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

[3.0] Rework driver exceptions #3367

Closed
wants to merge 60 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
d4fec7c
Decouple unique index from unique constraint
guilhermeblanco Sep 22, 2016
5a7b383
Added flag support to unique constraint
guilhermeblanco Sep 22, 2016
7b124ec
Fixed tests
guilhermeblanco Sep 24, 2016
dec14fb
Removed identifier generator type from schema table definition
guilhermeblanco Sep 24, 2016
3154749
Fixing rebase with master
guilhermeblanco Jun 21, 2017
76bb463
Fixed undefined result of rebase
guilhermeblanco Jun 22, 2017
3195492
Moved getSequencePrefix() from ClassMetadata (ORM) to AbstractPlatfor…
guilhermeblanco Jul 11, 2017
2170801
Require PHP 7.2, drop <7.2 in Composer & on CI
Majkl578 Jan 5, 2018
acebbfa
Bump version to 3.0.x-dev
Majkl578 Jan 5, 2018
77d9b2f
[BC] Removed support for PDO::PARAM_INPUT_OUTPUT in Statement::bindPa…
morozov Dec 27, 2017
5c63dc0
[BC] Replaced extension of \PDOStatement with a composition to avoid …
morozov Jan 2, 2018
46da0b0
[BC] Replaced PDO constants with values
morozov Jan 1, 2018
3d862a7
Updated UPGRADE.md for 3.x
morozov Dec 25, 2017
756a733
Drop Doctrine\DBAL\Version in favor of Ocramius\PackageVersions
Majkl578 Jan 5, 2018
8327c79
Drop Drizzle support
BenMorel Mar 7, 2018
2a20c16
Add note to UPGRADE.md
BenMorel Mar 7, 2018
1f81dd6
Introduce a null SQL logger
BenMorel Mar 8, 2018
91f6707
Make NullLogger final
BenMorel Mar 8, 2018
5939e49
One-liner for Configuration::getSQLLogger()
BenMorel Mar 8, 2018
997671b
Change the SQLLogger interface signature
BenMorel Mar 8, 2018
f1f1677
Add UPGRADE note
BenMorel Mar 8, 2018
32c473c
Ignore NullLogger in code coverage
BenMorel Mar 8, 2018
b130d98
Make SQLLogger implementations final
BenMorel Mar 8, 2018
2fb9115
Update UPGRADE.md
BenMorel Mar 8, 2018
ac0c12d
Do not accept null in Configuration::setSQLLogger()
BenMorel Mar 8, 2018
a143efc
Add note about setSQLLogger()
BenMorel Mar 8, 2018
77a76d8
Don't catch Exception anymore
BenMorel Mar 9, 2018
ce32c09
When rendering SQL, only render the alias if it's different from the …
morozov Mar 13, 2018
fe9200a
Drop support for PostgreSQL <9.3
Majkl578 Mar 16, 2018
b1ad528
Drop support for SQL Server <2008
Majkl578 Mar 16, 2018
9636513
Drop support for SQL Anywhere <16
Majkl578 Mar 16, 2018
ad9c3bc
Drop PDO DB2 driver
Majkl578 Mar 17, 2018
09bbaa4
Remove MsSQLKeywords
Majkl578 Mar 17, 2018
245377f
Reorder keywords and type mappings alphabetically
Majkl578 Mar 17, 2018
6eea142
Fixed build failure on SQL Server (sqlsrv)
morozov Mar 20, 2018
d71824e
Fixed build failure on SQL Server (pdo_sqlsrv)
morozov Mar 20, 2018
b888c04
[DBAL-3079] Reworked the usage of PDO inPDOConnection from inheritanc…
morozov Apr 2, 2018
0346d39
[DBAL-3079] Added type hints to query-related method parameters and r…
morozov Apr 11, 2018
137a962
[DBAL-3079] Updated upgrade documentation
morozov Apr 12, 2018
47f4ba7
Added string mapping in SqlitePlatform - used by make bundle
Apr 28, 2018
733c63a
Merge pull request #3119 from DeyV/develop
Ocramius Apr 28, 2018
1eb4cf3
Revert complex type specification in Connection
Majkl578 Apr 20, 2018
69b8cef
Merge pull request #3113 from Majkl578/revert-complex-type-spec
Majkl578 May 2, 2018
d7f06f3
Removed support for DB-generated UUIDs
morozov Jul 11, 2018
e6d452e
Removed the logic of using BLOB columns for BINARY type of fields
morozov Jun 6, 2018
03ccace
Merge pull request #3211 from morozov/issues/3167
morozov Aug 2, 2018
304bc85
Fixed and suppressed issues found by PHPStan on develop
morozov Aug 3, 2018
fbc7fb6
Merge pull request #3238 from morozov/phpstan-develop
Ocramius Aug 3, 2018
d3f7686
Removed dbal:import CLI command
morozov Aug 7, 2018
4e92005
Merge pull request #3241 from morozov/issues/3237
morozov Aug 8, 2018
254f38f
Made the OFFSET in LIMIT queries non-nullable
morozov Aug 11, 2018
ff92ad6
Merge pull request #3248 from morozov/non-nullable-offset
morozov Aug 12, 2018
97b7eb4
Remove Doctrine\DBAL\Types\Type::__toString()
Majkl578 Aug 17, 2018
b7e8230
Merge pull request #3257 from Majkl578/dev/removal/Type-__toString
morozov Aug 18, 2018
2f7bd80
Got rid of func_num_args in AbstractPlatform::getDummySelectSQL()
morozov Oct 6, 2018
2b33eef
Remove Doctrine\DBAL\Types\Type::getDefaultLength()
Majkl578 Aug 17, 2018
0ef7d47
Merge pull request #3315 from morozov/get-dummy-select-sql
Ocramius Oct 6, 2018
fd81a77
Handle binding errors in OCI8Statement::execute() and MySQLiStatement…
morozov Dec 1, 2018
7764294
Merge pull request #3369 from morozov/issues/3366
Ocramius Dec 1, 2018
c6c1c33
Rework driver exceptions
BenMorel Nov 29, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .scrutinizer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ build:
analysis:
environment:
php:
version: 7.1
version: 7.2
cache:
disabled: false
directories:
Expand All @@ -21,7 +21,7 @@ before_commands:
tools:
external_code_coverage:
timeout: 3600
runs: 27 # 23x Travis (jobs with COVERAGE=yes) + 3x AppVeyor (jobs with coverage=yes) + 1x ContinuousPHP
runs: 26 # 22x Travis (jobs with COVERAGE=yes) + 3x AppVeyor (jobs with coverage=yes) + 1x ContinuousPHP

filter:
excluded_paths:
Expand Down
84 changes: 3 additions & 81 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ cache:
- $HOME/.composer/cache

php:
- 7.1
- 7.2
- 7.3
- nightly
Expand Down Expand Up @@ -57,11 +56,11 @@ jobs:
- env: DB=pgsql POSTGRESQL_VERSION=11.0

exclude:
- php: 7.1
- php: 7.2
env: DB=sqlite
- php: 7.1
- php: 7.2
env: DB=mysql
- php: 7.1
- php: 7.2
env: DB=mysqli
- php: 7.2
env: DB=sqlite
Expand All @@ -79,10 +78,6 @@ jobs:
env: DB=mysqli

include:
- stage: Test
php: 7.1
env: DB=sqlite

- stage: Test
php: 7.2
env: DB=sqlite COVERAGE=yes
Expand All @@ -95,12 +90,6 @@ jobs:
php: 7.2
env: DB=mysqli COVERAGE=yes

- stage: Test
php: 7.1
env: DB=mysql MYSQL_VERSION=5.7
sudo: required
before_script:
- bash ./tests/travis/install-mysql-5.7.sh
- stage: Test
php: 7.2
env: DB=mysql MYSQL_VERSION=5.7 COVERAGE=yes
Expand All @@ -120,12 +109,6 @@ jobs:
before_script:
- bash ./tests/travis/install-mysql-5.7.sh

- stage: Test
php: 7.1
env: DB=mysqli MYSQL_VERSION=5.7
sudo: required
before_script:
- bash ./tests/travis/install-mysql-5.7.sh
- stage: Test
php: 7.2
env: DB=mysqli MYSQL_VERSION=5.7 COVERAGE=yes
Expand Down Expand Up @@ -181,12 +164,6 @@ jobs:
addons:
mariadb: 10.2

- stage: Test
php: 7.1
env: DB=mariadb MARIADB_VERSION=10.3
addons:
mariadb: 10.3

- stage: Test
php: 7.2
env: DB=mariadb MARIADB_VERSION=10.3 COVERAGE=yes
Expand All @@ -205,12 +182,6 @@ jobs:
addons:
mariadb: 10.3

- stage: Test
php: 7.1
env: DB=mariadb.mysqli MARIADB_VERSION=10.3
addons:
mariadb: 10.3

- stage: Test
php: 7.2
env: DB=mariadb.mysqli MARIADB_VERSION=10.3 COVERAGE=yes
Expand All @@ -229,14 +200,6 @@ jobs:
addons:
mariadb: 10.3

- stage: Test
php: 7.2
env: DB=pgsql POSTGRESQL_VERSION=9.2 COVERAGE=yes
services:
- postgresql
addons:
postgresql: "9.2"

- stage: Test
php: 7.2
env: DB=pgsql POSTGRESQL_VERSION=9.3 COVERAGE=yes
Expand Down Expand Up @@ -280,14 +243,6 @@ jobs:
before_script:
- bash ./tests/travis/install-postgres-10.sh

