Add ORDER BY and accept expected output changes for the testcase 'interval'
authorPavan Deolasee <[email protected]>
Fri, 30 Jun 2017 10:10:21 +0000 (15:40 +0530)
committerPavan Deolasee <[email protected]>
Fri, 30 Jun 2017 10:10:21 +0000 (15:40 +0530)
An ORDER BY was necessary to get consistent results. Other than that, a Remote
Subplan node is added to the explain plan output.

src/test/regress/expected/interval.out
src/test/regress/sql/interval.sql

index 38d0c5b85e120c9f93576543227706e4f6d1f34b..a921b5d0c79259534c38a27292f54fc3737022bb 100644 (file)
@@ -254,10 +254,11 @@ CREATE INDEX ON INTERVAL_TBL_OF USING btree (f1);
 SET enable_seqscan TO false;
 EXPLAIN (COSTS OFF)
 SELECT f1 FROM INTERVAL_TBL_OF r1 ORDER BY f1;
-                             QUERY PLAN                             
---------------------------------------------------------------------
- Index Only Scan using interval_tbl_of_f1_idx on interval_tbl_of r1
-(1 row)
+                                QUERY PLAN                                
+--------------------------------------------------------------------------
+ Remote Subquery Scan on all (datanode_1,datanode_2)
+   ->  Index Only Scan using interval_tbl_of_f1_idx on interval_tbl_of r1
+(2 rows)
 
 SELECT f1 FROM INTERVAL_TBL_OF r1 ORDER BY f1;
                     f1                     
@@ -749,19 +750,19 @@ SELECT interval '1 2:03:04.5678' minute to second(2);
 -- test casting to restricted precision (bug #14479)
 SELECT f1, f1::INTERVAL DAY TO MINUTE AS "minutes",
   (f1 + INTERVAL '1 month')::INTERVAL MONTH::INTERVAL YEAR AS "years"
-  FROM interval_tbl;
+  FROM interval_tbl ORDER BY f1;
        f1        |     minutes     |  years   
 -----------------+-----------------+----------
+ -00:00:14       | 00:00:00        | 00:00:00
  00:01:00        | 00:01:00        | 00:00:00
  05:00:00        | 05:00:00        | 00:00:00
+ 1 day 02:03:04  | 1 day 02:03:00  | 00:00:00
  10 days         | 10 days         | 00:00:00
- 34 years        | 34 years        | 34 years
  3 mons          | 3 mons          | 00:00:00
- -00:00:14       | 00:00:00        | 00:00:00
- 1 day 02:03:04  | 1 day 02:03:00  | 00:00:00
- 6 years         | 6 years         | 6 years
  5 mons          | 5 mons          | 00:00:00
  5 mons 12:00:00 | 5 mons 12:00:00 | 00:00:00
+ 6 years         | 6 years         | 6 years
+ 34 years        | 34 years        | 34 years
 (10 rows)
 
 -- test inputting and outputting SQL standard interval literals
index 501087f39fd5aa590494c45c3855faeb131f16ef..688b2ef982f90d9bf706ba29838b59a1d2813e27 100644 (file)
@@ -226,7 +226,7 @@ SELECT interval '1 2:03:04.5678' minute to second(2);
 -- test casting to restricted precision (bug #14479)
 SELECT f1, f1::INTERVAL DAY TO MINUTE AS "minutes",
   (f1 + INTERVAL '1 month')::INTERVAL MONTH::INTERVAL YEAR AS "years"
-  FROM interval_tbl;
+  FROM interval_tbl ORDER BY f1;
 
 -- test inputting and outputting SQL standard interval literals
 SET IntervalStyle TO sql_standard;