Bug 3170 "SQL library test T_SQLPERFORMANCE4 fails with USER 84 panic" RCL_3 PDK_3.0.1
authorNTT DOCOMO, INC <bugtracker-ml@nttdocomo.com>
Wed, 07 Jul 2010 08:33:46 +0100
branchRCL_3
changeset 36 b19bba7c5885
parent 34 3da531bb4329
child 43 48ff1e52fec3
Bug 3170 "SQL library test T_SQLPERFORMANCE4 fails with USER 84 panic"
persistentstorage/sql/TEST/t_sqlperformance4.cpp
--- a/persistentstorage/sql/TEST/t_sqlperformance4.cpp	Mon Jun 21 17:37:53 2010 +0300
+++ b/persistentstorage/sql/TEST/t_sqlperformance4.cpp	Wed Jul 07 08:33:46 2010 +0100
@@ -9,6 +9,7 @@
 // Nokia Corporation - initial contribution.
 //
 // Contributors:
+// NTT DOCOMO, INC - Fix for Bug 3170 "SQL library test T_SQLPERFORMANCE4 fails with USER 84 panic"
 //
 // Description:
 //
@@ -300,7 +301,12 @@
 			{
 			break;//No more SQL statements
 			}
-		TPtrC8 sqlStmt8(sql.Ptr(), eolPos - 1);//"eolPos - 1" - to cut off the '\r' character
+		TInt stmtLength = eolPos;
+		while (stmtLength > 0 && (sql[stmtLength-1] == '\r'))
+			{
+			--stmtLength; //Reduce length to remove carriage return characters from the end of the statement string
+			}
+		TPtrC8 sqlStmt8(sql.Ptr(), stmtLength);
 		TPtrC8 ptr = sql.Mid(eolPos + 1);//"eolPos + 1" - first character after '\n'
 		sql.Set(const_cast <TUint8*> (ptr.Ptr()), ptr.Length(), ptr.Length());
 		++recordCount;