Skip to content

Commit

Permalink
Address review on Define colliculocale and daticulocale since they ha…
Browse files Browse the repository at this point in the history
…ve been renamed
  • Loading branch information
naisila committed Oct 16, 2024
1 parent ef60a25 commit 06727b6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
16 changes: 8 additions & 8 deletions src/backend/distributed/commands/collation.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ CreateCollationDDLInternal(Oid collationId, Oid *collowner, char **quotedCollati
* ICU-related field. Only the libc-related fields or the ICU-related field
* is set, never both.
*/
char *colliculocale;
char *colllocale;
bool isnull;

Datum datum = SysCacheGetAttr(COLLOID, heapTuple, Anum_pg_collation_collcollate,
Expand All @@ -101,17 +101,17 @@ CreateCollationDDLInternal(Oid collationId, Oid *collowner, char **quotedCollati
collctype = NULL;
}

datum = SysCacheGetAttr(COLLOID, heapTuple, Anum_pg_collation_colliculocale, &isnull);
datum = SysCacheGetAttr(COLLOID, heapTuple, Anum_pg_collation_colllocale, &isnull);
if (!isnull)
{
colliculocale = TextDatumGetCString(datum);
colllocale = TextDatumGetCString(datum);
}
else
{
colliculocale = NULL;
colllocale = NULL;
}

Assert((collcollate && collctype) || colliculocale);
Assert((collcollate && collctype) || colllocale);
#else

/*
Expand Down Expand Up @@ -147,12 +147,12 @@ CreateCollationDDLInternal(Oid collationId, Oid *collowner, char **quotedCollati
*quotedCollationName, providerString);

#if PG_VERSION_NUM >= PG_VERSION_15
if (colliculocale)
if (colllocale)
{
appendStringInfo(&collationNameDef,
", locale = %s",
quote_literal_cstr(colliculocale));
pfree(colliculocale);
quote_literal_cstr(colllocale));
pfree(colllocale);
}
else
{
Expand Down
5 changes: 2 additions & 3 deletions src/include/pg_version_compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,6 @@ typedef int ObjectClass;
#define OCLASS_AM AccessMethodRelationId
#define OCLASS_TSTEMPLATE TSTemplateRelationId

#define Anum_pg_collation_colliculocale Anum_pg_collation_colllocale
#define Anum_pg_database_daticulocale Anum_pg_database_datlocale

#include "commands/tablecmds.h"

static inline void
Expand Down Expand Up @@ -113,6 +110,8 @@ getStxstattarget_compat(HeapTuple tup)

#else

#define Anum_pg_collation_colllocale Anum_pg_collation_colliculocale

#include "access/htup_details.h"
static inline int32
getAttstattarget_compat(HeapTuple attTuple)
Expand Down

0 comments on commit 06727b6

Please sign in to comment.