Skip to content
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
Merged

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

merged 1 commit into from
May 4, 2016

Conversation

yahonda
Copy link
Member

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

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
Copy link

r? @tenderlove

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

@yahonda
Copy link
Member Author

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
Copy link
Member Author

yahonda commented May 9, 2016

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

@rafaelfranca
Copy link
Member

👍, on it.

@yahonda
Copy link
Member Author

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
Copy link
Member

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

@yahonda
Copy link
Member Author

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
Copy link
Member

Yeah, it is supported.

@rafaelfranca
Copy link
Member

7.1.0 released

@akostadinov
Copy link

Any reason why same approach as the Oracle old visitor is not used instead of just raising an error? I checked that converting this to ROWNUM worked. Otherwise locking a record seems impossible. See rsim/oracle-enhanced#2237

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

Successfully merging this pull request may close these issues.

6 participants