]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
The sqlite_trace() API only works for commands started by the user, not for
authordrh <drh@noemail.net>
Wed, 17 Mar 2004 18:44:45 +0000 (18:44 +0000)
committerdrh <drh@noemail.net>
Wed, 17 Mar 2004 18:44:45 +0000 (18:44 +0000)
SQL commands run during initialization. (CVS 1298)

FossilOrigin-Name: 0a12473c4ae370ec34f1f431dd6d7d6ffa25d41a

manifest
manifest.uuid
src/encode.c
src/main.c

index 3cf4d8b71b801875cd8a8eba14e632bcba8cd132..ddd89a768f1adb5c3ae8902334de94644e1ebb30 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Makefile.in\sand\ssqlite.def\schanges\sfor\sencode\sand\snon-toplevel\sbuild;\sticket\s#667\s(CVS\s1297)
-D 2004-03-16T21:49:50
+C The\ssqlite_trace()\sAPI\sonly\sworks\sfor\scommands\sstarted\sby\sthe\suser,\snot\sfor\nSQL\scommands\srun\sduring\sinitialization.\s(CVS\s1298)
+D 2004-03-17T18:44:46
 F Makefile.in 5d50a7d2a6a641e90a0312fc30d4e9c96b3903da
 F Makefile.linux-gcc b86a99c493a5bfb402d1d9178dcdc4bd4b32f906
 F README f1de682fbbd94899d50aca13d387d1b3fd3be2dd
@@ -30,13 +30,13 @@ F src/build.c c8ab8b467d9a64254b0d4d42083f6313b3a980d1
 F src/copy.c 750e13828c3e4a293123e36aaa7cf0f22466248a
 F src/date.c f055419d602bde622c70f831350b6b52f2235de0
 F src/delete.c 82001c74882319f94dab5f6b92a27311b31092ae
-F src/encode.c e6518a1e3326a07539a88d2082cbaa3389cdf6e0
+F src/encode.c fc8c51f0b61bc803ccdec092e130bebe762b0a2f
 F src/expr.c 95ea5d47d11b5085aaeeb77d60b17c2cba13383a
 F src/func.c 34fead7a33e82095f6412d3fafd379d47864b3be
 F src/hash.c 9b56ef3b291e25168f630d5643a4264ec011c70e
 F src/hash.h 3247573ab95b9dd90bcca0307a75d9a16da1ccc7
 F src/insert.c c0485ee2d1b99322894e2d1e0b576fd05ed75616
-F src/main.c 8e1b406d661c6475cc27d4b2b9422d1d2ab94cf7
+F src/main.c 89a18cfb2a6a832a03fff10b2515da4bbe8f83ef
 F src/md5.c fe4f9c9c6f71dfc26af8da63e4d04489b1430565
 F src/os.c 5f11382733805d4529ec2a30800e117f30995ea8
 F src/os.h 250a3789be609adfee5c5aa20137ce8683276f24
@@ -188,7 +188,7 @@ F www/sqlite.tcl 3c83b08cf9f18aa2d69453ff441a36c40e431604
 F www/tclsqlite.tcl b9271d44dcf147a93c98f8ecf28c927307abd6da
 F www/vdbe.tcl 9b9095d4495f37697fd1935d10e14c6015e80aa1
 F www/whentouse.tcl a8335bce47cc2fddb07f19052cb0cb4d9129a8e4
-P 359f0e787ff2d4d10fd23059e2ce99670e93f66a
-R 844f798d0d4db4bb8c51bd95cdec6c47
-U dougcurrie
-Z e289d5957606d6a682af1d12195f27e6
+P 72205a371ce5be4eac0a77d5d2fa8ccb23bb988f
+R 99d9abce4fbd17d2074c2e743660ebc3
+U drh
+Z 0b52db8f82add9da6aef2ec7c65ba20e
index 7698ebb4a6f36017b845bef2b3198755ebaacfc5..d2944b794ecd03145c6f754fd6b35e90fcff23dc 100644 (file)
@@ -1 +1 @@
-72205a371ce5be4eac0a77d5d2fa8ccb23bb988f
\ No newline at end of file
+0a12473c4ae370ec34f1f431dd6d7d6ffa25d41a
\ No newline at end of file
index 712619c4c7dc4b188bce9225ef45bf9b91f3419c..01b4876fcb53f3118f8767e2c32227540acd517e 100644 (file)
@@ -15,7 +15,7 @@
 ** data in an SQLite database.  The code in this file is not used by any other
 ** part of the SQLite library.
 **
