Skip to content

Commit c6cb7d5

Browse files
committed
fix oversight - nested datum is in d2 variable (not in d)
1 parent 47f6cbd commit c6cb7d5

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/format.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -371,12 +371,13 @@ plpgsql_check_prepare_err_text_with_target_vardecl(PLpgSQL_checkstate *cstate, P
371371
{
372372
/* try to enumerate fields */
373373
PLpgSQL_row *row = (PLpgSQL_row *) var;
374-
PLpgSQL_datum *d2;
375374
int fnum;
376375
bool is_first = true;
377376

378377
for (fnum = 0; fnum < row->nfields; fnum++)
379378
{
379+
PLpgSQL_datum *d2;
380+
380381
/* skip dropped columns */
381382
if (row->varnos[fnum] < 0)
382383
continue;
@@ -396,7 +397,7 @@ plpgsql_check_prepare_err_text_with_target_vardecl(PLpgSQL_checkstate *cstate, P
396397
{
397398
appendStringInfo(&str, "%s", ((PLpgSQL_variable *) d2)->refname);
398399
}
399-
else if (d->dtype == PLPGSQL_DTYPE_RECFIELD)
400+
else if (d2->dtype == PLPGSQL_DTYPE_RECFIELD)
400401
{
401402
PLpgSQL_recfield *recfield = (PLpgSQL_recfield *) d2;
402403
PLpgSQL_variable *var2 = (PLpgSQL_variable *) cstate->estate->datums[recfield->recparentno];

0 commit comments

Comments
 (0)