Change expected output for select_views test case.
authorPavan Deolasee <[email protected]>
Mon, 25 Jan 2016 14:09:41 +0000 (19:39 +0530)
committerPavan Deolasee <[email protected]>
Mon, 25 Jan 2016 14:09:41 +0000 (19:39 +0530)
src/test/regress/expected/select_views_2.out

index 5e747bb250f6c58d939ac5aafc3a61384491c38d..96b5fbfb060d1c71f949a327b7adc2b18e1199e1 100644 (file)
@@ -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)