diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2013-11-28 12:37:15 -0500 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2013-11-28 12:37:15 -0500 |
| commit | bb60a8ad946dd331f546f06a156b7ebb87d1709d (patch) | |
| tree | d530604307af524dc87355811fd103718114c258 /lib/sqlalchemy/dialects/oracle/base.py | |
| parent | 106e793d0573b5bcd1ddee549bca1a546aa13972 (diff) | |
| download | sqlalchemy-bb60a8ad946dd331f546f06a156b7ebb87d1709d.tar.gz | |
- work in progress, will squash
Diffstat (limited to 'lib/sqlalchemy/dialects/oracle/base.py')
| -rw-r--r-- | lib/sqlalchemy/dialects/oracle/base.py | 31 |
1 files changed, 10 insertions, 21 deletions
diff --git a/lib/sqlalchemy/dialects/oracle/base.py b/lib/sqlalchemy/dialects/oracle/base.py index 0bd009807..a3c31b7cc 100644 --- a/lib/sqlalchemy/dialects/oracle/base.py +++ b/lib/sqlalchemy/dialects/oracle/base.py @@ -632,7 +632,7 @@ class OracleCompiler(compiler.SQLCompiler): # If needed, add the ora_rn, and wrap again with offset. if select._offset is None: - limitselect.for_update = select.for_update + limitselect._for_update_arg = select._for_update_arg select = limitselect else: limitselect = limitselect.column( @@ -651,7 +651,7 @@ class OracleCompiler(compiler.SQLCompiler): offsetselect.append_whereclause( sql.literal_column("ora_rn") > offset_value) - offsetselect.for_update = select.for_update + offsetselect._for_update_arg = select._for_update_arg select = offsetselect kwargs['iswrapper'] = getattr(select, '_is_wrapper', False) @@ -666,27 +666,16 @@ class OracleCompiler(compiler.SQLCompiler): tmp = ' FOR UPDATE' - # backwards compatibility - if isinstance(select.for_update, bool): - if select.for_update: - return tmp - elif isinstance(select.for_update, str): - if select.for_update == 'nowait': - return tmp + ' NOWAIT' - else: - return tmp + if select._for_update_arg.nowait: + tmp += " NOWAIT" - if isinstance(select.for_update.of, list): - tmp += ' OF ' + ', '.join(['.'.join(of) for of in select.for_update.of]) - elif isinstance(select.for_update.of, tuple): - tmp += ' OF ' + '.'.join(select.for_update.of) + if select._for_update_arg.of: + tmp += ' OF ' + ', '.join( + self._process(elem) for elem in + select._for_update_arg.of + ) - if select.for_update.mode == 'update_nowait': - return tmp + ' NOWAIT' - elif select.for_update.mode == 'update': - return tmp - else: - return super(OracleCompiler, self).for_update_clause(select) + return tmp class OracleDDLCompiler(compiler.DDLCompiler): |
