Assertion `0' failed in replace_where_subcondition with semijoin subquery in HAVING
| Affects | Status | Importance | Assigned to | Milestone | |
|---|---|---|---|---|---|
| MariaDB |
Fix Released
|
High
|
Sergey Petrunia | ||
Bug Description
The following query:
SELECT *
FROM t3
WHERE (t3.a) IN (
SELECT t1.d
FROM t1
HAVING ( 4 ) IN (
)
);
asserts as follows:
mysqld: opt_subselect.
#8 0x006b0d98 in __assert_fail () from /lib/libc.so.6
#9 0x083db52b in replace_
at opt_subselect.
#10 0x083db09c in convert_
#11 0x08319680 in JOIN::optimize (this=0xae52cdd8) at sql_select.cc:897
#12 0x081b5e0c in st_select_
#13 0x083e2867 in JOIN::optimize_
#14 0x0831bd23 in JOIN::optimize (this=0xae527b50) at sql_select.cc:1622
#15 0x0831ff2b in mysql_select (thd=0xb1f06b8, rref_pointer_
order=0x0, group=0x0, having=0x0, proc_param=0x0, select_
at sql_select.cc:2887
#16 0x08317da3 in handle_select (thd=0xb1f06b8, lex=0xb1f1dc0, result=0xae513de8, setup_tables_
#17 0x082b3171 in execute_
#18 0x082a9f75 in mysql_execute_
#19 0x082b57ad in mysql_parse (thd=0xb1f06b8,
rawbuf=
found_
#20 0x082a7bf2 in dispatch_command (command=COM_QUERY, thd=0xb1f06b8,
packet=
at sql_parse.cc:1211
#21 0x082a704d in do_command (thd=0xb1f06b8) at sql_parse.cc:906
#22 0x082a40b5 in handle_
#23 0x00821919 in start_thread () from /lib/libpthread
#24 0x0076acce in clone () from /lib/libc.so.6
explain also asserts.
minimal optimizer switch:semijoin=ON
full optimizer_switch:
index_
bzr version-info
revision-id: <email address hidden>
date: 2011-08-23 15:51:47 +0300
build-date: 2011-08-26 12:02:03 +0300
revno: 3166
branch-nick: maria-5.3
test case:
CREATE TABLE t1 ( d int );
INSERT INTO t1 VALUES (2),(2)
CREATE TABLE t2 ( b int );
INSERT INTO t2 VALUES (4),(3),(3);
CREATE TABLE t3 ( a int );
SET SESSION optimizer_
SELECT *
FROM t3
WHERE (t3.a) IN (
SELECT t1.d
FROM t1
HAVING ( 4 ) IN (
)
);
| Changed in maria: | |
| milestone: | none → 5.3 |
| assignee: | nobody → Sergey Petrunia (sergefp) |
| Changed in maria: | |
| importance: | Undecided → High |
| summary: |
- Assertion `0' failed in replace_where_subcondition with semijoin , - nested subqueries + Assertion `0' failed in replace_where_subcondition with semijoin + subquery in HAVING |
| Changed in maria: | |
| status: | New → Fix Committed |
| Changed in maria: | |
| status: | Fix Committed → Fix Released |
