Validation of bool for WHERE clause might be unnecessary
tatulea opened this issue · comments
There are SQL queries that don't have a bool type in the where clause (e.g.: the usage of JSON_CONTAINS_PATH).
sqlvalidator/sqlvalidator/grammar/sql.py
Line 250 in 6b87323
Hi @tatulea, thanks for opening an issue :)
mysql/MariaDB indeed supports WHERE conditions on other column types than boolean. Good catch, thanks for reporting it.
I based myself on postgresql, where the condition is stricter:
ERROR: argument of WHERE must be type boolean, not type integer
LINE 1: select * from sometable where id;
I'll probably make the validation a bit more permissive for now (even though the validation is only partly implemented)