summaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorMichael P2011-07-27 06:37:09 +0000
committerMichael P2011-07-27 06:37:09 +0000
commit1e04470efe097fdaa61ebdff858d7394537d6f9e (patch)
tree00e26cbeae53383e1c5fe19e070a4bad2816be24 /src/test
parent93d93ce4984b3868d80a6eb6b58e67abf99ce50f (diff)
Support for TEMPORARY sequences
A temporary sequence is created only on local Coordinator. It doesn't need any interaction with GTM as it only lives during the session session is up. Sequence algorithm for nextval, currval and lastval has been changed in accordance to temporary sequences. Moreover, this commit cleans up a part of the code used by XC in utility.c to have a more effective lookup on objects when looking for the node types utility queries should be sent to. COMMENTS are changed to be executed only on Coordinators. Comments on temporary objects need some special handling but this is not targetted yet.
Diffstat (limited to 'src/test')
-rw-r--r--src/test/regress/expected/drop_if_exists_1.out91
-rw-r--r--src/test/regress/expected/plancache_1.out5
-rw-r--r--src/test/regress/expected/sequence_2.out12
3 files changed, 94 insertions, 14 deletions
diff --git a/src/test/regress/expected/drop_if_exists_1.out b/src/test/regress/expected/drop_if_exists_1.out
new file mode 100644
index 0000000000..93c0a555ef
--- /dev/null
+++ b/src/test/regress/expected/drop_if_exists_1.out
@@ -0,0 +1,91 @@
+--
+-- IF EXISTS tests
+--
+-- table (will be really dropped at the end)
+DROP TABLE test_exists;
+ERROR: table "test_exists" does not exist
+DROP TABLE IF EXISTS test_exists;
+NOTICE: table "test_exists" does not exist, skipping
+CREATE TABLE test_exists (a int, b text);
+-- view
+DROP VIEW test_view_exists;
+ERROR: view "test_view_exists" does not exist
+DROP VIEW IF EXISTS test_view_exists;
+NOTICE: view "test_view_exists" does not exist, skipping
+CREATE VIEW test_view_exists AS select * from test_exists;
+DROP VIEW IF EXISTS test_view_exists;
+DROP VIEW test_view_exists;
+ERROR: view "test_view_exists" does not exist
+-- index
+DROP INDEX test_index_exists;
+ERROR: index "test_index_exists" does not exist
+DROP INDEX IF EXISTS test_index_exists;
+NOTICE: index "test_index_exists" does not exist, skipping
+CREATE INDEX test_index_exists on test_exists(a);
+DROP INDEX IF EXISTS test_index_exists;
+DROP INDEX test_index_exists;
+ERROR: index "test_index_exists" does not exist
+-- sequence
+DROP SEQUENCE test_sequence_exists;
+ERROR: relation "test_sequence_exists" does not exist
+DROP SEQUENCE IF EXISTS test_sequence_exists;
+ERROR: relation "test_sequence_exists" does not exist
+CREATE SEQUENCE test_sequence_exists;
+DROP SEQUENCE IF EXISTS test_sequence_exists;
+DROP SEQUENCE test_sequence_exists;
+ERROR: relation "test_sequence_exists" does not exist
+-- schema
+DROP SCHEMA test_schema_exists;
+ERROR: schema "test_schema_exists" does not exist
+DROP SCHEMA IF EXISTS test_schema_exists;
+NOTICE: schema "test_schema_exists" does not exist, skipping
+CREATE SCHEMA test_schema_exists;
+DROP SCHEMA IF EXISTS test_schema_exists;
+DROP SCHEMA test_schema_exists;
+ERROR: schema "test_schema_exists" does not exist
+-- type
+DROP TYPE test_type_exists;
+ERROR: type "test_type_exists" does not exist
+DROP TYPE IF EXISTS test_type_exists;
+NOTICE: type "test_type_exists" does not exist, skipping
+CREATE type test_type_exists as (a int, b text);
+DROP TYPE IF EXISTS test_type_exists;
+DROP TYPE test_type_exists;
+ERROR: type "test_type_exists" does not exist
+-- domain
+DROP DOMAIN test_domain_exists;
+ERROR: type "test_domain_exists" does not exist
+DROP DOMAIN IF EXISTS test_domain_exists;
+NOTICE: type "test_domain_exists" does not exist, skipping
+CREATE domain test_domain_exists as int not null check (value > 0);
+DROP DOMAIN IF EXISTS test_domain_exists;
+DROP DOMAIN test_domain_exists;
+ERROR: type "test_domain_exists" does not exist
+-- drop the table
+DROP TABLE IF EXISTS test_exists;
+DROP TABLE test_exists;
+ERROR: table "test_exists" does not exist
+---
+--- role/user/group
+---
+CREATE USER tu1;
+CREATE ROLE tr1;
+CREATE GROUP tg1;
+DROP USER tu2;
+ERROR: role "tu2" does not exist
+DROP USER IF EXISTS tu1, tu2;
+NOTICE: role "tu2" does not exist, skipping
+DROP USER tu1;
+ERROR: role "tu1" does not exist
+DROP ROLE tr2;
+ERROR: role "tr2" does not exist
+DROP ROLE IF EXISTS tr1, tr2;
+NOTICE: role "tr2" does not exist, skipping
+DROP ROLE tr1;
+ERROR: role "tr1" does not exist
+DROP GROUP tg2;
+ERROR: role "tg2" does not exist
+DROP GROUP IF EXISTS tg1, tg2;
+NOTICE: role "tg2" does not exist, skipping
+DROP GROUP tg1;
+ERROR: role "tg1" does not exist
diff --git a/src/test/regress/expected/plancache_1.out b/src/test/regress/expected/plancache_1.out
index 8418572093..6ccf6abd35 100644
--- a/src/test/regress/expected/plancache_1.out
+++ b/src/test/regress/expected/plancache_1.out
@@ -169,8 +169,6 @@ NOTICE: drop cascades to table abc
reset search_path;
-- Check that invalidation deals with regclass constants
create temp sequence seq;
-ERROR: Postgres-XC does not support TEMPORARY SEQUENCE yet
-DETAIL: The feature is not currently supported
prepare p2 as select nextval('seq');
ERROR: Postgres-XC does not support PREPARE yet
DETAIL: The feature is not currently supported
@@ -178,10 +176,7 @@ execute p2;
ERROR: Postgres-XC does not support EXECUTE yet
DETAIL: The feature is not currently supported
drop sequence seq;
-ERROR: sequence "seq" does not exist
create temp sequence seq;
-ERROR: Postgres-XC does not support TEMPORARY SEQUENCE yet
-DETAIL: The feature is not currently supported
execute p2;
ERROR: Postgres-XC does not support EXECUTE yet
DETAIL: The feature is not currently supported
diff --git a/src/test/regress/expected/sequence_2.out b/src/test/regress/expected/sequence_2.out
index df9eadff47..a83f486cee 100644
--- a/src/test/regress/expected/sequence_2.out
+++ b/src/test/regress/expected/sequence_2.out
@@ -143,11 +143,7 @@ LINE 1: SELECT * FROM serialTest ORDER BY f1, f2;
-- Check dependencies of serial and ordinary sequences
--
CREATE TEMP SEQUENCE myseq2;
-ERROR: Postgres-XC does not support TEMPORARY SEQUENCE yet
-DETAIL: The feature is not currently supported
CREATE TEMP SEQUENCE myseq3;
-ERROR: Postgres-XC does not support TEMPORARY SEQUENCE yet
-DETAIL: The feature is not currently supported
CREATE TEMP TABLE t1 (
f1 serial,
f2 int DEFAULT nextval('myseq2'),
@@ -157,20 +153,18 @@ ERROR: Postgres-XC does not support SERIAL yet
DETAIL: The feature is not currently supported
-- Both drops should fail, but with different error messages:
DROP SEQUENCE t1_f1_seq;
-ERROR: sequence "t1_f1_seq" does not exist
+ERROR: relation "t1_f1_seq" does not exist
DROP SEQUENCE myseq2;
-ERROR: sequence "myseq2" does not exist
-- This however will work:
DROP SEQUENCE myseq3;
-ERROR: sequence "myseq3" does not exist
DROP TABLE t1;
ERROR: table "t1" does not exist
-- Fails because no longer existent:
DROP SEQUENCE t1_f1_seq;
-ERROR: sequence "t1_f1_seq" does not exist
+ERROR: relation "t1_f1_seq" does not exist
-- Now OK:
DROP SEQUENCE myseq2;
-ERROR: sequence "myseq2" does not exist
+ERROR: relation "myseq2" does not exist
--
-- Alter sequence
--