Bug #355 DELETE FROM test WHERE NULL deletes all rows for MyISAM tables.
Submitted: 1 May 2003 7:47 Modified: 3 May 2003 11:20
Reporter: Peter Zaitsev (Basic Quality Contributor)
Status: Closed
Category:Server Severity:S1 (Critical)
Version:4.0.13 OS:Any (All)
Assigned to: Target Version:

[1 May 2003 7:47] Peter Zaitsev
Description:
DELETE FROM test WHERE NULL deletes all rows if test is MyISAM table but none 
if it is Innodb table. On other hand  SELECT * FROM test WHERE NULL returns no rows.

The same applies to any where clause which evaluates to NULL

How to repeat:
create table test(i int) type=MYISAM;
insert into test values (1);
select * from test where NULL;
delete from test where NULL;
select * from test;
[3 May 2003 10:17] Peter Zaitsev
I've tested similar bug report and discovered what bug happens even with this 
statements:

delete from test where 0;
delete from test where "1"="2";
delete from test where 1=2

Which makes bug even worse. 

It happens only with constant where clause.
[3 May 2003 11:20] Sergei Golubchik
fixed