diff --git a/client/mysqltest.cc b/client/mysqltest.cc index 94ae462c074..59273feeb1f 100644 --- a/client/mysqltest.cc +++ b/client/mysqltest.cc @@ -8725,7 +8725,7 @@ void run_query_stmt(struct st_connection *cn, struct st_command *command, DYNAMIC_STRING ds_res_1st_execution; my_bool ds_res_1st_execution_init = FALSE; my_bool compare_2nd_execution = TRUE; - int query_match_ps2_re; + int query_match_ps2_re, query_match_cursor_re; MYSQL_RES *res; DBUG_ENTER("run_query_stmt"); DBUG_PRINT("query", ("'%-.60s'", query)); @@ -8784,6 +8784,9 @@ void run_query_stmt(struct st_connection *cn, struct st_command *command, parameter markers. */ + query_match_cursor_re= cursor_protocol_enabled && cn->stmt->field_count && + match_re(&cursor_re, query); + if (cursor_protocol_enabled) { ps2_protocol_enabled = 0; @@ -8792,7 +8795,7 @@ void run_query_stmt(struct st_connection *cn, struct st_command *command, Use cursor for queries matching the filter, else reset cursor type */ - if (match_re(&cursor_re, query)) + if (query_match_cursor_re) { /* Use cursor when retrieving result @@ -8804,12 +8807,13 @@ void run_query_stmt(struct st_connection *cn, struct st_command *command, } } - query_match_ps2_re = match_re(&ps2_re, query); + query_match_ps2_re = ps2_protocol_enabled && cn->stmt->field_count && + match_re(&ps2_re, query); /* Execute the query first time if second execution enable */ - if (ps2_protocol_enabled && query_match_ps2_re) + if (query_match_ps2_re) { if (do_stmt_execute(cn)) { @@ -8865,8 +8869,7 @@ void run_query_stmt(struct st_connection *cn, struct st_command *command, and keep them in a separate string for later. Cursor_protocol is used only for queries matching the filter "cursor_re". */ - if (cursor_protocol_enabled && match_re(&cursor_re, query) && - !disable_warnings) + if (query_match_cursor_re && !disable_warnings) append_warnings(&ds_execute_warnings, mysql); if (read_stmt_results(stmt, ds, command)) @@ -8878,7 +8881,7 @@ void run_query_stmt(struct st_connection *cn, struct st_command *command, The results of the first and second execution are compared only if result logging is enabled */ - if (compare_2nd_execution && ps2_protocol_enabled && query_match_ps2_re) + if (compare_2nd_execution && query_match_ps2_re) { if (ds->length != ds_res_1st_execution.length || !(memcmp(ds_res_1st_execution.str, ds->str, ds->length) == 0)) diff --git a/mysql-test/include/commit.inc b/mysql-test/include/commit.inc index dbbd7459b52..132fdcff7bd 100644 --- a/mysql-test/include/commit.inc +++ b/mysql-test/include/commit.inc @@ -258,10 +258,8 @@ select * from t2; insert into t2 (a) values (1025); --replace_result $MYSQLTEST_VARDIR .. ---disable_cursor_protocol --error ER_DUP_ENTRY eval select f2(25) into outfile "$MYSQLTEST_VARDIR/tmp/dml.out" from t1; ---enable_cursor_protocol select * from t2; rollback; select * from t2; @@ -281,10 +279,8 @@ select * from t2; --echo ======================================================================= insert into t2 (a) values (1027); ---disable_cursor_protocol --error ER_DUP_ENTRY select f2(27) into @foo; ---enable_cursor_protocol select * from t2; rollback; select * from t2; diff --git a/mysql-test/include/diff_tables.inc b/mysql-test/include/diff_tables.inc index 98ed7e786a7..663407c0c8f 100644 --- a/mysql-test/include/diff_tables.inc +++ b/mysql-test/include/diff_tables.inc @@ -170,13 +170,9 @@ while ($_dt_tables) # Now that we have the comma-separated list of columns, we can write # the table to a file. - --disable_ps2_protocol --let $_dt_outfile= `SELECT @@datadir` --let $_dt_outfile= $_dt_outfile/diff_table-$_dt_connection-$_dt_database-$_dt_table - --disable_cursor_protocol eval SELECT * INTO OUTFILE '$_dt_outfile' FROM $_dt_database.$_dt_table ORDER BY `$_dt_column_list`; - --enable_cursor_protocol - --enable_ps2_protocol # Restore sorting buffers. --eval SET SESSION max_sort_length = $_dt_old_max_sort_length; --eval SET SESSION sort_buffer_size = $_dt_old_sort_buffer_size; diff --git a/mysql-test/include/function_defaults.inc b/mysql-test/include/function_defaults.inc index 86ccb697d28..6e4fa10a65b 100644 --- a/mysql-test/include/function_defaults.inc +++ b/mysql-test/include/function_defaults.inc @@ -824,8 +824,6 @@ eval CREATE TABLE t2 ( i $datetime DEFAULT $current_timestamp ON UPDATE $current_timestamp NOT NULL ); ---disable_cursor_protocol ---disable_ps2_protocol SELECT 1 INTO OUTFILE 't3.dat' FROM dual; SELECT NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL @@ -833,8 +831,6 @@ INTO OUTFILE 't4.dat' FROM dual; SELECT 1, 2 INTO OUTFILE 't5.dat' FROM dual; ---enable_ps2_protocol ---enable_cursor_protocol --echo # Mon Aug 1 15:11:19 2011 UTC SET TIMESTAMP = 1312211479.918273; @@ -933,13 +929,9 @@ remove_file $MYSQLD_DATADIR/test/t5.dat; --echo # Mon Aug 1 15:11:19 2011 UTC SET TIMESTAMP = 1312211479.089786; ---disable_cursor_protocol ---disable_ps2_protocol SELECT 1 INTO OUTFILE "file1.dat" FROM dual; SELECT NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL INTO OUTFILE "file2.dat" FROM dual; ---enable_ps2_protocol ---enable_cursor_protocol --echo # Too short row diff --git a/mysql-test/include/have_outfile.inc b/mysql-test/include/have_outfile.inc deleted file mode 100644 index 705d394b206..00000000000 --- a/mysql-test/include/have_outfile.inc +++ /dev/null @@ -1,5 +0,0 @@ --- require include/have_outfile.require -disable_query_log; -select load_file(concat(@tmpdir,'/outfile.test')); ---remove_file $MYSQLTEST_VARDIR/tmp/outfile.test -enable_query_log; diff --git a/mysql-test/include/have_outfile.require b/mysql-test/include/have_outfile.require deleted file mode 100644 index 71137a69a91..00000000000 --- a/mysql-test/include/have_outfile.require +++ /dev/null @@ -1,3 +0,0 @@ -load_file(concat(@tmpdir,'/outfile.test')) -Outfile OK - diff --git a/mysql-test/include/test_outfile.inc b/mysql-test/include/test_outfile.inc deleted file mode 100644 index af64cc6ba5f..00000000000 --- a/mysql-test/include/test_outfile.inc +++ /dev/null @@ -1,5 +0,0 @@ ---disable_cursor_protocol ---disable_ps2_protocol -eval select "Outfile OK" into outfile "$MYSQLTEST_VARDIR/tmp/outfile.test"; ---enable_ps2_protocol ---enable_cursor_protocol diff --git a/mysql-test/include/type_temporal_zero_default.inc b/mysql-test/include/type_temporal_zero_default.inc index 4cc36ad572c..500d25ea18f 100644 --- a/mysql-test/include/type_temporal_zero_default.inc +++ b/mysql-test/include/type_temporal_zero_default.inc @@ -34,12 +34,8 @@ SET sql_mode=DEFAULT; --eval CREATE TABLE t1 (a $type DEFAULT $defval, b $type DEFAULT $defval) --eval INSERT INTO t1 VALUES (DEFAULT,DEFAULT); --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR ---disable_ps2_protocol ---disable_cursor_protocol --eval SELECT a INTO OUTFILE '$MYSQLTEST_VARDIR/tmp/mdev-7824.txt' FROM t1 ---enable_cursor_protocol DELETE FROM t1; ---enable_ps2_protocol SET sql_mode=TRADITIONAL; --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR --error ER_INVALID_DEFAULT_VALUE_FOR_FIELD diff --git a/mysql-test/main/auto_increment_ranges_innodb.test b/mysql-test/main/auto_increment_ranges_innodb.test index 927954216c7..aaa64e2d6f9 100644 --- a/mysql-test/main/auto_increment_ranges_innodb.test +++ b/mysql-test/main/auto_increment_ranges_innodb.test @@ -11,11 +11,7 @@ set default_storage_engine=innodb; # create table t1 (pk int auto_increment primary key, f varchar(20)); insert t1 (f) values ('a'), ('b'), ('c'), ('d'); ---disable_cursor_protocol ---disable_ps2_protocol select null, f into outfile 'load.data' from t1 limit 1; ---enable_ps2_protocol ---enable_cursor_protocol load data infile 'load.data' into table t1; insert t1 (f) values ('<==='); select * from t1; diff --git a/mysql-test/main/bootstrap.result b/mysql-test/main/bootstrap.result index cfff13136d6..2b29a7c8937 100644 --- a/mysql-test/main/bootstrap.result +++ b/mysql-test/main/bootstrap.result @@ -17,6 +17,8 @@ ERROR 42S02: Unknown table 'test.t1' # # Bootstrap with a large thd->net.max_packet # +create table t1 select 2 as a, concat(repeat('MySQL', @@max_allowed_packet/10), ';') as b; +select * into outfile 'MYSQLTEST_VARDIR/tmp/long_query.sql' from t1; # Kill the server # restart drop table t1; diff --git a/mysql-test/main/bootstrap.test b/mysql-test/main/bootstrap.test index 5877b049fff..3db4c363bed 100644 --- a/mysql-test/main/bootstrap.test +++ b/mysql-test/main/bootstrap.test @@ -43,14 +43,9 @@ remove_file $MYSQLTEST_VARDIR/tmp/bootstrap_error.sql; --echo # --echo # Bootstrap with a large thd->net.max_packet --echo # ---disable_query_log create table t1 select 2 as a, concat(repeat('MySQL', @@max_allowed_packet/10), ';') as b; ---disable_cursor_protocol ---disable_ps2_protocol +replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR; eval select * into outfile '$MYSQLTEST_VARDIR/tmp/long_query.sql' from t1; ---enable_ps2_protocol ---enable_cursor_protocol ---enable_query_log --source include/kill_mysqld.inc --error 1 --exec $MYSQLD_BOOTSTRAP_CMD < $MYSQLTEST_VARDIR/tmp/long_query.sql >> $MYSQLTEST_VARDIR/tmp/bootstrap.log 2>&1 diff --git a/mysql-test/main/ctype_big5.test b/mysql-test/main/ctype_big5.test index 4b87373a3fd..c35f2f8262c 100644 --- a/mysql-test/main/ctype_big5.test +++ b/mysql-test/main/ctype_big5.test @@ -78,11 +78,7 @@ select hex(convert(_big5 0xC84041 using ucs2)); set names big5; create table t1 (a blob); insert into t1 values (0xEE00); ---disable_cursor_protocol ---disable_ps2_protocol select * into outfile 'test/t1.txt' from t1; ---enable_ps2_protocol ---enable_cursor_protocol delete from t1; let $MYSQLD_DATADIR= `select @@datadir`; --replace_result $MYSQLD_DATADIR MYSQLD_DATADIR diff --git a/mysql-test/main/ctype_ucs.result b/mysql-test/main/ctype_ucs.result index 994d5775be7..9728d3ed08d 100644 --- a/mysql-test/main/ctype_ucs.result +++ b/mysql-test/main/ctype_ucs.result @@ -1,4 +1,3 @@ -DROP TABLE IF EXISTS t1; SET @test_character_set= 'ucs2'; SET @test_collation= 'ucs2_general_ci'; SET @safe_character_set_server= @@character_set_server; diff --git a/mysql-test/main/ctype_ucs.test b/mysql-test/main/ctype_ucs.test index 001d213c357..03e65678204 100644 --- a/mysql-test/main/ctype_ucs.test +++ b/mysql-test/main/ctype_ucs.test @@ -1,9 +1,5 @@ -- source include/have_ucs2.inc ---disable_warnings -DROP TABLE IF EXISTS t1; ---enable_warnings - SET @test_character_set= 'ucs2'; SET @test_collation= 'ucs2_general_ci'; -- source include/ctype_common.inc @@ -75,13 +71,9 @@ DROP TABLE t1; --echo # Problem # 1 (original report): wrong parsing of ucs2 data SET character_set_connection=ucs2; ---disable_cursor_protocol --enable_prepare_warnings ---disable_ps2_protocol SELECT '00' UNION SELECT '10' INTO OUTFILE 'tmpp.txt'; --disable_prepare_warnings ---enable_ps2_protocol ---enable_cursor_protocol CREATE TABLE t1(a INT); LOAD DATA INFILE 'tmpp.txt' INTO TABLE t1 CHARACTER SET ucs2 (@b) SET a=REVERSE(@b); @@ -92,14 +84,10 @@ DROP TABLE t1; let $MYSQLD_DATADIR= `select @@datadir`; remove_file $MYSQLD_DATADIR/test/tmpp.txt; ---disable_ps2_protocol --echo # Problem # 2 : if you write and read ucs2 data to a file they're lost ---disable_cursor_protocol --enable_prepare_warnings SELECT '00' UNION SELECT '10' INTO OUTFILE 'tmpp2.txt' CHARACTER SET ucs2; --disable_prepare_warnings ---enable_cursor_protocol ---enable_ps2_protocol CREATE TABLE t1(a INT); LOAD DATA INFILE 'tmpp2.txt' INTO TABLE t1 CHARACTER SET ucs2 (@b) SET a=REVERSE(@b); diff --git a/mysql-test/main/distinct.result b/mysql-test/main/distinct.result index 72968f72798..c3f4fae80e6 100644 --- a/mysql-test/main/distinct.result +++ b/mysql-test/main/distinct.result @@ -652,7 +652,6 @@ SELECT DISTINCT 2 + 2, 'Bob' INTO @v17, @v18 FROM t1 WHERE fruit_name = SELECT @v17, @v18; @v17 @v18 4 Bob -DROP TABLE IF EXISTS t2; CREATE TABLE t2 (fruit_id INT NOT NULL, fruit_name varchar(20) default NULL); SELECT DISTINCT fruit_id, fruit_name INTO OUTFILE diff --git a/mysql-test/main/distinct.test b/mysql-test/main/distinct.test index fa9bf387b8f..c0c9439822a 100644 --- a/mysql-test/main/distinct.test +++ b/mysql-test/main/distinct.test @@ -460,7 +460,6 @@ INSERT INTO t1 VALUES (2,2,'APPLE'); INSERT INTO t1 VALUES (3,2,'APPLE'); INSERT INTO t1 VALUES (4,3,'PEAR'); ---disable_cursor_protocol SELECT DISTINCT fruit_id, fruit_name INTO @v1, @v2 FROM t1 WHERE fruit_name = 'APPLE'; SELECT @v1, @v2; @@ -488,28 +487,19 @@ SELECT DISTINCT 2 + 2, 'Bob' INTO @v17, @v18 FROM t1 WHERE fruit_name = 'APPLE'; SELECT @v17, @v18; ---disable_warnings -DROP TABLE IF EXISTS t2; ---enable_warnings - CREATE TABLE t2 (fruit_id INT NOT NULL, fruit_name varchar(20) default NULL); ---disable_ps2_protocol SELECT DISTINCT fruit_id, fruit_name INTO OUTFILE '../../tmp/data1.tmp' FROM t1 WHERE fruit_name = 'APPLE'; ---enable_ps2_protocol LOAD DATA INFILE '../../tmp/data1.tmp' INTO TABLE t2; --error 0,1 --remove_file $MYSQLTEST_VARDIR/tmp/data1.tmp ---disable_ps2_protocol SELECT DISTINCT @v19:= fruit_id, @v20:= fruit_name INTO OUTFILE '../../tmp/data2.tmp' FROM t1 WHERE fruit_name = 'APPLE'; ---enable_ps2_protocol LOAD DATA INFILE '../../tmp/data2.tmp' INTO TABLE t2; --remove_file $MYSQLTEST_VARDIR/tmp/data2.tmp ---enable_cursor_protocol SELECT @v19, @v20; SELECT * FROM t2; diff --git a/mysql-test/main/features.test b/mysql-test/main/features.test index 9d9c3de3c4f..6ef617159e6 100644 --- a/mysql-test/main/features.test +++ b/mysql-test/main/features.test @@ -156,14 +156,10 @@ show status like "feature_insert_returning"; --echo # create table t1(id1 int); insert into t1 values (1),(2); ---disable_cursor_protocol ---disable_ps2_protocol select * into outfile '../../tmp/features_outfile.1' from t1; select * from t1 into outfile '../../tmp/features_outfile.2'; ---enable_ps2_protocol select id1 INTO @x from t1 where id1=1; select * from t1 where id1=1 into @y; ---enable_cursor_protocol select * from t1 where id1=@x; select @x=@y; drop table t1; diff --git a/mysql-test/main/func_str.test b/mysql-test/main/func_str.test index 0fbefac6bc2..c8060961c3d 100644 --- a/mysql-test/main/func_str.test +++ b/mysql-test/main/func_str.test @@ -1537,11 +1537,7 @@ SELECT CONVERT(('' IN (REVERSE(CAST(('') AS DECIMAL)), '')), CHAR(3)); --echo # CREATE TABLE t1 ( a TEXT ); --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR ---disable_cursor_protocol ---disable_ps2_protocol --eval SELECT 'aaaaaaaaaaaaaa' INTO OUTFILE '$MYSQLTEST_VARDIR/tmp/bug58165.txt'; ---enable_ps2_protocol ---enable_cursor_protocol SELECT insert( substring_index( 'a', 'a', 'b' ), 1, 0, 'x' ); --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR --eval LOAD DATA INFILE '$MYSQLTEST_VARDIR/tmp/bug58165.txt' INTO TABLE t1; diff --git a/mysql-test/main/grant2.test b/mysql-test/main/grant2.test index 287aaebbbe6..26a2a40245f 100644 --- a/mysql-test/main/grant2.test +++ b/mysql-test/main/grant2.test @@ -4,9 +4,7 @@ # Save the initial number of concurrent sessions --source include/count_sessions.inc ---disable_cursor_protocol select priv into @root_priv from mysql.global_priv where user='root' and host='localhost'; ---enable_cursor_protocol set GLOBAL sql_mode=""; set LOCAL sql_mode=""; @@ -660,10 +658,8 @@ DROP DATABASE db1; # work out who we are. USE mysql; ---disable_cursor_protocol SELECT LEFT(CURRENT_USER(),INSTR(CURRENT_USER(),'@')-1) INTO @u; SELECT MID(CURRENT_USER(),INSTR(CURRENT_USER(),'@')+1) INTO @h; ---enable_cursor_protocol # show current privs. SELECT user,host,password,plugin,authentication_string,insert_priv FROM user WHERE user=@u AND host=@h; @@ -845,11 +841,7 @@ SHOW CREATE TABLE t1; --echo # INSERT INTO t1 VALUES (1), (2), (3); --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR ---disable_cursor_protocol ---disable_ps2_protocol --eval SELECT a INTO OUTFILE '$MYSQLTEST_VARDIR/tmp/bug27480.txt' FROM t1 ---enable_ps2_protocol ---enable_cursor_protocol --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR --eval LOAD DATA INFILE '$MYSQLTEST_VARDIR/tmp/bug27480.txt' INTO TABLE t1 --remove_file $MYSQLTEST_VARDIR/tmp/bug27480.txt diff --git a/mysql-test/main/insert.test b/mysql-test/main/insert.test index 4b5a5181f09..9cd0a6ac987 100644 --- a/mysql-test/main/insert.test +++ b/mysql-test/main/insert.test @@ -596,11 +596,7 @@ CREATE ALGORITHM = MERGE VIEW v1 AS SELECT f1, f2 FROM t1 WHERE f1 = cast('' as REPLACE INTO v1 SET f2 = 1; SELECT * from t1; drop view v1; ---disable_cursor_protocol ---disable_ps2_protocol SELECT 0,0 INTO OUTFILE 't1.txt'; ---enable_ps2_protocol ---enable_cursor_protocol CREATE ALGORITHM = MERGE VIEW v1 AS SELECT f1, f2 FROM t1 WHERE f1 = 'x' WITH CHECK OPTION; --error ER_TRUNCATED_WRONG_VALUE LOAD DATA INFILE 't1.txt' INTO TABLE v1; diff --git a/mysql-test/main/invisible_field.test b/mysql-test/main/invisible_field.test index ef3114b37f0..7fd22704fcb 100644 --- a/mysql-test/main/invisible_field.test +++ b/mysql-test/main/invisible_field.test @@ -251,12 +251,8 @@ DROP TABLE t1; create or replace table t1 (a int, b int invisible); insert into t1 values (1),(2); ---disable_cursor_protocol --enable_prepare_warnings ---disable_ps2_protocol select * from t1 into outfile 'f'; ---enable_ps2_protocol ---enable_cursor_protocol load data infile 'f' into table t1; select a,b from t1; load data infile 'f' into table t1 (a,@v) SET b=@v; @@ -266,11 +262,7 @@ select a,b from t1; truncate table t1; insert into t1(a,b) values (1,1),(2,2); ---disable_cursor_protocol ---disable_ps2_protocol select a,b from t1 into outfile 'a'; ---enable_ps2_protocol ---enable_cursor_protocol load data infile 'a' into table t1(a,b); select a,b from t1; load data infile 'a' into table t1 (a,@v) SET b=@v; diff --git a/mysql-test/main/loaddata.result b/mysql-test/main/loaddata.result index 44fca21f31e..f9353c340ad 100644 --- a/mysql-test/main/loaddata.result +++ b/mysql-test/main/loaddata.result @@ -1,5 +1,4 @@ ALTER DATABASE test CHARACTER SET latin1 COLLATE latin1_swedish_ci; -drop table if exists t1, t2; create table t1 (a date, b date, c date not null, d date); load data infile '../../std_data/loaddata1.dat' ignore into table t1 fields terminated by ','; Warnings: @@ -77,9 +76,18 @@ drop table t1; SET @OLD_SQL_MODE=@@SQL_MODE, @@SQL_MODE=NO_AUTO_VALUE_ON_ZERO; create table t1(id integer not null auto_increment primary key); insert into t1 values(0); +SELECT * INTO OUTFILE '$MYSQLTEST_VARDIR/tmp/t1' from t1; +delete from t1; +load data infile '$MYSQLTEST_VARDIR/tmp/t1' into table t1; select * from t1; id 0 +SELECT * INTO OUTFILE '$MYSQLTEST_VARDIR/tmp/t1' +FIELDS TERMINATED BY '' OPTIONALLY ENCLOSED BY '' LINES TERMINATED BY '\r\n' +FROM t1; +delete from t1; +load data infile '$MYSQLTEST_VARDIR/tmp/t1' into table t1 +FIELDS TERMINATED BY '' OPTIONALLY ENCLOSED BY '' LINES TERMINATED BY '\r\n'; Warnings: Note 1265 Data truncated for column 'id' at row 1 select * from t1; @@ -239,6 +247,9 @@ drop table t1, t2; create table t1(f1 int); insert into t1 values(1),(null); create table t2(f2 int auto_increment primary key); +select * into outfile '$MYSQLTEST_VARDIR/tmp/t1' from t1; +SET @OLD_SQL_MODE=@@SQL_MODE, @@SQL_MODE=NO_AUTO_VALUE_ON_ZERO; +load data infile '$MYSQLTEST_VARDIR/tmp/t1' into table t2; select * from t2; f2 1 @@ -248,6 +259,8 @@ drop table t1,t2; create table t1(f1 int, f2 timestamp not null default current_timestamp); create table t2(f1 int); insert into t2 values(1),(2); +select * into outfile '$MYSQLTEST_VARDIR/tmp/t2' from t2; +load data infile '$MYSQLTEST_VARDIR/tmp/t2' ignore into table t1; Warnings: Warning 1261 Row 1 doesn't contain data for all columns Warning 1261 Row 2 doesn't contain data for all columns @@ -256,6 +269,11 @@ f1 1 2 delete from t1; +SELECT * INTO OUTFILE '$MYSQLTEST_VARDIR/tmp/t2' +FIELDS TERMINATED BY '' OPTIONALLY ENCLOSED BY '' LINES TERMINATED BY '\r\n' +FROM t2; +load data infile '$MYSQLTEST_VARDIR/tmp/t2' ignore into table t1 +FIELDS TERMINATED BY '' OPTIONALLY ENCLOSED BY '' LINES TERMINATED BY '\r\n'; Warnings: Note 1265 Data truncated for column 'f1' at row 1 Warning 1261 Row 1 doesn't contain data for all columns diff --git a/mysql-test/main/loaddata.test b/mysql-test/main/loaddata.test index 624458d355d..dbf345fc69e 100644 --- a/mysql-test/main/loaddata.test +++ b/mysql-test/main/loaddata.test @@ -2,15 +2,9 @@ # Some simple test of load data # --- source include/have_ucs2.inc - +--source include/have_ucs2.inc --source include/test_db_charset_latin1.inc - ---disable_warnings -drop table if exists t1, t2; ---enable_warnings - create table t1 (a date, b date, c date not null, d date); load data infile '../../std_data/loaddata1.dat' ignore into table t1 fields terminated by ','; load data infile '../../std_data/loaddata1.dat' into table t1 fields terminated by ',' IGNORE 2 LINES; @@ -39,35 +33,25 @@ drop table t1; # # Bug #12053 LOAD DATA INFILE ignores NO_AUTO_VALUE_ON_ZERO setting # ---disable_ps2_protocol SET @OLD_SQL_MODE=@@SQL_MODE, @@SQL_MODE=NO_AUTO_VALUE_ON_ZERO; create table t1(id integer not null auto_increment primary key); insert into t1 values(0); -disable_query_log; ---disable_cursor_protocol -eval SELECT * INTO OUTFILE '$MYSQLTEST_VARDIR/tmp/t1' from t1; ---enable_cursor_protocol +evalp SELECT * INTO OUTFILE '$MYSQLTEST_VARDIR/tmp/t1' from t1; delete from t1; -eval load data infile '$MYSQLTEST_VARDIR/tmp/t1' into table t1; -enable_query_log; +evalp load data infile '$MYSQLTEST_VARDIR/tmp/t1' into table t1; select * from t1; remove_file $MYSQLTEST_VARDIR/tmp/t1; -disable_query_log; ---disable_cursor_protocol -eval SELECT * INTO OUTFILE '$MYSQLTEST_VARDIR/tmp/t1' +evalp SELECT * INTO OUTFILE '$MYSQLTEST_VARDIR/tmp/t1' FIELDS TERMINATED BY '' OPTIONALLY ENCLOSED BY '' LINES TERMINATED BY '\r\n' FROM t1; ---enable_cursor_protocol delete from t1; -eval load data infile '$MYSQLTEST_VARDIR/tmp/t1' into table t1 +evalp load data infile '$MYSQLTEST_VARDIR/tmp/t1' into table t1 FIELDS TERMINATED BY '' OPTIONALLY ENCLOSED BY '' LINES TERMINATED BY '\r\n'; -enable_query_log; select * from t1; remove_file $MYSQLTEST_VARDIR/tmp/t1; SET @@SQL_MODE=@OLD_SQL_MODE; drop table t1; ---enable_ps2_protocol # # Bug #11203: LOAD DATA does not accept same characters for ESCAPED and @@ -101,11 +85,7 @@ INSERT INTO t1 (c1) VALUES SELECT * FROM t1; --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR ---disable_cursor_protocol ---disable_ps2_protocol eval SELECT * INTO OUTFILE '$MYSQLTEST_VARDIR/tmp/t1' FIELDS ENCLOSED BY 'r' FROM t1; ---enable_ps2_protocol ---enable_cursor_protocol cat_file $MYSQLTEST_VARDIR/tmp/t1; --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR @@ -192,15 +172,9 @@ drop table t1, t2; create table t1(f1 int); insert into t1 values(1),(null); create table t2(f2 int auto_increment primary key); -disable_query_log; ---disable_cursor_protocol ---disable_ps2_protocol -eval select * into outfile '$MYSQLTEST_VARDIR/tmp/t1' from t1; ---enable_ps2_protocol ---enable_cursor_protocol +evalp select * into outfile '$MYSQLTEST_VARDIR/tmp/t1' from t1; SET @OLD_SQL_MODE=@@SQL_MODE, @@SQL_MODE=NO_AUTO_VALUE_ON_ZERO; -eval load data infile '$MYSQLTEST_VARDIR/tmp/t1' into table t2; -enable_query_log; +evalp load data infile '$MYSQLTEST_VARDIR/tmp/t1' into table t2; select * from t2; remove_file $MYSQLTEST_VARDIR/tmp/t1; SET @@SQL_MODE=@OLD_SQL_MODE; @@ -213,28 +187,16 @@ drop table t1,t2; create table t1(f1 int, f2 timestamp not null default current_timestamp); create table t2(f1 int); insert into t2 values(1),(2); -disable_query_log; ---disable_cursor_protocol ---disable_ps2_protocol -eval select * into outfile '$MYSQLTEST_VARDIR/tmp/t2' from t2; ---enable_ps2_protocol ---enable_cursor_protocol -eval load data infile '$MYSQLTEST_VARDIR/tmp/t2' ignore into table t1; -enable_query_log; +evalp select * into outfile '$MYSQLTEST_VARDIR/tmp/t2' from t2; +evalp load data infile '$MYSQLTEST_VARDIR/tmp/t2' ignore into table t1; select f1 from t1 where f2 <> '0000-00-00 00:00:00' order by f1; remove_file $MYSQLTEST_VARDIR/tmp/t2; delete from t1; -disable_query_log; ---disable_cursor_protocol ---disable_ps2_protocol -eval SELECT * INTO OUTFILE '$MYSQLTEST_VARDIR/tmp/t2' +evalp SELECT * INTO OUTFILE '$MYSQLTEST_VARDIR/tmp/t2' FIELDS TERMINATED BY '' OPTIONALLY ENCLOSED BY '' LINES TERMINATED BY '\r\n' FROM t2; ---enable_ps2_protocol ---enable_cursor_protocol -eval load data infile '$MYSQLTEST_VARDIR/tmp/t2' ignore into table t1 +evalp load data infile '$MYSQLTEST_VARDIR/tmp/t2' ignore into table t1 FIELDS TERMINATED BY '' OPTIONALLY ENCLOSED BY '' LINES TERMINATED BY '\r\n'; -enable_query_log; select f1 from t1 where f2 <> '0000-00-00 00:00:00' order by f1; remove_file $MYSQLTEST_VARDIR/tmp/t2; drop table t1,t2; @@ -250,11 +212,7 @@ INSERT INTO t1 (c1, c2, c3, c4) VALUES (10, '1970-02-01 01:02:03', 1.1E-100, 1.1 SELECT * FROM t1; --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR ---disable_cursor_protocol ---disable_ps2_protocol eval SELECT * INTO OUTFILE '$MYSQLTEST_VARDIR/tmp/t1' FIELDS ENCLOSED BY '-' FROM t1; ---enable_ps2_protocol ---enable_cursor_protocol cat_file $MYSQLTEST_VARDIR/tmp/t1; echo EOF; @@ -391,12 +349,8 @@ SET @OLD_SQL_MODE=@@SESSION.SQL_MODE; SET sql_mode = ''; ---disable_ps2_protocol --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR ---disable_cursor_protocol --eval SELECT '1 \\\\aa\n' INTO DUMPFILE '$file' ---enable_ps2_protocol ---enable_cursor_protocol CREATE TABLE t1 (id INT, val1 CHAR(3)) ENGINE=MyISAM; @@ -408,21 +362,13 @@ SELECT * FROM t1; # show we can write this with OUTFILE, forcing the parameters for now --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR ---disable_cursor_protocol ---disable_ps2_protocol --eval SELECT * INTO OUTFILE '$file2' FIELDS ESCAPED BY '' TERMINATED BY ' ' FROM t1 ---enable_ps2_protocol ---enable_cursor_protocol --diff_files $file $file2 --remove_file $file2 # now show the OUTFILE defaults are correct with NO_BACKSLASH_ESCAPES --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR ---disable_cursor_protocol ---disable_ps2_protocol --eval SELECT * INTO OUTFILE '$file2' FIELDS TERMINATED BY ' ' FROM t1 ---enable_ps2_protocol ---enable_cursor_protocol --diff_files $file $file2 --remove_file $file2 @@ -455,11 +401,7 @@ INSERT INTO t1 (id, val1) VALUES (3, '\tx'); --echo 1.1 NO_BACKSLASH_ESCAPES, use defaults for ESCAPED BY --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR ---disable_cursor_protocol ---disable_ps2_protocol --eval SELECT * INTO OUTFILE '$file' FIELDS TERMINATED BY ' ' FROM t1 ORDER BY id ---enable_ps2_protocol ---enable_cursor_protocol --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR --eval LOAD DATA INFILE '$file' INTO TABLE t2 FIELDS TERMINATED BY ' ' @@ -476,11 +418,7 @@ eval SELECT LOAD_FILE("$file") as exp; --echo 1.2 NO_BACKSLASH_ESCAPES, override defaults for ESCAPED BY --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR ---disable_cursor_protocol ---disable_ps2_protocol --eval SELECT * INTO OUTFILE '$file' FIELDS ESCAPED BY '\' TERMINATED BY ' ' FROM t1 ORDER BY id ---enable_ps2_protocol ---enable_cursor_protocol --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR --eval LOAD DATA INFILE '$file' INTO TABLE t2 FIELDS ESCAPED BY '\' TERMINATED BY ' ' @@ -502,11 +440,7 @@ SET sql_mode = ''; --echo 2.1 !NO_BACKSLASH_ESCAPES, use defaults for ESCAPED BY --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR ---disable_cursor_protocol ---disable_ps2_protocol --eval SELECT * INTO OUTFILE '$file' FIELDS TERMINATED BY ' ' FROM t1 ORDER BY id ---enable_ps2_protocol ---enable_cursor_protocol --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR --eval LOAD DATA INFILE '$file' INTO TABLE t2 FIELDS TERMINATED BY ' ' @@ -529,11 +463,7 @@ SET sql_mode = ''; --echo 2.2 !NO_BACKSLASH_ESCAPES, override defaults for ESCAPED BY --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR ---disable_cursor_protocol ---disable_ps2_protocol --eval SELECT * INTO OUTFILE '$file' FIELDS ESCAPED BY '' TERMINATED BY ' ' FROM t1 ORDER BY id ---enable_ps2_protocol ---enable_cursor_protocol --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR --eval LOAD DATA INFILE '$file' INTO TABLE t2 FIELDS ESCAPED BY '' TERMINATED BY ' ' @@ -575,11 +505,7 @@ INSERT INTO t1 VALUES (1); SET NAMES latin1; SET character_set_filesystem=filename; select @@character_set_filesystem; ---disable_cursor_protocol ---disable_ps2_protocol SELECT * INTO OUTFILE 't-1' FROM t1; ---enable_ps2_protocol ---enable_cursor_protocol DELETE FROM t1; LOAD DATA INFILE 't-1' INTO TABLE t1; SELECT * FROM t1; @@ -601,11 +527,7 @@ select @@character_set_filesystem; --echo # CREATE TABLE t1(col0 LONGBLOB); ---disable_cursor_protocol ---disable_ps2_protocol SELECT 'test' INTO OUTFILE 't1.txt'; ---enable_ps2_protocol ---enable_cursor_protocol LOAD DATA INFILE 't1.txt' IGNORE INTO TABLE t1 SET col0=col0; SELECT * FROM t1; @@ -674,11 +596,7 @@ disconnect con1; --echo # CREATE TABLE t1(f1 INT); ---disable_cursor_protocol ---disable_ps2_protocol -EVAL SELECT 0xE1BB30 INTO OUTFILE 't1.dat'; ---enable_ps2_protocol ---enable_cursor_protocol +eval SELECT 0xE1BB30 INTO OUTFILE 't1.dat'; --disable_warnings LOAD DATA INFILE 't1.dat' IGNORE INTO TABLE t1 CHARACTER SET utf8; --enable_warnings @@ -692,13 +610,9 @@ remove_file $MYSQLD_DATADIR/test/t1.dat; --echo # WHEN ERROR OCCURS --echo # ---disable_ps2_protocol --let $file=$MYSQLTEST_VARDIR/tmp/bug11735141.txt --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR ---disable_cursor_protocol --eval SELECT '1\n' INTO DUMPFILE '$file' ---enable_cursor_protocol ---enable_ps2_protocol create table t1(a point); --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR @@ -785,11 +699,7 @@ CREATE TABLE t1 (a INT, b INT, PRIMARY KEY (a), UNIQUE(b)); INSERT INTO t1 VALUES (1,1); CREATE TABLE t2 (c INT); CREATE VIEW v AS SELECT t1.* FROM t1 JOIN t2; ---disable_cursor_protocol ---disable_ps2_protocol SELECT a, b INTO OUTFILE '15645.data' FROM t1; ---enable_ps2_protocol ---enable_cursor_protocol --error ER_WRONG_USAGE LOAD DATA INFILE '15645.data' IGNORE INTO TABLE v (a,b); --error ER_WRONG_USAGE @@ -848,12 +758,8 @@ CREATE OR REPLACE TABLE t1 ( ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; INSERT INTO t1 VALUES (GeomFromText('POINT(37.646944 -75.761111)')); ---disable_cursor_protocol ---disable_ps2_protocol --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR eval SELECT * INTO OUTFILE '$MYSQLTEST_VARDIR/tmp/t1.tsv' FROM t1; ---enable_ps2_protocol ---enable_cursor_protocol CREATE OR REPLACE TABLE t2 LIKE t1; @@ -870,12 +776,8 @@ CREATE OR REPLACE TABLE t1 ( ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; INSERT INTO t1 VALUES (GeomFromText('POINT(37.646944 -75.761111)'),"їєі"); ---disable_cursor_protocol ---disable_ps2_protocol --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR eval SELECT * INTO OUTFILE '$MYSQLTEST_VARDIR/tmp/t1.tsv' FROM t1; ---enable_ps2_protocol ---enable_cursor_protocol CREATE OR REPLACE TABLE t2 LIKE t1; diff --git a/mysql-test/main/long_unique_bugs.test b/mysql-test/main/long_unique_bugs.test index 311c4a04a29..a407ce59e24 100644 --- a/mysql-test/main/long_unique_bugs.test +++ b/mysql-test/main/long_unique_bugs.test @@ -16,11 +16,7 @@ insert into t1 () values (),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(), (),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(), (),(),(),(); ---disable_cursor_protocol ---disable_ps2_protocol select * into outfile 'load.data' from t1; ---enable_ps2_protocol ---enable_cursor_protocol create temporary table tmp (a varchar(1024), b int, c int, d int, e linestring, unique (e)); load data infile 'load.data' into table tmp; delete from tmp; @@ -232,11 +228,7 @@ drop table t1; --echo # CREATE TABLE t1 (data VARCHAR(4), unique(data) using hash) with system versioning; INSERT INTO t1 VALUES ('A'); ---disable_cursor_protocol ---disable_ps2_protocol SELECT * INTO OUTFILE 'load.data' from t1; ---enable_ps2_protocol ---enable_cursor_protocol --error ER_DUP_ENTRY LOAD DATA INFILE 'load.data' INTO TABLE t1; select * from t1; @@ -250,11 +242,7 @@ DROP TABLE t1; CREATE TABLE t1 (data VARCHAR(7961)) ENGINE=InnoDB; INSERT INTO t1 VALUES ('f'), ('o'), ('o'); ---disable_cursor_protocol ---disable_ps2_protocol SELECT * INTO OUTFILE 'load.data' from t1; ---enable_ps2_protocol ---enable_cursor_protocol ALTER IGNORE TABLE t1 ADD UNIQUE INDEX (data); SELECT * FROM t1; @@ -519,11 +507,7 @@ drop table t2; --echo # create table t1 (pk int primary key, f blob, unique(f)) engine=innodb; insert t1 values (1, null); ---disable_cursor_protocol ---disable_ps2_protocol select * into outfile 't1.data' from t1; ---enable_ps2_protocol ---enable_cursor_protocol load data infile 't1.data' replace into table t1; select * from t1; drop table t1; diff --git a/mysql-test/main/mdev-34724.test b/mysql-test/main/mdev-34724.test index fb8ffa8be13..75832b8c705 100644 --- a/mysql-test/main/mdev-34724.test +++ b/mysql-test/main/mdev-34724.test @@ -56,12 +56,8 @@ $ --echo # then use it for loading data into the table `t1` CREATE TABLE t2 (a INT); INSERT INTO t2 VALUES (1), (2), (1), (3), (5); ---disable_ps2_protocol ---disable_cursor_protocol --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR --eval SELECT * INTO OUTFILE '$MYSQLTEST_VARDIR/tmp/t2' FROM t2 ---enable_cursor_protocol ---enable_ps2_protocol --echo # Execution of the following LOAD DATA INFILE statement produces warnings --echo # for the rows (1) filtered out by the statement SIGNAL SQLSTATE '02TRG' --echo # invoked from the trigger diff --git a/mysql-test/main/order_by_pack_big.test b/mysql-test/main/order_by_pack_big.test index 21ec803cd8a..0d8e9451985 100644 --- a/mysql-test/main/order_by_pack_big.test +++ b/mysql-test/main/order_by_pack_big.test @@ -145,20 +145,12 @@ set sort_buffer_size= 2097152; --source include/analyze-format.inc eval ANALYZE FORMAT=JSON SELECT id, names, address FROM t3 ORDER BY names, address; flush status; ---disable_cursor_protocol ---disable_ps2_protocol evalp SELECT id, names, address INTO OUTFILE '$file1' FROM t3 ORDER BY names, address; ---enable_ps2_protocol ---enable_cursor_protocol --echo # Sort_merge_passes should be 0 show status like '%sort%'; ---disable_cursor_protocol ---disable_ps2_protocol evalp SELECT id, names, address INTO OUTFILE '$file2' FROM t3 FORCE INDEX(idx) ORDER BY names, address; ---enable_ps2_protocol ---enable_cursor_protocol diff_files $file1 $file2; @@ -175,11 +167,7 @@ set sort_buffer_size= 1097152; --source include/analyze-format.inc eval ANALYZE FORMAT=JSON SELECT id, names, address FROM t3 ORDER BY names, address; flush status; ---disable_cursor_protocol ---disable_ps2_protocol evalp SELECT id, names, address INTO OUTFILE '$file1' FROM t3 ORDER BY names, address; ---enable_ps2_protocol ---enable_cursor_protocol --echo # Sort_merge_passes should be 0 show status like '%sort%'; diff --git a/mysql-test/main/outfile.result b/mysql-test/main/outfile.result index 4c439c37e4d..77dca24c254 100644 Binary files a/mysql-test/main/outfile.result and b/mysql-test/main/outfile.result differ diff --git a/mysql-test/main/outfile.test b/mysql-test/main/outfile.test index f9bd76dcd95..090872f0516 100644 --- a/mysql-test/main/outfile.test +++ b/mysql-test/main/outfile.test @@ -1,75 +1,39 @@ -disable_query_log; --- source include/test_outfile.inc -# Server are started in "var/master-data", so "../../tmp" will be "var/tmp" -eval set @tmpdir="../../tmp"; -enable_query_log; --- source include/have_outfile.inc - +--source include/not_embedded.inc # Save the initial number of concurrent sessions --source include/count_sessions.inc ---disable_ps2_protocol - # # test of into outfile|dumpfile # ---disable_warnings -drop table if exists t1; ---enable_warnings - create table t1 (`a` blob); insert into t1 values("hello world"),("Hello mars"),(NULL); -disable_query_log; ---disable_cursor_protocol -eval select * into outfile "../../tmp/outfile-test.1" from t1; ---enable_cursor_protocol -enable_query_log; -select load_file(concat(@tmpdir,"/outfile-test.1")); -disable_query_log; ---disable_cursor_protocol -eval select * into dumpfile "../../tmp/outfile-test.2" from t1 limit 1; ---enable_cursor_protocol -enable_query_log; -select load_file(concat(@tmpdir,"/outfile-test.2")); -disable_query_log; ---disable_cursor_protocol -eval select * into dumpfile "../../tmp/outfile-test.3" from t1 where a is null; ---enable_cursor_protocol -enable_query_log; -select load_file(concat(@tmpdir,"/outfile-test.3")); +select * into outfile "../../tmp/outfile-test.1" from t1; +select load_file('../../tmp/outfile-test.1'); +select * into dumpfile "../../tmp/outfile-test.2" from t1 limit 1; +select load_file('../../tmp/outfile-test.2'); +select * into dumpfile "../../tmp/outfile-test.3" from t1 where a is null; +select load_file('../../tmp/outfile-test.3'); # the following should give errors -disable_query_log; ---disable_cursor_protocol --error ER_FILE_EXISTS_ERROR eval select * into outfile "../../tmp/outfile-test.1" from t1; ---enable_cursor_protocol ---disable_cursor_protocol --error ER_FILE_EXISTS_ERROR eval select * into dumpfile "../../tmp/outfile-test.2" from t1; ---enable_cursor_protocol ---disable_cursor_protocol --error ER_FILE_EXISTS_ERROR eval select * into dumpfile "../../tmp/outfile-test.3" from t1; ---enable_cursor_protocol -enable_query_log; -select load_file(concat(@tmpdir,"/outfile-test.not-exist")); +select load_file('../../tmp/outfile-test.not-exist'); --remove_file $MYSQLTEST_VARDIR/tmp/outfile-test.1 --remove_file $MYSQLTEST_VARDIR/tmp/outfile-test.2 --remove_file $MYSQLTEST_VARDIR/tmp/outfile-test.3 drop table t1; # Bug#8191 SELECT INTO OUTFILE insists on FROM clause -disable_query_log; ---disable_cursor_protocol -eval select 1 into outfile "../../tmp/outfile-test.4"; ---enable_cursor_protocol -enable_query_log; -select load_file(concat(@tmpdir,"/outfile-test.4")); +select 1 into outfile "../../tmp/outfile-test.4"; +select load_file('../../tmp/outfile-test.4'); --remove_file $MYSQLTEST_VARDIR/tmp/outfile-test.4 # @@ -89,23 +53,16 @@ DROP TABLE t1; # # Bug#13202 SELECT * INTO OUTFILE ... FROM information_schema.schemata now fails # -disable_query_log; ---disable_cursor_protocol -eval SELECT * INTO OUTFILE "../../tmp/outfile-test.4" +SELECT * INTO OUTFILE "../../tmp/outfile-test.4" FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' FROM information_schema.schemata LIMIT 0, 5; ---enable_cursor_protocol # enable_query_log; --remove_file $MYSQLTEST_VARDIR/tmp/outfile-test.4 use information_schema; -# disable_query_log; ---disable_cursor_protocol -eval SELECT * INTO OUTFILE "../../tmp/outfile-test.4" +SELECT * INTO OUTFILE "../../tmp/outfile-test.4" FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' FROM schemata LIMIT 0, 5; ---enable_cursor_protocol -enable_query_log; --remove_file $MYSQLTEST_VARDIR/tmp/outfile-test.4 use test; @@ -115,10 +72,8 @@ use test; # It should not be possible to write to a file outside of vardir create table t1(a int); --replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR ---disable_cursor_protocol --error ER_OPTION_PREVENTS_STATEMENT eval select * into outfile "$MYSQL_TEST_DIR/outfile-test1" from t1; ---enable_cursor_protocol drop table t1; # @@ -130,29 +85,25 @@ create user user_1@localhost; grant all on mysqltest.* to user_1@localhost; connect (con28181_1,localhost,user_1,,mysqltest); ---disable_cursor_protocol --error ER_ACCESS_DENIED_ERROR -eval select schema_name +select schema_name into outfile "../../tmp/outfile-test.4" fields terminated by ',' optionally enclosed by '"' lines terminated by '\n' from information_schema.schemata where schema_name like 'mysqltest'; ---enable_cursor_protocol connection default; disconnect con28181_1; grant file on *.* to user_1@localhost; connect (con28181_2,localhost,user_1,,mysqltest); ---disable_cursor_protocol -eval select schema_name +select schema_name into outfile "../../tmp/outfile-test.4" fields terminated by ',' optionally enclosed by '"' lines terminated by '\n' from information_schema.schemata where schema_name like 'mysqltest'; ---enable_cursor_protocol connection default; disconnect con28181_2; @@ -164,4 +115,3 @@ drop database mysqltest; # Wait till we reached the initial number of concurrent sessions --source include/wait_until_count_sessions.inc ---enable_ps2_protocol diff --git a/mysql-test/main/outfile_loaddata.result b/mysql-test/main/outfile_loaddata.result index 3b9c4d4af53..7f57c39b878 100644 --- a/mysql-test/main/outfile_loaddata.result +++ b/mysql-test/main/outfile_loaddata.result @@ -1,4 +1,3 @@ -DROP TABLE IF EXISTS t1, t2; ALTER DATABASE test CHARACTER SET latin1 COLLATE latin1_swedish_ci; # # Bug#31663 FIELDS TERMINATED BY special character diff --git a/mysql-test/main/outfile_loaddata.test b/mysql-test/main/outfile_loaddata.test index ee28655d533..33831a4d434 100644 --- a/mysql-test/main/outfile_loaddata.test +++ b/mysql-test/main/outfile_loaddata.test @@ -1,10 +1,5 @@ ---disable_warnings -DROP TABLE IF EXISTS t1, t2; ---enable_warnings - --source include/test_db_charset_latin1.inc ---disable_ps2_protocol --echo # --echo # Bug#31663 FIELDS TERMINATED BY special character --echo # @@ -17,9 +12,7 @@ INSERT INTO t1 VALUES (101, 202, '-r-', '=raker='); --echo # $clauses, warning: --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR ---disable_cursor_protocol --eval SELECT $fields INTO OUTFILE '$MYSQLTEST_VARDIR/tmp/bug31663.txt' $clauses FROM t1 ---enable_cursor_protocol --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR --eval SELECT LOAD_FILE('$MYSQLTEST_VARDIR/tmp/bug31663.txt') as exp --eval CREATE TABLE t2 SELECT $fields FROM t1 @@ -34,9 +27,7 @@ DROP TABLE t2; --echo # Only numeric fields, $clauses, no warnings: --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR ---disable_cursor_protocol --eval SELECT $fields INTO OUTFILE '$MYSQLTEST_VARDIR/tmp/bug31663.txt' $clauses FROM t1 ---enable_cursor_protocol --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR --eval SELECT LOAD_FILE('$MYSQLTEST_VARDIR/tmp/bug31663.txt') as exp --eval CREATE TABLE t2 SELECT $fields FROM t1 @@ -51,9 +42,7 @@ DROP TABLE t2; --echo # $clauses, warning: --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR ---disable_cursor_protocol --eval SELECT $fields INTO OUTFILE '$MYSQLTEST_VARDIR/tmp/bug31663.txt' $clauses FROM t1 ---enable_cursor_protocol --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR --eval SELECT LOAD_FILE('$MYSQLTEST_VARDIR/tmp/bug31663.txt') as exp --eval CREATE TABLE t2 SELECT $fields FROM t1 @@ -68,9 +57,7 @@ DROP TABLE t2; --echo # $clauses, warning: --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR ---disable_cursor_protocol --eval SELECT $fields INTO OUTFILE '$MYSQLTEST_VARDIR/tmp/bug31663.txt' $clauses FROM t1 ---enable_cursor_protocol --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR --eval SELECT LOAD_FILE('$MYSQLTEST_VARDIR/tmp/bug31663.txt') as exp --eval CREATE TABLE t2 SELECT $fields FROM t1 @@ -85,9 +72,7 @@ DROP TABLE t2; --echo # Only string fields, $clauses, no warnings: --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR ---disable_cursor_protocol --eval SELECT $fields INTO OUTFILE '$MYSQLTEST_VARDIR/tmp/bug31663.txt' $clauses FROM t1 ---enable_cursor_protocol --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR --eval SELECT LOAD_FILE('$MYSQLTEST_VARDIR/tmp/bug31663.txt') as exp --eval CREATE TABLE t2 SELECT $fields FROM t1 @@ -110,9 +95,7 @@ SELECT HEX(c1) FROM t1; --let $file=$MYSQLTEST_VARDIR/tmp/bug32533.txt --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR ---disable_cursor_protocol --eval SELECT * INTO OUTFILE '$file' FIELDS ENCLOSED BY 0xC3 FROM t1 ---enable_cursor_protocol TRUNCATE t1; --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR @@ -147,17 +130,13 @@ INSERT INTO t1 VALUES (1, 'ABC-АБВ', 'DEF-ÂÃÄ'), (2, NULL, NULL); --echo # Error on multi-character ENCLOSED/ESCAPED BY --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR ---disable_cursor_protocol ---error 1083 +--error ER_WRONG_FIELD_TERMINATORS --eval SELECT * FROM t1 INTO OUTFILE '$file' FIELDS ENCLOSED BY '12345' ---enable_cursor_protocol --remove_file $file --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR ---disable_cursor_protocol ---error 1083 +--error ER_WRONG_FIELD_TERMINATORS --eval SELECT * FROM t1 INTO OUTFILE '$file' FIELDS ESCAPED BY '12345' ---enable_cursor_protocol --remove_file $file @@ -165,27 +144,21 @@ INSERT INTO t1 VALUES (1, 'ABC-АБВ', 'DEF-ÂÃÄ'), (2, NULL, NULL); --echo # LOAD DATA rises error or has unpredictable result -- to be fixed later --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR ---disable_cursor_protocol --eval SELECT * INTO OUTFILE '$file' FIELDS ENCLOSED BY 'ъ' FROM t1 ---enable_cursor_protocol --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR ---error 1083 # backward compatibility +--error ER_WRONG_FIELD_TERMINATORS # backward compatibility --eval LOAD DATA INFILE '$file' INTO TABLE t2 CHARACTER SET binary FIELDS ENCLOSED BY 'ъ' --remove_file $file --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR ---disable_cursor_protocol --eval SELECT * INTO OUTFILE '$file' FIELDS ESCAPED BY 'ъ' FROM t1 ---enable_cursor_protocol --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR ---error 1083 # backward compatibility +--error ER_WRONG_FIELD_TERMINATORS # backward compatibility --eval LOAD DATA INFILE '$file' INTO TABLE t2 CHARACTER SET binary FIELDS ESCAPED BY 'ъ' --remove_file $file --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR ---disable_cursor_protocol --eval SELECT * INTO OUTFILE '$file' FIELDS TERMINATED BY 'ъ' FROM t1 ---enable_cursor_protocol --echo ################################################## --cat_file $file --echo ################################################## @@ -198,9 +171,7 @@ SELECT * FROM t1; SELECT * FROM t2; --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR ---disable_cursor_protocol --eval SELECT * INTO OUTFILE '$file' LINES STARTING BY 'ъ' FROM t1 ---enable_cursor_protocol --echo ################################################## --cat_file $file --echo ################################################## @@ -211,9 +182,7 @@ TRUNCATE t2; SELECT * FROM t1 UNION SELECT * FROM t2 ORDER BY a, b, c; --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR ---disable_cursor_protocol --eval SELECT * INTO OUTFILE '$file' LINES TERMINATED BY 'ъ' FROM t1 ---enable_cursor_protocol --echo ################################################## --cat_file $file --echo ################################################## @@ -228,9 +197,7 @@ SELECT * FROM t2; --echo # Default (binary) charset: --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR ---disable_cursor_protocol --eval SELECT * INTO OUTFILE '$file' FROM t1 ---enable_cursor_protocol --echo ################################################## --cat_file $file --echo ################################################## @@ -244,9 +211,7 @@ SELECT * FROM t1 UNION SELECT * FROM t2 ORDER BY a, b, c; --echo # latin1 charset (INTO OUTFILE warning is expected): --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR ---disable_cursor_protocol --eval SELECT * INTO OUTFILE '$file' CHARACTER SET latin1 FROM t1 ---enable_cursor_protocol --echo ################################################## --cat_file $file --echo ################################################## @@ -260,9 +225,7 @@ SELECT * FROM t1 UNION SELECT * FROM t2 ORDER BY a, b, c; --echo # KOI8-R charset (INTO OUTFILE warning is expected): --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR ---disable_cursor_protocol --eval SELECT * INTO OUTFILE '$file' CHARACTER SET koi8r FROM t1 ---enable_cursor_protocol --echo ################################################## --cat_file $file --echo ################################################## @@ -276,9 +239,7 @@ SELECT * FROM t1 UNION SELECT * FROM t2 ORDER BY a, b, c; --echo # UTF-8 charset: --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR ---disable_cursor_protocol --eval SELECT * INTO OUTFILE '$file' CHARACTER SET utf8 FROM t1 ---enable_cursor_protocol --echo ################################################## --cat_file $file --echo ################################################## @@ -310,9 +271,7 @@ let $length= 800; --eval INSERT INTO t1 VALUES (REPEAT('.', $length)) --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR ---disable_cursor_protocol --eval SELECT * INTO OUTFILE $file CHARACTER SET latin1 FROM t1 ---enable_cursor_protocol --echo # should be greater than $length --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR @@ -329,7 +288,6 @@ SELECT LENGTH(a) FROM t2; DROP TABLE t1, t2; --disable_prepare_warnings ---enable_ps2_protocol ########################################################################### --echo # End of 5.1 tests. diff --git a/mysql-test/main/ps_missed_cmds_bin_prot.test b/mysql-test/main/ps_missed_cmds_bin_prot.test index 4e109c6d775..a2be5507414 100644 --- a/mysql-test/main/ps_missed_cmds_bin_prot.test +++ b/mysql-test/main/ps_missed_cmds_bin_prot.test @@ -19,9 +19,7 @@ SET default_storage_engine= InnoDB; CREATE TABLE t1 (a INT); INSERT INTO t1 VALUES (1); COMMIT; ---disable_ps2_protocol SELECT * INTO OUTFILE 'load.data' FROM t1; ---enable_ps2_protocol LOAD DATA INFILE 'load.data' INTO TABLE t1; SELECT * FROM t1; diff --git a/mysql-test/main/query_cache.result b/mysql-test/main/query_cache.result index 3519aabb943..9558f2e2274 100644 --- a/mysql-test/main/query_cache.result +++ b/mysql-test/main/query_cache.result @@ -13,10 +13,6 @@ flush query cache; flush query cache; reset query cache; flush global status; -drop table if exists t1,t2,t3,t4,t11,t21,t1_1,t1_2,t9,t9_1,t9_2; -drop database if exists mysqltest; -drop table if exists ```a`; -drop view if exists v1; create table t1 (a int not null); insert into t1 values (1),(2),(3); select * from t1; @@ -1085,7 +1081,6 @@ Qcache_hits 4 drop table t1; create table t1 (a int); insert into t1 values (1),(2); -drop procedure if exists p1; CREATE PROCEDURE `p1`() begin Declare c1 cursor for select a from t1; @@ -1617,8 +1612,6 @@ Qcache_free_blocks 1 set global query_cache_type=on; set session query_cache_type=on; Restore default values. -drop database if exists db1; -drop database if exists db2; set GLOBAL query_cache_size=15*1024*1024; create database db1; use db1; @@ -1638,8 +1631,6 @@ Variable_name Value Qcache_queries_in_cache 0 drop database db2; set global query_cache_size=@save_query_cache_size; -drop database if exists db1; -drop database if exists db3; set GLOBAL query_cache_size=15*1024*1024; create database db1; create database db3; @@ -1702,7 +1693,6 @@ Qcache_hits 1 DROP TABLE t1; SET GLOBAL concurrent_insert= @save_concurrent_insert; SET GLOBAL query_cache_size= default; -DROP TABLE IF EXISTS t1; FLUSH GLOBAL STATUS; SET GLOBAL query_cache_size=1048576; CREATE TABLE t1 (a INT); @@ -1759,8 +1749,6 @@ SET @row_count = 4; SET @sleep_time_per_result_row = 1; SET @max_acceptable_delay = 2; SET @@global.query_cache_size = 1024 * 64; -DROP TEMPORARY TABLE IF EXISTS t_history; -DROP TABLE IF EXISTS t1; CREATE TEMPORARY TABLE t_history (attempt SMALLINT, start_ts DATETIME, end_ts DATETIME, start_cached INTEGER, end_cached INTEGER); @@ -1914,7 +1902,6 @@ End of 5.1 tests # # Bug#51336 Assert in reload_acl_and_cache during RESET QUERY CACHE # -DROP TABLE IF EXISTS t1; CREATE TABLE t1(id INT); START TRANSACTION; SELECT * FROM t1; diff --git a/mysql-test/main/query_cache.test b/mysql-test/main/query_cache.test index 539c7db37cf..1994b84f184 100644 --- a/mysql-test/main/query_cache.test +++ b/mysql-test/main/query_cache.test @@ -26,14 +26,6 @@ flush query cache; # This crashed in some versions flush query cache; # This crashed in some versions reset query cache; flush global status; ---disable_warnings -drop table if exists t1,t2,t3,t4,t11,t21,t1_1,t1_2,t9,t9_1,t9_2; -drop database if exists mysqltest; - -# Fix possible left overs from other tests -drop table if exists ```a`; -drop view if exists v1; ---enable_warnings # # First simple test @@ -805,9 +797,6 @@ drop table t1; create table t1 (a int); insert into t1 values (1),(2); ---disable_warnings -drop procedure if exists p1; ---enable_warnings delimiter //; CREATE PROCEDURE `p1`() begin @@ -1228,10 +1217,6 @@ set global query_cache_type=on; set session query_cache_type=on; --echo Restore default values. - --disable_warnings - drop database if exists db1; - drop database if exists db2; - --enable_warnings set GLOBAL query_cache_size=15*1024*1024; create database db1; use db1; @@ -1247,10 +1232,6 @@ set session query_cache_type=on; drop database db2; set global query_cache_size=@save_query_cache_size; - --disable_warnings - drop database if exists db1; - drop database if exists db3; - --enable_warnings set GLOBAL query_cache_size=15*1024*1024; create database db1; create database db3; @@ -1303,10 +1284,6 @@ SET GLOBAL query_cache_size= default; # Bug#36326: nested transaction and select # ---disable_warnings -DROP TABLE IF EXISTS t1; ---enable_warnings - FLUSH GLOBAL STATUS; SET GLOBAL query_cache_size=1048576; CREATE TABLE t1 (a INT); @@ -1428,10 +1405,6 @@ if (!` SELECT (@sleep_time_per_result_row * @row_count - @max_acceptable_delay > exit; } SET @@global.query_cache_size = 1024 * 64; ---disable_warnings -DROP TEMPORARY TABLE IF EXISTS t_history; -DROP TABLE IF EXISTS t1; ---enable_warnings CREATE TEMPORARY TABLE t_history (attempt SMALLINT, start_ts DATETIME, end_ts DATETIME, start_cached INTEGER, end_cached INTEGER); @@ -1607,10 +1580,6 @@ DROP TABLE t1; --echo # Bug#51336 Assert in reload_acl_and_cache during RESET QUERY CACHE --echo # ---disable_warnings -DROP TABLE IF EXISTS t1; ---enable_warnings - CREATE TABLE t1(id INT); START TRANSACTION; diff --git a/mysql-test/main/secure_file_priv_win.test b/mysql-test/main/secure_file_priv_win.test index bacc9fc2de1..be5345dc161 100644 --- a/mysql-test/main/secure_file_priv_win.test +++ b/mysql-test/main/secure_file_priv_win.test @@ -12,12 +12,9 @@ INSERT INTO t1 values ('a'); LET $MYSQL_TMP_DIR_UCASE= `SELECT upper('$MYSQL_TMP_DIR')`; LET $MYSQL_TMP_DIR_LCASE= `SELECT lower('$MYSQL_TMP_DIR')`; ---disable_ps2_protocol ---disable_cursor_protocol #create the file --replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR eval SELECT * INTO OUTFILE '$MYSQL_TMP_DIR/B11764517.tmp' FROM t1; ---enable_cursor_protocol --replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR show global variables like 'secure_file_priv'; @@ -53,7 +50,6 @@ eval LOAD DATA INFILE '$MYSQL_TMP_DIR_LCASE/B11764517.tmp' INTO TABLE t1; --error ER_OPTION_PREVENTS_STATEMENT eval LOAD DATA INFILE "$MYSQL_TMP_DIR\\\\..a..\\\\..\\\\..\\\\B11764517.tmp" into table t1; ---disable_cursor_protocol --replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR --error ER_OPTION_PREVENTS_STATEMENT eval SELECT * INTO OUTFILE '$MYSQL_TMP_DIR\\\\..a..\\\\..\\\\..\\\\B11764517-2.tmp' FROM t1; @@ -69,7 +65,6 @@ eval SELECT * INTO OUTFILE '$MYSQL_TMP_DIR_UCASE/B11764517-4.tmp' FROM t1; --replace_result $MYSQL_TMP_DIR_LCASE MYSQL_TMP_DIR_LCASE eval SELECT * INTO OUTFILE '$MYSQL_TMP_DIR_LCASE/B11764517-5.tmp' FROM t1; ---enable_cursor_protocol --error 0,1 --remove_file $MYSQL_TMP_DIR/B11764517.tmp; @@ -82,4 +77,3 @@ eval SELECT * INTO OUTFILE '$MYSQL_TMP_DIR_LCASE/B11764517-5.tmp' FROM t1; --error 0,1 --remove_file $MYSQL_TMP_DIR/B11764517-5.tmp; DROP TABLE t1; ---enable_ps2_protocol diff --git a/mysql-test/main/sp-error.test b/mysql-test/main/sp-error.test index d8c265335e4..bf97bcc7577 100644 --- a/mysql-test/main/sp-error.test +++ b/mysql-test/main/sp-error.test @@ -4,15 +4,11 @@ --source include/default_charset.inc ---disable_ps2_protocol # Backup the mysql.proc table --enable_prepare_warnings --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR ---disable_cursor_protocol eval SELECT * FROM mysql.proc INTO OUTFILE '$MYSQLTEST_VARDIR/tmp/proc.txt'; --disable_prepare_warnings ---enable_cursor_protocol ---enable_ps2_protocol # Make sure we don't have any procedures left. delete from mysql.proc; diff --git a/mysql-test/main/sp.result b/mysql-test/main/sp.result index 4d7bf469451..4616baed65a 100644 --- a/mysql-test/main/sp.result +++ b/mysql-test/main/sp.result @@ -1,12 +1,6 @@ set @save_character_set_client=@@character_set_client; set @save_userstat=@@global.userstat, @@global.userstat= 0; use test; -drop table if exists t1,t2,t3,t4; -drop view if exists v1; -drop procedure if exists p1; -drop procedure if exists p2; -drop function if exists f1; -drop function if exists f2; create table t1 ( id char(16) not null default '', data int not null @@ -16,7 +10,6 @@ s char(16), i int, d double ); -drop procedure if exists foo42; create procedure foo42() insert into test.t1 values ("foo", 42); call foo42(); @@ -25,7 +18,6 @@ id data foo 42 delete from t1; drop procedure foo42; -drop procedure if exists bar; create procedure bar(x char(16), y int) insert into test.t1 values (x, y); call bar("bar", 666); @@ -33,13 +25,11 @@ select * from t1; id data bar 666 delete from t1; -drop procedure if exists empty| create procedure empty() begin end| call empty()| drop procedure empty| -drop procedure if exists scope| create procedure scope(a int, b float) begin declare b int; @@ -49,7 +39,6 @@ declare c int; end; end| drop procedure scope| -drop procedure if exists two| create procedure two(x1 char(16), x2 char(16), y int) begin insert into test.t1 values (x1, y); @@ -62,7 +51,6 @@ one 3 two 3 delete from t1| drop procedure two| -drop procedure if exists locset| create procedure locset(x char(16), y int) begin declare z1, z2 int; @@ -76,7 +64,6 @@ id data locset 21 delete from t1| drop procedure locset| -drop procedure if exists setcontext| create procedure setcontext() begin declare data int default 2; @@ -92,7 +79,6 @@ kaka 3 delete from t1| drop procedure setcontext| create table t3 ( d date, i int, f double, s varchar(32) )| -drop procedure if exists nullset| create procedure nullset() begin declare ld date; @@ -120,7 +106,6 @@ NULL NULL NULL lf = 0 NULL 1 1 ls is null drop table t3| drop procedure nullset| -drop procedure if exists mixset| create procedure mixset(x char(16), y int) begin declare z int; @@ -136,14 +121,12 @@ id data @z mixset 666 19 delete from t1| drop procedure mixset| -drop procedure if exists zip| create procedure zip(x char(16), y int) begin declare z int; call zap(y, z); call bar(x, z); end| -drop procedure if exists zap| create procedure zap(x int, out y int) begin declare z int; @@ -161,16 +144,12 @@ select @zap| @zap 8 drop procedure zap| -drop procedure if exists c1| create procedure c1(x int) call c2("c", x)| -drop procedure if exists c2| create procedure c2(s char(16), x int) call c3(x, s)| -drop procedure if exists c3| create procedure c3(x int, s char(16)) call c4("level", x, s)| -drop procedure if exists c4| create procedure c4(l char(8), x int, s char(16)) insert into t1 values (concat(l,s), x)| call c1(42)| @@ -182,19 +161,16 @@ drop procedure c1| drop procedure c2| drop procedure c3| drop procedure c4| -drop procedure if exists iotest| create procedure iotest(x1 char(16), x2 char(16), y int) begin call inc2(x2, y); insert into test.t1 values (x1, y); end| -drop procedure if exists inc2| create procedure inc2(x char(16), y int) begin call inc(y); insert into test.t1 values (x, y); end| -drop procedure if exists inc| create procedure inc(inout io int) set io = io + 1| call iotest("io1", "io2", 1)| @@ -205,7 +181,6 @@ io1 1 delete from t1| drop procedure iotest| drop procedure inc2| -drop procedure if exists incr| create procedure incr(inout x int) call inc(x)| select @zap| @@ -217,14 +192,12 @@ select @zap| 9 drop procedure inc| drop procedure incr| -drop procedure if exists cbv1| create procedure cbv1() begin declare y int default 3; call cbv2(y+1, y); insert into test.t1 values ("cbv1", y); end| -drop procedure if exists cbv2| create procedure cbv2(y1 int, inout y2 int) begin set y2 = 4711; @@ -239,17 +212,14 @@ delete from t1| drop procedure cbv1| drop procedure cbv2| insert into t2 values ("a", 1, 1.1), ("b", 2, 1.2), ("c", 3, 1.3)| -drop procedure if exists sub1| create procedure sub1(id char(16), x int) insert into test.t1 values (id, x)| -drop procedure if exists sub2| create procedure sub2(id char(16)) begin declare x int; set x = (select sum(t.i) from test.t2 t); insert into test.t1 values (id, x); end| -drop procedure if exists sub3| create function sub3(i int) returns int deterministic return i+1| call sub1("sub1a", (select 7))| @@ -272,7 +242,6 @@ drop procedure sub2| drop function sub3| delete from t1| delete from t2| -drop procedure if exists a0| create procedure a0(x int) while x do set x = x-1; @@ -286,7 +255,6 @@ a0 1 a0 0 delete from t1| drop procedure a0| -drop procedure if exists a| create procedure a(x int) while x > 0 do set x = x-1; @@ -300,7 +268,6 @@ a 1 a 0 delete from t1| drop procedure a| -drop procedure if exists b| create procedure b(x int) repeat insert into test.t1 values (repeat("b",3), x); @@ -314,14 +281,12 @@ bbb 2 bbb 1 delete from t1| drop procedure b| -drop procedure if exists b2| create procedure b2(x int) repeat(select 1) into outfile 'b2'; insert into test.t1 values (repeat("b2",3), x); set x = x-1; until x = 0 end repeat| drop procedure b2| -drop procedure if exists c| create procedure c(x int) hmm: while x > 0 do insert into test.t1 values ("c", x); @@ -337,7 +302,6 @@ c 2 c 1 delete from t1| drop procedure c| -drop procedure if exists d| create procedure d(x int) hmm: while x > 0 do insert into test.t1 values ("d", x); @@ -351,7 +315,6 @@ id data d 3 delete from t1| drop procedure d| -drop procedure if exists e| create procedure e(x int) foo: loop if x = 0 then @@ -368,7 +331,6 @@ e 2 e 1 delete from t1| drop procedure e| -drop procedure if exists f| create procedure f(x int) if x < 0 then insert into test.t1 values ("f", 0); @@ -387,7 +349,6 @@ f 1 f 2 delete from t1| drop procedure f| -drop procedure if exists g| create procedure g(x int) case when x < 0 then @@ -407,7 +368,6 @@ g 1 g 2 delete from t1| drop procedure g| -drop procedure if exists h| create procedure h(x int) case x when 0 then @@ -427,7 +387,6 @@ h1 1 h? 17 delete from t1| drop procedure h| -drop procedure if exists i| create procedure i(x int) foo: begin @@ -445,7 +404,6 @@ delete from t1| drop procedure i| insert into t1 values ("foo", 3), ("bar", 19)| insert into t2 values ("x", 9, 4.1), ("y", -1, 19.2), ("z", 3, 2.2)| -drop procedure if exists sel1| create procedure sel1() begin select * from t1 order by data; @@ -455,7 +413,6 @@ id data foo 3 bar 19 drop procedure sel1| -drop procedure if exists sel2| create procedure sel2() begin select * from t1 order by data; @@ -472,7 +429,6 @@ z 3 2.2 drop procedure sel2| delete from t1| delete from t2| -drop procedure if exists into_test| create procedure into_test(x char(16), y int) begin insert into test.t1 values (x, y); @@ -486,7 +442,6 @@ into 100 into2 102 delete from t1| drop procedure into_test| -drop procedure if exists into_tes2| create procedure into_test2(x char(16), y int) begin insert into test.t1 values (x, y); @@ -500,7 +455,6 @@ into 100 100 into2 102 100 delete from t1| drop procedure into_test2| -drop procedure if exists into_test3| create procedure into_test3() begin declare x char(16); @@ -518,7 +472,6 @@ into3 19 0 delete from t1| delete from t2| drop procedure into_test3| -drop procedure if exists into_test4| create procedure into_test4() begin declare x int; @@ -540,7 +493,6 @@ into4 77 delete from t1| drop table t3| drop procedure into_test4| -drop procedure if exists into_outfile| create procedure into_outfile(x char(16), y int) begin insert into test.t1 values (x, y); @@ -550,7 +502,6 @@ end| call into_outfile("ofile", 1)| delete from t1| drop procedure into_outfile| -drop procedure if exists into_dumpfile| create procedure into_dumpfile(x char(16), y int) begin insert into test.t1 values (x, y); @@ -560,7 +511,6 @@ end| call into_dumpfile("dfile", 1)| delete from t1| drop procedure into_dumpfile| -drop procedure if exists create_select| create procedure create_select(x char(16), y int) begin insert into test.t1 values (x, y); @@ -575,32 +525,27 @@ cs 90 cs2 92 drop table t3| delete from t1| drop procedure create_select| -drop function if exists e| create function e() returns double return 2.7182818284590452354| set @e = e()| select e(), @e| e() @e 2.718281828459045 2.718281828459045 -drop function if exists inc| create function inc(i int) returns int return i+1| select inc(1), inc(99), inc(-71)| inc(1) inc(99) inc(-71) 2 100 -70 -drop function if exists mul| create function mul(x int, y int) returns int return x*y| select mul(1,1), mul(3,5), mul(4711, 666)| mul(1,1) mul(3,5) mul(4711, 666) 1 15 3137526 -drop function if exists append| create function append(s1 char(8), s2 char(8)) returns char(16) return concat(s1, s2)| select append("foo", "bar")| append("foo", "bar") foobar -drop function if exists fac| create function fac(n int unsigned) returns bigint unsigned begin declare f bigint unsigned default 1; @@ -613,7 +558,6 @@ end| select fac(1), fac(2), fac(5), fac(10)| fac(1) fac(2) fac(5) fac(10) 1 2 120 3628800 -drop function if exists fun| create function fun(d double, i int, u int unsigned) returns double return mul(inc(i), fac(u)) / e()| select fun(2.3, 3, 5)| @@ -641,7 +585,6 @@ drop function inc| drop function mul| drop function append| drop function fun| -drop procedure if exists hndlr1| create procedure hndlr1(val int) begin declare x int default 0; @@ -660,7 +603,6 @@ id data hndlr1 42 delete from t1| drop procedure hndlr1| -drop procedure if exists hndlr2| create procedure hndlr2(val int) begin declare x int default 0; @@ -676,7 +618,6 @@ id data hndlr2 1 delete from t1| drop procedure hndlr2| -drop procedure if exists hndlr3| create procedure hndlr3(val int) begin declare x int default 0; @@ -704,7 +645,6 @@ hndlr3 13 delete from t1| drop procedure hndlr3| create table t3 ( id char(16), data int )| -drop procedure if exists hndlr4| create procedure hndlr4() begin declare x int default 0; @@ -719,7 +659,6 @@ id data z NULL drop table t3| drop procedure hndlr4| -drop procedure if exists cur1| create procedure cur1() begin declare a char(16); @@ -746,7 +685,6 @@ bar 15 zap 663 drop procedure cur1| create table t3 ( s char(16), i int )| -drop procedure if exists cur2| create procedure cur2() begin declare done int default 0; @@ -783,7 +721,6 @@ delete from t1| delete from t2| drop table t3| drop procedure cur2| -drop procedure if exists chistics| create procedure chistics() language sql modifies sql data @@ -811,7 +748,6 @@ chistics STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_E COMMENT 'Characteristics procedure test' insert into t1 values ("chistics", 1) latin1 latin1_swedish_ci utf8mb4_uca1400_ai_ci drop procedure chistics| -drop function if exists chistics| create function chistics() returns int language sql deterministic @@ -842,7 +778,6 @@ return 42 latin1 latin1_swedish_ci utf8mb4_uca1400_ai_ci drop function chistics| insert into t1 values ("foo", 1), ("bar", 2), ("zip", 3)| set @@sql_mode = 'ANSI'| -drop procedure if exists modes$ create procedure modes(out c1 int, out c2 int) begin declare done int default 0; @@ -879,14 +814,12 @@ use test| drop database sp_db2| create database sp_db3| use sp_db3| -drop procedure if exists dummy| create procedure dummy(out x int) set x = 42| use test| drop database sp_db3| select type,db,name from mysql.proc where db = 'sp_db3'| type db name -drop procedure if exists rc| create procedure rc() begin delete from t1; @@ -914,23 +847,6 @@ select row_count()| row_count() -1 drop procedure rc| -drop function if exists f0| -drop function if exists f1| -drop function if exists f2| -drop function if exists f3| -drop function if exists f4| -drop function if exists f5| -drop function if exists f6| -drop function if exists f7| -drop function if exists f8| -drop function if exists f9| -drop function if exists f10| -drop function if exists f11| -drop function if exists f12_1| -drop function if exists f12_2| -drop view if exists v0| -drop view if exists v1| -drop view if exists v2| delete from t1| delete from t2| insert into t1 values ("a", 1), ("b", 2) | @@ -1165,6 +1081,7 @@ drop temporary table t3| select f12_1() from t1 limit 1| f12_1() 3 +drop temporary table t3| drop function f0| drop function f1| drop function f2| @@ -1185,9 +1102,7 @@ drop view v2| truncate table t1 | truncate table t2 | drop table t4| -drop table if exists t3| create table t3 (n int unsigned not null primary key, f bigint unsigned)| -drop procedure if exists ifac| create procedure ifac(n int unsigned) begin declare i int unsigned default 1; @@ -1232,7 +1147,6 @@ drop procedure ifac| drop function fac| show function status where name like '%f%' and Db <> 'sys'| Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation -drop table if exists t3| create table t3 ( i int unsigned not null primary key, p bigint unsigned not null @@ -1247,7 +1161,6 @@ insert into t3 values (30, 131), (31, 137), (32, 139), (33, 149), (34, 151), (35, 157), (36, 163), (37, 167), (38, 173), (39, 179), (40, 181), (41, 191), (42, 193), (43, 197), (44, 199)| -drop procedure if exists opp| create procedure opp(n bigint unsigned, out pp bool) begin declare r double; @@ -1274,7 +1187,6 @@ end; end if; end loop; end| -drop procedure if exists ip| create procedure ip(m int unsigned) begin declare p bigint unsigned; @@ -1335,7 +1247,6 @@ drop procedure opp| drop procedure ip| show procedure status where name like '%p%' and db='test'| Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation -drop procedure if exists bar| create procedure bar(x char(16), y int) comment "111111111111" sql security invoker insert into test.t1 values (x, y)| @@ -1354,7 +1265,6 @@ show procedure status like 'bar'| Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation test bar PROCEDURE root@localhost 0000-00-00 00:00:00 0000-00-00 00:00:00 DEFINER 3333333333 latin1 latin1_swedish_ci utf8mb4_uca1400_ai_ci drop procedure bar| -drop procedure if exists p1| create procedure p1 () select (select s1 from t3) from t3| create table t3 (s1 int)| @@ -1366,14 +1276,12 @@ call p1()| 1 drop procedure p1| drop table t3| -drop function if exists foo| create function `foo` () returns int return 5| select `foo` ()| `foo` () 5 drop function `foo`| -drop function if exists t1max| create function t1max() returns int begin declare x int; @@ -1429,26 +1337,6 @@ zip 3 foo 1 drop table t3| drop function getcount| -drop table if exists t3| -drop procedure if exists h_ee| -drop procedure if exists h_es| -drop procedure if exists h_en| -drop procedure if exists h_ew| -drop procedure if exists h_ex| -drop procedure if exists h_se| -drop procedure if exists h_ss| -drop procedure if exists h_sn| -drop procedure if exists h_sw| -drop procedure if exists h_sx| -drop procedure if exists h_ne| -drop procedure if exists h_ns| -drop procedure if exists h_nn| -drop procedure if exists h_we| -drop procedure if exists h_ws| -drop procedure if exists h_ww| -drop procedure if exists h_xe| -drop procedure if exists h_xs| -drop procedure if exists h_xx| create table t3 (a smallint primary key)| insert into t3 (a) values (1)| create procedure h_ee() @@ -1762,7 +1650,6 @@ drop procedure h_ww| drop procedure h_xe| drop procedure h_xs| drop procedure h_xx| -drop procedure if exists bug822| create procedure bug822(a_id char(16), a_data int) begin declare n int; @@ -1781,7 +1668,6 @@ foo 42 bar 666 delete from t1| drop procedure bug822| -drop procedure if exists bug1495| create procedure bug1495() begin declare x int; @@ -1804,7 +1690,6 @@ less 2 more 17 delete from t1| drop procedure bug1495| -drop procedure if exists bug1547| create procedure bug1547(s char(16)) begin declare x int; @@ -1826,10 +1711,8 @@ less 2 more 17 delete from t1| drop procedure bug1547| -drop table if exists t70| create table t70 (s1 int,s2 int)| insert into t70 values (1,2)| -drop procedure if exists bug1656| create procedure bug1656(out p1 int, out p2 int) select * into p1, p1 from t70| call bug1656(@1, @2)| @@ -1839,7 +1722,6 @@ select @1, @2| drop table t70| drop procedure bug1656| create table t3(a int)| -drop procedure if exists bug1862| create procedure bug1862() begin insert into t3 values(2); @@ -1853,7 +1735,6 @@ a 2 drop table t3| drop procedure bug1862| -drop procedure if exists bug1874| create procedure bug1874() begin declare x int; @@ -1878,7 +1759,6 @@ sum 22 0 delete from t1| delete from t2| drop procedure bug1874| -drop procedure if exists bug2260| create procedure bug2260() begin declare v1 int; @@ -1894,23 +1774,18 @@ select @x2| @x2 2 drop procedure bug2260| -drop procedure if exists bug2267_1| create procedure bug2267_1() begin show procedure status where db='test'; end| -drop procedure if exists bug2267_2| create procedure bug2267_2() begin show function status where db='test'; end| -drop procedure if exists bug2267_3| create procedure bug2267_3() begin show create procedure bug2267_1; end| -drop procedure if exists bug2267_4| -drop function if exists bug2267_4| create procedure bug2267_4() begin show create function bug2267_4; @@ -1940,7 +1815,6 @@ drop procedure bug2267_2| drop procedure bug2267_3| drop procedure bug2267_4| drop function bug2267_4| -drop procedure if exists bug2227| create procedure bug2227(x int) begin declare y float default 2.6; @@ -1951,7 +1825,6 @@ call bug2227(9)| 1.3 x y 42 z 1.3 9 2.6 42 zzz drop procedure bug2227| -drop procedure if exists bug2614| create procedure bug2614() begin drop table if exists t3; @@ -1963,7 +1836,6 @@ call bug2614()| call bug2614()| drop table t3| drop procedure bug2614| -drop function if exists bug2674| create function bug2674() returns int return @@sort_buffer_size| set @osbs = @@sort_buffer_size| @@ -1973,11 +1845,8 @@ bug2674() 262000 drop function bug2674| set @@sort_buffer_size = @osbs| -drop procedure if exists bug3259_1 | create procedure bug3259_1 () begin end| -drop procedure if exists BUG3259_2 | create procedure BUG3259_2 () begin end| -drop procedure if exists Bug3259_3 | create procedure Bug3259_3 () begin end| call BUG3259_1()| call BUG3259_1()| @@ -1988,21 +1857,18 @@ call bUG3259_3()| drop procedure bUg3259_1| drop procedure BuG3259_2| drop procedure BUG3259_3| -drop function if exists bug2772| create function bug2772() returns char(10) character set latin2 return 'a'| select bug2772()| bug2772() a drop function bug2772| -drop procedure if exists bug2776_1| create procedure bug2776_1(out x int) begin declare v int; set v = default; set x = v; end| -drop procedure if exists bug2776_2| create procedure bug2776_2(out x int) begin declare v int default 42; @@ -2024,7 +1890,6 @@ create table t3 (s1 smallint)| insert into t3 values (123456789012)| Warnings: Warning 1264 Out of range value for column 's1' at row 1 -drop procedure if exists bug2780| create procedure bug2780() begin declare exit handler for sqlwarning set @x = 1; @@ -2046,7 +1911,6 @@ create table t3 (content varchar(10) )| insert into t3 values ("test1")| insert into t3 values ("test2")| create table t4 (f1 int, rc int, t3 int)| -drop procedure if exists bug1863| create procedure bug1863(in1 int) begin declare ind int default 0; @@ -2090,7 +1954,6 @@ insert t3 (OrderID,MarketID) values (1,1)| insert t3 (OrderID,MarketID) values (2,2)| insert t4 (MarketID,Market,Status) values (1,"MarketID One","A")| insert t4 (MarketID,Market,Status) values (2,"MarketID Two","A")| -drop procedure if exists bug2656_1| create procedure bug2656_1() begin select @@ -2098,7 +1961,6 @@ m.Market from t4 m JOIN t3 o ON o.MarketID != 1 and o.MarketID = m.MarketID; end | -drop procedure if exists bug2656_2| create procedure bug2656_2() begin select @@ -2123,7 +1985,6 @@ MarketID Two drop procedure bug2656_1| drop procedure bug2656_2| drop table t3, t4| -drop procedure if exists bug3426| create procedure bug3426(in_time int unsigned, out x int) begin if in_time is null then @@ -2166,7 +2027,6 @@ insert into t3 (title,body) values ('1001 MySQL Tricks','1. Never run mysqld as root. 2. ...'), ('MySQL vs. YourSQL','In the following database comparison ...'), ('MySQL Security','When configured properly, MySQL ...')| -drop procedure if exists bug3734 | create procedure bug3734 (param1 varchar(100)) select * from t3 where match (title,body) against (param1)| call bug3734('database')| @@ -2178,7 +2038,6 @@ id title body 6 MySQL Security When configured properly, MySQL ... drop procedure bug3734| drop table t3| -drop procedure if exists bug3863| create procedure bug3863() begin set @a = 0; @@ -2202,7 +2061,6 @@ msg text not null, primary key (id), unique key rid (rid, id) )| -drop procedure if exists bug2460_1| create procedure bug2460_1(in v int) begin ( select n0.id from t3 as n0 where n0.id = v ) @@ -2226,7 +2084,6 @@ call bug2460_1(2)| id 2 1 -drop procedure if exists bug2460_2| create procedure bug2460_2() begin drop table if exists t3; @@ -2242,20 +2099,16 @@ drop procedure bug2460_1| drop procedure bug2460_2| drop table t3| set @@sql_mode = ''| -drop procedure if exists bug2564_1| create procedure bug2564_1() comment 'Joe''s procedure' insert into `t1` values ("foo", 1)| set @@sql_mode = 'ANSI_QUOTES'| -drop procedure if exists bug2564_2| create procedure bug2564_2() insert into "t1" values ('foo', 1)| set @@sql_mode = ''$ -drop function if exists bug2564_3$ create function bug2564_3(x int, y int) returns int return x || y$ set @@sql_mode = 'ANSI'$ -drop function if exists bug2564_4$ create function bug2564_4(x int, y int) returns int return x || y$ set @@sql_mode = ''| @@ -2280,7 +2133,6 @@ drop procedure bug2564_1| drop procedure bug2564_2| drop function bug2564_3| drop function bug2564_4| -drop function if exists bug3132| create function bug3132(s char(20)) returns char(50) return concat('Hello, ', s, '!')| select bug3132('Bob') union all select bug3132('Judy')| @@ -2288,7 +2140,6 @@ bug3132('Bob') Hello, Bob! Hello, Judy! drop function bug3132| -drop procedure if exists bug3843| create procedure bug3843() analyze table t1| call bug3843()| @@ -2305,7 +2156,6 @@ select 1+2| drop procedure bug3843| create table t3 ( s1 char(10) )| insert into t3 values ('a'), ('b')| -drop procedure if exists bug3368| create procedure bug3368(v char(10)) begin select group_concat(v) from t3; @@ -2320,7 +2170,6 @@ drop procedure bug3368| drop table t3| create table t3 (f1 int, f2 int)| insert into t3 values (1,1)| -drop procedure if exists bug4579_1| create procedure bug4579_1 () begin declare sf1 int; @@ -2328,7 +2177,6 @@ select f1 into sf1 from t3 where f1=1 and f2=1; update t3 set f2 = f2 + 1 where f1=1 and f2=1; call bug4579_2(); end| -drop procedure if exists bug4579_2| create procedure bug4579_2 () begin end| @@ -2338,7 +2186,6 @@ call bug4579_1()| drop procedure bug4579_1| drop procedure bug4579_2| drop table t3| -drop procedure if exists bug2773| create function bug2773() returns int return null| create table t3 as select bug2773()| show create table t3| @@ -2348,7 +2195,6 @@ t3 CREATE TABLE `t3` ( ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci drop table t3| drop function bug2773| -drop procedure if exists bug3788| create function bug3788() returns date return cast("2005-03-04" as date)| select bug3788()| bug3788() @@ -2361,7 +2207,6 @@ bug3788() drop function bug3788| create table t3 (f1 int, f2 int, f3 int)| insert into t3 values (1,1,1)| -drop procedure if exists bug4726| create procedure bug4726() begin declare tmp_o_id INT; @@ -2378,7 +2223,6 @@ call bug4726()| call bug4726()| drop procedure bug4726| drop table t3| -drop procedure if exists bug4902| create procedure bug4902() begin show charset like 'foo'; @@ -2440,7 +2284,6 @@ Tables_in_test (foo) Variable_name Value Level Code Message drop procedure bug4902| -drop procedure if exists bug4904| create procedure bug4904() begin declare continue handler for sqlstate 'HY000' begin end; @@ -2450,7 +2293,6 @@ call bug4904()| ERROR 42S02: Table 'test.t3' doesn't exist drop procedure bug4904| create table t3 (s1 char character set latin1, s2 char character set latin2)| -drop procedure if exists bug4904| create procedure bug4904 () begin declare continue handler for sqlstate 'HY000' begin end; @@ -2459,7 +2301,6 @@ end| call bug4904()| drop procedure bug4904| drop table t3| -drop procedure if exists bug336| create procedure bug336(out y int) begin declare x int; @@ -2473,7 +2314,6 @@ select @y| 5 delete from t1| drop procedure bug336| -drop procedure if exists bug3157| create procedure bug3157() begin if exists(select * from t1) then @@ -2491,7 +2331,6 @@ select @n| 2 delete from t1| drop procedure bug3157| -drop procedure if exists bug5251| create procedure bug5251() begin end| @@ -2503,7 +2342,6 @@ where db='test' and name='bug5251' and created = @c1| count(*) 1 drop procedure bug5251| -drop procedure if exists bug5251| create procedure bug5251() checksum table t1| call bug5251()| @@ -2513,7 +2351,6 @@ call bug5251()| Table Checksum test.t1 0 drop procedure bug5251| -drop procedure if exists bug5287| create procedure bug5287(param1 int) label1: begin @@ -2526,7 +2363,6 @@ end loop; end| call bug5287(1)| drop procedure bug5287| -drop procedure if exists bug5307| create procedure bug5307() begin end; set @x = 3| @@ -2535,11 +2371,9 @@ select @x| @x 3 drop procedure bug5307| -drop procedure if exists bug5258| create procedure bug5258() begin end| -drop procedure if exists bug5258_aux| create procedure bug5258_aux() begin declare c, m char(19); @@ -2555,7 +2389,6 @@ Ok Ok drop procedure bug5258| drop procedure bug5258_aux| -drop function if exists bug4487| create function bug4487() returns char begin declare v char; @@ -2565,8 +2398,6 @@ select bug4487()| bug4487() NULL drop function bug4487| -drop procedure if exists bug4941| -drop procedure if exists bug4941| create procedure bug4941(out x int) begin declare c cursor for select i from t2 limit 1; @@ -2582,9 +2413,7 @@ select @x| NULL delete from t1| drop procedure bug4941| -drop procedure if exists bug4905| create table t3 (s1 int,primary key (s1))| -drop procedure if exists bug4905| create procedure bug4905() begin declare v int; @@ -2608,8 +2437,6 @@ s1 1 drop procedure bug4905| drop table t3| -drop procedure if exists bug6029| -drop procedure if exists bug6029| create procedure bug6029() begin declare exit handler for 1136 select '1136'; @@ -2629,7 +2456,6 @@ call bug6029()| 1136 drop procedure bug6029| drop table t3| -drop procedure if exists bug8540| create procedure bug8540() begin declare x int default 1; @@ -2640,7 +2466,6 @@ y z 1 1 drop procedure bug8540| create table t3 (s1 int)| -drop procedure if exists bug6642| create procedure bug6642() select abs(count(s1)) from t3| call bug6642()| @@ -2651,7 +2476,6 @@ abs(count(s1)) 0 drop procedure bug6642| insert into t3 values (0),(1)| -drop procedure if exists bug7013| create procedure bug7013() select s1,count(s1) from t3 group by s1 with rollup| call bug7013()| @@ -2665,7 +2489,6 @@ s1 count(s1) 1 1 NULL 2 drop procedure bug7013| -drop table if exists t4| create table t4 ( a mediumint(8) unsigned not null auto_increment, b smallint(5) unsigned not null, @@ -2674,7 +2497,6 @@ primary key (a) ) engine=myisam default charset=latin1| insert into t4 values (1, 2, 'oneword')| insert into t4 values (2, 2, 'anotherword')| -drop procedure if exists bug7743| create procedure bug7743 ( searchstring char(28) ) begin declare var mediumint(8) unsigned; @@ -2701,12 +2523,6 @@ drop procedure bug7743| drop table t4| delete from t3| insert into t3 values(1)| -drop procedure if exists bug7992_1| -Warnings: -Note 1305 PROCEDURE test.bug7992_1 does not exist -drop procedure if exists bug7992_2| -Warnings: -Note 1305 PROCEDURE test.bug7992_2 does not exist create procedure bug7992_1() begin declare i int; @@ -2722,7 +2538,6 @@ drop procedure bug7992_1| drop procedure bug7992_2| drop table t3| create table t3 ( userid bigint(20) not null default 0 )| -drop procedure if exists bug8116| create procedure bug8116(in _userid int) select * from t3 where userid = _userid| call bug8116(42)| @@ -2731,7 +2546,6 @@ call bug8116(42)| userid drop procedure bug8116| drop table t3| -drop procedure if exists bug6857| create procedure bug6857() begin declare t0, t1 bigint; @@ -2750,7 +2564,6 @@ sleep(1.1) plus 1 drop procedure bug6857| -drop procedure if exists bug8757| create procedure bug8757() begin declare x int; @@ -2780,11 +2593,9 @@ call bug8757()| delete from t1| delete from t2| drop procedure bug8757| -drop procedure if exists bug8762| drop procedure if exists bug8762; create procedure bug8762() begin end| drop procedure if exists bug8762; create procedure bug8762() begin end| drop procedure bug8762| -drop function if exists bug5240| create function bug5240 () returns int begin declare x int; @@ -2800,7 +2611,6 @@ select id, bug5240() from t1| id bug5240() answer 42 drop function bug5240| -drop procedure if exists p1| create table t3(id int)| insert into t3 values(1)| create procedure bug7992() @@ -2828,7 +2638,6 @@ lbsiid int(11) not null default '0', ltradingareaid int(11) not null default '0', primary key (lbsiid,ltradingareaid) )| -drop procedure if exists bug8849| create procedure bug8849() begin insert into t5 @@ -2851,7 +2660,6 @@ call bug8849()| call bug8849()| drop procedure bug8849| drop tables t3,t4,t5| -drop procedure if exists bug8937| create procedure bug8937() begin declare s,x,y,z int; @@ -2870,9 +2678,6 @@ a 3.2 drop procedure bug8937| delete from t1| -drop procedure if exists bug6900| -drop procedure if exists bug9074| -drop procedure if exists bug6900_9074| create table t3 (w char unique, x char)| insert into t3 values ('a', 'b')| create procedure bug6900() @@ -2934,13 +2739,11 @@ drop procedure bug6900| drop procedure bug9074| drop procedure bug6900_9074| drop table t3| -drop procedure if exists avg| create procedure avg () begin end| call avg ()| drop procedure avg| -drop procedure if exists bug6129| set @old_mode= @@sql_mode; set @@sql_mode= "ERROR_FOR_DIVISION_BY_ZERO"; create procedure bug6129() @@ -2958,7 +2761,6 @@ call bug6129()| ERROR_FOR_DIVISION_BY_ZERO set @@sql_mode=@old_mode; drop procedure bug6129| -drop procedure if exists bug9856| create procedure bug9856() begin declare v int; @@ -2976,8 +2778,6 @@ call bug9856()| 16 16 drop procedure bug9856| -drop procedure if exists bug9674_1| -drop procedure if exists bug9674_2| create procedure bug9674_1(out arg int) begin declare temp_in1 int default 0; @@ -3004,8 +2804,6 @@ v/10 10.0000 drop procedure bug9674_1| drop procedure bug9674_2| -drop procedure if exists bug9598_1| -drop procedure if exists bug9598_2| create procedure bug9598_1(in var_1 char(16), out var_2 integer, out var_3 integer) begin @@ -3032,7 +2830,6 @@ select @tmp1, @tmp2| 50 60 drop procedure bug9598_1| drop procedure bug9598_2| -drop procedure if exists bug9902| create function bug9902() returns int(11) begin set @x = @x + 1; @@ -3053,19 +2850,16 @@ select @x| # Restore the old query cache size delete from t1| drop function bug9902| -drop function if exists bug9102| create function bug9102() returns blob return 'a'| select bug9102()| bug9102() a drop function bug9102| -drop function if exists bug7648| create function bug7648() returns bit(8) return 'a'| select bug7648()| bug7648() a drop function bug7648| -drop function if exists bug9775| create function bug9775(v1 char(1)) returns enum('a','b') return v1| select bug9775('a'),bug9775('b'),bug9775('c')| bug9775('a') bug9775('b') bug9775('c') @@ -3095,7 +2889,6 @@ a b a,b Warnings: Warning 1265 Data truncated for column 'bug9775(4)' at row 0 drop function bug9775| -drop function if exists bug8861| create function bug8861(v1 int) returns year return v1| select bug8861(05)| bug8861(05) @@ -3105,8 +2898,6 @@ select @x| @x 2005 drop function bug8861| -drop procedure if exists bug9004_1| -drop procedure if exists bug9004_2| create procedure bug9004_1(x char(16)) begin insert into t1 values (x, 42); @@ -3123,7 +2914,6 @@ Warning 1265 Data truncated for column 'x' at row 0 delete from t1| drop procedure bug9004_1| drop procedure bug9004_2| -drop procedure if exists bug7293| insert into t1 values ('secret', 0)| create procedure bug7293(p1 varchar(100)) begin @@ -3139,15 +2929,12 @@ yes yes drop procedure bug7293| delete from t1| -drop procedure if exists bug9841| -drop view if exists v1| create view v1 as select * from t1, t2 where id = s| create procedure bug9841 () update v1 set data = 10| call bug9841()| drop view v1| drop procedure bug9841| -drop procedure if exists bug5963| create procedure bug5963_1 () begin declare v int; set v = (select s1 from t3); select v; end;| create table t3 (s1 int)| insert into t3 values (5)| @@ -3172,7 +2959,6 @@ call bug5963_2(1)| call bug5963_2(1)| drop procedure bug5963_2| drop table t3| -drop function if exists bug9559| create function bug9559() returns int begin @@ -3183,7 +2969,6 @@ select bug9559()| bug9559() -3 drop function bug9559| -drop procedure if exists bug10961| create procedure bug10961() begin declare v char; @@ -3212,13 +2997,6 @@ x x 3 drop procedure bug10961| -DROP PROCEDURE IF EXISTS bug6866| -DROP VIEW IF EXISTS tv| -Warnings: -Note 4092 Unknown VIEW: 'test.tv' -DROP TABLE IF EXISTS tt1,tt2,tt3| -Warnings: -Note 1051 Unknown table 'test.tt1,test.tt2,test.tt3' CREATE TABLE tt1 (a1 int, a2 int, a3 int, data varchar(10))| CREATE TABLE tt2 (a2 int, data2 varchar(10))| CREATE TABLE tt3 (a3 int, data3 varchar(10))| @@ -3250,7 +3028,6 @@ a1 a2 a3 data data2 data3 DROP PROCEDURE bug6866; DROP VIEW tv| DROP TABLE tt1, tt2, tt3| -DROP PROCEDURE IF EXISTS bug10136| create table t3 ( name char(5) not null primary key, val float not null)| insert into t3 values ('aaaaa', 1), ('bbbbb', 2), ('ccccc', 3)| create procedure bug10136() @@ -3302,7 +3079,6 @@ bbbbb 2 ccccc 3 drop procedure bug10136| drop table t3| -drop procedure if exists bug11529| create procedure bug11529() begin declare c cursor for select id, data from t1 where data in (10,13); @@ -3328,9 +3104,6 @@ call bug11529()| delete from t1| drop procedure bug11529| set character set utf8| -drop procedure if exists bug6063| -drop procedure if exists bug7088_1| -drop procedure if exists bug7088_2| create procedure bug6063() begin lâbel: begin end; @@ -3365,8 +3138,6 @@ l drop procedure bug6063| drop procedure bug7088_1| drop procedure bug7088_2| -drop procedure if exists bug9565_sub| -drop procedure if exists bug9565| create procedure bug9565_sub() begin select * from t1; @@ -3382,7 +3153,6 @@ one 1 delete from t1| drop procedure bug9565_sub| drop procedure bug9565| -drop procedure if exists bug9538| create procedure bug9538() set @@sort_buffer_size = 1000000| set @x = @@sort_buffer_size| @@ -3396,7 +3166,6 @@ select @@sort_buffer_size| 1000000 set @@sort_buffer_size = @x| drop procedure bug9538| -drop procedure if exists bug8692| create table t3 (c1 varchar(5), c2 char(5), c3 enum('one','two'), c4 text, c5 blob, c6 char(5), c7 varchar(5))| insert into t3 values ('', '', '', '', '', '', NULL)| Warnings: @@ -3420,7 +3189,6 @@ v1 v2 v3 v4 v5 v6 v7 NULL drop procedure bug8692| drop table t3| -drop function if exists bug10055| create function bug10055(v char(255)) returns char(255) return lower(v)| select t.column_name, bug10055(t.column_name) from information_schema.columns as t @@ -3429,7 +3197,6 @@ column_name bug10055(t.column_name) id id data data drop function bug10055| -drop procedure if exists bug12297| create procedure bug12297(lim int) begin set @x = 0; @@ -3442,8 +3209,6 @@ end repeat; end| call bug12297(10)| drop procedure bug12297| -drop function if exists f_bug11247| -drop procedure if exists p_bug11247| create function f_bug11247(param int) returns int return param + 1| @@ -3457,8 +3222,6 @@ end| call p_bug11247(10)| drop function f_bug11247| drop procedure p_bug11247| -drop procedure if exists bug12168| -drop table if exists t3, t4| create table t3 (a int)| insert into t3 values (1),(2),(3),(4)| create table t4 (a int)| @@ -3523,9 +3286,7 @@ a 4 truncate t4| drop table t3, t4| -drop procedure if exists bug12168| -drop table if exists t3| -drop procedure if exists bug11333| +drop procedure bug12168| create table t3 (c1 char(128))| insert into t3 values ('AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA')| @@ -3543,7 +3304,6 @@ end| call bug11333(10)| drop procedure bug11333| drop table t3| -drop function if exists bug9048| create function bug9048(f1 char binary) returns char begin set f1= concat( 'hello', f1 ); @@ -3559,7 +3319,6 @@ select collation(bug9048("foo"))| collation(bug9048("foo")) utf8mb4_bin drop function bug9048| -drop procedure if exists bug12849_1| create procedure bug12849_1(inout x char) select x into x| set @var='a'| call bug12849_1(@var)| @@ -3567,7 +3326,6 @@ select @var| @var a drop procedure bug12849_1| -drop procedure if exists bug12849_2| create procedure bug12849_2(inout foo varchar(15)) begin select concat(foo, foo) INTO foo; @@ -3578,8 +3336,6 @@ select @var| @var abcdabcd drop procedure bug12849_2| -drop procedure if exists bug131333| -drop function if exists bug131333| create procedure bug131333() begin begin @@ -3617,11 +3373,6 @@ bug131333() NULL drop procedure bug131333| drop function bug131333| -drop function if exists bug12379| -drop procedure if exists bug12379_1| -drop procedure if exists bug12379_2| -drop procedure if exists bug12379_3| -drop table if exists t3| create table t3 (c1 char(1) primary key not null)| create function bug12379() returns integer @@ -3671,7 +3422,6 @@ drop procedure bug12379_1| drop procedure bug12379_2| drop procedure bug12379_3| drop table t3| -drop procedure if exists bug13124| create procedure bug13124() begin declare y integer; @@ -3679,12 +3429,10 @@ set @x=y; end| call bug13124()| drop procedure bug13124| -drop procedure if exists bug12979_1| create procedure bug12979_1(inout d decimal(5)) set d = d / 2| set @bug12979_user_var = NULL| call bug12979_1(@bug12979_user_var)| drop procedure bug12979_1| -drop procedure if exists bug12979_2| create procedure bug12979_2() begin declare internal_var decimal(5); @@ -3695,8 +3443,6 @@ call bug12979_2()| internal_var NULL drop procedure bug12979_2| -drop table if exists t3| -drop procedure if exists bug6127| create table t3 (s1 int unique)| set @sm=@@sql_mode| set sql_mode='traditional'| @@ -3725,9 +3471,6 @@ s1 set sql_mode=@sm| drop table t3| drop procedure bug6127| -drop procedure if exists bug12589_1| -drop procedure if exists bug12589_2| -drop procedure if exists bug12589_3| create procedure bug12589_1() begin declare spv1 decimal(3,3); @@ -3771,13 +3514,6 @@ tm1 CREATE TEMPORARY TABLE `tm1` ( drop procedure bug12589_1| drop procedure bug12589_2| drop procedure bug12589_3| -drop table if exists t3| -drop procedure if exists bug7049_1| -drop procedure if exists bug7049_2| -drop procedure if exists bug7049_3| -drop procedure if exists bug7049_4| -drop function if exists bug7049_1| -drop function if exists bug7049_2| create table t3 ( x int unique )| create procedure bug7049_1() begin @@ -3839,8 +3575,6 @@ drop procedure bug7049_3| drop procedure bug7049_4| drop function bug7049_1| drop function bug7049_2| -drop function if exists bug13941| -drop procedure if exists bug13941| create function bug13941(p_input_str text) returns text begin @@ -3867,9 +3601,6 @@ select @a| Local drop function bug13941| drop procedure bug13941| -DROP PROCEDURE IF EXISTS bug13095; -DROP TABLE IF EXISTS bug13095_t1; -DROP VIEW IF EXISTS bug13095_v1; CREATE PROCEDURE bug13095(tbl_name varchar(32)) BEGIN SET @str = @@ -3907,11 +3638,8 @@ row2 row3 @str DROP VIEW bug13095_v1 -DROP PROCEDURE IF EXISTS bug13095; -DROP VIEW IF EXISTS bug13095_v1; -DROP TABLE IF EXISTS bug13095_t1; -drop function if exists bug14723| -drop procedure if exists bug14723| +DROP PROCEDURE bug13095; +DROP TABLE bug13095_t1; /*!50003 create function bug14723() returns bigint(20) main_loop: begin @@ -3960,8 +3688,6 @@ call bug14845()| a 0 drop procedure bug14845| -drop procedure if exists bug13549_1| -drop procedure if exists bug13549_2| CREATE PROCEDURE `bug13549_2`() begin call bug13549_1(); @@ -3974,13 +3700,6 @@ end| CALL bug13549_2()| drop procedure bug13549_2| drop procedure bug13549_1| -drop function if exists bug10100f| -drop procedure if exists bug10100p| -drop procedure if exists bug10100t| -drop procedure if exists bug10100pt| -drop procedure if exists bug10100pv| -drop procedure if exists bug10100pd| -drop procedure if exists bug10100pc| create function bug10100f(prm int) returns int begin if prm > 1 then @@ -4150,8 +3869,7 @@ drop procedure bug10100pv| drop procedure bug10100pd| drop procedure bug10100pc| drop view v1| -drop procedure if exists bug13729| -drop table if exists t3| +drop table t3| create table t3 (s1 int, primary key (s1))| insert into t3 values (1),(2)| create procedure bug13729() @@ -4168,8 +3886,6 @@ s1 2 drop procedure bug13729| drop table t3| -drop procedure if exists bug14643_1| -drop procedure if exists bug14643_2| create procedure bug14643_1() begin declare continue handler for sqlexception select 'boo' as 'Handler'; @@ -4195,8 +3911,6 @@ end case; select undefined_var; end| ERROR 42000: Undeclared variable: undefined_var -drop procedure if exists bug14304| -drop table if exists t3, t4| create table t3(a int primary key auto_increment)| create table t4(a int primary key auto_increment)| create procedure bug14304() @@ -4219,7 +3933,6 @@ a 3 drop procedure bug14304| drop table t3, t4| -drop procedure if exists bug14376| create procedure bug14376() begin declare x int default x; @@ -4246,8 +3959,6 @@ call bug14376(4711)| x 4711 drop procedure bug14376| -drop procedure if exists bug5967| -drop table if exists t3| create table t3 (a varchar(255))| insert into t3 (a) values ("a - table column")| create procedure bug5967(a varchar(255)) @@ -4299,7 +4010,6 @@ a - local variable in a nested compound statement A local variable in a nested compound statement takes precedence over table column in cursors a - local variable in a nested compound statement drop procedure bug5967| -drop procedure if exists bug13012| create procedure bug13012() BEGIN REPAIR TABLE t1; @@ -4383,6 +4093,7 @@ test.v1 analyze Error 'test.v1' is not of type 'BASE TABLE' test.v1 analyze status Operation failed drop procedure bug13012| drop view v1| +drop table t3| select * from t1 order by data| id data aa 0 @@ -4395,15 +4106,6 @@ aa 6 aa 7 aa 8 aa 9 -drop schema if exists mysqltest1| -Warnings: -Note 1008 Can't drop database 'mysqltest1'; database doesn't exist -drop schema if exists mysqltest2| -Warnings: -Note 1008 Can't drop database 'mysqltest2'; database doesn't exist -drop schema if exists mysqltest3| -Warnings: -Note 1008 Can't drop database 'mysqltest3'; database doesn't exist create schema mysqltest1| create schema mysqltest2| create schema mysqltest3| @@ -4430,12 +4132,10 @@ call mysqltest1.p1(@rs)| ERROR 42000: Incorrect number of arguments for PROCEDURE mysqltest3.p3; expected 1, got 2 call mysqltest1.p1(@rs)| ERROR 42000: Incorrect number of arguments for PROCEDURE mysqltest3.p3; expected 1, got 2 -drop schema if exists mysqltest1| -drop schema if exists mysqltest2| -drop schema if exists mysqltest3| +drop schema mysqltest1| +drop schema mysqltest2| +drop schema mysqltest3| use test| -drop table if exists t3| -drop procedure if exists bug15441| create table t3 (id int not null primary key, county varchar(25))| insert into t3 (id, county) values (1, 'York')| create procedure bug15441(c varchar(25)) @@ -4461,11 +4161,6 @@ id county 2 NULL drop table t3| drop procedure bug15441| -drop procedure if exists bug14498_1| -drop procedure if exists bug14498_2| -drop procedure if exists bug14498_3| -drop procedure if exists bug14498_4| -drop procedure if exists bug14498_5| create procedure bug14498_1() begin declare continue handler for sqlexception select 'error' as 'Handler'; @@ -4523,13 +4218,6 @@ end case; select 'done' as 'End'; end| ERROR 42000: Undeclared variable: v -drop table if exists t3| -drop procedure if exists bug15231_1| -drop procedure if exists bug15231_2| -drop procedure if exists bug15231_3| -drop procedure if exists bug15231_4| -drop procedure if exists bug15231_5| -drop procedure if exists bug15231_6| create table t3 (id int not null)| create procedure bug15231_1() begin @@ -4600,7 +4288,6 @@ drop procedure bug15231_3| drop procedure bug15231_4| drop procedure bug15231_5| drop procedure bug15231_6| -drop procedure if exists bug15011| create table t3 (c1 int primary key)| insert into t3 values (1)| create procedure bug15011() @@ -4619,7 +4306,6 @@ Handler Inner drop procedure bug15011| drop table t3| -drop procedure if exists bug17476| create table t3 ( d date )| insert into t3 values ( '2005-01-01' ), ( '2005-01-02' ), ( '2005-01-03' ), @@ -4638,8 +4324,6 @@ date_format(t3.d, pDateFormat) count(*) 2005-02 2 drop table t3| drop procedure bug17476| -drop table if exists t3| -drop procedure if exists bug16887| create table t3 ( c varchar(1) )| insert into t3 values (' '),('.'),(';'),(','),('-'),('_'),('('),(')'),('/'),('\\')| @@ -4694,8 +4378,6 @@ i 0 drop table t3| drop procedure bug16887| -drop procedure if exists bug16474_1| -drop procedure if exists bug16474_2| delete from t1| insert into t1 values ('c', 2), ('b', 3), ('a', 1)| create procedure bug16474_1() @@ -4703,7 +4385,6 @@ begin declare x int; select id from t1 order by x, id; end| -drop procedure if exists bug14945| create table t3 (id int not null auto_increment primary key)| create procedure bug14945() deterministic truncate t3| insert into t3 values (null)| @@ -4740,8 +4421,6 @@ a 1 c 2 b 3 delete from t1| -drop function if exists bug15728| -drop table if exists t3| create table t3 ( id int not null auto_increment, primary key (id) @@ -4757,7 +4436,6 @@ bug15728() 1 drop function bug15728| drop table t3| -drop procedure if exists bug18787| create procedure bug18787() begin declare continue handler for sqlexception begin end; @@ -4794,7 +4472,6 @@ schema_name select routine_name,routine_schema from information_schema.routines where routine_schema like 'bug18344%'| routine_name routine_schema -drop function if exists bug12472| create function bug12472() returns int return (select count(*) from t1)| create table t3 as select bug12472() as i| show create table t3| @@ -4819,9 +4496,6 @@ j drop table t3| drop view v1| drop function bug12472| -DROP FUNCTION IF EXISTS bug18589_f1| -DROP PROCEDURE IF EXISTS bug18589_p1| -DROP PROCEDURE IF EXISTS bug18589_p2| CREATE FUNCTION bug18589_f1(arg TEXT) RETURNS TEXT BEGIN RETURN CONCAT(arg, ""); @@ -4850,9 +4524,6 @@ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa DROP FUNCTION bug18589_f1| DROP PROCEDURE bug18589_p1| DROP PROCEDURE bug18589_p2| -DROP FUNCTION IF EXISTS bug18037_f1| -DROP PROCEDURE IF EXISTS bug18037_p1| -DROP PROCEDURE IF EXISTS bug18037_p2| CREATE FUNCTION bug18037_f1() RETURNS INT BEGIN RETURN @@server_id; @@ -4898,6 +4569,7 @@ select mysqltest1.bug18444(i) from t3| mysqltest1.bug18444(i) 2 3 +drop table t3| drop database mysqltest1| create database mysqltest1 charset=utf8| create database mysqltest2 charset=utf8| @@ -4926,8 +4598,6 @@ mysqltest2 CREATE DATABASE `mysqltest2` /*!40100 DEFAULT CHARACTER SET utf8mb3 C drop database mysqltest1| drop database mysqltest2| use test| -drop table if exists t3| -drop procedure if exists bug15217| create table t3 as select 1| create procedure bug15217() begin @@ -4947,7 +4617,6 @@ concat('data was: /', var1, '/') data was: /1/ drop table t3| drop procedure bug15217| -DROP PROCEDURE IF EXISTS bug21013 | CREATE PROCEDURE bug21013(IN lim INT) BEGIN DECLARE i INT DEFAULT 0; @@ -4959,8 +4628,6 @@ END | SET @a = _latin2"aaaaaaaaaa" | CALL bug21013(10) | DROP PROCEDURE bug21013 | -DROP DATABASE IF EXISTS mysqltest1| -DROP DATABASE IF EXISTS mysqltest2| CREATE DATABASE mysqltest1 DEFAULT CHARACTER SET utf8| CREATE DATABASE mysqltest2 DEFAULT CHARACTER SET utf8| use mysqltest1| @@ -5073,7 +4740,6 @@ koi8r use test| DROP DATABASE mysqltest1| DROP DATABASE mysqltest2| -DROP DATABASE IF EXISTS mysqltest1| CREATE DATABASE mysqltest1 DEFAULT CHARACTER SET utf8| use mysqltest1| CREATE PROCEDURE bug16676_p1( @@ -5112,13 +4778,6 @@ CHARSET(p3) COLLATION(p3) greek greek_general_ci use test| DROP DATABASE mysqltest1| -drop table if exists t3| -drop table if exists t4| -drop procedure if exists bug8153_subselect| -drop procedure if exists bug8153_subselect_a| -drop procedure if exists bug8153_subselect_b| -drop procedure if exists bug8153_proc_a| -drop procedure if exists bug8153_proc_b| create table t3 (a int)| create table t4 (a int)| insert into t3 values (1), (1), (2), (3)| @@ -5232,7 +4891,6 @@ drop procedure bug8153_proc_a| drop procedure bug8153_proc_b| drop table t3| drop table t4| -drop procedure if exists bug19862| CREATE TABLE t11 (a INT)| CREATE TABLE t12 (a INT)| CREATE FUNCTION bug19862(x INT) RETURNS INT @@ -5251,8 +4909,6 @@ a 2 DROP TABLE t11, t12| DROP FUNCTION bug19862| -drop table if exists t3| -drop database if exists mysqltest1| create table t3 (a int)| insert into t3 (a) values (1), (2)| create database mysqltest1| @@ -5266,8 +4922,6 @@ a 1 use test| drop table t3| -DROP PROCEDURE IF EXISTS bug16899_p1| -DROP FUNCTION IF EXISTS bug16899_f1| CREATE DEFINER=longer_than_80_456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789@localhost PROCEDURE bug16899_p1() BEGIN SET @a = 1; @@ -5279,14 +4933,12 @@ BEGIN RETURN 1; END| ERROR HY000: String '1234567890abcdefghij1234567890abcdefghij1234567890abcdefghijQWERTY1...' is too long for host name (should be no longer than 255) -drop procedure if exists bug21416| create procedure bug21416() show create procedure bug21416| call bug21416()| Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation bug21416 CREATE DEFINER=`root`@`localhost` PROCEDURE `bug21416`() show create procedure bug21416 latin1 utf8mb4_uca1400_ai_ci utf8mb4_uca1400_ai_ci drop procedure bug21416| -DROP PROCEDURE IF EXISTS bug21414| CREATE PROCEDURE bug21414() SELECT 1| FLUSH TABLES WITH READ LOCK| DROP PROCEDURE bug21414| @@ -5295,7 +4947,6 @@ UNLOCK TABLES| The following should succeed. DROP PROCEDURE bug21414| set names utf8| -drop database if exists това_е_дълго_име_за_база_данни_нали| create database това_е_дълго_име_за_база_данни_нали| INSERT INTO mysql.proc VALUES ('това_е_дълго_име_за_база_данни_нали','това_е_процедура_с_доста_дълго_име_нали_и_още_по_дълго','PROCEDURE','това_е_процедура_с_доста_дълго_име_нали_и_още_по_дълго','SQL','CONTAINS_SQL','NO','DEFINER','','','bad_body','root@localhost',now(), now(),'','', 'utf8', 'utf8_general_ci', 'utf8_general_ci', 'n/a', 'NONE')| call това_е_дълго_име_за_база_данни_нали.това_е_процедура_с_доста_дълго_име_нали_и_още_по_дълго()| @@ -5340,7 +4991,6 @@ INSERT INTO t4(Member_ID, Action, Action_Date, Track) VALUES ('666666', 'Enrolled', '2006-02-09', 'CAD' ), ('666666', 'Enrolled', '2006-05-12', 'CHF' ), ('666666', 'Disenrolled', '2006-06-01', 'CAD' )| -DROP FUNCTION IF EXISTS bug21493| CREATE FUNCTION bug21493(paramMember VARCHAR(15)) RETURNS varchar(45) BEGIN DECLARE tracks VARCHAR(45); @@ -5366,13 +5016,6 @@ CAD CHF DROP FUNCTION bug21493| DROP TABLE t3,t4| -drop function if exists func_20028_a| -drop function if exists func_20028_b| -drop function if exists func_20028_c| -drop procedure if exists proc_20028_a| -drop procedure if exists proc_20028_b| -drop procedure if exists proc_20028_c| -drop table if exists table_20028| create table table_20028 (i int)| SET @save_sql_mode=@@sql_mode| SET sql_mode=''| @@ -5487,8 +5130,6 @@ drop procedure proc_20028_a| drop procedure proc_20028_b| drop procedure proc_20028_c| drop table table_20028| -drop procedure if exists proc_21462_a| -drop procedure if exists proc_21462_b| create procedure proc_21462_a() begin select "Called A"; @@ -5514,8 +5155,6 @@ Called B Called B drop procedure proc_21462_a| drop procedure proc_21462_b| -drop table if exists t3| -drop procedure if exists proc_bug19733| create table t3 (s1 int)| create procedure proc_bug19733() begin @@ -5531,9 +5170,6 @@ call proc_bug19733()| call proc_bug19733()| drop procedure proc_bug19733| drop table t3| -DROP PROCEDURE IF EXISTS p1| -DROP VIEW IF EXISTS v1, v2| -DROP TABLE IF EXISTS t3, t4| CREATE TABLE t3 (t3_id INT)| INSERT INTO t3 VALUES (0)| INSERT INTO t3 VALUES (1)| @@ -5559,7 +5195,6 @@ DROP VIEW v1, v2| DROP TABLE t3, t4| End of 5.0 tests Begin of 5.1 tests -drop function if exists pi; create function pi() returns varchar(50) return "pie, my favorite desert."; Warnings: @@ -5581,9 +5216,6 @@ test.pi() test.pi () pie, my favorite desert. pie, my favorite desert. SET @@sql_mode=@save_sql_mode; drop function pi; -drop function if exists test.database; -drop function if exists test.current_user; -drop function if exists test.md5; create database nowhere; use nowhere; drop database nowhere; @@ -5665,11 +5297,6 @@ drop function test.current_user; drop function md5; use test; End of 5.1 tests -DROP TABLE IF EXISTS bug23760| -DROP TABLE IF EXISTS bug23760_log| -DROP PROCEDURE IF EXISTS bug23760_update_log| -DROP PROCEDURE IF EXISTS bug23760_test_row_count| -DROP FUNCTION IF EXISTS bug23760_rc_test| CREATE TABLE bug23760 ( id INT NOT NULL AUTO_INCREMENT , num INT NOT NULL , @@ -5747,8 +5374,6 @@ DROP PROCEDURE bug23760_update_log| DROP PROCEDURE bug23760_test_row_count| DROP PROCEDURE bug23760_test_row_count2| DROP FUNCTION bug23760_rc_test| -DROP PROCEDURE IF EXISTS bug24117| -DROP TABLE IF EXISTS t3| CREATE TABLE t3(c1 ENUM('abc'))| INSERT INTO t3 VALUES('abc')| CREATE PROCEDURE bug24117() @@ -5763,8 +5388,6 @@ END| CALL bug24117()| DROP PROCEDURE bug24117| DROP TABLE t3| -drop function if exists func_8407_a| -drop function if exists func_8407_b| create function func_8407_a() returns int begin declare x int; @@ -5797,11 +5420,6 @@ func_8407_b() 1500 drop function func_8407_a| drop function func_8407_b| -drop table if exists table_26503| -drop procedure if exists proc_26503_ok_1| -drop procedure if exists proc_26503_ok_2| -drop procedure if exists proc_26503_ok_3| -drop procedure if exists proc_26503_ok_4| create table table_26503(a int unique)| create procedure proc_26503_ok_1(v int) begin @@ -5962,7 +5580,6 @@ drop procedure proc_26503_ok_1| drop procedure proc_26503_ok_2| drop procedure proc_26503_ok_3| drop procedure proc_26503_ok_4| -DROP FUNCTION IF EXISTS bug25373| CREATE FUNCTION bug25373(p1 INTEGER) RETURNS INTEGER LANGUAGE SQL DETERMINISTIC RETURN p1;| @@ -5975,8 +5592,6 @@ SUM(f2) bug25373(f1) 21.300000071525574 NULL DROP FUNCTION bug25373| DROP TABLE t3| -DROP DATABASE IF EXISTS mysqltest1| -DROP DATABASE IF EXISTS mysqltest2| CREATE DATABASE mysqltest1| CREATE DATABASE mysqltest2| CREATE PROCEDURE mysqltest1.p1() @@ -5990,8 +5605,6 @@ DATABASE() NULL DROP DATABASE mysqltest1| use test| -drop function if exists bug20777| -drop table if exists examplebug20777| create function bug20777(f1 bigint unsigned) returns bigint unsigned begin set f1 = (f1 - 10); set f1 = (f1 + 10); @@ -6071,8 +5684,6 @@ select bug20777(18446744073709551613)+1; bug20777(18446744073709551613)+1 18446744073709551614 drop function bug20777; -DROP FUNCTION IF EXISTS bug5274_f1| -DROP FUNCTION IF EXISTS bug5274_f2| CREATE FUNCTION bug5274_f1(p1 CHAR) RETURNS CHAR RETURN CONCAT(p1, p1)| CREATE FUNCTION bug5274_f2() RETURNS CHAR @@ -6090,7 +5701,6 @@ bug5274_f2() x DROP FUNCTION bug5274_f1| DROP FUNCTION bug5274_f2| -drop procedure if exists proc_21513| create procedure proc_21513()`my_label`:BEGIN END| show create procedure proc_21513| Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation @@ -6192,16 +5802,12 @@ DROP PROCEDURE p2; DROP FUNCTION f1; DROP VIEW v1; DROP TABLE t1; -drop database if exists mysqltest_db1; create database mysqltest_db1; create procedure mysqltest_db1.sp_bug28551() begin end; call mysqltest_db1.sp_bug28551(); show warnings; Level Code Message -Note 1008 Can't drop database 'mysqltest_db1'; database doesn't exist drop database mysqltest_db1; -drop database if exists mysqltest_db1; -drop table if exists test.t1; create database mysqltest_db1; use mysqltest_db1; drop database mysqltest_db1; @@ -6342,7 +5948,6 @@ call proc_25411_c(); drop procedure proc_25411_a; drop procedure proc_25411_b; drop procedure proc_25411_c; -drop procedure if exists proc_26302; create procedure proc_26302() select 1 /* testing */; show create procedure proc_26302; @@ -6413,9 +6018,6 @@ drop function f1; # Bug#13675. -DROP PROCEDURE IF EXISTS p1; -DROP PROCEDURE IF EXISTS p2; -DROP TABLE IF EXISTS t1; CREATE PROCEDURE p1(v DATETIME) CREATE TABLE t1 SELECT v; CREATE PROCEDURE p2(v INT) CREATE TABLE t1 SELECT v; @@ -6471,11 +6073,6 @@ DROP PROCEDURE p2; # - Prepare. # -DROP TABLE IF EXISTS t1; -DROP FUNCTION IF EXISTS f1; -DROP FUNCTION IF EXISTS f2; -DROP FUNCTION IF EXISTS f3; -DROP FUNCTION IF EXISTS f4; # # - Create required objects. @@ -6547,9 +6144,6 @@ DROP FUNCTION f4; # - Prepare. # -DROP TABLE IF EXISTS t1; -DROP TABLE IF EXISTS t2; -DROP FUNCTION IF EXISTS f1; # # - Create required objects. @@ -6607,8 +6201,6 @@ DROP FUNCTION f1; # - Prepare. # -DROP TABLE IF EXISTS t1; -DROP FUNCTION IF EXISTS f1; # # - Create required objects. @@ -6638,10 +6230,6 @@ f1() DROP TABLE t1; DROP FUNCTION f1; -DROP PROCEDURE IF EXISTS db28318_a.t1; -DROP PROCEDURE IF EXISTS db28318_b.t2; -DROP DATABASE IF EXISTS db28318_a; -DROP DATABASE IF EXISTS db28318_b; CREATE DATABASE db28318_a; CREATE DATABASE db28318_b; CREATE PROCEDURE db28318_a.t1() SELECT "db28318_a.t1"; @@ -6654,8 +6242,6 @@ DROP PROCEDURE db28318_b.t2; DROP DATABASE db28318_a; DROP DATABASE db28318_b; use test; -DROP TABLE IF EXISTS t1; -DROP PROCEDURE IF EXISTS bug29770; CREATE TABLE t1(a int); CREATE PROCEDURE bug29770() BEGIN @@ -6670,8 +6256,6 @@ run NULL DROP TABLE t1; DROP PROCEDURE bug29770; use test; -drop table if exists t_33618; -drop procedure if exists proc_33618; create table t_33618 (`a` int, unique(`a`), `b` varchar(30)) engine=myisam; insert into t_33618 (`a`,`b`) values (1,'1'),(2,'2'); create procedure proc_33618(num int) @@ -6708,7 +6292,6 @@ drop procedure proc_33618; # Bug#30787: Stored function ignores user defined alias. # use test; -drop function if exists func30787; create table t1(f1 int); insert into t1 values(1),(2); create function func30787(p1 int) returns int @@ -6755,7 +6338,6 @@ drop procedure p1; drop function f1; drop view v1; drop table t1; -drop procedure if exists `p2` $ create procedure `p2`(in `a` text charset utf8) begin declare `pos` int default 1; @@ -6765,8 +6347,6 @@ select substr(`str`, `pos`+ 1 ) into `str`; end $ call `p2`('s s s s s s'); drop procedure `p2`; -drop table if exists t1; -drop procedure if exists p1; create procedure p1() begin select * from t1; end$ call p1$ ERROR 42S02: Table 'test.t1' doesn't exist @@ -6790,10 +6370,6 @@ drop procedure p1; # - Prepare. # -DROP VIEW IF EXISTS v1; -DROP VIEW IF EXISTS v2; -DROP FUNCTION IF EXISTS f1; -DROP FUNCTION IF EXISTS f2; # # - Create required objects. @@ -6832,7 +6408,6 @@ DROP VIEW v2; # - Bug#24923: prepare. # -DROP FUNCTION IF EXISTS f1; # # - Bug#24923: create required objects. @@ -6879,7 +6454,6 @@ END latin1 latin1_swedish_ci utf8mb4_uca1400_ai_ci DROP FUNCTION f1; -drop procedure if exists p; set @old_mode= @@sql_mode; set @@sql_mode= cast(pow(2,32)-1 as unsigned integer); select @@sql_mode into @full_mode; @@ -6942,9 +6516,6 @@ DROP TABLE t1, t2; # Bug#47627: SET @@{global.session}.local_variable in stored routine causes crash # Bug#48626: Crash or lost connection using SET for declared variables with @@ # -DROP PROCEDURE IF EXISTS p1; -DROP PROCEDURE IF EXISTS p2; -DROP PROCEDURE IF EXISTS p3; CREATE PROCEDURE p1() BEGIN DECLARE v INT DEFAULT 0; @@ -7001,7 +6572,6 @@ DROP PROCEDURE p5; # The string "versiondata" seems # to be 'leaking' into the schema name space # -DROP DATABASE IF EXISTS mixedCaseDbName; CREATE DATABASE mixedCaseDbName; CREATE PROCEDURE mixedCaseDbName.tryMyProc() begin end| CREATE FUNCTION mixedCaseDbName.tryMyFunc() returns text begin return 'IT WORKS'; end @@ -7033,9 +6603,6 @@ DROP TABLE t1, t2; # ------------------------------------------------------------------ # -- End of 5.1 tests # ------------------------------------------------------------------ -DROP FUNCTION IF EXISTS f1; -DROP TABLE IF EXISTS t_non_existing; -DROP TABLE IF EXISTS t1; CREATE FUNCTION f1() RETURNS INT BEGIN DECLARE v INT; @@ -7048,7 +6615,6 @@ SELECT * FROM t1 WHERE a = f1(); ERROR 42S02: Table 'test.t_non_existing' doesn't exist DROP FUNCTION f1; DROP TABLE t1; -DROP PROCEDURE IF EXISTS p1; CREATE PROCEDURE p1(a INT, b CHAR) BEGIN IF a > 0 THEN @@ -7069,7 +6635,6 @@ Warning 1265 Data truncated for column 'b' at row 0 Warning 1265 Data truncated for column 'b' at row 0 SET @@max_sp_recursion_depth= @save_max_sp_recursion; DROP PROCEDURE p1; -DROP PROCEDURE IF EXISTS p1; CREATE PROCEDURE p1(a CHAR) BEGIN SELECT 1; @@ -7087,10 +6652,6 @@ Warnings: Warning 1265 Data truncated for column 'a' at row 0 Note 1292 Truncated incorrect INTEGER value: '10 ' DROP PROCEDURE p1; -DROP PROCEDURE IF EXISTS p1; -DROP PROCEDURE IF EXISTS p2; -DROP PROCEDURE IF EXISTS p3; -DROP PROCEDURE IF EXISTS p4; CREATE PROCEDURE p1() CALL p2()| CREATE PROCEDURE p2() @@ -7116,11 +6677,6 @@ DROP PROCEDURE p1; DROP PROCEDURE p2; DROP PROCEDURE p3; DROP PROCEDURE p4; -DROP FUNCTION IF EXISTS f1; -DROP FUNCTION IF EXISTS f2; -DROP FUNCTION IF EXISTS f3; -DROP FUNCTION IF EXISTS f4; -DROP TABLE IF EXISTS t1; CREATE TABLE t1 (a CHAR(2)); INSERT INTO t1 VALUES ('aa'); CREATE FUNCTION f1() RETURNS CHAR @@ -7147,7 +6703,6 @@ DROP TABLE t1; # Bug#34197: CREATE PROCEDURE fails when COMMENT truncated in non # strict SQL mode # -DROP PROCEDURE IF EXISTS p1; CREATE PROCEDURE p1 () COMMENT '12345678901234567890123456789012345678901234567890123456789012345678901234567890' @@ -7163,9 +6718,6 @@ DROP PROCEDURE p1; # # Bug #47313 assert in check_key_in_view during CALL procedure # -DROP TABLE IF EXISTS t1; -DROP VIEW IF EXISTS t1, t2_unrelated; -DROP PROCEDURE IF EXISTS p1; CREATE PROCEDURE p1(IN x INT) INSERT INTO t1 VALUES (x); CREATE VIEW t1 AS SELECT 10 AS f1; # t1 refers to the view @@ -7221,8 +6773,6 @@ DROP PROCEDURE p1; # # Bug #11918 Can't use a declared variable in LIMIT clause # -drop table if exists t1; -drop procedure if exists p1; create table t1 (c1 int); insert into t1 (c1) values (1), (2), (3), (4), (5); create procedure p1() @@ -7451,10 +7001,6 @@ DROP PROCEDURE proc; # -- Bug 11765684 - 58674: SP-cache does not detect changes in # -- pre-locking list caused by triggers # --- -DROP TABLE IF EXISTS t1; -DROP TABLE IF EXISTS t2; -DROP TABLE IF EXISTS t3; -DROP PROCEDURE IF EXISTS p1; CREATE TABLE t1(a INT); CREATE TABLE t2(a INT); CREATE TABLE t3(a INT); @@ -7481,8 +7027,6 @@ DROP PROCEDURE p1; # -- Bug#12652769 - 61470: case operator in stored routine retains old # -- value of input parameter # --- -DROP TABLE IF EXISTS t1; -DROP PROCEDURE IF EXISTS p1; CREATE TABLE t1 (s1 CHAR(5) CHARACTER SET utf8); INSERT INTO t1 VALUES ('a'); CREATE PROCEDURE p1(dt DATETIME, i INT) @@ -7552,9 +7096,6 @@ DROP PROCEDURE p1; # Bug#12621017 - Crash if a sp variable is used in the # limit clause of a set statement # -DROP TABLE IF EXISTS t1; -DROP PROCEDURE IF EXISTS p1; -DROP PROCEDURE IF EXISTS p2; CREATE TABLE t1 (c1 INT); INSERT INTO t1 VALUES (1); CREATE PROCEDURE p1() @@ -7637,7 +7178,6 @@ DROP PROCEDURE sp; # # Bug#12663165 SP DEAD CODE REMOVAL DOESN'T UNDERSTAND CONTINUE HANDLERS # -DROP FUNCTION IF EXISTS f1; CREATE FUNCTION f1() RETURNS INT BEGIN DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END; @@ -7737,10 +7277,6 @@ drop table t1; # lp:1002157 : testing stored function # bug#62125 result for null incorrectly yields 1292 warning. # -DROP FUNCTION IF EXISTS f1; -DROP FUNCTION IF EXISTS f2; -DROP FUNCTION IF EXISTS f3; -DROP FUNCTION IF EXISTS f4; CREATE FUNCTION f1() RETURNS VARCHAR(1) BEGIN RETURN 'X'; END;/ CREATE FUNCTION f2() RETURNS CHAR(1) @@ -7770,8 +7306,6 @@ Stored procedures and a condition handler in a nested procedure call doesn't suppress the condition from being passed on to the calling procedure -drop procedure if exists p1; -drop procedure if exists p0; create table t1 (id int); create procedure p1 () begin declare i int default 0; @@ -7899,8 +7433,8 @@ from t2 ) X SET S.CLOSE_YN = '' where 1=1; -drop function if exists f1; drop table t1,t2; +drop function f1; # # MDEV-16957: Server crashes in Field_iterator_natural_join::next # upon 2nd execution of SP @@ -8140,9 +7674,6 @@ select id from t union select id from t ; -drop procedure if exists p; -Warnings: -Note 1305 PROCEDURE test.p does not exist create procedure p() insert into tmp_t select t.id from ( select id from v diff --git a/mysql-test/main/sp.test b/mysql-test/main/sp.test index 356b84bffae..98187930040 100644 --- a/mysql-test/main/sp.test +++ b/mysql-test/main/sp.test @@ -35,14 +35,7 @@ use test; # t1 and t2 are reused throughout the file, and dropped at the end. # t3 and up are created and dropped when needed. # ---disable_warnings -drop table if exists t1,t2,t3,t4; -drop view if exists v1; -drop procedure if exists p1; -drop procedure if exists p2; -drop function if exists f1; -drop function if exists f2; ---enable_warnings + create table t1 ( id char(16) not null default '', data int not null @@ -53,11 +46,8 @@ create table t2 ( d double ); - # Single statement, no params. ---disable_warnings -drop procedure if exists foo42; ---enable_warnings + create procedure foo42() insert into test.t1 values ("foo", 42); @@ -66,11 +56,8 @@ select * from t1; delete from t1; drop procedure foo42; - # Single statement, two IN params. ---disable_warnings -drop procedure if exists bar; ---enable_warnings + create procedure bar(x char(16), y int) insert into test.t1 values (x, y); @@ -79,14 +66,10 @@ select * from t1; delete from t1; # Don't drop procedure yet... - # Now for multiple statements... delimiter |; # Empty statement ---disable_warnings -drop procedure if exists empty| ---enable_warnings create procedure empty() begin end| @@ -96,9 +79,6 @@ drop procedure empty| # Scope test. This is legal (warnings might be possible in the future, # but for the time being, we just accept it). ---disable_warnings -drop procedure if exists scope| ---enable_warnings create procedure scope(a int, b float) begin declare b int; @@ -112,9 +92,6 @@ end| drop procedure scope| # Two statements. ---disable_warnings -drop procedure if exists two| ---enable_warnings create procedure two(x1 char(16), x2 char(16), y int) begin insert into test.t1 values (x1, y); @@ -126,11 +103,7 @@ select * from t1| delete from t1| drop procedure two| - # Simple test of local variables and SET. ---disable_warnings -drop procedure if exists locset| ---enable_warnings create procedure locset(x char(16), y int) begin declare z1, z2 int; @@ -144,12 +117,8 @@ select * from t1| delete from t1| drop procedure locset| - # In some contexts local variables are not recognized # (and in some, you have to qualify the identifier). ---disable_warnings -drop procedure if exists setcontext| ---enable_warnings create procedure setcontext() begin declare data int default 2; @@ -164,13 +133,9 @@ select * from t1 order by data| delete from t1| drop procedure setcontext| - # Set things to null create table t3 ( d date, i int, f double, s varchar(32) )| ---disable_warnings -drop procedure if exists nullset| ---enable_warnings create procedure nullset() begin declare ld date; @@ -194,11 +159,7 @@ select * from t3| drop table t3| drop procedure nullset| - # The peculiar (non-standard) mixture of variables types in SET. ---disable_warnings -drop procedure if exists mixset| ---enable_warnings create procedure mixset(x char(16), y int) begin declare z int; @@ -218,9 +179,6 @@ eval SET @@max_join_size= $start_value| --enable_query_log # Multiple CALL statements, one with OUT parameter. ---disable_warnings -drop procedure if exists zip| ---enable_warnings create procedure zip(x char(16), y int) begin declare z int; @@ -229,9 +187,6 @@ begin end| # SET local variables and OUT parameter. ---disable_warnings -drop procedure if exists zap| ---enable_warnings create procedure zap(x int, out y int) begin declare z int; @@ -250,26 +205,13 @@ select @zap| drop procedure zap| - # "Deep" calls... ---disable_warnings -drop procedure if exists c1| ---enable_warnings create procedure c1(x int) call c2("c", x)| ---disable_warnings -drop procedure if exists c2| ---enable_warnings create procedure c2(s char(16), x int) call c3(x, s)| ---disable_warnings -drop procedure if exists c3| ---enable_warnings create procedure c3(x int, s char(16)) call c4("level", x, s)| ---disable_warnings -drop procedure if exists c4| ---enable_warnings create procedure c4(l char(8), x int, s char(16)) insert into t1 values (concat(l,s), x)| @@ -282,27 +224,18 @@ drop procedure c3| drop procedure c4| # INOUT test ---disable_warnings -drop procedure if exists iotest| ---enable_warnings create procedure iotest(x1 char(16), x2 char(16), y int) begin call inc2(x2, y); insert into test.t1 values (x1, y); end| ---disable_warnings -drop procedure if exists inc2| ---enable_warnings create procedure inc2(x char(16), y int) begin call inc(y); insert into test.t1 values (x, y); end| ---disable_warnings -drop procedure if exists inc| ---enable_warnings create procedure inc(inout io int) set io = io + 1| @@ -313,9 +246,6 @@ drop procedure iotest| drop procedure inc2| # Propagating top-level @-vars ---disable_warnings -drop procedure if exists incr| ---enable_warnings create procedure incr(inout x int) call inc(x)| @@ -332,9 +262,6 @@ drop procedure incr| # The expected result is: # ("cbv2", 4) # ("cbv1", 4711) ---disable_warnings -drop procedure if exists cbv1| ---enable_warnings create procedure cbv1() begin declare y int default 3; @@ -343,9 +270,6 @@ begin insert into test.t1 values ("cbv1", y); end| ---disable_warnings -drop procedure if exists cbv2| ---enable_warnings create procedure cbv2(y1 int, inout y2 int) begin set y2 = 4711; @@ -358,20 +282,13 @@ delete from t1| drop procedure cbv1| drop procedure cbv2| - # Subselect arguments insert into t2 values ("a", 1, 1.1), ("b", 2, 1.2), ("c", 3, 1.3)| ---disable_warnings -drop procedure if exists sub1| ---enable_warnings create procedure sub1(id char(16), x int) insert into test.t1 values (id, x)| ---disable_warnings -drop procedure if exists sub2| ---enable_warnings create procedure sub2(id char(16)) begin declare x int; @@ -379,9 +296,6 @@ begin insert into test.t1 values (id, x); end| ---disable_warnings -drop procedure if exists sub3| ---enable_warnings create function sub3(i int) returns int deterministic return i+1| @@ -402,9 +316,6 @@ delete from t2| # Basic tests of the flow control constructs # Just test on 'x'... ---disable_warnings -drop procedure if exists a0| ---enable_warnings create procedure a0(x int) while x do set x = x-1; @@ -416,11 +327,7 @@ select * from t1 order by data desc| delete from t1| drop procedure a0| - # The same, but with a more traditional test. ---disable_warnings -drop procedure if exists a| ---enable_warnings create procedure a(x int) while x > 0 do set x = x-1; @@ -432,11 +339,7 @@ select * from t1 order by data desc| delete from t1| drop procedure a| - # REPEAT ---disable_warnings -drop procedure if exists b| ---enable_warnings create procedure b(x int) repeat insert into test.t1 values (repeat("b",3), x); @@ -448,11 +351,7 @@ select * from t1 order by data desc| delete from t1| drop procedure b| - # Check that repeat isn't parsed the wrong way ---disable_warnings -drop procedure if exists b2| ---enable_warnings create procedure b2(x int) repeat(select 1) into outfile 'b2'; insert into test.t1 values (repeat("b2",3), x); @@ -462,11 +361,7 @@ until x = 0 end repeat| # We don't actually want to call it. drop procedure b2| - # Labelled WHILE with ITERATE (pointless really) ---disable_warnings -drop procedure if exists c| ---enable_warnings create procedure c(x int) hmm: while x > 0 do insert into test.t1 values ("c", x); @@ -480,11 +375,7 @@ select * from t1 order by data desc| delete from t1| drop procedure c| - # Labelled WHILE with LEAVE ---disable_warnings -drop procedure if exists d| ---enable_warnings create procedure d(x int) hmm: while x > 0 do insert into test.t1 values ("d", x); @@ -498,11 +389,7 @@ select * from t1| delete from t1| drop procedure d| - # LOOP, with simple IF statement ---disable_warnings -drop procedure if exists e| ---enable_warnings create procedure e(x int) foo: loop if x = 0 then @@ -517,11 +404,7 @@ select * from t1 order by data desc| delete from t1| drop procedure e| - # A full IF statement ---disable_warnings -drop procedure if exists f| ---enable_warnings create procedure f(x int) if x < 0 then insert into test.t1 values ("f", 0); @@ -538,11 +421,7 @@ select * from t1 order by data| delete from t1| drop procedure f| - # This form of CASE is really just syntactic sugar for IF-ELSEIF-... ---disable_warnings -drop procedure if exists g| ---enable_warnings create procedure g(x int) case when x < 0 then @@ -560,11 +439,7 @@ select * from t1 order by data| delete from t1| drop procedure g| - # The "simple CASE" ---disable_warnings -drop procedure if exists h| ---enable_warnings create procedure h(x int) case x when 0 then @@ -582,11 +457,7 @@ select * from t1 order by data| delete from t1| drop procedure h| - # It's actually possible to LEAVE a BEGIN-END block ---disable_warnings -drop procedure if exists i| ---enable_warnings create procedure i(x int) foo: begin @@ -602,14 +473,10 @@ select * from t1| delete from t1| drop procedure i| - # SELECT with one of more result set sent back to the clinet insert into t1 values ("foo", 3), ("bar", 19)| insert into t2 values ("x", 9, 4.1), ("y", -1, 19.2), ("z", 3, 2.2)| ---disable_warnings -drop procedure if exists sel1| ---enable_warnings create procedure sel1() begin select * from t1 order by data; @@ -618,9 +485,6 @@ end| call sel1()| drop procedure sel1| ---disable_warnings -drop procedure if exists sel2| ---enable_warnings create procedure sel2() begin select * from t1 order by data; @@ -633,9 +497,6 @@ delete from t1| delete from t2| # SELECT INTO local variables ---disable_warnings -drop procedure if exists into_test| ---enable_warnings create procedure into_test(x char(16), y int) begin insert into test.t1 values (x, y); @@ -648,11 +509,7 @@ select * from t1 order by data| delete from t1| drop procedure into_test| - # SELECT INTO with a mix of local and global variables ---disable_warnings -drop procedure if exists into_tes2| ---enable_warnings create procedure into_test2(x char(16), y int) begin insert into test.t1 values (x, y); @@ -665,11 +522,7 @@ select id,data,@z from t1 order by data| delete from t1| drop procedure into_test2| - # SELECT * INTO ... (bug test) ---disable_warnings -drop procedure if exists into_test3| ---enable_warnings create procedure into_test3() begin declare x char(16); @@ -688,12 +541,8 @@ delete from t1| delete from t2| drop procedure into_test3| - # SELECT INTO with no data is a warning ("no data", which we will # not see normally). When not caught, execution proceeds. ---disable_warnings -drop procedure if exists into_test4| ---enable_warnings create procedure into_test4() begin declare x int; @@ -713,12 +562,8 @@ delete from t1| drop table t3| drop procedure into_test4| - # These two (and the two procedures above) caused an assert() to fail in # sql_base.cc:lock_tables() at some point. ---disable_warnings -drop procedure if exists into_outfile| ---enable_warnings --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR eval create procedure into_outfile(x char(16), y int) begin @@ -727,19 +572,13 @@ begin insert into test.t1 values (concat(x, "2"), y+2); end| ---disable_ps2_protocol -# Check that file does not exists --error 1 --file_exists $MYSQLTEST_VARDIR/tmp/spout call into_outfile("ofile", 1)| --remove_file $MYSQLTEST_VARDIR/tmp/spout delete from t1| drop procedure into_outfile| ---enable_ps2_protocol ---disable_warnings -drop procedure if exists into_dumpfile| ---enable_warnings --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR eval create procedure into_dumpfile(x char(16), y int) begin @@ -756,9 +595,6 @@ call into_dumpfile("dfile", 1)| delete from t1| drop procedure into_dumpfile| ---disable_warnings -drop procedure if exists create_select| ---enable_warnings create procedure create_select(x char(16), y int) begin insert into test.t1 values (x, y); @@ -772,11 +608,7 @@ drop table t3| delete from t1| drop procedure create_select| - # A minimal, constant FUNCTION. ---disable_warnings -drop function if exists e| ---enable_warnings create function e() returns double return 2.7182818284590452354| @@ -784,36 +616,24 @@ set @e = e()| select e(), @e| # A minimal function with one argument ---disable_warnings -drop function if exists inc| ---enable_warnings create function inc(i int) returns int return i+1| select inc(1), inc(99), inc(-71)| # A minimal function with two arguments ---disable_warnings -drop function if exists mul| ---enable_warnings create function mul(x int, y int) returns int return x*y| select mul(1,1), mul(3,5), mul(4711, 666)| # A minimal string function ---disable_warnings -drop function if exists append| ---enable_warnings create function append(s1 char(8), s2 char(8)) returns char(16) return concat(s1, s2)| select append("foo", "bar")| # A function with flow control ---disable_warnings -drop function if exists fac| ---enable_warnings create function fac(n int unsigned) returns bigint unsigned begin declare f bigint unsigned default 1; @@ -828,15 +648,11 @@ end| select fac(1), fac(2), fac(5), fac(10)| # Nested calls ---disable_warnings -drop function if exists fun| ---enable_warnings create function fun(d double, i int, u int unsigned) returns double return mul(inc(i), fac(u)) / e()| select fun(2.3, 3, 5)| - # Various function calls in differen statements insert into t2 values (append("xxx", "yyy"), mul(4,3), e())| @@ -857,14 +673,10 @@ drop function mul| drop function append| drop function fun| - # # CONDITIONs and HANDLERs # ---disable_warnings -drop procedure if exists hndlr1| ---enable_warnings create procedure hndlr1(val int) begin declare x int default 0; @@ -884,9 +696,6 @@ select * from t1| delete from t1| drop procedure hndlr1| ---disable_warnings -drop procedure if exists hndlr2| ---enable_warnings create procedure hndlr2(val int) begin declare x int default 0; @@ -905,10 +714,6 @@ select * from t1| delete from t1| drop procedure hndlr2| - ---disable_warnings -drop procedure if exists hndlr3| ---enable_warnings create procedure hndlr3(val int) begin declare x int default 0; @@ -938,15 +743,11 @@ select * from t1| delete from t1| drop procedure hndlr3| - # Variables might be uninitialized when using handlers # (Otherwise the compiler can detect if a variable is not set, but # not in this case.) create table t3 ( id char(16), data int )| ---disable_warnings -drop procedure if exists hndlr4| ---enable_warnings create procedure hndlr4() begin declare x int default 0; @@ -963,13 +764,9 @@ select * from t3| drop table t3| drop procedure hndlr4| - # # Cursors # ---disable_warnings -drop procedure if exists cur1| ---enable_warnings create procedure cur1() begin declare a char(16); @@ -996,9 +793,6 @@ drop procedure cur1| create table t3 ( s char(16), i int )| ---disable_warnings -drop procedure if exists cur2| ---enable_warnings create procedure cur2() begin declare done int default 0; @@ -1035,11 +829,7 @@ delete from t2| drop table t3| drop procedure cur2| - # The few characteristics we parse ---disable_warnings -drop procedure if exists chistics| ---enable_warnings create procedure chistics() language sql modifies sql data @@ -1057,9 +847,6 @@ alter procedure chistics sql security invoker| show create procedure chistics| drop procedure chistics| ---disable_warnings -drop function if exists chistics| ---enable_warnings create function chistics() returns int language sql deterministic @@ -1076,15 +863,11 @@ alter function chistics show create function chistics| drop function chistics| - # Check mode settings insert into t1 values ("foo", 1), ("bar", 2), ("zip", 3)| set @@sql_mode = 'ANSI'| delimiter $| ---disable_warnings -drop procedure if exists modes$ ---enable_warnings create procedure modes(out c1 int, out c2 int) begin declare done int default 0; @@ -1114,7 +897,6 @@ select @c1, @c2| delete from t1| drop procedure modes| - # Check that dropping a database without routines works. # (Dropping with routines is tested in sp-security.test) # First an empty db. @@ -1133,9 +915,6 @@ drop database sp_db2| # And yet again, with just a procedure. create database sp_db3| use sp_db3| ---disable_warnings -drop procedure if exists dummy| ---enable_warnings create procedure dummy(out x int) set x = 42| use test| @@ -1143,12 +922,8 @@ drop database sp_db3| # Check that it's gone select type,db,name from mysql.proc where db = 'sp_db3'| - # ROW_COUNT() function after a CALL # We test the other cases here too, although it's not strictly SP specific ---disable_warnings -drop procedure if exists rc| ---enable_warnings create procedure rc() begin delete from t1; @@ -1176,25 +951,6 @@ drop procedure rc| # # Let us prepare playground ---disable_warnings -drop function if exists f0| -drop function if exists f1| -drop function if exists f2| -drop function if exists f3| -drop function if exists f4| -drop function if exists f5| -drop function if exists f6| -drop function if exists f7| -drop function if exists f8| -drop function if exists f9| -drop function if exists f10| -drop function if exists f11| -drop function if exists f12_1| -drop function if exists f12_2| -drop view if exists v0| -drop view if exists v1| -drop view if exists v2| ---enable_warnings delete from t1| delete from t2| insert into t1 values ("a", 1), ("b", 2) | @@ -1419,6 +1175,7 @@ drop temporary table t3| select f12_1()| drop temporary table t3| select f12_1() from t1 limit 1| +drop temporary table t3| # Cleanup drop function f0| @@ -1444,21 +1201,14 @@ drop table t4| # End of non-bug tests - # # Some "real" examples # # fac ---disable_warnings -drop table if exists t3| ---enable_warnings create table t3 (n int unsigned not null primary key, f bigint unsigned)| ---disable_warnings -drop procedure if exists ifac| ---enable_warnings create procedure ifac(n int unsigned) begin declare i int unsigned default 1; @@ -1484,13 +1234,8 @@ drop function fac| --replace_column 4 'root@localhost' 5 '0000-00-00 00:00:00' 6 '0000-00-00 00:00:00' show function status where name like '%f%' and Db <> 'sys'| - # primes ---disable_warnings -drop table if exists t3| ---enable_warnings - create table t3 ( i int unsigned not null primary key, p bigint unsigned not null @@ -1507,9 +1252,6 @@ insert into t3 values (35, 157), (36, 163), (37, 167), (38, 173), (39, 179), (40, 181), (41, 191), (42, 193), (43, 197), (44, 199)| ---disable_warnings -drop procedure if exists opp| ---enable_warnings create procedure opp(n bigint unsigned, out pp bool) begin declare r double; @@ -1540,9 +1282,6 @@ begin end loop; end| ---disable_warnings -drop procedure if exists ip| ---enable_warnings create procedure ip(m int unsigned) begin declare p bigint unsigned; @@ -1585,14 +1324,10 @@ drop procedure ip| --replace_column 4 'root@localhost' 5 '0000-00-00 00:00:00' 6 '0000-00-00 00:00:00' show procedure status where name like '%p%' and db='test'| - # # Comment & suid # ---disable_warnings -drop procedure if exists bar| ---enable_warnings create procedure bar(x char(16), y int) comment "111111111111" sql security invoker insert into test.t1 values (x, y)| @@ -1609,9 +1344,6 @@ drop procedure bar| # # rexecution # ---disable_warnings -drop procedure if exists p1| ---enable_warnings create procedure p1 () select (select s1 from t3) from t3| @@ -1626,9 +1358,6 @@ drop table t3| # # backticks # ---disable_warnings -drop function if exists foo| ---enable_warnings create function `foo` () returns int return 5| select `foo` ()| @@ -1638,9 +1367,6 @@ drop function `foo`| # Implicit LOCK/UNLOCK TABLES for table access in functions # ---disable_warnings -drop function if exists t1max| ---enable_warnings create function t1max() returns int begin declare x int; @@ -1682,7 +1408,6 @@ select * from t3| drop table t3| drop function getcount| - # Test cases for different combinations of condition handlers in nested # begin-end blocks in stored procedures. # @@ -1712,29 +1437,6 @@ drop function getcount| # no tests for those combinations.) # ---disable_warnings -drop table if exists t3| -drop procedure if exists h_ee| -drop procedure if exists h_es| -drop procedure if exists h_en| -drop procedure if exists h_ew| -drop procedure if exists h_ex| -drop procedure if exists h_se| -drop procedure if exists h_ss| -drop procedure if exists h_sn| -drop procedure if exists h_sw| -drop procedure if exists h_sx| -drop procedure if exists h_ne| -drop procedure if exists h_ns| -drop procedure if exists h_nn| -drop procedure if exists h_we| -drop procedure if exists h_ws| -drop procedure if exists h_ww| -drop procedure if exists h_xe| -drop procedure if exists h_xs| -drop procedure if exists h_xx| ---enable_warnings - # smallint - to get out of range warnings # primary key - to get constraint errors create table t3 (a smallint primary key)| @@ -2073,7 +1775,6 @@ drop procedure h_xe| drop procedure h_xs| drop procedure h_xx| - # # Test cases for old bugs # @@ -2081,9 +1782,6 @@ drop procedure h_xx| # # BUG#822 # ---disable_warnings -drop procedure if exists bug822| ---enable_warnings create procedure bug822(a_id char(16), a_data int) begin declare n int; @@ -2104,9 +1802,6 @@ drop procedure bug822| # # BUG#1495 # ---disable_warnings -drop procedure if exists bug1495| ---enable_warnings create procedure bug1495() begin declare x int; @@ -2132,9 +1827,6 @@ drop procedure bug1495| # # BUG#1547 # ---disable_warnings -drop procedure if exists bug1547| ---enable_warnings create procedure bug1547(s char(16)) begin declare x int; @@ -2157,15 +1849,9 @@ drop procedure bug1547| # # BUG#1656 # ---disable_warnings -drop table if exists t70| ---enable_warnings create table t70 (s1 int,s2 int)| insert into t70 values (1,2)| ---disable_warnings -drop procedure if exists bug1656| ---enable_warnings create procedure bug1656(out p1 int, out p2 int) select * into p1, p1 from t70| @@ -2179,9 +1865,6 @@ drop procedure bug1656| # create table t3(a int)| ---disable_warnings -drop procedure if exists bug1862| ---enable_warnings create procedure bug1862() begin insert into t3 values(2); @@ -2198,9 +1881,6 @@ drop procedure bug1862| # # BUG#1874 # ---disable_warnings -drop procedure if exists bug1874| ---enable_warnings create procedure bug1874() begin declare x int; @@ -2225,9 +1905,6 @@ drop procedure bug1874| # # BUG#2260 # ---disable_warnings -drop procedure if exists bug2260| ---enable_warnings create procedure bug2260() begin declare v1 int; @@ -2247,34 +1924,21 @@ drop procedure bug2260| # # BUG#2267 "Lost connect if stored procedure has SHOW FUNCTION STATUS" # ---disable_warnings -drop procedure if exists bug2267_1| ---enable_warnings create procedure bug2267_1() begin show procedure status where db='test'; end| ---disable_warnings -drop procedure if exists bug2267_2| ---enable_warnings create procedure bug2267_2() begin show function status where db='test'; end| ---disable_warnings -drop procedure if exists bug2267_3| ---enable_warnings create procedure bug2267_3() begin show create procedure bug2267_1; end| ---disable_warnings -drop procedure if exists bug2267_4| -drop function if exists bug2267_4| ---enable_warnings create procedure bug2267_4() begin show create function bug2267_4; @@ -2297,9 +1961,6 @@ drop function bug2267_4| # # BUG#2227 # ---disable_warnings -drop procedure if exists bug2227| ---enable_warnings create procedure bug2227(x int) begin declare y float default 2.6; @@ -2315,9 +1976,6 @@ drop procedure bug2227| # BUG#2614 "Stored procedure with INSERT ... SELECT that does not # contain any tables crashes server" # ---disable_warnings -drop procedure if exists bug2614| ---enable_warnings create procedure bug2614() begin drop table if exists t3; @@ -2336,9 +1994,6 @@ drop procedure bug2614| # # BUG#2674 # ---disable_warnings -drop function if exists bug2674| ---enable_warnings create function bug2674() returns int return @@sort_buffer_size| @@ -2351,17 +2006,8 @@ set @@sort_buffer_size = @osbs| # # BUG#3259 # ---disable_warnings -drop procedure if exists bug3259_1 | ---enable_warnings create procedure bug3259_1 () begin end| ---disable_warnings -drop procedure if exists BUG3259_2 | ---enable_warnings create procedure BUG3259_2 () begin end| ---disable_warnings -drop procedure if exists Bug3259_3 | ---enable_warnings create procedure Bug3259_3 () begin end| call BUG3259_1()| @@ -2378,9 +2024,6 @@ drop procedure BUG3259_3| # # BUG#2772 # ---disable_warnings -drop function if exists bug2772| ---enable_warnings create function bug2772() returns char(10) character set latin2 return 'a'| @@ -2390,9 +2033,6 @@ drop function bug2772| # # BUG#2776 # ---disable_warnings -drop procedure if exists bug2776_1| ---enable_warnings create procedure bug2776_1(out x int) begin declare v int; @@ -2401,9 +2041,6 @@ begin set x = v; end| ---disable_warnings -drop procedure if exists bug2776_2| ---enable_warnings create procedure bug2776_2(out x int) begin declare v int default 42; @@ -2427,9 +2064,6 @@ create table t3 (s1 smallint)| insert into t3 values (123456789012)| ---disable_warnings -drop procedure if exists bug2780| ---enable_warnings create procedure bug2780() begin declare exit handler for sqlwarning set @x = 1; @@ -2454,9 +2088,6 @@ insert into t3 values ("test1")| insert into t3 values ("test2")| create table t4 (f1 int, rc int, t3 int)| ---disable_warnings -drop procedure if exists bug1863| ---enable_warnings create procedure bug1863(in1 int) begin @@ -2515,9 +2146,6 @@ insert t3 (OrderID,MarketID) values (2,2)| insert t4 (MarketID,Market,Status) values (1,"MarketID One","A")| insert t4 (MarketID,Market,Status) values (2,"MarketID Two","A")| ---disable_warnings -drop procedure if exists bug2656_1| ---enable_warnings create procedure bug2656_1() begin select @@ -2526,9 +2154,6 @@ begin ON o.MarketID != 1 and o.MarketID = m.MarketID; end | ---disable_warnings -drop procedure if exists bug2656_2| ---enable_warnings create procedure bug2656_2() begin select @@ -2548,13 +2173,9 @@ drop procedure bug2656_1| drop procedure bug2656_2| drop table t3, t4| - # # BUG#3426 # ---disable_warnings -drop procedure if exists bug3426| ---enable_warnings create procedure bug3426(in_time int unsigned, out x int) begin if in_time is null then @@ -2600,9 +2221,6 @@ insert into t3 (title,body) values ('MySQL vs. YourSQL','In the following database comparison ...'), ('MySQL Security','When configured properly, MySQL ...')| ---disable_warnings -drop procedure if exists bug3734 | ---enable_warnings create procedure bug3734 (param1 varchar(100)) select * from t3 where match (title,body) against (param1)| @@ -2615,9 +2233,6 @@ drop table t3| # # BUG#3863 # ---disable_warnings -drop procedure if exists bug3863| ---enable_warnings create procedure bug3863() begin set @a = 0; @@ -2645,9 +2260,6 @@ create table t3 ( unique key rid (rid, id) )| ---disable_warnings -drop procedure if exists bug2460_1| ---enable_warnings create procedure bug2460_1(in v int) begin ( select n0.id from t3 as n0 where n0.id = v ) @@ -2665,9 +2277,6 @@ insert into t3 values (1, 1, 'foo'), (2, 1, 'bar'), (3, 1, 'zip zap')| call bug2460_1(2)| call bug2460_1(2)| ---disable_warnings -drop procedure if exists bug2460_2| ---enable_warnings create procedure bug2460_2() begin drop table if exists t3; @@ -2683,37 +2292,24 @@ drop procedure bug2460_1| drop procedure bug2460_2| drop table t3| - # # BUG#2564 # set @@sql_mode = ''| ---disable_warnings -drop procedure if exists bug2564_1| ---enable_warnings create procedure bug2564_1() comment 'Joe''s procedure' insert into `t1` values ("foo", 1)| set @@sql_mode = 'ANSI_QUOTES'| ---disable_warnings -drop procedure if exists bug2564_2| ---enable_warnings create procedure bug2564_2() insert into "t1" values ('foo', 1)| delimiter $| set @@sql_mode = ''$ ---disable_warnings -drop function if exists bug2564_3$ ---enable_warnings create function bug2564_3(x int, y int) returns int return x || y$ set @@sql_mode = 'ANSI'$ ---disable_warnings -drop function if exists bug2564_4$ ---enable_warnings create function bug2564_4(x int, y int) returns int return x || y$ delimiter |$ @@ -2732,9 +2328,6 @@ drop function bug2564_4| # # BUG#3132 # ---disable_warnings -drop function if exists bug3132| ---enable_warnings create function bug3132(s char(20)) returns char(50) return concat('Hello, ', s, '!')| @@ -2744,9 +2337,6 @@ drop function bug3132| # # BUG#3843 # ---disable_warnings -drop procedure if exists bug3843| ---enable_warnings create procedure bug3843() analyze table t1| @@ -2763,9 +2353,6 @@ drop procedure bug3843| create table t3 ( s1 char(10) )| insert into t3 values ('a'), ('b')| ---disable_warnings -drop procedure if exists bug3368| ---enable_warnings create procedure bug3368(v char(10)) begin select group_concat(v) from t3; @@ -2782,9 +2369,6 @@ drop table t3| create table t3 (f1 int, f2 int)| insert into t3 values (1,1)| ---disable_warnings -drop procedure if exists bug4579_1| ---enable_warnings create procedure bug4579_1 () begin declare sf1 int; @@ -2794,9 +2378,6 @@ begin call bug4579_2(); end| ---disable_warnings -drop procedure if exists bug4579_2| ---enable_warnings create procedure bug4579_2 () begin end| @@ -2812,9 +2393,6 @@ drop table t3| # # BUG#2773: Function's data type ignored in stored procedures # ---disable_warnings -drop procedure if exists bug2773| ---enable_warnings create function bug2773() returns int return null| create table t3 as select bug2773()| @@ -2825,9 +2403,6 @@ drop function bug2773| # # BUG#3788: Stored procedure packet error # ---disable_warnings -drop procedure if exists bug3788| ---enable_warnings create function bug3788() returns date return cast("2005-03-04" as date)| select bug3788()| @@ -2844,9 +2419,6 @@ drop function bug3788| create table t3 (f1 int, f2 int, f3 int)| insert into t3 values (1,1,1)| ---disable_warnings -drop procedure if exists bug4726| ---enable_warnings create procedure bug4726() begin declare tmp_o_id INT; @@ -2875,9 +2447,6 @@ drop table t3| create table t3 (s1 int)| insert into t3 values (3), (4)| ---disable_warnings -drop procedure if exists bug4318| ---enable_warnings create procedure bug4318() handler t3 read next| @@ -2902,9 +2471,6 @@ drop table t3| # It's possible that some of these are not deterministic across # platforms. If so, just remove the offending command. # ---disable_warnings -drop procedure if exists bug4902| ---enable_warnings create procedure bug4902() begin show charset like 'foo'; @@ -2940,9 +2506,6 @@ drop procedure bug4902| # # BUG#4904 # ---disable_warnings -drop procedure if exists bug4904| ---enable_warnings create procedure bug4904() begin declare continue handler for sqlstate 'HY000' begin end; @@ -2957,9 +2520,6 @@ drop procedure bug4904| create table t3 (s1 char character set latin1, s2 char character set latin2)| ---disable_warnings -drop procedure if exists bug4904| ---enable_warnings create procedure bug4904 () begin declare continue handler for sqlstate 'HY000' begin end; @@ -2975,9 +2535,6 @@ drop table t3| # # BUG#336 # ---disable_warnings -drop procedure if exists bug336| ---enable_warnings create procedure bug336(out y int) begin declare x int; @@ -2994,9 +2551,6 @@ drop procedure bug336| # # BUG#3157 # ---disable_warnings -drop procedure if exists bug3157| ---enable_warnings create procedure bug3157() begin if exists(select * from t1) then @@ -3017,9 +2571,6 @@ drop procedure bug3157| # # BUG#5251: mysql changes creation time of a procedure/function when altering # ---disable_warnings -drop procedure if exists bug5251| ---enable_warnings create procedure bug5251() begin end| @@ -3038,9 +2589,6 @@ drop procedure bug5251| # # BUG#5279: Stored procedure packets out of order if CHECKSUM TABLE # ---disable_warnings -drop procedure if exists bug5251| ---enable_warnings create procedure bug5251() checksum table t1| @@ -3051,9 +2599,6 @@ drop procedure bug5251| # # BUG#5287: Stored procedure crash if leave outside loop # ---disable_warnings -drop procedure if exists bug5287| ---enable_warnings create procedure bug5287(param1 int) label1: begin @@ -3068,13 +2613,9 @@ end| call bug5287(1)| drop procedure bug5287| - # # BUG#5307: Stored procedure allows statement after BEGIN ... END # ---disable_warnings -drop procedure if exists bug5307| ---enable_warnings create procedure bug5307() begin end; set @x = 3| @@ -3086,16 +2627,10 @@ drop procedure bug5307| # # BUG#5258: Stored procedure modified date is 0000-00-00 # (This was a design flaw) ---disable_warnings -drop procedure if exists bug5258| ---enable_warnings create procedure bug5258() begin end| ---disable_warnings -drop procedure if exists bug5258_aux| ---enable_warnings create procedure bug5258_aux() begin declare c, m char(19); @@ -3116,9 +2651,6 @@ drop procedure bug5258_aux| # # BUG#4487: Stored procedure connection aborted if uninitialized char # ---disable_warnings -drop function if exists bug4487| ---enable_warnings create function bug4487() returns char begin declare v char; @@ -3128,16 +2660,9 @@ end| select bug4487()| drop function bug4487| - # # BUG#4941: Stored procedure crash fetching null value into variable. # ---disable_warnings -drop procedure if exists bug4941| ---enable_warnings ---disable_warnings -drop procedure if exists bug4941| ---enable_warnings create procedure bug4941(out x int) begin declare c cursor for select i from t2 limit 1; @@ -3156,15 +2681,9 @@ drop procedure bug4941| # # BUG#4905: Stored procedure doesn't clear for "Rows affected" # ---disable_warnings -drop procedure if exists bug4905| ---enable_warnings create table t3 (s1 int,primary key (s1))| ---disable_warnings -drop procedure if exists bug4905| ---enable_warnings create procedure bug4905() begin declare v int; @@ -3191,13 +2710,7 @@ drop table t3| # --disable_parsing # until we implement support for recursive stored functions. ---disable_warnings -drop function if exists bug6022| ---enable_warnings ---disable_warnings -drop function if exists bug6022| ---enable_warnings create function bug6022(x int) returns int begin if x < 0 then @@ -3214,13 +2727,7 @@ drop function bug6022| # # BUG#6029: Stored procedure specific handlers should have priority # ---disable_warnings -drop procedure if exists bug6029| ---enable_warnings ---disable_warnings -drop procedure if exists bug6029| ---enable_warnings create procedure bug6029() begin declare exit handler for 1136 select '1136'; @@ -3243,9 +2750,6 @@ drop table t3| # # BUG#8540: Local variable overrides an alias # ---disable_warnings -drop procedure if exists bug8540| ---enable_warnings create procedure bug8540() begin @@ -3261,10 +2765,6 @@ drop procedure bug8540| # create table t3 (s1 int)| ---disable_warnings -drop procedure if exists bug6642| ---enable_warnings - create procedure bug6642() select abs(count(s1)) from t3| @@ -3276,9 +2776,6 @@ drop procedure bug6642| # BUG#7013: Stored procedure crash if group by ... with rollup # insert into t3 values (0),(1)| ---disable_warnings -drop procedure if exists bug7013| ---enable_warnings create procedure bug7013() select s1,count(s1) from t3 group by s1 with rollup| call bug7013()| @@ -3288,9 +2785,6 @@ drop procedure bug7013| # # BUG#7743: 'Lost connection to server during query' on Stored Procedure # ---disable_warnings -drop table if exists t4| ---enable_warnings create table t4 ( a mediumint(8) unsigned not null auto_increment, b smallint(5) unsigned not null, @@ -3300,9 +2794,6 @@ create table t4 ( insert into t4 values (1, 2, 'oneword')| insert into t4 values (2, 2, 'anotherword')| ---disable_warnings -drop procedure if exists bug7743| ---enable_warnings create procedure bug7743 ( searchstring char(28) ) begin declare var mediumint(8) unsigned; @@ -3323,8 +2814,6 @@ drop table t4| # delete from t3| insert into t3 values(1)| -drop procedure if exists bug7992_1| -drop procedure if exists bug7992_2| create procedure bug7992_1() begin declare i int; @@ -3348,9 +2837,6 @@ drop table t3| # create table t3 ( userid bigint(20) not null default 0 )| ---disable_warnings -drop procedure if exists bug8116| ---enable_warnings create procedure bug8116(in _userid int) select * from t3 where userid = _userid| @@ -3362,9 +2848,6 @@ drop table t3| # # BUG#6857: current_time() in STORED PROCEDURES # ---disable_warnings -drop procedure if exists bug6857| ---enable_warnings create procedure bug6857() begin declare t0, t1 bigint; @@ -3385,9 +2868,6 @@ drop procedure bug6857| # # BUG#8757: Stored Procedures: Scope of Begin and End Statements do not # work properly. ---disable_warnings -drop procedure if exists bug8757| ---enable_warnings create procedure bug8757() begin declare x int; @@ -3419,26 +2899,18 @@ delete from t1| delete from t2| drop procedure bug8757| - # # BUG#8762: Stored Procedures: Inconsistent behavior # of DROP PROCEDURE IF EXISTS statement. ---disable_warnings -drop procedure if exists bug8762| ---enable_warnings # Doesn't exist drop procedure if exists bug8762; create procedure bug8762() begin end| # Does exist drop procedure if exists bug8762; create procedure bug8762() begin end| drop procedure bug8762| - # # BUG#5240: Stored procedure crash if function has cursor declaration # ---disable_warnings -drop function if exists bug5240| ---enable_warnings create function bug5240 () returns int begin declare x int; @@ -3458,9 +2930,6 @@ drop function bug5240| # # BUG#7992: rolling back temporary Item tree changes in SP # ---disable_warnings -drop procedure if exists p1| ---enable_warnings create table t3(id int)| insert into t3 values(1)| create procedure bug7992() @@ -3501,9 +2970,6 @@ create table t5 ( primary key (lbsiid,ltradingareaid) )| ---disable_warnings -drop procedure if exists bug8849| ---enable_warnings create procedure bug8849() begin insert into t5 @@ -3531,9 +2997,6 @@ drop tables t3,t4,t5| # # BUG#8937: Stored Procedure: AVG() works as SUM() in SELECT ... INTO statement # ---disable_warnings -drop procedure if exists bug8937| ---enable_warnings create procedure bug8937() begin declare s,x,y,z int; @@ -3552,18 +3015,11 @@ call bug8937()| drop procedure bug8937| delete from t1| - # # BUG#6900: Stored procedure inner handler ignored # BUG#9074: STORED PROC: The scope of every handler declared is not # properly applied # ---disable_warnings -drop procedure if exists bug6900| -drop procedure if exists bug9074| -drop procedure if exists bug6900_9074| ---enable_warnings - create table t3 (w char unique, x char)| insert into t3 values ('a', 'b')| @@ -3634,13 +3090,9 @@ drop procedure bug9074| drop procedure bug6900_9074| drop table t3| - # # BUG#7185: Stored procedure crash if identifier is AVG # ---disable_warnings -drop procedure if exists avg| ---enable_warnings create procedure avg () begin end| @@ -3648,13 +3100,9 @@ end| call avg ()| drop procedure avg| - # # BUG#6129: Stored procedure won't display @@sql_mode value # ---disable_warnings -drop procedure if exists bug6129| ---enable_warnings set @old_mode= @@sql_mode; set @@sql_mode= "ERROR_FOR_DIVISION_BY_ZERO"; create procedure bug6129() @@ -3668,13 +3116,9 @@ set @@sql_mode=@old_mode; drop procedure bug6129| - # # BUG#9856: Stored procedures: crash if handler for sqlexception, not found # ---disable_warnings -drop procedure if exists bug9856| ---enable_warnings create procedure bug9856() begin declare v int; @@ -3691,15 +3135,10 @@ call bug9856()| call bug9856()| drop procedure bug9856| - # # BUG##9674: Stored Procs: Using declared vars in algebric operation causes # system crash. # ---disable_warnings -drop procedure if exists bug9674_1| -drop procedure if exists bug9674_2| ---enable_warnings create procedure bug9674_1(out arg int) begin declare temp_in1 int default 0; @@ -3725,14 +3164,9 @@ call bug9674_2()| drop procedure bug9674_1| drop procedure bug9674_2| - # # BUG#9598: stored procedure call within stored procedure overwrites IN variable # ---disable_warnings -drop procedure if exists bug9598_1| -drop procedure if exists bug9598_2| ---enable_warnings create procedure bug9598_1(in var_1 char(16), out var_2 integer, out var_3 integer) begin @@ -3757,13 +3191,9 @@ select @tmp1, @tmp2| drop procedure bug9598_1| drop procedure bug9598_2| - # # BUG#9902: Crash with simple stored function using user defined variables # ---disable_warnings -drop procedure if exists bug9902| ---enable_warnings create function bug9902() returns int(11) begin set @x = @x + 1; @@ -3794,35 +3224,23 @@ if (`select @@have_query_cache='YES'`) { delete from t1| drop function bug9902| - # # BUG#9102: Stored proccedures: function which returns blob causes crash # ---disable_warnings -drop function if exists bug9102| ---enable_warnings create function bug9102() returns blob return 'a'| select bug9102()| drop function bug9102| - # # BUG#7648: Stored procedure crash when invoking a function that returns a bit # ---disable_warnings -drop function if exists bug7648| ---enable_warnings create function bug7648() returns bit(8) return 'a'| select bug7648()| drop function bug7648| - # # BUG#9775: crash if create function that returns enum or set # ---disable_warnings -drop function if exists bug9775| ---enable_warnings create function bug9775(v1 char(1)) returns enum('a','b') return v1| select bug9775('a'),bug9775('b'),bug9775('c')| drop function bug9775| @@ -3837,27 +3255,18 @@ create function bug9775(v1 int) returns set('a','b') return v1| select bug9775(1),bug9775(2),bug9775(3),bug9775(4)| drop function bug9775| - # # BUG#8861: If Return is a YEAR data type, value is not shown in year format # ---disable_warnings -drop function if exists bug8861| ---enable_warnings create function bug8861(v1 int) returns year return v1| select bug8861(05)| set @x = bug8861(05)| select @x| drop function bug8861| - # # BUG#9004: Inconsistent behaviour of SP re. warnings # ---disable_warnings -drop procedure if exists bug9004_1| -drop procedure if exists bug9004_2| ---enable_warnings create procedure bug9004_1(x char(16)) begin insert into t1 values (x, 42); @@ -3877,9 +3286,6 @@ drop procedure bug9004_2| # # BUG#7293: Stored procedure crash with soundex # ---disable_warnings -drop procedure if exists bug7293| ---enable_warnings insert into t1 values ('secret', 0)| create procedure bug7293(p1 varchar(100)) begin @@ -3892,15 +3298,10 @@ call bug7293 ('secrete')| drop procedure bug7293| delete from t1| - # # BUG#9841: Unexpected read lock when trying to update a view in a # stored procedure # ---disable_warnings -drop procedure if exists bug9841| -drop view if exists v1| ---enable_warnings create view v1 as select * from t1, t2 where id = s| create procedure bug9841 () @@ -3910,13 +3311,9 @@ call bug9841()| drop view v1| drop procedure bug9841| - # # BUG#5963 subqueries in SET/IF # ---disable_warnings -drop procedure if exists bug5963| ---enable_warnings create procedure bug5963_1 () begin declare v int; set v = (select s1 from t3); select v; end;| create table t3 (s1 int)| @@ -3940,14 +3337,10 @@ call bug5963_2(1)| drop procedure bug5963_2| drop table t3| - # # BUG#9559: Functions: Numeric Operations using -ve value gives incorrect # results. # ---disable_warnings -drop function if exists bug9559| ---enable_warnings create function bug9559() returns int begin @@ -3959,13 +3352,9 @@ select bug9559()| drop function bug9559| - # # BUG#10961: Stored procedures: crash if select * from dual # ---disable_warnings -drop procedure if exists bug10961| ---enable_warnings # "select * from dual" results in an error, so the cursor will not open create procedure bug10961() begin @@ -3991,13 +3380,6 @@ drop procedure bug10961| # BUG #6866: Second call of a stored procedure using a view with on expressions # ---disable_warnings -DROP PROCEDURE IF EXISTS bug6866| ---enable_warnings - -DROP VIEW IF EXISTS tv| -DROP TABLE IF EXISTS tt1,tt2,tt3| - CREATE TABLE tt1 (a1 int, a2 int, a3 int, data varchar(10))| CREATE TABLE tt2 (a2 int, data2 varchar(10))| CREATE TABLE tt3 (a3 int, data3 varchar(10))| @@ -4035,9 +3417,6 @@ DROP TABLE tt1, tt2, tt3| # # BUG#10136: items cleunup # ---disable_warnings -DROP PROCEDURE IF EXISTS bug10136| ---enable_warnings create table t3 ( name char(5) not null primary key, val float not null)| insert into t3 values ('aaaaa', 1), ('bbbbb', 2), ('ccccc', 3)| create procedure bug10136() @@ -4059,9 +3438,6 @@ drop table t3| # # BUG#11529: crash server after use stored procedure # ---disable_warnings -drop procedure if exists bug11529| ---enable_warnings create procedure bug11529() begin declare c cursor for select id, data from t1 where data in (10,13); @@ -4091,7 +3467,6 @@ call bug11529()| delete from t1| drop procedure bug11529| - # # BUG#6063: Stored procedure labels are subject to restrictions (partial) # BUG#7088: Stored procedures: labels won't work if character set is utf8 @@ -4099,12 +3474,6 @@ drop procedure bug11529| set character set utf8| ---disable_warnings -drop procedure if exists bug6063| -drop procedure if exists bug7088_1| -drop procedure if exists bug7088_2| ---enable_warnings - create procedure bug6063() begin lâbel: begin end; @@ -4137,10 +3506,6 @@ drop procedure bug7088_2| # BUG#9565: "Wrong locking in stored procedure if a sub-sequent procedure # is called". # ---disable_warnings -drop procedure if exists bug9565_sub| -drop procedure if exists bug9565| ---enable_warnings create procedure bug9565_sub() begin select * from t1; @@ -4155,14 +3520,10 @@ delete from t1| drop procedure bug9565_sub| drop procedure bug9565| - # # BUG#9538: SProc: Creation fails if we try to SET system variable # using @@var_name in proc # ---disable_warnings -drop procedure if exists bug9538| ---enable_warnings create procedure bug9538() set @@sort_buffer_size = 1000000| @@ -4175,13 +3536,9 @@ set @@sort_buffer_size = @x| drop procedure bug9538| - # # BUG#8692: Cursor fetch of empty string # ---disable_warnings -drop procedure if exists bug8692| ---enable_warnings create table t3 (c1 varchar(5), c2 char(5), c3 enum('one','two'), c4 text, c5 blob, c6 char(5), c7 varchar(5))| insert into t3 values ('', '', '', '', '', '', NULL)| @@ -4208,9 +3565,6 @@ drop table t3| # Bug#10055 "Using stored function with information_schema causes empty # result set" # ---disable_warnings -drop function if exists bug10055| ---enable_warnings create function bug10055(v char(255)) returns char(255) return lower(v)| # This select should not crash server and should return all fields in t1 select t.column_name, bug10055(t.column_name) @@ -4225,10 +3579,6 @@ drop function bug10055| # consumption by passing large input parameter. # ---disable_warnings -drop procedure if exists bug12297| ---enable_warnings - create procedure bug12297(lim int) begin set @x = 0; @@ -4249,11 +3599,6 @@ drop procedure bug12297| # isn't leaking by increasing the input value for p_bug11247. # ---disable_warnings -drop function if exists f_bug11247| -drop procedure if exists p_bug11247| ---enable_warnings - create function f_bug11247(param int) returns int return param + 1| @@ -4274,10 +3619,6 @@ drop procedure p_bug11247| # BUG#12168: "'DECLARE CONTINUE HANDLER FOR NOT FOUND ...' in conditional # handled incorrectly" # ---disable_warnings -drop procedure if exists bug12168| -drop table if exists t3, t4| ---enable_warnings create table t3 (a int)| insert into t3 values (1),(2),(3),(4)| @@ -4336,7 +3677,7 @@ call bug12168('b')| select * from t4| truncate t4| drop table t3, t4| -drop procedure if exists bug12168| +drop procedure bug12168| # # Bug #11333 "Stored Procedure: Memory blow up on repeated SELECT ... INTO @@ -4344,17 +3685,11 @@ drop procedure if exists bug12168| # One more memleak bug. Use the test to check memory consumption. # ---disable_warnings -drop table if exists t3| -drop procedure if exists bug11333| ---enable_warnings - create table t3 (c1 char(128))| insert into t3 values ('AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA')| - create procedure bug11333(i int) begin declare tmp varchar(128); @@ -4375,9 +3710,6 @@ drop table t3| # # BUG#9048: Creating a function with char binary IN parameter fails # ---disable_warnings -drop function if exists bug9048| ---enable_warnings create function bug9048(f1 char binary) returns char begin set f1= concat( 'hello', f1 ); @@ -4397,18 +3729,12 @@ drop function bug9048| # 'INOUT' parameter # ---disable_warnings -drop procedure if exists bug12849_1| ---enable_warnings create procedure bug12849_1(inout x char) select x into x| set @var='a'| call bug12849_1(@var)| select @var| drop procedure bug12849_1| ---disable_warnings -drop procedure if exists bug12849_2| ---enable_warnings create procedure bug12849_2(inout foo varchar(15)) begin select concat(foo, foo) INTO foo; @@ -4421,10 +3747,6 @@ drop procedure bug12849_2| # # BUG#13133: Local variables in stored procedures are not initialized correctly. # ---disable_warnings -drop procedure if exists bug131333| -drop function if exists bug131333| ---enable_warnings create procedure bug131333() begin begin @@ -4466,13 +3788,6 @@ drop function bug131333| # BUG#12379: PROCEDURE with HANDLER calling FUNCTION with error get # strange result # ---disable_warnings -drop function if exists bug12379| -drop procedure if exists bug12379_1| -drop procedure if exists bug12379_2| -drop procedure if exists bug12379_3| -drop table if exists t3| ---enable_warnings create table t3 (c1 char(1) primary key not null)| @@ -4526,9 +3841,6 @@ drop table t3| # Bug #13124 Stored Procedure using SELECT INTO crashes server # ---disable_warnings -drop procedure if exists bug13124| ---enable_warnings create procedure bug13124() begin declare y integer; @@ -4543,9 +3855,6 @@ drop procedure bug13124| # check NULL inout parameters processing ---disable_warnings -drop procedure if exists bug12979_1| ---enable_warnings create procedure bug12979_1(inout d decimal(5)) set d = d / 2| set @bug12979_user_var = NULL| call bug12979_1(@bug12979_user_var)| @@ -4553,9 +3862,6 @@ drop procedure bug12979_1| # check NULL local variables processing ---disable_warnings -drop procedure if exists bug12979_2| ---enable_warnings create procedure bug12979_2() begin declare internal_var decimal(5); @@ -4565,14 +3871,9 @@ end| call bug12979_2()| drop procedure bug12979_2| - # # BUG#6127: Stored procedure handlers within handlers don't work # ---disable_warnings -drop table if exists t3| -drop procedure if exists bug6127| ---enable_warnings create table t3 (s1 int unique)| set @sm=@@sql_mode| @@ -4601,16 +3902,10 @@ set sql_mode=@sm| drop table t3| drop procedure bug6127| - # # BUG#12589: Assert when creating temp. table from decimal stored procedure # variable # ---disable_warnings -drop procedure if exists bug12589_1| -drop procedure if exists bug12589_2| -drop procedure if exists bug12589_3| ---enable_warnings create procedure bug12589_1() begin declare spv1 decimal(3,3); @@ -4658,15 +3953,6 @@ drop procedure bug12589_3| # # BUG#7049: Stored procedure CALL errors are ignored # ---disable_warnings -drop table if exists t3| -drop procedure if exists bug7049_1| -drop procedure if exists bug7049_2| -drop procedure if exists bug7049_3| -drop procedure if exists bug7049_4| -drop function if exists bug7049_1| -drop function if exists bug7049_2| ---enable_warnings create table t3 ( x int unique )| @@ -4731,15 +4017,10 @@ drop procedure bug7049_4| drop function bug7049_1| drop function bug7049_2| - # # BUG#13941: replace() string fuction behaves badly inside stored procedure # (BUG#13914: IFNULL is returning garbage in stored procedure) # ---disable_warnings -drop function if exists bug13941| -drop procedure if exists bug13941| ---enable_warnings create function bug13941(p_input_str text) returns text @@ -4774,21 +4055,10 @@ select @a| drop function bug13941| drop procedure bug13941| - # # BUG#13095: Cannot create VIEWs in prepared statements # -delimiter ;| - ---disable_warnings -DROP PROCEDURE IF EXISTS bug13095; -DROP TABLE IF EXISTS bug13095_t1; -DROP VIEW IF EXISTS bug13095_v1; ---enable_warnings - -delimiter |; - CREATE PROCEDURE bug13095(tbl_name varchar(32)) BEGIN SET @str = @@ -4821,12 +4091,8 @@ END| delimiter ;| CALL bug13095('bug13095_t1'); - ---disable_warnings -DROP PROCEDURE IF EXISTS bug13095; -DROP VIEW IF EXISTS bug13095_v1; -DROP TABLE IF EXISTS bug13095_t1; ---enable_warnings +DROP PROCEDURE bug13095; +DROP TABLE bug13095_t1; delimiter |; @@ -4834,10 +4100,6 @@ delimiter |; # BUG#1473: Dumping of stored functions seems to cause corruption in # the function body # ---disable_warnings -drop function if exists bug14723| -drop procedure if exists bug14723| ---enable_warnings delimiter ;;| /*!50003 create function bug14723() @@ -4890,10 +4152,6 @@ drop procedure bug14845| # procedure and last of these variables is used in argument of NOT # operator. # ---disable_warnings -drop procedure if exists bug13549_1| -drop procedure if exists bug13549_2| ---enable_warnings CREATE PROCEDURE `bug13549_2`() begin call bug13549_1(); @@ -4910,15 +4168,6 @@ drop procedure bug13549_1| # # BUG#10100: function (and stored procedure?) recursivity problem # ---disable_warnings -drop function if exists bug10100f| -drop procedure if exists bug10100p| -drop procedure if exists bug10100t| -drop procedure if exists bug10100pt| -drop procedure if exists bug10100pv| -drop procedure if exists bug10100pd| -drop procedure if exists bug10100pc| ---enable_warnings # routines with simple recursion create function bug10100f(prm int) returns int begin @@ -5040,14 +4289,11 @@ drop procedure bug10100pv| drop procedure bug10100pd| drop procedure bug10100pc| drop view v1| +drop table t3| # # BUG#13729: Stored procedures: packet error after exception handled # ---disable_warnings -drop procedure if exists bug13729| -drop table if exists t3| ---enable_warnings create table t3 (s1 int, primary key (s1))| @@ -5071,10 +4317,6 @@ drop table t3| # BUG#14643: Stored Procedure: Continuing after failed var. initialization # crashes server. # ---disable_warnings -drop procedure if exists bug14643_1| -drop procedure if exists bug14643_2| ---enable_warnings --error ER_SP_UNDECLARED_VAR create procedure bug14643_1() @@ -5107,14 +4349,9 @@ begin select undefined_var; end| - # # BUG#14304: auto_increment field incorrect set in SP # ---disable_warnings -drop procedure if exists bug14304| -drop table if exists t3, t4| ---enable_warnings create table t3(a int primary key auto_increment)| create table t4(a int primary key auto_increment)| @@ -5143,9 +4380,6 @@ drop table t3, t4| # # BUG#14376: MySQL crash on scoped variable (re)initialization # ---disable_warnings -drop procedure if exists bug14376| ---enable_warnings --error ER_SP_UNDECLARED_VAR create procedure bug14376() @@ -5153,7 +4387,6 @@ begin declare x int default x; end| - create procedure bug14376() begin declare x int default 42; @@ -5190,10 +4423,6 @@ drop procedure bug14376| # variable declarations. In MySQL 5.0 it's vice versa. # ---disable_warnings -drop procedure if exists bug5967| -drop table if exists t3| ---enable_warnings create table t3 (a varchar(255))| insert into t3 (a) values ("a - table column")| create procedure bug5967(a varchar(255)) @@ -5239,9 +4468,6 @@ drop procedure bug5967| --error 0,1 --remove_file $backupdir/t1.MYD ---disable_warnings -drop procedure if exists bug13012| ---enable_warnings # Disable warnings also for BACKUP/RESTORE: they are deprecated. eval create procedure bug13012() BEGIN @@ -5265,6 +4491,7 @@ call bug13012()| call bug13012()| drop procedure bug13012| drop view v1| +drop table t3| select * from t1 order by data| # @@ -5275,9 +4502,6 @@ select * from t1 order by data| # It's necessary to use several DBs because in the original code # the successful return of mysql_change_db overrode the error from # execution. -drop schema if exists mysqltest1| -drop schema if exists mysqltest2| -drop schema if exists mysqltest3| create schema mysqltest1| create schema mysqltest2| create schema mysqltest3| @@ -5308,19 +4532,15 @@ call mysqltest1.p1(@rs)| call mysqltest1.p1(@rs)| --error ER_SP_WRONG_NO_OF_ARGS call mysqltest1.p1(@rs)| -drop schema if exists mysqltest1| -drop schema if exists mysqltest2| -drop schema if exists mysqltest3| +drop schema mysqltest1| +drop schema mysqltest2| +drop schema mysqltest3| use test| # # Bug#15441 "Running SP causes Server to Crash": check that an SP variable # can not be used in VALUES() function. # ---disable_warnings -drop table if exists t3| -drop procedure if exists bug15441| ---enable_warnings create table t3 (id int not null primary key, county varchar(25))| insert into t3 (id, county) values (1, 'York')| @@ -5366,13 +4586,6 @@ drop procedure bug15441| # # BUG#14498: Stored procedures: hang if undefined variable and exception # ---disable_warnings -drop procedure if exists bug14498_1| -drop procedure if exists bug14498_2| -drop procedure if exists bug14498_3| -drop procedure if exists bug14498_4| -drop procedure if exists bug14498_5| ---enable_warnings --error ER_SP_UNDECLARED_VAR create procedure bug14498_1() @@ -5441,20 +4654,9 @@ begin select 'done' as 'End'; end| - # # BUG#15231: Stored procedure bug with not found condition handler # ---disable_warnings -drop table if exists t3| -drop procedure if exists bug15231_1| -drop procedure if exists bug15231_2| -drop procedure if exists bug15231_3| -drop procedure if exists bug15231_4| -drop procedure if exists bug15231_5| -drop procedure if exists bug15231_6| ---enable_warnings - create table t3 (id int not null)| create procedure bug15231_1() @@ -5525,13 +4727,9 @@ drop procedure bug15231_4| drop procedure bug15231_5| drop procedure bug15231_6| - # # BUG#15011: error handler in nested block not activated # ---disable_warnings -drop procedure if exists bug15011| ---enable_warnings create table t3 (c1 int primary key)| @@ -5556,14 +4754,10 @@ call bug15011()| drop procedure bug15011| drop table t3| - # # BUG#17476: Stored procedure not returning data when it is called first # time per connection # ---disable_warnings -drop procedure if exists bug17476| ---enable_warnings create table t3 ( d date )| insert into t3 values @@ -5581,14 +4775,9 @@ call bug17476('%Y-%m')| drop table t3| drop procedure bug17476| - # # BUG#16887: Cursor causes server segfault # ---disable_warnings -drop table if exists t3| -drop procedure if exists bug16887| ---enable_warnings create table t3 ( c varchar(1) )| @@ -5639,10 +4828,6 @@ drop procedure bug16887| # BUG#16474: SP crashed MySQL # (when using "order by localvar", where 'localvar' is just that. # ---disable_warnings -drop procedure if exists bug16474_1| -drop procedure if exists bug16474_2| ---enable_warnings delete from t1| insert into t1 values ('c', 2), ('b', 3), ('a', 1)| @@ -5657,9 +4842,6 @@ end| # # BUG#14945: Truncate table doesn't reset the auto_increment counter # ---disable_warnings -drop procedure if exists bug14945| ---enable_warnings create table t3 (id int not null auto_increment primary key)| create procedure bug14945() deterministic truncate t3| insert into t3 values (null)| @@ -5685,16 +4867,11 @@ select * from t1 order by @x, data| delete from t1| - # # BUG#15728: LAST_INSERT_ID function inside a stored function returns 0 # # The solution is not to reset last_insert_id on enter to sub-statement. # ---disable_warnings -drop function if exists bug15728| -drop table if exists t3| ---enable_warnings create table t3 ( id int not null auto_increment, @@ -5710,14 +4887,10 @@ select bug15728()| drop function bug15728| drop table t3| - # # BUG#18787: Server crashed when calling a stored procedure containing # a misnamed function # ---disable_warnings -drop procedure if exists bug18787| ---enable_warnings create procedure bug18787() begin declare continue handler for sqlexception begin end; @@ -5728,7 +4901,6 @@ end| call bug18787()| drop procedure bug18787| - # # BUG#18344: DROP DATABASE does not drop associated routines # (... if the database name is longer than 21 characters) @@ -5762,14 +4934,10 @@ select schema_name from information_schema.schemata where select routine_name,routine_schema from information_schema.routines where routine_schema like 'bug18344%'| - # # BUG#12472/BUG#15137 'CREATE TABLE ... SELECT ... which explicitly or # implicitly uses stored function gives "Table not locked" error'. # ---disable_warnings -drop function if exists bug12472| ---enable_warnings create function bug12472() returns int return (select count(*) from t1)| # Check case when function is used directly create table t3 as select bug12472() as i| @@ -5785,7 +4953,6 @@ drop table t3| drop view v1| drop function bug12472| - # # BUG#18587: Function that accepts and returns TEXT garbles data if longer than # 766 chars @@ -5793,12 +4960,6 @@ drop function bug12472| # Prepare. ---disable_warnings -DROP FUNCTION IF EXISTS bug18589_f1| -DROP PROCEDURE IF EXISTS bug18589_p1| -DROP PROCEDURE IF EXISTS bug18589_p2| ---enable_warnings - CREATE FUNCTION bug18589_f1(arg TEXT) RETURNS TEXT BEGIN RETURN CONCAT(arg, ""); @@ -5832,7 +4993,6 @@ DROP FUNCTION bug18589_f1| DROP PROCEDURE bug18589_p1| DROP PROCEDURE bug18589_p2| - # # BUG#18037: Server crash when returning system variable in stored procedures # BUG#19633: Stack corruption in fix_fields()/THD::rollback_item_tree_changes() @@ -5840,12 +5000,6 @@ DROP PROCEDURE bug18589_p2| # Prepare. ---disable_warnings -DROP FUNCTION IF EXISTS bug18037_f1| -DROP PROCEDURE IF EXISTS bug18037_p1| -DROP PROCEDURE IF EXISTS bug18037_p2| ---enable_warnings - # Test case. CREATE FUNCTION bug18037_f1() RETURNS INT @@ -5899,6 +5053,7 @@ use mysqltest1| create function bug18444(i int) returns int no sql deterministic return i + 1| use test| select mysqltest1.bug18444(i) from t3| +drop table t3| drop database mysqltest1| # # Check that current database has no influence to a stored procedure @@ -5930,10 +5085,6 @@ use test| # the first execution of a stored procedure actually works for # sp_instr_copen. ---disable_warnings -drop table if exists t3| -drop procedure if exists bug15217| ---enable_warnings create table t3 as select 1| create procedure bug15217() begin @@ -5952,7 +5103,6 @@ call bug15217()| drop table t3| drop procedure bug15217| - # # BUG#21013: Performance Degrades when importing data that uses # Trigger and Stored Procedure @@ -5960,9 +5110,6 @@ drop procedure bug15217| # This is a performance and memory leak test. Run with large number # passed to bug21013() procedure. # ---disable_warnings -DROP PROCEDURE IF EXISTS bug21013 | ---enable_warnings CREATE PROCEDURE bug21013(IN lim INT) BEGIN @@ -5978,18 +5125,12 @@ CALL bug21013(10) | DROP PROCEDURE bug21013 | - # # BUG#16211: Stored function return type for strings is ignored # # Prepare: create database with fixed, pre-defined character set. ---disable_warnings -DROP DATABASE IF EXISTS mysqltest1| -DROP DATABASE IF EXISTS mysqltest2| ---enable_warnings - CREATE DATABASE mysqltest1 DEFAULT CHARACTER SET utf8| CREATE DATABASE mysqltest2 DEFAULT CHARACTER SET utf8| @@ -6086,17 +5227,12 @@ use test| DROP DATABASE mysqltest1| DROP DATABASE mysqltest2| - # # BUG#16676: Database CHARSET not used for stored procedures # # Prepare: create database with fixed, pre-defined character set. ---disable_warnings -DROP DATABASE IF EXISTS mysqltest1| ---enable_warnings - CREATE DATABASE mysqltest1 DEFAULT CHARACTER SET utf8| # Test case: @@ -6142,16 +5278,6 @@ DROP DATABASE mysqltest1| # BUG#8153: Stored procedure with subquery and continue handler, wrong result # ---disable_warnings -drop table if exists t3| -drop table if exists t4| -drop procedure if exists bug8153_subselect| -drop procedure if exists bug8153_subselect_a| -drop procedure if exists bug8153_subselect_b| -drop procedure if exists bug8153_proc_a| -drop procedure if exists bug8153_proc_b| ---enable_warnings - create table t3 (a int)| create table t4 (a int)| insert into t3 values (1), (1), (2), (3)| @@ -6239,9 +5365,6 @@ drop table t4| # # BUG#19862: Sort with filesort by function evaluates function twice # ---disable_warnings -drop procedure if exists bug19862| ---enable_warnings CREATE TABLE t11 (a INT)| CREATE TABLE t12 (a INT)| CREATE FUNCTION bug19862(x INT) RETURNS INT @@ -6257,17 +5380,12 @@ SELECT * FROM t11| DROP TABLE t11, t12| DROP FUNCTION bug19862| - # Bug#21002 "Derived table not selecting from a "real" table fails in JOINs" # # A regression caused by the fix for Bug#18444: for derived tables we should # set an empty string as the current database. They do not belong to any # database and must be usable even if there is no database # selected. ---disable_warnings -drop table if exists t3| -drop database if exists mysqltest1| ---enable_warnings create table t3 (a int)| insert into t3 (a) values (1), (2)| @@ -6282,16 +5400,10 @@ select * from (select 1 as a) as t1 natural join (select * from test.t3) as t2| use test| drop table t3| - # Test for BUG#16899: Possible buffer overflow in handling of DEFINER-clause. # # Prepare. ---disable_warnings -DROP PROCEDURE IF EXISTS bug16899_p1| -DROP FUNCTION IF EXISTS bug16899_f1| ---enable_warnings - --error ER_WRONG_STRING_LENGTH CREATE DEFINER=longer_than_80_456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789@localhost PROCEDURE bug16899_p1() BEGIN @@ -6305,24 +5417,16 @@ BEGIN RETURN 1; END| - # # BUG#21416: SP: Recursion level higher than zero needed for non-recursive call # ---disable_warnings -drop procedure if exists bug21416| ---enable_warnings create procedure bug21416() show create procedure bug21416| call bug21416()| drop procedure bug21416| - # # BUG#21414: SP: Procedure undroppable, to some extent # ---disable_warnings -DROP PROCEDURE IF EXISTS bug21414| ---enable_warnings CREATE PROCEDURE bug21414() SELECT 1| @@ -6336,14 +5440,10 @@ UNLOCK TABLES| --echo The following should succeed. DROP PROCEDURE bug21414| - # # BUG#21311: Possible stack overrun if SP has non-latin1 name # set names utf8| ---disable_warnings -drop database if exists това_е_дълго_име_за_база_данни_нали| ---enable_warnings create database това_е_дълго_име_за_база_данни_нали| INSERT INTO mysql.proc VALUES ('това_е_дълго_име_за_база_данни_нали','това_е_процедура_с_доста_дълго_име_нали_и_още_по_дълго','PROCEDURE','това_е_процедура_с_доста_дълго_име_нали_и_още_по_дълго','SQL','CONTAINS_SQL','NO','DEFINER','','','bad_body','root@localhost',now(), now(),'','', 'utf8', 'utf8_general_ci', 'utf8_general_ci', 'n/a', 'NONE')| --error ER_SP_PROC_TABLE_CORRUPT @@ -6375,7 +5475,6 @@ CREATE TABLE t4 ( KEY Action_Date (Action_Date) )| - INSERT INTO t3(Member_ID) VALUES ('111111'), ('222222'), ('333333'), ('444444'), ('555555'), ('666666')| @@ -6396,10 +5495,6 @@ INSERT INTO t4(Member_ID, Action, Action_Date, Track) VALUES ('666666', 'Enrolled', '2006-05-12', 'CHF' ), ('666666', 'Disenrolled', '2006-06-01', 'CAD' )| ---disable_warnings -DROP FUNCTION IF EXISTS bug21493| ---enable_warnings - CREATE FUNCTION bug21493(paramMember VARCHAR(15)) RETURNS varchar(45) BEGIN DECLARE tracks VARCHAR(45); @@ -6422,16 +5517,6 @@ DROP TABLE t3,t4| # Bug#20028 Function with select return no data # ---disable_warnings -drop function if exists func_20028_a| -drop function if exists func_20028_b| -drop function if exists func_20028_c| -drop procedure if exists proc_20028_a| -drop procedure if exists proc_20028_b| -drop procedure if exists proc_20028_c| -drop table if exists table_20028| ---enable_warnings - create table table_20028 (i int)| SET @save_sql_mode=@@sql_mode| @@ -6553,11 +5638,6 @@ drop table table_20028| # Bug#21462 Stored procedures with no arguments require parenthesis # ---disable_warnings -drop procedure if exists proc_21462_a| -drop procedure if exists proc_21462_b| ---enable_warnings - create procedure proc_21462_a() begin select "Called A"; @@ -6582,15 +5662,10 @@ call proc_21462_b(1)| drop procedure proc_21462_a| drop procedure proc_21462_b| - # # Bug#19733 "Repeated alter, or repeated create/drop, fails" # Check that CREATE/DROP INDEX is re-execution friendly. # ---disable_warnings -drop table if exists t3| -drop procedure if exists proc_bug19733| ---enable_warnings create table t3 (s1 int)| create procedure proc_bug19733() @@ -6610,18 +5685,12 @@ call proc_bug19733()| drop procedure proc_bug19733| drop table t3| - # # BUG#20492: Subsequent calls to stored procedure yeild incorrect # result if join is used # # Optimized ON expression in join wasn't properly saved for reuse. # ---disable_warnings -DROP PROCEDURE IF EXISTS p1| -DROP VIEW IF EXISTS v1, v2| -DROP TABLE IF EXISTS t3, t4| ---enable_warnings CREATE TABLE t3 (t3_id INT)| @@ -6660,10 +5729,6 @@ DROP TABLE t3, t4| delimiter ;| ---disable_warnings -drop function if exists pi; ---enable_warnings - create function pi() returns varchar(50) return "pie, my favorite desert."; @@ -6696,12 +5761,6 @@ drop function pi; # BUG#22619: Spaces considered harmful # ---disable_warnings -drop function if exists test.database; -drop function if exists test.current_user; -drop function if exists test.md5; ---enable_warnings - create database nowhere; use nowhere; drop database nowhere; @@ -6772,13 +5831,6 @@ delimiter |; # # BUG#23760: ROW_COUNT() and store procedure not owrking together # ---disable_warnings -DROP TABLE IF EXISTS bug23760| -DROP TABLE IF EXISTS bug23760_log| -DROP PROCEDURE IF EXISTS bug23760_update_log| -DROP PROCEDURE IF EXISTS bug23760_test_row_count| -DROP FUNCTION IF EXISTS bug23760_rc_test| ---enable_warnings CREATE TABLE bug23760 ( id INT NOT NULL AUTO_INCREMENT , num INT NOT NULL , @@ -6804,7 +5856,6 @@ BEGIN UPDATE bug23760 SET num = num - 1; END| - CREATE PROCEDURE bug23760_test_row_count2(level INT) BEGIN IF level THEN @@ -6853,10 +5904,6 @@ DROP FUNCTION bug23760_rc_test| # the table cache # ---disable_warnings -DROP PROCEDURE IF EXISTS bug24117| -DROP TABLE IF EXISTS t3| ---enable_warnings CREATE TABLE t3(c1 ENUM('abc'))| INSERT INTO t3 VALUES('abc')| CREATE PROCEDURE bug24117() @@ -6876,11 +5923,6 @@ DROP TABLE t3| # Bug#8407(Stored functions/triggers ignore exception handler) # ---disable_warnings -drop function if exists func_8407_a| -drop function if exists func_8407_b| ---enable_warnings - create function func_8407_a() returns int begin declare x int; @@ -6923,14 +5965,6 @@ drop function func_8407_b| # Bug#26503 (Illegal SQL exception handler code causes the server to crash) # ---disable_warnings -drop table if exists table_26503| -drop procedure if exists proc_26503_ok_1| -drop procedure if exists proc_26503_ok_2| -drop procedure if exists proc_26503_ok_3| -drop procedure if exists proc_26503_ok_4| ---enable_warnings - create table table_26503(a int unique)| create procedure proc_26503_ok_1(v int) @@ -7058,9 +6092,6 @@ drop procedure proc_26503_ok_4| # Bug#25373: Stored functions wasn't compared correctly which leads to a wrong # result. # ---disable_warnings -DROP FUNCTION IF EXISTS bug25373| ---disable_warnings CREATE FUNCTION bug25373(p1 INTEGER) RETURNS INTEGER LANGUAGE SQL DETERMINISTIC RETURN p1;| @@ -7070,7 +6101,6 @@ SELECT SUM(f2), bug25373(f1) FROM t3 GROUP BY bug25373(f1) WITH ROLLUP| DROP FUNCTION bug25373| DROP TABLE t3| - # # BUG#25082: Default database change on trigger execution breaks replication. # @@ -7084,11 +6114,6 @@ DROP TABLE t3| # Prepare. ---disable_warnings -DROP DATABASE IF EXISTS mysqltest1| -DROP DATABASE IF EXISTS mysqltest2| ---enable_warnings - CREATE DATABASE mysqltest1| CREATE DATABASE mysqltest2| @@ -7109,13 +6134,8 @@ DROP DATABASE mysqltest1| use test| - # # Bug#20777: Function w BIGINT UNSIGNED shows diff. behaviour --ps-protocol ---disable_warnings -drop function if exists bug20777| -drop table if exists examplebug20777| ---enable_warnings create function bug20777(f1 bigint unsigned) returns bigint unsigned begin set f1 = (f1 - 10); set f1 = (f1 + 10); @@ -7158,18 +6178,12 @@ select bug20777(18446744073709551613)+1; drop function bug20777; delimiter |; - # # BUG#5274: Stored procedure crash if length of CHAR variable too great. # # Prepare. ---disable_warnings -DROP FUNCTION IF EXISTS bug5274_f1| -DROP FUNCTION IF EXISTS bug5274_f2| ---enable_warnings - # Test. CREATE FUNCTION bug5274_f1(p1 CHAR) RETURNS CHAR @@ -7198,9 +6212,6 @@ DROP FUNCTION bug5274_f2| # # Bug#21513 (SP having body starting with quoted label rendered unusable) # ---disable_warnings -drop procedure if exists proc_21513| ---enable_warnings create procedure proc_21513()`my_label`:BEGIN END| show create procedure proc_21513| @@ -7213,9 +6224,6 @@ drop procedure proc_21513| # # BUG#NNNN: New bug synopsis # -#--disable_warnings -#drop procedure if exists bugNNNN| -#--enable_warnings #create procedure bugNNNN... # # Add bugs above this line. Use existing tables t1 and t2 when @@ -7250,7 +6258,6 @@ update t2 set b=-b where a=bug27354(); select * from t2 /* must return 1,-1 ... */; select count(*) from t1 /* must be 3 */; - drop table t1,t2; drop function bug27354; @@ -7346,9 +6353,7 @@ DROP TABLE t1; # Bug#28551 "The warning 'No database selected' is reported when calling # stored procedures" # ---disable_warnings -drop database if exists mysqltest_db1; ---enable_warnings + create database mysqltest_db1; create procedure mysqltest_db1.sp_bug28551() begin end; call mysqltest_db1.sp_bug28551(); @@ -7358,10 +6363,7 @@ drop database mysqltest_db1; # Bug#29050 Creation of a legal stored procedure fails if a database is not # selected prior # ---disable_warnings -drop database if exists mysqltest_db1; -drop table if exists test.t1; ---enable_warnings + create database mysqltest_db1; use mysqltest_db1; # For the sake of its side effect @@ -7456,15 +6458,10 @@ drop procedure proc_25411_a; drop procedure proc_25411_b; drop procedure proc_25411_c; - # # Bug#26302 (MySQL server cuts off trailing "*/" from comments in SP/func) # ---disable_warnings -drop procedure if exists proc_26302; ---enable_warnings - create procedure proc_26302() select 1 /* testing */; @@ -7475,7 +6472,6 @@ where ROUTINE_NAME = "proc_26302"; drop procedure proc_26302; - # Bug #29338: no optimization for stored functions with a trivial body # always returning constant. # @@ -7499,7 +6495,6 @@ EXPLAIN SELECT * FROM t1 WHERE c1=f2(10); EXPLAIN SELECT * FROM t1 WHERE c1=f2(c1); EXPLAIN SELECT * FROM t1 WHERE c1=f2(rand()); - DROP VIEW v1; DROP FUNCTION f1; DROP FUNCTION f2; @@ -7547,13 +6542,6 @@ drop function f1; --echo # Bug#13675. --echo ---disable_warnings -DROP PROCEDURE IF EXISTS p1; -DROP PROCEDURE IF EXISTS p2; - -DROP TABLE IF EXISTS t1; ---enable_warnings - --echo CREATE PROCEDURE p1(v DATETIME) CREATE TABLE t1 SELECT v; @@ -7614,14 +6602,6 @@ DROP PROCEDURE p2; --echo ---disable_warnings -DROP TABLE IF EXISTS t1; -DROP FUNCTION IF EXISTS f1; -DROP FUNCTION IF EXISTS f2; -DROP FUNCTION IF EXISTS f3; -DROP FUNCTION IF EXISTS f4; ---enable_warnings - --echo --echo # @@ -7736,12 +6716,6 @@ DROP FUNCTION f4; --echo ---disable_warnings -DROP TABLE IF EXISTS t1; -DROP TABLE IF EXISTS t2; -DROP FUNCTION IF EXISTS f1; ---enable_warnings - --echo --echo # @@ -7830,11 +6804,6 @@ DROP FUNCTION f1; --echo ---disable_warnings -DROP TABLE IF EXISTS t1; -DROP FUNCTION IF EXISTS f1; ---enable_warnings - --echo --echo # @@ -7886,13 +6855,6 @@ DROP FUNCTION f1; # Bug#28318 (CREATE FUNCTION (UDF) requires a schema) # ---disable_warnings -DROP PROCEDURE IF EXISTS db28318_a.t1; -DROP PROCEDURE IF EXISTS db28318_b.t2; -DROP DATABASE IF EXISTS db28318_a; -DROP DATABASE IF EXISTS db28318_b; ---enable_warnings - CREATE DATABASE db28318_a; CREATE DATABASE db28318_b; @@ -7917,11 +6879,6 @@ use test; # Bug#29770 Two handlers are allowed to catch an error in an stored procedure. # ---disable_warnings -DROP TABLE IF EXISTS t1; -DROP PROCEDURE IF EXISTS bug29770; ---enable_warnings - CREATE TABLE t1(a int); delimiter |; CREATE PROCEDURE bug29770() @@ -7942,11 +6899,6 @@ DROP PROCEDURE bug29770; use test; ---disable_warnings -drop table if exists t_33618; -drop procedure if exists proc_33618; ---enable_warnings - create table t_33618 (`a` int, unique(`a`), `b` varchar(30)) engine=myisam; insert into t_33618 (`a`,`b`) values (1,'1'),(2,'2'); @@ -7992,9 +6944,7 @@ drop procedure proc_33618; --echo # Bug#30787: Stored function ignores user defined alias. --echo # use test; ---disable_warnings -drop function if exists func30787; ---enable_warnings + create table t1(f1 int); insert into t1 values(1),(2); delimiter |; @@ -8023,7 +6973,6 @@ CALL test_sp(); DROP PROCEDURE test_sp; DROP TABLE t1; - ########################################################################### # # Bug#38291 memory corruption and server crash with view/sp/function @@ -8053,9 +7002,6 @@ drop table t1; # Bug#38469 invalid memory read and/or crash with utf8 text field, stored procedure, uservar # delimiter $; ---disable_warnings -drop procedure if exists `p2` $ ---enable_warnings create procedure `p2`(in `a` text charset utf8) begin declare `pos` int default 1; @@ -8071,11 +7017,6 @@ drop procedure `p2`; # Bug#38823: Invalid memory access when a SP statement does wildcard expansion # ---disable_warnings -drop table if exists t1; -drop procedure if exists p1; ---enable_warnings - delimiter $; create procedure p1() begin select * from t1; end$ --error ER_NO_SUCH_TABLE @@ -8115,13 +7056,6 @@ drop procedure p1; --echo ---disable_warnings -DROP VIEW IF EXISTS v1; -DROP VIEW IF EXISTS v2; -DROP FUNCTION IF EXISTS f1; -DROP FUNCTION IF EXISTS f2; ---enable_warnings - --echo --echo # @@ -8187,10 +7121,6 @@ DROP VIEW v2; --echo ---disable_warnings -DROP FUNCTION IF EXISTS f1; ---enable_warnings - --echo --echo # @@ -8252,9 +7182,6 @@ DROP FUNCTION f1; # the mysql.proc table. # ---disable_warnings -drop procedure if exists p; ---enable_warnings set @old_mode= @@sql_mode; set @@sql_mode= cast(pow(2,32)-1 as unsigned integer); --disable_cursor_protocol @@ -8285,7 +7212,6 @@ BEGIN END;// DELIMITER ;// - CREATE TABLE t1 (f1 INT); --disable_result_log let $tab_count= 4; @@ -8342,12 +7268,6 @@ DROP TABLE t1, t2; --echo # Bug#48626: Crash or lost connection using SET for declared variables with @@ --echo # ---disable_warnings -DROP PROCEDURE IF EXISTS p1; -DROP PROCEDURE IF EXISTS p2; -DROP PROCEDURE IF EXISTS p3; ---enable_warnings - delimiter //; --error ER_UNKNOWN_SYSTEM_VARIABLE @@ -8405,15 +7325,11 @@ SET @@GLOBAL.init_connect= @old_init_connect; DROP PROCEDURE p2; DROP PROCEDURE p5; - --echo # --echo # Bug#11840395 (formerly known as bug#60347): --echo # The string "versiondata" seems --echo # to be 'leaking' into the schema name space --echo # ---disable_warnings -DROP DATABASE IF EXISTS mixedCaseDbName; ---enable_warnings CREATE DATABASE mixedCaseDbName; DELIMITER |; CREATE PROCEDURE mixedCaseDbName.tryMyProc() begin end| @@ -8424,7 +7340,6 @@ call mixedCaseDbName.tryMyProc(); select mixedCaseDbName.tryMyFunc(); DROP DATABASE mixedCaseDbName; - --echo # --echo # Bug#11766594 59736: SELECT DISTINCT.. INCORRECT RESULT WITH DETERMINISTIC FUNCTION IN WHERE C --echo # @@ -8451,7 +7366,6 @@ SELECT COUNT(DISTINCT d) FROM t1, t2 WHERE a = c AND b = f1(); DROP FUNCTION f1; DROP TABLE t1, t2; - --echo # ------------------------------------------------------------------ --echo # -- End of 5.1 tests --echo # ------------------------------------------------------------------ @@ -8460,12 +7374,6 @@ DROP TABLE t1, t2; # Bug#39255: Stored procedures: crash if function references nonexistent table # ---disable_warnings -DROP FUNCTION IF EXISTS f1; -DROP TABLE IF EXISTS t_non_existing; -DROP TABLE IF EXISTS t1; ---enable_warnings - delimiter |; CREATE FUNCTION f1() RETURNS INT BEGIN @@ -8488,10 +7396,6 @@ DROP TABLE t1; # Bug#36649: Condition area is not properly cleaned up after stored routine invocation # ---disable_warnings -DROP PROCEDURE IF EXISTS p1; ---enable_warnings - delimiter |; CREATE PROCEDURE p1(a INT, b CHAR) BEGIN @@ -8514,10 +7418,6 @@ DROP PROCEDURE p1; # Ensure that rules for message list clean up are being respected. # ---disable_warnings -DROP PROCEDURE IF EXISTS p1; ---enable_warnings - delimiter |; CREATE PROCEDURE p1(a CHAR) BEGIN @@ -8535,13 +7435,6 @@ DROP PROCEDURE p1; # Cascading stored procedure/function calls. # ---disable_warnings -DROP PROCEDURE IF EXISTS p1; -DROP PROCEDURE IF EXISTS p2; -DROP PROCEDURE IF EXISTS p3; -DROP PROCEDURE IF EXISTS p4; ---enable_warnings - delimiter |; CREATE PROCEDURE p1() CALL p2()| @@ -8564,14 +7457,6 @@ DROP PROCEDURE p2; DROP PROCEDURE p3; DROP PROCEDURE p4; ---disable_warnings -DROP FUNCTION IF EXISTS f1; -DROP FUNCTION IF EXISTS f2; -DROP FUNCTION IF EXISTS f3; -DROP FUNCTION IF EXISTS f4; -DROP TABLE IF EXISTS t1; ---enable_warnings - CREATE TABLE t1 (a CHAR(2)); INSERT INTO t1 VALUES ('aa'); @@ -8602,10 +7487,6 @@ DROP TABLE t1; --echo # strict SQL mode --echo # ---disable_warnings -DROP PROCEDURE IF EXISTS p1; ---enable_warnings - CREATE PROCEDURE p1 () COMMENT '12345678901234567890123456789012345678901234567890123456789012345678901234567890' @@ -8618,17 +7499,10 @@ SELECT routine_comment FROM information_schema.routines WHERE routine_name = "p1 DROP PROCEDURE p1; - --echo # --echo # Bug #47313 assert in check_key_in_view during CALL procedure --echo # ---disable_warnings -DROP TABLE IF EXISTS t1; -DROP VIEW IF EXISTS t1, t2_unrelated; -DROP PROCEDURE IF EXISTS p1; ---enable_warnings - CREATE PROCEDURE p1(IN x INT) INSERT INTO t1 VALUES (x); CREATE VIEW t1 AS SELECT 10 AS f1; @@ -8699,10 +7573,7 @@ DROP PROCEDURE p1; --echo # --echo # Bug #11918 Can't use a declared variable in LIMIT clause --echo # ---disable_warnings -drop table if exists t1; -drop procedure if exists p1; ---enable_warnings + create table t1 (c1 int); insert into t1 (c1) values (1), (2), (3), (4), (5); @@ -8915,20 +7786,12 @@ DROP TABLE t1,t2; DROP VIEW v1; DROP PROCEDURE proc; - --echo --echo # -- --echo # -- Bug 11765684 - 58674: SP-cache does not detect changes in --echo # -- pre-locking list caused by triggers --echo # --- ---disable_warnings -DROP TABLE IF EXISTS t1; -DROP TABLE IF EXISTS t2; -DROP TABLE IF EXISTS t3; -DROP PROCEDURE IF EXISTS p1; ---enable_warnings - CREATE TABLE t1(a INT); CREATE TABLE t2(a INT); CREATE TABLE t3(a INT); @@ -8957,18 +7820,12 @@ DROP TABLE t1, t2, t3; DROP PROCEDURE p1; --echo - --echo --echo # -- --echo # -- Bug#12652769 - 61470: case operator in stored routine retains old --echo # -- value of input parameter --echo # --- ---disable_warnings -DROP TABLE IF EXISTS t1; -DROP PROCEDURE IF EXISTS p1; ---enable_warnings - CREATE TABLE t1 (s1 CHAR(5) CHARACTER SET utf8); INSERT INTO t1 VALUES ('a'); @@ -9018,12 +7875,6 @@ DROP PROCEDURE p1; --echo # limit clause of a set statement --echo # ---disable_warnings -DROP TABLE IF EXISTS t1; -DROP PROCEDURE IF EXISTS p1; -DROP PROCEDURE IF EXISTS p2; ---enable_warnings - CREATE TABLE t1 (c1 INT); INSERT INTO t1 VALUES (1); @@ -9114,10 +7965,6 @@ DROP PROCEDURE sp; --echo # Bug#12663165 SP DEAD CODE REMOVAL DOESN'T UNDERSTAND CONTINUE HANDLERS --echo # ---disable_warnings -DROP FUNCTION IF EXISTS f1; ---enable_warnings - delimiter $; CREATE FUNCTION f1() RETURNS INT BEGIN @@ -9208,13 +8055,6 @@ drop table t1; --echo # bug#62125 result for null incorrectly yields 1292 warning. --echo # ---disable_warnings -DROP FUNCTION IF EXISTS f1; -DROP FUNCTION IF EXISTS f2; -DROP FUNCTION IF EXISTS f3; -DROP FUNCTION IF EXISTS f4; ---enable_warnings - delimiter /; CREATE FUNCTION f1() RETURNS VARCHAR(1) @@ -9247,11 +8087,6 @@ DROP FUNCTION f4; --echo procedure --echo ---disable_warnings -drop procedure if exists p1; -drop procedure if exists p0; ---enable_warnings - create table t1 (id int); delimiter $$; create procedure p1 () begin @@ -9344,13 +8179,11 @@ CREATE TABLE `t1` ( `CLOSE_YN` varchar(10) COLLATE utf8_bin DEFAULT NULL ) DEFAULT CHARSET=utf8 COLLATE=utf8_bin ; - CREATE TABLE `t2` ( `ap_close_to` varchar(8) COLLATE utf8_bin DEFAULT NULL ) DEFAULT CHARSET=utf8 COLLATE=utf8_bin ; insert t1 values (1); - --delimiter $$ CREATE FUNCTION `f1`(`P_DC_CD` VARBINARY(50), `P_SYS_DATE` DATETIME) RETURNS datetime @@ -9382,8 +8215,8 @@ JOIN SET S.CLOSE_YN = '' where 1=1; -drop function if exists f1; drop table t1,t2; +drop function f1; --echo # --echo # MDEV-16957: Server crashes in Field_iterator_natural_join::next @@ -9668,7 +8501,6 @@ union select id from t ; -drop procedure if exists p; create procedure p() insert into tmp_t select t.id from ( select id from v @@ -9686,7 +8518,6 @@ drop procedure p; drop view v; drop table t, tmp_t; - --echo # --echo # MDEV-13936: Server crashes in Time_and_counter_tracker::incr_loops --echo # @@ -10003,7 +8834,6 @@ CALL p1(ROW_NUMBER() OVER ()); CALL p1(SUM(1)); DROP PROCEDURE p1; - --echo # --echo # MDEV-16311 Server crash when using a NAME_CONST() with a CURSOR --echo # @@ -10048,7 +8878,6 @@ DROP PROCEDURE p1; DROP VIEW v1; DROP TABLE t1; - --echo # --echo # BUG#30366310: USING A FUNCTION TO ASSIGN DEFAULT VALUES TO --echo # 2 OR MORE VARIABLES CRASHES SERVER @@ -10113,7 +8942,6 @@ DROP TABLE t2; --echo # MDEV-12007 Allow ROW variables as a cursor FETCH target --echo # - --echo # The cursor and the ROW variable in FETCH must have the same number of fields DELIMITER $$; CREATE PROCEDURE p1() @@ -10138,7 +8966,6 @@ DELIMITER ;$$ CALL p1(); DROP PROCEDURE p1; - --echo # Multiple ROW variables in FETCH DELIMITER $$; CREATE PROCEDURE p1() @@ -10164,7 +8991,6 @@ DELIMITER ;$$ CALL p1(); DROP PROCEDURE p1; - --echo # A complete working example CREATE TABLE t1 (a INT, b VARCHAR(32)); INSERT INTO t1 VALUES (10,'b10'); @@ -10194,7 +9020,6 @@ CALL p1(); DROP PROCEDURE p1; DROP TABLE t1; - --echo # A ROW variable with a single field DELIMITER $$; CREATE PROCEDURE p1() @@ -10273,7 +9098,6 @@ DROP FUNCTION f1; DROP TABLE t1; - DELIMITER $$; --error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION BEGIN NOT ATOMIC @@ -10385,7 +9209,6 @@ SHOW CREATE TABLE t2; DROP TABLE t1,t2; DROP FUNCTION f1; - CREATE FUNCTION f1() RETURNS TINYTEXT CHARACTER SET latin1 RETURN ''; CREATE TABLE t1 AS SELECT f1() AS c1, COALESCE(f1()) AS c2, CONCAT(f1()) AS c3; SHOW CREATE TABLE t1; @@ -10510,7 +9333,6 @@ CREATE PROCEDURE sp1() CREATE SEQUENCE s1 START WITH 300 INCREMENT BY 30 RESTART --echo # End of 10.3 tests - --echo # --echo # Start of 10.4 tests --echo # @@ -10753,7 +9575,6 @@ CREATE OR REPLACE FUNCTION path(a VARCHAR(128)) RETURNS int RETURN LENGTH(a)=0; SELECT path('1'); DROP FUNCTION path; - CREATE OR REPLACE FUNCTION fast(a VARCHAR(128)) RETURNS int RETURN LENGTH(a)=0; SELECT fast('1'); DROP FUNCTION fast; diff --git a/mysql-test/main/statistics.test b/mysql-test/main/statistics.test index 851bf849b6d..1b71d01e447 100644 --- a/mysql-test/main/statistics.test +++ b/mysql-test/main/statistics.test @@ -333,9 +333,7 @@ SELECT * FROM mysql.column_stats; --sorted_result SELECT * FROM mysql.index_stats; ---disable_cursor_protocol --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR ---disable_ps2_protocol eval SELECT * INTO OUTFILE '$MYSQLTEST_VARDIR/tmp/save_column_stats' FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\n' @@ -345,8 +343,6 @@ eval SELECT * INTO OUTFILE '$MYSQLTEST_VARDIR/tmp/save_index_stats' FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\n' FROM mysql.index_stats WHERE index_name IN ('idx1', 'idx4'); ---enable_ps2_protocol ---enable_cursor_protocol ALTER TABLE t1 CHANGE COLUMN b x varchar(30); SHOW CREATE TABLE t1; diff --git a/mysql-test/main/subselect.result b/mysql-test/main/subselect.result index e7dfb18c6f0..88c8a9c41c9 100644 --- a/mysql-test/main/subselect.result +++ b/mysql-test/main/subselect.result @@ -1,5 +1,3 @@ -drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t11,t12; -drop view if exists v2; call mtr.add_suppression("Sort aborted.*"); set @subselect_tmp=@@optimizer_switch; set @@optimizer_switch=ifnull(@optimizer_switch_for_subselect_test, diff --git a/mysql-test/main/subselect.test b/mysql-test/main/subselect.test index f08177d72f3..a8bcb3c40a4 100644 --- a/mysql-test/main/subselect.test +++ b/mysql-test/main/subselect.test @@ -8,10 +8,6 @@ # # Initialise --source include/have_sequence.inc ---disable_warnings -drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t11,t12; -drop view if exists v2; ---enable_warnings call mtr.add_suppression("Sort aborted.*"); @@ -1200,7 +1196,6 @@ DROP TABLE t1; # --disable_service_connection ---disable_ps2_protocol create table t1 (a int, b decimal(13, 3)); insert into t1 values (1, 0.123); let $outfile_abs= $MYSQLTEST_VARDIR/tmp/subselect.out.file.1; @@ -1209,15 +1204,12 @@ let $outfile_rel= ../../tmp/subselect.out.file.1; --error 0,1 --remove_file $outfile_abs --enable_warnings ---disable_cursor_protocol eval select a, (select max(b) from t1) into outfile "$outfile_rel" from t1; ---enable_cursor_protocol delete from t1; eval load data infile "$outfile_rel" into table t1; --remove_file $outfile_abs select * from t1; drop table t1; ---enable_ps2_protocol --enable_service_connection # @@ -3619,9 +3611,7 @@ DROP TABLE t1,t2; CREATE TABLE t1(a1 int); INSERT INTO t1 VALUES (1),(2); ---disable_cursor_protocol SELECT @@session.sql_mode INTO @old_sql_mode; ---enable_cursor_protocol SET SESSION sql_mode='ONLY_FULL_GROUP_BY'; ## First a simpler query, illustrating the transformation @@ -3659,9 +3649,7 @@ INSERT INTO t1 VALUES (1),(2); CREATE TABLE t2(a1 int); INSERT INTO t2 VALUES (3); ---disable_cursor_protocol SELECT @@session.sql_mode INTO @old_sql_mode; ---enable_cursor_protocol SET SESSION sql_mode='ONLY_FULL_GROUP_BY'; ## All these are subject to the transformation @@ -3682,9 +3670,7 @@ DROP TABLE t1, t2; create table t2(i int); insert into t2 values(0); ---disable_cursor_protocol SELECT @@session.sql_mode INTO @old_sql_mode; ---enable_cursor_protocol SET SESSION sql_mode='ONLY_FULL_GROUP_BY'; CREATE VIEW v1 AS @@ -5061,9 +5047,7 @@ INSERT INTO t1 VALUES (1),(2); CREATE TABLE t2(a1 int); INSERT INTO t2 VALUES (3); ---disable_cursor_protocol SELECT @@session.sql_mode INTO @old_sql_mode; ---enable_cursor_protocol SET SESSION sql_mode='ONLY_FULL_GROUP_BY'; ## All these are subject to the transformation @@ -5080,9 +5064,7 @@ DROP TABLE t1, t2; create table t2(i int); insert into t2 values(0); ---disable_cursor_protocol SELECT @@session.sql_mode INTO @old_sql_mode; ---enable_cursor_protocol SET SESSION sql_mode='ONLY_FULL_GROUP_BY'; CREATE VIEW v1 AS @@ -5475,9 +5457,7 @@ DROP TABLE t1,t2,t3; CREATE TABLE t1(a1 int); INSERT INTO t1 VALUES (1),(2); ---disable_cursor_protocol SELECT @@session.sql_mode INTO @old_sql_mode; ---enable_cursor_protocol SET SESSION sql_mode='ONLY_FULL_GROUP_BY'; ## First a simpler query, illustrating the transformation diff --git a/mysql-test/main/subselect3.inc b/mysql-test/main/subselect3.inc index e07d0c6810c..89c192516b0 100644 --- a/mysql-test/main/subselect3.inc +++ b/mysql-test/main/subselect3.inc @@ -651,11 +651,7 @@ DROP TABLE t1, t2; create table t1 (a int, b decimal(13, 3)); insert into t1 values (1, 0.123); ---disable_cursor_protocol ---disable_ps2_protocol select a, (select max(b) from t1) into outfile "../../tmp/subselect.out.file.1" from t1; ---enable_ps2_protocol ---enable_cursor_protocol delete from t1; load data infile "../../tmp/subselect.out.file.1" into table t1; select * from t1; diff --git a/mysql-test/main/subselect_no_exists_to_in.result b/mysql-test/main/subselect_no_exists_to_in.result index daa85e36358..38df3b6e308 100644 --- a/mysql-test/main/subselect_no_exists_to_in.result +++ b/mysql-test/main/subselect_no_exists_to_in.result @@ -2,8 +2,6 @@ select @@optimizer_switch like '%exists_to_in=off%'; @@optimizer_switch like '%exists_to_in=off%' 0 set optimizer_switch='exists_to_in=off'; -drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t11,t12; -drop view if exists v2; call mtr.add_suppression("Sort aborted.*"); set @subselect_tmp=@@optimizer_switch; set @@optimizer_switch=ifnull(@optimizer_switch_for_subselect_test, diff --git a/mysql-test/main/subselect_no_mat.result b/mysql-test/main/subselect_no_mat.result index 61a974ee08b..fc3d2bfc70a 100644 --- a/mysql-test/main/subselect_no_mat.result +++ b/mysql-test/main/subselect_no_mat.result @@ -5,8 +5,6 @@ set optimizer_switch='materialization=off'; set optimizer_switch='mrr=on,mrr_sort_keys=on,index_condition_pushdown=on'; set join_cache_level=1; set @join_cache_level_for_subselect_test=@@join_cache_level; -drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t11,t12; -drop view if exists v2; call mtr.add_suppression("Sort aborted.*"); set @subselect_tmp=@@optimizer_switch; set @@optimizer_switch=ifnull(@optimizer_switch_for_subselect_test, diff --git a/mysql-test/main/subselect_no_opts.result b/mysql-test/main/subselect_no_opts.result index ccb63506efe..7c35f4bade3 100644 --- a/mysql-test/main/subselect_no_opts.result +++ b/mysql-test/main/subselect_no_opts.result @@ -1,8 +1,6 @@ set @optimizer_switch_for_subselect_test='materialization=off,semijoin=off,subquery_cache=off,mrr=on,mrr_sort_keys=on,index_condition_pushdown=on'; set join_cache_level=1; set @join_cache_level_for_subselect_test=@@join_cache_level; -drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t11,t12; -drop view if exists v2; call mtr.add_suppression("Sort aborted.*"); set @subselect_tmp=@@optimizer_switch; set @@optimizer_switch=ifnull(@optimizer_switch_for_subselect_test, diff --git a/mysql-test/main/subselect_no_scache.result b/mysql-test/main/subselect_no_scache.result index 523238b450d..70e5a9b45f9 100644 --- a/mysql-test/main/subselect_no_scache.result +++ b/mysql-test/main/subselect_no_scache.result @@ -4,8 +4,6 @@ select @@optimizer_switch like '%subquery_cache=on%'; set optimizer_switch='subquery_cache=off'; set join_cache_level=1; set @join_cache_level_for_subselect_test=@@join_cache_level; -drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t11,t12; -drop view if exists v2; call mtr.add_suppression("Sort aborted.*"); set @subselect_tmp=@@optimizer_switch; set @@optimizer_switch=ifnull(@optimizer_switch_for_subselect_test, diff --git a/mysql-test/main/subselect_no_semijoin.result b/mysql-test/main/subselect_no_semijoin.result index 1c80bc7a8ce..cbdcf7c82e9 100644 --- a/mysql-test/main/subselect_no_semijoin.result +++ b/mysql-test/main/subselect_no_semijoin.result @@ -1,8 +1,6 @@ set @optimizer_switch_for_subselect_test='semijoin=off,mrr=on,mrr_sort_keys=on,index_condition_pushdown=on'; set join_cache_level=1; set @join_cache_level_for_subselect_test=@@join_cache_level; -drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t11,t12; -drop view if exists v2; call mtr.add_suppression("Sort aborted.*"); set @subselect_tmp=@@optimizer_switch; set @@optimizer_switch=ifnull(@optimizer_switch_for_subselect_test, diff --git a/mysql-test/main/trigger-compat.result b/mysql-test/main/trigger-compat.result index 735aa1ee5ff..7f77b368ca4 100644 --- a/mysql-test/main/trigger-compat.result +++ b/mysql-test/main/trigger-compat.result @@ -15,6 +15,14 @@ CREATE TABLE t2(user_str TEXT); CREATE TRIGGER wl2818_trg1 BEFORE INSERT ON t1 FOR EACH ROW INSERT INTO t2 VALUES(CURRENT_USER()); ---> patching t1.TRG... +connection default; +CREATE TABLE patch (a blob); +LOAD DATA LOCAL INFILE '$MYSQLD_DATADIR/mysqltest_db1/t1.TRG' INTO TABLE patch; +SELECT SUBSTRING_INDEX(a,'definers=',1) INTO OUTFILE +'$MYSQLD_DATADIR/mysqltest_db1/t1.TRG' +FROM patch; +DROP TABLE patch; +connection wl2818_definer_con; CREATE TRIGGER wl2818_trg2 AFTER INSERT ON t1 FOR EACH ROW diff --git a/mysql-test/main/trigger-compat.test b/mysql-test/main/trigger-compat.test index a8ad20073d6..f927a744c0a 100644 --- a/mysql-test/main/trigger-compat.test +++ b/mysql-test/main/trigger-compat.test @@ -61,23 +61,17 @@ CREATE TRIGGER wl2818_trg1 BEFORE INSERT ON t1 FOR EACH ROW INSERT INTO t2 VALUE # portable and we have to load the file into a table, exclude the definers line, # then load the data to an outfile to accomplish the same effect ---disable_query_log --connection default CREATE TABLE patch (a blob); let $MYSQLD_DATADIR = `select @@datadir`; -eval LOAD DATA LOCAL INFILE '$MYSQLD_DATADIR/mysqltest_db1/t1.TRG' INTO TABLE patch; +evalp LOAD DATA LOCAL INFILE '$MYSQLD_DATADIR/mysqltest_db1/t1.TRG' INTO TABLE patch; # remove original t1.TRG file so SELECT INTO OUTFILE won't fail --remove_file $MYSQLD_DATADIR/mysqltest_db1/t1.TRG ---disable_cursor_protocol ---disable_ps2_protocol -eval SELECT SUBSTRING_INDEX(a,'definers=',1) INTO OUTFILE +evalp SELECT SUBSTRING_INDEX(a,'definers=',1) INTO OUTFILE '$MYSQLD_DATADIR/mysqltest_db1/t1.TRG' FROM patch; ---enable_ps2_protocol ---enable_cursor_protocol DROP TABLE patch; --connection wl2818_definer_con ---enable_query_log # # Create a new trigger. diff --git a/mysql-test/main/type_timestamp.test b/mysql-test/main/type_timestamp.test index 0a6ca692904..e413e7302a0 100644 --- a/mysql-test/main/type_timestamp.test +++ b/mysql-test/main/type_timestamp.test @@ -740,11 +740,7 @@ FLUSH TABLES; # 0xFF - record flags # 0x77777777 - TIMESTAMP integer part # 0xFFFFFF - TIMESTAMP bad fractional part ---disable_cursor_protocol ---disable_ps2_protocol --eval SELECT CONCAT(0xFF,0x77777777,0xFFFFFF) INTO OUTFILE '$MYSQLD_DATADIR/test/t1.MYD' FIELDS TERMINATED BY '' ESCAPED BY '' LINES TERMINATED BY '' ---enable_ps2_protocol ---enable_cursor_protocol --eval SELECT HEX(LOAD_FILE('$MYSQLD_DATADIR/test/t1.MYD')) AS MYD --enable_query_log SELECT a, CAST(a AS DATETIME) AS dt0, CAST(a AS DATETIME(6)) AS dt6 FROM t1; diff --git a/mysql-test/main/union.test b/mysql-test/main/union.test index c3951bfeebf..264b4852194 100644 --- a/mysql-test/main/union.test +++ b/mysql-test/main/union.test @@ -1115,11 +1115,9 @@ DROP TABLE t1; -- echo # Bug#32858: Error: "Incorrect usage of UNION and INTO" does not take -- echo # subselects into account -- echo # ---disable_ps2_protocol CREATE TABLE t1 (a INT); INSERT INTO t1 VALUES (1); ---disable_cursor_protocol -- echo # Tests fix in parser rule select_derived_union. SELECT a INTO @v FROM ( SELECT a FROM t1 @@ -1161,11 +1159,9 @@ SELECT a INTO DUMPFILE 'union.out.file8' FROM t1 UNION SELECT a FROM t1; SELECT ( SELECT a UNION SELECT a ) INTO @v FROM t1; 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; ---enable_cursor_protocol DROP TABLE t1; remove_files_wildcard $MYSQLTEST_VARDIR/mysqld.1/data/test union.out.fil*; ---enable_ps2_protocol --echo # --echo # Bug #49734: Crash on EXPLAIN EXTENDED UNION ... ORDER BY diff --git a/mysql-test/suite/binlog/include/database.test b/mysql-test/suite/binlog/include/database.test index a55cd7c5002..097a501cc34 100644 --- a/mysql-test/suite/binlog/include/database.test +++ b/mysql-test/suite/binlog/include/database.test @@ -44,11 +44,7 @@ CREATE TABLE t2(c1 INT); let $prefix= `SELECT UUID()`; --echo # Create a file in the database directory --replace_result $prefix FAKE_FILE ---disable_cursor_protocol ---disable_ps2_protocol eval SELECT 'hello' INTO OUTFILE 'fake_file.$prefix'; ---enable_ps2_protocol ---enable_cursor_protocol --echo --echo # 'DROP DATABASE' will fail if there is any other file in the the diff --git a/mysql-test/suite/binlog_encryption/rpl_loadfile.result b/mysql-test/suite/binlog_encryption/rpl_loadfile.result index 19a11e99250..2f94847a3b3 100644 --- a/mysql-test/suite/binlog_encryption/rpl_loadfile.result +++ b/mysql-test/suite/binlog_encryption/rpl_loadfile.result @@ -229,7 +229,6 @@ connection slave; include/rpl_reset.inc connection master; SELECT repeat('x',20) INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/bug_39701.data'; -DROP TABLE IF EXISTS t1; CREATE TABLE t1 (t text); CREATE PROCEDURE p(file varchar(4096)) BEGIN diff --git a/mysql-test/suite/engines/funcs/r/rpl_drop_db.result b/mysql-test/suite/engines/funcs/r/rpl_drop_db.result index 1b132c20afc..e5cf52a4f4e 100644 --- a/mysql-test/suite/engines/funcs/r/rpl_drop_db.result +++ b/mysql-test/suite/engines/funcs/r/rpl_drop_db.result @@ -1,7 +1,6 @@ include/master-slave.inc [connection master] connection master; -drop database if exists mysqltest1; create database mysqltest1; create table mysqltest1.t1 (n int); insert into mysqltest1.t1 values (1); diff --git a/mysql-test/suite/engines/funcs/t/ld_null.test b/mysql-test/suite/engines/funcs/t/ld_null.test index e01c473baf3..50cbce78044 100644 --- a/mysql-test/suite/engines/funcs/t/ld_null.test +++ b/mysql-test/suite/engines/funcs/t/ld_null.test @@ -3,9 +3,7 @@ DROP TABLE IF EXISTS t1; --enable_warnings CREATE TABLE t1 (c1 INTEGER NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 DATETIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_null.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; ---disable_cursor_protocol eval SELECT * INTO OUTFILE '../../tmp/t1.dat' FROM t1; ---enable_cursor_protocol SELECT * FROM t1 ORDER BY c1; TRUNCATE TABLE t1; --disable_query_log @@ -17,9 +15,7 @@ DROP TABLE t1; CREATE TABLE t1 (c1 INTEGER NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 DATETIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_null2.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' ESCAPED BY '\'' LINES TERMINATED BY '\n'; --disable_query_log ---disable_cursor_protocol eval SELECT * INTO OUTFILE '$MYSQLTEST_VARDIR/tmp/t1-2.dat' FIELDS ESCAPED BY '\'' FROM t1; ---enable_cursor_protocol --enable_query_log SELECT * FROM t1 ORDER BY c1; TRUNCATE TABLE t1; diff --git a/mysql-test/suite/federated/federatedx_create_handlers.test b/mysql-test/suite/federated/federatedx_create_handlers.test index 22a94759678..3b060d25c33 100644 --- a/mysql-test/suite/federated/federatedx_create_handlers.test +++ b/mysql-test/suite/federated/federatedx_create_handlers.test @@ -173,9 +173,7 @@ select * from federated.t4; select name into @var from federated.t1 where id=3 limit 1 ; select @var; ---disable_ps2_protocol select name into outfile 'tmp.txt' from federated.t1; ---enable_ps2_protocol let $path=`select concat(@@datadir, 'test/tmp.txt')`; remove_file $path; diff --git a/mysql-test/suite/funcs_1/r/row_count_func.result b/mysql-test/suite/funcs_1/r/row_count_func.result index ffc0e8e3b77..d78e807732a 100644 --- a/mysql-test/suite/funcs_1/r/row_count_func.result +++ b/mysql-test/suite/funcs_1/r/row_count_func.result @@ -3,7 +3,6 @@ # -- Test case for Bug#21818. # -- -DROP TABLE IF EXISTS t1; CREATE TABLE t1(a INT); INSERT INTO t1 VALUES (1), (2), (3); diff --git a/mysql-test/suite/funcs_1/t/is_basics_mixed.test b/mysql-test/suite/funcs_1/t/is_basics_mixed.test index 9f52d7644f4..0fea9dd351c 100644 --- a/mysql-test/suite/funcs_1/t/is_basics_mixed.test +++ b/mysql-test/suite/funcs_1/t/is_basics_mixed.test @@ -176,11 +176,9 @@ SELECT 1 AS my_col FROM information_schema.tables WHERE table_name = 't1_third'; # # SELECT INTO USER VARIABLE ---disable_cursor_protocol SELECT table_name,table_schema INTO @table_name,@table_schema FROM information_schema.tables WHERE table_schema = 'db_datadict' ORDER BY table_name LIMIT 1; ---enable_cursor_protocol SELECT @table_name,@table_schema; # # SELECT INTO OUTFILE @@ -188,16 +186,12 @@ let $OUTFILE = $MYSQLTEST_VARDIR/tmp/datadict.out; --error 0,1 remove_file $OUTFILE; --replace_result $OUTFILE ---disable_cursor_protocol ---disable_ps2_protocol eval SELECT table_name,table_schema INTO OUTFILE '$OUTFILE' FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\n' FROM information_schema.tables WHERE table_schema = 'db_datadict' ORDER BY table_name; ---enable_ps2_protocol ---enable_cursor_protocol cat_file $OUTFILE; remove_file $OUTFILE; # diff --git a/mysql-test/suite/funcs_1/t/row_count_func.test b/mysql-test/suite/funcs_1/t/row_count_func.test index 4c3466f7a13..351aee61044 100644 --- a/mysql-test/suite/funcs_1/t/row_count_func.test +++ b/mysql-test/suite/funcs_1/t/row_count_func.test @@ -4,10 +4,6 @@ --echo # -- --echo ---disable_warnings -DROP TABLE IF EXISTS t1; ---enable_warnings - CREATE TABLE t1(a INT); INSERT INTO t1 VALUES (1), (2), (3); @@ -18,11 +14,7 @@ INSERT INTO t1 VALUES (1), (2), (3); --enable_info --echo SELECT * FROM t1 INTO OUTFILE "MYSQL_TMP_DIR/bug21818.txt"; --disable_query_log # to avoid $MYSQL_TMP_DIR in query log ---disable_cursor_protocol ---disable_ps2_protocol --eval SELECT * FROM t1 INTO OUTFILE "$MYSQL_TMP_DIR/bug21818.txt" ---enable_ps2_protocol ---enable_cursor_protocol --enable_query_log --disable_info @@ -34,11 +26,9 @@ SELECT ROW_COUNT(); --echo --echo # -- Check 2. ---disable_cursor_protocol --enable_info SELECT a FROM t1 LIMIT 1 INTO @a; --disable_info ---enable_cursor_protocol --echo --disable_ps2_protocol diff --git a/mysql-test/suite/gcol/inc/gcol_ins_upd.inc b/mysql-test/suite/gcol/inc/gcol_ins_upd.inc index 7b6538a3085..68c0a0e30c9 100644 --- a/mysql-test/suite/gcol/inc/gcol_ins_upd.inc +++ b/mysql-test/suite/gcol/inc/gcol_ins_upd.inc @@ -626,11 +626,7 @@ CREATE TABLE t1 ( ); INSERT IGNORE INTO t1 (b) VALUES (b'101110001110100'),(b'011101'); ---disable_cursor_protocol ---disable_ps2_protocol SELECT pk, b INTO OUTFILE 'load.data' FROM t1; ---enable_ps2_protocol ---enable_cursor_protocol --error ER_DATA_TOO_LONG LOAD DATA INFILE 'load.data' REPLACE INTO TABLE t1 (pk, b); diff --git a/mysql-test/suite/gcol/inc/gcol_keys.inc b/mysql-test/suite/gcol/inc/gcol_keys.inc index 48c4b0695f4..9996d23e42e 100644 --- a/mysql-test/suite/gcol/inc/gcol_keys.inc +++ b/mysql-test/suite/gcol/inc/gcol_keys.inc @@ -782,11 +782,7 @@ CREATE TABLE t1 ( ); INSERT IGNORE INTO t1 (b) VALUES (b'101110001110100'),(b'011101'); ---disable_cursor_protocol ---disable_ps2_protocol SELECT pk, b INTO OUTFILE 'load.data' FROM t1; ---enable_ps2_protocol ---enable_cursor_protocol --error ER_DATA_TOO_LONG LOAD DATA INFILE 'load.data' REPLACE INTO TABLE t1 (pk, b); diff --git a/mysql-test/suite/gcol/t/gcol_bugfixes.test b/mysql-test/suite/gcol/t/gcol_bugfixes.test index 7ec4b3d4e35..c4beb69058a 100644 --- a/mysql-test/suite/gcol/t/gcol_bugfixes.test +++ b/mysql-test/suite/gcol/t/gcol_bugfixes.test @@ -674,11 +674,7 @@ DROP TABLE t1; CREATE TABLE t1 (id INT PRIMARY KEY, a VARCHAR(2333), va VARCHAR(171) AS (a)) ENGINE=InnoDB; INSERT INTO t1 (id,a) VALUES (1,REPEAT('x',200)); ---disable_cursor_protocol ---disable_ps2_protocol SELECT id, va INTO OUTFILE 'load_t1' FROM t1; ---enable_ps2_protocol ---enable_cursor_protocol --error ER_DATA_TOO_LONG LOAD DATA INFILE 'load_t1' REPLACE INTO TABLE t1 (id,va); SELECT * FROM t1; @@ -691,11 +687,7 @@ DROP TABLE t1; CREATE TABLE t1 (id BIGINT PRIMARY KEY, a VARCHAR(2333), va VARCHAR(171) AS (a)) ENGINE=InnoDB; INSERT INTO t1 (id,a) VALUES (1,REPEAT('x',200)); ---disable_cursor_protocol ---disable_ps2_protocol SELECT id, va INTO OUTFILE 'load_t1' FROM t1; ---enable_ps2_protocol ---enable_cursor_protocol --error ER_DATA_TOO_LONG LOAD DATA INFILE 'load_t1' REPLACE INTO TABLE t1 (id,va); SELECT * FROM t1; @@ -715,11 +707,7 @@ CREATE TABLE t1 (id INT PRIMARY KEY, ts TIMESTAMP DEFAULT '1971-01-01 00:00:00', c VARBINARY(8) DEFAULT '', vc VARCHAR(3) AS (c) STORED); INSERT IGNORE INTO t1 (id,c) VALUES (1,'foobar'); ---disable_cursor_protocol ---disable_ps2_protocol SELECT id, ts, vc INTO OUTFILE 'load_t1' FROM t1; ---enable_ps2_protocol ---enable_cursor_protocol --error 0,ER_DATA_TOO_LONG LOAD DATA INFILE 'load_t1' REPLACE INTO TABLE t1 (id, ts, vc); INSERT IGNORE INTO t1 (id) VALUES (2); diff --git a/mysql-test/suite/innodb/t/insert_into_empty.test b/mysql-test/suite/innodb/t/insert_into_empty.test index f12c9726509..0473f36f6e2 100644 --- a/mysql-test/suite/innodb/t/insert_into_empty.test +++ b/mysql-test/suite/innodb/t/insert_into_empty.test @@ -560,11 +560,7 @@ DROP TABLE t; --echo # CREATE TABLE t (id INT) ENGINE=InnoDB; --replace_result $MYSQLTEST_VARDIR VARDIR ---disable_cursor_protocol ---disable_ps2_protocol eval select 1 into outfile "$MYSQLTEST_VARDIR/tmp/t.outfile"; ---enable_ps2_protocol ---enable_cursor_protocol BEGIN; --replace_result $MYSQLTEST_VARDIR VARDIR eval LOAD DATA INFILE '$MYSQLTEST_VARDIR/tmp/t.outfile' INTO TABLE t; diff --git a/mysql-test/suite/innodb/t/instant_alter_bugs.test b/mysql-test/suite/innodb/t/instant_alter_bugs.test index b10148d4018..47b4fe7581a 100644 --- a/mysql-test/suite/innodb/t/instant_alter_bugs.test +++ b/mysql-test/suite/innodb/t/instant_alter_bugs.test @@ -130,11 +130,7 @@ INSERT INTO t1 (f1,f2,f3,f4,f5,f6,f7,f8) VALUES INSERT INTO t1 (f1,f2,f3,f4,f5,f6,f7,f8) VALUES ('impact', 'b', 'h', 185, 'fj', 7, 7, 3); ALTER TABLE t1 ADD COLUMN filler VARCHAR(255) DEFAULT ''; ---disable_cursor_protocol ---disable_ps2_protocol SELECT * INTO OUTFILE 'load.data' FROM t1; ---enable_ps2_protocol ---enable_cursor_protocol UPDATE IGNORE t1 SET pk = 0; LOAD DATA INFILE 'load.data' REPLACE INTO TABLE t1; HANDLER t1 OPEN AS h; diff --git a/mysql-test/suite/innodb/t/temp_table_savepoint.test b/mysql-test/suite/innodb/t/temp_table_savepoint.test index 9960961bb7b..260d5df35a8 100644 --- a/mysql-test/suite/innodb/t/temp_table_savepoint.test +++ b/mysql-test/suite/innodb/t/temp_table_savepoint.test @@ -142,12 +142,7 @@ update ignore t5 set c1 = 20 where c1 = 140 ; select count(*) from t5 where c1 = 140; --replace_result $MYSQLTEST_VARDIR VARDIR ---disable_cursor_protocol ---disable_ps2_protocol eval select * into outfile "$MYSQLTEST_VARDIR/tmp/t5.outfile" from t5; ---enable_ps2_protocol ---enable_cursor_protocol - create temporary table temp_1 engine = innodb as select * from t5 where 1=2; select count(*) from temp_1; diff --git a/mysql-test/suite/period/t/overlaps.test b/mysql-test/suite/period/t/overlaps.test index aadd4cc7e65..5325e4872b3 100644 --- a/mysql-test/suite/period/t/overlaps.test +++ b/mysql-test/suite/period/t/overlaps.test @@ -264,22 +264,14 @@ insert into t values (1, '2020-03-03', '2020-03-10') on duplicate key update x = 2; select * from t; ---disable_cursor_protocol ---disable_ps2_protocol select * into outfile 'tmp_t.txt' from t; ---enable_ps2_protocol ---enable_cursor_protocol load data infile 'tmp_t.txt' into table t; --error ER_NOT_SUPPORTED_YET load data infile 'tmp_t.txt' replace into table t; remove_file $MYSQLD_DATADIR/test/tmp_t.txt; insert into t values (1, '2020-03-01', '2020-03-05'); ---disable_cursor_protocol ---disable_ps2_protocol select * into outfile 'tmp_t.txt' from t; ---enable_ps2_protocol ---enable_cursor_protocol --error ER_DUP_ENTRY load data infile 'tmp_t.txt' into table t; diff --git a/mysql-test/suite/rpl/r/rpl_drop_db.result b/mysql-test/suite/rpl/r/rpl_drop_db.result index 1b132c20afc..e5cf52a4f4e 100644 --- a/mysql-test/suite/rpl/r/rpl_drop_db.result +++ b/mysql-test/suite/rpl/r/rpl_drop_db.result @@ -1,7 +1,6 @@ include/master-slave.inc [connection master] connection master; -drop database if exists mysqltest1; create database mysqltest1; create table mysqltest1.t1 (n int); insert into mysqltest1.t1 values (1); diff --git a/mysql-test/suite/rpl/r/rpl_loaddata_map.result b/mysql-test/suite/rpl/r/rpl_loaddata_map.result index cc67c8d4660..65553c405c4 100644 --- a/mysql-test/suite/rpl/r/rpl_loaddata_map.result +++ b/mysql-test/suite/rpl/r/rpl_loaddata_map.result @@ -1,6 +1,11 @@ include/master-slave.inc [connection master] ==== Create a big file ==== +SET @@sql_log_bin= 0; +create table t1 (id int not null primary key auto_increment); +select * into outfile '$MYSQLTEST_VARDIR/tmp/bug30435_5k.txt' from t1; +DROP TABLE t1; +SET @@sql_log_bin= 1; ==== Load our big file into a table ==== create table t2 (id int not null primary key auto_increment); select @@session.read_buffer_size - @@session.max_allowed_packet > 0 ; diff --git a/mysql-test/suite/rpl/r/rpl_loadfile.result b/mysql-test/suite/rpl/r/rpl_loadfile.result index 2afe510ddeb..3c9cabeb497 100644 --- a/mysql-test/suite/rpl/r/rpl_loadfile.result +++ b/mysql-test/suite/rpl/r/rpl_loadfile.result @@ -229,7 +229,6 @@ connection slave; include/rpl_reset.inc connection master; SELECT repeat('x',20) INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/bug_39701.data'; -DROP TABLE IF EXISTS t1; CREATE TABLE t1 (t text); CREATE PROCEDURE p(file varchar(4096)) BEGIN diff --git a/mysql-test/suite/rpl/t/rpl_binlog_errors.test b/mysql-test/suite/rpl/t/rpl_binlog_errors.test index ae4b0884228..a357cce8373 100644 --- a/mysql-test/suite/rpl/t/rpl_binlog_errors.test +++ b/mysql-test/suite/rpl/t/rpl_binlog_errors.test @@ -58,11 +58,7 @@ SET @old_debug= @@global.debug_dbug; -- let $load_file= $MYSQLTEST_VARDIR/tmp/bug_46166.data -- let $MYSQLD_DATADIR= `select @@datadir` -- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR ---disable_cursor_protocol ---disable_ps2_protocol -- eval SELECT repeat('x',8192) INTO OUTFILE '$load_file' ---enable_ps2_protocol ---enable_cursor_protocol ### ACTION: create a small file (< 4096 bytes) that will be later used ### in LOAD DATA INFILE to check for absence of binlog errors @@ -71,11 +67,7 @@ SET @old_debug= @@global.debug_dbug; -- let $load_file2= $MYSQLTEST_VARDIR/tmp/bug_46166-2.data -- let $MYSQLD_DATADIR= `select @@datadir` -- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR ---disable_cursor_protocol ---disable_ps2_protocol -- eval SELECT repeat('x',10) INTO OUTFILE '$load_file2' ---enable_ps2_protocol ---enable_cursor_protocol RESET MASTER; diff --git a/mysql-test/suite/rpl/t/rpl_drop_db.test b/mysql-test/suite/rpl/t/rpl_drop_db.test index ef918842d4e..676794e090c 100644 --- a/mysql-test/suite/rpl/t/rpl_drop_db.test +++ b/mysql-test/suite/rpl/t/rpl_drop_db.test @@ -4,19 +4,12 @@ -- source include/master-slave.inc connection master; ---disable_warnings -drop database if exists mysqltest1; ---enable_warnings create database mysqltest1; create table mysqltest1.t1 (n int); insert into mysqltest1.t1 values (1); ---disable_cursor_protocol --enable_prepare_warnings ---disable_ps2_protocol select * from mysqltest1.t1 into outfile 'mysqltest1/f1.txt'; --disable_prepare_warnings ---enable_ps2_protocol ---enable_cursor_protocol create table mysqltest1.t2 (n int); create table mysqltest1.t3 (n int); --replace_result \\ / 66 39 93 39 17 39 247 39 41 39 "File exists" "Directory not empty" diff --git a/mysql-test/suite/rpl/t/rpl_loaddata_local.test b/mysql-test/suite/rpl/t/rpl_loaddata_local.test index 975bd110739..bdeacc522c9 100644 --- a/mysql-test/suite/rpl/t/rpl_loaddata_local.test +++ b/mysql-test/suite/rpl/t/rpl_loaddata_local.test @@ -27,11 +27,7 @@ set SQL_LOG_BIN=1; enable_query_log; let $MYSQLD_DATADIR= `select @@datadir`; --replace_result $MYSQLD_DATADIR MYSQLD_DATADIR ---disable_cursor_protocol ---disable_ps2_protocol eval select * into outfile '$MYSQLD_DATADIR/rpl_loaddatalocal.select_outfile' from t1; ---enable_ps2_protocol ---enable_cursor_protocol #This will generate a 20KB file, now test LOAD DATA LOCAL truncate table t1; --replace_result $MYSQLD_DATADIR MYSQLD_DATADIR @@ -54,11 +50,7 @@ connection master; create table t1(a int); insert into t1 values (1), (2), (2), (3); --replace_result $MYSQLD_DATADIR MYSQLD_DATADIR ---disable_cursor_protocol ---disable_ps2_protocol eval select * into outfile '$MYSQLD_DATADIR/rpl_loaddatalocal.select_outfile' from t1; ---enable_ps2_protocol ---enable_cursor_protocol drop table t1; create table t1(a int primary key); --replace_result $MYSQLD_DATADIR MYSQLD_DATADIR @@ -87,11 +79,7 @@ SET sql_mode='ignore_space'; CREATE TABLE t1(a int); insert into t1 values (1), (2), (3), (4); --replace_result $MYSQLD_DATADIR MYSQLD_DATADIR ---disable_cursor_protocol ---disable_ps2_protocol eval select * into outfile '$MYSQLD_DATADIR/rpl_loaddatalocal.select_outfile' from t1; ---enable_ps2_protocol ---enable_cursor_protocol truncate table t1; --replace_result $MYSQLD_DATADIR MYSQLD_DATADIR eval load data local infile '$MYSQLD_DATADIR/rpl_loaddatalocal.select_outfile' into table t1; @@ -125,11 +113,7 @@ CREATE TABLE t1(a int); INSERT INTO t1 VALUES (1), (2), (3), (4); --replace_result $MYSQLD_DATADIR MYSQLD_DATADIR ---disable_cursor_protocol ---disable_ps2_protocol eval SELECT * INTO OUTFILE '$MYSQLD_DATADIR/bug43746.sql' FROM t1; ---enable_ps2_protocol ---enable_cursor_protocol TRUNCATE TABLE t1; --replace_result $MYSQLD_DATADIR MYSQLD_DATADIR @@ -177,11 +161,7 @@ sync_slave_with_master; connection master; --replace_result $MYSQLD_DATADIR MYSQLD_DATADIR ---disable_cursor_protocol ---disable_ps2_protocol eval SELECT * INTO OUTFILE '$MYSQLD_DATADIR/bug59267.sql' FROM t1; ---enable_ps2_protocol ---enable_cursor_protocol TRUNCATE TABLE t1; --replace_result $MYSQLD_DATADIR MYSQLD_DATADIR @@ -226,11 +206,7 @@ CREATE VIEW v1 AS SELECT * FROM t2 WHERE f1 IN (SELECT f1 FROM t3 WHERE (t3.f2 IS NULL)); --replace_result $MYSQLD_DATADIR MYSQLD_DATADIR ---disable_cursor_protocol ---disable_ps2_protocol eval SELECT 1 INTO OUTFILE '$MYSQLD_DATADIR/bug60580.csv' FROM DUAL; ---enable_ps2_protocol ---enable_cursor_protocol --replace_result $MYSQLD_DATADIR MYSQLD_DATADIR eval LOAD DATA LOCAL INFILE '$MYSQLD_DATADIR/bug60580.csv' INTO TABLE t1 (@f1) SET f2 = (SELECT f1 FROM v1 WHERE f1=@f1); diff --git a/mysql-test/suite/rpl/t/rpl_loaddata_map.test b/mysql-test/suite/rpl/t/rpl_loaddata_map.test index 24477fa0230..4ba4af5f2fb 100644 --- a/mysql-test/suite/rpl/t/rpl_loaddata_map.test +++ b/mysql-test/suite/rpl/t/rpl_loaddata_map.test @@ -26,26 +26,22 @@ source include/master-slave.inc; # just an auxiliary construction anyways, it is not needed on the # slave. ---disable_query_log SET @@sql_log_bin= 0; -let $rows= 5000; create table t1 (id int not null primary key auto_increment); +--disable_query_log +let $rows= 5000; while($rows) { eval insert into t1 values (null); dec $rows; } ---disable_cursor_protocol ---disable_ps2_protocol -eval select * into outfile '$MYSQLTEST_VARDIR/tmp/bug30435_5k.txt' from t1; ---enable_ps2_protocol ---enable_cursor_protocol +--enable_query_log +evalp select * into outfile '$MYSQLTEST_VARDIR/tmp/bug30435_5k.txt' from t1; DROP TABLE t1; SET @@sql_log_bin= 1; ---enable_query_log --echo ==== Load our big file into a table ==== diff --git a/mysql-test/suite/rpl/t/rpl_loadfile.test b/mysql-test/suite/rpl/t/rpl_loadfile.test index edb72dc9925..eb6d65f4686 100644 --- a/mysql-test/suite/rpl/t/rpl_loadfile.test +++ b/mysql-test/suite/rpl/t/rpl_loadfile.test @@ -69,15 +69,7 @@ connection master; let $file= $MYSQLTEST_VARDIR/tmp/bug_39701.data; --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR ---disable_cursor_protocol ---disable_ps2_protocol --eval SELECT repeat('x',20) INTO OUTFILE '$file' ---enable_ps2_protocol ---enable_cursor_protocol - -disable_warnings; -DROP TABLE IF EXISTS t1; -enable_warnings; CREATE TABLE t1 (t text); DELIMITER |; diff --git a/mysql-test/suite/rpl/t/rpl_misc_functions.test b/mysql-test/suite/rpl/t/rpl_misc_functions.test index be55a208c3e..974fd9a16d1 100644 --- a/mysql-test/suite/rpl/t/rpl_misc_functions.test +++ b/mysql-test/suite/rpl/t/rpl_misc_functions.test @@ -26,11 +26,7 @@ insert into t1 values(3, 0, 0, 0, password('does_this_work?')); --disable_warnings insert into t1 values(4, connection_id(), rand()*1000, rand()*1000, password('does_this_still_work?')); --enable_warnings ---disable_cursor_protocol ---disable_ps2_protocol select * into outfile 'rpl_misc_functions.outfile' from t1; ---enable_ps2_protocol ---enable_cursor_protocol let $MYSQLD_DATADIR= `select @@datadir`; sync_slave_with_master; create temporary table t2 like t1; @@ -95,12 +91,8 @@ INSERT INTO t1 (col_a) VALUES (test_replication_sf()); --enable_prepare_warnings # Dump table on slave ---disable_cursor_protocol ---disable_ps2_protocol select * from t1 into outfile "../../tmp/t1_slave.txt"; --disable_prepare_warnings ---enable_ps2_protocol ---enable_cursor_protocol # Load data from slave into temp table on master connection master; diff --git a/mysql-test/suite/sys_vars/t/secure_file_priv.test b/mysql-test/suite/sys_vars/t/secure_file_priv.test index 395bdaed343..bbbf01aae89 100644 --- a/mysql-test/suite/sys_vars/t/secure_file_priv.test +++ b/mysql-test/suite/sys_vars/t/secure_file_priv.test @@ -26,9 +26,7 @@ my $protected_file= dirname($ENV{MYSQLTEST_VARDIR}).'/bug50373.txt'; # test runs). unlink $protected_file; open(FILE, ">", "$ENV{MYSQL_TMP_DIR}/bug50373.inc") or die; -print FILE "--disable_ps2_protocol\n"; print FILE "SELECT * FROM t1 INTO OUTFILE '".$protected_file."';\n"; -print FILE "--enable_ps2_protocol\n"; print FILE "DELETE FROM t1;\n"; print FILE "LOAD DATA INFILE '".$protected_file."' INTO TABLE t1;\n"; print FILE "SELECT * FROM t1;\n"; diff --git a/mysql-test/suite/vcol/t/load_data.test b/mysql-test/suite/vcol/t/load_data.test index be247d106b9..f4b3b60397e 100644 --- a/mysql-test/suite/vcol/t/load_data.test +++ b/mysql-test/suite/vcol/t/load_data.test @@ -5,11 +5,7 @@ create table t1 ( c1 varchar(10), c2 varchar(10), c3 int ); insert into t1 values ("a" , "b", 1), ("a" , "b", 2); create table t2 like t1 ; alter table t2 add column c4 bigint unsigned as (CONV(LEFT(MD5(concat(c1,c2,c3)), 16), 16, 10)) persistent unique key; ---disable_cursor_protocol ---disable_ps2_protocol select * into outfile 't1.csv' from t1; ---enable_ps2_protocol ---enable_cursor_protocol load data infile 't1.csv' ignore into table t2 ; select * from t2; insert into t2 (c1,c2,c3) values ("a" , "b", 4); diff --git a/mysql-test/suite/vcol/t/vcol_keys_myisam.test b/mysql-test/suite/vcol/t/vcol_keys_myisam.test index e9207d3bcdd..223da482423 100644 --- a/mysql-test/suite/vcol/t/vcol_keys_myisam.test +++ b/mysql-test/suite/vcol/t/vcol_keys_myisam.test @@ -281,11 +281,7 @@ drop table t1; CREATE TABLE t1 (i INT, d1 DATE, d2 DATE NOT NULL, t TIMESTAMP, KEY(t)) ENGINE=MyISAM; INSERT INTO t1 VALUES (1,'2023-03-16','2023-03-15','2012-12-12 12:12:12'); ALTER TABLE t1 MODIFY t FLOAT AS (i) PERSISTENT; ---disable_cursor_protocol ---disable_ps2_protocol SELECT i, d1, d2 INTO OUTFILE 'load_t1' FROM t1; ---enable_ps2_protocol ---enable_cursor_protocol DELETE FROM t1; LOAD DATA INFILE 'load_t1' INTO TABLE t1 (i,d1,d2); SELECT * FROM t1 WHERE d2 < d1; diff --git a/mysql-test/suite/versioning/t/foreign.test b/mysql-test/suite/versioning/t/foreign.test index a69f9df739b..f1eab39875a 100644 --- a/mysql-test/suite/versioning/t/foreign.test +++ b/mysql-test/suite/versioning/t/foreign.test @@ -401,27 +401,15 @@ INSERT INTO t2 VALUES (1,'against'),(2,'q'); SET SQL_MODE= ''; SET timestamp = 2; ---disable_cursor_protocol ---disable_ps2_protocol SELECT * INTO OUTFILE 't1.data' FROM t1; ---enable_ps2_protocol ---enable_cursor_protocol SET timestamp = 3; UPDATE t1 SET f13 = 'q'; SET timestamp = 4; LOAD DATA INFILE 't1.data' REPLACE INTO TABLE t1; ---disable_cursor_protocol ---disable_ps2_protocol SELECT * INTO OUTFILE 't1.data.2' FROM t1; ---enable_ps2_protocol ---enable_cursor_protocol SET timestamp = 5; LOAD DATA INFILE 't1.data.2' REPLACE INTO TABLE t1; ---disable_cursor_protocol ---disable_ps2_protocol SELECT * INTO OUTFILE 't2.data' FROM t2; ---enable_ps2_protocol ---enable_cursor_protocol SET timestamp = 6; LOAD DATA INFILE 't2.data' REPLACE INTO TABLE t2; SET FOREIGN_KEY_CHECKS = OFF; @@ -564,11 +552,7 @@ delete from t0; --error ER_ROW_IS_REFERENCED_2 replace t0 values (1); ---disable_cursor_protocol ---disable_ps2_protocol select * into outfile 'load_t0' from t0 ; ---enable_ps2_protocol ---enable_cursor_protocol --error ER_ROW_IS_REFERENCED_2 load data infile 'load_t0' replace into table t0; diff --git a/mysql-test/suite/versioning/t/insert.test b/mysql-test/suite/versioning/t/insert.test index 1a8e8981065..fe430b8e3b6 100644 --- a/mysql-test/suite/versioning/t/insert.test +++ b/mysql-test/suite/versioning/t/insert.test @@ -196,11 +196,7 @@ replace into t3 values (0, '1980-01-01 00:00:00', '1981-01-01 00:00:00'); --echo # LOAD DATA --let DATAFILE= $MYSQLTEST_VARDIR/tmp/test_versioning_t3.data --replace_result $DATAFILE DATAFILE ---disable_cursor_protocol ---disable_ps2_protocol eval select x, row_start, row_end into outfile '$DATAFILE' from t1 for system_time all; ---enable_ps2_protocol ---enable_cursor_protocol create or replace table t2 like t1; --replace_result $default_engine DEFAULT_ENGINE show create table t2; @@ -257,11 +253,7 @@ set sql_mode='STRICT_ALL_TABLES'; create or replace table t1 (a int) with system versioning; set system_versioning_insert_history= on; insert into t1 (a,row_start,row_end) values (1,'2022-01-01','2023-01-01'),(1,'2022-01-01','2023-01-01'); ---disable_cursor_protocol ---disable_ps2_protocol select a,row_start,row_end into outfile 'mdev29813.txt' from t1 for system_time all; ---enable_ps2_protocol ---enable_cursor_protocol create or replace table t1 (a int primary key) with system versioning; load data infile 'mdev29813.txt' ignore into table t1 (a,row_start,row_end); diff --git a/mysql-test/suite/versioning/t/partition.test b/mysql-test/suite/versioning/t/partition.test index abf72508698..c5213734d0c 100644 --- a/mysql-test/suite/versioning/t/partition.test +++ b/mysql-test/suite/versioning/t/partition.test @@ -1020,16 +1020,12 @@ create or replace table t1 ( insert into t1 () values (),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(); ---disable_cursor_protocol ---disable_ps2_protocol select * into outfile 'MDEV-17891.data' from t1; ---enable_ps2_protocol load data infile 'MDEV-17891.data' replace into table t1; --error ER_RECORD_FILE_FULL load data infile 'MDEV-17891.data' replace into table t1; --error ER_RECORD_FILE_FULL load data infile 'MDEV-17891.data' replace into table t1; ---enable_cursor_protocol # Cleanup --remove_file $datadir/test/MDEV-17891.data @@ -1370,11 +1366,7 @@ partition by system_time limit 100 ( partition pn current); insert into t1 select seq from seq_0_to_49; ---disable_cursor_protocol ---disable_ps2_protocol select x into outfile 'MDEV-20077.data' from t1; ---enable_ps2_protocol ---enable_cursor_protocol load data infile 'MDEV-20077.data' replace into table t1 (x); load data infile 'MDEV-20077.data' replace into table t1 (x); @@ -2213,11 +2205,7 @@ create or replace table t1 (x int primary key) with system versioning partition by system_time interval 1 hour auto; insert t1 values (1), (2), (3); ---disable_cursor_protocol ---disable_ps2_protocol select x into outfile 'MDEV-17554.data' from t1; ---enable_ps2_protocol ---enable_cursor_protocol set timestamp= unix_timestamp('2000-01-01 01:00:00'); load data infile 'MDEV-17554.data' replace into table t1 (x); diff --git a/mysql-test/suite/versioning/t/replace.test b/mysql-test/suite/versioning/t/replace.test index c10b6aa443d..abae4f3d3cb 100644 --- a/mysql-test/suite/versioning/t/replace.test +++ b/mysql-test/suite/versioning/t/replace.test @@ -93,11 +93,7 @@ if ($default_engine == MEMORY) create table t1 (a int, b int, c int, vc int as (c), unique(a), unique(b)) with system versioning; insert ignore into t1 (a,b,c) values (1,2,3); ---disable_cursor_protocol ---disable_ps2_protocol select a, b, c into outfile '15330.data' from t1; ---enable_ps2_protocol ---enable_cursor_protocol load data infile '15330.data' ignore into table t1 (a,b,c); load data infile '15330.data' replace into table t1 (a,b,c); --let $datadir=`select @@datadir` diff --git a/mysql-test/suite/versioning/t/rpl.test b/mysql-test/suite/versioning/t/rpl.test index 48c6f3ffbcf..38cc5b51014 100644 --- a/mysql-test/suite/versioning/t/rpl.test +++ b/mysql-test/suite/versioning/t/rpl.test @@ -414,11 +414,7 @@ select row_start = '1980-01-01 00:00:00', row_end = '1980-01-01 00:00:01' from t connection master; --let DATAFILE= $MYSQLTEST_VARDIR/tmp/test_versioning_t3.data --replace_result $DATAFILE DATAFILE ---disable_cursor_protocol ---disable_ps2_protocol eval select x, row_start, row_end into outfile '$DATAFILE' from t1 for system_time all; ---enable_ps2_protocol ---enable_cursor_protocol create or replace table t3 like t1; set @@system_versioning_insert_history= 1; --replace_result $DATAFILE DATAFILE