/ Check-in [716c25bd]
Login

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

Overview
Comment:Add SQLITE_CONFIG_LOG error logging to the mptest program.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | mptest
Files: files | file ages | folders
SHA1:716c25bd125c8934499c1fb59a60d7e844c0691c
User & Date: drh 2013-04-06 14:30:29
Context
2013-04-06
18:10
Merge trunk changes into the mptest branch. The mptest needs the SQLITE_MAX_SCHEMA_RETRY fix in particular. check-in: fb7a7773 user: drh tags: mptest
14:30
Add SQLITE_CONFIG_LOG error logging to the mptest program. check-in: 716c25bd user: drh tags: mptest
14:16
Get the build of mptest working on mac. check-in: a0bae686 user: drh tags: mptest
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to mptest/mptest.c.

284
285
286
287
288
289
290








291
292
293
294
295
296
297
....
1006
1007
1008
1009
1010
1011
1012

1013
1014
1015
1016
1017
1018
1019

/*
** SQL Trace callback
*/
static void sqlTraceCallback(void *NotUsed1, const char *zSql){
  logMessage("[%.*s]", clipLength(zSql), zSql);
}









/*
** Prepare an SQL statement.  Issue a fatal error if unable.
*/
static sqlite3_stmt *prepareSql(const char *zFormat, ...){
  va_list ap;
  char *zSql;
................................................................................
    g.pErrLog = stderr;
  }
  if( g.zLog ){
    g.pLog = fopen(g.zLog, "a");
  }else{
    g.pLog = stdout;
  }

  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);
  }else{
    iClient =  0;
    unlink(g.zDbFile);







>
>
>
>
>
>
>
>







 







>







284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
....
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028

/*
** SQL Trace callback
*/
static void sqlTraceCallback(void *NotUsed1, const char *zSql){
  logMessage("[%.*s]", clipLength(zSql), zSql);
}

/*
** SQL error log callback
*/
static void sqlErrorCallback(void *pArg, int iErrCode, const char *zMsg){
  if( (iErrCode&0xff)==SQLITE_SCHEMA && g.iTrace<3 ) return;
  errorMessage("(errcode=%d) %s", iErrCode, zMsg);
}

/*
** Prepare an SQL statement.  Issue a fatal error if unable.
*/
static sqlite3_stmt *prepareSql(const char *zFormat, ...){
  va_list ap;
  char *zSql;
................................................................................
    g.pErrLog = stderr;
  }
  if( g.zLog ){
    g.pLog = fopen(g.zLog, "a");
  }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);
  }else{
    iClient =  0;
    unlink(g.zDbFile);