Skip to content

Conversation

@koic
Copy link
Contributor

@koic koic commented Feb 14, 2017

Summary

This PR fixes the following 2 failures when using Oracle (11g) .

% ruby -v
ruby 2.4.0p0 (2016-12-24 revision 57164) [x86_64-linux]
% ARCONN=oracle bundle exec ruby -w -Itest:lib test/cases/validations/uniqueness_validation_test.rb -n /test_validate_uniqueness_with_limit/

(snip)

Run options: -n /test_validate_uniqueness_with_limit/ --seed 4392

# Running:

FF

Finished in 0.582791s, 3.4318 runs/s, 3.4318 assertions/s.

  1) Failure:
UniquenessValidationTest#test_validate_uniqueness_with_limit [test/cases/validations/uniqueness_validation_test.rb:381]:
[ActiveRecord::StatementInvalid] exception expected, not
Class: <ActiveRecord::ValueTooLong>
Message: <"OCIError: ORA-12899: value too large for column \"ARUNIT\".\"EVENTS\".\"TITLE\" (actual: 8, maximum: 5): INSERT INTO \"EVENTS\" (\"TITLE\", \"ID\") VALUES (:a1, :a2)">

(snip)

  2) Failure:
UniquenessValidationTest#test_validate_uniqueness_with_limit_and_utf8 [test/cases/validations/uniqueness_validation_test.rb:401]:
[ActiveRecord::StatementInvalid] exception expected, not
Class: <ActiveRecord::ValueTooLong>
Message: <"OCIError: ORA-12899: value too large for column \"ARUNIT\".\"EVENTS\".\"TITLE\" (actual: 8, maximum: 5): INSERT INTO \"EVENTS\" (\"TITLE\", \"ID\") VALUES (:a1, :a2)">

(snip)

2 runs, 2 assertions, 2 failures, 0 errors, 0 skips

In oracle-enhanced, it seems that raise ActiveRecord::ValueTooLong when these test cases. Then it seems like the expected behavior according to the following references.

References:

As additional Information, I confirmed that there is the same test fails on 5-0-stable branch.

Thanks.

@rails-bot
Copy link

Thanks for the pull request, and welcome! The Rails team is excited to review your changes, and you should hear from @sgrif (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

This repository is being automatically checked for code quality issues using Code Climate. You can see results for this analysis in the PR status below. Newly introduced issues should be fixed before a Pull Request is considered ready to review.

Please see the contribution instructions for more information.

@eileencodes eileencodes merged commit 6a61ca3 into rails:master Feb 15, 2017
eileencodes added a commit that referenced this pull request Feb 15, 2017
…oracle

Fix a tests of AR::ValueTooLong when using OracleAdapter
@eileencodes
Copy link
Member

Thank you! Backported in e79ffaf

@koic koic deleted the fix_test_ar_value_too_long_using_oracle branch February 16, 2017 02:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants