summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authordavi@mysql.com/endora.local <>2008-02-25 07:48:02 -0300
committerdavi@mysql.com/endora.local <>2008-02-25 07:48:02 -0300
commitbccbc79d0754e6f805ad96a0bc86d4804b66dc85 (patch)
tree015d9e1bd0360bfceeb9247d6e470bf931540aff /tests
parenta86ca245949b12697737b7d765df302cdbd9d3ca (diff)
downloadmariadb-git-bccbc79d0754e6f805ad96a0bc86d4804b66dc85.tar.gz
Bug#28386 the general log is incomplete
The problem is that the commands COM_STMT_CLOSE, COM_STMT_RESET, COM_STMT_SEND_LONG_DATA weren't being logged to the general log. The solution is to log the general log the aforementioned commands.
Diffstat (limited to 'tests')
-rw-r--r--tests/mysql_client_test.c60
1 files changed, 60 insertions, 0 deletions
diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c
index d85a40f7393..01177ffed3c 100644
--- a/tests/mysql_client_test.c
+++ b/tests/mysql_client_test.c
@@ -17313,6 +17313,65 @@ static void test_bug31669()
DBUG_VOID_RETURN;
}
+
+/**
+ Bug#28386 the general log is incomplete
+*/
+
+static void test_bug28386()
+{
+ int rc;
+ MYSQL_STMT *stmt;
+ MYSQL_RES *result;
+ MYSQL_BIND bind;
+ const char hello[]= "hello world!";
+
+ DBUG_ENTER("test_bug28386");
+ myheader("test_bug28386");
+
+ rc= mysql_query(mysql, "truncate mysql.general_log");
+ myquery(rc);
+
+ stmt= mysql_simple_prepare(mysql, "SELECT ?");
+ check_stmt(stmt);
+
+ memset(&bind, 0, sizeof(bind));
+
+ bind.buffer_type= MYSQL_TYPE_STRING;
+ bind.buffer= (void *) hello;
+ bind.buffer_length= sizeof(hello);
+
+ mysql_stmt_bind_param(stmt, &bind);
+ mysql_stmt_send_long_data(stmt, 0, hello, sizeof(hello));
+
+ rc= mysql_stmt_execute(stmt);
+ check_execute(stmt, rc);
+
+ rc= my_process_stmt_result(stmt);
+ DIE_UNLESS(rc == 1);
+
+ rc= mysql_stmt_reset(stmt);
+ check_execute(stmt, rc);
+
+ rc= mysql_stmt_close(stmt);
+ DIE_UNLESS(!rc);
+
+ rc= mysql_query(mysql, "select * from mysql.general_log where "
+ "command_type='Close stmt' or "
+ "command_type='Reset stmt' or "
+ "command_type='Long Data'");
+ myquery(rc);
+
+ result= mysql_store_result(mysql);
+ mytest(result);
+
+ DIE_UNLESS(mysql_num_rows(result) == 3);
+
+ mysql_free_result(result);
+
+ DBUG_VOID_RETURN;
+}
+
/*
Read and parse arguments and MySQL options from my.cnf
*/
@@ -17618,6 +17677,7 @@ static struct my_tests_st my_tests[]= {
{ "test_bug20023", test_bug20023 },
{ "test_bug31418", test_bug31418 },
{ "test_bug31669", test_bug31669 },
+ { "test_bug28386", test_bug28386 },
{ 0, 0 }
};