Skip to content

Commit 29fa9bc

Browse files
committed
Merge 10.4 into 10.5
2 parents 0324bde + 7e574eb commit 29fa9bc

File tree

16 files changed

+341
-38
lines changed

16 files changed

+341
-38
lines changed

mysql-test/main/subselect4.result

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3042,6 +3042,122 @@ a
30423042
3
30433043
2
30443044
drop table t1,t2,t3;
3045+
#
3046+
# MDEV-29139: Redundant IN/ALL/ANY predicand in GROUP BY clause of
3047+
# IN/ALL/ANY/EXISTS subquery
3048+
#
3049+
create table t1 (a int);
3050+
create table t2 (b int);
3051+
create table t3 (c int);
3052+
create table t4 (d int);
3053+
insert into t1 values (3), (1);
3054+
insert into t2 values (3), (2);
3055+
insert into t3 values (4), (2);
3056+
insert into t4 values (1), (7);
3057+
explain extended select b from t2
3058+
where exists (select c from t3
3059+
group by (select a from t1 where a = 1) in (select d from t4));
3060+
id select_type table type possible_keys key key_len ref rows filtered Extra
3061+
1 PRIMARY t2 ALL NULL NULL NULL NULL 2 100.00
3062+
2 SUBQUERY t3 ALL NULL NULL NULL NULL 2 100.00
3063+
Warnings:
3064+
Note 1003 /* select#1 */ select `test`.`t2`.`b` AS `b` from `test`.`t2` where 1
3065+
select b from t2
3066+
where exists (select c from t3
3067+
group by (select a from t1 where a = 1) in (select d from t4));
3068+
b
3069+
3
3070+
2
3071+
prepare stmt from "select b from t2
3072+
where exists (select c from t3
3073+
group by (select a from t1 where a = 1) in (select d from t4))";
3074+
execute stmt;
3075+
b
3076+
3
3077+
2
3078+
execute stmt;
3079+
b
3080+
3
3081+
2
3082+
deallocate prepare stmt;
3083+
explain extended select b from t2
3084+
where exists (select c from t3
3085+
group by (select a from t1 where a = 1) >=
3086+
any (select d from t4));
3087+
id select_type table type possible_keys key key_len ref rows filtered Extra
3088+
1 PRIMARY t2 ALL NULL NULL NULL NULL 2 100.00
3089+
2 SUBQUERY t3 ALL NULL NULL NULL NULL 2 100.00
3090+
Warnings:
3091+
Note 1003 /* select#1 */ select `test`.`t2`.`b` AS `b` from `test`.`t2` where 1
3092+
select b from t2
3093+
where exists (select c from t3
3094+
group by (select a from t1 where a = 1) >=
3095+
any (select d from t4));
3096+
b
3097+
3
3098+
2
3099+
explain extended select b from t2
3100+
where exists (select c from t3
3101+
group by (select a from t1 where a = 1) <
3102+
all (select d from t4));
3103+
id select_type table type possible_keys key key_len ref rows filtered Extra
3104+
1 PRIMARY t2 ALL NULL NULL NULL NULL 2 100.00
3105+
2 SUBQUERY t3 ALL NULL NULL NULL NULL 2 100.00
3106+
Warnings:
3107+
Note 1003 /* select#1 */ select `test`.`t2`.`b` AS `b` from `test`.`t2` where 1
3108+
select b from t2
3109+
where exists (select c from t3
3110+
group by (select a from t1 where a = 1) <
3111+
all (select d from t4));
3112+
b
3113+
3
3114+
2
3115+
explain extended select b from t2
3116+
where b in (select c from t3
3117+
group by (select a from t1 where a = 1) in (select d from t4));
3118+
id select_type table type possible_keys key key_len ref rows filtered Extra
3119+
1 PRIMARY t2 ALL NULL NULL NULL NULL 2 100.00
3120+
1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 100.00
3121+
2 MATERIALIZED t3 ALL NULL NULL NULL NULL 2 100.00
3122+
Warnings:
3123+
Note 1003 select `test`.`t2`.`b` AS `b` from `test`.`t2` semi join (`test`.`t3`) where 1
3124+
select b from t2
3125+
where b in (select c from t3
3126+
group by (select a from t1 where a = 1) in (select d from t4));
3127+
b
3128+
2
3129+
explain extended select b from t2
3130+
where b >= any (select c from t3
3131+
group by (select a from t1 where a = 1) in
3132+
(select d from t4));
3133+
id select_type table type possible_keys key key_len ref rows filtered Extra
3134+
1 PRIMARY t2 ALL NULL NULL NULL NULL 2 100.00 Using where
3135+
2 SUBQUERY t3 ALL NULL NULL NULL NULL 2 100.00
3136+
Warnings:
3137+
Note 1003 /* select#1 */ select `test`.`t2`.`b` AS `b` from `test`.`t2` where <nop>(<in_optimizer>(`test`.`t2`.`b`,(/* select#2 */ select min(`test`.`t3`.`c`) from `test`.`t3`) <= <cache>(`test`.`t2`.`b`)))
3138+
select b from t2
3139+
where b >= any (select c from t3
3140+
group by (select a from t1 where a = 1) in
3141+
(select d from t4));
3142+
b
3143+
3
3144+
2
3145+
explain extended select b from t2
3146+
where b <= all (select c from t3
3147+
group by (select a from t1 where a = 1) in
3148+
(select d from t4));
3149+
id select_type table type possible_keys key key_len ref rows filtered Extra
3150+
1 PRIMARY t2 ALL NULL NULL NULL NULL 2 100.00 Using where
3151+
2 SUBQUERY t3 ALL NULL NULL NULL NULL 2 100.00
3152+
Warnings:
3153+
Note 1003 /* select#1 */ select `test`.`t2`.`b` AS `b` from `test`.`t2` where <not>(<in_optimizer>(`test`.`t2`.`b`,<min>(/* select#2 */ select `test`.`t3`.`c` from `test`.`t3`) < <cache>(`test`.`t2`.`b`)))
3154+
select b from t2
3155+
where b <= all (select c from t3
3156+
group by (select a from t1 where a = 1) in
3157+
(select d from t4));
3158+
b
3159+
2
3160+
drop table t1,t2,t3,t4;
30453161
# End of 10.3 tests
30463162
#
30473163
# MDEV-19134: EXISTS() slower if ORDER BY is defined

