From 4e116fe70bdee0e051adb8c271fc85c5e0f6062d Mon Sep 17 00:00:00 2001 From: "kostja@dipika.(none)" <> Date: Tue, 26 Feb 2008 17:25:21 +0300 Subject: [PATCH] Valgrind errors in mysql_client_test. --- tests/mysql_client_test.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c index 7466f20fbdc..26c243d89a4 100644 --- a/tests/mysql_client_test.c +++ b/tests/mysql_client_test.c @@ -8985,6 +8985,7 @@ static void test_sqlmode() fprintf(stdout, "\n query: %s", query); stmt= mysql_simple_prepare(mysql, query); check_stmt(stmt); + mysql_stmt_close(stmt); /* ANSI */ strmov(query, "SET SQL_MODE= \"ANSI\""); @@ -17334,12 +17335,36 @@ static void test_bug28386() int rc; MYSQL_STMT *stmt; MYSQL_RES *result; + MYSQL_ROW row; MYSQL_BIND bind; const char hello[]= "hello world!"; DBUG_ENTER("test_bug28386"); myheader("test_bug28386"); + rc= mysql_query(mysql, "select @@global.log_output"); + myquery(rc); + + result= mysql_store_result(mysql); + DIE_UNLESS(result); + + row= mysql_fetch_row(result); + if (! strstr(row[0], "TABLE")) + { + mysql_free_result(result); + if (! opt_silent) + printf("Skipping the test since logging to tables is not enabled\n"); + /* Log output is not to tables */ + return; + } + mysql_free_result(result); + + rc= mysql_query(mysql, "set @save_global_general_log=@@global.general_log"); + myquery(rc); + + rc= mysql_query(mysql, "set @@global.general_log=on"); + myquery(rc); + rc= mysql_query(mysql, "truncate mysql.general_log"); myquery(rc); @@ -17380,6 +17405,9 @@ static void test_bug28386() mysql_free_result(result); + rc= mysql_query(mysql, "set @@global.general_log=@save_global_general_log"); + myquery(rc); + DBUG_VOID_RETURN; }