List:Commits« Previous MessageNext Message »
From:<gshchepa Date:September 5 2007 8:35am
Subject:bk commit into 5.1 tree (gshchepa:1.2572) BUG#29938
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of uchum. When uchum 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-09-05 11:35:29+05:00, gshchepa@stripped +3 -0
  Fixed bug #29938.
  mysqldump --skip-events --all-databases dumped data of the mysqld.event table,
  and during the restoration from this dump events were created in spite
  of the --skip-events option.
  
  The mysqldump client has been modified to ignore mysql.event table data
  in case of --skip-events options.

  client/mysqldump.c@stripped, 2007-09-05 11:35:01+05:00, gshchepa@stripped +12 -0
    Fixed bug #29938.
    The dump_table function has been modified to skip dumping of
    the mysql.event table data in case of the --skip-event mysqldump
    client option.

  mysql-test/r/mysqldump.result@stripped, 2007-09-05 11:35:15+05:00, gshchepa@stripped +13 -0
    Updated test case for bug #29938.

  mysql-test/t/mysqldump.test@stripped, 2007-09-05 11:35:13+05:00, gshchepa@stripped +16 -0
    Updated test case for bug #29938.

diff -Nrup a/client/mysqldump.c b/client/mysqldump.c
--- a/client/mysqldump.c	2007-08-15 18:42:54 +05:00
+++ b/client/mysqldump.c	2007-09-05 11:35:01 +05:00
@@ -3039,6 +3039,18 @@ static void dump_table(char *table, char
     DBUG_VOID_RETURN;
   }
 
+  /*
+     Check --skip-events flag: it is not enough to skip creation of events
+     discarding SHOW CREATE EVENT statements generation. The myslq.event
+     table data should be skipped too.
+  */
+  if (!opt_events && !my_strcasecmp(&my_charset_latin1, db, "mysql")
&&
+      !my_strcasecmp(&my_charset_latin1, table, "event"))
+  {
+    verbose_msg("-- Skipping data table mysql.event, --skip-events was used\n");
+    DBUG_VOID_RETURN;
+  }
+
   result_table= quote_name(table,table_buff, 1);
   opt_quoted_table= quote_name(table, table_buff2, 0);
 
diff -Nrup a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result
--- a/mysql-test/r/mysqldump.result	2007-08-01 13:30:11 +05:00
+++ b/mysql-test/r/mysqldump.result	2007-09-05 11:35:15 +05:00
@@ -4177,5 +4177,18 @@ set names latin1;
 # Cleanup.
 DROP DATABASE mysqldump_test_db;
 #
+# BUG#29938: wrong behavior of mysqldump --skip-events
+#            with --all-databases
+#
+TRUNCATE mysql.event;
+USE test;
+CREATE event e29938 ON SCHEDULE AT '2035-12-31 20:01:23' DO SET @bug29938=29938;
+SHOW EVENTS;
+Db	Name	Definer	Time zone	Type	Execute at	Interval value	Interval
field	Starts	Ends	Status	Originator	character_set_client	collation_connection	Database
Collation
+test	e29938	root@localhost	SYSTEM	ONE TIME	2035-12-31
20:01:23	NULL	NULL	NULL	NULL	ENABLED	1	latin1	latin1_swedish_ci	latin1_swedish_ci
+TRUNCATE mysql.event;
+SHOW EVENTS;
+Db	Name	Definer	Time zone	Type	Execute at	Interval value	Interval
field	Starts	Ends	Status	Originator	character_set_client	collation_connection	Database
Collation
+#
 # End of 5.1 tests
 #
diff -Nrup a/mysql-test/t/mysqldump.test b/mysql-test/t/mysqldump.test
--- a/mysql-test/t/mysqldump.test	2007-08-01 00:45:25 +05:00
+++ b/mysql-test/t/mysqldump.test	2007-09-05 11:35:13 +05:00
@@ -1756,5 +1756,21 @@ DROP DATABASE mysqldump_test_db;
 ###########################################################################
 
 --echo #
+--echo # BUG#29938: wrong behavior of mysqldump --skip-events
+--echo #            with --all-databases
+--echo #
+
+TRUNCATE mysql.event;
+
+USE test;
+CREATE event e29938 ON SCHEDULE AT '2035-12-31 20:01:23' DO SET @bug29938=29938;
+SHOW EVENTS;
+--exec $MYSQL_DUMP --skip-events --all-databases > $MYSQLTEST_VARDIR/tmp/bug29938.sql
+
+TRUNCATE mysql.event;
+--exec $MYSQL < $MYSQLTEST_VARDIR/tmp/bug29938.sql
+SHOW EVENTS;
+
+--echo #
 --echo # End of 5.1 tests
 --echo #
Thread
bk commit into 5.1 tree (gshchepa:1.2572) BUG#29938gshchepa5 Sep