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

Automatically delete duplicate keys in filecache table #6993

Closed
karlitschek opened this issue Jan 29, 2014 · 9 comments
Closed

Automatically delete duplicate keys in filecache table #6993

karlitschek opened this issue Jan 29, 2014 · 9 comments

Comments

@karlitschek
Copy link
Contributor

It seems that there are still a lot of ownCloud installations out there with broken filecache entries. The often break during upgrade because of duplicate keys in the filecache table.
I think we should cleanup duplicate keys in the repair function.

What do you thing @icewind1991

@karlitschek
Copy link
Contributor Author

And here is a real life example. #6994

@icewind1991
Copy link
Contributor

#6994 is not a duplicate entry in the filecache table but a duplicate entry in the appconfig table

@karlitschek
Copy link
Contributor Author

Ups. True :-)
But we should try to do the same here.

@PVince81
Copy link
Contributor

#6994 Rather seems to be for the oc_preferences table. But anyway, we should probably check most of the config/preference tables for duplicates anyway.

@PVince81
Copy link
Contributor

PVince81 commented May 6, 2014

@icewind1991 I've raised a separate issue for the oc_appconfig instead: #8469

@PVince81
Copy link
Contributor

PVince81 commented Jun 4, 2014

@icewind1991 do we have a primary key / index already on the filecache table in OC 6?

@icewind1991
Copy link
Contributor

Yes

@PVince81
Copy link
Contributor

PVince81 commented Jun 5, 2014

Just checked on OC 6.0.3 and I'm not able to add duplicate keys into the oc_preferences table.

owncloud=> insert into oc_preferences values ('root', 'test', 'x', 'y');
ERROR:  duplicate key value violates unique constraint "oc_preferences_pkey"
DETAIL:  Key (userid, appid, configkey)=(root, test, x) already exists.
owncloud=> insert into oc_preferences values ('root', 'test', 'x', 'y');
ERROR:  duplicate key value violates unique constraint "oc_preferences_pkey"
DETAIL:  Key (userid, appid, configkey)=(root, test, x) already exists.
owncloud=> insert into oc_preferences values ('root', 'test', 'x', 'z');
ERROR:  duplicate key value violates unique constraint "oc_preferences_pkey"
DETAIL:  Key (userid, appid, configkey)=(root, test, x) already exists.

So this is again a case of moving from OC 5 to OC 6, not OC 6 to OC 7.

@karlitschek
Copy link
Contributor Author

So I understand that in current versions this can´t happen because we have proper indexes/keys. Closing.

@lock lock bot locked as resolved and limited conversation to collaborators Aug 17, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants