From: Mike Bayer Date: Tue, 10 Feb 2015 01:49:19 +0000 (-0500) Subject: - additional mysql cast-related test fixes X-Git-Tag: rel_1_0_0b1~61 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3c46eb17ed033d83592bf3b22b74ca72d73f7113;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git - additional mysql cast-related test fixes --- diff --git a/test/dialect/mysql/test_query.py b/test/dialect/mysql/test_query.py index ccb501651a..f19177c2ae 100644 --- a/test/dialect/mysql/test_query.py +++ b/test/dialect/mysql/test_query.py @@ -10,6 +10,7 @@ class IdiosyncrasyTest(fixtures.TestBase, AssertsCompiledSQL): __only_on__ = 'mysql' __backend__ = True + @testing.emits_warning() def test_is_boolean_symbols_despite_no_native(self): is_( testing.db.scalar(select([cast(true().is_(true()), Boolean)])), diff --git a/test/orm/test_query.py b/test/orm/test_query.py index a2a1ee0961..b83a6304b4 100644 --- a/test/orm/test_query.py +++ b/test/orm/test_query.py @@ -1588,6 +1588,14 @@ class FilterTest(QueryTest, AssertsCompiledSQL): offset(bindparam('offset')).params(limit=2, offset=1).all(), [User(id=8), User(id=9)] ) + + @testing.fails_on("mysql", "doesn't like CAST in the limit clause") + @testing.requires.bound_limit_offset + def test_select_with_bindparam_offset_limit_w_cast(self): + User = self.classes.User + sess = create_session() + q1 = sess.query(self.classes.User).\ + order_by(self.classes.User.id).limit(bindparam('n')) eq_( list( sess.query(User).params(a=1, b=3).order_by(User.id)