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.
Oracle supports the syntax schema_name.index_name because indexes are schema objects. You can also do
And, naturally, index names are unique within a schema.
In MariaDB model an index is an object within a table. You cannot drop an index if you don't know the table name, and a schema can have many indexes with exactly the same name.
We definitely cannot do Oracle-style DROP INDEX and while we can do CREATE INDEX as a syntax sugar, I expect it'd very confusing, because it implies something that MariaDB doesn't do.