loaded collection will get cleared out if it's referenced in more than
one batch, and in all cases attributes will be overwritten on instances
that occur in more than one batch.
-
+
+- dialects
+
+ - PostgreSQL
+ - Fixed the missing call to subtype result processor for the PGArray
+ type. [ticket:913]
+
0.4.2
-----
- sql
arrtable = Table('arrtable', metadata,
Column('id', Integer, primary_key=True),
Column('intarr', postgres.PGArray(Integer)),
- Column('strarr', postgres.PGArray(String), nullable=False)
+ Column('strarr', postgres.PGArray(String(convert_unicode=True)), nullable=False)
)
metadata.create_all()
def tearDownAll(self):
self.assertEquals(results[0][0], [1,2,3,4,5,6])
arrtable.delete().execute()
+ def test_array_subtype_resultprocessor(self):
+ arrtable.insert().execute(intarr=[4,5,6], strarr=[[u'm\xe4\xe4'], [u'm\xf6\xf6']])
+ arrtable.insert().execute(intarr=[1,2,3], strarr=[u'm\xe4\xe4', u'm\xf6\xf6'])
+ results = arrtable.select(order_by=[arrtable.c.intarr]).execute().fetchall()
+ self.assertEquals(len(results), 2)
+ self.assertEquals(results[0]['strarr'], [u'm\xe4\xe4', u'm\xf6\xf6'])
+ self.assertEquals(results[1]['strarr'], [[u'm\xe4\xe4'], [u'm\xf6\xf6']])
+ arrtable.delete().execute()
+
if __name__ == "__main__":
testbase.main()