summaryrefslogtreecommitdiffstats
path: root/src/plugins/sqldrivers/mysql/qsql_mysql.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/sqldrivers/mysql/qsql_mysql.cpp')
-rw-r--r--src/plugins/sqldrivers/mysql/qsql_mysql.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/plugins/sqldrivers/mysql/qsql_mysql.cpp b/src/plugins/sqldrivers/mysql/qsql_mysql.cpp
index 18c8b48462..a1636302b7 100644
--- a/src/plugins/sqldrivers/mysql/qsql_mysql.cpp
+++ b/src/plugins/sqldrivers/mysql/qsql_mysql.cpp
@@ -74,6 +74,10 @@ Q_DECLARE_METATYPE(MYSQL_STMT*)
# define Q_CLIENT_MULTI_STATEMENTS 0
#endif
+// MySQL above version 8 removed my_bool typedef while MariaDB kept it,
+// by redefining it we can regain source compatibility.
+using my_bool = decltype(mysql_stmt_bind_result(nullptr, nullptr));
+
QT_BEGIN_NAMESPACE
class QMYSQLDriverPrivate : public QSqlDriverPrivate
@@ -305,7 +309,9 @@ static QVariant::Type qDecodeMYSQLType(int mysqltype, uint flags)
type = QVariant::Date;
break;
case FIELD_TYPE_TIME :
- type = QVariant::Time;
+ // A time field can be within the range '-838:59:59' to '838:59:59' so
+ // use QString instead of QTime since QTime is limited to 24 hour clock
+ type = QVariant::String;
break;
case FIELD_TYPE_DATETIME :
case FIELD_TYPE_TIMESTAMP :