Details
-
Bug
-
Resolution: Duplicate
-
P2: Important
-
None
-
5.15.12, 6.4.1
-
None
-
Windows 10
Description
Hi after Windows 10 is updated with KB5019959 it's no longer possible to retrieve columns with float values via ODBC from a MS SQL Server.
To reproduce, create a test table with an integer and a float column. (I made one with 5 rows).
Then run this console app: (don't forget to add +sql in the .pro file):
#include <QSqlQuery>
#include <qdebug.h>
int main()
{
auto db = QSqlDatabase::addDatabase("QODBC");
db.setDatabaseName("Driver=SQL Server; Server=192.168.1.1; Database==TestDB;");
db.open("user","password");
auto q = QSqlQuery();
// q.setForwardOnly(true);
q.exec("select MyInt,MyFloat from MyTable");
while (q.next())
db.close();
}
On a Windows 10 that has not yet installed KB5019959 the console app will run correctly and display:
QVariant(int, 1)
QVariant(double, 1.1)
QVariant(int, 2)
QVariant(double, 2.2)
QVariant(int, 3)
QVariant(double, 3.3)
QVariant(int, 4)
QVariant(double, 4.4)
QVariant(int, 5)
QVariant(double, 5.5)
On a Windows 10 that has installed KB5019959 the console app will run incorrectly displaying:
QVariant(int, 1)
QVariant(Invalid)
QVariant(int, 2)
QVariant(Invalid)
QVariant(int, 3)
QVariant(Invalid)
QVariant(int, 4)
QVariant(Invalid)
QVariant(int, 5)
QVariant(Invalid)
if I remove the comment above so that the query becomes forward only, after a rebuild the app runs exactly the same on a Windows 10 without KB5019959 installed.
But if I run it now on a Windows 10 with KB5019959 installed it displays:
QVariant(int, 1)
QVariant(Invalid)
and exits normally as if row 2,3,4 and 5 do not exist on the SqlServer
Attachments
Issue Links
- duplicates
-
QTBUG-108307 QODBC: MSSQL ODBC Driver 18.1.2 does not return float/double values
- Closed