Guard MariaDB 11.3 SQL compatibility when an AI assistant writes, reviews, refactors, or validates SQL in migrations, schema changes, raw query strings, prepared statements, or generated SQL. Use whenever SQL must emit or approve SQL that must run on MariaDB 11.3 and must avoid PostgreSQL, SQL Server, SQLite, Oracle-mode-only, or newer MariaDB 11.6+/12.3+ syntax.
Keep SQL aligned with MariaDB 11.3 syntax and behavior. Prefer documented MariaDB forms, reject version-gated features newer than 11.3, and translate foreign-dialect constructs before finalizing code.
If the host tool does not support native skills, load this file as task instructions and keep the bundled reference and checker available.
python3 scripts/check_mariadb_11_3_sql_compat.py <paths...> on changed SQL-bearing files, or pipe a rendered query to stdin with python3 scripts/check_mariadb_11_3_sql_compat.py -.ANSI_QUOTES is enabled. Do not use square brackets unless the task explicitly says MSSQL mode is enabled.INSERT ... ON DUPLICATE KEY UPDATE or INSERT IGNORE for upsert-style flows. Do not emit PostgreSQL ON CONFLICT.UPDATE table_references SET ... with joins in the table_references section. Do not emit PostgreSQL UPDATE ... FROM.WITH ... SELECT for CTE reads. Do not emit WITH ... UPDATE or WITH ... DELETE; those are newer than MariaDB 11.3.DELETE FROM tbl AS t ...; that form is only documented from MariaDB 11.6. Rewrite to unaliased single-table delete or multi-table delete syntax.AUTO_INCREMENT or SERIAL; do not assume PostgreSQL GENERATED ... AS IDENTITY.JSON as MariaDB's alias type, not MySQL's binary JSON implementation.The checker lives at scripts/check_mariadb_11_3_sql_compat.py.
It currently flags high-signal patterns that regularly leak in from other dialects:
ON CONFLICTUPDATE ... FROMWITH ... UPDATEWITH ... DELETEDELETE FROM ... AS alias::typeThe checker does not prove correctness. If the SQL is generated dynamically, validate the final rendered SQL, not just the template fragment.
Read references/mariadb-11-3-compatibility.md when you need:
JSON, UUID, AUTO_INCREMENT, or SERIALSQL_MODE and the task does not specify it, assume MariaDB 11.3 with the default sql_mode documented by MariaDB.