From f690ada80f7293aef9440ec5069425e806bf3777 Mon Sep 17 00:00:00 2001 From: Masahiko Sawada Date: Tue, 3 Oct 2017 11:51:07 -0700 Subject: [PATCH] Change to use only the characters that are printable ASCII. The regression test could fail on some environments such as where the encoding is SQL_ASCII. Fixed issue #130. --- regress/expected/repack.out | 7 ++++++- regress/expected/repack_1.out | 7 ++++++- regress/expected/repack_2.out | 7 ++++++- regress/sql/repack.sql | 2 +- 4 files changed, 19 insertions(+), 4 deletions(-) diff --git a/regress/expected/repack.out b/regress/expected/repack.out index 205cd1b..25d4751 100644 --- a/regress/expected/repack.out +++ b/regress/expected/repack.out @@ -113,7 +113,12 @@ ALTER TABLE tbl_with_dropped_toast DROP COLUMN t; INSERT INTO tbl_badindex VALUES(1, 10); INSERT INTO tbl_badindex VALUES(2, 10); -- insert data that is always stored into the toast table if column type is extended. -INSERT INTO tbl_with_mod_column_storage SELECT 1, array_to_string(ARRAY(SELECT chr(code) FROM generate_series(33,3000) code), ''); +SELECT setseed(0); INSERT INTO tbl_with_mod_column_storage SELECT 1, array_to_string(ARRAY(SELECT chr((random() * (127 - 32) + 32)::int) FROM generate_series(1, 3 * 1024) code), ''); + setseed +--------- + +(1 row) + -- This will fail. Silence the message as it's different across PG versions. SET client_min_messages = fatal; CREATE UNIQUE INDEX CONCURRENTLY idx_badindex_n ON tbl_badindex (n); diff --git a/regress/expected/repack_1.out b/regress/expected/repack_1.out index 85d665f..595aab6 100644 --- a/regress/expected/repack_1.out +++ b/regress/expected/repack_1.out @@ -113,7 +113,12 @@ ALTER TABLE tbl_with_dropped_toast DROP COLUMN t; INSERT INTO tbl_badindex VALUES(1, 10); INSERT INTO tbl_badindex VALUES(2, 10); -- insert data that is always stored into the toast table if column type is extended. -INSERT INTO tbl_with_mod_column_storage SELECT 1, array_to_string(ARRAY(SELECT chr(code) FROM generate_series(33,3000) code), ''); +SELECT setseed(0); INSERT INTO tbl_with_mod_column_storage SELECT 1, array_to_string(ARRAY(SELECT chr((random() * (127 - 32) + 32)::int) FROM generate_series(1, 3 * 1024) code), ''); + setseed +--------- + +(1 row) + -- This will fail. Silence the message as it's different across PG versions. SET client_min_messages = fatal; CREATE UNIQUE INDEX CONCURRENTLY idx_badindex_n ON tbl_badindex (n); diff --git a/regress/expected/repack_2.out b/regress/expected/repack_2.out index 6cee6ac..3b5d72e 100644 --- a/regress/expected/repack_2.out +++ b/regress/expected/repack_2.out @@ -113,7 +113,12 @@ ALTER TABLE tbl_with_dropped_toast DROP COLUMN t; INSERT INTO tbl_badindex VALUES(1, 10); INSERT INTO tbl_badindex VALUES(2, 10); -- insert data that is always stored into the toast table if column type is extended. -INSERT INTO tbl_with_mod_column_storage SELECT 1, array_to_string(ARRAY(SELECT chr(code) FROM generate_series(33,3000) code), ''); +SELECT setseed(0); INSERT INTO tbl_with_mod_column_storage SELECT 1, array_to_string(ARRAY(SELECT chr((random() * (127 - 32) + 32)::int) FROM generate_series(1, 3 * 1024) code), ''); + setseed +--------- + +(1 row) + -- This will fail. Silence the message as it's different across PG versions. SET client_min_messages = fatal; CREATE UNIQUE INDEX CONCURRENTLY idx_badindex_n ON tbl_badindex (n); diff --git a/regress/sql/repack.sql b/regress/sql/repack.sql index 917d79f..f79022e 100644 --- a/regress/sql/repack.sql +++ b/regress/sql/repack.sql @@ -129,7 +129,7 @@ INSERT INTO tbl_badindex VALUES(1, 10); INSERT INTO tbl_badindex VALUES(2, 10); -- insert data that is always stored into the toast table if column type is extended. -INSERT INTO tbl_with_mod_column_storage SELECT 1, array_to_string(ARRAY(SELECT chr(code) FROM generate_series(33,3000) code), ''); +SELECT setseed(0); INSERT INTO tbl_with_mod_column_storage SELECT 1, array_to_string(ARRAY(SELECT chr((random() * (127 - 32) + 32)::int) FROM generate_series(1, 3 * 1024) code), ''); -- This will fail. Silence the message as it's different across PG versions. SET client_min_messages = fatal;