Reject zero or negative BY step in plpgsql integer FOR-loops, and behave
authorTom Lane <tgl@sss.pgh.pa.us>
Sun, 15 Jul 2007 02:15:04 +0000 (02:15 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Sun, 15 Jul 2007 02:15:04 +0000 (02:15 +0000)
commitea59ffbdc34a60c8ef5140d4986f5a53e85a3938
treee4bd1d2e7749fa3320d5fed0cde0e3aaeefe4414
parent349846ec925121f33868311bfed4d8327ae2e93c
Reject zero or negative BY step in plpgsql integer FOR-loops, and behave
sanely if the loop value overflows int32 on the way to the end value.
Avoid useless computation of "SELECT 1" when BY is omitted.  Avoid some
type-punning between Datum and int4 that dates from the original coding.
src/pl/plpgsql/src/gram.y
src/pl/plpgsql/src/pl_exec.c
src/pl/plpgsql/src/pl_funcs.c
src/pl/plpgsql/src/plpgsql.h