Re: SQLGetInfo Bug

From: "Dave Page" <dpage(at)vale-housing(dot)co(dot)uk>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: <pgsql-odbc(at)postgresql(dot)org>, "Didier Moens" <moensd(at)xs4all(dot)be>
Subject: Re: SQLGetInfo Bug
Date: 2003-01-02 14:47:41
Message-ID: 03AF4E498C591348A42FC93DEA9661B88547@mail.vale-housing.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-odbc

> -----Original Message-----
> From: Tom Lane [mailto:tgl(at)sss(dot)pgh(dot)pa(dot)us]
> Sent: 02 January 2003 14:36
> To: Dave Page
> Cc: pgsql-odbc(at)postgresql(dot)org; Didier Moens
> Subject: Re: [ODBC] SQLGetInfo Bug
>
>
> "Dave Page" <dpage(at)vale-housing(dot)co(dot)uk> writes:
> > snprintf(tmp, sizeof(tmp) - 1, "%s %s", POSTGRESDRIVERVERSION,
> > conn->pg_version);
>
> > but somewhere along the way garbage is getting appended back on the
> > string returned:
>
> > [328][SQLGetInfo][328]PGAPI_GetInfo: entering...fInfoType=18
> > [328]PGAPI_GetInfo: p='07.02.0005 PostgreSQL 7.3 on
> > i386-redhat-linux-gnu, compiled by GCC i386-redhat-linux-gcc (GCC)
> > 3.2.1 20021207 (Red Hat Linux 8wãF¸8Ù', len=0, value=0, cbMax=0
>
> > I can't see what the heck I've done wrong here. Any ideas?
>
> I think the error is elsewhere, and that the garbage is
> already present in conn->pg_version.

Hi Tom,

The garbage is not there if I use sprintf with a larger size of tmp. I've tried variations of the code to check (without luck) but I assume I'm not somehow knocking the null off the end of the string?

Also of note, is that the logging call from which I'm seeing the garbage occurs before any other manipulation of the string.

Regards, Dave.

Responses

Browse pgsql-odbc by date

  From Date Subject
Next Message Tom Lane 2003-01-02 15:03:12 Re: SQLGetInfo Bug
Previous Message Tom Lane 2003-01-02 14:35:58 Re: SQLGetInfo Bug