Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit a570fea

Browse files
committed
Merge large_object.sql test into largeobject.source.
It seems pretty confusing to have tests named both largeobject and large_object. The latter is of very recent vintage (commit ff992c0), so get rid of it in favor of merging into the former. Also, enable the LO comment test that was added by commit 70ad7ed, since the later commit added the then-missing pg_upgrade functionality. The large_object.sql test case is almost completely redundant with that, but not quite: it seems like creating a user-defined LO with an OID in the system range might be an interesting case for pg_upgrade, so let's keep it. Like the earlier patch, back-patch to all supported branches. Discussion: https://postgr.es/m/18665.1500306372@sss.pgh.pa.us
1 parent 6c6970a commit a570fea

File tree

7 files changed

+35
-38
lines changed

7 files changed

+35
-38
lines changed

src/test/regress/expected/large_object.out

-15
This file was deleted.

src/test/regress/input/largeobject.source

+9-4
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,8 @@ END;
8686
SELECT lo_from_bytea(0, lo_get(loid)) AS newloid FROM lotest_stash_values
8787
\gset
8888

89-
-- Ideally we'd put a comment on this object for pg_dump testing purposes.
90-
-- But since pg_upgrade fails to preserve large object comments, doing so
91-
-- would break pg_upgrade's regression test.
92-
-- COMMENT ON LARGE OBJECT :newloid IS 'I Wandered Lonely as a Cloud';
89+
-- Add a comment to it, as well, for pg_dump/pg_upgrade testing.
90+
COMMENT ON LARGE OBJECT :newloid IS 'I Wandered Lonely as a Cloud';
9391

9492
-- Read out a portion
9593
BEGIN;
@@ -253,6 +251,13 @@ SELECT lo_from_bytea(0, E'\\xdeadbeef') AS newloid
253251
SET bytea_output TO hex;
254252
SELECT lo_get(:newloid);
255253

254+
-- Create one more object that we leave behind for testing pg_dump/pg_upgrade;
255+
-- this one intentionally has an OID in the system range
256+
SELECT lo_create(3001);
257+
258+
COMMENT ON LARGE OBJECT 3001 IS 'testing comments';
259+
260+
-- Clean up
256261
DROP TABLE lotest_stash_values;
257262

258263
DROP ROLE regress_lo_user;

src/test/regress/output/largeobject.source

+12-4
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,8 @@ END;
9090
-- it's left behind to help test pg_dump.
9191
SELECT lo_from_bytea(0, lo_get(loid)) AS newloid FROM lotest_stash_values
9292
\gset
93-
-- Ideally we'd put a comment on this object for pg_dump testing purposes.
94-
-- But since pg_upgrade fails to preserve large object comments, doing so
95-
-- would break pg_upgrade's regression test.
96-
-- COMMENT ON LARGE OBJECT :newloid IS 'I Wandered Lonely as a Cloud';
93+
-- Add a comment to it, as well, for pg_dump/pg_upgrade testing.
94+
COMMENT ON LARGE OBJECT :newloid IS 'I Wandered Lonely as a Cloud';
9795
-- Read out a portion
9896
BEGIN;
9997
UPDATE lotest_stash_values SET fd=lo_open(loid, CAST(x'20000' | x'40000' AS integer));
@@ -469,5 +467,15 @@ SELECT lo_get(:newloid);
469467
\xdeadbeef
470468
(1 row)
471469

470+
-- Create one more object that we leave behind for testing pg_dump/pg_upgrade;
471+
-- this one intentionally has an OID in the system range
472+
SELECT lo_create(3001);
473+
lo_create
474+
-----------
475+
3001
476+
(1 row)
477+
478+
COMMENT ON LARGE OBJECT 3001 IS 'testing comments';
479+
-- Clean up
472480
DROP TABLE lotest_stash_values;
473481
DROP ROLE regress_lo_user;

src/test/regress/output/largeobject_1.source

+12-4
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,8 @@ END;
9090
-- it's left behind to help test pg_dump.
9191
SELECT lo_from_bytea(0, lo_get(loid)) AS newloid FROM lotest_stash_values
9292
\gset
93-
-- Ideally we'd put a comment on this object for pg_dump testing purposes.
94-
-- But since pg_upgrade fails to preserve large object comments, doing so
95-
-- would break pg_upgrade's regression test.
96-
-- COMMENT ON LARGE OBJECT :newloid IS 'I Wandered Lonely as a Cloud';
93+
-- Add a comment to it, as well, for pg_dump/pg_upgrade testing.
94+
COMMENT ON LARGE OBJECT :newloid IS 'I Wandered Lonely as a Cloud';
9795
-- Read out a portion
9896
BEGIN;
9997
UPDATE lotest_stash_values SET fd=lo_open(loid, CAST(x'20000' | x'40000' AS integer));
@@ -469,5 +467,15 @@ SELECT lo_get(:newloid);
469467
\xdeadbeef
470468
(1 row)
471469

470+
-- Create one more object that we leave behind for testing pg_dump/pg_upgrade;
471+
-- this one intentionally has an OID in the system range
472+
SELECT lo_create(3001);
473+
lo_create
474+
-----------
475+
3001
476+
(1 row)
477+
478+
COMMENT ON LARGE OBJECT 3001 IS 'testing comments';
479+
-- Clean up
472480
DROP TABLE lotest_stash_values;
473481
DROP ROLE regress_lo_user;

src/test/regress/parallel_schedule

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ test: select_into select_distinct select_distinct_on select_implicit select_havi
8484
# ----------
8585
# Another group of parallel tests
8686
# ----------
87-
test: brin gin gist spgist privileges init_privs security_label collate matview lock replica_identity rowsecurity object_address tablesample groupingsets drop_operator large_object password
87+
test: brin gin gist spgist privileges init_privs security_label collate matview lock replica_identity rowsecurity object_address tablesample groupingsets drop_operator password
8888

8989
# ----------
9090
# Another group of parallel tests

src/test/regress/serial_schedule

+1-2
Original file line numberDiff line numberDiff line change
@@ -115,12 +115,11 @@ test: matview
115115
test: lock
116116
test: replica_identity
117117
test: rowsecurity
118-
test: password
119118
test: object_address
120119
test: tablesample
121120
test: groupingsets
122121
test: drop_operator
123-
test: large_object
122+
test: password
124123
test: alter_generic
125124
test: alter_operator
126125
test: misc

src/test/regress/sql/large_object.sql

-8
This file was deleted.

0 commit comments

Comments
 (0)