diff options
author | Igor Babaev <igor@askmonty.org> | 2012-12-04 16:06:07 -0800 |
---|---|---|
committer | Igor Babaev <igor@askmonty.org> | 2012-12-04 16:06:07 -0800 |
commit | 5e345281e3599c793fdea771d0f23eb19f22d601 (patch) | |
tree | e83f6afd57d876a7e2bc17fb8e616fb85dc76f83 /mysql-test/r/innodb_ext_key.result | |
parent | b057f95d421cd0174d36ce77a058936a7046ed13 (diff) | |
download | mariadb-git-5e345281e3599c793fdea771d0f23eb19f22d601.tar.gz |
Fixed bug mdev-3888.
When inserting a record with update on duplicate keys the server calls
the ha_index_read_idx_map handler function to look for the record
that violates unique key constraints. The third parameter of this call
should mark only the base components of the index where the server is
searched for the record. Possible hidden components of the primary key
are to be unmarked.
Diffstat (limited to 'mysql-test/r/innodb_ext_key.result')
-rw-r--r-- | mysql-test/r/innodb_ext_key.result | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/mysql-test/r/innodb_ext_key.result b/mysql-test/r/innodb_ext_key.result index 0b7b042a0b2..4e441245a39 100644 --- a/mysql-test/r/innodb_ext_key.result +++ b/mysql-test/r/innodb_ext_key.result @@ -744,5 +744,33 @@ SELECT * FROM t1, t2 WHERE b=a; a b set optimizer_switch=@save_optimizer_switch; DROP TABLE t1,t2; +# +# Bug mdev-3888: INSERT with UPDATE on duplicate keys +# with extended_keys=on +# +CREATE TABLE t1 ( +c1 bigint(20) unsigned NOT NULL AUTO_INCREMENT, +c2 bigint(20) unsigned NOT NULL, +c3 bigint(20) unsigned NOT NULL, +c4 varchar(128) DEFAULT NULL, +PRIMARY KEY (c1), +UNIQUE KEY uq (c2,c3), +KEY c3 (c3), +KEY c4 (c4) +) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8; +set @save_optimizer_switch=@@optimizer_switch; +set session optimizer_switch='extended_keys=off'; +INSERT INTO t1 (c2, c3, c4) VALUES (58291525, 2580, 'foobar') +ON DUPLICATE KEY UPDATE c4 = VALUES(c4); +INSERT INTO t1 (c2, c3, c4) VALUES (58291525, 2580, 'foobar') +ON DUPLICATE KEY UPDATE c4 = VALUES(c4); +DELETE FROM t1; +set session optimizer_switch='extended_keys=on'; +INSERT INTO t1 (c2, c3, c4) VALUES (58291525, 2580, 'foobar') +ON DUPLICATE KEY UPDATE c4 = VALUES(c4); +INSERT INTO t1 (c2, c3, c4) VALUES (58291525, 2580, 'foobar') +ON DUPLICATE KEY UPDATE c4 = VALUES(c4); +set optimizer_switch=@save_optimizer_switch; +DROP TABLE t1; set optimizer_switch=@save_ext_key_optimizer_switch; SET SESSION STORAGE_ENGINE=DEFAULT; |