summaryrefslogtreecommitdiff
path: root/mysql-test/t/mysqldump-compat.test
diff options
context:
space:
mode:
authorunknown <gshchepa/uchum@gleb.loc>2007-08-31 16:59:07 +0500
committerunknown <gshchepa/uchum@gleb.loc>2007-08-31 16:59:07 +0500
commitff149b713cc8fef67a6b25945efa8e4f4f65bcdb (patch)
treec9ca0c7e92c4c979b542002264f72e5f0e880220 /mysql-test/t/mysqldump-compat.test
parent294a43ec5e8644e197620a18371ca3c920f6bb5b (diff)
downloadmariadb-git-ff149b713cc8fef67a6b25945efa8e4f4f65bcdb.tar.gz
Fixed bug #30126.
When dumping database from a 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. The 4x_server_emul test case option has been added for use with the DBUG_EXECUTE_IF debugging macro. This option affects debug server builds only to emulate particular behavior of a 4.x server for the mysqldump client testing. Non-debugging builds are not affected. mysql-test/r/mysqldump-compat.result: Added test case for bug #30126. mysql-test/t/mysqldump-compat.opt: Added test case for bug #30126. mysql-test/t/mysqldump-compat.test: Added test case for bug #30126. sql/sql_parse.cc: Fixed bug #30126. The mysqldump client uses the "SHOW CREATE DATABASE" query to obtain the "CREATE DATABASE" statement from that database. The 4.x server doesn't recognise that query, and mysqldump forms the "CREATE DATABASE" statement from scratch. That statement was formed incorrectly. To enforce the mysqldump client to create that statement from scratch, debugging code has been added to the mysql_execute_command function: in tcase of the --loose-debug=d,4x_server_emul option, the server returns parse error to client to emulate old behaviour. The 4x_server_emul test case option has been added for use with the DBUG_EXECUTE_IF debugging macro. This option affects debug server builds only to emulate particular behavior of a 4.x server for the mysqldump client testing. Non-debugging builds are not affected. client/mysqldump.c: Fixed bug #30126. The init_dumping_tables function has been modified to output semicolon outside of commentaries.
Diffstat (limited to 'mysql-test/t/mysqldump-compat.test')
-rw-r--r--mysql-test/t/mysqldump-compat.test13
1 files changed, 13 insertions, 0 deletions
diff --git a/mysql-test/t/mysqldump-compat.test b/mysql-test/t/mysqldump-compat.test
new file mode 100644
index 00000000000..848d66cc728
--- /dev/null
+++ b/mysql-test/t/mysqldump-compat.test
@@ -0,0 +1,13 @@
+# Embedded server doesn't support external clients
+--source include/not_embedded.inc
+
+#
+# Bug #30126: semicolon before closing */ in /*!... CREATE DATABASE ;*/
+#
+
+CREATE DATABASE mysqldump_30126;
+USE mysqldump_30126;
+CREATE TABLE t1 (c1 int);
+--exec $MYSQL_DUMP --add-drop-database mysqldump_30126 > $MYSQLTEST_VARDIR/tmp/bug30126.sql
+--exec $MYSQL mysqldump_30126 < $MYSQLTEST_VARDIR/tmp/bug30126.sql
+DROP DATABASE mysqldump_30126;