Skip to content

Switch order to prevent double-replacement in the query - #38783

Merged
phil-davis merged 1 commit into
masterfrom
switch_set_order
May 27, 2021
Merged

phil-davis merged 1 commit into
masterfrom
switch_set_order

Conversation

@jvillafanez

Copy link
Copy Markdown
Member

Description

The path used in the replacement for the path_hash column was the "new" one already replaced in the previous "set" clause. This was causing problems since the replacement could also happen in that new path, and could generate a wrong md5.
Switching the order makes sure the path used in the replace for both the path and path_hash columns will be the same

Related Issue

owncloud/encryption#276

Motivation and Context

How Has This Been Tested?

Manually tested using occ files:transfer-ownership

  1. user1 uploads a file
  2. user1 shares the file with user3
  3. run occ files:transfer-ownershp user1 user2

Previously, due to the wrong hash, a duplicate of the transfer file was generated in the DB, which was visible in the user2 account. This duplicate was causing side effects
This PR fixes that. The behaviour is the expected one.

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Database schema changes (next release will require increase of minor version instead of patch)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical debt
  • Tests only (no source changes)

Checklist:

  • Code changes
  • Unit tests added
  • Acceptance tests added
  • Documentation ticket raised:
  • Changelog item, see TEMPLATE

@update-docs

update-docs Bot commented May 27, 2021

Copy link
Copy Markdown

Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes.

@IljaN IljaN left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Failing tests pass ✔️

@jvillafanez

Copy link
Copy Markdown
Member Author

Linking with #38649 since it's a bug fix for that PR. No need for changelog because target PR hasn't been released yet and this one is a follow up of the other.

@sonarqubecloud

Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@phil-davis
phil-davis merged commit a8a03dd into master May 27, 2021
@delete-merged-branch
delete-merged-branch Bot deleted the switch_set_order branch May 27, 2021 09:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants