Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.11.2
-
None
-
Windows 10, MySQL 5.7.24 x64.
-
-
f5213ab799be73ef7e0c5fee9828d4fbcf238d95 (qt/qtbase/5.15)
Description
When querying the type of the POINT spatial datatype in MySql, QSqlRecord returns type QVariant::Type::String, but it should return QVariant::Type::ByteArray. Example:
QString sqlCommand = "SELECT * FROM test_point_tbl;"; // NOTE: table contains a single column of type POINT QSqlQuery sqlQuery(db); if (sqlQuery.exec(sqlCommand)) { sqlQuery.record().field(0).type(); // ^^^ incorrect type (QVariant::Type::String) returned }
This type certainly can't be interpreted as a string. From what I can see, a POINT is stored (and specified) as a WKB (well-known binary) GIS type in MySQL. When Qt supports GIS databases, maybe it should return Point as the type, but for now, it think it should return ByteArray as the type.
Full sample program attached.
Attachments
For Gerrit Dashboard: QTBUG-72140 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
277276,4 | QMySQL: return QVariant::ByteArray for POINT column | 5.15 | qt/qtbase | Status: MERGED | +2 | 0 |