-** $Id: encode.c,v 1.11 2004/03/14 22:12:00 drh Exp $
+** $Id: encode.c,v 1.12 2004/03/17 18:44:46 drh Exp $
 */
 #include <string.h>
 #include <assert.h>
@@ -27,7 +27,7 @@
 ** 0x00.  This is accomplished by using an escape character to encode
 ** 0x27 and 0x00 as a two-byte sequence.  The escape character is always
 ** 0x01.  An 0x00 is encoded as the two byte sequence 0x01 0x01.  The
-** 0x27 character is encoded as the two byte sequence 0x01 0x03.  Finally,
+** 0x27 character is encoded as the two byte sequence 0x01 0x28.  Finally,
 ** the escape character itself is encoded as the two-character sequence
 ** 0x01 0x02.
 **
@@ -35,7 +35,7 @@
 **
 **       0x00  ->  0x01 0x01
 **       0x01  ->  0x01 0x02
-**       0x27  ->  0x01 0x03
+**       0x27  ->  0x01 0x28
 **
 ** If that were all the encoder did, it would work, but in certain cases
 ** it could double the size of the encoded string.  For example, to
@@ -81,7 +81,7 @@
 **           the offset in step 7 below.
 **
 **     (6)   Convert each 0x01 0x01 sequence into a single character 0x00.
-**           Convert 0x01 0x02 into 0x01.  Convert 0x01 0x03 into 0x27.
+**           Convert 0x01 0x02 into 0x01.  Convert 0x01 0x28 into 0x27.
 **
 **     (7)   Subtract the offset value that was the first character of
 **           the encoded buffer from all characters in the output buffer.
 */
 int sqlite_encode_binary(const unsigned char *in, int n, unsigned char *out){
   int i, j, e, m;
+  unsigned char x;
   int cnt[256];
   if( n<=0 ){
     if( out ){
@@ -149,16 +150,12 @@ int sqlite_encode_binary(const unsigned char *in, int n, unsigned char *out){
   out[0] = e;
   j = 1;
   for(i=0; i<n; i++){
-    int c = (in[i] - e)&0xff;
-    if( c==0 || c==1 ){
+    x = in[i] - e;
+    if( x==0 || x==1 || x=='\''){
       out[j++] = 1;
-      out[j++] = c+1;
-    }else if( c=='\'' ){
-      out[j++] = 1;
-      out[j++] = 3;
-    }else{
-      out[j++] = c;
+      x++;
     }
+    out[j++] = x;
   }
   out[j] = 0;
   assert( j==n+m+1 );
@@ -176,21 +173,15 @@ int sqlite_encode_binary(const unsigned char *in, int n, unsigned char *out){
 ** to decode a string in place.
 */
 int sqlite_decode_binary(const unsigned char *in, unsigned char *out){
-  int i, c, e;
+  int i, e;
+  unsigned char c;
   e = *(in++);
   i = 0;
   while( (c = *(in++))!=0 ){
     if( c==1 ){
-      c = *(in++);
-      if( c==1 || c==2 ){
-        c--;
-      }else if( c==3 ){
-        c = '\'';
-      }else{
-        return -1;
-      }
+      c = *(in++) - 1;
     }
-    out[i++] = (c + e)&0xff;
+    out[i++] = c + e;
   }
   return i;
 }
index 6fa014104a1886671bbb4f79859d4fe94af8467d..bf8b666735fe7aad29c8a6668a5e06c39278fdc0 100644 (file)
@@ -14,7 +14,7 @@
 ** other files are for internal use by SQLite and should not be
 ** accessed by users of the library.
 **
-** $Id: main.c,v 1.162 2004/03/04 19:09:20 rdc Exp $
+** $Id: main.c,v 1.163 2004/03/17 18:44:47 drh Exp $
 */
 #include "sqliteInt.h"
 #include "os.h"
@@ -719,7 +719,7 @@ int sqlite_compile(
   memset(&sParse, 0, sizeof(sParse));
   sParse.db = db;
   sqliteRunParser(&sParse, zSql, pzErrMsg);
-  if( db->xTrace ){
+  if( db->xTrace && !db->init.busy ){
     /* Trace only the statment that was compiled.
     ** Make a copy of that part of the SQL string since zSQL is const
     ** and we must pass a zero terminated string to the trace function