- stage: Test
php: 7.1
env: DB=pgsql POSTGRESQL_VERSION=11.0
sudo: required
services:
- docker
before_script:
- bash ./tests/travis/install-postgres-11.sh
- stage: Test
php: 7.2
env: DB=pgsql POSTGRESQL_VERSION=11.0 COVERAGE=yes
Expand All @@ -313,15 +268,6 @@ jobs:
before_script:
- bash ./tests/travis/install-postgres-11.sh

- stage: Test
php: 7.1
env: DB=sqlsrv
sudo: required
services:
- docker
before_script:
- bash ./tests/travis/install-mssql-$DB.sh
- bash ./tests/travis/install-mssql.sh
- stage: Test
php: 7.2
env: DB=sqlsrv COVERAGE=yes
Expand Down Expand Up @@ -350,15 +296,6 @@ jobs:
- bash ./tests/travis/install-mssql-$DB.sh
- bash ./tests/travis/install-mssql.sh

- stage: Test
php: 7.1
env: DB=pdo_sqlsrv
sudo: required
services:
- docker
before_script:
- bash ./tests/travis/install-mssql-$DB.sh
- bash ./tests/travis/install-mssql.sh
- stage: Test
php: 7.2
env: DB=pdo_sqlsrv COVERAGE=yes
Expand Down Expand Up @@ -387,15 +324,6 @@ jobs:
- bash ./tests/travis/install-mssql-$DB.sh
- bash ./tests/travis/install-mssql.sh

- stage: Test
php: 7.1
env: DB=ibm_db2
sudo: required
services:
- docker
before_script:
- bash ./tests/travis/install-db2.sh
- bash ./tests/travis/install-db2-$DB.sh
- stage: Test
php: 7.2
env: DB=ibm_db2 COVERAGE=yes
Expand All @@ -406,12 +334,6 @@ jobs:
- bash ./tests/travis/install-db2.sh
- bash ./tests/travis/install-db2-$DB.sh

- stage: Test
php: 7.1
env: DB=sqlite DEPENDENCIES=low
install:
- travis_retry composer update --prefer-dist --prefer-lowest

- stage: Test
if: type = cron
php: 7.2
Expand Down
140 changes: 140 additions & 0 deletions UPGRADE.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,143 @@
# Upgrade to 3.0

## 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.9

## Deprecated `Configuration::getFilterSchemaAssetsExpression()`, `::setFilterSchemaAssetsExpression()` and `AbstractSchemaManager::getFilterSchemaAssetsExpression()`.
Expand Down
3 changes: 0 additions & 3 deletions build.properties
Original file line number Diff line number Diff line change
@@ -1,3 +0,0 @@
# Version class and file
project.version_class = Doctrine\\DBAL\\Version
project.version_file = lib/Doctrine/DBAL/Version.php
23 changes: 0 additions & 23 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,29 +38,6 @@
</exec>
</target>

<target name="make-release" depends="check-git-checkout-clean,prepare,php">
<replace file="${project.version_file}" token="-DEV" value="" failOnNoReplacements="true" />
<exec executable="${php_executable}" outputproperty="doctrine.current_version" failonerror="true">
<arg value="-r" />
<arg value="require_once '${project.version_file}';echo ${project.version_class}::VERSION;" />
</exec>
<exec executable="${php_executable}" outputproperty="doctrine.next_version" failonerror="true">
<arg value="-r" />
<arg value="$parts = explode('.', str_ireplace(array('-DEV', '-ALPHA', '-BETA'), '', '${doctrine.current_version}'));
if (count($parts) != 3) {
throw new \InvalidArgumentException('Version is assumed in format x.y.z, ${doctrine.current_version} given');
}
$parts[2]++;
echo implode('.', $parts);
" />
</exec>

<git-commit file="${project.version_file}" message="Release ${doctrine.current_version}" />
<git-tag version="${doctrine.current_version}" />
<replace file="${project.version_file}" token="${doctrine.current_version}" value="${doctrine.next_version}-DEV" />
<git-commit file="${project.version_file}" message="Bump version to ${doctrine.next_version}" />
</target>

<target name="check-git-checkout-clean">
<exec executable="git" failonerror="true">
<arg value="diff-index" />
Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
{"name": "Jonathan Wage", "email": "jonwage@gmail.com"}
],
"require": {
"php": "^7.1",
"ext-pdo": "*",
"php": "^7.2",
"doctrine/cache": "^1.0",
"doctrine/event-manager": "^1.0"
"doctrine/event-manager": "^1.0",
"ocramius/package-versions": "^1.2"
},
"require-dev": {
"doctrine/coding-standard": "^5.0",
Expand Down
Loading