diff options
author | Bjorn Munch <bjorn.munch@oracle.com> | 2011-09-14 15:15:36 +0200 |
---|---|---|
committer | Bjorn Munch <bjorn.munch@oracle.com> | 2011-09-14 15:15:36 +0200 |
commit | a238e6ada252aaf8c0f9f146ec46c15ea13309e7 (patch) | |
tree | a99d3c540d0a643fd383ee8311dd153d785846d3 /mysql-test/t/mysqltest.test | |
parent | b01b7dc2486ea5744d5f1c4b314f25d20c5d809d (diff) | |
download | mariadb-git-a238e6ada252aaf8c0f9f146ec46c15ea13309e7.tar.gz |
Bug #12956584 MYSQLTEST: --ENABLE_X OR --DISABLE_X APPLYING ONLY TO NEXT COMMAND/STMT
Added a keyword ONCE to add to those commands
Some internal tables to keep track of which properties are
temporarily overriden
Added tests in mysqltest.test
Updates to other tests will be done later
Diffstat (limited to 'mysql-test/t/mysqltest.test')
-rw-r--r-- | mysql-test/t/mysqltest.test | 61 |
1 files changed, 52 insertions, 9 deletions
diff --git a/mysql-test/t/mysqltest.test b/mysql-test/t/mysqltest.test index 9fa41b9eb51..6279a392119 100644 --- a/mysql-test/t/mysqltest.test +++ b/mysql-test/t/mysqltest.test @@ -383,6 +383,54 @@ select 3 from t1 ; --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 --enable and --disable with ONCE +# ---------------------------------------------------------------------------- + +--disable_abort_on_error ONCE +garbage; +--disable_abort_on_error ONCE +--remove_file DoesNotExist + +--disable_result_log +select 2; +--enable_result_log ONCE +select 3; +select 5; +--enable_result_log + +# ---------------------------------------------------------------------------- +# Test cumulative ONCE +# ---------------------------------------------------------------------------- + +--disable_abort_on_error ONCE +--disable_query_log ONCE +select 3 from t1; +select 7; + +--error 1 +--exec echo "--disable_info OCNE" | $MYSQL_TEST 2>&1 + +--enable_connect_log ONCE +connect (con1,localhost,root,,); +connection default; +disconnect con1; + +# ---------------------------------------------------------------------------- +# Test ONCE can be combined with --error or modifiers like lowercase +# ---------------------------------------------------------------------------- + +--disable_result_log ONCE +--error ER_NO_SUCH_TABLE +select 5 from t1; + +--disable_query_log ONCE +--lowercase_result +select "CASE" as "LOWER"; + +--sorted_result +--disable_query_log ONCE +select "xyz" as name union select "abc" as name order by name desc; # ---------------------------------------------------------------------------- # Test comments @@ -952,10 +1000,9 @@ while ($outer) --source $MYSQLTEST_VARDIR/tmp/sourced.inc --error ER_NO_SUCH_TABLE SELECT * from nowhere; - --disable_abort_on_error + --disable_abort_on_error ONCE # Statement giving a different error, to make sure we don't mask it SELECT * FROM nowhere else; - --enable_abort_on_error } dec $outer; inc $ifval; @@ -1104,9 +1151,8 @@ system echo "hej" > /dev/null; --error 1 --exec echo "system $NONEXISTSINFVAREABLI;" | $MYSQL_TEST 2>&1 ---disable_abort_on_error +--disable_abort_on_error ONCE system NonExistsinfComamdn 2> /dev/null; ---enable_abort_on_error # ---------------------------------------------------------------------------- @@ -2517,10 +2563,9 @@ INSERT INTO t1 SELECT f1 - 64 FROM t1; INSERT INTO t1 SELECT f1 - 128 FROM t1; INSERT INTO t1 SELECT f1 - 256 FROM t1; INSERT INTO t1 SELECT f1 - 512 FROM t1; ---disable_result_log +--disable_result_log ONCE --sorted_result SELECT * FROM t1; ---enable_result_log DROP TABLE t1; # ---------------------------------------------------------------------------- @@ -2568,11 +2613,9 @@ SELECT 0 as "WILL NOT lower case ÄËÐ"; --exec $MYSQL_TEST --help 2>&1 > /dev/null --exec $MYSQL_TEST --version 2>&1 > /dev/null --enable_query_log ---disable_abort_on_error +--disable_abort_on_error ONCE --error 1 --exec $MYSQL_TEST a b c 2>&1 > /dev/null ---enable_abort_on_error ---enable_query_log # ---------------------------------------------------------------------------- # test for query_get_value |