summaryrefslogtreecommitdiff
path: root/mysql-test/t
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/t')
-rw-r--r--mysql-test/t/ctype_utf8.test9
-rw-r--r--mysql-test/t/disabled.def5
-rw-r--r--mysql-test/t/errors.test16
-rw-r--r--mysql-test/t/func_math.test8
-rw-r--r--mysql-test/t/func_time.test10
-rw-r--r--mysql-test/t/key_cache-master.opt1
-rw-r--r--mysql-test/t/keywords.test100
-rw-r--r--mysql-test/t/log_tables.test19
-rw-r--r--mysql-test/t/mysqlbinlog-master.opt1
-rw-r--r--mysql-test/t/mysqlbinlog.test15
-rw-r--r--mysql-test/t/not_embedded_server.test54
-rw-r--r--mysql-test/t/partition.test18
-rw-r--r--mysql-test/t/plugin_auth.test7
-rw-r--r--mysql-test/t/ps.test6
-rw-r--r--mysql-test/t/sp-bugs.test37
-rw-r--r--mysql-test/t/subselect.test18
-rw-r--r--mysql-test/t/system_mysql_db_fix40123.test2
-rw-r--r--mysql-test/t/system_mysql_db_fix50030.test2
-rw-r--r--mysql-test/t/system_mysql_db_fix50117.test2
-rw-r--r--mysql-test/t/type_blob.test13
-rw-r--r--mysql-test/t/union.test2
-rw-r--r--mysql-test/t/variables-big.test10
-rw-r--r--mysql-test/t/wl4435_generated.inc588
23 files changed, 932 insertions, 11 deletions
diff --git a/mysql-test/t/ctype_utf8.test b/mysql-test/t/ctype_utf8.test
index 5ce83a05f61..2aea21afe68 100644
--- a/mysql-test/t/ctype_utf8.test
+++ b/mysql-test/t/ctype_utf8.test
@@ -1497,6 +1497,15 @@ CREATE TABLE t1 (
INSERT INTO t1 VALUES (19, x'E0B696'), (30, x'E0B69AE0B798'), (61, x'E0B6AF'), (93, x'E0B799'), (52, x'E0B6A6'), (73, x'E0B6BBE0B78AE2808D'), (3, x'E0B686'), (56, x'E0B6AA'), (55, x'E0B6A9'), (70, x'E0B6B9'), (94, x'E0B79A'), (80, x'E0B785'), (25, x'E0B69AE0B791'), (48, x'E0B6A2'), (13, x'E0B690'), (86, x'E0B793'), (91, x'E0B79F'), (81, x'E0B786'), (79, x'E0B784'), (14, x'E0B691'), (99, x'E0B78A'), (8, x'E0B68B'), (68, x'E0B6B7'), (22, x'E0B69A'), (16, x'E0B693'), (33, x'E0B69AE0B7B3'), (38, x'E0B69AE0B79D'), (21, x'E0B683'), (11, x'E0B68E'), (77, x'E0B782'), (40, x'E0B69AE0B78A'), (101, x'E0B78AE2808DE0B6BB'), (35, x'E0B69AE0B79A'), (1, x'E0B7B4'), (9, x'E0B68C'), (96, x'E0B79C'), (6, x'E0B689'), (95, x'E0B79B'), (88, x'E0B796'), (64, x'E0B6B3'), (26, x'E0B69AE0B792'), (82, x'E0B78F'), (28, x'E0B69AE0B794'), (39, x'E0B69AE0B79E'), (97, x'E0B79D'), (2, x'E0B685'), (75, x'E0B780'), (34, x'E0B69AE0B799'), (69, x'E0B6B8'), (83, x'E0B790'), (18, x'E0B695'), (90, x'E0B7B2'), (17, x'E0B694'), (72, x'E0B6BB'), (66, x'E0B6B5'), (59, x'E0B6AD'), (44, x'E0B69E'), (15, x'E0B692'), (23, x'E0B69AE0B78F'), (65, x'E0B6B4'), (42, x'E0B69C'), (63, x'E0B6B1'), (85, x'E0B792'), (47, x'E0B6A1'), (49, x'E0B6A3'), (92, x'E0B7B3'), (78, x'E0B783'), (36, x'E0B69AE0B79B'), (4, x'E0B687'), (24, x'E0B69AE0B790'), (87, x'E0B794'), (37, x'E0B69AE0B79C'), (32, x'E0B69AE0B79F'), (29, x'E0B69AE0B796'), (43, x'E0B69D'), (62, x'E0B6B0'), (100, x'E0B78AE2808DE0B6BA'), (60, x'E0B6AE'), (45, x'E0B69F'), (12, x'E0B68F'), (46, x'E0B6A0'), (50, x'E0B6A5'), (51, x'E0B6A4'), (5, x'E0B688'), (76, x'E0B781'), (89, x'E0B798'), (74, x'E0B6BD'), (10, x'E0B68D'), (57, x'E0B6AB'), (71, x'E0B6BA'), (58, x'E0B6AC'), (27, x'E0B69AE0B793'), (54, x'E0B6A8'), (84, x'E0B791'), (31, x'E0B69AE0B7B2'), (98, x'E0B79E'), (53, x'E0B6A7'), (41, x'E0B69B'), (67, x'E0B6B6'), (7, x'E0B68A'), (20, x'E0B682');
SELECT predicted_order, hex(utf8_encoding) FROM t1 ORDER BY utf8_encoding COLLATE utf8_sinhala_ci;
DROP TABLE t1;
+#
+# Postfix for Bug#26474
+#
+SET NAMES utf8 COLLATE utf8_sinhala_ci;
+CREATE TABLE t1 (s1 VARCHAR(10) COLLATE utf8_sinhala_ci);
+INSERT INTO t1 VALUES ('a'),('ae'),('af');
+SELECT s1,hex(s1) FROM t1 ORDER BY s1;
+SELECT * FROM t1 ORDER BY s1;
+DROP TABLE t1;
--echo End of 5.4 tests
diff --git a/mysql-test/t/disabled.def b/mysql-test/t/disabled.def
index 2f0cd1401f1..e1d4e4f80b5 100644
--- a/mysql-test/t/disabled.def
+++ b/mysql-test/t/disabled.def
@@ -15,3 +15,8 @@ query_cache_28249 : Bug#43861 2009-03-25 main.query_cache_28249 fails spo
ctype_utf8mb4_ndb : Bug#55799, Bug#51907, disabled by Konstantin 2010-08-06
main.mysqlhotcopy_myisam : Bug#56817 2010-10-21 anitha mysqlhotcopy* fails
main.mysqlhotcopy_archive: Bug#56817 2010-10-21 anitha mysqlhotcopy* fails
+log_tables-big : Bug#48646 2010-11-15 mattiasj report already exists
+read_many_rows_innodb : Bug#37635 2010-11-15 mattiasj report already exists
+sum_distinct-big : Bug#56927 2010-11-15 mattiasj was not tested
+alter_table-big : Bug#37248 2010-11-15 mattiasj was not tested
+create-big : Bug#37248 2010-11-15 mattiasj was not tested
diff --git a/mysql-test/t/errors.test b/mysql-test/t/errors.test
index f308c340645..82822c87e89 100644
--- a/mysql-test/t/errors.test
+++ b/mysql-test/t/errors.test
@@ -155,3 +155,19 @@ INSERT INTO t1 VALUES ('abc\0\0');
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES ('abc\0\0');
DROP TABLE t1;
+
+--echo #
+--echo # Bug#57882: Item_func_conv_charset::val_str(String*):
+--echo # Assertion `fixed == 1' failed
+--echo #
+
+--error ER_DATA_OUT_OF_RANGE
+SELECT (CONVERT('0' USING latin1) IN (CHAR(COT('v') USING utf8),''));
+
+SET NAMES utf8 COLLATE utf8_latvian_ci ;
+--error ER_DATA_OUT_OF_RANGE
+SELECT UPDATEXML(-73 * -2465717823867977728,@@global.auto_increment_increment,null);
+
+--echo #
+--echo # End Bug#57882
+--echo #
diff --git a/mysql-test/t/func_math.test b/mysql-test/t/func_math.test
index 1e7026b0bcb..7f9ed6d8a93 100644
--- a/mysql-test/t/func_math.test
+++ b/mysql-test/t/func_math.test
@@ -472,3 +472,11 @@ SELECT -9223372036854775808 MOD -1;
--echo #
SELECT floor(log10(format(concat_ws(5445796E25, 5306463, 30837), -358821)))
as foo;
+
+--echo #
+--echo # Bug #58137 char(0) column cause:
+--echo # my_gcvt: Assertion `width > 0 && to != ((void *)0)' failed
+--echo #
+CREATE TABLE t1(a char(0));
+INSERT INTO t1 (SELECT -pi());
+DROP TABLE t1;
diff --git a/mysql-test/t/func_time.test b/mysql-test/t/func_time.test
index 08c09adb093..0a2b473ca59 100644
--- a/mysql-test/t/func_time.test
+++ b/mysql-test/t/func_time.test
@@ -832,6 +832,16 @@ INSERT INTO t1 VALUES (0),(9.216e-096);
SELECT 1 FROM t1 ORDER BY @x:=makedate(a,a);
DROP TABLE t1;
+--echo #
+--echo # Bug #52160: crash and inconsistent results when grouping
+--echo # by a function and column
+--echo #
+
+CREATE TABLE t1(a CHAR(10) NOT NULL);
+INSERT INTO t1 VALUES (''),('');
+SELECT COUNT(*) FROM t1 GROUP BY TIME_TO_SEC(a);
+DROP TABLE t1;
+
--echo End of 5.1 tests
--echo #
diff --git a/mysql-test/t/key_cache-master.opt b/mysql-test/t/key_cache-master.opt
index 66e19c18a8a..6398e3e0a26 100644
--- a/mysql-test/t/key_cache-master.opt
+++ b/mysql-test/t/key_cache-master.opt
@@ -1 +1,2 @@
--key_buffer_size=2M --small.key_buffer_size=256K --small.key_buffer_size=128K
+--force-restart
diff --git a/mysql-test/t/keywords.test b/mysql-test/t/keywords.test
index 3080c4847b4..08016313ca7 100644
--- a/mysql-test/t/keywords.test
+++ b/mysql-test/t/keywords.test
@@ -62,5 +62,103 @@ call p1();
drop procedure p1;
drop table t1;
-
# End of 5.0 tests
+
+#
+# BUG#57899: Certain reserved words should not be reserved
+#
+
+#
+# We are looking for SYNTAX ERRORS here, so no need to
+# log the queries
+#
+
+CREATE TABLE slow (slow INT, general INT, master_heartbeat_period INT, ignore_server_ids INT);
+INSERT INTO slow(slow, general, master_heartbeat_period, ignore_server_ids) VALUES (1,2,3,4), (5,6,7,8);
+INSERT INTO slow(slow, general, master_heartbeat_period) VALUES (1,2,3), (5,6,7);
+INSERT INTO slow(slow, general) VALUES (1,2), (5,6);
+INSERT INTO slow(slow) VALUES (1), (5);
+SELECT slow, general, master_heartbeat_period, ignore_server_ids FROM slow ORDER BY slow;
+SELECT slow, general, master_heartbeat_period FROM slow ORDER BY slow;
+SELECT slow, master_heartbeat_period FROM slow ORDER BY slow;
+SELECT slow FROM slow ORDER BY slow;
+DROP TABLE slow;
+CREATE TABLE general (slow INT, general INT, master_heartbeat_period INT, ignore_server_ids INT);
+INSERT INTO general(slow, general, master_heartbeat_period, ignore_server_ids) VALUES (1,2,3,4), (5,6,7,8);
+INSERT INTO general(slow, general, master_heartbeat_period) VALUES (1,2,3), (5,6,7);
+INSERT INTO general(slow, general) VALUES (1,2), (5,6);
+INSERT INTO general(slow) VALUES (1), (5);
+SELECT slow, general, master_heartbeat_period, ignore_server_ids FROM general ORDER BY slow;
+SELECT slow, general, master_heartbeat_period FROM general ORDER BY slow;
+SELECT slow, master_heartbeat_period FROM general ORDER BY slow;
+SELECT slow FROM general ORDER BY slow;
+DROP TABLE general;
+CREATE TABLE master_heartbeat_period (slow INT, general INT, master_heartbeat_period INT, ignore_server_ids INT);
+INSERT INTO master_heartbeat_period(slow, general, master_heartbeat_period, ignore_server_ids) VALUES (1,2,3,4), (5,6,7,8);
+INSERT INTO master_heartbeat_period(slow, general, master_heartbeat_period) VALUES (1,2,3), (5,6,7);
+INSERT INTO master_heartbeat_period(slow, general) VALUES (1,2), (5,6);
+INSERT INTO master_heartbeat_period(slow) VALUES (1), (5);
+SELECT slow, general, master_heartbeat_period, ignore_server_ids FROM master_heartbeat_period ORDER BY slow;
+SELECT slow, general, master_heartbeat_period FROM master_heartbeat_period ORDER BY slow;
+SELECT slow, master_heartbeat_period FROM master_heartbeat_period ORDER BY slow;
+SELECT slow FROM master_heartbeat_period ORDER BY slow;
+DROP TABLE master_heartbeat_period;
+CREATE TABLE ignore_server_ids (slow INT, general INT, master_heartbeat_period INT, ignore_server_ids INT);
+INSERT INTO ignore_server_ids(slow, general, master_heartbeat_period, ignore_server_ids) VALUES (1,2,3,4), (5,6,7,8);
+INSERT INTO ignore_server_ids(slow, general, master_heartbeat_period) VALUES (1,2,3), (5,6,7);
+INSERT INTO ignore_server_ids(slow, general) VALUES (1,2), (5,6);
+INSERT INTO ignore_server_ids(slow) VALUES (1), (5);
+SELECT slow, general, master_heartbeat_period, ignore_server_ids FROM ignore_server_ids ORDER BY slow;
+SELECT slow, general, master_heartbeat_period FROM ignore_server_ids ORDER BY slow;
+SELECT slow, master_heartbeat_period FROM ignore_server_ids ORDER BY slow;
+SELECT slow FROM ignore_server_ids ORDER BY slow;
+DROP TABLE ignore_server_ids;
+
+CREATE TABLE t1 (slow INT, general INT, ignore_server_ids INT, master_heartbeat_period INT);
+INSERT INTO t1 VALUES (1,2,3,4);
+DELIMITER |;
+CREATE PROCEDURE p1()
+BEGIN
+ DECLARE slow INT;
+ DECLARE general INT;
+ DECLARE ignore_server_ids INT;
+ DECLARE master_heartbeat_period INT;
+
+ SELECT max(t1.slow) INTO slow FROM t1;
+ SELECT max(t1.general) INTO general FROM t1;
+ SELECT max(t1.ignore_server_ids) INTO ignore_server_ids FROM t1;
+ SELECT max(t1.master_heartbeat_period) INTO master_heartbeat_period FROM t1;
+
+ SELECT slow, general, ignore_server_ids, master_heartbeat_period;
+END|
+
+CREATE PROCEDURE p2()
+BEGIN
+
+ DECLARE n INT DEFAULT 2;
+ general: WHILE n > 0 DO
+ SET n = n -1;
+ END WHILE general;
+
+ SET n = 2;
+ slow: WHILE n > 0 DO
+ SET n = n -1;
+ END WHILE slow;
+
+ SET n = 2;
+ ignore_server_ids: WHILE n > 0 DO
+ SET n = n -1;
+ END WHILE ignore_server_ids;
+
+ SET n = 2;
+ master_heartbeat_period: WHILE n > 0 DO
+ SET n = n -1;
+ END WHILE master_heartbeat_period;
+
+END|
+DELIMITER ;|
+CALL p1();
+call p2();
+DROP PROCEDURE p1;
+DROP PROCEDURE p2;
+DROP TABLE t1;
diff --git a/mysql-test/t/log_tables.test b/mysql-test/t/log_tables.test
index 5275b8e7db3..5b6be217d9d 100644
--- a/mysql-test/t/log_tables.test
+++ b/mysql-test/t/log_tables.test
@@ -1034,6 +1034,25 @@ DROP TABLE t1;
TRUNCATE TABLE mysql.slow_log;
+#
+# Bug #47924 main.log_tables times out sporadically
+#
+
+use mysql;
+# Should result in error
+--disable_warnings
+drop table if exists renamed_general_log;
+drop table if exists renamed_slow_log;
+--enable_warnings
+--error ER_CANT_RENAME_LOG_TABLE
+RENAME TABLE general_log TO renamed_general_log;
+--error ER_CANT_RENAME_LOG_TABLE
+RENAME TABLE slow_log TO renamed_slow_log;
+
+use test;
+flush tables with read lock;
+unlock tables;
+
SET @@session.long_query_time= @old_long_query_time;
SET @@global.log_output= @old_log_output;
diff --git a/mysql-test/t/mysqlbinlog-master.opt b/mysql-test/t/mysqlbinlog-master.opt
index ac1a87c73b3..a9f4a6010d8 100644
--- a/mysql-test/t/mysqlbinlog-master.opt
+++ b/mysql-test/t/mysqlbinlog-master.opt
@@ -1 +1,2 @@
--max-binlog-size=4096
+--force-restart
diff --git a/mysql-test/t/mysqlbinlog.test b/mysql-test/t/mysqlbinlog.test
index 3a9dae35476..76f6c63fc1d 100644
--- a/mysql-test/t/mysqlbinlog.test
+++ b/mysql-test/t/mysqlbinlog.test
@@ -487,3 +487,18 @@ diff_files $MYSQLTEST_VARDIR/tmp/mysqlbinlog.warn $MYSQLTEST_VARDIR/tmp/mysqlbin
# Cleanup for this part of test
remove_file $MYSQLTEST_VARDIR/tmp/mysqlbinlog.warn.empty;
remove_file $MYSQLTEST_VARDIR/tmp/mysqlbinlog.warn;
+
+#
+# WL#5625: Deprecate mysqlbinlog options --base64-output=always and --base64-output
+#
+
+--echo # Expect deprecation warning.
+--exec $MYSQL_BINLOG --base64-output=always std_data/master-bin.000001 > /dev/null 2> $MYSQLTEST_VARDIR/tmp/mysqlbinlog.warn
+--cat_file $MYSQLTEST_VARDIR/tmp/mysqlbinlog.warn
+
+--echo # Expect deprecation warning again.
+--exec $MYSQL_BINLOG --base64-output std_data/master-bin.000001 > /dev/null 2> $MYSQLTEST_VARDIR/tmp/mysqlbinlog.warn
+--cat_file $MYSQLTEST_VARDIR/tmp/mysqlbinlog.warn
+
+# Clean up this part of the test.
+--remove_file $MYSQLTEST_VARDIR/tmp/mysqlbinlog.warn
diff --git a/mysql-test/t/not_embedded_server.test b/mysql-test/t/not_embedded_server.test
index 917d5871682..3fea1f630e0 100644
--- a/mysql-test/t/not_embedded_server.test
+++ b/mysql-test/t/not_embedded_server.test
@@ -54,3 +54,57 @@ lock tables t1 read;
flush privileges;
unlock tables;
drop table t1;
+
+--echo #
+--echo # Bug#54812: assert in Diagnostics_area::set_ok_status during EXPLAIN
+--echo #
+
+CREATE USER nopriv_user@localhost;
+
+connection default;
+--echo connection: default
+
+--disable_warnings
+DROP TABLE IF EXISTS t1,t2,t3;
+DROP FUNCTION IF EXISTS f;
+--enable_warnings
+
+CREATE TABLE t1 (key1 INT PRIMARY KEY);
+CREATE TABLE t2 (key2 INT);
+INSERT INTO t1 VALUES (1),(2);
+
+CREATE FUNCTION f() RETURNS INT RETURN 1;
+
+GRANT FILE ON *.* TO 'nopriv_user'@'localhost';
+
+FLUSH PRIVILEGES;
+
+connect (con1,localhost,nopriv_user,,);
+connection con1;
+--echo connection: con1
+
+--error ER_PROCACCESS_DENIED_ERROR
+SELECT MAX(key1) FROM t1 WHERE f() < 1 INTO OUTFILE 'mytest';
+
+--error ER_PROCACCESS_DENIED_ERROR
+INSERT INTO t2 SELECT MAX(key1) FROM t1 WHERE f() < 1;
+
+--error ER_PROCACCESS_DENIED_ERROR
+SELECT MAX(key1) INTO @dummy FROM t1 WHERE f() < 1;
+
+--error ER_PROCACCESS_DENIED_ERROR
+CREATE TABLE t3 (i INT) AS SELECT MAX(key1) FROM t1 WHERE f() < 1;
+
+disconnect con1;
+--source include/wait_until_disconnected.inc
+
+connection default;
+--echo connection: default
+
+DROP TABLE t1,t2;
+DROP FUNCTION f;
+DROP USER nopriv_user@localhost;
+
+--echo #
+--echo # End Bug#54812
+--echo #
diff --git a/mysql-test/t/partition.test b/mysql-test/t/partition.test
index 68239c06660..cf3dcfadb27 100644
--- a/mysql-test/t/partition.test
+++ b/mysql-test/t/partition.test
@@ -15,6 +15,24 @@ drop table if exists t1, t2;
--enable_warnings
--echo #
+--echo # Bug#57778: failed primary key add to partitioned innodb table
+--echo # inconsistent and crashes
+--echo #
+CREATE TABLE t1 (a INT NOT NULL, b INT NOT NULL)
+PARTITION BY KEY (a) PARTITIONS 2;
+INSERT INTO t1 VALUES (0,1), (0,2);
+--error ER_DUP_ENTRY
+ALTER TABLE t1 ADD PRIMARY KEY (a);
+SHOW CREATE TABLE t1;
+SELECT * FROM t1;
+UPDATE t1 SET a = 1, b = 1 WHERE a = 0 AND b = 2;
+ALTER TABLE t1 ADD PRIMARY KEY (a);
+SELECT * FROM t1;
+ALTER TABLE t1 DROP PRIMARY KEY;
+SELECT * FROM t1;
+DROP TABLE t1;
+
+--echo #
--echo # Bug#57113: ha_partition::extra(ha_extra_function):
--echo # Assertion `m_extra_cache' failed
CREATE TABLE t1
diff --git a/mysql-test/t/plugin_auth.test b/mysql-test/t/plugin_auth.test
index 77dcd7add73..439cabaef18 100644
--- a/mysql-test/t/plugin_auth.test
+++ b/mysql-test/t/plugin_auth.test
@@ -16,6 +16,11 @@ connect(plug_con,localhost,plug,plug_dest);
--enable_query_log
GRANT PROXY ON plug_dest TO plug;
+--echo test proxies_priv columns
+--replace_column 1 xx 7 xx
+SELECT * FROM mysql.proxies_priv;
+--echo test mysql.proxies_priv;
+SHOW CREATE TABLE mysql.proxies_priv;
connect(plug_con,localhost,plug,plug_dest);
@@ -226,7 +231,7 @@ CREATE USER test_drop@localhost;
GRANT PROXY ON future_user TO test_drop@localhost;
SHOW GRANTS FOR test_drop@localhost;
DROP USER test_drop@localhost;
-SELECT * FROM mysql.proxy_priv WHERE Host = 'test_drop' AND User = 'localhost';
+SELECT * FROM mysql.proxies_priv WHERE Host = 'test_drop' AND User = 'localhost';
DROP USER proxy_admin;
diff --git a/mysql-test/t/ps.test b/mysql-test/t/ps.test
index bf15648951b..eaef1cf3000 100644
--- a/mysql-test/t/ps.test
+++ b/mysql-test/t/ps.test
@@ -3296,6 +3296,12 @@ SELECT @a;
DROP PROCEDURE p1;
DROP PROCEDURE p2;
+###########################################################################
+
+--source t/wl4435_generated.inc
+
+###########################################################################
+
--echo
--echo # End of WL#4435.
diff --git a/mysql-test/t/sp-bugs.test b/mysql-test/t/sp-bugs.test
index 8aa0791e265..fe52632c784 100644
--- a/mysql-test/t/sp-bugs.test
+++ b/mysql-test/t/sp-bugs.test
@@ -101,4 +101,41 @@ CALL p1 ();
DROP TABLE t1;
DROP PROCEDURE p1;
+--echo #
+--echo # Bug#54375: Error in stored procedure leaves connection
+--echo # in different default schema
+--echo #
+
+--disable_warnings
+SET @@SQL_MODE = 'STRICT_ALL_TABLES';
+DROP DATABASE IF EXISTS db1;
+CREATE DATABASE db1;
+USE db1;
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (c1 int NOT NULL PRIMARY KEY);
+INSERT INTO t1 VALUES (1);
+DELIMITER $$;
+CREATE FUNCTION f1 (
+ some_value int
+)
+RETURNS smallint
+DETERMINISTIC
+BEGIN
+ INSERT INTO t1 SET c1 = some_value;
+ RETURN(LAST_INSERT_ID());
+END$$
+DELIMITER ;$$
+DROP DATABASE IF EXISTS db2;
+CREATE DATABASE db2;
+--enable_warnings
+USE db2;
+SELECT DATABASE();
+--error ER_DUP_ENTRY
+SELECT db1.f1(1);
+SELECT DATABASE();
+USE test;
+DROP FUNCTION db1.f1;
+DROP TABLE db1.t1;
+DROP DATABASE db1;
+DROP DATABASE db2;
--echo End of 5.1 tests
diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test
index 2e442e7f897..d4a995ee181 100644
--- a/mysql-test/t/subselect.test
+++ b/mysql-test/t/subselect.test
@@ -3946,3 +3946,21 @@ DROP TABLE t1,t2;
--enable_result_log
--echo End of 5.1 tests
+
+--echo #
+--echo # Bug #57704: Cleanup code dies with void TABLE::set_keyread(bool):
+--echo # Assertion `file' failed.
+--echo #
+
+CREATE TABLE t1 (a INT);
+
+--error ER_OPERAND_COLUMNS
+SELECT 1 FROM
+ (SELECT ROW(
+ (SELECT 1 FROM t1 RIGHT JOIN
+ (SELECT 1 FROM t1, t1 t2) AS d ON 1),
+ 1) FROM t1) AS e;
+
+DROP TABLE t1;
+
+
diff --git a/mysql-test/t/system_mysql_db_fix40123.test b/mysql-test/t/system_mysql_db_fix40123.test
index d069271a02e..8c2060d76ba 100644
--- a/mysql-test/t/system_mysql_db_fix40123.test
+++ b/mysql-test/t/system_mysql_db_fix40123.test
@@ -72,7 +72,7 @@ CREATE TABLE time_zone_leap_second ( Transition_time bigint signed NOT NULL,
-- disable_query_log
# Drop all tables created by this test
-DROP TABLE db, host, user, func, plugin, tables_priv, columns_priv, procs_priv, servers, help_category, help_keyword, help_relation, help_topic, proc, time_zone, time_zone_leap_second, time_zone_name, time_zone_transition, time_zone_transition_type, general_log, slow_log, event, ndb_binlog_index, proxy_priv;
+DROP TABLE db, host, user, func, plugin, tables_priv, columns_priv, procs_priv, servers, help_category, help_keyword, help_relation, help_topic, proc, time_zone, time_zone_leap_second, time_zone_name, time_zone_transition, time_zone_transition_type, general_log, slow_log, event, ndb_binlog_index, proxies_priv;
-- enable_query_log
diff --git a/mysql-test/t/system_mysql_db_fix50030.test b/mysql-test/t/system_mysql_db_fix50030.test
index 53166919f1c..7d55a091b6d 100644
--- a/mysql-test/t/system_mysql_db_fix50030.test
+++ b/mysql-test/t/system_mysql_db_fix50030.test
@@ -78,7 +78,7 @@ INSERT INTO servers VALUES ('test','localhost','test','root','', 0,'','mysql','r
-- disable_query_log
# Drop all tables created by this test
-DROP TABLE db, host, user, func, plugin, tables_priv, columns_priv, procs_priv, servers, help_category, help_keyword, help_relation, help_topic, proc, time_zone, time_zone_leap_second, time_zone_name, time_zone_transition, time_zone_transition_type, general_log, slow_log, event, ndb_binlog_index, proxy_priv;
+DROP TABLE db, host, user, func, plugin, tables_priv, columns_priv, procs_priv, servers, help_category, help_keyword, help_relation, help_topic, proc, time_zone, time_zone_leap_second, time_zone_name, time_zone_transition, time_zone_transition_type, general_log, slow_log, event, ndb_binlog_index, proxies_priv;
-- enable_query_log
diff --git a/mysql-test/t/system_mysql_db_fix50117.test b/mysql-test/t/system_mysql_db_fix50117.test
index 872829ae79d..260400b9c8a 100644
--- a/mysql-test/t/system_mysql_db_fix50117.test
+++ b/mysql-test/t/system_mysql_db_fix50117.test
@@ -97,7 +97,7 @@ CREATE TABLE IF NOT EXISTS ndb_binlog_index (Position BIGINT UNSIGNED NOT NULL,
-- disable_query_log
# Drop all tables created by this test
-DROP TABLE db, host, user, func, plugin, tables_priv, columns_priv, procs_priv, servers, help_category, help_keyword, help_relation, help_topic, proc, time_zone, time_zone_leap_second, time_zone_name, time_zone_transition, time_zone_transition_type, general_log, slow_log, event, ndb_binlog_index, proxy_priv;
+DROP TABLE db, host, user, func, plugin, tables_priv, columns_priv, procs_priv, servers, help_category, help_keyword, help_relation, help_topic, proc, time_zone, time_zone_leap_second, time_zone_name, time_zone_transition, time_zone_transition_type, general_log, slow_log, event, ndb_binlog_index, proxies_priv;
-- enable_query_log
diff --git a/mysql-test/t/type_blob.test b/mysql-test/t/type_blob.test
index c06d8ac97e0..fa67afa48e8 100644
--- a/mysql-test/t/type_blob.test
+++ b/mysql-test/t/type_blob.test
@@ -617,4 +617,17 @@ SELECT LENGTH(c) FROM t2;
DROP TABLE t1, t2;
+--echo # Bug #52160: crash and inconsistent results when grouping
+--echo # by a function and column
+
+CREATE FUNCTION f1() RETURNS TINYBLOB RETURN 1;
+
+CREATE TABLE t1(a CHAR(1));
+INSERT INTO t1 VALUES ('0'), ('0');
+
+SELECT COUNT(*) FROM t1 GROUP BY f1(), a;
+
+DROP FUNCTION f1;
+DROP TABLE t1;
+
--echo End of 5.1 tests
diff --git a/mysql-test/t/union.test b/mysql-test/t/union.test
index 93dc4cad50c..596fc5f41ef 100644
--- a/mysql-test/t/union.test
+++ b/mysql-test/t/union.test
@@ -1062,7 +1062,7 @@ SELECT ( SELECT a UNION SELECT a ) INTO OUTFILE 'union.out.file3' FROM t1;
SELECT ( SELECT a UNION SELECT a ) INTO DUMPFILE 'union.out.file4' FROM t1;
DROP TABLE t1;
-
+remove_files_wildcard $MYSQLTEST_VARDIR/mysqld.1/data/test union.out.fil*;
--echo #
--echo # Bug #49734: Crash on EXPLAIN EXTENDED UNION ... ORDER BY
diff --git a/mysql-test/t/variables-big.test b/mysql-test/t/variables-big.test
index fdb11ffa907..6c357bb6e54 100644
--- a/mysql-test/t/variables-big.test
+++ b/mysql-test/t/variables-big.test
@@ -37,19 +37,19 @@
--disable_warnings
SET SESSION transaction_prealloc_size=1024*1024*1024*1;
---replace_column 1 <Id> 6 <Time>
+--replace_column 1 <Id> 3 <Host> 6 <Time>
SHOW PROCESSLIST;
SET SESSION transaction_prealloc_size=1024*1024*1024*2;
---replace_column 1 <Id> 6 <Time>
+--replace_column 1 <Id> 3 <Host> 6 <Time>
SHOW PROCESSLIST;
SET SESSION transaction_prealloc_size=1024*1024*1024*3;
---replace_column 1 <Id> 6 <Time>
+--replace_column 1 <Id> 3 <Host> 6 <Time>
SHOW PROCESSLIST;
SET SESSION transaction_prealloc_size=1024*1024*1024*4;
---replace_column 1 <Id> 6 <Time>
+--replace_column 1 <Id> 3 <Host> 6 <Time>
SHOW PROCESSLIST;
SET SESSION transaction_prealloc_size=1024*1024*1024*5;
---replace_column 1 <Id> 6 <Time>
+--replace_column 1 <Id> 3 <Host> 6 <Time>
SHOW PROCESSLIST;
--enable_warnings
diff --git a/mysql-test/t/wl4435_generated.inc b/mysql-test/t/wl4435_generated.inc
new file mode 100644
index 00000000000..5ea05a89402
--- /dev/null
+++ b/mysql-test/t/wl4435_generated.inc
@@ -0,0 +1,588 @@
+
+###########################################################################
+
+--echo
+--echo TINYINT
+--echo
+
+CREATE PROCEDURE p1(OUT v TINYINT)
+ SET v = 127;
+
+PREPARE stmt1 FROM 'CALL p1(?)';
+EXECUTE stmt1 USING @a;
+
+CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
+
+SHOW CREATE TABLE tmp1;
+
+SELECT @a, @a = 127;
+
+DROP TEMPORARY TABLE tmp1;
+DROP PROCEDURE p1;
+
+###########################################################################
+
+--echo
+--echo SMALLINT
+--echo
+
+CREATE PROCEDURE p1(OUT v SMALLINT)
+ SET v = 32767;
+
+PREPARE stmt1 FROM 'CALL p1(?)';
+EXECUTE stmt1 USING @a;
+
+CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
+
+SHOW CREATE TABLE tmp1;
+
+SELECT @a, @a = 32767;
+
+DROP TEMPORARY TABLE tmp1;
+DROP PROCEDURE p1;
+
+###########################################################################
+
+--echo
+--echo MEDIUMINT
+--echo
+
+CREATE PROCEDURE p1(OUT v MEDIUMINT)
+ SET v = 8388607;
+
+PREPARE stmt1 FROM 'CALL p1(?)';
+EXECUTE stmt1 USING @a;
+
+CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
+
+SHOW CREATE TABLE tmp1;
+
+SELECT @a, @a = 8388607;
+
+DROP TEMPORARY TABLE tmp1;
+DROP PROCEDURE p1;
+
+###########################################################################
+
+--echo
+--echo INT
+--echo
+
+CREATE PROCEDURE p1(OUT v INT)
+ SET v = 2147483647;
+
+PREPARE stmt1 FROM 'CALL p1(?)';
+EXECUTE stmt1 USING @a;
+
+CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
+
+SHOW CREATE TABLE tmp1;
+
+SELECT @a, @a = 2147483647;
+
+DROP TEMPORARY TABLE tmp1;
+DROP PROCEDURE p1;
+
+###########################################################################
+
+--echo
+--echo BIGINT
+--echo
+
+CREATE PROCEDURE p1(OUT v BIGINT)
+ SET v = 9223372036854775807;
+
+PREPARE stmt1 FROM 'CALL p1(?)';
+EXECUTE stmt1 USING @a;
+
+CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
+
+SHOW CREATE TABLE tmp1;
+
+SELECT @a, @a = 9223372036854775807;
+
+DROP TEMPORARY TABLE tmp1;
+DROP PROCEDURE p1;
+
+###########################################################################
+
+--echo
+--echo BIT(11)
+--echo
+
+CREATE PROCEDURE p1(OUT v BIT(11))
+ SET v = b'10100100101';
+
+PREPARE stmt1 FROM 'CALL p1(?)';
+EXECUTE stmt1 USING @a;
+
+CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
+
+SHOW CREATE TABLE tmp1;
+
+SELECT @a, @a = b'10100100101';
+
+DROP TEMPORARY TABLE tmp1;
+DROP PROCEDURE p1;
+
+###########################################################################
+
+--echo
+--echo TIMESTAMP
+--echo
+
+CREATE PROCEDURE p1(OUT v TIMESTAMP)
+ SET v = '2007-11-18 15:01:02';
+
+PREPARE stmt1 FROM 'CALL p1(?)';
+EXECUTE stmt1 USING @a;
+
+CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
+
+SHOW CREATE TABLE tmp1;
+
+SELECT @a, @a = '2007-11-18 15:01:02';
+
+DROP TEMPORARY TABLE tmp1;
+DROP PROCEDURE p1;
+
+###########################################################################
+
+--echo
+--echo DATETIME
+--echo
+
+CREATE PROCEDURE p1(OUT v DATETIME)
+ SET v = '1234-11-12 12:34:59';
+
+PREPARE stmt1 FROM 'CALL p1(?)';
+EXECUTE stmt1 USING @a;
+
+CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
+
+SHOW CREATE TABLE tmp1;
+
+SELECT @a, @a = '1234-11-12 12:34:59';
+
+DROP TEMPORARY TABLE tmp1;
+DROP PROCEDURE p1;
+
+###########################################################################
+
+--echo
+--echo TIME
+--echo
+
+CREATE PROCEDURE p1(OUT v TIME)
+ SET v = '123:45:01';
+
+PREPARE stmt1 FROM 'CALL p1(?)';
+EXECUTE stmt1 USING @a;
+
+CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
+
+SHOW CREATE TABLE tmp1;
+
+SELECT @a, @a = '123:45:01';
+
+DROP TEMPORARY TABLE tmp1;
+DROP PROCEDURE p1;
+
+###########################################################################
+
+--echo
+--echo DATE
+--echo
+
+CREATE PROCEDURE p1(OUT v DATE)
+ SET v = '1234-11-12';
+
+PREPARE stmt1 FROM 'CALL p1(?)';
+EXECUTE stmt1 USING @a;
+
+CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
+
+SHOW CREATE TABLE tmp1;
+
+SELECT @a, @a = '1234-11-12';
+
+DROP TEMPORARY TABLE tmp1;
+DROP PROCEDURE p1;
+
+###########################################################################
+
+--echo
+--echo YEAR
+--echo
+
+CREATE PROCEDURE p1(OUT v YEAR)
+ SET v = 2010;
+
+PREPARE stmt1 FROM 'CALL p1(?)';
+EXECUTE stmt1 USING @a;
+
+CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
+
+SHOW CREATE TABLE tmp1;
+
+SELECT @a, @a = 2010;
+
+DROP TEMPORARY TABLE tmp1;
+DROP PROCEDURE p1;
+
+###########################################################################
+
+--echo
+--echo FLOAT(7, 4)
+--echo
+
+CREATE PROCEDURE p1(OUT v FLOAT(7, 4))
+ SET v = 123.4567;
+
+PREPARE stmt1 FROM 'CALL p1(?)';
+EXECUTE stmt1 USING @a;
+
+CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
+
+SHOW CREATE TABLE tmp1;
+
+SELECT @a, @a - 123.4567 < 0.00001;
+
+DROP TEMPORARY TABLE tmp1;
+DROP PROCEDURE p1;
+
+###########################################################################
+
+--echo
+--echo DOUBLE(8, 5)
+--echo
+
+CREATE PROCEDURE p1(OUT v DOUBLE(8, 5))
+ SET v = 123.45678;
+
+PREPARE stmt1 FROM 'CALL p1(?)';
+EXECUTE stmt1 USING @a;
+
+CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
+
+SHOW CREATE TABLE tmp1;
+
+SELECT @a, @a - 123.45678 < 0.000001;
+
+DROP TEMPORARY TABLE tmp1;
+DROP PROCEDURE p1;
+
+###########################################################################
+
+--echo
+--echo DECIMAL(9, 6)
+--echo
+
+CREATE PROCEDURE p1(OUT v DECIMAL(9, 6))
+ SET v = 123.456789;
+
+PREPARE stmt1 FROM 'CALL p1(?)';
+EXECUTE stmt1 USING @a;
+
+CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
+
+SHOW CREATE TABLE tmp1;
+
+SELECT @a, @a = 123.456789;
+
+DROP TEMPORARY TABLE tmp1;
+DROP PROCEDURE p1;
+
+###########################################################################
+
+--echo
+--echo CHAR(32)
+--echo
+
+CREATE PROCEDURE p1(OUT v CHAR(32))
+ SET v = REPEAT('a', 16);
+
+PREPARE stmt1 FROM 'CALL p1(?)';
+EXECUTE stmt1 USING @a;
+
+CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
+
+SHOW CREATE TABLE tmp1;
+
+SELECT @a, @a = REPEAT('a', 16);
+
+DROP TEMPORARY TABLE tmp1;
+DROP PROCEDURE p1;
+
+###########################################################################
+
+--echo
+--echo VARCHAR(32)
+--echo
+
+CREATE PROCEDURE p1(OUT v VARCHAR(32))
+ SET v = REPEAT('b', 16);
+
+PREPARE stmt1 FROM 'CALL p1(?)';
+EXECUTE stmt1 USING @a;
+
+CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
+
+SHOW CREATE TABLE tmp1;
+
+SELECT @a, @a = REPEAT('b', 16);
+
+DROP TEMPORARY TABLE tmp1;
+DROP PROCEDURE p1;
+
+###########################################################################
+
+--echo
+--echo TINYTEXT
+--echo
+
+CREATE PROCEDURE p1(OUT v TINYTEXT)
+ SET v = REPEAT('c', 16);
+
+PREPARE stmt1 FROM 'CALL p1(?)';
+EXECUTE stmt1 USING @a;
+
+CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
+
+SHOW CREATE TABLE tmp1;
+
+SELECT @a, @a = REPEAT('c', 16);
+
+DROP TEMPORARY TABLE tmp1;
+DROP PROCEDURE p1;
+
+###########################################################################
+
+--echo
+--echo TEXT
+--echo
+
+CREATE PROCEDURE p1(OUT v TEXT)
+ SET v = REPEAT('d', 16);
+
+PREPARE stmt1 FROM 'CALL p1(?)';
+EXECUTE stmt1 USING @a;
+
+CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
+
+SHOW CREATE TABLE tmp1;
+
+SELECT @a, @a = REPEAT('d', 16);
+
+DROP TEMPORARY TABLE tmp1;
+DROP PROCEDURE p1;
+
+###########################################################################
+
+--echo
+--echo MEDIUMTEXT
+--echo
+
+CREATE PROCEDURE p1(OUT v MEDIUMTEXT)
+ SET v = REPEAT('e', 16);
+
+PREPARE stmt1 FROM 'CALL p1(?)';
+EXECUTE stmt1 USING @a;
+
+CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
+
+SHOW CREATE TABLE tmp1;
+
+SELECT @a, @a = REPEAT('e', 16);
+
+DROP TEMPORARY TABLE tmp1;
+DROP PROCEDURE p1;
+
+###########################################################################
+
+--echo
+--echo LONGTEXT
+--echo
+
+CREATE PROCEDURE p1(OUT v LONGTEXT)
+ SET v = REPEAT('f', 16);
+
+PREPARE stmt1 FROM 'CALL p1(?)';
+EXECUTE stmt1 USING @a;
+
+CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
+
+SHOW CREATE TABLE tmp1;
+
+SELECT @a, @a = REPEAT('f', 16);
+
+DROP TEMPORARY TABLE tmp1;
+DROP PROCEDURE p1;
+
+###########################################################################
+
+--echo
+--echo BINARY(32)
+--echo
+
+CREATE PROCEDURE p1(OUT v BINARY(32))
+ SET v = REPEAT('g', 32);
+
+PREPARE stmt1 FROM 'CALL p1(?)';
+EXECUTE stmt1 USING @a;
+
+CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
+
+SHOW CREATE TABLE tmp1;
+
+SELECT @a, @a = REPEAT('g', 32);
+
+DROP TEMPORARY TABLE tmp1;
+DROP PROCEDURE p1;
+
+###########################################################################
+
+--echo
+--echo VARBINARY(32)
+--echo
+
+CREATE PROCEDURE p1(OUT v VARBINARY(32))
+ SET v = REPEAT('h', 16);
+
+PREPARE stmt1 FROM 'CALL p1(?)';
+EXECUTE stmt1 USING @a;
+
+CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
+
+SHOW CREATE TABLE tmp1;
+
+SELECT @a, @a = REPEAT('h', 16);
+
+DROP TEMPORARY TABLE tmp1;
+DROP PROCEDURE p1;
+
+###########################################################################
+
+--echo
+--echo TINYBLOB
+--echo
+
+CREATE PROCEDURE p1(OUT v TINYBLOB)
+ SET v = REPEAT('i', 16);
+
+PREPARE stmt1 FROM 'CALL p1(?)';
+EXECUTE stmt1 USING @a;
+
+CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
+
+SHOW CREATE TABLE tmp1;
+
+SELECT @a, @a = REPEAT('i', 16);
+
+DROP TEMPORARY TABLE tmp1;
+DROP PROCEDURE p1;
+
+###########################################################################
+
+--echo
+--echo BLOB
+--echo
+
+CREATE PROCEDURE p1(OUT v BLOB)
+ SET v = REPEAT('j', 16);
+
+PREPARE stmt1 FROM 'CALL p1(?)';
+EXECUTE stmt1 USING @a;
+
+CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
+
+SHOW CREATE TABLE tmp1;
+
+SELECT @a, @a = REPEAT('j', 16);
+
+DROP TEMPORARY TABLE tmp1;
+DROP PROCEDURE p1;
+
+###########################################################################
+
+--echo
+--echo MEDIUMBLOB
+--echo
+
+CREATE PROCEDURE p1(OUT v MEDIUMBLOB)
+ SET v = REPEAT('k', 16);
+
+PREPARE stmt1 FROM 'CALL p1(?)';
+EXECUTE stmt1 USING @a;
+
+CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
+
+SHOW CREATE TABLE tmp1;
+
+SELECT @a, @a = REPEAT('k', 16);
+
+DROP TEMPORARY TABLE tmp1;
+DROP PROCEDURE p1;
+
+###########################################################################
+
+--echo
+--echo LONGBLOB
+--echo
+
+CREATE PROCEDURE p1(OUT v LONGBLOB)
+ SET v = REPEAT('l', 16);
+
+PREPARE stmt1 FROM 'CALL p1(?)';
+EXECUTE stmt1 USING @a;
+
+CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
+
+SHOW CREATE TABLE tmp1;
+
+SELECT @a, @a = REPEAT('l', 16);
+
+DROP TEMPORARY TABLE tmp1;
+DROP PROCEDURE p1;
+
+###########################################################################
+
+--echo
+--echo SET('aaa', 'bbb')
+--echo
+
+CREATE PROCEDURE p1(OUT v SET('aaa', 'bbb'))
+ SET v = 'aaa';
+
+PREPARE stmt1 FROM 'CALL p1(?)';
+EXECUTE stmt1 USING @a;
+
+CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
+
+SHOW CREATE TABLE tmp1;
+
+SELECT @a, @a = 'aaa';
+
+DROP TEMPORARY TABLE tmp1;
+DROP PROCEDURE p1;
+
+###########################################################################
+
+--echo
+--echo ENUM('aaa', 'bbb')
+--echo
+
+CREATE PROCEDURE p1(OUT v ENUM('aaa', 'bbb'))
+ SET v = 'aaa';
+
+PREPARE stmt1 FROM 'CALL p1(?)';
+EXECUTE stmt1 USING @a;
+
+CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
+
+SHOW CREATE TABLE tmp1;
+
+SELECT @a, @a = 'aaa';
+
+DROP TEMPORARY TABLE tmp1;
+DROP PROCEDURE p1;