mirror of
https://github.com/django/django.git
synced 2025-10-25 14:46:09 +00:00
Fixed #24609 -- Made ConcatPair use CONCAT_WS() on MySQL
This commit is contained in:
@@ -47,7 +47,9 @@ class ConcatPair(Func):
|
|||||||
return super(ConcatPair, self).as_sql(compiler, connection)
|
return super(ConcatPair, self).as_sql(compiler, connection)
|
||||||
|
|
||||||
def as_mysql(self, 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)
|
return super(ConcatPair, self).as_sql(compiler, connection)
|
||||||
|
|
||||||
def coalesce(self):
|
def coalesce(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user