1
0
mirror of https://github.com/MariaDB/server.git synced 2025-12-24 11:21:21 +03:00

Bug#25262 Auto Increment lost when changing Engine type

- Try to copy the autoincrement value when altering the table


mysql-test/r/alter_table.result:
  Update test result
mysql-test/t/alter_table.test:
  Add test case as described in bug report
sql/sql_table.cc:
  Try to copy the autoincrement value when altering the table
This commit is contained in:
unknown
2007-03-01 13:43:04 +01:00
parent b3d96f7972
commit 9248b580b9
5 changed files with 131 additions and 0 deletions

View File

@@ -3274,6 +3274,12 @@ view_err:
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);