summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael T. Dean <mdean@mythtv.org>2011-02-21 01:48:13 (GMT)
committer Michael T. Dean <mdean@mythtv.org>2011-04-16 23:10:24 (GMT)
commitc339887d24a316365ddfc3f768d628202dd57fe8 (patch)
treeadbc5e29559c80cea8f8e655aab9c17e50652284
parent0bbd75b72a2e4a0ac79662a4484797ccce4b37fe (diff)
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 7e33788e5b75049d8eaceee589606a69241eab24)
-rw-r--r--mythtv/libs/libmyth/programinfo.cpp2
-rw-r--r--mythtv/libs/libmythtv/dbcheck.cpp2
-rw-r--r--mythtv/programs/mythbackend/scheduler.cpp3
3 files changed, 4 insertions, 3 deletions
diff --git a/mythtv/libs/libmyth/programinfo.cpp b/mythtv/libs/libmyth/programinfo.cpp
index 39fa480..2a253d2 100644
--- a/mythtv/libs/libmyth/programinfo.cpp
+++ b/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);
diff --git a/mythtv/libs/libmythtv/dbcheck.cpp b/mythtv/libs/libmythtv/dbcheck.cpp
index 68990e2..9912bf8 100644
--- a/mythtv/libs/libmythtv/dbcheck.cpp
+++ b/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
};
diff --git a/mythtv/programs/mythbackend/scheduler.cpp b/mythtv/programs/mythbackend/scheduler.cpp
index f7479c3..c9837fe 100644
--- a/mythtv/programs/mythbackend/scheduler.cpp
+++ b/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
{