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

MSSQL with unixODBC and FreeTDS

    XMLWordPrintable

Details

    • Bug
    • Resolution: Incomplete
    • P3: Somewhat important
    • None
    • 5.9.7, 5.14.1
    • SQL Support
    • None
    • Linux/X11

    Description

      The following query executes successfully, but returns 0 records on Linux (openSUSE) using unixODBC with FreeTDS, while it works fine with "ODBC Driver 17 for SQL Server" proprietary driver on the same machine.
       
      {{QSqlQuery query(db);
      query.prepare("RESTORE HEADERONLY FROM DISK = :bakfile");
      query.bindValue(":bakfile", bakfile);}}

      bakfile is a QString that points to the Windows path on the server.

      query.exec() succeeds. But query.record().count() is 0 and of course query.next() returns false. query.lastError().text() is empty (no errors).
      Doing the same query with an non-existent file returns the normal operating system cannot find file.

      The same SQL query works fine using tsql (freeTDS diagnostic tool).

      The server is MSSQL 2017 Express on a Windows 10 PC.

      I've also tried query without using bindvalue with the same result.

      Tracing packets using wireshark shows the result back from the server.

       

       

      Attachments

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

        Activity

          People

            andysh Andy Shaw
            jonaski Jonas Kvinge
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes