diff options
author | unknown <holyfoot/hf@mysql.com/hfmain.(none)> | 2007-04-29 18:39:45 +0500 |
---|---|---|
committer | unknown <holyfoot/hf@mysql.com/hfmain.(none)> | 2007-04-29 18:39:45 +0500 |
commit | 0cd6377f2815db838a0f58acfbd6a2dcdb6cd5af (patch) | |
tree | 765473b871af39c0d2e7edb8b244cd7600e9cdb7 /mysql-test/t | |
parent | a4bfd854145379f86bf622a44e28ced6136c8fa8 (diff) | |
parent | e8225073649844a43bc4ea6362a5df5e6210933b (diff) | |
download | mariadb-git-0cd6377f2815db838a0f58acfbd6a2dcdb6cd5af.tar.gz |
Merge bk@192.168.21.1:mysql-4.1
into mysql.com:/d2/hf/mrg/mysql-4.1-opt
Diffstat (limited to 'mysql-test/t')
-rw-r--r-- | mysql-test/t/alter_table.test | 11 | ||||
-rw-r--r-- | mysql-test/t/innodb_mysql.test | 30 |
2 files changed, 41 insertions, 0 deletions
diff --git a/mysql-test/t/alter_table.test b/mysql-test/t/alter_table.test index 52a569dfb57..874c42ac0b6 100644 --- a/mysql-test/t/alter_table.test +++ b/mysql-test/t/alter_table.test @@ -583,5 +583,16 @@ alter table table_24562 order by no_such_col; drop table table_24562; +# +# Bug #20710: adding unique index of column with duplicated +# long values to reproduce error message with truncated key value. +# + +CREATE TABLE t1 (c1 CHAR(255)); +INSERT INTO t1 VALUES (REPEAT("x", 255)), (REPEAT("x", 255)); +--error 1062 +ALTER TABLE t1 ADD UNIQUE (c1); +DROP TABLE t1; + # End of 4.1 tests diff --git a/mysql-test/t/innodb_mysql.test b/mysql-test/t/innodb_mysql.test index c5a5e997775..0973385dc5b 100644 --- a/mysql-test/t/innodb_mysql.test +++ b/mysql-test/t/innodb_mysql.test @@ -161,4 +161,34 @@ show /*!50002 GLOBAL */ status like 'Handler_rollback'; connection default; drop table t1; disconnect con1; + +# +# Bug #13191: INSERT...ON DUPLICATE KEY UPDATE of UTF-8 string fields +# used in partial unique indices. +# + +CREATE TABLE t1(c1 TEXT, UNIQUE (c1(1)), cnt INT DEFAULT 1) + ENGINE=INNODB CHARACTER SET UTF8; +INSERT INTO t1 (c1) VALUES ('1a'); +SELECT * FROM t1; +INSERT INTO t1 (c1) VALUES ('1b') ON DUPLICATE KEY UPDATE cnt=cnt+1; +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1(c1 VARCHAR(2), UNIQUE (c1(1)), cnt INT DEFAULT 1) + ENGINE=INNODB CHARACTER SET UTF8; +INSERT INTO t1 (c1) VALUES ('1a'); +SELECT * FROM t1; +INSERT INTO t1 (c1) VALUES ('1b') ON DUPLICATE KEY UPDATE cnt=cnt+1; +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1(c1 CHAR(2), UNIQUE (c1(1)), cnt INT DEFAULT 1) + ENGINE=INNODB CHARACTER SET UTF8; +INSERT INTO t1 (c1) VALUES ('1a'); +SELECT * FROM t1; +INSERT INTO t1 (c1) VALUES ('1b') ON DUPLICATE KEY UPDATE cnt=cnt+1; +SELECT * FROM t1; +DROP TABLE t1; + --echo End of 4.1 tests |