From 07ad7b4e6257026c1c5e939e91a919e5f0a03807 Mon Sep 17 00:00:00 2001 From: Bill King Date: Mon, 7 Sep 2009 13:49:36 +1000 Subject: 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 --- src/sql/drivers/db2/qsql_db2.cpp | 5 +++-- 1 file 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); -- cgit v0.12