summaryrefslogtreecommitdiff
path: root/doc/src
diff options
context:
space:
mode:
authorTom Lane2007-02-08 18:37:30 +0000
committerTom Lane2007-02-08 18:37:30 +0000
commitfe796ea8acccdfcff37f7db87e8ba4822dae425d (patch)
treecb2c87924c57c9e428c2115a7b3f75cc4744adf8 /doc/src
parent7ad33cebfdb7523642e5efff133f743fbb1947bb (diff)
Fix an ancient logic error in plpgsql's exec_stmt_block: it thought it could
get away with not (re)initializing a local variable if the variable is marked "isconst" and not "isnull". Unfortunately it makes this decision after having already freed the old value, meaning that something like for i in 1..10 loop declare c constant text := 'hi there'; leads to subsequent accesses to freed memory, and hence probably crashes. (In particular, this is why Asif Ali Rehman's bug leads to crash and not just an unexpectedly-NULL value for SQLERRM: SQLERRM is marked CONSTANT and so triggers this error.) The whole thing seems wrong on its face anyway: CONSTANT means that you can't change the variable inside the block, not that the initializer expression is guaranteed not to change value across successive block entries. Hence, remove the "optimization" instead of trying to fix it.
Diffstat (limited to 'doc/src')
0 files changed, 0 insertions, 0 deletions