Details
-
New Feature
-
Status: Open (View Workflow)
-
Critical
-
Resolution: Unresolved
-
None
Description
Oracle supports prefixing the index name in CREATE INDEX with the database name, MariaDB does not. For compatibility it would be reasonable to support this syntax, even if it is ignored, in SQL_MODE=Oracle. Two different SQL_MODE options would be reasonable
IGNORE_INDEX_DBNAME - Always ignore the database name.
IGNORE_INDEX_SAMEDBNAME - Ignore database name if it matches the table name, else raise an error.
I agree with what you say, largely, but in the name of compatibility I still think it is reasonable, assuming the sql_mode is set to allow it. It wouldn't be the first piece of, sometimes confusing, syntactic sugar we support. When you export a schema from Oracle using Oracle datapump, which is pretty much standard, then you always get index names prefixed with database names, even if the indexes are in the same database as the table. So this syntax is actually rather common.