]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Show the process-id on log messages from mptester.
authordrh <drh@noemail.net>
Thu, 11 Apr 2013 11:53:45 +0000 (11:53 +0000)
committerdrh <drh@noemail.net>
Thu, 11 Apr 2013 11:53:45 +0000 (11:53 +0000)
FossilOrigin-Name: 6748a83dc5c02db37ecd963e678c5c69db142cac

manifest
manifest.uuid
mptest/mptest.c

index 672a0594059149715b28e3b87bb744ae18b2340c..8a66fe58aa69ebca65aa94dfe0dbde908a54a033 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Have\sthe\sUNIX\sVFS\sissue\swarnings\svia\ssqlite3_log()\sif\sa\sdatabase\sfile\sis\nrenamed\sor\sunlinked\sor\slinked\sto\smore\sthan\sone\sname\swhile\sthe\sfile\sis\sopen.
-D 2013-04-11T01:16:15.249
+C Show\sthe\sprocess-id\son\slog\smessages\sfrom\smptester.
+D 2013-04-11T11:53:45.288
 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
 F Makefile.in 3dd3fcb87b70c78d99b2c8a03e44ec86d6ca9ce2
 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
@@ -114,7 +114,7 @@ F mptest/config01.test 3f4ddeb152a4f83872f0fa7fcb48d9fd609893da
 F mptest/config02.test 962913ed2b537d60de4126db7fe54716865cdd22
 F mptest/crash01.test a5f31998ed48de8267d6620e8af107ec148e5f12
 F mptest/crash02.subtest f4ef05adcd15d60e5d2bd654204f2c008b519df8
-F mptest/mptest.c 8b6d7878addccbb9a1b28d9dbf2b0b516a3279f1
+F mptest/mptest.c 1a8ca3d21e285d38f3ee06d708e634dda3f05bed
 F mptest/multiwrite01.test 81fbc17657964889b60750bd7bbb1deffe8f4d42
 F spec.template 86a4a43b99ebb3e75e6b9a735d5fd293a24e90ca
 F sqlite.pc.in 42b7bf0d02e08b9e77734a47798d1a55a9e0716b
@@ -1050,7 +1050,7 @@ F tool/vdbe-compress.tcl f12c884766bd14277f4fcedcae07078011717381
 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
 F tool/warnings.sh fbc018d67fd7395f440c28f33ef0f94420226381
 F tool/win/sqlite.vsix 97894c2790eda7b5bce3cc79cb2a8ec2fde9b3ac
-P 0fdc743583c67a3a017b9ad812c62a5104b9aee7
-R 6358d94b9e9fcf447041dc89384ceff9
+P e238dcf9189c029fbdcf89339e21d9cdd8fbf2c5
+R 961d2f18ca03b287ca1083092d6feb69
 U drh
-Z 7f7d7e8aee1747123050111170b5d1bc
+Z d718ebcef0d40f58f76fbe3a2824e294
index 784964e39bf16e2fafc0b203b54a846a60b76db1..68dd000d58367caa4fd4bfe493503c70b0397f98 100644 (file)
@@ -1 +1 @@
-e238dcf9189c029fbdcf89339e21d9cdd8fbf2c5
\ No newline at end of file
+6748a83dc5c02db37ecd963e678c5c69db142cac
\ No newline at end of file
index 0a8a8cedbdc66afbfb9eaa12c3136fd22c022ce7..210ac6fa7b40d32adf133723b29cc1ec85891072 100644 (file)
 #if defined(_WIN32)
 # define WIN32_LEAN_AND_MEAN
 # include <windows.h>
+# include <process.h>
+# define GETPID _getpid
 #else
 # include <unistd.h>
+# define GETPID getpid
 #endif
 #include <stdlib.h>
 #include <string.h>
@@ -67,7 +70,7 @@ static struct Global {
   FILE *pErrLog;         /* Where to write errors */
   char *zLog;            /* Name of output log file */
   FILE *pLog;            /* Where to write log messages */
-  char zName[12];        /* Symbolic name of this process */
+  char zName[32];        /* Symbolic name of this process */
   int taskId;            /* Task ID.  0 means supervisor. */
   int iTrace;            /* Tracing level */
   int bSqlTrace;         /* True to trace SQL commands */
@@ -331,7 +334,7 @@ static void sqlErrorCallback(void *pArg, int iErrCode, const char *zMsg){
   UNUSED_PARAMETER(pArg);
   if( (iErrCode&0xff)==SQLITE_SCHEMA && g.iTrace<3 ) return;
   if( g.iTimeout==0 && (iErrCode&0xff)==SQLITE_BUSY && g.iTrace<3 ) return;
-  if( iErrCode==SQLITE_OK ){
+  if( (iErrCode&0xff)==SQLITE_NOTICE ){
     logMessage("(info) %s", zMsg);
   }else{
     errorMessage("(errcode=%d) %s", iErrCode, zMsg);
@@ -1189,7 +1192,7 @@ int main(int argc, char **argv){
     exit(1);
   }
   n = argc-2;
-  sqlite3_snprintf(sizeof(g.zName), g.zName, "mptest");
+  sqlite3_snprintf(sizeof(g.zName), g.zName, "%05d.mptest", GETPID());
   g.zVfs = findOption(argv+2, &n, "vfs", 1);
   zClient = findOption(argv+2, &n, "client", 1);
   g.zErrLog = findOption(argv+2, &n, "errlog", 1);
@@ -1209,11 +1212,13 @@ int main(int argc, char **argv){
   }else{
     g.pLog = stdout;
   }
+  
   sqlite3_config(SQLITE_CONFIG_LOG, sqlErrorCallback, 0);
   if( zClient ){
     iClient = atoi(zClient);
     if( iClient<1 ) fatalError("illegal client number: %d\n", iClient);
-    sqlite3_snprintf(sizeof(g.zName), g.zName, "client%02d", iClient);
+    sqlite3_snprintf(sizeof(g.zName), g.zName, "%05d.client%02d",
+                     GETPID(), iClient);
   }else{
     if( g.iTrace>0 ){
       printf("With SQLite " SQLITE_VERSION " " SQLITE_SOURCE_ID "\n" );