summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorunknown <pekka@mysql.com>2006-05-25 13:08:50 +0200
committerunknown <pekka@mysql.com>2006-05-25 13:08:50 +0200
commit69c80350dc78aa43ceffbc623b70b0e7f21fe108 (patch)
treeba6be91421f65c423e40770810ce6ec97a09678f /mysql-test
parentf63e1728f7b9f69dec5f73f3cc7620dbf9d28739 (diff)
parent4e6efa1023034ba288d3c5f72f3545e0bfbdd53c (diff)
downloadmariadb-git-69c80350dc78aa43ceffbc623b70b0e7f21fe108.tar.gz
Merge mysql.com:/space/pekka/ndb/version/my50
into mysql.com:/space/pekka/ndb/version/my50-bug14509 ndb/src/ndbapi/DictCache.cpp: Auto merged ndb/src/ndbapi/DictCache.hpp: Auto merged sql/ha_ndbcluster.cc: Auto merged
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/ndb_alter_table.result23
-rw-r--r--mysql-test/t/ndb_alter_table.test17
2 files changed, 38 insertions, 2 deletions
diff --git a/mysql-test/r/ndb_alter_table.result b/mysql-test/r/ndb_alter_table.result
index acb67250c26..89999eca051 100644
--- a/mysql-test/r/ndb_alter_table.result
+++ b/mysql-test/r/ndb_alter_table.result
@@ -1,4 +1,4 @@
-DROP TABLE IF EXISTS t1;
+DROP TABLE IF EXISTS t1, t2;
drop database if exists mysqltest;
CREATE TABLE t1 (
a INT NOT NULL,
@@ -315,3 +315,24 @@ unique key tx1 (c002, c003, c004, c005)) engine=ndb;
create index tx2
on t1 (c010, c011, c012, c013);
drop table t1;
+create table t1 (a int primary key auto_increment, b int) engine=ndb;
+insert into t1 (b) values (101),(102),(103);
+select * from t1 where a = 3;
+a b
+3 103
+alter table t1 rename t2;
+insert into t2 (b) values (201),(202),(203);
+select * from t2 where a = 6;
+a b
+6 203
+alter table t2 add c int;
+insert into t2 (b) values (301),(302),(303);
+select * from t2 where a = 9;
+a b c
+9 303 NULL
+alter table t2 rename t1;
+insert into t1 (b) values (401),(402),(403);
+select * from t1 where a = 12;
+a b c
+12 403 NULL
+drop table t1;
diff --git a/mysql-test/t/ndb_alter_table.test b/mysql-test/t/ndb_alter_table.test
index 0a0211c8c83..957b95c6fd9 100644
--- a/mysql-test/t/ndb_alter_table.test
+++ b/mysql-test/t/ndb_alter_table.test
@@ -3,7 +3,7 @@
-- source include/not_embedded.inc
--disable_warnings
-DROP TABLE IF EXISTS t1;
+DROP TABLE IF EXISTS t1, t2;
drop database if exists mysqltest;
--enable_warnings
@@ -326,5 +326,20 @@ on t1 (c010, c011, c012, c013);
drop table t1;
+# simple test that auto incr is not lost at rename or alter
+create table t1 (a int primary key auto_increment, b int) engine=ndb;
+insert into t1 (b) values (101),(102),(103);
+select * from t1 where a = 3;
+alter table t1 rename t2;
+insert into t2 (b) values (201),(202),(203);
+select * from t2 where a = 6;
+alter table t2 add c int;
+insert into t2 (b) values (301),(302),(303);
+select * from t2 where a = 9;
+alter table t2 rename t1;
+insert into t1 (b) values (401),(402),(403);
+select * from t1 where a = 12;
+drop table t1;
+
# End of 4.1 tests