Assertion `cp + len <= buff + buff_size' failed in JOIN_CACHE::write_record_data with derived_merge=ON
| Affects | Status | Importance | Assigned to | Milestone | |
|---|---|---|---|---|---|
| MariaDB |
Fix Released
|
Critical
|
Igor Babaev | ||
Bug Description
The following query:
SELECT t2.d
FROM t1, t2 , (
SELECT t3.*
FROM t3, t4, t5
) AS alias3
WHERE alias3.e = t2.d ;
asserts when run with derived_merge=on. The required dataset is somewhat larger, which points to some sort of join cache overflow. Valgrind does not report any warnings.
Assertion:
mysqld: sql_join_
backtrace:
#8 0x006b0d98 in __assert_fail () from /lib/libc.so.6
#9 0x082f1e47 in JOIN_CACHE:
#10 0x082f22f6 in JOIN_CACHE:
#11 0x0833d6ce in sub_select_cache (join=0xae53e598, join_tab=
#12 0x082f35af in JOIN_CACHE:
#13 0x082f3307 in JOIN_CACHE:
#14 0x082f2dc7 in JOIN_CACHE:
#15 0x0833d604 in sub_select_cache (join=0xae53e598, join_tab=
#16 0x0833d81c in sub_select (join=0xae53e598, join_tab=
#17 0x0833d630 in sub_select_cache (join=0xae53e598, join_tab=
#18 0x0833d81c in sub_select (join=0xae53e598, join_tab=
#19 0x0833d81c in sub_select (join=0xae53e598, join_tab=
#20 0x0833d30b in do_select (join=0xae53e598, fields=0x9dfd1b4, table=0x0, procedure=0x0) at sql_select.cc:14771
#21 0x08321c11 in JOIN::exec (this=0xae53e598) at sql_select.cc:2679
#22 0x0832243e in mysql_select (thd=0x9dfb6e0, rref_pointer_
order=0x0, group=0x0, having=0x0, proc_param=0x0, select_
at sql_select.cc:2900
#23 0x0831a20f in handle_select (thd=0x9dfb6e0, lex=0x9dfcde4, result=0xae514cb0, setup_tables_
#24 0x082b49dc in execute_
#25 0x082ab799 in mysql_execute_
#26 0x082b700b in mysql_parse (thd=0x9dfb6e0,
rawbuf=
found_
#27 0x082a93e8 in dispatch_command (command=COM_QUERY, thd=0x9dfb6e0, packet=0x9e54321 "", packet_length=91) at sql_parse.cc:1221
#28 0x082a8843 in do_command (thd=0x9dfb6e0) at sql_parse.cc:916
#29 0x082a5827 in handle_
#30 0x00821919 in start_thread () from /lib/libpthread
#31 0x0076acce in clone () from /lib/libc.so.6
explain:
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 3
1 SIMPLE t3 ref e e 3 test.t2.d 1 Using index
1 SIMPLE t4 ALL NULL NULL NULL NULL 17 Using join buffer (flat, BNL join)
1 SIMPLE t1 ALL NULL NULL NULL NULL 20 Using join buffer (flat, BNL join)
1 SIMPLE t5 ALL NULL NULL NULL NULL 20 Using join buffer (flat, BNL join)
minimal optimizer switch: derived_merge=on;
full optimizer_switch: index_merge=
bzr version-info
revision-id: <email address hidden>
date: 2011-10-14 03:56:41 -0700
build-date: 2011-10-14 19:00:28 +0300
revno: 3235
branch-nick: maria-5.3
test case:
CREATE TABLE t1 ( d varchar(1) NOT NULL) ;
INSERT INTO t1 VALUES ('j'),(
CREATE TABLE t2 ( h time NOT NULL, d varchar(1) NOT NULL) ;
INSERT INTO t2 VALUES ('05:03:
CREATE TABLE t3 ( b int NOT NULL, e varchar(1) NOT NULL, d varchar(1) NOT NULL, KEY (e,b)) ;
INSERT INTO t3 VALUES (4,'x',
CREATE TABLE t4 ( b int NOT NULL, e varchar(1) NOT NULL) ;
INSERT INTO t4 VALUES (8,'m')
CREATE TABLE t5 ( a int NOT NULL, c int NOT NULL, b int NOT NULL, f date NOT NULL, g date NOT NULL, h time NOT NULL, j time NOT NULL, k datetime NOT NULL, l datetime NOT NULL, e varchar(1) NOT NULL, d varchar(1) NOT NULL) ;
INSERT INTO t5 VALUES (1,4,0,
SET SESSION optimizer_
SELECT t2.d
FROM t1, t2 , (
SELECT t3.*
FROM t3, t4, t5
) AS alias3
WHERE alias3.e = t2.d ;
| Changed in maria: | |
| milestone: | none → 5.3 |
| assignee: | nobody → Igor Babaev (igorb-seattle) |
| Changed in maria: | |
| importance: | Undecided → Critical |
| status: | New → Confirmed |
| Changed in maria: | |
| status: | Confirmed → In Progress |
| Changed in maria: | |
| status: | In Progress → Fix Committed |
| Changed in maria: | |
| status: | Fix Committed → Fix Released |
