Fix expected output for plpgsql test suite
authorTomas Vondra <[email protected]>
Sun, 8 Oct 2017 23:30:44 +0000 (01:30 +0200)
committerTomas Vondra <[email protected]>
Sun, 8 Oct 2017 23:31:42 +0000 (01:31 +0200)
Commit 7d55b3a318 accepted incorrect expected output for a number
of tests in this suite. The issue might have been initially masked
by existence of another .out file for this test.

We seem to be producing the correct output, so just use expected
output from upstream. Moreover, the table (INT4_TBL) is defined as
replicated, so we don't need the explicit ORDER BY clauses as the
ordering is stable anyway. So remove them, to make the the tests
a bit closer to upstream.

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

index dcbe8de32fb28dfe06b20a9d57b2c1891dd64a51..6d256f44b87ea3e59933c5102f94e21a6804e8be 100644 (file)
@@ -3415,10 +3415,15 @@ begin
   close c;
 end;
 $$ language plpgsql;
-select * from sc_test() order by 1;
- sc_test 
----------
-(0 rows)
+select * from sc_test();
+   sc_test   
+-------------
+ -2147483647
+  2147483647
+     -123456
+      123456
+           0
+(5 rows)
 
 create or replace function sc_test() returns setof integer as $$
 declare
@@ -3434,7 +3439,7 @@ begin
   close c;
 end;
 $$ language plpgsql;
-select * from sc_test() order by 1;  -- fails because of NO SCROLL specification
+select * from sc_test();  -- fails because of NO SCROLL specification
 ERROR:  cursor can only scan forward
 HINT:  Declare it with SCROLL option to enable backward scan.
 CONTEXT:  PL/pgSQL function sc_test() line 7 at FETCH
@@ -3452,17 +3457,22 @@ begin
   close c;
 end;
 $$ language plpgsql;
-select * from sc_test() order by 1;
- sc_test 
----------
-(0 rows)
+select * from sc_test();
+   sc_test   
+-------------
+ -2147483647
+  2147483647
+     -123456
+      123456
+           0
+(5 rows)
 
 create or replace function sc_test() returns setof integer as $$
 declare
   c refcursor;
   x integer;
 begin
-  open c scroll for execute 'select f1 from int4_tbl order by 1';
+  open c scroll for execute 'select f1 from int4_tbl';
   fetch last from c into x;
   while found loop
     return next x;
@@ -3472,16 +3482,19 @@ begin
 end;
 $$ language plpgsql;
 select * from sc_test();
- sc_test 
----------
-(0 rows)
+   sc_test   
+-------------
+ -2147483647
+     -123456
+           0
+(3 rows)
 
 create or replace function sc_test() returns setof integer as $$
 declare
   c refcursor;
   x integer;
 begin
-  open c scroll for execute 'select f1 from int4_tbl order by 1';
+  open c scroll for execute 'select f1 from int4_tbl';
   fetch last from c into x;
   while found loop
     return next x;
@@ -3492,9 +3505,11 @@ begin
 end;
 $$ language plpgsql;
 select * from sc_test();
- sc_test 
----------
-(0 rows)
+   sc_test   
+-------------
+ -2147483647
+      123456
+(2 rows)
 
 create or replace function sc_test() returns setof integer as $$
 declare
index 06a9d187bf926e9be88a3e8747e555db6bc9e3b6..e48090207a3882ac8ea3ac65f3832675988189ca 100644 (file)
@@ -2861,7 +2861,7 @@ begin
 end;
 $$ language plpgsql;
 
-select * from sc_test() order by 1;
+select * from sc_test();
 
 create or replace function sc_test() returns setof integer as $$
 declare
@@ -2878,7 +2878,7 @@ begin
 end;
 $$ language plpgsql;
 
-select * from sc_test() order by 1;  -- fails because of NO SCROLL specification
+select * from sc_test();  -- fails because of NO SCROLL specification
 
 create or replace function sc_test() returns setof integer as $$
 declare
@@ -2895,14 +2895,14 @@ begin
 end;
 $$ language plpgsql;
 
-select * from sc_test() order by 1;
+select * from sc_test();
 
 create or replace function sc_test() returns setof integer as $$
 declare
   c refcursor;
   x integer;
 begin
-  open c scroll for execute 'select f1 from int4_tbl order by 1';
+  open c scroll for execute 'select f1 from int4_tbl';
   fetch last from c into x;
   while found loop
     return next x;
@@ -2919,7 +2919,7 @@ declare
   c refcursor;
   x integer;
 begin
-  open c scroll for execute 'select f1 from int4_tbl order by 1';
+  open c scroll for execute 'select f1 from int4_tbl';
   fetch last from c into x;
   while found loop
     return next x;