summaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorAmit Khandekar2012-04-20 03:36:30 +0000
committerAmit Khandekar2012-04-20 03:36:30 +0000
commita6123bce9ad2b1266f149cf9b516cc40fb8e7047 (patch)
tree5ae7c70dfac21e8a487d023fe54c5c5f5e1c9cc8 /src/test
parentc8039d89b42944f722d76c858b790e18201dfb98 (diff)
Fixed regression expected output file rangefuncs_1.out so as to make the
rangefuncs.sql test pass. The diffs were due to "RETURNING not supported" errors. Checked that test scenarios were specifically testing the combination of range functions that return rows returned by INSERT..RETURNING. Since we don't support yet RETURNING yet, there isn't much we can do other than just adjust the expected out file to accommodate these diffs. No other feature testing is masked because of these errors.
Diffstat (limited to 'src/test')
-rw-r--r--src/test/regress/expected/rangefuncs_1.out178
1 files changed, 43 insertions, 135 deletions
diff --git a/src/test/regress/expected/rangefuncs_1.out b/src/test/regress/expected/rangefuncs_1.out
index 5e0d87c17e..5f8324f92a 100644
--- a/src/test/regress/expected/rangefuncs_1.out
+++ b/src/test/regress/expected/rangefuncs_1.out
@@ -588,95 +588,51 @@ create function insert_tt(text) returns int as
$$ insert into tt(data) values($1) returning f1 $$
language sql;
select insert_tt('foo');
- insert_tt
------------
- 1
-(1 row)
-
+ERROR: RETURNING clause not yet supported
+CONTEXT: SQL function "insert_tt" during startup
select insert_tt('bar');
- insert_tt
------------
- 2
-(1 row)
-
+ERROR: RETURNING clause not yet supported
+CONTEXT: SQL function "insert_tt" during startup
select * from tt order by 1, 2;
f1 | data
----+------
- 1 | foo
- 2 | bar
-(2 rows)
+(0 rows)
-- insert will execute to completion even if function needs just 1 row
create or replace function insert_tt(text) returns int as
$$ insert into tt(data) values($1),($1||$1) returning f1 $$
language sql;
select insert_tt('fool');
- insert_tt
------------
- 3
-(1 row)
-
+ERROR: RETURNING clause not yet supported
+CONTEXT: SQL function "insert_tt" during startup
select * from tt order by 1, 2;
- f1 | data
-----+----------
- 1 | foo
- 2 | bar
- 3 | fool
- 4 | foolfool
-(4 rows)
+ f1 | data
+----+------
+(0 rows)
-- setof does what's expected
create or replace function insert_tt2(text,text) returns setof int as
$$ insert into tt(data) values($1),($2) returning f1 $$
language sql;
select insert_tt2('foolish','barrish');
- insert_tt2
-------------
- 5
- 6
-(2 rows)
-
+ERROR: RETURNING clause not yet supported
+CONTEXT: SQL function "insert_tt2" during startup
select * from insert_tt2('baz','quux') order by 1;
- insert_tt2
-------------
- 7
- 8
-(2 rows)
-
+ERROR: RETURNING clause not yet supported
+CONTEXT: SQL function "insert_tt2" during startup
select * from tt order by 1, 2;
- f1 | data
-----+----------
- 1 | foo
- 2 | bar
- 3 | fool
- 4 | foolfool
- 5 | foolish
- 6 | barrish
- 7 | baz
- 8 | quux
-(8 rows)
+ f1 | data
+----+------
+(0 rows)
-- limit doesn't prevent execution to completion
select insert_tt2('foolish','barrish') limit 1;
- insert_tt2
-------------
- 9
-(1 row)
-
+ERROR: RETURNING clause not yet supported
+CONTEXT: SQL function "insert_tt2" during startup
select * from tt order by 1, 2;
- f1 | data
-----+----------
- 1 | foo
- 2 | bar
- 3 | fool
- 4 | foolfool
- 5 | foolish
- 6 | barrish
- 7 | baz
- 8 | quux
- 9 | foolish
- 10 | barrish
-(10 rows)
+ f1 | data
+----+------
+(0 rows)
-- triggers will fire, too
create function noticetrigger() returns trigger as $$
@@ -689,65 +645,31 @@ execute procedure noticetrigger();
ERROR: Postgres-XC does not support TRIGGER yet
DETAIL: The feature is not currently supported
select insert_tt2('foolme','barme') limit 1;
- insert_tt2
-------------
- 11
-(1 row)
-
+ERROR: RETURNING clause not yet supported
+CONTEXT: SQL function "insert_tt2" during startup
select * from tt order by 1, 2;
- f1 | data
-----+----------
- 1 | foo
- 2 | bar
- 3 | fool
- 4 | foolfool
- 5 | foolish
- 6 | barrish
- 7 | baz
- 8 | quux
- 9 | foolish
- 10 | barrish
- 11 | foolme
- 12 | barme
-(12 rows)
+ f1 | data
+----+------
+(0 rows)
-- and rules work
create temp table tt_log(f1 int, data text);
create rule insert_tt_rule as on insert to tt do also
insert into tt_log values(new.*);
select insert_tt2('foollog','barlog') limit 1;
- insert_tt2
-------------
- 13
-(1 row)
-
+ERROR: RETURNING clause not yet supported
+CONTEXT: SQL function "insert_tt2" during startup
select * from tt order by 1, 2;
- f1 | data
-----+----------
- 1 | foo
- 2 | bar
- 3 | fool
- 4 | foolfool
- 5 | foolish
- 6 | barrish
- 7 | baz
- 8 | quux
- 9 | foolish
- 10 | barrish
- 11 | foolme
- 12 | barme
- 13 | foollog
- 14 | barlog
-(14 rows)
+ f1 | data
+----+------
+(0 rows)
-- note that nextval() gets executed a second time in the rule expansion,
-- which is expected.
select * from tt_log order by 1, 2;
- f1 | data
-----+---------
- 15 | foollog
- 16 | barlog
-(2 rows)
+ f1 | data
+----+------
+(0 rows)
-- test case for a whole-row-variable bug
create function foo1(n integer, out a text, out b text)
@@ -798,17 +720,11 @@ create function testfoo() returns record as $$
insert into foo values (1,2) returning *;
$$ language sql;
select testfoo();
- testfoo
----------
- (1,2)
-(1 row)
-
+ERROR: RETURNING clause not yet supported
+CONTEXT: SQL function "testfoo" during startup
select * from testfoo() as t(f1 int8,f2 int8);
- f1 | f2
-----+----
- 1 | 2
-(1 row)
-
+ERROR: RETURNING clause not yet supported
+CONTEXT: SQL function "testfoo" during startup
select * from testfoo(); -- fail
ERROR: a column definition list is required for functions returning "record"
LINE 1: select * from testfoo();
@@ -818,19 +734,11 @@ create function testfoo() returns setof record as $$
insert into foo values (1,2), (3,4) returning *;
$$ language sql;
select testfoo();
- testfoo
----------
- (1,2)
- (3,4)
-(2 rows)
-
+ERROR: RETURNING clause not yet supported
+CONTEXT: SQL function "testfoo" during startup
select * from testfoo() as t(f1 int8,f2 int8) order by 1, 2;
- f1 | f2
-----+----
- 1 | 2
- 3 | 4
-(2 rows)
-
+ERROR: RETURNING clause not yet supported
+CONTEXT: SQL function "testfoo" during startup
select * from testfoo(); -- fail
ERROR: a column definition list is required for functions returning "record"
LINE 1: select * from testfoo();