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

QSqlQuery omitting results under certain conditions

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • P3: Somewhat important
    • None
    • 5.13.0
    • SQL Support
    • None
    • 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

            andysh Andy Shaw
            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