MySQL raises ER_JSON_VACUOUS_PATH (error 3153) when the JSON path expression is a lone $ symbol, which is disallowed outside SELECT projections.
ER_JSON_VACUOUS_PATH (MySQL error 3153) means the JSON path '$' is used where MySQL expects a more specific path. Replace '$' with a valid key or array step, or omit JSON_EXTRACT entirely to fix the issue.
ER_JSON_VACUOUS_PATH
MySQL raises ER_JSON_VACUOUS_PATH when a JSON function receives the bare dollar sign path ( $ ) where a more detailed path is required. The server labels this shorthand as vacuous, meaning it carries no actionable navigation.
The error first appeared in MySQL 5.7.8 and commonly surfaces in JSON_EXTRACT, JSON_SET, JSON_REMOVE, or CHECK constraints that reference JSON columns.
The primary trigger is using '$' on its own inside JSON path arguments. MySQL expects at least one key, array index, or wildcard after the root token when the path sits in a WHERE clause, UPDATE assignment, or constraint.
It can also occur when a generated column or view definition includes JSON_EXTRACT(col, '$') instead of selecting the column directly.
Identify every JSON function call that passes '$'. Decide whether you truly need JSON_EXTRACT. If you intended to return the whole document, drop the function and reference the column name directly.
If you meant to fetch a key, change '$' to '$.key_name' or '$[index]'. Validate path syntax with JSON_VALID before deploying.
CHECK constraint failure - Replace JSON_EXTRACT(data,'$') IS NOT NULL with data IS NOT NULL.
WHERE filter typo - Change WHERE JSON_EXTRACT(meta,'$') = 1 to WHERE meta = 1 or WHERE JSON_EXTRACT(meta,'$.flag') = 1.
UPDATE misuse - Switch JSON_SET(info,'$','value') to JSON_SET(info,'$.field','value').
Always include a key or array step after '$' when you need partial extraction. Lint new SQL with automated tests that reject vacuous paths.
Store entire JSON blobs only when necessary; prefer normalized columns for frequently accessed fields to reduce JSON_EXTRACT usage.
Error 3143 ER_INVALID_JSON_PATH - Raised for syntactically invalid paths. Fix by following MySQL JSON path grammar.
Error 3144 ER_INVALID_WINDOWING_EXPRESSION - Unrelated to JSON but often seen in the same complex queries. Review window clauses for frame errors.
Using JSON_EXTRACT(col,'$') in SELECT, WHERE, or CHECK clauses.
Passing '$' to JSON_SET, JSON_INSERT, or JSON_REMOVE during UPDATE statements.
Copying example code that assumes other databases allow the root token alone.
ER_INVALID_JSON_PATH (3143) - Path syntax error, not just vacuous.
ER_INVALID_JSON_CHARSET (3146) - JSON column with non-utf8 character set.
ER_JSON_DOCUMENT_NULL_KEY (3152) - Attempt to use NULL as path key.
Inside SELECT, '$' simply returns the full JSON and is allowed. In WHERE and other expressions MySQL needs a scalar value, so a bare path causes ER_JSON_VACUOUS_PATH.
MariaDB implements JSON differently and may allow '$' in places where MySQL rejects it, so confirm against your version.
No. The restriction exists in all versions since 5.7.8. Rewrite queries instead of relying on an upgrade.
Galaxy highlights JSON path misuse during query linting and suggests valid paths through its AI copilot, reducing runtime errors.