monotone-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Monotone-devel] Linking monotone with Debian's official sqlite shared l


From: Tomas Fasth
Subject: [Monotone-devel] Linking monotone with Debian's official sqlite shared library
Date: Mon, 25 Jul 2005 02:35:04 +0200
User-agent: Mozilla Thunderbird 1.0.6 (Windows/20050716)

Hello

I maintain the monotone package in Debian. Monotone is using sqlite
for data storage. It is currently _not_ linked with the sqlite
shared library provided in Debian but instead linked with it's own
copy of sqlite. This is not a good thing from the package
maintainance and security point of view.

The source for the latest release of monotone (version 0.21) contain
sqlite source files from sqlite version 3.2.2 with the addition of a
couple of local changes made by the monotone developers. See the
attached diff for details.

My question to Andreas Rottmann is; Since sqlite version 3.2.2 is
not yet uploaded to the Debian unstable archive, is it possible to
incorporate the changes already made to the monotone version of the
sqlite source files?

My question to the monotone developers is; Can you please provide
convincing arguments for each and every change made to the sqlite
source files as presented in the attached diff?

A followup question is; Do you intend to communicate your changes
upstream to the authors of sqlite so it will show up in a future
source release of sqlite?

I would very much like to resolve this issue in such a way that I
can begin to link monotone with the sqlite library as provided in
Debian.

The relevant diff is attached to this letter.

--
Tomas Fasth <address@hidden>
GnuPG KeyId: 0x9FE8D504
Fingerprint: DC7B 9453 7F26 1BF9 6B21 9F90 C187 7355 9FE8 D504
diff -u sqlite-3.2.2/src/main.c monotone/monotone-0.21/sqlite/main.c
--- sqlite-3.2.2/src/main.c     2005-06-06 14:44:41.000000000 +0000
+++ monotone/monotone-0.21/sqlite/main.c        2005-07-17 23:02:14.000000000 
+0000
@@ -298,7 +298,7 @@
   sqlite3OsSleep(delay);
   return 1;
 #else
-  int timeout = (int)Timeout;
+  int timeout = ((sqlite3 *)ptr)->busyTimeout;
   if( (count+1)*1000 > timeout ){
     return 0;
   }
diff -u sqlite-3.2.2/src/sqliteInt.h monotone/monotone-0.21/sqlite/sqliteInt.h
--- sqlite-3.2.2/src/sqliteInt.h        2005-06-12 21:35:52.000000000 +0000
+++ monotone/monotone-0.21/sqlite/sqliteInt.h   2005-07-17 23:02:14.000000000 
+0000
@@ -39,6 +39,7 @@
 # define _LARGEFILE_SOURCE 1
 #endif

+#include "config.h"
 #include "sqlite3.h"
 #include "hash.h"
 #include "parse.h"
diff -u sqlite-3.2.2/src/tokenize.c monotone/monotone-0.21/sqlite/tokenize.c
--- sqlite-3.2.2/src/tokenize.c 2005-06-06 14:45:43.000000000 +0000
+++ monotone/monotone-0.21/sqlite/tokenize.c    2005-07-17 23:02:14.000000000 
+0000
@@ -500,8 +500,14 @@
 ** is look for a semicolon that is not part of an string or comment.
 */
 int sqlite3_complete(const char *zSql){
+  const char *tmp;
+  return sqlite3_complete_last(zSql, &tmp);
+}
+
+int sqlite3_complete_last(const char *zSql, const char **last){
   u8 state = 0;   /* Current state, using numbers defined in header comment */
   u8 token;       /* Value of the next token */
+  const char* lastseen = 0;

 #ifndef SQLITE_OMIT_TRIGGER
   /* A complex statement machine used to detect the end of a CREATE TRIGGER
@@ -551,7 +557,7 @@
         }
         zSql += 2;
         while( zSql[0] && (zSql[0]!='*' || zSql[1]!='/') ){ zSql++; }
-        if( zSql[0]==0 ) return 0;
+        if( zSql[0]==0 ) { *last = lastseen; return 0; }
         zSql++;
         token = tkWS;
         break;
@@ -562,14 +568,14 @@
           break;
         }
         while( *zSql && *zSql!='\n' ){ zSql++; }
-        if( *zSql==0 ) return state==0;
+        if( *zSql==0 ) { *last = lastseen; return state==0; }
         token = tkWS;
         break;
       }
       case '[': {   /* Microsoft-style identifiers in [...] */
         zSql++;
         while( *zSql && *zSql!=']' ){ zSql++; }
-        if( *zSql==0 ) return 0;
+        if( *zSql==0 ) { *last = lastseen; return 0; }
         token = tkOTHER;
         break;
       }
@@ -578,7 +584,7 @@
         int c = *zSql;
         zSql++;
         while( *zSql && *zSql!=c ){ zSql++; }
-        if( *zSql==0 ) return 0;
+        if( *zSql==0 ) { *last = lastseen; return 0; }
         token = tkOTHER;
         break;
       }
@@ -641,8 +647,11 @@
       }
     }
     state = trans[state][token];
+    if (state == 0)
+      lastseen = zSql;
     zSql++;
   }
+  *last = lastseen;
   return state==0;
 }

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]