oracle-enhanced icon indicating copy to clipboard operation
oracle-enhanced copied to clipboard

Use longer identifier for `DatabaseLimits` when using Oracle 12.2 or higher

Open koic opened this issue 4 years ago • 6 comments

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.

koic avatar Jan 19 '21 05:01 koic

I found that there will probably be breaking change in this PR. Please wait for a while due to I will investigate it.

koic avatar Jan 20 '21 08:01 koic

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.

yahonda avatar Jan 21 '21 00:01 yahonda

Any updates on this?

gpg0 avatar Apr 22 '21 17:04 gpg0

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.

stale[bot] avatar Jun 26 '21 03:06 stale[bot]

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 avatar Nov 04 '21 14:11 mattalat

@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.

akostadinov avatar Jan 13 '22 11:01 akostadinov