Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-15-SP7:GA
libqt5-qtbase.35116
0002-SQL-ODBC-Pass-correct-length-to-SQLColAttr...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0002-SQL-ODBC-Pass-correct-length-to-SQLColAttribute.patch of Package libqt5-qtbase.35116
From a2266959eabe75657425356b462077f76b03e147 Mon Sep 17 00:00:00 2001 From: Christian Ehrlicher <ch.ehrlicher@gmx.de> Date: Sun, 22 Jan 2023 19:59:16 +0100 Subject: [PATCH] SQL/ODBC: Pass correct length to SQLColAttribute() This ensures the tst_QSqlQuery::record() test passes when checking the tablename. Pick-to: 6.5 6.4 6.2 5.15 Change-Id: I146f9f627ea366c6813af61ce48b930ca1041b15 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 9ea00c70fbbe61d4c2da98c3d9390bfbada157bd) --- src/plugins/sqldrivers/odbc/qsql_odbc.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/plugins/sqldrivers/odbc/qsql_odbc.cpp b/src/plugins/sqldrivers/odbc/qsql_odbc.cpp index 8e2e8836525..d1477740555 100644 --- a/src/plugins/sqldrivers/odbc/qsql_odbc.cpp +++ b/src/plugins/sqldrivers/odbc/qsql_odbc.cpp @@ -745,10 +745,15 @@ static QSqlField qMakeFieldInfo(const SQLHANDLE hStmt, int i, QString *errorMess f.setAutoValue(isAutoValue(hStmt, i)); QVarLengthArray<SQLTCHAR> tableName(TABLENAMESIZE); SQLSMALLINT tableNameLen; - r = SQLColAttribute(hStmt, i + 1, SQL_DESC_BASE_TABLE_NAME, tableName.data(), - TABLENAMESIZE, &tableNameLen, 0); + r = SQLColAttribute(hStmt, + i + 1, + SQL_DESC_BASE_TABLE_NAME, + tableName.data(), + SQLSMALLINT(tableName.size() * sizeof(SQLTCHAR)), // SQLColAttribute needs/returns size in bytes + &tableNameLen, + 0); if (r == SQL_SUCCESS) - f.setTableName(fromSQLTCHAR(tableName, tableNameLen)); + f.setTableName(fromSQLTCHAR(tableName, tableNameLen / sizeof(SQLTCHAR))); return f; } -- GitLab
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor