Details
-
Bug
-
Resolution: Done
-
P4: Low
-
4.6.2, 5.0.1
-
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.