Skip to content

Commit 3514aa1

Browse files
authored
Merge branch 'main' into gp_relsizes_stats
2 parents c6072c4 + d4f437b commit 3514aa1

6 files changed

Lines changed: 15 additions & 5 deletions

File tree

src/backend/access/common/reloptions_gp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1791,7 +1791,7 @@ transformColumnEncoding(const TableAmRoutine *tam, Relation rel, List *colDefs,
17911791
return result;
17921792
}
17931793

1794-
List* transfromColumnEncodingAocoRootPartition(List *colDefs, List *stenc, List *withOptions, bool errorOnEncodingClause)
1794+
List* transformColumnEncodingAocoRootPartition(List *colDefs, List *stenc, List *withOptions, bool errorOnEncodingClause)
17951795
{
17961796
ColumnReferenceStorageDirective *deflt = NULL;
17971797
ListCell *lc;

src/backend/commands/tablecmds.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1183,7 +1183,7 @@ DefineRelation(CreateStmt *stmt, char relkind, Oid ownerId,
11831183
* table access method. The partition table will have the same behaviors on
11841184
* relam, reloptions, attribute encodings in the future.
11851185
*/
1186-
stmt->attr_encodings = transfromColumnEncodingAocoRootPartition(schema,
1186+
stmt->attr_encodings = transformColumnEncodingAocoRootPartition(schema,
11871187
stmt->attr_encodings,
11881188
stmt->options,
11891189
!AMHandlerIsAoCols(amHandlerOid)

src/backend/commands/vacuum_ao.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,14 @@ ao_vacuum_rel_pre_cleanup(Relation onerel, VacuumParams *params, BufferAccessStr
224224
*/
225225
ao_vacuum_rel_recycle_dead_segments(onerel, params, bstrategy, vacrelstats);
226226

227+
/*
228+
* Make the pg_aoseg updates above visible to AppendOptimizedTruncateToEOF's
229+
* catalog snapshot; without this the zeroed-eof rows are invisible (same
230+
* CommandId) and the old non-zero-eof rows appear live, triggering "file
231+
* size smaller than logical eof".
232+
*/
233+
CommandCounterIncrement();
234+
227235
/*
228236
* Also truncate all live segments to the EOF values stored in pg_aoseg.
229237
* This releases space left behind by aborted inserts.

src/backend/optimizer/util/plancat.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1621,8 +1621,10 @@ GetExtStatisticsName(Oid statOid)
16211621
elog(ERROR, "cache lookup failed for statistics object %u", statOid);
16221622

16231623
staForm = (Form_pg_statistic_ext) GETSTRUCT(htup);
1624+
/* Copy the name before releasing the cache entry. */
1625+
char *result = pstrdup(NameStr(staForm->stxname));
16241626
ReleaseSysCache(htup);
1625-
return NameStr(staForm->stxname);
1627+
return result;
16261628
}
16271629

16281630
/*

src/backend/parser/parse_partition_gp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1687,7 +1687,7 @@ generatePartitions(Oid parentrelid, GpPartitionDefinition *gpPartSpec,
16871687
if (elem->accessMethod && strcmp(elem->accessMethod, "ao_column") == 0)
16881688
elem->colencs = merge_partition_encoding(pstate, elem->colencs, penc_cls);
16891689
else if (!elem->colencs) {
1690-
/* For the aoco, used `transfromColumnEncodingAocoRootPartition` to
1690+
/* For the aoco, used `transformColumnEncodingAocoRootPartition` to
16911691
* pass encoding clause in root partition. The logic in that method is
16921692
* relate to aoco that means it only validate and pass the aoco encoding
16931693
* clause options. So we have to give up pass root partition encoding

src/include/access/reloptions.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ extern List *transformColumnEncoding(const TableAmRoutine *tam, Relation rel, Li
306306
List *stenc, List *withOptions, List *parentenc,
307307
bool explicitOnly, bool createDefaultOne, bool appendonly);
308308

309-
List* transfromColumnEncodingAocoRootPartition(List *colDefs, List *stenc, List *withOptions, bool errorOnEncodingClause);
309+
List* transformColumnEncodingAocoRootPartition(List *colDefs, List *stenc, List *withOptions, bool errorOnEncodingClause);
310310

311311
extern List *transformStorageEncodingClause(List *options, bool validate);
312312
extern List *form_default_storage_directive(List *enc);

0 commit comments

Comments
 (0)