|
I've just noticed I missed the actual test case in the bug description. I don't have the original one, so here is a new one:
--source include/have_innodb.inc
|
|
CREATE TABLE t1 (
|
pk INT PRIMARY KEY, f1 INT, f2 CHAR(1), f3 CHAR(1),
|
KEY(f1), KEY(f2)
|
) ENGINE=InnoDB;
|
|
INSERT INTO t1 VALUES
|
(1,4,'v',NULL),(2,6,'v',NULL),(3,7,'c',NULL),(4,1,'e',NULL),(5,0,'x',NULL),
|
(6,7,'i',NULL),(7,7,'e',NULL),(8,1,'p',NULL),(9,7,'s',NULL),(10,1,'j',NULL),
|
(11,5,'z',NULL),(12,2,'c',NULL),(13,0,'a',NULL),(14,1,'q',NULL),(15,8,'y',NULL),
|
(16,1,'m',NULL),(17,1,'r',NULL),(18,9,'v',NULL),(19,1,'n',NULL);
|
|
CREATE TABLE t2 (f4 INT, f5 CHAR(1)) ENGINE=InnoDB;
|
INSERT INTO t2 VALUES (4,'q'),(NULL,'j');
|
|
SELECT * FROM t1 AS t1_1, t1 AS t1_2, t2
|
WHERE f5 = t1_2.f2 AND ( t1_1.f1 = 103 AND t1_1.f2 = 'o' OR t1_1.pk < f4 );
|
EXPLAIN:
EXPLAIN EXTENDED
|
SELECT * FROM t1 AS t1_1, t1 AS t1_2, t2
|
WHERE f5 = t1_2.f2 AND ( t1_1.f1 = 103 AND t1_1.f2 = 'o' OR t1_1.pk < f4 );
|
id select_type table type possible_keys key key_len ref rows filtered Extra
|
1 SIMPLE t2 ALL NULL NULL NULL NULL 2 100.00 Using where
|
1 SIMPLE t1_2 ref f2 f2 2 test.t2.f5 1 100.00
|
1 SIMPLE t1_1 ALL PRIMARY,f1,f2 NULL NULL NULL 19 100.00 Range checked for each record (index map: 0x7)
|
Warnings:
|
Note 1003 select `test`.`t1_1`.`pk` AS `pk`,`test`.`t1_1`.`f1` AS `f1`,`test`.`t1_1`.`f2` AS `f2`,`test`.`t1_1`.`f3` AS `f3`,`test`.`t1_2`.`pk` AS `pk`,`test`.`t1_2`.`f1` AS `f1`,`test`.`t1_2`.`f2` AS `f2`,`test`.`t1_2`.`f3` AS `f3`,`test`.`t2`.`f4` AS `f4`,`test`.`t2`.`f5` AS `f5` from `test`.`t1` `t1_1` join `test`.`t1` `t1_2` join `test`.`t2` where ((`test`.`t1_2`.`f2` = `test`.`t2`.`f5`) and (((`test`.`t1_1`.`f1` = 103) and (`test`.`t1_1`.`f2` = 'o')) or (`test`.`t1_1`.`pk` < `test`.`t2`.`f4`)))
|
#6 0x00007f3f7cace6f1 in *__GI___assert_fail (assertion=0xf177c0 "inited==NONE || (inited==RND && scan)", file=<optimized out>, line=2620, function=0xf1abf0 "int handler::ha_rnd_init(bool)") at assert.c:81
|
#7 0x0000000000610f44 in handler::ha_rnd_init (this=0x7f3f69fce088, scan=false) at 10.0/sql/handler.h:2620
|
#8 0x000000000086b16d in handler::ha_rnd_init_with_error (this=0x7f3f69fce088, scan=false) at 10.0/sql/handler.cc:2720
|
#9 0x0000000000975312 in QUICK_ROR_INTERSECT_SELECT::init_ror_merged_scan (this=0x7f3f69c5a200, reuse_handler=true, alloc=0x7f3f69c5a260) at 10.0/sql/opt_range.cc:2220
|
#10 0x00000000009753d9 in QUICK_ROR_INTERSECT_SELECT::reset (this=0x7f3f69c5a200) at 10.0/sql/opt_range.cc:2241
|
#11 0x00000000006d9add in join_init_read_record (tab=0x7f3f69df18d8) at 10.0/sql/sql_select.cc:18490
|
#12 0x00000000006d98ea in join_init_quick_read_record (tab=0x7f3f69df18d8) at 10.0/sql/sql_select.cc:18452
|
#13 0x00000000006d7b17 in sub_select (join=0x7f3f69f55720, join_tab=0x7f3f69df18d8, end_of_records=false) at 10.0/sql/sql_select.cc:17604
|
#14 0x00000000006d8280 in evaluate_join_record (join=0x7f3f69f55720, join_tab=0x7f3f69df15b0, error=0) at 10.0/sql/sql_select.cc:17829
|
#15 0x00000000006d7b79 in sub_select (join=0x7f3f69f55720, join_tab=0x7f3f69df15b0, end_of_records=false) at 10.0/sql/sql_select.cc:17607
|
#16 0x00000000006d8280 in evaluate_join_record (join=0x7f3f69f55720, join_tab=0x7f3f69df1288, error=0) at 10.0/sql/sql_select.cc:17829
|
#17 0x00000000006d7d0b in sub_select (join=0x7f3f69f55720, join_tab=0x7f3f69df1288, end_of_records=false) at 10.0/sql/sql_select.cc:17646
|
#18 0x00000000006d73de in do_select (join=0x7f3f69f55720, fields=0x7f3f7121f580, table=0x0, procedure=0x0) at 10.0/sql/sql_select.cc:17269
|
#19 0x00000000006b4d18 in JOIN::exec_inner (this=0x7f3f69f55720) at 10.0/sql/sql_select.cc:3079
|
#20 0x00000000006b222a in JOIN::exec (this=0x7f3f69f55720) at 10.0/sql/sql_select.cc:2369
|
#21 0x00000000006b55ad in mysql_select (thd=0x7f3f7121b070, rref_pointer_array=0x7f3f7121f6e0, tables=0x7f3f69da2340, wild_num=1, fields=..., conds=0x7f3f69f55528, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x7f3f69f55700, unit=0x7f3f7121ed80, select_lex=0x7f3f7121f468) at 10.0/sql/sql_select.cc:3307
|
#22 0x00000000006abb8f in handle_select (thd=0x7f3f7121b070, lex=0x7f3f7121ecb8, result=0x7f3f69f55700, setup_tables_done_option=0) at 10.0/sql/sql_select.cc:372
|
#23 0x000000000068087b in execute_sqlcom_select (thd=0x7f3f7121b070, all_tables=0x7f3f69da2340) at 10.0/sql/sql_parse.cc:5266
|
#24 0x0000000000678bd7 in mysql_execute_command (thd=0x7f3f7121b070) at 10.0/sql/sql_parse.cc:2552
|
#25 0x0000000000683005 in mysql_parse (thd=0x7f3f7121b070, rawbuf=0x7f3f69da2088 "SELECT * FROM t1 AS t1_1, t1 AS t1_2, t2\nWHERE f5 = t1_2.f2 AND ( t1_1.f1 = 103 AND t1_1.f2 = 'o' OR t1_1.pk < f4 )", length=115, parser_state=0x7f3f7ea4e610) at 10.0/sql/sql_parse.cc:6412
|
#26 0x0000000000675e78 in dispatch_command (command=COM_QUERY, thd=0x7f3f7121b070, packet=0x7f3f76655071 "", packet_length=115) at 10.0/sql/sql_parse.cc:1307
|
#27 0x000000000067521d in do_command (thd=0x7f3f7121b070) at 10.0/sql/sql_parse.cc:1004
|
#28 0x0000000000791512 in do_handle_one_connection (thd_arg=0x7f3f7121b070) at 10.0/sql/sql_connect.cc:1379
|
#29 0x0000000000791265 in handle_one_connection (arg=0x7f3f7121b070) at 10.0/sql/sql_connect.cc:1293
|
#30 0x0000000000cc4112 in pfs_spawn_thread (arg=0x7f3f7664d0f0) at 10.0/storage/perfschema/pfs.cc:1860
|
#31 0x00007f3f7e687b50 in start_thread (arg=<optimized out>) at pthread_create.c:304
|
#32 0x00007f3f7cb7f20d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
|
Stack trace from:
revision-id: jplindst@mariadb.org-20140825103533-p9jodvh91r9tueo1
|
revno: 4362
|
branch-nick: 10.0
|
|