metadata pickling regression

Issue #2104 resolved
Mike Bayer repo owner created an issue
from sqlalchemy import *
import pickle

metadata = MetaData()

Table('a',metadata,
     Column('id',Integer,primary_key=True),
     Column('x', Integer, Sequence("x_seq"), ),
     )

metadata2 = pickle.loads(pickle.dumps(metadata))
Table('a',metadata2,
     Column('id',Integer,primary_key=True),
     Column('x', Integer, Sequence("x_seq"), ),
     useexisting=True)

Comments (2)

  1. Mike Bayer reporter

    93da3087f1a068018a3c5a67f61dbbfa5178bdf0 , but some more thinking in de529fb81cc80cd49666a80ef60de6015ff81c1c . We change _sequences to be a dict which keys on the name/schema of the Sequence itself, and also support that the Sequence is present in _sequences from an unpickle regardless of if it was explicitly placed there. The last Sequence associated with the Table wins. The previous one is silently replaced, not unlike when Column is specified.

  2. Log in to comment