Permalink
Browse files

Fix some instances where ISODate was being used for DB insterts.

mysql 5.5 and later reject ISO 8601 combined date and time format when used for DATETIME inserts.
  • Loading branch information...
1 parent 63b999e commit 19ec6e85b46d394b2a3cce3e24eb2d787b1753d9 @daniel-kristjansson daniel-kristjansson committed Aug 20, 2011
@@ -365,10 +365,10 @@ void TVBrowseHelper::GetNextProgramDB(
MSqlBindings bindings;
bindings[":CHANID"] = chanid;
- bindings[":NOWTS"] = nowtime.toString(Qt::ISODate);
- bindings[":LATESTTS"] = latesttime.toString(Qt::ISODate);
- bindings[":BROWSETS"] = browsetime.toString(Qt::ISODate);
- bindings[":BROWSETS2"] = browsetime.toString(Qt::ISODate);
+ bindings[":NOWTS"] = nowtime;
+ bindings[":LATESTTS"] = latesttime;
+ bindings[":BROWSETS"] = browsetime;
+ bindings[":BROWSETS2"] = browsetime;
QString querystr = " WHERE program.chanid = :CHANID ";
switch (direction)
@@ -690,7 +690,7 @@ void ProgLister::DeleteOldEpisode(bool ok)
"WHERE chanid = :CHANID AND "
" starttime = :STARTTIME");
query.bindValue(":CHANID", pi->GetChanID());
- query.bindValue(":STARTTIME", pi->GetScheduledStartTime(MythDate::ISODate));
+ query.bindValue(":STARTTIME", pi->GetScheduledStartTime());
if (!query.exec())
MythDB::DBError("ProgLister::DeleteOldEpisode", query);
@@ -7,6 +7,7 @@ using namespace std;
#include <QCoreApplication>
#include <QFile>
+#include "util.h"
#include "exitcodes.h"
#include "mythcontext.h"
#include "mythdb.h"
@@ -395,7 +396,7 @@ static int setWakeupTime(QString sWakeupTime)
}
setGlobalSetting("MythShutdownNextScheduled",
- dtWakeupTime.toString(Qt::ISODate));
+ MythDate::toString(dtWakeupTime, MythDate::kDatabase));
return 0;
}
@@ -602,7 +603,7 @@ static int shutdown()
// save the next wakuptime in the db
setGlobalSetting("MythShutdownWakeupTime",
- dtWakeupTime.toString(Qt::ISODate));
+ MythDate::toString(dtWakeupTime, MythDate::kDatabase));
// stop here to debug
//return 0;

0 comments on commit 19ec6e8

Please sign in to comment.