From: Pavan Deolasee Date: Mon, 25 Jan 2016 14:09:41 +0000 (+0530) Subject: Change expected output for select_views test case. X-Git-Tag: XL9_5_R1BETA1~61 X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=3cd85ad666f461601791458e415997a814cf19bd;p=postgres-xl.git Change expected output for select_views test case. --- 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), @@ -1347,6 +1346,44 @@ EXPLAIN (COSTS OFF) SELECT * FROM my_property_secure WHERE f_leak(passwd); Filter: (name = ("current_user"())::text) (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 @@ -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)