diff --git a/manifest b/manifest index af6cd78425..a32ea08427 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Remove\sreference\sto\sGDBM\sin\sthe\sdocumentation\sof\sthe\s"sqlite"\ncommand-line\sutility.\s(CVS\s274) -D 2001-09-28T18:14:17 +C Documentation\supdates.\s(CVS\s275) +D 2001-09-28T23:11:24 F Makefile.in 98d4627cb364537e4c3a29ee806171f3abf5211a F Makefile.template 7179523fdf3d6e7933ec843e2352dcfc9785c700 F README 93d2977cc5c6595c448de16bdefc312b9d401533 @@ -98,20 +98,20 @@ F tool/renumberOps.awk 6d067177ad5f8d711b79577b462da9b3634bd0a9 F tool/report1.txt 9eae07f26a8fc53889b45fc833a66a33daa22816 F www/arch.fig d5f9752a4dbf242e9cfffffd3f5762b6c63b3bcf F www/arch.png 82ef36db1143828a7abc88b1e308a5f55d4336f4 -F www/arch.tcl c1891efdc00cd76eec72bdbf8b446195902932a3 -F www/c_interface.tcl 52ae81c89bf906b358e04857bd3f76b1a7f61c1b +F www/arch.tcl 03b521d252575f93b9c52f7c8b0007011512fcfb +F www/c_interface.tcl 8e8d9e66e8467c5751116c3427296bde77f474a6 F www/changes.tcl 47619693c843174b57d41482fcd00e2e70d41fd0 F www/crosscompile.tcl c99efacb3aefaa550c6e80d91b240f55eb9fd33e F www/dynload.tcl 02eb8273aa78cfa9070dd4501dca937fb22b466c -F www/index.tcl 639a75165dc532a16ddb02055bc69541eecc3fa7 +F www/index.tcl 998f61fe69be9f1b04e403c8efb75bca92710e83 F www/lang.tcl 33a74d727615ccbee8be7c8efd5876ce008c4b0e F www/mingw.tcl fc5f4ba9d336b6e8c97347cc6496d6162461ef60 -F www/opcode.tcl 60222aeb57a7855b2582c374b8753cb5bb53c4ab -F www/speed.tcl 91b53f9403a62bb322dc1f85a81531309bcfb41c -F www/sqlite.tcl ea362207eee32cdd9dd594b1ec990bdb20101efe +F www/opcode.tcl 4365ad9798872491dbd7d3071510ebe461785ac3 +F www/speed.tcl ab7d6d3bc898472bd94320a5d3c63de928d4804b +F www/sqlite.tcl 6a21242a272e9c0939a04419a51c3d50cae33e3e F www/tclsqlite.tcl 13d50723f583888fc80ae1a38247c0ab415066fa -F www/vdbe.tcl 0c8aaa529dd216ccbf7daaabd80985e413d5f9ad -P 7e79e91b03e21058bbae2c0aab8f3e8ce09ae7f9 -R 241095ce4074dd39044429d0144b987e +F www/vdbe.tcl bb7d620995f0a987293e9d4fb6185a3b077e9b44 +P 0ffab36d1fc29125fdcf0d732073f77012dfcad4 +R 50ffde789836ed27912ab4a11f3cd02b U drh -Z 5497d3942cad9d16c737ee62c27c8636 +Z 7f4c737cc5ad90cbc1518651f459aab9 diff --git a/manifest.uuid b/manifest.uuid index e2aae0032c..a41dbd5389 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -0ffab36d1fc29125fdcf0d732073f77012dfcad4 \ No newline at end of file +4b4bfc6290f05c6672338690911f68fd8bb418c9 \ No newline at end of file diff --git a/www/arch.tcl b/www/arch.tcl index 0982b7dee5..a32f9f592e 100644 --- a/www/arch.tcl +++ b/www/arch.tcl @@ -1,7 +1,7 @@ # # Run this Tcl script to generate the sqlite.html file. # -set rcsid {$Id: arch.tcl,v 1.5 2001/09/20 01:44:43 drh Exp $} +set rcsid {$Id: arch.tcl,v 1.6 2001/09/28 23:11:24 drh Exp $} puts {
@@ -121,11 +121,11 @@ between the virtual machine and the rest of the SQLite library.An SQLite database is maintained on disk using a B-tree implementation found in the btree.c source file. A separate B-tree is used for -each table and index in the database but all B-trees are stored in the -same disk file. Each page of a B-tree is 1024 bytes in size. The data -is stored with the key in an area called "payload". Up to 236 bytes of -payload can be stored with each B-tree entry. Any additional payload -is stored in a chain of overflow pages.
+each table and index in the database. All B-trees are stored in the +same disk file. Each page of a B-tree is 1024 bytes in size. The key +and data for an entry are stored together in an area called "payload". +Up to 236 bytes of payload can be stored on the same page as the B-tree +entry. Any additional payload is stored in a chain of overflow pages.The interface to the B-tree subsystem is defined by the header file btree.h. @@ -135,11 +135,11 @@ is stored in a chain of overflow pages.
The B-tree module requests information from the disk in 1024 byte chunks. The page cache is reponsible for reading, writing, and -caching these chunks for the B-tree module. +caching these chunks at the behest of the B-tree module. The page cache also provides the rollback and atomic commit abstraction and takes care of reader/writer locking of the database file. The B-tree driver requests particular pages from the page cache and notifies -the page cache when it wants to modify pages and commit or rollback its +the page cache when it wants to modify pages or commit or rollback changes and the page cache handles all the messy details of making sure the requests are handled quickly, safely, and efficiently.
diff --git a/www/c_interface.tcl b/www/c_interface.tcl index fdbd668fb9..c65f589188 100644 --- a/www/c_interface.tcl +++ b/www/c_interface.tcl @@ -1,7 +1,7 @@ # # Run this Tcl script to generate the sqlite.html file. # -set rcsid {$Id: c_interface.tcl,v 1.15 2001/09/20 01:44:43 drh Exp $} +set rcsid {$Id: c_interface.tcl,v 1.16 2001/09/28 23:11:24 drh Exp $} puts { @@ -41,22 +41,26 @@ int sqlite_exec( char **errmsg ); -#define SQLITE_OK 0 /* Successful result */ -#define SQLITE_ERROR 1 /* SQL error or missing database */ -#define SQLITE_INTERNAL 2 /* An internal logic error in SQLite */ -#define SQLITE_PERM 3 /* Access permission denied */ -#define SQLITE_ABORT 4 /* Callback routine requested an abort */ -#define SQLITE_BUSY 5 /* One or more database files are locked */ -#define SQLITE_NOMEM 6 /* A malloc() failed */ -#define SQLITE_READONLY 7 /* Attempt to write a readonly database */ -#define SQLITE_INTERRUPT 8 /* Operation terminated by sqlite_interrupt() */ -#define SQLITE_IOERR 9 /* Some kind of disk I/O error occurred */ -#define SQLITE_CORRUPT 10 /* The database disk image is malformed */ -#define SQLITE_FULL 12 /* Insertion failed because database is full */ -#define SQLITE_CANTOPEN 13 /* Unable to open the database file */ -#define SQLITE_PROTOCOL 14 /* Database lock protocol error */ -#define SQLITE_SCHEMA 16 /* The database schema changed */ -#define SQLITE_TOOBIG 17 /* Too much data for one row of a table */ +#define SQLITE_OK 0 /* Successful result */ +#define SQLITE_ERROR 1 /* SQL error or missing database */ +#define SQLITE_INTERNAL 2 /* An internal logic error in SQLite */ +#define SQLITE_PERM 3 /* Access permission denied */ +#define SQLITE_ABORT 4 /* Callback routine requested an abort */ +#define SQLITE_BUSY 5 /* The database file is locked */ +#define SQLITE_LOCKED 6 /* A table in the database is locked */ +#define SQLITE_NOMEM 7 /* A malloc() failed */ +#define SQLITE_READONLY 8 /* Attempt to write a readonly database */ +#define SQLITE_INTERRUPT 9 /* Operation terminated by sqlite_interrupt() */ +#define SQLITE_IOERR 10 /* Some kind of disk I/O error occurred */ +#define SQLITE_CORRUPT 11 /* The database disk image is malformed */ +#define SQLITE_NOTFOUND 12 /* (Internal Only) Table or record not found */ +#define SQLITE_FULL 13 /* Insertion failed because database is full */ +#define SQLITE_CANTOPEN 14 /* Unable to open the database file */ +#define SQLITE_PROTOCOL 15 /* Database lock protocol error */ +#define SQLITE_EMPTY 16 /* (Internal Only) Database table is empty */ +#define SQLITE_SCHEMA 17 /* The database schema changed */ +#define SQLITE_TOOBIG 18 /* Too much data for one row of a table */ +#define SQLITE_CONSTRAINT 19 /* Abort due to contraint violation */Only the three core routines shown above are required to use @@ -259,6 +263,15 @@ database at the same time, but only one thread can have the database open for writing at the same time. Locking in SQLite is on the entire database.
+This return code is similar to SQLITE_BUSY in that it indicates +that the database is locked. But the source of the lock is a recursive +call to sqlite_exec(). This return can only occur if you attempt +to invoke sqlite_exec() from within a callback routine of a query +from a prior invocation of sqlite_exec(). Recursive calls to +sqlite_exec() are allowed as long as no more they all read-only or do +not attempt to write the same table. +
This value is returned if a call to malloc() fails.
This constant is returned if the SQL statement would have violated +a database constraint. +
-Precompiled binaries for Linux and Windows and the complete -source tree are available for download. -
-} - puts {A change history is available online. +The latest source code is +available for download. There are currently no known memory leaks or debilitating bugs -in the library. Gcov -is used to verify test coverage.
+in the library. + ++The file format used changed beginning with version 2.0.0. Version 1.0.X +of SQLite used GDBM as its database backend. Version 2.0.0 and later +use a built-in implementation of B-trees. If you have older 1.0 databases +you will need to convert them before they can be read using a 2.0 +release of SQLite. The following command will convert a legacy +database into the new 2.0 format: +
+ ++ ++echo .dump | sqlite1.0 old.db | sqlite2.0 new.db +
+The above command assumes that sqlite1.0 is sqlite version 1.0 +and sqlite2.0 is sqlite version 2.0. The old database is stored +in a directory named old.db and the new database is created in +the file new.db. +
@@ -75,8 +75,7 @@ the NDEBUG macro makes SQLite 2.0 run nearly twice as fast.
All tests are conducted on an otherwise quiescent machine. -A simple shell script generates and runs all the tests. -The shell script is named speedtest3.sh. +A simple shell script was used to generate and run all the tests. Each test reports three different times:
diff --git a/www/sqlite.tcl b/www/sqlite.tcl index 583a01f685..d8a23af3ed 100644 --- a/www/sqlite.tcl +++ b/www/sqlite.tcl @@ -1,7 +1,7 @@ # # Run this Tcl script to generate the sqlite.html file. # -set rcsid {$Id: sqlite.tcl,v 1.14 2001/09/28 18:14:17 drh Exp $} +set rcsid {$Id: sqlite.tcl,v 1.15 2001/09/28 23:11:24 drh Exp $} puts { @@ -28,8 +28,7 @@ the name the file that holds the SQLite database. If the file does not exist, a new one is created automatically. The sqlite program will then prompt you to enter SQL. Type in SQL statements (terminated by a -semicolon), press "Enter" and the SQL will be executed. It's as -simple as that! +semicolon), press "Enter" and the SQL will be executed.For example, to create a new SQLite database named "ex1" with a single table named "tbl1", you might do this:
@@ -48,6 +47,7 @@ proc Code {body} { Code { $ (((sqlite ex1))) +SQLite version 2.0.0 Enter ".help" for instructions sqlite> (((create table tbl1(one varchar(10), two smallint);))) sqlite> (((insert into tbl1 values('hello!',10);))) @@ -60,7 +60,7 @@ sqlite> puts {(In the example above, and in all subsequent examples, the commands -you type are underlined shown with a green tint and the responses +you type are underlined and shown with a green tint and the responses from the computer are shown in black without underlining.)
You can terminate the sqlite program by typing your systems @@ -85,31 +85,26 @@ sqlite> } puts { -
If you exit sqlite and look at the contents of the directory "ex1" -you'll see that it now contains two files: sqlite_master.tcl -and tbl1.tbl. The tbl1.tbl file contains all the -data for table "tbl1" in your database. The file -sqlite_master.tbl is a special table found on all SQLite -databases that records information about all other tables and -indices. In general, an SQLite database will contain one "*.tbl" -file for each table and index in your database, plus the extra -"sqlite_master.tbl" file used to store the database schema.
You can execute "SELECT" statements against the +
The database schema in an SQLite database is stored in +a special table named "sqlite_master". +You can execute "SELECT" statements against the special sqlite_master table just like any other table in an SQLite database. For example:
} Code { $ (((sqlite ex1))) +SQlite vresion 2.0.0 Enter ".help" for instructions sqlite> (((select * from sqlite_master;))) -type = table -name = tbl1 + type = table + name = tbl1 tbl_name = tbl1 -sql = create table tbl1(one varchar(10), two smallint) +rootpage = 3 + sql = create table tbl1(one varchar(10), two smallint) sqlite> } diff --git a/www/vdbe.tcl b/www/vdbe.tcl index 9e29fd2a63..95d5a8dc59 100644 --- a/www/vdbe.tcl +++ b/www/vdbe.tcl @@ -1,7 +1,7 @@ # # Run this Tcl script to generate the vdbe.html file. # -set rcsid {$Id: vdbe.tcl,v 1.6 2000/11/28 20:46:41 drh Exp $} +set rcsid {$Id: vdbe.tcl,v 1.7 2001/09/28 23:11:24 drh Exp $} puts { @@ -15,11 +15,15 @@ puts "(This page was last modified on [lrange $rcsid 3 4] GMT)
" -# puts { -#This document is -# currently under development. It is incomplete and contains -# errors. Use it accordingly.-# } +puts { +
+This document describes the +virtual machine used in SQLite version 1.0. It has not been +updated to reflect important changes that have occurred for +version 2.0. Some of the information presented below is +obsolete and/or incorrect. Use it accordingly. ++} puts {
If you want to know how the SQLite library works internally,