Assertion `table_ref->has_record' failed with small value for join_buffer_size
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MariaDB |
Fix Released
|
High
|
Igor Babaev |
Bug Description
If a table contains a field that is comparable in size to the value for join_cache_level, certain joins cause the following assertion:
mysqld: sql_select.
This happens in maria-5.3 where the fixes for all other "table_
backtrace:
#8 0x006b0d98 in __assert_fail () from /lib/libc.so.6
#9 0x0832d094 in join_read_key2 (thd=0xb256b50, tab=0xae59caa0, table=0xae569088, table_ref=
#10 0x0832ceb0 in join_read_key (tab=0xae59caa0) at sql_select.cc:13992
#11 0x0832bc1f in sub_select (join=0xae596f10, join_tab=
#12 0x0832c2ee in evaluate_
#13 0x0832bc72 in sub_select (join=0xae596f10, join_tab=
#14 0x082e3352 in JOIN_CACHE:
#15 0x082e3114 in JOIN_CACHE:
#16 0x082e2c9e in JOIN_CACHE:
#17 0x0832b898 in sub_select_cache (join=0xae596f10, join_tab=
#18 0x0832bab1 in sub_select (join=0xae596f10, join_tab=
#19 0x0832b0b8 in do_select (join=0xae596f10, fields=0xb25857c, table=0x0, procedure=0x0) at sql_select.cc:13009
#20 0x083109a1 in JOIN::exec (this=0xae596f10) at sql_select.cc:2404
#21 0x0831117e in mysql_select (thd=0xb256b50, rref_pointer_
order=0x0, group=0x0, having=0x0, proc_param=0x0, select_
at sql_select.cc:2621
#22 0x08309685 in handle_select (thd=0xb256b50, lex=0xb2581f0, result=0xae577160, setup_tables_
#23 0x082a47e0 in execute_
#24 0x0829b1fb in mysql_execute_
#25 0x082a6d7e in mysql_parse (thd=0xb256b50,
rawbuf=
#26 0x08298ce4 in dispatch_command (command=COM_QUERY, thd=0xb256b50, packet=0xb26ec81 "", packet_length=146) at sql_parse.cc:1210
#27 0x0829814e in do_command (thd=0xb256b50) at sql_parse.cc:903
#28 0x0829522a in handle_
#29 0x00821919 in start_thread () from /lib/libpthread
#30 0x0076acce in clone () from /lib/libc.so.6
EXPLAIN:
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t6 ALL NULL NULL NULL NULL 3 Using where
1 SIMPLE t5 ALL NULL NULL NULL NULL 1 Using join buffer (flat, BNL join)
1 SIMPLE t1 ALL NULL NULL NULL NULL 1 Using where
1 SIMPLE t4 eq_ref PRIMARY PRIMARY 4 test.t5.f1 1 Using where
1 SIMPLE t3 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join)
1 SIMPLE t2 ALL NULL NULL NULL NULL 0 Using where; Using join buffer (flat, BNL join)
bzr version-info:
revision-id: <email address hidden>
date: 2011-01-12 15:00:10 +0300
build-date: 2011-01-13 13:33:06 +0200
revno: 2876
branch-nick: maria-5.3
test case:
SET SESSION join_buffer_size = 1024;
CREATE TABLE t2 ( f1 int(11)) ;
CREATE TABLE t3 ( f3 int(11)) ;
INSERT IGNORE INTO t3 VALUES (20),(5);
CREATE TABLE t6 ( f3 int(11), f2 int(11)) ;
INSERT IGNORE INTO t6 VALUES (3,-19)
CREATE TABLE t5 ( f1 int(11)) ;
INSERT IGNORE INTO t5 VALUES (9);
CREATE TABLE t1 ( f2 int(11)) ;
INSERT IGNORE INTO t1 VALUES (17);
CREATE TABLE t4 ( f4 varchar(1024), f1 int(11), PRIMARY KEY (f1)) ;
SELECT STRAIGHT_JOIN *
FROM t6 JOIN t5 ON t6.f3
LEFT JOIN t1 JOIN t4 ON t4.f1 ON t5.f1 = t4.f1
LEFT JOIN t3 JOIN t2 ON t3.f3 ON t6.f2
WHERE t2.f1 ;
Changed in maria: | |
assignee: | nobody → Igor Babaev (igorb-seattle) |
milestone: | none → 5.3 |
Changed in maria: | |
status: | New → Confirmed |
importance: | Undecided → High |
Changed in maria: | |
status: | Confirmed → In Progress |
Changed in maria: | |
status: | Fix Committed → Fix Released |
also reproducible with maria-5.3-mwl128
bzr version-info
revision-id: <email address hidden>
date: 2011-01-06 11:40:01 -0800
build-date: 2011-01-13 13:54:08 +0200
revno: 2877
branch-nick: maria-5.3-mwl128