build.c File Reference

Go to the source code of this file.

Classes

struct  TableLock

Defines

#define SAVE_SZ   (sizeof(Parse) - offsetof(Parse,nVar))
#define STRICMP(x, y)

Functions

void sqlite3BeginParse (Parse *pParse, int explainFlag)
void sqlite3TableLock (Parse *pParse, int iDb, int iTab, u8 isWriteLock, const char *zName)
static void codeTableLocks (Parse *pParse)
void sqlite3FinishCoding (Parse *pParse)
void sqlite3NestedParse (Parse *pParse, const char *zFormat,...)
Tablesqlite3FindTable (sqlite3 *db, const char *zName, const char *zDatabase)
Tablesqlite3LocateTable (Parse *pParse, int isView, const char *zName, const char *zDbase)
Indexsqlite3FindIndex (sqlite3 *db, const char *zName, const char *zDb)
static void freeIndex (Index *p)
static void sqliteDeleteIndex (Index *p)
void sqlite3UnlinkAndDeleteIndex (sqlite3 *db, int iDb, const char *zIdxName)
void sqlite3ResetInternalSchema (sqlite3 *db, int iDb)
void sqlite3CommitInternalChanges (sqlite3 *db)
static void sqliteResetColumnNames (Table *pTable)
void sqlite3DeleteTable (Table *pTable)
void sqlite3UnlinkAndDeleteTable (sqlite3 *db, int iDb, const char *zTabName)
char * sqlite3NameFromToken (sqlite3 *db, Token *pName)
void sqlite3OpenMasterTable (Parse *p, int iDb)
int sqlite3FindDb (sqlite3 *db, Token *pName)
int sqlite3TwoPartName (Parse *pParse, Token *pName1, Token *pName2, Token **pUnqual)
int sqlite3CheckObjectName (Parse *pParse, const char *zName)
void sqlite3StartTable (Parse *pParse, Token *pName1, Token *pName2, int isTemp, int isView, int isVirtual, int noErr)
void sqlite3AddColumn (Parse *pParse, Token *pName)
void sqlite3AddNotNull (Parse *pParse, int onError)
char sqlite3AffinityType (const Token *pType)
void sqlite3AddColumnType (Parse *pParse, Token *pType)
void sqlite3AddDefaultValue (Parse *pParse, Expr *pExpr)
void sqlite3AddPrimaryKey (Parse *pParse, ExprList *pList, int onError, int autoInc, int sortOrder)
void sqlite3AddCheckConstraint (Parse *pParse, Expr *pCheckExpr)
void sqlite3AddCollateType (Parse *pParse, Token *pToken)
CollSeqsqlite3LocateCollSeq (Parse *pParse, const char *zName, int nName)
void sqlite3ChangeCookie (Parse *pParse, int iDb)
static int identLength (const char *z)
static void identPut (char *z, int *pIdx, char *zSignedIdent)
static char * createTableStmt (sqlite3 *db, Table *p, int isTemp)
void sqlite3EndTable (Parse *pParse, Token *pCons, Token *pEnd, Select *pSelect)
void sqlite3CreateView (Parse *pParse, Token *pBegin, Token *pName1, Token *pName2, Select *pSelect, int isTemp, int noErr)
int sqlite3ViewGetColumnNames (Parse *pParse, Table *pTable)
static void sqliteViewResetAll (sqlite3 *db, int idx)
void sqlite3RootPageMoved (Db *pDb, int iFrom, int iTo)
static void destroyRootPage (Parse *pParse, int iTable, int iDb)
static void destroyTable (Parse *pParse, Table *pTab)
void sqlite3DropTable (Parse *pParse, SrcList *pName, int isView, int noErr)
void sqlite3CreateForeignKey (Parse *pParse, ExprList *pFromCol, Token *pTo, ExprList *pToCol, int flags)
void sqlite3DeferForeignKey (Parse *pParse, int isDeferred)
static void sqlite3RefillIndex (Parse *pParse, Index *pIndex, int memRootPage)
void sqlite3CreateIndex (Parse *pParse, Token *pName1, Token *pName2, SrcList *pTblName, ExprList *pList, int onError, Token *pStart, Token *pEnd, int sortOrder, int ifNotExist)
void sqlite3MinimumFileFormat (Parse *pParse, int iDb, int minFormat)
void sqlite3DefaultRowEst (Index *pIdx)
void sqlite3DropIndex (Parse *pParse, SrcList *pName, int ifExists)
void * sqlite3ArrayAllocate (sqlite3 *db, void *pArray, int szEntry, int initSize, int *pnEntry, int *pnAlloc, int *pIdx)
IdListsqlite3IdListAppend (sqlite3 *db, IdList *pList, Token *pToken)
void sqlite3IdListDelete (sqlite3 *db, IdList *pList)
int sqlite3IdListIndex (IdList *pList, const char *zName)
SrcListsqlite3SrcListEnlarge (sqlite3 *db, SrcList *pSrc, int nExtra, int iStart)
SrcListsqlite3SrcListAppend (sqlite3 *db, SrcList *pList, Token *pTable, Token *pDatabase)
void sqlite3SrcListAssignCursors (Parse *pParse, SrcList *pList)
void sqlite3SrcListDelete (sqlite3 *db, SrcList *pList)
SrcListsqlite3SrcListAppendFromTerm (Parse *pParse, SrcList *p, Token *pTable, Token *pDatabase, Token *pAlias, Select *pSubquery, Expr *pOn, IdList *pUsing)
void sqlite3SrcListIndexedBy (Parse *pParse, SrcList *p, Token *pIndexedBy)
void sqlite3SrcListShiftJoinType (SrcList *p)
void sqlite3BeginTransaction (Parse *pParse, int type)
void sqlite3CommitTransaction (Parse *pParse)
void sqlite3RollbackTransaction (Parse *pParse)
int sqlite3OpenTempDatabase (Parse *pParse)
void sqlite3CodeVerifySchema (Parse *pParse, int iDb)
void sqlite3BeginWriteOperation (Parse *pParse, int setStatement, int iDb)
static int collationMatch (const char *zColl, Index *pIndex)
static void reindexTable (Parse *pParse, Table *pTab, char const *zColl)
static void reindexDatabases (Parse *pParse, char const *zColl)
void sqlite3Reindex (Parse *pParse, Token *pName1, Token *pName2)
KeyInfosqlite3IndexKeyinfo (Parse *pParse, Index *pIdx)

