From 7ebac2081244bc1f075bc16da6ce59cbd5122c7d Mon Sep 17 00:00:00 2001 From: Christian Ehrlicher Date: Thu, 9 Feb 2023 20:58:21 +0100 Subject: SQL/ODBC: add handling for SQL_SS_TIME2 MSSql Server sometimes returns SQL_SS_TIME2 instead SQL_TIME. Since this value is non-standard, we have to define it by ourself. Pick-to: 5.15 6.2 6.4 6.5 Fixes: QTBUG-109206 Change-Id: I40a4b32590d877ebfdc4b2f1d9080d8cdb2ae7a5 Reviewed-by: Volker Hilsheimer --- src/plugins/sqldrivers/odbc/qsql_odbc.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/plugins/sqldrivers') diff --git a/src/plugins/sqldrivers/odbc/qsql_odbc.cpp b/src/plugins/sqldrivers/odbc/qsql_odbc.cpp index e73b573e42..b0b5edbcc8 100644 --- a/src/plugins/sqldrivers/odbc/qsql_odbc.cpp +++ b/src/plugins/sqldrivers/odbc/qsql_odbc.cpp @@ -28,6 +28,11 @@ QT_BEGIN_NAMESPACE using namespace Qt::StringLiterals; +// non-standard ODBC SQL data type from SQL Server sometimes used instead of SQL_TIME +#ifndef SQL_SS_TIME2 +#define SQL_SS_TIME2 (-154) +#endif + // undefine this to prevent initial check of the ODBC driver #define ODBC_CHECK_DRIVER @@ -342,6 +347,7 @@ static QMetaType qDecodeODBCType(SQLSMALLINT sqltype, bool isSigned = true) case SQL_TYPE_DATE: type = QMetaType::QDate; break; + case SQL_SS_TIME2: case SQL_TIME: case SQL_TYPE_TIME: type = QMetaType::QTime; -- cgit v1.2.3