Fixed #24609 -- Made ConcatPair use CONCAT_WS() on MySQL

This commit is contained in:
Adam Chainz 2015-04-08 22:26:09 +01:00 committed by Tim Graham
parent 418f75d55f
commit 9d0c600d8d
1 changed files with 3 additions and 1 deletions

View File

@ -47,7 +47,9 @@ class ConcatPair(Func):
return super(ConcatPair, self).as_sql(compiler, connection)
def as_mysql(self, compiler, connection):
self.coalesce()
# Use CONCAT_WS with an empty separator so that NULLs are ignored.
self.function = 'CONCAT_WS'
self.template = "%(function)s('', %(expressions)s)"
return super(ConcatPair, self).as_sql(compiler, connection)
def coalesce(self):