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-02-21 01:48:13 (GMT)
commit7e33788e5b75049d8eaceee589606a69241eab24 (patch)
treed8578f6ff7c72c4e68ec1d72a65d3b5f168f795f
parent8ff39aa56e6fdb4a080b28fb859f0349429de9d3 (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).
-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 8c8991a..bf89568 100644
--- a/mythtv/libs/libmyth/programinfo.cpp
+++ b/mythtv/libs/libmyth/programinfo.cpp
@@ -2669,7 +2669,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 fa43d1a..f21ec29 100644
--- a/mythtv/libs/libmythtv/dbcheck.cpp
+++ b/mythtv/libs/libmythtv/dbcheck.cpp
@@ -2019,7 +2019,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 bd81323..33a9dc4 100644
--- a/mythtv/programs/mythbackend/scheduler.cpp
+++ b/mythtv/programs/mythbackend/scheduler.cpp
@@ -1446,9 +1446,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
{