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

Union fails with mysql2 driver #546

Closed
maletor opened this issue Sep 19, 2014 · 3 comments
Closed

Union fails with mysql2 driver #546

maletor opened this issue Sep 19, 2014 · 3 comments

Comments

@maletor
Copy link

maletor commented Sep 19, 2014

I'm working with trying to make a union of two queries with ActiveRecord and Arel. I have been able to produce a Gist that proves the sqlite3 driver creates the correct query, while the mysql2 raises an error.

https://gist.github.com/maletor/af1aae5086ba10ed7cad

The failing line is https://github.com/rails/rails/blob/v4.0.8/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb#L14 where there is an undefined method reverse for nil.

I have also tested this against Rails 4.1.5 and Arel 5.0.

@sodabrew
Copy link
Collaborator

Is this a mysql2 gem bug?

@maletor
Copy link
Author

maletor commented Sep 19, 2014

@sodabrew, I've also opened a bug on Rails. To be honest, I'm not completely sure, but you can see that only with the mysql2 driver does this fail.

@sodabrew
Copy link
Collaborator

Closing here. The issue is well discussed in rails/rails#16978.

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

No branches or pull requests

2 participants