Crash in mark_as_null_row with materialization+semijoin, aggregate functions, constant MyISAM or Aria table
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MariaDB |
Invalid
|
Undecided
|
Sergey Petrunia |
Bug Description
#3 0x083e4684 in handle_fatal_signal (sig=11)
at /home/elenst/
#4 <signal handler called>
#5 0x082bbf9e in mark_as_null_row (table=0x9730ee0)
at /home/elenst/
#6 0x082a0077 in return_zero_rows (join=0x97222b0, result=0x97101b0, tables=...,
fields=..., send_row=true, select_
info=0x89075cc "no matching row in const table", having=0x0)
at /home/elenst/
#7 0x0828c028 in JOIN::exec (this=0x97222b0)
at /home/elenst/
#8 0x0828e69c in mysql_select (thd=0x965f8e0, rref_pointer_
tables=
group=0x0, having=0x0, proc_param=0x0, select_
unit=0x9660e80, select_
#9 0x082864ba in handle_select (thd=0x965f8e0, lex=0x9660e1c, result=0x97101b0,
setup_
#10 0x082626cd in execute_
at /home/elenst/
#11 0x0825b674 in mysql_execute_
at /home/elenst/
#12 0x08264ca8 in mysql_parse (thd=0x965f8e0,
rawbuf=
length=60, parser_
#13 0x0825913e in dispatch_command (command=COM_QUERY, thd=0x965f8e0,
packet=
packet_
#14 0x08258603 in do_command (thd=0x965f8e0) at /home/elenst/
#15 0x08341236 in do_handle_
at /home/elenst/
#16 0x08340d84 in handle_
at /home/elenst/
#17 0x085621e9 in pfs_spawn_thread (arg=0x974e318)
at /home/elenst/
#18 0xb7883b25 in start_thread () from /lib/libpthread
bzr version-info
revision-id: <email address hidden>
date: 2012-01-20 22:32:31 +0100
build-date: 2012-01-22 08:43:43 +0400
revno: 3228
branch-nick: maria-5.5
Could not reproduce on MariaDB-5.3 or MySQL-5.5.20.
Minimal optimizer_switch: materialization
Full optimizer_switch: index_merge=
EXPLAIN EXTENDED SELECT MAX(a) FROM t1
WHERE a IN ( SELECT MAX(b) FROM t2 );
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
2 MATERIALIZED t2 ALL NULL NULL NULL NULL 2 100.00
Warnings:
Note 1003 select max(NULL) AS `MAX(a)` from <materialize> (select max(`test`
SELECT MAX(a) FROM t1
WHERE a IN ( SELECT MAX(b) FROM t2 );
Test case:
SET optimizer_switch = 'materializatio
# The first table has to be MyISAM or Aria,
# but not InnoDB
CREATE TABLE t1 ( a INT ) ENGINE=MyISAM;
CREATE TABLE t2 ( b INT ) ENGINE=MyISAM;
INSERT INTO t2 VALUES (1),(2);
SELECT MAX(a) FROM t1
WHERE a IN ( SELECT MAX(b) FROM t2 );
Also filed as JIRA issue MDEV-113