1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-07 00:04:31 +03:00

Fixed bug mdev-10783.

Do not push conditions into materialized views/derived tables
marked with the flag 'fill_me'.
This commit is contained in:
Igor Babaev
2016-09-13 11:58:35 -07:00
parent 54b81ac57f
commit 08ba474174
3 changed files with 22 additions and 1 deletions

View File

@@ -7007,3 +7007,12 @@ WHERE f = 1;
f
1
DROP TABLE t1;
#
# MDEV-10783: pushdown into constant view
#
CREATE TABLE t1 (i int) ENGINE=MyISAM;
CREATE VIEW v AS SELECT 5;
SELECT * FROM t1 WHERE 1 IN ( SELECT * FROM v );
i
DROP VIEW v;
DROP TABLE t1;

View File

@@ -898,5 +898,13 @@ SELECT *
WHERE f = 1;
DROP TABLE t1;
--echo #
--echo # MDEV-10783: pushdown into constant view
--echo #
CREATE TABLE t1 (i int) ENGINE=MyISAM;
CREATE VIEW v AS SELECT 5;
SELECT * FROM t1 WHERE 1 IN ( SELECT * FROM v );
DROP VIEW v;
DROP TABLE t1;

View File

@@ -1144,6 +1144,10 @@ bool pushdown_cond_for_derived(THD *thd, Item *cond, TABLE_LIST *derived)
if (!any_select_allows_cond_pushdown)
return false;
/* Do not push conditions into constant derived */
if (derived->fill_me)
return false;
/* Do not push conditions into recursive with tables */
if (derived->is_recursive_with_table())
return false;