summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/dialects/mysql/base.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2017-11-13 09:21:48 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2017-11-13 09:23:14 -0500
commit4f054550b768985f1c3393e46e0fc26bfefeeaf6 (patch)
tree951bccee1e64cb5d1de5c3581a055ca2220b993a /lib/sqlalchemy/dialects/mysql/base.py
parent6448903b5287801aaefbf82b5fa108403d743e8f (diff)
downloadsqlalchemy-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 'lib/sqlalchemy/dialects/mysql/base.py')
-rw-r--r--lib/sqlalchemy/dialects/mysql/base.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/sqlalchemy/dialects/mysql/base.py b/lib/sqlalchemy/dialects/mysql/base.py
index 2aaeacb19..bee62b76f 100644
--- a/lib/sqlalchemy/dialects/mysql/base.py
+++ b/lib/sqlalchemy/dialects/mysql/base.py
@@ -941,21 +941,21 @@ class MySQLCompiler(compiler.SQLCompiler):
return 'ON DUPLICATE KEY UPDATE ' + ', '.join(clauses)
def visit_concat_op_binary(self, binary, operator, **kw):
- return "concat(%s, %s)" % (self.process(binary.left),
- self.process(binary.right))
+ return "concat(%s, %s)" % (self.process(binary.left, **kw),
+ self.process(binary.right, **kw))
def visit_match_op_binary(self, binary, operator, **kw):
return "MATCH (%s) AGAINST (%s IN BOOLEAN MODE)" % \
- (self.process(binary.left), self.process(binary.right))
+ (self.process(binary.left, **kw), self.process(binary.right, **kw))
def get_from_hint_text(self, table, text):
return text
- def visit_typeclause(self, typeclause, type_=None):
+ def visit_typeclause(self, typeclause, type_=None, **kw):
if type_ is None:
type_ = typeclause.type.dialect_impl(self.dialect)
if isinstance(type_, sqltypes.TypeDecorator):
- return self.visit_typeclause(typeclause, type_.impl)
+ return self.visit_typeclause(typeclause, type_.impl, **kw)
elif isinstance(type_, sqltypes.Integer):
if getattr(type_, 'unsigned', False):
return 'UNSIGNED INTEGER'
@@ -1208,7 +1208,7 @@ class MySQLDDLCompiler(compiler.DDLCompiler):
return ' '.join(table_opts)
- def visit_create_index(self, create):
+ def visit_create_index(self, create, **kw):
index = create.element
self._verify_index_table(index)
preparer = self.preparer
@@ -1225,7 +1225,7 @@ class MySQLDDLCompiler(compiler.DDLCompiler):
index_prefix = index.kwargs.get('mysql_prefix', None)
if index_prefix:
- text += index_prefix + ' '
+ text += index_prefix + ' '
text += "INDEX %s ON %s " % (name, table)