mirror of
https://github.com/MariaDB/server.git
synced 2025-01-19 13:32:33 +01:00
59b3711986
optimization of left expression evaluation more descriptive method name mysql-test/r/func_in.result: test of _NEW_ IN behaviour with NULL mysql-test/r/subselect.result: test of _NEW_ IN/ALL/ANY/SOME behaviour with NULL mysql-test/t/func_in.test: test of _NEW_ IN behaviour with NULL mysql-test/t/subselect.test: test of _NEW_ IN/ALL/ANY/SOME behaviour with NULL sql/item.cc: _NEW_ IN/ALL/ANY/SOME behaviour with NULL optimization of left expression evaluation sql/item.h: _NEW_ IN/ALL/ANY/SOME behaviour with NULL optimization of left expression evaluation sql/item_cmpfunc.cc: _NEW_ IN/ALL/ANY/SOME behaviour with NULL optimization of left expression evaluation sql/item_cmpfunc.h: _NEW_ IN/ALL/ANY/SOME behaviour with NULL optimization of left expression evaluation sql/item_subselect.cc: _NEW_ IN/ALL/ANY/SOME behaviour with NULL optimization of left expression evaluation sql/item_subselect.h: _NEW_ IN/ALL/ANY/SOME behaviour with NULL optimization of left expression evaluation sql/sql_class.cc: more descriptive method name sql/sql_union.cc: more descriptive method name
113 lines
1.9 KiB
Text
113 lines
1.9 KiB
Text
select 1 in (1,2,3);
|
|
1 in (1,2,3)
|
|
1
|
|
select 10 in (1,2,3);
|
|
10 in (1,2,3)
|
|
0
|
|
select NULL in (1,2,3);
|
|
NULL in (1,2,3)
|
|
NULL
|
|
select 1 in (1,NULL,3);
|
|
1 in (1,NULL,3)
|
|
1
|
|
select 3 in (1,NULL,3);
|
|
3 in (1,NULL,3)
|
|
1
|
|
select 10 in (1,NULL,3);
|
|
10 in (1,NULL,3)
|
|
NULL
|
|
select 1.5 in (1.5,2.5,3.5);
|
|
1.5 in (1.5,2.5,3.5)
|
|
1
|
|
select 10.5 in (1.5,2.5,3.5);
|
|
10.5 in (1.5,2.5,3.5)
|
|
0
|
|
select NULL in (1.5,2.5,3.5);
|
|
NULL in (1.5,2.5,3.5)
|
|
NULL
|
|
select 1.5 in (1.5,NULL,3.5);
|
|
1.5 in (1.5,NULL,3.5)
|
|
1
|
|
select 3.5 in (1.5,NULL,3.5);
|
|
3.5 in (1.5,NULL,3.5)
|
|
1
|
|
select 10.5 in (1.5,NULL,3.5);
|
|
10.5 in (1.5,NULL,3.5)
|
|
NULL
|
|
drop table if exists t1;
|
|
CREATE TABLE t1 (a int, b int, c int);
|
|
insert into t1 values (1,2,3), (1,NULL,3);
|
|
select 1 in (a,b,c) from t1;
|
|
1 in (a,b,c)
|
|
1
|
|
1
|
|
select 3 in (a,b,c) from t1;
|
|
3 in (a,b,c)
|
|
1
|
|
1
|
|
select 10 in (a,b,c) from t1;
|
|
10 in (a,b,c)
|
|
0
|
|
NULL
|
|
select NULL in (a,b,c) from t1;
|
|
NULL in (a,b,c)
|
|
NULL
|
|
NULL
|
|
drop table t1;
|
|
CREATE TABLE t1 (a float, b float, c float);
|
|
insert into t1 values (1.5,2.5,3.5), (1.5,NULL,3.5);
|
|
select 1.5 in (a,b,c) from t1;
|
|
1.5 in (a,b,c)
|
|
1
|
|
1
|
|
select 3.5 in (a,b,c) from t1;
|
|
3.5 in (a,b,c)
|
|
1
|
|
1
|
|
select 10.5 in (a,b,c) from t1;
|
|
10.5 in (a,b,c)
|
|
0
|
|
NULL
|
|
drop table t1;
|
|
CREATE TABLE t1 (a varchar(10), b varchar(10), c varchar(10));
|
|
insert into t1 values ('A','BC','EFD'), ('A',NULL,'EFD');
|
|
select 'A' in (a,b,c) from t1;
|
|
'A' in (a,b,c)
|
|
1
|
|
1
|
|
select 'EFD' in (a,b,c) from t1;
|
|
'EFD' in (a,b,c)
|
|
1
|
|
1
|
|
select 'XSFGGHF' in (a,b,c) from t1;
|
|
'XSFGGHF' in (a,b,c)
|
|
0
|
|
NULL
|
|
drop table t1;
|
|
CREATE TABLE t1 (field char(1));
|
|
INSERT INTO t1 VALUES ('A'),(NULL);
|
|
SELECT * from t1 WHERE field IN (NULL);
|
|
field
|
|
SELECT * from t1 WHERE field NOT IN (NULL);
|
|
field
|
|
SELECT * from t1 where field = field;
|
|
field
|
|
A
|
|
SELECT * from t1 where field <=> field;
|
|
field
|
|
A
|
|
NULL
|
|
DELETE FROM t1 WHERE field NOT IN (NULL);
|
|
SELECT * FROM t1;
|
|
field
|
|
A
|
|
NULL
|
|
drop table t1;
|
|
create table t1 (id int(10) primary key);
|
|
insert into t1 values (1),(2),(3),(4),(5),(6),(7),(8),(9);
|
|
select * from t1 where id in (2,5,9);
|
|
id
|
|
2
|
|
5
|
|
9
|
|
drop table t1;
|