You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Two pieces of issue 05 (P2 expression and type semantics) that the
prior session had ready in the working tree:
CHAR_LENGTH (string.h, function_registry.cpp)
Was previously aliased to LENGTH (byte length). MySQL semantics
require CHAR_LENGTH to count UTF-8 code points. Adds
utf8_codepoint_count helper that walks the bytes and counts every
non-continuation byte (high two bits != 10), and a dedicated
fn_char_length wired into the registry. LENGTH stays at byte count.
Cast targets (cast.h)
PostgreSQL bool string casts now also recognise the canonical
'on' / 'off' tokens alongside true/t/1/yes and false/f/0/no.
CAST AS DATE / TIME / DATETIME / TIMESTAMP from STRING was not
implemented (returned NULL). Each now parses the string through
datetime_parse with a stack buffer NUL-terminator so values like
'2026-04-18' or '2026-04-18 14:30:00' coming from a remote
PostgreSQL backend can be CAST cleanly inside the engine. TIMESTAMP
uses parse_datetime_tz so timezone-bearing literals are normalised
to UTC consistently with PgSQLRemoteExecutor.
CAST AS DOUBLE from TAG_DECIMAL is now supported (was STRING-only).
Tests:
- tests/test_string_funcs.cpp: CHAR_LENGTH UTF-8 cases (single-byte,
two-byte Latin, three-byte CJK, four-byte emoji), plus regression
that LENGTH still returns bytes.
- tests/test_cast.cpp: PostgreSQL string -> bool 'on'/'off',
string -> date/time/datetime/timestamp happy paths and malformed
inputs returning NULL.
Verification:
- make test: 1208 passed, 37 skipped (live-backend), 0 failed.
Issue 05 is still partial: tuple/array support (now landed in
a90d147), composite field access (a90d147), CHAR_LENGTH UTF-8 (here),
PostgreSQL bool/date/time casts (here). Remaining: non-literal
arrays end-to-end, decimal as int128, string-backed decimals beyond
the cast path. Those are tracked under issue 05 separately.
0 commit comments