08.02.2026 18:33, 'Mark Rotteveel' via firebird-devel wrote:
> I was checking how a TIMESTAMP WITH TIME ZONE ended up in an external
> table, and it looks to me like it stores garbage (uninitialized/non-
> zeroed memory?) into the last two bytes after the time zone id/offset.
>
> I guess this will also affect normal tables, but I haven't checked that.
Yes, it does.
> This seems a bug to me, but before I enter this into the tracker, is
> that correct, or am I missing something?
Maybe not really a bug, but something sub-optimal -- as it does not
affect anything except storage size.
In C++, sizeof(ISC_TIME_TZ) == 8 and sizeof(ISC_TIMESTAMP_TZ) == 12, so
both have 2 bytes stored but unused. They're not explicitly zeroed,
because from the engine POV they're part of the data value, although
internally this is just a padding -- but this is a purely compiler
thing. Whether it contains garbage or zeroes is IMHO just a matter of
luck. But whatever bytes are found in the tail, they're ignored and do
not affect the stored value.
Dmitry