Archive for November, 2006

The SUM(col) of zero rows is

Wednesday, November 29th, 2006

This just annoys me so much. The sum of an empty set of integers is zero, not undefined.

However neither Oracle nor MySQL understand this. I can only assume this variation from common sense and mathematics is considered the “best practices” definition of the SQL SUM function.

mysql> desc email_box;
| box_size_bytes | int(10)     |

mysql> select count(*) from email_box;
|        0 |

mysql> select sum(box_size_bytes) from email_box;
| NULL |

gmail errors using T-Mobile UMTS card

Thursday, November 9th, 2006

I started to get errors when using gmail. Gmail is normally very reliable.

I would enter the URL in Firefox, the white background with "Loading…" top-left would appear, then a little later "This appears to be taking longer than normal" would appear, and that was it.

It turned out, I only got the errors when using a T-Mobile UMTS card (in Austria). This has an option to "compress images" which is on by default. This means that JPEGs look nastier (but load faster) than normal. This was somehow corrupting gmail! Go to the URL "1.2.3.4" to change this. Even once you've changed it, it "forgets" you've changed it, so you've got to do it once a session. And the browser can cache the downgraded images so you have to clear the browser cache sometimes as well.

All seems well using Internet Explorer, and all seems well using the "basic HTML version".