]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Fix makefiles so that they build sqlite3_analyzer again. Tweaks to comments
authordrh <drh@noemail.net>
Mon, 12 Jul 2010 16:47:48 +0000 (16:47 +0000)
committerdrh <drh@noemail.net>
Mon, 12 Jul 2010 16:47:48 +0000 (16:47 +0000)
in test_stat.c.  Fix tclsqlite.c to build the sqlite3_analyzer again.

FossilOrigin-Name: e6cd15451d8c47bfc86d07565655920134b494fe

Makefile.in
main.mk
manifest
manifest.uuid
src/tclsqlite.c
src/test_async.c
src/test_stat.c

index da9d2131fd0bcedbf1319c6806d0f7b222a8d00c..49741940df5e6c9323acb446d79aefa0ff8943d6 100644 (file)
@@ -874,7 +874,7 @@ sqlite3_analyzer$(TEXE):    $(TESTFIXTURE_SRC) $(TOP)/tool/spaceanal.tcl
          $(TOP)/tool/spaceanal.tcl >spaceanal_tcl.h
        $(LTLINK) -DTCLSH=2 -DSQLITE_TEST=1 -DSQLITE_CRASH_TEST=1 \
                -DSQLITE_SERVER=1 -DSQLITE_PRIVATE="" -DSQLITE_CORE \
-               $(TEMP_STORE) -o $@ $(TESTFIXTURE_SRC) $(LIBTCL)
+               $(TEMP_STORE) -o $@ $(TESTFIXTURE_SRC) $(LIBTCL) $(TLIBS)
 
 
 # Standard install and cleanup targets
diff --git a/main.mk b/main.mk
index d212dca39b511061233defbc4f8245718a2d7d4c..83228c30e8f7aab6b80a0ecdaf1559b159e52683 100644 (file)
--- a/main.mk
+++ b/main.mk
@@ -493,21 +493,21 @@ tclsqlite3:       $(TOP)/src/tclsqlite.c libsqlite3.a
 
 # Rules to build the 'testfixture' application.
 #
-TESTFIXTURE_FLAGS  = -DTCLSH=1 -DSQLITE_TEST=1 -DSQLITE_CRASH_TEST=1
+TESTFIXTURE_FLAGS  = -DSQLITE_TEST=1 -DSQLITE_CRASH_TEST=1
 TESTFIXTURE_FLAGS += -DSQLITE_SERVER=1 -DSQLITE_PRIVATE="" -DSQLITE_CORE 
 
 testfixture$(EXE): $(TESTSRC2) libsqlite3.a $(TESTSRC) $(TOP)/src/tclsqlite.c
-       $(TCCX) $(TCL_FLAGS) $(TESTFIXTURE_FLAGS)                            \
+       $(TCCX) $(TCL_FLAGS) -DTCLSH=1 $(TESTFIXTURE_FLAGS)                  \
                $(TESTSRC) $(TESTSRC2) $(TOP)/src/tclsqlite.c                \
                -o testfixture$(EXE) $(LIBTCL) $(THREADLIB) libsqlite3.a
 
 amalgamation-testfixture$(EXE): sqlite3.c $(TESTSRC) $(TOP)/src/tclsqlite.c
-       $(TCCX) $(TCL_FLAGS) $(TESTFIXTURE_FLAGS)                            \
+       $(TCCX) $(TCL_FLAGS) -DTCLSH=1 $(TESTFIXTURE_FLAGS)                  \
                $(TESTSRC) $(TOP)/src/tclsqlite.c sqlite3.c                  \
                -o testfixture$(EXE) $(LIBTCL) $(THREADLIB)
 
 fts3-testfixture$(EXE): sqlite3.c fts3amal.c $(TESTSRC) $(TOP)/src/tclsqlite.c
-       $(TCCX) $(TCL_FLAGS) $(TESTFIXTURE_FLAGS)                            \
+       $(TCCX) $(TCL_FLAGS) -DTCLSH=1 $(TESTFIXTURE_FLAGS)                  \
        -DSQLITE_ENABLE_FTS3=1                                               \
                $(TESTSRC) $(TOP)/src/tclsqlite.c sqlite3.c fts3amal.c       \
                -o testfixture$(EXE) $(LIBTCL) $(THREADLIB)
