跳到内容

TiDB Compatibility

v1.0.3

xuliwen · 2024年3月6日 上架

This plugin is an official tool provided by PingCAP, designed to solve compatibility issues between TiDB and WordPress.

正在使用
80+
评分
5.0 / 5
累计下载
3,756
最近更新
2026年11月2日
1 条评价需要 WordPress 4.7+已测试到 6.8.13PHP 7.0+

贡献者

TiDB is a high-performance database that is compatible with the MySQL protocol. Since MySQL has deprecated the SQL_CALC_FOUND_ROWS function, TiDB also has no intention of offering the SQL_CALC_FOUND_ROWS function. This leads to an error in WordPress when using TiDB, indicating that SQL_CALC_FOUND_ROWS is not supported, and submissions cannot be displayed correctly.

WordPress is also currently working on this issue, but it seems that more time is needed. #47280 Remove usage of deprecated MySQL SQL_CALC_FOUND_ROWS from WP_Query

This plugin solves the issue of TiDB not providing the SQL_CALC_FOUND_ROWS function. Once this plugin is activated, parts of WP_Query that use SQL_CALC_FOUND_ROWS will be replaced with the COUNT(*) function.

This plugin is entirely based on the method mentioned by @akramipro in the article, and this solution works perfectly and addresses the issue. I’ve turned this method into a plugin so that those using TiDB can easily resolve this problem. Many thanks to @akramipro for the excellent work, and I hope the official WordPress team can address this issue sooner.

Configuration

The plugin only rewrites queries when the database server reports itself as TiDB.

  • Define WTC_DISABLE as true in wp-config.php to switch the rewrite off.
  • Use the tidb_compatibility_enabled filter (from a plugin or must-use plugin, not a theme) to override the TiDB detection.
  • With WP_DEBUG enabled, the plugin logs to the PHP error log when it is inactive, when it keeps the core count query, and when its count query fails. Activation and deactivation are always logged.

Contribute

Contribute to this plugin on github.com/pingcap/wordpress-tidb-plugin

Plums

按场景查找 WordPress 插件。安装量、评分和兼容版本来自官方目录。

导航

说明

WordPress 是 WordPress Foundation 的商标。本站与 WordPress Foundation、Automattic 没有隶属关系。这里不托管插件文件,下载和安装以 WordPress.org 上的页面为准。

© 2026 Plums