-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle IN/NOT IN with an empty array
Previously, Sequel may not have handled IN/NOT correctly when given an empty array. Also, it may not have handled IN/NOT correctly for multiple columns and datasets when the database didn't directly support multiple columns for IN/NOT IN. This changes the code to handle the empty array as a special case, using col != col for correct NULL semantics in the IN case, and 1 = 1 for the NOT IN case. The idea for this way of handling things came from reading SQLAlchemy's documentation. Sequel should now correctly work with all types of IN/NOT IN and arrays or datasets. Even the case where the database doesn't support multiple columns for IN/NOT IN, and a dataset is used instead of an array is now handled correctly by sending the subquery separately, getting the results as an array and then handling it like an array.
- Loading branch information
1 parent
e66d8a1
commit 6984690
Showing
4 changed files
with
138 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters