diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2017-11-13 09:21:48 -0500 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2017-11-13 09:23:14 -0500 |
commit | 4f054550b768985f1c3393e46e0fc26bfefeeaf6 (patch) | |
tree | 951bccee1e64cb5d1de5c3581a055ca2220b993a /test/dialect/mysql/test_compiler.py | |
parent | 6448903b5287801aaefbf82b5fa108403d743e8f (diff) | |
download | sqlalchemy-4f054550b768985f1c3393e46e0fc26bfefeeaf6.tar.gz |
Propagate kwargs for mysql concat, match
Fixed bug where the MySQL "concat" and "match" operators failed to
propagate kwargs to the left and right expressions, causing compiler
options such as "literal_binds" to fail.
Also adds non-interpreted **kw for visit_create_index, visit_typeclause
Change-Id: Iaf54ac18949cc6a54f50678125f010b4f12c5673
Fixes: #4136
Diffstat (limited to 'test/dialect/mysql/test_compiler.py')
-rw-r--r-- | test/dialect/mysql/test_compiler.py | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/test/dialect/mysql/test_compiler.py b/test/dialect/mysql/test_compiler.py index e8731e532..cebbfc896 100644 --- a/test/dialect/mysql/test_compiler.py +++ b/test/dialect/mysql/test_compiler.py @@ -8,7 +8,7 @@ from sqlalchemy import Table, MetaData, Column, select, String, \ NUMERIC, DECIMAL, Numeric, Float, FLOAT, TIMESTAMP, DATE, \ DATETIME, TIME, \ DateTime, Time, Date, Interval, NCHAR, CHAR, CLOB, TEXT, Boolean, \ - BOOLEAN, LargeBinary, BLOB, SmallInteger, INT, func, cast + BOOLEAN, LargeBinary, BLOB, SmallInteger, INT, func, cast, literal from sqlalchemy.dialects.mysql import insert from sqlalchemy.dialects.mysql import base as mysql @@ -202,6 +202,22 @@ class CompileTest(fixtures.TestBase, AssertsCompiledSQL): matchtable.c.title.match('somstr'), "MATCH (matchtable.title) AGAINST (%s IN BOOLEAN MODE)") + def test_match_compile_kw(self): + expr = literal('x').match(literal('y')) + self.assert_compile( + expr, + "MATCH ('x') AGAINST ('y' IN BOOLEAN MODE)", + literal_binds=True + ) + + def test_concat_compile_kw(self): + expr = literal('x', type_=String) + literal('y', type_=String) + self.assert_compile( + expr, + "concat('x', 'y')", + literal_binds=True + ) + def test_for_update(self): table1 = table('mytable', column('myid'), column('name'), column('description')) |