.. changelog::
:version: 1.0.15
+ .. change::
+ :tags: bug, sql
+ :tickets: 3755
+
+ Fixed bug in :class:`.Table` where the internal method
+ ``_reset_exported()`` would corrupt the state of the object. This
+ method is intended for selectable objects and is called by the ORM
+ in some cases; an erroneous mapper configuration would could lead the
+ ORM to call this on on a :class:`.Table` object.
+
.. change::
:tags: bug, ext
:tickets: 3743
instrumentation.unregister_class(self.class_)
def _configure_pks(self):
-
self.tables = sql_util.find_tables(self.mapped_table)
self._pks_by_table = {}
col.table not in self._cols_by_table))
def _configure_properties(self):
-
# Column and other ClauseElement objects which are mapped
self.columns = self.c = util.OrderedProperties()
def _init_collections(self):
pass
+ def _reset_exported(self):
+ pass
+
@property
def _autoincrement_column(self):
return self.primary_key._autoincrement_column
t.info['bar'] = 'zip'
assert t.info['bar'] == 'zip'
+ def test_reset_exported_passes(self):
+
+ m = MetaData()
+
+ t = Table('t', m, Column('foo', Integer))
+ eq_(
+ list(t.c), [t.c.foo]
+ )
+
+ t._reset_exported()
+
+ eq_(
+ list(t.c), [t.c.foo]
+ )
+
def test_foreign_key_constraints_collection(self):
metadata = MetaData()
t1 = Table('foo', metadata, Column('a', Integer))