commit transaction after select query #26700

Merged
merged 1 commit into from Nov 23, 2016

Projects

None yet

4 participants

@phisch
Contributor
phisch commented Nov 23, 2016 edited

Description

In some cases the transaction will not have executed the insert query once we execute the select query afterwards. So the select after the transaction will return an empty result. Committing the transaction after the select query has been executed makes sure that it returns the share.

Motivation and Context

Has been described in Description.

How Has This Been Tested?

Tested manually.

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
@phisch phisch commit transaction after select query
47df51a
@phisch phisch added the bug label Nov 23, 2016
@mention-bot

@PhilippSchaffrath, thanks for your PR! By analyzing the history of the files in this pull request, we identified @rullzer, @PVince81 and @DeepDiver1975 to be potential reviewers.

@phisch
Contributor
phisch commented Nov 23, 2016 edited

Needs backports to 9.1 and 9.0

@butonic butonic added the db:mariadb label Nov 23, 2016
@butonic butonic added this to the 9.2 milestone Nov 23, 2016
@PVince81
Collaborator

Can you double check whether this is covered by the existing unit tests ? (all seem to pass, so that's good news)

Would it be possible to write a test that produces the original issue ?

@PVince81
Collaborator

How to reproduce the original issue ? Creating link shares seems to work fine so probably need a special setup ?

@phisch
Contributor
phisch commented Nov 23, 2016

I think that problem is quite hard to reproduce. It might depend on transaction/database timings which is close to impossible to reproduce consistently.

@PVince81
Collaborator

Ok, then 👍

@PVince81 PVince81 merged commit e772fe1 into master Nov 23, 2016

4 checks passed

Scrutinizer 44 new issues, 308 updated code elements
Details
continuous-integration/jenkins/pr-head This commit looks good
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
licence/cla Contributor License Agreement is signed.
Details
@PVince81 PVince81 deleted the failed-to-create-share-fix branch Nov 23, 2016
@PVince81
Collaborator

@PhilippSchaffrath @butonic backport down to 9.0 ?

@butonic
Member
butonic commented Nov 23, 2016

yes please

@PVince81
Collaborator

@PhilippSchaffrath please submit the backport PRs, thanks

@phisch phisch was assigned by PVince81 Nov 24, 2016
@LukasReschke LukasReschke referenced this pull request in nextcloud/server Dec 16, 2016
Merged

[downstream] commit transaction after select query #2722

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment