diff options
author | Liang Qi <liang.qi@qt.io> | 2016-09-16 23:16:25 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2016-09-16 23:16:25 +0200 |
commit | d148019f16e3c95916731e59e0324e7c470cc1fc (patch) | |
tree | d9c0640c9055f24379468b8f55b3419f30a37c47 /src/sql | |
parent | 8ceab12814a7437a01d917c83ec28fd6e81c459e (diff) | |
parent | 6b9c57f8cd3df65702db327616913fa9d8172237 (diff) |
Merge remote-tracking branch 'origin/5.6' into 5.7
Conflicts:
src/plugins/platforms/qnx/qqnxscreeneventhandler.cpp
Change-Id: I0af32ee55936d523cbd259b6fe82eb9c409f9074
Diffstat (limited to 'src/sql')
-rw-r--r-- | src/sql/drivers/mysql/qsql_mysql.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/sql/drivers/mysql/qsql_mysql.cpp b/src/sql/drivers/mysql/qsql_mysql.cpp index b13e10e3a5..f6b2e74986 100644 --- a/src/sql/drivers/mysql/qsql_mysql.cpp +++ b/src/sql/drivers/mysql/qsql_mysql.cpp @@ -640,8 +640,15 @@ QVariant QMYSQLResult::data(int field) if (f.nullIndicator) return QVariant(f.type); - if (qIsInteger(f.type)) - return QVariant(f.type, f.outField); + if (qIsInteger(f.type)) { + QVariant variant(f.type, f.outField); + // we never want to return char variants here, see QTBUG-53397 + if (static_cast<int>(f.type) == QMetaType::UChar) + return variant.toUInt(); + else if (static_cast<int>(f.type) == QMetaType::Char) + return variant.toInt(); + return variant; + } if (f.type != QVariant::ByteArray) val = toUnicode(d->drv_d_func()->tc, f.outField, f.bufLength); @@ -1371,7 +1378,7 @@ bool QMYSQLDriver::open(const QString& db, : sslCipher.toLocal8Bit().constData()); } -#if MYSQL_VERSION_ID >= 50000 +#if MYSQL_VERSION_ID >= 50100 if (connectTimeout != 0) mysql_options(d->mysql, MYSQL_OPT_CONNECT_TIMEOUT, &connectTimeout); if (readTimeout != 0) @@ -1400,7 +1407,7 @@ bool QMYSQLDriver::open(const QString& db, setOpenError(true); return false; } -#if MYSQL_VERSION_ID >= 50000 +#if MYSQL_VERSION_ID >= 50100 if (reconnect) mysql_options(d->mysql, MYSQL_OPT_RECONNECT, &reconnect); #endif |