]> granicus.if.org Git - postgresql/commit
Ensure variables live across calls in generate_series(numeric, numeric).
authorFujii Masao <fujii@postgresql.org>
Thu, 18 Dec 2014 12:13:52 +0000 (21:13 +0900)
committerFujii Masao <fujii@postgresql.org>
Thu, 18 Dec 2014 12:13:52 +0000 (21:13 +0900)
commit19e065c0492c34fbccbd2c3707ba68cff14195a3
treef34ea79704758b2adcaf1e8beafc4d77035d2b5a
parentccf292cd2ec16c69ddfee3bf72afe113a7595e00
Ensure variables live across calls in generate_series(numeric, numeric).

In generate_series_step_numeric(), the variables "start_num"
and "stop_num" may be potentially freed until the next call.
So they should be put in the location which can survive across calls.
But previously they were not, and which could cause incorrect
behavior of generate_series(numeric, numeric). This commit fixes
this problem by copying them on multi_call_memory_ctx.

Andrew Gierth
src/backend/utils/adt/numeric.c
src/test/regress/expected/numeric.out
src/test/regress/sql/numeric.sql