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

Raise ArgumentError if limit and lock are used for Oracle12 visitor #430

Merged
merged 1 commit into from May 4, 2016

Conversation

Projects
None yet
5 participants
@yahonda
Copy link

yahonda commented May 2, 2016

Considering several comments in rails/rails#24779 and #337 this pull request changes Oracle12 visitor behavior to return ArgumentError if limit and lock are used.

it would generates SELECT ... FETCH FIRST n ROWS ONLY FOR UPDATE
which causes Oracle 12c database returns this error :

ORA-02014: cannot select FOR UPDATE from view with DISTINCT, GROUP BY, etc.

Oracle12 visitor is a new feature for Rails 5, then it would not cause large incompatibility for users.

Raise ArgumentError if limit and lock are used for Oracle12 visitor
it would generates `SELECT ... FETCH FIRST n ROWS ONLY FOR UPDATE`
which causes Oracle 12c database returns this error :

ORA-02014: cannot select FOR UPDATE from view with DISTINCT, GROUP BY, etc.
@rails-bot

This comment has been minimized.

Copy link

rails-bot commented May 2, 2016

r? @tenderlove

(@rails-bot has picked a reviewer for you, use r? to override)

@sgrif sgrif merged commit cd81da6 into rails:master May 4, 2016

1 check failed

continuous-integration/travis-ci/pr The Travis CI build could not complete due to an error
Details
@yahonda

This comment has been minimized.

Copy link

yahonda commented May 9, 2016

Thank for merging.

To support Rails 5, Oracle enhanced adapter requires these two commits backported to the next version of arel which should be tagged v7.0.1.

commit c938736cf3b6cceb85a353e0c9f53ac9d842f742
Author: Yasuo Honda <yasuo.honda@gmail.com>
Date:   Mon May 2 13:31:06 2016 +0000

    Raise ArgumentError if limit and lock are used for Oracle12 visitor
    it would generates `SELECT ... FETCH FIRST n ROWS ONLY FOR UPDATE`
    which causes Oracle 12c database returns this error :

    ORA-02014: cannot select FOR UPDATE from view with DISTINCT, GROUP BY, etc.

commit 6f54a359e68395c9ea1506d38a2bf156ba7946ad
Author: Yasuo Honda <yasuo.honda@gmail.com>
Date:   Tue Apr 5 20:48:48 2016 +0000

    Support Oracle bind parameter value for Oracle12 visitor

It would be appreciated to release next version of arel 7.0.x including these 2 commits.

It actually changes some behavior for Oracle12 visitor users. There is no Oracle enhanced adapter version released for Rails 5, this behavior change should be fine.

@yahonda

This comment has been minimized.

Copy link

yahonda commented May 9, 2016

cc: @rafaelfranca This is what I had requested in RailsConf.

@yahonda yahonda deleted the yahonda:oracle12_limit_and_lock_2 branch May 9, 2016

@rafaelfranca

This comment has been minimized.

Copy link
Member

rafaelfranca commented May 10, 2016

👍, on it.

@yahonda

This comment has been minimized.

Copy link

yahonda commented Jul 19, 2016

@rafaelfranca Hi, Oracle enhanced adapter 17.0.beta1 has been released to support Rails 5. I would like newer version of Arel which should be called 7.0.1 including #422 and #430.

@rafaelfranca

This comment has been minimized.

Copy link
Member

rafaelfranca commented Jul 19, 2016

I'll release 7.1.0, is it fine to you?

@yahonda

This comment has been minimized.

Copy link

yahonda commented Jul 19, 2016

As long as Rails 5.0.x 5-0-stable branch is supported I am fine Are version is 7.1.0.

@rafaelfranca

This comment has been minimized.

Copy link
Member

rafaelfranca commented Jul 19, 2016

Yeah, it is supported.

@rafaelfranca

This comment has been minimized.

Copy link
Member

rafaelfranca commented Jul 20, 2016

7.1.0 released

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment