summaryrefslogtreecommitdiff
path: root/mysql-test/t/alter_table.test
diff options
context:
space:
mode:
authorunknown <msvensson@pilot.blaudden>2007-03-01 13:43:04 +0100
committerunknown <msvensson@pilot.blaudden>2007-03-01 13:43:04 +0100
commit9248b580b96ba9246169b80ea0ea53be5137f6b0 (patch)
tree31eae62fb8efd4decfe49c873ca4641f27b1596f /mysql-test/t/alter_table.test
parentb3d96f79727c597404bb559fc6d43c2577c52005 (diff)
downloadmariadb-git-9248b580b96ba9246169b80ea0ea53be5137f6b0.tar.gz
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
Diffstat (limited to 'mysql-test/t/alter_table.test')
-rw-r--r--mysql-test/t/alter_table.test28
1 files changed, 28 insertions, 0 deletions
diff --git a/mysql-test/t/alter_table.test b/mysql-test/t/alter_table.test
index 01f55931ca4..382790e00d0 100644
--- a/mysql-test/t/alter_table.test
+++ b/mysql-test/t/alter_table.test
@@ -613,3 +613,31 @@ create table t1 (t varchar(255) default null, key t (t(80)))
engine=myisam default charset=latin1;
alter table t1 change t t text;
drop table t1;
+
+#
+# Bug#25262 Auto Increment lost when changing Engine type
+#
+
+create table t1(id int(8) primary key auto_increment) engine=heap;
+
+insert into t1 values (null);
+insert into t1 values (null);
+
+select * from t1;
+
+# Set auto increment to 50
+alter table t1 auto_increment = 50;
+
+# Alter to myisam
+alter table t1 engine = myisam;
+
+# This insert should get id 50
+insert into t1 values (null);
+select * from t1;
+
+# Alter to heap again
+alter table t1 engine = heap;
+insert into t1 values (null);
+select * from t1;
+
+drop table t1;