You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When writing a query with a NOT in the WHERE clause, the result seems to indicate that the precedence grouping in the query is incorrect, as it appears to group a NOT with just the column name not the full expression when not using parenthesis.
Reproducible with: alasql('SELECT a FROM ? WHERE NOT id = 2', [[{id:2,a:123},{id:1,a:null}]])
(no results)
vs alasql('SELECT a FROM ? WHERE NOT (id = 2)', [[{id:2,a:123},{id:1,a:null}]])
(1 result, as expected)
Activity
agershun commentedon Aug 10, 2015
@workmad3 Thank you for the note. It is so, because we place NOT with higher priority than
=.I just checked SQL standards and some realizations (e.g. Transact SQL, MySQL. You are right, we need to fix it.
mathiasrw commentedon Aug 10, 2015
Thank you for taking the time to investigate and describe the issue.
@agershun Could this be the same cause as issue #368 ?
agershun commentedon Aug 10, 2015
I fixed it. See the version in
developbranch.workmad3 commentedon Aug 10, 2015
@agershun Seems good in my initial testing, just going to ask some of my users to test the change as well. Thanks for the quick fix!
workmad3 commentedon Aug 10, 2015
My users just confirmed the fix works as expected too, and pass on their thanks!
Closing this issue.