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

QSqlQuery::exec(delete stmt) should not return false on ODBC Driver if SQL_NO_DATA_FOUND is returned

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P4: Low
    • 5.1.0
    • 4.6.2, 5.0.1
    • SQL Support
    • None
    • Linux and Windows
    • 0646d1131b4bc65cdd9af29f4ce00fdd2398a3df

    Description

      Currently the ODBC-Driver handles return code SQL_NO_DATA_FOUND like an error (unsuccessful). That is: the QSqlQuery::exec function returns false.
      So one can not distinguish between an "error" and "no data found". Since QSqlQuery::exec returns eather 'true' or 'false' one can not resolve more than two states. To be sure that no error occured one would have to first issue a select (wether there is data that needs a delete) and than the delete. That is very inefficient and unnecessary.
      So in qsql_odbc.cpp function QODBCResult::exec() should return true if SQL_NO_DATA_FOUND was returned by the SQLExecute().

      Also the other db driver like like for instance the native PSQL-Driver return true in the same situation. So the behaviour is currently inconsistent.

      Attachments

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

        Activity

          People

            israelins85 Israel Lins Albuquerque
            hgerdau Heiko Gerdau
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes