Crash in JOIN::optimize with variables and nested derived tables in maria-5.3
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MariaDB |
Fix Released
|
Critical
|
Igor Babaev |
Bug Description
Not repeatable with maria-5.2. Does not require any tables to run.
test case:
SELECT * FROM ( SELECT * FROM ( SELECT @b ) AS a1 ) AS a2;
explain:
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY <derived2> ALL NULL NULL NULL NULL 2
2 DERIVED <derived3> ALL NULL NULL NULL NULL 2
3 DERIVED NULL NULL NULL NULL NULL NULL NULL No tables used
backtrace:
#2 0x0000000000691b54 in handle_segfault (sig=11) at mysqld.cc:2805
#3 <signal handler called>
#4 0x000000000074b5b9 in JOIN::optimize (this=0x0) at sql_select.cc:868
#5 0x00000000008a0b63 in mysql_derived_
#6 0x00000000008a1a74 in mysql_handle_
#7 0x000000000070e4c5 in TABLE_LIST:
#8 0x000000000057a833 in st_select_
#9 0x000000000074b681 in JOIN::optimize (this=0xe9a4e10) at sql_select.cc:878
#10 0x00000000008a0b63 in mysql_derived_
#11 0x00000000008a1a74 in mysql_handle_
#12 0x000000000070e4c5 in TABLE_LIST:
#13 0x000000000057a833 in st_select_
#14 0x000000000074b681 in JOIN::optimize (this=0xe997a10) at sql_select.cc:878
#15 0x000000000074feb7 in mysql_select (thd=0xe8ea108, rref_pointer_
order=0x0, group=0x0, having=0x0, proc_param=0x0, select_
at sql_select.cc:2877
#16 0x0000000000756376 in handle_select (thd=0xe8ea108, lex=0xe8ec510, result=0xe971b90, setup_tables_
#17 0x00000000006a3046 in execute_
#18 0x00000000006a4d24 in mysql_execute_
#19 0x00000000006adabd in mysql_parse (thd=0xe8ea108, rawbuf=0xe96fd40 "SELECT * FROM ( SELECT * FROM ( SELECT @b ) AS a1 ) AS a2", length=57,
found_
#20 0x00000000006ae955 in dispatch_command (command=COM_QUERY, thd=0xe8ea108, packet=0xe9669c9 "SELECT * FROM ( SELECT * FROM ( SELECT @b ) AS a1 ) AS a2",
packet_
#21 0x00000000006aff63 in do_command (thd=0xe8ea108) at sql_parse.cc:906
#22 0x000000000069a903 in handle_
#23 0x00000033b600673d in start_thread () from /lib64/
#24 0x00000033b58d40cd in clone () from /lib64/libc.so.6
bzr version-info
revision-id: <email address hidden>
date: 2011-08-01 11:05:30 +0200
build-date: 2011-08-02 12:44:39 +0300
revno: 3138
branch-nick: maria-5.3
Changed in maria: | |
importance: | Undecided → Critical |
assignee: | nobody → Igor Babaev (igorb-seattle) |
milestone: | none → 5.3 |
summary: |
- Crash in JOIN::optimize with variables in maria-5.3 + Crash in JOIN::optimize with variables and nested derived tables in + maria-5.3 |
Changed in maria: | |
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 |
Original query from user:
SELECT * FROM (
SELECT @rn := if( @lc = l.l_contentid, @rn +1, 0 ) AS rnum, @lc := l_contentid, l.*
FROM vb3_vbseo_likes l, (SELECT @rn :=0, @lc :=0) r
WHERE l_ctype = 1 AND l_cgroup =39820 AND l_contentid IN (289195,289196 )
ORDER BY l_contentid;