project-hatohol/hatohol — pull request #466 by ashie (2014-08-27 08:49:10+00:00)
Title: [DBTablesMonitoring] Fix a bug that getLastEventId() returns unexpected ...

...value

When no event exists, getLastEventId() returns 0 in spite of
expecting EVENT_NOT_FOUND.

In this commit we use a SQL function coalesce to avoid this issue.

Since getLastChangeTimeOfTrigger() has similar code, I also fixed
this function although it doesn't have such problem (because the
expected value is 0 for this case).