Common SQL Errors

MySQL Error 3005: ER_WARN_LEGACY_SYNTAX_CONVERTED - How to Fix Legacy Syntax Conversion Warnings

Galaxy Team
August 8, 2025

MySQL raises warning 3005 ER_WARN_LEGACY_SYNTAX_CONVERTED when it rewrites deprecated legacy SQL syntax to modern syntax during statement execution.

Sign up for the latest in common SQL errors from the Galaxy Team!
Welcome to the Galaxy, Guardian!
You'll be receiving a confirmation email

Follow us on twitter :)
Oops! Something went wrong while submitting the form.

What is MySQL error 3005 (ER_WARN_LEGACY_SYNTAX_CONVERTED)?

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.

Error Highlights

Typical Error Message

ER_WARN_LEGACY_SYNTAX_CONVERTED

Error Type

Deprecation Warning

Language

MySQL

Symbol

%s.

Error Code

3005

SQL State

HY000

Explanation

Table of Contents

What is MySQL error 3005 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.

What Causes This Error?

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.

How to Fix ER_WARN_LEGACY_SYNTAX_CONVERTED

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.

Common Scenarios and Solutions

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.

Best Practices to Avoid This Error

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.

Related Errors and Solutions

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.

Common Causes

Comma-separated joins with WHERE filters

Using old implicit joins forces MySQL to rewrite the query as explicit INNER or LEFT JOIN clauses, producing warning 3005.

TYPE keyword in CREATE TABLE

Specifying TYPE=InnoDB or TYPE=MyISAM is obsolete. MySQL converts it to ENGINE and issues the legacy syntax warning.

Old outer-join operator (+)

Ported code from Oracle that retains the (+) syntax is silently converted to LEFT JOIN, triggering the warning.

Deprecated LOCK IN SHARE MODE

MySQL 8.0 replaces SHARE MODE with LOCK SHARE. The server rewrites and warns when older syntax is used.

Related Errors

ER_DEPRECATED_SYNTAX_WITH_VERIFY (3010)

Warns that deprecated syntax is present and might change behavior. Unlike 3005, no automatic conversion occurs.

Syntax Error 1064

Indicates unrecognized SQL syntax that MySQL cannot parse. Requires immediate correction.

ER_WARN_DEPRECATED_SYNTAX (1287)

General warning for deprecated features. Similar to 3005 but without automatic rewrite.

FAQs

Does error 3005 stop my query from running?

No. MySQL executes the converted statement. The warning alerts you that your original SQL is outdated.

Will future MySQL versions remove automatic conversion?

Yes. Deprecated syntax is eventually dropped entirely, so relying on conversion is risky.

How can I detect warnings in my application?

Enable the client library's warning retrieval API, or run SHOW WARNINGS after each statement during testing.

Can Galaxy help me avoid this warning?

Galaxy's AI copilot suggests modern ANSI-compliant SQL and flags deprecated constructs in real time, reducing the chance of hitting error 3005.

Start Querying with the Modern SQL Editor Today!
Welcome to the Galaxy, Guardian!
You'll be receiving a confirmation email

Follow us on twitter :)
Oops! Something went wrong while submitting the form.

Check out some other errors

Trusted by top engineers on high-velocity teams
Aryeo Logo
Assort Health
Curri
Rubie Logo
Bauhealth Logo
Truvideo Logo