Re: DataRow Null values Frontend/Backend Protocol TCP/IP - Mailing list pgsql-general

From Raimon Fernandez
Subject Re: DataRow Null values Frontend/Backend Protocol TCP/IP
Date
Msg-id 02141AA5-EBDC-4B0D-89F9-C9F11F4BC69C@montx.com
Whole thread Raw
In response to Re: Implementing Frontend/Backend Protocol TCP/IP  (Raimon Fernandez <coder@montx.com>)
Responses Re: DataRow Null values Frontend/Backend Protocol TCP/IP  (Craig Ringer <craig@postnewspapers.com.au>)
Re: DataRow Null values Frontend/Backend Protocol TCP/IP  (Alban Hertroys <dalroi@solfertje.student.utwente.nl>)
List pgsql-general
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


pgsql-general by date:

Previous
From: Raimon Fernandez
Date:
Subject: Re: Cancelling Requests Frontend/Backend Protocol TCP/IP
Next
From: "Bernard Grosperrin"
Date:
Subject: Re: Error on compile for Windows