summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorGeorgi Kodinov <Georgi.Kodinov@Oracle.com>2010-09-20 17:17:32 +0300
committerGeorgi Kodinov <Georgi.Kodinov@Oracle.com>2010-09-20 17:17:32 +0300
commit353739fdef95fb1765dbbadf14ce1a9849a36137 (patch)
tree4b2b7364d1e622b3b02db3fb9d0c898fb9293a87 /tests
parent9fee5866beed47b55c5196acfa1a03503a13a2d7 (diff)
parentf4444c0016c68feb3f300c4b30b886cd407f5824 (diff)
downloadmariadb-git-353739fdef95fb1765dbbadf14ce1a9849a36137.tar.gz
merge of mysql-5.5 into mysql-5.5-wl1054
Diffstat (limited to 'tests')
-rw-r--r--tests/mysql_client_test.c49
1 files changed, 39 insertions, 10 deletions
diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c
index edb98f8c1a7..71dc56e31e7 100644
--- a/tests/mysql_client_test.c
+++ b/tests/mysql_client_test.c
@@ -13623,37 +13623,52 @@ static void test_bug15518()
}
-static void disable_general_log()
+static void disable_query_logs()
{
int rc;
rc= mysql_query(mysql, "set @@global.general_log=off");
myquery(rc);
+ rc= mysql_query(mysql, "set @@global.slow_query_log=off");
+ myquery(rc);
}
-static void enable_general_log(int truncate)
+static void enable_query_logs(int truncate)
{
int rc;
rc= mysql_query(mysql, "set @save_global_general_log=@@global.general_log");
myquery(rc);
+ rc= mysql_query(mysql, "set @save_global_slow_query_log=@@global.slow_query_log");
+ myquery(rc);
+
rc= mysql_query(mysql, "set @@global.general_log=on");
myquery(rc);
+ rc= mysql_query(mysql, "set @@global.slow_query_log=on");
+ myquery(rc);
+
+
if (truncate)
{
rc= mysql_query(mysql, "truncate mysql.general_log");
myquery(rc);
+
+ rc= mysql_query(mysql, "truncate mysql.slow_log");
+ myquery(rc);
}
}
-static void restore_general_log()
+static void restore_query_logs()
{
int rc;
rc= mysql_query(mysql, "set @@global.general_log=@save_global_general_log");
myquery(rc);
+
+ rc= mysql_query(mysql, "set @@global.slow_query_log=@save_global_slow_query_log");
+ myquery(rc);
}
@@ -15823,7 +15838,7 @@ static void test_bug17667()
return;
}
- enable_general_log(1);
+ enable_query_logs(1);
for (statement_cursor= statements; statement_cursor->buffer != NULL;
statement_cursor++)
@@ -15903,7 +15918,7 @@ static void test_bug17667()
statement_cursor->buffer);
}
- restore_general_log();
+ restore_query_logs();
if (!opt_silent)
printf("success. All queries found intact in the log.\n");
@@ -17766,7 +17781,7 @@ static void test_bug28386()
}
mysql_free_result(result);
- enable_general_log(1);
+ enable_query_logs(1);
stmt= mysql_simple_prepare(mysql, "SELECT ?");
check_stmt(stmt);
@@ -17805,7 +17820,7 @@ static void test_bug28386()
mysql_free_result(result);
- restore_general_log();
+ restore_query_logs();
DBUG_VOID_RETURN;
}
@@ -18856,7 +18871,7 @@ static void test_bug42373()
Bug#54041: MySQL 5.0.92 fails when tests from Connector/C suite run
*/
-static void test_bug54041()
+static void test_bug54041_impl()
{
int rc;
MYSQL_STMT *stmt;
@@ -18871,7 +18886,7 @@ static void test_bug54041()
rc= mysql_query(mysql, "CREATE TABLE t1 (a INT)");
myquery(rc);
- stmt= mysql_simple_prepare(mysql, "INSERT INTO t1 (a) VALUES (?)");
+ stmt= mysql_simple_prepare(mysql, "SELECT a FROM t1 WHERE a > ?");
check_stmt(stmt);
verify_param_count(stmt, 1);
@@ -18909,6 +18924,20 @@ static void test_bug54041()
}
+/**
+ Bug#54041: MySQL 5.0.92 fails when tests from Connector/C suite run
+*/
+
+static void test_bug54041()
+{
+ enable_query_logs(0);
+ test_bug54041_impl();
+ disable_query_logs();
+ test_bug54041_impl();
+ restore_query_logs();
+}
+
+
/*
Bug#49972: Crash in prepared statements.
@@ -19098,7 +19127,7 @@ and you are welcome to modify and redistribute it under the GPL license\n");
static struct my_tests_st my_tests[]= {
- { "disable_general_log", disable_general_log },
+ { "disable_query_logs", disable_query_logs },
{ "test_view_sp_list_fields", test_view_sp_list_fields },
{ "client_query", client_query },
{ "test_prepare_insert_update", test_prepare_insert_update},