-
-
Notifications
You must be signed in to change notification settings - Fork 4.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
fix(QueryBuilder): Restrict identifier length to 30 characters due to Oracle limitations #48361
fix(QueryBuilder): Restrict identifier length to 30 characters due to Oracle limitations #48361
Conversation
… Oracle limitations Signed-off-by: provokateurin <kate@provokateurin.de>
/backport to stable30 |
/backport to stable29 |
/backport to stable28 |
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 does not fix the bug but ensures it crashes on all DB, right?
Is there no way to magically fix the query instead, ideally in a class specific to OCI? I see we have Adapter, ExpressionBuilder and FuncitonBuilder specifc to OCI.
If we keep this as-is, what would the fix look like in the calling method?
It doesn't crash, it just logs an error. It will fail on Oracle when the query is executed eventually.
I don't think we can magically fix this as the code receiving the results relies on the exact names.
The aliases just need to be shorter. For example Circles adds a ton of prefixes to the name so I think for that case we could maybe drop some of them. |
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.
Okay I missed that the Exception is not thrown but only logged.
We do this already: server/lib/private/DB/MigrationService.php Lines 528 to 550 in 9836e9b
|
Summary
According to https://docs.nextcloud.com/server/latest/admin_manual/installation/system_requirements.html we still support Oracle versions <12.2.
https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Database-Object-Names-and-Qualifiers.html says:
If COMPATIBLE is set to a value of 12.2 or higher, then names must be from 1 to 128 bytes long
andIf COMPATIBLE is set to a value lower than 12.2, then names must be from 1 to 30 bytes long
.This means we must prevent any identifier with more than 30 characters as long as we support Oracle <12.2.
This check should also be extended to table names and schema names, but I'm not sure how to do that best.
I found this due to https://github.com/nextcloud/groupfolders/actions/runs/10960223441/job/30434816204 (which tests against Oracle 11) which triggers this query:
where
hp_cc_wn_on_contact_addressbook
is 31 characters.Checklist