diff options
author | unknown <msvensson@devsrv-b.mysql.com> | 2005-12-02 23:37:38 +0100 |
---|---|---|
committer | unknown <msvensson@devsrv-b.mysql.com> | 2005-12-02 23:37:38 +0100 |
commit | cf7e0d124643289a2f473119cacba1ce6d83ef67 (patch) | |
tree | 8d78cfbca05e0c3228f30fc25247e72a4a0f6b64 | |
parent | 07b81edba6417369a8a350d979d8320658003663 (diff) | |
parent | 67de8bb098b974afb268c6525ac2925d9b413b9a (diff) | |
download | mariadb-git-cf7e0d124643289a2f473119cacba1ce6d83ef67.tar.gz |
Merge msvensson@bk-internal.mysql.com:/home/bk/mysql-5.0
into devsrv-b.mysql.com:/space/magnus/my50-bug11731
-rw-r--r-- | mysql-test/r/mysqltest.result | 22 | ||||
-rw-r--r-- | mysql-test/t/mysqltest.test | 46 |
2 files changed, 68 insertions, 0 deletions
diff --git a/mysql-test/r/mysqltest.result b/mysql-test/r/mysqltest.result index 54bdb1b45d8..56ee329fb28 100644 --- a/mysql-test/r/mysqltest.result +++ b/mysql-test/r/mysqltest.result @@ -391,3 +391,25 @@ root@localhost -------------------------------------------------------------------------------- this will be executed this will be executed +mysqltest: At line 2: query 'create table t1 (a int primary key); +insert into t1 values (1); +select 'select-me'; +insertz 'error query'' 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 'insertz 'error query'' at line 1 +drop table t1; +drop table t1; +create table t1 (a int primary key); +insert into t1 values (1); +select 'select-me'; +insertz error query|||| +select-me +select-me +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 'insertz error query' at line 1 +drop table t1; +create table t1 (a int primary key); +insert into t1 values (1); +select 'select-me'; +insertz error query|||| +select-me +select-me +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 'insertz error query' at line 1 +drop table t1; diff --git a/mysql-test/t/mysqltest.test b/mysql-test/t/mysqltest.test index 3d9dff4d373..6e56fac2f86 100644 --- a/mysql-test/t/mysqltest.test +++ b/mysql-test/t/mysqltest.test @@ -945,3 +945,49 @@ select "this will not be executed"; --enable_parsing select "this will be executed"; --enable_query_log + + +# +# Bug #11731 mysqltest in multi-statement queries ignores errors in +# non-1st queries +# + +# Failing multi statement query +--exec echo "delimiter ||||;" > var/tmp/bug11731.sql +--exec echo "create table t1 (a int primary key);" >> var/tmp/bug11731.sql +--exec echo "insert into t1 values (1);" >> var/tmp/bug11731.sql +--exec echo "select 'select-me';" >> var/tmp/bug11731.sql +--exec echo "insertz 'error query'||||" >> var/tmp/bug11731.sql +--exec echo "delimiter ;||||" >> var/tmp/bug11731.sql + +--error 1 +--exec $MYSQL_TEST -x $MYSQL_TEST_DIR/var/tmp/bug11731.sql 2>&1 +drop table t1; + +--error 1 +--exec $MYSQL_TEST --record -x $MYSQL_TEST_DIR/var/tmp/bug11731.sql -R $MYSQL_TEST_DIR/var/tmp/bug11731.out +# The .out file should be empty, cat will fail! +--error 1 +--exec cat $MYSQL_TEST_DIR/var/tmp/bug11731.out +drop table t1; + + +# Using expected error +--exec echo "delimiter ||||;" > var/tmp/bug11731.sql +--exec echo "--error 1064" >> var/tmp/bug11731.sql +--exec echo "create table t1 (a int primary key);" >> var/tmp/bug11731.sql +--exec echo "insert into t1 values (1);" >> var/tmp/bug11731.sql +--exec echo "select 'select-me';" >> var/tmp/bug11731.sql +--exec echo "insertz "error query"||||" >> var/tmp/bug11731.sql +--exec echo "delimiter ;||||" >> var/tmp/bug11731.sql + +# These two should work since the error is expected +--exec $MYSQL_TEST -x $MYSQL_TEST_DIR/var/tmp/bug11731.sql 2>&1 +drop table t1; + +--exec $MYSQL_TEST --record -x $MYSQL_TEST_DIR/var/tmp/bug11731.sql -R $MYSQL_TEST_DIR/var/tmp/bug11731.out +--exec cat $MYSQL_TEST_DIR/var/tmp/bug11731.out +drop table t1; + + + |