Re: NaN/Inf fix for ECPG Re: out-of-scope cursor errors - Mailing list pgsql-hackers

From Michael Meskes
Subject Re: NaN/Inf fix for ECPG Re: out-of-scope cursor errors
Date
Msg-id 20100202141522.GA31552@feivel.credativ.lan
Whole thread Raw
In response to Re: NaN/Inf fix for ECPG Re: out-of-scope cursor errors  (Boszormenyi Zoltan <zb@cybertec.at>)
Responses Re: NaN/Inf fix for ECPG Re: out-of-scope cursor errors
List pgsql-hackers
On Sat, Jan 30, 2010 at 11:09:34AM +0100, Boszormenyi Zoltan wrote:
> After I sent it and reread my mail, I realized that my fix
> wouldn't be enough because of the above: ECPG uses sprintf()
> for float and double, and just like in the backend, a common
> code to send "NaN" and +/- "Infinity" to the server is needed.
> New patch is attached.

Does it work for you? I get regression test failures. Haven't looked into the
function yet though.

***
/home/michael/technik/sources/archive/postgresql/pgsql/src/interfaces/ecpg.nan/test/expected/pgtypeslib-nan_test.stderr
 2010-02-02 14:10:30.000000000 +0100
 
---
/home/michael/technik/sources/archive/postgresql/pgsql/src/interfaces/ecpg.nan/test/results/pgtypeslib-nan_test.stderr
2010-02-02 15:11:17.000000000 +0100
 
***************
*** 38,44 **** [NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: free_params on line 39: parameter 1 = 1 [NO_PID]:
sqlca:code: 0, state: 00000
 
! [NO_PID]: free_params on line 39: parameter 2 = nan [NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: ecpg_execute on
line39: OK: INSERT 0 1 [NO_PID]: sqlca: code: 0, state: 00000
 
--- 38,44 ---- [NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: free_params on line 39: parameter 1 = 1 [NO_PID]:
sqlca:code: 0, state: 00000
 
! [NO_PID]: free_params on line 39: parameter 2 = NaN [NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: ecpg_execute on
line39: OK: INSERT 0 1 [NO_PID]: sqlca: code: 0, state: 00000
 
***************
*** 70,76 **** [NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: free_params on line 39: parameter 1 = 2 [NO_PID]:
sqlca:code: 0, state: 00000
 
! [NO_PID]: free_params on line 39: parameter 2 = inf [NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: ecpg_execute on
line39: OK: INSERT 0 1 [NO_PID]: sqlca: code: 0, state: 00000
 
--- 70,76 ---- [NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: free_params on line 39: parameter 1 = 2 [NO_PID]:
sqlca:code: 0, state: 00000
 
! [NO_PID]: free_params on line 39: parameter 2 = Infinity [NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]:
ecpg_executeon line 39: OK: INSERT 0 1 [NO_PID]: sqlca: code: 0, state: 00000
 
***************
*** 102,108 **** [NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: free_params on line 39: parameter 1 = 3 [NO_PID]:
sqlca:code: 0, state: 00000
 
! [NO_PID]: free_params on line 39: parameter 2 = -inf [NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: ecpg_execute on
line39: OK: INSERT 0 1 [NO_PID]: sqlca: code: 0, state: 00000
 
--- 102,108 ---- [NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: free_params on line 39: parameter 1 = 3 [NO_PID]:
sqlca:code: 0, state: 00000
 
! [NO_PID]: free_params on line 39: parameter 2 = -Infinity [NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]:
ecpg_executeon line 39: OK: INSERT 0 1 [NO_PID]: sqlca: code: 0, state: 00000
 

======================================================================

Michael

-- 
Michael Meskes
Michael at Fam-Meskes dot De, Michael at Meskes dot (De|Com|Net|Org)
Michael at BorussiaFan dot De, Meskes at (Debian|Postgresql) dot Org
ICQ 179140304, AIM/Yahoo/Skype michaelmeskes, Jabber meskes@jabber.org
VfL Borussia! Força Barça! Go SF 49ers! Use Debian GNU/Linux, PostgreSQL


pgsql-hackers by date:

Previous
From: "Albe Laurenz"
Date:
Subject: Re: PG 9.0 and standard_conforming_strings
Next
From: Boszormenyi Zoltan
Date:
Subject: Re: NaN/Inf fix for ECPG Re: out-of-scope cursor errors