MySQL raises warning 3005 ER_WARN_LEGACY_SYNTAX_CONVERTED when it rewrites deprecated legacy SQL syntax to modern syntax during statement execution.
MySQL error 3005 ER_WARN_LEGACY_SYNTAX_CONVERTED appears when the server encounters outdated SQL and silently converts it to supported syntax. Review the warning, update your query to modern syntax (e.g., replace old outer-join comma style with explicit JOIN), and test to avoid future issues.
ER_WARN_LEGACY_SYNTAX_CONVERTED
Error 3005 is a warning, not a hard failure. MySQL emits it when it detects deprecated or removed SQL syntax that it can automatically rewrite to newer syntax. The server executes the converted statement but flags the change so developers know the original code is outdated.
The message text shows which legacy construct was removed and what MySQL used instead. Ignoring the warning can hide behavioral differences and cause future breakage when automatic conversion is dropped in later versions.
The warning is triggered by using SQL forms that MySQL no longer supports, such as comma joins with WHERE conditions, old-style OUTER JOIN operators, TYPE = storage options, or deprecated LOCK syntax. Upgrading to a newer MySQL version exposes legacy code paths that previously executed without notice.
It also appears when tools generate statements targeting older engine features. Continuous integration systems that compile against multiple MySQL versions often surface the warning first.
Locate the statement MySQL converted by checking SHOW WARNINGS immediately after running the query or by reviewing the application log. Rewrite the query to use modern, ANSI-compliant syntax so no conversion is required.
For example, switch comma joins to explicit JOIN ... ON clauses, remove the TYPE keyword from CREATE TABLE, or replace STRAIGHT_JOIN hints with optimizer hints.
Legacy outer joins written as SELECT * FROM a, b WHERE a.id = b.id(+); should be updated to SELECT * FROM a LEFT JOIN b ON a.id = b.id; to eliminate the warning.
Storage engine declarations using TYPE=InnoDB must be modernized to ENGINE=InnoDB. MySQL removed the TYPE option long ago and now silently rewrites it while emitting error 3005.
Consistently test code on the same MySQL major version used in production. Enable sql_mode=STRICT_ALL_TABLES to surface warnings as errors during development and CI.
Adopt a SQL style guide that forbids deprecated constructs and run static analysis or linting tools to detect them before code reaches production.
Error 3010 ER_DEPRECATED_SYNTAX_WITH_VERIFY warns about deprecated syntax that cannot be converted automatically. Error 1064 is a syntax error that stops execution entirely. Addressing warning 3005 early prevents escalation to these more severe errors.
Using old implicit joins forces MySQL to rewrite the query as explicit INNER or LEFT JOIN clauses, producing warning 3005.
Specifying TYPE=InnoDB or TYPE=MyISAM is obsolete. MySQL converts it to ENGINE and issues the legacy syntax warning.
Ported code from Oracle that retains the (+) syntax is silently converted to LEFT JOIN, triggering the warning.
MySQL 8.0 replaces SHARE MODE with LOCK SHARE. The server rewrites and warns when older syntax is used.
Warns that deprecated syntax is present and might change behavior. Unlike 3005, no automatic conversion occurs.
Indicates unrecognized SQL syntax that MySQL cannot parse. Requires immediate correction.
General warning for deprecated features. Similar to 3005 but without automatic rewrite.
No. MySQL executes the converted statement. The warning alerts you that your original SQL is outdated.
Yes. Deprecated syntax is eventually dropped entirely, so relying on conversion is risky.
Enable the client library's warning retrieval API, or run SHOW WARNINGS after each statement during testing.
Galaxy's AI copilot suggests modern ANSI-compliant SQL and flags deprecated constructs in real time, reducing the chance of hitting error 3005.