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

QSqlQuery::executedQuery() does not return correct query

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: P3: Somewhat important P3: Somewhat important
    • 5.12.2, 5.14.0 Alpha
    • 4.8.4
    • SQL Support
    • None
    • 9501e92841d0a97ff5083f0000947a2e795f61a2 (qt/qtbase/5.12)

      With the following code:

      QSqlQuery query("select * from person where ID=101");
      query.exec("insert into person values(108, 'Maria2', 'Papadopoulos')");
      qDebug()<<query.executedQuery().toAscii();
      

      executedQuery() returns incorrect query since SqlQuery::exec(const QString& query) does not set executedQuery -variable. But calling bool QSqlQuery::exec() sets the executedQuery, and then correct query is returned with QSqlQuery::executedQuery().

        For Gerrit Dashboard: QTBUG-28883
        # Subject Branch Project Status CR V

            jefernan Jesus Fernandez
            qtcomsupport Qt Support
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes