Doctrine DBAL
  1. Doctrine DBAL
  2. DBAL-120

MySql platform getAlterTableSQL does not quote existing column names

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Duplicate
    • Affects Version/s: 2.0.4
    • Fix Version/s: 2.0.4
    • Component/s: Platforms
    • Labels:
      None

      Description

      When creating alter table SQL, the MySqlPlatform class does not quote names for columns of an existing table when building a CHANGE query. This can cause SQL errors.

      It creates queries like this:

      ALTER TABLE my_table CHANGE key `key` INTVARCHAR(255) DEFAULT '' NOT NULL';

      Attached is a patch to fix this.

      As an aside, is this the best way to contribute a patch? Or is a GitHub pull request better?

      1. quote-mysql-change-colname.patch
        0.9 kB
        Devon Weller
      2. quote-mysql-change-keyname.patch
        0.6 kB
        Devon Weller

        Issue Links

          Activity

          Devon Weller created issue -
          Devon Weller made changes -
          Field Original Value New Value
          Attachment quote-mysql-change-keyname.patch [ 10993 ]
          Benjamin Eberlei made changes -
          Link This issue duplicates DBAL-96 [ DBAL-96 ]
          Benjamin Eberlei made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Resolution Duplicate [ 3 ]
          Benjamin Eberlei made changes -
          Workflow jira [ 12636 ] jira-feedback2 [ 17720 ]
          Benjamin Eberlei made changes -
          Workflow jira-feedback2 [ 17720 ] jira-feedback3 [ 20075 ]

            People

            • Assignee:
              Benjamin Eberlei
              Reporter:
              Devon Weller
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: