MySQL Lists are EOL. Please join:

List:Internals« Previous MessageNext Message »
From:Patrick Galbraith Date:September 23 2005 5:42pm
Subject:bk commit into 5.0 tree (patg:1.1991) BUG#7815
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of patg. When patg 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
  1.1991 05/09/23 19:42:01 patg@stripped +4 -0
  BUG #7815 
  
  Re-enabled --delayed-insert, added new tests to test all table types for
  support/non-support of delayed insert in the dump.

  mysql-test/r/mysqldump.result
    1.72 05/09/23 19:41:45 patg@stripped +1 -3
    New results 'DELAYED' doesn't use 'LOCK TABLES'

  client/mysqldump.c
    1.202 05/09/23 19:41:45 patg@stripped +173 -110
    BUG #7815
    
    1. Re-enabled --delayed-insert
     - modified options, removed code that was in place until
       bug was fixed
    2. Moved the call to get_table_structure to dump_table
     - Use added 'ignore_flag' variable to determine what exactly is 
       being ignored - whole table or just delayed insert ability
    3. Changed return type of ignore_table to char with byte value that 
       determines what exactly is being ignored - the whole table, or 
       delayed inserts
    4. Added ignore_table flags IGNORE_DATA and IGNORE_INSERT_DELAYED
    5. Added logic in get_table_structure to not append INSERT data text 
       if the table's data isn't going to be dumped because the return
       value from ignore_table is IGNORE_DATA
    6. Changed the name of numFields to numfields. Studly caps aren't 
       consistent with the rest of the code!
    7. Added inclusive list to check_if_ignore_table to set the flag to
       IGNORE_INSERT_DELAYED if the table type doesn't support delayed 
       inserts.
    8. More documentation

  mysql-test/r/mysqldump-max.result
    1.1 05/09/23 19:29:20 patg@stripped +266 -0

  mysql-test/r/mysqldump-max.result
    1.0 05/09/23 19:29:20 patg@stripped +0 -0
    BitKeeper file /Users/patg/mysql-build/mysql-5.0.bug7815/mysql-test/r/mysqldump-max.result

  mysql-test/t/mysqldump-max.test
    1.1 05/09/23 19:29:13 patg@stripped +73 -0

  mysql-test/t/mysqldump-max.test
    1.0 05/09/23 19:29:13 patg@stripped +0 -0
    BitKeeper file /Users/patg/mysql-build/mysql-5.0.bug7815/mysql-test/t/mysqldump-max.test

# 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:	patg
# Host:	radha.local
# Root:	/Users/patg/mysql-build/mysql-5.0.bug7815

--- 1.201/client/mysqldump.c	2005-09-14 15:46:28 +02:00
+++ 1.202/client/mysqldump.c	2005-09-23 19:41:45 +02:00
@@ -70,6 +70,11 @@
 /* Size of buffer for dump's select query */
 #define QUERY_LENGTH 1536
 
+/* ignore table flags */
+#define IGNORE_NONE 0x00 /* no ignore */
+#define IGNORE_DATA 0x01 /* don't dump data for this table */
+#define IGNORE_INSERT_DELAYED 0x02 /* table doesn't support INSERT DELAYED */
+
 static char *add_load_option(char *ptr, const char *object,
 			     const char *statement);
 static ulong find_set(TYPELIB *lib, const char *x, uint length,
@@ -209,9 +214,7 @@
   {"default-character-set", OPT_DEFAULT_CHARSET,
    "Set the default character set.", (gptr*) &default_charset,
    (gptr*) &default_charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
-  {"delayed-insert", OPT_DELAYED, "Insert rows with INSERT DELAYED; "
-   "currently ignored because of http://bugs.mysql.com/bug.php?id=7815 "
-   "but will be re-enabled later",
+  {"delayed-insert", OPT_DELAYED, "Insert rows with INSERT DELAYED; ",
    (gptr*) &opt_delayed, (gptr*) &opt_delayed, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
    0, 0},
   {"delete-master-logs", OPT_DELETE_MASTER_LOGS,
@@ -411,7 +414,7 @@
 static int dump_databases(char **);
 static int dump_all_databases();
 static char *quote_name(const char *name, char *buff, my_bool force);
-static const char *check_if_ignore_table(const char *table_name);
+char check_if_ignore_table(const char *table_name, char *table_type);
 static char *primary_key_fields(const char *table_name);
 static my_bool get_view_structure(char *table, char* db);
 static my_bool dump_all_views_in_db(char *database);
@@ -720,25 +723,6 @@
       }
       break;
     }
-#ifndef REMOVE_THIS_CODE_WHEN_FIX_BUG_7815
-  case (int) OPT_DELAYED:
-    /*
-      Because of http://bugs.mysql.com/bug.php?id=7815, we disable
-      --delayed-insert; when the bug gets fixed by checking the storage engine
-      (using the table definition cache) before printing INSERT DELAYED, we
-      can correct the option's description and re-enable it again (scheduled
-      for later 5.0 or 5.1 versions).
-      It's ok to do the if() below as get_one_option is called after
-      opt_delayed is set.
-    */
-    if (opt_delayed)
-    {
-      fprintf(stderr, "Warning: ignoring --delayed-insert (as explained "
-	      "in the output of 'mysqldump --help').\n");
-      opt_delayed= 0;
-    }
-    break;
-#endif
   }
   return 0;
 }
@@ -1280,19 +1264,27 @@
 }
 
 /*
-  getTableStructure -- retrievs database structure, prints out corresponding
-  CREATE statement and fills out insert_pat.
+  get_table_structure -- retrievs database structure, prints out corresponding
+  CREATE statement and fills out insert_pat if the table is the type we will
+  be dumping.
+
+  ARGS
+    table       - table name
+    db          - db name
+    table_type  - table type ie "InnoDB"
+    ignore_flag - what we must particularly ignore - see IGNORE_ defines above
 
   RETURN
     number of fields in table, 0 if error
 */
 
-static uint get_table_structure(char *table, char *db)
+static uint get_table_structure(char *table, char *db, char *table_type,
+                                char *ignore_flag)
 {
   MYSQL_RES  *tableRes;
   MYSQL_ROW  row;
   my_bool    init=0;
-  uint       numFields;
+  uint       numfields;
   char	     *result_table, *opt_quoted_table;
   const char *insert_option;
   char	     name_buff[NAME_LEN+3],table_buff[NAME_LEN*2+3];
@@ -1300,18 +1292,30 @@
   char       query_buff[512];
   FILE       *sql_file = md_result_file;
   int        len;
+
   DBUG_ENTER("get_table_structure");
   DBUG_PRINT("enter", ("db: %s, table: %s", db, table));
 
-  if (!insert_pat_inited)
+  *ignore_flag= check_if_ignore_table(table, table_type);
+
+  if (opt_delayed && (*ignore_flag & IGNORE_INSERT_DELAYED))
+    if (verbose)
+      fprintf(stderr,
+	      "-- Unable to use delayed inserts for table '%s' because it's of\
+ type %s\n", table, table_type);
+
+  if (!(*ignore_flag & IGNORE_DATA))
   {
-    insert_pat_inited= init_dynamic_string(&insert_pat, "", 1024, 1024);
+    if (!insert_pat_inited)
+      insert_pat_inited= init_dynamic_string(&insert_pat, "", 1024, 1024);
+    else
+      dynstr_set(&insert_pat, "");
   }
-  else
-    dynstr_set(&insert_pat, "");
 
-  insert_option= ((opt_delayed && opt_ignore) ? " DELAYED IGNORE " : 
-                  opt_delayed ? " DELAYED " :
+  insert_option= ((opt_delayed && opt_ignore &&
+                   !(*ignore_flag & IGNORE_INSERT_DELAYED)) ?
+                  " DELAYED IGNORE " :
+                  opt_delayed && !(*ignore_flag & IGNORE_INSERT_DELAYED) ? " DELAYED " :
                   opt_ignore ? " IGNORE " : "");
 
   if (verbose)
@@ -1321,7 +1325,8 @@
                    "SET OPTION SQL_QUOTE_SHOW_CREATE=%d",
                    (opt_quoted || opt_keywords));
   if (!create_options)
-    strmov(query_buff+len, "/*!40102 ,SQL_MODE=concat(@@sql_mode, _utf8 ',NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS') */");
+    strmov(query_buff+len,
+           "/*!40102 ,SQL_MODE=concat(@@sql_mode, _utf8 ',NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS') */");
 
   result_table=     quote_name(table, table_buff, 1);
   opt_quoted_table= quote_name(table, table_buff2, 0);
@@ -1442,34 +1447,42 @@
       DBUG_RETURN(0);
     }
 
