diff options
author | Igor Babaev <igor@askmonty.org> | 2016-09-14 01:06:45 -0700 |
---|---|---|
committer | Igor Babaev <igor@askmonty.org> | 2016-09-14 01:06:45 -0700 |
commit | c22d307afa1a6accbfe9857256cad01c1eacd677 (patch) | |
tree | 2a78540435691e50fc50fa1d625f30fea3197e28 /mysql-test/r/derived_cond_pushdown.result | |
parent | 61d46e0423c61ff2fd1eedd707924193006cdedd (diff) | |
download | mariadb-git-c22d307afa1a6accbfe9857256cad01c1eacd677.tar.gz |
Fixed bug mdev-10785.
The condition pushed into WHERE/HAVING of a materialized
view/derived table may differ for different executions of
the same prepared statement. That's why the should be
ANDed with the existing WHERE/HAVING conditions only after all
permanent transformations of these conditions has been
performed.
Diffstat (limited to 'mysql-test/r/derived_cond_pushdown.result')
-rw-r--r-- | mysql-test/r/derived_cond_pushdown.result | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/mysql-test/r/derived_cond_pushdown.result b/mysql-test/r/derived_cond_pushdown.result index 9401a035d55..91c6e629821 100644 --- a/mysql-test/r/derived_cond_pushdown.result +++ b/mysql-test/r/derived_cond_pushdown.result @@ -7016,3 +7016,19 @@ SELECT * FROM t1 WHERE 1 IN ( SELECT * FROM v ); i DROP VIEW v; DROP TABLE t1; +# +# MDEV-10785: second execution of a query with condition +# pushed into view +# +CREATE TABLE t1 (i int); +CREATE VIEW v1 AS SELECT i FROM t1 WHERE i < 5; +CREATE FUNCTION f (in1 int) RETURNS int RETURN in1; +CREATE VIEW v2 AS SELECT * FROM v1 GROUP BY i; +PREPARE stmt FROM "SELECT * FROM v2 WHERE f(0) <> 2"; +EXECUTE stmt; +i +EXECUTE stmt; +i +DROP FUNCTION f; +DROP VIEW v2,v1; +DROP TABLE t1; |