diff options
Diffstat (limited to 'src/test/regress/sql')
| -rw-r--r-- | src/test/regress/sql/hs_primary_extremes.sql | 73 | ||||
| -rw-r--r-- | src/test/regress/sql/hs_primary_setup.sql | 25 | ||||
| -rw-r--r-- | src/test/regress/sql/hs_standby_allowed.sql | 125 | ||||
| -rw-r--r-- | src/test/regress/sql/hs_standby_check.sql | 16 | ||||
| -rw-r--r-- | src/test/regress/sql/hs_standby_disallowed.sql | 103 | ||||
| -rw-r--r-- | src/test/regress/sql/hs_standby_functions.sql | 24 |
6 files changed, 0 insertions, 366 deletions
diff --git a/src/test/regress/sql/hs_primary_extremes.sql b/src/test/regress/sql/hs_primary_extremes.sql deleted file mode 100644 index 2051e2e5cf2..00000000000 --- a/src/test/regress/sql/hs_primary_extremes.sql +++ /dev/null @@ -1,73 +0,0 @@ --- --- Hot Standby tests --- --- hs_primary_extremes.sql --- - -drop table if exists hs_extreme; -create table hs_extreme (col1 integer); - -CREATE OR REPLACE FUNCTION hs_subxids (n integer) -RETURNS void -LANGUAGE plpgsql -AS $$ - BEGIN - IF n <= 0 THEN RETURN; END IF; - INSERT INTO hs_extreme VALUES (n); - PERFORM hs_subxids(n - 1); - RETURN; - EXCEPTION WHEN raise_exception THEN NULL; END; -$$; - -BEGIN; -SELECT hs_subxids(257); -ROLLBACK; -BEGIN; -SELECT hs_subxids(257); -COMMIT; - -set client_min_messages = 'warning'; - -CREATE OR REPLACE FUNCTION hs_locks_create (n integer) -RETURNS void -LANGUAGE plpgsql -AS $$ - BEGIN - IF n <= 0 THEN - CHECKPOINT; - RETURN; - END IF; - EXECUTE 'CREATE TABLE hs_locks_' || n::text || ' ()'; - PERFORM hs_locks_create(n - 1); - RETURN; - EXCEPTION WHEN raise_exception THEN NULL; END; -$$; - -CREATE OR REPLACE FUNCTION hs_locks_drop (n integer) -RETURNS void -LANGUAGE plpgsql -AS $$ - BEGIN - IF n <= 0 THEN - CHECKPOINT; - RETURN; - END IF; - EXECUTE 'DROP TABLE IF EXISTS hs_locks_' || n::text; - PERFORM hs_locks_drop(n - 1); - RETURN; - EXCEPTION WHEN raise_exception THEN NULL; END; -$$; - -BEGIN; -SELECT hs_locks_drop(257); -SELECT hs_locks_create(257); -SELECT count(*) > 257 FROM pg_locks; -ROLLBACK; -BEGIN; -SELECT hs_locks_drop(257); -SELECT hs_locks_create(257); -SELECT count(*) > 257 FROM pg_locks; -COMMIT; -SELECT hs_locks_drop(257); - -SELECT pg_switch_wal(); diff --git a/src/test/regress/sql/hs_primary_setup.sql b/src/test/regress/sql/hs_primary_setup.sql deleted file mode 100644 index eeb4421307f..00000000000 --- a/src/test/regress/sql/hs_primary_setup.sql +++ /dev/null @@ -1,25 +0,0 @@ --- --- Hot Standby tests --- --- hs_primary_setup.sql --- - -drop table if exists hs1; -create table hs1 (col1 integer primary key); -insert into hs1 values (1); - -drop table if exists hs2; -create table hs2 (col1 integer primary key); -insert into hs2 values (12); -insert into hs2 values (13); - -drop table if exists hs3; -create table hs3 (col1 integer primary key); -insert into hs3 values (113); -insert into hs3 values (114); -insert into hs3 values (115); - -DROP sequence if exists hsseq; -create sequence hsseq; - -SELECT pg_switch_wal(); diff --git a/src/test/regress/sql/hs_standby_allowed.sql b/src/test/regress/sql/hs_standby_allowed.sql deleted file mode 100644 index 6debddc5e99..00000000000 --- a/src/test/regress/sql/hs_standby_allowed.sql +++ /dev/null @@ -1,125 +0,0 @@ --- --- Hot Standby tests --- --- hs_standby_allowed.sql --- - --- SELECT - -select count(*) as should_be_1 from hs1; - -select count(*) as should_be_2 from hs2; - -select count(*) as should_be_3 from hs3; - -COPY hs1 TO '/tmp/copy_test'; -\! cat /tmp/copy_test - --- Access sequence directly -select is_called from hsseq; - --- Transactions - -begin; -select count(*) as should_be_1 from hs1; -end; - -begin transaction read only; -select count(*) as should_be_1 from hs1; -end; - -begin transaction isolation level repeatable read; -select count(*) as should_be_1 from hs1; -select count(*) as should_be_1 from hs1; -select count(*) as should_be_1 from hs1; -commit; - -begin; -select count(*) as should_be_1 from hs1; -commit; - -begin; -select count(*) as should_be_1 from hs1; -abort; - -start transaction; -select count(*) as should_be_1 from hs1; -commit; - -begin; -select count(*) as should_be_1 from hs1; -rollback; - -begin; -select count(*) as should_be_1 from hs1; -savepoint s; -select count(*) as should_be_2 from hs2; -commit; - -begin; -select count(*) as should_be_1 from hs1; -savepoint s; -select count(*) as should_be_2 from hs2; -release savepoint s; -select count(*) as should_be_2 from hs2; -savepoint s; -select count(*) as should_be_3 from hs3; -rollback to savepoint s; -select count(*) as should_be_2 from hs2; -commit; - --- SET parameters - --- has no effect on read only transactions, but we can still set it -set synchronous_commit = on; -show synchronous_commit; -reset synchronous_commit; - -discard temp; -discard all; - --- CURSOR commands - -BEGIN; - -DECLARE hsc CURSOR FOR select * from hs3; - -FETCH next from hsc; -fetch first from hsc; -fetch last from hsc; -fetch 1 from hsc; - -CLOSE hsc; - -COMMIT; - --- Prepared plans - -PREPARE hsp AS select count(*) from hs1; -PREPARE hsp_noexec (integer) AS insert into hs1 values ($1); - -EXECUTE hsp; - -DEALLOCATE hsp; - --- LOCK - -BEGIN; -LOCK hs1 IN ACCESS SHARE MODE; -LOCK hs1 IN ROW SHARE MODE; -LOCK hs1 IN ROW EXCLUSIVE MODE; -COMMIT; - --- UNLISTEN -UNLISTEN a; -UNLISTEN *; - --- LOAD --- should work, easier if there is no test for that... - - --- ALLOWED COMMANDS - -CHECKPOINT; - -discard all; diff --git a/src/test/regress/sql/hs_standby_check.sql b/src/test/regress/sql/hs_standby_check.sql deleted file mode 100644 index 3fe8a02720b..00000000000 --- a/src/test/regress/sql/hs_standby_check.sql +++ /dev/null @@ -1,16 +0,0 @@ --- --- Hot Standby tests --- --- hs_standby_check.sql --- - --- --- If the query below returns false then all other tests will fail after it. --- -select case pg_is_in_recovery() when false then - 'These tests are intended only for execution on a standby server that is reading ' || - 'WAL from a server upon which the regression database is already created and into ' || - 'which src/test/regress/sql/hs_primary_setup.sql has been run' -else - 'Tests are running on a standby server during recovery' -end; diff --git a/src/test/regress/sql/hs_standby_disallowed.sql b/src/test/regress/sql/hs_standby_disallowed.sql deleted file mode 100644 index a470600eec8..00000000000 --- a/src/test/regress/sql/hs_standby_disallowed.sql +++ /dev/null @@ -1,103 +0,0 @@ --- --- Hot Standby tests --- --- hs_standby_disallowed.sql --- - -SET transaction_read_only = off; - -begin transaction read write; -commit; - --- SELECT - -select * from hs1 FOR SHARE; -select * from hs1 FOR UPDATE; - --- DML -BEGIN; -insert into hs1 values (37); -ROLLBACK; -BEGIN; -delete from hs1 where col1 = 1; -ROLLBACK; -BEGIN; -update hs1 set col1 = NULL where col1 > 0; -ROLLBACK; -BEGIN; -truncate hs3; -ROLLBACK; - --- DDL - -create temporary table hstemp1 (col1 integer); -BEGIN; -drop table hs2; -ROLLBACK; -BEGIN; -create table hs4 (col1 integer); -ROLLBACK; - --- Sequences - -SELECT nextval('hsseq'); - --- Two-phase commit transaction stuff - -BEGIN; -SELECT count(*) FROM hs1; -PREPARE TRANSACTION 'foobar'; -ROLLBACK; -BEGIN; -SELECT count(*) FROM hs1; -COMMIT PREPARED 'foobar'; -ROLLBACK; - -BEGIN; -SELECT count(*) FROM hs1; -PREPARE TRANSACTION 'foobar'; -ROLLBACK PREPARED 'foobar'; -ROLLBACK; - -BEGIN; -SELECT count(*) FROM hs1; -ROLLBACK PREPARED 'foobar'; -ROLLBACK; - - --- Locks -BEGIN; -LOCK hs1; -COMMIT; -BEGIN; -LOCK hs1 IN SHARE UPDATE EXCLUSIVE MODE; -COMMIT; -BEGIN; -LOCK hs1 IN SHARE MODE; -COMMIT; -BEGIN; -LOCK hs1 IN SHARE ROW EXCLUSIVE MODE; -COMMIT; -BEGIN; -LOCK hs1 IN EXCLUSIVE MODE; -COMMIT; -BEGIN; -LOCK hs1 IN ACCESS EXCLUSIVE MODE; -COMMIT; - --- Listen -listen a; -notify a; - --- disallowed commands - -ANALYZE hs1; - -VACUUM hs2; - -CLUSTER hs2 using hs1_pkey; - -REINDEX TABLE hs2; - -REVOKE SELECT ON hs1 FROM PUBLIC; -GRANT SELECT ON hs1 TO PUBLIC; diff --git a/src/test/regress/sql/hs_standby_functions.sql b/src/test/regress/sql/hs_standby_functions.sql deleted file mode 100644 index b57f67ff8b5..00000000000 --- a/src/test/regress/sql/hs_standby_functions.sql +++ /dev/null @@ -1,24 +0,0 @@ --- --- Hot Standby tests --- --- hs_standby_functions.sql --- - --- should fail -select pg_current_xact_id(); - -select length(pg_current_snapshot()::text) >= 4; - -select pg_start_backup('should fail'); -select pg_switch_wal(); -select pg_stop_backup(); - --- should return no rows -select * from pg_prepared_xacts; - --- just the startup process -select locktype, virtualxid, virtualtransaction, mode, granted -from pg_locks where virtualxid = '1/1'; - --- suicide is painless -select pg_cancel_backend(pg_backend_pid()); |
