Skip to content

Commit 3e6690a

Browse files
authored
Merge branch 'main' into cp_CVE_2023_5870
2 parents cf24bb8 + 72581fd commit 3e6690a

File tree

2 files changed

+10
-43
lines changed

2 files changed

+10
-43
lines changed

src/bin/pg_dump/pg_backup_archiver.c

Lines changed: 1 addition & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -4935,43 +4935,8 @@ CloneArchive(ArchiveHandle *AH)
49354935

49364936
/* re-establish fixed state */
49374937
if (AH->mode == archModeRead)
4938-
{
4939-
Assert(AH->connection == NULL);
4940-
4941-
/* this also sets clone->connection */
4942-
ConnectDatabase((Archive *) clone, &clone->public.ropt->cparams, true, false);
4943-
4944-
/* re-establish fixed state */
49454938
_doSetFixedOutputState(clone);
4946-
}
4947-
else
4948-
{
4949-
PQExpBufferData connstr;
4950-
char *pghost;
4951-
char *pgport;
4952-
char *username;
4953-
4954-
Assert(AH->connection != NULL);
4955-
4956-
/*
4957-
* Even though we are technically accessing the parent's database
4958-
* object here, these functions are fine to be called like that
4959-
* because all just return a pointer and do not actually send/receive
4960-
* any data to/from the database.
4961-
*/
4962-
initPQExpBuffer(&connstr);
4963-
appendPQExpBufferStr(&connstr, "dbname=");
4964-
appendConnStrVal(&connstr, PQdb(AH->connection));
4965-
pghost = PQhost(AH->connection);
4966-
pgport = PQport(AH->connection);
4967-
username = PQuser(AH->connection);
4968-
4969-
/* this also sets clone->connection */
4970-
ConnectDatabase((Archive *) clone, &clone->public.ropt->cparams, true, false);
4971-
4972-
termPQExpBuffer(&connstr);
4973-
/* setupDumpWorker will fix up connection state */
4974-
}
4939+
/* in write case, setupDumpWorker will fix up connection state */
49754940

49764941
/* Let the format-specific code have a chance too */
49774942
clone->ClonePtr(clone);

src/bin/pg_dump/t/002_pg_dump.pl

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2214,20 +2214,22 @@
22142214
create_order => 19,
22152215
create_sql => 'CREATE TABLE dump_test.test_table_ao(a integer, b text)
22162216
WITH (appendonly = true, compresstype = zlib, compresslevel = 1);',
2217-
regexp => qr/^
2218-
\QCREATE TABLE dump_test.test_table_ao (\E\n
2219-
\s+\Qa integer,\E\n
2220-
\s+\Qb text\E\n
2221-
\QWITH (appendonly = true, orientation = column, compresstype = zlib, compresslevel = 1);\E\n/xm,
2217+
regexp => qr{^
2218+
\QCREATE TABLE dump_test.test_table_ao (\E
2219+
\n\s+\Qa integer,\E
2220+
\n\s+\Qb text\E
2221+
\n\Q)\E
2222+
\n\QWITH (appendonly = true, compresstype=zlib, compresslevel='1');\E
2223+
}xm,
22222224
like => {
22232225
%full_runs,
22242226
%dump_test_schema_runs,
2225-
only_dump_test_table => 1,
22262227
section_pre_data => 1,
2228+
exclude_test_table => 1,
22272229
},
22282230
unlike => {
2231+
only_dump_test_table => 1,
22292232
exclude_dump_test_schema => 1,
2230-
exclude_test_table => 1,
22312233
},
22322234
},
22332235

0 commit comments

Comments
 (0)