diff options
| author | mike bayer <mike_mp@zzzcomputing.com> | 2021-04-15 12:35:07 +0000 |
|---|---|---|
| committer | Gerrit Code Review <gerrit@ci3.zzzcomputing.com> | 2021-04-15 12:35:07 +0000 |
| commit | e222f6b3f201c43d39871447a701ad09dee54b88 (patch) | |
| tree | f340ba9172025b2f323bf99cc2251bc90c190328 /lib/sqlalchemy/sql/base.py | |
| parent | ea225c63f98dc3c250cee1b243762970b8e0932a (diff) | |
| parent | 60b0a693c97e7ab504a0d36497b71ccba24ac8e8 (diff) | |
| download | sqlalchemy-e222f6b3f201c43d39871447a701ad09dee54b88.tar.gz | |
Merge "Fix with_expression() cache leak; don't adapt singletons"
Diffstat (limited to 'lib/sqlalchemy/sql/base.py')
| -rw-r--r-- | lib/sqlalchemy/sql/base.py | 9 |
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( |
