postgres.git / summary / log / commit / refs

commit    0fe8b1f7d48ed2d5f50d6583481f70d2ebf2a073
Author:   Tom Lane <tgl@sss.pgh.pa.us>
Date:     Tue Feb 02 19:35:12 2021 +0000
First released in: 14.0, 12.6, 13.2

    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 bbd5c207b; backpatch to v12 where that came in.
    
    Pavel Stehule
    
    Discussion: https://postgr.es/m/CAFj8pRDXyQaJmpotNTQVc-t-WxdWZC35V2PnmwOaV1-taidFWA@mail.gmail.com


src/pl/plpgsql/src/pl_gram.y | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/pl/plpgsql/src/pl_gram.y b/src/pl/plpgsql/src/pl_gram.y index 5a7e1a44442..3e84162487c 100644 --- a/src/pl/plpgsql/src/pl_gram.y +++ b/src/pl/plpgsql/src/pl_gram.y @@ -1304,7 +1304,6 @@ stmt_for : opt_loop_label K_FOR for_control loop_body new = (PLpgSQL_stmt_fori *) $3; new->lineno = plpgsql_location_to_lineno(@2); - new->stmtid = ++plpgsql_curr_compile->nstatements; new->label = $1; new->body = $4.stmts; $$ = (PLpgSQL_stmt *) new; @@ -1319,7 +1318,6 @@ stmt_for : opt_loop_label K_FOR for_control loop_body /* forq is the common supertype of all three */ new = (PLpgSQL_stmt_forq *) $3; new->lineno = plpgsql_location_to_lineno(@2); - new->stmtid = ++plpgsql_curr_compile->nstatements; new->label = $1; new->body = $4.stmts; $$ = (PLpgSQL_stmt *) new; [parent: 586891394344]