Commit 3d30668e authored by Otto Kekäläinen's avatar Otto Kekäläinen
Browse files

Imported upstream 5.5.36

parent cdd04139
...@@ -1311,7 +1311,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra ...@@ -1311,7 +1311,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 system NULL NULL NULL NULL 1 100.00 1 SIMPLE t1 system NULL NULL NULL NULL 1 100.00
1 SIMPLE t2 system NULL NULL NULL NULL 1 100.00 1 SIMPLE t2 system NULL NULL NULL NULL 1 100.00
Warnings: Warnings:
Note 1003 select 1 AS `f1`,NULL AS `f2`,3 AS `f3`,NULL AS `f1`,NULL AS `f2` from `test`.`t2` where ((coalesce(1,NULL),3) in ((1,3),(2,2))) Note 1003 select 1 AS `f1`,NULL AS `f2`,3 AS `f3`,NULL AS `f1`,NULL AS `f2` from `test`.`t2` where 1
SELECT * FROM t1 LEFT JOIN t2 ON t1.f2 = t2.f2 SELECT * FROM t1 LEFT JOIN t2 ON t1.f2 = t2.f2
WHERE (COALESCE(t1.f1, t2.f1), f3) IN ((1, 3), (2, 2)); WHERE (COALESCE(t1.f1, t2.f1), f3) IN ((1, 3), (2, 2));
f1 f2 f3 f1 f2 f1 f2 f3 f1 f2
......
...@@ -1322,7 +1322,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra ...@@ -1322,7 +1322,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 system NULL NULL NULL NULL 1 100.00 1 SIMPLE t1 system NULL NULL NULL NULL 1 100.00
1 SIMPLE t2 system NULL NULL NULL NULL 1 100.00 1 SIMPLE t2 system NULL NULL NULL NULL 1 100.00
Warnings: Warnings:
Note 1003 select 1 AS `f1`,NULL AS `f2`,3 AS `f3`,NULL AS `f1`,NULL AS `f2` from `test`.`t2` where ((coalesce(1,NULL),3) in ((1,3),(2,2))) Note 1003 select 1 AS `f1`,NULL AS `f2`,3 AS `f3`,NULL AS `f1`,NULL AS `f2` from `test`.`t2` where 1
SELECT * FROM t1 LEFT JOIN t2 ON t1.f2 = t2.f2 SELECT * FROM t1 LEFT JOIN t2 ON t1.f2 = t2.f2
WHERE (COALESCE(t1.f1, t2.f1), f3) IN ((1, 3), (2, 2)); WHERE (COALESCE(t1.f1, t2.f1), f3) IN ((1, 3), (2, 2));
f1 f2 f3 f1 f2 f1 f2 f3 f1 f2
......
...@@ -1029,7 +1029,7 @@ port 3306 ...@@ -1029,7 +1029,7 @@ port 3306
port-open-timeout 0 port-open-timeout 0
preload-buffer-size 32768 preload-buffer-size 32768
profiling-history-size 15 profiling-history-size 15
progress-report-time 56 progress-report-time 5
query-alloc-block-size 8192 query-alloc-block-size 8192
query-cache-limit 1048576 query-cache-limit 1048576
query-cache-min-res-unit 4096 query-cache-min-res-unit 4096
......
...@@ -5264,6 +5264,20 @@ slow_log CREATE TABLE `slow_log` ( ...@@ -5264,6 +5264,20 @@ slow_log CREATE TABLE `slow_log` (
SET @@global.log_output= @old_log_output_state; SET @@global.log_output= @old_log_output_state;
SET @@global.slow_query_log= @old_slow_query_log_state; SET @@global.slow_query_log= @old_slow_query_log_state;
SET @@global.general_log= @old_general_log_state; SET @@global.general_log= @old_general_log_state;
# MDEV-5481 mysqldump fails to dump geometry types properly
create table t1 (g GEOMETRY) CHARSET koi8r;
create table t2 (g GEOMETRY) CHARSET koi8r;
insert into t1 values (point(1,1)), (point(2,2));
##################################################
\0\0\0\0\0\0\0\0\0\0\0\0\0?\0\0\0\0\0\0?
\0\0\0\0\0\0\0\0\0\0\0\0\0\0@\0\0\0\0\0\0\0@
##################################################
LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/t1.txt' INTO TABLE t2 CHARACTER SET koi8r;
select astext(g) from t2;
astext(g)
POINT(1 1)
POINT(2 2)
drop table t1, t2;
# #
# End of 5.1 tests # End of 5.1 tests
# #
...@@ -2493,3 +2493,70 @@ i ...@@ -2493,3 +2493,70 @@ i
3 3
4 4
DROP TABLE t1; DROP TABLE t1;
#
# MDEV-5177: ha_partition and innodb index intersection produce fewer rows (MySQL Bug#70703)
#
create table t1 (
a int not null,
b int not null,
pk int not null,
primary key (pk),
key(a),
key(b)
) partition by hash(pk) partitions 10;
insert into t1 values (1,2,4);
insert into t1 values (1,0,17);
insert into t1 values (1,2,25);
insert into t1 values (10,20,122);
insert into t1 values (10,20,123);
create table t2 (a int);
insert into t2 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
insert into t1 select 1,2, 200 + A.a + 10*B.a + 100*C.a from t2 A, t2 B, t2 C;
insert into t1 select 10+A.a + 10*B.a + 100*C.a + 1000*D.a,
10+A.a + 10*B.a + 100*C.a + 1000*D.a,
2000 + A.a + 10*B.a + 100*C.a + 1000*D.a
from t2 A, t2 B, t2 C ,t2 D;
explain select * from t1 where a=1 and b=2 and pk between 1 and 999999 ;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ref PRIMARY,a,b b 4 const 982 Using where
create temporary table t3 as
select * from t1 where a=1 and b=2 and pk between 1 and 999 ;
select count(*) from t3;
count(*)
802
drop table t3;
create temporary table t3 as
select * from t1 ignore index(a,b) where a=1 and b=2 and pk between 1 and 999 ;
select count(*) from t3;
count(*)
802
drop table t3;
drop table t1,t2;
#
# MDEV-5555: Incorrect index_merge on BTREE indices
#
CREATE TABLE t1 (
id bigint(20) unsigned NOT NULL,
id2 bigint(20) unsigned NOT NULL,
dob date DEFAULT NULL,
address char(100) DEFAULT NULL,
city char(35) DEFAULT NULL,
hours_worked_per_week smallint(5) unsigned DEFAULT NULL,
weeks_worked_last_year tinyint(3) unsigned DEFAULT NULL,
KEY dob (dob),
KEY address (address),
KEY city (city),
KEY hours_worked_per_week (hours_worked_per_week),
KEY weeks_worked_last_year (weeks_worked_last_year)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
PARTITION BY KEY (id) PARTITIONS 5;
# Insert some rows
select * from t1 where hours_worked_per_week = 40 and weeks_worked_last_year = 52 and dob < '1949-11-21';
id id2 dob address city hours_worked_per_week weeks_worked_last_year
16 16 1949-11-07 address16 city16 40 52
50 50 1923-09-08 address50 city50 40 52
select * from t1 IGNORE INDEX(dob, weeks_worked_last_year, hours_worked_per_week) where hours_worked_per_week = 40 and weeks_worked_last_year = 52 and dob < '1949-11-21';
id id2 dob address city hours_worked_per_week weeks_worked_last_year
16 16 1949-11-07 address16 city16 40 52
50 50 1923-09-08 address50 city50 40 52
drop table t1;
...@@ -752,8 +752,8 @@ select * from t1 force index (b) where b < 10 ORDER BY b DESC; ...@@ -752,8 +752,8 @@ select * from t1 force index (b) where b < 10 ORDER BY b DESC;
a b a b
6 6 6 6
4 5 4 5
2 4
30 4 30 4
2 4
3 3 3 3
35 2 35 2
7 1 7 1
......
...@@ -4019,4 +4019,36 @@ c1 ...@@ -4019,4 +4019,36 @@ c1
NULL NULL
2 2
DROP TABLE t1,t2; DROP TABLE t1,t2;
#
# MDEV-5369: Wrong result (0 instead of NULL) on 2nd execution of
# PS with LEFT JOIN, TEMPTABLE view
#
CREATE TABLE t1 (a INT) ENGINE=MyISAM;
INSERT INTO t1 VALUES (0),(8);
CREATE TABLE t2 (pk INT PRIMARY KEY) ENGINE=MyISAM;
CREATE ALGORITHM=TEMPTABLE VIEW v2 AS SELECT * FROM t2;
SELECT SUM(pk) FROM t1 LEFT JOIN v2 ON a = pk;
SUM(pk)
NULL
PREPARE stmt FROM "SELECT SUM(pk) FROM t1 LEFT JOIN v2 ON a = pk";
EXECUTE stmt;
SUM(pk)
NULL
EXECUTE stmt;
SUM(pk)
NULL
DEALLOCATE PREPARE stmt;
DROP VIEW v2;
DROP TABLE t1, t2;
# End of 5.3 tests
#
# MDEV-5505: Assertion `! is_set()' fails on PREPARE SELECT
# with out of range in GROUP BY
#
CREATE TABLE t1 (a INT);
PREPARE stmt FROM "SELECT 1 FROM t1 GROUP BY 0 OR 18446744073709551615+1";
ERROR 22003: BIGINT UNSIGNED value is out of range in '(18446744073709551615 + 1)'
SELECT 1 FROM t1 GROUP BY 0 OR 18446744073709551615+1;
ERROR 22003: BIGINT UNSIGNED value is out of range in '(18446744073709551615 + 1)'
drop table t1;
# End of 5.3 tests # End of 5.3 tests
...@@ -11,4 +11,11 @@ START SLAVE; ...@@ -11,4 +11,11 @@ START SLAVE;
STOP SLAVE; STOP SLAVE;
CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_MYPORT, MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=BINLOG_START; CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_MYPORT, MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=BINLOG_START;
START SLAVE; START SLAVE;
slave start;
Warnings:
Note 1254 Slave is already running
CHANGE MASTER TO MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=BINLOG_START;
slave start;
Warnings:
Note 1254 Slave is already running
include/rpl_end.inc include/rpl_end.inc
...@@ -5315,7 +5315,7 @@ SELECT * FROM t1 WHERE (1=2 OR t1.pk=2) AND t1.a <> 0; ...@@ -5315,7 +5315,7 @@ SELECT * FROM t1 WHERE (1=2 OR t1.pk=2) AND t1.a <> 0;
id select_type table type possible_keys key key_len ref rows filtered Extra id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
Warnings: Warnings:
Note 1003 select 2 AS `pk`,0 AS `a` from `test`.`t1` where (0 <> 0) Note 1003 select 2 AS `pk`,0 AS `a` from `test`.`t1` where 0
DROP TABLE t1; DROP TABLE t1;
SELECT * FROM mysql.time_zone SELECT * FROM mysql.time_zone
WHERE ( NOT (Use_leap_seconds <= Use_leap_seconds AND Time_zone_id != 1) WHERE ( NOT (Use_leap_seconds <= Use_leap_seconds AND Time_zone_id != 1)
...@@ -5338,7 +5338,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra ...@@ -5338,7 +5338,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 system idx NULL NULL NULL 1 100.00 1 SIMPLE t1 system idx NULL NULL NULL 1 100.00
1 SIMPLE t2 ref idx idx 5 const 1 100.00 Using index 1 SIMPLE t2 ref idx idx 5 const 1 100.00 Using index
Warnings: Warnings:
Note 1003 select 8 AS `a`,8 AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t2` where ((`test`.`t2`.`c` = 8) and 1) Note 1003 select 8 AS `a`,8 AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t2` where (`test`.`t2`.`c` = 8)
SELECT * FROM t1 INNER JOIN t2 ON ( c = a ) SELECT * FROM t1 INNER JOIN t2 ON ( c = a )
WHERE 1 IS NULL OR b < 33 AND b = c; WHERE 1 IS NULL OR b < 33 AND b = c;
a b c a b c
...@@ -5462,7 +5462,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra ...@@ -5462,7 +5462,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t2 system PRIMARY NULL NULL NULL 1 100.00 1 SIMPLE t2 system PRIMARY NULL NULL NULL 1 100.00
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings: Warnings:
Note 1003 select `test`.`t1`.`pk1` AS `pk1`,`test`.`t1`.`a1` AS `a1`,`test`.`t1`.`b1` AS `b1`,1 AS `pk2`,1 AS `a2` from `test`.`t1` where ((`test`.`t1`.`a1` = 1) and ((`test`.`t1`.`b1` = 6) or 0)) Note 1003 select `test`.`t1`.`pk1` AS `pk1`,`test`.`t1`.`a1` AS `a1`,`test`.`t1`.`b1` AS `b1`,1 AS `pk2`,1 AS `a2` from `test`.`t1` where ((`test`.`t1`.`a1` = 1) and (`test`.`t1`.`b1` = 6))
INSERT INTO t1 VALUES (3,1,6); INSERT INTO t1 VALUES (3,1,6);
SELECT * FROM t1, t2 SELECT * FROM t1, t2
WHERE a1 = pk2 AND ( ( b1 = 6 OR a2 > 4 ) AND pk2 = a2 OR pk1 IS NULL ); WHERE a1 = pk2 AND ( ( b1 = 6 OR a2 > 4 ) AND pk2 = a2 OR pk1 IS NULL );
......
...@@ -5326,7 +5326,7 @@ SELECT * FROM t1 WHERE (1=2 OR t1.pk=2) AND t1.a <> 0; ...@@ -5326,7 +5326,7 @@ SELECT * FROM t1 WHERE (1=2 OR t1.pk=2) AND t1.a <> 0;
id select_type table type possible_keys key key_len ref rows filtered Extra id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
Warnings: Warnings:
Note 1003 select 2 AS `pk`,0 AS `a` from `test`.`t1` where (0 <> 0) Note 1003 select 2 AS `pk`,0 AS `a` from `test`.`t1` where 0
DROP TABLE t1; DROP TABLE t1;
SELECT * FROM mysql.time_zone SELECT * FROM mysql.time_zone
WHERE ( NOT (Use_leap_seconds <= Use_leap_seconds AND Time_zone_id != 1) WHERE ( NOT (Use_leap_seconds <= Use_leap_seconds AND Time_zone_id != 1)
...@@ -5349,7 +5349,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra ...@@ -5349,7 +5349,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 system idx NULL NULL NULL 1 100.00 1 SIMPLE t1 system idx NULL NULL NULL 1 100.00
1 SIMPLE t2 ref idx idx 5 const 1 100.00 Using index 1 SIMPLE t2 ref idx idx 5 const 1 100.00 Using index
Warnings: Warnings:
Note 1003 select 8 AS `a`,8 AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t2` where ((`test`.`t2`.`c` = 8) and 1) Note 1003 select 8 AS `a`,8 AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t2` where (`test`.`t2`.`c` = 8)
SELECT * FROM t1 INNER JOIN t2 ON ( c = a ) SELECT * FROM t1 INNER JOIN t2 ON ( c = a )
WHERE 1 IS NULL OR b < 33 AND b = c; WHERE 1 IS NULL OR b < 33 AND b = c;
a b c a b c
...@@ -5473,7 +5473,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra ...@@ -5473,7 +5473,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t2 system PRIMARY NULL NULL NULL 1 100.00 1 SIMPLE t2 system PRIMARY NULL NULL NULL 1 100.00
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings: Warnings:
Note 1003 select `test`.`t1`.`pk1` AS `pk1`,`test`.`t1`.`a1` AS `a1`,`test`.`t1`.`b1` AS `b1`,1 AS `pk2`,1 AS `a2` from `test`.`t1` where ((`test`.`t1`.`a1` = 1) and ((`test`.`t1`.`b1` = 6) or 0)) Note 1003 select `test`.`t1`.`pk1` AS `pk1`,`test`.`t1`.`a1` AS `a1`,`test`.`t1`.`b1` AS `b1`,1 AS `pk2`,1 AS `a2` from `test`.`t1` where ((`test`.`t1`.`a1` = 1) and (`test`.`t1`.`b1` = 6))
INSERT INTO t1 VALUES (3,1,6); INSERT INTO t1 VALUES (3,1,6);
SELECT * FROM t1, t2 SELECT * FROM t1, t2
WHERE a1 = pk2 AND ( ( b1 = 6 OR a2 > 4 ) AND pk2 = a2 OR pk1 IS NULL ); WHERE a1 = pk2 AND ( ( b1 = 6 OR a2 > 4 ) AND pk2 = a2 OR pk1 IS NULL );
......
...@@ -5315,7 +5315,7 @@ SELECT * FROM t1 WHERE (1=2 OR t1.pk=2) AND t1.a <> 0; ...@@ -5315,7 +5315,7 @@ SELECT * FROM t1 WHERE (1=2 OR t1.pk=2) AND t1.a <> 0;
id select_type table type possible_keys key key_len ref rows filtered Extra id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
Warnings: Warnings:
Note 1003 select 2 AS `pk`,0 AS `a` from `test`.`t1` where (0 <> 0) Note 1003 select 2 AS `pk`,0 AS `a` from `test`.`t1` where 0
DROP TABLE t1; DROP TABLE t1;
SELECT * FROM mysql.time_zone SELECT * FROM mysql.time_zone
WHERE ( NOT (Use_leap_seconds <= Use_leap_seconds AND Time_zone_id != 1) WHERE ( NOT (Use_leap_seconds <= Use_leap_seconds AND Time_zone_id != 1)
...@@ -5338,7 +5338,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra ...@@ -5338,7 +5338,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 system idx NULL NULL NULL 1 100.00 1 SIMPLE t1 system idx NULL NULL NULL 1 100.00
1 SIMPLE t2 ref idx idx 5 const 1 100.00 Using index 1 SIMPLE t2 ref idx idx 5 const 1 100.00 Using index
Warnings: Warnings:
Note 1003 select 8 AS `a`,8 AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t2` where ((`test`.`t2`.`c` = 8) and 1) Note 1003 select 8 AS `a`,8 AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t2` where (`test`.`t2`.`c` = 8)
SELECT * FROM t1 INNER JOIN t2 ON ( c = a ) SELECT * FROM t1 INNER JOIN t2 ON ( c = a )
WHERE 1 IS NULL OR b < 33 AND b = c; WHERE 1 IS NULL OR b < 33 AND b = c;
a b c a b c
...@@ -5462,7 +5462,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra ...@@ -5462,7 +5462,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t2 system PRIMARY NULL NULL NULL 1 100.00 1 SIMPLE t2 system PRIMARY NULL NULL NULL 1 100.00
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings: Warnings:
Note 1003 select `test`.`t1`.`pk1` AS `pk1`,`test`.`t1`.`a1` AS `a1`,`test`.`t1`.`b1` AS `b1`,1 AS `pk2`,1 AS `a2` from `test`.`t1` where ((`test`.`t1`.`a1` = 1) and ((`test`.`t1`.`b1` = 6) or 0)) Note 1003 select `test`.`t1`.`pk1` AS `pk1`,`test`.`t1`.`a1` AS `a1`,`test`.`t1`.`b1` AS `b1`,1 AS `pk2`,1 AS `a2` from `test`.`t1` where ((`test`.`t1`.`a1` = 1) and (`test`.`t1`.`b1` = 6))
INSERT INTO t1 VALUES (3,1,6); INSERT INTO t1 VALUES (3,1,6);
SELECT * FROM t1, t2 SELECT * FROM t1, t2
WHERE a1 = pk2 AND ( ( b1 = 6 OR a2 > 4 ) AND pk2 = a2 OR pk1 IS NULL ); WHERE a1 = pk2 AND ( ( b1 = 6 OR a2 > 4 ) AND pk2 = a2 OR pk1 IS NULL );
......
...@@ -561,7 +561,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra ...@@ -561,7 +561,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 const PRIMARY,numreponse PRIMARY 7 const,const 1 100.00 Using index 1 PRIMARY t1 const PRIMARY,numreponse PRIMARY 7 const,const 1 100.00 Using index
2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away 2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
Warnings: Warnings:
Note 1003 select 3 AS `numreponse` from `test`.`t1` where (1 = '1') Note 1003 select 3 AS `numreponse` from `test`.`t1` where 1
drop table t1; drop table t1;
CREATE TABLE t1 (a int(1)); CREATE TABLE t1 (a int(1));
INSERT INTO t1 VALUES (1); INSERT INTO t1 VALUES (1);
...@@ -6098,7 +6098,7 @@ FROM t1 AS sq4_alias1 ...@@ -6098,7 +6098,7 @@ FROM t1 AS sq4_alias1
WHERE (sq4_alias1.col_varchar_key + NULL) IS NULL OR WHERE (sq4_alias1.col_varchar_key + NULL) IS NULL OR
sq4_alias1.col_varchar_key = @var3; sq4_alias1.col_varchar_key = @var3;
id select_type table type possible_keys key key_len ref rows Extra id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables 1 SIMPLE sq4_alias1 system NULL NULL NULL NULL 0 const row not found
SELECT @var3:=12, sq4_alias1.* SELECT @var3:=12, sq4_alias1.*
FROM t1 AS sq4_alias1 FROM t1 AS sq4_alias1
WHERE (sq4_alias1.col_varchar_key + NULL) IS NULL OR WHERE (sq4_alias1.col_varchar_key + NULL) IS NULL OR
......
...@@ -2317,6 +2317,33 @@ WHERE a='r' AND (c,b) NOT IN (SELECT c,b FROM t2 WHERE (c,b)=(t.c,t.b)); ...@@ -2317,6 +2317,33 @@ WHERE a='r' AND (c,b) NOT IN (SELECT c,b FROM t2 WHERE (c,b)=(t.c,t.b));
a b c d a b c d
DROP TABLE t1, t2; DROP TABLE t1, t2;
# #
# MDEV-5468: assertion failure with a simplified condition in subselect
#
CREATE TABLE t1 (a int, b int) ENGINE=MyISAM;
INSERT INTO t1 VALUES (1,1);
CREATE TABLE t2 ( pk int PRIMARY KEY, c INT) ENGINE=MyISAM;
INSERT INTO t2 VALUES (1,4), (2,6);
SELECT ( SELECT MAX(b) FROM t1, t2 WHERE pk = a AND b < from_sq.c ) AS select_sq,
COUNT( DISTINCT from_sq.c )
FROM ( SELECT DISTINCT t2_1.* FROM t2 AS t2_1, t2 AS t2_2 ) AS from_sq
GROUP BY select_sq ;
select_sq COUNT( DISTINCT from_sq.c )
1 2
DROP TABLE t1,t2;
CREATE TABLE t1 (id int, a2 char(2), a3 char(3)) ENGINE=MyISAM;
INSERT INTO t1 VALUES (1,'BE','BEL');
CREATE TABLE t2 (id int, a2 char(2), a3 char(3)) ENGINE=MyISAM;
INSERT INTO t2 VALUES (1,'BE','BEL'), (2,'MX','MEX');
CREATE VIEW v2 AS SELECT DISTINCT * FROM t2;
SELECT * FROM t1 AS outer_t1, v2
WHERE v2.a3 = outer_t1.a3
AND EXISTS ( SELECT * FROM t1 WHERE a2 < v2.a2 AND id = outer_t1.id )
AND outer_t1.a3 < 'J'
ORDER BY v2.id;
id a2 a3 id a2 a3
DROP VIEW v2;
DROP TABLE t1,t2;
#
# MDEV-3899 Valgrind warnings (blocks are definitely lost) in filesort on IN subquery with SUM and DISTINCT # MDEV-3899 Valgrind warnings (blocks are definitely lost) in filesort on IN subquery with SUM and DISTINCT
# #
CREATE TABLE t1 (a INT) ENGINE=MyISAM; CREATE TABLE t1 (a INT) ENGINE=MyISAM;
......
...@@ -46,7 +46,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra ...@@ -46,7 +46,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
Warnings: Warnings:
Note 1276 Field or reference 'test.t1.cur_date' of SELECT #2 was resolved in SELECT #1 Note 1276 Field or reference 'test.t1.cur_date' of SELECT #2 was resolved in SELECT #1
Note 1003 select 1 AS `id`,'2007-04-25 18:30:22' AS `cur_date` from (dual) where ('2007-04-25 18:30:22' = 0) Note 1003 select 1 AS `id`,'2007-04-25 18:30:22' AS `cur_date` from (dual) where 0
select * from t1 select * from t1
where id in (select id from t1 as x1 where (t1.cur_date is null)); where id in (select id from t1 as x1 where (t1.cur_date is null));
id cur_date id cur_date
...@@ -57,7 +57,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra ...@@ -57,7 +57,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
Warnings: Warnings:
Note 1276 Field or reference 'test.t2.cur_date' of SELECT #2 was resolved in SELECT #1 Note 1276 Field or reference 'test.t2.cur_date' of SELECT #2 was resolved in SELECT #1
Note 1003 select 1 AS `id`,'2007-04-25' AS `cur_date` from (dual) where ('2007-04-25' = 0) Note 1003 select 1 AS `id`,'2007-04-25' AS `cur_date` from (dual) where 0
select * from t2 select * from t2
where id in (select id from t2 as x1 where (t2.cur_date is null)); where id in (select id from t2 as x1 where (t2.cur_date is null));
id cur_date id cur_date
......
...@@ -568,7 +568,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra ...@@ -568,7 +568,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 const PRIMARY,numreponse PRIMARY 7 const,const 1 100.00 Using index 1 PRIMARY t1 const PRIMARY,numreponse PRIMARY 7 const,const 1 100.00 Using index
2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away 2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
Warnings: Warnings:
Note 1003 select 3 AS `numreponse` from `test`.`t1` where (1 = '1') Note 1003 select 3 AS `numreponse` from `test`.`t1` where 1
drop table t1; drop table t1;
CREATE TABLE t1 (a int(1)); CREATE TABLE t1 (a int(1));
INSERT INTO t1 VALUES (1); INSERT INTO t1 VALUES (1);
...@@ -6097,7 +6097,7 @@ FROM t1 AS sq4_alias1 ...@@ -6097,7 +6097,7 @@ FROM t1 AS sq4_alias1
WHERE (sq4_alias1.col_varchar_key + NULL) IS NULL OR WHERE (sq4_alias1.col_varchar_key + NULL) IS NULL OR
sq4_alias1.col_varchar_key = @var3; sq4_alias1.col_varchar_key = @var3;
id select_type table type possible_keys key key_len ref rows Extra id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables 1 SIMPLE sq4_alias1 system NULL NULL NULL NULL 0 const row not found
SELECT @var3:=12, sq4_alias1.* SELECT @var3:=12, sq4_alias1.*
FROM t1 AS sq4_alias1 FROM t1 AS sq4_alias1
WHERE (sq4_alias1.col_varchar_key + NULL) IS NULL OR WHERE (sq4_alias1.col_varchar_key + NULL) IS NULL OR
......
...@@ -564,7 +564,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra ...@@ -564,7 +564,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 const PRIMARY,numreponse PRIMARY 7 const,const 1 100.00 Using index 1 PRIMARY t1 const PRIMARY,numreponse PRIMARY 7 const,const 1 100.00 Using index
2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away 2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
Warnings: Warnings:
Note 1003 select 3 AS `numreponse` from `test`.`t1` where (1 = '1') Note 1003 select 3 AS `numreponse` from `test`.`t1` where 1
drop table t1; drop table t1;
CREATE TABLE t1 (a int(1)); CREATE TABLE t1 (a int(1));
INSERT INTO t1 VALUES (1); INSERT INTO t1 VALUES (1);
...@@ -6093,7 +6093,7 @@ FROM t1 AS sq4_alias1 ...@@ -6093,7 +6093,7 @@ FROM t1 AS sq4_alias1
WHERE (sq4_alias1.col_varchar_key + NULL) IS NULL OR WHERE (sq4_alias1.col_varchar_key + NULL) IS NULL OR
sq4_alias1.col_varchar_key = @var3; sq4_alias1.col_varchar_key = @var3;
id select_type table type possible_keys key key_len ref rows Extra id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables 1 SIMPLE sq4_alias1 system NULL NULL NULL NULL 0 const row not found
SELECT @var3:=12, sq4_alias1.* SELECT @var3:=12, sq4_alias1.*
FROM t1 AS sq4_alias1 FROM t1 AS sq4_alias1
WHERE (sq4_alias1.col_varchar_key + NULL) IS NULL OR WHERE (sq4_alias1.col_varchar_key + NULL) IS NULL OR
......
...@@ -567,7 +567,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra ...@@ -567,7 +567,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 const PRIMARY,numreponse PRIMARY 7 const,const 1 100.00 Using index 1 PRIMARY t1 const PRIMARY,numreponse PRIMARY 7 const,const 1 100.00 Using index
2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away 2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
Warnings: Warnings:
Note 1003 select 3 AS `numreponse` from `test`.`t1` where (1 = '1') Note 1003 select 3 AS `numreponse` from `test`.`t1` where 1
drop table t1; drop table t1;
CREATE TABLE t1 (a int(1)); CREATE TABLE t1 (a int(1));
INSERT INTO t1 VALUES (1); INSERT INTO t1 VALUES (1);
...@@ -6104,7 +6104,7 @@ FROM t1 AS sq4_alias1 ...@@ -6104,7 +6104,7 @@ FROM t1 AS sq4_alias1
WHERE (sq4_alias1.col_varchar_key + NULL) IS NULL OR WHERE (sq4_alias1.col_varchar_key + NULL) IS NULL OR
sq4_alias1.col_varchar_key = @var3; sq4_alias1.col_varchar_key = @var3;
id select_type table type possible_keys key key_len ref rows Extra id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables 1 SIMPLE sq4_alias1 system NULL NULL NULL NULL 0 const row not found
SELECT @var3:=12, sq4_alias1.* SELECT @var3:=12, sq4_alias1.*
FROM t1 AS sq4_alias1 FROM t1 AS sq4_alias1
WHERE (sq4_alias1.col_varchar_key + NULL) IS NULL OR WHERE (sq4_alias1.col_varchar_key + NULL) IS NULL OR
......
...@@ -564,7 +564,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra ...@@ -564,7 +564,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 const PRIMARY,numreponse PRIMARY 7 const,const 1 100.00 Using index 1 PRIMARY t1 const PRIMARY,numreponse PRIMARY 7 const,const 1 100.00 Using index
2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away 2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
Warnings: Warnings:
Note 1003 select 3 AS `numreponse` from `test`.`t1` where (1 = '1') Note 1003 select 3 AS `numreponse` from `test`.`t1` where 1
drop table t1; drop table t1;
CREATE TABLE t1 (a int(1)); CREATE TABLE t1 (a int(1));
INSERT INTO t1 VALUES (1); INSERT INTO t1 VALUES (1);
...@@ -6093,7 +6093,7 @@ FROM t1 AS sq4_alias1 ...@@ -6093,7 +6093,7 @@ FROM t1 AS sq4_alias1
WHERE (sq4_alias1.col_varchar_key + NULL) IS NULL OR WHERE (sq4_alias1.col_varchar_key + NULL) IS NULL OR
sq4_alias1.col_varchar_key = @var3; sq4_alias1.col_varchar_key = @var3;
id select_type table type possible_keys key key_len ref rows Extra id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables 1 SIMPLE sq4_alias1 system NULL NULL NULL NULL 0 const row not found
SELECT @var3:=12, sq4_alias1.* SELECT @var3:=12, sq4_alias1.*
FROM t1 AS sq4_alias1 FROM t1 AS sq4_alias1
WHERE (sq4_alias1.col_varchar_key + NULL) IS NULL OR WHERE (sq4_alias1.col_varchar_key + NULL) IS NULL OR
......
...@@ -2793,6 +2793,22 @@ mysql ...@@ -2793,6 +2793,22 @@ mysql
information_schema information_schema
DROP TABLE t1; DROP TABLE t1;
# #
# MDEV-5581: Server crashes in in JOIN::prepare on 2nd execution of PS with materialization+semijoin
#
CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (2),(3);
CREATE TABLE t2 (b INT);
INSERT INTO t2 VALUES (8),(9);
CREATE TABLE t3 (c INT, INDEX(c));
INSERT INTO t2 VALUES (5),(6);
PREPARE stmt FROM
"SELECT * FROM t1 WHERE ( 9, 5 ) IN ( SELECT b, COUNT(*) FROM t2 WHERE 1 IN ( SELECT MIN(c) FROM t3 ) )";
EXECUTE stmt;
a
EXECUTE stmt;
a
DROP TABLE t1,t2,t3;
#
# MySQL Bug#13340270: assertion table->sort.record_pointers == __null # MySQL Bug#13340270: assertion table->sort.record_pointers == __null
# #
CREATE TABLE t1 ( CREATE TABLE t1 (
......
...@@ -1109,6 +1109,23 @@ t3 AS t3a INNER JOIN t3 AS t3b ON ( t3a.i3 = t3b.i3 ) ...@@ -1109,6 +1109,23 @@ t3 AS t3a INNER JOIN t3 AS t3b ON ( t3a.i3 = t3b.i3 )
); );
i1 i1
DROP TABLE t1,t2,t3; DROP TABLE t1,t2,t3;
#
# MDEV-5582: Plugin 'MEMORY' has ref_count=1 after shutdown with materialization+semijoin
#
CREATE TABLE t1 (a INT) engine=innodb;
INSERT INTO t1 VALUES (8),(9);
CREATE TABLE t2 (b INT) engine=innodb;
INSERT INTO t2 VALUES (2),(3);
CREATE TABLE t3 (c INT, INDEX(c)) engine=innodb;
INSERT INTO t2 VALUES (4),(5);
explain
SELECT * FROM t1 WHERE 9 IN ( SELECT b FROM t2 WHERE 1 IN ( SELECT MIN(c) FROM t3 ) );
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
3 MATERIALIZED NULL NULL NULL NULL NULL NULL NULL No matching min/max row
SELECT * FROM t1 WHERE 9 IN ( SELECT b FROM t2 WHERE 1 IN ( SELECT MIN(c) FROM t3 ) );
a
DROP TABLE t1,t2,t3;
DROP TABLE IF EXISTS t1,t2,t3,t4; DROP TABLE IF EXISTS t1,t2,t3,t4;
# #
# MDEV-4782: Valgrind warnings (Conditional jump or move depends on uninitialised value) with InnoDB, semijoin # MDEV-4782: Valgrind warnings (Conditional jump or move depends on uninitialised value) with InnoDB, semijoin
......
Supports Markdown
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