-    dynstr_append_mem(&insert_pat, "INSERT ", 7);
-    dynstr_append(&insert_pat, insert_option);
-    dynstr_append_mem(&insert_pat, "INTO ", 5);
-    dynstr_append(&insert_pat, opt_quoted_table);
-    if (opt_complete_insert)
-    {
-      dynstr_append_mem(&insert_pat, " (", 2);
-    }
-    else
+    /*
+      if *ignore_flag & IGNORE_DATA is true, then we don't build up insert statements 
+      for the table's data. Note: in subsequent lines of code, this test will 
+      have to be performed each time we are appending to insert_pat.
+    */
+    if (!(*ignore_flag & IGNORE_DATA))
     {
-      dynstr_append_mem(&insert_pat, " VALUES ", 8);
-      if (!extended_insert)
-        dynstr_append_mem(&insert_pat, "(", 1);
+      dynstr_append_mem(&insert_pat, "INSERT ", 7);
+      dynstr_append(&insert_pat, insert_option);
+      dynstr_append_mem(&insert_pat, "INTO ", 5);
+      dynstr_append(&insert_pat, opt_quoted_table);
+      if (opt_complete_insert)
+      {
+        dynstr_append_mem(&insert_pat, " (", 2);
+      }
+      else
+      {
+        dynstr_append_mem(&insert_pat, " VALUES ", 8);
+        if (!extended_insert)
+          dynstr_append_mem(&insert_pat, "(", 1);
+      }
     }
 
     while ((row=mysql_fetch_row(tableRes)))
     {
       if (init)
       {
-        if (opt_complete_insert)
+        if (opt_complete_insert && !(*ignore_flag & IGNORE_DATA))
           dynstr_append_mem(&insert_pat, ", ", 2);
       }
       init=1;
-      if (opt_complete_insert)
+      if (opt_complete_insert && !(*ignore_flag & IGNORE_DATA))
         dynstr_append(&insert_pat,
                       quote_name(row[SHOW_FIELDNAME], name_buff, 0));
     }
-    numFields = (uint) mysql_num_rows(tableRes);
+    numfields= (uint) mysql_num_rows(tableRes);
     mysql_free_result(tableRes);
   }
   else
@@ -1515,19 +1528,20 @@
       check_io(sql_file);
     }
 
-    dynstr_append_mem(&insert_pat, "INSERT ", 7);
-    dynstr_append(&insert_pat, insert_option);
-    dynstr_append_mem(&insert_pat, "INTO ", 5);
-    dynstr_append(&insert_pat, result_table);
-    if (opt_complete_insert)
+    if (!(*ignore_flag & IGNORE_DATA))
     {
-      dynstr_append_mem(&insert_pat, " (", 2);
-    }
-    else
-    {
-      dynstr_append_mem(&insert_pat, " VALUES ", 8);
-      if (!extended_insert)
-        dynstr_append_mem(&insert_pat, "(", 1);
+      dynstr_append_mem(&insert_pat, "INSERT ", 7);
+      dynstr_append(&insert_pat, insert_option);
+      dynstr_append_mem(&insert_pat, "INTO ", 5);
+      dynstr_append(&insert_pat, result_table);
+      if (opt_complete_insert)
+        dynstr_append_mem(&insert_pat, " (", 2);
+      else
+      {
+        dynstr_append_mem(&insert_pat, " VALUES ", 8);
+        if (!extended_insert)
+          dynstr_append_mem(&insert_pat, "(", 1);
+      }
     }
 
     while ((row=mysql_fetch_row(tableRes)))
@@ -1540,11 +1554,11 @@
 	  fputs(",\n",sql_file);
 	  check_io(sql_file);
 	}
-        if (opt_complete_insert)
+        if (opt_complete_insert && !(*ignore_flag & IGNORE_DATA))
           dynstr_append_mem(&insert_pat, ", ", 2);
       }
       init=1;
-      if (opt_complete_insert)
+      if (opt_complete_insert && !(*ignore_flag & IGNORE_DATA))
         dynstr_append(&insert_pat,
                       quote_name(row[SHOW_FIELDNAME], name_buff, 0));
       if (!tFlag)
@@ -1575,7 +1589,7 @@
 	check_io(sql_file);
       }
     }
