mirror of
https://github.com/sqlalchemy/sqlalchemy.git
synced 2026-06-02 13:59:02 -04:00
allow setattr() access to _CursorFairy directly, thereby removing the need for dialects to guess whether they have a wrapped cursor or not, fixes #1609, regression from r6471
This commit is contained in:
@@ -234,7 +234,7 @@ class Oracle_cx_oracleExecutionContext(OracleExecutionContext):
|
||||
def create_cursor(self):
|
||||
c = self._connection.connection.cursor()
|
||||
if self.dialect.arraysize:
|
||||
c.cursor.arraysize = self.dialect.arraysize
|
||||
c.arraysize = self.dialect.arraysize
|
||||
return c
|
||||
|
||||
def get_result_proxy(self):
|
||||
|
||||
+10
-4
@@ -431,15 +431,15 @@ class _ConnectionFairy(object):
|
||||
self._connection_record = None
|
||||
|
||||
class _CursorFairy(object):
|
||||
__slots__ = '__parent', 'cursor', 'execute'
|
||||
__slots__ = '_parent', 'cursor', 'execute'
|
||||
|
||||
def __init__(self, parent, cursor):
|
||||
self.__parent = parent
|
||||
self._parent = parent
|
||||
self.cursor = cursor
|
||||
self.execute = cursor.execute
|
||||
|
||||
def invalidate(self, e=None):
|
||||
self.__parent.invalidate(e=e)
|
||||
self._parent.invalidate(e=e)
|
||||
|
||||
def close(self):
|
||||
try:
|
||||
@@ -453,7 +453,13 @@ class _CursorFairy(object):
|
||||
|
||||
if isinstance(e, (SystemExit, KeyboardInterrupt)):
|
||||
raise
|
||||
|
||||
|
||||
def __setattr__(self, key, value):
|
||||
if key in self.__slots__:
|
||||
object.__setattr__(self, key, value)
|
||||
else:
|
||||
setattr(self.cursor, key, value)
|
||||
|
||||
def __getattr__(self, key):
|
||||
return getattr(self.cursor, key)
|
||||
|
||||
|
||||
@@ -243,7 +243,7 @@ class MultiSchemaTest(TestBase, AssertsCompiledSQL):
|
||||
__only_on__ = 'oracle'
|
||||
|
||||
def test_create_same_names_explicit_schema(self):
|
||||
schema = testing.db.dialect.get_default_schema_name(testing.db.connect())
|
||||
schema = testing.db.dialect.default_schema_name
|
||||
meta = MetaData(testing.db)
|
||||
parent = Table('parent', meta,
|
||||
Column('pid', Integer, primary_key=True),
|
||||
|
||||
Reference in New Issue
Block a user