diff options
| author | Ants Aasma <ants.aasma@gmail.com> | 2008-10-20 20:41:09 +0000 |
|---|---|---|
| committer | Ants Aasma <ants.aasma@gmail.com> | 2008-10-20 20:41:09 +0000 |
| commit | 11619ad8eeb137efd84bda67d34414c3c3e00080 (patch) | |
| tree | b6f0265f2d81b2497e4fd2f4d3dc53bf23112ac3 /lib/sqlalchemy/sql | |
| parent | 9dd05715de7e673b5ab4af8eb84b719f8d5e66ff (diff) | |
| download | sqlalchemy-11619ad8eeb137efd84bda67d34414c3c3e00080.tar.gz | |
Slightly changed behavior of IN operator for comparing to empty collections. Now results in inequality comparison against self. More portable, but breaks with stored procedures that aren't pure functions.
Diffstat (limited to 'lib/sqlalchemy/sql')
| -rw-r--r-- | lib/sqlalchemy/sql/expression.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/sqlalchemy/sql/expression.py b/lib/sqlalchemy/sql/expression.py index b721e5884..cb2bcd6d6 100644 --- a/lib/sqlalchemy/sql/expression.py +++ b/lib/sqlalchemy/sql/expression.py @@ -1383,8 +1383,8 @@ class _CompareMixin(ColumnOperators): args.append(o) if len(args) == 0: - # Special case handling for empty IN's - return _Grouping(case([(self.__eq__(None), text('NULL'))], else_=text('0')).__eq__(text('1'))) + # Special case handling for empty IN's, behave like comparison against zero row selectable + return self != self return self.__compare(op, ClauseList(*args).self_group(against=op), negate=negate_op) |
