Re: Increase pltcl test coverage

From: Jim Nasby <Jim(dot)Nasby(at)BlueTreble(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>, Karl Lehenbauer <karl(at)flightaware(dot)com>
Subject: Re: Increase pltcl test coverage
Date: 2017-01-09 00:21:36
Message-ID: e1d4ff4a-5bfe-c462-5f8e-d072d39a3be3@BlueTreble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 1/8/17 11:25 AM, Tom Lane wrote:
> But I don't understand
> how you got the sample output shown in the patch. Is this based
> on some unsubmitted changes in pltcl's error handling?

AFAICT you've got everything. What I had on my end is:

create function public.tcl_error_handling_test(text)
returns text
language pltcl
as $function$
if {[catch $1 err]} {
# Set keys that will change over time to fixed values
array set myArray $::errorCode
set myArray(funcname) "'funcname'"
set myArray(lineno) 'lineno'
set myArray(POSTGRES) 'POSTGRES'

# Format into something nicer
set vals []
foreach {key} [lsort [array names myArray]] {
set value [string map {"\n" "\n\t"} $myArray($key)]
lappend vals "$key: $value"
}
return [join $vals "\n"]
} else {
return "no error"
}
$function$
;

Maybe it's a version difference?

echo 'puts [info patchlevel];exit 0' | tclsh
8.6.6

Anyway, attached is a complete new patch that fixes that issue (and a
couple test diffs I missed :/), as well as the utf_e2u issue you
discovered. I've applied this patch to master via git apply and run it
through make check-world, so hopefully this puts the horse out to pasture.
--
Jim Nasby, Data Architect, Blue Treble Consulting, Austin TX
Experts in Analytics, Data Architecture and PostgreSQL
Data in Trouble? Get it in Treble! http://BlueTreble.com
855-TREBLE2 (855-873-2532)

Attachment Content-Type Size
pltcl_coverage_3.patch text/plain 30.2 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jim Nasby 2017-01-09 00:27:42 Re: createdb warnings on OS X
Previous Message Jim Nasby 2017-01-09 00:21:07 Re: RustgreSQL