From 7506d1567ce8e3e3a54baf556b2ca9bee80cbbf0 Mon Sep 17 00:00:00 2001 From: Wayne Merricks Date: Sat, 4 Jun 2016 19:50:23 +0100 Subject: [PATCH] lib/rdlog_event.cpp MySQL v5.7+ date/time checks Usual date changes and some TODOs for potentially invalid SELECT statements --- lib/rdlog_event.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/rdlog_event.cpp b/lib/rdlog_event.cpp index 898617ae..ea7ecd25 100644 --- a/lib/rdlog_event.cpp +++ b/lib/rdlog_event.cpp @@ -244,6 +244,7 @@ int RDLogEvent::validate(QString *report,const QDate &date) // // Handle events with no logged start time (e.g. manual inserts) // + //TODO do we need to verify date here? sql=QString(). sprintf("select CUT_NAME from CUTS where \ (CART_NUMBER=%u)&& \ @@ -258,6 +259,7 @@ int RDLogEvent::validate(QString *report,const QDate &date) (const char *)RDDowCode(date.dayOfWeek())); } else { + //TODO Do we need to verify date and logLine(i)->startTime? sql=QString(). sprintf("select CUT_NAME from CUTS where \ (CART_NUMBER=%u)&& \ @@ -1203,8 +1205,8 @@ void RDLogEvent::InsertLineValues(QString *query, int line) RDEscapeString(log_line[line]->markerLabel()), log_line[line]->graceTime(), log_line[line]->source(), - (const char *)log_line[line]->extStartTime(). - toString("hh:mm:ss"), + (const char *)RDCheckDateTime( + log_line[line]->extStartTime(),"hh:mm:ss"), log_line[line]->extLength(), (const char *)RDEscapeString(log_line[line]->extData()), (const char *) @@ -1226,8 +1228,8 @@ void RDLogEvent::InsertLineValues(QString *query, int line) (const char *)RDYesNo(log_line[line]->linkEmbedded()), (const char *) RDEscapeString(log_line[line]->originUser()), - (const char *)log_line[line]->originDateTime(). - toString("yyyy-MM-dd hh:mm:ss"), + (const char *)RDCheckDateTime( + log_line[line]->originDateTime(),"yyyy-MM-dd hh:mm:ss"), log_line[line]->linkStartSlop(), log_line[line]->linkEndSlop(), log_line[line]->duckUpGain(),