Skip to content

Commit

Permalink
Fix some instances where ISODate was being used for DB insterts.
Browse files Browse the repository at this point in the history
mysql 5.5 and later reject ISO 8601 combined date and time format when used for DATETIME inserts.
  • Loading branch information
daniel-kristjansson committed Aug 20, 2011
1 parent 63b999e commit 19ec6e8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
8 changes: 4 additions & 4 deletions mythtv/libs/libmythtv/tvbrowsehelper.cpp
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion mythtv/programs/mythfrontend/proglist.cpp
Expand Up @@ -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);
Expand Down
5 changes: 3 additions & 2 deletions mythtv/programs/mythshutdown/main.cpp
Expand Up @@ -7,6 +7,7 @@ using namespace std;
#include <QCoreApplication>
#include <QFile>

#include "util.h"
#include "exitcodes.h"
#include "mythcontext.h"
#include "mythdb.h"
Expand Down Expand Up @@ -395,7 +396,7 @@ static int setWakeupTime(QString sWakeupTime)
}

setGlobalSetting("MythShutdownNextScheduled",
dtWakeupTime.toString(Qt::ISODate));
MythDate::toString(dtWakeupTime, MythDate::kDatabase));

return 0;
}
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 19ec6e8

Please sign in to comment.