summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPavan Deolasee2016-01-25 14:09:41 +0000
committerPavan Deolasee2016-10-18 09:47:51 +0000
commit65689f5905e06c954365a4f5e072f276794386bf (patch)
tree79142750e56ce4e823d690d799c0cec2ef9f1a84
parentd238a9a2992900bb2f0e63807390d5abae0d6b3d (diff)
Change expected output for select_views test case.
-rw-r--r--src/test/regress/expected/select_views_2.out51
1 files changed, 44 insertions, 7 deletions
diff --git a/src/test/regress/expected/select_views_2.out b/src/test/regress/expected/select_views_2.out
index 5e747bb250..96b5fbfb06 100644
--- a/src/test/regress/expected/select_views_2.out
+++ b/src/test/regress/expected/select_views_2.out
@@ -1260,7 +1260,6 @@ CREATE TABLE customer (
tel text,
passwd text
);
-NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "customer_pkey" for table "customer"
CREATE TABLE credit_card (
cid int references customer(cid),
cnum text,
@@ -1281,7 +1280,7 @@ INSERT INTO credit_card
(103, '9801-2345-6789-0123', 2000);
INSERT INTO credit_usage
VALUES (101, '2011-09-15', 120),
- (101, '2011-10-05', 90),
+ (101, '2011-10-05', 90),
(101, '2011-10-18', 110),
(101, '2011-10-21', 200),
(101, '2011-11-10', 80),
@@ -1348,6 +1347,44 @@ EXPLAIN (COSTS OFF) SELECT * FROM my_property_secure WHERE f_leak(passwd);
(5 rows)
--
+-- scenario: qualifiers can be pushed down if they contain leaky functions,
+-- provided they aren't passed data from inside the view.
+--
+SELECT * FROM my_property_normal v
+ WHERE f_leak('passwd') AND f_leak(passwd);
+ cid | name | tel | passwd
+-----+---------------+------------------+-----------
+ 101 | regress_alice | +81-12-3456-7890 | passwd123
+(1 row)
+
+EXPLAIN (COSTS OFF) SELECT * FROM my_property_normal v
+ WHERE f_leak('passwd') AND f_leak(passwd);
+ QUERY PLAN
+---------------------------------------------------------------------------------------------------
+ Remote Subquery Scan on all (datanode_1,datanode_2)
+ -> Seq Scan on customer
+ Filter: (f_leak('passwd'::text) AND f_leak(passwd) AND (name = ("current_user"())::text))
+(3 rows)
+
+SELECT * FROM my_property_secure v
+ WHERE f_leak('passwd') AND f_leak(passwd);
+ cid | name | tel | passwd
+-----+---------------+------------------+-----------
+ 101 | regress_alice | +81-12-3456-7890 | passwd123
+(1 row)
+
+EXPLAIN (COSTS OFF) SELECT * FROM my_property_secure v
+ WHERE f_leak('passwd') AND f_leak(passwd);
+ QUERY PLAN
+--------------------------------------------------------------------------------------
+ Remote Subquery Scan on all (datanode_1,datanode_2)
+ -> Subquery Scan on v
+ Filter: f_leak(v.passwd)
+ -> Seq Scan on customer
+ Filter: (f_leak('passwd'::text) AND (name = ("current_user"())::text))
+(5 rows)
+
+--
-- scenario: if a qualifier references only one-side of a particular join-
-- tree, it shall be distributed to the most deep scan plan as
-- possible as we can.
@@ -1418,10 +1455,10 @@ EXPLAIN (COSTS OFF) SELECT * FROM my_credit_card_usage_normal
-> Subquery Scan on l
Filter: f_leak(l.cnum)
-> Hash Join
- Hash Cond: (r.cid = l.cid)
- -> Seq Scan on credit_card r
+ Hash Cond: (r_1.cid = l_1.cid)
+ -> Seq Scan on credit_card r_1
-> Hash
- -> Seq Scan on customer l
+ -> Seq Scan on customer l_1
Filter: (name = ("current_user"())::text)
(14 rows)
@@ -1447,8 +1484,8 @@ EXPLAIN (COSTS OFF) SELECT * FROM my_credit_card_usage_secure
Filter: ((ymd >= '10-01-2011'::date) AND (ymd < '11-01-2011'::date))
-> Materialize
-> Hash Join
- Hash Cond: (r.cid = l.cid)
- -> Seq Scan on credit_card r
+ Hash Cond: (r_1.cid = l.cid)
+ -> Seq Scan on credit_card r_1
-> Hash
-> Seq Scan on customer l
Filter: (name = ("current_user"())::text)