Skip to content

Commit c543966

Browse files
authored
Merge branch 'main' into reshke-patch-1
2 parents 5a9e97a + 72581fd commit c543966

File tree

4 files changed

+28
-43
lines changed

4 files changed

+28
-43
lines changed

src/backend/gporca/libgpopt/include/gpopt/operators/CPhysicalDynamicTableScan.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,9 @@ class CPhysicalDynamicTableScan : public CPhysicalDynamicScan
7474
CPartitionPropagationSpec *PppsDerive(
7575
CMemoryPool *mp, CExpressionHandle &exprhdl) const override;
7676

77+
// return rewindability property enforcing type for this operator
78+
CEnfdProp::EPropEnforcingType EpetRewindability(CExpressionHandle &, const CEnfdRewindability *) const override;
79+
7780
}; // class CPhysicalDynamicTableScan
7881

7982
} // namespace gpopt

src/backend/gporca/libgpopt/src/operators/CPhysicalDynamicTableScan.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,4 +91,19 @@ CPhysicalDynamicTableScan::PppsDerive(CMemoryPool *mp,
9191
return pps;
9292
}
9393

94+
95+
CEnfdProp::EPropEnforcingType
96+
CPhysicalDynamicTableScan::EpetRewindability(CExpressionHandle &exprhdl,
97+
const CEnfdRewindability *per) const
98+
{
99+
CRewindabilitySpec *prs = CDrvdPropPlan::Pdpplan(exprhdl.Pdp())->Prs();
100+
if (per->FCompatible(prs))
101+
{
102+
// required rewindability is already provided
103+
return CEnfdProp::EpetUnnecessary;
104+
}
105+
106+
return CEnfdProp::EpetRequired;
107+
}
108+
94109
// EOF

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)