]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Add the --breakpoint and --show-sql-errors commands to mptester.
authordrh <drh@noemail.net>
Thu, 18 Apr 2013 15:11:03 +0000 (15:11 +0000)
committerdrh <drh@noemail.net>
Thu, 18 Apr 2013 15:11:03 +0000 (15:11 +0000)
FossilOrigin-Name: d0898fd76a54512894418e53ba28703e250c9ed3

manifest
manifest.uuid
mptest/mptest.c

index a10eb457210c2a021bfebc21d1c04522f702482f..519938b65f20a1129df95e9cda24ca4dc5b6e18f 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Fix\sa\scompiler\swarning\sin\ssqlite3_compileoption_used().
-D 2013-04-18T03:10:43.014
+C Add\sthe\s--breakpoint\sand\s--show-sql-errors\scommands\sto\smptester.
+D 2013-04-18T15:11:03.053
 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
 F Makefile.in 3dd3fcb87b70c78d99b2c8a03e44ec86d6ca9ce2
 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
@@ -114,7 +114,7 @@ F mptest/config01.test 3c6adcbc50b991866855f1977ff172eb6d901271
 F mptest/config02.test 4415dfe36c48785f751e16e32c20b077c28ae504
 F mptest/crash01.test a5f31998ed48de8267d6620e8af107ec148e5f12
 F mptest/crash02.subtest f4ef05adcd15d60e5d2bd654204f2c008b519df8
-F mptest/mptest.c 23365b9f65f220f1206caed7bcee651538a31559
+F mptest/mptest.c ce0d99750a9c01624f29b8942241592e94a7d0d1
 F mptest/multiwrite01.test 81fbc17657964889b60750bd7bbb1deffe8f4d42
 F spec.template 86a4a43b99ebb3e75e6b9a735d5fd293a24e90ca
 F sqlite.pc.in 42b7bf0d02e08b9e77734a47798d1a55a9e0716b
@@ -1051,7 +1051,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 61b2a7be3b9c04bf45bffa93a7d3a480fc5c947a
-R 6659de1ffecbe8f368709b1c4cb6dc19
+P e9f9d84b223b69d36688cd7a4c7c696bfda8a1ad
+R fd7f4162984b752563533589ad89bff8
 U drh
-Z 0f74e436c879f4a5d6bdb52557a8b2af
+Z e0f5854023cf43fccbc89e940a13a42c
index 26f13d75e54cb8da500f560886ff936d4c053eb1..530384dc8c75ce267edd0517a91d67303cd05042 100644 (file)
@@ -1 +1 @@
-e9f9d84b223b69d36688cd7a4c7c696bfda8a1ad
\ No newline at end of file
+d0898fd76a54512894418e53ba28703e250c9ed3
\ No newline at end of file
index cb6dd55d913a1b8c84b765c8e3e207ed653b7ba4..ac3d40820441a00dc0c853e98d9bf39b27642fed 100644 (file)
@@ -71,6 +71,7 @@ static struct Global {
   int taskId;            /* Task ID.  0 means supervisor. */
   int iTrace;            /* Tracing level */
   int bSqlTrace;         /* True to trace SQL commands */
+  int bIgnoreSqlErrors;  /* Ignore errors in SQL statements */
   int nError;            /* Number of errors */
   int nTest;             /* Number of --match operators */
   int iTimeout;          /* Milliseconds until a busy timeout */
@@ -329,6 +330,7 @@ static void sqlTraceCallback(void *NotUsed1, const char *zSql){
 */
 static void sqlErrorCallback(void *pArg, int iErrCode, const char *zMsg){
   UNUSED_PARAMETER(pArg);
+  if( iErrCode==SQLITE_ERROR && g.bIgnoreSqlErrors ) return;
   if( (iErrCode&0xff)==SQLITE_SCHEMA && g.iTrace<3 ) return;
   if( g.iTimeout==0 && (iErrCode&0xff)==SQLITE_BUSY && g.iTrace<3 ) return;
   if( (iErrCode&0xff)==SQLITE_NOTICE ){
@@ -826,6 +828,30 @@ static char *filenameTail(char *z){
   return z+j;
 }
 
+/*
+** Interpret zArg as a boolean value.  Return either 0 or 1.
+*/
+static int booleanValue(char *zArg){
+  int i;
+  if( zArg==0 ) return 0;
+  for(i=0; zArg[i]>='0' && zArg[i]<='9'; i++){}
+  if( i>0 && zArg[i]==0 ) return atoi(zArg);
+  if( sqlite3_stricmp(zArg, "on")==0 || sqlite3_stricmp(zArg,"yes")==0 ){
+    return 1;
+  }
+  if( sqlite3_stricmp(zArg, "off")==0 || sqlite3_stricmp(zArg,"no")==0 ){
+    return 0;
+  }
+  errorMessage("unknown boolean: [%s]", zArg);
+  return 0;
+}
+
+
+/* This routine exists as a convenient place to set a debugger
+** breakpoint.
+*/
+static void test_breakpoint(void){ static volatile int cnt = 0; cnt++; }
+
 /* Maximum number of arguments to a --command */
 #define MX_ARG 2
 
@@ -1119,6 +1145,26 @@ static void runScript(
       iBegin = ii+len;
     }else
 
+    /*
+    **  --breakpoint
+    **
+    ** This command calls "test_breakpoint()" which is a routine provided
+    ** as a convenient place to set a debugger breakpoint.
+    */
+    if( strcmp(zCmd, "breakpoint")==0 ){
+      test_breakpoint();
+    }else
+
+    /*
+    **  --show-sql-errors BOOLEAN
+    **
+    ** Turn display of SQL errors on and off.
+    */
+    if( strcmp(zCmd, "show-sql-errors")==0 ){
+      g.bIgnoreSqlErrors = nArg>=1 ? !booleanValue(azArg[0]) : 1;
+    }else
+
+
     /* error */{
       errorMessage("line %d of %s: unknown command --%s",
                    prevLine, zFilename, zCmd);