summaryrefslogtreecommitdiff
path: root/test/sql/test_query.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2010-06-24 12:19:15 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2010-06-24 12:19:15 -0400
commit87664ce88ab8931ccaacbac3357f484069efe6e9 (patch)
tree5635f38b27d3d6c489f9aeb41509a8dc890cb263 /test/sql/test_query.py
parent0adf381d994b0f374d2b6394bff5f2c423942c78 (diff)
downloadsqlalchemy-87664ce88ab8931ccaacbac3357f484069efe6e9.tar.gz
- The argument to "ESCAPE" of a LIKE operator or similar
is passed through render_literal_value(), which may implement escaping of backslashes. [ticket:1400] - Postgresql render_literal_value() is overridden which escapes backslashes, currently applies to the ESCAPE clause of LIKE and similar expressions. Ultimately this will have to detect the value of "standard_conforming_strings" for full behavior. [ticket:1400] - MySQL render_literal_value() is overridden which escapes backslashes, currently applies to the ESCAPE clause of LIKE and similar expressions. This behavior is derived from detecting the value of NO_BACKSLASH_ESCAPES. [ticket:1400]
Diffstat (limited to 'test/sql/test_query.py')
-rw-r--r--test/sql/test_query.py16
1 files changed, 12 insertions, 4 deletions
diff --git a/test/sql/test_query.py b/test/sql/test_query.py
index 2b51d68a2..e8f9d118b 100644
--- a/test/sql/test_query.py
+++ b/test/sql/test_query.py
@@ -376,13 +376,21 @@ class QueryTest(TestBase):
)
for expr, result in (
- (select([users.c.user_id]).where(users.c.user_name.startswith('apple')), [(1,)]),
- (select([users.c.user_id]).where(users.c.user_name.contains('i % t')), [(5,)]),
- (select([users.c.user_id]).where(users.c.user_name.endswith('anas')), [(3,)]),
+ (select([users.c.user_id]).\
+ where(users.c.user_name.startswith('apple')), [(1,)]),
+ (select([users.c.user_id]).\
+ where(users.c.user_name.contains('i % t')), [(5,)]),
+ (select([users.c.user_id]).\
+ where(
+ users.c.user_name.endswith('anas')
+ ), [(3,)]),
+ (select([users.c.user_id]).\
+ where(
+ users.c.user_name.contains('i % t', escape='\\')
+ ), [(5,)]),
):
eq_(expr.execute().fetchall(), result)
-
@testing.fails_on("firebird", "see dialect.test_firebird:MiscTest.test_percents_in_text")
@testing.fails_on("oracle", "neither % nor %% are accepted")
@testing.fails_on("+pg8000", "can't interpret result column from '%%'")