oracle-enhanced
oracle-enhanced copied to clipboard
Use longer identifier for `DatabaseLimits` when using Oracle 12.2 or higher
Follow #1703.
Oracle enhanced adapter supports longer identifier by #1703.
I encountered the following error when using rename_table
in Oracle 12c.
New table name 'identifier_of_thirty_bytes_or_more' is too long; the limit is 30 characters
Because IDENTIFIER_MAX_LENGTH
constant was fixed to 30 bytes.
This PR will use max_identifier_length
method instead of the constant and accept longer identifier (max 128 bytes) when using Oracle 12.2 or higher.
I encountered the error in Rails 6.0. So I'd like to backport to 6.1 and 6.0 stable branches.
I found that there will probably be breaking change in this PR. Please wait for a while due to I will investigate it.
Sure.
Although I have not checked this pull request in detail yet, In general, I prefer not to change method signature/arity for this requirement. Because the Oracle database version never changes per database connection. Also, I especially prefer not to change the method signature if it requires to backport to the older versions of Oracle enhanced adapter.
Let's have some discussion if you have questions. Thank you.
Any updates on this?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Is there any work that needs to be completed on this? If so, I'd be happy to help. I am eager to see this in a release!
@mattalat, the biggest complaint I see is changing of the method signatures. Since identifiers are same for the whole connection, I think that probably detecting their length within the connection and then accessing that value wherever needed would resolve that.
Also my suggestion would be to have a method that returns length of identifiers instead of long
/short
and other non-descriptive names. This may allow users to set some configuration option to force certain identifiers max length.