Skip to content

Commit

Permalink
[TMP] Find the driver that results an empty string for lastInsertId()
Browse files Browse the repository at this point in the history
  • Loading branch information
BenMorel committed Nov 26, 2018
1 parent 890eae6 commit 8559397
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 139 deletions.
138 changes: 0 additions & 138 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ cache:

php:
- 7.2
- 7.3
- nightly

env:
- DB=sqlite
Expand Down Expand Up @@ -86,47 +84,12 @@ jobs:
php: 7.2
env: DB=mysql COVERAGE=yes

- stage: Test
php: 7.2
env: DB=mysqli COVERAGE=yes

- stage: Test
php: 7.2
env: DB=mysql MYSQL_VERSION=5.7 COVERAGE=yes
sudo: required
before_script:
- bash ./tests/travis/install-mysql-5.7.sh
- stage: Test
php: 7.3
env: DB=mysql MYSQL_VERSION=5.7
sudo: required
before_script:
- bash ./tests/travis/install-mysql-5.7.sh
- stage: Test
php: nightly
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=mysqli MYSQL_VERSION=5.7 COVERAGE=yes
sudo: required
before_script:
- bash ./tests/travis/install-mysql-5.7.sh
- stage: Test
php: 7.3
env: DB=mysqli MYSQL_VERSION=5.7
sudo: required
before_script:
- bash ./tests/travis/install-mysql-5.7.sh
- stage: Test
php: nightly
env: DB=mysqli MYSQL_VERSION=5.7
sudo: required
before_script:
- bash ./tests/travis/install-mysql-5.7.sh

- stage: Test
php: 7.2
Expand All @@ -146,60 +109,12 @@ jobs:
addons:
mariadb: 10.2

- stage: Test
php: 7.2
env: DB=mariadb.mysqli MARIADB_VERSION=10.0 COVERAGE=yes
addons:
mariadb: 10.0

- stage: Test
php: 7.2
env: DB=mariadb.mysqli MARIADB_VERSION=10.1 COVERAGE=yes
addons:
mariadb: 10.1

- stage: Test
php: 7.2
env: DB=mariadb.mysqli MARIADB_VERSION=10.2 COVERAGE=yes
addons:
mariadb: 10.2

- stage: Test
php: 7.2
env: DB=mariadb MARIADB_VERSION=10.3 COVERAGE=yes
addons:
mariadb: 10.3

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

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

- stage: Test
php: 7.2
env: DB=mariadb.mysqli MARIADB_VERSION=10.3 COVERAGE=yes
addons:
mariadb: 10.3

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

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

- stage: Test
php: 7.2
env: DB=pgsql POSTGRESQL_VERSION=9.3 COVERAGE=yes
Expand Down Expand Up @@ -251,22 +166,6 @@ jobs:
- docker
before_script:
- bash ./tests/travis/install-postgres-11.sh
- stage: Test
php: 7.3
env: DB=pgsql POSTGRESQL_VERSION=11.0
sudo: required
services:
- docker
before_script:
- bash ./tests/travis/install-postgres-11.sh
- stage: Test
php: nightly
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
Expand All @@ -277,24 +176,6 @@ jobs:
before_script:
- bash ./tests/travis/install-mssql-$DB.sh
- bash ./tests/travis/install-mssql.sh
- stage: Test
php: 7.3
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: nightly
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
Expand All @@ -305,25 +186,6 @@ jobs:
before_script:
- bash ./tests/travis/install-mssql-$DB.sh
- bash ./tests/travis/install-mssql.sh
- stage: Test
php: 7.3
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: nightly
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=ibm_db2 COVERAGE=yes
Expand Down
3 changes: 2 additions & 1 deletion lib/Doctrine/DBAL/Driver/PDOConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ public function lastInsertId(?string $name = null) : string
throw new PDOException($e);
}

if ($lastInsertId === '0' || $lastInsertId === '') {
// pdo_mysql returns '0', pdo_
if ($lastInsertId === '0') {
// WIP regarding exceptions, see:
// https://github.com/doctrine/dbal/pull/3335#discussion_r234381175
throw new class ('The last statement did not return an insert ID.') extends AbstractDriverException {
Expand Down

0 comments on commit 8559397

Please sign in to comment.