MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Davi Arnaut Date:March 25 2008 1:39am
Subject:bk commit into 5.1 tree (davi:1.2571)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of davi.  When davi does a push these changes
will be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2008-03-24 22:39:48-03:00, davi@stripped +1 -0
  Patch for bug 28386 enabled table logging for all tests in
  mysql_client_test causing a severe slowdown and increase
  in memory usage, especially for test cases with long queries.
  
  The solution is to enable the general log only in tests that
  actually need the general log and disable it during the
  execution of all other tests.

  tests/mysql_client_test.c@stripped, 2008-03-24 22:39:45-03:00, davi@stripped +42 -11
    Selectively enable and disable the general log.

diff -Nrup a/tests/mysql_client_test.c b/tests/mysql_client_test.c
--- a/tests/mysql_client_test.c	2008-03-18 08:13:32 -03:00
+++ b/tests/mysql_client_test.c	2008-03-24 22:39:45 -03:00
@@ -13233,6 +13233,40 @@ static void test_bug15518()
 }
 
 
+static void disable_general_log()
+{
+  int rc;
+  rc= mysql_query(mysql, "set @@global.general_log=off");
+  myquery(rc);
+}
+
+
+static void enable_general_log(int truncate)
+{
+  int rc;
+
+  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);
+
+  if (truncate)
+  {
+    rc= mysql_query(mysql, "truncate mysql.general_log");
+    myquery(rc);
+  }
+}
+
+
+static void restore_general_log()
+{
+  int rc;
+  rc= mysql_query(mysql, "set @@global.general_log=@save_global_general_log");
+  myquery(rc);
+}
+
+
 static void test_view_sp_list_fields()
 {
   int		rc;
@@ -15397,6 +15431,8 @@ static void test_bug17667()
     return;
   }
 
+  enable_general_log(1);
+
   for (statement_cursor= statements; statement_cursor->buffer != NULL;
        statement_cursor++)
   {
@@ -15475,6 +15511,8 @@ static void test_bug17667()
              statement_cursor->buffer);
   }
 
+  restore_general_log();
+
   if (!opt_silent)
     printf("success.  All queries found intact in the log.\n");
 
@@ -17301,14 +17339,7 @@ static void test_bug28386()
   }
   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);
+  enable_general_log(1);
 
   stmt= mysql_simple_prepare(mysql, "SELECT ?");
   check_stmt(stmt);
@@ -17347,8 +17378,7 @@ static void test_bug28386()
 
   mysql_free_result(result);
 
-  rc= mysql_query(mysql, "set @@global.general_log=@save_global_general_log");
-  myquery(rc);
+  restore_general_log();
 
   DBUG_VOID_RETURN;
 }
@@ -17429,7 +17459,8 @@ and you are welcome to modify and redist
 
 
 static struct my_tests_st my_tests[]= {
-  { "test_view_sp_list_fields", test_view_sp_list_fields},
+  { "disable_general_log", disable_general_log },
+  { "test_view_sp_list_fields", test_view_sp_list_fields },
   { "client_query", client_query },
   { "test_prepare_insert_update", test_prepare_insert_update},
 #if NOT_YET_WORKING
Thread
bk commit into 5.1 tree (davi:1.2571)Davi Arnaut25 Mar