-    numFields = (uint) mysql_num_rows(tableRes);
+    numfields = (uint) mysql_num_rows(tableRes);
     mysql_free_result(tableRes);
     if (!tFlag)
     {
@@ -1627,7 +1641,7 @@
 	  print_xml_row(sql_file, "key", tableRes, &row);
 	  continue;
 	}
-        
+
         if (atoi(row[3]) == 1)
         {
 	  if (keynr++)
@@ -1684,9 +1698,7 @@
         else
         {
 	  if (opt_xml)
-	  {
 	    print_xml_row(sql_file, "options", tableRes, &row);
-	  }
 	  else
 	  {
 	    fputs("/*!",sql_file);
@@ -1707,7 +1719,7 @@
       check_io(sql_file);
     }
   }
-  if (opt_complete_insert)
+  if (opt_complete_insert && !(*ignore_flag & IGNORE_DATA))
   {
     dynstr_append_mem(&insert_pat, ") VALUES ", 9);
     if (!extended_insert)
@@ -1719,7 +1731,7 @@
     write_footer(sql_file);
     my_fclose(sql_file, MYF(MY_WME));
   }
-  DBUG_RETURN(numFields);
+  DBUG_RETURN(numfields);
 } /* get_table_structure */
 
 
@@ -1844,20 +1856,40 @@
 
 
 /*
-** dump_table saves database contents as a series of INSERT statements.
+
+ SYNOPSIS
+  dump_table()
+
+  dump_table saves database contents as a series of INSERT statements.
+
+  ARGS
+   table - table name
+   db    - db name
+
+   RETURNS
+    void
 */
 
-static void dump_table(uint numFields, char *table)
+static void dump_table(char *table, char *db)
 {
+  char ignore_flag;
   char query_buf[QUERY_LENGTH], *end, buff[256],table_buff[NAME_LEN+3];
+  char    table_type[NAME_LEN];
   char *result_table, table_buff2[NAME_LEN*2+3], *opt_quoted_table;
   char *query= query_buf;
+  int error= 0;
+  ulong		rownr, row_break, total_length, init_length;
+  uint numfields;
   MYSQL_RES	*res;
   MYSQL_FIELD	*field;
   MYSQL_ROW	row;
-  ulong		rownr, row_break, total_length, init_length;
-  const char    *table_type;
-  int error= 0;
+  DBUG_ENTER("dump_table");
+
+  /*
+    Make sure you get the create table info before the following check for
+    --no-data flag below. Otherwise, the create table info won't be printed.
+  */
+  numfields= get_table_structure(table, db, (char *)&table_type, &ignore_flag);
 
   /* Check --no-data flag */
   if (dFlag)
@@ -1866,31 +1898,35 @@
       fprintf(stderr,
               "-- Skipping dump data for table '%s', --no-data was used\n",
 	      table);
-    return;
+    DBUG_VOID_RETURN;
   }
 
+  DBUG_PRINT("info", ("ignore_flag %x numfields %d", ignore_flag, numfields));
+  /*
+    If the table type is a merge table or any type that has to be
+     _completely_ ignored and no data dumped
+  */
+  if (ignore_flag & IGNORE_DATA)
+  {
+    if (verbose)
+      fprintf(stderr,
+	      "-- Skipping data for table '%s' because it's of type %s\n",
+	      table, table_type);
+    DBUG_VOID_RETURN;
+  }
   /* Check that there are any fields in the table */
-  if (numFields == 0)
+  if (numfields == 0)
   {
     if (verbose)
       fprintf(stderr,
 	      "-- Skipping dump data for table '%s', it has no fields\n",
 	      table);
-    return;
+    DBUG_VOID_RETURN;
   }
 
   result_table= quote_name(table,table_buff, 1);
   opt_quoted_table= quote_name(table, table_buff2, 0);
 
-  /* Check table type */
-  if ((table_type= check_if_ignore_table(table)))
-  {
-    if (verbose)
-      fprintf(stderr,
-	      "-- Skipping data for table '%s' because it's of type %s\n",
-	      table, table_type);
-    return;
-  }
 
   if (verbose)
     fprintf(stderr, "-- Sending SELECT query...\n");
@@ -1934,7 +1970,7 @@
     if (mysql_real_query(sock, query, (uint) (end - query)))
     {
       DB_error(sock, "when executing 'SELECT INTO OUTFILE'");
-      return;
+      DBUG_VOID_RETURN;
     }
   }
   else
@@ -1989,7 +2025,7 @@
       DB_error(sock, "when retrieving data from server");
     if (verbose)
       fprintf(stderr, "-- Retrieving rows...\n");
-    if (mysql_num_fields(res) != numFields)
+    if (mysql_num_fields(res) != numfields)
     {
       fprintf(stderr,"%s: Error in field count for table: %s !  Aborting.\n",
 	      my_progname, result_table);
@@ -2052,7 +2088,7 @@
 	  error= EX_CONSCHECK;
 	  goto err;
 	}
-	
+
 	/*
 	   63 is my_charset_bin. If charsetnr is not 63,
 	   we have not a BLOB but a TEXT column. 
@@ -2287,14 +2323,14 @@
     mysql_free_result(res);
     if (query != query_buf)
       my_free(query, MYF(MY_ALLOW_ZERO_PTR));
-  } 
-  return;
+  }
+  DBUG_VOID_RETURN;
 
 err:
   if (query != query_buf)
     my_free(query, MYF(MY_ALLOW_ZERO_PTR));
   safe_exit(error);
-  return;
+  DBUG_VOID_RETURN;
 } /* dump_table */
 
 
@@ -2495,8 +2531,7 @@
     char *end= strmov(afterdot, table);
     if (include_table(hash_key, end - hash_key))
     {
-      numrows = get_table_structure(table, database);
-      dump_table(numrows,table);
+      dump_table(table,database);
       my_free(order_by, MYF(MY_ALLOW_ZERO_PTR));
       order_by= 0;
       if (opt_dump_triggers && ! opt_xml &&
@@ -2630,7 +2665,7 @@
 
 static int dump_selected_tables(char *db, char **table_names, int tables)
 {
-  uint numrows, i;
+  uint i;
   char table_buff[NAME_LEN*+3];
   char new_table_name[NAME_LEN];
   DYNAMIC_STRING lock_tables_query;
@@ -2699,8 +2734,7 @@
   {
     table_name= hash_element(&dump_tables, i);
     DBUG_PRINT("info",("Dumping table %s", table_name));
-    numrows= get_table_structure(table_name, db);
-    dump_table(numrows, table_name);
+    dump_table(table_name,db);
     if (opt_dump_triggers &&
         mysql_get_server_version(sock) >= 50009)
       dump_triggers_for_table(table_name, db);
@@ -2899,28 +2933,37 @@
 
 
 /*
-  Check if we the table is one of the table types that should be ignored:
-  MRG_ISAM, MRG_MYISAM
 
   SYNOPSIS
+
+  Check if we the table is one of the table types that should be ignored:
+  MRG_ISAM, MRG_MYISAM, if opt_delayed, if that table supports delayed inserts.
+  If the table should be altogether ignored, it returns a TRUE, FALSE if it
+  should not be ignored. If the user has selected to use INSERT DELAYED, it 
+  sets the value of the bool pointer supports_delayed_inserts to 0 if not 
+  supported, 1 if it is supported.
+
+  ARGS
+
     check_if_ignore_table()
     table_name			Table name to check
+    table_type                  Type of table
 
   GLOBAL VARIABLES
     sock			MySQL socket
     verbose			Write warning messages
 
   RETURN
-    0	Table should be backuped
-    #	Type of table (that should be skipped)
+    char (bit value)            See IGNORE_ values at top
 */
 
-static const char *check_if_ignore_table(const char *table_name)
+char check_if_ignore_table(const char *table_name, char *table_type)
 {
+  bool result= IGNORE_NONE;
   char buff[FN_REFLEN+80], show_name_buff[FN_REFLEN];
   MYSQL_RES *res;
   MYSQL_ROW row;
-  const char *result= 0;
+  DBUG_ENTER("check_if_ignore_table");
 
   /* Check memory for quote_for_like() */
   DBUG_ASSERT(2*sizeof(table_name) < sizeof(show_name_buff));
@@ -2934,7 +2977,7 @@
 	fprintf(stderr,
 		"-- Warning: Couldn't get status information for table %s (%s)\n",
 		table_name,mysql_error(sock));
-      return 0;					/* assume table is ok */
+      DBUG_RETURN(1);					/* assume table is ok */
     }
   }
   if (!(row= mysql_fetch_row(res)))
@@ -2943,18 +2986,38 @@
 	    "Error: Couldn't read status information for table %s (%s)\n",
 	    table_name, mysql_error(sock));
     mysql_free_result(res);
-    return 0;					/* assume table is ok */
+    DBUG_RETURN(1);					/* assume table is ok */
   }
   if (!(row[1]))
-      result= "VIEW";
+      sprintf(table_type,"%s","VIEW");
   else
   {
-    if (strcmp(row[1], (result= "MRG_MyISAM")) &&
-        strcmp(row[1], (result= "MRG_ISAM")))
-      result= 0;
+    /*
+      If the table type matches any of these, we do support delayed inserts.
+      Note: we do not want to skip dumping this table if if is not one of
+      these types, but we do want to use delayed inserts in the dump if
+      the table type is _NOT_ one of these types
+    */
+    sprintf(table_type, "%s",row[1]);
+    if (opt_delayed)
+    {
+      if (strcmp(table_type,"MyISAM") &&
+          strcmp(table_type,"ISAM") &&
+          strcmp(table_type,"ARCHIVE") &&
+          strcmp(table_type,"HEAP") &&
+          strcmp(table_type,"MEMORY"))
+        result= IGNORE_INSERT_DELAYED;
+    }
+
+    /*
+      If these two types, we do want to skip dumping the table
+    */
+    if (!strcmp(table_type,"MRG_MyISAM") ||
+        !strcmp(table_type,"MRG_ISAM"))
+      result= IGNORE_DATA;
   }
   mysql_free_result(res);
-  return result;
+  DBUG_RETURN(result);
 }
 
 /*
--- New file ---
+++ mysql-test/r/mysqldump-max.result	05/09/23 19:29:20
drop table if exists sometable;
Warnings:
Note	1051	Unknown table 'sometable'
drop table if exists mytable;
Warnings:
Note	1051	Unknown table 'mytable'
drop table if exists memtable;
Warnings:
Note	1051	Unknown table 'memtable'
drop table if exists archtable;
Warnings:
Note	1051	Unknown table 'archtable'
drop table if exists heaptable;
Warnings:
Note	1051	Unknown table 'heaptable'
drop table if exists innotable;
Warnings:
Note	1051	Unknown table 'innotable'
create table sometable (id int(8), name varchar(32));
create table mytable (id int(8), name varchar(32)) ENGINE="MyISAM";
create table memtable (id int(8), name varchar(32)) ENGINE="MEMORY";
create table heaptable (id int(8), name varchar(32)) ENGINE="HEAP";
create table archtable (id int(8), name varchar(32)) ENGINE="ARCHIVE";
create table innotable (id int(8), name varchar(32)) ENGINE="InnoDB";
insert into sometable values (1, 'first value');
insert into sometable values (2, 'first value');
insert into sometable values (3, 'first value');
insert into sometable values (4, 'first value');
insert into sometable values (5, 'first value');
insert into mytable values (1, 'first value');
insert into mytable values (2, 'first value');
insert into mytable values (3, 'first value');
insert into mytable values (4, 'first value');
insert into mytable values (5, 'first value');
insert into memtable values (1, 'first value');
insert into memtable values (2, 'first value');
insert into memtable values (3, 'first value');
insert into memtable values (4, 'first value');
insert into memtable values (5, 'first value');
insert into heaptable values (1, 'first value');
insert into heaptable values (2, 'first value');
insert into heaptable values (3, 'first value');
insert into heaptable values (4, 'first value');
insert into heaptable values (5, 'first value');
insert into archtable values (1, 'first value');
insert into archtable values (2, 'first value');
insert into archtable values (3, 'first value');
insert into archtable values (4, 'first value');
insert into archtable values (5, 'first value');
insert into innotable values (1, 'first value');
insert into innotable values (2, 'first value');
insert into innotable values (3, 'first value');
insert into innotable values (4, 'first value');
insert into innotable values (5, 'first value');
select * from sometable;
id	name
1	first value
2	first value
3	first value
4	first value
5	first value
select * from mytable;
id	name
1	first value
2	first value
3	first value
4	first value
5	first value
select * from memtable;
id	name
1	first value
2	first value
3	first value
4	first value
5	first value
select * from heaptable;
id	name
1	first value
2	first value
3	first value
4	first value
5	first value
select * from archtable;
id	name
1	first value
2	first value
3	first value
4	first value
5	first value
select * from innotable;
id	name
1	first value
2	first value
3	first value
4	first value
5	first value

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;

CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test` /*!40100 DEFAULT CHARACTER SET latin1 */;

