-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Adding repair step for sub share #30186
Conversation
Need to write unit test. But so far with the scenario mentioned in the issue, when I run the
|
Codecov Report
@@ Coverage Diff @@
## master #30186 +/- ##
============================================
+ Coverage 58.36% 58.36% +<.01%
- Complexity 18566 18573 +7
============================================
Files 1093 1094 +1
Lines 63771 63805 +34
============================================
+ Hits 37217 37242 +25
- Misses 26554 26563 +9
Continue to review full report at Codecov.
|
a2eb7a9
to
b6f6ca9
Compare
Created the tests for this repair PR. |
|
||
public function run(IOutput $output) { | ||
$deletedEntries = 0; | ||
$this->removeRowsWithDuplicateDataExceptId(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this function's name is lying. It is not removing rows with duplicate data except id. It's only setting some attributes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@PVince81 Yes its making the query statement with attributes. Will get it corrected. It was there in my mind sometime back and then got slipped :( Thanks.
a689afc
to
8d67c73
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks fine, see comment
'share_with' => $qb->expr()->literal($userName.$groupCount), | ||
'uid_owner' => $qb->expr()->literal('admin'), | ||
'uid_initiator' => $qb->expr()->literal('admin'), | ||
'parent' => $qb->expr()->literal(1), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest you also vary the parent value considering that we use it on the group by
]) | ||
->execute(); | ||
|
||
if (($i%3) === 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a bit more fresh air appreciated
8d67c73
to
f3ff72a
Compare
Adding repair step for sub share. When share table due to some magic gets duplicate entries ( except the id or primary key ), then this repair step comes for rescue. Signed-off-by: Sujith H <sharidasan@owncloud.com>
f3ff72a
to
2f09bd8
Compare
any update ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
@tom @butonic any comments on the query from https://github.com/owncloud/core/pull/30186/files#diff-c7d3960633d9f6fe9eb517281d947301R61 regarding performance ?
@sharidas please backport |
Backport PR: #30695 |
Backport PR has been done and merged. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Adding repair step for sub share.
When share table due to some magic gets
duplicate entries for sub share ( except the id or primary
key ), then this repair step comes for rescue.
Signed-off-by: Sujith H sharidasan@owncloud.com
Description
Remove the duplicate entries from the
share
table which can cause exception described in the issue.Related Issue
#27990
Motivation and Context
For some magical reason, if the share table gets populated with duplicate entries then we would have to remove the duplicate entry. Keeping the row with minimum id. Else exception would be thrown as mentioned in the issue.
How Has This Been Tested?
Screenshots (if appropriate):
Types of changes
Checklist: