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

QSqlQuery::exec always return true for wrong queries (PostgreSql)

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • P3: Somewhat important
    • None
    • 5.12.2
    • SQL Support
    • None
    • All

    Description

      Database: PostgreSql 9.4

      SQL:

      CREATE TEMPORARY TABLE test(field integer NOT NULL, CONSTRAINT pk PRIMARY KEY (field));
      INSERT INTO test (field) values (1); -- OK
      INSERT INTO test (field) values (1); -- NOK (PK violation)

      In this case QSqlQuery::exec(sql) return TRUE for 5.12.2.

       

      I think error in function: 

      bool QPSQLResult::reset (const QString& query)
      {
      ...
      ==> we lost PQerrorMessage information for next results here:
      while (PGresult *nextResultSet = d->drv_d_func()->getResult(d->stmtId))
                  d->nextResultSets.append(nextResultSet);
      ...
      }

       

      Attachments

        Issue Links

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

          Activity

            People

              amiart Robert Szefner
              n_r_w n_r_w
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes