summaryrefslogtreecommitdiff
path: root/test/aaa_profiling
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2012-03-10 16:18:52 -0800
committerMike Bayer <mike_mp@zzzcomputing.com>2012-03-10 16:18:52 -0800
commit5448f6129cd0487c3d06324385cc2ef0701b5815 (patch)
treecdc8bd5a7312e37dc8fb873c7211be49e54b202c /test/aaa_profiling
parentdb69a48231754c4279b2ceb5ce7317a50ed839d2 (diff)
downloadsqlalchemy-5448f6129cd0487c3d06324385cc2ef0701b5815.tar.gz
- [bug] Fixed memory leak in core which would
occur when C extensions were used with particular types of result fetches, in particular when orm query.count() were called. [ticket:2427]
Diffstat (limited to 'test/aaa_profiling')
-rw-r--r--test/aaa_profiling/test_memusage.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/aaa_profiling/test_memusage.py b/test/aaa_profiling/test_memusage.py
index 579555c3f..cffe8b71f 100644
--- a/test/aaa_profiling/test_memusage.py
+++ b/test/aaa_profiling/test_memusage.py
@@ -496,6 +496,22 @@ class MemUsageTest(EnsureZeroed):
metadata.drop_all()
assert_no_mappers()
+ @testing.fails_if(lambda : testing.db.dialect.name == 'sqlite' \
+ and testing.db.dialect.dbapi.version > '2.5')
+ @testing.provide_metadata
+ def test_key_fallback_result(self):
+ e = testing.db
+ m = self.metadata
+ t = Table('t', m, Column('x', Integer), Column('y', Integer))
+ m.create_all(e)
+ e.execute(t.insert(), {"x":1, "y":1})
+ @profile_memory
+ def go():
+ r = e.execute(t.alias().select())
+ for row in r:
+ row[t.c.x]
+ go()
+
# fails on newer versions of pysqlite due to unusual memory behvior
# in pysqlite itself. background at:
# http://thread.gmane.org/gmane.comp.python.db.pysqlite.user/2290