summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/sqlalchemy/dialects/oracle/zxjdbc.py10
-rw-r--r--test/sql/test_returning.py4
2 files changed, 6 insertions, 8 deletions
diff --git a/lib/sqlalchemy/dialects/oracle/zxjdbc.py b/lib/sqlalchemy/dialects/oracle/zxjdbc.py
index fba16288a..5b4760ff8 100644
--- a/lib/sqlalchemy/dialects/oracle/zxjdbc.py
+++ b/lib/sqlalchemy/dialects/oracle/zxjdbc.py
@@ -53,17 +53,17 @@ class _ZxJDBCNumeric(sqltypes.Numeric):
class Oracle_zxjdbcCompiler(OracleCompiler):
def returning_clause(self, stmt, returning_cols):
- columnlist = list(expression._select_iterables(returning_cols))
+ self.returning_cols = list(expression._select_iterables(returning_cols))
# within_columns_clause=False so that labels (foo AS bar) don't render
columns = [self.process(c, within_columns_clause=False, result_map=self.result_map)
- for c in columnlist]
+ for c in self.returning_cols]
if not hasattr(self, 'returning_parameters'):
self.returning_parameters = []
binds = []
- for i, col in enumerate(columnlist):
+ for i, col in enumerate(self.returning_cols):
dbtype = col.type.dialect_impl(self.dialect).get_dbapi_type(self.dialect.dbapi)
self.returning_parameters.append((i + 1, dbtype))
@@ -123,10 +123,8 @@ class ReturningResultProxy(base.FullyBufferedResultProxy):
super(ReturningResultProxy, self).__init__(context)
def _cursor_description(self):
- returning = self.context.compiled.returning
-
ret = []
- for c in returning:
+ for c in self.context.compiled.returning_cols:
if hasattr(c, 'name'):
ret.append((c.name, c.type))
else:
diff --git a/test/sql/test_returning.py b/test/sql/test_returning.py
index ba3e2ebb9..332f4eef5 100644
--- a/test/sql/test_returning.py
+++ b/test/sql/test_returning.py
@@ -96,7 +96,7 @@ class ReturningTest(TestBase, AssertsExecutionResults):
eq_(result.fetchall(), [(1,)])
@testing.fails_on('postgresql', '')
- @testing.fails_on('oracle', '')
+ @testing.fails_on('oracle+cx_oracle', '')
@testing.crashes('mssql+mxodbc', 'Raises an error')
def test_executemany():
# return value is documented as failing with psycopg2/executemany
@@ -106,7 +106,7 @@ class ReturningTest(TestBase, AssertsExecutionResults):
if testing.against('mssql+zxjdbc'):
# jtds apparently returns only the first row
eq_(result2.fetchall(), [(2, 2, False, None)])
- elif testing.against('firebird', 'mssql'):
+ elif testing.against('firebird', 'mssql', 'oracle'):
# Multiple inserts only return the last row
eq_(result2.fetchall(), [(3, 3, True, None)])
else: