BACK TO DIRECTORY

TiDB Compatibility

by xuliwen

5.0
(1 ratings)

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.

Contribute

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

Plugin Details

Active Installs
70
Total Downloads
2,049
Version
1.0.2
Requires WP
4.7
Requires PHP
6.8.1
Tested Up To
6.8.8
Added
2024-03-06
Last Updated
2025-08-11 8:23am GMT

Ratings

5
1
4
0
3
0
2
0
1
0