Commit 6b9db6d2 authored by unknown's avatar unknown

Valgrind errors in mysql_client_test.


tests/mysql_client_test.c:
  Fix a memory leak.
  Run the test for Bug#28386 only if logging to tables is enabled.
parent 0a1c0059
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment