summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/include/mysqltest_while.inc137
-rw-r--r--mysql-test/include/windows.inc4
-rw-r--r--mysql-test/lib/mtr_process.pl6
-rwxr-xr-xmysql-test/mysql-test-run.pl5
-rw-r--r--mysql-test/mysql-test-run.sh1
-rw-r--r--mysql-test/r/func_gconcat.result3
-rw-r--r--mysql-test/r/grant2.result9
-rw-r--r--mysql-test/r/lowercase_table.result6
-rw-r--r--mysql-test/r/mysqltest.result223
-rw-r--r--mysql-test/r/ndb_index_ordered.result6
-rw-r--r--mysql-test/r/rpl_flush_log_loop.result2
-rw-r--r--mysql-test/r/type_newdecimal.result2
-rw-r--r--mysql-test/r/windows.result8
-rw-r--r--mysql-test/t/create.test2
-rw-r--r--mysql-test/t/create_select_tmp.test16
-rw-r--r--mysql-test/t/drop.test10
-rw-r--r--mysql-test/t/flush_read_lock_kill.test2
-rw-r--r--mysql-test/t/func_gconcat.test5
-rw-r--r--mysql-test/t/grant2.test43
-rw-r--r--mysql-test/t/handler.test18
-rw-r--r--mysql-test/t/information_schema.test2
-rw-r--r--mysql-test/t/innodb-deadlock.test6
-rw-r--r--mysql-test/t/innodb-lock.test2
-rw-r--r--mysql-test/t/innodb.test2
-rw-r--r--mysql-test/t/kill.test2
-rw-r--r--mysql-test/t/lowercase_table.test10
-rw-r--r--mysql-test/t/mysqltest.test531
-rw-r--r--mysql-test/t/ndb_autodiscover2.test2
-rw-r--r--mysql-test/t/ndb_index_ordered.test6
-rw-r--r--mysql-test/t/rpl000001.test2
-rw-r--r--mysql-test/t/rpl000009.test2
-rw-r--r--mysql-test/t/rpl_EE_error.test2
-rw-r--r--mysql-test/t/rpl_change_master.test2
-rw-r--r--mysql-test/t/rpl_deadlock.test6
-rw-r--r--mysql-test/t/rpl_drop.test2
-rw-r--r--mysql-test/t/rpl_drop_temp.test2
-rw-r--r--mysql-test/t/rpl_error_ignored_table.test4
-rw-r--r--mysql-test/t/rpl_flush_log_loop.test4
-rw-r--r--mysql-test/t/rpl_insert_id.test2
-rw-r--r--mysql-test/t/rpl_loaddata.test4
-rw-r--r--mysql-test/t/rpl_rotate_logs.test2
-rw-r--r--mysql-test/t/rpl_slave_status.test2
-rw-r--r--mysql-test/t/rpl_sp.test12
-rw-r--r--mysql-test/t/sp.test8
-rw-r--r--mysql-test/t/strict.test4
-rw-r--r--mysql-test/t/system_mysql_db_fix.test2
-rw-r--r--mysql-test/t/type_newdecimal.test2
-rw-r--r--mysql-test/t/view.test2
-rw-r--r--mysql-test/t/windows.test20
49 files changed, 1061 insertions, 96 deletions
diff --git a/mysql-test/include/mysqltest_while.inc b/mysql-test/include/mysqltest_while.inc
new file mode 100644
index 00000000000..90b05ee2695
--- /dev/null
+++ b/mysql-test/include/mysqltest_while.inc
@@ -0,0 +1,137 @@
+let $1 = 10;
+while ($1)
+{
+while ($1)
+{
+while ($1)
+{
+ while ($1)
+{
+ while ($1)
+{
+ while ($1)
+{
+ while ($1)
+{
+ while ($1)
+{
+ while ($1)
+{
+ while ($1)
+{
+ while ($1)
+{
+ while ($1)
+{
+ while ($1)
+{
+ while ($1)
+{
+ while ($1)
+{
+ while ($1)
+{
+ while ($1)
+{
+ while ($1)
+{
+ while ($1)
+{
+ while ($1)
+{
+ while ($1)
+{
+ while ($1)
+{
+ while ($1)
+{
+ while ($1)
+{
+ while ($1)
+{
+ while ($1)
+{
+ while ($1)
+{
+ while ($1)
+{
+ while ($1)
+{
+ while ($1)
+{
+ while ($1)
+{
+ while ($1)
+{
+ while ($1)
+{
+ while ($1)
+{
+ while ($1)
+{
+ while ($1)
+{
+ while ($1)
+{
+ while ($1)
+{
+ while ($1)
+{
+ while ($1)
+{
+ while ($1)
+{
+ while ($1)
+{
+ while ($1)
+{
+ while ($1)
+{
+ while ($1)
+{
+ while ($1)
+{
+ while ($1)
+{
+ while ($1)
+{
+ while ($1)
+{
+ echo $1;
+ dec $1;
+}
+}
+}
+}
+}
+}
+}
+}
+}
+}
+}
+}
+}
+}
+}
+}
+}
+}
+}
+}
+}
+}
+}
+}
+}
+}
+}
+}
+}
+}
+}
+}
+}
+}
+}
+}
diff --git a/mysql-test/include/windows.inc b/mysql-test/include/windows.inc
new file mode 100644
index 00000000000..05ec7b0e021
--- /dev/null
+++ b/mysql-test/include/windows.inc
@@ -0,0 +1,4 @@
+--require r/true.require
+disable_query_log;
+select convert(@@version_compile_os using latin1) IN ("Win32","Win64","Windows") as "TRUE";
+enable_query_log;
diff --git a/mysql-test/lib/mtr_process.pl b/mysql-test/lib/mtr_process.pl
index 1b6dcf0e7fc..d3b652186dd 100644
--- a/mysql-test/lib/mtr_process.pl
+++ b/mysql-test/lib/mtr_process.pl
@@ -183,7 +183,7 @@ sub spawn_impl ($$$$$$$$) {
{
if ( ! open(STDERR,$log_file_open_mode,$error) )
{
- mtr_error("can't redirect STDERR to \"$output\": $!");
+ mtr_error("can't redirect STDERR to \"$error\": $!");
}
}
}
@@ -560,8 +560,8 @@ sub mtr_stop_mysqld_servers ($) {
start_reap_all(); # Avoid zombies
- SIGNAL:
- mtr_kill_processes(\keys (%mysqld_pids));
+ my @mysqld_pids= keys %mysqld_pids;
+ mtr_kill_processes(\@mysqld_pids);
stop_reap_all(); # Get into control again
diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl
index 1e7a58cfd99..09d15f79198 100755
--- a/mysql-test/mysql-test-run.pl
+++ b/mysql-test/mysql-test-run.pl
@@ -2484,6 +2484,11 @@ sub run_mysqltest ($) {
mysqld_arguments($args,'master',0,$tinfo->{'master_opt'},[]);
}
+ # ----------------------------------------------------------------------
+ # export MYSQL_TEST variable containing <path>/mysqltest <args>
+ # ----------------------------------------------------------------------
+ $ENV{'MYSQL_TEST'}= "$exe_mysqltest " . join(" ", @$args);
+
return mtr_run_test($exe,$args,$tinfo->{'path'},"",$path_timefile,"");
}
diff --git a/mysql-test/mysql-test-run.sh b/mysql-test/mysql-test-run.sh
index 5528f2b8a42..ba9a710390f 100644
--- a/mysql-test/mysql-test-run.sh
+++ b/mysql-test/mysql-test-run.sh
@@ -733,6 +733,7 @@ if [ x$USE_TIMER = x1 ] ; then
fi
MYSQL_TEST_BIN=$MYSQL_TEST
MYSQL_TEST="$MYSQL_TEST $MYSQL_TEST_ARGS"
+export MYSQL_TEST
GDB_CLIENT_INIT=$MYSQL_TMP_DIR/gdbinit.client
GDB_MASTER_INIT=$MYSQL_TMP_DIR/gdbinit.master
GDB_SLAVE_INIT=$MYSQL_TMP_DIR/gdbinit.slave
diff --git a/mysql-test/r/func_gconcat.result b/mysql-test/r/func_gconcat.result
index 184bd07b066..7235fded66a 100644
--- a/mysql-test/r/func_gconcat.result
+++ b/mysql-test/r/func_gconcat.result
@@ -555,3 +555,6 @@ FROM t1 JOIN t2 ON t1.bID = t2.bID;
COUNT(*) GROUP_CONCAT(DISTINCT t2.somename SEPARATOR ' |')
2 test
DROP TABLE t1,t2;
+select * from (select group_concat('c') from DUAL) t;
+group_concat('c')
+NULL
diff --git a/mysql-test/r/grant2.result b/mysql-test/r/grant2.result
index 7ac10de1f7c..ca375ef5057 100644
--- a/mysql-test/r/grant2.result
+++ b/mysql-test/r/grant2.result
@@ -312,3 +312,12 @@ flush privileges;
drop database mysqltest_1;
set password = password("changed");
ERROR 42000: Access denied for user ''@'localhost' to database 'mysql'
+lock table mysql.user write;
+ flush privileges;
+ grant all on *.* to 'mysqltest_1'@'localhost';
+unlock tables;
+lock table mysql.user write;
+ set password for 'mysqltest_1'@'localhost' = password('');
+ revoke all on *.* from 'mysqltest_1'@'localhost';
+unlock tables;
+drop user 'mysqltest_1'@'localhost';
diff --git a/mysql-test/r/lowercase_table.result b/mysql-test/r/lowercase_table.result
index c09750ed561..7705961d08d 100644
--- a/mysql-test/r/lowercase_table.result
+++ b/mysql-test/r/lowercase_table.result
@@ -84,9 +84,3 @@ create table t2 like T1;
drop table t1, t2;
show tables;
Tables_in_test
-use lpt1;
-ERROR 42000: Unknown database 'lpt1'
-use com1;
-ERROR 42000: Unknown database 'com1'
-use prn;
-ERROR 42000: Unknown database 'prn'
diff --git a/mysql-test/r/mysqltest.result b/mysql-test/r/mysqltest.result
index 256576704b5..1825e6f624f 100644
--- a/mysql-test/r/mysqltest.result
+++ b/mysql-test/r/mysqltest.result
@@ -7,18 +7,16 @@ otto
select otto from (select 1 as otto) as t1;
otto
1
+mysqltest: At line 1: query 'select friedrich from (select 1 as otto) as t1' failed: 1054: Unknown column 'friedrich' in 'field list'
select friedrich from (select 1 as otto) as t1;
ERROR 42S22: Unknown column 'friedrich' in 'field list'
select otto from (select 1 as otto) as t1;
otto
1
-select otto from (select 1 as otto) as t1;
-otto
-1
-select friedrich from (select 1 as otto) as t1;
-ERROR 42S22: Unknown column 'friedrich' in 'field list'
+mysqltest: At line 1: query 'select otto from (select 1 as otto) as t1' succeeded - should have failed with sqlstate 42S22...
select friedrich from (select 1 as otto) as t1;
ERROR 42S22: Unknown column 'friedrich' in 'field list'
+mysqltest: At line 1: query 'select friedrich from (select 1 as otto) as t1' failed with wrong sqlstate 42S22 instead of 00000...
select otto from (select 1 as otto) as t1;
otto
1
@@ -135,6 +133,8 @@ ERROR 42S02: Table 'test.t1' doesn't exist
select 1146 as "after_!errno_masked_error" ;
after_!errno_masked_error
1146
+mysqltest: At line 1: query 'select 3 from t1' failed with wrong errno 1146 instead of 1000...
+mysqltest: At line 1: query 'select 3 from t1' failed with wrong errno 1146 instead of 1000...
garbage ;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'garbage' at line 1
select 1064 as "after_--enable_abort_on_error" ;
@@ -142,6 +142,219 @@ after_--enable_abort_on_error
1064
select 3 from t1 ;
ERROR 42S02: Table 'test.t1' doesn't exist
+mysqltest: At line 1: query 'select 3 from t1' failed with wrong errno 1146 instead of 1064...
+mysqltest: At line 1: query 'select 3 from t1' failed: 1146: Table 'test.t1' doesn't exist
+hello
+hello
+;;;;;;;;
+# MySQL: -- The
+mysqltest: At line 1: End of line junk detected: "6"
+mysqltest: At line 1: End of line junk detected: "6"
+mysqltest: At line 1: Missing delimiter
+mysqltest: At line 1: Extra delimiter ";" found
+MySQL
+"MySQL"
+MySQL: The world''s most popular open source database
+"MySQL: The world's most popular open source database"
+MySQL: The world''s
+most popular open
+source database
+# MySQL: The world''s
+# most popular open
+# source database
+- MySQL: The world''s
+- most popular open
+- source database
+- MySQL: The world''s
+-- most popular open
+-- source database
+# MySQL: The
+--world''s
+# most popular
+-- open
+- source database
+"MySQL: The world's most popular; open source database"
+"MySQL: The world's most popular ; open source database"
+"MySQL: The world's most popular ;open source database"
+echo message echo message
+
+mysqltest: At line 1: Empty variable
+sh: -c: line 0: syntax error near unexpected token `;'
+sh: -c: line 0: `;'
+mysqltest: At line 1: command ";" failed
+mysqltest: At line 1: Missing argument in exec
+MySQL
+"MySQL"
+MySQL: The
+world''s most
+popular open
+source database
+# MySQL: The
+# world''s most
+# popular open
+# source database
+-- MySQL: The
+-- world''s most
+-- popular open
+-- source database
+# MySQL: The
+- world''s most
+-- popular open
+# source database
+'$message'
+"$message"
+hej
+hej
+hej
+1
+
+
+a long variable content
+a long variable content
+a long $where variable content
+
+mysqltest: At line 1: Missing arguments to let
+mysqltest: At line 1: Missing variable name in let
+mysqltest: At line 1: Variable name in hi=hi does not start with '$'
+mysqltest: At line 1: Missing assignment operator in let
+mysqltest: At line 1: Missing assignment operator in let
+mysqltest: At line 1: Missing arguments to let
+mysqltest: At line 1: Missing variable name in let
+mysqltest: At line 1: Variable name in =hi does not start with '$'
+mysqltest: At line 1: Missing assignment operator in let
+mysqltest: At line 1: Missing file name in source
+mysqltest: At line 1: Could not open file ./non_existingFile
+mysqltest: In included file "./var/tmp/recursive.sql": At line 1: Source directives are nesting too deep
+mysqltest: In included file "./var/tmp/error.sql": At line 1: query 'garbage ' failed: 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'garbage' at line 1
+
+2 = outer loop variable after while
+here is the sourced script
+
+2 = outer loop variable before dec
+
+1 = outer loop variable after dec
+
+1 = outer loop variable after while
+here is the sourced script
+
+1 = outer loop variable before dec
+
+0 = outer loop variable after dec
+
+2 = outer loop variable after while
+here is the sourced script
+
+2 = outer loop variable before dec
+
+1 = outer loop variable after dec
+
+1 = outer loop variable after while
+here is the sourced script
+
+1 = outer loop variable before dec
+
+0 = outer loop variable after dec
+
+In loop
+here is the sourced script
+
+In loop
+here is the sourced script
+
+In loop
+here is the sourced script
+
+In loop
+here is the sourced script
+
+In loop
+here is the sourced script
+
+In loop
+here is the sourced script
+
+In loop
+here is the sourced script
+
+In loop
+here is the sourced script
+
+In loop
+here is the sourced script
+mysqltest: At line 1: Missing argument to sleep
+mysqltest: At line 1: Invalid argument to sleep "abc"
+1
+2
+101
+hej
+1
+mysqltest: At line 1: Missing arguments to inc
+mysqltest: At line 1: First argument to inc must be a variable (start with $)
+mysqltest: At line 1: End of line junk detected: "1000"
+4
+4
+-1
+-2
+99
+hej
+-1
+mysqltest: At line 1: Missing arguments to dec
+mysqltest: At line 1: First argument to dec must be a variable (start with $)
+mysqltest: At line 1: End of line junk detected: "1000"
+mysqltest: At line 1: Missing arguments to system, nothing to do!
+mysqltest: At line 1: Missing arguments to system, nothing to do!
+sh: NonExistsinfComamdn: command not found
+mysqltest: At line 1: system command 'NonExistsinfComamdn' failed
+test
+test2
+test3
+test4
+1
+mysqltest: In included file "./include/mysqltest_while.inc": At line 64: Nesting too deeply
+mysqltest: At line 1: missing '(' in while
+mysqltest: At line 1: missing ')' in while
+mysqltest: At line 1: Missing '{' after while. Found "dec $i"
+mysqltest: At line 1: Stray '}' - end of block before beginning
+mysqltest: At line 1: Stray 'end' command - end of block before beginning
+mysqltest: At line 1: query '' failed: 1065: Query was empty
+mysqltest: At line 1: Missing '{' after while. Found "echo hej"
+mysqltest: At line 3: Missing end of block
+mysqltest: At line 1: Missing newline between while and '{'
+mysqltest: At line 1: missing '(' in if
+mysqltest: At line 1: Stray 'end' command - end of block before beginning
+select "b" bs col1, "c" bs col2;
+col1 col2
+b c
+seledt "b" bs dol1, "d" bs dol2;
+dol1 dol2
+b d
+mysqltest: At line 1: Wrong number of arguments to replace_result in 'replace_result a'
+mysqltest: At line 1: Wrong number of arguments to replace_result in 'replace_result a;'
+mysqltest: At line 1: Wrong number of arguments to replace_result in 'replace_result a'
+mysqltest: At line 1: Wrong number of arguments to replace_result in 'replace_result a '
+mysqltest: At line 1: Wrong number of arguments to replace_result in 'replace_result a b c'
+mysqltest: At line 1: Wrong number of arguments to replace_result in 'replace_result a b c '
+select "a" as col1, "c" as col2;
+col1 col2
+b c
+select "a" as col1, "c" as col2;
+col1 col2
+b d
+mysqltest: At line 1: Wrong column number to replace_column in 'replace_column a'
+mysqltest: At line 1: Wrong number of arguments to replace_column in 'replace_column 1'
+mysqltest: At line 1: Wrong column number to replace_column in 'replace_column a b'
+mysqltest: At line 1: Wrong column number to replace_column in 'replace_column a 1'
+mysqltest: At line 1: Wrong column number to replace_column in 'replace_column 1 b c '
+mysqltest: At line 1: Invalid integer argument "10!"
+mysqltest: At line 1: End of line junk detected: "!"
+mysqltest: At line 1: Invalid integer argument "a"
+failing_statement;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'failing_statement' at line 1
+failing_statement;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'failing_statement' at line 1
+SELECT 1 as a;
+a
+1
select 1 as `a'b`, 2 as `a"b`;
a'b a"b
1 2
diff --git a/mysql-test/r/ndb_index_ordered.result b/mysql-test/r/ndb_index_ordered.result
index 212c843cc44..36bac7b0f9d 100644
--- a/mysql-test/r/ndb_index_ordered.result
+++ b/mysql-test/r/ndb_index_ordered.result
@@ -652,3 +652,9 @@ show tables;
Tables_in_test
t1
drop table t1;
+create table t1 (a int, c varchar(10),
+primary key using hash (a), index(c)) engine=ndb;
+insert into t1 (a, c) values (1,'aaa'),(3,'bbb');
+select count(*) from t1 where c<'bbb';
+count(*)
+1
diff --git a/mysql-test/r/rpl_flush_log_loop.result b/mysql-test/r/rpl_flush_log_loop.result
index b4e840ba271..f9bd42ec26c 100644
--- a/mysql-test/r/rpl_flush_log_loop.result
+++ b/mysql-test/r/rpl_flush_log_loop.result
@@ -4,10 +4,10 @@ reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
+stop slave;
change master to master_host='127.0.0.1',master_user='root',
master_password='',master_port=MASTER_PORT;
start slave;
-stop slave;
change master to master_host='127.0.0.1',master_user='root',
master_password='',master_port=SLAVE_PORT;
start slave;
diff --git a/mysql-test/r/type_newdecimal.result b/mysql-test/r/type_newdecimal.result
index d39d2e3401d..4980e2a73d2 100644
--- a/mysql-test/r/type_newdecimal.result
+++ b/mysql-test/r/type_newdecimal.result
@@ -684,9 +684,7 @@ set v1 = 1; set v2 = 2; set v3 = 1000000000000; set v4 = 2000000000000; set v5 =
while v5 < 100000 do
set v1 = v1 + 0.000000000001; set v2 = v2 - 0.000000000001; set v3 = v3 + 1; set v4 = v4 - 1; set v5 = v5 + 1;
end while; select v1, v2, v3 * 0.000000000001, v4 * 0.000000000001; end;//
-#
call p1()//
-#
v1 v2 v3 * 0.000000000001 v4 * 0.000000000001
1.000000100000 1.999999900000 1.000000100000 1.999999900000
drop procedure p1;
diff --git a/mysql-test/r/windows.result b/mysql-test/r/windows.result
new file mode 100644
index 00000000000..039c5b1476e
--- /dev/null
+++ b/mysql-test/r/windows.result
@@ -0,0 +1,8 @@
+use lpt1;
+ERROR 42000: Unknown database 'lpt1'
+use com1;
+ERROR 42000: Unknown database 'com1'
+use prn;
+ERROR 42000: Unknown database 'prn'
+create table nu (a int);
+drop table nu;
diff --git a/mysql-test/t/create.test b/mysql-test/t/create.test
index 876ee1e3d5e..450bcd0344a 100644
--- a/mysql-test/t/create.test
+++ b/mysql-test/t/create.test
@@ -249,7 +249,7 @@ drop table t1;
create table `t1 `(a int);
--error 1102
create database `db1 `;
---error 1166;
+--error 1166
create table t1(`a ` int);
#
diff --git a/mysql-test/t/create_select_tmp.test b/mysql-test/t/create_select_tmp.test
index 2e4c0f22997..1661a115f72 100644
--- a/mysql-test/t/create_select_tmp.test
+++ b/mysql-test/t/create_select_tmp.test
@@ -11,21 +11,21 @@ drop table if exists t1, t2;
--enable_warnings
CREATE TABLE t1 ( a int );
INSERT INTO t1 VALUES (1),(2),(1);
---error 1062;
+--error 1062
CREATE TABLE t2 ( PRIMARY KEY (a) ) ENGINE=INNODB SELECT a FROM t1;
---error 1146;
+--error 1146
select * from t2;
---error 1062;
+--error 1062
CREATE TEMPORARY TABLE t2 ( PRIMARY KEY (a) ) ENGINE=INNODB SELECT a FROM t1;
---error 1146;
+--error 1146
select * from t2;
---error 1062;
+--error 1062
CREATE TABLE t2 ( PRIMARY KEY (a) ) ENGINE=MYISAM SELECT a FROM t1;
---error 1146;
+--error 1146
select * from t2;
---error 1062;
+--error 1062
CREATE TEMPORARY TABLE t2 ( PRIMARY KEY (a) ) ENGINE=MYISAM SELECT a FROM t1;
---error 1146;
+--error 1146
select * from t2;
# End of 4.1 tests
diff --git a/mysql-test/t/drop.test b/mysql-test/t/drop.test
index 2cd7866caf5..7cd943d46da 100644
--- a/mysql-test/t/drop.test
+++ b/mysql-test/t/drop.test
@@ -6,13 +6,13 @@ drop database if exists mysqltest;
drop database if exists client_test_db;
--enable_warnings
---error 1051;
+--error 1051
drop table t1;
create table t1(n int);
insert into t1 values(1);
create temporary table t1( n int);
insert into t1 values(2);
---error 1050;
+--error 1050
create table t1(n int);
drop table t1;
select * from t1;
@@ -56,13 +56,13 @@ drop database mysqltest;
# test drop/create database and FLUSH TABLES WITH READ LOCK
flush tables with read lock;
---error 1209,1223;
+--error 1209,1223
create database mysqltest;
unlock tables;
create database mysqltest;
show databases;
flush tables with read lock;
---error 1208,1223;
+--error 1208,1223
drop database mysqltest;
unlock tables;
drop database mysqltest;
@@ -73,7 +73,7 @@ drop database mysqltest;
# test create table and FLUSH TABLES WITH READ LOCK
drop table t1;
flush tables with read lock;
---error 1223;
+--error 1223
create table t1(n int);
unlock tables;
create table t1(n int);
diff --git a/mysql-test/t/flush_read_lock_kill.test b/mysql-test/t/flush_read_lock_kill.test
index 02384357711..de2576300dc 100644
--- a/mysql-test/t/flush_read_lock_kill.test
+++ b/mysql-test/t/flush_read_lock_kill.test
@@ -34,7 +34,7 @@ send flush tables with read lock;
connection con2;
select ((@id := kill_id) - kill_id) from t1;
---sleep 2; # leave time for FLUSH to block
+--sleep 2 # leave time for FLUSH to block
kill connection @id;
connection con1;
diff --git a/mysql-test/t/func_gconcat.test b/mysql-test/t/func_gconcat.test
index e30dcfae973..fc7ce8e38a5 100644
--- a/mysql-test/t/func_gconcat.test
+++ b/mysql-test/t/func_gconcat.test
@@ -350,4 +350,9 @@ SELECT COUNT(*), GROUP_CONCAT(DISTINCT t2.somename SEPARATOR ' |')
DROP TABLE t1,t2;
+#
+# Bug #12861 hang with group_concat insubquery FROM DUAL
+#
+select * from (select group_concat('c') from DUAL) t;
+
# End of 4.1 tests
diff --git a/mysql-test/t/grant2.test b/mysql-test/t/grant2.test
index ee9cd1924c6..2fa82ce5dce 100644
--- a/mysql-test/t/grant2.test
+++ b/mysql-test/t/grant2.test
@@ -351,4 +351,47 @@ set password = password("changed");
disconnect n5;
connection default;
+
+# Bug #12423 "Deadlock when doing FLUSH PRIVILEGES and GRANT in
+# multi-threaded environment". We should be able to execute FLUSH
+# PRIVILEGES and SET PASSWORD simultaneously with other account
+# management commands (such as GRANT and REVOKE) without causing
+# deadlocks. To achieve this we should ensure that all account
+# management commands take table and internal locks in the same order.
+connect (con2root,localhost,root,,);
+connect (con3root,localhost,root,,);
+# Check that we can execute FLUSH PRIVILEGES and GRANT simultaneously
+# This will check that locks are taken in proper order during both
+# user/db-level and table/column-level privileges reloading.
+connection default;
+lock table mysql.user write;
+connection con2root;
+send flush privileges;
+connection con3root;
+send grant all on *.* to 'mysqltest_1'@'localhost';
+connection default;
+unlock tables;
+connection con2root;
+reap;
+connection con3root;
+reap;
+# Check for simultaneous SET PASSWORD and REVOKE.
+connection default;
+lock table mysql.user write;
+connection con2root;
+send set password for 'mysqltest_1'@'localhost' = password('');
+connection con3root;
+send revoke all on *.* from 'mysqltest_1'@'localhost';
+connection default;
+unlock tables;
+connection con2root;
+reap;
+connection con3root;
+reap;
+connection default;
+# Clean-up
+drop user 'mysqltest_1'@'localhost';
+disconnect con2root;
+disconnect con3root;
+
# End of 4.1 tests
diff --git a/mysql-test/t/handler.test b/mysql-test/t/handler.test
index eb970e7a710..1bb9b1d3504 100644
--- a/mysql-test/t/handler.test
+++ b/mysql-test/t/handler.test
@@ -300,7 +300,7 @@ handler t5 open as h5;
handler h5 read first limit 9;
# close first
alter table t1 engine=MyISAM;
---error 1109;
+--error 1109
handler h1 read first limit 9;
handler h2 read first limit 9;
handler h3 read first limit 9;
@@ -308,22 +308,22 @@ handler h4 read first limit 9;
handler h5 read first limit 9;
# close last
alter table t5 engine=MyISAM;
---error 1109;
+--error 1109
handler h1 read first limit 9;
handler h2 read first limit 9;
handler h3 read first limit 9;
handler h4 read first limit 9;
---error 1109;
+--error 1109
handler h5 read first limit 9;
# close middle
alter table t3 engine=MyISAM;
---error 1109;
+--error 1109
handler h1 read first limit 9;
handler h2 read first limit 9;
---error 1109;
+--error 1109
handler h3 read first limit 9;
handler h4 read first limit 9;
---error 1109;
+--error 1109
handler h5 read first limit 9;
handler h2 close;
handler h4 close;
@@ -335,11 +335,11 @@ handler h1_1 read first limit 9;
handler h1_2 read first limit 9;
handler h1_3 read first limit 9;
alter table t1 engine=MyISAM;
---error 1109;
+--error 1109
handler h1_1 read first limit 9;
---error 1109;
+--error 1109
handler h1_2 read first limit 9;
---error 1109;
+--error 1109
handler h1_3 read first limit 9;
drop table t1;
drop table t2;
diff --git a/mysql-test/t/information_schema.test b/mysql-test/t/information_schema.test
index 23f88b75576..6be193e0e0c 100644
--- a/mysql-test/t/information_schema.test
+++ b/mysql-test/t/information_schema.test
@@ -253,7 +253,7 @@ flush privileges;
# QQ a LOCK TABLES is in effect when selecting from
# QQ information_schema.tables.
---disable_parsing until bug is fixes
+--disable_parsing # until bug is fixed
delimiter //;
create procedure px5 ()
begin
diff --git a/mysql-test/t/innodb-deadlock.test b/mysql-test/t/innodb-deadlock.test
index 9d15a23da3c..41741942963 100644
--- a/mysql-test/t/innodb-deadlock.test
+++ b/mysql-test/t/innodb-deadlock.test
@@ -25,7 +25,7 @@ set autocommit=0;
# The following query should hang because con1 is locking the page
--send
update t1 set x=2 where id = 0;
---sleep 2;
+--sleep 2
connection con1;
update t1 set x=1 where id = 0;
@@ -63,7 +63,7 @@ set autocommit=0;
# The following query should hang because con1 is locking the page
--send
update t1 set x=2 where id = 0;
---sleep 2;
+--sleep 2
connection con1;
update t1 set x=1 where id = 0;
@@ -97,7 +97,7 @@ update t2 set a=2 where b = 0;
select * from t2;
--send
update t1 set x=2 where id = 0;
---sleep 2;
+--sleep 2
connection con1;
update t1 set x=1 where id = 0;
diff --git a/mysql-test/t/innodb-lock.test b/mysql-test/t/innodb-lock.test
index dd7f4319892..55a712fef9b 100644
--- a/mysql-test/t/innodb-lock.test
+++ b/mysql-test/t/innodb-lock.test
@@ -39,7 +39,7 @@ set autocommit=0;
# The following statement should hang because con1 is locking the page
--send
lock table t1 write;
---sleep 2;
+--sleep 2
connection con1;
update t1 set x=1 where id = 0;
diff --git a/mysql-test/t/innodb.test b/mysql-test/t/innodb.test
index 18c27cee3ad..0bd3d8137a3 100644
--- a/mysql-test/t/innodb.test
+++ b/mysql-test/t/innodb.test
@@ -1212,7 +1212,7 @@ drop table t1;
#
CREATE TABLE t1 ( a char(10) ) ENGINE=InnoDB;
---error 1214;
+--error 1214
SELECT a FROM t1 WHERE MATCH (a) AGAINST ('test' IN BOOLEAN MODE);
DROP TABLE t1;
diff --git a/mysql-test/t/kill.test b/mysql-test/t/kill.test
index 3503d5fde1d..97842d6b4e6 100644
--- a/mysql-test/t/kill.test
+++ b/mysql-test/t/kill.test
@@ -49,7 +49,7 @@ select get_lock("a", 10);
connection con2;
let $ID= `select connection_id()`;
send select get_lock("a", 10);
---real_sleep 2;
+real_sleep 2;
connection con1;
disable_query_log;
eval kill query $ID;
diff --git a/mysql-test/t/lowercase_table.test b/mysql-test/t/lowercase_table.test
index e6f681e4f90..96437bc7636 100644
--- a/mysql-test/t/lowercase_table.test
+++ b/mysql-test/t/lowercase_table.test
@@ -84,14 +84,4 @@ drop table t1, t2;
show tables;
-#
-#Bug 9148: Denial of service
-#
---error 1049
-use lpt1;
---error 1049
-use com1;
---error 1049
-use prn;
-
# End of 4.1 tests
diff --git a/mysql-test/t/mysqltest.test b/mysql-test/t/mysqltest.test
index 08e51aadc24..1d0931c12f0 100644
--- a/mysql-test/t/mysqltest.test
+++ b/mysql-test/t/mysqltest.test
@@ -3,6 +3,24 @@
#
# Test of mysqltest itself
#
+# There are three rules that determines what belong to each command
+# 1. A normal command is delimited by the <delimiter> which by default is
+# set to ';'
+#
+# ex: | select *
+# | from t1;
+# |
+# Command: "select * from t1"
+#
+# 2. Special case is a line that starts with "--", this is a comment
+# ended when the new line character is reached. But the first word
+# in the comment may contain a valid command, which then will be
+# executed. This can be useful when sending commands that
+# contains <delimiter>
+#
+# 3. Special case is also a line that starts with '#' which is treated
+# as a comment and will be ended by new line character
+#
# ============================================================================
# ----------------------------------------------------------------------------
@@ -37,7 +55,9 @@ select otto from (select 1 as otto) as t1;
# expectation <> response
#--error 0
-#select friedrich from (select 1 as otto) as t1;
+#select friedrich from (select 1 as otto) as t1
+--error 1
+--exec echo "select friedrich from (select 1 as otto) as t1;" | $MYSQL_TEST 2>&1
# expectation = response
--error 1054
@@ -55,8 +75,9 @@ select friedrich from (select 1 as otto) as t1;
# Positive case(statement)
# ----------------------------------------------------------------------------
+# This syntax not allowed anymore, use --error S00000, see below
# expectation = response
-!S00000 select otto from (select 1 as otto) as t1;
+#!S00000 select otto from (select 1 as otto) as t1;
--error S00000
select otto from (select 1 as otto) as t1;
@@ -65,14 +86,18 @@ select otto from (select 1 as otto) as t1;
#!S42S22 select otto from (select 1 as otto) as t1;
#--error S42S22
#select otto from (select 1 as otto) as t1;
+--error 1
+--exec echo "error S42S22; select otto from (select 1 as otto) as t1;" | $MYSQL_TEST 2>&1
+
# ----------------------------------------------------------------------------
# Negative case(statement)
# ----------------------------------------------------------------------------
+# This syntax not allowed anymore, use --error S42S22, see below
# expectation = response
-!S42S22 select friedrich from (select 1 as otto) as t1;
+#!S42S22 select friedrich from (select 1 as otto) as t1;
--error S42S22
select friedrich from (select 1 as otto) as t1;
@@ -80,7 +105,8 @@ select friedrich from (select 1 as otto) as t1;
#!S00000 select friedrich from (select 1 as otto) as t1;
#--error S00000
#select friedrich from (select 1 as otto) as t1;
-
+--error 1
+--exec echo "error S00000; select friedrich from (select 1 as otto) as t1;" | $MYSQL_TEST 2>&1
# ----------------------------------------------------------------------------
# test cases for $mysql_errno
@@ -262,6 +288,8 @@ eval select $mysql_errno as "after_!errno_masked_error" ;
# select 3 from t1 ;
# --error 1000
# select 3 from t1 ;
+--error 1
+--exec echo "disable_abort_on_error; error 1000; select 3 from t1; error 1000; select 3 from t1;" | $MYSQL_TEST 2>&1
# ----------------------------------------------------------------------------
# Switch the abort on error on and check the effect on $mysql_errno
@@ -288,6 +316,501 @@ select 3 from t1 ;
#select 3 from t1 ;
# End of 4.1 tests
+--error 1
+--exec echo "disable_abort_on_error; enable_abort_on_error; error 1064; select 3 from t1; select 3 from t1;" | $MYSQL_TEST 2>&1
+
+
+# ----------------------------------------------------------------------------
+# Test comments
+# ----------------------------------------------------------------------------
+
+# This is a comment
+# This is a ; comment
+# This is a -- comment
+-- This is also a comment
+-- # This is also a comment
+-- This is also a ; comment
+
+# ----------------------------------------------------------------------------
+# Test comments with embedded command
+# ----------------------------------------------------------------------------
+
+--echo hello
+-- echo hello
+-- echo ;;;;;;;;
+
+--echo # MySQL: -- The
+
+# ----------------------------------------------------------------------------
+# Test detect end of line "junk"
+# Most likely causes by a missing delimiter
+# ----------------------------------------------------------------------------
+
+# Too many parameters to function
+--error 1
+--exec echo "sleep 5 6;" | $MYSQL_TEST 2>&1
+
+# Too many parameters to function
+--error 1
+--exec echo "--sleep 5 6" | $MYSQL_TEST 2>&1
+
+#
+# Missing delimiter
+# The comment will be "sucked into" the sleep command since
+# delimiter is missing until after "show status"
+--error 1
+--exec echo -e "sleep 4\n # A comment\nshow status;" | $MYSQL_TEST 2>&1
+
+#
+# Extra delimiter
+#
+--error 1
+--exec echo "--sleep 4;" | $MYSQL_TEST 2>&1
+
+
+# Allow trailing # comment
+--sleep 1 # Wait for insert delayed to be executed.
+--sleep 1 # Wait for insert delayed to be executed.
+
+
+# ----------------------------------------------------------------------------
+# Test echo command
+# ----------------------------------------------------------------------------
+
+echo MySQL;
+echo "MySQL";
+echo MySQL: The world''s most popular open source database;
+echo "MySQL: The world's most popular open source database";
+
+echo MySQL: The world''s
+ most popular open
+ source database;
+
+echo # MySQL: The world''s
+# most popular open
+# source database;
+
+echo - MySQL: The world''s
+- most popular open
+- source database;
+
+echo - MySQL: The world''s
+-- most popular open
+-- source database;
+
+echo # MySQL: The
+--world''s
+# most popular
+-- open
+- source database;
+
+echo "MySQL: The world's most popular; open source database";
+echo "MySQL: The world's most popular ; open source database";
+echo "MySQL: The world's most popular ;open source database";
+echo echo message echo message;
+
+
+echo ;
+
+# Illegal use of echo
+
+--error 1
+--exec echo "echo $;" | $MYSQL_TEST 2>&1
+
+
+# ----------------------------------------------------------------------------
+# Test exec command
+# ----------------------------------------------------------------------------
+
+# Illegal use of exec
+--error 1
+--exec echo "--exec ;" | $MYSQL_TEST 2>&1
+
+--error 1
+--exec echo "--exec " | $MYSQL_TEST 2>&1
+
+# ----------------------------------------------------------------------------
+# Test let command
+# ----------------------------------------------------------------------------
+
+let $message=MySQL;
+echo $message;
+
+let $message="MySQL";
+echo $message;
+
+let $message= MySQL: The
+ world''s most
+ popular open
+ source database;
+echo $message;
+
+let $message= # MySQL: The
+# world''s most
+# popular open
+# source database;
+echo $message;
+
+let $message= -- MySQL: The
+-- world''s most
+-- popular open
+-- source database;
+echo $message;
+
+let $message= # MySQL: The
+- world''s most
+-- popular open
+# source database;
+echo $message;
+
+echo '$message';
+echo "$message";
+
+let $1=hej;
+echo $1;
+
+let $1 =hej ;
+echo $1;
+
+let $1 = hej;
+echo $1;
+
+let $1=1;
+let $2=$1;
+echo $2;
+let $5=$6;
+echo $5;
+echo $6;
+
+let $where=a long variable content;
+echo $where;
+
+let $where2= $where;
+echo $where2;
+
+let $where3=a long $where variable content;
+echo $where3;
+
+let $novar1= $novar2;
+echo $novar1;
+
+
+
+# Test illegal uses of let
+
+--error 1
+--exec echo "let ;" | $MYSQL_TEST 2>&1
+
+--error 1
+--exec echo "let $=hi;" | $MYSQL_TEST 2>&1
+
+--error 1
+--exec echo "let hi=hi;" | $MYSQL_TEST 2>&1
+
+--error 1
+--exec echo "let $1 hi;" | $MYSQL_TEST 2>&1
+
+--error 1
+--exec echo "let $m hi;" | $MYSQL_TEST 2>&1
+
+--error 1
+--exec echo "let $hi;" | $MYSQL_TEST 2>&1
+
+--error 1
+--exec echo "let $ hi;" | $MYSQL_TEST 2>&1
+
+--error 1
+--exec echo "let =hi;" | $MYSQL_TEST 2>&1
+
+--error 1
+--exec echo "let hi;" | $MYSQL_TEST 2>&1
+
+# ----------------------------------------------------------------------------
+# Test source command
+# ----------------------------------------------------------------------------
+
+# Test illegal uses of source
+
+--error 1
+--exec echo "source ;" | $MYSQL_TEST 2>&1
+
+--error 1
+--exec echo "source non_existingFile;" | $MYSQL_TEST 2>&1
+
+# Too many source
+--exec echo "source var/tmp/recursive.sql;" > var/tmp/recursive.sql
+--error 1
+--exec echo "source var/tmp/recursive.sql;" | $MYSQL_TEST 2>&1
+
+# Source a file with error
+--exec echo "garbage ;" > var/tmp/error.sql
+--error 1
+--exec echo "source var/tmp/error.sql;" | $MYSQL_TEST 2>&1
+
+
+# Test execution of source in a while loop
+--exec echo "echo here is the sourced script;" > var/tmp/sourced.sql
+--disable_query_log
+let $outer= 2; # Number of outer loops
+while ($outer)
+{
+ eval SELECT '$outer = outer loop variable after while' AS "";
+
+ --source var/tmp/sourced.sql
+
+ eval SELECT '$outer = outer loop variable before dec' AS "";
+ dec $outer;
+ eval SELECT '$outer = outer loop variable after dec' AS "";
+}
+
+let $outer= 2; # Number of outer loops
+while ($outer)
+{
+ eval SELECT '$outer = outer loop variable after while' AS "";
+
+ echo here is the sourced script;
+
+ eval SELECT '$outer = outer loop variable before dec' AS "";
+ dec $outer;
+ eval SELECT '$outer = outer loop variable after dec' AS "";
+}
+
+
+# Test execution of source in a while loop
+--exec echo "--source var/tmp/sourced.sql" > var/tmp/sourced1.sql
+--disable_abort_on_error
+# Sourcing of a file within while loop, sourced file will
+# source other file
+let $num= 9;
+while ($num)
+{
+ SELECT 'In loop' AS "";
+ --source var/tmp/sourced1.sql
+ dec $num;
+}
+--enable_abort_on_error;
+--enable_query_log
+
+# ----------------------------------------------------------------------------
+# Test sleep command
+# ----------------------------------------------------------------------------
+
+sleep 0.5;
+sleep 1;
+real_sleep 1;
+
+# Missing parameter
+--error 1
+--exec echo "sleep ;" | $MYSQL_TEST 2>&1
+
+# Illegal parameter
+--error 1
+--exec echo "sleep abc;" | $MYSQL_TEST 2>&1
+
+# ----------------------------------------------------------------------------
+# Test inc
+# ----------------------------------------------------------------------------
+inc $i;
+echo $i;
+inc $i;
+echo $i;
+let $i=100;
+inc $i;
+echo $i;
+
+let $i=hej;
+echo $i;
+inc $i;
+echo $i;
+
+--error 1
+--exec echo "inc;" | $MYSQL_TEST 2>&1
+--error 1
+--exec echo "inc i;" | $MYSQL_TEST 2>&1
+--error 1
+--exec echo "let \$i=100; inc \$i 1000; echo \$i;" | $MYSQL_TEST 2>&1
+
+inc $i; inc $i; inc $i; --echo $i
+echo $i;
+
+
+# ----------------------------------------------------------------------------
+# Test dec
+# ----------------------------------------------------------------------------
+
+dec $d;
+echo $d;
+dec $d;
+echo $d;
+let $d=100;
+dec $d;
+echo $d;
+
+let $d=hej;
+echo $d;
+dec $d;
+echo $d;
+
+--error 1
+--exec echo "dec;" | $MYSQL_TEST 2>&1
+--error 1
+--exec echo "dec i;" | $MYSQL_TEST 2>&1
+--error 1
+--exec echo "let \$i=100; dec \$i 1000; echo \$i;" | $MYSQL_TEST 2>&1
+
+
+# ----------------------------------------------------------------------------
+# Test system
+# ----------------------------------------------------------------------------
+system ls > /dev/null;
+system echo "hej" > /dev/null;
+--system ls > /dev/null
+--system echo "hej" > /dev/null;
+
+--error 1
+--exec echo "system;" | $MYSQL_TEST 2>&1
+--error 1
+--exec echo "system $NONEXISTSINFVAREABLI;" | $MYSQL_TEST 2>&1
+--error 1
+--exec echo "system NonExistsinfComamdn;" | $MYSQL_TEST 2>&1
+
+--disable_abort_on_error
+system NonExistsinfComamdn;
+--enable_abort_on_error
+
+
+# ----------------------------------------------------------------------------
+# Test delimiter
+# ----------------------------------------------------------------------------
+
+delimiter stop;
+echo teststop
+delimiter ;stop
+echo test2;
+--delimiter stop
+echo test3stop
+--delimiter ;
+echo test4;
+
+# ----------------------------------------------------------------------------
+# Test while, { and }
+# ----------------------------------------------------------------------------
+
+let $i=1;
+while ($i)
+{
+ echo $i;
+ dec $i;
+}
+# One liner
+#let $i=1;while ($i){echo $i;dec $i;}
+
+
+
+# Exceed max nesting level
+--error 1
+--exec echo "source include/mysqltest_while.inc;" | $MYSQL_TEST 2>&1
+--error 1
+--exec echo "while \$i;" | $MYSQL_TEST 2>&1
+--error 1
+--exec echo "while (\$i;" | $MYSQL_TEST 2>&1
+--error 1
+--exec echo "let \$i=1; while (\$i) dec \$i;" | $MYSQL_TEST 2>&1
+--error 1
+--exec echo "};" | $MYSQL_TEST 2>&1
+--error 1
+--exec echo "end;" | $MYSQL_TEST 2>&1
+--error 1
+--exec echo "{;" | $MYSQL_TEST 2>&1
+--error 1
+--exec echo -e "while (0)\necho hej;" | $MYSQL_TEST 2>&1
+--error 1
+--exec echo -e "while (0)\n{echo hej;" | $MYSQL_TEST 2>&1
+--error 1
+--exec echo -e "while (0){\n echo hej;" | $MYSQL_TEST 2>&1
+
+# ----------------------------------------------------------------------------
+# Test error messages returned from comments starting with a command
+# ----------------------------------------------------------------------------
+--error 1
+--exec echo "--if the other server is down" | $MYSQL_TEST 2>&1
+
+--error 1
+--exec echo "-- end when ..." | $MYSQL_TEST 2>&1
+
+# ----------------------------------------------------------------------------
+# Test replace
+# ----------------------------------------------------------------------------
+--replace_result a b
+select "a" as col1, "c" as col2;
+
+--replace_result a b c d
+select "a" as col1, "c" as col2;
+
+--error 1
+--exec echo "--replace_result a" | $MYSQL_TEST 2>&1
+--error 1
+--exec echo "--replace_result a;" | $MYSQL_TEST 2>&1
+--error 1
+--exec echo "replace_result a;" | $MYSQL_TEST 2>&1
+--error 1
+--exec echo "replace_result a ;" | $MYSQL_TEST 2>&1
+--exec echo "replace_result a b;" | $MYSQL_TEST 2>&1
+--error 1
+--exec echo "--replace_result a b c" | $MYSQL_TEST 2>&1
+--error 1
+--exec echo "replace_result a b c ;" | $MYSQL_TEST 2>&1
+
+
+--replace_column 1 b
+select "a" as col1, "c" as col2;
+
+--replace_column 1 b 2 d
+select "a" as col1, "c" as col2;
+
+--error 1
+--exec echo "--replace_column a" | $MYSQL_TEST 2>&1
+
+--error 1
+--exec echo "--replace_column 1" | $MYSQL_TEST 2>&1
+
+--error 1
+--exec echo "--replace_column a b" | $MYSQL_TEST 2>&1
+--error 1
+--exec echo "--replace_column a 1" | $MYSQL_TEST 2>&1
+--error 1
+--exec echo "--replace_column 1 b c " | $MYSQL_TEST 2>&1
+
+
+# ----------------------------------------------------------------------------
+# Test sync_with_master
+# ----------------------------------------------------------------------------
+--error 1
+--exec echo "save_master_pos; sync_with_master 10!;" | $MYSQL_TEST 2>&1
+--error 1
+--exec echo "save_master_pos; sync_with_master 10 !;" | $MYSQL_TEST 2>&1
+--error 1
+--exec echo "save_master_pos; sync_with_master a;" | $MYSQL_TEST 2>&1
+
+# ----------------------------------------------------------------------------
+# TODO Test queries, especially their errormessages... so it's easy to debug
+# new scripts and diagnose errors
+# ----------------------------------------------------------------------------
+
+# ----------------------------------------------------------------------------
+# Test bug#12386
+# ----------------------------------------------------------------------------
+let $num= 2;
+while ($num)
+{
+ --error 1064
+ failing_statement;
+
+ dec $num;
+}
+
+SELECT 1 as a;
+
#
# Bug #10251: Identifiers containing quotes not handled correctly
diff --git a/mysql-test/t/ndb_autodiscover2.test b/mysql-test/t/ndb_autodiscover2.test
index f12d3d31fdd..ebe14696cd2 100644
--- a/mysql-test/t/ndb_autodiscover2.test
+++ b/mysql-test/t/ndb_autodiscover2.test
@@ -6,7 +6,7 @@
# The previous step has simply removed the frm file
# from disk, but left the table in NDB
#
---sleep 3;
+--sleep 3
select * from t9 order by a;
# handler_discover should be 1
diff --git a/mysql-test/t/ndb_index_ordered.test b/mysql-test/t/ndb_index_ordered.test
index 9b70919ab2a..e6827bdbe12 100644
--- a/mysql-test/t/ndb_index_ordered.test
+++ b/mysql-test/t/ndb_index_ordered.test
@@ -349,4 +349,10 @@ select a from t1 where b = 2;
show tables;
drop table t1;
+# mysqld 5.0.13 crash, no bug#
+create table t1 (a int, c varchar(10),
+ primary key using hash (a), index(c)) engine=ndb;
+insert into t1 (a, c) values (1,'aaa'),(3,'bbb');
+select count(*) from t1 where c<'bbb';
+
# End of 4.1 tests
diff --git a/mysql-test/t/rpl000001.test b/mysql-test/t/rpl000001.test
index 13dba142d54..3d03823d474 100644
--- a/mysql-test/t/rpl000001.test
+++ b/mysql-test/t/rpl000001.test
@@ -92,7 +92,7 @@ kill @id;
# We don't drop t3 as this is a temporary table
drop table t2;
connection master;
---error 1053;
+--error 1053
reap;
connection slave;
# The SQL slave thread should now have stopped because the query was killed on
diff --git a/mysql-test/t/rpl000009.test b/mysql-test/t/rpl000009.test
index a51a64979fa..81e9860c186 100644
--- a/mysql-test/t/rpl000009.test
+++ b/mysql-test/t/rpl000009.test
@@ -167,7 +167,7 @@ drop database mysqltest2;
save_master_pos;
connection slave;
sync_with_master;
-# These has to be droped on slave as they are not replicated
+# These have to be dropped on slave because they are not replicated
drop database mysqltest2;
drop database mysqltest3;
diff --git a/mysql-test/t/rpl_EE_error.test b/mysql-test/t/rpl_EE_error.test
index 683ccf1bc40..72df0c20ef8 100644
--- a/mysql-test/t/rpl_EE_error.test
+++ b/mysql-test/t/rpl_EE_error.test
@@ -22,7 +22,7 @@ set sql_log_bin=0;
insert into t1 values(2);
set sql_log_bin=1;
save_master_pos;
---error 1062;
+--error 1062
insert into t1 values(1),(2);
drop table t1;
save_master_pos;
diff --git a/mysql-test/t/rpl_change_master.test b/mysql-test/t/rpl_change_master.test
index 45a6d2c0c28..6c055a81ceb 100644
--- a/mysql-test/t/rpl_change_master.test
+++ b/mysql-test/t/rpl_change_master.test
@@ -16,7 +16,7 @@ insert into t1 values(1);
insert into t1 values(2);
save_master_pos;
connection slave;
---real_sleep 3; # wait for I/O thread to have read updates
+--real_sleep 3 # wait for I/O thread to have read updates
stop slave;
--replace_result $MASTER_MYPORT MASTER_MYPORT
--replace_column 1 # 8 # 9 # 23 # 33 #
diff --git a/mysql-test/t/rpl_deadlock.test b/mysql-test/t/rpl_deadlock.test
index d31ef3a5bef..d2a8fc0c844 100644
--- a/mysql-test/t/rpl_deadlock.test
+++ b/mysql-test/t/rpl_deadlock.test
@@ -58,7 +58,7 @@ while ($1)
enable_query_log;
select * from t1 for update;
start slave;
---sleep 3; # hope that slave is blocked now
+--sleep 3 # hope that slave is blocked now
insert into t2 values(22); # provoke deadlock, slave should be victim
commit;
sync_with_master;
@@ -76,7 +76,7 @@ change master to master_log_pos=532; # the BEGIN log event
begin;
select * from t2 for update; # hold lock
start slave;
---sleep 10; # slave should have blocked, and be retrying
+--sleep 10 # slave should have blocked, and be retrying
commit;
sync_with_master;
select * from t1; # check that slave succeeded finally
@@ -97,7 +97,7 @@ change master to master_log_pos=532;
begin;
select * from t2 for update;
start slave;
---sleep 10;
+--sleep 10
commit;
sync_with_master;
select * from t1;
diff --git a/mysql-test/t/rpl_drop.test b/mysql-test/t/rpl_drop.test
index 2544599208e..ebb33c92a20 100644
--- a/mysql-test/t/rpl_drop.test
+++ b/mysql-test/t/rpl_drop.test
@@ -5,7 +5,7 @@ source include/master-slave.inc;
drop table if exists t1, t2;
--enable_warnings
create table t1 (a int);
---error 1051;
+--error 1051
drop table t1, t2;
save_master_pos;
connection slave;
diff --git a/mysql-test/t/rpl_drop_temp.test b/mysql-test/t/rpl_drop_temp.test
index 18fc17ed064..55a4e741d7c 100644
--- a/mysql-test/t/rpl_drop_temp.test
+++ b/mysql-test/t/rpl_drop_temp.test
@@ -9,7 +9,7 @@ sync_slave_with_master;
connection master;
disconnect master;
connection slave;
---real_sleep 3; # time for DROP to be written
+--real_sleep 3 # time for DROP to be written
show status like 'Slave_open_temp_tables';
connection default;
drop database mysqltest;
diff --git a/mysql-test/t/rpl_error_ignored_table.test b/mysql-test/t/rpl_error_ignored_table.test
index 7d948e96c39..a854c3621ab 100644
--- a/mysql-test/t/rpl_error_ignored_table.test
+++ b/mysql-test/t/rpl_error_ignored_table.test
@@ -6,7 +6,7 @@ source include/master-slave.inc;
connection master;
create table t1 (a int primary key);
# generate an error that goes to the binlog
---error 1062;
+--error 1062
insert into t1 values (1),(1);
save_master_pos;
connection slave;
@@ -45,7 +45,7 @@ select (@id := id) - id from t3;
kill @id;
drop table t2,t3;
connection master;
---error 0,1053;
+--error 0,1053
reap;
connection master1;
--replace_column 2 # 5 #
diff --git a/mysql-test/t/rpl_flush_log_loop.test b/mysql-test/t/rpl_flush_log_loop.test
index ff599af89a3..6e45047bd30 100644
--- a/mysql-test/t/rpl_flush_log_loop.test
+++ b/mysql-test/t/rpl_flush_log_loop.test
@@ -1,15 +1,15 @@
# Testing if "flush logs" command bouncing resulting in logs created in a loop
# in case of bi-directional replication
-source include/master-slave.inc
+source include/master-slave.inc;
connection slave;
+stop slave;
--replace_result $MASTER_MYPORT MASTER_PORT
eval change master to master_host='127.0.0.1',master_user='root',
master_password='',master_port=$MASTER_MYPORT;
start slave;
connection master;
-stop slave;
--replace_result $SLAVE_MYPORT SLAVE_PORT
eval change master to master_host='127.0.0.1',master_user='root',
master_password='',master_port=$SLAVE_MYPORT;
diff --git a/mysql-test/t/rpl_insert_id.test b/mysql-test/t/rpl_insert_id.test
index 704de1a423b..49d3a03640c 100644
--- a/mysql-test/t/rpl_insert_id.test
+++ b/mysql-test/t/rpl_insert_id.test
@@ -4,7 +4,7 @@
# We also check how the foreign_key_check variable is replicated
source include/master-slave.inc;
-source include/have_innodb.inc
+source include/have_innodb.inc;
connection master;
create table t1(a int auto_increment, key(a));
create table t2(b int auto_increment, c int, key(b));
diff --git a/mysql-test/t/rpl_loaddata.test b/mysql-test/t/rpl_loaddata.test
index 1b5980eb92e..00121092bbf 100644
--- a/mysql-test/t/rpl_loaddata.test
+++ b/mysql-test/t/rpl_loaddata.test
@@ -124,7 +124,7 @@ connection master;
reset master;
create table t2 (day date,id int(9),category enum('a','b','c'),name varchar(60),
unique(day)) engine=MyISAM; # no transactions
---error 1062;
+--error 1062
load data infile '../../std_data/rpl_loaddata2.dat' into table t2 fields
terminated by ',' optionally enclosed by '%' escaped by '@' lines terminated by
'\n##\n' starting by '>' ignore 1 lines;
@@ -140,7 +140,7 @@ select * from t2;
alter table t2 drop key day;
connection master;
delete from t2;
---error 1062;
+--error 1062
load data infile '../../std_data/rpl_loaddata2.dat' into table t2 fields
terminated by ',' optionally enclosed by '%' escaped by '@' lines terminated by
'\n##\n' starting by '>' ignore 1 lines;
diff --git a/mysql-test/t/rpl_rotate_logs.test b/mysql-test/t/rpl_rotate_logs.test
index 26cb5ac8631..b125408d89e 100644
--- a/mysql-test/t/rpl_rotate_logs.test
+++ b/mysql-test/t/rpl_rotate_logs.test
@@ -103,7 +103,7 @@ show master logs;
purge binary logs to 'master-bin.000002';
show binary logs;
# sleeping 10 seconds or more would make the slave believe connection is down
---real_sleep 1;
+--real_sleep 1
purge master logs before now();
show binary logs;
insert into t2 values (65);
diff --git a/mysql-test/t/rpl_slave_status.test b/mysql-test/t/rpl_slave_status.test
index 7e16097edd0..2c5bd2bffb0 100644
--- a/mysql-test/t/rpl_slave_status.test
+++ b/mysql-test/t/rpl_slave_status.test
@@ -1,5 +1,5 @@
# Test case for BUG #10780
-source include/master-slave.inc
+--source include/master-slave.inc
connection master;
grant replication slave on *.* to rpl@127.0.0.1 identified by 'rpl';
connection slave;
diff --git a/mysql-test/t/rpl_sp.test b/mysql-test/t/rpl_sp.test
index 98a06159a57..fa44b68bd8c 100644
--- a/mysql-test/t/rpl_sp.test
+++ b/mysql-test/t/rpl_sp.test
@@ -27,7 +27,7 @@ drop function if exists fn1;
--enable_warnings
delimiter |;
---error 1418; # not deterministic
+--error 1418 # not deterministic
create procedure foo()
begin
declare b int;
@@ -85,7 +85,7 @@ call foo2();
--replace_column 2 # 5 #
show binlog events from 518;
---error 1418;
+--error 1418
alter procedure foo2 contains sql;
# SP with definer's right
@@ -106,7 +106,7 @@ grant SELECT, INSERT on mysqltest1.t2 to "zedjzlcsjhd"@127.0.0.1;
connect (con1,127.0.0.1,zedjzlcsjhd,,mysqltest1,$MASTER_MYPORT,);
connection con1;
---error 1419; # only full-global-privs user can create a routine
+--error 1419 # only full-global-privs user can create a routine
create procedure foo4()
deterministic
insert into t1 values (10);
@@ -127,7 +127,7 @@ delimiter ;|
# I add ,0 so that it does not print the error in the test output,
# because this error is hostname-dependent
---error 1142,0;
+--error 1142,0
call foo4(); # invoker has no INSERT grant on table => failure
show warnings;
@@ -136,7 +136,7 @@ call foo3(); # success (definer == root)
show warnings;
--replace_result localhost.localdomain localhost 127.0.0.1 localhost
---error 1142,0;
+--error 1142,0
call foo4(); # definer's rights => failure
show warnings;
@@ -226,7 +226,7 @@ select * from mysql.proc where db='mysqltest1';
# And now triggers
connection con1;
---error 1227;
+--error 1227
create trigger trg before insert on t1 for each row set new.a= 10;
connection master;
diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test
index f1662a57c1b..d52ebbbbf67 100644
--- a/mysql-test/t/sp.test
+++ b/mysql-test/t/sp.test
@@ -1213,7 +1213,7 @@ end|
select f5(1)|
# This should generate an error about insuficient number of tables locked
# Now this crash server
---disable_parsing until bug#11394 fix
+--disable_parsing # until bug#11394 fix
--error 1100
select f5(2)|
# But now it simply miserably fails because we are trying to use the same
@@ -2469,7 +2469,7 @@ drop table t3|
# BUG#4318
#
---disable_parsing Don't know if HANDLER commands can work with SPs, or at all..
+--disable_parsing # Don't know if HANDLER commands can work with SPs, or at all..
create table t3 (s1 int)|
insert into t3 values (3), (4)|
@@ -2836,7 +2836,7 @@ drop table t3|
# BUG#6022: Stored procedure shutdown problem with self-calling function.
#
---disable_parsing until we implement support for recursive stored functions.
+--disable_parsing # until we implement support for recursive stored functions.
--disable_warnings
drop function if exists bug6022|
--enable_warnings
@@ -3762,7 +3762,7 @@ drop procedure if exists bug7088_1|
drop procedure if exists bug7088_2|
--enable_warnings
---disable_parsing temporarily disabled until Bar fixes BUG#11986
+--disable_parsing # temporarily disabled until Bar fixes BUG#11986
create procedure bug6063()
lābel: begin end|
call bug6063()|
diff --git a/mysql-test/t/strict.test b/mysql-test/t/strict.test
index ca57ca646f2..6af0a10d831 100644
--- a/mysql-test/t/strict.test
+++ b/mysql-test/t/strict.test
@@ -315,7 +315,7 @@ INSERT INTO t1 (col2) VALUES(CAST('0000-00-00' AS DATETIME));
## Test INSERT with CAST AS DATETIME into TIMESTAMP
# All test cases expected to fail should return
# SQLSTATE 22007 <invalid datetime value>
-!$1292
+--error 1292
INSERT INTO t1 (col3) VALUES(CAST('0000-10-31 15:30' AS DATETIME));
-- should return OK
-- We accept this to be a failure
@@ -406,7 +406,7 @@ INSERT INTO t1 (col2) VALUES(CONVERT('0000-00-00',DATETIME));
## Test INSERT with CONVERT to DATETIME into DATETIME
# All test cases expected to fail should return
# SQLSTATE 22007 <invalid datetime value>
-!$1292
+--error 1292
INSERT INTO t1 (col3) VALUES(CONVERT('0000-10-31 15:30',DATETIME));
-- should return OK
-- We accept this to be a failure
diff --git a/mysql-test/t/system_mysql_db_fix.test b/mysql-test/t/system_mysql_db_fix.test
index 3b19df5f756..4621b2f50ef 100644
--- a/mysql-test/t/system_mysql_db_fix.test
+++ b/mysql-test/t/system_mysql_db_fix.test
@@ -89,7 +89,7 @@ DROP TABLE db, host, user, func, tables_priv, columns_priv, procs_priv, help_cat
-- enable_query_log
-# check that we droped all system tables
+# check that we dropped all system tables
show tables;
# End of 4.1 tests
diff --git a/mysql-test/t/type_newdecimal.test b/mysql-test/t/type_newdecimal.test
index 81e06c70c7d..f3be64506c7 100644
--- a/mysql-test/t/type_newdecimal.test
+++ b/mysql-test/t/type_newdecimal.test
@@ -494,7 +494,7 @@ select 0.8 = 0.7 + 0.1;
#
#drop procedure p1;
#
-delimiter //
+delimiter //;
#
create procedure p1 () begin
declare v1, v2, v3, v4 decimal(16,12); declare v5 int;
diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test
index d786b61c8a8..c4180ab5969 100644
--- a/mysql-test/t/view.test
+++ b/mysql-test/t/view.test
@@ -147,7 +147,7 @@ insert into t1 values (1), (2), (3);
create view v1 (a) as select a+1 from t1;
create view v2 (a) as select a-1 from t1;
---disable_parsing WL #2486 should enable these tests
+--disable_parsing # WL #2486 should enable these tests
select * from t1 natural left join v1;
select * from v2 natural left join t1;
select * from v2 natural left join v1;
diff --git a/mysql-test/t/windows.test b/mysql-test/t/windows.test
new file mode 100644
index 00000000000..d6bcfeb8cb3
--- /dev/null
+++ b/mysql-test/t/windows.test
@@ -0,0 +1,20 @@
+# Windows-specific tests
+--source include/windows.inc
+
+#
+# Bug 9148: Denial of service
+#
+--error 1049
+use lpt1;
+--error 1049
+use com1;
+--error 1049
+use prn;
+
+#
+# Bug #12325: Can't create table named 'nu'
+#
+create table nu (a int);
+drop table nu;
+
+# End of 4.1 tests