-
Notifications
You must be signed in to change notification settings - Fork 7
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
Fixes typo in the ORDER BY
clause in a user query.
#97
Conversation
`$args['orderby']` was used twice. The second time should have been `$args['order']`.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before:
SELECT SQL_CALC_FOUND_ROWS ID FROM wp_users ORDER BY 'ID' 'ID' LIMIT 0, 350
(vitess not a fan)
After:
SELECT SQL_CALC_FOUND_ROWS ID FROM wp_users ORDER BY 'ID' 'asc' LIMIT 0, 350
(vitess still not a fan because of quotes around asc
>.<)
Previously, the order by direction was quoted: `ORDER BY 'ID' 'desc'` and Vitess didn't like that. This passes the `ORDER BY` clause through `sanitize_sql_orderby()`, and if that doesn't return `false`, sets up the clause. We then use that directly in the SQL statement.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Vitess approves now :)
Description
One of the users queries contained a typo. The
$args['orderby']
was used twice instead of using$args['order']
for the second arg. This resulted in theORDER BY
clause beingORDER BY 'ID' 'ID'
.Checklist
Please make sure the items below have been covered before requesting a review: