Doctrine DBAL
  1. Doctrine DBAL
  2. DBAL-254

SQL Server rename table should use sp_RENAME

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.2.1
    • Fix Version/s: None
    • Component/s: Platforms
    • Security Level: All
    • Labels:
      None
    • Environment:
      SQL Server 2008 R2 on windows Server

      Description

      Whenever DBAL Schema Manager tries to rename a table in sql server 2008 it should use also the sp_RENAME procedure. Otherwise error is thrown.

      Apparently a similar issue was fixed for column ALTER Commands as described in the link below, but also the ALTER TABLE command should use sp_RENAME to avoid crash.

      http://www.doctrine-project.org/jira/browse/DBAL-199?page=com.atlassian.jira.plugin.system.issuetabpanels%3Achangehistory-tabpanel

      Suggested fix for Latest DBAL 2.2

      From Line 283:

      $queryParts[] = 'RENAME TO ' . $diff->newName;

      To Line 283:

      $sql[] = 'sp_RENAME \'' . $diff->name . '\',\'' . $diff->newName.'\'';

      This seems to fix the problem.

      Hope this helps

      Sorry for my bad english.

      Fredcallagan

        Activity

        Fryderyk Benigni created issue -
        Benjamin Eberlei made changes -
        Field Original Value New Value
        Workflow jira [ 13627 ] jira-feedback2 [ 17605 ]
        Benjamin Eberlei made changes -
        Workflow jira-feedback2 [ 17605 ] jira-feedback3 [ 19958 ]
        Benjamin Eberlei made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 2.2.3 [ 10210 ]
        Resolution Fixed [ 1 ]
        Guilherme Blanco made changes -
        Fix Version/s 2.2.3 [ 10210 ]

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            Fryderyk Benigni
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: