List:Commits« Previous MessageNext Message »
From:<gshchepa Date:August 24 2007 8:29pm
Subject:bk commit into 5.0 tree (gshchepa:1.2504) BUG#30126
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 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-08-24 23:29:31+05:00, gshchepa@stripped +5 -0
  Fixed bug #30126.
  When dumping database from the old (4.x) server, the mysqldump client
  inserted a delimiter sign inside special commentaries of the form:
    /*!... CREATE DATABASE IF NOT EXISTS ... ;*/
  During restoration that dump file was splitten by delimiter signs on
  the client side, and the rest of some commentary strings was prepended
  to following statements.

  client/mysqldump.c@stripped, 2007-08-24 23:00:46+05:00, gshchepa@stripped +1 -1
    Fixed bug #30126.
    The init_dumping_tables function has been modified to output semicolon
    outside of commentaries.

  mysql-test/r/mysqldump-old.result@stripped, 2007-08-24 22:59:06+05:00, gshchepa@stripped +7
-0
    Added testcase for bug #30126.

  mysql-test/r/mysqldump-old.result@stripped, 2007-08-24 22:59:06+05:00, gshchepa@stripped +0
-0

  mysql-test/t/mysqldump-old.opt@stripped, 2007-08-24 22:59:06+05:00, gshchepa@stripped +1 -0
    Added testcase for bug #30126.

  mysql-test/t/mysqldump-old.opt@stripped, 2007-08-24 22:59:06+05:00, gshchepa@stripped +0 -0

  mysql-test/t/mysqldump-old.test@stripped, 2007-08-24 22:59:06+05:00, gshchepa@stripped +16 -0
    Added testcase for bug #30126.

  mysql-test/t/mysqldump-old.test@stripped, 2007-08-24 22:59:06+05:00, gshchepa@stripped +0 -0

  sql/sql_parse.cc@stripped, 2007-08-24 23:00:44+05:00, gshchepa@stripped +2 -0
    Fixed bug #30126.
    Debugging code has been added to the mysql_execute_command function
    to emulate old (4.0+) server answer to 'CREADE DATABASE IF NOT EXISTS"
    in case of the --loose-debug=d,mysqldump_old server option.

diff -Nrup a/client/mysqldump.c b/client/mysqldump.c
--- a/client/mysqldump.c	2007-07-31 21:00:52 +05:00
+++ b/client/mysqldump.c	2007-08-24 23:00:46 +05:00
@@ -2898,7 +2898,7 @@ int init_dumping_tables(char *qdatabase)
       /* Old server version, dump generic CREATE DATABASE */
       if (opt_drop_database)
         fprintf(md_result_file,
-                "\n/*!40000 DROP DATABASE IF EXISTS %s;*/\n",
+                "\n/*!40000 DROP DATABASE IF EXISTS %s*/;\n",
                 qdatabase);
       fprintf(md_result_file,
               "\nCREATE DATABASE /*!32312 IF NOT EXISTS*/ %s;\n",
diff -Nrup a/mysql-test/r/mysqldump-old.result b/mysql-test/r/mysqldump-old.result
--- /dev/null	Wed Dec 31 16:00:00 196900
+++ b/mysql-test/r/mysqldump-old.result	2007-08-24 22:59:06 +05:00
@@ -0,0 +1,7 @@
+#
+# Bug #30126: semicolon before closing */ in /*!... CREATE DATABASE ;*/
+#
+CREATE DATABASE mysqldump_30126;
+USE mysqldump_30126;
+CREATE TABLE t1 (c1 int);
+DROP DATABASE mysqldump_30126;
diff -Nrup a/mysql-test/t/mysqldump-old.opt b/mysql-test/t/mysqldump-old.opt
--- /dev/null	Wed Dec 31 16:00:00 196900
+++ b/mysql-test/t/mysqldump-old.opt	2007-08-24 22:59:06 +05:00
@@ -0,0 +1 @@
+--loose-debug=d,mysqldump_old
diff -Nrup a/mysql-test/t/mysqldump-old.test b/mysql-test/t/mysqldump-old.test
--- /dev/null	Wed Dec 31 16:00:00 196900
+++ b/mysql-test/t/mysqldump-old.test	2007-08-24 22:59:06 +05:00
@@ -0,0 +1,16 @@
+# Embedded server doesn't support external clients
+--source include/not_embedded.inc
+
+# Binlog is required
+--source include/have_log_bin.inc
+
+--echo #
+--echo # Bug #30126: semicolon before closing */ in /*!... CREATE DATABASE ;*/
+--echo #
+
+CREATE DATABASE mysqldump_30126;
+USE mysqldump_30126;
+CREATE TABLE t1 (c1 int);
+--exec $MYSQL_DUMP --add-drop-database --skip-comments --databases mysqldump_30126 >
$MYSQLTEST_VARDIR/tmp/bug30126.sql
+--exec $MYSQL mysqldump_30126 < $MYSQLTEST_VARDIR/tmp/bug30126.sql
+DROP DATABASE mysqldump_30126;
diff -Nrup a/sql/sql_parse.cc b/sql/sql_parse.cc
--- a/sql/sql_parse.cc	2007-08-05 08:53:13 +05:00
+++ b/sql/sql_parse.cc	2007-08-24 23:00:44 +05:00
@@ -3990,6 +3990,8 @@ end_with_restore_list:
   }
   case SQLCOM_SHOW_CREATE_DB:
   {
+    DBUG_EXECUTE_IF("mysqldump_old",
+                    my_error(ER_UNKNOWN_ERROR, MYF(0)); goto error;);
     if (!strip_sp(lex->name) || check_db_name(lex->name))
     {
       my_error(ER_WRONG_DB_NAME, MYF(0), lex->name);
Thread
bk commit into 5.0 tree (gshchepa:1.2504) BUG#30126gshchepa24 Aug