diff options
author | unknown <sanja@askmonty.org> | 2013-11-11 17:28:14 +0200 |
---|---|---|
committer | unknown <sanja@askmonty.org> | 2013-11-11 17:28:14 +0200 |
commit | c98a054fdeab9c2d3a637cf4fce57a2f9756dcc8 (patch) | |
tree | 7799ca0d2534b5ef7eedbca5db25c3c058674a38 /mysql-test/r/view.result | |
parent | c85db2c4943b644c34cc4c67a95cfb5e5f0a09a4 (diff) | |
download | mariadb-git-c98a054fdeab9c2d3a637cf4fce57a2f9756dcc8.tar.gz |
MDEV-5153: Server crashes in Item_ref::fix_fields on 2nd execution of PS with LEFT JOIN and MERGE view or SELECT SQ
1. Transformation of row IN subquery made the same as single value.
2. replace_where_subcondition() made working on several layers of OR/AND because it called on expression before fix_fields().
Diffstat (limited to 'mysql-test/r/view.result')
-rw-r--r-- | mysql-test/r/view.result | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result index e0323c305f5..c98d8dfd8a4 100644 --- a/mysql-test/r/view.result +++ b/mysql-test/r/view.result @@ -4709,6 +4709,37 @@ q 1 q q 1 q drop view v1; drop table t1,t2; +# +# MDEV-5153: Server crashes in Item_ref::fix_fields on 2nd execution +# of PS with LEFT JOIN and MERGE view or SELECT SQ +# +CREATE TABLE t1 (i1 INT, c1 VARCHAR(6)) ENGINE=MyISAM; +INSERT INTO t1 VALUES (1,'foo'),(2,'bar'); +CREATE TABLE t2 (c2 VARCHAR(6)) ENGINE=MyISAM; +INSERT INTO t2 VALUES ('foobar'),('qux'); +CREATE ALGORITHM=MERGE VIEW v1 AS SELECT * FROM t1 WHERE ( c1 ) IN ( SELECT c2 FROM t2 ) AND i1 <= 2 ; +PREPARE stmt FROM 'SELECT * FROM t1 LEFT JOIN v1 ON (v1.i1 = t1.i1)'; +EXECUTE stmt; +i1 c1 i1 c1 +1 foo NULL NULL +2 bar NULL NULL +EXECUTE stmt; +i1 c1 i1 c1 +1 foo NULL NULL +2 bar NULL NULL +drop view v1; +CREATE ALGORITHM=MERGE VIEW v1 AS SELECT * FROM t1 WHERE ( c1, c1 ) IN ( SELECT c2, c2 FROM t2 ) AND i1 <= 2 ; +EXECUTE stmt; +i1 c1 i1 c1 +1 foo NULL NULL +2 bar NULL NULL +EXECUTE stmt; +i1 c1 i1 c1 +1 foo NULL NULL +2 bar NULL NULL +deallocate prepare stmt; +drop view v1; +drop table t1,t2; # ----------------------------------------------------------------- # -- End of 5.3 tests. # ----------------------------------------------------------------- |