@@ -530,8 +530,8 @@ sqlite3_analyzer$(EXE):     $(TOP)/src/tclsqlite.c sqlite3.c $(TESTSRC) \
          -e 's,^,",' \
          -e 's,$$,\\n",' \
          $(TOP)/tool/spaceanal.tcl >spaceanal_tcl.h
-       $(TCCX) $(TCL_FLAGS)                  $(TESTFIXTURE_FLAGS)                                 \
-               -DTCLSH=2 -DSQLITE_TEST=1 -DSQLITE_DEBUG=1 -DSQLITE_PRIVATE="" \
+       $(TCCX) $(TCL_FLAGS) -DTCLSH=2 $(TESTFIXTURE_FLAGS)                    \
+               -DSQLITE_TEST=1 -DSQLITE_PRIVATE=""                            \
                $(TESTSRC) $(TOP)/src/tclsqlite.c sqlite3.c                    \
                -o sqlite3_analyzer$(EXE)                                      \
                $(LIBTCL) $(THREADLIB)
index cc8867bf47128606116b44e6b0bf76a152b7b6fb..9f75c56157fc93aa63560efd231013cf253300b1 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,7 +1,10 @@
-C In\sthe\sasync-IO\smodule,\sdo\snot\sincrement\sthe\sopen\sfile-counter\suntil\safter\san\s"open\sfile"\sevent\shas\sbeen\sadded\sto\sthe\sevent\squeue.\sOtherwise,\san\sOOM\smay\scause\sthe\ssystem\sto\sincrement\sthe\scounter\seven\sthough\sno\sfile\swas\ssuccessfully\sopened.
-D 2010-07-12T12:22:29
+-----BEGIN PGP SIGNED MESSAGE-----
+Hash: SHA1
+
+C Fix\smakefiles\sso\sthat\sthey\sbuild\ssqlite3_analyzer\sagain.\s\sTweaks\sto\scomments\nin\stest_stat.c.\s\sFix\stclsqlite.c\sto\sbuild\sthe\ssqlite3_analyzer\sagain.
+D 2010-07-12T16:47:49
 F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
-F Makefile.in 3340503a02ffc70370f8308a484c99330589774d
+F Makefile.in ec08dc838fd8110fe24c92e5130bcd91cbb1ff2e
 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
 F Makefile.vxworks 4314cde20a1d9460ec5083526ea975442306ae7e
 F README cd04a36fbc7ea56932a4052d7d0b7f09f27c33d6
@@ -93,7 +96,7 @@ F ext/rtree/tkt3363.test 2bf324f7908084a5f463de3109db9c6e607feb1b
 F ext/rtree/viewrtree.tcl eea6224b3553599ae665b239bd827e182b466024
 F install-sh 9d4de14ab9fb0facae2f48780b874848cbf2f895 x
 F ltmain.sh 3ff0879076df340d2e23ae905484d8c15d5fdea8
-F main.mk 471e9b275ac3177c46ee077bcaba76f74313a13f
+F main.mk 26ad86cf0689940f19b3d608bbfdb3956b2fb9a7
 F mkdll.sh 7d09b23c05d56532e9d44a50868eb4b12ff4f74a
 F mkextu.sh 416f9b7089d80e5590a29692c9d9280a10dbad9f
 F mkextw.sh 4123480947681d9b434a5e7b1ee08135abe409ac
@@ -176,7 +179,7 @@ F src/sqliteInt.h 8eb5d1c63fff70ed30f4b861aeaf8485e663129c
 F src/sqliteLimit.h 196e2f83c3b444c4548fc1874f52f84fdbda40f3
 F src/status.c 4df6fe7dce2d256130b905847c6c60055882bdbe
 F src/table.c 2cd62736f845d82200acfa1287e33feb3c15d62e
