List:Commits« Previous MessageNext Message »
From:msvensson Date:February 7 2007 2:58pm
Subject:bk commit into 5.0 tree (msvensson:1.2407) BUG#25262
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of msvensson. When msvensson 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-02-07 14:58:51+01:00, msvensson@stripped +1 -0
  Bug#25262 Auto Increment lost when changing Engine type
   - Try to copy the autoincrement value when altering the table

  sql/sql_table.cc@stripped, 2007-02-07 14:58:49+01:00, msvensson@stripped +6 -0
    Try to copy the autoincrement value when altering the table

# 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:	msvensson
# Host:	pilot.mysql.com
# Root:	/home/msvensson/mysql/bug25262/my50-bug25262

--- 1.333/sql/sql_table.cc	2007-01-26 13:36:47 +01:00
+++ 1.334/sql/sql_table.cc	2007-02-07 14:58:49 +01:00
@@ -3274,6 +3274,12 @@
     create_info->avg_row_length= table->s->avg_row_length;
   if (!(used_fields & HA_CREATE_USED_DEFAULT_CHARSET))
     create_info->default_table_charset= table->s->table_charset;
+  if (!(used_fields & HA_CREATE_USED_AUTO) &&
table->found_next_number_field)
+  {
+    /* Table has an autoincrement, copy value to new table */
+    table->file->info(HA_STATUS_AUTO);
+    create_info->auto_increment_value= table->file->auto_increment_value;
+  }
 
   restore_record(table, s->default_values);     // Empty record for DEFAULT
   List_iterator<Alter_drop> drop_it(alter_info->drop_list);
Thread
bk commit into 5.0 tree (msvensson:1.2407) BUG#25262msvensson7 Feb