Define Documentation

#define SAVE_SZ   (sizeof(Parse) - offsetof(Parse,nVar))

Referenced by sqlite3NestedParse().

#define STRICMP ( x,
 ) 
Value:
(\
sqlite3UpperToLower[*(unsigned char *)(x)]==   \
sqlite3UpperToLower[*(unsigned char *)(y)]     \
&& sqlite3StrICmp((x)+1,(y)+1)==0 )

Definition at line 925 of file build.c.

Referenced by sqlite3AddColumn().


Function Documentation

static void codeTableLocks ( Parse pParse  )  [static]
static int collationMatch ( const char *  zColl,
Index pIndex 
) [static]

Definition at line 3418 of file build.c.

References Index::azColl, Index::nColumn, and sqlite3StrICmp().

Referenced by reindexTable().

static char* createTableStmt ( sqlite3 db,
Table p,
int  isTemp 
) [static]
static void destroyRootPage ( Parse pParse,
int  iTable,
int  iDb 
) [static]
static void destroyTable ( Parse pParse,
Table pTab 
) [static]
static void freeIndex ( Index p  )  [static]
static int identLength ( const char *  z  )  [static]

Definition at line 1318 of file build.c.

Referenced by createTableStmt().

static void identPut ( char *  z,
int *  pIdx,
char *  zSignedIdent 
) [static]

Definition at line 1330 of file build.c.

References sqlite3KeywordCode(), and TK_ID.

Referenced by createTableStmt().

static void reindexDatabases ( Parse pParse,
char const *  zColl 
) [static]
static void reindexTable ( Parse pParse,
Table pTab,
char const *  zColl 
) [static]
void sqlite3AddCheckConstraint ( Parse pParse,
Expr pCheckExpr 
)
void sqlite3AddCollateType ( Parse pParse,
Token pToken 
)
void sqlite3AddColumn ( Parse pParse,
Token pName 
)
void sqlite3AddColumnType ( Parse pParse,
Token pType 
)
void sqlite3AddDefaultValue ( Parse pParse,
Expr pExpr 
)
void sqlite3AddNotNull ( Parse pParse,
int  onError 
)

Definition at line 987 of file build.c.

References Table::aCol, Table::nCol, Column::notNull, and Parse::pNewTable.

Referenced by yy_reduce().

void sqlite3AddPrimaryKey ( Parse pParse,
ExprList pList,
int  onError,
int  autoInc,
int  sortOrder 
)
char sqlite3AffinityType ( const Token pType  ) 
void* sqlite3ArrayAllocate ( sqlite3 db,
void *  pArray,
int  szEntry,
int  initSize,
int *  pnEntry,
int *  pnAlloc,
int *  pIdx 
)

Definition at line 2909 of file build.c.

References sqlite3DbRealloc().

Referenced by addAggInfoColumn(), addAggInfoFunc(), and sqlite3IdListAppend().

void sqlite3BeginParse ( Parse pParse,
int  explainFlag 
)

Definition at line 34 of file build.c.

References Parse::explain, and Parse::nVar.

Referenced by yy_reduce().

