Skip to content

Commit

Permalink
[#25340] YSQL: Init primaryKeyIndex value in a correct point
Browse files Browse the repository at this point in the history
Summary:
Fix YB_TODO: initialize `tbinfo->primaryKeyIndex` in a correct point in the code.
Initialize the value where other values in the structure are being initialized.

Test Plan: Jenkins

Reviewers: mihnea, yguan

Reviewed By: yguan

Subscribers: yql

Differential Revision: https://phorge.dev.yugabyte.com/D40734
  • Loading branch information
OlegLoginov committed Dec 17, 2024
1 parent 4ec2b51 commit bbb1db7
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions src/postgres/src/bin/pg_dump/pg_dump.c
Original file line number Diff line number Diff line change
Expand Up @@ -8412,14 +8412,6 @@ getTableAttrs(Archive *fout, TableInfo *tblinfo, int numTables)
if (!tbinfo->interesting)
continue;

#ifdef YB_TODO
/*
* - Postgres now initialize tbinfo later in this function and not in this loop.
* - Move this code further down where appropriate.
*/
tbinfo->primaryKeyIndex = NULL;
#endif

/* OK, we need info for this table */
if (tbloids->len > 1) /* do we have more than the '{'? */
appendPQExpBufferChar(tbloids, ',');
Expand Down Expand Up @@ -8595,6 +8587,7 @@ getTableAttrs(Archive *fout, TableInfo *tblinfo, int numTables)
tbinfo->notnull = (bool *) pg_malloc(numatts * sizeof(bool));
tbinfo->inhNotNull = (bool *) pg_malloc(numatts * sizeof(bool));
tbinfo->attrdefs = (AttrDefInfo **) pg_malloc(numatts * sizeof(AttrDefInfo *));
tbinfo->primaryKeyIndex = NULL;
hasdefaults = false;

for (int j = 0; j < numatts; j++, r++)
Expand Down

0 comments on commit bbb1db7

Please sign in to comment.