diff options
author | unknown <knielsen@knielsen-hq.org> | 2010-01-11 14:15:28 +0100 |
---|---|---|
committer | unknown <knielsen@knielsen-hq.org> | 2010-01-11 14:15:28 +0100 |
commit | 0855019e3ae0c8d1d20c49a8be317050c093b4dc (patch) | |
tree | c60b27ef063564b256a70addfd51e6f1ca877fac /tests | |
parent | 95c4b56a0a23e3dafee3da29a99dae12a8aa40c1 (diff) | |
download | mariadb-git-0855019e3ae0c8d1d20c49a8be317050c093b4dc.tar.gz |
Fix multiple test suite failures in Buildbot due to races in the test cases or missing server features not properly checked
mysql-test/r/func_misc.result:
Move test that requires query cache from main.func_misc to main.query_cache.
mysql-test/r/mysqltest.result:
Fix test failure due to race.
This test case creates > 300 connections in a tight loop, and depending on thread
scheduling and load, even though each connection is immediately disconnected
before connecting the next one, the server max connections may still be exceeded
due to server not being able to free old connections as fast as new ones are made.
mysql-test/r/query_cache.result:
Move test that requires query cache from main.func_misc to main.query_cache.
Move test that requires query cache from main.variables to main.query_cache.
mysql-test/r/query_cache_notembedded.result:
Move test that requires query cache from main.sp_notembedded to main.query_cache_notembedded.
mysql-test/r/sp_notembedded.result:
Move test that requires query cache from main.sp_notembedded to main.query_cache_notembedded.
mysql-test/r/udf.result:
Move test in main.udf that requires query cache to separate file.
mysql-test/r/udf_query_cache.result:
Move test in main.udf that requires query cache to separate file.
mysql-test/r/variables.result:
Move test that requires query cache from main.variables to main.query_cache.
mysql-test/suite/funcs_1/datadict/processlist_val.inc:
Fix race where result file may show state "cleaning up" in the small window
between setting COMMAND to 'Sleep' and clearing STATE.
mysql-test/suite/rpl/r/rpl_temporary.result:
Fix race with suppression of warning message by fixing the test to not generate the
warning message in the first place.
Problem was a race between creating an anonymous account and resetting the slave.
If the slave reset happens before replicating the account, the subsequest deletion
of the account will fail to replicate correctly due to missing row.
mysql-test/suite/rpl/t/rpl_temporary.test:
Fix race with suppression of warning message by fixing the test to not generate the
warning message in the first place.
Problem was a race between creating an anonymous account and resetting the slave.
If the slave reset happens before replicating the account, the subsequest deletion
of the account will fail to replicate correctly due to missing row.
mysql-test/t/func_misc.test:
Move test that requires query cache from main.func_misc to main.query_cache.
Move test that requires query cache from main.variables to main.query_cache.
mysql-test/t/mysqltest.test:
Fix test failure due to race.
This test case creates > 300 connections in a tight loop, and depending on thread
scheduling and load, even though each connection is immediately disconnected
before connecting the next one, the server max connections may still be exceeded
due to server not being able to free old connections as fast as new ones are made.
mysql-test/t/query_cache.test:
Move test that requires query cache to main.query_cache.
mysql-test/t/query_cache_notembedded.test:
Move test that requires query cache from main.sp_notembedded to main.query_cache_notembedded.
mysql-test/t/sp_notembedded.test:
Move test that requires query cache from main.sp_notembedded to main.query_cache_notembedded.
mysql-test/t/udf.test:
Move test in main.udf that requires query cache to separate file.
mysql-test/t/udf_query_cache-master.opt:
Move test in main.udf that requires query cache to separate file.
mysql-test/t/udf_query_cache.test:
Move test in main.udf that requires query cache to separate file.
mysql-test/t/variables.test:
Move test that requires query cache from main.variables to main.query_cache.
tests/mysql_client_test.c:
In tests that require query cache, skip the test if query cache not available.
Do this dynamically rather than using HAVE_QUERY_CACHE, as there is no guarantee
that the server we run against was compiled with same preprocessor #define as
the mysql_client_test program (and since it is trivial to check dynamically).
Diffstat (limited to 'tests')
-rw-r--r-- | tests/mysql_client_test.c | 46 |
1 files changed, 40 insertions, 6 deletions
diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c index 0efe779c7bc..7f5bcaff083 100644 --- a/tests/mysql_client_test.c +++ b/tests/mysql_client_test.c @@ -2465,6 +2465,34 @@ static uint query_cache_hits(MYSQL *conn) /* + Check that query cache is available in server. +*/ +static my_bool is_query_cache_available() +{ + int rc; + MYSQL_RES *result; + MYSQL_ROW row; + int res= -1; + + rc= mysql_query(mysql, "SHOW VARIABLES LIKE 'have_query_cache'"); + myquery(rc); + + result= mysql_store_result(mysql); + DIE_UNLESS(result); + + row= mysql_fetch_row(result); + DIE_UNLESS(row != NULL); + if (strcmp(row[1], "YES") == 0) + res= 1; + else if (strcmp(row[1], "NO") == 0) + res= 0; + mysql_free_result(result); + + DIE_UNLESS(res == 0 || res == 1); + return res; +} + +/* Test that prepared statements make use of the query cache just as normal statements (BUG#735). */ @@ -2508,6 +2536,12 @@ static void test_ps_query_cache() myheader("test_ps_query_cache"); + if (! is_query_cache_available()) + { + fprintf(stdout, "Skipping test_ps_query_cache: Query cache not available.\n"); + return; + } + rc= mysql_query(mysql, "SET SQL_MODE=''"); myquery(rc); @@ -17863,8 +17897,6 @@ static void test_bug43560(void) Bug#36326: nested transaction and select */ -#ifdef HAVE_QUERY_CACHE - static void test_bug36326() { int rc; @@ -17872,6 +17904,12 @@ static void test_bug36326() DBUG_ENTER("test_bug36326"); myheader("test_bug36326"); + if (! is_query_cache_available()) + { + fprintf(stdout, "Skipping test_bug36326: Query cache not available.\n"); + DBUG_VOID_RETURN; + } + rc= mysql_autocommit(mysql, TRUE); myquery(rc); rc= mysql_query(mysql, "DROP TABLE IF EXISTS t1"); @@ -17911,8 +17949,6 @@ static void test_bug36326() DBUG_VOID_RETURN; } -#endif - /** Bug#41078: With CURSOR_TYPE_READ_ONLY mysql_stmt_fetch() returns short string value. @@ -18373,9 +18409,7 @@ static struct my_tests_st my_tests[]= { { "test_bug38486", test_bug38486 }, { "test_bug40365", test_bug40365 }, { "test_bug43560", test_bug43560 }, -#ifdef HAVE_QUERY_CACHE { "test_bug36326", test_bug36326 }, -#endif { "test_bug41078", test_bug41078 }, { "test_bug44495", test_bug44495 }, { 0, 0 } |