diff options
author | unknown <holyfoot/hf@mysql.com/hfmain.(none)> | 2007-04-29 18:42:50 +0500 |
---|---|---|
committer | unknown <holyfoot/hf@mysql.com/hfmain.(none)> | 2007-04-29 18:42:50 +0500 |
commit | d812bcb9551856e872a3232ebbe6a2cd8c376005 (patch) | |
tree | cc7620ed1a2c650710f867868996b3131a503f1e /mysql-test/t/innodb_mysql.test | |
parent | 56c184503cdbcbbdca808b178bb0861c055c6d9c (diff) | |
parent | 7eb77da33a7da7c56053164793012f1091048350 (diff) | |
download | mariadb-git-d812bcb9551856e872a3232ebbe6a2cd8c376005.tar.gz |
Merge bk@192.168.21.1:mysql-5.0
into mysql.com:/d2/hf/mrg/mysql-5.0-opt
CMakeLists.txt:
Auto merged
sql/ha_innodb.cc:
Auto merged
sql/item_cmpfunc.cc:
Auto merged
tests/mysql_client_test.c:
Auto merged
mysql-test/r/innodb_mysql.result:
merging
mysql-test/t/innodb_mysql.test:
merging
Diffstat (limited to 'mysql-test/t/innodb_mysql.test')
-rw-r--r-- | mysql-test/t/innodb_mysql.test | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/mysql-test/t/innodb_mysql.test b/mysql-test/t/innodb_mysql.test index 61ec64fa566..c9e1de8c3ab 100644 --- a/mysql-test/t/innodb_mysql.test +++ b/mysql-test/t/innodb_mysql.test @@ -139,6 +139,36 @@ eval select STRCMP("$before", "$after") as "Before and after comparison"; 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 # # Bug #12882 min/max inconsistent on empty table @@ -442,4 +472,50 @@ drop table test; set global query_cache_type=@save_qcache_type; set global query_cache_size=@save_qcache_size; +-- source include/have_innodb.inc + +# +# Bug #27650: INSERT fails after multi-row INSERT of the form: +# INSERT INTO t (id...) VALUES (NULL...) ON DUPLICATE KEY UPDATE id=VALUES(id) +# + +create table t1( +id int auto_increment, +c char(1) not null, +counter int not null default 1, +primary key (id), +unique key (c) +) engine=innodb; + +insert into t1 (id, c) values +(NULL, 'a'), +(NULL, 'a') +on duplicate key update id = values(id), counter = counter + 1; + +select * from t1; + +insert into t1 (id, c) values +(NULL, 'b') +on duplicate key update id = values(id), counter = counter + 1; + +select * from t1; + +truncate table t1; + +insert into t1 (id, c) values (NULL, 'a'); + +select * from t1; + +insert into t1 (id, c) values (NULL, 'b'), (NULL, 'b') +on duplicate key update id = values(id), c = values(c), counter = counter + 1; + +select * from t1; + +insert into t1 (id, c) values (NULL, 'a') +on duplicate key update id = values(id), c = values(c), counter = counter + 1; + +select * from t1; + +drop table t1; + --echo End of 5.0 tests |