USE `test`;
DROP TABLE IF EXISTS `archtable`;
CREATE TABLE `archtable` (
  `id` int(8) default NULL,
  `name` varchar(32) default NULL
) ENGINE=ARCHIVE DEFAULT CHARSET=latin1;


/*!40000 ALTER TABLE `archtable` DISABLE KEYS */;
INSERT  DELAYED IGNORE INTO `archtable` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
/*!40000 ALTER TABLE `archtable` ENABLE KEYS */;
DROP TABLE IF EXISTS `heaptable`;
CREATE TABLE `heaptable` (
  `id` int(8) default NULL,
  `name` varchar(32) default NULL
) ENGINE=MEMORY DEFAULT CHARSET=latin1;


/*!40000 ALTER TABLE `heaptable` DISABLE KEYS */;
INSERT  DELAYED IGNORE INTO `heaptable` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
/*!40000 ALTER TABLE `heaptable` ENABLE KEYS */;
DROP TABLE IF EXISTS `innotable`;
CREATE TABLE `innotable` (
  `id` int(8) default NULL,
  `name` varchar(32) default NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;


/*!40000 ALTER TABLE `innotable` DISABLE KEYS */;
INSERT  IGNORE INTO `innotable` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
/*!40000 ALTER TABLE `innotable` ENABLE KEYS */;
DROP TABLE IF EXISTS `memtable`;
CREATE TABLE `memtable` (
  `id` int(8) default NULL,
  `name` varchar(32) default NULL
) ENGINE=MEMORY DEFAULT CHARSET=latin1;


/*!40000 ALTER TABLE `memtable` DISABLE KEYS */;
INSERT  DELAYED IGNORE INTO `memtable` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
/*!40000 ALTER TABLE `memtable` ENABLE KEYS */;
DROP TABLE IF EXISTS `mytable`;
CREATE TABLE `mytable` (
  `id` int(8) default NULL,
  `name` varchar(32) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;


/*!40000 ALTER TABLE `mytable` DISABLE KEYS */;
INSERT  DELAYED IGNORE INTO `mytable` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
/*!40000 ALTER TABLE `mytable` ENABLE KEYS */;
DROP TABLE IF EXISTS `sometable`;
CREATE TABLE `sometable` (
  `id` int(8) default NULL,
  `name` varchar(32) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;


/*!40000 ALTER TABLE `sometable` DISABLE KEYS */;
INSERT  DELAYED IGNORE INTO `sometable` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
/*!40000 ALTER TABLE `sometable` ENABLE KEYS */;

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;

CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test` /*!40100 DEFAULT CHARACTER SET latin1 */;

USE `test`;
DROP TABLE IF EXISTS `archtable`;
CREATE TABLE `archtable` (
  `id` int(8) default NULL,
  `name` varchar(32) default NULL
) ENGINE=ARCHIVE DEFAULT CHARSET=latin1;


/*!40000 ALTER TABLE `archtable` DISABLE KEYS */;
INSERT  DELAYED INTO `archtable` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
/*!40000 ALTER TABLE `archtable` ENABLE KEYS */;
DROP TABLE IF EXISTS `heaptable`;
CREATE TABLE `heaptable` (
  `id` int(8) default NULL,
  `name` varchar(32) default NULL
) ENGINE=MEMORY DEFAULT CHARSET=latin1;


/*!40000 ALTER TABLE `heaptable` DISABLE KEYS */;
INSERT  DELAYED INTO `heaptable` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
/*!40000 ALTER TABLE `heaptable` ENABLE KEYS */;
DROP TABLE IF EXISTS `innotable`;
CREATE TABLE `innotable` (
  `id` int(8) default NULL,
  `name` varchar(32) default NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;


/*!40000 ALTER TABLE `innotable` DISABLE KEYS */;
INSERT INTO `innotable` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
/*!40000 ALTER TABLE `innotable` ENABLE KEYS */;
DROP TABLE IF EXISTS `memtable`;
CREATE TABLE `memtable` (
  `id` int(8) default NULL,
  `name` varchar(32) default NULL
) ENGINE=MEMORY DEFAULT CHARSET=latin1;


/*!40000 ALTER TABLE `memtable` DISABLE KEYS */;
INSERT  DELAYED INTO `memtable` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
/*!40000 ALTER TABLE `memtable` ENABLE KEYS */;
DROP TABLE IF EXISTS `mytable`;
CREATE TABLE `mytable` (
  `id` int(8) default NULL,
  `name` varchar(32) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;


/*!40000 ALTER TABLE `mytable` DISABLE KEYS */;
INSERT  DELAYED INTO `mytable` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
/*!40000 ALTER TABLE `mytable` ENABLE KEYS */;
DROP TABLE IF EXISTS `sometable`;
CREATE TABLE `sometable` (
  `id` int(8) default NULL,
  `name` varchar(32) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;


/*!40000 ALTER TABLE `sometable` DISABLE KEYS */;
INSERT  DELAYED INTO `sometable` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
/*!40000 ALTER TABLE `sometable` ENABLE KEYS */;

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

drop table sometable;
drop table mytable;
drop table archtable;
drop table memtable;
drop table heaptable;
drop table innotable;

--- New file ---
+++ mysql-test/t/mysqldump-max.test	05/09/23 19:29:13
# Embedded server doesn't support external clients
--source include/not_embedded.inc
--source include/have_innodb.inc
--source include/have_archive.inc

--disable-warnings
drop table if exists sometable; 
drop table if exists mytable; 
drop table if exists memtable; 
drop table if exists archtable; 
drop table if exists heaptable; 
drop table if exists innotable; 
--enable-warnings

create table sometable (id int(8), name varchar(32));
create table mytable (id int(8), name varchar(32)) ENGINE="MyISAM";
create table memtable (id int(8), name varchar(32)) ENGINE="MEMORY";
create table heaptable (id int(8), name varchar(32)) ENGINE="HEAP";
create table archtable (id int(8), name varchar(32)) ENGINE="ARCHIVE";
create table innotable (id int(8), name varchar(32)) ENGINE="InnoDB";

insert into sometable values (1, 'first value');
insert into sometable values (2, 'first value');
insert into sometable values (3, 'first value');
insert into sometable values (4, 'first value');
insert into sometable values (5, 'first value');

insert into mytable values (1, 'first value');
insert into mytable values (2, 'first value');
insert into mytable values (3, 'first value');
insert into mytable values (4, 'first value');
insert into mytable values (5, 'first value');

insert into memtable values (1, 'first value');
insert into memtable values (2, 'first value');
insert into memtable values (3, 'first value');
insert into memtable values (4, 'first value');
insert into memtable values (5, 'first value');

insert into heaptable values (1, 'first value');
insert into heaptable values (2, 'first value');
insert into heaptable values (3, 'first value');
insert into heaptable values (4, 'first value');
insert into heaptable values (5, 'first value');

insert into archtable values (1, 'first value');
insert into archtable values (2, 'first value');
insert into archtable values (3, 'first value');
insert into archtable values (4, 'first value');
insert into archtable values (5, 'first value');

insert into innotable values (1, 'first value');
insert into innotable values (2, 'first value');
insert into innotable values (3, 'first value');
insert into innotable values (4, 'first value');
insert into innotable values (5, 'first value');

select * from sometable;
select * from mytable;
select * from memtable;
select * from heaptable;
select * from archtable;
select * from innotable;

--exec $MYSQL_DUMP --skip-comments --delayed-insert --insert-ignore --databases test
--exec $MYSQL_DUMP --skip-comments --delayed-insert --databases test

drop table sometable;
drop table mytable;
drop table archtable;
drop table memtable;
drop table heaptable;
drop table innotable;


--- 1.71/mysql-test/r/mysqldump.result	2005-09-14 11:24:10 +02:00
+++ 1.72/mysql-test/r/mysqldump.result	2005-09-23 19:41:45 +02:00
@@ -614,9 +614,7 @@
 
 
 /*!40000 ALTER TABLE `t1` DISABLE KEYS */;
-LOCK TABLES `t1` WRITE;
-INSERT  IGNORE INTO `t1` VALUES (1),(2),(3),(4),(5),(6);
-UNLOCK TABLES;
+INSERT  DELAYED IGNORE INTO `t1` VALUES (1),(2),(3),(4),(5),(6);
 /*!40000 ALTER TABLE `t1` ENABLE KEYS */;
 
 /*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
Thread
bk commit into 5.0 tree (patg:1.1991) BUG#7815Patrick Galbraith23 Sep