void sqlite3BeginTransaction ( Parse pParse,
int  type 
)
void sqlite3BeginWriteOperation ( Parse pParse,
int  setStatement,
int  iDb 
)
void sqlite3ChangeCookie ( Parse pParse,
int  iDb 
)
int sqlite3CheckObjectName ( Parse pParse,
const char *  zName 
)
void sqlite3CodeVerifySchema ( Parse pParse,
int  iDb 
)
void sqlite3CommitInternalChanges ( sqlite3 db  ) 

Definition at line 472 of file build.c.

References sqlite3::flags, and SQLITE_InternChanges.

Referenced by sqlite3Init(), and sqlite3VdbeHalt().

void sqlite3CommitTransaction ( Parse pParse  ) 
void sqlite3CreateForeignKey ( Parse pParse,
ExprList pFromCol,
Token pTo,
ExprList pToCol,
int  flags 
)
void sqlite3CreateIndex ( Parse pParse,
Token pName1,
Token pName2,
SrcList pTblName,
ExprList pList,
int  onError,
Token pStart,
Token pEnd,
int  sortOrder,
int  ifNotExist 
)

Definition at line 2336 of file build.c.

References ExprList::a, SrcList::a, Table::aCol, sqlite3::aDb, Index::aiColumn, Index::aiRowEst, Index::aSortOrder, Index::autoIndex, Index::azColl, sqlite3::sqlite3InitInfo::busy, Parse::db, db, Schema::file_format, sqlite3::flags, freeIndex(), Schema::idxHash, IN_DECLARE_VTAB, sqlite3::init, IsVirtual, sqlite3::mallocFailed, Token::n, Table::nCol, Index::nColumn, Parse::nErr, sqlite3::sqlite3InitInfo::newTnum, ExprList::nExpr, Parse::nMem, OE_Default, OE_None, OE_Replace, OMIT_TEMPDB, Index::onError, OP_CreateIndex, OP_Expire, OP_ParseSchema, P4_DYNAMIC, Expr::pColl, sqlite3::pDfltColl, ExprList::ExprList_item::pExpr, Table::pIndex, Parse::pNewTable, Index::pNext, Index::pSchema, Db::pSchema, Table::pSchema, Table::pSelect, Index::pTable, SCHEMA_TABLE, ExprList::ExprList_item::sortOrder, sqlite3_snprintf(), sqlite3AuthCheck(), sqlite3BeginWriteOperation(), sqlite3ChangeCookie(), sqlite3CheckObjectName(), sqlite3DbFree(), sqlite3DbMallocZero(), sqlite3DefaultRowEst(), sqlite3ErrorMsg(), sqlite3ExprListAppend(), sqlite3ExprListDelete(), sqlite3FindIndex(), sqlite3FindTable(), sqlite3FixInit(), sqlite3FixSrcList(), sqlite3GetVdbe(), sqlite3HashInsert(), sqlite3LocateCollSeq(), sqlite3LocateTable(), sqlite3MPrintf(), sqlite3NameFromToken(), sqlite3NestedParse(), sqlite3ReadSchema(), sqlite3RefillIndex(), sqlite3SchemaToIndex(), sqlite3SrcListDelete(), sqlite3SrcListLookup(), sqlite3StrICmp(), sqlite3StrNICmp(), sqlite3TwoPartName(), sqlite3VdbeAddOp1(), sqlite3VdbeAddOp2(), sqlite3VdbeAddOp4(), SQLITE_CREATE_INDEX, SQLITE_CREATE_TEMP_INDEX, SQLITE_INSERT, SQLITE_InternChanges, SQLITE_OK, Index::tnum, Token::z, Column::zColl, SrcList::SrcList_item::zDatabase, Index::zName, CollSeq::zName, Column::zName, Db::zName, Table::zName, and SrcList::SrcList_item::zName.

Referenced by sqlite3AddPrimaryKey(), and yy_reduce().

void sqlite3CreateView ( Parse pParse,
Token pBegin,
Token pName1,
Token pName2,
Select pSelect,
int  isTemp,
int  noErr 
)
void sqlite3DefaultRowEst ( Index pIdx  ) 

Definition at line 2806 of file build.c.

References Index::aiRowEst, Index::nColumn, OE_None, and Index::onError.

Referenced by sqlite3AnalysisLoad(), and sqlite3CreateIndex().

void sqlite3DeferForeignKey ( Parse pParse,
int  isDeferred 
)

Definition at line 2242 of file build.c.

References FKey::isDeferred, Table::pFKey, and Parse::pNewTable.

Referenced by yy_reduce().

