SQLite

Check-in [3966b33284]
Login

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

Overview
Comment:Get the mptest program running on windows.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | mptest
Files: files | file ages | folders
SHA1: 3966b33284355325afda627ed6f4e26f967438f8
User & Date: drh 2013-04-06 14:04:22.154
Context
2013-04-06
14:16
Get the build of mptest working on mac. (check-in: a0bae686c9 user: drh tags: mptest)
14:04
Get the mptest program running on windows. (check-in: 3966b33284 user: drh tags: mptest)
13:09
Many improvements to the mptest program. Added a simple test script. (check-in: 07b0401a9b user: drh tags: mptest)
Changes
Unified Diff Ignore Whitespace Patch
Changes to mptest/mptest.c.
18
19
20
21
22
23
24

25
26
27
28
29
30
31
**
**    gcc -g -c -Wall sqlite3.c $(OPTS)
**    gcc -g -o mptest mptest.c sqlite3.o $(LIBS)
**
** Recommended options:
**
**    -DHAVE_USLEEP

**    -DSQLITE_NO_SYNC
**    -DSQLITE_THREADSAFE=0
**    -DSQLITE_OMIT_LOAD_EXTENSION
**
** Run like this:
**
**     ./mptest $database $script







>







18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
**
**    gcc -g -c -Wall sqlite3.c $(OPTS)
**    gcc -g -o mptest mptest.c sqlite3.o $(LIBS)
**
** Recommended options:
**
**    -DHAVE_USLEEP
**    -DSQLITE_MAX_SCHEMA_RETRY=100
**    -DSQLITE_NO_SYNC
**    -DSQLITE_THREADSAFE=0
**    -DSQLITE_OMIT_LOAD_EXTENSION
**
** Run like this:
**
**     ./mptest $database $script
538
539
540
541
542
543
544

545
546
547
548
549
550
551
552





















553
554
555
556
557
558
559
** Start up a client process for iClient, if it is not already
** running.  If the client is already running, then this routine
** 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;
    zSys = sqlite3_mprintf(
                 "%s \"%s\" --client %d --trace %d %s&",
                 g.argv0, g.zDbFile, iClient, g.iTrace,
                 g.bSqlTrace ? "--sqltrace " : "");

    system(zSys);
    sqlite3_free(zSys);





















  }
}

/*
** Read the entire content of a file into memory
*/
static char *readFile(const char *zFilename){







>





<


>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







539
540
541
542
543
544
545
546
547
548
549
550
551

552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
** Start up a client process for iClient, if it is not already
** running.  If the client is already running, then this routine
** is a no-op.
*/
static void startClient(int iClient){
  runSql("INSERT OR IGNORE INTO client VALUES(%d,0)", iClient);
  if( sqlite3_changes(g.db) ){
#if defined(__unix__)
    char *zSys;
    zSys = sqlite3_mprintf(
                 "%s \"%s\" --client %d --trace %d %s&",
                 g.argv0, g.zDbFile, iClient, g.iTrace,
                 g.bSqlTrace ? "--sqltrace " : "");

    system(zSys);
    sqlite3_free(zSys);
#endif
#if defined(_WIN32)
    char *argv[10];
    char zClient[20];
    char zTrace[20];
    argv[0] = g.argv0;
    argv[1] = g.zDbFile;
    argv[2] = "--client";
    sqlite3_snprintf(sizeof(zClient),zClient,"%d",iClient);
    argv[3] = zClient;
    argv[4] = "--trace";
    sqlite3_snprintf(sizeof(zTrace),zTrace,"%d",g.iTrace);
    argv[5] = zTrace;
    if( g.bSqlTrace ){
      argv[6] = "--sqltrace";
      argv[7] = 0;
    }else{
      argv[6] = 0;
    }
    _spawnv(_P_NOWAIT, g.argv0, argv);
#endif
  }
}

/*
** Read the entire content of a file into memory
*/
static char *readFile(const char *zFilename){