summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/heap.result5
-rw-r--r--mysql-test/t/heap.test9
2 files changed, 14 insertions, 0 deletions
diff --git a/mysql-test/r/heap.result b/mysql-test/r/heap.result
index d2750fd5a43..52bf99d45ea 100644
--- a/mysql-test/r/heap.result
+++ b/mysql-test/r/heap.result
@@ -696,3 +696,8 @@ drop table t1;
create table t1 (a int not null, b int not null auto_increment,
primary key(a, b)) engine=heap;
ERROR 42000: Incorrect table definition; there can be only one auto column and it must be defined as a key
+create table t1 (c char(255), primary key(c(90)));
+insert into t1 values ("abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz");
+insert into t1 values ("abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz");
+ERROR 23000: Duplicate entry 'abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijkl' for key 1
+drop table t1;
diff --git a/mysql-test/t/heap.test b/mysql-test/t/heap.test
index 68a84e1c193..75ef5a73cb0 100644
--- a/mysql-test/t/heap.test
+++ b/mysql-test/t/heap.test
@@ -426,3 +426,12 @@ drop table t1;
--error 1075
create table t1 (a int not null, b int not null auto_increment,
primary key(a, b)) engine=heap;
+
+#
+# Bug #10566: Verify that we can create a prefixed key with length > 255
+#
+create table t1 (c char(255), primary key(c(90)));
+insert into t1 values ("abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz");
+--error 1062
+insert into t1 values ("abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz");
+drop table t1;