Skip to content

Commit dfcc46f

Browse files
committed
Remove extra increment of plpgsql's statement counter for FOR loops.
This left gaps in the internal statement numbering, which is not terribly harmful (else we'd have noticed sooner), but it's not great either. Oversight in bbd5c20; backpatch to v12 where that came in. Pavel Stehule Discussion: https://postgr.es/m/CAFj8pRDXyQaJmpotNTQVc-t-WxdWZC35V2PnmwOaV1-taidFWA@mail.gmail.com
1 parent 5c0f7cc commit dfcc46f

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

src/pl/plpgsql/src/pl_gram.y

-2
Original file line numberDiff line numberDiff line change
@@ -1341,7 +1341,6 @@ stmt_for : opt_loop_label K_FOR for_control loop_body
13411341

13421342
new = (PLpgSQL_stmt_fori *) $3;
13431343
new->lineno = plpgsql_location_to_lineno(@2);
1344-
new->stmtid = ++plpgsql_curr_compile->nstatements;
13451344
new->label = $1;
13461345
new->body = $4.stmts;
13471346
$$ = (PLpgSQL_stmt *) new;
@@ -1356,7 +1355,6 @@ stmt_for : opt_loop_label K_FOR for_control loop_body
13561355
/* forq is the common supertype of all three */
13571356
new = (PLpgSQL_stmt_forq *) $3;
13581357
new->lineno = plpgsql_location_to_lineno(@2);
1359-
new->stmtid = ++plpgsql_curr_compile->nstatements;
13601358
new->label = $1;
13611359
new->body = $4.stmts;
13621360
$$ = (PLpgSQL_stmt *) new;

0 commit comments

Comments
 (0)