-F src/tclsqlite.c 0e47807e6e05269152a0d51348b72c221128723c
+F src/tclsqlite.c ae1e4fb653c91ddad7e2534d209711a12604ccc4
 F src/test1.c a48320a6481761c46b61ee1c1ee39177add8fccd
 F src/test2.c e3f564ab1e9fd0b47b0c9e23e7054e38bf0836cf
 F src/test3.c 4c21700c73a890a47fc685c1097bfb661346ac94
@@ -186,7 +189,7 @@ F src/test6.c a1217a210fd6e2bcd11ddff4ad2484ec65998043
 F src/test7.c 3f2d63e4ccf97f8c2cf1a7fa0a3c8e2e2a354e6e
 F src/test8.c f959db9a22d882013b64c92753fa793b2ce3bdea
 F src/test9.c bea1e8cf52aa93695487badedd6e1886c321ea60
-F src/test_async.c 5193a69d0982096d64e56c9ff8b2ec6d4f446f82
+F src/test_async.c 0612a752896fad42d55c3999a5122af10dcf22ad
 F src/test_autoext.c 30e7bd98ab6d70a62bb9ba572e4c7df347fe645e
 F src/test_backup.c c129c91127e9b46e335715ae2e75756e25ba27de
 F src/test_btree.c 47cd771250f09cdc6e12dda5bc71bc0b3abc96e2
@@ -207,7 +210,7 @@ F src/test_osinst.c 700a39f4b7d3959fb65b1a97a5503a9b6d952c6b
 F src/test_pcache.c 7bf828972ac0d2403f5cfa4cd14da41f8ebe73d8
 F src/test_schema.c 8c06ef9ddb240c7a0fcd31bc221a6a2aade58bf0
 F src/test_server.c bbba05c144b5fc4b52ff650a4328027b3fa5fcc6
-F src/test_stat.c 29b4b949834b8c1901b5fd52df49ae36bea594d2
+F src/test_stat.c 43fbdefb11cef9ffe0d68358a53f0d5b73ce7a03
 F src/test_tclvar.c f4dc67d5f780707210d6bb0eb6016a431c04c7fa
 F src/test_thread.c bedd05cad673dba53326f3aa468cc803038896c0
 F src/test_vfs.c bea0f0bdee9b033a62d057bf3451c25760b0414d
@@ -833,7 +836,14 @@ F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
 F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
 F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f
-P 86159cb3f00a380dc55be3affb01c433618f0683
-R 7615db4c5a55fdef05b6d83351ebc753
-U dan
-Z f80c53af3756aa1578d0c9c79219d994
+P 15a190dc5769beb53b89254543e744a964cd86ed
+R b03ba0baa83ecbd1443fe1ae924d6bf5
+U drh
+Z 04b286182088f92bee4d811b7155ecc4
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v1.4.6 (GNU/Linux)
+
+iD8DBQFMO0c4oxKgR168RlERAoTDAKCCtvm0lsyE0VQBBwpBriE6MEfmCwCgiZ6l
+E2dmMrqBg49MZkPjgXnYW64=
+=t01V
+-----END PGP SIGNATURE-----
index 75051081c500ce4b79fa240a2b485869d3369c48..ad6f07158515218487ef8cb16a27e98c356f9418 100644 (file)
@@ -1 +1 @@
-15a190dc5769beb53b89254543e744a964cd86ed
\ No newline at end of file
+e6cd15451d8c47bfc86d07565655920134b494fe
\ No newline at end of file
index 23b7e8e84fb9205b1aa88553655b69ab765ded7f..a2d352c3bc1cf8906c05477fe4c8d8243b30bc1e 100644 (file)
@@ -3488,6 +3488,11 @@ static char zMainloop[] =
   "}\n"
 ;
 #endif
+#if TCLSH==2
+static char zMainloop[] = 
+#include "spaceanal_tcl.h"
+;
+#endif
 
 #ifdef SQLITE_TEST
 static void init_all(Tcl_Interp *);
