-
Notifications
You must be signed in to change notification settings - Fork 22
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
Backticks added to values in ORDER BY FIELD() #60
Comments
Hi. The good news is that this is not caused by cortex itself, because it does not do anything with the order by clause, but the underlying SQL mapper does a false guess here. array('order' => 'FIELD(`id`, 1, 2, 3)') When you add your own backticks here, the auto-quoting is disabled and everything should work fine. Nevertheless I'm looking into a more generic preparation of the order clause in cortex to mitigate future issues like that. |
@brucecastro With the latest commit, ordering fields are now automatically quoted. If it does detect already quoted fields, it'll skip this process. Hope this works fine ;) |
Thank you very much! |
Hello,
First off, thanks for your work on this library!
I am running into an issue after updating to the latest version. I was previously using version 1.3, which did not have this issue. Running the following query:
Results in the following error:
Because the underlying SQL Query is:
Notice how backticks are being added to the values within the FIELD function, making MySQL think those are field names.
The text was updated successfully, but these errors were encountered: