mirror of
https://github.com/postgres/postgres.git
synced 2025-08-05 07:41:25 +03:00
In PL/Tcl tests, don't choke if optional error fields are missing.
This fixes a portability issue introduced by commit 961bed020
: with a
compiler that doesn't support PG_FUNCNAME_MACRO, the "funcname" field of
errorCode won't be provided, leading to a failure of the unset command.
I added -nocomplain to the unset commands for filename and lineno too, just
in case, though I know of no platform that wouldn't populate those fields.
(BTW, -nocomplain is new in Tcl 8.4, but fortunately we dropped support
for pre-8.4 Tcl some time ago.)
Per buildfarm member pademelon.
This commit is contained in:
@@ -608,9 +608,9 @@ as $function$
|
|||||||
# Get rid of keys that can't be expected to remain constant
|
# Get rid of keys that can't be expected to remain constant
|
||||||
array set myArray $::errorCode
|
array set myArray $::errorCode
|
||||||
unset myArray(POSTGRES)
|
unset myArray(POSTGRES)
|
||||||
unset myArray(funcname)
|
unset -nocomplain myArray(funcname)
|
||||||
unset myArray(filename)
|
unset -nocomplain myArray(filename)
|
||||||
unset myArray(lineno)
|
unset -nocomplain myArray(lineno)
|
||||||
|
|
||||||
# Format into something nicer
|
# Format into something nicer
|
||||||
set vals []
|
set vals []
|
||||||
|
@@ -653,9 +653,9 @@ as $function$
|
|||||||
# Get rid of keys that can't be expected to remain constant
|
# Get rid of keys that can't be expected to remain constant
|
||||||
array set myArray $::errorCode
|
array set myArray $::errorCode
|
||||||
unset myArray(POSTGRES)
|
unset myArray(POSTGRES)
|
||||||
unset myArray(funcname)
|
unset -nocomplain myArray(funcname)
|
||||||
unset myArray(filename)
|
unset -nocomplain myArray(filename)
|
||||||
unset myArray(lineno)
|
unset -nocomplain myArray(lineno)
|
||||||
|
|
||||||
# Format into something nicer
|
# Format into something nicer
|
||||||
set vals []
|
set vals []
|
||||||
|
Reference in New Issue
Block a user