← Back to team overview

drizzle-discuss team mailing list archive

Where clause with non-Boolean

 

Hi All,
during the testing, found that Where clause is accepting non-booleans.
for example.

select * from tablename where 1;
select * from tablename where columnname;

in other planets it is illegal. and citizens uses loopholes like:
create table x as select * from y where 1=2;
to get a empty table x with same structure as y.

Don't know it is MySQL ism or expected behaviour.

i noticed it because a typo like this :
delete from emp where id-2;
cleaned up my table. :(

Thank you,
Jobin.

Follow ups