summaryrefslogtreecommitdiff
path: root/mysql-test/t/create.test
diff options
context:
space:
mode:
authorunknown <vva@eagle.mysql.r18.ru>2004-03-14 01:31:30 +0400
committerunknown <vva@eagle.mysql.r18.ru>2004-03-14 01:31:30 +0400
commitb9793c5473f7a0b2a2b011d0897ba2667450a91c (patch)
treefb0387ba3be89722d2976971f7b30de9a601a4b5 /mysql-test/t/create.test
parent8b11f1c10620b40c9fa654f3738daeab4369f8b6 (diff)
downloadmariadb-git-b9793c5473f7a0b2a2b011d0897ba2667450a91c.tar.gz
fixed bug #856 'Naming a key "Primary" causes trouble'
mysql-test/r/create.result: added test for bug #856 'Naming a key "Primary" causes trouble' mysql-test/t/create.test: added test for bug #856 'Naming a key "Primary" causes trouble'
Diffstat (limited to 'mysql-test/t/create.test')
-rw-r--r--mysql-test/t/create.test30
1 files changed, 30 insertions, 0 deletions
diff --git a/mysql-test/t/create.test b/mysql-test/t/create.test
index 70fa4173c76..fedd82356f9 100644
--- a/mysql-test/t/create.test
+++ b/mysql-test/t/create.test
@@ -359,3 +359,33 @@ select database();
# Connect without a database
connect (user4,localhost,mysqltest_1,,*NO-ONE*);
select database();
+
+#
+# Test for Bug 856 'Naming a key "Primary" causes trouble'
+#
+
+use test;
+--error 1280
+create table t1 (a int, index `primary` (a));
+--error 1280
+create table t1 (a int, index `PRIMARY` (a));
+
+create table t1 (`primary` int, index(`primary`));
+show create table t1;
+create table t2 (`PRIMARY` int, index(`PRIMARY`));
+show create table t2;
+
+create table t3 (a int);
+--error 1280
+alter table t3 add index `primary` (a);
+--error 1280
+alter table t3 add index `PRIMARY` (a);
+
+create table t4 (`primary` int);
+alter table t4 add index(`primary`);
+show create table t4;
+create table t5 (`PRIMARY` int);
+alter table t5 add index(`PRIMARY`);
+show create table t5;
+
+drop table t1, t2, t3, t4, t5;