Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Disclaimed copyright. Preparing for release 2.0. (CVS 250) |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
4e926efe2b59adfec4086eb1d2ba8302 |
User & Date: | drh 2001-09-16 00:13:26.000 |
Context
2001-09-16
| ||
13:36 | Version to 2.0.0 (CVS 251) (check-in: c67f6db681 user: drh tags: trunk) | |
00:13 | Disclaimed copyright. Preparing for release 2.0. (CVS 250) (check-in: 4e926efe2b user: drh tags: trunk) | |
2001-09-15
| ||
14:43 | Separate columns in keys using nulls instead of tabs. (CVS 249) (check-in: 8e2f3f751e user: drh tags: trunk) | |
Changes
Deleted COPYRIGHT.
|
| < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < |
Changes to Makefile.in.
︙ | ︙ | |||
207 208 209 210 211 212 213 214 | $(TOP)/src/tclsqlite.c libsqlite.a $(LIBTCL) testfixture: $(TOP)/src/tclsqlite.c libsqlite.a $(TESTSRC) $(TCC) $(TCL_FLAGS) -DTCLSH=1 -DSQLITE_TEST=1 -o testfixture \ $(TESTSRC) $(TOP)/src/tclsqlite.c \ libsqlite.a $(LIBTCL) test: testfixture sqlite | > > > | | 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 | $(TOP)/src/tclsqlite.c libsqlite.a $(LIBTCL) testfixture: $(TOP)/src/tclsqlite.c libsqlite.a $(TESTSRC) $(TCC) $(TCL_FLAGS) -DTCLSH=1 -DSQLITE_TEST=1 -o testfixture \ $(TESTSRC) $(TOP)/src/tclsqlite.c \ libsqlite.a $(LIBTCL) fulltest: testfixture sqlite ./testfixture $(TOP)/test/all.test test: testfixture sqlite ./testfixture $(TOP)/test/quick.test sqlite.tar.gz: pwd=`pwd`; cd $(TOP)/..; tar czf $$pwd/sqlite.tar.gz sqlite index.html: $(TOP)/www/index.tcl sqlite.tar.gz last_change tclsh $(TOP)/www/index.tcl `cat $(TOP)/VERSION` >index.html sqlite.html: $(TOP)/www/sqlite.tcl |
︙ | ︙ |
Changes to doc/lemon.html.
︙ | ︙ | |||
99 100 101 102 103 104 105 | Using ``-s'' causes a brief summary of parser statistics to be printed. Like this: <pre> Parser statistics: 74 terminals, 70 nonterminals, 179 rules 340 states, 2026 parser table entries, 0 conflicts </pre> Finally, the ``-x'' option causes Lemon to print its version number | < | | 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 | Using ``-s'' causes a brief summary of parser statistics to be printed. Like this: <pre> Parser statistics: 74 terminals, 70 nonterminals, 179 rules 340 states, 2026 parser table entries, 0 conflicts </pre> Finally, the ``-x'' option causes Lemon to print its version number and then stops without attempting to read the grammar or generate a parser.</p> <h3>The Parser Interface</h3> <p>Lemon doesn't generate a complete, working program. It only generates a few subroutines that implement a parser. This section describes the interface to those subroutines. It is up to the programmer to call these subroutines in an appropriate way in order to produce a |
︙ | ︙ |
Changes to doc/report1.txt.
|
| | | | | 1 2 3 4 5 6 7 8 9 10 | An SQLite (version 1.0) database was used in a large military application where the database contained 105 tables and indices. The following is a breakdown on the sizes of keys and data within these tables and indices: Entries: 967089 Size: 45896104 Avg Size: 48 Key Size: 11112265 Avg Key Size: 12 Max Key Size: 99 |
︙ | ︙ |
Deleted notes/notes1.txt.
|
| < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < |
Deleted notes/notes2.txt.
|
| < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < |
Deleted notes/notes2b.txt.
|
| < < < < < < < < < < < < < < < < < < < < < < < < < < |
Deleted notes/notes3.txt.
|
| < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < |
Changes to src/btree.c.
1 | /* | | | < < < | < < < < | < < < < | < | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | /* ** 2001 September 15 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** $Id: btree.c,v 1.29 2001/09/16 00:13:26 drh Exp $ ** ** This file implements a external (disk-based) database using BTrees. ** For a detailed discussion of BTrees, refer to ** ** Donald E. Knuth, THE ART OF COMPUTER PROGRAMMING, Volume 3: ** "Sorting And Searching", pages 473-480. Addison-Wesley ** Publishing Company, Reading, Massachusetts. |
︙ | ︙ | |||
49 50 51 52 53 54 55 | ** In this implementation, a single file can hold one or more separate ** BTrees. Each BTree is identified by the index of its root page. The ** key and data for any entry are combined to form the "payload". Up to ** MX_LOCAL_PAYLOAD bytes of payload can be carried directly on the ** database page. If the payload is larger than MX_LOCAL_PAYLOAD bytes ** then surplus bytes are stored on overflow pages. The payload for an ** entry and the preceding pointer are combined to form a "Cell". Each | | | | 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 | ** In this implementation, a single file can hold one or more separate ** BTrees. Each BTree is identified by the index of its root page. The ** key and data for any entry are combined to form the "payload". Up to ** MX_LOCAL_PAYLOAD bytes of payload can be carried directly on the ** database page. If the payload is larger than MX_LOCAL_PAYLOAD bytes ** then surplus bytes are stored on overflow pages. The payload for an ** entry and the preceding pointer are combined to form a "Cell". Each ** page has a small header which contains the Ptr(N+1) pointer. ** ** The first page of the file contains a magic string used to verify that ** the file really is a valid BTree database, a pointer to a list of unused ** pages in the file, and some meta information. The root of the first ** BTree begins on page 2 of the file. (Pages are numbered beginning with ** 1, not 0.) Thus a minimum database contains 2 pages. */ #include "sqliteInt.h" #include "pager.h" #include "btree.h" #include <assert.h> /* ** Primitive data types. u32 must be 4 bytes and u16 must be 2 bytes. ** The uptr type must be big enough to hold a pointer. ** Change these typedefs when porting to new architectures. */ typedef unsigned int uptr; /* There are already defined in sqliteInt.h... ** typedef unsigned int u32; ** typedef unsigned short int u16; ** typedef unsigned char u8; */ /* ** This macro casts a pointer to an integer. Useful for doing |
︙ | ︙ | |||
118 119 120 121 122 123 124 | ** This is a magic integer also used to test the integrity of the database ** file. This integer is used in addition to the string above so that ** if the file is written on a little-endian architecture and read ** on a big-endian architectures (or vice versa) we can detect the ** problem. ** ** The number used was obtained at random and has no special | | > | 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 | ** This is a magic integer also used to test the integrity of the database ** file. This integer is used in addition to the string above so that ** if the file is written on a little-endian architecture and read ** on a big-endian architectures (or vice versa) we can detect the ** problem. ** ** The number used was obtained at random and has no special ** significance other than the fact that it represents a different ** integer on little-endian and big-endian machines. */ #define MAGIC 0xdae37528 /* ** The first page of the database file contains a magic header string ** to identify the file as an SQLite database file. It also contains ** a pointer to the first free page of the file. Page 2 contains the |
︙ | ︙ |
Changes to src/btree.h.
1 | /* | | | < < < | < < < < | < < < < | < | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | /* ** 2001 September 15 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** This header file defines the interface that the sqlite B-Tree file ** subsystem. ** ** @(#) $Id: btree.h,v 1.14 2001/09/16 00:13:26 drh Exp $ */ #ifndef _BTREE_H_ #define _BTREE_H_ typedef struct Btree Btree; typedef struct BtCursor BtCursor; |
︙ | ︙ |
Changes to src/build.c.
1 | /* | | | < < < | < < < < | < < < < | < | | | | | > > > > | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | /* ** 2001 September 15 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** This file contains C code routines that are called by the SQLite parser ** when syntax rules are reduced. The routines in this file handle the ** following kinds of SQL syntax: ** ** CREATE TABLE ** DROP TABLE ** CREATE INDEX ** DROP INDEX ** creating expressions and ID lists ** COPY ** VACUUM ** BEGIN TRANSACTION ** COMMIT ** ROLLBACK ** PRAGMA ** ** $Id: build.c,v 1.36 2001/09/16 00:13:26 drh Exp $ */ #include "sqliteInt.h" #include <ctype.h> /* ** This routine is called after a single SQL statement has been ** parsed and we want to execute the VDBE code to implement |
︙ | ︙ |
Changes to src/delete.c.
1 | /* | | | < < < | < < < < | < < < < | < | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | /* ** 2001 September 15 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** This file contains C code routines that are called by the parser ** to handle DELETE FROM statements. ** ** $Id: delete.c,v 1.14 2001/09/16 00:13:27 drh Exp $ */ #include "sqliteInt.h" /* ** Process a DELETE FROM statement. */ void sqliteDeleteFrom( |
︙ | ︙ |
Changes to src/expr.c.
1 | /* | | | < < < | < < < < | < < < < | < | | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | /* ** 2001 September 15 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** This file contains routines used for analyzing expressions and ** for generating VDBE code that evaluates expressions in SQLite. ** ** $Id: expr.c,v 1.28 2001/09/16 00:13:27 drh Exp $ */ #include "sqliteInt.h" /* ** Walk an expression tree. Return 1 if the expression is constant ** and 0 if it involves variables. */ |
︙ | ︙ |
Changes to src/insert.c.
1 | /* | | | < < < | < < < < | < < < < | < | | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | /* ** 2001 September 15 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** This file contains C code routines that are called by the parser ** to handle INSERT statements in SQLite. ** ** $Id: insert.c,v 1.18 2001/09/16 00:13:27 drh Exp $ */ #include "sqliteInt.h" /* ** This routine is call to handle SQL of the following forms: ** ** insert into TABLE (IDLIST) values(EXPRLIST) |
︙ | ︙ |
Changes to src/main.c.
1 | /* | | | < < < | < < < < | < < < < | < | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | /* ** 2001 September 15 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** Main file for the SQLite library. The routines in this file ** implement the programmer interface to the library. Routines in ** other files are for internal use by SQLite and should not be ** accessed by users of the library. ** ** $Id: main.c,v 1.37 2001/09/16 00:13:27 drh Exp $ */ #include "sqliteInt.h" #if defined(HAVE_USLEEP) && HAVE_USLEEP #include <unistd.h> #endif /* |
︙ | ︙ |
Changes to src/pager.c.
1 | /* | | | < < < | < < < < | < < < < | < | | | | | > > > | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | /* ** 2001 September 15 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** This is the implementation of the page cache subsystem or "pager". ** ** The pager is used to access a database disk file. It implements ** atomic commit and rollback through the use of a journal file that ** is separate from the database file. The pager also implements file ** locking to prevent two processes from writing the same database ** file simultaneously, or one process from reading the database while ** another is writing. ** ** @(#) $Id: pager.c,v 1.20 2001/09/16 00:13:27 drh Exp $ */ #include "sqliteInt.h" #include "pager.h" #include <fcntl.h> #include <sys/stat.h> #include <unistd.h> #include <assert.h> |
︙ | ︙ | |||
99 100 101 102 103 104 105 | #define DATA_TO_PGHDR(D) (&((PgHdr*)(D))[-1]) #define PGHDR_TO_EXTRA(P) ((void*)&((char*)(&(P)[1]))[SQLITE_PAGE_SIZE]) /* ** How big to make the hash table used for locating in-memory pages ** by page number. Knuth says this should be a prime number. */ | | | 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 | #define DATA_TO_PGHDR(D) (&((PgHdr*)(D))[-1]) #define PGHDR_TO_EXTRA(P) ((void*)&((char*)(&(P)[1]))[SQLITE_PAGE_SIZE]) /* ** How big to make the hash table used for locating in-memory pages ** by page number. Knuth says this should be a prime number. */ #define N_PG_HASH 373 /* ** A open page cache is an instance of the following structure. */ struct Pager { char *zFilename; /* Name of the database file */ char *zJournal; /* Name of the journal file */ |
︙ | ︙ | |||
680 681 682 683 684 685 686 | int sqlitepager_ref(void *pData){ PgHdr *pPg = DATA_TO_PGHDR(pData); page_ref(pPg); return SQLITE_OK; } /* | | > > > > > > > > > | 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 | int sqlitepager_ref(void *pData){ PgHdr *pPg = DATA_TO_PGHDR(pData); page_ref(pPg); return SQLITE_OK; } /* ** Sync the journal and then write all free dirty pages to the database ** file. ** ** Writing all free dirty pages to the database after the sync is a ** non-obvious optimization. fsync() is an expensive operation so we ** want to minimize the number that occur. So after an fsync() is forced ** and we are free to write dirty pages back to the database, it is best ** to go ahead and do as much of that as possible to minimize the chance ** of having to do another fsync() later on. Writing dirty free pages ** in this way make database operations go up to 10 times faster. */ static int syncAllPages(Pager *pPager){ PgHdr *pPg; int rc = SQLITE_OK; if( pPager->needSync ){ rc = fsync(pPager->jfd); if( rc!=0 ) return rc; |
︙ | ︙ | |||
814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 | ** Try to find one that is not dirty and is near the head of ** of the free list */ int cnt = pPager->mxPage/2; pPg = pPager->pFirst; while( pPg->dirty && 0<cnt-- && pPg->pNextFree ){ pPg = pPg->pNextFree; } if( pPg==0 || pPg->dirty ){ int rc = syncAllPages(pPager); if( rc!=0 ){ sqlitepager_rollback(pPager); *ppPage = 0; return SQLITE_IOERR; } pPg = pPager->pFirst; } assert( pPg->nRef==0 ); | > > > > > > > > > > > > > < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 | ** Try to find one that is not dirty and is near the head of ** of the free list */ int cnt = pPager->mxPage/2; pPg = pPager->pFirst; while( pPg->dirty && 0<cnt-- && pPg->pNextFree ){ pPg = pPg->pNextFree; } /* If we could not find a page that has not been used recently ** and which is not dirty, then sync the journal and write all ** dirty free pages into the database file, thus making them ** clean pages and available for recycling. ** ** We have to sync the journal before writing a page to the main ** database. But syncing is a very slow operation. So after a ** sync, it is best to write everything we can back to the main ** database to minimize the risk of having to sync again in the ** near future. That is way we write all dirty pages after a ** sync. */ if( pPg==0 || pPg->dirty ){ int rc = syncAllPages(pPager); if( rc!=0 ){ sqlitepager_rollback(pPager); *ppPage = 0; return SQLITE_IOERR; } pPg = pPager->pFirst; } assert( pPg->nRef==0 ); assert( pPg->dirty==0 ); /* Unlink the old page from the free list and the hash table */ if( pPg->pPrevFree ){ pPg->pPrevFree->pNextFree = pPg->pNextFree; }else{ |
︙ | ︙ |
Changes to src/pager.h.
1 | /* | | | < < < | < < < < | < < < < | < | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | /* ** 2001 September 15 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** This header file defines the interface that the sqlite page cache ** subsystem. The page cache subsystem reads and writes a file a page ** at a time and provides a journal for rollback. ** ** @(#) $Id: pager.h,v 1.11 2001/09/16 00:13:27 drh Exp $ */ /* ** The size of one page */ #define SQLITE_PAGE_SIZE 1024 |
︙ | ︙ |
Changes to src/parse.y.
1 | /* | | | < < < | < < < < | < < < < | < | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | /* ** 2001 September 15 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** This file contains SQLite's grammar for SQL. Process this file ** using the lemon parser generator to generate C code that runs ** the parser. Lemon will also generate a header file containing ** numeric codes for all of the tokens. ** ** @(#) $Id: parse.y,v 1.30 2001/09/16 00:13:27 drh Exp $ */ %token_prefix TK_ %token_type {Token} %default_type {Token} %extra_argument {Parse *pParse} %syntax_error { sqliteSetString(&pParse->zErrMsg,"syntax error",0); |
︙ | ︙ |
Changes to src/random.c.
1 | /* | | | < < < | < < < < | < < < < | < | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | /* ** 2001 September 15 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** This file contains code to implement a pseudo-random number ** generator (PRNG) for SQLite. ** ** Random numbers are used by some of the database backends in order ** to generate random integer keys for tables or random filenames. ** ** $Id: random.c,v 1.5 2001/09/16 00:13:27 drh Exp $ */ #include "sqliteInt.h" #include <time.h> /* ** Get a single 8-bit random value from the RC4 PRNG. */ |
︙ | ︙ |
Changes to src/select.c.
1 | /* | | | < < < | < < < < | < < < < | < | | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | /* ** 2001 September 15 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** This file contains C code routines that are called by the parser ** to handle SELECT statements in SQLite. ** ** $Id: select.c,v 1.37 2001/09/16 00:13:27 drh Exp $ */ #include "sqliteInt.h" /* ** Allocate a new Select structure and return a pointer to that ** structure. */ |
︙ | ︙ |
Changes to src/shell.c.
1 | /* | | | < < < | < < < < | < < < < | < | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | /* ** 2001 September 15 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** This file contains code to implement the "sqlite" command line ** utility for accessing SQLite databases. ** ** $Id: shell.c,v 1.33 2001/09/16 00:13:27 drh Exp $ */ #include <stdlib.h> #include <string.h> #include <stdio.h> #include "sqlite.h" #include <unistd.h> #include <ctype.h> |
︙ | ︙ |
Changes to src/sqlite.h.in.
1 | /* | | | < < < | < < < < | < < < < | < | | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | /* ** 2001 September 15 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** This header file defines the interface that the SQLite library ** presents to client programs. ** ** @(#) $Id: sqlite.h.in,v 1.17 2001/09/16 00:13:27 drh Exp $ */ #ifndef _SQLITE_H_ #define _SQLITE_H_ #include <stdarg.h> /* Needed for the definition of va_list */ /* ** The version of the SQLite library. |
︙ | ︙ | |||
105 106 107 108 109 110 111 | ** value then the query is aborted, all subsequent SQL statements ** are skipped and the sqlite_exec() function returns the SQLITE_ABORT. ** ** The 4th parameter is an arbitrary pointer that is passed ** to the callback function as its first parameter. ** ** The 2nd parameter to the callback function is the number of | | | > | | < < | | > > > > | < < | 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 | ** value then the query is aborted, all subsequent SQL statements ** are skipped and the sqlite_exec() function returns the SQLITE_ABORT. ** ** The 4th parameter is an arbitrary pointer that is passed ** to the callback function as its first parameter. ** ** The 2nd parameter to the callback function is the number of ** columns in the query result. The 3rd parameter to the callback ** is an array of strings holding the values for each column. ** The 4th parameter to the callback is an array of strings holding ** the names of each column. ** ** The callback function may be NULL, even for queries. A NULL ** callback is not an error. It just means that no callback ** will be invoked. ** ** If an error occurs while parsing or evaluating the SQL (but ** not while executing the callback) then an appropriate error ** message is written into memory obtained from malloc() and ** *errmsg is made to point to that message. The calling function ** is responsible for freeing the memory that holds the error ** message. If errmsg==NULL, then no error message is ever written. ** ** The return value is is SQLITE_OK if there are no errors and ** some other return code if there is an error. The particular ** return value depends on the type of error. ** ** If the query could not be executed because a database file is ** locked or busy, then this function returns SQLITE_BUSY. (This ** behavior can be modified somewhat using the sqlite_busy_handler() ** and sqlite_busy_timeout() functions below.) */ int sqlite_exec( sqlite*, /* An open database */ char *sql, /* SQL to be executed */ sqlite_callback, /* Callback function */ void *, /* 1st argument to callback function */ char **errmsg /* Error msg written here */ |
︙ | ︙ | |||
149 150 151 152 153 154 155 | #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() */ | | | 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 | #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_NOTFOUND 11 /* Table or record not found */ #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_EMPTY 15 /* Database table is empty */ #define SQLITE_SCHEMA 16 /* The database schema changed */ |
︙ | ︙ |
Changes to src/sqliteInt.h.
1 | /* | | | < < < | < < < < | < < < < | < | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | /* ** 2001 September 15 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** Internal interface definitions for SQLite. ** ** @(#) $Id: sqliteInt.h,v 1.51 2001/09/16 00:13:27 drh Exp $ */ #include "sqlite.h" #include "vdbe.h" #include "parse.h" #include "btree.h" #include <stdio.h> #include <stdlib.h> |
︙ | ︙ |
Changes to src/table.c.
1 | /* | | | < < < | < < < < | < < < < | < | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | /* ** 2001 September 15 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** This file contains the sqlite_get_table() and sqlite_free_table() ** interface routines. These are just wrappers around the main ** interface routine of sqlite_exec(). ** ** These routines are in a separate files so that they will not be linked |
︙ | ︙ |
Changes to src/tclsqlite.c.
1 | /* | | | < < < | < < < < | < < < < | < | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | /* ** 2001 September 15 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** A TCL Interface to SQLite ** ** $Id: tclsqlite.c,v 1.23 2001/09/16 00:13:27 drh Exp $ */ #ifndef NO_TCL /* Omit this whole file if TCL is unavailable */ #include "sqlite.h" #include "tcl.h" #include <stdlib.h> #include <string.h> |
︙ | ︙ |
Changes to src/test1.c.
1 | /* | | | < < < | < < < < | < < < < | < | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | /* ** 2001 September 15 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** Code for testing the printf() interface to SQLite. This code ** is not included in the SQLite library. It is used for automated ** testing of the SQLite library. ** ** $Id: test1.c,v 1.3 2001/09/16 00:13:27 drh Exp $ */ #include "sqliteInt.h" #include "tcl.h" #include <stdlib.h> #include <string.h> /* |
︙ | ︙ |
Changes to src/test2.c.
1 | /* | | | < < < | < < < < | < < < < | < | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | /* ** 2001 September 15 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** Code for testing the pager.c module in SQLite. This code ** is not included in the SQLite library. It is used for automated ** testing of the SQLite library. ** ** $Id: test2.c,v 1.5 2001/09/16 00:13:27 drh Exp $ */ #include "sqliteInt.h" #include "pager.h" #include "tcl.h" #include <stdlib.h> #include <string.h> |
︙ | ︙ |
Changes to src/test3.c.
1 | /* | | | < < < | < < < < | < < < < | < | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | /* ** 2001 September 15 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** Code for testing the btree.c module in SQLite. This code ** is not included in the SQLite library. It is used for automated ** testing of the SQLite library. ** ** $Id: test3.c,v 1.11 2001/09/16 00:13:27 drh Exp $ */ #include "sqliteInt.h" #include "pager.h" #include "btree.h" #include "tcl.h" #include <stdlib.h> #include <string.h> |
︙ | ︙ |
Changes to src/tokenize.c.
1 | /* | | | < < < | < < < < | < < < < | < | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | /* ** 2001 September 15 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** An tokenizer for SQL ** ** This file contains C code that splits an SQL input string up into ** individual tokens and sends those tokens one-by-one over to the ** parser for analysis. ** ** $Id: tokenize.c,v 1.22 2001/09/16 00:13:27 drh Exp $ */ #include "sqliteInt.h" #include <ctype.h> #include <stdlib.h> /* ** All the keywords of the SQL language are stored as in a hash |
︙ | ︙ | |||
301 302 303 304 305 306 307 | } *tokenType = TK_ILLEGAL; return 1; } /* ** Run the parser on the given SQL string. The parser structure is | | > > > | 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 | } *tokenType = TK_ILLEGAL; return 1; } /* ** Run the parser on the given SQL string. The parser structure is ** passed in. An SQLITE_ status code is returned. If an error occurs ** and pzErrMsg!=NULL then an error message might be written into ** memory obtained from malloc() and *pzErrMsg made to point to that ** error message. Or maybe not. */ int sqliteRunParser(Parse *pParse, char *zSql, char **pzErrMsg){ int nErr = 0; int i; void *pEngine; int once = 1; extern void *sqliteParserAlloc(void*(*)(int)); |
︙ | ︙ |
Changes to src/update.c.
1 | /* | | | < < < | < < < < | < < < < | < | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | /* ** 2001 September 15 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** This file contains C code routines that are called by the parser ** to handle UPDATE statements. ** ** $Id: update.c,v 1.14 2001/09/16 00:13:27 drh Exp $ */ #include "sqliteInt.h" /* ** Process an UPDATE statement. */ void sqliteUpdate( |
︙ | ︙ |
Changes to src/util.c.
1 | /* | | | < < < | < < < < | < < < < | < | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | /* ** 2001 September 15 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** Utility functions used throughout sqlite. ** ** This file contains functions for allocating memory, comparing ** strings, and stuff like that. ** ** $Id: util.c,v 1.25 2001/09/16 00:13:27 drh Exp $ */ #include "sqliteInt.h" #include <stdarg.h> #include <ctype.h> /* ** If malloc() ever fails, this global variable gets set to 1. |
︙ | ︙ |
Changes to src/vdbe.c.
1 | /* | | | < < < | < < < < | < < < < | < | | | > | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | /* ** 2001 September 15 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** The code in this file implements the Virtual Database Engine (VDBE) ** ** The SQL parser generates a program which is then executed by ** the VDBE to do the work of the SQL statement. VDBE programs are ** similar in form to assembly language. The program consists of ** a linear sequence of operations. Each operation has an opcode ** and 3 operands. Operands P1 and P2 are integers. Operand P3 ** is a null-terminated string. The P2 operand must be non-negative. ** Opcodes will typically ignore one or more operands. Many opcodes ** ignore all three operands. ** ** Computation results are stored on a stack. Each entry on the ** stack is either an integer, a null-terminated string, a floating point ** number, or the SQL "NULL" value. An inplicit conversion from one ** type to the other occurs as necessary. ** ** Most of the code in this file is taken up by the sqliteVdbeExec() ** function which does the work of interpreting a VDBE program. ** But other routines are also provided to help in building up ** a program instruction by instruction. ** ** $Id: vdbe.c,v 1.70 2001/09/16 00:13:27 drh Exp $ */ #include "sqliteInt.h" #include <ctype.h> #include <unistd.h> /* ** SQL is translated into a sequence of instructions to be |
︙ | ︙ | |||
1117 1118 1119 1120 1121 1122 1123 | case OP_Goto: { pc = pOp->p2 - 1; break; } /* Opcode: Halt * * * ** | | > > > > | 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 | case OP_Goto: { pc = pOp->p2 - 1; break; } /* Opcode: Halt * * * ** ** Exit immediately. All open cursors, Lists, Sorts, etc are closed ** automatically. ** ** There is an implied Halt instruction inserted at the very end of ** every program. So a jump past the last instruction of the program ** is the same as executing Halt. */ case OP_Halt: { pc = p->nOp-1; break; } /* Opcode: Integer P1 * * |
︙ | ︙ | |||
1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 | /* Opcode: Dup P1 * * ** ** A copy of the P1-th element of the stack ** is made and pushed onto the top of the stack. ** The top of the stack is element 0. So the ** instruction "Dup 0 0 0" will make a copy of the ** top of the stack. */ case OP_Dup: { int i = p->tos - pOp->p1; int j = ++p->tos; VERIFY( if( i<0 ) goto not_enough_stack; ) VERIFY( if( NeedStack(p, p->tos) ) goto no_mem; ) aStack[j] = aStack[i]; | > > | 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 | /* Opcode: Dup P1 * * ** ** A copy of the P1-th element of the stack ** is made and pushed onto the top of the stack. ** The top of the stack is element 0. So the ** instruction "Dup 0 0 0" will make a copy of the ** top of the stack. ** ** Also see the Pull instruction. */ case OP_Dup: { int i = p->tos - pOp->p1; int j = ++p->tos; VERIFY( if( i<0 ) goto not_enough_stack; ) VERIFY( if( NeedStack(p, p->tos) ) goto no_mem; ) aStack[j] = aStack[i]; |
︙ | ︙ | |||
1203 1204 1205 1206 1207 1208 1209 | } /* Opcode: Pull P1 * * ** ** The P1-th element is removed from its current location on ** the stack and pushed back on top of the stack. The ** top of the stack is element 0, so "Pull 0 0 0" is | | > > > | 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 | } /* Opcode: Pull P1 * * ** ** The P1-th element is removed from its current location on ** the stack and pushed back on top of the stack. The ** top of the stack is element 0, so "Pull 0 0 0" is ** a no-op. "Pull 1 0 0" swaps the top two elements of ** the stack. ** ** See also the Dup instruction. */ case OP_Pull: { int from = p->tos - pOp->p1; int to = p->tos; int i; Stack ts; char *tz; |
︙ | ︙ | |||
1779 1780 1781 1782 1783 1784 1785 | ** The lowest entry ** on the stack is the first in the concatenation and the top of ** the stack is the last. After all columns are concatenated, an ** index header is added. The index header consists of P1 16-bit integers ** which hold the offset of the beginning of each column data from the ** beginning of the completed record including the header. ** | | | 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 | ** The lowest entry ** on the stack is the first in the concatenation and the top of ** the stack is the last. After all columns are concatenated, an ** index header is added. The index header consists of P1 16-bit integers ** which hold the offset of the beginning of each column data from the ** beginning of the completed record including the header. ** ** The Column opcode is used to unpack a record manufactured with ** the opcode. */ case OP_MakeRecord: { char *zNewRecord; int nByte; int nField; int i, j; |
︙ | ︙ | |||
1832 1833 1834 1835 1836 1837 1838 | zStack[p->tos] = zNewRecord; break; } /* Opcode: MakeKey P1 P2 * ** ** Convert the top P1 entries of the stack into a single entry suitable | | | | < | 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 | zStack[p->tos] = zNewRecord; break; } /* Opcode: MakeKey P1 P2 * ** ** Convert the top P1 entries of the stack into a single entry suitable ** for use as the key in an index. The top P1 records are ** converted to strings and merged. The null-terminators ** are retained and used as separators. ** The lowest entry in the stack is the first field and the top of the ** stack becomes the last. ** ** If P2 is not zero, then the original entries remain on the stack ** and the new key is pushed on top. If P2 is zero, the original ** data is popped off the stack first then the new key is pushed ** back in its place. |
︙ | ︙ | |||
1952 1953 1954 1955 1956 1957 1958 | break; } /* Opcode: Transaction * * * ** ** Begin a transaction. The transaction ends when a Commit or Rollback ** opcode is encountered or whenever there is an execution error that causes | | > > > > | > > > > > | | | | | | | | 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 | break; } /* Opcode: Transaction * * * ** ** Begin a transaction. The transaction ends when a Commit or Rollback ** opcode is encountered or whenever there is an execution error that causes ** a script to abort. A transaction is not ended by a Halt. ** ** A write lock is obtained on the database file when a transaction is ** started. No other process can read or write the file while the ** transaction is underway. Starting a transaction also creates a ** rollback journal. ** A transaction must be started before any changes can be made to the ** database. */ case OP_Transaction: { rc = sqliteBtreeBeginTrans(pBt); break; } /* Opcode: Commit * * * ** ** Cause all modifications to the database that have been made since the ** last Transaction to actually take effect. No additional modifications ** are allowed until another transaction is started. The Commit instruction ** deletes the journal file and releases the write lock on the database. ** A read lock continues to be held if there are still cursors open. */ case OP_Commit: { rc = sqliteBtreeCommit(pBt); if( rc==SQLITE_OK ){ sqliteCommitInternalChanges(db); }else{ sqliteRollbackInternalChanges(db); } break; } /* Opcode: Rollback * * * ** ** Cause all modifications to the database that have been made since the ** last Transaction to be undone. The database is restored to its state ** before the Transaction opcode was executed. No additional modifications ** are allowed until another transaction is started. ** ** This instruction automatically closes all cursors and releases both ** the read and write locks on the database. */ case OP_Rollback: { rc = sqliteBtreeRollback(pBt); sqliteRollbackInternalChanges(db); break; } /* Opcode: ReadCookie * * * ** ** Read the schema cookie from the database file and push it onto the ** stack. The schema cookie is an integer that is used like a version ** number for the database schema. Everytime the schema changes, the ** cookie changes to a new random value. This opcode is used during ** initialization to read the initial cookie value so that subsequent ** database accesses can verify that the cookie has not changed. ** ** There must be a read-lock on the database (either a transaction ** must be started or there must be an open cursor) before ** executing this instruction. */ case OP_ReadCookie: { int i = ++p->tos; int aMeta[SQLITE_N_BTREE_META]; VERIFY( if( NeedStack(p, p->tos) ) goto no_mem; ) rc = sqliteBtreeGetMeta(pBt, aMeta); aStack[i].i = aMeta[1]; aStack[i].flags = STK_Int; break; } /* Opcode: SetCookie P1 * * ** ** This operation changes the value of the schema cookie on the database. ** The new value is P1. ** ** The schema cookie changes its value whenever the database schema changes. ** That way, other processes can recognize when the schema has changed ** and reread it. ** ** A transaction must be started before executing this opcode. */ case OP_SetCookie: { int aMeta[SQLITE_N_BTREE_META]; rc = sqliteBtreeGetMeta(pBt, aMeta); if( rc==SQLITE_OK ){ aMeta[1] = pOp->p1; rc = sqliteBtreeUpdateMeta(pBt, aMeta); } break; } /* Opcode: VerifyCookie P1 * * ** ** Check the current value of the schema cookie and make sure it is ** equal to P1. If it is not, abort with an SQLITE_SCHEMA error. ** ** The cookie changes its value whenever the database schema changes. ** This operation is used to detect when that the cookie has changed ** and that the current process needs to reread the schema. ** ** Either a transaction needs to have been started or an OP_Open needs ** to be executed (to establish a read lock) before this opcode is ** invoked. */ case OP_VerifyCookie: { |
︙ | ︙ | |||
2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 | ** ** Open a new cursor for the database table whose root page is ** P2 in the main database file. Give the new cursor an identifier ** of P1. The P1 values need not be contiguous but all P1 values ** should be small integers. It is an error for P1 to be negative. ** ** If P2==0 then take the root page number from the top of the stack. ** ** The P3 value is the name of the table or index being opened. ** The P3 value is not actually used by this opcode and may be ** omitted. But the code generator usually inserts the index or ** table name into P3 to make the code easier to read. */ case OP_Open: { | > > > > > > > > > | 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 | ** ** Open a new cursor for the database table whose root page is ** P2 in the main database file. Give the new cursor an identifier ** of P1. The P1 values need not be contiguous but all P1 values ** should be small integers. It is an error for P1 to be negative. ** ** If P2==0 then take the root page number from the top of the stack. ** ** There will be a read lock on the database whenever there is an ** open cursor. If the database was unlocked prior to this instruction ** then a read lock is acquired as part of this instruction. A read ** lock allows other processes to read the database but prohibits ** any other process from modifying the database. The read lock is ** released when all cursors are closed. If this instruction attempts ** to get a read lock but fails, the script terminates with an ** SQLITE_BUSY error code. ** ** The P3 value is the name of the table or index being opened. ** The P3 value is not actually used by this opcode and may be ** omitted. But the code generator usually inserts the index or ** table name into P3 to make the code easier to read. */ case OP_Open: { |
︙ | ︙ | |||
2125 2126 2127 2128 2129 2130 2131 | }while( busy ); break; } /* Opcode: OpenTemp P1 * * ** ** Open a new cursor that points to a table in a temporary database | | | 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 | }while( busy ); break; } /* Opcode: OpenTemp P1 * * ** ** Open a new cursor that points to a table in a temporary database ** file. The temporary file is opened read/write even if the main ** database is read-only. The temporary file is deleted when the ** cursor is closed. */ case OP_OpenTemp: { int i = pOp->p1; Cursor *pCx; VERIFY( if( i<0 ) goto bad_instruction; ) |
︙ | ︙ | |||
2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 | /* Opcode: MoveTo P1 * * ** ** Pop the top of the stack and use its value as a key. Reposition ** cursor P1 so that it points to an entry with a matching key. If ** the table contains no record with a matching key, then the cursor ** is left pointing at a nearby record. */ case OP_MoveTo: { int i = pOp->p1; int tos = p->tos; VERIFY( if( tos<0 ) goto not_enough_stack; ) if( i>=0 && i<p->nCursor && p->aCsr[i].pCursor ){ int res; | > > | 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 | /* Opcode: MoveTo P1 * * ** ** Pop the top of the stack and use its value as a key. Reposition ** cursor P1 so that it points to an entry with a matching key. If ** the table contains no record with a matching key, then the cursor ** is left pointing at a nearby record. ** ** See also: Found, NotFound, Distinct */ case OP_MoveTo: { int i = pOp->p1; int tos = p->tos; VERIFY( if( tos<0 ) goto not_enough_stack; ) if( i>=0 && i<p->nCursor && p->aCsr[i].pCursor ){ int res; |
︙ | ︙ | |||
2200 2201 2202 2203 2204 2205 2206 | POPSTACK; break; } /* Opcode: Fcnt * * * ** ** Push an integer onto the stack which is the total number of | | | | > > | > > | > > | 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 | POPSTACK; break; } /* Opcode: Fcnt * * * ** ** Push an integer onto the stack which is the total number of ** MoveTo opcodes that have been executed by this virtual machine. ** ** This instruction is used to implement the special fcnt() function ** in the SQL dialect that SQLite understands. fcnt() is used for ** testing purposes. */ case OP_Fcnt: { int i = ++p->tos; VERIFY( if( NeedStack(p, p->tos) ) goto no_mem; ) aStack[i].i = p->nFetch; aStack[i].flags = STK_Int; break; } /* Opcode: Distinct P1 P2 * ** ** Use the top of the stack as a key. If a record with that key does ** not exist in the table of cursor P1, then jump to P2. If the record ** does already exist, then fall thru. The cursor is left pointing ** at the record if it exists. The key is not popped from the stack. ** ** This operation is similar to NotFound except that this operation ** does not pop the key from the stack. ** ** See also: Found, NotFound, MoveTo */ /* Opcode: Found P1 P2 * ** ** Use the top of the stack as a key. If a record with that key ** does exist in table of P1, then jump to P2. If the record ** does not exist, then fall thru. The cursor is left pointing ** to the record if it exists. The key is popped from the stack. ** ** See also: Distinct, NotFound, MoveTo */ /* Opcode: NotFound P1 P2 * ** ** Use the top of the stack as a key. If a record with that key ** does not exist in table of P1, then jump to P2. If the record ** does exist, then fall thru. The cursor is left pointing to the ** record if it exists. The key is popped from the stack. ** ** The difference between this operation and Distinct is that ** Distinct does not pop the key from the stack. ** ** See also: Distinct, Found, MoveTo */ case OP_Distinct: case OP_NotFound: case OP_Found: { int i = pOp->p1; int tos = p->tos; int alreadyExists = 0; |
︙ | ︙ | |||
2274 2275 2276 2277 2278 2279 2280 | } break; } /* Opcode: NewRecno P1 * * ** ** Get a new integer record number used as the key to a table. | | | | 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 | } break; } /* Opcode: NewRecno P1 * * ** ** Get a new integer record number used as the key to a table. ** The record number is not previously used as a key in the database ** table that cursor P1 points to. The new record number pushed ** onto the stack. */ case OP_NewRecno: { int i = pOp->p1; int v = 0; if( VERIFY( i<0 || i>=p->nCursor || ) p->aCsr[i].pCursor==0 ){ v = 0; |
︙ | ︙ | |||
2317 2318 2319 2320 2321 2322 2323 | aStack[p->tos].flags = STK_Int; break; } /* Opcode: Put P1 * * ** ** Write an entry into the database file P1. A new entry is | | | 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 | aStack[p->tos].flags = STK_Int; break; } /* Opcode: Put P1 * * ** ** Write an entry into the database file P1. A new entry is ** created if it doesn't already exist or the data for an existing ** entry is overwritten. The data is the value on the top of the ** stack. The key is the next value down on the stack. The stack ** is popped twice by this instruction. */ case OP_Put: { int tos = p->tos; int nos = p->tos-1; |
︙ | ︙ | |||
2352 2353 2354 2355 2356 2357 2358 | /* Opcode: Delete P1 * * ** ** Delete the record at which the P1 cursor is currently pointing. ** ** The cursor will be left pointing at either the next or the previous ** record in the table. If it is left pointing at the next record, then | | | | | 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 | /* Opcode: Delete P1 * * ** ** Delete the record at which the P1 cursor is currently pointing. ** ** The cursor will be left pointing at either the next or the previous ** record in the table. If it is left pointing at the next record, then ** the next Next instruction will be a no-op. Hence it is OK to delete ** a record from within an Next loop. */ case OP_Delete: { int i = pOp->p1; if( VERIFY( i>=0 && i<p->nCursor && ) p->aCsr[i].pCursor!=0 ){ rc = sqliteBtreeDelete(p->aCsr[i].pCursor); } break; } /* Opcode: KeyAsData P1 P2 * ** ** Turn the key-as-data mode for cursor P1 either on (if P2==1) or ** off (if P2==0). In key-as-data mode, the Field opcode pulls ** data off of the key rather than the data. This is useful for ** processing compound selects. */ case OP_KeyAsData: { int i = pOp->p1; if( VERIFY( i>=0 && i<p->nCursor && ) p->aCsr[i].pCursor!=0 ){ p->aCsr[i].keyAsData = pOp->p2; |
︙ | ︙ | |||
2503 2504 2505 2506 2507 2508 2509 | aStack[tos].flags = STK_Int; } break; } /* Opcode: FullKey P1 * * ** | | > > | > | | 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 | aStack[tos].flags = STK_Int; } break; } /* Opcode: FullKey P1 * * ** ** Extract the complete key from the record that cursor P1 is currently ** pointing to and push the key onto the stack as a string. ** ** Compare this opcode to Recno. The Recno opcode extracts the first ** 4 bytes of the key and pushes those bytes onto the stack as an ** integer. This instruction pushes the entire key as a string. */ case OP_FullKey: { int i = pOp->p1; int tos = ++p->tos; BtCursor *pCrsr; VERIFY( if( NeedStack(p, p->tos) ) goto no_mem; ) |
︙ | ︙ | |||
2618 2619 2620 2621 2622 2623 2624 | break; } /* Opcode: NextIdx P1 P2 * ** ** The P1 cursor points to an SQL index for which a BeginIdx operation ** has been issued. This operation retrieves the next record from that | | | | | 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 | break; } /* Opcode: NextIdx P1 P2 * ** ** The P1 cursor points to an SQL index for which a BeginIdx operation ** has been issued. This operation retrieves the next record from that ** cursor and verifies that the key on the record minus the last 4 bytes ** matches the key that was pulled from the stack by the BeginIdx instruction. ** If they match, then the last 4 bytes of the key on the record hold a record ** number and that record number is extracted and pushed on the stack. ** If the keys do not match, there is an immediate jump to instruction P2. */ case OP_NextIdx: { int i = pOp->p1; int tos = ++p->tos; Cursor *pCrsr; |
︙ | ︙ | |||
2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 | break; } /* Opcode: Destroy P1 * * ** ** Delete an entire database table or index whose root page in the database ** file is given by P1. */ case OP_Destroy: { sqliteBtreeDropTable(pBt, pOp->p1); break; } /* Opcode: Clear P1 * * ** ** Delete all contents of the database table or index whose root page | > > | > > > > | < < > > | 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 | break; } /* Opcode: Destroy P1 * * ** ** Delete an entire database table or index whose root page in the database ** file is given by P1. ** ** See also: Clear */ case OP_Destroy: { sqliteBtreeDropTable(pBt, pOp->p1); break; } /* Opcode: Clear P1 * * ** ** Delete all contents of the database table or index whose root page ** in the database file is given by P1. But, unlike Destroy, do not ** remove the table or index from the database file. ** ** See also: Destroy */ case OP_Clear: { sqliteBtreeClearTable(pBt, pOp->p1); break; } /* Opcode: CreateTable * * * ** ** Allocate a new table in the main database file. Push the page number ** for the root page of the new table onto the stack. ** ** The root page number is also written to a memory location which has ** be set up by the parser. The difference between CreateTable and ** CreateIndex is that each writes its root page number into a different ** memory location. This writing of the page number into a memory location ** is used by the SQL parser to record the page number in its internal ** data structures. ** ** See also: CreateIndex */ case OP_CreateTable: { int i = ++p->tos; int pgno; VERIFY( if( NeedStack(p, p->tos) ) goto no_mem; ) if( p->pTableRoot==0 ){ rc = SQLITE_INTERNAL; goto abort_due_to_error; } rc = sqliteBtreeCreateTable(pBt, &pgno); if( rc==SQLITE_OK ){ aStack[i].i = pgno; aStack[i].flags = STK_Int; *p->pTableRoot = pgno; p->pTableRoot = 0; } break; } /* Opcode: CreateIndex P1 * * ** ** Allocate a new Index in the main database file. Push the page number ** for the root page of the new table onto the stack. ** ** The root page number is also written to a memory location which has ** be set up by the parser. The difference between CreateTable and ** CreateIndex is that each writes its root page number into a different ** memory location. This writing of the page number into a memory location ** is used by the SQL parser to record the page number in its internal ** data structures. ** ** See also: CreateTable */ case OP_CreateIndex: { int i = ++p->tos; int pgno; VERIFY( if( NeedStack(p, p->tos) ) goto no_mem; ) if( p->pIndexRoot==0 ){ rc = SQLITE_INTERNAL; |
︙ | ︙ | |||
2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 | break; } /* Opcode: Reorganize P1 * * ** ** Compress, optimize, and tidy up table or index whose root page in the ** database file is P1. */ case OP_Reorganize: { /* This is currently a no-op */ break; } /* Opcode: ListOpen P1 * * ** ** Open a "List" structure used for temporary storage of integer | > > < | | 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 | break; } /* Opcode: Reorganize P1 * * ** ** Compress, optimize, and tidy up table or index whose root page in the ** database file is P1. ** ** In the current implementation, this is a no-op. */ case OP_Reorganize: { /* This is currently a no-op */ break; } /* Opcode: ListOpen P1 * * ** ** Open a "List" structure used for temporary storage of integer ** record numbers. P1 will server as a handle to this list for future ** interactions. If another list with the P1 handle is ** already opened, the prior list is closed and a new one opened ** in its place. */ case OP_ListOpen: { int i = pOp->p1; VERIFY( if( i<0 ) goto bad_instruction; ) |
︙ | ︙ | |||
3000 3001 3002 3003 3004 3005 3006 | ** the string P3. One character from P3 is prepended to each entry. ** The first character of P3 is prepended to the element lowest in ** the stack and the last character of P3 is appended to the top of ** the stack. All stack entries are separated by a \000 character ** in the result. The whole key is terminated by two \000 characters ** in a row. ** | | | 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 | ** the string P3. One character from P3 is prepended to each entry. ** The first character of P3 is prepended to the element lowest in ** the stack and the last character of P3 is appended to the top of ** the stack. All stack entries are separated by a \000 character ** in the result. The whole key is terminated by two \000 characters ** in a row. ** ** See also the MakeKey and MakeIdxKey opcodes. */ case OP_SortMakeKey: { char *zNewKey; int nByte; int nField; int i, j, k; |
︙ | ︙ | |||
3213 3214 3215 3216 3217 3218 3219 | ** ** Read a single line of input from the open file (the file opened using ** FileOpen). If we reach end-of-file, jump immediately to P2. If ** we are able to get another line, split the line apart using P3 as ** a delimiter. There should be P1 fields. If the input line contains ** more than P1 fields, ignore the excess. If the input line contains ** fewer than P1 fields, assume the remaining fields contain an | | | 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 | ** ** Read a single line of input from the open file (the file opened using ** FileOpen). If we reach end-of-file, jump immediately to P2. If ** we are able to get another line, split the line apart using P3 as ** a delimiter. There should be P1 fields. If the input line contains ** more than P1 fields, ignore the excess. If the input line contains ** fewer than P1 fields, assume the remaining fields contain an ** empty strings. */ case OP_FileRead: { int n, eol, nField, i, c, nDelim; char *zDelim, *z; if( p->pFile==0 ) goto fileread_jump; nField = pOp->p1; if( nField<=0 ) goto fileread_jump; |
︙ | ︙ | |||
3297 3298 3299 3300 3301 3302 3303 | fileread_jump: pc = pOp->p2 - 1; break; } /* Opcode: FileColumn P1 * * ** | | | 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 | fileread_jump: pc = pOp->p2 - 1; break; } /* Opcode: FileColumn P1 * * ** ** Push onto the stack the P1-th column of the most recently read line ** from the input file. */ case OP_FileColumn: { int i = pOp->p1; char *z; VERIFY( if( NeedStack(p, p->tos+1) ) goto no_mem; ) if( VERIFY( i>=0 && i<p->nField && ) p->azField ){ |
︙ | ︙ |
Changes to src/vdbe.h.
1 | /* | | | < < < | < < < < | < < < < | < | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | /* ** 2001 September 15 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** Header file for the Virtual DataBase Engine (VDBE) ** ** This header defines the interface to the virtual database engine ** or VDBE. The VDBE implements an abstract machine that runs a ** simple program to access and modify the underlying database. ** ** $Id: vdbe.h,v 1.23 2001/09/16 00:13:27 drh Exp $ */ #ifndef _SQLITE_VDBE_H_ #define _SQLITE_VDBE_H_ #include <stdio.h> /* ** A single VDBE is an opaque structure named "Vdbe". Only routines |
︙ | ︙ |
Changes to src/where.c.
1 | /* | | | < < < | < < < < | < < < < | < | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | /* ** 2001 September 15 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** This module contains C code that generates VDBE code used to process ** the WHERE clause of SQL statements. Also found here are subroutines ** to generate VDBE code to evaluate expressions. ** ** $Id: where.c,v 1.20 2001/09/16 00:13:27 drh Exp $ */ #include "sqliteInt.h" /* ** The query generator uses an array of instances of this structure to ** help it analyze the subexpressions of the WHERE clause. Each WHERE ** clause subexpression is separated from the others by an AND operator. |
︙ | ︙ |
Changes to test/all.test.
|
| | | | < < < < < < < < < < < < < | < > > | > > > > > | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 | # 2001 September 15 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #*********************************************************************** # This file runs all tests. # # $Id: all.test,v 1.10 2001/09/16 00:13:28 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl rename finish_test really_finish_test proc finish_test {} {memleak_check} if {[file exists ./sqlite_test_count]} { set COUNT [exec cat ./sqlite_test_count] } else { set COUNT 3 } # LeakList will hold a list of the number of unfreed mallocs after # each round of the test. This number should be constant. If it # grows, it may mean there is a memory leak in the library. # set LeakList {} set EXCLUDE { all.test quick.test malloc.test } for {set Counter 0} {$Counter<$COUNT && $nErr==0} {incr Counter} { foreach testfile [lsort -dictionary [glob $testdir/*.test]] { set tail [file tail $testfile] if {[lsearch -exact $EXCLUDE $tail]>=0} continue source $testfile } if {[info exists Leak]} { lappend LeakList $Leak } } |
︙ | ︙ |
Changes to test/btree.test.
|
| | | | < < < < < < < < < < < < < | < > > | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | # 2001 September 15 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #*********************************************************************** # This file implements regression tests for SQLite library. The # focus of this script is btree database backend # # $Id: btree.test,v 1.9 2001/09/16 00:13:28 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl if {[info commands btree_open]!=""} { |
︙ | ︙ |
Changes to test/btree2.test.
|
| | | | < < < < < < < < < < < < < | < > > | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | # 2001 September 15 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #*********************************************************************** # This file implements regression tests for SQLite library. The # focus of this script is btree database backend # # $Id: btree2.test,v 1.7 2001/09/16 00:13:28 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl if {[info commands btree_open]!=""} { |
︙ | ︙ | |||
284 285 286 287 288 289 290 291 | # Repeat this test sequence on database of various sizes # set testno 2 foreach {N L} { 10 2 50 2 200 3 } { | > < | 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 | # Repeat this test sequence on database of various sizes # set testno 2 foreach {N L} { 10 2 50 2 200 3 2000 5 } { puts "**** N=$N L=$L ****" set hash [md5file test2.bt] do_test btree2-$testno.1 [subst -nocommands { set ::c2 [btree_cursor $::b 2] set ::c3 [btree_cursor $::b 3] set ::c4 [btree_cursor $::b 4] set ::c5 [btree_cursor $::b 5] |
︙ | ︙ |
Changes to test/copy.test.
|
| | | | < < < < < < < < < < < < < | < > > | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | # 2001 September 15 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #*********************************************************************** # This file implements regression tests for SQLite library. The # focus of this file is testing the COPY statement. # # $Id: copy.test,v 1.6 2001/09/16 00:13:28 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl # Create a file of data from which to copy. # set f [open data1.txt w] |
︙ | ︙ |
Changes to test/delete.test.
|
| | | | < < < < < < < < < < < < < | < > > | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | # 2001 September 15 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #*********************************************************************** # This file implements regression tests for SQLite library. The # focus of this file is testing the DELETE FROM statement. # # $Id: delete.test,v 1.9 2001/09/16 00:13:28 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl # Try to delete from a non-existant table. # do_test delete-1.1 { |
︙ | ︙ |
Changes to test/expr.test.
|
| | | | < < < < < < < < < < < < < | < > > | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | # 2001 September 15 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #*********************************************************************** # This file implements regression tests for SQLite library. The # focus of this file is testing expressions. # # $Id: expr.test,v 1.15 2001/09/16 00:13:28 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl # Create a table to work with. # execsql {CREATE TABLE test1(i1 int, i2 int, r1 real, r2 real, t1 text, t2 text)} |
︙ | ︙ |
Changes to test/func.test.
|
| | | | < < < < < < < < < < < < < | < > > | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | # 2001 September 15 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #*********************************************************************** # This file implements regression tests for SQLite library. The # focus of this file is testing built-in functions. # # $Id: func.test,v 1.4 2001/09/16 00:13:28 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl # Create a table to work with. # do_test func-0.0 { |
︙ | ︙ |
Changes to test/in.test.
|
| | | | < < < < < < < < < < < < < | < > > | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | # 2001 September 15 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #*********************************************************************** # This file implements regression tests for SQLite library. The # focus of this file is testing the IN and BETWEEN operator. # # $Id: in.test,v 1.5 2001/09/16 00:13:28 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl # Generate the test data we will need for the first squences of tests. # do_test in-1.0 { |
︙ | ︙ |
Changes to test/index.test.
|
| | | | < < < < < < < < < < < < < | < > > | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | # 2001 September 15 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #*********************************************************************** # This file implements regression tests for SQLite library. The # focus of this file is testing the CREATE INDEX statement. # # $Id: index.test,v 1.12 2001/09/16 00:13:28 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl # Create a basic index and verify it is added to sqlite_master # do_test index-1.1 { |
︙ | ︙ |
Changes to test/insert.test.
|
| | | | < < < < < < < < < < < < < | < > > | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | # 2001 September 15 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #*********************************************************************** # This file implements regression tests for SQLite library. The # focus of this file is testing the INSERT statement. # # $Id: insert.test,v 1.6 2001/09/16 00:13:28 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl # Try to insert into a non-existant table. # do_test insert-1.1 { |
︙ | ︙ |
Changes to test/insert2.test.
|
| | | | < < < < < < < < < < < < < | < > > | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | # 2001 September 15 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #*********************************************************************** # This file implements regression tests for SQLite library. The # focus of this file is testing the INSERT statement that takes is # result from a SELECT. # # $Id: insert2.test,v 1.4 2001/09/16 00:13:28 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl # Create some tables with data that we can select against # do_test insert2-1.0 { |
︙ | ︙ |
Changes to test/lock.test.
|
| | | | < < < < < < < < < < < < < | < > > | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | # 2001 September 15 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #*********************************************************************** # This file implements regression tests for SQLite library. The # focus of this script is database locks. # # $Id: lock.test,v 1.10 2001/09/16 00:13:28 drh Exp $ if {0} { set testdir [file dirname $argv0] source $testdir/tester.tcl # Create a largish table |
︙ | ︙ |
Changes to test/main.test.
|
| | | | < < < < < < < < < < < < < | < > > | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | # 2001 September 15 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #*********************************************************************** # This file implements regression tests for SQLite library. The # focus of this file is exercising the code in main.c. # # $Id: main.test,v 1.8 2001/09/16 00:13:28 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl # Tests of the sqlite_complete() function. # do_test main-1.1 { |
︙ | ︙ |
Changes to test/malloc.test.
|
| | | | < < < < < < < < < < < < < | < > > | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | # 2001 September 15 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #*********************************************************************** # This file attempts to check the library in an out-of-memory situation. # When compiled with -DMEMORY_DEBUG=1, the SQLite library accepts a special # command (--malloc-fail=N) which causes the N-th malloc to fail. This # special feature is used to see what happens in the library if a malloc # were to really fail due to an out-of-memory situation. # # $Id: malloc.test,v 1.3 2001/09/16 00:13:28 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl # Only run these tests if memory debugging is turned on. # if {[info command sqlite_malloc_fail]==""} { |
︙ | ︙ |
Changes to test/pager.test.
|
| | | | < < < < < < < < < < < < < | < > > | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | # 2001 September 15 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #*********************************************************************** # This file implements regression tests for SQLite library. The # focus of this script is page cache subsystem. # # $Id: pager.test,v 1.10 2001/09/16 00:13:28 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl if {[info commands pager_open]!=""} { |
︙ | ︙ |
Changes to test/printf.test.
|
| | | | < < < < < < < < < < < < < | < > > | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | # 2001 September 15 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #*********************************************************************** # This file implements regression tests for SQLite library. The # focus of this file is testing the sqlite_*_printf() interface. # # $Id: printf.test,v 1.3 2001/09/16 00:13:28 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl set n 1 foreach v {1 2 5 10 99 100 1000000 999999999 0 -1 -2 -5 -10 -99 -100 -9999999} { do_test printf-1.$n.1 [subst { |
︙ | ︙ |
Added test/quick.test.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | # 2001 September 15 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #*********************************************************************** # This file runs all tests. # # $Id: quick.test,v 1.1 2001/09/16 00:13:28 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl rename finish_test really_finish_test proc finish_test {} {} set EXCLUDE { all.test quick.test btree2.test } foreach testfile [lsort -dictionary [glob $testdir/*.test]] { set tail [file tail $testfile] if {[lsearch -exact $EXCLUDE $tail]>=0} continue source $testfile } really_finish_test |
Changes to test/quote.test.
|
| | | | < < < < < < < < < < < < < | < > > | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | # 2001 September 15 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #*********************************************************************** # This file implements regression tests for SQLite library. The # focus of this file is the ability to specify table and column names # as quoted strings. # # $Id: quote.test,v 1.2 2001/09/16 00:13:28 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl # Create a table with a strange name and with strange column names. # do_test quote-1.0 { |
︙ | ︙ |
Changes to test/rowid.test.
|
| | | | < < < < < < < < < < < < < | < > > | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | # 2001 September 15 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #*********************************************************************** # This file implements regression tests for SQLite library. The # focus of this file is testing the magic ROWID column that is # found on all tables. # # $Id: rowid.test,v 1.4 2001/09/16 00:13:28 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl # Basic ROWID functionality tests. # do_test rowid-1.1 { |
︙ | ︙ |
Changes to test/select1.test.
|
| | | | < < < < < < < < < < < < < | < > > | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | # 2001 September 15 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #*********************************************************************** # This file implements regression tests for SQLite library. The # focus of this file is testing the SELECT statement. # # $Id: select1.test,v 1.10 2001/09/16 00:13:28 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl # Try to select on a non-existant table. # do_test select1-1.1 { |
︙ | ︙ |
Changes to test/select2.test.
|
| | | | < < < < < < < < < < < < < | < > > | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | # 2001 September 15 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #*********************************************************************** # This file implements regression tests for SQLite library. The # focus of this file is testing the SELECT statement. # # $Id: select2.test,v 1.14 2001/09/16 00:13:28 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl # Create a table with some data # execsql {CREATE TABLE tbl1(f1 int, f2 int)} |
︙ | ︙ |
Changes to test/select3.test.
|
| | | | < < < < < < < < < < < < < | < > > | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | # 2001 September 15 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #*********************************************************************** # This file implements regression tests for SQLite library. The # focus of this file is testing aggregate functions and the # GROUP BY and HAVING clauses of SELECT statements. # # $Id: select3.test,v 1.3 2001/09/16 00:13:28 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl # Build some test data # do_test select3-1.0 { |
︙ | ︙ |
Changes to test/select4.test.
|
| | | | < < < < < < < < < < < < < | < > > | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | # 2001 September 15 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #*********************************************************************** # This file implements regression tests for SQLite library. The # focus of this file is testing UNION, INTERSECT and EXCEPT operators # in SELECT statements. # # $Id: select4.test,v 1.4 2001/09/16 00:13:28 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl # Build some test data # set fd [open data1.txt w] |
︙ | ︙ |
Changes to test/select5.test.
|
| | | | < < < < < < < < < < < < < | < > > | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | # 2001 September 15 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #*********************************************************************** # This file implements regression tests for SQLite library. The # focus of this file is testing aggregate functions and the # GROUP BY and HAVING clauses of SELECT statements. # # $Id: select5.test,v 1.5 2001/09/16 00:13:28 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl # Build some test data # set fd [open data1.txt w] |
︙ | ︙ |
Changes to test/sort.test.
|
| | | | < < < < < < < < < < < < < | < > > | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | # 2001 September 15 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #*********************************************************************** # This file implements regression tests for SQLite library. The # focus of this file is testing the CREATE TABLE statement. # # $Id: sort.test,v 1.3 2001/09/16 00:13:28 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl # Create a bunch of data to sort against # do_test sort-1.0 { |
︙ | ︙ |
Changes to test/subselect.test.
|
| | | | < < < < < < < < < < < < < | < > > | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | # 2001 September 15 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #*********************************************************************** # This file implements regression tests for SQLite library. The # focus of this file is testing SELECT statements that are part of # expressions. # # $Id: subselect.test,v 1.4 2001/09/16 00:13:28 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl # Basic sanity checking. Try a simple subselect. # do_test subselect-1.1 { |
︙ | ︙ |
Changes to test/table.test.
|
| | | | < < < < < < < < < < < < < | < > > | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | # 2001 September 15 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #*********************************************************************** # This file implements regression tests for SQLite library. The # focus of this file is testing the CREATE TABLE statement. # # $Id: table.test,v 1.12 2001/09/16 00:13:28 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl # Create a basic table and verify it is added to sqlite_master # do_test table-1.1 { |
︙ | ︙ |
Changes to test/tableapi.test.
|
| | | | < < < < < < < < < < < < < | < > > | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | # 2001 September 15 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #*********************************************************************** # This file implements regression tests for SQLite library. The # focus of this file is testing the sqlite_exec_printf() and # sqlite_get_table_printf() APIs. # # $Id: tableapi.test,v 1.3 2001/09/16 00:13:28 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl do_test tableapi-1.0 { set ::dbx [sqlite_open testdb] catch {sqlite_exec_printf $::dbx {DROP TABLE xyz} {}} |
︙ | ︙ |
Changes to test/tclsqlite.test.
|
| | | | < < < < < < < < < < < < < | < > > | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | # 2001 September 15 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #*********************************************************************** # This file implements regression tests for TCL interface to the # SQLite library. # # Actually, all tests are based on the TCL interface, so the main # interface is pretty well tested. This file contains some addition # tests for fringe issues that the main test suite does not cover. # # $Id: tclsqlite.test,v 1.2 2001/09/16 00:13:28 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl # Check the error messages generated by tclsqlite # do_test tcl-1.1 { |
︙ | ︙ |
Changes to test/tester.tcl.
|
| | | | < < < < < < < < < < < < < | < > > | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | # 2001 September 15 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #*********************************************************************** # This file implements some common TCL routines used for regression # testing the SQLite library # # $Id: tester.tcl,v 1.18 2001/09/16 00:13:28 drh Exp $ # Make sure tclsqlite was compiled correctly. Abort now with an # error message if not. # if {[sqlite -tcl-uses-utf]} { if {"\u1234"=="u1234"} { puts stderr "***** BUILD PROBLEM *****" |
︙ | ︙ |
Changes to test/trans.test.
|
| | | | < < < < < < < < < < < < < | < > > | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | # 2001 September 15 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #*********************************************************************** # This file implements regression tests for SQLite library. The # focus of this script is database locks. # # $Id: trans.test,v 1.4 2001/09/16 00:13:28 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl if {0} { |
︙ | ︙ |
Changes to test/update.test.
|
| | | | < < < < < < < < < < < < < | < > > | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | # 2001 September 15 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #*********************************************************************** # This file implements regression tests for SQLite library. The # focus of this file is testing the UPDATE statement. # # $Id: update.test,v 1.6 2001/09/16 00:13:28 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl # Try to update an non-existent table # do_test update-1.1 { |
︙ | ︙ |
Changes to test/vacuum.test.
|
| | | | < < < < < < < < < < < < < | < > > | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | # 2001 September 15 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #*********************************************************************** # This file implements regression tests for SQLite library. The # focus of this file is testing the VACUUM statement. # # $Id: vacuum.test,v 1.6 2001/09/16 00:13:28 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl if {0} { # Try to vacuum a non-existant table. |
︙ | ︙ |
Changes to test/where.test.
|
| | | | < < < < < < < < < < < < < | < > > | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | # 2001 September 15 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #*********************************************************************** # This file implements regression tests for SQLite library. The # focus of this file is testing the use of indices in WHERE clases. # # $Id: where.test,v 1.3 2001/09/16 00:13:28 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl # Build some test data # do_test where-1.0 { |
︙ | ︙ |
Changes to tool/lemon.c.
1 | /* | < < | < < < < < < < < < < < < < < < < < | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 | /* ** This file contains all sources (including headers) to the LEMON ** LALR(1) parser generator. The sources have been combined into a ** single file to make it easy to include LEMON in the source tree ** and Makefile of another program. ** ** The author of this program disclaims copyright. */ #include <stdio.h> #include <varargs.h> #include <string.h> #include <ctype.h> extern void qsort(); |
︙ | ︙ | |||
1194 1195 1196 1197 1198 1199 1200 | {OPT_FLAG,0,0,0} }; int i; struct lemon lem; OptInit(argv,options,stderr); if( version ){ | | < < < | 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 | {OPT_FLAG,0,0,0} }; int i; struct lemon lem; OptInit(argv,options,stderr); if( version ){ printf("Lemon version 1.0\n"); exit(0); } if( OptNArgs()!=1 ){ fprintf(stderr,"Exactly one filename argument is required.\n"); exit(1); } lem.errorcnt = 0; |
︙ | ︙ |
Changes to tool/lempar.c.
1 | /* Driver template for the LEMON parser generator. | | < < < < < < < < < < < < < < < < < | 1 2 3 4 5 6 7 8 9 | /* Driver template for the LEMON parser generator. ** The author disclaims copyright to this source code. */ /* First off, code is include which follows the "include" declaration ** in the input file. */ #include <stdio.h> %% /* Next is all token values, in a form suitable for use by makeheaders. ** This section will be null unless lemon is run with the -m switch. |
︙ | ︙ |
Changes to www/arch.fig.
1 | #FIG 3.2 | | | | < | | | | > | | | > > > > | | | | < | | > | | | | | | | | > > | > | | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 | #FIG 3.2 Portrait Center Inches Letter 100.00 Single -2 1200 2 2 2 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 5 2550 450 4875 450 4875 1275 2550 1275 2550 450 2 1 0 3 0 7 100 0 -1 0.000 0 0 -1 1 0 2 1 1 3.00 75.00 135.00 3675 8550 3675 9075 2 2 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 5 2550 9075 4875 9075 4875 9900 2550 9900 2550 9075 2 1 0 3 0 7 100 0 -1 0.000 0 0 -1 1 0 2 1 1 3.00 75.00 135.00 3675 7200 3675 7725 2 2 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 5 2550 7725 4875 7725 4875 8550 2550 8550 2550 7725 2 1 0 3 0 7 100 0 -1 0.000 0 0 -1 1 0 2 1 1 3.00 75.00 135.00 3675 5775 3675 6300 2 2 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 5 2550 6300 4875 6300 4875 7200 2550 7200 2550 6300 2 2 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 5 2550 4500 4875 4500 4875 5775 2550 5775 2550 4500 2 1 0 3 0 7 100 0 -1 0.000 0 0 -1 1 0 2 1 1 3.00 75.00 135.00 3675 3975 3675 4500 2 1 0 3 0 7 100 0 -1 0.000 0 0 -1 1 0 2 1 1 3.00 75.00 135.00 3675 2625 3675 3150 2 2 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 5 2550 3150 4875 3150 4875 3975 2550 3975 2550 3150 2 1 0 3 0 7 100 0 -1 0.000 0 0 -1 1 0 2 1 1 3.00 75.00 135.00 3675 1275 3675 1800 2 2 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 5 2550 1800 4875 1800 4875 2625 2550 2625 2550 1800 4 1 0 100 0 0 20 0.0000 4 195 1020 3675 750 Interface\001 4 1 0 100 0 0 14 0.0000 4 195 2040 3675 1125 main.c table.c tclsqlite.c\001 4 1 0 100 0 0 20 0.0000 4 195 1920 3675 6675 Virtual Machine\001 4 1 0 100 0 0 14 0.0000 4 150 570 3675 7050 vdbe.c\001 4 1 0 100 0 0 20 0.0000 4 195 1830 3675 4875 Code Generator\001 4 1 0 100 0 0 14 0.0000 4 195 1860 3675 5175 build.c delete.c expr.c\001 4 1 0 100 0 0 14 0.0000 4 195 2115 3675 5400 insert.c select.c update.c\001 4 1 0 100 0 0 14 0.0000 4 150 705 3675 5625 where.c\001 4 1 0 100 0 0 20 0.0000 4 195 735 3675 3450 Parser\001 4 1 0 100 0 0 20 0.0000 4 195 1140 3675 2100 Tokenizer\001 4 1 0 100 0 0 14 0.0000 4 150 870 3675 2475 tokenize.c\001 4 1 0 100 0 0 20 0.0000 4 255 1350 3675 9375 Page Cache\001 4 1 0 100 0 0 14 0.0000 4 150 630 3675 3825 parse.y\001 4 1 0 100 0 0 14 0.0000 4 150 600 3675 8400 btree.c\001 4 1 0 100 0 0 14 0.0000 4 150 645 3675 9750 pager.c\001 4 1 0 100 0 0 20 0.0000 4 195 1620 3675 8025 B-tree Driver\001 |
Changes to www/arch.png.
cannot compute difference between binary files
Changes to www/arch.tcl.
1 2 3 | # # Run this Tcl script to generate the sqlite.html file. # | | | 1 2 3 4 5 6 7 8 9 10 11 | # # Run this Tcl script to generate the sqlite.html file. # set rcsid {$Id: arch.tcl,v 1.4 2001/09/16 00:13:29 drh Exp $} puts {<html> <head> <title>Architecture of SQLite</title> </head> <body bgcolor=white> <h1 align=center> |
︙ | ︙ | |||
108 109 110 111 112 113 114 | up to three additional operands.</p> <p>The virtual machine is entirely contained in a single source file <b>vdbe.c</b>. The virtual machine also has its own header file <b>vdbe.h</b> that defines an interface between the virtual machine and the rest of the SQLite library.</p> | | | | | | | | | | | > > > > | > | 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 | up to three additional operands.</p> <p>The virtual machine is entirely contained in a single source file <b>vdbe.c</b>. The virtual machine also has its own header file <b>vdbe.h</b> that defines an interface between the virtual machine and the rest of the SQLite library.</p> <h2>B-tree Driver</h2> <p>An SQLite database is maintained on disk using a B-tree implementation found in the <b>btree.c</b> 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.</p> <h2>Page Cache</h2> <p>The page cache 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 changes and the page cache handles all the messy details of making sure the requests are handled quickly, safely, and efficiently.</p> } puts { <br clear="both" /> <p><hr /></p> <p><a href="index.html"><img src="/goback.jpg" border=0 /> Back to the SQLite Home Page</a> </p> </body></html>} |
Changes to www/changes.tcl.
︙ | ︙ | |||
12 13 14 15 16 17 18 19 20 21 22 23 24 25 | } proc chng {date desc} { puts "<DT><B>$date</B></DT>" puts "<DD><P><UL>$desc</UL></P></DD>" } chng {2001 Jul 23 (1.0.32)} { <li>Pager and btree subsystems removed. These will be used in a follow-on SQL server library named "SQLus".</li> <li>Add the ability to use quoted strings as table and column names in expressions.</li> } | > > > > > > > > > > > | 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | } proc chng {date desc} { puts "<DT><B>$date</B></DT>" puts "<DD><P><UL>$desc</UL></P></DD>" } chng {2001 Sep 15 (2.0.0)} { <li>Initial release of version 2.0. The idea of renaming the library to "SQLus" was abandoned in favor of keeping the "SQLite" name and bumping the major version number.</li> <li>The pager and btree subsystems added back. They are now the only available backend.</li> <li>The Dbbe abstraction and the GDBM and memory drivers were removed.</li> <li>Copyright on all code was disclaimed. The library is now in the public domain.</li> } chng {2001 Jul 23 (1.0.32)} { <li>Pager and btree subsystems removed. These will be used in a follow-on SQL server library named "SQLus".</li> <li>Add the ability to use quoted strings as table and column names in expressions.</li> } |
︙ | ︙ |
Changes to www/index.tcl.
1 2 3 | # # Run this TCL script to generate HTML for the index.html file. # | | | < < < | | | | | | < | < < < | | < | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 | # # Run this TCL script to generate HTML for the index.html file. # set rcsid {$Id: index.tcl,v 1.38 2001/09/16 00:13:29 drh Exp $} puts {<html> <head><title>SQLite: An SQL Database Library Built Atop GDBM</title></head> <body bgcolor=white> <h1 align=center>SQLite: An SQL Database Library Built Atop <a href="http://www.gnu.org/software/gdbm/gdbm.html">GDBM</a></h1> <p align=center>} puts "This page was last modified on [lrange $rcsid 3 4] GMT<br>" set vers [lindex $argv 0] puts "The latest SQLite version is <b>$vers</b>" puts " created on [exec cat last_change] GMT" puts {</p>} puts {<h2>Introduction</h2> <p>SQLite is a C library that implements an SQL database engine. Programs that link with the SQLite library can have SQL database access without running a separate RDBMS process. The distribution comes with a standalone command-line access program (<a href="sqlite.html">sqlite</a>) that can be used to administer an SQLite database and which serves as an example of how to use the SQLite library.</p> <h2>Features</h2> <p><ul> <li>Implements a large subset of SQL92.</li> <li>A complete SQL database (with multiple tables and indices) is stored in a single disk file.</li> <li>Atomic commit and rollback protect data integrity.</li> <li>Small memory footprint: about 12000 lines of C code.</li> <li>Very simple <a href="c_interface.html">C/C++ interface</a> requires the use of only three functions and one opaque structure.</li> <li>A TCL interface to the library is included.</li> <li>A TCL-based test suite provides near 100% code coverage.</li> <li>Self-contained: no external dependencies.</li> <li>Built and tested under Linux, HPUX, and WinNT.</li> </ul> </p> <h2>Current Status</h2> <p>A <a href="changes.html">change history</a> is available online. |
︙ | ︙ | |||
69 70 71 72 73 74 75 | But it only ignores case for 7-bit Latin characters. The case of 8-bit iso8859 characters or UTF-8 characters is signification. Hence, <b>'a' LIKE 'A'</b> returns TRUE but <b>'æ' LIKE 'Æ'</b> returns FALSE. </p></li> </ul> | < < < < | 61 62 63 64 65 66 67 68 69 70 71 72 73 74 | But it only ignores case for 7-bit Latin characters. The case of 8-bit iso8859 characters or UTF-8 characters is signification. Hence, <b>'a' LIKE 'A'</b> returns TRUE but <b>'æ' LIKE 'Æ'</b> returns FALSE. </p></li> </ul> <h2>Documentation</h2> <p>The following documentation is currently available:</p> <p><ul> <li>Information on the <a href="sqlite.html">sqlite</a> command-line utility.</li> |
︙ | ︙ |