diff options
author | Tom Lane | 2017-01-13 21:59:52 +0000 |
---|---|---|
committer | Tom Lane | 2017-01-13 21:59:52 +0000 |
commit | 5b29e6b688d1e783a098aa24f9e795f8de798a87 (patch) | |
tree | 8cb769a3f8061d85f354af3301f880d90f4d2c4a | |
parent | 7f5b043d69a83e44e22a6b42f902e3e268b80a24 (diff) |
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.
-rw-r--r-- | src/pl/tcl/expected/pltcl_setup.out | 6 | ||||
-rw-r--r-- | src/pl/tcl/sql/pltcl_setup.sql | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/pl/tcl/expected/pltcl_setup.out b/src/pl/tcl/expected/pltcl_setup.out index d0ef3b5f26..e213b94225 100644 --- a/src/pl/tcl/expected/pltcl_setup.out +++ b/src/pl/tcl/expected/pltcl_setup.out @@ -608,9 +608,9 @@ as $function$ # Get rid of keys that can't be expected to remain constant array set myArray $::errorCode unset myArray(POSTGRES) - unset myArray(funcname) - unset myArray(filename) - unset myArray(lineno) + unset -nocomplain myArray(funcname) + unset -nocomplain myArray(filename) + unset -nocomplain myArray(lineno) # Format into something nicer set vals [] diff --git a/src/pl/tcl/sql/pltcl_setup.sql b/src/pl/tcl/sql/pltcl_setup.sql index cda31a9c1c..a8eaba6243 100644 --- a/src/pl/tcl/sql/pltcl_setup.sql +++ b/src/pl/tcl/sql/pltcl_setup.sql @@ -653,9 +653,9 @@ as $function$ # Get rid of keys that can't be expected to remain constant array set myArray $::errorCode unset myArray(POSTGRES) - unset myArray(funcname) - unset myArray(filename) - unset myArray(lineno) + unset -nocomplain myArray(funcname) + unset -nocomplain myArray(filename) + unset -nocomplain myArray(lineno) # Format into something nicer set vals [] |