Skip to content

feat(mariadb): UUID/INET4/INET6 types; reject FOR UPDATE/SHARE OF#318

Open
vsai12 wants to merge 4 commits into
mainfrom
vh/byt-9135-mariadb-uuid-inet-types
Open

feat(mariadb): UUID/INET4/INET6 types; reject FOR UPDATE/SHARE OF#318
vsai12 wants to merge 4 commits into
mainfrom
vh/byt-9135-mariadb-uuid-inet-types

Conversation

@vsai12

@vsai12 vsai12 commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Part of the BYT-9135 MariaDB add-surface. Two fidelity items, container-verified vs mariadb:11.8.8.

Add — UUID / INET4 / INET6 scalar types

Recognised in parseDataType in type position only, by identifier text — so they stay non-reserved (UUID is also a function; INET4/INET6 can be identifiers). Verified intact: UUID() as a function, uuid/inet6 as identifiers, uuid/inet4 as column names.

Fix — reject FOR UPDATE/SHARE ... OF

The OF object list on a locking clause is MySQL-only; MariaDB 11.4 removed it. omni mirrored MySQL and over-accepted it (a parser-fidelity bug). Gated the OF arm to a reject; FOR UPDATE / FOR SHARE without OF are unaffected.

Container verification (mdbcheck vs mariadb:11.8.8)

  • CREATE TABLE t (a UUID), (a INET4, b INET6)AGREE_ACCEPT
  • ... FOR UPDATE OF t, ... FOR SHARE OF tAGREE_REJECT
  • a -> '$.b'OVER (see deferral below)

Deferred (tracked) — JSON -> / ->>

MariaDB has no arrow operators (uses JSON_EXTRACT()/JSON_UNQUOTE()), so omni over-accepts them. The grammar fix is one line, but it ripples into inherited mysql accept-tests (compare_test.go TestParseJson{Extract,UnquoteExtract}) and the routine-body audit — a multi-file cleanup deferred from this surgical arm. Recorded as a fidelity note in expr.go.

Downstream

These flow to Bytebase MariaDB Diagnose (already on omni/mariadb) on a dep bump, zero Bytebase source change — verified end-to-end: CREATE TABLE t (a UUID) goes RED→GREEN in Bytebase Diagnose against pinned vs. this branch.

Tests

TestUUIDInetTypeAccept, TestUUIDInetNonReserved, TestForUpdateOfReject. Full mariadb/parser suite green (-short).

vsai12 added 4 commits June 18, 2026 22:42
MariaDB-only non-reserved scalar types, recognised in type position only (UUID is
also a function; INET4/INET6 usable as identifiers) so the words are not reserved.

Closes part of the BYT-9135 add-surface; flows to bytebase MariaDB Diagnose on a
dep bump (verified end-to-end: CREATE TABLE t (a UUID) RED->GREEN).
The OF object list on a locking clause is MySQL-only; MariaDB 11.4 removed it.
omni mirrored MySQL and over-accepted it — a parser-fidelity bug. Gate the OF arm
to a reject; FOR UPDATE / FOR SHARE (no OF) are unaffected.

Also records a fidelity note in expr.go for the sibling JSON -> / ->> over-accept,
deferred because its grammar one-liner ripples into inherited accept-tests + the
routine-body audit (a multi-file cleanup, out of this surgical arm).
…tory

The JSON arrow prune is deferred (ripples into inherited accept-tests + the
routine-body audit). Pin the two over-accepts in subtractiveDivergences +
categoryCaseSQLs so the inventory gate stays honest and the finding is tracked,
not floating. Container-verified OVER vs mariadb:11.8.8 (TestMariaDBDivergenceInventory green).
The parser now rejects FOR UPDATE/SHARE ... OF (MariaDB 11.4 removal), so the
deparse round-trip fixture for it no longer parses (deparse_test.go). Remove the
fixture and the now-dead OF-emission in deparseForUpdate, so parse and deparse
stay consistent — neither supports FOR UPDATE OF.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant