persistentstorage/sql/TEST/t_sqlperformance4.cpp
branchRCL_3
changeset 19 b19bba7c5885
parent 15 fcc16690f446
equal deleted inserted replaced
18:3da531bb4329 19:b19bba7c5885
     7 //
     7 //
     8 // Initial Contributors:
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
     9 // Nokia Corporation - initial contribution.
    10 //
    10 //
    11 // Contributors:
    11 // Contributors:
       
    12 // NTT DOCOMO, INC - Fix for Bug 3170 "SQL library test T_SQLPERFORMANCE4 fails with USER 84 panic"
    12 //
    13 //
    13 // Description:
    14 // Description:
    14 //
    15 //
    15 
    16 
    16 #include <e32test.h>
    17 #include <e32test.h>
   298 		TInt eolPos = sql.Locate(TChar('\n'));
   299 		TInt eolPos = sql.Locate(TChar('\n'));
   299 		if(eolPos < 0)
   300 		if(eolPos < 0)
   300 			{
   301 			{
   301 			break;//No more SQL statements
   302 			break;//No more SQL statements
   302 			}
   303 			}
   303 		TPtrC8 sqlStmt8(sql.Ptr(), eolPos - 1);//"eolPos - 1" - to cut off the '\r' character
   304 		TInt stmtLength = eolPos;
       
   305 		while (stmtLength > 0 && (sql[stmtLength-1] == '\r'))
       
   306 			{
       
   307 			--stmtLength; //Reduce length to remove carriage return characters from the end of the statement string
       
   308 			}
       
   309 		TPtrC8 sqlStmt8(sql.Ptr(), stmtLength);
   304 		TPtrC8 ptr = sql.Mid(eolPos + 1);//"eolPos + 1" - first character after '\n'
   310 		TPtrC8 ptr = sql.Mid(eolPos + 1);//"eolPos + 1" - first character after '\n'
   305 		sql.Set(const_cast <TUint8*> (ptr.Ptr()), ptr.Length(), ptr.Length());
   311 		sql.Set(const_cast <TUint8*> (ptr.Ptr()), ptr.Length(), ptr.Length());
   306 		++recordCount;
   312 		++recordCount;
   307 		
   313 		
   308 		//Convert to 16 bit query string
   314 		//Convert to 16 bit query string