From f5213ab799be73ef7e0c5fee9828d4fbcf238d95 Mon Sep 17 00:00:00 2001 From: Christian Ehrlicher Date: Sun, 13 Oct 2019 13:51:19 +0200 Subject: QMySQL: return QVariant::ByteArray for POINT column qDecodeMYSQLType() did not handle FIELD_TYPE_GEOMETRY and therefore the type for a POINT column was incorrectly treated as QVariant::String. Even the type can not (yet) be properly decoded to a QPoint, treating it as QVariant::ByteArray is the better option here. Fixes: QTBUG-72140 Change-Id: I12e75b326ae3acb75cb36f2e650464528bd43c0e Reviewed-by: Andy Shaw --- src/plugins/sqldrivers/mysql/qsql_mysql.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/plugins/sqldrivers/mysql') diff --git a/src/plugins/sqldrivers/mysql/qsql_mysql.cpp b/src/plugins/sqldrivers/mysql/qsql_mysql.cpp index d3e37f11d6..a641935dc5 100644 --- a/src/plugins/sqldrivers/mysql/qsql_mysql.cpp +++ b/src/plugins/sqldrivers/mysql/qsql_mysql.cpp @@ -294,6 +294,7 @@ static QMetaType::Type qDecodeMYSQLType(int mysqltype, uint flags) case FIELD_TYPE_TINY_BLOB : case FIELD_TYPE_MEDIUM_BLOB : case FIELD_TYPE_LONG_BLOB : + case FIELD_TYPE_GEOMETRY : type = (flags & BINARY_FLAG) ? QMetaType::QByteArray : QMetaType::QString; break; default: -- cgit v1.2.3