Automattic / HyperDB

HyperDB is an advanced database class that supports replication, failover, load balancing, and partitioning.
101 stars 22 forks source link

Support `SELECT DISTINCT SQL_CALC_FOUND_ROWS` #137

Open dd32 opened 1 year ago

dd32 commented 1 year ago

Fixes #136

The MariaDB SELECT format is...

SELECT
    [ALL | DISTINCT | DISTINCTROW]
    [HIGH_PRIORITY]
    [STRAIGHT_JOIN]
    [SQL_SMALL_RESULT] [SQL_BIG_RESULT] [SQL_BUFFER_RESULT]
    [SQL_CACHE | SQL_NO_CACHE] [SQL_CALC_FOUND_ROWS]
    select_expr [, select_expr ...]
    [ FROM [table_references](https://mariadb.com/kb/en/join-syntax/)

The current regular expression therefor doesn't match any of the other query modifiers either, but DISTINCT is AFAIK the only one that WordPress would be using.