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 WriteTest for platforms supporting both sequences and identity columns #402

Merged
merged 1 commit into from
Nov 12, 2013

Conversation

deeky666
Copy link
Member

@deeky666 deeky666 commented Nov 6, 2013

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
Copy link

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 added a commit that referenced this pull request Nov 12, 2013
Fix WriteTest for platforms supporting both sequences and identity columns
@beberlei beberlei merged commit 72599b7 into doctrine:master Nov 12, 2013
deeky666 pushed a commit that referenced this pull request Apr 30, 2015
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).
deeky666 pushed a commit that referenced this pull request Apr 30, 2015
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).
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 2, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants