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

Fix FinderMethods#exists? sql generation to make picky sql servers happy - 3 0 stable #1141

Closed
wants to merge 1 commit into from

Conversation

iaddict
Copy link
Contributor

@iaddict iaddict commented May 19, 2011

Minimal change to query generation of FinderMethods#exists? that makes SQLServer and others happy that do not like columns without an alias.

Without this patch MS-SQLServer doesn't like the generated SQL and barks for FinderMethods#exists?, ie:

ActiveRecord::StatementInvalid: ActiveRecord::JDBCError: No column was specified for column 2 of 't'.: SELECT t.* FROM (SELECT ROW_NUMBER() OVER(ORDER BY huhu.id) AS _row_num, 1 FROM huhu WHERE huhu.[id] = 83287) AS t WHERE t._row_num BETWEEN 1 AND 1

…s SQLServer and others happy that do not like columns without an alias.
@idev
Copy link

idev commented Jun 6, 2011

+1 please fix

@jonkessler
Copy link
Contributor

@iaddict Is this still an issue? If not, please close it. Thanks.

@rafaelfranca
Copy link
Member

This pull request is for a no longer supported Rails version. If you still have this issue please open a new pull request pointing to master.

Thank you so much for your time.

rafaelfranca added a commit that referenced this pull request Jun 10, 2012
This behavior was added in dd286a4

Closes #1139.

Fixes #2553, #1141, #1623 and #2062.
rafaelfranca added a commit that referenced this pull request Jun 10, 2012
This behavior was added in be4ecdc.

Closes #1139.

Fixes #2553, #1141, #1623 and #2062.
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.

None yet

4 participants