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

Fix dav properties column types #39084

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

tcitworld
Copy link
Member

@tcitworld tcitworld commented Jun 30, 2023

Summary

If changing the type of the column can't be done, we'll need to create a new column and move data

TODO

  • SQLite is accepting pretty much anything ✅
  • MySQL/MariaDB ✅ just needs the index to be on a prefix
  • Test on PostgreSQL ❌ (needs some cast magic)
  • Test on Oracle ❌ (is being Oracle)

Checklist

@tcitworld tcitworld added this to the Nextcloud 28 milestone Jun 30, 2023
@tcitworld tcitworld force-pushed the fix-dav-properties-column-type branch 5 times, most recently from a253545 to b4118da Compare July 2, 2023 10:02
@skjnldsv skjnldsv mentioned this pull request Nov 1, 2023
This was referenced Nov 6, 2023
This was referenced Nov 14, 2023
@blizzz blizzz modified the milestones: Nextcloud 28, Nextcloud 29 Nov 23, 2023
This was referenced Mar 12, 2024
@Altahrim Altahrim mentioned this pull request Mar 20, 2024
@skjnldsv skjnldsv modified the milestones: Nextcloud 29, Nextcloud 30 Mar 28, 2024
@skjnldsv skjnldsv modified the milestones: Nextcloud 30, Nextcloud 31 Aug 14, 2024
@skjnldsv skjnldsv closed this Aug 14, 2024
@skjnldsv skjnldsv removed this from the Nextcloud 31 milestone Aug 14, 2024
@tcitworld tcitworld reopened this Aug 26, 2024
@tcitworld
Copy link
Member Author

@skjnldsv This one is important and I need some help on the database migration.

@rakekniven
Copy link
Member

Any chance this PR get's some love?

@tcitworld tcitworld force-pushed the fix-dav-properties-column-type branch 2 times, most recently from e06a61d to c4be207 Compare October 15, 2024 07:42
The propertyvalue column can contain null 0x00 characters values because of serializing PHP objects since #30368. This truncates data in text fields, but not blob fields. We start by removing invalid value and altering the column to match the new type.

That's what Sabre PDO's being doing in the first place 🙈

Closes #37754

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
Match it to the value in oc_filecache table path column should be fine.

Closes #9907

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
@tcitworld tcitworld force-pushed the fix-dav-properties-column-type branch from c4be207 to 1440e5a Compare October 15, 2024 07:48
@miaulalala miaulalala assigned tcitworld and unassigned miaulalala Oct 15, 2024
@tcitworld
Copy link
Member Author

For PostgreSQL : https://stackoverflow.com/questions/19300113/unable-to-convert-postgresql-text-column-to-bytea
For Oracle : https://asktom.oracle.com/ords/f?p=100:11:::::P11_QUESTION_ID:510622111991

If we have less than 50k rows (value yet to determine), perform the migrations straight away.
Otherwise, skip the migration, set an appconfig and add a red flag in system check. Then include as an expensive repair step.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 📄 To do
Development

Successfully merging this pull request may close these issues.

5 participants