Fix WriteTest for platforms supporting both sequences and identity columns #402

Merged
merged 1 commit into from Nov 12, 2013

Projects

None yet

3 participants

@deeky666
Doctrine member

The test WriteTest::testLastInsertIdNoSequenceGiven() does not work if the tested platform supports both sequences and identity columns and when the driver is able to return distinguished information about the last inserted sequence ID and identity column ID.
The problem here is that both sequence IDs and identity column IDs get inserted into the database in the tests before. Therefore a driver that is capable of distinguishing between last inserted sequence and identity column IDs returns the last inserted identity column ID when Connection::lastInsertId(null) is called in this particular test.
The behaviour of Connection:lastInsertId() is very inconsistent throughout the drivers and therefore a true expectation can only be made if the tested platform supports sequences but not identity columns.

@doctrinebot

Hello,

thank you for creating this pull request. I have automatically opened an issue
on our Jira Bug Tracker for you. See the issue link:

http://www.doctrine-project.org/jira/browse/DBAL-653

We use Jira to track the state of pull requests and the versions they got
included in.

@beberlei beberlei merged commit 72599b7 into doctrine:master Nov 12, 2013

1 check passed

Details default The Travis CI build passed
@pdesgarets pdesgarets pushed a commit to pdesgarets/dbal that referenced this pull request Apr 29, 2015
Paul dG template1 as default database for Postgres
Fixes #402 (doctrine/DoctrineBundle#402) by connecting by default to 'template1' instead of the database with the same name as the user (Postgre default in case of no dbname).
522bb66
@pdesgarets pdesgarets referenced this pull request in pdesgarets/dbal Apr 29, 2015
Merged

template1 as default database for Postgres #1

@deeky666 deeky666 added a commit that referenced this pull request Apr 30, 2015
Paul dG template1 as default database for Postgres
Fixes #402 (doctrine/DoctrineBundle#402) by connecting by default to 'template1' instead of the database with the same name as the user (Postgre default in case of no dbname).
3c9d223
@deeky666 deeky666 added a commit that referenced this pull request Apr 30, 2015
Paul dG template1 as default database for Postgres
Fixes #402 (doctrine/DoctrineBundle#402) by connecting by default to 'template1' instead of the database with the same name as the user (Postgre default in case of no dbname).
4ebd411
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment