List:Commits« Previous MessageNext Message »
From:tomas Date:April 27 2007 12:50pm
Subject:bk commit into 5.1 tree (tomas:1.2512) BUG#26121
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of tomas. When tomas 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, 2007-04-27 14:50:01+02:00, tomas@stripped +2 -0
  Bug#26121 mysqldump includes LOCK TABLES general_log WRITE
  (backport to telco 6.1)
  - Giving the directive '--all-databases' to mysqldump caused 
    an attempt to lock and dump log tables which don't support this
    operation.
  - With this patch the log tables are excluded from the set of
    databases tables to dump.

  client/mysqldump.c@stripped, 2007-04-27 14:49:59+02:00, tomas@stripped +12 -4
    - Ignore log tables which can't be locked.

  mysql-test/t/mysqldump.test@stripped, 2007-04-27 14:49:59+02:00, tomas@stripped +7 -0
    Added test

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	tomas
# Host:	whalegate.ndb.mysql.com
# Root:	/home/tomas/mysql-5.1-telco-6.1

--- 1.264/client/mysqldump.c	2007-01-17 19:45:38 +01:00
+++ 1.265/client/mysqldump.c	2007-04-27 14:49:59 +02:00
@@ -817,11 +817,15 @@
                 (hash_get_key) get_table_key,
                 (hash_free_key) free_table_ent, 0))
     return(EX_EOM);
-  /* Don't copy cluster internal log tables */
+  /* Don't copy internal log tables */
   if (my_hash_insert(&ignore_table,
                      (byte*) my_strdup("mysql.apply_status", MYF(MY_WME))) ||
       my_hash_insert(&ignore_table,
-                     (byte*) my_strdup("mysql.schema", MYF(MY_WME))))
+                     (byte*) my_strdup("mysql.schema", MYF(MY_WME))) ||
+      my_hash_insert(&ignore_table,
+                     (byte*) my_strdup("mysql.general_log", MYF(MY_WME))) ||
+      my_hash_insert(&ignore_table,
+                     (byte*) my_strdup("mysql.slow_log", MYF(MY_WME))))
     return(EX_EOM);
 
   if ((ho_error= handle_options(argc, argv, my_long_options, get_one_option)))
@@ -3283,8 +3287,12 @@
     init_dynamic_string(&query, "LOCK TABLES ", 256, 1024);
     for (numrows= 0 ; (table= getTableName(1)) ; numrows++)
     {
-      dynstr_append(&query, quote_name(table, table_buff, 1));
-      dynstr_append(&query, " READ /*!32311 LOCAL */,");
+      char *end= strmov(afterdot, table);
+      if (include_table(hash_key,end - hash_key))
+      {
+        dynstr_append(&query, quote_name(table, table_buff, 1));
+        dynstr_append(&query, " READ /*!32311 LOCAL */,");
+      }
     }
     if (numrows && mysql_real_query(mysql, query.str, query.length-1))
       DB_error(mysql, "when using LOCK TABLES");

--- 1.128/mysql-test/t/mysqldump.test	2006-12-08 23:52:14 +01:00
+++ 1.129/mysql-test/t/mysqldump.test	2007-04-27 14:49:59 +02:00
@@ -1544,6 +1544,13 @@
 drop table t1;
 drop database mysqldump_test_db;
 
+#
+# BUG#26121 mysqldump includes LOCK TABLES general_log WRITE
+#
+--exec $MYSQL_DUMP --all-databases > $MYSQLTEST_VARDIR/tmp/bug26121.sql
+--exec $MYSQL < $MYSQLTEST_VARDIR/tmp/bug26121.sql
+--remove_file $MYSQLTEST_VARDIR/tmp/bug26121.sql
+
 --echo #
 --echo # End of 5.1 tests
 --echo #
Thread
bk commit into 5.1 tree (tomas:1.2512) BUG#26121tomas27 Apr