MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Tatjana A Nuernberg Date:May 14 2007 6:53am
Subject:bk commit into 5.0 tree (tnurnberg:1.2478) BUG#28223
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of tnurnberg. When tnurnberg 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-05-14 08:53:40+02:00, tnurnberg@stripped +2 -0
  Bug#28223: mysqldump --compact --routines restores from @OLD_SQL_MODE w/o ever setting it
  
  mysqldump generated output that set OLD_SQL_MODE twice, to different values
  (for triggers), or not at all (for routines) in some cases.

  client/mysqldump.c@stripped, 2007-05-14 08:53:30+02:00, tnurnberg@stripped +8 -2
    Bug#28223: mysqldump --compact --routines restores from @OLD_SQL_MODE w/o ever setting it
    
    Only save SQL_MODE in dump_triggers if in --compact mode. Otherwise,
    it's already been saved in write_header(). Likewise for dumpe_routines,
    where it was never saved.

  mysql-test/r/mysqldump.result@stripped, 2007-05-14 08:53:31+02:00, tnurnberg@stripped +4 -4
    Bug#28223: mysqldump --compact --routines restores from @OLD_SQL_MODE w/o ever setting it
    
    mysqldump output has subtly changed. Adjust test-results. This also shows
    OLD_SQL_MODE is always set exactly once now.

# 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:	tnurnberg
# Host:	blasphemy.mysql.com
# Root:	/home/tnurnberg/28223/50-28223

--- 1.262/client/mysqldump.c	2007-04-30 11:30:02 +02:00
+++ 1.263/client/mysqldump.c	2007-05-14 08:53:30 +02:00
@@ -1456,6 +1456,9 @@ static uint dump_routines_for_db(char *d
   if (lock_tables)
     mysql_query(mysql, "LOCK TABLES mysql.proc READ");
 
+  if (opt_compact)
+    fprintf(sql_file, "\n/*!50003 SET @OLD_SQL_MODE=@@SQL_MODE*/;\n");
+
   fprintf(sql_file, "DELIMITER ;;\n");
 
   /* 0, retrieve and dump functions, 1, procedures */
@@ -2106,8 +2109,11 @@ static void dump_triggers_for_table(char
     DBUG_VOID_RETURN;
   }
   if (mysql_num_rows(result))
-    fprintf(sql_file, "\n/*!50003 SET @OLD_SQL_MODE=@@SQL_MODE*/;\n\
-DELIMITER ;;\n");
+  {
+    if (opt_compact)
+      fprintf(sql_file, "\n/*!50003 SET @OLD_SQL_MODE=@@SQL_MODE*/;\n");
+    fprintf(sql_file, "\nDELIMITER ;;\n");
+  }
   while ((row= mysql_fetch_row(result)))
   {
     fprintf(sql_file,

--- 1.123/mysql-test/r/mysqldump.result	2007-04-30 11:30:03 +02:00
+++ 1.124/mysql-test/r/mysqldump.result	2007-05-14 08:53:31 +02:00
@@ -2238,7 +2238,6 @@ INSERT INTO `t1` VALUES (1,NULL),(2,NULL
 /*!40000 ALTER TABLE `t1` ENABLE KEYS */;
 UNLOCK TABLES;
 
-/*!50003 SET @OLD_SQL_MODE=@@SQL_MODE*/;
 DELIMITER ;;
 /*!50003 SET SESSION SQL_MODE="" */;;
 /*!50003 CREATE */ /*!50017 DEFINER=`root`@`localhost` */ /*!50003 TRIGGER `trg1` BEFORE INSERT ON `t1` FOR EACH ROW begin
@@ -2272,7 +2271,6 @@ LOCK TABLES `t2` WRITE;
 /*!40000 ALTER TABLE `t2` ENABLE KEYS */;
 UNLOCK TABLES;
 
-/*!50003 SET @OLD_SQL_MODE=@@SQL_MODE*/;
 DELIMITER ;;
 /*!50003 SET SESSION SQL_MODE="STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER" */;;
 /*!50003 CREATE */ /*!50017 DEFINER=`root`@`localhost` */ /*!50003 TRIGGER `trg4` BEFORE INSERT ON `t2` FOR EACH ROW begin
@@ -2630,7 +2628,6 @@ INSERT INTO "t1 test" VALUES (1),(2),(3)
 /*!40000 ALTER TABLE "t1 test" ENABLE KEYS */;
 UNLOCK TABLES;
 
-/*!50003 SET @OLD_SQL_MODE=@@SQL_MODE*/;
 DELIMITER ;;
 /*!50003 SET SESSION SQL_MODE="" */;;
 /*!50003 CREATE */ /*!50017 DEFINER=`root`@`localhost` */ /*!50003 TRIGGER `test trig` BEFORE INSERT ON `t1 test` FOR EACH ROW BEGIN
@@ -2791,7 +2788,6 @@ LOCK TABLES `t1` WRITE;
 /*!40000 ALTER TABLE `t1` ENABLE KEYS */;
 UNLOCK TABLES;
 
-/*!50003 SET @OLD_SQL_MODE=@@SQL_MODE*/;
 DELIMITER ;;
 /*!50003 SET SESSION SQL_MODE="IGNORE_SPACE" */;;
 /*!50003 CREATE */ /*!50017 DEFINER=`root`@`localhost` */ /*!50003 TRIGGER `tr1` BEFORE INSERT ON `t1` FOR EACH ROW BEGIN
@@ -3293,12 +3289,16 @@ create database mysqldump_test_db;
 grant all privileges on mysqldump_test_db.*  to user1;
 grant all privileges on mysqldump_test_db.*  to user2;
 create procedure mysqldump_test_db.sp1() select 'hello';
+
+/*!50003 SET @OLD_SQL_MODE=@@SQL_MODE*/;
 DELIMITER ;;
 
 -- insufficient privileges to SHOW CREATE PROCEDURE `sp1`
 -- does user2 have permissions on mysql.proc?
 
 DELIMITER ;
+
+/*!50003 SET @OLD_SQL_MODE=@@SQL_MODE*/;
 DELIMITER ;;
 /*!50003 SET SESSION SQL_MODE=""*/;;
 /*!50003 CREATE*/ /*!50020 DEFINER=`user1`@`%`*/ /*!50003 PROCEDURE `sp1`()
Thread
bk commit into 5.0 tree (tnurnberg:1.2478) BUG#28223Tatjana A Nuernberg14 May