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

Fixed Selection::insert spoiling PDO:lastInsertId #217

Merged
merged 4 commits into from Feb 8, 2019

Conversation

@Stopka
Copy link
Contributor

commented Feb 6, 2019

  • bug fix #216
  • BC break? no

Changes the order of method calls in Selection::insert, so that getPrimarySequence and getPrimaryAutoincrementKey methods are called before actual query. Without this edit calling of these methods can spoil PDO:lastInsertId by database query for building Structure cache, which results in not obtaining new inserted ActiveRow.
This fail usualy happened on first insert query when used with StaticConvetions.

@dg

This comment has been minimized.

Copy link
Member

commented Feb 7, 2019

Great. Can you add a test?

Štěpán Škorpil added some commits Feb 8, 2019

Štěpán Škorpil
Štěpán Škorpil
Štěpán Škorpil
@Stopka

This comment has been minimized.

Copy link
Contributor Author

commented Feb 8, 2019

Ok, I added test covering this bug.

@dg

This comment has been minimized.

Copy link
Member

commented Feb 8, 2019

Thanks!

@dg dg merged commit 2eb679f into nette:master Feb 8, 2019

3 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage increased (+0.04%) to 86.463%
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.