diff options
author | Igor Babaev <igor@askmonty.org> | 2011-08-11 12:11:04 -0700 |
---|---|---|
committer | Igor Babaev <igor@askmonty.org> | 2011-08-11 12:11:04 -0700 |
commit | 4ddea0cb93dc5a7dcf6087b9fc9de4f0e9dfa840 (patch) | |
tree | 509708a2912a813c19ea9500ea1c23b5484a15db /mysql-test/t/derived_view.test | |
parent | 209682577fec6f8e0ec5186e3a8b0d6814236846 (diff) | |
download | mariadb-git-4ddea0cb93dc5a7dcf6087b9fc9de4f0e9dfa840.tar.gz |
Fixed LP bug #823826.
The method Item_func_isnull::update_used_tables() erroneously did not
update cached values stored in the fields used_tables_cache and
const_item_cache of the Item_func_isnull objects. As a result the
Item_func_isnull::used_tables() returned wrong bitmaps and, as a
consequence, push-down predicates could be attached to wrong tables.
Diffstat (limited to 'mysql-test/t/derived_view.test')
-rw-r--r-- | mysql-test/t/derived_view.test | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/mysql-test/t/derived_view.test b/mysql-test/t/derived_view.test index 48df49226a4..375a63e47e0 100644 --- a/mysql-test/t/derived_view.test +++ b/mysql-test/t/derived_view.test @@ -735,7 +735,30 @@ set optimizer_switch='derived_merge=off'; EXPLAIN SELECT * FROM (SELECT * FROM (SELECT @b) AS t) AS s; SELECT * FROM (SELECT * FROM (SELECT @b) AS t) AS s; -set optimizer_switch=@exit_optimizer_switch; +set optimizer_switch='derived_merge=on'; + +--echo # +--echo # LP bug #823826: view over join + IS NULL in WHERE +--echo # + +CREATE TABLE t1 (a int) ; +INSERT INTO t1 VALUES (1), (1); + +CREATE TABLE t2 (b int) ; +INSERT INTO t2 VALUES (9), (NULL), (7); + +CREATE VIEW v1 AS SELECT * FROM t1,t2; + +EXPLAIN +SELECT * FROM (SELECT * FROM t1,t2) t WHERE b IS NULL; +SELECT * FROM (SELECT * FROM t1,t2) t WHERE b IS NULL; + +EXPLAIN +SELECT * FROM v1 WHERE b IS NULL; +SELECT * FROM v1 WHERE b IS NULL; + +DROP VIEW v1; +DROP TABLE t1,t2; # The following command must be the last one the file set optimizer_switch=@exit_optimizer_switch; |