summaryrefslogtreecommitdiff
path: root/mysql-test/suite/ndb/t
diff options
context:
space:
mode:
authorunknown <gni@dev3-221.dev.cn.tlan>2007-11-29 19:19:55 +0800
committerunknown <gni@dev3-221.dev.cn.tlan>2007-11-29 19:19:55 +0800
commit37b188cdffee19d77769ba99a719d436633f6e5b (patch)
tree8d287aeb424a2abf0e2acc8a4824f0110246a877 /mysql-test/suite/ndb/t
parent115e1a1fffe2fdb8b343bb9cba26d1015cca2793 (diff)
downloadmariadb-git-37b188cdffee19d77769ba99a719d436633f6e5b.tar.gz
BUG#30417 Cluster misbehaves on auto-inc w/o PK.
storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp: The check that how many auto_increment columns in table are there should be preceded creating the table. If there are more than one auto_increment columns, the table shouldn't be created. mysql-test/suite/ndb/r/ndb_autoinc.result: Adding test case for auto_increment isn't the default primary key columns mysql-test/suite/ndb/t/ndb_autoinc.test: Adding test case for auto_increment isn't the default primary key columns
Diffstat (limited to 'mysql-test/suite/ndb/t')
-rw-r--r--mysql-test/suite/ndb/t/ndb_autoinc.test43
1 files changed, 43 insertions, 0 deletions
diff --git a/mysql-test/suite/ndb/t/ndb_autoinc.test b/mysql-test/suite/ndb/t/ndb_autoinc.test
new file mode 100644
index 00000000000..3e7ba7bdf6a
--- /dev/null
+++ b/mysql-test/suite/ndb/t/ndb_autoinc.test
@@ -0,0 +1,43 @@
+-- source include/have_ndb.inc
+-- source include/not_embedded.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS t1,t2,t3;
+--enable_warnings
+
+USE test;
+
+CREATE TABLE t1 (
+ id INT AUTO_INCREMENT,
+ PRIMARY KEY(id)
+) ENGINE=NDBCLUSTER;
+
+# Test For bug#30417
+--error 1005
+
+CREATE TABLE t2 (
+ id INT AUTO_INCREMENT,
+ KEY(id)
+) ENGINE=NDBCLUSTER;
+
+SHOW TABLES;
+
+CREATE TABLE t3 (
+ id INT AUTO_INCREMENT,
+ KEY(id)
+) ENGINE=MYISAM;
+
+--error 1005
+ALTER TABLE t3
+ENGINE NDBCLUSTER;
+
+SHOW CREATE TABLE t3;
+
+ALTER TABLE t3
+ADD PRIMARY KEY (id);
+
+SHOW CREATE TABLE t3;
+
+DROP TABLE t1, t3;
+
+--echo End of 5.1 tests