diff options
Diffstat (limited to 'src/test/modules')
| -rw-r--r-- | src/test/modules/test_int128/test_int128.c | 14 | ||||
| -rw-r--r-- | src/test/modules/unsafe_tests/expected/guc_privs.out | 15 | ||||
| -rw-r--r-- | src/test/modules/unsafe_tests/sql/guc_privs.sql | 10 |
3 files changed, 34 insertions, 5 deletions
diff --git a/src/test/modules/test_int128/test_int128.c b/src/test/modules/test_int128/test_int128.c index c9c17a73a4e..1efd4ff68b3 100644 --- a/src/test/modules/test_int128/test_int128.c +++ b/src/test/modules/test_int128/test_int128.c @@ -90,17 +90,21 @@ main(int argc, char **argv) while (count-- > 0) { - int64 x = pg_prng_uint64(&pg_global_prng_state); - int64 y = pg_prng_uint64(&pg_global_prng_state); - int64 z = pg_prng_uint64(&pg_global_prng_state); - int64 w = pg_prng_uint64(&pg_global_prng_state); - int32 z32 = (int32) z; + int64 x = pg_prng_int64(&pg_global_prng_state); + int64 y = pg_prng_int64(&pg_global_prng_state); + int64 z = pg_prng_int64(&pg_global_prng_state); + int64 w = pg_prng_int64(&pg_global_prng_state); + int32 z32 = pg_prng_int32(&pg_global_prng_state); test128 t1; test128 t2; test128 t3; int32 r1; int32 r2; + /* prevent division by zero in the 128/32-bit division test */ + while (z32 == 0) + z32 = pg_prng_int32(&pg_global_prng_state); + /* check unsigned addition */ t1.hl.hi = x; t1.hl.lo = y; diff --git a/src/test/modules/unsafe_tests/expected/guc_privs.out b/src/test/modules/unsafe_tests/expected/guc_privs.out index 6c0ad898341..3cf2f2fdb85 100644 --- a/src/test/modules/unsafe_tests/expected/guc_privs.out +++ b/src/test/modules/unsafe_tests/expected/guc_privs.out @@ -581,6 +581,21 @@ DROP ROLE regress_host_resource_newadmin; -- ok, nothing was transferred -- Use "drop owned by" so we can drop the role DROP OWNED BY regress_host_resource_admin; -- ok DROP ROLE regress_host_resource_admin; -- ok +-- Test for GUC synchronized standby slots +-- Cannot set synchronized_standby_slots to a reserved slot name +ALTER SYSTEM SET synchronized_standby_slots='pg_conflict_detection'; +ERROR: invalid value for parameter "synchronized_standby_slots": "pg_conflict_detection" +DETAIL: replication slot name "pg_conflict_detection" is reserved +HINT: The name "pg_conflict_detection" is reserved for the conflict detection slot. +-- Cannot set synchronized_standby_slots to an invalid slot name +ALTER SYSTEM SET synchronized_standby_slots='invalid*'; +ERROR: invalid value for parameter "synchronized_standby_slots": "invalid*" +DETAIL: replication slot name "invalid*" contains invalid character +HINT: Replication slot names may only contain lower case letters, numbers, and the underscore character. +-- Can set synchronized_standby_slots to a non-existent slot name +ALTER SYSTEM SET synchronized_standby_slots='missing'; +-- Reset the GUC +ALTER SYSTEM RESET synchronized_standby_slots; -- Clean up RESET SESSION AUTHORIZATION; DROP ROLE regress_admin; -- ok diff --git a/src/test/modules/unsafe_tests/sql/guc_privs.sql b/src/test/modules/unsafe_tests/sql/guc_privs.sql index 9bcbbfa9040..d0d16f3c29f 100644 --- a/src/test/modules/unsafe_tests/sql/guc_privs.sql +++ b/src/test/modules/unsafe_tests/sql/guc_privs.sql @@ -262,6 +262,16 @@ DROP ROLE regress_host_resource_newadmin; -- ok, nothing was transferred DROP OWNED BY regress_host_resource_admin; -- ok DROP ROLE regress_host_resource_admin; -- ok +-- Test for GUC synchronized standby slots +-- Cannot set synchronized_standby_slots to a reserved slot name +ALTER SYSTEM SET synchronized_standby_slots='pg_conflict_detection'; +-- Cannot set synchronized_standby_slots to an invalid slot name +ALTER SYSTEM SET synchronized_standby_slots='invalid*'; +-- Can set synchronized_standby_slots to a non-existent slot name +ALTER SYSTEM SET synchronized_standby_slots='missing'; +-- Reset the GUC +ALTER SYSTEM RESET synchronized_standby_slots; + -- Clean up RESET SESSION AUTHORIZATION; DROP ROLE regress_admin; -- ok |
