Skip to content
Browse files

Fix some invalid-format datetimes in queries.

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...
1 parent 0bbd75b commit c339887d24a316365ddfc3f768d628202dd57fe8 @sphery sphery committed
View
2 mythtv/libs/libmyth/programinfo.cpp
@@ -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);
View
2 mythtv/libs/libmythtv/dbcheck.cpp
@@ -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
};
View
3 mythtv/programs/mythbackend/scheduler.cpp
@@ -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
{

0 comments on commit c339887

Please sign in to comment.
Something went wrong with that request. Please try again.