Fix sub-second handling in MySQL driver

As stated in http://dev.mysql.com/doc/refman/5.7/en/c-api-prepared-statement-data-structures.html
the content of MYSQL_TIME.second_part field is supposed to be
in microseconds not milliseconds.

Task-number: QTBUG-31124
[ChangeLog][QtSql][QMYSQL] Fix sub-second handling
Change-Id: I5718868029bdedab9508213e800d2dcf3da9be9a
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
This commit is contained in:
Tobias Koenig 2013-11-27 12:46:18 +01:00 committed by The Qt Project
parent e82951611c
commit 7216387370

View File

@ -857,7 +857,7 @@ static MYSQL_TIME *toMySqlDate(QDate date, QTime time, QVariant::Type type)
myTime->hour = time.hour();
myTime->minute = time.minute();
myTime->second = time.second();
myTime->second_part = time.msec();
myTime->second_part = time.msec() * 1000;
}
if (type == QVariant::Date || type == QVariant::DateTime) {
myTime->year = date.year();