Bruce, after checking the libecpg source i'm fairly sure the problem
is due to the malloc buffer that the float is being sprintf'd into
being too small... It is always allocated 20 bytes but with a %.14g
printf specifier -6e-06 results in 20 characters:
-6.0e-06
and the NULL goes...
OK, I have reproduced the problem on my machine:
#$ ./a.out floattest
col1: -0.06
*!*!* Error -220: No such connection NULL in line 21.
Wow, how did that "A" get into the query string:
insert into tab1 ( col1 ) values ( -6.002122251e-06A )
Quite str
Bruce, the attached source reproduces this on 7.2, I don't have a
later version at hand to test if it's been fixed:
createdb floattest
echo "CREATE TABLE tab1(col1 FLOAT);" | psql floattest
ecpg insert-float.pgc
gcc insert-float.c -lecpg -lpq
./a.out floattest
results in:
col1: -0.06
Has this been addressed? Can you supply a reproducable example?
---
Edward Pilipczuk wrote:
> On Monday, 22 April 2002 18:41, you wrote:
> > Edward ([EMAIL PROTECTED]) reports a bug with a severity of 1
> > The lower the n
On Monday, 22 April 2002 18:41, you wrote:
> Edward ([EMAIL PROTECTED]) reports a bug with a severity of 1
> The lower the number the more severe it is.
>
> Short Description
> ECPG: inserting float numbers
>
> Long Description
> Inserting records with single precision real variables having small
Edward ([EMAIL PROTECTED]) reports a bug with a severity of 1
The lower the number the more severe it is.
Short Description
ECPG: inserting float numbers
Long Description
Inserting records with single precision real variables having small value (range
1.0e-6 or less) frequently results in error