diff options
| author | Sergei Golubchik <serg@mariadb.org> | 2019-02-21 22:42:00 +0100 |
|---|---|---|
| committer | Sergei Golubchik <serg@mariadb.org> | 2019-02-22 12:33:08 +0100 |
| commit | bd7f7b14163d0696aa92c90deeab16d63ae6bbd6 (patch) | |
| tree | 4548b3da88d7d5231cc936a5d7f281379f1ad9e6 /mysql-test | |
| parent | f6000782fbcd8c0576cb89737ad66902f6113966 (diff) | |
| download | mariadb-git-bd7f7b14163d0696aa92c90deeab16d63ae6bbd6.tar.gz | |
MDEV-371 Unique Index for long columns
post-merge fixes
Diffstat (limited to 'mysql-test')
| -rw-r--r-- | mysql-test/main/long_unique.result | 4 | ||||
| -rw-r--r-- | mysql-test/main/long_unique.test | 6 | ||||
| -rw-r--r-- | mysql-test/main/long_unique_debug.test | 6 | ||||
| -rw-r--r-- | mysql-test/main/long_unique_innodb.result | 10 | ||||
| -rw-r--r-- | mysql-test/main/long_unique_innodb.test | 11 | ||||
| -rw-r--r-- | mysql-test/main/long_unique_update.test | 3 | ||||
| -rw-r--r-- | mysql-test/main/long_unique_using_hash.test | 3 |
7 files changed, 36 insertions, 7 deletions
diff --git a/mysql-test/main/long_unique.result b/mysql-test/main/long_unique.result index 38ec65700a0..082eb4302ee 100644 --- a/mysql-test/main/long_unique.result +++ b/mysql-test/main/long_unique.result @@ -1387,13 +1387,13 @@ create table t1(a blob unique) partition by hash(a); ERROR HY000: A BLOB field is not allowed in partition function #key length > 2^16 -1 create table t1(a blob, unique(a(65536))); -ERROR HY000: Max key segment length is 65535 +ERROR 42000: Specified key part was too long; max key part length is 65535 bytes create table t1(a blob, unique(a(65535))); show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` blob DEFAULT NULL, - UNIQUE KEY `a` (`a`) USING HASH + UNIQUE KEY `a` (`a`(65535)) USING HASH ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; #64 indexes diff --git a/mysql-test/main/long_unique.test b/mysql-test/main/long_unique.test index 11ab5038809..6016c168c36 100644 --- a/mysql-test/main/long_unique.test +++ b/mysql-test/main/long_unique.test @@ -1,6 +1,10 @@ let datadir=`select @@datadir`; --source include/have_partition.inc +# +# MDEV-371 Unique indexes for blobs +# + --echo #Structure of tests --echo #First we will check all option for --echo #table containing single unique column @@ -475,7 +479,7 @@ drop table t1; --error ER_BLOB_FIELD_IN_PART_FUNC_ERROR create table t1(a blob unique) partition by hash(a); --echo #key length > 2^16 -1 ---error ER_TOO_LONG_HASH_KEYSEG +--error ER_TOO_LONG_KEYPART create table t1(a blob, unique(a(65536))); create table t1(a blob, unique(a(65535))); show create table t1; diff --git a/mysql-test/main/long_unique_debug.test b/mysql-test/main/long_unique_debug.test index 63ebfa89b48..560f6499be6 100644 --- a/mysql-test/main/long_unique_debug.test +++ b/mysql-test/main/long_unique_debug.test @@ -1,5 +1,9 @@ --source include/have_debug.inc ---source include/have_innodb.inc + +# +# MDEV-371 Unique indexes for blobs +# + --echo #In this test case we will check what will happen in the case of hash collision SET debug_dbug="d,same_long_unique_hash"; diff --git a/mysql-test/main/long_unique_innodb.result b/mysql-test/main/long_unique_innodb.result index efbddfb30a8..cb8c3ea4858 100644 --- a/mysql-test/main/long_unique_innodb.result +++ b/mysql-test/main/long_unique_innodb.result @@ -3,6 +3,16 @@ insert into t1 values('RUC'); insert into t1 values ('RUC'); ERROR 23000: Duplicate entry 'RUC' for key 'a' drop table t1; +create table t1 (a blob unique , c int unique) engine=innodb; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` blob DEFAULT NULL, + `c` int(11) DEFAULT NULL, + UNIQUE KEY `a` (`a`) USING HASH, + UNIQUE KEY `c` (`c`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +drop table t1; #test for concurrent insert of long unique in innodb create table t1(a blob unique) engine= InnoDB; show create table t1; diff --git a/mysql-test/main/long_unique_innodb.test b/mysql-test/main/long_unique_innodb.test index f3c7f7d952d..aac68cd2271 100644 --- a/mysql-test/main/long_unique_innodb.test +++ b/mysql-test/main/long_unique_innodb.test @@ -1,11 +1,19 @@ --source include/have_innodb.inc +# +# MDEV-371 Unique indexes for blobs +# + create table t1(a blob unique) engine= InnoDB; insert into t1 values('RUC'); --error ER_DUP_ENTRY insert into t1 values ('RUC'); drop table t1; +create table t1 (a blob unique , c int unique) engine=innodb; +show create table t1; +drop table t1; + --echo #test for concurrent insert of long unique in innodb create table t1(a blob unique) engine= InnoDB; show create table t1; @@ -33,7 +41,6 @@ insert into t1 values('RC'); commit; set transaction isolation level READ COMMITTED; start transaction; ---error ER_DUP_ENTRY --error ER_LOCK_WAIT_TIMEOUT insert into t1 values ('RC'); commit; @@ -47,7 +54,6 @@ insert into t1 values('RR'); commit; set transaction isolation level REPEATABLE READ; start transaction; ---error ER_DUP_ENTRY --error ER_LOCK_WAIT_TIMEOUT insert into t1 values ('RR'); @@ -60,7 +66,6 @@ insert into t1 values('S'); commit; set transaction isolation level SERIALIZABLE; start transaction; ---error ER_DUP_ENTRY --error ER_LOCK_WAIT_TIMEOUT insert into t1 values ('S'); commit; diff --git a/mysql-test/main/long_unique_update.test b/mysql-test/main/long_unique_update.test index b160ebad9f1..98c3aaefe17 100644 --- a/mysql-test/main/long_unique_update.test +++ b/mysql-test/main/long_unique_update.test @@ -1,3 +1,6 @@ +# +# MDEV-371 Unique indexes for blobs +# --echo #structure of tests; --echo #1 test of table containing single unique blob column; --echo #2 test of table containing another unique int/ varchar etc column; diff --git a/mysql-test/main/long_unique_using_hash.test b/mysql-test/main/long_unique_using_hash.test index 50f7a4e1920..1e19cd66b02 100644 --- a/mysql-test/main/long_unique_using_hash.test +++ b/mysql-test/main/long_unique_using_hash.test @@ -1,3 +1,6 @@ +# +# MDEV-371 Unique indexes for blobs +# create table t1(a blob , unique(a) using hash); --query_vertical show keys from t1; |
