mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-04-14 08:39:31 +02:00
importers/rivendell_filter.cpp MySQL v5.7+ date/time changes
Unsure if the times can be invalid but old MySQL values can have 0000-00-00 as dates but the 5.7+ can't. There is a null check for this but I'm not 100% sure whether 0000-00-00 passes the isNull. Put in a date check for both just in case.
This commit is contained in:
parent
9eb97c5b27
commit
65be7b3f5f
@ -304,8 +304,7 @@ MainObject::MainObject(QObject *parent)
|
||||
(const char *)RDEscapeString(q->value(3).toString()),
|
||||
(const char *)RDEscapeString(q->value(4).toString()),
|
||||
(const char *)RDEscapeString(q->value(5).toString()),
|
||||
(const char *)q->value(6).toDate().
|
||||
toString("yyyy-MM-dd"),
|
||||
(const char *)RDCheckDateTime(q->value(6).toDate(),"yyyy-MM-dd"),
|
||||
(const char *)RDEscapeString(q->value(7).toString()),
|
||||
(const char *)RDEscapeString(q->value(8).toString()),
|
||||
(const char *)RDEscapeString(q->value(9).toString()),
|
||||
@ -349,32 +348,32 @@ MainObject::MainObject(QObject *parent)
|
||||
}
|
||||
else {
|
||||
start_datetime=QString().sprintf("\"%s\"",
|
||||
(const char *)q1->value(7).
|
||||
toDateTime().toString("yyyy-MM-dd hh:mm:ss"));
|
||||
(const char *)RDCheckDateTime(q1->value(7).
|
||||
toDateTime(),"yyyy-MM-dd hh:mm:ss"));//Could be invalid (0000-00-00)
|
||||
}
|
||||
if(q1->value(8).isNull()) {
|
||||
end_datetime="null";
|
||||
}
|
||||
else {
|
||||
end_datetime=QString().sprintf("\"%s\"",
|
||||
(const char *)q1->value(8).
|
||||
toDateTime().toString("yyyy-MM-dd hh:mm:ss"));
|
||||
(const char *)RDCheckDateTime(q1->value(8).
|
||||
toDateTime(),"yyyy-MM-dd hh:mm:ss"));//Could be invalid (0000-00-00)
|
||||
}
|
||||
if(q1->value(16).isNull()) {
|
||||
start_daypart="null";
|
||||
}
|
||||
else {
|
||||
start_daypart=QString().sprintf("\"%s\"",
|
||||
(const char *)q1->value(16).
|
||||
toTime().toString("hh:mm:ss"));
|
||||
(const char *)RDCheckDateTime(q1->value(16).
|
||||
toTime(),"hh:mm:ss"));//Invalid possible?
|
||||
}
|
||||
if(q1->value(17).isNull()) {
|
||||
end_daypart="null";
|
||||
}
|
||||
else {
|
||||
end_daypart=QString().sprintf("\"%s\"",
|
||||
(const char *)q1->value(17).
|
||||
toTime().toString("hh:mm:ss"));
|
||||
(const char *)RDCheckDateTime(q1->value(17).
|
||||
toTime(),"hh:mm:ss"));//Invalid possible?
|
||||
}
|
||||
sql=QString().sprintf("insert into CUTS set CART_NUMBER=%u,\
|
||||
CUT_NAME=\"%s\",\
|
||||
|
Loading…
x
Reference in New Issue
Block a user