Summary: | Replace IFNULL() with COALESCE() in all database calls | ||
---|---|---|---|
Product: | Koha | Reporter: | Ian Walls <koha.sekjal> |
Component: | Architecture, internals, and plumbing | Assignee: | Jonathan Druart <jonathan.druart> |
Status: | CLOSED FIXED | QA Contact: | Marcel de Rooy <m.de.rooy> |
Severity: | enhancement | ||
Priority: | P5 - low | CC: | chris, jcamins, jonathan.druart, m.de.rooy |
Version: | 3.12 | ||
Hardware: | All | ||
OS: | All | ||
See Also: | https://bugzilla.mozilla.org/show_bug.cgi?id=253357 | ||
Change sponsored?: | --- | Patch complexity: | Trivial patch |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: | ||
Circulation function: | |||
Bug Depends on: | |||
Bug Blocks: | 7365 | ||
Attachments: |
Bug 8164: Replace IFNULL with COALESCE
Bug 8164: Replace IFNULL with COALESCE Signed patch |
Description
Ian Walls
2012-05-29 20:02:27 UTC
Created attachment 11791 [details] [review] Bug 8164: Replace IFNULL with COALESCE mysql> SELECT IFNULL(0, 123); +----------------+ | IFNULL(0, 123) | +----------------+ | 0 | +----------------+ 1 row in set (0.00 sec) mysql> SELECT IFNULL(1, 123); +----------------+ | IFNULL(1, 123) | +----------------+ | 1 | +----------------+ 1 row in set (0.00 sec) mysql> SELECT IFNULL(NULL, 123); +-------------------+ | IFNULL(NULL, 123) | +-------------------+ | 123 | +-------------------+ 1 row in set (0.00 sec) mysql> SELECT COALESCE(0, 123); +------------------+ | COALESCE(0, 123) | +------------------+ | 0 | +------------------+ 1 row in set (0.00 sec) mysql> SELECT COALESCE(1, 123); +------------------+ | COALESCE(1, 123) | +------------------+ | 1 | +------------------+ 1 row in set (0.00 sec) mysql> SELECT COALESCE(NULL, 123); +---------------------+ | COALESCE(NULL, 123) | +---------------------+ | 123 | +---------------------+ 1 row in set (0.00 sec) Created attachment 11811 [details] [review] Bug 8164: Replace IFNULL with COALESCE mysql> SELECT IFNULL(0, 123); +----------------+ | IFNULL(0, 123) | +----------------+ | 0 | +----------------+ 1 row in set (0.00 sec) mysql> SELECT IFNULL(1, 123); +----------------+ | IFNULL(1, 123) | +----------------+ | 1 | +----------------+ 1 row in set (0.00 sec) mysql> SELECT IFNULL(NULL, 123); +-------------------+ | IFNULL(NULL, 123) | +-------------------+ | 123 | +-------------------+ 1 row in set (0.00 sec) mysql> SELECT COALESCE(0, 123); +------------------+ | COALESCE(0, 123) | +------------------+ | 0 | +------------------+ 1 row in set (0.00 sec) mysql> SELECT COALESCE(1, 123); +------------------+ | COALESCE(1, 123) | +------------------+ | 1 | +------------------+ 1 row in set (0.00 sec) mysql> SELECT COALESCE(NULL, 123); +---------------------+ | COALESCE(NULL, 123) | +---------------------+ | 123 | +---------------------+ 1 row in set (0.00 sec) Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz> Changing target version so this bug report will show up in the list of 3.12-targeted features and doesn't get lost in the shuffle during feature freeze. Tested Acquisition Late Orders and Lists. Created attachment 13676 [details] [review] Signed patch QA Comment: Works. Small patch improving code. Looks good to me. Passed QA This patch has been pushed to master. |