Commit dfcc46fe authored by Tom Lane's avatar Tom Lane

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 bbd5c207; backpatch to v12 where that came in.

Pavel Stehule

Discussion: https://postgr.es/m/CAFj8pRDXyQaJmpotNTQVc-t-WxdWZC35V2PnmwOaV1-taidFWA@mail.gmail.com
parent 5c0f7cc5
...@@ -1341,7 +1341,6 @@ stmt_for : opt_loop_label K_FOR for_control loop_body ...@@ -1341,7 +1341,6 @@ stmt_for : opt_loop_label K_FOR for_control loop_body
new = (PLpgSQL_stmt_fori *) $3; new = (PLpgSQL_stmt_fori *) $3;
new->lineno = plpgsql_location_to_lineno(@2); new->lineno = plpgsql_location_to_lineno(@2);
new->stmtid = ++plpgsql_curr_compile->nstatements;
new->label = $1; new->label = $1;
new->body = $4.stmts; new->body = $4.stmts;
$$ = (PLpgSQL_stmt *) new; $$ = (PLpgSQL_stmt *) new;
...@@ -1356,7 +1355,6 @@ stmt_for : opt_loop_label K_FOR for_control loop_body ...@@ -1356,7 +1355,6 @@ stmt_for : opt_loop_label K_FOR for_control loop_body
/* forq is the common supertype of all three */ /* forq is the common supertype of all three */
new = (PLpgSQL_stmt_forq *) $3; new = (PLpgSQL_stmt_forq *) $3;
new->lineno = plpgsql_location_to_lineno(@2); new->lineno = plpgsql_location_to_lineno(@2);
new->stmtid = ++plpgsql_curr_compile->nstatements;
new->label = $1; new->label = $1;
new->body = $4.stmts; new->body = $4.stmts;
$$ = (PLpgSQL_stmt *) new; $$ = (PLpgSQL_stmt *) new;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment