mirror of
https://github.com/status-im/sqlcipher.git
synced 2026-09-02 07:21:07 +00:00
Snapshot of upstream SQLite 3.27.1
This commit is contained in:
+43
-26
@@ -1356,10 +1356,13 @@ void sqlite3CryptFunc(sqlite3_context*,int,sqlite3_value**);
|
||||
/* This is an extra SQLITE_TRACE macro that indicates "legacy" tracing
|
||||
** in the style of sqlite3_trace()
|
||||
*/
|
||||
#define SQLITE_TRACE_LEGACY 0x80
|
||||
#define SQLITE_TRACE_LEGACY 0x40 /* Use the legacy xTrace */
|
||||
#define SQLITE_TRACE_XPROFILE 0x80 /* Use the legacy xProfile */
|
||||
#else
|
||||
#define SQLITE_TRACE_LEGACY 0
|
||||
#define SQLITE_TRACE_LEGACY 0
|
||||
#define SQLITE_TRACE_XPROFILE 0
|
||||
#endif /* SQLITE_OMIT_DEPRECATED */
|
||||
#define SQLITE_TRACE_NONLEGACY_MASK 0x0f /* Normal flags */
|
||||
|
||||
|
||||
/*
|
||||
@@ -1418,8 +1421,10 @@ struct sqlite3 {
|
||||
void **aExtension; /* Array of shared library handles */
|
||||
int (*xTrace)(u32,void*,void*,void*); /* Trace function */
|
||||
void *pTraceArg; /* Argument to the trace function */
|
||||
#ifndef SQLITE_OMIT_DEPRECATED
|
||||
void (*xProfile)(void*,const char*,u64); /* Profiling function */
|
||||
void *pProfileArg; /* Argument to profile function */
|
||||
#endif
|
||||
void *pCommitArg; /* Argument to xCommitCallback() */
|
||||
int (*xCommitCallback)(void*); /* Invoked at every commit. */
|
||||
void *pRollbackArg; /* Argument to xRollbackCallback() */
|
||||
@@ -1550,6 +1555,7 @@ struct sqlite3 {
|
||||
#define SQLITE_VdbeTrace HI(0x0004) /* True to trace VDBE execution */
|
||||
#define SQLITE_VdbeAddopTrace HI(0x0008) /* Trace sqlite3VdbeAddOp() calls */
|
||||
#define SQLITE_VdbeEQP HI(0x0010) /* Debug EXPLAIN QUERY PLAN */
|
||||
#define SQLITE_ParserTrace HI(0x0020) /* PRAGMA parser_trace=ON */
|
||||
#endif
|
||||
|
||||
/*
|
||||
@@ -1952,9 +1958,6 @@ struct VTable {
|
||||
struct Table {
|
||||
char *zName; /* Name of the table or view */
|
||||
Column *aCol; /* Information about each column */
|
||||
#ifdef SQLITE_ENABLE_NORMALIZE
|
||||
Hash *pColHash; /* All columns indexed by name */
|
||||
#endif
|
||||
Index *pIndex; /* List of SQL indexes on this table. */
|
||||
Select *pSelect; /* NULL for tables. Points to definition if a view. */
|
||||
FKey *pFKey; /* Linked list of all foreign keys in this table */
|
||||
@@ -2241,7 +2244,7 @@ struct Index {
|
||||
u16 nKeyCol; /* Number of columns forming the key */
|
||||
u16 nColumn; /* Number of columns stored in the index */
|
||||
u8 onError; /* OE_Abort, OE_Ignore, OE_Replace, or OE_None */
|
||||
unsigned idxType:2; /* 1==UNIQUE, 2==PRIMARY KEY, 0==CREATE INDEX */
|
||||
unsigned idxType:2; /* 0:Normal 1:UNIQUE, 2:PRIMARY KEY, 3:IPK */
|
||||
unsigned bUnordered:1; /* Use this index for == or IN queries only */
|
||||
unsigned uniqNotNull:1; /* True if UNIQUE and NOT NULL for all columns */
|
||||
unsigned isResized:1; /* True if resizeIndexObject() has been called */
|
||||
@@ -2266,6 +2269,7 @@ struct Index {
|
||||
#define SQLITE_IDXTYPE_APPDEF 0 /* Created using CREATE INDEX */
|
||||
#define SQLITE_IDXTYPE_UNIQUE 1 /* Implements a UNIQUE constraint */
|
||||
#define SQLITE_IDXTYPE_PRIMARYKEY 2 /* Is the PRIMARY KEY for the table */
|
||||
#define SQLITE_IDXTYPE_IPK 3 /* INTEGER PRIMARY KEY index */
|
||||
|
||||
/* Return true if index X is a PRIMARY KEY index */
|
||||
#define IsPrimaryKeyIndex(X) ((X)->idxType==SQLITE_IDXTYPE_PRIMARYKEY)
|
||||
@@ -2483,6 +2487,10 @@ struct Expr {
|
||||
Table *pTab; /* TK_COLUMN: Table containing column. Can be NULL
|
||||
** for a column of an index on an expression */
|
||||
Window *pWin; /* TK_FUNCTION: Window definition for the func */
|
||||
struct { /* TK_IN, TK_SELECT, and TK_EXISTS */
|
||||
int iAddr; /* Subroutine entry address */
|
||||
int regReturn; /* Register used to hold return address */
|
||||
} sub;
|
||||
} y;
|
||||
};
|
||||
|
||||
@@ -2514,6 +2522,8 @@ struct Expr {
|
||||
#define EP_Alias 0x400000 /* Is an alias for a result set column */
|
||||
#define EP_Leaf 0x800000 /* Expr.pLeft, .pRight, .u.pSelect all NULL */
|
||||
#define EP_WinFunc 0x1000000 /* TK_FUNCTION with Expr.y.pWin set */
|
||||
#define EP_Subrtn 0x2000000 /* Uses Expr.y.sub. TK_IN, _SELECT, or _EXISTS */
|
||||
#define EP_Quoted 0x4000000 /* TK_ID was originally quoted */
|
||||
|
||||
/*
|
||||
** The EP_Propagate mask is a set of properties that automatically propagate
|
||||
@@ -3057,16 +3067,17 @@ struct Parse {
|
||||
u8 hasCompound; /* Need to invoke convertCompoundSelectToSubquery() */
|
||||
u8 okConstFactor; /* OK to factor out constants */
|
||||
u8 disableLookaside; /* Number of times lookaside has been disabled */
|
||||
u8 disableVtab; /* Disable all virtual tables for this parse */
|
||||
int nRangeReg; /* Size of the temporary register block */
|
||||
int iRangeReg; /* First register in temporary register block */
|
||||
int nErr; /* Number of errors seen */
|
||||
int nTab; /* Number of previously allocated VDBE cursors */
|
||||
int nMem; /* Number of memory cells used so far */
|
||||
int nOpAlloc; /* Number of slots allocated for Vdbe.aOp[] */
|
||||
int szOpAlloc; /* Bytes of memory space allocated for Vdbe.aOp[] */
|
||||
int iSelfTab; /* Table associated with an index on expr, or negative
|
||||
** of the base register during check-constraint eval */
|
||||
int nLabel; /* Number of labels used */
|
||||
int nLabel; /* The *negative* of the number of labels used */
|
||||
int nLabelAlloc; /* Number of slots in aLabel */
|
||||
int *aLabel; /* Space to hold the labels */
|
||||
ExprList *pConstExpr;/* Constant expressions */
|
||||
Token constraintName;/* Name of the constraint currently being parsed */
|
||||
@@ -3126,7 +3137,9 @@ struct Parse {
|
||||
Vdbe *pReprepare; /* VM being reprepared (sqlite3Reprepare()) */
|
||||
const char *zTail; /* All SQL text past the last semicolon parsed */
|
||||
Table *pNewTable; /* A table being constructed by CREATE TABLE */
|
||||
Index *pNewIndex; /* An index being constructed by CREATE INDEX */
|
||||
Index *pNewIndex; /* An index being constructed by CREATE INDEX.
|
||||
** Also used to hold redundant UNIQUE constraints
|
||||
** during a RENAME COLUMN */
|
||||
Trigger *pNewTrigger; /* Trigger under construct by a CREATE TRIGGER */
|
||||
const char *zAuthContext; /* The 6th parameter to db->xAuth callbacks */
|
||||
#ifndef SQLITE_OMIT_VIRTUALTABLE
|
||||
@@ -3354,6 +3367,7 @@ typedef struct {
|
||||
int iDb; /* 0 for main database. 1 for TEMP, 2.. for ATTACHed */
|
||||
int rc; /* Result code stored here */
|
||||
u32 mInitFlags; /* Flags controlling error messages */
|
||||
u32 nInitRow; /* Number of rows processed */
|
||||
} InitData;
|
||||
|
||||
/*
|
||||
@@ -3414,6 +3428,9 @@ struct Sqlite3Config {
|
||||
void (*xVdbeBranch)(void*,unsigned iSrcLine,u8 eThis,u8 eMx); /* Callback */
|
||||
void *pVdbeBranchArg; /* 1st argument */
|
||||
#endif
|
||||
#ifdef SQLITE_ENABLE_DESERIALIZE
|
||||
sqlite3_int64 mxMemdbSize; /* Default max memdb size */
|
||||
#endif
|
||||
#ifndef SQLITE_UNTESTABLE
|
||||
int (*xTestCallback)(int); /* Invoked by sqlite3FaultSim() */
|
||||
#endif
|
||||
@@ -3802,6 +3819,7 @@ char *sqlite3VMPrintf(sqlite3*,const char*, va_list);
|
||||
void sqlite3SetString(char **, sqlite3*, const char*);
|
||||
void sqlite3ErrorMsg(Parse*, const char*, ...);
|
||||
void sqlite3Dequote(char*);
|
||||
void sqlite3DequoteExpr(Expr*);
|
||||
void sqlite3TokenInit(Token*,char*);
|
||||
int sqlite3KeywordCode(const unsigned char*, int);
|
||||
int sqlite3RunParser(Parse*, const char*, char **);
|
||||
@@ -3830,6 +3848,7 @@ void sqlite3ExprListSetName(Parse*,ExprList*,Token*,int);
|
||||
void sqlite3ExprListSetSpan(Parse*,ExprList*,const char*,const char*);
|
||||
void sqlite3ExprListDelete(sqlite3*, ExprList*);
|
||||
u32 sqlite3ExprListFlags(const ExprList*);
|
||||
int sqlite3IndexHasDuplicateRootPage(Index*);
|
||||
int sqlite3Init(sqlite3*, char**);
|
||||
int sqlite3InitCallback(void*, int, char**, char**);
|
||||
int sqlite3InitOne(sqlite3*, int, char**, u32);
|
||||
@@ -3863,6 +3882,11 @@ void sqlite3AddCollateType(Parse*, Token*);
|
||||
void sqlite3EndTable(Parse*,Token*,Token*,u8,Select*);
|
||||
int sqlite3ParseUri(const char*,const char*,unsigned int*,
|
||||
sqlite3_vfs**,char**,char **);
|
||||
#ifdef SQLITE_HAS_CODEC
|
||||
int sqlite3CodecQueryParameters(sqlite3*,const char*,const char*);
|
||||
#else
|
||||
# define sqlite3CodecQueryParameters(A,B,C) 0
|
||||
#endif
|
||||
Btree *sqlite3DbNameToBtree(sqlite3*,const char*);
|
||||
|
||||
#ifdef SQLITE_UNTESTABLE
|
||||
@@ -3915,8 +3939,8 @@ void sqlite3Insert(Parse*, SrcList*, Select*, IdList*, int, Upsert*);
|
||||
void *sqlite3ArrayAllocate(sqlite3*,void*,int,int*,int*);
|
||||
IdList *sqlite3IdListAppend(Parse*, IdList*, Token*);
|
||||
int sqlite3IdListIndex(IdList*,const char*);
|
||||
SrcList *sqlite3SrcListEnlarge(sqlite3*, SrcList*, int, int);
|
||||
SrcList *sqlite3SrcListAppend(sqlite3*, SrcList*, Token*, Token*);
|
||||
SrcList *sqlite3SrcListEnlarge(Parse*, SrcList*, int, int);
|
||||
SrcList *sqlite3SrcListAppend(Parse*, SrcList*, Token*, Token*);
|
||||
SrcList *sqlite3SrcListAppendFromTerm(Parse*, SrcList*, Token*, Token*,
|
||||
Token*, Select*, Expr*, IdList*);
|
||||
void sqlite3SrcListIndexedBy(Parse *, SrcList *, Token *);
|
||||
@@ -3983,8 +4007,8 @@ Table *sqlite3LocateTableItem(Parse*,u32 flags,struct SrcList_item *);
|
||||
Index *sqlite3FindIndex(sqlite3*,const char*, const char*);
|
||||
void sqlite3UnlinkAndDeleteTable(sqlite3*,int,const char*);
|
||||
void sqlite3UnlinkAndDeleteIndex(sqlite3*,int,const char*);
|
||||
void sqlite3Vacuum(Parse*,Token*);
|
||||
int sqlite3RunVacuum(char**, sqlite3*, int);
|
||||
void sqlite3Vacuum(Parse*,Token*,Expr*);
|
||||
int sqlite3RunVacuum(char**, sqlite3*, int, sqlite3_value*);
|
||||
char *sqlite3NameFromToken(sqlite3*, Token*);
|
||||
int sqlite3ExprCompare(Parse*,Expr*, Expr*, int);
|
||||
int sqlite3ExprCompareSkip(Expr*, Expr*, int);
|
||||
@@ -4022,9 +4046,6 @@ int sqlite3ExprIsInteger(Expr*, int*);
|
||||
int sqlite3ExprCanBeNull(const Expr*);
|
||||
int sqlite3ExprNeedsNoAffinityChange(const Expr*, char);
|
||||
int sqlite3IsRowid(const char*);
|
||||
#ifdef SQLITE_ENABLE_NORMALIZE
|
||||
int sqlite3IsRowidN(const char*, int);
|
||||
#endif
|
||||
void sqlite3GenerateRowDelete(
|
||||
Parse*,Table*,Trigger*,int,int,int,i16,u8,u8,u8,int);
|
||||
void sqlite3GenerateRowIndexDelete(Parse*, Table*, int, int, int*, int);
|
||||
@@ -4051,9 +4072,7 @@ ExprList *sqlite3ExprListDup(sqlite3*,ExprList*,int);
|
||||
SrcList *sqlite3SrcListDup(sqlite3*,SrcList*,int);
|
||||
IdList *sqlite3IdListDup(sqlite3*,IdList*);
|
||||
Select *sqlite3SelectDup(sqlite3*,Select*,int);
|
||||
#ifdef SQLITE_ENABLE_NORMALIZE
|
||||
FuncDef *sqlite3FunctionSearchN(int,const char*,int);
|
||||
#endif
|
||||
FuncDef *sqlite3FunctionSearch(int,const char*);
|
||||
void sqlite3InsertBuiltinFuncs(FuncDef*,int);
|
||||
FuncDef *sqlite3FindFunction(sqlite3*,const char*,int,u8,u8);
|
||||
void sqlite3RegisterBuiltinFunctions(void);
|
||||
@@ -4258,19 +4277,17 @@ void sqlite3AlterFunctions(void);
|
||||
void sqlite3AlterRenameTable(Parse*, SrcList*, Token*);
|
||||
void sqlite3AlterRenameColumn(Parse*, SrcList*, Token*, Token*);
|
||||
int sqlite3GetToken(const unsigned char *, int *);
|
||||
#ifdef SQLITE_ENABLE_NORMALIZE
|
||||
int sqlite3GetTokenNormalized(const unsigned char *, int *, int *);
|
||||
#endif
|
||||
void sqlite3NestedParse(Parse*, const char*, ...);
|
||||
void sqlite3ExpirePreparedStatements(sqlite3*, int);
|
||||
int sqlite3CodeSubselect(Parse*, Expr *, int, int);
|
||||
void sqlite3CodeRhsOfIN(Parse*, Expr*, int, int);
|
||||
int sqlite3CodeSubselect(Parse*, Expr*);
|
||||
void sqlite3SelectPrep(Parse*, Select*, NameContext*);
|
||||
void sqlite3SelectWrongNumTermsError(Parse *pParse, Select *p);
|
||||
int sqlite3MatchSpanName(const char*, const char*, const char*, const char*);
|
||||
int sqlite3ResolveExprNames(NameContext*, Expr*);
|
||||
int sqlite3ResolveExprListNames(NameContext*, ExprList*);
|
||||
void sqlite3ResolveSelectNames(Parse*, Select*, NameContext*);
|
||||
void sqlite3ResolveSelfReference(Parse*,Table*,int,Expr*,ExprList*);
|
||||
int sqlite3ResolveSelfReference(Parse*,Table*,int,Expr*,ExprList*);
|
||||
int sqlite3ResolveOrderGroupBy(Parse*, Select*, ExprList*, const char*);
|
||||
void sqlite3ColumnDefault(Vdbe *, Table *, int, int);
|
||||
void sqlite3AlterFinishAddColumn(Parse *, Token *);
|
||||
@@ -4419,7 +4436,7 @@ int sqlite3VdbeParameterIndex(Vdbe*, const char*, int);
|
||||
int sqlite3TransferBindings(sqlite3_stmt *, sqlite3_stmt *);
|
||||
void sqlite3ParserReset(Parse*);
|
||||
#ifdef SQLITE_ENABLE_NORMALIZE
|
||||
void sqlite3Normalize(Vdbe*, const char*, int, u8);
|
||||
char *sqlite3Normalize(Vdbe*, const char*);
|
||||
#endif
|
||||
int sqlite3Reprepare(Vdbe*);
|
||||
void sqlite3ExprListCheckLength(Parse*, ExprList*, const char*);
|
||||
@@ -4515,7 +4532,7 @@ const char *sqlite3JournalModename(int);
|
||||
#define IN_INDEX_NOOP_OK 0x0001 /* OK to return IN_INDEX_NOOP */
|
||||
#define IN_INDEX_MEMBERSHIP 0x0002 /* IN operator used for membership test */
|
||||
#define IN_INDEX_LOOP 0x0004 /* IN operator used as a loop */
|
||||
int sqlite3FindInIndex(Parse *, Expr *, u32, int*, int*);
|
||||
int sqlite3FindInIndex(Parse *, Expr *, u32, int*, int*, int*);
|
||||
|
||||
int sqlite3JournalOpen(sqlite3_vfs *, const char *, sqlite3_file *, int, int);
|
||||
int sqlite3JournalSize(sqlite3_vfs *);
|
||||
|
||||
Reference in New Issue
Block a user