[WordPress] 外掛分享: TiDB Compatibility

首頁外掛目錄 › TiDB Compatibility
50+
安裝啟用
★★★★★
5/5 分(1 則評價)
218 天前
最後更新
問題解決
WordPress 4.7+ PHP 6.8.1+ v1.0.2 上架:2024-03-05

內容簡介

**總結:**
TiDB 是一個高性能數據庫,與 MySQL 協議相容。然而,由於 MySQL 已經淘汰 SQL_CALC_FOUND_ROWS 函數,因此 TiDB 也沒有提供該函數。這導致在 WordPress 使用 TiDB 時出現錯誤,指出 SQL_CALC_FOUND_ROWS 不受支援,提交無法正確顯示。目前 WordPress 團隊也在努力解決這個問題,但可能需要更多時間。

**問題與答案:**
- **問題:** 什麼是 TiDB?
- **答案:** TiDB 是一個高性能數據庫,兼容 MySQL 協議。

- **問題:** 為什麼在 WordPress 使用 TiDB 會出現錯誤?
- **答案:** 因為 MySQL 已經淘汰 SQL_CALC_FOUND_ROWS 函數,而 TiDB 也沒有提供該函數,導致 WordPress 顯示此錯誤。

- **問題:** 如何解決 TiDB 不提供 SQL_CALC_FOUND_ROWS 函數的問題?
- **答案:** 這個外掛解決了這個問題。一旦啟用此外掛,使用 SQL_CALC_FOUND_ROWS 的 WP_Query 部分將被替換為 COUNT(*) 函數。

- **問題:** 這個外掛的解決方法基於什麼?
- **答案:** 這個外掛完全基於 @akramipro 在文章中提到的方法,這個解決方案有效且解決了問題。作者把這個方法製作成外掛,讓使用 TiDB 的人可以輕鬆解決這個問題。感謝 @akramipro 的出色工作,希望官方 WordPress 團隊能儘快解決這個問題。

外掛標籤

開發者團隊

⬇ 下載最新版 (v1.0.2) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「TiDB Compatibility」→ 直接安裝(推薦)
📦 歷史版本下載

原文外掛簡介

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

延伸相關外掛

文章
Filter
Apply Filters
Mastodon