Q:

Why does MySQL time diff return greater than an hour for two times across the hour boundary?

I run
select timestamp('2013-10-17 19:00:45') - timestamp('2013-10-17 18:59:37');

And it returns
4108.000000

Why?  It's not a leap day, timestamp is the correct function, and subtracting works for times that don't cross an hour boundary.
One fix here is to use unix_timestamp instead of timestamp. But that still doesn't explain what weird thing is happening here.

A:

When you subtract datetimes, it first converts them to numbers in the form:
YYYYMMDDHHMMSS.uuuuuu

So you're seeing this result:
mysql> select 20131017190045.000000 - 20131017185937.000000 diff;
+-------------+
| diff        |
+-------------+
| 4108.000000 |
+-------------+

