How to avoid `LOWER` in `in` mysql statement
magicdawn opened this issue · 3 comments
example I have
Model.find({
field: [val1, val2]
})
results
SELECT xxx FROM TB_FOO WHERE LOWER(TB_FOO.field) in [val1, val2]
the LOWER(TB_FOO.field)
will cause the index on field
column not working
How to get rid of the LOWER
?
@magicdawn Thanks for posting, we'll take a look as soon as possible. In the meantime, if you haven’t already, please carefully read the issue contribution guidelines and double-check for any missing information above. In particular, please ensure that this issue is about a stability or performance bug with a documented feature; and make sure you’ve included detailed instructions on how to reproduce the bug from a clean install. Finally, don’t forget to include the version of Node.js you tested with, as well as your version of Sails or Waterline, and of any relevant standalone adapters/generators/hooks.
Thank you!
For help with questions about Sails, click here. If you’re interested in hiring @sailsbot and her Austin-based minions, click here.
@magicdawn,@sailsbot: Hello, I'm a repo bot-- nice to meet you!
It has been 30 days since there have been any updates or new comments on this page. If this issue has been resolved, feel free to disregard the rest of this message and simply close the issue if possible. On the other hand, if you are still waiting on a patch, please post a comment to keep the thread alive (with any new information you can provide).
If no further activity occurs on this thread within the next 3 days, the issue will automatically be closed.
Thanks so much for your help!
just use Model.query(sql)