Commit 4bcd78e8 authored by Sergey Petrunya's avatar Sergey Petrunya

Fix after previous cset: update test results

parent f740845e
......@@ -760,6 +760,23 @@ LEFT JOIN t2 AS SQ4_alias3 ON SQ4_alias3.f10
GROUP BY field2;
field2
drop table t1, t2, t3;
#
# BUG#849763: Wrong result with second execution of prepared statement with semijoin + view
#
CREATE TABLE t1 ( c varchar(1)) engine=innodb;
INSERT INTO t1 VALUES ('r');
CREATE TABLE t2 ( a integer, b varchar(1), c varchar(1)) engine=innodb;
INSERT INTO t2 VALUES (1,'r','r');
CREATE OR REPLACE VIEW v1 AS SELECT * FROM t1;
PREPARE st1 FROM 'SELECT * FROM t2 WHERE a = SOME (SELECT a FROM v1 WHERE v1.c = t2.c)';
EXECUTE st1;
a b c
1 r r
EXECUTE st1;
a b c
1 r r
DROP VIEW v1;
DROP TABLE t1, t2;
set optimizer_switch=@subselect_sj2_tmp;
set optimizer_switch=default;
select @@optimizer_switch like '%materialization=on%';
......
......@@ -2477,6 +2477,8 @@ void Item_in_subselect::fix_after_pullout(st_select_lex *new_parent, Item **ref)
{
left_expr->fix_after_pullout(new_parent, &left_expr);
Item_subselect::fix_after_pullout(new_parent, ref);
//psergey-todo: the above looks odd, why don't we 'aggregate' left_expr with
//the rest?
}
void Item_in_subselect::update_used_tables()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment