summaryrefslogtreecommitdiff
path: root/mysql-test/main
diff options
context:
space:
mode:
authorsachinsetia1001@gmail.com <sachinsetia1001@gmail.com>2019-03-15 14:27:29 +0530
committersachinsetia1001@gmail.com <sachinsetia1001@gmail.com>2019-03-15 16:05:01 +0530
commit2e34a031f846dbfee547e304328b6450cd61aaee (patch)
treec79948ce4546187f97aa7ffbc005fec202313712 /mysql-test/main
parentecf07300a2f3af39f7fe434bdaa5cd1a49c954bc (diff)
downloadmariadb-git-2e34a031f846dbfee547e304328b6450cd61aaee.tar.gz
MDEV-18809 Server crash in fields_in_hash_keyinfo or Assertion `key_info->key_part->field->flags & (1<< 30)' failed in setup_keyinfo_hash
Move calling setup_keyinfo_hash until all continue is exhausted. And also call re_setup_keyinfo_hash for goto err.
Diffstat (limited to 'mysql-test/main')
-rw-r--r--mysql-test/main/long_unique_bugs.result15
-rw-r--r--mysql-test/main/long_unique_bugs.test18
2 files changed, 33 insertions, 0 deletions
diff --git a/mysql-test/main/long_unique_bugs.result b/mysql-test/main/long_unique_bugs.result
index 26d4fe14575..d1f04d1e9fa 100644
--- a/mysql-test/main/long_unique_bugs.result
+++ b/mysql-test/main/long_unique_bugs.result
@@ -143,3 +143,18 @@ a
3
4
drop table t1;
+CREATE TABLE t1 (f VARCHAR(4096), UNIQUE(f)) ENGINE=InnoDB;
+ALTER TABLE t1 DROP KEY f, ADD INDEX idx1(f), ALGORITHM=INSTANT;
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: ADD INDEX. Try ALGORITHM=NOCOPY
+ALTER TABLE t1 ADD KEY idx2(f);
+Warnings:
+Warning 1071 Specified key was too long; max key length is 3072 bytes
+DROP TABLE t1;
+CREATE TABLE t1(a blob , b blob , unique(a,b));
+alter table t1 drop column b;
+ERROR 42000: Key column 'b' doesn't exist in table
+insert into t1 values(1,1);
+insert into t1 values(1,1);
+ERROR 23000: Duplicate entry '1-1' for key 'a'
+alter table t1 add column c int;
+drop table t1;
diff --git a/mysql-test/main/long_unique_bugs.test b/mysql-test/main/long_unique_bugs.test
index 550ef393595..b8428e32017 100644
--- a/mysql-test/main/long_unique_bugs.test
+++ b/mysql-test/main/long_unique_bugs.test
@@ -160,3 +160,21 @@ ALTER TABLE t1 ADD UNIQUE INDEX (a);
SELECT * FROM t1;
SELECT a FROM t1;
drop table t1;
+
+#
+# MDEV-18809 Server crash in fields_in_hash_keyinfo or Assertion `key_info->key_part->field->flags
+# & (1<< 30)' failed in setup_keyinfo_hash
+#
+CREATE TABLE t1 (f VARCHAR(4096), UNIQUE(f)) ENGINE=InnoDB;
+--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
+ALTER TABLE t1 DROP KEY f, ADD INDEX idx1(f), ALGORITHM=INSTANT;
+ALTER TABLE t1 ADD KEY idx2(f);
+DROP TABLE t1;
+CREATE TABLE t1(a blob , b blob , unique(a,b));
+--error ER_KEY_COLUMN_DOES_NOT_EXITS
+alter table t1 drop column b;
+insert into t1 values(1,1);
+--error ER_DUP_ENTRY
+insert into t1 values(1,1);
+alter table t1 add column c int;
+drop table t1;