-
Notifications
You must be signed in to change notification settings - Fork 326
Support longer identifier for Oracle database 12.2 or higher #1703
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Longer identifier has been supported by aliasing `table_alias_length` and `index_name_length` method defined in `ActiveRecord::ConnectionAdapters::OracleEnhanced::DatabaseLimits` to use `max_identifier_length` method newly creted in `ActiveRecord::ConnectionAdapters::OracleEnhanced::OracleEnhancedAdapter`. because ActiveRecord::ConnectionAdapters::OracleEnhanced::DatabaseLimits does not know the database version. Refer https://docs.oracle.com/en/database/oracle/oracle-database/12.2/sqlrf/Database-Object-Names-and-Qualifiers.html#GUID-75337742-67FD-4EC0-985F-741C93D918DA Not implemented in this commit: * Support longer identifiers for column name, sequence name * Use 30 byte identifier for Oracle database 12.2 for those who prefer old behavior. Addresses rsim#1594
This was referenced Apr 16, 2018
yahonda
added a commit
to yahonda/oracle-enhanced
that referenced
this pull request
Apr 16, 2018
to support shorter 30 bytes identifier for Oracle 12.2 or higher Follows up rsim#1703
yahonda
added a commit
to yahonda/rails
that referenced
this pull request
Mar 3, 2019
```ruby $ ARCONN=oracle bin/test test/cases/migration/columns_test.rb -n test_rename_column_with_multi_column_index ... snip ... F Failure: ActiveRecord::Migration::ColumnsTest#test_rename_column_with_multi_column_index [/home/yahonda/git/rails/activerecord/test/cases/migration/columns_test.rb:113]: --- expected +++ actual @@ -1 +1 @@ -["i_test_models_hat_style_size"] +["index_test_models_on_hat_style_and_size"] ``` Kind of reverting rails#9395 Refer rsim/oracle-enhanced#1703
koic
added a commit
to koic/oracle-enhanced
that referenced
this pull request
Jan 19, 2021
…higher Follow rsim#1703. Oracle enhanced adapter supports longer identifier by rsim#1703. I encountered the following error when using `rename_table` in Oracle 12c. ```console 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 a backport to 6.1 and 6.0 stable branches.
koic
added a commit
to koic/oracle-enhanced
that referenced
this pull request
Jan 19, 2021
…higher Follow rsim#1703. Oracle enhanced adapter supports longer identifier by rsim#1703. I encountered the following error when using `rename_table` in Oracle 12c. ```console 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 a backport to 6.1 and 6.0 stable branches.
koic
added a commit
to koic/oracle-enhanced
that referenced
this pull request
Jan 19, 2021
…higher Follow rsim#1703. Oracle enhanced adapter supports longer identifier by rsim#1703. I encountered the following error when using `rename_table` in Oracle 12c. ```console 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
added a commit
to koic/oracle-enhanced
that referenced
this pull request
Jan 19, 2021
…higher Follow rsim#1703. Oracle enhanced adapter supports longer identifier by rsim#1703. I encountered the following error when using `rename_table` in Oracle 12c. ```console 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
added a commit
to koic/oracle-enhanced
that referenced
this pull request
Jan 19, 2021
…higher Follow rsim#1703. Oracle enhanced adapter supports longer identifier by rsim#1703. I encountered the following error when using `rename_table` in Oracle 12c. ```console 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.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Longer identifier has been supported by aliasing
table_alias_length
andindex_name_length
method defined inActiveRecord::ConnectionAdapters::OracleEnhanced::DatabaseLimits
to usemax_identifier_length
method newly creted inActiveRecord::ConnectionAdapters::OracleEnhanced::OracleEnhancedAdapter
. Because ActiveRecord::ConnectionAdapters::OracleEnhanced::DatabaseLimits does not know the database version.Refer
https://docs.oracle.com/en/database/oracle/oracle-database/12.2/sqlrf/Database-Object-Names-and-Qualifiers.html#GUID-75337742-67FD-4EC0-985F-741C93D918DA
Not implemented in this commit:
Addresses #1594