MySQL's CONCAT *does* return NULL if any argument is NULL, however it has
a very similar function, CONCAT_WS that just silently skips NULLs.
Therefore it can be used rather than unnecessary COALESCE calls:
https://dev.mysql.com/doc/refman/5.5/en/string-functions.html
#function_concat-ws
I've implemented this in a patch - it's not a big change.
--
Ticket URL: <https://code.djangoproject.com/ticket/24609>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* status: new => assigned
* needs_better_patch: => 0
* owner: nobody => adamchainz
* needs_tests: => 0
* needs_docs: => 0
Comment:
https://github.com/django/django/pull/4468
--
Ticket URL: <https://code.djangoproject.com/ticket/24609#comment:1>
Comment (by adamchainz):
"runtests.py db_functions" passes with MySQL 5.6 locally.
--
Ticket URL: <https://code.djangoproject.com/ticket/24609#comment:2>
* stage: Unreviewed => Ready for checkin
Comment:
Looks okay to me (but not a MySQL user). Could someone else +1?
--
Ticket URL: <https://code.djangoproject.com/ticket/24609#comment:3>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"9d0c600d8d6359107cdbef5f0c30757321da09f6" 9d0c600]:
{{{
#!CommitTicketReference repository=""
revision="9d0c600d8d6359107cdbef5f0c30757321da09f6"
Fixed #24609 -- Made ConcatPair use CONCAT_WS() on MySQL
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/24609#comment:4>