UPGRADE 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. # Upgrade to 2.3
  2. ## Oracle Session Init now sets Numeric Character
  3. Before 2.3 the Oracle Session Init did not care about the numeric character of the Session.
  4. This could lead to problems on non english locale systems that required a comma as a floating
  5. point seperator in Oracle. Since 2.3, using the Oracle Session Init on connection start the
  6. client session will be altered to set the numeric character to ".,":
  7. ALTER SESSION SET NLS_NUMERIC_CHARACTERS = '.,'
  8. See [DBAL-345](http://www.doctrine-project.org/jira/browse/DBAL-345) for more details.
  9. ## Doctrine\DBAL\Connection and Doctrine\DBAL\Statement
  10. The query related methods including but not limited to executeQuery, exec, query, and executeUpdate
  11. now wrap the driver exceptions such as PDOException with DBALException to add more debugging
  12. information such as the executed SQL statement, and any bound parameters.
  13. If you want to retrieve the driver specific exception, you can retrieve it by calling the
  14. ``getPrevious()`` method on DBALException.
  15. Before:
  16. catch(\PDOException $ex) {
  17. // ...
  18. }
  19. After:
  20. catch(\Doctrine\DBAL\DBALException $ex) {
  21. $pdoException = $ex->getPrevious();
  22. // ...
  23. }
  24. ## Doctrine\DBAL\Connection#setCharsetSQL() removed
  25. This method only worked on MySQL and it is considered unsafe on MySQL to use SET NAMES UTF-8 instead
  26. of setting the charset directly on connection already. Replace this behavior with the
  27. connection charset option:
  28. Before:
  29. $conn = DriverManager::getConnection(array(..));
  30. $conn->setCharset('UTF8');
  31. After:
  32. $conn = DriverManager::getConnection(array('charset' => 'UTF8', ..));
  33. ## Doctrine\DBAL\Schema\Table#renameColumn() removed
  34. Doctrine\DBAL\Schema\Table#renameColumn() was removed, because it drops and recreates
  35. the column instead. There is no fix available, because a schema diff
  36. cannot reliably detect if a column was renamed or one column was created
  37. and another one dropped.
  38. You should use explicit SQL ALTER TABLE statements to change columns names.
  39. ## Schema Filter paths
  40. The Filter Schema assets expression is not wrapped in () anymore for the regexp automatically.
  41. Before:
  42. $config->setFilterSchemaAssetsExpression('foo');
  43. After:
  44. $config->setFilterSchemaAssetsExpression('(foo)');
  45. ## Creating MySQL Tables now defaults to UTF-8
  46. If you are creating a new MySQL Table through the Doctrine API, charset/collate are
  47. now set to 'utf8'/'utf8_unicode_ci' by default. Previously the MySQL server defaults were used.
  48. # Upgrade to 2.2
  49. ## Doctrine\DBAL\Connection#insert and Doctrine\DBAL\Connnection#update
  50. Both methods now accept an optional last parameter $types with binding types of the values passed.
  51. This can potentially break child classes that have overwritten one of these methods.
  52. ## Doctrine\DBAL\Connection#executeQuery
  53. Doctrine\DBAL\Connection#executeQuery() got a new last parameter "QueryCacheProfile $qcp"
  54. ## Doctrine\DBAL\Driver\Statement split
  55. The Driver statement was split into a ResultStatement and the normal statement extending from it.
  56. This seperates the configuration and the retrieval API from a statement.
  57. ## MsSql Platform/SchemaManager renamed
  58. The MsSqlPlatform was renamed to SQLServerPlatform, the MsSqlSchemaManager was renamed
  59. to SQLServerSchemaManager.
  60. ## Cleanup SQLServer Platform version mess
  61. DBAL 2.1 and before were actually only compatible to SQL Server 2008, not earlier versions.
  62. Still other parts of the platform did use old features instead of newly introduced datatypes
  63. in SQL Server 2005. Starting with DBAL 2.2 you can pick the Doctrine abstraction exactly
  64. matching your SQL Server version.
  65. The PDO SqlSrv driver now uses the new `SQLServer2008Platform` as default platform.
  66. This platform uses new features of SQL Server as of version 2008. This also includes a switch
  67. in the used fields for "text" and "blob" field types to:
  68. "text" => "VARCHAR(MAX)"
  69. "blob" => "VARBINARY(MAX)"
  70. Additionally `SQLServerPlatform` in DBAL 2.1 and before used "DATE", "TIME" and "DATETIME2" for dates.
  71. This types are only available since version 2008 and the introduction of an explicit
  72. SQLServer 2008 platform makes this dependency explicit.
  73. An `SQLServer2005Platform` was also introduced to differentiate the features between
  74. versions 2003, earlier and 2005.
  75. With this change the `SQLServerPlatform` now throws an exception for using limit queries
  76. with an offset, since SQLServer 2003 and lower do not support this feature.
  77. To use the old SQL Server Platform, because you are using SQL Server 2003 and below use
  78. the following configuration code:
  79. use Doctrine\DBAL\DriverManager;
  80. use Doctrine\DBAL\Platforms\SQLServerPlatform;
  81. use Doctrine\DBAL\Platforms\SQLServer2005Platform;
  82. // You are using SQL Server 2003 or earlier
  83. $conn = DriverManager::getConnection(array(
  84. 'driver' => 'pdo_sqlsrv',
  85. 'platform' => new SQLServerPlatform()
  86. // .. additional parameters
  87. ));
  88. // You are using SQL Server 2005
  89. $conn = DriverManager::getConnection(array(
  90. 'driver' => 'pdo_sqlsrv',
  91. 'platform' => new SQLServer2005Platform()
  92. // .. additional parameters
  93. ));
  94. // You are using SQL Server 2008
  95. $conn = DriverManager::getConnection(array(
  96. 'driver' => 'pdo_sqlsrv',
  97. // 2008 is default platform
  98. // .. additional parameters
  99. ));