1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-30 19:03:16 +03:00

Comment updates most. Also some small changes to the VDBE. (CVS 339)

FossilOrigin-Name: 9b0be4fcc1cbca69f5fee906f86dfb36a323fe84
This commit is contained in:
drh
2002-01-06 17:07:40 +00:00
parent c6b52df32d
commit aacc543e23
12 changed files with 99 additions and 74 deletions

View File

@ -1,5 +1,5 @@
C An\sattempt\sto\sdelete\sa\ssingle\srow\susing\sa\sWHERE\sclause\sthat\sspecifies\nthe\srowid\swould\sresult\sin\san\serror\sif\sthe\srowid\sdid\snot\sexist.\s\sThis\nproblem\shas\sbeen\sresolved.\s(CVS\s338) C Comment\supdates\smost.\s\sAlso\ssome\ssmall\schanges\sto\sthe\sVDBE.\s(CVS\s339)
D 2002-01-04T03:09:29 D 2002-01-06T17:07:40
F Makefile.in 352fed589f09dd94347e0bb391d047118ebd6105 F Makefile.in 352fed589f09dd94347e0bb391d047118ebd6105
F Makefile.template c88ffcb9c339e718f434d0c7f045bcd7eea125af F Makefile.template c88ffcb9c339e718f434d0c7f045bcd7eea125af
F README a4c0ba11354ef6ba0776b400d057c59da47a4cc0 F README a4c0ba11354ef6ba0776b400d057c59da47a4cc0
@ -23,24 +23,24 @@ F src/btree.c c796e387da340cb628dc1e41f684fc20253f561e
F src/btree.h 9ead7f54c270d8a554e59352ca7318fdaf411390 F src/btree.h 9ead7f54c270d8a554e59352ca7318fdaf411390
F src/build.c 6c01002e98204ad2b993d0d043ee56c8c7dc8692 F src/build.c 6c01002e98204ad2b993d0d043ee56c8c7dc8692
F src/delete.c f7690efc09ad6a2f1f3f0490e1b0cbb676bb95cf F src/delete.c f7690efc09ad6a2f1f3f0490e1b0cbb676bb95cf
F src/expr.c fcdb7416e502cb7e26b933ccd44b0baff5b78420 F src/expr.c 8169261ac56e96c860407a8773ca10b779e32328
F src/hash.c 6f1a7712ae3aac8351662969aec5693740a2fbf7 F src/hash.c 838a6f2af547dfdc5ff2b438e8f981ea4b74f224
F src/hash.h a5f5b3ce2d086a172c5879b0b06a27a82eac9fac F src/hash.h a5f5b3ce2d086a172c5879b0b06a27a82eac9fac
F src/insert.c 7b36ce2e0b555d9d12bbbdbcd579728ad518ec80 F src/insert.c 813c37719866c583e6ca7660f94f10230f4e385d
F src/main.c 00a9f5603e130fc0b1a05f731731c9c99ebdc2dc F src/main.c 567e472a1ca22f7d9970b1f96b9be91d45ccd7e2
F src/md5.c 52f677bfc590e09f71d07d7e327bd59da738d07c F src/md5.c 52f677bfc590e09f71d07d7e327bd59da738d07c
F src/os.c 07882cde5c61f26751b8ee76fd84726c1f7e453c F src/os.c 07882cde5c61f26751b8ee76fd84726c1f7e453c
F src/os.h 00a18e0ae1139a64f1d3ead465ae2b9ff43f3db2 F src/os.h 00a18e0ae1139a64f1d3ead465ae2b9ff43f3db2
F src/pager.c dde0eb5bf9af0ac0ff8a4429b2bee2aec2194ec9 F src/pager.c ad8a3574d88b3b2d9048206d00ebeaac5ef83fe5
F src/pager.h f78d064c780855ff70beacbeba0e2324471b26fe F src/pager.h f78d064c780855ff70beacbeba0e2324471b26fe
F src/parse.y f050644e7a2586227686e8c1709aa2662b9bcf9c F src/parse.y f3fc4fb5766393003577bd175eb611495f6efd9f
F src/printf.c 300a90554345751f26e1fc0c0333b90a66110a1d F src/printf.c 300a90554345751f26e1fc0c0333b90a66110a1d
F src/random.c 2a9cc2c9716d14815fd4c2accf89d87a1143e46b F src/random.c 2a9cc2c9716d14815fd4c2accf89d87a1143e46b
F src/select.c bddd8b5d07ffdae0d798c10b20dc7167469a3904 F src/select.c bddd8b5d07ffdae0d798c10b20dc7167469a3904
F src/shell.c 407095aaeeae78f42deb3e846b1ad77f8ed3b4ef F src/shell.c f8008f0607f9523ca0f9562b8975c1bcc427d2b3
F src/shell.tcl 27ecbd63dd88396ad16d81ab44f73e6c0ea9d20e F src/shell.tcl 27ecbd63dd88396ad16d81ab44f73e6c0ea9d20e
F src/sqlite.h.in a4c11d38d62b1bfbd50a5804edee8ca54c1adc9b F src/sqlite.h.in a4c11d38d62b1bfbd50a5804edee8ca54c1adc9b
F src/sqliteInt.h d2bfc012fb2c91652d67401e5d7a646a0c30a675 F src/sqliteInt.h 5b613b2c30965051135641e98e41b066cc0f8245
F src/table.c c89698bd5bb4b8d14722d6ee7e9be014c383d24a F src/table.c c89698bd5bb4b8d14722d6ee7e9be014c383d24a
F src/tclsqlite.c b82e4faeae89fdb7304b3c970979ade299336a1f F src/tclsqlite.c b82e4faeae89fdb7304b3c970979ade299336a1f
F src/test1.c 41eabe255970ef947263b94145c9b2766bab8675 F src/test1.c 41eabe255970ef947263b94145c9b2766bab8675
@ -49,9 +49,9 @@ F src/test3.c d6775f95fd91f5b3cf0e2382a28e5aaeb68f745b
F src/tokenize.c 830e9ef684334070a26583d94770bb869e2727bf F src/tokenize.c 830e9ef684334070a26583d94770bb869e2727bf
F src/update.c f9f48e78c13c79e32a55840414bea84479f9848d F src/update.c f9f48e78c13c79e32a55840414bea84479f9848d
F src/util.c 8e9ca72d8288cae39c57c6f397abd14a56b14a38 F src/util.c 8e9ca72d8288cae39c57c6f397abd14a56b14a38
F src/vdbe.c 90a561f7b9bd8711dd01dbdc491b8eff134af476 F src/vdbe.c b27b256a5930da1e8fc347a272357be72de0f853
F src/vdbe.h e5cc6fb13d1905a4339db4d6dba4ab393c0765fa F src/vdbe.h e5cc6fb13d1905a4339db4d6dba4ab393c0765fa
F src/where.c d673265cad96f790923210707b45fdcaec9408f1 F src/where.c ed7343344a30d62eb91464f1580490b80a6275ac
F test/all.test 2a51e5395ac7c2c539689b123b9782a05e3837fe F test/all.test 2a51e5395ac7c2c539689b123b9782a05e3837fe
F test/bigrow.test 8ab252dba108f12ad64e337b0f2ff31a807ac578 F test/bigrow.test 8ab252dba108f12ad64e337b0f2ff31a807ac578
F test/btree.test 6ab4dc5f595905a276ef588fad3c9236dc07a47b F test/btree.test 6ab4dc5f595905a276ef588fad3c9236dc07a47b
@ -119,7 +119,7 @@ F www/speed.tcl 83457b2bf6bb430900bd48ca3dd98264d9a916a5
F www/sqlite.tcl 8b5884354cb615049aed83039f8dfe1552a44279 F www/sqlite.tcl 8b5884354cb615049aed83039f8dfe1552a44279
F www/tclsqlite.tcl 880ef67cb4f2797b95bf1368fc4e0d8ca0fda956 F www/tclsqlite.tcl 880ef67cb4f2797b95bf1368fc4e0d8ca0fda956
F www/vdbe.tcl 2013852c27a02a091d39a766bc87cff329f21218 F www/vdbe.tcl 2013852c27a02a091d39a766bc87cff329f21218
P 18e606f7486eb3a4ab128504d88a44f53d39e5b2 P 011be9a9d2632d261489005d97c69b0a0bc5a108
R 0880ebdecbc9a3b9787a721d544d5701 R 6344d21046bf26426615521a28ec7ddb
U drh U drh
Z cf2abd860be64f6e25eafc52151b0f16 Z d9e4a308acd11d4e3b3d3caeececa822

