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)
commit816ff27f60385d362898d8ac6523f043f888b1f5
tree6805c1226f3c0673e7e59341c19e4409077b42c7
parenta69f9028b573e18f1e8b525dbe0f9fbaac28414c
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