mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Backported the fix and the test case for bug 12822678 from the mysql-5.6 code line.
Fixed a bug in select_describe. Adjusted results for affected test cases.
This commit is contained in:
@ -614,6 +614,32 @@ SELECT col999 FROM t1 WHERE col1000 = "3" AND col1003 <=> sysdate();
|
||||
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # BUG#12822678 - ICP WITH STRAIGHT_JOIN
|
||||
--echo #
|
||||
|
||||
CREATE TABLE t1 (
|
||||
i1 INTEGER NOT NULL,
|
||||
d1 DOUBLE,
|
||||
KEY k1 (d1)
|
||||
);
|
||||
INSERT INTO t1 VALUES (10,1), (17,NULL), (22,NULL);
|
||||
|
||||
CREATE TABLE t2 (
|
||||
pk INTEGER NOT NULL,
|
||||
i1 INTEGER NOT NULL,
|
||||
PRIMARY KEY (pk)
|
||||
);
|
||||
INSERT INTO t2 VALUES (4,1);
|
||||
|
||||
EXPLAIN
|
||||
SELECT t1.d1, t2.pk, t2.i1 FROM t1 STRAIGHT_JOIN t2 ON t2.i1
|
||||
WHERE t2.pk <> t1.d1 AND t2.pk = 4;
|
||||
SELECT t1.d1, t2.pk, t2.i1 FROM t1 STRAIGHT_JOIN t2 ON t2.i1
|
||||
WHERE t2.pk <> t1.d1 AND t2.pk = 4;
|
||||
|
||||
DROP TABLE t1, t2;
|
||||
|
||||
--echo #
|
||||
--echo # BUG#778434 Wrong result with in_to_exists=on in maria-5.3-mwl89
|
||||
--echo #
|
||||
|
@ -575,6 +575,32 @@ SELECT col999 FROM t1 WHERE col1000 = "3" AND col1003 <=> sysdate();
|
||||
col999
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# BUG#12822678 - ICP WITH STRAIGHT_JOIN
|
||||
#
|
||||
CREATE TABLE t1 (
|
||||
i1 INTEGER NOT NULL,
|
||||
d1 DOUBLE,
|
||||
KEY k1 (d1)
|
||||
);
|
||||
INSERT INTO t1 VALUES (10,1), (17,NULL), (22,NULL);
|
||||
CREATE TABLE t2 (
|
||||
pk INTEGER NOT NULL,
|
||||
i1 INTEGER NOT NULL,
|
||||
PRIMARY KEY (pk)
|
||||
);
|
||||
INSERT INTO t2 VALUES (4,1);
|
||||
EXPLAIN
|
||||
SELECT t1.d1, t2.pk, t2.i1 FROM t1 STRAIGHT_JOIN t2 ON t2.i1
|
||||
WHERE t2.pk <> t1.d1 AND t2.pk = 4;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 index NULL k1 9 NULL 3 Using index
|
||||
1 SIMPLE t2 const PRIMARY PRIMARY 4 const 1 Using where
|
||||
SELECT t1.d1, t2.pk, t2.i1 FROM t1 STRAIGHT_JOIN t2 ON t2.i1
|
||||
WHERE t2.pk <> t1.d1 AND t2.pk = 4;
|
||||
d1 pk i1
|
||||
1 4 1
|
||||
DROP TABLE t1, t2;
|
||||
#
|
||||
# BUG#778434 Wrong result with in_to_exists=on in maria-5.3-mwl89
|
||||
#
|
||||
CREATE TABLE t1 ( f11 int) ;
|
||||
|
@ -581,6 +581,32 @@ SELECT col999 FROM t1 WHERE col1000 = "3" AND col1003 <=> sysdate();
|
||||
col999
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# BUG#12822678 - ICP WITH STRAIGHT_JOIN
|
||||
#
|
||||
CREATE TABLE t1 (
|
||||
i1 INTEGER NOT NULL,
|
||||
d1 DOUBLE,
|
||||
KEY k1 (d1)
|
||||
);
|
||||
INSERT INTO t1 VALUES (10,1), (17,NULL), (22,NULL);
|
||||
CREATE TABLE t2 (
|
||||
pk INTEGER NOT NULL,
|
||||
i1 INTEGER NOT NULL,
|
||||
PRIMARY KEY (pk)
|
||||
);
|
||||
INSERT INTO t2 VALUES (4,1);
|
||||
EXPLAIN
|
||||
SELECT t1.d1, t2.pk, t2.i1 FROM t1 STRAIGHT_JOIN t2 ON t2.i1
|
||||
WHERE t2.pk <> t1.d1 AND t2.pk = 4;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 index NULL k1 9 NULL 3 Using index
|
||||
1 SIMPLE t2 const PRIMARY PRIMARY 4 const 1 Using where
|
||||
SELECT t1.d1, t2.pk, t2.i1 FROM t1 STRAIGHT_JOIN t2 ON t2.i1
|
||||
WHERE t2.pk <> t1.d1 AND t2.pk = 4;
|
||||
d1 pk i1
|
||||
1 4 1
|
||||
DROP TABLE t1, t2;
|
||||
#
|
||||
# BUG#778434 Wrong result with in_to_exists=on in maria-5.3-mwl89
|
||||
#
|
||||
CREATE TABLE t1 ( f11 int) ;
|
||||
|
@ -579,6 +579,32 @@ SELECT col999 FROM t1 WHERE col1000 = "3" AND col1003 <=> sysdate();
|
||||
col999
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# BUG#12822678 - ICP WITH STRAIGHT_JOIN
|
||||
#
|
||||
CREATE TABLE t1 (
|
||||
i1 INTEGER NOT NULL,
|
||||
d1 DOUBLE,
|
||||
KEY k1 (d1)
|
||||
);
|
||||
INSERT INTO t1 VALUES (10,1), (17,NULL), (22,NULL);
|
||||
CREATE TABLE t2 (
|
||||
pk INTEGER NOT NULL,
|
||||
i1 INTEGER NOT NULL,
|
||||
PRIMARY KEY (pk)
|
||||
);
|
||||
INSERT INTO t2 VALUES (4,1);
|
||||
EXPLAIN
|
||||
SELECT t1.d1, t2.pk, t2.i1 FROM t1 STRAIGHT_JOIN t2 ON t2.i1
|
||||
WHERE t2.pk <> t1.d1 AND t2.pk = 4;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 index NULL k1 9 NULL 3 Using index
|
||||
1 SIMPLE t2 const PRIMARY PRIMARY 4 const 1 Using where
|
||||
SELECT t1.d1, t2.pk, t2.i1 FROM t1 STRAIGHT_JOIN t2 ON t2.i1
|
||||
WHERE t2.pk <> t1.d1 AND t2.pk = 4;
|
||||
d1 pk i1
|
||||
1 4 1
|
||||
DROP TABLE t1, t2;
|
||||
#
|
||||
# BUG#778434 Wrong result with in_to_exists=on in maria-5.3-mwl89
|
||||
#
|
||||
CREATE TABLE t1 ( f11 int) ;
|
||||
|
@ -369,7 +369,7 @@ EXPLAIN EXTENDED SELECT pseudo,(SELECT email FROM t8 WHERE pseudo=(SELECT pseudo
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 PRIMARY t8 const PRIMARY PRIMARY 37 const 1 100.00 Using where; Using index
|
||||
4 SUBQUERY t8 const PRIMARY PRIMARY 37 const 1 100.00 Using index
|
||||
2 SUBQUERY t8 const PRIMARY PRIMARY 37 const 1 100.00 Using index condition
|
||||
2 SUBQUERY t8 const PRIMARY PRIMARY 37 const 1 100.00 Using where
|
||||
3 SUBQUERY t8 const PRIMARY PRIMARY 37 const 1 100.00 Using index
|
||||
Warnings:
|
||||
Note 1003 select `test`.`t8`.`pseudo` AS `pseudo`,(select `test`.`t8`.`email` from `test`.`t8` where (`test`.`t8`.`pseudo` = (select 'joce' from `test`.`t8` where 1))) AS `(SELECT email FROM t8 WHERE pseudo=(SELECT pseudo FROM t8 WHERE pseudo='joce'))` from `test`.`t8` where (`test`.`t8`.`pseudo` = (select 'joce' from `test`.`t8` where 1))
|
||||
|
@ -374,7 +374,7 @@ EXPLAIN EXTENDED SELECT pseudo,(SELECT email FROM t8 WHERE pseudo=(SELECT pseudo
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 PRIMARY t8 const PRIMARY PRIMARY 37 const 1 100.00 Using where; Using index
|
||||
4 SUBQUERY t8 const PRIMARY PRIMARY 37 const 1 100.00 Using index
|
||||
2 SUBQUERY t8 const PRIMARY PRIMARY 37 const 1 100.00 Using index condition
|
||||
2 SUBQUERY t8 const PRIMARY PRIMARY 37 const 1 100.00 Using where
|
||||
3 SUBQUERY t8 const PRIMARY PRIMARY 37 const 1 100.00 Using index
|
||||
Warnings:
|
||||
Note 1003 select `test`.`t8`.`pseudo` AS `pseudo`,(select `test`.`t8`.`email` from `test`.`t8` where (`test`.`t8`.`pseudo` = (select 'joce' from `test`.`t8` where 1))) AS `(SELECT email FROM t8 WHERE pseudo=(SELECT pseudo FROM t8 WHERE pseudo='joce'))` from `test`.`t8` where (`test`.`t8`.`pseudo` = (select 'joce' from `test`.`t8` where 1))
|
||||
|
@ -370,7 +370,7 @@ EXPLAIN EXTENDED SELECT pseudo,(SELECT email FROM t8 WHERE pseudo=(SELECT pseudo
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 PRIMARY t8 const PRIMARY PRIMARY 37 const 1 100.00 Using where; Using index
|
||||
4 SUBQUERY t8 const PRIMARY PRIMARY 37 const 1 100.00 Using index
|
||||
2 SUBQUERY t8 const PRIMARY PRIMARY 37 const 1 100.00 Using index condition
|
||||
2 SUBQUERY t8 const PRIMARY PRIMARY 37 const 1 100.00 Using where
|
||||
3 SUBQUERY t8 const PRIMARY PRIMARY 37 const 1 100.00 Using index
|
||||
Warnings:
|
||||
Note 1003 select `test`.`t8`.`pseudo` AS `pseudo`,(select `test`.`t8`.`email` from `test`.`t8` where (`test`.`t8`.`pseudo` = (select 'joce' from `test`.`t8` where 1))) AS `(SELECT email FROM t8 WHERE pseudo=(SELECT pseudo FROM t8 WHERE pseudo='joce'))` from `test`.`t8` where (`test`.`t8`.`pseudo` = (select 'joce' from `test`.`t8` where 1))
|
||||
|
@ -373,7 +373,7 @@ EXPLAIN EXTENDED SELECT pseudo,(SELECT email FROM t8 WHERE pseudo=(SELECT pseudo
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 PRIMARY t8 const PRIMARY PRIMARY 37 const 1 100.00 Using where; Using index
|
||||
4 SUBQUERY t8 const PRIMARY PRIMARY 37 const 1 100.00 Using index
|
||||
2 SUBQUERY t8 const PRIMARY PRIMARY 37 const 1 100.00 Using index condition
|
||||
2 SUBQUERY t8 const PRIMARY PRIMARY 37 const 1 100.00 Using where
|
||||
3 SUBQUERY t8 const PRIMARY PRIMARY 37 const 1 100.00 Using index
|
||||
Warnings:
|
||||
Note 1003 select `test`.`t8`.`pseudo` AS `pseudo`,(select `test`.`t8`.`email` from `test`.`t8` where (`test`.`t8`.`pseudo` = (select 'joce' from `test`.`t8` where 1))) AS `(SELECT email FROM t8 WHERE pseudo=(SELECT pseudo FROM t8 WHERE pseudo='joce'))` from `test`.`t8` where (`test`.`t8`.`pseudo` = (select 'joce' from `test`.`t8` where 1))
|
||||
|
@ -370,7 +370,7 @@ EXPLAIN EXTENDED SELECT pseudo,(SELECT email FROM t8 WHERE pseudo=(SELECT pseudo
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 PRIMARY t8 const PRIMARY PRIMARY 37 const 1 100.00 Using where; Using index
|
||||
4 SUBQUERY t8 const PRIMARY PRIMARY 37 const 1 100.00 Using index
|
||||
2 SUBQUERY t8 const PRIMARY PRIMARY 37 const 1 100.00 Using index condition
|
||||
2 SUBQUERY t8 const PRIMARY PRIMARY 37 const 1 100.00 Using where
|
||||
3 SUBQUERY t8 const PRIMARY PRIMARY 37 const 1 100.00 Using index
|
||||
Warnings:
|
||||
Note 1003 select `test`.`t8`.`pseudo` AS `pseudo`,(select `test`.`t8`.`email` from `test`.`t8` where (`test`.`t8`.`pseudo` = (select 'joce' from `test`.`t8` where 1))) AS `(SELECT email FROM t8 WHERE pseudo=(SELECT pseudo FROM t8 WHERE pseudo='joce'))` from `test`.`t8` where (`test`.`t8`.`pseudo` = (select 'joce' from `test`.`t8` where 1))
|
||||
|
Reference in New Issue
Block a user