checking against empty array/set generates invalid sql #252

Closed
jeremyevans opened this Issue May 1, 2011 · 2 comments

Projects

None yet

1 participant

@jeremyevans
Owner

require 'set'

User.where{ :user_id == [] }
Sequel::Error::InvalidExpression: Invalid expression tree: [:zarray]

User.where{ :user_id == Set.new.to_a }
=> #

User.filter( :user_id => [] )
=> #

field IN () is invalid sql

Google Code Info:
Issue #: 227
Author: themaste...@gmail.com
Created On: 2008-05-21T18:23:03.000Z
Closed On: 2008-05-21T22:39:25.000Z

@jeremyevans jeremyevans was assigned May 1, 2011
@jeremyevans jeremyevans closed this May 1, 2011
@jeremyevans
Owner

This used to work in previous sequel versions:

irb(main):006:0> User.where{ :id == Set.new.to_a }
=> #

Google Code Info:
Author: themaste...@gmail.com
Created On: 2008-05-21T18:33:29.000Z

@jeremyevans
Owner

Fixed:
http://github.com/jeremyevans/sequel/commit/260c31bb23774ce4e6edc8623f8725b9259a1ad2

Google Code Info:
Author: jeremyev...@gmail.com
Created On: 2008-05-21T22:39:25.000Z

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