From bb3801714270de37f05383214aadfb09006113ea Mon Sep 17 00:00:00 2001 From: Ilia Alshanetsky Date: Sun, 28 Aug 2005 16:57:01 +0000 Subject: Upgrade sqlite lib to 3.2.5 --- ext/pdo_sqlite/sqlite/src/sqliteInt.h | 108 ++++++++++++++++++++-------------- 1 file changed, 64 insertions(+), 44 deletions(-) (limited to 'ext/pdo_sqlite/sqlite/src/sqliteInt.h') diff --git a/ext/pdo_sqlite/sqlite/src/sqliteInt.h b/ext/pdo_sqlite/sqlite/src/sqliteInt.h index f0ffbd2e85..a5245015eb 100644 --- a/ext/pdo_sqlite/sqlite/src/sqliteInt.h +++ b/ext/pdo_sqlite/sqlite/src/sqliteInt.h @@ -39,7 +39,6 @@ # define _LARGEFILE_SOURCE 1 #endif -#include "config.h" #include "sqlite3.h" #include "hash.h" #include "parse.h" @@ -209,6 +208,7 @@ typedef struct BusyHandler BusyHandler; struct BusyHandler { int (*xFunc)(void *,int); /* The busy callback */ void *pArg; /* First arg to busy callback */ + int nBusy; /* Incremented with each busy call */ }; /* @@ -298,30 +298,30 @@ extern int sqlite3_iMallocReset; /* Set iMallocFail to this when it reaches 0 */ /* ** Forward references to structures */ +typedef struct AggExpr AggExpr; +typedef struct AuthContext AuthContext; +typedef struct CollSeq CollSeq; typedef struct Column Column; -typedef struct Table Table; -typedef struct Index Index; +typedef struct Db Db; typedef struct Expr Expr; typedef struct ExprList ExprList; -typedef struct Parse Parse; -typedef struct Token Token; -typedef struct IdList IdList; -typedef struct SrcList SrcList; -typedef struct WhereInfo WhereInfo; -typedef struct WhereLevel WhereLevel; -typedef struct Select Select; -typedef struct AggExpr AggExpr; -typedef struct FuncDef FuncDef; -typedef struct Trigger Trigger; -typedef struct TriggerStep TriggerStep; -typedef struct TriggerStack TriggerStack; typedef struct FKey FKey; -typedef struct Db Db; -typedef struct AuthContext AuthContext; +typedef struct FuncDef FuncDef; +typedef struct IdList IdList; +typedef struct Index Index; typedef struct KeyClass KeyClass; -typedef struct CollSeq CollSeq; typedef struct KeyInfo KeyInfo; typedef struct NameContext NameContext; +typedef struct Parse Parse; +typedef struct Select Select; +typedef struct SrcList SrcList; +typedef struct Table Table; +typedef struct Token Token; +typedef struct TriggerStack TriggerStack; +typedef struct TriggerStep TriggerStep; +typedef struct Trigger Trigger; +typedef struct WhereInfo WhereInfo; +typedef struct WhereLevel WhereLevel; /* ** Each database file to be accessed by the system is an instance @@ -496,17 +496,23 @@ struct sqlite3 { ** points to a linked list of these structures. */ struct FuncDef { - char *zName; /* SQL name of the function */ - int nArg; /* Number of arguments. -1 means unlimited */ + i16 nArg; /* Number of arguments. -1 means unlimited */ u8 iPrefEnc; /* Preferred text encoding (SQLITE_UTF8, 16LE, 16BE) */ + u8 needCollSeq; /* True if sqlite3GetFuncCollSeq() might be called */ + u8 flags; /* Some combination of SQLITE_FUNC_* */ void *pUserData; /* User data parameter */ FuncDef *pNext; /* Next function with same name */ void (*xFunc)(sqlite3_context*,int,sqlite3_value**); /* Regular function */ void (*xStep)(sqlite3_context*,int,sqlite3_value**); /* Aggregate step */ void (*xFinalize)(sqlite3_context*); /* Aggregate finializer */ - u8 needCollSeq; /* True if sqlite3GetFuncCollSeq() might be called */ + char zName[1]; /* SQL name of the function. MUST BE LAST */ }; +/* +** Possible values for FuncDef.flags +*/ +#define SQLITE_FUNC_LIKEOPT 0x01 /* Candidate for the LIKE optimization */ + /* ** information about each column of an SQL table is held in an instance ** of this structure. @@ -745,6 +751,7 @@ struct Index { char *zName; /* Name of this index */ int nColumn; /* Number of columns in the table used by this index */ int *aiColumn; /* Which columns are used by this index. 1st is 0 */ + unsigned *aiRowEst; /* Result of ANALYZE: Est. rows selected by each column */ Table *pTable; /* The SQL table being indexed */ int tnum; /* Page containing root of this index in database file */ u8 onError; /* OE_Abort, OE_Ignore, OE_Replace, or OE_None */ @@ -839,12 +846,13 @@ struct Expr { /* ** The following are the meanings of bits in the Expr.flags field. */ -#define EP_FromJoin 0x0001 /* Originated in ON or USING clause of a join */ -#define EP_Agg 0x0002 /* Contains one or more aggregate functions */ -#define EP_Resolved 0x0004 /* IDs have been resolved to COLUMNs */ -#define EP_Error 0x0008 /* Expression contains one or more errors */ -#define EP_Not 0x0010 /* Operator preceeded by NOT */ -#define EP_VarSelect 0x0020 /* pSelect is correlated, not constant */ +#define EP_FromJoin 0x01 /* Originated in ON or USING clause of a join */ +#define EP_Agg 0x02 /* Contains one or more aggregate functions */ +#define EP_Resolved 0x04 /* IDs have been resolved to COLUMNs */ +#define EP_Error 0x08 /* Expression contains one or more errors */ +#define EP_Not 0x10 /* Operator preceeded by NOT */ +#define EP_VarSelect 0x20 /* pSelect is correlated, not constant */ +#define EP_Dequoted 0x40 /* True if the string has been dequoted */ /* ** These macros can be used to test, set, or clear bits in the @@ -924,8 +932,8 @@ struct SrcList { char *zAlias; /* The "B" part of a "A AS B" phrase. zName is the "A" */ Table *pTab; /* An SQL table corresponding to zName */ Select *pSelect; /* A SELECT statement used in place of a table name */ - int jointype; /* Type of join between this table and the next */ - int iCursor; /* The VDBE cursor number used to access this table */ + u8 jointype; /* Type of join between this table and the next */ + i16 iCursor; /* The VDBE cursor number used to access this table */ Expr *pOn; /* The ON clause of a join */ IdList *pUsing; /* The USING clause of a join */ Bitmask colUsed; /* Bit N (1<