#24609: Concat on MySQL doesn't need the coalesce step
----------------------------------------------+--------------------
     Reporter:  adamchainz                    |      Owner:  nobody
         Type:  Cleanup/optimization          |     Status:  new
    Component:  Database layer (models, ORM)  |    Version:  1.8
     Severity:  Normal                        |   Keywords:
 Triage Stage:  Unreviewed                    |  Has patch:  1
Easy pickings:  0                             |      UI/UX:  0
----------------------------------------------+--------------------
 The new Concat database function calls ConcatPair which does a coalesce
 around each argument with the empty string on sqlite and MySQL.

 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.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/053.97690b3376a781055406f709e050fbd3%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to