@@ -3609,6 +3614,9 @@ int TCLSH_MAIN(int argc, char **argv){
   ** sqlite3_initialize() is. */
   sqlite3_shutdown();
 
+#if TCLSH==2
+  sqlite3_config(SQLITE_CONFIG_SINGLETHREAD);
+#endif
   Tcl_FindExecutable(argv[0]);
 
   interp = Tcl_CreateInterp();
@@ -3624,14 +3632,14 @@ int TCLSH_MAIN(int argc, char **argv){
       Tcl_SetVar(interp, "argv", argv[i],
           TCL_GLOBAL_ONLY | TCL_LIST_ELEMENT | TCL_APPEND_VALUE);
     }
-    if( Tcl_EvalFile(interp, argv[1])!=TCL_OK ){
+    if( TCLSH==1 && Tcl_EvalFile(interp, argv[1])!=TCL_OK ){
       const char *zInfo = Tcl_GetVar(interp, "errorInfo", TCL_GLOBAL_ONLY);
       if( zInfo==0 ) zInfo = Tcl_GetStringResult(interp);
       fprintf(stderr,"%s: %s\n", *argv, zInfo);
       return 1;
     }
   }
-  if( argc<=1 ){
+  if( TCLSH==2 || argc<=1 ){
     Tcl_GlobalEval(interp, zMainloop);
   }
   return 0;
index 313645dec64b61aea61fb88784c395ebb8fc9f3b..c760eea1fa2d6ddbec32497a673ec074c3963f90 100644 (file)
@@ -229,7 +229,7 @@ static int testAsyncControl(
 ** of this module.
 */
 int Sqlitetestasync_Init(Tcl_Interp *interp){
-#if SQLITE_ENABLE_ASYNCIO
+#ifdef SQLITE_ENABLE_ASYNCIO
   Tcl_CreateObjCommand(interp,"sqlite3async_start",testAsyncStart,0,0);
   Tcl_CreateObjCommand(interp,"sqlite3async_wait",testAsyncWait,0,0);
 
index 1a44c38f87448fac5dbb94f6c5c11d083c2812db..527c8b323ead134763030a7de33a1957f5e3342e 100644 (file)
@@ -9,6 +9,13 @@
 **    May you share freely, never taking more than you give.
 **
 ******************************************************************************
+**
+** This file contains an implementation of the "dbstat" virtual table.
+**
+** The dbstat virtual table is used to extract low-level formatting
+** information from an SQLite database in order to implement the
+** "sqlite3_analyzer" utility.  See the ../tool/spaceanal.tcl script
+** for an example implementation.
 */
 
 #include "sqliteInt.h"
 **   root-node path is '/'.
 **
 **   The value of the path for the left-most child page of the root of
-**   a b-tree is '/000/'. The next to left-most child of the root page is
+**   a b-tree is '/000/'. (Btrees store content ordered from left to right
+**   so the pages to the left have smaller keys than the pages to the right.)
+**   The next to left-most child of the root page is
 **   '/001', and so on, each sibling page identified by a 3-digit hex 
-**   value. The children of the 450th left-most sibling have paths such
+**   value. The children of the 451st left-most sibling have paths such
 **   as '/1c2/000/, '/1c2/001/' etc.
 **
 **   Overflow pages are specified by appending a '+' character and a 
@@ -40,7 +49,7 @@
 **   the overflow pages associated with a cell will appear earlier in the
 **   sort-order than its child page:
 **
-**      '/1c2/000/'               // Left-most child of 450th child of root
+**      '/1c2/000/'               // Left-most child of 451st child of root
 */
 #define VTAB_SCHEMA                                                         \
   "CREATE TABLE xx( "                                                       \
@@ -348,13 +357,6 @@ static int statDecodePage(Btree *pBt, StatPage *p){
   return SQLITE_OK;
 }
 
-static void statSetPath(StatPage *p, StatPage *pParent){
-  if( pParent ){
-    p->zPath = sqlite3_mprintf("%s%.3x/", pParent->zPath, pParent->iCell);
-  }else{
-  }
-}
-
 /*
 ** Move a statvfs cursor to the next entry in the file.
 */
@@ -601,4 +603,3 @@ int SqlitetestStat_Init(Tcl_Interp *interp){
   return TCL_OK;
 }
 #endif
-