List:Commits« Previous MessageNext Message »
From:Nirbhay Choubey Date:April 23 2011 10:12am
Subject:bzr commit into mysql-5.1 branch (nirbhay.choubey:3622) Bug#11760384
View as plain text  
#At file:///home/nirbhay/Project/mysql/repo/bugs/mysql-5.1.52792/ based on revid:ramil@stripped

 3622 Nirbhay Choubey	2011-04-23
      BUG#11760384 - 52792: mysqldump in XML mode does not dump
                           routines.
      
      mysqldump in xml mode did not dump routines, events or
      triggers.
      
      This patch fixes this issue by fixing the if conditions
      that disallowed the dump of above mentioned objects in
      xml mode, and added the required code to enable dump
      in xml format.
     @ client/mysqldump.c
        BUG#11760384 - 52792: mysqldump in XML mode does not dump
                              routines.
        
        Fixed some if conditions to allow execution of dump methods
        for xml and further added the relevant code at places to produce
        the dump in xml format.
     @ mysql-test/r/mysqldump.result
        Added a test case for Bug#11760384.
     @ mysql-test/t/mysqldump.test
        Added a test case for Bug#11760384.

    modified:
      client/mysqldump.c
      mysql-test/r/mysqldump.result
      mysql-test/t/mysqldump.test
=== modified file 'client/mysqldump.c'
--- a/client/mysqldump.c	2011-02-21 07:07:24 +0000
+++ b/client/mysqldump.c	2011-04-23 10:12:25 +0000
@@ -72,6 +72,9 @@
 /* Size of buffer for dump's select query */
 #define QUERY_LENGTH 1536
 
+/* Size of comment buffer. */
+#define COMMENT_LENGTH 2048
+
 /* ignore table flags */
 #define IGNORE_NONE 0x00 /* no ignore */
 #define IGNORE_DATA 0x01 /* don't dump data for this table */
@@ -98,7 +101,7 @@ static my_bool  verbose= 0, opt_no_creat
                 opt_complete_insert= 0, opt_drop_database= 0,
                 opt_replace_into= 0,
                 opt_dump_triggers= 0, opt_routines=0, opt_tz_utc=1,
-                opt_events= 0,
+                opt_events= 0, opt_comments_used= 0,
                 opt_alltspcs=0, opt_notspcs= 0;
 static my_bool insert_pat_inited= 0, debug_info_flag= 0, debug_check_flag= 0;
 static ulong opt_max_allowed_packet, opt_net_buffer_length;
@@ -110,7 +113,8 @@ static char  *opt_password=0,*current_us
              *where=0, *order_by=0,
              *opt_compatible_mode_str= 0,
              *err_ptr= 0,
-             *log_error_file= NULL;
+             *log_error_file= NULL,
+             *comment_buff= NULL;
 static char **defaults_argv= 0;
 static char compatible_mode_normal_str[255];
 /* Server supports character_set_results session variable? */
@@ -505,6 +509,7 @@ static int dump_all_tablespaces();
 static int dump_tablespaces_for_tables(char *db, char **table_names, int tables);
 static int dump_tablespaces_for_databases(char** databases);
 static int dump_tablespaces(char* ts_where);
+static void print_comment(FILE *sql_file, const char *format, ...);
 
 #include <help_start.h>
 
