mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 03:52:35 +01:00
Test case backport for: Bug#42580 - Innodb's ORDER BY ..LIMIT returns no rows for null-safe operator <=> NULL
This commit is contained in:
parent
71be71da15
commit
d0535d80a1
7 changed files with 157 additions and 0 deletions
29
mysql-test/include/icp_tests.inc
Normal file
29
mysql-test/include/icp_tests.inc
Normal file
|
@ -0,0 +1,29 @@
|
|||
--echo #
|
||||
--echo # Bug#42580 - Innodb's ORDER BY ..LIMIT returns no rows for
|
||||
--echo # null-safe operator <=> NULL
|
||||
--echo #
|
||||
|
||||
CREATE TABLE t1(
|
||||
c1 DATE NOT NULL,
|
||||
c2 DATE NULL,
|
||||
c3 DATETIME,
|
||||
c4 TIMESTAMP,
|
||||
PRIMARY KEY(c1),
|
||||
UNIQUE(c2)
|
||||
);
|
||||
|
||||
--echo
|
||||
INSERT INTO t1 VALUES('0000-00-00', '0000-00-00', '2008-01-04', '2008-01-05');
|
||||
INSERT INTO t1 VALUES('2007-05-25', '2007-05-25', '2007-05-26', '2007-05-26');
|
||||
INSERT INTO t1 VALUES('2008-01-01', NULL , '2008-01-02', '2008-01-03');
|
||||
INSERT INTO t1 VALUES('2008-01-17', NULL , NULL , '2009-01-29');
|
||||
INSERT INTO t1 VALUES('2009-01-29', '2009-01-29', '2009-01-29', '2009-01-29');
|
||||
|
||||
--echo
|
||||
SELECT * FROM t1 WHERE c2 <=> NULL ORDER BY c1,c2;
|
||||
--echo
|
||||
SELECT * FROM t1 WHERE c2 <=> NULL ORDER BY c1,c2 LIMIT 2;
|
||||
|
||||
--echo
|
||||
DROP TABLE t1;
|
||||
|
33
mysql-test/r/innodb_icp.result
Normal file
33
mysql-test/r/innodb_icp.result
Normal file
|
@ -0,0 +1,33 @@
|
|||
set @save_storage_engine= @@storage_engine;
|
||||
set storage_engine=InnoDB;
|
||||
#
|
||||
# Bug#42580 - Innodb's ORDER BY ..LIMIT returns no rows for
|
||||
# null-safe operator <=> NULL
|
||||
#
|
||||
CREATE TABLE t1(
|
||||
c1 DATE NOT NULL,
|
||||
c2 DATE NULL,
|
||||
c3 DATETIME,
|
||||
c4 TIMESTAMP,
|
||||
PRIMARY KEY(c1),
|
||||
UNIQUE(c2)
|
||||
);
|
||||
|
||||
INSERT INTO t1 VALUES('0000-00-00', '0000-00-00', '2008-01-04', '2008-01-05');
|
||||
INSERT INTO t1 VALUES('2007-05-25', '2007-05-25', '2007-05-26', '2007-05-26');
|
||||
INSERT INTO t1 VALUES('2008-01-01', NULL , '2008-01-02', '2008-01-03');
|
||||
INSERT INTO t1 VALUES('2008-01-17', NULL , NULL , '2009-01-29');
|
||||
INSERT INTO t1 VALUES('2009-01-29', '2009-01-29', '2009-01-29', '2009-01-29');
|
||||
|
||||
SELECT * FROM t1 WHERE c2 <=> NULL ORDER BY c1,c2;
|
||||
c1 c2 c3 c4
|
||||
2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00
|
||||
2008-01-17 NULL NULL 2009-01-29 00:00:00
|
||||
|
||||
SELECT * FROM t1 WHERE c2 <=> NULL ORDER BY c1,c2 LIMIT 2;
|
||||
c1 c2 c3 c4
|
||||
2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00
|
||||
2008-01-17 NULL NULL 2009-01-29 00:00:00
|
||||
|
||||
DROP TABLE t1;
|
||||
set storage_engine= @save_storage_engine;
|
33
mysql-test/r/maria_icp.result
Normal file
33
mysql-test/r/maria_icp.result
Normal file
|
@ -0,0 +1,33 @@
|
|||
set @save_storage_engine= @@storage_engine;
|
||||
set storage_engine=Maria;
|
||||
#
|
||||
# Bug#42580 - Innodb's ORDER BY ..LIMIT returns no rows for
|
||||
# null-safe operator <=> NULL
|
||||
#
|
||||
CREATE TABLE t1(
|
||||
c1 DATE NOT NULL,
|
||||
c2 DATE NULL,
|
||||
c3 DATETIME,
|
||||
c4 TIMESTAMP,
|
||||
PRIMARY KEY(c1),
|
||||
UNIQUE(c2)
|
||||
);
|
||||
|
||||
INSERT INTO t1 VALUES('0000-00-00', '0000-00-00', '2008-01-04', '2008-01-05');
|
||||
INSERT INTO t1 VALUES('2007-05-25', '2007-05-25', '2007-05-26', '2007-05-26');
|
||||
INSERT INTO t1 VALUES('2008-01-01', NULL , '2008-01-02', '2008-01-03');
|
||||
INSERT INTO t1 VALUES('2008-01-17', NULL , NULL , '2009-01-29');
|
||||
INSERT INTO t1 VALUES('2009-01-29', '2009-01-29', '2009-01-29', '2009-01-29');
|
||||
|
||||
SELECT * FROM t1 WHERE c2 <=> NULL ORDER BY c1,c2;
|
||||
c1 c2 c3 c4
|
||||
2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00
|
||||
2008-01-17 NULL NULL 2009-01-29 00:00:00
|
||||
|
||||
SELECT * FROM t1 WHERE c2 <=> NULL ORDER BY c1,c2 LIMIT 2;
|
||||
c1 c2 c3 c4
|
||||
2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00
|
||||
2008-01-17 NULL NULL 2009-01-29 00:00:00
|
||||
|
||||
DROP TABLE t1;
|
||||
set storage_engine= @save_storage_engine;
|
30
mysql-test/r/myisam_icp.result
Normal file
30
mysql-test/r/myisam_icp.result
Normal file
|
@ -0,0 +1,30 @@
|
|||
#
|
||||
# Bug#42580 - Innodb's ORDER BY ..LIMIT returns no rows for
|
||||
# null-safe operator <=> NULL
|
||||
#
|
||||
CREATE TABLE t1(
|
||||
c1 DATE NOT NULL,
|
||||
c2 DATE NULL,
|
||||
c3 DATETIME,
|
||||
c4 TIMESTAMP,
|
||||
PRIMARY KEY(c1),
|
||||
UNIQUE(c2)
|
||||
);
|
||||
|
||||
INSERT INTO t1 VALUES('0000-00-00', '0000-00-00', '2008-01-04', '2008-01-05');
|
||||
INSERT INTO t1 VALUES('2007-05-25', '2007-05-25', '2007-05-26', '2007-05-26');
|
||||
INSERT INTO t1 VALUES('2008-01-01', NULL , '2008-01-02', '2008-01-03');
|
||||
INSERT INTO t1 VALUES('2008-01-17', NULL , NULL , '2009-01-29');
|
||||
INSERT INTO t1 VALUES('2009-01-29', '2009-01-29', '2009-01-29', '2009-01-29');
|
||||
|
||||
SELECT * FROM t1 WHERE c2 <=> NULL ORDER BY c1,c2;
|
||||
c1 c2 c3 c4
|
||||
2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00
|
||||
2008-01-17 NULL NULL 2009-01-29 00:00:00
|
||||
|
||||
SELECT * FROM t1 WHERE c2 <=> NULL ORDER BY c1,c2 LIMIT 2;
|
||||
c1 c2 c3 c4
|
||||
2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00
|
||||
2008-01-17 NULL NULL 2009-01-29 00:00:00
|
||||
|
||||
DROP TABLE t1;
|
13
mysql-test/t/innodb_icp.test
Normal file
13
mysql-test/t/innodb_icp.test
Normal file
|
@ -0,0 +1,13 @@
|
|||
#
|
||||
# ICP/InnoDB tests (Index Condition Pushdown)
|
||||
#
|
||||
|
||||
--source include/have_innodb.inc
|
||||
|
||||
set @save_storage_engine= @@storage_engine;
|
||||
set storage_engine=InnoDB;
|
||||
|
||||
--source include/icp_tests.inc
|
||||
|
||||
set storage_engine= @save_storage_engine;
|
||||
|
13
mysql-test/t/maria_icp.test
Normal file
13
mysql-test/t/maria_icp.test
Normal file
|
@ -0,0 +1,13 @@
|
|||
#
|
||||
# ICP/Maria tests (Index Condition Pushdown)
|
||||
#
|
||||
|
||||
--source include/have_maria.inc
|
||||
|
||||
set @save_storage_engine= @@storage_engine;
|
||||
set storage_engine=Maria;
|
||||
|
||||
--source include/icp_tests.inc
|
||||
|
||||
set storage_engine= @save_storage_engine;
|
||||
|
6
mysql-test/t/myisam_icp.test
Normal file
6
mysql-test/t/myisam_icp.test
Normal file
|
@ -0,0 +1,6 @@
|
|||
#
|
||||
# ICP/MyISAM tests (Index Condition Pushdown)
|
||||
#
|
||||
|
||||
--source include/icp_tests.inc
|
||||
|
Loading…
Reference in a new issue