Lines Matching defs:char
495 SQLITE_API const char sqlite3_version[] = SQLITE_VERSION;
496 SQLITE_API const char *sqlite3_libversion(void);
497 SQLITE_API const char *sqlite3_sourceid(void);
523 SQLITE_API int sqlite3_compileoption_used(const char *zOptName);
524 SQLITE_API const char *sqlite3_compileoption_get(int N);
671 typedef int (*sqlite3_callback)(void*,int,char**, char**);
737 const char *sql, /* SQL to be evaluated */
738 int (*callback)(void*,int,char**,char**), /* Callback function */
740 char **errmsg /* Error msg written here */
1301 ** [sqlite3_malloc()] and the result is stored in the char* variable
1305 ** do anything. Callers should initialize the char* variable to a NULL
1323 ** pointers to strings (char**) in which the second element of the array
1327 ** of the char** argument point to a string obtained from [sqlite3_mprintf()]
1360 ** argument should be a char** which will be filled with the filename
1587 ** xOpen method of a [VFS]. It may be cast to (const char*) and treated
1601 typedef const char *sqlite3_filename;
1779 const char *zName; /* Name of this virtual file system */
1783 int (*xDelete)(sqlite3_vfs*, const char *zName, int syncDir);
1784 int (*xAccess)(sqlite3_vfs*, const char *zName, int flags, int *pResOut);
1785 int (*xFullPathname)(sqlite3_vfs*, const char *zName, int nOut, char *zOut);
1786 void *(*xDlOpen)(sqlite3_vfs*, const char *zFilename);
1787 void (*xDlError)(sqlite3_vfs*, int nByte, char *zErrMsg);
1788 void (*(*xDlSym)(sqlite3_vfs*,void*, const char *zSymbol))(void);
1790 int (*xRandomness)(sqlite3_vfs*, int nByte, char *zOut);
1793 int (*xGetLastError)(sqlite3_vfs*, int, char *);
1803 int (*xSetSystemCall)(sqlite3_vfs*, const char *zName, sqlite3_syscall_ptr);
1804 sqlite3_syscall_ptr (*xGetSystemCall)(sqlite3_vfs*, const char *zName);
1805 const char *(*xNextSystemCall)(sqlite3_vfs*, const char *zName);
2287 ** function with a call signature of void(*)(void*,int,const char*),
2340 ** be a pointer to a function of type void(*)(void*,sqlite3*,const char*, int).
2747 #define SQLITE_DBCONFIG_MAINDBNAME 1000 /* const char* */
3026 SQLITE_API int sqlite3_complete(const char *sql);
3188 const char *zSql, /* SQL to be evaluated */
3189 char ***pazResult, /* Results of the query */
3192 char **pzErrmsg /* Error msg written here */
3194 SQLITE_API void sqlite3_free_table(char **result);
3236 SQLITE_API char *sqlite3_mprintf(const char*,...);
3237 SQLITE_API char *sqlite3_vmprintf(const char*, va_list);
3238 SQLITE_API char *sqlite3_snprintf(int,char*,const char*, ...);
3239 SQLITE_API char *sqlite3_vsnprintf(int,char*,const char*, va_list);
3463 int (*xAuth)(void*,int,const char*,const char*,const char*,const char*),
3570 void(*xTrace)(void*,const char*), void*);
3572 void(*xProfile)(void*,const char*,sqlite3_uint64), void*);
3975 const char *filename, /* Database filename (UTF-8) */
3983 const char *filename, /* Database filename (UTF-8) */
3986 const char *zVfs /* Name of VFS module to use */
4055 SQLITE_API const char *sqlite3_uri_parameter(sqlite3_filename z, const char *zParam);
4056 SQLITE_API int sqlite3_uri_boolean(sqlite3_filename z, const char *zParam, int bDefault);
4057 SQLITE_API sqlite3_int64 sqlite3_uri_int64(sqlite3_filename, const char*, sqlite3_int64);
4058 SQLITE_API const char *sqlite3_uri_key(sqlite3_filename z, int N);
4087 SQLITE_API const char *sqlite3_filename_database(sqlite3_filename);
4088 SQLITE_API const char *sqlite3_filename_journal(sqlite3_filename);
4089 SQLITE_API const char *sqlite3_filename_wal(sqlite3_filename);
4108 SQLITE_API sqlite3_file *sqlite3_database_file_object(const char*);
4156 const char *zDatabase,
4157 const char *zJournal,
4158 const char *zWal,
4160 const char **azParam
4226 SQLITE_API const char *sqlite3_errmsg(sqlite3*);
4228 SQLITE_API const char *sqlite3_errstr(int);
4509 const char *zSql, /* SQL statement, UTF-8 encoded */
4512 const char **pzTail /* OUT: Pointer to unused portion of zSql */
4516 const char *zSql, /* SQL statement, UTF-8 encoded */
4519 const char **pzTail /* OUT: Pointer to unused portion of zSql */
4523 const char *zSql, /* SQL statement, UTF-8 encoded */
4527 const char **pzTail /* OUT: Pointer to unused portion of zSql */
4593 SQLITE_API const char *sqlite3_sql(sqlite3_stmt *pStmt);
4594 SQLITE_API char *sqlite3_expanded_sql(sqlite3_stmt *pStmt);
4596 SQLITE_API const char *sqlite3_normalized_sql(sqlite3_stmt *pStmt);
4886 SQLITE_API int sqlite3_bind_text(sqlite3_stmt*,int,const char*,int,void(*)(void*));
4888 SQLITE_API int sqlite3_bind_text64(sqlite3_stmt*, int, const char*, sqlite3_uint64,
4889 void(*)(void*), unsigned char encoding);
4891 SQLITE_API int sqlite3_bind_pointer(sqlite3_stmt*, int, void*, const char*,void(*)(void*));
4942 SQLITE_API const char *sqlite3_bind_parameter_name(sqlite3_stmt*, int);
4960 SQLITE_API int sqlite3_bind_parameter_index(sqlite3_stmt*, const char *zName);
5015 SQLITE_API const char *sqlite3_column_name(sqlite3_stmt*, int N);
5060 SQLITE_API const char *sqlite3_column_database_name(sqlite3_stmt*,int);
5062 SQLITE_API const char *sqlite3_column_table_name(sqlite3_stmt*,int);
5064 SQLITE_API const char *sqlite3_column_origin_name(sqlite3_stmt*,int);
5097 SQLITE_API const char *sqlite3_column_decltype(sqlite3_stmt*,int);
5185 SQLITE_API int sqlite3_set_droptable_handle(sqlite3*, void (*xFunc)(sqlite3*,const char*,const char*));
5457 SQLITE_API const unsigned char *sqlite3_column_text(sqlite3_stmt*, int iCol);
5644 const char *zFunctionName,
5664 const char *zFunctionName,
5675 const char *zFunctionName,
5931 SQLITE_API void *sqlite3_value_pointer(sqlite3_value*, const char*);
5932 SQLITE_API const unsigned char *sqlite3_value_text(sqlite3_value*);
6276 SQLITE_API void sqlite3_result_error(sqlite3_context*, const char*, int);
6284 SQLITE_API void sqlite3_result_text(sqlite3_context*, const char*, int, void(*)(void*));
6285 SQLITE_API void sqlite3_result_text64(sqlite3_context*, const char*,sqlite3_uint64,
6286 void(*)(void*), unsigned char encoding);
6291 SQLITE_API void sqlite3_result_pointer(sqlite3_context*, void*,const char*,void(*)(void*));
6393 const char *zName,
6400 const char *zName,
6444 void(*)(void*,sqlite3*,int eTextRep,const char*)
6466 const char *zDbName, /* Name of the database */
6484 const char *zDbName, /* Name of the database */
6496 const char *zPassPhrase /* Activation phrase */
6568 ** char zPathBuf[MAX_PATH + 1];
6575 SQLITE_API char *sqlite3_temp_directory;
6612 SQLITE_API char *sqlite3_data_directory;
6637 SQLITE_API int sqlite3_win32_set_directory8(unsigned long type, const char *zValue);
6706 SQLITE_API const char *sqlite3_db_name(sqlite3 *db, int N);
6738 SQLITE_API sqlite3_filename sqlite3_db_filename(sqlite3 *db, const char *zDbName);
6748 SQLITE_API int sqlite3_db_readonly(sqlite3 *db, const char *zDbName);
6766 SQLITE_API int sqlite3_txn_state(sqlite3*,const char *zSchema);
6916 ** const char *zSchema,
6927 unsigned int(*)(void*,const char*,unsigned int,unsigned int,unsigned int),
6984 void(*)(void *,int ,char const *,char const *,sqlite3_int64),
7179 ** <tr><td> 5th <td> const char* <td> Data type
7180 ** <tr><td> 6th <td> const char* <td> Name of default collation sequence
7214 const char *zDbName, /* Database name or NULL */
7215 const char *zTableName, /* Table name */
7216 const char *zColumnName, /* Column name */
7217 char const **pzDataType, /* OUTPUT: Declared data type */
7218 char const **pzCollSeq, /* OUTPUT: Collation sequence name */
7270 const char *zFile, /* Name of the shared library containing extension */
7271 const char *zProc, /* Entry point. Derived from zFile if 0 */
7272 char **pzErrMsg /* Put error message here if not 0 */
7318 ** const char **pzErrMsg,
7396 int argc, const char *const*argv,
7397 sqlite3_vtab **ppVTab, char**);
7399 int argc, const char *const*argv,
7400 sqlite3_vtab **ppVTab, char**);
7406 int (*xFilter)(sqlite3_vtab_cursor*, int idxNum, const char *idxStr,
7417 int (*xFindFunction)(sqlite3_vtab *pVtab, int nArg, const char *zName,
7420 int (*xRename)(sqlite3_vtab *pVtab, const char *zNew);
7428 int (*xShadowName)(const char*);
7538 unsigned char op; /* Constraint operator */
7539 unsigned char usable; /* True if this constraint is usable */
7545 unsigned char desc; /* True for DESC. False for ASC. */
7550 unsigned char omit; /* Do not code a test for this constraint */
7553 char *idxStr; /* String, possibly obtained from sqlite3_malloc */
7664 const char *zName, /* Name of the module */
7670 const char *zName, /* Name of the module */
7690 const char **azKeep /* Except, do not remove the ones named here */
7714 char *zErrMsg; /* Error message from sqlite3_mprintf() */
7748 SQLITE_API int sqlite3_declare_vtab(sqlite3*, const char *zSQL);
7767 SQLITE_API int sqlite3_overload_function(sqlite3*, const char *zFuncName, int nArg);
7878 const char *zDb,
7879 const char *zTable,
7880 const char *zColumn,
8050 SQLITE_API sqlite3_vfs *sqlite3_vfs_find(const char *zVfsName);
8370 SQLITE_API int sqlite3_file_control(sqlite3*, const char *zDbName, int op, void*);
8484 SQLITE_API int sqlite3_keyword_name(int,const char**,int*);
8485 SQLITE_API int sqlite3_keyword_check(const char*,int);
8545 SQLITE_API char *sqlite3_str_finish(sqlite3_str*);
8579 SQLITE_API void sqlite3_str_appendf(sqlite3_str*, const char *zFormat, ...);
8580 SQLITE_API void sqlite3_str_vappendf(sqlite3_str*, const char *zFormat, va_list);
8581 SQLITE_API void sqlite3_str_append(sqlite3_str*, const char *zIn, int N);
8582 SQLITE_API void sqlite3_str_appendall(sqlite3_str*, const char *zIn);
8583 SQLITE_API void sqlite3_str_appendchar(sqlite3_str*, int N, char C);
8617 SQLITE_API char *sqlite3_str_value(sqlite3_str*);
9412 const char *zDestName, /* Destination database name */
9414 const char *zSourceName /* Source database name */
9551 SQLITE_API int sqlite3_stricmp(const char *, const char *);
9552 SQLITE_API int sqlite3_strnicmp(const char *, const char *, int);
9569 SQLITE_API int sqlite3_strglob(const char *zGlob, const char *zStr);
9592 SQLITE_API int sqlite3_strlike(const char *zGlob, const char *zStr, unsigned int cEsc);
9615 SQLITE_API void sqlite3_log(int iErrCode, const char *zFormat, ...);
9654 int(*)(void *,sqlite3*,const char*,int),
9709 SQLITE_API int sqlite3_wal_checkpoint(sqlite3 *db, const char *zDb);
9805 const char *zDb, /* Name of attached database (or NULL) */
9934 int (*xPutString)(void *pCtx, int addedRows, int column, const char* text, int len);
10003 SQLITE_API SQLITE_EXPERIMENTAL const char *sqlite3_vtab_collation(sqlite3_index_info*,int);
10290 ** <dd>^The "const char *" variable pointed to by the V parameter will be set
10295 ** <dd>^The "const char *" variable pointed to by the V parameter will be set
10495 char const *zDb, /* Database name */
10496 char const *zName, /* Table name */
10543 unsigned char hidden[48];
10591 const char *zSchema,
10640 const char *zSchema,
10710 SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_snapshot_recover(sqlite3 *db, const char *zDb);
10748 SQLITE_API unsigned char *sqlite3_serialize(
10750 const char *zSchema, /* Which DB to serialize. ex: "main", "temp", ... */
10806 const char *zSchema, /* Which DB to reopen with the deserialization */
10807 unsigned char *pData, /* The serialized database content */
10893 const char *zGeom,
10919 const char *zQueryFunc,
11032 const char *zDb, /* Name of db (e.g. "main") */
11194 const char *zTab /* Table name */
11211 const char *zTab /* Table name */
11402 const char *zFromDb,
11403 const char *zTbl,
11404 char **pzErrMsg
11594 const char **pzTab, /* OUT: Pointer to table name */
11628 unsigned char **pabPK, /* OUT: Array of boolean - true for PK cols */
12168 const char *zTab /* Table name */
12183 const char *zTab /* Table name */
12566 const char *zTab /* Table name */
12581 const char *zTab /* Table name */
12742 const unsigned char *a;
12743 const unsigned char *b;
12967 const char *pText, int nText, /* Text to tokenize */
12969 int (*xToken)(void*, int, const char*, int, int, int) /* Callback */
12979 int (*xColumnText)(Fts5Context*, int iCol, const char **pz, int *pn);
13194 int (*xCreate)(void*, const char **azArg, int nArg, Fts5Tokenizer **ppOut);
13199 const char *pText, int nText,
13203 const char *pToken, /* Pointer to buffer containing token */
13235 const char *zName,
13244 const char *zName,
13252 const char *zName,
13552 ** the ((void*)&((char*)0)[X]) construct. But MSVC chokes on ((void*)(X)).
13563 # define SQLITE_INT_TO_PTR(X) ((void*)&((char*)0)[X])
13564 # define SQLITE_PTR_TO_INT(X) ((int)(((char*)X)-(char*)0))
13949 const char *pKey; /* Key associated with this element */
13956 SQLITE_PRIVATE void *sqlite3HashInsert(Hash*, const char *pKey, void *pData);
13957 SQLITE_PRIVATE void *sqlite3HashFind(const Hash*, const char *pKey);
14190 # define memcpy(D,S,N) {char*xxd=(char*)(D);const char*xxs=(const char*)(S);\
14306 #define offsetof(STRUCTURE,FIELD) ((int)((char*)&((STRUCTURE*)0)->FIELD))
14366 # define UINT8_TYPE unsigned char
14373 # define INT8_TYPE signed char
14505 # define SQLITE_BIGENDIAN (*(char *)(&sqlite3one)==0)
14506 # define SQLITE_LITTLEENDIAN (*(char *)(&sqlite3one)==1)
14551 # define EIGHT_BYTE_ALIGNMENT(X) ((((char*)(X) - (char*)0)&3)==0)
14553 # define EIGHT_BYTE_ALIGNMENT(X) ((((char*)(X) - (char*)0)&7)==0)
15140 SQLITE_PRIVATE int sqlite3OsOpen(sqlite3_vfs *, const char *, sqlite3_file*, int, int *);
15141 SQLITE_PRIVATE int sqlite3OsDelete(sqlite3_vfs *, const char *, int);
15142 SQLITE_PRIVATE int sqlite3OsAccess(sqlite3_vfs *, const char *, int, int *pResOut);
15143 SQLITE_PRIVATE int sqlite3OsFullPathname(sqlite3_vfs *, const char *, int, char *);
15145 SQLITE_PRIVATE void *sqlite3OsDlOpen(sqlite3_vfs *, const char *);
15146 SQLITE_PRIVATE void sqlite3OsDlError(sqlite3_vfs *, int, char *);
15147 SQLITE_PRIVATE void (*sqlite3OsDlSym(sqlite3_vfs *, void *, const char *))(void);
15150 SQLITE_PRIVATE int sqlite3OsRandomness(sqlite3_vfs *, int, char *);
15159 SQLITE_PRIVATE int sqlite3OsOpenMalloc(sqlite3_vfs *, const char *, sqlite3_file **, int,int*);
15287 const char*,
15294 SQLITE_PRIVATE int sqlite3PagerReadFileheader(Pager*, int, unsigned char*);
15335 SQLITE_PRIVATE int sqlite3PagerCommitPhaseOne(Pager*,const char *zSuper, int);
15337 SQLITE_PRIVATE int sqlite3PagerSync(Pager *pPager, const char *zSuper);
15382 SQLITE_PRIVATE const char *sqlite3PagerFilename(const Pager*, int);
15386 SQLITE_PRIVATE const char *sqlite3PagerJournalname(Pager*);
15469 const char *zFilename, /* Name of database file to open */
15504 SQLITE_PRIVATE int sqlite3BtreeCommitPhaseOne(Btree*, const char*);
15528 SQLITE_PRIVATE const char *sqlite3BtreeGetFilename(Btree *);
15529 SQLITE_PRIVATE const char *sqlite3BtreeGetJournalname(Btree *);
15754 SQLITE_PRIVATE char *sqlite3BtreeIntegrityCheck(sqlite3*,Btree*,Pgno*aRoot,int nRoot,int,int*);
15884 signed char p4type; /* One of the P4_xxx constants for p4 */
15892 char *z; /* Pointer to data for string (char array) types */
15909 char *zComment; /* Comment to improve readability */
15942 signed char p1; /* First operand */
15943 signed char p2; /* Second parameter (often the jump destination) */
15944 signed char p3; /* Third parameter */
16262 SQLITE_PRIVATE int sqlite3VdbeLoadString(Vdbe*,int,const char*);
16263 SQLITE_PRIVATE void sqlite3VdbeMultiLoad(Vdbe*,int,const char*,...);
16265 SQLITE_PRIVATE int sqlite3VdbeAddOp4(Vdbe*,int,int,int,int,const char *zP4,int);
16286 SQLITE_PRIVATE void sqlite3VdbeExplain(Parse*,u8,const char*,...);
16299 SQLITE_PRIVATE void sqlite3ExplainBreakpoint(const char*,const char*);
16303 SQLITE_PRIVATE void sqlite3VdbeAddParseSchemaOp(Vdbe*, int, char*, u16);
16319 SQLITE_PRIVATE void sqlite3VdbeChangeP4(Vdbe*, int addr, const char *zP4, int N);
16340 SQLITE_PRIVATE int sqlite3VdbeSetColName(Vdbe*, int, int, const char *, void(*)(void*));
16344 SQLITE_PRIVATE void sqlite3VdbeSetSql(Vdbe*, const char *z, int n, u8);
16346 SQLITE_PRIVATE void sqlite3VdbeAddDblquoteStr(sqlite3*,Vdbe*,const char*);
16347 SQLITE_PRIVATE int sqlite3VdbeUsesDoubleQuotedString(Vdbe*,const char*);
16354 SQLITE_PRIVATE char *sqlite3VdbeExpandSql(Vdbe*, const char*);
16383 SQLITE_PRIVATE void sqlite3VdbeComment(Vdbe*, const char*, ...);
16385 SQLITE_PRIVATE void sqlite3VdbeNoopComment(Vdbe*, const char*, ...);
16465 SQLITE_PRIVATE void sqlite3VdbeScanStatus(Vdbe*, int, int, int, LogEst, const char*);
16789 char *zDbSName; /* Name of this database. (schema name, not filename) */
16958 char *zAuthPW; /* Password used to authenticate */
16959 char *zAuthUser; /* User name used to authenticate */
16969 SQLITE_PRIVATE int sqlite3UserAuthTable(const char*);
16970 SQLITE_PRIVATE int sqlite3UserAuthCheckLogin(sqlite3*,const char*,u8*);
16980 typedef int (*sqlite3_xauth)(void*,int,const char*,const char*,const char*,
16981 const char*, const char*);
16983 typedef int (*sqlite3_xauth)(void*,int,const char*,const char*,const char*,
16984 const char*);
17005 typedef void (*sqlite3_xDropTableHandle)(sqlite3*, const char*, const char*);
17034 signed char nextAutovac; /* Autovac setting after VACUUM if >=0 */
17054 const char **azInit; /* "type", "name", and "tbl_name" columns */
17064 void (*xLegacy)(void*,const char*); /* mTrace==SQLITE_TRACE_LEGACY */
17069 void (*xProfile)(void*,const char*,u64); /* Profiling function */
17077 void (*xUpdateCallback)(void*,int, const char*,const char*,sqlite_int64);
17080 unsigned int (*xAutovacPages)(void*,const char*,u32,u32,u32);
17085 void*,sqlite3*,int,char const*,char const*,sqlite3_int64,sqlite3_int64
17090 int (*xWalCallback)(void *, sqlite3 *, const char *, int);
17093 void(*xCollNeeded)(void*,sqlite3*,int eTextRep,const char*);
17152 char *mDropTableName;
17153 char *mDropSchemaName;
17316 const char *zName; /* SQL name of the function. */
17520 char *zName; /* Savepoint name (nul-terminated) */
17542 const char *zName; /* Name passed to create_module() */
17575 char *zCnName; /* Name of this column */
17578 char affinity; /* One of the SQLITE_AFF_... values */
17632 char *zName; /* Name of the collating sequence, UTF-8 encoded */
17752 char *zName; /* Name of the table or view */
17755 char *zColAff; /* String defining the affinity of each column */
17783 char **azArg; /* 0: module 1: schema 2: vtab name 3...: args */
17903 char *zTo; /* Name of table that the key points to (aka: Parent) */
17913 char *zCol; /* Name of column in zTo. If NULL use PRIMARY KEY */
18026 char *z; /* Cache of aMem[0].z for vdbeRecordCompareString() */
18086 char *zName; /* Name of this index */
18090 char *zColAff; /* String defining the affinity of each column */
18094 const char **azColl; /* Array of collation sequence names for index */
18175 const char *z; /* Text of the token. Not NULL-terminated! */
18306 char affExpr; /* affinity, or RAISE type */
18316 char *zToken; /* Token value. Zero terminated and dequoted */
18505 char *zEName; /* Token associated with this expression */
18555 char *zName; /* Name of the identifier */
18592 char *zDatabase; /* Name of database holding this table */
18593 char *zName; /* Name of the table */
18594 char *zAlias; /* The "B" part of a "A AS B" phrase. zName is the "A" */
18624 char *zIndexedBy; /* Identifier from "INDEXED BY <zIndex>" clause */
18992 char *zAffSdst; /* Affinity used for SRT_Set, SRT_Table, and similar */
19042 typedef unsigned char yDbMask[(SQLITE_MAX_ATTACHED+9)/8];
19075 const char *zIdxName; /* Name of index, used only for bytecode comments */
19108 char *zErrMsg; /* An error message */
19198 const char *zTail; /* All SQL text past the last semicolon parsed */
19204 const char *zAuthContext; /* The 6th parameter to db->xAuth callbacks */
19225 #define PARSE_HDR(X) (((char*)(X))+offsetof(Parse,zErrMsg))
19229 #define PARSE_TAIL(X) (((char*)(X))+PARSE_RECURSE_SZ) /* Pointer to tail */
19257 const char *zAuthContext; /* Put saved Parse.zAuthContext here */
19310 char *zName; /* The name of the trigger */
19311 char *table; /* The table or view to which the trigger applies */
19383 char *zTarget; /* Target table for DELETE, UPDATE, INSERT */
19389 char *zSpan; /* Original SQL text of this command */
19413 char *zText; /* The string collected so far */
19433 char **pzErrMsg; /* Error message stored here */
19506 void (*xLog)(void*,int,const char*); /* Function for logging */
19509 void(*xSqllog)(void*,sqlite3*,const char*, int);
19595 const char *zDb; /* Make sure all objects are contained in this database */
19596 const char *zType; /* Type of the container - used for error messages */
19635 char *zName; /* Name of this CTE */
19638 const char *zCteErr; /* Error message for circular references */
19717 char *zName; /* Name of window (may be NULL) */
19718 char *zBase; /* Name of base window for chaining (may be NULL) */
19788 SQLITE_PRIVATE int sqlite3ReportError(int iErr, int lineno, const char *zType);
19843 # define sqlite3Toupper(x) ((x)&~(sqlite3CtypeMap[(unsigned char)(x)]&0x20))
19844 # define sqlite3Isspace(x) (sqlite3CtypeMap[(unsigned char)(x)]&0x01)
19845 # define sqlite3Isalnum(x) (sqlite3CtypeMap[(unsigned char)(x)]&0x06)
19846 # define sqlite3Isalpha(x) (sqlite3CtypeMap[(unsigned char)(x)]&0x02)
19847 # define sqlite3Isdigit(x) (sqlite3CtypeMap[(unsigned char)(x)]&0x04)
19848 # define sqlite3Isxdigit(x) (sqlite3CtypeMap[(unsigned char)(x)]&0x08)
19849 # define sqlite3Tolower(x) (sqlite3UpperToLower[(unsigned char)(x)])
19850 # define sqlite3Isquote(x) (sqlite3CtypeMap[(unsigned char)(x)]&0x80)
19852 # define sqlite3Toupper(x) toupper((unsigned char)(x))
19853 # define sqlite3Isspace(x) isspace((unsigned char)(x))
19854 # define sqlite3Isalnum(x) isalnum((unsigned char)(x))
19855 # define sqlite3Isalpha(x) isalpha((unsigned char)(x))
19856 # define sqlite3Isdigit(x) isdigit((unsigned char)(x))
19857 # define sqlite3Isxdigit(x) isxdigit((unsigned char)(x))
19858 # define sqlite3Tolower(x) tolower((unsigned char)(x))
19866 SQLITE_PRIVATE int sqlite3StrICmp(const char*,const char*);
19867 SQLITE_PRIVATE int sqlite3Strlen30(const char*);
19869 SQLITE_PRIVATE char *sqlite3ColumnType(Column*,char*);
19879 SQLITE_PRIVATE char *sqlite3DbStrDup(sqlite3*,const char*);
19880 SQLITE_PRIVATE char *sqlite3DbStrNDup(sqlite3*,const char*, u64);
19881 SQLITE_PRIVATE char *sqlite3DbSpanDup(sqlite3*,const char*,const char*);
19981 SQLITE_PRIVATE char *sqlite3MPrintf(sqlite3*,const char*, ...);
19982 SQLITE_PRIVATE char *sqlite3VMPrintf(sqlite3*,const char*, va_list);
19984 SQLITE_PRIVATE void sqlite3DebugPrintf(const char*, ...);
19987 SQLITE_PRIVATE void *sqlite3TestTextToPtr(const char*);
19991 SQLITE_PRIVATE void sqlite3TreeViewLine(TreeView*, const char *zFormat, ...);
19993 SQLITE_PRIVATE void sqlite3TreeViewBareExprList(TreeView*, const ExprList*, const char*);
19994 SQLITE_PRIVATE void sqlite3TreeViewExprList(TreeView*, const ExprList*, u8, const char*);
19995 SQLITE_PRIVATE void sqlite3TreeViewBareIdList(TreeView*, const IdList*, const char*);
19996 SQLITE_PRIVATE void sqlite3TreeViewIdList(TreeView*, const IdList*, u8, const char*);
20039 SQLITE_PRIVATE void sqlite3SetString(char **, sqlite3*, const char*);
20040 SQLITE_PRIVATE void sqlite3ErrorMsg(Parse*, const char*, ...);
20042 SQLITE_PRIVATE void sqlite3Dequote(char*);
20045 SQLITE_PRIVATE void sqlite3TokenInit(Token*,char*);
20046 SQLITE_PRIVATE int sqlite3KeywordCode(const unsigned char*, int);
20047 SQLITE_PRIVATE int sqlite3RunParser(Parse*, const char*);
20058 SQLITE_PRIVATE Expr *sqlite3Expr(sqlite3*,int,const char*);
20075 SQLITE_PRIVATE void sqlite3ExprListSetSpan(Parse*,ExprList*,const char*,const char*);
20079 SQLITE_PRIVATE int sqlite3Init(sqlite3*, char**);
20080 SQLITE_PRIVATE int sqlite3InitCallback(void*, int, char**, char**);
20081 SQLITE_PRIVATE int sqlite3InitOne(sqlite3*, int, char**, u32);
20084 SQLITE_PRIVATE Module *sqlite3PragmaVtabRegister(sqlite3*,const char *zName);
20092 SQLITE_PRIVATE void sqlite3ColumnSetColl(sqlite3*,Column*,const char*zColl);
20093 SQLITE_PRIVATE const char *sqlite3ColumnColl(Column*);
20097 SQLITE_PRIVATE void sqlite3SelectAddColumnTypeAndCollation(Parse*,Table*,Select*,char);
20098 SQLITE_PRIVATE Table *sqlite3ResultSetOfSelect(Parse*,Select*,char);
20118 SQLITE_PRIVATE void sqlite3AddCheckConstraint(Parse*, Expr*, const char*, const char*);
20119 SQLITE_PRIVATE void sqlite3AddDefaultValue(Parse*,Expr*,const char*,const char*);
20124 SQLITE_PRIVATE int sqlite3ParseUri(const char*,const char*,unsigned int*,
20125 sqlite3_vfs**,char**,char **);
20127 SQLITE_PRIVATE int sqlite3CodecQueryParameters(sqlite3*,const char*,const char*);
20131 SQLITE_PRIVATE Btree *sqlite3DbNameToBtree(sqlite3*,const char*);
20185 SQLITE_PRIVATE int sqlite3IdListIndex(IdList*,const char*);
20199 SQLITE_PRIVATE Index *sqlite3AllocateIndexObject(sqlite3*,i16,int,char**);
20211 SQLITE_PRIVATE Expr *sqlite3LimitWhere(Parse*,SrcList*,Expr*,ExprList*,Expr*,char*);
20213 SQLITE_PRIVATE void sqlite3CodeChangeCount(Vdbe*,int,const char*);
20254 SQLITE_PRIVATE Table *sqlite3FindTable(sqlite3*,const char*, const char*);
20257 SQLITE_PRIVATE Table *sqlite3LocateTable(Parse*,u32 flags,const char*, const char*);
20258 SQLITE_PRIVATE const char *sqlite3PreferredTableName(const char*);
20260 SQLITE_PRIVATE Index *sqlite3FindIndex(sqlite3*,const char*, const char*);
20261 SQLITE_PRIVATE void sqlite3UnlinkAndDeleteTable(sqlite3*,int,const char*);
20262 SQLITE_PRIVATE void sqlite3UnlinkAndDeleteIndex(sqlite3*,int,const char*);
20264 SQLITE_PRIVATE int sqlite3RunVacuum(char**, sqlite3*, int, sqlite3_value*);
20265 SQLITE_PRIVATE char *sqlite3NameFromToken(sqlite3*, const Token*);
20283 SQLITE_PRIVATE void sqlite3CodeVerifyNamedSchema(Parse*, const char *zDb);
20289 SQLITE_PRIVATE u32 sqlite3IsTrueOrFalse(const char*);
20303 SQLITE_PRIVATE int sqlite3ExprNeedsNoAffinityChange(const Expr*, char);
20304 SQLITE_PRIVATE int sqlite3IsRowid(const char*);
20323 SQLITE_PRIVATE void sqlite3HaltConstraint(Parse*, int, int, char*, i8, u8);
20331 SQLITE_PRIVATE FuncDef *sqlite3FunctionSearch(int,const char*);
20333 SQLITE_PRIVATE FuncDef *sqlite3FindFunction(sqlite3*,const char*,int,u8,u8);
20365 const char*,const char*);
20368 const char*,const char*);
20370 Expr*, u8, const char*,const char*);
20372 const char*,const char*);
20374 SQLITE_PRIVATE void sqlite3UnlinkAndDeleteTrigger(sqlite3*,int,const char*);
20394 SQLITE_PRIVATE int sqlite3ColumnIndex(Table *pTab, const char *zCol);
20401 SQLITE_PRIVATE int sqlite3AuthCheck(Parse*,int, const char*, const char*, const char*);
20402 SQLITE_PRIVATE void sqlite3AuthContextPush(Parse*, AuthContext*, const char*);
20404 SQLITE_PRIVATE int sqlite3AuthReadCol(Parse*, const char *, const char *, int);
20411 SQLITE_PRIVATE int sqlite3DbIsNamed(sqlite3 *db, int iDb, const char *zName);
20414 SQLITE_PRIVATE void sqlite3FixInit(DbFixer*, Parse*, int, const char*, const Token*);
20421 SQLITE_PRIVATE void sqlite3Int64ToText(i64,char*);
20422 SQLITE_PRIVATE int sqlite3AtoF(const char *z, double*, int, u8);
20423 SQLITE_PRIVATE int sqlite3GetInt32(const char *, int*);
20424 SQLITE_PRIVATE int sqlite3GetUInt32(const char*, u32*);
20425 SQLITE_PRIVATE int sqlite3Atoi(const char*);
20429 SQLITE_PRIVATE int sqlite3Utf8CharLen(const char *pData, int nByte);
20435 SQLITE_PRIVATE VList *sqlite3VListAdd(sqlite3*,VList*,const char*,int,int);
20436 SQLITE_PRIVATE const char *sqlite3VListNumToName(VList*,int);
20437 SQLITE_PRIVATE int sqlite3VListNameToNum(VList*,const char*,int);
20444 SQLITE_PRIVATE int sqlite3PutVarint(unsigned char*, u64);
20445 SQLITE_PRIVATE u8 sqlite3GetVarint(const unsigned char *, u64 *);
20446 SQLITE_PRIVATE u8 sqlite3GetVarint32(const unsigned char *, u32 *);
20459 (u8)(((u32)(B)<(u32)0x80)?(*(A)=(unsigned char)(B)),1:\
20465 SQLITE_PRIVATE const char *sqlite3IndexAffinityStr(sqlite3*, Index*);
20466 SQLITE_PRIVATE char *sqlite3TableAffinityStr(sqlite3*,const Table*);
20468 SQLITE_PRIVATE char sqlite3CompareAffinity(const Expr *pExpr, char aff2);
20469 SQLITE_PRIVATE int sqlite3IndexAffinityOk(const Expr *pExpr, char idx_affinity);
20470 SQLITE_PRIVATE char sqlite3TableColumnAffinity(const Table*,int);
20471 SQLITE_PRIVATE char sqlite3ExprAffinity(const Expr *pExpr);
20472 SQLITE_PRIVATE int sqlite3Atoi64(const char*, i64*, int, u8);
20473 SQLITE_PRIVATE int sqlite3DecOrHexToI64(const char*, i64*);
20474 SQLITE_PRIVATE void sqlite3ErrorWithMsg(sqlite3*, int, const char*,...);
20478 SQLITE_PRIVATE void *sqlite3HexToBlob(sqlite3*, const char *z, int n);
20483 SQLITE_PRIVATE const char *sqlite3ErrName(int);
20490 SQLITE_PRIVATE const char *sqlite3ErrStr(int);
20492 SQLITE_PRIVATE CollSeq *sqlite3FindCollSeq(sqlite3*,u8 enc, const char*,int);
20494 SQLITE_PRIVATE CollSeq *sqlite3LocateCollSeq(Parse *pParse, const char*zName);
20500 SQLITE_PRIVATE Expr *sqlite3ExprAddCollateString(const Parse*,Expr*,const char*);
20505 SQLITE_PRIVATE int sqlite3CheckObjectName(Parse*, const char*,const char*,const char*);
20512 SQLITE_PRIVATE void sqlite3FileSuffix3(const char*, char*);
20516 SQLITE_PRIVATE u8 sqlite3GetBoolean(const char *z,u8);
20529 SQLITE_PRIVATE char *sqlite3Utf16to8(sqlite3 *, const void*, int, u8);
20534 SQLITE_PRIVATE const unsigned char sqlite3OpcodeProperty[];
20535 SQLITE_PRIVATE const char sqlite3StrBINARY[];
20536 SQLITE_PRIVATE const unsigned char sqlite3StdTypeLen[];
20537 SQLITE_PRIVATE const char sqlite3StdTypeAffinity[];
20538 SQLITE_PRIVATE const char *sqlite3StdType[];
20539 SQLITE_PRIVATE const unsigned char sqlite3UpperToLower[];
20540 SQLITE_PRIVATE const unsigned char *sqlite3aLTb;
20541 SQLITE_PRIVATE const unsigned char *sqlite3aEQb;
20542 SQLITE_PRIVATE const unsigned char *sqlite3aGTb;
20543 SQLITE_PRIVATE const unsigned char sqlite3CtypeMap[];
20558 SQLITE_PRIVATE int sqlite3GetToken(const unsigned char *, int *);
20559 SQLITE_PRIVATE void sqlite3NestedParse(Parse*, const char*, ...);
20568 const char*,
20569 const char*,
20570 const char*
20573 SQLITE_PRIVATE u8 sqlite3StrIHash(const char*);
20578 SQLITE_PRIVATE int sqlite3ResolveOrderGroupBy(Parse*, Select*, ExprList*, const char*);
20587 SQLITE_PRIVATE CollSeq *sqlite3GetCollSeq(Parse*, u8, CollSeq *, const char*);
20588 SQLITE_PRIVATE char sqlite3AffinityType(const char*, Column*);
20592 SQLITE_PRIVATE int sqlite3FindDbName(sqlite3 *, const char *);
20597 SQLITE_PRIVATE int sqlite3IsLikeFunction(sqlite3*,Expr*,int*,char*);
20606 SQLITE_PRIVATE const char *sqlite3SelectOpName(int);
20612 SQLITE_PRIVATE int sqlite3CreateFunc(sqlite3 *, const char *, int, int, void *,
20626 SQLITE_PRIVATE void sqlite3StrAccumInit(StrAccum*, sqlite3*, char*, int, int);
20628 SQLITE_PRIVATE char *sqlite3StrAccumFinish(StrAccum*);
20633 SQLITE_PRIVATE void sqlite3RecordErrorByteOffset(sqlite3*,const char*);
20651 SQLITE_PRIVATE char sqlite3IndexColumnAffinity(sqlite3*, Index*, int);
20675 SQLITE_PRIVATE void sqlite3TableLock(Parse *, int, Pgno, u8, const char *);
20681 SQLITE_PRIVATE int sqlite3Utf8To8(unsigned char*);
20711 const char*,
20720 SQLITE_PRIVATE int sqlite3ShadowTableName(sqlite3 *db, const char *zName);
20721 SQLITE_PRIVATE int sqlite3IsShadowTableOf(sqlite3*,Table*,const char*);
20735 SQLITE_PRIVATE int sqlite3VtabCallCreate(sqlite3*, int, const char *, char **);
20737 SQLITE_PRIVATE int sqlite3VtabCallDestroy(sqlite3*, int, const char *);
20746 SQLITE_PRIVATE int sqlite3VdbeParameterIndex(Vdbe*, const char*, int);
20752 SQLITE_PRIVATE char *sqlite3Normalize(Vdbe*, const char*);
20755 SQLITE_PRIVATE void sqlite3ExprListCheckLength(Parse*, ExprList*, const char*);
20759 SQLITE_PRIVATE const char *sqlite3JournalModename(int);
20762 SQLITE_PRIVATE int sqlite3WalDefaultHook(void*,sqlite3*,const char*,int);
20862 SQLITE_PRIVATE int sqlite3JournalOpen(sqlite3_vfs *, const char *, sqlite3_file *, int, int);
20895 SQLITE_PRIVATE void sqlite3ParserTrace(FILE*, char *);
20909 SQLITE_API SQLITE_EXTERN void (SQLITE_CDECL *sqlite3IoTrace)(const char*,...);
20978 SQLITE_PRIVATE const char **sqlite3CompileOptions(int *pnOpt);
21244 static const char * const sqlite3azCompileOpt[] = {
21977 SQLITE_PRIVATE const char **sqlite3CompileOptions(int *pnOpt){
21979 return (const char**)sqlite3azCompileOpt;
22009 SQLITE_PRIVATE const unsigned char sqlite3UpperToLower[] = {
22071 SQLITE_PRIVATE const unsigned char *sqlite3aLTb = &sqlite3UpperToLower[256-OP_Ne];
22072 SQLITE_PRIVATE const unsigned char *sqlite3aEQb = &sqlite3UpperToLower[256+6-OP_Ne];
22073 SQLITE_PRIVATE const unsigned char *sqlite3aGTb = &sqlite3UpperToLower[256+12-OP_Ne];
22103 SQLITE_PRIVATE const unsigned char sqlite3CtypeMap[256] = {
22352 SQLITE_PRIVATE const unsigned char sqlite3OpcodeProperty[] = OPFLG_INITIALIZER;
22357 SQLITE_PRIVATE const char sqlite3StrBINARY[] = "BINARY";
22371 SQLITE_PRIVATE const unsigned char sqlite3StdTypeLen[] = { 3, 4, 3, 7, 4, 4 };
22372 SQLITE_PRIVATE const char sqlite3StdTypeAffinity[] = {
22380 SQLITE_PRIVATE const char *sqlite3StdType[] = {
22621 const char *zPType; /* Pointer type when MEM_Term|MEM_Subtype|MEM_Null */
22624 char *z; /* String or BLOB value */
22633 char *zMalloc; /* Space to hold MEM_Str or MEM_Blob if szMalloc>0 */
22806 char *zName; /* Name of table or index */
22819 char z[8]; /* Dequoted value for the string */
22858 char *zErrMsg; /* Error message written here */
22881 char *zSql; /* Text of the SQL statement that generated this */
22883 char *zNormSql; /* Normalization of the associated SQL statement */
22964 SQLITE_PRIVATE void sqlite3VdbeError(Vdbe*, const char *, ...);
22979 SQLITE_PRIVATE void sqlite3VdbeSerialGet(const unsigned char*, u32, Mem*);
22988 SQLITE_PRIVATE char *sqlite3VdbeDisplayP4(sqlite3*,Op*);
22991 SQLITE_PRIVATE char *sqlite3VdbeDisplayComment(sqlite3*,const Op*,const char*);
23003 SQLITE_PRIVATE int sqlite3VdbeMemSetStr(Mem*, const char*, i64, u8, void(*)(void*));
23010 SQLITE_PRIVATE void sqlite3VdbeMemSetPointer(Mem*, void*, const char*, void(*)(void*));
23042 SQLITE_PRIVATE const char *sqlite3OpcodeName(int);
23055 Vdbe*,VdbeCursor*,int,const char*,Table*,i64,int,int);
23139 static const char statMutex[] = {
23576 char validJD; /* True (1) if iJD is valid */
23577 char rawS; /* Raw numeric value stored in s */
23578 char validYMD; /* True (1) if Y,M,D are valid */
23579 char validHMS; /* True (1) if h,m,s are valid */
23580 char validTZ; /* True (1) if tz is valid */
23581 char tzSet; /* Timezone was set explicitly */
23582 char isError; /* An overflow has occurred */
23613 static int getDigits(const char *zDate, const char *zFormat, ...){
23619 char nextC;
23622 char N = zFormat[0] - '0';
23623 char min = zFormat[1] - '0';
23667 static int parseTimezone(const char *zDate, DateTime *p){
23703 static int parseHhMmSs(const char *zDate, DateTime *p){
23804 static int parseYyyyMmDd(const char *zDate, DateTime *p){
23884 const char *zDate,
24129 char zName[7]; /* Name of the transformation */
24167 const char *z, /* The text of the modifier */
24359 const char *z2 = z;
24447 const unsigned char *z;
24459 if( !z || parseDateOrTime(context, (char*)z, p) ){
24466 if( z==0 || parseModifier(context, (char*)z, n, p, i) ) return 1;
24527 char zBuf[24];
24574 char zBuf[16];
24603 char zBuf[16];
24654 const char *zFmt;
24659 zFmt = (const char*)sqlite3_value_text(argv[0]);
24727 (char)(((x.iJD+129600000)/86400000) % 7) + '0');
24809 char *zFormat = (char *)sqlite3_user_data(context);
24813 char zBuf[20];
25080 const char *zPath,
25096 SQLITE_PRIVATE int sqlite3OsDelete(sqlite3_vfs *pVfs, const char *zPath, int dirSync){
25103 const char *zPath,
25112 const char *zPath,
25114 char *zPathOut
25121 SQLITE_PRIVATE void *sqlite3OsDlOpen(sqlite3_vfs *pVfs, const char *zPath){
25126 SQLITE_PRIVATE void sqlite3OsDlError(sqlite3_vfs *pVfs, int nByte, char *zBufOut){
25129 SQLITE_PRIVATE void (*sqlite3OsDlSym(sqlite3_vfs *pVfs, void *pHdle, const char *zSym))(void){
25136 SQLITE_PRIVATE int sqlite3OsRandomness(sqlite3_vfs *pVfs, int nByte, char *zBufOut){
25173 const char *zFile,
25225 SQLITE_API sqlite3_vfs *sqlite3_vfs_find(const char *zVfs){
25817 char nBacktrace; /* Number of backtraces on this alloc */
25818 char nBacktraceSlots; /* Available backtrace slots */
25864 char zTitle[100]; /* The title text */
25978 static void randomFill(char *pBuf, int nByte){
26004 char *z;
26049 randomFill((char*)pInt, nByte);
26050 memset(((char*)pInt)+nByte, 0x65, nReserve-nByte);
26063 char *z;
26084 z = (char*)pBt;
26112 randomFill(&((char*)pNew)[pOldHdr->iSize], nByte - (int)pOldHdr->iSize);
26212 SQLITE_PRIVATE void sqlite3MemdebugSettitle(const char *zTitle){
26235 SQLITE_PRIVATE void sqlite3MemdebugDump(const char *zFilename){
26247 char *z = (char*)pHdr;
26879 SQLITE_PRIVATE void sqlite3Memsys3Dump(const char *zFilename){
27508 SQLITE_PRIVATE void sqlite3Memsys5Dump(const char *zFilename){
29804 SQLITE_PRIVATE char *sqlite3DbStrDup(sqlite3 *db, const char *z){
29805 char *zNew;
29817 SQLITE_PRIVATE char *sqlite3DbStrNDup(sqlite3 *db, const char *z, u64 n){
29818 char *zNew;
29835 SQLITE_PRIVATE char *sqlite3DbSpanDup(sqlite3 *db, const char *zStart, const char *zEnd){
29846 SQLITE_PRIVATE void sqlite3SetString(char **pz, sqlite3 *db, const char *zNew){
29847 char *z = sqlite3DbStrDup(db, zNew);
29983 typedef unsigned char etByte;
29990 char fmttype; /* The format field code letter */
30009 static const char aDigits[] = "0123456789ABCDEF0123456789abcdef";
30010 static const char aPrefix[] = "-x0\000X0";
30071 static char et_getdigit(LONGDOUBLE_TYPE *val, int *cnt){
30080 return (char)digit;
30105 static char *getTextArg(PrintfArguments *p){
30107 return (char*)sqlite3_value_text(p->apArg[p->nUsed++]);
30119 static char *printfTempBuf(sqlite3_str *pAccum, sqlite3_int64 n){
30120 char *z;
30154 const char *fmt, /* Format string */
30158 char *bufpt; /* Pointer to the conversion buffer */
30173 char prefix; /* Prefix character. "+" or "-" or " " or '\0'. */
30177 char *zOut; /* Rendering buffer */
30179 char *zExtra = 0; /* Malloced memory used by some conversion */
30188 char buf[etBUFSIZE]; /* Conversion buffer */
30204 bufpt = (char *)fmt;
30353 flag_long = sizeof(char*)==sizeof(i64) ? 2 :
30354 sizeof(char*)==sizeof(long int) ? 1 : 0;
30415 static const char zOrd[] = "thstndrd";
30424 const char *cset = &aDigits[infop->charset];
30452 const char *pre;
30453 char x;
30602 *(bufpt++) = (char)((exp/100)+'0'); /* 100's digit */
30605 *(bufpt++) = (char)(exp/10+'0'); /* 10's digit */
30606 *(bufpt++) = (char)(exp%10+'0'); /* 1's digit */
30696 bufpt = va_arg(ap,char*);
30724 unsigned char *z = (unsigned char*)bufpt;
30728 length = (int)(z - (unsigned char*)bufpt);
30747 char ch;
30748 char q = ((xtype==etSQLESCAPE3)?'"':'\''); /* Quote character */
30749 char *escarg;
30754 escarg = va_arg(ap,char*);
30796 sqlite3_str_appendall(pAccum, (const char*)pExpr->u.zToken);
30804 sqlite3_str_append(pAccum, (const char*)pToken->z, pToken->n);
30874 SQLITE_PRIVATE void sqlite3RecordErrorByteOffset(sqlite3 *db, const char *z){
30876 const char *zText;
30877 const char *zEnd;
30913 char *zNew;
30924 char *zOld = isMalloced(p) ? p->zText : 0;
30962 SQLITE_API void sqlite3_str_appendchar(sqlite3_str *p, int N, char c){
30978 static void SQLITE_NOINLINE enlargeAndAppend(StrAccum *p, const char *z, int N){
30990 SQLITE_API void sqlite3_str_append(sqlite3_str *p, const char *z, int N){
31007 SQLITE_API void sqlite3_str_appendall(sqlite3_str *p, const char *z){
31017 static SQLITE_NOINLINE char *strAccumFinishRealloc(StrAccum *p){
31018 char *zText;
31030 SQLITE_PRIVATE char *sqlite3StrAccumFinish(StrAccum *p){
31068 SQLITE_API char *sqlite3_str_finish(sqlite3_str *p){
31069 char *z;
31090 SQLITE_API char *sqlite3_str_value(sqlite3_str *p){
31123 SQLITE_PRIVATE void sqlite3StrAccumInit(StrAccum *p, sqlite3 *db, char *zBase, int n, int mx){
31149 SQLITE_PRIVATE char *sqlite3VMPrintf(sqlite3 *db, const char *zFormat, va_list ap){
31150 char *z;
31151 char zBase[SQLITE_PRINT_BUF_SIZE];
31169 SQLITE_PRIVATE char *sqlite3MPrintf(sqlite3 *db, const char *zFormat, ...){
31171 char *z;
31182 SQLITE_API char *sqlite3_vmprintf(const char *zFormat, va_list ap){
31183 char *z;
31184 char zBase[SQLITE_PRINT_BUF_SIZE];
31206 SQLITE_API char *sqlite3_mprintf(const char *zFormat, ...){
31208 char *z;
31231 SQLITE_API char *sqlite3_vsnprintf(int n, char *zBuf, const char *zFormat, va_list ap){
31246 SQLITE_API char *sqlite3_snprintf(int n, char *zBuf, const char *zFormat, ...){
31247 char *z;
31269 static void renderLogMsg(int iErrCode, const char *zFormat, va_list ap){
31271 char zMsg[SQLITE_PRINT_BUF_SIZE*10]; /* Complete log message */
31282 SQLITE_API void sqlite3_log(int iErrCode, const char *zFormat, ...){
31297 SQLITE_PRIVATE void sqlite3DebugPrintf(const char *zFormat, ...){
31300 char zBuf[SQLITE_PRINT_BUF_SIZE*10];
31308 extern void SQLITE_OS_TRACE_PROC(const char *zBuf, int nBuf);
31323 SQLITE_API void sqlite3_str_appendf(StrAccum *p, const char *zFormat, ...){
31388 SQLITE_PRIVATE void sqlite3TreeViewLine(TreeView *p, const char *zFormat, ...){
31392 char zBuf[1000];
31415 static void sqlite3TreeViewItem(TreeView *p, const char *zLabel,u8 moreFollows){
31447 const char *z = aCol[i].zCnName;
31483 char zLine[1000];
31488 char cSep = '(';
31523 char zLine[1000];
31678 const char *zOp = "UNION";
31762 char zBuf[30];
31763 const char *zFrmType = "ROWS";
31774 char zBuf[30];
31775 const char *zExclude;
31812 const char *zBinOp = 0; /* Binary operator */
31813 const char *zUniOp = 0; /* Unary operator */
31814 char zFlgs[200];
31851 char zOp2[16];
31962 const char *azOp[] = {
32017 const char *zOp2;
32018 char zBuf[8];
32055 char *z;
32120 const char *zType = "unk";
32139 char *z = sqlite3_mprintf("VECTOR%s",zFlgs);
32198 const char *zLabel
32208 char *zName = pList->a[i].zEName;
32247 const char *zLabel
32260 const char *zLabel
32269 char *zName = pList->a[i].zName;
32297 const char *zLabel
32406 const char *zLabel = "INSERT";
32477 const char *zLabel = "UPDATE";
32684 unsigned char *zBuf = pBuf;
32730 sqlite3OsRandomness(pVfs, 44, (char*)&wsdPrng.s[4]);
33113 static const unsigned char sqlite3Utf8Trans1[] = {
33208 const unsigned char **pz /* Pointer to string from which to read char */
33245 unsigned char *zOut; /* Output buffer */
33246 unsigned char *zIn; /* Input iterator */
33247 unsigned char *zTerm; /* End of input */
33248 unsigned char *z; /* Output iterator */
33260 char zBuf[1000];
33410 pMem->z = (char*)zOut;
33418 char zBuf[1000];
33476 SQLITE_PRIVATE int sqlite3Utf8CharLen(const char *zIn, int nByte){
33506 SQLITE_PRIVATE int sqlite3Utf8To8(unsigned char *zIn){
33507 unsigned char *zOut = zIn;
33508 unsigned char *zStart = zIn;
33530 SQLITE_PRIVATE char *sqlite3Utf16to8(sqlite3 *db, const void *z, int nByte, u8 enc){
33553 unsigned char const *z = zIn;
33563 return (int)(z-(unsigned char const *)zIn)
33575 unsigned char zBuf[20];
33576 unsigned char *z;
33678 SQLITE_PRIVATE int sqlite3Strlen30(const char *z){
33690 SQLITE_PRIVATE char *sqlite3ColumnType(Column *pCol, char *zDflt){
33695 return (char*)sqlite3StdType[pCol->eCType-1];
33761 SQLITE_PRIVATE void sqlite3ErrorWithMsg(sqlite3 *db, int err_code, const char *zFormat, ...){
33768 char *z;
33787 SQLITE_PRIVATE void sqlite3ErrorMsg(Parse *pParse, const char *zFormat, ...){
33788 char *zMsg;
33843 SQLITE_PRIVATE void sqlite3Dequote(char *z){
33844 char quote;
33897 SQLITE_PRIVATE void sqlite3TokenInit(Token *p, char *z){
33915 SQLITE_API int sqlite3_stricmp(const char *zLeft, const char *zRight){
33923 SQLITE_PRIVATE int sqlite3StrICmp(const char *zLeft, const char *zRight){
33924 unsigned char *a, *b;
33926 a = (unsigned char *)zLeft;
33927 b = (unsigned char *)zRight;
33942 SQLITE_API int sqlite3_strnicmp(const char *zLeft, const char *zRight, int N){
33943 register unsigned char *a, *b;
33949 a = (unsigned char *)zLeft;
33950 b = (unsigned char *)zRight;
33958 SQLITE_PRIVATE u8 sqlite3StrIHash(const char *z){
33962 h += UpperToLower[(unsigned char)z[0]];
34039 SQLITE_PRIVATE int sqlite3AtoF(const char *z, double *pResult, int length, u8 enc){
34042 const char *zEnd;
34238 SQLITE_PRIVATE void sqlite3Int64ToText(i64 v, char *zOut){
34241 char zTemp[22];
34271 static int compare2pow63(const char *zNum, int incr){
34275 const char *pow63 = "922337203685477580";
34304 SQLITE_PRIVATE int sqlite3Atoi64(const char *zNum, i64 *pNum, int length, u8 enc){
34312 const char *zStart;
34313 const char *zEnd = zNum + length;
34407 SQLITE_PRIVATE int sqlite3DecOrHexToI64(const char *z, i64 *pOut){
34437 SQLITE_PRIVATE int sqlite3GetInt32(const char *zNum, int *pValue){
34496 SQLITE_PRIVATE int sqlite3Atoi(const char *z){
34508 SQLITE_PRIVATE int sqlite3GetUInt32(const char *z, u32 *pI){
34549 static int SQLITE_NOINLINE putVarint64(unsigned char *p, u64 v){
34573 SQLITE_PRIVATE int sqlite3PutVarint(unsigned char *p, u64 v){
34603 SQLITE_PRIVATE u8 sqlite3GetVarint(const unsigned char *p, u64 *v){
34606 if( ((signed char*)p)[0]>=0 ){
34610 if( ((signed char*)p)[1]>=0 ){
34764 SQLITE_PRIVATE u8 sqlite3GetVarint32(const unsigned char *p, u32 *v){
34914 SQLITE_PRIVATE void sqlite3Put4byte(unsigned char *p, u32 v){
34956 SQLITE_PRIVATE void *sqlite3HexToBlob(sqlite3 *db, const char *z, int n){
34957 char *zBlob;
34960 zBlob = (char *)sqlite3DbMallocRawNN(db, n/2 + 1);
34977 static void logBadConnection(const char *zType){
35120 SQLITE_PRIVATE void sqlite3FileSuffix3(const char *zBaseFilename, char *z){
35140 static const unsigned char x[] = {
35252 const char *zName, /* Name of symbol to add */
35257 char *z; /* Pointer to where zName will be stored */
35274 z = (char*)&pIn[i+2];
35287 SQLITE_PRIVATE const char *sqlite3VListNumToName(VList *pIn, int iVal){
35293 if( pIn[i]==iVal ) return (char*)&pIn[i+2];
35303 SQLITE_PRIVATE int sqlite3VListNameToNum(VList *pIn, const char *zName, int nName){
35309 const char *z = (const char*)&pIn[i+2];
35372 static unsigned int strHash(const char *z){
35374 unsigned char c;
35375 while( (c = (unsigned char)*z++)!=0 ){ /*OPTIMIZATION-IF-TRUE*/
35466 const char *pKey, /* The key we are searching for */
35534 SQLITE_PRIVATE void *sqlite3HashFind(const Hash *pH, const char *pKey){
35554 SQLITE_PRIVATE void *sqlite3HashInsert(Hash *pH, const char *pKey, void *data){
35600 SQLITE_PRIVATE const char *sqlite3OpcodeName(int i){
35601 static const char *const azName[] = {
35844 const char *zClass; /* Storage class */
35847 char *aJrnl; /* Journal content */
35877 static int kvvfsOpen(sqlite3_vfs*, const char *, sqlite3_file*, int , int *);
35878 static int kvvfsDelete(sqlite3_vfs*, const char *zName, int syncDir);
35879 static int kvvfsAccess(sqlite3_vfs*, const char *zName, int flags, int *);
35880 static int kvvfsFullPathname(sqlite3_vfs*, const char *zName, int, char *zOut);
35881 static void *kvvfsDlOpen(sqlite3_vfs*, const char *zFilename);
35882 static int kvvfsRandomness(sqlite3_vfs*, int nByte, char *zOut);
35964 static int kvstorageWrite(const char*, const char *zKey, const char *zData);
35965 static int kvstorageDelete(const char*, const char *zKey);
35966 static int kvstorageRead(const char*, const char *zKey, char *zBuf, int nBuf);
35974 const char *zClass,
35975 const char *zKeyIn,
35976 char *zKeyOut
35989 const char *zClass,
35990 const char *zKey,
35991 const char *zData
35994 char zXKey[KVSTORAGE_KEY_SZ];
36013 static int kvstorageDelete(const char *zClass, const char *zKey){
36014 char zXKey[KVSTORAGE_KEY_SZ];
36035 const char *zClass,
36036 const char *zKey,
36037 char *zBuf,
36042 char zXKey[KVSTORAGE_KEY_SZ];
36089 int (*xRead)(const char *zClass, const char *zKey, char *zBuf, int nBuf);
36090 int (*xWrite)(const char *zClass, const char *zKey, const char *zData);
36091 int (*xDelete)(const char *zClass, const char *zKey);
36139 static int kvvfsEncode(const char *aData, int nData, char *aOut){
36141 const unsigned char *a = (const unsigned char*)aData;
36143 unsigned char c = a[i];
36166 static const signed char kvvfsHexValue[256] = {
36192 static int kvvfsDecode(const char *a, char *aOut, int nOut){
36195 const unsigned char *aIn = (const unsigned char*)a;
36239 const char *zTxt, /* Text encoding. Zero-terminated */
36269 char zData[50];
36275 char zData[50];
36308 char *aTxt;
36338 char zKey[30];
36339 char aData[133073];
36397 char *aNew = sqlite3_realloc(pFile->aJrnl, iEnd);
36422 char zKey[30];
36423 char aData[131073];
36460 char zKey[50];
36482 char *zOut;
36605 const char *zName,
36644 static int kvvfsDelete(sqlite3_vfs *pVfs, const char *zPath, int dirSync){
36660 const char *zPath,
36691 const char *zPath,
36693 char *zOut
36710 static void *kvvfsDlOpen(sqlite3_vfs *pVfs, const char *zPath){
36718 static int kvvfsRandomness(sqlite3_vfs *pVfs, int nByte, char *zBufOut){
36994 unsigned char eFileLock; /* The type of lock held on this fd */
36999 const char *zPath; /* Name of the file */
37031 unsigned char transCntrChng; /* True if the transaction counter changed */
37032 unsigned char dbUpdate; /* True if any part of database file changed */
37033 unsigned char inNormalWrite; /* True if in a normal write operation */
37041 char aPadding[32];
37157 ** open(const char*,int,mode_t). Others use open(const char*,int,...).
37163 static int posixOpen(const char *zFile, int flags, int mode){
37190 static int openDirectory(const char*, int*);
37200 const char *zName; /* Name of the system call */
37205 #define osOpen ((int(*)(const char*,int,int))aSyscall[0].pCurrent)
37211 #define osAccess ((int(*)(const char*,int))aSyscall[2].pCurrent)
37214 #define osGetcwd ((char*(*)(char*,size_t))aSyscall[3].pCurrent)
37217 #define osStat ((int(*)(const char*,struct stat*))aSyscall[4].pCurrent)
37286 #define osUnlink ((int(*)(const char*))aSyscall[16].pCurrent)
37289 #define osOpenDirectory ((int(*)(const char*,int*))aSyscall[17].pCurrent)
37292 #define osMkdir ((int(*)(const char*,mode_t))aSyscall[18].pCurrent)
37295 #define osRmdir ((int(*)(const char*))aSyscall[19].pCurrent)
37344 #define osReadlink ((ssize_t(*)(const char*,char*,size_t))aSyscall[26].pCurrent)
37351 #define osLstat ((int(*)(const char*,struct stat*))aSyscall[27].pCurrent)
37389 const char *zName, /* Name of system call to override */
37432 const char *zName
37449 static const char *unixNextSystemCall(sqlite3_vfs *p, const char *zName){
37490 static int robust_open(const char *z, int f, mode_t m){
37577 static const char *azFileLock(int eFileLock){
37599 char *zOpName, *zType;
37727 char *zCanonicalName; /* Canonical filename */
37750 static int vxworksSimplifyName(char *z, int n){
37784 static struct vxworksFileId *vxworksFindFileId(const char *zAbsoluteName){
37793 pNew->zCanonicalName = (char*)&pNew[1];
37984 unsigned char eFileLock; /* One of SHARED_LOCK, RESERVED_LOCK etc. */
37985 unsigned char bProcessLock; /* An exclusive process lock is held */
37996 char aSemName[MAX_PATHNAME+2]; /* Name of that semaphore */
38042 const char *zFunc, /* Name of OS function that failed */
38043 const char *zPath, /* File path associated with error */
38046 char *zErr; /* Message from strerror() or equivalent */
38054 char aErr[80];
38938 sqlite3_free(*(char**)&pFile->zPath);
39074 reserved = osAccess((const char*)pFile->lockingContext, 0)==0;
39109 char *zLockFile = (char *)pFile->lockingContext;
39159 char *zLockFile = (char *)pFile->lockingContext;
39612 const char *dbPath; /* Name of the open file */
39620 unsigned char unLockFlag; /* 1 = unlock, 0 = lock */
39621 unsigned char startEndFlag; /* 1=rel to end of fork, 0=rel to start */
39634 const char *path, /* Name of the file to be locked or unlocked */
40152 pBuf = (void*)(got + (char*)pBuf);
40236 memset(&((char*)pBuf)[got], 0, amt-got);
40334 char oldCntr[4];
40338 if( rc!=4 || memcmp(oldCntr, &((char*)pBuf)[24-offset], 4)!=0 ){
40365 pBuf = &((char*)pBuf)[wrote];
40552 static int openDirectory(const char *zFilename, int *pFd){
40555 char zDirname[MAX_PATHNAME+1];
40817 static void unixModeBit(unixFile *pFile, unsigned char mask, int *pArg){
40828 static int unixGetTempname(int nBuf, char *zBuf);
40897 *(char**)pArg = sqlite3_mprintf("%s", pFile->pVfs->zName);
40901 char *zTFile = sqlite3_malloc64( pFile->pVfs->mxPathname );
40904 *(char**)pArg = zTFile;
41172 char *zFilename; /* Name of the mmapped file */
41178 char **apRegion; /* Array of mapped shared-memory regions */
41484 char *zShm; /* Name of the file used for SHM */
41503 const char *zBasePath = pDbFd->zPath;
41526 zShm = pShmNode->zFilename = (char*)&pShmNode[1];
41658 char **apNew; /* New apRegion[] array */
41698 const char *zFile = pShmNode->zFilename;
41708 apNew = (char **)sqlite3_realloc(
41709 pShmNode->apRegion, nReqRegion*sizeof(char *)
41739 pShmNode->apRegion[pShmNode->nRegion+i] = &((char*)pMem)[szRegion*i];
42049 const char *zErr = "mmap";
42295 static const sqlite3_io_methods *FINDER##Impl(const char *z, unixFile *p){ \
42299 static const sqlite3_io_methods *(*const FINDER)(const char*,unixFile *p) \
42426 const char *filePath, /* name of the database file */
42430 const char *zFilesystem; /* Filesystem type name */
42479 *(*const autolockIoFinder)(const char*,unixFile*) = autolockIoFinderImpl;
42490 const char *filePath, /* name of the database file */
42515 *(*const vxworksIoFinder)(const char*,unixFile*) = vxworksIoFinderImpl;
42522 typedef const sqlite3_io_methods *(*finder_type)(const char*,unixFile*);
42539 const char *zFilename, /* Name of the file being opened */
42651 char *zLockFile;
42655 zLockFile = (char *)sqlite3_malloc64(nFilename);
42672 char *zSemName = pNew->pInode->aSemName;
42710 static const char *azTempDirs[] = {
42731 static const char *unixTempFileDir(void){
42734 const char *zDir = sqlite3_temp_directory;
42755 static int unixGetTempname(int nBuf, char *zBuf){
42756 const char *zDir;
42795 static int proxyTransformUnixFile(unixFile*, const char*);
42814 static UnixUnusedFd *findReusableFd(const char *zPath, int flags){
42865 const char *zFile, /* File name */
42904 const char *zPath, /* Path of file (possibly) being created */
42915 char zDb[MAX_PATHNAME+1]; /* Database file path */
42953 const char *z = sqlite3_uri_parameter(zPath, "modeof");
42985 const char *zPath, /* Pathname of file to be opened */
43023 char zTmpname[MAX_PATHNAME+2];
43024 const char *zName = zPath;
43220 char *envforce = getenv("SQLITE_FORCE_PROXY_LOCKING");
43267 const char *zPath, /* Name of file to be deleted */
43315 const char *zPath, /* Path of the file to examine */
43342 static int unixBackupDir(const char *z, int *pJ){
43361 const char *zPath, /* Input path */
43362 char *zOut, /* Output buffer */
43431 const char *zPath, /* Possibly relative input path */
43433 char *zOut /* Output buffer */
43441 const char *zIn = zPath; /* Input path for each iteration of loop */
43442 char *zDel = 0;
43520 static void *unixDlOpen(sqlite3_vfs *NotUsed, const char *zFilename){
43532 static void unixDlError(sqlite3_vfs *NotUsed, int nBuf, char *zBufOut){
43533 const char *zErr;
43542 static void (*unixDlSym(sqlite3_vfs *NotUsed, void *p, const char*zSym))(void){
43550 ** parameters void* and const char* and returning a pointer to a function.
43560 void (*(*x)(void*,const char*))(void);
43562 x = (void(*(*)(void*,const char*))(void))dlsym;
43579 static int unixRandomness(sqlite3_vfs *NotUsed, int nBuf, char *zBuf){
43717 static int unixGetLastError(sqlite3_vfs *NotUsed, int NotUsed2, char *NotUsed3){
43891 char *conchFilePath; /* Name of the conch file */
43893 char *lockProxyPath; /* Name of the proxy lock file */
43894 char *dbPath; /* Name of the open file */
43906 static int proxyGetLockPath(const char *dbPath, char *lPath, size_t maxLen){
43938 char c = dbPath[i];
43950 static int proxyCreateLockPath(const char *lockPath){
43952 char buf[MAXPATHLEN];
43991 const char *path, /* path for the new unixFile */
44088 static int proxyGetHostID(unsigned char *pHostID, int *pError){
44108 pHostID[0] = (char)(pHostID[0] + (char)(sqlite3_hostid_num & 0xFF));
44131 char tPath[MAXPATHLEN];
44132 char buf[PROXY_MAXCONCHLEN];
44133 char *cPath = pCtx->conchFilePath;
44136 char errmsg[64] = "";
44228 char tBuf[PROXY_MAXCONCHLEN];
44237 if( len>PROXY_PATHINDEX && tBuf[0]==(char)PROXY_CONCHVERSION){
44281 char readBuf[PROXY_MAXCONCHLEN];
44282 char lockPath[MAXPATHLEN];
44283 char *tempLockPath = NULL;
44315 readBuf[0]!=(char)PROXY_CONCHVERSION ){
44387 char writeBuffer[PROXY_MAXCONCHLEN];
44390 writeBuffer[0] = (char)PROXY_CONCHVERSION;
44453 char *path = tempLockPath ? tempLockPath : pCtx->lockProxyPath;
44527 static int proxyCreateConchPathname(char *dbPath, char **pConchPath){
44530 char *conchPath; /* buffer in which to construct conch name */
44534 *pConchPath = conchPath = (char *)sqlite3_malloc64(len + 8);
44564 static int switchLockProxyPath(unixFile *pFile, const char *path) {
44566 char *oldPath = pCtx->lockProxyPath;
44600 static int proxyGetDbPathForUnixFile(unixFile *pFile, char *dbPath){
44605 assert( (int)strlen((char*)pFile->lockingContext)<=MAXPATHLEN );
44613 int len = strlen((char *)pFile->lockingContext) - strlen(DOTLOCK_SUFFIX);
44614 memcpy(dbPath, (char *)pFile->lockingContext, len + 1);
44617 assert( strlen((char*)pFile->lockingContext)<=MAXPATHLEN );
44618 strlcpy(dbPath, (char *)pFile->lockingContext, MAXPATHLEN);
44631 static int proxyTransformUnixFile(unixFile *pFile, const char *path) {
44633 char dbPath[MAXPATHLEN+1]; /* Name of the database file */
44634 char *lockPath=NULL;
44644 lockPath=(char *)path;
44726 *(const char **)pArg = pCtx->lockProxyPath;
44728 *(const char **)pArg = ":auto: (not held)";
44731 *(const char **)pArg = NULL;
44739 if( pArg==NULL || (const char *)pArg==0 ){
44751 const char *proxyPath = (const char *)pArg;
45347 const char *zPath; /* Full pathname of this file */
45579 const char *zName; /* Name of the system call */
46241 const char *zName, /* Name of system call to override */
46284 const char *zName
46301 static const char *winNextSystemCall(sqlite3_vfs *p, const char *zName){
46409 SQLITE_API void sqlite3_win32_write_debug(const char *zBuf, int nBuf){
46410 char zDbgBuf[SQLITE_WIN32_DBG_BUF_SIZE];
46749 static LPWSTR winUtf8ToUnicode(const char *zText){
46775 static char *winUnicodeToUtf8(LPCWSTR zWideText){
46777 char *zText;
46802 static LPWSTR winMbcsToUnicode(const char *zText, int useAnsi){
46831 static char *winUnicodeToMbcs(LPCWSTR zWideText, int useAnsi){
46833 char *zText;
46858 static char *winMbcsToUtf8(const char *zText, int useAnsi){
46859 char *zTextUtf8;
46876 static char *winUtf8ToMbcs(const char *zText, int useAnsi){
46877 char *zTextMbcs;
46892 SQLITE_API LPWSTR sqlite3_win32_utf8_to_unicode(const char *zText){
46908 SQLITE_API char *sqlite3_win32_unicode_to_utf8(LPCWSTR zWideText){
46924 SQLITE_API char *sqlite3_win32_mbcs_to_utf8(const char *zText){
46940 SQLITE_API char *sqlite3_win32_mbcs_to_utf8_v2(const char *zText, int useAnsi){
46956 SQLITE_API char *sqlite3_win32_utf8_to_mbcs(const char *zText){
46972 SQLITE_API char *sqlite3_win32_utf8_to_mbcs_v2(const char *zText, int useAnsi){
46991 const char *zValue /* New value for directory being set or reset */
46993 char **ppDirectory = 0;
47010 char *zCopy = 0;
47038 char *zUtf8 = 0;
47067 static int winGetLastErrorMsg(DWORD lastErrno, int nBuf, char *zBuf){
47070 ** buffer, excluding the terminating null char.
47073 char *zOut = 0;
47111 char *zTemp = NULL;
47161 const char *zFunc, /* Name of OS function that failed */
47162 const char *zPath, /* File path associated with error */
47165 char zMsg[500]; /* Human readable error text */
47304 #define HANDLE_TO_WINFILE(a) (winFile*)&((char*)a)[-(int)offsetof(winFile,h)]
47324 static int winceCreateLock(const char *zFilename, winFile *pFile){
47858 memset(&((char*)pBuf)[nRead], 0, amt-nRead);
48572 static void winModeBit(winFile *pFile, unsigned char mask, int *pArg){
48583 static int winGetTempname(sqlite3_vfs *, char **);
48585 static BOOL winIsLongPathPrefix(const char *);
48586 static BOOL winIsDriveLetterAndColon(const char *);
48639 *(char**)pArg = sqlite3_mprintf("%s", pFile->pVfs->zName);
48676 char *zTFile = 0;
48679 *(char**)pArg = zTFile;
48801 char *zFilename; /* Name of the file */
48905 static int winOpen(sqlite3_vfs*,const char*,sqlite3_file*,int,int*);
48906 static int winDelete(sqlite3_vfs *,const char*,int);
49014 pNew->zFilename = (char*)&pNew[1];
49418 char *p = (char *)pShmNode->aRegion[iRegion].pMap;
49744 static char *winConvertToUtf8Filename(const void *zFilename){
49745 char *zConverted = 0;
49765 static void *winConvertFromUtf8Filename(const char *zFilename){
49784 static int winMakeEndInDirSep(int nBuf, char *zBuf){
49817 static int winGetTempname(sqlite3_vfs *pVfs, char **pzBuf){
49818 static char zChars[] =
49825 char *zBuf;
49868 static const char *azDirs[] = {
49881 const char *zDir = 0;
49930 char *zUtf8 = winConvertToUtf8Filename(zConverted);
49948 char *zMulti;
49976 char *zUtf8;
49977 char *zMbcsPath = sqlite3MallocZero( nMax );
50036 zBuf[j] = (char)zChars[ ((unsigned char)zBuf[j])%(sizeof(zChars)-1) ];
50069 attr = osGetFileAttributesA((char*)zConverted);
50078 const char *zFilename, /* Name of file to check */
50088 const char *zName, /* Name of the file (UTF-8) */
50105 const char *zUtf8Name = zName; /* Filename in UTF-8 encoding */
50111 char *zTmpname = 0; /* For temporary filename, if necessary. */
50411 const char *zFilename, /* Name of file to delete */
50519 const char *zFilename, /* Name of file to check */
50569 attr = osGetFileAttributesA((char*)zConverted);
50596 const char *zPathname
50607 const char *zPathname
50619 const char *zPathname
50656 const char *zRelative, /* Possibly relative input path */
50658 char *zFull /* Output buffer */
50663 char *zOut;
50685 char *zOut = sqlite3MallocZero( pVfs->mxPathname+1 );
50696 char *zUtf8 = winConvertToUtf8Filename(zOut);
50707 char *zOut = sqlite3MallocZero( pVfs->mxPathname+1 );
50718 char *zUtf8 = winConvertToUtf8Filename(zOut);
50799 char *zTemp;
50800 nByte = osGetFullPathNameA((char*)zConverted, 0, 0, 0);
50812 nByte = osGetFullPathNameA((char*)zConverted, nByte, zTemp, 0);
50835 const char *zRelative, /* Possibly relative input path */
50837 char *zFull /* Output buffer */
50853 static void *winDlOpen(sqlite3_vfs *pVfs, const char *zFilename){
50857 char *zFull = sqlite3MallocZero( nFull );
50887 h = osLoadLibraryA((char*)zConverted);
50894 static void winDlError(sqlite3_vfs *pVfs, int nBuf, char *zBufOut){
50898 static void (*winDlSym(sqlite3_vfs *pVfs,void *pH,const char *zSym))(void){
50921 unsigned char *a; /* Gather entropy into this buffer */
50929 static void xorMemory(EntropyGatherer *p, unsigned char *x, int sz){
50943 static int winRandomness(sqlite3_vfs *pVfs, int nBuf, char *zBuf){
50952 e.a = (unsigned char*)zBuf;
50959 xorMemory(&e, (unsigned char*)&x, sizeof(SYSTEMTIME));
50963 xorMemory(&e, (unsigned char*)&pid, sizeof(DWORD));
50968 xorMemory(&e, (unsigned char*)&cnt, sizeof(ULONGLONG));
50973 xorMemory(&e, (unsigned char*)&cnt, sizeof(DWORD));
50979 xorMemory(&e, (unsigned char*)&i, sizeof(LARGE_INTEGER));
50986 xorMemory(&e, (unsigned char*)&id, sizeof(UUID));
50989 xorMemory(&e, (unsigned char*)&id, sizeof(UUID));
51099 ** int xGetLastError(sqlite3_vfs *pVfs, int nBuf, char *zBuf){
51108 static int winGetLastError(sqlite3_vfs *pVfs, int nBuf, char *zBuf){
51345 unsigned char *aData; /* content of the file */
51352 char *zFName; /* The filename for shared stores */
51394 static int memdbOpen(sqlite3_vfs*, const char *, sqlite3_file*, int , int *);
51395 /* static int memdbDelete(sqlite3_vfs*, const char *zName, int syncDir); */
51396 static int memdbAccess(sqlite3_vfs*, const char *zName, int flags, int *);
51397 static int memdbFullPathname(sqlite3_vfs*, const char *zName, int, char *zOut);
51398 static void *memdbDlOpen(sqlite3_vfs*, const char *zFilename);
51399 static void memdbDlError(sqlite3_vfs*, int nByte, char *zErrMsg);
51400 static void (*memdbDlSym(sqlite3_vfs *pVfs, void *p, const char*zSym))(void);
51402 static int memdbRandomness(sqlite3_vfs*, int nByte, char *zOut);
51405 static int memdbGetLastError(sqlite3_vfs*, int, char *);
51546 unsigned char *pNew;
51740 *(char**)pArg = sqlite3_mprintf("memdb(%p,%lld)", p->aData, p->sz);
51815 const char *zName,
51858 p->zFName = (char*)&p[1];
51899 static int memdbDelete(sqlite3_vfs *pVfs, const char *zPath, int dirSync){
51912 const char *zPath,
51930 const char *zPath,
51932 char *zOut
51942 static void *memdbDlOpen(sqlite3_vfs *pVfs, const char *zPath){
51951 static void memdbDlError(sqlite3_vfs *pVfs, int nByte, char *zErrMsg){
51958 static void (*memdbDlSym(sqlite3_vfs *pVfs, void *p, const char *zSym))(void){
51973 static int memdbRandomness(sqlite3_vfs *pVfs, int nByte, char *zBufOut){
51994 static int memdbGetLastError(sqlite3_vfs *pVfs, int a, char *b){
52005 static MemFile *memdbFromDbSchema(sqlite3 *db, const char *zSchema){
52021 SQLITE_API unsigned char *sqlite3_serialize(
52023 const char *zSchema, /* Which database within the connection */
52033 unsigned char *pOut;
52034 char *zSql;
52084 unsigned char *pTo = pOut + szPage*(sqlite3_int64)(pgno-1);
52104 const char *zSchema, /* Which DB to reopen with the deserialization */
52105 unsigned char *pData, /* The serialized database content */
52111 char *zSql;
52534 unsigned char *pV = 0;
52680 unsigned char *a;
52684 a = (unsigned char *)pLower->pBuf;
53825 pBuf = (void*)&((char*)pBuf)[sz];
53837 char *zBulk;
54956 p->pFresh = (struct RowSetEntry*)(ROUND8(sizeof(*p)) + (char*)p);
55404 SQLITE_PRIVATE int sqlite3WalOpen(sqlite3_vfs*, sqlite3_file*, const char *, int, i64, Wal**);
55897 if( P->xCodec==0 ){ O=(char*)D; }else \
55898 if( (O=(char*)(P->xCodec(P->pCodec,D,N,X)))==0 ){ E; }
55901 # define CODEC2(P,D,N,X,E,O) O=(char*)D
56165 char dbFileVers[16]; /* Changes whenever database file changes */
56182 char *zFilename; /* Name of the database file */
56183 char *zJournal; /* Name of the journal file */
56198 char *pTmpSpace; /* Pager.pageSize bytes of space for tmp use */
56202 char *zWal; /* File name for write-ahead log */
56255 static const unsigned char aJournalMagic[] = {
56498 char *print_pager_state(Pager *p){
56499 static char zRet[1024];
56610 unsigned char ac[4];
56629 char ac[4];
56750 static u32 pager_datahash(int nByte, unsigned char *pData){
56759 return pager_datahash(pPage->pPager->pageSize, (unsigned char *)pPage->pData);
56809 static int readSuperJournal(sqlite3_file *pJrnl, char *zSuper, u32 nSuper){
56815 unsigned char aMagic[8]; /* A buffer to hold the magic header */
56909 static const char zeroHdr[28] = {0};
56950 char *zHeader = pPager->pTmpSpace; /* Temporary space used to build header */
57074 unsigned char aMagic[8]; /* A buffer to hold the magic header */
57191 static int writeSuperJournal(Pager *pPager, const char *zSuper){
57787 char *aData; /* Temporary storage for the page */
58047 static int pager_delsuper(Pager *pPager, const char *zSuper){
58052 char *zSuperJournal = 0; /* Contents of super-journal file */
58054 char *zJournal; /* Pointer to one journal within MJ file */
58055 char *zSuperPtr; /* Space to hold super-journal filename */
58056 char *zFree = 0; /* Free this buffer */
58183 char *pTmp = pPager->pTmpSpace;
58317 char *zSuper = 0; /* Name of super-journal file if any */
58600 put32bits(((char*)pPg->pData)+24, change_counter);
58605 put32bits(((char*)pPg->pData)+92, change_counter);
58606 put32bits(((char*)pPg->pData)+96, SQLITE_VERSION_NUMBER);
59285 char *pNew = NULL; /* New temp space */
59294 pNew = (char *)sqlite3PageMalloc(pageSize+8);
59396 SQLITE_PRIVATE int sqlite3PagerReadFileheader(Pager *pPager, int N, unsigned char *pDest){
59974 char *pData; /* Data to write */
60068 char *pData2;
60246 const char *zFilename, /* Name of the database file to open */
60264 char *zPathname = 0; /* Full path to database file */
60269 const char *zUri = 0; /* URI args to copy */
60297 const char *z;
60412 pPager->zFilename = (char*)pPtr;
60425 pPager->zJournal = (char*)pPtr;
60439 pPager->zWal = (char*)pPtr;
60615 SQLITE_API sqlite3_file *sqlite3_database_file_object(const char *zName){
60929 char dbFileVers[sizeof(pPager->dbFileVers)];
61502 char *pData2;
61885 const void *pCopy = (const void *)&((const char *)zBuf)[24];
61907 SQLITE_PRIVATE int sqlite3PagerSync(Pager *pPager, const char *zSuper){
61974 const char *zSuper, /* If not NULL, the super-journal name */
62588 SQLITE_PRIVATE const char *sqlite3PagerFilename(const Pager *pPager, int nullIfMemDb){
62589 static const char zFake[8] = { 0, 0, 0, 0, 0, 0, 0, 0 };
62624 SQLITE_PRIVATE const char *sqlite3PagerJournalname(Pager *pPager){
63890 const char *zWalName; /* Name of WAL file */
64269 static const char *walLockName(int lockIdx){
64277 static char zName[15];
64468 nByte = (int)((char *)sLoc.aHash - (char *)&sLoc.aPgno[iLimit]);
64837 const char *zWalName, /* Name of the WAL file */
65364 static int checkHeaderValid(Pager *pager, u8 *zBuf, const char *logStr);
66886 pContent = (void*)(iFirstAmt + (char*)pContent);
68268 const char *zPfx; /* Error message prefix */
68616 static const char zMagicHeader[] = SQLITE_FILE_HEADER;
68720 static int checkHeaderValid(Pager *pager, u8 *zBuf, const char *logStr){
68726 if( zBuf && strncmp((const char *)zBuf, zMagicHeader, 16)!=0 ){
68755 char *zMsg;
69637 if( ((char*)sqlite3PagerGetExtra(pDbPage))[0]!=0 ){
70122 unsigned char *data; /* The page data */
70123 unsigned char *temp; /* Temp area for cell content */
70124 unsigned char *src; /* Source of content */
70425 unsigned char *data = pPage->aData; /* Page content */
70779 unsigned char *data = pPage->aData;
70792 data[hdr] = (char)flags;
71072 const char *zFilename, /* Name of the file containing the BTree database */
71083 unsigned char zDbHeader[100]; /* Database header content */
71136 char *zFullPathname = sqlite3Malloc(MAX(nFullPathname,nFilename));
72041 unsigned char *data;
72785 SQLITE_PRIVATE int sqlite3BtreeCommitPhaseOne(Btree *p, const char *zSuperJrnl){
73584 unsigned char *pBuf, /* Write the bytes into this buffer */
73587 unsigned char *aPayload;
73593 unsigned char * const pBufStart = pBuf; /* Start of original out buffer */
73788 return accessPayload(pCur, offset, amt, (unsigned char*)pBuf, 0);
74584 rc = accessPayload(pCur, 0, nCell, (unsigned char*)pCellKey, 0);
75057 unsigned char *aData = pTrunk->aData;
75346 unsigned char *pCell, /* First byte of the Cell */
75441 unsigned char *pCell, /* Complete text of the cell */
75450 unsigned char *pPrior;
75451 unsigned char *pPayload;
77641 unsigned char *oldCell;
77642 unsigned char *newCell = 0;
78061 unsigned char *pCell; /* Pointer to cell to delete */
78172 unsigned char *pTmp;
78431 unsigned char *pCell;
78686 unsigned char *pP1;
78795 const char *zFormat,
78905 unsigned char *pOvflData;
78912 pOvflData = (unsigned char *)sqlite3PagerGetData(pOvflPage);
79054 const char *saved_zPfx = pCheck->zPfx;
79306 SQLITE_PRIVATE char *sqlite3BtreeIntegrityCheck(
79318 char zErr[100];
79461 SQLITE_PRIVATE const char *sqlite3BtreeGetFilename(Btree *p){
79474 SQLITE_PRIVATE const char *sqlite3BtreeGetJournalname(Btree *p){
79647 return accessPayload(pCsr, offset, amt, (unsigned char *)z, 1);
79828 static Btree *findBtree(sqlite3 *pErrorDb, sqlite3 *pDb, const char *zDb){
79888 const char *zDestDb, /* Name of database within pDestDb */
79890 const char *zSrcDb /* Name of database within pSrcDb */
80654 static void vdbeMemRenderNum(int sz, char *zBuf, Mem *p){
80664 memcpy(&x, (char*)&p->u, (p->flags&MEM_Int)*2);
80702 char zBuf[100];
80703 char *z;
81490 const char *zPType,
81542 pMem->z = (char*)p;
81687 const char *z, /* String pointer */
81756 pMem->z = (char *)z;
81832 pMem->z = (char *)sqlite3BtreePayloadFetch(pCur, &available);
82111 char *zVal = 0;
82114 const char *zNeg = "";
82593 SQLITE_PRIVATE void sqlite3VdbeError(Vdbe *p, const char *zFormat, ...){
82604 SQLITE_PRIVATE void sqlite3VdbeSetSql(Vdbe *p, const char *z, int n, u8 prepFlags){
82618 SQLITE_PRIVATE void sqlite3VdbeAddDblquoteStr(sqlite3 *db, Vdbe *p, const char *z){
82639 const char *zId /* The double-quoted identifier, already dequoted */
82663 char *zTmp;
82833 SQLITE_PRIVATE int sqlite3VdbeLoadString(Vdbe *p, int iDest, const char *zStr){
82848 SQLITE_PRIVATE void sqlite3VdbeMultiLoad(Vdbe *p, int iDest, const char *zTypes, ...){
82851 char c;
82855 const char *z = va_arg(ap, const char*);
82877 const char *zP4, /* The P4 operand */
82923 p1, p2, p3, (char*)pCtx, P4_FUNCCTX);
82942 char *p4copy = sqlite3DbMallocRawNN(sqlite3VdbeDb(p), 8);
82964 SQLITE_PRIVATE void sqlite3ExplainBreakpoint(const char *z1, const char *z2){
82976 SQLITE_PRIVATE void sqlite3VdbeExplain(Parse *pParse, u8 bPush, const char *zFmt, ...){
82983 char *zMsg;
83018 SQLITE_PRIVATE void sqlite3VdbeAddParseSchemaOp(Vdbe *p, int iDb, char *zWhere, u16 p5){
83507 char *zErr = sqlite3_str_finish(pErr);
83649 const char *zName /* Name of table or index being scanned */
83928 const char *zP4,
83944 SQLITE_PRIVATE void sqlite3VdbeChangeP4(Vdbe *p, int addr, const char *zP4, int n){
83952 if( n!=P4_VTAB ) freeP4(db, n, (void*)*(char**)&zP4);
83967 ** that was cast to a (const char *). */
83973 pOp->p4type = (signed char)n;
84023 static void vdbeVComment(Vdbe *p, const char *zFormat, va_list ap){
84032 SQLITE_PRIVATE void sqlite3VdbeComment(Vdbe *p, const char *zFormat, ...){
84040 SQLITE_PRIVATE void sqlite3VdbeNoopComment(Vdbe *p, const char *zFormat, ...){
84097 static int translateP(char c, const Op *pOp){
84118 SQLITE_PRIVATE char *sqlite3VdbeDisplayComment(
84121 const char *zP4 /* Previously obtained value for P4 */
84123 const char *zOpName;
84124 const char *zSynopsis;
84127 char zAlt[50];
84135 char c;
84209 const char *zOp = 0;
84283 SQLITE_PRIVATE char *sqlite3VdbeDisplayP4(sqlite3 *db, Op *pOp){
84284 char *zP4 = 0;
84296 const char *zColl = pColl ? pColl->zName : "";
84313 static const char *const encnames[] = {"?", "8", "16LE", "16BE"};
84481 char *zP4;
84482 char *zCom;
84484 static const char *zFormat1 = "%4d %-13s %4d %4d %4d %-13s %.2X %s\n";
84823 char *zP4 = sqlite3VdbeDisplayP4(db, pOp);
84832 sqlite3VdbeMemSetStr(pMem+1, (char*)sqlite3OpcodeName(pOp->opcode),
84841 char *zCom = sqlite3VdbeDisplayComment(db, pOp, zP4);
84869 const char *z = 0;
84895 char z[1000];
85062 static const char * const azColName[] = {
85271 const char *zName, /* Pointer to buffer containing name */
85407 char *zSuper = 0; /* File-name for the super-journal */
85408 char const *zMainFile = sqlite3BtreeGetFilename(db->aDb[0].pBt);
85462 char const *zFile = sqlite3BtreeGetJournalname(pBt);
85927 char *zExpanded = sqlite3VdbeExpandSql(v, v->zSql);
86011 char c, pc = 0;
86021 char zHdr[100];
86436 const unsigned char *buf, /* Buffer to deserialize from */
86471 const unsigned char *buf, /* Buffer to deserialize from */
86554 pMem->z = (char *)buf;
86584 p->aMem = (Mem*)&((char*)p)[ROUND8P(sizeof(UnpackedRecord))];
86602 const unsigned char *aKey = (const unsigned char *)pKey;
86661 const unsigned char *aKey1 = (const unsigned char *)pKey1;
86771 const unsigned char *aKey = (const unsigned char*)pKey;
86830 static int isAllZero(const char *z, int n){
87075 const unsigned char *aKey1 = (const unsigned char *)pKey1;
87185 mem1.z = (char*)&aKey1[d1];
87212 if( !isAllZero((const char*)&aKey1[d1],nStr) ){
87397 serial_type = (signed char)(aKey1[1]);
87732 const char *zContext;
87733 char *zMsg;
87801 const char *zDb, /* Database name */
87810 const char *zTbl = pTab->zName;
88068 SQLITE_API void *sqlite3_value_pointer(sqlite3_value *pVal, const char *zPType){
88081 SQLITE_API const unsigned char *sqlite3_value_text(sqlite3_value *pVal){
88082 return (const unsigned char *)sqlite3ValueText(pVal, SQLITE_UTF8);
88243 const char *z, /* String pointer */
88310 SQLITE_API void sqlite3_result_error(sqlite3_context *pCtx, const char *z, int n){
88337 const char *zPType,
88354 const char *z,
88363 const char *z,
88366 unsigned char enc
88646 SQLITE_API int sqlite3_set_droptable_handle(sqlite3 *db, void (*xFunc)(sqlite3*, const char*, const char*)){
88690 const char *zErr = (const char *)sqlite3_value_text(db->pErr);
89040 /* .z = */ (char*)0,
89048 /* .zMalloc = */ (char*)0,
89154 SQLITE_API const unsigned char *sqlite3_column_text(sqlite3_stmt *pStmt, int i){
89155 const unsigned char *val = sqlite3_value_text( columnMem(pStmt,i) );
89246 SQLITE_API const char *sqlite3_column_name(sqlite3_stmt *pStmt, int N){
89269 SQLITE_API const char *sqlite3_column_decltype(sqlite3_stmt *pStmt, int N){
89285 SQLITE_API const char *sqlite3_column_database_name(sqlite3_stmt *pStmt, int N){
89299 SQLITE_API const char *sqlite3_column_table_name(sqlite3_stmt *pStmt, int N){
89313 SQLITE_API const char *sqlite3_column_origin_name(sqlite3_stmt *pStmt, int N){
89475 const char *zPTtype,
89492 const char *zData,
89501 const char *zData,
89504 unsigned char enc
89599 SQLITE_API const char *sqlite3_bind_parameter_name(sqlite3_stmt *pStmt, int i){
89610 SQLITE_PRIVATE int sqlite3VdbeParameterIndex(Vdbe *p, const char *zName, int nName){
89614 SQLITE_API int sqlite3_bind_parameter_index(sqlite3_stmt *pStmt, const char *zName){
89759 SQLITE_API const char *sqlite3_sql(sqlite3_stmt *pStmt){
89773 SQLITE_API char *sqlite3_expanded_sql(sqlite3_stmt *pStmt){
89777 char *z = 0;
89778 const char *zSql = sqlite3_sql(pStmt);
89793 SQLITE_API const char *sqlite3_normalized_sql(sqlite3_stmt *pStmt){
90039 *(const char**)pOut = pScan->zName;
90044 *(const char**)pOut = p->aOp[ pScan->addrExplain ].p4.z;
90046 *(const char**)pOut = 0;
90104 static int findNextHostParameter(const char *zSql, int *pnToken){
90147 SQLITE_PRIVATE char *sqlite3VdbeExpandSql(
90149 const char *zRawSql /* Raw text of the SQL statement */
90167 const char *zStart = zRawSql;
90653 char affinity, /* The affinity to be applied */
90771 static const char *const encnames[] = {"(X)", "(8)", "(16LE)", "(16BE)"};
90774 char c;
90793 char z = pMem->z[i];
90848 char zBuf[1000];
91024 static const char *vdbeMemTypeName(Mem *pMem){
91025 static const char *azTypes[] = {
91510 static const char * const azType[] = { "NOT NULL", "UNIQUE", "CHECK",
92488 char affinity; /* Affinity to use for comparison */
92809 static const unsigned char and_logic[] = { 0, 0, 0, 0, 1, 2, 0, 2, 2 };
92812 static const unsigned char or_logic[] = { 0, 1, 2, 1, 1, 1, 2, 1, 2 };
93015 static const unsigned char aMask[] = {
93572 const char *zAffinity; /* The affinity to be applied */
93647 char *zAffinity; /* The affinity string for the record */
93982 char *zName; /* Name of savepoint */
94026 pNew->zName = (char *)&pNew[1];
95902 const char *zDb; /* database name - used by the update hook */
96044 const char *zDb;
97165 const char *zSchema;
97166 char *zSql;
97316 char *z; /* Text of the error report */
97526 pRt->z = (char*)pFrame;
98057 const char *zFilename; /* Name of database file for pPager */
98136 pOut->z = (char *)sqlite3JournalModename(eNew);
98271 const char *z = pOp->p4.z;
98309 const char *zTab; /* Name of the virtual table */
98319 zTab = (const char*)sqlite3_value_text(&sMem);
98951 char *zTrace;
98975 char *z = sqlite3VdbeExpandSql(p, zTrace);
98981 char *z = sqlite3MPrintf(db, "-- %s", zTrace);
99181 const char *zTrace = p->zSql;
99289 char *zDb; /* Database name */
99311 static int blobSeekToRow(Incrblob *p, sqlite3_int64 iRow, char **pzErr){
99313 char *zErr = 0; /* Error message */
99381 const char *zDb, /* The attached database containing the blob */
99382 const char *zTable, /* The table containing the blob */
99383 const char *zColumn, /* The column containing the blob */
99391 char *zErr = 0;
99465 const char *zFault = 0;
99757 char *zErr;
100846 static void vdbeSorterWorkDebug(SortSubtask *pTask, const char *zEvent){
100852 static void vdbeSorterRewindDebug(const char *zEvent){
100860 const char *zEvent
100870 const char *zEvent
102585 char *zP4; /* Rendered P4 value */
102586 const char *zType; /* tables_used.type */
102587 const char *zSchema; /* tables_used.schema */
102588 const char *zName; /* tables_used.name */
102598 int argc, const char *const*argv,
102600 char **pzErr
102605 const char *azSchema[2] = {
102784 sqlite3_result_text(ctx, (char*)sqlite3OpcodeName(pOp->opcode),
102805 char *zCom = sqlite3VdbeDisplayComment(pVTab->db, pOp, pCur->zP4);
102860 int idxNum, const char *idxStr,
102873 const char *zSql = (const char*)sqlite3_value_text(argv[0]);
103051 const char *zJournal; /* Name of the journal file */
103327 const char *zName, /* Name of the journal file */
103790 const char *zCol,
103791 const char *zTab,
103792 const char *zDb
103795 const char *zSpan;
103909 const char *zDb, /* Name of the database containing table, or NULL */
103910 const char *zTab, /* Name of table containing column, or NULL */
103911 const char *zCol, /* Name of the column. */
104033 const char *zTabName;
104249 char *zAs = pEList->a[j].zEName;
104346 const char *zErr;
104473 ** const char *zMsg, // Type of error
104485 const char *zMsg, /* Type of error */
104489 const char *zIn = "partial index WHERE clauses";
104623 const char *zColumn;
104624 const char *zTable;
104625 const char *zDb;
104669 const char *zId; /* The function name. */
104780 const char *zType;
104999 const char *zCol;
105080 const char *zType, /* "ORDER" or "GROUP" */
105223 const char *zType /* "ORDER" or "GROUP" */
105301 const char *zType /* Either "ORDER" or "GROUP", as appropriate */
105433 const char *zSavedContext = pParse->zAuthContext;
105837 SQLITE_PRIVATE char sqlite3TableColumnAffinity(const Table *pTab, int iCol){
105858 SQLITE_PRIVATE char sqlite3ExprAffinity(const Expr *pExpr){
105929 const char *zC /* The collating sequence name */
105933 sqlite3TokenInit(&s, (char*)zC);
105994 const char *zColl = sqlite3ColumnColl(&p->y.pTab->aCol[j]);
106073 SQLITE_PRIVATE char sqlite3CompareAffinity(const Expr *pExpr, char aff2){
106074 char aff1 = sqlite3ExprAffinity(pExpr);
106095 static char comparisonAffinity(const Expr *pExpr){
106096 char aff;
106118 SQLITE_PRIVATE int sqlite3IndexAffinityOk(const Expr *pExpr, char idx_affinity){
106119 char aff = comparisonAffinity(pExpr);
106138 u8 aff = (char)sqlite3ExprAffinity(pExpr2);
106679 pNew->u.zToken = (char*)&pNew[1];
106702 const char *zToken /* Token argument. Might be NULL */
106962 const char *z;
107285 char *zToken = pNew->u.zToken = (char*)&zAlloc[nNewSize];
107812 const char *zStart, /* Start of the span */
107813 const char *zEnd /* End of the span */
107834 const char *zObject
107900 SQLITE_PRIVATE u32 sqlite3IsTrueOrFalse(const char *zIn){
108344 SQLITE_PRIVATE int sqlite3ExprNeedsNoAffinityChange(const Expr *p, char aff){
108380 SQLITE_PRIVATE int sqlite3IsRowid(const char *z){
108631 char idxaff = sqlite3TableColumnAffinity(pTab,iCol); /* RHS table */
108632 char cmpaff = sqlite3CompareAffinity(pLhs, idxaff);
108779 static char *exprINAffinity(Parse *pParse, const Expr *pExpr){
108783 char *zRet;
108791 char a = sqlite3ExprAffinity(pA);
108813 const char *zFmt = "sub-select returns %d columns - expected %d";
108989 char affinity; /* Affinity of the LHS of the IN */
109240 char *zAff = 0; /* Affinity string for comparisons */
109259 pParse->db, nVector*(sizeof(int) + sizeof(char)) + 1
109486 static void codeReal(Vdbe *v, const char *z, int negateFlag, int iMem){
109514 const char *z = pExpr->u.zToken;
109839 const char *azAff[] = { "blob", "text", "numeric", "integer", "real" };
109840 char aff;
109980 static const char zAff[] = "B\000C\000D\000E";
110078 const char *z;
110079 char *zBlob;
110097 const char *z = sqlite3VListNumToName(pParse->pVList, pExpr->iColumn);
110100 sqlite3VdbeAppendP4(v, (char*)z, P4_STATIC);
110265 const char *zId; /* The function name */
110370 sqlite3VdbeAddOp4(v, OP_CollSeq, 0, 0, 0, (char *)pColl, P4_COLLSEQ);
112381 const char *zDb, /* Name of db to verify schema of */
112383 const char *zWhen, /* "when" part of error message */
112416 static void renameFixQuotes(Parse *pParse, const char *zDb, int bTemp){
112456 char *zDb; /* Name of database iDb */
112458 char *zName = 0; /* NULL-terminated version of pName */
112461 const char *zTabName; /* Original name of the table */
112603 sqlite3VdbeAddOp4(v, OP_VRename, i, 0, 0,(const char*)pVTab, P4_VTAB);
112621 const char *zDb, /* Schema holding the table */
112622 const char *zTab, /* Table to check for empty */
112623 const char *zErr /* Error message text */
112643 const char *zDb; /* Database name */
112644 const char *zTab; /* Table name */
112645 char *zCol; /* Null-terminated column definition */
112733 zCol = sqlite3DbStrNDup(db, (char*)pColDef->z, pColDef->n);
112735 char *zEnd = &zCol[pColDef->n-1];
112888 const char *zType = 0;
112926 char *zOld = 0; /* Old column name */
112927 char *zNew = 0; /* New column name */
112928 const char *zDb; /* Name of schema containing the table */
113038 const char *zOld; /* Old column name */
113383 const char *zWhen,
113388 const char *zT = (const char*)sqlite3_value_text(pType);
113389 const char *zN = (const char*)sqlite3_value_text(pObject);
113390 char *zErr;
113410 const char *zOld
113415 const char *zName = pEList->a[i].zEName;
113435 const char *zOld
113440 const char *zName = pIdList->a[i].zName;
113455 const char *zDb, /* Name of schema SQL belongs to */
113457 const char *zSql, /* SQL to parse */
113509 const char *zSql, /* SQL statement to edit */
113510 const char *zNew, /* New token text */
113517 char *zQuot = 0;
113518 char *zOut;
113520 char *zBuf1 = 0;
113521 char *zBuf2 = 0;
113539 zOut = (char*)sqlite3DbMallocZero(db, (nSql*2+1) * 3);
113556 const char *zReplace;
113794 const char *zSql = (const char*)sqlite3_value_text(argv[0]);
113795 const char *zDb = (const char*)sqlite3_value_text(argv[3]);
113796 const char *zTable = (const char*)sqlite3_value_text(argv[4]);
113798 const char *zNew = (const char*)sqlite3_value_text(argv[6]);
113801 const char *zOld;
114018 const char *zDb = (const char*)sqlite3_value_text(argv[0]);
114019 const char *zInput = (const char*)sqlite3_value_text(argv[3]);
114020 const char *zOld = (const char*)sqlite3_value_text(argv[4]);
114021 const char *zNew = (const char*)sqlite3_value_text(argv[5]);
114204 char const *zDb = (const char*)sqlite3_value_text(argv[0]);
114205 char const *zInput = (const char*)sqlite3_value_text(argv[1]);
114317 char const *zDb = (const char*)sqlite3_value_text(argv[0]);
114318 char const *zInput = (const char*)sqlite3_value_text(argv[1]);
114321 char const *zWhen = (const char*)sqlite3_value_text(argv[5]);
114393 const char *zSql = (const char*)sqlite3_value_text(argv[1]);
114395 const char *zDb = db->aDb[iSchema].zDbSName;
114400 const char *zEnd;
114401 char *zNew = 0;
114422 zEnd = (const char*)pEnd->t.z;
114425 zEnd = (const char*)&zSql[pTab->u.tab.addColOffset];
114455 const char *zDb; /* Database containing pTab ("main" etc.) */
114456 char *zCol = 0; /* Name of column to drop */
114776 const char *zWhere, /* Delete entries for this table or index */
114777 const char *zWhereType /* Either "tbl" or "idx" */
114780 const char *zName;
114781 const char *zCols;
114812 const char *zTab = aTable[i].zName;
115635 pStat1->zName = (char*)&pStat1[1];
115639 sqlite3VdbeAddOp4(pParse->pVdbe, OP_Noop, 0, 0, 0,(char*)pStat1,P4_DYNAMIC);
115658 const char *zIdxName; /* Name of the index */
115785 char *pColl = (char*)sqlite3LocateCollSeq(pParse, pIdx->azColl[i]);
115868 sqlite3VdbeChangeP4(v, -1, (char*)pStat1, P4_TABLE);
115927 sqlite3VdbeChangeP4(v, -1, (char*)pStat1, P4_TABLE);
116010 char *z, *zDb;
116061 const char *zDatabase;
116070 char *zIntArray, /* String containing int array to decode */
116076 char *z = zIntArray;
116142 static int analysisLoader(void *pData, int argc, char **argv, char **NotUsed){
116146 const char *z;
116181 decodeIntArray((char*)z, nCol, aiRowEst, pIndex->aiRowLogEst, pIndex);
116193 decodeIntArray((char*)z, 1, 0, &pTable->nRowLogEst, &fakeIdx);
116291 const char *zName,
116292 const char *zDb
116316 const char *zSql1, /* SQL statement 1 (see above) */
116317 const char *zSql2, /* SQL statement 2 (see above) */
116318 const char *zDb /* Database name (e.g. "main") */
116322 char *zSql; /* Text of the SQL statement */
116338 char *zIndex; /* Index name */
116345 zIndex = (char *)sqlite3_column_text(pStmt, 0);
116389 char *zIndex; /* Index name */
116393 zIndex = (char *)sqlite3_column_text(pStmt, 0);
116405 decodeIntArray((char*)sqlite3_column_text(pStmt,1),nCol,pSample->anEq,0,0);
116406 decodeIntArray((char*)sqlite3_column_text(pStmt,2),nCol,pSample->anLt,0,0);
116407 decodeIntArray((char*)sqlite3_column_text(pStmt,3),nCol,pSample->anDLt,0,0);
116435 static int loadStat4(sqlite3 *db, const char *zDb){
116476 char *zSql;
116598 SQLITE_PRIVATE int sqlite3DbIsNamed(sqlite3 *db, int iDb, const char *zName){
116628 const char *zName;
116629 const char *zFile;
116630 char *zPath = 0;
116631 char *zErr = 0;
116635 char *zErrDyn = 0;
116639 zFile = (const char *)sqlite3_value_text(argv[0]);
116640 zName = (const char *)sqlite3_value_text(argv[1]);
116752 char *zKey;
116764 zKey = (char *)sqlite3_value_blob(argv[2]);
116853 const char *zName = (const char *)sqlite3_value_text(argv[0]);
116858 char zErr[128];
116939 char *zAuthArg;
117089 const char *zType, /* "view", "trigger", or "index" */
117258 int (*xAuth)(void*,int,const char*,const char*,const char*,const char*),
117292 const char *zTab, /* Table name */
117293 const char *zCol, /* Column name */
117297 char *zDb = db->aDb[iDb].zDbSName; /* Schema name of attached database */
117307 char *z = sqlite3_mprintf("%s.%s", zTab, zCol);
117333 const char *zCol; /* Name of the column of the table */
117386 const char *zArg1,
117387 const char *zArg2,
117388 const char *zArg3
117435 const char *zContext
117493 const char *zLockName; /* Name of the table */
117511 const char *zName /* Name of the table to be locked */
117547 const char *zName /* Name of the table to be locked */
117688 char *vtab = (char *)sqlite3GetVTable(db, pParse->apVtabLock[i]);
117759 SQLITE_PRIVATE void sqlite3NestedParse(Parse *pParse, const char *zFormat, ...){
117761 char *zSql;
117764 char saveBuf[PARSE_TAIL_SZ];
117795 SQLITE_PRIVATE int sqlite3UserAuthTable(const char *zTable){
117812 SQLITE_PRIVATE Table *sqlite3FindTable(sqlite3 *db, const char *zName, const char *zDatabase){
117893 const char *zName, /* Name of the table we are looking for */
117894 const char *zDbase /* Name of the database. Might be NULL */
117931 const char *zMsg = flags & LOCATE_VIEW ? "no such view" : "no such table";
117958 const char *zDb;
117973 SQLITE_PRIVATE const char *sqlite3PreferredTableName(const char *zName){
117997 SQLITE_PRIVATE Index *sqlite3FindIndex(sqlite3 *db, const char *zName, const char *zDb){
118037 SQLITE_PRIVATE void sqlite3UnlinkAndDeleteIndex(sqlite3 *db, int iDb, const char *zIdxName){
118194 const char *zColl
118198 char *zNew;
118216 SQLITE_PRIVATE const char *sqlite3ColumnColl(Column *pCol){
118217 const char *z;
118294 char *zName = pIndex->zName;
118341 SQLITE_PRIVATE void sqlite3UnlinkAndDeleteTable(sqlite3 *db, int iDb, const char *zTabName){
118385 SQLITE_PRIVATE char *sqlite3NameFromToken(sqlite3 *db, const Token *pName){
118386 char *zName;
118388 zName = sqlite3DbStrNDup(db, (const char*)pName->z, pName->n);
118415 SQLITE_PRIVATE int sqlite3FindDbName(sqlite3 *db, const char *zName){
118437 char *zName; /* Name we are searching for */
118517 const char *zName, /* Name of the object to check */
118518 const char *zType, /* Type of this object */
118519 const char *zTblName /* Parent table name for triggers and indexes */
118694 char *zName = 0; /* The name of the new table */
118737 char *zDb = db->aDb[iDb].zDbSName;
118756 char *zDb = db->aDb[iDb].zDbSName;
118810 static const char nullRow[] = { 6, 0, 0, 0, 0, 0 };
118970 char *z;
118971 char *zType;
118978 char affinity = SQLITE_AFF_BLOB;
119127 SQLITE_PRIVATE char sqlite3AffinityType(const char *zIn, Column *pCol){
119129 char aff = SQLITE_AFF_NUMERIC;
119130 const char *zChar = 0;
119207 const char *zStart, /* Start of the default value text */
119208 const char *zEnd /* First character past end of defaut value text */
119334 const char *zCName;
119384 const char *zStart, /* Opening "(" */
119385 const char *zEnd /* Closing ")" */
119418 char *zColl; /* Dequoted name of collation sequence */
119532 static int identLength(const char *z){
119553 static void identPut(char *z, int *pIdx, char *zSignedIdent){
119554 unsigned char *zIdent = (unsigned char*)zSignedIdent;
119581 static char *createTableStmt(sqlite3 *db, Table *p){
119583 char *zStmt;
119584 char *zSep, *zSep2, *zEnd;
119611 static const char * const azType[] = {
119619 const char *zType;
119650 char *zExtra;
119654 nByte = (sizeof(char*) + sizeof(LogEst) + sizeof(i16) + 1)*N;
119657 memcpy(zExtra, pIdx->azColl, sizeof(char*)*pIdx->nColumn);
119658 pIdx->azColl = (const char**)zExtra;
119659 zExtra += sizeof(char*)*N;
119968 SQLITE_PRIVATE int sqlite3IsShadowTableOf(sqlite3 *db, Table *pTab, const char *zName){
120027 SQLITE_PRIVATE int sqlite3ShadowTableName(sqlite3 *db, const char *zName){
120028 char *zTail; /* Pointer to the last "_" in zName */
120249 char *zType; /* "view" or "table" */
120250 char *zType2; /* "VIEW" or "TABLE" */
120251 char *zStmt; /* Text of the CREATE TABLE or CREATE VIEW statement */
120442 const char *z;
120803 const char *zType, /* "idx" or "tbl" */
120804 const char *zName /* Name of index or table */
120807 const char *zDbName = pParse->db->aDb[iDb].zDbSName;
120809 char zTab[24];
120967 const char *zTab = SCHEMA_TABLE(iDb);
120968 const char *zDb = db->aDb[iDb].zDbSName;
120969 const char *zArg2 = 0;
121066 char *z;
121101 z = (char*)&pFKey->aCol[nCol];
121243 sqlite3VdbeAddOp4(v, OP_SorterOpen, iSorter, 0, pIndex->nKeyCol, (char*)
121260 (char *)pKey, P4_KEYINFO);
121316 char **ppExtra /* Pointer to the "extra" space */
121322 ROUND8(sizeof(char*)*nCol) + /* Index.azColl */
121328 char *pExtra = ((char*)p)+ROUND8(sizeof(Index));
121329 p->azColl = (const char**)pExtra; pExtra += ROUND8(sizeof(char*)*nCol);
121335 *ppExtra = ((char*)p) + nByte;
121388 char *zName = 0; /* Name of the index */
121400 char *zExtra = 0; /* Extra space after the Index object */
121553 const char *zDb = pDb->zDbSName;
121650 const char *zColl; /* Collation sequence name */
121781 const char *z1;
121782 const char *z2;
121860 char *zStmt;
122065 const char *zDb = db->aDb[iDb].zDbSName;
122066 const char *zTab = SCHEMA_TABLE(iDb);
122119 char *z;
122130 z = (char*)pArray;
122184 SQLITE_PRIVATE int sqlite3IdListIndex(IdList *pList, const char *zName){
122643 char *zName = sqlite3NameFromToken(pParse->db, pName);
122647 static const char * const az[] = { "BEGIN", "RELEASE", "ROLLBACK" };
122718 SQLITE_PRIVATE void sqlite3CodeVerifyNamedSchema(Parse *pParse, const char *zDb){
122791 char *p4, /* Error message */
122814 char *zErr;
122825 char *zCol;
122850 char *zMsg;
122869 static int collationMatch(const char *zColl, Index *pIndex){
122873 const char *z = pIndex->azColl[i];
122888 static void reindexTable(Parse *pParse, Table *pTab, char const *zColl){
122909 static void reindexDatabases(Parse *pParse, char const *zColl){
122943 char *z; /* Name of a table or index */
122944 const char *zDb; /* Name of the database */
122961 char *zColl;
123015 const char *zColl = pIdx->azColl[i];
123103 char *zName;
123178 static void callCollNeeded(sqlite3 *db, int enc, const char *zName){
123181 char *zExternal = sqlite3DbStrDup(db, zName);
123188 char const *zExternal;
123209 char *z = pColl->zName;
123236 const char *zName = pColl->zName;
123264 const char *zName, /* Name of the collating sequence */
123275 pColl[0].zName = (char*)&pColl[3];
123277 pColl[1].zName = (char*)&pColl[3];
123279 pColl[2].zName = (char*)&pColl[3];
123317 const char *zName, /* Name of the collating sequence. Might be NULL */
123363 const char *zName /* Collating sequence name */
123410 SQLITE_PRIVATE CollSeq *sqlite3LocateCollSeq(Parse *pParse, const char *zName){
123491 const char *zFunc /* Name of function */
123513 const char *zName = aDef[i].zName;
123553 const char *zName, /* Name of the function. zero-terminated */
123614 pBest->zName = (const char*)&pBest[1];
123617 memcpy((char*)&pBest[1], zName, nName+1);
123747 SQLITE_PRIVATE void sqlite3CodeChangeCount(Vdbe *v, int regCounter, const char *zColName){
123880 char *zStmtType /* Either DELETE or UPDATE. For err msgs. */
123924 const char *zName = pTab->aCol[pPk->aiColumn[0]].zCnName;
124319 const char *pVTab = (const char *)sqlite3GetVTable(db, pTab);
124535 sqlite3VdbeAppendP4(v, (char*)pTab, P4_TABLE);
124800 static const char *azType[] = { "integer", "real", "text", "blob", "null" };
124847 const unsigned char *z = sqlite3_value_text(argv[0]);
124848 const unsigned char *z0;
124849 unsigned char c;
124928 const unsigned char *zHaystack;
124929 const unsigned char *zNeedle;
124935 unsigned char firstChar;
124998 const char *zFormat;
125002 if( argc>=1 && (zFormat = (const char*)sqlite3_value_text(argv[0]))!=0 ){
125032 const unsigned char *z;
125033 const unsigned char *z2;
125107 sqlite3_result_text64(context, (char*)z, z2-z, SQLITE_TRANSIENT,
125114 sqlite3_result_blob64(context, (char*)&z[p1], (u64)p2, SQLITE_TRANSIENT);
125125 char *zBuf;
125164 char *z;
125185 char *z1;
125186 const char *z2;
125189 z2 = (char*)sqlite3_value_text(argv[0]);
125192 assert( z2==(char*)sqlite3_value_text(argv[0]) );
125197 z1[i] = (char)sqlite3Toupper(z2[i]);
125204 char *z1;
125205 const char *z2;
125208 z2 = (char*)sqlite3_value_text(argv[0]);
125211 assert( z2==(char*)sqlite3_value_text(argv[0]) );
125268 unsigned char *p;
125278 sqlite3_result_blob(context, (char*)p, n, sqlite3_free);
125412 u32 matchOther /* The escape char (LIKE) or '[' (GLOB) */
125418 const u8 *zEscaped = 0; /* One past the last escaped input char */
125460 char zStop[3];
125471 zString += strcspn((const char*)zString, zStop);
125541 SQLITE_API int sqlite3_strglob(const char *zGlobPattern, const char *zString){
125555 SQLITE_API int sqlite3_strlike(const char *zPattern, const char *zStr, unsigned int esc){
125592 const unsigned char *zA, *zB;
125625 const unsigned char *zEsc = sqlite3_value_text(argv[2]);
125627 if( sqlite3Utf8CharLen((char*)zEsc, -1)!=1 ){
125727 const char *zOptName;
125734 if( (zOptName = (const char*)sqlite3_value_text(argv[0]))!=0 ){
125764 static const char hexdigits[] = {
125782 const char *zVal;
125800 char const *zBlob = sqlite3_value_blob(pValue);
125805 char *zText = pStr->zText;
125820 const unsigned char *zArg = sqlite3_value_text(pValue);
125866 const unsigned char *z = sqlite3_value_text(argv[0]);
125872 ** The char() function takes zero or more arguments, each of which is
125881 unsigned char *z, *zOut;
125910 sqlite3_result_text64(context, (char*)z, zOut-z, sqlite3_free, SQLITE_UTF8);
125923 const unsigned char *pBlob;
125924 char *zHex, *z;
125933 unsigned char c = *pBlob;
125973 const unsigned char *zStr; /* The input string A */
125974 const unsigned char *zPattern; /* The pattern string B */
125975 const unsigned char *zRep; /* The replacement string C */
125976 unsigned char *zOut; /* The output */
126054 sqlite3_result_text(context, (char*)zOut, j, sqlite3_free);
126066 const unsigned char *zIn; /* Input string */
126067 const unsigned char *zCharSet; /* Set of characters to trim */
126072 unsigned char **azChar = 0; /* Individual characters in zCharSet */
126084 static unsigned char * const azOne[] = { (u8*)" " };
126087 azChar = (unsigned char **)azOne;
126092 const unsigned char *z;
126098 ((i64)nChar)*(sizeof(char*)+sizeof(unsigned)));
126104 azChar[nChar] = (unsigned char *)z;
126139 sqlite3_result_text(context, (char*)zIn, nIn, SQLITE_TRANSIENT);
126179 char zResult[8];
126182 static const unsigned char iCode[] = {
126228 const char *zFile = (const char *)sqlite3_value_text(argv[0]);
126229 const char *zProc;
126231 char *zErrMsg = 0;
126242 zProc = (const char *)sqlite3_value_text(argv[1]);
126493 const char *zVal;
126495 const char *zSep;
126514 zSep = (char*)sqlite3_value_text(argv[1]);
126552 zVal = (char*)sqlite3_value_text(argv[0]);
126626 const char *zText = sqlite3_str_value(pAccum);
126696 SQLITE_PRIVATE int sqlite3IsLikeFunction(sqlite3 *db, Expr *pExpr, int *pIsNocase, char *aWc){
126720 assert( (char*)&likeInfoAlt == (char*)&likeInfoAlt.matchAll );
126721 assert( &((char*)&likeInfoAlt)[1] == (char*)&likeInfoAlt.matchOne );
126722 assert( &((char*)&likeInfoAlt)[2] == (char*)&likeInfoAlt.matchSet );
126728 char *zEscape;
127005 FUNCTION(char, -1, 0, 0, charFunc ),
127317 char *zKey = pFKey->aCol[0].zCol; /* Name of left-most parent key column */
127378 const char *zDfltColl; /* Def. collation for column */
127379 char *zIdxCol; /* Name of indexed column */
127603 const char *zColl;
127712 const char *zCol; /* Name of column in child table */
127957 char *zKey = p->aCol[i].zCol;
128022 const char *zDb; /* Name of database containing pTab */
128104 char *zCol = pTo->aCol[pIdx ? pIdx->aiColumn[i] : pTo->iPKey].zCnName;
128350 char const *zFrom; /* Name of child table */
128476 pStep->zTarget = (char *)&pStep[1];
128477 memcpy((char *)pStep->zTarget, zFrom, nFrom);
128576 const char *z = (p ? pFKey->pNextTo->zTo : pFKey->zTo);
128675 SQLITE_PRIVATE const char *sqlite3IndexAffinityStr(sqlite3 *db, Index *pIdx){
128687 pIdx->zColAff = (char *)sqlite3DbMallocRaw(0, pIdx->nColumn+1);
128694 char aff;
128720 SQLITE_PRIVATE char *sqlite3TableAffinityStr(sqlite3 *db, const Table *pTab){
128721 char *zColAff;
128722 zColAff = (char *)sqlite3DbMallocRaw(db, pTab->nCol+1);
128779 char *zColAff;
128906 char *zP4 = pOp->p4.z;
129935 const char *pVTab = (const char *)sqlite3GetVTable(db, pTab);
130396 char *zMsg = sqlite3MPrintf(db, "%s.%s", pTab->zName,
130465 char *zName = pCheck->a[i].zEName;
130927 char *p4 = (char*)sqlite3LocateCollSeq(pParse, pPk->azColl[i]);
131020 const char *zP4;
131137 sqlite3VdbeAddOp4(v, OP_Insert, iCur, regData, r, (char*)pTab, P4_TABLE);
131679 sqlite3VdbeChangeP4(v, -1, (char*)pDest, P4_TABLE);
131720 const char *zColl = pSrcIdx->azColl[i];
131795 const char *zSql, /* The SQL to be executed */
131798 char **pzErrMsg /* Write error messages here */
131801 const char *zLeftover; /* Tail of unprocessed SQL */
131803 char **azCols = 0; /* Names of result columns */
131813 char **azVals = 0;
131838 azCols = sqlite3DbMallocRaw(db, (2*nCol+1)*sizeof(const char*));
131843 azCols[i] = (char *)sqlite3_column_name(pStmt, i);
131853 azVals[i] = (char *)sqlite3_column_text(pStmt, i);
131968 int (*bind_parameter_index)(sqlite3_stmt*,const char*zName);
131969 const char * (*bind_parameter_name)(sqlite3_stmt*,int);
131970 int (*bind_text)(sqlite3_stmt*,int,const char*,int n,void(*)(void*));
131978 int eTextRep,const char*));
131985 const char * (*column_database_name)(sqlite3_stmt*,int);
131987 const char * (*column_decltype)(sqlite3_stmt*,int i);
131992 const char * (*column_name)(sqlite3_stmt*,int);
131994 const char * (*column_origin_name)(sqlite3_stmt*,int);
131996 const char * (*column_table_name)(sqlite3_stmt*,int);
131998 const unsigned char * (*column_text)(sqlite3_stmt*,int iCol);
132003 int (*complete)(const char*sql);
132005 int (*create_collation)(sqlite3*,const char*,int,void*,
132009 int (*create_function)(sqlite3*,const char*,int,int,void*,
132017 int (*create_module)(sqlite3*,const char*,const sqlite3_module*,void*);
132020 int (*declare_vtab)(sqlite3*,const char*);
132023 const char * (*errmsg)(sqlite3*);
132025 int (*exec)(sqlite3*,const char*,sqlite3_callback,void*,char**);
132029 void (*free_table)(char**result);
132032 int (*get_table)(sqlite3*,const char*,char***,int*,int*,char**);
132036 const char * (*libversion)(void);
132039 char * (*mprintf)(const char*,...);
132040 int (*open)(const char*,sqlite3**);
132042 int (*prepare)(sqlite3*,const char*,int,sqlite3_stmt**,const char**);
132044 void * (*profile)(sqlite3*,void(*)(void*,const char*,sqlite_uint64),void*);
132050 void (*result_error)(sqlite3_context*,const char*,int);
132055 void (*result_text)(sqlite3_context*,const char*,int,void(*)(void*));
132061 int (*set_authorizer)(sqlite3*,int(*)(void*,int,const char*,const char*,
132062 const char*,const char*),void*);
132064 char * (*xsnprintf)(int,char*,const char*,...);
132066 int (*table_column_metadata)(sqlite3*,const char*,const char*,const char*,
132067 char const**,char const**,int*,int*,int*);
132070 void * (*trace)(sqlite3*,void(*xTrace)(void*,const char*),void*);
132072 void * (*update_hook)(sqlite3*,void(*)(void*,int ,char const*,char const*,
132082 const unsigned char * (*value_text)(sqlite3_value*);
132087 char *(*vmprintf)(const char*,va_list);
132089 int (*overload_function)(sqlite3*, const char *zFuncName, int nArg);
132091 int (*prepare_v2)(sqlite3*,const char*,int,sqlite3_stmt**,const char**);
132095 int (*create_module_v2)(sqlite3*,const char*,const sqlite3_module*,void*,
132101 int (*blob_open)(sqlite3*,const char*,const char*,const char*,sqlite3_int64,
132105 int (*create_collation_v2)(sqlite3*,const char*,int,void*,
132108 int (*file_control)(sqlite3*,const char*,int,void*);
132116 int (*open_v2)(const char*,sqlite3**,int,const char*);
132122 sqlite3_vfs *(*vfs_find)(const char*);
132134 const char *(*sql)(sqlite3_stmt*);
132137 sqlite3_backup *(*backup_init)(sqlite3*,const char*,sqlite3*,const char*);
132141 const char *(*compileoption_get)(int);
132142 int (*compileoption_used)(const char*);
132143 int (*create_function_v2)(sqlite3*,const char*,int,int,void*,
132152 void (*log)(int,const char*,...);
132154 const char *(*sourceid)(void);
132156 int (*strnicmp)(const char*,const char*,int);
132159 int (*wal_checkpoint)(sqlite3*,const char*);
132160 void *(*wal_hook)(sqlite3*,int(*)(void*,sqlite3*,const char*,int),void*);
132166 const char *(*db_filename)(sqlite3*,const char*);
132167 int (*db_readonly)(sqlite3*,const char*);
132169 const char *(*errstr)(int);
132172 int (*stricmp)(const char*,const char*);
132173 int (*uri_boolean)(const char*,const char*,int);
132174 sqlite3_int64 (*uri_int64)(const char*,const char*,sqlite3_int64);
132175 const char *(*uri_parameter)(const char*,const char*);
132176 char *(*xvsnprintf)(int,char*,const char*,va_list);
132177 int (*wal_checkpoint_v2)(sqlite3*,const char*,int,int*,int*);
132182 int (*bind_text64)(sqlite3_stmt*,int,const char*,sqlite3_uint64,
132183 void(*)(void*),unsigned char);
132185 int (*load_extension)(sqlite3*,const char*,const char*,char**);
132192 void (*result_text64)(sqlite3_context*,const char*,sqlite3_uint64,
132193 void(*)(void*), unsigned char);
132194 int (*strglob)(const char*,const char*);
132205 int (*strlike)(const char*,const char*,unsigned int);
132211 char *(*expanded_sql)(sqlite3_stmt*);
132215 int (*prepare_v3)(sqlite3*,const char*,int,unsigned int,
132216 sqlite3_stmt**,const char**);
132219 int (*bind_pointer)(sqlite3_stmt*,int,void*,const char*,void(*)(void*));
132220 void (*result_pointer)(sqlite3_context*,void*,const char*,void(*)(void*));
132221 void *(*value_pointer)(sqlite3_value*,const char*);
132224 const char *(*vtab_collation)(sqlite3_index_info*,int);
132227 int (*keyword_name)(int,const char**,int*);
132228 int (*keyword_check)(const char*,int);
132230 char *(*str_finish)(sqlite3_str*);
132231 void (*str_appendf)(sqlite3_str*, const char *zFormat, ...);
132232 void (*str_vappendf)(sqlite3_str*, const char *zFormat, va_list);
132233 void (*str_append)(sqlite3_str*, const char *zIn, int N);
132234 void (*str_appendall)(sqlite3_str*, const char *zIn);
132235 void (*str_appendchar)(sqlite3_str*, int N, char C);
132239 char *(*str_value)(sqlite3_str*);
132241 int (*create_window_function)(sqlite3*,const char*,int,int,void*,
132248 const char *(*normalized_sql)(sqlite3_stmt*);
132253 int (*drop_modules)(sqlite3*,const char**);
132256 const char *(*uri_key)(const char*,int);
132257 const char *(*filename_database)(const char*);
132258 const char *(*filename_journal)(const char*);
132259 const char *(*filename_wal)(const char*);
132261 const char *(*create_filename)(const char*,const char*,const char*,
132262 int,const char**);
132263 void (*free_filename)(const char*);
132264 sqlite3_file *(*database_file_object)(const char*);
132266 int (*txn_state)(sqlite3*,const char*);
132272 unsigned int(*)(void*,const char*,unsigned int,unsigned int,unsigned int),
132282 int (*deserialize)(sqlite3*,const char*,unsigned char*,
132284 unsigned char *(*serialize)(sqlite3*,const char *,sqlite3_int64*,
132286 const char *(*db_name)(sqlite3*,int);
132290 int (*set_droptable_handle)(sqlite3*,void(*)(sqlite3*,const char*,const char*));
132299 char **pzErrMsg, /* Used to set error string on failure. */
133171 const char *zFile, /* Name of the shared library containing extension */
133172 const char *zProc, /* Entry point. Use "sqlite3_extension_init" if 0 */
133173 char **pzErrMsg /* Put error message here if not 0 */
133178 char *zErrmsg = 0;
133179 const char *zEntry;
133180 char *zAltEntry = 0;
133187 static const char *azEndings[] = {
133225 char *zAltFile = sqlite3_mprintf("%s.%s", zFile, azEndings[ii]);
133259 zAltEntry[iEntry++] = (char)sqlite3UpperToLower[(unsigned)c];
133322 const char *zFile, /* Name of the shared library containing extension */
133323 const char *zProc, /* Entry point. Use "sqlite3_extension_init" if 0 */
133324 char **pzErrMsg /* Put error message here if not 0 */
133503 char *zErrmsg;
133635 static const char *const pragCName[] = {
133701 const char *const zName; /* Name of pragma */
134282 static u8 getSafetyLevel(const char *z, int omitFull, u8 dflt){
134284 static const char zText[] = "onoffalseyestruextrafull";
134307 SQLITE_PRIVATE u8 sqlite3GetBoolean(const char *z, u8 dflt){
134320 static int getLockingMode(const char *z){
134335 static int getAutoVacuum(const char *z){
134351 static int getTempStore(const char *z){
134393 static int changeTempStorage(Parse *pParse, const char *zStorageType){
134437 const char *zValue /* Value to be returned */
134440 sqlite3VdbeLoadString(v, 1, (const char*)zValue);
134479 static const char *actionName(u8 action){
134480 const char *zName;
134499 SQLITE_PRIVATE const char *sqlite3JournalModename(int eMode){
134500 static char * const azModeName[] = {
134521 static const PragmaName *pragmaLocate(const char *zName){
134557 const char *zType;
134558 static const char *azEnc[] = { 0, "utf8", "utf16le", "utf16be" };
134626 char *zLeft = 0; /* Nul-terminated UTF-8 string <id> */
134627 char *zRight = 0; /* Nul-terminated UTF-8 string <value>, or NULL */
134628 const char *zDb = 0; /* The database name */
134630 char *aFcntl[4]; /* Argument to SQLITE_FCNTL_PRAGMA */
134640 extern int sqlite3CodecPragma(sqlite3*, int, Parse *, const char *, const char *);
134685 ** file control is an array of pointers to strings (char**) in which the
134897 const char *zRet = "normal";
134952 const char *zMode;
135307 char *proxy_file_path = NULL;
135506 char *zSql = sqlite3MPrintf(db, "SELECT*FROM\"%w\"", pTab->zName);
135525 const char *zType;
135631 const char *azOrigin[] = { "c", "u", "pk" };
135989 sqlite3VdbeAddOp4(v, OP_IntegrityCk, 2, cnt, 1, (char*)aRoot,P4_INTARRAY);
136054 char *zErr;
136081 char *zErr;
136141 static unsigned char aStdTypeMask[] = {
136193 char *zErr;
136298 aOp[5].p4.z = (char*)sqlite3ErrStr(SQLITE_CORRUPT);
136331 char *zName;
136460 const char *zOpt;
136588 char *zSubSql; /* SQL statement for the OP_SqlExec opcode */
136741 static const char *const azLockName[] = {
136748 const char *zState = "unknown";
136776 char zBuf[40];
136777 const char *zKey = zRight;
136847 char *azArg[2]; /* Value of the argument and schema */
136856 int argc, const char *const*argv,
136858 char **pzErr
136864 char cSep = '(';
136866 char zBuf[200];
137015 int idxNum, const char *idxStr,
137023 char *zSql;
137030 const char *zText = (const char*)sqlite3_value_text(argv[i]);
137128 SQLITE_PRIVATE Module *sqlite3PragmaVtabRegister(sqlite3 *db, const char *zName){
137167 char **azObj, /* Type and name of object being parsed */
137168 const char *zExtra /* Error information */
137176 static const char *azAlterType[] = {
137190 char *z;
137191 const char *zObj = azObj[1] ? azObj[1] : "?";
137215 const char *zSql, /* UTF-8 encoded SQL statement. */
137220 const char **pzTail /* OUT: End of parsed string */
137238 SQLITE_PRIVATE int sqlite3InitCallback(void *pInit, int argc, char **argv, char **NotUsed){
137258 && 'c'==sqlite3UpperToLower[(unsigned char)argv[4][0]]
137259 && 'r'==sqlite3UpperToLower[(unsigned char)argv[4][1]] ){
137285 db->init.azInit = (const char**)argv;
137341 SQLITE_PRIVATE int sqlite3InitOne(sqlite3 *db, int iDb, char **pzErrMsg, u32 mFlags){
137348 char const *azArg[6];
137351 const char *zSchemaTabName;
137382 sqlite3InitCallback(&initData, 5, (char **)azArg, 0);
137506 char *zSql;
137580 SQLITE_PRIVATE int sqlite3Init(sqlite3 *db, char **pzErrMsg){
137822 const char *zSql, /* UTF-8 encoded SQL statement. */
137827 const char **pzTail /* OUT: End of parsed string */
137883 const char *zDb = db->aDb[i].zDbSName;
137897 char *zSqlCopy;
137967 const char *zSql, /* UTF-8 encoded SQL statement. */
137972 const char **pzTail /* OUT: End of parsed string */
138015 const char *zSql;
138053 const char *zSql, /* UTF-8 encoded SQL statement. */
138056 const char **pzTail /* OUT: End of parsed string */
138065 const char *zSql, /* UTF-8 encoded SQL statement. */
138068 const char **pzTail /* OUT: End of parsed string */
138083 const char *zSql, /* UTF-8 encoded SQL statement. */
138087 const char **pzTail /* OUT: End of parsed string */
138121 char *zSql8;
138122 const char *zTail8 = 0;
138134 const char *z = (const char*)zSql;
138470 static const char zKeyText[] = "naturaleftouterightfullinnercross";
138492 && sqlite3StrNICmp((char*)p->z, &zKeyText[aKeyword[j].i], p->n)==0 ){
138508 const char *zSp1 = " ";
138509 const char *zSp2 = " ";
138523 SQLITE_PRIVATE int sqlite3ColumnIndex(Table *pTab, const char *zCol){
138563 const char *zCol, /* Name of the column we are looking for */
138723 char *zName; /* Name of column in the right table */
138756 char *zName; /* Name of the term in the USING clause */
138976 sqlite3VdbeChangeP4(v, -1, (char*)pKI, P4_KEYINFO);
139125 sqlite3VdbeChangeP4(v, -1, (const char *)pColl, P4_COLLSEQ);
139815 SQLITE_PRIVATE const char *sqlite3SelectOpName(int id){
139816 char *z;
139837 static void explainTempTable(Parse *pParse, const char *zUsage){
140103 static const char *columnTypeImpl(
140109 const char **pzOrigDb,
140110 const char **pzOrigTab,
140111 const char **pzOrigCol
140114 char const *zType = 0;
140117 char const *zOrigDb = 0;
140118 char const *zOrigTab = 0;
140119 char const *zOrigCol = 0;
140268 const char *zType;
140270 const char *zOrigDb = 0;
140271 const char *zOrigTab = 0;
140272 const char *zOrigCol = 0;
140362 char *zName = pEList->a[i].zEName;
140365 char *zCol;
140377 char *zName = 0;
140384 const char *z = pEList->a[i].zEName;
140425 char *zName; /* Column name */
140534 char aff /* Default affinity for columns */
140552 const char *zType;
140585 SQLITE_PRIVATE Table *sqlite3ResultSetOfSelect(Parse *pParse, Select *pSelect, char aff){
140874 (char*)pKeyInfo, P4_KEYINFO);
141384 sqlite3VdbeChangeP4(v, addr, (char*)sqlite3KeyInfoRef(pKeyInfo),
141461 (char*)sqlite3KeyInfoRef(pKeyInfo), P4_KEYINFO);
141936 sqlite3VdbeAddOp4(v, OP_Permutation, 0, 0, 0, (char*)aPermute, P4_INTARRAY);
141938 (char*)pKeyMerge, P4_KEYINFO);
142482 const char *zSavedAuthContext = pParse->zAuthContext;
142626 char aff;
143407 const char *zFunc; /* Name of aggregate function pFunc */
143500 char *zIndexedBy = pFrom->u1.zIndexedBy;
143629 const char *zName = pItem->zName;
143934 const char *zName, /* Name we are looking for */
144154 char *zTName = 0; /* text of name of TABLE */
144163 char *zTabName; /* AS name for this data source */
144164 const char *zSchemaName = 0; /* Schema name for this data source */
144193 const char *zUName = pUsing->a[ii].zName;
144208 char *zName = pTab->aCol[j].zCnName;
144499 pFunc->iDistinct, 0, 0, (char*)pKeyInfo, P4_KEYINFO);
144605 sqlite3VdbeAddOp4(v, OP_CollSeq, regHit, 0, 0, (char *)pColl, P4_COLLSEQ);
145204 const char *zSavedAuthContext;
145437 (char*)pKeyInfo, P4_KEYINFO
145479 (char*)sqlite3KeyInfoFromExprList(pParse, p->pEList,0,0),
145747 0, (char*)pKeyInfo, P4_KEYINFO);
145873 (char*)sqlite3KeyInfoRef(pKeyInfo), P4_KEYINFO);
146016 sqlite3VdbeChangeP4(v, -1, (char *)pKeyInfo, P4_KEYINFO);
146189 char **azResult; /* Accumulated output */
146190 char *zErrMsg; /* Error message text, if an error occurs */
146203 static int sqlite3_get_table_cb(void *pArg, int nCol, char **argv, char **colv){
146207 char *z; /* A single column of result */
146218 char **azNew;
146220 azNew = sqlite3Realloc( p->azResult, sizeof(char*)*p->nAlloc );
146279 const char *zSql, /* The SQL to be executed */
146280 char ***pazResult, /* Write the result table here */
146283 char **pzErrMsg /* Write error messages here */
146301 res.azResult = sqlite3_malloc64(sizeof(char*)*res.nAlloc );
146328 char **azNew;
146329 azNew = sqlite3Realloc( res.azResult, sizeof(char*)*res.nData );
146347 char **azResult /* Result returned from sqlite3_get_table() */
146479 char *zName = 0; /* Name of the trigger */
146596 const char *zDb = db->aDb[iTabDb].zDbSName;
146597 const char *zDbTrig = isTemp ? db->aDb[1].zDbSName : zDb;
146678 char *zName; /* Name of trigger */
146714 char *z;
146737 z = sqlite3DbStrNDup(db, (char*)pAll->z, pAll->n);
146777 static char *triggerSpanDup(sqlite3 *db, const char *zStart, const char *zEnd){
146778 char *z = sqlite3DbSpanDup(db, zStart, zEnd);
146794 const char *zStart, /* Start of SQL text */
146795 const char *zEnd /* End of SQL text */
146819 const char *zStart, /* Start of SQL text */
146820 const char *zEnd /* End of SQL text */
146828 char *z = (char*)&pTriggerStep[1];
146855 const char *zStart, /* Start of SQL text */
146856 const char *zEnd /* End of SQL text */
146900 const char *zStart, /* Start of SQL text */
146901 const char *zEnd /* End of SQL text */
146937 const char *zStart, /* Start of SQL text */
146938 const char *zEnd /* End of SQL text */
146981 const char *zDb;
146982 const char *zName;
147041 const char *zDb = db->aDb[iDb].zDbSName;
147042 const char *zTab = SCHEMA_TABLE(iDb);
147066 SQLITE_PRIVATE void sqlite3UnlinkAndDeleteTrigger(sqlite3 *db, int iDb, const char *zName){
147220 char *zName = sqlite3DbStrDup(db, pStep->zTarget);
147478 static const char *onErrorText(int onError){
147680 (const char *)pPrg->pProgram, P4_SUBPROGRAM);
149038 const char *pVTab = (const char*)sqlite3GetVTable(db, pTab);
149356 sCol[0].u.zToken = (char*)pIdx->azColl[ii];
149390 char zWhich[16];
149542 static int execSql(sqlite3 *db, char **pzErrMsg, const char *zSql){
149550 const char *zSubSql = (const char*)sqlite3_column_text(pStmt,0);
149572 static int execSqlF(sqlite3 *db, char **pzErrMsg, const char *zSql, ...){
149573 char *z;
149654 char **pzErrMsg, /* Write error message here */
149672 const char *zDbMain; /* Schema name of database to vacuum */
149673 const char *zOut; /* Name of output file */
149690 zOut = (const char*)sqlite3_value_text(pOut);
149758 char *zKey;
149862 static const unsigned char aCopy[] = {
149977 const char *zName, /* Name assigned to this module */
149984 char *zCopy;
149986 zCopy = (char*)zName;
149995 zCopy = (char *)(&pMod[1]);
150025 const char *zName, /* Name assigned to this module */
150046 const char *zName, /* Name assigned to this module */
150061 const char *zName, /* Name assigned to this module */
150076 SQLITE_API int sqlite3_drop_modules(sqlite3 *db, const char** azNames){
150296 static void addModuleArgument(Parse *pParse, Table *pTable, char *zArg){
150298 char **azModuleArg;
150302 nBytes = sizeof(char *)*(2+pTable->u.vtab.nArg);
150373 const char *z = (const char*)pParse->sArg.z;
150401 char *zStmt;
150402 char *zWhere;
150450 const char *zName = pTab->zName;
150497 int (*xConstruct)(sqlite3*,void*,int,const char*const*,sqlite3_vtab**,char**),
150498 char **pzErr
150503 const char *const*azArg;
150505 char *zErr = 0;
150506 char *zModuleName;
150511 azArg = (const char *const*)pTab->u.vtab.azArg;
150570 const char *zFormat = "vtable constructor did not declare schema: %s";
150586 char *zType = sqlite3ColumnType(&pTab->aCol[iCol], "");
150631 const char *zMod;
150646 const char *zModule = pTab->u.vtab.azArg[0];
150650 char *zErr = 0;
150702 SQLITE_PRIVATE int sqlite3VtabCallCreate(sqlite3 *db, int iDb, const char *zTab, char **pzErr){
150706 const char *zMod;
150743 SQLITE_API int sqlite3_declare_vtab(sqlite3 *db, const char *zCreateTable){
150837 SQLITE_PRIVATE int sqlite3VtabCallDestroy(sqlite3 *db, int iDb, const char *zTab){
150891 x = *(int (**)(sqlite3_vtab *))((char *)p->pModule + offset);
151099 unsigned char x = (unsigned char)pDef->zName[i];
151117 pNew->zName = (const char*)&pNew[1];
151118 memcpy((char*)&pNew[1], pDef->zName, sqlite3Strlen30(pDef->zName)+1);
151168 char *zErr = 0;
151223 static const unsigned char aMap[] = {
151438 char cId; /* Symbolic ID of this loop for debugging use */
151459 char *idxStr; /* Index identifier string */
151626 const char *zCollName; /* Required collating sequence, if not NULL */
151630 char idxaff; /* Must match this affinity, if zCollName!=NULL */
151631 unsigned char iEquiv; /* Current slot in aiCur[] and aiColumn[] */
151632 unsigned char nEquiv; /* Number of entries in aiCur[] and aiColumn[] */
151727 unsigned char bldFlags1; /* First set of SQLITE_BLDF_* flags */
151728 unsigned char bldFlags2; /* Second set of SQLITE_BLDF_* flags */
151954 static const char *explainIndexColumnName(Index *pIdx, int i){
151975 const char *zOp /* Name of the operator */
152022 const char *z = explainIndexColumnName(pIndex, i);
152064 char *zMsg; /* Text to add to EQP output */
152066 char zBuf[100]; /* Initial space for EQP output string */
152080 const char *zFmt = 0;
152105 char cRangeOp;
152108 const char *zRowid = pTab->iPKey>=0 ? pTab->aCol[pTab->iPKey].zCnName:
152111 const char *zRowid = "rowid";
152171 char *zMsg; /* Text to add to EQP output */
152175 char zBuf[100]; /* Initial space for EQP output string */
152190 const char *z = explainIndexColumnName(pLoop->u.btree.pIndex, i);
152219 const char *zObj = 0;
152313 static void codeApplyAffinity(Parse *pParse, int base, int n, char *zAff){
152353 char *zAff /* Affinity string to modify */
152693 char **pzAff /* OUT: Set to point to affinity string */
152704 char *zAff; /* Affinity string to return */
152887 char d2[4];
153041 (const char*)pExpr, P4_EXPR);
153104 sqlite3VdbeChangeP4(v, -1, (char*)ai, P4_INTARRAY);
153222 char *zStartAff;
153656 char *zStartAff; /* Affinity for start of range constraint */
153657 char *zEndAff = 0; /* Affinity for end of range constraint */
154887 if( !sqlite3IsLikeFunction(db, pExpr, pnoCase, (char*)wc) ){
154936 pPrefix = sqlite3Expr(db, TK_STRING, (char*)z);
154939 char *zNew;
155051 unsigned char *peOp2, /* OUT: 0 for MATCH, or else an op2 value */
155057 const char *zOp;
155058 unsigned char eOp2;
155611 char aff1, aff2;
155763 unsigned char eOp2 = 0; /* op2 value for LIKE/REGEXP/GLOB */
156020 const char *zCollSeqName; /* Name of collating sequence */
156036 char c;
157092 const char *zColl = pIdx->azColl[iCol];
157344 char aff;
157391 char *zNotUsed; /* Extra space on the end of pIdx */
157803 const char *zColl; /* The collating sequence name */
158192 SQLITE_PRIVATE char sqlite3IndexColumnAffinity(sqlite3 *db, Index *pIdx, int iCol){
158637 char zType[8];
158638 char zLeft[50];
158702 const char *zName;
158714 char *z;
159274 char aff; /* Comparison affinity */
159275 char idxaff = 0; /* Indexed columns affinity */
160414 SQLITE_API const char *sqlite3_vtab_collation(sqlite3_index_info *pIdxInfo, int iCons){
160416 const char *zRet = 0;
161261 static const char *wherePathName(WherePath *pPath, int nLoop, WhereLoop *pLast){
161262 static char zName[65];
161347 char *pSpace; /* Temporary memory used by this routine */
161392 assert( aSortCost==0 || &pSpace[nSpace]==(char*)&aSortCost[nOrderBy] );
161393 assert( aSortCost!=0 || &pSpace[nSpace]==(char*)pX );
161855 static const char zLabel[] = "0123456789abcdefghijklmnopqrstuvwyxz"
162268 sWLB.pNew = (WhereLoop*)(((char*)pWInfo)+nByteWInfo);
162553 const char *pVTab = (const char *)sqlite3GetVTable(db, pTab);
163674 static const char row_numberName[] = "row_number";
163675 static const char dense_rankName[] = "dense_rank";
163676 static const char rankName[] = "rank";
163677 static const char percent_rankName[] = "percent_rank";
163678 static const char cume_distName[] = "cume_dist";
163679 static const char ntileName[] = "ntile";
163680 static const char last_valueName[] = "last_value";
163681 static const char nth_valueName[] = "nth_value";
163682 static const char first_valueName[] = "first_value";
163683 static const char leadName[] = "lead";
163684 static const char lagName[] = "lag";
163757 static Window *windowFind(Parse *pParse, Window *pList, const char *zName){
163821 const char *zFunc;
164406 const char *zErr = 0;
164602 static const char *azErr[] = {
164867 sqlite3VdbeAddOp4(v, OP_CollSeq, 0,0,0, (const char*)pColl, P4_COLLSEQ);
166403 p->u.zToken = (char*)&p[1];
166653 ** "unsigned char" is used if there are fewer than
166726 const char* yy522;
167694 static char *yyTracePrompt = 0;
167715 SQLITE_PRIVATE void sqlite3ParserTrace(FILE *TraceFILE, char *zTracePrompt){
167726 static const char *const yyTokenName[] = {
168052 static const char *const yyRuleName[] = {
168750 static unsigned char yycoverage[YYNSTATE][YYNTOKEN];
168902 static void yyTraceShift(yyParser *yypParser, int yyNewState, const char *zTag){
169373 static const signed char yyRuleInfoNRhs[] = {
171015 yymsp[-5].minor.yy528->affExpr = (char)yymsp[-3].minor.yy394;
171651 char cDiv = '[';
171739 static const unsigned char aiClass[] = {
171790 # define charMap(X) sqlite3UpperToLower[(unsigned char)X]
171793 # define charMap(X) ebcdicToAscii[(unsigned char)X]
171794 const unsigned char ebcdicToAscii[] = {
171855 static const char zKWText[666] = {
171895 static const unsigned char aKWHash[127] = {
171910 static const unsigned char aKWNext[147] = {
171925 static const unsigned char aKWLen[147] = {
171956 static const unsigned char aKWCode[147] = {
172120 static int keywordCode(const char *z, int n, int *pType){
172122 const char *zKW;
172294 SQLITE_PRIVATE int sqlite3KeywordCode(const unsigned char *z, int n){
172296 keywordCode((char*)z, n, &id);
172300 SQLITE_API int sqlite3_keyword_name(int i,const char **pzName,int *pnName){
172307 SQLITE_API int sqlite3_keyword_check(const char *zName, int nName){
172332 #define IdChar(C) ((sqlite3CtypeMap[(unsigned char)C]&0x46)!=0)
172335 SQLITE_PRIVATE const char sqlite3IsEbcdicIdChar[] = {
172361 static int getToken(const unsigned char **pz){
172362 const unsigned char *z = *pz;
172410 static int analyzeWindowKeyword(const unsigned char *z){
172418 static int analyzeOverKeyword(const unsigned char *z, int lastToken){
172425 static int analyzeFilterKeyword(const unsigned char *z, int lastToken){
172437 SQLITE_PRIVATE int sqlite3GetToken(const unsigned char *z, int *tokenType){
172681 return keywordCode((char*)z, i, tokenType);
172731 SQLITE_PRIVATE int sqlite3RunParser(Parse *pParse, const char *zSql){
172901 SQLITE_PRIVATE char *sqlite3Normalize(
172903 const char *zSql /* The original SQL string */
172925 n = sqlite3GetToken((unsigned char*)zSql+i, &tokenType);
172970 char *zId = sqlite3DbStrNDup(db, zSql+i, n);
173047 #define IdChar(C) ((sqlite3CtypeMap[(unsigned char)C]&0x46)!=0)
173050 SQLITE_PRIVATE const char sqlite3IsEbcdicIdChar[];
173124 SQLITE_API int sqlite3_complete(const char *zSql){
173219 unsigned char c;
173291 char const *zSql8;
173509 SQLITE_API const char sqlite3_version[] = SQLITE_VERSION;
173515 SQLITE_API const char *sqlite3_libversion(void){ return sqlite3_version; }
173523 /* SQLITE_API const char *sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; } */
173555 SQLITE_API void (SQLITE_CDECL *sqlite3IoTrace)(const char*, ...) = 0;
173565 SQLITE_API char *sqlite3_temp_directory = 0;
173574 SQLITE_API char *sqlite3_data_directory = 0;
173624 assert( SQLITE_PTRSIZE==sizeof(char*) );
173766 int SQLITE_EXTRA_INIT(const char*);
174031 ** sqlite3GlobalConfig.xLog = va_arg(ap, void(*)(void*,int,const char*));
174033 typedef void(*LOGFUNC_t)(void*,int,const char*);
174064 typedef void(*SQLLOGFUNC_t)(void*, sqlite3*, const char*, int);
174331 db->aDb[0].zDbSName = va_arg(ap,char*);
174480 (const char *)pKey1, (const char *)pKey2, (nKey1<nKey2)?nKey1:nKey2);
174686 SQLITE_API int sqlite3_txn_state(sqlite3 *db, const char *zSchema){
174906 SQLITE_PRIVATE const char *sqlite3ErrName(int rc){
174907 const char *zName = 0;
175005 static char zBuf[50];
175017 SQLITE_PRIVATE const char *sqlite3ErrStr(int rc){
175018 static const char* const aMsg[] = {
175053 const char *zErr = "unknown error";
175245 const char *zFunctionName,
175379 const char *zFunc,
175430 const char *zFunc,
175443 const char *zFunc,
175457 const char *zFunc,
175483 char *zFunc8;
175513 const char *zName = (const char*)sqlite3_user_data(context);
175514 char *zErr;
175536 const char *zName,
175540 char *zCopy;
175567 SQLITE_API void *sqlite3_trace(sqlite3 *db, void(*xTrace)(void*,const char*), void *pArg){
175620 void (*xProfile)(void*,const char*,sqlite_uint64),
175675 void (*xCallback)(void*,int,char const *,char const *,sqlite_int64),
175727 void*,sqlite3*,int,char const*,char const*,sqlite3_int64,sqlite3_int64),
175746 unsigned int (*xCallback)(void*,const char*,u32,u32,u32),
175778 const char *zDb, /* Database */
175824 int(*xCallback)(void *, sqlite3*, const char*, int),
175851 const char *zDb, /* Name of attached database (or NULL) */
175913 SQLITE_API int sqlite3_wal_checkpoint(sqlite3 *db, const char *zDb){
176007 SQLITE_API const char *sqlite3_errmsg(sqlite3 *db){
176008 const char *z;
176020 z = db->errCode ? (char*)sqlite3_value_text(db->pErr) : 0;
176117 SQLITE_API const char *sqlite3_errstr(int rc){
176127 const char *zName,
176338 const char *zDefaultVfs, /* VFS to use if no "vfs=xxx" query option */
176339 const char *zUri, /* Nul-terminated URI to parse */
176342 char **pzFile, /* OUT: Filename component of URI */
176343 char **pzErrMsg /* OUT: Error message (if rc!=SQLITE_OK) */
176347 const char *zVfs = zDefaultVfs;
176348 char *zFile;
176349 char c;
176358 char *zOpt;
176473 char *zVal = &zOpt[nOpt+1];
176480 const char *z;
176483 char *zModeType = 0;
176519 const char *z = aMode[i].z;
176574 static const char *uriParameter(const char *zFilename, const char *zParam){
176593 const char *zDb, /* Which schema is being created/attached */
176594 const char *zUri /* URI filename */
176596 const char *zKey;
176602 char zDecoded[40];
176628 const char *zFilename, /* Database filename UTF-8 encoded */
176631 const char *zVfs /* Name of the VFS to use */
176636 char *zOpen = 0; /* Filename argument to pass to BtreeOpen() */
176637 char *zErrMsg = 0; /* Error message from sqlite3ParseUri() */
176991 const char *zFilename,
176998 const char *filename, /* Database filename (UTF-8) */
177001 const char *zVfs /* Name of VFS module to use */
177014 char const *zFilename8; /* zFilename encoded in UTF-8 instead of UTF-16 */
177051 const char *zName,
177064 const char *zName,
177095 char *zName8;
177120 void(*xCollNeeded)(void*,sqlite3*,int eTextRep,const char*)
177192 SQLITE_PRIVATE int sqlite3ReportError(int iErr, int lineno, const char *zType){
177211 char zMsg[100];
177246 const char *zDbName, /* Database name or NULL */
177247 const char *zTableName, /* Table name */
177248 const char *zColumnName, /* Column name */
177249 char const **pzDataType, /* OUTPUT: Declared data type */
177250 char const **pzCollSeq, /* OUTPUT: Collation sequence name */
177256 char *zErrMsg = 0;
177260 char const *zDataType = 0;
177261 char const *zCollSeq = 0;
177391 SQLITE_API int sqlite3_file_control(sqlite3 *db, const char *zDbName, int op, void *pArg){
177772 unsigned char,unsigned char);
177816 iDb = sqlite3FindDbName(db, va_arg(ap,const char*));
177964 static const char *databaseName(const char *zName){
177975 static char *appendText(char *p, const char *z){
177990 SQLITE_API const char *sqlite3_create_filename(
177991 const char *zDatabase,
177992 const char *zJournal,
177993 const char *zWal,
177995 const char **azParam
177999 char *pResult, *p;
178026 SQLITE_API void sqlite3_free_filename(const char *p){
178029 sqlite3_free((char*)p - 4);
178044 SQLITE_API const char *sqlite3_uri_parameter(const char *zFilename, const char *zParam){
178053 SQLITE_API const char *sqlite3_uri_key(const char *zFilename, int N){
178067 SQLITE_API int sqlite3_uri_boolean(const char *zFilename, const char *zParam, int bDflt){
178068 const char *z = sqlite3_uri_parameter(zFilename, zParam);
178077 const char *zFilename, /* Filename as passed to xOpen */
178078 const char *zParam, /* URI parameter sought */
178081 const char *z = sqlite3_uri_parameter(zFilename, zParam);
178099 SQLITE_API const char *sqlite3_filename_database(const char *zFilename){
178103 SQLITE_API const char *sqlite3_filename_journal(const char *zFilename){
178113 SQLITE_API const char *sqlite3_filename_wal(const char *zFilename){
178126 SQLITE_PRIVATE Btree *sqlite3DbNameToBtree(sqlite3 *db, const char *zDbName){
178135 SQLITE_API const char *sqlite3_db_name(sqlite3 *db, int N){
178153 SQLITE_API const char *sqlite3_db_filename(sqlite3 *db, const char *zDbName){
178169 SQLITE_API int sqlite3_db_readonly(sqlite3 *db, const char *zDbName){
178188 const char *zDb,
178224 const char *zDb,
178278 SQLITE_API int sqlite3_snapshot_recover(sqlite3 *db, const char *zDb){
178322 SQLITE_API int sqlite3_compileoption_used(const char *zOptName){
178325 const char **azCompileOpt;
178343 && sqlite3IsIdChar((unsigned char)azCompileOpt[i][n])==0
178355 SQLITE_API const char *sqlite3_compileoption_get(int N){
178357 const char **azCompileOpt;
178827 ** char pTerm[nTerm]; (content of first term)
178829 ** char pDoclist[nDoclist]; (content of doclist)
178834 ** char pTermSuffix[nSuffix];(unshared suffix of next term)
178836 ** char pDoclist[nDoclist]; (content of doclist)
178875 ** char pTerm[nTerm]; (content of first term)
178880 ** char pTermSuffix[nSuffix]; (unshared suffix of next term)
179118 const char *const*argv, /* Tokenizer argument strings */
179135 const char *pInput, int nBytes, /* Input buffer */
179171 const char **ppToken, int *pnBytes, /* OUT: Normalized text for token */
179239 char keyClass; /* HASH_INT, _POINTER, _STRING, _BINARY */
179240 char copyKey; /* True if copy of key made on insert */
179280 SQLITE_PRIVATE void sqlite3Fts3HashInit(Fts3Hash *pNew, char keyClass, char copyKey);
179446 typedef unsigned char u8; /* 1-byte (or larger) unsigned integer */
179513 const char *zDb; /* logical database name */
179514 const char *zName; /* virtual table name */
179516 char **azColumn; /* column names. malloced */
179519 char *zContentTbl; /* content=xxx option, or NULL */
179520 char *zLanguageid; /* languageid=xxx option, or NULL */
179531 char *zReadExprlist;
179532 char *zWriteExprlist;
179541 char *zSegmentsTbl; /* Name of %_segments table */
179616 char *pNextId; /* Pointer into the body of aDoclist */
179617 char *aDoclist; /* List of docids for full-text queries */
179663 char *aAll; /* Array containing doclist (or NULL) */
179665 char *pNextDocid; /* Pointer to next docid */
179669 char *pList; /* Pointer to position list following iDocid */
179680 char *z; /* Text of the token */
179700 char *pOrPoslist;
179775 sqlite3_int64, sqlite3_int64, const char *, int, Fts3SegReader**);
179777 Fts3Table*,int,const char*,int,int,Fts3SegReader**);
179780 SQLITE_PRIVATE int sqlite3Fts3ReadBlock(Fts3Table*, sqlite3_int64, char **, int*, int*);
179790 SQLITE_PRIVATE int sqlite3Fts3DeferredTokenList(Fts3DeferredToken *, char **, int *);
179811 int, int, int, const char *, int, int, int, Fts3MultiSegReader *);
179823 const char *zTerm;
179835 char *aBuffer; /* Buffer to merge doclists in */
179846 char *zTerm; /* Pointer to term buffer */
179848 char *aDoclist; /* Pointer to doclist buffer */
179859 SQLITE_PRIVATE void sqlite3Fts3ErrMsg(char**,const char*,...);
179860 SQLITE_PRIVATE int sqlite3Fts3PutVarint(char *, sqlite3_int64);
179861 SQLITE_PRIVATE int sqlite3Fts3GetVarint(const char *, sqlite_int64 *);
179862 SQLITE_PRIVATE int sqlite3Fts3GetVarintU(const char *, sqlite_uint64 *);
179863 SQLITE_PRIVATE int sqlite3Fts3GetVarintBounded(const char*,const char*,sqlite3_int64*);
179864 SQLITE_PRIVATE int sqlite3Fts3GetVarint32(const char *, int *);
179866 SQLITE_PRIVATE void sqlite3Fts3Dequote(char *);
179867 SQLITE_PRIVATE void sqlite3Fts3DoclistPrev(int,char*,int,char**,sqlite3_int64*,int*,u8*);
179869 SQLITE_PRIVATE int sqlite3Fts3FirstFilter(sqlite3_int64, char *, int, char *);
179872 SQLITE_PRIVATE int sqlite3Fts3ReadInt(const char *z, int *pnOut);
179875 SQLITE_PRIVATE const char *sqlite3Fts3NextToken(const char *, int *);
179876 SQLITE_PRIVATE int sqlite3Fts3InitHashTable(sqlite3 *, Fts3Hash *, const char *);
179877 SQLITE_PRIVATE int sqlite3Fts3InitTokenizer(Fts3Hash *pHash, const char *,
179878 sqlite3_tokenizer **, char **
179880 SQLITE_PRIVATE int sqlite3Fts3IsIdChar(char);
179884 SQLITE_PRIVATE void sqlite3Fts3Snippet(sqlite3_context *, Fts3Cursor *, const char *,
179885 const char *, const char *, int, int
179887 SQLITE_PRIVATE void sqlite3Fts3Matchinfo(sqlite3_context *, Fts3Cursor *, const char *);
179892 char **, int, int, int, const char *, int, Fts3Expr **, char **
179901 SQLITE_PRIVATE int sqlite3Fts3OpenTokenizer(sqlite3_tokenizer *, int, const char *, int,
179911 Fts3Table*, Fts3MultiSegReader*, int, const char*, int);
179913 Fts3Table *, Fts3MultiSegReader *, sqlite3_int64 *, char **, int *);
179914 SQLITE_PRIVATE int sqlite3Fts3EvalPhrasePoslist(Fts3Cursor *, Fts3Expr *, int iCol, char **);
179961 Fts3Cursor *, const char *, int, int, Fts3MultiSegReader **);
179978 SQLITE_PRIVATE int sqlite3Fts3PutVarint(char *p, sqlite_int64 v){
179979 unsigned char *q = (unsigned char *) p;
179982 *q++ = (unsigned char) ((vu & 0x7f) | 0x80);
179986 assert( q - (unsigned char *)p <= FTS3_VARINT_MAX );
179987 return (int) (q - (unsigned char *)p);
179991 v = (v & mask1) | ( (*(const unsigned char*)(ptr++)) << shift ); \
179997 SQLITE_PRIVATE int sqlite3Fts3GetVarintU(const char *pBuf, sqlite_uint64 *v){
179998 const unsigned char *p = (const unsigned char*)pBuf;
179999 const unsigned char *pStart = p;
180024 SQLITE_PRIVATE int sqlite3Fts3GetVarint(const char *pBuf, sqlite_int64 *v){
180035 const char *pBuf,
180036 const char *pEnd,
180039 const unsigned char *p = (const unsigned char*)pBuf;
180040 const unsigned char *pStart = p;
180041 const unsigned char *pX = (const unsigned char*)pEnd;
180058 SQLITE_PRIVATE int sqlite3Fts3GetVarint32(const char *p, int *pi){
180059 const unsigned char *ptr = (const unsigned char*)p;
180105 SQLITE_PRIVATE void sqlite3Fts3Dequote(char *z){
180106 char quote; /* Quote character (if any ) */
180134 static void fts3GetDeltaVarint(char **pp, sqlite3_int64 *pVal){
180150 char **pp,
180151 char *pStart,
180155 char *p;
180199 SQLITE_PRIVATE void sqlite3Fts3ErrMsg(char **pzErr, const char *zFormat, ...){
180217 const char *zFormat, /* Format string for SQL */
180221 char *zSql;
180240 const char *zDb = p->zDb; /* Name of database (e.g. "main", "temp") */
180278 char *zSql; /* SQL statement passed to declare_vtab() */
180279 char *zCols; /* List of user defined columns */
180280 const char *zLanguageid;
180335 const char *zLanguageid = p->zLanguageid;
180336 char *zContentCols; /* Columns of %_content table */
180341 char *z = p->azColumn[i];
180397 char *zSql; /* SQL text "PRAGMA %Q.page_size" */
180429 const char *z,
180431 char **pzValue
180433 char *zValue;
180434 const char *zCsr = z;
180455 char **pz, /* IN/OUT: Pointer to string buffer */
180456 const char *zFormat, /* Printf format string to append */
180461 char *z;
180466 char *z2 = sqlite3_mprintf("%s%s", *pz, z);
180486 static char *fts3QuoteId(char const *zInput){
180488 char *zRet;
180493 char *z = zRet;
180528 static char *fts3ReadExprList(Fts3Table *p, const char *zFunc, int *pRc){
180529 char *zRet = 0;
180530 char *zFree = 0;
180531 char *zFunction;
180585 static char *fts3WriteExprList(Fts3Table *p, const char *zFunc, int *pRc){
180586 char *zRet = 0;
180587 char *zFree = 0;
180588 char *zFunction;
180612 SQLITE_PRIVATE int sqlite3Fts3ReadInt(const char *z, int *pnOut){
180636 static int fts3GobbleInt(const char **pp, int *pnOut){
180670 const char *zParam, /* ABC in prefix=ABC parameter to parse */
180678 const char *p;
180693 const char *p = zParam;
180740 const char *zDb, /* Name of db (i.e. "main", "temp" etc.) */
180741 const char *zTbl, /* Name of content table */
180742 const char ***pazCol, /* OUT: Malloc'd array of column names */
180745 char **pzErr /* OUT: error message */
180748 char *zSql; /* "SELECT *" statement on zTbl */
180763 const char **azCol; /* Output array */
180773 const char *zCol = sqlite3_column_name(pStmt, i);
180778 azCol = (const char **)sqlite3_malloc64(sizeof(char *) * nCol + nStr);
180782 char *p = (char *)&azCol[nCol];
180784 const char *zCol = sqlite3_column_name(pStmt, i);
180818 const char * const *argv, /* xCreate/xConnect argument array */
180820 char **pzErr /* Write any error message here */
180830 char *zCsr; /* Space for holding column names */
180834 const char **aCol; /* Array of column names */
180843 char *zPrefix = 0; /* Prefix parameter value (or NULL) */
180844 char *zCompress = 0; /* compress=? parameter (or NULL) */
180845 char *zUncompress = 0; /* uncompress=? parameter (or NULL) */
180846 char *zContent = 0; /* content=? parameter (or NULL) */
180847 char *zLanguageid = 0; /* languageid=? parameter (or NULL) */
180848 char **azNotindexed = 0; /* The set of notindexed= columns */
180859 nByte = sizeof(const char *) * (argc-2);
180860 aCol = (const char **)sqlite3_malloc64(nByte);
180863 azNotindexed = (char **)sqlite3_malloc64(nByte);
180885 char const *z = argv[i];
180887 char *zVal;
180901 const char *zOpt;
181052 nCol * sizeof(char *) + /* azColumn */
181067 p->azColumn = (char **)&p[1];
181091 zCsr = (char *)&p->abNotindexed[nCol];
181101 char *z;
181103 z = (char *)sqlite3Fts3NextToken(aCol[iCol], &n);
181111 assert( zCsr <= &((char *)p)[nByte] );
181118 char *zNot = azNotindexed[i];
181136 char const *zMiss = (zCompress==0 ? "compress" : "uncompress");
181201 const char * const *argv, /* xCreate/xConnect argument array */
181203 char **pzErr /* OUT: sqlite3_malloc'd error message */
181211 const char * const *argv, /* xCreate/xConnect argument array */
181213 char **pzErr /* OUT: sqlite3_malloc'd error message */
181457 char *zSql;
181529 const char *zTerm, /* Term to select leaves for */
181531 const char *zNode, /* Buffer containing segment interior node */
181537 const char *zCsr = zNode; /* Cursor to iterate through node */
181538 const char *zEnd = &zCsr[nNode];/* End of interior node buffer */
181539 char *zBuffer = 0; /* Buffer to load terms into */
181587 char *zNew;
181589 zNew = (char *)sqlite3_realloc64(zBuffer, nAlloc);
181656 const char *zTerm, /* Term to select leaves for */
181658 const char *zNode, /* Buffer containing segment interior node */
181673 char *zBlob = 0; /* Blob read from %_segments table */
181709 char **pp, /* IN/OUT: Output pointer */
181732 static void fts3PoslistCopy(char **pp, char **ppPoslist){
181733 char *pEnd = *ppPoslist;
181734 char c = 0;
181754 char *p = *pp;
181779 static void fts3ColumnlistCopy(char **pp, char **ppPoslist){
181780 char *pEnd = *ppPoslist;
181781 char c = 0;
181792 char *p = *pp;
181826 char **pp, /* IN/OUT: Pointer into position-list buffer */
181848 static int fts3PutColNumber(char **pp, int iCol){
181851 char *p = *pp; /* Output pointer */
181867 char **pp, /* Output buffer */
181868 char **pp1, /* Left input list */
181869 char **pp2 /* Right input list */
181871 char *p = *pp;
181872 char *p1 = *pp1;
181873 char *p2 = *pp2;
181967 char **pp, /* IN/OUT: Preallocated output buffer */
181971 char **pp1, /* IN/OUT: Left input list */
181972 char **pp2 /* IN/OUT: Right input list */
181974 char *p = *pp;
181975 char *p1 = *pp1;
181976 char *p2 = *pp2;
181995 char *pSave = p;
182090 char **pp, /* Output buffer */
182091 char *aTmp, /* Temporary buffer space */
182094 char **pp1, /* IN/OUT: Left input list */
182095 char **pp2 /* IN/OUT: Right input list */
182097 char *p1 = *pp1;
182098 char *p2 = *pp2;
182100 char *pTmp1 = aTmp;
182101 char *pTmp2;
182102 char *aTmp2;
182130 char *aaOutput[16]; /* Malloc'd output buffers */
182148 char **pp, /* IN/OUT: Point to read varint from */
182149 char *pEnd, /* End of buffer */
182182 char **pp, /* IN/OUT: Output pointer */
182232 char *a1, int n1, /* First doclist */
182233 char *a2, int n2, /* Second doclist */
182234 char **paOut, int *pnOut /* OUT: Malloc'd doclist */
182240 char *pEnd1 = &a1[n1];
182241 char *pEnd2 = &a2[n2];
182242 char *p1 = a1;
182243 char *p2 = a2;
182244 char *p;
182245 char *aOut;
182335 char *aLeft, int nLeft, /* Left doclist */
182336 char **paRight, int *pnRight /* IN/OUT: Right/output doclist */
182341 char *aRight = *paRight;
182342 char *pEnd1 = &aLeft[nLeft];
182343 char *pEnd2 = &aRight[*pnRight];
182344 char *p1 = aLeft;
182345 char *p2 = aRight;
182346 char *p;
182348 char *aOut;
182365 char *pSave = p;
182405 char *pList, /* Position list (no 0x00 term) */
182407 char *pOut /* Write output here */
182411 char *p = pList;
182412 char *pEnd = &pList[nList];
182456 char *aOut = 0;
182471 char *aNew;
182512 char *aDoclist, /* Pointer to doclist */
182541 char *aMerge = aDoclist;
182552 char *aNew;
182612 const char *zTerm, /* Term to query for */
182649 char const *zRoot = sqlite3_column_blob(pStmt, 4);
182686 const char *zTerm, /* Term to query for */
182716 const char *zTerm, /* Term to scan doclist of */
182740 const char *zTerm, /* Term to query for */
182809 char **ppOut /* OUT: Malloced result buffer */
182861 static int fts3DoclistCountDocids(char *aList, int nList){
182864 char *aEnd = &aList[nList]; /* Pointer to one byte after EOF */
182865 char *p = aList; /* Cursor */
182942 const char *idxStr, /* Unused */
182947 char *zSql; /* SQL statement used to access %_content */
182993 const char *zQuery = (const char *)sqlite3_value_text(pCons);
183214 char *zTbl = sqlite3_mprintf("%s_stat", p->zName);
183282 static void fts3ReversePoslist(char *pStart, char **ppPoslist){
183283 char *p = &(*ppPoslist)[-2];
183284 char c = 0;
183327 const char *zFunc, /* Function name */
183336 char *zErr = sqlite3_mprintf("illegal first argument to %s", zFunc);
183353 const char *zStart = "<b>";
183354 const char *zEnd = "</b>";
183355 const char *zEllipsis = "<b>...</b>";
183376 case 4: zEllipsis = (const char*)sqlite3_value_text(apVal[3]);
183378 case 3: zEnd = (const char*)sqlite3_value_text(apVal[2]);
183380 case 2: zStart = (const char*)sqlite3_value_text(apVal[1]);
183462 const char *zArg = 0;
183464 zArg = (const char *)sqlite3_value_text(apVal[1]);
183477 const char *zName, /* Name of SQL function */
183482 const char *zName;
183512 const char *zName /* New name of table */
183613 static int fts3ShadowName(const char *zName){
183614 static const char *azName[] = {
183850 char *pList, /* Pointer to doclist */
183872 char *pLeft;
183873 char *pRight;
183924 char *pThis = 0;
183949 char *aPoslist = 0; /* Position list for deferred tokens */
183952 char *aFree = (pPhrase->doclist.bFreeList ? pPhrase->doclist.pList : 0);
183959 char *pList;
183976 char *aOut = pList;
183977 char *p1 = aPoslist;
183978 char *p2 = aOut;
184006 char *p1;
184007 char *p2;
184008 char *aOut;
184020 aOut = (char *)sqlite3Fts3MallocZero(nPoslist+FTS3_BUFFER_PADDING);
184122 char *aDoclist, /* Pointer to entire doclist */
184124 char **ppIter, /* IN/OUT: Iterator pointer */
184129 char *p = *ppIter;
184138 char *pNext = 0;
184139 char *pDocid = aDoclist;
184140 char *pEnd = &aDoclist[nDoclist];
184165 char *pSave = p;
184178 char *aDoclist, /* Pointer to entire doclist */
184180 char **ppIter, /* IN/OUT: Iterator pointer */
184184 char *p = *ppIter;
184218 char *pIter; /* Used to iterate through aAll */
184219 char *pEnd; /* 1 byte past end of aAll */
184264 char *pList;
184389 char *aDoclist = sqlite3_malloc64((i64)nByte+FTS3_BUFFER_PADDING);
184396 char *pL = a[i].pList;
184397 char *pR = aDoclist;
184398 char *pOut = aDoclist;
184594 const char *pEnd;
184595 const char *a;
184735 char *pList = 0;
184852 char *aTmp, /* Temporary space to use */
184853 char **paPoslist, /* IN/OUT: Position list */
184860 char *p2;
184861 char *pOut;
185098 char *aTmp; /* Temp space for PoslistNearMerge() */
185111 char *aPoslist = p->pPhrase->doclist.pList;
185383 char *p = pPhrase->doclist.pList;
185584 char **ppOut /* OUT: Pointer to position list */
185588 char *pIter;
185749 char **pzErrMsg,
185792 char *zStop;
185821 const char * const *argv, /* xCreate/xConnect argument array */
185823 char **pzErr /* OUT: sqlite3_malloc'd error message */
185825 char const *zDb; /* Name of database (e.g. "main") */
185826 char const *zFts3; /* Name of fts3 table */
185866 p->pFts3Tab->zDb = (char *)&p->pFts3Tab[1];
185871 memcpy((char *)p->pFts3Tab->zDb, zDb, nDb);
185872 memcpy((char *)p->pFts3Tab->zName, zFts3, nFts3);
185873 sqlite3Fts3Dequote((char *)p->pFts3Tab->zName);
186043 char *aDoclist = pCsr->csr.aDoclist;
186128 const char *idxStr, /* Unused */
186180 const unsigned char *zStr = sqlite3_value_text(apVal[0]);
186415 const char **azCol; /* Array of column names for fts3 table */
186429 ** an integer that falls outside of the range of the unsigned char type
186431 ** is defined to accept an argument of type char, and always returns 0 for
186432 ** any values that fall outside of the range of the unsigned char type (i.e.
186435 static int fts3isspace(char c){
186453 const char *z,
186481 static int fts3ExprParse(ParseContext *, const char *, int, Fts3Expr **, int *);
186498 const char *z, int n, /* Input string */
186518 const char *zToken;
186534 pRet->pPhrase->aToken[0].z = (char *)&pRet->pPhrase[1];
186596 const char *zInput, int nInput, /* Input string */
186604 char *zTemp = 0;
186634 const char *zByte;
186666 char *zBuf = 0;
186670 memset(p, 0, (char *)&(((Fts3Phrase *)&p[1])->aToken[0])-(char *)p);
186676 zBuf = (char *)&p->pPhrase->aToken[nToken];
186714 const char *z, int n, /* Input string */
186719 char *z; /* Keyword text */
186720 unsigned char n; /* Length of the keyword */
186721 unsigned char parenOnly; /* Only valid in paren mode */
186722 unsigned char eType; /* Keyword code */
186735 const char *zInput = z;
186762 char cNext;
186845 const char *zStr = pParse->azCol[ii];
186933 const char *z, int n, /* Text of MATCH query */
186941 const char *zIn = z;
187283 char **azCol, /* Array of column names for fts3 table */
187287 const char *z, int n, /* Text of MATCH query */
187297 sParse.azCol = (const char **)azCol;
187346 char **azCol, /* Array of column names for fts3 table */
187350 const char *z, int n, /* Text of MATCH query */
187352 char **pzErr /* OUT: Error message (sqlite3_malloc) */
187441 static char *exprToString(Fts3Expr *pExpr, char *zBuf){
187506 char **azCol = 0;
187507 const char *zExpr;
187512 char *zBuf = 0;
187514 const char *zTokenizer = 0;
187515 char *zErr = 0;
187524 zTokenizer = (const char*)sqlite3_value_text(argv[0]);
187536 zExpr = (const char *)sqlite3_value_text(argv[1]);
187539 azCol = (char **)sqlite3_malloc64(nCol*sizeof(char *));
187545 azCol[ii] = (char *)sqlite3_value_text(argv[ii+2]);
187549 char *zDummy = 0;
187674 SQLITE_PRIVATE void sqlite3Fts3HashInit(Fts3Hash *pNew, char keyClass, char copyKey){
187713 const char *z = (const char *)pKey;
187724 return strncmp((const char*)pKey1,(const char*)pKey2,n1);
187732 const char *z = (const char *)pKey;
188048 const char *zInput; /* input we are tokenizing */
188052 char *zToken; /* storage for current token */
188061 int argc, const char * const *argv,
188092 const char *zInput, int nInput, /* String to be tokenized */
188132 static const char cType[] = {
188150 static int isVowel(const char*);
188151 static int isConsonant(const char *z){
188153 char x = *z;
188160 static int isVowel(const char *z){
188162 char x = *z;
188189 static int m_gt_0(const char *z){
188199 static int m_eq_1(const char *z){
188213 static int m_gt_1(const char *z){
188227 static int hasVowel(const char *z){
188238 static int doubleConsonant(const char *z){
188250 static int star_oh(const char *z){
188271 char **pz, /* The word being stemmed (Reversed) */
188272 const char *zFrom, /* If the ending matches this... (Reversed) */
188273 const char *zTo, /* ... change the ending to this (not reversed) */
188274 int (*xCond)(const char*) /* Condition that must be true */
188276 char *z = *pz;
188295 static void copy_stemmer(const char *zIn, int nIn, char *zOut, int *pnOut){
188299 char c = zIn[i];
188342 static void porter_stemmer(const char *zIn, int nIn, char *zOut, int *pnOut){
188344 char zReverse[28];
188345 char *z, *z2;
188353 char c = zIn[i];
188581 static const char porterIdChar[] = {
188597 const char **pzToken, /* OUT: *pzToken is the token text */
188604 const char *z = c->zInput;
188623 char *pNew;
188737 const unsigned char *zName;
188769 char *zErr = sqlite3_mprintf("unknown tokenizer: %s", zName);
188780 SQLITE_PRIVATE int sqlite3Fts3IsIdChar(char c){
188781 static const char isFtsIdChar[] = {
188794 SQLITE_PRIVATE const char *sqlite3Fts3NextToken(const char *zStr, int *pn){
188795 const char *z1;
188796 const char *z2 = 0;
188801 char c = *z1;
188833 const char *zArg, /* Tokenizer name */
188835 char **pzErr /* OUT: Set to malloced error message */
188838 char *z = (char *)zArg;
188840 char *zCopy;
188841 char *zEnd; /* Pointer to nul-term of zCopy */
188848 z = (char *)sqlite3Fts3NextToken(zCopy, &n);
188861 char const **aArg = 0;
188864 while( z<zEnd && (NULL!=(z = (char *)sqlite3Fts3NextToken(z, &n))) ){
188865 sqlite3_int64 nNew = sizeof(char *)*(iArg+1);
188866 char const **aNew = (const char **)sqlite3_realloc64((void *)aArg, nNew);
188937 const char *zErr = 0;
188939 const char *zName;
188941 const char *zInput;
188944 const char *azArg[64];
188946 const char *zToken;
188961 zName = (const char *)sqlite3_value_text(argv[0]);
188963 zInput = (const char *)sqlite3_value_text(argv[argc-1]);
188969 char *zErr2 = sqlite3_mprintf("unknown tokenizer: %s", zName);
188979 azArg[i-1] = (const char *)sqlite3_value_text(argv[i]);
189021 char *zName,
189026 const char zSql[] = "SELECT fts3_tokenizer(?, ?)";
189044 char *zName,
189049 const char zSql[] = "SELECT fts3_tokenizer(?)";
189146 const char *zName
189153 char *zTest = 0;
189154 char *zTest2 = 0;
189226 char delim[128]; /* flag ASCII delimiters */
189231 const char *pInput; /* input we are tokenizing */
189235 char *pToken; /* storage for current token */
189240 static int simpleDelim(simple_tokenizer *t, unsigned char c){
189251 int argc, const char * const *argv,
189268 unsigned char ch = argv[1][i];
189304 const char *pInput, int nBytes, /* String to be tokenized */
189348 const char **ppToken, /* OUT: *ppToken is the token text */
189356 unsigned char *p = (unsigned char *)c->pInput;
189375 char *pNew;
189385 unsigned char ch = p[iStartOffset+i];
189386 c->pToken[i] = (char)((ch>='A' && ch<='Z') ? ch-'A'+'a' : ch);
189490 char *zInput; /* Input string */
189493 const char *zToken; /* Current 'token' value */
189505 const char *zName,
189507 char **pzErr
189536 const char * const *argv, /* Input array */
189537 char ***pazDequote /* Output array */
189545 char **azDequote;
189551 *pazDequote = azDequote = sqlite3_malloc64(sizeof(char *)*argc + nByte);
189555 char *pSpace = (char *)&azDequote[argc];
189588 const char * const *argv, /* xCreate/xConnect argument array */
189590 char **pzErr /* OUT: sqlite3_malloc'd error message */
189596 char **azDequote = 0;
189606 const char *zModule;
189617 const char * const *azArg = 0;
189618 if( nDequote>1 ) azArg = (const char * const *)&azDequote[1];
189762 const char *idxStr, /* Unused */
189774 const char *zByte = (const char *)sqlite3_value_text(apVal[0]);
189989 char *aData;
190034 char *aNode; /* Pointer to node data (or NULL) */
190047 char *zTerm; /* Pointer to current term */
190049 char *aDoclist; /* Pointer to doclist of current entry */
190055 char *pOffsetList;
190076 char *zTerm; /* Pointer to previous term buffer */
190079 char *zMalloc; /* Malloc'd space (possibly) used for zTerm */
190082 char *aData; /* Pointer to block from malloc() */
190109 char *zTerm; /* Pointer to previous term buffer */
190112 char *zMalloc; /* Malloc'd space (possibly) used for zTerm */
190114 char *aData; /* Node data */
190180 const char *azSql[] = {
190289 char *zSql;
190544 p->aData = (char *)&p[1];
190556 p->aData = (char *)&p[1];
190642 const char *zToken,
190678 const char *zText, /* Text of document to be inserted */
190688 char const *zToken;
190695 const char**,int*,int*,int*,int*);
190817 const char *zText = (const char *)sqlite3_value_text(apVal[i]);
190973 const char *zText = (const char *)sqlite3_column_text(pSelect, i);
191087 char **paBlob, /* OUT: Blob data in malloc'd buffer */
191112 char *aByte = sqlite3_malloc64((i64)nByte + FTS3_NODE_PADDING);
191169 static int fts3SegReaderRequire(Fts3SegReader *pReader, char *pFrom, int nByte){
191205 char *pNext; /* Cursor variable */
191222 char *aCopy;
191229 pReader->zTerm = (char*)sqlite3_malloc64(((i64)nTerm+1)*2);
191237 aCopy = (char*)sqlite3_malloc64(nCopy);
191293 char *zNew = sqlite3_realloc64(pReader->zTerm, nNew);
191363 char **ppOffsetList, /* OUT: Pointer to current position-list */
191367 char *p = pReader->pOffsetList;
191368 char c = 0;
191391 char *pEnd = &pReader->aDoclist[pReader->nDoclist];
191507 const char *zRoot, /* Buffer containing root node */
191537 pReader->aNode = (char *)&pReader[1];
191558 char *z1 = fts3HashKey(*(Fts3HashElem **)lhs);
191559 char *z2 = fts3HashKey(*(Fts3HashElem **)rhs);
191593 const char *zTerm, /* Term to search for */
191610 char *zKey = (char *)fts3HashKey(pE);
191755 const char *zTerm, /* Term to compare to */
191814 char *z, /* Pointer to buffer containing block data */
191861 char *zRoot, /* Blob value for "root" field */
191874 char *zEnd = sqlite3_mprintf("%lld %lld", iEndBlock, nLeafData);
191895 const char *zPrev, /* Buffer containing previous term */
191897 const char *zNext, /* Buffer containing next term */
191914 const char *zTerm, /* Pointer to buffer containing term */
191949 assert( pTree->aData==(char *)&pTree[1] );
191950 pTree->aData = (char *)sqlite3_malloc64(nReq);
191968 char *zNew = sqlite3_realloc64(pTree->zMalloc, (i64)nTerm*2);
191979 pTree->zTerm = (char *)zTerm;
192000 pNew->aData = (char *)&pNew[1];
192034 pTree->aData[nStart] = (char)iHeight;
192059 char **paRoot, /* OUT: Data for root node */
192102 if( p->aData!=(char *)&p[1] ){
192125 const char *zTerm, /* Pointer to buffer containing term */
192127 const char *aDoclist, /* Pointer to buffer containing doclist */
192147 pWriter->aData = (char *)sqlite3_malloc64(p->nNodeSize);
192222 char *aNew = sqlite3_realloc64(pWriter->aData, nReq);
192247 char *zNew = sqlite3_realloc64(pWriter->zMalloc, (i64)nTerm*2);
192259 pWriter->zTerm = (char *)zTerm;
192282 char *zRoot = NULL; /* Pointer to buffer containing root node */
192510 char **ppList, /* IN/OUT: Pointer to position list */
192513 char *pList = *ppList;
192515 char *pEnd = &pList[nList];
192517 char *p = pList;
192521 char c = 0;
192554 char *pList,
192558 char *pNew;
192560 pNew = (char *)sqlite3_realloc64(pMsr->aBuffer, pMsr->nBuffer);
192574 char **paPoslist, /* OUT: Pointer to position list */
192597 char *pList;
192641 const char *zTerm, /* Term searched for (or NULL) */
192683 const char *zTerm, /* Term to iterate through a doclist for */
192755 char *aNew;
192869 char *pList = 0;
192907 char *a = &pCsr->aBuffer[nDoclist];
192977 const unsigned char *zText = sqlite3_column_text(pStmt, iCol);
193244 char *zBuf, /* Write the BLOB here */
193260 const char *zBuf, /* The BLOB containing the varints */
193285 char *pBlob; /* The BLOB encoding of the document size */
193331 char *pBlob; /* Storage for BLOB written into %_stat */
193346 pBlob = (char*)&a[nStat];
193455 char *zSql = sqlite3_mprintf("SELECT %s" , p->zReadExprlist);
193482 const char *z = (const char *) sqlite3_column_text(pStmt, iCol+1);
193579 char *a; /* Pointer to allocation */
193619 const char *aNode;
193626 const char *aDoclist; /* Pointer to doclist */
193642 char *a = (char *)sqlite3_realloc64(pBlob->a, nAlloc);
193716 static int nodeReaderInit(NodeReader *p, const char *aNode, int nNode){
193745 const char *zTerm, /* Term to write to internal node */
193779 pBlk->a[0] = (char)iLayer;
193806 pNode->block.a[0] = (char)iLayer;
193849 const char *zTerm, /* New term to write */
193851 const char *aDoclist, /* Doclist (or NULL) to write */
193902 const char *zTerm = pCsr->zTerm;
193904 const char *aDoclist = pCsr->aDoclist;
194074 const char *zLhs, int nLhs, /* LHS of comparison */
194075 const char *zRhs, int nRhs /* RHS of comparison */
194138 const char *zKey, /* First key to write */
194150 const char *aRoot = 0; /* Pointer to %_segdir.root buffer */
194181 char *aLeaf = 0;
194248 char *aBlock = 0;
194476 pNode->a[0] = (char)iHeight;
194495 const char *aNode, /* Current node image */
194498 const char *zTerm, /* Omit all terms smaller than this */
194556 const char *zTerm, /* Remove terms smaller than this */
194573 const char *aRoot = sqlite3_column_blob(pFetch, 4);
194583 char *aBlock = 0;
194671 const char *zTerm = pSeg->zTerm;
194723 const char *aHint = sqlite3_column_blob(pSelect, 0);
194918 const char *zKey = pCsr->zTerm;
194976 static int fts3Getint(const char **pz){
194977 const char *z = *pz;
194995 const char *zParam /* Nul-terminated string containing "A,B" */
195000 const char *z = zParam;
195038 const char *zParam /* Nul-terminated string containing boolean */
195065 const char *zTerm, /* Pointer to buffer containing term */
195121 char *pCsr = csr.aDoclist;
195122 char *pEnd = &pCsr[csr.nDoclist];
195199 char *zSql;
195216 const char *zText = (const char *)sqlite3_column_text(pStmt, iCol+1);
195221 char const *zToken; /* Buffer containing token */
195305 const char *zVal = (const char *)sqlite3_value_text(pVal);
195396 const char *zText = (const char *)sqlite3_column_text(pCsr->pStmt, i+1);
195401 char const *zToken; /* Buffer containing token */
195435 char **ppData,
195438 char *pRet;
195449 pRet = (char *)sqlite3_malloc64(p->pList->nData);
195777 char *pList; /* Pointer to start of phrase position list */
195779 char *pHead; /* Position list data following iHead */
195781 char *pTail; /* Position list data following iTail */
195801 char flag;
195814 char *zMatchinfo;
195826 char *z; /* Pointer to buffer containing string */
195839 static MatchinfoBuffer *fts3MIBufferNew(size_t nElem, const char *zMatchinfo){
195851 pRet->zMatchinfo = ((char*)pRet) + nByte;
195944 static void fts3GetDeltaPosition(char **pp, i64 *piPos){
196053 static void fts3SnippetAdvance(char **ppIter, i64 *piIter, int iNext){
196054 char *pIter = *ppIter;
196138 char *pCsr = pPhrase->pTail;
196178 char *pCsr;
196307 const char *zAppend, /* Pointer to data to append to buffer */
196320 char *zNew = sqlite3_realloc64(pStr->z, nAlloc);
196361 const char *zDoc, /* Document text to extract snippet from */
196401 const char *ZDUMMY; int DUMMY1 = 0, DUMMY2 = 0, DUMMY3 = 0;
196428 const char *zOpen, /* String inserted before highlighted term */
196429 const char *zClose, /* String inserted after highlighted term */
196430 const char *zEllipsis, /* String inserted between snippets */
196435 const char *zDoc; /* Document text to extract snippet from */
196446 zDoc = (const char *)sqlite3_column_text(pCsr->pStmt, iCol);
196463 const char *ZDUMMY; /* Dummy argument used with tokenizer */
196550 static int fts3ColumnlistCount(char **ppCollist){
196551 char *pEnd = *ppCollist;
196552 char c = 0;
196575 char *pIter = pPhrase->doclist.pList;
196677 char *pCsr;
196691 char cArg,
196692 char **pzErr
196710 static size_t fts3MatchinfoSize(MatchInfo *pInfo, char cArg){
196747 const char **paLen,
196748 const char **ppEnd
196751 const char *a;
196752 const char *pEnd;
196791 char *pRead; /* Cursor used to iterate through aDoclist */
196817 char *pRead;
196938 const char *zArg /* Matchinfo format string */
196967 const char *a; /* Aggregate column length array */
196968 const char *pEnd; /* First byte past end of length array */
196993 const char *a = sqlite3_column_blob(pSelectDocsize, 0);
196994 const char *pEnd = a + sqlite3_column_bytes(pSelectDocsize, 0);
197059 const char *zArg /* Second argument to matchinfo() function */
197096 char *zErr = 0;
197144 const char *zStart, /* Snippet start text - "<b>" */
197145 const char *zEnd, /* Snippet end text - "</b>" */
197146 const char *zEllipsis, /* Snippet ellipsis text - "<b>...</b>" */
197248 char *pList; /* Position-list */
197268 char *pList; /* Pointer to position list for phrase */
197331 const char *ZDUMMY; /* Dummy argument used with xNext() */
197336 const char *zDoc;
197353 zDoc = (const char *)sqlite3_column_text(pCsr->pStmt, iCol+1);
197397 char aBuffer[64];
197434 const char *zArg /* Second arg to matchinfo() function */
197437 const char *zFormat;
197493 static const unsigned char sqlite3Utf8Trans1[] = {
197550 const unsigned char *aInput; /* Input text being tokenized */
197554 char *zToken; /* storage for current token */
197592 const char *zIn, /* Array of characters to make exceptions */
197595 const unsigned char *z = (const unsigned char *)zIn;
197596 const unsigned char *zTerm = &z[nIn];
197620 z = (const unsigned char *)zIn;
197678 const char * const *azArg, /* Tokenizer creation arguments */
197691 const char *z = azArg[i];
197731 const char *aInput, /* Input string */
197743 pCsr->aInput = (const unsigned char *)aInput;
197746 pCsr->aInput = (const unsigned char*)"";
197775 const char **paToken, /* OUT: Token text */
197784 char *zOut;
197785 const unsigned char *z = &pCsr->aInput[pCsr->iOff];
197786 const unsigned char *zStart = z;
197787 const unsigned char *zEnd;
197788 const unsigned char *zTerm = &pCsr->aInput[pCsr->nInput];
197806 char *zNew = sqlite3_realloc64(pCsr->zToken, pCsr->nAlloc+64);
198039 #define HIBIT ((unsigned char)0x80)
198040 unsigned char aChar[] = {
198126 unsigned char flags;
198127 unsigned char nRange;
198200 assert( sizeof(unsigned short)==2 && sizeof(unsigned char)==1 );
198276 static const char jsonIsSpace[] = {
198294 #define fast_isspace(x) (jsonIsSpace[(unsigned char)x])
198313 char *zBuf; /* Append JSON content here */
198318 char zSpace[100]; /* Initial static space */
198338 static const char * const jsonType[] = {
198361 const char *zJContent; /* 1: Content for INT, REAL, and STRING */
198375 const char *zJson; /* Original JSON string */
198437 char *zNew;
198462 static void jsonAppendRaw(JsonString *p, const char *zIn, u32 N){
198471 static void jsonPrintf(int N, JsonString *p, const char *zFormat, ...){
198482 static void jsonAppendChar(JsonString *p, char c){
198491 char c;
198502 static void jsonAppendString(JsonString *p, const char *zIn, u32 N){
198507 unsigned char c = ((unsigned const char*)zIn)[i];
198513 static const char aSpecial[] = {
198556 const char *z = (const char*)sqlite3_value_text(pValue);
198562 const char *z = (const char*)sqlite3_value_text(pValue);
198757 static u32 jsonHexToInt4(const char *z){
198794 const char *z;
198824 const char *z;
198855 const char *z;
198856 char *zOut;
198866 char c = z[i];
198876 zOut[j++] = (char)v;
198878 zOut[j++] = (char)(0xc0 | (v>>6));
198931 static int jsonParseAddNode(JsonParse*,u32,u32,const char*);
198950 const char *zContent /* Content */
198977 const char *zContent /* Content */
198995 static int jsonIs4Hex(const char *z){
199010 char c;
199015 const char *z = pParse->zJson;
199173 const char *zJson /* Input JSON text to be parsed */
199261 const char *zJson = (const char*)sqlite3_value_text(argv[0]);
199301 p->zJson = (char*)&p[1];
199302 memcpy((char*)p->zJson, zJson, nJson+1);
199318 static int jsonLabelCompare(JsonNode *pNode, const char *zKey, u32 nKey){
199330 static JsonNode *jsonLookupAppend(JsonParse*,const char*,int*,const char**);
199344 const char *zPath, /* The path to search */
199346 const char **pzErr /* Make *pzErr point to any syntax error in zPath */
199349 const char *zKey;
199496 const char *zPath, /* Description of content to append */
199498 const char **pzErr /* Make this point to any syntax error */
199520 static char *jsonPathSyntaxError(const char *zErr){
199536 const char *zPath, /* The path to search */
199540 const char *zErr = 0;
199542 char *zMsg;
199573 const char *zFuncName
199575 char *zMsg = sqlite3_mprintf("json_%s() needs an odd number of arguments",
199621 if( jsonParse(&x, ctx, (const char*)sqlite3_value_text(argv[0])) ) return;
199625 const char *zType;
199733 const char *zPath = (const char*)sqlite3_value_text(argv[1]);
199786 const char *zPath;
199795 zPath = (const char*)sqlite3_value_text(argv[1]);
199841 zPath = (const char*)sqlite3_value_text(argv[i]);
199883 const char *zKey;
199954 if( jsonParse(&x, ctx, (const char*)sqlite3_value_text(argv[0])) ) return;
199955 if( jsonParse(&y, ctx, (const char*)sqlite3_value_text(argv[1])) ){
199983 const char *z;
200000 z = (const char*)sqlite3_value_text(argv[i]);
200025 const char *zPath;
200029 if( jsonParse(&x, ctx, (const char*)sqlite3_value_text(argv[0])) ) return;
200032 zPath = (const char*)sqlite3_value_text(argv[i]);
200058 const char *zPath;
200066 if( jsonParse(&x, ctx, (const char*)sqlite3_value_text(argv[0])) ) return;
200069 zPath = (const char*)sqlite3_value_text(argv[i]);
200110 const char *zPath;
200120 if( jsonParse(&x, ctx, (const char*)sqlite3_value_text(argv[0])) ) return;
200123 zPath = (const char*)sqlite3_value_text(argv[i]);
200162 const char *zPath;
200168 zPath = (const char*)sqlite3_value_text(argv[1]);
200267 char *z;
200268 char c;
200313 const char *z;
200325 z = (const char*)sqlite3_value_text(argv[0]);
200375 char *zJson; /* Input JSON */
200376 char *zRoot; /* Path by which to filter zJson */
200384 int argc, const char *const*argv,
200386 char **pzErr
200530 const char *z;
200663 const char *zRoot = p->zRoot;
200750 int idxNum, const char *idxStr,
200754 const char *z;
200755 const char *zRoot = 0;
200762 z = (const char*)sqlite3_value_text(argv[0]);
200783 const char *zErr = 0;
200784 zRoot = (const char*)sqlite3_value_text(argv[1]);
200931 const char *zName;
201011 SQLITE_PRIVATE int sqlite3GetToken(const unsigned char*,int*); /* In the SQLite core */
201021 typedef unsigned char u8;
201108 char *zDb; /* Name of database containing r-tree table */
201109 char *zName; /* Name of r-tree table */
201114 char *zReadAuxSql; /* SQL for statement to read aux data */
201450 assert( ((((char*)p) - (char*)0)&3)==0 ); /* p is always 4-byte aligned */
201504 assert( ((((char*)p) - (char*)0)&3)==0 ); /* p is always 4-byte aligned */
201675 char *zTab = sqlite3_mprintf("%s_node", pRtree->zName);
201918 sqlite3 *, void *, int, const char *const*, sqlite3_vtab **, char **, int
201927 int argc, const char *const*argv,
201929 char **pzErr
201940 int argc, const char *const*argv,
201942 char **pzErr
201993 char *zCreate = sqlite3_mprintf(
202232 assert( ((((char*)pCellData) - (char*)0)&3)==0 ); /* 4-byte aligned */
202285 assert( ((((char*)pCellData) - (char*)0)&3)==0 ); /* 4-byte aligned */
202489 static void traceQueue(RtreeCursor *pCur, const char *zPrefix){
202780 int idxNum, const char *idxStr,
202939 char zIdxStr[RTREE_MAX_DIMENSIONS*8+1];
202997 zIdxStr[iIdx++] = (char)(p->iColumn - 1 + '0');
204128 char *zSql;
204142 const char *zCol = sqlite3_column_name(pStmt, 0);
204147 const char *zCol1 = sqlite3_column_name(pStmt, iCol);
204148 const char *zCol2 = sqlite3_column_name(pStmt, iCol+1);
204333 static int rtreeRename(sqlite3_vtab *pVtab, const char *zNewName){
204336 char *zSql = sqlite3_mprintf(
204382 const char *zFmt = "SELECT stat FROM %Q.sqlite_stat1 WHERE tbl = '%q_rowid'";
204383 char *zSql;
204415 static int rtreeShadowName(const char *zName){
204416 static const char *azName[] = {
204456 const char *zDb,
204457 const char *zPrefix,
204463 static const char *azSql[N_STATEMENT] = {
204485 char *zCreate;
204525 char *zSql;
204526 const char *zFormat;
204552 char *zSql;
204586 static int getIntFromStmt(sqlite3 *db, const char *zSql, int *piVal){
204620 char **pzErr /* OUT: Error message, if any */
204623 char *zSql;
204659 static int rtreeTokenLength(const char *z){
204661 return sqlite3GetToken((const unsigned char*)z,&dummy);
204676 int argc, const char *const*argv, /* Parameters to CREATE TABLE statement */
204678 char **pzErr, /* OUT: Error message, if any */
204687 char *zSql;
204691 const char *aErrMsg[] = {
204717 pRtree->zDb = (char *)&pRtree[1];
204732 const char *zArg = argv[ii];
204739 static const char *azFormat[] = {",%.*s REAL", ",%.*s INT"};
204886 const char *zDb; /* Database containing rtree table */
204887 const char *zTab; /* Name of rtree table */
204895 char *zReport; /* Message to report */
204920 const char *zFmt, ... /* Format string and trailing args */
204923 char *z;
204947 static void rtreeCheckAppendMsg(RtreeCheck *pCheck, const char *zFmt, ...){
204951 char *z = sqlite3_vmprintf(zFmt, ap);
205033 const char *azSql[2] = {
205186 static void rtreeCheckCount(RtreeCheck *pCheck, const char *zTbl, i64 nExpect){
205212 const char *zDb, /* Name of db ("main", "temp" etc.) */
205213 const char *zTab, /* Name of rtree table to check */
205214 char **pzReport /* OUT: sqlite3_malloc'd report text */
205328 char *zReport = 0;
205329 const char *zDb = (const char*)sqlite3_value_text(apArg[0]);
205330 const char *zTab;
205335 zTab = (const char*)sqlite3_value_text(apArg[1]);
205389 # define safe_isdigit(x) isdigit((unsigned char)(x))
205390 # define safe_isalnum(x) isalnum((unsigned char)(x))
205391 # define safe_isxdigit(x) isxdigit((unsigned char)(x))
205399 static const char geopolyIsSpace[] = {
205417 #define fast_isspace(x) (geopolyIsSpace[(unsigned char)x])
205465 unsigned char hdr[4]; /* Header for on-disk representation */
205487 const unsigned char *z; /* Unparsed input */
205495 static void geopolySwab32(unsigned char *a){
205496 unsigned char t = a[0];
205505 static char geopolySkipSpace(GeoParse *p){
205514 char c = geopolySkipSpace(p);
205515 const unsigned char *z = p->z;
205553 (void)sqlite3AtoF((const char*)p->z, &r, j, SQLITE_UTF8);
205556 *pVal = (GeoCoord)atof((const char*)p->z);
205571 static GeoPoly *geopolyParseJson(const unsigned char *z, int *pRc){
205580 char c;
205624 pOut->hdr[0] = *(unsigned char*)&x;
205659 const unsigned char *a = sqlite3_value_blob(pVal);
205677 if( a[0] != *(unsigned char*)&x ){
205680 geopolySwab32((unsigned char*)&GeoX(p,ii));
205681 geopolySwab32((unsigned char*)&GeoY(p,ii));
205690 const unsigned char *zJson = sqlite3_value_text(pVal);
205766 char cSep = '\'';
205774 const char *z = (const char*)sqlite3_value_text(argv[i]);
205953 p->hdr[0] = *(unsigned char*)&i;
206019 pOut->hdr[0] = *(unsigned char*)ⅈ
206233 unsigned char side; /* 1 for p1, 2 for p2 */
206253 unsigned char side,
206294 unsigned char side /* The side of pPoly */
206417 unsigned char aOverlap[4];
206574 int argc, const char *const*argv, /* Parameters to CREATE TABLE statement */
206576 char **pzErr, /* OUT: Error message, if any */
206584 char *zSql;
206599 pRtree->zDb = (char *)&pRtree[1];
206658 int argc, const char *const*argv,
206660 char **pzErr
206671 int argc, const char *const*argv,
206673 char **pzErr
206694 const char *idxStr, /* Not Used */
207070 const char *zName,
207119 signed char nArg;
207120 unsigned char bPure;
207121 const char *zName;
207139 const char *zName;
207286 const char *zGeom, /* Name of the new SQL function */
207310 const char *zQueryFunc, /* Name of new SQL function */
207338 char **pzErrMsg,
207408 const char *zName, /* Name of ICU function that failed */
207411 char zBuf[128];
207439 static const unsigned char icuUtf8Trans1[] = {
207564 const unsigned char *zA = sqlite3_value_text(argv[0]);
207565 const unsigned char *zB = sqlite3_value_text(argv[1]);
207582 const unsigned char *zE = sqlite3_value_text(argv[2]);
207718 const char *zLocale = 0;
207723 zLocale = (const char *)sqlite3_value_text(apArg[1]);
207818 const char *zLocale; /* Locale identifier - (eg. "jp_JP") */
207819 const char *zName; /* SQL Collation sequence name (eg. "japanese") */
207825 zLocale = (const char *)sqlite3_value_text(apArg[0]);
207826 zName = (const char *)sqlite3_value_text(apArg[1]);
207854 const char *zName; /* Function name */
207855 unsigned char nArg; /* Number of arguments */
207857 unsigned char iContext; /* sqlite3_user_data() context */
207896 char **pzErrMsg,
207939 char *zLocale;
207951 char *zBuffer;
207961 const char * const *argv, /* Tokenizer creation arguments */
207977 p->zLocale = (char *)&p[1];
208003 const char *zInput, /* Input string */
208086 const char **ppToken, /* OUT: *ppToken is the token text */
208122 char *zNew = sqlite3_realloc(pCsr->zBuffer, nByte);
208575 const char *zTarget,
208576 const char *zRbu,
208577 const char *zState
208618 const char *zTarget,
208619 const char *zState
208721 SQLITE_API int sqlite3rbu_close(sqlite3rbu *pRbu, char **pzErrmsg);
208834 int (*xRename)(void *pArg, const char *zOld, const char *zNew)
208880 SQLITE_API int sqlite3rbu_create_vfs(const char *zName, const char *zParent);
208890 SQLITE_API void sqlite3rbu_destroy_vfs(const char *zName);
209009 typedef unsigned char u8;
209029 char *zTbl;
209030 char *zDataTbl;
209031 char *zIdx;
209041 char *zMask; /* Copy of update mask used with pUpdate */
209047 const char *zSpan;
209076 char **azTblCol; /* Array of unquoted target column names */
209077 char **azTblType; /* Array of target column types */
209086 const char *zTbl; /* Name of target db table */
209087 const char *zDataTbl; /* Name of rbu db table (or null) */
209088 const char *zIdx; /* Name of target db index (or null) */
209102 char *zIdxSql;
209191 char *zTarget; /* Path to target db */
209192 char *zRbu; /* Path to rbu db */
209193 char *zState; /* Path to state db (or NULL if zRbu) */
209194 char zStateDb[5]; /* Db name for state ("stat" or "main") */
209196 char *zErrmsg; /* Error message if rc!=SQLITE_OK */
209200 const char *zVfsName; /* Name of automatically created rbu vfs */
209206 int (*xRename)(void*, const char*, const char*);
209264 char **apShm; /* Array of mmap'd *-shm regions */
209265 char *zDel; /* Delete this when closing file */
209267 const char *zWal; /* Wal filename for this main db file */
209296 static unsigned int rbuDeltaGetInt(const char **pz, int *pLen){
209297 static const signed char zValue[] = {
209309 unsigned char *z = (unsigned char*)*pz;
209310 unsigned char *zStart = z;
209316 *pz = (char*)z;
209324 static unsigned int rbuDeltaChecksum(const char *zIn, size_t N){
209325 const unsigned char *z = (const unsigned char *)zIn;
209378 const char *zSrc, /* The source or pattern file */
209380 const char *zDelta, /* Delta to apply to the pattern */
209382 char *zOut /* Write the output into this preallocated buffer */
209387 char *zOrigOut = zOut;
209463 static int rbuDeltaOutputSize(const char *zDelta, int lenDelta){
209490 const char *aDelta;
209492 const char *aOrig;
209497 char *aOut;
209502 aOrig = (const char*)sqlite3_value_blob(argv[0]);
209504 aDelta = (const char*)sqlite3_value_blob(argv[1]);
209541 char **pzErrmsg,
209542 const char *zSql
209560 static int resetAndCollectError(sqlite3_stmt *pStmt, char **pzErrmsg){
209586 char **pzErrmsg,
209587 char *zSql
209698 pIter->zTbl = (const char*)sqlite3_column_text(pIter->pTblIter, 0);
209699 pIter->zDataTbl = (const char*)sqlite3_column_text(pIter->pTblIter,1);
209714 pIter->zIdx = (const char*)sqlite3_column_text(pIter->pIdxIter, 0);
209759 const char *zIn;
209762 zIn = (const char*)sqlite3_value_text(argv[0]);
209824 static char *rbuMPrintf(sqlite3rbu *p, const char *zFmt, ...){
209825 char *zSql = 0;
209849 static int rbuMPrintfExec(sqlite3rbu *p, sqlite3 *db, const char *zFmt, ...){
209851 char *zSql;
209897 sqlite3_int64 nByte = (2*sizeof(char*) + sizeof(int) + 3*sizeof(u8)) * nCol;
209898 char **azNew;
209900 azNew = (char**)rbuMalloc(p, nByte);
209921 static char *rbuStrndup(const char *zStr, int *pRc){
209922 char *zRet = 0;
209927 zRet = (char*)sqlite3_malloc64(nCopy);
209996 const char *zTab,
210093 const char *zIdx = (const char*)sqlite3_column_text(pList, 1);
210169 const char *zName = (const char*)sqlite3_column_name(pStmt, i);
210171 char *zCopy = rbuStrndup(zName, &p->rc);
210202 const char *zName = (const char*)sqlite3_column_text(pStmt, 1);
210215 const char *zType = (const char*)sqlite3_column_text(pStmt, 2);
210219 SWAP(char*, pIter->azTblCol[i], pIter->azTblCol[iOrder]);
210244 static char *rbuObjIterGetCollist(
210248 char *zList = 0;
210249 const char *zSep = "";
210252 const char *z = pIter->azTblCol[i];
210265 static char *rbuObjIterGetPkList(
210268 const char *zPre, /* Before each quoted column name */
210269 const char *zSeparator, /* Separator to use between columns */
210270 const char *zPost /* After each quoted column name */
210273 char *zRet = 0;
210274 const char *zSep = "";
210279 const char *zCol = pIter->azTblCol[i];
210310 static char *rbuVacuumTableStart(
210314 const char *zWrite /* Target table name prefix */
210317 char *zRet = 0;
210330 char *zOrder = rbuObjIterGetPkList(p, pIter, "", ", ", " DESC");
210331 char *zSelect = rbuObjIterGetPkList(p, pIter, "quote(", "||','||", ")");
210332 char *zList = rbuObjIterGetPkList(p, pIter, "", ", ", "");
210342 const char *zVal = (const char*)sqlite3_column_text(pMax, 0);
210377 static char *rbuVacuumIndexStart(
210381 char *zOrder = 0;
210382 char *zLhs = 0;
210383 char *zSelect = 0;
210384 char *zVector = 0;
210385 char *zRet = 0;
210387 const char *zSep = "";
210396 const char *zCollate = (const char*)sqlite3_column_text(pXInfo, 4);
210397 const char *zCol;
210442 const char *zQuoted = (const char*)sqlite3_column_text(pSel, iCol);
210492 static char *rbuObjIterGetIndexCols(
210495 char **pzImposterCols, /* OUT: Columns for imposter table */
210496 char **pzImposterPk, /* OUT: Imposter PK clause */
210497 char **pzWhere, /* OUT: WHERE clause */
210502 char *zRet = 0; /* String to return */
210503 char *zImpCols = 0; /* String to return via *pzImposterCols */
210504 char *zImpPK = 0; /* String to return via *pzImposterPK */
210505 char *zWhere = 0; /* String to return via *pzWhere */
210507 const char *zCom = ""; /* Set to ", " later on */
210508 const char *zAnd = ""; /* Set to " AND " later on */
210521 const char *zCollate = (const char*)sqlite3_column_text(pXInfo, 4);
210522 const char *zCol = 0;
210523 const char *zType;
210554 const char *zOrder = (bDesc ? " DESC" : "");
210604 static char *rbuObjIterGetOldlist(
210607 const char *zObj
210609 char *zList = 0;
210611 const char *zS = "";
210615 const char *zCol = pIter->azTblCol[i];
210645 static char *rbuObjIterGetWhere(
210649 char *zList = 0;
210653 const char *zSep = "";
210666 const char *zSep = "";
210670 const char *zCol = pIter->azTblCol[i];
210709 static char *rbuObjIterGetSetlist(
210712 const char *zMask
210714 char *zList = 0;
210721 const char *zSep = "";
210723 char c = zMask[pIter->aiSrcOrder[i]];
210763 static char *rbuObjIterGetBindlist(sqlite3rbu *p, int nBind){
210764 char *zRet = 0;
210767 zRet = (char*)rbuMalloc(p, nByte);
210790 static char *rbuWithoutRowidPK(sqlite3rbu *p, RbuObjIter *pIter){
210791 char *z = 0;
210794 const char *zSep = "PRIMARY KEY(";
210802 const char *zOrig = (const char*)sqlite3_column_text(pXList,3);
210804 const char *zIdx = (const char*)sqlite3_column_text(pXList,1);
210818 const char *zCol = (const char*)sqlite3_column_text(pXInfo, 2);
210819 const char *zDesc = sqlite3_column_int(pXInfo, 3) ? " DESC" : "";
210853 const char *zIdx = 0; /* Name of PK index */
210855 const char *zComma = "";
210856 char *zCols = 0; /* Used to build up list of table cols */
210857 char *zPk = 0; /* Used to build up table PK declaration */
210868 zIdx = (const char*)sqlite3_column_text(pQuery, 0);
210883 const char *zCollate = (const char*)sqlite3_column_text(pXInfo, 4);
210926 const char *zComma = "";
210927 char *zSql = 0;
210932 const char *zPk = "";
210933 const char *zCol = pIter->azTblCol[iCol];
210934 const char *zColl = 0;
210953 char *zPk = rbuWithoutRowidPK(p, pIter);
210982 const char *zCollist,
210983 const char *zRbuRowid
210986 char *zBind = rbuObjIterGetBindlist(p, pIter->nTblCol + 1 + bRbuRowid);
211027 static char *rbuObjIterGetIndexWhere(sqlite3rbu *p, RbuObjIter *pIter){
211030 char *zRet = 0;
211043 char *zSql = (char*)sqlite3_column_text(pStmt, 0);
211053 char c = zSql[i];
211135 char *zCollist = 0; /* List of indexed columns */
211136 char **pz = &p->zErrmsg;
211137 const char *zIdx = pIter->zIdx;
211138 char *zLimit = 0;
211146 const char *zTbl = pIter->zTbl;
211147 char *zImposterCols = 0; /* Columns for imposter table */
211148 char *zImposterPK = 0; /* Primary key declaration for imposter */
211149 char *zWhere = 0; /* WHERE clause on PK columns */
211150 char *zBind = 0;
211151 char *zPart = 0;
211189 char *zSql;
211191 char *zStart = 0;
211247 const char *zTbl = pIter->zTbl; /* Table this step applies to */
211248 const char *zWrite; /* Imposter table name */
211250 char *zBindings = rbuObjIterGetBindlist(p, pIter->nTblCol + bRbuRowid);
211251 char *zWhere = rbuObjIterGetWhere(p, pIter);
211252 char *zOldlist = rbuObjIterGetOldlist(p, pIter, "old");
211253 char *zNewlist = rbuObjIterGetOldlist(p, pIter, "new");
211285 const char *zRbuRowid = "";
211334 const char *zRbuRowid = "";
211335 char *zStart = 0;
211336 char *zOrder = 0;
211397 const char *zMask, /* rbu_control value ('x.x.') */
211434 char *zWhere = rbuObjIterGetWhere(p, pIter);
211435 char *zSet = rbuObjIterGetSetlist(p, pIter, zMask);
211436 char *zUpdate = 0;
211438 pUp->zMask = (char*)&pUp[1];
211444 const char *zPrefix = "";
211464 const char *zName,
211526 pRet->zTbl = rbuStrndup((char*)sqlite3_column_text(pStmt, 1), &rc);
211530 pRet->zIdx = rbuStrndup((char*)sqlite3_column_text(pStmt, 1), &rc);
211558 pRet->zDataTbl = rbuStrndup((char*)sqlite3_column_text(pStmt, 1), &rc);
211594 const char *zFile = sqlite3_db_filename(p->dbRbu, "main");
211683 char *zTarget;
211684 char *zExtra = 0;
211763 static void rbuFileSuffix3(const char *zBase, char *z){
211978 const char *zUri = sqlite3_db_filename(db, 0);
211983 static LPWSTR rbuWinUtf8ToUnicode(const char *zFilename){
212014 const char *zBase = sqlite3_db_filename(p->dbMain, "main");
212015 const char *zMove = zBase;
212016 char *zOal;
212017 char *zWal;
212093 static int rbuStepType(sqlite3rbu *p, const char **pzMask){
212111 const unsigned char *z = sqlite3_column_text(p->objiter.pSelect, iCol);
212115 *pzMask = (const char*)z;
212136 static void assertColumnName(sqlite3_stmt *pStmt, int iCol, const char *zName){
212137 const char *zCol = sqlite3_column_name(pStmt, iCol);
212234 const char *zMask = 0;
212266 char c = zMask[pIter->aiSrcOrder[i]];
212389 static void rbuCopyPragma(sqlite3rbu *p, const char *zPragma){
212424 const char *zSql = (const char*)sqlite3_column_text(pSql, 0);
212590 static int rbuStrCompare(const char *z1, const char *z2){
212640 char *zOal = rbuMPrintf(p, "%s-oal", p->zTarget);
212657 char zRnd[64];
212694 char *zErrmsg = 0;
212779 const char *zTarget,
212780 const char *zRbu,
212781 const char *zState
212799 char *pCsr = (char*)&p[1];
212957 const char *zTarget,
212958 const char *zRbu,
212959 const char *zState
212969 const char *zTarget,
212970 const char *zState
213018 SQLITE_API int sqlite3rbu_close(sqlite3rbu *p, char **pzErrmsg){
213176 const char *zBegin = rbuIsVacuum(p) ? "BEGIN" : "BEGIN IMMEDIATE";
213189 static int xDefaultRename(void *pArg, const char *zOld, const char *zNew){
213223 int (*xRename)(void *pArg, const char *zOld, const char *zNew)
213370 static rbu_file *rbuFindMaindb(rbu_vfs *pRbuVfs, const char *zWal, int bRbu){
213682 char *zIn = *(char**)pArg;
213683 char *zOut = sqlite3_mprintf("rbu(%s)/%z", pRbuVfs->base.zName, zIn);
213684 *(char**)pArg = zOut;
213764 sqlite3_int64 nByte = (iRegion+1) * sizeof(char*);
213765 char **apNew = (char**)sqlite3_realloc64(p->apShm, nByte);
213775 memset(&apNew[p->nShm], 0, sizeof(char*) * (1 + iRegion - p->nShm));
213781 char *pNew = (char*)sqlite3_malloc64(szRegion);
213835 const char *zName,
213864 const char *zOpen = zName;
213891 ((char*)zOpen)[nOpen-3] = 'o';
213931 static int rbuVfsDelete(sqlite3_vfs *pVfs, const char *zPath, int dirSync){
213942 const char *zPath,
213990 const char *zPath,
213992 char *zOut
214002 static void *rbuVfsDlOpen(sqlite3_vfs *pVfs, const char *zPath){
214012 static void rbuVfsDlError(sqlite3_vfs *pVfs, int nByte, char *zErrMsg){
214023 const char *zSym
214042 static int rbuVfsRandomness(sqlite3_vfs *pVfs, int nByte, char *zBufOut){
214067 static int rbuVfsGetLastError(sqlite3_vfs *pVfs, int a, char *b){
214075 SQLITE_API void sqlite3rbu_destroy_vfs(const char *zName){
214089 SQLITE_API int sqlite3rbu_create_vfs(const char *zName, const char *zParent){
214138 char *zSpace;
214143 pNew->base.zName = (const char*)(zSpace = (char*)&pNew[1]);
214252 static const char zDbstatSchema[] =
214290 char *zPath; /* Path to this page */
214314 char *zName; /* Value of 'name' column */
214315 char *zPath; /* Value of 'path' column */
214316 char *zPagetype; /* Value of 'pagetype' column */
214343 int argc, const char *const*argv,
214345 char **pzErr
214353 sqlite3TokenInit(&nm, (char*)argv[3]);
214754 char *z;
214812 pCsr->zName = (char *)sqlite3_column_text(pCsr->pStmt, 0);
214864 pCsr->zName = (char *)sqlite3_column_text(pCsr->pStmt, 0);
214918 int idxNum, const char *idxStr,
214924 char *zSql; /* String value of pSql */
214927 const char *zName = 0; /* Only provide analysis of this table */
214934 const char *zDbase = (const char*)sqlite3_value_text(argv[iArg++]);
214946 zName = (const char*)sqlite3_value_text(argv[iArg++]);
215156 int argc, const char *const*argv,
215158 char **pzErr
215306 int idxNum, const char *idxStr,
215320 const char *zSchema;
215322 zSchema = (const char*)sqlite3_value_text(argv[0]);
215403 char *zErr = 0;
215404 const char *zSchema;
215423 zSchema = (const char*)sqlite3_value_text(argv[4]);
215559 char *zDb; /* Name of database session is attached to */
215566 int (*xTableFilter)(void *pCtx, const char *zTab);
215614 char *zTab; /* Current table */
215637 char *zName; /* Local name of table */
215640 const char **azCol; /* Column names */
216510 const char *zDb, /* Name of attached database (e.g. "main") */
216511 const char *zThis, /* Table name */
216513 const char **pzTab, /* OUT: Copy of zThis */
216514 const char ***pazCol, /* OUT: Array of column names for table */
216517 char *zPragma;
216525 char **azCol = 0;
216578 nByte += nDbCol * (sizeof(const char *) + sizeof(u8) + 1);
216585 azCol = (char **)pAlloc;
216591 *pzTab = (char *)pAlloc;
216598 const unsigned char *zName = sqlite3_column_text(pStmt, 1);
216601 azCol[i] = (char *)pAlloc;
216614 *pazCol = (const char **)azCol;
216966 const char *zName,
217008 char const *zDb, /* Database name */
217009 char const *zName, /* Table name */
217111 static char *sessionExprComparePK(
217113 const char *zDb1, const char *zDb2,
217114 const char *zTab,
217115 const char **azCol, u8 *abPK
217118 const char *zSep = "";
217119 char *zRet = 0;
217134 static char *sessionExprCompareOther(
217136 const char *zDb1, const char *zDb2,
217137 const char *zTab,
217138 const char **azCol, u8 *abPK
217141 const char *zSep = "";
217142 char *zRet = 0;
217165 static char *sessionSelectFindNew(
217167 const char *zDb1, /* Pick rows in this db only */
217168 const char *zDb2, /* But not in this one */
217169 const char *zTbl, /* Table name */
217170 const char *zExpr
217172 char *zRet = sqlite3_mprintf(
217185 const char *zDb1,
217186 const char *zDb2,
217187 char *zExpr
217190 char *zStmt = sessionSelectFindNew(pTab->nCol, zDb1, zDb2, pTab->zName,zExpr);
217215 const char *zFrom,
217216 const char *zExpr
217220 char *zExpr2 = sessionExprCompareOther(pTab->nCol,
217226 char *zStmt = sqlite3_mprintf(
217254 const char *zFrom,
217255 const char *zTbl,
217256 char **pzErrMsg
217258 const char *zDb = pSession->zDb;
217268 char *zExpr = 0;
217286 const char **azCol = 0;
217300 sqlite3_free((char*)azCol);
217349 const char *zDb, /* Name of db (e.g. "main") */
217364 pNew->zDb = (char *)&pNew[1];
217400 sessionFree(pSession, (char*)pTab->azCol); /* cast works around VC++ bug */
217443 int(*xFilter)(void*, const char*),
217461 const char *zName /* Table name */
217493 pTab->zName = (char *)&pTab[1];
217625 const char *zStr,
217648 char aBuf[24];
217664 const char *zStr, /* String to quote, escape and append */
217669 char *zOut = (char *)&p->aBuf[p->nBuf];
217670 const char *zIn = zStr;
217906 const char *zDb, /* Database name */
217907 const char *zTab, /* Table name */
217909 const char **azCol, /* Names of table columns */
217914 char *zSql = 0;
217925 const char *zSep = "";
217942 zSql = (char*)buf.aBuf;
218004 rc = sqlite3_bind_text(pSelect, i+1, (char *)a, n, SQLITE_TRANSIENT);
218088 const char *zName = pTab->zName;
218091 const char **azCol = 0; /* Table columns */
218157 sqlite3_free((char*)azCol); /* cast works around VC++ bug */
218493 sqlite3ValueSetStr(pVal, nData, (char*)aCopy, enc, sqlite3_free);
218722 p->zTab = p->abPK ? (char*)&p->abPK[p->nCol] : 0;
218920 const char **pzTab, /* OUT: Pointer to table name */
218940 unsigned char **pabPK, /* OUT: Array of boolean - true for PK cols */
219291 const char **azCol; /* Array of column names */
219379 const char *zSep = "";
219424 char *zSql = (char*)buf.aBuf;
219484 const char *zTab, /* Table name */
219488 const char *zSep = "";
219527 rc = sqlite3_prepare_v2(db, (char *)buf.aBuf, buf.nBuf, &p->pDelete, 0);
219549 const char *zTab, /* Table name */
219567 const char *zTab, /* Table name */
219589 rc = sqlite3_prepare_v2(db, (char *)buf.aBuf, buf.nBuf, &p->pInsert, 0);
219595 static int sessionPrepare(sqlite3 *db, sqlite3_stmt **pp, const char *zSql){
219719 const char *zDummy; /* Unused */
219756 const char *zTab = pIter->zTab;
219831 const char *zDummy;
219925 const char *zDummy;
220110 const char *zTab,
220129 pIter2->zTab = (char*)zTab;
220168 const char *zTab /* Table name */
220181 const char *zTab = 0; /* Name of current table */
220202 const char *zNew;
220215 sqlite3_free((char*)sApply.azCol); /* cast works around VC++ bug */
220242 sApply.azCol = (const char **)zTab;
220350 sqlite3_free((char*)sApply.azCol); /* cast works around VC++ bug */
220351 sqlite3_free((char*)sApply.constraints.aBuf);
220352 sqlite3_free((char*)sApply.rebase.aBuf);
220367 const char *zTab /* Table name */
220400 const char *zTab /* Table name */
220425 const char *zTab /* Table name */
220452 const char *zTab /* Table name */
220673 const char *zNew;
220711 pTab->zName = (char*)&pTab->abPK[nCol];
221125 const char *zTab = pIter->zTab;
221403 const unsigned char *a;
221404 const unsigned char *b;
221628 const char *pText, int nText, /* Text to tokenize */
221630 int (*xToken)(void*, int, const char*, int, int, int) /* Callback */
221640 int (*xColumnText)(Fts5Context*, int iCol, const char **pz, int *pn);
221855 int (*xCreate)(void*, const char **azArg, int nArg, Fts5Tokenizer **ppOut);
221860 const char *pText, int nText,
221864 const char *pToken, /* Pointer to buffer containing token */
221896 const char *zName,
221905 const char *zName,
221913 const char *zName,
221955 typedef unsigned char u8;
222112 char *zDb; /* Database holding FTS index (e.g. "main") */
222113 char *zName; /* Name of FTS index */
222115 char **azCol; /* Column names */
222120 char *zContent; /* content table */
222121 char *zContentRowid; /* "content_rowid=" option value */
222124 char *zContentExprlist;
222137 char *zRank; /* Name of rank function */
222138 char *zRankArgs; /* Arguments to rank function */
222141 char **pzErrmsg;
222164 Fts5Global*, sqlite3*, int, const char **, Fts5Config**, char**
222173 const char *pText, int nText, /* Text to tokenize */
222175 int (*xToken)(void*, int, const char*, int, int, int) /* Callback */
222178 static void sqlite3Fts5Dequote(char *z);
222184 static int sqlite3Fts5ConfigSetValue(Fts5Config*, const char*, sqlite3_value*, int*);
222186 static int sqlite3Fts5ConfigParseRank(const char*, char**, char**);
222209 static void sqlite3Fts5BufferAppendString(int *, Fts5Buffer*, const char*);
222213 static void sqlite3Fts5BufferAppendPrintf(int *, Fts5Buffer*, char *zFmt, ...);
222215 static char *sqlite3Fts5Mprintf(int *pRc, const char *zFmt, ...);
222269 static char *sqlite3Fts5Strndup(int *pRc, const char *pIn, int nIn);
222272 static int sqlite3Fts5IsBareword(char t);
222278 static int sqlite3Fts5TermsetAdd(Fts5Termset*, int, const char*, int, int *pbPresent);
222319 static int sqlite3Fts5IndexOpen(Fts5Config *pConfig, int bCreate, Fts5Index**, char**);
222330 const char *pTerm,
222340 const char *p,
222351 const char *pToken, int nToken, /* Token (or prefix) to query for */
222377 static const char *sqlite3Fts5IterTerm(Fts5IndexIter*, int*);
222398 const char *pToken, int nToken /* Token to add or remove to or from index */
222464 static int sqlite3Fts5GetVarint32(const unsigned char *p, u32 *v);
222466 static u8 sqlite3Fts5GetVarint(const unsigned char*, u64*);
222467 static int sqlite3Fts5PutVarint(unsigned char *p, u64 v);
222502 const char **azArg,
222505 char **pzErr
222532 char bByte,
222533 const char *pToken, int nToken /* Token to add or remove to or from index */
222544 const char *pTerm, int nTerm, /* Query term */
222551 const char *pTerm, int nTerm /* Query prefix */
222556 const char **pzTerm, /* OUT: term (nul-terminated) */
222577 static int sqlite3Fts5StorageOpen(Fts5Config*, Fts5Index*, int, Fts5Storage**, char**);
222579 static int sqlite3Fts5StorageRename(Fts5Storage*, const char *zName);
222582 static int sqlite3Fts5CreateTable(Fts5Config*, const char*, const char*, int, char **);
222590 static int sqlite3Fts5StorageStmt(Fts5Storage *p, int eStmt, sqlite3_stmt**, char**);
222601 Fts5Storage *p, const char*, sqlite3_value*, int
222626 const char *p; /* Token text (not NULL terminated) */
222635 const char *zExpr,
222637 char **pzErr
222643 const char *zText,
222674 Fts5Config*, Fts5Expr*, Fts5PoslistPopulator*, int, const char*, int
222687 static void sqlite3Fts5ParseError(Fts5Parse *pParse, const char *zFmt, ...);
222755 int (*xCreate)(void*, const char**, int, Fts5Tokenizer**),
222779 static int sqlite3Fts5UnicodeCatParse(const char*, u8*);
222884 ** "unsigned char" is used if there are fewer than
222935 #define fts5YYCODETYPE unsigned char
222937 #define fts5YYACTIONTYPE unsigned char
223071 static const unsigned char fts5yy_shift_ofst[] = {
223080 static const signed char fts5yy_reduce_ofst[] = {
223163 static char *fts5yyTracePrompt = 0;
223184 static void sqlite3Fts5ParserTrace(FILE *TraceFILE, char *zTracePrompt){
223195 static const char *const fts5yyTokenName[] = {
223229 static const char *const fts5yyRuleName[] = {
223486 static unsigned char fts5yycoverage[fts5YYNSTATE][fts5YYNFTS5TOKEN];
223638 static void fts5yyTraceShift(fts5yyParser *fts5yypParser, int fts5yyNewState, const char *zTag){
223732 static const signed char fts5yyRuleInfoNRhs[] = {
224257 char cDiv = '[';
224399 const char *zOpen; /* Opening highlight */
224400 const char *zClose; /* Closing highlight */
224401 const char *zIn; /* Input text */
224404 char *zOut; /* Output value */
224419 const char *z, int n
224434 const char *pToken, /* Buffer containing token */
224497 const char *zErr = "wrong number of arguments to function highlight()";
224504 ctx.zOpen = (const char*)sqlite3_value_text(apVal[1]);
224505 ctx.zClose = (const char*)sqlite3_value_text(apVal[2]);
224519 sqlite3_result_text(pCtx, (const char*)ctx.zOut, -1, SQLITE_TRANSIENT);
224540 const char *zDoc; /* Document being tokenized */
224570 const char *pToken, /* Buffer containing token */
224584 char c = 0;
224604 unsigned char *aSeen, /* Array with one element per query phrase */
224649 static const char *fts5ValueToText(sqlite3_value *pVal){
224650 const char *zRet = (const char*)sqlite3_value_text(pVal);
224667 const char *zEllips; /* 4th argument to snippet() */
224672 unsigned char *aSeen; /* Array of "seen instance" flags */
224681 const char *zErr = "wrong number of arguments to function snippet()";
224800 sqlite3_result_text(pCtx, (const char*)ctx.zOut, -1, SQLITE_TRANSIENT);
224974 const char *zFunc; /* Function name (nul-terminated) */
225081 const char *zStr
225099 char *zFmt, ...
225102 char *zTmp;
225117 static char *sqlite3Fts5Mprintf(int *pRc, const char *zFmt, ...){
225118 char *zRet = 0;
225279 static char *sqlite3Fts5Strndup(int *pRc, const char *pIn, int nIn){
225280 char *zRet = 0;
225285 zRet = (char*)sqlite3_malloc(nIn+1);
225307 static int sqlite3Fts5IsBareword(char t){
225327 char *pTerm;
225346 const char *pTerm, int nTerm,
225379 pEntry->pTerm = (char*)&pEntry[1];
225434 static int fts5_iswhitespace(char x){
225438 static int fts5_isopenquote(char x){
225447 static const char *fts5ConfigSkipWhitespace(const char *pIn){
225448 const char *p = pIn;
225460 static const char *fts5ConfigSkipBareword(const char *pIn){
225461 const char *p = pIn;
225467 static int fts5_isdigit(char a){
225473 static const char *fts5ConfigSkipLiteral(const char *pIn){
225474 const char *p = pIn;
225549 static int fts5Dequote(char *z){
225550 char q;
225594 static void sqlite3Fts5Dequote(char *z){
225595 char quote; /* Quote character (if any ) */
225606 const char *zName;
225613 const char *zEnum,
225643 const char *zCmd, /* Special command to parse */
225644 const char *zArg, /* Argument to parse */
225645 char **pzErr /* OUT: Error message */
225651 const char *p;
225703 const char *p = (const char*)zArg;
225705 char **azArg = sqlite3Fts5MallocZero(&rc, sizeof(char*) * nArg);
225706 char *pDel = sqlite3Fts5MallocZero(&rc, nArg * 2);
225707 char *pSpace = pDel;
225715 const char *p2 = fts5ConfigSkipWhitespace(p);
225734 (const char**)azArg, (int)nArg, pConfig,
225824 static const char *fts5ConfigGobbleWord(
225826 const char *zIn, /* Buffer to gobble string/bareword from */
225827 char **pzOut, /* OUT: malloc'd buffer containing str/bw */
225830 const char *zRet = 0;
225833 char *zOut = sqlite3_malloc64(nIn+1);
225866 char *zCol,
225867 char *zArg,
225868 char **pzErr
225909 p->zContentExprlist = (char*)buf.p;
225929 const char **azArg, /* Array of nArg CREATE VIRTUAL TABLE args */
225931 char **pzErr /* OUT: Error message */
225944 nByte = nArg * (sizeof(char*) + sizeof(u8));
225945 pRet->azCol = (char**)sqlite3Fts5MallocZero(&rc, nByte);
225960 const char *zOrig = azArg[i];
225961 const char *z;
225962 char *zOne = 0;
225963 char *zTwo = 0;
226013 const char *zTail = 0;
226079 char *zSql;
226083 const char *zSep = (i==0?"":", ");
226106 ** const char *pToken // Pointer to buffer containing token
226125 const char *pText, int nText, /* Text to tokenize */
226127 int (*xToken)(void*, int, const char*, int, int, int) /* Callback */
226141 static const char *fts5ConfigSkipArgs(const char *pIn){
226142 const char *p = pIn;
226169 const char *zIn, /* Input string */
226170 char **pzRank, /* OUT: Rank function name */
226171 char **pzRankArgs /* OUT: Rank function arguments */
226173 const char *p = zIn;
226174 const char *pRank;
226175 char *zRank = 0;
226176 char *zRankArgs = 0;
226202 const char *pArgs;
226229 const char *zKey,
226299 const char *zIn = (const char*)sqlite3_value_text(pVal);
226300 char *zRank;
226301 char *zRankArgs;
226322 const char *zSelect = "SELECT k, v FROM %Q.'%q_config'";
226323 char *zSql;
226344 const char *zK = (const char*)sqlite3_column_text(p, 0);
226409 static void sqlite3Fts5ParserTrace(FILE*, char*);
226465 char *zTerm; /* nul-terminated term */
226498 char *zErr;
226506 static void sqlite3Fts5ParseError(Fts5Parse *pParse, const char *zFmt, ...){
226517 static int fts5ExprIsspace(char t){
226526 const char **pz, /* IN/OUT: Pointer into buffer */
226529 const char *z = *pz;
226551 const char *z2;
226569 const char *z2;
226595 const char *zExpr, /* Expression text */
226597 char **pzErr
226601 const char *z = zExpr;
226673 Fts5Config *pConfig, int bGlob, int iCol, const char *zText, Fts5Expr **pp
226676 char *zExpr = (char*)sqlite3_malloc64(nText*4 + 1);
226682 char aSpec[3];
227912 static int fts5ParseStringFromToken(Fts5Token *pToken, char **pz){
228035 const char *pToken, /* Buffer containing token */
228059 pSyn->zTerm = ((char*)pSyn) + sizeof(Fts5ExprTerm) + sizeof(Fts5Buffer);
228148 char *z = 0;
228237 const char *zTerm = p->zTerm;
228307 char c = (char)p->p[i];
228403 char *z; /* Dequoted copy of token p */
228789 static char *fts5ExprTermPrint(Fts5ExprTerm *pTerm){
228792 char *zQuoted;
228803 char *zIn = p->zTerm;
228821 static char *fts5PrintfAppend(char *zApp, const char *zFmt, ...){
228822 char *zNew;
228828 char *zNew2 = sqlite3_mprintf("%s%s", zApp, zNew);
228842 static char *fts5ExprPrintTcl(
228844 const char *zNearsetCmd,
228847 char *zRet = 0;
228883 char *zTerm = pPhrase->aTerm[iTerm].zTerm;
228895 char const *zOp = 0;
228908 char *z = fts5ExprPrintTcl(pConfig, zNearsetCmd, pExpr->apChild[i]);
228921 static char *fts5ExprPrint(Fts5Config *pConfig, Fts5ExprNode *pExpr){
228922 char *zRet = 0;
228958 char *zTerm = fts5ExprTermPrint(&pPhrase->aTerm[iTerm]);
228976 char const *zOp = 0;
228989 char *z = fts5ExprPrint(pConfig, pExpr->apChild[i]);
229020 const char *zExpr = 0;
229021 char *zErr = 0;
229026 const char **azConfig; /* Array of arguments for Fts5Config */
229027 const char *zNearsetCmd = "nearset";
229042 zNearsetCmd = (const char*)sqlite3_value_text(apVal[1]);
229047 azConfig = (const char**)sqlite3_malloc64(sizeof(char*) * nConfig);
229056 const char *z = (const char*)sqlite3_value_text(apVal[iArg]);
229060 zExpr = (const char*)sqlite3_value_text(apVal[0]);
229068 char *zText;
229164 const char *z;
229286 const char *pToken, /* Pointer to buffer containing token */
229323 const char *z, int n
229521 ** char *fts5EntryKey(Fts5HashEntry *pEntry){ return zKey; }
229523 #define fts5EntryKey(p) ( ((char *)(&(p)[1])) )
229690 char bByte, /* First byte of token */
229691 const char *pToken, int nToken /* Token to add or remove to or from index */
229704 char *zKey = fts5EntryKey(p);
229716 char *zKey;
229856 char *zKey1 = fts5EntryKey(p1);
229857 char *zKey2 = fts5EntryKey(p2);
229886 const char *pTerm, int nTerm, /* Query prefix, if any */
229934 const char *pTerm, int nTerm, /* Query term */
229939 char *zKey = 0;
229971 const char *pTerm, int nTerm /* Query prefix */
229987 const char **pzTerm, /* OUT: term (nul-terminated) */
229993 char *zKey = fts5EntryKey(p);
230284 char *zDataTbl; /* Name of %_data table */
230732 char *zSql
230780 char *zSql = sqlite3_mprintf(
231222 static void fts5PrintStructure(const char *zCaption, Fts5Structure *pStruct){
231999 const char *zTerm = 0;
232073 const char *zTerm = 0;
232532 p->rc = sqlite3Fts5HashScanInit(p->pHash, (const char*)pTerm, nTerm);
232533 sqlite3Fts5HashScanEntry(p->pHash, (const char**)&z, &pList, &nList);
232534 n = (z ? (int)strlen((const char*)z) : 0);
232543 (const char*)pTerm, nTerm, (void**)&pLeaf, &nList
233816 const char *z = (pWriter->btterm.n>0?(const char*)pWriter->btterm.p:"");
234614 const char *zTerm; /* Buffer containing term */
235413 char **pzErr
235474 const char *p,
235482 if( (unsigned char)p[n++]>=0xc0 ){
235500 static int fts5IndexCharlen(const char *pIn, int nIn){
235504 if( (unsigned char)pIn[i++]>=0xc0 ){
235526 const char *pToken, int nToken /* Token to add or remove to or from index */
235545 p->iWriteRowid, iCol, iPos, (char)(FTS5_MAIN_PREFIX+i+1), pToken,
235560 const char *pToken, int nToken, /* Token (or prefix) to query for */
235689 static const char *sqlite3Fts5IterTerm(Fts5IndexIter *pIndexIter, int *pn){
235691 const char *z = (const char*)fts5MultiIterTerm((Fts5Iter*)pIndexIter, &n);
235802 const char *pTerm,
235862 const char *z, /* Index key to query for */
235903 static int fts5TestUtf8(const char *z, int n){
235937 const char *z, int n, /* Possibly new term to test */
235947 const char *zTerm = (const char*)&pPrev->p[1]; /* term sans prefix-byte */
236109 const char *zIdxTerm = (const char*)sqlite3_column_blob(pStmt, 1);
236282 char *z = (char*)fts5MultiIterTerm(pIter, &n);
236432 const char *zSpace = "";
236520 const char *zApp = "";
236625 &rc, &s, " term=%.*s", term.n, (const char*)term.p
236732 &rc, &s, " term=%.*s", term.n, (const char*)term.p
236743 sqlite3_result_text(pCtx, (const char*)s.p, s.n, SQLITE_TRANSIENT);
236760 const char *zArg;
236764 zArg = (const char*)sqlite3_value_text(apVal[0]);
236923 char *zFunc; /* Function name (nul-terminated) */
236936 char *zName; /* Name of tokenizer */
237013 char *zRank; /* Custom rank function */
237014 char *zRankArgs; /* Custom rank function args */
237189 const char * const *argv, /* xCreate/xConnect argument array */
237191 char **pzErr /* Write any error message here */
237194 const char **azConfig = (const char**)argv;
237254 const char * const *argv, /* xCreate/xConnect argument array */
237256 char **pzErr /* OUT: sqlite3_malloc'd error message */
237264 const char * const *argv, /* xCreate/xConnect argument array */
237266 char **pzErr /* OUT: sqlite3_malloc'd error message */
237382 char *idxStr;
237406 idxStr = (char*)sqlite3_malloc(pInfo->nConstraint * 8 + 1);
237782 const char *zFmt,
237787 char *zSql;
237818 const char *zRank = pCsr->zRank;
237819 const char *zRankArgs = pCsr->zRankArgs;
237880 const char *zQuery
237883 const char *z = zQuery; /* Special query text */
237912 static Fts5Auxiliary *fts5FindAuxiliary(Fts5FullTable *pTab, const char *zName){
237929 const char *zRank = pCsr->zRank;
237930 const char *zRankArgs = pCsr->zRankArgs;
237933 char *zSql = sqlite3Fts5Mprintf(&rc, "SELECT %s", zRankArgs);
237982 const char *z = (const char*)sqlite3_value_text(pRank);
237983 char *zRank = 0;
237984 char *zRankArgs = 0;
238002 pCsr->zRank = (char*)pConfig->zRank;
238003 pCsr->zRankArgs = (char*)pConfig->zRankArgs;
238005 pCsr->zRank = (char*)FTS5_DEFAULT_RANK;
238036 const char *idxStr, /* Unused */
238051 char **pzErrmsg = pConfig->pzErrmsg;
238086 const char *zText = (const char*)sqlite3_value_text(apVal[i]);
238101 char **pzErr = &pTab->p.base.zErrMsg;
238115 const char *zText = (const char*)sqlite3_value_text(apVal[i]);
238322 static void fts5SetVtabError(Fts5FullTable *p, const char *zFormat, ...){
238347 const char *zCmd, /* Text inserted into table-name column */
238474 const char *z = (const char*)sqlite3_value_text(apVal[2+pConfig->nCol]);
238643 const char *pText, int nText,
238645 int (*xToken)(void*, int, const char*, int, int, int)
238667 const char **pz,
238680 *pz = (const char*)sqlite3_column_text(pCsr->pStmt, iCol+1);
238705 int n; const char *z;
238859 const char *pUnused, /* Buffer containing token */
238894 const char *z; int n;
239202 char *zErr = sqlite3_mprintf("no such cursor: %lld", iCsrId);
239355 const char *zName, /* Name of SQL function */
239379 const char *zName /* New name of table */
239430 const char *zName, /* Name of new function */
239447 pAux->zFunc = (char*)&pAux[1];
239469 const char *zName, /* Name of new function */
239485 pNew->zName = (char*)&pNew[1];
239504 const char *zName
239525 const char *zName, /* Name of new function */
239546 const char **azArg,
239549 char **pzErr
239631 static int fts5ShadowName(const char *zName){
239632 static const char *azName[] = {
239730 char **pzErrMsg,
239743 char **pzErrMsg,
239813 char **pzErrMsg /* OUT: Error message (if any) */
239827 const char *azStmt[] = {
239844 char *zSql = 0;
239870 char *zBind;
239914 char **pzErr,
239915 const char *zFormat,
239920 char *zSql;
239967 const char *zTail, /* Tail of table name e.g. "data", "config" */
239968 const char *zName /* New name of FTS5 table */
239978 static int sqlite3Fts5StorageRename(Fts5Storage *pStorage, const char *zName){
240000 const char *zPost, /* Shadow table to create (e.g. "content") */
240001 const char *zDefn, /* Columns etc. for shadow table */
240003 char **pzErr /* OUT: Error message */
240006 char *zErr = 0;
240038 char **pzErr /* OUT: Error message */
240057 char *zDefn = sqlite3_malloc64(32 + (sqlite3_int64)pConfig->nCol * 10);
240127 const char *pToken, /* Buffer containing token */
240173 const char *zText;
240178 zText = (const char*)sqlite3_column_text(pSeek, iCol);
240181 zText = (const char*)sqlite3_value_text(apVal[iCol-1]);
240382 const char *zText = (const char*)sqlite3_column_text(pScan, ctx.iCol+1);
240508 const char *zText = (const char*)sqlite3_value_text(apVal[ctx.iCol+2]);
240531 static int fts5StorageCount(Fts5Storage *p, const char *zSuffix, i64 *pnRow){
240533 char *zSql;
240576 const char *pToken, /* Buffer containing token */
240686 const char *zText = (const char*)sqlite3_column_text(pScan, i+1);
240755 char **pzErrMsg
240898 const char *z,
240949 static unsigned char aAsciiTokenChar[128] = {
240962 unsigned char aTokenChar[128];
240967 const char *zArg,
240973 p->aTokenChar[(int)zArg[i]] = (unsigned char)bTokenChars;
240990 const char **azArg, int nArg,
241007 const char *zArg = azArg[i+1];
241029 static void asciiFold(char *aOut, const char *aIn, int nByte){
241032 char c = aIn[i];
241045 const char *pText, int nText,
241046 int (*xToken)(void*, int, const char*, int nToken, int iStart, int iEnd)
241053 char aFold[64];
241055 char *pFold = aFold;
241056 unsigned char *a = p->aTokenChar;
241110 static const unsigned char sqlite3Utf8Trans1[] = {
241136 *zOut++ = (unsigned char)(c&0xFF); \
241139 *zOut++ = 0xC0 + (unsigned char)((c>>6)&0x1F); \
241140 *zOut++ = 0x80 + (unsigned char)(c & 0x3F); \
241143 *zOut++ = 0xE0 + (unsigned char)((c>>12)&0x0F); \
241144 *zOut++ = 0x80 + (unsigned char)((c>>6) & 0x3F); \
241145 *zOut++ = 0x80 + (unsigned char)(c & 0x3F); \
241147 *zOut++ = 0xF0 + (unsigned char)((c>>18) & 0x07); \
241148 *zOut++ = 0x80 + (unsigned char)((c>>12) & 0x3F); \
241149 *zOut++ = 0x80 + (unsigned char)((c>>6) & 0x3F); \
241150 *zOut++ = 0x80 + (unsigned char)(c & 0x3F); \
241158 unsigned char aTokenChar[128]; /* ASCII range token characters */
241159 char *aFold; /* Buffer to fold text into */
241165 unsigned char aCategory[32]; /* True for token char categories */
241175 const char *z, /* Characters to treat as exceptions */
241187 const unsigned char *zCsr = (const unsigned char*)z;
241188 const unsigned char *zTerm = (const unsigned char*)&z[n];
241194 p->aTokenChar[iCode] = (unsigned char)bTokenChars;
241257 static int unicodeSetCategories(Unicode61Tokenizer *p, const char *zCat){
241258 const char *z = zCat;
241277 const char **azArg, int nArg,
241290 const char *zCat = "L* N* Co";
241296 p->aFold = sqlite3_malloc64(p->nFold * sizeof(char));
241313 const char *zArg = azArg[i+1];
241366 const char *pText, int nText,
241367 int (*xToken)(void*, int, const char*, int nToken, int iStart, int iEnd)
241371 unsigned char *a = p->aTokenChar;
241373 unsigned char *zTerm = (unsigned char*)&pText[nText];
241374 unsigned char *zCsr = (unsigned char *)pText;
241377 char *aFold = p->aFold;
241379 const char *pEnd = &aFold[nFold-6];
241387 char *zOut = aFold;
241397 is = zCsr - (unsigned char*)pText;
241404 is = zCsr - (unsigned char*)pText;
241454 ie = zCsr - (unsigned char*)pText;
241478 char aBuf[FTS5_PORTER_MAX_TOKEN + 64];
241499 const char **azArg, int nArg,
241506 const char *zBase = "unicode61";
241521 const char **azArg2 = (nArg2 ? &azArg[1] : 0);
241536 int (*xToken)(void*, int, const char*, int, int, int);
241537 char *aBuf;
241542 const char *zSuffix;
241544 int (*xCond)(char *zStem, int nStem);
241545 const char *zOutput;
241550 static int fts5PorterApply(char *aBuf, int *pnBuf, PorterRule *aRule){
241575 static int fts5PorterIsVowel(char c, int bYIsVowel){
241581 static int fts5PorterGobbleVC(char *zStem, int nStem, int bPrevCons){
241598 static int fts5Porter_MGt0(char *zStem, int nStem){
241603 static int fts5Porter_MGt1(char *zStem, int nStem){
241613 static int fts5Porter_MEq1(char *zStem, int nStem){
241623 static int fts5Porter_Ostar(char *zStem, int nStem){
241640 static int fts5Porter_MGt1_and_S_or_T(char *zStem, int nStem){
241647 static int fts5Porter_Vowel(char *zStem, int nStem){
241663 static int fts5PorterStep4(char *aBuf, int *pnBuf){
241797 static int fts5PorterStep1B2(char *aBuf, int *pnBuf){
241831 static int fts5PorterStep2(char *aBuf, int *pnBuf){
241978 static int fts5PorterStep3(char *aBuf, int *pnBuf){
242044 static int fts5PorterStep1B(char *aBuf, int *pnBuf){
242081 static void fts5PorterStep1A(char *aBuf, int *pnBuf){
242102 const char *pToken,
242109 char *aBuf;
242121 char c = aBuf[nBuf-1];
242172 const char *pText, int nText,
242173 int (*xToken)(void*, int, const char*, int nToken, int iStart, int iEnd)
242205 const char **azArg,
242218 const char *zArg = azArg[i+1];
242245 const char *pText, int nText,
242246 int (*xToken)(void*, int, const char*, int, int, int)
242250 char aBuf[32];
242251 const unsigned char *zIn = (const unsigned char*)pText;
242252 const unsigned char *zEof = &zIn[nText];
242257 char *zOut = aBuf;
242258 int iStart = zIn - (const unsigned char*)pText;
242259 const unsigned char *zNext;
242302 int (*xCreate)(void*, const char**, int, Fts5Tokenizer**),
242317 const char *zName;
242390 #define HIBIT ((unsigned char)0x80)
242391 unsigned char aChar[] = {
242477 unsigned char flags;
242478 unsigned char nRange;
242551 assert( sizeof(unsigned short)==2 && sizeof(unsigned char)==1 );
242593 static int sqlite3Fts5UnicodeCatParse(const char *zCat, u8 *aArray){
243143 static int sqlite3Fts5GetVarint32(const unsigned char *p, u32 *v){
243221 static u8 sqlite3Fts5GetVarint(const unsigned char *p, u64 *v){
243415 static int FTS5_NOINLINE fts5PutVarint64(unsigned char *p, u64 v){
243440 static int sqlite3Fts5PutVarint(unsigned char *p, u64 v){
243512 char *zFts5Tbl; /* Name of fts5 table */
243513 char *zFts5Db; /* Db containing fts5 table */
243530 char *zLeTerm; /* (term <= $zLeTerm) paramater, or NULL */
243568 static int fts5VocabTableType(const char *zType, char **pzErr, int *peType){
243570 char *zCopy = sqlite3Fts5Strndup(&rc, zType, -1);
243637 const char * const *argv, /* xCreate/xConnect argument array */
243639 char **pzErr /* Write any error message here */
243641 const char *azSchema[] = {
243658 const char *zDb = bDb ? argv[3] : argv[1];
243659 const char *zTab = bDb ? argv[4] : argv[3];
243660 const char *zType = bDb ? argv[5] : argv[4];
243677 pRet->zFts5Tbl = (char*)&pRet[1];
243699 const char * const *argv, /* xCreate/xConnect argument array */
243701 char **pzErr /* OUT: sqlite3_malloc'd error message */
243709 const char * const *argv, /* xCreate/xConnect argument array */
243711 char **pzErr /* OUT: sqlite3_malloc'd error message */
243799 char *zSql = 0;
243889 const char *zTerm;
243961 const char *zTerm;
244068 const char *zUnused, /* Unused */
244079 const char *zTerm = 0;
244094 zTerm = (const char *)sqlite3_value_text(pEq);
244099 zTerm = (const char *)sqlite3_value_text(pGe);
244103 const char *zCopy = (const char *)sqlite3_value_text(pLe);
244156 pCtx, (const char*)pCsr->term.p, pCsr->term.n, SQLITE_TRANSIENT
244162 const char *z = pCsr->pFts5->pConfig->azCol[pCsr->iCol];
244191 const char *z = pCsr->pFts5->pConfig->azCol[ii];
244300 char *zSql; /* column "sql" */
244341 int argc, const char *const*argv,
244343 char **pzErr
244473 int idxNum, const char *idxStr,
244484 const char *zSql = sqlite3_sql(p);
244491 pNew->zSql = (char*)&pNew[1];
244588 char **pzErrMsg,
244603 SQLITE_API const char *sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; }
244616 unsigned char *buffer;
244654 unsigned char *password;
244655 unsigned char *key;
244656 unsigned char *hmacKey;
244657 unsigned char *keyInfo;
244663 unsigned char salt[SALT_SIZE];
244664 unsigned char hmacSalt[SALT_SIZE];
244665 unsigned char *buffer;
244727 CODEC_STATIC void *opensslGetCipher(const char *cipherName){
244735 CODEC_STATIC const char *opensslGetCipherName(void *cipher){
244786 CODEC_STATIC void *opensslGetCtx(void *cipher, int mode, unsigned char *key, unsigned char *initVector){
244797 CODEC_STATIC int opensslCipher(void *iCtx, Buffer *input, unsigned char *output){
244838 PKCS5_PBKDF2_HMAC((const char *)(password->buffer), password->bufferSize, salt->buffer, salt->bufferSize,
244841 PKCS5_PBKDF2_HMAC((const char *)(password->buffer), password->bufferSize, salt->buffer, salt->bufferSize,
244844 PKCS5_PBKDF2_HMAC((const char *)(password->buffer), password->bufferSize, salt->buffer, salt->bufferSize,
244860 CODEC_STATIC int sqlite3CodecIsHex(const unsigned char *buffer, int bufferSize){
244872 CODEC_STATIC int sqlite3CodecHex2int(char input){
244884 CODEC_STATIC void sqlite3CodecHex2Bin(unsigned char *inputBuffer, int inputBuffersize, unsigned char *outputBuffer){
244892 CODEC_STATIC void sqlite3CodecBin2Hex(unsigned char *inputBuffer, int inputBuffersize, unsigned char *outputBuffer){
244893 char *buffer = NULL;
244896 buffer = (char *)(outputBuffer + i * 2);
244902 CODEC_STATIC int sqlite3CodecIfMemset(unsigned char *input, unsigned char val, int len){
244912 CODEC_STATIC int sqlite3CodecIsKeyInfoFormat(const unsigned char *input, int inputSize){
244953 keyCtx->key = (unsigned char *)sqlite3Malloc(keyCtx->codecConst.keySize);
244954 keyCtx->hmacKey = (unsigned char *)sqlite3Malloc(keyCtx->codecConst.keySize);
244955 keyCtx->keyInfo = (unsigned char *)sqlite3Malloc(keyCtx->codecConst.keyInfoSize);
244960 if(memcmp((unsigned char *)first, (unsigned char *)second, sizeof(CodecConstant))){
244987 output->key = (unsigned char *)sqlite3Malloc(output->codecConst.keySize);
244999 output->hmacKey = (unsigned char *)sqlite3Malloc(output->codecConst.keySize);
245011 output->keyInfo = (unsigned char *)sqlite3Malloc(output->codecConst.keyInfoSize);
245048 unsigned char salt[SALT_SIZE];
245131 CODEC_STATIC int sqlite3CodecSetCodecConstant(KeyContext *keyCtx, const char *cipherName){
245173 const char *cipherName;
245181 CODEC_STATIC void sqlite3CodecSetDefaultAttachCipher(const char *cipherName){
245194 CODEC_STATIC const char *sqlite3CodecGetDefaultAttachCipher(){
245195 const char *attachedCipher = CIPHER_NAME_AES_256_GCM;
245264 keyCtx->password = (unsigned char *)sqlite3Malloc(keyCtx->passwordSize);
245310 ctx->buffer = (unsigned char *)sqlite3Malloc(size);
245325 output->password = (unsigned char *)sqlite3Malloc(output->passwordSize);
245419 ctx->buffer = (unsigned char *)sqlite3Malloc(DEFAULT_PAGE_SIZE);
245463 CODEC_STATIC int sqlite3CodecGetDbIndex(sqlite3 *db, const char *zDb){
245469 const char *zDbSName = db->aDb[nDbIndex].zDbSName;
245477 CODEC_STATIC void sqlite3CodecTransPgno(Pgno input, unsigned char *output){
245488 CODEC_STATIC int sqlite3CodecHmac(KeyContext *ctx, Pgno pgno, int bufferSize, unsigned char *input, unsigned char *output){
245496 unsigned char pgnoBuffer[sizeof(Pgno)];
245510 CODEC_STATIC int sqlite3CodecCheckHmac(KeyContext *ctx, Pgno pgno, int bufferSize, unsigned char *input, unsigned char *expectResult){
245516 unsigned char buffer[MAX_HMAC_SIZE];
245523 unsigned char *output = (unsigned char *)malloc(ctx->codecConst.hmacSize);
245538 CODEC_STATIC int sqlite3CodecEncryptData(CodecContext *ctx, OperateContext whichKey, Pgno pgno, int bufferSize, unsigned char *input, unsigned char *output){
245586 CODEC_STATIC int sqlite3CodecDecryptData(CodecContext *ctx, OperateContext whichKey, Pgno pgno, int bufferSize, unsigned char *input, unsigned char *output){
245623 unsigned char *initVector = input + inputBuffer.bufferSize;
245639 unsigned char *pData = (unsigned char *)data;
245661 rc = sqlite3CodecDecryptData(pCtx, OPERATE_CONTEXT_READ, pgno, cipherPageSize - offset, (unsigned char *)(pData + offset), pCtx->buffer + offset);
245676 rc = sqlite3CodecEncryptData(pCtx, OPERATE_CONTEXT_WRITE, pgno, cipherPageSize - offset, (unsigned char *)(pData + offset), pCtx->buffer + offset);
245691 rc = sqlite3CodecEncryptData(pCtx, OPERATE_CONTEXT_READ, pgno, cipherPageSize - offset, (unsigned char *)(pData + offset), pCtx->buffer + offset);
245782 int sqlite3_key_v2(sqlite3 *db, const char *zDb, const void *pKey, int nKey){
245794 int sqlite3_rekey_v2(sqlite3 *db, const char *zDb, const void *pKey, int nKey){
245858 void sqlite3_activate_see(const char* zPassPhrase){
245862 CODEC_STATIC void sqlite3CodecReturnPragmaResult(Parse *parse, const char *label, const char *value){
245872 int sqlite3CodecPragma(sqlite3 *db, int iDb, Parse *parse, const char *zLeft, const char *zRight){
245940 char *iter = sqlite3_mprintf("%d", ctx->writeCtx->iter);
246021 char *pageSize = sqlite3_mprintf("%d", ctx->readCtx->codecConst.cipherPageSize);
246056 CODEC_STATIC int sqlite3CodecExportMetadata(sqlite3 *db, const char *dbName, const char *metaName){
246057 char *sql = sqlite3_mprintf("PRAGMA %s;", metaName);
246084 CODEC_STATIC int sqlite3CodecBatchExportSql(sqlite3 *db, const char *sql, char **errMsg){
246091 rc = sqlite3_exec(db, (char*)sqlite3_column_text(statement, 0), NULL, NULL, errMsg);
246103 const char *dbName = (const char*) sqlite3_value_text(argv[0]);
246106 char *sql = NULL;
246107 char *errMsg = NULL;
246227 const char *lock_type[DB_LOCK_NUM] = {"F_RDLCK", "F_WRLCK", "F_UNLCK"};
246239 const char *lock_name_list[DB_LOCK_NUM] = {"pending lock ", "reserved lock", "shared lock "};
246261 char *lock_name_list_wal[WAL_LOCK_NUM] = {"wal_write lock ", "wal_ckpt lock ", "wal_recover lock"};
246330 int (*key_v2)(sqlite3*,const char*,const void*,int);
246332 int (*rekey_v2)(sqlite3*,const char*,const void*,int);