mindsdb / mindsdb_sql

SQL parser and planner used by MindsDB
https://mindsdb.com
GNU General Public License v3.0
55 stars 21 forks source link

Bug: wrong priority in parsing 'not in' #384

Closed ea-rus closed 3 months ago

ea-rus commented 3 months ago

This query:

 SELECT *
 FROM table1 
 WHERE a = 1 AND b NOT IN (1,2)

is parsed with wrong operators priority:

 SELECT *
 FROM table1 
 WHERE (a = 1 AND b) NOT IN (1,2)

the proper way:

 SELECT *
 FROM table1 
 WHERE (a = 1) AND (b NOT IN (1,2))