Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MySQL FORCE INDEX query hints cause invalid SQL #333

Open
rmc47 opened this Issue Mar 15, 2019 · 0 comments

Comments

Projects
None yet
1 participant
@rmc47
Copy link
Contributor

rmc47 commented Mar 15, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.