mysql-test/main/subselect4.test

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2479,6 +2479,80 @@ eval $q3;
24792479

24802480
drop table t1,t2,t3;
24812481

2482+
--echo #
2483+
--echo # MDEV-29139: Redundant IN/ALL/ANY predicand in GROUP BY clause of
2484+
--echo # IN/ALL/ANY/EXISTS subquery
2485+
--echo #
2486+
2487+
create table t1 (a int);
2488+
create table t2 (b int);
2489+
create table t3 (c int);
2490+
create table t4 (d int);
2491+
2492+
insert into t1 values (3), (1);
2493+
insert into t2 values (3), (2);
2494+
insert into t3 values (4), (2);
2495+
insert into t4 values (1), (7);
2496+
2497+
let $q1=
2498+
select b from t2
2499+
where exists (select c from t3
2500+
group by (select a from t1 where a = 1) in (select d from t4));
2501+
2502+
eval explain extended $q1;
2503+
eval $q1;
2504+
2505+
eval prepare stmt from "$q1";
2506+
execute stmt;
2507+
execute stmt;
2508+
deallocate prepare stmt;
2509+
2510+
let $q2=
2511+
select b from t2
2512+
where exists (select c from t3
2513+
group by (select a from t1 where a = 1) >=
2514+
any (select d from t4));
2515+
2516+
eval explain extended $q2;
2517+
eval $q2;
2518+
2519+
let $q3=
2520+
select b from t2
2521+
where exists (select c from t3
2522+
group by (select a from t1 where a = 1) <
2523+
all (select d from t4));
2524+
2525+
eval explain extended $q3;
2526+
eval $q3;
2527+
2528+
let $q4=
2529+
select b from t2
2530+
where b in (select c from t3
2531+
group by (select a from t1 where a = 1) in (select d from t4));
2532+
2533+
eval explain extended $q4;
2534+
eval $q4;
2535+
2536+
let $q5=
2537+
select b from t2
2538+
where b >= any (select c from t3
2539+
group by (select a from t1 where a = 1) in
2540+
(select d from t4));
2541+
2542+
eval explain extended $q5;
2543+
eval $q5;
2544+
2545+
let $q6=
2546+
select b from t2
2547+
where b <= all (select c from t3
2548+
group by (select a from t1 where a = 1) in
2549+
(select d from t4));
2550+
2551+
eval explain extended $q6;
2552+
eval $q6;
2553+
2554+
drop table t1,t2,t3,t4;
2555+
24822556
--echo # End of 10.3 tests
24832557

24842558
--echo #

