From: drh Date: Thu, 11 Apr 2013 11:53:45 +0000 (+0000) Subject: Show the process-id on log messages from mptester. X-Git-Tag: version-3.7.17~88 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e3be8c86277b72d8ce281d347792c543f5084544;p=thirdparty%2Fsqlite.git Show the process-id on log messages from mptester. FossilOrigin-Name: 6748a83dc5c02db37ecd963e678c5c69db142cac --- diff --git a/manifest b/manifest index 672a059405..8a66fe58aa 100644 --- 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 diff --git a/manifest.uuid b/manifest.uuid index 784964e39b..68dd000d58 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -e238dcf9189c029fbdcf89339e21d9cdd8fbf2c5 \ No newline at end of file +6748a83dc5c02db37ecd963e678c5c69db142cac \ No newline at end of file diff --git a/mptest/mptest.c b/mptest/mptest.c index 0a8a8cedbd..210ac6fa7b 100644 --- a/mptest/mptest.c +++ b/mptest/mptest.c @@ -38,8 +38,11 @@ #if defined(_WIN32) # define WIN32_LEAN_AND_MEAN # include +# include +# define GETPID _getpid #else # include +# define GETPID getpid #endif #include #include @@ -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" );