Minor comment changes and code optimizations. (CVS 3029)

FossilOrigin-Name: 9e55dcd1a57f2b6ad5b267e8fa58c58b266dc8c7
This commit is contained in:
drh
2006-01-25 22:50:38 +00:00
parent 2d02a67db3
commit f248e21136
4 changed files with 23 additions and 11 deletions
+13 -2
View File
@@ -13,7 +13,7 @@
** interface, and routines that contribute to loading the database schema
** from disk.
**
** $Id: prepare.c,v 1.28 2006/01/23 00:04:55 drh Exp $
** $Id: prepare.c,v 1.29 2006/01/25 22:50:38 drh Exp $
*/
#include "sqliteInt.h"
#include "os.h"
@@ -217,7 +217,7 @@ static int sqlite3InitOne(sqlite3 *db, int iDb, char **pzErrMsg){
** meta[8]
** meta[9]
**
** Note: The hash defined SQLITE_UTF* symbols in sqliteInt.h correspond to
** Note: The #defined SQLITE_UTF* symbols in sqliteInt.h correspond to
** the possible values of meta[4].
*/
if( rc==SQLITE_OK ){
@@ -440,6 +440,10 @@ void sqlite3SchemaFree(void *p){
pSchema->flags &= ~DB_SchemaLoaded;
}
/*
** Find and return the schema associated with a BTree. Create
** a new one if necessary.
*/
Schema *sqlite3SchemaGet(Btree *pBt){
Schema * p;
if( pBt ){
@@ -456,6 +460,13 @@ Schema *sqlite3SchemaGet(Btree *pBt){
return p;
}
/*
** Convert a schema pointer into the iDb index that indicates
** which database file in db->aDb[] the schema refers to.
**
** If the same database is attached more than once, the first
** attached database is returned.
*/
int sqlite3SchemaToIndex(sqlite3 *db, Schema *pSchema){
int i = -1000000;
+2 -1
View File
@@ -102,7 +102,8 @@ int sqlite3VdbeAddOp(Vdbe *p, int op, int p1, int p2){
p->nOp++;
assert( p->magic==VDBE_MAGIC_INIT );
resizeOpArray(p, i+1);
if( p->aOp==0 || p->nOpAlloc<=i ){
assert( p->aOp==0 || p->nOpAlloc>=i+1 );
if( p->aOp==0 ){
return 0;
}
pOp = &p->aOp[i];