Skip to content

Commit f0b9bec

Browse files
committed
Fix pg_dump TAP tests.
Currecntly TAP tests for pg_dump are red. ``` Test Summary Report ------------------- t/002_pg_dump.pl (Wstat: 25088 (exited 98) Tests: 7138 Failed: 98) Failed tests: 112, 327, 542, 972, 1402, 1618, 1834, 1976-1977 1979-1982, 1987-1988, 1993-1995, 2001-2002 2004, 2010, 2013, 2015, 2023, 2032-2033 2043, 2045-2050, 2054, 2063, 2073-2074 2086-2091, 2093-2094, 2101-2104, 2108, 2125 2135, 2155, 2158-2167, 2169-2171, 2180 2182, 2185-2189, 2270, 2915, 3345, 3560 3775, 3990, 4205, 4420, 4635, 4850, 5633-5634 5644-5645, 5680, 5730, 5812, 5819, 5824 5845-5846, 6141, 6786, 7001 Non-zero exit status: 98 t/004_pg_dump_parallel.pl (Wstat: 1024 (exited 4) Tests: 4 Failed: 4) Failed tests: 1-4 Non-zero exit status: 4 t/010_dump_connstr.pl (Wstat: 768 (exited 3) Tests: 14 Failed: 3) Failed tests: 7-9 Non-zero exit status: 3 ``` Issues cause is appendonly-speicific test and parrallel dump. Fix first by modifying TAP perl regex. Fix latter by fixing rebase issues with 56b46d3 with changes for pg_backup_archiver.c
1 parent f8210ef commit f0b9bec

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)