View File

@ -1 +1 @@
011be9a9d2632d261489005d97c69b0a0bc5a108 9b0be4fcc1cbca69f5fee906f86dfb36a323fe84

View File

@ -12,7 +12,7 @@
** This file contains routines used for analyzing expressions and ** This file contains routines used for analyzing expressions and
** for generating VDBE code that evaluates expressions in SQLite. ** for generating VDBE code that evaluates expressions in SQLite.
** **
** $Id: expr.c,v 1.36 2002/01/04 03:09:30 drh Exp $ ** $Id: expr.c,v 1.37 2002/01/06 17:07:40 drh Exp $
*/ */
#include "sqliteInt.h" #include "sqliteInt.h"
@ -49,7 +49,9 @@ static int isConstant(Expr *p){
** These operators have to be processed before column names are ** These operators have to be processed before column names are
** resolved because each such operator increments pParse->nTab ** resolved because each such operator increments pParse->nTab
** to reserve cursor numbers for its own use. But pParse->nTab ** to reserve cursor numbers for its own use. But pParse->nTab
** needs to be constant once we begin resolving column names. ** needs to be constant once we begin resolving column names. For
** that reason, this procedure needs to be called on every expression
** before sqliteExprResolveIds() is called on any expression.
** **
** Actually, the processing of IN-SELECT is only started by this ** Actually, the processing of IN-SELECT is only started by this
** routine. This routine allocates a cursor number to the IN-SELECT ** routine. This routine allocates a cursor number to the IN-SELECT
@ -86,11 +88,15 @@ static int sqliteIsRowid(const char *z){
/* /*
** This routine walks an expression tree and resolves references to ** This routine walks an expression tree and resolves references to
** table columns. Nodes of the form ID.ID or ID resolve into an ** table columns. Nodes of the form ID.ID or ID resolve into an
** index to the table in the table list and a column offset. The opcode ** index to the table in the table list and a column offset. The
** for such nodes is changed to TK_COLUMN. The iTable value is changed ** Expr.opcode for such nodes is changed to TK_COLUMN. The Expr.iTable
** to the index of the referenced table in pTabList plus the pParse->nTab ** value is changed to the index of the referenced table in pTabList
** value. The iColumn value is changed to the index of the column of the ** plus the pParse->nTab value. This value will ultimately become the
** referenced table. ** VDBE cursor number for a cursor that is pointing into the referenced
** table. The Expr.iColumn value is changed to the index of the column
** of the referenced table. The Expr.iColumn value for the special
** ROWID column is -1. Any INTEGER PRIMARY KEY column is tried as an
** alias for ROWID.
** **
** We also check for instances of the IN operator. IN comes in two ** We also check for instances of the IN operator. IN comes in two
** forms: ** forms:

View File

@ -12,13 +12,22 @@
** This is the implementation of generic hash-tables ** This is the implementation of generic hash-tables
** used in SQLite. ** used in SQLite.
** **
** $Id: hash.c,v 1.4 2001/11/21 02:21:12 drh Exp $ ** $Id: hash.c,v 1.5 2002/01/06 17:07:40 drh Exp $
*/ */
#include "sqliteInt.h" #include "sqliteInt.h"
#include <assert.h> #include <assert.h>
/* Turn bulk memory into a hash table object by initializing the /* Turn bulk memory into a hash table object by initializing the
** fields of the Hash structure. ** fields of the Hash structure.
**
** "new" is a pointer to the hash table that is to be initialized.
** keyClass is one of the constants SQLITE_HASH_INT, SQLITE_HASH_POINTER,
** SQLITE_HASH_BINARY, or SQLITE_HASH_STRING. The value of keyClass
** determines what kind of key the hash table will use. "copyKey" is
** true if the hash table should make its own private copy of keys and
** false if it should just use the supplied pointer. CopyKey only makes
** sense for SQLITE_HASH_STRING and SQLITE_HASH_BINARY and is ignored
** for other key classes.
*/ */
void sqliteHashInit(Hash *new, int keyClass, int copyKey){ void sqliteHashInit(Hash *new, int keyClass, int copyKey){
assert( new!=0 ); assert( new!=0 );
@ -33,6 +42,8 @@ void sqliteHashInit(Hash *new, int keyClass, int copyKey){
} }
/* Remove all entries from a hash table. Reclaim all memory. /* Remove all entries from a hash table. Reclaim all memory.
** Call this routine to delete a hash table or to reset a hash table
** to the empty state.
*/ */
void sqliteHashClear(Hash *pH){ void sqliteHashClear(Hash *pH){
HashElem *elem; /* For looping over all elements of the table */ HashElem *elem; /* For looping over all elements of the table */
@ -107,6 +118,15 @@ static int binCompare(const void *pKey1, int n1, const void *pKey2, int n2){
/* /*
** Return a pointer to the appropriate hash function given the key class. ** Return a pointer to the appropriate hash function given the key class.
**
** The C syntax in this function definition may be unfamilar to some
** programmers, so we provide the following additional explanation:
**
** The name of the function is "hashFunction". The function takes a
** single parameter "keyClass". The return value of hashFunction()
** is a pointer to another function. Specifically, the return value
** of hashFunction() is a pointer to a function that takes two parameters
** with types "const void*" and "int" and returns an "int".
*/ */
static int (*hashFunction(int keyClass))(const void*,int){ static int (*hashFunction(int keyClass))(const void*,int){
switch( keyClass ){ switch( keyClass ){
@ -121,6 +141,9 @@ static int (*hashFunction(int keyClass))(const void*,int){
/* /*
** Return a pointer to the appropriate hash function given the key class. ** Return a pointer to the appropriate hash function given the key class.
**
** For help in interpreted the obscure C code in the function definition,
** see the header comment on the previous function.
*/ */
static int (*compareFunction(int keyClass))(const void*,int,const void*,int){ static int (*compareFunction(int keyClass))(const void*,int,const void*,int){
switch( keyClass ){ switch( keyClass ){
@ -134,8 +157,9 @@ static int (*compareFunction(int keyClass))(const void*,int,const void*,int){
} }
/* Resize the hash table. new_size must be a power of 2. /* Resize the hash table so that it cantains "new_size" buckets.
** The hash table might fail to resize if sqliteMalloc() fails. ** "new_size" must be a power of 2. The hash table might fail
** to resize if sqliteMalloc() fails.
*/ */
static void rehash(Hash *pH, int new_size){ static void rehash(Hash *pH, int new_size){
struct _ht *new_ht; /* The new hash table */ struct _ht *new_ht; /* The new hash table */
@ -172,8 +196,8 @@ static void rehash(Hash *pH, int new_size){
} }
/* This function (for internal use only) locates an element in an /* This function (for internal use only) locates an element in an
** pH that matches the given key. The hash for this key has ** hash table that matches the given key. The hash for this key has
** already been computed and is passed as the 3rd parameter. ** already been computed and is passed as the 4th parameter.
*/ */
static HashElem *findElementGivenHash( static HashElem *findElementGivenHash(
const Hash *pH, /* The pH to be searched */ const Hash *pH, /* The pH to be searched */
@ -205,7 +229,7 @@ static HashElem *findElementGivenHash(
static void removeElementGivenHash( static void removeElementGivenHash(
Hash *pH, /* The pH containing "elem" */ Hash *pH, /* The pH containing "elem" */
HashElem* elem, /* The element to be removed from the pH */ HashElem* elem, /* The element to be removed from the pH */
int h /* Hash value for the element */ int h /* Hash value for the element */
){ ){
if( elem->prev ){ if( elem->prev ){
elem->prev->next = elem->next; elem->prev->next = elem->next;
@ -229,9 +253,9 @@ static void removeElementGivenHash(
pH->count--; pH->count--;
} }
/* Attempt to locate an element of the associative pH with a key /* Attempt to locate an element of the hash table pH with a key
** that matches pKey,nKey. Return the data for this element if it is ** that matches pKey,nKey. Return the data for this element if it is
** found, or NULL if no match is found. ** found, or NULL if there is no match.
*/ */
void *sqliteHashFind(const Hash *pH, const void *pKey, int nKey){ void *sqliteHashFind(const Hash *pH, const void *pKey, int nKey){
int h; /* A hash on key */ int h; /* A hash on key */
@ -257,7 +281,7 @@ void *sqliteHashFind(const Hash *pH, const void *pKey, int nKey){
** If another element already exists with the same key, then the ** If another element already exists with the same key, then the
** new data replaces the old data and the old data is returned. ** new data replaces the old data and the old data is returned.
** The key is not copied in this instance. If a malloc fails, then ** The key is not copied in this instance. If a malloc fails, then
** new data is returned. ** the new data is returned and the hash table is unchanged.
** **
** If the "data" parameter to this function is NULL, then the ** If the "data" parameter to this function is NULL, then the
** element corresponding to "key" is removed from the hash table. ** element corresponding to "key" is removed from the hash table.

View File

@ -12,7 +12,7 @@
** This file contains C code routines that are called by the parser ** This file contains C code routines that are called by the parser
** to handle INSERT statements in SQLite. ** to handle INSERT statements in SQLite.
** **
** $Id: insert.c,v 1.31 2002/01/04 03:09:30 drh Exp $ ** $Id: insert.c,v 1.32 2002/01/06 17:07:40 drh Exp $
*/ */
#include "sqliteInt.h" #include "sqliteInt.h"
@ -163,7 +163,7 @@ void sqliteInsert(
} }
} }
/* If there is not IDLIST term but the table has an integer primary /* If there is no IDLIST term but the table has an integer primary
** key, the set the keyColumn variable to the primary key column index ** key, the set the keyColumn variable to the primary key column index
** in the original table definition. ** in the original table definition.
*/ */
@ -220,15 +220,15 @@ void sqliteInsert(
sqliteVdbeAddOp(v, OP_Dup, 0, 0); sqliteVdbeAddOp(v, OP_Dup, 0, 0);
} }
/* Push onto the stack data for all columns of the new entry, beginning /* Push onto the stack, data for all columns of the new entry, beginning
** with the first column. ** with the first column.
*/ */
for(i=0; i<pTab->nCol; i++){ for(i=0; i<pTab->nCol; i++){
if( i==pTab->iPKey ){ if( i==pTab->iPKey ){
/* The value of the INTEGER PRIMARY KEY column is always a NULL. /* The value of the INTEGER PRIMARY KEY column is always a NULL.
** Whenever this column is used, the record number will be substituted ** Whenever this column is read, the record number will be substituted
** in its place, so there is no point in it taking up space in ** in its place. So will fill this column with a NULL to avoid
** the data record. */ ** taking up data space with information that will never be used. */
sqliteVdbeAddOp(v, OP_String, 0, 0); sqliteVdbeAddOp(v, OP_String, 0, 0);
continue; continue;
} }

View File

@ -14,7 +14,7 @@
** other files are for internal use by SQLite and should not be ** other files are for internal use by SQLite and should not be
** accessed by users of the library. ** accessed by users of the library.
** **
** $Id: main.c,v 1.52 2001/12/21 14:30:43 drh Exp $ ** $Id: main.c,v 1.53 2002/01/06 17:07:40 drh Exp $
*/ */
#include "sqliteInt.h" #include "sqliteInt.h"
#include "os.h" #include "os.h"
@ -67,9 +67,9 @@ static int sqliteOpenCb(void *pDb, int argc, char **argv, char **azColName){
}else{ }else{
/* If the SQL column is blank it means this is an index that /* If the SQL column is blank it means this is an index that
** was created to be the PRIMARY KEY or to fulfill a UNIQUE ** was created to be the PRIMARY KEY or to fulfill a UNIQUE
** constraint or a CREATE TABLE. The index should have already ** constraint for a CREATE TABLE. The index should have already
** been created when we processed the CREATE TABLE. All we have ** been created when we processed the CREATE TABLE. All we have
** to do here is record the root page. ** to do here is record the root page number for that index.
*/ */
Index *pIndex = sqliteFindIndex(db, argv[1]); Index *pIndex = sqliteFindIndex(db, argv[1]);
if( pIndex==0 || pIndex->tnum!=0 ){ if( pIndex==0 || pIndex->tnum!=0 ){
@ -118,7 +118,7 @@ static int sqliteInit(sqlite *db, char **pzErrMsg){
")" ")"
; ;
/* The following program is used to initialize the internal /* The following VDBE program is used to initialize the internal
** structure holding the tables and indexes of the database. ** structure holding the tables and indexes of the database.
** The database contains a special table named "sqlite_master" ** The database contains a special table named "sqlite_master"
** defined as follows: ** defined as follows:
@ -210,6 +210,11 @@ static int sqliteInit(sqlite *db, char **pzErrMsg){
sqliteSetString(pzErrMsg, "unsupported file format", 0); sqliteSetString(pzErrMsg, "unsupported file format", 0);
rc = SQLITE_ERROR; rc = SQLITE_ERROR;
} }
/* The schema for the SQLITE_MASTER table is not stored in the
** database itself. We have to invoke the callback one extra
** time to get it to process the SQLITE_MASTER table defintion.
*/
if( rc==SQLITE_OK ){ if( rc==SQLITE_OK ){
Table *pTab; Table *pTab;
char *azArg[6]; char *azArg[6];
@ -270,9 +275,7 @@ sqlite *sqlite_open(const char *zFilename, int mode, char **pzErrMsg){
if( rc!=SQLITE_OK ){ if( rc!=SQLITE_OK ){
switch( rc ){ switch( rc ){
default: { default: {
if( pzErrMsg ){ sqliteSetString(pzErrMsg, "unable to open database: ", zFilename, 0);
sqliteSetString(pzErrMsg, "unable to open database: ", zFilename, 0);
}
} }
} }
sqliteFree(db); sqliteFree(db);
@ -289,7 +292,7 @@ sqlite *sqlite_open(const char *zFilename, int mode, char **pzErrMsg){
sqlite_close(db); sqlite_close(db);
sqliteStrRealloc(pzErrMsg); sqliteStrRealloc(pzErrMsg);
return 0; return 0;
}else /* if( pzErrMsg ) */{ }else if( pzErrMsg ){
sqliteFree(*pzErrMsg); sqliteFree(*pzErrMsg);
*pzErrMsg = 0; *pzErrMsg = 0;
} }
@ -304,7 +307,7 @@ no_mem_on_open:
/* /*
** Erase all schema information from the schema hash table. Except ** Erase all schema information from the schema hash table. Except
** tables that are created using CREATE TEMPORARY TABLE are preserved ** tables that are created using CREATE TEMPORARY TABLE are preserved
** if the preserverTemps flag is true. ** if the preserveTemps flag is true.
** **
** The database schema is normally read in once when the database ** The database schema is normally read in once when the database
** is first opened and stored in a hash table in the sqlite structure. ** is first opened and stored in a hash table in the sqlite structure.

View File

@ -18,7 +18,7 @@
** file simultaneously, or one process from reading the database while ** file simultaneously, or one process from reading the database while
** another is writing. ** another is writing.
** **
** @(#) $Id: pager.c,v 1.34 2001/12/15 14:22:19 drh Exp $ ** @(#) $Id: pager.c,v 1.35 2002/01/06 17:07:40 drh Exp $
*/ */
#include "sqliteInt.h" #include "sqliteInt.h"
#include "pager.h" #include "pager.h"
@ -993,7 +993,7 @@ int sqlitepager_write(void *pData){
} }
/* /*
** Return TRUE if the page given in the argument was previous passed ** Return TRUE if the page given in the argument was previously passed
** to sqlitepager_write(). In other words, return TRUE if it is ok ** to sqlitepager_write(). In other words, return TRUE if it is ok
** to change the content of the page. ** to change the content of the page.
*/ */

View File

@ -14,7 +14,7 @@
** the parser. Lemon will also generate a header file containing ** the parser. Lemon will also generate a header file containing
** numeric codes for all of the tokens. ** numeric codes for all of the tokens.
** **
** @(#) $Id: parse.y,v 1.41 2001/12/22 14:49:25 drh Exp $ ** @(#) $Id: parse.y,v 1.42 2002/01/06 17:07:40 drh Exp $
*/ */
%token_prefix TK_ %token_prefix TK_
%token_type {Token} %token_type {Token}
@ -102,6 +102,7 @@ id(A) ::= CLUSTER(X). {A = X;}
id(A) ::= ID(X). {A = X;} id(A) ::= ID(X). {A = X;}
id(A) ::= TEMP(X). {A = X;} id(A) ::= TEMP(X). {A = X;}
id(A) ::= OFFSET(X). {A = X;} id(A) ::= OFFSET(X). {A = X;}
id(A) ::= KEY(X). {A = X;}
// And "ids" is an identifer-or-string. // And "ids" is an identifer-or-string.
// //

View File

@ -12,7 +12,7 @@
** This file contains code to implement the "sqlite" command line ** This file contains code to implement the "sqlite" command line
** utility for accessing SQLite databases. ** utility for accessing SQLite databases.
** **
** $Id: shell.c,v 1.40 2001/11/25 13:18:24 drh Exp $ ** $Id: shell.c,v 1.41 2002/01/06 17:07:40 drh Exp $
*/ */
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
@ -92,7 +92,7 @@ static char *getline(char *zPrompt, FILE *in){
** Retrieve a single line of input text. "isatty" is true if text ** Retrieve a single line of input text. "isatty" is true if text
** is coming from a terminal. In that case, we issue a prompt and ** is coming from a terminal. In that case, we issue a prompt and
** attempt to use "readline" for command-line editing. If "isatty" ** attempt to use "readline" for command-line editing. If "isatty"
** is false, use "getline" instead of "readline" and issue to prompt. ** is false, use "getline" instead of "readline" and issue no prompt.
** **
** zPrior is a string of prior text retrieved. If not the empty ** zPrior is a string of prior text retrieved. If not the empty
** string, then issue a continuation prompt. ** string, then issue a continuation prompt.

View File

@ -11,7 +11,7 @@
************************************************************************* *************************************************************************
** Internal interface definitions for SQLite. ** Internal interface definitions for SQLite.
** **
** @(#) $Id: sqliteInt.h,v 1.74 2001/12/31 02:48:51 drh Exp $ ** @(#) $Id: sqliteInt.h,v 1.75 2002/01/06 17:07:40 drh Exp $
*/ */
#include "sqlite.h" #include "sqlite.h"
#include "hash.h" #include "hash.h"
@ -119,13 +119,6 @@ extern int sqlite_nFree; /* Number of sqliteFree() calls */
extern int sqlite_iMallocFail; /* Fail sqliteMalloc() after this many calls */ extern int sqlite_iMallocFail; /* Fail sqliteMalloc() after this many calls */
#endif #endif
/*
** The number of entries in the in-memory hash array holding the
** database schema. (Collision resolution is by chaining, so the
** table will hold more than this many entries.)
*/
#define N_HASH 51
/* /*
** Name of the master database table. The master database table ** Name of the master database table. The master database table
** is a special table that holds the names and attributes of all ** is a special table that holds the names and attributes of all

View File

@ -30,7 +30,7 @@
** But other routines are also provided to help in building up ** But other routines are also provided to help in building up
** a program instruction by instruction. ** a program instruction by instruction.
** **
** $Id: vdbe.c,v 1.104 2002/01/04 03:09:30 drh Exp $ ** $Id: vdbe.c,v 1.105 2002/01/06 17:07:41 drh Exp $
*/ */
#include "sqliteInt.h" #include "sqliteInt.h"
#include <ctype.h> #include <ctype.h>
@ -456,11 +456,12 @@ void sqliteVdbeCompressSpace(Vdbe *p, int addr){
Op *pOp; Op *pOp;
if( p->aOp==0 || addr<0 || addr>=p->nOp ) return; if( p->aOp==0 || addr<0 || addr>=p->nOp ) return;
pOp = &p->aOp[addr]; pOp = &p->aOp[addr];
if( pOp->p3type==P3_POINTER ){
return;
}
if( pOp->p3type!=P3_DYNAMIC ){ if( pOp->p3type!=P3_DYNAMIC ){
pOp->p3 = sqliteStrDup(pOp->p3); pOp->p3 = sqliteStrDup(pOp->p3);
pOp->p3type = P3_DYNAMIC; pOp->p3type = P3_DYNAMIC;
}else if( pOp->p3type!=P3_STATIC ){
return;
} }
z = pOp->p3; z = pOp->p3;
if( z==0 ) return; if( z==0 ) return;
@ -474,10 +475,8 @@ void sqliteVdbeCompressSpace(Vdbe *p, int addr){
z[j++] = z[i++]; z[j++] = z[i++];
} }
} }
while( i>0 && isspace(z[i-1]) ){ while( j>0 && isspace(z[j-1]) ){ j--; }
z[i-1] = 0; z[j] = 0;
i--;
}
} }
/* /*
@ -922,7 +921,6 @@ int sqliteVdbeList(
azValue[3] = zP2; azValue[3] = zP2;
azValue[5] = 0; azValue[5] = 0;
rc = SQLITE_OK; rc = SQLITE_OK;
/* if( pzErrMsg ){ *pzErrMsg = 0; } */
for(i=0; rc==SQLITE_OK && i<p->nOp; i++){ for(i=0; rc==SQLITE_OK && i<p->nOp; i++){
if( p->db->flags & SQLITE_Interrupt ){ if( p->db->flags & SQLITE_Interrupt ){
p->db->flags &= ~SQLITE_Interrupt; p->db->flags &= ~SQLITE_Interrupt;
@ -1028,8 +1026,9 @@ static int byteSwap(int x){
** from sqliteMalloc() and *pzErrMsg is made to point to that memory. ** from sqliteMalloc() and *pzErrMsg is made to point to that memory.
** The return parameter is the number of errors. ** The return parameter is the number of errors.
** **
** If the callback every returns non-zero, then the program exits ** If the callback ever returns non-zero, then the program exits
** immediately. No error message but the function does return SQLITE_ABORT. ** immediately. There will be no error message but the function
** does return SQLITE_ABORT.
** **
** A memory allocation error causes this routine to return SQLITE_NOMEM ** A memory allocation error causes this routine to return SQLITE_NOMEM
** and abandon furture processing. ** and abandon furture processing.
@ -1089,7 +1088,6 @@ int sqliteVdbeExec(
p->trace = stdout; p->trace = stdout;
} }
#endif #endif
/* if( pzErrMsg ){ *pzErrMsg = 0; } */
if( sqlite_malloc_failed ) goto no_mem; if( sqlite_malloc_failed ) goto no_mem;
for(pc=0; !sqlite_malloc_failed && rc==SQLITE_OK && pc<p->nOp for(pc=0; !sqlite_malloc_failed && rc==SQLITE_OK && pc<p->nOp
VERIFY(&& pc>=0); pc++){ VERIFY(&& pc>=0); pc++){

View File

@ -13,7 +13,7 @@
** the WHERE clause of SQL statements. Also found here are subroutines ** the WHERE clause of SQL statements. Also found here are subroutines
** to generate VDBE code to evaluate expressions. ** to generate VDBE code to evaluate expressions.
** **
** $Id: where.c,v 1.30 2002/01/04 03:09:30 drh Exp $ ** $Id: where.c,v 1.31 2002/01/06 17:07:41 drh Exp $
*/ */
#include "sqliteInt.h" #include "sqliteInt.h"
@ -572,8 +572,8 @@ WhereInfo *sqliteWhereBegin(
pLevel->p2 = start; pLevel->p2 = start;
haveKey = 0; haveKey = 0;
}else{ }else{
/* Case 5: The contraints on the right-most index field are /* Case 5: The contraint on the right-most index field is
** inequalities. ** an inequality.
*/ */
int score = pLevel->score; int score = pLevel->score;
int nEqColumn = score/4; int nEqColumn = score/4;