Disregard. Apparently the value of the timestamp of 0001-01-01 00:00:00 is
quite a bit bigger than an integer, which means you'll have problems casting
that value to an integer.
> UNIX_TIMESTAMP( p.next ) AS next, p.id, p.did as dwid,
> pt.units, pt.interval, pt.table, pt.name,
> pt.type, IFNULL( sl.state, 0 ) AS state, sl.value,
> UNIX_TIMESTAMP( sl.start_time ) AS sctstamp,