summaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorPeter Eisentraut2017-12-07 19:03:29 +0000
committerPeter Eisentraut2017-12-13 16:02:29 +0000
commit632b03da31cbbf4d32193d35031d301bd50d2679 (patch)
tree35ae69edf6e2e942d157c201c501ed06a9f0cbae /src/test
parent3d8874224ff25de3ca4f9da8ce3118391bd6609e (diff)
Start a separate test suite for plpgsql
The plpgsql.sql test file in the main regression tests is now by far the largest after numeric_big, making editing and managing the test cases very cumbersome. The other PLs have their own test suites split up into smaller files by topic. It would be nice to have that for plpgsql as well. So, to get that started, set up test infrastructure in src/pl/plpgsql/src/ and split out the recently added procedure test cases into a new file there. That file now mirrors the test cases added to the other PLs, making managing those matching tests a bit easier too. msvc build system changes with help from Michael Paquier
Diffstat (limited to 'src/test')
-rw-r--r--src/test/regress/expected/plpgsql.out41
-rw-r--r--src/test/regress/sql/plpgsql.sql49
2 files changed, 0 insertions, 90 deletions
diff --git a/src/test/regress/expected/plpgsql.out b/src/test/regress/expected/plpgsql.out
index 26f6e4394f..a2df411132 100644
--- a/src/test/regress/expected/plpgsql.out
+++ b/src/test/regress/expected/plpgsql.out
@@ -6067,44 +6067,3 @@ END; $$ LANGUAGE plpgsql;
ERROR: "x" is not a scalar variable
LINE 3: GET DIAGNOSTICS x = ROW_COUNT;
^
---
--- Procedures
---
-CREATE PROCEDURE test_proc1()
-LANGUAGE plpgsql
-AS $$
-BEGIN
- NULL;
-END;
-$$;
-CALL test_proc1();
--- error: can't return non-NULL
-CREATE PROCEDURE test_proc2()
-LANGUAGE plpgsql
-AS $$
-BEGIN
- RETURN 5;
-END;
-$$;
-CALL test_proc2();
-ERROR: cannot return a value from a procedure
-CONTEXT: PL/pgSQL function test_proc2() while casting return value to function's return type
-CREATE TABLE proc_test1 (a int);
-CREATE PROCEDURE test_proc3(x int)
-LANGUAGE plpgsql
-AS $$
-BEGIN
- INSERT INTO proc_test1 VALUES (x);
-END;
-$$;
-CALL test_proc3(55);
-SELECT * FROM proc_test1;
- a
-----
- 55
-(1 row)
-
-DROP PROCEDURE test_proc1;
-DROP PROCEDURE test_proc2;
-DROP PROCEDURE test_proc3;
-DROP TABLE proc_test1;
diff --git a/src/test/regress/sql/plpgsql.sql b/src/test/regress/sql/plpgsql.sql
index bb09b2d807..02c8913801 100644
--- a/src/test/regress/sql/plpgsql.sql
+++ b/src/test/regress/sql/plpgsql.sql
@@ -4843,52 +4843,3 @@ BEGIN
GET DIAGNOSTICS x = ROW_COUNT;
RETURN;
END; $$ LANGUAGE plpgsql;
-
-
---
--- Procedures
---
-
-CREATE PROCEDURE test_proc1()
-LANGUAGE plpgsql
-AS $$
-BEGIN
- NULL;
-END;
-$$;
-
-CALL test_proc1();
-
-
--- error: can't return non-NULL
-CREATE PROCEDURE test_proc2()
-LANGUAGE plpgsql
-AS $$
-BEGIN
- RETURN 5;
-END;
-$$;
-
-CALL test_proc2();
-
-
-CREATE TABLE proc_test1 (a int);
-
-CREATE PROCEDURE test_proc3(x int)
-LANGUAGE plpgsql
-AS $$
-BEGIN
- INSERT INTO proc_test1 VALUES (x);
-END;
-$$;
-
-CALL test_proc3(55);
-
-SELECT * FROM proc_test1;
-
-
-DROP PROCEDURE test_proc1;
-DROP PROCEDURE test_proc2;
-DROP PROCEDURE test_proc3;
-
-DROP TABLE proc_test1;