More work toward getting sqlite3_interrupt() to work from separate
threads.  Ticket #1897. (CVS 3336)

FossilOrigin-Name: e431131d47481f9fc64c498e8934b10a96b0a931
diff --git a/src/vdbeapi.c b/src/vdbeapi.c
index 3b0a6ad..a57cff3 100644
--- a/src/vdbeapi.c
+++ b/src/vdbeapi.c
@@ -180,6 +180,14 @@
     return SQLITE_MISUSE;
   }
   if( p->pc<0 ){
+    /* If there are no other statements currently running, then
+    ** reset the interrupt flag.  This prevents a call to sqlite3_interrupt
+    ** from interrupting a statement that has not yet started.
+    */
+    if( db->activeVdbeCnt==0 ){
+      db->u1.isInterrupted = 0;
+    }
+
 #ifndef SQLITE_OMIT_TRACE
     /* Invoke the trace callback if there is one
     */