[Koha-bugs] [Bug 8164] Replace IFNULL() with COALESCE() in all database calls

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Fri Aug 24 00:14:02 CEST 2012


http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8164

Chris Cormack <chris at bigballofwax.co.nz> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #11791|0                           |1
        is obsolete|                            |

--- Comment #2 from Chris Cormack <chris at bigballofwax.co.nz> ---
Created attachment 11811
  -->
http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=11811&action=edit
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 at catalyst.net.nz>

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list