summaryrefslogtreecommitdiff
path: root/mysql-test/suite
diff options
context:
space:
mode:
authorThirunarayanan B <thirunarayanan.balathandayuth@oracle.com>2014-02-17 13:45:34 +0530
committerThirunarayanan B <thirunarayanan.balathandayuth@oracle.com>2014-02-17 13:45:34 +0530
commit9ea02a1c094594692469e79a519b649ec3b8e487 (patch)
tree41a8a0b882730d8ef943ba56b49b0772965b696a /mysql-test/suite
parent6923c1d9a5020d890dc45a108c0817da33266af2 (diff)
downloadmariadb-git-9ea02a1c094594692469e79a519b649ec3b8e487.tar.gz
Bug #18010711 UNIQUE PREFIX INDEX ON BINARY COLUMN:
FAILING ASSERTION: FLEN == LEN Problem: Broken invariant triggered when building a unique index on a binary column and the input data contains duplicate keys. This was broken in debug builds only. Fix: Fixed length of the binary datatype can be greater than length of the shorter prefix on which index is being created.
Diffstat (limited to 'mysql-test/suite')
-rw-r--r--mysql-test/suite/innodb/r/create-index.result9
-rw-r--r--mysql-test/suite/innodb/t/create-index.test11
2 files changed, 20 insertions, 0 deletions
diff --git a/mysql-test/suite/innodb/r/create-index.result b/mysql-test/suite/innodb/r/create-index.result
new file mode 100644
index 00000000000..ad358a86329
--- /dev/null
+++ b/mysql-test/suite/innodb/r/create-index.result
@@ -0,0 +1,9 @@
+#
+# Bug #18010711 UNIQUE PREFIX INDEX ON BINARY COLUMN: FAILING
+# ASSERTION: FLEN == LEN
+#
+create table t1 (f1 binary(5)) engine=innodb;
+insert into t1 values ('w'), ('w');
+create unique index index_t1 on t1(f1(4));
+ERROR 23000: Duplicate entry 'w' for key 'index_t1'
+drop table t1;
diff --git a/mysql-test/suite/innodb/t/create-index.test b/mysql-test/suite/innodb/t/create-index.test
new file mode 100644
index 00000000000..e1e5b856aca
--- /dev/null
+++ b/mysql-test/suite/innodb/t/create-index.test
@@ -0,0 +1,11 @@
+--source include/have_innodb.inc
+
+--echo #
+--echo # Bug #18010711 UNIQUE PREFIX INDEX ON BINARY COLUMN: FAILING
+--echo # ASSERTION: FLEN == LEN
+--echo #
+create table t1 (f1 binary(5)) engine=innodb;
+insert into t1 values ('w'), ('w');
+--error ER_DUP_ENTRY
+create unique index index_t1 on t1(f1(4));
+drop table t1;