Assertion `0' failed in st_select_lex_unit::optimize with view , UNION and prepared statement
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MariaDB |
Fix Released
|
High
|
Oleksandr "Sanja" Byelkin |
Bug Description
mysqld: sql_union.cc:538: bool st_select_
backtrace:
#8 0x006b0d98 in __assert_fail () from /lib/libc.so.6
#9 0x0846dbcc in st_select_
#10 0x0846deda in st_select_
#11 0x0824c419 in subselect_
#12 0x08246003 in Item_subselect:
#13 0x082464aa in Item_in_
#14 0x08247ffe in Item_in_
#15 0x081e1e04 in Item::val_
#16 0x0820e21e in Item_in_
#17 0x081ca06c in Item::val_bool (this=0xae62cdd8) at item.cc:197
#18 0x0820adcc in Item_func_
#19 0x08251d08 in Item_func_
#20 0x081ca06c in Item::val_bool (this=0xae6141a0) at item.cc:197
#21 0x082164bc in Item_cond_
#22 0x0833d066 in evaluate_
#23 0x0833cc34 in sub_select (join=0xae635280, join_tab=
#24 0x0833d2d1 in evaluate_
#25 0x0833cd7c in sub_select (join=0xae635280, join_tab=
#26 0x0833c487 in do_select (join=0xae635280, fields=0xae629698, table=0x0, procedure=0x0) at sql_select.cc:14763
#27 0x08320e5d in JOIN::exec (this=0xae635280) at sql_select.cc:2679
#28 0x0832168a in mysql_select (thd=0x950a6b8, rref_pointer_
order=0x0, group=0x0, having=0x0, proc_param=0x0, select_
at sql_select.cc:2900
#29 0x0831945b in handle_select (thd=0x950a6b8, lex=0xae6292c8, result=0xae62b738, setup_tables_
#30 0x082b41d9 in execute_
#31 0x082aafea in mysql_execute_
#32 0x08363c48 in Prepared_
#33 0x08363163 in Prepared_
at sql_prepare.cc:3416
#34 0x08361a32 in mysql_sql_
#35 0x082ab013 in mysql_execute_
#36 0x082b6808 in mysql_parse (thd=0x950a6b8, rawbuf=0xae612a10 "EXECUTE st1", length=11, found_semicolon
#37 0x082a8c30 in dispatch_command (command=COM_QUERY, thd=0x950a6b8, packet=0x9563549 "", packet_length=11) at sql_parse.cc:1221
#38 0x082a808b in do_command (thd=0x950a6b8) at sql_parse.cc:916
#39 0x082a5015 in handle_
#40 0x00821919 in start_thread () from /lib/libpthread
#41 0x0076acce in clone () from /lib/libc.so.6
explain:
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using where
1 PRIMARY t2 ALL NULL NULL NULL NULL 1 Using where
2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL No tables used
3 DEPENDENT UNION NULL NULL NULL NULL NULL NULL NULL No tables used
NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL
full optimizer switch:
index_merge=
repeatable in maria-5.3 . Not repeatable in maria-5.2
bzr version-info:
revision-id: <email address hidden>
date: 2011-09-24 14:45:49 +0200
build-date: 2011-09-26 08:01:19 +0300
revno: 3194
branch-nick: maria-5.3
test case:
CREATE TABLE t1 ( f1 int NOT NULL, f4 varchar(1) NOT NULL) ;
INSERT INTO t1 VALUES (6,'d'),(7,'y');
CREATE TABLE t2 ( f1 int NOT NULL, f2 int NOT NULL) ;
INSERT INTO t2 VALUES (10,7);
CREATE VIEW v2 AS SELECT * FROM t2;
PREPARE st1 FROM "
SELECT *
FROM t1
LEFT JOIN v2 ON ( v2.f2 = t1.f1 )
WHERE v2.f1 NOT IN (
) AND t1.f4 != 2
";
EXECUTE st1;
Changed in maria: | |
milestone: | none → 5.3 |
Changed in maria: | |
importance: | Undecided → High |
Changed in maria: | |
status: | New → Confirmed |
Changed in maria: | |
assignee: | nobody → Oleksandr "Sanja" Byelkin (sanja-byelkin) |
Changed in maria: | |
status: | In Progress → Fix Committed |
Changed in maria: | |
status: | Fix Committed → Fix Released |
There other problem here: When we create the union temporary table it is not distinct then it turn to be distinct some how...