From 46aae5949f56580281a0f487c785c745d8856a04 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Mon, 30 Jan 2017 13:28:28 -0500 Subject: [PATCH] Fix sequence test in cs_CZ locale Rename some objects so that sorted output becomes less locale-dependent. --- src/test/regress/expected/sequence.out | 24 ++++++++++++------------ src/test/regress/sql/sequence.sql | 20 ++++++++++---------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/test/regress/expected/sequence.out b/src/test/regress/expected/sequence.out index 5af536d4c7..d062e91d26 100644 --- a/src/test/regress/expected/sequence.out +++ b/src/test/regress/expected/sequence.out @@ -31,14 +31,14 @@ DROP TABLE sequence_test_table; --- --- test creation of SERIAL column --- -CREATE TABLE serialTest (f1 text, f2 serial); -INSERT INTO serialTest VALUES ('foo'); -INSERT INTO serialTest VALUES ('bar'); -INSERT INTO serialTest VALUES ('force', 100); -INSERT INTO serialTest VALUES ('wrong', NULL); +CREATE TABLE serialTest1 (f1 text, f2 serial); +INSERT INTO serialTest1 VALUES ('foo'); +INSERT INTO serialTest1 VALUES ('bar'); +INSERT INTO serialTest1 VALUES ('force', 100); +INSERT INTO serialTest1 VALUES ('wrong', NULL); ERROR: null value in column "f2" violates not-null constraint DETAIL: Failing row contains (wrong, null). -SELECT * FROM serialTest; +SELECT * FROM serialTest1; f1 | f2 -------+----- foo | 1 @@ -230,9 +230,9 @@ SELECT last_value, log_cnt IN (31, 32) AS log_cnt_ok, is_called FROM foo_seq_new DROP SEQUENCE foo_seq_new; -- renaming serial sequences -ALTER TABLE serialtest_f2_seq RENAME TO serialtest_f2_foo; -INSERT INTO serialTest VALUES ('more'); -SELECT * FROM serialTest; +ALTER TABLE serialtest1_f2_seq RENAME TO serialtest1_f2_foo; +INSERT INTO serialTest1 VALUES ('more'); +SELECT * FROM serialTest1; f1 | f2 -------+----- foo | 1 @@ -445,12 +445,12 @@ SELECT * FROM information_schema.sequences regression | public | sequence_test2 | bigint | 64 | 2 | 0 | 32 | 5 | 36 | 4 | YES regression | public | sequence_test3 | bigint | 64 | 2 | 0 | 1 | 1 | 9223372036854775807 | 1 | NO regression | public | sequence_test4 | bigint | 64 | 2 | 0 | -1 | -9223372036854775808 | -1 | -1 | NO + regression | public | serialtest1_f2_foo | bigint | 64 | 2 | 0 | 1 | 1 | 9223372036854775807 | 1 | NO regression | public | serialtest2_f2_seq | bigint | 64 | 2 | 0 | 1 | 1 | 9223372036854775807 | 1 | NO regression | public | serialtest2_f3_seq | bigint | 64 | 2 | 0 | 1 | 1 | 9223372036854775807 | 1 | NO regression | public | serialtest2_f4_seq | bigint | 64 | 2 | 0 | 1 | 1 | 9223372036854775807 | 1 | NO regression | public | serialtest2_f5_seq | bigint | 64 | 2 | 0 | 1 | 1 | 9223372036854775807 | 1 | NO regression | public | serialtest2_f6_seq | bigint | 64 | 2 | 0 | 1 | 1 | 9223372036854775807 | 1 | NO - regression | public | serialtest_f2_foo | bigint | 64 | 2 | 0 | 1 | 1 | 9223372036854775807 | 1 | NO (9 rows) SELECT schemaname, sequencename, start_value, min_value, max_value, increment_by, cycle, cache_size, last_value @@ -462,12 +462,12 @@ WHERE sequencename ~ ANY(ARRAY['sequence_test', 'serialtest']) public | sequence_test2 | 32 | 5 | 36 | 4 | t | 1 | 5 public | sequence_test3 | 1 | 1 | 9223372036854775807 | 1 | f | 1 | public | sequence_test4 | -1 | -9223372036854775808 | -1 | -1 | f | 1 | -1 + public | serialtest1_f2_foo | 1 | 1 | 9223372036854775807 | 1 | f | 1 | 3 public | serialtest2_f2_seq | 1 | 1 | 9223372036854775807 | 1 | f | 1 | 2 public | serialtest2_f3_seq | 1 | 1 | 9223372036854775807 | 1 | f | 1 | 2 public | serialtest2_f4_seq | 1 | 1 | 9223372036854775807 | 1 | f | 1 | 2 public | serialtest2_f5_seq | 1 | 1 | 9223372036854775807 | 1 | f | 1 | 2 public | serialtest2_f6_seq | 1 | 1 | 9223372036854775807 | 1 | f | 1 | 2 - public | serialtest_f2_foo | 1 | 1 | 9223372036854775807 | 1 | f | 1 | 3 (9 rows) SELECT * FROM pg_sequence_parameters('sequence_test4'::regclass); @@ -716,7 +716,7 @@ ALTER SEQUENCE sequence_test2 START WITH 1; ERROR: must be owner of relation sequence_test2 ROLLBACK; -- Sequences should get wiped out as well: -DROP TABLE serialTest, serialTest2; +DROP TABLE serialTest1, serialTest2; -- Make sure sequences are gone: SELECT * FROM information_schema.sequences WHERE sequence_name IN ('sequence_test2', 'serialtest2_f2_seq', 'serialtest2_f3_seq', diff --git a/src/test/regress/sql/sequence.sql b/src/test/regress/sql/sequence.sql index d57aa953b9..4b9824c3cc 100644 --- a/src/test/regress/sql/sequence.sql +++ b/src/test/regress/sql/sequence.sql @@ -23,14 +23,14 @@ DROP TABLE sequence_test_table; --- test creation of SERIAL column --- -CREATE TABLE serialTest (f1 text, f2 serial); +CREATE TABLE serialTest1 (f1 text, f2 serial); -INSERT INTO serialTest VALUES ('foo'); -INSERT INTO serialTest VALUES ('bar'); -INSERT INTO serialTest VALUES ('force', 100); -INSERT INTO serialTest VALUES ('wrong', NULL); +INSERT INTO serialTest1 VALUES ('foo'); +INSERT INTO serialTest1 VALUES ('bar'); +INSERT INTO serialTest1 VALUES ('force', 100); +INSERT INTO serialTest1 VALUES ('wrong', NULL); -SELECT * FROM serialTest; +SELECT * FROM serialTest1; -- test smallserial / bigserial CREATE TABLE serialTest2 (f1 text, f2 serial, f3 smallserial, f4 serial2, @@ -111,9 +111,9 @@ SELECT last_value, log_cnt IN (31, 32) AS log_cnt_ok, is_called FROM foo_seq_new DROP SEQUENCE foo_seq_new; -- renaming serial sequences -ALTER TABLE serialtest_f2_seq RENAME TO serialtest_f2_foo; -INSERT INTO serialTest VALUES ('more'); -SELECT * FROM serialTest; +ALTER TABLE serialtest1_f2_seq RENAME TO serialtest1_f2_foo; +INSERT INTO serialTest1 VALUES ('more'); +SELECT * FROM serialTest1; -- -- Check dependencies of serial and ordinary sequences @@ -353,7 +353,7 @@ ALTER SEQUENCE sequence_test2 START WITH 1; ROLLBACK; -- Sequences should get wiped out as well: -DROP TABLE serialTest, serialTest2; +DROP TABLE serialTest1, serialTest2; -- Make sure sequences are gone: SELECT * FROM information_schema.sequences WHERE sequence_name IN -- 2.40.0