diff options
| author | Nicolas Rolin <nicolas.rolin@cubber.com> | 2018-05-25 13:27:22 -0400 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2018-08-07 17:04:10 -0400 |
| commit | b17fa2513e412b8f9aa1f62c0acc7fa3805e632b (patch) | |
| tree | e0b565bbdb40394a1a55f10db63dd5408ee97822 /lib/sqlalchemy/dialects/oracle/base.py | |
| parent | abeea1d82db34232bbef01e98fa4d1de0f583eb6 (diff) | |
| download | sqlalchemy-b17fa2513e412b8f9aa1f62c0acc7fa3805e632b.tar.gz | |
Add support of empty list in exanding of bindparam
Added new logic to the "expanding IN" bound parameter feature whereby if
the given list is empty, a special "empty set" expression that is specific
to different backends is generated, thus allowing IN expressions to be
fully dynamic including empty IN expressions.
Fixes: #4271
Change-Id: Icc3c73bbd6005206b9d06baaeb14a097af5edd36
Pull-request: https://github.com/zzzeek/sqlalchemy/pull/432
Diffstat (limited to 'lib/sqlalchemy/dialects/oracle/base.py')
| -rw-r--r-- | lib/sqlalchemy/dialects/oracle/base.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/sqlalchemy/dialects/oracle/base.py b/lib/sqlalchemy/dialects/oracle/base.py index 356c2a2bf..76ae1ced6 100644 --- a/lib/sqlalchemy/dialects/oracle/base.py +++ b/lib/sqlalchemy/dialects/oracle/base.py @@ -909,6 +909,9 @@ class OracleCompiler(compiler.SQLCompiler): def limit_clause(self, select, **kw): return "" + def visit_empty_set_expr(self, type_): + return 'SELECT 1 FROM DUAL WHERE 1!=1' + def for_update_clause(self, select, **kw): if self.is_subquery(): return "" |
