summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael T. Dean <mdean@mythtv.org>2011-08-26 23:27:55 (GMT)
committer Michael T. Dean <mdean@mythtv.org>2011-08-26 23:27:55 (GMT)
commit8b9e5ce0d92721396144fe0014ab4b90cde5152b (patch)
tree87ea7f23d47218fc0818731177279ace7e064bbb
parent4bba807ea5ec563698cdbb94e5f787484d7326e0 (diff)
Fix invalid-string-format date passing to MySQL.
This fixes a lot of instances where we were passing incorrectly-formatted string representations of date/time values in prepared queries. This is an issue now that MySQL 5.5 is picky about receiving properly-formatted strings. Thanks to Daniel K for finding another pattern to search for direct binding of string-formatted dates. Refs #8585. (backports 3d42de592 from master)
-rw-r--r--mythtv/libs/libmythtv/recordinginfo.cpp4
-rw-r--r--mythtv/libs/libmythtv/tvbrowsehelper.cpp8
-rw-r--r--mythtv/programs/mythfrontend/guidegrid.cpp8
-rw-r--r--mythtv/programs/mythfrontend/progfind.cpp14
-rw-r--r--mythtv/programs/mythfrontend/proglist.cpp4
5 files changed, 19 insertions, 19 deletions
diff --git a/mythtv/libs/libmythtv/recordinginfo.cpp b/mythtv/libs/libmythtv/recordinginfo.cpp
index 4abab35..3e2e7a9 100644
--- a/mythtv/libs/libmythtv/recordinginfo.cpp
+++ b/mythtv/libs/libmythtv/recordinginfo.cpp
@@ -236,7 +236,7 @@ RecordingInfo::RecordingInfo(
" program.starttime < :STARTTS1 AND "
" program.endtime > :STARTTS2 ";
bindings[":CHANID"] = QString::number(_chanid);
- QString str_startts = desiredts.toString("yyyy-MM-ddThh:mm:50");
+ QString str_startts = desiredts.toString("yyyy-MM-dd hh:mm:50");
bindings[":STARTTS1"] = str_startts;
bindings[":STARTTS2"] = str_startts;
@@ -332,7 +332,7 @@ RecordingInfo::RecordingInfo(
" program.starttime > :STARTTS "
"GROUP BY program.starttime ORDER BY program.starttime LIMIT 1 ";
bindings[":CHANID"] = QString::number(_chanid);
- bindings[":STARTTS"] = desiredts.toString("yyyy-MM-ddThh:mm:50");
+ bindings[":STARTTS"] = desiredts.toString("yyyy-MM-dd hh:mm:50");
LoadFromProgram(progList, querystr, bindings, schedList, false);
diff --git a/mythtv/libs/libmythtv/tvbrowsehelper.cpp b/mythtv/libs/libmythtv/tvbrowsehelper.cpp
index e635e9d..1f57078 100644
--- a/mythtv/libs/libmythtv/tvbrowsehelper.cpp
+++ b/mythtv/libs/libmythtv/tvbrowsehelper.cpp
@@ -315,10 +315,10 @@ void TVBrowseHelper::GetNextProgramDB(
MSqlBindings bindings;
bindings[":CHANID"] = chanid;
- bindings[":NOWTS"] = nowtime.toString("yyyy-MM-ddThh:mm:ss");
- bindings[":LATESTTS"] = latesttime.toString("yyyy-MM-ddThh:mm:ss");
- bindings[":BROWSETS"] = browsetime.toString("yyyy-MM-ddThh:mm:ss");
- bindings[":BROWSETS2"] = browsetime.toString("yyyy-MM-ddThh:mm:ss");
+ bindings[":NOWTS"] = nowtime;
+ bindings[":LATESTTS"] = latesttime;
+ bindings[":BROWSETS"] = browsetime;
+ bindings[":BROWSETS2"] = browsetime;
QString querystr = " WHERE program.chanid = :CHANID ";
switch (direction)
diff --git a/mythtv/programs/mythfrontend/guidegrid.cpp b/mythtv/programs/mythfrontend/guidegrid.cpp
index c05b876..43e3e8a 100644
--- a/mythtv/programs/mythfrontend/guidegrid.cpp
+++ b/mythtv/programs/mythfrontend/guidegrid.cpp
@@ -673,8 +673,8 @@ ProgramList GuideGrid::GetProgramList(uint chanid) const
" program.endtime >= :STARTTS AND "
" program.starttime <= :ENDTS AND "
" program.manualid = 0 ";
- bindings[":STARTTS"] = m_currentStartTime.toString("yyyy-MM-ddThh:mm:00");
- bindings[":ENDTS"] = m_currentEndTime.toString("yyyy-MM-ddThh:mm:00");
+ bindings[":STARTTS"] = m_currentStartTime.toString("yyyy-MM-dd hh:mm:00");
+ bindings[":ENDTS"] = m_currentEndTime.toString("yyyy-MM-dd hh:mm:00");
bindings[":CHANID"] = chanid;
ProgramList dummy;
@@ -1039,8 +1039,8 @@ ProgramList *GuideGrid::getProgramListFromProgram(int chanNum)
" AND program.starttime <= :ENDTS "
" AND program.manualid = 0 ";
bindings[":CHANID"] = GetChannelInfo(chanNum)->chanid;
- bindings[":STARTTS"] = m_currentStartTime.toString("yyyy-MM-ddThh:mm:00");
- bindings[":ENDTS"] = m_currentEndTime.toString("yyyy-MM-ddThh:mm:00");
+ bindings[":STARTTS"] = m_currentStartTime.toString("yyyy-MM-dd hh:mm:00");
+ bindings[":ENDTS"] = m_currentEndTime.toString("yyyy-MM-dd hh:mm:00");
LoadFromProgram(*proglist, querystr, bindings, m_recList, false);
}
diff --git a/mythtv/programs/mythfrontend/progfind.cpp b/mythtv/programs/mythfrontend/progfind.cpp
index 960d8dc..4ceba8b 100644
--- a/mythtv/programs/mythfrontend/progfind.cpp
+++ b/mythtv/programs/mythfrontend/progfind.cpp
@@ -570,7 +570,7 @@ void ProgFinder::selectShowData(QString progTitle, int newCurShow)
" AND program.endtime > :ENDTIME "
" AND channel.visible = 1 ";
bindings[":TITLE"] = progTitle;
- bindings[":ENDTIME"] = progStart.toString("yyyy-MM-ddThh:mm:50");
+ bindings[":ENDTIME"] = progStart.toString("yyyy-MM-dd hh:mm:50");
LoadFromScheduler(m_schedList);
LoadFromProgram(m_showData, querystr, bindings, m_schedList, false);
@@ -619,7 +619,7 @@ void ProgFinder::whereClauseGetSearchData(QString &where, MSqlBindings &bindings
where += "ORDER BY title;";
- bindings[":STARTTIME"] = progStart.toString("yyyy-MM-ddThh:mm:50");
+ bindings[":STARTTIME"] = progStart.toString("yyyy-MM-dd hh:mm:50");
}
else
{
@@ -644,7 +644,7 @@ void ProgFinder::whereClauseGetSearchData(QString &where, MSqlBindings &bindings
bindings[":TWO"] = two;
bindings[":THREE"] = three;
bindings[":FOUR"] = four;
- bindings[":STARTTIME"] = progStart.toString("yyyy-MM-ddThh:mm:50");
+ bindings[":STARTTIME"] = progStart.toString("yyyy-MM-dd hh:mm:50");
if (!m_searchStr.isEmpty())
bindings[":SEARCH"] = '%' + m_searchStr + '%';
@@ -839,7 +839,7 @@ void JaProgFinder::whereClauseGetSearchData(QString &where, MSqlBindings &bindin
where += "ORDER BY title_pronounce;";
- bindings[":STARTTIME"] = progStart.toString("yyyy-MM-ddThh:mm:50");
+ bindings[":STARTTIME"] = progStart.toString("yyyy-MM-dd hh:mm:50");
}
@@ -925,7 +925,7 @@ void HeProgFinder::whereClauseGetSearchData(QString &where, MSqlBindings &bindin
where += "ORDER BY title;";
- bindings[":STARTTIME"] = progStart.toString("yyyy-MM-ddThh:mm:50");
+ bindings[":STARTTIME"] = progStart.toString("yyyy-MM-dd hh:mm:50");
}
bool HeProgFinder::formatSelectedData(QString& data)
@@ -1007,7 +1007,7 @@ void RuProgFinder::whereClauseGetSearchData(QString &where, MSqlBindings
where += "ORDER BY title;";
- bindings[":STARTTIME"] = progStart.toString("yyyy-MM-ddThh:mm:50");
+ bindings[":STARTTIME"] = progStart.toString("yyyy-MM-dd hh:mm:50");
}
else
{
@@ -1035,7 +1035,7 @@ void RuProgFinder::whereClauseGetSearchData(QString &where, MSqlBindings
bindings[":THREE"] = three;
bindings[":FOUR"] = four;
bindings[":FIVE"] = five;
- bindings[":STARTTIME"] = progStart.toString("yyyy-MM-ddThh:mm:50");
+ bindings[":STARTTIME"] = progStart.toString("yyyy-MM-dd hh:mm:50");
if (!m_searchStr.isEmpty())
bindings[":SEARCH"] = '%' + m_searchStr + '%';
diff --git a/mythtv/programs/mythfrontend/proglist.cpp b/mythtv/programs/mythfrontend/proglist.cpp
index def0b94..e770c29 100644
--- a/mythtv/programs/mythfrontend/proglist.cpp
+++ b/mythtv/programs/mythfrontend/proglist.cpp
@@ -811,7 +811,7 @@ void ProgLister::FillViewList(const QString &view)
}
else if (m_type == plCategory) // list by category
{
- QString startstr = m_startTime.toString("yyyy-MM-ddThh:mm:50");
+ QString startstr = m_startTime.toString("yyyy-MM-dd hh:mm:50");
MSqlQuery query(MSqlQuery::InitCon());
query.prepare("SELECT g1.genre, g2.genre "
"FROM program "
@@ -1144,7 +1144,7 @@ void ProgLister::FillItemList(bool restorePosition, bool updateDisp)
bool oneChanid = false;
QString where;
- QString startstr = m_startTime.toString("yyyy-MM-ddThh:mm:50");
+ QString startstr = m_startTime.toString("yyyy-MM-dd hh:mm:50");
QString qphrase = m_viewList[m_curView];
MSqlBindings bindings;