diff options
author | Tobias Koenig <tobias.koenig.qnx@kdab.com> | 2013-11-27 12:46:18 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-11-28 00:21:56 +0100 |
commit | 7216387370203fc8f49d76cc2cb68bb5286c8dff (patch) | |
tree | 7699bab55b3cced16c06c17aa32b950195d91e0b /src/sql/drivers/mysql/qsql_mysql.cpp | |
parent | e82951611c6d965cc8ef9cbf4ee7fbccf615bb3f (diff) |
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>
Diffstat (limited to 'src/sql/drivers/mysql/qsql_mysql.cpp')
-rw-r--r-- | src/sql/drivers/mysql/qsql_mysql.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/sql/drivers/mysql/qsql_mysql.cpp b/src/sql/drivers/mysql/qsql_mysql.cpp index 0e20cf539e..1b1cb2ac91 100644 --- a/src/sql/drivers/mysql/qsql_mysql.cpp +++ b/src/sql/drivers/mysql/qsql_mysql.cpp @@ -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(); |