@@ -605,16 +610,16 @@ static void write_header(FILE *sql_file,
   {
     if (opt_comments)
     {
-      fprintf(sql_file,
-              "-- MySQL dump %s  Distrib %s, for %s (%s)\n--\n",
-              DUMP_VERSION, MYSQL_SERVER_VERSION, SYSTEM_TYPE, MACHINE_TYPE);
-      fprintf(sql_file, "-- Host: %s    Database: %s\n",
-              current_host ? current_host : "localhost", db_name ? db_name :
-              "");
+      print_comment(sql_file, "-- MySQL dump %s  Distrib %s, for %s (%s)\n--\n",
+                    DUMP_VERSION, MYSQL_SERVER_VERSION, SYSTEM_TYPE,
+                    MACHINE_TYPE);
+      print_comment(sql_file, "-- Host: %s    Database: %s\n",
+                    current_host ? current_host : "localhost",
+                    db_name ? db_name : "");
       fputs("-- ------------------------------------------------------\n",
             sql_file);
-      fprintf(sql_file, "-- Server version\t%s\n",
-              mysql_get_server_info(&mysql_connection));
+      print_comment(sql_file, "-- Server version\t%s\n",
+                    mysql_get_server_info(&mysql_connection));
     }
     if (opt_set_charset)
       fprintf(sql_file,
@@ -679,11 +684,10 @@ static void write_footer(FILE *sql_file)
       {
         char time_str[20];
         get_date(time_str, GETDATE_DATE_TIME, 0);
-        fprintf(sql_file, "-- Dump completed on %s\n",
-                time_str);
+        print_comment(sql_file, "-- Dump completed on %s\n", time_str);
       }
       else
-        fprintf(sql_file, "-- Dump completed\n");
+        print_comment(sql_file, "-- Dump completed\n");
     }
     check_io(sql_file);
   }
@@ -769,6 +773,9 @@ get_one_option(int optid, const struct m
     extended_insert= opt_drop= opt_lock=
       opt_disable_keys= opt_autocommit= opt_create_db= 0;
     break;
+  case 'i':
+    opt_comments_used= 1;
+    break;
   case 'I':
   case '?':
     usage();
@@ -795,11 +802,12 @@ get_one_option(int optid, const struct m
       opt_disable_keys= lock_tables= opt_set_charset= 0;
     break;
   case (int) OPT_COMPACT:
-  if (opt_compact)
-  {
-    opt_comments= opt_drop= opt_disable_keys= opt_lock= 0;
-    opt_set_charset= 0;
-  }
+    if (opt_compact)
+    {
+       opt_comments= opt_drop= opt_disable_keys= opt_lock= 0;
+       opt_set_charset= 0;
+    }
+    break;
   case (int) OPT_TABLES:
     opt_databases=0;
     break;
@@ -1455,6 +1463,7 @@ static void free_resources()
     dynstr_free(&insert_pat);
   if (defaults_argv)
     free_defaults(defaults_argv);
+  my_free(comment_buff, MYF(MY_ALLOW_ZERO_PTR));
   my_end(my_end_arg);
 }
 
@@ -1662,15 +1671,17 @@ static char *quote_for_like(const char *
 
   SYNOPSIS
     print_quoted_xml()
-    xml_file    - output file
-    str         - string to print
-    len         - its length
+    xml_file          - Output file.
+    str               - String to print.
+    len               - Its length.
+    is_attribute_name - A check for attribute name or value.
 
   DESCRIPTION
     Quote '<' '>' '&' '\"' chars and print a string to the xml_file.
 */
 
-static void print_quoted_xml(FILE *xml_file, const char *str, ulong len)
+static void print_quoted_xml(FILE *xml_file, const char *str, ulong len,
+                             my_bool is_attribute_name)
 {
   const char *end;
 
@@ -1689,6 +1700,13 @@ static void print_quoted_xml(FILE *xml_f
     case '\"':
       fputs("&quot;", xml_file);
       break;
+    case ' ':
+      /* Attribute names cannot contain spaces. */
+      if (is_attribute_name)
+      {
+        fputs("_", xml_file);
+        break;
+      }
     default:
       fputc(*str, xml_file);
       break;
@@ -1749,7 +1767,7 @@ static void print_xml_tag(FILE * xml_fil
     fputs(attribute_name, xml_file);    
     fputc('\"', xml_file);
     
-    print_quoted_xml(xml_file, attribute_value, strlen(attribute_value));
+    print_quoted_xml(xml_file, attribute_value, strlen(attribute_value), 0);
     fputc('\"', xml_file);
 
     attribute_name= va_arg(arg_list, char *);
@@ -1789,7 +1807,7 @@ static void print_xml_null_tag(FILE * xm
   fputs("<", xml_file);
   fputs(stag_atr, xml_file);
   fputs("\"", xml_file);
-  print_quoted_xml(xml_file, sval, strlen(sval));
+  print_quoted_xml(xml_file, sval, strlen(sval), 0);
   fputs("\" xsi:nil=\"true\" />", xml_file);
   fputs(line_end, xml_file);
   check_io(xml_file);
@@ -1800,11 +1818,12 @@ static void print_xml_null_tag(FILE * xm
   Print xml tag with many attributes.
 
   SYNOPSIS
-    print_xml_row()
+    prin_xml_row()
     xml_file    - output file
     row_name    - xml tag name
     tableRes    - query result
     row         - result row
+    str_create  - create statement header string
 
   DESCRIPTION
     Print tag with many attribute to the xml_file. Format is:
@@ -1814,9 +1833,12 @@ static void print_xml_null_tag(FILE * xm
 */
 
 static void print_xml_row(FILE *xml_file, const char *row_name,
-                          MYSQL_RES *tableRes, MYSQL_ROW *row)
+                          MYSQL_RES *tableRes, MYSQL_ROW *row,
+                          const char *str_create)
 {
   uint i;
+  char *create_ptr;
+  uint create_len= 0;
   MYSQL_FIELD *field;
   ulong *lengths= mysql_fetch_lengths(tableRes);
 
@@ -1827,16 +1849,95 @@ static void print_xml_row(FILE *xml_file
   {
     if ((*row)[i])
     {
-      fputc(' ', xml_file);
-      print_quoted_xml(xml_file, field->name, field->name_length);
-      fputs("=\"", xml_file);
-      print_quoted_xml(xml_file, (*row)[i], lengths[i]);
-      fputc('"', xml_file);
-      check_io(xml_file);
+      /* For 'create' statements, dump using CDATA. */
+      if ((str_create) && (strcmp(str_create, field->name) == 0))
+      {
+        create_ptr= (*row)[i];
+        create_len= lengths[i];
+      }
+      else
+      {
+        fputc(' ', xml_file);
+        print_quoted_xml(xml_file, field->name, field->name_length, 1);
+        fputs("=\"", xml_file);
+        print_quoted_xml(xml_file, (*row)[i], lengths[i], 0);
+        fputc('"', xml_file);
+        check_io(xml_file);
+      }
     }
   }
   fputs(" />\n", xml_file);
   check_io(xml_file);
+
+  if (create_len)
+  {
+    fputs("<![CDATA[\n\"", xml_file);
+    print_quoted_xml(xml_file, create_ptr, create_len, 0);
+    fputs("\"\n]]>\n", xml_file);
+  }
+}
+
+
+/*
+  Print xml comments.
+
+  SYNOPSIS
+    print_xml_comment()
+    xml_file       - output file
+    len            - length of comment message
+    comment_string - comment message
+
+  DESCRIPTION
+    Print the comment message in the format:
+      "<!-- \n comment string  \n -->\n"
+  NOTE
+    Any occurrence of continuous hyphens will be
+    squeezed to a single hyphen.
+*/
+
+static void print_xml_comment(FILE *xml_file, ulong len,
+                              const char *comment_string)
+{
+  const char* end;
+
+  fputs("<!-- ", xml_file);
+
+  for (end= comment_string + len; comment_string != end; comment_string++)
+  {
+    /*
+      The string "--" (double-hyphen) MUST NOT occur within xml comments.
+    */
+    switch (*comment_string) {
+    case '-':
+      if (*(comment_string + 1) == '-')         /* Discard double hyphens. */
+        break;
+    default:
+      fputc(*comment_string, xml_file);
+      break;
+    }
+  }
+  fputs(" -->\n", xml_file);
+  check_io(xml_file);
+}
+
+
+
+/* A common printing function for xml and non-xml modes. */
+
+static void print_comment(FILE *sql_file, const char *format, ...)
+{
+  va_list args;
+  va_start(args, format);
+  my_vsnprintf(comment_buff, COMMENT_LENGTH, format, args);
+  va_end(args);
+
+  if (!opt_xml)
+  {
+    fprintf(sql_file, "%s", comment_buff);
+    return;
+  }
+
+  print_xml_comment(sql_file, strlen(comment_buff), comment_buff);
 }
 
 
@@ -1907,7 +2008,8 @@ static uint dump_events_for_db(char *db)
 
   /* nice comments */
   if (opt_comments)
-    fprintf(sql_file, "\n--\n-- Dumping events for database '%s'\n--\n", db);
+    print_comment(sql_file,
+                  "\n--\n-- Dumping events for database '%s'\n--\n", db);
 
   /*
     not using "mysql_query_with_error_report" because we may have not
@@ -1922,12 +2024,17 @@ static uint dump_events_for_db(char *db)
   strcpy(delimiter, ";");
   if (mysql_num_rows(event_list_res) > 0)
   {
-    fprintf(sql_file, "/*!50106 SET @save_time_zone= @@TIME_ZONE */ ;\n");
+    if (opt_xml)
+      fputs("\t<events>\n", sql_file);
+    else
+    {
+      fprintf(sql_file, "/*!50106 SET @save_time_zone= @@TIME_ZONE */ ;\n");
 
-    /* Get database collation. */
+      /* Get database collation. */
 
-    if (fetch_db_collation(db_name_buff, db_cl_name, sizeof (db_cl_name)))
-      DBUG_RETURN(1);
+      if (fetch_db_collation(db_name_buff, db_cl_name, sizeof (db_cl_name)))
+        DBUG_RETURN(1);
+    }
 
     if (switch_character_set_results(mysql, "binary"))
       DBUG_RETURN(1);
@@ -1944,6 +2051,13 @@ static uint dump_events_for_db(char *db)
 
       while ((row= mysql_fetch_row(event_res)) != NULL)
       {
+        if (opt_xml)
+        {
+          print_xml_row(sql_file, "event", event_res, &row,
+                        "Create Event");
+          continue;
+        }
+
         /*
           if the user has EXECUTE privilege he can see event names, but not the
           event body!
@@ -2022,8 +2136,16 @@ static uint dump_events_for_db(char *db)
       mysql_free_result(event_res);
 
     } /* end of list of events */
-    fprintf(sql_file, "DELIMITER ;\n");
-    fprintf(sql_file, "/*!50106 SET TIME_ZONE= @save_time_zone */ ;\n");
+    if (opt_xml)
+    {
+      fputs("\t</events>\n", sql_file);
+      check_io(sql_file);
+    }
+    else
+    {
+      fprintf(sql_file, "DELIMITER ;\n");
+      fprintf(sql_file, "/*!50106 SET TIME_ZONE= @save_time_zone */ ;\n");
+    }
 
     if (switch_character_set_results(mysql, default_charset))
       DBUG_RETURN(1);
@@ -2077,6 +2199,7 @@ static uint dump_routines_for_db(char *d
   const char *routine_type[]= {"FUNCTION", "PROCEDURE"};
   char       db_name_buff[NAME_LEN*2+3], name_buff[NAME_LEN*2+3];
   char       *routine_name;
+  char       *query_str;
   int        i;
   FILE       *sql_file= md_result_file;
   MYSQL_RES  *routine_res, *routine_list_res;
@@ -2092,7 +2215,8 @@ static uint dump_routines_for_db(char *d
 
   /* nice comments */
   if (opt_comments)
-    fprintf(sql_file, "\n--\n-- Dumping routines for database '%s'\n--\n", db);
+    print_comment(sql_file,
+                  "\n--\n-- Dumping routines for database '%s'\n--\n", db);
 
   /*
     not using "mysql_query_with_error_report" because we may have not
@@ -2109,6 +2233,9 @@ static uint dump_routines_for_db(char *d
   if (switch_character_set_results(mysql, "binary"))
     DBUG_RETURN(1);
 
+  if (opt_xml)
+    fputs("<routines>\n", sql_file);
+
   /* 0, retrieve and dump functions, 1, procedures */
   for (i= 0; i <= 1; i++)
   {
@@ -2144,13 +2271,25 @@ static uint dump_routines_for_db(char *d
                              row[2] ? (int) strlen(row[2]) : 0));
           if (row[2] == NULL)
           {
-            fprintf(sql_file, "\n-- insufficient privileges to %s\n", query_buff);
-            fprintf(sql_file, "-- does %s have permissions on mysql.proc?\n\n", current_user);
+            print_comment(sql_file, "\n-- insufficient privileges to %s\n",
+                          query_buff);
+            print_comment(sql_file,
+                          "-- does %s have permissions on mysql.proc?\n\n",
+                          current_user);
             maybe_die(EX_MYSQLERR,"%s has insufficent privileges to %s!", current_user, query_buff);
           }
           else if (strlen(row[2]))
           {
-            char *query_str;
+            if (opt_xml)
+            {
+              if (i)                            // Procedures.
+                print_xml_row(sql_file, "routine", routine_res, &row,
+                              "Create Procedure");
+              else                              // Functions.
+                print_xml_row(sql_file, "routine", routine_res, &row,
+                              "Create Function");
+              continue;
+            }
             if (opt_drop)
               fprintf(sql_file, "/*!50003 DROP %s IF EXISTS %s */;\n",
                       routine_type[i], routine_name);
@@ -2221,6 +2360,12 @@ static uint dump_routines_for_db(char *d
     mysql_free_result(routine_list_res);
   } /* end of for i (0 .. 1)  */
 
+  if (opt_xml)
+  {
+    fputs("\t</routines>\n", sql_file);
+    check_io(sql_file);
+  }
+
   if (switch_character_set_results(mysql, default_charset))
     DBUG_RETURN(1);
 
@@ -2333,14 +2478,16 @@ static uint get_table_structure(char *ta
 
         write_header(sql_file, db);
       }
-      if (!opt_xml && opt_comments)
+      if (opt_comments)
       {
       if (strcmp (table_type, "VIEW") == 0)         /* view */
-        fprintf(sql_file, "\n--\n-- Temporary table structure for view %s\n--\n\n",
-                result_table);
+        print_comment(sql_file,
+                      "\n--\n-- Temporary table structure for view %s\n--\n\n",
+                      result_table);
       else
-        fprintf(sql_file, "\n--\n-- Table structure for table %s\n--\n\n",
-                result_table);
+        print_comment(sql_file,
+                      "\n--\n-- Table structure for table %s\n--\n\n",
+                      result_table);
         check_io(sql_file);
       }
       if (opt_drop)
@@ -2543,9 +2690,10 @@ static uint get_table_structure(char *ta
           DBUG_RETURN(0);
         write_header(sql_file, db);
       }
-      if (!opt_xml && opt_comments)
-        fprintf(sql_file, "\n--\n-- Table structure for table %s\n--\n\n",
-                result_table);
+      if (opt_comments)
+        print_comment(sql_file,
+                      "\n--\n-- Table structure for table %s\n--\n\n",
+                      result_table);
       if (opt_drop)
         fprintf(sql_file, "DROP TABLE IF EXISTS %s;\n", result_table);
       if (!opt_xml)
@@ -2596,7 +2744,7 @@ static uint get_table_structure(char *ta
       {
         if (opt_xml)
         {
-          print_xml_row(sql_file, "field", result, &row);
+          print_xml_row(sql_file, "field", result, &row, NullS);
           continue;
         }
 
@@ -2668,7 +2816,7 @@ static uint get_table_structure(char *ta
       {
         if (opt_xml)
         {
-          print_xml_row(sql_file, "key", result, &row);
+          print_xml_row(sql_file, "key", result, &row, NullS);
           continue;
         }
 
@@ -2727,7 +2875,7 @@ static uint get_table_structure(char *ta
         else
         {
           if (opt_xml)
-            print_xml_row(sql_file, "options", result, &row);
+            print_xml_row(sql_file, "options", result, &row, NullS);
           else
           {
             fputs("/*!",sql_file);
@@ -2771,9 +2919,19 @@ static void dump_trigger_old(FILE *sql_f
   char *quoted_table_name= quote_name(table_name, quoted_table_name_buf, 1);
 
   char name_buff[NAME_LEN * 4 + 3];
+  const char *xml_msg= "\nWarning! mysqldump being run against old server "
+                       "that does not\nsupport 'SHOW CREATE TRIGGERS' "
+                       "statement. Skipping..\n";
 
   DBUG_ENTER("dump_trigger_old");
 
+  if (opt_xml)
+  {
+    print_xml_comment(sql_file, strlen(xml_msg), xml_msg);
+    check_io(sql_file);
+    DBUG_VOID_RETURN;
+  }
+
   fprintf(sql_file,
           "--\n"
           "-- WARNING: old server version. "
@@ -2837,13 +2995,25 @@ static int dump_trigger(FILE *sql_file, 
                         const char *db_cl_name)
 {
   MYSQL_ROW row;
+  char *query_str;
   int db_cl_altered= FALSE;
 
   DBUG_ENTER("dump_trigger");
 
   while ((row= mysql_fetch_row(show_create_trigger_rs)))
   {
-    char *query_str= cover_definer_clause_in_trigger(row[2], strlen(row[2]));
+    if (opt_xml)
+    {
+      print_xml_tag(sql_file, "\t", "\n", "triggers", "name=",
+                    row[0], NullS);
+      print_xml_row(sql_file, "trigger", show_create_trigger_rs, &row,
+                    "SQL Original Statement");
+      fputs("\t</triggers>\n", sql_file);
+      check_io(sql_file);
+      continue;
+    }
+
+    query_str= cover_definer_clause_in_trigger(row[2], strlen(row[2]));
 
 
     if (switch_db_collation(sql_file, db_name, ";",
@@ -3213,10 +3383,11 @@ static void dump_table(char *table, char
   }
   else
   {
-    if (!opt_xml && opt_comments)
+    if (opt_comments)
     {
-      fprintf(md_result_file,"\n--\n-- Dumping data for table %s\n--\n",
-              result_table);
+      print_comment(md_result_file,
+                    "\n--\n-- Dumping data for table %s\n--\n",
+                    result_table);
       check_io(md_result_file);
     }
     
@@ -3436,7 +3607,7 @@ static void dump_table(char *table, char
                 {
                   print_xml_tag(md_result_file, "\t\t", "", "field", "name=", 
                                 field->name, NullS);
-                  print_quoted_xml(md_result_file, row[i], length);
+                  print_quoted_xml(md_result_file, row[i], length, 0);
                 }
                 fputs("</field>\n", md_result_file);
               }
@@ -3742,7 +3913,7 @@ static int dump_tablespaces(char* ts_whe
     {
       if (!opt_xml && opt_comments)
       {
-	fprintf(md_result_file,"\n--\n-- Logfile group: %s\n--\n", row[0]);
+	fprintf(md_result_file, "\n--\n-- Logfile group: %s\n--\n", row[0]);
 	check_io(md_result_file);
       }
       fprintf(md_result_file, "\nCREATE");
@@ -3812,9 +3983,9 @@ static int dump_tablespaces(char* ts_whe
       first= 1;
     if (first)
     {
-      if (!opt_xml && opt_comments)
+      if (opt_comments)
       {
-	fprintf(md_result_file,"\n--\n-- Tablespace: %s\n--\n", row[0]);
+	print_comment(md_result_file, "\n--\n-- Tablespace: %s\n--\n", row[0]);
 	check_io(md_result_file);
       }
       fprintf(md_result_file, "\nCREATE");
@@ -4008,7 +4179,8 @@ static int init_dumping(char *database, 
       char *qdatabase= quote_name(database,quoted_database_buf,opt_quoted);
       if (opt_comments)
       {
-        fprintf(md_result_file,"\n--\n-- Current Database: %s\n--\n", qdatabase);
+        print_comment(md_result_file,
+                      "\n--\n-- Current Database: %s\n--\n", qdatabase);
         check_io(md_result_file);
       }
 
@@ -4084,8 +4256,7 @@ static int dump_all_tables_in_db(char *d
       dump_table(table,database);
       my_free(order_by, MYF(MY_ALLOW_ZERO_PTR));
       order_by= 0;
-      if (opt_dump_triggers && ! opt_xml &&
-          mysql_get_server_version(mysql) >= 50009)
+      if (opt_dump_triggers && mysql_get_server_version(mysql) >= 50009)
       {
         if (dump_triggers_for_table(table, database))
         {
@@ -4096,14 +4267,12 @@ static int dump_all_tables_in_db(char *d
       }
     }
   }
-  if (opt_events && !opt_xml &&
-      mysql_get_server_version(mysql) >= 50106)
+  if (opt_events && mysql_get_server_version(mysql) >= 50106)
   {
     DBUG_PRINT("info", ("Dumping events for database %s", database));
     dump_events_for_db(database);
   }
-  if (opt_routines && !opt_xml &&
-      mysql_get_server_version(mysql) >= 50009)
+  if (opt_routines && mysql_get_server_version(mysql) >= 50009)
   {
     DBUG_PRINT("info", ("Dumping routines for database %s", database));
     dump_routines_for_db(database);
@@ -4338,15 +4507,13 @@ static int dump_selected_tables(char *db
     for (pos= dump_tables; pos < end; pos++)
       get_view_structure(*pos, db);
   }
-  if (opt_events && !opt_xml &&
-      mysql_get_server_version(mysql) >= 50106)
+  if (opt_events && mysql_get_server_version(mysql) >= 50106)
   {
     DBUG_PRINT("info", ("Dumping events for database %s", db));
     dump_events_for_db(db);
   }
   /* obtain dump of routines (procs/functions) */
-  if (opt_routines  && !opt_xml &&
-      mysql_get_server_version(mysql) >= 50009)
+  if (opt_routines && mysql_get_server_version(mysql) >= 50009)
   {
     DBUG_PRINT("info", ("Dumping routines for database %s", db));
     dump_routines_for_db(db);
@@ -4381,7 +4548,7 @@ static int do_show_master_status(MYSQL *
     if (row && row[0] && row[1])
     {
       /* SHOW MASTER STATUS reports file and position */
-      if (opt_comments)
+      if (!opt_xml && opt_comments)
         fprintf(md_result_file,
                 "\n--\n-- Position to start replication or point-in-time "
                 "recovery from\n--\n\n");
@@ -5049,6 +5216,12 @@ int main(int argc, char **argv)
     exit(exit_code);
   }
 
+  /*
+    Disable comments in xml mode if 'comments' option is not explicitly used.
+  */
+  if (opt_xml && !opt_comments_used)
+    opt_comments= 0;
+
   if (log_error_file)
   {
     if(!(stderror_file= freopen(log_error_file, "a+", stderr)))
@@ -5058,6 +5231,9 @@ int main(int argc, char **argv)
     }
   }
 
+ if (!(comment_buff= (char*) my_malloc(COMMENT_LENGTH, MYF(MY_WME))))
+   die(EX_MYSQLERR, "Couldn't allocate memory for comment buffer.");
+
   if (connect_to_db(current_host, current_user, opt_password))
   {
     free_resources();

=== modified file 'mysql-test/r/mysqldump.result'
--- a/mysql-test/r/mysqldump.result	2011-03-17 10:58:16 +0000
+++ b/mysql-test/r/mysqldump.result	2011-04-23 10:12:25 +0000
@@ -4628,5 +4628,396 @@ ALTER DATABASE `test-database` CHARACTER
 DROP DATABASE `test-database`;
 USE `test`;
 #
+# BUG#11760384 : 52792: mysqldump in XML mode does not dump routines.
+#
+CREATE DATABASE BUG52792;
+USE BUG52792;
+CREATE TABLE t1 (c1 INT, c2 VARCHAR(20));
+CREATE TABLE t2 (c1 INT);
+INSERT INTO t1 VALUES (1, 'aaa'), (2, 'bbb'), (3, 'ccc');
+INSERT INTO t2 VALUES (1),(2),(3);
+# Stored Procedures.
+CREATE PROCEDURE simpleproc1 (OUT param1 INT)
+BEGIN
+SELECT COUNT(*) INTO param1 FROM t1;
+END//
+CREATE PROCEDURE simpleproc2 (OUT param1 INT)
+BEGIN
+SELECT COUNT(*) INTO param1 FROM t2;
+END//
+# Events.
+CREATE EVENT e1 ON SCHEDULE EVERY 1 SECOND DO DROP DATABASE BUG52792;
+CREATE EVENT e2 ON SCHEDULE EVERY 1 SECOND DO DROP DATABASE BUG52792;
+# Functions.
+CREATE FUNCTION `hello1` (s CHAR(20))
+RETURNS CHAR(50) DETERMINISTIC
+RETURN CONCAT('Hello, ',s,'!');
+CREATE FUNCTION `hello2` (s CHAR(20))
+RETURNS CHAR(50) DETERMINISTIC
+RETURN CONCAT('Hello, ',s,'!');
+# Triggers.
+CREATE TRIGGER trig1 BEFORE INSERT ON t1
+FOR EACH ROW BEGIN
+INSERT INTO t1 VALUES(1);
+END;
+|
+CREATE TRIGGER trig2 BEFORE INSERT ON t2
+FOR EACH ROW BEGIN
+INSERT INTO t2 VALUES(1);
+END;
+|
+# Views
+CREATE VIEW v1 AS SELECT * FROM t1;
+CREATE VIEW v2 AS SELECT * FROM t2;
+
+# Dumping BUG52792 database in xml format.
+
+# Using 'replace_regex /[0-9]{2}/00/'
+<?xml version="1.0"?>
+<mysqldump xmlns:xsi="http://www.w3.org/0000/XMLSchema-instance">
+<database name="BUG00002">
+	<table_structure name="t1">
+		<field Field="c1" Type="int(00)" Null="YES" Key="" Extra="" Comment="" />
+		<field Field="c2" Type="varchar(00)" Null="YES" Key="" Extra="" Comment="" />
+		<options Name="t1" Engine="MyISAM" Version="00" Row_format="Dynamic" Rows="3" Avg_row_length="00" Data_length="00" Max_data_length="000000000000005" Index_length="0000" Data_free="0" Create_time="0000-00-00 00:00:00" Update_time="0000-00-00 00:00:00" Collation="latin1_swedish_ci" Create_options="" Comment="" />
+	</table_structure>
+	<table_data name="t1">
+	<row>
+		<field name="c1">1</field>
+		<field name="c2">aaa</field>
+	</row>
+	<row>
+		<field name="c1">2</field>
+		<field name="c2">bbb</field>
+	</row>
+	<row>
+		<field name="c1">3</field>
+		<field name="c2">ccc</field>
+	</row>
+	</table_data>
+	<triggers name="trig1">
+		<trigger Trigger="trig1" sql_mode="" character_set_client="latin1" collation_connection="latin1_swedish_ci" Database_Collation="latin1_swedish_ci" />
+<![CDATA[
+"CREATE DEFINER=`root`@`localhost` TRIGGER trig1 BEFORE INSERT ON t1
+FOR EACH ROW BEGIN
+INSERT INTO t1 VALUES(1);
+END"
+]]>
+	</triggers>
+	<table_structure name="t2">
+		<field Field="c1" Type="int(00)" Null="YES" Key="" Extra="" Comment="" />
+		<options Name="t2" Engine="MyISAM" Version="00" Row_format="Fixed" Rows="3" Avg_row_length="7" Data_length="00" Max_data_length="0000000000000000" Index_length="0000" Data_free="0" Create_time="0000-00-00 00:00:00" Update_time="0000-00-00 00:00:00" Collation="latin1_swedish_ci" Create_options="" Comment="" />
+	</table_structure>
+	<table_data name="t2">
+	<row>
+		<field name="c1">1</field>
+	</row>
+	<row>
+		<field name="c1">2</field>
+	</row>
+	<row>
+		<field name="c1">3</field>
+	</row>
+	</table_data>
+	<triggers name="trig2">
+		<trigger Trigger="trig2" sql_mode="" character_set_client="latin1" collation_connection="latin1_swedish_ci" Database_Collation="latin1_swedish_ci" />
+<![CDATA[
+"CREATE DEFINER=`root`@`localhost` TRIGGER trig2 BEFORE INSERT ON t2
+FOR EACH ROW BEGIN
+INSERT INTO t2 VALUES(1);
+END"
+]]>
+	</triggers>
+	<table_structure name="v1">
+		<field Field="c1" Type="int(00)" Null="YES" Key="" Extra="" Comment="" />
+		<field Field="c2" Type="varchar(00)" Null="YES" Key="" Extra="" Comment="" />
+		<options Name="v1" Comment="VIEW" />
+	</table_structure>
+	<table_structure name="v2">
+		<field Field="c1" Type="int(00)" Null="YES" Key="" Extra="" Comment="" />
+		<options Name="v2" Comment="VIEW" />
+	</table_structure>
+	<events>
+		<event Event="e1" sql_mode="" time_zone="SYSTEM" character_set_client="latin1" collation_connection="latin1_swedish_ci" Database_Collation="latin1_swedish_ci" />
+<![CDATA[
+"CREATE EVENT `e1` ON SCHEDULE EVERY 1 SECOND STARTS '0000-00-00 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO DROP DATABASE BUG00002"
+]]>
+		<event Event="e2" sql_mode="" time_zone="SYSTEM" character_set_client="latin1" collation_connection="latin1_swedish_ci" Database_Collation="latin1_swedish_ci" />
+<![CDATA[
+"CREATE EVENT `e2` ON SCHEDULE EVERY 1 SECOND STARTS '0000-00-00 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO DROP DATABASE BUG00002"
+]]>
+	</events>
+<routines>
+		<routine Function="hello1" sql_mode="" character_set_client="latin1" collation_connection="latin1_swedish_ci" Database_Collation="latin1_swedish_ci" />
+<![CDATA[
+"CREATE DEFINER=`root`@`localhost` FUNCTION `hello1`(s CHAR(00)) RETURNS char(00) CHARSET latin1
+    DETERMINISTIC
+RETURN CONCAT('Hello, ',s,'!')"
+]]>
+		<routine Function="hello2" sql_mode="" character_set_client="latin1" collation_connection="latin1_swedish_ci" Database_Collation="latin1_swedish_ci" />
+<![CDATA[
+"CREATE DEFINER=`root`@`localhost` FUNCTION `hello2`(s CHAR(00)) RETURNS char(00) CHARSET latin1
+    DETERMINISTIC
+RETURN CONCAT('Hello, ',s,'!')"
+]]>
+		<routine Procedure="simpleproc1" sql_mode="" character_set_client="latin1" collation_connection="latin1_swedish_ci" Database_Collation="latin1_swedish_ci" />
+<![CDATA[
+"CREATE DEFINER=`root`@`localhost` PROCEDURE `simpleproc1`(OUT param1 INT)
+BEGIN
+SELECT COUNT(*) INTO param1 FROM t1;
+END"
+]]>
+		<routine Procedure="simpleproc2" sql_mode="" character_set_client="latin1" collation_connection="latin1_swedish_ci" Database_Collation="latin1_swedish_ci" />
+<![CDATA[
+"CREATE DEFINER=`root`@`localhost` PROCEDURE `simpleproc2`(OUT param1 INT)
+BEGIN
+SELECT COUNT(*) INTO param1 FROM t2;
+END"
+]]>
+	</routines>
+</database>
+</mysqldump>
+
+# Dumping BUG52792 database in xml format with comments.
+
+# Using 'replace_regex /[0-9]{2}/00/'
+<?xml version="1.0"?>
+<mysqldump xmlns:xsi="http://www.w3.org/0000/XMLSchema-instance">
+<database name="BUG00002">
+<!-- 
+-
+- Table structure for table `t1`
+-
+
+ -->
+	<table_structure name="t1">
+		<field Field="c1" Type="int(00)" Null="YES" Key="" Extra="" Comment="" />
+		<field Field="c2" Type="varchar(00)" Null="YES" Key="" Extra="" Comment="" />
+		<options Name="t1" Engine="MyISAM" Version="00" Row_format="Dynamic" Rows="3" Avg_row_length="00" Data_length="00" Max_data_length="000000000000005" Index_length="0000" Data_free="0" Create_time="0000-00-00 00:00:00" Update_time="0000-00-00 00:00:00" Collation="latin1_swedish_ci" Create_options="" Comment="" />
+	</table_structure>
+<!-- 
+-
+- Dumping data for table `t1`
+-
+ -->
+	<table_data name="t1">
+	<row>
+		<field name="c1">1</field>
+		<field name="c2">aaa</field>
+	</row>
+	<row>
+		<field name="c1">2</field>
+		<field name="c2">bbb</field>
+	</row>
+	<row>
+		<field name="c1">3</field>
+		<field name="c2">ccc</field>
+	</row>
+	</table_data>
+	<triggers name="trig1">
+		<trigger Trigger="trig1" sql_mode="" character_set_client="latin1" collation_connection="latin1_swedish_ci" Database_Collation="latin1_swedish_ci" />
+<![CDATA[
+"CREATE DEFINER=`root`@`localhost` TRIGGER trig1 BEFORE INSERT ON t1
+FOR EACH ROW BEGIN
+INSERT INTO t1 VALUES(1);
+END"
+]]>
+	</triggers>
+<!-- 
+-
+- Table structure for table `t2`
+-
+
+ -->
+	<table_structure name="t2">
+		<field Field="c1" Type="int(00)" Null="YES" Key="" Extra="" Comment="" />
+		<options Name="t2" Engine="MyISAM" Version="00" Row_format="Fixed" Rows="3" Avg_row_length="7" Data_length="00" Max_data_length="0000000000000000" Index_length="0000" Data_free="0" Create_time="0000-00-00 00:00:00" Update_time="0000-00-00 00:00:00" Collation="latin1_swedish_ci" Create_options="" Comment="" />
+	</table_structure>
+<!-- 
+-
+- Dumping data for table `t2`
+-
+ -->
+	<table_data name="t2">
+	<row>
+		<field name="c1">1</field>
+	</row>
+	<row>
+		<field name="c1">2</field>
+	</row>
+	<row>
+		<field name="c1">3</field>
+	</row>
+	</table_data>
+	<triggers name="trig2">
+		<trigger Trigger="trig2" sql_mode="" character_set_client="latin1" collation_connection="latin1_swedish_ci" Database_Collation="latin1_swedish_ci" />
+<![CDATA[
+"CREATE DEFINER=`root`@`localhost` TRIGGER trig2 BEFORE INSERT ON t2
+FOR EACH ROW BEGIN
+INSERT INTO t2 VALUES(1);
+END"
+]]>
+	</triggers>
+<!-- 
+-
+- Table structure for table `v1`
+-
+
+ -->
+	<table_structure name="v1">
+		<field Field="c1" Type="int(00)" Null="YES" Key="" Extra="" Comment="" />
+		<field Field="c2" Type="varchar(00)" Null="YES" Key="" Extra="" Comment="" />
+		<options Name="v1" Comment="VIEW" />
+	</table_structure>
+<!-- 
+-
+- Table structure for table `v2`
+-
+
+ -->
+	<table_structure name="v2">
+		<field Field="c1" Type="int(00)" Null="YES" Key="" Extra="" Comment="" />
+		<options Name="v2" Comment="VIEW" />
+	</table_structure>
+<!-- 
+-
+- Dumping events for database 'BUG00002'
+-
+ -->
+	<events>
+		<event Event="e1" sql_mode="" time_zone="SYSTEM" character_set_client="latin1" collation_connection="latin1_swedish_ci" Database_Collation="latin1_swedish_ci" />
+<![CDATA[
+"CREATE EVENT `e1` ON SCHEDULE EVERY 1 SECOND STARTS '0000-00-00 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO DROP DATABASE BUG00002"
+]]>
+		<event Event="e2" sql_mode="" time_zone="SYSTEM" character_set_client="latin1" collation_connection="latin1_swedish_ci" Database_Collation="latin1_swedish_ci" />
+<![CDATA[
+"CREATE EVENT `e2` ON SCHEDULE EVERY 1 SECOND STARTS '0000-00-00 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO DROP DATABASE BUG00002"
+]]>
+	</events>
+<!-- 
+-
+- Dumping routines for database 'BUG00002'
+-
+ -->
+<routines>
+		<routine Function="hello1" sql_mode="" character_set_client="latin1" collation_connection="latin1_swedish_ci" Database_Collation="latin1_swedish_ci" />
+<![CDATA[
+"CREATE DEFINER=`root`@`localhost` FUNCTION `hello1`(s CHAR(00)) RETURNS char(00) CHARSET latin1
+    DETERMINISTIC
+RETURN CONCAT('Hello, ',s,'!')"
+]]>
+		<routine Function="hello2" sql_mode="" character_set_client="latin1" collation_connection="latin1_swedish_ci" Database_Collation="latin1_swedish_ci" />
+<![CDATA[
+"CREATE DEFINER=`root`@`localhost` FUNCTION `hello2`(s CHAR(00)) RETURNS char(00) CHARSET latin1
+    DETERMINISTIC
+RETURN CONCAT('Hello, ',s,'!')"
+]]>
+		<routine Procedure="simpleproc1" sql_mode="" character_set_client="latin1" collation_connection="latin1_swedish_ci" Database_Collation="latin1_swedish_ci" />
+<![CDATA[
+"CREATE DEFINER=`root`@`localhost` PROCEDURE `simpleproc1`(OUT param1 INT)
+BEGIN
+SELECT COUNT(*) INTO param1 FROM t1;
+END"
+]]>
+		<routine Procedure="simpleproc2" sql_mode="" character_set_client="latin1" collation_connection="latin1_swedish_ci" Database_Collation="latin1_swedish_ci" />
+<![CDATA[
+"CREATE DEFINER=`root`@`localhost` PROCEDURE `simpleproc2`(OUT param1 INT)
+BEGIN
+SELECT COUNT(*) INTO param1 FROM t2;
+END"
+]]>
+	</routines>
+</database>
+</mysqldump>
+
+# Test to check 'Insufficient privileges' error.
+
+GRANT ALL PRIVILEGES ON BUG52792.* TO user1;
+# Using 'replace_regex /[0-9]{2}/00/'
+<?xml version="1.0"?>
+<mysqldump xmlns:xsi="http://www.w3.org/0000/XMLSchema-instance">
+<database name="BUG00002">
+	<table_structure name="t1">
+		<field Field="c1" Type="int(00)" Null="YES" Key="" Extra="" Comment="" />
+		<field Field="c2" Type="varchar(00)" Null="YES" Key="" Extra="" Comment="" />
+		<options Name="t1" Engine="MyISAM" Version="00" Row_format="Dynamic" Rows="3" Avg_row_length="00" Data_length="00" Max_data_length="000000000000005" Index_length="0000" Data_free="0" Create_time="0000-00-00 00:00:00" Update_time="0000-00-00 00:00:00" Collation="latin1_swedish_ci" Create_options="" Comment="" />
+	</table_structure>
+	<table_data name="t1">
+	<row>
+		<field name="c1">1</field>
+		<field name="c2">aaa</field>
+	</row>
+	<row>
+		<field name="c1">2</field>
+		<field name="c2">bbb</field>
+	</row>
+	<row>
+		<field name="c1">3</field>
+		<field name="c2">ccc</field>
+	</row>
+	</table_data>
+	<triggers name="trig1">
+		<trigger Trigger="trig1" sql_mode="" character_set_client="latin1" collation_connection="latin1_swedish_ci" Database_Collation="latin1_swedish_ci" />
+<![CDATA[
+"CREATE DEFINER=`root`@`localhost` TRIGGER trig1 BEFORE INSERT ON t1
+FOR EACH ROW BEGIN
+INSERT INTO t1 VALUES(1);
+END"
+]]>
+	</triggers>
+	<table_structure name="t2">
+		<field Field="c1" Type="int(00)" Null="YES" Key="" Extra="" Comment="" />
+		<options Name="t2" Engine="MyISAM" Version="00" Row_format="Fixed" Rows="3" Avg_row_length="7" Data_length="00" Max_data_length="0000000000000000" Index_length="0000" Data_free="0" Create_time="0000-00-00 00:00:00" Update_time="0000-00-00 00:00:00" Collation="latin1_swedish_ci" Create_options="" Comment="" />
+	</table_structure>
+	<table_data name="t2">
+	<row>
+		<field name="c1">1</field>
+	</row>
+	<row>
+		<field name="c1">2</field>
+	</row>
+	<row>
+		<field name="c1">3</field>
+	</row>
+	</table_data>
+	<triggers name="trig2">
+		<trigger Trigger="trig2" sql_mode="" character_set_client="latin1" collation_connection="latin1_swedish_ci" Database_Collation="latin1_swedish_ci" />
+<![CDATA[
+"CREATE DEFINER=`root`@`localhost` TRIGGER trig2 BEFORE INSERT ON t2
+FOR EACH ROW BEGIN
+INSERT INTO t2 VALUES(1);
+END"
+]]>
+	</triggers>
+	<table_structure name="v1">
+		<field Field="c1" Type="int(00)" Null="YES" Key="" Extra="" Comment="" />
+		<field Field="c2" Type="varchar(00)" Null="YES" Key="" Extra="" Comment="" />
+		<options Name="v1" Comment="VIEW" />
+	</table_structure>
+	<table_structure name="v2">
+		<field Field="c1" Type="int(00)" Null="YES" Key="" Extra="" Comment="" />
+		<options Name="v2" Comment="VIEW" />
+	</table_structure>
+	<events>
+		<event Event="e1" sql_mode="" time_zone="SYSTEM" character_set_client="latin1" collation_connection="latin1_swedish_ci" Database_Collation="latin1_swedish_ci" />
+<![CDATA[
+"CREATE EVENT `e1` ON SCHEDULE EVERY 1 SECOND STARTS '0000-00-00 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO DROP DATABASE BUG00002"
+]]>
+		<event Event="e2" sql_mode="" time_zone="SYSTEM" character_set_client="latin1" collation_connection="latin1_swedish_ci" Database_Collation="latin1_swedish_ci" />
+<![CDATA[
+"CREATE EVENT `e2` ON SCHEDULE EVERY 1 SECOND STARTS '0000-00-00 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO DROP DATABASE BUG00002"
+]]>
+	</events>
+<routines>
+<!-- 
+- insufficient privileges to SHOW CREATE FUNCTION `hello1`
+ -->
+<!-- - does user1 have permissions on mysql.proc?
+
+ -->
+DROP USER user1;
+DROP DATABASE BUG52792;
+USE test;
+#
 # End of 5.1 tests
 #

=== modified file 'mysql-test/t/mysqldump.test'
--- a/mysql-test/t/mysqldump.test	2011-03-17 10:58:16 +0000
+++ b/mysql-test/t/mysqldump.test	2011-04-23 10:12:25 +0000
@@ -2197,6 +2197,103 @@ DROP DATABASE `test-database`;
 USE `test`;
 
 --echo #
+--echo # BUG#11760384 : 52792: mysqldump in XML mode does not dump routines.
+--echo #
+CREATE DATABASE BUG52792;
+USE BUG52792;
+CREATE TABLE t1 (c1 INT, c2 VARCHAR(20));
+CREATE TABLE t2 (c1 INT);
+INSERT INTO t1 VALUES (1, 'aaa'), (2, 'bbb'), (3, 'ccc');
+INSERT INTO t2 VALUES (1),(2),(3);
+
+--echo # Stored Procedures.
+
+DELIMITER //;
+CREATE PROCEDURE simpleproc1 (OUT param1 INT)
+BEGIN
+  SELECT COUNT(*) INTO param1 FROM t1;
+END//
+DELIMITER ;//
+
+DELIMITER //;
+CREATE PROCEDURE simpleproc2 (OUT param1 INT)
+BEGIN
+  SELECT COUNT(*) INTO param1 FROM t2;
+END//
+DELIMITER ;//
+
+--echo # Events.
+
+CREATE EVENT e1 ON SCHEDULE EVERY 1 SECOND DO DROP DATABASE BUG52792;
+CREATE EVENT e2 ON SCHEDULE EVERY 1 SECOND DO DROP DATABASE BUG52792;
+
+--echo # Functions.
+
+CREATE FUNCTION `hello1` (s CHAR(20))
+  RETURNS CHAR(50) DETERMINISTIC
+RETURN CONCAT('Hello, ',s,'!');
+
+CREATE FUNCTION `hello2` (s CHAR(20))
+    RETURNS CHAR(50) DETERMINISTIC
+RETURN CONCAT('Hello, ',s,'!');
+
+--echo # Triggers.
+
+DELIMITER |;
+CREATE TRIGGER trig1 BEFORE INSERT ON t1
+  FOR EACH ROW BEGIN
+    INSERT INTO t1 VALUES(1);
+END;
+|
+DELIMITER ;|
+
+DELIMITER |;
+CREATE TRIGGER trig2 BEFORE INSERT ON t2
+  FOR EACH ROW BEGIN
+    INSERT INTO t2 VALUES(1);
+END;
+|
+DELIMITER ;|
+
+--echo # Views
+
+CREATE VIEW v1 AS SELECT * FROM t1;
+CREATE VIEW v2 AS SELECT * FROM t2;
+--echo
+--echo # Dumping BUG52792 database in xml format.
+--echo
+--echo # Using 'replace_regex /[0-9]{2}/00/'
+--replace_regex /[0-9]{2}/00/
+--exec $MYSQL_DUMP --user=root --compact -R -E --triggers -X BUG52792
+--echo
+--echo # Dumping BUG52792 database in xml format with comments.
+--echo
+--echo # Using 'replace_regex /[0-9]{2}/00/'
+--replace_regex /[0-9]{2}/00/
+--exec $MYSQL_DUMP --comments --user=root -R -E --triggers -X BUG52792
+
+--echo
+--echo # Test to check 'Insufficient privileges' error.
+--echo
+
+GRANT ALL PRIVILEGES ON BUG52792.* TO user1;
+
+connect (conn_1, localhost, user1, , BUG52792, $MASTER_MYPORT, $MASTER_MYSOCK);
+connection conn_1;
+
+--echo # Using 'replace_regex /[0-9]{2}/00/'
+--replace_regex /[0-9]{2}/00/
+--error 2
+--exec $MYSQL_DUMP --user=user1 -R -E --triggers -X BUG52792
+
+connection default;
+disconnect conn_1;
+
+DROP USER user1;
+DROP DATABASE BUG52792;
+USE test;
+
+--echo #
 --echo # End of 5.1 tests
 --echo #
 


Attachment: [text/bzr-bundle] bzr/nirbhay.choubey@oracle.com-20110423101225-egl03a3kzaf3ko32.bundle
Thread
bzr commit into mysql-5.1 branch (nirbhay.choubey:3622) Bug#11760384Nirbhay Choubey23 Apr