Open
Description
Bug Report
Q | A |
---|---|
Version | 3.9/4.2 |
Summary
If an index is created with quotes in an Oracle database, Doctrine fails to generate statements with the correct index name.
How to reproduce
Create an index with a quoted name:
CREATE INDEX "idx_test_col" ON "test" ("col")
Then, try to rename or drop the index:
$table->renameIndex('"idx_test_col"', '"idx_test_type"');
// -> ALTER INDEX idx_test_col RENAME TO "idx_test_type"
$table->dropIndex('"idx_test_col"');
// -> DROP INDEX idx_test_col
Because Oracle is case-sensitive and converts unquoted identifiers to upper-case automatically, these statements result in a "index not found" error.
Expected behaviour
Quoted index names must be used in the generated SQL statements:
$table->renameIndex('"idx_test_col"', '"idx_test_type"');
// -> ALTER INDEX "idx_test_col" RENAME TO "idx_test_type"
$table->dropIndex('"idx_test_col"');
// -> DROP INDEX "idx_test_col"