Re: NaN/Inf fix for ECPG Re: out-of-scope cursor errors

From: Michael Meskes <meskes(at)postgresql(dot)org>
To: Boszormenyi Zoltan <zb(at)cybertec(dot)at>
Cc: Michael Meskes <meskes(at)postgresql(dot)org>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: NaN/Inf fix for ECPG Re: out-of-scope cursor errors
Date: 2010-02-02 14:15:22
Message-ID: 20100202141522.GA31552@feivel.credativ.lan
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 line 39: 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 line 39: 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 line 39: 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_execute on 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 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 = -Infinity
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on 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(at)jabber(dot)org
VfL Borussia! Força Barça! Go SF 49ers! Use Debian GNU/Linux, PostgreSQL

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Boszormenyi Zoltan 2010-02-02 14:34:24 Re: NaN/Inf fix for ECPG Re: out-of-scope cursor errors
Previous Message Albe Laurenz 2010-02-02 09:13:42 Re: PG 9.0 and standard_conforming_strings