1718
MariaDBERRORNotableQueryHIGH confidence
Full-text search is not supported in a materialised subquery
Production Risk
Low — query fails; no data affected.
What this means
MATCH() AGAINST() full-text search cannot be used inside a derived table or materialised subquery.
Why it happens
- 1Using MATCH() AGAINST() in a subquery that MySQL materialises as a temporary table.
How to reproduce
trigger — this will error
trigger — this will error
SELECT * FROM (SELECT MATCH(body) AGAINST('keyword') AS score FROM articles) AS sub;expected output
ERROR 1718 (HY000): MATCH is not allowed in this context.
Fix
Move the full-text search to the outer query
Move the full-text search to the outer query
SELECT MATCH(body) AGAINST('keyword') AS score FROM articles WHERE MATCH(body) AGAINST('keyword');Why this works
Full-text search must be applied directly to a base table, not through materialisation.
What not to do
✕
Sources
Official documentation ↗
MySQL 8.0 — 1718 ER_NO_FT_MATERIALIZED_SUBQUERY
Content generated with AI assistance and reviewed for accuracy. Found an error? hello@errcodes.dev