Re: DataRow Null values Frontend/Backend Protocol TCP/IP

From: Raimon Fernandez <coder(at)montx(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: DataRow Null values Frontend/Backend Protocol TCP/IP
Date: 2009-11-02 09:21:21
Message-ID: 02141AA5-EBDC-4B0D-89F9-C9F11F4BC69C@montx.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-interfaces

Here I'm again ...

I'm parsing the DataRow(B), and I'm having problems with NULL values.

In the docs I can read they have a -1 value, an no bytes follow them
for the value.

But I'm getting a 1020 value instead of -1

Int32 The length of the column value, in bytes (this count does not
include itself). Can be zero.
As a special case, -1 indicates a NULL column value. No value bytes
follow in the NULL case.

byte 1: 255 &HFF
byte 2: 255 &HFF
byte 3: 255 &HFF
byte 4: 255 &HFF
-----------------
1020 decimal or

&HFFFFFFFF 4294967295

but never -1

If I change my code to be aware of the 1020 instead of -1, I can
extract the next field/values without problems.

thanks,

regards,

raimon

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bernard Grosperrin 2009-11-02 09:29:12 Re: Error on compile for Windows
Previous Message Raimon Fernandez 2009-11-02 09:15:55 Re: Cancelling Requests Frontend/Backend Protocol TCP/IP

Browse pgsql-interfaces by date

  From Date Subject
Next Message Craig Ringer 2009-11-02 09:29:28 Re: Cancelling Requests Frontend/Backend Protocol TCP/IP
Previous Message Raimon Fernandez 2009-11-02 09:15:55 Re: Cancelling Requests Frontend/Backend Protocol TCP/IP