Am I missing something obvious, or is this bug...
should be opposites.
However, the following SQL script shows this not to be the case:
The second select should return "6" not "5".
Note that the third select is logically identical to the second select according to DeMorgan's Law. And it returns "6", correctly.
Code:
(data = 15 and data is not null)
not (data = 15 and data is not null)
However, the following SQL script shows this not to be the case:
Code:
drop table if exists bugtest;
create table bugtest (id int not null auto_increment primary key,data smallint);
insert into bugtest values (NULL,10);
insert into bugtest values (NULL,20);
insert into bugtest values (NULL,30);
insert into bugtest values (NULL,40);
insert into bugtest values (NULL,50);
insert into bugtest values (NULL,NULL);
select * from bugtest;
select count(*) from bugtest where (data = 15 and data is not null);
select count(*) from bugtest where not (data = 15 and data is not null);
select count(*) from bugtest where (data <> 15 or data is null);
drop table bugtest;
Note that the third select is logically identical to the second select according to DeMorgan's Law. And it returns "6", correctly.