Support for Where 1

I got this error for queries with “WHERE 1 AND” construct. Will be nice to have feature:sunglasses:

SELECT * FROM ds_mysql.table where 1 and col = ‘some_val’

Hi @HLNA

This looks like a MySQL specific thing. Wondering why you need that filer? Can we just not do the below?

SELECT * FROM ds_mysql.table where col = ‘some_val’

@balaji.ramaswamy yes, it’s just a nice to have feature; btw, it’s available not just on mysql.

That SQL relies on an implicit conversion of the integer 1 to a boolean value of “true” which might work on some database platforms but not on others.

There’s no reason to include a condition that will always be true, but if you have to then it’s better to write this as either “WHERE true” or use a condition that evaluates to true, e.g. “WHERE 1 = 1”.