Revision: 201033
authorDremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Wed, 18 Aug 2010 11:30:17 +0300
changeset 41 3256212fc81f
parent 35 0d6db0a14001
child 46 826b40dcb0a8
Revision: 201033 Kit: 201033
featuremgmt/featuremgr/src/serverexe/featmgrserver.cpp
featuremgmt/featuremgr/test/helper/test_plugins/data/102836F3.rss
featuremgmt/featuremgr/test/helper/test_plugins/data/102836F5.rss
featuremgmt/featuremgr/test/helper/test_plugins/data/102836F7.rss
featuremgmt/featuremgr/test/helper/test_plugins/data/102836F9.rss
featuremgmt/featuremgr/test/helper/test_plugins/data/102836FB.rss
featuremgmt/featuremgr/test/helper/test_plugins/data/102836FD.rss
featuremgmt/featuremgr/test/helper/test_plugins/data/102836FF.rss
featuremgmt/featuremgr/test/helper/test_plugins/data/10283707.rss
featuremgmt/featuremgr/test/tef/tef_efm_normal/src/component_test_steps.cpp
featuremgmt/featuremgr/test/tef/tef_efm_unit/src/efm_unit_teststeps.cpp
loggingservices/eventlogger/LogServ/src/LogServResourceInterpreter.cpp
loggingservices/eventlogger/Rom/logengtest.iby
loggingservices/eventlogger/group/BLD.INF
loggingservices/eventlogger/test/src/t_logapi.cpp
loggingservices/eventlogger/test/src/t_logcompat.cpp
loggingservices/filelogger/TSRC/T_LOG.CPP
persistentstorage/dbms/group/BLD.INF
persistentstorage/dbms/group/DBMSTests.iby
persistentstorage/dbms/tdbms/U_SCRIPT.TXT
persistentstorage/sql/GROUP/BLD.INF
persistentstorage/sql/GROUP/SqlDb.mmp
persistentstorage/sql/GROUP/SqlSrv.mmp
persistentstorage/sql/GROUP/sqlite.mmp
persistentstorage/sql/GROUP/sqltests.bat
persistentstorage/sql/GROUP/sqltests.iby
persistentstorage/sql/GROUP/t_sqlbur.mmp
persistentstorage/sql/GROUP/t_sqlcompact2.mmp
persistentstorage/sql/GROUP/t_sqlcompact3.mmp
persistentstorage/sql/GROUP/t_sqlconfig.mmp
persistentstorage/sql/GROUP/t_sqlconfigfile.mmp
persistentstorage/sql/GROUP/t_sqldefect2.mmp
persistentstorage/sql/GROUP/t_sqlfilebuf64.mmp
persistentstorage/sql/GROUP/t_sqlgetfirststmt.mmp
persistentstorage/sql/GROUP/t_sqloom5.mmp
persistentstorage/sql/GROUP/t_sqlperformance.mmp
persistentstorage/sql/GROUP/t_sqlstartup.mmp
persistentstorage/sql/OsLayer/FileBuf64.cpp
persistentstorage/sql/OsLayer/FileBuf64.h
persistentstorage/sql/OsLayer/SqliteTraceDef.h
persistentstorage/sql/OsLayer/SqliteUtil.cpp
persistentstorage/sql/OsLayer/SqliteUtil.h
persistentstorage/sql/OsLayer/os_symbian.cpp
persistentstorage/sql/SQLite/pager.c
persistentstorage/sql/SQLite/sqlite3.h
persistentstorage/sql/SRC/Client/IPC/IPCBuf.cpp
persistentstorage/sql/SRC/Client/SQLDatabase.cpp
persistentstorage/sql/SRC/Client/SqlBlob.cpp
persistentstorage/sql/SRC/Client/SqlDatabaseImpl.cpp
persistentstorage/sql/SRC/Client/SqlDbSession.cpp
persistentstorage/sql/SRC/Client/SqlDbSession.h
persistentstorage/sql/SRC/Client/SqlDbSession.inl
persistentstorage/sql/SRC/Client/SqlResourceProfiler.cpp
persistentstorage/sql/SRC/Client/SqlResourceTest.cpp
persistentstorage/sql/SRC/Client/SqlScalarFullSelect.cpp
persistentstorage/sql/SRC/Client/SqlStatement.cpp
persistentstorage/sql/SRC/Client/SqlStatementImpl.cpp
persistentstorage/sql/SRC/Client/SqlStatementImpl.inl
persistentstorage/sql/SRC/Client/SqlStmtSession.cpp
persistentstorage/sql/SRC/Client/SqlStmtSession.h
persistentstorage/sql/SRC/Client/SqlStmtSession.inl
persistentstorage/sql/SRC/Client/SqlStream.cpp
persistentstorage/sql/SRC/Common/SqlAssert.h
persistentstorage/sql/SRC/Common/SqlBufFlat.cpp
persistentstorage/sql/SRC/Common/SqlBufFlat.h
persistentstorage/sql/SRC/Common/SqlBufIterator.cpp
persistentstorage/sql/SRC/Common/SqlBufIterator.h
persistentstorage/sql/SRC/Common/SqlBufIterator.inl
persistentstorage/sql/SRC/Common/SqlMap.h
persistentstorage/sql/SRC/Common/SqlMap.inl
persistentstorage/sql/SRC/Common/SqlPanic.h
persistentstorage/sql/SRC/Common/SqlTraceDef.h
persistentstorage/sql/SRC/Common/SqlUtil.cpp
persistentstorage/sql/SRC/Common/Trace/UTraceSql.cpp
persistentstorage/sql/SRC/Common/Trace/UTraceSql.h
persistentstorage/sql/SRC/Security/SqlSecurity.cpp
persistentstorage/sql/SRC/Security/SqlSecurityImpl.cpp
persistentstorage/sql/SRC/Server/Compact/SqlCompact.cpp
persistentstorage/sql/SRC/Server/Compact/SqlCompactConn.cpp
persistentstorage/sql/SRC/Server/Compact/SqlCompactEntry.cpp
persistentstorage/sql/SRC/Server/Compact/SqlCompactTimer.cpp
persistentstorage/sql/SRC/Server/IPC/IPCStream.cpp
persistentstorage/sql/SRC/Server/IPC/IPCStream.inl
persistentstorage/sql/SRC/Server/SqlBur.cpp
persistentstorage/sql/SRC/Server/SqlSrvAuthorizer.cpp
persistentstorage/sql/SRC/Server/SqlSrvBlob.cpp
persistentstorage/sql/SRC/Server/SqlSrvCollation.cpp
persistentstorage/sql/SRC/Server/SqlSrvConfig.cpp
persistentstorage/sql/SRC/Server/SqlSrvConfig.h
persistentstorage/sql/SRC/Server/SqlSrvDatabase.cpp
persistentstorage/sql/SRC/Server/SqlSrvDatabase.inl
persistentstorage/sql/SRC/Server/SqlSrvDbSysSettings.cpp
persistentstorage/sql/SRC/Server/SqlSrvDbSysSettings.h
persistentstorage/sql/SRC/Server/SqlSrvDriveSpace.cpp
persistentstorage/sql/SRC/Server/SqlSrvFileData.cpp
persistentstorage/sql/SRC/Server/SqlSrvMain.cpp
persistentstorage/sql/SRC/Server/SqlSrvMain.h
persistentstorage/sql/SRC/Server/SqlSrvObjContainer.h
persistentstorage/sql/SRC/Server/SqlSrvObjContainer.inl
persistentstorage/sql/SRC/Server/SqlSrvResourceProfiler.cpp
persistentstorage/sql/SRC/Server/SqlSrvSession.cpp
persistentstorage/sql/SRC/Server/SqlSrvSession.h
persistentstorage/sql/SRC/Server/SqlSrvStatement.cpp
persistentstorage/sql/SRC/Server/SqlSrvStatement.inl
persistentstorage/sql/SRC/Server/SqlSrvStatementUtil.cpp
persistentstorage/sql/SRC/Server/SqlSrvUtil.cpp
persistentstorage/sql/SRC/Server/SqlSrvUtil.h
persistentstorage/sql/TEST/t_sqldefect2.cpp
persistentstorage/sql/TEST/t_sqlfilebuf64.cpp
persistentstorage/sql/TEST/t_sqloslayer.cpp
persistentstorage/sql/TEST/t_sqlperformance.cpp
persistentstorage/sql/TEST/t_sqlperformance5.cpp
persistentstorage/sql/TEST/testexecute/SQLite/src/cdtest.cpp
persistentstorage/sql/traces_SqlDb/OstTraceDefinitions.h
persistentstorage/sql/traces_SqlDb/fixed_id.definitions
persistentstorage/sql/traces_SqlDb/trace.properties
persistentstorage/sql/traces_SqlSrv/OstTraceDefinitions.h
persistentstorage/sql/traces_SqlSrv/fixed_id.definitions
persistentstorage/sql/traces_SqlSrv/trace.properties
persistentstorage/sql/traces_sqlite/OstTraceDefinitions.h
persistentstorage/sql/traces_sqlite/fixed_id.definitions
persistentstorage/sql/traces_sqlite/trace.properties
persistentstorage/sqlite3api/GROUP/BLD.INF
persistentstorage/sqlite3api/GROUP/sqlite3.mmp
persistentstorage/sqlite3api/GROUP/sqlite3tests.bat
persistentstorage/sqlite3api/GROUP/sqlite3tests.iby
persistentstorage/sqlite3api/GROUP/tclsqlite3.mmp
persistentstorage/sqlite3api/OsLayer/FileBuf64.cpp
persistentstorage/sqlite3api/OsLayer/FileBuf64.h
persistentstorage/sqlite3api/OsLayer/SqliteTraceDef.h
persistentstorage/sqlite3api/OsLayer/SqliteUtil.cpp
persistentstorage/sqlite3api/OsLayer/SqliteUtil.h
persistentstorage/sqlite3api/OsLayer/UTraceSqlite.cpp
persistentstorage/sqlite3api/OsLayer/UTraceSqlite.h
persistentstorage/sqlite3api/OsLayer/os_symbian.h
persistentstorage/sqlite3api/OsLayer/os_symbian_emul.cpp
persistentstorage/sqlite3api/OsLayer/os_symbian_hrdw.cpp
persistentstorage/sqlite3api/OsLayer/os_symbian_mt.cpp
persistentstorage/sqlite3api/TEST/TclScript/all.test
persistentstorage/sqlite3api/traces_sqlite3/OstTraceDefinitions.h
persistentstorage/sqlite3api/traces_sqlite3/fixed_id.definitions
persistentstorage/sqlite3api/traces_sqlite3/trace.properties
persistentstorage/store/ROM/StoreTests.IBY
--- a/featuremgmt/featuremgr/src/serverexe/featmgrserver.cpp	Tue Jul 06 16:18:30 2010 +0300
+++ b/featuremgmt/featuremgr/src/serverexe/featmgrserver.cpp	Wed Aug 18 11:30:17 2010 +0300
@@ -317,9 +317,13 @@
     TBool ret( EFalse );
 
     // Use ECom to read information about existing interface implementations
-    _LIT8( KEmptyString, "" );
+#ifndef EXTENDED_FEATURE_MANAGER_TEST
+    _LIT8( KResolverString, "" );
+#else
+    _LIT8( KResolverString, "efmtestplugin" ); //In test server we only want test plugins.
+#endif
     TEComResolverParams resolverParams;
-    resolverParams.SetDataType (KEmptyString);
+    resolverParams.SetDataType (KResolverString);
     resolverParams.SetWildcardMatch (ETrue);
 
     TCleanupItem cleanupItem( ResetAndDestroyArray, &implInfoArray );
@@ -327,9 +331,8 @@
     
     TIMESTAMP( "CFeatMgrServer::LoadPluginsL - ListImplementationsL start: " )
     REComSession::ListImplementationsL( KFeatureInfoPluginInterfaceUid,
+                                        resolverParams,
 #ifndef EXTENDED_FEATURE_MANAGER_TEST                                         
-                                        resolverParams,
-
                                         KRomOnlyResolverUid, 
 #endif                                        
                                         implInfoArray);
--- a/featuremgmt/featuremgr/test/helper/test_plugins/data/102836F3.rss	Tue Jul 06 16:18:30 2010 +0300
+++ b/featuremgmt/featuremgr/test/helper/test_plugins/data/102836F3.rss	Wed Aug 18 11:30:17 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2002-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -35,8 +35,8 @@
                     {
                     implementation_uid = 0x102836F4;
                     version_no = 1;
-                    display_name = "";
-                    default_data = "";      
+                    display_name = "efmtestplugin";
+                    default_data = "efmtestplugin";      
                     opaque_data = "";
 	      //rom-only resolving is disabled for test projects to allow run-time plugin addition and removal 	
                     rom_only = 0;
--- a/featuremgmt/featuremgr/test/helper/test_plugins/data/102836F5.rss	Tue Jul 06 16:18:30 2010 +0300
+++ b/featuremgmt/featuremgr/test/helper/test_plugins/data/102836F5.rss	Wed Aug 18 11:30:17 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2002-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -35,8 +35,8 @@
                     {
                     implementation_uid = 0x102836F6;
                     version_no = 1;
-                    display_name = "";
-                    default_data = "";      
+                    display_name = "efmtestplugin";
+                    default_data = "efmtestplugin";      
                     opaque_data = "";
 	      //rom-only resolving is disabled for test projects to allow run-time plugin addition and removal 	
                     rom_only = 0;
--- a/featuremgmt/featuremgr/test/helper/test_plugins/data/102836F7.rss	Tue Jul 06 16:18:30 2010 +0300
+++ b/featuremgmt/featuremgr/test/helper/test_plugins/data/102836F7.rss	Wed Aug 18 11:30:17 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2002-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -35,8 +35,8 @@
                     {
                     implementation_uid = 0x102836F8;
                     version_no = 1;
-                    display_name = "";
-                    default_data = "";      
+                    display_name = "efmtestplugin";
+                    default_data = "efmtestplugin";      
                     opaque_data = "";
 	      //rom-only resolving is disabled for test projects to allow run-time plugin addition and removal 	
                     rom_only = 0;
--- a/featuremgmt/featuremgr/test/helper/test_plugins/data/102836F9.rss	Tue Jul 06 16:18:30 2010 +0300
+++ b/featuremgmt/featuremgr/test/helper/test_plugins/data/102836F9.rss	Wed Aug 18 11:30:17 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2002-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -35,8 +35,8 @@
                     {
                     implementation_uid = 0x102836FA;
                     version_no = 1;
-                    display_name = "";
-                    default_data = "";      
+                    display_name = "efmtestplugin";
+                    default_data = "efmtestplugin";      
                     opaque_data = "";
 	      //rom-only resolving is disabled for test projects to allow run-time plugin addition and removal 	
                     rom_only = 0;
--- a/featuremgmt/featuremgr/test/helper/test_plugins/data/102836FB.rss	Tue Jul 06 16:18:30 2010 +0300
+++ b/featuremgmt/featuremgr/test/helper/test_plugins/data/102836FB.rss	Wed Aug 18 11:30:17 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2002-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -35,8 +35,8 @@
                     {
                     implementation_uid = 0x102836FC;
                     version_no = 1;
-                    display_name = "";
-                    default_data = "";      
+                    display_name = "efmtestplugin";
+                    default_data = "efmtestplugin";      
                     opaque_data = "";
 	      //rom-only resolving is disabled for test projects to allow run-time plugin addition and removal 	
                     rom_only = 0;
--- a/featuremgmt/featuremgr/test/helper/test_plugins/data/102836FD.rss	Tue Jul 06 16:18:30 2010 +0300
+++ b/featuremgmt/featuremgr/test/helper/test_plugins/data/102836FD.rss	Wed Aug 18 11:30:17 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2002-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -35,8 +35,8 @@
                     {
                     implementation_uid = 0x102836FE;
                     version_no = 1;
-                    display_name = "";
-                    default_data = "";      
+                    display_name = "efmtestplugin";
+                    default_data = "efmtestplugin";      
                     opaque_data = "";
 	      //rom-only resolving is disabled for test projects to allow run-time plugin addition and removal 	
                     rom_only = 0;
--- a/featuremgmt/featuremgr/test/helper/test_plugins/data/102836FF.rss	Tue Jul 06 16:18:30 2010 +0300
+++ b/featuremgmt/featuremgr/test/helper/test_plugins/data/102836FF.rss	Wed Aug 18 11:30:17 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2002-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -35,8 +35,8 @@
                     {
                     implementation_uid = 0x10283700;
                     version_no = 1;
-                    display_name = "";
-                    default_data = "";      
+                    display_name = "efmtestplugin";
+                    default_data = "efmtestplugin";      
                     opaque_data = "";
 	      //rom-only resolving is disabled for test projects to allow run-time plugin addition and removal 	
                     rom_only = 0;
--- a/featuremgmt/featuremgr/test/helper/test_plugins/data/10283707.rss	Tue Jul 06 16:18:30 2010 +0300
+++ b/featuremgmt/featuremgr/test/helper/test_plugins/data/10283707.rss	Wed Aug 18 11:30:17 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2002-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -35,8 +35,8 @@
                     {
                     implementation_uid = 0x10283708;
                     version_no = 1;
-                    display_name = "";
-                    default_data = "";      
+                    display_name = "efmtestplugin";
+                    default_data = "efmtestplugin";      
                     opaque_data = "";
 	      //rom-only resolving is disabled for test projects to allow run-time plugin addition and removal 	
                     rom_only = 0;
--- a/featuremgmt/featuremgr/test/tef/tef_efm_normal/src/component_test_steps.cpp	Tue Jul 06 16:18:30 2010 +0300
+++ b/featuremgmt/featuremgr/test/tef/tef_efm_normal/src/component_test_steps.cpp	Wed Aug 18 11:30:17 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -510,9 +510,7 @@
 	*/
 	
 	// Locals for the test scenarios
-	RApaLsSession ls;
 	RProcess process; 
-	CApaCommandLine* cmdLine;
 	TBitFlags32 flags( 0 ); 	
 	flags.Set( EFeatureSupported);
 	flags.Set( EFeatureModifiable );
@@ -535,14 +533,7 @@
 			   _L("RProcess::Create expects KErrNone, returned value is = %d"),err);
 	if( err==KErrNone )
 		{
-		User::LeaveIfError(ls.Connect());
-		CleanupClosePushL(ls);
-		cmdLine = CApaCommandLine::NewLC();
-		cmdLine->SetExecutableNameL(KDummySWIPath);
-		cmdLine->SetProcessEnvironmentL(process);
 		process.Resume();
-		CleanupStack::PopAndDestroy(2);
-		cmdLine = NULL;
 	
 		// This delay is used to allow P&S to complete the initial setting of the 
 		// KSAUidSoftwareInstallKeyValue property to ESASwisInstall before we proceed with 
@@ -666,14 +657,7 @@
 			   _L("RProcess::Create expects KErrNone, returned value is = %d"),err);
 	if( err==KErrNone )
 		{
-		User::LeaveIfError(ls.Connect());
-		CleanupClosePushL(ls);
-		cmdLine = CApaCommandLine::NewLC();
-		cmdLine->SetExecutableNameL(KDummySWIPath);
-		cmdLine->SetProcessEnvironmentL(process);
 		process.Resume();
-		CleanupStack::PopAndDestroy(2);
-		cmdLine = NULL;
 		
 		// Allow P&S to complete initialising
 		User::After(200000);
@@ -723,14 +707,7 @@
 			   _L("RProcess::Create expects KErrNone, returned value is = %d"),err);
 	if( err==KErrNone )
 		{
-		User::LeaveIfError(ls.Connect());
-		CleanupClosePushL(ls);
-		cmdLine = CApaCommandLine::NewLC();
-		cmdLine->SetExecutableNameL(KDummySWIPath);
-		cmdLine->SetProcessEnvironmentL(process);
 		process.Resume();
-		CleanupStack::PopAndDestroy(2);
-		cmdLine = NULL;
 		
 		// Allow P&S to complete initialising
 		User::After(200000);
@@ -779,14 +756,7 @@
 			   _L("RProcess::Create expects KErrNone, returned value is = %d"),err);
 	if( err==KErrNone )
 		{
-		User::LeaveIfError(ls.Connect());
-		CleanupClosePushL(ls);
-		cmdLine = CApaCommandLine::NewLC();
-		cmdLine->SetExecutableNameL(KDummySWIPath);
-		cmdLine->SetProcessEnvironmentL(process);
 		process.Resume();
-		CleanupStack::PopAndDestroy(2);
-		cmdLine = NULL;
 			
 		// Allow P&S to complete initialising
 		User::After(200000);
@@ -845,14 +815,7 @@
 			   _L("RProcess::Create expects KErrNone, returned value is = %d"),err);
 	if( err==KErrNone )
 		{
-		User::LeaveIfError(ls.Connect());
-		CleanupClosePushL(ls);
-		cmdLine = CApaCommandLine::NewLC();
-		cmdLine->SetExecutableNameL(KDummySWIPath);
-		cmdLine->SetProcessEnvironmentL(process);
 		process.Resume();
-		CleanupStack::PopAndDestroy(2);
-		cmdLine = NULL;
 		
 		// Allow P&S to complete initialising
 		User::After(200000);
@@ -911,14 +874,7 @@
 			   _L("RProcess::Create expects KErrNone, returned value is = %d"),err);
 	if( err==KErrNone )
 		{
-		User::LeaveIfError(ls.Connect());
-		CleanupClosePushL(ls);
-		cmdLine = CApaCommandLine::NewLC();
-		cmdLine->SetExecutableNameL(KDummySWIPath);
-		cmdLine->SetProcessEnvironmentL(process);
 		process.Resume();
-		CleanupStack::PopAndDestroy(2);
-		cmdLine = NULL;
 		
 		// Allow P&S to complete initialising
 		User::After(200000);
@@ -961,14 +917,7 @@
 			   _L("RProcess::Create expects KErrNone, returned value is = %d"),err);
 	if( err==KErrNone )
 		{
-		User::LeaveIfError(ls.Connect());
-		CleanupClosePushL(ls);
-		cmdLine = CApaCommandLine::NewLC();
-		cmdLine->SetExecutableNameL(KDummySWIPath);
-		cmdLine->SetProcessEnvironmentL(process);
 		process.Resume();
-		CleanupStack::PopAndDestroy(2);
-		cmdLine = NULL;
 		
 		// Allow P&S to complete initialising
 		User::After(200000);
@@ -1014,14 +963,7 @@
 			   _L("RProcess::Create expects KErrNone, returned value is = %d"),err);
 	if( err==KErrNone )
 		{
-		User::LeaveIfError(ls.Connect());
-		CleanupClosePushL(ls);
-		cmdLine = CApaCommandLine::NewLC();
-		cmdLine->SetExecutableNameL(KDummySWIPath);
-		cmdLine->SetProcessEnvironmentL(process);
 		process.Resume();
-		CleanupStack::PopAndDestroy(2);
-		cmdLine = NULL;
 		
 		// Allow P&S to complete initialising
 		User::After(200000);
@@ -1141,14 +1083,7 @@
 			   _L("RProcess::Create expects KErrNone, returned value is = %d"),err);
 	if( err==KErrNone )
 		{
-		User::LeaveIfError(ls.Connect());
-		CleanupClosePushL(ls);
-		cmdLine = CApaCommandLine::NewLC();
-		cmdLine->SetExecutableNameL(KDummySWIPath);
-		cmdLine->SetProcessEnvironmentL(process);
 		process.Resume();
-		CleanupStack::PopAndDestroy(2);
-		cmdLine = NULL;
 		
 		// Allow P&S to complete initialising
 		User::After(200000);
@@ -1198,14 +1133,7 @@
 			   _L("RProcess::Create expects KErrNone, returned value is = %d"),err);
 	if( err==KErrNone )
 		{
-		User::LeaveIfError(ls.Connect());
-		CleanupClosePushL(ls);
-		cmdLine = CApaCommandLine::NewLC();
-		cmdLine->SetExecutableNameL(KDummySWIPath);
-		cmdLine->SetProcessEnvironmentL(process);
 		process.Resume();
-		CleanupStack::PopAndDestroy(2);
-		cmdLine = NULL;
 		
 		// Allow P&S to complete initialising
 		User::After(200000);
@@ -1239,14 +1167,7 @@
 			   _L("RProcess::Create expects KErrNone, returned value is = %d"),err);
 	if( err==KErrNone )
 		{
-		User::LeaveIfError(ls.Connect());
-		CleanupClosePushL(ls);
-		cmdLine = CApaCommandLine::NewLC();
-		cmdLine->SetExecutableNameL(KDummySWIPath);
-		cmdLine->SetProcessEnvironmentL(process);
 		process.Resume();
-		CleanupStack::PopAndDestroy(2);
-		cmdLine = NULL;
 			
 		// Allow P&S to complete initialising
 		User::After(200000);
@@ -1305,14 +1226,7 @@
 			   _L("RProcess::Create expects KErrNone, returned value is = %d"),err);
 	if( err==KErrNone )
 		{
-		User::LeaveIfError(ls.Connect());
-		CleanupClosePushL(ls);
-		cmdLine = CApaCommandLine::NewLC();
-		cmdLine->SetExecutableNameL(KDummySWIPath);
-		cmdLine->SetProcessEnvironmentL(process);
 		process.Resume();
-		CleanupStack::PopAndDestroy(2);
-		cmdLine = NULL;
 		
 		// Allow P&S to complete initialising
 		User::After(200000);
@@ -1376,14 +1290,7 @@
 			   _L("RProcess::Create expects KErrNone, returned value is = %d"),err);
 	if( err==KErrNone )
 		{
-		User::LeaveIfError(ls.Connect());
-		CleanupClosePushL(ls);
-		cmdLine = CApaCommandLine::NewLC();
-		cmdLine->SetExecutableNameL(KDummySWIPath);
-		cmdLine->SetProcessEnvironmentL(process);
 		process.Resume();
-		CleanupStack::PopAndDestroy(2);
-		cmdLine = NULL;
 		
 		// Allow P&S to complete initialising
 		User::After(200000);
@@ -1418,14 +1325,7 @@
 		// Starting helping exe
 		_LIT(KHelpingExePath, "helping_exe.exe");
 		err = process.Create(KHelpingExePath, _L("1"));
-		User::LeaveIfError(ls.Connect());
-		CleanupClosePushL(ls);
-		cmdLine = CApaCommandLine::NewLC();
-		cmdLine->SetExecutableNameL(KHelpingExePath);
-		cmdLine->SetProcessEnvironmentL(process);
 		process.Resume();
-		CleanupStack::PopAndDestroy(2);
-		cmdLine = NULL;
 		
 		// Wait for helping_exe to finish
 		User::After(600000);
@@ -1509,14 +1409,7 @@
 			   _L("RProcess::Create expects KErrNone, returned value is = %d"),err);
 	if( err==KErrNone )
 		{
-		User::LeaveIfError(ls.Connect());
-		CleanupClosePushL(ls);
-		cmdLine = CApaCommandLine::NewLC();
-		cmdLine->SetExecutableNameL(KDummySWIPath);
-		cmdLine->SetProcessEnvironmentL(process);
 		process.Resume();
-		CleanupStack::PopAndDestroy(2);
-		cmdLine = NULL;
 		
 		// Allow P&S to complete initialising
 		User::After(200000);
@@ -1543,14 +1436,7 @@
 		// Starting helping exe which is going to call SWIEnd (passing 2 as a parameter to indicate this)
 		_LIT(KHelpingExePath, "helping_exe.exe");
 		err = process.Create(KHelpingExePath, _L("2"));
-		User::LeaveIfError(ls.Connect());
-		CleanupClosePushL(ls);
-		cmdLine = CApaCommandLine::NewLC();
-		cmdLine->SetExecutableNameL(KHelpingExePath);
-		cmdLine->SetProcessEnvironmentL(process);
 		process.Resume();
-		CleanupStack::PopAndDestroy(2);
-		cmdLine = NULL;
 		
 		User::After(500000);
 			
@@ -1603,14 +1489,7 @@
 			   _L("RProcess::Create expects KErrNone, returned value is = %d"),err);
 	if( err==KErrNone )
 		{
-		User::LeaveIfError(ls.Connect());
-		CleanupClosePushL(ls);
-		cmdLine = CApaCommandLine::NewLC();
-		cmdLine->SetExecutableNameL(KDummySWIPath);
-		cmdLine->SetProcessEnvironmentL(process);
 		process.Resume();
-		CleanupStack::PopAndDestroy(2);
-		cmdLine = NULL;
 		
 		// Allow P&S to complete initialising
 		User::After(200000);
--- a/featuremgmt/featuremgr/test/tef/tef_efm_unit/src/efm_unit_teststeps.cpp	Tue Jul 06 16:18:30 2010 +0300
+++ b/featuremgmt/featuremgr/test/tef/tef_efm_unit/src/efm_unit_teststeps.cpp	Wed Aug 18 11:30:17 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -435,16 +435,7 @@
 			   _L("RProcess::Create expects KErrNone, returned value is = %d"),err);
 	if( err==KErrNone )
 		{
-	    RApaLsSession ls;
-		CApaCommandLine* cmdLine;		
-		User::LeaveIfError(ls.Connect());
-		CleanupClosePushL(ls);
-		cmdLine = CApaCommandLine::NewLC();
-		cmdLine->SetExecutableNameL(KDummySWIPath);
-		cmdLine->SetProcessEnvironmentL(iSWIProcess);
-		iSWIProcess.Resume();	
-		CleanupStack::PopAndDestroy(2);
-		cmdLine = NULL;			
+	    iSWIProcess.Resume();	
 		}
     
 	// Install the Active Scheduler. We need this for the SWIListener Active Object on the server to
--- a/loggingservices/eventlogger/LogServ/src/LogServResourceInterpreter.cpp	Tue Jul 06 16:18:30 2010 +0300
+++ b/loggingservices/eventlogger/LogServ/src/LogServResourceInterpreter.cpp	Wed Aug 18 11:30:17 2010 +0300
@@ -133,7 +133,8 @@
 	// Check the entry exists on this drive (e.g. if we are running the log server
 	// from RAM, then default to the ROM if no RSC on the current drive exists).
 	TEntry fsEntry;
-	if	(iFsSession.Entry(fileName, fsEntry) == KErrNotFound)
+	TInt err = iFsSession.Entry(fileName, fsEntry);
+	if ( err == KErrNotFound || err == KErrPathNotFound )
 		{
 		// Switch to ROM (we might already have been launching from the ROM,
 		// in which case this will have no effect anyway).
--- a/loggingservices/eventlogger/Rom/logengtest.iby	Tue Jul 06 16:18:30 2010 +0300
+++ b/loggingservices/eventlogger/Rom/logengtest.iby	Wed Aug 18 11:30:17 2010 +0300
@@ -27,49 +27,48 @@
 
 ECOM_PLUGIN(t_logcntmatchplugin.dll,2000862e.rsc)
 
-file=ABI_DIR\BUILD_DIR\t_logtype.exe          	Test\t_logtype.exe
-file=ABI_DIR\BUILD_DIR\t_logapi.exe          	Test\t_logapi.exe
-file=ABI_DIR\BUILD_DIR\t_logapi2.exe          	Test\t_logapi2.exe
-file=ABI_DIR\BUILD_DIR\t_logbadclient.exe          	Test\t_logbadclient.exe
-file=ABI_DIR\BUILD_DIR\t_logview1.exe        	Test\t_logview1.exe
-file=ABI_DIR\BUILD_DIR\t_logpurge.exe      	Test\t_logpurge.exe
-file=ABI_DIR\BUILD_DIR\t_logheap.exe      	Test\t_logheap.exe
-file=ABI_DIR\BUILD_DIR\t_logfile.exe      	Test\t_logfile.exe
-file=ABI_DIR\BUILD_DIR\t_logfilter.exe      	Test\t_logfilter.exe
-file=ABI_DIR\BUILD_DIR\t_lognotify.exe      	Test\t_lognotify.exe
-file=ABI_DIR\BUILD_DIR\t_logview2.exe      	Test\t_logview2.exe
-file=ABI_DIR\BUILD_DIR\t_logviewfail.exe      	Test\t_logviewfail.exe
-file=ABI_DIR\BUILD_DIR\t_logviewfail2.exe     Test\t_logviewfail2.exe
-file=ABI_DIR\BUILD_DIR\t_logviewfail3.exe      	Test\t_logviewfail3.exe
-file=ABI_DIR\BUILD_DIR\t_logbench.exe      	Test\t_logbench.exe
-file=ABI_DIR\BUILD_DIR\t_logbackup.exe      	Test\t_logbackup.exe
-file=ABI_DIR\BUILD_DIR\t_logevent.exe      	Test\t_logevent.exe
-file=ABI_DIR\BUILD_DIR\t_logwrap.exe      	Test\t_logwrap.exe
-file=ABI_DIR\BUILD_DIR\t_logcontact.exe      	Test\t_logcontact.exe
-file=ABI_DIR\BUILD_DIR\t_logcntmatch.exe      	Test\t_logcntmatch.exe
-file=ABI_DIR\BUILD_DIR\t_logmaxnumlen.exe    Test\t_logmaxnumlen.exe
-file=ABI_DIR\BUILD_DIR\t_logorderbyid.exe		Test\t_logorderbyid.exe
-file=ABI_DIR\BUILD_DIR\t_logservercrash.exe     Test\t_logservercrash.exe
-file=ABI_DIR\BUILD_DIR\t_loghicaphelper.exe	Test\t_loghicaphelper.exe
-file=ABI_DIR\BUILD_DIR\t_loghicapability.exe	Test\t_loghicapability.exe
-file=ABI_DIR\BUILD_DIR\t_loglowcapability.exe	Test\t_loglowcapability.exe
-file=ABI_DIR\BUILD_DIR\t_logsecureview_hicap.exe	Test\t_logsecureview_hicap.exe
-file=ABI_DIR\BUILD_DIR\t_logsecureview_lowcap.exe	Test\t_logsecureview_lowcap.exe
-file=ABI_DIR\BUILD_DIR\t_logsecurity.exe	Test\t_logsecurity.exe
-file=ABI_DIR\BUILD_DIR\t_logservipc.exe		Test\t_logservipc.exe
-file=ABI_DIR\BUILD_DIR\t_logapi_helper.exe		Test\t_logapi_helper.exe
-file=ABI_DIR\BUILD_DIR\t_logcompat.exe	Test\t_logcompat.exe
-file=ABI_DIR\BUILD_DIR\t_logsimid.exe	Test\t_logsimid.exe
+file=ABI_DIR\BUILD_DIR\t_logtype.exe            test\t_logtype.exe
+file=ABI_DIR\BUILD_DIR\t_logapi.exe             test\t_logapi.exe
+file=ABI_DIR\BUILD_DIR\t_logapi2.exe            test\t_logapi2.exe
+file=ABI_DIR\BUILD_DIR\t_logbadclient.exe       test\t_logbadclient.exe
+file=ABI_DIR\BUILD_DIR\t_logview1.exe           test\t_logview1.exe
+file=ABI_DIR\BUILD_DIR\t_logpurge.exe           test\t_logpurge.exe
+file=ABI_DIR\BUILD_DIR\t_logheap.exe            test\t_logheap.exe
+file=ABI_DIR\BUILD_DIR\t_logfile.exe            test\t_logfile.exe
+file=ABI_DIR\BUILD_DIR\t_logfilter.exe          test\t_logfilter.exe
+file=ABI_DIR\BUILD_DIR\t_lognotify.exe          test\t_lognotify.exe
+file=ABI_DIR\BUILD_DIR\t_logview2.exe           test\t_logview2.exe
+file=ABI_DIR\BUILD_DIR\t_logviewfail.exe        test\t_logviewfail.exe
+file=ABI_DIR\BUILD_DIR\t_logviewfail2.exe       test\t_logviewfail2.exe
+file=ABI_DIR\BUILD_DIR\t_logviewfail3.exe       test\t_logviewfail3.exe
+file=ABI_DIR\BUILD_DIR\t_logbench.exe           test\t_logbench.exe
+file=ABI_DIR\BUILD_DIR\t_logbackup.exe          test\t_logbackup.exe
+file=ABI_DIR\BUILD_DIR\t_logevent.exe           test\t_logevent.exe
+file=ABI_DIR\BUILD_DIR\t_logwrap.exe            test\t_logwrap.exe
+file=ABI_DIR\BUILD_DIR\t_logcontact.exe         test\t_logcontact.exe
+file=ABI_DIR\BUILD_DIR\t_logcntmatch.exe        test\t_logcntmatch.exe
+file=ABI_DIR\BUILD_DIR\t_logmaxnumlen.exe       test\t_logmaxnumlen.exe
+file=ABI_DIR\BUILD_DIR\t_logorderbyid.exe       test\t_logorderbyid.exe
+file=ABI_DIR\BUILD_DIR\t_logservercrash.exe     test\t_logservercrash.exe
+file=ABI_DIR\BUILD_DIR\t_loghicaphelper.exe     test\t_loghicaphelper.exe
+file=ABI_DIR\BUILD_DIR\t_loghicapability.exe    test\t_loghicapability.exe
+file=ABI_DIR\BUILD_DIR\t_loglowcapability.exe   test\t_loglowcapability.exe
+file=ABI_DIR\BUILD_DIR\t_logsecureview_hicap.exe    test\t_logsecureview_hicap.exe
+file=ABI_DIR\BUILD_DIR\t_logsecureview_lowcap.exe   test\t_logsecureview_lowcap.exe
+file=ABI_DIR\BUILD_DIR\t_logsecurity.exe        test\t_logsecurity.exe
+file=ABI_DIR\BUILD_DIR\t_logservipc.exe         test\t_logservipc.exe
+file=ABI_DIR\BUILD_DIR\t_logapi_helper.exe      test\t_logapi_helper.exe
+file=ABI_DIR\BUILD_DIR\t_logcompat.exe          test\t_logcompat.exe
+file=ABI_DIR\BUILD_DIR\t_logsimid.exe           test\t_logsimid.exe
 
-data=DATAZ_\test\logengtests.bat          Test\logengtests.bat
-
-data=DATAZ_\test\oldLogdbu.dat            Test\oldLogdbu.dat
-data=DATAZ_\test\corruptLogdbu.dat        Test\corruptLogdbu.dat
-data=DATAZ_\test\corruptDamagedLogdbu.dat Test\corruptDamagedLogdbu.dat
-data=DATAZ_\test\101f401d.txt             Test\101f401d.txt
+data=DATAZ_\test\logengtests.bat                test\logengtests.bat
+data=DATAZ_\test\oldlogdbu.dat                  test\oldlogdbu.dat
+data=DATAZ_\test\corruptlogdbu.dat              test\corruptlogdbu.dat
+data=DATAZ_\test\corruptdamagedlogdbu.dat       test\corruptdamagedlogdbu.dat
+data=DATAZ_\test\101f401d_test.txt              test\101f401d_test.txt
 
 //The next line to be uncommented if the testing is performed locally. Otherwise t_logview2 fails - 
 //the following file is missing and needed by the time zone server.
-//data=ZPRIVATE\10202BE9\1020383e.txt     private\10202be9\1020383e.txt
+//data=ZPRIVATE\10202BE9\1020383e.txt           private\10202be9\1020383e.txt
 
 #endif
--- a/loggingservices/eventlogger/group/BLD.INF	Tue Jul 06 16:18:30 2010 +0300
+++ b/loggingservices/eventlogger/group/BLD.INF	Wed Aug 18 11:30:17 2010 +0300
@@ -64,10 +64,10 @@
 ../Rom/logengtest.iby                   /epoc32/rom/include/logengtest.iby
 ../group/logengtests.bat                z:/test/logengtests.bat
 
-../test/src/oldLogdbu.dat               z:/test/oldLogdbu.dat
-../test/src/corruptLogdbu.dat           z:/test/corruptLogdbu.dat
-../test/src/corruptDamagedLogdbu.dat    z:/test/corruptDamagedLogdbu.dat
-../test/101f401d.txt                    z:/test/101f401d.txt
+../test/src/oldLogdbu.dat               z:/test/oldlogdbu.dat
+../test/src/corruptLogdbu.dat           z:/test/corruptlogdbu.dat
+../test/src/corruptDamagedLogdbu.dat    z:/test/corruptdamagedlogdbu.dat
+../test/101f401d.txt                    z:/test/101f401d_test.txt
 
 PRJ_TESTMMPFILES
 
--- a/loggingservices/eventlogger/test/src/t_logapi.cpp	Tue Jul 06 16:18:30 2010 +0300
+++ b/loggingservices/eventlogger/test/src/t_logapi.cpp	Wed Aug 18 11:30:17 2010 +0300
@@ -780,17 +780,24 @@
 	_LIT(KExecutableFileName,		"t_logapi_helper.exe");
 	_LIT(KCommandParameters,		"c:\\private\\10202be9\\;c:\\private\\10202be9\\101f401d.txt;3");
 	RProcess process;
+	TRequestStatus processWaitStatus;
 	TInt r = process.Create(KExecutableFileName, KCommandParameters); 
+	TEST(r == KErrNone);
+	process.Logon(processWaitStatus);
 	process.Resume();
-	process.Close();	 
-	User::After(1000);
+	User::WaitForRequest(processWaitStatus);
+	TEST(processWaitStatus.Int() == KErrNone);
+	process.Close();
 	
 	 //copy the repository file to the folder 10202be9
-	_LIT(KCommandParameters1,		"z:\\test\\101f401d.txt;c:\\private\\10202be9\\101f401d.txt;0");
+	_LIT(KCommandParameters1,		"z:\\test\\101f401d_TEST.txt;c:\\private\\10202be9\\101f401d.txt;0");
 	r = process.Create(KExecutableFileName, KCommandParameters1); 
+	TEST(r == KErrNone);
+	process.Logon(processWaitStatus);
 	process.Resume();
-	process.Close();	 
-	User::After(1000);
+	User::WaitForRequest(processWaitStatus);
+	TEST(processWaitStatus.Int() == KErrNone);
+	process.Close();
 	
 	TestUtils::DeleteDatabaseL();
 	
@@ -830,9 +837,13 @@
 	//delete the repository file c:\\private\\10202be9\\101f401d.txt.
 	_LIT(KCommandParameters2,		"c:\\private\\10202be9\\101f401d.txt;private\\10202be9\101f401d.txt;2");
 	r = process.Create(KExecutableFileName, KCommandParameters2); 
+	TEST(r == KErrNone);
+	process.Logon(processWaitStatus);
 	process.Resume();
-	process.Close();	 
-	User::After(1000);
+	User::WaitForRequest(processWaitStatus);
+	TEST(processWaitStatus.Int() == KErrNone);
+	process.Close();
+
 	theLog.Write(_L8("Deleting the Log engine database... \n"));	
 	TestUtils::DeleteDatabaseL();
 	TheTest.Next(_L("Delay of 2 min, the necessary time to central repository to unload its cache... "));	
--- a/loggingservices/eventlogger/test/src/t_logcompat.cpp	Tue Jul 06 16:18:30 2010 +0300
+++ b/loggingservices/eventlogger/test/src/t_logcompat.cpp	Wed Aug 18 11:30:17 2010 +0300
@@ -684,6 +684,7 @@
 
 void doTestsL()
 	{
+	TestUtils::Initialize(_L("t_logcompat"));
 	TheTest.Start(_L("The LogEng compatibility test cases are compiled only when SYMBIAN_ENABLE_EVENTLOGGER_DUALSIM macro is defined!"));
 	}
 
--- a/loggingservices/filelogger/TSRC/T_LOG.CPP	Tue Jul 06 16:18:30 2010 +0300
+++ b/loggingservices/filelogger/TSRC/T_LOG.CPP	Wed Aug 18 11:30:17 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 1997-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -64,40 +64,15 @@
 
 LOCAL_C TInt DeleteFolder(const TDesC& aFolder)
 	{
-
-	TUint temp;
-	_LIT(KLogDir,"c:\\Logs\\");
-	TInt ret=fs.Att(KLogDir,temp);
-	if (ret==KErrPathNotFound)
-		return KErrNone;
-	else
-		{
-		TInt exists=fs.Att(aFolder,temp);
-		if (exists==KErrPathNotFound)
-			return KErrNone;
-		
-		if (exists!=KErrNotFound)
-			{
-			TFileName file1=aFolder;
-			file1.Append(KTestLogFileName1);
-			ret=fs.Delete(file1);
-			if (ret!=KErrNone && ret!=KErrNotFound)
-				return ret;
-			TFileName file2=aFolder;
-			file2.Append(KTestLogFileName1);
-			ret=fs.Delete(file2);
-			if (ret!=KErrNone && ret!=KErrNotFound)
-				return ret;
-			}
-
-		CFileMan* fileman=NULL;
-		TRAP(ret,fileman=CFileMan::NewL(fs));
-		TFileName folder;
-		folder.Copy(aFolder.Left(aFolder.Length()-1));
-		ret=fileman->RmDir(folder);
-		delete fileman;
-		return ret;
-		}
+    CFileMan* fileman=NULL;
+    TRAPD(ret,fileman=CFileMan::NewL(fs));
+    ret=fileman->RmDir(aFolder);
+    delete fileman;
+    if (ret==KErrPathNotFound || ret==KErrNotFound)
+        {
+        return KErrNone;
+        }
+    return ret;
 	}
 
 LOCAL_C void CreateFolderL(const TDesC& aFolder)
--- a/persistentstorage/dbms/group/BLD.INF	Tue Jul 06 16:18:30 2010 +0300
+++ b/persistentstorage/dbms/group/BLD.INF	Wed Aug 18 11:30:17 2010 +0300
@@ -83,23 +83,23 @@
 DBMSTests.iby                   /epoc32/rom/include/dbmstests.iby
 DbmsTests.bat                   z:/test/dbmstests.bat
 
-../tdbms/11335577.spd           z:/private/100012a5/policy/11335577.spd
-../tdbms/11335578.spd           z:/private/100012a5/policy/11335578.spd
-../tdbms/11335579.spd           z:/private/100012a5/policy/11335579.spd
+../tdbms/11335577.SPD           z:/private/100012a5/policy/11335577.spd
+../tdbms/11335578.SPD           z:/private/100012a5/policy/11335578.spd
+../tdbms/11335579.SPD           z:/private/100012a5/policy/11335579.spd
 ../tdbms/1133557A.spd           z:/private/100012a5/policy/1133557a.spd
-../tdbms/12344321.spd           z:/private/100012a5/policy/12344321.spd
-../tdbms/dbs_11335578_A.DB      z:/private/100012a5/dbs_11335578_a.db
-../tdbms/dbs_11335578_B.DB      z:/private/100012a5/dbs_11335578_b.db
-../tdbms/dbs_11335578_Z.DB      z:/private/100012a5/dbs_11335578_z.db
-../tdbms/dbs_11335579_TESTDB.DB z:/private/100012a5/dbs_11335579_testdb.db
-../tdbms/dbs_1133557A_ZZZ.DB    z:/private/100012a5/dbs_1133557a_zzz.db
-../tdbms/dbs_12344321_1234567890123456789012345678901234567890123456789012345678901234567890.DB	z:/private/100012a5/dbs_12344321_1234567890123456789012345678901234567890123456789012345678901234567890.db
+../tdbms/12344321.SPD           z:/private/100012a5/policy/12344321.spd
+../tdbms/DBS_11335578_A.DB      z:/private/100012a5/dbs_11335578_a.db
+../tdbms/DBS_11335578_B.DB      z:/private/100012a5/dbs_11335578_b.db
+../tdbms/DBS_11335578_Z.DB      z:/private/100012a5/dbs_11335578_z.db
+../tdbms/DBS_11335579_TESTDB.DB z:/private/100012a5/dbs_11335579_testdb.db
+../tdbms/DBS_1133557A_ZZZ.DB    z:/private/100012a5/dbs_1133557a_zzz.db
+../tdbms/DBS_12344321_1234567890123456789012345678901234567890123456789012345678901234567890.DB	z:/private/100012a5/dbs_12344321_1234567890123456789012345678901234567890123456789012345678901234567890.db
 ../tdbms/11335577.txt           z:/test/11335577.txt
 ../tdbms/11335578.txt           z:/test/11335578.txt
 ../tdbms/11335579.txt           z:/test/11335579.txt
-../tdbms/1133557A.txt           z:/test/1133557A.txt
+../tdbms/1133557A.txt           z:/test/1133557a.txt
 ../tdbms/t_dbperf1.sql          z:/test/t_dbperf1.sql
-../tdbms/t_script.txt           z:/test/t_script.txt
-../tdbms/typetextktests44.dat   z:/test/typetextktests44.dat
-../tdbms/typetextktests46.dat   z:/test/typetextktests46.dat
-../tdbms/typetextktests47.dat   z:/test/typetextktests47.dat
+../tdbms/T_SCRIPT.TXT           z:/test/t_script.txt
+../tdbms/TypeTextKTests44.dat   z:/test/typetextktests44.dat
+../tdbms/TypeTextKTests46.dat   z:/test/typetextktests46.dat
+../tdbms/TypeTextKTests47.dat   z:/test/typetextktests47.dat
--- a/persistentstorage/dbms/group/DBMSTests.iby	Tue Jul 06 16:18:30 2010 +0300
+++ b/persistentstorage/dbms/group/DBMSTests.iby	Wed Aug 18 11:30:17 2010 +0300
@@ -20,68 +20,66 @@
 REM DBMS Tests
 #include <dbms.iby>
 
-data=DATAZ_\test\DBMStests.bat               \TEST\DBMStests.bat
-
-data=DATAZ_\TEST\T_SCRIPT.TXT                \TEST\T_SCRIPT.TXT
-data=DATAZ_\TEST\11335577.TXT                \TEST\11335577.TXT	
-data=DATAZ_\TEST\11335578.TXT                \TEST\11335578.TXT	
-data=DATAZ_\TEST\11335579.TXT                \TEST\11335579.TXT	
-data=DATAZ_\TEST\1133557A.TXT                \TEST\1133557A.TXT	
-data=DATAZ_\TEST\t_dbperf1.sql               \TEST\t_dbperf1.sql	
+data=DATAZ_\test\dbmstests.bat               \test\dbmstests.bat
+data=DATAZ_\test\t_script.txt                \test\t_script.txt
+data=DATAZ_\test\11335577.txt                \test\11335577.txt	
+data=DATAZ_\test\11335578.txt                \test\11335578.txt		
+data=DATAZ_\test\11335579.txt                \test\11335579.txt		
+data=DATAZ_\test\1133557a.txt                \test\1133557a.txt		
+data=DATAZ_\test\t_dbperf1.sql               \test\t_dbperf1.sql	
 
 // Work around for DEF063276
-data=DATAZ_\test\TypeTextKTests44.dat        \TEST\TypeTextKTests44.dat
-data=DATAZ_\test\TypeTextKTests46.dat        \TEST\TypeTextKTests46.dat
-data=DATAZ_\test\TypeTextKTests47.dat        \TEST\TypeTextKTests47.dat
+data=DATAZ_\test\typetextktests44.dat        \test\typetextktests44.dat
+data=DATAZ_\test\typetextktests46.dat        \test\typetextktests46.dat
+data=DATAZ_\test\typetextktests47.dat        \test\typetextktests47.dat
 
-data=ZPRIVATE\100012A5\POLICY\11335577.SPD   \PRIVATE\100012A5\POLICY\11335577.SPD
-data=ZPRIVATE\100012A5\POLICY\11335578.SPD   \PRIVATE\100012A5\POLICY\11335578.SPD
-data=ZPRIVATE\100012A5\POLICY\11335579.SPD   \PRIVATE\100012A5\POLICY\11335579.SPD
-data=ZPRIVATE\100012A5\POLICY\1133557A.SPD   \PRIVATE\100012A5\POLICY\1133557A.SPD
-data=ZPRIVATE\100012A5\POLICY\12344321.SPD   \PRIVATE\100012A5\POLICY\12344321.SPD
-data=ZPRIVATE\100012A5\DBS_11335578_A.DB     \PRIVATE\100012A5\Dbs_11335578_a.dB
-data=ZPRIVATE\100012A5\DBS_11335578_B.DB     \PRIVATE\100012A5\dbs_11335578_b.DB
-data=ZPRIVATE\100012A5\DBS_11335578_Z.DB     \PRIVATE\100012A5\dBS_11335578_z.db
-data=ZPRIVATE\100012A5\DBS_11335579_TESTDB.DB \PRIVATE\100012A5\DbS_11335579_TEStdB.DB
-data=ZPRIVATE\100012A5\DBS_12344321_1234567890123456789012345678901234567890123456789012345678901234567890.DB \PRIVATE\100012A5\DBS_12344321_1234567890123456789012345678901234567890123456789012345678901234567890.DB
-data=ZPRIVATE\100012A5\DBS_1133557A_ZZZ.DB   \PRIVATE\100012A5\DBS_1133557A_ZZZ.db
+data=ZPRIVATE\100012a5\policy\11335577.spd      \private\100012a5\pOLICY\11335577.spd
+data=ZPRIVATE\100012a5\policy\11335578.spd      \private\100012a5\pOLICY\11335578.spd
+data=ZPRIVATE\100012a5\policy\11335579.spd      \private\100012a5\pOLICY\11335579.spd
+data=ZPRIVATE\100012a5\policy\1133557a.spd      \private\100012a5\pOLICY\1133557a.spd
+data=ZPRIVATE\100012a5\policy\12344321.spd      \private\100012a5\pOLICY\12344321.spd
+data=ZPRIVATE\100012a5\dbs_11335578_a.db        \private\100012a5\dbs_11335578_a.dB
+data=ZPRIVATE\100012a5\dbs_11335578_b.db        \private\100012a5\dbs_11335578_b.dB
+data=ZPRIVATE\100012a5\dbs_11335578_z.db        \private\100012a5\dbs_11335578_z.db
+data=ZPRIVATE\100012a5\dbs_11335579_testdb.db   \private\100012a5\dbs_11335579_testdb.db
+data=ZPRIVATE\100012a5\dbs_12344321_1234567890123456789012345678901234567890123456789012345678901234567890.DB \PRIVATE\100012A5\dbs_12344321_1234567890123456789012345678901234567890123456789012345678901234567890.db
+data=ZPRIVATE\100012a5\dbs_1133557a_zzz.db      \private\100012a5\dbs_1133557a_zzz.db
 
-file=ABI_DIR\BUILD_DIR\TEST.DBX				\SYSTEM\LIBS\TEST.DBX
-file=ABI_DIR\BUILD_DIR\T_DBENVCREATE.EXE	\TEST\T_DBENVCREATE.EXE
-file=ABI_DIR\BUILD_DIR\T_DBALTER.EXE		\TEST\T_DBALTER.EXE
-file=ABI_DIR\BUILD_DIR\T_DBBENCH.EXE		\TEST\T_DBBENCH.EXE
-file=ABI_DIR\BUILD_DIR\T_DBBIG.EXE			\TEST\T_DBBIG.EXE
-file=ABI_DIR\BUILD_DIR\T_DBBUG.EXE			\TEST\T_DBBUG.EXE
-file=ABI_DIR\BUILD_DIR\T_DBCLIENT.EXE		\TEST\T_DBCLIENT.EXE
-file=ABI_DIR\BUILD_DIR\T_DBCOMP.EXE			\TEST\T_DBCOMP.EXE
-file=ABI_DIR\BUILD_DIR\T_DBAPI.EXE			\TEST\T_DBAPI.EXE
-file=ABI_DIR\BUILD_DIR\T_DBSRV.EXE			\TEST\T_DBSRV.EXE
-file=ABI_DIR\BUILD_DIR\T_DBFAIL.EXE			\TEST\T_DBFAIL.EXE
-file=ABI_DIR\BUILD_DIR\T_DBINDEX.EXE		\TEST\T_DBINDEX.EXE
-file=ABI_DIR\BUILD_DIR\T_DBLIMIT.EXE		\TEST\T_DBLIMIT.EXE
-file=ABI_DIR\BUILD_DIR\T_DBSCRIPT.EXE		\TEST\T_DBSCRIPT.EXE
-file=ABI_DIR\BUILD_DIR\T_DBSQL.EXE			\TEST\T_DBSQL.EXE
-file=ABI_DIR\BUILD_DIR\T_DBSTRESS.EXE		\TEST\T_DBSTRESS.EXE
-file=ABI_DIR\BUILD_DIR\T_DBTRANS.EXE		\TEST\T_DBTRANS.EXE
-file=ABI_DIR\BUILD_DIR\T_DBWINDOW.EXE		\TEST\T_DBWINDOW.EXE
-file=ABI_DIR\BUILD_DIR\T_DBPANIC.EXE		\TEST\T_DBPANIC.EXE
-file=ABI_DIR\BUILD_DIR\T_DBDEFECT.EXE		\TEST\T_DBDEFECT.EXE
-file=ABI_DIR\BUILD_DIR\T_DBLONGCOL.EXE		\TEST\T_DBLONGCOL.EXE
-file=ABI_DIR\BUILD_DIR\T_DBPLATSEC.EXE		\TEST\T_DBPLATSEC.EXE
-file=ABI_DIR\BUILD_DIR\T_DBPLATSEC1.EXE		\TEST\T_DBPLATSEC1.EXE
-file=ABI_DIR\BUILD_DIR\T_DBPLATSEC2.EXE		\TEST\T_DBPLATSEC2.EXE
-file=ABI_DIR\BUILD_DIR\T_DBPLATSEC3.EXE		\TEST\T_DBPLATSEC3.EXE
-file=ABI_DIR\BUILD_DIR\T_DBPLATSEC4.EXE		\TEST\T_DBPLATSEC4.EXE
-file=ABI_DIR\BUILD_DIR\T_DBPLATSEC5.EXE		\TEST\T_DBPLATSEC5.EXE
-file=ABI_DIR\BUILD_DIR\T_DBNEWCAP1.EXE		\TEST\T_DBNEWCAP1.EXE
-file=ABI_DIR\BUILD_DIR\T_DBPLATSECPERF.EXE	\TEST\T_DBPLATSECPERF.EXE
-file=ABI_DIR\BUILD_DIR\T_DBBACKUPSID.EXE	\TEST\T_DBBACKUPSID.EXE
-file=ABI_DIR\BUILD_DIR\T_DBOOD.EXE			\TEST\T_DBOOD.EXE
-file=ABI_DIR\BUILD_DIR\T_DBSTRCMP.EXE		\TEST\T_DBSTRCMP.EXE
-file=ABI_DIR\BUILD_DIR\T_DBPERF1.EXE		\TEST\T_DBPERF1.EXE
-file=ABI_DIR\BUILD_DIR\T_DBPERF2.EXE		\TEST\T_DBPERF2.EXE
-file=ABI_DIR\BUILD_DIR\T_DBPERF3.EXE		\TEST\T_DBPERF3.EXE
-file=ABI_DIR\BUILD_DIR\T_DBENVDESTROY.EXE	\TEST\T_DBENVDESTROY.EXE
+file=ABI_DIR\BUILD_DIR\T_DBENVCREATE.EXE	\test\t_dbenvcreate.exe
+file=ABI_DIR\BUILD_DIR\T_DBALTER.EXE		\test\t_dbalter.exe
+file=ABI_DIR\BUILD_DIR\T_DBBENCH.EXE		\test\t_dbbench.exe
+file=ABI_DIR\BUILD_DIR\T_DBBIG.EXE			\test\t_dbbig.exe
+file=ABI_DIR\BUILD_DIR\T_DBBUG.EXE			\test\t_dbbug.exe
+file=ABI_DIR\BUILD_DIR\T_DBCLIENT.EXE		\test\t_dbclient.exe
+file=ABI_DIR\BUILD_DIR\T_DBCOMP.EXE			\test\t_dbcomp.exe
+file=ABI_DIR\BUILD_DIR\T_DBAPI.EXE			\test\t_dbapi.exe
+file=ABI_DIR\BUILD_DIR\T_DBSRV.EXE			\test\t_dbsrv.exe
+file=ABI_DIR\BUILD_DIR\T_DBFAIL.EXE			\test\t_dbfail.exe
+file=ABI_DIR\BUILD_DIR\T_DBINDEX.EXE		\test\t_dbindex.exe
+file=ABI_DIR\BUILD_DIR\T_DBLIMIT.EXE		\test\t_dblimit.exe
+file=ABI_DIR\BUILD_DIR\T_DBSCRIPT.EXE		\test\t_dbscript.exe
+file=ABI_DIR\BUILD_DIR\T_DBSQL.EXE			\test\t_dbsql.exe
+file=ABI_DIR\BUILD_DIR\T_DBSTRESS.EXE		\test\t_dbstress.exe
+file=ABI_DIR\BUILD_DIR\T_DBTRANS.EXE		\test\t_dbtrans.exe
+file=ABI_DIR\BUILD_DIR\T_DBWINDOW.EXE		\test\t_dbwindow.exe
+file=ABI_DIR\BUILD_DIR\T_DBPANIC.EXE		\test\t_dbpanic.exe
+file=ABI_DIR\BUILD_DIR\T_DBDEFECT.EXE		\test\t_dbdefect.exe
+file=ABI_DIR\BUILD_DIR\T_DBLONGCOL.EXE		\test\t_dblongcol.exe
+file=ABI_DIR\BUILD_DIR\T_DBPLATSEC.EXE		\test\t_dbplatsec.exe
+file=ABI_DIR\BUILD_DIR\T_DBPLATSEC1.EXE		\test\t_dbplatsec1.exe
+file=ABI_DIR\BUILD_DIR\T_DBPLATSEC2.EXE		\test\t_dbplatsec2.exe
+file=ABI_DIR\BUILD_DIR\T_DBPLATSEC3.EXE		\test\t_dbplatsec3.exe
+file=ABI_DIR\BUILD_DIR\T_DBPLATSEC4.EXE		\test\t_dbplatsec4.exe
+file=ABI_DIR\BUILD_DIR\T_DBPLATSEC5.EXE		\test\t_dbplatsec5.exe
+file=ABI_DIR\BUILD_DIR\T_DBNEWCAP1.EXE		\test\t_dbnewcap1.exe
+file=ABI_DIR\BUILD_DIR\T_DBPLATSECPERF.EXE	\test\t_dbplatsecperf.eXE
+file=ABI_DIR\BUILD_DIR\T_DBBACKUPSID.EXE	\test\t_dbbackupsid.exe
+file=ABI_DIR\BUILD_DIR\T_DBOOD.EXE			\test\t_dbood.exe
+file=ABI_DIR\BUILD_DIR\T_DBSTRCMP.EXE		\test\t_dbstrcmp.exe
+file=ABI_DIR\BUILD_DIR\T_DBPERF1.EXE		\test\t_dbperf1.exe
+file=ABI_DIR\BUILD_DIR\T_DBPERF2.EXE		\test\t_dbperf2.exe
+file=ABI_DIR\BUILD_DIR\T_DBPERF3.EXE		\test\t_dbperf3.exe
+file=ABI_DIR\BUILD_DIR\T_DBENVDESTROY.EXE	\test\t_dbenvdestroy.exE
 
 
 #endif
Binary file persistentstorage/dbms/tdbms/U_SCRIPT.TXT has changed
--- a/persistentstorage/sql/GROUP/BLD.INF	Tue Jul 06 16:18:30 2010 +0300
+++ b/persistentstorage/sql/GROUP/BLD.INF	Wed Aug 18 11:30:17 2010 +0300
@@ -53,13 +53,13 @@
 ../TEST/t_SqlShortNonDb.db                  z:/test/t_sqlshortnondb.db
 ../TEST/contacts_startup_time.sql           z:/test/contacts_startup_time.sql
 ../TEST/t_inc095412.db                      z:/test/t_inc095412.db
-../TEST/default_avacon.dbSQL                z:/test/default_avacon.dbSQL
+../TEST/default_avacon.dbSQL                z:/test/default_avacon.dbsql
 ../TEST/t_sqlbur_backup_ver0.bak            z:/test/t_sqlbur_backup_ver0.bak
 ../TEST/t_sqlperformance4.sql               z:/test/t_sqlperformance4.sql
 ../TEST/{21212122}AADb2.db                  z:/private/10281e17/[21212122]aadb2.db
 ../TEST/{21212122}BBDb2.db                  z:/private/10281e17/[21212122]bbdb2.db
-../TEST/{21212125}T_AB.db                   z:/private/10281e17/[21212125]t_ab.db
-../TEST/{1111CCCC}T_AB.db                   z:/private/10281e17/[1111CCCC]t_ab.db
+../TEST/{21212125}t_ab.db                   z:/private/10281e17/[21212125]t_ab.db
+../TEST/{1111CCCC}t_ab.db                   z:/private/10281e17/[1111cccc]t_ab.db
 ../TEST/{21212125}T_OneDefPolicy.db         z:/private/10281e17/[21212125]t_onedefpolicy.db
 //../TEST/SqlServer.cfg                     z:/private/10281e17/sqlserver.cfg
 ../TEST/t_sqldb1.db                         z:/private/21212124/t_sqldb1.db
--- a/persistentstorage/sql/GROUP/SqlDb.mmp	Tue Jul 06 16:18:30 2010 +0300
+++ b/persistentstorage/sql/GROUP/SqlDb.mmp	Wed Aug 18 11:30:17 2010 +0300
@@ -19,13 +19,6 @@
 @file
 */
 
-//#define SYMBIAN_INCLUDE_EXECUTABLE_TRACE
-#include <e32utrace.mmh>
-
-#ifdef SYMBIAN_INCLUDE_EXECUTABLE_TRACE
-MACRO			SQLDB_ENABLE_TRACE
-#endif
-
 TARGET			sqldb.dll
 TARGETTYPE		dll
 
@@ -35,12 +28,12 @@
 OPTION CW -w noillpragmas
 
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
+USERINCLUDE		../traces_SqlDb
 USERINCLUDE		../INC
 USERINCLUDE		../SRC/Client
 USERINCLUDE		../SRC/Client/IPC
 USERINCLUDE		../SRC/Common
 USERINCLUDE		../SRC/Common/IPC
-USERINCLUDE		../SRC/Common/Trace
 USERINCLUDE		../SRC/Security
 //SqlDb includes sqlite3.h header file for the error code macros defined there
 #ifdef SYMBIAN_USE_SQLITE_VERSION_3_6_4
@@ -52,26 +45,30 @@
 OS_LAYER_ESTLIB_SYSTEMINCLUDE
 
 SOURCEPATH		../SRC/Client
-SOURCE			SQLDatabase.cpp SqlDatabaseImpl.cpp SqlStatement.cpp SqlStatementImpl.cpp SqlStream.cpp
+SOURCE			SQLDatabase.cpp 
+SOURCE			SqlDatabaseImpl.cpp 
+SOURCE			SqlStatement.cpp 
+SOURCE			SqlStatementImpl.cpp 
+SOURCE			SqlStream.cpp
 SOURCE			SqlBlob.cpp
+SOURCE			SqlDbSession.cpp 
+SOURCE			SqlStmtSession.cpp 
+SOURCE			SqlResourceTest.cpp 
+SOURCE			SqlScalarFullSelect.cpp 
+SOURCE			SqlResourceProfiler.cpp
+
+SOURCEPATH		../SRC/Client/IPC
+SOURCE			IPCBuf.cpp
 
 SOURCEPATH		../SRC/Common
-SOURCE			SqlUtil.cpp SqlBufFlat.cpp SqlBufIterator.cpp
-
-SOURCEPATH		../SRC/Client
-SOURCE			SqlDbSession.cpp SqlStmtSession.cpp SqlResourceTest.cpp SqlScalarFullSelect.cpp SqlResourceProfiler.cpp
-SOURCEPATH		../SRC/Client/IPC
-SOURCE			IPCBuf.cpp
-SOURCEPATH		../SRC/Common
+SOURCE			SqlUtil.cpp 
+SOURCE			SqlBufFlat.cpp 
+SOURCE			SqlBufIterator.cpp
 SOURCE			SqlSrvStartup.cpp
 
 SOURCEPATH		../SRC/Security
-SOURCE			SqlSecurity.cpp SqlSecurityImpl.cpp
-
-#ifdef SYMBIAN_INCLUDE_EXECUTABLE_TRACE
-SOURCEPATH 		../SRC/Common/Trace
-SOURCE 			UTraceSql.cpp
-#endif
+SOURCE			SqlSecurity.cpp 
+SOURCE			SqlSecurityImpl.cpp
 
 LIBRARY			euser.lib efsrv.lib estor.lib
 
--- a/persistentstorage/sql/GROUP/SqlSrv.mmp	Tue Jul 06 16:18:30 2010 +0300
+++ b/persistentstorage/sql/GROUP/SqlSrv.mmp	Wed Aug 18 11:30:17 2010 +0300
@@ -19,13 +19,6 @@
 @file
 */
 
-//#define SYMBIAN_INCLUDE_EXECUTABLE_TRACE
-#include <e32utrace.mmh>
-
-#ifdef SYMBIAN_INCLUDE_EXECUTABLE_TRACE
-MACRO			SQLSRV_ENABLE_TRACE
-#endif
-
 TARGET		sqlsrv.exe
 TARGETTYPE	exe
 CAPABILITY	ProtServ
@@ -50,10 +43,10 @@
 
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
 OS_LAYER_ESTLIB_SYSTEMINCLUDE
+USERINCLUDE	../traces_SqlSrv
 USERINCLUDE	../INC
 USERINCLUDE	../SRC/Common
 USERINCLUDE	../SRC/Common/IPC
-USERINCLUDE	../SRC/Common/Trace
 USERINCLUDE	../SRC/Security
 USERINCLUDE	../SRC/Server
 USERINCLUDE	../SRC/Server/IPC
@@ -66,10 +59,23 @@
 #endif
 
 SOURCEPATH	../SRC/Server
-SOURCE		SqlSrvMain.cpp SqlSrvSession.cpp SqlSrvDatabase.cpp SqlSrvStatement.cpp SqlSrvAuthorizer.cpp
-SOURCE		SqlSrvUtil.cpp SqlSrvStrings.cpp SqlSrvStatementUtil.cpp SqlSrvCollation.cpp SqlSrvSecurityMap.cpp
-SOURCE		SqlSrvFileData.cpp SqlSrvDriveSpace.cpp SqlSrvDbSysSettings.cpp SqlSrvConfig.cpp SqlSrvBlob.cpp
-SOURCE		SqlSrvCheckStatement.cpp SqlSrvResourceProfiler.cpp
+SOURCE		SqlSrvMain.cpp 
+SOURCE		SqlSrvSession.cpp 
+SOURCE		SqlSrvDatabase.cpp 
+SOURCE		SqlSrvStatement.cpp 
+SOURCE		SqlSrvAuthorizer.cpp
+SOURCE		SqlSrvUtil.cpp 
+SOURCE		SqlSrvStrings.cpp 
+SOURCE		SqlSrvStatementUtil.cpp 
+SOURCE		SqlSrvCollation.cpp 
+SOURCE		SqlSrvSecurityMap.cpp
+SOURCE		SqlSrvFileData.cpp 
+SOURCE		SqlSrvDriveSpace.cpp 
+SOURCE		SqlSrvDbSysSettings.cpp 
+SOURCE		SqlSrvConfig.cpp 
+SOURCE		SqlSrvBlob.cpp
+SOURCE		SqlSrvCheckStatement.cpp 
+SOURCE		SqlSrvResourceProfiler.cpp
 // for backup and restore
 SOURCE		SqlBur.cpp
 
@@ -77,18 +83,18 @@
 SOURCE		IPCStream.cpp
 
 SOURCEPATH	../SRC/Common
-SOURCE		SqlUtil.cpp SqlBufFlat.cpp SqlBufIterator.cpp
+SOURCE		SqlUtil.cpp 
+SOURCE		SqlBufFlat.cpp 
+SOURCE		SqlBufIterator.cpp
 
 SOURCEPATH	../SRC/Security
 SOURCE		SqlSecurityImpl.cpp 
 
 SOURCEPATH	../SRC/Server/Compact
-SOURCE		SqlCompact.cpp SqlCompactEntry.cpp SqlCompactConn.cpp SqlCompactTimer.cpp
-
-#ifdef SYMBIAN_INCLUDE_EXECUTABLE_TRACE
-SOURCEPATH 	../SRC/Common/Trace
-SOURCE 		UTraceSql.cpp
-#endif
+SOURCE		SqlCompact.cpp 
+SOURCE		SqlCompactEntry.cpp 
+SOURCE		SqlCompactConn.cpp 
+SOURCE		SqlCompactTimer.cpp
 
 LIBRARY		estlib.lib 
 LIBRARY		euser.lib 
--- a/persistentstorage/sql/GROUP/sqlite.mmp	Tue Jul 06 16:18:30 2010 +0300
+++ b/persistentstorage/sql/GROUP/sqlite.mmp	Wed Aug 18 11:30:17 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2005-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -19,13 +19,8 @@
  @file
 */
 
-//#define SYMBIAN_INCLUDE_EXECUTABLE_TRACE
 #include "sqlite_macro.mmh"
 
-#ifdef SYMBIAN_INCLUDE_EXECUTABLE_TRACE
-MACRO			SQLITELIB_ENABLE_TRACE
-#endif
-
 TARGET		sqlite.lib
 TARGETTYPE	lib
 
@@ -68,9 +63,9 @@
 
 //////////////////////////////////////////////////////////////////////////////////////////////////////////
 
-USERINCLUDE		../SRC/Common/Trace
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
 OS_LAYER_ESTLIB_SYSTEMINCLUDE
+USERINCLUDE		../traces_sqlite
 USERINCLUDE		../OsLayer
 
 #ifdef SYMBIAN_USE_SQLITE_VERSION_3_6_4
@@ -195,8 +190,4 @@
 SOURCEPATH	../OsLayer
 SOURCE		FileBuf64.cpp
 SOURCE		os_symbian.cpp
-
-#ifdef SYMBIAN_INCLUDE_EXECUTABLE_TRACE
-SOURCEPATH 	../SRC/Common/Trace
-SOURCE 		UTraceSql.cpp
-#endif
+SOURCE		SqliteUtil.cpp
--- a/persistentstorage/sql/GROUP/sqltests.bat	Tue Jul 06 16:18:30 2010 +0300
+++ b/persistentstorage/sql/GROUP/sqltests.bat	Wed Aug 18 11:30:17 2010 +0300
@@ -14,54 +14,54 @@
 @rem Description:
 @rem
 
-T_SQLENVCREATE.EXE
-T_SQLITE.EXE
-T_SQLAPI.EXE
-T_SQLAPI2.EXE
-T_SQLPANIC.EXE
-T_SQLLANG.EXE
-T_SQLOOM1.EXE
-T_SQLOOM2.EXE
-T_SQLOOM3.EXE
-T_SQLOOM4.EXE
-T_SQLOOM5.EXE
-T_SQLOOM6.EXE
-T_SQLMULTI.EXE
-T_SQLCOLLATE.EXE
-T_SQLTRANS.EXE
-T_SQLLOAD.EXE
-T_SQLGETFIRSTSTMT.EXE
-T_SQLSECURITY1.EXE
-T_SQLSECURITY2.EXE
-T_SQLSECURITY3.EXE
-T_SQLSECURITY4.EXE
-T_SQLSECURITY5.EXE
-T_SQLSECURITY6.EXE
-T_SQLATTACH.EXE
-T_SQLPERFORMANCE.EXE
-T_SQLPERFORMANCE2.EXE
-T_SQLPERFORMANCE3.EXE
-T_SQLPERFORMANCE4.EXE
-T_SQLPERFORMANCE5.EXE
-T_SQLOOD.EXE
-T_SQLOSLAYER.EXE
-T_SQLDEFECT.EXE
-T_SQLDEFECT2.EXE
-T_SQLPRIVCAGE.EXE
-T_SQLBADCLIENT.EXE
-T_SQLBUR.EXE
-T_SQLSCALARFULLSELECT.EXE
-T_SQLFSERR.EXE
-T_SQLCONFIG.EXE
-T_SQLCONFIGFILE.EXE
-T_SQLDBCONFIGFILE.EXE
-T_SQLCOMPACT1.EXE
-T_SQLCOMPACT2.EXE
-T_SQLCOMPACT3.EXE
-T_SQLCOMPACT4.EXE
-T_SQLBLOB.EXE
-T_SQLFILEBUF64.EXE
-T_SQLAUTHORIZER.EXE
-T_SQLSTARTUP.EXE
-T_SQLCORRUPT.EXE
-T_SQLENVDESTROY.EXE
+t_sqlenvcreate.exe
+t_sqlite.exe
+t_sqlapi.exe
+t_sqlapi2.exe
+t_sqlpanic.exe
+t_sqllang.exe
+t_sqloom1.exe
+t_sqloom2.exe
+t_sqloom3.exe
+t_sqloom4.exe
+t_sqloom5.exe
+t_sqloom6.exe
+t_sqlmulti.exe
+t_sqlcollate.exe
+t_sqltrans.exe
+t_sqlload.exe
+t_sqlgetfirststmt.exe
+t_sqlsecurity1.exe
+t_sqlsecurity2.exe
+t_sqlsecurity3.exe
+t_sqlsecurity4.exe
+t_sqlsecurity5.exe
+t_sqlsecurity6.exe
+t_sqlattach.exe
+t_sqlperformance.exe
+t_sqlperformance2.exe
+t_sqlperformance3.exe
+t_sqlperformance4.exe
+t_sqlperformance5.exe
+t_sqlood.exe
+t_sqloslayer.exe
+t_sqldefect.exe
+t_sqldefect2.exe
+t_sqlprivcage.exe
+t_sqlbadclient.exe
+t_sqlbur.exe
+t_sqlscalarfullselect.exe
+t_sqlfserr.exe
+t_sqlconfig.exe
+t_sqlconfigfile.exe
+t_sqldbconfigfile.exe
+t_sqlcompact1.exe
+t_sqlcompact2.exe
+t_sqlcompact3.exe
+t_sqlcompact4.exe
+t_sqlblob.exe
+t_sqlfilebuf64.exe
+t_sqlauthorizer.exe
+t_sqlstartup.exe
+t_sqlcorrupt.exe
+t_sqlenvdestroy.exe
--- a/persistentstorage/sql/GROUP/sqltests.iby	Tue Jul 06 16:18:30 2010 +0300
+++ b/persistentstorage/sql/GROUP/sqltests.iby	Wed Aug 18 11:30:17 2010 +0300
@@ -23,93 +23,87 @@
 #include <charconv.iby>
 #include <sql.iby>
 
-//Include the following to enable the ulogger server and the client tool. 
-//This is used to perform tracing using the UTF2
-
-//#include <uloggerclttool.iby>
-//#include <ulogger.iby>
-
-data=DATAZ_\test\sqlTests.bat                            \TEST\sqlTests.bat
+data=DATAZ_\test\sqlTests.bat                            \test\sqltests.bat
 
-data=DATAZ_\test\contacts_schema_to_vendors.sql          \TEST\contacts_schema_to_vendors.sql
-data=DATAZ_\test\add_simple_contacts.sql                 \TEST\add_simple_contacts.sql
-data=DATAZ_\test\contacts_startup_time.sql               \TEST\contacts_startup_time.sql
-data=DATAZ_\test\TestDb1.DB                              \TEST\TestDb1.dB
-data=DATAZ_\test\CorruptDb.DB                            \TEST\CorruptDb.dB
-data=DATAZ_\test\t_SqlShortNonDb.db                      \TEST\t_SqlShortNonDb.db
-data=DATAZ_\test\t_inc095412.db                          \TEST\t_inc095412.db
-data=DATAZ_\test\default_avacon.dbSQL                    \TEST\default_avacon.dbSQL
-data=DATAZ_\test\t_sqlbur_backup_ver0.bak                \TEST\t_sqlbur_backup_ver0.bak
-data=DATAZ_\test\t_sqlperformance4.sql                   \TEST\t_sqlperformance4.sql
-data=ZPRIVATE\10281e17\[21212122]AADb2.db                \PRIVATE\10281e17\[21212122]AADb2.db
-data=ZPRIVATE\10281e17\[21212122]BBDb2.db                \PRIVATE\10281e17\[21212122]BBDb2.db
-data=ZPRIVATE\10281e17\[21212125]T_AB.db                 \PRIVATE\10281e17\[21212125]T_AB.db
-data=ZPRIVATE\10281e17\[1111CCCC]T_AB.db                 \PRIVATE\10281e17\[1111CCCC]T_AB.db
-data=ZPRIVATE\21212124\t_sqldb1.db                       \PRIVATE\21212124\t_sqldb1.db
-data=ZPRIVATE\10281e17\[21212125]T_OneDefPolicy.db       \PRIVATE\10281e17\[21212125]T_OneDefPolicy.db
-data=ZPRIVATE\10281e17\[98765432]t_2defaultpolicies.db   \PRIVATE\10281e17\[98765432]t_2defaultpolicies.db
-data=ZPRIVATE\10281e17\[98765432]t_emptysettings.db      \PRIVATE\10281e17\[98765432]t_emptysettings.db
-data=ZPRIVATE\10281e17\[98765432]t_invobject.db          \PRIVATE\10281e17\[98765432]t_invobject.db
-data=ZPRIVATE\10281e17\[98765432]t_invversion.db         \PRIVATE\10281e17\[98765432]t_invversion.db
-data=ZPRIVATE\10281e17\[98765432]t_longcollation.db      \PRIVATE\10281e17\[98765432]t_longcollation.db
-data=ZPRIVATE\10281e17\[98765432]t_nocollation.db        \PRIVATE\10281e17\[98765432]t_nocollation.db
-data=ZPRIVATE\10281e17\[98765432]t_nodefaultpolicy.db    \PRIVATE\10281e17\[98765432]t_nodefaultpolicy.db
-data=ZPRIVATE\10281e17\[98765432]t_nosettings.db         \PRIVATE\10281e17\[98765432]t_nosettings.db
+data=DATAZ_\test\contacts_schema_to_vendors.sql          \test\contacts_schema_to_vendors.sql
+data=DATAZ_\test\add_simple_contacts.sql                 \test\add_simple_contacts.sql
+data=DATAZ_\test\contacts_startup_time.sql               \test\contacts_startup_time.sql
+data=DATAZ_\test\testdb1.db                              \test\testdb1.db
+data=DATAZ_\test\corruptdb.db                            \test\corruptdb.db
+data=DATAZ_\test\t_sqlshortnondb.db                      \test\t_sqlshortnondb.db
+data=DATAZ_\test\t_inc095412.db                          \test\t_inc095412.db
+data=DATAZ_\test\default_avacon.dbsql                    \test\default_avacon.dbsql
+data=DATAZ_\test\t_sqlbur_backup_ver0.bak                \test\t_sqlbur_backup_ver0.bak
+data=DATAZ_\test\t_sqlperformance4.sql                   \test\t_sqlperformance4.sql
+data=ZPRIVATE\10281e17\[21212122]aadb2.db                \private\10281e17\[21212122]aadb2.db
+data=ZPRIVATE\10281e17\[21212122]bbdb2.db                \private\10281e17\[21212122]bbdb2.db
+data=ZPRIVATE\10281e17\[21212125]t_ab.db                 \private\10281e17\[21212125]t_ab.db
+data=ZPRIVATE\10281e17\[1111cccc]t_ab.db                 \private\10281e17\[1111CCCC]t_ab.db
+data=ZPRIVATE\21212124\t_sqldb1.db                       \private\21212124\t_sqldb1.db
+data=ZPRIVATE\10281e17\[21212125]t_onedefpolicy.db       \private\10281e17\[21212125]t_onedefpolicy.db
+data=ZPRIVATE\10281e17\[98765432]t_2defaultpolicies.db   \private\10281e17\[98765432]t_2defaultpolicies.db
+data=ZPRIVATE\10281e17\[98765432]t_emptysettings.db      \private\10281e17\[98765432]t_emptysettings.db
+data=ZPRIVATE\10281e17\[98765432]t_invobject.db          \private\10281e17\[98765432]t_invobject.db
+data=ZPRIVATE\10281e17\[98765432]t_invversion.db         \private\10281e17\[98765432]t_invversion.db
+data=ZPRIVATE\10281e17\[98765432]t_longcollation.db      \private\10281e17\[98765432]t_longcollation.db
+data=ZPRIVATE\10281e17\[98765432]t_nocollation.db        \private\10281e17\[98765432]t_nocollation.db
+data=ZPRIVATE\10281e17\[98765432]t_nodefaultpolicy.db    \private\10281e17\[98765432]t_nodefaultpolicy.db
+data=ZPRIVATE\10281e17\[98765432]t_nosettings.db         \private\10281e17\[98765432]t_nosettings.db
 
-file=ABI_DIR\BUILD_DIR\T_SQLENVCREATE.EXE	\TEST\T_SQLENVCREATE.EXE
-file=ABI_DIR\BUILD_DIR\T_SQLITE.EXE		\TEST\T_SQLITE.EXE
-file=ABI_DIR\BUILD_DIR\T_SQLAPI.EXE		\TEST\T_SQLAPI.EXE
-file=ABI_DIR\BUILD_DIR\T_SQLAPI2.EXE		\TEST\T_SQLAPI2.EXE
-file=ABI_DIR\BUILD_DIR\T_SQLPANIC.EXE		\TEST\T_SQLPANIC.EXE
-file=ABI_DIR\BUILD_DIR\T_SQLLANG.EXE		\TEST\T_SQLLANG.EXE
-file=ABI_DIR\BUILD_DIR\T_SQLOOM1.EXE		\TEST\T_SQLOOM1.EXE
-file=ABI_DIR\BUILD_DIR\T_SQLOOM2.EXE		\TEST\T_SQLOOM2.EXE
-file=ABI_DIR\BUILD_DIR\T_SQLOOM3.EXE		\TEST\T_SQLOOM3.EXE
-file=ABI_DIR\BUILD_DIR\T_SQLOOM4.EXE		\TEST\T_SQLOOM4.EXE
-file=ABI_DIR\BUILD_DIR\T_SQLOOM5.EXE		\TEST\T_SQLOOM5.EXE
-file=ABI_DIR\BUILD_DIR\T_SQLOOM6.EXE		\TEST\T_SQLOOM6.EXE
-file=ABI_DIR\BUILD_DIR\T_SQLMULTI.EXE		\TEST\T_SQLMULTI.EXE
-file=ABI_DIR\BUILD_DIR\T_SQLCOLLATE.EXE		\TEST\T_SQLCOLLATE.EXE
-file=ABI_DIR\BUILD_DIR\T_SQLTRANS.EXE		\TEST\T_SQLTRANS.EXE
-file=ABI_DIR\BUILD_DIR\T_SQLLOAD.EXE		\TEST\T_SQLLOAD.EXE
-file=ABI_DIR\BUILD_DIR\T_SQLGETFIRSTSTMT.EXE	\TEST\T_SQLGETFIRSTSTMT.EXE
-file=ABI_DIR\BUILD_DIR\T_SQLSECURITY1.EXE	\TEST\T_SQLSECURITY1.EXE
-file=ABI_DIR\BUILD_DIR\T_SQLSECURITY2.EXE	\TEST\T_SQLSECURITY2.EXE
-file=ABI_DIR\BUILD_DIR\T_SQLSECURITY3.EXE	\TEST\T_SQLSECURITY3.EXE
-file=ABI_DIR\BUILD_DIR\T_SQLSECURITY4.EXE	\TEST\T_SQLSECURITY4.EXE
-file=ABI_DIR\BUILD_DIR\T_SQLSECURITY5.EXE	\TEST\T_SQLSECURITY5.EXE
-file=ABI_DIR\BUILD_DIR\T_SQLSECURITY6.EXE	\TEST\T_SQLSECURITY6.EXE
-file=ABI_DIR\BUILD_DIR\T_SQLATTACH.EXE		\TEST\T_SQLATTACH.EXE
-file=ABI_DIR\BUILD_DIR\T_SQLATTACH2.EXE		\TEST\T_SQLATTACH2.EXE
-file=ABI_DIR\BUILD_DIR\T_SQLPERFORMANCE.EXE	\TEST\T_SQLPERFORMANCE.EXE
-file=ABI_DIR\BUILD_DIR\T_SQLPERFORMANCE2.EXE	\TEST\T_SQLPERFORMANCE2.EXE
-file=ABI_DIR\BUILD_DIR\T_SQLPERFORMANCE3.EXE	\TEST\T_SQLPERFORMANCE3.EXE
-file=ABI_DIR\BUILD_DIR\T_SQLPERFORMANCE4.EXE	\TEST\T_SQLPERFORMANCE4.EXE
-file=ABI_DIR\BUILD_DIR\T_SQLPERFORMANCE5.EXE	\TEST\T_SQLPERFORMANCE5.EXE
-file=ABI_DIR\BUILD_DIR\T_SQLOOD.EXE		\TEST\T_SQLOOD.EXE
-file=ABI_DIR\BUILD_DIR\T_SQLOSLAYER.EXE		\TEST\T_SQLOSLAYER.EXE
-file=ABI_DIR\BUILD_DIR\T_SQLDEFECT.EXE		\TEST\T_SQLDEFECT.EXE
-file=ABI_DIR\BUILD_DIR\T_SQLDEFECT2.EXE		\TEST\T_SQLDEFECT2.EXE
-file=ABI_DIR\BUILD_DIR\T_SQLPRIVCAGE.EXE	\TEST\T_SQLPRIVCAGE.EXE
-file=ABI_DIR\BUILD_DIR\T_SQLBADCLIENT.EXE	\TEST\T_SQLBADCLIENT.EXE
-file=ABI_DIR\BUILD_DIR\T_SQLBUR.EXE		\TEST\T_SQLBUR.EXE
-file=ABI_DIR\BUILD_DIR\T_SQLSCALARFULLSELECT.EXE \TEST\T_SQLSCALARFULLSELECT.EXE
-file=ABI_DIR\BUILD_DIR\T_SQLFSERR.EXE		\TEST\T_SQLFSERR.EXE
-file=ABI_DIR\BUILD_DIR\T_SQLCONFIG.EXE		\TEST\T_SQLCONFIG.EXE
-file=ABI_DIR\BUILD_DIR\T_SQLCONFIGFILE.EXE	\TEST\T_SQLCONFIGFILE.EXE
-file=ABI_DIR\BUILD_DIR\T_SQLDBCONFIGFILE.EXE		\TEST\T_SQLDBCONFIGFILE.EXE
-file=ABI_DIR\BUILD_DIR\T_SQLCOMPACT1.EXE	\TEST\T_SQLCOMPACT1.EXE
-file=ABI_DIR\BUILD_DIR\T_SQLCOMPACT2.EXE	\TEST\T_SQLCOMPACT2.EXE
-file=ABI_DIR\BUILD_DIR\T_SQLCOMPACT3.EXE	\TEST\T_SQLCOMPACT3.EXE
-file=ABI_DIR\BUILD_DIR\T_SQLCOMPACT4.EXE	\TEST\T_SQLCOMPACT4.EXE
-file=ABI_DIR\BUILD_DIR\T_SQLBLOB.EXE	\TEST\T_SQLBLOB.EXE
-file=ABI_DIR\BUILD_DIR\T_SQLAUTHORIZER.EXE \TEST\T_SQLAUTHORIZER.EXE
-file=ABI_DIR\BUILD_DIR\T_SQLFILEBUF64.EXE 	\TEST\T_SQLFILEBUF64.EXE
-file=ABI_DIR\BUILD_DIR\T_SQLSTARTUP.EXE 	\TEST\T_SQLSTARTUP.EXE
-file=ABI_DIR\BUILD_DIR\T_SQLDB64.EXE	\TEST\T_SQLDB64.EXE
-file=ABI_DIR\BUILD_DIR\T_SQLFILESRVCRASH1.EXE	\TEST\T_SQLFILESRVCRASH1.EXE
-file=ABI_DIR\BUILD_DIR\T_SQLFILESRVCRASH2.EXE 	\TEST\T_SQLFILESRVCRASH2.EXE
-file=ABI_DIR\BUILD_DIR\T_SQLCORRUPT.EXE 	\TEST\T_SQLCORRUPT.EXE
-file=ABI_DIR\BUILD_DIR\T_SQLENVDESTROY.EXE	\TEST\T_SQLENVDESTROY.EXE
+file=ABI_DIR\BUILD_DIR\t_sqlenvcreate.exe           \test\t_sqlenvcreate.exe
+file=ABI_DIR\BUILD_DIR\t_sqlite.exe                 \test\t_sqlite.exe
+file=ABI_DIR\BUILD_DIR\t_sqlapi.exe                 \test\t_sqlapi.exe
+file=ABI_DIR\BUILD_DIR\t_sqlapi2.exe                \test\t_sqlapi2.exe
+file=ABI_DIR\BUILD_DIR\t_sqlpanic.exe               \test\t_sqlpanic.exe
+file=ABI_DIR\BUILD_DIR\t_sqllang.exe                \test\t_sqllang.exe
+file=ABI_DIR\BUILD_DIR\t_sqloom1.exe                \test\t_sqloom1.exe
+file=ABI_DIR\BUILD_DIR\t_sqloom2.exe                \test\t_sqloom2.exe
+file=ABI_DIR\BUILD_DIR\t_sqloom3.exe                \test\t_sqloom3.exe
+file=ABI_DIR\BUILD_DIR\t_sqloom4.exe                \test\t_sqloom4.exe
+file=ABI_DIR\BUILD_DIR\t_sqloom5.exe                \test\t_sqloom5.exe
+file=ABI_DIR\BUILD_DIR\t_sqloom6.exe                \test\t_sqloom6.exe
+file=ABI_DIR\BUILD_DIR\t_sqlmulti.exe               \test\t_sqlmulti.exe
+file=ABI_DIR\BUILD_DIR\t_sqlcollate.exe             \test\t_sqlcollate.exe
+file=ABI_DIR\BUILD_DIR\t_sqltrans.exe               \test\t_sqltrans.exe
+file=ABI_DIR\BUILD_DIR\t_sqlload.exe                \test\t_sqlload.exe
+file=ABI_DIR\BUILD_DIR\t_sqlgetfirststmt.exe        \test\t_sqlgetfirststmt.exe
+file=ABI_DIR\BUILD_DIR\t_sqlsecurity1.exe           \test\t_sqlsecurity1.exe
+file=ABI_DIR\BUILD_DIR\t_sqlsecurity2.exe           \test\t_sqlsecurity2.exe
+file=ABI_DIR\BUILD_DIR\t_sqlsecurity3.exe           \test\t_sqlsecurity3.exe
+file=ABI_DIR\BUILD_DIR\t_sqlsecurity4.exe           \test\t_sqlsecurity4.exe
+file=ABI_DIR\BUILD_DIR\t_sqlsecurity5.exe           \test\t_sqlsecurity5.exe
+file=ABI_DIR\BUILD_DIR\t_sqlsecurity6.exe           \test\t_sqlsecurity6.exe
+file=ABI_DIR\BUILD_DIR\t_sqlattach.exe              \test\t_sqlattach.exe
+file=ABI_DIR\BUILD_DIR\t_sqlattach2.exe             \test\t_sqlattach2.exe
+file=ABI_DIR\BUILD_DIR\t_sqlperformance.exe         \test\t_sqlperformance.exe
+file=ABI_DIR\BUILD_DIR\t_sqlperformance2.exe        \test\t_sqlperformance2.exe
+file=ABI_DIR\BUILD_DIR\t_sqlperformance3.exe        \test\t_sqlperformance3.exe
+file=ABI_DIR\BUILD_DIR\t_sqlperformance4.exe        \test\t_sqlperformance4.exe
+file=ABI_DIR\BUILD_DIR\t_sqlperformance5.exe        \test\t_sqlperformance5.exe
+file=ABI_DIR\BUILD_DIR\t_sqlood.exe                 \test\t_sqlood.exe
+file=ABI_DIR\BUILD_DIR\t_sqloslayer.exe             \test\t_sqloslayer.exe
+file=ABI_DIR\BUILD_DIR\t_sqldefect.exe              \test\t_sqldefect.exe
+file=ABI_DIR\BUILD_DIR\t_sqldefect2.exe             \test\t_sqldefect2.exe
+file=ABI_DIR\BUILD_DIR\t_sqlprivcage.exe            \test\t_sqlprivcage.exe
+file=ABI_DIR\BUILD_DIR\t_sqlbadclient.exe           \test\t_sqlbadclient.exe
+file=ABI_DIR\BUILD_DIR\t_sqlbur.exe                 \test\t_sqlbur.exe
+file=ABI_DIR\BUILD_DIR\t_sqlscalarfullselect.exe    \test\t_sqlscalarfullselect.exe
+file=ABI_DIR\BUILD_DIR\t_sqlfserr.exe               \test\t_sqlfserr.exe
+file=ABI_DIR\BUILD_DIR\t_sqlconfig.exe              \test\t_sqlconfig.exe
+file=ABI_DIR\BUILD_DIR\t_sqlconfigfile.exe          \test\t_sqlconfigfile.exE
+file=ABI_DIR\BUILD_DIR\t_sqldbconfigfile.exe        \test\t_sqldbconfigfile.exe
+file=ABI_DIR\BUILD_DIR\t_sqlcompact1.exe            \test\t_sqlcompact1.exe
+file=ABI_DIR\BUILD_DIR\t_sqlcompact2.exe            \test\t_sqlcompact2.exe
+file=ABI_DIR\BUILD_DIR\t_sqlcompact3.exe            \test\t_sqlcompact3.exe
+file=ABI_DIR\BUILD_DIR\t_sqlcompact4.exe            \test\t_sqlcompact4.exe
+file=ABI_DIR\BUILD_DIR\t_sqlblob.exe                \test\t_sqlblob.exe
+file=ABI_DIR\BUILD_DIR\t_sqlauthorizer.exe          \test\t_sqlauthorizer.exe
+file=ABI_DIR\BUILD_DIR\t_sqlfilebuf64.exe           \test\t_sqlfilebuf64.exe
+file=ABI_DIR\BUILD_DIR\t_sqlstartup.exe             \test\t_sqlstartup.exe
+file=ABI_DIR\BUILD_DIR\t_sqldb64.exe                \test\t_sqldb64.exe
+file=ABI_DIR\BUILD_DIR\t_sqlfilesrvcrash1.exe       \test\t_sqlfilesrvcrash1.exe
+file=ABI_DIR\BUILD_DIR\t_sqlfilesrvcrash2.exe       \test\t_sqlfilesrvcrash2.exe
+file=ABI_DIR\BUILD_DIR\t_sqlcorrupt.exe             \test\t_sqlcorrupt.exe
+file=ABI_DIR\BUILD_DIR\t_sqlenvdestroy.exe          \test\t_sqlenvdestroy.exe
 
 #endif
--- a/persistentstorage/sql/GROUP/t_sqlbur.mmp	Tue Jul 06 16:18:30 2010 +0300
+++ b/persistentstorage/sql/GROUP/t_sqlbur.mmp	Wed Aug 18 11:30:17 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -20,7 +20,7 @@
 USERINCLUDE 	. 
 USERINCLUDE 	../SRC/Server
 USERINCLUDE		../SRC/Common
-USERINCLUDE		../SRC/Common/Trace
+USERINCLUDE 	../traces_SqlSrv
 #ifdef SYMBIAN_USE_SQLITE_VERSION_3_6_4
 USERINCLUDE		../SQLite364
 #else
@@ -47,4 +47,4 @@
 UID				0 0x10281e17
 VENDORID		0x70000001
 
-SMPSAFE
\ No newline at end of file
+SMPSAFE
--- a/persistentstorage/sql/GROUP/t_sqlcompact2.mmp	Tue Jul 06 16:18:30 2010 +0300
+++ b/persistentstorage/sql/GROUP/t_sqlcompact2.mmp	Wed Aug 18 11:30:17 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -13,7 +13,6 @@
 // Description:
 //
 
-#include <e32utrace.mmh>
 #include "sqlite_macro.mmh"
 
 TARGET			t_sqlcompact2.exe
@@ -28,7 +27,7 @@
 USERINCLUDE 	.
 USERINCLUDE 	../INC
 USERINCLUDE		../SRC/Common
-USERINCLUDE		../SRC/Common/Trace
+USERINCLUDE 	../traces_SqlSrv
 USERINCLUDE 	../SRC/Server/Compact
 USERINCLUDE 	../SRC/Server
 USERINCLUDE		../OsLayer
--- a/persistentstorage/sql/GROUP/t_sqlcompact3.mmp	Tue Jul 06 16:18:30 2010 +0300
+++ b/persistentstorage/sql/GROUP/t_sqlcompact3.mmp	Wed Aug 18 11:30:17 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -25,6 +25,7 @@
 USERINCLUDE 	.
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
 OS_LAYER_ESTLIB_SYSTEMINCLUDE
+USERINCLUDE		../traces_sqlite
 USERINCLUDE		../OsLayer
 #ifdef SYMBIAN_USE_SQLITE_VERSION_3_6_4
 USERINCLUDE		../SQLite364
--- a/persistentstorage/sql/GROUP/t_sqlconfig.mmp	Tue Jul 06 16:18:30 2010 +0300
+++ b/persistentstorage/sql/GROUP/t_sqlconfig.mmp	Wed Aug 18 11:30:17 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -20,7 +20,7 @@
 USERINCLUDE 	.
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
 USERINCLUDE		../SRC/Common
-USERINCLUDE		../SRC/Common/Trace
+USERINCLUDE 	../traces_SqlSrv
 USERINCLUDE		../SRC/Server
 
 SOURCEPATH		../TEST
@@ -34,4 +34,4 @@
 UID				0 0x1111C1C1
 VENDORID		0x70000001
 
-SMPSAFE
\ No newline at end of file
+SMPSAFE
--- a/persistentstorage/sql/GROUP/t_sqlconfigfile.mmp	Tue Jul 06 16:18:30 2010 +0300
+++ b/persistentstorage/sql/GROUP/t_sqlconfigfile.mmp	Wed Aug 18 11:30:17 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -21,7 +21,7 @@
 USERINCLUDE 	../INC
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
 USERINCLUDE		../SRC/Common
-USERINCLUDE		../SRC/Common/Trace
+USERINCLUDE 	../traces_SqlSrv
 USERINCLUDE		../SRC/Server
 
 SOURCEPATH		../TEST
--- a/persistentstorage/sql/GROUP/t_sqldefect2.mmp	Tue Jul 06 16:18:30 2010 +0300
+++ b/persistentstorage/sql/GROUP/t_sqldefect2.mmp	Wed Aug 18 11:30:17 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -18,7 +18,7 @@
 
 TARGET			t_sqldefect2.exe
 TARGETTYPE		EXE
-CAPABILITY		None
+CAPABILITY		All -Tcb
 
 USERINCLUDE 	.
 USERINCLUDE		../INC
@@ -35,4 +35,4 @@
 
 VENDORID		0x70000001
 
-SMPSAFE
\ No newline at end of file
+SMPSAFE
--- a/persistentstorage/sql/GROUP/t_sqlfilebuf64.mmp	Tue Jul 06 16:18:30 2010 +0300
+++ b/persistentstorage/sql/GROUP/t_sqlfilebuf64.mmp	Wed Aug 18 11:30:17 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -19,6 +19,7 @@
 MACRO 			_SQLPROFILER
 
 USERINCLUDE 	.
+USERINCLUDE		../traces_sqlite
 USERINCLUDE		../OsLayer
 #ifdef SYMBIAN_USE_SQLITE_VERSION_3_6_4
 USERINCLUDE		../SQLite364
@@ -31,6 +32,7 @@
 
 SOURCEPATH		../OsLayer
 SOURCE			FileBuf64.cpp
+SOURCE			SqliteUtil.cpp
 
 SOURCEPATH		../TEST
 SOURCE			t_sqlfilebuf64.cpp
--- a/persistentstorage/sql/GROUP/t_sqlgetfirststmt.mmp	Tue Jul 06 16:18:30 2010 +0300
+++ b/persistentstorage/sql/GROUP/t_sqlgetfirststmt.mmp	Wed Aug 18 11:30:17 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -13,8 +13,6 @@
 // Description:
 //
 
-#include <e32utrace.mmh>
-
 TARGET			t_sqlgetfirststmt.exe
 TARGETTYPE		EXE
 CAPABILITY		None
@@ -29,8 +27,8 @@
 USERINCLUDE 	.
 USERINCLUDE 	../INC
 USERINCLUDE 	../SRC/Common
-USERINCLUDE 	../SRC/Common/Trace
-USERINCLUDE		../OsLayer
+USERINCLUDE 	../traces_SqlSrv
+USERINCLUDE		../OsLayer 
 
 SOURCEPATH		../TEST
 SOURCE			t_sqlgetfirststmt.cpp
--- a/persistentstorage/sql/GROUP/t_sqloom5.mmp	Tue Jul 06 16:18:30 2010 +0300
+++ b/persistentstorage/sql/GROUP/t_sqloom5.mmp	Wed Aug 18 11:30:17 2010 +0300
@@ -35,13 +35,15 @@
 USERINCLUDE 	../INC
 USERINCLUDE 	../SRC/Common
 USERINCLUDE 	../SRC/Common/IPC
-USERINCLUDE 	../SRC/Common/Trace
 USERINCLUDE 	../SRC/Server
 USERINCLUDE 	../SRC/Server/Compact
 USERINCLUDE 	../SRC/Server/IPC
 USERINCLUDE 	../SRC/Security
 USERINCLUDE 	../SQLite
 USERINCLUDE 	../OsLayer
+USERINCLUDE 	../traces_SqlDb
+USERINCLUDE 	../traces_SqlSrv
+
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
 OS_LAYER_ESTLIB_SYSTEMINCLUDE
 
--- a/persistentstorage/sql/GROUP/t_sqlperformance.mmp	Tue Jul 06 16:18:30 2010 +0300
+++ b/persistentstorage/sql/GROUP/t_sqlperformance.mmp	Wed Aug 18 11:30:17 2010 +0300
@@ -13,8 +13,6 @@
 // Description:
 //
 
-#include <e32utrace.mmh>
-
 TARGET			t_sqlperformance.exe
 TARGETTYPE		EXE
 //"AllFiles" capability is needed because the test accesses the database files in the SQL server private data cage
@@ -28,7 +26,7 @@
 USERINCLUDE 	.
 USERINCLUDE 	../INC
 USERINCLUDE 	../SRC/Common
-USERINCLUDE 	../SRC/Common/Trace
+USERINCLUDE 	../traces_SqlSrv
 USERINCLUDE 	../SRC/Server
 USERINCLUDE		../OsLayer
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
--- a/persistentstorage/sql/GROUP/t_sqlstartup.mmp	Tue Jul 06 16:18:30 2010 +0300
+++ b/persistentstorage/sql/GROUP/t_sqlstartup.mmp	Wed Aug 18 11:30:17 2010 +0300
@@ -13,8 +13,8 @@
 // Description:
 //
 #include <e32utrace.mmh>
-TARGET			t_sqlstartup.exe
-TARGETTYPE		EXE
+TARGET          t_sqlstartup.exe
+TARGETTYPE      EXE
 CAPABILITY      ProtServ AllFiles
 
 EPOCFIXEDPROCESS
@@ -25,58 +25,59 @@
 EPOCHEAPSIZE 0x00020000 0x02000000
 #endif
 
-EPOCSTACKSIZE	0x3000
+EPOCSTACKSIZE   0x3000
 
-UID		    0 0x10281E17
+UID             0 0x10281E17
 
 MACRO SQLSRV_STARTUP_TEST
 
-USERINCLUDE 	.
-USERINCLUDE 	../INC
-USERINCLUDE 	../SRC/Common
-USERINCLUDE 	../SRC/Common/IPC
-USERINCLUDE 	../SRC/Common/Trace
-USERINCLUDE 	../SRC/Server
-USERINCLUDE 	../SRC/Server/Compact
-USERINCLUDE 	../SRC/Server/IPC
-USERINCLUDE 	../SRC/Security
-USERINCLUDE 	../SQLite
-USERINCLUDE 	../OsLayer
+USERINCLUDE     .
+USERINCLUDE     ../INC
+USERINCLUDE     ../traces_SqlDb
+USERINCLUDE     ../traces_SqlSrv
+USERINCLUDE     ../SRC/Common
+USERINCLUDE     ../SRC/Common/IPC
+USERINCLUDE     ../SRC/Server
+USERINCLUDE     ../SRC/Server/Compact
+USERINCLUDE     ../SRC/Server/IPC
+USERINCLUDE     ../SRC/Security
+USERINCLUDE     ../SQLite
+USERINCLUDE     ../OsLayer
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
 OS_LAYER_ESTLIB_SYSTEMINCLUDE
 
-SOURCEPATH		../TEST
-SOURCE			t_sqlstartup.cpp
+SOURCEPATH      ../TEST
+SOURCE          t_sqlstartup.cpp
 
-SOURCEPATH		../SRC/Common
-SOURCE			SqlBufFlat.cpp
-SOURCE			SqlUtil.cpp
+SOURCEPATH      ../SRC/Common
+SOURCE          SqlBufFlat.cpp
+SOURCE          SqlUtil.cpp
 
-SOURCEPATH		../SRC/Server
-SOURCE			SqlBur.cpp
-SOURCE			SqlSrvConfig.cpp
-SOURCE			SqlSrvMain.cpp
-SOURCE			SqlSrvDriveSpace.cpp
-SOURCE			SqlSrvStrings.cpp
-SOURCE			SqlSrvStatementUtil.cpp
-SOURCE			SqlSrvSecurityMap.cpp
-SOURCE			SqlSrvUtil.cpp
-SOURCE			SqlSrvResourceProfiler.cpp
+SOURCEPATH      ../SRC/Server
+SOURCE          SqlBur.cpp
+SOURCE          SqlSrvConfig.cpp
+SOURCE          SqlSrvMain.cpp
+SOURCE          SqlSrvDriveSpace.cpp
+SOURCE          SqlSrvStrings.cpp
+SOURCE          SqlSrvStatementUtil.cpp
+SOURCE          SqlSrvSecurityMap.cpp
+SOURCE          SqlSrvUtil.cpp
+SOURCE          SqlSrvResourceProfiler.cpp
 
-SOURCEPATH		../SRC/Server/Compact
-SOURCE			SqlCompact.cpp
-SOURCE			SqlCompactConn.cpp
-SOURCE			SqlCompactEntry.cpp
-SOURCE			SqlCompactTimer.cpp
+SOURCEPATH      ../SRC/Server/Compact
+SOURCE          SqlCompact.cpp
+SOURCE          SqlCompactConn.cpp
+SOURCE          SqlCompactEntry.cpp
+SOURCE          SqlCompactTimer.cpp
 
-LIBRARY			estlib.lib 
-LIBRARY			hal.lib 
-LIBRARY			euser.lib 
-LIBRARY			efsrv.lib
-LIBRARY			estor.lib 
-LIBRARY			abclient.lib
-STATICLIBRARY	sqlite.lib
+LIBRARY         estlib.lib 
+LIBRARY         hal.lib 
+LIBRARY         euser.lib 
+LIBRARY         efsrv.lib
+LIBRARY         estor.lib 
+LIBRARY         abclient.lib
+STATICLIBRARY   sqlite.lib
 
-VENDORID		0x70000001
+VENDORID        0x70000001
 
 SMPSAFE
--- a/persistentstorage/sql/OsLayer/FileBuf64.cpp	Tue Jul 06 16:18:30 2010 +0300
+++ b/persistentstorage/sql/OsLayer/FileBuf64.cpp	Wed Aug 18 11:30:17 2010 +0300
@@ -256,6 +256,7 @@
 */
 RFileBuf64::RFileBuf64(TInt aMinCapacity) :
 	iCapacity(aMinCapacity),
+	iBase(NULL),
 	iReadAheadSize(RFileBuf64::KDefaultReadAheadSize),
 	iOptimized(EFalse)
 	{
@@ -657,9 +658,9 @@
 					iDirty = ETrue;	
 					}
 				else									
-				//Beyond the end of the file and not in the buffer - set file size.
+				//Beyond the end of the file and not in the buffer - write the buffer to the file.
 					{
-					err = DoSetFileSize(aFilePos);
+                    err = DoFileWrite2(aFilePos);
 					}
 				}
 			else										
@@ -673,22 +674,22 @@
 		//4. The new write pos is in the buffer, the data entirely fits in the buffer
 		else
 			{
-			if(iCapacity == iLength)			//The buffer is full. Write the buffer and associate the new file pos
-				{
-				err = DoFileWrite2(aFilePos);
-				}
-			if(err == KErrNone)
-				{
-				TInt amount = Min(len, (iCapacity - (aFilePos - iFilePos)));
-				const TUint8* end = Mem::Copy(iBase + (aFilePos - iFilePos), data, amount);
-				iLength = Max(iLength, (end - iBase));
-				iFileSize = Max(iFileSize, (iFilePos + iLength));
-				len -= amount;
-				data += amount;
-				aFilePos += amount;
-				iDirty = ETrue;	
-				}
-			}
+            if (iFilePos+iCapacity == aFilePos)	//The buffer is full. The new position to write is the end of the buffer.
+                {
+                err = DoFileWrite2(aFilePos);
+                }
+            if(err == KErrNone)
+                {
+                TInt amount = Min(len, (iCapacity - (aFilePos - iFilePos)));
+                const TUint8* end = Mem::Copy(iBase + (aFilePos - iFilePos), data, amount);
+                iLength = Max(iLength, (end - iBase));
+                iFileSize = Max(iFileSize, (iFilePos + iLength));
+                len -= amount;
+                data += amount;
+                aFilePos += amount;
+                iDirty = ETrue;	
+                }
+           }
 		}
 	__FILEBUF64_INVARIANT();
 	return err;
@@ -800,7 +801,7 @@
     DoDiscard();
     iReadAheadSize = RFileBuf64::KDefaultReadAheadSize;
     iBase = static_cast <TUint8*> (User::Alloc(iCapacity));
-    return iBase ? KErrNone : KErrNoMemory; 
+    return iBase ? KErrNone : KErrNoMemory;   
     }
 
 /**
@@ -860,6 +861,10 @@
 		{
 		DoDiscard();
 		}
+	else
+	    {
+        iRealFileSize = iFileSize;
+	    }
 	__FILEBUF64_INVARIANT();
 	return err;
 	}
@@ -901,6 +906,7 @@
 	else
 		{
 		iFileSize = aFileSize;
+		iRealFileSize = aFileSize;
 		}
 	__FILEBUF64_INVARIANT();
 	return err;
@@ -956,12 +962,20 @@
 		__FILEBUF64_INVARIANT();
 		return KErrNone;	
 		}
-	TPtrC8 data(iBase, iLength);		
-	TInt err = iFile.Write(iFilePos, data);
+	TPtrC8 data(iBase, iLength);
+	TInt err = KErrNone;
+	if(iFilePos > iRealFileSize )
+	    {
+        err = DoSetFileSize(iFileSize);
+ 	    }
+	if(err == KErrNone)
+	    {
+        err = iFile.Write(iFilePos, data);
+	    }
 	PROFILE_WRITE(iFilePos, iLength, err);
 	if(err == KErrNone)
 		{
-		iFileSize = Max(iFileSize, (iFilePos + iLength));
+		iRealFileSize = iFileSize;
 		}
 	else
 		{
--- a/persistentstorage/sql/OsLayer/FileBuf64.h	Tue Jul 06 16:18:30 2010 +0300
+++ b/persistentstorage/sql/OsLayer/FileBuf64.h	Wed Aug 18 11:30:17 2010 +0300
@@ -180,7 +180,8 @@
 	TInt		iLength;				//The length of the data currently held in the buffer.
 	//File related
 	TInt64		iFilePos;				//The file position associated with the beginning of the buffer.
-	TInt64		iFileSize;				//The file size.
+	TInt64		iFileSize;				//The file size which is the nominal file length including the buffer contents.
+    TInt64      iRealFileSize;          //The real file size in disk.
 	RFile64		iFile;					//The file object.
 	//Read-ahead related
 	TBool		iDirty;					//The buffer contains pending data to be written to the file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/persistentstorage/sql/OsLayer/SqliteTraceDef.h	Wed Aug 18 11:30:17 2010 +0300
@@ -0,0 +1,55 @@
+// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+#ifndef SQLITETRACEDEF_H
+#define SQLITETRACEDEF_H
+
+#include <e32def.h>
+#include "SqliteUtil.h"
+
+//////////////////////////////////////////////////////////////////////////////////////
+
+#if defined OST_TRACE_COMPILER_IN_USE && defined _SQLITE_OS_TRACE_ENABLED
+    #define __SQLITETRACE_OSVAR(var) var
+    #define __SQLITETRACE_OSEXPR(expr) expr
+#else
+    #define __SQLITETRACE_OSVAR(var)
+    #define __SQLITETRACE_OSEXPR(expr)
+#endif    
+
+//////////////////////////////////////////////////////////////////////////////////////
+
+#if defined OST_TRACE_COMPILER_IN_USE && defined _SQLITE_RDEBUG_PRINT
+    #undef OstTrace0 
+    #undef OstTrace1 
+    #undef OstTraceExt1 
+    #undef OstTraceExt2 
+    #undef OstTraceExt3 
+    #undef OstTraceExt4 
+    #undef OstTraceExt5
+
+    void SqlitePrintf(TInt aGroupName, TInt aTraceName, const char* aFormat, ...);
+
+    #define OstTrace0    SqlitePrintf 
+    #define OstTrace1    SqlitePrintf
+    #define OstTraceExt1 SqlitePrintf
+    #define OstTraceExt2 SqlitePrintf
+    #define OstTraceExt3 SqlitePrintf
+    #define OstTraceExt4 SqlitePrintf
+    #define OstTraceExt5 SqlitePrintf
+#endif//defined OST_TRACE_COMPILER_IN_USE && defined _SQLITE_RDEBUG_PRINT
+
+//////////////////////////////////////////////////////////////////////////////////////
+
+#endif//SQLITETRACEDEF_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/persistentstorage/sql/OsLayer/SqliteUtil.cpp	Wed Aug 18 11:30:17 2010 +0300
@@ -0,0 +1,180 @@
+// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+#include <e32debug.h>
+#include "SqliteUtil.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "SqliteUtilTraces.h"
+#endif
+#include "SqliteTraceDef.h"
+
+///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+#define UNUSED_ARG(arg) arg = arg
+#define UNUSED_DES(arg) arg
+
+///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+#if defined OST_TRACE_COMPILER_IN_USE &&  defined _SQLITE_RDEBUG_PRINT
+
+/**
+This class has been added here to avoid the crashes when _SQLITE_RDEBUG_PRINT macro is defined but the
+data to be printed out is too big and cannot fit into the buffer with size KSqliteMaxPrnStrLen.
+@internalComponent   
+*/
+class TSqliteDes16Overflow : public TDes16Overflow
+    {
+public:    
+    virtual void Overflow(TDes16& /*aDes*/)
+        {
+        }
+    };
+
+//Replaces:
+// 1) "%lld" with "%ld"
+// 2) "%s" with "%S"
+//These are the differences in format specification between RDebig::Print and OST functions.
+//The new format spec length should be less or equal than the old format spec length.
+static void ReplaceFmtSpec(TDes& aFormat, const TDesC& aFmtSpec, const TDesC& aNewFmtSpec)
+	{
+	TInt fmtLength = aFormat.Length();
+	const TInt KDiff = aFmtSpec.Length() - aNewFmtSpec.Length();
+    TPtr ptr((TText*)aFormat.Ptr(), fmtLength, fmtLength);
+    TInt pos;
+    while((pos = ptr.Find(aFmtSpec)) >= 0)
+    	{
+		ptr.Replace(pos, aFmtSpec.Length(), aNewFmtSpec);
+		fmtLength -= KDiff;
+		ptr.Set(ptr.MidTPtr(pos));
+    	}
+    aFormat.SetLength(fmtLength);
+	}
+
+void SqlitePrintf(TInt /*aGroupName*/, TInt /*aTraceName*/, const char* aFormat, ...)
+    {
+    VA_LIST list;
+    VA_START(list, aFormat);
+    TBuf<128> format;
+    _LIT(KTraceIdent, "Sqlite;");
+    format.Copy(TPtrC8((const TUint8*)aFormat));
+    format.Insert(0, KTraceIdent);
+    format.Append(_L("\r\n"));
+    _LIT(KOstI64Fmt, "%lld");
+    _LIT(KDbgPrnI64Fmt, "%ld");
+    ReplaceFmtSpec(format, KOstI64Fmt, KDbgPrnI64Fmt);
+    _LIT(KOstDes8Fmt, "%s");
+    _LIT(KDbgPrnDesFmt, "%S");
+    ReplaceFmtSpec(format, KOstDes8Fmt, KDbgPrnDesFmt);
+    TBuf<KSqliteMaxPrnStrLen> buf;
+    TSqliteDes16Overflow overflowHandler;
+    buf.AppendFormatList(format, list, &overflowHandler);
+#ifdef _SQLITE_RDEBUG_PRINT    
+    RDebug::RawPrint(buf);
+#endif
+    }
+
+const TDesC* SqliteDes8to16Ptr(const TDesC8& aDes)
+	{
+	const TInt KBufSize = 100;
+	static TBuf<KBufSize> buf;
+	TPtrC8 ptr(aDes.Ptr(), Min(aDes.Length(), buf.MaxLength()));
+	buf.Copy(ptr);
+	return &buf;
+	}
+
+#endif//defined OST_TRACE_COMPILER_IN_USE &&  defined _SQLITE_RDEBUG_PRINT 
+
+///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+/**
+SQLite panic category.
+
+@internalComponent
+*/
+_LIT(KSqlitePanicCategory, "Sqlite");
+
+///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+/**
+Panics the caller with aPanicCode panic code.
+The call will terminate the thread where it is called from.
+
+@param aPanicCode Panic code.
+
+@internalComponent
+*/
+static void SqlitePanic(TSqlitePanic aPanicCode)
+	{
+	User::Panic(KSqlitePanicCategory, aPanicCode);
+	}
+	
+///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+/**
+The function prints out a "SQLite" panic message to the console and panics the thread where it is called from.
+It gives a useful information about the found error together with the source file name and line number where
+it occurred.
+
+Note: this function  will output information regarding the panic only if _SQLITE_PANIC_TRACE_ENABLED macro is defined  
+
+@param aFile Source file name
+@param aLine Source line number
+@param aPanicCode Panic code
+@param aHandle Numeric value, uniquely identfying the leaving location (the "this" pointer for example)
+
+@return KErrNone
+
+@internalComponent
+*/  
+TInt TSqliteUtil::Panic(const TText* aFile, TInt aLine, TInt aPanicCode, TUint aHandle)
+    {
+#if defined OST_TRACE_COMPILER_IN_USE && defined _SQLITE_PANIC_TRACE_ENABLED
+    TPtrC fname(FileName(aFile));
+    OstTraceExt5(TRACE_FATAL, TSQLUTIL_PANIC, "SQLite-Panic;0x%X;%S;%d;%S;%d", aHandle, __SQLITEPRNSTR(fname), aLine, __SQLITEPRNSTR(KSqlitePanicCategory), aPanicCode);
+#else
+    UNUSED_ARG(aFile);
+    UNUSED_ARG(aLine);
+    UNUSED_ARG(aHandle);
+#endif      
+    ::SqlitePanic(static_cast <TSqlitePanic> (aPanicCode));
+    return KErrNone;
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+#if defined OST_TRACE_COMPILER_IN_USE && defined _SQLITE_PANIC_TRACE_ENABLED
+
+/**
+The function creates and returns TPtrC object which points to aFile parameter.
+
+@param aFile File name
+@return TPtrC object pointing to aFile parameter.
+
+@internalComponent
+*/	
+TPtrC TSqliteUtil::FileName(const TText* aFile)
+	{
+	TPtrC p(aFile);
+	TInt ix = p.LocateReverse('\\');
+	if(ix<0)
+		ix=p.LocateReverse('/');
+	if(ix>=0)
+		p.Set(p.Mid(1+ix));
+	return p;
+	}
+
+#endif //defined OST_TRACE_COMPILER_IN_USE && defined _SQLITE_PANIC_TRACE_ENABLED
+
+///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/persistentstorage/sql/OsLayer/SqliteUtil.h	Wed Aug 18 11:30:17 2010 +0300
@@ -0,0 +1,143 @@
+// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+#ifndef SQLITEUTIL_H
+#define SQLITEUTIL_H
+
+#include <e32std.h>
+
+/**
+Panic codes - used by asserts in the OS porting layer and the file buffer.
+
+@see KPanicCategory
+
+@internalComponent
+*/
+enum TSqlitePanic
+	{
+	ESqliteOsPanicNullOsLayerDataPtr	= 1,
+	ESqliteOsPanicInvalidWAmount 		= 2,
+	ESqliteOsPanicOffset64bit 			= 3,
+	ESqliteOsPanicInvalidOpType			=11,
+	ESqliteOsPanicInvalidFhStr			=12,
+	ESqliteOsPanicInvalidFhData			=13,
+	ESqliteOsPanicInvalidArg			=14,
+	ESqliteOsPanicInvalidRAmount 		=15,
+	ESqliteOsPanicOsLayerDataExists		=16,
+	ESqliteOsPanicInvalidDrive			=17,
+	ESqliteOsPanicInvalidSectorSize		=18,
+	ESqliteOsPanicInternalError			=19,
+	ESqliteOsPanicNullDbFilePtr			=20,
+	ESqliteOsPanicFastCounterFreq		=21,
+	//
+	EFBufPanicCapacity					=101,
+	EFBufPanicNullBuf					=102,
+	EFBufPanicBufLen					=103,
+	EFBufPanicFilePos					=104,
+	EFBufPanicFileSize					=105,
+	EFBufPanicFileHandle				=106,
+	EFBufPanicFsHandle					=107,
+	EFBufPanicMsgHandle					=108,
+	EFBufPanicMsgIndex					=109,
+	EFBufPanicFileNameLen				=110,
+	EFBufPanicNullThis					=111,
+	EFBufPanicDirty						=112,
+	EFBufPanicNextReadFilePos			=113,
+	EFBufPanicNextReadFilePosHits		=114,
+	EFBufPanicFileBlockSize				=115,
+	EFBufPanicRwDataLength				=116,
+	};
+
+////////////////////////////////////////////////////////////////////////////////////////////
+
+//All macros in this header will have a non-void definition only if the OST_TRACE_COMPILER_IN_USE macro
+//is defined. 
+//In order to get the traces enabled, the OST_TRACE_COMPILER_IN_USE macro has to be defined in
+//OstTraceDefinitions.h file. 
+//After that, the trace output can be redirected by defining _SQL_RDEBUG_PRINT or specific categories
+//of traces can be enabled/disabled.
+
+//Enable _SQLITE_RDEBUG_PRINT if you want to redirect the OS porting layer and file buffer tracing output via RDebug::Print()
+//#define _SQLITE_RDEBUG_PRINT
+
+//Enable _SQLITE_OS_TRACE_ENABLED if you get the OS porting layer traces compiled in the binary
+//#define _SQLITE_OS_TRACE_ENABLED
+
+//Enable _SQLITE_FBUF_TRACE_ENABLED if you get the file buffer traces compiled in the binary
+//#define _SQLITE_FBUF_TRACE_ENABLED
+
+#ifdef _DEBUG
+	//Enable _SQLITE_PANIC_TRACE_ENABLED if you want to get more detailed output regarding panics
+	//#define _SQLITE_PANIC_TRACE_ENABLED
+#endif
+
+///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+//Wrap every string (file name, file path, etc.) you want to trace, in a __SQLITEPRNSTR()/__SQLITEPRNSTR8() macro. 
+//There is a difference how RDebug::Print() and OstTraceExt<n>() work.
+#if defined _SQLITE_RDEBUG_PRINT
+    const TInt KSqliteMaxPrnStrLen = 512;    
+    #define __SQLITEPRNSTR(des)  &des
+    const TDesC* SqliteDes8to16Ptr(const TDesC8& aDes);
+	#define __SQLITEPRNSTR8(des)  SqliteDes8to16Ptr(des) 
+#else
+    #define __SQLITEPRNSTR(des)  des
+    #define __SQLITEPRNSTR8(des) des
+#endif
+
+///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+/**
+Set of useful functions to print diagnostic messages on the console when a panic occurs.
+
+@internalComponent
+*/
+class TSqliteUtil
+	{
+public:
+	static TInt Panic(const TText* aFile, TInt aLine, TInt aPanicCode, TUint aHandle);
+	
+private:
+	static TPtrC FileName(const TText* aFile);
+	
+	};
+
+///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+#define __SQLITESTRING(str) _S(str)
+
+///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+//__SQLITEPANIC/__SQLITEPANIC2 macro is used for printing out additional information when panic occurs in SQLite OS porting layer and the file buffer:
+//source file name, line number, "this" pointer, panic category.
+#define __SQLITEPANIC(aPanicCode)      TSqliteUtil::Panic(__SQLITESTRING(__FILE__), __LINE__, aPanicCode, (TUint)this)
+#define __SQLITEPANIC2(aPanicCode)     TSqliteUtil::Panic(__SQLITESTRING(__FILE__), __LINE__, aPanicCode, 0)
+
+///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+#ifdef _SQLITE_OS_TRACE_ENABLED
+    #define SQLITE_TRACE_OS(trace)   trace
+#else
+    #define SQLITE_TRACE_OS(trace)   do {} while(0)
+#endif
+
+#ifdef _SQLITE_FBUF_TRACE_ENABLED
+    #define SQLITE_TRACE_FBUF(trace)   trace
+#else
+    #define SQLITE_TRACE_FBUF(trace)   do {} while(0)
+#endif
+
+///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+#endif //SQLITEUTIL_H
--- a/persistentstorage/sql/OsLayer/os_symbian.cpp	Tue Jul 06 16:18:30 2010 +0300
+++ b/persistentstorage/sql/OsLayer/os_symbian.cpp	Wed Aug 18 11:30:17 2010 +0300
@@ -40,49 +40,23 @@
 #include "SqliteSymbian.h"
 #include "FileBuf64.h"
 #include <e32math.h>
-#include "UTraceSql.h"
 #ifdef _SQLPROFILER
 #include <hal.h>
 #include "../INC/SqlResourceProfiler.h"
 #endif
+#include "SqliteUtil.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "os_symbianTraces.h"
+#endif
+#include "SqliteTraceDef.h"
 
 /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 
-/**
-Panic category - used by asserts in this file (the OS porting layer).
-
-@see TPanicCodes
-
-@internalComponent
-*/
-_LIT(KPanicCategory, "Sqlite");
-
-/**
-Panic codes - used by asserts in this file (the OS porting layer).
-
-@see KPanicCategory
-
-@internalComponent
-*/
-enum TPanicCodes
-	{
-	EPanicNullOsLayerDataPtr	= 1,
-	EPanicInvalidWAmount 		= 2,
-	EPanicOffset64bit 			= 3,
-	EPanicInvalidOpType			=11,
-	EPanicInvalidFhStr			=12,
-	EPanicInvalidFhData			=13,
-	EPanicInvalidArg			=14,
-	EPanicInvalidRAmount 		=15,
-	EPanicOsLayerDataExists		=16,
-	EPanicInvalidDrive			=17,
-	EPanicInvalidSectorSize		=18,
-	EPanicInternalError			=19,
-	EPanicNullDbFilePtr			=20,
-	EPanicFastCounterFreq		=21
-	};
+//The SQLite temp files willl be created in this subdir
+_LIT(KTempFileDir, "temp");
 
 //Bit-mask constant. If xOpen()'s "aFlag" parameter contains one of these bits set, then the the file top be
 //opened or created is a journal file.
@@ -485,7 +459,7 @@
 	{
 	TInt ticksPerSec = 0;
 	TInt err = HAL::Get(HAL::EFastCounterFrequency, ticksPerSec);
-	__ASSERT_ALWAYS(err == KErrNone, User::Panic(KPanicCategory, EPanicFastCounterFreq));
+	__ASSERT_ALWAYS(err == KErrNone, __SQLITEPANIC2(ESqliteOsPanicFastCounterFreq));
 	return ticksPerSec;
 	}
 
@@ -679,6 +653,47 @@
 #endif//_SQLPROFILER
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+/**
+Os2SqliteErr() is called at the end of many of the interface functions of the OS porting layer (wherever it is appropriate - 
+TFileIo and TVfs interfaces). The purpose of this function is to identify the "out of memory" and "disk is full" errors
+reported by the used Symbian OS APIs (aOsErr parameter) and report them to SQLite as SQLITE_FULL and SQLITE_NOMEM errors.
+The KErrEof error (TFileIo::Read() can return KErrEof) is reported to SQLite as SQLITE_IOERR_SHORT_READ. The rest of failures
+are reported as the error specified in aDefaultErr parameter.
+ 
+@param aOsErr      Symbian OS error
+@param aDefaultErr The default SQLite error that should be used if the aOsErr parameter is not one of:
+                     KErrNone, KErrEof, KErrNoMemory, KErrDiskFull
+@return SQLITE_OK,               The OS porting layer function call has completed successfully, 
+          SQLITE_IOERR_SHORT_READ, The amount of the data read is less than the requested amount,
+          SQLITE_IOERR_NOMEM,      Out of memory,
+          SQLITE_FULL,             The disk is full,
+          aDefaultErr,             The rest of failures will be reported as aDefaultErr.
+*/
+static TInt Os2SqliteErr(TInt aOsErr, TInt aDefaultErr)
+	{
+	switch(aOsErr)
+		{
+		case KErrNone:
+			return SQLITE_OK;	
+		case KErrEof:
+			return SQLITE_IOERR_SHORT_READ;
+		case KErrNoMemory:
+			return SQLITE_IOERR_NOMEM;
+		case KErrDiskFull:
+			return SQLITE_FULL;
+		default:
+#ifdef _DEBUG		
+			RDebug::Print(_L("SQLite OS porting layer, Os2SqliteErr(), err=%d\n"), aOsErr);
+			SQLITE_TRACE_OS(OstTrace1(TRACE_INTERNALS, OS2SQLITEERR, "OS;0;Os2SqliteErr;aOsErr=%d", aOsErr));
+#endif			
+			break;
+		}
+	return aDefaultErr;
+	}
+	
+
+///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 /////////////////////       COsLayerData class declaration   //////////////////////////////////////////////////////////////////
 ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 
@@ -720,7 +735,6 @@
 public:
 	RFs			iFs;		//File session instance.
 	TFileName	iSysPrivDir;//"<system drive>:\" + process's private data path. Initialized in sqlite3SymbianFsOpen().
-							//Used for storing sqlite temporary files.
 	TInt64		iSeed;
 
 private:	
@@ -767,12 +781,13 @@
 	{
 	inline TDbFile();
 	RFileBuf64	iFileBuf;
-	HBufC*		iFullName;				//Used for the "delete file" operation (RFile64::FullName() makes an IPC call!)
 	TInt		iLockType;				//File lock type
 	TBool		iReadOnly;				//True if the file is read-only
 	TInt		iSectorSize;			//Media sector-size
 	TInt		iDeviceCharacteristics;
 	TSqlFreePageCallback iFreePageCallback;
+	TBool       iIsFileCreated;          //If the file to be created is a temp file, 
+                                       //it will not be created until the data is to be written to.
 #ifdef _SQLPROFILER
 	TBool		iIsJournal;
 #endif	
@@ -814,6 +829,8 @@
 	static int FileControl(sqlite3_file* aDbFile, int aOp, void* aArg);
 	static int SectorSize(sqlite3_file* aDbFile);
 	static int DeviceCharacteristics(sqlite3_file* aDbFile);
+private:
+	static TInt DoCreateTempFile(TDbFile& aDbFile);
 	};
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -842,12 +859,12 @@
 	static int Sleep(sqlite3_vfs* aVfs, int aMicrosec);
 	static int CurrentTime(sqlite3_vfs* aVfs, double* aNow);
 	static int GetLastError(sqlite3_vfs *sVfs, int aBufLen, char* aBuf);
+	static TInt DoGetDeviceCharacteristicsAndSectorSize(TDbFile& aDbFile, TInt& aRecReadBufSize);
 private:
 	static TInt DoOpenFromHandle(TDbFile& aDbFile, const RMessage2& aMsg, TBool aReadOnly);
 	static inline TInt DoGetVolumeIoParamInfo(RFs& aFs, TInt aDriveNo, TVolumeIOParamInfo& aVolumeInfo);
 	static TInt DoGetDeviceCharacteristics(const TDriveInfo& aDriveInfo, const TVolumeIOParamInfo& aVolumeInfo);
 	static TInt DoGetSectorSize(const TDriveInfo& aDriveInfo, const TVolumeIOParamInfo& aVolumeInfo);
-	static TInt DoGetDeviceCharacteristicsAndSectorSize(TDbFile& aDbFile, TInt& aRecReadBufSize);
 	static TInt DoFileSizeCorruptionCheck(TDbFile& aDbFile, const TDesC& aFname, TInt aFmode);
 	};
 
@@ -952,12 +969,14 @@
 */
 /* static */ TInt COsLayerData::Create()
 	{
-	__ASSERT_DEBUG(!COsLayerData::iOsLayerData, User::Panic(KPanicCategory, EPanicOsLayerDataExists));
+	SQLITE_TRACE_OS(OstTrace0(TRACE_INTERNALS, COSLAYERDATA_CREATE_ENTRY, "OS-Entry;0;COsLayerData::Create"));
+	__ASSERT_DEBUG(!COsLayerData::iOsLayerData, __SQLITEPANIC2(ESqliteOsPanicOsLayerDataExists));
 	if(!COsLayerData::iOsLayerData)
 		{
 		COsLayerData::iOsLayerData = new COsLayerData;
 		if(!COsLayerData::iOsLayerData)
 			{
+			SQLITE_TRACE_OS(OstTrace0(TRACE_INTERNALS, COSLAYERDATA_CREATE_EXIT1, "OS-Exit;0;COsLayerData::Create;err=KErrNoMemory"));
 			return KErrNoMemory;	
 			}
 		TInt err = COsLayerData::iOsLayerData->DoCreate();
@@ -965,9 +984,11 @@
 			{
 			delete COsLayerData::iOsLayerData;
 			COsLayerData::iOsLayerData = NULL;
+			SQLITE_TRACE_OS(OstTrace1(TRACE_INTERNALS, COSLAYERDATA_CREATE_EXIT2, "OS-Exit;0;COsLayerData::Create;err=%d", err));
 			return err;
 			}
 		}
+	SQLITE_TRACE_OS(OstTrace0(TRACE_INTERNALS, COSLAYERDATA_CREATE_EXIT3, "OS-Exit;0;COsLayerData::Create;err=KErrNone"));
 	return KErrNone;
 	}
 
@@ -978,6 +999,7 @@
 	{
 	delete COsLayerData::iOsLayerData;
 	COsLayerData::iOsLayerData = NULL;
+	SQLITE_TRACE_OS(OstTrace0(TRACE_INTERNALS, COSLAYERDATA_DESTROY, "OS;0;COsLayerData::Destroy"));
 	}
 
 /**
@@ -987,7 +1009,7 @@
 */
 /* static */ inline COsLayerData& COsLayerData::Instance()
 	{
-	__ASSERT_DEBUG(COsLayerData::iOsLayerData != NULL, User::Panic(KPanicCategory, EPanicNullOsLayerDataPtr));
+	__ASSERT_DEBUG(COsLayerData::iOsLayerData != NULL, __SQLITEPANIC2(ESqliteOsPanicNullOsLayerDataPtr));
 	return *COsLayerData::iOsLayerData;
 	}
 
@@ -1061,7 +1083,7 @@
 */
 inline void COsLayerData::RetrieveAndResetFhData(const RMessage2*& aMsg, TBool& aReadOnly)
 	{
-	__ASSERT_DEBUG(iMessage != NULL, User::Panic(KPanicCategory, EPanicInvalidFhData));
+	__ASSERT_DEBUG(iMessage != NULL, __SQLITEPANIC(ESqliteOsPanicInvalidFhData));
 	aMsg = iMessage; 
 	aReadOnly = iReadOnly;
 	iMessage = NULL;
@@ -1087,6 +1109,7 @@
 */
 inline COsLayerData::~COsLayerData()
 	{
+	SQLITE_TRACE_OS(OstTrace1(TRACE_INTERNALS, COSLAYERDATA_COSLAYERDATA2, "OS;0;COsLayerData::~COsLayerData;iFs.Handle()=0x%X", (TUint)iFs.Handle()));
 	__FS_CALL(EFsOpFsClose, 0);
 	iFs.Close();	
 	}
@@ -1136,6 +1159,14 @@
 	TParse parse;
 	(void)parse.Set(driveName, &privateDir, 0);//this call can't fail
 	iSysPrivDir.Copy(parse.DriveAndPath());
+	//Create the temp files directory
+	(void)parse.AddDir(KTempFileDir);//this call can't fail
+	err = iFs.MkDir(parse.DriveAndPath());
+    if(err != KErrNone && err != KErrAlreadyExists)
+    	{
+		return err;
+    	}
+	SQLITE_TRACE_OS(OstTraceExt3(TRACE_INTERNALS, COSLAYERDATA_DOCREATE, "OS;0;COsLayerData::DoCreate;iFs.Handle()=0x%X;sysDrive=%d;iSysPrivDir=%S", (TUint)iFs.Handle(), sysDrive, __SQLITEPRNSTR(iSysPrivDir)));
 	return KErrNone;
 	}
 
@@ -1185,6 +1216,7 @@
 		osErr = sqliteErr == SQLITE_NOMEM ? KErrNoMemory : KErrGeneral;
 		COsLayerData::Destroy();
 		}
+	SQLITE_TRACE_OS(OstTrace1(TRACE_INTERNALS, SQLITE3SYMBIANLIBINIT, "OS;0;sqlite3SymbianLibInit;osErr=%d", osErr));
 	return osErr;
 	}
 
@@ -1204,6 +1236,7 @@
 	{
 	(void)sqlite3_shutdown();
 	COsLayerData::Destroy();
+	SQLITE_TRACE_OS(OstTrace0(TRACE_INTERNALS, SQLITE3SYMBIANLIBFINALIZE, "OS;0;sqlite3SymbianLibFinalize"));
 	}
 
 /**
@@ -1240,7 +1273,7 @@
 		{
 		wchar_t* dest = reinterpret_cast <wchar_t*> (const_cast <TUint16*> (aFileNameDestBuf.Ptr()));
 		TInt len = mbstowcs(dest, aFileName, aFileNameDestBuf.MaxLength());
-		__ASSERT_DEBUG(len >= 0, User::Panic(KPanicCategory, EPanicInternalError));
+		__ASSERT_DEBUG(len >= 0, __SQLITEPANIC2(ESqliteOsPanicInternalError));
 		//If len == aFileNameDestBuf.MaxLength(), then the output buffer is too small.
 		if(len < aFileNameDestBuf.MaxLength())
 			{
@@ -1269,7 +1302,7 @@
 	char* dest = reinterpret_cast <char*> (const_cast <TUint8*> (aFileNameDestBuf.Ptr()));
 	const wchar_t* src = reinterpret_cast <const wchar_t*> (aFileName.Ptr());
 	TInt len = wcstombs(dest, src, aFileNameDestBuf.MaxLength());
-	__ASSERT_DEBUG(len >= 0, User::Panic(KPanicCategory, EPanicInternalError));
+	__ASSERT_DEBUG(len >= 0, __SQLITEPANIC2(ESqliteOsPanicInternalError));
 	//If len == aFileNameDestBuf.MaxLength(), then the output buffer is too small.
 	if(len < aFileNameDestBuf.MaxLength())
 		{
@@ -1411,7 +1444,7 @@
 static void FhExtractAndStore(TDes& aDbFileName)
 	{
 	TInt fhStartPos = aDbFileName.Locate(TChar(KFhSeparator));
-	__ASSERT_DEBUG(fhStartPos == KFhMarkPos, User::Panic(KPanicCategory, EPanicInvalidFhStr));
+	__ASSERT_DEBUG(fhStartPos == KFhMarkPos, __SQLITEPANIC2(ESqliteOsPanicInvalidFhStr));
 	//If this file name string contains file handles
 	if(fhStartPos == KFhMarkPos)
 		{
@@ -1419,12 +1452,12 @@
 		TLex lex(aDbFileName.Mid(fhStartPos + KFhMsgAddrPos, KFhMsgAddrLen));
 		TUint32 addr;
 		TInt err = lex.Val(addr, EHex);
-		__ASSERT_DEBUG(err == KErrNone, User::Panic(KPanicCategory, EPanicInvalidFhStr));
+		__ASSERT_DEBUG(err == KErrNone, __SQLITEPANIC2(ESqliteOsPanicInvalidFhStr));
 		if(err == KErrNone)
 			{
 			//Cast the address to RMessage2 pointer.
 			const RMessage2* msg = reinterpret_cast <const RMessage2*> (addr);
-			__ASSERT_DEBUG(msg != NULL, User::Panic(KPanicCategory, EPanicInvalidFhStr));
+			__ASSERT_DEBUG(msg != NULL, __SQLITEPANIC2(ESqliteOsPanicInvalidFhStr));
 			if(msg)
 				{
 				//Store the data from aDbFileName in the single COsLayerData instance.
@@ -1446,16 +1479,17 @@
 */
 inline TDbFile::TDbFile() :
 	iFileBuf(KFileBufSize),
-	iFullName(0),
 	iLockType(SQLITE_LOCK_NONE),
 	iReadOnly(EFalse),
 	iSectorSize(0),
-	iDeviceCharacteristics(-1)
+	iDeviceCharacteristics(-1),
+	iIsFileCreated(ETrue)
 	{
 #ifdef _SQLPROFILER
 	iIsJournal = EFalse;
 #endif
 	pMethods = 0;
+	SQLITE_TRACE_OS(OstTrace1(TRACE_INTERNALS, TDBFILE_TDBFILE, "OS;0x%X;TDbFile::TDbFile", (TUint)this));
 	}
 
 /**
@@ -1476,7 +1510,7 @@
 */
 static inline TDbFile& DbFile(sqlite3_file* aDbFile)
 	{
-	__ASSERT_DEBUG(aDbFile != 0, User::Panic(KPanicCategory, EPanicNullDbFilePtr));
+	__ASSERT_DEBUG(aDbFile != 0, __SQLITEPANIC2(ESqliteOsPanicNullDbFilePtr));
 	return *(static_cast <TDbFile*> (aDbFile));
 	}
 
@@ -1488,7 +1522,6 @@
 SQLite OS porting layer API.
 
 Closes the file referred by aDbFile parameter.
-If aDbFile.iFullName data member is not NULL, then the file will be deleted.
 
 @param aDbFile A pointer to a TDbFile instance, than contains the file handle to be closed.
 
@@ -1498,19 +1531,12 @@
 */
 /* static */ int TFileIo::Close(sqlite3_file* aDbFile)
 	{
-	SQLUTRACE_PROFILER(aDbFile);
 	TDbFile& dbFile = ::DbFile(aDbFile);
+	SQLITE_TRACE_OS(OstTrace1(TRACE_INTERNALS, TFILEIO_CLOSE1, "OS;0x%X;TFileIo::Close", (TUint)&dbFile));
 	__OS_CALL(EOsFileClose, 0, 0);
 	__OSTIME_COUNTER(TheOsCallTicks[EOsFileClose], ::OsCallProfile(dbFile.iIsJournal, EOsFileClose), 0, 0, aDbFile, 0);
 	__FS_CALL(EFsOpFileClose, 0);
 	dbFile.iFileBuf.Close();
-	if(dbFile.iFullName)
-		{//"iFullName" will not be NULL only when TVfs::Open() is called with SQLITE_OPEN_DELETEONCLOSE flag.
-		 //That means - SQlite expects the file to be deleted after the file close operation. 
-		__FS_CALL(EFsOpFileDelete, 0);
-		(void)COsLayerData::Instance().iFs.Delete(*dbFile.iFullName);
-		delete dbFile.iFullName;
-		}
 	return SQLITE_OK;
 	}
 
@@ -1538,41 +1564,63 @@
 */
 /* static */ int TFileIo::Read(sqlite3_file* aDbFile, void* aBuf, int aAmt, sqlite3_int64 aOffset)
 	{
-	SQLUTRACE_PROFILER(aDbFile);
-	SYMBIAN_TRACE_SQL_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KFileRead, aAmt, aOffset));
 	TDbFile& dbFile = ::DbFile(aDbFile);
+	SQLITE_TRACE_OS(OstTraceExt3(TRACE_INTERNALS, TFILEIO_READ_ENTRY, "OS-Entry;0x%X;TFileIo::Read;aAmt=%d;aOffset=%lld", (TUint)&dbFile, aAmt, aOffset));
 	__OS_CALL(EOsFileRead, 0, 0);
 	__COUNTER_INCR(TheSqlSrvProfilerFileRead);
 	__OSTIME_COUNTER(TheOsCallTicks[EOsFileRead], ::OsCallProfile(dbFile.iIsJournal, EOsFileRead), aOffset, aAmt, aDbFile, 0);
 	TPtr8 ptr((TUint8*)aBuf, 0, aAmt);
 	TInt err = dbFile.iFileBuf.Read(aOffset, ptr);
 	TInt cnt = ptr.Length();
-	TInt sqliteErr = SQLITE_IOERR_READ;
-	switch(err)
+	TInt sqliteErr = ::Os2SqliteErr(err, SQLITE_IOERR_READ);
+	if(cnt != aAmt && (sqliteErr == SQLITE_OK || sqliteErr == SQLITE_IOERR_SHORT_READ))
 		{
-		case KErrNone:
-			sqliteErr = SQLITE_OK;	
-			if(cnt != aAmt)
-				{
-				Mem::FillZ(static_cast <TUint8*> (aBuf) + cnt, aAmt - cnt);
-				sqliteErr = SQLITE_IOERR_SHORT_READ;
-				err = KErrEof;
-				}
-			break;
-		case KErrEof:
-			Mem::FillZ(static_cast <TUint8*> (aBuf) + cnt, aAmt - cnt);
-			sqliteErr = SQLITE_IOERR_SHORT_READ;
-			break;
-		case KErrNoMemory:
-			sqliteErr = SQLITE_IOERR_NOMEM;
-			break;
-		default:
-			break;
+		Mem::FillZ(static_cast <TUint8*> (aBuf) + cnt, aAmt - cnt);
+		err = KErrEof;
+		sqliteErr = SQLITE_IOERR_SHORT_READ;
 		}
 	COsLayerData::Instance().SetOsErrorCode(err);
+	SQLITE_TRACE_OS(OstTraceExt4(TRACE_INTERNALS, TFILEIO_READ_EXIT, "OS-Exit;0x%X;TFileIo::Read;cnt=%d;err=%d;sqliteErr=%d", (TUint)&dbFile, cnt, err, sqliteErr));
 	return sqliteErr;
 	}
 
+//Creates a temporary file in "\temp" subdirectory of osLayerData.iSysPrivDir directory.
+//If the function fails, the temp file will be closed and deleted, 
+//the related Symbian OS error will be returned to the caller.
+/* static */TInt TFileIo::DoCreateTempFile(TDbFile& aDbFile)
+    {
+    COsLayerData& osLayerData = COsLayerData::Instance();
+    //TParse2 is used in order to avoid the need of another TFileName stack based variable
+	class TParse2 : public TParse
+		{
+	public:
+		inline TFileName& FileName()
+			{
+			return static_cast <TFileName&> (NameBuf());
+			}
+		};
+	TParse2 parse;
+	(void)parse.Set(osLayerData.iSysPrivDir, 0, 0);//this call can't fail
+	(void)parse.AddDir(KTempFileDir);//this call can't fail
+    __FS_CALL(EFsOpFileCreateTemp, 0);
+    TInt err = aDbFile.iFileBuf.Temp(osLayerData.iFs, parse.FullName(), parse.FileName(), EFileRead|EFileWrite|EDeleteOnClose);        
+    if(err == KErrNone)
+        {
+        TInt recReadBufSize = -1;
+        err = TVfs::DoGetDeviceCharacteristicsAndSectorSize(aDbFile, recReadBufSize);
+        if(err != KErrNone)
+            {
+            aDbFile.iFileBuf.Close();//With EDeleteOnClose flag set, the file will be deleted
+            }
+        else
+            {
+            (void)aDbFile.iFileBuf.SetReadAheadSize(aDbFile.iSectorSize, recReadBufSize);
+            aDbFile.iIsFileCreated = ETrue;
+            }
+        }
+    return err;
+    }
+
 /**
 SQLite OS porting layer API.
 
@@ -1583,6 +1631,8 @@
 (TDbFile::iFreePageCallback) and the free pages count is above the defined value,
 then the callback will be called.
 
+If the file to be written to is a temp file, which is not created yet, then the file will be created.
+
 @param aDbFile A pointer to a TDbFile instance, that contains the file handle to be written to.
 @param aData The data to be written to the file. The buffer size must be at least aAmt bytes.
 @param aAmt The amount of data to be written to the file.
@@ -1601,13 +1651,22 @@
 */
 /* static */ int TFileIo::Write(sqlite3_file* aDbFile, const void* aData, int aAmt, sqlite3_int64 aOffset)
 	{
-	SQLUTRACE_PROFILER(aDbFile);
-	SYMBIAN_TRACE_SQL_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KFileWrite, aAmt, aOffset));
 	TDbFile& dbFile = ::DbFile(aDbFile);
+	SQLITE_TRACE_OS(OstTraceExt3(TRACE_INTERNALS, TFILEIO_WRITE_ENTRY, "OS-Entry;0x%X;TFileIo::Write;aAmt=%d;aOffset=%lld", (TUint)&dbFile, aAmt, aOffset));
 	__OS_CALL(EOsFileWrite, 0, 0);
     __COUNTER_INCR(TheSqlSrvProfilerFileWrite);
 	__OSTIME_COUNTER(TheOsCallTicks[EOsFileWrite], ::OsCallProfile(dbFile.iIsJournal, EOsFileWrite), aOffset, aAmt, aDbFile, 0);
-	TInt err = KErrAccessDenied;
+	TInt err = KErrNone;
+	if(!dbFile.iIsFileCreated)
+	    {//Create a temp file if it has not been created. 
+	    err = TFileIo::DoCreateTempFile(dbFile);
+	    }
+	if(err != KErrNone)
+	    {
+        COsLayerData::Instance().SetOsErrorCode(err);
+		return ::Os2SqliteErr(err, SQLITE_FULL);
+	    }
+	err = KErrAccessDenied;
 	if(!dbFile.iReadOnly)
 		{
 		TPtrC8 ptr((const TUint8*)aData, aAmt);
@@ -1630,7 +1689,9 @@
 		dbFile.iFreePageCallback.CheckAndCallback(freePageCount);
 		}
 		
-	return err == KErrNone ? SQLITE_OK : (err == KErrNoMemory ? SQLITE_IOERR_NOMEM : SQLITE_FULL);
+	TInt sqliteErr = ::Os2SqliteErr(err, SQLITE_FULL);
+	SQLITE_TRACE_OS(OstTraceExt3(TRACE_INTERNALS, TFILEIO_WRITE_EXIT, "OS-Exit;0x%X;TFileIo::Write;err=%d;sqliteErr=%d", (TUint)&dbFile, err, sqliteErr));
+	return sqliteErr;
 	}
 
 /**
@@ -1655,9 +1716,8 @@
 */
 /* static */ int TFileIo::Truncate(sqlite3_file* aDbFile, sqlite3_int64 aLength)
 	{
-	SQLUTRACE_PROFILER(aDbFile);
-	SYMBIAN_TRACE_SQL_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KFileTruncate, aLength));
 	TDbFile& dbFile = ::DbFile(aDbFile);
+	SQLITE_TRACE_OS(OstTraceExt2(TRACE_INTERNALS, TFILEIO_TRUNCATE_ENTRY, "OS-Entry;0x%X;TFileIo::Truncate;aLength=%lld", (TUint)&dbFile, aLength));
 	__OS_CALL(EOsFileTruncate, 0, 0);
     __COUNTER_INCR(TheSqlSrvProfilerFileSetSize);
 	__OSTIME_COUNTER(TheOsCallTicks[EOsFileTruncate], ::OsCallProfile(dbFile.iIsJournal, EOsFileTruncate), aLength, 0, aDbFile, 0);
@@ -1669,7 +1729,9 @@
 	__FS_CALL(EFsOpFileSetSize, 0);
 	TInt err = dbFile.iFileBuf.SetSize(aLength);
 	COsLayerData::Instance().SetOsErrorCode(err);
-	return err == KErrNone ? SQLITE_OK : (err == KErrNoMemory ? SQLITE_IOERR_NOMEM : SQLITE_IOERR);
+	TInt sqliteErr = ::Os2SqliteErr(err, SQLITE_IOERR);
+	SQLITE_TRACE_OS(OstTraceExt3(TRACE_INTERNALS, TFILEIO_TRUNCATE_EXIT, "OS-Exit;0x%X;TFileIo::Truncate;err=%d;sqliteErr=%d", (TUint)&dbFile, err, sqliteErr));
+	return sqliteErr;
 	}
 
 /**
@@ -1692,8 +1754,8 @@
 */
 /* static */int TFileIo::Sync(sqlite3_file* aDbFile, int /* aFlags */)
 	{
-	SQLUTRACE_PROFILER(aDbFile);
 	TDbFile& dbFile = ::DbFile(aDbFile);
+	SQLITE_TRACE_OS(OstTrace1(TRACE_INTERNALS, TFILEIO_SYNC_ENTRY, "OS-Entry;0x%X;TFileIo::Sync", (TUint)&dbFile));
 	__OS_CALL(EOsFileSync, 0, 0);
     __COUNTER_INCR(TheSqlSrvProfilerFileSync);
 	__OSTIME_COUNTER(TheOsCallTicks[EOsFileSync], ::OsCallProfile(dbFile.iIsJournal, EOsFileSync), 0, 0, aDbFile, 0);
@@ -1705,7 +1767,9 @@
 	__FS_CALL(EFsOpFileSync, 0);
 	TInt err = dbFile.iFileBuf.Flush();
 	COsLayerData::Instance().SetOsErrorCode(err);
-	return err == KErrNone ? SQLITE_OK : (err == KErrNoMemory ? SQLITE_IOERR_NOMEM : SQLITE_IOERR);
+	TInt sqliteErr = ::Os2SqliteErr(err, SQLITE_IOERR);
+	SQLITE_TRACE_OS(OstTraceExt3(TRACE_INTERNALS, TFILEIO_SYNC_EXIT, "OS-Exit;0x%X;TFileIo::Sync;err=%d;sqliteErr=%d", (TUint)&dbFile, err, sqliteErr));
+	return sqliteErr;
 	}
 
 /**
@@ -1728,18 +1792,16 @@
 */
 /* static */ int TFileIo::FileSize(sqlite3_file* aDbFile, sqlite3_int64* aSize)
 	{
-	SQLUTRACE_PROFILER(aDbFile);
 	TDbFile& dbFile = ::DbFile(aDbFile);
+	SQLITE_TRACE_OS(OstTrace1(TRACE_INTERNALS, TFILEIO_FILESIZE_ENTRY, "OS-Entry;0x%X;TFileIo::FileSize", (TUint)&dbFile));
 	__OS_CALL(EOsFileFileSize, 0, 0);
 	__OSTIME_COUNTER(TheOsCallTicks[EOsFileFileSize], ::OsCallProfile(dbFile.iIsJournal, EOsFileFileSize), 0, 0, aDbFile, 0);
 	__FS_CALL(EFsOpFileSize, 0);
 	TInt err =  dbFile.iFileBuf.Size(*aSize);
 	COsLayerData::Instance().SetOsErrorCode(err);
-	if(err == KErrNone)
-		{
-		return SQLITE_OK;
-		}
-	return err == KErrNoMemory ? SQLITE_IOERR_NOMEM : SQLITE_IOERR;
+	TInt sqliteErr = ::Os2SqliteErr(err, SQLITE_IOERR);
+	SQLITE_TRACE_OS(OstTraceExt3(TRACE_INTERNALS, TFILEIO_FILESIZE_EXIT, "OS-Exit;0x%X;TFileIo::FileSize;err=%d;sqliteErr=%d", (TUint)&dbFile, err, sqliteErr));
+	return sqliteErr;
 	}
 
 /**
@@ -1762,7 +1824,6 @@
 */
 /* static */ int TFileIo::Lock(sqlite3_file* aDbFile, int aLockType)
 	{
-	SQLUTRACE_PROFILER(aDbFile);
 	TDbFile& dbFile = ::DbFile(aDbFile);
 	__OS_CALL(EOsFileLock, 0, 0);
 	__OSTIME_COUNTER(TheOsCallTicks[EOsFileLock], ::OsCallProfile(dbFile.iIsJournal, EOsFileLock), aLockType, 0, aDbFile, 0);
@@ -1795,7 +1856,6 @@
 */
 /* static */ int TFileIo::Unlock(sqlite3_file* aDbFile, int aLockType)
 	{
-	SQLUTRACE_PROFILER(aDbFile);
 	TDbFile& dbFile = ::DbFile(aDbFile);
 	__OS_CALL(EOsFileUnlock, 0, 0);
 	__OSTIME_COUNTER(TheOsCallTicks[EOsFileUnlock], ::OsCallProfile(dbFile.iIsJournal, EOsFileUnlock), aLockType, 0, aDbFile, 0);
@@ -1824,7 +1884,6 @@
 */
 /* static */ int TFileIo::CheckReservedLock(sqlite3_file* aDbFile, int *aResOut)
 	{
-	SQLUTRACE_PROFILER(aDbFile);
 	TDbFile& dbFile = ::DbFile(aDbFile);
 	__OS_CALL(EOsFileCheckReservedLock, 0, 0);
 	__OSTIME_COUNTER(TheOsCallTicks[EOsFileCheckReservedLock], ::OsCallProfile(dbFile.iIsJournal, EOsFileCheckReservedLock), 0, 0, aDbFile, 0);
@@ -1859,9 +1918,8 @@
 */
 /* static */ int TFileIo::FileControl(sqlite3_file* aDbFile, int aOp, void* aArg)
 	{
-	SQLUTRACE_PROFILER(aDbFile);
-	SYMBIAN_TRACE_SQL_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KFileFileCtr, aOp));
 	TDbFile& dbFile = ::DbFile(aDbFile);
+	SQLITE_TRACE_OS(OstTraceExt2(TRACE_INTERNALS, TFILEIO_FILECONTROL_ENTRY, "OS-Entry;0x%X;TFileIo::FileControl;aOp=%d", (TUint)&dbFile, aOp));
 	__OS_CALL(EOsFileFileControl, 0, 0);
 	__OSTIME_COUNTER(TheOsCallTicks[EOsFileFileControl], ::OsCallProfile(dbFile.iIsJournal, EOsFileFileControl), aOp, 0, aDbFile, 0);
 	TInt err = KErrNone;
@@ -1889,7 +1947,9 @@
 			break;
 		}
 	COsLayerData::Instance().SetOsErrorCode(err);
-	return err == KErrNone ? SQLITE_OK : SQLITE_ERROR;
+	TInt sqliteErr = ::Os2SqliteErr(err, SQLITE_ERROR);
+	SQLITE_TRACE_OS(OstTraceExt3(TRACE_INTERNALS, TFILEIO_FILECONTROL_EXIT, "OS-Exit;0x%X;TFileIo::FileControl;err=%d;sqliteErr=%d", (TUint)&dbFile, err, sqliteErr));
+	return sqliteErr;
 	}
 
 /**
@@ -1911,11 +1971,10 @@
 */
 /* static */ int TFileIo::SectorSize(sqlite3_file* aDbFile)
 	{
-	SQLUTRACE_PROFILER(aDbFile);
 	TDbFile& dbFile = ::DbFile(aDbFile);
 	__OS_CALL(EOsFileSectorSize, 0, 0);
 	__OSTIME_COUNTER(TheOsCallTicks[EOsFileSectorSize], ::OsCallProfile(dbFile.iIsJournal, EOsFileSectorSize), 0, 0, aDbFile, 0);
-	__ASSERT_DEBUG(dbFile.iSectorSize > 0, User::Panic(KPanicCategory, EPanicInternalError));
+	__ASSERT_DEBUG(dbFile.iSectorSize > 0, __SQLITEPANIC2(ESqliteOsPanicInternalError));
 	if(dbFile.iSectorSize > 0)
 		{
 		return dbFile.iSectorSize;	
@@ -1942,11 +2001,10 @@
 */
 /* static */ int TFileIo::DeviceCharacteristics(sqlite3_file* aDbFile)
 	{
-	SQLUTRACE_PROFILER(aDbFile);
 	TDbFile& dbFile = ::DbFile(aDbFile);
 	__OS_CALL(EOsFileDeviceCharacteristics, 0, 0);
 	__OSTIME_COUNTER(TheOsCallTicks[EOsFileDeviceCharacteristics], ::OsCallProfile(dbFile.iIsJournal, EOsFileDeviceCharacteristics), 0, 0, aDbFile, 0);
-	__ASSERT_DEBUG(dbFile.iDeviceCharacteristics >= 0, User::Panic(KPanicCategory, EPanicInternalError));
+	__ASSERT_DEBUG(dbFile.iDeviceCharacteristics >= 0, __SQLITEPANIC2(ESqliteOsPanicInternalError));
 	if(dbFile.iDeviceCharacteristics >= 0)
 		{
 		return dbFile.iDeviceCharacteristics;	
@@ -2003,7 +2061,9 @@
 /* static */ inline TInt TVfs::DoGetVolumeIoParamInfo(RFs& aFs, TInt aDriveNo, TVolumeIOParamInfo& aVolumeInfo)
 	{
 	__FS_CALL(EFsOpFsVolumeIoParam, 0);
-	return aFs.VolumeIOParam(aDriveNo, aVolumeInfo);
+	TInt err = aFs.VolumeIOParam(aDriveNo, aVolumeInfo); 
+	SQLITE_TRACE_OS(OstTraceExt2(TRACE_INTERNALS, TVFS_DOGETVOLUMEIOPARAMINFO, "OS;0;TVfs::DoGetVolumeIoParamInfo;aDriveNo=%d;err=%d", aDriveNo, err));
+	return err;		
 	}
 
 /**
@@ -2091,7 +2151,7 @@
 			sectorSize = aVolumeInfo.iBlockSize;
 			}
 		}
-	__ASSERT_DEBUG(sectorSize > 0 && (sectorSize & (sectorSize - 1)) == 0, User::Panic(KPanicCategory, EPanicInternalError));
+	__ASSERT_DEBUG(sectorSize > 0 && (sectorSize & (sectorSize - 1)) == 0, __SQLITEPANIC2(ESqliteOsPanicInternalError));
 	return sectorSize;
 	}
 
@@ -2120,8 +2180,8 @@
 */
 /* static */ TInt TVfs::DoGetDeviceCharacteristicsAndSectorSize(TDbFile& aDbFile, TInt& aRecReadBufSize)
 	{
-	__ASSERT_DEBUG(aDbFile.iDeviceCharacteristics < 0, User::Panic(KPanicCategory, EPanicInternalError));
-	__ASSERT_DEBUG(aDbFile.iSectorSize <= 0, User::Panic(KPanicCategory, EPanicInternalError));
+	__ASSERT_DEBUG(aDbFile.iDeviceCharacteristics < 0, __SQLITEPANIC2(ESqliteOsPanicInternalError));
+	__ASSERT_DEBUG(aDbFile.iSectorSize <= 0, __SQLITEPANIC2(ESqliteOsPanicInternalError));
 	TInt driveNo;
 	TDriveInfo driveInfo;
 	__FS_CALL(EFsOpFileDrive, 0);
@@ -2139,6 +2199,7 @@
 	aDbFile.iDeviceCharacteristics = TVfs::DoGetDeviceCharacteristics(driveInfo, volumeInfo);
 	aDbFile.iSectorSize = TVfs::DoGetSectorSize(driveInfo, volumeInfo);
 	aRecReadBufSize = volumeInfo.iRecReadBufSize;
+	SQLITE_TRACE_OS(OstTraceExt5(TRACE_INTERNALS, TVFS_DOGETGETDEVICECHARACTERISTICSANDSECTORSIZE, "OS;0x%X;TVfs::DoGetDeviceCharacteristicsAndSectorSize;driveNo=%d;sectorSize=%d;devCharact=0x%X;readBufSize=%d", (TUint)&aDbFile, driveNo, aDbFile.iSectorSize, (TUint)aDbFile.iDeviceCharacteristics, volumeInfo.iRecReadBufSize));
 	return KErrNone;
 	}
 
@@ -2194,8 +2255,10 @@
         COsLayerData& osLayerData = COsLayerData::Instance();
     
         aDbFile.iFileBuf.Close();
-        (void) osLayerData.iFs.Delete(aFname);
+        __SQLITETRACE_OSEXPR(TInt err2 =) osLayerData.iFs.Delete(aFname);
+		SQLITE_TRACE_OS(OstTraceExt4(TRACE_INTERNALS, TVFS_DOFILESIZECORRUPTIONCHECK1, "OS;0x%X;TVfs::DoFileSizeCorruptionCheck;size=%lld;err=%d;deleteErr=%d", (TUint)&aDbFile, size, err, err2));
         err = aDbFile.iFileBuf.Create(osLayerData.iFs, aFname, aFmode);
+		SQLITE_TRACE_OS(OstTraceExt2(TRACE_INTERNALS, TVFS_DOFILESIZECORRUPTIONCHECK2, "OS;0x%X;TVfs::DoFileSizeCorruptionCheck;createErr=%d", (TUint)&aDbFile, err));
         }
     return err;
     }
@@ -2234,30 +2297,32 @@
 */
 /* static */ int TVfs::Open(sqlite3_vfs* aVfs, const char* aFileName, sqlite3_file* aDbFile, int aFlags, int* aOutFlags)
 	{
-	SQLUTRACE_PROFILER(aVfs);
 	__OS_CALL(EOsVfsOpen, 0, 0);
 	__OSTIME_COUNTER(TheOsCallTicks[EOsVfsOpen], ::OsCallProfile(EFalse, EOsVfsOpen), 0, 0, aDbFile, aFileName);
 	COsLayerData& osLayerData = COsLayerData::Instance();
-	TFileName fname;
-	if(aFileName && !::ConvertToUnicode(aFileName, fname))
-		{
-		osLayerData.SetOsErrorCode(KErrBadName);
-		return SQLITE_CANTOPEN;	
-		}
-	SYMBIAN_TRACE_SQL_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KFileOpen, aDbFile, &fname));
 	new (aDbFile) TDbFile;
 	TDbFile& dbFile = ::DbFile(aDbFile);
-	TFhStrType fhStrType = aFileName ? ::FhStringProps(aFileName) : ENotFhStr;
-	if(aFileName && (aFlags & SQLITE_OPEN_DELETEONCLOSE))
+    if(!aFileName)
+        {  
+        //It is to create and open a temp file if aFileName is NULL. In this case,
+        //we will defer the file creation util it is needed.  
+        dbFile.pMethods = &TheFileIoApi;
+        dbFile.iIsFileCreated = EFalse;
+        if(aOutFlags)
+            {
+            *aOutFlags = SQLITE_OPEN_READWRITE;
+            }
+		osLayerData.SetOsErrorCode(KErrNone);
+        return SQLITE_OK;
+        }  
+	TFileName fname;
+    if(!::ConvertToUnicode(aFileName, fname))
 		{
-		dbFile.iFullName = fname.Alloc();
-		if(!dbFile.iFullName)
-			{
-			osLayerData.SetOsErrorCode(KErrNoMemory);
-			return SQLITE_IOERR_NOMEM;
-			}
-		}
-	TInt recReadBufSize = -1;
+        osLayerData.SetOsErrorCode(KErrBadName);
+        return SQLITE_CANTOPEN;	
+    	}
+	SQLITE_TRACE_OS(OstTraceExt3(TRACE_INTERNALS, TVFS_OPEN_ENTRY, "OS-Entry;0x%X;TVfs::Open;fname=%S;aFlags=0x%X", (TUint)&aDbFile, __SQLITEPRNSTR(fname), (TUint)aFlags));
+	TFhStrType fhStrType = aFileName ? ::FhStringProps(aFileName) : ENotFhStr;
 	TInt err = KErrNone;
 	if(fhStrType == EFhMainDbStr)
 		{//Main db file, open from handle
@@ -2281,52 +2346,41 @@
 			{
 			fmode |= EFileShareExclusive;
 			}
-		if(!aFileName)	
+		if(aFlags & SQLITE_OPEN_DELETEONCLOSE)
+			{
+			fmode |= EDeleteOnClose;
+			}
+		err = KErrAccessDenied;
+		TInt prevErr = KErrNone;
+		if(aFlags & SQLITE_OPEN_CREATE)
 			{
-			__FS_CALL(EFsOpFileCreateTemp, 0);
-			err = dbFile.iFileBuf.Temp(osLayerData.iFs, osLayerData.iSysPrivDir, fname, fmode);
-			if(err == KErrNone)
+			__FS_CALL(EFsOpFileCreate, 0);
+			prevErr = err = dbFile.iFileBuf.Create(osLayerData.iFs, fname, fmode);
+			}
+		if(err != KErrNone && err != KErrNoMemory && err != KErrDiskFull)
+			{
+			__FS_CALL(EFsOpFileOpen, 0);
+			err = dbFile.iFileBuf.Open(osLayerData.iFs, fname, fmode);
+
+			if(err == KErrNone && (aFlags & KJournalFileTypeBitMask))
 				{
-				dbFile.iFullName = fname.Alloc();
-				if(!dbFile.iFullName)
-					{
-					err = KErrNoMemory;	
-					}
+				err = TVfs::DoFileSizeCorruptionCheck(dbFile, fname, fmode);
 				}
 			}
-		else
+		if((err != KErrNone && err != KErrNoMemory && err != KErrDiskFull) && (aFlags & SQLITE_OPEN_READWRITE))
+			{
+			aFlags &= ~SQLITE_OPEN_READWRITE;
+			aFlags |= SQLITE_OPEN_READONLY;
+			fmode &= ~EFileWrite;
+			__FS_CALL(EFsOpFileOpen, 0);
+			err = dbFile.iFileBuf.Open(osLayerData.iFs, fname, fmode);
+			}
+		if(err != KErrNone && prevErr == KErrAccessDenied)
 			{
 			err = KErrAccessDenied;
-			TInt prevErr = KErrNone;
-			if(aFlags & SQLITE_OPEN_CREATE)
-				{
-				__FS_CALL(EFsOpFileCreate, 0);
-				prevErr = err = dbFile.iFileBuf.Create(osLayerData.iFs, fname, fmode);
-				}
-			if(err != KErrNone && err != KErrNoMemory && err != KErrDiskFull)
-				{
-				__FS_CALL(EFsOpFileOpen, 0);
-				err = dbFile.iFileBuf.Open(osLayerData.iFs, fname, fmode);
-				
-				if(err == KErrNone && (aFlags & KJournalFileTypeBitMask))
-				    {
-                    err = TVfs::DoFileSizeCorruptionCheck(dbFile, fname, fmode);
-				    }
-				}
-			if((err != KErrNone && err != KErrNoMemory && err != KErrDiskFull) && (aFlags & SQLITE_OPEN_READWRITE))
-				{
-				aFlags &= ~SQLITE_OPEN_READWRITE;
-				aFlags |= SQLITE_OPEN_READONLY;
-				fmode &= ~EFileWrite;
-				__FS_CALL(EFsOpFileOpen, 0);
-   				err = dbFile.iFileBuf.Open(osLayerData.iFs, fname, fmode);
-				}
-			if(err != KErrNone && prevErr == KErrAccessDenied)
-				{
-				err = KErrAccessDenied;
-				}
 			}
 		}
+	TInt recReadBufSize = -1;
 	if(err == KErrNone)
 		{
 		err = TVfs::DoGetDeviceCharacteristicsAndSectorSize(dbFile, recReadBufSize);
@@ -2336,13 +2390,6 @@
 		{
 		__FS_CALL(EFsOpFileClose, 0);
 		dbFile.iFileBuf.Close();	
-		delete dbFile.iFullName;
-		dbFile.iFullName = NULL;
-        if(!aFileName && fname.Length() > 0)
-            {//temporary file, the error is not KErrNone. Then delete the file (after a successfull 
-             //temporary file creation there could be a failed memory allocation)
-            (void)osLayerData.iFs.Delete(fname);
-            }
 		}
 	else
 		{
@@ -2360,7 +2407,9 @@
 #ifdef _SQLPROFILER
 	dbFile.iIsJournal = aFlags & KJournalFileTypeBitMask; 
 #endif
-	return err == KErrNone ? SQLITE_OK : (err == KErrNoMemory ? SQLITE_IOERR_NOMEM : SQLITE_CANTOPEN);
+	TInt sqliteErr = ::Os2SqliteErr(err, SQLITE_CANTOPEN);
+	SQLITE_TRACE_OS(OstTraceExt4(TRACE_INTERNALS, TVFS_OPEN_EXIT, "OS-Exit;0x%X;TVfs::Open;outFlags=0x%X;err=%d;sqliteErr=%d", (TUint)&aDbFile, aOutFlags ? (TUint)*aOutFlags : 0, err, sqliteErr));
+	return sqliteErr;
 	}
 
 /**
@@ -2383,7 +2432,6 @@
 */
 /* static */ int TVfs::Delete(sqlite3_vfs* aVfs, const char* aFileName, int /*aSyncDir*/)
 	{
-	SQLUTRACE_PROFILER(aVfs);
 	__OS_CALL(EOsVfsDelete, 0, 0);
 	__OSTIME_COUNTER(TheOsCallTicks[EOsVfsDelete], ::OsCallProfile(EFalse, EOsVfsDelete), 0, 0, 0, aFileName);
 	COsLayerData& osLayerData = COsLayerData::Instance();
@@ -2391,13 +2439,15 @@
 	if(!::ConvertToUnicode(aFileName, fname))
 		{
 		osLayerData.SetOsErrorCode(KErrBadName);
+		SQLITE_TRACE_OS(OstTrace0(TRACE_INTERNALS, TVFS_DELETE1, "OS;0;TVfs::Delete;err=KErrBadName"));
 		return SQLITE_ERROR;	
 		}
-	SYMBIAN_TRACE_SQL_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KFileName, &fname));
+	SQLITE_TRACE_OS(OstTraceExt1(TRACE_INTERNALS, TVFS_DELETE_ENTRY, "OS-Entry;0;TVfs::Delete;fname=%S", __SQLITEPRNSTR(fname)));
 	TFhStrType fhStrType = FhStringProps(aFileName);
 	if(fhStrType == EFhMainDbStr)
 		{//Deleting files not in your own private data cage - not allowed!
 		osLayerData.SetOsErrorCode(KErrPermissionDenied);
+		SQLITE_TRACE_OS(OstTraceExt1(TRACE_INTERNALS, TVFS_DELETE2, "OS;0;TVfs::Delete;err=KErrPermissionDenied;fname=%S", __SQLITEPRNSTR(fname)));
 		return SQLITE_ERROR;	
 		}
 	if(fhStrType == EFhStr)
@@ -2407,7 +2457,9 @@
 	__FS_CALL(EFsOpFileDelete, 0);
 	TInt err = osLayerData.iFs.Delete(fname);
 	osLayerData.SetOsErrorCode(err);
-	return err == KErrNone ? SQLITE_OK : (err == KErrNoMemory ? SQLITE_IOERR_NOMEM : SQLITE_IOERR_DELETE);
+	TInt sqliteErr = ::Os2SqliteErr(err, SQLITE_IOERR_DELETE);	
+	SQLITE_TRACE_OS(OstTraceExt2(TRACE_INTERNALS, TVFS_DELETE_EXIT, "OS-Exit;0;TVfs::Delete;err=%d;sqliteErr=%d", err, sqliteErr));
+	return sqliteErr;
 	}
 
 /**
@@ -2431,7 +2483,6 @@
 */
 /* static */ int TVfs::Access(sqlite3_vfs* aVfs, const char* aFileName, int aFlags, int* aResOut)
 	{
-	SQLUTRACE_PROFILER(aVfs);
 	__OS_CALL(EOsVfsAccess, 0, 0);
 	__OSTIME_COUNTER(TheOsCallTicks[EOsVfsAccess], ::OsCallProfile(EFalse, EOsVfsAccess), aFlags, 0, 0, aFileName);
 	COsLayerData& osLayerData = COsLayerData::Instance();
@@ -2439,9 +2490,10 @@
 	if(!::ConvertToUnicode(aFileName, fname))
 		{
 		osLayerData.SetOsErrorCode(KErrGeneral);
+		SQLITE_TRACE_OS(OstTrace0(TRACE_INTERNALS, TVFS_ACCESS1, "OS;0;TVfs::Access;err=KErrGeneral"));
 		return SQLITE_IOERR_ACCESS;
 		}
-	SYMBIAN_TRACE_SQL_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KFileName, &fname));
+	SQLITE_TRACE_OS(OstTraceExt2(TRACE_INTERNALS, TVFS_ACCESS_ENTRY, "OS-Entry;0;TVfs::Access;fname=%S;aFlags=0x%X", __SQLITEPRNSTR(fname), (TUint)aFlags));
 	TFhStrType fhStrType = ::FhStringProps(aFileName);
 	if(fhStrType == EFhStr)
 		{
@@ -2454,11 +2506,13 @@
 		{
 		osLayerData.SetOsErrorCode(KErrNone);
 		*aResOut = 0;
+		SQLITE_TRACE_OS(OstTrace0(TRACE_INTERNALS, TVFS_ACCESS_EXIT1, "OS-Exit;0;TVfs::Access;Exists-NoFound"));
 		return SQLITE_OK;
 		}
 	if(err != KErrNone)
 		{
 		osLayerData.SetOsErrorCode(err);
+		SQLITE_TRACE_OS(OstTrace1(TRACE_INTERNALS, TVFS_ACCESS_EXIT2, "OS-Exit;0;TVfs::Access;err=%d", err));
 		return err == KErrNoMemory ? SQLITE_IOERR_NOMEM : SQLITE_IOERR_ACCESS;
 		}
 	*aResOut = 0;
@@ -2477,6 +2531,7 @@
 			break;			
 		}
 	osLayerData.SetOsErrorCode(KErrNone);
+	SQLITE_TRACE_OS(OstTrace1(TRACE_INTERNALS, TVFS_ACCESS_EXIT3, "OS-Exit;0;TVfs::Access;aResOut=%d", *aResOut));
 	return SQLITE_OK;
 	}
 
@@ -2508,7 +2563,6 @@
 */
 /* static */ int TVfs::FullPathName(sqlite3_vfs* aVfs, const char* aRelative, int aBufLen, char* aBuf)
 	{
-	SQLUTRACE_PROFILER(aVfs);
 	__OS_CALL(EOsVfsFullPathName, 0, 0);
 	__OSTIME_COUNTER(TheOsCallTicks[EOsVfsFullPathName], ::OsCallProfile(EFalse, EOsVfsFullPathName), aBufLen, 0, 0, aRelative);
 	COsLayerData& osLayerData = COsLayerData::Instance();
@@ -2517,9 +2571,10 @@
 	TBuf<KMaxFileName + 1> fname;
 	if(!::ConvertToUnicode(aRelative, fname))
 		{
+		SQLITE_TRACE_OS(OstTrace0(TRACE_INTERNALS, TVFS_FULLPATHNAME1, "OS;0;TVfs::FullPathName;err=SQLITE_ERROR"));
 		return SQLITE_ERROR;
 		}
-	SYMBIAN_TRACE_SQL_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KFileName, &fname));
+	SQLITE_TRACE_OS(OstTraceExt2(TRACE_INTERNALS, TVFS_FULLPATHNAME_ENTRY, "OS-Entry;0;TVfs::FullPathName;fname=%S;aBufLen=%d", __SQLITEPRNSTR(fname), aBufLen));
 	//Zero-terminate the converted file name
 	fname.Append(TChar(0));
 	TParse parse;
@@ -2538,8 +2593,10 @@
 	if(!::ConvertFromUnicode(parse.FullName(), dest8))
 		{//Zero the stored fh data, because it has been initialized by the FhExtractAndStore(fname) call (couple of lines above)
 		osLayerData.StoreFhData(NULL, EFalse);
+		SQLITE_TRACE_OS(OstTrace0(TRACE_INTERNALS, TVFS_FULLPATHNAME_EXIT1, "OS-Exit;0;TVfs::FullPathName;err=SQLITE_ERROR"));
 		return SQLITE_ERROR;	
 		}
+	SQLITE_TRACE_OS(OstTrace0(TRACE_INTERNALS, TVFS_FULLPATHNAME_EXIT2, "OS-Exit;0;TVfs::FullPathName;err=SQLITE_OK"));
 	return SQLITE_OK;
 	}
 
@@ -2555,7 +2612,6 @@
 */
 /* static */ int TVfs::Randomness(sqlite3_vfs* aVfs, int aBufLen, char* aBuf)
 	{
-	SQLUTRACE_PROFILER(aVfs);
 	__OS_CALL(EOsVfsRandomness, 0, 0);
 	__OSTIME_COUNTER(TheOsCallTicks[EOsVfsRandomness], ::OsCallProfile(EFalse, EOsVfsRandomness), aBufLen, 0, 0, 0);
 	COsLayerData& osLayerData = COsLayerData::Instance();
@@ -2579,7 +2635,6 @@
 */
 /* static */ int TVfs::Sleep(sqlite3_vfs* aVfs, int aMicrosec)
 	{
-	SQLUTRACE_PROFILER(aVfs);
 	__OS_CALL(EOsVfsSleep, 0, 0);
 	__OSTIME_COUNTER(TheOsCallTicks[EOsVfsSleep], ::OsCallProfile(EFalse, EOsVfsSleep), aMicrosec, 0, 0, 0);
 	User::AfterHighRes(TTimeIntervalMicroSeconds32(aMicrosec));
@@ -2599,7 +2654,6 @@
 */
 /* static */ int TVfs::CurrentTime(sqlite3_vfs* aVfs, double* aNow)
 	{
-	SQLUTRACE_PROFILER(aVfs);
 	__OS_CALL(EOsVfsCurrentTime, 0, 0);
 	__OSTIME_COUNTER(TheOsCallTicks[EOsVfsCurrentTime], ::OsCallProfile(EFalse, EOsVfsCurrentTime), 0, 0, 0, 0);
 	TTime now;
@@ -2635,7 +2689,6 @@
 */
 /* static */int TVfs::GetLastError(sqlite3_vfs* aVfs, int /*aBufLen*/, char* /*aBuf*/)
 	{
-	SQLUTRACE_PROFILER(aVfs);
 	__OS_CALL(EOsVfsGetLastError, 0, 0);
 	__OSTIME_COUNTER(TheOsCallTicks[EOsVfsGetLastError], ::OsCallProfile(EFalse, EOsVfsGetLastError), 0, 0, 0, 0);
 	return 0;
--- a/persistentstorage/sql/SQLite/pager.c	Tue Jul 06 16:18:30 2010 +0300
+++ b/persistentstorage/sql/SQLite/pager.c	Wed Aug 18 11:30:17 2010 +0300
@@ -3062,15 +3062,15 @@
     assert( p->dirty );
     p->dirty = 0;
   }
+
+  /* If the file has not yet been opened, open it now. */
+  if( !pPager->fd->pMethods ){
+    assert(pPager->tempFile);
+	rc = sqlite3PagerOpentemp(pPager, pPager->fd, pPager->vfsFlags);
+	if( rc ) return rc;
+  }
+
   while( pList ){
-
-    /* If the file has not yet been opened, open it now. */
-    if( !pPager->fd->pMethods ){
-      assert(pPager->tempFile);
-      rc = sqlite3PagerOpentemp(pPager, pPager->fd, pPager->vfsFlags);
-      if( rc ) return rc;
-    }
-
     /* If there are dirty pages in the page cache with page numbers greater
     ** than Pager.dbSize, this means sqlite3PagerTruncate() was called to
     ** make the file smaller (presumably by auto-vacuum code). Do not write
--- a/persistentstorage/sql/SQLite/sqlite3.h	Tue Jul 06 16:18:30 2010 +0300
+++ b/persistentstorage/sql/SQLite/sqlite3.h	Wed Aug 18 11:30:17 2010 +0300
@@ -698,6 +698,7 @@
 ** into an integer that the pArg argument points to. This capability
 ** is used during testing and only needs to be supported when SQLITE_TEST
 ** is defined.
+**
 */
 #define SQLITE_FCNTL_LOCKSTATE        1
 
--- a/persistentstorage/sql/SRC/Client/IPC/IPCBuf.cpp	Tue Jul 06 16:18:30 2010 +0300
+++ b/persistentstorage/sql/SRC/Client/IPC/IPCBuf.cpp	Wed Aug 18 11:30:17 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2005-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -15,8 +15,13 @@
 
 #include <e32base.h>
 #include "IPCBuf.h"
-#include "SqlPanic.h"
+#include "SqlAssert.h"
 #include "SqlDbSession.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "IPCBufTraces.h"
+#endif
+#include "SqlTraceDef.h"
 
 /**
 Standard, phase-one HIpcBuf factory method.
@@ -75,6 +80,7 @@
 	TPckg<TIpcStreamBuf> pckg(iBuf);
 	aArgs.Set(2, &pckg);
 	__SQLLEAVE_IF_ERROR(iHandle = iSession.SendReceive(aFunction, aArgs));
+    SQL_TRACE_INTERNALS(OstTraceExt2(TRACE_INTERNALS, HIPCBUF_CONSTRUCTL, "0x%X;HIpcBuf::ConstructL;iHandle=%d", (TUint)this, iHandle));
 	TUint8* base = iBuf.iData;
 	// if reading we already have one buffer-full of data
 	TInt avail = Max(0, Min(iBuf.iExt, KIpcBufSize));
@@ -100,6 +106,7 @@
 */
 HIpcBuf::~HIpcBuf()
 	{
+    SQL_TRACE_INTERNALS(OstTraceExt2(TRACE_INTERNALS, HIPCBUF_HIPCBUFL2, "0x%X;HIpcBuf::~HIpcBuf;iHandle=%d", (TUint)this, iHandle));
 	if(iHandle > 0) //iHandle is valid only when > 0.
 		{
 		(void)iSession.SendReceive(::MakeMsgCode(ESqlSrvStreamClose, ESqlSrvStreamHandle, iHandle));
@@ -116,7 +123,7 @@
 		{
 		return 0;
 		}
-	__SQLASSERT(Avail(ERead) == 0, ESqlPanicInternalError);
+	__ASSERT_DEBUG(Avail(ERead) == 0, __SQLPANIC(ESqlPanicInternalError));
 	TUint8* base=iBuf.iData;
 	IpcWriteL(base,Lag(EWrite));
 	SetBuf(EWrite,base,base);
@@ -131,7 +138,7 @@
 */
 void HIpcBuf::OverflowL()
 	{
-	__SQLASSERT(Avail(EWrite) == 0, ESqlPanicInternalError);
+	__ASSERT_DEBUG(Avail(EWrite) == 0, __SQLPANIC(ESqlPanicInternalError));
 	
 	TUint8* base = iBuf.iData;
 	MovePos(ERead, Lag(ERead));
@@ -168,9 +175,9 @@
 */
 TInt HIpcBuf::DoReadL(TAny* aPtr, TInt aMaxLength)
 	{
-	__SQLASSERT(aMaxLength > 0, ESqlPanicInternalError);
+	__ASSERT_DEBUG(aMaxLength > 0, __SQLPANIC(ESqlPanicInternalError));
 	TInt avail = Avail(ERead);
-	__SQLASSERT(avail >= 0 && Avail(EWrite) >= 0, ESqlPanicInternalError);
+	__ASSERT_DEBUG(avail >= 0 && Avail(EWrite) >= 0, __SQLPANIC(ESqlPanicInternalError));
 	if(avail > 0)
 		{
 		TInt len = Min(aMaxLength, avail);
@@ -181,7 +188,7 @@
 		if(aMaxLength == 0)
 			return len; // that's it
 		}
-	__SQLASSERT(Avail(ERead) == 0, ESqlPanicInternalError);
+	__ASSERT_DEBUG(Avail(ERead) == 0, __SQLPANIC(ESqlPanicInternalError));
 	if(aMaxLength < iBuf.ESize)
 		return avail + TStreamBuf::DoReadL(aPtr, aMaxLength);
 
@@ -202,9 +209,9 @@
 */
 void HIpcBuf::DoWriteL(const TAny* aPtr,TInt aLength)
 	{
-	__SQLASSERT(aLength > 0, ESqlPanicInternalError);
+	__ASSERT_DEBUG(aLength > 0, __SQLPANIC(ESqlPanicInternalError));
 	TInt avail = Avail(EWrite);
-	__SQLASSERT(Avail(ERead) >= 0 && avail >= 0, ESqlPanicInternalError);
+	__ASSERT_DEBUG(Avail(ERead) >= 0 && avail >= 0, __SQLPANIC(ESqlPanicInternalError));
 	if(avail > 0)
 		{
 		TInt len = Min(aLength, avail);
@@ -215,7 +222,7 @@
 
 		aPtr = (TUint8*)aPtr + len;
 		}
-	__SQLASSERT(Avail(EWrite) == 0, ESqlPanicInternalError);
+	__ASSERT_DEBUG(Avail(EWrite) == 0, __SQLPANIC(ESqlPanicInternalError));
 	if(aLength < iBuf.ESize)
 		TStreamBuf::DoWriteL(aPtr, aLength);
 	else
@@ -250,7 +257,7 @@
 			aOffset += Mark(EWrite);
 			break;
 		default:
-			__SQLASSERT_ALWAYS(0, ESqlPanicStreamMarkInvalid);
+		    __ASSERT_ALWAYS(0, __SQLPANIC(ESqlPanicStreamMarkInvalid));
 			break;
 			}
 		break;
@@ -258,7 +265,7 @@
 		aOffset += end;
 		break;
 	default:
-		__SQLASSERT_ALWAYS(0, ESqlPanicStreamLocationInvalid);
+	    __ASSERT_ALWAYS(0, __SQLPANIC(ESqlPanicStreamLocationInvalid));
 		break;
 		}
 	TInt r = KErrNone;
@@ -273,7 +280,7 @@
 		r = KErrEof;
 		}
 
-	__SQLASSERT_ALWAYS(!(aMark & ~(ERead | EWrite)), ESqlPanicStreamMarkInvalid);
+	__ASSERT_ALWAYS(!(aMark & ~(ERead | EWrite)), __SQLPANIC(ESqlPanicStreamMarkInvalid));
 	if(aMark & ERead)
 		{
 		TInt lag = aOffset - Pos(ERead);
@@ -304,7 +311,7 @@
 */
 TInt HIpcBuf::IpcReadL(TAny* aPtr, TInt aMaxLength)
 	{
-	__SQLASSERT(aMaxLength >= 0, ESqlPanicInternalError);
+	__ASSERT_DEBUG(aMaxLength >= 0, __SQLPANIC(ESqlPanicInternalError));
 	if(aMaxLength == 0)
 		return 0;
 
@@ -327,7 +334,7 @@
 */
 void HIpcBuf::IpcWriteL(const TAny* aPtr, TInt aLength)
 	{
-	__SQLASSERT(aLength >= 0, ESqlPanicInternalError);
+	__ASSERT_DEBUG(aLength >= 0, __SQLPANIC(ESqlPanicInternalError));
 	if(aLength == 0)
 		return;
 
--- a/persistentstorage/sql/SRC/Client/SQLDatabase.cpp	Tue Jul 06 16:18:30 2010 +0300
+++ b/persistentstorage/sql/SRC/Client/SQLDatabase.cpp	Wed Aug 18 11:30:17 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2005-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -13,8 +13,13 @@
 // Description:
 //
 
-#include "SqlPanic.h"			//ESqlPanicInvalidObj, ESqlPanicObjExists
+#include "SqlAssert.h"			//ESqlPanicInvalidObj, ESqlPanicObjExists
 #include "SqlDatabaseImpl.h"	//CSqlDatabaseImpl
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "SqlDatabaseTraces.h"
+#endif
+#include "SqlTraceDef.h"
 
 /**
 Gets the category of the return code value that is returned by
@@ -95,12 +100,11 @@
 */
 EXPORT_C TInt RSqlDatabase::Create(const TDesC& aDbFileName, const TDesC8* aConfig)
 	{
-	SQLUTRACE_PROFILER(this);
-	SYMBIAN_TRACE_SQL_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KStrParam16, 1, &aDbFileName));
-	SYMBIAN_TRACE_SQL_EVENTS_ONLY(aConfig ? (void)UTF::Printf(UTF::TTraceContext(UTF::EInternals), 
-			KStrParam, 2, aConfig) : void(0));
-	
+    __SQLTRACE_BORDEREXPR(TPtrC8 config(aConfig ? *aConfig : KNullDesC8));
+	__SQLTRACE_BORDERVAR(TBuf<100> des16prnbuf);
+	SQL_TRACE_BORDER(OstTraceExt3(TRACE_BORDER, RSQLDATABASE_CREATE_ENTRY, "Entry;0x%X;RSqlDatabase::Create;aDbFileName=%S;aConfig=%s", (TUint)this, __SQLPRNSTR(aDbFileName), __SQLPRNSTR8(config, des16prnbuf)));
 	TRAPD(err, iImpl = CSqlDatabaseImpl::NewL(ESqlSrvDbCreate, aDbFileName, NULL, aConfig));
+    SQL_TRACE_BORDER(OstTraceExt3(TRACE_BORDER, RSQLDATABASE_CREATE_Exit, "Exit;0x%X;RSqlDatabase::Create;iImpl=0x%X;err=%d", (TUint)this, (TUint)iImpl, err));
 	return err;
 	}
 	
@@ -146,13 +150,11 @@
 EXPORT_C TInt RSqlDatabase::Create(const TDesC& aDbFileName,
 						const RSqlSecurityPolicy& aSecurityPolicy, const TDesC8* aConfig)
 	{
-	SQLUTRACE_PROFILER(this);
-	SYMBIAN_TRACE_SQL_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KStrParam16, 1, &aDbFileName));
-	SYMBIAN_TRACE_SQL_EVENTS_ONLY(aConfig ? (void)UTF::Printf(UTF::TTraceContext(UTF::EInternals), 
-			KStrParam, 2, aConfig) : void(0));
-	
-	TRAPD(err, 	iImpl = CSqlDatabaseImpl::NewL(ESqlSrvDbCreateSecure, aDbFileName,
-			&aSecurityPolicy.Impl(), aConfig));
+    __SQLTRACE_BORDEREXPR(TPtrC8 config(aConfig ? *aConfig : KNullDesC8));
+	__SQLTRACE_BORDERVAR(TBuf<100> des16prnbuf);
+    SQL_TRACE_BORDER(OstTraceExt4(TRACE_BORDER, RSQLDATABASE_CREATE2_ENTRY, "Entry;0x%X;RSqlDatabase::Create;aDbFileName=%S;aSecurityPolicy=0x%X;aConfig=%s", (TUint)this, __SQLPRNSTR(aDbFileName), (TUint)&aSecurityPolicy, __SQLPRNSTR8(config, des16prnbuf)));
+	TRAPD(err, 	iImpl = CSqlDatabaseImpl::NewL(ESqlSrvDbCreateSecure, aDbFileName, &aSecurityPolicy.Impl(), aConfig));
+    SQL_TRACE_BORDER(OstTraceExt3(TRACE_BORDER, RSQLDATABASE_CREATE2_Exit, "Exit;0x%X;RSqlDatabase::Create;iImpl=0x%X;err=%d", (TUint)this, (TUint)iImpl, err));
 	return err;
 	}
 	
@@ -199,12 +201,11 @@
 */
 EXPORT_C TInt RSqlDatabase::Open(const TDesC& aDbFileName, const TDesC8* aConfig)
 	{
-	SQLUTRACE_PROFILER(this);
-	SYMBIAN_TRACE_SQL_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KStrParam16, 1, &aDbFileName));
-	SYMBIAN_TRACE_SQL_EVENTS_ONLY(aConfig ? (void)UTF::Printf(UTF::TTraceContext(UTF::EInternals), 
-			KStrParam, 2, aConfig) : void(0));
-	
+    __SQLTRACE_BORDEREXPR(TPtrC8 config(aConfig ? *aConfig : KNullDesC8));
+	__SQLTRACE_BORDERVAR(TBuf<100> des16prnbuf);
+    SQL_TRACE_BORDER(OstTraceExt3(TRACE_BORDER, RSQLDATABASE_OPEN_ENTRY, "Entry;0x%X;RSqlDatabase::Open;aDbFileName=%S;aConfig=%s", (TUint)this, __SQLPRNSTR(aDbFileName), __SQLPRNSTR8(config, des16prnbuf)));
 	TRAPD(err, iImpl = CSqlDatabaseImpl::NewL(ESqlSrvDbOpen, aDbFileName, NULL, aConfig));
+    SQL_TRACE_BORDER(OstTraceExt3(TRACE_BORDER, RSQLDATABASE_OPEN_EXIT, "Exit;0x%X;RSqlDatabase::Open;iImpl=0x%X;err=%d", (TUint)this, (TUint)iImpl, err));
 	return err;
 	}
 
@@ -240,12 +241,11 @@
 */
 EXPORT_C void RSqlDatabase::CreateL(const TDesC& aDbFileName, const TDesC8* aConfig)
 	{
-	SQLUTRACE_PROFILER(this);
-	SYMBIAN_TRACE_SQL_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KStrParam16, 1, &aDbFileName));
-	SYMBIAN_TRACE_SQL_EVENTS_ONLY(aConfig ? (void)UTF::Printf(UTF::TTraceContext(UTF::EInternals), 
-			KStrParam, 2, aConfig) : void(0));
-	
+    __SQLTRACE_BORDEREXPR(TPtrC8 config(aConfig ? *aConfig : KNullDesC8));
+	__SQLTRACE_BORDERVAR(TBuf<100> des16prnbuf);
+    SQL_TRACE_BORDER(OstTraceExt3(TRACE_BORDER, RSQLDATABASE_CREATEL_ENTRY, "Entry;0x%X;RSqlDatabase::CreateL;aDbFileName=%S;aConfig=%s", (TUint)this, __SQLPRNSTR(aDbFileName), __SQLPRNSTR8(config, des16prnbuf)));
 	iImpl = CSqlDatabaseImpl::NewL(ESqlSrvDbCreate, aDbFileName, NULL, aConfig);
+    SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, RSQLDATABASE_CREATEL_EXIT, "Entry;0x%X;RSqlDatabase::CreateL;iImpl=0x%X", (TUint)this, (TUint)iImpl));
 	}
 	
 /**
@@ -288,13 +288,11 @@
 EXPORT_C void RSqlDatabase::CreateL(const TDesC& aDbFileName,
 				const RSqlSecurityPolicy& aSecurityPolicy, const TDesC8* aConfig)
 	{
-	SQLUTRACE_PROFILER(this);
-	SYMBIAN_TRACE_SQL_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KStrParam16, 1, &aDbFileName));
-	SYMBIAN_TRACE_SQL_EVENTS_ONLY(aConfig ? (void)UTF::Printf(UTF::TTraceContext(UTF::EInternals), 
-			KStrParam, 2, aConfig) : void(0));
-	
-	iImpl = CSqlDatabaseImpl::NewL(ESqlSrvDbCreateSecure, aDbFileName,
-						&aSecurityPolicy.Impl(), aConfig);
+    __SQLTRACE_BORDEREXPR(TPtrC8 config(aConfig ? *aConfig : KNullDesC8));
+	__SQLTRACE_BORDERVAR(TBuf<100> des16prnbuf);
+    SQL_TRACE_BORDER(OstTraceExt4(TRACE_BORDER, RSQLDATABASE_CREATEL2_ENTRY, "Entry;0x%X;RSqlDatabase::CreateL;aDbFileName=%S;aSecurityPolicy=0x%X;aConfig=%s", (TUint)this, __SQLPRNSTR(aDbFileName), (TUint)&aSecurityPolicy, __SQLPRNSTR8(config, des16prnbuf)));
+	iImpl = CSqlDatabaseImpl::NewL(ESqlSrvDbCreateSecure, aDbFileName, &aSecurityPolicy.Impl(), aConfig);
+    SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, RSQLDATABASE_CREATEL2_EXIT, "Exit;0x%X;RSqlDatabase::CreateL;iImpl=0x%X", (TUint)this, (TUint)iImpl));
 	}
 	
 /**
@@ -339,12 +337,10 @@
 */
 EXPORT_C void RSqlDatabase::OpenL(const TDesC& aDbFileName, const TDesC8* aConfig)
 	{
-	SQLUTRACE_PROFILER(this);
-	SYMBIAN_TRACE_SQL_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KStrParam16, 1, &aDbFileName));
-	SYMBIAN_TRACE_SQL_EVENTS_ONLY(aConfig ? (void)UTF::Printf(UTF::TTraceContext(UTF::EInternals), 
-			KStrParam, 2, aConfig) : void(0));
-	
+    __SQLTRACE_BORDEREXPR(TPtrC8 config(aConfig ? *aConfig : KNullDesC8));
+    SQL_TRACE_BORDER(OstTraceExt3(TRACE_BORDER, RSQLDATABASE_OPENL_ENTRY, "Entry;0x%X;RSqlDatabase::OpenL;aDbFileName=%S;aConfig=%s", (TUint)this, __SQLPRNSTR(aDbFileName), __SQLPRNSTR(config)));
 	iImpl = CSqlDatabaseImpl::NewL(ESqlSrvDbOpen, aDbFileName, NULL, aConfig);
+    SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, RSQLDATABASE_OPENL_EXIT, "Exit;0x%X;RSqlDatabase::OpenL;iImpl=0x%X", (TUint)this, (TUint)iImpl));
 	}
 
 /**
@@ -362,8 +358,9 @@
 */
 EXPORT_C void RSqlDatabase::Close()
 	{
-	SQLUTRACE_PROFILER(this);
+    SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, RSQLDATABASE_CLOSE_ENTRY, "Entry;0x%X;RSqlDatabase::Close;iImpl=0x%X", (TUint)this, (TUint)iImpl));
 	delete iImpl;
+    SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, RSQLDATABASE_CLOSE_EXIT, "Exit;0x%X;RSqlDatabase::Close;iImpl=0x%X", (TUint)this, (TUint)iImpl));
 	iImpl = NULL;
 	}
 	
@@ -408,10 +405,10 @@
 */
 EXPORT_C TInt RSqlDatabase::Attach(const TDesC& aDbFileName, const TDesC& aDbName)
 	{
-	SQLUTRACE_PROFILER(this);
-	SYMBIAN_TRACE_SQL_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KStrStrParam16, &aDbFileName, &aDbName));
-	
-	return Impl().Attach(aDbFileName, aDbName);
+    SQL_TRACE_BORDER(OstTraceExt3(TRACE_BORDER, RSQLDATABASE_ATTACH_ENTRY, "Entry;0x%X;RSqlDatabase::Attach;aDbFileName=%S;aDbName=%S", (TUint)this, __SQLPRNSTR(aDbFileName), __SQLPRNSTR(aDbName)));
+	TInt err = Impl().Attach(aDbFileName, aDbName);
+    SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, RSQLDATABASE_ATTACH_EXIT, "Entry;0x%X;RSqlDatabase::Attach;err=%d", (TUint)this, err));
+	return err;
 	}
 		
 /**
@@ -429,10 +426,10 @@
 */
 EXPORT_C TInt RSqlDatabase::Detach(const TDesC& aDbName)
 	{
-	SQLUTRACE_PROFILER(this);
-	SYMBIAN_TRACE_SQL_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KStrParam16, 1, &aDbName));
-	
-	return Impl().Detach(aDbName);
+    SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, RSQLDATABASE_DETACH_ENTRY, "Entry;0x%X;RSqlDatabase::Detach;aDbName=%S", (TUint)this, __SQLPRNSTR(aDbName)));
+	TInt err = Impl().Detach(aDbName);
+    SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, RSQLDATABASE_DETACH_EXIT, "Exit;0x%X;RSqlDatabase::Detach;err=%d", (TUint)this, err));
+	return err;
 	}
 
 /**
@@ -470,11 +467,10 @@
 */
 EXPORT_C TInt RSqlDatabase::Copy(const TDesC& aSrcDbFileName, const TDesC& aDestDbFileName)
 	{
-	SQLUTRACE_PROFILER(0);
-	SYMBIAN_TRACE_SQL_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KStrStrParam16, 
-			&aSrcDbFileName, &aDestDbFileName));
-
-	return CSqlDatabaseImpl::Copy(aSrcDbFileName, aDestDbFileName);
+    SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, RSQLDATABASE_COPY_ENTRY, "Entry;0;RSqlDatabase::Copy;aSrcDbFileName=%S;aDestDbFileName=%S", __SQLPRNSTR(aSrcDbFileName), __SQLPRNSTR(aDestDbFileName)));
+	TInt err = CSqlDatabaseImpl::Copy(aSrcDbFileName, aDestDbFileName);
+    SQL_TRACE_BORDER(OstTrace1(TRACE_BORDER, RSQLDATABASE_COPY_EXIT, "Exit;0;RSqlDatabase::Copy;err=%d", err));
+	return err;
 	}
 	
 /**
@@ -504,10 +500,10 @@
 */
 EXPORT_C TInt RSqlDatabase::Delete(const TDesC& aDbFileName)
 	{
-	SQLUTRACE_PROFILER(0);
-	SYMBIAN_TRACE_SQL_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KStrParam16, 1, &aDbFileName));
-	
-	return CSqlDatabaseImpl::Delete(aDbFileName);
+    SQL_TRACE_BORDER(OstTraceExt1(TRACE_BORDER, RSQLDATABASE_DELETE_ENTRY, "Entry;0;RSqlDatabase::Delete;aDbFileName=%S", __SQLPRNSTR(aDbFileName)));
+	TInt err = CSqlDatabaseImpl::Delete(aDbFileName);
+    SQL_TRACE_BORDER(OstTrace1(TRACE_BORDER, RSQLDATABASE_DELETE_EXIT, "Exit;0;RSqlDatabase::Delete;err=%d", err));
+	return err;
 	}
 	
 /**
@@ -527,10 +523,9 @@
 */
 EXPORT_C TInt RSqlDatabase::GetSecurityPolicy(RSqlSecurityPolicy& aSecurityPolicy) const
 	{
-	SQLUTRACE_PROFILER(this);
-	TRAPD(err, CSqlSecurityPolicy* securityPolicy = Impl().CloneSecurityPolicyL();
-		aSecurityPolicy.Set(*securityPolicy));
-	
+    SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, RSQLDATABASE_GETSECURITYPOLICY_ENTRY, "Entry;0x%X;RSqlDatabase::GetSecurityPolicy;aSecurityPolicy=0x%X", (TUint)this, (TUint)&aSecurityPolicy));
+	TRAPD(err, CSqlSecurityPolicy* securityPolicy = Impl().CloneSecurityPolicyL(); aSecurityPolicy.Set(*securityPolicy));
+    SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, RSQLDATABASE_GETSECURITYPOLICY_EXIT, "Exit;0x%X;RSqlDatabase::GetSecurityPolicy;err=%d", (TUint)this, err));
 	return err;
 	}
 	
@@ -550,9 +545,10 @@
 */
 EXPORT_C void RSqlDatabase::GetSecurityPolicyL(RSqlSecurityPolicy& aSecurityPolicy) const
 	{
-	SQLUTRACE_PROFILER(this);
+    SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, RSQLDATABASE_GETSECURITYPOLICYL_ENTRY, "Entry;0x%X;RSqlDatabase::GetSecurityPolicyL;aSecurityPolicy=0x%X", (TUint)this, (TUint)&aSecurityPolicy));
 	CSqlSecurityPolicy* securityPolicy = Impl().CloneSecurityPolicyL();
 	aSecurityPolicy.Set(*securityPolicy);	
+    SQL_TRACE_BORDER(OstTrace1(TRACE_BORDER, RSQLDATABASE_GETSECURITYPOLICYL_EXIT, "Exit;0x%X;RSqlDatabase::GetSecurityPolicyL", (TUint)this));
 	}
 	
 /**
@@ -581,8 +577,10 @@
 */
 EXPORT_C TInt RSqlDatabase::SetIsolationLevel(RSqlDatabase::TIsolationLevel aIsolationLevel)
 	{
-	SQLUTRACE_PROFILER(this);
-	return Impl().SetIsolationLevel(aIsolationLevel);
+    SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, RSQLDATABASE_SETISOLATIONLEVEL_ENTRY, "Entry;0x%X;RSqlDatabase::SetIsolationLevel;aIsolationLevel=%d", (TUint)this, aIsolationLevel));
+	TInt err = Impl().SetIsolationLevel(aIsolationLevel);
+    SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, RSQLDATABASE_SETISOLATIONLEVEL_EXIT, "Exit;0x%X;RSqlDatabase::SetIsolationLevel;err=%d", (TUint)this, err));
+	return err;
 	}
 	
 /**
@@ -632,10 +630,10 @@
 */
 EXPORT_C TInt RSqlDatabase::Exec(const TDesC& aSqlStmt)
 	{
-	SQLUTRACE_PROFILER(this);
-	SYMBIAN_TRACE_SQL_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KStrParam16, 1, &aSqlStmt));
-
-	return Impl().Exec(aSqlStmt);
+    SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, RSQLDATABASE_EXEC16_ENTRY, "Entry;0x%X;RSqlDatabase::Exec16;aSqlStmt=%S", (TUint)this, __SQLPRNSTR(aSqlStmt)));
+	TInt err = Impl().Exec(aSqlStmt);
+    SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, RSQLDATABASE_EXEC16_EXIT, "Exit;0x%X;RSqlDatabase::Exec16;err=%d", (TUint)this, err));
+    return err;
 	}
 	
 /**
@@ -685,10 +683,11 @@
 */
 EXPORT_C TInt RSqlDatabase::Exec(const TDesC8& aSqlStmt)
 	{
-	SQLUTRACE_PROFILER(this);
-	SYMBIAN_TRACE_SQL_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KStrParam, 1, &aSqlStmt));
-
-	return Impl().Exec(aSqlStmt);
+	__SQLTRACE_BORDERVAR(TBuf<100> des16prnbuf);
+    SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, RSQLDATABASE_EXEC8_ENTRY, "Entry;0x%X;RSqlDatabase::Exec8;aSqlStmt=%s", (TUint)this, __SQLPRNSTR8(aSqlStmt, des16prnbuf)));
+	TInt err = Impl().Exec(aSqlStmt);
+    SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, RSQLDATABASE_EXEC8_EXIT, "Exit;0x%X;RSqlDatabase::Exec8;err=%d", (TUint)this, err));
+	return err;
 	}
 
 /**
@@ -743,10 +742,9 @@
 */
 EXPORT_C void RSqlDatabase::Exec(const TDesC& aSqlStmt, TRequestStatus& aStatus)
 	{
-	SQLUTRACE_PROFILER(this);
-	SYMBIAN_TRACE_SQL_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KStrParam16, 1, &aSqlStmt));
-
+    SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, RSQLDATABASE_EXECASYNC16_ENTRY, "Entry;0x%X;RSqlDatabase::ExecAsync16;aSqlStmt=%S", (TUint)this, __SQLPRNSTR(aSqlStmt)));
 	Impl().Exec(aSqlStmt, aStatus);
+    SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, RSQLDATABASE_EXECASYNC16_EXIT, "Exit;0x%X;RSqlDatabase::ExecAsync16;aStatus.Int()=%d", (TUint)this, aStatus.Int()));
 	}
 
 /**
@@ -801,10 +799,10 @@
 */
 EXPORT_C void RSqlDatabase::Exec(const TDesC8& aSqlStmt, TRequestStatus& aStatus)
 	{
-	SQLUTRACE_PROFILER(this);
-	SYMBIAN_TRACE_SQL_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KStrParam, 1, &aSqlStmt));
-
+	__SQLTRACE_BORDERVAR(TBuf<100> des16prnbuf);
+    SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, RSQLDATABASE_EXECASYNC8_ENTRY, "Entry;0x%X;RSqlDatabase::ExecAsync8;aSqlStmt=%s", (TUint)this, __SQLPRNSTR8(aSqlStmt, des16prnbuf)));
 	Impl().Exec(aSqlStmt, aStatus);
+    SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, RSQLDATABASE_EXECASYNC8_EXIT, "Exit;0x%X;RSqlDatabase::ExecAsync8;aStatus.Int()=%d", (TUint)this, aStatus.Int()));
 	}
 	
 /**
@@ -833,8 +831,9 @@
 */
 EXPORT_C TPtrC RSqlDatabase::LastErrorMessage() const
 	{
-	SQLUTRACE_PROFILER(0);
-	return Impl().LastErrorMessage();
+	TPtrC msg(Impl().LastErrorMessage());
+    SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, RSQLDATABASE_LASTERRORMESSAGE, "0x%X;RSqlDatabase::LastErrorMessage;msg=%S", (TUint)this, __SQLPRNSTR(msg)));
+	return msg;
 	}
 
 /**
@@ -850,8 +849,10 @@
 */
 EXPORT_C TInt64 RSqlDatabase::LastInsertedRowId() const
 	{
-	SQLUTRACE_PROFILER(0);
-	return Impl().LastInsertedRowId();	
+    SQL_TRACE_BORDER(OstTrace1(TRACE_BORDER, RSQLDATABASE_LASTINSERTEDROWID_ENTRY, "Entry;0x%X;RSqlDatabase::LastInsertedRowId", (TUint)this));
+	TInt64 rc = Impl().LastInsertedRowId();
+	SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, RSQLDATABASE_LASTINSERTEDROWID_EXIT, "Exit;0x%X;RSqlDatabase::LastInsertedRowId;RowId=%lld", (TUint)this, rc));
+	return rc;
 	}
 
 /**
@@ -863,8 +864,10 @@
 */
 EXPORT_C TBool RSqlDatabase::InTransaction() const
 	{
-	SQLUTRACE_PROFILER(0);
-	return Impl().InTransaction();
+    SQL_TRACE_BORDER(OstTrace1(TRACE_BORDER, RSQLDATABASE_INTRABSACTION_ENTRY, "Entry;0x%X;RSqlDatabase::InTransaction", (TUint)this));
+	TBool res = Impl().InTransaction();
+    SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, RSQLDATABASE_INTRABSACTION_EXIT, "Exit;0x%X;RSqlDatabase::InTransaction;res=%d", (TUint)this, res));
+	return res;
 	}
 	
 /**
@@ -881,8 +884,10 @@
 */
 EXPORT_C TInt RSqlDatabase::Size() const
 	{
-	SQLUTRACE_PROFILER(0);
-	return Impl().Size();
+    SQL_TRACE_BORDER(OstTrace1(TRACE_BORDER, RSQLDATABASE_SIZE_ENTRY, "Entry;0x%X;RSqlDatabase::Size", (TUint)this));
+	TInt rc = Impl().Size();
+    SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, RSQLDATABASE_SIZE_EXIT, "Exit;0x%X;RSqlDatabase::Size;rc=%d", (TUint)this, rc));
+	return rc;
 	}
 
 /**
@@ -902,10 +907,10 @@
 */
 EXPORT_C TInt RSqlDatabase::Size(RSqlDatabase::TSize& aSize, const TDesC& aDbName) const
 	{
-	SQLUTRACE_PROFILER(0);
-	SYMBIAN_TRACE_SQL_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KStrParam16, 2, &aDbName));
-	
-	return Impl().Size(aSize, aDbName);
+    SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, RSQLDATABASE_SIZE2_ENTRY, "Entry;0x%X;RSqlDatabase::Size-2;aDbName=%S", (TUint)this, __SQLPRNSTR(aDbName)));
+	TInt err = Impl().Size(aSize, aDbName);
+    SQL_TRACE_BORDER(OstTraceExt4(TRACE_BORDER, RSQLDATABASE_SIZE2_EXIT, "Exit;0x%X;RSqlDatabase::Size-2;err=%d;aSize.iSize=%lld;aSize.iFree=%lld", (TUint)this, err, aSize.iSize, aSize.iFree));
+	return err;
 	}
 
 /**
@@ -940,10 +945,10 @@
 */
 EXPORT_C TInt RSqlDatabase::Compact(TInt64 aSize, const TDesC& aDbName)
 	{
-	SQLUTRACE_PROFILER(this);
-	SYMBIAN_TRACE_SQL_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KSizeStrParam16, 1, aSize, 2, &aDbName));
-
-	return Impl().Compact(aSize, aDbName);
+	SQL_TRACE_BORDER(OstTraceExt3(TRACE_BORDER, RSQLDATABASE_COMPACT_ENTRY, "Entry;0x%X;RSqlDatabase::Compact;aSize=%lld;aDbName=%S", (TUint)this, aSize, __SQLPRNSTR(aDbName)));
+	TInt rc = Impl().Compact(aSize, aDbName);
+    SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, RSQLDATABASE_COMPACT_EXIT, "Exit;0x%X;RSqlDatabase::Compact;rc=%d", (TUint)this, rc));
+	return rc;
 	}
 	
 /**
@@ -980,10 +985,9 @@
 */
 EXPORT_C void RSqlDatabase::Compact(TInt64 aSize, TRequestStatus& aStatus, const TDesC& aDbName)
 	{
-	SQLUTRACE_PROFILER(this);
-	SYMBIAN_TRACE_SQL_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KSizeStrParam16, 1, aSize, 3, &aDbName));
-
+	SQL_TRACE_BORDER(OstTraceExt3(TRACE_BORDER, RSQLDATABASE_COMPACTASYNC_ENTRY, "Entry;0x%X;RSqlDatabase::CompactAsync;aSize=%lld;aDbName=%S", (TUint)this, aSize, __SQLPRNSTR(aDbName)));
 	Impl().Compact(aSize, aDbName, aStatus);
+    SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, RSQLDATABASE_COMPACTASYNC_EXIT, "Exit;0x%X;RSqlDatabase::CompactAsync;aStatus.Int()=%d", (TUint)this, aStatus.Int()));
 	}
 
 /**
@@ -1010,10 +1014,12 @@
 */
 EXPORT_C TInt RSqlDatabase::ReserveDriveSpace(TInt aSize)
 	{
-	SQLUTRACE_PROFILER(this);
+    SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, RSQLDATABASE_RESERVEDRIVESPACE_ENTRY, "Entry;0x%X;RSqlDatabase::ReserveDriveSpace;aSize=%d", (TUint)this, aSize));
 	//Usage of the IPC call arguments: 
 	//Arg 0: [out]  requested size
-	return Impl().Session().SendReceive(ESqlSrvDbReserveDriveSpace, TIpcArgs(aSize));
+	TInt err = Impl().Session().SendReceive(ESqlSrvDbReserveDriveSpace, TIpcArgs(aSize));
+    SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, RSQLDATABASE_RESERVEDRIVESPACE_EXIT, "Exit;0x%X;RSqlDatabase::ReserveDriveSpace;err=%d", (TUint)this, err));
+    return err;
 	}
 	
 /**
@@ -1025,8 +1031,9 @@
 */
 EXPORT_C void RSqlDatabase::FreeReservedSpace()
 	{
-	SQLUTRACE_PROFILER(this);
-	Impl().Session().SendReceive(ESqlSrvDbFreeReservedSpace);
+    SQL_TRACE_BORDER(OstTrace1(TRACE_BORDER, RSQLDATABASE_FREERESERVEDSPACE_ENTRY, "Entry;0x%X;RSqlDatabase::FreeReservedSpace", (TUint)this));
+	__SQLTRACE_BORDERVAR(TInt err =) Impl().Session().SendReceive(ESqlSrvDbFreeReservedSpace);
+    SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, RSQLDATABASE_FREERESERVEDSPACE_EXIT, "Exit;0x%X;RSqlDatabase::FreeReservedSpace;err=%d", (TUint)this, err));
 	}
 	
 /**
@@ -1043,8 +1050,10 @@
 */
 EXPORT_C TInt RSqlDatabase::GetReserveAccess()
 	{
-	SQLUTRACE_PROFILER(this);
-	return Impl().Session().SendReceive(ESqlSrvDbGetReserveAccess);
+    SQL_TRACE_BORDER(OstTrace1(TRACE_BORDER, RSQLDATABASE_GETRESERVEACCESS_ENTRY, "Exit;0x%X;RSqlDatabase::GetReserveAccess", (TUint)this));
+	TInt err = Impl().Session().SendReceive(ESqlSrvDbGetReserveAccess);
+    SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, RSQLDATABASE_GETRESERVEACCESS_EXIT, "Exit;0x%X;RSqlDatabase::GetReserveAccess;err=%d", (TUint)this, err));
+	return err;
 	}
 	
 /**
@@ -1056,8 +1065,9 @@
 */
 EXPORT_C void RSqlDatabase::ReleaseReserveAccess()
 	{
-	SQLUTRACE_PROFILER(this);
-	Impl().Session().SendReceive(ESqlSrvDbReleaseReserveAccess);
+    SQL_TRACE_BORDER(OstTrace1(TRACE_BORDER, RSQLDATABASE_RELEASERESERVEACCESS_ENTRY, "Entry;0x%X;RSqlDatabase::ReleaseReserveAccess", (TUint)this));
+	__SQLTRACE_BORDERVAR(TInt err =) Impl().Session().SendReceive(ESqlSrvDbReleaseReserveAccess);
+    SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, RSQLDATABASE_RELEASERESERVEACCESS_EXIT, "Exit;0x%X;RSqlDatabase::ReleaseReserveAccess;err=%d", (TUint)this, err));
 	}
 
 /**
@@ -1069,6 +1079,6 @@
 */
 CSqlDatabaseImpl& RSqlDatabase::Impl() const
 	{
-	__SQLASSERT_ALWAYS(iImpl != NULL, ESqlPanicInvalidObj);
+	__ASSERT_ALWAYS(iImpl != NULL, __SQLPANIC(ESqlPanicInvalidObj));
 	return *iImpl;	
 	}
--- a/persistentstorage/sql/SRC/Client/SqlBlob.cpp	Tue Jul 06 16:18:30 2010 +0300
+++ b/persistentstorage/sql/SRC/Client/SqlBlob.cpp	Wed Aug 18 11:30:17 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -15,9 +15,14 @@
 
 #include <s32mem.h>
 #include "SqlDb.h"
-#include "SqlPanic.h"
+#include "SqlAssert.h"
 #include "SqlDatabaseImpl.h"
 #include "IPCBuf.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "SqlBlobTraces.h"
+#endif
+#include "SqlTraceDef.h"
 
 // The maximum time (100 milliseconds) that a block of data is allowed to take to be read/written by TSqlBlob.
 // If the time taken is longer than this value then the next block size used will be less
@@ -103,7 +108,7 @@
 	
 		// Update how much data is still to be read, and the buffer pointer
 		remainingDataSize -= blockSize;
-		__SQLASSERT(remainingDataSize >= 0, ESqlPanicInternalError);
+		__ASSERT_DEBUG(remainingDataSize >= 0, __SQLPANIC2(ESqlPanicInternalError));
 		ptr.Set((TUint8*)(ptr.Ptr() + blockSize), 0, remainingDataSize);
 		}	
 	aDestBuffer.SetLength(aBlobSize);
@@ -132,7 +137,7 @@
 	
 		// Update how much data is still to be written
 		remainingDataSize -= blockSize;
-		__SQLASSERT(remainingDataSize >= 0, ESqlPanicInternalError);
+		__ASSERT_DEBUG(remainingDataSize >= 0, __SQLPANIC2(ESqlPanicInternalError));
 		}	
 	aStrm.CommitL();	
 	}
@@ -171,7 +176,7 @@
 	TInt blobSize = strm.SizeL(); // size of the blob, in bytes
 	if(blobSize > aBuffer.MaxSize())
 		{
-		__SQLLEAVE(KErrOverflow);
+		__SQLLEAVE2(KErrOverflow);
 		}	
 	DoReadInBlocksL(strm, aBuffer, blobSize);
 	CleanupStack::PopAndDestroy(); // strm
@@ -192,7 +197,7 @@
 	TInt blobSize = strm.SizeL(); // size of the blob, in bytes
 	if(dataSize > blobSize)
 		{
-		__SQLLEAVE(KErrEof);
+		__SQLLEAVE2(KErrEof);
 		}	
 	if(dataSize > 0)
 		{
@@ -236,14 +241,12 @@
 EXPORT_C void RSqlBlobReadStream::OpenL(RSqlDatabase& aDb, const TDesC& aTableName, const TDesC& aColumnName, 
 										TInt64 aRowId, const TDesC& aDbName)
 	{
-	SQLUTRACE_PROFILER(this);
-	SYMBIAN_TRACE_SQL_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KRSqlBlobParam16, &aDb, &aTableName, 
-			&aColumnName, aRowId, &aDbName));
-	
+	SQL_TRACE_BORDER(OstTraceExt5(TRACE_BORDER, RSQLBLOBREADSTREAM_OPENL_ENTRY, "Entry;0;RSqlBlobReadStream::OpenL;aDb=0x%X;aTableName=%S;aColumnName=%S;aDbName=%S;aRowId=%lld", (TUint)&aDb, __SQLPRNSTR(aTableName), __SQLPRNSTR(aColumnName), __SQLPRNSTR(aDbName), aRowId));
 	HBufC8* ipcPrmBuf = ::PrepareIpcParamBufLC(aTableName, aColumnName, aRowId, ETrue, aDbName);
 	MStreamBuf* strm = ::CreateIpcStreamL(aDb.Impl().Session(), ipcPrmBuf->Des());
 	Attach(strm);
 	CleanupStack::PopAndDestroy(ipcPrmBuf);	
+    SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, RSQLBLOBREADSTREAM_OPENL_EXIT, "Exit;0x%x;RSqlBlobReadStream::OpenL;strm=0x%X", (TUint)this, (TUint)strm));
 	}
 	
 /**
@@ -259,11 +262,12 @@
 */
 EXPORT_C TInt RSqlBlobReadStream::SizeL()
 	{
-	SQLUTRACE_PROFILER(this);
-	
+    SQL_TRACE_BORDER(OstTrace1(TRACE_BORDER, RSQLBLOBREADSTREAM_SIZEL_ENTRY, "Entry;0x%X;RSqlBlobReadStream::SizeL;", (TUint)this));
 	MStreamBuf* src = Source();
-	__SQLASSERT_ALWAYS(src != NULL, ESqlPanicInvalidObj);
-	return src->SizeL();
+	__ASSERT_ALWAYS(src != NULL, __SQLPANIC(ESqlPanicInvalidObj));
+	TInt size = src->SizeL();
+    SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, RSQLBLOBREADSTREAM_SIZEL_EXIT, "Exit;0x%X;RSqlBlobReadStream::SizeL;size=%d", (TUint)this, size));
+	return size;
 	}
 
 /**
@@ -299,14 +303,12 @@
 EXPORT_C void RSqlBlobWriteStream::OpenL(RSqlDatabase& aDb, const TDesC& aTableName, const TDesC& aColumnName, 
 										 TInt64 aRowId, const TDesC& aDbName)
 	{
-	SQLUTRACE_PROFILER(this);
-	SYMBIAN_TRACE_SQL_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KRSqlBlobParam16, &aDb, &aTableName, 
-			&aColumnName, aRowId, &aDbName));
-	
+    SQL_TRACE_BORDER(OstTraceExt5(TRACE_BORDER, RSQLBLOBWRITESTREAM_OPENL_ENTRY, "Entry;0;RSqlBlobWriteStream::OpenL;aDb=0x%X;aTableName=%S;aColumnName=%S;aDbName=%S;aRowId=%lld", (TUint)&aDb, __SQLPRNSTR(aTableName), __SQLPRNSTR(aColumnName), __SQLPRNSTR(aDbName), aRowId));
 	HBufC8* ipcPrmBuf = ::PrepareIpcParamBufLC(aTableName, aColumnName, aRowId, EFalse, aDbName);
 	MStreamBuf* strm = ::CreateIpcStreamL(aDb.Impl().Session(), ipcPrmBuf->Des());
 	Attach(strm);
 	CleanupStack::PopAndDestroy(ipcPrmBuf);		
+    SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, RSQLBLOBWRITESTREAM_OPENL_EXIT, "Exit;0x%x;RSqlBlobWriteStream::OpenL;strm=0x%X", (TUint)this, (TUint)strm));
 	}
 
 /**
@@ -322,11 +324,12 @@
 */
 EXPORT_C TInt RSqlBlobWriteStream::SizeL()
 	{
-	SQLUTRACE_PROFILER(this);
-
+    SQL_TRACE_BORDER(OstTrace1(TRACE_BORDER, RSQLBLOBWRITESTREAM_SIZEL_ENTRY, "Entry;0x%X;RSqlBlobWriteStream::SizeL;", (TUint)this));
 	MStreamBuf* sink = Sink();
-	__SQLASSERT_ALWAYS(sink != NULL, ESqlPanicInvalidObj);
-	return sink->SizeL();
+	__ASSERT_ALWAYS(sink != NULL, __SQLPANIC(ESqlPanicInvalidObj));
+	TInt size =  sink->SizeL();
+    SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, RSQLBLOBWRITESTREAM_SIZEL_EXIT, "Exit;0x%X;RSqlBlobWriteStream::SizeL;size=%d", (TUint)this, size));
+    return size;
 	}
 
 /**
@@ -367,11 +370,10 @@
 					     		 TInt64 aRowId,
 					     		 const TDesC& aDbName)
 	{
-	SQLUTRACE_PROFILER(0);
-	SYMBIAN_TRACE_SQL_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KRSqlBlobParam16, &aDb, &aTableName, 
-			&aColumnName, aRowId, &aDbName));
-	
-	return ReadLC(aDb, aTableName, aColumnName, aRowId, aDbName);
+    SQL_TRACE_BORDER(OstTraceExt5(TRACE_BORDER, TSQLBLOB_GETLC_ENTRY, "Entry;0;TSqlBlob::GetLC;aDb=0x%X;aTableName=%S;aColumnName=%S;aDbName=%S;aRowId=%lld", (TUint)&aDb, __SQLPRNSTR(aTableName), __SQLPRNSTR(aColumnName), __SQLPRNSTR(aDbName), aRowId));
+	HBufC8* res = ReadLC(aDb, aTableName, aColumnName, aRowId, aDbName);
+    SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, TSQLBLOB_GETLC_EXIT, "Exit;0;TSqlBlob::GetLC;res=0x%X;res->Size()=%d", (TUint)res, res->Des().Size()));
+	return res;
 	}
 	
 /**
@@ -412,11 +414,9 @@
 					 		TInt64 aRowId,
 					 	    const TDesC& aDbName)
 	{
-	SQLUTRACE_PROFILER(0);
-	SYMBIAN_TRACE_SQL_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KRSqlBlobParam16, &aDb, &aTableName, 
-			&aColumnName, aRowId, &aDbName));
-	
+    SQL_TRACE_BORDER(OstTraceExt5(TRACE_BORDER, TSQLBLOB_GET_ENTRY, "Entry;0;TSqlBlob::Get;aDb=0x%X;aTableName=%S;aColumnName=%S;aDbName=%S;aRowId=%lld", (TUint)&aDb, __SQLPRNSTR(aTableName), __SQLPRNSTR(aColumnName), __SQLPRNSTR(aDbName), aRowId));
 	TRAPD(err, ReadL(aDb, aTableName, aColumnName, aBuffer, aRowId, aDbName));
+    SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, TSQLBLOB_GET_EXIT, "Exit;0;TSqlBlob::Get;aBuffer.Ptr()=0x%X;aBuffer.Size()=%d", (TUint)aBuffer.Ptr(), aBuffer.Size()));
 	return err;	
 	}
 
@@ -458,10 +458,9 @@
 					  		 TInt64 aRowId,
 					  		 const TDesC& aDbName)
 	{
-	SQLUTRACE_PROFILER(0);
-	SYMBIAN_TRACE_SQL_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KRSqlBlobParam16, &aDb, &aTableName, 
-			&aColumnName, aRowId, &aDbName));
-	
+    SQL_TRACE_BORDER(OstTraceExt5(TRACE_BORDER, TSQLBLOB_SET_ENTRY, "Entry;0;TSqlBlob::Set;aDb=0x%X;aTableName=%S;aColumnName=%S;aDbName=%S;aRowId=%lld", (TUint)&aDb, __SQLPRNSTR(aTableName), __SQLPRNSTR(aColumnName), __SQLPRNSTR(aDbName), aRowId));
+    SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, TSQLBLOB_SET_ENTRYEXT, "EntryExt;0;TSqlBlob::Set;aData.Ptr=0x%X;aData.Size()=%d", (TUint)aData.Ptr(), aData.Size()));
 	WriteL(aDb, aTableName, aColumnName, aData,	aRowId, aDbName);
+    SQL_TRACE_BORDER(OstTrace0(TRACE_BORDER, TSQLBLOB_SET_EXIT, "Exit;0;TSqlBlob::Set"));
 	}
 
--- a/persistentstorage/sql/SRC/Client/SqlDatabaseImpl.cpp	Tue Jul 06 16:18:30 2010 +0300
+++ b/persistentstorage/sql/SRC/Client/SqlDatabaseImpl.cpp	Wed Aug 18 11:30:17 2010 +0300
@@ -171,7 +171,7 @@
 	TPtrC8 securityPolicyData;
 	if(aFunction == ESqlSrvDbCreateSecure)	
 		{
-		__SQLASSERT(aSecurityPolicy != NULL, ESqlPanicBadArgument);
+		__ASSERT_DEBUG(aSecurityPolicy != NULL, __SQLPANIC(ESqlPanicBadArgument));
 		const RSqlBufFlat& bufFlat = aSecurityPolicy->BufFlat();
 		securityPolicyData.Set(bufFlat.BufDes());
 		}
--- a/persistentstorage/sql/SRC/Client/SqlDbSession.cpp	Tue Jul 06 16:18:30 2010 +0300
+++ b/persistentstorage/sql/SRC/Client/SqlDbSession.cpp	Wed Aug 18 11:30:17 2010 +0300
@@ -23,6 +23,11 @@
 #include "SqlSrvStartup.h"		//StartSqlServer()
 #include "SqlResourceTest.h"	//TSqlResourceTestData
 #include "SqlSecurityImpl.h"	//CSqlSecurityPolicy
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "SqlDbSessionTraces.h"
+#endif
+#include "SqlTraceDef.h"
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////////////////
 //////////////////////             TSqlFhCmdFunctor             ///////////////////////////////////////////////
@@ -196,8 +201,8 @@
 	TPtr8 bufPtr = buf->Des();
 	RDesWriteStream out(bufPtr);
 	TRAPD(err, SerializeToStreamL(out));
-	__SQLASSERT(err == KErrNone, ESqlPanicInternalError);//"Write to descriptor" streaming operatons can't fail
-    TUint32 arg0 = (TUint32)bufPtr.Length() | (aReadOnly ? 0x80000000 : 0);
+	__ASSERT_DEBUG(err == KErrNone, __SQLPANIC(ESqlPanicInternalError));//"Write to descriptor" streaming operatons can't fail
+   TUint32 arg0 = (TUint32)bufPtr.Length() | (aReadOnly ? 0x80000000 : 0);
     TIpcArgs ipcArgs(arg0, &bufPtr);
     err = aDbFile.TransferToServer(ipcArgs, 2, 3);
     if(err == KErrNone)
@@ -301,6 +306,7 @@
 */
 TInt RSqlDbSession::Connect(TSqlSrvFunction aFunction, const TDesC& aDbFileName, const TDesC8& aSecurityPolicyData, const TDesC8* aConfig)
 	{
+    SQL_TRACE_SESSION(OstTraceExt2(TRACE_INTERNALS, RSQLDBSESSION_CONNECT_ENTRY, "Entry;0x%X;RSqlDbSession::Connect;aDbFileName=%S", (TUint)this, __SQLPRNSTR(aDbFileName)));
 #ifdef SYSLIBS_TEST
     const TInt KDefaultMsgBufLen = 4;
 #else	
@@ -358,6 +364,7 @@
 		{
 		Close();	
 		}
+    SQL_TRACE_SESSION(OstTraceExt3(TRACE_INTERNALS, RSQLDBSESSION_CONNECT_EXIT, "Exit;0x%X;RSqlDbSession::Connect;err=%d;handle=0x%X", (TUint)this, err, (TUint)Handle()));
 	return err;
 	}
 
@@ -650,6 +657,7 @@
 */
 void RSqlDbSession::Close()
 	{
+    SQL_TRACE_SESSION(OstTraceExt2(TRACE_INTERNALS, RSQLDBSESSION_CLOSE, "0x%X;RSqlDbSession::Close;handle=0x%X", (TUint)this, (TUint)Handle()));
 	if(Handle())
 		{
 		(void)SendReceive(ESqlSrvDbClose);
@@ -848,7 +856,7 @@
 			{
 			//coverity[DEADCODE]
 			//The ASSERT might be useful in catching future defect in this function
-			__SQLASSERT(aConfig != NULL, ESqlPanicInternalError);
+			__ASSERT_DEBUG(aConfig != NULL, __SQLPANIC(ESqlPanicInternalError));
 			arg3Ptr.Append(*aConfig);
 			}
 		ipcArgs.Set(3, &arg3Ptr);
--- a/persistentstorage/sql/SRC/Client/SqlDbSession.h	Tue Jul 06 16:18:30 2010 +0300
+++ b/persistentstorage/sql/SRC/Client/SqlDbSession.h	Wed Aug 18 11:30:17 2010 +0300
@@ -18,7 +18,6 @@
 
 #include <sqldb.h>			//RSqlDatabase::TIsolationLevel
 #include "SqlUtil.h"		//TSqlSrvFunction
-#include "UTraceSql.h"
 
 //Forward declarations
 struct sqlite3;
--- a/persistentstorage/sql/SRC/Client/SqlDbSession.inl	Tue Jul 06 16:18:30 2010 +0300
+++ b/persistentstorage/sql/SRC/Client/SqlDbSession.inl	Wed Aug 18 11:30:17 2010 +0300
@@ -223,8 +223,6 @@
 */
 inline TInt RSqlDbSession::SendReceive(TInt aFunction)
 	{
-	SYMBIAN_TRACE_SQL_EVENTS_ONLY(TPtrC8 funcStr = GetIPCFuncStr(aFunction));
-	SYMBIAN_TRACE_SQL_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EBorder), KDbMsgStr, &funcStr));
 	return RSessionBase::SendReceive(aFunction);	
 	}
 
@@ -237,8 +235,6 @@
 */
 inline void RSqlDbSession::SendReceive(TInt aFunction, TRequestStatus& aStatus)
 	{
-	SYMBIAN_TRACE_SQL_EVENTS_ONLY(TPtrC8 funcStr = GetIPCFuncStr(aFunction));
-	SYMBIAN_TRACE_SQL_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EBorder), KDbMsgStr, &funcStr));
 	RSessionBase::SendReceive(aFunction, aStatus);
 	}
 
@@ -252,8 +248,6 @@
 */
 inline TInt RSqlDbSession::SendReceive(TInt aFunction, const TIpcArgs& aArgs)
 	{
-	SYMBIAN_TRACE_SQL_EVENTS_ONLY(TPtrC8 funcStr = GetIPCFuncStr(aFunction));
-	SYMBIAN_TRACE_SQL_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EBorder), KDbMsgStr, &funcStr));
 	return RSessionBase::SendReceive(aFunction, aArgs);	
 	}
 	
@@ -266,7 +260,5 @@
 */
 inline void RSqlDbSession::SendReceive(TInt aFunction,const TIpcArgs& aArgs, TRequestStatus& aStatus)
 	{
-	SYMBIAN_TRACE_SQL_EVENTS_ONLY(TPtrC8 funcStr = GetIPCFuncStr(aFunction));
-	SYMBIAN_TRACE_SQL_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EBorder), KDbMsgStr, &funcStr));
 	RSessionBase::SendReceive(aFunction, aArgs, aStatus);	
 	}
--- a/persistentstorage/sql/SRC/Client/SqlResourceProfiler.cpp	Tue Jul 06 16:18:30 2010 +0300
+++ b/persistentstorage/sql/SRC/Client/SqlResourceProfiler.cpp	Wed Aug 18 11:30:17 2010 +0300
@@ -14,7 +14,7 @@
 //
 
 #include "SqlResourceProfiler.h"
-#include "SqlPanic.h"
+#include "SqlAssert.h"
 #include "SqlDatabaseImpl.h"
 
 
--- a/persistentstorage/sql/SRC/Client/SqlResourceTest.cpp	Tue Jul 06 16:18:30 2010 +0300
+++ b/persistentstorage/sql/SRC/Client/SqlResourceTest.cpp	Wed Aug 18 11:30:17 2010 +0300
@@ -15,7 +15,7 @@
 
 #include <sqldb.h>				//TSqlResourceTester
 #include "SqlResourceTest.h"	//TSqlResourceTestData
-#include "SqlPanic.h"			//__SQLASSERT, ESqlPanicInternalError
+#include "SqlAssert.h"			//ESqlPanicInternalError
 #include "SqlDbSession.h"		//RSqlDbSession
 #include "SqlResourceTester.h"		//TSqlResourceTester
 
@@ -102,7 +102,7 @@
 */
 TInt TSqlResourceTestData::Set(TSqlSrvFunction aFunction, TInt aAllocFailType, TInt aRate)
 	{
-	__SQLASSERT(!iRqPending, ESqlPanicMisuse);
+	__ASSERT_DEBUG(!iRqPending, __SQLPANIC(ESqlPanicMisuse));
 	if(iDbSession)	
 		{
 		return iDbSession->SendReceive(aFunction, TIpcArgs(aAllocFailType, aRate));
--- a/persistentstorage/sql/SRC/Client/SqlScalarFullSelect.cpp	Tue Jul 06 16:18:30 2010 +0300
+++ b/persistentstorage/sql/SRC/Client/SqlScalarFullSelect.cpp	Wed Aug 18 11:30:17 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -13,8 +13,13 @@
 // Description:
 //
 
-#include "SqlPanic.h"			//ESqlPanicInvalidObj, ESqlPanicObjExists
+#include "SqlAssert.h"			//ESqlPanicInvalidObj, ESqlPanicObjExists
 #include "SqlDatabaseImpl.h"	//CSqlDatabaseImpl
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "SqlScalarFullSelectTraces.h"
+#endif
+#include "SqlTraceDef.h"
 
 /**
 Returns a reference to the implementation object of RSqlDatabase - CSqlDatabaseImpl.
@@ -25,7 +30,7 @@
 */
 inline CSqlDatabaseImpl& TSqlScalarFullSelectQuery::Impl() const
 	{
-	__SQLASSERT_ALWAYS(iDatabaseImpl != NULL, ESqlPanicInvalidObj);
+	__ASSERT_ALWAYS(iDatabaseImpl != NULL, __SQLPANIC(ESqlPanicInvalidObj));
 	return *iDatabaseImpl;	
 	}
 
@@ -46,6 +51,7 @@
 EXPORT_C TSqlScalarFullSelectQuery::TSqlScalarFullSelectQuery(RSqlDatabase& aDatabase) :
 	iDatabaseImpl(&aDatabase.Impl())
 	{
+	SQL_TRACE_BORDER(OstTraceExt3(TRACE_BORDER, TSQLSCALARFULLSELECTQUERY_TSQLSCALARFULLSELECTQUERY, "0x%X;TSqlScalarFullSelectQuery::TSqlScalarFullSelectQuery;aDatabase=0x%X;iDatabaseImpl=0x%X", (TUint)this, (TUint)&aDatabase, (TUint)iDatabaseImpl));
 	}
 	
 /**
@@ -56,8 +62,8 @@
 */
 EXPORT_C void TSqlScalarFullSelectQuery::SetDatabase(RSqlDatabase& aDatabase)
 	{
-	SQLUTRACE_PROFILER(this);
 	iDatabaseImpl = &aDatabase.Impl();
+    SQL_TRACE_BORDER(OstTraceExt3(TRACE_BORDER, TSQLSCALARFULLSELECTQUERY_SETDATABASE, "0x%X;TSqlScalarFullSelectQuery::SetDatabase;aDatabase=0x%X;iDatabaseImpl=0x%X", (TUint)this, (TUint)&aDatabase, (TUint)iDatabaseImpl));
 	}
 	
 /**
@@ -74,12 +80,11 @@
 */
 EXPORT_C TInt TSqlScalarFullSelectQuery::SelectIntL(const TDesC& aSqlStmt)
 	{
-	SQLUTRACE_PROFILER(this);
-	SYMBIAN_TRACE_SQL_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KStrParam16, 1, &aSqlStmt));
-
+    SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, TSQLSCALARFULLSELECTQUERY_SELECTINTL_ENTRY16, "Entry;0x%X;TSqlScalarFullSelectQuery::SelectIntL-16;aSqlStmt=%S", (TUint)this, __SQLPRNSTR(aSqlStmt)));
 	TInt res;
 	TPtr8 ptr(reinterpret_cast <TUint8*> (&res), sizeof(res));
 	(void)Impl().ExecScalarFullSelectL(aSqlStmt, ESqlInt, ptr);
+    SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, TSQLSCALARFULLSELECTQUERY_SELECTINTL_EXIT16, "Exit;0x%X;TSqlScalarFullSelectQuery::SelectIntL-16;res=%d", (TUint)this, res));
 	return res;
 	}
 	
@@ -97,12 +102,11 @@
 */
 EXPORT_C TInt64 TSqlScalarFullSelectQuery::SelectInt64L(const TDesC& aSqlStmt)
 	{
-	SQLUTRACE_PROFILER(this);
-	SYMBIAN_TRACE_SQL_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KStrParam16, 1, &aSqlStmt));
-
+    SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, TSQLSCALARFULLSELECTQUERY_SELECTINT64L_ENTRY16, "Entry;0x%X;TSqlScalarFullSelectQuery::SelectInt64L-16;aSqlStmt=%S", (TUint)this, __SQLPRNSTR(aSqlStmt)));
 	TInt64 res;
 	TPtr8 ptr(reinterpret_cast <TUint8*> (&res), sizeof(res));
 	(void)Impl().ExecScalarFullSelectL(aSqlStmt, ESqlInt64, ptr);
+	SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, TSQLSCALARFULLSELECTQUERY_SELECTINT64L_EXIT16, "Exit;0x%X;TSqlScalarFullSelectQuery::SelectInt64L-16;res=%lld", (TUint)this, res));
 	return res;
 	}
 	
@@ -120,12 +124,11 @@
 */
 EXPORT_C TReal TSqlScalarFullSelectQuery::SelectRealL(const TDesC& aSqlStmt)
 	{
-	SQLUTRACE_PROFILER(this);
-	SYMBIAN_TRACE_SQL_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KStrParam16, 1, &aSqlStmt));
-
+    SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, TSQLSCALARFULLSELECTQUERY_SELECTREALL_ENTRY16, "Entry;0x%X;TSqlScalarFullSelectQuery::SelectRealL-16;aSqlStmt=%S", (TUint)this, __SQLPRNSTR(aSqlStmt)));
 	TReal res;
 	TPtr8 ptr(reinterpret_cast <TUint8*> (&res), sizeof(res));
 	(void)Impl().ExecScalarFullSelectL(aSqlStmt, ESqlReal, ptr);
+    SQL_TRACE_BORDER(OstTrace1(TRACE_BORDER, TSQLSCALARFULLSELECTQUERY_SELECTREALL_EXIT16, "Exit;0x%X;TSqlScalarFullSelectQuery::SelectRealL-16", (TUint)this));
 	return res;
 	}
 	
@@ -149,13 +152,12 @@
 */
 EXPORT_C TInt TSqlScalarFullSelectQuery::SelectTextL(const TDesC& aSqlStmt, TDes& aDest)
 	{
-	SQLUTRACE_PROFILER(this);
-	SYMBIAN_TRACE_SQL_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KStrParam16, 1, &aSqlStmt));
-	
+    SQL_TRACE_BORDER(OstTraceExt5(TRACE_BORDER, TSQLSCALARFULLSELECTQUERY_SELECTTEXTL_ENTRY16, "Entry;0x%X;TSqlScalarFullSelectQuery::SelectTextL-16;aSqlStmt=%S;aDest.Ptr()=0x%X;aDest.Size()=%d;aDest.MaxSize()=%d", (TUint)this, __SQLPRNSTR(aSqlStmt), (TUint)aDest.Ptr(), aDest.Size(), aDest.MaxSize()));
 	TPtr8 ptr(reinterpret_cast <TUint8*> (const_cast <TUint16*> (aDest.Ptr())), aDest.MaxLength() * sizeof(TUint16));
-	TInt err = Impl().ExecScalarFullSelectL(aSqlStmt, ESqlText, ptr);
+	TInt rc = Impl().ExecScalarFullSelectL(aSqlStmt, ESqlText, ptr);
 	aDest.SetLength(ptr.Length() / sizeof(TUint16));
-	return err;
+    SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, TSQLSCALARFULLSELECTQUERY_SELECTTEXTL_EXIT16, "Exit;0x%X;TSqlScalarFullSelectQuery::SelectTextL-16;rc=%d", (TUint)this, rc));
+	return rc;
 	}
 	
 /**
@@ -178,10 +180,10 @@
 */
 EXPORT_C TInt TSqlScalarFullSelectQuery::SelectBinaryL(const TDesC& aSqlStmt, TDes8& aDest)
 	{
-	SQLUTRACE_PROFILER(this);
-	SYMBIAN_TRACE_SQL_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KStrParam16, 1, &aSqlStmt));
-	
-	return Impl().ExecScalarFullSelectL(aSqlStmt, ESqlBinary, aDest);
+    SQL_TRACE_BORDER(OstTraceExt5(TRACE_BORDER, TSQLSCALARFULLSELECTQUERY_SELECTBINARYL_ENTRY16, "Entry;0x%X;TSqlScalarFullSelectQuery::SelectBinaryL-16;aSqlStmt=%S;aDest.Ptr()=0x%X;aDest.Size()=%d;aDest.MaxSize()=%d", (TUint)this, __SQLPRNSTR(aSqlStmt), (TUint)aDest.Ptr(), aDest.Size(), aDest.MaxSize()));
+	TInt rc = Impl().ExecScalarFullSelectL(aSqlStmt, ESqlBinary, aDest);
+    SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, TSQLSCALARFULLSELECTQUERY_SELECTBINARYL_EXIT16, "Exit;0x%X;TSqlScalarFullSelectQuery::SelectBinaryL-16;rc=%d", (TUint)this, rc));
+	return rc;
 	}
 	
 /**
@@ -198,12 +200,12 @@
 */
 EXPORT_C TInt TSqlScalarFullSelectQuery::SelectIntL(const TDesC8& aSqlStmt)
 	{
-	SQLUTRACE_PROFILER(this);	
-	SYMBIAN_TRACE_SQL_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KStrParam, 1, &aSqlStmt));
-
+	__SQLTRACE_BORDERVAR(TBuf<100> des16prnbuf);
+    SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, TSQLSCALARFULLSELECTQUERY_SELECTINTL_ENTRY8, "Entry;0x%X;TSqlScalarFullSelectQuery::SelectIntL-8;aSqlStmt=%s", (TUint)this, __SQLPRNSTR8(aSqlStmt, des16prnbuf)));
 	TInt res;
 	TPtr8 ptr(reinterpret_cast <TUint8*> (&res), sizeof(res));
 	(void)Impl().ExecScalarFullSelectL(aSqlStmt, ESqlInt, ptr);
+    SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, TSQLSCALARFULLSELECTQUERY_SELECTINTL_EXIT8, "Exit;0x%X;TSqlScalarFullSelectQuery::SelectIntL-8;res=%d", (TUint)this, res));
 	return res;
 	}
 	
@@ -221,12 +223,12 @@
 */
 EXPORT_C TInt64 TSqlScalarFullSelectQuery::SelectInt64L(const TDesC8& aSqlStmt)
 	{
-	SQLUTRACE_PROFILER(this);
-	SYMBIAN_TRACE_SQL_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KStrParam, 1, &aSqlStmt));
-
+	__SQLTRACE_BORDERVAR(TBuf<100> des16prnbuf);
+	SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, TSQLSCALARFULLSELECTQUERY_SELECTINT64L_ENTRY8, "Entry;0x%X;TSqlScalarFullSelectQuery::SelectInt64L-8;aSqlStmt=%s", (TUint)this, __SQLPRNSTR8(aSqlStmt, des16prnbuf)));
 	TInt64 res;
 	TPtr8 ptr(reinterpret_cast <TUint8*> (&res), sizeof(res));
 	(void)Impl().ExecScalarFullSelectL(aSqlStmt, ESqlInt64, ptr);
+	SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, TSQLSCALARFULLSELECTQUERY_SELECTINT64L_EXIT8, "Exit;0x%X;TSqlScalarFullSelectQuery::SelectInt64L-8;res=%lld", (TUint)this, res));
 	return res;
 	}
 	
@@ -244,12 +246,12 @@
 */
 EXPORT_C TReal TSqlScalarFullSelectQuery::SelectRealL(const TDesC8& aSqlStmt)
 	{
-	SQLUTRACE_PROFILER(this);
-	SYMBIAN_TRACE_SQL_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KStrParam, 1, &aSqlStmt));
-	
+	__SQLTRACE_BORDERVAR(TBuf<100> des16prnbuf);
+    SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, TSQLSCALARFULLSELECTQUERY_SELECTREALL_ENTRY8, "Entry;0x%X;TSqlScalarFullSelectQuery::SelectRealL-8;aSqlStmt=%s", (TUint)this, __SQLPRNSTR8(aSqlStmt, des16prnbuf)));
 	TReal res;
 	TPtr8 ptr(reinterpret_cast <TUint8*> (&res), sizeof(res));
 	(void)Impl().ExecScalarFullSelectL(aSqlStmt, ESqlReal, ptr);
+    SQL_TRACE_BORDER(OstTrace1(TRACE_BORDER, TSQLSCALARFULLSELECTQUERY_SELECTREALL_EXIT8, "Exit;0x%X;TSqlScalarFullSelectQuery::SelectRealL-8", (TUint)this));
 	return res;
 	}
 	
@@ -273,13 +275,13 @@
 */
 EXPORT_C TInt TSqlScalarFullSelectQuery::SelectTextL(const TDesC8& aSqlStmt, TDes& aDest)
 	{
-	SQLUTRACE_PROFILER(this);
-	SYMBIAN_TRACE_SQL_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KStrParam, 1, &aSqlStmt));
-
+	__SQLTRACE_BORDERVAR(TBuf<100> des16prnbuf);
+    SQL_TRACE_BORDER(OstTraceExt5(TRACE_BORDER, TSQLSCALARFULLSELECTQUERY_SELECTTEXTL_ENTRY8, "Entry;0x%X;TSqlScalarFullSelectQuery::SelectTextL-8;aSqlStmt=%s;aDest.Ptr()=0x%X;aDest.Size()=%d;aDest.MaxSize()=%d", (TUint)this, __SQLPRNSTR8(aSqlStmt, des16prnbuf), (TUint)aDest.Ptr(), aDest.Size(), aDest.MaxSize()));
 	TPtr8 ptr(reinterpret_cast <TUint8*> (const_cast <TUint16*> (aDest.Ptr())), aDest.MaxLength() * sizeof(TUint16));
-	TInt err = Impl().ExecScalarFullSelectL(aSqlStmt, ESqlText, ptr);
+	TInt rc = Impl().ExecScalarFullSelectL(aSqlStmt, ESqlText, ptr);
 	aDest.SetLength(ptr.Length() / sizeof(TUint16));
-	return err;
+    SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, TSQLSCALARFULLSELECTQUERY_SELECTTEXTL_EXIT8, "Exit;0x%X;TSqlScalarFullSelectQuery::SelectTextL-8;rc=%d", (TUint)this, rc));
+	return rc;
 	}
 	
 /**
@@ -302,8 +304,9 @@
 */
 EXPORT_C TInt TSqlScalarFullSelectQuery::SelectBinaryL(const TDesC8& aSqlStmt, TDes8& aDest)
 	{
-	SQLUTRACE_PROFILER(this);
-	SYMBIAN_TRACE_SQL_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KStrParam, 1, &aSqlStmt));
-	
-	return Impl().ExecScalarFullSelectL(aSqlStmt, ESqlBinary, aDest);
+	__SQLTRACE_BORDERVAR(TBuf<100> des16prnbuf);
+    SQL_TRACE_BORDER(OstTraceExt5(TRACE_BORDER, TSQLSCALARFULLSELECTQUERY_SELECTBINARYL_ENTRY8, "Entry;0x%X;TSqlScalarFullSelectQuery::SelectBinaryL-8;aSqlStmt=%s;aDest.Ptr()=0x%X;aDest.Size()=%d;aDest.MaxSize()=%d", (TUint)this, __SQLPRNSTR8(aSqlStmt, des16prnbuf), (TUint)aDest.Ptr(), aDest.Size(), aDest.MaxSize()));
+	TInt rc = Impl().ExecScalarFullSelectL(aSqlStmt, ESqlBinary, aDest);
+    SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, TSQLSCALARFULLSELECTQUERY_SELECTBINARYL_EXIT8, "Exit;0x%X;TSqlScalarFullSelectQuery::SelectBinaryL-8;rc=%d", (TUint)this, rc));
+	return rc;
 	}
--- a/persistentstorage/sql/SRC/Client/SqlStatement.cpp	Tue Jul 06 16:18:30 2010 +0300
+++ b/persistentstorage/sql/SRC/Client/SqlStatement.cpp	Wed Aug 18 11:30:17 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2005-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -14,6 +14,11 @@
 //
 
 #include "SqlStatementImpl.h"		//CSqlStatementImpl
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "SqlStatementTraces.h"
+#endif
+#include "SqlTraceDef.h"
 
 /////////////////////////////////////////////////////////////////////////////////////////////////////////////
 
@@ -79,10 +84,10 @@
 */	
 EXPORT_C TInt RSqlStatement::Prepare(RSqlDatabase& aDatabase, const TDesC& aSqlStmt)
 	{
-	SQLUTRACE_PROFILER(this);
-	SYMBIAN_TRACE_SQL_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KHexStrParam16, &aDatabase, &aSqlStmt));
-
-	return CSqlStatementImpl::New(iImpl, aDatabase.Impl(), aSqlStmt);
+    SQL_TRACE_BORDER(OstTraceExt3(TRACE_BORDER, RSQLSTATEMENT_PREPARE16_ENTRY, "Entry;0x%X;RSqlStatement::Prepare16;aDatabase=0x%X;aSqlStmt=%S", (TUint)this, (TUint)&aDatabase, __SQLPRNSTR(aSqlStmt)));
+	TInt err = CSqlStatementImpl::New(iImpl, aDatabase.Impl(), aSqlStmt);
+    SQL_TRACE_BORDER(OstTraceExt3(TRACE_BORDER, RSQLSTATEMENT_PREPARE16_EXIT, "Exit;0x%X;RSqlStatement::Prepare16;iImpl=0x%X;err=%d", (TUint)this, (TUint)iImpl, err));
+	return err;
 	}
 	
 /**
@@ -138,11 +143,11 @@
 */	
 EXPORT_C TInt RSqlStatement::Prepare(RSqlDatabase& aDatabase, const TDesC8& aSqlStmt)
 	{
-	SQLUTRACE_PROFILER(this);
-	SYMBIAN_TRACE_SQL_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KHexStrParam, 
-			&aDatabase, &aSqlStmt));
-	
-	return CSqlStatementImpl::New(iImpl, aDatabase.Impl(), aSqlStmt);
+	__SQLTRACE_BORDERVAR(TBuf<100> des16prnbuf);
+    SQL_TRACE_BORDER(OstTraceExt3(TRACE_BORDER, RSQLSTATEMENT_PREPARE8_ENTRY, "Entry;0x%X;RSqlStatement::Prepare8;aDatabase=0x%X;aSqlStmt=%s", (TUint)this, (TUint)&aDatabase, __SQLPRNSTR8(aSqlStmt, des16prnbuf)));
+	TInt err = CSqlStatementImpl::New(iImpl, aDatabase.Impl(), aSqlStmt);
+    SQL_TRACE_BORDER(OstTraceExt3(TRACE_BORDER, RSQLSTATEMENT_PREPARE8_EXIT, "Exit;0x%X;RSqlStatement::Prepare8;iImpl=0x%X;err=%d", (TUint)this, (TUint)iImpl, err));
+	return err;
 	}
 
 /**
@@ -196,11 +201,9 @@
 */
 EXPORT_C void RSqlStatement::PrepareL(RSqlDatabase& aDatabase, const TDesC& aSqlStmt)
 	{
-	SQLUTRACE_PROFILER(this);
-	SYMBIAN_TRACE_SQL_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KHexStrParam16, 
-			&aDatabase, &aSqlStmt));
-	
+    SQL_TRACE_BORDER(OstTraceExt3(TRACE_BORDER, RSQLSTATEMENT_PREPARE16L_ENTRY, "Entry;0x%X;RSqlStatement::Prepare16L;aDatabase=0x%X;aSqlStmt=%S", (TUint)this, (TUint)&aDatabase, __SQLPRNSTR(aSqlStmt)));
 	__SQLLEAVE_IF_ERROR(Prepare(aDatabase, aSqlStmt));
+    SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, RSQLSTATEMENT_PREPARE16L_EXIT, "Exit;0x%X;RSqlStatement::Prepare16L;iImpl=0x%X", (TUint)this, (TUint)iImpl));
 	}
 	
 /**
@@ -255,11 +258,10 @@
 */
 EXPORT_C void RSqlStatement::PrepareL(RSqlDatabase& aDatabase, const TDesC8& aSqlStmt)
 	{
-	SQLUTRACE_PROFILER(this);
-	SYMBIAN_TRACE_SQL_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KHexStrParam, 
-			&aDatabase, &aSqlStmt));
-
+	__SQLTRACE_BORDERVAR(TBuf<100> des16prnbuf);
+    SQL_TRACE_BORDER(OstTraceExt3(TRACE_BORDER, RSQLSTATEMENT_PREPARE8L_ENTRY, "Entry;0x%X;RSqlStatement::Prepare8L;aDatabase=0x%X;aSqlStmt=%s", (TUint)this, (TUint)&aDatabase, __SQLPRNSTR8(aSqlStmt, des16prnbuf)));
 	__SQLLEAVE_IF_ERROR(Prepare(aDatabase, aSqlStmt));
+    SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, RSQLSTATEMENT_PREPARE8L_EXIT, "Exit;0x%X;RSqlStatement::Prepare8L;iImpl=0x%X", (TUint)this, (TUint)iImpl));
 	}
 
 
@@ -274,8 +276,9 @@
 */	
 EXPORT_C void RSqlStatement::Close()
 	{
-	SQLUTRACE_PROFILER(this);
+    SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, RSQLSTATEMENT_CLOSE_ENTRY, "Entry;0x%X;RSqlStatement::Close;iImpl=0x%X", (TUint)this, (TUint)iImpl));
 	delete iImpl;
+    SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, RSQLSTATEMENT_CLOSE_EXIT, "Exit;0x%X;RSqlStatement::Close;iImpl=0x%X", (TUint)this, (TUint)iImpl));
 	iImpl = NULL;
 	}
 
@@ -288,7 +291,6 @@
 */
 EXPORT_C TBool RSqlStatement::AtRow() const
 	{
-	SQLUTRACE_PROFILER(this);
 	return Impl().AtRow();
 	}
 	
@@ -352,8 +354,10 @@
 */	
 EXPORT_C TInt RSqlStatement::Reset()
 	{
-	SQLUTRACE_PROFILER(this);
-	return Impl().Reset();
+    SQL_TRACE_BORDER(OstTrace1(TRACE_BORDER, RSQLSTATEMENT_RESET_ENTRY, "Entry;0x%X;RSqlStatement::Reset", (TUint)this));
+	TInt err = Impl().Reset();
+    SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, RSQLSTATEMENT_RESET_EXIT, "Exit;0x%X;RSqlStatement::Reset;err=%d", (TUint)this, err));
+	return err;
 	}
 	
 /**
@@ -412,8 +416,10 @@
 */	
 EXPORT_C TInt RSqlStatement::Exec()
 	{
-	SQLUTRACE_PROFILER(this);
-	return Impl().Exec();
+    SQL_TRACE_BORDER(OstTrace1(TRACE_BORDER, RSQLSTATEMENT_EXEC_ENTRY, "Entry;0x%X;RSqlStatement::Exec", (TUint)this));
+	TInt err = Impl().Exec();
+    SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, RSQLSTATEMENT_EXEC_EXIT, "Exit;0x%X;RSqlStatement::Exec;err=%d", (TUint)this, err));
+	return err;
 	}
 
 /**
@@ -463,8 +469,9 @@
 */	
 EXPORT_C void RSqlStatement::Exec(TRequestStatus& aStatus)
 	{
-	SQLUTRACE_PROFILER(this);
+    SQL_TRACE_BORDER(OstTrace1(TRACE_BORDER, RSQLSTATEMENT_EXECASYNC_ENTRY, "Entry;0x%X;RSqlStatement::ExecAsync", (TUint)this));
 	Impl().Exec(aStatus);
+    SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, RSQLSTATEMENT_EXECASYNC_EXIT, "Exit;0x%X;RSqlStatement::ExecAsync;aStatus.Int()=%d", (TUint)this, aStatus.Int()));
 	}
 	
 /**
@@ -513,8 +520,10 @@
 */	
 EXPORT_C TInt RSqlStatement::Next()
 	{
-	SQLUTRACE_PROFILER(this);
-	return Impl().Next();
+    SQL_TRACE_BORDER(OstTrace1(TRACE_BORDER, RSQLSTATEMENT_NEXT_ENTRY, "Entry;0x%X;RSqlStatement::Next", (TUint)this));
+	TInt err = Impl().Next();
+    SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, RSQLSTATEMENT_NEXT_EXIT, "Exit;0x%X;RSqlStatement::Next;err=%d", (TUint)this, err));
+	return err;
 	}
 
 /**
@@ -537,9 +546,6 @@
 */	
 EXPORT_C TInt RSqlStatement::ParameterIndex(const TDesC& aParameterName) const
 	{
-	SQLUTRACE_PROFILER(this);
-	SYMBIAN_TRACE_SQL_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KStrParam16, 1, &aParameterName));
-
 	return Impl().ParamIndex(aParameterName);
 	}
 
@@ -555,7 +561,6 @@
 */	
 EXPORT_C TInt RSqlStatement::ColumnCount() const
 	{
-	SQLUTRACE_PROFILER(this);
 	return Impl().ColumnCount();
 	}
 	
@@ -576,9 +581,6 @@
 */	
 EXPORT_C TInt RSqlStatement::ColumnIndex(const TDesC& aColumnName) const
 	{
-	SQLUTRACE_PROFILER(this);
-	SYMBIAN_TRACE_SQL_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KStrParam16, 1, &aColumnName));
-
 	return Impl().ColumnIndex(aColumnName);
 	}
 	
@@ -609,9 +611,6 @@
 */	
 EXPORT_C TSqlColumnType RSqlStatement::ColumnType(TInt aColumnIndex) const
 	{
-	SQLUTRACE_PROFILER(this);
-	SYMBIAN_TRACE_SQL_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KIntParam, 1, aColumnIndex));
-
 	return Impl().ColumnType(aColumnIndex);
 	}
 
@@ -650,9 +649,6 @@
 */	
 EXPORT_C TInt RSqlStatement::DeclaredColumnType(TInt aColumnIndex, TSqlColumnType& aColumnType) const
 	{
-	SQLUTRACE_PROFILER(this);
-	SYMBIAN_TRACE_SQL_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KIntParam, 1, aColumnIndex));
-
 	return Impl().DeclaredColumnType(aColumnIndex, aColumnType);
 	}
 	
@@ -700,9 +696,6 @@
 */	
 EXPORT_C TInt RSqlStatement::ColumnSize(TInt aColumnIndex) const
 	{
-	SQLUTRACE_PROFILER(this);
-	SYMBIAN_TRACE_SQL_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KIntParam, 1, aColumnIndex));
-
 	return Impl().ColumnSize(aColumnIndex);
 	}
 
@@ -733,9 +726,6 @@
 */	
 EXPORT_C TInt RSqlStatement::BindNull(TInt aParamIndex)
 	{
-	SQLUTRACE_PROFILER(this);
-	SYMBIAN_TRACE_SQL_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KIntParam, 1, aParamIndex));
-	
 	return Impl().BindNull(aParamIndex);
 	}
 	
@@ -764,9 +754,6 @@
 */	
 EXPORT_C TInt RSqlStatement::BindInt(TInt aParamIndex, TInt aParamValue)
 	{
-	SQLUTRACE_PROFILER(this);
-	SYMBIAN_TRACE_SQL_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KIntParam, 1, aParamIndex));
-	
 	return Impl().BindInt(aParamIndex, aParamValue);
 	}
 	
@@ -795,9 +782,6 @@
 */	
 EXPORT_C TInt RSqlStatement::BindInt64(TInt aParamIndex, TInt64 aParamValue)
 	{
-	SQLUTRACE_PROFILER(this);
-	SYMBIAN_TRACE_SQL_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KIntParam, 1, aParamIndex));
-	
 	return Impl().BindInt64(aParamIndex, aParamValue);
 	}
 	
@@ -826,9 +810,6 @@
 */	
 EXPORT_C TInt RSqlStatement::BindReal(TInt aParamIndex, TReal aParamValue)
 	{
-	SQLUTRACE_PROFILER(this);
-	SYMBIAN_TRACE_SQL_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KIntParam, 1, aParamIndex));
-
 	return Impl().BindReal(aParamIndex, aParamValue);
 	}
 	
@@ -872,10 +853,6 @@
 */	
 EXPORT_C TInt RSqlStatement::BindText(TInt aParamIndex, const TDesC& aParamText)
 	{
-	SQLUTRACE_PROFILER(this);
-	SYMBIAN_TRACE_SQL_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KIntSizeParam, 
-			aParamIndex, aParamText.Length()));
-	
 	return Impl().BindText(aParamIndex, aParamText);
 	}
 	
@@ -917,10 +894,6 @@
 */	
 EXPORT_C TInt RSqlStatement::BindBinary(TInt aParamIndex, const TDesC8& aParamData)
 	{
-	SQLUTRACE_PROFILER(this);
-	SYMBIAN_TRACE_SQL_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KIntSizeParam, 
-			aParamIndex, aParamData.Length()));
-	
 	return Impl().BindBinary(aParamIndex, aParamData);
 	}
 	
@@ -969,10 +942,6 @@
 */	
 EXPORT_C TInt RSqlStatement::BindZeroBlob(TInt aParamIndex, TInt aBlobSize)
 	{
-	SQLUTRACE_PROFILER(this);
-	SYMBIAN_TRACE_SQL_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KIntSizeParam, 
-			aParamIndex, aBlobSize));
-	
 	return Impl().BindZeroBlob(aParamIndex, aBlobSize);
 	}
 
@@ -1005,9 +974,6 @@
 */	
 EXPORT_C TBool RSqlStatement::IsNull(TInt aColumnIndex) const
 	{
-	SQLUTRACE_PROFILER(this);
-	SYMBIAN_TRACE_SQL_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KIntParam, 1, aColumnIndex));
-
 	return Impl().ColumnType(aColumnIndex) == ESqlNull;
 	}
 
@@ -1035,9 +1001,6 @@
 */	
 EXPORT_C TInt RSqlStatement::ColumnInt(TInt aColumnIndex) const
 	{
-	SQLUTRACE_PROFILER(this);
-	SYMBIAN_TRACE_SQL_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KIntParam, 1, aColumnIndex));
-
 	return Impl().ColumnInt(aColumnIndex);
 	}
 	
@@ -1065,9 +1028,6 @@
 */	
 EXPORT_C TInt64 RSqlStatement::ColumnInt64(TInt aColumnIndex) const
 	{
-	SQLUTRACE_PROFILER(this);
-	SYMBIAN_TRACE_SQL_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KIntParam, 1, aColumnIndex));
-
 	return Impl().ColumnInt64(aColumnIndex);
 	}
 	
@@ -1095,9 +1055,6 @@
 */	
 EXPORT_C TReal RSqlStatement::ColumnReal(TInt aColumnIndex) const
 	{
-	SQLUTRACE_PROFILER(this);
-	SYMBIAN_TRACE_SQL_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KIntParam, 1, aColumnIndex));
-
 	return Impl().ColumnReal(aColumnIndex);
 	}
 
@@ -1140,9 +1097,6 @@
 */
 EXPORT_C TPtrC RSqlStatement::ColumnTextL(TInt aColumnIndex) const
 	{
-	SQLUTRACE_PROFILER(this);
-	SYMBIAN_TRACE_SQL_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KIntParam, 1, aColumnIndex));
-
 	TPtrC res;
 	__SQLLEAVE_IF_ERROR(Impl().ColumnText(aColumnIndex, res));
 	return res;
@@ -1184,9 +1138,6 @@
 */	
 EXPORT_C TInt RSqlStatement::ColumnText(TInt aColumnIndex, TPtrC& aPtr) const
 	{
-	SQLUTRACE_PROFILER(this);
-	SYMBIAN_TRACE_SQL_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KIntParam, 1, aColumnIndex));
-
 	return Impl().ColumnText(aColumnIndex, aPtr);
 	}
 	
@@ -1228,9 +1179,6 @@
 */	
 EXPORT_C TInt RSqlStatement::ColumnText(TInt aColumnIndex, TDes& aDest) const
 	{
-	SQLUTRACE_PROFILER(this);
-	SYMBIAN_TRACE_SQL_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KIntParam, 1, aColumnIndex));
-
 	return Impl().ColumnText(aColumnIndex, aDest);
 	}
 
@@ -1273,9 +1221,6 @@
 */
 EXPORT_C TPtrC8 RSqlStatement::ColumnBinaryL(TInt aColumnIndex) const
 	{
-	SQLUTRACE_PROFILER(this);
-	SYMBIAN_TRACE_SQL_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KIntParam, 1, aColumnIndex));
-
 	TPtrC8 res;
 	__SQLLEAVE_IF_ERROR(Impl().ColumnBinary(aColumnIndex, res));
 	return res;
@@ -1317,9 +1262,6 @@
 */	
 EXPORT_C TInt RSqlStatement::ColumnBinary(TInt aColumnIndex, TPtrC8& aPtr) const
 	{
-	SQLUTRACE_PROFILER(this);
-	SYMBIAN_TRACE_SQL_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KIntParam, 1, aColumnIndex));
-
    	return Impl().ColumnBinary(aColumnIndex, aPtr);
 	}
 	
@@ -1361,9 +1303,6 @@
 */	
 EXPORT_C TInt RSqlStatement::ColumnBinary(TInt aColumnIndex, TDes8& aDest) const
 	{
-	SQLUTRACE_PROFILER(this);
-	SYMBIAN_TRACE_SQL_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KIntParam, 1, aColumnIndex));
-	
    	return Impl().ColumnBinary(aColumnIndex, aDest);
 	}
 
@@ -1377,9 +1316,6 @@
 */
 EXPORT_C TInt RSqlStatement::ColumnName(TInt aColumnIndex, TPtrC& aNameDest)
 	{
-	SQLUTRACE_PROFILER(this);
-	SYMBIAN_TRACE_SQL_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KIntParam, 1, aColumnIndex));
-	
 	return Impl().ColumnName(aColumnIndex, aNameDest);
 	}
 
@@ -1398,9 +1334,6 @@
 */
 EXPORT_C TInt RSqlStatement::ParameterName(TInt aParameterIndex, TPtrC& aNameDest)
 	{
-	SQLUTRACE_PROFILER(this);
-	SYMBIAN_TRACE_SQL_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KIntParam, 1, aParameterIndex));
-	
 	return Impl().ParameterName(aParameterIndex, aNameDest);
 	}
 
@@ -1440,6 +1373,6 @@
 */
 CSqlStatementImpl& RSqlStatement::Impl() const
 	{
-	__SQLASSERT_ALWAYS(iImpl != NULL, ESqlPanicInvalidObj);
+	__ASSERT_ALWAYS(iImpl != NULL, __SQLPANIC(ESqlPanicInvalidObj));
 	return *iImpl;	
 	}
--- a/persistentstorage/sql/SRC/Client/SqlStatementImpl.cpp	Tue Jul 06 16:18:30 2010 +0300
+++ b/persistentstorage/sql/SRC/Client/SqlStatementImpl.cpp	Wed Aug 18 11:30:17 2010 +0300
@@ -45,8 +45,8 @@
 */
 TBool RSqlLongColumnColl::TData::Compare(const TInt* aIndex, const RSqlLongColumnColl::TData& aData)
 	{
-	__SQLASSERT(aIndex != NULL, ESqlPanicBadArgument);
-	__SQLASSERT(*aIndex >= 0, ESqlPanicBadArgument);
+	__ASSERT_DEBUG(aIndex != NULL, __SQLPANIC2(ESqlPanicBadArgument));
+	__ASSERT_DEBUG(*aIndex >= 0, __SQLPANIC2(ESqlPanicBadArgument));
 	return *aIndex == aData.iIndex;
 	}
 
@@ -63,8 +63,8 @@
 */
 TInt RSqlLongColumnColl::Append(RSqlLongColumnColl::TColumnReader& aReader, TInt aColumnIndex, TInt aColumnSize)
 	{
-	__SQLASSERT(aColumnIndex >= 0, ESqlPanicBadArgument);
-	__SQLASSERT(aColumnSize >= KSqlMaxDesLen, ESqlPanicBadArgument);
+	__ASSERT_DEBUG(aColumnIndex >= 0, __SQLPANIC(ESqlPanicBadArgument));
+	__ASSERT_DEBUG(aColumnSize >= KSqlMaxDesLen, __SQLPANIC(ESqlPanicBadArgument));
 	LONGCOL_INVARIANT();
 	HBufC8* colBuf = HBufC8::New(aColumnSize);
 	if(!colBuf)
@@ -96,11 +96,11 @@
 	for(TInt i=iValues.Count()-1;i>=0;--i)
 		{
 		const RSqlLongColumnColl::TData& data = iValues[i];
-		__SQLASSERT(data.iIndex >= 0, ESqlPanicInternalError);
-		__SQLASSERT(data.iData != NULL, ESqlPanicInternalError);
+		__ASSERT_DEBUG(data.iIndex >= 0, __SQLPANIC(ESqlPanicInternalError));
+		__ASSERT_DEBUG(data.iData != NULL, __SQLPANIC(ESqlPanicInternalError));
 		for(TInt j=i-1;j>=0;--j)
 			{
-			__SQLASSERT(data.iIndex != iValues[j].iIndex, ESqlPanicInternalError);
+			__ASSERT_DEBUG(data.iIndex != iValues[j].iIndex, __SQLPANIC(ESqlPanicInternalError));
 			}
 		}
 	}
@@ -318,7 +318,7 @@
 */	
 TInt CSqlStatementImpl::BindNull(TInt aParamIndex)
 	{
-	__SQLASSERT_ALWAYS((TUint)aParamIndex < (TUint)iParamCnt, ESqlPanicBadColumnIndex);
+	__ASSERT_ALWAYS((TUint)aParamIndex < (TUint)iParamCnt, __SQLPANIC(ESqlPanicBadColumnIndex));
 	iBound = EFalse;
 	iParamValBufIt.MoveTo(aParamIndex);
 	iParamValBufIt.SetNull();
@@ -334,7 +334,7 @@
 */	
 TInt CSqlStatementImpl::BindInt(TInt aParamIndex, TInt aParamValue)
 	{
-	__SQLASSERT_ALWAYS((TUint)aParamIndex < (TUint)iParamCnt, ESqlPanicBadColumnIndex);
+	__ASSERT_ALWAYS((TUint)aParamIndex < (TUint)iParamCnt, __SQLPANIC(ESqlPanicBadColumnIndex));
 	iBound = EFalse;
 	iParamValBufIt.MoveTo(aParamIndex);
 	return iParamValBufIt.SetInt(aParamValue);
@@ -349,7 +349,7 @@
 */	
 TInt CSqlStatementImpl::BindInt64(TInt aParamIndex, TInt64 aParamValue)
 	{
-	__SQLASSERT_ALWAYS((TUint)aParamIndex < (TUint)iParamCnt, ESqlPanicBadColumnIndex);
+	__ASSERT_ALWAYS((TUint)aParamIndex < (TUint)iParamCnt, __SQLPANIC(ESqlPanicBadColumnIndex));
 	iBound = EFalse;
 	iParamValBufIt.MoveTo(aParamIndex);
 	return iParamValBufIt.SetInt64(aParamValue);
@@ -364,7 +364,7 @@
 */	
 TInt CSqlStatementImpl::BindReal(TInt aParamIndex, TReal aParamValue)
 	{
-	__SQLASSERT_ALWAYS((TUint)aParamIndex < (TUint)iParamCnt, ESqlPanicBadColumnIndex);
+	__ASSERT_ALWAYS((TUint)aParamIndex < (TUint)iParamCnt, __SQLPANIC(ESqlPanicBadColumnIndex));
 	iBound = EFalse;
 	iParamValBufIt.MoveTo(aParamIndex);
 	return iParamValBufIt.SetReal(aParamValue);
@@ -379,7 +379,7 @@
 */	
 TInt CSqlStatementImpl::BindText(TInt aParamIndex, const TDesC& aParamText)
 	{
-	__SQLASSERT_ALWAYS((TUint)aParamIndex < (TUint)iParamCnt, ESqlPanicBadColumnIndex);
+	__ASSERT_ALWAYS((TUint)aParamIndex < (TUint)iParamCnt, __SQLPANIC(ESqlPanicBadColumnIndex));
 	iBound = EFalse;
 	iParamValBufIt.MoveTo(aParamIndex);
 	return iParamValBufIt.SetText(aParamText);
@@ -394,7 +394,7 @@
 */	
 TInt CSqlStatementImpl::BindBinary(TInt aParamIndex, const TDesC8& aParamData)
 	{
-	__SQLASSERT_ALWAYS((TUint)aParamIndex < (TUint)iParamCnt, ESqlPanicBadColumnIndex);
+	__ASSERT_ALWAYS((TUint)aParamIndex < (TUint)iParamCnt, __SQLPANIC(ESqlPanicBadColumnIndex));
 	iBound = EFalse;
 	iParamValBufIt.MoveTo(aParamIndex);
 	return iParamValBufIt.SetBinary(aParamData);
@@ -409,7 +409,7 @@
 */	
 TInt CSqlStatementImpl::BindZeroBlob(TInt aParamIndex, TInt aBlobSize)
 	{
-	__SQLASSERT_ALWAYS((TUint)aParamIndex < (TUint)iParamCnt, ESqlPanicBadColumnIndex);
+	__ASSERT_ALWAYS((TUint)aParamIndex < (TUint)iParamCnt, __SQLPANIC(ESqlPanicBadColumnIndex));
 	iBound = EFalse;
 	iParamValBufIt.MoveTo(aParamIndex);
 	return iParamValBufIt.SetZeroBlob(aBlobSize);
@@ -425,8 +425,8 @@
 */	
 TSqlColumnType CSqlStatementImpl::ColumnType(TInt aColumnIndex)
 	{
-	__SQLASSERT_ALWAYS((TUint)aColumnIndex < (TUint)iColumnCnt, ESqlPanicBadColumnIndex);
-	__SQLASSERT_ALWAYS(iState == CSqlStatementImpl::EAtRow, ESqlPanicInvalidRow);
+	__ASSERT_ALWAYS((TUint)aColumnIndex < (TUint)iColumnCnt, __SQLPANIC(ESqlPanicBadColumnIndex));
+	__ASSERT_ALWAYS(iState == CSqlStatementImpl::EAtRow, __SQLPANIC(ESqlPanicInvalidRow));
 	iColumnValBufIt.MoveTo(aColumnIndex);		
 	return static_cast <TSqlColumnType> (iColumnValBufIt.Type());
 	}
@@ -447,7 +447,7 @@
 */
 TInt CSqlStatementImpl::DeclaredColumnType(TInt aColumnIndex, TSqlColumnType& aColumnType)
 	{
-	__SQLASSERT_ALWAYS((TUint)aColumnIndex < (TUint)iColumnCnt, ESqlPanicBadColumnIndex);
+	__ASSERT_ALWAYS((TUint)aColumnIndex < (TUint)iColumnCnt, __SQLPANIC(ESqlPanicBadColumnIndex));
 	if(iDeclaredColumnTypes.Count() == 0) //initialise iDeclaredColumnTypes array if necessary
 		{
 		RSqlBufFlat declaredColumnTypeBuf;
@@ -506,10 +506,10 @@
 				colType = ESqlReal;
 				}
 			err = iDeclaredColumnTypes.Append(colType);
-			__SQLASSERT(err == KErrNone, ESqlPanicInternalError);//memory for the array elements has been reserved already
+			__ASSERT_DEBUG(err == KErrNone, __SQLPANIC(ESqlPanicInternalError));//memory for the array elements has been reserved already
 			++colIdx;
 			} //end of - while(declColumnTypeBufIt.Next())
-		__SQLASSERT(colIdx == iColumnCnt, ESqlPanicInternalError);
+		__ASSERT_DEBUG(colIdx == iColumnCnt, __SQLPANIC(ESqlPanicInternalError));
 		declaredColumnTypeBuf.Close();
 		} //end of - if(iDeclaredColumnTypes.Count() == 0 && iColumnCnt > 0)
 	aColumnType = iDeclaredColumnTypes[aColumnIndex];
@@ -526,8 +526,8 @@
 */	
 TInt CSqlStatementImpl::ColumnSize(TInt aColumnIndex)
 	{
-	__SQLASSERT_ALWAYS((TUint)aColumnIndex < (TUint)iColumnCnt, ESqlPanicBadColumnIndex);
-	__SQLASSERT_ALWAYS(iState == CSqlStatementImpl::EAtRow, ESqlPanicInvalidRow);
+	__ASSERT_ALWAYS((TUint)aColumnIndex < (TUint)iColumnCnt, __SQLPANIC(ESqlPanicBadColumnIndex));
+	__ASSERT_ALWAYS(iState == CSqlStatementImpl::EAtRow, __SQLPANIC(ESqlPanicInvalidRow));
 	iColumnValBufIt.MoveTo(aColumnIndex);		
 	return iColumnValBufIt.Size();
 	}
@@ -542,10 +542,10 @@
 */	
 TInt CSqlStatementImpl::ColumnInt(TInt aColumnIndex)
 	{
-	__SQLASSERT_ALWAYS((TUint)aColumnIndex < (TUint)iColumnCnt, ESqlPanicBadColumnIndex);
-	__SQLASSERT_ALWAYS(iState == CSqlStatementImpl::EAtRow, ESqlPanicInvalidRow);
+	__ASSERT_ALWAYS((TUint)aColumnIndex < (TUint)iColumnCnt, __SQLPANIC(ESqlPanicBadColumnIndex));
+	__ASSERT_ALWAYS(iState == CSqlStatementImpl::EAtRow, __SQLPANIC(ESqlPanicInvalidRow));
 	iColumnValBufIt.MoveTo(aColumnIndex);		
-	__SQLASSERT(iColumnValBufIt.IsPresent(), ESqlPanicValueNotPresent);
+	__ASSERT_DEBUG(iColumnValBufIt.IsPresent(), __SQLPANIC(ESqlPanicValueNotPresent));
 	return iColumnValBufIt.Int();
 	}
 	
@@ -559,10 +559,10 @@
 */	
 TInt64 CSqlStatementImpl::ColumnInt64(TInt aColumnIndex)
 	{
-	__SQLASSERT_ALWAYS((TUint)aColumnIndex < (TUint)iColumnCnt, ESqlPanicBadColumnIndex);
-	__SQLASSERT_ALWAYS(iState == CSqlStatementImpl::EAtRow, ESqlPanicInvalidRow);
+	__ASSERT_ALWAYS((TUint)aColumnIndex < (TUint)iColumnCnt, __SQLPANIC(ESqlPanicBadColumnIndex));
+	__ASSERT_ALWAYS(iState == CSqlStatementImpl::EAtRow, __SQLPANIC(ESqlPanicInvalidRow));
 	iColumnValBufIt.MoveTo(aColumnIndex);		
-	__SQLASSERT(iColumnValBufIt.IsPresent(), ESqlPanicValueNotPresent);
+	__ASSERT_DEBUG(iColumnValBufIt.IsPresent(), __SQLPANIC(ESqlPanicValueNotPresent));
 	return iColumnValBufIt.Int64();
 	}
 	
@@ -576,10 +576,10 @@
 */	
 TReal CSqlStatementImpl::ColumnReal(TInt aColumnIndex)
 	{
-	__SQLASSERT_ALWAYS((TUint)aColumnIndex < (TUint)iColumnCnt, ESqlPanicBadColumnIndex);
-	__SQLASSERT_ALWAYS(iState == CSqlStatementImpl::EAtRow, ESqlPanicInvalidRow);
+	__ASSERT_ALWAYS((TUint)aColumnIndex < (TUint)iColumnCnt, __SQLPANIC(ESqlPanicBadColumnIndex));
+	__ASSERT_ALWAYS(iState == CSqlStatementImpl::EAtRow, __SQLPANIC(ESqlPanicInvalidRow));
 	iColumnValBufIt.MoveTo(aColumnIndex);		
-	__SQLASSERT(iColumnValBufIt.IsPresent(), ESqlPanicValueNotPresent);
+	__ASSERT_DEBUG(iColumnValBufIt.IsPresent(), __SQLPANIC(ESqlPanicValueNotPresent));
 	return iColumnValBufIt.Real();
 	}
 
@@ -597,8 +597,8 @@
 */	
 TInt CSqlStatementImpl::ColumnText(TInt aColumnIndex, TPtrC& aPtr)
 	{
-	__SQLASSERT_ALWAYS((TUint)aColumnIndex < (TUint)iColumnCnt, ESqlPanicBadColumnIndex);
-	__SQLASSERT_ALWAYS(iState == CSqlStatementImpl::EAtRow, ESqlPanicInvalidRow);
+	__ASSERT_ALWAYS((TUint)aColumnIndex < (TUint)iColumnCnt, __SQLPANIC(ESqlPanicBadColumnIndex));
+	__ASSERT_ALWAYS(iState == CSqlStatementImpl::EAtRow, __SQLPANIC(ESqlPanicInvalidRow));
 	iColumnValBufIt.MoveTo(aColumnIndex);		
 	if(iColumnValBufIt.IsPresent())
 		{
@@ -644,8 +644,8 @@
 */	
 TInt CSqlStatementImpl::ColumnText(TInt aColumnIndex, TDes& aDest)
 	{
-	__SQLASSERT_ALWAYS((TUint)aColumnIndex < (TUint)iColumnCnt, ESqlPanicBadColumnIndex);
-	__SQLASSERT_ALWAYS(iState == CSqlStatementImpl::EAtRow, ESqlPanicInvalidRow);
+	__ASSERT_ALWAYS((TUint)aColumnIndex < (TUint)iColumnCnt, __SQLPANIC(ESqlPanicBadColumnIndex));
+	__ASSERT_ALWAYS(iState == CSqlStatementImpl::EAtRow, __SQLPANIC(ESqlPanicInvalidRow));
 	iColumnValBufIt.MoveTo(aColumnIndex);		
 	TInt err = KErrNone;
 	//The text column value has not been transferred to the client side if its length is >= KSqlMaxDesLen characters.
@@ -697,8 +697,8 @@
 */	
 TInt CSqlStatementImpl::ColumnBinary(TInt aColumnIndex, TPtrC8& aPtr)
 	{
-	__SQLASSERT_ALWAYS((TUint)aColumnIndex < (TUint)iColumnCnt, ESqlPanicBadColumnIndex);
-	__SQLASSERT_ALWAYS(iState == CSqlStatementImpl::EAtRow, ESqlPanicInvalidRow);
+	__ASSERT_ALWAYS((TUint)aColumnIndex < (TUint)iColumnCnt, __SQLPANIC(ESqlPanicBadColumnIndex));
+	__ASSERT_ALWAYS(iState == CSqlStatementImpl::EAtRow, __SQLPANIC(ESqlPanicInvalidRow));
 	iColumnValBufIt.MoveTo(aColumnIndex);		
 	if(iColumnValBufIt.IsPresent())
 		{
@@ -744,8 +744,8 @@
 */	
 TInt CSqlStatementImpl::ColumnBinary(TInt aColumnIndex, TDes8& aDest)
 	{
-	__SQLASSERT_ALWAYS((TUint)aColumnIndex < (TUint)iColumnCnt, ESqlPanicBadColumnIndex);
-	__SQLASSERT_ALWAYS(iState == CSqlStatementImpl::EAtRow, ESqlPanicInvalidRow);
+	__ASSERT_ALWAYS((TUint)aColumnIndex < (TUint)iColumnCnt, __SQLPANIC(ESqlPanicBadColumnIndex));
+	__ASSERT_ALWAYS(iState == CSqlStatementImpl::EAtRow, __SQLPANIC(ESqlPanicInvalidRow));
 	iColumnValBufIt.MoveTo(aColumnIndex);		
 	TInt err = KErrNone;
 	//The binary column value has not been transferred to the client side if its length is >= KSqlMaxDesLen bytes.
--- a/persistentstorage/sql/SRC/Client/SqlStatementImpl.inl	Tue Jul 06 16:18:30 2010 +0300
+++ b/persistentstorage/sql/SRC/Client/SqlStatementImpl.inl	Wed Aug 18 11:30:17 2010 +0300
@@ -53,10 +53,10 @@
 */
 inline TPtrC RSqlLongColumnColl::Text(TInt aColumnIndex) const
 	{
-	__SQLASSERT(aColumnIndex >= 0, ESqlPanicBadArgument);
+	__ASSERT_DEBUG(aColumnIndex >= 0, __SQLPANIC(ESqlPanicBadArgument));
 	LONGCOL_INVARIANT();
 	TInt rc = FindValue(aColumnIndex);
-	__SQLASSERT_ALWAYS(rc >= 0, ESqlPanicInternalError);
+	__ASSERT_ALWAYS(rc >= 0, __SQLPANIC(ESqlPanicInternalError));
 	TPtrC8 ptr(iValues[rc].iData->Des());
 	return TPtrC(reinterpret_cast <const TUint16*> (ptr.Ptr()), ptr.Length() / sizeof(TUint16));
 	}
@@ -70,10 +70,10 @@
 */
 inline TPtrC8 RSqlLongColumnColl::Binary(TInt aColumnIndex) const
 	{
-	__SQLASSERT(aColumnIndex >= 0, ESqlPanicBadArgument);
+	__ASSERT_DEBUG(aColumnIndex >= 0, __SQLPANIC(ESqlPanicBadArgument));
 	LONGCOL_INVARIANT();
 	TInt rc = FindValue(aColumnIndex);
-	__SQLASSERT_ALWAYS(rc >= 0, ESqlPanicInternalError);
+	__ASSERT_ALWAYS(rc >= 0, __SQLPANIC(ESqlPanicInternalError));
 	return iValues[rc].iData->Des();
 	}
 
@@ -85,7 +85,7 @@
 */
 inline TBool RSqlLongColumnColl::IsPresent(TInt aColumnIndex) const
 	{
-	__SQLASSERT(aColumnIndex >= 0, ESqlPanicBadArgument);
+	__ASSERT_DEBUG(aColumnIndex >= 0, __SQLPANIC(ESqlPanicBadArgument));
 	LONGCOL_INVARIANT();
 	return FindValue(aColumnIndex) >= 0;
 	}
@@ -99,7 +99,7 @@
 */
 inline TInt RSqlLongColumnColl::FindValue(TInt aColumnIndex) const
 	{
-	__SQLASSERT(aColumnIndex >= 0, ESqlPanicBadArgument);
+	__ASSERT_DEBUG(aColumnIndex >= 0, __SQLPANIC(ESqlPanicBadArgument));
 	return iValues.Find(aColumnIndex, &RSqlLongColumnColl::TData::Compare);
 	}
 
@@ -113,8 +113,8 @@
 	iIndex(aIndex),
 	iData(aData)
 	{
-	__SQLASSERT(aIndex >= 0, ESqlPanicBadArgument);
-	__SQLASSERT(aData != NULL, ESqlPanicBadArgument);
+	__ASSERT_DEBUG(aIndex >= 0, __SQLPANIC(ESqlPanicBadArgument));
+	__ASSERT_DEBUG(aData != NULL, __SQLPANIC(ESqlPanicBadArgument));
 	}
 
 /////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -145,7 +145,7 @@
 		{
 		return err;	
 		}
-    __SQLASSERT(iColumnCnt >= 0, ESqlPanicInternalError);
+	__ASSERT_DEBUG(iColumnCnt >= 0, __SQLPANIC(ESqlPanicInternalError));
     err = iColumnValueBuf.SetCount(iColumnCnt);
     if(err != KErrNone)
         {
@@ -342,8 +342,8 @@
 */
 inline MStreamBuf* CSqlStatementImpl::ColumnSourceL(TInt aColumnIndex)
 	{
-	__SQLASSERT_ALWAYS((TUint)aColumnIndex < (TUint)iColumnCnt, ESqlPanicBadColumnIndex);
-	__SQLASSERT_ALWAYS(iState == CSqlStatementImpl::EAtRow, ESqlPanicInvalidRow);
+	__ASSERT_ALWAYS((TUint)aColumnIndex < (TUint)iColumnCnt, __SQLPANIC(ESqlPanicBadColumnIndex));
+	__ASSERT_ALWAYS(iState == CSqlStatementImpl::EAtRow, __SQLPANIC(ESqlPanicInvalidRow));
 	iColumnValBufIt.MoveTo(aColumnIndex);		
 	return iColumnValBufIt.IsPresent() ? iColumnValBufIt.StreamL() : iSqlStmtSession.ColumnSourceL(aColumnIndex);
 	}
@@ -369,7 +369,7 @@
 */
 inline MStreamBuf* CSqlStatementImpl::ParamSinkL(TSqlSrvFunction aFunction, TInt aParamIndex)
 	{
-	__SQLASSERT_ALWAYS((TUint)aParamIndex < (TUint)iParamCnt, ESqlPanicBadColumnIndex);
+	__ASSERT_ALWAYS((TUint)aParamIndex < (TUint)iParamCnt, __SQLPANIC(ESqlPanicBadColumnIndex));
 	return iSqlStmtSession.ParamSinkL(aFunction, aParamIndex);
 	}
 
--- a/persistentstorage/sql/SRC/Client/SqlStmtSession.cpp	Tue Jul 06 16:18:30 2010 +0300
+++ b/persistentstorage/sql/SRC/Client/SqlStmtSession.cpp	Wed Aug 18 11:30:17 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2005-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -16,6 +16,83 @@
 
 #include <s32mem.h>
 #include "SqlStmtSession.h"		//RSqlStatementSession
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "SqlStmtSessionTraces.h"
+#endif
+#include "SqlTraceDef.h"
+
+/**
+ Sends a request to the SQL server to prepare 16-bit aSqlStmt statement.
+ 
+ Usage of the IPC call arguments:
+ Arg 0: [in/out]        data buffer for the column and parameter count.
+ Arg 1: [out]       statement length in characters
+ Arg 2: [out]       16-bit statement
+ 
+ @param aDbSession A reference to RSqlDbSession instance.
+ @param aSqlStmt 16-bit SQL statement.
+ @param aColumnCount Output parameter. Statement column count.
+ @param aParamCount Output parameter. Statement parameter count.
+ 
+ @return KErrNoMemory, an out of memory condition has occured;
+ KErrArgument, bad argument, for example - the SQL string contains more than one SQL statements.
+ Note that the function may return some database specific errors categorised as 
+ ESqlDbError or other system-wide error codes;
+ KErrNone      The operation has completed successfully. 
+ 
+ @panic SqlDb 7 In _DEBUG mode if the statement handle is 0.
+*/
+TInt RSqlStatementSession::Prepare(RSqlDbSession& aDbSession, const TDesC& aSqlStmt, 
+                                          TInt& aColumnCount, TInt& aParamCount)
+    {
+    iDbSession = &aDbSession;
+    TSqlIpcData data;
+    TPckg<TSqlIpcData> pckg(data);
+    TUint stmtLen = aSqlStmt.Length();
+    iHandle = iDbSession->SendReceive(ESqlSrvStmtPrepare16, TIpcArgs(&pckg, stmtLen, &aSqlStmt));
+    __ASSERT_DEBUG(iHandle != 0, __SQLPANIC(ESqlPanicInternalError));   
+    aColumnCount = static_cast <TInt> (data.iPrm1);
+    aParamCount = static_cast <TInt> (data.iPrm2);
+    SQL_TRACE_SESSION(OstTraceExt2(TRACE_INTERNALS, RSQLSTATEMENTSESSION_PREPARE16, "0x%X;RSqlStatementSession::Prepare-16;iHandle=%d", (TUint)this, iHandle));
+    return iHandle > 0 ? KErrNone : iHandle;
+    }
+
+/**
+Sends a request to the SQL server to prepare 8-bit aSqlStmt statement.
+
+Usage of the IPC call arguments:
+Arg 0: [in/out]     data buffer for the column and parameter count.
+Arg 1: [out]        statement length in characters
+Arg 2: [out]        8-bit statement
+
+@param aDbSession A reference to RSqlDbSession instance.
+@param aSqlStmt 8-bit SQL statement.
+@param aColumnCount Output parameter. Statement column count.
+@param aParamCount Output parameter. Statement parameter count.
+
+@return KErrNoMemory, an out of memory condition has occured;
+        KErrArgument, bad argument, for example - the SQL string contains more than one SQL statements.
+                      Note that the function may return some database specific errors categorised as 
+                      ESqlDbError or other system-wide error codes;
+        KErrNone      The operation has completed successfully. 
+
+@panic SqlDb 7 In _DEBUG mode if the statement handle is 0.
+*/
+TInt RSqlStatementSession::Prepare(RSqlDbSession& aDbSession, const TDesC8& aSqlStmt, 
+                                          TInt& aColumnCount, TInt& aParamCount)
+    {
+    iDbSession = &aDbSession;
+    TSqlIpcData data;
+    TPckg<TSqlIpcData> pckg(data);
+    TUint stmtLen = aSqlStmt.Length();
+    iHandle = iDbSession->SendReceive(ESqlSrvStmtPrepare8, TIpcArgs(&pckg, stmtLen, &aSqlStmt));
+    __ASSERT_DEBUG(iHandle != 0, __SQLPANIC(ESqlPanicInternalError));
+    aColumnCount = static_cast <TInt> (data.iPrm1);
+    aParamCount = static_cast <TInt> (data.iPrm2);
+    SQL_TRACE_SESSION(OstTraceExt2(TRACE_INTERNALS, RSQLSTATEMENTSESSION_PREPARE8, "0x%X;RSqlStatementSession::Prepare-8;iHandle=%d", (TUint)this, iHandle));
+    return iHandle > 0 ? KErrNone : iHandle;
+    }
 
 /**
 Sends a request to the server to close the statement handle.
@@ -23,6 +100,7 @@
 */
 void RSqlStatementSession::Close()
 	{
+	SQL_TRACE_SESSION(OstTraceExt2(TRACE_INTERNALS, RSQLSTATEMENTSESSION_CLOSE, "0x%X;RSqlStatementSession::Close;iHandle=%d", (TUint)this, iHandle));
 	if(iDbSession && iHandle > 0)
 		{
 		(void)iDbSession->SendReceive(::MakeMsgCode(ESqlSrvStmtClose, ESqlSrvStatementHandle, iHandle));
--- a/persistentstorage/sql/SRC/Client/SqlStmtSession.h	Tue Jul 06 16:18:30 2010 +0300
+++ b/persistentstorage/sql/SRC/Client/SqlStmtSession.h	Wed Aug 18 11:30:17 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2005-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -81,8 +81,8 @@
 	{
 public:	
 	inline RSqlStatementSession();
-	inline TInt Prepare(RSqlDbSession& aDbSession, const TDesC& aSqlStmt, TInt& aColumnCount, TInt& aParamCount);
-	inline TInt Prepare(RSqlDbSession& aDbSession, const TDesC8& aSqlStmt, TInt& aColumnCount, TInt& aParamCount);
+	TInt Prepare(RSqlDbSession& aDbSession, const TDesC& aSqlStmt, TInt& aColumnCount, TInt& aParamCount);
+	TInt Prepare(RSqlDbSession& aDbSession, const TDesC8& aSqlStmt, TInt& aColumnCount, TInt& aParamCount);
 	void Close();
 	
 	inline TInt Reset();
--- a/persistentstorage/sql/SRC/Client/SqlStmtSession.inl	Tue Jul 06 16:18:30 2010 +0300
+++ b/persistentstorage/sql/SRC/Client/SqlStmtSession.inl	Wed Aug 18 11:30:17 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -16,77 +16,6 @@
 //
 
 /**
- 
- Sends a request to the SQL server to prepare 16-bit aSqlStmt statement.
- 
- Usage of the IPC call arguments:
- Arg 0: [in/out]		data buffer for the column and parameter count.
- Arg 1: [out]		statement length in characters
- Arg 2: [out]		16-bit statement
- 
- @param aDbSession A reference to RSqlDbSession instance.
- @param aSqlStmt 16-bit SQL statement.
- @param aColumnCount Output parameter. Statement column count.
- @param aParamCount Output parameter. Statement parameter count.
- 
- @return KErrNoMemory, an out of memory condition has occured;
- KErrArgument, bad argument, for example - the SQL string contains more than one SQL statements.
- Note that the function may leave with some database specific errors categorised as 
- ESqlDbError or other system-wide error codes;
- KErrNone      The operation has completed successfully. 
- 
- @panic SqlDb 7 In _DEBUG mode if the statement handle is 0.
-*/
-inline TInt RSqlStatementSession::Prepare(RSqlDbSession& aDbSession, const TDesC& aSqlStmt, 
-										  TInt& aColumnCount, TInt& aParamCount)
-	{
-	iDbSession = &aDbSession;
-	TSqlIpcData data;
-	TPckg<TSqlIpcData> pckg(data);
-	TUint stmtLen = aSqlStmt.Length();
-	iHandle = iDbSession->SendReceive(ESqlSrvStmtPrepare16, TIpcArgs(&pckg, stmtLen, &aSqlStmt));
-	__SQLASSERT(iHandle != 0, ESqlPanicInternalError);	
-	aColumnCount = static_cast <TInt> (data.iPrm1);
-	aParamCount = static_cast <TInt> (data.iPrm2);
-	return iHandle > 0 ? KErrNone : iHandle;
-	}
-
-/**
-Sends a request to the SQL server to prepare 8-bit aSqlStmt statement.
-
-Usage of the IPC call arguments:
-Arg 0: [in/out]		data buffer for the column and parameter count.
-Arg 1: [out]		statement length in characters
-Arg 2: [out]		8-bit statement
-
-@param aDbSession A reference to RSqlDbSession instance.
-@param aSqlStmt 8-bit SQL statement.
-@param aColumnCount Output parameter. Statement column count.
-@param aParamCount Output parameter. Statement parameter count.
-
-@return KErrNoMemory, an out of memory condition has occured;
-	    KErrArgument, bad argument, for example - the SQL string contains more than one SQL statements.
-                      Note that the function may leave with some database specific errors categorised as 
-                      ESqlDbError or other system-wide error codes;
-        KErrNone      The operation has completed successfully. 
-
-@panic SqlDb 7 In _DEBUG mode if the statement handle is 0.
-*/
-inline TInt RSqlStatementSession::Prepare(RSqlDbSession& aDbSession, const TDesC8& aSqlStmt, 
-										  TInt& aColumnCount, TInt& aParamCount)
-	{
-	iDbSession = &aDbSession;
-	TSqlIpcData data;
-	TPckg<TSqlIpcData> pckg(data);
-	TUint stmtLen = aSqlStmt.Length();
-	iHandle = iDbSession->SendReceive(ESqlSrvStmtPrepare8, TIpcArgs(&pckg, stmtLen, &aSqlStmt));
-	__SQLASSERT(iHandle != 0, ESqlPanicInternalError);
-	aColumnCount = static_cast <TInt> (data.iPrm1);
-	aParamCount = static_cast <TInt> (data.iPrm2);
-	return iHandle > 0 ? KErrNone : iHandle;
-	}
-
-/**
 @panic SqlDb 2 In _DEBUG mode if the statement handle is 0 or the database session is NULL,
 			   i.e. Prepare() has not yet been called on this RSqlStatementSession object.
 			   
@@ -94,7 +23,7 @@
 */
 inline RSqlDbSession& RSqlStatementSession::DbSession() const
 	{
-	__SQLASSERT(iHandle > 0 && iDbSession != NULL, ESqlPanicInvalidObj);
+	__ASSERT_DEBUG(iHandle > 0 && iDbSession != NULL, __SQLPANIC(ESqlPanicInvalidObj));
 	return *iDbSession;
 	}
 
--- a/persistentstorage/sql/SRC/Client/SqlStream.cpp	Tue Jul 06 16:18:30 2010 +0300
+++ b/persistentstorage/sql/SRC/Client/SqlStream.cpp	Wed Aug 18 11:30:17 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -15,6 +15,11 @@
 
 #include <sqldb.h>					//RSqlColumnReadStream, RSqlParamWriteStream
 #include "SqlStatementImpl.h"		//CSqlStatementImpl
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "SqlStreamTraces.h"
+#endif
+#include "SqlTraceDef.h"
 
 ////////////////////////////////////////////////////////////////////////////////////////////////////
 /////////////////////         RSqlColumnReadStream              ////////////////////////////////////
@@ -38,10 +43,9 @@
 */
 EXPORT_C TInt RSqlColumnReadStream::ColumnText(RSqlStatement& aStmt, TInt aColumnIndex)
 	{
-	SQLUTRACE_PROFILER(this);
-	SYMBIAN_TRACE_SQL_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KHexIntParam, &aStmt, aColumnIndex));
-	
+	SQL_TRACE_BORDER(OstTraceExt3(TRACE_BORDER, RSQLCOLUMNREADSTREAM_COLUMNTEXT_ENTRY, "Entry;0x%X;RSqlColumnReadStream::ColumnText;aStmt=0x%X;aColumnIndex=%d", (TUint)this, (TUint)&aStmt, aColumnIndex));
 	TRAPD(err, Attach(aStmt.Impl().ColumnSourceL(aColumnIndex)));
+    SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, RSQLCOLUMNREADSTREAM_COLUMNTEXT_EXIT, "Exit;0x%X;RSqlColumnReadStream::ColumnText;err=%d", (TUint)this, err));
 	return err;
 	}
 	
@@ -63,10 +67,9 @@
 */
 EXPORT_C TInt RSqlColumnReadStream::ColumnBinary(RSqlStatement& aStmt, TInt aColumnIndex)
 	{
-	SQLUTRACE_PROFILER(this);
-	SYMBIAN_TRACE_SQL_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KHexIntParam, &aStmt, aColumnIndex));
-	
+    SQL_TRACE_BORDER(OstTraceExt3(TRACE_BORDER, RSQLCOLUMNREADSTREAM_COLUMNBINARY_ENTRY, "Entry;0x%X;RSqlColumnReadStream::ColumnBinary;aStmt=0x%X;aColumnIndex=%d", (TUint)this, (TUint)&aStmt, aColumnIndex));
 	TRAPD(err, Attach(aStmt.Impl().ColumnSourceL(aColumnIndex)));
+    SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, RSQLCOLUMNREADSTREAM_COLUMNBINARY_EXIT, "Exit;0x%X;RSqlColumnReadStream::ColumnBinary;err=%d", (TUint)this, err));
 	return err;
 	}
 
@@ -87,10 +90,9 @@
 */
 EXPORT_C void RSqlColumnReadStream::ColumnTextL(RSqlStatement& aStmt, TInt aColumnIndex)
 	{
-	SQLUTRACE_PROFILER(this);
-	SYMBIAN_TRACE_SQL_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KHexIntParam, &aStmt, aColumnIndex));
-	
+    SQL_TRACE_BORDER(OstTraceExt3(TRACE_BORDER, RSQLCOLUMNREADSTREAM_COLUMNTEXTL_ENTRY, "Entry;0x%X;RSqlColumnReadStream::ColumnTextL;aStmt=0x%X;aColumnIndex=%d", (TUint)this, (TUint)&aStmt, aColumnIndex));
 	Attach(aStmt.Impl().ColumnSourceL(aColumnIndex));
+    SQL_TRACE_BORDER(OstTrace1(TRACE_BORDER, RSQLCOLUMNREADSTREAM_COLUMNTEXTL_EXIT, "Exit;0x%X;RSqlColumnReadStream::ColumnTextL", (TUint)this));
 	}
 	
 /**
@@ -110,10 +112,9 @@
 */
 EXPORT_C void RSqlColumnReadStream::ColumnBinaryL(RSqlStatement& aStmt, TInt aColumnIndex)
 	{
-	SQLUTRACE_PROFILER(this);
-	SYMBIAN_TRACE_SQL_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KHexIntParam, &aStmt, aColumnIndex));
-
+    SQL_TRACE_BORDER(OstTraceExt3(TRACE_BORDER, RSQLCOLUMNREADSTREAM_COLUMNBINARYL_ENTRY, "Entry;0x%X;RSqlColumnReadStream::ColumnBinaryL;aStmt=0x%X;aColumnIndex=%d", (TUint)this, (TUint)&aStmt, aColumnIndex));
 	Attach(aStmt.Impl().ColumnSourceL(aColumnIndex));
+    SQL_TRACE_BORDER(OstTrace1(TRACE_BORDER, RSQLCOLUMNREADSTREAM_COLUMNBINARYL_EXIT, "Exit;0x%X;RSqlColumnReadStream::ColumnBinaryL", (TUint)this));
 	}
 
 ////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -141,10 +142,9 @@
 */
 EXPORT_C TInt RSqlParamWriteStream::BindText(RSqlStatement& aStmt, TInt aParameterIndex)
 	{
-	SQLUTRACE_PROFILER(this);
-	SYMBIAN_TRACE_SQL_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KHexIntParam, &aStmt, aParameterIndex));
-
+    SQL_TRACE_BORDER(OstTraceExt3(TRACE_BORDER, RSQLPARAMWRITESTREAM_BINDTEXT_ENTRY, "Entry;0x%X;RSqlParamWriteStream::BindText;aStmt=0x%X;aParameterIndex=%d", (TUint)this, (TUint)&aStmt, aParameterIndex));
 	TRAPD(err, Attach(aStmt.Impl().ParamSinkL(ESqlSrvStmtTxtParamSink16, aParameterIndex)));
+    SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, RSQLPARAMWRITESTREAM_BINDTEXT_EXIT, "Exit;0x%X;RSqlParamWriteStream::BindText;err=%d", (TUint)this, err));
 	return err;
 	}
 	
@@ -169,10 +169,9 @@
 */
 EXPORT_C TInt RSqlParamWriteStream::BindBinary(RSqlStatement& aStmt, TInt aParameterIndex)
 	{
-	SQLUTRACE_PROFILER(this);
-	SYMBIAN_TRACE_SQL_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KHexIntParam, &aStmt, aParameterIndex));
-
+    SQL_TRACE_BORDER(OstTraceExt3(TRACE_BORDER, RSQLPARAMWRITESTREAM_BINDBINARY_ENTRY, "Entry;0x%X;RSqlParamWriteStream::BindBinary;aStmt=0x%X;aParameterIndex=%d", (TUint)this, (TUint)&aStmt, aParameterIndex));
 	TRAPD(err, Attach(aStmt.Impl().ParamSinkL(ESqlSrvStmtBinParamSink, aParameterIndex)));
+    SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, RSQLPARAMWRITESTREAM_BINDBINARY_EXIT, "Exit;0x%X;RSqlParamWriteStream::BindBinary;err=%d", (TUint)this, err));
 	return err;
 	}
 
@@ -196,10 +195,9 @@
 */
 EXPORT_C void RSqlParamWriteStream::BindTextL(RSqlStatement& aStmt, TInt aParameterIndex)
 	{
-	SQLUTRACE_PROFILER(this);
-	SYMBIAN_TRACE_SQL_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KHexIntParam, &aStmt, aParameterIndex));
-
+    SQL_TRACE_BORDER(OstTraceExt3(TRACE_BORDER, RSQLPARAMWRITESTREAM_BINDTEXTL_ENTRY, "Entry;0x%X;RSqlParamWriteStream::BindTextL;aStmt=0x%X;aParameterIndex=%d", (TUint)this, (TUint)&aStmt, aParameterIndex));
 	Attach(aStmt.Impl().ParamSinkL(ESqlSrvStmtTxtParamSink16, aParameterIndex));
+    SQL_TRACE_BORDER(OstTrace1(TRACE_BORDER, RSQLPARAMWRITESTREAM_BINDTEXTL_EXIT, "Exit;0x%X;RSqlParamWriteStream::BindTextL", (TUint)this));
 	}
 	
 /**
@@ -222,9 +220,8 @@
 */
 EXPORT_C void RSqlParamWriteStream::BindBinaryL(RSqlStatement& aStmt, TInt aParameterIndex)
 	{
-	SQLUTRACE_PROFILER(this);
-	SYMBIAN_TRACE_SQL_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KHexIntParam, &aStmt, aParameterIndex));
-
+    SQL_TRACE_BORDER(OstTraceExt3(TRACE_BORDER, RSQLPARAMWRITESTREAM_BINDBINARYL_ENTRY, "Entry;0x%X;RSqlParamWriteStream::BindBinaryL;aStmt=0x%X;aParameterIndex=%d", (TUint)this, (TUint)&aStmt, aParameterIndex));
 	Attach(aStmt.Impl().ParamSinkL(ESqlSrvStmtBinParamSink, aParameterIndex));
+    SQL_TRACE_BORDER(OstTrace1(TRACE_BORDER, RSQLPARAMWRITESTREAM_BINDBINARYL_EXIT, "Exit;0x%X;RSqlParamWriteStream::BindBinaryL", (TUint)this));
 	}
 
--- a/persistentstorage/sql/SRC/Common/SqlAssert.h	Tue Jul 06 16:18:30 2010 +0300
+++ b/persistentstorage/sql/SRC/Common/SqlAssert.h	Wed Aug 18 11:30:17 2010 +0300
@@ -17,17 +17,68 @@
 #define __SQLASSERT_H__
 
 #include <e32std.h>
-#include "UTraceSql.h"
+#include "SqlPanic.h"   //TSqlPanic
+
+///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+//Enable _SQLPROFILER if you want to use the TSqlResourceProfiler functions. Do not forget the same macro declaration in os_symbian.cpp file.
+
+///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+//All macros in this header will have a non-void definition only if the OST_TRACE_COMPILER_IN_USE macro
+//is defined. 
+//In order to get the traces enabled, the OST_TRACE_COMPILER_IN_USE macro has to be defined in
+//OstTraceDefinitions.h file. 
+//After that, the trace output can be redirected by defining _SQL_RDEBUG_PRINT or specific categories
+//of traces can be enabled/disabled.
+
+//Enable _SQL_RDEBUG_PRINT if you want to redirect the tracing output via RDebug::Print()
+//#define _SQL_RDEBUG_PRINT
 
-//#define _SQLPROFILER	//Enable _SQLPROFILER if you want to use the TSqlResourceProfiler functions. Do not forget the same macro declaration in os_symbian.cpp file.
+//Enable _SQL_BORDER_TRACE_ENABLED if you want to get the entry/exit traces compiled in the binary
+//#define _SQL_BORDER_TRACE_ENABLED
+
+//Enable _SQL_INTERNALS_TRACE_ENABLED if you want to get the internal traces compiled in the binary
+//#define _SQL_INTERNALS_TRACE_ENABLED
+
+//Enable _SQL_BUR_TRACE_ENABLED if you want to get the backup&restore traces compiled in the binary
+//#define _SQL_BUR_TRACE_ENABLED
+
+//Enable _SQL_COMPACT_TRACE_ENABLED if you want to get the background compaction traces compiled in the binary
+//#define _SQL_COMPACT_TRACE_ENABLED
+
+//Enable _SQL_SESSION_TRACE_ENABLED if you want to get the client and server sessions traces compiled in the binary
+//#define _SQL_SESSION_TRACE_ENABLED
+
+//Enable _SQL_AUTHORIZER_TRACE_ENABLED if you want to trace the authorizer parameters
+//#define _SQL_AUTHORIZER_TRACE_ENABLED
+
+//Enable _SQL_BLOB_TRACE_ENABLED if you want to trace the server side BLOB calls
+//#define _SQL_BLOB_TRACE_ENABLED
 
 #ifdef _DEBUG
-#define _ASSERTIONS
-//#define _LOGGING
-//#define _NOTIFY		//Enable _NOTIFY if you want to get more detailed output in _DEBUG mode
+    //Enable _SQL_PANIC_TRACE_ENABLED if you want to get more detailed output regarding panics
+    //#define _SQL_PANIC_TRACE_ENABLED
+
+    //Enable _SQL_LEAVE_TRACE_ENABLED if you want to get more detailed output regarding leaving locations
+    //#define _SQL_LEAVE_TRACE_ENABLED
 #endif
 
-const TInt KSqlLeavePanic = -359;//The (last-1) error code from the reserved area for the SQL component.
+///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+//Wrap every string (file name, file path, etc.) you want to trace, in a __SQLPRNSTR()/__SQLPRNSTR8() macro. 
+//There is a difference how RDebug::Print() and OstTraceExt<n>() work.
+#if defined _SQL_RDEBUG_PRINT
+    const TInt KSqlMaxPrnStrLen = 512;    
+    #define __SQLPRNSTR(des)  &des
+    const TDesC* SqlDes8to16Ptr(const TDesC8& aDes, TDes& aOut);
+	#define __SQLPRNSTR8(des, out)  SqlDes8to16Ptr(des, out) 
+#else
+    #define __SQLPRNSTR(des)  des
+    #define __SQLPRNSTR8(des, out) des
+#endif
+
+///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 
 //Forward declarations
 class RMessage2;
@@ -37,98 +88,104 @@
 
 @internalComponent
 */
-class Util
+class TSqlUtil
 	{
 	friend void UtilFileNameTest();
 	
 public:
 	static void GetTimeStr(TDes& aWhere);
-	static TInt Assert(const TText* aFile, TInt aLine, TInt aPanicCode);
-	static void Leave(const TText* aFile, TInt aLine, TInt aError);
-	static TInt LeaveIfError(const TText* aFile, TInt aLine, TInt aError);
-	static const void* LeaveIfNull(const TText* aFile, TInt aLine, const void* aPtr);
-	static TInt PanicClientL(const TText* aFile, TInt aLine, const RMessage2& aMessage, TInt aPanicCode);
-	static void ErrorPrint(const TDesC& aMsg, TInt aErr);
-	static void ErrorPrint(const TDesC& aMsg, const TDesC& aStr);
+	static TInt Panic(const TText* aFile, TInt aLine, TInt aPanicCode, TUint aHandle);
+	static void Leave(const TText* aFile, TInt aLine, TInt aError, TUint aHandle);
+	static TInt LeaveIfError(const TText* aFile, TInt aLine, TInt aError, TUint aHandle);
+	static void* LeaveIfNull(const TText* aFile, TInt aLine, void* aPtr, TUint aHandle);
+	static TInt PanicClientL(const TText* aFile, TInt aLine, const RMessage2& aMessage, TInt aPanicCode, TUint aHandle);
 	
 private:
-	static TPtrC Filename(const TText* aFile);
+	static TPtrC FileName(const TText* aFile);
 	
 	};
 
-#define __STRING(str) _S(str)
-
-//This macro should be used when there is a need to panic the client/server if "expr" condition is not satisfied.
-//Works in both debug and release modes.
-#define __SQLASSERT_ALWAYS(expr, panicCode)	(void)((expr) || Util::Assert(__STRING(__FILE__), __LINE__, panicCode))
-
 ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-//////////////////////////////       _ASSERTIONS          /////////////////////////////////////////////////////////
-#ifdef _ASSERTIONS
 
-//This macro should be used when there is a need to panic the client/server if "expr" condition is not satisfied.
-//Works in only in debug mode. In release mode evaluates to nothing.
-#define __SQLASSERT(expr, panicCode)	(void)((expr) || Util::Assert(__STRING(__FILE__), __LINE__, panicCode))
-
-#else
-
-#define __SQLASSERT(expr, panicCode) 	void(0)
-
-#endif //_ASSERTIONS
+#define __SQLSTRING(str) _S(str)
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-//////////////////////////////          _LOGGING          //////////////////////////////////////////////////////////
-#if defined _LOGGING || defined SYMBIAN_TRACE_SQL_ERR
 
-//This macro should be used to log the message "msg" containing the "err" error code.
-//The message "msg" should contain the format specifier %d.
-//Works only in debug mode. In release mode evaluates to nothing.
-#define __SQLLOG_ERR(msg, err)		Util::ErrorPrint(msg, err)
-
-//This macro should be used to log the message "msg" containing the "str" string.
-//The message "msg" should contain the format specifier %S.
-//Works only in debug mode. In release mode evaluates to nothing.
-#define __SQLLOG_STRING(msg, str)	Util::ErrorPrint(msg, str)
-
-#else
-
-#define __SQLLOG_ERR(msg, err) 	    do {} while(0)
-#define __SQLLOG_STRING(msg, str) 	do {} while(0)
-
-#endif //_LOGGING || SYMBIAN_TRACE_SQL_ERR
+//__SQLPANIC/__SQLPANIC2 macro is used for printing out additional information when panic occurs in SQL:
+//source file name, line number, "this" pointer, panic category.
+#define __SQLPANIC(aPanicCode)      TSqlUtil::Panic(__SQLSTRING(__FILE__), __LINE__, aPanicCode, (TUint)this)
+#define __SQLPANIC2(aPanicCode)     TSqlUtil::Panic(__SQLSTRING(__FILE__), __LINE__, aPanicCode, 0)
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-//////////////////////////////          _NOTIFY          ///////////////////////////////////////////////////////////
-#if defined _NOTIFY || defined SYMBIAN_TRACE_SQL_ERR
 
 //This macro should be used to leave with "err" error code.
 //In debug mode prints the file name and the line number where the leaving occurs and then leaves.
 //In release mode only leaves.
-#define __SQLLEAVE(err) 					Util::Leave(__STRING(__FILE__), __LINE__, err)
+#define __SQLLEAVE(err)             TSqlUtil::Leave(__SQLSTRING(__FILE__), __LINE__, err, (TUint)this)
+#define __SQLLEAVE2(err)            TSqlUtil::Leave(__SQLSTRING(__FILE__), __LINE__, err, 0)
 
 //This macro should be used to leave with "err" error code, if the error code is negative.
 //In debug mode prints the file name and the line number where the leaving occurs and then leaves.
 //In release mode only leaves.
-#define __SQLLEAVE_IF_ERROR(err) 			Util::LeaveIfError(__STRING(__FILE__), __LINE__, err)
+#define __SQLLEAVE_IF_ERROR(err)    TSqlUtil::LeaveIfError(__SQLSTRING(__FILE__), __LINE__, err, (TUint)this)
+#define __SQLLEAVE_IF_ERROR2(err)   TSqlUtil::LeaveIfError(__SQLSTRING(__FILE__), __LINE__, err, 0)
 
 //This macro should be used to leave with KErrNoMemory if "ptr" argument is NULL.
 //In debug mode prints the file name and the line number where the leaving occurs and then leaves.
 //In release mode only leaves.
-#define __SQLLEAVE_IF_NULL(ptr) 			Util::LeaveIfNull(__STRING(__FILE__), __LINE__, ptr)
+#define __SQLLEAVE_IF_NULL(ptr)     TSqlUtil::LeaveIfNull(__SQLSTRING(__FILE__), __LINE__, ptr, (TUint)this)
 
 //This macro should be used to panic the client and leave if "expr" condition is not satisfied.
 //In debug mode prints the file name and the line number where the leaving occurs and then 
 //panics the client and leaves.
 //In release mode only panics the client and leaves.
-#define __SQLPANIC_CLIENT(expr, msg, panicCode)	(void)((expr) || Util::PanicClientL(__STRING(__FILE__), __LINE__, msg, panicCode))
+#define __SQLPANIC_CLIENT(expr, msg, panicCode)  (void)((expr) || TSqlUtil::PanicClientL(__SQLSTRING(__FILE__), __LINE__, msg, panicCode, (TUint)this))
+#define __SQLPANIC_CLIENT2(expr, msg, panicCode) (void)((expr) || TSqlUtil::PanicClientL(__SQLSTRING(__FILE__), __LINE__, msg, panicCode, 0))
+
+//===================================================================================
+
+#ifdef _SQL_BORDER_TRACE_ENABLED
+    #define SQL_TRACE_BORDER(trace)   trace
+#else
+    #define SQL_TRACE_BORDER(trace)   do {} while(0)
+#endif
 
+#ifdef _SQL_INTERNALS_TRACE_ENABLED
+    #define SQL_TRACE_INTERNALS(trace)   trace
 #else
+    #define SQL_TRACE_INTERNALS(trace)   do {} while(0)
+#endif
+
+#ifdef _SQL_BUR_TRACE_ENABLED
+    #define SQL_TRACE_BUR(trace)   trace
+#else
+    #define SQL_TRACE_BUR(trace)   do {} while(0)
+#endif
 
-#define __SQLLEAVE(err) 					User::Leave(err)
-#define __SQLLEAVE_IF_ERROR(err) 			User::LeaveIfError(err)
-#define __SQLLEAVE_IF_NULL(ptr) 			User::LeaveIfNull(ptr)
-#define __SQLPANIC_CLIENT(expr, msg, panicCode)	(void)((expr) || ::SqlPanicClientL(msg, panicCode))
+#ifdef _SQL_COMPACT_TRACE_ENABLED
+    #define SQL_TRACE_COMPACT(trace)   trace
+#else
+    #define SQL_TRACE_COMPACT(trace)   do {} while(0)
+#endif
+
+#ifdef _SQL_SESSION_TRACE_ENABLED
+    #define SQL_TRACE_SESSION(trace)   trace
+#else
+    #define SQL_TRACE_SESSION(trace)   do {} while(0)
+#endif
 
-#endif //_NOTIFY || SYMBIAN_TRACE_SQL_ERR
+#ifdef _SQL_AUTHORIZER_TRACE_ENABLED
+    #define SQL_TRACE_AUTHORIZER(trace)   trace
+#else
+    #define SQL_TRACE_AUTHORIZER(trace)   do {} while(0)
+#endif
+
+#ifdef _SQL_BLOB_TRACE_ENABLED
+    #define SQL_TRACE_BLOB(trace)   trace
+#else
+    #define SQL_TRACE_BLOB(trace)   do {} while(0)
+#endif
+
+//===================================================================================
 
 #endif//__SQLASSERT_H__
--- a/persistentstorage/sql/SRC/Common/SqlBufFlat.cpp	Tue Jul 06 16:18:30 2010 +0300
+++ b/persistentstorage/sql/SRC/Common/SqlBufFlat.cpp	Wed Aug 18 11:30:17 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -15,6 +15,7 @@
 
 #include "SqlUtil.h"
 #include "SqlBufFlat.h"
+#include "OstTraceDefinitions.h"
 
 /**
 Sets the flat buffer pointer to NULL
@@ -45,7 +46,7 @@
 */
 TInt RSqlBufFlat::SetCount(TInt aCount)
 	{
-	__SQLASSERT(aCount >= 0, ESqlPanicBadArgument);
+	__ASSERT_DEBUG(aCount >= 0, __SQLPANIC(ESqlPanicBadArgument));
 	TInt headerSize = sizeof(RSqlBufFlat::TCell) * aCount;
 	TInt newSize = headerSize + sizeof(RSqlBufFlat::TBufFlat);
 	if(DoReAlloc(newSize) != KErrNone)
@@ -110,7 +111,7 @@
 		iMaxSize = KBufLimit - 1;  //to force the reallocation
 		(void)DoReAlloc(KBufLimit);//User::ReAlloc() does not fail if the new requested size is less than the current block size
 		}
-	__SQLASSERT(oldBuf == iBuf, ESqlPanicInternalError);
+	__ASSERT_DEBUG(oldBuf == iBuf, __SQLPANIC(ESqlPanicInternalError));
 	SQLFLATBUF_INVARIANT();
 	}
 
@@ -156,12 +157,12 @@
 TInt RSqlBufFlat::SetField(TInt aIndex, TInt aType, const void* aData, TInt aDataLength)
 	{
 	SQLFLATBUF_INVARIANT();
-	__SQLASSERT((TUint)aIndex < iBuf->iCount, ESqlPanicBadArgument);
-	__SQLASSERT((TUint)aType < RSqlBufFlat::EMaxType, ESqlPanicBadArgument);
-	__SQLASSERT((TUint)aDataLength < RSqlBufFlat::EMaxLength, ESqlPanicBadArgument);
+	__ASSERT_DEBUG((TUint)aIndex < iBuf->iCount, __SQLPANIC(ESqlPanicBadArgument));
+	__ASSERT_DEBUG((TUint)aType < RSqlBufFlat::EMaxType, __SQLPANIC(ESqlPanicBadArgument));
+	__ASSERT_DEBUG((TUint)aDataLength < RSqlBufFlat::EMaxLength, __SQLPANIC(ESqlPanicBadArgument));
 	if(aData)						//field value "present"
 		{
-		__SQLASSERT(aDataLength >= 0, ESqlPanicBadArgument);
+		__ASSERT_DEBUG(aDataLength >= 0, __SQLPANIC(ESqlPanicBadArgument));
 		if(aDataLength > 0)
 			{
 			if(Reserve(aDataLength) != KErrNone)
@@ -195,9 +196,9 @@
 void RSqlBufFlat::DoInit()
 	{
 	TBufFlat& buf = *iBuf;
-	__SQLASSERT(buf.iCount >= 0, ESqlPanicInternalError);
-	__SQLASSERT(buf.iSize <= iMaxSize, ESqlPanicInternalError);
-	__SQLASSERT(buf.iHeaderSize == sizeof(RSqlBufFlat::TCell) * buf.iCount, ESqlPanicInternalError);
+	__ASSERT_DEBUG(buf.iCount >= 0, __SQLPANIC(ESqlPanicInternalError));
+	__ASSERT_DEBUG(buf.iSize <= iMaxSize, __SQLPANIC(ESqlPanicInternalError));
+	__ASSERT_DEBUG(buf.iHeaderSize == sizeof(RSqlBufFlat::TCell) * buf.iCount, __SQLPANIC(ESqlPanicInternalError));
 	if(buf.iHeaderSize > 0)
 		{
 		Mem::FillZ(Header(), buf.iHeaderSize);
@@ -244,10 +245,10 @@
 void RSqlBufFlat::DoSet(TInt aIndex, TInt aType, const void* aData, TInt aDataLength)
 	{
 	TBufFlat& buf = *iBuf;
-	__SQLASSERT((TUint)aDataLength < RSqlBufFlat::EMaxLength, ESqlPanicBadArgument);
-	__SQLASSERT(aDataLength > 0 ? aData != NULL : ETrue, ESqlPanicBadArgument);
-	__SQLASSERT(aDataLength <= (iMaxSize - buf.iSize), ESqlPanicInternalError);
-	__SQLASSERT(::IsAligned8(buf.iSize), ESqlPanicInternalError);
+	__ASSERT_DEBUG((TUint)aDataLength < RSqlBufFlat::EMaxLength, __SQLPANIC(ESqlPanicBadArgument));
+	__ASSERT_DEBUG(aDataLength > 0 ? aData != NULL : ETrue, __SQLPANIC(ESqlPanicBadArgument));
+	__ASSERT_DEBUG(aDataLength <= (iMaxSize - buf.iSize), __SQLPANIC(ESqlPanicInternalError));
+	__ASSERT_DEBUG(::IsAligned8(buf.iSize), __SQLPANIC(ESqlPanicInternalError));
 	RSqlBufFlat::TCell& cell = *(Header() + aIndex);
 	cell.iBits = (TUint)(((TUint)aType << RSqlBufFlat::EWidthLen) | (TUint)aDataLength);
 	cell.iPos = 1;	//not 0, because 0 means "not present"
@@ -291,24 +292,24 @@
 */
 void RSqlBufFlat::Invariant() const
 	{
-	__SQLASSERT(iBuf != NULL, ESqlPanicInternalError);
+	__ASSERT_DEBUG(iBuf != NULL, __SQLPANIC(ESqlPanicInternalError));
 	const TBufFlat& buf = *iBuf;
-	__SQLASSERT(buf.iCount >= 0, ESqlPanicInternalError);
-	__SQLASSERT(buf.iHeaderSize == sizeof(RSqlBufFlat::TCell) * buf.iCount, ESqlPanicInternalError);
-	__SQLASSERT(::IsAligned8(buf.iSize), ESqlPanicInternalError);
-	__SQLASSERT(buf.iSize >= buf.iHeaderSize + sizeof(RSqlBufFlat::TBufFlat), ESqlPanicInternalError);
-	__SQLASSERT(buf.iSize <= iMaxSize, ESqlPanicInternalError);
- 	__SQLASSERT(buf.iSize <= User::AllocLen(iBuf), ESqlPanicInternalError);	
+	__ASSERT_DEBUG(buf.iCount >= 0, __SQLPANIC(ESqlPanicInternalError));
+	__ASSERT_DEBUG(buf.iHeaderSize == sizeof(RSqlBufFlat::TCell) * buf.iCount, __SQLPANIC(ESqlPanicInternalError));
+	__ASSERT_DEBUG(::IsAligned8(buf.iSize), __SQLPANIC(ESqlPanicInternalError));
+	__ASSERT_DEBUG(buf.iSize >= buf.iHeaderSize + sizeof(RSqlBufFlat::TBufFlat), __SQLPANIC(ESqlPanicInternalError));
+	__ASSERT_DEBUG(buf.iSize <= iMaxSize, __SQLPANIC(ESqlPanicInternalError));
+	__ASSERT_DEBUG(buf.iSize <= User::AllocLen(iBuf), __SQLPANIC(ESqlPanicInternalError));	
 	for(TInt i=0;i<(TInt)buf.iCount;++i)
 		{
 		const RSqlBufFlat::TCell& cell = *((reinterpret_cast <const RSqlBufFlat::TCell*> (iBuf + 1)) + i);
-		__SQLASSERT(cell.Type() < RSqlBufFlat::EMaxType, ESqlPanicInternalError);
+		__ASSERT_DEBUG(cell.Type() < RSqlBufFlat::EMaxType, __SQLPANIC(ESqlPanicInternalError));
 		if(cell.Size() > 0 && cell.iPos >= buf.iHeaderSize) //only for present fields with length > 0
 			{
-			__SQLASSERT((TUint)cell.Size() <= buf.iSize, ESqlPanicInternalError);
-			__SQLASSERT(cell.iPos < (buf.iSize - sizeof(RSqlBufFlat::TBufFlat)), ESqlPanicInternalError);
+			__ASSERT_DEBUG((TUint)cell.Size() <= buf.iSize, __SQLPANIC(ESqlPanicInternalError));
+			__ASSERT_DEBUG(cell.iPos < (buf.iSize - sizeof(RSqlBufFlat::TBufFlat)), __SQLPANIC(ESqlPanicInternalError));
 			TUint64 val = *(TUint64*)(reinterpret_cast <TUint8*> (iBuf) + cell.iPos + sizeof(RSqlBufFlat::TBufFlat) - sizeof(KSqlBufFlatMagicValue));
-			__SQLASSERT(val == KSqlBufFlatMagicValue, ESqlPanicInternalError);
+			__ASSERT_DEBUG(val == KSqlBufFlatMagicValue, __SQLPANIC(ESqlPanicInternalError));
 			}
 		}
 	}
--- a/persistentstorage/sql/SRC/Common/SqlBufFlat.h	Tue Jul 06 16:18:30 2010 +0300
+++ b/persistentstorage/sql/SRC/Common/SqlBufFlat.h	Wed Aug 18 11:30:17 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -17,7 +17,7 @@
 #define __SQLBUFFLAT_H__
 
 #include <e32base.h>
-#include "SqlPanic.h"
+#include "SqlAssert.h"
 
 //Forward declarations
 class TSqlBufRIterator;
--- a/persistentstorage/sql/SRC/Common/SqlBufIterator.cpp	Tue Jul 06 16:18:30 2010 +0300
+++ b/persistentstorage/sql/SRC/Common/SqlBufIterator.cpp	Wed Aug 18 11:30:17 2010 +0300
@@ -26,7 +26,7 @@
 */
 inline TInt TSqlBufRIterator::AsInt() const
 	{
-	__SQLASSERT(iCurrent >= iBegin && iCurrent < iEnd, ESqlPanicInternalError);
+	__ASSERT_DEBUG(iCurrent >= iBegin && iCurrent < iEnd, __SQLPANIC(ESqlPanicInternalError));
 	return *reinterpret_cast <const TInt32*> (reinterpret_cast <const TUint8*> (iBegin) + iCurrent->iPos);
 	}
 
@@ -35,7 +35,7 @@
 */
 inline TInt64 TSqlBufRIterator::AsInt64() const
 	{
-	__SQLASSERT(iCurrent >= iBegin && iCurrent < iEnd, ESqlPanicInternalError);
+	__ASSERT_DEBUG(iCurrent >= iBegin && iCurrent < iEnd, __SQLPANIC(ESqlPanicInternalError));
 	return *reinterpret_cast <const TInt64*> (reinterpret_cast <const TUint8*> (iBegin) + iCurrent->iPos);
 	}
 
@@ -44,7 +44,7 @@
 */
 inline TReal TSqlBufRIterator::AsReal() const
 	{
-	__SQLASSERT(iCurrent >= iBegin && iCurrent < iEnd, ESqlPanicInternalError);
+	__ASSERT_DEBUG(iCurrent >= iBegin && iCurrent < iEnd, __SQLPANIC(ESqlPanicInternalError));
 	return *reinterpret_cast <const TReal*> (reinterpret_cast <const TUint8*> (iBegin) + iCurrent->iPos);
 	}
 
@@ -56,7 +56,7 @@
 */
 TInt TSqlBufRIterator::Int() const
 	{
-	__SQLASSERT(iCurrent >= iBegin && iCurrent < iEnd, ESqlPanicInternalError);
+	__ASSERT_DEBUG(iCurrent >= iBegin && iCurrent < iEnd, __SQLPANIC(ESqlPanicInternalError));
 	switch(Type())
 		{
 		case ESqlInt64:
@@ -94,7 +94,7 @@
 */
 TInt64 TSqlBufRIterator::Int64() const
 	{
-	__SQLASSERT(iCurrent >= iBegin && iCurrent < iEnd, ESqlPanicInternalError);
+	__ASSERT_DEBUG(iCurrent >= iBegin && iCurrent < iEnd, __SQLPANIC(ESqlPanicInternalError));
 	switch(Type())
 		{
 		case ESqlInt:
@@ -128,7 +128,7 @@
 */
 TReal TSqlBufRIterator::Real() const
 	{
-	__SQLASSERT(iCurrent >= iBegin && iCurrent < iEnd, ESqlPanicInternalError);
+	__ASSERT_DEBUG(iCurrent >= iBegin && iCurrent < iEnd, __SQLPANIC(ESqlPanicInternalError));
 	switch(Type())
 		{
 		case ESqlInt:
@@ -159,7 +159,7 @@
 */
 TPtrC8 TSqlBufRIterator::Binary() const
 	{
-	__SQLASSERT(iCurrent >= iBegin && iCurrent < iEnd, ESqlPanicInternalError);
+	__ASSERT_DEBUG(iCurrent >= iBegin && iCurrent < iEnd, __SQLPANIC(ESqlPanicInternalError));
 	TInt size = Size();
 	if(Type() != ESqlBinary || size == 0)
 		{
@@ -176,7 +176,7 @@
 */
 TPtrC16 TSqlBufRIterator::Text() const
 	{
-	__SQLASSERT(iCurrent >= iBegin && iCurrent < iEnd, ESqlPanicInternalError);
+	__ASSERT_DEBUG(iCurrent >= iBegin && iCurrent < iEnd, __SQLPANIC(ESqlPanicInternalError));
 	TInt size = Size();
 	if(Type() != ESqlText || size == 0)
 		{
@@ -196,7 +196,7 @@
 public:
 	static HReadOnlyBuf* NewL(const TUint8* aFrom, TInt aLen)
 		{
-		__SQLASSERT(aLen >= 0, ESqlPanicBadArgument);
+		__ASSERT_DEBUG(aLen >= 0, __SQLPANIC2(ESqlPanicBadArgument));
    		HReadOnlyBuf* self = new (ELeave) HReadOnlyBuf;
 		TUint8* p = const_cast <TUint8*> (aFrom);
 		self->Set(p, p + aLen, MStreamBuf::ERead);
@@ -219,7 +219,7 @@
 */	
 MStreamBuf* TSqlBufRIterator::StreamL() const
 	{
-	__SQLASSERT(iCurrent >= iBegin && iCurrent < iEnd, ESqlPanicInternalError);
+    __ASSERT_DEBUG(iCurrent >= iBegin && iCurrent < iEnd, __SQLPANIC(ESqlPanicInternalError));
 	if(!::IsSequenceSqlType(Type()))
 		{
 		__SQLLEAVE(KErrArgument);
--- a/persistentstorage/sql/SRC/Common/SqlBufIterator.h	Tue Jul 06 16:18:30 2010 +0300
+++ b/persistentstorage/sql/SRC/Common/SqlBufIterator.h	Wed Aug 18 11:30:17 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -18,7 +18,7 @@
 
 #include <sqldb.h>			//TSqlColumnType
 #include "SqlBufFlat.h"		//RSqlBufFlat
-#include "SqlPanic.h"	
+#include "SqlAssert.h"	
 
 //Forward declarations
 class MStreamBuf;
--- a/persistentstorage/sql/SRC/Common/SqlBufIterator.inl	Tue Jul 06 16:18:30 2010 +0300
+++ b/persistentstorage/sql/SRC/Common/SqlBufIterator.inl	Wed Aug 18 11:30:17 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -46,7 +46,7 @@
 */
 inline void TSqlBufRIterator::MoveTo(TInt aIndex)
 	{
-	__SQLASSERT((iBegin + (TUint)aIndex) < iEnd, ESqlPanicBadArgument);
+	__ASSERT_DEBUG((iBegin + (TUint)aIndex) < iEnd, __SQLPANIC(ESqlPanicBadArgument));
 	iCurrent = iBegin + aIndex;
 	}
 
@@ -55,7 +55,7 @@
 */
 inline TBool TSqlBufRIterator::IsPresent() const
 	{
-	__SQLASSERT(iCurrent >= iBegin && iCurrent < iEnd, ESqlPanicInternalError);
+	__ASSERT_DEBUG(iCurrent >= iBegin && iCurrent < iEnd, __SQLPANIC(ESqlPanicInternalError));
 	return iCurrent->iPos > 0;
 	}
 	
@@ -64,7 +64,7 @@
 */
 inline TInt TSqlBufRIterator::Type() const
 	{
-	__SQLASSERT(iCurrent >= iBegin && iCurrent < iEnd, ESqlPanicInternalError);
+	__ASSERT_DEBUG(iCurrent >= iBegin && iCurrent < iEnd, __SQLPANIC(ESqlPanicInternalError));
 	return iCurrent->Type();
 	}
 	
@@ -73,7 +73,7 @@
 */
 inline TInt TSqlBufRIterator::Size() const
 	{
-	__SQLASSERT(iCurrent >= iBegin && iCurrent < iEnd, ESqlPanicInternalError);
+	__ASSERT_DEBUG(iCurrent >= iBegin && iCurrent < iEnd, __SQLPANIC(ESqlPanicInternalError));
 	return Type() == ESqlText ? iCurrent->Size() / sizeof(TUint16) : iCurrent->Size();
 	}
 
@@ -101,7 +101,7 @@
 */
 inline TBool TSqlBufWIterator::Next()
 	{
-	__SQLASSERT(iBuf != NULL, ESqlPanicInternalError);
+	__ASSERT_DEBUG(iBuf != NULL, __SQLPANIC(ESqlPanicInternalError));
 	return ++iIndex < iBuf->Count();	
 	}
 	
@@ -112,8 +112,8 @@
 */
 inline void TSqlBufWIterator::MoveTo(TInt aIndex)
 	{
-	__SQLASSERT(iBuf != NULL, ESqlPanicInternalError);
-	__SQLASSERT((TUint)aIndex < iBuf->Count(), ESqlPanicInternalError);
+	__ASSERT_DEBUG(iBuf != NULL, __SQLPANIC(ESqlPanicInternalError));
+	__ASSERT_DEBUG((TUint)aIndex < iBuf->Count(), __SQLPANIC(ESqlPanicInternalError));
 	iIndex = aIndex;
 	}
 
@@ -122,8 +122,8 @@
 */
 inline void TSqlBufWIterator::SetNull()
 	{
-	__SQLASSERT(iBuf != NULL, ESqlPanicInternalError);
-	__SQLASSERT((TUint)iIndex < iBuf->Count(), ESqlPanicInternalError);
+	__ASSERT_DEBUG(iBuf != NULL, __SQLPANIC(ESqlPanicInternalError));
+	__ASSERT_DEBUG((TUint)iIndex < iBuf->Count(), __SQLPANIC(ESqlPanicInternalError));
 	(void)iBuf->SetField(iIndex, ESqlNull, NULL, 0);
 	}
 	
@@ -135,10 +135,10 @@
 */
 inline void TSqlBufWIterator::SetAsNotPresent(TInt aType, TInt aLength)
 	{
-	__SQLASSERT(::IsSequenceSqlType(aType), ESqlPanicBadArgument);
-	__SQLASSERT(aLength >= 0, ESqlPanicBadArgument);
-	__SQLASSERT(iBuf != NULL, ESqlPanicInternalError);
-	__SQLASSERT((TUint)iIndex < iBuf->Count(), ESqlPanicInternalError);
+	__ASSERT_DEBUG(::IsSequenceSqlType(aType), __SQLPANIC(ESqlPanicBadArgument));
+	__ASSERT_DEBUG(aLength >= 0, __SQLPANIC(ESqlPanicBadArgument));
+	__ASSERT_DEBUG(iBuf != NULL, __SQLPANIC(ESqlPanicInternalError));
+	__ASSERT_DEBUG((TUint)iIndex < iBuf->Count(), __SQLPANIC(ESqlPanicInternalError));
 	iBuf->SetField(iIndex, aType, NULL, aType == ESqlText ? aLength * sizeof(TUint16) : aLength);
 	}
 	
@@ -152,8 +152,8 @@
 */
 inline TInt TSqlBufWIterator::SetInt(TInt aValue)
 	{
-	__SQLASSERT(iBuf != NULL, ESqlPanicInternalError);
-	__SQLASSERT((TUint)iIndex < iBuf->Count(), ESqlPanicInternalError);
+	__ASSERT_DEBUG(iBuf != NULL, __SQLPANIC(ESqlPanicInternalError));
+	__ASSERT_DEBUG((TUint)iIndex < iBuf->Count(), __SQLPANIC(ESqlPanicInternalError));
 	return iBuf->SetField(iIndex, ESqlInt, &aValue, sizeof(TInt));
 	}
 	
@@ -167,8 +167,8 @@
 */
 inline TInt TSqlBufWIterator::SetInt64(TInt64 aValue)
 	{
-	__SQLASSERT(iBuf != NULL, ESqlPanicInternalError);
-	__SQLASSERT((TUint)iIndex < iBuf->Count(), ESqlPanicInternalError);
+	__ASSERT_DEBUG(iBuf != NULL, __SQLPANIC(ESqlPanicInternalError));
+	__ASSERT_DEBUG((TUint)iIndex < iBuf->Count(), __SQLPANIC(ESqlPanicInternalError));
 	return iBuf->SetField(iIndex, ESqlInt64, &aValue, sizeof(TInt64));
 	}
 	
@@ -182,8 +182,8 @@
 */
 inline TInt TSqlBufWIterator::SetReal(TReal aValue)
 	{
-	__SQLASSERT(iBuf != NULL, ESqlPanicInternalError);
-	__SQLASSERT((TUint)iIndex < iBuf->Count(), ESqlPanicInternalError);
+	__ASSERT_DEBUG(iBuf != NULL, __SQLPANIC(ESqlPanicInternalError));
+	__ASSERT_DEBUG((TUint)iIndex < iBuf->Count(), __SQLPANIC(ESqlPanicInternalError));
 	return iBuf->SetField(iIndex, ESqlReal, &aValue, sizeof(TReal));
 	}
 	
@@ -197,8 +197,8 @@
 */
 inline TInt TSqlBufWIterator::SetBinary(const TDesC8& aValue)
 	{
-	__SQLASSERT(iBuf != NULL, ESqlPanicInternalError);
-	__SQLASSERT((TUint)iIndex < iBuf->Count(), ESqlPanicInternalError);
+	__ASSERT_DEBUG(iBuf != NULL, __SQLPANIC(ESqlPanicInternalError));
+	__ASSERT_DEBUG((TUint)iIndex < iBuf->Count(), __SQLPANIC(ESqlPanicInternalError));
 	return iBuf->SetField(iIndex, ESqlBinary, aValue.Ptr(), aValue.Length());
 	}
 	
@@ -212,8 +212,8 @@
 */
 inline TInt TSqlBufWIterator::SetText(const TDesC16& aValue)
 	{
-	__SQLASSERT(iBuf != NULL, ESqlPanicInternalError);
-	__SQLASSERT((TUint)iIndex < iBuf->Count(), ESqlPanicInternalError);
+	__ASSERT_DEBUG(iBuf != NULL, __SQLPANIC(ESqlPanicInternalError));
+	__ASSERT_DEBUG((TUint)iIndex < iBuf->Count(), __SQLPANIC(ESqlPanicInternalError));
 	return iBuf->SetField(iIndex, ESqlText, aValue.Ptr(), aValue.Length() * sizeof(TUint16));
 	}
 
@@ -228,7 +228,7 @@
 */
 inline TInt TSqlBufWIterator::SetZeroBlob(TInt aSize)
 	{
-	__SQLASSERT(iBuf != NULL, ESqlPanicInternalError);
-	__SQLASSERT((TUint)iIndex < iBuf->Count(), ESqlPanicInternalError);
+	__ASSERT_DEBUG(iBuf != NULL, __SQLPANIC(ESqlPanicInternalError));
+	__ASSERT_DEBUG((TUint)iIndex < iBuf->Count(), __SQLPANIC(ESqlPanicInternalError));
 	return iBuf->SetField(iIndex, ESqlZeroBlob, &aSize, sizeof(TInt));
 	}
--- a/persistentstorage/sql/SRC/Common/SqlMap.h	Tue Jul 06 16:18:30 2010 +0300
+++ b/persistentstorage/sql/SRC/Common/SqlMap.h	Wed Aug 18 11:30:17 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2004-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -18,7 +18,7 @@
 #ifndef __SQLMAP_H__
 #define __SQLMAP_H__
 
-#include "SqlPanic.h"
+#include "SqlAssert.h"
 
 //Forward declaration
 template <class KEY, class DATA, class REFCNTR, class DESTRUCTOR> class RSqlMap;
--- a/persistentstorage/sql/SRC/Common/SqlMap.inl	Tue Jul 06 16:18:30 2010 +0300
+++ b/persistentstorage/sql/SRC/Common/SqlMap.inl	Wed Aug 18 11:30:17 2010 +0300
@@ -142,7 +142,7 @@
 			}
 		return;
 		}
-	__SQLASSERT(EFalse, ESqlPanicInternalError);
+	__ASSERT_DEBUG(EFalse, __SQLPANIC(ESqlPanicInternalError));
 	}
 
 /**
--- a/persistentstorage/sql/SRC/Common/SqlPanic.h	Tue Jul 06 16:18:30 2010 +0300
+++ b/persistentstorage/sql/SRC/Common/SqlPanic.h	Wed Aug 18 11:30:17 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2005-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -16,11 +16,6 @@
 #ifndef __SQLPANIC_H__
 #define __SQLPANIC_H__
 
-#include "SqlAssert.h"
-
-//Forward declarations
-class RMessage2;
-
 /**
 TSqlPanic contains panic codes which may used by the SQL component (SqlDb.dll and SqlSrv.exe).
 
@@ -44,27 +39,4 @@
 	ESqlPanicBadDescriptor		=  13
 	};
 
-/**
-This function panics the thread where it is called from with aPanicCode panic code.
-
-@param aPanicCode Panic code
-
-@internalComponent
-*/
-void SqlPanic(TSqlPanic aPanicCode);
-
-/**
-This function is used inside the SQL server to panic the calling client.
-
-@param aMessage The message which processing causes the panic.
-@param aPanicCode Panic code
-
-@leave KSqlLeavePanic
-
-@return KErrNone
-
-@internalComponent
-*/
-TInt SqlPanicClientL(const RMessage2& aMessage, TSqlPanic aPanicCode);
-	
 #endif //__SQLPANIC_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/persistentstorage/sql/SRC/Common/SqlTraceDef.h	Wed Aug 18 11:30:17 2010 +0300
@@ -0,0 +1,103 @@
+// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+#ifndef SQLTRACEDEF_H
+#define SQLTRACEDEF_H
+
+#include <e32def.h>
+#include "SqlAssert.h"
+
+//////////////////////////////////////////////////////////////////////////////////////
+
+#if defined OST_TRACE_COMPILER_IN_USE && defined _SQL_BORDER_TRACE_ENABLED
+    #define __SQLTRACE_BORDERVAR(var) var
+    #define __SQLTRACE_BORDEREXPR(expr) expr
+#else
+    #define __SQLTRACE_BORDERVAR(var)
+    #define __SQLTRACE_BORDEREXPR(expr)
+#endif    
+
+#if defined OST_TRACE_COMPILER_IN_USE && defined _SQL_INTERNALS_TRACE_ENABLED
+    #define __SQLTRACE_INTERNALSVAR(var) var
+    #define __SQLTRACE_INTERNALSEXPR(expr) expr
+#else
+    #define __SQLTRACE_INTERNALSVAR(var)
+    #define __SQLTRACE_INTERNALSEXPR(expr)
+#endif
+
+#if defined OST_TRACE_COMPILER_IN_USE && defined _SQL_BUR_TRACE_ENABLED
+    #define __SQLTRACE_BURVAR(var) var
+    #define __SQLTRACE_BUREXPR(expr) expr
+#else
+    #define __SQLTRACE_BURVAR(var)
+    #define __SQLTRACE_BUREXPR(expr)
+#endif
+
+#if defined OST_TRACE_COMPILER_IN_USE && defined _SQL_COMPACT_TRACE_ENABLED
+    #define __SQLTRACE_COMPACTVAR(var) var
+    #define __SQLTRACE_COMPACTEXPR(expr) expr
+#else
+    #define __SQLTRACE_COMPACTVAR(var)
+    #define __SQLTRACE_COMPACTEXPR(expr)
+#endif
+
+#if defined OST_TRACE_COMPILER_IN_USE && defined _SQL_SESSION_TRACE_ENABLED
+    #define __SQLTRACE_SESSIONVAR(var) var
+    #define __SQLTRACE_SESSIONEXPR(expr) expr
+#else
+    #define __SQLTRACE_SESSIONVAR(var)
+    #define __SQLTRACE_SESSIONEXPR(expr)
+#endif
+
+#if defined OST_TRACE_COMPILER_IN_USE && defined _SQL_AUTHORIZER_TRACE_ENABLED
+    #define __SQLTRACE_AUTHORIZERVAR(var) var
+    #define __SQLTRACE_AUTHORIZEREXPR(expr) expr
+#else
+    #define __SQLTRACE_AUTHORIZERVAR(var)
+    #define __SQLTRACE_AUTHORIZEREXPR(expr)
+#endif
+
+#if defined OST_TRACE_COMPILER_IN_USE && defined _SQL_BLOB_TRACE_ENABLED
+    #define __SQLTRACE_BLOBVAR(var) var
+    #define __SQLTRACE_BLOBEXPR(expr) expr
+#else
+    #define __SQLTRACE_BLOBVAR(var)
+    #define __SQLTRACE_BLOBEXPR(expr)
+#endif
+
+//////////////////////////////////////////////////////////////////////////////////////
+
+#if defined OST_TRACE_COMPILER_IN_USE && defined _SQL_RDEBUG_PRINT
+    #undef OstTrace0 
+    #undef OstTrace1 
+    #undef OstTraceExt1 
+    #undef OstTraceExt2 
+    #undef OstTraceExt3 
+    #undef OstTraceExt4 
+    #undef OstTraceExt5
+
+    void SqlPrintf(TInt aGroupName, TInt aTraceName, const char* aFormat, ...);
+
+    #define OstTrace0    SqlPrintf 
+    #define OstTrace1    SqlPrintf
+    #define OstTraceExt1 SqlPrintf
+    #define OstTraceExt2 SqlPrintf
+    #define OstTraceExt3 SqlPrintf
+    #define OstTraceExt4 SqlPrintf
+    #define OstTraceExt5 SqlPrintf
+#endif//defined OST_TRACE_COMPILER_IN_USE && defined _SQL_RDEBUG_PRINT
+
+//////////////////////////////////////////////////////////////////////////////////////
+
+#endif//SQLTRACEDEF_H
--- a/persistentstorage/sql/SRC/Common/SqlUtil.cpp	Tue Jul 06 16:18:30 2010 +0300
+++ b/persistentstorage/sql/SRC/Common/SqlUtil.cpp	Wed Aug 18 11:30:17 2010 +0300
@@ -14,18 +14,101 @@
 //
 
 #include <e32svr.h>
+#include "SqlAssert.h"
 #include <sqldb.h>		//ESqlAtRow, ESqlAtEnd, ESqlErrGeneral
-#include "SqlUtil.h"
-#include "SqlPanic.h"	//SqlPanic(), TSqlPanic
 #include "sqlite3.h"	//SQLITE_OK, SQLITE_ROW, SQLITE_DONE
-#include "UTraceSql.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "SqlUtilTraces.h"
+#endif
+#include "SqlTraceDef.h"
+
+///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+const TInt KSqlLeavePanic = -359;//The (last-1) error code from the reserved area for the SQL component.
+
+#define UNUSED_ARG(arg) arg = arg
+#define UNUSED_DES(arg) arg
+
+///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+#if defined OST_TRACE_COMPILER_IN_USE &&  defined _SQL_RDEBUG_PRINT
+
+/**
+This class has been added here to avoid the crashes when _SQL_RDEBUG_PRINT macro is defined but the
+data to be printed out is too big and cannot fit into the buffer with size KSqlMaxPrnStrLen.
+@internalComponent   
+*/
+class TSqlDes16Overflow : public TDes16Overflow
+    {
+public:    
+    virtual void Overflow(TDes16& /*aDes*/)
+        {
+        }
+    };
+
+//Replaces:
+// 1) "%lld" with "%ld"
+// 2) "%s" with "%S"
+//These are the differences in format specification between RDebig::Print and OST functions.
+//The new format spec length should be less or equal than the old format spec length.
+static void ReplaceFmtSpec(TDes& aFormat, const TDesC& aFmtSpec, const TDesC& aNewFmtSpec)
+	{
+	TInt fmtLength = aFormat.Length();
+	const TInt KDiff = aFmtSpec.Length() - aNewFmtSpec.Length();
+    TPtr ptr((TText*)aFormat.Ptr(), fmtLength, fmtLength);
+    TInt pos;
+    while((pos = ptr.Find(aFmtSpec)) >= 0)
+    	{
+		ptr.Replace(pos, aFmtSpec.Length(), aNewFmtSpec);
+		fmtLength -= KDiff;
+		ptr.Set(ptr.MidTPtr(pos));
+    	}
+    aFormat.SetLength(fmtLength);
+	}
+
+void SqlPrintf(TInt /*aGroupName*/, TInt /*aTraceName*/, const char* aFormat, ...)
+    {
+    VA_LIST list;
+    VA_START(list, aFormat);
+    TBuf<128> format;
+    _LIT(KTraceIdent, "SQL;");
+    format.Copy(TPtrC8((const TUint8*)aFormat));
+    format.Insert(0, KTraceIdent);
+    format.Append(_L("\r\n"));
+    _LIT(KOstI64Fmt, "%lld");
+    _LIT(KDbgPrnI64Fmt, "%ld");
+    ReplaceFmtSpec(format, KOstI64Fmt, KDbgPrnI64Fmt);
+    _LIT(KOstDes8Fmt, "%s");
+    _LIT(KDbgPrnDesFmt, "%S");
+    ReplaceFmtSpec(format, KOstDes8Fmt, KDbgPrnDesFmt);
+    TBuf<KSqlMaxPrnStrLen> buf;
+    TSqlDes16Overflow overflowHandler;
+    buf.AppendFormatList(format, list, &overflowHandler);
+#ifdef _SQL_RDEBUG_PRINT    
+    RDebug::RawPrint(buf);
+#endif
+    }
+
+const TDesC* SqlDes8to16Ptr(const TDesC8& aDes, TDes& aOut)
+	{
+	TPtrC8 ptr(aDes.Ptr(), Min(aDes.Length(), aOut.MaxLength()));
+	aOut.Copy(ptr);
+	return &aOut;
+	}
+
+#endif//defined OST_TRACE_COMPILER_IN_USE &&  defined _SQL_RDEBUG_PRINT 
+
+///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 
 /**
 SQL panic category.
 
 @internalComponent
 */
-_LIT(KPanicCategory,"SqlDb");
+_LIT(KPanicCategory, "SqlDb");
+
+///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 
 /**
 Panics the caller with aPanicCode panic code.
@@ -35,11 +118,13 @@
 
 @internalComponent
 */
-void SqlPanic(TSqlPanic aPanicCode)
+static void SqlPanic(TSqlPanic aPanicCode)
 	{
 	User::Panic(KPanicCategory, aPanicCode);
 	}
 	
+///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
 /**
 Panics the client with aPanicCode panic code.
 This function is used by the SQL server to panic the caller (the client).
@@ -53,13 +138,158 @@
 
 @internalComponent
 */
-TInt SqlPanicClientL(const RMessage2& aMessage, TSqlPanic aPanicCode)
+static TInt SqlPanicClientL(const RMessage2& aMessage, TSqlPanic aPanicCode)
 	{
 	aMessage.Panic(KPanicCategory, aPanicCode);
-	__SQLLEAVE(KSqlLeavePanic);
+	__SQLLEAVE2(KSqlLeavePanic);
 	return KErrNone;
-	}
-	
+	}	
+
+///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+/**
+The function prints out a "SQL panic" message to the console and panics the thread where it is called from.
+It gives a useful information about the found error together with the source file name and line number where
+it occurred.
+
+Note: this function  will output information regarding the panic only if _SQL_PANIC_TRACE_ENABLED macro is defined  
+
+@param aFile Source file name
+@param aLine Source line number
+@param aPanicCode Panic code
+@param aHandle Numeric value, uniquely identfying the leaving location (the "this" pointer for example)
+
+@return KErrNone
+
+@internalComponent
+*/  
+TInt TSqlUtil::Panic(const TText* aFile, TInt aLine, TInt aPanicCode, TUint aHandle)
+    {
+#if defined OST_TRACE_COMPILER_IN_USE && defined _SQL_PANIC_TRACE_ENABLED
+    TPtrC fname(FileName(aFile));
+    OstTraceExt5(TRACE_FATAL, TSQLUTIL_PANIC, "Panic;0x%X;%S;%d;%S;%d", aHandle, __SQLPRNSTR(fname), aLine, __SQLPRNSTR(KPanicCategory), aPanicCode);
+#else
+    UNUSED_ARG(aFile);
+    UNUSED_ARG(aLine);
+    UNUSED_ARG(aHandle);
+#endif      
+    ::SqlPanic(static_cast <TSqlPanic> (aPanicCode));
+    return KErrNone;
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+/**
+The function prints out a "SQL leave" message to the console and leaves with aError error code.
+It gives a usefull information about the found error together with the source file name and line number where
+it occured.
+
+Note: this function  will output information regarding the panic only if _SQL_LEAVE_TRACE_ENABLED macro is defined  
+
+@param aFile Source file name
+@param aLine Source line number
+@param aError Error code
+@param aHandle Numeric value, uniquely identfying the leaving location (the "this" pointer for example)
+
+@internalComponent
+*/  
+void TSqlUtil::Leave(const TText* aFile, TInt aLine, TInt aError, TUint aHandle)
+    {
+#if defined OST_TRACE_COMPILER_IN_USE && defined _SQL_LEAVE_TRACE_ENABLED     
+    TPtrC fname(FileName(aFile));
+    OstTraceExt4(TRACE_ERROR, TSQLUTIL_LEAVE, "Leave;0x%X;%S;%d;Error=%d", aHandle, __SQLPRNSTR(fname), aLine, aError);
+#else
+    UNUSED_ARG(aFile);
+    UNUSED_ARG(aLine);
+    UNUSED_ARG(aHandle);
+#endif
+    User::Leave(aError);
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+/**
+The function prints out a "SQL leave" message to the console and leaves with aError error code, if it is 
+negative.
+It gives a usefull information about the found error together with the source file name and line number where
+it occured.
+
+Note: this function  will output information regarding the panic only if _SQL_LEAVE_TRACE_ENABLED macro is defined  
+
+@param aFile Source file name
+@param aLine Source line number
+@param aError Error code
+
+@internalComponent
+*/  
+TInt TSqlUtil::LeaveIfError(const TText* aFile, TInt aLine, TInt aError, TUint aHandle)
+    {
+    if(aError < 0)
+        {
+        TSqlUtil::Leave(aFile, aLine, aError, aHandle);
+        }
+    return aError;
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+/**
+The function prints out a "SQL leave" message to the console and leaves with KErrNoMemory if 
+aPtr parameter is NULL.
+
+Note: this function  will output information regarding the panic only if _SQL_LEAVE_TRACE_ENABLED macro is defined  
+
+@param aFile Source file name
+@param aLine Source line number
+@param aPtr The pointer to be tested against NULL value.
+
+@internalComponent
+*/  
+void* TSqlUtil::LeaveIfNull(const TText* aFile, TInt aLine, void* aPtr, TUint aHandle)
+    {
+    if(!aPtr)
+        {
+        TSqlUtil::Leave(aFile, aLine, KErrNoMemory, aHandle);
+        }
+    return aPtr;
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+/**
+The function is used by the SQL server.
+It prints out a "SQL panic" message to the console and panic the client.
+It gives a usefull information about the found error together with the source file name and line number where
+it occured.
+
+Note: this function  will output information regarding the panic only if _SQL_PANIC_TRACE_ENABLED macro is defined  
+
+@param aFile Source file name
+@param aLine Source line number
+@param aMessage The client message, which processing caused the panic.
+@param aPanicCode Error code
+
+@leave KSqlLeavePanic
+
+@return KErrNone;
+
+@internalComponent
+*/  
+TInt TSqlUtil::PanicClientL(const TText* aFile, TInt aLine, const RMessage2& aMessage, TInt aPanicCode, TUint aHandle)
+    {
+#if defined OST_TRACE_COMPILER_IN_USE && defined  _SQL_PANIC_TRACE_ENABLED
+    TPtrC fname(FileName(aFile));
+    OstTraceExt5(TRACE_FATAL, TSQLUTIL_PANICCLIENTL, "Panic;%X;%S;%d;%S;%d", aHandle, __SQLPRNSTR(fname), aLine, __SQLPRNSTR(KPanicCategory), aPanicCode);
+#else
+    UNUSED_ARG(aFile);
+    UNUSED_ARG(aLine);
+    UNUSED_ARG(aHandle);
+#endif      
+    return ::SqlPanicClientL(aMessage, static_cast <TSqlPanic> (aPanicCode));
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
 /**
 Processes SQL database error code and OS error code and returns unified error code.
 If aSqlError == SQLITE_ROW then the function returns KSqlAtRow.
@@ -80,7 +310,8 @@
 */
 TInt Sql2OsErrCode(TInt aSqlError, TInt aOsError)
 	{
-	__SQLASSERT(aSqlError >= SQLITE_OK && aOsError <= KErrNone, ESqlPanicBadArgument);
+
+	__ASSERT_DEBUG(aSqlError >= SQLITE_OK && aOsError <= KErrNone, __SQLPANIC2(ESqlPanicBadArgument));
 	TInt err = KErrNone;
 	if(aOsError == KErrDiskFull)
 		{//Whatever is the aSqlError value, even SQLITE_OK, never ignore KErrDiskFull errors
@@ -114,243 +345,19 @@
 	return err;
 	}
 
-////////////////////////////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////   class Util   ////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////////////////////////////
-#if defined _LOGGING || defined SYMBIAN_TRACE_SQL_ERR
-
-/**
-This function is used to log the message "msg" containing the "err" error code.
-The message "msg" should contain the format specifier %d.
-
-The function is used when _LOGGING or SYMBIAN_TRACE_SQL_ERR is defined.
-
-@param aMsg Error message
-@param aErr Error code
-
-@internalComponent
-*/	
-void Util::ErrorPrint(const TDesC& aMsg, TInt aErr)
-	{
-	SYMBIAN_TRACE_SQL_ERR_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EError), aMsg, aErr));
-	RDebug::Print(aMsg, aErr);
-	}
-
-/**
-This macro should be used to log the message "msg" containing the "str" string.
-The message "msg" should contain the format specifier %S.
-
-The function is used when _LOGGING or SYMBIAN_TRACE_SQL_ERR is defined.
-
-@param aMsg Error message
-@param aErr Error code
-
-@internalComponent
-*/	
-void Util::ErrorPrint(const TDesC& aMsg, const TDesC& aStr)
-	{
-	SYMBIAN_TRACE_SQL_ERR_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EError), aMsg, &aStr));
-	RDebug::Print(aMsg, &aStr);
-	}
-
-#endif  //_LOGGING || SYMBIAN_TRACE_SQL_ERR
-
-#if defined _ASSERTIONS
-
-/**
-The function prints out a "SQL panic" message to the console and panics the thread where it is called from.
-It gives a useful information about the found error together with the source file name and line number where
-it occurred.
-
-The function is used when _ASSERTIONS is defined.
-
-@param aFile Source file name
-@param aLine Source line number
-@param aPanicCode Panic code
-
-@return KErrNone
-
-@internalComponent
-*/	
-TInt Util::Assert(const TText* aFile, TInt aLine, TInt aPanicCode)
-	{
-	TBuf<16> tbuf;
-	Util::GetTimeStr(tbuf);
-	TBuf<80> buf;
-	_LIT(KFormat,"**%S* SQL panic %d, at %S(%d)");
-	TPtrC fname(Filename(aFile));
-	SYMBIAN_TRACE_SQL_ERR_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EError), KSqlPanic, aPanicCode, &fname, aLine));
-	buf.Format(KFormat, &tbuf, aPanicCode, &fname, aLine);
-	RDebug::Print(buf);
-	::SqlPanic(static_cast <TSqlPanic> (aPanicCode));
-	return KErrNone;
-	}
-
-#else //_ASSERTIONS
-
-/**
-The function panics the thread where it is called from.
-
-The function is used when _ASSERTIONS is not defined.
-
-@param Not used
-@param Not used
-@param aPanicCode Panic code
-
-@return KErrNone
-
-@internalComponent
-*/	
-TInt Util::Assert(const TText*, TInt, TInt aPanicCode)
-	{
-	::SqlPanic(static_cast <TSqlPanic> (aPanicCode));
-	return KErrNone;
-	}
-	
-#endif //_ASSERTIONS
-
-#if defined _NOTIFY || defined SYMBIAN_TRACE_SQL_ERR
-	
-/**
-The function prints out a "SQL leave" message to the console and leaves with aError error code.
-It gives a usefull information about the found error together with the source file name and line number where
-it occured.
-
-The function is used when _NOTIFY is defined.
-
-@param aFile Source file name
-@param aLine Source line number
-@param aError Error code
+///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 
-@internalComponent
-*/	
-void Util::Leave(const TText* aFile, TInt aLine, TInt aError)
-	{
-	SYMBIAN_TRACE_SQL_ERR_ONLY(TPtrC filename(Filename(aFile)));
-	SYMBIAN_TRACE_SQL_ERR_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EError), KSqlLeave, aError, &filename, aLine));	
-
-#ifdef _NOTIFY
-	TBuf<16> tbuf;
-	Util::GetTimeStr(tbuf);
-	TPtrC f(Filename(aFile));
-	TBuf<80> buf;
-	_LIT(KFormat,"**%S* SQL leave, error=%d at %S(%d)\r\n");
-	buf.Format(KFormat, &tbuf, aError, &f, aLine);
-	RDebug::Print(buf);
-#endif //_NOTIFY
-	User::Leave(aError);
-	}
-	
-/**
-The function prints out a "SQL leave" message to the console and leaves with aError error code, if it is 
-negative.
-It gives a usefull information about the found error together with the source file name and line number where
-it occured.
-
-The function is used when _NOTIFY is defined.
-
-@param aFile Source file name
-@param aLine Source line number
-@param aError Error code
-
-@internalComponent
-*/	
-TInt Util::LeaveIfError(const TText* aFile, TInt aLine, TInt aError)
-	{
-	if(aError<0)
-		Util::Leave(aFile,aLine,aError);
-	return aError;
-	}
-
-/**
-The function prints out a "SQL leave" message to the console and leaves with KErrNoMemory if 
-aPtr parameter is NULL.
-
-The function is used when _NOTIFY is defined.
-
-@param aFile Source file name
-@param aLine Source line number
-@param aPtr The pointer to be tested against NULL value.
+#if defined OST_TRACE_COMPILER_IN_USE && (defined _SQL_PANIC_TRACE_ENABLED || defined _SQL_LEAVE_TRACE_ENABLED) 
 
-@internalComponent
-*/	
-const void* Util::LeaveIfNull(const TText* aFile, TInt aLine, const void* aPtr)
-	{
-	if(!aPtr)
-		{
-		Util::Leave(aFile, aLine, KErrNoMemory);
-		}
-	return aPtr;
-	}
-
-/**
-The function is used by the SQL server.
-It prints out a "SQL panic" message to the console and panic the client.
-It gives a usefull information about the found error together with the source file name and line number where
-it occured.
-
-The function is used when _NOTIFY is defined.
-
-@param aFile Source file name
-@param aLine Source line number
-@param aMessage The client message, which processing caused the panic.
-@param aPanicCode Error code
-
-@leave KSqlLeavePanic
-
-@return KErrNone;
-
-@internalComponent
-*/	
-TInt Util::PanicClientL(const TText* aFile, TInt aLine, const RMessage2& aMessage, TInt aPanicCode)
-	{
-	SYMBIAN_TRACE_SQL_ERR_ONLY(TPtrC filename(Filename(aFile)));
-	SYMBIAN_TRACE_SQL_ERR_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EError), KSqlPanicClient, aPanicCode, &filename, aLine));	
-	
-#ifdef _NOTIFY
-	TBuf<16> tbuf;
-	Util::GetTimeStr(tbuf);
-	TPtrC fname(Filename(aFile));
-	TBuf<80> buf;
-	_LIT(KFormat,"**%S* SQL panic=%d at %S(%d)\r\n");
-	buf.Format(KFormat, &tbuf, aPanicCode, &fname, aLine);
-	RDebug::Print(buf);
-#endif
-	return ::SqlPanicClientL(aMessage, static_cast <TSqlPanic> (aPanicCode));
-	}
-
-#endif//defined _NOTIFY || SYMBIAN_TRACE_SQL_ERR
-
-#if defined _ASSERTIONS || defined _NOTIFY ||defined SYMBIAN_TRACE_SQL_ERR
-
-/**
-Formats the current time into aWhere descriptor.
-
-@param aWhere Output parameter. The current time will be formatted there. The buffer length should be at least 16 characters.
-
-The function is used when _ASSERT or _NOTIFY or SYMBIAN_TRACE_SQL_ERR is defined.
-
-@internalComponent
-*/
-void Util::GetTimeStr(TDes& aWhere)
-	{
-	TTime time;
-	time.HomeTime();
-	TDateTime dt = time.DateTime();
-	aWhere.Format(_L("%02d:%02d:%02d.%06d"), dt.Hour(), dt.Minute(), dt.Second(), dt.MicroSecond());
-	};
-	
 /**
 The function creates and returns TPtrC object which points to aFile parameter.
 
 @param aFile File name
 @return TPtrC object pointing to aFile parameter.
 
-The function is used when _ASSERT or _NOTIFY or SYMBIAN_TRACE_SQL_ERR is defined.
-
 @internalComponent
 */	
-TPtrC Util::Filename(const TText* aFile)
+TPtrC TSqlUtil::FileName(const TText* aFile)
 	{
 	TPtrC p(aFile);
 	TInt ix = p.LocateReverse('\\');
@@ -361,4 +368,4 @@
 	return p;
 	}
 
-#endif//defined _ASSERTIONS || defined _NOTIFY || SYMBIAN_TRACE_SQL_ERR
+#endif //defined OST_TRACE_COMPILER_IN_USE && (defined _SQL_PANIC_TRACE_ENABLED || defined _SQL_LEAVE_TRACE_ENABLED)
--- a/persistentstorage/sql/SRC/Common/Trace/UTraceSql.cpp	Tue Jul 06 16:18:30 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,217 +0,0 @@
-// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-#include <e32std.h>
-
-//The file is used only to compile and include in the executable server image only a single
-//copy of the trace strings.
-#define __SQLTRACE_STRINGS__
-#include "UTraceSql.h"
-
-#ifdef SYMBIAN_TRACE_SQL_EVENTS
-
-/**
-Get the corresponding string to the IPC function from the TSqlSrvFunction enum
-
-@param aFunction Function code
-			
-@return A pointer to the string literal associated with the TSqlSrvFunction enum identifiers
-
-@internalComponent
- */ 
-const TPtrC8 GetIPCFuncStr(TInt aFunction)
-	{
-	TInt function = aFunction & 0xFF;
-	
-	//Array of Sql Server's IPC functions.This should map to TSqlSrvFunction
-	const TText8* const KSrvFunctionStr[] =
-	   {
-	   //Test functions	   
-		_S8("ESqlSrvTestBase"),			//0x00
-		_S8("ESqlSrvResourceMark"),		//0x01
-		_S8("ESqlSrvResourceCheck"),	//0x02
-		_S8("ESqlSrvResourceCount"),	//0x03
-		_S8("ESqlSrvSetDbHeapFailure"),	//0x04
-		_S8("ESqlSrvSetHeapFailure"),	//0x05
-		
-		//Profiling functions	
-		_S8("ESqlSrvProfilerStart"),	//0x06
-		_S8("ESqlSrvProfilerStop"),		//0x07
-		_S8("ESqlSrvProfilerReset"),	//0x08
-		_S8("ESqlSrvProfilerSetRange"),	//0x09
-		_S8("ESqlSrvProfilerQuery"),	//0x0A
-		
-		//Not Used
-		_S8(""),						//0x0B
-		_S8(""),						//0x0C
-		_S8(""),						//0x0D
-		_S8(""),						//0x0E
-		_S8(""),						//0x0F
-		
-		//Database functions
-		_S8("ESqlSrvDbBase"),			//0x10
-		_S8("ESqlSrvDbCreate"),			//0x11
-		_S8("ESqlSrvDbCreateSecure"),	//0x12
-		_S8("ESqlSrvDbOpen"),			//0x13
-		_S8("ESqlSrvDbOpenFromHandle"),	//0x14
-		_S8("ESqlSrvDbClose"),			//0x15	
-		_S8("ESqlSrvDbCopy"),			//0x16
-		_S8("ESqlSrvDbDelete"),			//0x17
-		
-		//All operations with opcode > ESqlSrvDbDelete require valid database object (on the server side)	
-		_S8("ESqlSrvLastErrorMsg"),			//0x18
-		_S8("ESqlSrvDbExec8"),				//0x19
-		_S8("ESqlSrvDbExec16"),				//0x1A
-		_S8("ESqlSrvDbRowIdExec16"),		//0x1B
-		_S8("ESqlSrvDbSetIsolationLevel"),	//0x1C
-		_S8("ESqlSrvDbGetSecurityPolicy"),	//0x1D
-		_S8("ESqlSrvDbAttach"),				//0x1E
-		_S8("ESqlSrvDbAttachFromHandle"),	//0x1F
-		_S8("ESqlSrvDbDetach"),				//0x20
-		_S8("ESqlSrvDbScalarFullSelect8"),	//0x21
-		_S8("ESqlSrvDbScalarFullSelect16"),	//0x22
-		_S8("ESqlSrvDbInTransaction"),		//0x23
-		_S8("ESqlSrvDbSize"),				//0x24
-		_S8("ESqlSrvDbSize2"),				//0x25
-		_S8("ESqlSrvDbBlobSource"),			//0x26
-		_S8("ESqlSrvDbLastInsertedRowId"),	//0x27
-		_S8("ESqlSrvDbCompact"),			//0x28
-
-		//Database - reserved drive space management
-		_S8("ESqlSrvDbReserveDriveSpace"), 		//0x29
-		_S8("ESqlSrvDbFreeReservedSpace"),		//0x2A
-		_S8("ESqlSrvDbGetReserveAccess"),		//0x2B
-		_S8("ESqlSrvDbReleaseReserveAccess"),	//0x2C
-		
-		//Not Used
-		_S8(""),						//0x2D
-		_S8(""),						//0x2E
-		_S8(""),						//0x2F
-		_S8(""),						//0x30
-		_S8(""),						//0x31
-		_S8(""),						//0x32
-		_S8(""),						//0x33
-		_S8(""),						//0x34
-		_S8(""),						//0x35
-		_S8(""),						//0x36
-		_S8(""),						//0x37	
-		_S8(""),						//0x38
-		_S8(""),						//0x39
-		_S8(""),						//0x3A
-		_S8(""),						//0x3B
-		_S8(""),						//0x3C
-		_S8(""),						//0x3D
-		_S8(""),						//0x3E
-		_S8(""),						//0x3F
-		_S8(""),						//0x40
-		_S8(""),						//0x41
-		_S8(""),						//0x42
-		_S8(""),						//0x43
-		_S8(""),						//0x44
-		_S8(""),						//0x45
-		_S8(""),						//0x46
-		_S8(""),						//0x47
-		_S8(""),						//0x48
-		_S8(""),						//0x49
-		_S8(""),						//0x4A
-		_S8(""),						//0x4B
-		_S8(""),						//0x4C
-		_S8(""),						//0x4D
-		_S8(""),						//0x4E
-		_S8(""),						//0x4F
-		
-		//Statement functions	
-		_S8("ESqlSrvStmtBase"),				//0x50
-		_S8("ESqlSrvStmtPrepare8"),			//0x51
-		_S8("ESqlSrvStmtPrepare16"),		//0x52	
-		_S8("ESqlSrvStmtClose"),			//0x53
-		_S8("ESqlSrvStmtReset"),			//0x54
-		_S8("ESqlSrvStmtExec"),				//0x55
-		_S8("ESqlSrvStmtAsyncExec"),		//0x56
-		_S8("ESqlSrvStmtBindExec"),			//0x57
-		_S8("ESqlSrvStmtBindExecRowId"),	//0x58
-		_S8("ESqlSrvStmtAsyncBindExec"),	//0x59
-		_S8("ESqlSrvStmtNext"),				//0x5A
-		_S8("ESqlSrvStmtBindNext"),			//0x5B
-		_S8("ESqlSrvStmtColumnNames"),		//0x5C
-		_S8("ESqlSrvStmtParamNames"),		//0x5D
-		_S8("ESqlSrvStmtColumnSource"),		//0x5E
-		_S8("ESqlSrvStmtBinParamSink"),		//0x5F
-		_S8("ESqlSrvStmtTxtParamSink8"),	//0x60
-		_S8("ESqlSrvStmtTxtParamSink16"),	//0x61
-		_S8("ESqlSrvStmtBufFlat"),			//0x62	
-		_S8("ESqlSrvStmtColumnValue"),		//0x63
-		_S8("ESqlSrvStmtDeclColumnTypes"),	//0x64
-		_S8("ESqlSrvStmtEvaluateAll"),		//0x65
-		_S8("ESqlSrvStmtGoto"),				//0x66
-		
-		//Not Used
-		_S8(""),						//0x67
-		_S8(""),						//0x68
-		_S8(""),						//0x69
-		_S8(""),						//0x6A
-		_S8(""),						//0x6B
-		_S8(""),						//0x6C
-		_S8(""),						//0x6D
-		_S8(""),						//0x6E
-		_S8(""),						//0x6F
-
-		//Stream functions
-		_S8("ESqlSrvStreamBase"),		//0x70
-		_S8("ESqlSrvStreamRead"),		//0x71
-		_S8("ESqlSrvStreamWrite"),		//0x72
-		_S8("ESqlSrvStreamSize"),		//0x73
-		_S8("ESqlSrvStreamSynch"),		//0x74
-		_S8("ESqlSrvStreamClose")		//0x75
-	   };
-
-	const TInt KMaxSrvFunctions = sizeof(KSrvFunctionStr) / sizeof(KSrvFunctionStr[0]);
-	
-	if (function <= KMaxSrvFunctions)
-		return KSrvFunctionStr[function];
-	else 
-		return _S8("Unknown");
-	}
-#endif //SYMBIAN_TRACE_SQL_EVENTS
-
-#ifdef SYMBIAN_TRACE_SQL_FUNC
-
-/**
-Create the TSqlUTraceProfiler object which inserts a UTF trace, used to signal a function entry
-
-@param aFunctionStr 	A "const char" pointer describing the function to be profiled.
-						Currently this is the type signature of the function returned by 
-						the __PRETTY_FUNCTION__ macro.
-@param aObj  			A object pointer used to provide context for the function.
-
-@internalComponent
-*/
-TSqlUTraceProfiler::TSqlUTraceProfiler(const TAny* aObj, const char* aFunctionStr):
-iObj(aObj), iFunctionStr(reinterpret_cast<const TUint8*>(aFunctionStr))
-	{
-	UTF::Printf(UTF::TTraceContext(UTF::ESystemCharacteristicMetrics), KProfilerBegin, &iFunctionStr, iObj);
-	}
-
-/**
-Destroys TSqlUTraceProfiler object which inserts a UTF trace, used to signal a function exit
-
-@internalComponent
-*/
-TSqlUTraceProfiler::~TSqlUTraceProfiler()
-	{
-	UTF::Printf(UTF::TTraceContext(UTF::ESystemCharacteristicMetrics), KProfilerEnd, &iFunctionStr, iObj);
-	}
-
-#endif //SYMBIAN_TRACE_SQL_FUNC
--- a/persistentstorage/sql/SRC/Common/Trace/UTraceSql.h	Tue Jul 06 16:18:30 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,183 +0,0 @@
-// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-#ifndef UTRACESQL_H
-#define UTRACESQL_H
-
-#if defined  SQLSRV_ENABLE_TRACE
-//If this header is included from Sqlsrv.exe then use the UID3 from that process
-#define EXECUTABLE_DEFAULT_MODULEUID 0x10281E17
-#define SQL_ENABLE_TRACE
-
-#elif defined SQLDB_ENABLE_TRACE  
-//If this header is included from Sqldb.dll then use the UID3 from that process
-#define EXECUTABLE_DEFAULT_MODULEUID 0x10281E18
-#define SQL_ENABLE_TRACE
-
-#elif defined SQLITELIB_ENABLE_TRACE
-//If this header is included from Sqlite.lib then use the UID3 from that process
-#define EXECUTABLE_DEFAULT_MODULEUID 0x10281E19
-#define SQL_ENABLE_TRACE
-
-#endif //SQLSRV_ENABLE_TRACE, SQLDB_ENABLE_TRACE, SQLITELIB_ENABLE_TRACE 
-
-#ifdef SQL_ENABLE_TRACE
-
-//The UTF header can only be included after EXECUTABLE_DEFAULT_MODULEUID is defined  
-#include <e32utf.h>
-
-/**
-Enable this macro to compile in the SQL trace points that trace function leaves and panics.  
-These traces can be used to assist debugging in client applications and the Symbian SQL.
-
-@SymTraceMacro
-*/
-//#define SYMBIAN_TRACE_SQL_ERR
-/**
-Enable this macro to compile in the SQL trace points that trace exported functions and certain 
-porting layer functions entry and exit. From the timestamps of these trace, the total time spent 
-in these functions can be worked out. 
-These traces are particularly useful for performance investigations.
-
-@SymTraceMacro
-*/
-//#define SYMBIAN_TRACE_SQL_FUNC
-/**
-Enable this macro to compile in the SQL trace points that trace the following internal events. 
-	-	IPC calls send to and serviced by the SQL Server
-	- 	SQL Server's startup and close
-	- 	No. of full table scans and sort operation performed by a RSqlStatement object
-	-	Extra internal information for certain exported and porting layer functions
-These traces can be used to assist performance and debug investigations
-
-@SymTraceMacro
-*/
-//#define SYMBIAN_TRACE_SQL_EVENTS
-#endif //SQL_ENABLE_TRACE	
-
-//////////////////////////////////////////////////////////////////////////////////////////////////////////////
-//////////                      		UTrace Related Strings                      //////////////////////////
-//////////////////////////////////////////////////////////////////////////////////////////////////////////////
-#ifdef SQL_ENABLE_TRACE
-
-#ifdef __SQLTRACE_STRINGS__
-	#define CONST_LIT8(var, val) extern const TLitC8<sizeof(val)> var = {sizeof(val) - 1, val}
-	#define CONST_LIT16(var, val) extern const TLitC16<sizeof(L##val)/2> var = {sizeof(L##val)/2 - 1, L##val}
-#else
-	#define CONST_LIT8(var, val) extern const TLitC8<sizeof(val)> var
-	#define CONST_LIT16(var, val) extern const TLitC16<sizeof(L##val)/2> var
-#endif
-
-//File I/O trace format strings
-CONST_LIT8(KFileRead, 			"Sqlite: Size - %d bytes, File Offset Position - %d,");
-CONST_LIT8(KFileWrite,			"Sqlite: Size - %d bytes, File Offset Position - %d,");
-CONST_LIT8(KFileTruncate,		"Sqlite: Size - %d bytes");
-CONST_LIT8(KFileFileCtr,		"Sqlite: Opeartion Called - %d");
-CONST_LIT16(KFileOpen,			"Sqlite: Sqlite3_file - 0x%x, Filename - \"%S\"");
-CONST_LIT16(KFileName,			"Sqlite: Filename - \"%S\"");
-
-//Input pararmeter format strings 
-CONST_LIT8(KStrParam,			"SqlDb: Parameter %d  - \"%S\"");
-CONST_LIT8(KHexStrParam,		"SqlDb: Parameter 1 - 0x%x, Parameter 2 - \"%S\"");
-CONST_LIT8(KHexIntParam,		"SqlDb: Parameter 1 - 0x%x, Parameter 2 - %d");
-CONST_LIT8(KIntParam,			"SqlDb: Parameter 1  - %d");
-CONST_LIT8(KIntSizeParam,		"SqlDb: Parameter 1 - %d, Parameter %d  - %d bytes");
-
-CONST_LIT16(KStrParam16,		"SqlDb: Parameter %d  - \"%S\"");
-CONST_LIT16(KStrStrParam16,		"SqlDb: Parameter 1 - \"%S\", Parameter 2 - \"%S\"");
-CONST_LIT16(KHexStrParam16,		"SqlDb: Parameter 1 - 0x%x, Parameter 2 - \"%S\"");
-CONST_LIT16(KSizeStrParam16,	"SqlDb: Parameter %d - %d bytes, Parameter %d - \"%S\"");
-CONST_LIT16(KRSqlBlobParam16,	"SqlDb: Parameter 1 - 0x%x, Parameter 2 - \"%S\", Parameter 3 - \"%S\", Parameter 4 - %d, Parameter 5 - \"%S\"");	
-
-//IPC request trace format strings
-CONST_LIT8(KDbMsgStr, 			"SqlDb:  Request - %S Sent to SQL Server");
-CONST_LIT8(KSrvMsgStr, 			"SqlSrv: Request - %S Recieved by SQL Server");
-CONST_LIT8(KSrvStmtCreated, 	"SqlSrv: sqlite3_stmt Object 0x%x Created");
-CONST_LIT8(KSrvStmtStatus,		"SqlSrv: sqlite3_stmt Object 0x%x Destroyed, %d Full Table Scan Performed, %d Sort Performed");
-
-//Server startup and close trace format strings
-CONST_LIT8(KSqlSrvStart,		"SqlSrv: SQL Server Startup");
-CONST_LIT8(KSqlSrvClose,		"SqlSrv: SQL Server Close");
-
-//TSqlUTraceProfiler trace format strings, used to display function entry and exit
-CONST_LIT8(KProfilerBegin,			"Function Entry:\"%S\", Address - 0x%x");
-CONST_LIT8(KProfilerEnd,			"Function Exit:\"%S\",  Address - 0x%x");
-
-//Panic and leave trace format strings
-CONST_LIT16(KSqlPanic,			"Sql: Panic %d at %S(%d)");
-CONST_LIT16(KSqlPanicClient,		"Sql: Panic client %d at %S(%d)");
-CONST_LIT16(KSqlLeave,			"Sql: Leave error %d at %S(%d)");
-CONST_LIT8(KSqlSrvPanicClient, 	"SqlSrv ServiceError: Panic Client %d");
-CONST_LIT8(KSqlSrvError, 		"SqlSrv ServiceError: Error %d");
-
-#endif //SQL_ENABLE_TRACE	
-
-////////////////////////////////////////////////////////////////////////////////////////////////////////////
-//////////              UTrace Related Macro Functions and Class Declarations           ////////////////////
-////////////////////////////////////////////////////////////////////////////////////////////////////////////
-#if defined SYMBIAN_TRACE_SQL_ERR && defined SQL_ENABLE_TRACE
-
-//This macro should be used to trace errors occurring within Symbian SQL.
-//To use the macro, insert the full UTF statement as the macro parameter
-//Works only when SYMBIAN_TRACE_SQL_ERR is enabled. Otherwise it evaluates to zero
-#define SYMBIAN_TRACE_SQL_ERR_ONLY(c) c
-
-#else
-
-#define SYMBIAN_TRACE_SQL_ERR_ONLY(c) do {} while(0)
-#endif //SYMBIAN_TRACE_SQL_ERR
-
-
-#if defined SYMBIAN_TRACE_SQL_FUNC && defined SQL_ENABLE_TRACE
-
-/**
-This class is used to help trace function entry and exits within Symbian SQL 
-Exist only when SYMBIAN_TRACE_SQL_FUNC is enabled.
-
-@internalComponent
-*/
-class TSqlUTraceProfiler
-	{
-	public:
-		TSqlUTraceProfiler(const TAny* aObj, const char* aFunctionStr);
-		~TSqlUTraceProfiler();
-	private: 
-		const TAny* iObj;
-		TPtrC8 iFunctionStr;
-	};
-
-//This macro should be used to trace function entry and exits within Symbian SQL 
-//Works only when SYMBIAN_TRACE_SQL_FUNC is enabled. Otherwise it evaluates to zero
-#define SQLUTRACE_PROFILER(x) TSqlUTraceProfiler _profiler(x, __PRETTY_FUNCTION__)
-
-#else
-
-#define SQLUTRACE_PROFILER(x) do {} while(0)
-#endif //SYMBIAN_TRACE_SQL_FUNC
-
-#if defined SYMBIAN_TRACE_SQL_EVENTS && defined SQL_ENABLE_TRACE
-
-//This macro should be used to trace events occurring within Symbian SQL.
-//To use the macro, insert the full UTF statement as the macro parameter
-//Works only when SYMBIAN_TRACE_SQL_EVENTS is enabled. Otherwise it evaluates to zero
-#define SYMBIAN_TRACE_SQL_EVENTS_ONLY(c) c
-const TPtrC8 GetIPCFuncStr(TInt aFunction);
-
-#else
-
-#define SYMBIAN_TRACE_SQL_EVENTS_ONLY(c) do {} while(0)
-#endif //SYMBIAN_TRACE_SQL_EVENTS
-////////////////////////////////////////////////////////////////////////////////////////////////////////////	
-#endif // UTRACESQL_H
--- a/persistentstorage/sql/SRC/Security/SqlSecurity.cpp	Tue Jul 06 16:18:30 2010 +0300
+++ b/persistentstorage/sql/SRC/Security/SqlSecurity.cpp	Wed Aug 18 11:30:17 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2005-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -14,8 +14,12 @@
 //
 
 #include "SqlSecurityImpl.h"
-#include "SqlPanic.h"
-#include "UTraceSql.h"
+#include "SqlAssert.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "SqlSecurityTraces.h"
+#endif
+#include "SqlTraceDef.h"
 
 const TInt32 KEndOfSPStream = -1;//If found in the stream, given as an argument to RSqlSecurityPolicy::InternalizeL(),
 							     //then there are no more policies in the stream.
@@ -46,8 +50,9 @@
 */
 EXPORT_C TInt RSqlSecurityPolicy::Create(const TSecurityPolicy& aDefaultPolicy)
 	{
-	SQLUTRACE_PROFILER(this);
+	SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, RSQLSECURITYPOLICY_CREATE_ENTRY , "Entry;0x%X;RSqlSecurityPolicy::Create;aDefaultPolicy=0x%X", (TUint)this, (TUint)&aDefaultPolicy));
 	TRAPD(err, CreateL(aDefaultPolicy));
+    SQL_TRACE_BORDER(OstTraceExt3(TRACE_BORDER, RSQLSECURITYPOLICY_CREATE_EXIT, "Exit;0x%X;RSqlSecurityPolicy::Create;iImpl=0x%X;err=%d", (TUint)this, (TUint)iImpl, err));
 	return err;
 	}
 
@@ -66,8 +71,9 @@
 */
 EXPORT_C void RSqlSecurityPolicy::CreateL(const TSecurityPolicy& aDefaultPolicy)
 	{
-	SQLUTRACE_PROFILER(this);
+    SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, RSQLSECURITYPOLICY_CREATEL_ENTRY , "Entry;0x%X;RSqlSecurityPolicy::CreateL;aDefaultPolicy=0x%X", (TUint)this, (TUint)&aDefaultPolicy));
 	iImpl = CSqlSecurityPolicy::NewL(aDefaultPolicy);
+    SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, RSQLSECURITYPOLICY_CREATEL_EXIT, "Exit;0x%X;RSqlSecurityPolicy::CreateL;iImpl=0x%X", (TUint)this, (TUint)iImpl));
 	}
 
 /**
@@ -77,8 +83,9 @@
 */
 EXPORT_C void RSqlSecurityPolicy::Close()
 	{
-	SQLUTRACE_PROFILER(this);
+    SQL_TRACE_BORDER(OstTrace1(TRACE_BORDER, RSQLSECURITYPOLICY_CLOSE_ENTRY , "Entry;0x%X;RSqlSecurityPolicy::Close", (TUint)this));
 	delete iImpl;
+    SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, RSQLSECURITYPOLICY_CLOSE_EXIT, "Exit;0x%X;RSqlSecurityPolicy::Close;iImpl=0x%X", (TUint)this, (TUint)iImpl));
 	iImpl = NULL;
 	}
 
@@ -103,8 +110,7 @@
 */
 EXPORT_C TInt RSqlSecurityPolicy::SetDbPolicy(TPolicyType aPolicyType, const TSecurityPolicy& aPolicy)
 	{
-	SQLUTRACE_PROFILER(this);
-	__SQLASSERT_ALWAYS(aPolicyType >= ESchemaPolicy && aPolicyType <= EWritePolicy, ESqlPanicBadArgument);
+	__ASSERT_ALWAYS(aPolicyType >= ESchemaPolicy && aPolicyType <= EWritePolicy, __SQLPANIC(ESqlPanicBadArgument));
 	Impl().SetDbPolicy(aPolicyType, aPolicy);
 	return KErrNone;
 	}
@@ -140,10 +146,9 @@
 EXPORT_C TInt RSqlSecurityPolicy::SetPolicy(TObjectType aObjectType, const TDesC& aObjectName, 
 									  TPolicyType aPolicyType, const TSecurityPolicy& aPolicy)
 	{
-	SQLUTRACE_PROFILER(this);
-	__SQLASSERT_ALWAYS(aObjectType == ETable, ESqlPanicBadArgument);
-	__SQLASSERT_ALWAYS(aObjectName.Length() > 0, ESqlPanicBadArgument);
-	__SQLASSERT_ALWAYS(aPolicyType >= EReadPolicy && aPolicyType <= EWritePolicy, ESqlPanicBadArgument);
+	__ASSERT_ALWAYS(aObjectType == ETable, __SQLPANIC(ESqlPanicBadArgument));
+	__ASSERT_ALWAYS(aObjectName.Length() > 0, __SQLPANIC(ESqlPanicBadArgument));
+	__ASSERT_ALWAYS(aPolicyType >= EReadPolicy && aPolicyType <= EWritePolicy, __SQLPANIC(ESqlPanicBadArgument));
 	return Impl().SetPolicy(aObjectType, aObjectName, aPolicyType, aPolicy);
 	}
 
@@ -158,7 +163,6 @@
 */	
 EXPORT_C TSecurityPolicy RSqlSecurityPolicy::DefaultPolicy() const
 	{
-	SQLUTRACE_PROFILER(this);
 	return Impl().DefaultPolicy();
 	}
 
@@ -179,8 +183,7 @@
 */	
 EXPORT_C TSecurityPolicy RSqlSecurityPolicy::DbPolicy(TPolicyType aPolicyType) const
 	{
-	SQLUTRACE_PROFILER(this);
-	__SQLASSERT_ALWAYS(aPolicyType >= ESchemaPolicy && aPolicyType <= EWritePolicy, ESqlPanicBadArgument);
+	__ASSERT_ALWAYS(aPolicyType >= ESchemaPolicy && aPolicyType <= EWritePolicy, __SQLPANIC(ESqlPanicBadArgument));
 	return Impl().DbPolicy(aPolicyType);
 	}
 	
@@ -209,10 +212,9 @@
 EXPORT_C TSecurityPolicy RSqlSecurityPolicy::Policy(TObjectType aObjectType, const TDesC& aObjectName, 
 												 TPolicyType aPolicyType) const
 	{
-	SQLUTRACE_PROFILER(this);
-	__SQLASSERT_ALWAYS(aObjectType == ETable, ESqlPanicBadArgument);
-	__SQLASSERT_ALWAYS(aObjectName.Length() > 0, ESqlPanicBadArgument);
-	__SQLASSERT_ALWAYS(aPolicyType >= EReadPolicy && aPolicyType <= EWritePolicy, ESqlPanicBadArgument);
+	__ASSERT_ALWAYS(aObjectType == ETable, __SQLPANIC(ESqlPanicBadArgument));
+	__ASSERT_ALWAYS(aObjectName.Length() > 0, __SQLPANIC(ESqlPanicBadArgument));
+	__ASSERT_ALWAYS(aPolicyType >= EReadPolicy && aPolicyType <= EWritePolicy, __SQLPANIC(ESqlPanicBadArgument));
 	return Impl().Policy(aObjectType, aObjectName, aPolicyType);
 	}
 
@@ -227,7 +229,7 @@
 */
 EXPORT_C void RSqlSecurityPolicy::ExternalizeL(RWriteStream& aStream) const
 	{
-	SQLUTRACE_PROFILER(this);
+    SQL_TRACE_BORDER(OstTraceExt3(TRACE_BORDER, RSQLSECURITYPOLICY_EXTERNALIZEL_ENTRY , "Entry;0x%X;RSqlSecurityPolicy::ExternalizeL;aStream=0x%X;aStream.Sink()=0x%X", (TUint)this, (TUint)&aStream, (TUint)aStream.Sink()));
 	RSqlSecurityPolicy::TObjectType objectType;
 	TPtrC objectName;
 	RSqlSecurityPolicy::TPolicyType policyType;
@@ -253,6 +255,7 @@
 		}
 	//Object policy stream - end
 	aStream << KEndOfSPStream;
+    SQL_TRACE_BORDER(OstTrace1(TRACE_BORDER, RSQLSECURITYPOLICY_EXTERNALIZEL_EXIT, "Exit;0x%X;RSqlSecurityPolicy::ExternalizeL", (TUint)this));
 	}
 	
 /**
@@ -268,7 +271,7 @@
 */
 EXPORT_C void RSqlSecurityPolicy::InternalizeL(RReadStream& aStream)
 	{
-	SQLUTRACE_PROFILER(this);
+    SQL_TRACE_BORDER(OstTraceExt3(TRACE_BORDER, RSQLSECURITYPOLICY_INTERNALIZEL_ENTRY , "Entry;0x%X;RSqlSecurityPolicy::InternalizeL;aStream=0x%X;aStream.Source()=0x%X", (TUint)this, (TUint)&aStream, (TUint)aStream.Source()));
 	TSecurityPolicy policy;
 	TBuf8<sizeof(TSecurityPolicy)> policyBuf;
 	//Default policy
@@ -311,6 +314,7 @@
 	iImpl = temp;
 	//Destroy the old policy (which was swapped)
 	CleanupStack::PopAndDestroy(&newPolicy);
+    SQL_TRACE_BORDER(OstTrace1(TRACE_BORDER, RSQLSECURITYPOLICY_INTERNALIZEL_EXIT, "Exit;0x%X;RSqlSecurityPolicy::InternalizeL", (TUint)this));
 	}
 
 /**
@@ -333,6 +337,6 @@
 */
 CSqlSecurityPolicy& RSqlSecurityPolicy::Impl() const
 	{
-	__SQLASSERT_ALWAYS(iImpl != NULL, ESqlPanicInvalidObj);
+	__ASSERT_ALWAYS(iImpl != NULL, __SQLPANIC(ESqlPanicInvalidObj));
 	return *iImpl;	
 	}
--- a/persistentstorage/sql/SRC/Security/SqlSecurityImpl.cpp	Tue Jul 06 16:18:30 2010 +0300
+++ b/persistentstorage/sql/SRC/Security/SqlSecurityImpl.cpp	Wed Aug 18 11:30:17 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -43,8 +43,8 @@
 */
 inline CSqlSecurityPolicy::TPolicyItem* CSqlSecurityPolicy::PolicyItemPtr(const RSqlBufFlat::TCell* aBegin, const RSqlBufFlat::TCell* aCurrent)
 	{
-	__SQLASSERT(aBegin != NULL && aCurrent != NULL, ESqlPanicBadArgument);
-	__SQLASSERT(aCurrent->iPos != 0, ESqlPanicBadArgument);
+	__ASSERT_DEBUG(aBegin != NULL && aCurrent != NULL, __SQLPANIC2(ESqlPanicBadArgument));
+	__ASSERT_DEBUG(aCurrent->iPos != 0, __SQLPANIC2(ESqlPanicBadArgument));
 	const TUint8* begin = reinterpret_cast <const TUint8*> (aBegin);
 	return reinterpret_cast <CSqlSecurityPolicy::TPolicyItem*> (const_cast <TUint8*> (begin) + aCurrent->iPos);
 	}
@@ -63,7 +63,7 @@
 																	   		 const TDesC& aObjectName) const
 	{
 	const RSqlBufFlat::TCell* begin = iBufFlat.Header();
-	__SQLASSERT(begin != NULL, ESqlPanicInternalError);
+	__ASSERT_DEBUG(begin != NULL, __SQLPANIC(ESqlPanicInternalError));
 	const RSqlBufFlat::TCell* end = begin + Count();
 	const RSqlBufFlat::TCell* current = begin + CSqlSecurityPolicy::EDbPolicyIdx;//ignore default and database policiy types ("current" points before the first non-database policy)
 	while(++current < end)
@@ -71,8 +71,8 @@
 		if(current->iPos > 0 && current->Type() == (TInt)aObjectType) //if present and the same type as aObjectType
 			{
 			const CSqlSecurityPolicy::TPolicyItem* item = CSqlSecurityPolicy::PolicyItemPtr(begin, current);
-			__SQLASSERT(item != NULL, ESqlPanicInternalError);
-			__SQLASSERT(((current->Size() - sizeof(CSqlSecurityPolicy::TPolicyItem) - sizeof(TInt)) / sizeof(TUint16)) == item->NameSize(), ESqlPanicInternalError);
+			__ASSERT_DEBUG(item != NULL, __SQLPANIC(ESqlPanicInternalError));
+			__ASSERT_DEBUG(((current->Size() - sizeof(CSqlSecurityPolicy::TPolicyItem) - sizeof(TInt)) / sizeof(TUint16)) == item->NameSize(), __SQLPANIC(ESqlPanicInternalError));
 			if(::CompareNoCase16(aObjectName, TPtrC(item->NamePtr(), item->NameSize())) == 0)
 				{
 				return item;	
@@ -147,7 +147,7 @@
 TInt CSqlSecurityPolicy::Count() const
 	{
 	const RSqlBufFlat::TCell* begin = iBufFlat.Header();
-	__SQLASSERT(begin != NULL, ESqlPanicInternalError);
+	__ASSERT_DEBUG(begin != NULL, __SQLPANIC(ESqlPanicInternalError));
 	return *reinterpret_cast <const TInt*> (reinterpret_cast <const TUint8*> (begin) + (begin + CSqlSecurityPolicy::ECountIdx)->iPos);
 	}
 
@@ -156,9 +156,9 @@
 */
 void CSqlSecurityPolicy::SetCount(TInt aCount)
 	{
-	__SQLASSERT(aCount >= 0, ESqlPanicBadArgument);
+	__ASSERT_DEBUG(aCount >= 0, __SQLPANIC(ESqlPanicBadArgument));
 	RSqlBufFlat::TCell* begin = iBufFlat.Header();
-	__SQLASSERT(begin != NULL, ESqlPanicInternalError);
+	__ASSERT_DEBUG(begin != NULL, __SQLPANIC(ESqlPanicInternalError));
 	*reinterpret_cast <TInt*> (reinterpret_cast <TUint8*> (begin) + (begin + CSqlSecurityPolicy::ECountIdx)->iPos) = aCount;
 	}
 
@@ -168,9 +168,9 @@
 void CSqlSecurityPolicy::SetDefaultPolicy(const TSecurityPolicy& aPolicy)
 	{
 	RSqlBufFlat::TCell* begin = iBufFlat.Header();
-	__SQLASSERT(begin != NULL, ESqlPanicInternalError);
+	__ASSERT_DEBUG(begin != NULL, __SQLPANIC(ESqlPanicInternalError));
 	CSqlSecurityPolicy::TPolicyItem* item = CSqlSecurityPolicy::PolicyItemPtr(begin, begin + CSqlSecurityPolicy::EDefaultPolicyIdx);
-	__SQLASSERT(item != NULL, ESqlPanicInternalError);
+	__ASSERT_DEBUG(item != NULL, __SQLPANIC(ESqlPanicInternalError));
 	item->iPolicy[0] = aPolicy;
 	}
 	
@@ -184,11 +184,11 @@
 void CSqlSecurityPolicy::SetDbPolicy(RSqlSecurityPolicy::TPolicyType aPolicyType, const TSecurityPolicy& aPolicy)
 	{
 	const TInt KPolicyIndex = CSqlSecurityPolicy::PolicyType2Index(aPolicyType);
-	__SQLASSERT((TUint)KPolicyIndex < EPolicyTypeCount, ESqlPanicBadArgument);
+	__ASSERT_DEBUG((TUint)KPolicyIndex < EPolicyTypeCount, __SQLPANIC(ESqlPanicBadArgument));
 	RSqlBufFlat::TCell* begin = iBufFlat.Header();
-	__SQLASSERT(begin != NULL, ESqlPanicInternalError);
+	__ASSERT_DEBUG(begin != NULL, __SQLPANIC(ESqlPanicInternalError));
 	CSqlSecurityPolicy::TPolicyItem* item = CSqlSecurityPolicy::PolicyItemPtr(begin, begin + CSqlSecurityPolicy::EDbPolicyIdx);
-	__SQLASSERT(item != NULL, ESqlPanicInternalError);
+	__ASSERT_DEBUG(item != NULL, __SQLPANIC(ESqlPanicInternalError));
 	//KPolicyIndex value is tested at the beginning of the function
 	//coverity[overrun-local]
 	item->iPolicy[KPolicyIndex] = aPolicy;
@@ -220,8 +220,8 @@
 							   	   RSqlSecurityPolicy::TPolicyType aPolicyType, const TSecurityPolicy& aPolicy)
 	{
 	const TInt KPolicyIndex = CSqlSecurityPolicy::PolicyType2Index(aPolicyType);
-	__SQLASSERT((TUint)KPolicyIndex < EPolicyTypeCount, ESqlPanicBadArgument);
-	__SQLASSERT(aObjectName.Length() > 0, ESqlPanicBadArgument);
+	__ASSERT_DEBUG((TUint)KPolicyIndex < EPolicyTypeCount, __SQLPANIC(ESqlPanicBadArgument));
+	__ASSERT_DEBUG(aObjectName.Length() > 0, __SQLPANIC(ESqlPanicBadArgument));
 	CSqlSecurityPolicy::TPolicyItem* item = const_cast <CSqlSecurityPolicy::TPolicyItem*> (FindPolicyItemPtr(aObjectType, aObjectName));
 	if(item)
 		{//There is a field in the flat buffer for {aObjectType, aObjectName}. Set the policy.
@@ -246,7 +246,7 @@
 	item = reinterpret_cast <CSqlSecurityPolicy::TPolicyItem*> (buf);
 	//coverity[DEADCODE]
 	//The ASSERT might be useful in catching future defect in this function
-	__SQLASSERT(item != NULL, ESqlPanicInternalError);
+	__ASSERT_DEBUG(item != NULL, __SQLPANIC(ESqlPanicInternalError));
 	TSecurityPolicy defaultPolicy = DefaultPolicy();
 	for(TInt i=0;i<CSqlSecurityPolicy::EPolicyTypeCount;++i)
 		{
@@ -273,9 +273,9 @@
 TSecurityPolicy CSqlSecurityPolicy::DefaultPolicy() const
 	{
 	const RSqlBufFlat::TCell* begin = iBufFlat.Header();
-	__SQLASSERT(begin != NULL, ESqlPanicInternalError);
+	__ASSERT_DEBUG(begin != NULL, __SQLPANIC(ESqlPanicInternalError));
 	const CSqlSecurityPolicy::TPolicyItem* item = CSqlSecurityPolicy::PolicyItemPtr(begin, begin + CSqlSecurityPolicy::EDefaultPolicyIdx);
-	__SQLASSERT(item != NULL, ESqlPanicInternalError);
+	__ASSERT_DEBUG(item != NULL, __SQLPANIC(ESqlPanicInternalError));
 	return item->iPolicy[0];
 	}
 	
@@ -292,11 +292,11 @@
 TSecurityPolicy CSqlSecurityPolicy::DbPolicy(RSqlSecurityPolicy::TPolicyType aPolicyType) const
 	{
 	const TInt KPolicyIndex = CSqlSecurityPolicy::PolicyType2Index(aPolicyType);
-	__SQLASSERT((TUint)KPolicyIndex < EPolicyTypeCount, ESqlPanicBadArgument);
+	__ASSERT_DEBUG((TUint)KPolicyIndex < EPolicyTypeCount, __SQLPANIC(ESqlPanicBadArgument));
 	const RSqlBufFlat::TCell* begin = iBufFlat.Header();
-	__SQLASSERT(begin != NULL, ESqlPanicInternalError);
+	__ASSERT_DEBUG(begin != NULL, __SQLPANIC(ESqlPanicInternalError));
 	const CSqlSecurityPolicy::TPolicyItem* item = CSqlSecurityPolicy::PolicyItemPtr(begin, begin + CSqlSecurityPolicy::EDbPolicyIdx);
-	__SQLASSERT(item != NULL, ESqlPanicInternalError);
+	__ASSERT_DEBUG(item != NULL, __SQLPANIC(ESqlPanicInternalError));
 	//KPolicyIndex value is tested at the beginning of the function
 	//coverity[overrun-local]
 	return item->iPolicy[KPolicyIndex];
@@ -324,8 +324,8 @@
 										   const TDesC& aObjectName, RSqlSecurityPolicy::TPolicyType aPolicyType)
 	{
 	const TInt KPolicyIndex = CSqlSecurityPolicy::PolicyType2Index(aPolicyType);
-	__SQLASSERT((TUint)KPolicyIndex < EPolicyTypeCount, ESqlPanicBadArgument);
-	__SQLASSERT(aObjectName.Length() > 0, ESqlPanicBadArgument);
+	__ASSERT_DEBUG((TUint)KPolicyIndex < EPolicyTypeCount, __SQLPANIC(ESqlPanicBadArgument));
+	__ASSERT_DEBUG(aObjectName.Length() > 0, __SQLPANIC(ESqlPanicBadArgument));
 	const CSqlSecurityPolicy::TPolicyItem* item = FindPolicyItemPtr(aObjectType, aObjectName);
 	//KPolicyIndex value is tested at the beginning of the function
 	//coverity[overrun-local]
@@ -377,7 +377,7 @@
 	iEnd(iBegin + aSqlSecurityPolicy.Count()),
 	iCurPolicyIdx(CSqlSecurityPolicy::EPolicyTypeCount)
 	{
-	__SQLASSERT(iBegin != NULL, ESqlPanicInternalError);
+	__ASSERT_DEBUG(iBegin != NULL, __SQLPANIC(ESqlPanicInternalError));
 	}
 	
 /**
@@ -402,7 +402,7 @@
 			}
 		}
 	const CSqlSecurityPolicy::TPolicyItem* item = CSqlSecurityPolicy::PolicyItemPtr(iBegin, iCurrent);
-	__SQLASSERT(item != NULL, ESqlPanicInternalError);
+	__ASSERT_DEBUG(item != NULL, __SQLPANIC(ESqlPanicInternalError));
 	aObjectType = static_cast <RSqlSecurityPolicy::TObjectType> (iCurrent->Type());
 	aPolicyType = static_cast <RSqlSecurityPolicy::TPolicyType> (iCurPolicyIdx);
 	aPolicy = item->iPolicy[iCurPolicyIdx];
--- a/persistentstorage/sql/SRC/Server/Compact/SqlCompact.cpp	Tue Jul 06 16:18:30 2010 +0300
+++ b/persistentstorage/sql/SRC/Server/Compact/SqlCompact.cpp	Wed Aug 18 11:30:17 2010 +0300
@@ -13,11 +13,16 @@
 // Description:
 //
 
-#include "SqlPanic.h"
+#include "SqlAssert.h"
 #include "SqlCompact.h"
 #include "SqlCompactEntry.h"
 #include "SqlCompactTimer.h"
 #include "SqlUtil.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "SqlCompactTraces.h"
+#endif
+#include "SqlTraceDef.h"
 
 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -38,8 +43,8 @@
 */
 void TSqlCompactSettings::Invariant() const
 	{
-	__SQLASSERT(iStepLength > 0, ESqlPanicInternalError);
-	__SQLASSERT(iFreePageThresholdKb >= 0, ESqlPanicInternalError);
+	__ASSERT_DEBUG(iStepLength > 0, __SQLPANIC(ESqlPanicInternalError));
+	__ASSERT_DEBUG(iFreePageThresholdKb >= 0, __SQLPANIC(ESqlPanicInternalError));
 	}
 #endif//_DEBUG
 
@@ -72,8 +77,8 @@
 */
 CSqlCompactor* CSqlCompactor::NewL(TSqlCompactConnFactoryL aConnFactoryL, TInt aCompactStepInterval)
 	{
-	__SQLASSERT(aConnFactoryL != NULL, ESqlPanicBadArgument);
-	__SQLASSERT(aCompactStepInterval > 0, ESqlPanicBadArgument);
+	__ASSERT_DEBUG(aConnFactoryL != NULL, __SQLPANIC2(ESqlPanicBadArgument));
+	__ASSERT_DEBUG(aCompactStepInterval > 0, __SQLPANIC2(ESqlPanicBadArgument));
 	CSqlCompactor* self = new (ELeave) CSqlCompactor(aConnFactoryL);
 	CleanupStack::PushL(self);
 	self->ConstructL(aCompactStepInterval);
@@ -89,7 +94,7 @@
 	{
 	for(TInt idx=iEntries.Count()-1;idx>=0;--idx)
 		{
-		__SQLASSERT(iEntries[idx] != NULL, ESqlPanicInternalError);
+		__ASSERT_DEBUG(iEntries[idx] != NULL, __SQLPANIC(ESqlPanicInternalError));
 		while(iEntries[idx]->Release() != 0)
 			{
 			}
@@ -134,12 +139,13 @@
 */
 void CSqlCompactor::AddEntryL(const TDesC& aFullName, const TSqlCompactSettings& aSettings)
 	{
-	__SQLASSERT(aFullName.Length() > 0 && aFullName.Length() <= KMaxFileName, ESqlPanicBadArgument);
+	__ASSERT_DEBUG(aFullName.Length() > 0 && aFullName.Length() <= KMaxFileName, __SQLPANIC(ESqlPanicBadArgument));
 	SQLCOMPACTOR_INVARIANT();
 	CSqlCompactEntry* entry = NULL;
 	TInt idx = iEntries.FindInOrder(aFullName, &CSqlCompactor::Search);
 	if(idx == KErrNotFound)
 		{
+		SQL_TRACE_COMPACT(OstTraceExt4(TRACE_INTERNALS, CSQLCOMPACTOR_ADDENTRYL1, "0x%X;CSqlCompactor::AddEntryL;New entry;aFullName=%S;iStepLength=%d;iFreePageThreashold=%d", (TUint)this, __SQLPRNSTR(aFullName), aSettings.iStepLength, aSettings.iFreePageThresholdKb));
 		entry = CSqlCompactEntry::NewLC(aFullName, iConnFactoryL, aSettings, *iTimer);
 		TLinearOrder<CSqlCompactEntry> order(&CSqlCompactor::Compare);
 		__SQLLEAVE_IF_ERROR(iEntries.InsertInOrder(entry, order));
@@ -147,8 +153,9 @@
 		}
 	else
 		{
+		SQL_TRACE_COMPACT(OstTraceExt4(TRACE_INTERNALS, CSQLCOMPACTOR_ADDENTRYL2, "0x%X;CSqlCompactor::AddEntryL;Reuse entry;aFullName=%S;iStepLength=%d;iFreePageThreashold=%d", (TUint)this, __SQLPRNSTR(aFullName), aSettings.iStepLength, aSettings.iFreePageThresholdKb));
 		entry = iEntries[idx];
-		__SQLASSERT(entry != NULL, ESqlPanicInternalError);
+		__ASSERT_DEBUG(entry != NULL, __SQLPANIC(ESqlPanicInternalError));
 		(void)entry->AddRef();
 		}
 	SQLCOMPACTOR_INVARIANT();
@@ -163,13 +170,14 @@
 */
 void CSqlCompactor::ReleaseEntry(const TDesC& aFullName)
 	{
+	SQL_TRACE_COMPACT(OstTraceExt2(TRACE_INTERNALS, CSQLCOMPACTOR_RELEASEENTRY1, "0x%X;CSqlCompactor::ReleaseEntry;aFullName=%S", (TUint)this, __SQLPRNSTR(aFullName)));
 	SQLCOMPACTOR_INVARIANT();
 	TInt idx = iEntries.FindInOrder(aFullName, &CSqlCompactor::Search);
-	__SQLASSERT(idx >= 0, ESqlPanicInternalError);
+	__ASSERT_DEBUG(idx >= 0, __SQLPANIC(ESqlPanicInternalError));
 	if(idx >= 0)
 		{
 		CSqlCompactEntry* entry = iEntries[idx];
-		__SQLASSERT(entry != NULL, ESqlPanicInternalError);
+		__ASSERT_DEBUG(entry != NULL, __SQLPANIC(ESqlPanicInternalError));
 		if(entry)
 			{
 			if(entry->Release() == 0)
@@ -199,7 +207,7 @@
 	iConnFactoryL(aConnFactoryL),
 	iEntries(KEntriesGranularity)
 	{
-	__SQLASSERT(aConnFactoryL != NULL, ESqlPanicBadArgument);
+	__ASSERT_DEBUG(aConnFactoryL != NULL, __SQLPANIC(ESqlPanicBadArgument));
 	}
 
 /**
@@ -211,7 +219,7 @@
 */
 void CSqlCompactor::ConstructL(TInt aCompactStepInterval)
 	{
-	__SQLASSERT(aCompactStepInterval > 0, ESqlPanicBadArgument);
+	__ASSERT_DEBUG(aCompactStepInterval > 0, __SQLPANIC(ESqlPanicBadArgument));
 	iTimer = CSqlCompactTimer::NewL(aCompactStepInterval);
 	}
 
@@ -223,11 +231,11 @@
 */
 /* static */TInt CSqlCompactor::Search(const TDesC* aFullName, const CSqlCompactEntry& aEntry)
 	{
-	__SQLASSERT(&aEntry != NULL, ESqlPanicInternalError);
-	__SQLASSERT(aFullName != NULL, ESqlPanicInternalError);
+	__ASSERT_DEBUG(&aEntry != NULL, __SQLPANIC2(ESqlPanicInternalError));
+	__ASSERT_DEBUG(aFullName != NULL, __SQLPANIC2(ESqlPanicInternalError));
 	const TDesC& fullName = *aFullName;
-	__SQLASSERT(fullName.Length() > 0 && fullName.Length() <= KMaxFileName, ESqlPanicInternalError);
-	__SQLASSERT(aEntry.FullName().Length() > 0 && aEntry.FullName().Length() <= KMaxFileName, ESqlPanicInternalError);
+	__ASSERT_DEBUG(fullName.Length() > 0 && fullName.Length() <= KMaxFileName, __SQLPANIC2(ESqlPanicInternalError));
+	__ASSERT_DEBUG(aEntry.FullName().Length() > 0 && aEntry.FullName().Length() <= KMaxFileName, __SQLPANIC2(ESqlPanicInternalError));
 	return fullName.CompareF(aEntry.FullName());
 	}
 
@@ -236,10 +244,10 @@
 */
 /* static */TInt CSqlCompactor::Compare(const CSqlCompactEntry& aLeft, const CSqlCompactEntry& aRight)
 	{
-	__SQLASSERT(&aLeft != NULL, ESqlPanicInternalError);
-	__SQLASSERT(&aRight != NULL, ESqlPanicInternalError);
-	__SQLASSERT(aLeft.FullName().Length() > 0 && aLeft.FullName().Length() <= KMaxFileName, ESqlPanicInternalError);
-	__SQLASSERT(aRight.FullName().Length() > 0 && aRight.FullName().Length() <= KMaxFileName, ESqlPanicInternalError);
+	__ASSERT_DEBUG(&aLeft != NULL, __SQLPANIC2(ESqlPanicInternalError));
+	__ASSERT_DEBUG(&aRight != NULL, __SQLPANIC2(ESqlPanicInternalError));
+	__ASSERT_DEBUG(aLeft.FullName().Length() > 0 && aLeft.FullName().Length() <= KMaxFileName, __SQLPANIC2(ESqlPanicInternalError));
+	__ASSERT_DEBUG(aRight.FullName().Length() > 0 && aRight.FullName().Length() <= KMaxFileName, __SQLPANIC2(ESqlPanicInternalError));
 	return aLeft.FullName().CompareF(aRight.FullName());
 	}
 
@@ -249,12 +257,12 @@
 */
 void CSqlCompactor::Invariant() const
 	{
-	__SQLASSERT(iConnFactoryL != NULL, ESqlPanicInternalError);
-	__SQLASSERT(iTimer != NULL, ESqlPanicInternalError);
+	__ASSERT_DEBUG(iConnFactoryL != NULL, __SQLPANIC(ESqlPanicInternalError));
+	__ASSERT_DEBUG(iTimer != NULL, __SQLPANIC(ESqlPanicInternalError));
 	iTimer->Invariant();
 	for(TInt idx=iEntries.Count()-1;idx>=0;--idx)
 		{
-		__SQLASSERT(iEntries[idx] != NULL, ESqlPanicInternalError);
+		__ASSERT_DEBUG(iEntries[idx] != NULL, __SQLPANIC(ESqlPanicInternalError));
 		iEntries[idx]->Invariant();
 		}
 	}
--- a/persistentstorage/sql/SRC/Server/Compact/SqlCompactConn.cpp	Tue Jul 06 16:18:30 2010 +0300
+++ b/persistentstorage/sql/SRC/Server/Compact/SqlCompactConn.cpp	Wed Aug 18 11:30:17 2010 +0300
@@ -15,12 +15,17 @@
 
 #include <f32file.h>
 #include <sqldb.h>
-#include "SqlPanic.h"
+#include "SqlAssert.h"
 #include "sqlite3.h"
 #include "SqliteSymbian.h"		//TSqlFreePageCallback
 #include "SqlSrvUtil.h"
 #include "SqlSrvStatementUtil.h"
 #include "SqlCompactConn.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "SqlCompactConnTraces.h"
+#endif
+#include "SqlTraceDef.h"
 
 /**
 Creates a new CSqlCompactConn instance.
@@ -45,12 +50,14 @@
 */
 CSqlCompactConn* CSqlCompactConn::NewL(const TDesC& aFullName, TSqlFreePageCallback& aFreePageCallback)
 	{
-	__SQLASSERT(aFullName.Length() > 0 && aFullName.Length() <= KMaxFileName, ESqlPanicBadArgument);
-	__SQLASSERT(aFreePageCallback.IsValid(), ESqlPanicBadArgument);
+	SQL_TRACE_COMPACT(OstTraceExt1(TRACE_INTERNALS, CSQLCOMPACTCONN_NEWLC_ENTRY, "Entry;0;CSqlCompactConn::NewL;aFullName=%S", __SQLPRNSTR(aFullName)));
+	__ASSERT_DEBUG(aFullName.Length() > 0 && aFullName.Length() <= KMaxFileName, __SQLPANIC2(ESqlPanicBadArgument));
+	__ASSERT_DEBUG(aFreePageCallback.IsValid(), __SQLPANIC2(ESqlPanicBadArgument));
 	CSqlCompactConn* self = new (ELeave) CSqlCompactConn;
 	CleanupStack::PushL(self);
 	self->ConstructL(aFullName, aFreePageCallback);
 	CleanupStack::Pop(self);
+	SQL_TRACE_COMPACT(OstTraceExt2(TRACE_INTERNALS, CSQLCOMPACTCONN_NEWLC_EXIT, "Exit;0x%X;CSqlCompactConn::NewL;aFullName=%S", (TUint)self, __SQLPRNSTR(aFullName)));
 	return self;
 	}
 
@@ -59,6 +66,7 @@
 */
 CSqlCompactConn::~CSqlCompactConn()
 	{
+	SQL_TRACE_COMPACT(OstTrace1(TRACE_INTERNALS, CSQLCOMPACTCONN_CSQLCOMPACTCONN2, "0x%X;CSqlCompactConn::~CSqlCompactConn", (TUint)this));
 	::CloseDbHandle(iHandle);
  	}
 
@@ -89,8 +97,8 @@
 */
 TInt CSqlCompactConn::Compact(TInt aPageCount, TInt& aProcessedPageCount, TInt aLength)
 	{
-	__SQLASSERT(aPageCount >= 0, ESqlPanicBadArgument);
-	__SQLASSERT(aLength >= 0, ESqlPanicBadArgument);
+	__ASSERT_DEBUG(aPageCount >= 0, __SQLPANIC(ESqlPanicBadArgument));
+	__ASSERT_DEBUG(aLength >= 0, __SQLPANIC(ESqlPanicBadArgument));
 	SQLCOMPACTCONN_INVARIANT();
 	TInt err = ::DbCompact(iHandle, KNullDesC, aPageCount, aProcessedPageCount, aLength);
 	SQLCOMPACTCONN_INVARIANT();
@@ -123,9 +131,9 @@
 */
 void CSqlCompactConn::ConstructL(const TDesC& aFullName, TSqlFreePageCallback& aFreePageCallback)
 	{
-	__SQLASSERT(aFullName.Length() > 0 && aFullName.Length() <= KMaxFileName, ESqlPanicBadArgument);
-	__SQLASSERT(aFreePageCallback.IsValid(), ESqlPanicBadArgument);
-	__SQLASSERT(!iHandle, ESqlPanicInternalError);
+	__ASSERT_DEBUG(aFullName.Length() > 0 && aFullName.Length() <= KMaxFileName, __SQLPANIC(ESqlPanicBadArgument));
+	__ASSERT_DEBUG(aFreePageCallback.IsValid(), __SQLPANIC(ESqlPanicBadArgument));
+	__ASSERT_DEBUG(!iHandle, __SQLPANIC(ESqlPanicInternalError));
 	
 	TBuf8<KMaxFileName + 1> fname;
 	(void)::UTF16ToUTF8Z(aFullName, fname);//The file is first open by the main connection. 
@@ -190,7 +198,7 @@
 */
 void CSqlCompactConn::Invariant() const
 	{
-	__SQLASSERT_ALWAYS(iHandle != NULL, ESqlPanicInternalError);
+	__ASSERT_ALWAYS(iHandle != NULL, __SQLPANIC(ESqlPanicInternalError));
 	}
 #endif//_DEBUG
 
@@ -222,7 +230,7 @@
 */
 MSqlCompactConn* SqlCreateCompactConnL(const TDesC& aFullName, TSqlFreePageCallback& aFreePageCallback)
 	{
-	__SQLASSERT(aFullName.Length() > 0 && aFullName.Length() <= KMaxFileName, ESqlPanicBadArgument);
-	__SQLASSERT(aFreePageCallback.IsValid(), ESqlPanicBadArgument);
+	__ASSERT_DEBUG(aFullName.Length() > 0 && aFullName.Length() <= KMaxFileName, __SQLPANIC2(ESqlPanicBadArgument));
+	__ASSERT_DEBUG(aFreePageCallback.IsValid(), __SQLPANIC2(ESqlPanicBadArgument));
 	return CSqlCompactConn::NewL(aFullName, aFreePageCallback);
 	}
--- a/persistentstorage/sql/SRC/Server/Compact/SqlCompactEntry.cpp	Tue Jul 06 16:18:30 2010 +0300
+++ b/persistentstorage/sql/SRC/Server/Compact/SqlCompactEntry.cpp	Wed Aug 18 11:30:17 2010 +0300
@@ -16,10 +16,15 @@
 #include <e32debug.h>
 #include <hal.h>
 #include <sqldb.h>
-#include "SqlPanic.h"
+#include "SqlAssert.h"
 #include "SqlCompactEntry.h"
 #include "SqlCompactTimer.h"
 #include "SqliteSymbian.h"		//TSqlFreePageCallback
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "SqlCompactEntryTraces.h"
+#endif
+#include "SqlTraceDef.h"
 
 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -47,11 +52,13 @@
 CSqlCompactEntry* CSqlCompactEntry::NewLC(const TDesC& aFullName, TSqlCompactConnFactoryL aConnFactoryL, 
 										  const TSqlCompactSettings& aSettings, CSqlCompactTimer& aTimer)
 	{
-	__SQLASSERT(aFullName.Length() > 0 && aFullName.Length() <= KMaxFileName, ESqlPanicBadArgument); 
-	__SQLASSERT(aConnFactoryL != NULL, ESqlPanicBadArgument);
+	SQL_TRACE_COMPACT(OstTraceExt1(TRACE_INTERNALS, CSQLCOMPACTENTRY_NEWLC_ENTRY, "Entry;0;CSqlCompactEntry::NewLC;aFullName=%S", __SQLPRNSTR(aFullName)));
+	__ASSERT_DEBUG(aFullName.Length() > 0 && aFullName.Length() <= KMaxFileName, __SQLPANIC2(ESqlPanicBadArgument)); 
+	__ASSERT_DEBUG(aConnFactoryL != NULL, __SQLPANIC2(ESqlPanicBadArgument));
 	CSqlCompactEntry* self = new (ELeave) CSqlCompactEntry(aSettings, aTimer);
 	CleanupStack::PushL(self);
 	self->ConstructL(aFullName, aConnFactoryL);
+	SQL_TRACE_COMPACT(OstTrace1(TRACE_INTERNALS, CSQLCOMPACTENTRY_NEWLC_EXIT, "Exit;0x%X;CSqlCompactEntry::NewLC", (TUint)self));
 	return self;
 	}
 
@@ -60,6 +67,7 @@
 */
 CSqlCompactEntry::~CSqlCompactEntry()
 	{
+	SQL_TRACE_COMPACT(OstTraceExt3(TRACE_INTERNALS, CSQLCOMPACTENTRY_CSQLCOMPACTENTRY2, "0x%X;CSqlCompactEntry::~CSqlCompactEntry;iState=%d;iPageCount=%d", (TUint)this, (TInt)iState, iPageCount));
 	if(iState == CSqlCompactEntry::EInProgress)
 		{
 		iTimer.DeQueue(*this);
@@ -78,6 +86,7 @@
 */
 TInt CSqlCompactEntry::AddRef()
 	{
+	SQL_TRACE_COMPACT(OstTraceExt4(TRACE_INTERNALS, CSQLCOMPACTENTRY_ADDREF, "0x%X;CSqlCompactEntry::AddRef;iState=%d;iPageCount=%d;iRefCounter=%d", (TUint)this, (TInt)iState, iPageCount, iRefCounter));
 	SQLCOMPACTENTRY_INVARIANT();
 	return ++iRefCounter;
 	}
@@ -90,6 +99,7 @@
 */
 TInt CSqlCompactEntry::Release()
 	{
+	SQL_TRACE_COMPACT(OstTraceExt4(TRACE_INTERNALS, CSQLCOMPACTENTRY_RELEASE, "0x%X;CSqlCompactEntry::Release;iState=%d;iPageCount=%d;iRefCounter=%d", (TUint)this, (TInt)iState, iPageCount, iRefCounter));
 	SQLCOMPACTENTRY_INVARIANT();
 	TInt rc = --iRefCounter;
 	if(rc == 0)
@@ -114,10 +124,11 @@
 */
 /* static */ void CSqlCompactEntry::FreePageCallback(void* aThis, TInt aFreePageCount)
 	{
-	__SQLASSERT(aThis != NULL, ESqlPanicBadArgument); 
-	__SQLASSERT(aFreePageCount > 0, ESqlPanicBadArgument); 
+	__ASSERT_DEBUG(aThis != NULL, __SQLPANIC2(ESqlPanicBadArgument)); 
+	__ASSERT_DEBUG(aFreePageCount > 0, __SQLPANIC2(ESqlPanicBadArgument)); 
 	
 	CSqlCompactEntry& entry = *(static_cast <CSqlCompactEntry*> (aThis));
+	SQL_TRACE_COMPACT(OstTraceExt3(TRACE_INTERNALS, CSQLCOMPACTENTRY_FREEPAGECALLBACK, "0x%X;CSqlCompactEntry::FreePageCallback;aFreePageCount=%d;iState=%d", (TUint)aThis, aFreePageCount, (TInt)entry.iState));
 	if(entry.iFreePageCallbackDisabled)
 		{//The callback is disabled during the background compaction step.
 		 //The server is single-threaded, so no other client can activate the callback.
@@ -161,9 +172,9 @@
 */
 void CSqlCompactEntry::ConstructL(const TDesC& aFullName, TSqlCompactConnFactoryL aConnFactoryL)
 	{
-	__SQLASSERT(aFullName.Length() > 0 && aFullName.Length() <= KMaxFileName, ESqlPanicBadArgument); 
-	__SQLASSERT(aConnFactoryL != NULL, ESqlPanicBadArgument);
-	__SQLASSERT(!iConnection, ESqlPanicInternalError);
+	__ASSERT_DEBUG(aFullName.Length() > 0 && aFullName.Length() <= KMaxFileName, __SQLPANIC(ESqlPanicBadArgument)); 
+	__ASSERT_DEBUG(aConnFactoryL != NULL, __SQLPANIC(ESqlPanicBadArgument));
+	__ASSERT_DEBUG(!iConnection, __SQLPANIC(ESqlPanicInternalError));
 	
 	__SQLLEAVE_IF_ERROR(iFullName.Create(aFullName));
 
@@ -173,7 +184,7 @@
 	//the threshold from Kbs to pages when the connection with the database is established.
 	TSqlFreePageCallback callback(this, iSettings.iFreePageThresholdKb, &CSqlCompactEntry::FreePageCallback);
 	iConnection = (*aConnFactoryL)(aFullName, callback);
-	__SQLASSERT(iConnection != NULL, ESqlPanicInternalError);
+	__ASSERT_DEBUG(iConnection != NULL, __SQLPANIC(ESqlPanicInternalError));
 	
 	//"callback.iThreshold > 0" is an indication that the background compaction should be kicked-off
 	if(callback.iThreshold > 0) 
@@ -201,19 +212,19 @@
 */
 TInt CSqlCompactEntry::Compact()
 	{
-	//RDebug::Print(_L("++ CSqlCompactEntry::Compact() ++\r\n"));
+	SQL_TRACE_COMPACT(OstTraceExt3(TRACE_INTERNALS, CSQLCOMPACTENTRY_COMPACT_ENTRY, "Entry;0x%X;CSqlCompactEntry::Compact;aFreePageCount=%d;iState=%d", (TUint)this, iPageCount, (TInt)iState));
 	SQLCOMPACTENTRY_INVARIANT();
-	__SQLASSERT(iPageCount > 0, ESqlPanicInternalError);
-	__SQLASSERT(iState == CSqlCompactEntry::EInProgress, ESqlPanicInternalError);
+	__ASSERT_DEBUG(iPageCount > 0, __SQLPANIC(ESqlPanicInternalError));
+	__ASSERT_DEBUG(iState == CSqlCompactEntry::EInProgress, __SQLPANIC(ESqlPanicInternalError));
 	TInt processedPageCount = 0;
 	iFreePageCallbackDisabled = ETrue;
 	TInt err = Connection().Compact(iPageCount, processedPageCount, iSettings.iStepLength);
 	iFreePageCallbackDisabled = EFalse;
-	__SQLASSERT(processedPageCount >= 0, ESqlPanicInternalError);
+	__ASSERT_DEBUG(processedPageCount >= 0, __SQLPANIC(ESqlPanicInternalError));
 	if(err == KErrNone)
 		{
 		iPageCount -= processedPageCount;
-		__SQLASSERT(iPageCount >= 0, ESqlPanicInternalError);
+		__ASSERT_DEBUG(iPageCount >= 0, __SQLPANIC(ESqlPanicInternalError));
 		}
 	TBool stopCompaction = err == KSqlErrCorrupt || err == KSqlErrNotDb || err == KErrCorrupt || err == KErrDisMounted;
 	if(iPageCount <= 0 || stopCompaction)
@@ -221,6 +232,7 @@
 		ResetState();
 		iTimer.DeQueue(*this);
 		}
+	SQL_TRACE_COMPACT(OstTraceExt4(TRACE_INTERNALS, CSQLCOMPACTENTRY_COMPACT_EXIT, "Exit;0x%X;CSqlCompactEntry::Compact;iPageCount=%d;iState=%d;err=%d", (TUint)this, iPageCount, (TInt)iState, err));
 	SQLCOMPACTENTRY_INVARIANT();
 	return err;
 	}
@@ -257,7 +269,7 @@
 MSqlCompactConn& CSqlCompactEntry::Connection()
 	{
 	SQLCOMPACTENTRY_INVARIANT();
-	__SQLASSERT_ALWAYS(iConnection != NULL, ESqlPanicInternalError);
+	__ASSERT_ALWAYS(iConnection != NULL, __SQLPANIC(ESqlPanicInternalError));
 	return *iConnection;
 	}
 
@@ -267,11 +279,11 @@
 */
 void CSqlCompactEntry::Invariant() const
 	{
-	__SQLASSERT(iFullName.Length() > 0 && iFullName.Length() <= KMaxFileName, ESqlPanicInternalError); 
-	__SQLASSERT(iConnection != NULL, ESqlPanicInternalError);
-	__SQLASSERT(iRefCounter > 0, ESqlPanicInternalError);
-	__SQLASSERT(iState == CSqlCompactEntry::EInactive || iState == CSqlCompactEntry::EInProgress, ESqlPanicInternalError);
-	__SQLASSERT(iPageCount >= 0, ESqlPanicInternalError);
+	__ASSERT_DEBUG(iFullName.Length() > 0 && iFullName.Length() <= KMaxFileName, __SQLPANIC(ESqlPanicInternalError)); 
+	__ASSERT_DEBUG(iConnection != NULL, __SQLPANIC(ESqlPanicInternalError));
+	__ASSERT_DEBUG(iRefCounter > 0, __SQLPANIC(ESqlPanicInternalError));
+	__ASSERT_DEBUG(iState == CSqlCompactEntry::EInactive || iState == CSqlCompactEntry::EInProgress, __SQLPANIC(ESqlPanicInternalError));
+	__ASSERT_DEBUG(iPageCount >= 0, __SQLPANIC(ESqlPanicInternalError));
 	iSettings.Invariant();
 	}
 #endif//_DEBUG
--- a/persistentstorage/sql/SRC/Server/Compact/SqlCompactTimer.cpp	Tue Jul 06 16:18:30 2010 +0300
+++ b/persistentstorage/sql/SRC/Server/Compact/SqlCompactTimer.cpp	Wed Aug 18 11:30:17 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -14,8 +14,13 @@
 //
 
 #include "SqlCompactTimer.h"
-#include "SqlPanic.h"
+#include "SqlAssert.h"
 #include "SqlCompactEntry.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "SqlCompactTimerTraces.h"
+#endif
+#include "SqlTraceDef.h"
 
 /**
 Creates new CSqlCompactTimer instance.
@@ -26,11 +31,13 @@
 */
 CSqlCompactTimer* CSqlCompactTimer::NewL(TInt aIntervalMs)
 	{
-	__SQLASSERT(aIntervalMs > 0, ESqlPanicBadArgument);
+	SQL_TRACE_COMPACT(OstTrace1(TRACE_INTERNALS, CSQLCOMPACTTIMER_NEWL_ENTRY, "Entry;0;CSqlCompactTimer::NewL;aIntervalMs=%d", aIntervalMs));
+	__ASSERT_DEBUG(aIntervalMs > 0, __SQLPANIC2(ESqlPanicBadArgument));
 	CSqlCompactTimer* self = new (ELeave) CSqlCompactTimer(aIntervalMs);
 	CleanupStack::PushL(self);
 	self->ConstructL();
 	CleanupStack::Pop(self);
+	SQL_TRACE_COMPACT(OstTraceExt2(TRACE_INTERNALS, CSQLCOMPACTTIMER_NEWL_EXIT, "Exit;0x%X;CSqlCompactTimer::NewL;aIntervalMs=%d", (TUint)self, aIntervalMs));
 	return self;
 	}
 
@@ -39,6 +46,7 @@
 */
 CSqlCompactTimer::~CSqlCompactTimer()
 	{
+	SQL_TRACE_COMPACT(OstTrace1(TRACE_INTERNALS, CSQLCOMPACTTIMER_CSQLCOMPACTTIMER2, "0x%X;CSqlCompactTimer::~CSqlCompactTimer", (TUint)this));
 	Cancel();
 	}
 
@@ -65,6 +73,7 @@
 */
 void CSqlCompactTimer::Queue(CSqlCompactEntry& aEntry)
 	{
+	SQL_TRACE_COMPACT(OstTraceExt3(TRACE_INTERNALS, CSQLCOMPACTTIMER_QUEUE, "0x%X;CSqlCompactTimer::Queue;aEntry=0x%X;Name=%S", (TUint)this, (TUint)&aEntry,__SQLPRNSTR(aEntry.FullName())));
 	SQLCOMPACTTIMER_INVARIANT();
 	iQueue.AddFirst(aEntry);
 	if(!IsActive())
@@ -83,6 +92,7 @@
 */
 void CSqlCompactTimer::DeQueue(CSqlCompactEntry& aEntry)
 	{
+	SQL_TRACE_COMPACT(OstTraceExt2(TRACE_INTERNALS, CSQLCOMPACTTIMER_DEQUEUE, "0x%X;CSqlCompactTimer::DeQueue;aEntry=0x%X", (TUint)this, (TUint)&aEntry));
 	SQLCOMPACTTIMER_INVARIANT();
 	iQueue.Remove(aEntry);
 	if(iQueue.IsEmpty())
@@ -104,7 +114,7 @@
 	iIntervalMicroSec(aIntervalMs * 1000),
 	iQueue(_FOFF(CSqlCompactEntry, iLink))
 	{
-	__SQLASSERT(aIntervalMs > 0, ESqlPanicBadArgument);
+	__ASSERT_DEBUG(aIntervalMs > 0, __SQLPANIC(ESqlPanicBadArgument));
 	}
 
 /**
@@ -128,10 +138,12 @@
 */
 void CSqlCompactTimer::RunL()
 	{
+	SQL_TRACE_COMPACT(OstTrace1(TRACE_INTERNALS, CSQLCOMPACTTIMER_RUNL, "0x%X;CSqlCompactTimer::RunL", (TUint)this));
 	SQLCOMPACTTIMER_INVARIANT();
-	__SQLASSERT_ALWAYS(!iQueue.IsEmpty(), ESqlPanicInternalError);	
+	__ASSERT_ALWAYS(!iQueue.IsEmpty(), __SQLPANIC(ESqlPanicInternalError));	
 	CSqlCompactEntry* entry = iQueue.Last();
-	__SQLASSERT(entry, ESqlPanicInternalError);	
+	SQL_TRACE_COMPACT(OstTraceExt4(TRACE_INTERNALS, CSQLCOMPACTTIMER_RUNL2, "0x%X;CSqlCompactTimer::RunL;Compact;entry=0x%X;Name=%S;iQueue.IsEmpty()=%d", (TUint)this, (TUint)entry,__SQLPRNSTR(entry->FullName()), (TInt)iQueue.IsEmpty()));
+	__ASSERT_DEBUG(entry, __SQLPANIC(ESqlPanicInternalError));	
 	(void)entry->Compact();
 	if(!iQueue.IsEmpty())
 		{
@@ -146,11 +158,11 @@
 */
 void CSqlCompactTimer::Invariant() const
 	{
-	__SQLASSERT(iIntervalMicroSec > 0, ESqlPanicInternalError);
+	__ASSERT_DEBUG(iIntervalMicroSec > 0, __SQLPANIC(ESqlPanicInternalError));
 	if(!iQueue.IsEmpty())
 		{
 		CSqlCompactEntry* entry = iQueue.Last();
-		__SQLASSERT(entry != NULL, ESqlPanicInternalError);
+		__ASSERT_DEBUG(entry != NULL, __SQLPANIC(ESqlPanicInternalError));
 		}
 	}
 #endif//_DEBUG
--- a/persistentstorage/sql/SRC/Server/IPC/IPCStream.cpp	Tue Jul 06 16:18:30 2010 +0300
+++ b/persistentstorage/sql/SRC/Server/IPC/IPCStream.cpp	Wed Aug 18 11:30:17 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2005-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -14,7 +14,7 @@
 //
 
 #include <s32buf.h>
-#include "SqlPanic.h"
+#include "SqlAssert.h"
 #include "IPCStream.h"
 #include "SqlSrvResourceProfiler.h"
 
--- a/persistentstorage/sql/SRC/Server/IPC/IPCStream.inl	Tue Jul 06 16:18:30 2010 +0300
+++ b/persistentstorage/sql/SRC/Server/IPC/IPCStream.inl	Wed Aug 18 11:30:17 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2005-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -31,7 +31,7 @@
 	iRPos(aReadPos),
 	iWPos(0)
 	{
-	__SQLASSERT(aHost != NULL, ESqlPanicInternalError);
+	__ASSERT_DEBUG(aHost != NULL, __SQLPANIC(ESqlPanicInternalError));
 	}
 
 /**
--- a/persistentstorage/sql/SRC/Server/SqlBur.cpp	Tue Jul 06 16:18:30 2010 +0300
+++ b/persistentstorage/sql/SRC/Server/SqlBur.cpp	Wed Aug 18 11:30:17 2010 +0300
@@ -15,7 +15,13 @@
 
 #include "SqlBur.h"
 #include "SqlAssert.h"
-#include "SqlPanic.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "SqlBurTraces.h"
+#endif
+#include "SqlTraceDef.h"
+
+#define UNUSED_ARG(arg) arg = arg
 
 //Extracts and returns 32-bit integer from aNumBuf buffer.
 static TUint32 GetNumUint32L(const TDesC& aNumBuf)
@@ -23,7 +29,7 @@
 	TLex lex(aNumBuf);
 	lex.SkipSpace();
 	TUint32 num = 0xFFFFFFFF;
-	__SQLLEAVE_IF_ERROR(lex.Val(num, EHex));
+	__SQLLEAVE_IF_ERROR2(lex.Val(num, EHex));
 	return num;
 	}
 
@@ -33,7 +39,7 @@
 	TLex lex(aNumBuf);
 	lex.SkipSpace();
 	TInt64 num = -1;
-	__SQLLEAVE_IF_ERROR(lex.Val(num, EHex));
+	__SQLLEAVE_IF_ERROR2(lex.Val(num, EHex));
 	return num;
 	}
 
@@ -57,6 +63,7 @@
 	CSqlBackupClient *self=(CSqlBackupClient *)new(ELeave) CSqlBackupClient(aInterface);
 	CleanupStack::PushL(self);
 	self->ConstructL();
+	SQL_TRACE_BUR(OstTrace1(TRACE_INTERNALS, CSQLBACKUPCLIENT_NEWLC, "0x%X;CSqlBackupClient::NewLC", (TUint)self));
 	return self;
 	}
 
@@ -86,6 +93,8 @@
 */
 CSqlBackupClient::~CSqlBackupClient()
 	{
+	SQL_TRACE_BUR(OstTraceExt2(TRACE_INTERNALS, CSQLBACKUPCLIENT_CSQLBACKUPCLIENT2, "0x%X;CSqlBackupClient::~CSqlBackupClient;iFile.SubSessionHandle()=0x%X", (TUint)this, (TUint)iFile.SubSessionHandle()));
+	
 	// cancel outstanding requests
 	Cancel();
 	
@@ -130,8 +139,10 @@
 	@return a flag indicating whether we actioned the error
 	@param the error unused
 */
-TInt CSqlBackupClient::RunError(TInt /* aError */)
+TInt CSqlBackupClient::RunError(TInt aError)
 	{
+	UNUSED_ARG(aError);
+	SQL_TRACE_BUR(OstTraceExt2(TRACE_INTERNALS, CSQLBACKUPCLIENT_RUNERROR, "0x%X;CSqlBackupClient::RunError;aError=%d", (TUint)this, aError));
 	// just satisfy it that we did something!
 	return KErrNone;
 	}
@@ -149,6 +160,7 @@
 */	
 void CSqlBackupClient::NotifyChange()
 	{
+	SQL_TRACE_BUR(OstTraceExt2(TRACE_INTERNALS, CSQLBACKUPCLIENT_NOTIFYCHANGE, "0x%X;CSqlBackupClient::NotifyChange;iBurProperty.Handle()=0x%X", (TUint)this, (TUint)iBurProperty.Handle()));
 	iBurProperty.Subscribe(iStatus);
 	SetActive();
 	}
@@ -161,10 +173,17 @@
 */
 void CSqlBackupClient::TestBurStatusL()
 	{
+	SQL_TRACE_BUR(OstTrace1(TRACE_INTERNALS, CSQLBACKUPCLIENT_TESTBURSTATUSL_ENTRY, "Entry;0x%X;CSqlBackupClient::TestBurStatusL", (TUint)this));
 	TInt status;
-	if(iBurProperty.Get(status)!=KErrNotFound)
+	__SQLTRACE_BURVAR(TInt err = KErrNone);
+	if((__SQLTRACE_BUREXPR(err =) iBurProperty.Get(status)) != KErrNotFound)
 		{
 		status&=KBURPartTypeMask;
+#ifdef _SQL_RDEBUG_PRINT
+		SQL_TRACE_BUR(OstTraceExt2(TRACE_INTERNALS, CSQLBACKUPCLIENT_TESTBURSTATUSL1, "0x%X;CSqlBackupClient::TestBurStatusL;status=%d", (TUint)this, status));
+#else
+		SQL_TRACE_BUR(OstTraceExt2(TRACE_INTERNALS, CSQLBACKUPCLIENT_TESTBURSTATUSL2, "0x%X;CSqlBackupClient::TestBurStatusL;status=%{TBURPartType}", (TUint)this, status));
+#endif	    
 		switch(status)
 			{
 			case EBURUnset: // same as EBURNormal
@@ -184,9 +203,10 @@
 				iActiveBackupClient->ConfirmReadyForBURL(KErrNone);
 				break;
 			default:
-				return;
+				break;
 			}
 		}
+	SQL_TRACE_BUR(OstTraceExt2(TRACE_INTERNALS, CSQLBACKUPCLIENT_TESTBURSTATUSL_EXIT, "Exit;0x%X;CSqlBackupClient::TestBurStatusL;iProperty.Get() err=%d", (TUint)this, err));
 	}
 
 /** Called when BUE notifies a BUR event
@@ -209,10 +229,12 @@
 	@return an arbitrary number
 	@param TDrive unused
 */
-TUint CSqlBackupClient::GetExpectedDataSize(TDriveNumber /* aDrive */)
+TUint CSqlBackupClient::GetExpectedDataSize(TDriveNumber aDrive)
 	{
+	UNUSED_ARG(aDrive);
 	// we have no idea at this point - we even don't know who is to be backed up yet
 	const TUint KArbitraryNumber = 1024;
+	SQL_TRACE_BUR(OstTraceExt3(TRACE_INTERNALS, CSQLBACKUPCLIENT_GETEXPECTEDDATASIZE, "0x%X;CSqlBackupClient::GetExpectedDataSize;aDrive=%d;rc=%u", (TUint)this, (TInt)aDrive, KArbitraryNumber));
 	return KArbitraryNumber;
 	}
 
@@ -227,11 +249,13 @@
 */
 void CSqlBackupClient::GetBackupDataSectionL(TPtr8& aBuffer, TBool& aFinishedFlag)
 	{
+	SQL_TRACE_BUR(OstTraceExt3(TRACE_INTERNALS, CSQLBACKUPCLIENT_GETBACKUPDATASECTIONL0, "0x%X;CSqlBackupClient::GetBackupDataSectionL;iState=%d;iFileIndex=%d", (TUint)this, (TInt)iState, iFileIndex));
 	// don't assume they set it to false
 	aFinishedFlag=EFalse;
 	// any files to backup
 	if(iFileList.Count()==0)
 		{
+		SQL_TRACE_BUR(OstTrace1(TRACE_INTERNALS, CSQLBACKUPCLIENT_GETBACKUPDATASECTIONL1, "0x%X;CSqlBackupClient::GetBackupDataSectionL;file count is 0", (TUint)this));
 		// nothing to backup - just return the finished flag
 		aFinishedFlag=ETrue;
 		// clear down the list
@@ -239,7 +263,7 @@
 		// iFileList closed in dtor
 		return;
 		}
-	
+
 	// run the state machine
 	for(TInt bufFreeSpace=aBuffer.MaxSize()-aBuffer.Size(); bufFreeSpace>0; bufFreeSpace=aBuffer.MaxSize()-aBuffer.Size())
 		{
@@ -249,6 +273,7 @@
 				{
 				if(iFileIndex>=iFileList.Count())
 					{
+					SQL_TRACE_BUR(OstTrace1(TRACE_INTERNALS, CSQLBACKUPCLIENT_GETBACKUPDATASECTIONL2, "0x%X;CSqlBackupClient::GetBackupDataSectionL;all files processed", (TUint)this));
 					// all files have been processed - send the finished flag
 					aFinishedFlag=ETrue;
 					// clear down the filelist
@@ -257,6 +282,8 @@
 					}
 				// open the database file to send
 				TInt rc=iFile.Open(	iInterface->Fs(), iFileList[iFileIndex].FullName(), EFileRead | EFileShareExclusive);
+				__SQLTRACE_BUREXPR(TPtrC fname = iFileList[iFileIndex].FullName());
+				SQL_TRACE_BUR(OstTraceExt5(TRACE_INTERNALS, CSQLBACKUPCLIENT_GETBACKUPDATASECTIONL3, "0x%X;CSqlBackupClient::GetBackupDataSectionL;BEGIN;fname=%S;iFileIndex=%d;iFile.SubSessionHandle()=0x%X;rc=%d", (TUint)this, __SQLPRNSTR(fname), iFileIndex, (TUint)iFile.SubSessionHandle(), rc));
 				if(KErrNone!=rc)
 					{
 					// there's nothing we can do if we can't open the file so we just skip it
@@ -290,6 +317,7 @@
 					fileSize,					// %16lx
 					fileName.Length(),			// %8x
 					&fileName);					// %S
+				SQL_TRACE_BUR(OstTraceExt4(TRACE_INTERNALS, CSQLBACKUPCLIENT_GETBACKUPDATASECTIONL5, "0x%X;CSqlBackupClient::GetBackupDataSectionL;fileName=%S;hdrPtr=|%S|;fileSize=%lld", (TUint)this, __SQLPRNSTR(fileName), __SQLPRNSTR(iBuffer), fileSize));
 				
 				// we need it to look like an 8bit buffer
 				TPtr8 hdrPtr8((TUint8*)iBuffer.Ptr(), iBuffer.Size(), iBuffer.Size());
@@ -357,6 +385,7 @@
 				}
 			case EBackupEndOfFile:
 				{
+				SQL_TRACE_BUR(OstTraceExt3(TRACE_INTERNALS, CSQLBACKUPCLIENT_GETBACKUPDATASECTIONL4, "0x%X;CSqlBackupClient::GetBackupDataSectionL;END;iFile.SubSessionHandle()=0x%X;iFileIndex=%d", (TUint)this, (TUint)iFile.SubSessionHandle(), iFileIndex));
 				iFile.Close();
 				++iFileIndex; // move on to next file
 				iState = EBackupNoFileOpen; // go round again
@@ -374,8 +403,10 @@
 	Nothing to do here except tell the server
 	@param TDrive the drive that is being restored (unused)
 */
-void CSqlBackupClient::RestoreComplete(TDriveNumber /* aDrive */)
+void CSqlBackupClient::RestoreComplete(TDriveNumber aDrive)
 	{
+	UNUSED_ARG(aDrive);
+	SQL_TRACE_BUR(OstTraceExt2(TRACE_INTERNALS, CSQLBACKUPCLIENT_RESTORECOMPLETE, "0x%X;CSqlBackupClient::RestoreComplete;aDrive=%d", (TUint)this, (TInt)aDrive));
 	}
 
 /** This is called to let us know that the given SID is to be backed up
@@ -387,8 +418,10 @@
 	@param TDriveNumber the drive to be backed up (unused)
 	@leave
 */
-void CSqlBackupClient::InitialiseGetProxyBackupDataL(TSecureId aSid, TDriveNumber /*aDrive*/)
+void CSqlBackupClient::InitialiseGetProxyBackupDataL(TSecureId aSid, TDriveNumber aDrive)
 	{
+	UNUSED_ARG(aDrive);
+	SQL_TRACE_BUR(OstTraceExt3(TRACE_INTERNALS, CSQLBACKUPCLIENT_INITIALIZEGETPROXYBACKUPDATAL, "0x%X;CSqlBackupClient::InitialiseGetProxyBackupDataL;aSid=0x%X;aDrive=%d", (TUint)this, (TUint)aSid.iId, (TInt)aDrive));
 	// get the list of database files to back up - this is provided by the SQL server
 	GetBackupListL(aSid);
 	// this is the index of the file being processed - point to the beginning
@@ -404,8 +437,10 @@
 	@param TDriveNumber the drive to restore (unused)
 	@leave
 */
-void CSqlBackupClient::InitialiseRestoreProxyBaseDataL(TSecureId aSid, TDriveNumber /* aDrive */)
+void CSqlBackupClient::InitialiseRestoreProxyBaseDataL(TSecureId aSid, TDriveNumber aDrive)
 	{
+	UNUSED_ARG(aDrive);
+	SQL_TRACE_BUR(OstTraceExt3(TRACE_INTERNALS, CSQLBACKUPCLIENT_INITIALIZERESTOREPROXYBASEDATAL, "0x%X;CSqlBackupClient::InitialiseRestoreProxyBaseDataL;aSid=0x%X;aDrive=%d", (TUint)this, (TUint)aSid.iId, (TInt)aDrive));
 	iBuffer.Zero();
 	// this is the first state of the restore state machine
 	iState=ERestoreExpectChecksum;
@@ -426,6 +461,7 @@
 */
 void CSqlBackupClient::RestoreBaseDataSectionL(TDesC8& aInBuffer, TBool aFinishedFlag)
 	{
+	SQL_TRACE_BUR(OstTraceExt4(TRACE_INTERNALS, CSQLBACKUPCLIENT_RESTOREBASEDATASECTONL0, "0x%X;CSqlBackupClient::RestoreBaseDataSectionL;iState=%d;aInBuffer.Length()=%d;aFinishedFlag=%d", (TUint)this, (TInt)iState, aInBuffer.Length(), (TInt)aFinishedFlag));
 	// used to walk the buffer
 	// got a new buffer - because each time this method is called, we have a
 	// fresh chunk of data
@@ -526,6 +562,7 @@
 					iState = ERestoreExpectFileNameSize;
 					iBuffer.Zero();
 					}
+				SQL_TRACE_BUR(OstTraceExt2(TRACE_INTERNALS, CSQLBACKUPCLIENT_RESTOREBASEDATASECTONL1, "0x%X;CSqlBackupClient::RestoreBaseDataSectionL;iFileSize=%lld", (TUint)this, iFileSize));
 				break;
 				}
 			case ERestoreExpectFileNameSize: // the size of the file name to restore
@@ -543,6 +580,7 @@
 			case ERestoreExpectFileName:  // the name of the file to restore
 				{
 				CopyBufData(aInBuffer, inBufferPos, iBuffer, iFileNameSize);
+				SQL_TRACE_BUR(OstTraceExt4(TRACE_INTERNALS, CSQLBACKUPCLIENT_RESTOREBASEDATASECTONL2, "0x%X;CSqlBackupClient::RestoreBaseDataSectionL;BEGIN;iBuffer=%S;iBuffer.Length()=%d;iFileNameSize=%d", (TUint)this, __SQLPRNSTR(iBuffer), iBuffer.Length(), iFileNameSize));
 				if(iBuffer.Length() == iFileNameSize)
 					{
 					iState = ERestoreExpectData;
@@ -552,6 +590,7 @@
 					// once all the temp files are created, then they are renamed to the
 					// real file names in one fell swoop
 					__SQLLEAVE_IF_ERROR(iFile.Replace(iInterface->Fs(), iBuffer, EFileWrite | EFileShareExclusive));
+					SQL_TRACE_BUR(OstTraceExt2(TRACE_INTERNALS, CSQLBACKUPCLIENT_RESTOREBASEDATASECTONL3, "0x%X;CSqlBackupClient::RestoreBaseDataSectionL;iFile.SubSessionHandle()=0x%X", (TUint)this, (TUint)iFile.SubSessionHandle()));
 					iBuffer.Zero();
 					}
 				break;
@@ -574,8 +613,9 @@
 				TUint32 cksum = CheckSumL(iFile) & KMaxTUint32;
 				
 				// done with the file now - has to follow checksum cos it
-				// expects an open file
-                __SQLLEAVE_IF_ERROR(iFile.Flush());
+				// expects ann open file
+				SQL_TRACE_BUR(OstTraceExt2(TRACE_INTERNALS, CSQLBACKUPCLIENT_RESTOREBASEDATASECTONL4, "0x%X;CSqlBackupClient::RestoreBaseDataSectionL;END;iFile.SubSessionHandle()=0x%X", (TUint)this, (TUint)iFile.SubSessionHandle()));
+			    __SQLLEAVE_IF_ERROR(iFile.Flush());
 				iFile.Close();
 
                 // validate that the checksum matches
@@ -592,6 +632,7 @@
 					CDir *dir=NULL;
 					__SQLLEAVE_IF_ERROR(iInterface->Fs().GetDir(KRestoreFilter,KEntryAttNormal,ESortNone,dir));
 					CleanupStack::PushL(dir);
+					TInt err2 = KErrNone;
 					for(TInt a=0;a<dir->Count();++a)
 						{
 						TEntry entry=(*dir)[a];
@@ -607,17 +648,25 @@
 						//the ".bak" file, if exists, will be deleted first.
 						(void)iInterface->Fs().Delete(bak);
 						TInt err=iInterface->Fs().Rename(db,bak);
+						SQL_TRACE_BUR(OstTraceExt4(TRACE_INTERNALS, CSQLBACKUPCLIENT_RESTOREBASEDATASECTONL5, "0x%X;CSqlBackupClient::RestoreBaseDataSectionL;END;bak=%S;db=%S;err=%d", (TUint)this, __SQLPRNSTR(bak), __SQLPRNSTR(db), err));
 						if(err!=KErrNone && err!=KErrNotFound)
 							{
 							__SQLLEAVE(err);
 							}
 						
 						// now, rename the .rst as .db
-						__SQLLEAVE_IF_ERROR(iInterface->Fs().Rename(rst,db));
-						
+						err = iInterface->Fs().Rename(rst,db);
+						if(err != KErrNone && err2 == KErrNone)
+							{
+							//The idea here is to not report the error immediatelly by calling LeaveIfError().
+							//If we leave here, the next database restore may also fail, for example, if the current database is still open by 
+							//its owner. Then "TInt err=iInterface->Fs().Rename(db,bak);" will fail again.
+							err2 = err;
+							}
 						// if we got here, we have a backup of the original database in .db.bak
 						// and the new database in .db
 						}
+					__SQLLEAVE_IF_ERROR(err2);
 					
 					// clean up dir
 					//delete dir;
@@ -630,6 +679,7 @@
 					// files that belong together and not bits of old and new
 					__SQLLEAVE_IF_ERROR(iInterface->Fs().GetDir(KBackupFilter,KEntryAttNormal,ESortNone,dir));
 					CleanupStack::PushL(dir);
+					SQL_TRACE_BUR(OstTraceExt2(TRACE_INTERNALS, CSQLBACKUPCLIENT_RESTOREBASEDATASECTONL6, "0x%X;CSqlBackupClient::RestoreBaseDataSectionL;bak files count=%d", (TUint)this, dir->Count()));
 					for(TInt a1=0;a1<dir->Count();++a1)
 						{
 						TEntry entry=(*dir)[a1];
@@ -668,6 +718,7 @@
 	// rename all the .bak files to .db
 	CDir *dir=NULL;
 	TInt rc=iInterface->Fs().GetDir(KBackupFilter,KEntryAttNormal,ESortNone,dir);
+	SQL_TRACE_BUR(OstTraceExt3(TRACE_INTERNALS, CSQLBACKUPCLIENT_TERMINATEMULTISTAGEOPERATION1, "0x%X;CSqlBackupClient::TerminateMultiStageOperation;Fs().GetDir() err=%d;file count=%d", (TUint)this, rc, rc == KErrNone ? dir->Count() : 0));
 	if(KErrNone!=rc)
 		{
 		// can't get a file list - can't do anything
@@ -688,7 +739,7 @@
 		//and continue with the next file.
 		if(KErrNone != rc)
 		    {
-		    RDebug::Print(_L(" *** CSqlBackupClient::TerminateMultiStageOperation(), file \"%S\", err=%d\r\n"), &db, rc);
+			SQL_TRACE_BUR(OstTraceExt4(TRACE_INTERNALS, CSQLBACKUPCLIENT_TERMINATEMULTISTAGEOPERATION2, "0x%X;CSqlBackupClient::TerminateMultiStageOperation;Fs().Rename() err=%d;bak=%S;db=%S", (TUint)this, rc, __SQLPRNSTR(bak), __SQLPRNSTR(db)));
 		    }
 		// backup restored ok
 		}
@@ -776,6 +827,7 @@
 */
 void CSqlBackupClient::GetBackupListL(TSecureId aSid)
 	{
+	SQL_TRACE_BUR(OstTraceExt2(TRACE_INTERNALS, CSQLBACKUPCLIENT_GETBACKUPLISTL, "0x%X;CSqlBackupClient::GetBackupListL;aSid=0x%X", (TUint)this, (TUint)aSid.iId));
 	// we own the array - the SQL server just populates it
 	iInterface->GetBackUpListL(aSid,iFileList);
 	}
@@ -836,9 +888,9 @@
 //
 void CSqlBackupClient::CopyBufData(const TDesC8& aInBuf, TInt& aInBufReadPos, TDes& aOutBuf, TInt aDataLen)
 	{
-	__SQLASSERT(aInBufReadPos >= 0, ESqlPanicBadArgument);
-    __SQLASSERT(aDataLen > 0, ESqlPanicBadArgument);
-    __SQLASSERT(!(aInBuf.Length() & 0x01), ESqlPanicInternalError);
+    __ASSERT_DEBUG(aInBufReadPos >= 0, __SQLPANIC(ESqlPanicBadArgument));
+    __ASSERT_DEBUG(aDataLen > 0, __SQLPANIC(ESqlPanicBadArgument));
+    __ASSERT_DEBUG(!(aInBuf.Length() & 0x01), __SQLPANIC(ESqlPanicInternalError));
 	
 	TInt needed = (aDataLen - aOutBuf.Length()) << K8to16bitShift;
 	TInt available = aInBuf.Size() - aInBufReadPos;
--- a/persistentstorage/sql/SRC/Server/SqlSrvAuthorizer.cpp	Tue Jul 06 16:18:30 2010 +0300
+++ b/persistentstorage/sql/SRC/Server/SqlSrvAuthorizer.cpp	Wed Aug 18 11:30:17 2010 +0300
@@ -154,7 +154,7 @@
 //The function returns the argument number where the table name is.
 inline TInt DbOp2TableNameArgIndex(TInt aDbOpType)
 	{
-	__SQLASSERT(aDbOpType > 0 && aDbOpType <= SQLITE_FUNCTION, ESqlPanicInternalError);
+	__ASSERT_DEBUG(aDbOpType > 0 && aDbOpType <= SQLITE_FUNCTION, __SQLPANIC2(ESqlPanicInternalError));
 	return KTableNameArgIndex[aDbOpType];
 	}
 
@@ -165,12 +165,12 @@
 	TInt pos = DbOp2TableNameArgIndex(aDbOpType);
 	if(pos == 2)
 		{
-		__SQLASSERT(aDbObjName2 != NULL, ESqlPanicInternalError);
+		__ASSERT_DEBUG(aDbObjName2 != NULL, __SQLPANIC2(ESqlPanicInternalError));
 		return aDbObjName2;
 		}
 	else if(pos == 1)
 		{
-		__SQLASSERT(aDbObjName1 != NULL, ESqlPanicInternalError);
+		__ASSERT_DEBUG(aDbObjName1 != NULL, __SQLPANIC2(ESqlPanicInternalError));
 		return aDbObjName1;
 		}
 	return NULL;//Some database operations do not use table name
@@ -182,7 +182,7 @@
 	{
 	if(aDbOpType == SQLITE_DETACH || aDbOpType == SQLITE_ALTER_TABLE)
 		{
-		__SQLASSERT(aDbObjName1 != NULL, ESqlPanicInternalError);
+		__ASSERT_DEBUG(aDbObjName1 != NULL, __SQLPANIC2(ESqlPanicInternalError));
 		return aDbObjName1;
 		}
 	return aDbName;//It may be NULL for some database operations
@@ -298,7 +298,7 @@
 //		case SQLITE_CREATE_VTABLE:
 //		case SQLITE_DROP_VTABLE:
 		default:
-			__SQLASSERT(EFalse, ESqlPanicInternalError);
+			__ASSERT_DEBUG(EFalse, __SQLPANIC2(ESqlPanicInternalError));
 			break;
 			}
 	return res;
@@ -428,7 +428,7 @@
 //		case SQLITE_CREATE_VTABLE:
 //		case SQLITE_DROP_VTABLE:
 		default:
-			__SQLASSERT(EFalse, ESqlPanicInternalError);
+			__ASSERT_DEBUG(EFalse, __SQLPANIC2(ESqlPanicInternalError));
 			break;
 		}
 	return res;
@@ -503,9 +503,9 @@
 										const char* aDbName, const char* aTrgOrViewName)
 	{
 	UNUSED_ARG(aTrgOrViewName);
- 	__SQLASSERT(aDb != NULL, ESqlPanicBadArgument);
+ 	__ASSERT_DEBUG(aDb != NULL, __SQLPANIC2(ESqlPanicBadArgument));
 	
-#ifdef _NOTIFY
+#ifdef _SQL_AUTHORIZER_TRACE_ENABLED
     enum TDbOpType {EOpCreateIndex = 1, EOpCreateTable, EOpCreateTempIndex, EOpCreateTempTable, 
         EOpCreateTempTrigger, EOpCreateTempView, EOpCreateTrigger, EOpCreateView, EOpDelete, EOpDropIndex, 
         EOpDropTable, EOpDropTempIndex, EOpDropTempTable, EOpDropTempTrigger, EOpDropTempView, EOpDropTrigger,
@@ -513,7 +513,7 @@
 		EOpAlterTable, EOpReindex, EOpAnalyze, EOpCreateVTable, EOpDropVTable, EOpFunctionCall};
 	TDbOpType dbOpType = static_cast <TDbOpType> (aDbOpType);//can be seen now in the debugger
 	::PrintAuthorizerArguments(dbOpType, aDbObjName1, aDbObjName2, aDbName, aTrgOrViewName);
-#endif//_NOTIFY
+#endif
 
 	CSqlSrvDatabase& db = *static_cast <CSqlSrvDatabase*> (aDb);
 
--- a/persistentstorage/sql/SRC/Server/SqlSrvBlob.cpp	Tue Jul 06 16:18:30 2010 +0300
+++ b/persistentstorage/sql/SRC/Server/SqlSrvBlob.cpp	Wed Aug 18 11:30:17 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -14,12 +14,19 @@
 //
 
 #include "sqlite3.h"
-#include "SqlPanic.h"
+#include "SqlAssert.h"
 #include "SqlSrvBlob.h"
 #include "SqliteSymbian.h"
 #include "SqlSrvUtil.h"
 #include "SqlSrvStrings.h"
 #include "SqlDb.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "SqlSrvBlobTraces.h"
+#endif
+#include "SqlTraceDef.h"
+
+#define UNUSED_VAR(var) var = var
 
 /**
 Creates a new HBlobBuf instance.
@@ -45,14 +52,19 @@
 */
 HBlobBuf* HBlobBuf::NewL(sqlite3* aDb, const TDesC8& aDbName, const TDesC8& aTableName, const TDesC8& aColumnName, TInt64 aRowId, TMode aMode)
 	{
-	__SQLASSERT(aDb != NULL, ESqlPanicBadArgument);
-	__SQLASSERT(aRowId > 0, ESqlPanicBadArgument);
-	__SQLASSERT(aMode == HBlobBuf::EReadOnly || aMode == HBlobBuf::EReadWrite, ESqlPanicBadArgument);
+	__SQLTRACE_BLOBVAR(TBuf<100> des16prnbuf);
+	SQL_TRACE_BLOB(OstTraceExt4(TRACE_INTERNALS, HBLOBBUF_NEWL_ENTRY1, "Entry;0;HBlobBuf::NewL;sqlite3*=0x%X;aDbName=%s;aRowId=%lld;aMode=%d", (TUint)aDb, __SQLPRNSTR8(aDbName, des16prnbuf), aRowId, (TInt)aMode));
+	SQL_TRACE_BLOB(OstTraceExt1(TRACE_INTERNALS, HBLOBBUF_NEWL_ENTRY2, "Entry;0;HBlobBuf::NewL;aTableName=%s", __SQLPRNSTR8(aTableName, des16prnbuf)));
+	SQL_TRACE_BLOB(OstTraceExt1(TRACE_INTERNALS, HBLOBBUF_NEWL_ENTRY3, "Entry;0;HBlobBuf::NewL;aColumnName=%s", __SQLPRNSTR8(aColumnName, des16prnbuf)));
+	__ASSERT_DEBUG(aDb != NULL, __SQLPANIC2(ESqlPanicBadArgument));
+	__ASSERT_DEBUG(aRowId > 0, __SQLPANIC2(ESqlPanicBadArgument));
+	__ASSERT_DEBUG(aMode == HBlobBuf::EReadOnly || aMode == HBlobBuf::EReadWrite, __SQLPANIC2(ESqlPanicBadArgument));
 	
 	HBlobBuf* self = new (ELeave) HBlobBuf;
 	CleanupStack::PushL(self);
 	self->ConstructL(aDb, aDbName, aTableName, aColumnName, aRowId, aMode);
 	CleanupStack::Pop(self);
+	SQL_TRACE_BLOB(OstTraceExt2(TRACE_INTERNALS, HBLOBBUF_NEWL_EXIT, "Exit;0x%X;HBlobBuf::NewL;sqlite3_blob*=0x%X", (TUint)self, (TUint)self->iBlobHandle));
 	return self;
 	}
 
@@ -89,16 +101,16 @@
 */
 void HBlobBuf::ConstructL(sqlite3* aDb, const TDesC8& aDbName, const TDesC8& aTableName, const TDesC8& aColumnName, TInt64 aRowId, TMode aMode)
 	{
-	__SQLASSERT(aDb != NULL, ESqlPanicBadArgument);
-	__SQLASSERT(aRowId > 0, ESqlPanicBadArgument);
-	__SQLASSERT(aMode == HBlobBuf::EReadOnly || aMode == HBlobBuf::EReadWrite, ESqlPanicBadArgument);
+	__ASSERT_DEBUG(aDb != NULL, __SQLPANIC(ESqlPanicBadArgument));
+	__ASSERT_DEBUG(aRowId > 0, __SQLPANIC(ESqlPanicBadArgument));
+	__ASSERT_DEBUG(aMode == HBlobBuf::EReadOnly || aMode == HBlobBuf::EReadWrite, __SQLPANIC(ESqlPanicBadArgument));
 	
 	(void)sqlite3SymbianLastOsError();//clear last OS error
 			
 	TInt err = sqlite3_blob_open(aDb, (const char*)aDbName.Ptr(), (const char*)aTableName.Ptr(), (const char*)aColumnName.Ptr(), 
 								 aRowId, aMode & HBlobBuf::EReadWrite, &iBlobHandle);
 	__SQLLEAVE_IF_ERROR(::Sql2OsErrCode(err, sqlite3SymbianLastOsError()));
-	__SQLASSERT(iBlobHandle != NULL, ESqlPanicInternalError);
+	__ASSERT_DEBUG(iBlobHandle != NULL, __SQLPANIC(ESqlPanicInternalError));
 	iBlobSize = sqlite3_blob_bytes(iBlobHandle);
 	iWrPos = iRdPos = 0;
 	}
@@ -108,8 +120,11 @@
 */
 void HBlobBuf::DoRelease()
 	{
-	TRAP_IGNORE(DoSynchL());
-	}
+	SQL_TRACE_BLOB(OstTraceExt2(TRACE_INTERNALS, HBLOBBUF_DORELEASE_ENTRY, "Entry;0x%X;HBlobBuf::DoRelease;sqlite3_blob*=0x%X", (TUint)this, (TUint)iBlobHandle));
+	TRAPD(err, DoSynchL());
+	SQL_TRACE_BLOB(OstTraceExt2(TRACE_INTERNALS, HBLOBBUF_DORELEASE_EXIT, "Exit;0x%X;HBlobBuf::DoRelease;err=%d", (TUint)this, err));
+    UNUSED_VAR(err);
+    }
 	
 /**
 Closes the blob handle.
@@ -120,6 +135,7 @@
 	if(iBlobHandle)
 		{
 		TInt err = sqlite3_blob_close(iBlobHandle);
+		SQL_TRACE_BLOB(OstTraceExt2(TRACE_INTERNALS, HBLOBBUF_DOSYNCHL, "0x%X;HBlobBuf::DoSynchL;err=%d", (TUint)this, err));
 		iBlobHandle = NULL; // the close is unconditional, even if an error occurs
 		__SQLLEAVE_IF_ERROR(::Sql2OsErrCode(err, sqlite3SymbianLastOsError()));
 		}	
@@ -145,9 +161,11 @@
 */
 TInt HBlobBuf::DoReadL(TAny* aPtr, TInt aMaxLength)
 	{
-	__SQLASSERT(aPtr != NULL, ESqlPanicBadArgument);
-	__SQLASSERT(aMaxLength >= 0, ESqlPanicBadArgument);
-	__SQLASSERT(iBlobHandle != NULL, ESqlPanicInvalidObj);
+	__ASSERT_DEBUG(aPtr != NULL, __SQLPANIC(ESqlPanicBadArgument));
+	__ASSERT_DEBUG(aMaxLength >= 0, __SQLPANIC(ESqlPanicBadArgument));
+	__ASSERT_DEBUG(iBlobHandle != NULL, __SQLPANIC(ESqlPanicInvalidObj));
+	
+	SQL_TRACE_BLOB(OstTraceExt5(TRACE_INTERNALS, HBLOBBUF_DOREADL, "0x%X;HBlobBuf::DoReadL;aMaxLength=%d;iBlobSize=%d;iWrPos=%d;iRdPos=%d", (TUint)this, aMaxLength, iBlobSize, iWrPos, iRdPos));
 	
 	if(aMaxLength <= 0)
 		{
@@ -188,9 +206,11 @@
 */
 void HBlobBuf::DoWriteL(const TAny* aPtr, TInt aLength)
 	{
-	__SQLASSERT(aPtr != NULL, ESqlPanicBadArgument);
-	__SQLASSERT(aLength >= 0, ESqlPanicBadArgument);
-	__SQLASSERT(iBlobHandle != NULL, ESqlPanicInvalidObj);
+	__ASSERT_DEBUG(aPtr != NULL, __SQLPANIC(ESqlPanicBadArgument));
+	__ASSERT_DEBUG(aLength >= 0, __SQLPANIC(ESqlPanicBadArgument));
+	__ASSERT_DEBUG(iBlobHandle != NULL, __SQLPANIC(ESqlPanicInvalidObj));
+	
+	SQL_TRACE_BLOB(OstTraceExt5(TRACE_INTERNALS, HBLOBBUF_DOWRITEL, "0x%X;HBlobBuf::DoWriteL;aLength=%d;iBlobSize=%d;iWrPos=%d;iRdPos=%d", (TUint)this, aLength, iBlobSize, iWrPos, iRdPos));
 	
 	if(aLength <= 0)
 		{
@@ -227,9 +247,10 @@
 */
 TStreamPos HBlobBuf::DoSeekL(MStreamBuf::TMark aMark, TStreamLocation aLocation, TInt aOffset)
 	{
-	__SQLASSERT_ALWAYS(!(aMark & ~(ERead | EWrite)), ESqlPanicStreamMarkInvalid);
-	__SQLASSERT(aOffset >= 0, ESqlPanicBadArgument);
-	__SQLASSERT(iBlobHandle != NULL, ESqlPanicInvalidObj);
+	SQL_TRACE_BLOB(OstTraceExt5(TRACE_INTERNALS, HBLOBBUF_DOSEEKL, "0x%X;HBlobBuf::DoSeekL;aMark=%d;aLocation=%d;aOffset=%d;iBlobSize=%d", (TUint)this, (TInt)aMark, (TInt)aLocation, aOffset, iBlobSize));
+	__ASSERT_ALWAYS(!(aMark & ~(ERead | EWrite)), __SQLPANIC(ESqlPanicStreamMarkInvalid));
+	__ASSERT_DEBUG(aOffset >= 0, __SQLPANIC(ESqlPanicBadArgument));
+	__ASSERT_DEBUG(iBlobHandle != NULL, __SQLPANIC(ESqlPanicInvalidObj));
 	
 	TInt newPos = 0;
 	switch(aLocation)
@@ -244,7 +265,7 @@
 		newPos = iBlobSize + aOffset;
 		break;
 	default:
-		__SQLASSERT(0, ESqlPanicStreamLocationInvalid);
+		__ASSERT_DEBUG(0, __SQLPANIC(ESqlPanicStreamLocationInvalid));
 		newPos = -1;
 		break;
 		}
--- a/persistentstorage/sql/SRC/Server/SqlSrvCollation.cpp	Tue Jul 06 16:18:30 2010 +0300
+++ b/persistentstorage/sql/SRC/Server/SqlSrvCollation.cpp	Wed Aug 18 11:30:17 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -16,7 +16,7 @@
 //
 
 #include "SqlSrvCollation.h"
-#include "SqlPanic.h"
+#include "SqlAssert.h"
 #include "SqlUtil.h"
 #include "sqlite3.h"
 #include "SqliteSymbian.h"		//sqlite3SymbianLastOsError()
@@ -155,7 +155,7 @@
 TSqlCollationUtil::TSqlCollationUtil(sqlite3* aDbHandle) :
 	iDbHandle(aDbHandle)
 	{
-	__SQLASSERT(iDbHandle != NULL, ESqlPanicBadArgument);
+	__ASSERT_DEBUG(iDbHandle != NULL, __SQLPANIC(ESqlPanicBadArgument));
 	}
 
 /**
@@ -194,7 +194,7 @@
 */
 void TSqlCollationUtil::InstallCollationsL()
 	{
-	__SQLASSERT(iDbHandle != NULL, ESqlPanicInvalidObj);
+	__ASSERT_DEBUG(iDbHandle != NULL, __SQLPANIC(ESqlPanicInvalidObj));
 	(void)sqlite3SymbianLastOsError();//clear last OS error
 	//Register user defined collations
 	for(TInt i=0;i<KCollationMethodCount;++i)
@@ -224,6 +224,6 @@
 */
 TPtrC TSqlCollationUtil::CollationName(TInt aIndex) const
 	{
-	__SQLASSERT((TUint)aIndex < KCollationMethodCount, ESqlPanicBadArgument);
+	__ASSERT_DEBUG((TUint)aIndex < KCollationMethodCount, __SQLPANIC(ESqlPanicBadArgument));
 	return TPtrC(KCollationMethodName[aIndex]);
 	}
--- a/persistentstorage/sql/SRC/Server/SqlSrvConfig.cpp	Tue Jul 06 16:18:30 2010 +0300
+++ b/persistentstorage/sql/SRC/Server/SqlSrvConfig.cpp	Wed Aug 18 11:30:17 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -16,6 +16,11 @@
 #include <f32file64.h>
 #include "SqlSrvConfig.h"
 #include "SqlSrvUtil.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "SqlSrvConfigTraces.h"
+#endif
+#include "SqlTraceDef.h"
 
 /**
 Initializes TSqlSrvConfigParams data members with their default values.
@@ -46,11 +51,15 @@
 */
 void TSqlSrvConfig::InitL(RFs& aFs, const TDesC& aFileName)
 	{
+	SQL_TRACE_INTERNALS(OstTraceExt2(TRACE_INTERNALS, TSQLSRVCONFIGFILE_INITL_ENTRY, "Entry;0;TSqlSrvConfig::InitL;aFs.Handle()=0x%X;aFileName=%S", (TUint)aFs.Handle(), __SQLPRNSTR(aFileName)));
 	if(::FileExists(aFs, aFileName))
 		{
+        SQL_TRACE_INTERNALS(OstTrace0(TRACE_INTERNALS, TSQLSRVCONFIGFILE_INITL1, "0;TSqlSrvConfig::InitL;Config file found"));
 		TBuf8<KSqlSrvMaxConfigStrLen> configFileStr;
 		//Step 1: get the config string from the config file and store the string in configFileStr
 		TSqlSrvConfig::GetConfigStringFromFileL(aFs, aFileName, configFileStr);
+		__SQLTRACE_INTERNALSVAR(TBuf<100> des16prnbuf);
+        SQL_TRACE_INTERNALS(OstTraceExt1(TRACE_INTERNALS, TSQLSRVCONFIGFILE_INITL2, "0;TSqlSrvConfig::InitL;Config file string=%s", __SQLPRNSTR8(configFileStr, des16prnbuf)));
 		//Step 2: extract config file parameters from the string (configFileStr)  and store them in iConfigFileParams
 		TSqlSrvConfig::ExtractConfigParamsFromStringL(configFileStr, iConfigFileParams);
 		}
@@ -64,6 +73,13 @@
 		{
 		iConfigFileParams.iFreePageThresholdKb = KSqlCompactFreePageThresholdKb;
 		}
+
+#ifdef _SQL_RDEBUG_PRINT
+    SQL_TRACE_INTERNALS(OstTraceExt4(TRACE_INTERNALS, TSQLSRVCONFIGFILE_INITL_EXIT1, "Exit;0;TSqlSrvConfig::InitL;iCacheSize=%d;iPageSize=%d;iDbEncoding=%d;iSoftHeapLimit=%d", iConfigFileParams.iCacheSize, iConfigFileParams.iPageSize, iConfigFileParams.iDbEncoding, iConfigFileParams.iSoftHeapLimitKb));
+#else	
+    SQL_TRACE_INTERNALS(OstTraceExt4(TRACE_INTERNALS, TSQLSRVCONFIGFILE_INITL_EXIT2, "Exit;0;TSqlSrvConfig::InitL;iCacheSize=%d;iPageSize=%d;iDbEncoding=%{TSqlSrvConfig_TDbEncoding};iSoftHeapLimit=%d", iConfigFileParams.iCacheSize, iConfigFileParams.iPageSize, iConfigFileParams.iDbEncoding, iConfigFileParams.iSoftHeapLimitKb));
+#endif    
+    SQL_TRACE_INTERNALS(OstTraceExt2(TRACE_INTERNALS, TSQLSRVCONFIGFILE_INITL_EXIT3, "Exit;0;TSqlSrvConfig::InitL;iCompactionMode=%d;iFreePageThresholdKb=%d", iConfigFileParams.iCompactionMode, iConfigFileParams.iFreePageThresholdKb));
 	}
 
 /**
@@ -82,6 +98,8 @@
 */
 void TSqlSrvConfig::GetConfigParamsL(const TDesC8& aConfigStr, TSqlSrvConfigParams& aConfigParams) const
 	{
+	__SQLTRACE_INTERNALSVAR(TBuf<100> des16prnbuf);
+    SQL_TRACE_INTERNALS(OstTraceExt1(TRACE_INTERNALS, TSQLSRVCONFIGFILE_GETCONFIGPARAMSL_ENTRY, "Entry;0;TSqlSrvConfig::GetConfigParamsL;aConfigStr=%s", __SQLPRNSTR8(aConfigStr, des16prnbuf)));
 	TSqlSrvConfigParams tmpConfigParams;
 	//Step 1: extract configuration parameters from aConfigStr, store them in tmpConfigParams.
 	TSqlSrvConfig::ExtractConfigParamsFromStringL(aConfigStr, tmpConfigParams);
@@ -111,18 +129,24 @@
 	//Step 5: set the free page threshold.
 	aConfigParams.iFreePageThresholdKb = iConfigFileParams.iFreePageThresholdKb;
 	//Step 6: assert the parameter values.
-	__SQLASSERT(aConfigParams.iPageSize == TSqlSrvConfigParams::KConfigPrmValueNotSet || aConfigParams.iPageSize >= 0, ESqlPanicInternalError);
-	__SQLASSERT(aConfigParams.iCacheSize == TSqlSrvConfigParams::KConfigPrmValueNotSet || aConfigParams.iCacheSize >= 0, ESqlPanicInternalError);
-	__SQLASSERT(aConfigParams.iDbEncoding == TSqlSrvConfigParams::EEncNotSet || 
+	__ASSERT_DEBUG(aConfigParams.iPageSize == TSqlSrvConfigParams::KConfigPrmValueNotSet || aConfigParams.iPageSize >= 0, __SQLPANIC(ESqlPanicInternalError));
+	__ASSERT_DEBUG(aConfigParams.iCacheSize == TSqlSrvConfigParams::KConfigPrmValueNotSet || aConfigParams.iCacheSize >= 0, __SQLPANIC(ESqlPanicInternalError));
+	__ASSERT_DEBUG(aConfigParams.iDbEncoding == TSqlSrvConfigParams::EEncNotSet || 
 				aConfigParams.iDbEncoding == TSqlSrvConfigParams::EEncUtf8 || 
-				aConfigParams.iDbEncoding == TSqlSrvConfigParams::EEncUtf16, ESqlPanicInternalError);
-	__SQLASSERT(aConfigParams.iSoftHeapLimitKb == TSqlSrvConfigParams::KConfigPrmValueNotSet || 
+				aConfigParams.iDbEncoding == TSqlSrvConfigParams::EEncUtf16, __SQLPANIC(ESqlPanicInternalError));
+	__ASSERT_DEBUG(aConfigParams.iSoftHeapLimitKb == TSqlSrvConfigParams::KConfigPrmValueNotSet || 
 	            (aConfigParams.iSoftHeapLimitKb >= TSqlSrvConfigParams::KMinSoftHeapLimitKb &&
-	             aConfigParams.iSoftHeapLimitKb <= TSqlSrvConfigParams::KMaxSoftHeapLimitKb), ESqlPanicInternalError);
-	__SQLASSERT(aConfigParams.iCompactionMode == ESqlCompactionNotSet || aConfigParams.iCompactionMode == ESqlCompactionManual || 
-				aConfigParams.iCompactionMode == ESqlCompactionBackground || aConfigParams.iCompactionMode == ESqlCompactionAuto, ESqlPanicInternalError);
-	__SQLASSERT(aConfigParams.iFreePageThresholdKb == TSqlSrvConfigParams::KConfigPrmValueNotSet || 
-				aConfigParams.iFreePageThresholdKb >= 0, ESqlPanicInternalError);
+	             aConfigParams.iSoftHeapLimitKb <= TSqlSrvConfigParams::KMaxSoftHeapLimitKb), __SQLPANIC(ESqlPanicInternalError));
+	__ASSERT_DEBUG(aConfigParams.iCompactionMode == ESqlCompactionNotSet || aConfigParams.iCompactionMode == ESqlCompactionManual || 
+				aConfigParams.iCompactionMode == ESqlCompactionBackground || aConfigParams.iCompactionMode == ESqlCompactionAuto, __SQLPANIC(ESqlPanicInternalError));
+	__ASSERT_DEBUG(aConfigParams.iFreePageThresholdKb == TSqlSrvConfigParams::KConfigPrmValueNotSet || 
+				aConfigParams.iFreePageThresholdKb >= 0, __SQLPANIC(ESqlPanicInternalError));
+#ifdef _SQL_RDEBUG_PRINT
+    SQL_TRACE_INTERNALS(OstTraceExt4(TRACE_INTERNALS, TSQLSRVCONFIGFILE_GETCONFIGPARAMSL_EXIT1, "Exit;0;TSqlSrvConfig::GetConfigParamsL;cacheSize=%d;pageSize=%d;dbEncoding=%d;softHeapLimit=%d", aConfigParams.iCacheSize, aConfigParams.iPageSize, aConfigParams.iDbEncoding, aConfigParams.iSoftHeapLimitKb));
+#else   
+    SQL_TRACE_INTERNALS(OstTraceExt4(TRACE_INTERNALS, TSQLSRVCONFIGFILE_GETCONFIGPARAMSL_EXIT2, "Exit;0;TSqlSrvConfig::GetConfigParamsL;cacheSize=%d;pageSize=%d;dbEncoding=%{TSqlSrvConfig_TDbEncoding};softHeapLimit=%d", aConfigParams.iCacheSize, aConfigParams.iPageSize, aConfigParams.iDbEncoding, aConfigParams.iSoftHeapLimitKb));
+#endif    
+    SQL_TRACE_INTERNALS(OstTraceExt2(TRACE_INTERNALS, TSQLSRVCONFIGFILE_GETCONFIGPARAMSL_EXIT3, "Exit;0;TSqlSrvConfig::GetConfigParamsL;compactionMode=%d;freePageThresholdKb=%d", aConfigParams.iCompactionMode, aConfigParams.iFreePageThresholdKb));
 	}
 
 //The function opeans the aFileName config file and reads the config string, storring it in aConfigStr argument.
@@ -133,10 +157,10 @@
 //The function may leave if some of the file I/O operations (open file, read file) fails.
 void TSqlSrvConfig::GetConfigStringFromFileL(RFs& aFs, const TDesC& aFileName, TDes8& aConfigStr)
 	{
-	__SQLASSERT(aConfigStr.MaxLength() >= KSqlSrvMaxConfigStrLen, ESqlPanicBadArgument);
+	__ASSERT_DEBUG(aConfigStr.MaxLength() >= KSqlSrvMaxConfigStrLen, __SQLPANIC2(ESqlPanicBadArgument));
 	RFile64 cfgFile;
 	CleanupClosePushL(cfgFile);
-	__SQLLEAVE_IF_ERROR(cfgFile.Open(aFs, aFileName, EFileRead));
+	__SQLLEAVE_IF_ERROR2(cfgFile.Open(aFs, aFileName, EFileRead));
 	TFileText cfgFileReader;
 	cfgFileReader.Set(cfgFile);
 	TBuf<KSqlSrvMaxConfigStrLen> buf;
@@ -156,13 +180,13 @@
 	CleanupStack::PopAndDestroy(&cfgFile);
 	if(err != KErrEof)
 		{//The "read configuration file" operation has failed with "err" (if err != KErrNone)
-		__SQLLEAVE_IF_ERROR(err);	
+		__SQLLEAVE_IF_ERROR2(err);	
 		}
 	if(!cfgLineFound)
 		{//End of config file reached - no valid configuration line found.
-		__SQLLEAVE(KErrEof);	
+		__SQLLEAVE2(KErrEof);	
 		}
-	__SQLASSERT(err == KErrNone || err == KErrEof, ESqlPanicInternalError);
+	__ASSERT_DEBUG(err == KErrNone || err == KErrEof, __SQLPANIC2(ESqlPanicInternalError));
 	aConfigStr.Copy(buf);
 	}
 
@@ -184,18 +208,18 @@
 			}
 		}
 	//Assert the extracted parameter values.
-	__SQLASSERT(aConfigParams.iPageSize == TSqlSrvConfigParams::KConfigPrmValueNotSet || aConfigParams.iPageSize >= 0, ESqlPanicInternalError);
-	__SQLASSERT(aConfigParams.iCacheSize == TSqlSrvConfigParams::KConfigPrmValueNotSet || aConfigParams.iCacheSize >= 0, ESqlPanicInternalError);
-	__SQLASSERT(aConfigParams.iDbEncoding == TSqlSrvConfigParams::EEncNotSet || 
+	__ASSERT_DEBUG(aConfigParams.iPageSize == TSqlSrvConfigParams::KConfigPrmValueNotSet || aConfigParams.iPageSize >= 0, __SQLPANIC2(ESqlPanicInternalError));
+	__ASSERT_DEBUG(aConfigParams.iCacheSize == TSqlSrvConfigParams::KConfigPrmValueNotSet || aConfigParams.iCacheSize >= 0, __SQLPANIC2(ESqlPanicInternalError));
+	__ASSERT_DEBUG(aConfigParams.iDbEncoding == TSqlSrvConfigParams::EEncNotSet || 
 				aConfigParams.iDbEncoding == TSqlSrvConfigParams::EEncUtf8 || 
-				aConfigParams.iDbEncoding == TSqlSrvConfigParams::EEncUtf16, ESqlPanicInternalError);
-	__SQLASSERT(aConfigParams.iSoftHeapLimitKb == TSqlSrvConfigParams::KConfigPrmValueNotSet || 
+				aConfigParams.iDbEncoding == TSqlSrvConfigParams::EEncUtf16, __SQLPANIC2(ESqlPanicInternalError));
+	__ASSERT_DEBUG(aConfigParams.iSoftHeapLimitKb == TSqlSrvConfigParams::KConfigPrmValueNotSet || 
 	            (aConfigParams.iSoftHeapLimitKb >= TSqlSrvConfigParams::KMinSoftHeapLimitKb &&
-	             aConfigParams.iSoftHeapLimitKb <= TSqlSrvConfigParams::KMaxSoftHeapLimitKb), ESqlPanicInternalError);
-	__SQLASSERT(aConfigParams.iCompactionMode == ESqlCompactionNotSet || aConfigParams.iCompactionMode == ESqlCompactionManual || 
-				aConfigParams.iCompactionMode == ESqlCompactionBackground || aConfigParams.iCompactionMode == ESqlCompactionAuto, ESqlPanicInternalError);
-	__SQLASSERT(aConfigParams.iFreePageThresholdKb == TSqlSrvConfigParams::KConfigPrmValueNotSet || 
-			    aConfigParams.iFreePageThresholdKb >= 0, ESqlPanicInternalError);
+	             aConfigParams.iSoftHeapLimitKb <= TSqlSrvConfigParams::KMaxSoftHeapLimitKb), __SQLPANIC2(ESqlPanicInternalError));
+	__ASSERT_DEBUG(aConfigParams.iCompactionMode == ESqlCompactionNotSet || aConfigParams.iCompactionMode == ESqlCompactionManual || 
+				aConfigParams.iCompactionMode == ESqlCompactionBackground || aConfigParams.iCompactionMode == ESqlCompactionAuto, __SQLPANIC2(ESqlPanicInternalError));
+	__ASSERT_DEBUG(aConfigParams.iFreePageThresholdKb == TSqlSrvConfigParams::KConfigPrmValueNotSet || 
+			    aConfigParams.iFreePageThresholdKb >= 0, __SQLPANIC2(ESqlPanicInternalError));
 	}
 
 //The function searches aConfigStr arguments for "PARAM=VALUE;" pair. If such pair is found, then 
@@ -237,7 +261,7 @@
 	pos = prmText.Locate(KAssignment);
 	if(pos < 0 || pos >= (prmText.Length() - 1))
 		{
-		__SQLLEAVE(KErrArgument);
+		__SQLLEAVE2(KErrArgument);
 		}
 	//we've got now prmText pointing to a " PARAM = VALUE " string.
 	aParamName.Set(TSqlSrvConfig::TrimAndConstructPtr(prmText.Ptr(), pos));
@@ -289,7 +313,7 @@
 	TInt err = lex.Val(cacheSize);
 	if(err != KErrNone || cacheSize < 0) 	//The correct check is for "<=0", but it has to be backward 
 		{									//compatible with the previous implementation
-		__SQLLEAVE(KErrArgument);
+		__SQLLEAVE2(KErrArgument);
 		}
 	return cacheSize;
 	}
@@ -303,7 +327,7 @@
 	TInt err = lex.Val(pageSize);
 	if(err != KErrNone || pageSize < 0) 	//The correct check is for "<0", "power of 2", "between 512 and 32768",
 		{									//but it has to be backward compatible with the previous implementation
-		__SQLLEAVE(KErrArgument);
+		__SQLLEAVE2(KErrArgument);
 		}
 	return pageSize;
 	}
@@ -336,7 +360,7 @@
 	if(err != KErrNone || softHeapLimitKb < 0 || 
 	   (softHeapLimitKb < TSqlSrvConfigParams::KMinSoftHeapLimitKb || softHeapLimitKb > TSqlSrvConfigParams::KMaxSoftHeapLimitKb))
 		{					
-		__SQLLEAVE(KErrArgument);
+		__SQLLEAVE2(KErrArgument);
 		}
 	return softHeapLimitKb;
 	}
@@ -372,7 +396,7 @@
 	TInt err = lex.Val(freePageThreshold);
 	if(err != KErrNone || freePageThreshold < 0)
 		{					
-		__SQLLEAVE(KErrArgument);
+		__SQLLEAVE2(KErrArgument);
 		}
 	return freePageThreshold;
 	}
@@ -383,8 +407,8 @@
 //aStr content without leading and trailing whitespace characters.
 TPtrC8 TSqlSrvConfig::TrimAndConstructPtr(const TUint8* aStr, TInt aLength)
 	{
-	__SQLASSERT(aStr != NULL, ESqlPanicBadArgument);
-	__SQLASSERT(aLength >= 0, ESqlPanicBadArgument);
+	__ASSERT_DEBUG(aStr != NULL, __SQLPANIC2(ESqlPanicBadArgument));
+	__ASSERT_DEBUG(aLength >= 0, __SQLPANIC2(ESqlPanicBadArgument));
 	//Trim left
 	for(;aLength>0;--aLength,++aStr)
 		{
--- a/persistentstorage/sql/SRC/Server/SqlSrvConfig.h	Tue Jul 06 16:18:30 2010 +0300
+++ b/persistentstorage/sql/SRC/Server/SqlSrvConfig.h	Wed Aug 18 11:30:17 2010 +0300
@@ -18,7 +18,7 @@
 
 #include <e32std.h>
 #include <f32file.h> 
-#include "SqlPanic.h"
+#include "SqlAssert.h"
 #include "SqlUtil.h"
 
 //Forward declarations
@@ -55,7 +55,6 @@
 #else
 		KDefaultSoftHeapLimitKb = 8192,
 #endif	
-
 #ifdef SYSLIBS_TEST	
 		KMinSoftHeapLimitKb = 8, 
 #else
--- a/persistentstorage/sql/SRC/Server/SqlSrvDatabase.cpp	Tue Jul 06 16:18:30 2010 +0300
+++ b/persistentstorage/sql/SRC/Server/SqlSrvDatabase.cpp	Wed Aug 18 11:30:17 2010 +0300
@@ -22,6 +22,11 @@
 #include "SqlSrvUtil.h"			//Global server functions
 #include "SqlCompact.h"
 #include "SqlSrvResourceProfiler.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "SqlSrvDatabaseTraces.h"
+#endif
+#include "SqlTraceDef.h"
 
 //
 // The following macro disables the creation/loading of the settings table.
@@ -66,6 +71,7 @@
 _LIT(KAutoVacuumPragma,	"PRAGMA \"%S\".auto_vacuum=%d\x0");
 //_LIT(KPersist, "persist");
 //_LIT(KPersistentJournalPragma, "PRAGMA \"%S\".journal_mode=%S\x0");
+_LIT(KJournalSizeLimitPragma, "PRAGMA \"%S\".journal_size_limit=%d\x0");
 ////////////////////////////////////////////////////////
 //"LIKE" - user defined function name
 _LIT8(KStrLikeFuncName,  "LIKE\x0");
@@ -85,7 +91,7 @@
 //aRight argument is NULL.
 static TInt Compare(const TSqlAttachDbPair& aLeft, const TSqlAttachDbPair& aRight)
 	{
-	__SQLASSERT(aLeft.iKey != NULL && aRight.iKey != NULL, ESqlPanicInternalError);
+	__ASSERT_DEBUG(aLeft.iKey != NULL && aRight.iKey != NULL, __SQLPANIC2(ESqlPanicInternalError));
 	return ::CompareNoCase8(TPtrC8(aLeft.iKey), TPtrC8(aRight.iKey));
 	}
 
@@ -100,7 +106,7 @@
 //aRight argument is NULL.
 static TInt Compare2(const TSqlCompactDbPair& aLeft, const TSqlCompactDbPair& aRight)
 	{
-	__SQLASSERT(aLeft.iKey != NULL && aRight.iKey != NULL, ESqlPanicInternalError);
+	__ASSERT_DEBUG(aLeft.iKey != NULL && aRight.iKey != NULL, __SQLPANIC2(ESqlPanicInternalError));
 	return ::CompareNoCase(*aLeft.iKey, *aRight.iKey);
 	}
 
@@ -114,13 +120,13 @@
 		TBuf8<KMaxFileName + 1> fileNameZ;
 		if(!::UTF16ZToUTF8Z(aFileData.FileNameZ(), fileNameZ))
 			{
-			__SQLLEAVE(KErrGeneral);	
+			__SQLLEAVE2(KErrGeneral);	
 			}
-		__SQLLEAVE_IF_ERROR(::CreateDbHandle8(fileNameZ, aDbHandle));
+		__SQLLEAVE_IF_ERROR2(::CreateDbHandle8(fileNameZ, aDbHandle));
 		}
 	else
 		{
-		__SQLLEAVE_IF_ERROR(::CreateDbHandle16(aFileData.FileNameZ(), aDbHandle));
+		__SQLLEAVE_IF_ERROR2(::CreateDbHandle16(aFileData.FileNameZ(), aDbHandle));
 		}
 	}
 	
@@ -152,7 +158,7 @@
 //The function is used to read the security policy of the main database.
 static CSqlSecurityPolicy* LoadDbSecurityPolicyLC(sqlite3* aDbHandle)
 	{
-	__SQLASSERT(aDbHandle != NULL, ESqlPanicBadArgument);
+	__ASSERT_DEBUG(aDbHandle != NULL, __SQLPANIC2(ESqlPanicBadArgument));
 	//Create new database security policy object and initialize it with a default security policy
 	TSecurityPolicy defaultPolicy(TSecurityPolicy::EAlwaysFail);
 	CSqlSecurityPolicy* dbPolicy = CSqlSecurityPolicy::NewLC(defaultPolicy);
@@ -167,7 +173,7 @@
 //The function panics in _DEBUG mode if aSrc is NULL.
 static TUint8* CreateStrCopyLC(const TUint8* aSrc)
 	{
-	__SQLASSERT(aSrc != NULL, ESqlPanicBadArgument);
+	__ASSERT_DEBUG(aSrc != NULL, __SQLPANIC2(ESqlPanicBadArgument));
 	TInt len = User::StringLength(aSrc) + 1;
 	TUint8* copy = new (ELeave) TUint8[len];
 	Mem::Copy(copy, aSrc, len);
@@ -179,7 +185,7 @@
 //during the stack cleanup.
 static void EnableAuthorizer(void* aAuthorizerDisabled)
 	{
-	__SQLASSERT(aAuthorizerDisabled != NULL, ESqlPanicBadArgument);
+	__ASSERT_DEBUG(aAuthorizerDisabled != NULL, __SQLPANIC2(ESqlPanicBadArgument));
 	TBool* authorizerDisabled = static_cast <TBool*> (aAuthorizerDisabled);
 	*authorizerDisabled = EFalse;
 	}
@@ -208,7 +214,7 @@
 //CSqlSrvDatabase's ConstructL() method(s) leave (when creating a new database file).
 static void DbFileCleanup(void* aDbFileCleanup)
 	{
-	__SQLASSERT(aDbFileCleanup != NULL, ESqlPanicBadArgument);
+	__ASSERT_DEBUG(aDbFileCleanup != NULL, __SQLPANIC2(ESqlPanicBadArgument));
 	TDbFileCleanup* dbFileCleanup = static_cast <TDbFileCleanup*> (aDbFileCleanup);
 	dbFileCleanup->Cleanup();
 	}
@@ -222,16 +228,37 @@
 //During the call the authorizer will be disabled.
 static TInt ExecPragma(sqlite3* aDbHandle, TBool& aAuthorizerDisabled, const TDesC& aPragma, TInt aValue, const TDesC& aDbName = KMainDb16)
 	{
-	__SQLASSERT(aDbHandle != NULL, ESqlPanicBadArgument);
+    __SQLTRACE_INTERNALSEXPR(TPtrC pragmaprnptr(aPragma.Left(aPragma.Length() - 1)));
+	SQL_TRACE_INTERNALS(OstTraceExt4(TRACE_INTERNALS, EXECPRAGMA_ENTRY, "Entry;0;ExecPragma;sqlite3*=0x%X;aPragma=%S;aValue=%d;aDbName=%S", (TUint)aDbHandle, __SQLPRNSTR(pragmaprnptr), aValue, __SQLPRNSTR(aDbName)));
+	__ASSERT_DEBUG(aDbHandle != NULL, __SQLPANIC2(ESqlPanicBadArgument));
 	TBuf<KMaxFileName + 64> pragmaSql;//(KMaxFileName + 64) characters buffer length is enough for the longest possible PRAGMA statement
 	pragmaSql.Format(aPragma, &aDbName, aValue);
 	TBool authorizerDisabledState = aAuthorizerDisabled;
 	aAuthorizerDisabled	= ETrue;
 	TInt err = DbExecStmt16(aDbHandle, pragmaSql);
 	aAuthorizerDisabled = authorizerDisabledState;
+	SQL_TRACE_INTERNALS(OstTraceExt2(TRACE_INTERNALS, EXECPRAGMA_EXIT, "Exit;0;ExecPragma;sqlite3*=0x%X;err=%d", (TUint)aDbHandle, err));
 	return err;
 	}
 
+//The journal size limit is set to be at lest 16 pages and no less than 64 Kb.
+static void SetJournalSizeLimitL(sqlite3* aDbHandle, TBool& aAuthorizerDisabled, TInt aPageSize, const TDesC& aDbName = KMainDb16)
+	{
+	__ASSERT_DEBUG(aDbHandle != NULL, __SQLPANIC2(ESqlPanicBadArgument));
+	if(aPageSize == TSqlSrvConfigParams::KConfigPrmValueNotSet)
+		{
+		__SQLLEAVE_IF_ERROR2(DbPageSize(aDbHandle, aDbName, aPageSize));
+		}
+	const TInt KPageMultiplier = 16;
+	const TInt KDefaultJournalSizeLimit = 64 * 1024;
+	const TInt KMaxJournalSizeLimit = 512 * 1024;
+	const TInt KJournalSizeLimit = Min((aPageSize * KPageMultiplier), KMaxJournalSizeLimit);
+	if(KJournalSizeLimit > KDefaultJournalSizeLimit)
+		{
+		__SQLLEAVE_IF_ERROR2(::ExecPragma(aDbHandle, aAuthorizerDisabled, KJournalSizeLimitPragma, KJournalSizeLimit));
+		}
+	}
+
 //////////////////////////////////////////////////////////////////////////////////////////////////////
 /////////////////////////////   CSqlSrvDatabase class    /////////////////////////////////////////////
 //////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -274,15 +301,16 @@
 */
 CSqlSrvDatabase* CSqlSrvDatabase::CreateSecureL(const TSqlSrvFileData& aFileData, CSqlSecurityPolicy* aSecurityPolicy)
 	{
-	__SQLASSERT(aFileData.IsSecureFileNameFmt(), ESqlPanicBadArgument);
-	__SQLASSERT(aSecurityPolicy != NULL, ESqlPanicBadArgument);
+	SQL_TRACE_INTERNALS(OstTrace0(TRACE_INTERNALS, CSQLSRVDATABASE_CREATESECUREL_ENTRY, "Entry;0;CSqlSrvDatabase::CreateSecureL"));
+	__ASSERT_DEBUG(aFileData.IsSecureFileNameFmt(), __SQLPANIC2(ESqlPanicBadArgument));
+	__ASSERT_DEBUG(aSecurityPolicy != NULL, __SQLPANIC2(ESqlPanicBadArgument));
 	if(!::SqlServer().SecurityInspector().Check(aSecurityPolicy->DbPolicy(RSqlSecurityPolicy::ESchemaPolicy)))
 		{
 		//The caller has no "SCHEMA" policy. Then the client is not given a permission to create the database.
 		//Delete aSecurityPolicy since no database object is going to be created and the security policy object 
 		//won't be put in the security policies map.
 		delete aSecurityPolicy;
-		__SQLLEAVE(KErrPermissionDenied);
+		__SQLLEAVE2(KErrPermissionDenied);
 		}
 	//What does happen with aSecurityPolicy instance?
 	// If the database is created successfully, then a lookup will be made in the security policies map.
@@ -305,6 +333,7 @@
 	CleanupStack::PushL(self);
 	self->ConstructCreateSecureL(aFileData, aSecurityPolicy);
 	CleanupStack::Pop(self);
+	SQL_TRACE_INTERNALS(OstTraceExt2(TRACE_INTERNALS, CSQLSRVDATABASE_CREATESECUREL_EXIT, "Exit;0x%X;CSqlSrvDatabase::CreateSecureL;sqlite3*=0x%X", (TUint)self, (TUint)self->iDbHandle));
 	return self;
 	}
 
@@ -335,11 +364,13 @@
 */
 CSqlSrvDatabase* CSqlSrvDatabase::CreateL(const TSqlSrvFileData& aFileData)
 	{
-	__SQLASSERT(!aFileData.IsSecureFileNameFmt(), ESqlPanicBadArgument);
+	SQL_TRACE_INTERNALS(OstTrace0(TRACE_INTERNALS, CSQLSRVDATABASE_CREATEL_ENTRY, "Entry;0;CSqlSrvDatabase::CreateL"));
+	__ASSERT_DEBUG(!aFileData.IsSecureFileNameFmt(), __SQLPANIC2(ESqlPanicBadArgument));
 	CSqlSrvDatabase* self = new (ELeave) CSqlSrvDatabase();
 	CleanupStack::PushL(self);
 	self->ConstructCreateL(aFileData);
 	CleanupStack::Pop(self);
+	SQL_TRACE_INTERNALS(OstTraceExt2(TRACE_INTERNALS, CSQLSRVDATABASE_CREATEL_EXIT, "Exit;0x%X;CSqlSrvDatabase::CreateL;sqlite3*=0x%X", (TUint)self, (TUint)self->iDbHandle));
 	return self;
 	}
 
@@ -374,10 +405,12 @@
 */
 CSqlSrvDatabase* CSqlSrvDatabase::OpenL(const TSqlSrvFileData& aFileData)
 	{
+	SQL_TRACE_INTERNALS(OstTrace0(TRACE_INTERNALS, CSQLSRVDATABASE_OPENL_ENTRY, "Entry;0;CSqlSrvDatabase::OpenL"));
 	CSqlSrvDatabase* self = new (ELeave) CSqlSrvDatabase();
 	CleanupStack::PushL(self);
 	aFileData.IsSecureFileNameFmt() ? self->ConstructOpenSecureL(aFileData) : self->ConstructOpenL(aFileData);
 	CleanupStack::Pop(self);
+	SQL_TRACE_INTERNALS(OstTraceExt2(TRACE_INTERNALS, CSQLSRVDATABASE_OPENL_EXIT, "Exit;0x%X;CSqlSrvDatabase::OpenL;sqlite3*=0x%X", (TUint)self, (TUint)self->iDbHandle));
 	return self;
 	}
 
@@ -386,12 +419,12 @@
 */
 CSqlSrvDatabase::~CSqlSrvDatabase()
 	{
-    SQLPROFILER_DB_CLOSE((TUint)iDbHandle);
+	SQL_TRACE_INTERNALS(OstTraceExt2(TRACE_INTERNALS, CSQLSRVDATABASE_CSQLSRVDATABASE2_ENTRY, "Entry;0x%X;CSqlSrvDatabase::~CSqlSrvDatabase;sqlite3*=0x%X", (TUint)this, (TUint)iDbHandle));
 	TSqlCompactDbMapIterator compactDbIt(iCompactDbMap);
 	TSqlCompactDbPair compactDbPair;
 	while(compactDbIt.Next(compactDbPair))
 		{
-        __SQLASSERT(compactDbPair.iData, ESqlPanicInvalidObj);
+	   __ASSERT_DEBUG(compactDbPair.iData, __SQLPANIC2(ESqlPanicInvalidObj));
 		::SqlServer().Compactor().ReleaseEntry(*compactDbPair.iData);
 		}
 	iCompactDbMap.Close();
@@ -434,11 +467,12 @@
     TSqlAttachDbPair attachDbPair;
     while(it.Next(attachDbPair))
         {
-        __SQLASSERT(attachDbPair.iData, ESqlPanicInvalidObj);
-        ::SqlServer().SecurityMap().Remove(attachDbPair.iData);
+        __ASSERT_DEBUG(attachDbPair.iData, __SQLPANIC2(ESqlPanicInvalidObj));
+       ::SqlServer().SecurityMap().Remove(attachDbPair.iData);
         }
 	iAttachDbMap.Close();
 	::CloseDbHandle(iDbHandle);
+	SQL_TRACE_INTERNALS(OstTrace1(TRACE_INTERNALS, CSQLSRVDATABASE_CSQLSRVDATABASE2_EXIT, "Exit;0x%X;CSqlSrvDatabase::~CSqlSrvDatabase", (TUint)this));
 	}
 
 /**
@@ -476,6 +510,8 @@
 */
 void CSqlSrvDatabase::CreateNewDbFileL(const TSqlSrvFileData& aFileData)
 	{
+	__SQLTRACE_INTERNALSVAR(TPtrC fname = aFileData.FileName());
+	SQL_TRACE_INTERNALS(OstTraceExt2(TRACE_INTERNALS, CSQLSRVDATABASE_CREATENEWDBFILEL, "0x%x;CSqlSrvDatabase::CreateNewDbFileL;fname=%S", (TUint)this, __SQLPRNSTR(fname)));
 	if(::FileExists(aFileData.Fs(), aFileData.FileName()))
 		{
 		__SQLLEAVE(KErrAlreadyExists);	
@@ -511,6 +547,8 @@
 */
 void CSqlSrvDatabase::OpenExistingDbFileL(const TSqlSrvFileData& aFileData)
 	{
+	__SQLTRACE_INTERNALSVAR(TPtrC fname = aFileData.FileName());
+	SQL_TRACE_INTERNALS(OstTraceExt2(TRACE_INTERNALS, CSQLSRVDATABASE_OPENEXISTINGDBFILEL, "0x%x;CSqlSrvDatabase::OpenExistingDbFileL;fname=%S", (TUint)this, __SQLPRNSTR(fname)));
 	if(!aFileData.ContainHandles())
 		{//This check is valid only if the database is outside application's private data cage
 		if(!::FileExists(aFileData.Fs(), aFileData.FileName()))
@@ -635,6 +673,7 @@
 */
 void CSqlSrvDatabase::AttachDbL(const TSqlSrvFileData& aFileData, const TDesC& aDbName)
 	{
+	SQL_TRACE_INTERNALS(OstTraceExt2(TRACE_INTERNALS, CSQLSRVDATABASE_ATTACHDBL_ENTRY, "Entry;0x%X;CSqlSrvDatabase::AttachDbL;aDbName=%S", (TUint)this, __SQLPRNSTR(aDbName)));
 	if(!aFileData.ContainHandles())
 		{//This check is valid only if the database is outside application's private data cage
 		if(!::FileExists(aFileData.Fs(), aFileData.FileName()))
@@ -677,6 +716,7 @@
 			__SQLLEAVE(err);
 			}
 		}
+	SQL_TRACE_INTERNALS(OstTrace1(TRACE_INTERNALS, CSQLSRVDATABASE_ATTACHDBL_EXIT, "Exit;0x%X;CSqlSrvDatabase::AttachDbL", (TUint)this));
 	}
 
 /**
@@ -760,6 +800,7 @@
 */
 void CSqlSrvDatabase::DetachDbL(const TDesC& aDbName)
 	{
+	SQL_TRACE_INTERNALS(OstTraceExt2(TRACE_INTERNALS, CSQLSRVDATABASE_DETACHDBL_ENTRY, "Entry;0x%X;CSqlSrvDatabase::DetachDbL;aDbName=%S", (TUint)this, __SQLPRNSTR(aDbName)));
 	TInt err = FinalizeAttachedDb(aDbName);
 	if(err == KErrNone)
 		{
@@ -769,6 +810,7 @@
 		{
 		__SQLLEAVE(err);
 		}
+	SQL_TRACE_INTERNALS(OstTrace1(TRACE_INTERNALS, CSQLSRVDATABASE_DETACHDBL_EXIT, "Exit;0x%X;CSqlSrvDatabase::DetachDbL", (TUint)this));
 	}
 
 /**
@@ -787,7 +829,7 @@
 	CleanupStack::PushL(TCleanupItem(&EnableAuthorizer, &iAuthorizerDisabled));
 	TInt pageCount = 0;
 	__SQLLEAVE_IF_ERROR(::DbPageCount(iDbHandle, aDbName, pageCount));
-	__SQLASSERT(pageCount >= 0, ESqlPanicInternalError);
+	__ASSERT_DEBUG(pageCount >= 0, __SQLPANIC(ESqlPanicInternalError));
 	CleanupStack::PopAndDestroy();
 	return (TInt64)pageCount * PageSizeL(aDbName);
 	}
@@ -809,7 +851,7 @@
 	TInt freePageCount = 0;
 	__SQLLEAVE_IF_ERROR(::DbFreePageCount(iDbHandle, aDbName, freePageCount));
 	CleanupStack::PopAndDestroy();
-	__SQLASSERT(freePageCount >= 0, ESqlPanicInternalError);
+	__ASSERT_DEBUG(freePageCount >= 0, __SQLPANIC(ESqlPanicInternalError));
 	return (TInt64)freePageCount * PageSizeL(aDbName);
 	}
 
@@ -873,7 +915,8 @@
 */
 TInt CSqlSrvDatabase::CompactL(TInt aSize, const TDesC& aDbName)
 	{
-	__SQLASSERT(aSize > 0 || aSize == RSqlDatabase::EMaxCompaction, ESqlPanicBadArgument);
+	SQL_TRACE_INTERNALS(OstTraceExt3(TRACE_INTERNALS, CSQLSRVDATABASE_COMPACTL_ENTRY, "Entry;0x%X;CSqlSrvDatabase::CompactL;aSize=%d;aDbName=%S", (TUint)this, aSize, __SQLPRNSTR(aDbName)));
+	__ASSERT_DEBUG(aSize > 0 || aSize == RSqlDatabase::EMaxCompaction, __SQLPANIC(ESqlPanicBadArgument));
 	TInt pageSize = PageSizeL(aDbName);//PageSizeL() will disable/enable the authorizer
 	TInt pageCount = KMaxTInt;
 	if(aSize > 0)
@@ -887,6 +930,7 @@
 		__SQLLEAVE_IF_ERROR(::DbCompact(iDbHandle, aDbName, pageCount, pageCount));
 		CleanupStack::PopAndDestroy();
 		}
+	SQL_TRACE_INTERNALS(OstTraceExt3(TRACE_INTERNALS, CSQLSRVDATABASE_COMPACTL_EXIT, "Exit;0x%X;CSqlSrvDatabase::CompactL;pageCount=%d;pageSize=%d", (TUint)this, pageCount, pageSize));
 	return pageCount * pageSize;
 	}
 
@@ -924,7 +968,7 @@
 void CSqlSrvDatabase::AttachCleanup(void* aCleanup)
 	{
 	TAttachCleanup* cleanup = reinterpret_cast <TAttachCleanup*> (aCleanup);
-	__SQLASSERT(cleanup != NULL, ESqlPanicBadArgument);
+	__ASSERT_DEBUG(cleanup != NULL, __SQLPANIC2(ESqlPanicBadArgument));
 	(void)cleanup->iSelf.FinalizeAttachedDb(cleanup->iDbName);
 	}
 
@@ -1059,17 +1103,17 @@
 		{
 		//No, it is not in the map. Read the security policies from the security policies tables and 
 		//insert a new item in the map.
-		__SQLASSERT(aMapKey != NULL, ESqlPanicInternalError);
+		__ASSERT_DEBUG(aMapKey != NULL, __SQLPANIC(ESqlPanicInternalError));
 		aMapKey = ::CreateStrCopyLC(aMapKey);
 		CSqlSecurityPolicy* securityPolicy = aAttachedDb ? ::LoadAttachedDbSecurityPolicyLC(aFileData) :
 		                                                   ::LoadDbSecurityPolicyLC(iDbHandle);
-        __SQLASSERT(!::SqlServer().SecurityMap().Entry(aMapKey), ESqlPanicObjExists);
+	    __ASSERT_DEBUG(!::SqlServer().SecurityMap().Entry(aMapKey), __SQLPANIC2(ESqlPanicObjExists));
 		__SQLLEAVE_IF_ERROR(::SqlServer().SecurityMap().Insert(aMapKey, securityPolicy));
 		CleanupStack::Pop(2);//iSecurityMap owns aMapKey and securityPolicy objects
 		aSecurityPolicy = securityPolicy;
 		}
-	__SQLASSERT(aMapKey != NULL, ESqlPanicInternalError);
-	__SQLASSERT(aSecurityPolicy != NULL, ESqlPanicInternalError);
+	__ASSERT_DEBUG(aMapKey != NULL, __SQLPANIC(ESqlPanicInternalError));
+	__ASSERT_DEBUG(aSecurityPolicy != NULL, __SQLPANIC(ESqlPanicInternalError));
 	}
 
 /**
@@ -1098,6 +1142,7 @@
 */
 void CSqlSrvDatabase::RemoveFromMapsL(const TDesC& aDbName)
 	{
+	SQL_TRACE_INTERNALS(OstTraceExt2(TRACE_INTERNALS, CSQLSRVDATABASE_REMOVEFROMMAPSL, "0x%X;CSqlSrvDatabase::RemoveFromMapsL;aDbName=%S", (TUint)this, __SQLPRNSTR(aDbName)));
 	TPtr8 ptr(iFileNameBuf, sizeof(iFileNameBuf));
 	if(!::UTF16ToUTF8Z(aDbName, ptr))
 		{
@@ -1128,6 +1173,7 @@
 */
 void CSqlSrvDatabase::InsertInAttachDbMapL(const TDesC& aDbFileName, const TDesC& aDbName)
 	{
+	SQL_TRACE_INTERNALS(OstTraceExt3(TRACE_INTERNALS, CSQLSRVDATABASE_INSERTINATTACHDBMAPL, "0x%X;CSqlSrvDatabase::InsertInAttachDbMapL;aDbFileName=%S;aDbName=%S", (TUint)this, __SQLPRNSTR(aDbFileName), __SQLPRNSTR(aDbName)));
 	//Convert aDbName to UTF8, zero-terminated name
 	TPtr8 ptr(iFileNameBuf, sizeof(iFileNameBuf));
 	if(!::UTF16ToUTF8Z(aDbName, ptr))
@@ -1137,7 +1183,7 @@
 	const TUint8* mapKey = ::CreateStrCopyLC(iFileNameBuf);
 	const TUint8* mapData = SecurityMapKeyL(aDbFileName);
 	mapData = ::CreateStrCopyLC(mapData);
-    __SQLASSERT(!iAttachDbMap.Entry(mapKey), ESqlPanicObjExists);
+	__ASSERT_DEBUG(!iAttachDbMap.Entry(mapKey), __SQLPANIC(ESqlPanicObjExists));
 	__SQLLEAVE_IF_ERROR(iAttachDbMap.Insert(mapKey, mapData));
 	CleanupStack::Pop(2);//iAttachDbMap owns mapKey amd mapData.
 	}
@@ -1159,7 +1205,7 @@
 */
 void CSqlSrvDatabase::ProcessSettingsL(const TSqlSrvFileData& aFileData, const TDesC& aDbName)
 	{
-	__SQLASSERT(!aFileData.IsReadOnly(), ESqlPanicInternalError);
+	__ASSERT_DEBUG(!aFileData.IsReadOnly(), __SQLPANIC(ESqlPanicInternalError));
 #if !defined(__SQL_DISABLE_SYMBIAN_SETTINGS_TABLE__)
 	//Make the journal file persistent - done by SQLite automatically because the locking mode is EXCLUSIVE
 	//__SQLLEAVE_IF_ERROR(::ExecPragma(iDbHandle, iAuthorizerDisabled, KPersistentJournalPragma, KPersist, aDbName));
@@ -1172,7 +1218,7 @@
 	TSqlCompactionMode compactionMode = currVacuumMode == ESqliteVacuumOff ? ESqlCompactionManual : ESqlCompactionNotSet;
 	TSqlDbSysSettings dbSettings(iDbHandle);
 	dbSettings.LoadSettingsL(aDbName, storedCollationDllName, storedDbConfigFileVer, compactionMode);
-	__SQLASSERT(currVacuumMode == ESqliteVacuumOff ? compactionMode == ESqlCompactionManual : 1, ESqlPanicInternalError);
+	__ASSERT_DEBUG(currVacuumMode == ESqliteVacuumOff ? compactionMode == ESqlCompactionManual : 1, __SQLPANIC(ESqlPanicInternalError));
 	if(aFileData.ContainHandles() && aFileData.IsCreated())
 		{
 		compactionMode = aFileData.ConfigParams().iCompactionMode;
@@ -1216,6 +1262,7 @@
 	//Check whether reindexing is necessary
 	if(::SqlServer().CollationDllName().CompareF(aStoredCollationDllName) != 0)
 		{
+		SQL_TRACE_INTERNALS(OstTraceExt3(TRACE_INTERNALS, CSQLSRVDATABASE_APPLYCONFIGUPDATES2L, "0x%X;CSqlSrvDatabase::ApplyConfigUpdatesL;Reindex db;aStoredCollationDllName=%S;aDbName=%S", (TUint)this, __SQLPRNSTR(aStoredCollationDllName), __SQLPRNSTR(aDbName)));
 		dbSettings.ReindexDatabaseL(aDbName, ::SqlServer().CollationDllName());
 		}
 
@@ -1226,7 +1273,7 @@
 	TRAPD(err, dbSettings.ConfigureDatabaseL(aStoredDbConfigFileVersion, aFileData, aDbName));
 	if(KErrNone != err)
 		{
-		__SQLLOG_ERR(_L("SQLLOG: CSqlSrvDatabase::ApplyConfigUpdatesL() - ConfigureDatabaseL() failed with error code %d"), err);	
+		SQL_TRACE_INTERNALS(OstTraceExt2(TRACE_INTERNALS, CSQLSRVDATABASE_APPLYCONFIGUPDATESL, "0x%X;CSqlSrvDatabase::ApplyConfigUpdatesL;ConfigureDatabaseL() failed with error code %d", (TUint)this, err));	
 		}
 	}
 
@@ -1243,8 +1290,8 @@
 */
 void CSqlSrvDatabase::SetConfigL(const TSqlSrvConfigParams& aConfigParams, TBool aSetPageSize, const TDesC& aLogicalDbName)
 	{
-	__SQLASSERT(aConfigParams.iPageSize == TSqlSrvConfigParams::KConfigPrmValueNotSet || aConfigParams.iPageSize >= 0, ESqlPanicBadArgument);
-	__SQLASSERT(aConfigParams.iCacheSize == TSqlSrvConfigParams::KConfigPrmValueNotSet || aConfigParams.iCacheSize >= 0, ESqlPanicBadArgument);
+	__ASSERT_DEBUG(aConfigParams.iPageSize == TSqlSrvConfigParams::KConfigPrmValueNotSet || aConfigParams.iPageSize >= 0, __SQLPANIC(ESqlPanicBadArgument));
+	__ASSERT_DEBUG(aConfigParams.iCacheSize == TSqlSrvConfigParams::KConfigPrmValueNotSet || aConfigParams.iCacheSize >= 0, __SQLPANIC(ESqlPanicBadArgument));
 	if(aSetPageSize && aConfigParams.iPageSize != TSqlSrvConfigParams::KConfigPrmValueNotSet)
 		{
 		__SQLLEAVE_IF_ERROR(::ExecPragma(iDbHandle, iAuthorizerDisabled, KPageSizePragma, aConfigParams.iPageSize));
@@ -1252,6 +1299,8 @@
 	
 	const TDesC& logicalDbName = aLogicalDbName.Length() > 0 ? aLogicalDbName : KMainDb16;
 	
+	::SetJournalSizeLimitL(iDbHandle, iAuthorizerDisabled, aConfigParams.iPageSize, logicalDbName);
+
 	//Setting the cache size.
 	//Step 1: Check if aConfigParams.iCacheSize value is set. If it is set, then use it.
 	if(aConfigParams.iCacheSize != TSqlSrvConfigParams::KConfigPrmValueNotSet)
@@ -1263,8 +1312,8 @@
 	//Step 2: aConfigParams.iCacheSize value is not set. Then check if aConfigParams.iSoftHeapLimitKb value is set.
 		if(aConfigParams.iSoftHeapLimitKb != TSqlSrvConfigParams::KConfigPrmValueNotSet)
 			{
-			__SQLASSERT(aConfigParams.iSoftHeapLimitKb >= TSqlSrvConfigParams::KMinSoftHeapLimitKb && 
-			            aConfigParams.iSoftHeapLimitKb <= TSqlSrvConfigParams::KMaxSoftHeapLimitKb, ESqlPanicInternalError);
+			__ASSERT_DEBUG(aConfigParams.iSoftHeapLimitKb >= TSqlSrvConfigParams::KMinSoftHeapLimitKb && 
+			            aConfigParams.iSoftHeapLimitKb <= TSqlSrvConfigParams::KMaxSoftHeapLimitKb, __SQLPANIC(ESqlPanicInternalError));
 	//Step 3: aConfigParams.iSoftHeapLimitKb value is set. Then use it to calculate the cache size. But we need the page size first.
     //        aLogicalDbName is used instead of logicalDbName because PageSizeL() if called with non-zero length name, 
 	//        "thinks" it is the main database name. KMainDb16 will be interpreted as an attached database name. 
@@ -1305,10 +1354,10 @@
 void CSqlSrvDatabase::InitCompactionL(TSqlCompactionMode aCompactionMode, TInt aFreePageThresholdKb, 
 									  const TDesC& aDbFileName, TSqliteVacuumMode aCurrentVacuumMode, const TDesC& aDbName)
 	{
-	__SQLASSERT(aCompactionMode == ESqlCompactionManual || aCompactionMode == ESqlCompactionBackground || aCompactionMode == ESqlCompactionAuto, ESqlPanicBadArgument);
-	__SQLASSERT(aCurrentVacuumMode == ESqliteVacuumOff || aCurrentVacuumMode == ESqliteVacuumAuto || 
-			    aCurrentVacuumMode == ESqliteVacuumIncremental, ESqlPanicBadArgument);
-	__SQLASSERT(aFreePageThresholdKb >= 0, ESqlPanicBadArgument);
+	__ASSERT_DEBUG(aCompactionMode == ESqlCompactionManual || aCompactionMode == ESqlCompactionBackground || aCompactionMode == ESqlCompactionAuto, __SQLPANIC(ESqlPanicBadArgument));
+	__ASSERT_DEBUG(aCurrentVacuumMode == ESqliteVacuumOff || aCurrentVacuumMode == ESqliteVacuumAuto || 
+			    aCurrentVacuumMode == ESqliteVacuumIncremental, __SQLPANIC(ESqlPanicBadArgument));
+	__ASSERT_DEBUG(aFreePageThresholdKb >= 0, __SQLPANIC(ESqlPanicBadArgument));
 	TSqliteVacuumMode newSqliteVacuumMode = aCompactionMode == ESqlCompactionAuto ? ESqliteVacuumAuto : ESqliteVacuumIncremental;
 	if(aCurrentVacuumMode == ESqliteVacuumOff)
 		{
@@ -1341,6 +1390,7 @@
 */
 void CSqlSrvDatabase::NewCompactEntryL(TInt aFreePageThresholdKb, const TDesC& aDbFileName, const TDesC& aDbName)
 	{
+	SQL_TRACE_INTERNALS(OstTraceExt4(TRACE_INTERNALS, CSQLSRVDATABASE_NEWCOMPACTENTRYL_ENTRY, "Entry;0x%X;CSqlSrvDatabase::NewCompactEntryL;aFreePageThresholdKb=%d;aDbFileName=%S;aDbName=%S", (TUint)this, aFreePageThresholdKb, __SQLPRNSTR(aDbFileName), __SQLPRNSTR(aDbName)));	
 	TSqlCompactSettings settings;
 	settings.iFreePageThresholdKb = aFreePageThresholdKb;
 	::SqlServer().Compactor().AddEntryL(aDbFileName, settings);
@@ -1349,7 +1399,7 @@
 	HBufC* data = aDbFileName.Alloc();
 	if(key && data)
 		{
-	    __SQLASSERT(!iCompactDbMap.Entry(key), ESqlPanicObjExists);
+	    __ASSERT_DEBUG(!iCompactDbMap.Entry(key), __SQLPANIC(ESqlPanicObjExists));
 		err = iCompactDbMap.Insert(key, data);//returns the index of the new entry
 		}
 	if(err < 0) //If either "key" or "data" or both is NULL, then "err" is KErrNoMemory and the next "if" will be executed.
@@ -1358,6 +1408,7 @@
 		delete key;
 		::SqlServer().Compactor().ReleaseEntry(aDbFileName);
 		}
+	SQL_TRACE_INTERNALS(OstTraceExt2(TRACE_INTERNALS, CSQLSRVDATABASE_NEWCOMPACTENTRYL_EXIT, "Exit;0x%X;CSqlSrvDatabase::NewCompactEntryL;err=%d", (TUint)this, err));	
 	__SQLLEAVE_IF_ERROR(err);
 	}
 
@@ -1379,6 +1430,7 @@
 			{
 			::SqlServer().Compactor().ReleaseEntry(*compactDbPair.iData);
 			iCompactDbMap.Remove(compactDbPair.iKey);
+			SQL_TRACE_INTERNALS(OstTrace1(TRACE_INTERNALS, CSQLSRVDATABASE_RELEASECOMPACTENTRY, "0x%X;CSqlSrvDatabase::ReleaseCompactEntry", (TUint)this));	
 			break;
 			}
 		}
@@ -1398,7 +1450,7 @@
 void CSqlSrvDatabase::CompactCleanup(void* aCleanup)
 	{
 	CSqlSrvDatabase* self = reinterpret_cast <CSqlSrvDatabase*> (aCleanup);
-	__SQLASSERT(self != NULL, ESqlPanicBadArgument);
+	__ASSERT_DEBUG(self != NULL, __SQLPANIC2(ESqlPanicBadArgument));
     self->ReleaseCompactEntry(KMainDb16);
 	}
 
@@ -1426,7 +1478,7 @@
 	TInt pageSize = 0;
 	__SQLLEAVE_IF_ERROR(::DbPageSize(iDbHandle, aDbName, pageSize));
 	CleanupStack::PopAndDestroy();
-	__SQLASSERT(pageSize > 0, ESqlPanicInternalError);
+	__ASSERT_DEBUG(pageSize > 0, __SQLPANIC(ESqlPanicInternalError));
 	if(aDbName == KNullDesC)
 		{
 		iPageSize = pageSize;	
@@ -1454,13 +1506,13 @@
 */
 void CSqlSrvDatabase::ConstructCreateSecureL(const TSqlSrvFileData& aFileData, CSqlSecurityPolicy* aSecurityPolicy)
 	{
-	__SQLASSERT(aSecurityPolicy != NULL, ESqlPanicBadArgument);
+	__ASSERT_DEBUG(aSecurityPolicy != NULL, __SQLPANIC(ESqlPanicBadArgument));
 	//Insert a new item in the security policies map.
 	CleanupStack::PushL(aSecurityPolicy);
 	const TUint8* mapKey = SecurityMapKeyL(aFileData.FileName());
 	mapKey = ::CreateStrCopyLC(mapKey);
-    __SQLASSERT(!::SqlServer().SecurityMap().Entry(mapKey), ESqlPanicObjExists);
-	__SQLLEAVE_IF_ERROR(::SqlServer().SecurityMap().Insert(mapKey, aSecurityPolicy));
+	__ASSERT_DEBUG(!::SqlServer().SecurityMap().Entry(mapKey), __SQLPANIC(ESqlPanicObjExists));
+ 	__SQLLEAVE_IF_ERROR(::SqlServer().SecurityMap().Insert(mapKey, aSecurityPolicy));
 	CleanupStack::Pop(2);//iSecurityMap owns mapKey and aSecurityPolicy.
 	iSecureDbName = mapKey;
 	iSecurityPolicy = aSecurityPolicy;
@@ -1497,8 +1549,8 @@
 //If the method fails and the error is not KErrAlreadyExists, the database file will be closed and deleted.
 void CSqlSrvDatabase::DoCommonConstructCreateL(const TSqlSrvFileData& aFileData, TBool aSecureDb)
 	{
-	__SQLASSERT(!iDbHandle, ESqlPanicInternalError);
-	__SQLASSERT(aSecureDb ? iSecurityPolicy != NULL : ETrue, ESqlPanicInternalError);
+	__ASSERT_DEBUG(!iDbHandle, __SQLPANIC(ESqlPanicInternalError));
+	__ASSERT_DEBUG(aSecureDb ? iSecurityPolicy != NULL : ETrue, __SQLPANIC(ESqlPanicInternalError));
 	CreateNewDbFileL(aFileData);
 	TDbFileCleanup dbFileCleanup(aFileData, iDbHandle);
 	CleanupStack::PushL(TCleanupItem(&DbFileCleanup, &dbFileCleanup));
--- a/persistentstorage/sql/SRC/Server/SqlSrvDatabase.inl	Tue Jul 06 16:18:30 2010 +0300
+++ b/persistentstorage/sql/SRC/Server/SqlSrvDatabase.inl	Wed Aug 18 11:30:17 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -144,7 +144,7 @@
 */
 inline sqlite3* CSqlSrvDatabase::RawDbHandle() const
 	{
-	__SQLASSERT(iDbHandle != NULL, ESqlPanicInternalError);
+	__ASSERT_DEBUG(iDbHandle != NULL, __SQLPANIC(ESqlPanicInternalError));
 	return iDbHandle;	
 	}
 
@@ -224,7 +224,7 @@
 */
 inline void CSqlSrvDatabase::StoreSettingsL(const TDesC& aCollationDllName, TInt aDbConfigFileVersion, TSqlCompactionMode aCompactionMode)
 	{
-	__SQLASSERT(aCompactionMode == ESqlCompactionManual || aCompactionMode == ESqlCompactionBackground || aCompactionMode == ESqlCompactionAuto, ESqlPanicBadArgument);
+	__ASSERT_DEBUG(aCompactionMode == ESqlCompactionManual || aCompactionMode == ESqlCompactionBackground || aCompactionMode == ESqlCompactionAuto, __SQLPANIC(ESqlPanicBadArgument));
 #if !defined(__SQL_DISABLE_SYMBIAN_SETTINGS_TABLE__)		
 	TSqlDbSysSettings dbSettings(iDbHandle);
 	dbSettings.StoreSettingsL(KMainDb16, aCollationDllName, aDbConfigFileVersion, aCompactionMode);
--- a/persistentstorage/sql/SRC/Server/SqlSrvDbSysSettings.cpp	Tue Jul 06 16:18:30 2010 +0300
+++ b/persistentstorage/sql/SRC/Server/SqlSrvDbSysSettings.cpp	Wed Aug 18 11:30:17 2010 +0300
@@ -29,6 +29,11 @@
 #include "SqlSrvStrings.h"		//System table names
 #include "SqlSrvUtil.h"			//Global functions
 #include "SqlSrvFileData.h"		//TSqlSrvFileData
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "SqlSrvDbSysSettingsTraces.h"
+#endif
+#include "SqlTraceDef.h"
 
 extern TBool IsStatementSupported(const TDesC& aStatementIn, const TDesC& aDbName, TDes& aStatementOut);
 
@@ -105,7 +110,7 @@
 //Panic SqlDb 4 In _DEBUG mode if aHandle argument is NULL.
 static void FinalizeStatementHandle(void* aHandle)
 	{
-	__SQLASSERT(aHandle != NULL, ESqlPanicBadArgument);
+	__ASSERT_DEBUG(aHandle != NULL, __SQLPANIC2(ESqlPanicBadArgument));
 	sqlite3_stmt* stmtHandle = static_cast <sqlite3_stmt*> (aHandle);
 	(void)sqlite3_finalize(stmtHandle);
 	}
@@ -114,7 +119,7 @@
 //Panic SqlDb 4 In _DEBUG mode if aDbHandle argument is NULL.
 static void RollbackTransaction(void* aDbHandle)
 	{
-	__SQLASSERT(aDbHandle != NULL, ESqlPanicBadArgument);
+	__ASSERT_DEBUG(aDbHandle != NULL, __SQLPANIC2(ESqlPanicBadArgument));
 	(void)::DbExecStmt8(reinterpret_cast <sqlite3*> (aDbHandle), KRollbackTransactionSql);
 	}
 
@@ -132,7 +137,7 @@
 TSqlDbSysSettings::TSqlDbSysSettings(sqlite3* aDbHandle) :
 	iDbHandle(aDbHandle)
 	{
-	__SQLASSERT(iDbHandle != NULL, ESqlPanicBadArgument);
+	__ASSERT_DEBUG(iDbHandle != NULL, __SQLPANIC(ESqlPanicBadArgument));
 	}
 
 /**
@@ -147,7 +152,7 @@
 */
 void TSqlDbSysSettings::StoreSecurityPolicyL(const CSqlSecurityPolicy& aSecurityPolicyCon)
 	{
-	__SQLASSERT(iDbHandle != NULL, ESqlPanicInvalidObj);
+	__ASSERT_DEBUG(iDbHandle != NULL, __SQLPANIC(ESqlPanicInvalidObj));
 	__SQLLEAVE_IF_ERROR(::DbExecStmt8(iDbHandle, KBeginTransactionSql()));
 	CleanupStack::PushL(TCleanupItem(&RollbackTransaction, iDbHandle));
 	__SQLLEAVE_IF_ERROR(::DbExecStmt8(iDbHandle, KCreateSecuritySql()));
@@ -176,8 +181,8 @@
 */
 void TSqlDbSysSettings::StoreSettingsL(const TDesC& aDbName, const TDesC& aCollationDllName, TInt aDbConfigFileVersion, TSqlCompactionMode aCompactionMode)
 	{
-	__SQLASSERT(aCompactionMode == ESqlCompactionManual || aCompactionMode == ESqlCompactionBackground || aCompactionMode == ESqlCompactionAuto, ESqlPanicBadArgument);
-	__SQLASSERT(iDbHandle != NULL, ESqlPanicInvalidObj);
+	__ASSERT_DEBUG(aCompactionMode == ESqlCompactionManual || aCompactionMode == ESqlCompactionBackground || aCompactionMode == ESqlCompactionAuto, __SQLPANIC(ESqlPanicBadArgument));
+	__ASSERT_DEBUG(iDbHandle != NULL, __SQLPANIC(ESqlPanicInvalidObj));
 	HBufC* buf = HBufC::NewLC(Max((TInt)sizeof(KDropSettingsSql), 
 							  Max((TInt)sizeof(KCreateSettingsSql), (TInt)sizeof(KInsertSettingsSql))) + 
 							  aDbName.Length() + aCollationDllName.Length() + 10);
@@ -216,7 +221,7 @@
 */
 void TSqlDbSysSettings::LoadSecurityPolicyL(CSqlSecurityPolicy& aSecurityPolicyCon)
 	{
-	__SQLASSERT(iDbHandle != NULL, ESqlPanicInvalidObj);
+	__ASSERT_DEBUG(iDbHandle != NULL, __SQLPANIC(ESqlPanicInvalidObj));
 	//Even if the version of the system settings is bigger than the current one (KSqlSystemVersion constant),
 	//I think that all future modifications of the system tables shall not affect the already existing
 	//fields. So it is correct to think that all information available in version 1 should be available 
@@ -289,7 +294,7 @@
 */	
 void TSqlDbSysSettings::LoadSettingsL(const TDesC& aDbName, TDes& aCollationDllName, TInt& aDbConfigFileVersion, TSqlCompactionMode& aCompactionMode)
 	{
-	__SQLASSERT(iDbHandle != NULL, ESqlPanicInvalidObj);
+	__ASSERT_DEBUG(iDbHandle != NULL, __SQLPANIC(ESqlPanicInvalidObj));
 
 	aCollationDllName.Zero();
 	aDbConfigFileVersion = KSqlNullDbConfigFileVersion;	
@@ -319,7 +324,7 @@
 			StoreSettingsL(aDbName, aCollationDllName, aDbConfigFileVersion, aCompactionMode); // store empty collation dll name, then reindexing will occur
 			}
 		}
-	__SQLASSERT(aCompactionMode == ESqlCompactionManual || aCompactionMode == ESqlCompactionBackground || aCompactionMode == ESqlCompactionAuto, ESqlPanicInternalError);
+	__ASSERT_DEBUG(aCompactionMode == ESqlCompactionManual || aCompactionMode == ESqlCompactionBackground || aCompactionMode == ESqlCompactionAuto, __SQLPANIC(ESqlPanicInternalError));
 	}
 	
 /**
@@ -345,7 +350,7 @@
 void TSqlDbSysSettings::GetSettingsL(const TDesC& aDbName, TDes& aCollationDllName, TInt& aDbConfigFileVersion, 
 									 TInt& aSettingsVersion, TSqlCompactionMode& aCompactionMode)
 	{
-	__SQLASSERT(iDbHandle != NULL, ESqlPanicInvalidObj);
+	__ASSERT_DEBUG(iDbHandle != NULL, __SQLPANIC(ESqlPanicInvalidObj));
 
 	HBufC* buf = HBufC::NewLC(sizeof(KGetSettingsSql) + aDbName.Length());
 	TPtr sql = buf->Des();
@@ -389,7 +394,7 @@
 		const void* ptr = sqlite3_column_text16(stmtHandle, KCollationDllNameColIdx);
         //Null column value - this might be an indication of an "out of memory" problem, if the column text  
         //is in UTF8 format. (sqlite3_column_text16() may allocate memory for UTF8->UTF16 conversion)
-		__SQLLEAVE_IF_NULL(ptr);
+		__SQLLEAVE_IF_NULL(const_cast<void*>(ptr));
         TPtrC16 src(reinterpret_cast <const TUint16*> (ptr));
         if(src.Length() > aCollationDllName.MaxLength())
             {
@@ -423,7 +428,7 @@
 */
 void TSqlDbSysSettings::ReindexDatabaseL(const TDesC& aDbName, const TDesC& aCurrentCollationDllName)
 	{	
-	__SQLASSERT(iDbHandle != NULL, ESqlPanicInvalidObj);
+	__ASSERT_DEBUG(iDbHandle != NULL, __SQLPANIC(ESqlPanicInvalidObj));
 
 	//Allocate memory for the SQL statements
 	HBufC* buf = HBufC::NewLC(Max((TInt)sizeof(KUpdateCollationSettingsSql), (TInt)sizeof(KReindexSql)) + 
@@ -475,12 +480,15 @@
 void TSqlDbSysSettings::ConfigureDatabaseL(TInt aStoredDbConfigFileVersion, const TSqlSrvFileData& aFileData, 
 										   const TDesC& aDbName)
 	{	
-	__SQLASSERT(iDbHandle != NULL, ESqlPanicInvalidObj);
+	SQL_TRACE_INTERNALS(OstTrace1(TRACE_INTERNALS, TSQLDBSYSSETTINGS_CONFIGUREDATABASEL_ENTRY, "Entry;0x%X;TSqlDbSysSettings::ConfigureDatabaseL", (TUint)this));    
+	
+	__ASSERT_DEBUG(iDbHandle != NULL, __SQLPANIC(ESqlPanicInvalidObj));
 
 	if(!aFileData.IsSecureFileNameFmt())
 		{
 		//As a first implementation, config files will only be supported for 
 		//shared, secure databases - not for private, secure databases or public databases
+		SQL_TRACE_INTERNALS(OstTrace1(TRACE_INTERNALS, TSQLDBSYSSETTINGS_CONFIGUREDATABASEL_EXIT1, "Exit;0x%X;TSqlDbSysSettings::ConfigureDatabaseL;Not a secure db", (TUint)this));    
 		return;	
 		}
 		
@@ -514,13 +522,13 @@
 					if(fileVersion > aStoredDbConfigFileVersion)
 						{
 						//The latest version of the configuration file has not yet been processed, so do it now
-						__SQLLOG_STRING(_L("SQLLOG: TSqlDbSysSettings::ConfigureDatabaseL() - Processing config file %S"), configFileName);	
+						SQL_TRACE_INTERNALS(OstTraceExt2(TRACE_INTERNALS, TSQLDBSYSSETTINGS_CONFIGUREDATABASEL1, "0x%X;TSqlDbSysSettings::ConfigureDatabaseL;Config file '%S'", (TUint)this, __SQLPRNSTR(configFileName)));	
 						ExecuteConfigurationUpdateL(aFileData, configFileName, fileVersion, aDbName);
-						__SQLLOG_STRING(_L("SQLLOG: TSqlDbSysSettings::ConfigureDatabaseL() - SUCCESS! Config file %S was processed"), configFileName);	
+						SQL_TRACE_INTERNALS(OstTraceExt2(TRACE_INTERNALS, TSQLDBSYSSETTINGS_CONFIGUREDATABASEL2, "0x%X;TSqlDbSysSettings::ConfigureDatabaseL;Config file '%S' was processed, no errors", (TUint)this, __SQLPRNSTR(configFileName)));	
 						}
 					else
 						{
-						__SQLLOG_STRING(_L("SQLLOG: TSqlDbSysSettings::ConfigureDatabaseL() - Not processing config file %S as this or a later version has already been processed"), configFileName);	
+						SQL_TRACE_INTERNALS(OstTraceExt2(TRACE_INTERNALS, TSQLDBSYSSETTINGS_CONFIGUREDATABASEL3, "0x%X;TSqlDbSysSettings::ConfigureDatabaseL;Config file '%S' as this or a later version has already been processed", (TUint)this, __SQLPRNSTR(configFileName)));	
 						}
 					}
 				else
@@ -537,9 +545,10 @@
 			}
 		else
 			{
-			__SQLLOG_STRING(_L("SQLLOG: TSqlDbSysSettings::ConfigureDatabaseL() - No config file found for database %S"), dbFileNameAndExt);	
+			SQL_TRACE_INTERNALS(OstTraceExt2(TRACE_INTERNALS, TSQLDBSYSSETTINGS_CONFIGUREDATABASEL4, "0x%X;TSqlDbSysSettings::ConfigureDatabaseL;No config file found for database '%S'", (TUint)this, __SQLPRNSTR(dbFileNameAndExt)));	
 			}
 		}		
+	SQL_TRACE_INTERNALS(OstTrace1(TRACE_INTERNALS, TSQLDBSYSSETTINGS_CONFIGUREDATABASEL_EXIT2, "Exit;0x%X;TSqlDbSysSettings::ConfigureDatabaseL", (TUint)this));    
 	}
 	
 /**
@@ -565,7 +574,7 @@
 													TInt aDbConfigFileVersion,
 													const TDesC& aDbName)
 	{
-	__SQLASSERT(iDbHandle != NULL, ESqlPanicInvalidObj);
+	__ASSERT_DEBUG(iDbHandle != NULL, __SQLPANIC(ESqlPanicInvalidObj));
 														
 	//Execute the specified database config file operations that are supported
 #ifdef SYSLIBS_TEST
@@ -609,7 +618,7 @@
 */
 void TSqlDbSysSettings::DoExecuteDbConfigFileOpsL(RFs& aFs, const TDesC& aConfigFilePath, const TDesC& aDbName)
 	{
-	__SQLASSERT(iDbHandle != NULL, ESqlPanicInvalidObj);
+	__ASSERT_DEBUG(iDbHandle != NULL, __SQLPANIC(ESqlPanicInvalidObj));
 	
 	//Open the config file and read it into a buffer
 	RFile64 file;
@@ -620,7 +629,7 @@
 	if(size == 0)
 		{
 		//Config file is empty so just return
-		__SQLLOG_STRING(_L("SQLLOG: TSqlDbSysSettings::DoExecuteDbConfigFileOpsL() - Config file %S is empty"), aConfigFilePath);	
+		SQL_TRACE_INTERNALS(OstTraceExt1(TRACE_INTERNALS, TSQLDBSYSSETTINGS_DOEXECUTEDBCONFIGFILEOPSL, "0;TSqlDbSysSettings::DoExecuteDbConfigFileOpsL();Config file %S is empty", __SQLPRNSTR(aConfigFilePath)));	
 		CleanupStack::PopAndDestroy(); // file
 		return;
 		}
@@ -691,12 +700,12 @@
 */
 void TSqlDbSysSettings::ProcessStatementL(const TDesC& aStmt, const TDesC& aDbName)
 	{	
-	__SQLLOG_STRING(_L("SQLLOG: TSqlDbSysSettings::ProcessStatementL() - Processing statement '%S'"), aStmt);	
+	SQL_TRACE_INTERNALS(OstTraceExt2(TRACE_INTERNALS, TSQLDBSYSSETTINGS_PROCESSSTATEMENTL_ENTRY, "Entry;0x%X;TSqlDbSysSettings::ProcessStatementL;Processing statement '%S'", (TUint)this, __SQLPRNSTR(aStmt)));	
 	
 	//If the statement only contained whitespace then just return
 	if(aStmt.Length() == 0)
 		{
-		__SQLLOG_STRING(_L("SQLLOG: TSqlDbSysSettings::ProcessStatementL() - Statement '%S' only contains whitespace - statement will be ignored"), aStmt);	
+		SQL_TRACE_INTERNALS(OstTrace1(TRACE_INTERNALS, TSQLDBSYSSETTINGS_PROCESSSTATEMENTL_EXIT1, "Exit;0x%X;TSqlDbSysSettings::ProcessStatementL;The statement ignored because contains only whitespace", (TUint)this));	
 		return;	
 		}
 		
@@ -705,7 +714,7 @@
 		{
 		//The statement contains '//' which is an unsupported comment style, but rather
 		//than leave here and cause the full file to fail, we just ignore this statement
-		__SQLLOG_STRING(_L("SQLLOG: TSqlDbSysSettings::ProcessStatementL() - Statement '%S' contains invalid comment style - statement will be ignored"), aStmt);	
+		SQL_TRACE_INTERNALS(OstTrace1(TRACE_INTERNALS, TSQLDBSYSSETTINGS_PROCESSSTATEMENTL_EXIT2, "Exit;0x%X;TSqlDbSysSettings::ProcessStatementL;The statement ignored because contains invalid comment style", (TUint)this));	
 		return;
 		}
 		
@@ -717,11 +726,11 @@
 		TInt err = ::DbExecStmt16(iDbHandle, stmtPtr);
 		if(KErrNone == err)
 			{
-			__SQLLOG_STRING(_L("SQLLOG: TSqlDbSysSettings::ProcessStatementL() - Successfully executed statement '%S'"), aStmt);		
+			SQL_TRACE_INTERNALS(OstTrace1(TRACE_INTERNALS, TSQLDBSYSSETTINGS_PROCESSSTATEMENTL1, "0x%X;TSqlDbSysSettings::ProcessStatementL;Successfully executed statement", (TUint)this));		
 			}
 		else
 			{
-			__SQLLOG_ERR(_L("SQLLOG: TSqlDbSysSettings::ProcessStatementL() - Failed to execute the statement, err=%d"), err);		
+			SQL_TRACE_INTERNALS(OstTraceExt2(TRACE_INTERNALS, TSQLDBSYSSETTINGS_PROCESSSTATEMENTL2, "0x%X;TSqlDbSysSettings::ProcessStatementL;Failed to execute the statement;err=%d", (TUint)this, err));		
 			if(err == KErrNoMemory)
 				{
 				__SQLLEAVE(err);	
@@ -730,9 +739,10 @@
 		}
 	else
 		{
-		__SQLLOG_STRING(_L("SQLLOG: TSqlDbSysSettings::ProcessStatementL() - Non-supported statement, will be ignored - '%S'"), aStmt);		
+		SQL_TRACE_INTERNALS(OstTrace1(TRACE_INTERNALS, TSQLDBSYSSETTINGS_PROCESSSTATEMENTL3, "0x%X;TSqlDbSysSettings::ProcessStatementL;Non-supported statement, will be ignored", (TUint)this));		
 		}
 	CleanupStack::PopAndDestroy(); // stmtBuf
+	SQL_TRACE_INTERNALS(OstTrace1(TRACE_INTERNALS, TSQLDBSYSSETTINGS_PROCESSSTATEMENTL_EXIT3, "Exit;0x%X;TSqlDbSysSettings::ProcessStatementL", (TUint)this));  
 	}
 
 
@@ -795,7 +805,7 @@
 void TSqlDbSysSettings::StoreSecurityPolicyL(sqlite3_stmt* aStmtHandle, TInt aObjType, const TDesC& aObjName, 
 											 TInt aPolicyType, const TSecurityPolicy& aPolicy)
 	{
-	__SQLASSERT(aStmtHandle != NULL, ESqlPanicBadArgument);
+	__ASSERT_DEBUG(aStmtHandle != NULL, __SQLPANIC(ESqlPanicBadArgument));
 	__SQLLEAVE_IF_ERROR(::StmtReset(aStmtHandle));
 	__SQLLEAVE_IF_ERROR(BindSecurityPolicyPrm(aStmtHandle, aObjType, aObjName, aPolicyType, aPolicy));
 	__SQLLEAVE_IF_ERROR(::StmtExec(aStmtHandle));
@@ -854,7 +864,7 @@
 TSecurityPolicy TSqlDbSysSettings::ReadCurrSecurityPolicyL(sqlite3_stmt* aStmtHandle, TInt& aObjType, 
 														   TPtrC& aObjName, TInt& aPolicyType)
 	{
-	__SQLASSERT(aStmtHandle != NULL, ESqlPanicBadArgument);
+	__ASSERT_DEBUG(aStmtHandle != NULL, __SQLPANIC(ESqlPanicBadArgument));
 	aObjType = sqlite3_column_int(aStmtHandle, KObjTypeColIdx);
     //The "ObjectName" column type might be different than SQLITE_TEXT - malformed database.
     if(sqlite3_column_type(aStmtHandle, KObjNameColIdx) != SQLITE_TEXT)
@@ -864,7 +874,7 @@
     const void* text = sqlite3_column_text16(aStmtHandle, KObjNameColIdx);
     //Null column value - this might be an indication of an "out of memory" problem, if the column text  
     //is in UTF8 format. (sqlite3_column_text16() may allocate memory for UTF8->UTF16 conversion)
-    __SQLLEAVE_IF_NULL(text);
+    __SQLLEAVE_IF_NULL(const_cast<void*>(text));
 	TInt len = (TUint)sqlite3_column_bytes16(aStmtHandle, KObjNameColIdx) / sizeof(TUint16);
 	aObjName.Set(reinterpret_cast <const TUint16*> (text), len);
 	aPolicyType = sqlite3_column_int(aStmtHandle, KObjPolicyTypeColIdx);
--- a/persistentstorage/sql/SRC/Server/SqlSrvDbSysSettings.h	Tue Jul 06 16:18:30 2010 +0300
+++ b/persistentstorage/sql/SRC/Server/SqlSrvDbSysSettings.h	Wed Aug 18 11:30:17 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -18,7 +18,7 @@
 #ifndef __SQLSRVDBSYSSETTINGS_H__
 #define __SQLSRVDBSYSSETTINGS_H__
 
-#include "SqlPanic.h"	// __SQLASSERT, ESqlPanicInternalError
+#include "SqlAssert.h"	// ESqlPanicInternalError
 #include "SqlUtil.h"	// TSqlCompactionMode
 
 //Forward declarations
--- a/persistentstorage/sql/SRC/Server/SqlSrvDriveSpace.cpp	Tue Jul 06 16:18:30 2010 +0300
+++ b/persistentstorage/sql/SRC/Server/SqlSrvDriveSpace.cpp	Wed Aug 18 11:30:17 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2004-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -16,7 +16,12 @@
 //
 
 #include "SqlSrvDriveSpace.h"
-#include "SqlPanic.h"
+#include "SqlAssert.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "SqlSrvDriveSpaceTraces.h"
+#endif
+#include "SqlTraceDef.h"
 
 /**
 The amount of the disk space, which will be reserved at the moment of creation of
@@ -52,10 +57,12 @@
 */
 CSqlDriveSpace* CSqlDriveSpace::NewLC(RFs& aFs, TDriveNumber aDrive)
     {
-	__SQLASSERT(aDrive >= EDriveA && aDrive <= EDriveZ, ESqlPanicBadArgument);
+	SQL_TRACE_INTERNALS(OstTraceExt2(TRACE_INTERNALS, CSQLDRIVESPACE_NEWLC_ENTRY, "Entry;0;CSqlDriveSpace::NewLC;aFs.Handle()=0x%X;aDrive=%d", (TUint)aFs.Handle(), (TInt)aDrive));
+	__ASSERT_DEBUG(aDrive >= EDriveA && aDrive <= EDriveZ, __SQLPANIC2(ESqlPanicBadArgument));
     CSqlDriveSpace* self = new (ELeave) CSqlDriveSpace(aFs, aDrive);
     CleanupStack::PushL(self);
     self->ConstructL();
+	SQL_TRACE_INTERNALS(OstTrace1(TRACE_INTERNALS, CSQLDRIVESPACE_NEWLC_EXIT, "Exit;0x%X;CSqlDriveSpace::NewLC", (TUint)self));
     return self;
     }
 
@@ -64,6 +71,7 @@
 */
 CSqlDriveSpace::~CSqlDriveSpace()
     {
+	SQL_TRACE_INTERNALS(OstTraceExt3(TRACE_INTERNALS, CSQLDRIVESPACE_CSQLDRIVESPACE2, "0x%X;CSqlDriveSpace::~CSqlDriveSpace;iDrive=%d;iGetAccessRefCnt=%d", (TUint)this, (TInt)iDrive, iGetAccessRefCnt));
 	SQLDRIVESPACE_INVARIANT();
 	(void)iFs.ReleaseReserveAccess(static_cast <TInt> (iDrive));
 	(void)iFs.ReserveDriveSpace(static_cast <TInt> (iDrive), 0);
@@ -82,6 +90,7 @@
 */
 void CSqlDriveSpace::GetAccessL()
 	{
+	SQL_TRACE_INTERNALS(OstTraceExt3(TRACE_INTERNALS, CSQLDRIVESPACE_GETACCESSL_ENTRY, "Entry;0x%X;CSqlDriveSpace::GetAccessL;iDrive=%d;iGetAccessRefCnt=%d", (TUint)this, (TInt)iDrive, iGetAccessRefCnt));
 	SQLDRIVESPACE_INVARIANT();
 	//Gets an access only once, there is only one RFs session instance.
 	if(iGetAccessRefCnt == 0)
@@ -89,6 +98,7 @@
 		__SQLLEAVE_IF_ERROR(iFs.GetReserveAccess(static_cast <TInt> (iDrive)));
 		}
 	++iGetAccessRefCnt;
+	SQL_TRACE_INTERNALS(OstTraceExt3(TRACE_INTERNALS, CSQLDRIVESPACE_GETACCESSL_EXIT, "Exit;0x%X;CSqlDriveSpace::GetAccessL;iDrive=%d;iGetAccessRefCnt=%d", (TUint)this, (TInt)iDrive, iGetAccessRefCnt));
 	SQLDRIVESPACE_INVARIANT();
 	}
 
@@ -103,6 +113,7 @@
 */
 void CSqlDriveSpace::ReleaseAccess()
 	{
+	SQL_TRACE_INTERNALS(OstTraceExt3(TRACE_INTERNALS, CSQLDRIVESPACE_RELEASEACCESS, "0x%X;CSqlDriveSpace::ReleaseAccess;iDrive=%d;iGetAccessRefCnt=%d", (TUint)this, (TInt)iDrive, iGetAccessRefCnt));
 	SQLDRIVESPACE_INVARIANT();
     if(iGetAccessRefCnt == 0)
         {
@@ -127,7 +138,7 @@
 	iFs(aFs),
 	iDrive(aDrive)
 	{
-	__SQLASSERT(aDrive >= EDriveA && aDrive <= EDriveZ, ESqlPanicBadArgument);
+	__ASSERT_DEBUG(aDrive >= EDriveA && aDrive <= EDriveZ, __SQLPANIC(ESqlPanicBadArgument));
 	}
 
 /**
@@ -152,8 +163,8 @@
 */
 void CSqlDriveSpace::Invariant() const
 	{
-	__SQLASSERT(iDrive >= EDriveA && iDrive <= EDriveZ, ESqlPanicInternalError);
-	__SQLASSERT(iGetAccessRefCnt >= 0, ESqlPanicMisuse);
+	__ASSERT_DEBUG(iDrive >= EDriveA && iDrive <= EDriveZ, __SQLPANIC(ESqlPanicInternalError));
+	__ASSERT_DEBUG(iGetAccessRefCnt >= 0, __SQLPANIC(ESqlPanicMisuse));
 	}
 #endif//_DEBUG
 
@@ -202,7 +213,7 @@
 */
 CSqlDriveSpace* RSqlDriveSpaceCol::Find(TDriveNumber aDrive)
     {
-	__SQLASSERT(aDrive >= EDriveA && aDrive <= EDriveZ, ESqlPanicBadArgument);
+	__ASSERT_DEBUG(aDrive >= EDriveA && aDrive <= EDriveZ, __SQLPANIC(ESqlPanicBadArgument));
 	SQLDRIVESPACECOL_INVARIANT();
     for(TInt index=iDriveSpaceCol.Count()-1;index>=0;--index)
         {
@@ -230,8 +241,8 @@
 */
 CSqlDriveSpace* RSqlDriveSpaceCol::AddL(TDriveNumber aDrive)
 	{
-	__SQLASSERT(aDrive >= EDriveA && aDrive <= EDriveZ, ESqlPanicBadArgument);
-    __SQLASSERT(!Find(aDrive), ESqlPanicMisuse);
+	__ASSERT_DEBUG(aDrive >= EDriveA && aDrive <= EDriveZ, __SQLPANIC(ESqlPanicBadArgument));
+    __ASSERT_DEBUG(!Find(aDrive), __SQLPANIC(ESqlPanicMisuse));
 	SQLDRIVESPACECOL_INVARIANT();
     CSqlDriveSpace* drvSpace = CSqlDriveSpace::NewLC(*iFs, aDrive);
     __SQLLEAVE_IF_ERROR(iDriveSpaceCol.Append(drvSpace));
@@ -246,7 +257,7 @@
 */
 void RSqlDriveSpaceCol::Invariant() const
 	{
-	__SQLASSERT(iFs != NULL, ESqlPanicInternalError);
+	__ASSERT_DEBUG(iFs != NULL, __SQLPANIC(ESqlPanicInternalError));
     for(TInt index=iDriveSpaceCol.Count()-1;index>=0;--index)
     	{
 		iDriveSpaceCol[index]->Invariant();
--- a/persistentstorage/sql/SRC/Server/SqlSrvFileData.cpp	Tue Jul 06 16:18:30 2010 +0300
+++ b/persistentstorage/sql/SRC/Server/SqlSrvFileData.cpp	Wed Aug 18 11:30:17 2010 +0300
@@ -15,7 +15,7 @@
 
 #include "SqlSrvFileData.h"
 #include "SqlSrvUtil.h"
-#include "SqlPanic.h"
+#include "SqlAssert.h"
 #include "SqlSrvStrings.h"
 #include "SqlSrvResourceProfiler.h"
 
@@ -35,13 +35,13 @@
 static void CreatePrivateDataPathL(RFs& aFs, TDriveNumber aDriveNumber)
 	{
 	TDriveInfo driveInfo;
-	__SQLLEAVE_IF_ERROR(aFs.Drive(driveInfo, aDriveNumber));
+	__SQLLEAVE_IF_ERROR2(aFs.Drive(driveInfo, aDriveNumber));
 	if(!(driveInfo.iDriveAtt & KDriveAttRom))
 		{
 		TInt err = aFs.CreatePrivatePath(aDriveNumber);
 		if(err != KErrNone && err != KErrAlreadyExists)
 			{
-			__SQLLEAVE(err);
+			__SQLLEAVE2(err);
 			}
 		}
 	}
@@ -114,16 +114,16 @@
 static void DoFullFileNameL(TDes& aDbFileName, const TDesC& aSysDrivePrivatePath, TDriveNumber& aDrive)
 	{
 	TParse parse;
-	__SQLLEAVE_IF_ERROR(parse.Set(aDbFileName, &aSysDrivePrivatePath, NULL));
+	__SQLLEAVE_IF_ERROR2(parse.Set(aDbFileName, &aSysDrivePrivatePath, NULL));
 	if(!parse.NamePresent())
 		{
-		__SQLLEAVE(KErrBadName);	
+		__SQLLEAVE2(KErrBadName);	
 		}
 	aDbFileName.Copy(parse.FullName());
 	TPtrC driveName = parse.Drive();
-	__SQLASSERT(driveName.Length() > 0, ESqlPanicInternalError);
+	__ASSERT_DEBUG(driveName.Length() > 0, __SQLPANIC2(ESqlPanicInternalError));
 	TInt driveNumber = -1;
-	__SQLLEAVE_IF_ERROR(RFs::CharToDrive(driveName[0], driveNumber));
+	__SQLLEAVE_IF_ERROR2(RFs::CharToDrive(driveName[0], driveNumber));
 	aDrive = static_cast <TDriveNumber> (driveNumber);
 	}
 
@@ -143,7 +143,7 @@
 	//If SQL server private path is in the file name - leave
 	if(::IsPrivatePathInFileName(aDbFileName, aServerPrivatePath))
 		{
-		__SQLLEAVE(KErrArgument);
+		__SQLLEAVE2(KErrArgument);
 		}
 	//Extract database SID from the name
 	aIsSecureFileNameFmt = ::IsSecureFileNameFmt(aDbFileName);
@@ -198,8 +198,8 @@
 #endif          
                            const TDesC8* aConfigStr)
 	{
-	__SQLASSERT((TUint)aFileNameArgNum < KMaxMessageArguments, ESqlPanicBadArgument);
-	__SQLASSERT(iSysDrivePrivatePath.DriveAndPath().Length() > 0, ESqlPanicInternalError);
+	__ASSERT_DEBUG((TUint)aFileNameArgNum < KMaxMessageArguments, __SQLPANIC(ESqlPanicBadArgument));
+	__ASSERT_DEBUG(iSysDrivePrivatePath.DriveAndPath().Length() > 0, __SQLPANIC(ESqlPanicInternalError));
 		
 	if(aFileNameLen < 1 || aFileNameLen > KMaxFileName)
 		{
--- a/persistentstorage/sql/SRC/Server/SqlSrvMain.cpp	Tue Jul 06 16:18:30 2010 +0300
+++ b/persistentstorage/sql/SRC/Server/SqlSrvMain.cpp	Wed Aug 18 11:30:17 2010 +0300
@@ -25,10 +25,14 @@
 #include "SqlCompact.h"
 #include "SqlCompactConn.h"
 #include "SqlSrvResourceProfiler.h"
-#include "UTraceSql.h"
 #ifdef _DEBUG
 #include <stdio.h>
 #endif
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "SqlSrvMainTraces.h"
+#endif
+#include "SqlTraceDef.h"
 
 #ifndef SQLSRV_STARTUP_TEST
 static  
@@ -66,7 +70,7 @@
 //aRight argument is NULL.
 static TInt Compare(const TSqlSecurityPair& aLeft, const TSqlSecurityPair& aRight)
 	{
-	__SQLASSERT(aLeft.iKey != NULL && aRight.iKey != NULL, ESqlPanicInternalError);
+	__ASSERT_DEBUG(aLeft.iKey != NULL && aRight.iKey != NULL, __SQLPANIC2(ESqlPanicInternalError));
 	return ::CompareNoCase8(TPtrC8(aLeft.iKey), TPtrC8(aRight.iKey));
 	}
 	
@@ -81,7 +85,7 @@
 */
 CSqlServer& SqlServer(void)
 	{
-	__SQLASSERT_ALWAYS(TheServer != NULL, ESqlPanicInvalidObj);		
+	__ASSERT_ALWAYS(TheServer != NULL, __SQLPANIC2(ESqlPanicInvalidObj));		
 	return *TheServer;
 	}
 	
@@ -95,9 +99,11 @@
 */
 CSqlServer* CSqlServer::NewLC()
 	{
+	SQL_TRACE_INTERNALS(OstTrace0(TRACE_INTERNALS, CSQLSERVER_NEWLC_ENTRY, "Entry;0;CSqlServer::NewLC"));
 	CSqlServer* self = new (ELeave) CSqlServer;
 	CleanupStack::PushL(self);
 	self->ConstructL();
+	SQL_TRACE_INTERNALS(OstTrace1(TRACE_INTERNALS, CSQLSERVER_NEWLC_EXIT, "Exit;0x%X;CSqlServer::NewLC", (TUint)self));
 	return self;
 	}
 	
@@ -106,6 +112,7 @@
 */
 CSqlServer::~CSqlServer()
 	{
+	SQL_TRACE_INTERNALS(OstTrace1(TRACE_INTERNALS, CSQLSERVER_CSQLSERVER2_ENTRY, "Entry;0x%x;CSqlServer::~CSqlServer", (TUint)this));
 	delete iCompactor;
 	delete iBackupClient;
 	iDriveSpaceCol.ResetAndDestroy();
@@ -117,8 +124,7 @@
 	delete iDbConfigFiles;
 	sqlite3SymbianLibFinalize();
 	TheServer = NULL;
-	SYMBIAN_TRACE_SQL_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KSqlSrvClose));
-    SQLPROFILER_SERVER_STOP();
+	SQL_TRACE_INTERNALS(OstTrace1(TRACE_INTERNALS, CSQLSERVER_CSQLSERVER2_EXIT, "Exit;0x%x;CSqlServer::~CSqlServer", (TUint)this));
 	}
 
 /**
@@ -128,7 +134,7 @@
 */
 RSqlBufFlat& CSqlServer::GetFlatBufL(TInt aMinLen)
 	{
-	__SQLASSERT(aMinLen >= 0, ESqlPanicBadArgument);
+	__ASSERT_DEBUG(aMinLen >= 0, __SQLPANIC(ESqlPanicBadArgument));
 	__SQLLEAVE_IF_ERROR(iFlatBuf.ReAlloc(aMinLen));
 	SQLPROFILER_REPORT_ALLOC(iFlatBuf.MaxSize());
 	return iFlatBuf;
@@ -144,10 +150,10 @@
 */
 TDes8& CSqlServer::GetBuf8L(TInt aMinLen)
 	{
-	__SQLASSERT(aMinLen >= 0, ESqlPanicBadArgument);
+	__ASSERT_DEBUG(aMinLen >= 0, __SQLPANIC(ESqlPanicBadArgument));
 #ifdef _DEBUG
-TInt maxBufLen = iBufPtr8.MaxLength();
-maxBufLen = maxBufLen;
+	TInt maxBufLen = iBufPtr8.MaxLength();
+	maxBufLen = maxBufLen;
 #endif
 	if(iBufPtr8.MaxLength() < aMinLen)
 		{
@@ -167,10 +173,10 @@
 */
 TDes16& CSqlServer::GetBuf16L(TInt aMinLen)
 	{
-	__SQLASSERT(aMinLen >= 0, ESqlPanicBadArgument);
+	__ASSERT_DEBUG(aMinLen >= 0, __SQLPANIC(ESqlPanicBadArgument));
 #ifdef _DEBUG
-TInt maxBufLen = iBufPtr16.MaxLength();
-maxBufLen = maxBufLen;
+	TInt maxBufLen = iBufPtr16.MaxLength();
+	maxBufLen = maxBufLen;
 #endif
 	if(iBufPtr16.MaxLength() < aMinLen)
 		{
@@ -196,7 +202,7 @@
 	if(iBufPtr8.MaxSize() > KBufLimit)
 		{
 		(void)ReAllocBuf(KBufLimit);
-		__SQLASSERT(oldBuf == iBuf, ESqlPanicInternalError);
+		__ASSERT_DEBUG(oldBuf == iBuf, __SQLPANIC(ESqlPanicInternalError));
 		}
 	}
 
@@ -211,7 +217,7 @@
 */
 TInt CSqlServer::ReAllocBuf(TInt aNewBufSize)
 	{
-	__SQLASSERT(aNewBufSize >= 0, ESqlPanicBadArgument);
+	__ASSERT_DEBUG(aNewBufSize >= 0, __SQLPANIC(ESqlPanicBadArgument));
 #ifdef _DEBUG	
 	const TInt KMinBufSize = 8;
 #else
@@ -301,7 +307,8 @@
 #endif	
     SQLPROFILER_SERVER_START();
 	//Configure the SQLite library
-	__SQLLEAVE_IF_ERROR(sqlite3_config(SQLITE_CONFIG_LOOKASIDE, KSqliteLookAsideCellSize, KSqliteLookAsideCellCount));
+	TInt sqliteErr = sqlite3_config(SQLITE_CONFIG_LOOKASIDE, KSqliteLookAsideCellSize, KSqliteLookAsideCellCount);
+    __SQLLEAVE_IF_ERROR(::Sql2OsErrCode(sqliteErr, KErrArgument));
 	//Open SQLITE library - this must be the first call after StartL() (os_symbian.cpp, "TheAllocator" initialization rellated).
 	__SQLLEAVE_IF_ERROR(sqlite3SymbianLibInit());
 	//Create buffers
@@ -314,6 +321,7 @@
 	RFs& fs = sqlite3SymbianFs();
 	TFileName serverPrivatePath;
 	__SQLLEAVE_IF_ERROR(fs.PrivatePath(serverPrivatePath));
+	DeleteTempFilesL(sysDrive, serverPrivatePath);
 	//Load config file parameter values (if config file exists) and initialize iFileData.
 	TParse parse;
 	__SQLLEAVE_IF_ERROR(parse.Set(KSqlSrvDefaultConfigFile, &serverPrivatePath, NULL));
@@ -326,8 +334,8 @@
 	const TSqlSrvConfigParams& configParams = iFileData.ConfigParams();
 	if(configParams.iSoftHeapLimitKb > 0)
 		{
-		__SQLASSERT(configParams.iSoftHeapLimitKb >= TSqlSrvConfigParams::KMinSoftHeapLimitKb &&
-		            configParams.iSoftHeapLimitKb <= TSqlSrvConfigParams::KMaxSoftHeapLimitKb, ESqlPanicInternalError);
+		__ASSERT_DEBUG(configParams.iSoftHeapLimitKb >= TSqlSrvConfigParams::KMinSoftHeapLimitKb &&
+		            configParams.iSoftHeapLimitKb <= TSqlSrvConfigParams::KMaxSoftHeapLimitKb, __SQLPANIC(ESqlPanicInternalError));
 		sqlite3_soft_heap_limit(configParams.iSoftHeapLimitKb * 1024);
 		}
 	//Enable shared cache
@@ -362,6 +370,39 @@
 	}
 
 /**
+Delete any temp files left the "temp" subdirectory in server's private directory.
+
+The SQLite is configured to use shared page cache. When the shared page cache is enabled,
+those temp files created by SQLite are deleted only when the database gets closed. However,
+if during power down event the client application does not close the database, 
+the temp files will never get deleted.
+This is why the SQL server should deletes all temp files during its start-up.
+
+Note that all errors exept KErrNoMemory are ignored in the function body, becasuse
+the temp files deletion is not a critical operation to prevent the server start up.
+
+@param aDriveNumber A drive number.
+@param aServerPath A server's private path.
+
+*/
+void CSqlServer::DeleteTempFilesL(TInt aDriveNumber, const TDesC& aServerPath)const
+    {
+    _LIT(KTempFileDir, "temp");
+    _LIT(KWildCard, "*.*");
+    TDriveUnit drive(aDriveNumber); 
+    TDriveName driveName = drive.Name();
+    TParse parse;
+    (void)parse.Set(aServerPath, &driveName, 0);//this call can't fail
+    (void)parse.AddDir(KTempFileDir);//this call can't fail
+    TFileName tempfileDir(parse.FullName());
+    (void)parse.Set(KWildCard, &tempfileDir, 0);//this call can't fail
+	RFs& fs = sqlite3SymbianFs();
+	CFileMan* fm = CFileMan::NewL(fs);
+	(void)fm->Delete(parse.FullName());
+	delete fm;
+    }
+
+/**
 Retrieves in iCollationDllName current(default) collation dll name.
 see TExtendedLocale
 */
@@ -380,6 +421,7 @@
 		fileName.Set(fname, NULL, NULL);
 		iCollationDllName = fileName.NameAndExt();
 		}
+	SQL_TRACE_INTERNALS(OstTraceExt3(TRACE_INTERNALS, CSQLSERVER_GETCOLLATIONDLLNAMEL, "0x%x;CSqlServer::GetCollationDllNameL;iCollationDllName=%S;err=%d", (TUint)this, __SQLPRNSTR(iCollationDllName), err));
 	}
 /**
 Finds and caches the name of each database configuration file 
@@ -403,7 +445,7 @@
 		}
 	else
 		{
-		__SQLLOG_ERR(_L("SQLLOG: CSqlServer::CacheDbConfigFileNamesL() - GetDir() failed with error code %d"), err);	
+		SQL_TRACE_INTERNALS(OstTraceExt2(TRACE_INTERNALS, CSQLSERVER_CACHEDDBCONFIGFILENAMESL, "0x%X;CSqlServer::CacheDbConfigFileNamesL;GetDir() failed with error code %d", (TUint)this, err));	
 		}
 	CleanupStack::PopAndDestroy(); // entryList	
 	}
@@ -459,6 +501,7 @@
 */
 void CSqlServer::GetBackUpListL(TSecureId aUid, RArray<TParse>& aFileList)
 	{
+	SQL_TRACE_INTERNALS(OstTraceExt2(TRACE_INTERNALS, CSQLSERVER_GETBACKUPLISTL_ENTRY, "Entry;0x%x;CSqlServer::GetBackUpListL;aUid=0x%X", (TUint)this, (TUint)aUid.iId));
 	aFileList.Reset();
 	TFindFile findFile(iFileData.Fs());
 	CDir* fileNameCol = NULL;
@@ -472,14 +515,14 @@
 		//The first set of files, which name is matching "[aUid]*" pattern, is ready.
 		do
 			{
-			__SQLASSERT(fileNameCol != NULL, ESqlPanicInternalError);
+			__ASSERT_DEBUG(fileNameCol != NULL, __SQLPANIC(ESqlPanicInternalError));
 			CleanupStack::PushL(fileNameCol);
 			const TDesC& file = findFile.File();//"file" variable contains the drive and the path. the file name in "file" is invalid in this case.
 			//Check that the drive, where the database files are, is not ROM drive
 			TParse parse;
 			(void)parse.Set(file, NULL, NULL);//this call can't file, the file name comes from findFile call.
 			TPtrC driveName = parse.Drive();
-			__SQLASSERT(driveName.Length() > 0, ESqlPanicInternalError);
+			__ASSERT_DEBUG(driveName.Length() > 0, __SQLPANIC(ESqlPanicInternalError));
 			TInt driveNumber = -1;
 			__SQLLEAVE_IF_ERROR(RFs::CharToDrive(driveName[0], driveNumber));
 			TDriveInfo driveInfo;
@@ -495,6 +538,8 @@
 					if(!entry.IsDir())
 						{
 						(void)parse.Set(entry.iName, &file, NULL);//"parse" variable now contains the full file path
+						__SQLTRACE_INTERNALSVAR(TPtrC fname = parse.FullName());
+						SQL_TRACE_INTERNALS(OstTraceExt2(TRACE_INTERNALS, CSQLSERVER_GETBACKUPLISTL, "0x%x;CSqlServer::GetBackUpListL;fname=%S", (TUint)this, __SQLPRNSTR(fname)));
 						__SQLLEAVE_IF_ERROR(aFileList.Append(parse));
 						}
 					}
@@ -503,11 +548,12 @@
 			fileNameCol = NULL;
 			} while((err = findFile.FindWild(fileNameCol)) == KErrNone);//Get the next set of files
 		}//end of "if(err == KErrNone)"
-	__SQLASSERT(!fileNameCol, ESqlPanicInternalError);
+	__ASSERT_DEBUG(!fileNameCol, __SQLPANIC(ESqlPanicInternalError));
 	if(err != KErrNotFound && err != KErrNone)
 		{
 		__SQLLEAVE(err);
 		}
+	SQL_TRACE_INTERNALS(OstTraceExt3(TRACE_INTERNALS, CSQLSERVER_GETBACKUPLISTL_EXIT, "Exit;0x%x;CSqlServer::GetBackUpListL;file count=%d;err=%d", (TUint)this, aFileList.Count(), err));
 	}
 
 //////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -526,7 +572,6 @@
 	CActiveScheduler* scheduler = new (ELeave) CActiveScheduler;
 	CleanupStack::PushL(scheduler);
 	CActiveScheduler::Install(scheduler);
-	SYMBIAN_TRACE_SQL_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KSqlSrvStart));
 	TheServer = CSqlServer::NewLC();
 	RProcess::Rendezvous(KErrNone);
 	CActiveScheduler::Start();
--- a/persistentstorage/sql/SRC/Server/SqlSrvMain.h	Tue Jul 06 16:18:30 2010 +0300
+++ b/persistentstorage/sql/SRC/Server/SqlSrvMain.h	Wed Aug 18 11:30:17 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2005-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -17,7 +17,7 @@
 #define __SQLSRVMAIN_H__
 
 #include <f32file.h>
-#include "SqlPanic.h" 			//TSqlPanic
+#include "SqlAssert.h" 			//TSqlPanic
 #include "SqlSrvFileData.h"		//TSqlSrvFileData
 #include "SqlSrvAuthorizer.h"	//MSqlPolicyInspector
 #include "SqlSrvSecurityMap.h"	//
@@ -90,6 +90,7 @@
 	void GetCollationDllNameL();
 	void CacheDbConfigFileNamesL(RFs& aFs, const TDesC& aServerPrivatePath);
 	TInt ReAllocBuf(TInt aNewBufSize);
+	void DeleteTempFilesL(TInt aDriveNumber, const TDesC& aServerPrivatePath) const;
 
 private:
 	TSqlSrvFileData		iFileData;		//Used as a temporary storage for file data (file name, drive, path, secure uid)
@@ -162,7 +163,7 @@
 */
 inline CSqlCompactor& CSqlServer::Compactor()
 	{
-	__SQLASSERT(iCompactor != NULL, ESqlPanicInternalError);			
+	__ASSERT_DEBUG(iCompactor != NULL, __SQLPANIC(ESqlPanicInternalError));			
 	return *iCompactor;
 	}
 
--- a/persistentstorage/sql/SRC/Server/SqlSrvObjContainer.h	Tue Jul 06 16:18:30 2010 +0300
+++ b/persistentstorage/sql/SRC/Server/SqlSrvObjContainer.h	Wed Aug 18 11:30:17 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -17,7 +17,7 @@
 #define __SQLSRVOBJCONTAINER_H__
 
 #include <e32std.h>
-#include "SqlPanic.h"
+#include "SqlAssert.h"
 
 /**
 Indexed storage for server sdide objects.
--- a/persistentstorage/sql/SRC/Server/SqlSrvObjContainer.inl	Tue Jul 06 16:18:30 2010 +0300
+++ b/persistentstorage/sql/SRC/Server/SqlSrvObjContainer.inl	Wed Aug 18 11:30:17 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -55,7 +55,7 @@
 template <class T> 
 void RDbObjContainer<T>::AllocL()
 	{
-	__SQLASSERT(iFree <= iSize, ESqlPanicInternalError);
+	__ASSERT_DEBUG(iFree <= iSize, __SQLPANIC(ESqlPanicInternalError));
 	if(iFree == iSize)
 		{
 		if(iSize >= KMaxSize)
@@ -87,15 +87,15 @@
 template <class T> 
 TInt RDbObjContainer<T>::Add(T* aObj)
 	{
-	__SQLASSERT(aObj != NULL, ESqlPanicBadArgument);
-	__SQLASSERT(iFree <= iSize, ESqlPanicInternalError);
+	__ASSERT_DEBUG(aObj != NULL, __SQLPANIC(ESqlPanicBadArgument));
+	__ASSERT_DEBUG(iFree <= iSize, __SQLPANIC(ESqlPanicInternalError));
 	TInt idx = iFree;
 	if(idx < iSize)
 		{
 		/*RDbObjContainer<T>::*/TEntry& entry = iEntries[idx];
-		__SQLASSERT(!entry.iObj, ESqlPanicInternalError);
+		__ASSERT_DEBUG(!entry.iObj, __SQLPANIC(ESqlPanicInternalError));
 		iFree = entry.iNext;
-		__SQLASSERT(iFree <= iSize, ESqlPanicInternalError);
+		__ASSERT_DEBUG(iFree <= iSize, __SQLPANIC(ESqlPanicInternalError));
 		entry.iObj = aObj;
 		return MakeHandle(idx);
 		}
@@ -135,7 +135,7 @@
 template <class T> 
 void RDbObjContainer<T>::Remove(TInt aHandle)
 	{
-	__SQLASSERT(iFree <= iSize, ESqlPanicInternalError);
+	__ASSERT_DEBUG(iFree <= iSize, __SQLPANIC(ESqlPanicInternalError));
 	if(aHandle > 0)	//It is a handle, sent by the client. It isn't a server's problem if the handle is <= 0.
 		{
 		TInt idx = MakeIndex(aHandle);
@@ -148,7 +148,7 @@
 			iFree = idx;
 			}
 		}
-	__SQLASSERT(iFree <= iSize, ESqlPanicInternalError);
+	__ASSERT_DEBUG(iFree <= iSize, __SQLPANIC(ESqlPanicInternalError));
 	}
 
 /**
--- a/persistentstorage/sql/SRC/Server/SqlSrvResourceProfiler.cpp	Tue Jul 06 16:18:30 2010 +0300
+++ b/persistentstorage/sql/SRC/Server/SqlSrvResourceProfiler.cpp	Wed Aug 18 11:30:17 2010 +0300
@@ -13,10 +13,8 @@
 // Description:
 //
 
-#include <e32std.h>
-#include <e32debug.h>
 #include <f32file.h>
-#include "SqlPanic.h"
+#include "SqlAssert.h"
 #include "SqlSrvResourceProfiler.h"
 #include "SqlResourceProfiler.h"
 #include "SqliteSymbian.h"
@@ -140,7 +138,7 @@
 		    {
 			TheSqlSrvProfilerTraceEnabled = ETrue;
 		    TInt len = aMessage.Int1();
-		    __SQLPANIC_CLIENT((TUint)len < 64, aMessage, ESqlPanicBadArgument);
+		    __SQLPANIC_CLIENT2((TUint)len < 64, aMessage, ESqlPanicBadArgument);
 		    if(len > 0)
 		        {
                 TBuf8<64> prmBuf;
@@ -193,7 +191,7 @@
 			err = KErrNotSupported;
 			break;
 		}
-	__SQLLEAVE_IF_ERROR(err);
+	__SQLLEAVE_IF_ERROR2(err);
 	}
 	
 /**
@@ -237,7 +235,7 @@
 			err = KErrNotSupported;
 			break;
 		}
-	__SQLLEAVE_IF_ERROR(err);
+	__SQLLEAVE_IF_ERROR2(err);
 	}
 	
 /**
@@ -278,7 +276,7 @@
 			err = KErrNotSupported;
 			break;
 		}
-	__SQLLEAVE_IF_ERROR(err);
+	__SQLLEAVE_IF_ERROR2(err);
 	}
 	
 /**
@@ -351,7 +349,7 @@
 			err = KErrNotSupported;
 			break;
 		}
-	__SQLLEAVE_IF_ERROR(err);
+	__SQLLEAVE_IF_ERROR2(err);
 	aMessage.WriteL(2, ipcBuf);
 	}
 	
@@ -590,7 +588,7 @@
         default:
             return KErrNotSupported;
         };
-    __SQLASSERT((TUint)rc < KIpcTraceTypeCount || rc == KErrNotFound, ESqlPanicInternalError);
+    __ASSERT_DEBUG((TUint)rc < KIpcTraceTypeCount || rc == KErrNotFound, __SQLPANIC2(ESqlPanicInternalError));
     return rc;
     }
 
@@ -603,7 +601,7 @@
         TInt err = HAL::Get(HAL::EFastCounterFrequency, freq);
         if(err != KErrNone)
             {
-            SqlPanic((TSqlPanic)err);
+            __SQLPANIC2((TSqlPanic)err);
             }
         }
     TInt64 diffTicks = (TInt64)aEndTicks - (TInt64)aStartTicks;
@@ -1011,22 +1009,22 @@
 
 void TSqlSrvResourceProfiler::StartL(const RMessage2&)
 	{
-	__SQLLEAVE(KErrNotSupported);
+	__SQLLEAVE2(KErrNotSupported);
 	}
 	
 void TSqlSrvResourceProfiler::StopL(const RMessage2&)
 	{
-	__SQLLEAVE(KErrNotSupported);
+	__SQLLEAVE2(KErrNotSupported);
 	}
 	
 void TSqlSrvResourceProfiler::ResetL(const RMessage2&)
 	{
-	__SQLLEAVE(KErrNotSupported);
+	__SQLLEAVE2(KErrNotSupported);
 	}
 	
 void TSqlSrvResourceProfiler::QueryL(const RMessage2&)
 	{
-	__SQLLEAVE(KErrNotSupported);
+	__SQLLEAVE2(KErrNotSupported);
 	}
 	
 #endif//_SQLPROFILER
--- a/persistentstorage/sql/SRC/Server/SqlSrvSession.cpp	Tue Jul 06 16:18:30 2010 +0300
+++ b/persistentstorage/sql/SRC/Server/SqlSrvSession.cpp	Wed Aug 18 11:30:17 2010 +0300
@@ -24,7 +24,12 @@
 #include "SqlSrvBlob.h"
 #include "SqlResourceProfiler.h"
 #include "SqlCompact.h"
-#include "UTraceSql.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "SqlSrvSessionTraces.h"
+#endif
+#include "SqlTraceDef.h"
+
 ///////////////////////////////////////////////////////////////////////////////////////////////////////////////
 ///////////////////////////////////////////////////////////////////////////////////////////////////////////////
 
@@ -159,7 +164,7 @@
 template <class T> T& SqlSessObjFind(RDbObjContainer<T>& aContainer, TInt aHandle, const RMessage2& aMessage)
 	{
 	T* obj = aContainer.Find(aHandle);
-	__SQLPANIC_CLIENT(obj != NULL, aMessage, ESqlPanicBadArgument);
+	__SQLPANIC_CLIENT2(obj != NULL, aMessage, ESqlPanicBadArgument);
 	return *obj;
 	}
 
@@ -183,6 +188,7 @@
 	if(aError == KSqlErrFull && !HasFreeDiskSpace(aFs, aDrive))
 		{
 		aError = KErrDiskFull;
+		SQL_TRACE_SESSION(OstTrace1(TRACE_INTERNALS, CONVERTSQLFULL2DISKFULLERRROR, "0;ConvertSqlFull2DiskFullErr;aError=KSqlErrFull;!HasFreeDiskSpace();aDrive=%d", (TInt)aDrive));
 		}
 	return aError;
 	}
@@ -206,10 +212,12 @@
 */
 CSqlSrvSession* CSqlSrvSession::NewL()
 	{
+	SQL_TRACE_SESSION(OstTrace0(TRACE_INTERNALS, CSQLSRVSESSION_NEWL_ENTRY, "Entry;0;CSqlSrvSession::NewL"));
 	CSqlSrvSession* self = new (ELeave)	CSqlSrvSession;
 	CleanupStack::PushL(self);
 	self->ConstructL();
 	CleanupStack::Pop(self);
+	SQL_TRACE_SESSION(OstTrace1(TRACE_INTERNALS, CSQLSRVSESSION_NEWL_EXIT, "Exit;0x%X;CSqlSrvSession::NewL", (TUint)self));
 	return self;
 	}
 
@@ -218,11 +226,13 @@
 */
 CSqlSrvSession::~CSqlSrvSession()
 	{
+	SQL_TRACE_SESSION(OstTraceExt2(TRACE_INTERNALS, CSQLSRVSESSION_CSQLSRVSESSION2_ENTRY, "Entry;0x%X;CSqlSrvSession::~CSqlSrvSession;iDatabase=0x%X", (TUint)this, (TUint)iDatabase));
 	StopDbTestMode();
 	DbFreeReservedSpace();
 	iIpcStreams.Close();
 	iStatements.Close();
 	delete iDatabase;
+	SQL_TRACE_SESSION(OstTrace1(TRACE_INTERNALS, CSQLSRVSESSION_CSQLSRVSESSION2_EXIT, "Exit;0x%X;CSqlSrvSession::~CSqlSrvSession", (TUint)this));
 	}
 
 /**
@@ -247,11 +257,9 @@
 		{
 		SQLPROFILER_REPORT_IPC(ESqlIpcRq, 0);
 		}
-	SYMBIAN_TRACE_SQL_EVENTS_ONLY(TPtrC8 funcName = GetIPCFuncStr(funcCode));
-	SYMBIAN_TRACE_SQL_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EBorder), KSrvMsgStr, &funcName));
-	
-	SQLPROFILER_IPC_START(iIpcCounter, iDatabase ? (TUint)iDatabase->RawDbHandle() : 0);
-	
+	__SQLTRACE_SESSIONEXPR(++iIpcCallCounter);
+    SQL_TRACE_SESSION(OstTraceExt4(TRACE_INTERNALS, CSQLSRVSESSION_SERVICEL_ENTRY, "Entry;0x%X;CSqlSrvSession::ServiceL;aMessage.Handle()=0x%X;funcCode=0x%X;iIpcCallCounter=%u", (TUint)this, (TUint)aMessage.Handle(), (TUint)funcCode, iIpcCallCounter));
+	SQLPROFILER_IPC_START(iIpcCallCounter, iDatabase ? (TUint)iDatabase->RawDbHandle() : 0);
 	switch(funcCode)
 		{
 		//////////////////////  resource check operations  ///////////////////////////
@@ -447,7 +455,7 @@
 		{
 		aMessage.Complete(retCode);
 		}
-    SQLPROFILER_IPC_END(iIpcCounter, funcCode, iDatabase ? (TUint)iDatabase->RawDbHandle() : 0, iIpcTraceData, retCode);
+	SQL_TRACE_SESSION(OstTraceExt4(TRACE_INTERNALS, CSQLSRVSESSION_SERVICEL_EXIT, "Exit;0x%X;CSqlSrvSession::ServiceL;funcCode=0x%X;retCode=%d;iIpcCallCounter=%u", (TUint)this, (TUint)funcCode, retCode, iIpcCallCounter));
 	}
 
 /**
@@ -457,6 +465,7 @@
 */
 void CSqlSrvSession::ServiceError(const RMessage2& aMessage, TInt aError)
  	{
+	SQL_TRACE_SESSION(OstTraceExt4(TRACE_INTERNALS, CSQLSRVSESSION_SERVICEERROR_ENTRY, "Entry;0x%X;CSqlSrvSession::ServiceError;aMessage.Function()=0x%X;aError=%d;iIpcCallCounter=%u", (TUint)this, (TUint)aMessage.Function(), aError, iIpcCallCounter));
 	Server().MinimizeBuffers();		
 	aError = ::ConvertSqlFull2DiskFullErr(aError, Server().FileData().Fs(), iDrive);
  	if(aError == KErrBadDescriptor)
@@ -464,15 +473,12 @@
 		//The __SQLPANIC_CLIENT() macro cannot be used here because it calls a leaving function. A leaving call
 		//from a leaving call will terminate the server.
 		_LIT(KPanicCategory, "SqlDb");
-		
-		SYMBIAN_TRACE_SQL_ERR_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EError), KSqlSrvPanicClient, aError));
 		aMessage.Panic(KPanicCategory, ESqlPanicBadDescriptor);
  		}
- 	
- 	SYMBIAN_TRACE_SQL_ERR_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EError), KSqlSrvError, aError));
- 	SQLPROFILER_IPC_ERROR(iIpcCounter, static_cast <TSqlSrvFunction> (KSqlSrvFunctionMask & aMessage.Function()), 
+ 	SQLPROFILER_IPC_ERROR(iIpcCallCounter, static_cast <TSqlSrvFunction> (KSqlSrvFunctionMask & aMessage.Function()), 
  	       iDatabase ? (TUint)iDatabase->RawDbHandle() : 0, aError);
  	CSession2::ServiceError(aMessage, aError);
+ 	SQL_TRACE_SESSION(OstTraceExt3(TRACE_INTERNALS, CSQLSRVSESSION_SERVICEERROR_EXIT, "Exit;0x%X;CSqlSrvSession::ServiceError;aMessage.Function()=0x%X;iIpcCallCounter=%u", (TUint)this, (TUint)aMessage.Function(), iIpcCallCounter));
    	}
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -726,10 +732,8 @@
 			__SQLLEAVE(KErrPermissionDenied);	
 			}
 		}
-	#ifdef _NOTIFY
-	TPtrC fname = fileData.FileName();
-	RDebug::Print(_L("--SrvSess, delete, fname=\"%S\"\r\n"), &fname);
-	#endif		
+	__SQLTRACE_SESSIONVAR(TPtrC fname(fileData.FileName()));
+	SQL_TRACE_SESSION(OstTraceExt2(TRACE_INTERNALS, CSQLSRVSESSION_DBDELETEFILEL, "0x%X;CSqlSrvSession::DbDeleteFileL;file='%S'", (TUint)this, __SQLPRNSTR(fname)));
 	__SQLLEAVE_IF_ERROR(fileData.Fs().Delete(fileData.FileName()));
 	}
 
@@ -1166,7 +1170,7 @@
 			__SQLLEAVE(KErrBadName);
 			}
 	  	}
-	 __SQLASSERT(len > 0, ESqlPanicInternalError);//The "if" above should have hanled the case with "len == 0"
+	 __ASSERT_DEBUG(len > 0, __SQLPANIC2(ESqlPanicInternalError));//The "if" above should have hanled the case with "len == 0"
 	 if((TUint)len > KMaxFileName)
 	  {
 	  __SQLLEAVE(KErrBadName);
@@ -1380,7 +1384,7 @@
 		SQLPROFILER_REPORT_IPC(ESqlIpcWrite, size);
 		}
 	__SQLLEAVE_IF_ERROR(err);
-	__SQLASSERT(err == KSqlAtRow || err == KSqlAtEnd, ESqlPanicInternalError);
+	__ASSERT_DEBUG(err == KSqlAtRow || err == KSqlAtEnd, __SQLPANIC(ESqlPanicInternalError));
 	return err;
 	}
 
@@ -1550,7 +1554,7 @@
 	aStreamBuf->PushL();
 	iIpcStreams.AllocL();
 	TInt size = aStreamBuf->SizeL();
-	__SQLASSERT(size >= 0, ESqlPanicInternalError);
+	__ASSERT_DEBUG(size >= 0, __SQLPANIC(ESqlPanicInternalError));
 	TPckgBuf<TIpcStreamBuf> ipcBuf;
     // read the first buffer-full
     TInt len = Min(size, KIpcBufSize);
--- a/persistentstorage/sql/SRC/Server/SqlSrvSession.h	Tue Jul 06 16:18:30 2010 +0300
+++ b/persistentstorage/sql/SRC/Server/SqlSrvSession.h	Wed Aug 18 11:30:17 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2005-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -135,8 +135,8 @@
 	TBool								iDriveSpaceReserved;	//True if this session reserved drive space
 	TBool								iDriveSpaceInUse;		//True if the client has been given an access to the reserved drive space
 	TDriveNumber 						iDrive;					//the drive number, where the database file is
+	TUint                               iIpcCallCounter;
 #ifdef _SQLPROFILER
-	TUint                               iIpcCounter;                                   
     TSqlSrvIpcTraceData                 iIpcTraceData[KIpcTraceTypeCount];
 #endif
 	};
--- a/persistentstorage/sql/SRC/Server/SqlSrvStatement.cpp	Tue Jul 06 16:18:30 2010 +0300
+++ b/persistentstorage/sql/SRC/Server/SqlSrvStatement.cpp	Wed Aug 18 11:30:17 2010 +0300
@@ -21,7 +21,12 @@
 #include "SqlSrvStatement.h"
 #include "SqlBufIterator.h"			//TSqlBufRIterator
 #include "SqlSrvResourceProfiler.h"
-#include "UTraceSql.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "SqlSrvStatementTraces.h"
+#endif
+#include "SqlTraceDef.h"
+
 //////////////////////////////////////////////////////////////////////////////////////////////////////
 /////////////////////////////      local const data       ////////////////////////////////////////////
 //////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -137,14 +142,16 @@
 */	
 CSqlSrvStatement* CSqlSrvStatement::NewLC(sqlite3* aDbHandle, const TDesC16& aSqlStmt, TInt& aColumnCount, TInt& aParamCount)
 	{
-	__SQLASSERT(aSqlStmt.Length() > 0 ? (TInt)aSqlStmt[aSqlStmt.Length() - 1] == 0 : ETrue, ESqlPanicBadArgument);
+    __SQLTRACE_INTERNALSEXPR(TPtrC sqlprnptr(aSqlStmt.Left(aSqlStmt.Length() - 1)));
+    SQL_TRACE_INTERNALS(OstTraceExt2(TRACE_INTERNALS, CSQLSRVSTATEMENT_NEWLC_ENTRY, "Entry;0;CSqlSrvStatement::NewLC-16;aDbHandle=0x%X;aSqlStmt=%S", (TUint)aDbHandle, __SQLPRNSTR(sqlprnptr)));
+	__ASSERT_DEBUG(aSqlStmt.Length() > 0 ? (TInt)aSqlStmt[aSqlStmt.Length() - 1] == 0 : ETrue, __SQLPANIC2(ESqlPanicBadArgument));
 	
 	CSqlSrvStatement* self = new (ELeave) CSqlSrvStatement;
 	CleanupStack::PushL(self);
 	self->ConstructL(aDbHandle, aSqlStmt);
-	SYMBIAN_TRACE_SQL_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KSrvStmtCreated, self));
 	aColumnCount = self->iColumnCount;
 	aParamCount = self->iParamCount;
+	SQL_TRACE_INTERNALS(OstTraceExt4(TRACE_INTERNALS, CSQLSRVSTATEMENT_NEWLC_EXIT, "Exit;0x%X;CSqlSrvStatement::NewLC-16;iStmtHandle=0x%X;aColumnCount=%d;aParamCount=%d", (TUint)self, (TUint)self->iStmtHandle, aColumnCount, aParamCount));
 	return self;
 	}
 	
@@ -169,14 +176,17 @@
 */	
 CSqlSrvStatement* CSqlSrvStatement::NewLC(sqlite3* aDbHandle, const TDesC8& aSqlStmt, TInt& aColumnCount, TInt& aParamCount)
 	{
-	__SQLASSERT(aSqlStmt.Length() > 0 ? (TInt)aSqlStmt[aSqlStmt.Length() - 1] == 0 : ETrue, ESqlPanicBadArgument);
+    __SQLTRACE_INTERNALSEXPR(TPtrC8 sqlprnptr(aSqlStmt.Left(aSqlStmt.Length() - 1)));
+	__SQLTRACE_INTERNALSVAR(TBuf<100> des16prnbuf);
+    SQL_TRACE_INTERNALS(OstTraceExt2(TRACE_INTERNALS, CSQLSRVSTATEMENT_NEWLC_ENTRY2, "Entry;0;CSqlSrvStatement::NewLC-8;aDbHandle=0x%X;aSqlStmt=%s", (TUint)aDbHandle, __SQLPRNSTR8(sqlprnptr, des16prnbuf)));
+	__ASSERT_DEBUG(aSqlStmt.Length() > 0 ? (TInt)aSqlStmt[aSqlStmt.Length() - 1] == 0 : ETrue, __SQLPANIC2(ESqlPanicBadArgument));
 
 	CSqlSrvStatement* self = new (ELeave) CSqlSrvStatement;
 	CleanupStack::PushL(self);
 	self->ConstructL(aDbHandle, aSqlStmt);
-	SYMBIAN_TRACE_SQL_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KSrvStmtCreated, self));
 	aColumnCount = self->iColumnCount;
 	aParamCount = self->iParamCount;
+	SQL_TRACE_INTERNALS(OstTraceExt4(TRACE_INTERNALS, CSQLSRVSTATEMENT_NEWLC_EXIT2, "Exit;0x%X;CSqlSrvStatement::NewLC-8;iStmtHandle=0x%X;aColumnCount=%d;aParamCount=%d", (TUint)self, (TUint)self->iStmtHandle, aColumnCount, aParamCount));
 	return self;
 	}
 	
@@ -185,17 +195,19 @@
 */	
 CSqlSrvStatement::~CSqlSrvStatement()
 	{
+	SQL_TRACE_INTERNALS(OstTraceExt2(TRACE_INTERNALS, CSQLSRVSTATEMENT_CSQLSRVSTATEMENT2_ENTRY, "Entry;0x%X;CSqlSrvStatement::~CSqlSrvStatement;iStmtHandle=0x%X", (TUint)this, (TUint)iStmtHandle));
 	DestroyParamBufArray();
 	iBufFlat.Close();
 	if(iStmtHandle)
 		{
-#ifdef SYMBIAN_TRACE_SQL_EVENTS
-		TInt scanCount = sqlite3_stmt_status(iStmtHandle, SQLITE_STMTSTATUS_FULLSCAN_STEP, ETrue);
-		TInt sortCount = sqlite3_stmt_status(iStmtHandle, SQLITE_STMTSTATUS_SORT, ETrue);
-		SYMBIAN_TRACE_SQL_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KSrvStmtStatus, this, scanCount, sortCount));
-#endif
+#ifdef SYMBIAN_USE_SQLITE_VERSION_3_6_4
+		__SQLTRACE_INTERNALSEXPR(TInt scanCount = sqlite3_stmt_status(iStmtHandle, SQLITE_STMTSTATUS_FULLSCAN_STEP, ETrue));
+		__SQLTRACE_INTERNALSEXPR(TInt sortCount = sqlite3_stmt_status(iStmtHandle, SQLITE_STMTSTATUS_SORT, ETrue));
+		SQL_TRACE_INTERNALS(OstTraceExt3(TRACE_INTERNALS, CSQLSRVSTATEMENT_CSQLSRVSTATEMENT2, "0x%X;CSqlSrvStatement::~CSqlSrvStatement;scan count=%d;sort count=%d", (TUint)this, scanCount, sortCount));
+#endif		
 		(void)sqlite3_finalize(iStmtHandle);
 		}
+	SQL_TRACE_INTERNALS(OstTrace1(TRACE_INTERNALS, CSQLSRVSTATEMENT_CSQLSRVSTATEMENT2_EXIT, "Exit;0x%X;CSqlSrvStatement::~CSqlSrvStatement", (TUint)this));
 	}
 
 /**
@@ -214,7 +226,7 @@
 */	
 void CSqlSrvStatement::BindL(const RSqlBufFlat& aParamBuf)
 	{
-	__SQLASSERT(iStmtHandle != NULL, ESqlPanicInvalidObj);
+	__ASSERT_DEBUG(iStmtHandle != NULL, __SQLPANIC(ESqlPanicInvalidObj));
 	
 	(void)sqlite3SymbianLastOsError();//clear last OS error
 
@@ -282,7 +294,7 @@
 */	
 const RSqlBufFlat& CSqlSrvStatement::ColumnNamesL()
 	{
-	__SQLASSERT(iStmtHandle != NULL, ESqlPanicInvalidObj);
+	__ASSERT_DEBUG(iStmtHandle != NULL, __SQLPANIC(ESqlPanicInvalidObj));
 	iBufFlatType = static_cast <TSqlBufFlatType> (-1);
 	__SQLLEAVE_IF_ERROR(iBufFlat.SetCount(iColumnCount));
 	TSqlBufWIterator it;
@@ -311,7 +323,7 @@
 */	
 const RSqlBufFlat& CSqlSrvStatement::ParamNamesL()
 	{
-	__SQLASSERT(iStmtHandle != NULL, ESqlPanicInvalidObj);
+	__ASSERT_DEBUG(iStmtHandle != NULL, __SQLPANIC(ESqlPanicInvalidObj));
 	iBufFlatType = static_cast <TSqlBufFlatType> (-1);
 	__SQLLEAVE_IF_ERROR(iBufFlat.SetCount(iParamCount));
 	TSqlBufWIterator it;
@@ -353,7 +365,7 @@
 */	
 const RSqlBufFlat& CSqlSrvStatement::ColumnValuesL()
 	{
-	__SQLASSERT(iStmtHandle != NULL, ESqlPanicInvalidObj);
+	__ASSERT_DEBUG(iStmtHandle != NULL, __SQLPANIC(ESqlPanicInvalidObj));
 	
 	iBufFlatType = static_cast <TSqlBufFlatType> (-1);
 	iBufFlat.SetCount(iColumnCount);
@@ -393,7 +405,7 @@
 					{//sqlite3_column_bytes16() already allocated the needed memory if a UTF8->UTF16 conversion
                      //had to be performed. The sqlite3_column_text16() on the next line is guaranteed to succeed.
 					const TUint16* text = reinterpret_cast <const TUint16*> (sqlite3_column_text16(iStmtHandle, colIdx));
-					__SQLASSERT(text != NULL, ESqlPanicInternalError);
+					__ASSERT_DEBUG(text != NULL, __SQLPANIC(ESqlPanicInternalError));
 					__SQLLEAVE_IF_ERROR(it.SetText(TPtrC16(text, charLength)));
 					}
 				}
@@ -415,7 +427,7 @@
 				it.SetNull();
 				break;
 			default:
-				__SQLASSERT(EFalse, ESqlPanicInternalError);
+				__ASSERT_DEBUG(EFalse, __SQLPANIC(ESqlPanicInternalError));
 				break;
 			}//end of switch(...)
 		}//end of - while(it.Next())
@@ -437,15 +449,15 @@
 */	
 TInt CSqlSrvStatement::ColumnSource(TInt aColumnIndex, TPtrC8& aColumnSource) const
 	{
-	__SQLASSERT(iStmtHandle != NULL, ESqlPanicInvalidObj);
+	__ASSERT_DEBUG(iStmtHandle != NULL, __SQLPANIC(ESqlPanicInvalidObj));
 	TInt colType = sqlite3_column_type(iStmtHandle, aColumnIndex);
 	if(colType == SQLITE_TEXT)
         {//Since the first called function after the Next() operation is always CSqlSrvStatement::ColumnValuesL(), then
          //sqlite3_column_bytes16() (called from  ColumnValuesL()) already allocated the needed memory if a UTF8->UTF16 
          //conversion had to be performed. The sqlite3_column_text16() on the next line is guaranteed to succeed.
 		const void* text = sqlite3_column_text16(iStmtHandle, aColumnIndex);
-        __SQLASSERT(text != NULL, ESqlPanicInternalError);
-		TInt length  = sqlite3_column_bytes16(iStmtHandle, aColumnIndex);
+		__ASSERT_DEBUG(text != NULL, __SQLPANIC2(ESqlPanicInternalError));
+ 		TInt length  = sqlite3_column_bytes16(iStmtHandle, aColumnIndex);
 		aColumnSource.Set(reinterpret_cast <const TUint8*> (text), length);
 		}
 	else if(colType == SQLITE_BLOB)
@@ -468,7 +480,7 @@
 */	
 void CSqlSrvStatement::DoCommonConstructL()
 	{
-	__SQLASSERT(iStmtHandle != NULL, ESqlPanicInvalidObj);
+	__ASSERT_DEBUG(iStmtHandle != NULL, __SQLPANIC(ESqlPanicInvalidObj));
 	iColumnCount = sqlite3_column_count(iStmtHandle);
 	iParamCount = sqlite3_bind_parameter_count(iStmtHandle);
 	__SQLLEAVE_IF_ERROR(iBufFlat.SetCount(Max(iColumnCount, iParamCount)));
@@ -507,10 +519,10 @@
 */
 void CSqlSrvStatement::BindParamBufL(TInt aParamIndex)
 	{
-	__SQLASSERT(iStmtHandle != NULL, ESqlPanicInvalidObj);
-	__SQLASSERT(aParamIndex >= 0 && aParamIndex < sqlite3_bind_parameter_count(iStmtHandle), ESqlPanicBadArgument);
-	__SQLASSERT(aParamIndex < iParamBufArray.Count(), ESqlPanicBadArgument);
-	__SQLASSERT(iParamBufArray[aParamIndex] != NULL, ESqlPanicBadArgument);
+	__ASSERT_DEBUG(iStmtHandle != NULL, __SQLPANIC(ESqlPanicInvalidObj));
+	__ASSERT_DEBUG(aParamIndex >= 0 && aParamIndex < sqlite3_bind_parameter_count(iStmtHandle), __SQLPANIC(ESqlPanicBadArgument));
+	__ASSERT_DEBUG(aParamIndex < iParamBufArray.Count(), __SQLPANIC(ESqlPanicBadArgument));
+	__ASSERT_DEBUG(iParamBufArray[aParamIndex] != NULL, __SQLPANIC(ESqlPanicBadArgument));
 	(void)sqlite3SymbianLastOsError();//clear last OS error
 	//Bind the parameter value.
 	//SQLITE_STATIC is used as an argument, because the text/blob data will be kept and can be used by the next bind call
@@ -546,8 +558,8 @@
 */
 TInt CSqlSrvStatement::ColumnInt(TInt aColIdx) const
 	{
-	__SQLASSERT(iStmtHandle != NULL, ESqlPanicInvalidObj);
-	__SQLASSERT((TUint)aColIdx < iColumnCount, ESqlPanicBadArgument);
+	__ASSERT_DEBUG(iStmtHandle != NULL, __SQLPANIC(ESqlPanicInvalidObj));
+	__ASSERT_DEBUG((TUint)aColIdx < iColumnCount, __SQLPANIC(ESqlPanicBadArgument));
 	TInt colType = sqlite3_column_type(iStmtHandle, aColIdx);
 	switch(colType)
 		{
@@ -586,8 +598,8 @@
 */
 TInt64 CSqlSrvStatement::ColumnInt64(TInt aColIdx) const
 	{
-	__SQLASSERT(iStmtHandle != NULL, ESqlPanicInvalidObj);
-	__SQLASSERT((TUint)aColIdx < iColumnCount, ESqlPanicBadArgument);
+	__ASSERT_DEBUG(iStmtHandle != NULL, __SQLPANIC(ESqlPanicInvalidObj));
+	__ASSERT_DEBUG((TUint)aColIdx < iColumnCount, __SQLPANIC(ESqlPanicBadArgument));
 	TInt colType = sqlite3_column_type(iStmtHandle, aColIdx);
 	switch(colType)
 		{
@@ -623,8 +635,8 @@
 */
 TReal CSqlSrvStatement::ColumnReal(TInt aColIdx) const
 	{
-	__SQLASSERT(iStmtHandle != NULL, ESqlPanicInvalidObj);
-	__SQLASSERT((TUint)aColIdx < iColumnCount, ESqlPanicBadArgument);
+	__ASSERT_DEBUG(iStmtHandle != NULL, __SQLPANIC(ESqlPanicInvalidObj));
+	__ASSERT_DEBUG((TUint)aColIdx < iColumnCount, __SQLPANIC(ESqlPanicBadArgument));
 	TInt colType = sqlite3_column_type(iStmtHandle, aColIdx);
 	switch(colType)
 		{
@@ -657,8 +669,8 @@
 */
 TPtrC CSqlSrvStatement::ColumnTextL(TInt aColIdx) const
 	{
-	__SQLASSERT(iStmtHandle != NULL, ESqlPanicInvalidObj);
-	__SQLASSERT((TUint)aColIdx < iColumnCount, ESqlPanicBadArgument);
+	__ASSERT_DEBUG(iStmtHandle != NULL, __SQLPANIC(ESqlPanicInvalidObj));
+	__ASSERT_DEBUG((TUint)aColIdx < iColumnCount, __SQLPANIC(ESqlPanicBadArgument));
 	TPtrC res;
 	TInt colType = sqlite3_column_type(iStmtHandle, aColIdx);
 	if(colType == SQLITE_TEXT)
@@ -673,8 +685,8 @@
         //sqlite3_column_bytes16() already allocated the needed memory if a UTF8->UTF16 conversion
         //had to be performed. The sqlite3_column_text16() on the next line is guaranteed to succeed.
         const TUint16* text = reinterpret_cast <const TUint16*> (sqlite3_column_text16(iStmtHandle, aColIdx));
-        __SQLASSERT(text != NULL, ESqlPanicInternalError);
-		res.Set(text, charLength);
+        __ASSERT_DEBUG(text != NULL, __SQLPANIC(ESqlPanicInternalError));
+ 		res.Set(text, charLength);
 		}
 	return res;
 	}
@@ -692,8 +704,8 @@
 */
 TPtrC8 CSqlSrvStatement::ColumnBinary(TInt aColIdx) const
 	{
-	__SQLASSERT(iStmtHandle != NULL, ESqlPanicInvalidObj);
-	__SQLASSERT((TUint)aColIdx < iColumnCount, ESqlPanicBadArgument);
+	__ASSERT_DEBUG(iStmtHandle != NULL, __SQLPANIC(ESqlPanicInvalidObj));
+	__ASSERT_DEBUG((TUint)aColIdx < iColumnCount, __SQLPANIC(ESqlPanicBadArgument));
 	TPtrC8 res;
 	TInt colType = sqlite3_column_type(iStmtHandle, aColIdx);
 	if(colType == SQLITE_BLOB)
@@ -716,8 +728,8 @@
 */
 const RSqlBufFlat& CSqlSrvStatement::GetDeclColumnTypesL()
 	{
-	__SQLASSERT(iStmtHandle != NULL, ESqlPanicInvalidObj);
-	iBufFlatType = static_cast <TSqlBufFlatType> (-1);
+    __ASSERT_DEBUG(iStmtHandle != NULL, __SQLPANIC(ESqlPanicInvalidObj));
+ 	iBufFlatType = static_cast <TSqlBufFlatType> (-1);
 	__SQLLEAVE_IF_ERROR(iBufFlat.SetCount(iColumnCount));
 	TSqlBufWIterator it;
 	it.Set(iBufFlat);
@@ -761,12 +773,12 @@
 HSqlSrvStmtParamBuf* CSqlSrvStatement::GetParamBufL(TInt aParamIndex, HSqlSrvStmtParamBuf::TDataType aDataType, 
 													HSqlSrvStmtParamBuf::TBufType aBufType)
 	{
-	__SQLASSERT(aParamIndex >= 0 && aParamIndex < sqlite3_bind_parameter_count(iStmtHandle), ESqlPanicBadArgument);
+	__ASSERT_DEBUG(aParamIndex >= 0 && aParamIndex < sqlite3_bind_parameter_count(iStmtHandle), __SQLPANIC(ESqlPanicBadArgument));
 	ExtendParamBufArrayL(aParamIndex);
 	HSqlSrvStmtParamBuf*& paramBuf = iParamBufArray[aParamIndex];
 	if(paramBuf)
 		{//Reset and reuse the existing buffer
-		__SQLASSERT(paramBuf->ParamIndex() == aParamIndex, ESqlPanicInternalError);
+		__ASSERT_DEBUG(paramBuf->ParamIndex() == aParamIndex, __SQLPANIC(ESqlPanicInternalError));
 		paramBuf->Reset(aDataType, aBufType);	
 		}
 	else
@@ -789,8 +801,8 @@
 */
 void CSqlSrvStatement::ExtendParamBufArrayL(TInt aParamIndex)
 	{
-	__SQLASSERT(iStmtHandle != NULL, ESqlPanicInvalidObj);
-	__SQLASSERT(aParamIndex >= 0 && aParamIndex < sqlite3_bind_parameter_count(iStmtHandle), ESqlPanicBadArgument);
+	__ASSERT_DEBUG(iStmtHandle != NULL, __SQLPANIC(ESqlPanicInvalidObj));
+	__ASSERT_DEBUG(aParamIndex >= 0 && aParamIndex < sqlite3_bind_parameter_count(iStmtHandle), __SQLPANIC(ESqlPanicBadArgument));
 	TInt ext = aParamIndex - iParamBufArray.Count() + 1;
 	while(ext-- > 0)
 		{
@@ -815,8 +827,8 @@
 */
 TPtrC8 CSqlSrvStatement::CopyAndStoreParamL(TInt aParamIndex, HSqlSrvStmtParamBuf::TDataType aDataType, const TDesC8& aParamValue)
 	{
-	__SQLASSERT(iStmtHandle != NULL, ESqlPanicInvalidObj);
-	__SQLASSERT(aParamIndex >= 0 && aParamIndex < sqlite3_bind_parameter_count(iStmtHandle), ESqlPanicBadArgument);
+	__ASSERT_DEBUG(iStmtHandle != NULL, __SQLPANIC(ESqlPanicInvalidObj));
+	__ASSERT_DEBUG(aParamIndex >= 0 && aParamIndex < sqlite3_bind_parameter_count(iStmtHandle), __SQLPANIC(ESqlPanicBadArgument));
 	HSqlSrvStmtParamBuf* paramBuf = GetParamBufL(aParamIndex, aDataType, HSqlSrvStmtParamBuf::EBufSimpleBind);
 	return paramBuf->SetDataL(aParamValue);
 	}
--- a/persistentstorage/sql/SRC/Server/SqlSrvStatement.inl	Tue Jul 06 16:18:30 2010 +0300
+++ b/persistentstorage/sql/SRC/Server/SqlSrvStatement.inl	Wed Aug 18 11:30:17 2010 +0300
@@ -33,7 +33,7 @@
 inline HSqlSrvStmtParamBuf* HSqlSrvStmtParamBuf::NewL(CSqlSrvStatement& aStatement, TInt aParamIndex, 
 													  HSqlSrvStmtParamBuf::TDataType aDataType, HSqlSrvStmtParamBuf::TBufType aBufType)
 	{
-	__SQLASSERT(aParamIndex >= 0, ESqlPanicBadArgument);
+	__ASSERT_DEBUG(aParamIndex >= 0, __SQLPANIC2(ESqlPanicBadArgument));
 	HSqlSrvStmtParamBuf* self = new (ELeave) HSqlSrvStmtParamBuf(aStatement, aParamIndex, aDataType, aBufType);
 	self->PushL();
 	self->ConstructL();
@@ -53,7 +53,7 @@
 */
 inline void HSqlSrvStmtParamBuf::Reset(HSqlSrvStmtParamBuf::TDataType aDataType, HSqlSrvStmtParamBuf::TBufType aBufType)
 	{
-	__SQLASSERT(iBuf != NULL, ESqlPanicInvalidObj);
+	__ASSERT_DEBUG(iBuf != NULL, __SQLPANIC(ESqlPanicInvalidObj));
 	
 	iStatementFinalized = EFalse;
 	iAlive = ETrue;
@@ -65,7 +65,7 @@
 	if(iBuf->Capacity() > (HSqlSrvStmtParamBuf::EExpandSize * 2))
 		{
 		TRAPD(err, iBuf->SetReserveL(HSqlSrvStmtParamBuf::EExpandSize * 2));//the buffer size is minimized, the call can't fail
-		__SQLASSERT_ALWAYS(err == KErrNone, ESqlPanicInternalError);
+		__ASSERT_ALWAYS(err == KErrNone, __SQLPANIC(ESqlPanicInternalError));
 		}
 	Set(*iBuf, 0, MStreamBuf::ERead | MStreamBuf::EWrite);
 	}
@@ -83,8 +83,8 @@
 */
 inline const TPtrC8 HSqlSrvStmtParamBuf::SetDataL(const TDesC8& aData)
 	{
-	__SQLASSERT(iBuf != NULL, ESqlPanicInvalidObj);
-	__SQLASSERT(iBufType == HSqlSrvStmtParamBuf::EBufSimpleBind, ESqlPanicInternalError);
+	__ASSERT_DEBUG(iBuf != NULL, __SQLPANIC(ESqlPanicInvalidObj));
+	__ASSERT_DEBUG(iBufType == HSqlSrvStmtParamBuf::EBufSimpleBind, __SQLPANIC(ESqlPanicInternalError));
 	iBuf->ResizeL(aData.Length());
 	iBuf->Write(0, aData);
 	return iBuf->Ptr(0);
@@ -99,7 +99,7 @@
 */
 inline const TPtrC8 HSqlSrvStmtParamBuf::Data() const
 	{
-	__SQLASSERT(iBuf != NULL, ESqlPanicInvalidObj);
+	__ASSERT_DEBUG(iBuf != NULL, __SQLPANIC(ESqlPanicInvalidObj));
 	return iBuf->Ptr(0);
 	}
 
@@ -120,7 +120,7 @@
 */
 inline TInt HSqlSrvStmtParamBuf::ParamIndex() const
 	{
-	__SQLASSERT(iParamIndex >= 0, ESqlPanicInternalError);
+	__ASSERT_DEBUG(iParamIndex >= 0, __SQLPANIC(ESqlPanicInternalError));
 	return iParamIndex;
 	}
 
@@ -180,7 +180,7 @@
 */	
 inline TInt CSqlSrvStatement::Next()
 	{
-	__SQLASSERT(iStmtHandle != NULL, ESqlPanicInvalidObj);
+	__ASSERT_DEBUG(iStmtHandle != NULL, __SQLPANIC(ESqlPanicInvalidObj));
 	TInt err = ::StmtNext(iStmtHandle);
 	iBufFlatType = static_cast <TSqlBufFlatType> (-1);
 	iBufFlat.ResetAndMinimize();
@@ -200,7 +200,7 @@
 */	
 inline TInt CSqlSrvStatement::Reset()
 	{
-	__SQLASSERT(iStmtHandle != NULL, ESqlPanicInvalidObj);
+	__ASSERT_DEBUG(iStmtHandle != NULL, __SQLPANIC(ESqlPanicInvalidObj));
 	iBufFlatType = static_cast <TSqlBufFlatType> (-1);
 	iBufFlat.ResetAndMinimize();
 	return ::StmtReset(iStmtHandle);
@@ -219,7 +219,7 @@
 */	
 inline TInt CSqlSrvStatement::Exec()
 	{
-	__SQLASSERT(iStmtHandle != NULL, ESqlPanicInvalidObj);
+	__ASSERT_DEBUG(iStmtHandle != NULL, __SQLPANIC(ESqlPanicInvalidObj));
 	TInt err = ::StmtExec(iStmtHandle);
 	iBufFlatType = static_cast <TSqlBufFlatType> (-1);
 	iBufFlat.ResetAndMinimize();
@@ -231,7 +231,7 @@
 */
 inline const RSqlBufFlat& CSqlSrvStatement::BufFlatL(TSqlBufFlatType aWhat) const
 	{
-	__SQLASSERT(iStmtHandle != NULL, ESqlPanicInvalidObj);
+	__ASSERT_DEBUG(iStmtHandle != NULL, __SQLPANIC(ESqlPanicInvalidObj));
 	if(aWhat != iBufFlatType)
 		{
 		__SQLLEAVE(KErrArgument);
@@ -260,7 +260,7 @@
 */	
 inline void CSqlSrvStatement::ConstructL(sqlite3* aDbHandle, const TDesC16& aSqlStmt)
 	{
-	__SQLASSERT(aDbHandle != NULL, ESqlPanicBadArgument);
+	__ASSERT_DEBUG(aDbHandle != NULL, __SQLPANIC(ESqlPanicBadArgument));
 	iStmtHandle = ::StmtPrepare16L(aDbHandle, aSqlStmt);
 	DoCommonConstructL();
 	}
@@ -280,7 +280,7 @@
 */	
 inline void CSqlSrvStatement::ConstructL(sqlite3* aDbHandle, const TDesC8& aSqlStmt)
 	{
-	__SQLASSERT(aDbHandle != NULL, ESqlPanicBadArgument);
+	__ASSERT_DEBUG(aDbHandle != NULL, __SQLPANIC(ESqlPanicBadArgument));
 	iStmtHandle = ::StmtPrepare8L(aDbHandle, aSqlStmt);
 	DoCommonConstructL();
 	}
--- a/persistentstorage/sql/SRC/Server/SqlSrvStatementUtil.cpp	Tue Jul 06 16:18:30 2010 +0300
+++ b/persistentstorage/sql/SRC/Server/SqlSrvStatementUtil.cpp	Wed Aug 18 11:30:17 2010 +0300
@@ -18,11 +18,16 @@
 #include <sqldb.h>
 #include "sqlite3.h"
 #include "SqlSrvStatementUtil.h"
-#include "SqlPanic.h"
+#include "SqlAssert.h"
 #include "SqlSrvUtil.h"
 #include "SqlUtil.h"
 #include "SqliteSymbian.h"		//sqlite3SymbianLastOsError()
+#include "OstTraceDefinitions.h"
 #include "SqlSrvResourceProfiler.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "SqlSrvStatementUtilTraces.h"
+#endif
+#include "SqlTraceDef.h"
 
 //The database names in all statements are quoted to avoid the "sql injection" threat.
 _LIT8(KPageCountPragma, "PRAGMA \"%S\".page_count\x0");
@@ -35,109 +40,6 @@
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////////////////
 
-#ifdef _NOTIFY
-static void PrintErrMsg8(TBool aCondition, sqlite3* aDbHandle, const char* aFuncNameZ, const TDesC8& aStmt)
-	{
-	if(!aCondition)
-		{
-		return;	
-		}
-	TPtrC8 funcName8(reinterpret_cast <const TUint8*> (aFuncNameZ));
-	TBuf<32> funcName;
-	funcName.Copy(funcName8);
-	RDebug::Print(_L("###%S\r\n"), &funcName);
-	TInt stmtLen = aStmt.Length();
-	if(stmtLen > 0)
-		{
-		if(aStmt[stmtLen - 1] == 0)
-			{
-			--stmtLen;
-			}
-		HBufC* buf = HBufC::New(stmtLen);
-		if(buf)
-			{
-			TPtr sqlStmt = buf->Des();
-			sqlStmt.Copy(aStmt.Left(stmtLen));
-			if(sqlStmt.Length() > 250)
-				{
-				sqlStmt.SetLength(250);		
-				}
-			RDebug::Print(_L("###\"%S\"\r\n"), &sqlStmt);
-			delete buf;
-			}
-		}
-	TBuf<16> tbuf;
-	Util::GetTimeStr(tbuf);
-	const void* errMsg = sqlite3_errmsg16(aDbHandle);//"errMsg" - zero terminated string
-	if(errMsg)
-		{
-		TPtrC msg(reinterpret_cast <const TText16*> (errMsg));//terminating zero character excluded.
-		if(msg.Length() > 230)
-			{
-			msg.Set(msg.Left(230));		
-			}
-		RDebug::Print(_L("##%S#ErrMsg=%S\r\n"), &tbuf, &msg);
-		}
-	else
-		{
-		RDebug::Print(_L("##%S#ErrMsg=null\r\n"), &tbuf);
-		}
-	}
-	
-static void PrintErrMsg16(TBool aCondition, sqlite3* aDbHandle, const char* aFuncNameZ, const TDesC16& aStmt)
-	{
-	if(!aCondition)
-		{
-		return;	
-		}
-	TPtrC8 funcName8(reinterpret_cast <const TUint8*> (aFuncNameZ));
-	TBuf<32> funcName;
-	funcName.Copy(funcName8);
-	RDebug::Print(_L("###%S\r\n"), &funcName);
-	TInt stmtLen = aStmt.Length();
-	if(stmtLen > 0)
-		{
-		if(aStmt[stmtLen - 1] == 0)
-			{
-			--stmtLen;
-			}
-		TPtrC sqlStmt(aStmt.Ptr(), stmtLen);
-		if(sqlStmt.Length() > 250)
-			{
-			sqlStmt.Set(sqlStmt.Left(250));		
-			}
-		RDebug::Print(_L("###\"%S\"\r\n"), &sqlStmt);
-		}
-	TBuf<16> tbuf;
-	Util::GetTimeStr(tbuf);
-	const void* errMsg = sqlite3_errmsg16(aDbHandle);//"errMsg" - zero terminated string
-	if(errMsg)
-		{
-		TPtrC msg(reinterpret_cast <const TText16*> (errMsg));//terminating zero character excluded.
-		if(msg.Length() > 230)
-			{
-			msg.Set(msg.Left(230));		
-			}
-		RDebug::Print(_L("##%S#ErrMsg=%S\r\n"), &tbuf, &msg);
-		}
-	else
-		{
-		RDebug::Print(_L("##%S#ErrMsg=null\r\n"), &tbuf);
-		}
-	}
-
-#define PRINT_ERRMSG8(Condition, DbHandle, FuncNameZ, Stmt) PrintErrMsg8(Condition, DbHandle, FuncNameZ, Stmt)
-#define PRINT_ERRMSG16(Condition, DbHandle, FuncNameZ, Stmt) PrintErrMsg16(Condition, DbHandle, FuncNameZ, Stmt)
-
-#else  //_NOTIFY
-
-#define PRINT_ERRMSG8(Condition, DbHandle, FuncNameZ, Stmt) 
-#define PRINT_ERRMSG16(Condition, DbHandle, FuncNameZ, Stmt) 
-	
-#endif //_NOTIFY
-
-///////////////////////////////////////////////////////////////////////////////////////////////////////////////
-
 //Calls sqlite3_open16() to create or open database file with aFileNameZ.
 //aFileNameZ is UTF16 encoded, zero-terminated.
 //The function returns system-wide errors or database specific errors.
@@ -146,7 +48,7 @@
 	{
 	(void)sqlite3SymbianLastOsError();//clear last OS error
 	TInt err = sqlite3_open16(aFileNameZ.Ptr(), &aDbHandle);
-	__SQLASSERT(err == SQLITE_OK ? aDbHandle != NULL : ETrue, ESqlPanicInternalError);
+	__ASSERT_DEBUG(err == SQLITE_OK ? aDbHandle != NULL : ETrue, __SQLPANIC2(ESqlPanicInternalError));
 	if(err == SQLITE_OK)
 		{
 		(void)sqlite3_extended_result_codes(aDbHandle, 0);
@@ -169,7 +71,7 @@
 	{
 	(void)sqlite3SymbianLastOsError();//clear last OS error
 	TInt err = sqlite3_open((const char *) aFileNameZ.Ptr(), &aDbHandle);
-	__SQLASSERT(err == SQLITE_OK ? aDbHandle != NULL : ETrue, ESqlPanicInternalError);
+	__ASSERT_DEBUG(err == SQLITE_OK ? aDbHandle != NULL : ETrue, __SQLPANIC2(ESqlPanicInternalError));
 	if(err == SQLITE_OK)
 		{
 		(void)sqlite3_extended_result_codes(aDbHandle, 0);
@@ -202,15 +104,15 @@
 //If the function fails then it returns one of the SQLITE error codes.
 static TInt DoSingleStmtExec16(sqlite3 *aDbHandle, const TDesC16& aSql)
 	{
-	__SQLASSERT(aDbHandle != NULL, ESqlPanicInvalidObj);
-	__SQLASSERT(aSql.Length() > 0 ? (TInt)aSql[aSql.Length() - 1] == 0 : ETrue, ESqlPanicBadArgument);
+    __ASSERT_DEBUG(aDbHandle != NULL, __SQLPANIC2(ESqlPanicInvalidObj));
+    __ASSERT_DEBUG(aSql.Length() > 0 ? (TInt)aSql[aSql.Length() - 1] == 0 : ETrue, __SQLPANIC2(ESqlPanicBadArgument));
 	sqlite3_stmt* stmtHandle = NULL;
 	const void* stmtTail = NULL;
     //sqlite3_prepare16_v2() expects parameter #3 to be one of the following:
     // - byte length of the sql statement (parameter #2), excluding terminating zero;
     // - negative value - the sql statement (parameter #2) is zero-terminated;
 	TInt err = sqlite3_prepare16_v2(aDbHandle, aSql.Ptr(), aSql.Length() * sizeof(TUint16) - sizeof(TUint16), &stmtHandle, &stmtTail);
-	__SQLASSERT(err == SQLITE_OK ? !stmtTail || User::StringLength((const TUint16*)stmtTail) == 0 : !stmtHandle, ESqlPanicInternalError);
+	__ASSERT_DEBUG(err == SQLITE_OK ? !stmtTail || User::StringLength((const TUint16*)stmtTail) == 0 : !stmtHandle, __SQLPANIC2(ESqlPanicInternalError));
 	if(stmtHandle)	//stmtHandle can be NULL for statements like this: ";".
 		{
 		if(err == SQLITE_OK)
@@ -221,7 +123,7 @@
 			if(err == SQLITE_ERROR)	//It may be "out of memory" problem
 				{
 				err = sqlite3_reset(stmtHandle);
-				__SQLASSERT(err != SQLITE_OK, ESqlPanicInternalError);
+				__ASSERT_DEBUG(err != SQLITE_OK, __SQLPANIC2(ESqlPanicInternalError));
 				}
 			}
 		(void)sqlite3_finalize(stmtHandle);//sqlite3_finalize() fails only if an invalid statement handle is passed.
@@ -300,10 +202,13 @@
 
 @internalComponent
 */
-TInt DbExecStmt16(sqlite3 *aDbHandle, TDes16& aSqlStmt)
+TInt DbExecStmt16(sqlite3* aDbHandle, TDes16& aSqlStmt)
 	{
-	__SQLASSERT(aDbHandle != NULL, ESqlPanicInternalError);
-	__SQLASSERT(aSqlStmt.Length() > 0 ? (TInt)aSqlStmt[aSqlStmt.Length() - 1] == 0: ETrue, ESqlPanicBadArgument);
+    __SQLTRACE_INTERNALSEXPR(TPtrC sqlprnptr(aSqlStmt.Left(aSqlStmt.Length() - 1)));
+    SQL_TRACE_INTERNALS(OstTraceExt2(TRACE_INTERNALS, DBEXECSTMT16_ENTRY, "Entry;0x%X;DbExecStmt16;sql=%S", (TUint)aDbHandle, __SQLPRNSTR(sqlprnptr)));
+	
+	__ASSERT_DEBUG(aDbHandle != NULL, __SQLPANIC2(ESqlPanicInternalError));
+	__ASSERT_DEBUG(aSqlStmt.Length() > 0 ? (TInt)aSqlStmt[aSqlStmt.Length() - 1] == 0: ETrue, __SQLPANIC2(ESqlPanicBadArgument));
 
 	(void)sqlite3SymbianLastOsError();//clear last OS error
 	
@@ -325,7 +230,7 @@
 		{
 		err = KErrNone;	
 		}
-	PRINT_ERRMSG16(err <= KSqlErrGeneral, aDbHandle, "DbExecStmt16()", aSqlStmt);
+	SQL_TRACE_INTERNALS(OstTraceExt2(TRACE_INTERNALS, DBEXECSTMT16_EXIT, "Exit;0x%X;DbExecStmt16;err=%d", (TUint)aDbHandle, err));
 	return err;
 	}
 
@@ -349,10 +254,14 @@
 
 @internalComponent
 */
-TInt DbExecStmt8(sqlite3 *aDbHandle, const TDesC8& aSqlStmt)
+TInt DbExecStmt8(sqlite3* aDbHandle, const TDesC8& aSqlStmt)
 	{
-	__SQLASSERT(aDbHandle != NULL, ESqlPanicInternalError);
-	__SQLASSERT(aSqlStmt.Length() > 0 ? (TInt)aSqlStmt[aSqlStmt.Length() - 1] == 0: ETrue, ESqlPanicBadArgument);
+    __SQLTRACE_INTERNALSEXPR(TPtrC8 sqlprnptr(aSqlStmt.Left(aSqlStmt.Length() - 1)));
+	__SQLTRACE_INTERNALSVAR(TBuf<100> des16prnbuf);
+    SQL_TRACE_INTERNALS(OstTraceExt2(TRACE_INTERNALS, DBEXECSTMT8_ENTRY, "Entry;0x%X;DbExecStmt8;sql=%s", (TUint)aDbHandle, __SQLPRNSTR8(sqlprnptr, des16prnbuf)));
+    
+	__ASSERT_DEBUG(aDbHandle != NULL, __SQLPANIC2(ESqlPanicInternalError));
+	__ASSERT_DEBUG(aSqlStmt.Length() > 0 ? (TInt)aSqlStmt[aSqlStmt.Length() - 1] == 0: ETrue, __SQLPANIC2(ESqlPanicBadArgument));
 
     SQLPROFILER_SQL8_PRINT((TUint)aDbHandle, aSqlStmt.Left(aSqlStmt.Length() - 1), EFalse);
 	
@@ -365,7 +274,7 @@
 		{
 		err = KErrNone;	
 		}
-	PRINT_ERRMSG8(err <= KSqlErrGeneral, aDbHandle, "DbExecStmt8()", aSqlStmt);
+	SQL_TRACE_INTERNALS(OstTraceExt2(TRACE_INTERNALS, DBEXECSTMT8_EXIT, "Exit;0x%X;DbExecStmt8;err=%d", (TUint)aDbHandle, err));
 	return err;
 	}
 
@@ -385,8 +294,7 @@
     // - negative value - the sql statement (parameter #2) is zero-terminated;
 	TInt err = sqlite3_prepare16_v2(aDbHandle, aStmt.Ptr(), aStmt.Length() * sizeof(TUint16) - sizeof(TUint16), aStmtHandle, &stmtTail);
 	aHasTail = stmtTail && static_cast <const TUint16*> (stmtTail)[0] != 0;
-	PRINT_ERRMSG16(err != SQLITE_OK, aDbHandle, "DoPrepareStmt16()", aStmt);
-	__SQLASSERT(err != SQLITE_OK ? !(*aStmtHandle) : ETrue, ESqlPanicInternalError);
+	__ASSERT_DEBUG(err != SQLITE_OK ? !(*aStmtHandle) : ETrue, __SQLPANIC2(ESqlPanicInternalError));
 	//(*aStmtHandle) is NULL for ";" statements, when err == SQLITE_OK. Since the server should not panic
 	//that situation is handled later (not inside the assert above)
 	return err;
@@ -404,8 +312,7 @@
     // - negative value - the sql statement (parameter #2) is zero-terminated;
 	TInt err = sqlite3_prepare_v2(aDbHandle, reinterpret_cast <const char*> (aStmt), -1, aStmtHandle, &stmtTail);
 	aHasTail = stmtTail && stmtTail[0] != 0;
-	PRINT_ERRMSG8(err != SQLITE_OK, aDbHandle, "DoPrepareStmt8()", TPtrC8(aStmt, aStmt ? User::StringLength(aStmt) : 0));
-	__SQLASSERT(err != SQLITE_OK ? !(*aStmtHandle) : ETrue, ESqlPanicInternalError);
+	__ASSERT_DEBUG(err != SQLITE_OK ? !(*aStmtHandle) : ETrue, __SQLPANIC2(ESqlPanicInternalError));
 	//(*aStmtHandle) is NULL for ";" statements, when err == SQLITE_OK. Since the server should not panic
 	//that situation is handled later (not inside the assert above)
 	return err;
@@ -451,7 +358,7 @@
 //
 static void LeaveIfPrepareErrorL(TInt aSqliteError, TBool aHasTail, sqlite3_stmt* aStmtHandle)
 	{
-	__SQLLEAVE_IF_ERROR(ProcessPrepareError(aSqliteError, aHasTail, aStmtHandle));
+	__SQLLEAVE_IF_ERROR2(ProcessPrepareError(aSqliteError, aHasTail, aStmtHandle));
 	}
 
 /**
@@ -469,13 +376,14 @@
 */
 sqlite3_stmt* StmtPrepare16L(sqlite3* aDbHandle, const TDesC16& aSqlStmt)
 	{
-    SQLPROFILER_SQL16_PRINT((TUint)aDbHandle, aSqlStmt.Left(aSqlStmt.Length() - 1), ETrue);
-	
+    __SQLTRACE_INTERNALSEXPR(TPtrC sqlprnptr(aSqlStmt.Left(aSqlStmt.Length() - 1)));
+    SQL_TRACE_INTERNALS(OstTraceExt2(TRACE_INTERNALS, STMTPREPARE16L_ENTRY, "Entry;0x%X;StmtPrepare16L;sql=%S", (TUint)aDbHandle, __SQLPRNSTR(sqlprnptr)));	
 	(void)sqlite3SymbianLastOsError();//clear last OS error
 	TBool hasTail = EFalse;
 	sqlite3_stmt* stmtHandle = NULL;
 	TInt err = DoPrepareStmt16(aDbHandle, aSqlStmt, &stmtHandle, hasTail);
 	LeaveIfPrepareErrorL(err, hasTail, stmtHandle);
+	SQL_TRACE_INTERNALS(OstTraceExt2(TRACE_INTERNALS, STMTPREPARE16L_EXIT, "Exit;0x%X;StmtPrepare16L;stmtHandle=0x%X", (TUint)aDbHandle, (TUint)stmtHandle)); 
 	return stmtHandle;
 	}
 
@@ -494,12 +402,15 @@
 */
 TInt StmtPrepare8(sqlite3* aDbHandle, const TDesC8& aSqlStmt, sqlite3_stmt*& aStmtHandle)
 	{
-    SQLPROFILER_SQL8_PRINT((TUint)aDbHandle, aSqlStmt.Left(aSqlStmt.Length() - 1), ETrue);
-	
+    __SQLTRACE_INTERNALSEXPR(TPtrC8 sqlprnptr(aSqlStmt.Left(aSqlStmt.Length() - 1)));
+	__SQLTRACE_INTERNALSVAR(TBuf<100> des16prnbuf);
+    SQL_TRACE_INTERNALS(OstTraceExt2(TRACE_INTERNALS, STMTPREPARE8_ENTRY, "Entry;0x%X;StmtPrepare8;sql=%s", (TUint)aDbHandle, __SQLPRNSTR8(sqlprnptr, des16prnbuf))); 
 	(void)sqlite3SymbianLastOsError();//clear last OS error
 	TBool hasTail = EFalse;
 	TInt err = DoPrepareStmt8(aDbHandle, aSqlStmt.Ptr(), &aStmtHandle, hasTail);
-	return ProcessPrepareError(err, hasTail, aStmtHandle);
+	err = ProcessPrepareError(err, hasTail, aStmtHandle);
+	SQL_TRACE_INTERNALS(OstTraceExt3(TRACE_INTERNALS, STMTPREPARE8_EXIT, "Exit;0x%X;StmtPrepare8;aStmtHandle=0x%X;err=%d", (TUint)aDbHandle, (TUint)aStmtHandle, err)); 
+	return err;
 	}
 
 /**
@@ -517,13 +428,15 @@
 */
 sqlite3_stmt* StmtPrepare8L(sqlite3* aDbHandle, const TDesC8& aSqlStmt)
 	{
-    SQLPROFILER_SQL8_PRINT((TUint)aDbHandle, aSqlStmt.Left(aSqlStmt.Length() - 1), ETrue);
-	
+    __SQLTRACE_INTERNALSEXPR(TPtrC8 sqlprnptr(aSqlStmt.Left(aSqlStmt.Length() - 1)));
+	__SQLTRACE_INTERNALSVAR(TBuf<100> des16prnbuf);
+    SQL_TRACE_INTERNALS(OstTraceExt2(TRACE_INTERNALS, STMTPREPARE8L_ENTRY, "Entry;0x%X;StmtPrepare8L;sql=%s", (TUint)aDbHandle, __SQLPRNSTR8(sqlprnptr, des16prnbuf))); 
 	(void)sqlite3SymbianLastOsError();//clear last OS error
 	TBool hasTail = EFalse;
 	sqlite3_stmt* stmtHandle = NULL;
 	TInt err = DoPrepareStmt8(aDbHandle, aSqlStmt.Ptr(), &stmtHandle, hasTail);
 	LeaveIfPrepareErrorL(err, hasTail, stmtHandle);
+	SQL_TRACE_INTERNALS(OstTraceExt2(TRACE_INTERNALS, STMTPREPARE8L_EXIT, "Exit;0x%X;StmtPrepare8L;stmtHandle=0x%X", (TUint)aDbHandle, (TUint)stmtHandle)); 
 	return stmtHandle;
 	}
 
@@ -544,7 +457,8 @@
 */	
 TInt StmtExec(sqlite3_stmt* aStmtHandle)
 	{
-	__SQLASSERT(aStmtHandle != NULL, ESqlPanicInvalidObj);
+	SQL_TRACE_INTERNALS(OstTraceExt2(TRACE_INTERNALS, STMTEXEC_ENTRY, "Entry;0x%X;StmtExec;aStmtHandle=0x%X", (TUint)sqlite3_db_handle(aStmtHandle), (TUint)aStmtHandle));
+	__ASSERT_DEBUG(aStmtHandle != NULL, __SQLPANIC2(ESqlPanicInvalidObj));
 	
 	(void)sqlite3SymbianLastOsError();//clear last OS error
 
@@ -556,7 +470,7 @@
 	if(err == SQLITE_ERROR)	//It may be "out of memory" problem
 		{
 		err = sqlite3_reset(aStmtHandle);
-		__SQLASSERT(err != SQLITE_OK, ESqlPanicInternalError);
+		__ASSERT_DEBUG(err != SQLITE_OK, __SQLPANIC2(ESqlPanicInternalError));
 		}
 		
 	err = ::Sql2OsErrCode(err, sqlite3SymbianLastOsError());
@@ -565,7 +479,7 @@
 		err = KErrNone;	
 		}
 
-	PRINT_ERRMSG16(err <= KSqlErrGeneral, sqlite3_db_handle(aStmtHandle), "StmtExec()", _L(" "));
+	SQL_TRACE_INTERNALS(OstTraceExt3(TRACE_INTERNALS, STMTEXEC_EXIT, "Exit;0x%X;StmtExec;aStmtHandle=0x%X;err=%d", (TUint)sqlite3_db_handle(aStmtHandle), (TUint)aStmtHandle, err));
 	return err;
 	}
 
@@ -588,7 +502,8 @@
 */	
 TInt StmtNext(sqlite3_stmt* aStmtHandle)
 	{
-	__SQLASSERT(aStmtHandle != NULL, ESqlPanicInvalidObj);
+	SQL_TRACE_INTERNALS(OstTraceExt2(TRACE_INTERNALS, STMTNEXT_ENTRY, "Entry;0x%X;StmtNext;aStmtHandle=0x%X", (TUint)sqlite3_db_handle(aStmtHandle), (TUint)aStmtHandle));
+	__ASSERT_DEBUG(aStmtHandle != NULL, __SQLPANIC2(ESqlPanicInvalidObj));
 	
 	(void)sqlite3SymbianLastOsError();//clear last OS error
 	
@@ -596,10 +511,10 @@
 	if(err == SQLITE_ERROR)	//It may be "out of memory" problem
 		{
 		err = sqlite3_reset(aStmtHandle);
-		__SQLASSERT(err != SQLITE_OK, ESqlPanicInternalError);
+		__ASSERT_DEBUG(err != SQLITE_OK, __SQLPANIC2(ESqlPanicInternalError));
 		}
 	err = ::Sql2OsErrCode(err, sqlite3SymbianLastOsError());
-	PRINT_ERRMSG16(err <= KSqlErrGeneral, sqlite3_db_handle(aStmtHandle), "StmtNext()", _L(" "));
+	SQL_TRACE_INTERNALS(OstTraceExt3(TRACE_INTERNALS, STMTNEXT_EXIT, "Exit;0x%X;StmtNext;aStmtHandle=0x%X;err=%d", (TUint)sqlite3_db_handle(aStmtHandle), (TUint)aStmtHandle, err));
 	return err;
 	}
 
@@ -617,12 +532,15 @@
 */	
 TInt StmtReset(sqlite3_stmt* aStmtHandle)
 	{
-	__SQLASSERT(aStmtHandle != NULL, ESqlPanicInvalidObj);
+	SQL_TRACE_INTERNALS(OstTraceExt2(TRACE_INTERNALS, STMTRESET_ENTRY, "Entry;0x%X;StmtReset;aStmtHandle=0x%X", (TUint)sqlite3_db_handle(aStmtHandle), (TUint)aStmtHandle));
+	__ASSERT_DEBUG(aStmtHandle != NULL, __SQLPANIC2(ESqlPanicInvalidObj));
 	
 	(void)sqlite3SymbianLastOsError();//clear last OS error
 	
 	TInt err = sqlite3_reset(aStmtHandle);
-	return ::Sql2OsErrCode(err, sqlite3SymbianLastOsError());
+	err = ::Sql2OsErrCode(err, sqlite3SymbianLastOsError());
+	SQL_TRACE_INTERNALS(OstTraceExt3(TRACE_INTERNALS, STMTRESET_EXIT, "Exit;0x%X;StmtReset;aStmtHandle=0x%X;err=%d", (TUint)sqlite3_db_handle(aStmtHandle), (TUint)aStmtHandle, err));
+	return err;
 	}
 
 /**
@@ -644,12 +562,16 @@
 */
 static TInt PreRetrievePragmaValue(sqlite3* aDbHandle, const TDesC& aDbName, const TDesC8& aPragmaSql, sqlite3_stmt*& aStmtHandle)
 	{
-	__SQLASSERT(aDbHandle != NULL, ESqlPanicInternalError);
-	__SQLASSERT(aPragmaSql.Length() > 0, ESqlPanicBadArgument);
-	__SQLASSERT(aPragmaSql[aPragmaSql.Length() - 1] == 0, ESqlPanicBadArgument);
+    __SQLTRACE_INTERNALSEXPR(TPtrC8 sqlprnptr(aPragmaSql.Left(aPragmaSql.Length() - 1)));
+	__SQLTRACE_INTERNALSVAR(TBuf<100> des16prnbuf);
+    SQL_TRACE_INTERNALS(OstTraceExt3(TRACE_INTERNALS, PRERETRIEVEPRAGMAVALUE_ENTRY, "Entry;0x%X;PreRetrievePragmaValue;aDbName=%S;aPragmaSql=%s", (TUint)aDbHandle, __SQLPRNSTR(aDbName), __SQLPRNSTR8(sqlprnptr, des16prnbuf)));
+	__ASSERT_DEBUG(aDbHandle != NULL, __SQLPANIC2(ESqlPanicInternalError));
+	__ASSERT_DEBUG(aPragmaSql.Length() > 0, __SQLPANIC2(ESqlPanicBadArgument));
+	__ASSERT_DEBUG(aPragmaSql[aPragmaSql.Length() - 1] == 0, __SQLPANIC2(ESqlPanicBadArgument));
 	TBuf8<KMaxFileName> dbName;
 	if(!UTF16ToUTF8(aDbName, dbName))
 		{
+		SQL_TRACE_INTERNALS(OstTrace1(TRACE_INTERNALS, PRERETRIEVEPRAGMAVALUE_EXIT1, "Exit;0x%X;PreRetrievePragmaValue;err=KErrGeneral", (TUint)aDbHandle));
 		return KErrGeneral;
 		}
 	TBuf8<KMaxFileName + 64> sql;//64 characters is enough for the longest PRAGMA statement
@@ -665,10 +587,10 @@
 	TInt err = ::StmtPrepare8(aDbHandle, sql, aStmtHandle);
 	if(err == KErrNone)
 		{
-		__SQLASSERT(aStmtHandle != NULL, ESqlPanicInvalidObj);
+		__ASSERT_DEBUG(aStmtHandle != NULL, __SQLPANIC2(ESqlPanicInvalidObj));
 		err = ::StmtNext(aStmtHandle);
 		}
-	PRINT_ERRMSG8(err <= KSqlErrGeneral, aDbHandle, "PreRetrievePragmaValue()", sql);
+	SQL_TRACE_INTERNALS(OstTraceExt3(TRACE_INTERNALS, PRERETRIEVEPRAGMAVALUE_EXIT2, "Exit;0x%X;PreRetrievePragmaValue;aStmtHandle=0x%X;err=%d", (TUint)aDbHandle, (TUint)aStmtHandle, err));
 	return err;
 	}
 
@@ -691,9 +613,9 @@
 */
 static TInt RetrievePragmaValue(sqlite3* aDbHandle, const TDesC& aDbName, const TDesC8& aPragmaSql, TInt& aPragmaValue)
 	{
-	__SQLASSERT(aDbHandle != NULL, ESqlPanicInternalError);
-	__SQLASSERT(aPragmaSql.Length() > 0, ESqlPanicBadArgument);
-	__SQLASSERT(aPragmaSql[aPragmaSql.Length() - 1] == 0, ESqlPanicBadArgument);
+	__ASSERT_DEBUG(aDbHandle != NULL, __SQLPANIC2(ESqlPanicInternalError));
+	__ASSERT_DEBUG(aPragmaSql.Length() > 0, __SQLPANIC2(ESqlPanicBadArgument));
+	__ASSERT_DEBUG(aPragmaSql[aPragmaSql.Length() - 1] == 0, __SQLPANIC2(ESqlPanicBadArgument));
 	sqlite3_stmt* stmtHandle = NULL;
 	TInt err = PreRetrievePragmaValue(aDbHandle, aDbName, aPragmaSql, stmtHandle);
 	if(err == KSqlAtRow)
@@ -724,9 +646,9 @@
 */
 static TInt RetrievePragmaValue(sqlite3* aDbHandle, const TDesC& aDbName, const TDesC8& aPragmaSql, TDes8& aPragmaValue)
 	{
-	__SQLASSERT(aDbHandle != NULL, ESqlPanicInternalError);
-	__SQLASSERT(aPragmaSql.Length() > 0, ESqlPanicBadArgument);
-	__SQLASSERT(aPragmaSql[aPragmaSql.Length() - 1] == 0, ESqlPanicBadArgument);
+	__ASSERT_DEBUG(aDbHandle != NULL, __SQLPANIC2(ESqlPanicInternalError));
+	__ASSERT_DEBUG(aPragmaSql.Length() > 0, __SQLPANIC2(ESqlPanicBadArgument));
+	__ASSERT_DEBUG(aPragmaSql[aPragmaSql.Length() - 1] == 0, __SQLPANIC2(ESqlPanicBadArgument));
 	sqlite3_stmt* stmtHandle = NULL;
 	TInt err = PreRetrievePragmaValue(aDbHandle, aDbName, aPragmaSql, stmtHandle);
 	if(err == KSqlAtRow)
@@ -756,7 +678,7 @@
 */
 TInt DbPageCount(sqlite3* aDbHandle, const TDesC& aDbName, TInt& aPageCount)
 	{
-	__SQLASSERT(aDbHandle != NULL, ESqlPanicInternalError);
+	__ASSERT_DEBUG(aDbHandle != NULL, __SQLPANIC2(ESqlPanicInternalError));
 	return RetrievePragmaValue(aDbHandle, aDbName, KPageCountPragma, aPageCount);
 	}
 
@@ -777,7 +699,7 @@
 */
 TInt DbPageSize(sqlite3* aDbHandle, const TDesC& aDbName, TInt& aPageSize)
 	{
-	__SQLASSERT(aDbHandle != NULL, ESqlPanicInternalError);
+	__ASSERT_DEBUG(aDbHandle != NULL, __SQLPANIC2(ESqlPanicInternalError));
 	return RetrievePragmaValue(aDbHandle, aDbName, KPageSizePragma, aPageSize);
 	}
 
@@ -798,7 +720,7 @@
 */
 TInt DbCacheSize(sqlite3* aDbHandle, const TDesC& aDbName, TInt& aCacheSize)
 	{
-	__SQLASSERT(aDbHandle != NULL, ESqlPanicInternalError);
+	__ASSERT_DEBUG(aDbHandle != NULL, __SQLPANIC2(ESqlPanicInternalError));
 	return RetrievePragmaValue(aDbHandle, aDbName, KCacheSizePragma, aCacheSize);
 	}
 
@@ -819,7 +741,7 @@
 */
 TInt DbEncoding(sqlite3* aDbHandle, const TDesC& aDbName, TDes8& aEncoding)
 	{
-	__SQLASSERT(aDbHandle != NULL, ESqlPanicInternalError);
+	__ASSERT_DEBUG(aDbHandle != NULL, __SQLPANIC2(ESqlPanicInternalError));
 	return RetrievePragmaValue(aDbHandle, aDbName, KEncodingPragma, aEncoding);
 	}
 
@@ -840,7 +762,7 @@
 */
 TInt DbFreePageCount(sqlite3* aDbHandle, const TDesC& aDbName, TInt& aPageCount)
 	{
-	__SQLASSERT(aDbHandle != NULL, ESqlPanicInternalError);
+	__ASSERT_DEBUG(aDbHandle != NULL, __SQLPANIC2(ESqlPanicInternalError));
 	return RetrievePragmaValue(aDbHandle, aDbName, KFreePageCountPragma, aPageCount);
 	}
 
@@ -861,13 +783,13 @@
 */
 TInt DbVacuumMode(sqlite3* aDbHandle, const TDesC& aDbName, TInt& aVacuumMode)
 	{
-	__SQLASSERT(aDbHandle != NULL, ESqlPanicInternalError);
+	__ASSERT_DEBUG(aDbHandle != NULL, __SQLPANIC2(ESqlPanicInternalError));
 	return RetrievePragmaValue(aDbHandle, aDbName, KVacuumModePragma, aVacuumMode);
 	}
 
 static TBool IsCompactTimeLimitReached(TUint32 aStartTicks, TUint32 aCurrTicks, TInt aMaxTime)
 	{
-	__SQLASSERT(aMaxTime > 0, ESqlPanicBadArgument);
+	__ASSERT_DEBUG(aMaxTime > 0, __SQLPANIC2(ESqlPanicBadArgument));
 	TInt64 tickDiff64 = (TInt64)aCurrTicks - (TInt64)aStartTicks;
 	if(tickDiff64 < 0)
 		{
@@ -878,6 +800,7 @@
 	if(freq == 0)
 		{
 		err = HAL::Get(HAL::EFastCounterFrequency, freq);
+		SQL_TRACE_INTERNALS(OstTraceExt2(TRACE_INTERNALS, ISCOMPACTTIMELIMITREACHED, "0;IsCompactTimeLimitReached;fast counter frequency=%d;err=%d", freq, err));
 		}
 	if(err == KErrNone && freq > 0)
 		{
@@ -912,12 +835,14 @@
 */
 TInt DbCompact(sqlite3* aDbHandle, const TDesC& aDbName, TInt aPageCount, TInt& aProcessedPageCount, TInt aMaxTime)
 	{
-	__SQLASSERT(aPageCount >= 0, ESqlPanicBadArgument);
-	__SQLASSERT(aMaxTime >= 0, ESqlPanicBadArgument);
-	__SQLASSERT(aDbHandle != NULL, ESqlPanicInternalError);
+	SQL_TRACE_INTERNALS(OstTraceExt4(TRACE_INTERNALS, DBCOMPACT_ENTRY, "Entry;0x%X;DbCompact;aDbName=%S;aPageCount=%d;aMaxTime=%d", (TUint)aDbHandle, __SQLPRNSTR(aDbName), aPageCount, aMaxTime));
+	__ASSERT_DEBUG(aPageCount >= 0, __SQLPANIC2(ESqlPanicBadArgument));
+	__ASSERT_DEBUG(aMaxTime >= 0, __SQLPANIC2(ESqlPanicBadArgument));
+	__ASSERT_DEBUG(aDbHandle != NULL, __SQLPANIC2(ESqlPanicInternalError));
 	TBuf8<KMaxFileName> dbName;
 	if(!UTF16ToUTF8(aDbName, dbName))
 		{
+		SQL_TRACE_INTERNALS(OstTrace1(TRACE_INTERNALS, DBCOMPACT_EXIT1, "Exit;0x%X;DbCompact;err=KErrGeneral", (TUint)aDbHandle));
 		return KErrGeneral;
 		}
 	TBuf8<KMaxFileName + sizeof(KIncrementalVacuumPragma) + 1> sql;
@@ -941,7 +866,7 @@
 	// - byte length of the sql statement (parameter #2), excluding terminating zero;
 	// - negative value - the sql statement (parameter #2) is zero-terminated;
 	TInt err = sqlite3_prepare_v2(aDbHandle, (const char*)sql.Ptr(), sql.Length() - sizeof(TUint8), &stmtHandle, &stmtTail);
-	__SQLASSERT(err == SQLITE_OK ? !stmtTail || User::StringLength((const TUint8*)stmtTail) == 0 : !stmtHandle, ESqlPanicInternalError);
+	__ASSERT_DEBUG(err == SQLITE_OK ? !stmtTail || User::StringLength((const TUint8*)stmtTail) == 0 : !stmtHandle, __SQLPANIC2(ESqlPanicInternalError));
 	if(stmtHandle)	//stmtHandle can be NULL for statements like this: ";".
 		{
 		if(err == SQLITE_OK)
@@ -963,7 +888,7 @@
 			if(err == SQLITE_ERROR)	//It may be "out of memory" problem
 				{
 				err = sqlite3_reset(stmtHandle);
-				__SQLASSERT(err != SQLITE_OK, ESqlPanicInternalError);
+				__ASSERT_DEBUG(err != SQLITE_OK, __SQLPANIC2(ESqlPanicInternalError));
 				}
 			}
 		(void)sqlite3_finalize(stmtHandle);//sqlite3_finalize() fails only if an invalid statement handle is passed.
@@ -973,7 +898,7 @@
 		{
 		err = KErrNone;	
 		}
-	PRINT_ERRMSG8(err <= KSqlErrGeneral, aDbHandle, "DbCompact()", sql);
+	SQL_TRACE_INTERNALS(OstTraceExt3(TRACE_INTERNALS, DBCOMPACT_EXIT2, "Exit;0x%X;DbCompact;aProcessedPageCount=%d;err=%d", (TUint)aDbHandle, aProcessedPageCount, err));
 	return err;
 	}
 
@@ -989,6 +914,7 @@
 */
 TInt FinalizeStmtHandle(sqlite3_stmt* aStmtHandle)
 	{
+	SQL_TRACE_INTERNALS(OstTraceExt2(TRACE_INTERNALS, FINALIZESTMTHANDLE_ENTRY, "Entry;0x%X;FinalizeStmtHandle;aStmtHandle=0x%X", (TUint)sqlite3_db_handle(aStmtHandle), (TUint)aStmtHandle));
 	TInt err = KErrNone;
 	if(aStmtHandle)
 		{
@@ -996,5 +922,6 @@
 		err = sqlite3_finalize(aStmtHandle);
 		err = ::Sql2OsErrCode(err, sqlite3SymbianLastOsError());
 		}
+	SQL_TRACE_INTERNALS(OstTrace1(TRACE_INTERNALS, FINALIZESTMTHANDLE_EXIT, "Exit;0;FinalizeStmtHandle;err=%d", err));
 	return err;
 	}
--- a/persistentstorage/sql/SRC/Server/SqlSrvUtil.cpp	Tue Jul 06 16:18:30 2010 +0300
+++ b/persistentstorage/sql/SRC/Server/SqlSrvUtil.cpp	Wed Aug 18 11:30:17 2010 +0300
@@ -14,10 +14,15 @@
 //
 
 #include <stdlib.h>				//wchar_t
-#include "SqlPanic.h"
+#include "SqlAssert.h"
 #include "SqlSrvUtil.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "SqlSrvUtilTraces.h"
+#endif
+#include "SqlTraceDef.h"
 
-#ifdef _NOTIFY
+#ifdef _SQL_AUTHORIZER_TRACE_ENABLED
 
 //Used in PrintAuthorizerArguments()
 _LIT8(KCreateIndex,			"Create index");			//SQLITE_CREATE_INDEX
@@ -66,9 +71,9 @@
 	KCreateVTable(), KDropVTable(), KFunctionCall()
 	};
 
+#ifdef _DEBUG
 const TInt KMaxOpCodes = sizeof(KDbOpNames) / sizeof(KDbOpNames[0]);
-
-_LIT(KFormatStr, "!!Authorize: %20.20S, %40.40S, %10.10S, %10.10S, %10.10S\r\n"); 
+#endif
 
 /**
 This function has a defined implementaion only in _DEBUG mode and is used to print the authorizer arguments.
@@ -78,7 +83,7 @@
 void PrintAuthorizerArguments(TInt aDbOpType, const char* aDbObjName1, const char* aDbObjName2, 
 							  const char* aDbName, const char* aTrgOrViewName)
 	{
-	__SQLASSERT(aDbOpType > 0 && aDbOpType <= KMaxOpCodes, ESqlPanicInternalError);
+	__ASSERT_DEBUG(aDbOpType > 0 && aDbOpType <= KMaxOpCodes, __SQLPANIC2(ESqlPanicInternalError));
 	
 	//TPtrC8 objects cannot be used for the function arguments, because the arguments may not be 16-bit aligned!!!	
 
@@ -126,9 +131,9 @@
 			}
 		}
 		
-	RDebug::Print(KFormatStr, &opName, &dbObjName1, &dbObjName2, &dbName, &trgOrViewName);
+	SQL_TRACE_AUTHORIZER(OstTraceExt5(TRACE_INTERNALS, SQLAUTHORIZER, "0;PrintAuthorizerArguments;%20.20S;%40.40S;%10.10S;%10.10S;%10.10S", __SQLPRNSTR(opName), __SQLPRNSTR(dbObjName1), __SQLPRNSTR(dbObjName2), __SQLPRNSTR(dbName), __SQLPRNSTR(trgOrViewName)));
 	}
-#endif//_NOTIFY
+#endif//_SQL_AUTHORIZER_TRACE_ENABLED
 
 /**
 Converts a UTF16 encoded descriptor to a UTF8 encoded descriptor.
@@ -145,8 +150,8 @@
 */
 TBool UTF16ToUTF8(const TDesC& aIn, TDes8& aOut)
 	{
-	__SQLASSERT(aIn.Length() <= KMaxFileName, ESqlPanicBadArgument);
-	__SQLASSERT(aOut.MaxLength() >= KMaxFileName, ESqlPanicBadArgument);
+    __ASSERT_DEBUG(aIn.Length() <= KMaxFileName, __SQLPANIC2(ESqlPanicBadArgument));
+    __ASSERT_DEBUG(aOut.MaxLength() >= KMaxFileName, __SQLPANIC2(ESqlPanicBadArgument));
 	TBuf16<KMaxFileName + 1> des;
 	des.Copy(aIn);
 	des.Append(TChar(0));
@@ -175,9 +180,9 @@
 */
 TBool UTF16ZToUTF8Z(const TDesC& aFileName, TDes8& aFileNameDestBuf)
 	{
-	__SQLASSERT(aFileName.Length() <= (KMaxFileName + 1), ESqlPanicBadArgument);
-	__SQLASSERT(aFileName[aFileName.Length() - 1] == 0, ESqlPanicBadArgument);
-	__SQLASSERT(aFileNameDestBuf.MaxLength() >= (KMaxFileName + 1), ESqlPanicBadArgument);
+	__ASSERT_DEBUG(aFileName.Length() <= (KMaxFileName + 1), __SQLPANIC2(ESqlPanicBadArgument));
+	__ASSERT_DEBUG(aFileName[aFileName.Length() - 1] == 0, __SQLPANIC2(ESqlPanicBadArgument));
+	__ASSERT_DEBUG(aFileNameDestBuf.MaxLength() >= (KMaxFileName + 1), __SQLPANIC2(ESqlPanicBadArgument));
 	const wchar_t* src = reinterpret_cast <const wchar_t*> (aFileName.Ptr());
 	TInt len = wcstombs((char*)aFileNameDestBuf.Ptr(), src, KMaxFileName);
 	//Check the file name length. If it is longer than KMaxFileName characters, then the file name is not valid.
@@ -204,8 +209,8 @@
 */
 TBool UTF16ToUTF8Z(const TDesC& aFileName, TDes8& aFileNameDestBuf)
 	{
-	__SQLASSERT(aFileName.Length() <= KMaxFileName, ESqlPanicBadArgument);
-	__SQLASSERT(aFileNameDestBuf.MaxLength() >= (KMaxFileName + 1), ESqlPanicBadArgument);
+	__ASSERT_DEBUG(aFileName.Length() <= KMaxFileName, __SQLPANIC2(ESqlPanicBadArgument));
+	__ASSERT_DEBUG(aFileNameDestBuf.MaxLength() >= (KMaxFileName + 1), __SQLPANIC2(ESqlPanicBadArgument));
 	TBool rc = ::UTF16ToUTF8(aFileName, aFileNameDestBuf);
 	if(rc)
 		{
@@ -223,6 +228,6 @@
 		{//Non-existing file
 		return EFalse;	
 		}
-	__SQLLEAVE_IF_ERROR(err);
+	__SQLLEAVE_IF_ERROR2(err);
 	return entry.IsReadOnly();
 	}
--- a/persistentstorage/sql/SRC/Server/SqlSrvUtil.h	Tue Jul 06 16:18:30 2010 +0300
+++ b/persistentstorage/sql/SRC/Server/SqlSrvUtil.h	Wed Aug 18 11:30:17 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -24,10 +24,13 @@
 inline TBool IsSystemTableName(const TDesC8& aTableName);
 inline TBool IsSqliteTableName(const TDesC8& aTableName);
 
-#ifdef _NOTIFY
-void PrintAuthorizerArguments(TInt aDbOpType, const char* aDbObjName1, const char* aDbObjName2, 
-							  const char* aDbName, const char* aTrgOrViewName);
-#endif//_NOTIFY
+#ifdef _SQL_AUTHORIZER_TRACE_ENABLED
+void PrintAuthorizerArguments(TInt aDbOpType, 
+                              const char* aDbObjName1, 
+                              const char* aDbObjName2, 
+							  const char* aDbName, 
+							  const char* aTrgOrViewName);
+#endif
 
 TBool UTF16ToUTF8(const TDesC& aIn, TDes8& aOut);
 TBool UTF16ZToUTF8Z(const TDesC& aFileName, TDes8& aFileNameDestBuf);
--- a/persistentstorage/sql/TEST/t_sqldefect2.cpp	Tue Jul 06 16:18:30 2010 +0300
+++ b/persistentstorage/sql/TEST/t_sqldefect2.cpp	Wed Aug 18 11:30:17 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -16,7 +16,7 @@
 #include <e32test.h>
 #include <f32file.h>
 #include <sqldb.h>
-
+#include <f32file.h>
 ///////////////////////////////////////////////////////////////////////////////////////
 
 static RFs TheFs;
@@ -259,6 +259,128 @@
     TEST(diff.Int() <= 1);
     }
 
+static TInt KillProcess(const TDesC& aProcessName)
+    {
+    TFullName name;
+    TBuf<64> pattern(aProcessName);
+    TInt length = pattern.Length();
+    pattern += _L("*");
+    TFindProcess procFinder(pattern);
+
+    while (procFinder.Next(name) == KErrNone)
+        {
+        if (name.Length() > length)
+            {//If found name is a string containing aProcessName string.
+            TChar c(name[length]);
+            if (c.IsAlphaDigit() ||
+                c == TChar('_') ||
+                c == TChar('-'))
+                {
+                // If the found name is other valid application name
+                // starting with aProcessName string.
+                continue;
+                }
+            }
+        RProcess proc;
+        if (proc.Open(name) == KErrNone)
+            {
+            proc.Kill(0);
+            }
+        proc.Close();
+        }
+    return KErrNone;
+    }
+
+/**
+@SYMTestCaseID          PDS-SQL-CT-4210
+@SYMTestCaseDesc        Test for the change "Temp files created during sql operations are not deleted after rebooting the phone" 
+@SYMTestPriority        High
+@SYMTestActions         Kill the sql server
+                        Create two temp files in sql server's private directory
+                        Start the sql server
+                        Test that the temp files do not exist.
+@SYMTestExpectedResults Test must not fail
+*/
+void DeleteTempFile()
+    {   
+    _LIT(KSqlSrvName, "sqlsrv.exe");
+    _LIT(KServerTempDir, "c:\\private\\10281e17\\temp\\");
+    _LIT(KTempFile1, "TMP00052.$$$");
+    _LIT(KTempFile2, "TMP00044.$$$");
+    
+    KillProcess(KSqlSrvName);
+ 
+    //Create two temp file in c:\\private\\10281e17\\temp\\ folder
+    TInt err = TheFs.MkDir(KServerTempDir);
+    TEST(err == KErrNone || err == KErrAlreadyExists);
+    RFile file;
+    TFileName filename1(KServerTempDir);
+    TFileName filename2(KServerTempDir);
+    filename1.Append(KTempFile1);
+    filename2.Append(KTempFile2);
+    err = file.Replace(TheFs, filename1, 0);
+    file.Close();
+    TEST2(err, KErrNone);
+    err = file.Replace(TheFs, filename2, 0);
+    file.Close();
+    TEST2(err, KErrNone);
+    
+    //Create a database that should start sql server
+    err = TheDb1.Create(KTestDatabase1);
+    TEST(err == KErrNone || err == KErrAlreadyExists);
+    //Test that the temp files have been deleted during server's start-up
+    TUint dummy;
+    err = TheFs.Att(filename1, dummy);
+    TEST2(err, KErrNotFound);
+    err = TheFs.Att(filename2, dummy);
+    TEST2(err, KErrNotFound);
+    
+    TheDb1.Close();
+    err = RSqlDatabase::Delete(KTestDatabase1);
+    TEST2(err, KErrNone);
+    }
+
+TInt TempFilesCount()
+	{
+    _LIT(KServerTempDirMask, "c:\\private\\10281e17\\temp\\*.*");
+	CDir* dir = NULL;
+	TInt err = TheFs.GetDir(KServerTempDirMask, KEntryAttNormal, ESortNone, dir);
+	TEST2(err, KErrNone);
+	TInt tmpFileCount = dir->Count();
+	delete dir;
+	return tmpFileCount;
+	}
+
+/**
+@SYMTestCaseID          PDS-SQL-CT-4211
+@SYMTestCaseDesc        Test for the change "Temp files created during sql operations are not deleted after rebooting the phone" 
+@SYMTestPriority        High
+@SYMTestActions         The test creates a database and runs a set of statements that
+						will lead to a delayed creation of a temp file.
+						At the end the test checks that the temp file was created.
+@SYMTestExpectedResults Test must not fail
+*/
+void TempFileTest()
+	{
+    (void)RSqlDatabase::Delete(KTestDatabase1);
+    TInt err = TheDb1.Create(KTestDatabase1);
+    TEST2(err, KErrNone);
+    //Get the number of the files in the SQL temp directory 
+	TInt tmpFileCount = TempFilesCount();
+    //    
+    err = TheDb1.Exec(_L("CREATE TABLE t1(x UNIQUE); INSERT INTO t1 VALUES(1)"));
+    TEST(err >= 0);
+    err = TheDb1.Exec(_L("BEGIN; UPDATE t1 SET x = 2; UPDATE t1 SET x = 3; COMMIT"));
+    TEST(err >= 0);
+    //Check that a temp file really was created
+	TInt tmpFileCount2 = TempFilesCount();
+	TEST(tmpFileCount2 > tmpFileCount);
+    //
+    TheDb1.Close();
+    err = RSqlDatabase::Delete(KTestDatabase1);
+    TEST2(err, KErrNone);
+	}
+
 void DoTestsL()
 	{
 	TheTest.Start(_L(" @SYMTestCaseID:SYSLIB-SQL-CT-4154 DEF143062: SQL, \"CREATE INDEX\" sql crashes SQL server"));
@@ -269,6 +391,12 @@
 
     TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-SQL-CT-4156 DEF143150: SQL, strftime() returns incorrect result"));
     DEF143150();
+    
+    TheTest.Next(_L(" @SYMTestCaseDesc Temp files created during sql operations are not deleted after rebooting the phone - 1"));
+    DeleteTempFile();
+    
+    TheTest.Next(_L(" @SYMTestCaseDesc Temp files created during sql operations are not deleted after rebooting the phone - 2"));
+    TempFileTest();
 	}
 
 TInt E32Main()
--- a/persistentstorage/sql/TEST/t_sqlfilebuf64.cpp	Tue Jul 06 16:18:30 2010 +0300
+++ b/persistentstorage/sql/TEST/t_sqlfilebuf64.cpp	Wed Aug 18 11:30:17 2010 +0300
@@ -404,9 +404,17 @@
 	TEST2(fbuf.iFileWriteAmount, 0);
 	TEST2(fbuf.iFileSizeCount, 1);
 
-	//Second write operation. The offset is 0.  Data length: 12;
+	//Second write operation. The offset is 0.  Data length: 12, i.e. within the buffer - should have no write to the disk.
 	err = fbuf.Write(0, _L8("ZZXXCCVVBBNN"));
 	TEST2(err, KErrNone); 
+	TEST2(fbuf.iFileWriteCount, 0);
+	TEST2(fbuf.iFileWriteAmount, 0);
+	TEST2(fbuf.iFileSizeCount, 1);
+	
+	//Third write operation. The offet is 18. Data length: 5. The buffer should be written out to the file
+	// after "ab" is appended to the buffer. The new buffe after being emptied should have data "cde".
+	err = fbuf.Write(18, _L8("abcde"));
+	TEST2(err, KErrNone); 
 	TEST2(fbuf.iFileWriteCount, 1);
 	TEST2(fbuf.iFileWriteAmount, 20);
 	TEST2(fbuf.iFileSizeCount, 1);
@@ -415,12 +423,12 @@
 	TEST2(err, KErrNone); 
 	TEST2(fbuf.iFileWriteCount, 2);
 	TEST2(fbuf.iFileFlushCount, 1);
-	TEST2(fbuf.iFileWriteAmount, 20 + 12);
+	TEST2(fbuf.iFileWriteAmount, 23);
 	TEST2(fbuf.iFileSizeCount, 1);
 
 	fbuf.Close();
 
-	VerifyFileContent(_L8("ZZXXCCVVBBNN23456789"));
+	VerifyFileContent(_L8("ZZXXCCVVBBNN234567abcde"));
 	
 	(void)TheFs.Delete(KTestFile);
 	}
@@ -1256,6 +1264,79 @@
 	delete databuf;
 	}
 
+/**
+@SYMTestCaseID          PDS-SQL-CT-4212
+@SYMTestCaseDesc        RFileBuf64::Write() test.
+                        The test performs file write operations using RFileBuf64 class.
+                        Teh test sumilates the write operation at the conditions:
+                        
+                        1. There are 8 pages to be writted to the file.
+                        2. Each page is 16 bytes
+                        3. The size of RFileBuf64 is 4 pages, i.e. 64 bytes.
+                        4. The order of write is not sequential.
+ 
+@SYMTestActions         Write database pages.
+@SYMTestExpectedResults Test must not fail
+@SYMTestPriority        High
+*/
+void TestSetSizeCounter()
+    {
+    const TInt KPageSize = 16;
+    const TInt KBufSize = 4 * KPageSize;
+    RFileBuf64 fbuf(KBufSize);
+    (void)TheFs.Delete(KTestFile);
+    TInt err = fbuf.Create(TheFs, KTestFile, EFileRead | EFileWrite);
+    TEST2(err, KErrNone); 
+    const TInt KMaxPage = 8;
+    TUint8 fileData[KMaxPage][KPageSize];
+    TPtrC8 pageData[KMaxPage];
+    for(TInt i = 0;i <KMaxPage;++i)
+        {
+        Mem::Fill(fileData[i], KPageSize, TChar('a' + i));
+        const TUint8* p = fileData[i]; 
+        pageData[i].Set(p, KPageSize);
+        }
+    //
+    fbuf.ProfilerReset();
+    //Write the first 4 pages
+    for (TInt ii = 0; ii < 4; ii++)
+        {
+        err = fbuf.Write(ii * KPageSize, pageData[ii]);
+        TEST2(err, KErrNone);
+        }
+    //Write page #2
+    err = fbuf.Write(2 * KPageSize, pageData[2]);
+    TEST2(err, KErrNone);
+    //
+    TEST2(fbuf.iFileWriteCount, 0);
+    TEST2(fbuf.iFileSetSizeCount, 0);
+    //Write pages 5, 4, 6, 7
+    err = fbuf.Write(5 * KPageSize, pageData[5]);
+    TEST2(err, KErrNone);
+    //
+    TEST2(fbuf.iFileWriteCount, 1);
+    TEST2(fbuf.iFileSetSizeCount, 0);
+    //
+    err = fbuf.Write(4 * KPageSize, pageData[4]);
+    TEST2(err, KErrNone);
+    err = fbuf.Write(6 * KPageSize, pageData[6]);
+    TEST2(err, KErrNone);
+    err = fbuf.Write(7 * KPageSize, pageData[7]);
+    TEST2(err, KErrNone);
+    //
+    TEST2(fbuf.iFileWriteCount, 1);
+    TEST2(fbuf.iFileSetSizeCount, 0);
+    //
+    err = fbuf.Flush();
+    TEST2(err, KErrNone);
+    //
+    TEST2(fbuf.iFileWriteCount, 2);
+    TEST2(fbuf.iFileSetSizeCount, 0);
+    //
+    fbuf.Close();
+    (void)TheFs.Delete(KTestFile);
+    }
+
 void DoTests()
 	{
 	TheTest.Start(_L(" @SYMTestCaseID:PDS-SQL-UT-4132 RFileBuf64 write test 1"));
@@ -1301,6 +1382,8 @@
 	OpenFileIoErrTest();
 	TheTest.Next( _L(" @SYMTestCaseID:PDS-SQL-UT-4197 RFileBuf64::Temp() file I/O error simulation test"));
 	OpenFileIoErrTest();
+	TheTest.Next( _L(" @SYMTestCaseID:PDS-SQL-CT-4212 RFileBuf64::Write() test"));
+	TestSetSizeCounter();
 	}
 
 TInt E32Main()
--- a/persistentstorage/sql/TEST/t_sqloslayer.cpp	Tue Jul 06 16:18:30 2010 +0300
+++ b/persistentstorage/sql/TEST/t_sqloslayer.cpp	Wed Aug 18 11:30:17 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -27,6 +27,7 @@
 #ifdef __cplusplus
 }  /* End of the 'extern "C"' block */
 #endif
+#include "SqliteUtil.h"
 
 ///////////////////////////////////////////////////////////////////////////////////////
 
@@ -52,6 +53,9 @@
 TInt TheSqlSrvProfilerFileSetSize = 0;
 #endif
 
+//SQLite panic category.
+_LIT(KSqlitePanicCategory, "Sqlite");
+
 ///////////////////////////////////////////////////////////////////////////////////////
 
 void DeleteTestFiles()
@@ -623,16 +627,24 @@
 	User::Free(osFile);
 	}
 
+TInt DoDeleteTempFiles()
+	{
+    CFileMan* fm = NULL;
+    TRAPD(err, fm = CFileMan::NewL(TheFs));
+    TEST2(err, KErrNone);
+    TFileName path;
+    path.Copy(KPrivateDir);
+    path.Append(_L("temp\\"));
+    path.Append(_L("*.$$$"));
+    err = fm->Delete(path);
+    delete fm;
+    return err;
+	}
+
 void VfsOpenTempFileOomTest()
     {
     //Delete all temp files in this test private data cage.
-    CFileMan* fm = NULL;
-    TRAPD(err, fm = CFileMan::NewL(TheFs));
-    TEST2(err, KErrNone);
-    TBuf<50> path;
-    path.Copy(KPrivateDir);
-    path.Append(_L("*.$$$"));
-    err = fm->Delete(path);
+	TInt err = DoDeleteTempFiles();
     TEST(err == KErrNone || err == KErrNotFound);
     
     sqlite3_vfs* vfs = sqlite3_vfs_find(NULL);
@@ -653,7 +665,9 @@
         err = sqlite3OsOpen(vfs, NULL, osFile, SQLITE_OPEN_READWRITE, &outFlags);
         if(err == SQLITE_OK)
             {
-            err = sqlite3OsClose(osFile);
+			//Since this is a temp file, its creation will be delayed till the first file write operation.
+			err = sqlite3OsWrite(osFile, "1234", 4, 0);
+			(void)sqlite3OsClose(osFile);
             }
         OomPostStep();
         if(err != SQLITE_OK)
@@ -662,16 +676,68 @@
             }
         //If the iteration has failed, then no temp file should exist in the test private data cage.
         //If the iteration has succeeded, then sqlite3OsClose() should have deleted the temp file.
-        TInt err2 = fm->Delete(path);
+        TInt err2 = DoDeleteTempFiles();
         TEST2(err2, KErrNotFound);
         }
     TEST2(err, SQLITE_OK);
     TheTest.Printf(_L("\r\n=== TVfs::Open(<temp file>) OOM test succeeded at allcoation %d\r\n"), failingAllocNum);
     
     User::Free(osFile);
-    delete fm;
     }
 
+void VfsOpenTempFileFileIoErrTest()
+	{
+    //Delete all temp files in this test private data cage.
+	TInt err = DoDeleteTempFiles();
+    TEST(err == KErrNone || err == KErrNotFound);
+    
+    sqlite3_vfs* vfs = sqlite3_vfs_find(NULL);
+    TEST(vfs != NULL);
+
+    sqlite3_file* osFile = (sqlite3_file*)User::Alloc(vfs->szOsFile);
+    TEST(osFile != NULL);
+    
+	err = SQLITE_ERROR;
+	TInt cnt = 1;
+	while(err != SQLITE_OK)
+		{
+		TInt processHandleCnt = 0;
+		TInt threadHandleCnt = 0;
+		RThread().HandleCount(processHandleCnt, threadHandleCnt);
+		TInt allocCellsCnt = User::CountAllocCells();
+
+        TheTest.Printf(_L("%d "), cnt);
+		(void)TheFs.SetErrorCondition(KErrGeneral, cnt);
+        int outFlags = 0;
+        err = sqlite3OsOpen(vfs, NULL, osFile, SQLITE_OPEN_READWRITE, &outFlags);
+        if(err == SQLITE_OK)
+            {
+			//Since this is a temp file, its creation will be delayed till the first file write operation.
+			err = sqlite3OsWrite(osFile, "1234", 4, 0);
+			(void)sqlite3OsClose(osFile);
+            }
+		(void)TheFs.SetErrorCondition(KErrNone);
+		if(err != SQLITE_OK)
+			{
+			TInt processHandleCnt2 = 0;
+			TInt threadHandleCnt2 = 0;
+			RThread().HandleCount(processHandleCnt2, threadHandleCnt2);
+			TEST2(processHandleCnt2, processHandleCnt);
+			TEST2(threadHandleCnt2, threadHandleCnt);
+			TInt allocCellsCnt2 = User::CountAllocCells();
+			TEST2(allocCellsCnt2, allocCellsCnt);
+	        ++cnt;
+			}
+        //If the iteration has failed, then no temp file should exist in the test private data cage.
+        //If the iteration has succeeded, then sqlite3OsClose() should have deleted the temp file.
+        TInt err2 = DoDeleteTempFiles();
+        TEST2(err2, KErrNotFound);
+		}
+    TEST2(err, SQLITE_OK);
+    TheTest.Printf(_L("\r\n=== TVfs::Open(<temp file>) file I/O error simulation test succeeded at iteration %d\r\n"), cnt);
+    User::Free(osFile);
+	}
+
 void VfsCreateDeleteOnCloseFileOomTest()
     {
     sqlite3_vfs* vfs = sqlite3_vfs_find(NULL);
@@ -711,6 +777,71 @@
     User::Free(osFile);
     }
 
+///////////////////////////////////////////////////////////////////////////////////////
+
+//Panic thread function. 
+//It will cast aData parameter to a TFunctor pointer and call it.
+//The expectation is that the called function will panic and kill the panic thread.
+TInt ThreadFunc(void* aData)
+	{
+	CTrapCleanup* tc = CTrapCleanup::New();
+	TEST(tc != NULL);
+	
+	User::SetJustInTime(EFalse);	// disable debugger panic handling
+	
+	TFunctor* obj = reinterpret_cast<TFunctor*> (aData);
+	TEST(obj != NULL);
+	(*obj)();//call the panic function
+	
+	delete tc;
+	
+	return KErrNone;		
+	}
+
+//Panic test.
+//PanicTest function will create a new thread - panic thread, giving it a pointer to the function which has to
+//be executed and the expectation is that the function will panic and kill the panic thread.
+//PanicTest function will check the panic thread exit code, exit category and the panic code.
+void PanicTest(TFunctor& aFunctor, TExitType aExpectedExitType, const TDesC& aExpectedCategory, TInt aExpectedPanicCode)
+	{
+	RThread thread;
+	_LIT(KThreadName,"OsLayerPanicThread");
+	TEST2(thread.Create(KThreadName, &ThreadFunc, 0x2000, 0x1000, 0x10000, (void*)&aFunctor, EOwnerThread), KErrNone);
+	
+	TRequestStatus status;
+	thread.Logon(status);
+	TEST2(status.Int(), KRequestPending);
+	thread.Resume();
+	User::WaitForRequest(status);
+	User::SetJustInTime(ETrue);	// enable debugger panic handling
+
+	TEST2(thread.ExitType(), aExpectedExitType);
+	TEST(thread.ExitCategory() == aExpectedCategory);
+	TEST2(thread.ExitReason(), aExpectedPanicCode);
+	
+	CLOSE_AND_WAIT(thread);
+	}
+
+////////////////////////////////////////////////////////////////////////////////////////////////////////////
+//////////////////////////////     Panic test functions    /////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+#ifdef _DEBUG    
+
+//Panic when calling COsLayerData::Create() is called and the OS layer data has been already created.
+class TOsLayerDataDuplicated : public TFunctor
+	{
+private:		
+	virtual void operator()()
+		{
+		(void)sqlite3SymbianLibInit();//This should crash the thread in debug mode (because the Os layer
+		                              //data was created already in TestEnvInit()).
+		}
+	};
+static TOsLayerDataDuplicated TheOsLayerDataDuplicated;
+
+#endif //_DEBUG
+
 /**
 @SYMTestCaseID			SYSLIB-SQL-CT-1650
 @SYMTestCaseDesc		SQL, OS porting layer tests.
@@ -740,8 +871,14 @@
 	NegativeTest();
     TheTest.Printf(_L("TVfs::Open(<temp file>) OOM test\r\n"));
     VfsOpenTempFileOomTest();
+    TheTest.Printf(_L("TVfs::Open(<temp file>) file I/O error simulation test\r\n"));
+    VfsOpenTempFileFileIoErrTest();
     TheTest.Printf(_L("TVfs::Open(<'delete on close' file>) OOM test\r\n"));
     VfsCreateDeleteOnCloseFileOomTest();
+#ifdef _DEBUG    
+	TheTest.Printf(_L("'An attempt to create the OS layer data again' panic\r\n"));
+	PanicTest(TheOsLayerDataDuplicated, EExitPanic, KSqlitePanicCategory, ESqliteOsPanicOsLayerDataExists);
+#endif //_DEBUG	
 	}
 
 TInt E32Main()
--- a/persistentstorage/sql/TEST/t_sqlperformance.cpp	Tue Jul 06 16:18:30 2010 +0300
+++ b/persistentstorage/sql/TEST/t_sqlperformance.cpp	Wed Aug 18 11:30:17 2010 +0300
@@ -1174,12 +1174,10 @@
 	
 void SelectLikeQueryPerfTest()
 {
-	_LIT(KTestDatabase1, "c:\\test\\t_sqldefect_1.db");
-	
 	_LIT8(KServerConfigString1, "encoding =  \"UTF-8\"");
 	//create a sql db file
-	(void)RSqlDatabase::Delete(KTestDatabase1);
-	TInt err = TheDb.Create(KTestDatabase1, &KServerConfigString1);
+	(void)RSqlDatabase::Delete(TheNonSecureDbName);
+	TInt err = TheDb.Create(TheNonSecureDbName, &KServerConfigString1);
 	TEST2(err, KErrNone);
 	
 	//Create a test table and insert some records
@@ -1188,12 +1186,12 @@
 	
 	//Add 100 records to the table
 	for(TInt k=0;k<100;++k)
-	{
-	TBuf<100> sql;
-	sql.Format(_L("INSERT INTO A VALUES(%d, 'Dvorák')"), k + 1);
-	err = TheDb.Exec(sql);
-	TEST2(err, 1);
-	}
+		{
+		TBuf<100> sql;
+		sql.Format(_L("INSERT INTO A VALUES(%d, 'Dvorák')"), k + 1);
+		err = TheDb.Exec(sql);
+		TEST2(err, 1);
+		}
 	
 	//Update one record  
 	err = TheDb.Exec(_L("UPDATE A SET Name='dvorak1' WHERE ID = 50"));
@@ -1218,7 +1216,7 @@
 	PrintStats(start, end);
 	
 	TheDb.Close();
-	(void)RSqlDatabase::Delete(KTestDatabase1);
+	(void)RSqlDatabase::Delete(TheNonSecureDbName);
 }
 
 ///////////////////////////////////////////////////////////////////////////////////
--- a/persistentstorage/sql/TEST/t_sqlperformance5.cpp	Tue Jul 06 16:18:30 2010 +0300
+++ b/persistentstorage/sql/TEST/t_sqlperformance5.cpp	Wed Aug 18 11:30:17 2010 +0300
@@ -296,7 +296,7 @@
 	delete thumbnailBuf;
 	}
 
-void FlushTemptTables()
+void FlushTempTables()
 	{
 	TUint32 fc1 = User::FastCounter();
 	
@@ -358,7 +358,7 @@
 	TEST2(err, KErrNone);
 	
 	PoulateTempTables(stmt1, stmt2);
-	FlushTemptTables();
+	FlushTempTables();
 	
 	stmt2.Close();
 	stmt1.Close();
--- a/persistentstorage/sql/TEST/testexecute/SQLite/src/cdtest.cpp	Tue Jul 06 16:18:30 2010 +0300
+++ b/persistentstorage/sql/TEST/testexecute/SQLite/src/cdtest.cpp	Wed Aug 18 11:30:17 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -312,6 +312,55 @@
     return;
     }
 
+//This function is needed for drives with more free space than KMaxTUint32 (4GB -1) 
+//This is because in a FAT32 file system, the maximum file size is (4GB-1)
+//In the case where the free space is larger than this limit, this function will create additional 
+//file(s)until the disk is under the (4GB-1) limit. After that CSQLCDT::NearFillDisk will fill the 
+//disk up to the required amount.
+void CSQLCDT::PrepareLargeDisk(const TDesC& /*acfgblk*/, const TDriveUnit atdu, TInt64 &atowrite)
+    {
+    _LIT(KTestFunction, "PrepareLargeDisk");
+    _LIT(KFillDiskName,"\\FillDisk");
+    _LIT(KFillDiskExt,".txt");
+    TFileName fname;
+    TInt count = 1;
+    TInt err = 0;
+    
+    while(atowrite > KMaxTUint32)
+        {
+        RFile64 fillDiskFile;
+        fname.Copy(atdu.Name());
+        fname.Append(KFillDiskName);
+        fname.AppendNum(count);
+        fname.Append(KFillDiskExt);
+        
+        if( (err = fillDiskFile.Create(irfs, fname, EFileWrite)) != KErrNone )
+            {
+            SetTestStepResult(EFail);
+            INFO_PRINTF1(HTML_RED);
+            ERR_PRINTF4(_L("%S: Failed to open RFile64 for file %S, err %d"),
+                               &KTestFunction, &fname, err );
+            INFO_PRINTF1(HTML_COLOUR_OFF);
+            return;
+            }
+        
+        if( (err = fillDiskFile.SetSize(KMaxTUint32)) != KErrNone )
+            {
+            SetTestStepResult(EFail);
+            INFO_PRINTF1(HTML_RED);
+            ERR_PRINTF4(_L("%S: Failed on RFile64::SetSize for file %S, err %d"),
+                               &KTestFunction, &fname, err );
+            INFO_PRINTF1(HTML_COLOUR_OFF);
+            fillDiskFile.Close();
+            return;
+            }
+        
+        fillDiskFile.Close();
+        atowrite-=KMaxTUint32;
+        count++;
+        }
+    }
+
 // Create a file specified by 'FillFile' in the config and write to
 // it until 'DiskFree' bytes remain. Note that because files use whole
 // sectors (512/1024/2048/4096 or whatever bytes), that attempting to leave
@@ -347,29 +396,33 @@
         }
 
     // So how many bytes do we need to write?
-    TInt towrite = vol.iFree - free;
-    INFO_PRINTF4(_L("%S: Disk writing %d, free %d"), &KTestFunction, 
+    TInt64 towrite = vol.iFree - free;
+    INFO_PRINTF4(_L("%S: Disk writing %Ld, free %Ld"), &KTestFunction, 
                     towrite, vol.iFree );
-    INFO_PRINTF3(_L("%S: free %d"), &KTestFunction, vol.iFree );
-    INFO_PRINTF3(_L("%S: writing %d"), &KTestFunction, towrite );
+    INFO_PRINTF3(_L("%S: free %Ld"), &KTestFunction, vol.iFree );
+    INFO_PRINTF3(_L("%S: writing %Ld"), &KTestFunction, towrite );
 
     if( towrite < 0 )
         {
         SetTestStepResult(EFail);
         INFO_PRINTF1(HTML_RED);
-        ERR_PRINTF3(_L("%S: Disk wanted remaining less than current(%d)"),
+        ERR_PRINTF3(_L("%S: Disk wanted remaining less than current(%Ld)"),
                            &KTestFunction, vol.iFree );
         INFO_PRINTF1(HTML_COLOUR_OFF);
         return;
         }
-        
+    
+    //In case the disk is large (i.e >4G -1 bytes) we need another function to 
+    //create more files to fill it
+    PrepareLargeDisk(acfgblk, tdu, towrite);
+    
     // Get a file.
-    RFile myfile;
+    RFile64 myfile;
     if( (err = myfile.Create(irfs, fillfile, EFileWrite)) != KErrNone )
         {
         SetTestStepResult(EFail);
         INFO_PRINTF1(HTML_RED);
-        ERR_PRINTF4(_L("%S: Failed to open RFile for file %S, err %d"),
+        ERR_PRINTF4(_L("%S: Failed to open RFile64 for file %S, err %d"),
                            &KTestFunction, &fillfile, err );
         INFO_PRINTF1(HTML_COLOUR_OFF);
         return;
@@ -383,18 +436,20 @@
     // remaining space tends to be a kilobyte or two less than requested.
     // Obviously this is likely to be different between file system types,
     // between hardware and emulator and so on.
-	TInt size = 0;
+    
+    
+    TInt64 size = 0;
     while(towrite > 0)
         {
         if(towrite < 1024) break;
-        TInt tow = towrite/2;
+        TInt64 tow = towrite/2;
         if(towrite < 4096) tow = towrite;
 		size += tow;
         if( (err = myfile.SetSize(size)) != KErrNone )
             {
             SetTestStepResult(EFail);
             INFO_PRINTF1(HTML_RED);
-            ERR_PRINTF4(_L("%S: Failed on RFile::SetSize for file %S, err %d"),
+            ERR_PRINTF4(_L("%S: Failed on RFile64::SetSize for file %S, err %d"),
                                &KTestFunction, &fillfile, err );
             INFO_PRINTF1(HTML_COLOUR_OFF);
 			break;
@@ -421,7 +476,7 @@
                            &KTestFunction, err);
         INFO_PRINTF1(HTML_COLOUR_OFF);
     	}
-    INFO_PRINTF3(_L("%S: Disk remaining is %d"), &KTestFunction, vol.iFree );
+    INFO_PRINTF3(_L("%S: Disk remaining is %Ld"), &KTestFunction, vol.iFree );
 	myfile.Close();
     return;
     }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/persistentstorage/sql/traces_SqlDb/OstTraceDefinitions.h	Wed Aug 18 11:30:17 2010 +0300
@@ -0,0 +1,7 @@
+#ifndef __OSTTRACEDEFINITIONS_H__
+#define __OSTTRACEDEFINITIONS_H__
+// OST_TRACE_COMPILER_IN_USE flag has been added by Trace Compiler
+// REMOVE BEFORE CHECK-IN TO VERSION CONTROL
+//#define OST_TRACE_COMPILER_IN_USE
+#include <opensystemtrace.h>
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/persistentstorage/sql/traces_SqlDb/fixed_id.definitions	Wed Aug 18 11:30:17 2010 +0300
@@ -0,0 +1,154 @@
+#Fixed group and trace id definitions. If this file is removed, the identifiers are rebuilt.
+[GROUP]TRACE_BORDER=0x84
+[GROUP]TRACE_ERROR=0x82
+[GROUP]TRACE_FATAL=0x81
+[GROUP]TRACE_INTERNALS=0x88
+[TRACE]TRACE_BORDER[0x84]_RSQLBLOBREADSTREAM_OPENL_ENTRY=0x3a
+[TRACE]TRACE_BORDER[0x84]_RSQLBLOBREADSTREAM_OPENL_EXIT=0x3b
+[TRACE]TRACE_BORDER[0x84]_RSQLBLOBREADSTREAM_SIZEL_ENTRY=0x3c
+[TRACE]TRACE_BORDER[0x84]_RSQLBLOBREADSTREAM_SIZEL_EXIT=0x3d
+[TRACE]TRACE_BORDER[0x84]_RSQLBLOBWRITESTREAM_OPENL_ENTRY=0x3e
+[TRACE]TRACE_BORDER[0x84]_RSQLBLOBWRITESTREAM_OPENL_EXIT=0x3f
+[TRACE]TRACE_BORDER[0x84]_RSQLBLOBWRITESTREAM_SIZEL_ENTRY=0x40
+[TRACE]TRACE_BORDER[0x84]_RSQLBLOBWRITESTREAM_SIZEL_EXIT=0x41
+[TRACE]TRACE_BORDER[0x84]_RSQLCOLUMNREADSTREAM_COLUMNBINARYL_ENTRY=0x77
+[TRACE]TRACE_BORDER[0x84]_RSQLCOLUMNREADSTREAM_COLUMNBINARYL_EXIT=0x78
+[TRACE]TRACE_BORDER[0x84]_RSQLCOLUMNREADSTREAM_COLUMNBINARY_ENTRY=0x73
+[TRACE]TRACE_BORDER[0x84]_RSQLCOLUMNREADSTREAM_COLUMNBINARY_EXIT=0x74
+[TRACE]TRACE_BORDER[0x84]_RSQLCOLUMNREADSTREAM_COLUMNTEXTL_ENTRY=0x75
+[TRACE]TRACE_BORDER[0x84]_RSQLCOLUMNREADSTREAM_COLUMNTEXTL_EXIT=0x76
+[TRACE]TRACE_BORDER[0x84]_RSQLCOLUMNREADSTREAM_COLUMNTEXT_ENTRY=0x71
+[TRACE]TRACE_BORDER[0x84]_RSQLCOLUMNREADSTREAM_COLUMNTEXT_EXIT=0x72
+[TRACE]TRACE_BORDER[0x84]_RSQLDATABASE_ATTACH_ENTRY=0xf
+[TRACE]TRACE_BORDER[0x84]_RSQLDATABASE_ATTACH_EXIT=0x10
+[TRACE]TRACE_BORDER[0x84]_RSQLDATABASE_CLOSE_ENTRY=0xd
+[TRACE]TRACE_BORDER[0x84]_RSQLDATABASE_CLOSE_EXIT=0xe
+[TRACE]TRACE_BORDER[0x84]_RSQLDATABASE_COMPACTASYNC_ENTRY=0x30
+[TRACE]TRACE_BORDER[0x84]_RSQLDATABASE_COMPACTASYNC_EXIT=0x31
+[TRACE]TRACE_BORDER[0x84]_RSQLDATABASE_COMPACT_ENTRY=0x2e
+[TRACE]TRACE_BORDER[0x84]_RSQLDATABASE_COMPACT_EXIT=0x2f
+[TRACE]TRACE_BORDER[0x84]_RSQLDATABASE_COPY_ENTRY=0x13
+[TRACE]TRACE_BORDER[0x84]_RSQLDATABASE_COPY_EXIT=0x14
+[TRACE]TRACE_BORDER[0x84]_RSQLDATABASE_CREATE2_ENTRY=0x3
+[TRACE]TRACE_BORDER[0x84]_RSQLDATABASE_CREATE2_Exit=0x4
+[TRACE]TRACE_BORDER[0x84]_RSQLDATABASE_CREATEL2_ENTRY=0x9
+[TRACE]TRACE_BORDER[0x84]_RSQLDATABASE_CREATEL2_EXIT=0xa
+[TRACE]TRACE_BORDER[0x84]_RSQLDATABASE_CREATEL_ENTRY=0x7
+[TRACE]TRACE_BORDER[0x84]_RSQLDATABASE_CREATEL_EXIT=0x8
+[TRACE]TRACE_BORDER[0x84]_RSQLDATABASE_CREATE_ENTRY=0x1
+[TRACE]TRACE_BORDER[0x84]_RSQLDATABASE_CREATE_Exit=0x2
+[TRACE]TRACE_BORDER[0x84]_RSQLDATABASE_DELETE_ENTRY=0x15
+[TRACE]TRACE_BORDER[0x84]_RSQLDATABASE_DELETE_EXIT=0x16
+[TRACE]TRACE_BORDER[0x84]_RSQLDATABASE_DETACH_ENTRY=0x11
+[TRACE]TRACE_BORDER[0x84]_RSQLDATABASE_DETACH_EXIT=0x12
+[TRACE]TRACE_BORDER[0x84]_RSQLDATABASE_EXEC16_ENTRY=0x1d
+[TRACE]TRACE_BORDER[0x84]_RSQLDATABASE_EXEC16_EXIT=0x1e
+[TRACE]TRACE_BORDER[0x84]_RSQLDATABASE_EXEC8_ENTRY=0x1f
+[TRACE]TRACE_BORDER[0x84]_RSQLDATABASE_EXEC8_EXIT=0x20
+[TRACE]TRACE_BORDER[0x84]_RSQLDATABASE_EXECASYNC16_ENTRY=0x21
+[TRACE]TRACE_BORDER[0x84]_RSQLDATABASE_EXECASYNC16_EXIT=0x22
+[TRACE]TRACE_BORDER[0x84]_RSQLDATABASE_EXECASYNC8_ENTRY=0x23
+[TRACE]TRACE_BORDER[0x84]_RSQLDATABASE_EXECASYNC8_EXIT=0x24
+[TRACE]TRACE_BORDER[0x84]_RSQLDATABASE_FREERESERVEDSPACE_ENTRY=0x34
+[TRACE]TRACE_BORDER[0x84]_RSQLDATABASE_FREERESERVEDSPACE_EXIT=0x35
+[TRACE]TRACE_BORDER[0x84]_RSQLDATABASE_GETRESERVEACCESS_ENTRY=0x36
+[TRACE]TRACE_BORDER[0x84]_RSQLDATABASE_GETRESERVEACCESS_EXIT=0x37
+[TRACE]TRACE_BORDER[0x84]_RSQLDATABASE_GETSECURITYPOLICYL_ENTRY=0x19
+[TRACE]TRACE_BORDER[0x84]_RSQLDATABASE_GETSECURITYPOLICYL_EXIT=0x1a
+[TRACE]TRACE_BORDER[0x84]_RSQLDATABASE_GETSECURITYPOLICY_ENTRY=0x17
+[TRACE]TRACE_BORDER[0x84]_RSQLDATABASE_GETSECURITYPOLICY_EXIT=0x18
+[TRACE]TRACE_BORDER[0x84]_RSQLDATABASE_INTRABSACTION_ENTRY=0x28
+[TRACE]TRACE_BORDER[0x84]_RSQLDATABASE_INTRABSACTION_EXIT=0x29
+[TRACE]TRACE_BORDER[0x84]_RSQLDATABASE_LASTERRORMESSAGE=0x25
+[TRACE]TRACE_BORDER[0x84]_RSQLDATABASE_LASTINSERTEDROWID_ENTRY=0x26
+[TRACE]TRACE_BORDER[0x84]_RSQLDATABASE_LASTINSERTEDROWID_EXIT=0x27
+[TRACE]TRACE_BORDER[0x84]_RSQLDATABASE_OPENL_ENTRY=0xb
+[TRACE]TRACE_BORDER[0x84]_RSQLDATABASE_OPENL_EXIT=0xc
+[TRACE]TRACE_BORDER[0x84]_RSQLDATABASE_OPEN_ENTRY=0x5
+[TRACE]TRACE_BORDER[0x84]_RSQLDATABASE_OPEN_EXIT=0x6
+[TRACE]TRACE_BORDER[0x84]_RSQLDATABASE_RELEASERESERVEACCESS_ENTRY=0x38
+[TRACE]TRACE_BORDER[0x84]_RSQLDATABASE_RELEASERESERVEACCESS_EXIT=0x39
+[TRACE]TRACE_BORDER[0x84]_RSQLDATABASE_RESERVEDRIVESPACE_ENTRY=0x32
+[TRACE]TRACE_BORDER[0x84]_RSQLDATABASE_RESERVEDRIVESPACE_EXIT=0x33
+[TRACE]TRACE_BORDER[0x84]_RSQLDATABASE_SETISOLATIONLEVEL_ENTRY=0x1b
+[TRACE]TRACE_BORDER[0x84]_RSQLDATABASE_SETISOLATIONLEVEL_EXIT=0x1c
+[TRACE]TRACE_BORDER[0x84]_RSQLDATABASE_SIZE2_ENTRY=0x2c
+[TRACE]TRACE_BORDER[0x84]_RSQLDATABASE_SIZE2_EXIT=0x2d
+[TRACE]TRACE_BORDER[0x84]_RSQLDATABASE_SIZE_ENTRY=0x2a
+[TRACE]TRACE_BORDER[0x84]_RSQLDATABASE_SIZE_EXIT=0x2b
+[TRACE]TRACE_BORDER[0x84]_RSQLPARAMWRITESTREAM_BINDBINARYL_ENTRY=0x7f
+[TRACE]TRACE_BORDER[0x84]_RSQLPARAMWRITESTREAM_BINDBINARYL_EXIT=0x80
+[TRACE]TRACE_BORDER[0x84]_RSQLPARAMWRITESTREAM_BINDBINARY_ENTRY=0x7b
+[TRACE]TRACE_BORDER[0x84]_RSQLPARAMWRITESTREAM_BINDBINARY_EXIT=0x7c
+[TRACE]TRACE_BORDER[0x84]_RSQLPARAMWRITESTREAM_BINDTEXTL_ENTRY=0x7d
+[TRACE]TRACE_BORDER[0x84]_RSQLPARAMWRITESTREAM_BINDTEXTL_EXIT=0x7e
+[TRACE]TRACE_BORDER[0x84]_RSQLPARAMWRITESTREAM_BINDTEXT_ENTRY=0x79
+[TRACE]TRACE_BORDER[0x84]_RSQLPARAMWRITESTREAM_BINDTEXT_EXIT=0x7a
+[TRACE]TRACE_BORDER[0x84]_RSQLSECURITYPOLICY_CLOSE_ENTRY=0x85
+[TRACE]TRACE_BORDER[0x84]_RSQLSECURITYPOLICY_CLOSE_EXIT=0x86
+[TRACE]TRACE_BORDER[0x84]_RSQLSECURITYPOLICY_CREATEL_ENTRY=0x83
+[TRACE]TRACE_BORDER[0x84]_RSQLSECURITYPOLICY_CREATEL_EXIT=0x84
+[TRACE]TRACE_BORDER[0x84]_RSQLSECURITYPOLICY_CREATE_ENTRY=0x81
+[TRACE]TRACE_BORDER[0x84]_RSQLSECURITYPOLICY_CREATE_EXIT=0x82
+[TRACE]TRACE_BORDER[0x84]_RSQLSECURITYPOLICY_EXTERNALIZEL_ENTRY=0x87
+[TRACE]TRACE_BORDER[0x84]_RSQLSECURITYPOLICY_EXTERNALIZEL_EXIT=0x88
+[TRACE]TRACE_BORDER[0x84]_RSQLSECURITYPOLICY_INTERNALIZEL_ENTRY=0x89
+[TRACE]TRACE_BORDER[0x84]_RSQLSECURITYPOLICY_INTERNALIZEL_EXIT=0x8a
+[TRACE]TRACE_BORDER[0x84]_RSQLSTATEMENT_CLOSE_ENTRY=0x67
+[TRACE]TRACE_BORDER[0x84]_RSQLSTATEMENT_CLOSE_EXIT=0x68
+[TRACE]TRACE_BORDER[0x84]_RSQLSTATEMENT_EXECASYNC_ENTRY=0x6d
+[TRACE]TRACE_BORDER[0x84]_RSQLSTATEMENT_EXECASYNC_EXIT=0x6e
+[TRACE]TRACE_BORDER[0x84]_RSQLSTATEMENT_EXEC_ENTRY=0x6b
+[TRACE]TRACE_BORDER[0x84]_RSQLSTATEMENT_EXEC_EXIT=0x6c
+[TRACE]TRACE_BORDER[0x84]_RSQLSTATEMENT_NEXT_ENTRY=0x6f
+[TRACE]TRACE_BORDER[0x84]_RSQLSTATEMENT_NEXT_EXIT=0x70
+[TRACE]TRACE_BORDER[0x84]_RSQLSTATEMENT_PREPARE16L_ENTRY=0x63
+[TRACE]TRACE_BORDER[0x84]_RSQLSTATEMENT_PREPARE16L_EXIT=0x64
+[TRACE]TRACE_BORDER[0x84]_RSQLSTATEMENT_PREPARE16_ENTRY=0x5f
+[TRACE]TRACE_BORDER[0x84]_RSQLSTATEMENT_PREPARE16_EXIT=0x60
+[TRACE]TRACE_BORDER[0x84]_RSQLSTATEMENT_PREPARE8L_ENTRY=0x65
+[TRACE]TRACE_BORDER[0x84]_RSQLSTATEMENT_PREPARE8L_EXIT=0x66
+[TRACE]TRACE_BORDER[0x84]_RSQLSTATEMENT_PREPARE8_ENTRY=0x61
+[TRACE]TRACE_BORDER[0x84]_RSQLSTATEMENT_PREPARE8_EXIT=0x62
+[TRACE]TRACE_BORDER[0x84]_RSQLSTATEMENT_RESET_ENTRY=0x69
+[TRACE]TRACE_BORDER[0x84]_RSQLSTATEMENT_RESET_EXIT=0x6a
+[TRACE]TRACE_BORDER[0x84]_TSQLBLOB_GETLC_ENTRY=0x42
+[TRACE]TRACE_BORDER[0x84]_TSQLBLOB_GETLC_EXIT=0x43
+[TRACE]TRACE_BORDER[0x84]_TSQLBLOB_GET_ENTRY=0x44
+[TRACE]TRACE_BORDER[0x84]_TSQLBLOB_GET_EXIT=0x45
+[TRACE]TRACE_BORDER[0x84]_TSQLBLOB_SET_ENTRY=0x46
+[TRACE]TRACE_BORDER[0x84]_TSQLBLOB_SET_ENTRYEXT=0x47
+[TRACE]TRACE_BORDER[0x84]_TSQLBLOB_SET_EXIT=0x48
+[TRACE]TRACE_BORDER[0x84]_TSQLSCALARFULLSELECTQUERY_SELECTBINARYL_ENTRY16=0x53
+[TRACE]TRACE_BORDER[0x84]_TSQLSCALARFULLSELECTQUERY_SELECTBINARYL_ENTRY8=0x5d
+[TRACE]TRACE_BORDER[0x84]_TSQLSCALARFULLSELECTQUERY_SELECTBINARYL_EXIT16=0x54
+[TRACE]TRACE_BORDER[0x84]_TSQLSCALARFULLSELECTQUERY_SELECTBINARYL_EXIT8=0x5e
+[TRACE]TRACE_BORDER[0x84]_TSQLSCALARFULLSELECTQUERY_SELECTINT64L_ENTRY16=0x4d
+[TRACE]TRACE_BORDER[0x84]_TSQLSCALARFULLSELECTQUERY_SELECTINT64L_ENTRY8=0x57
+[TRACE]TRACE_BORDER[0x84]_TSQLSCALARFULLSELECTQUERY_SELECTINT64L_EXIT16=0x4e
+[TRACE]TRACE_BORDER[0x84]_TSQLSCALARFULLSELECTQUERY_SELECTINT64L_EXIT8=0x58
+[TRACE]TRACE_BORDER[0x84]_TSQLSCALARFULLSELECTQUERY_SELECTINTL_ENTRY16=0x4b
+[TRACE]TRACE_BORDER[0x84]_TSQLSCALARFULLSELECTQUERY_SELECTINTL_ENTRY8=0x55
+[TRACE]TRACE_BORDER[0x84]_TSQLSCALARFULLSELECTQUERY_SELECTINTL_EXIT16=0x4c
+[TRACE]TRACE_BORDER[0x84]_TSQLSCALARFULLSELECTQUERY_SELECTINTL_EXIT8=0x56
+[TRACE]TRACE_BORDER[0x84]_TSQLSCALARFULLSELECTQUERY_SELECTREALL_ENTRY16=0x4f
+[TRACE]TRACE_BORDER[0x84]_TSQLSCALARFULLSELECTQUERY_SELECTREALL_ENTRY8=0x59
+[TRACE]TRACE_BORDER[0x84]_TSQLSCALARFULLSELECTQUERY_SELECTREALL_EXIT16=0x50
+[TRACE]TRACE_BORDER[0x84]_TSQLSCALARFULLSELECTQUERY_SELECTREALL_EXIT8=0x5a
+[TRACE]TRACE_BORDER[0x84]_TSQLSCALARFULLSELECTQUERY_SELECTTEXTL_ENTRY16=0x51
+[TRACE]TRACE_BORDER[0x84]_TSQLSCALARFULLSELECTQUERY_SELECTTEXTL_ENTRY8=0x5b
+[TRACE]TRACE_BORDER[0x84]_TSQLSCALARFULLSELECTQUERY_SELECTTEXTL_EXIT16=0x52
+[TRACE]TRACE_BORDER[0x84]_TSQLSCALARFULLSELECTQUERY_SELECTTEXTL_EXIT8=0x5c
+[TRACE]TRACE_BORDER[0x84]_TSQLSCALARFULLSELECTQUERY_SETDATABASE=0x4a
+[TRACE]TRACE_BORDER[0x84]_TSQLSCALARFULLSELECTQUERY_TSQLSCALARFULLSELECTQUERY=0x49
+[TRACE]TRACE_ERROR[0x82]_TSQLUTIL_LEAVE=0x1
+[TRACE]TRACE_FATAL[0x81]_TSQLUTIL_PANIC=0x1
+[TRACE]TRACE_FATAL[0x81]_TSQLUTIL_PANICCLIENTL=0x2
+[TRACE]TRACE_INTERNALS[0x88]_HIPCBUF_CONSTRUCTL=0x1
+[TRACE]TRACE_INTERNALS[0x88]_HIPCBUF_HIPCBUFL2=0x2
+[TRACE]TRACE_INTERNALS[0x88]_RSQLDBSESSION_CLOSE=0x5
+[TRACE]TRACE_INTERNALS[0x88]_RSQLDBSESSION_CONNECT_ENTRY=0x3
+[TRACE]TRACE_INTERNALS[0x88]_RSQLDBSESSION_CONNECT_EXIT=0x4
+[TRACE]TRACE_INTERNALS[0x88]_RSQLSTATEMENTSESSION_CLOSE=0x8
+[TRACE]TRACE_INTERNALS[0x88]_RSQLSTATEMENTSESSION_PREPARE16=0x6
+[TRACE]TRACE_INTERNALS[0x88]_RSQLSTATEMENTSESSION_PREPARE8=0x7
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/persistentstorage/sql/traces_SqlDb/trace.properties	Wed Aug 18 11:30:17 2010 +0300
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<trace_properties>
+</trace_properties>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/persistentstorage/sql/traces_SqlSrv/OstTraceDefinitions.h	Wed Aug 18 11:30:17 2010 +0300
@@ -0,0 +1,7 @@
+#ifndef __OSTTRACEDEFINITIONS_H__
+#define __OSTTRACEDEFINITIONS_H__
+// OST_TRACE_COMPILER_IN_USE flag has been added by Trace Compiler
+// REMOVE BEFORE CHECK-IN TO VERSION CONTROL
+//#define OST_TRACE_COMPILER_IN_USE
+#include <opensystemtrace.h>
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/persistentstorage/sql/traces_SqlSrv/fixed_id.definitions	Wed Aug 18 11:30:17 2010 +0300
@@ -0,0 +1,174 @@
+#Fixed group and trace id definitions. If this file is removed, the identifiers are rebuilt.
+[GROUP]TRACE_ERROR=0x82
+[GROUP]TRACE_FATAL=0x81
+[GROUP]TRACE_INTERNALS=0x88
+[TRACE]TRACE_ERROR[0x82]_TSQLUTIL_LEAVE=0x1
+[TRACE]TRACE_FATAL[0x81]_TSQLUTIL_PANIC=0x1
+[TRACE]TRACE_FATAL[0x81]_TSQLUTIL_PANICCLIENTL=0x2
+[TRACE]TRACE_INTERNALS[0x88]_CONVERTSQLFULL2DISKFULLERRROR=0x7d
+[TRACE]TRACE_INTERNALS[0x88]_CSQLBACKUPCLIENT_CSQLBACKUPCLIENT2=0x17
+[TRACE]TRACE_INTERNALS[0x88]_CSQLBACKUPCLIENT_GETBACKUPDATASECTIONL0=0x1f
+[TRACE]TRACE_INTERNALS[0x88]_CSQLBACKUPCLIENT_GETBACKUPDATASECTIONL1=0x20
+[TRACE]TRACE_INTERNALS[0x88]_CSQLBACKUPCLIENT_GETBACKUPDATASECTIONL2=0x21
+[TRACE]TRACE_INTERNALS[0x88]_CSQLBACKUPCLIENT_GETBACKUPDATASECTIONL3=0x22
+[TRACE]TRACE_INTERNALS[0x88]_CSQLBACKUPCLIENT_GETBACKUPDATASECTIONL4=0x24
+[TRACE]TRACE_INTERNALS[0x88]_CSQLBACKUPCLIENT_GETBACKUPDATASECTIONL5=0x23
+[TRACE]TRACE_INTERNALS[0x88]_CSQLBACKUPCLIENT_GETBACKUPLISTL=0x31
+[TRACE]TRACE_INTERNALS[0x88]_CSQLBACKUPCLIENT_GETEXPECTEDDATASIZE=0x1e
+[TRACE]TRACE_INTERNALS[0x88]_CSQLBACKUPCLIENT_INITIALIZEGETPROXYBACKUPDATAL=0x26
+[TRACE]TRACE_INTERNALS[0x88]_CSQLBACKUPCLIENT_INITIALIZERESTOREPROXYBASEDATAL=0x27
+[TRACE]TRACE_INTERNALS[0x88]_CSQLBACKUPCLIENT_NEWLC=0x16
+[TRACE]TRACE_INTERNALS[0x88]_CSQLBACKUPCLIENT_NOTIFYCHANGE=0x19
+[TRACE]TRACE_INTERNALS[0x88]_CSQLBACKUPCLIENT_RESTOREBASEDATASECTONL0=0x28
+[TRACE]TRACE_INTERNALS[0x88]_CSQLBACKUPCLIENT_RESTOREBASEDATASECTONL1=0x29
+[TRACE]TRACE_INTERNALS[0x88]_CSQLBACKUPCLIENT_RESTOREBASEDATASECTONL2=0x2a
+[TRACE]TRACE_INTERNALS[0x88]_CSQLBACKUPCLIENT_RESTOREBASEDATASECTONL3=0x2b
+[TRACE]TRACE_INTERNALS[0x88]_CSQLBACKUPCLIENT_RESTOREBASEDATASECTONL4=0x2c
+[TRACE]TRACE_INTERNALS[0x88]_CSQLBACKUPCLIENT_RESTOREBASEDATASECTONL5=0x2d
+[TRACE]TRACE_INTERNALS[0x88]_CSQLBACKUPCLIENT_RESTOREBASEDATASECTONL6=0x2e
+[TRACE]TRACE_INTERNALS[0x88]_CSQLBACKUPCLIENT_RESTORECOMPLETE=0x25
+[TRACE]TRACE_INTERNALS[0x88]_CSQLBACKUPCLIENT_RUNERROR=0x18
+[TRACE]TRACE_INTERNALS[0x88]_CSQLBACKUPCLIENT_TERMINATEMULTISTAGEOPERATION1=0x2f
+[TRACE]TRACE_INTERNALS[0x88]_CSQLBACKUPCLIENT_TERMINATEMULTISTAGEOPERATION2=0x30
+[TRACE]TRACE_INTERNALS[0x88]_CSQLBACKUPCLIENT_TESTBURSTATUSL1=0x1b
+[TRACE]TRACE_INTERNALS[0x88]_CSQLBACKUPCLIENT_TESTBURSTATUSL2=0x1c
+[TRACE]TRACE_INTERNALS[0x88]_CSQLBACKUPCLIENT_TESTBURSTATUSL_ENTRY=0x1a
+[TRACE]TRACE_INTERNALS[0x88]_CSQLBACKUPCLIENT_TESTBURSTATUSL_EXIT=0x1d
+[TRACE]TRACE_INTERNALS[0x88]_CSQLCOMPACTCONN_CSQLCOMPACTCONN2=0x6
+[TRACE]TRACE_INTERNALS[0x88]_CSQLCOMPACTCONN_NEWLC_ENTRY=0x4
+[TRACE]TRACE_INTERNALS[0x88]_CSQLCOMPACTCONN_NEWLC_EXIT=0x5
+[TRACE]TRACE_INTERNALS[0x88]_CSQLCOMPACTENTRY_ADDREF=0xa
+[TRACE]TRACE_INTERNALS[0x88]_CSQLCOMPACTENTRY_COMPACT_ENTRY=0xd
+[TRACE]TRACE_INTERNALS[0x88]_CSQLCOMPACTENTRY_COMPACT_EXIT=0xe
+[TRACE]TRACE_INTERNALS[0x88]_CSQLCOMPACTENTRY_CSQLCOMPACTENTRY2=0x9
+[TRACE]TRACE_INTERNALS[0x88]_CSQLCOMPACTENTRY_FREEPAGECALLBACK=0xc
+[TRACE]TRACE_INTERNALS[0x88]_CSQLCOMPACTENTRY_NEWLC_ENTRY=0x7
+[TRACE]TRACE_INTERNALS[0x88]_CSQLCOMPACTENTRY_NEWLC_EXIT=0x8
+[TRACE]TRACE_INTERNALS[0x88]_CSQLCOMPACTENTRY_RELEASE=0xb
+[TRACE]TRACE_INTERNALS[0x88]_CSQLCOMPACTOR_ADDENTRYL1=0x1
+[TRACE]TRACE_INTERNALS[0x88]_CSQLCOMPACTOR_ADDENTRYL2=0x2
+[TRACE]TRACE_INTERNALS[0x88]_CSQLCOMPACTOR_RELEASEENTRY1=0x3
+[TRACE]TRACE_INTERNALS[0x88]_CSQLCOMPACTTIMER_CSQLCOMPACTTIMER2=0x11
+[TRACE]TRACE_INTERNALS[0x88]_CSQLCOMPACTTIMER_DEQUEUE=0x13
+[TRACE]TRACE_INTERNALS[0x88]_CSQLCOMPACTTIMER_NEWL_ENTRY=0xf
+[TRACE]TRACE_INTERNALS[0x88]_CSQLCOMPACTTIMER_NEWL_EXIT=0x10
+[TRACE]TRACE_INTERNALS[0x88]_CSQLCOMPACTTIMER_QUEUE=0x12
+[TRACE]TRACE_INTERNALS[0x88]_CSQLCOMPACTTIMER_RUNL=0x14
+[TRACE]TRACE_INTERNALS[0x88]_CSQLCOMPACTTIMER_RUNL2=0x15
+[TRACE]TRACE_INTERNALS[0x88]_CSQLDRIVESPACE_CSQLDRIVESPACE2=0x70
+[TRACE]TRACE_INTERNALS[0x88]_CSQLDRIVESPACE_GETACCESSL_ENTRY=0x71
+[TRACE]TRACE_INTERNALS[0x88]_CSQLDRIVESPACE_GETACCESSL_EXIT=0x72
+[TRACE]TRACE_INTERNALS[0x88]_CSQLDRIVESPACE_NEWLC_ENTRY=0x6e
+[TRACE]TRACE_INTERNALS[0x88]_CSQLDRIVESPACE_NEWLC_EXIT=0x6f
+[TRACE]TRACE_INTERNALS[0x88]_CSQLDRIVESPACE_RELEASEACCESS=0x73
+[TRACE]TRACE_INTERNALS[0x88]_CSQLSERVER_CACHEDDBCONFIGFILENAMESL=0x79
+[TRACE]TRACE_INTERNALS[0x88]_CSQLSERVER_CSQLSERVER2_ENTRY=0x76
+[TRACE]TRACE_INTERNALS[0x88]_CSQLSERVER_CSQLSERVER2_EXIT=0x77
+[TRACE]TRACE_INTERNALS[0x88]_CSQLSERVER_GETBACKUPLISTL=0x7b
+[TRACE]TRACE_INTERNALS[0x88]_CSQLSERVER_GETBACKUPLISTL_ENTRY=0x7a
+[TRACE]TRACE_INTERNALS[0x88]_CSQLSERVER_GETBACKUPLISTL_EXIT=0x7c
+[TRACE]TRACE_INTERNALS[0x88]_CSQLSERVER_GETCOLLATIONDLLNAMEL=0x78
+[TRACE]TRACE_INTERNALS[0x88]_CSQLSERVER_NEWLC_ENTRY=0x74
+[TRACE]TRACE_INTERNALS[0x88]_CSQLSERVER_NEWLC_EXIT=0x75
+[TRACE]TRACE_INTERNALS[0x88]_CSQLSRVDATABASE_APPLYCONFIGUPDATES2L=0x5a
+[TRACE]TRACE_INTERNALS[0x88]_CSQLSRVDATABASE_APPLYCONFIGUPDATESL=0x5b
+[TRACE]TRACE_INTERNALS[0x88]_CSQLSRVDATABASE_ATTACHDBL_ENTRY=0x52
+[TRACE]TRACE_INTERNALS[0x88]_CSQLSRVDATABASE_ATTACHDBL_EXIT=0x53
+[TRACE]TRACE_INTERNALS[0x88]_CSQLSRVDATABASE_COMPACTL_ENTRY=0x56
+[TRACE]TRACE_INTERNALS[0x88]_CSQLSRVDATABASE_COMPACTL_EXIT=0x57
+[TRACE]TRACE_INTERNALS[0x88]_CSQLSRVDATABASE_CREATEL_ENTRY=0x4a
+[TRACE]TRACE_INTERNALS[0x88]_CSQLSRVDATABASE_CREATEL_EXIT=0x4b
+[TRACE]TRACE_INTERNALS[0x88]_CSQLSRVDATABASE_CREATENEWDBFILEL=0x50
+[TRACE]TRACE_INTERNALS[0x88]_CSQLSRVDATABASE_CREATESECUREL_ENTRY=0x48
+[TRACE]TRACE_INTERNALS[0x88]_CSQLSRVDATABASE_CREATESECUREL_EXIT=0x49
+[TRACE]TRACE_INTERNALS[0x88]_CSQLSRVDATABASE_CSQLSRVDATABASE2_ENTRY=0x4e
+[TRACE]TRACE_INTERNALS[0x88]_CSQLSRVDATABASE_CSQLSRVDATABASE2_EXIT=0x4f
+[TRACE]TRACE_INTERNALS[0x88]_CSQLSRVDATABASE_DETACHDBL_ENTRY=0x54
+[TRACE]TRACE_INTERNALS[0x88]_CSQLSRVDATABASE_DETACHDBL_EXIT=0x55
+[TRACE]TRACE_INTERNALS[0x88]_CSQLSRVDATABASE_INSERTINATTACHDBMAPL=0x59
+[TRACE]TRACE_INTERNALS[0x88]_CSQLSRVDATABASE_NEWCOMPACTENTRYL_ENTRY=0x5c
+[TRACE]TRACE_INTERNALS[0x88]_CSQLSRVDATABASE_NEWCOMPACTENTRYL_EXIT=0x5d
+[TRACE]TRACE_INTERNALS[0x88]_CSQLSRVDATABASE_OPENEXISTINGDBFILEL=0x51
+[TRACE]TRACE_INTERNALS[0x88]_CSQLSRVDATABASE_OPENL_ENTRY=0x4c
+[TRACE]TRACE_INTERNALS[0x88]_CSQLSRVDATABASE_OPENL_EXIT=0x4d
+[TRACE]TRACE_INTERNALS[0x88]_CSQLSRVDATABASE_RELEASECOMPACTENTRY=0x5e
+[TRACE]TRACE_INTERNALS[0x88]_CSQLSRVDATABASE_REMOVEFROMMAPSL=0x58
+[TRACE]TRACE_INTERNALS[0x88]_CSQLSRVSESSION_CSQLSRVSESSION2_ENTRY=0x80
+[TRACE]TRACE_INTERNALS[0x88]_CSQLSRVSESSION_CSQLSRVSESSION2_EXIT=0x81
+[TRACE]TRACE_INTERNALS[0x88]_CSQLSRVSESSION_DBDELETEFILEL=0x86
+[TRACE]TRACE_INTERNALS[0x88]_CSQLSRVSESSION_NEWL_ENTRY=0x7e
+[TRACE]TRACE_INTERNALS[0x88]_CSQLSRVSESSION_NEWL_EXIT=0x7f
+[TRACE]TRACE_INTERNALS[0x88]_CSQLSRVSESSION_SERVICEERROR_ENTRY=0x84
+[TRACE]TRACE_INTERNALS[0x88]_CSQLSRVSESSION_SERVICEERROR_EXIT=0x85
+[TRACE]TRACE_INTERNALS[0x88]_CSQLSRVSESSION_SERVICEL_ENTRY=0x82
+[TRACE]TRACE_INTERNALS[0x88]_CSQLSRVSESSION_SERVICEL_EXIT=0x83
+[TRACE]TRACE_INTERNALS[0x88]_CSQLSRVSTATEMENT_CSQLSRVSTATEMENT2=0x8c
+[TRACE]TRACE_INTERNALS[0x88]_CSQLSRVSTATEMENT_CSQLSRVSTATEMENT2_ENTRY=0x8b
+[TRACE]TRACE_INTERNALS[0x88]_CSQLSRVSTATEMENT_CSQLSRVSTATEMENT2_EXIT=0x8d
+[TRACE]TRACE_INTERNALS[0x88]_CSQLSRVSTATEMENT_NEWLC_ENTRY=0x87
+[TRACE]TRACE_INTERNALS[0x88]_CSQLSRVSTATEMENT_NEWLC_ENTRY2=0x89
+[TRACE]TRACE_INTERNALS[0x88]_CSQLSRVSTATEMENT_NEWLC_EXIT=0x88
+[TRACE]TRACE_INTERNALS[0x88]_CSQLSRVSTATEMENT_NEWLC_EXIT2=0x8a
+[TRACE]TRACE_INTERNALS[0x88]_DBCOMPACT_ENTRY=0xa2
+[TRACE]TRACE_INTERNALS[0x88]_DBCOMPACT_EXIT1=0xa3
+[TRACE]TRACE_INTERNALS[0x88]_DBCOMPACT_EXIT2=0xa4
+[TRACE]TRACE_INTERNALS[0x88]_DBEXECSTMT16_ENTRY=0x8e
+[TRACE]TRACE_INTERNALS[0x88]_DBEXECSTMT16_EXIT=0x8f
+[TRACE]TRACE_INTERNALS[0x88]_DBEXECSTMT8_ENTRY=0x90
+[TRACE]TRACE_INTERNALS[0x88]_DBEXECSTMT8_EXIT=0x91
+[TRACE]TRACE_INTERNALS[0x88]_EXECPRAGMA_ENTRY=0x46
+[TRACE]TRACE_INTERNALS[0x88]_EXECPRAGMA_EXIT=0x47
+[TRACE]TRACE_INTERNALS[0x88]_FINALIZESTMTHANDLE_ENTRY=0xa5
+[TRACE]TRACE_INTERNALS[0x88]_FINALIZESTMTHANDLE_EXIT=0xa6
+[TRACE]TRACE_INTERNALS[0x88]_HBLOBBUF_DOREADL=0x39
+[TRACE]TRACE_INTERNALS[0x88]_HBLOBBUF_DORELEASE_ENTRY=0x36
+[TRACE]TRACE_INTERNALS[0x88]_HBLOBBUF_DORELEASE_EXIT=0x37
+[TRACE]TRACE_INTERNALS[0x88]_HBLOBBUF_DOSEEKL=0x3b
+[TRACE]TRACE_INTERNALS[0x88]_HBLOBBUF_DOSYNCHL=0x38
+[TRACE]TRACE_INTERNALS[0x88]_HBLOBBUF_DOWRITEL=0x3a
+[TRACE]TRACE_INTERNALS[0x88]_HBLOBBUF_NEWL_ENTRY1=0x32
+[TRACE]TRACE_INTERNALS[0x88]_HBLOBBUF_NEWL_ENTRY2=0x33
+[TRACE]TRACE_INTERNALS[0x88]_HBLOBBUF_NEWL_ENTRY3=0x34
+[TRACE]TRACE_INTERNALS[0x88]_HBLOBBUF_NEWL_EXIT=0x35
+[TRACE]TRACE_INTERNALS[0x88]_ISCOMPACTTIMELIMITREACHED=0xa1
+[TRACE]TRACE_INTERNALS[0x88]_PRERETRIEVEPRAGMAVALUE_ENTRY=0x9e
+[TRACE]TRACE_INTERNALS[0x88]_PRERETRIEVEPRAGMAVALUE_EXIT1=0x9f
+[TRACE]TRACE_INTERNALS[0x88]_PRERETRIEVEPRAGMAVALUE_EXIT2=0xa0
+[TRACE]TRACE_INTERNALS[0x88]_SQLAUTHORIZER=0xa7
+[TRACE]TRACE_INTERNALS[0x88]_STMTEXEC_ENTRY=0x98
+[TRACE]TRACE_INTERNALS[0x88]_STMTEXEC_EXIT=0x99
+[TRACE]TRACE_INTERNALS[0x88]_STMTNEXT_ENTRY=0x9a
+[TRACE]TRACE_INTERNALS[0x88]_STMTNEXT_EXIT=0x9b
+[TRACE]TRACE_INTERNALS[0x88]_STMTPREPARE16L_ENTRY=0x92
+[TRACE]TRACE_INTERNALS[0x88]_STMTPREPARE16L_EXIT=0x93
+[TRACE]TRACE_INTERNALS[0x88]_STMTPREPARE8L_ENTRY=0x96
+[TRACE]TRACE_INTERNALS[0x88]_STMTPREPARE8L_EXIT=0x97
+[TRACE]TRACE_INTERNALS[0x88]_STMTPREPARE8_ENTRY=0x94
+[TRACE]TRACE_INTERNALS[0x88]_STMTPREPARE8_EXIT=0x95
+[TRACE]TRACE_INTERNALS[0x88]_STMTRESET_ENTRY=0x9c
+[TRACE]TRACE_INTERNALS[0x88]_STMTRESET_EXIT=0x9d
+[TRACE]TRACE_INTERNALS[0x88]_TSQLDBSYSSETTINGS_CONFIGUREDATABASEL1=0x61
+[TRACE]TRACE_INTERNALS[0x88]_TSQLDBSYSSETTINGS_CONFIGUREDATABASEL2=0x62
+[TRACE]TRACE_INTERNALS[0x88]_TSQLDBSYSSETTINGS_CONFIGUREDATABASEL3=0x63
+[TRACE]TRACE_INTERNALS[0x88]_TSQLDBSYSSETTINGS_CONFIGUREDATABASEL4=0x64
+[TRACE]TRACE_INTERNALS[0x88]_TSQLDBSYSSETTINGS_CONFIGUREDATABASEL_ENTRY=0x5f
+[TRACE]TRACE_INTERNALS[0x88]_TSQLDBSYSSETTINGS_CONFIGUREDATABASEL_EXIT1=0x60
+[TRACE]TRACE_INTERNALS[0x88]_TSQLDBSYSSETTINGS_CONFIGUREDATABASEL_EXIT2=0x65
+[TRACE]TRACE_INTERNALS[0x88]_TSQLDBSYSSETTINGS_DOEXECUTEDBCONFIGFILEOPSL=0x66
+[TRACE]TRACE_INTERNALS[0x88]_TSQLDBSYSSETTINGS_PROCESSSTATEMENTL1=0x6a
+[TRACE]TRACE_INTERNALS[0x88]_TSQLDBSYSSETTINGS_PROCESSSTATEMENTL2=0x6b
+[TRACE]TRACE_INTERNALS[0x88]_TSQLDBSYSSETTINGS_PROCESSSTATEMENTL3=0x6c
+[TRACE]TRACE_INTERNALS[0x88]_TSQLDBSYSSETTINGS_PROCESSSTATEMENTL_ENTRY=0x67
+[TRACE]TRACE_INTERNALS[0x88]_TSQLDBSYSSETTINGS_PROCESSSTATEMENTL_EXIT1=0x68
+[TRACE]TRACE_INTERNALS[0x88]_TSQLDBSYSSETTINGS_PROCESSSTATEMENTL_EXIT2=0x69
+[TRACE]TRACE_INTERNALS[0x88]_TSQLDBSYSSETTINGS_PROCESSSTATEMENTL_EXIT3=0x6d
+[TRACE]TRACE_INTERNALS[0x88]_TSQLSRVCONFIGFILE_GETCONFIGPARAMSL_ENTRY=0x42
+[TRACE]TRACE_INTERNALS[0x88]_TSQLSRVCONFIGFILE_GETCONFIGPARAMSL_EXIT1=0x43
+[TRACE]TRACE_INTERNALS[0x88]_TSQLSRVCONFIGFILE_GETCONFIGPARAMSL_EXIT2=0x44
+[TRACE]TRACE_INTERNALS[0x88]_TSQLSRVCONFIGFILE_GETCONFIGPARAMSL_EXIT3=0x45
+[TRACE]TRACE_INTERNALS[0x88]_TSQLSRVCONFIGFILE_INITL1=0x3d
+[TRACE]TRACE_INTERNALS[0x88]_TSQLSRVCONFIGFILE_INITL2=0x3e
+[TRACE]TRACE_INTERNALS[0x88]_TSQLSRVCONFIGFILE_INITL_ENTRY=0x3c
+[TRACE]TRACE_INTERNALS[0x88]_TSQLSRVCONFIGFILE_INITL_EXIT1=0x3f
+[TRACE]TRACE_INTERNALS[0x88]_TSQLSRVCONFIGFILE_INITL_EXIT2=0x40
+[TRACE]TRACE_INTERNALS[0x88]_TSQLSRVCONFIGFILE_INITL_EXIT3=0x41
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/persistentstorage/sql/traces_SqlSrv/trace.properties	Wed Aug 18 11:30:17 2010 +0300
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<trace_properties>
+<enum name="TBURPartType">
+<value id="0">EBURUnset</value>
+<value id="1">EBURNormal</value>
+<value id="2">EBURBackupFull</value>
+<value id="4">EBURBackupPartial</value>
+<value id="8">EBURRestoreFull</value>
+<value id="16">EBURRestorePartial</value>
+</enum>
+<enum name="TSqlBackupState">
+<value id="0">EBackupNoFileOpen</value>
+<value id="1">EBackupOpenNothingSent</value>
+<value id="2">EBackupOpenPartHeaderSent</value>
+<value id="3">EBackupOpenAllHeaderSent</value>
+<value id="4">EBackupEndOfFile</value>
+</enum>
+<enum name="TSqlRestoreState">
+<value id="0">ERestoreExpectChecksum</value>
+<value id="1">ERestoreExpectOldFileSize</value>
+<value id="2">ERestoreExpectVersion</value>
+<value id="3">ERestoreExpectFileSize</value>
+<value id="4">ERestoreExpectFileNameSize</value>
+<value id="5">ERestoreExpectFileName</value>
+<value id="6">ERestoreExpectData</value>
+<value id="7">ERestoreComplete</value>
+</enum>
+<enum name="TSqlSrvConfig_TDbEncoding">
+<value id="0">EEncNotSet</value>
+<value id="1">EEncUtf8</value>
+<value id="2">EEncUtf16</value>
+</enum>
+</trace_properties>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/persistentstorage/sql/traces_sqlite/OstTraceDefinitions.h	Wed Aug 18 11:30:17 2010 +0300
@@ -0,0 +1,7 @@
+#ifndef __OSTTRACEDEFINITIONS_H__
+#define __OSTTRACEDEFINITIONS_H__
+// OST_TRACE_COMPILER_IN_USE flag has been added by Trace Compiler
+// REMOVE BEFORE CHECK-IN TO VERSION CONTROL
+//#define OST_TRACE_COMPILER_IN_USE
+#include <opensystemtrace.h>
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/persistentstorage/sql/traces_sqlite/fixed_id.definitions	Wed Aug 18 11:30:17 2010 +0300
@@ -0,0 +1,47 @@
+#Fixed group and trace id definitions. If this file is removed, the identifiers are rebuilt.
+[GROUP]TRACE_FATAL=0x81
+[GROUP]TRACE_INTERNALS=0x88
+[TRACE]TRACE_FATAL[0x81]_TSQLUTIL_PANIC=0x1
+[TRACE]TRACE_INTERNALS[0x88]_COSLAYERDATA_COSLAYERDATA2=0x7
+[TRACE]TRACE_INTERNALS[0x88]_COSLAYERDATA_CREATE_ENTRY=0x2
+[TRACE]TRACE_INTERNALS[0x88]_COSLAYERDATA_CREATE_EXIT1=0x3
+[TRACE]TRACE_INTERNALS[0x88]_COSLAYERDATA_CREATE_EXIT2=0x4
+[TRACE]TRACE_INTERNALS[0x88]_COSLAYERDATA_CREATE_EXIT3=0x5
+[TRACE]TRACE_INTERNALS[0x88]_COSLAYERDATA_DESTROY=0x6
+[TRACE]TRACE_INTERNALS[0x88]_COSLAYERDATA_DOCREATE=0x8
+[TRACE]TRACE_INTERNALS[0x88]_OS2SQLITEERR=0x1
+[TRACE]TRACE_INTERNALS[0x88]_SQLITE3SYMBIANLIBFINALIZE=0xa
+[TRACE]TRACE_INTERNALS[0x88]_SQLITE3SYMBIANLIBINIT=0x9
+[TRACE]TRACE_INTERNALS[0x88]_TDBFILE_TDBFILE=0xb
+[TRACE]TRACE_INTERNALS[0x88]_TFILEIO_CLOSE1=0xc
+[TRACE]TRACE_INTERNALS[0x88]_TFILEIO_FILECONTROL_ENTRY=0x17
+[TRACE]TRACE_INTERNALS[0x88]_TFILEIO_FILECONTROL_EXIT=0x18
+[TRACE]TRACE_INTERNALS[0x88]_TFILEIO_FILESIZE_ENTRY=0x15
+[TRACE]TRACE_INTERNALS[0x88]_TFILEIO_FILESIZE_EXIT=0x16
+[TRACE]TRACE_INTERNALS[0x88]_TFILEIO_READ_ENTRY=0xd
+[TRACE]TRACE_INTERNALS[0x88]_TFILEIO_READ_EXIT=0xe
+[TRACE]TRACE_INTERNALS[0x88]_TFILEIO_SYNC_ENTRY=0x13
+[TRACE]TRACE_INTERNALS[0x88]_TFILEIO_SYNC_EXIT=0x14
+[TRACE]TRACE_INTERNALS[0x88]_TFILEIO_TRUNCATE_ENTRY=0x11
+[TRACE]TRACE_INTERNALS[0x88]_TFILEIO_TRUNCATE_EXIT=0x12
+[TRACE]TRACE_INTERNALS[0x88]_TFILEIO_WRITE_ENTRY=0xf
+[TRACE]TRACE_INTERNALS[0x88]_TFILEIO_WRITE_EXIT=0x10
+[TRACE]TRACE_INTERNALS[0x88]_TVFS_ACCESS1=0x23
+[TRACE]TRACE_INTERNALS[0x88]_TVFS_ACCESS_ENTRY=0x24
+[TRACE]TRACE_INTERNALS[0x88]_TVFS_ACCESS_EXIT1=0x25
+[TRACE]TRACE_INTERNALS[0x88]_TVFS_ACCESS_EXIT2=0x26
+[TRACE]TRACE_INTERNALS[0x88]_TVFS_ACCESS_EXIT3=0x27
+[TRACE]TRACE_INTERNALS[0x88]_TVFS_DELETE1=0x1f
+[TRACE]TRACE_INTERNALS[0x88]_TVFS_DELETE2=0x21
+[TRACE]TRACE_INTERNALS[0x88]_TVFS_DELETE_ENTRY=0x20
+[TRACE]TRACE_INTERNALS[0x88]_TVFS_DELETE_EXIT=0x22
+[TRACE]TRACE_INTERNALS[0x88]_TVFS_DOFILESIZECORRUPTIONCHECK1=0x1b
+[TRACE]TRACE_INTERNALS[0x88]_TVFS_DOFILESIZECORRUPTIONCHECK2=0x1c
+[TRACE]TRACE_INTERNALS[0x88]_TVFS_DOGETGETDEVICECHARACTERISTICSANDSECTORSIZE=0x1a
+[TRACE]TRACE_INTERNALS[0x88]_TVFS_DOGETVOLUMEIOPARAMINFO=0x19
+[TRACE]TRACE_INTERNALS[0x88]_TVFS_FULLPATHNAME1=0x28
+[TRACE]TRACE_INTERNALS[0x88]_TVFS_FULLPATHNAME_ENTRY=0x29
+[TRACE]TRACE_INTERNALS[0x88]_TVFS_FULLPATHNAME_EXIT1=0x2a
+[TRACE]TRACE_INTERNALS[0x88]_TVFS_FULLPATHNAME_EXIT2=0x2b
+[TRACE]TRACE_INTERNALS[0x88]_TVFS_OPEN_ENTRY=0x1d
+[TRACE]TRACE_INTERNALS[0x88]_TVFS_OPEN_EXIT=0x1e
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/persistentstorage/sql/traces_sqlite/trace.properties	Wed Aug 18 11:30:17 2010 +0300
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<trace_properties>
+</trace_properties>
--- a/persistentstorage/sqlite3api/GROUP/BLD.INF	Tue Jul 06 16:18:30 2010 +0300
+++ b/persistentstorage/sqlite3api/GROUP/BLD.INF	Wed Aug 18 11:30:17 2010 +0300
@@ -37,410 +37,410 @@
 ../GROUP/sqlite3tests.bat                      z:/test/sqlite3tests.bat
 ../GROUP/config.ini                            z:/test/config.ini
 
-../TEST/TclScript/speed1p.explain			z:/private/10285A82/speed1p.explain
-../TEST/TclScript/speed4p.explain			z:/private/10285A82/speed4p.explain
-../TEST/TclScript/fuzz_common.tcl			z:/private/10285A82/fuzz_common.tcl
-../TEST/TclScript/malloc_common.tcl			z:/private/10285A82/malloc_common.tcl
-../TEST/TclScript/tester.tcl				z:/private/10285A82/tester.tcl
-../TEST/TclScript/thread_common.tcl			z:/private/10285A82/thread_common.tcl
-../TEST/TclScript/trans2.test.gz			z:/private/10285A82/trans2.test.gz
-../TEST/TclScript/aggerror.test				z:/private/10285A82/aggerror.test
-../TEST/TclScript/alias.test				z:/private/10285A82/alias.test
-../TEST/TclScript/all.test					z:/private/10285A82/all.test
-../TEST/TclScript/alter.test				z:/private/10285A82/alter.test
-../TEST/TclScript/alter2.test				z:/private/10285A82/alter2.test
-../TEST/TclScript/alter3.test				z:/private/10285A82/alter3.test
-../TEST/TclScript/altermalloc.test			z:/private/10285A82/altermalloc.test
-../TEST/TclScript/analyze.test				z:/private/10285A82/analyze.test
-../TEST/TclScript/async.test				z:/private/10285A82/async.test
-../TEST/TclScript/async2.test				z:/private/10285A82/async2.test
-../TEST/TclScript/async3.test				z:/private/10285A82/async3.test
-../TEST/TclScript/attach.test				z:/private/10285A82/attach.test
-../TEST/TclScript/attach2.test				z:/private/10285A82/attach2.test
-../TEST/TclScript/attach3.test				z:/private/10285A82/attach3.test
-../TEST/TclScript/attachmalloc.test			z:/private/10285A82/attachmalloc.test
-../TEST/TclScript/auth.test					z:/private/10285A82/auth.test
-../TEST/TclScript/auth2.test				z:/private/10285A82/auth2.test
-../TEST/TclScript/autoinc.test				z:/private/10285A82/autoinc.test
-../TEST/TclScript/autovacuum.test			z:/private/10285A82/autovacuum.test
-../TEST/TclScript/autovacuum_ioerr2.test	z:/private/10285A82/autovacuum_ioerr2.test
-../TEST/TclScript/avtrans.test			z:/private/10285A82/avtrans.test
-../TEST/TclScript/badutf.test			z:/private/10285A82/badutf.test
-../TEST/TclScript/between.test			z:/private/10285A82/between.test
-../TEST/TclScript/bigfile.test			z:/private/10285A82/bigfile.test
-../TEST/TclScript/bigrow.test			z:/private/10285A82/bigrow.test
-../TEST/TclScript/bind.test				z:/private/10285A82/bind.test
-../TEST/TclScript/bindxfer.test			z:/private/10285A82/bindxfer.test
-../TEST/TclScript/bitvec.test			z:/private/10285A82/bitvec.test
-../TEST/TclScript/blob.test				z:/private/10285A82/blob.test
-../TEST/TclScript/busy.test				z:/private/10285A82/busy.test
-../TEST/TclScript/cache.test			z:/private/10285A82/cache.test
-../TEST/TclScript/capi2.test			z:/private/10285A82/capi2.test
-../TEST/TclScript/capi3.test			z:/private/10285A82/capi3.test
-../TEST/TclScript/capi3b.test			z:/private/10285A82/capi3b.test
-../TEST/TclScript/capi3c.test			z:/private/10285A82/capi3c.test
-../TEST/TclScript/capi3d.test			z:/private/10285A82/capi3d.test
-../TEST/TclScript/cast.test				z:/private/10285A82/cast.test
-../TEST/TclScript/check.test			z:/private/10285A82/check.test
-../TEST/TclScript/collate1.test			z:/private/10285A82/collate1.test
-../TEST/TclScript/collate2.test			z:/private/10285A82/collate2.test
-../TEST/TclScript/collate3.test			z:/private/10285A82/collate3.test
-../TEST/TclScript/collate4.test			z:/private/10285A82/collate4.test
-../TEST/TclScript/collate5.test			z:/private/10285A82/collate5.test
-../TEST/TclScript/collate6.test			z:/private/10285A82/collate6.test
-../TEST/TclScript/collate7.test			z:/private/10285A82/collate7.test
-../TEST/TclScript/collate8.test			z:/private/10285A82/collate8.test
-../TEST/TclScript/collate9.test			z:/private/10285A82/collate9.test
-../TEST/TclScript/collateA.test			z:/private/10285A82/collateA.test
-../TEST/TclScript/colmeta.test			z:/private/10285A82/colmeta.test
-../TEST/TclScript/colname.test			z:/private/10285A82/colname.test
-../TEST/TclScript/conflict.test			z:/private/10285A82/conflict.test
-../TEST/TclScript/corrupt.test			z:/private/10285A82/corrupt.test
-../TEST/TclScript/corrupt2.test			z:/private/10285A82/corrupt2.test
-../TEST/TclScript/corrupt3.test			z:/private/10285A82/corrupt3.test
-../TEST/TclScript/corrupt4.test			z:/private/10285A82/corrupt4.test
-../TEST/TclScript/corrupt5.test			z:/private/10285A82/corrupt5.test
-../TEST/TclScript/corrupt6.test			z:/private/10285A82/corrupt6.test
-../TEST/TclScript/corrupt7.test			z:/private/10285A82/corrupt7.test
-../TEST/TclScript/corrupt8.test			z:/private/10285A82/corrupt8.test
-../TEST/TclScript/corrupt9.test			z:/private/10285A82/corrupt9.test
-../TEST/TclScript/corruptA.test			z:/private/10285A82/corruptA.test
-../TEST/TclScript/crash.test			z:/private/10285A82/crash.test
-../TEST/TclScript/crash2.test			z:/private/10285A82/crash2.test
-../TEST/TclScript/crash3.test			z:/private/10285A82/crash3.test
-../TEST/TclScript/crash4.test			z:/private/10285A82/crash4.test
-../TEST/TclScript/crash5.test			z:/private/10285A82/crash5.test
-../TEST/TclScript/crash6.test			z:/private/10285A82/crash6.test
-../TEST/TclScript/crash7.test			z:/private/10285A82/crash7.test
-../TEST/TclScript/createtab.test		z:/private/10285A82/createtab.test
-../TEST/TclScript/cse.test				z:/private/10285A82/cse.test
-../TEST/TclScript/date.test				z:/private/10285A82/date.test
-../TEST/TclScript/default.test			z:/private/10285A82/default.test
-../TEST/TclScript/delete.test			z:/private/10285A82/delete.test
-../TEST/TclScript/delete2.test			z:/private/10285A82/delete2.test
-../TEST/TclScript/delete3.test			z:/private/10285A82/delete3.test
-../TEST/TclScript/descidx1.test			z:/private/10285A82/descidx1.test
-../TEST/TclScript/descidx2.test			z:/private/10285A82/descidx2.test
-../TEST/TclScript/descidx3.test			z:/private/10285A82/descidx3.test
-../TEST/TclScript/diskfull.test			z:/private/10285A82/diskfull.test
-../TEST/TclScript/distinctagg.test		z:/private/10285A82/distinctagg.test
-../TEST/TclScript/enc.test				z:/private/10285A82/enc.test
-../TEST/TclScript/enc2.test				z:/private/10285A82/enc2.test
-../TEST/TclScript/enc3.test				z:/private/10285A82/enc3.test
-../TEST/TclScript/eval.test				z:/private/10285A82/eval.test
-../TEST/TclScript/exclusive.test		z:/private/10285A82/exclusive.test
-../TEST/TclScript/exclusive2.test		z:/private/10285A82/exclusive2.test
-../TEST/TclScript/exec.test				z:/private/10285A82/exec.test
-../TEST/TclScript/expr.test				z:/private/10285A82/expr.test
-../TEST/TclScript/filectrl.test			z:/private/10285A82/filectrl.test
-../TEST/TclScript/filefmt.test			z:/private/10285A82/filefmt.test
-../TEST/TclScript/fkey1.test			z:/private/10285A82/fkey1.test
-../TEST/TclScript/format4.test			z:/private/10285A82/format4.test
-../TEST/TclScript/fts1a.test			z:/private/10285A82/fts1a.test
-../TEST/TclScript/fts1b.test			z:/private/10285A82/fts1b.test
-../TEST/TclScript/fts1c.test			z:/private/10285A82/fts1c.test
-../TEST/TclScript/fts1d.test			z:/private/10285A82/fts1d.test
-../TEST/TclScript/fts1e.test			z:/private/10285A82/fts1e.test
-../TEST/TclScript/fts1f.test			z:/private/10285A82/fts1f.test
-../TEST/TclScript/fts1i.test			z:/private/10285A82/fts1i.test
-../TEST/TclScript/fts1j.test			z:/private/10285A82/fts1j.test
-../TEST/TclScript/fts1k.test			z:/private/10285A82/fts1k.test
-../TEST/TclScript/fts1l.test			z:/private/10285A82/fts1l.test
-../TEST/TclScript/fts1m.test			z:/private/10285A82/fts1m.test
-../TEST/TclScript/fts1n.test			z:/private/10285A82/fts1n.test
-../TEST/TclScript/fts1o.test			z:/private/10285A82/fts1o.test
-../TEST/TclScript/fts1porter.test		z:/private/10285A82/fts1porter.test
-../TEST/TclScript/fts2.test				z:/private/10285A82/fts2.test
-../TEST/TclScript/fts2a.test			z:/private/10285A82/fts2a.test
-../TEST/TclScript/fts2b.test			z:/private/10285A82/fts2b.test
-../TEST/TclScript/fts2c.test			z:/private/10285A82/fts2c.test
-../TEST/TclScript/fts2d.test			z:/private/10285A82/fts2d.test
-../TEST/TclScript/fts2e.test			z:/private/10285A82/fts2e.test
-../TEST/TclScript/fts2f.test			z:/private/10285A82/fts2f.test
-../TEST/TclScript/fts2g.test			z:/private/10285A82/fts2g.test
-../TEST/TclScript/fts2h.test			z:/private/10285A82/fts2h.test
-../TEST/TclScript/fts2i.test			z:/private/10285A82/fts2i.test
-../TEST/TclScript/fts2j.test			z:/private/10285A82/fts2j.test
-../TEST/TclScript/fts2k.test			z:/private/10285A82/fts2k.test
-../TEST/TclScript/fts2l.test			z:/private/10285A82/fts2l.test
-../TEST/TclScript/fts2m.test			z:/private/10285A82/fts2m.test
-../TEST/TclScript/fts2n.test			z:/private/10285A82/fts2n.test
-../TEST/TclScript/fts2o.test			z:/private/10285A82/fts2o.test
-../TEST/TclScript/fts2p.test			z:/private/10285A82/fts2p.test
-../TEST/TclScript/fts2q.test			z:/private/10285A82/fts2q.test
-../TEST/TclScript/fts2r.test			z:/private/10285A82/fts2r.test
-../TEST/TclScript/fts2token.test		z:/private/10285A82/fts2token.test
-../TEST/TclScript/fts3.test				z:/private/10285A82/fts3.test
-../TEST/TclScript/fts3aa.test			z:/private/10285A82/fts3aa.test
-../TEST/TclScript/fts3ab.test			z:/private/10285A82/fts3ab.test
-../TEST/TclScript/fts3ac.test			z:/private/10285A82/fts3ac.test
-../TEST/TclScript/fts3ad.test			z:/private/10285A82/fts3ad.test
-../TEST/TclScript/fts3ae.test			z:/private/10285A82/fts3ae.test
-../TEST/TclScript/fts3af.test			z:/private/10285A82/fts3af.test
-../TEST/TclScript/fts3ag.test			z:/private/10285A82/fts3ag.test
-../TEST/TclScript/fts3ah.test			z:/private/10285A82/fts3ah.test
-../TEST/TclScript/fts3ai.test			z:/private/10285A82/fts3ai.test
-../TEST/TclScript/fts3aj.test			z:/private/10285A82/fts3aj.test
-../TEST/TclScript/fts3ak.test			z:/private/10285A82/fts3ak.test
-../TEST/TclScript/fts3al.test			z:/private/10285A82/fts3al.test
-../TEST/TclScript/fts3am.test			z:/private/10285A82/fts3am.test
-../TEST/TclScript/fts3an.test			z:/private/10285A82/fts3an.test
-../TEST/TclScript/fts3ao.test			z:/private/10285A82/fts3ao.test
-../TEST/TclScript/fts3atoken.test		z:/private/10285A82/fts3atoken.test
-../TEST/TclScript/fts3b.test			z:/private/10285A82/fts3b.test
-../TEST/TclScript/fts3c.test			z:/private/10285A82/fts3c.test
-../TEST/TclScript/fts3d.test			z:/private/10285A82/fts3d.test
-../TEST/TclScript/fts3e.test			z:/private/10285A82/fts3e.test
-../TEST/TclScript/fts3near.test			z:/private/10285A82/fts3near.test
-../TEST/TclScript/func.test				z:/private/10285A82/func.test
-../TEST/TclScript/fuzz.test				z:/private/10285A82/fuzz.test
-../TEST/TclScript/fuzz2.test			z:/private/10285A82/fuzz2.test
-../TEST/TclScript/fuzz_malloc.test		z:/private/10285A82/fuzz_malloc.test
-../TEST/TclScript/hook.test				z:/private/10285A82/hook.test
-../TEST/TclScript/icu.test				z:/private/10285A82/icu.test
-../TEST/TclScript/in.test				z:/private/10285A82/in.test
-../TEST/TclScript/in2.test				z:/private/10285A82/in2.test
-../TEST/TclScript/in3.test				z:/private/10285A82/in3.test
-../TEST/TclScript/incrblob.test			z:/private/10285A82/incrblob.test
-../TEST/TclScript/incrblob2.test		z:/private/10285A82/incrblob2.test
-../TEST/TclScript/incrblob_err.test		z:/private/10285A82/incrblob_err.test
-../TEST/TclScript/incrvacuum.test		z:/private/10285A82/incrvacuum.test
-../TEST/TclScript/incrvacuum2.test		z:/private/10285A82/incrvacuum2.test
-../TEST/TclScript/incrvacuum_ioerr.test	z:/private/10285A82/incrvacuum_ioerr.test
-../TEST/TclScript/index.test			z:/private/10285A82/index.test
-../TEST/TclScript/index2.test			z:/private/10285A82/index2.test
-../TEST/TclScript/index3.test			z:/private/10285A82/index3.test
-../TEST/TclScript/insert.test			z:/private/10285A82/insert.test
-../TEST/TclScript/insert2.test			z:/private/10285A82/insert2.test
-../TEST/TclScript/insert3.test			z:/private/10285A82/insert3.test
-../TEST/TclScript/insert4.test			z:/private/10285A82/insert4.test
-../TEST/TclScript/insert5.test			z:/private/10285A82/insert5.test
-../TEST/TclScript/interrupt.test		z:/private/10285A82/interrupt.test
-../TEST/TclScript/intpkey.test			z:/private/10285A82/intpkey.test
-../TEST/TclScript/io.test				z:/private/10285A82/io.test
-../TEST/TclScript/ioerr.test			z:/private/10285A82/ioerr.test
-../TEST/TclScript/ioerr2.test			z:/private/10285A82/ioerr2.test
-../TEST/TclScript/ioerr3.test			z:/private/10285A82/ioerr3.test
-../TEST/TclScript/ioerr4.test			z:/private/10285A82/ioerr4.test
-../TEST/TclScript/ioerr5.test			z:/private/10285A82/ioerr5.test
-../TEST/TclScript/join.test				z:/private/10285A82/join.test
-../TEST/TclScript/join2.test			z:/private/10285A82/join2.test
-../TEST/TclScript/join3.test			z:/private/10285A82/join3.test
-../TEST/TclScript/join4.test			z:/private/10285A82/join4.test
-../TEST/TclScript/join5.test			z:/private/10285A82/join5.test
-../TEST/TclScript/journal1.test			z:/private/10285A82/journal1.test
-../TEST/TclScript/jrnlmode.test			z:/private/10285A82/jrnlmode.test
-../TEST/TclScript/lastinsert.test		z:/private/10285A82/lastinsert.test
-../TEST/TclScript/laststmtchanges.test	z:/private/10285A82/laststmtchanges.test
-../TEST/TclScript/like.test				z:/private/10285A82/like.test
-../TEST/TclScript/like2.test			z:/private/10285A82/like2.test
-../TEST/TclScript/limit.test			z:/private/10285A82/limit.test
-../TEST/TclScript/loadext.test			z:/private/10285A82/loadext.test
-../TEST/TclScript/loadext2.test			z:/private/10285A82/loadext2.test
-../TEST/TclScript/lock.test				z:/private/10285A82/lock.test
-../TEST/TclScript/lock2.test			z:/private/10285A82/lock2.test
-../TEST/TclScript/lock3.test			z:/private/10285A82/lock3.test
-../TEST/TclScript/lock4.test			z:/private/10285A82/lock4.test
-../TEST/TclScript/lock5.test			z:/private/10285A82/lock5.test
-../TEST/TclScript/lookaside.test		z:/private/10285A82/lookaside.test
-../TEST/TclScript/main.test				z:/private/10285A82/main.test
-../TEST/TclScript/malloc.test			z:/private/10285A82/malloc.test
-../TEST/TclScript/malloc3.test			z:/private/10285A82/malloc3.test
-../TEST/TclScript/malloc4.test			z:/private/10285A82/malloc4.test
-../TEST/TclScript/malloc5.test			z:/private/10285A82/malloc5.test
-../TEST/TclScript/malloc6.test			z:/private/10285A82/malloc6.test
-../TEST/TclScript/malloc7.test			z:/private/10285A82/malloc7.test
-../TEST/TclScript/malloc8.test			z:/private/10285A82/malloc8.test
-../TEST/TclScript/malloc9.test			z:/private/10285A82/malloc9.test
-../TEST/TclScript/mallocA.test			z:/private/10285A82/mallocA.test
-../TEST/TclScript/mallocAll.test		z:/private/10285A82/mallocAll.test
-../TEST/TclScript/mallocB.test			z:/private/10285A82/mallocB.test
-../TEST/TclScript/mallocC.test			z:/private/10285A82/mallocC.test
-../TEST/TclScript/mallocD.test			z:/private/10285A82/mallocD.test
-../TEST/TclScript/mallocE.test			z:/private/10285A82/mallocE.test
-../TEST/TclScript/mallocF.test			z:/private/10285A82/mallocF.test
-../TEST/TclScript/mallocG.test			z:/private/10285A82/mallocG.test
-../TEST/TclScript/mallocH.test			z:/private/10285A82/mallocH.test
-../TEST/TclScript/mallocI.test			z:/private/10285A82/mallocI.test
-../TEST/TclScript/manydb.test			z:/private/10285A82/manydb.test
-../TEST/TclScript/memdb.test			z:/private/10285A82/memdb.test
-../TEST/TclScript/memleak.test			z:/private/10285A82/memleak.test
-../TEST/TclScript/memsubsys1.test		z:/private/10285A82/memsubsys1.test
-../TEST/TclScript/memsubsys2.test		z:/private/10285A82/memsubsys2.test
-../TEST/TclScript/minmax.test			z:/private/10285A82/minmax.test
-../TEST/TclScript/minmax2.test			z:/private/10285A82/minmax2.test
-../TEST/TclScript/minmax3.test			z:/private/10285A82/minmax3.test
-../TEST/TclScript/misc1.test			z:/private/10285A82/misc1.test
-../TEST/TclScript/misc2.test			z:/private/10285A82/misc2.test
-../TEST/TclScript/misc3.test			z:/private/10285A82/misc3.test
-../TEST/TclScript/misc4.test			z:/private/10285A82/misc4.test
-../TEST/TclScript/misc5.test			z:/private/10285A82/misc5.test
-../TEST/TclScript/misc6.test			z:/private/10285A82/misc6.test
-../TEST/TclScript/misc7.test			z:/private/10285A82/misc7.test
-../TEST/TclScript/misuse.test			z:/private/10285A82/misuse.test
-../TEST/TclScript/mutex1.test			z:/private/10285A82/mutex1.test
-../TEST/TclScript/mutex2.test			z:/private/10285A82/mutex2.test
-../TEST/TclScript/nan.test				z:/private/10285A82/nan.test
-../TEST/TclScript/notnull.test			z:/private/10285A82/notnull.test
-../TEST/TclScript/null.test				z:/private/10285A82/null.test
-../TEST/TclScript/openv2.test			z:/private/10285A82/openv2.test
-../TEST/TclScript/pager.test			z:/private/10285A82/pager.test
-../TEST/TclScript/pager2.test			z:/private/10285A82/pager2.test
-../TEST/TclScript/pager3.test			z:/private/10285A82/pager3.test
-../TEST/TclScript/pageropt.test			z:/private/10285A82/pageropt.test
-../TEST/TclScript/pagesize.test			z:/private/10285A82/pagesize.test
-../TEST/TclScript/pcache.test			z:/private/10285A82/pcache.test
-../TEST/TclScript/permutations.test		z:/private/10285A82/permutations.test
-../TEST/TclScript/pragma.test			z:/private/10285A82/pragma.test
-../TEST/TclScript/pragma2.test			z:/private/10285A82/pragma2.test
-../TEST/TclScript/printf.test			z:/private/10285A82/printf.test
-../TEST/TclScript/progress.test			z:/private/10285A82/progress.test
-../TEST/TclScript/ptrchng.test			z:/private/10285A82/ptrchng.test
-../TEST/TclScript/quick.test			z:/private/10285A82/quick.test
-../TEST/TclScript/quote.test			z:/private/10285A82/quote.test
-../TEST/TclScript/rdonly.test			z:/private/10285A82/rdonly.test
-../TEST/TclScript/reindex.test			z:/private/10285A82/reindex.test
-../TEST/TclScript/rollback.test			z:/private/10285A82/rollback.test
-../TEST/TclScript/rowid.test			z:/private/10285A82/rowid.test
-../TEST/TclScript/rtree.test			z:/private/10285A82/rtree.test
-../TEST/TclScript/safety.test			z:/private/10285A82/safety.test
-../TEST/TclScript/schema.test			z:/private/10285A82/schema.test
-../TEST/TclScript/schema2.test			z:/private/10285A82/schema2.test
-../TEST/TclScript/select1.test			z:/private/10285A82/select1.test
-../TEST/TclScript/select2.test			z:/private/10285A82/select2.test
-../TEST/TclScript/select3.test			z:/private/10285A82/select3.test
-../TEST/TclScript/select4.test			z:/private/10285A82/select4.test
-../TEST/TclScript/select5.test			z:/private/10285A82/select5.test
-../TEST/TclScript/select6.test			z:/private/10285A82/select6.test
-../TEST/TclScript/select7.test			z:/private/10285A82/select7.test
-../TEST/TclScript/select8.test			z:/private/10285A82/select8.test
-../TEST/TclScript/select9.test			z:/private/10285A82/select9.test
-../TEST/TclScript/selectA.test			z:/private/10285A82/selectA.test
-../TEST/TclScript/selectB.test			z:/private/10285A82/selectB.test
-../TEST/TclScript/server1.test			z:/private/10285A82/server1.test
-../TEST/TclScript/shared.test			z:/private/10285A82/shared.test
-../TEST/TclScript/shared2.test			z:/private/10285A82/shared2.test
-../TEST/TclScript/shared3.test			z:/private/10285A82/shared3.test
-../TEST/TclScript/shared4.test			z:/private/10285A82/shared4.test
-../TEST/TclScript/shared_err.test		z:/private/10285A82/shared_err.test
-../TEST/TclScript/shortread1.test		z:/private/10285A82/shortread1.test
-../TEST/TclScript/sidedelete.test		z:/private/10285A82/sidedelete.test
-../TEST/TclScript/soak.test				z:/private/10285A82/soak.test
-../TEST/TclScript/softheap1.test		z:/private/10285A82/softheap1.test
-../TEST/TclScript/sort.test				z:/private/10285A82/sort.test
-../TEST/TclScript/speed1.test			z:/private/10285A82/speed1.test
-../TEST/TclScript/speed1p.test			z:/private/10285A82/speed1p.test
-../TEST/TclScript/speed2.test			z:/private/10285A82/speed2.test
-../TEST/TclScript/speed3.test			z:/private/10285A82/speed3.test
-../TEST/TclScript/speed4.test			z:/private/10285A82/speed4.test
-../TEST/TclScript/speed4p.test			z:/private/10285A82/speed4p.test
-../TEST/TclScript/sqllimits1.test		z:/private/10285A82/sqllimits1.test
-../TEST/TclScript/subquery.test			z:/private/10285A82/subquery.test
-../TEST/TclScript/subselect.test		z:/private/10285A82/subselect.test
-../TEST/TclScript/substr.test			z:/private/10285A82/substr.test
-../TEST/TclScript/sync.test				z:/private/10285A82/sync.test
-../TEST/TclScript/table.test			z:/private/10285A82/table.test
-../TEST/TclScript/tableapi.test			z:/private/10285A82/tableapi.test
-../TEST/TclScript/tclsqlite.test		z:/private/10285A82/tclsqlite.test
-../TEST/TclScript/tempdb.test			z:/private/10285A82/tempdb.test
-../TEST/TclScript/temptable.test		z:/private/10285A82/temptable.test
-../TEST/TclScript/thread001.test		z:/private/10285A82/thread001.test
-../TEST/TclScript/thread002.test		z:/private/10285A82/thread002.test
-../TEST/TclScript/thread003.test		z:/private/10285A82/thread003.test
-../TEST/TclScript/thread1.test			z:/private/10285A82/thread1.test
-../TEST/TclScript/thread2.test			z:/private/10285A82/thread2.test
-../TEST/TclScript/tkt1435.test			z:/private/10285A82/tkt1435.test
-../TEST/TclScript/tkt1443.test			z:/private/10285A82/tkt1443.test
-../TEST/TclScript/tkt1444.test			z:/private/10285A82/tkt1444.test
-../TEST/TclScript/tkt1449.test			z:/private/10285A82/tkt1449.test
-../TEST/TclScript/tkt1473.test			z:/private/10285A82/tkt1473.test
-../TEST/TclScript/tkt1501.test			z:/private/10285A82/tkt1501.test
-../TEST/TclScript/tkt1512.test			z:/private/10285A82/tkt1512.test
-../TEST/TclScript/tkt1514.test			z:/private/10285A82/tkt1514.test
-../TEST/TclScript/tkt1536.test			z:/private/10285A82/tkt1536.test
-../TEST/TclScript/tkt1537.test			z:/private/10285A82/tkt1537.test
-../TEST/TclScript/tkt1567.test			z:/private/10285A82/tkt1567.test
-../TEST/TclScript/tkt1644.test			z:/private/10285A82/tkt1644.test
-../TEST/TclScript/tkt1667.test			z:/private/10285A82/tkt1667.test
-../TEST/TclScript/tkt1873.test			z:/private/10285A82/tkt1873.test
-../TEST/TclScript/tkt2141.test			z:/private/10285A82/tkt2141.test
-../TEST/TclScript/tkt2192.test			z:/private/10285A82/tkt2192.test
-../TEST/TclScript/tkt2213.test			z:/private/10285A82/tkt2213.test
-../TEST/TclScript/tkt2251.test			z:/private/10285A82/tkt2251.test
-../TEST/TclScript/tkt2285.test			z:/private/10285A82/tkt2285.test
-../TEST/TclScript/tkt2332.test			z:/private/10285A82/tkt2332.test
-../TEST/TclScript/tkt2339.test			z:/private/10285A82/tkt2339.test
-../TEST/TclScript/tkt2391.test			z:/private/10285A82/tkt2391.test
-../TEST/TclScript/tkt2409.test			z:/private/10285A82/tkt2409.test
-../TEST/TclScript/tkt2450.test			z:/private/10285A82/tkt2450.test
-../TEST/TclScript/tkt2640.test			z:/private/10285A82/tkt2640.test
-../TEST/TclScript/tkt2643.test			z:/private/10285A82/tkt2643.test
-../TEST/TclScript/tkt2686.test			z:/private/10285A82/tkt2686.test
-../TEST/TclScript/tkt2767.test			z:/private/10285A82/tkt2767.test
-../TEST/TclScript/tkt2817.test			z:/private/10285A82/tkt2817.test
-../TEST/TclScript/tkt2820.test			z:/private/10285A82/tkt2820.test
-../TEST/TclScript/tkt2822.test			z:/private/10285A82/tkt2822.test
-../TEST/TclScript/tkt2832.test			z:/private/10285A82/tkt2832.test
-../TEST/TclScript/tkt2854.test			z:/private/10285A82/tkt2854.test
-../TEST/TclScript/tkt2920.test			z:/private/10285A82/tkt2920.test
-../TEST/TclScript/tkt2927.test			z:/private/10285A82/tkt2927.test
-../TEST/TclScript/tkt2942.test			z:/private/10285A82/tkt2942.test
-../TEST/TclScript/tkt3080.test			z:/private/10285A82/tkt3080.test
-../TEST/TclScript/tkt3093.test			z:/private/10285A82/tkt3093.test
-../TEST/TclScript/tkt3121.test			z:/private/10285A82/tkt3121.test
-../TEST/TclScript/tkt3201.test			z:/private/10285A82/tkt3201.test
-../TEST/TclScript/tkt3292.test			z:/private/10285A82/tkt3292.test
-../TEST/TclScript/tkt3298.test			z:/private/10285A82/tkt3298.test
-../TEST/TclScript/tkt3334.test			z:/private/10285A82/tkt3334.test
-../TEST/TclScript/tokenize.test			z:/private/10285A82/tokenize.test
-../TEST/TclScript/trace.test			z:/private/10285A82/trace.test
-../TEST/TclScript/trans.test			z:/private/10285A82/trans.test
-../TEST/TclScript/trans2.test			z:/private/10285A82/trans2.test
-../TEST/TclScript/trigger1.test			z:/private/10285A82/trigger1.test
-../TEST/TclScript/trigger2.test			z:/private/10285A82/trigger2.test
-../TEST/TclScript/trigger3.test			z:/private/10285A82/trigger3.test
-../TEST/TclScript/trigger4.test			z:/private/10285A82/trigger4.test
-../TEST/TclScript/trigger5.test			z:/private/10285A82/trigger5.test
-../TEST/TclScript/trigger6.test			z:/private/10285A82/trigger6.test
-../TEST/TclScript/trigger7.test			z:/private/10285A82/trigger7.test
-../TEST/TclScript/trigger8.test			z:/private/10285A82/trigger8.test
-../TEST/TclScript/trigger9.test			z:/private/10285A82/trigger9.test
-../TEST/TclScript/triggerA.test			z:/private/10285A82/triggerA.test
-../TEST/TclScript/triggerB.test			z:/private/10285A82/triggerB.test
-../TEST/TclScript/types.test			z:/private/10285A82/types.test
-../TEST/TclScript/types2.test			z:/private/10285A82/types2.test
-../TEST/TclScript/types3.test			z:/private/10285A82/types3.test
-../TEST/TclScript/unique.test			z:/private/10285A82/unique.test
-../TEST/TclScript/update.test			z:/private/10285A82/update.test
-../TEST/TclScript/utf16align.test		z:/private/10285A82/utf16align.test
-../TEST/TclScript/vacuum.test			z:/private/10285A82/vacuum.test
-../TEST/TclScript/vacuum2.test			z:/private/10285A82/vacuum2.test
-../TEST/TclScript/vacuum3.test			z:/private/10285A82/vacuum3.test
-../TEST/TclScript/varint.test			z:/private/10285A82/varint.test
-../TEST/TclScript/veryquick.test		z:/private/10285A82/veryquick.test
-../TEST/TclScript/view.test				z:/private/10285A82/view.test
-../TEST/TclScript/vtab1.test			z:/private/10285A82/vtab1.test
-../TEST/TclScript/vtab2.test			z:/private/10285A82/vtab2.test
-../TEST/TclScript/vtab3.test			z:/private/10285A82/vtab3.test
-../TEST/TclScript/vtab4.test			z:/private/10285A82/vtab4.test
-../TEST/TclScript/vtab5.test			z:/private/10285A82/vtab5.test
-../TEST/TclScript/vtab6.test			z:/private/10285A82/vtab6.test
-../TEST/TclScript/vtab7.test			z:/private/10285A82/vtab7.test
-../TEST/TclScript/vtab8.test			z:/private/10285A82/vtab8.test
-../TEST/TclScript/vtab9.test			z:/private/10285A82/vtab9.test
-../TEST/TclScript/vtabA.test			z:/private/10285A82/vtabA.test
-../TEST/TclScript/vtabB.test			z:/private/10285A82/vtabB.test
-../TEST/TclScript/vtabC.test			z:/private/10285A82/vtabC.test
-../TEST/TclScript/vtab_alter.test		z:/private/10285A82/vtab_alter.test
-../TEST/TclScript/vtab_err.test			z:/private/10285A82/vtab_err.test
-../TEST/TclScript/vtab_shared.test		z:/private/10285A82/vtab_shared.test
-../TEST/TclScript/where.test			z:/private/10285A82/where.test
-../TEST/TclScript/where2.test			z:/private/10285A82/where2.test
-../TEST/TclScript/where3.test			z:/private/10285A82/where3.test
-../TEST/TclScript/where4.test			z:/private/10285A82/where4.test
-../TEST/TclScript/where5.test			z:/private/10285A82/where5.test
-../TEST/TclScript/where6.test			z:/private/10285A82/where6.test
-../TEST/TclScript/zeroblob.test			z:/private/10285A82/zeroblob.test
+../TEST/TclScript/speed1p.explain			z:/private/10285a82/speed1p.explain
+../TEST/TclScript/speed4p.explain			z:/private/10285a82/speed4p.explain
+../TEST/TclScript/fuzz_common.tcl			z:/private/10285a82/fuzz_common.tcl
+../TEST/TclScript/malloc_common.tcl			z:/private/10285a82/malloc_common.tcl
+../TEST/TclScript/tester.tcl				z:/private/10285a82/tester.tcl
+../TEST/TclScript/thread_common.tcl			z:/private/10285a82/thread_common.tcl
+../TEST/TclScript/trans2.test.gz			z:/private/10285a82/trans2.test.gz
+../TEST/TclScript/aggerror.test				z:/private/10285a82/aggerror.test
+../TEST/TclScript/alias.test				z:/private/10285a82/alias.test
+../TEST/TclScript/all.test					z:/private/10285a82/all.test
+../TEST/TclScript/alter.test				z:/private/10285a82/alter.test
+../TEST/TclScript/alter2.test				z:/private/10285a82/alter2.test
+../TEST/TclScript/alter3.test				z:/private/10285a82/alter3.test
+../TEST/TclScript/altermalloc.test			z:/private/10285a82/altermalloc.test
+../TEST/TclScript/analyze.test				z:/private/10285a82/analyze.test
+../TEST/TclScript/async.test				z:/private/10285a82/async.test
+../TEST/TclScript/async2.test				z:/private/10285a82/async2.test
+../TEST/TclScript/async3.test				z:/private/10285a82/async3.test
+../TEST/TclScript/attach.test				z:/private/10285a82/attach.test
+../TEST/TclScript/attach2.test				z:/private/10285a82/attach2.test
+../TEST/TclScript/attach3.test				z:/private/10285a82/attach3.test
+../TEST/TclScript/attachmalloc.test			z:/private/10285a82/attachmalloc.test
+../TEST/TclScript/auth.test					z:/private/10285a82/auth.test
+../TEST/TclScript/auth2.test				z:/private/10285a82/auth2.test
+../TEST/TclScript/autoinc.test				z:/private/10285a82/autoinc.test
+../TEST/TclScript/autovacuum.test			z:/private/10285a82/autovacuum.test
+../TEST/TclScript/autovacuum_ioerr2.test	z:/private/10285a82/autovacuum_ioerr2.test
+../TEST/TclScript/avtrans.test			z:/private/10285a82/avtrans.test
+../TEST/TclScript/badutf.test			z:/private/10285a82/badutf.test
+../TEST/TclScript/between.test			z:/private/10285a82/between.test
+../TEST/TclScript/bigfile.test			z:/private/10285a82/bigfile.test
+../TEST/TclScript/bigrow.test			z:/private/10285a82/bigrow.test
+../TEST/TclScript/bind.test				z:/private/10285a82/bind.test
+../TEST/TclScript/bindxfer.test			z:/private/10285a82/bindxfer.test
+../TEST/TclScript/bitvec.test			z:/private/10285a82/bitvec.test
+../TEST/TclScript/blob.test				z:/private/10285a82/blob.test
+../TEST/TclScript/busy.test				z:/private/10285a82/busy.test
+../TEST/TclScript/cache.test			z:/private/10285a82/cache.test
+../TEST/TclScript/capi2.test			z:/private/10285a82/capi2.test
+../TEST/TclScript/capi3.test			z:/private/10285a82/capi3.test
+../TEST/TclScript/capi3b.test			z:/private/10285a82/capi3b.test
+../TEST/TclScript/capi3c.test			z:/private/10285a82/capi3c.test
+../TEST/TclScript/capi3d.test			z:/private/10285a82/capi3d.test
+../TEST/TclScript/cast.test				z:/private/10285a82/cast.test
+../TEST/TclScript/check.test			z:/private/10285a82/check.test
+../TEST/TclScript/collate1.test			z:/private/10285a82/collate1.test
+../TEST/TclScript/collate2.test			z:/private/10285a82/collate2.test
+../TEST/TclScript/collate3.test			z:/private/10285a82/collate3.test
+../TEST/TclScript/collate4.test			z:/private/10285a82/collate4.test
+../TEST/TclScript/collate5.test			z:/private/10285a82/collate5.test
+../TEST/TclScript/collate6.test			z:/private/10285a82/collate6.test
+../TEST/TclScript/collate7.test			z:/private/10285a82/collate7.test
+../TEST/TclScript/collate8.test			z:/private/10285a82/collate8.test
+../TEST/TclScript/collate9.test			z:/private/10285a82/collate9.test
+../TEST/TclScript/collateA.test			z:/private/10285a82/collatea.test
+../TEST/TclScript/colmeta.test			z:/private/10285a82/colmeta.test
+../TEST/TclScript/colname.test			z:/private/10285a82/colname.test
+../TEST/TclScript/conflict.test			z:/private/10285a82/conflict.test
+../TEST/TclScript/corrupt.test			z:/private/10285a82/corrupt.test
+../TEST/TclScript/corrupt2.test			z:/private/10285a82/corrupt2.test
+../TEST/TclScript/corrupt3.test			z:/private/10285a82/corrupt3.test
+../TEST/TclScript/corrupt4.test			z:/private/10285a82/corrupt4.test
+../TEST/TclScript/corrupt5.test			z:/private/10285a82/corrupt5.test
+../TEST/TclScript/corrupt6.test			z:/private/10285a82/corrupt6.test
+../TEST/TclScript/corrupt7.test			z:/private/10285a82/corrupt7.test
+../TEST/TclScript/corrupt8.test			z:/private/10285a82/corrupt8.test
+../TEST/TclScript/corrupt9.test			z:/private/10285a82/corrupt9.test
+../TEST/TclScript/corruptA.test			z:/private/10285a82/corrupta.test
+../TEST/TclScript/crash.test			z:/private/10285a82/crash.test
+../TEST/TclScript/crash2.test			z:/private/10285a82/crash2.test
+../TEST/TclScript/crash3.test			z:/private/10285a82/crash3.test
+../TEST/TclScript/crash4.test			z:/private/10285a82/crash4.test
+../TEST/TclScript/crash5.test			z:/private/10285a82/crash5.test
+../TEST/TclScript/crash6.test			z:/private/10285a82/crash6.test
+../TEST/TclScript/crash7.test			z:/private/10285a82/crash7.test
+../TEST/TclScript/createtab.test		z:/private/10285a82/createtab.test
+../TEST/TclScript/cse.test				z:/private/10285a82/cse.test
+../TEST/TclScript/date.test				z:/private/10285a82/date.test
+../TEST/TclScript/default.test			z:/private/10285a82/default.test
+../TEST/TclScript/delete.test			z:/private/10285a82/delete.test
+../TEST/TclScript/delete2.test			z:/private/10285a82/delete2.test
+../TEST/TclScript/delete3.test			z:/private/10285a82/delete3.test
+../TEST/TclScript/descidx1.test			z:/private/10285a82/descidx1.test
+../TEST/TclScript/descidx2.test			z:/private/10285a82/descidx2.test
+../TEST/TclScript/descidx3.test			z:/private/10285a82/descidx3.test
+../TEST/TclScript/diskfull.test			z:/private/10285a82/diskfull.test
+../TEST/TclScript/distinctagg.test		z:/private/10285a82/distinctagg.test
+../TEST/TclScript/enc.test				z:/private/10285a82/enc.test
+../TEST/TclScript/enc2.test				z:/private/10285a82/enc2.test
+../TEST/TclScript/enc3.test				z:/private/10285a82/enc3.test
+../TEST/TclScript/eval.test				z:/private/10285a82/eval.test
+../TEST/TclScript/exclusive.test		z:/private/10285a82/exclusive.test
+../TEST/TclScript/exclusive2.test		z:/private/10285a82/exclusive2.test
+../TEST/TclScript/exec.test				z:/private/10285a82/exec.test
+../TEST/TclScript/expr.test				z:/private/10285a82/expr.test
+../TEST/TclScript/filectrl.test			z:/private/10285a82/filectrl.test
+../TEST/TclScript/filefmt.test			z:/private/10285a82/filefmt.test
+../TEST/TclScript/fkey1.test			z:/private/10285a82/fkey1.test
+../TEST/TclScript/format4.test			z:/private/10285a82/format4.test
+../TEST/TclScript/fts1a.test			z:/private/10285a82/fts1a.test
+../TEST/TclScript/fts1b.test			z:/private/10285a82/fts1b.test
+../TEST/TclScript/fts1c.test			z:/private/10285a82/fts1c.test
+../TEST/TclScript/fts1d.test			z:/private/10285a82/fts1d.test
+../TEST/TclScript/fts1e.test			z:/private/10285a82/fts1e.test
+../TEST/TclScript/fts1f.test			z:/private/10285a82/fts1f.test
+../TEST/TclScript/fts1i.test			z:/private/10285a82/fts1i.test
+../TEST/TclScript/fts1j.test			z:/private/10285a82/fts1j.test
+../TEST/TclScript/fts1k.test			z:/private/10285a82/fts1k.test
+../TEST/TclScript/fts1l.test			z:/private/10285a82/fts1l.test
+../TEST/TclScript/fts1m.test			z:/private/10285a82/fts1m.test
+../TEST/TclScript/fts1n.test			z:/private/10285a82/fts1n.test
+../TEST/TclScript/fts1o.test			z:/private/10285a82/fts1o.test
+../TEST/TclScript/fts1porter.test		z:/private/10285a82/fts1porter.test
+../TEST/TclScript/fts2.test				z:/private/10285a82/fts2.test
+../TEST/TclScript/fts2a.test			z:/private/10285a82/fts2a.test
+../TEST/TclScript/fts2b.test			z:/private/10285a82/fts2b.test
+../TEST/TclScript/fts2c.test			z:/private/10285a82/fts2c.test
+../TEST/TclScript/fts2d.test			z:/private/10285a82/fts2d.test
+../TEST/TclScript/fts2e.test			z:/private/10285a82/fts2e.test
+../TEST/TclScript/fts2f.test			z:/private/10285a82/fts2f.test
+../TEST/TclScript/fts2g.test			z:/private/10285a82/fts2g.test
+../TEST/TclScript/fts2h.test			z:/private/10285a82/fts2h.test
+../TEST/TclScript/fts2i.test			z:/private/10285a82/fts2i.test
+../TEST/TclScript/fts2j.test			z:/private/10285a82/fts2j.test
+../TEST/TclScript/fts2k.test			z:/private/10285a82/fts2k.test
+../TEST/TclScript/fts2l.test			z:/private/10285a82/fts2l.test
+../TEST/TclScript/fts2m.test			z:/private/10285a82/fts2m.test
+../TEST/TclScript/fts2n.test			z:/private/10285a82/fts2n.test
+../TEST/TclScript/fts2o.test			z:/private/10285a82/fts2o.test
+../TEST/TclScript/fts2p.test			z:/private/10285a82/fts2p.test
+../TEST/TclScript/fts2q.test			z:/private/10285a82/fts2q.test
+../TEST/TclScript/fts2r.test			z:/private/10285a82/fts2r.test
+../TEST/TclScript/fts2token.test		z:/private/10285a82/fts2token.test
+../TEST/TclScript/fts3.test				z:/private/10285a82/fts3.test
+../TEST/TclScript/fts3aa.test			z:/private/10285a82/fts3aa.test
+../TEST/TclScript/fts3ab.test			z:/private/10285a82/fts3ab.test
+../TEST/TclScript/fts3ac.test			z:/private/10285a82/fts3ac.test
+../TEST/TclScript/fts3ad.test			z:/private/10285a82/fts3ad.test
+../TEST/TclScript/fts3ae.test			z:/private/10285a82/fts3ae.test
+../TEST/TclScript/fts3af.test			z:/private/10285a82/fts3af.test
+../TEST/TclScript/fts3ag.test			z:/private/10285a82/fts3ag.test
+../TEST/TclScript/fts3ah.test			z:/private/10285a82/fts3ah.test
+../TEST/TclScript/fts3ai.test			z:/private/10285a82/fts3ai.test
+../TEST/TclScript/fts3aj.test			z:/private/10285a82/fts3aj.test
+../TEST/TclScript/fts3ak.test			z:/private/10285a82/fts3ak.test
+../TEST/TclScript/fts3al.test			z:/private/10285a82/fts3al.test
+../TEST/TclScript/fts3am.test			z:/private/10285a82/fts3am.test
+../TEST/TclScript/fts3an.test			z:/private/10285a82/fts3an.test
+../TEST/TclScript/fts3ao.test			z:/private/10285a82/fts3ao.test
+../TEST/TclScript/fts3atoken.test		z:/private/10285a82/fts3atoken.test
+../TEST/TclScript/fts3b.test			z:/private/10285a82/fts3b.test
+../TEST/TclScript/fts3c.test			z:/private/10285a82/fts3c.test
+../TEST/TclScript/fts3d.test			z:/private/10285a82/fts3d.test
+../TEST/TclScript/fts3e.test			z:/private/10285a82/fts3e.test
+../TEST/TclScript/fts3near.test			z:/private/10285a82/fts3near.test
+../TEST/TclScript/func.test				z:/private/10285a82/func.test
+../TEST/TclScript/fuzz.test				z:/private/10285a82/fuzz.test
+../TEST/TclScript/fuzz2.test			z:/private/10285a82/fuzz2.test
+../TEST/TclScript/fuzz_malloc.test		z:/private/10285a82/fuzz_malloc.test
+../TEST/TclScript/hook.test				z:/private/10285a82/hook.test
+../TEST/TclScript/icu.test				z:/private/10285a82/icu.test
+../TEST/TclScript/in.test				z:/private/10285a82/in.test
+../TEST/TclScript/in2.test				z:/private/10285a82/in2.test
+../TEST/TclScript/in3.test				z:/private/10285a82/in3.test
+../TEST/TclScript/incrblob.test			z:/private/10285a82/incrblob.test
+../TEST/TclScript/incrblob2.test		z:/private/10285a82/incrblob2.test
+../TEST/TclScript/incrblob_err.test		z:/private/10285a82/incrblob_err.test
+../TEST/TclScript/incrvacuum.test		z:/private/10285a82/incrvacuum.test
+../TEST/TclScript/incrvacuum2.test		z:/private/10285a82/incrvacuum2.test
+../TEST/TclScript/incrvacuum_ioerr.test	z:/private/10285a82/incrvacuum_ioerr.test
+../TEST/TclScript/index.test			z:/private/10285a82/index.test
+../TEST/TclScript/index2.test			z:/private/10285a82/index2.test
+../TEST/TclScript/index3.test			z:/private/10285a82/index3.test
+../TEST/TclScript/insert.test			z:/private/10285a82/insert.test
+../TEST/TclScript/insert2.test			z:/private/10285a82/insert2.test
+../TEST/TclScript/insert3.test			z:/private/10285a82/insert3.test
+../TEST/TclScript/insert4.test			z:/private/10285a82/insert4.test
+../TEST/TclScript/insert5.test			z:/private/10285a82/insert5.test
+../TEST/TclScript/interrupt.test		z:/private/10285a82/interrupt.test
+../TEST/TclScript/intpkey.test			z:/private/10285a82/intpkey.test
+../TEST/TclScript/io.test				z:/private/10285a82/io.test
+../TEST/TclScript/ioerr.test			z:/private/10285a82/ioerr.test
+../TEST/TclScript/ioerr2.test			z:/private/10285a82/ioerr2.test
+../TEST/TclScript/ioerr3.test			z:/private/10285a82/ioerr3.test
+../TEST/TclScript/ioerr4.test			z:/private/10285a82/ioerr4.test
+../TEST/TclScript/ioerr5.test			z:/private/10285a82/ioerr5.test
+../TEST/TclScript/join.test				z:/private/10285a82/join.test
+../TEST/TclScript/join2.test			z:/private/10285a82/join2.test
+../TEST/TclScript/join3.test			z:/private/10285a82/join3.test
+../TEST/TclScript/join4.test			z:/private/10285a82/join4.test
+../TEST/TclScript/join5.test			z:/private/10285a82/join5.test
+../TEST/TclScript/journal1.test			z:/private/10285a82/journal1.test
+../TEST/TclScript/jrnlmode.test			z:/private/10285a82/jrnlmode.test
+../TEST/TclScript/lastinsert.test		z:/private/10285a82/lastinsert.test
+../TEST/TclScript/laststmtchanges.test	z:/private/10285a82/laststmtchanges.test
+../TEST/TclScript/like.test				z:/private/10285a82/like.test
+../TEST/TclScript/like2.test			z:/private/10285a82/like2.test
+../TEST/TclScript/limit.test			z:/private/10285a82/limit.test
+../TEST/TclScript/loadext.test			z:/private/10285a82/loadext.test
+../TEST/TclScript/loadext2.test			z:/private/10285a82/loadext2.test
+../TEST/TclScript/lock.test				z:/private/10285a82/lock.test
+../TEST/TclScript/lock2.test			z:/private/10285a82/lock2.test
+../TEST/TclScript/lock3.test			z:/private/10285a82/lock3.test
+../TEST/TclScript/lock4.test			z:/private/10285a82/lock4.test
+../TEST/TclScript/lock5.test			z:/private/10285a82/lock5.test
+../TEST/TclScript/lookaside.test		z:/private/10285a82/lookaside.test
+../TEST/TclScript/main.test				z:/private/10285a82/main.test
+../TEST/TclScript/malloc.test			z:/private/10285a82/malloc.test
+../TEST/TclScript/malloc3.test			z:/private/10285a82/malloc3.test
+../TEST/TclScript/malloc4.test			z:/private/10285a82/malloc4.test
+../TEST/TclScript/malloc5.test			z:/private/10285a82/malloc5.test
+../TEST/TclScript/malloc6.test			z:/private/10285a82/malloc6.test
+../TEST/TclScript/malloc7.test			z:/private/10285a82/malloc7.test
+../TEST/TclScript/malloc8.test			z:/private/10285a82/malloc8.test
+../TEST/TclScript/malloc9.test			z:/private/10285a82/malloc9.test
+../TEST/TclScript/mallocA.test			z:/private/10285a82/malloca.test
+../TEST/TclScript/mallocAll.test		z:/private/10285a82/mallocall.test
+../TEST/TclScript/mallocB.test			z:/private/10285a82/mallocb.test
+../TEST/TclScript/mallocC.test			z:/private/10285a82/mallocc.test
+../TEST/TclScript/mallocD.test			z:/private/10285a82/mallocd.test
+../TEST/TclScript/mallocE.test			z:/private/10285a82/malloce.test
+../TEST/TclScript/mallocF.test			z:/private/10285a82/mallocf.test
+../TEST/TclScript/mallocG.test			z:/private/10285a82/mallocg.test
+../TEST/TclScript/mallocH.test			z:/private/10285a82/malloch.test
+../TEST/TclScript/mallocI.test			z:/private/10285a82/malloci.test
+../TEST/TclScript/manydb.test			z:/private/10285a82/manydb.test
+../TEST/TclScript/memdb.test			z:/private/10285a82/memdb.test
+../TEST/TclScript/memleak.test			z:/private/10285a82/memleak.test
+../TEST/TclScript/memsubsys1.test		z:/private/10285a82/memsubsys1.test
+../TEST/TclScript/memsubsys2.test		z:/private/10285a82/memsubsys2.test
+../TEST/TclScript/minmax.test			z:/private/10285a82/minmax.test
+../TEST/TclScript/minmax2.test			z:/private/10285a82/minmax2.test
+../TEST/TclScript/minmax3.test			z:/private/10285a82/minmax3.test
+../TEST/TclScript/misc1.test			z:/private/10285a82/misc1.test
+../TEST/TclScript/misc2.test			z:/private/10285a82/misc2.test
+../TEST/TclScript/misc3.test			z:/private/10285a82/misc3.test
+../TEST/TclScript/misc4.test			z:/private/10285a82/misc4.test
+../TEST/TclScript/misc5.test			z:/private/10285a82/misc5.test
+../TEST/TclScript/misc6.test			z:/private/10285a82/misc6.test
+../TEST/TclScript/misc7.test			z:/private/10285a82/misc7.test
+../TEST/TclScript/misuse.test			z:/private/10285a82/misuse.test
+../TEST/TclScript/mutex1.test			z:/private/10285a82/mutex1.test
+../TEST/TclScript/mutex2.test			z:/private/10285a82/mutex2.test
+../TEST/TclScript/nan.test				z:/private/10285a82/nan.test
+../TEST/TclScript/notnull.test			z:/private/10285a82/notnull.test
+../TEST/TclScript/null.test				z:/private/10285a82/null.test
+../TEST/TclScript/openv2.test			z:/private/10285a82/openv2.test
+../TEST/TclScript/pager.test			z:/private/10285a82/pager.test
+../TEST/TclScript/pager2.test			z:/private/10285a82/pager2.test
+../TEST/TclScript/pager3.test			z:/private/10285a82/pager3.test
+../TEST/TclScript/pageropt.test			z:/private/10285a82/pageropt.test
+../TEST/TclScript/pagesize.test			z:/private/10285a82/pagesize.test
+../TEST/TclScript/pcache.test			z:/private/10285a82/pcache.test
+../TEST/TclScript/permutations.test		z:/private/10285a82/permutations.test
+../TEST/TclScript/pragma.test			z:/private/10285a82/pragma.test
+../TEST/TclScript/pragma2.test			z:/private/10285a82/pragma2.test
+../TEST/TclScript/printf.test			z:/private/10285a82/printf.test
+../TEST/TclScript/progress.test			z:/private/10285a82/progress.test
+../TEST/TclScript/ptrchng.test			z:/private/10285a82/ptrchng.test
+../TEST/TclScript/quick.test			z:/private/10285a82/quick.test
+../TEST/TclScript/quote.test			z:/private/10285a82/quote.test
+../TEST/TclScript/rdonly.test			z:/private/10285a82/rdonly.test
+../TEST/TclScript/reindex.test			z:/private/10285a82/reindex.test
+../TEST/TclScript/rollback.test			z:/private/10285a82/rollback.test
+../TEST/TclScript/rowid.test			z:/private/10285a82/rowid.test
+../TEST/TclScript/rtree.test			z:/private/10285a82/rtree.test
+../TEST/TclScript/safety.test			z:/private/10285a82/safety.test
+../TEST/TclScript/schema.test			z:/private/10285a82/schema.test
+../TEST/TclScript/schema2.test			z:/private/10285a82/schema2.test
+../TEST/TclScript/select1.test			z:/private/10285a82/select1.test
+../TEST/TclScript/select2.test			z:/private/10285a82/select2.test
+../TEST/TclScript/select3.test			z:/private/10285a82/select3.test
+../TEST/TclScript/select4.test			z:/private/10285a82/select4.test
+../TEST/TclScript/select5.test			z:/private/10285a82/select5.test
+../TEST/TclScript/select6.test			z:/private/10285a82/select6.test
+../TEST/TclScript/select7.test			z:/private/10285a82/select7.test
+../TEST/TclScript/select8.test			z:/private/10285a82/select8.test
+../TEST/TclScript/select9.test			z:/private/10285a82/select9.test
+../TEST/TclScript/selectA.test			z:/private/10285a82/selecta.test
+../TEST/TclScript/selectB.test			z:/private/10285a82/selectb.test
+../TEST/TclScript/server1.test			z:/private/10285a82/server1.test
+../TEST/TclScript/shared.test			z:/private/10285a82/shared.test
+../TEST/TclScript/shared2.test			z:/private/10285a82/shared2.test
+../TEST/TclScript/shared3.test			z:/private/10285a82/shared3.test
+../TEST/TclScript/shared4.test			z:/private/10285a82/shared4.test
+../TEST/TclScript/shared_err.test		z:/private/10285a82/shared_err.test
+../TEST/TclScript/shortread1.test		z:/private/10285a82/shortread1.test
+../TEST/TclScript/sidedelete.test		z:/private/10285a82/sidedelete.test
+../TEST/TclScript/soak.test				z:/private/10285a82/soak.test
+../TEST/TclScript/softheap1.test		z:/private/10285a82/softheap1.test
+../TEST/TclScript/sort.test				z:/private/10285a82/sort.test
+../TEST/TclScript/speed1.test			z:/private/10285a82/speed1.test
+../TEST/TclScript/speed1p.test			z:/private/10285a82/speed1p.test
+../TEST/TclScript/speed2.test			z:/private/10285a82/speed2.test
+../TEST/TclScript/speed3.test			z:/private/10285a82/speed3.test
+../TEST/TclScript/speed4.test			z:/private/10285a82/speed4.test
+../TEST/TclScript/speed4p.test			z:/private/10285a82/speed4p.test
+../TEST/TclScript/sqllimits1.test		z:/private/10285a82/sqllimits1.test
+../TEST/TclScript/subquery.test			z:/private/10285a82/subquery.test
+../TEST/TclScript/subselect.test		z:/private/10285a82/subselect.test
+../TEST/TclScript/substr.test			z:/private/10285a82/substr.test
+../TEST/TclScript/sync.test				z:/private/10285a82/sync.test
+../TEST/TclScript/table.test			z:/private/10285a82/table.test
+../TEST/TclScript/tableapi.test			z:/private/10285a82/tableapi.test
+../TEST/TclScript/tclsqlite.test		z:/private/10285a82/tclsqlite.test
+../TEST/TclScript/tempdb.test			z:/private/10285a82/tempdb.test
+../TEST/TclScript/temptable.test		z:/private/10285a82/temptable.test
+../TEST/TclScript/thread001.test		z:/private/10285a82/thread001.test
+../TEST/TclScript/thread002.test		z:/private/10285a82/thread002.test
+../TEST/TclScript/thread003.test		z:/private/10285a82/thread003.test
+../TEST/TclScript/thread1.test			z:/private/10285a82/thread1.test
+../TEST/TclScript/thread2.test			z:/private/10285a82/thread2.test
+../TEST/TclScript/tkt1435.test			z:/private/10285a82/tkt1435.test
+../TEST/TclScript/tkt1443.test			z:/private/10285a82/tkt1443.test
+../TEST/TclScript/tkt1444.test			z:/private/10285a82/tkt1444.test
+../TEST/TclScript/tkt1449.test			z:/private/10285a82/tkt1449.test
+../TEST/TclScript/tkt1473.test			z:/private/10285a82/tkt1473.test
+../TEST/TclScript/tkt1501.test			z:/private/10285a82/tkt1501.test
+../TEST/TclScript/tkt1512.test			z:/private/10285a82/tkt1512.test
+../TEST/TclScript/tkt1514.test			z:/private/10285a82/tkt1514.test
+../TEST/TclScript/tkt1536.test			z:/private/10285a82/tkt1536.test
+../TEST/TclScript/tkt1537.test			z:/private/10285a82/tkt1537.test
+../TEST/TclScript/tkt1567.test			z:/private/10285a82/tkt1567.test
+../TEST/TclScript/tkt1644.test			z:/private/10285a82/tkt1644.test
+../TEST/TclScript/tkt1667.test			z:/private/10285a82/tkt1667.test
+../TEST/TclScript/tkt1873.test			z:/private/10285a82/tkt1873.test
+../TEST/TclScript/tkt2141.test			z:/private/10285a82/tkt2141.test
+../TEST/TclScript/tkt2192.test			z:/private/10285a82/tkt2192.test
+../TEST/TclScript/tkt2213.test			z:/private/10285a82/tkt2213.test
+../TEST/TclScript/tkt2251.test			z:/private/10285a82/tkt2251.test
+../TEST/TclScript/tkt2285.test			z:/private/10285a82/tkt2285.test
+../TEST/TclScript/tkt2332.test			z:/private/10285a82/tkt2332.test
+../TEST/TclScript/tkt2339.test			z:/private/10285a82/tkt2339.test
+../TEST/TclScript/tkt2391.test			z:/private/10285a82/tkt2391.test
+../TEST/TclScript/tkt2409.test			z:/private/10285a82/tkt2409.test
+../TEST/TclScript/tkt2450.test			z:/private/10285a82/tkt2450.test
+../TEST/TclScript/tkt2640.test			z:/private/10285a82/tkt2640.test
+../TEST/TclScript/tkt2643.test			z:/private/10285a82/tkt2643.test
+../TEST/TclScript/tkt2686.test			z:/private/10285a82/tkt2686.test
+../TEST/TclScript/tkt2767.test			z:/private/10285a82/tkt2767.test
+../TEST/TclScript/tkt2817.test			z:/private/10285a82/tkt2817.test
+../TEST/TclScript/tkt2820.test			z:/private/10285a82/tkt2820.test
+../TEST/TclScript/tkt2822.test			z:/private/10285a82/tkt2822.test
+../TEST/TclScript/tkt2832.test			z:/private/10285a82/tkt2832.test
+../TEST/TclScript/tkt2854.test			z:/private/10285a82/tkt2854.test
+../TEST/TclScript/tkt2920.test			z:/private/10285a82/tkt2920.test
+../TEST/TclScript/tkt2927.test			z:/private/10285a82/tkt2927.test
+../TEST/TclScript/tkt2942.test			z:/private/10285a82/tkt2942.test
+../TEST/TclScript/tkt3080.test			z:/private/10285a82/tkt3080.test
+../TEST/TclScript/tkt3093.test			z:/private/10285a82/tkt3093.test
+../TEST/TclScript/tkt3121.test			z:/private/10285a82/tkt3121.test
+../TEST/TclScript/tkt3201.test			z:/private/10285a82/tkt3201.test
+../TEST/TclScript/tkt3292.test			z:/private/10285a82/tkt3292.test
+../TEST/TclScript/tkt3298.test			z:/private/10285a82/tkt3298.test
+../TEST/TclScript/tkt3334.test			z:/private/10285a82/tkt3334.test
+../TEST/TclScript/tokenize.test			z:/private/10285a82/tokenize.test
+../TEST/TclScript/trace.test			z:/private/10285a82/trace.test
+../TEST/TclScript/trans.test			z:/private/10285a82/trans.test
+../TEST/TclScript/trans2.test			z:/private/10285a82/trans2.test
+../TEST/TclScript/trigger1.test			z:/private/10285a82/trigger1.test
+../TEST/TclScript/trigger2.test			z:/private/10285a82/trigger2.test
+../TEST/TclScript/trigger3.test			z:/private/10285a82/trigger3.test
+../TEST/TclScript/trigger4.test			z:/private/10285a82/trigger4.test
+../TEST/TclScript/trigger5.test			z:/private/10285a82/trigger5.test
+../TEST/TclScript/trigger6.test			z:/private/10285a82/trigger6.test
+../TEST/TclScript/trigger7.test			z:/private/10285a82/trigger7.test
+../TEST/TclScript/trigger8.test			z:/private/10285a82/trigger8.test
+../TEST/TclScript/trigger9.test			z:/private/10285a82/trigger9.test
+../TEST/TclScript/triggerA.test			z:/private/10285a82/triggera.test
+../TEST/TclScript/triggerB.test			z:/private/10285a82/triggerb.test
+../TEST/TclScript/types.test			z:/private/10285a82/types.test
+../TEST/TclScript/types2.test			z:/private/10285a82/types2.test
+../TEST/TclScript/types3.test			z:/private/10285a82/types3.test
+../TEST/TclScript/unique.test			z:/private/10285a82/unique.test
+../TEST/TclScript/update.test			z:/private/10285a82/update.test
+../TEST/TclScript/utf16align.test		z:/private/10285a82/utf16align.test
+../TEST/TclScript/vacuum.test			z:/private/10285a82/vacuum.test
+../TEST/TclScript/vacuum2.test			z:/private/10285a82/vacuum2.test
+../TEST/TclScript/vacuum3.test			z:/private/10285a82/vacuum3.test
+../TEST/TclScript/varint.test			z:/private/10285a82/varint.test
+../TEST/TclScript/veryquick.test		z:/private/10285a82/veryquick.test
+../TEST/TclScript/view.test				z:/private/10285a82/view.test
+../TEST/TclScript/vtab1.test			z:/private/10285a82/vtab1.test
+../TEST/TclScript/vtab2.test			z:/private/10285a82/vtab2.test
+../TEST/TclScript/vtab3.test			z:/private/10285a82/vtab3.test
+../TEST/TclScript/vtab4.test			z:/private/10285a82/vtab4.test
+../TEST/TclScript/vtab5.test			z:/private/10285a82/vtab5.test
+../TEST/TclScript/vtab6.test			z:/private/10285a82/vtab6.test
+../TEST/TclScript/vtab7.test			z:/private/10285a82/vtab7.test
+../TEST/TclScript/vtab8.test			z:/private/10285a82/vtab8.test
+../TEST/TclScript/vtab9.test			z:/private/10285a82/vtab9.test
+../TEST/TclScript/vtabA.test			z:/private/10285a82/vtaba.test
+../TEST/TclScript/vtabB.test			z:/private/10285a82/vtabb.test
+../TEST/TclScript/vtabC.test			z:/private/10285a82/vtabc.test
+../TEST/TclScript/vtab_alter.test		z:/private/10285a82/vtab_alter.test
+../TEST/TclScript/vtab_err.test			z:/private/10285a82/vtab_err.test
+../TEST/TclScript/vtab_shared.test		z:/private/10285a82/vtab_shared.test
+../TEST/TclScript/where.test			z:/private/10285a82/where.test
+../TEST/TclScript/where2.test			z:/private/10285a82/where2.test
+../TEST/TclScript/where3.test			z:/private/10285a82/where3.test
+../TEST/TclScript/where4.test			z:/private/10285a82/where4.test
+../TEST/TclScript/where5.test			z:/private/10285a82/where5.test
+../TEST/TclScript/where6.test			z:/private/10285a82/where6.test
+../TEST/TclScript/zeroblob.test			z:/private/10285a82/zeroblob.test
 
 PRJ_TESTMMPFILES
 
--- a/persistentstorage/sqlite3api/GROUP/sqlite3.mmp	Tue Jul 06 16:18:30 2010 +0300
+++ b/persistentstorage/sqlite3api/GROUP/sqlite3.mmp	Wed Aug 18 11:30:17 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -19,14 +19,8 @@
  @file
 */
 
-//#define SYMBIAN_INCLUDE_EXECUTABLE_TRACE
-#include <e32utrace.mmh>
 #include "sqlite3_macro.mmh"
 
-#ifdef SYMBIAN_INCLUDE_EXECUTABLE_TRACE
-MACRO			SQLITE_ENABLE_TRACE
-#endif
-
 TARGET		sqlite3.dll
 TARGETTYPE	dll
 
@@ -78,6 +72,7 @@
 
 //////////////////////////////////////////////////////////////////////////////////////////////////////////
 
+userinclude		../traces_sqlite3
 userinclude		../SQLite
 userinclude		../OsLayer
 OS_LAYER_LIBC_SYSTEMINCLUDE
@@ -146,14 +141,12 @@
 SOURCEPATH	../OsLayer
 SOURCE		FileBuf64.cpp
 SOURCE		os_symbian_mt.cpp
+SOURCE		SqliteUtil.cpp
 #ifdef WINSCW
 SOURCE		os_symbian_emul.cpp
 #else
 SOURCE		os_symbian_hrdw.cpp
 #endif
-#ifdef SYMBIAN_INCLUDE_EXECUTABLE_TRACE
-SOURCE 		UTraceSqlite.cpp
-#endif
 
 LIBRARY		euser.lib 
 LIBRARY		efsrv.lib 
--- a/persistentstorage/sqlite3api/GROUP/sqlite3tests.bat	Tue Jul 06 16:18:30 2010 +0300
+++ b/persistentstorage/sqlite3api/GROUP/sqlite3tests.bat	Wed Aug 18 11:30:17 2010 +0300
@@ -1,5 +1,5 @@
 @rem
-@rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+@rem Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
 @rem All rights reserved.
 @rem This component and the accompanying materials are made available
 @rem under the terms of "Eclipse Public License v1.0"
@@ -14,8 +14,8 @@
 @rem Description:
 @rem
 
-T_SQLITEAPI.EXE
-T_SQLITEWSD.EXE
-T_SQLITEPERF.EXE
-T_SQLITEPERF2.EXE
-T_SQLITEDEF.EXE
+t_sqliteapi.exe
+t_sqlitewsd.exe
+t_sqliteperf.exe
+t_sqliteperf2.exe
+t_sqlitedef.exe
--- a/persistentstorage/sqlite3api/GROUP/sqlite3tests.iby	Tue Jul 06 16:18:30 2010 +0300
+++ b/persistentstorage/sqlite3api/GROUP/sqlite3tests.iby	Wed Aug 18 11:30:17 2010 +0300
@@ -24,7 +24,7 @@
 
 #ifndef __STDIOSERVER_EXE__
 #define __STDIOSERVER_EXE__
-file=ABI_DIR\BUILD_DIR\StdioServer.exe			sys\bin\StdioServer.exe
+file=ABI_DIR\BUILD_DIR\stdioserver.exe			sys\bin\stdioserver.exe
 #endif
 
 #ifndef __TCLSQLITE3_CONFIG_INI__
@@ -32,416 +32,416 @@
 data=DATAZ_\test\config.ini                 system\data\config.ini
 #endif
 
-data=DATAZ_\test\sqlite3Tests.bat			\TEST\sqlite3Tests.bat
+data=DATAZ_\test\sqlite3tests.bat			\test\sqlite3tests.bat
 
-data=ZPRIVATE\10285A82\speed1p.explain		\PRIVATE\10285A82\speed1p.explain
-data=ZPRIVATE\10285A82\speed4p.explain		\PRIVATE\10285A82\speed4p.explain
+data=ZPRIVATE\10285a82\speed1p.explain		\private\10285a82\speed1p.explain
+data=ZPRIVATE\10285a82\speed4p.explain		\private\10285a82\speed4p.explain
 
-data=ZPRIVATE\10285A82\fuzz_common.tcl		\PRIVATE\10285A82\fuzz_common.tcl
-data=ZPRIVATE\10285A82\malloc_common.tcl	\PRIVATE\10285A82\malloc_common.tcl
-data=ZPRIVATE\10285A82\tester.tcl			\PRIVATE\10285A82\tester.tcl
-data=ZPRIVATE\10285A82\thread_common.tcl	\PRIVATE\10285A82\thread_common.tcl
+data=ZPRIVATE\10285a82\fuzz_common.tcl		\private\10285a82\fuzz_common.tcl
+data=ZPRIVATE\10285a82\malloc_common.tcl	\private\10285a82\malloc_common.tcl
+data=ZPRIVATE\10285a82\tester.tcl			\private\10285a82\tester.tcl
+data=ZPRIVATE\10285a82\thread_common.tcl	\private\10285a82\thread_common.tcl
 
-data=ZPRIVATE\10285A82\aggerror.test			\PRIVATE\10285A82\aggerror.test
-data=ZPRIVATE\10285A82\all.test				\PRIVATE\10285A82\all.test
-data=ZPRIVATE\10285A82\alter.test			\PRIVATE\10285A82\alter.test
-data=ZPRIVATE\10285A82\alter2.test			\PRIVATE\10285A82\alter2.test
-data=ZPRIVATE\10285A82\alter3.test			\PRIVATE\10285A82\alter3.test
-data=ZPRIVATE\10285A82\altermalloc.test			\PRIVATE\10285A82\altermalloc.test
-data=ZPRIVATE\10285A82\analyze.test			\PRIVATE\10285A82\analyze.test
-data=ZPRIVATE\10285A82\async.test			\PRIVATE\10285A82\async.test
-data=ZPRIVATE\10285A82\async2.test			\PRIVATE\10285A82\async2.test
-data=ZPRIVATE\10285A82\async3.test			\PRIVATE\10285A82\async3.test
-data=ZPRIVATE\10285A82\attach.test			\PRIVATE\10285A82\attach.test
-data=ZPRIVATE\10285A82\attach2.test			\PRIVATE\10285A82\attach2.test
-data=ZPRIVATE\10285A82\attach3.test			\PRIVATE\10285A82\attach3.test
-data=ZPRIVATE\10285A82\attachmalloc.test		\PRIVATE\10285A82\attachmalloc.test
-data=ZPRIVATE\10285A82\auth.test			\PRIVATE\10285A82\auth.test
-data=ZPRIVATE\10285A82\auth2.test			\PRIVATE\10285A82\auth2.test
-data=ZPRIVATE\10285A82\autoinc.test			\PRIVATE\10285A82\autoinc.test
-data=ZPRIVATE\10285A82\autovacuum.test			\PRIVATE\10285A82\autovacuum.test
-data=ZPRIVATE\10285A82\autovacuum_ioerr2.test		\PRIVATE\10285A82\autovacuum_ioerr2.test
-data=ZPRIVATE\10285A82\avtrans.test			\PRIVATE\10285A82\avtrans.test
-data=ZPRIVATE\10285A82\badutf.test			\PRIVATE\10285A82\badutf.test
-data=ZPRIVATE\10285A82\between.test			\PRIVATE\10285A82\between.test
-data=ZPRIVATE\10285A82\bigfile.test			\PRIVATE\10285A82\bigfile.test
-data=ZPRIVATE\10285A82\bigrow.test			\PRIVATE\10285A82\bigrow.test
-data=ZPRIVATE\10285A82\bind.test			\PRIVATE\10285A82\bind.test
-data=ZPRIVATE\10285A82\bindxfer.test			\PRIVATE\10285A82\bindxfer.test
-data=ZPRIVATE\10285A82\bitvec.test			\PRIVATE\10285A82\bitvec.test
-data=ZPRIVATE\10285A82\blob.test			\PRIVATE\10285A82\blob.test
-data=ZPRIVATE\10285A82\busy.test			\PRIVATE\10285A82\busy.test
-data=ZPRIVATE\10285A82\cache.test			\PRIVATE\10285A82\cache.test
-data=ZPRIVATE\10285A82\capi2.test			\PRIVATE\10285A82\capi2.test
-data=ZPRIVATE\10285A82\capi3.test			\PRIVATE\10285A82\capi3.test
-data=ZPRIVATE\10285A82\capi3b.test			\PRIVATE\10285A82\capi3b.test
-data=ZPRIVATE\10285A82\capi3c.test			\PRIVATE\10285A82\capi3c.test
-data=ZPRIVATE\10285A82\capi3d.test			\PRIVATE\10285A82\capi3d.test
-data=ZPRIVATE\10285A82\cast.test			\PRIVATE\10285A82\cast.test
-data=ZPRIVATE\10285A82\check.test			\PRIVATE\10285A82\check.test
-data=ZPRIVATE\10285A82\collate1.test			\PRIVATE\10285A82\collate1.test
-data=ZPRIVATE\10285A82\collate2.test			\PRIVATE\10285A82\collate2.test
-data=ZPRIVATE\10285A82\collate3.test			\PRIVATE\10285A82\collate3.test
-data=ZPRIVATE\10285A82\collate4.test			\PRIVATE\10285A82\collate4.test
-data=ZPRIVATE\10285A82\collate5.test			\PRIVATE\10285A82\collate5.test
-data=ZPRIVATE\10285A82\collate6.test			\PRIVATE\10285A82\collate6.test
-data=ZPRIVATE\10285A82\collate7.test			\PRIVATE\10285A82\collate7.test
-data=ZPRIVATE\10285A82\collate8.test			\PRIVATE\10285A82\collate8.test
-data=ZPRIVATE\10285A82\collate9.test			\PRIVATE\10285A82\collate9.test
-data=ZPRIVATE\10285A82\collateA.test			\PRIVATE\10285A82\collateA.test
-data=ZPRIVATE\10285A82\colmeta.test			\PRIVATE\10285A82\colmeta.test
-data=ZPRIVATE\10285A82\colname.test			\PRIVATE\10285A82\colname.test
-data=ZPRIVATE\10285A82\conflict.test			\PRIVATE\10285A82\conflict.test
-data=ZPRIVATE\10285A82\corrupt.test			\PRIVATE\10285A82\corrupt.test
-data=ZPRIVATE\10285A82\corrupt2.test			\PRIVATE\10285A82\corrupt2.test
-data=ZPRIVATE\10285A82\corrupt3.test			\PRIVATE\10285A82\corrupt3.test
-data=ZPRIVATE\10285A82\corrupt4.test			\PRIVATE\10285A82\corrupt4.test
-data=ZPRIVATE\10285A82\corrupt5.test			\PRIVATE\10285A82\corrupt5.test
-data=ZPRIVATE\10285A82\corrupt6.test			\PRIVATE\10285A82\corrupt6.test
-data=ZPRIVATE\10285A82\corrupt7.test			\PRIVATE\10285A82\corrupt7.test
-data=ZPRIVATE\10285A82\corrupt8.test			\PRIVATE\10285A82\corrupt8.test
-data=ZPRIVATE\10285A82\corrupt9.test			\PRIVATE\10285A82\corrupt9.test
-data=ZPRIVATE\10285A82\corruptA.test			\PRIVATE\10285A82\corruptA.test
-data=ZPRIVATE\10285A82\crash.test			\PRIVATE\10285A82\crash.test
-data=ZPRIVATE\10285A82\crash2.test			\PRIVATE\10285A82\crash2.test
-data=ZPRIVATE\10285A82\crash3.test			\PRIVATE\10285A82\crash3.test
-data=ZPRIVATE\10285A82\crash4.test			\PRIVATE\10285A82\crash4.test
-data=ZPRIVATE\10285A82\crash5.test			\PRIVATE\10285A82\crash5.test
-data=ZPRIVATE\10285A82\crash6.test			\PRIVATE\10285A82\crash6.test
-data=ZPRIVATE\10285A82\crash7.test			\PRIVATE\10285A82\crash7.test
-data=ZPRIVATE\10285A82\createtab.test		\PRIVATE\10285A82\createtab.test
-data=ZPRIVATE\10285A82\cse.test				\PRIVATE\10285A82\cse.test
-data=ZPRIVATE\10285A82\date.test			\PRIVATE\10285A82\date.test
-data=ZPRIVATE\10285A82\default.test			\PRIVATE\10285A82\default.test
-data=ZPRIVATE\10285A82\delete.test			\PRIVATE\10285A82\delete.test
-data=ZPRIVATE\10285A82\delete2.test			\PRIVATE\10285A82\delete2.test
-data=ZPRIVATE\10285A82\delete3.test			\PRIVATE\10285A82\delete3.test
-data=ZPRIVATE\10285A82\descidx1.test			\PRIVATE\10285A82\descidx1.test
-data=ZPRIVATE\10285A82\descidx2.test			\PRIVATE\10285A82\descidx2.test
-data=ZPRIVATE\10285A82\descidx3.test			\PRIVATE\10285A82\descidx3.test
-data=ZPRIVATE\10285A82\diskfull.test			\PRIVATE\10285A82\diskfull.test
-data=ZPRIVATE\10285A82\distinctagg.test			\PRIVATE\10285A82\distinctagg.test
-data=ZPRIVATE\10285A82\enc.test				\PRIVATE\10285A82\enc.test
-data=ZPRIVATE\10285A82\enc2.test			\PRIVATE\10285A82\enc2.test
-data=ZPRIVATE\10285A82\enc3.test			\PRIVATE\10285A82\enc3.test
-data=ZPRIVATE\10285A82\eval.test			\PRIVATE\10285A82\eval.test
-data=ZPRIVATE\10285A82\exclusive.test			\PRIVATE\10285A82\exclusive.test
-data=ZPRIVATE\10285A82\exclusive2.test			\PRIVATE\10285A82\exclusive2.test
-data=ZPRIVATE\10285A82\exec.test			\PRIVATE\10285A82\exec.test
-data=ZPRIVATE\10285A82\expr.test			\PRIVATE\10285A82\expr.test
-data=ZPRIVATE\10285A82\filectrl.test		\PRIVATE\10285A82\filectrl.test
-data=ZPRIVATE\10285A82\filefmt.test			\PRIVATE\10285A82\filefmt.test
-data=ZPRIVATE\10285A82\fkey1.test			\PRIVATE\10285A82\fkey1.test
-data=ZPRIVATE\10285A82\format4.test			\PRIVATE\10285A82\format4.test
-data=ZPRIVATE\10285A82\fts1a.test			\PRIVATE\10285A82\fts1a.test
-data=ZPRIVATE\10285A82\fts1b.test			\PRIVATE\10285A82\fts1b.test
-data=ZPRIVATE\10285A82\fts1c.test			\PRIVATE\10285A82\fts1c.test
-data=ZPRIVATE\10285A82\fts1d.test			\PRIVATE\10285A82\fts1d.test
-data=ZPRIVATE\10285A82\fts1e.test			\PRIVATE\10285A82\fts1e.test
-data=ZPRIVATE\10285A82\fts1f.test			\PRIVATE\10285A82\fts1f.test
-data=ZPRIVATE\10285A82\fts1i.test			\PRIVATE\10285A82\fts1i.test
-data=ZPRIVATE\10285A82\fts1j.test			\PRIVATE\10285A82\fts1j.test
-data=ZPRIVATE\10285A82\fts1k.test			\PRIVATE\10285A82\fts1k.test
-data=ZPRIVATE\10285A82\fts1l.test			\PRIVATE\10285A82\fts1l.test
-data=ZPRIVATE\10285A82\fts1m.test			\PRIVATE\10285A82\fts1m.test
-data=ZPRIVATE\10285A82\fts1n.test			\PRIVATE\10285A82\fts1n.test
-data=ZPRIVATE\10285A82\fts1o.test			\PRIVATE\10285A82\fts1o.test
-data=ZPRIVATE\10285A82\fts1porter.test			\PRIVATE\10285A82\fts1porter.test
-data=ZPRIVATE\10285A82\fts2a.test			\PRIVATE\10285A82\fts2a.test
-data=ZPRIVATE\10285A82\fts2b.test			\PRIVATE\10285A82\fts2b.test
-data=ZPRIVATE\10285A82\fts2c.test			\PRIVATE\10285A82\fts2c.test
-data=ZPRIVATE\10285A82\fts2d.test			\PRIVATE\10285A82\fts2d.test
-data=ZPRIVATE\10285A82\fts2e.test			\PRIVATE\10285A82\fts2e.test
-data=ZPRIVATE\10285A82\fts2f.test			\PRIVATE\10285A82\fts2f.test
-data=ZPRIVATE\10285A82\fts2g.test			\PRIVATE\10285A82\fts2g.test
-data=ZPRIVATE\10285A82\fts2h.test			\PRIVATE\10285A82\fts2h.test
-data=ZPRIVATE\10285A82\fts2i.test			\PRIVATE\10285A82\fts2i.test
-data=ZPRIVATE\10285A82\fts2j.test			\PRIVATE\10285A82\fts2j.test
-data=ZPRIVATE\10285A82\fts2k.test			\PRIVATE\10285A82\fts2k.test
-data=ZPRIVATE\10285A82\fts2l.test			\PRIVATE\10285A82\fts2l.test
-data=ZPRIVATE\10285A82\fts2m.test			\PRIVATE\10285A82\fts2m.test
-data=ZPRIVATE\10285A82\fts2o.test			\PRIVATE\10285A82\fts2o.test
-data=ZPRIVATE\10285A82\fts2p.test			\PRIVATE\10285A82\fts2p.test
-data=ZPRIVATE\10285A82\fts2q.test			\PRIVATE\10285A82\fts2q.test
-data=ZPRIVATE\10285A82\fts2r.test			\PRIVATE\10285A82\fts2r.test
-data=ZPRIVATE\10285A82\fts2token.test		\PRIVATE\10285A82\fts2token.test
-data=ZPRIVATE\10285A82\fts3.test			\PRIVATE\10285A82\fts3.test
-data=ZPRIVATE\10285A82\fts3aa.test			\PRIVATE\10285A82\fts3aa.test
-data=ZPRIVATE\10285A82\fts3ab.test			\PRIVATE\10285A82\fts3ab.test
-data=ZPRIVATE\10285A82\fts3ac.test			\PRIVATE\10285A82\fts3ac.test
-data=ZPRIVATE\10285A82\fts3ad.test			\PRIVATE\10285A82\fts3ad.test
-data=ZPRIVATE\10285A82\fts3ae.test			\PRIVATE\10285A82\fts3ae.test
-data=ZPRIVATE\10285A82\fts3af.test			\PRIVATE\10285A82\fts3af.test
-data=ZPRIVATE\10285A82\fts3ag.test			\PRIVATE\10285A82\fts3ag.test
-data=ZPRIVATE\10285A82\fts3ah.test			\PRIVATE\10285A82\fts3ah.test
-data=ZPRIVATE\10285A82\fts3ai.test			\PRIVATE\10285A82\fts3ai.test
-data=ZPRIVATE\10285A82\fts3aj.test			\PRIVATE\10285A82\fts3aj.test
-data=ZPRIVATE\10285A82\fts3ak.test			\PRIVATE\10285A82\fts3ak.test
-data=ZPRIVATE\10285A82\fts3al.test			\PRIVATE\10285A82\fts3al.test
-data=ZPRIVATE\10285A82\fts3am.test			\PRIVATE\10285A82\fts3am.test
-data=ZPRIVATE\10285A82\fts3an.test			\PRIVATE\10285A82\fts3an.test
-data=ZPRIVATE\10285A82\fts3ao.test			\PRIVATE\10285A82\fts3ao.test
-data=ZPRIVATE\10285A82\fts3atoken.test		\PRIVATE\10285A82\fts3atoken.test
-data=ZPRIVATE\10285A82\fts3b.test			\PRIVATE\10285A82\fts3b.test
-data=ZPRIVATE\10285A82\fts3c.test			\PRIVATE\10285A82\fts3c.test
-data=ZPRIVATE\10285A82\fts3d.test			\PRIVATE\10285A82\fts3d.test
-data=ZPRIVATE\10285A82\fts3e.test			\PRIVATE\10285A82\fts3e.test
-data=ZPRIVATE\10285A82\fts3near.test		\PRIVATE\10285A82\fts3near.test
-data=ZPRIVATE\10285A82\func.test			\PRIVATE\10285A82\func.test
-data=ZPRIVATE\10285A82\fuzz.test			\PRIVATE\10285A82\fuzz.test
-data=ZPRIVATE\10285A82\fuzz2.test			\PRIVATE\10285A82\fuzz2.test
-data=ZPRIVATE\10285A82\fuzz_malloc.test		\PRIVATE\10285A82\fuzz_malloc.test
-data=ZPRIVATE\10285A82\hook.test			\PRIVATE\10285A82\hook.test
-data=ZPRIVATE\10285A82\icu.test				\PRIVATE\10285A82\icu.test
-data=ZPRIVATE\10285A82\in.test				\PRIVATE\10285A82\in.test
-data=ZPRIVATE\10285A82\in2.test				\PRIVATE\10285A82\in2.test
-data=ZPRIVATE\10285A82\in3.test				\PRIVATE\10285A82\in3.test
-data=ZPRIVATE\10285A82\incrblob.test		\PRIVATE\10285A82\incrblob.test
-data=ZPRIVATE\10285A82\incrblob2.test		\PRIVATE\10285A82\incrblob2.test
-data=ZPRIVATE\10285A82\incrblob_err.test	\PRIVATE\10285A82\incrblob_err.test
-data=ZPRIVATE\10285A82\incrvacuum.test		\PRIVATE\10285A82\incrvacuum.test
-data=ZPRIVATE\10285A82\incrvacuum2.test		\PRIVATE\10285A82\incrvacuum2.test
-data=ZPRIVATE\10285A82\incrvacuum_ioerr.test \PRIVATE\10285A82\incrvacuum_ioerr.test
-data=ZPRIVATE\10285A82\index.test			\PRIVATE\10285A82\index.test
-data=ZPRIVATE\10285A82\index2.test			\PRIVATE\10285A82\index2.test
-data=ZPRIVATE\10285A82\index3.test			\PRIVATE\10285A82\index3.test
-data=ZPRIVATE\10285A82\insert.test			\PRIVATE\10285A82\insert.test
-data=ZPRIVATE\10285A82\insert2.test			\PRIVATE\10285A82\insert2.test
-data=ZPRIVATE\10285A82\insert3.test			\PRIVATE\10285A82\insert3.test
-data=ZPRIVATE\10285A82\insert4.test			\PRIVATE\10285A82\insert4.test
-data=ZPRIVATE\10285A82\insert5.test			\PRIVATE\10285A82\insert5.test
-data=ZPRIVATE\10285A82\interrupt.test			\PRIVATE\10285A82\interrupt.test
-data=ZPRIVATE\10285A82\intpkey.test			\PRIVATE\10285A82\intpkey.test
-data=ZPRIVATE\10285A82\io.test				\PRIVATE\10285A82\io.test
-data=ZPRIVATE\10285A82\ioerr.test			\PRIVATE\10285A82\ioerr.test
-data=ZPRIVATE\10285A82\ioerr2.test			\PRIVATE\10285A82\ioerr2.test
-data=ZPRIVATE\10285A82\ioerr3.test			\PRIVATE\10285A82\ioerr3.test
-data=ZPRIVATE\10285A82\ioerr4.test			\PRIVATE\10285A82\ioerr4.test
-data=ZPRIVATE\10285A82\ioerr5.test			\PRIVATE\10285A82\ioerr5.test
-data=ZPRIVATE\10285A82\join.test			\PRIVATE\10285A82\join.test
-data=ZPRIVATE\10285A82\join2.test			\PRIVATE\10285A82\join2.test
-data=ZPRIVATE\10285A82\join3.test			\PRIVATE\10285A82\join3.test
-data=ZPRIVATE\10285A82\join4.test			\PRIVATE\10285A82\join4.test
-data=ZPRIVATE\10285A82\join5.test			\PRIVATE\10285A82\join5.test
-data=ZPRIVATE\10285A82\journal1.test			\PRIVATE\10285A82\journal1.test
-data=ZPRIVATE\10285A82\jrnlmode.test			\PRIVATE\10285A82\jrnlmode.test
-data=ZPRIVATE\10285A82\lastinsert.test			\PRIVATE\10285A82\lastinsert.test
-data=ZPRIVATE\10285A82\laststmtchanges.test		\PRIVATE\10285A82\laststmtchanges.test
-data=ZPRIVATE\10285A82\like.test			\PRIVATE\10285A82\like.test
-data=ZPRIVATE\10285A82\like2.test			\PRIVATE\10285A82\like2.test
-data=ZPRIVATE\10285A82\limit.test			\PRIVATE\10285A82\limit.test
-data=ZPRIVATE\10285A82\loadext.test			\PRIVATE\10285A82\loadext.test
-data=ZPRIVATE\10285A82\loadext2.test			\PRIVATE\10285A82\loadext2.test
-data=ZPRIVATE\10285A82\lock.test			\PRIVATE\10285A82\lock.test
-data=ZPRIVATE\10285A82\lock2.test			\PRIVATE\10285A82\lock2.test
-data=ZPRIVATE\10285A82\lock3.test			\PRIVATE\10285A82\lock3.test
-data=ZPRIVATE\10285A82\lock4.test			\PRIVATE\10285A82\lock4.test
-data=ZPRIVATE\10285A82\lock5.test			\PRIVATE\10285A82\lock5.test
-data=ZPRIVATE\10285A82\lookaside.test		\PRIVATE\10285A82\lookaside.test
-data=ZPRIVATE\10285A82\main.test			\PRIVATE\10285A82\main.test
-data=ZPRIVATE\10285A82\malloc.test			\PRIVATE\10285A82\malloc.test
-data=ZPRIVATE\10285A82\malloc3.test			\PRIVATE\10285A82\malloc3.test
-data=ZPRIVATE\10285A82\malloc4.test			\PRIVATE\10285A82\malloc4.test
-data=ZPRIVATE\10285A82\malloc5.test			\PRIVATE\10285A82\malloc5.test
-data=ZPRIVATE\10285A82\malloc6.test			\PRIVATE\10285A82\malloc6.test
-data=ZPRIVATE\10285A82\malloc7.test			\PRIVATE\10285A82\malloc7.test
-data=ZPRIVATE\10285A82\malloc8.test			\PRIVATE\10285A82\malloc8.test
-data=ZPRIVATE\10285A82\malloc9.test			\PRIVATE\10285A82\malloc9.test
-data=ZPRIVATE\10285A82\mallocA.test			\PRIVATE\10285A82\mallocA.test
-data=ZPRIVATE\10285A82\mallocAll.test		\PRIVATE\10285A82\mallocAll.test
-data=ZPRIVATE\10285A82\mallocB.test			\PRIVATE\10285A82\mallocB.test
-data=ZPRIVATE\10285A82\mallocC.test			\PRIVATE\10285A82\mallocC.test
-data=ZPRIVATE\10285A82\mallocD.test			\PRIVATE\10285A82\mallocD.test
-data=ZPRIVATE\10285A82\mallocE.test			\PRIVATE\10285A82\mallocE.test
-data=ZPRIVATE\10285A82\mallocF.test			\PRIVATE\10285A82\mallocF.test
-data=ZPRIVATE\10285A82\mallocG.test			\PRIVATE\10285A82\mallocG.test
-data=ZPRIVATE\10285A82\mallocH.test			\PRIVATE\10285A82\mallocH.test
-data=ZPRIVATE\10285A82\mallocI.test			\PRIVATE\10285A82\mallocI.test
-data=ZPRIVATE\10285A82\manydb.test			\PRIVATE\10285A82\manydb.test
-data=ZPRIVATE\10285A82\memdb.test			\PRIVATE\10285A82\memdb.test
-data=ZPRIVATE\10285A82\memleak.test			\PRIVATE\10285A82\memleak.test
-data=ZPRIVATE\10285A82\memsubsys1.test		\PRIVATE\10285A82\memsubsys1.test
-data=ZPRIVATE\10285A82\memsubsys2.test		\PRIVATE\10285A82\memsubsys2.test
-data=ZPRIVATE\10285A82\minmax.test			\PRIVATE\10285A82\minmax.test
-data=ZPRIVATE\10285A82\minmax2.test			\PRIVATE\10285A82\minmax2.test
-data=ZPRIVATE\10285A82\minmax3.test			\PRIVATE\10285A82\minmax3.test
-data=ZPRIVATE\10285A82\misc1.test			\PRIVATE\10285A82\misc1.test
-data=ZPRIVATE\10285A82\misc2.test			\PRIVATE\10285A82\misc2.test
-data=ZPRIVATE\10285A82\misc3.test			\PRIVATE\10285A82\misc3.test
-data=ZPRIVATE\10285A82\misc4.test			\PRIVATE\10285A82\misc4.test
-data=ZPRIVATE\10285A82\misc5.test			\PRIVATE\10285A82\misc5.test
-data=ZPRIVATE\10285A82\misc6.test			\PRIVATE\10285A82\misc6.test
-data=ZPRIVATE\10285A82\misc7.test			\PRIVATE\10285A82\misc7.test
-data=ZPRIVATE\10285A82\misuse.test			\PRIVATE\10285A82\misuse.test
-data=ZPRIVATE\10285A82\mutex1.test			\PRIVATE\10285A82\mutex1.test
-data=ZPRIVATE\10285A82\mutex2.test			\PRIVATE\10285A82\mutex2.test
-data=ZPRIVATE\10285A82\nan.test				\PRIVATE\10285A82\nan.test
-data=ZPRIVATE\10285A82\notnull.test			\PRIVATE\10285A82\notnull.test
-data=ZPRIVATE\10285A82\null.test			\PRIVATE\10285A82\null.test
-data=ZPRIVATE\10285A82\openv2.test			\PRIVATE\10285A82\openv2.test
-data=ZPRIVATE\10285A82\pager.test			\PRIVATE\10285A82\pager.test
-data=ZPRIVATE\10285A82\pager2.test			\PRIVATE\10285A82\pager2.test
-data=ZPRIVATE\10285A82\pager3.test			\PRIVATE\10285A82\pager3.test
-data=ZPRIVATE\10285A82\pageropt.test			\PRIVATE\10285A82\pageropt.test
-data=ZPRIVATE\10285A82\pagesize.test			\PRIVATE\10285A82\pagesize.test
-data=ZPRIVATE\10285A82\permutations.test		\PRIVATE\10285A82\permutations.test
-data=ZPRIVATE\10285A82\pragma.test			\PRIVATE\10285A82\pragma.test
-data=ZPRIVATE\10285A82\pragma2.test			\PRIVATE\10285A82\pragma2.test
-data=ZPRIVATE\10285A82\printf.test			\PRIVATE\10285A82\printf.test
-data=ZPRIVATE\10285A82\progress.test			\PRIVATE\10285A82\progress.test
-data=ZPRIVATE\10285A82\ptrchng.test			\PRIVATE\10285A82\ptrchng.test
-data=ZPRIVATE\10285A82\quick.test			\PRIVATE\10285A82\quick.test
-data=ZPRIVATE\10285A82\quote.test			\PRIVATE\10285A82\quote.test
-data=ZPRIVATE\10285A82\rdonly.test			\PRIVATE\10285A82\rdonly.test
-data=ZPRIVATE\10285A82\reindex.test			\PRIVATE\10285A82\reindex.test
-data=ZPRIVATE\10285A82\rollback.test			\PRIVATE\10285A82\rollback.test
-data=ZPRIVATE\10285A82\rowid.test			\PRIVATE\10285A82\rowid.test
-data=ZPRIVATE\10285A82\rtree.test			\PRIVATE\10285A82\rtree.test
-data=ZPRIVATE\10285A82\safety.test			\PRIVATE\10285A82\safety.test
-data=ZPRIVATE\10285A82\schema.test			\PRIVATE\10285A82\schema.test
-data=ZPRIVATE\10285A82\schema2.test			\PRIVATE\10285A82\schema2.test
-data=ZPRIVATE\10285A82\select1.test			\PRIVATE\10285A82\select1.test
-data=ZPRIVATE\10285A82\select2.test			\PRIVATE\10285A82\select2.test
-data=ZPRIVATE\10285A82\select3.test			\PRIVATE\10285A82\select3.test
-data=ZPRIVATE\10285A82\select4.test			\PRIVATE\10285A82\select4.test
-data=ZPRIVATE\10285A82\select5.test			\PRIVATE\10285A82\select5.test
-data=ZPRIVATE\10285A82\select6.test			\PRIVATE\10285A82\select6.test
-data=ZPRIVATE\10285A82\select7.test			\PRIVATE\10285A82\select7.test
-data=ZPRIVATE\10285A82\select8.test			\PRIVATE\10285A82\select8.test
-data=ZPRIVATE\10285A82\select9.test			\PRIVATE\10285A82\select9.test
-data=ZPRIVATE\10285A82\selectA.test			\PRIVATE\10285A82\selectA.test
-data=ZPRIVATE\10285A82\selectB.test			\PRIVATE\10285A82\selectB.test
-data=ZPRIVATE\10285A82\server1.test			\PRIVATE\10285A82\server1.test
-data=ZPRIVATE\10285A82\shared.test			\PRIVATE\10285A82\shared.test
-data=ZPRIVATE\10285A82\shared2.test			\PRIVATE\10285A82\shared2.test
-data=ZPRIVATE\10285A82\shared3.test			\PRIVATE\10285A82\shared3.test
-data=ZPRIVATE\10285A82\shared4.test			\PRIVATE\10285A82\shared4.test
-data=ZPRIVATE\10285A82\shared_err.test			\PRIVATE\10285A82\shared_err.test
-data=ZPRIVATE\10285A82\shortread1.test			\PRIVATE\10285A82\shortread1.test
-data=ZPRIVATE\10285A82\sidedelete.test			\PRIVATE\10285A82\sidedelete.test
-data=ZPRIVATE\10285A82\soak.test			\PRIVATE\10285A82\soak.test
-data=ZPRIVATE\10285A82\softheap1.test			\PRIVATE\10285A82\softheap1.test
-data=ZPRIVATE\10285A82\sort.test			\PRIVATE\10285A82\sort.test
-data=ZPRIVATE\10285A82\speed1.test			\PRIVATE\10285A82\speed1.test
-data=ZPRIVATE\10285A82\speed1p.test			\PRIVATE\10285A82\speed1p.test
-data=ZPRIVATE\10285A82\speed2.test			\PRIVATE\10285A82\speed2.test
-data=ZPRIVATE\10285A82\speed3.test			\PRIVATE\10285A82\speed3.test
-data=ZPRIVATE\10285A82\speed4.test			\PRIVATE\10285A82\speed4.test
-data=ZPRIVATE\10285A82\speed4p.test			\PRIVATE\10285A82\speed4p.test
-data=ZPRIVATE\10285A82\sqllimits1.test			\PRIVATE\10285A82\sqllimits1.test
-data=ZPRIVATE\10285A82\subquery.test			\PRIVATE\10285A82\subquery.test
-data=ZPRIVATE\10285A82\subselect.test			\PRIVATE\10285A82\subselect.test
-data=ZPRIVATE\10285A82\substr.test			\PRIVATE\10285A82\substr.test
-data=ZPRIVATE\10285A82\sync.test			\PRIVATE\10285A82\sync.test
-data=ZPRIVATE\10285A82\table.test			\PRIVATE\10285A82\table.test
-data=ZPRIVATE\10285A82\tableapi.test			\PRIVATE\10285A82\tableapi.test
-data=ZPRIVATE\10285A82\tclsqlite.test			\PRIVATE\10285A82\tclsqlite.test
-data=ZPRIVATE\10285A82\tempdb.test			\PRIVATE\10285A82\tempdb.test
-data=ZPRIVATE\10285A82\temptable.test			\PRIVATE\10285A82\temptable.test
-data=ZPRIVATE\10285A82\thread001.test			\PRIVATE\10285A82\thread001.test
-data=ZPRIVATE\10285A82\thread002.test			\PRIVATE\10285A82\thread002.test
-data=ZPRIVATE\10285A82\thread1.test			\PRIVATE\10285A82\thread1.test
-data=ZPRIVATE\10285A82\thread2.test			\PRIVATE\10285A82\thread2.test
-data=ZPRIVATE\10285A82\tkt1435.test			\PRIVATE\10285A82\tkt1435.test
-data=ZPRIVATE\10285A82\tkt1443.test			\PRIVATE\10285A82\tkt1443.test
-data=ZPRIVATE\10285A82\tkt1444.test			\PRIVATE\10285A82\tkt1444.test
-data=ZPRIVATE\10285A82\tkt1449.test			\PRIVATE\10285A82\tkt1449.test
-data=ZPRIVATE\10285A82\tkt1473.test			\PRIVATE\10285A82\tkt1473.test
-data=ZPRIVATE\10285A82\tkt1501.test			\PRIVATE\10285A82\tkt1501.test
-data=ZPRIVATE\10285A82\tkt1512.test			\PRIVATE\10285A82\tkt1512.test
-data=ZPRIVATE\10285A82\tkt1514.test			\PRIVATE\10285A82\tkt1514.test
-data=ZPRIVATE\10285A82\tkt1536.test			\PRIVATE\10285A82\tkt1536.test
-data=ZPRIVATE\10285A82\tkt1537.test			\PRIVATE\10285A82\tkt1537.test
-data=ZPRIVATE\10285A82\tkt1567.test			\PRIVATE\10285A82\tkt1567.test
-data=ZPRIVATE\10285A82\tkt1644.test			\PRIVATE\10285A82\tkt1644.test
-data=ZPRIVATE\10285A82\tkt1667.test			\PRIVATE\10285A82\tkt1667.test
-data=ZPRIVATE\10285A82\tkt1873.test			\PRIVATE\10285A82\tkt1873.test
-data=ZPRIVATE\10285A82\tkt2141.test			\PRIVATE\10285A82\tkt2141.test
-data=ZPRIVATE\10285A82\tkt2192.test			\PRIVATE\10285A82\tkt2192.test
-data=ZPRIVATE\10285A82\tkt2213.test			\PRIVATE\10285A82\tkt2213.test
-data=ZPRIVATE\10285A82\tkt2251.test			\PRIVATE\10285A82\tkt2251.test
-data=ZPRIVATE\10285A82\tkt2285.test			\PRIVATE\10285A82\tkt2285.test
-data=ZPRIVATE\10285A82\tkt2332.test			\PRIVATE\10285A82\tkt2332.test
-data=ZPRIVATE\10285A82\tkt2339.test			\PRIVATE\10285A82\tkt2339.test
-data=ZPRIVATE\10285A82\tkt2391.test			\PRIVATE\10285A82\tkt2391.test
-data=ZPRIVATE\10285A82\tkt2409.test			\PRIVATE\10285A82\tkt2409.test
-data=ZPRIVATE\10285A82\tkt2450.test			\PRIVATE\10285A82\tkt2450.test
-data=ZPRIVATE\10285A82\tkt2640.test			\PRIVATE\10285A82\tkt2640.test
-data=ZPRIVATE\10285A82\tkt2643.test			\PRIVATE\10285A82\tkt2643.test
-data=ZPRIVATE\10285A82\tkt2686.test			\PRIVATE\10285A82\tkt2686.test
-data=ZPRIVATE\10285A82\tkt2767.test			\PRIVATE\10285A82\tkt2767.test
-data=ZPRIVATE\10285A82\tkt2817.test			\PRIVATE\10285A82\tkt2817.test
-data=ZPRIVATE\10285A82\tkt2820.test			\PRIVATE\10285A82\tkt2820.test
-data=ZPRIVATE\10285A82\tkt2822.test			\PRIVATE\10285A82\tkt2822.test
-data=ZPRIVATE\10285A82\tkt2832.test			\PRIVATE\10285A82\tkt2832.test
-data=ZPRIVATE\10285A82\tkt2854.test			\PRIVATE\10285A82\tkt2854.test
-data=ZPRIVATE\10285A82\tkt2920.test			\PRIVATE\10285A82\tkt2920.test
-data=ZPRIVATE\10285A82\tkt2927.test			\PRIVATE\10285A82\tkt2927.test
-data=ZPRIVATE\10285A82\tkt2942.test			\PRIVATE\10285A82\tkt2942.test
-data=ZPRIVATE\10285A82\tkt3080.test			\PRIVATE\10285A82\tkt3080.test
-data=ZPRIVATE\10285A82\tkt3093.test			\PRIVATE\10285A82\tkt3093.test
-data=ZPRIVATE\10285A82\tkt3121.test			\PRIVATE\10285A82\tkt3121.test
-data=ZPRIVATE\10285A82\tkt3201.test			\PRIVATE\10285A82\tkt3201.test
-data=ZPRIVATE\10285A82\tokenize.test			\PRIVATE\10285A82\tokenize.test
-data=ZPRIVATE\10285A82\trace.test			\PRIVATE\10285A82\trace.test
-data=ZPRIVATE\10285A82\trans.test			\PRIVATE\10285A82\trans.test
-data=ZPRIVATE\10285A82\trigger1.test			\PRIVATE\10285A82\trigger1.test
-data=ZPRIVATE\10285A82\trigger2.test			\PRIVATE\10285A82\trigger2.test
-data=ZPRIVATE\10285A82\trigger3.test			\PRIVATE\10285A82\trigger3.test
-data=ZPRIVATE\10285A82\trigger4.test			\PRIVATE\10285A82\trigger4.test
-data=ZPRIVATE\10285A82\trigger5.test			\PRIVATE\10285A82\trigger5.test
-data=ZPRIVATE\10285A82\trigger6.test			\PRIVATE\10285A82\trigger6.test
-data=ZPRIVATE\10285A82\trigger7.test			\PRIVATE\10285A82\trigger7.test
-data=ZPRIVATE\10285A82\trigger8.test			\PRIVATE\10285A82\trigger8.test
-data=ZPRIVATE\10285A82\trigger9.test			\PRIVATE\10285A82\trigger9.test
-data=ZPRIVATE\10285A82\triggerA.test			\PRIVATE\10285A82\triggerA.test
-data=ZPRIVATE\10285A82\triggerB.test			\PRIVATE\10285A82\triggerB.test
-data=ZPRIVATE\10285A82\types.test			\PRIVATE\10285A82\types.test
-data=ZPRIVATE\10285A82\types2.test			\PRIVATE\10285A82\types2.test
-data=ZPRIVATE\10285A82\types3.test			\PRIVATE\10285A82\types3.test
-data=ZPRIVATE\10285A82\unique.test			\PRIVATE\10285A82\unique.test
-data=ZPRIVATE\10285A82\update.test			\PRIVATE\10285A82\update.test
-data=ZPRIVATE\10285A82\utf16align.test			\PRIVATE\10285A82\utf16align.test
-data=ZPRIVATE\10285A82\vacuum.test			\PRIVATE\10285A82\vacuum.test
-data=ZPRIVATE\10285A82\vacuum2.test			\PRIVATE\10285A82\vacuum2.test
-data=ZPRIVATE\10285A82\vacuum3.test			\PRIVATE\10285A82\vacuum3.test
-data=ZPRIVATE\10285A82\varint.test			\PRIVATE\10285A82\varint.test
-data=ZPRIVATE\10285A82\veryquick.test			\PRIVATE\10285A82\veryquick.test
-data=ZPRIVATE\10285A82\view.test			\PRIVATE\10285A82\view.test
-data=ZPRIVATE\10285A82\vtab1.test			\PRIVATE\10285A82\vtab1.test
-data=ZPRIVATE\10285A82\vtab2.test			\PRIVATE\10285A82\vtab2.test
-data=ZPRIVATE\10285A82\vtab3.test			\PRIVATE\10285A82\vtab3.test
-data=ZPRIVATE\10285A82\vtab4.test			\PRIVATE\10285A82\vtab4.test
-data=ZPRIVATE\10285A82\vtab5.test			\PRIVATE\10285A82\vtab5.test
-data=ZPRIVATE\10285A82\vtab6.test			\PRIVATE\10285A82\vtab6.test
-data=ZPRIVATE\10285A82\vtab7.test			\PRIVATE\10285A82\vtab7.test
-data=ZPRIVATE\10285A82\vtab8.test			\PRIVATE\10285A82\vtab8.test
-data=ZPRIVATE\10285A82\vtab9.test			\PRIVATE\10285A82\vtab9.test
-data=ZPRIVATE\10285A82\vtabA.test			\PRIVATE\10285A82\vtabA.test
-data=ZPRIVATE\10285A82\vtabB.test			\PRIVATE\10285A82\vtabB.test
-data=ZPRIVATE\10285A82\vtabC.test			\PRIVATE\10285A82\vtabC.test
-data=ZPRIVATE\10285A82\vtab_alter.test			\PRIVATE\10285A82\vtab_alter.test
-data=ZPRIVATE\10285A82\vtab_err.test			\PRIVATE\10285A82\vtab_err.test
-data=ZPRIVATE\10285A82\vtab_shared.test			\PRIVATE\10285A82\vtab_shared.test
-data=ZPRIVATE\10285A82\where.test			\PRIVATE\10285A82\where.test
-data=ZPRIVATE\10285A82\where2.test			\PRIVATE\10285A82\where2.test
-data=ZPRIVATE\10285A82\where3.test			\PRIVATE\10285A82\where3.test
-data=ZPRIVATE\10285A82\where4.test			\PRIVATE\10285A82\where4.test
-data=ZPRIVATE\10285A82\where5.test			\PRIVATE\10285A82\where5.test
-data=ZPRIVATE\10285A82\where6.test			\PRIVATE\10285A82\where6.test
-data=ZPRIVATE\10285A82\zeroblob.test			\PRIVATE\10285A82\zeroblob.test
+data=ZPRIVATE\10285a82\aggerror.test			\private\10285a82\aggerror.test
+data=ZPRIVATE\10285a82\all.test				\private\10285a82\all.test
+data=ZPRIVATE\10285a82\alter.test			\private\10285a82\alter.test
+data=ZPRIVATE\10285a82\alter2.test			\private\10285a82\alter2.test
+data=ZPRIVATE\10285a82\alter3.test			\private\10285a82\alter3.test
+data=ZPRIVATE\10285a82\altermalloc.test			\private\10285a82\altermalloc.test
+data=ZPRIVATE\10285a82\analyze.test			\private\10285a82\analyze.test
+data=ZPRIVATE\10285a82\async.test			\private\10285a82\async.test
+data=ZPRIVATE\10285a82\async2.test			\private\10285a82\async2.test
+data=ZPRIVATE\10285a82\async3.test			\private\10285a82\async3.test
+data=ZPRIVATE\10285a82\attach.test			\private\10285a82\attach.test
+data=ZPRIVATE\10285a82\attach2.test			\private\10285a82\attach2.test
+data=ZPRIVATE\10285a82\attach3.test			\private\10285a82\attach3.test
+data=ZPRIVATE\10285a82\attachmalloc.test		\private\10285a82\attachmalloc.test
+data=ZPRIVATE\10285a82\auth.test			\private\10285a82\auth.test
+data=ZPRIVATE\10285a82\auth2.test			\private\10285a82\auth2.test
+data=ZPRIVATE\10285a82\autoinc.test			\private\10285a82\autoinc.test
+data=ZPRIVATE\10285a82\autovacuum.test			\private\10285a82\autovacuum.test
+data=ZPRIVATE\10285a82\autovacuum_ioerr2.test		\private\10285a82\autovacuum_ioerr2.test
+data=ZPRIVATE\10285a82\avtrans.test			\private\10285a82\avtrans.test
+data=ZPRIVATE\10285a82\badutf.test			\private\10285a82\badutf.test
+data=ZPRIVATE\10285a82\between.test			\private\10285a82\between.test
+data=ZPRIVATE\10285a82\bigfile.test			\private\10285a82\bigfile.test
+data=ZPRIVATE\10285a82\bigrow.test			\private\10285a82\bigrow.test
+data=ZPRIVATE\10285a82\bind.test			\private\10285a82\bind.test
+data=ZPRIVATE\10285a82\bindxfer.test			\private\10285a82\bindxfer.test
+data=ZPRIVATE\10285a82\bitvec.test			\private\10285a82\bitvec.test
+data=ZPRIVATE\10285a82\blob.test			\private\10285a82\blob.test
+data=ZPRIVATE\10285a82\busy.test			\private\10285a82\busy.test
+data=ZPRIVATE\10285a82\cache.test			\private\10285a82\cache.test
+data=ZPRIVATE\10285a82\capi2.test			\private\10285a82\capi2.test
+data=ZPRIVATE\10285a82\capi3.test			\private\10285a82\capi3.test
+data=ZPRIVATE\10285a82\capi3b.test			\private\10285a82\capi3b.test
+data=ZPRIVATE\10285a82\capi3c.test			\private\10285a82\capi3c.test
+data=ZPRIVATE\10285a82\capi3d.test			\private\10285a82\capi3d.test
+data=ZPRIVATE\10285a82\cast.test			\private\10285a82\cast.test
+data=ZPRIVATE\10285a82\check.test			\private\10285a82\check.test
+data=ZPRIVATE\10285a82\collate1.test			\private\10285a82\collate1.test
+data=ZPRIVATE\10285a82\collate2.test			\private\10285a82\collate2.test
+data=ZPRIVATE\10285a82\collate3.test			\private\10285a82\collate3.test
+data=ZPRIVATE\10285a82\collate4.test			\private\10285a82\collate4.test
+data=ZPRIVATE\10285a82\collate5.test			\private\10285a82\collate5.test
+data=ZPRIVATE\10285a82\collate6.test			\private\10285a82\collate6.test
+data=ZPRIVATE\10285a82\collate7.test			\private\10285a82\collate7.test
+data=ZPRIVATE\10285a82\collate8.test			\private\10285a82\collate8.test
+data=ZPRIVATE\10285a82\collate9.test			\private\10285a82\collate9.test
+data=ZPRIVATE\10285a82\collatea.test			\private\10285a82\collatea.test
+data=ZPRIVATE\10285a82\colmeta.test			\private\10285a82\colmeta.test
+data=ZPRIVATE\10285a82\colname.test			\private\10285a82\colname.test
+data=ZPRIVATE\10285a82\conflict.test			\private\10285a82\conflict.test
+data=ZPRIVATE\10285a82\corrupt.test			\private\10285a82\corrupt.test
+data=ZPRIVATE\10285a82\corrupt2.test			\private\10285a82\corrupt2.test
+data=ZPRIVATE\10285a82\corrupt3.test			\private\10285a82\corrupt3.test
+data=ZPRIVATE\10285a82\corrupt4.test			\private\10285a82\corrupt4.test
+data=ZPRIVATE\10285a82\corrupt5.test			\private\10285a82\corrupt5.test
+data=ZPRIVATE\10285a82\corrupt6.test			\private\10285a82\corrupt6.test
+data=ZPRIVATE\10285a82\corrupt7.test			\private\10285a82\corrupt7.test
+data=ZPRIVATE\10285a82\corrupt8.test			\private\10285a82\corrupt8.test
+data=ZPRIVATE\10285a82\corrupt9.test			\private\10285a82\corrupt9.test
+data=ZPRIVATE\10285a82\corrupta.test			\private\10285a82\corrupta.test
+data=ZPRIVATE\10285a82\crash.test			\private\10285a82\crash.test
+data=ZPRIVATE\10285a82\crash2.test			\private\10285a82\crash2.test
+data=ZPRIVATE\10285a82\crash3.test			\private\10285a82\crash3.test
+data=ZPRIVATE\10285a82\crash4.test			\private\10285a82\crash4.test
+data=ZPRIVATE\10285a82\crash5.test			\private\10285a82\crash5.test
+data=ZPRIVATE\10285a82\crash6.test			\private\10285a82\crash6.test
+data=ZPRIVATE\10285a82\crash7.test			\private\10285a82\crash7.test
+data=ZPRIVATE\10285a82\createtab.test		\private\10285a82\createtab.test
+data=ZPRIVATE\10285a82\cse.test				\private\10285a82\cse.test
+data=ZPRIVATE\10285a82\date.test			\private\10285a82\date.test
+data=ZPRIVATE\10285a82\default.test			\private\10285a82\default.test
+data=ZPRIVATE\10285a82\delete.test			\private\10285a82\delete.test
+data=ZPRIVATE\10285a82\delete2.test			\private\10285a82\delete2.test
+data=ZPRIVATE\10285a82\delete3.test			\private\10285a82\delete3.test
+data=ZPRIVATE\10285a82\descidx1.test			\private\10285a82\descidx1.test
+data=ZPRIVATE\10285a82\descidx2.test			\private\10285a82\descidx2.test
+data=ZPRIVATE\10285a82\descidx3.test			\private\10285a82\descidx3.test
+data=ZPRIVATE\10285a82\diskfull.test			\private\10285a82\diskfull.test
+data=ZPRIVATE\10285a82\distinctagg.test			\private\10285a82\distinctagg.test
+data=ZPRIVATE\10285a82\enc.test				\private\10285a82\enc.test
+data=ZPRIVATE\10285a82\enc2.test			\private\10285a82\enc2.test
+data=ZPRIVATE\10285a82\enc3.test			\private\10285a82\enc3.test
+data=ZPRIVATE\10285a82\eval.test			\private\10285a82\eval.test
+data=ZPRIVATE\10285a82\exclusive.test			\private\10285a82\exclusive.test
+data=ZPRIVATE\10285a82\exclusive2.test			\private\10285a82\exclusive2.test
+data=ZPRIVATE\10285a82\exec.test			\private\10285a82\exec.test
+data=ZPRIVATE\10285a82\expr.test			\private\10285a82\expr.test
+data=ZPRIVATE\10285a82\filectrl.test		\private\10285a82\filectrl.test
+data=ZPRIVATE\10285a82\filefmt.test			\private\10285a82\filefmt.test
+data=ZPRIVATE\10285a82\fkey1.test			\private\10285a82\fkey1.test
+data=ZPRIVATE\10285a82\format4.test			\private\10285a82\format4.test
+data=ZPRIVATE\10285a82\fts1a.test			\private\10285a82\fts1a.test
+data=ZPRIVATE\10285a82\fts1b.test			\private\10285a82\fts1b.test
+data=ZPRIVATE\10285a82\fts1c.test			\private\10285a82\fts1c.test
+data=ZPRIVATE\10285a82\fts1d.test			\private\10285a82\fts1d.test
+data=ZPRIVATE\10285a82\fts1e.test			\private\10285a82\fts1e.test
+data=ZPRIVATE\10285a82\fts1f.test			\private\10285a82\fts1f.test
+data=ZPRIVATE\10285a82\fts1i.test			\private\10285a82\fts1i.test
+data=ZPRIVATE\10285a82\fts1j.test			\private\10285a82\fts1j.test
+data=ZPRIVATE\10285a82\fts1k.test			\private\10285a82\fts1k.test
+data=ZPRIVATE\10285a82\fts1l.test			\private\10285a82\fts1l.test
+data=ZPRIVATE\10285a82\fts1m.test			\private\10285a82\fts1m.test
+data=ZPRIVATE\10285a82\fts1n.test			\private\10285a82\fts1n.test
+data=ZPRIVATE\10285a82\fts1o.test			\private\10285a82\fts1o.test
+data=ZPRIVATE\10285a82\fts1porter.test			\private\10285a82\fts1porter.test
+data=ZPRIVATE\10285a82\fts2a.test			\private\10285a82\fts2a.test
+data=ZPRIVATE\10285a82\fts2b.test			\private\10285a82\fts2b.test
+data=ZPRIVATE\10285a82\fts2c.test			\private\10285a82\fts2c.test
+data=ZPRIVATE\10285a82\fts2d.test			\private\10285a82\fts2d.test
+data=ZPRIVATE\10285a82\fts2e.test			\private\10285a82\fts2e.test
+data=ZPRIVATE\10285a82\fts2f.test			\private\10285a82\fts2f.test
+data=ZPRIVATE\10285a82\fts2g.test			\private\10285a82\fts2g.test
+data=ZPRIVATE\10285a82\fts2h.test			\private\10285a82\fts2h.test
+data=ZPRIVATE\10285a82\fts2i.test			\private\10285a82\fts2i.test
+data=ZPRIVATE\10285a82\fts2j.test			\private\10285a82\fts2j.test
+data=ZPRIVATE\10285a82\fts2k.test			\private\10285a82\fts2k.test
+data=ZPRIVATE\10285a82\fts2l.test			\private\10285a82\fts2l.test
+data=ZPRIVATE\10285a82\fts2m.test			\private\10285a82\fts2m.test
+data=ZPRIVATE\10285a82\fts2o.test			\private\10285a82\fts2o.test
+data=ZPRIVATE\10285a82\fts2p.test			\private\10285a82\fts2p.test
+data=ZPRIVATE\10285a82\fts2q.test			\private\10285a82\fts2q.test
+data=ZPRIVATE\10285a82\fts2r.test			\private\10285a82\fts2r.test
+data=ZPRIVATE\10285a82\fts2token.test		\private\10285a82\fts2token.test
+data=ZPRIVATE\10285a82\fts3.test			\private\10285a82\fts3.test
+data=ZPRIVATE\10285a82\fts3aa.test			\private\10285a82\fts3aa.test
+data=ZPRIVATE\10285a82\fts3ab.test			\private\10285a82\fts3ab.test
+data=ZPRIVATE\10285a82\fts3ac.test			\private\10285a82\fts3ac.test
+data=ZPRIVATE\10285a82\fts3ad.test			\private\10285a82\fts3ad.test
+data=ZPRIVATE\10285a82\fts3ae.test			\private\10285a82\fts3ae.test
+data=ZPRIVATE\10285a82\fts3af.test			\private\10285a82\fts3af.test
+data=ZPRIVATE\10285a82\fts3ag.test			\private\10285a82\fts3ag.test
+data=ZPRIVATE\10285a82\fts3ah.test			\private\10285a82\fts3ah.test
+data=ZPRIVATE\10285a82\fts3ai.test			\private\10285a82\fts3ai.test
+data=ZPRIVATE\10285a82\fts3aj.test			\private\10285a82\fts3aj.test
+data=ZPRIVATE\10285a82\fts3ak.test			\private\10285a82\fts3ak.test
+data=ZPRIVATE\10285a82\fts3al.test			\private\10285a82\fts3al.test
+data=ZPRIVATE\10285a82\fts3am.test			\private\10285a82\fts3am.test
+data=ZPRIVATE\10285a82\fts3an.test			\private\10285a82\fts3an.test
+data=ZPRIVATE\10285a82\fts3ao.test			\private\10285a82\fts3ao.test
+data=ZPRIVATE\10285a82\fts3atoken.test		\private\10285a82\fts3atoken.test
+data=ZPRIVATE\10285a82\fts3b.test			\private\10285a82\fts3b.test
+data=ZPRIVATE\10285a82\fts3c.test			\private\10285a82\fts3c.test
+data=ZPRIVATE\10285a82\fts3d.test			\private\10285a82\fts3d.test
+data=ZPRIVATE\10285a82\fts3e.test			\private\10285a82\fts3e.test
+data=ZPRIVATE\10285a82\fts3near.test		\private\10285a82\fts3near.test
+data=ZPRIVATE\10285a82\func.test			\private\10285a82\func.test
+data=ZPRIVATE\10285a82\fuzz.test			\private\10285a82\fuzz.test
+data=ZPRIVATE\10285a82\fuzz2.test			\private\10285a82\fuzz2.test
+data=ZPRIVATE\10285a82\fuzz_malloc.test		\private\10285a82\fuzz_malloc.test
+data=ZPRIVATE\10285a82\hook.test			\private\10285a82\hook.test
+data=ZPRIVATE\10285a82\icu.test				\private\10285a82\icu.test
+data=ZPRIVATE\10285a82\in.test				\private\10285a82\in.test
+data=ZPRIVATE\10285a82\in2.test				\private\10285a82\in2.test
+data=ZPRIVATE\10285a82\in3.test				\private\10285a82\in3.test
+data=ZPRIVATE\10285a82\incrblob.test		\private\10285a82\incrblob.test
+data=ZPRIVATE\10285a82\incrblob2.test		\private\10285a82\incrblob2.test
+data=ZPRIVATE\10285a82\incrblob_err.test	\private\10285a82\incrblob_err.test
+data=ZPRIVATE\10285a82\incrvacuum.test		\private\10285a82\incrvacuum.test
+data=ZPRIVATE\10285a82\incrvacuum2.test		\private\10285a82\incrvacuum2.test
+data=ZPRIVATE\10285a82\incrvacuum_ioerr.test \private\10285a82\incrvacuum_ioerr.test
+data=ZPRIVATE\10285a82\index.test			\private\10285a82\index.test
+data=ZPRIVATE\10285a82\index2.test			\private\10285a82\index2.test
+data=ZPRIVATE\10285a82\index3.test			\private\10285a82\index3.test
+data=ZPRIVATE\10285a82\insert.test			\private\10285a82\insert.test
+data=ZPRIVATE\10285a82\insert2.test			\private\10285a82\insert2.test
+data=ZPRIVATE\10285a82\insert3.test			\private\10285a82\insert3.test
+data=ZPRIVATE\10285a82\insert4.test			\private\10285a82\insert4.test
+data=ZPRIVATE\10285a82\insert5.test			\private\10285a82\insert5.test
+data=ZPRIVATE\10285a82\interrupt.test			\private\10285a82\interrupt.test
+data=ZPRIVATE\10285a82\intpkey.test			\private\10285a82\intpkey.test
+data=ZPRIVATE\10285a82\io.test				\private\10285a82\io.test
+data=ZPRIVATE\10285a82\ioerr.test			\private\10285a82\ioerr.test
+data=ZPRIVATE\10285a82\ioerr2.test			\private\10285a82\ioerr2.test
+data=ZPRIVATE\10285a82\ioerr3.test			\private\10285a82\ioerr3.test
+data=ZPRIVATE\10285a82\ioerr4.test			\private\10285a82\ioerr4.test
+data=ZPRIVATE\10285a82\ioerr5.test			\private\10285a82\ioerr5.test
+data=ZPRIVATE\10285a82\join.test			\private\10285a82\join.test
+data=ZPRIVATE\10285a82\join2.test			\private\10285a82\join2.test
+data=ZPRIVATE\10285a82\join3.test			\private\10285a82\join3.test
+data=ZPRIVATE\10285a82\join4.test			\private\10285a82\join4.test
+data=ZPRIVATE\10285a82\join5.test			\private\10285a82\join5.test
+data=ZPRIVATE\10285a82\journal1.test			\private\10285a82\journal1.test
+data=ZPRIVATE\10285a82\jrnlmode.test			\private\10285a82\jrnlmode.test
+data=ZPRIVATE\10285a82\lastinsert.test			\private\10285a82\lastinsert.test
+data=ZPRIVATE\10285a82\laststmtchanges.test		\private\10285a82\laststmtchanges.test
+data=ZPRIVATE\10285a82\like.test			\private\10285a82\like.test
+data=ZPRIVATE\10285a82\like2.test			\private\10285a82\like2.test
+data=ZPRIVATE\10285a82\limit.test			\private\10285a82\limit.test
+data=ZPRIVATE\10285a82\loadext.test			\private\10285a82\loadext.test
+data=ZPRIVATE\10285a82\loadext2.test			\private\10285a82\loadext2.test
+data=ZPRIVATE\10285a82\lock.test			\private\10285a82\lock.test
+data=ZPRIVATE\10285a82\lock2.test			\private\10285a82\lock2.test
+data=ZPRIVATE\10285a82\lock3.test			\private\10285a82\lock3.test
+data=ZPRIVATE\10285a82\lock4.test			\private\10285a82\lock4.test
+data=ZPRIVATE\10285a82\lock5.test			\private\10285a82\lock5.test
+data=ZPRIVATE\10285a82\lookaside.test		\private\10285a82\lookaside.test
+data=ZPRIVATE\10285a82\main.test			\private\10285a82\main.test
+data=ZPRIVATE\10285a82\malloc.test			\private\10285a82\malloc.test
+data=ZPRIVATE\10285a82\malloc3.test			\private\10285a82\malloc3.test
+data=ZPRIVATE\10285a82\malloc4.test			\private\10285a82\malloc4.test
+data=ZPRIVATE\10285a82\malloc5.test			\private\10285a82\malloc5.test
+data=ZPRIVATE\10285a82\malloc6.test			\private\10285a82\malloc6.test
+data=ZPRIVATE\10285a82\malloc7.test			\private\10285a82\malloc7.test
+data=ZPRIVATE\10285a82\malloc8.test			\private\10285a82\malloc8.test
+data=ZPRIVATE\10285a82\malloc9.test			\private\10285a82\malloc9.test
+data=ZPRIVATE\10285a82\malloca.test			\private\10285a82\malloca.test
+data=ZPRIVATE\10285a82\mallocall.test		\private\10285a82\mallocall.test
+data=ZPRIVATE\10285a82\mallocb.test			\private\10285a82\mallocb.test
+data=ZPRIVATE\10285a82\mallocc.test			\private\10285a82\mallocc.test
+data=ZPRIVATE\10285a82\mallocd.test			\private\10285a82\mallocd.test
+data=ZPRIVATE\10285a82\malloce.test			\private\10285a82\malloce.test
+data=ZPRIVATE\10285a82\mallocf.test			\private\10285a82\mallocf.test
+data=ZPRIVATE\10285a82\mallocg.test			\private\10285a82\mallocg.test
+data=ZPRIVATE\10285a82\malloch.test			\private\10285a82\malloch.test
+data=ZPRIVATE\10285a82\malloci.test			\private\10285a82\malloci.test
+data=ZPRIVATE\10285a82\manydb.test			\private\10285a82\manydb.test
+data=ZPRIVATE\10285a82\memdb.test			\private\10285a82\memdb.test
+data=ZPRIVATE\10285a82\memleak.test			\private\10285a82\memleak.test
+data=ZPRIVATE\10285a82\memsubsys1.test		\private\10285a82\memsubsys1.test
+data=ZPRIVATE\10285a82\memsubsys2.test		\private\10285a82\memsubsys2.test
+data=ZPRIVATE\10285a82\minmax.test			\private\10285a82\minmax.test
+data=ZPRIVATE\10285a82\minmax2.test			\private\10285a82\minmax2.test
+data=ZPRIVATE\10285a82\minmax3.test			\private\10285a82\minmax3.test
+data=ZPRIVATE\10285a82\misc1.test			\private\10285a82\misc1.test
+data=ZPRIVATE\10285a82\misc2.test			\private\10285a82\misc2.test
+data=ZPRIVATE\10285a82\misc3.test			\private\10285a82\misc3.test
+data=ZPRIVATE\10285a82\misc4.test			\private\10285a82\misc4.test
+data=ZPRIVATE\10285a82\misc5.test			\private\10285a82\misc5.test
+data=ZPRIVATE\10285a82\misc6.test			\private\10285a82\misc6.test
+data=ZPRIVATE\10285a82\misc7.test			\private\10285a82\misc7.test
+data=ZPRIVATE\10285a82\misuse.test			\private\10285a82\misuse.test
+data=ZPRIVATE\10285a82\mutex1.test			\private\10285a82\mutex1.test
+data=ZPRIVATE\10285a82\mutex2.test			\private\10285a82\mutex2.test
+data=ZPRIVATE\10285a82\nan.test				\private\10285a82\nan.test
+data=ZPRIVATE\10285a82\notnull.test			\private\10285a82\notnull.test
+data=ZPRIVATE\10285a82\null.test			\private\10285a82\null.test
+data=ZPRIVATE\10285a82\openv2.test			\private\10285a82\openv2.test
+data=ZPRIVATE\10285a82\pager.test			\private\10285a82\pager.test
+data=ZPRIVATE\10285a82\pager2.test			\private\10285a82\pager2.test
+data=ZPRIVATE\10285a82\pager3.test			\private\10285a82\pager3.test
+data=ZPRIVATE\10285a82\pageropt.test			\private\10285a82\pageropt.test
+data=ZPRIVATE\10285a82\pagesize.test			\private\10285a82\pagesize.test
+data=ZPRIVATE\10285a82\permutations.test		\private\10285a82\permutations.test
+data=ZPRIVATE\10285a82\pragma.test			\private\10285a82\pragma.test
+data=ZPRIVATE\10285a82\pragma2.test			\private\10285a82\pragma2.test
+data=ZPRIVATE\10285a82\printf.test			\private\10285a82\printf.test
+data=ZPRIVATE\10285a82\progress.test			\private\10285a82\progress.test
+data=ZPRIVATE\10285a82\ptrchng.test			\private\10285a82\ptrchng.test
+data=ZPRIVATE\10285a82\quick.test			\private\10285a82\quick.test
+data=ZPRIVATE\10285a82\quote.test			\private\10285a82\quote.test
+data=ZPRIVATE\10285a82\rdonly.test			\private\10285a82\rdonly.test
+data=ZPRIVATE\10285a82\reindex.test			\private\10285a82\reindex.test
+data=ZPRIVATE\10285a82\rollback.test			\private\10285a82\rollback.test
+data=ZPRIVATE\10285a82\rowid.test			\private\10285a82\rowid.test
+data=ZPRIVATE\10285a82\rtree.test			\private\10285a82\rtree.test
+data=ZPRIVATE\10285a82\safety.test			\private\10285a82\safety.test
+data=ZPRIVATE\10285a82\schema.test			\private\10285a82\schema.test
+data=ZPRIVATE\10285a82\schema2.test			\private\10285a82\schema2.test
+data=ZPRIVATE\10285a82\select1.test			\private\10285a82\select1.test
+data=ZPRIVATE\10285a82\select2.test			\private\10285a82\select2.test
+data=ZPRIVATE\10285a82\select3.test			\private\10285a82\select3.test
+data=ZPRIVATE\10285a82\select4.test			\private\10285a82\select4.test
+data=ZPRIVATE\10285a82\select5.test			\private\10285a82\select5.test
+data=ZPRIVATE\10285a82\select6.test			\private\10285a82\select6.test
+data=ZPRIVATE\10285a82\select7.test			\private\10285a82\select7.test
+data=ZPRIVATE\10285a82\select8.test			\private\10285a82\select8.test
+data=ZPRIVATE\10285a82\select9.test			\private\10285a82\select9.test
+data=ZPRIVATE\10285a82\selecta.test			\private\10285a82\selecta.test
+data=ZPRIVATE\10285a82\selectb.test			\private\10285a82\selectb.test
+data=ZPRIVATE\10285a82\server1.test			\private\10285a82\server1.test
+data=ZPRIVATE\10285a82\shared.test			\private\10285a82\shared.test
+data=ZPRIVATE\10285a82\shared2.test			\private\10285a82\shared2.test
+data=ZPRIVATE\10285a82\shared3.test			\private\10285a82\shared3.test
+data=ZPRIVATE\10285a82\shared4.test			\private\10285a82\shared4.test
+data=ZPRIVATE\10285a82\shared_err.test			\private\10285a82\shared_err.test
+data=ZPRIVATE\10285a82\shortread1.test			\private\10285a82\shortread1.test
+data=ZPRIVATE\10285a82\sidedelete.test			\private\10285a82\sidedelete.test
+data=ZPRIVATE\10285a82\soak.test			\private\10285a82\soak.test
+data=ZPRIVATE\10285a82\softheap1.test			\private\10285a82\softheap1.test
+data=ZPRIVATE\10285a82\sort.test			\private\10285a82\sort.test
+data=ZPRIVATE\10285a82\speed1.test			\private\10285a82\speed1.test
+data=ZPRIVATE\10285a82\speed1p.test			\private\10285a82\speed1p.test
+data=ZPRIVATE\10285a82\speed2.test			\private\10285a82\speed2.test
+data=ZPRIVATE\10285a82\speed3.test			\private\10285a82\speed3.test
+data=ZPRIVATE\10285a82\speed4.test			\private\10285a82\speed4.test
+data=ZPRIVATE\10285a82\speed4p.test			\private\10285a82\speed4p.test
+data=ZPRIVATE\10285a82\sqllimits1.test			\private\10285a82\sqllimits1.test
+data=ZPRIVATE\10285a82\subquery.test			\private\10285a82\subquery.test
+data=ZPRIVATE\10285a82\subselect.test			\private\10285a82\subselect.test
+data=ZPRIVATE\10285a82\substr.test			\private\10285a82\substr.test
+data=ZPRIVATE\10285a82\sync.test			\private\10285a82\sync.test
+data=ZPRIVATE\10285a82\table.test			\private\10285a82\table.test
+data=ZPRIVATE\10285a82\tableapi.test			\private\10285a82\tableapi.test
+data=ZPRIVATE\10285a82\tclsqlite.test			\private\10285a82\tclsqlite.test
+data=ZPRIVATE\10285a82\tempdb.test			\private\10285a82\tempdb.test
+data=ZPRIVATE\10285a82\temptable.test			\private\10285a82\temptable.test
+data=ZPRIVATE\10285a82\thread001.test			\private\10285a82\thread001.test
+data=ZPRIVATE\10285a82\thread002.test			\private\10285a82\thread002.test
+data=ZPRIVATE\10285a82\thread1.test			\private\10285a82\thread1.test
+data=ZPRIVATE\10285a82\thread2.test			\private\10285a82\thread2.test
+data=ZPRIVATE\10285a82\tkt1435.test			\private\10285a82\tkt1435.test
+data=ZPRIVATE\10285a82\tkt1443.test			\private\10285a82\tkt1443.test
+data=ZPRIVATE\10285a82\tkt1444.test			\private\10285a82\tkt1444.test
+data=ZPRIVATE\10285a82\tkt1449.test			\private\10285a82\tkt1449.test
+data=ZPRIVATE\10285a82\tkt1473.test			\private\10285a82\tkt1473.test
+data=ZPRIVATE\10285a82\tkt1501.test			\private\10285a82\tkt1501.test
+data=ZPRIVATE\10285a82\tkt1512.test			\private\10285a82\tkt1512.test
+data=ZPRIVATE\10285a82\tkt1514.test			\private\10285a82\tkt1514.test
+data=ZPRIVATE\10285a82\tkt1536.test			\private\10285a82\tkt1536.test
+data=ZPRIVATE\10285a82\tkt1537.test			\private\10285a82\tkt1537.test
+data=ZPRIVATE\10285a82\tkt1567.test			\private\10285a82\tkt1567.test
+data=ZPRIVATE\10285a82\tkt1644.test			\private\10285a82\tkt1644.test
+data=ZPRIVATE\10285a82\tkt1667.test			\private\10285a82\tkt1667.test
+data=ZPRIVATE\10285a82\tkt1873.test			\private\10285a82\tkt1873.test
+data=ZPRIVATE\10285a82\tkt2141.test			\private\10285a82\tkt2141.test
+data=ZPRIVATE\10285a82\tkt2192.test			\private\10285a82\tkt2192.test
+data=ZPRIVATE\10285a82\tkt2213.test			\private\10285a82\tkt2213.test
+data=ZPRIVATE\10285a82\tkt2251.test			\private\10285a82\tkt2251.test
+data=ZPRIVATE\10285a82\tkt2285.test			\private\10285a82\tkt2285.test
+data=ZPRIVATE\10285a82\tkt2332.test			\private\10285a82\tkt2332.test
+data=ZPRIVATE\10285a82\tkt2339.test			\private\10285a82\tkt2339.test
+data=ZPRIVATE\10285a82\tkt2391.test			\private\10285a82\tkt2391.test
+data=ZPRIVATE\10285a82\tkt2409.test			\private\10285a82\tkt2409.test
+data=ZPRIVATE\10285a82\tkt2450.test			\private\10285a82\tkt2450.test
+data=ZPRIVATE\10285a82\tkt2640.test			\private\10285a82\tkt2640.test
+data=ZPRIVATE\10285a82\tkt2643.test			\private\10285a82\tkt2643.test
+data=ZPRIVATE\10285a82\tkt2686.test			\private\10285a82\tkt2686.test
+data=ZPRIVATE\10285a82\tkt2767.test			\private\10285a82\tkt2767.test
+data=ZPRIVATE\10285a82\tkt2817.test			\private\10285a82\tkt2817.test
+data=ZPRIVATE\10285a82\tkt2820.test			\private\10285a82\tkt2820.test
+data=ZPRIVATE\10285a82\tkt2822.test			\private\10285a82\tkt2822.test
+data=ZPRIVATE\10285a82\tkt2832.test			\private\10285a82\tkt2832.test
+data=ZPRIVATE\10285a82\tkt2854.test			\private\10285a82\tkt2854.test
+data=ZPRIVATE\10285a82\tkt2920.test			\private\10285a82\tkt2920.test
+data=ZPRIVATE\10285a82\tkt2927.test			\private\10285a82\tkt2927.test
+data=ZPRIVATE\10285a82\tkt2942.test			\private\10285a82\tkt2942.test
+data=ZPRIVATE\10285a82\tkt3080.test			\private\10285a82\tkt3080.test
+data=ZPRIVATE\10285a82\tkt3093.test			\private\10285a82\tkt3093.test
+data=ZPRIVATE\10285a82\tkt3121.test			\private\10285a82\tkt3121.test
+data=ZPRIVATE\10285a82\tkt3201.test			\private\10285a82\tkt3201.test
+data=ZPRIVATE\10285a82\tokenize.test			\private\10285a82\tokenize.test
+data=ZPRIVATE\10285a82\trace.test			\private\10285a82\trace.test
+data=ZPRIVATE\10285a82\trans.test			\private\10285a82\trans.test
+data=ZPRIVATE\10285a82\trigger1.test			\private\10285a82\trigger1.test
+data=ZPRIVATE\10285a82\trigger2.test			\private\10285a82\trigger2.test
+data=ZPRIVATE\10285a82\trigger3.test			\private\10285a82\trigger3.test
+data=ZPRIVATE\10285a82\trigger4.test			\private\10285a82\trigger4.test
+data=ZPRIVATE\10285a82\trigger5.test			\private\10285a82\trigger5.test
+data=ZPRIVATE\10285a82\trigger6.test			\private\10285a82\trigger6.test
+data=ZPRIVATE\10285a82\trigger7.test			\private\10285a82\trigger7.test
+data=ZPRIVATE\10285a82\trigger8.test			\private\10285a82\trigger8.test
+data=ZPRIVATE\10285a82\trigger9.test			\private\10285a82\trigger9.test
+data=ZPRIVATE\10285a82\triggera.test			\private\10285a82\triggera.test
+data=ZPRIVATE\10285a82\triggerb.test			\private\10285a82\triggerb.test
+data=ZPRIVATE\10285a82\types.test			\private\10285a82\types.test
+data=ZPRIVATE\10285a82\types2.test			\private\10285a82\types2.test
+data=ZPRIVATE\10285a82\types3.test			\private\10285a82\types3.test
+data=ZPRIVATE\10285a82\unique.test			\private\10285a82\unique.test
+data=ZPRIVATE\10285a82\update.test			\private\10285a82\update.test
+data=ZPRIVATE\10285a82\utf16align.test			\private\10285a82\utf16align.test
+data=ZPRIVATE\10285a82\vacuum.test			\private\10285a82\vacuum.test
+data=ZPRIVATE\10285a82\vacuum2.test			\private\10285a82\vacuum2.test
+data=ZPRIVATE\10285a82\vacuum3.test			\private\10285a82\vacuum3.test
+data=ZPRIVATE\10285a82\varint.test			\private\10285a82\varint.test
+data=ZPRIVATE\10285a82\veryquick.test			\private\10285a82\veryquick.test
+data=ZPRIVATE\10285a82\view.test			\private\10285a82\view.test
+data=ZPRIVATE\10285a82\vtab1.test			\private\10285a82\vtab1.test
+data=ZPRIVATE\10285a82\vtab2.test			\private\10285a82\vtab2.test
+data=ZPRIVATE\10285a82\vtab3.test			\private\10285a82\vtab3.test
+data=ZPRIVATE\10285a82\vtab4.test			\private\10285a82\vtab4.test
+data=ZPRIVATE\10285a82\vtab5.test			\private\10285a82\vtab5.test
+data=ZPRIVATE\10285a82\vtab6.test			\private\10285a82\vtab6.test
+data=ZPRIVATE\10285a82\vtab7.test			\private\10285a82\vtab7.test
+data=ZPRIVATE\10285a82\vtab8.test			\private\10285a82\vtab8.test
+data=ZPRIVATE\10285a82\vtab9.test			\private\10285a82\vtab9.test
+data=ZPRIVATE\10285a82\vtaba.test			\private\10285a82\vtaba.test
+data=ZPRIVATE\10285a82\vtabb.test			\private\10285a82\vtabb.test
+data=ZPRIVATE\10285a82\vtabc.test			\private\10285a82\vtabc.test
+data=ZPRIVATE\10285a82\vtab_alter.test			\private\10285a82\vtab_alter.test
+data=ZPRIVATE\10285a82\vtab_err.test			\private\10285a82\vtab_err.test
+data=ZPRIVATE\10285a82\vtab_shared.test			\private\10285a82\vtab_shared.test
+data=ZPRIVATE\10285a82\where.test			\private\10285a82\where.test
+data=ZPRIVATE\10285a82\where2.test			\private\10285a82\where2.test
+data=ZPRIVATE\10285a82\where3.test			\private\10285a82\where3.test
+data=ZPRIVATE\10285a82\where4.test			\private\10285a82\where4.test
+data=ZPRIVATE\10285a82\where5.test			\private\10285a82\where5.test
+data=ZPRIVATE\10285a82\where6.test			\private\10285a82\where6.test
+data=ZPRIVATE\10285a82\zeroblob.test			\private\10285a82\zeroblob.test
 
 //The next line to be uncommented if the testing is performed locally. Otherwise tests will fail - 
 //the following file is missing and needed by the timezone server.
-//data=ZPRIVATE\10202BE9\1020383e.txt     	\PRIVATE\10202be9\1020383e.txt
+//data=ZPRIVATE\10202be9\1020383e.txt     	\private\10202be9\1020383e.txt
 
-file=ABI_DIR\BUILD_DIR\t_sqliteapi.exe		\TEST\t_sqliteapi.exe
-file=ABI_DIR\BUILD_DIR\t_sqlitewsd.exe		\TEST\t_sqlitewsd.exe
-file=ABI_DIR\BUILD_DIR\t_sqlitewsd2.exe		\TEST\t_sqlitewsd2.exe
-file=ABI_DIR\BUILD_DIR\t_sqliteperf.exe		\TEST\t_sqliteperf.exe
-file=ABI_DIR\BUILD_DIR\t_sqliteperf2.exe	\TEST\t_sqliteperf2.exe
-file=ABI_DIR\BUILD_DIR\tclsqlite3.exe		\TEST\tclsqlite3.exe
-file=ABI_DIR\BUILD_DIR\t_sqlitedef.exe		\TEST\t_sqlitedef.exe
-file=ABI_DIR\BUILD_DIR\t_sqlitedb64.exe		\TEST\t_sqlitedb64.exe
+file=ABI_DIR\BUILD_DIR\t_sqliteapi.exe		\test\t_sqliteapi.exe
+file=ABI_DIR\BUILD_DIR\t_sqlitewsd.exe		\test\t_sqlitewsd.exe
+file=ABI_DIR\BUILD_DIR\t_sqlitewsd2.exe		\test\t_sqlitewsd2.exe
+file=ABI_DIR\BUILD_DIR\t_sqliteperf.exe		\test\t_sqliteperf.exe
+file=ABI_DIR\BUILD_DIR\t_sqliteperf2.exe	\test\t_sqliteperf2.exe
+file=ABI_DIR\BUILD_DIR\tclsqlite3.exe		\test\tclsqlite3.exe
+file=ABI_DIR\BUILD_DIR\t_sqlitedef.exe		\test\t_sqlitedef.exe
+file=ABI_DIR\BUILD_DIR\t_sqlitedb64.exe		\test\t_sqlitedb64.exe
 
 #endif
--- a/persistentstorage/sqlite3api/GROUP/tclsqlite3.mmp	Tue Jul 06 16:18:30 2010 +0300
+++ b/persistentstorage/sqlite3api/GROUP/tclsqlite3.mmp	Wed Aug 18 11:30:17 2010 +0300
@@ -20,7 +20,7 @@
 /**
  @file
 */
-#include <e32utrace.mmh>
+
 #include "tclsqlite3_macro.mmh"
 
 TARGET		tclsqlite3.exe
@@ -73,6 +73,7 @@
 
 //////////////////////////////////////////////////////////////////////////////////////////////////////////
 
+USERINCLUDE		../traces_sqlite3
 USERINCLUDE		../SQLite
 USERINCLUDE		../OsLayer
 OS_LAYER_LIBC_SYSTEMINCLUDE
@@ -171,6 +172,7 @@
 SOURCEPATH	../OsLayer
 SOURCE		FileBuf64.cpp
 SOURCE		os_symbian_mt.cpp
+SOURCE		SqliteUtil.cpp
 #ifdef WINSCW
 SOURCE		os_symbian_emul.cpp
 #else
--- a/persistentstorage/sqlite3api/OsLayer/FileBuf64.cpp	Tue Jul 06 16:18:30 2010 +0300
+++ b/persistentstorage/sqlite3api/OsLayer/FileBuf64.cpp	Wed Aug 18 11:30:17 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -13,58 +13,13 @@
 // Description:
 //
 #include "FileBuf64.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "FileBuf64Traces.h"
+#endif
+#include "SqliteTraceDef.h"
 
 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-///////////////////////////        PROFILER       ////////////////////////////////////////////////////////////////////
-//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-
-#ifdef _SQLPROFILER
-
-#define PROFILE_READ(pos,amount) \
-	do \
-		{ \
-		++iFileReadCount; iFileReadAmount += (amount); \
-        RDebug::Print(_L(" -- FRead    this=%X, Cnt=%d, Pos=%ld, Amt=%d, Ttl=%ld\r\n"), (TUint32)this, iFileReadCount,  pos, amount, iFileReadAmount); \
-		} while(0)
-	
-#define PROFILE_WRITE(pos,amount) \
-	do \
-		{ \
-		++iFileWriteCount; iFileWriteAmount += (amount); \
-		RDebug::Print(_L(" -- FWrite   this=%X, Cnt=%d, Pos=%ld, Amt=%d, Ttl=%ld\r\n"), (TUint32)this, iFileWriteCount, pos, amount, iFileWriteAmount); \
-		} while(0)
-
-#define PROFILE_SIZE() \
-	do \
-		{ \
-		++iFileSizeCount; \
-		RDebug::Print(_L(" -- FSize    this=%X, Cnt=%d\r\n"), (TUint32)this, iFileSizeCount); \
-		} while(0)
-
-#define PROFILE_SETSIZE() \
-	do \
-		{ \
-		++iFileSetSizeCount; \
-		RDebug::Print(_L(" -- FSetSize this=%X, Cnt=%d\r\n"), (TUint32)this, iFileSetSizeCount); \
-		} while(0)
-
-#define PROFILE_FLUSH()	\
-	do \
-		{ \
-		++iFileFlushCount; \
-		RDebug::Print(_L(" -- FFlush   this=%X, Cnt=%d\r\n"), (TUint32)this, iFileFlushCount); \
-		} while(0)
-
-#else
-
-#define PROFILE_READ(pos,amount)	void(0)
-#define PROFILE_WRITE(pos,amount)	void(0)
-
-#define PROFILE_SIZE()			void(0)
-#define PROFILE_SETSIZE()		void(0)
-#define PROFILE_FLUSH()			void(0)
-
-#endif//_SQLPROFILER
 
 /**
 This constant is used for initializing the RFileBuf64::iFileSize data member and means that
@@ -82,90 +37,17 @@
 static const TInt KNextReadFilePosNotSet = -1;
 
 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-///////////////////////////        ASSERTS & INVARIANT      //////////////////////////////////////////////////////////
+///////////////////////////        FBUF INVARIANT      ///////////////////////////////////////////////////////////////
 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 
 #ifdef _DEBUG
 
 #define __FILEBUF64_INVARIANT() Invariant()
 
-/**
-String literal used in _DEBUG mode for indicating that the reported panic happened inside the RFileBuf64 implementation.
-
-@see TFileBufPanic64
-@internalComponent
-*/
-_LIT(KPanicCategory, "FBuf64");
-
-/**
-Set of numeric constants used together with the KPanicCategory string literal in _DEBUG mode for providing more detailed
-information about the reason of the panic.
-
-@see KPanicCategory
-@internalComponent
-*/
-enum TFileBufPanic64
-	{
-	EFBufPanicCapacity = 1,				//1
-	EFBufPanicNullBuf,
-	EFBufPanicBufLen,
-	EFBufPanicFilePos,
-	EFBufPanicFileSize,					//5
-	EFBufPanicFileHandle,
-	EFBufPanicFsHandle,
-	EFBufPanicMsgHandle,
-	EFBufPanicMsgIndex,
-	EFBufPanicFileNameLen,				//10
-	EFBufPanicNullThis,
-	EFBufPanicDirty,
-	EFBufPanicNextReadFilePos,
-	EFBufPanicNextReadFilePosHits,
-	EFBufPanicFileBlockSize,			//15
-	};
-
-/**
-Helper function used in the implementation of the __FBUF64_ASSERT() macro.
-In case if the expression in __FBUF64_ASSERT() macro evaluates to false, 
-PanicFileBuf64() will use the supplied aLine and aPanicCode arguments together with the KPanicCategory string literal
-to prepare and print out a line (including the time of the panic) to the default log. The calling thread will be panic'ed
-after that.
-
-@see TFileBufPanic64
-@see KPanicCategory
-@internalComponent
-*/
-static void PanicFileBuf64(TInt aLine, TFileBufPanic64 aPanicCode)
-	{
-	TTime time;
-	time.HomeTime();
-	TDateTime dt = time.DateTime();
-	TBuf<16> tbuf;
-	tbuf.Format(_L("%02d:%02d:%02d.%06d"), dt.Hour(), dt.Minute(), dt.Second(), dt.MicroSecond());
-	
-	TBuf<64> buf;
-	_LIT(KFormat,"**%S:RFileBuf64 panic %d, at line(%d)");
-	buf.Format(KFormat, &tbuf, aPanicCode, aLine);
-	RDebug::Print(buf);
-	User::Panic(KPanicCategory, aPanicCode);
-	}
-
-/**
-This macro should be used when there is a need to panic the client/server if "expr" condition is not satisfied.
-Works in only in debug mode. In release mode evaluates to nothing.
-
-@see TFileBufPanic64
-@see KPanicCategory
-@see PanicFileBuf64()
-@internalComponent
-*/
-#define __FBUF64_ASSERT(expr, panicCode)	(void)(!(expr) ? ::PanicFileBuf64(__LINE__, panicCode) : void(0))
-
 #else //_DEBUG
 
 #define __FILEBUF64_INVARIANT() void(0)
 
-#define __FBUF64_ASSERT(expr, panicCode) 	void(0)
-
 #endif//_DEBUG
 
 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -177,13 +59,15 @@
 
 @param aSize Max file buffer size (capacity) in bytes.
 
-@panic FBuf64 1 In _DEBUG mode - aSize is 0 or negative.
+@panic Sqlite3 1 In _DEBUG mode - aSize is 0 or negative.
 */
 RFileBuf64::RFileBuf64(TInt aSize) :
 	iCapacity(aSize),
+	iBase(NULL),
 	iReadAheadSize(RFileBuf64::KDefaultReadAheadSize)
 	{
-	__FBUF64_ASSERT(aSize > 0, EFBufPanicCapacity);
+	SQLITE_TRACE_FBUF(OstTraceExt3(TRACE_INTERNALS, RFILEBUF64_RFILEBUF64, "FBuf;0x%X;RFileBuf64::RFileBuf64;aSize=%d;iReadAheadSize=%d", (TUint)this, aSize, iReadAheadSize));
+	__ASSERT_DEBUG(aSize > 0, __SQLITEPANIC(EFBufPanicCapacity));
 	}
 
 /**
@@ -202,20 +86,22 @@
 @see TFileMode
 @see RFile64::Create()
 
-@panic FBuf64  7 In _DEBUG mode - Invalid aFs object (null file session handle).
-@panic FBuf64 10 In _DEBUG mode - Invalid file name length (zero file name length).
+@panic Sqlite3  7 In _DEBUG mode - Invalid aFs object (null file session handle).
+@panic Sqlite3 10 In _DEBUG mode - Invalid file name length (zero file name length).
 */
 TInt RFileBuf64::Create(RFs& aFs, const TDesC& aFileName, TUint aFileMode)
 	{
-	__FBUF64_ASSERT(aFs.Handle() != 0, EFBufPanicFsHandle);
-	__FBUF64_ASSERT(aFileName.Length() > 0, EFBufPanicFileNameLen);
+	__ASSERT_DEBUG(aFs.Handle() != 0, __SQLITEPANIC(EFBufPanicFsHandle));
+	__ASSERT_DEBUG(aFileName.Length() > 0, __SQLITEPANIC(EFBufPanicFileNameLen));
 	
-    TInt err = DoPreInit();
-    if(err == KErrNone)
-        {
-        err = iFile.Create(aFs, aFileName, aFileMode);
-        }
-    return DoPostInit(err);
+	TInt err = DoPreInit();
+	if(err == KErrNone)
+	    {
+	    err = iFile.Create(aFs, aFileName, aFileMode);
+	    }
+	SQLITE_TRACE_FBUF(OstTraceExt5(TRACE_INTERNALS, RFILEBUF64_CREATE, "FBuf;0x%X;RFileBuf64::Create;aFs.Handle()=0x%X;aFileName=%S;iFile.SubSessionHandle()=0x%X;err=%d", (TUint)this, (TUint)aFs.Handle(), __SQLITEPRNSTR(aFileName), (TUint)iFile.SubSessionHandle(), err));
+	DoPostInit(err);
+	return err;
 	}
 
 /**
@@ -233,20 +119,22 @@
 @see TFileMode
 @see RFile64::Open()
 
-@panic FBuf64  7 In _DEBUG mode - Invalid aFs object (null file session handle).
-@panic FBuf64 10 In _DEBUG mode - Invalid file name length (zero file name length).
+@panic Sqlite3  7 In _DEBUG mode - Invalid aFs object (null file session handle).
+@panic Sqlite3 10 In _DEBUG mode - Invalid file name length (zero file name length).
 */
 TInt RFileBuf64::Open(RFs& aFs, const TDesC& aFileName, TUint aFileMode)
 	{
-	__FBUF64_ASSERT(aFs.Handle() != 0, EFBufPanicFsHandle);
-	__FBUF64_ASSERT(aFileName.Length() > 0, EFBufPanicFileNameLen);
-    
+	__ASSERT_DEBUG(aFs.Handle() != 0, __SQLITEPANIC(EFBufPanicFsHandle));
+	__ASSERT_DEBUG(aFileName.Length() > 0, __SQLITEPANIC(EFBufPanicFileNameLen));
+	
     TInt err = DoPreInit();
     if(err == KErrNone)
         {
         err = iFile.Open(aFs, aFileName, aFileMode);
         }
-    return DoPostInit(err);
+	SQLITE_TRACE_FBUF(OstTraceExt5(TRACE_INTERNALS, RFILEBUF64_OPEN, "FBuf;0x%X;RFileBuf64::Open;aFs.Handle()=0x%X;aFileName=%S;iFile.SubSessionHandle()=0x%X;err=%d", (TUint)this, (TUint)aFs.Handle(), __SQLITEPRNSTR(aFileName), (TUint)iFile.SubSessionHandle(), err));
+    DoPostInit(err);
+	return err;
 	}
 
 /**
@@ -266,18 +154,20 @@
 @see TFileMode
 @see RFile64::Temp()
 
-@panic FBuf64  7 In _DEBUG mode - Invalid aFs object (null file session handle).
+@panic Sqlite3  7 In _DEBUG mode - Invalid aFs object (null file session handle).
 */
 TInt RFileBuf64::Temp(RFs& aFs, const TDesC& aPath, TFileName& aFileName, TUint aFileMode)
 	{
-	__FBUF64_ASSERT(aFs.Handle() != 0, EFBufPanicFsHandle);
-    
+	__ASSERT_DEBUG(aFs.Handle() != 0, __SQLITEPANIC(EFBufPanicFsHandle));
+	
     TInt err = DoPreInit();
     if(err == KErrNone)
         {
         err = iFile.Temp(aFs, aPath, aFileName, aFileMode);
         }
-    return DoPostInit(err);
+	SQLITE_TRACE_FBUF(OstTraceExt5(TRACE_INTERNALS, RFILEBUF64_TEMP, "FBuf;0x%X;RFileBuf64::Temp;aFs.Handle()=0x%X;aFileName=%S;iFile.SubSessionHandle()=0x%X;err=%d", (TUint)this, (TUint)aFs.Handle(), __SQLITEPRNSTR(aFileName), (TUint)iFile.SubSessionHandle(), err));
+    DoPostInit(err);
+	return err;
 	}
 
 /**
@@ -290,6 +180,7 @@
 */
 void RFileBuf64::Close()
 	{
+	SQLITE_TRACE_FBUF(OstTraceExt2(TRACE_INTERNALS, RFILEBUF64_CLOSE, "FBuf;0x%X;RFileBuf64::Close;iFile.SubSessionHandle()=0x%X", (TUint)this, (TUint)iFile.SubSessionHandle()));
 	if(iFile.SubSessionHandle() != 0 && iBase != 0)
 		{
 		(void)DoFileWrite2();
@@ -321,14 +212,15 @@
 TInt RFileBuf64::SetReadAheadSize(TInt aBlockSize, TInt aReadRecBufSize)
 	{
 	__FILEBUF64_INVARIANT();
-	if(aReadRecBufSize > 0 && (aReadRecBufSize & (aReadRecBufSize - 1)) == 0 && aReadRecBufSize > RFileBuf64::KDefaultReadAheadSize)
+	if((aReadRecBufSize & (aReadRecBufSize - 1)) == 0 && aReadRecBufSize > RFileBuf64::KDefaultReadAheadSize)
 		{
 		iReadAheadSize = aReadRecBufSize > iCapacity ? iCapacity : aReadRecBufSize;
 		}
-	else if(aBlockSize > 0 && (aBlockSize & (aBlockSize - 1)) == 0 && aBlockSize > RFileBuf64::KDefaultReadAheadSize)
+	else if((aBlockSize & (aBlockSize - 1)) == 0 && aBlockSize > RFileBuf64::KDefaultReadAheadSize)
 		{
 		iReadAheadSize = aBlockSize > iCapacity ? iCapacity : aBlockSize;
 		}
+	SQLITE_TRACE_FBUF(OstTraceExt4(TRACE_INTERNALS, RFILEBUF64_SETREADAHEADSIZE, "FBuf;0x%X;RFileBuf64::SetReadAheadSize;aBlockSize=%d;aReadRecBufSize=%d;iReadAheadSize=%d", (TUint)this, aBlockSize, aReadRecBufSize, iReadAheadSize));
 	__FILEBUF64_INVARIANT();
 	return iReadAheadSize;
 	}
@@ -347,14 +239,14 @@
             
 @return KErrNone if successful, otherwise one of the other system-wide error  codes.
 
-@panic FBuf64  4 In _DEBUG mode - negative aFilePos value.
+@panic Sqlite3  4 In _DEBUG mode - negative aFilePos value.
 See RFileBuf64::Invariant() for other possible panics that may occur when this method is called.
 
 @see RFileBuf64::Invariant()
 */
 TInt RFileBuf64::Read(TInt64 aFilePos, TDes8& aDes)
 	{
-	__FBUF64_ASSERT(aFilePos >= 0, EFBufPanicFilePos);
+	__ASSERT_DEBUG(aFilePos >= 0, __SQLITEPANIC(EFBufPanicFilePos));
 	__FILEBUF64_INVARIANT();
 	aDes.SetLength(0);
 	//1. The output buffer max len is 0
@@ -374,14 +266,14 @@
 	TInt len = aDes.MaxLength();
 	if(len > iCapacity)
 		{
-		if((aFilePos + len) > iFilePos && !(aFilePos >= (iFilePos + iLength)))
+		if((aFilePos + len) > iFilePos && aFilePos < (iFilePos + iLength))
 			{//Write the pending data if the iDirty flag is set, otherwise preserve the buffer content.
 			err = DoFileWrite1(aFilePos);
 			}
 		if(err == KErrNone)
 			{
 			err = iFile.Read(aFilePos, aDes);
-			PROFILE_READ(aFilePos, aDes.Size());
+			SQLITE_TRACE_FBUF(OstTraceExt5(TRACE_INTERNALS, RFILEBUF64_READ1, "FBuf;0x%X;RFileBuf64::Read;TooBigRq;iFileSize=%lld;aFilePos=%lld;len=%d;err=%d", (TUint)this, iFileSize, aFilePos, len, err));
 			}
 		__FILEBUF64_INVARIANT();
 		return err;
@@ -412,7 +304,7 @@
 				iNextReadFilePosHits = 0;
 				TPtr8 ptr2(outptr, len);
 				err = iFile.Read(aFilePos, ptr2);
-				PROFILE_READ(aFilePos, ptr2.Size());
+				SQLITE_TRACE_FBUF(OstTraceExt5(TRACE_INTERNALS, RFILEBUF64_READ2, "FBuf;0x%X;RFileBuf64::Read;Read;iFileSize=%lld;aFilePos=%lld;len=%d;err=%d", (TUint)this, iFileSize, aFilePos, len, err));
 				if(err == KErrNone)
 					{
 					iNextReadFilePos = aFilePos + len;
@@ -436,7 +328,7 @@
 				}
 			TPtr8 ptr(iBase, Min(iCapacity, (len + readahead)));
 			err = iFile.Read(aFilePos, ptr);
-			PROFILE_READ(aFilePos, ptr.Size());
+			SQLITE_TRACE_FBUF(OstTraceExt5(TRACE_INTERNALS, RFILEBUF64_READ3, "FBuf;0x%X;RFileBuf64::Read;ReadAhead;iFileSize=%lld;aFilePos=%lld;len=%d;err=%d", (TUint)this, iFileSize, aFilePos, ptr.MaxLength(), err));
 			if(err == KErrNone)
 				{
 				iFilePos = aFilePos;
@@ -472,14 +364,14 @@
 
 @return KErrNone if successful, otherwise one of the other system-wide error  codes.
 
-@panic FBuf64  4 In _DEBUG mode - negative aFilePos value.
+@panic Sqlite3  4 In _DEBUG mode - negative aFilePos value.
 See RFileBuf64::Invariant() for other possible panics that may occur when this method is called.
 
 @see RFileBuf64::Invariant()
 */
 TInt RFileBuf64::Write(TInt64 aFilePos, const TDesC8& aData)
 	{
-	__FBUF64_ASSERT(aFilePos >= 0, EFBufPanicFilePos);
+	__ASSERT_DEBUG(aFilePos >= 0, __SQLITEPANIC(EFBufPanicFilePos));
 	__FILEBUF64_INVARIANT();
 	if(aData.Length() == 0)
 		{
@@ -608,14 +500,14 @@
 
 @return KErrNone if successful, otherwise one of the other system-wide error codes.
 
-@panic FBuf64  5 In _DEBUG mode - negative aFileSize value.
+@panic Sqlite3  5 In _DEBUG mode - negative aFileSize value.
 See RFileBuf64::Invariant() for other possible panics that may occur when this method is called.
 
 @see RFileBuf64::Invariant()
 */
 TInt RFileBuf64::SetSize(TInt64 aFileSize)
 	{
-	__FBUF64_ASSERT(aFileSize >= 0, EFBufPanicFileSize);
+	__ASSERT_DEBUG(aFileSize >= 0, __SQLITEPANIC(EFBufPanicFileSize));
 	__FILEBUF64_INVARIANT();
 	return DoSetFileSize(aFileSize);
 	}
@@ -634,7 +526,9 @@
 TInt RFileBuf64::Lock(TInt64 aFilePos, TInt64 aLength) const
 	{
 	__FILEBUF64_INVARIANT();
-	return iFile.Lock(aFilePos, aLength);
+	TInt err = iFile.Lock(aFilePos, aLength);
+	SQLITE_TRACE_FBUF(OstTraceExt5(TRACE_INTERNALS, RFILEBUF64_LOCK, "FBuf;0x%X;RFileBuf64::Lock;iFileSize=%lld;aFilePos=%lld;aLength=%lld;err=%d", (TUint)this, iFileSize, aFilePos, aLength, err));
+	return err;
 	}
 	
 /**
@@ -650,7 +544,9 @@
 TInt RFileBuf64::UnLock(TInt64 aFilePos, TInt64 aLength) const
 	{
 	__FILEBUF64_INVARIANT();
-	return iFile.UnLock(aFilePos, aLength);
+	TInt err = iFile.UnLock(aFilePos, aLength);
+	SQLITE_TRACE_FBUF(OstTraceExt5(TRACE_INTERNALS, RFILEBUF64_UNLOCK, "FBuf;0x%X;RFileBuf64::UnLock;iFileSize=%lld;aFilePos=%lld;aLength=%lld;err=%d", (TUint)this, iFileSize, aFilePos, aLength, err));
+	return err;
 	}
 
 /**
@@ -699,7 +595,9 @@
 TInt RFileBuf64::Drive(TInt& aDriveNumber, TDriveInfo& aDriveInfo) const
 	{
 	__FILEBUF64_INVARIANT();
-	return iFile.Drive(aDriveNumber, aDriveInfo);
+	TInt err = iFile.Drive(aDriveNumber, aDriveInfo);
+	SQLITE_TRACE_FBUF(OstTraceExt5(TRACE_INTERNALS, RFILEBUF64_DRIVE, "FBuf;0x%X;RFileBuf64::Drive;aDriveNumber=%d;driveAtt=0x%X;mediaAtt=0x%X;err=%d", (TUint)this, aDriveNumber, (TUint)aDriveInfo.iDriveAtt, (TUint)aDriveInfo.iMediaAtt, err));
+	return err;
 	}
 
 /**
@@ -720,20 +618,16 @@
 /**
 Performs post-initialization of the RFileBuf64 object.   
 If aInitErr is not KErrNone, then the buffer memory will be released.
-The function returns the aInitErr value to the caller. 
 
 @param aInitErr The result of the performed before the call RFileBuf64 initialization.
- 
-@return KErrNone if successful, otherwise one of the other system-wide error codes.
 */
-TInt RFileBuf64::DoPostInit(TInt aInitErr)
+void RFileBuf64::DoPostInit(TInt aInitErr)
     {
     if(aInitErr != KErrNone)
         {
         User::Free(iBase);
         iBase = 0;
         }
-    return aInitErr;
     }
 
 /**
@@ -768,8 +662,8 @@
 		__FILEBUF64_INVARIANT();
 		return KErrNone;
 		}
-	PROFILE_SIZE();
 	TInt err = iFile.Size(iFileSize);
+	SQLITE_TRACE_FBUF(OstTraceExt3(TRACE_INTERNALS, RFILEBUF64_DOFILESIZE, "FBuf;0x%X;RFileBuf64::DoFileSize;iFileSize=%lld;err=%d", (TUint)this, iFileSize, err));
 	if(err != KErrNone)
 		{
 		DoDiscard();
@@ -787,14 +681,14 @@
 
 @return KErrNone if successful, otherwise one of the other system-wide error codes.
 
-@panic FBuf64  5 In _DEBUG mode - negative aFileSize value.
+@panic Sqlite3  5 In _DEBUG mode - negative aFileSize value.
 See RFileBuf64::Invariant() for other possible panics that may occur when this method is called.
 
 @see RFileBuf64::Invariant()
 */
 TInt RFileBuf64::DoSetFileSize(TInt64 aFileSize)
 	{
-	__FBUF64_ASSERT(aFileSize >= 0, EFBufPanicFileSize);
+	__ASSERT_DEBUG(aFileSize >= 0, __SQLITEPANIC(EFBufPanicFileSize));
 	__FILEBUF64_INVARIANT();
 	if(aFileSize < iFilePos)
 		{
@@ -806,8 +700,8 @@
 		{
 		iLength = aFileSize - iFilePos;
 		}
-	PROFILE_SETSIZE();
 	TInt err = iFile.SetSize(aFileSize);
+	SQLITE_TRACE_FBUF(OstTraceExt4(TRACE_INTERNALS, RFILEBUF64_DOSETFILESIZE, "FBuf;0x%X;RFileBuf64::DoSetFileSize;iFileSize=%lld;aFileSize=%lld;err=%d", (TUint)this, iFileSize, aFileSize, err));
 	if(err != KErrNone)
 		{
 		DoDiscard();
@@ -838,8 +732,8 @@
 		__FILEBUF64_INVARIANT();
 		return err;	
 		}
-	PROFILE_FLUSH();
 	err = iFile.Flush();
+	SQLITE_TRACE_FBUF(OstTraceExt3(TRACE_INTERNALS, RFILEBUF64_DOFILEFLUSH, "FBuf;0x%X;RFileBuf64::DoFileFlush;iFileSize=%lld;err=%d", (TUint)this, iFileSize, err));
 	if(err != KErrNone)
 		{
 		DoDiscard();
@@ -870,9 +764,9 @@
 		__FILEBUF64_INVARIANT();
 		return KErrNone;	
 		}
-	PROFILE_WRITE(iFilePos, iLength);
 	TPtrC8 data(iBase, iLength);		
 	TInt err = iFile.Write(iFilePos, data);
+	SQLITE_TRACE_FBUF(OstTraceExt5(TRACE_INTERNALS, RFILEBUF64_DOFILEWRITE, "FBuf;0x%X;RFileBuf64::DoFileWrite;iFileSize=%lld;iFilePos=%lld;iLength=%d;err=%d", (TUint)this, iFileSize, iFilePos, iLength, err));
 	if(err == KErrNone)
 		{
 		iFileSize = Max(iFileSize, (iFilePos + iLength));
@@ -902,7 +796,7 @@
 
 See RFileBuf64::Invariant() for other possible panics that may occur when this method is called.
 				   
-@panic FBuf64  4 In _DEBUG mode - negative aNewFilePos value.
+@panic Sqlite3  4 In _DEBUG mode - negative aNewFilePos value.
 
 @see RFileBuf64::Read()
 @see RFileBuf64::DoFileWrite()
@@ -911,7 +805,7 @@
 */
 TInt RFileBuf64::DoFileWrite1(TInt64 aNewFilePos)
 	{
-	__FBUF64_ASSERT(aNewFilePos >= 0, EFBufPanicFilePos);
+	__ASSERT_DEBUG(aNewFilePos >= 0, __SQLITEPANIC(EFBufPanicFilePos));
 	__FILEBUF64_INVARIANT();
 	TInt err = KErrNone;
 	if(iDirty)
@@ -949,7 +843,7 @@
 
 See RFileBuf64::Invariant() for other possible panics that may occur when this method is called.
 				   
-@panic FBuf64  4 In _DEBUG mode - negative aNewFilePos value.
+@panic Sqlite3  4 In _DEBUG mode - negative aNewFilePos value.
 
 @see RFileBuf64::Write()
 @see RFileBuf64::DoFileWrite()
@@ -958,7 +852,7 @@
 */
 TInt RFileBuf64::DoFileWrite2(TInt64 aNewFilePos)
 	{
-	__FBUF64_ASSERT(aNewFilePos >= 0, EFBufPanicFilePos);
+	__ASSERT_DEBUG(aNewFilePos >= 0, __SQLITEPANIC(EFBufPanicFilePos));
 	__FILEBUF64_INVARIANT();
 	TInt err = KErrNone;
 	if(iDirty)
@@ -1009,29 +903,29 @@
 RFileBuf64 invariant. Called in _DEBUG mode at the beginning and before the end of every RFileBuf64 method
 (except the init/destroy methods).
 
-@panic FBuf64  11 In _DEBUG mode - null "this" pointer.
-@panic FBuf64   1 In _DEBUG mode - negative iCapacity value.
-@panic FBuf64   2 In _DEBUG mode - the buffer pointer is null (possible the buffer is not allocated or already destroyed).
-@panic FBuf64   3 In _DEBUG mode - invalid iLength value (negative or bigger than iCapacity).
-@panic FBuf64   4 In _DEBUG mode - negative iFilePos value.
-@panic FBuf64   5 In _DEBUG mode - set but negative iFileSize value.
-@panic FBuf64   6 In _DEBUG mode - null file handle (the RFile64 object is not created or already destroyed).
-@panic FBuf64  13 In _DEBUG mode - set but negative iNextReadFilePos value.
-@panic FBuf64  14 In _DEBUG mode - negative iNextReadFilePosHits value.
-@panic FBuf64  15 In _DEBUG mode - iReadAheadSize is negative or is not power of two.
+@panic Sqlite3  11 In _DEBUG mode - null "this" pointer.
+@panic Sqlite3   1 In _DEBUG mode - negative iCapacity value.
+@panic Sqlite3   2 In _DEBUG mode - the buffer pointer is null (possible the buffer is not allocated or already destroyed).
+@panic Sqlite3   3 In _DEBUG mode - invalid iLength value (negative or bigger than iCapacity).
+@panic Sqlite3   4 In _DEBUG mode - negative iFilePos value.
+@panic Sqlite3   5 In _DEBUG mode - set but negative iFileSize value.
+@panic Sqlite3   6 In _DEBUG mode - null file handle (the RFile64 object is not created or already destroyed).
+@panic Sqlite3  13 In _DEBUG mode - set but negative iNextReadFilePos value.
+@panic Sqlite3  14 In _DEBUG mode - negative iNextReadFilePosHits value.
+@panic Sqlite3  15 In _DEBUG mode - iReadAheadSize is negative or is not power of two.
 */
 void RFileBuf64::Invariant() const
 	{
-	__FBUF64_ASSERT(this != 0, EFBufPanicNullThis);
-	__FBUF64_ASSERT(iCapacity > 0, EFBufPanicCapacity);
-	__FBUF64_ASSERT(iBase != 0, EFBufPanicNullBuf);
-	__FBUF64_ASSERT(iLength >= 0 && iLength <= iCapacity, EFBufPanicBufLen);
-	__FBUF64_ASSERT(iFilePos >= 0, EFBufPanicFilePos);
-	__FBUF64_ASSERT(iFileSize == KFileSizeNotSet || iFileSize >= 0, EFBufPanicFileSize);
-	__FBUF64_ASSERT(iFile.SubSessionHandle() != 0, EFBufPanicFileHandle);
-	__FBUF64_ASSERT(iNextReadFilePos == KNextReadFilePosNotSet || iNextReadFilePos >= 0, EFBufPanicNextReadFilePos);
-	__FBUF64_ASSERT(iNextReadFilePosHits >= 0, EFBufPanicNextReadFilePosHits);
-	__FBUF64_ASSERT(iReadAheadSize > 0 && (iReadAheadSize & (iReadAheadSize - 1)) == 0, EFBufPanicFileBlockSize);
+	__ASSERT_DEBUG(this != 0, __SQLITEPANIC(EFBufPanicNullThis));
+	__ASSERT_DEBUG(iCapacity > 0, __SQLITEPANIC(EFBufPanicCapacity));
+	__ASSERT_DEBUG(iBase != 0, __SQLITEPANIC(EFBufPanicNullBuf));
+	__ASSERT_DEBUG(iLength >= 0 && iLength <= iCapacity, __SQLITEPANIC(EFBufPanicBufLen));
+	__ASSERT_DEBUG(iFilePos >= 0, __SQLITEPANIC(EFBufPanicFilePos));
+	__ASSERT_DEBUG(iFileSize == KFileSizeNotSet || iFileSize >= 0, __SQLITEPANIC(EFBufPanicFileSize));
+	__ASSERT_DEBUG(iFile.SubSessionHandle() != 0, __SQLITEPANIC(EFBufPanicFileHandle));
+	__ASSERT_DEBUG(iNextReadFilePos == KNextReadFilePosNotSet || iNextReadFilePos >= 0, __SQLITEPANIC(EFBufPanicNextReadFilePos));
+	__ASSERT_DEBUG(iNextReadFilePosHits >= 0, __SQLITEPANIC(EFBufPanicNextReadFilePosHits));
+	__ASSERT_DEBUG(iReadAheadSize > 0 && (iReadAheadSize & (iReadAheadSize - 1)) == 0, __SQLITEPANIC(EFBufPanicFileBlockSize));
 	}
 	
 #endif
--- a/persistentstorage/sqlite3api/OsLayer/FileBuf64.h	Tue Jul 06 16:18:30 2010 +0300
+++ b/persistentstorage/sqlite3api/OsLayer/FileBuf64.h	Wed Aug 18 11:30:17 2010 +0300
@@ -151,7 +151,7 @@
 private:
 	void Invariant() const;
     TInt DoPreInit();
-    TInt DoPostInit(TInt aInitErr);
+    void DoPostInit(TInt aInitErr);
 	void DoDiscard();
 	TInt DoFileSize();
 	TInt DoSetFileSize(TInt64 aFileSize);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/persistentstorage/sqlite3api/OsLayer/SqliteTraceDef.h	Wed Aug 18 11:30:17 2010 +0300
@@ -0,0 +1,55 @@
+// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+#ifndef SQLITETRACEDEF_H
+#define SQLITETRACEDEF_H
+
+#include <e32def.h>
+#include "SqliteUtil.h"
+
+//////////////////////////////////////////////////////////////////////////////////////
+
+#if defined OST_TRACE_COMPILER_IN_USE && defined _SQLITE_OS_TRACE_ENABLED
+    #define __SQLITETRACE_OSVAR(var) var
+    #define __SQLITETRACE_OSEXPR(expr) expr
+#else
+    #define __SQLITETRACE_OSVAR(var)
+    #define __SQLITETRACE_OSEXPR(expr)
+#endif    
+
+//////////////////////////////////////////////////////////////////////////////////////
+
+#if defined OST_TRACE_COMPILER_IN_USE && defined _SQLITE_RDEBUG_PRINT
+    #undef OstTrace0 
+    #undef OstTrace1 
+    #undef OstTraceExt1 
+    #undef OstTraceExt2 
+    #undef OstTraceExt3 
+    #undef OstTraceExt4 
+    #undef OstTraceExt5
+
+    void SqlitePrintf(TInt aGroupName, TInt aTraceName, const char* aFormat, ...);
+
+    #define OstTrace0    SqlitePrintf 
+    #define OstTrace1    SqlitePrintf
+    #define OstTraceExt1 SqlitePrintf
+    #define OstTraceExt2 SqlitePrintf
+    #define OstTraceExt3 SqlitePrintf
+    #define OstTraceExt4 SqlitePrintf
+    #define OstTraceExt5 SqlitePrintf
+#endif//defined OST_TRACE_COMPILER_IN_USE && defined _SQLITE_RDEBUG_PRINT
+
+//////////////////////////////////////////////////////////////////////////////////////
+
+#endif//SQLITETRACEDEF_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/persistentstorage/sqlite3api/OsLayer/SqliteUtil.cpp	Wed Aug 18 11:30:17 2010 +0300
@@ -0,0 +1,167 @@
+// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+#include <e32debug.h>
+#include "SqliteUtil.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "SqliteUtilTraces.h"
+#endif
+#include "SqliteTraceDef.h"
+
+///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+#define UNUSED_ARG(arg) arg = arg
+#define UNUSED_DES(arg) arg
+
+///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+#if defined OST_TRACE_COMPILER_IN_USE &&  defined _SQLITE_RDEBUG_PRINT
+
+/**
+This class has been added here to avoid the crashes when _SQLITE_RDEBUG_PRINT macro is defined but the
+data to be printed out is too big and cannot fit into the buffer with size KSqliteMaxPrnStrLen.
+@internalComponent   
+*/
+class TSqliteDes16Overflow : public TDes16Overflow
+    {
+public:    
+    virtual void Overflow(TDes16& /*aDes*/)
+        {
+        }
+    };
+
+//Replaces:
+// "%lld" with "%ld"
+//These are the differences in format specification between RDebig::Print and OST functions.
+//The new format spec length should be less or equal than the old format spec length.
+static void ReplaceFmtSpec(TDes& aFormat, const TDesC& aFmtSpec, const TDesC& aNewFmtSpec)
+	{
+	TInt fmtLength = aFormat.Length();
+	const TInt KDiff = aFmtSpec.Length() - aNewFmtSpec.Length();
+    TPtr ptr((TText*)aFormat.Ptr(), fmtLength, fmtLength);
+    TInt pos;
+    while((pos = ptr.Find(aFmtSpec)) >= 0)
+    	{
+		ptr.Replace(pos, aFmtSpec.Length(), aNewFmtSpec);
+		fmtLength -= KDiff;
+		ptr.Set(ptr.MidTPtr(pos));
+    	}
+    aFormat.SetLength(fmtLength);
+	}
+
+void SqlitePrintf(TInt /*aGroupName*/, TInt /*aTraceName*/, const char* aFormat, ...)
+    {
+    VA_LIST list;
+    VA_START(list, aFormat);
+    TBuf<128> format;
+    _LIT(KTraceIdent, "Sqlite3;");
+    format.Copy(TPtrC8((const TUint8*)aFormat));
+    format.Insert(0, KTraceIdent);
+    format.Append(_L("\r\n"));
+    _LIT(KOstI64Fmt, "%lld");
+    _LIT(KDbgPrnI64Fmt, "%ld");
+    ReplaceFmtSpec(format, KOstI64Fmt, KDbgPrnI64Fmt);
+    TBuf<KSqliteMaxPrnStrLen> buf;
+    TSqliteDes16Overflow overflowHandler;
+    buf.AppendFormatList(format, list, &overflowHandler);
+#ifdef _SQLITE_RDEBUG_PRINT    
+    RDebug::RawPrint(buf);
+#endif
+    }
+
+#endif//defined OST_TRACE_COMPILER_IN_USE &&  defined _SQLITE_RDEBUG_PRINT 
+
+///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+/**
+SQLite panic category.
+
+@internalComponent
+*/
+_LIT(KSqlitePanicCategory, "Sqlite3");
+
+///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+/**
+Panics the caller with aPanicCode panic code.
+The call will terminate the thread where it is called from.
+
+@param aPanicCode Panic code.
+
+@internalComponent
+*/
+static void SqlitePanic(TSqlitePanic aPanicCode)
+	{
+	User::Panic(KSqlitePanicCategory, aPanicCode);
+	}
+	
+///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+/**
+The function prints out a "SQLite" panic message to the console and panics the thread where it is called from.
+It gives a useful information about the found error together with the source file name and line number where
+it occurred.
+
+Note: this function  will output information regarding the panic only if _SQLITE_PANIC_TRACE_ENABLED macro is defined  
+
+@param aFile Source file name
+@param aLine Source line number
+@param aPanicCode Panic code
+@param aHandle Numeric value, uniquely identfying the leaving location (the "this" pointer for example)
+
+@return KErrNone
+
+@internalComponent
+*/  
+TInt TSqliteUtil::Panic(const TText* aFile, TInt aLine, TInt aPanicCode, TUint aHandle)
+    {
+#if defined OST_TRACE_COMPILER_IN_USE && defined _SQLITE_PANIC_TRACE_ENABLED
+    TPtrC fname(FileName(aFile));
+    OstTraceExt5(TRACE_FATAL, TSQLUTIL_PANIC, "Panic;0x%X;%S;%d;%S;%d", aHandle, __SQLITEPRNSTR(fname), aLine, __SQLITEPRNSTR(KSqlitePanicCategory), aPanicCode);
+#else
+    UNUSED_ARG(aFile);
+    UNUSED_ARG(aLine);
+    UNUSED_ARG(aHandle);
+#endif      
+    ::SqlitePanic(static_cast <TSqlitePanic> (aPanicCode));
+    return KErrNone;
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+#if defined OST_TRACE_COMPILER_IN_USE && defined _SQLITE_PANIC_TRACE_ENABLED
+
+/**
+The function creates and returns TPtrC object which points to aFile parameter.
+
+@param aFile File name
+@return TPtrC object pointing to aFile parameter.
+
+@internalComponent
+*/	
+TPtrC TSqliteUtil::FileName(const TText* aFile)
+	{
+	TPtrC p(aFile);
+	TInt ix = p.LocateReverse('\\');
+	if(ix<0)
+		ix=p.LocateReverse('/');
+	if(ix>=0)
+		p.Set(p.Mid(1+ix));
+	return p;
+	}
+
+#endif //defined OST_TRACE_COMPILER_IN_USE && defined _SQLITE_PANIC_TRACE_ENABLED
+
+///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/persistentstorage/sqlite3api/OsLayer/SqliteUtil.h	Wed Aug 18 11:30:17 2010 +0300
@@ -0,0 +1,144 @@
+// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+#ifndef SQLITEUTIL_H
+#define SQLITEUTIL_H
+
+#include <e32std.h>
+
+/**
+Panic codes - used by asserts in the OS porting layer and the file buffer.
+
+@see KPanicCategory
+
+@internalComponent
+*/
+enum TSqlitePanic
+	{
+	ESqliteOsPanicFsCreationError		= 1,
+	ESqliteOsPanicMutexCreationError	= 2,
+	ESqliteOsPanicInvalidFs				= 3,
+	ESqliteOsPanicNullPls1				= 4,
+	ESqliteOsPanicNullPls2				= 5,
+	ESqliteOsPanicNullPls3				= 6,
+	ESqliteOsPanicNullPls4				= 7,
+	ESqliteOsPanicAssert				= 8,
+	ESqliteOsPanicMaxKeysExceeded		= 9,
+	ESqliteOsPanicBufferSizeExceeded	=10,
+	ESqliteOsPanicNullKey				=11,
+	ESqliteOsPanicWsdBufSize			=12,
+	ESqliteOsPanicWsdEntryCount			=13,
+	ESqliteOsPanicInternalError			=19,
+	ESqliteOsPanicNullDbFilePtr			=20,
+	ESqliteOsPanicInvalidLock			=21,
+	ESqliteOsPanicInvalidMutexType		=22,
+	ESqliteOsPanicMutexLockCounter		=23,
+	ESqliteOsPanicMutexOwner			=24,
+	//
+	EFBufPanicCapacity					=101,
+	EFBufPanicNullBuf					=102,
+	EFBufPanicBufLen					=103,
+	EFBufPanicFilePos					=104,
+	EFBufPanicFileSize					=105,
+	EFBufPanicFileHandle				=106,
+	EFBufPanicFsHandle					=107,
+	EFBufPanicMsgHandle					=108,
+	EFBufPanicMsgIndex					=109,
+	EFBufPanicFileNameLen				=110,
+	EFBufPanicNullThis					=111,
+	EFBufPanicDirty						=112,
+	EFBufPanicNextReadFilePos			=113,
+	EFBufPanicNextReadFilePosHits		=114,
+	EFBufPanicFileBlockSize				=115,
+	};
+
+////////////////////////////////////////////////////////////////////////////////////////////
+
+//All macros in this header will have a non-void definition only if the OST_TRACE_COMPILER_IN_USE macro
+//is defined. 
+//In order to get the traces enabled, the OST_TRACE_COMPILER_IN_USE macro has to be defined in
+//OstTraceDefinitions.h file. 
+//After that, the trace output can be redirected by defining _SQL_RDEBUG_PRINT or specific categories
+//of traces can be enabled/disabled.
+
+//Enable _SQLITE_RDEBUG_PRINT if you want to redirect the OS porting layer and file buffer tracing output via RDebug::Print()
+//#define _SQLITE_RDEBUG_PRINT
+
+//Enable _SQLITE_OS_TRACE_ENABLED if you get the OS porting layer traces compiled in the binary
+//#define _SQLITE_OS_TRACE_ENABLED
+
+//Enable _SQLITE_FBUF_TRACE_ENABLED if you get the file buffer traces compiled in the binary
+//#define _SQLITE_FBUF_TRACE_ENABLED
+
+#ifdef _DEBUG
+	//Enable _SQLITE_PANIC_TRACE_ENABLED if you want to get more detailed output regarding panics
+	//#define _SQLITE_PANIC_TRACE_ENABLED
+#endif
+
+///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+//Wrap every string (file name, file path, etc.) you want to trace, in a __SQLITEPRNSTR()/__SQLITEPRNSTR8() macro. 
+//There is a difference how RDebug::Print() and OstTraceExt<n>() work.
+#if defined _SQLITE_RDEBUG_PRINT
+    const TInt KSqliteMaxPrnStrLen = 512;    
+    #define __SQLITEPRNSTR(des)  &des
+#else
+    #define __SQLITEPRNSTR(des)  des
+#endif
+
+///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+/**
+Set of useful functions to print diagnostic messages on the console when a panic occurs.
+
+@internalComponent
+*/
+class TSqliteUtil
+	{
+public:
+	static TInt Panic(const TText* aFile, TInt aLine, TInt aPanicCode, TUint aHandle);
+	
+private:
+	static TPtrC FileName(const TText* aFile);
+	
+	};
+
+///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+#define __SQLITESTRING(str) _S(str)
+
+///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+//__SQLITEPANIC/__SQLITEPANIC2 macro is used for printing out additional information when panic occurs in SQLite OS porting layer and the file buffer:
+//source file name, line number, "this" pointer, panic category.
+#define __SQLITEPANIC(aPanicCode)      TSqliteUtil::Panic(__SQLITESTRING(__FILE__), __LINE__, aPanicCode, (TUint)this)
+#define __SQLITEPANIC2(aPanicCode)     TSqliteUtil::Panic(__SQLITESTRING(__FILE__), __LINE__, aPanicCode, 0)
+
+///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+#ifdef _SQLITE_OS_TRACE_ENABLED
+    #define SQLITE_TRACE_OS(trace)   trace
+#else
+    #define SQLITE_TRACE_OS(trace)   do {} while(0)
+#endif
+
+#ifdef _SQLITE_FBUF_TRACE_ENABLED
+    #define SQLITE_TRACE_FBUF(trace)   trace
+#else
+    #define SQLITE_TRACE_FBUF(trace)   do {} while(0)
+#endif
+
+///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+#endif //SQLITEUTIL_H
--- a/persistentstorage/sqlite3api/OsLayer/UTraceSqlite.cpp	Tue Jul 06 16:18:30 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-#include <e32std.h>
-
-//The file is used only to compile and include in the image only a single
-//copy of the trace strings.
-#define __SQLITETRACE_STRINGS__
-#include "UTraceSqlite.h"
-
-#ifdef SYMBIAN_TRACE_SQLITE_FUNC
-
-/**
-Create the TSqlUTraceProfiler object which inserts a UTF trace, used to signal a function entry
-
-@param aFunctionStr 	A "const char" pointer describing the function to be profiled.
-						Currently this is the type signature of the function returned by 
-						the __PRETTY_FUNCTION__ macro.
-@param aObj  			A object pointer used to provide context for the function.
-
-@internalComponent
-*/
-TSqlUTraceProfiler::TSqlUTraceProfiler(const TAny* aObj, const char* aFunctionStr):
-iObj(aObj), iFunctionStr(reinterpret_cast<const TUint8*>(aFunctionStr))
-	{
-	UTF::Printf(UTF::TTraceContext(UTF::ESystemCharacteristicMetrics), KProfilerBegin, &iFunctionStr, iObj);
-	}
-
-/**
-Destroys TSqlUTraceProfiler object which inserts a UTF trace, used to signal a function exit
-
-@internalComponent
-*/
-TSqlUTraceProfiler::~TSqlUTraceProfiler()
-	{
-	UTF::Printf(UTF::TTraceContext(UTF::ESystemCharacteristicMetrics), KProfilerEnd, &iFunctionStr, iObj);
-	}
-
-#endif //SYMBIAN_TRACE_SQLITE_FUNC
--- a/persistentstorage/sqlite3api/OsLayer/UTraceSqlite.h	Tue Jul 06 16:18:30 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,117 +0,0 @@
-// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-#ifndef UTRACESQLITE_H_
-#define UTRACESQLITE_H_
-
-#if defined SQLITE_ENABLE_TRACE
-
-// UID3 of sqlite3.dll
-#define EXECUTABLE_DEFAULT_MODULEUID 0x10285A79
-
-//The UTF header can only be included after EXECUTABLE_DEFAULT_MODULEUID is defined  
-#include <e32utf.h>
-
-/**
-Enable this macro to compile in the SQLite trace points that certain porting layer functions entry and exit. 
-From the timestamps of these trace, the total time spent in these functions can be worked out. 
-These traces are particularly useful for performance investigations.
-
-@SymTraceMacro
-*/
-#undef SYMBIAN_TRACE_SQLITE_FUNC
-
-/**
-Enable this macro to compile in the SQLite trace points that trace the following internal events. 
-	-	Extra internal information for certain porting layer functions
-These traces can be used to assist performance and debug investigations
-
-@SymTraceMacro
-*/
-#undef SYMBIAN_TRACE_SQLITE_EVENTS
-
-#endif //SQLITE_ENABLE_TRACE
-
-
-////////////////////////////////////////////////////////////////////////////////////////////////////////////
-//////////                      		UTrace Related Strings                       ///////////////////////
-////////////////////////////////////////////////////////////////////////////////////////////////////////////
-#if defined SQLITE_ENABLE_TRACE
-#ifdef __SQLITETRACE_STRINGS__
-	#define CONST_LIT8(var, val) extern const TLitC8<sizeof(val)> var = {sizeof(val) - 1, val}
-	#define CONST_LIT16(var, val) extern const TLitC16<sizeof(L##val)/2> var = {sizeof(L##val)/2 - 1, L##val}
-#else
-	#define CONST_LIT8(var, val) extern const TLitC8<sizeof(val)> var
-	#define CONST_LIT16(var, val) extern const TLitC16<sizeof(L##val)/2> var
-#endif
-
-//File I/O trace format strings
-CONST_LIT8(KFileRead, 			"Sqlite: Size - %d bytes, File Offset Position - %d,");
-CONST_LIT8(KFileWrite,			"Sqlite: Size - %d bytes, File Offset Position - %d,");
-CONST_LIT8(KFileTruncate,		"Sqlite: Size - %d bytes");
-CONST_LIT8(KFileFileCtr,		"Sqlite: Opeartion Called - %d");
-CONST_LIT16(KFileOpen,			"Sqlite: Sqlite3_file - 0x%x, Filename - \"%S\"");
-CONST_LIT16(KFileName,			"Sqlite: Filename - \"%S\"");
-
-//TSqlUTraceProfiler trace format strings, used to display function entry and exit
-CONST_LIT8(KProfilerBegin,			"Function Entry:\"%S\", Address - 0x%x");
-CONST_LIT8(KProfilerEnd,			"Function Exit:\"%S\",  Address - 0x%x");
-
-#endif //SQLITE_ENABLE_TRACE
-
-////////////////////////////////////////////////////////////////////////////////////////////////////////////
-//////////              UTrace Related Macro Functions and Class Declarations           ////////////////////
-////////////////////////////////////////////////////////////////////////////////////////////////////////////
-#ifdef SYMBIAN_TRACE_SQLITE_FUNC
-
-/**
-This class is used to help trace function entry and exits within sqlite3.dll
-Exist only when SYMBIAN_TRACE_SQLITE_FUNC is enabled.
-
-@internalComponent
-*/
-class TSqlUTraceProfiler
-	{
-	public:
-		TSqlUTraceProfiler(const TAny* aObj, const char* aFunctionStr);
-		~TSqlUTraceProfiler();
-	private: 
-		const TAny* iObj;
-		TPtrC8 iFunctionStr;
-	};
-
-//This macro should be used to trace function entry and exits within Symbian SQL 
-//Works only when SYMBIAN_TRACE_SQLITE_FUNC is enabled. Otherwise it evaluates to zero
-#define SQLUTRACE_PROFILER(x) TSqlUTraceProfiler _profiler(x, __PRETTY_FUNCTION__)
-
-#else
-
-#define SQLUTRACE_PROFILER(x) void(0)
-#endif //SYMBIAN_TRACE_SQLITE_FUNC
-
-#ifdef SYMBIAN_TRACE_SQLITE_EVENTS
-
-//This macro should be used to trace events occuring within Symbian SQL.
-//To use the macro, insert the full UTF statement as the macro parameter
-//Works only when SYMBIAN_TRACE_SQLITE_EVENTS is enabled. Otherwise it evaluates to zero
-#define SYMBIAN_TRACE_SQLITE_EVENTS_ONLY(c) c
-const TPtrC8 GetFuncString(TInt aFunction);
-
-#else
-
-#define SYMBIAN_TRACE_SQLITE_EVENTS_ONLY(c) void(0)
-#endif //SYMBIAN_TRACE_SQLITE_EVENTS
-////////////////////////////////////////////////////////////////////////////////////////////////////////////
-#endif /* UTRACESQLITE_H_ */
--- a/persistentstorage/sqlite3api/OsLayer/os_symbian.h	Tue Jul 06 16:18:30 2010 +0300
+++ b/persistentstorage/sqlite3api/OsLayer/os_symbian.h	Wed Aug 18 11:30:17 2010 +0300
@@ -1,5 +1,5 @@
 /**
-* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of "Eclipse Public License v1.0"
@@ -30,45 +30,6 @@
 
 #ifdef SQLITE_OS_SYMBIAN
 
-/**
-Multi-threaded Symbian OS porting layer panic category.
-
-@see TPanicCodes
-
-@internalComponent
-*/
-_LIT(KPanicCategory, "SqliteMt");
-
-/**
-Panic codes - used by asserts in the multi-threaded OS porting layer.
-
-@see KPanicCategory
-
-@internalComponent
-*/
-enum TPanicCodes
-	{
-	EPanicFsCreationError		= 1,
-	EPanicMutexCreationError	= 2,
-	EPanicInvalidFs				= 3,
-	EPanicNullPls1				= 4,
-	EPanicNullPls2				= 5,
-	EPanicNullPls3				= 6,
-	EPanicNullPls4				= 7,
-	EPanicAssert				= 8,
-	EPanicMaxKeysExceeded		= 9,
-	EPanicBufferSizeExceeded	=10,
-	EPanicNullKey				=11,
-	EPanicWsdBufSize			=12,
-	EPanicWsdEntryCount			=13,
-	EPanicInternalError			=19,
-	EPanicNullDbFilePtr			=20,
-	EPanicInvalidLock			=21,
-	EPanicInvalidMutexType		=22,
-	EPanicMutexLockCounter		=23,
-	EPanicMutexOwner			=24
-	};
-
 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 //////////////////////////  TStaticFs  /////////////////////////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -341,6 +302,7 @@
 	static TInt DoGetDeviceCharacteristics(const TDriveInfo& aDriveInfo, const TVolumeIOParamInfo& aVolumeInfo);
 	static TInt DoGetSectorSize(const TDriveInfo& aDriveInfo, const TVolumeIOParamInfo& aVolumeInfo);
 	static TInt DoGetDeviceCharacteristicsAndSectorSize(TDbFile& aDbFile, TInt& aRecReadBufSize);
+	static TInt DoFileSizeCorruptionCheck(TDbFile& aDbFile, const TDesC& aFname, TInt aFmode);
 	};
 	
 ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
--- a/persistentstorage/sqlite3api/OsLayer/os_symbian_emul.cpp	Tue Jul 06 16:18:30 2010 +0300
+++ b/persistentstorage/sqlite3api/OsLayer/os_symbian_emul.cpp	Wed Aug 18 11:30:17 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -22,6 +22,12 @@
 #include "os_symbian.h"
 #include <pls.h>
 #include <e32std.h>
+#include "SqliteUtil.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "os_symbian_emulTraces.h"
+#endif
+#include "SqliteTraceDef.h"
 
 #ifdef SQLITE_OS_SYMBIAN
 
@@ -78,7 +84,7 @@
 			{
 			idx = ++idx % KMaxEntries;
 			}
-		__ASSERT_ALWAYS(cnt < KMaxEntries, User::Panic(KPanicCategory, EPanicMaxKeysExceeded));
+		__ASSERT_ALWAYS(cnt < KMaxEntries, __SQLITEPANIC2(ESqliteOsPanicMaxKeysExceeded));
 		if(!iTable[idx].iKey)
 			{
 			Add(idx, aKey, aLength);
@@ -105,7 +111,7 @@
 	*/
 	void Add(TInt aIdx, const TUint8* aKey, TInt aLength)
 		{
-		__ASSERT_ALWAYS((iSize + aLength) <= KBufferSize, User::Panic(KPanicCategory, EPanicBufferSizeExceeded));
+		__ASSERT_ALWAYS((iSize + aLength) <= KBufferSize, __SQLITEPANIC2(ESqliteOsPanicBufferSizeExceeded));
 		//Add new entry to the hash table and the intial value to the WSD buffer
 		iTable[aIdx].iKey = aKey;
 		iTable[aIdx].iData = iNext;
@@ -159,16 +165,20 @@
 */
 static TInt PlsInitialize(TPls* aPls)
 	{
-	__ASSERT_ALWAYS(aPls != NULL, User::Panic(KPanicCategory, EPanicNullPls1));
+	SQLITE_TRACE_OS(OstTrace0(TRACE_INTERNALS, PLSINITIALIZE_ENTRY, "OS-Entry;0;PlsInitialize"));
+	__ASSERT_ALWAYS(aPls != NULL, __SQLITEPANIC2(ESqliteOsPanicNullPls1));
 	//Global RFs object
 	TInt err = aPls->iStaticFs.Connect();
-	__ASSERT_ALWAYS(err == KErrNone , User::Panic(KPanicCategory, EPanicFsCreationError));
+	SQLITE_TRACE_OS(OstTrace1(TRACE_INTERNALS, PLSINITIALIZE1, "OS;0;PlsInitialize;iStaticFs.Connect() err=%d", err));
+	__ASSERT_ALWAYS(err == KErrNone, __SQLITEPANIC2(ESqliteOsPanicFsCreationError));
 	//Static mutexes
-	for(TInt i=0;i<(sizeof(aPls->iStaticMutex)/sizeof(aPls->iStaticMutex[0])) && err==KErrNone;++i)
+	TInt idx = 0;
+	for(;idx<(sizeof(aPls->iStaticMutex)/sizeof(aPls->iStaticMutex[0])) && err==KErrNone;++idx)
 		{
-		err = aPls->iStaticMutex[i].Create();
+		err = aPls->iStaticMutex[idx].Create();
 		}
-	__ASSERT_ALWAYS(err == KErrNone , User::Panic(KPanicCategory, EPanicMutexCreationError));
+	SQLITE_TRACE_OS(OstTraceExt2(TRACE_INTERNALS, PLSINITIALIZE2, "OS;0;PlsInitialize;iStaticMutex[%d].Create() err=%d", idx, err));
+	__ASSERT_ALWAYS(err == KErrNone , __SQLITEPANIC2(ESqliteOsPanicMutexCreationError));
 	//WSD map
 	//...already initialized by its constructor
 	//sqlite3_vfs object	
@@ -191,6 +201,7 @@
 	aPls->iVfsApi.xCurrentTime 	= &TVfs::CurrentTime;
 	aPls->iVfsApi.xGetLastError	= &TVfs::GetLastError;
 	
+	SQLITE_TRACE_OS(OstTrace0(TRACE_INTERNALS, PLSINITIALIZE_EXIT, "OS-Exit;0;PlsInitialize"));
 	return KErrNone;
 	}
 
@@ -213,8 +224,8 @@
 RFs& TStaticFs::Fs()
 	{
 	TPls* pls = ::Pls(KSqliteUid, &PlsInitialize);
-	__ASSERT_ALWAYS(pls != 0, User::Panic(KPanicCategory, EPanicNullPls2));
-	__ASSERT_DEBUG(pls->iStaticFs.iFs.Handle() != KNullHandle, User::Panic(KPanicCategory, EPanicInvalidFs));
+	__ASSERT_ALWAYS(pls != 0, __SQLITEPANIC2(ESqliteOsPanicNullPls2));
+	__ASSERT_DEBUG(pls->iStaticFs.iFs.Handle() != KNullHandle, __SQLITEPANIC2(ESqliteOsPanicInvalidFs));
 	return pls->iStaticFs.iFs;
 	}
 
@@ -229,8 +240,8 @@
 sqlite3_mutex* StaticMutex(TInt aType)
 	{
 	TPls* pls = ::Pls(KSqliteUid, &PlsInitialize);
-	__ASSERT_ALWAYS(pls != 0, User::Panic(KPanicCategory, EPanicNullPls3));
-	__ASSERT_ALWAYS((TUint)aType < (sizeof(pls->iStaticMutex)/sizeof(pls->iStaticMutex[0])), User::Panic(KPanicCategory, EPanicInvalidMutexType));
+	__ASSERT_ALWAYS(pls != 0, __SQLITEPANIC2(ESqliteOsPanicNullPls3));
+	__ASSERT_ALWAYS((TUint)aType < (sizeof(pls->iStaticMutex)/sizeof(pls->iStaticMutex[0])), __SQLITEPANIC2(ESqliteOsPanicInvalidMutexType));
 	return &pls->iStaticMutex[aType];
 	}
 
@@ -253,8 +264,8 @@
 */
 int sqlite3_wsd_init(int aWsdBufSize, int aWsdEntryCount)
 	{
-	__ASSERT_ALWAYS(aWsdBufSize <= TWsdMap::KBufferSize, User::Panic(KPanicCategory, EPanicWsdBufSize));
-	__ASSERT_ALWAYS(aWsdEntryCount <= TWsdMap::KMaxEntries, User::Panic(KPanicCategory, EPanicWsdEntryCount));
+	__ASSERT_ALWAYS(aWsdBufSize <= TWsdMap::KBufferSize, __SQLITEPANIC2(ESqliteOsPanicWsdBufSize));
+	__ASSERT_ALWAYS(aWsdEntryCount <= TWsdMap::KMaxEntries, __SQLITEPANIC2(ESqliteOsPanicWsdEntryCount));
 	return SQLITE_OK;	
 	}
 
@@ -272,7 +283,7 @@
 */
 void* sqlite3_wsd_find(void* aKey, int aLength)
 	{
-	__ASSERT_ALWAYS(aKey != NULL, User::Panic(KPanicCategory, EPanicNullKey));
+	__ASSERT_ALWAYS(aKey != NULL, __SQLITEPANIC2(ESqliteOsPanicNullKey));
 	return ::Pls(KSqliteUid, &PlsInitialize)->iWsdMap.Find(static_cast <const TUint8*> (aKey), aLength);
 	}
 
@@ -283,7 +294,7 @@
 sqlite3_vfs* VfsApi()
 	{
 	TPls* pls = ::Pls(KSqliteUid, &PlsInitialize);
-	__ASSERT_ALWAYS(pls != 0, User::Panic(KPanicCategory, EPanicNullPls4));
+	__ASSERT_ALWAYS(pls != 0, __SQLITEPANIC2(ESqliteOsPanicNullPls4));
 	return &pls->iVfsApi;
 	}
 
--- a/persistentstorage/sqlite3api/OsLayer/os_symbian_hrdw.cpp	Tue Jul 06 16:18:30 2010 +0300
+++ b/persistentstorage/sqlite3api/OsLayer/os_symbian_hrdw.cpp	Wed Aug 18 11:30:17 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -20,6 +20,12 @@
  @file
 */
 #include "os_symbian.h"
+#include "SqliteUtil.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "os_symbian_hrdwTraces.h"
+#endif
+#include "SqliteTraceDef.h"
 
 #ifdef SQLITE_OS_SYMBIAN
 
@@ -47,7 +53,7 @@
 	TInt err = Connect();
 	if(err != KErrNone)
 		{
-		RDebug::Print(_L("===SQLITE OS porting layer, file session creation has failed with err=%d.\r\n"), err);
+		SQLITE_TRACE_OS(OstTraceExt2(TRACE_INTERNALS, TSTATICFS_TSTATICFS, "OS;0x%X;TStaticFs::TStaticFs;err=%d", (TUint)this, err));
 		User::Exit(err);	
 		}
 	}
@@ -63,7 +69,7 @@
 */
 RFs& TStaticFs::Fs()
 	{
-	__ASSERT_DEBUG(TheFs.iFs.Handle() != KNullHandle, User::Panic(KPanicCategory, EPanicInvalidFs));
+	__ASSERT_DEBUG(TheFs.iFs.Handle() != KNullHandle, __SQLITEPANIC2(ESqliteOsPanicInvalidFs));
 	return TheFs.iFs;
 	}
 
@@ -91,14 +97,14 @@
 	TInt err = Create();
 	if(err != KErrNone)
 		{
-		RDebug::Print(_L("===SQLITE OS porting layer, static mutex creation has failed with err=%d.\r\n"), err);
+		SQLITE_TRACE_OS(OstTraceExt2(TRACE_INTERNALS, TSTATICMUTEX_TSTATICMUTEX, "OS;0x%X;TStaticMutex::TStaticMutex;err=%d", (TUint)this, err));
 		User::Exit(err);	
 		}
 	}
 
 sqlite3_mutex* StaticMutex(TInt aType)
 	{
-	__ASSERT_ALWAYS((TUint)aType < (sizeof(TheStaticMutex)/sizeof(TheStaticMutex[0])), User::Panic(KPanicCategory, EPanicInvalidMutexType));
+	__ASSERT_ALWAYS((TUint)aType < (sizeof(TheStaticMutex)/sizeof(TheStaticMutex[0])), __SQLITEPANIC2(ESqliteOsPanicInvalidMutexType));
 	return &TheStaticMutex[aType];
 	}
 
--- a/persistentstorage/sqlite3api/OsLayer/os_symbian_mt.cpp	Tue Jul 06 16:18:30 2010 +0300
+++ b/persistentstorage/sqlite3api/OsLayer/os_symbian_mt.cpp	Wed Aug 18 11:30:17 2010 +0300
@@ -36,7 +36,16 @@
 	}
 #include <e32math.h>
 #include "os_symbian.h"
-#include "UTraceSqlite.h"
+#include "SqliteUtil.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "os_symbian_mtTraces.h"
+#endif
+#include "SqliteTraceDef.h"
+
+//Bit-mask constant. If xOpen()'s "aFlag" parameter contains one of these bits set, then the the file top be
+//opened or created is a journal file.
+const TUint KJournalFileTypeBitMask = SQLITE_OPEN_MAIN_JOURNAL | SQLITE_OPEN_TEMP_JOURNAL | SQLITE_OPEN_SUBJOURNAL | SQLITE_OPEN_MASTER_JOURNAL; 
 
 #ifdef SQLITE_TEST
 
@@ -96,7 +105,7 @@
 			return SQLITE_FULL;
 		default:
 #ifdef _DEBUG		
-			RDebug::Print(_L("SQLite3 C API, Os2SqliteErr(), err=%d\n"), aOsErr);
+			SQLITE_TRACE_OS(OstTrace1(TRACE_INTERNALS, OS2SQLITEERR, "OS;0;Os2SqliteErr;aOsErr=%d", aOsErr));
 #endif			
 			break;
 		}
@@ -125,6 +134,7 @@
 		{
 		iFs.Close();	
 		}
+	SQLITE_TRACE_OS(OstTraceExt2(TRACE_INTERNALS, TSTATICFS_CONNECT, "OS;0;TStaticFs::Connect;iFs.Handle()=0x%X;err=%d", iFs.Handle(), err));
 	return err;
 	}
 
@@ -139,6 +149,7 @@
 	iRefCount(0),
 	iOwnerThreadId(KMaxTUint64)
 	{
+	SQLITE_TRACE_OS(OstTrace1(TRACE_INTERNALS, SQLITE3_MUTEX_SQLITE3_MUTEX, "OS;0x%X;sqlite3_mutex::sqlite3_mutex", (TUint)this));
 	}
 
 /**
@@ -146,6 +157,7 @@
 */
 sqlite3_mutex::~sqlite3_mutex()
 	{
+	SQLITE_TRACE_OS(OstTrace1(TRACE_INTERNALS, SQLITE3_MUTEX_SQLITE3_MUTEX2, "OS;0x%X;sqlite3_mutex::~sqlite3_mutex", (TUint)this));
 	iMutex.Close();
 	}
 
@@ -159,7 +171,7 @@
 */
 void sqlite3_mutex::Enter()
 	{
-    __ASSERT_DEBUG(iRefCount >= 0, User::Panic(KPanicCategory, EPanicMutexLockCounter));
+    __ASSERT_DEBUG(iRefCount >= 0, __SQLITEPANIC(ESqliteOsPanicMutexLockCounter));
 	iMutex.Wait();
 	RThread currThread;
 	iOwnerThreadId = currThread.Id();
@@ -177,10 +189,10 @@
 */
 void sqlite3_mutex::Leave()
 	{
-	__ASSERT_DEBUG(iRefCount > 0, User::Panic(KPanicCategory, EPanicMutexLockCounter));
+	__ASSERT_DEBUG(iRefCount > 0, __SQLITEPANIC(ESqliteOsPanicMutexLockCounter));
 #ifdef _DEBUG
 	RThread currThread;	
-	__ASSERT_DEBUG(iOwnerThreadId == currThread.Id(), User::Panic(KPanicCategory, EPanicMutexOwner));
+	__ASSERT_DEBUG(iOwnerThreadId == currThread.Id(), __SQLITEPANIC(ESqliteOsPanicMutexOwner));
 #endif
 	--iRefCount;
 	iMutex.Signal();
@@ -205,7 +217,9 @@
 */
 TInt sqlite3_mutex::Create()
 	{
-	return iMutex.CreateLocal();
+	TInt err = iMutex.CreateLocal();
+	SQLITE_TRACE_OS(OstTraceExt2(TRACE_INTERNALS, SQLITE3_MUTEX_CREATE, "OS;0x%X;sqlite3_mutex::Create;err=%d", (TUint)this, err));
+	return err;
 	}
 
 /**
@@ -224,6 +238,7 @@
 			self = NULL;
 			}
 		}
+	SQLITE_TRACE_OS(OstTrace1(TRACE_INTERNALS, CRECURSIVEMUTEX_NEWL, "OS;0x%X;CRecursiveMutex::New", (TUint)self));
 	return self;
 	}
 
@@ -243,7 +258,6 @@
 */
 int TMutexApi::Init()
 	{
-	SQLUTRACE_PROFILER(0);
 	return SQLITE_OK;
 	}
 	
@@ -255,7 +269,6 @@
 */
 int TMutexApi::End()
 	{
-	SQLUTRACE_PROFILER(0);
 	return SQLITE_OK;
 	}
 	
@@ -268,7 +281,6 @@
 */
 sqlite3_mutex* TMutexApi::Alloc(int aType)
 	{
-	SQLUTRACE_PROFILER(0);
 	sqlite3_mutex* mutex = NULL;
 	switch(aType)
 		{
@@ -281,6 +293,7 @@
 			//value is 2 (SQLITE_MUTEX_FAST is 0, SQLITE_MUTEX_RECURSIVE is 1). 
 			break;	
 		}
+	SQLITE_TRACE_OS(OstTraceExt2(TRACE_INTERNALS, TMUTEXAPI_ALLOC, "OS;0;TMutexApi::Alloc;aType=%d;mutex=0x%X", aType, (TUint)mutex));
 	return mutex;
 	}
 	
@@ -290,7 +303,7 @@
 */
 void TMutexApi::Free(sqlite3_mutex* aMutex)
 	{
-	SQLUTRACE_PROFILER(0);
+	SQLITE_TRACE_OS(OstTrace1(TRACE_INTERNALS, TMUTEXAPI_FREE, "OS;0;TMutexApi::Free;mutex=0x%X", (TUint)aMutex));
 	delete aMutex;
 	}
 	
@@ -304,7 +317,6 @@
 */
 void TMutexApi::Enter(sqlite3_mutex* aMutex)
 	{
-	SQLUTRACE_PROFILER(0);
 	aMutex->Enter();
 	}
 	
@@ -315,7 +327,6 @@
 */
 int TMutexApi::Try(sqlite3_mutex*)
 	{
-	SQLUTRACE_PROFILER(0);
 	return SQLITE_BUSY;
 	}
 	
@@ -329,7 +340,6 @@
 */
 void TMutexApi::Leave(sqlite3_mutex* aMutex)
 	{
-	SQLUTRACE_PROFILER(0);
 	aMutex->Leave();
 	}
 	
@@ -345,7 +355,6 @@
 */
 int TMutexApi::Held(sqlite3_mutex* aMutex)
 	{
-	SQLUTRACE_PROFILER(0);
 	return aMutex->IsHeld();
 	}
 	
@@ -361,7 +370,6 @@
 */
 int TMutexApi::Notheld(sqlite3_mutex* aMutex)
 	{
-	SQLUTRACE_PROFILER(0);
 	return !aMutex->IsHeld();
 	}
 
@@ -374,7 +382,9 @@
 */
 extern "C" SQLITE_EXPORT int sqlite3_os_init(void)
 	{
-	return sqlite3_vfs_register(VfsApi(), 1);
+	TInt err = sqlite3_vfs_register(VfsApi(), 1);
+	SQLITE_TRACE_OS(OstTrace1(TRACE_INTERNALS, SQLITE3_OS_INIT, "OS;0;sqlite3_os_init;err=%d", err));
+	return err;
 	}
 
 /**
@@ -382,7 +392,9 @@
 */
 extern "C" SQLITE_EXPORT int sqlite3_os_end(void)
 	{
-	return sqlite3_vfs_unregister(VfsApi());
+	TInt err = sqlite3_vfs_unregister(VfsApi());
+	SQLITE_TRACE_OS(OstTrace1(TRACE_INTERNALS, SQLITE3_OS_END, "OS;0;sqlite3_os_end;err=%d", err));
+	return err;
 	}
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -521,6 +533,7 @@
 	iDeviceCharacteristics(-1)
 	{
 	pMethods = 0;
+	SQLITE_TRACE_OS(OstTrace1(TRACE_INTERNALS, TDBFILE_TDBFILE, "OS;0x%X;TDbFile::TDbFile", (TUint)this));
 	}
 
 /**
@@ -541,7 +554,7 @@
 */
 static inline TDbFile& DbFile(sqlite3_file* aDbFile)
 	{
-	__ASSERT_DEBUG(aDbFile != 0, User::Panic(KPanicCategory, EPanicNullDbFilePtr));
+	__ASSERT_DEBUG(aDbFile != 0, __SQLITEPANIC2(ESqliteOsPanicNullDbFilePtr));
 	return *(static_cast <TDbFile*> (aDbFile));
 	}
 
@@ -563,13 +576,14 @@
 */
 /* static */ int TFileIo::Close(sqlite3_file* aDbFile)
 	{
-	SQLUTRACE_PROFILER(aDbFile);
 	TDbFile& dbFile = ::DbFile(aDbFile);
+	SQLITE_TRACE_OS(OstTrace1(TRACE_INTERNALS, TFILEIO_CLOSE1, "OS;0x%X;TFileIo::Close", (TUint)&dbFile));
 	dbFile.iFileBuf.Close();	
 	if(dbFile.iFullName)
         {//"iFullName" will not be NULL only when TVfs::Open() is called with SQLITE_OPEN_DELETEONCLOSE flag.
          //That means - SQlite expects the file to be deleted after the file close operation. 
-		(void)TStaticFs::Fs().Delete(*dbFile.iFullName);
+		__SQLITETRACE_OSEXPR(TInt err = ) TStaticFs::Fs().Delete(*dbFile.iFullName);
+		SQLITE_TRACE_OS(OstTraceExt3(TRACE_INTERNALS, TFILEIO_CLOSE2, "OS;0x%X;TFileIo::Close;delete fileName=%S;err=%d", (TUint)&dbFile, __SQLITEPRNSTR(*dbFile.iFullName), err));
 		delete dbFile.iFullName;
 		dbFile.iFullName = NULL;
 		}
@@ -598,10 +612,9 @@
 */
 /* static */ int TFileIo::Read(sqlite3_file* aDbFile, void* aBuf, int aAmt, sqlite3_int64 aOffset)
 	{
-	SQLUTRACE_PROFILER(aDbFile);
-	SYMBIAN_TRACE_SQLITE_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KFileRead, aAmt, aOffset));
 	SimulateIOError(return SQLITE_IOERR_READ);
 	TDbFile& dbFile = ::DbFile(aDbFile);
+	SQLITE_TRACE_OS(OstTraceExt3(TRACE_INTERNALS, TFILEIO_READ_ENTRY, "OS-Entry;0x%X;TFileIo::Read;aAmt=%d;aOffset=%lld", (TUint)&dbFile, aAmt, aOffset));
 	TPtr8 ptr((TUint8*)aBuf, 0, aAmt);
 	TInt err = dbFile.iFileBuf.Read(aOffset, ptr);
 	TInt cnt = ptr.Length();
@@ -611,6 +624,7 @@
 		Mem::FillZ(static_cast <TUint8*> (aBuf) + cnt, aAmt - cnt);
 		sqliteErr = SQLITE_IOERR_SHORT_READ;
 		}
+	SQLITE_TRACE_OS(OstTraceExt4(TRACE_INTERNALS, TFILEIO_READ_EXIT, "OS-Exit;0x%X;TFileIo::Read;cnt=%d;err=%d;sqliteErr=%d", (TUint)&dbFile, cnt, err, sqliteErr));
 	return sqliteErr;
 	}
 
@@ -634,18 +648,19 @@
 */
 /* static */ int TFileIo::Write(sqlite3_file* aDbFile, const void* aData, int aAmt, sqlite3_int64 aOffset)
 	{
-	SQLUTRACE_PROFILER(aDbFile);
-	SYMBIAN_TRACE_SQLITE_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KFileWrite, aAmt, aOffset));
 	SimulateIOError(return SQLITE_IOERR_WRITE);
 	SimulateDiskfullError(return SQLITE_FULL);
 	TDbFile& dbFile = ::DbFile(aDbFile);
+	SQLITE_TRACE_OS(OstTraceExt3(TRACE_INTERNALS, TFILEIO_WRITE_ENTRY, "OS-Entry;0x%X;TFileIo::Write;aAmt=%d;aOffset=%lld", (TUint)&dbFile, aAmt, aOffset));
 	TInt err = KErrAccessDenied;
 	if(!dbFile.iReadOnly)
 		{
 		TPtrC8 ptr((const TUint8*)aData, aAmt);
 		err = dbFile.iFileBuf.Write(aOffset, ptr);
 		}
-	return ::Os2SqliteErr(err, SQLITE_IOERR_WRITE);
+	TInt sqliteErr = ::Os2SqliteErr(err, SQLITE_IOERR_WRITE);
+	SQLITE_TRACE_OS(OstTraceExt3(TRACE_INTERNALS, TFILEIO_WRITE_EXIT, "OS-Exit;0x%X;TFileIo::Write;err=%d;sqliteErr=%d", (TUint)&dbFile, err, sqliteErr));
+	return sqliteErr;
 	}
 
 /**
@@ -666,16 +681,17 @@
 */
 /* static */ int TFileIo::Truncate(sqlite3_file* aDbFile, sqlite3_int64 aLength)
 	{
-	SQLUTRACE_PROFILER(aDbFile);
-	SYMBIAN_TRACE_SQLITE_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KFileTruncate, aLength));
 	SimulateIOError(return SQLITE_IOERR_TRUNCATE);
 	TDbFile& dbFile = ::DbFile(aDbFile);
+	SQLITE_TRACE_OS(OstTraceExt2(TRACE_INTERNALS, TFILEIO_TRUNCATE_ENTRY, "OS-Entry;0x%X;TFileIo::Truncate;aLength=%lld", (TUint)&dbFile, aLength));
 	TInt err = KErrAccessDenied;
 	if(!dbFile.iReadOnly)
 		{
 		err = dbFile.iFileBuf.SetSize(aLength);
 		}
-	return ::Os2SqliteErr(err, SQLITE_IOERR_TRUNCATE);
+	TInt sqliteErr = ::Os2SqliteErr(err, SQLITE_IOERR_TRUNCATE);
+	SQLITE_TRACE_OS(OstTraceExt3(TRACE_INTERNALS, TFILEIO_TRUNCATE_EXIT, "OS-Exit;0x%X;TFileIo::Truncate;err=%d;sqliteErr=%d", (TUint)&dbFile, err, sqliteErr));
+	return sqliteErr;
 	}
 
 /**
@@ -696,9 +712,9 @@
 */
 /* static */int TFileIo::Sync(sqlite3_file* aDbFile, int aFlags)
 	{
-	SQLUTRACE_PROFILER(aDbFile);
 	SimulateIOError(return SQLITE_IOERR_FSYNC);
 	TDbFile& dbFile = ::DbFile(aDbFile);
+	SQLITE_TRACE_OS(OstTrace1(TRACE_INTERNALS, TFILEIO_SYNC_ENTRY, "OS-Entry;0x%X;TFileIo::Sync", (TUint)&dbFile));
 #ifdef SQLITE_TEST
 	if(aFlags & SQLITE_SYNC_FULL)
 		{
@@ -713,7 +729,9 @@
 		{
 		err = dbFile.iFileBuf.Flush();
 		}
-	return ::Os2SqliteErr(err, SQLITE_IOERR_FSYNC);
+	TInt sqliteErr = ::Os2SqliteErr(err, SQLITE_IOERR_FSYNC);
+	SQLITE_TRACE_OS(OstTraceExt3(TRACE_INTERNALS, TFILEIO_SYNC_EXIT, "OS-Exit;0x%X;TFileIo::Sync;err=%d;sqliteErr=%d", (TUint)&dbFile, err, sqliteErr));
+	return sqliteErr;
 	}
 
 /**
@@ -732,11 +750,13 @@
 */
 /* static */ int TFileIo::FileSize(sqlite3_file* aDbFile, sqlite3_int64* aSize)
 	{
-	SQLUTRACE_PROFILER(aDbFile);
 	SimulateIOError(return SQLITE_IOERR_FSTAT);
 	TDbFile& dbFile = ::DbFile(aDbFile);
+	SQLITE_TRACE_OS(OstTrace1(TRACE_INTERNALS, TFILEIO_FILESIZE_ENTRY, "OS-Entry;0x%X;TFileIo::FileSize", (TUint)&dbFile));
 	TInt err =  dbFile.iFileBuf.Size(*aSize);
-	return ::Os2SqliteErr(err, SQLITE_IOERR_FSTAT);
+	TInt sqliteErr = ::Os2SqliteErr(err, SQLITE_IOERR_FSTAT);
+	SQLITE_TRACE_OS(OstTraceExt4(TRACE_INTERNALS, TFILEIO_FILESIZE_EXIT, "OS-Exit;0x%X;TFileIo::FileSize;aSize=%lld;err=%d;sqliteErr=%d", (TUint)&dbFile, *aSize, err, sqliteErr));
+	return sqliteErr;
 	}
 
 /**
@@ -779,6 +799,7 @@
 	    	break;
 	    	}
 		}
+	SQLITE_TRACE_OS(OstTraceExt2(TRACE_INTERNALS, TFILEIO_GETREADLOCK, "OS;0x%X;TFileIo::GetReadLock;rc=%d", (TUint)&aDbFile, rc));
 	return rc;
 	}
 
@@ -795,7 +816,9 @@
 */
 /* static */TInt TFileIo::UnlockReadLock(TDbFile& aDbFile)
 	{
-	return aDbFile.iFileBuf.UnLock(SHARED_FIRST + aDbFile.iSharedLockByte, 1);
+	TInt err = aDbFile.iFileBuf.UnLock(SHARED_FIRST + aDbFile.iSharedLockByte, 1);
+	SQLITE_TRACE_OS(OstTraceExt2(TRACE_INTERNALS, TFILEIO_UNLOCKREADLOCK, "OS;0x%X;TFileIo::UnlockReadLock;err=%d", (TUint)&aDbFile, err));
+	return err;
 	}
 
 /**
@@ -832,11 +855,11 @@
 */
 /* static */ int TFileIo::Lock(sqlite3_file* aDbFile, int aLockType)
 	{
-	SQLUTRACE_PROFILER(aDbFile);
 	TDbFile& dbFile = ::DbFile(aDbFile);
 	//If there is already a lock of this type or more restrictive on the aDbFile, then - do nothing.
 	if(dbFile.iLockType >= aLockType)
 		{
+		SQLITE_TRACE_OS(OstTraceExt3(TRACE_INTERNALS, TFILEIO_LOCK1, "OS;0x%X;TFileIo::Lock;dbFile.iLockType=%d;aLockType=%d", (TUint)&dbFile, dbFile.iLockType, aLockType));
 		return SQLITE_OK;
 		}
 
@@ -848,14 +871,15 @@
 		TInt err = dbFile.iFileBuf.Flush(ETrue);
 		if(err != KErrNone)
 			{
+			SQLITE_TRACE_OS(OstTraceExt2(TRACE_INTERNALS, TFILEIO_LOCK2, "OS;0x%X;TFileIo::Lock;iFileBuf.Flush() failed, err=%d", (TUint)&dbFile, err));
 			return ::Os2SqliteErr(err, SQLITE_IOERR_LOCK);
 			}
 		}
 
 	//Make sure the locking sequence is correct
-	__ASSERT_DEBUG(dbFile.iLockType != SQLITE_LOCK_NONE || aLockType == SQLITE_LOCK_SHARED, User::Panic(KPanicCategory, EPanicInvalidLock));
-	__ASSERT_DEBUG(aLockType != SQLITE_LOCK_PENDING, User::Panic(KPanicCategory, EPanicInvalidLock));
-	__ASSERT_DEBUG(aLockType != SQLITE_LOCK_RESERVED || dbFile.iLockType == SQLITE_LOCK_SHARED, User::Panic(KPanicCategory, EPanicInvalidLock));
+	__ASSERT_DEBUG(dbFile.iLockType != SQLITE_LOCK_NONE || aLockType == SQLITE_LOCK_SHARED, __SQLITEPANIC2(ESqliteOsPanicInvalidLock));
+	__ASSERT_DEBUG(aLockType != SQLITE_LOCK_PENDING, __SQLITEPANIC2(ESqliteOsPanicInvalidLock));
+	__ASSERT_DEBUG(aLockType != SQLITE_LOCK_RESERVED || dbFile.iLockType == SQLITE_LOCK_SHARED, __SQLITEPANIC2(ESqliteOsPanicInvalidLock));
 		
 	TInt rc = SQLITE_OK;    //Return code from subroutines
 	TBool locked = ETrue;   //Result of a file lock call (the default value means: "lock accuired")
@@ -892,10 +916,11 @@
 	//Acquire a shared lock
 	if(aLockType == SQLITE_LOCK_SHARED && locked)
 		{
-		__ASSERT_DEBUG(dbFile.iLockType == SQLITE_LOCK_NONE, User::Panic(KPanicCategory, EPanicInvalidLock));
+		__ASSERT_DEBUG(dbFile.iLockType == SQLITE_LOCK_NONE, __SQLITEPANIC2(ESqliteOsPanicInvalidLock));
 		TInt err = TFileIo::GetReadLock(dbFile);
 		if(err != KErrNone && err != KErrLocked) 
 			{
+			SQLITE_TRACE_OS(OstTraceExt2(TRACE_INTERNALS, TFILEIO_LOCK3, "OS;0x%X;TFileIo::Lock;TFileIo::GetReadLock() failed, err=%d", (TUint)&dbFile, err));
 			return ::Os2SqliteErr(err, SQLITE_IOERR_LOCK);
 			}
 		locked = (err == KErrNone);
@@ -908,10 +933,11 @@
 	//Acquire a RESERVED lock
 	if(aLockType == SQLITE_LOCK_RESERVED && locked)
 		{
-		__ASSERT_DEBUG(dbFile.iLockType == SQLITE_LOCK_SHARED, User::Panic(KPanicCategory, EPanicInvalidLock));
+		__ASSERT_DEBUG(dbFile.iLockType == SQLITE_LOCK_SHARED, __SQLITEPANIC2(ESqliteOsPanicInvalidLock));
 		TInt err = dbFile.iFileBuf.Lock(RESERVED_BYTE, 1); 
 		if(err != KErrNone && err != KErrLocked) 
 			{
+			SQLITE_TRACE_OS(OstTraceExt2(TRACE_INTERNALS, TFILEIO_LOCK4, "OS;0x%X;TFileIo::Lock;iFileBuf.Lock() failed, err=%d", (TUint)&dbFile, err));
 			return ::Os2SqliteErr(err, SQLITE_IOERR_LOCK);
 			}
 		locked = (err == KErrNone);
@@ -931,11 +957,12 @@
 	//Acquire an EXCLUSIVE lock
 	if(aLockType == SQLITE_LOCK_EXCLUSIVE && locked)
 		{
-		__ASSERT_DEBUG(dbFile.iLockType >= SQLITE_LOCK_SHARED, User::Panic(KPanicCategory, EPanicInvalidLock));
+		__ASSERT_DEBUG(dbFile.iLockType >= SQLITE_LOCK_SHARED, __SQLITEPANIC2(ESqliteOsPanicInvalidLock));
 		(void)TFileIo::UnlockReadLock(dbFile);
 		TInt err = dbFile.iFileBuf.Lock(SHARED_FIRST, SHARED_SIZE);
 		if(err != KErrNone && err != KErrLocked)
 			{
+			SQLITE_TRACE_OS(OstTraceExt2(TRACE_INTERNALS, TFILEIO_LOCK5, "OS;0x%X;TFileIo::Lock;iFileBuf.Lock()-2 failed, err=%d", (TUint)&dbFile, err));
 			return ::Os2SqliteErr(err, SQLITE_IOERR_LOCK);
 			}
 		locked = (err == KErrNone);
@@ -949,13 +976,15 @@
 	// release it now.
 	if(gotPendingLock && aLockType == SQLITE_LOCK_SHARED)
 		{
-		(void)dbFile.iFileBuf.UnLock(PENDING_BYTE, 1);
+		__SQLITETRACE_OSEXPR(TInt err =) dbFile.iFileBuf.UnLock(PENDING_BYTE, 1);
+		SQLITE_TRACE_OS(OstTraceExt2(TRACE_INTERNALS, TFILEIO_LOCK6, "OS;0x%X;TFileIo::Lock;iFileBuf.UnLock()=%d", (TUint)&dbFile, err));
   		}
 
 	// Update the state of the lock has held in the file descriptor then
 	// return the appropriate result code.
 	rc = locked ? SQLITE_OK : SQLITE_BUSY;
 	dbFile.iLockType = newLockType;
+	SQLITE_TRACE_OS(OstTraceExt3(TRACE_INTERNALS, TFILEIO_LOCK7, "OS;0x%X;TFileIo::Lock;rc=%d;newLockType=%d", (TUint)&dbFile, rc, newLockType));
 	return rc;
 	}
 
@@ -986,21 +1015,22 @@
 */
 /* static */ int TFileIo::Unlock(sqlite3_file* aDbFile, int aLockType)
 	{
-	__ASSERT_DEBUG(aLockType <= SQLITE_LOCK_SHARED, User::Panic(KPanicCategory, EPanicInvalidLock));
+	__ASSERT_DEBUG(aLockType <= SQLITE_LOCK_SHARED, __SQLITEPANIC2(ESqliteOsPanicInvalidLock));
 	
-	SQLUTRACE_PROFILER(aDbFile);
 	TDbFile& dbFile = ::DbFile(aDbFile);
 	TInt rc = SQLITE_OK;
 	TInt currLockType = dbFile.iLockType;
 	
 	if(currLockType >= SQLITE_LOCK_EXCLUSIVE)
 		{
-		(void)dbFile.iFileBuf.UnLock(SHARED_FIRST, SHARED_SIZE);
+		__SQLITETRACE_OSEXPR(TInt err2 =) dbFile.iFileBuf.UnLock(SHARED_FIRST, SHARED_SIZE);
+		SQLITE_TRACE_OS(OstTraceExt2(TRACE_INTERNALS, TFILEIO_UNLOCK1, "OS;0x%X;TFileIo::Unlock;iFileBuf.UnLock()=%d", (TUint)&dbFile, err2));
 		if(aLockType == SQLITE_LOCK_SHARED)
     		{
 			TInt err = TFileIo::GetReadLock(dbFile); 
 			if(err != KErrNone && err != KErrLocked)
 				{
+				SQLITE_TRACE_OS(OstTraceExt2(TRACE_INTERNALS, TFILEIO_UNLOCK2, "OS;0x%X;TFileIo::Unlock;TFileIo::GetReadLock() failed, err=%d", (TUint)&dbFile, err));
 				return ::Os2SqliteErr(err, SQLITE_IOERR_UNLOCK);
 				}
 			if(err == KErrLocked)
@@ -1012,18 +1042,22 @@
 		}
 	if(currLockType >= SQLITE_LOCK_RESERVED)
 		{
-    	(void)dbFile.iFileBuf.UnLock(RESERVED_BYTE, 1);
+		__SQLITETRACE_OSEXPR(TInt err2 =) dbFile.iFileBuf.UnLock(RESERVED_BYTE, 1);
+		SQLITE_TRACE_OS(OstTraceExt2(TRACE_INTERNALS, TFILEIO_UNLOCK3, "OS;0x%X;TFileIo::Unlock;iFileBuf.UnLock()-2=%d", (TUint)&dbFile, err2));
 		}
 	if(aLockType == SQLITE_LOCK_NONE && currLockType >= SQLITE_LOCK_SHARED)
 		{
-		(void)TFileIo::UnlockReadLock(dbFile);
+		__SQLITETRACE_OSEXPR(TInt err2 =) TFileIo::UnlockReadLock(dbFile);
+		SQLITE_TRACE_OS(OstTraceExt2(TRACE_INTERNALS, TFILEIO_UNLOCK4, "OS;0x%X;TFileIo::Unlock;TFileIo::UnlockReadLock()=%d", (TUint)&dbFile, err2));
 		}
 	if(currLockType>= SQLITE_LOCK_PENDING)
 		{
-		(void)dbFile.iFileBuf.UnLock(PENDING_BYTE, 1);
+		__SQLITETRACE_OSEXPR(TInt err2 =) dbFile.iFileBuf.UnLock(PENDING_BYTE, 1);
+		SQLITE_TRACE_OS(OstTraceExt2(TRACE_INTERNALS, TFILEIO_UNLOCK5, "OS;0x%X;TFileIo::Unlock;iFileBuf.UnLock()-3=%d", (TUint)&dbFile, err2));
 		}
 		
 	dbFile.iLockType = aLockType;
+	SQLITE_TRACE_OS(OstTraceExt3(TRACE_INTERNALS, TFILEIO_UNLOCK6, "OS;0x%X;TFileIo::Unlock;rc=%d;newLockType=%d", (TUint)&dbFile, rc, aLockType));
 	return rc;
 	}
 
@@ -1046,7 +1080,6 @@
 */
 /* static */ int TFileIo::CheckReservedLock(sqlite3_file* aDbFile, int *aResOut)
 	{
-	SQLUTRACE_PROFILER(aDbFile);
 	TDbFile& dbFile = ::DbFile(aDbFile);
 	TInt rc;
 	if(dbFile.iLockType >= SQLITE_LOCK_RESERVED)
@@ -1058,16 +1091,19 @@
 		TInt err = dbFile.iFileBuf.Lock(RESERVED_BYTE, 1);
 		if(err != KErrNone && err != KErrLocked)
 			{
+			SQLITE_TRACE_OS(OstTraceExt2(TRACE_INTERNALS, TFILEIO_CHECKRESERVEDLOCK1, "OS;0x%X;TFileIo::CheckReservedLock;iFileBuf.Lock(), err=%d", (TUint)&dbFile, err));
 			return ::Os2SqliteErr(err, SQLITE_IOERR_CHECKRESERVEDLOCK);
 			}
 		rc = (err == KErrNone);
 		if(rc) //non-zero rc means: the lock has been successful (there wasn't a reserved lock on this file)
 			{
-			(void)dbFile.iFileBuf.UnLock(RESERVED_BYTE, 1);
+			__SQLITETRACE_OSEXPR(TInt err2 =) dbFile.iFileBuf.UnLock(RESERVED_BYTE, 1);
+			SQLITE_TRACE_OS(OstTraceExt2(TRACE_INTERNALS, TFILEIO_CHECKRESERVEDLOCK2, "OS;0x%X;TFileIo::CheckReservedLock;iFileBuf.UnLock()=%d", (TUint)&dbFile, err2));
 			}
     	rc = !rc;
 		}
 	*aResOut = rc;
+	SQLITE_TRACE_OS(OstTraceExt2(TRACE_INTERNALS, TFILEIO_CHECKRESERVEDLOCK3, "OS;0x%X;TFileIo::CheckReservedLock;rc=%d", (TUint)&dbFile, rc));
 	return SQLITE_OK;
 	}
 
@@ -1092,9 +1128,7 @@
 */
 /* static */ int TFileIo::FileControl(sqlite3_file* aDbFile, int aOp, void* aArg)
 	{
-	SQLUTRACE_PROFILER(aDbFile);
 	TDbFile& dbFile = ::DbFile(aDbFile);
-	SYMBIAN_TRACE_SQLITE_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KFileFileCtr, aOp, dbFile.iFullName));
 	TInt err = KErrNone;
 	switch(aOp)
 		{
@@ -1105,7 +1139,9 @@
 			err = KErrArgument;
 			break;
 		}
-	return err == KErrNone ? SQLITE_OK : SQLITE_ERROR;
+	TInt sqliteErr = err == KErrNone ? SQLITE_OK : SQLITE_ERROR;
+	SQLITE_TRACE_OS(OstTraceExt3(TRACE_INTERNALS, TFILEIO_FILECONTROL, "OS;0x%X;TFileIo::FileControl;err=%d;sqliteErr=%d", (TUint)&dbFile, err, sqliteErr));
+	return sqliteErr;
 	}
 
 /**
@@ -1127,9 +1163,8 @@
 */
 /* static */ int TFileIo::SectorSize(sqlite3_file* aDbFile)
 	{
-	SQLUTRACE_PROFILER(aDbFile);
 	TDbFile& dbFile = ::DbFile(aDbFile);
-	__ASSERT_DEBUG(dbFile.iSectorSize > 0, User::Panic(KPanicCategory, EPanicInternalError));
+	__ASSERT_DEBUG(dbFile.iSectorSize > 0, __SQLITEPANIC2(ESqliteOsPanicInternalError));
 	if(dbFile.iSectorSize > 0)
 		{
 		return dbFile.iSectorSize;	
@@ -1156,9 +1191,8 @@
 */
 /* static */ int TFileIo::DeviceCharacteristics(sqlite3_file* aDbFile)
 	{
-	SQLUTRACE_PROFILER(aDbFile);
 	TDbFile& dbFile = ::DbFile(aDbFile);
-	__ASSERT_DEBUG(dbFile.iDeviceCharacteristics >= 0, User::Panic(KPanicCategory, EPanicInternalError));
+	__ASSERT_DEBUG(dbFile.iDeviceCharacteristics >= 0, __SQLITEPANIC2(ESqliteOsPanicInternalError));
 	if(dbFile.iDeviceCharacteristics >= 0)
 		{
 		return dbFile.iDeviceCharacteristics;	
@@ -1185,7 +1219,9 @@
 */
 /* static */ inline TInt TVfs::DoGetVolumeIoParamInfo(RFs& aFs, TInt aDriveNo, TVolumeIOParamInfo& aVolumeInfo)
 	{
-	return aFs.VolumeIOParam(aDriveNo, aVolumeInfo);
+	TInt err = aFs.VolumeIOParam(aDriveNo, aVolumeInfo);
+	SQLITE_TRACE_OS(OstTraceExt2(TRACE_INTERNALS, TVFS_DOGETVOLUMEIOPARAMINFO, "OS;0;TVfs::DoGetVolumeIoParamInfo;aDriveNo=%d;err=%d", aDriveNo, err));
+	return err;
 	}
 
 /**
@@ -1277,7 +1313,7 @@
 			sectorSize = aVolumeInfo.iBlockSize;
 			}
 		}
-	__ASSERT_DEBUG(sectorSize > 0 && (sectorSize & (sectorSize - 1)) == 0, User::Panic(KPanicCategory, EPanicInternalError));
+	__ASSERT_DEBUG(sectorSize > 0 && (sectorSize & (sectorSize - 1)) == 0, __SQLITEPANIC2(ESqliteOsPanicInternalError));
 	return sectorSize;
 	}
 
@@ -1306,8 +1342,8 @@
 */
 /* static */ TInt TVfs::DoGetDeviceCharacteristicsAndSectorSize(TDbFile& aDbFile, TInt& aRecReadBufSize)
 	{
-	__ASSERT_DEBUG(aDbFile.iDeviceCharacteristics < 0, User::Panic(KPanicCategory, EPanicInternalError));
-	__ASSERT_DEBUG(aDbFile.iSectorSize <= 0, User::Panic(KPanicCategory, EPanicInternalError));
+	__ASSERT_DEBUG(aDbFile.iDeviceCharacteristics < 0, __SQLITEPANIC2(ESqliteOsPanicInternalError));
+	__ASSERT_DEBUG(aDbFile.iSectorSize <= 0, __SQLITEPANIC2(ESqliteOsPanicInternalError));
 	TInt driveNo;
 	TDriveInfo driveInfo;
 	TInt err = aDbFile.iFileBuf.Drive(driveNo, driveInfo);
@@ -1324,6 +1360,7 @@
 	aDbFile.iDeviceCharacteristics = TVfs::DoGetDeviceCharacteristics(driveInfo, volumeInfo);
 	aDbFile.iSectorSize = TVfs::DoGetSectorSize(driveInfo, volumeInfo);
 	aRecReadBufSize = volumeInfo.iRecReadBufSize;
+	SQLITE_TRACE_OS(OstTraceExt5(TRACE_INTERNALS, TVFS_DOGETGETDEVICECHARACTERISTICSANDSECTORSIZE, "OS;0x%X;TVfs::DoGetDeviceCharacteristicsAndSectorSize;driveNo=%d;sectorSize=%d;devCharact=0x%X;readBufSize=%d", (TUint)&aDbFile, driveNo, aDbFile.iSectorSize, (TUint)aDbFile.iDeviceCharacteristics, volumeInfo.iRecReadBufSize));
 	return KErrNone;
 	}
 
@@ -1361,6 +1398,64 @@
 /**
 SQLite OS porting layer API.
 
+The behaviour of the RFile/RFile64::SetSize operation is not atomic for non-rugged drives. 
+When RFile/RFile64::SetSize() is called 2 operations occurs:-
+
+1)The cluster chain of the file is updated.
+2)The new file size is added to the file cache.
+
+If a power loss occurs after a SetSize there is a chance that the cluster chain was updated 
+but the new file size is not yet flushed to the file. This puts the file into an inconsistent state.
+This is most likely to occur in the journal file where the time between a SetSize and Flush can 
+be long. 
+
+For this reason this check is added when the file is opened to see if the end of the file can 
+be read straight away, if an error is returned then it is assumed that the SetSize has not be 
+completed previously. In this case the file is deleted and re-created.
+ 
+@param aDbFile A pointer to a TDbFile instance, that contains the file handle.
+@param aFname A string of 16-bit wide characters containing name of the file to be checked.
+@param aFmode The mode in which the file is opened. These mode are documented in TFileMode.
+
+@return KErrNone,          The operation has completed succesfully;
+                           Note that other system-wide error codes may also be returned.
+@see TFileMode
+@see TVfs::Open()
+@see TDbFile
+*/
+/* static */ TInt TVfs::DoFileSizeCorruptionCheck(TDbFile& aDbFile, const TDesC& aFname, TInt aFmode)
+    {
+    const TInt KMinSize = 16;
+    TInt64 size;
+    TInt err = KErrNone ;
+    TBuf8<KMinSize> buf;
+
+    err = aDbFile.iFileBuf.Size(size);
+    if (err != KErrNone)
+        {
+        return err;
+        }
+    TBool IsMinFileSize = (size >= KMinSize);
+    
+    if (IsMinFileSize)
+        {
+        err = aDbFile.iFileBuf.Read(size - KMinSize, buf);
+        }
+    
+    if (err == KErrCorrupt || err == KErrEof || !IsMinFileSize)
+        {
+        aDbFile.iFileBuf.Close();
+        __SQLITETRACE_OSEXPR(TInt err2 =) TStaticFs::Fs().Delete(aFname);
+		SQLITE_TRACE_OS(OstTraceExt4(TRACE_INTERNALS, TVFS_DOFILESIZECORRUPTIONCHECK1, "OS;0x%X;TVfs::DoFileSizeCorruptionCheck;size=%lld;err=%d;deleteErr=%d", (TUint)&aDbFile, size, err, err2));
+        err = aDbFile.iFileBuf.Create(TStaticFs::Fs(), aFname, aFmode);
+		SQLITE_TRACE_OS(OstTraceExt2(TRACE_INTERNALS, TVFS_DOFILESIZECORRUPTIONCHECK2, "OS;0x%X;TVfs::DoFileSizeCorruptionCheck;createErr=%d", (TUint)&aDbFile, err));
+        }
+    return err;
+    }
+
+/**
+SQLite OS porting layer API.
+
 Opens or creates a file which name is in the aFileName parameter.
 If the function succeeds, the file handle and other related information will be stored in the place pointed by the 
 aDbFile parameter, a memory block of sizeof(TDbFile) size for which is allocated by the caller.
@@ -1388,20 +1483,21 @@
 */
 /* static */ int TVfs::Open(sqlite3_vfs* aVfs, const char* aFileName, sqlite3_file* aDbFile, int aFlags, int* aOutFlags)
 	{
-	SQLUTRACE_PROFILER(aVfs);
 	TFileName fname;
 	if(aFileName && !::ConvertToUnicode(aFileName, fname))
 		{
+		SQLITE_TRACE_OS(OstTrace0(TRACE_INTERNALS, TVFS_OPEN1, "OS;0;TVfs::Open;ConvertToUnicode() failed"));
 		return SQLITE_CANTOPEN;	
 		}
-	SYMBIAN_TRACE_SQLITE_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KFileOpen, aDbFile, &fname));
 	new (aDbFile) TDbFile;
 	TDbFile& dbFile = ::DbFile(aDbFile);
+	SQLITE_TRACE_OS(OstTraceExt3(TRACE_INTERNALS, TVFS_OPEN_ENTRY, "OS-Entry;0x%X;TVfs::Open;fname=%S;aFlags=0x%X", (TUint)&aDbFile, __SQLITEPRNSTR(fname), (TUint)aFlags));
 	if(aFileName && (aFlags & SQLITE_OPEN_DELETEONCLOSE))
 		{
 		dbFile.iFullName = fname.Alloc();
 		if(!dbFile.iFullName)
 			{
+			SQLITE_TRACE_OS(OstTrace0(TRACE_INTERNALS, TVFS_OPEN2, "OS;0;TVfs::Open;fname.Alloc() failed"));
 			return SQLITE_IOERR_NOMEM;
 			}
 		}
@@ -1427,22 +1523,31 @@
 		}
 	else
 		{
-		err = KErrGeneral;//The error has to be set here, because, there is case where none of the file create/open operations will be executed
+		err = KErrAccessDenied;//The error has to be set here, because, there is a case where none of the file create/open operations will be executed
+		TInt prevErr = KErrNone;
 		if(aFlags & SQLITE_OPEN_CREATE)
 			{
-			err = dbFile.iFileBuf.Create(TStaticFs::Fs(), fname, fmode);
+			prevErr = err = dbFile.iFileBuf.Create(TStaticFs::Fs(), fname, fmode);
 			}
-		if(err != KErrNone && err != KErrNoMemory)
+		if(err != KErrNone && err != KErrNoMemory && err != KErrDiskFull)
 			{
 			err = dbFile.iFileBuf.Open(TStaticFs::Fs(), fname, fmode);
+			if(err == KErrNone && (aFlags & KJournalFileTypeBitMask))
+			    {
+                err = TVfs::DoFileSizeCorruptionCheck(dbFile, fname, fmode);
+			    }
 			}
-		if((err != KErrNone && err != KErrNoMemory) && (aFlags & SQLITE_OPEN_READWRITE))
+		if((err != KErrNone && err != KErrNoMemory && err != KErrDiskFull) && (aFlags & SQLITE_OPEN_READWRITE))
 			{
 			aFlags &= ~SQLITE_OPEN_READWRITE;
 			aFlags |= SQLITE_OPEN_READONLY;
 			fmode &= ~EFileWrite;
 			err = dbFile.iFileBuf.Open(TStaticFs::Fs(), fname, fmode);
 			}
+		if(err != KErrNone && prevErr == KErrAccessDenied)
+			{
+			err = KErrAccessDenied;
+			}
 		}
 	if(err == KErrNone)
 		{
@@ -1453,6 +1558,11 @@
 		dbFile.iFileBuf.Close();	
 		delete dbFile.iFullName;
 		dbFile.iFullName = NULL;
+        if(!aFileName && fname.Length() > 0)
+            {//temporary file, the error is not KErrNone. Then delete the file (after a successfull 
+             //temporary file creation there could be a failed memory allocation)
+            (void)TStaticFs::Fs().Delete(fname);
+            }
 		}
 	else
 		{
@@ -1465,7 +1575,9 @@
 		(void)dbFile.iFileBuf.SetReadAheadSize(dbFile.iSectorSize, recReadBufSize);
 		OpenCounter(+1);
 		}
-	return ::Os2SqliteErr(err, SQLITE_CANTOPEN);
+	TInt sqliteErr = ::Os2SqliteErr(err, SQLITE_CANTOPEN);
+	SQLITE_TRACE_OS(OstTraceExt4(TRACE_INTERNALS, TVFS_OPEN_EXIT, "OS-Exit;0x%X;TVfs::Open;outFlags=0x%X;err=%d;sqliteErr=%d", (TUint)&aDbFile, aOutFlags ? (TUint)*aOutFlags : 0, err, sqliteErr));
+	return sqliteErr;
 	}
 
 /**
@@ -1483,16 +1595,17 @@
 */
 /* static */ int TVfs::Delete(sqlite3_vfs* aVfs, const char* aFileName, int /*aSyncDir*/)
 	{
-	SQLUTRACE_PROFILER(aVfs);
 	SimulateIOError(return SQLITE_IOERR_DELETE);
 	TFileName fname;
 	if(!::ConvertToUnicode(aFileName, fname))
 		{
+		SQLITE_TRACE_OS(OstTrace0(TRACE_INTERNALS, TVFS_DELETE1, "OS;0;TVfs::Delete;ConvertToUnicode() failed"));
 		return SQLITE_ERROR;	
 		}
-	SYMBIAN_TRACE_SQLITE_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KFileName, &fname));
 	TInt err = TStaticFs::Fs().Delete(fname);
-	return ::Os2SqliteErr(err, SQLITE_IOERR_DELETE);
+	TInt sqliteErr = ::Os2SqliteErr(err, SQLITE_IOERR_DELETE);
+	SQLITE_TRACE_OS(OstTraceExt2(TRACE_INTERNALS, TVFS_DELETE2, "OS;0;TVfs::Delete;err=%d;sqliteErr=%d", err, sqliteErr));
+	return sqliteErr;
 	}
 
 /**
@@ -1511,22 +1624,24 @@
 */
 /* static */ int TVfs::Access(sqlite3_vfs* aVfs, const char* aFileName, int aFlags, int* aResOut)
 	{
-	SQLUTRACE_PROFILER(aVfs);
 	TFileName fname;
 	if(!::ConvertToUnicode(aFileName, fname))
 		{
+		SQLITE_TRACE_OS(OstTrace0(TRACE_INTERNALS, TVFS_ACCESS1, "OS;0;TVfs::Access;ConvertToUnicode() failed"));
 		return SQLITE_IOERR_ACCESS;
 		}
-	SYMBIAN_TRACE_SQLITE_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KFileName, &fname));
+	SQLITE_TRACE_OS(OstTraceExt2(TRACE_INTERNALS, TVFS_ACCESS_ENTRY, "OS-Entry;0;TVfs::Access;fname=%S;aFlags=0x%X", __SQLITEPRNSTR(fname), (TUint)aFlags));
 	TEntry entry;
 	TInt err = TStaticFs::Fs().Entry(fname, entry);
 	if(aFlags == SQLITE_ACCESS_EXISTS && err == KErrNotFound)
 		{
 		*aResOut = 0;
+		SQLITE_TRACE_OS(OstTrace0(TRACE_INTERNALS, TVFS_ACCESS_EXIT1, "OS-Exit;0;TVfs::Access;Exists-NoFound"));
 		return SQLITE_OK;
 		}
 	if(err != KErrNone)
 		{
+		SQLITE_TRACE_OS(OstTrace1(TRACE_INTERNALS, TVFS_ACCESS_EXIT2, "OS-Exit;0;TVfs::Access;err=%d", err));
 		return err == KErrNoMemory ? SQLITE_IOERR_NOMEM : SQLITE_IOERR_ACCESS;
 		}
 	*aResOut = 0;
@@ -1544,6 +1659,7 @@
 		default:
 			break;			
 		}
+	SQLITE_TRACE_OS(OstTrace1(TRACE_INTERNALS, TVFS_ACCESS_EXIT3, "OS-Exit;0;TVfs::Access;aResOut=%d", *aResOut));
 	return SQLITE_OK;
 	}
 
@@ -1575,18 +1691,19 @@
 */
 /* static */ int TVfs::FullPathName(sqlite3_vfs* aVfs, const char* aRelative, int aBufLen, char* aBuf)
 	{
-	SQLUTRACE_PROFILER(aVfs);
 	if(!aRelative)	//NULL argument
 		{
+		SQLITE_TRACE_OS(OstTrace0(TRACE_INTERNALS, TVFS_FULLPATHNAME1, "OS;0;TVfs::FullPathName;err=SQLITE_ERROR"));
 		return SQLITE_ERROR;
 		}
 	//Convert the received file name to UTF16
 	TBuf<KMaxFileName + 1> fname;
 	if(!::ConvertToUnicode(aRelative, fname))
 		{
+		SQLITE_TRACE_OS(OstTrace0(TRACE_INTERNALS, TVFS_FULLPATHNAME_EXIT1, "OS-Exit;0;TVfs::FullPathName;ConvertToUnicode() failed"));
 		return SQLITE_ERROR;
 		}	
-	SYMBIAN_TRACE_SQLITE_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KFileName, &fname));
+	SQLITE_TRACE_OS(OstTraceExt2(TRACE_INTERNALS, TVFS_FULLPATHNAME_ENTRY, "OS-Entry;0;TVfs::FullPathName;fname=%S;aBufLen=%d", __SQLITEPRNSTR(fname), aBufLen));
 	//Search if the file name begins with ".\" - current directory
 	if(fname.Find(KCwd) == 0)
 		{
@@ -1597,6 +1714,7 @@
 	TInt err = TStaticFs::Fs().SessionPath(defaultPath);
 	if(err != KErrNone)
 		{
+		SQLITE_TRACE_OS(OstTrace1(TRACE_INTERNALS, TVFS_FULLPATHNAME_EXIT4, "OS-Exit;0;TVfs::FullPathName;SessionPath() failed, err=%d", err));
 		return SQLITE_ERROR;
 		}
 	TParse parse;
@@ -1604,8 +1722,10 @@
 	TPtr8 dest8(reinterpret_cast <TUint8*> (aBuf), aBufLen);	
 	if(!::ConvertFromUnicode(parse.FullName(), dest8))
 		{
+		SQLITE_TRACE_OS(OstTrace0(TRACE_INTERNALS, TVFS_FULLPATHNAME_EXIT2, "OS-Exit;0;TVfs::FullPathName;ConvertFromUnicode() failed"));
 		return SQLITE_ERROR;	
 		}
+	SQLITE_TRACE_OS(OstTrace0(TRACE_INTERNALS, TVFS_FULLPATHNAME_EXIT3, "OS-Exit;0;TVfs::FullPathName;err=SQLITE_OK"));
 	return SQLITE_OK;
 	}
 
@@ -1621,7 +1741,6 @@
 */
 /* static */ int TVfs::Randomness(sqlite3_vfs* aVfs, int aBufLen, char* aBuf)
 	{
-	SQLUTRACE_PROFILER(aVfs);
 	const TInt KRandIterations = aBufLen / sizeof(int);
 	for(TInt i=0;i<KRandIterations;++i)
 		{
@@ -1642,7 +1761,6 @@
 */
 /* static */ int TVfs::Sleep(sqlite3_vfs* aVfs, int aMicrosec)
 	{
-	SQLUTRACE_PROFILER(aVfs);
 	User::AfterHighRes(TTimeIntervalMicroSeconds32(aMicrosec));
 	return aMicrosec;
 	}
@@ -1660,7 +1778,6 @@
 */
 /* static */ int TVfs::CurrentTime(sqlite3_vfs* aVfs, double* aNow)
 	{
-	SQLUTRACE_PROFILER(aVfs);
 	TTime now;
 	now.UniversalTime();
 	TDateTime date = now.DateTime();
@@ -1700,7 +1817,6 @@
 */
 /* static */int TVfs::GetLastError(sqlite3_vfs* aVfs, int /*aBufLen*/, char* /*aBuf*/)
 	{
-	SQLUTRACE_PROFILER(aVfs);
 	return 0;
 	}
 
--- a/persistentstorage/sqlite3api/TEST/TclScript/all.test	Tue Jul 06 16:18:30 2010 +0300
+++ b/persistentstorage/sqlite3api/TEST/TclScript/all.test	Wed Aug 18 11:30:17 2010 +0300
@@ -1,6 +1,6 @@
 # 2001 September 15
 #
-# Portions Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiaries. All rights reserved.
+# Portions Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiaries. All rights reserved.
 #
 # The author disclaims copyright to this source code.  In place of
 # a legal notice, here is a blessing:
@@ -75,7 +75,7 @@
 lappend EXCLUDE fuzz3.test
 lappend EXCLUDE soak.test              ;# Takes a very long time (default 1 hr)
 lappend EXCLUDE fts3.test              ;# Wrapper for muliple fts3*.tests
-lappend EXCLUDE mallocAll.test         ;# Wrapper for running all malloc tests
+lappend EXCLUDE mallocall.test         ;# Wrapper for running all malloc tests
 lappend EXCLUDE speed1.test			   ;# Symbian OS: Excluding all "speed" tests, the first one is crashing all.test.
 lappend EXCLUDE speed1p.test		   ;# Also, these "speed" tests are not that useful for Symbian OS.
 lappend EXCLUDE speed2.test
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/persistentstorage/sqlite3api/traces_sqlite3/OstTraceDefinitions.h	Wed Aug 18 11:30:17 2010 +0300
@@ -0,0 +1,7 @@
+#ifndef __OSTTRACEDEFINITIONS_H__
+#define __OSTTRACEDEFINITIONS_H__
+// OST_TRACE_COMPILER_IN_USE flag has been added by Trace Compiler
+// REMOVE BEFORE CHECK-IN TO VERSION CONTROL
+//#define OST_TRACE_COMPILER_IN_USE
+#include <opensystemtrace.h>
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/persistentstorage/sqlite3api/traces_sqlite3/fixed_id.definitions	Wed Aug 18 11:30:17 2010 +0300
@@ -0,0 +1,87 @@
+#Fixed group and trace id definitions. If this file is removed, the identifiers are rebuilt.
+[GROUP]TRACE_FATAL=0x81
+[GROUP]TRACE_INTERNALS=0x88
+[TRACE]TRACE_FATAL[0x81]_TSQLUTIL_PANIC=0x1
+[TRACE]TRACE_INTERNALS[0x88]_CRECURSIVEMUTEX_NEWL=0x1a
+[TRACE]TRACE_INTERNALS[0x88]_OS2SQLITEERR=0x15
+[TRACE]TRACE_INTERNALS[0x88]_PLSINITIALIZE1=0x12
+[TRACE]TRACE_INTERNALS[0x88]_PLSINITIALIZE2=0x13
+[TRACE]TRACE_INTERNALS[0x88]_PLSINITIALIZE_ENTRY=0x11
+[TRACE]TRACE_INTERNALS[0x88]_PLSINITIALIZE_EXIT=0x14
+[TRACE]TRACE_INTERNALS[0x88]_RFILEBUF64_CLOSE=0x5
+[TRACE]TRACE_INTERNALS[0x88]_RFILEBUF64_CREATE=0x2
+[TRACE]TRACE_INTERNALS[0x88]_RFILEBUF64_DOFILEFLUSH=0xf
+[TRACE]TRACE_INTERNALS[0x88]_RFILEBUF64_DOFILESIZE=0xd
+[TRACE]TRACE_INTERNALS[0x88]_RFILEBUF64_DOFILEWRITE=0x10
+[TRACE]TRACE_INTERNALS[0x88]_RFILEBUF64_DOSETFILESIZE=0xe
+[TRACE]TRACE_INTERNALS[0x88]_RFILEBUF64_DRIVE=0xc
+[TRACE]TRACE_INTERNALS[0x88]_RFILEBUF64_LOCK=0xa
+[TRACE]TRACE_INTERNALS[0x88]_RFILEBUF64_OPEN=0x3
+[TRACE]TRACE_INTERNALS[0x88]_RFILEBUF64_READ1=0x7
+[TRACE]TRACE_INTERNALS[0x88]_RFILEBUF64_READ2=0x8
+[TRACE]TRACE_INTERNALS[0x88]_RFILEBUF64_READ3=0x9
+[TRACE]TRACE_INTERNALS[0x88]_RFILEBUF64_RFILEBUF64=0x1
+[TRACE]TRACE_INTERNALS[0x88]_RFILEBUF64_SETREADAHEADSIZE=0x6
+[TRACE]TRACE_INTERNALS[0x88]_RFILEBUF64_TEMP=0x4
+[TRACE]TRACE_INTERNALS[0x88]_RFILEBUF64_UNLOCK=0xb
+[TRACE]TRACE_INTERNALS[0x88]_SQLITE3_MUTEX_CREATE=0x19
+[TRACE]TRACE_INTERNALS[0x88]_SQLITE3_MUTEX_SQLITE3_MUTEX=0x17
+[TRACE]TRACE_INTERNALS[0x88]_SQLITE3_MUTEX_SQLITE3_MUTEX2=0x18
+[TRACE]TRACE_INTERNALS[0x88]_SQLITE3_OS_END=0x1e
+[TRACE]TRACE_INTERNALS[0x88]_SQLITE3_OS_INIT=0x1d
+[TRACE]TRACE_INTERNALS[0x88]_TDBFILE_TDBFILE=0x1f
+[TRACE]TRACE_INTERNALS[0x88]_TFILEIO_CHECKRESERVEDLOCK1=0x3b
+[TRACE]TRACE_INTERNALS[0x88]_TFILEIO_CHECKRESERVEDLOCK2=0x3c
+[TRACE]TRACE_INTERNALS[0x88]_TFILEIO_CHECKRESERVEDLOCK3=0x3d
+[TRACE]TRACE_INTERNALS[0x88]_TFILEIO_CLOSE1=0x20
+[TRACE]TRACE_INTERNALS[0x88]_TFILEIO_CLOSE2=0x21
+[TRACE]TRACE_INTERNALS[0x88]_TFILEIO_FILECONTROL=0x3e
+[TRACE]TRACE_INTERNALS[0x88]_TFILEIO_FILESIZE_ENTRY=0x2a
+[TRACE]TRACE_INTERNALS[0x88]_TFILEIO_FILESIZE_EXIT=0x2b
+[TRACE]TRACE_INTERNALS[0x88]_TFILEIO_GETREADLOCK=0x2c
+[TRACE]TRACE_INTERNALS[0x88]_TFILEIO_LOCK1=0x2e
+[TRACE]TRACE_INTERNALS[0x88]_TFILEIO_LOCK2=0x2f
+[TRACE]TRACE_INTERNALS[0x88]_TFILEIO_LOCK3=0x30
+[TRACE]TRACE_INTERNALS[0x88]_TFILEIO_LOCK4=0x31
+[TRACE]TRACE_INTERNALS[0x88]_TFILEIO_LOCK5=0x32
+[TRACE]TRACE_INTERNALS[0x88]_TFILEIO_LOCK6=0x33
+[TRACE]TRACE_INTERNALS[0x88]_TFILEIO_LOCK7=0x34
+[TRACE]TRACE_INTERNALS[0x88]_TFILEIO_READ_ENTRY=0x22
+[TRACE]TRACE_INTERNALS[0x88]_TFILEIO_READ_EXIT=0x23
+[TRACE]TRACE_INTERNALS[0x88]_TFILEIO_SYNC_ENTRY=0x28
+[TRACE]TRACE_INTERNALS[0x88]_TFILEIO_SYNC_EXIT=0x29
+[TRACE]TRACE_INTERNALS[0x88]_TFILEIO_TRUNCATE_ENTRY=0x26
+[TRACE]TRACE_INTERNALS[0x88]_TFILEIO_TRUNCATE_EXIT=0x27
+[TRACE]TRACE_INTERNALS[0x88]_TFILEIO_UNLOCK1=0x35
+[TRACE]TRACE_INTERNALS[0x88]_TFILEIO_UNLOCK2=0x36
+[TRACE]TRACE_INTERNALS[0x88]_TFILEIO_UNLOCK3=0x37
+[TRACE]TRACE_INTERNALS[0x88]_TFILEIO_UNLOCK4=0x38
+[TRACE]TRACE_INTERNALS[0x88]_TFILEIO_UNLOCK5=0x39
+[TRACE]TRACE_INTERNALS[0x88]_TFILEIO_UNLOCK6=0x3a
+[TRACE]TRACE_INTERNALS[0x88]_TFILEIO_UNLOCKREADLOCK=0x2d
+[TRACE]TRACE_INTERNALS[0x88]_TFILEIO_WRITE_ENTRY=0x24
+[TRACE]TRACE_INTERNALS[0x88]_TFILEIO_WRITE_EXIT=0x25
+[TRACE]TRACE_INTERNALS[0x88]_TMUTEXAPI_ALLOC=0x1b
+[TRACE]TRACE_INTERNALS[0x88]_TMUTEXAPI_FREE=0x1c
+[TRACE]TRACE_INTERNALS[0x88]_TSTATICFS_CONNECT=0x16
+[TRACE]TRACE_INTERNALS[0x88]_TVFS_ACCESS1=0x49
+[TRACE]TRACE_INTERNALS[0x88]_TVFS_ACCESS_ENTRY=0x4a
+[TRACE]TRACE_INTERNALS[0x88]_TVFS_ACCESS_EXIT1=0x4b
+[TRACE]TRACE_INTERNALS[0x88]_TVFS_ACCESS_EXIT2=0x4c
+[TRACE]TRACE_INTERNALS[0x88]_TVFS_ACCESS_EXIT3=0x4d
+[TRACE]TRACE_INTERNALS[0x88]_TVFS_DELETE1=0x47
+[TRACE]TRACE_INTERNALS[0x88]_TVFS_DELETE2=0x48
+[TRACE]TRACE_INTERNALS[0x88]_TVFS_DOFILESIZECORRUPTIONCHECK1=0x41
+[TRACE]TRACE_INTERNALS[0x88]_TVFS_DOFILESIZECORRUPTIONCHECK2=0x42
+[TRACE]TRACE_INTERNALS[0x88]_TVFS_DOGETGETDEVICECHARACTERISTICSANDSECTORSIZE=0x40
+[TRACE]TRACE_INTERNALS[0x88]_TVFS_DOGETVOLUMEIOPARAMINFO=0x3f
+[TRACE]TRACE_INTERNALS[0x88]_TVFS_FULLPATHNAME1=0x4e
+[TRACE]TRACE_INTERNALS[0x88]_TVFS_FULLPATHNAME_ENTRY=0x50
+[TRACE]TRACE_INTERNALS[0x88]_TVFS_FULLPATHNAME_EXIT1=0x4f
+[TRACE]TRACE_INTERNALS[0x88]_TVFS_FULLPATHNAME_EXIT2=0x52
+[TRACE]TRACE_INTERNALS[0x88]_TVFS_FULLPATHNAME_EXIT3=0x53
+[TRACE]TRACE_INTERNALS[0x88]_TVFS_FULLPATHNAME_EXIT4=0x51
+[TRACE]TRACE_INTERNALS[0x88]_TVFS_OPEN1=0x43
+[TRACE]TRACE_INTERNALS[0x88]_TVFS_OPEN2=0x45
+[TRACE]TRACE_INTERNALS[0x88]_TVFS_OPEN_ENTRY=0x44
+[TRACE]TRACE_INTERNALS[0x88]_TVFS_OPEN_EXIT=0x46
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/persistentstorage/sqlite3api/traces_sqlite3/trace.properties	Wed Aug 18 11:30:17 2010 +0300
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<trace_properties>
+</trace_properties>
--- a/persistentstorage/store/ROM/StoreTests.IBY	Tue Jul 06 16:18:30 2010 +0300
+++ b/persistentstorage/store/ROM/StoreTests.IBY	Wed Aug 18 11:30:17 2010 +0300
@@ -23,33 +23,33 @@
 #include "pbe.iby"
 
 // batch file that runs all automatic store tests
-data=DATAZ_\test\StoreTests.bat	Test\StoreTests.bat
+data=DATAZ_\test\storetests.bat	test\storetests.bat
 
-file=ABI_DIR\BUILD_DIR\t_storset.exe	Test\t_storset.exe
-file=ABI_DIR\BUILD_DIR\t_storcrypt.exe	Test\t_storcrypt.exe
-file=ABI_DIR\BUILD_DIR\t_storcorrupt.exe	Test\t_storcorrupt.exe
-file=ABI_DIR\BUILD_DIR\t_storfbuf.exe	Test\t_storfbuf.exe
-file=ABI_DIR\BUILD_DIR\t_storfcomp.exe	Test\t_storfcomp.exe
-file=ABI_DIR\BUILD_DIR\t_storfdir.exe	Test\t_storfdir.exe
-file=ABI_DIR\BUILD_DIR\t_storfperm.exe	Test\t_storfperm.exe
-file=ABI_DIR\BUILD_DIR\t_storfrecl.exe	Test\t_storfrecl.exe
-file=ABI_DIR\BUILD_DIR\t_storfserr.exe	Test\t_storfserr.exe
-file=ABI_DIR\BUILD_DIR\t_storfstrm.exe	Test\t_storfstrm.exe
-file=ABI_DIR\BUILD_DIR\t_storoom.exe	Test\t_storoom.exe	
-file=ABI_DIR\BUILD_DIR\t_stormemstrm.exe	Test\t_stormemstrm.exe
-file=ABI_DIR\BUILD_DIR\t_storpage.exe	Test\t_storpage.exe	
-file=ABI_DIR\BUILD_DIR\t_stordelim.exe	Test\t_stordelim.exe
-file=ABI_DIR\BUILD_DIR\t_stordictfs.exe	Test\t_stordictfs.exe
-file=ABI_DIR\BUILD_DIR\t_storembed.exe	Test\t_storembed.exe
-file=ABI_DIR\BUILD_DIR\t_storshape.exe	Test\t_storshape.exe
-file=ABI_DIR\BUILD_DIR\t_stordict.exe	Test\t_stordict.exe
-file=ABI_DIR\BUILD_DIR\t_storstrm.exe	Test\t_storstrm.exe	
-file=ABI_DIR\BUILD_DIR\t_storconv.exe	Test\t_storconv.exe
-file=ABI_DIR\BUILD_DIR\t_storucmp.exe	Test\t_storucmp.exe
-file=ABI_DIR\BUILD_DIR\t_storstreamperf.exe Test\t_storstreamperf.exe
-file=ABI_DIR\BUILD_DIR\t_storiter.exe	Test\t_storiter.exe
-file=ABI_DIR\BUILD_DIR\t_stortoc.exe	Test\t_stortoc.exe
-file=ABI_DIR\BUILD_DIR\t_storverify.exe	Test\t_storverify.exe
-file=ABI_DIR\BUILD_DIR\t_storbench.exe	Test\T_storbench.exe
+file=ABI_DIR\BUILD_DIR\t_storset.exe        test\t_storset.exe
+file=ABI_DIR\BUILD_DIR\t_storcrypt.exe      test\t_storcrypt.exe
+file=ABI_DIR\BUILD_DIR\t_storcorrupt.exe    test\t_storcorrupt.exe
+file=ABI_DIR\BUILD_DIR\t_storfbuf.exe       test\t_storfbuf.exe
+file=ABI_DIR\BUILD_DIR\t_storfcomp.exe      test\t_storfcomp.exe
+file=ABI_DIR\BUILD_DIR\t_storfdir.exe       test\t_storfdir.exe
+file=ABI_DIR\BUILD_DIR\t_storfperm.exe      test\t_storfperm.exe
+file=ABI_DIR\BUILD_DIR\t_storfrecl.exe      test\t_storfrecl.exe
+file=ABI_DIR\BUILD_DIR\t_storfserr.exe      test\t_storfserr.exe
+file=ABI_DIR\BUILD_DIR\t_storfstrm.exe      test\t_storfstrm.exe
+file=ABI_DIR\BUILD_DIR\t_storoom.exe        test\t_storoom.exe	
+file=ABI_DIR\BUILD_DIR\t_stormemstrm.exe    test\t_stormemstrm.exe
+file=ABI_DIR\BUILD_DIR\t_storpage.exe       test\t_storpage.exe	
+file=ABI_DIR\BUILD_DIR\t_stordelim.exe      test\t_stordelim.exe
+file=ABI_DIR\BUILD_DIR\t_stordictfs.exe     test\t_stordictfs.exe
+file=ABI_DIR\BUILD_DIR\t_storembed.exe      test\t_storembed.exe
+file=ABI_DIR\BUILD_DIR\t_storshape.exe      test\t_storshape.exe
+file=ABI_DIR\BUILD_DIR\t_stordict.exe       test\t_stordict.exe
+file=ABI_DIR\BUILD_DIR\t_storstrm.exe       test\t_storstrm.exe	
+file=ABI_DIR\BUILD_DIR\t_storconv.exe       test\t_storconv.exe
+file=ABI_DIR\BUILD_DIR\t_storucmp.exe       test\t_storucmp.exe
+file=ABI_DIR\BUILD_DIR\t_storstreamperf.exe test\t_storstreamperf.exe
+file=ABI_DIR\BUILD_DIR\t_storiter.exe       test\t_storiter.exe
+file=ABI_DIR\BUILD_DIR\t_stortoc.exe        test\t_stortoc.exe
+file=ABI_DIR\BUILD_DIR\t_storverify.exe     test\t_storverify.exe
+file=ABI_DIR\BUILD_DIR\t_storbench.exe      test\t_storbench.exe
 #endif