SQLite

Check-in [55718ae346]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:In mptester: improve the way that child processes are dispatched. Pass the --vfs option through to children. Log the command used to start child processes when the tracing level is high enough.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 55718ae3462b2b6e0774d49e1c4c74143bc9e3a5
User & Date: drh 2013-04-12 01:04:36.558
Context
2013-04-12
16:47
Change the fts4aux virtual table module so that fts4aux tables created in the temp database may report on fts3/fts4 tables in any attached database. (check-in: 546a187f13 user: dan tags: trunk)
01:04
In mptester: improve the way that child processes are dispatched. Pass the --vfs option through to children. Log the command used to start child processes when the tracing level is high enough. (check-in: 55718ae346 user: drh tags: trunk)
2013-04-11
21:13
For the multi-process tester on Win32, make use of the GetCurrentProcessId API. (check-in: f1b524b9d9 user: mistachkin tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to mptest/mptest.c.
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <ctype.h>

/* The suffix to append to the child command lines, if any */
#if defined(_WIN32)
# define CMDLINE_SUFFIX ""
# define GETPID (int)GetCurrentProcessId
#else
# define CMDLINE_SUFFIX "&"
# define GETPID getpid
#endif

/* Mark a parameter as unused to suppress compiler warnings */
#define UNUSED_PARAMETER(x)  (void)x

/* Global data







<


<







44
45
46
47
48
49
50

51
52

53
54
55
56
57
58
59
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <ctype.h>

/* The suffix to append to the child command lines, if any */
#if defined(_WIN32)

# define GETPID (int)GetCurrentProcessId
#else

# define GETPID getpid
#endif

/* Mark a parameter as unused to suppress compiler warnings */
#define UNUSED_PARAMETER(x)  (void)x

/* Global data
625
626
627
628
629
630
631
632
633
634
635


636
637


638



639

640
641
642
643
644
645
646
** is a no-op.
*/
static void startClient(int iClient){
  runSql("INSERT OR IGNORE INTO client VALUES(%d,0)", iClient);
  if( sqlite3_changes(g.db) ){
    char *zSys;
    int rc;
    zSys = sqlite3_mprintf(
                 "%s \"%s\" --client %d --trace %d %s%s%s",
                 g.argv0, g.zDbFile, iClient, g.iTrace,
                 g.bSqlTrace ? "--sqltrace " : "",


                 g.bSync ? "--sync " : "",
                 CMDLINE_SUFFIX


    );



#if !defined(_WIN32)

    rc = system(zSys);
    if( rc ) errorMessage("system() fails with error code %d", rc);
#else
    {
      STARTUPINFOA startupInfo;
      PROCESS_INFORMATION processInfo;
      memset(&startupInfo, 0, sizeof(startupInfo));







|
<
|
|
>
>
|
<
>
>
|
>
>
>

>







623
624
625
626
627
628
629
630

631
632
633
634
635

636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
** is a no-op.
*/
static void startClient(int iClient){
  runSql("INSERT OR IGNORE INTO client VALUES(%d,0)", iClient);
  if( sqlite3_changes(g.db) ){
    char *zSys;
    int rc;
    zSys = sqlite3_mprintf("%s \"%s\" --client %d --trace %d",

                 g.argv0, g.zDbFile, iClient, g.iTrace);
    if( g.bSqlTrace ){
      zSys = sqlite3_mprintf("%z --sqltrace", zSys);
    }
    if( g.bSync ){

      zSys = sqlite3_mprintf("%z --sync", zSys);
    }
    if( g.zVfs ){
      zSys = sqlite3_mprintf("%z --vfs \"%s\"", zSys, g.zVfs);
    }
    if( g.iTrace>=2 ) logMessage("system('%q')", zSys);
#if !defined(_WIN32)
    zSys = sqlite3_mprintf("%z &", zSys);
    rc = system(zSys);
    if( rc ) errorMessage("system() fails with error code %d", rc);
#else
    {
      STARTUPINFOA startupInfo;
      PROCESS_INFORMATION processInfo;
      memset(&startupInfo, 0, sizeof(startupInfo));