3646
MariaDBERRORNotableQueryHIGH confidence

Data type not allowed in JSON_TABLE column

Production Risk

Low — Query fails at parse time.

How to reproduce
trigger — this will error
trigger — this will error
SELECT * FROM JSON_TABLE('[{"a":"text"}]', '$[*]' COLUMNS (v BLOB PATH '$.a')) jt;

expected output

ERROR 3646 (HY000): Data type not allowed in JSON_TABLE column definition.

Fix

Use VARCHAR instead

Use VARCHAR instead
SELECT * FROM JSON_TABLE('[{"a":"text"}]', '$[*]' COLUMNS (v VARCHAR(1000) PATH '$.a')) jt;

Why this works

Uses a supported string type for the JSON_TABLE column.

What not to do

Version notes

Sources
Official documentation ↗

MySQL 8.0 — 3646 ER_JSON_TABLE_FIELD_TYPE_NOT_ALLOWED

Content generated with AI assistance and reviewed for accuracy. Found an error? hello@errcodes.dev

← All MariaDB errors