diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2012-08-27 19:40:12 -0400 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2012-08-27 19:40:12 -0400 |
| commit | 7d6c1c4a95596d5d83d9187d823f88fdc46f35b6 (patch) | |
| tree | 1899e61ed65a2e5e44698bf06a3342aa1e89b422 /test/sql/test_compiler.py | |
| parent | 3a2d617f7f4232ae6f0e256e6b4327e48118ffbf (diff) | |
| download | sqlalchemy-7d6c1c4a95596d5d83d9187d823f88fdc46f35b6.tar.gz | |
- [feature] Reworked the startswith(), endswith(),
contains() operators to do a better job with
negation (NOT LIKE), and also to assemble them
at compilation time so that their rendered SQL
can be altered, such as in the case for Firebird
STARTING WITH [ticket:2470]
- [feature] firebird - The "startswith()" operator renders
as "STARTING WITH", "~startswith()" renders
as "NOT STARTING WITH", using FB's more efficient
operator. [ticket:2470]
Diffstat (limited to 'test/sql/test_compiler.py')
| -rw-r--r-- | test/sql/test_compiler.py | 55 |
1 files changed, 0 insertions, 55 deletions
diff --git a/test/sql/test_compiler.py b/test/sql/test_compiler.py index 40d29f222..356f2e8b1 100644 --- a/test/sql/test_compiler.py +++ b/test/sql/test_compiler.py @@ -1029,61 +1029,6 @@ class SelectTest(fixtures.TestBase, AssertsCompiledSQL): ]: self.assert_compile(expr, check, dialect=dialect) - def test_composed_string_comparators(self): - self.assert_compile( - table1.c.name.contains('jo'), - "mytable.name LIKE '%%' || :name_1 || '%%'" , - checkparams = {'name_1': u'jo'}, - ) - self.assert_compile( - table1.c.name.contains('jo'), - "mytable.name LIKE concat(concat('%%', %s), '%%')" , - checkparams = {'name_1': u'jo'}, - dialect=mysql.dialect() - ) - self.assert_compile( - table1.c.name.contains('jo', escape='\\'), - "mytable.name LIKE '%%' || :name_1 || '%%' ESCAPE '\\'" , - checkparams = {'name_1': u'jo'}, - ) - self.assert_compile( - table1.c.name.startswith('jo', escape='\\'), - "mytable.name LIKE :name_1 || '%%' ESCAPE '\\'" ) - self.assert_compile( - table1.c.name.endswith('jo', escape='\\'), - "mytable.name LIKE '%%' || :name_1 ESCAPE '\\'" ) - self.assert_compile( - table1.c.name.endswith('hn'), - "mytable.name LIKE '%%' || :name_1", - checkparams = {'name_1': u'hn'}, ) - self.assert_compile( - table1.c.name.endswith('hn'), - "mytable.name LIKE concat('%%', %s)", - checkparams = {'name_1': u'hn'}, dialect=mysql.dialect() - ) - self.assert_compile( - table1.c.name.startswith(u"hi \xf6 \xf5"), - "mytable.name LIKE :name_1 || '%%'", - checkparams = {'name_1': u'hi \xf6 \xf5'}, - ) - self.assert_compile( - column('name').endswith(text("'foo'")), - "name LIKE '%%' || 'foo'" ) - self.assert_compile( - column('name').endswith(literal_column("'foo'")), - "name LIKE '%%' || 'foo'" ) - self.assert_compile( - column('name').startswith(text("'foo'")), - "name LIKE 'foo' || '%%'" ) - self.assert_compile( - column('name').startswith(text("'foo'")), - "name LIKE concat('foo', '%%')", dialect=mysql.dialect()) - self.assert_compile( - column('name').startswith(literal_column("'foo'")), - "name LIKE 'foo' || '%%'" ) - self.assert_compile( - column('name').startswith(literal_column("'foo'")), - "name LIKE concat('foo', '%%')", dialect=mysql.dialect()) def test_multiple_col_binds(self): self.assert_compile( |
