-
Notifications
You must be signed in to change notification settings - Fork 1
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
Fix Mapper Insert method #75
Conversation
Codecov Report
@@ Coverage Diff @@
## master #75 +/- ##
===========================================
+ Coverage 2.96% 2.96% +<.01%
Complexity 225 225
===========================================
Files 22 22
Lines 1012 1011 -1
===========================================
Hits 30 30
+ Misses 982 981 -1
Continue to review full report at Codecov.
|
What effect does this behavior have on the normal usage? |
Before the Fix
The Status gets created in the DB here https://github.com/owncloud/search_elastic/blob/master/db/statusmapper.php#L289 Bad Side EffectIf the first Background Job for indexing a new file or updating content or metatada is run all status entries in the Effect of the fix on the normal usage:
|
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.
makes sense. we saw when debugging this that the db always returned 0 for the getLastInsertId() call. @micbar what db was running, btw?
I assume that since the entitiy comes with an id no autoincrement is triggered, hence no id is generated.
The code that creates the id for the entitiy is in https://github.com/owncloud/search_elastic/blob/master/db/statusmapper.php#L279-L291
We always pass in the id because we get it from the filecache first.
If anything we could think about making the fileid column a foreign key column ... but that is a different issue.
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.
LGTM
@butonic MariaDB |
Bug
The Status Mappers insert method does not return the
fileid
of the entity.Problem
This sets all scanned files on
occ search:index --all
to Status "N" (New)Solution
Fix the mappers insert method