MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:<gshchepa Date:July 16 2007 6:44pm
Subject:bk commit into 5.0 tree (gshchepa:1.2527) BUG#28524
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-07-16 23:43:58+05:00, gshchepa@stripped +3 -0
  Fixed bug #28524.
  For each of view the mysqldump utility creates a temporary table
  with the same name as the view and with columns of the same names
  in order to satisfy views that depend on this view.
  After the creation of all tables, the mysqldump drops all
  temporary tables and creates actual views.
  However, the --skip-add-drop-table (and --compact) flag disabled
  DROP TABLE statements for those temporary tables. Thus, it was
  impossible to create views because of existence of the temporary
  tables with the same names.

  client/mysqldump.c@stripped, 2007-07-16 23:29:41+05:00, gshchepa@stripped +3 -2
    Fixed bug #28524.
    The mysqldump utility has been modified to unconditionally drop
    temporary tables before the creation of views.

  mysql-test/r/mysqldump.result@stripped, 2007-07-16 23:30:11+05:00, gshchepa@stripped +13 -0
    Updated test case for bug #28524.

  mysql-test/t/mysqldump.test@stripped, 2007-07-16 23:29:50+05:00, gshchepa@stripped +13 -0
    Updated test case for bug #28524.

diff -Nrup a/client/mysqldump.c b/client/mysqldump.c
--- a/client/mysqldump.c	2007-06-28 14:23:58 +05:00
+++ b/client/mysqldump.c	2007-07-16 23:29:41 +05:00
@@ -3673,10 +3673,11 @@ static my_bool get_view_structure(char *
             result_table);
     check_io(sql_file);
   }
+  /* Drop temporary table for view. */
+  fprintf(sql_file, "/*!50001 DROP TABLE %s*/;\n",
+          opt_quoted_table);
   if (opt_drop)
   {
-    fprintf(sql_file, "/*!50001 DROP TABLE IF EXISTS %s*/;\n",
-            opt_quoted_table);
     fprintf(sql_file, "/*!50001 DROP VIEW IF EXISTS %s*/;\n",
             opt_quoted_table);
     check_io(sql_file);
diff -Nrup a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result
--- a/mysql-test/r/mysqldump.result	2007-06-28 14:23:58 +05:00
+++ b/mysql-test/r/mysqldump.result	2007-07-16 23:30:11 +05:00
@@ -2941,11 +2941,13 @@ insert into t values(5, 51);
 create view v1 as select qty, price, qty*price as value from t;
 create view v2 as select qty from v1;
 mysqldump {
+/*!50001 DROP TABLE IF EXISTS `v1`*/;
 /*!50001 CREATE ALGORITHM=UNDEFINED */
 /*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
 /*!50001 VIEW `v1` AS select `t`.`qty` AS `qty`,`t`.`price` AS `price`,(`t`.`qty` * `t`.`price`) AS `value` from `t` */;
 
 } mysqldump {
+/*!50001 DROP TABLE IF EXISTS `v2`*/;
 /*!50001 CREATE ALGORITHM=UNDEFINED */
 /*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
 /*!50001 VIEW `v2` AS select `v1`.`qty` AS `qty` from `v1` */;
@@ -3076,6 +3078,7 @@ USE `mysqldump_views`;
 USE `mysqldump_tables`;
 
 USE `mysqldump_views`;
+/*!50001 DROP TABLE IF EXISTS `nasishnasifu`*/;
 /*!50001 CREATE ALGORITHM=UNDEFINED */
 /*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
 /*!50001 VIEW `mysqldump_views`.`nasishnasifu` AS select `mysqldump_tables`.`basetable`.`id` AS `id` from `mysqldump_tables`.`basetable` */;
@@ -3320,6 +3323,16 @@ CREATE TABLE `t1` (
 );
 INSERT INTO `t1` VALUES (11,0x71717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717
 17171717171717171717171717171717171717171717171717171717171);
 DROP TABLE t1;
+#
+# Bug #28524: mysqldump --skip-add-drop-table is not
+#             compatible with views
+#
+CREATE VIEW v1 AS SELECT 1;
+DROP VIEW v1;
+SELECT * FROM v1;
+1
+1
+DROP VIEW v1;
 #
 # End of 5.0 tests
 #
diff -Nrup a/mysql-test/t/mysqldump.test b/mysql-test/t/mysqldump.test
--- a/mysql-test/t/mysqldump.test	2007-06-16 09:19:39 +05:00
+++ b/mysql-test/t/mysqldump.test	2007-07-16 23:29:50 +05:00
@@ -1542,5 +1542,18 @@ INSERT INTO t1 SET c1=11, c2=REPEAT('q',
 DROP TABLE t1;
 
 --echo #
+--echo # Bug #28524: mysqldump --skip-add-drop-table is not
+--echo #             compatible with views
+--echo #
+
+CREATE VIEW v1 AS SELECT 1;
+--exec $MYSQL_DUMP --compact test > $MYSQLTEST_VARDIR/tmp/bug28524.sql
+DROP VIEW v1;
+
+--exec $MYSQL test <  $MYSQLTEST_VARDIR/tmp/bug28524.sql
+SELECT * FROM v1;
+DROP VIEW v1;
+
+--echo #
 --echo # End of 5.0 tests
 --echo #
Thread
bk commit into 5.0 tree (gshchepa:1.2527) BUG#28524gshchepa16 Jul
  • Re: bk commit into 5.0 tree (gshchepa:1.2527) BUG#28524Georgi Kodinov18 Jul