summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/dialects/postgresql
diff options
context:
space:
mode:
authorPhilip Jenvey <pjenvey@underboss.org>2009-09-24 02:11:56 +0000
committerPhilip Jenvey <pjenvey@underboss.org>2009-09-24 02:11:56 +0000
commit5a9c1b8824bb84aaf8baccdfa2780a94af5c0f44 (patch)
treeabb0eed7f59567b73b0087d2f1e68c89254f7d2a /lib/sqlalchemy/dialects/postgresql
parent79ce8e89bd0537d26c8c3594557b2aa4c67f8f90 (diff)
downloadsqlalchemy-5a9c1b8824bb84aaf8baccdfa2780a94af5c0f44.tar.gz
merge from branches/clauseelement-nonzero
adds a __nonzero__ to _BinaryExpression to avoid faulty comparisons during hash collisions (which only occur on Jython) fixes #1547
Diffstat (limited to 'lib/sqlalchemy/dialects/postgresql')
-rw-r--r--lib/sqlalchemy/dialects/postgresql/base.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/sqlalchemy/dialects/postgresql/base.py b/lib/sqlalchemy/dialects/postgresql/base.py
index a6fa21f99..78ea1a8fc 100644
--- a/lib/sqlalchemy/dialects/postgresql/base.py
+++ b/lib/sqlalchemy/dialects/postgresql/base.py
@@ -240,8 +240,8 @@ class PGCompiler(compiler.SQLCompiler):
return text
def get_select_precolumns(self, select):
- if select._distinct:
- if isinstance(select._distinct, bool):
+ if select._distinct is not False:
+ if select._distinct is True:
return "DISTINCT "
elif isinstance(select._distinct, (list, tuple)):
return "DISTINCT ON (" + ', '.join(