diff options
author | Bill King <bill.king@nokia.com> | 2009-09-07 03:49:36 (GMT) |
---|---|---|
committer | Bill King <bill.king@nokia.com> | 2009-09-07 03:54:40 (GMT) |
commit | 07ad7b4e6257026c1c5e939e91a919e5f0a03807 (patch) | |
tree | c99bb36347224ad564c812de5063a1b370a066f7 | |
parent | 365f00905e3cbe0b5b55258f38df9cb323b56524 (diff) | |
download | Qt-07ad7b4e6257026c1c5e939e91a919e5f0a03807.zip Qt-07ad7b4e6257026c1c5e939e91a919e5f0a03807.tar.gz Qt-07ad7b4e6257026c1c5e939e91a919e5f0a03807.tar.bz2 |
DB2 - Don't return an error when the table is just empty.
Makes the behaviour consistent with the ODBC driver behaviour
Reviewed-by: Justin McPherson
-rw-r--r-- | src/sql/drivers/db2/qsql_db2.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/sql/drivers/db2/qsql_db2.cpp b/src/sql/drivers/db2/qsql_db2.cpp index 6187e6b..7bbe122 100644 --- a/src/sql/drivers/db2/qsql_db2.cpp +++ b/src/sql/drivers/db2/qsql_db2.cpp @@ -908,8 +908,9 @@ bool QDB2Result::fetchFirst() SQL_FETCH_FIRST, 0); if (r != SQL_SUCCESS && r != SQL_SUCCESS_WITH_INFO) { - setLastError(qMakeError(QCoreApplication::translate("QDB2Result", "Unable to fetch first"), - QSqlError::StatementError, d)); + if(r!= SQL_NO_DATA) + setLastError(qMakeError(QCoreApplication::translate("QDB2Result", "Unable to fetch first"), + QSqlError::StatementError, d)); return false; } setAt(0); |