Bugfix evaluate NULL to 0 if lastrun is 0000-00...
Bugfix evaluate NULL to 0 if lastrun is 0000-00...

By default UNIX_TIMESTAMP(0000-00-00 00:00:00) will be evaluated to null
by the mysql. and some timestamp minus NULL will be NULL. New jobs have
the value 0000-00-00 00:00:00 in last run and this is needed to calculate
if it has to be executed if the period is over. With IFNULL it is possible
to cast a NULL to a 0 and everything works fine again.

RNT-Forest/OVZ