void sqlite3DeleteTable ( Table pTable  ) 
void sqlite3DropIndex ( Parse pParse,
SrcList pName,
int  ifExists 
)
void sqlite3DropTable ( Parse pParse,
SrcList pName,
int  isView,
int  noErr 
)
void sqlite3EndTable ( Parse pParse,
Token pCons,
Token pEnd,
Select pSelect 
)
int sqlite3FindDb ( sqlite3 db,
Token pName 
)
Index* sqlite3FindIndex ( sqlite3 db,
const char *  zName,
const char *  zDb 
)
Table* sqlite3FindTable ( sqlite3 db,
const char *  zName,
const char *  zDatabase 
)
void sqlite3FinishCoding ( Parse pParse  ) 
IdList* sqlite3IdListAppend ( sqlite3 db,
IdList pList,
Token pToken 
)
void sqlite3IdListDelete ( sqlite3 db,
IdList pList 
)
int sqlite3IdListIndex ( IdList pList,
const char *  zName 
)

Definition at line 2985 of file build.c.

References IdList::a, IdList::nId, sqlite3StrICmp(), and IdList::IdList_item::zName.

Referenced by checkColumnOverLap(), and selectExpander().

KeyInfo* sqlite3IndexKeyinfo ( Parse pParse,
Index pIdx 
)
CollSeq* sqlite3LocateCollSeq ( Parse pParse,
const char *  zName,
int  nName 
)
Table* sqlite3LocateTable ( Parse pParse,
int  isView,
const char *  zName,
const char *  zDbase 
)
void sqlite3MinimumFileFormat ( Parse pParse,
int  iDb,
int  minFormat 
)
char* sqlite3NameFromToken ( sqlite3 db,
Token pName 
)
void sqlite3NestedParse ( Parse pParse,
const char *  zFormat,
  ... 
)
void sqlite3OpenMasterTable ( Parse p,
int  iDb 
)
int sqlite3OpenTempDatabase ( Parse pParse  ) 
static void sqlite3RefillIndex ( Parse pParse,
Index pIndex,
int  memRootPage 
) [static]
void sqlite3Reindex ( Parse pParse,
Token pName1,
Token pName2 
)
void sqlite3ResetInternalSchema ( sqlite3 db,
int  iDb 
)
void sqlite3RollbackTransaction ( Parse pParse  ) 
void sqlite3RootPageMoved ( Db pDb,
int  iFrom,
int  iTo 
)
SrcList* sqlite3SrcListAppend ( sqlite3 db,
SrcList pList,
Token pTable,
Token pDatabase 
)
SrcList* sqlite3SrcListAppendFromTerm ( Parse pParse,
SrcList p,
Token pTable,
Token pDatabase,
Token pAlias,
Select pSubquery,
Expr pOn,
IdList pUsing 
)
void sqlite3SrcListAssignCursors ( Parse pParse,
SrcList pList 
)
void sqlite3SrcListDelete ( sqlite3 db,
SrcList pList 
)
SrcList* sqlite3SrcListEnlarge ( sqlite3 db,
SrcList pSrc,
int  nExtra,
int  iStart 
)
void sqlite3SrcListIndexedBy ( Parse pParse,
SrcList p,
Token pIndexedBy 
)

Definition at line 3207 of file build.c.

References SrcList::a, Parse::db, Token::n, SrcList::nSrc, sqlite3NameFromToken(), and Token::z.

Referenced by yy_reduce().

void sqlite3SrcListShiftJoinType ( SrcList p  ) 

Definition at line 3236 of file build.c.

References SrcList::a, SrcList::SrcList_item::jointype, and SrcList::nSrc.

Referenced by yy_reduce().

void sqlite3StartTable ( Parse pParse,
Token pName1,
Token pName2,
int  isTemp,
int  isView,
int  isVirtual,
int  noErr 
)
void sqlite3TableLock ( Parse pParse,
int  iDb,
int  iTab,
u8  isWriteLock,
const char *  zName 
)
int sqlite3TwoPartName ( Parse pParse,
Token pName1,
Token pName2,
Token **  pUnqual 
)
void sqlite3UnlinkAndDeleteIndex ( sqlite3 db,
int  iDb,
const char *  zIdxName 
)
void sqlite3UnlinkAndDeleteTable ( sqlite3 db,
int  iDb,
const char *  zTabName 
)
int sqlite3ViewGetColumnNames ( Parse pParse,
Table pTable 
)
static void sqliteDeleteIndex ( Index p  )  [static]

Definition at line 368 of file build.c.

References freeIndex(), Schema::idxHash, Index::pSchema, sqlite3HashInsert(), and Index::zName.

Referenced by sqlite3DeleteTable().

static void sqliteResetColumnNames ( Table pTable  )  [static]
static void sqliteViewResetAll ( sqlite3 db,
int  idx 
) [static]

ContextLogger2—ContextLogger2 Logger Daemon Internals—Generated on Mon May 2 13:49:58 2011 by Doxygen 1.6.1