Matt: April 2009 Archives

If you spend a lot of time dealing with languages that are loosely typed and have scalars running wild, then like me, you may be prone to doing something like this:

mysql> select NOW(); select GREATEST(NOW(), DATE_ADD(NOW(),INTERVAL 1 DAY)); +---------------------+ | NOW() | +---------------------+ | 2009-04-28 14:17:36 | +---------------------+ 1 row in set (0.00 sec)

+-------------------------------------------------+
| GREATEST(NOW(), DATE_ADD(NOW(),INTERVAL 1 DAY)) |
+-------------------------------------------------+
| 2009-04-29 14:17:36 |
+-------------------------------------------------+
1 row in set (0.00 sec)

mysql> select GREATEST(NULL, NOW());
+-----------------------+
| GREATEST(NULL, NOW()) |
+-----------------------+
| NULL |
+-----------------------+
1 row in set (0.00 sec)

I'm glad the bug this caused had a minor impact, and this will hopefully be sufficient to slap me out of my loosely typed comfort zone for a while.

October 2009

Sun Mon Tue Wed Thu Fri Sat
        1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31
Creative Commons License
This weblog is licensed under a Creative Commons License.