Re: [BUGS] Bug #640: ECPG: inserting float numbers

From: Lee Kindness <lkindness(at)csl(dot)co(dot)uk>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Lee Kindness <lkindness(at)csl(dot)co(dot)uk>, meskes(at)postgresql(dot)org, pgsql-hackers(at)postgresql(dot)org, edx(at)astercity(dot)net
Subject: Re: [BUGS] Bug #640: ECPG: inserting float numbers
Date: 2002-06-11 13:30:05
Message-ID: 15621.64349.783645.240661@kelvin.csl.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Bruce, this error and the one in your earlier post are not indicative
of the bug, but rather of the connection failing - looking at the
created ecpgdebug file should confirm this.

I have since compiled 7.3 with the patch locally and cannot recreate
the bug (after messing around with the HBA cfg file - I was getting
the same error as you).

My command line (with 7.3 sitting in /database/pgsql-test on port 5433
and LD_LIBRARY_PATH setup):

/database/pgsql-test/bin/ecpg insert-float.pgc
gcc insert-float.c -I/database/pgsql-test/include -L/database/pgsql-test/lib -lecpg -lpq
./a.out floattest(at)localhost:5433

Regards, Lee Kindness.

Bruce Momjian writes:
> I am now getting this error:
> #$ ./a.out floattest
> col1: -0.000006
> *!*!* Error -220: No such connection NULL in line 21.
> I will wait for Michael to comment on this.
>
> ---------------------------------------------------------------------------
>
> Lee Kindness wrote:
> > Lee Kindness writes:
> > > and the NULL goes... bang! I guess the '-' wasn't factored in and 21
> > > bytes would be enough. Patch against current CVS (but untested):
> >
> > Ooops, a context diff is below...
> >
> > Index: src/interfaces/ecpg/lib/execute.c
> > ===================================================================
> > RCS file: /projects/cvsroot/pgsql/src/interfaces/ecpg/lib/execute.c,v
> > retrieving revision 1.36
> > diff -c -r1.36 execute.c
> > *** src/interfaces/ecpg/lib/execute.c 2002/01/13 08:52:08 1.36
> > --- src/interfaces/ecpg/lib/execute.c 2002/06/11 11:45:35
> > ***************
> > *** 700,706 ****
> > break;
> > #endif /* HAVE_LONG_LONG_INT_64 */
> > case ECPGt_float:
> > ! if (!(mallocedval = ECPGalloc(var->arrsize * 20, stmt->lineno)))
> > return false;
> >
> > if (var->arrsize > 1)
> > --- 700,706 ----
> > break;
> > #endif /* HAVE_LONG_LONG_INT_64 */
> > case ECPGt_float:
> > ! if (!(mallocedval = ECPGalloc(var->arrsize * 21, stmt->lineno)))
> > return false;
> >
> > if (var->arrsize > 1)
> > ***************
> > *** 720,726 ****
> > break;
> >
> > case ECPGt_double:
> > ! if (!(mallocedval = ECPGalloc(var->arrsize * 20, stmt->lineno)))
> > return false;
> >
> > if (var->arrsize > 1)
> > --- 720,726 ----
> > break;
> >
> > case ECPGt_double:
> > ! if (!(mallocedval = ECPGalloc(var->arrsize * 21, stmt->lineno)))
> > return false;
> >
> > if (var->arrsize > 1)

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2002-06-11 13:39:35 Re: tuplesort: unexpected end of data
Previous Message Thomas Lockhart 2002-06-11 13:22:55 Re: Timestamp/Interval proposals: Part 2