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

QSqlQuery omitting results under certain conditions

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3: Somewhat important
    • Resolution: Invalid
    • Affects Version/s: 5.13.0
    • Fix Version/s: None
    • Component/s: SQL Support
    • Labels:
      None
    • Platform/s:
      Windows

      Description

      In my project with MySQL database, I am not getting results with this code:

      QSqlQuery q;
      q.prepare("SELECT id, ? AS type FROM table");
      q.bind(0, 0);
      q.exec();
      qDebug() << q.size(); // Returns correct number of rows
      while(q.next()) {} // Does not correctly iterate through results
      

      When I instead of binding place the number directly in the SQL code, it works correctly.

        Attachments

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

          Activity

            People

            Assignee:
            andysh Andy Shaw
            Reporter:
            danol Daniel
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes