Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix returning the proper last inserted id in MSSQL #3523

Closed
Show file tree
Hide file tree
Changes from 137 commits
Commits
Show all changes
141 commits
Select commit Hold shift + click to select a range
8304622
Decouple unique index from unique constraint
guilhermeblanco Sep 22, 2016
ee858e3
Added flag support to unique constraint
guilhermeblanco Sep 22, 2016
708641b
Fixed tests
guilhermeblanco Sep 24, 2016
2bfa56d
Removed identifier generator type from schema table definition
guilhermeblanco Sep 24, 2016
846869f
Fixing rebase with master
guilhermeblanco Jun 21, 2017
bb7ff36
Fixed undefined result of rebase
guilhermeblanco Jun 22, 2017
103d1a3
Moved getSequencePrefix() from ClassMetadata (ORM) to AbstractPlatfor…
guilhermeblanco Jul 11, 2017
66541a0
Bump version to 3.0.x-dev
Majkl578 Jan 5, 2018
e2b67d3
[BC] Removed support for PDO::PARAM_INPUT_OUTPUT in Statement::bindPa…
morozov Dec 27, 2017
b36fd3c
[BC] Replaced extension of \PDOStatement with a composition to avoid …
morozov Jan 2, 2018
3971de2
[BC] Replaced PDO constants with values
morozov Jan 1, 2018
6fcb0ff
Updated UPGRADE.md for 3.x
morozov Dec 25, 2017
7c23689
Drop Doctrine\DBAL\Version in favor of Ocramius\PackageVersions
Majkl578 Jan 5, 2018
101df0c
Drop Drizzle support
BenMorel Mar 7, 2018
768738e
Add note to UPGRADE.md
BenMorel Mar 7, 2018
09c614f
Introduce a null SQL logger
BenMorel Mar 8, 2018
40a8851
Make NullLogger final
BenMorel Mar 8, 2018
7ead557
One-liner for Configuration::getSQLLogger()
BenMorel Mar 8, 2018
7e08661
Change the SQLLogger interface signature
BenMorel Mar 8, 2018
4af1ea1
Add UPGRADE note
BenMorel Mar 8, 2018
b4276f5
Ignore NullLogger in code coverage
BenMorel Mar 8, 2018
e35f9f9
Make SQLLogger implementations final
BenMorel Mar 8, 2018
8f5f3cc
Update UPGRADE.md
BenMorel Mar 8, 2018
b39c81a
Do not accept null in Configuration::setSQLLogger()
BenMorel Mar 8, 2018
1a867b8
Add note about setSQLLogger()
BenMorel Mar 8, 2018
59524c7
Don't catch Exception anymore
BenMorel Mar 9, 2018
cdb0e9f
When rendering SQL, only render the alias if it's different from the …
morozov Mar 13, 2018
e0685e1
Drop support for PostgreSQL <9.3
Majkl578 Mar 16, 2018
7aa3d53
Drop support for SQL Server <2008
Majkl578 Mar 16, 2018
a7589c8
Drop support for SQL Anywhere <16
Majkl578 Mar 16, 2018
cd8dff9
Drop PDO DB2 driver
Majkl578 Mar 17, 2018
0ffd7e8
Remove MsSQLKeywords
Majkl578 Mar 17, 2018
4bbcf60
Reorder keywords and type mappings alphabetically
Majkl578 Mar 17, 2018
658a5e2
Fixed build failure on SQL Server (sqlsrv)
morozov Mar 20, 2018
c10a94d
Fixed build failure on SQL Server (pdo_sqlsrv)
morozov Mar 20, 2018
d8409a7
[DBAL-3079] Reworked the usage of PDO in PDOConnection from inheritan…
morozov Apr 2, 2018
67eb2ef
[DBAL-3079] Added type hints to query-related method parameters and r…
morozov Apr 11, 2018
c1c11a1
Added string mapping in SqlitePlatform - used by make bundle
Apr 28, 2018
3d793b2
[DBAL-3079] Updated upgrade documentation
morozov Apr 12, 2018
59a5ea1
Revert complex type specification in Connection
Majkl578 Apr 20, 2018
983fa1f
Merge pull request #3119 from DeyV/develop
Ocramius Apr 28, 2018
34c3f80
Merge pull request #3113 from Majkl578/revert-complex-type-spec
Majkl578 May 2, 2018
27829b2
Removed support for DB-generated UUIDs
morozov Jul 11, 2018
7522514
Removed the logic of using BLOB columns for BINARY type of fields
morozov Jun 6, 2018
0d6b63d
Fixed and suppressed issues found by PHPStan on develop
morozov Aug 3, 2018
51e7956
Merge pull request #3211 from morozov/issues/3167
morozov Aug 2, 2018
ded8cee
Removed dbal:import CLI command
morozov Aug 7, 2018
35eec30
Merge pull request #3238 from morozov/phpstan-develop
Ocramius Aug 3, 2018
7502b94
Made the OFFSET in LIMIT queries non-nullable
morozov Aug 11, 2018
937fd01
Merge pull request #3241 from morozov/issues/3237
morozov Aug 8, 2018
506a04b
Merge pull request #3248 from morozov/non-nullable-offset
morozov Aug 12, 2018
62b9e66
Remove Doctrine\DBAL\Types\Type::__toString()
Majkl578 Aug 17, 2018
8bbe46a
Remove Doctrine\DBAL\Types\Type::getDefaultLength()
Majkl578 Aug 17, 2018
a282db0
Got rid of func_num_args in AbstractPlatform::getDummySelectSQL()
morozov Oct 6, 2018
32eff18
Transaction-related Statement methods return void
morozov Mar 13, 2019
3d912ba
Statement::fetchColumn() will throw an exception in the case of inval…
morozov Dec 1, 2018
968d971
Handle binding errors in OCI8Statement::execute() and MySQLiStatement…
morozov Dec 1, 2018
f143086
Connection::setAutoCommit() will return void
morozov Mar 13, 2019
cfd1c33
Merge pull request #3417 from morozov/issues/3358
morozov Feb 9, 2019
38382fa
Moved rowCount() from Statement to ResultStatement
morozov Jan 24, 2019
4012f0a
Merge pull request #3480 from morozov/transaction-void
Ocramius Mar 13, 2019
576f094
Merge pull request #3483 from morozov/row-count
morozov Mar 15, 2019
b56fa47
Connection::quote() can only quote strings
morozov Mar 16, 2019
49bbed0
Assert that the username is specified on the connection when listing …
morozov Mar 16, 2019
ff1c22a
Converted Connection and Statement methods which returned false in ca…
morozov Mar 15, 2019
0a6eaaa
Make the $tableName argument of _getPortableTableIndexesList() required
morozov Mar 16, 2019
3ae6993
Merge pull request #3486 from morozov/conn-stmt-void
morozov Mar 16, 2019
2ec034f
Changed the type of `$char` in `AbstractPlatform::getTrimExpression()…
morozov Mar 17, 2019
f89e2f9
Merge pull request #3488 from morozov/quote-only-string
Ocramius Mar 16, 2019
1165b64
Merge pull request #3491 from morozov/get-trim-expr
Ocramius Mar 18, 2019
66416c6
Modified AbstractPlatform::getLocateExpression() and ::getSubstringEx…
morozov Mar 18, 2019
8d76f73
Reworked AbstractPlatform::get*Expression() methods
morozov Mar 22, 2019
3631ed5
Merge pull request #3494 from morozov/get-locate-expr
Ocramius Mar 21, 2019
eb2d67f
Merge pull request #3498 from morozov/get-other-expr
Ocramius Mar 27, 2019
82509ef
Enable strict types
Majkl578 Feb 8, 2019
6ed3302
Merge pull request #2854 from Majkl578/strict-types
morozov Apr 2, 2019
4380ce4
Removed DB2SchemaManager::_getPortableForeignKeyRuleDef()
morozov Mar 30, 2019
532cc11
Merge pull request #3502 from morozov/db2-get-portable-foreign-key-ru…
Majkl578 Apr 3, 2019
1d8921c
Reworking driver exceptions
morozov Apr 5, 2019
6fb21e1
Merge pull request #3505 from morozov/driver-exceptions
Ocramius Apr 5, 2019
6ee1d09
Removed errorCode() and errorInfo() methods from Connection and State…
morozov Apr 5, 2019
6029aeb
Reworked `AbstractSchemaManager::extractDoctrineTypeFromComment()` re…
morozov Mar 29, 2019
af11239
Merge pull request #3507 from morozov/error-code-info
Ocramius Apr 6, 2019
62f7ad8
Drop support for feferred misspelling in
jwage Apr 17, 2019
3ed2f25
Merge pull request #3501 from morozov/extract-type-from-comment
morozov Apr 13, 2019
490dbe2
Added type hints to the Column class
morozov Apr 7, 2019
fbe5f07
Merge pull request #3520 from doctrine/drop-misspelling-in-foreign-ke…
jwage Apr 17, 2019
78c135d
Fix UniqueConstraint with empty name.
jwage Apr 17, 2019
cc54415
Merge pull request #3511 from morozov/column-type-hints
morozov Apr 17, 2019
000f5a0
Implemented support for persistent connections in PDO and mysqli drivers
morozov Apr 14, 2019
5af3a45
Merge pull request #3519 from doctrine/fix-unique-constraint-with-emp…
jwage Apr 19, 2019
91159d1
Extract exception factory methods into specific exceptions
Majkl578 May 4, 2018
d007efe
Merge pull request #3515 from morozov/persistent-connections
morozov Apr 23, 2019
5494b34
Merge pull request #3525 from doctrine/exceptions
morozov Apr 29, 2019
83b6ac2
Improve consistency of exception message formatting.
jwage Apr 30, 2019
89766f8
Merge pull request #3536 from jwage/improve-exception-messages
morozov May 8, 2019
20e707f
Remove user provided PDO functionality
morozov May 20, 2019
bf0d7c6
Connection::ping() will return void
morozov Mar 14, 2019
e3f4726
Merge pull request #3548 from morozov/issues/3545
morozov May 22, 2019
fb869d7
Merge pull request #3485 from morozov/ping-void
Ocramius May 22, 2019
22d677b
Enforced parameter and return value types in Statement classes
morozov May 23, 2019
600d79f
Merge pull request #3552 from morozov/statement-types
morozov May 23, 2019
0cd6baa
Remove deprecated json_array type
Majkl578 Apr 15, 2019
101950b
Remove deprecated Connection::TRANSACTION_* constants
Majkl578 Apr 15, 2019
623ca14
Remove deprecated AbstractPlatform::DATE_INTERVAL_UNIT_* and Abstract…
Majkl578 Apr 15, 2019
0dbca36
Remove deprecated MysqlSessionInit listener
Majkl578 Apr 15, 2019
cab0ce4
Remove deprecated MysqlPlatform::getCollationFieldDeclaration()
Majkl578 Apr 15, 2019
9d652f9
Remove deprecated AbstractPlatform::getIdentityColumnNullInsertSQL()
Majkl578 Apr 15, 2019
a28941b
Remove deprecated Table::addUnnamedForeignKeyConstraint() and Table::…
Majkl578 Apr 15, 2019
9539988
SQLParserUtils::*_TOKEN constants made private
Majkl578 Apr 15, 2019
4924169
Remove deprecated SQLParserUtils::getPlaceholderPositions()
Majkl578 Apr 15, 2019
d370eeb
Remove deprecated Table::renameColumn()
Majkl578 Apr 15, 2019
1993fc2
Remove deprecated AbstractSchemaManager::getFilterSchemaAssetsExpress…
Majkl578 Apr 15, 2019
d1c6699
Merge pull request #3518 from Majkl578/drop-deprecated
morozov May 23, 2019
40f26b1
Removed Driver::getName()
morozov May 23, 2019
0723eeb
Merge pull request #3553 from morozov/remove-driver-name
morozov May 24, 2019
f9dcaf3
add test for issue 3516 - invalid last inserted id in mssql when the …
sarven Apr 15, 2019
dc3ccf1
fix getting proper last inserted id when the table has a trigger with…
sarven Apr 15, 2019
2d36c21
change the number of insert statements in the trigger
sarven Apr 16, 2019
44f4888
fix PDOSqlsrv to get proper last inserted id when the table has a tri…
sarven Apr 18, 2019
3bf0d1e
fix phpstan errors
sarven Apr 18, 2019
e20814e
fix phpcs
sarven Apr 18, 2019
fb28489
fix phpdoc for stmt
sarven Apr 19, 2019
e3eaa58
fix typehint
sarven Apr 19, 2019
5b4fa18
convert fetchColumn result to string
sarven Apr 19, 2019
101c745
remove unnecessary if
sarven Apr 19, 2019
0c36944
remove whitespace
sarven Apr 19, 2019
0239670
convert fetchColumn to string
sarven Apr 19, 2019
de77ce0
remove getAttribute method which is not in the Connection interface
sarven Apr 19, 2019
ecf04f6
fix typehint
sarven Apr 19, 2019
e440b91
change sqlsrv version from devel to stable
sarven May 10, 2019
080c619
adjust changes to develop branch
sarven May 18, 2019
d10ff38
adjust PDOSqlsrvStatement
sarven May 23, 2019
a4b7904
Revert "change sqlsrv version from devel to stable"
sarven May 24, 2019
49b5b55
move DBAL3516Test to ConnectionTest
sarven May 24, 2019
79b93df
Connection in PDOSqlsrv as subtype of PDOConnection
sarven May 24, 2019
2e19509
fix alias
sarven May 24, 2019
96d9c5b
change protected to private
sarven May 28, 2019
98710f2
add missing typehints to LastInsertId
sarven May 28, 2019
6a06832
fix cs
sarven May 28, 2019
5122cc2
id as nullable
sarven May 28, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .scrutinizer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ before_commands:
tools:
external_code_coverage:
timeout: 3600
runs: 30 # 25x Travis (jobs with COVERAGE=yes) + 3x AppVeyor (jobs with coverage=yes) + 2x ContinuousPHP
runs: 29 # 24x Travis (jobs with COVERAGE=yes) + 3x AppVeyor (jobs with coverage=yes) + 2x ContinuousPHP

filter:
excluded_paths:
Expand Down
7 changes: 0 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -187,13 +187,6 @@ jobs:
env: DB=mariadb.mysqli MARIADB_VERSION=10.3 COVERAGE=yes
addons:
mariadb: 10.3
- stage: Test
php: 7.3
env: DB=pgsql POSTGRESQL_VERSION=9.2 COVERAGE=yes
services:
- postgresql
addons:
postgresql: "9.2"
- stage: Test
php: 7.3
env: DB=pgsql POSTGRESQL_VERSION=9.3 COVERAGE=yes
Expand Down
251 changes: 251 additions & 0 deletions UPGRADE.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,254 @@
# Upgrade to 3.0

## BC BREAK: `Doctrine\DBAL\Driver::getName()` removed

The `Doctrine\DBAL\Driver::getName()` has been removed.

## BC BREAK Removed previously deprecated features

* Removed `json_array` type and all associated hacks.
* Removed `Connection::TRANSACTION_*` constants.
* Removed `AbstractPlatform::DATE_INTERVAL_UNIT_*` and `AbstractPlatform::TRIM_*` constants.
* Removed `MysqlSessionInit` listener.
* Removed `MysqlPlatform::getCollationFieldDeclaration()`.
* Removed `AbstractPlatform::getIdentityColumnNullInsertSQL()`.
* Removed `Table::addUnnamedForeignKeyConstraint()` and `Table::addNamedForeignKeyConstraint()`.
* Removed `Table::renameColumn()`.
* Removed `SQLParserUtils::getPlaceholderPositions()`.
* Removed `AbstractSchemaManager::getFilterSchemaAssetsExpression()`, `Configuration::getFilterSchemaAssetsExpression()`
and `Configuration::getFilterSchemaAssetsExpression()`.
* `SQLParserUtils::*_TOKEN` constants made private.

## BC BREAK `Connection::ping()` returns `void`.

`Connection::ping()` and `PingableConnection::ping()` no longer return a boolean value. They will throw an exception in case of failure.

## BC BREAK User-provided `PDO` instance is no longer supported

In order to share the same `PDO` instances between DBAL and other components, initialize the connection in DBAL and access it using `Connection::getWrappedConnection()->getWrappedConnection()`.

## BC BREAK PostgreSqlPlatform ForeignKeyConstraint support for `feferred` misspelling removed

`PostgreSqlPlatform::getAdvancedForeignKeyOptionsSQL()` had a typo in it in 2.x. Both the option name
`feferred` and `deferred` were supported in `2.x` but the misspelling was removed in 3.x.

## BC BREAK `AbstractSchemaManager::extractDoctrineTypeFromComment()` changed, `::removeDoctrineTypeFromComment()` removed

`AbstractSchemaManager::extractDoctrineTypeFromComment()` made `protected`. It takes the comment by reference, removes the type annotation from it and returns the extracted Doctrine type.

## BC BREAK `::errorCode()` and `::errorInfo()` removed from `Connection` and `Statement` APIs

The error information is available in `DriverException` trown in case of an error.

## BC BREAK Changes in driver exceptions

1. The `Doctrine\DBAL\Driver\DriverException::getErrorCode()` method is removed. In order to obtain the driver error code, please use `::getCode()`.
2. `Doctrine\DBAL\Driver\PDOException` no longer extends `PDOException`.
3. The value returned by `Doctrine\DBAL\Driver\PDOException::getSQLState()` no longer falls back to the driver error code.

The method was used internally and is no longer needed.

## BC BREAK `DB2SchemaManager::_getPortableForeignKeyRuleDef()` removed

The method was used internally and is no longer needed.

## BC BREAK `AbstractPlatform::get*Expression()` methods no loner accept integer values as arguments

The following methods' arguments do not longer accept integer value:

- the `$expression` argument in `::getCountExpression()`,
- the `$decimals` argument in `::getRoundExpression()`,
- the `$seconds` argument in `::getDateAddSecondsExpression()`,
- the `$seconds` argument in `::getDateSubSecondsExpression()`,
- the `$minutes` argument in `::getDateAddMinutesExpression()`,
- the `$minutes` argument in `::getDateSubMinutesExpression()`,
- the `$hours` argument in `::getDateAddHourExpression()`,
- the `$hours` argument in `::getDateAddHourExpression()`,
- the `$days` argument in `::getDateAddDaysExpression()`,
- the `$days` argument in `::getDateSubDaysExpression()`,
- the `$weeks` argument in `::getDateAddWeeksExpression()`,
- the `$weeks` argument in `::getDateSubWeeksExpression()`,
- the `$months` argument in `::getDateAddMonthExpression()`,
- the `$months` argument in `::getDateSubMonthExpression()`,
- the `$quarters` argument in `::getDateAddQuartersExpression()`,
- the `$quarters` argument in `::getDateSubQuartersExpression()`,
- the `$years` argument in `::getDateAddYearsExpression()`,
- the `$years` argument in `::getDateSubYearsExpression()`.

Please use the strings representing numeric SQL literals instead (e.g. `'1'` instead of `1`).

The signature of `AbstractPlatform::getConcatExpression()` changed to `::getConcatExpression(string ...$string)`.

## BC BREAK The type of `$start` in `AbstractPlatform::getLocateExpression()` changed from `string|false` to `?string`

The default value of `$start` is now `null`, not `false`.

## BC BREAK The types of `$start` and `$length` in `AbstractPlatform::getSubstringExpression()` changed from `int` and `?int` to `string` and `?string` respectively

The platform abstraction allows building arbitrary SQL expressions, so even if the arguments represent numeric literals, they should be passed as a string.

## BC BREAK The type of `$char` in `AbstractPlatform::getTrimExpression()` changed from `string|false` to `?string`

The default value of `$char` is now `null`, not `false`. Additionally, the method will throw an `InvalidArgumentException` in an invalid value of `$mode` is passed.

## BC BREAK `Statement::quote()` only accepts strings.

`Statement::quote()` and `ExpressionBuilder::literal()` no longer accept arguments of an arbitrary type and and don't implement type-specific handling. Only strings can be quoted.

## BC BREAK `Statement` and `Connection` methods return `void`.

`Connection::connect()`, `Statement::bindParam()`, `::bindValue()`, `::execute()`, `ResultStatement::setFetchMode()` and `::closeCursor()` no longer return a boolean value. They will throw an exception in case of failure.

## BC BREAK `Statement::rowCount()` is moved.

`Statement::rowCount()` has been moved to the `ResultStatement` interface where it belongs by definition.

## BC BREAK Transaction-related `Statement` methods return `void`.

`Statement::beginTransaction()`, `::commit()` and `::rollBack()` no longer return a boolean value. They will throw a `DriverException` in case of failure.

## MINOR BC BREAK `Statement::fetchColumn()` with an invalid index.

Similarly to `PDOStatement::fetchColumn()`, DBAL statements throw an exception in case of an invalid column index.

## BC BREAK `Statement::execute()` with redundant parameters.

Similarly to the drivers based on `pdo_pgsql` and `pdo_sqlsrv`, `OCI8Statement::execute()` and `MySQLiStatement::execute()` do not longer ignore redundant parameters.

## BC BREAK: `Doctrine\DBAL\Types\Type::getDefaultLength()` removed

The `Doctrine\DBAL\Types\Type::getDefaultLength()` method has been removed as it served no purpose.

## BC BREAK: `Doctrine\DBAL\Types\Type::__toString()` removed

Relying on string representation was discouraged and has been removed.

## BC BREAK: The `NULL` value of `$offset` in LIMIT queries is not allowed

The `NULL` value of the `$offset` argument in `AbstractPlatform::(do)?ModifyLimitQuery()` methods is no longer allowed. The absence of the offset should be indicated with a `0` which is now the default value.

## BC BREAK: Removed dbal:import CLI command

The `dbal:import` CLI command has been removed since it only worked with PDO-based drivers by relying on a non-documented behavior of the extension, and it was impossible to make it work with other drivers.
Please use other database client applications for import, e.g.:

* For MySQL and MariaDB: `mysql [dbname] < data.sql`.
* For PostgreSQL: `psql [dbname] < data.sql`.
* For SQLite: `sqlite3 /path/to/file.db < data.sql`.

## BC BREAK: Removed support for DB-generated UUIDs

The support for DB-generated UUIDs was removed as non-portable.
Please generate UUIDs on the application side (e.g. using [ramsey/uuid](https://packagist.org/packages/ramsey/uuid)).

## BC BREAK: Removed MsSQLKeywords class

The `Doctrine\DBAL\Platforms\MsSQLKeywords` has been removed.
Please use `Doctrine\DBAL\Platforms\SQLServerPlatform `instead.

## BC BREAK: Removed PDO DB2 driver

This PDO-based IBM DB2 driver (built on top of pdo_ibm extension) has already been unsupported as of 2.5, it has now been now removed.

The following class has been removed:

* `Doctrine\DBAL\Driver\PDOIbm\Driver`

## BC BREAK: Removed support for SQL Anywhere 12 and older

DBAL now requires SQL Anywhere 16 or newer, support for unmaintained versions has been dropped.
If you are using any of the legacy versions, you have to upgrade to newer SQL Anywhere version (16+).
`Doctrine\DBAL\Platforms\SQLAnywherePlatform` and `Doctrine\DBAL\Platforms\Keywords\SQLAnywhereKeywords` now represent the SQL Anywhere 16.

The following classes have been removed:

* `Doctrine\DBAL\Platforms\SQLAnywhere11Platform`
* `Doctrine\DBAL\Platforms\SQLAnywhere12Platform`
* `Doctrine\DBAL\Platforms\SQLAnywhere16Platform`
* `Doctrine\DBAL\Platforms\Keywords\SQLAnywhere11Keywords`
* `Doctrine\DBAL\Platforms\Keywords\SQLAnywhere12Keywords`
* `Doctrine\DBAL\Platforms\Keywords\SQLAnywhere16Keywords`

## BC BREAK: Removed support for SQL Server 2005 and older

DBAL now requires SQL Server 2008 or newer, support for unmaintained versions has been dropped.
If you are using any of the legacy versions, you have to upgrade to newer SQL Server version (2012+ is recommended).
`Doctrine\DBAL\Platforms\SQLServerPlatform` and `Doctrine\DBAL\Platforms\Keywords\SQLServerKeywords` now represent the SQL Server 2008.

The following classes have been removed:

* `Doctrine\DBAL\Platforms\SQLServer2005Platform`
* `Doctrine\DBAL\Platforms\SQLServer2008Platform`
* `Doctrine\DBAL\Platforms\Keywords\SQLServer2005Keywords`
* `Doctrine\DBAL\Platforms\Keywords\SQLServer2008Keywords`

## BC BREAK: Removed support for PostgreSQL 9.2 and older

DBAL now requires PostgeSQL 9.3 or newer, support for unmaintained versions has been dropped.
If you are using any of the legacy versions, you have to upgrade to newer PostgreSQL version (9.6+ is recommended).
`Doctrine\DBAL\Platforms\PostgreSqlPlatform` and `Doctrine\DBAL\Platforms\Keywords\PostgreSQLKeywords` now represent the PostgreSQL 9.3.

The following classes have been removed:

* `Doctrine\DBAL\Platforms\PostgreSQL91Platform`
* `Doctrine\DBAL\Platforms\PostgreSQL92Platform`
* `Doctrine\DBAL\Platforms\Keywords\PostgreSQL91Keywords`
* `Doctrine\DBAL\Platforms\Keywords\PostgreSQL92Keywords`

## BC BREAK: Removed Doctrine\DBAL\Version

The Doctrine\DBAL\Version class is no longer available: please refrain from checking the DBAL version at runtime.

## BC BREAK: the PDO symbols are no longer part of the DBAL API

1. The support of `PDO::PARAM_*`, `PDO::FETCH_*`, `PDO::CASE_*` and `PDO::PARAM_INPUT_OUTPUT` constants in the DBAL API is removed.
2. `\Doctrine\DBAL\Driver\PDOConnection` does not extend `\PDO` anymore. Please use `\Doctrine\DBAL\Driver\PDOConnection::getWrappedConnection()` to access the underlying `PDO` object.
3. `\Doctrine\DBAL\Driver\PDOStatement` does not extend `\PDOStatement` anymore.

Before:

use Doctrine\DBAL\Portability\Connection;

$params = array(
'wrapperClass' => Connection::class,
'fetch_case' => PDO::CASE_LOWER,
);

$stmt->bindValue(1, 1, PDO::PARAM_INT);
$stmt->fetchAll(PDO::FETCH_COLUMN);

After:

use Doctrine\DBAL\ColumnCase;
use Doctrine\DBAL\FetchMode;
use Doctrine\DBAL\ParameterType;
use Doctrine\DBAL\Portability\Connection;

$params = array(
'wrapperClass' => Connection::class,
'fetch_case' => ColumnCase::LOWER,
);

$stmt->bindValue(1, 1, ParameterType::INTEGER);
$stmt->fetchAll(FetchMode::COLUMN);

## BC BREAK: Removed Drizzle support

The Drizzle project is abandoned and is therefore not supported by Doctrine DBAL anymore.

## BC BREAK: SQLLogger changes

- The `SQLLogger` interface has changed; the methods are the same but use scalar type hints, return types, and non-nullable arrays.
- `SQLLogger` implementations: `DebugStack`, `EchoSQLLogger`, `LoggerChain` are now final.
- `Configuration::getSQLLogger()` does not return `null` anymore, but a `NullLogger` implementation.
- `Configuration::setSQLLogger()` does not allow `null` anymore.

## BC BREAK: Changes to handling binary fields

- Binary fields whose length exceeds the maximum field size on a given platform are no longer represented as `BLOB`s.
Use binary fields of a size which fits all target platforms, or use blob explicitly instead.
- Binary fields are no longer represented as streams in PHP. They are represented as strings.

# Upgrade to 2.10

## MINOR BC BREAK: Default values are no longer handled as SQL expressions
Expand Down
2 changes: 2 additions & 0 deletions bin/doctrine-dbal.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

use Doctrine\DBAL\Tools\Console\ConsoleRunner;
use Symfony\Component\Console\Helper\HelperSet;

Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@
],
"require": {
"php": "^7.2",
"ext-pdo": "*",
"doctrine/cache": "^1.0",
"doctrine/event-manager": "^1.0"
"doctrine/event-manager": "^1.0",
"ocramius/package-versions": "^1.2"
},
"require-dev": {
"doctrine/coding-standard": "^6.0",
Expand Down
Loading