Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-108912

Retrieving columns with float valiues from MS SqlServer fails after KB5019959

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • P2: Important
    • None
    • 5.15.12, 6.4.1
    • SQL Support
    • None
    • Windows 10
    • Windows

    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())
         

      {         qDebug() << q.value(0);        qDebug() << q.value(1);     }

          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

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              chehrlic Christian Ehrlicher
              hskoglund Henry Skoglund
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes