Skip to content

Commit 5b29e6b

Browse files
committed
In PL/Tcl tests, don't choke if optional error fields are missing.
This fixes a portability issue introduced by commit 961bed0: 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.
1 parent 7f5b043 commit 5b29e6b

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/pl/tcl/expected/pltcl_setup.out

+3-3
Original file line numberDiff line numberDiff line change
@@ -608,9 +608,9 @@ as $function$
608608
# Get rid of keys that can't be expected to remain constant
609609
array set myArray $::errorCode
610610
unset myArray(POSTGRES)
611-
unset myArray(funcname)
612-
unset myArray(filename)
613-
unset myArray(lineno)
611+
unset -nocomplain myArray(funcname)
612+
unset -nocomplain myArray(filename)
613+
unset -nocomplain myArray(lineno)
614614

615615
# Format into something nicer
616616
set vals []

src/pl/tcl/sql/pltcl_setup.sql

+3-3
Original file line numberDiff line numberDiff line change
@@ -653,9 +653,9 @@ as $function$
653653
# Get rid of keys that can't be expected to remain constant
654654
array set myArray $::errorCode
655655
unset myArray(POSTGRES)
656-
unset myArray(funcname)
657-
unset myArray(filename)
658-
unset myArray(lineno)
656+
unset -nocomplain myArray(funcname)
657+
unset -nocomplain myArray(filename)
658+
unset -nocomplain myArray(lineno)
659659

660660
# Format into something nicer
661661
set vals []

0 commit comments

Comments
 (0)