projectnami
projectnami copied to clipboard
MySQL FORCE INDEX query hints cause invalid SQL
bbPress uses a MySQL query hint in its WHERE clause filter: https://bbpress.trac.wordpress.org/browser/trunk/src/includes/replies/functions.php#L2042
This generates a query like SELECT col FROM foo FORCE INDEX (PRIMARY, col) WHERE..., which is invalid T-SQL.
While T-SQL does have query hints, it's probably not a simple translation to use them since they're index-name-based rather than column-based, so it's probably simplest just to strip the hints from the query.