diff -r b8bdbc8f59c7 -r 7d4490026038 persistentstorage/sql/SRC/Server/SqlSrvStatementUtil.cpp --- a/persistentstorage/sql/SRC/Server/SqlSrvStatementUtil.cpp Thu Aug 12 11:53:23 2010 +0100 +++ b/persistentstorage/sql/SRC/Server/SqlSrvStatementUtil.cpp Mon Sep 27 11:59:56 2010 +0100 @@ -270,10 +270,7 @@ TInt err = sqlite3_exec(aDbHandle, reinterpret_cast (aSqlStmt.Ptr()), NULL, NULL, NULL); err = ::Sql2OsErrCode(err, sqlite3SymbianLastOsError()); - if(err == KSqlAtEnd) - { - err = KErrNone; - } + __ASSERT_DEBUG(err != KSqlAtEnd, __SQLPANIC2(ESqlPanicInternalError)); SQL_TRACE_INTERNALS(OstTraceExt2(TRACE_INTERNALS, DBEXECSTMT8_EXIT, "Exit;0x%X;DbExecStmt8;err=%d", (TUint)aDbHandle, err)); return err; } @@ -876,20 +873,22 @@ { startTicks = User::FastCounter(); } + while((err = sqlite3_step(stmtHandle)) == SQLITE_ROW) - { - ++aProcessedPageCount; - if(aMaxTime > 0 && IsCompactTimeLimitReached(startTicks, User::FastCounter(), aMaxTime)) - { - err = SQLITE_DONE;//The statement execution did not complete because of the time limit - break; - } - } - if(err == SQLITE_ERROR) //It may be "out of memory" problem - { - err = sqlite3_reset(stmtHandle); - __ASSERT_DEBUG(err != SQLITE_OK, __SQLPANIC2(ESqlPanicInternalError)); - } + { + ++aProcessedPageCount; + if(aMaxTime > 0 && IsCompactTimeLimitReached(startTicks, User::FastCounter(), aMaxTime)) + { + err = SQLITE_DONE;//The statement execution did not complete because of the time limit + break; + } + } + + if(err == SQLITE_ERROR) //It may be "out of memory" problem + { + err = sqlite3_reset(stmtHandle); + __ASSERT_DEBUG(err != SQLITE_OK, __SQLPANIC2(ESqlPanicInternalError)); + } } (void)sqlite3_finalize(stmtHandle);//sqlite3_finalize() fails only if an invalid statement handle is passed. }