diff options
author | Monty <monty@mariadb.org> | 2019-06-02 11:47:36 +0300 |
---|---|---|
committer | Monty <monty@mariadb.org> | 2019-06-03 15:06:51 +0300 |
commit | 76f14be10f5e6cebf44a93e48673930fdeb50442 (patch) | |
tree | 56403d7cd7bc309f6c121476021318c1d3961607 /tests | |
parent | 2d89a70facaf9c9f71bad1c805c44b625b0f607d (diff) | |
download | mariadb-git-76f14be10f5e6cebf44a93e48673930fdeb50442.tar.gz |
Ensure that tests and programs can restore variables
- --default-character-set can now be disabled in mysqldump
- --skip-resolve can be be disabled in mysqld
- mysql_client_test now resets global variables it changes
- mtr couldn't handle [mysqldump] in config files (wrong regexp used)
Diffstat (limited to 'tests')
-rw-r--r-- | tests/mysql_client_test.c | 30 |
1 files changed, 24 insertions, 6 deletions
diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c index 04717f1946b..c544e20f2fe 100644 --- a/tests/mysql_client_test.c +++ b/tests/mysql_client_test.c @@ -2341,6 +2341,12 @@ static void test_ps_query_cache() "(2, 'hh', 'hh'), (1, 'ii', 'ii'), (2, 'ii', 'ii')"); myquery(rc); + rc= mysql_query(mysql, + "set @save_query_cache_type=" + "@@global.query_cache_type," + "@save_query_cache_size=" + "@@global.query_cache_size"); + myquery(rc); rc= mysql_query(lmysql, "set global query_cache_type=ON"); myquery(rc); rc= mysql_query(lmysql, "set local query_cache_type=ON"); @@ -2497,9 +2503,9 @@ static void test_ps_query_cache() if (lmysql != mysql) mysql_close(lmysql); - rc= mysql_query(mysql, "set global query_cache_size=default"); + rc= mysql_query(mysql, "set global query_cache_size=@save_query_cache_size"); myquery(rc); - rc= mysql_query(mysql, "set global query_cache_type=default"); + rc= mysql_query(mysql, "set global query_cache_type=@save_query_cache_type"); myquery(rc); } @@ -13364,6 +13370,12 @@ static void test_open_cursor_prepared_statement_query_cache() return; } + rc= mysql_query(mysql, + "set @save_query_cache_type=" + "@@global.query_cache_type," + "@save_query_cache_size=" + "@@global.query_cache_size"); + myquery(rc); rc= mysql_query(mysql, "set global query_cache_type=ON"); myquery(rc); rc= mysql_query(mysql, "set local query_cache_type=ON"); @@ -13390,9 +13402,9 @@ static void test_open_cursor_prepared_statement_query_cache() check_execute(stmt, rc); mysql_stmt_close(stmt); - rc= mysql_query(mysql, "set global query_cache_type=default"); + rc= mysql_query(mysql, "set global query_cache_type=@save_query_cache_type"); myquery(rc); - rc= mysql_query(mysql, "set global query_cache_size=default"); + rc= mysql_query(mysql, "set global query_cache_size=@save_query_cache_size"); myquery(rc); } @@ -18177,6 +18189,12 @@ static void test_bug36326() myquery(rc); rc= mysql_query(mysql, "INSERT INTO t1 VALUES (1)"); myquery(rc); + rc= mysql_query(mysql, + "set @save_query_cache_type=" + "@@global.query_cache_type," + "@save_query_cache_size=" + "@@global.query_cache_size"); + myquery(rc); rc= mysql_query(mysql, "SET GLOBAL query_cache_type = 1"); myquery(rc); rc= mysql_query(mysql, "SET LOCAL query_cache_type = 1"); @@ -18204,8 +18222,8 @@ static void test_bug36326() DIE_UNLESS(rc == 1); rc= mysql_query(mysql, "DROP TABLE t1"); myquery(rc); - rc= mysql_query(mysql, "SET GLOBAL query_cache_size = default"); - rc= mysql_query(mysql, "SET GLOBAL query_cache_type = default"); + rc= mysql_query(mysql, "SET GLOBAL query_cache_size = @save_query_cache_size"); + rc= mysql_query(mysql, "SET GLOBAL query_cache_type = @save_query_cache_type"); myquery(rc); DBUG_VOID_RETURN; |