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
Merged

Conversation

Stopka
Copy link
Contributor

@Stopka Stopka 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
Copy link
Member

@dg dg commented Feb 7, 2019

Great. Can you add a test?

@Stopka
Copy link
Contributor Author

@Stopka Stopka commented Feb 8, 2019

Ok, I added test covering this bug.

@dg
Copy link
Member

@dg dg commented Feb 8, 2019

Thanks!

@dg dg merged commit 2eb679f into nette:master Feb 8, 2019
3 checks passed
zelenomodrypes pushed a commit to AppsDevTeam/database that referenced this issue Mar 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants