]> granicus.if.org Git - postgresql/commit
Fix GET DIAGNOSTICS for case of assignment to function's first variable.
authorTom Lane <tgl@sss.pgh.pa.us>
Thu, 22 Mar 2012 18:13:17 +0000 (14:13 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Thu, 22 Mar 2012 18:14:11 +0000 (14:14 -0400)
commit543e5ab8be9d10fe3bf28effa2bd929f827d8793
treeccfc9796f3b992a1ce62e936a6138f58473fd341
parent1d058a292c517de63ba29b1ea20ef7819f5a302e
Fix GET DIAGNOSTICS for case of assignment to function's first variable.

An incorrect and entirely unnecessary "safety check" in exec_stmt_getdiag()
caused the code to treat an assignment to a variable with dno zero as a
no-op.  Unfortunately, that's a perfectly valid dno.  This has been broken
since GET DIAGNOSTICS was invented.  It's not terribly surprising that the
bug went unnoticed for so long, since in most cases you probably wouldn't
use the function's first-created variable (normally its first parameter)
as a GET DIAGNOSTICS target.  Nonetheless, it's broken.  Per bug #6551
from Adam Buraczewski.
src/pl/plpgsql/src/pl_exec.c