mysql-test/suite/innodb/r/foreign_key_not_windows.result

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,21 @@ CREATE TABLE `d255`.`_##################################################`
1111
ERROR HY000: Long database name and identifier for object resulted in path length exceeding 512 characters. Path: './@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023/_@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023
1212
CREATE TABLE `d255`.`##################################################`
1313
(a INT PRIMARY KEY, FOREIGN KEY(a) REFERENCES test.t(a)) ENGINE=InnoDB;
14+
#
15+
# MDEV-29258 Failing assertion for name length on RENAME TABLE
16+
#
17+
CREATE TABLE `d255`.`d245` (x INT) ENGINE=InnoDB;
18+
DROP TABLE `d255`.`d250`;
19+
RENAME TABLE `d250#`.`d245` TO `d250#`.`d250`;
20+
RENAME TABLE `d255`.`d250` TO a;
21+
DROP TABLE a,t;
22+
#
23+
# MDEV-29409 Buffer overflow in my_wc_mb_filename() on RENAME TABLE
24+
#
25+
CREATE TABLE `d255`.t(a INT PRIMARY KEY)ENGINE=InnoDB;
26+
CREATE TABLE `d255`.u(a INT PRIMARY KEY,
27+
CONSTRAINT `d320` FOREIGN KEY (a) REFERENCES `d255`.t (a)) ENGINE=InnoDB;
28+
RENAME TABLE `d255`.u TO u;
29+
DROP TABLE u;
1430
DROP DATABASE `d255`;
15-
DROP TABLE t;
1631
# End of 10.3 tests

mysql-test/suite/innodb/t/foreign_key_not_windows.test

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,40 @@ eval CREATE TABLE `$d255`.`_$d250`
3838
--replace_result $d255 d255
3939
eval CREATE TABLE `$d255`.`$d250`
4040
(a INT PRIMARY KEY, FOREIGN KEY(a) REFERENCES test.t(a)) ENGINE=InnoDB;
41+
42+
--echo #
43+
--echo # MDEV-29258 Failing assertion for name length on RENAME TABLE
44+
--echo #
45+
46+
let $d245=-------------------------------------------------;
47+
--replace_result $d245 d245 $d255 d255
48+
eval CREATE TABLE `$d255`.`$d245` (x INT) ENGINE=InnoDB;
49+
--replace_result $d250 d250 $d255 d255
50+
eval DROP TABLE `$d255`.`$d250`;
51+
52+
--replace_result $d245 d245 $d250 d250 d255 d255
53+
eval RENAME TABLE `$d255`.`$d245` TO `$d255`.`$d250`;
54+
--replace_result $d250 d250 $d255 d255
55+
eval RENAME TABLE `$d255`.`$d250` TO a;
56+
--replace_result $d255 d255
57+
DROP TABLE a,t;
58+
59+
--echo #
60+
--echo # MDEV-29409 Buffer overflow in my_wc_mb_filename() on RENAME TABLE
61+
--echo #
62+
63+
let $d225=#############################################;
64+
let $d320=################################################################;
65+
66+
--replace_result $d255 d255
67+
eval CREATE TABLE `$d255`.t(a INT PRIMARY KEY)ENGINE=InnoDB;
68+
--replace_result $d255 d255 $d320 d320
69+
eval CREATE TABLE `$d255`.u(a INT PRIMARY KEY,
70+
CONSTRAINT `$d320` FOREIGN KEY (a) REFERENCES `$d255`.t (a)) ENGINE=InnoDB;
71+
--replace_result $d255 d255
72+
eval RENAME TABLE `$d255`.u TO u;
73+
DROP TABLE u;
4174
--replace_result $d255 d255
4275
eval DROP DATABASE `$d255`;
43-
DROP TABLE t;
4476

4577
--echo # End of 10.3 tests

mysql-test/suite/innodb/t/innodb_sys_semaphore_waits.test

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,10 @@ let $counter= 80;
7878
let $mysql_errno= 0;
7979
while (!$mysql_errno)
8080
{
81-
--error 0,ER_SERVER_SHUTDOWN,ER_CONNECTION_KILLED,2002,2006,2013
81+
--error 0,ER_SERVER_SHUTDOWN,ER_CONNECTION_KILLED,2002,2006,2013,5014
8282
show status;
8383

84-
--error 0,ER_SERVER_SHUTDOWN,ER_CONNECTION_KILLED,2002,2006,2013
84+
--error 0,ER_SERVER_SHUTDOWN,ER_CONNECTION_KILLED,2002,2006,2013,5014
8585
select * from information_schema.innodb_sys_semaphore_waits;
8686

8787
dec $counter;

mysql-test/suite/innodb_fts/r/innodb_fts_plugin.result

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
INSTALL PLUGIN simple_parser SONAME 'mypluglib';
2+
FLUSH TABLES;
23
# Test Part 1: Grammar Test
34
CREATE TABLE articles (
45
id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
@@ -31,7 +32,7 @@ INSERT INTO articles (title, body) VALUES
3132
('1001 MySQL Tricks','How to use full-text search engine'),
3233
('Go MySQL Tricks','How to use full text search engine');
3334
SELECT * FROM articles WHERE
34-
MATCH(title, body) AGAINST('mysql');
35+
MATCH(title, body) AGAINST('mysql') ORDER BY id;
3536
id title body
3637
1 MySQL Tutorial DBMS stands for MySQL DataBase ...
3738
2 How To Use MySQL Well After you went through a ...
@@ -68,7 +69,7 @@ INSERT INTO articles (title, body) VALUES
6869
('Go MySQL Tricks','How to use full text search engine');
6970
ALTER TABLE articles ADD FULLTEXT INDEX (title, body) WITH PARSER simple_parser;
7071
SELECT * FROM articles WHERE
71-
MATCH(title, body) AGAINST('mysql');
72+
MATCH(title, body) AGAINST('mysql') ORDER BY id;
7273
id title body
7374
1 MySQL Tutorial DBMS stands for MySQL DataBase ...
7475
2 How To Use MySQL Well After you went through a ...
@@ -88,21 +89,23 @@ MATCH(title, body) AGAINST('full text');
8889
id title body
8990
5 Go MySQL Tricks How to use full text search engine
9091
SELECT * FROM articles WHERE
91-
MATCH(title, body) AGAINST('full-text' WITH QUERY EXPANSION);
92+
MATCH(title, body) AGAINST('full-text' WITH QUERY EXPANSION)
93+
ORDER BY id;
9294
id title body
93-
4 1001 MySQL Tricks How to use full-text search engine
94-
5 Go MySQL Tricks How to use full text search engine
95-
2 How To Use MySQL Well After you went through a ...
9695
1 MySQL Tutorial DBMS stands for MySQL DataBase ...
96+
2 How To Use MySQL Well After you went through a ...
9797
3 Optimizing MySQL In this tutorial we will show ...
98+
4 1001 MySQL Tricks How to use full-text search engine
99+
5 Go MySQL Tricks How to use full text search engine
98100
SELECT * FROM articles WHERE
99-
MATCH(title, body) AGAINST('full text' WITH QUERY EXPANSION);
101+
MATCH(title, body) AGAINST('full text' WITH QUERY EXPANSION)
102+
ORDER BY id;
100103
id title body
101-
5 Go MySQL Tricks How to use full text search engine
102-
4 1001 MySQL Tricks How to use full-text search engine
103-
2 How To Use MySQL Well After you went through a ...
104104
1 MySQL Tutorial DBMS stands for MySQL DataBase ...
105+
2 How To Use MySQL Well After you went through a ...
105106
3 Optimizing MySQL In this tutorial we will show ...
107+
4 1001 MySQL Tricks How to use full-text search engine
108+
5 Go MySQL Tricks How to use full text search engine
106109
SELECT * FROM articles WHERE
107110
MATCH(title, body) AGAINST('"mysql database"' IN BOOLEAN MODE);
108111
id title body
@@ -137,27 +140,27 @@ INSERT INTO articles (title, body) VALUES
137140
('Go MariaDB Tricks','How to use full text search engine');
138141
# restart
139142
SELECT * FROM articles WHERE
140-
MATCH(title, body) AGAINST('MySQL');
143+
MATCH(title, body) AGAINST('MySQL') ORDER BY id;
141144
id title body
142145
6 MySQL Tutorial DBMS stands for MySQL DataBase ...
143146
7 How To Use MySQL Well After you went through a ...
144147
8 Optimizing MySQL In this tutorial we will show ...
145148
9 1001 MySQL Tricks How to use full-text search engine
146149
SELECT * FROM articles WHERE
147-
MATCH(title, body) AGAINST('tutorial');
150+
MATCH(title, body) AGAINST('tutorial') ORDER BY id;
148151
id title body
149152
6 MySQL Tutorial DBMS stands for MySQL DataBase ...
150153
8 Optimizing MySQL In this tutorial we will show ...
151154
SELECT * FROM articles WHERE
152-
MATCH(title, body) AGAINST('Tricks');
155+
MATCH(title, body) AGAINST('Tricks') ORDER BY id;
153156
id title body
154157
9 1001 MySQL Tricks How to use full-text search engine
155158
10 Go MariaDB Tricks How to use full text search engine
156159
SELECT * FROM articles WHERE
157-
MATCH(title, body) AGAINST('full text search');
160+
MATCH(title, body) AGAINST('full text search') ORDER BY id;
158161
id title body
159-
10 Go MariaDB Tricks How to use full text search engine
160162
9 1001 MySQL Tricks How to use full-text search engine
163+
10 Go MariaDB Tricks How to use full text search engine
161164
SELECT COUNT(*) FROM articles;
162165
COUNT(*)
163166
5
@@ -185,7 +188,8 @@ UNINSTALL PLUGIN simple_parser;
185188
Warnings:
186189
Warning 1620 Plugin is busy and will be uninstalled on shutdown
187190
SELECT * FROM articles WHERE
188-
MATCH(title, body) AGAINST('mysql');
191+
MATCH(title, body) AGAINST('mysql')
192+
ORDER BY id;
189193
id title body
190194
1 MySQL Tutorial DBMS stands for MySQL DataBase ...
191195
2 How To Use MySQL Well After you went through a ...

0 commit comments

Comments
 (0)