Doctrine DBAL
  1. Doctrine DBAL
  2. DBAL-802

Tablename quoting not working for ALTER TABLE

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Duplicate
    • Affects Version/s: 2.3.4, 2.4.2
    • Fix Version/s: 2.5
    • Component/s: Platforms
    • Security Level: All

      Description

      I use the orm:schema-tool:update to update the database schema of my model which contains a table with the name "Character".
      Quoting for this table name works without the need to add backticks in foreign key definitions (references `Character`) but "ALTER Character" misses the quotes.
      The reason is that the getAlterTableSQL method of the MySqlPlatform class uses the name property of the supplied TableDiff which does not contain a quoted name.
      The original Table information that contained the quoting information is not available from the TableDiff.

      A quick fix is to just force a name quoting with "$this->quoteIdentifier($diff->name)" in the getAlterTableSQL but this does ignore all quoting-decision-functionality of doctrine.

        Issue Links

          Activity

          Hide
          Dennis Birkholz added a comment -

          Just checked on v2.4.2: the issue is still present there but the TableDiff now contains the original table information object so the fix may be a lot less hacky.

          Show
          Dennis Birkholz added a comment - Just checked on v2.4.2: the issue is still present there but the TableDiff now contains the original table information object so the fix may be a lot less hacky.
          Hide
          Steve Müller added a comment -
          Show
          Steve Müller added a comment - Dennis Birkholz This issue should have been fixed in 2.5, commit: https://github.com/doctrine/dbal/commit/75d35f5809095b37cb7085a9289eca4aa9c6df68 See here: https://github.com/doctrine/dbal/blob/master/lib/Doctrine/DBAL/Platforms/MySqlPlatform.php#L600 Please check again with the current master.
          Hide
          Steve Müller added a comment -
          Show
          Steve Müller added a comment - Duplicate of http://www.doctrine-project.org/jira/browse/DBAL-555

            People

            • Assignee:
              Steve Müller
              Reporter:
              Dennis Birkholz
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: