A fix for the bug with:

delete from table where column<=>NULL 
on indexed columns
parent dd1b7e0c
......@@ -24,3 +24,9 @@ create table t1 (a bigint not null, primary key (a,a,a,a,a,a,a,a,a,a));
insert into t1 values (2),(4),(6),(8),(10),(12),(14),(16),(18),(20),(22),(24),(26),(23),(27);
delete from t1 where a=27;
drop table t1;
create table t1 (id int, index(id));
insert into t1 values(NULL);
delete from t1 where id <=> NULL;
select * from t1;
id
drop table if exists t1;
......@@ -35,3 +35,8 @@ create table t1 (a bigint not null, primary key (a,a,a,a,a,a,a,a,a,a));
insert into t1 values (2),(4),(6),(8),(10),(12),(14),(16),(18),(20),(22),(24),(26),(23),(27);
delete from t1 where a=27;
drop table t1;
create table t1 (id int, index(id));
insert into t1 values(NULL);
delete from t1 where id <=> NULL;
select * from t1;
drop table if exists t1;
......@@ -1024,7 +1024,7 @@ get_mm_leaf(PARAM *param, Field *field, KEY_PART *key_part,
field->cmp_type() != value->result_type())
DBUG_RETURN(0);
if (value->save_in_field(field))
if (value->save_in_field(field) || value->is_null())
{
// TODO; Check if we can we remove the following block.
if (type == Item_func::EQUAL_FUNC)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment