summaryrefslogtreecommitdiff
path: root/mysql-test/main
diff options
context:
space:
mode:
authorVicențiu Ciorbaru <vicentiu@mariadb.org>2018-04-12 12:41:19 +0300
committerVicențiu Ciorbaru <vicentiu@mariadb.org>2018-04-12 12:41:19 +0300
commit65eefcdc601ef0f57b0779f1722161fc83a571c3 (patch)
tree7fe642e7d6e685ed87fbd292d986b871b5e0a720 /mysql-test/main
parent9c42b9038dc1457fd4aeed0520bc143a043a84d9 (diff)
parent36c01167200cf29ac92f3bd3263d7757c55cbb89 (diff)
downloadmariadb-git-65eefcdc601ef0f57b0779f1722161fc83a571c3.tar.gz
Merge remote-tracking branch '10.2' into 10.3
Diffstat (limited to 'mysql-test/main')
-rw-r--r--mysql-test/main/connect.result24
-rw-r--r--mysql-test/main/connect.test18
-rw-r--r--mysql-test/main/contributors.result3
-rw-r--r--mysql-test/main/derived_cond_pushdown.result15
-rw-r--r--mysql-test/main/derived_cond_pushdown.test13
-rw-r--r--mysql-test/main/func_misc.result11
-rw-r--r--mysql-test/main/func_misc.test11
-rw-r--r--mysql-test/main/func_str.result37
-rw-r--r--mysql-test/main/func_str.test35
-rw-r--r--mysql-test/main/lock.result16
-rw-r--r--mysql-test/main/lock.test21
-rw-r--r--mysql-test/main/mdev375.result12
-rw-r--r--mysql-test/main/mdev375.test11
-rw-r--r--mysql-test/main/myisam.result7
-rw-r--r--mysql-test/main/myisam.test7
-rw-r--r--mysql-test/main/myisam_recover.result3
-rw-r--r--mysql-test/main/myisam_recover.test3
-rw-r--r--mysql-test/main/mysqld--help,win.rdiff4
-rw-r--r--mysql-test/main/mysqld--help.result4
-rw-r--r--mysql-test/main/mysqltest.test2
-rw-r--r--mysql-test/main/perror.result2
-rw-r--r--mysql-test/main/ps.result2
-rw-r--r--mysql-test/main/sp.result2
-rw-r--r--mysql-test/main/sp.test2
-rw-r--r--mysql-test/main/statistics.result18
-rw-r--r--mysql-test/main/statistics.test19
-rw-r--r--mysql-test/main/variables.result7
-rw-r--r--mysql-test/main/variables.test3
-rw-r--r--mysql-test/main/view.result197
-rw-r--r--mysql-test/main/view.test196
30 files changed, 677 insertions, 28 deletions
diff --git a/mysql-test/main/connect.result b/mysql-test/main/connect.result
index f36483e6d8d..b05d0ea9fea 100644
--- a/mysql-test/main/connect.result
+++ b/mysql-test/main/connect.result
@@ -182,8 +182,16 @@ drop table t1;
CREATE USER mysqltest_u1@localhost;
GRANT USAGE ON *.* TO mysqltest_u1@localhost;
-SET GLOBAL max_connections = 3;
+SET GLOBAL max_connections = 10;
SET GLOBAL event_scheduler = ON;
+connect tmp_con1,localhost,mysqltest_u1,,;
+connect tmp_con2,localhost,mysqltest_u1,,;
+connect tmp_con3,localhost,mysqltest_u1,,;
+connect tmp_con4,localhost,mysqltest_u1,,;
+connect tmp_con5,localhost,mysqltest_u1,,;
+connect tmp_con6,localhost,mysqltest_u1,,;
+connect tmp_con7,localhost,mysqltest_u1,,;
+connection default;
# -- Waiting for Event Scheduler to start...
@@ -227,6 +235,13 @@ event_scheduler
mysqltest_u1
mysqltest_u1
mysqltest_u1
+mysqltest_u1
+mysqltest_u1
+mysqltest_u1
+mysqltest_u1
+mysqltest_u1
+mysqltest_u1
+mysqltest_u1
root
# -- Resetting variables...
@@ -242,6 +257,13 @@ disconnect con_1;
disconnect con_2;
disconnect con_3;
disconnect con_super_1;
+disconnect tmp_con1;
+disconnect tmp_con2;
+disconnect tmp_con3;
+disconnect tmp_con4;
+disconnect tmp_con5;
+disconnect tmp_con6;
+disconnect tmp_con7;
# -- Restoring default connection...
connect default,localhost,root,,test;
diff --git a/mysql-test/main/connect.test b/mysql-test/main/connect.test
index 20989e70ef9..c2d44c08e22 100644
--- a/mysql-test/main/connect.test
+++ b/mysql-test/main/connect.test
@@ -143,9 +143,18 @@ GRANT USAGE ON *.* TO mysqltest_u1@localhost;
--echo
let $saved_max_connections = `SELECT @@global.max_connections`;
-SET GLOBAL max_connections = 3;
+SET GLOBAL max_connections = 10;
SET GLOBAL event_scheduler = ON;
+connect (tmp_con1,localhost,mysqltest_u1,,);
+connect (tmp_con2,localhost,mysqltest_u1,,);
+connect (tmp_con3,localhost,mysqltest_u1,,);
+connect (tmp_con4,localhost,mysqltest_u1,,);
+connect (tmp_con5,localhost,mysqltest_u1,,);
+connect (tmp_con6,localhost,mysqltest_u1,,);
+connect (tmp_con7,localhost,mysqltest_u1,,);
+connection default;
+
--echo
--echo # -- Waiting for Event Scheduler to start...
let $wait_condition =
@@ -230,6 +239,13 @@ let $wait_condition =
--disconnect con_2
--disconnect con_3
--disconnect con_super_1
+--disconnect tmp_con1
+--disconnect tmp_con2
+--disconnect tmp_con3
+--disconnect tmp_con4
+--disconnect tmp_con5
+--disconnect tmp_con6
+--disconnect tmp_con7
--echo
--echo # -- Restoring default connection...
diff --git a/mysql-test/main/contributors.result b/mysql-test/main/contributors.result
index 927c0bcccbf..36d033f4cb3 100644
--- a/mysql-test/main/contributors.result
+++ b/mysql-test/main/contributors.result
@@ -4,13 +4,12 @@ Booking.com https://www.booking.com Founding member, Platinum Sponsor of the Mar
Alibaba Cloud https://www.alibabacloud.com/ Platinum Sponsor of the MariaDB Foundation
Tencent Cloud https://cloud.tencent.com Platinum Sponsor of the MariaDB Foundation
Microsoft https://microsoft.com/ Platinum Sponsor of the MariaDB Foundation
-MariaDB Corporation https://mariadb.com Founding member, Gold Sponsor of the MariaDB Foundation
+MariaDB Corporation https://mariadb.com Founding member, Platinum Sponsor of the MariaDB Foundation
Visma https://visma.com Gold Sponsor of the MariaDB Foundation
DBS https://dbs.com Gold Sponsor of the MariaDB Foundation
IBM https://www.ibm.com Gold Sponsor of the MariaDB Foundation
Nexedi https://www.nexedi.com Silver Sponsor of the MariaDB Foundation
Acronis http://www.acronis.com Silver Sponsor of the MariaDB Foundation
-Auttomattic https://automattic.com Bronze Sponsor of the MariaDB Foundation
Verkkokauppa.com https://www.verkkokauppa.com Bronze Sponsor of the MariaDB Foundation
Virtuozzo https://virtuozzo.com Bronze Sponsor of the MariaDB Foundation
Tencent Game DBA http://tencentdba.com/about Bronze Sponsor of the MariaDB Foundation
diff --git a/mysql-test/main/derived_cond_pushdown.result b/mysql-test/main/derived_cond_pushdown.result
index 5edd91faf16..6887ad11284 100644
--- a/mysql-test/main/derived_cond_pushdown.result
+++ b/mysql-test/main/derived_cond_pushdown.result
@@ -12763,6 +12763,21 @@ EXPLAIN
}
DROP TABLE t1,t2;
#
+# MDEV-15765: pushing condition with temporal constants
+# into constant tables
+#
+select * from (select date('2018-01-01') as d
+union all
+select date('2018-01-01') as d) as t
+where t.d between date ('2017-01-01') and date ('2019-01-01');
+d
+2018-01-01
+2018-01-01
+select * from (select date('2018-01-01') as d) as t
+where t.d between date ('2017-01-01') and date ('2019-01-01');
+d
+2018-01-01
+#
# MDEV-10855: Pushdown into derived with window functions
#
set @save_optimizer_switch= @@optimizer_switch;
diff --git a/mysql-test/main/derived_cond_pushdown.test b/mysql-test/main/derived_cond_pushdown.test
index 2188cc00533..234f88976c9 100644
--- a/mysql-test/main/derived_cond_pushdown.test
+++ b/mysql-test/main/derived_cond_pushdown.test
@@ -2208,6 +2208,19 @@ EVAL EXPLAIN FORMAT=JSON $query;
DROP TABLE t1,t2;
+--echo #
+--echo # MDEV-15765: pushing condition with temporal constants
+--echo # into constant tables
+--echo #
+
+select * from (select date('2018-01-01') as d
+ union all
+ select date('2018-01-01') as d) as t
+ where t.d between date ('2017-01-01') and date ('2019-01-01');
+
+select * from (select date('2018-01-01') as d) as t
+ where t.d between date ('2017-01-01') and date ('2019-01-01');
+
# Start of 10.3 tests
--echo #
diff --git a/mysql-test/main/func_misc.result b/mysql-test/main/func_misc.result
index 804a563f401..e7a416f8ea6 100644
--- a/mysql-test/main/func_misc.result
+++ b/mysql-test/main/func_misc.result
@@ -585,6 +585,17 @@ SELECT NAME_CONST('a', -(1)) OR 1;
NAME_CONST('a', -(1)) OR 1
1
#
+# MDEV-15630 uuid() function evaluates at wrong time in query
+#
+CREATE TABLE t1 (id INT);
+INSERT INTO t1 VALUES (1),(2),(3);
+SELECT COUNT(1), UUID() as uid FROM t1 GROUP BY uid;
+COUNT(1) uid
+1 xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
+1 xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
+1 xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
+DROP TABLE t1;
+#
# End of 5.5 tests
#
#
diff --git a/mysql-test/main/func_misc.test b/mysql-test/main/func_misc.test
index 9f452e632ec..f144236bfdb 100644
--- a/mysql-test/main/func_misc.test
+++ b/mysql-test/main/func_misc.test
@@ -607,6 +607,17 @@ SELECT NAME_CONST('a', -(1 AND 2)) OR 1;
SELECT NAME_CONST('a', -(1)) OR 1;
--echo #
+--echo # MDEV-15630 uuid() function evaluates at wrong time in query
+--echo #
+
+CREATE TABLE t1 (id INT);
+INSERT INTO t1 VALUES (1),(2),(3);
+--replace_column 2 xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
+SELECT COUNT(1), UUID() as uid FROM t1 GROUP BY uid;
+DROP TABLE t1;
+
+
+--echo #
--echo # End of 5.5 tests
--echo #
diff --git a/mysql-test/main/func_str.result b/mysql-test/main/func_str.result
index 2b376373f51..07dca08c819 100644
--- a/mysql-test/main/func_str.result
+++ b/mysql-test/main/func_str.result
@@ -4755,6 +4755,43 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
Warnings:
Note 1003 select char(0xdf) AS `CHAR(0xDF)`
#
+# MDEV-15619 using CONVERT() inside AES_ENCRYPT() in an UPDATE corrupts data
+#
+CREATE TABLE t1 (
+id int(11) NOT NULL,
+session_id varchar(255) DEFAULT NULL,
+directory mediumtext,
+checksum int(10) DEFAULT NULL,
+last_update datetime DEFAULT NULL,
+PRIMARY KEY (id),
+KEY lastupdate (last_update)
+) DEFAULT CHARSET=latin1;
+INSERT INTO t1 VALUES (1,'',NULL,38391,'2017-06-24 07:35:28');
+UPDATE t1 SET directory = AES_ENCRYPT(CONVERT('test stringrererejrjerjehrjekhrjkehrjkehrkjehrjkerhkjehrjekrhkjehrkjerhjkehrkjehrkjehrjkehrjkehrjkehrjkerjkehrjkehrjkehrjke rekjhrejrejhrjehgrehjgrhjerjhegrjherejhgrjhegrjehgrjhegrejhrgjehgrjhegrjhegrjhergjhegrjhegrhjegrjerhthkjjkdhjkgdfjkgjkdgdjkfjkhgjkfdhjgjkfdghkjdfghkjfdghfjkdghkdjfghdkjfghfjkdghfkjdghkjfdghfkjdghfkdjghfkjdghfdjkghjkdfhgdfjkghfjkdghfjkdghfjdkghfjkdghkfjdghfkjdghfkjdghkjdfghfjdkghjkfdghkjdfhgjkdfhgjkfdhgkjfdghkfjdhgkjfdgdjkejktjherjthkjrethkjrethjkerthjkerhtjkerhtkjerhtjkerhtjkerhtjkrehtkjerhtkjrehtjkrehtkjrehtkjerhtkjerhtjkrehtkjrehtjkrehtkjrethjkrethkjrehtkjethjkerhtjkrehtjkretkjerhtkjrehtjkerhtjkrehtjrehtkjrekjtrfgdsfgdhjsghjgfdhjsfhjdfgdhjshjdshjfghjdsfgjhsfgjhsdfgjhdsfgjdhsfgsjhfgjhsdfgsdjhfgjdhsfdjshfgdsjhfgjsdhfdjshfgdjhsfgdjshfgjdhsfgjhsdfgjhsdgfjhsdgfjhdsgfjhsgfjhsdgfjhdsgfhjsdehkjthrkjethjkre' USING latin1), '95F5A1F52A554'), last_update= NOW();
+SELECT directory IS NULL FROM t1;
+directory IS NULL
+0
+DROP TABLE t1;
+CREATE TABLE t1 (
+id int(11) NOT NULL PRIMARY KEY,
+directory mediumtext
+) DEFAULT CHARSET=latin1;
+INSERT INTO t1 VALUES (1,AES_ENCRYPT(CONVERT(REPEAT('a',800) USING latin1),'95F5A1F52A554'));
+SELECT AES_DECRYPT(directory,'95F5A1F52A554') FROM t1;
+AES_DECRYPT(directory,'95F5A1F52A554')
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+DROP TABLE t1;
+SET @enc=AES_ENCRYPT(REPEAT(_latin1'a',800),'95F5A1F52A554');
+CREATE TABLE t1 (
+id int(11) NOT NULL PRIMARY KEY,
+directory mediumtext
+) DEFAULT CHARSET=latin1;
+INSERT INTO t1 VALUES (1,AES_DECRYPT(CONVERT(@enc USING binary),'95F5A1F52A554'));
+SELECT * FROM t1;
+id directory
+1 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+DROP TABLE t1;
+#
# Start of 10.1 tests
#
#
diff --git a/mysql-test/main/func_str.test b/mysql-test/main/func_str.test
index dbb7502a3ec..4165e147768 100644
--- a/mysql-test/main/func_str.test
+++ b/mysql-test/main/func_str.test
@@ -1822,6 +1822,41 @@ EXPLAIN EXTENDED SELECT CHAR(0xDF USING `binary`);
EXPLAIN EXTENDED SELECT CHAR(0xDF);
--echo #
+--echo # MDEV-15619 using CONVERT() inside AES_ENCRYPT() in an UPDATE corrupts data
+--echo #
+
+CREATE TABLE t1 (
+ id int(11) NOT NULL,
+ session_id varchar(255) DEFAULT NULL,
+ directory mediumtext,
+ checksum int(10) DEFAULT NULL,
+ last_update datetime DEFAULT NULL,
+ PRIMARY KEY (id),
+ KEY lastupdate (last_update)
+) DEFAULT CHARSET=latin1;
+INSERT INTO t1 VALUES (1,'',NULL,38391,'2017-06-24 07:35:28');
+UPDATE t1 SET directory = AES_ENCRYPT(CONVERT('test stringrererejrjerjehrjekhrjkehrjkehrkjehrjkerhkjehrjekrhkjehrkjerhjkehrkjehrkjehrjkehrjkehrjkehrjkerjkehrjkehrjkehrjke rekjhrejrejhrjehgrehjgrhjerjhegrjherejhgrjhegrjehgrjhegrejhrgjehgrjhegrjhegrjhergjhegrjhegrhjegrjerhthkjjkdhjkgdfjkgjkdgdjkfjkhgjkfdhjgjkfdghkjdfghkjfdghfjkdghkdjfghdkjfghfjkdghfkjdghkjfdghfkjdghfkdjghfkjdghfdjkghjkdfhgdfjkghfjkdghfjkdghfjdkghfjkdghkfjdghfkjdghfkjdghkjdfghfjdkghjkfdghkjdfhgjkdfhgjkfdhgkjfdghkfjdhgkjfdgdjkejktjherjthkjrethkjrethjkerthjkerhtjkerhtkjerhtjkerhtjkerhtjkrehtkjerhtkjrehtjkrehtkjrehtkjerhtkjerhtjkrehtkjrehtjkrehtkjrethjkrethkjrehtkjethjkerhtjkrehtjkretkjerhtkjrehtjkerhtjkrehtjrehtkjrekjtrfgdsfgdhjsghjgfdhjsfhjdfgdhjshjdshjfghjdsfgjhsfgjhsdfgjhdsfgjdhsfgsjhfgjhsdfgsdjhfgjdhsfdjshfgdsjhfgjsdhfdjshfgdjhsfgdjshfgjdhsfgjhsdfgjhsdgfjhsdgfjhdsgfjhsgfjhsdgfjhdsgfhjsdehkjthrkjethjkre' USING latin1), '95F5A1F52A554'), last_update= NOW();
+SELECT directory IS NULL FROM t1;
+DROP TABLE t1;
+
+CREATE TABLE t1 (
+ id int(11) NOT NULL PRIMARY KEY,
+ directory mediumtext
+) DEFAULT CHARSET=latin1;
+INSERT INTO t1 VALUES (1,AES_ENCRYPT(CONVERT(REPEAT('a',800) USING latin1),'95F5A1F52A554'));
+SELECT AES_DECRYPT(directory,'95F5A1F52A554') FROM t1;
+DROP TABLE t1;
+
+SET @enc=AES_ENCRYPT(REPEAT(_latin1'a',800),'95F5A1F52A554');
+CREATE TABLE t1 (
+ id int(11) NOT NULL PRIMARY KEY,
+ directory mediumtext
+) DEFAULT CHARSET=latin1;
+INSERT INTO t1 VALUES (1,AES_DECRYPT(CONVERT(@enc USING binary),'95F5A1F52A554'));
+SELECT * FROM t1;
+DROP TABLE t1;
+
+--echo #
--echo # Start of 10.1 tests
--echo #
diff --git a/mysql-test/main/lock.result b/mysql-test/main/lock.result
index 00dbb166ffb..e3fd16ee59a 100644
--- a/mysql-test/main/lock.result
+++ b/mysql-test/main/lock.result
@@ -489,3 +489,19 @@ unlock tables;
disconnect con1;
connection default;
drop table t1;
+#
+# MDEV-15769: Assertion `!is_set() || (m_status == DA_OK_BULK && is_bulk_op())' failed in Diagnostics_area::set_ok_status
+#
+CREATE TABLE t1 (a INT);
+CREATE TABLE t2 (b INT);
+LOCK TABLE t1 READ;
+connect con1,localhost,root,,test;
+LOCK TABLE t2 WRITE;
+SET lock_wait_timeout= 1;
+FLUSH TABLES;
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+UNLOCK TABLES;
+disconnect con1;
+connection default;
+UNLOCK TABLES;
+DROP TABLE t1, t2;
diff --git a/mysql-test/main/lock.test b/mysql-test/main/lock.test
index 2e164de9b93..2c2c5d42783 100644
--- a/mysql-test/main/lock.test
+++ b/mysql-test/main/lock.test
@@ -598,3 +598,24 @@ unlock tables;
disconnect con1;
connection default;
drop table t1;
+
+--echo #
+--echo # MDEV-15769: Assertion `!is_set() || (m_status == DA_OK_BULK && is_bulk_op())' failed in Diagnostics_area::set_ok_status
+--echo #
+CREATE TABLE t1 (a INT);
+CREATE TABLE t2 (b INT);
+LOCK TABLE t1 READ;
+
+--connect (con1,localhost,root,,test)
+LOCK TABLE t2 WRITE;
+SET lock_wait_timeout= 1;
+--error ER_LOCK_WAIT_TIMEOUT
+FLUSH TABLES;
+
+# Cleanup
+UNLOCK TABLES;
+--disconnect con1
+--connection default
+UNLOCK TABLES;
+DROP TABLE t1, t2;
+
diff --git a/mysql-test/main/mdev375.result b/mysql-test/main/mdev375.result
index d7a66ebd6dd..0ae8375ff24 100644
--- a/mysql-test/main/mdev375.result
+++ b/mysql-test/main/mdev375.result
@@ -1,5 +1,13 @@
SET GLOBAL log_warnings=4;
-SET GLOBAL max_connections=2;
+SET GLOBAL max_connections=10;
+connect tmp_con1,localhost,root,,;
+connect tmp_con2,localhost,root,,;
+connect tmp_con3,localhost,root,,;
+connect tmp_con4,localhost,root,,;
+connect tmp_con5,localhost,root,,;
+connect tmp_con6,localhost,root,,;
+connect tmp_con7,localhost,root,,;
+connect tmp_con8,localhost,root,,;
connect con1,localhost,root,,;
SELECT 1;
1
@@ -15,6 +23,6 @@ SELECT 0;
0
show status like "Threads_connected";
Variable_name Value
-Threads_connected 3
+Threads_connected 11
SET GLOBAL log_warnings=default;
SET GLOBAL max_connections=default;
diff --git a/mysql-test/main/mdev375.test b/mysql-test/main/mdev375.test
index 92e403b6513..759f7bd31f0 100644
--- a/mysql-test/main/mdev375.test
+++ b/mysql-test/main/mdev375.test
@@ -4,7 +4,16 @@
--source include/not_embedded.inc
SET GLOBAL log_warnings=4;
-SET GLOBAL max_connections=2;
+SET GLOBAL max_connections=10;
+
+--connect (tmp_con1,localhost,root,,)
+--connect (tmp_con2,localhost,root,,)
+--connect (tmp_con3,localhost,root,,)
+--connect (tmp_con4,localhost,root,,)
+--connect (tmp_con5,localhost,root,,)
+--connect (tmp_con6,localhost,root,,)
+--connect (tmp_con7,localhost,root,,)
+--connect (tmp_con8,localhost,root,,)
--connect (con1,localhost,root,,)
SELECT 1;
diff --git a/mysql-test/main/myisam.result b/mysql-test/main/myisam.result
index cbc475cfd8a..4864ef0bb13 100644
--- a/mysql-test/main/myisam.result
+++ b/mysql-test/main/myisam.result
@@ -1938,16 +1938,17 @@ DROP TABLE t1;
#
# BUG#48438 - crash with error in unioned query against merge table and view...
#
-SET GLOBAL table_open_cache=3;
+SET @save_table_open_cache=@@table_open_cache;
+SET GLOBAL table_open_cache=10;
CREATE TABLE t1(a INT);
-SELECT 1 FROM t1 AS a1, t1 AS a2, t1 AS a3, t1 AS a4 FOR UPDATE;
+SELECT 1 FROM t1 AS a1, t1 AS a2, t1 AS a3, t1 AS a4, t1 AS a5, t1 AS a6, t1 AS a7, t1 AS a8, t1 AS a9, t1 AS a10, t1 AS a11 FOR UPDATE;
1
SELECT TABLE_ROWS, DATA_LENGTH FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t1';
TABLE_ROWS DATA_LENGTH
0 0
DROP TABLE t1;
-SET GLOBAL table_open_cache=DEFAULT;
+SET GLOBAL table_open_cache=@save_table_open_cache;
End of 5.0 tests
create table t1 (a int not null, key `a` (a) key_block_size=1024);
show create table t1;
diff --git a/mysql-test/main/myisam.test b/mysql-test/main/myisam.test
index 24f3ff783c9..63f5f6672f2 100644
--- a/mysql-test/main/myisam.test
+++ b/mysql-test/main/myisam.test
@@ -1220,13 +1220,14 @@ DROP TABLE t1;
--echo #
--echo # BUG#48438 - crash with error in unioned query against merge table and view...
--echo #
-SET GLOBAL table_open_cache=3;
+SET @save_table_open_cache=@@table_open_cache;
+SET GLOBAL table_open_cache=10;
CREATE TABLE t1(a INT);
-SELECT 1 FROM t1 AS a1, t1 AS a2, t1 AS a3, t1 AS a4 FOR UPDATE;
+SELECT 1 FROM t1 AS a1, t1 AS a2, t1 AS a3, t1 AS a4, t1 AS a5, t1 AS a6, t1 AS a7, t1 AS a8, t1 AS a9, t1 AS a10, t1 AS a11 FOR UPDATE;
SELECT TABLE_ROWS, DATA_LENGTH FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t1';
DROP TABLE t1;
-SET GLOBAL table_open_cache=DEFAULT;
+SET GLOBAL table_open_cache=@save_table_open_cache;
--echo End of 5.0 tests
diff --git a/mysql-test/main/myisam_recover.result b/mysql-test/main/myisam_recover.result
index 12184ad0ca6..1af3dbf9ad5 100644
--- a/mysql-test/main/myisam_recover.result
+++ b/mysql-test/main/myisam_recover.result
@@ -18,6 +18,7 @@ connection con1;
call mtr.add_suppression("Got an error from thread_id=.*ha_myisam.cc:");
call mtr.add_suppression("MySQL thread id .*, query id .* localhost.*root Checking table");
call mtr.add_suppression(" '\..test.t1'");
+set @save_table_open_cache=@@table_open_cache;
set global table_open_cache=256;
set global table_definition_cache=400;
drop procedure if exists p_create;
@@ -98,7 +99,7 @@ prepare stmt from @drop_table_stmt;
execute stmt;
deallocate prepare stmt;
set @@global.table_definition_cache=default;
-set @@global.table_open_cache=default;
+set @@global.table_open_cache=@save_table_open_cache;
disconnect con1;
connection default;
#
diff --git a/mysql-test/main/myisam_recover.test b/mysql-test/main/myisam_recover.test
index 86a4d16d0f9..316be56609b 100644
--- a/mysql-test/main/myisam_recover.test
+++ b/mysql-test/main/myisam_recover.test
@@ -23,6 +23,7 @@ call mtr.add_suppression("Got an error from thread_id=.*ha_myisam.cc:");
call mtr.add_suppression("MySQL thread id .*, query id .* localhost.*root Checking table");
call mtr.add_suppression(" '\..test.t1'");
+set @save_table_open_cache=@@table_open_cache;
set global table_open_cache=256;
set global table_definition_cache=400;
--disable_warnings
@@ -104,7 +105,7 @@ prepare stmt from @drop_table_stmt;
execute stmt;
deallocate prepare stmt;
set @@global.table_definition_cache=default;
-set @@global.table_open_cache=default;
+set @@global.table_open_cache=@save_table_open_cache;
disconnect con1;
connection default;
--enable_ps_protocol
diff --git a/mysql-test/main/mysqld--help,win.rdiff b/mysql-test/main/mysqld--help,win.rdiff
index 367744f6f5d..89d2cd36112 100644
--- a/mysql-test/main/mysqld--help,win.rdiff
+++ b/mysql-test/main/mysqld--help,win.rdiff
@@ -105,10 +105,10 @@
sync-relay-log-info 10000
sysdate-is-now FALSE
system-versioning-alter-history ERROR
--table-cache 431
+-table-cache 421
+table-cache 2000
table-definition-cache 400
--table-open-cache 431
+-table-open-cache 421
+table-open-cache 2000
table-open-cache-instances 8
tc-heuristic-recover OFF
diff --git a/mysql-test/main/mysqld--help.result b/mysql-test/main/mysqld--help.result
index ef6a49df08b..6c997a9e936 100644
--- a/mysql-test/main/mysqld--help.result
+++ b/mysql-test/main/mysqld--help.result
@@ -1652,9 +1652,9 @@ sync-relay-log 10000
sync-relay-log-info 10000
sysdate-is-now FALSE
system-versioning-alter-history ERROR
-table-cache 431
+table-cache 421
table-definition-cache 400
-table-open-cache 431
+table-open-cache 421
table-open-cache-instances 8
tc-heuristic-recover OFF
tcp-keepalive-interval 0
diff --git a/mysql-test/main/mysqltest.test b/mysql-test/main/mysqltest.test
index d6c68ecf3c2..b545e354040 100644
--- a/mysql-test/main/mysqltest.test
+++ b/mysql-test/main/mysqltest.test
@@ -684,7 +684,7 @@ remove_file $MYSQLTEST_VARDIR/tmp/mysqltest.sql;
# Too many errorcodes specified
--error 1
---exec echo "--error 1,2,3,4,5,6,7,8,9,10,11" | $MYSQL_TEST 2>&1
+--exec echo "--error 1,2,3,4,5,6,7,8,9,10,11,12,13" | $MYSQL_TEST 2>&1
# ----------------------------------------------------------------------------
diff --git a/mysql-test/main/perror.result b/mysql-test/main/perror.result
index 432a4fd4c04..46554442721 100644
--- a/mysql-test/main/perror.result
+++ b/mysql-test/main/perror.result
@@ -3,4 +3,4 @@ MySQL error code 1062 (ER_DUP_ENTRY): Duplicate entry '%-.192s' for key %d
MySQL error code 1408 (ER_STARTUP): %s: ready for connections.
Version: '%s' socket: '%s' port: %d %s
MySQL error code 1459 (ER_TABLE_NEEDS_UPGRADE): Upgrade required. Please do "REPAIR %s %`s" or dump/reload to fix it!
-MySQL error code 1461 (ER_MAX_PREPARED_STMT_COUNT_REACHED): Can't create more than max_prepared_stmt_count statements (current value: %lu)
+MySQL error code 1461 (ER_MAX_PREPARED_STMT_COUNT_REACHED): Can't create more than max_prepared_stmt_count statements (current value: %u)
diff --git a/mysql-test/main/ps.result b/mysql-test/main/ps.result
index 45e3f60e431..89de00a38bc 100644
--- a/mysql-test/main/ps.result
+++ b/mysql-test/main/ps.result
@@ -821,7 +821,7 @@ Warnings:
Warning 1292 Truncated incorrect max_prepared_stmt_count value: '10000000000000000'
select @@max_prepared_stmt_count;
@@max_prepared_stmt_count
-1048576
+4294967295
set global max_prepared_stmt_count=default;
select @@max_prepared_stmt_count;
@@max_prepared_stmt_count
diff --git a/mysql-test/main/sp.result b/mysql-test/main/sp.result
index 5e457fae1e0..582ea33d903 100644
--- a/mysql-test/main/sp.result
+++ b/mysql-test/main/sp.result
@@ -7955,7 +7955,7 @@ CLOSE cur1;
end|
set @tmp_toc= @@table_open_cache;
set @tmp_tdc= @@table_definition_cache;
-set global table_open_cache=1;
+set global table_open_cache=10;
set global table_definition_cache=1;
Warnings:
Warning 1292 Truncated incorrect table_definition_cache value: '1'
diff --git a/mysql-test/main/sp.test b/mysql-test/main/sp.test
index c97f6dbba68..7a6fc3e711d 100644
--- a/mysql-test/main/sp.test
+++ b/mysql-test/main/sp.test
@@ -9403,7 +9403,7 @@ DELIMITER ;|
set @tmp_toc= @@table_open_cache;
set @tmp_tdc= @@table_definition_cache;
-set global table_open_cache=1;
+set global table_open_cache=10;
set global table_definition_cache=1;
call p1();
diff --git a/mysql-test/main/statistics.result b/mysql-test/main/statistics.result
index ffaaf09acc8..8f87b166e8d 100644
--- a/mysql-test/main/statistics.result
+++ b/mysql-test/main/statistics.result
@@ -1664,6 +1664,24 @@ db_name table_name column_name HEX(min_value) HEX(max_value) nulls_ratio avg_fre
test t1 a D879626AF872675F73E662F8 D879626AF872675F73E662F8 0.0000 1.0000 0 NULL NULL
drop table t1;
#
+# MDEB-9744: session optimizer_use_condition_selectivity=5 causing SQL Error (1918):
+# Encountered illegal value '' when converting to DECIMAL
+#
+set @save_optimizer_use_condition_selectivity= @@optimizer_use_condition_selectivity;
+set optimizer_use_condition_selectivity=3, use_stat_tables=preferably;
+create table t1 (id int(10),cost decimal(9,2)) engine=innodb;
+ANALYZE TABLE t1 PERSISTENT FOR ALL;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+create temporary table t2 (id int);
+insert into t2 (id) select id from t1 where cost > 0;
+select * from t2;
+id
+set use_stat_tables=@save_use_stat_tables;
+set optimizer_use_condition_selectivity= @save_optimizer_use_condition_selectivity;
+drop table t1,t2;
+#
# MDEV-9590: Always print "Engine-independent statistic" warnings and
# might be filtering columns unintentionally from engines
#
diff --git a/mysql-test/main/statistics.test b/mysql-test/main/statistics.test
index e9ecb56a1cb..368cee0f8c8 100644
--- a/mysql-test/main/statistics.test
+++ b/mysql-test/main/statistics.test
@@ -800,6 +800,25 @@ select db_name, table_name, column_name,
drop table t1;
--echo #
+--echo # MDEB-9744: session optimizer_use_condition_selectivity=5 causing SQL Error (1918):
+--echo # Encountered illegal value '' when converting to DECIMAL
+--echo #
+
+set @save_optimizer_use_condition_selectivity= @@optimizer_use_condition_selectivity;
+set optimizer_use_condition_selectivity=3, use_stat_tables=preferably;
+
+create table t1 (id int(10),cost decimal(9,2)) engine=innodb;
+ANALYZE TABLE t1 PERSISTENT FOR ALL;
+
+create temporary table t2 (id int);
+insert into t2 (id) select id from t1 where cost > 0;
+select * from t2;
+
+set use_stat_tables=@save_use_stat_tables;
+set optimizer_use_condition_selectivity= @save_optimizer_use_condition_selectivity;
+drop table t1,t2;
+
+--echo #
--echo # MDEV-9590: Always print "Engine-independent statistic" warnings and
--echo # might be filtering columns unintentionally from engines
--echo #
diff --git a/mysql-test/main/variables.result b/mysql-test/main/variables.result
index 89b2367cec8..9224aa82e8a 100644
--- a/mysql-test/main/variables.result
+++ b/mysql-test/main/variables.result
@@ -568,6 +568,7 @@ set sql_safe_updates=1;
set sql_select_limit=1;
set sql_select_limit=default;
set sql_warnings=1;
+set @save_table_open_cache=@@table_open_cache;
set global table_open_cache=100;
set default_storage_engine=myisam;
set global thread_cache_size=100;
@@ -748,11 +749,11 @@ Warnings:
Warning 1292 Truncated incorrect table_open_cache value: '-1'
SHOW VARIABLES LIKE 'table_open_cache';
Variable_name Value
-table_open_cache 1
+table_open_cache 10
SELECT * FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME LIKE 'table_open_cache';
VARIABLE_NAME VARIABLE_VALUE
-TABLE_OPEN_CACHE 1
-SET GLOBAL table_open_cache=DEFAULT;
+TABLE_OPEN_CACHE 10
+SET GLOBAL table_open_cache=@save_table_open_cache;
set character_set_results=NULL;
select ifnull(@@character_set_results,"really null");
ifnull(@@character_set_results,"really null")
diff --git a/mysql-test/main/variables.test b/mysql-test/main/variables.test
index 4da3cac3a73..fa0bdc251b5 100644
--- a/mysql-test/main/variables.test
+++ b/mysql-test/main/variables.test
@@ -343,6 +343,7 @@ set sql_select_limit=1;
# reset it, so later tests don't get confused
set sql_select_limit=default;
set sql_warnings=1;
+set @save_table_open_cache=@@table_open_cache;
set global table_open_cache=100;
set default_storage_engine=myisam;
set global thread_cache_size=100;
@@ -502,7 +503,7 @@ SELECT * FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME LIKE 'MYI
SET GLOBAL table_open_cache=-1;
SHOW VARIABLES LIKE 'table_open_cache';
SELECT * FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME LIKE 'table_open_cache';
-SET GLOBAL table_open_cache=DEFAULT;
+SET GLOBAL table_open_cache=@save_table_open_cache;
#
# Bugs12363: character_set_results is nullable,
diff --git a/mysql-test/main/view.result b/mysql-test/main/view.result
index e61e2d2663d..63207ea6a67 100644
--- a/mysql-test/main/view.result
+++ b/mysql-test/main/view.result
@@ -5527,6 +5527,203 @@ View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select group_concat(`t1`.`str` separator '\\') AS `GROUP_CONCAT(str SEPARATOR '\\')` from `t1` latin1 latin1_swedish_ci
drop view v1;
drop table t1;
+CREATE TABLE IF NOT EXISTS t0 (f0 INT);
+CREATE TABLE IF NOT EXISTS t1 (f1 INT);
+CREATE TABLE IF NOT EXISTS t2 (f2 INT);
+CREATE TABLE IF NOT EXISTS t3 (f3 INT);
+CREATE TABLE IF NOT EXISTS t4 (f4 INT);
+CREATE TABLE IF NOT EXISTS t5 (f5 INT);
+CREATE TABLE IF NOT EXISTS t6 (f6 INT);
+CREATE TABLE IF NOT EXISTS t7 (f7 INT);
+CREATE TABLE IF NOT EXISTS t8 (f8 INT);
+CREATE TABLE IF NOT EXISTS t9 (f9 INT);
+CREATE TABLE IF NOT EXISTS t10 (f10 INT);
+CREATE TABLE IF NOT EXISTS t11 (f11 INT);
+CREATE TABLE IF NOT EXISTS t12 (f12 INT);
+CREATE TABLE IF NOT EXISTS t13 (f13 INT);
+CREATE TABLE IF NOT EXISTS t14 (f14 INT);
+CREATE TABLE IF NOT EXISTS t15 (f15 INT);
+CREATE TABLE IF NOT EXISTS t16 (f16 INT);
+CREATE TABLE IF NOT EXISTS t17 (f17 INT);
+CREATE TABLE IF NOT EXISTS t18 (f18 INT);
+CREATE TABLE IF NOT EXISTS t19 (f19 INT);
+CREATE TABLE IF NOT EXISTS t20 (f20 INT);
+CREATE TABLE IF NOT EXISTS t21 (f21 INT);
+CREATE TABLE IF NOT EXISTS t22 (f22 INT);
+CREATE TABLE IF NOT EXISTS t23 (f23 INT);
+CREATE TABLE IF NOT EXISTS t24 (f24 INT);
+CREATE TABLE IF NOT EXISTS t25 (f25 INT);
+CREATE TABLE IF NOT EXISTS t26 (f26 INT);
+CREATE TABLE IF NOT EXISTS t27 (f27 INT);
+CREATE TABLE IF NOT EXISTS t28 (f28 INT);
+CREATE TABLE IF NOT EXISTS t29 (f29 INT);
+CREATE TABLE IF NOT EXISTS t30 (f30 INT);
+CREATE TABLE IF NOT EXISTS t31 (f31 INT);
+CREATE TABLE IF NOT EXISTS t32 (f32 INT);
+CREATE TABLE IF NOT EXISTS t33 (f33 INT);
+CREATE TABLE IF NOT EXISTS t34 (f34 INT);
+CREATE TABLE IF NOT EXISTS t35 (f35 INT);
+CREATE TABLE IF NOT EXISTS t36 (f36 INT);
+CREATE TABLE IF NOT EXISTS t37 (f37 INT);
+CREATE TABLE IF NOT EXISTS t38 (f38 INT);
+CREATE TABLE IF NOT EXISTS t39 (f39 INT);
+CREATE TABLE IF NOT EXISTS t40 (f40 INT);
+CREATE TABLE IF NOT EXISTS t41 (f41 INT);
+CREATE TABLE IF NOT EXISTS t42 (f42 INT);
+CREATE TABLE IF NOT EXISTS t43 (f43 INT);
+CREATE TABLE IF NOT EXISTS t44 (f44 INT);
+CREATE TABLE IF NOT EXISTS t45 (f45 INT);
+CREATE TABLE IF NOT EXISTS t46 (f46 INT);
+CREATE TABLE IF NOT EXISTS t47 (f47 INT);
+CREATE TABLE IF NOT EXISTS t48 (f48 INT);
+CREATE TABLE IF NOT EXISTS t49 (f49 INT);
+CREATE TABLE IF NOT EXISTS t50 (f50 INT);
+CREATE TABLE IF NOT EXISTS t51 (f51 INT);
+CREATE TABLE IF NOT EXISTS t52 (f52 INT);
+CREATE TABLE IF NOT EXISTS t53 (f53 INT);
+CREATE TABLE IF NOT EXISTS t54 (f54 INT);
+CREATE TABLE IF NOT EXISTS t55 (f55 INT);
+CREATE TABLE IF NOT EXISTS t56 (f56 INT);
+CREATE TABLE IF NOT EXISTS t57 (f57 INT);
+CREATE TABLE IF NOT EXISTS t58 (f58 INT);
+CREATE TABLE IF NOT EXISTS t59 (f59 INT);
+CREATE TABLE IF NOT EXISTS t60 (f60 INT);
+CREATE OR REPLACE VIEW v60 AS SELECT * FROM t60;
+EXPLAIN
+SELECT t0.*
+FROM t0
+JOIN t1
+ON t1.f1 = t0.f0
+LEFT JOIN t2
+ON t0.f0 = t2.f2
+LEFT JOIN t3
+ON t0.f0 = t3.f3
+LEFT JOIN t4
+ON t0.f0 = t4.f4
+LEFT JOIN t5
+ON t4.f4 = t5.f5
+LEFT JOIN t6
+ON t0.f0 = t6.f6
+LEFT JOIN t7
+ON t0.f0 = t7.f7
+LEFT JOIN t8
+ON t0.f0 = t8.f8
+LEFT JOIN t9
+ON t0.f0 = t9.f9
+LEFT JOIN t10
+ON t0.f0 = t10.f10
+LEFT JOIN t11
+ON t0.f0 = t11.f11
+LEFT JOIN t12
+ON t0.f0 = t12.f12
+LEFT JOIN t13
+ON t0.f0 = t13.f13
+LEFT JOIN t14
+ON t0.f0 = t14.f14
+LEFT JOIN t15
+ON t0.f0 = t15.f15
+LEFT JOIN t16
+ON t0.f0 = t16.f16
+LEFT JOIN t17
+ON t0.f0 = t17.f17
+LEFT JOIN t18
+ON t0.f0 = t18.f18
+LEFT JOIN t19
+ON t18.f18 = t19.f19
+LEFT JOIN t20
+ON t20.f20 = t19.f19
+LEFT JOIN t21
+ON t20.f20 = t21.f21
+LEFT JOIN t22
+ON t19.f19 = t22.f22
+LEFT JOIN t23
+ON t23.f23 = t0.f0
+LEFT JOIN t24
+ON t24.f24 = t23.f23
+LEFT JOIN t25
+ON t0.f0 = t25.f25
+LEFT JOIN t26
+ON t26.f26 = t0.f0
+LEFT JOIN t27
+ON t27.f27 = t0.f0
+LEFT JOIN t28
+ON t0.f0 = t28.f28
+LEFT JOIN t29
+ON t0.f0 = t29.f29
+LEFT JOIN t30
+ON t30.f30 = t0.f0
+LEFT JOIN t31
+ON t0.f0 = t31.f31
+LEFT JOIN t32
+ON t32.f32 = t31.f31
+LEFT JOIN t33
+ON t33.f33 = t0.f0
+LEFT JOIN t34
+ON t33.f33 = t34.f34
+LEFT JOIN t35
+ON t33.f33 = t35.f35
+LEFT JOIN t36
+ON t36.f36 = t0.f0
+LEFT JOIN t37
+ON t32.f32 = t37.f37
+LEFT JOIN t38
+ON t31.f31 = t38.f38
+LEFT JOIN t39
+ON t39.f39 = t0.f0
+LEFT JOIN t40
+ON t40.f40 = t39.f39
+LEFT JOIN t41
+ON t41.f41 = t0.f0
+LEFT JOIN t42
+ON t42.f42 = t41.f41
+LEFT JOIN t43
+ON t43.f43 = t41.f41
+LEFT JOIN t44
+ON t44.f44 = t0.f0
+LEFT JOIN t45
+ON t45.f45 = t0.f0
+LEFT JOIN t46
+ON t46.f46 = t0.f0
+LEFT JOIN t47
+ON t47.f47 = t0.f0
+LEFT JOIN t48
+ON t48.f48 = t0.f0
+LEFT JOIN t49
+ON t0.f0 = t49.f49
+LEFT JOIN t50
+ON t0.f0 = t50.f50
+LEFT JOIN t51
+ON t0.f0 = t51.f51
+LEFT JOIN t52
+ON t52.f52 = t0.f0
+LEFT JOIN t53
+ON t53.f53 = t0.f0
+LEFT JOIN t54
+ON t54.f54 = t0.f0
+LEFT JOIN t55
+ON t55.f55 = t0.f0
+LEFT JOIN t56
+ON t56.f56 = t0.f0
+LEFT JOIN t57
+ON t57.f57 = t0.f0
+LEFT JOIN t58
+ON t58.f58 = t57.f57
+LEFT JOIN t59
+ON t36.f36 = t59.f59
+LEFT JOIN v60
+ON t36.f36 = v60.f60
+;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table
+drop table t0, t1, t2, t3, t4, t5, t6, t7, t8, t9,
+t10, t11, t12, t13, t14, t15, t16, t17, t18,
+t19, t20, t21, t22, t23, t24, t25, t26, t27,
+t28, t29, t30, t31, t32, t33, t34, t35, t36,
+t37, t38, t39, t40, t41, t42, t43, t44, t45,
+t46, t47, t48, t49, t50, t51, t52, t53, t54,
+t55, t56, t57, t58, t59,t60;
+drop view v60;
# -----------------------------------------------------------------
# -- End of 5.5 tests.
# -----------------------------------------------------------------
diff --git a/mysql-test/main/view.test b/mysql-test/main/view.test
index f78ddd6f49e..82ef38f0eb6 100644
--- a/mysql-test/main/view.test
+++ b/mysql-test/main/view.test
@@ -5419,6 +5419,202 @@ SHOW CREATE VIEW v1;
drop view v1;
drop table t1;
+CREATE TABLE IF NOT EXISTS t0 (f0 INT);
+CREATE TABLE IF NOT EXISTS t1 (f1 INT);
+CREATE TABLE IF NOT EXISTS t2 (f2 INT);
+CREATE TABLE IF NOT EXISTS t3 (f3 INT);
+CREATE TABLE IF NOT EXISTS t4 (f4 INT);
+CREATE TABLE IF NOT EXISTS t5 (f5 INT);
+CREATE TABLE IF NOT EXISTS t6 (f6 INT);
+CREATE TABLE IF NOT EXISTS t7 (f7 INT);
+CREATE TABLE IF NOT EXISTS t8 (f8 INT);
+CREATE TABLE IF NOT EXISTS t9 (f9 INT);
+CREATE TABLE IF NOT EXISTS t10 (f10 INT);
+CREATE TABLE IF NOT EXISTS t11 (f11 INT);
+CREATE TABLE IF NOT EXISTS t12 (f12 INT);
+CREATE TABLE IF NOT EXISTS t13 (f13 INT);
+CREATE TABLE IF NOT EXISTS t14 (f14 INT);
+CREATE TABLE IF NOT EXISTS t15 (f15 INT);
+CREATE TABLE IF NOT EXISTS t16 (f16 INT);
+CREATE TABLE IF NOT EXISTS t17 (f17 INT);
+CREATE TABLE IF NOT EXISTS t18 (f18 INT);
+CREATE TABLE IF NOT EXISTS t19 (f19 INT);
+CREATE TABLE IF NOT EXISTS t20 (f20 INT);
+CREATE TABLE IF NOT EXISTS t21 (f21 INT);
+CREATE TABLE IF NOT EXISTS t22 (f22 INT);
+CREATE TABLE IF NOT EXISTS t23 (f23 INT);
+CREATE TABLE IF NOT EXISTS t24 (f24 INT);
+CREATE TABLE IF NOT EXISTS t25 (f25 INT);
+CREATE TABLE IF NOT EXISTS t26 (f26 INT);
+CREATE TABLE IF NOT EXISTS t27 (f27 INT);
+CREATE TABLE IF NOT EXISTS t28 (f28 INT);
+CREATE TABLE IF NOT EXISTS t29 (f29 INT);
+CREATE TABLE IF NOT EXISTS t30 (f30 INT);
+CREATE TABLE IF NOT EXISTS t31 (f31 INT);
+CREATE TABLE IF NOT EXISTS t32 (f32 INT);
+CREATE TABLE IF NOT EXISTS t33 (f33 INT);
+CREATE TABLE IF NOT EXISTS t34 (f34 INT);
+CREATE TABLE IF NOT EXISTS t35 (f35 INT);
+CREATE TABLE IF NOT EXISTS t36 (f36 INT);
+CREATE TABLE IF NOT EXISTS t37 (f37 INT);
+CREATE TABLE IF NOT EXISTS t38 (f38 INT);
+CREATE TABLE IF NOT EXISTS t39 (f39 INT);
+CREATE TABLE IF NOT EXISTS t40 (f40 INT);
+CREATE TABLE IF NOT EXISTS t41 (f41 INT);
+CREATE TABLE IF NOT EXISTS t42 (f42 INT);
+CREATE TABLE IF NOT EXISTS t43 (f43 INT);
+CREATE TABLE IF NOT EXISTS t44 (f44 INT);
+CREATE TABLE IF NOT EXISTS t45 (f45 INT);
+CREATE TABLE IF NOT EXISTS t46 (f46 INT);
+CREATE TABLE IF NOT EXISTS t47 (f47 INT);
+CREATE TABLE IF NOT EXISTS t48 (f48 INT);
+CREATE TABLE IF NOT EXISTS t49 (f49 INT);
+CREATE TABLE IF NOT EXISTS t50 (f50 INT);
+CREATE TABLE IF NOT EXISTS t51 (f51 INT);
+CREATE TABLE IF NOT EXISTS t52 (f52 INT);
+CREATE TABLE IF NOT EXISTS t53 (f53 INT);
+CREATE TABLE IF NOT EXISTS t54 (f54 INT);
+CREATE TABLE IF NOT EXISTS t55 (f55 INT);
+CREATE TABLE IF NOT EXISTS t56 (f56 INT);
+CREATE TABLE IF NOT EXISTS t57 (f57 INT);
+CREATE TABLE IF NOT EXISTS t58 (f58 INT);
+CREATE TABLE IF NOT EXISTS t59 (f59 INT);
+CREATE TABLE IF NOT EXISTS t60 (f60 INT);
+CREATE OR REPLACE VIEW v60 AS SELECT * FROM t60;
+
+EXPLAIN
+ SELECT t0.*
+FROM t0
+JOIN t1
+ ON t1.f1 = t0.f0
+LEFT JOIN t2
+ ON t0.f0 = t2.f2
+LEFT JOIN t3
+ ON t0.f0 = t3.f3
+LEFT JOIN t4
+ ON t0.f0 = t4.f4
+LEFT JOIN t5
+ ON t4.f4 = t5.f5
+LEFT JOIN t6
+ ON t0.f0 = t6.f6
+LEFT JOIN t7
+ ON t0.f0 = t7.f7
+LEFT JOIN t8
+ ON t0.f0 = t8.f8
+LEFT JOIN t9
+ ON t0.f0 = t9.f9
+LEFT JOIN t10
+ ON t0.f0 = t10.f10
+LEFT JOIN t11
+ ON t0.f0 = t11.f11
+LEFT JOIN t12
+ ON t0.f0 = t12.f12
+LEFT JOIN t13
+ ON t0.f0 = t13.f13
+LEFT JOIN t14
+ ON t0.f0 = t14.f14
+LEFT JOIN t15
+ ON t0.f0 = t15.f15
+LEFT JOIN t16
+ ON t0.f0 = t16.f16
+LEFT JOIN t17
+ ON t0.f0 = t17.f17
+LEFT JOIN t18
+ ON t0.f0 = t18.f18
+LEFT JOIN t19
+ ON t18.f18 = t19.f19
+LEFT JOIN t20
+ ON t20.f20 = t19.f19
+LEFT JOIN t21
+ ON t20.f20 = t21.f21
+LEFT JOIN t22
+ ON t19.f19 = t22.f22
+LEFT JOIN t23
+ ON t23.f23 = t0.f0
+LEFT JOIN t24
+ ON t24.f24 = t23.f23
+LEFT JOIN t25
+ ON t0.f0 = t25.f25
+LEFT JOIN t26
+ ON t26.f26 = t0.f0
+LEFT JOIN t27
+ ON t27.f27 = t0.f0
+LEFT JOIN t28
+ ON t0.f0 = t28.f28
+LEFT JOIN t29
+ ON t0.f0 = t29.f29
+LEFT JOIN t30
+ ON t30.f30 = t0.f0
+LEFT JOIN t31
+ ON t0.f0 = t31.f31
+LEFT JOIN t32
+ ON t32.f32 = t31.f31
+LEFT JOIN t33
+ ON t33.f33 = t0.f0
+LEFT JOIN t34
+ ON t33.f33 = t34.f34
+LEFT JOIN t35
+ ON t33.f33 = t35.f35
+LEFT JOIN t36
+ ON t36.f36 = t0.f0
+LEFT JOIN t37
+ ON t32.f32 = t37.f37
+LEFT JOIN t38
+ ON t31.f31 = t38.f38
+LEFT JOIN t39
+ ON t39.f39 = t0.f0
+LEFT JOIN t40
+ ON t40.f40 = t39.f39
+LEFT JOIN t41
+ ON t41.f41 = t0.f0
+LEFT JOIN t42
+ ON t42.f42 = t41.f41
+LEFT JOIN t43
+ ON t43.f43 = t41.f41
+LEFT JOIN t44
+ ON t44.f44 = t0.f0
+LEFT JOIN t45
+ ON t45.f45 = t0.f0
+LEFT JOIN t46
+ ON t46.f46 = t0.f0
+LEFT JOIN t47
+ ON t47.f47 = t0.f0
+LEFT JOIN t48
+ ON t48.f48 = t0.f0
+LEFT JOIN t49
+ ON t0.f0 = t49.f49
+LEFT JOIN t50
+ ON t0.f0 = t50.f50
+LEFT JOIN t51
+ ON t0.f0 = t51.f51
+LEFT JOIN t52
+ ON t52.f52 = t0.f0
+LEFT JOIN t53
+ ON t53.f53 = t0.f0
+LEFT JOIN t54
+ ON t54.f54 = t0.f0
+LEFT JOIN t55
+ ON t55.f55 = t0.f0
+LEFT JOIN t56
+ ON t56.f56 = t0.f0
+LEFT JOIN t57
+ ON t57.f57 = t0.f0
+LEFT JOIN t58
+ ON t58.f58 = t57.f57
+LEFT JOIN t59
+ ON t36.f36 = t59.f59
+LEFT JOIN v60
+ ON t36.f36 = v60.f60
+;
+drop table t0, t1, t2, t3, t4, t5, t6, t7, t8, t9,
+t10, t11, t12, t13, t14, t15, t16, t17, t18,
+t19, t20, t21, t22, t23, t24, t25, t26, t27,
+t28, t29, t30, t31, t32, t33, t34, t35, t36,
+t37, t38, t39, t40, t41, t42, t43, t44, t45,
+t46, t47, t48, t49, t50, t51, t52, t53, t54,
+t55, t56, t57, t58, t59,t60;
+drop view v60;
+
--echo # -----------------------------------------------------------------
--echo # -- End of 5.5 tests.
--echo # -----------------------------------------------------------------