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

Add a test case of nested empty array values in conditions #16528

Conversation

byroot
Copy link
Member

@byroot byroot commented Aug 17, 2014

  Post.where(id: [[]]).to_a

Used to fail with a SQL syntax error (until 4.1):

SELECT ... WHERE id in ();

It now properly generate:

SELECT ... WHERE 1=0;

I think it have been fixed in Arel, but I'm not 100% sure.
In any case I think adding a regression test cannot harm

  Post.where(id: [[]]).to_a

Used to fail with a SQL syntax error (until 4.1):

  SELECT ... WHERE id in ();

It now properly generate:

  SELECT ... WHERE 1=0;
@arthurnn
Copy link
Member

👍 , @rafaelfranca thoughts?

spastorino added a commit that referenced this pull request Aug 18, 2014
…in-where-conditions

Add a test case of nested empty array values in conditions
@spastorino spastorino merged commit 7074981 into rails:master Aug 18, 2014
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

Successfully merging this pull request may close these issues.

None yet

3 participants