From: Mike Bayer Date: Tue, 31 Oct 2006 15:58:51 +0000 (+0000) Subject: - fixed direct execution of Compiled objects X-Git-Tag: rel_0_3_1~24 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f60151ebd3abc59327e2939e4513e58db1c48e46;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git - fixed direct execution of Compiled objects --- diff --git a/CHANGES b/CHANGES index acddae34f6..a6021ca927 100644 --- a/CHANGES +++ b/CHANGES @@ -8,6 +8,7 @@ passive_deletes=True on a relation(). - MySQL catches exception on "describe" and reports as NoSuchTableError - further fixes to sqlite booleans, weren't working as defaults - fix to postgres sequence quoting when using schemas +- fixed direct execution of Compiled objects 0.3.0 - General: diff --git a/lib/sqlalchemy/engine/base.py b/lib/sqlalchemy/engine/base.py index 704767b014..07a88659be 100644 --- a/lib/sqlalchemy/engine/base.py +++ b/lib/sqlalchemy/engine/base.py @@ -299,7 +299,7 @@ class Connection(Connectable): # poor man's multimethod/generic function thingy executors = { sql.ClauseElement : execute_clauseelement, - sql.Compiled : execute_compiled, + sql.ClauseVisitor : execute_compiled, schema.SchemaItem:execute_default, str.__mro__[-2] : execute_text } diff --git a/test/sql/query.py b/test/sql/query.py index 2c92a49322..96ad6ec8b1 100644 --- a/test/sql/query.py +++ b/test/sql/query.py @@ -50,7 +50,12 @@ class QueryTest(PersistTest): for row in r: l.append(row) self.assert_(len(l) == 3) - + + def test_compiled_execute(self): + s = select([self.users], self.users.c.user_id==bindparam('id')).compile() + c = testbase.db.connect() + print repr(c.execute(s, id=7).fetchall()) + def test_global_metadata(self): t1 = Table('table1', Column('col1', Integer, primary_key=True), Column('col2', String(20)))