Doctrine DBAL
  1. Doctrine DBAL
  2. DBAL-830

[GH-539] unit test added for altering a column's default where the column name is...

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 2.4.2
    • Fix Version/s: None
    • Component/s: Platforms
    • Security Level: All
    • Labels:

      Description

      This issue is created automatically through a Github pull request on behalf of DeepDiver1975:

      Url: https://github.com/doctrine/dbal/pull/539

      Message:

      ... a keyword - fails on mssql:

      Exception : [Doctrine\DBAL\DBALException] An exception occurred while executing 'ALTER TABLE column_keyword_test DROP CONSTRAINT DF_D3D4D2F1_4BF2EAC0':
      
      SQLSTATE [42000, 3728]: [Microsoft][SQL Server Native Client 11.0][SQL Server]'DF_D3D4D2F1_4BF2EAC0' is not a constraint.
      SQLSTATE [42000, 3727]: [Microsoft][SQL Server Native Client 11.0][SQL Server]Could not drop constraint. See previous errors.
      
      With queries:
      5. SQL: 'ALTER TABLE column_keyword_test DROP CONSTRAINT DF_D3D4D2F1_4BF2EAC0' Params: 
      4. SQL: 'SELECT    col.name,
                                type.name AS type,
                                col.max_length AS length,
                                ~col.is_nullable AS notnull,
                                def.definition AS [default],
                                col.scale,
                                col.precision,
                                col.is_identity AS autoincrement,
                                col.collation_name AS collation,
                                CAST(prop.value AS NVARCHAR(MAX)) AS comment -- CAST avoids driver error for sql_variant type
                      FROM      sys.columns AS col
                      JOIN      sys.types AS type
                      ON        col.user_type_id = type.user_type_id
                      JOIN      sys.objects AS obj
                      ON        col.object_id = obj.object_id
                      JOIN      sys.schemas AS scm
                      ON        obj.schema_id = scm.schema_id
                      LEFT JOIN sys.default_constraints def
                      ON        col.default_object_id = def.object_id
                      AND       col.object_id = def.parent_object_id
                      LEFT JOIN sys.extended_properties AS prop
                      ON        obj.object_id = prop.major_id
                      AND       col.column_id = prop.minor_id
                      AND       prop.name = 'MS_Description'
                      WHERE     obj.type = 'U'
                      AND       (obj.name = 'column_keyword_test' AND scm.name = SCHEMA_NAME())' Params: 
      3. SQL: 'ALTER TABLE column_keyword_test ADD CONSTRAINT DF_D3D4D2F1_ACF51D19 DEFAULT 23 FOR [select]' Params: 
      2. SQL: 'CREATE TABLE column_keyword_test ([select] INT NOT NULL)' Params: 
      
      Trace:
      C:\projects\doctrine\dbal\lib\Doctrine\DBAL\Connection.php:988
      C:\projects\doctrine\dbal\lib\Doctrine\DBAL\Schema\AbstractSchemaManager.php:971
      C:\projects\doctrine\dbal\lib\Doctrine\DBAL\Schema\AbstractSchemaManager.php:612
      C:\projects\doctrine\dbal\lib\Doctrine\DBAL\Schema\SQLServerSchemaManager.php:232
      C:\projects\doctrine\dbal\tests\Doctrine\Tests\DBAL\Functional\Schema\SchemaManagerFunctionalTestCase.php:619
      C:\projects\doctrine\dbal\vendor\phpunit\phpunit\PHPUnit\Framework\TestCase.php:976
      C:\projects\doctrine\dbal\vendor\phpunit\phpunit\PHPUnit\Framework\TestCase.php:831
      C:\projects\doctrine\dbal\vendor\phpunit\phpunit\PHPUnit\Framework\TestResult.php:648
      C:\projects\doctrine\dbal\vendor\phpunit\phpunit\PHPUnit\Framework\TestCase.php:776
      C:\projects\doctrine\dbal\vendor\phpunit\phpunit\PHPUnit\Framework\TestSuite.php:775
      C:\projects\doctrine\dbal\vendor\phpunit\phpunit\PHPUnit\Framework\TestSuite.php:745
      C:\projects\doctrine\dbal\vendor\phpunit\phpunit\PHPUnit\TextUI\TestRunner.php:349
      C:\Program Files (x86)\PHP\v5.3\pear\PHPUnit\TextUI\Command.php:176
      C:\Users\deepdiver\AppData\Local\Temp\ide-phpunit.php:268
      C:\Users\deepdiver\AppData\Local\Temp\ide-phpunit.php:506
      
      #0 C:\projects\doctrine\dbal\vendor\phpunit\phpunit\PHPUnit\Framework\TestCase.php(946): Doctrine\Tests\DbalFunctionalTestCase->onNotSuccessfulTest(Object(Doctrine\DBAL\DBALException))
      #1 C:\projects\doctrine\dbal\vendor\phpunit\phpunit\PHPUnit\Framework\TestResult.php(648): PHPUnit_Framework_TestCase->runBare()
      #2 C:\projects\doctrine\dbal\vendor\phpunit\phpunit\PHPUnit\Framework\TestCase.php(776): PHPUnit_Framework_TestResult->run(Object(Doctrine\Tests\DBAL\Functional\Schema\SQLServerSchemaManagerTest))
      #3 C:\projects\doctrine\dbal\vendor\phpunit\phpunit\PHPUnit\Framework\TestSuite.php(775): PHPUnit_Framework_TestCase->run(Object(PHPUnit_Framework_TestResult))
      #4 C:\projects\doctrine\dbal\vendor\phpunit\phpunit\PHPUnit\Framework\TestSuite.php(745): PHPUnit_Framework_TestSuite->runTest(Object(Doctrine\Tests\DBAL\Functional\Schema\SQLServerSchemaManagerTest), Object(PHPUnit_Framework_TestResult))
      #5 C:\projects\doctrine\dbal\vendor\phpunit\phpunit\PHPUnit\TextUI\TestRunner.php(349): PHPUnit_Framework_TestSuite->run(Object(PHPUnit_Framework_TestResult), false, Array, Array, false)
      #6 C:\Program Files (x86)\PHP\v5.3\pear\PHPUnit\TextUI\Command.php(176): PHPUnit_TextUI_TestRunner->doRun(Object(PHPUnit_Framework_TestSuite), Array)
      #7 C:\Users\deepdiver\AppData\Local\Temp\ide-phpunit.php(268): PHPUnit_TextUI_Command->run(Array, true)
      #8 C:\Users\deepdiver\AppData\Local\Temp\ide-phpunit.php(506): IDE_Base_PHPUnit_TextUI_Command::main()
      #9 {main}
      

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            Doctrine Bot
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated: