Firebird: Data type & value handler improvements (BLOB, DECFLOAT, INT128, TIME ZONE, BINARY)
- Dominant language
- Java
- Stars
- 51.8k
- Forks
- 4.4k
- Avg merge
- 3d 13h
- Merged PRs (30d)
- 183
Description
## Tasks
- ➖ **`FireBirdBlobValueHandler`** — Sub-typed BLOB handling. Firebird BLOBs have sub-types: 0=binary, 1=text, 2=BLR, etc. SUB_TYPE 1 (TEXT) should be treated as CLOB. Currently uses generic blob handling.
- ➖ **`FireBirdDateTimeValueHandler`** — WITH TIME ZONE support. Firebird 4.0 introduced `TIME WITH TIME ZONE` and `TIMESTAMP WITH TIME ZONE`. Need proper time zone handling. Reference: `PostgreDateTimeValueHandler`.
- ➖ **`DECFLOAT` value handler** — Firebird 4.0 introduced `DECFLOAT(16)` and `DECFLOAT(34)` (IEEE 754 decimal). Two bugs: (a) The enum has `DECFLOAT(11, Types.FLOAT, ...)` but Firebird type ID 11 does not exist — the actual metadata type IDs are **24** for `DECFLOAT(16)` and **25** for `DECFLOAT(34)` (confirmed via `RDB$FIELDS.RDB$FIELD_TYPE`). The enum needs TWO entries: `DECFLOAT16(24, ...)` and `DECFLOAT34(25, ...)`. (b) The Java SQL type `Types.FLOAT` loses decimal precision — should map to `Types.NUMERIC` or `Types.DECIMAL` with `BigDecimal` handling.
- ➖ **`INT128` value handler** — Firebird 4.0's `INT128` is mapped to `Types.BIGINT` which overflows (64-bit max). The internal type ID (26) is correct in the enum. Should map to `Types.NUMERIC` with `BigInteger` or `BigDecimal`.
- ➖ **`BOOLEAN` value handler** — Currently using generic handler. Verify correct TRUE/FALSE/UNKNOWN (Firebird supports SQL three-valued logic).
- ➖ **`VARBINARY`/`BINARY` type support** — Firebird 4.0 introduced `BINARY(n)` and `VARBINARY(n)` aliases. However, they share type IDs with `CHAR`/`VARCHAR` (14/37) in `RDB$FIELDS` — they are distinguished by `RDB$FIELD_SUB_TYPE = 1` and `RDB$CHARACTER_SET_ID = 1` (OCTETS charset). They CANNOT be added as separate enum entries with new type IDs. Instead, the `getById()` method (and callers) must be extended to accept charset/subtype info and return BINARY/VARBINARY variants for type 14/37 with sub_type=1, charset=OCTETS.
- ➖ **Register `FireBirdValueHandlerProvider` in plugin.xml** — Add `dataTypeProvider` extension with Firebird-specific value handlers. Reference: `MySQLValueHandlerProvider`, `PostgreValueHandlerProvider`.
Part of epic #40664.
Contributor guide
Assessment
This issue has not been assessed yet.