summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql/base.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sqlalchemy/sql/base.py')
-rw-r--r--lib/sqlalchemy/sql/base.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/sqlalchemy/sql/base.py b/lib/sqlalchemy/sql/base.py
index 81685dfe0..d9f05e823 100644
--- a/lib/sqlalchemy/sql/base.py
+++ b/lib/sqlalchemy/sql/base.py
@@ -54,6 +54,8 @@ class Immutable(object):
class SingletonConstant(Immutable):
+ """Represent SQL constants like NULL, TRUE, FALSE"""
+
def __new__(cls, *arg, **kw):
return cls._singleton
@@ -63,6 +65,13 @@ class SingletonConstant(Immutable):
obj.__init__()
cls._singleton = obj
+ # don't proxy singletons. this means that a SingletonConstant
+ # will never be a "corresponding column" in a statement; the constant
+ # can be named directly and as it is often/usually compared against using
+ # "IS", it can't be adapted to a subquery column in any case.
+ # see :ticket:`6259`.
+ proxy_set = frozenset()
+
def _from_objects(*elements):
return itertools.chain.from_iterable(