Skip to content

Commit

Permalink
Fix some invalid-format datetimes in queries.
Browse files Browse the repository at this point in the history
Fix some hard-coded, string datetime representations in queries that
were using an invalid format that no longer works with MySQL 5.5.  These
datetime literals now use the correct MySQL SQL datetime literal format
(which is also the ISO SQL datetime literal format).

Huge thanks to Rob Smith for testing with MySQL 5.5 and seeking out the
datetime-usage within queries.

Refs #8585 (possibly fixes #8585).
(cherry picked from commit 7e33788)
  • Loading branch information
sphery committed Apr 16, 2011
1 parent 0bbd75b commit c339887
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion mythtv/libs/libmyth/programinfo.cpp
Expand Up @@ -2661,7 +2661,7 @@ void ProgramInfo::UpdateLastDelete(bool setTime) const
}
else
{
query.prepare("UPDATE record SET last_delete = '0000-00-00T00:00:00' "
query.prepare("UPDATE record SET last_delete = '0000-00-00 00:00:00' "
"WHERE recordid = :RECORDID");
}
query.bindValue(":RECORDID", recordid);
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythtv/dbcheck.cpp
Expand Up @@ -2011,7 +2011,7 @@ NULL
"UPDATE settings SET value = 'MythFillGrabberSuggestsTime' "
"WHERE value = 'HonorGrabberNextSuggestedMythfilldatabaseRunTime';",
"UPDATE settings SET value = 'MythFillSuggestedRunTime', "
" data = '1970-01-01T00:00:00' "
" data = '1970-01-01 00:00:00' "
"WHERE value = 'NextSuggestedMythfilldatabaseRun';",
NULL
};
Expand Down
3 changes: 2 additions & 1 deletion mythtv/programs/mythbackend/scheduler.cpp
Expand Up @@ -1456,9 +1456,10 @@ void Scheduler::UpdateNextRecord(void)
if (nextRecMap[recid].isNull() || !next_record.isValid())
{
subquery.prepare("UPDATE record "
"SET next_record = '0000-00-00T00:00:00' "
"SET next_record = '0000-00-00 00:00:00' "
"WHERE recordid = :RECORDID;");
subquery.bindValue(":RECORDID", recid);

}
else
{
Expand Down

0 comments on commit c339887

Please sign in to comment.