diff options
Diffstat (limited to 'mysql-test/r/innodb_ext_key.result')
-rw-r--r-- | mysql-test/r/innodb_ext_key.result | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/mysql-test/r/innodb_ext_key.result b/mysql-test/r/innodb_ext_key.result index d2fb29a023c..4e441245a39 100644 --- a/mysql-test/r/innodb_ext_key.result +++ b/mysql-test/r/innodb_ext_key.result @@ -613,6 +613,26 @@ Handler_read_prev 0 Handler_read_rnd 0 Handler_read_rnd_deleted 0 Handler_read_rnd_next 0 +# +# Bug mdev-3851: ref access used instead of expected eq_ref access +# when extended_keys=on +# +create table t0 (a int); +insert into t0 values (1), (2), (3), (4), (5); +create index i_p_size on part(p_size); +set optimizer_switch='extended_keys=on'; +explain +select * from t0, part ignore index (primary) +where p_partkey=t0.a and p_size=1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t0 ALL NULL NULL NULL NULL 5 Using where +1 SIMPLE part eq_ref i_p_size i_p_size 9 const,dbt3_s001.t0.a 1 +select * from t0, part ignore index (primary) +where p_partkey=t0.a and p_size=1; +a p_partkey p_name p_mfgr p_brand p_type p_size p_container p_retailprice p_comment +2 2 blush rosy metallic lemon navajo Manufacturer#1 Brand#13 LARGE BRUSHED BRASS 1 LG CASE 902 final platelets hang f +drop table t0; +drop index i_p_size on part; DROP DATABASE dbt3_s001; use test; # @@ -724,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; |