Re: New libpq based driver snapshot 08.01.0003 available

From: "Dave Page" <dpage(at)vale-housing(dot)co(dot)uk>
To: "Zoltan Boszormenyi" <zboszor(at)dunaweb(dot)hu>
Cc: <pgsql-odbc(at)postgresql(dot)org>
Subject: Re: New libpq based driver snapshot 08.01.0003 available
Date: 2005-08-04 07:38:05
Message-ID: E7F85A1B5FF8D44C8A1AF6885BC9A0E4AC97A9@ratbert.vale-housing.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-odbc

> -----Original Message-----
> From: Zoltan Boszormenyi [mailto:zboszor(at)dunaweb(dot)hu]
> Sent: 03 August 2005 19:08
> To: Dave Page
> Cc: pgsql-odbc(at)postgresql(dot)org
> Subject: Re: [ODBC] New libpq based driver snapshot
> 08.01.0003 available
>
> I got these on compiling the latest CVS
> using the RedHat RawHide src.rpm environment:

<snip>
>
> You guessed right, 64 bit system, FC3/x86-64.

Well, I guessed 64 bit at least :-) I have an x86-64 FC4 box kicking
around so I'll look into this.

> I used NULL as the last parameter of SQLBindCol() for every fields
> meaning I don't care to be notified about NULL values.
>
> Last thing I tried was to use 3 SQLINTEGER for the 3 fields that may
> have NULL values and use &null_val1, etc. as the last parameter
> for SQLBindCol(). And it finally fixed it, I get all the rows that
> e.g. psql produce for the same query.
>
> I looked quickly at the sources and copy_and_convert_field() in
> convert.c has this at line 481:
>
> -----------------------------------------------
> if (!value)
> {
> /*
> * handle a null just by returning SQL_NULL_DATA in
> pcbValue, and
> * doing nothing to the buffer.
> */
> if (pcbValue)
> {
> *((SDWORD *) pcbValueBindRow) =
> SQL_NULL_DATA;
> return COPY_OK;
> }
> else
> {
> SC_set_error(stmt,
> STMT_RETURN_NULL_WITHOUT_INDICATOR, "StrLen_or_IndPtr was a
> null pointer
> and NULL data was retrieved");
> SC_log_error(func, "", stmt);
> return SQL_ERROR;
> }
> }
> -----------------------------------------------

This is correct from my reading of the spec - specifically, it says:

"If StrLen_or_IndPtr is a null pointer, no length or indicator value is
used. This is an error when fetching data and the data is NULL."

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odbc/ht
m/odbcsqlbindcol.asp

Regards, Dave

Responses

Browse pgsql-odbc by date

  From Date Subject
Next Message Dave Page 2005-08-04 08:07:20 Re: Usind database with encoding UNICODE and vovel
Previous Message Josef Springer 2005-08-04 06:04:28 Re: Usind database with encoding UNICODE and vovel