On 2019-03-04 19:46, Lester Caine wrote:
On 04/03/2019 17:01, Mark Rotteveel wrote:
Interesting bit of information: in the wire protocol, the time zone id is encoded as a signed short, which results in for example Europe/Moscow (id = 65064 or 0xFE28) being encoded as bytes 0xFFFFFE28 due to sign-extension, in little-endian native, the buffer has 0x28FE0000. This suggests that native only uses two bytes plus two padding bytes.

It is only 16 bits ... It's restricted to minute accuracy on a fixed
offset so is no use for storing mean time offsets which are in
seconds, and the TZ identifiers are just an offset from the 1440
minute fixed offset.

And that is not the point of this thread. I know it is a 16 bit unsigned short inside Firebird, and I know how the value works.

My question is about the **encoding** in the data buffer obtained from the native client. I want to avoid incorrectly implementing the support in Jaybird. And FYI, In the wire protocol 16 bit integers are encoded as 32 bit integers, and the length of the buffer from fbclient (12 instead of 10 bytes for TIMESTAMP WITH TIME ZONE) seemed to suggest it is in native as well. However as I said in my reply above, it probably is just padded to a multiple of 4.

Mark


Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to