Fossil SCM
Update the built-in SQLite to version 3.9.0 plus a few minor fixes for harmless details.
Commit
bc16590e21e0e0e9f2f19f2f7a74f8c0956ff9bd
Parent
47ee063e83a86a4…
2 files changed
+201
-204
+1
-2
+201
-204
| --- src/sqlite3.c | ||
| +++ src/sqlite3.c | ||
| @@ -325,11 +325,11 @@ | ||
| 325 | 325 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 326 | 326 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 327 | 327 | */ |
| 328 | 328 | #define SQLITE_VERSION "3.9.0" |
| 329 | 329 | #define SQLITE_VERSION_NUMBER 3009000 |
| 330 | -#define SQLITE_SOURCE_ID "2015-10-14 12:29:53 a721fc0d89495518fe5612e2e3bbc60befd2e90d" | |
| 330 | +#define SQLITE_SOURCE_ID "2015-10-15 12:06:11 a61880c223c2229ecc3b4da7e5647eca17f7ddf5" | |
| 331 | 331 | |
| 332 | 332 | /* |
| 333 | 333 | ** CAPI3REF: Run-Time Library Version Numbers |
| 334 | 334 | ** KEYWORDS: sqlite3_version, sqlite3_sourceid |
| 335 | 335 | ** |
| @@ -8156,11 +8156,10 @@ | ||
| 8156 | 8156 | |
| 8157 | 8157 | |
| 8158 | 8158 | #ifndef _FTS5_H |
| 8159 | 8159 | #define _FTS5_H |
| 8160 | 8160 | |
| 8161 | -/* #include "sqlite3.h" */ | |
| 8162 | 8161 | |
| 8163 | 8162 | #if 0 |
| 8164 | 8163 | extern "C" { |
| 8165 | 8164 | #endif |
| 8166 | 8165 | |
| @@ -10431,11 +10430,11 @@ | ||
| 10431 | 10430 | ** header file that defines a number for each opcode used by the VDBE. |
| 10432 | 10431 | */ |
| 10433 | 10432 | /************** Include opcodes.h in the middle of vdbe.h ********************/ |
| 10434 | 10433 | /************** Begin file opcodes.h *****************************************/ |
| 10435 | 10434 | /* Automatically generated. Do not edit */ |
| 10436 | -/* See the mkopcodeh.awk script for details */ | |
| 10435 | +/* See the tool/mkopcodeh.tcl script for details */ | |
| 10437 | 10436 | #define OP_Savepoint 1 |
| 10438 | 10437 | #define OP_AutoCommit 2 |
| 10439 | 10438 | #define OP_Transaction 3 |
| 10440 | 10439 | #define OP_SorterNext 4 |
| 10441 | 10440 | #define OP_PrevIfOpen 5 |
| @@ -10592,11 +10591,10 @@ | ||
| 10592 | 10591 | #define OP_Pagecount 156 |
| 10593 | 10592 | #define OP_MaxPgcnt 157 |
| 10594 | 10593 | #define OP_Init 158 /* synopsis: Start at P2 */ |
| 10595 | 10594 | #define OP_Noop 159 |
| 10596 | 10595 | #define OP_Explain 160 |
| 10597 | - | |
| 10598 | 10596 | |
| 10599 | 10597 | /* Properties such as "out2" or "jump" that are specified in |
| 10600 | 10598 | ** comments following the "case" for each opcode in the vdbe.c |
| 10601 | 10599 | ** are encoded into bitvectors as follows: |
| 10602 | 10600 | */ |
| @@ -26245,179 +26243,181 @@ | ||
| 26245 | 26243 | } |
| 26246 | 26244 | |
| 26247 | 26245 | /************** End of hash.c ************************************************/ |
| 26248 | 26246 | /************** Begin file opcodes.c *****************************************/ |
| 26249 | 26247 | /* Automatically generated. Do not edit */ |
| 26250 | -/* See the mkopcodec.awk script for details. */ | |
| 26251 | -#if !defined(SQLITE_OMIT_EXPLAIN) || defined(VDBE_PROFILE) || defined(SQLITE_DEBUG) | |
| 26248 | +/* See the tool/mkopcodec.tcl script for details. */ | |
| 26249 | +#if !defined(SQLITE_OMIT_EXPLAIN) \ | |
| 26250 | + || defined(VDBE_PROFILE) \ | |
| 26251 | + || defined(SQLITE_DEBUG) | |
| 26252 | 26252 | #if defined(SQLITE_ENABLE_EXPLAIN_COMMENTS) || defined(SQLITE_DEBUG) |
| 26253 | 26253 | # define OpHelp(X) "\0" X |
| 26254 | 26254 | #else |
| 26255 | 26255 | # define OpHelp(X) |
| 26256 | 26256 | #endif |
| 26257 | 26257 | SQLITE_PRIVATE const char *sqlite3OpcodeName(int i){ |
| 26258 | 26258 | static const char *const azName[] = { "?", |
| 26259 | - /* 1 */ "Savepoint" OpHelp(""), | |
| 26260 | - /* 2 */ "AutoCommit" OpHelp(""), | |
| 26261 | - /* 3 */ "Transaction" OpHelp(""), | |
| 26262 | - /* 4 */ "SorterNext" OpHelp(""), | |
| 26263 | - /* 5 */ "PrevIfOpen" OpHelp(""), | |
| 26264 | - /* 6 */ "NextIfOpen" OpHelp(""), | |
| 26265 | - /* 7 */ "Prev" OpHelp(""), | |
| 26266 | - /* 8 */ "Next" OpHelp(""), | |
| 26267 | - /* 9 */ "Checkpoint" OpHelp(""), | |
| 26268 | - /* 10 */ "JournalMode" OpHelp(""), | |
| 26269 | - /* 11 */ "Vacuum" OpHelp(""), | |
| 26270 | - /* 12 */ "VFilter" OpHelp("iplan=r[P3] zplan='P4'"), | |
| 26271 | - /* 13 */ "VUpdate" OpHelp("data=r[P3@P2]"), | |
| 26272 | - /* 14 */ "Goto" OpHelp(""), | |
| 26273 | - /* 15 */ "Gosub" OpHelp(""), | |
| 26274 | - /* 16 */ "Return" OpHelp(""), | |
| 26275 | - /* 17 */ "InitCoroutine" OpHelp(""), | |
| 26276 | - /* 18 */ "EndCoroutine" OpHelp(""), | |
| 26277 | - /* 19 */ "Not" OpHelp("r[P2]= !r[P1]"), | |
| 26278 | - /* 20 */ "Yield" OpHelp(""), | |
| 26279 | - /* 21 */ "HaltIfNull" OpHelp("if r[P3]=null halt"), | |
| 26280 | - /* 22 */ "Halt" OpHelp(""), | |
| 26281 | - /* 23 */ "Integer" OpHelp("r[P2]=P1"), | |
| 26282 | - /* 24 */ "Int64" OpHelp("r[P2]=P4"), | |
| 26283 | - /* 25 */ "String" OpHelp("r[P2]='P4' (len=P1)"), | |
| 26284 | - /* 26 */ "Null" OpHelp("r[P2..P3]=NULL"), | |
| 26285 | - /* 27 */ "SoftNull" OpHelp("r[P1]=NULL"), | |
| 26286 | - /* 28 */ "Blob" OpHelp("r[P2]=P4 (len=P1)"), | |
| 26287 | - /* 29 */ "Variable" OpHelp("r[P2]=parameter(P1,P4)"), | |
| 26288 | - /* 30 */ "Move" OpHelp("r[P2@P3]=r[P1@P3]"), | |
| 26289 | - /* 31 */ "Copy" OpHelp("r[P2@P3+1]=r[P1@P3+1]"), | |
| 26290 | - /* 32 */ "SCopy" OpHelp("r[P2]=r[P1]"), | |
| 26291 | - /* 33 */ "ResultRow" OpHelp("output=r[P1@P2]"), | |
| 26292 | - /* 34 */ "CollSeq" OpHelp(""), | |
| 26293 | - /* 35 */ "Function0" OpHelp("r[P3]=func(r[P2@P5])"), | |
| 26294 | - /* 36 */ "Function" OpHelp("r[P3]=func(r[P2@P5])"), | |
| 26295 | - /* 37 */ "AddImm" OpHelp("r[P1]=r[P1]+P2"), | |
| 26296 | - /* 38 */ "MustBeInt" OpHelp(""), | |
| 26297 | - /* 39 */ "RealAffinity" OpHelp(""), | |
| 26298 | - /* 40 */ "Cast" OpHelp("affinity(r[P1])"), | |
| 26299 | - /* 41 */ "Permutation" OpHelp(""), | |
| 26300 | - /* 42 */ "Compare" OpHelp("r[P1@P3] <-> r[P2@P3]"), | |
| 26301 | - /* 43 */ "Jump" OpHelp(""), | |
| 26302 | - /* 44 */ "Once" OpHelp(""), | |
| 26303 | - /* 45 */ "If" OpHelp(""), | |
| 26304 | - /* 46 */ "IfNot" OpHelp(""), | |
| 26305 | - /* 47 */ "Column" OpHelp("r[P3]=PX"), | |
| 26306 | - /* 48 */ "Affinity" OpHelp("affinity(r[P1@P2])"), | |
| 26307 | - /* 49 */ "MakeRecord" OpHelp("r[P3]=mkrec(r[P1@P2])"), | |
| 26308 | - /* 50 */ "Count" OpHelp("r[P2]=count()"), | |
| 26309 | - /* 51 */ "ReadCookie" OpHelp(""), | |
| 26310 | - /* 52 */ "SetCookie" OpHelp(""), | |
| 26311 | - /* 53 */ "ReopenIdx" OpHelp("root=P2 iDb=P3"), | |
| 26312 | - /* 54 */ "OpenRead" OpHelp("root=P2 iDb=P3"), | |
| 26313 | - /* 55 */ "OpenWrite" OpHelp("root=P2 iDb=P3"), | |
| 26314 | - /* 56 */ "OpenAutoindex" OpHelp("nColumn=P2"), | |
| 26315 | - /* 57 */ "OpenEphemeral" OpHelp("nColumn=P2"), | |
| 26316 | - /* 58 */ "SorterOpen" OpHelp(""), | |
| 26317 | - /* 59 */ "SequenceTest" OpHelp("if( cursor[P1].ctr++ ) pc = P2"), | |
| 26318 | - /* 60 */ "OpenPseudo" OpHelp("P3 columns in r[P2]"), | |
| 26319 | - /* 61 */ "Close" OpHelp(""), | |
| 26320 | - /* 62 */ "ColumnsUsed" OpHelp(""), | |
| 26321 | - /* 63 */ "SeekLT" OpHelp("key=r[P3@P4]"), | |
| 26322 | - /* 64 */ "SeekLE" OpHelp("key=r[P3@P4]"), | |
| 26323 | - /* 65 */ "SeekGE" OpHelp("key=r[P3@P4]"), | |
| 26324 | - /* 66 */ "SeekGT" OpHelp("key=r[P3@P4]"), | |
| 26325 | - /* 67 */ "Seek" OpHelp("intkey=r[P2]"), | |
| 26326 | - /* 68 */ "NoConflict" OpHelp("key=r[P3@P4]"), | |
| 26327 | - /* 69 */ "NotFound" OpHelp("key=r[P3@P4]"), | |
| 26328 | - /* 70 */ "Found" OpHelp("key=r[P3@P4]"), | |
| 26329 | - /* 71 */ "Or" OpHelp("r[P3]=(r[P1] || r[P2])"), | |
| 26330 | - /* 72 */ "And" OpHelp("r[P3]=(r[P1] && r[P2])"), | |
| 26331 | - /* 73 */ "NotExists" OpHelp("intkey=r[P3]"), | |
| 26332 | - /* 74 */ "Sequence" OpHelp("r[P2]=cursor[P1].ctr++"), | |
| 26333 | - /* 75 */ "NewRowid" OpHelp("r[P2]=rowid"), | |
| 26334 | - /* 76 */ "IsNull" OpHelp("if r[P1]==NULL goto P2"), | |
| 26335 | - /* 77 */ "NotNull" OpHelp("if r[P1]!=NULL goto P2"), | |
| 26336 | - /* 78 */ "Ne" OpHelp("if r[P1]!=r[P3] goto P2"), | |
| 26337 | - /* 79 */ "Eq" OpHelp("if r[P1]==r[P3] goto P2"), | |
| 26338 | - /* 80 */ "Gt" OpHelp("if r[P1]>r[P3] goto P2"), | |
| 26339 | - /* 81 */ "Le" OpHelp("if r[P1]<=r[P3] goto P2"), | |
| 26340 | - /* 82 */ "Lt" OpHelp("if r[P1]<r[P3] goto P2"), | |
| 26341 | - /* 83 */ "Ge" OpHelp("if r[P1]>=r[P3] goto P2"), | |
| 26342 | - /* 84 */ "Insert" OpHelp("intkey=r[P3] data=r[P2]"), | |
| 26343 | - /* 85 */ "BitAnd" OpHelp("r[P3]=r[P1]&r[P2]"), | |
| 26344 | - /* 86 */ "BitOr" OpHelp("r[P3]=r[P1]|r[P2]"), | |
| 26345 | - /* 87 */ "ShiftLeft" OpHelp("r[P3]=r[P2]<<r[P1]"), | |
| 26346 | - /* 88 */ "ShiftRight" OpHelp("r[P3]=r[P2]>>r[P1]"), | |
| 26347 | - /* 89 */ "Add" OpHelp("r[P3]=r[P1]+r[P2]"), | |
| 26348 | - /* 90 */ "Subtract" OpHelp("r[P3]=r[P2]-r[P1]"), | |
| 26349 | - /* 91 */ "Multiply" OpHelp("r[P3]=r[P1]*r[P2]"), | |
| 26350 | - /* 92 */ "Divide" OpHelp("r[P3]=r[P2]/r[P1]"), | |
| 26351 | - /* 93 */ "Remainder" OpHelp("r[P3]=r[P2]%r[P1]"), | |
| 26352 | - /* 94 */ "Concat" OpHelp("r[P3]=r[P2]+r[P1]"), | |
| 26353 | - /* 95 */ "InsertInt" OpHelp("intkey=P3 data=r[P2]"), | |
| 26354 | - /* 96 */ "BitNot" OpHelp("r[P1]= ~r[P1]"), | |
| 26355 | - /* 97 */ "String8" OpHelp("r[P2]='P4'"), | |
| 26356 | - /* 98 */ "Delete" OpHelp(""), | |
| 26357 | - /* 99 */ "ResetCount" OpHelp(""), | |
| 26358 | - /* 100 */ "SorterCompare" OpHelp("if key(P1)!=trim(r[P3],P4) goto P2"), | |
| 26359 | - /* 101 */ "SorterData" OpHelp("r[P2]=data"), | |
| 26360 | - /* 102 */ "RowKey" OpHelp("r[P2]=key"), | |
| 26361 | - /* 103 */ "RowData" OpHelp("r[P2]=data"), | |
| 26362 | - /* 104 */ "Rowid" OpHelp("r[P2]=rowid"), | |
| 26363 | - /* 105 */ "NullRow" OpHelp(""), | |
| 26364 | - /* 106 */ "Last" OpHelp(""), | |
| 26365 | - /* 107 */ "SorterSort" OpHelp(""), | |
| 26366 | - /* 108 */ "Sort" OpHelp(""), | |
| 26367 | - /* 109 */ "Rewind" OpHelp(""), | |
| 26368 | - /* 110 */ "SorterInsert" OpHelp(""), | |
| 26369 | - /* 111 */ "IdxInsert" OpHelp("key=r[P2]"), | |
| 26370 | - /* 112 */ "IdxDelete" OpHelp("key=r[P2@P3]"), | |
| 26371 | - /* 113 */ "IdxRowid" OpHelp("r[P2]=rowid"), | |
| 26372 | - /* 114 */ "IdxLE" OpHelp("key=r[P3@P4]"), | |
| 26373 | - /* 115 */ "IdxGT" OpHelp("key=r[P3@P4]"), | |
| 26374 | - /* 116 */ "IdxLT" OpHelp("key=r[P3@P4]"), | |
| 26375 | - /* 117 */ "IdxGE" OpHelp("key=r[P3@P4]"), | |
| 26376 | - /* 118 */ "Destroy" OpHelp(""), | |
| 26377 | - /* 119 */ "Clear" OpHelp(""), | |
| 26378 | - /* 120 */ "ResetSorter" OpHelp(""), | |
| 26379 | - /* 121 */ "CreateIndex" OpHelp("r[P2]=root iDb=P1"), | |
| 26380 | - /* 122 */ "CreateTable" OpHelp("r[P2]=root iDb=P1"), | |
| 26381 | - /* 123 */ "ParseSchema" OpHelp(""), | |
| 26382 | - /* 124 */ "LoadAnalysis" OpHelp(""), | |
| 26383 | - /* 125 */ "DropTable" OpHelp(""), | |
| 26384 | - /* 126 */ "DropIndex" OpHelp(""), | |
| 26385 | - /* 127 */ "DropTrigger" OpHelp(""), | |
| 26386 | - /* 128 */ "IntegrityCk" OpHelp(""), | |
| 26387 | - /* 129 */ "RowSetAdd" OpHelp("rowset(P1)=r[P2]"), | |
| 26388 | - /* 130 */ "RowSetRead" OpHelp("r[P3]=rowset(P1)"), | |
| 26389 | - /* 131 */ "RowSetTest" OpHelp("if r[P3] in rowset(P1) goto P2"), | |
| 26390 | - /* 132 */ "Program" OpHelp(""), | |
| 26391 | - /* 133 */ "Real" OpHelp("r[P2]=P4"), | |
| 26392 | - /* 134 */ "Param" OpHelp(""), | |
| 26393 | - /* 135 */ "FkCounter" OpHelp("fkctr[P1]+=P2"), | |
| 26394 | - /* 136 */ "FkIfZero" OpHelp("if fkctr[P1]==0 goto P2"), | |
| 26395 | - /* 137 */ "MemMax" OpHelp("r[P1]=max(r[P1],r[P2])"), | |
| 26396 | - /* 138 */ "IfPos" OpHelp("if r[P1]>0 then r[P1]-=P3, goto P2"), | |
| 26397 | - /* 139 */ "SetIfNotPos" OpHelp("if r[P1]<=0 then r[P2]=P3"), | |
| 26398 | - /* 140 */ "IfNotZero" OpHelp("if r[P1]!=0 then r[P1]-=P3, goto P2"), | |
| 26399 | - /* 141 */ "DecrJumpZero" OpHelp("if (--r[P1])==0 goto P2"), | |
| 26400 | - /* 142 */ "JumpZeroIncr" OpHelp("if (r[P1]++)==0 ) goto P2"), | |
| 26401 | - /* 143 */ "AggStep0" OpHelp("accum=r[P3] step(r[P2@P5])"), | |
| 26402 | - /* 144 */ "AggStep" OpHelp("accum=r[P3] step(r[P2@P5])"), | |
| 26403 | - /* 145 */ "AggFinal" OpHelp("accum=r[P1] N=P2"), | |
| 26404 | - /* 146 */ "IncrVacuum" OpHelp(""), | |
| 26405 | - /* 147 */ "Expire" OpHelp(""), | |
| 26406 | - /* 148 */ "TableLock" OpHelp("iDb=P1 root=P2 write=P3"), | |
| 26407 | - /* 149 */ "VBegin" OpHelp(""), | |
| 26408 | - /* 150 */ "VCreate" OpHelp(""), | |
| 26409 | - /* 151 */ "VDestroy" OpHelp(""), | |
| 26410 | - /* 152 */ "VOpen" OpHelp(""), | |
| 26411 | - /* 153 */ "VColumn" OpHelp("r[P3]=vcolumn(P2)"), | |
| 26412 | - /* 154 */ "VNext" OpHelp(""), | |
| 26413 | - /* 155 */ "VRename" OpHelp(""), | |
| 26414 | - /* 156 */ "Pagecount" OpHelp(""), | |
| 26415 | - /* 157 */ "MaxPgcnt" OpHelp(""), | |
| 26416 | - /* 158 */ "Init" OpHelp("Start at P2"), | |
| 26417 | - /* 159 */ "Noop" OpHelp(""), | |
| 26418 | - /* 160 */ "Explain" OpHelp(""), | |
| 26259 | + /* 1 */ "Savepoint" OpHelp(""), | |
| 26260 | + /* 2 */ "AutoCommit" OpHelp(""), | |
| 26261 | + /* 3 */ "Transaction" OpHelp(""), | |
| 26262 | + /* 4 */ "SorterNext" OpHelp(""), | |
| 26263 | + /* 5 */ "PrevIfOpen" OpHelp(""), | |
| 26264 | + /* 6 */ "NextIfOpen" OpHelp(""), | |
| 26265 | + /* 7 */ "Prev" OpHelp(""), | |
| 26266 | + /* 8 */ "Next" OpHelp(""), | |
| 26267 | + /* 9 */ "Checkpoint" OpHelp(""), | |
| 26268 | + /* 10 */ "JournalMode" OpHelp(""), | |
| 26269 | + /* 11 */ "Vacuum" OpHelp(""), | |
| 26270 | + /* 12 */ "VFilter" OpHelp("iplan=r[P3] zplan='P4'"), | |
| 26271 | + /* 13 */ "VUpdate" OpHelp("data=r[P3@P2]"), | |
| 26272 | + /* 14 */ "Goto" OpHelp(""), | |
| 26273 | + /* 15 */ "Gosub" OpHelp(""), | |
| 26274 | + /* 16 */ "Return" OpHelp(""), | |
| 26275 | + /* 17 */ "InitCoroutine" OpHelp(""), | |
| 26276 | + /* 18 */ "EndCoroutine" OpHelp(""), | |
| 26277 | + /* 19 */ "Not" OpHelp("r[P2]= !r[P1]"), | |
| 26278 | + /* 20 */ "Yield" OpHelp(""), | |
| 26279 | + /* 21 */ "HaltIfNull" OpHelp("if r[P3]=null halt"), | |
| 26280 | + /* 22 */ "Halt" OpHelp(""), | |
| 26281 | + /* 23 */ "Integer" OpHelp("r[P2]=P1"), | |
| 26282 | + /* 24 */ "Int64" OpHelp("r[P2]=P4"), | |
| 26283 | + /* 25 */ "String" OpHelp("r[P2]='P4' (len=P1)"), | |
| 26284 | + /* 26 */ "Null" OpHelp("r[P2..P3]=NULL"), | |
| 26285 | + /* 27 */ "SoftNull" OpHelp("r[P1]=NULL"), | |
| 26286 | + /* 28 */ "Blob" OpHelp("r[P2]=P4 (len=P1)"), | |
| 26287 | + /* 29 */ "Variable" OpHelp("r[P2]=parameter(P1,P4)"), | |
| 26288 | + /* 30 */ "Move" OpHelp("r[P2@P3]=r[P1@P3]"), | |
| 26289 | + /* 31 */ "Copy" OpHelp("r[P2@P3+1]=r[P1@P3+1]"), | |
| 26290 | + /* 32 */ "SCopy" OpHelp("r[P2]=r[P1]"), | |
| 26291 | + /* 33 */ "ResultRow" OpHelp("output=r[P1@P2]"), | |
| 26292 | + /* 34 */ "CollSeq" OpHelp(""), | |
| 26293 | + /* 35 */ "Function0" OpHelp("r[P3]=func(r[P2@P5])"), | |
| 26294 | + /* 36 */ "Function" OpHelp("r[P3]=func(r[P2@P5])"), | |
| 26295 | + /* 37 */ "AddImm" OpHelp("r[P1]=r[P1]+P2"), | |
| 26296 | + /* 38 */ "MustBeInt" OpHelp(""), | |
| 26297 | + /* 39 */ "RealAffinity" OpHelp(""), | |
| 26298 | + /* 40 */ "Cast" OpHelp("affinity(r[P1])"), | |
| 26299 | + /* 41 */ "Permutation" OpHelp(""), | |
| 26300 | + /* 42 */ "Compare" OpHelp("r[P1@P3] <-> r[P2@P3]"), | |
| 26301 | + /* 43 */ "Jump" OpHelp(""), | |
| 26302 | + /* 44 */ "Once" OpHelp(""), | |
| 26303 | + /* 45 */ "If" OpHelp(""), | |
| 26304 | + /* 46 */ "IfNot" OpHelp(""), | |
| 26305 | + /* 47 */ "Column" OpHelp("r[P3]=PX"), | |
| 26306 | + /* 48 */ "Affinity" OpHelp("affinity(r[P1@P2])"), | |
| 26307 | + /* 49 */ "MakeRecord" OpHelp("r[P3]=mkrec(r[P1@P2])"), | |
| 26308 | + /* 50 */ "Count" OpHelp("r[P2]=count()"), | |
| 26309 | + /* 51 */ "ReadCookie" OpHelp(""), | |
| 26310 | + /* 52 */ "SetCookie" OpHelp(""), | |
| 26311 | + /* 53 */ "ReopenIdx" OpHelp("root=P2 iDb=P3"), | |
| 26312 | + /* 54 */ "OpenRead" OpHelp("root=P2 iDb=P3"), | |
| 26313 | + /* 55 */ "OpenWrite" OpHelp("root=P2 iDb=P3"), | |
| 26314 | + /* 56 */ "OpenAutoindex" OpHelp("nColumn=P2"), | |
| 26315 | + /* 57 */ "OpenEphemeral" OpHelp("nColumn=P2"), | |
| 26316 | + /* 58 */ "SorterOpen" OpHelp(""), | |
| 26317 | + /* 59 */ "SequenceTest" OpHelp("if( cursor[P1].ctr++ ) pc = P2"), | |
| 26318 | + /* 60 */ "OpenPseudo" OpHelp("P3 columns in r[P2]"), | |
| 26319 | + /* 61 */ "Close" OpHelp(""), | |
| 26320 | + /* 62 */ "ColumnsUsed" OpHelp(""), | |
| 26321 | + /* 63 */ "SeekLT" OpHelp("key=r[P3@P4]"), | |
| 26322 | + /* 64 */ "SeekLE" OpHelp("key=r[P3@P4]"), | |
| 26323 | + /* 65 */ "SeekGE" OpHelp("key=r[P3@P4]"), | |
| 26324 | + /* 66 */ "SeekGT" OpHelp("key=r[P3@P4]"), | |
| 26325 | + /* 67 */ "Seek" OpHelp("intkey=r[P2]"), | |
| 26326 | + /* 68 */ "NoConflict" OpHelp("key=r[P3@P4]"), | |
| 26327 | + /* 69 */ "NotFound" OpHelp("key=r[P3@P4]"), | |
| 26328 | + /* 70 */ "Found" OpHelp("key=r[P3@P4]"), | |
| 26329 | + /* 71 */ "Or" OpHelp("r[P3]=(r[P1] || r[P2])"), | |
| 26330 | + /* 72 */ "And" OpHelp("r[P3]=(r[P1] && r[P2])"), | |
| 26331 | + /* 73 */ "NotExists" OpHelp("intkey=r[P3]"), | |
| 26332 | + /* 74 */ "Sequence" OpHelp("r[P2]=cursor[P1].ctr++"), | |
| 26333 | + /* 75 */ "NewRowid" OpHelp("r[P2]=rowid"), | |
| 26334 | + /* 76 */ "IsNull" OpHelp("if r[P1]==NULL goto P2"), | |
| 26335 | + /* 77 */ "NotNull" OpHelp("if r[P1]!=NULL goto P2"), | |
| 26336 | + /* 78 */ "Ne" OpHelp("if r[P1]!=r[P3] goto P2"), | |
| 26337 | + /* 79 */ "Eq" OpHelp("if r[P1]==r[P3] goto P2"), | |
| 26338 | + /* 80 */ "Gt" OpHelp("if r[P1]>r[P3] goto P2"), | |
| 26339 | + /* 81 */ "Le" OpHelp("if r[P1]<=r[P3] goto P2"), | |
| 26340 | + /* 82 */ "Lt" OpHelp("if r[P1]<r[P3] goto P2"), | |
| 26341 | + /* 83 */ "Ge" OpHelp("if r[P1]>=r[P3] goto P2"), | |
| 26342 | + /* 84 */ "Insert" OpHelp("intkey=r[P3] data=r[P2]"), | |
| 26343 | + /* 85 */ "BitAnd" OpHelp("r[P3]=r[P1]&r[P2]"), | |
| 26344 | + /* 86 */ "BitOr" OpHelp("r[P3]=r[P1]|r[P2]"), | |
| 26345 | + /* 87 */ "ShiftLeft" OpHelp("r[P3]=r[P2]<<r[P1]"), | |
| 26346 | + /* 88 */ "ShiftRight" OpHelp("r[P3]=r[P2]>>r[P1]"), | |
| 26347 | + /* 89 */ "Add" OpHelp("r[P3]=r[P1]+r[P2]"), | |
| 26348 | + /* 90 */ "Subtract" OpHelp("r[P3]=r[P2]-r[P1]"), | |
| 26349 | + /* 91 */ "Multiply" OpHelp("r[P3]=r[P1]*r[P2]"), | |
| 26350 | + /* 92 */ "Divide" OpHelp("r[P3]=r[P2]/r[P1]"), | |
| 26351 | + /* 93 */ "Remainder" OpHelp("r[P3]=r[P2]%r[P1]"), | |
| 26352 | + /* 94 */ "Concat" OpHelp("r[P3]=r[P2]+r[P1]"), | |
| 26353 | + /* 95 */ "InsertInt" OpHelp("intkey=P3 data=r[P2]"), | |
| 26354 | + /* 96 */ "BitNot" OpHelp("r[P1]= ~r[P1]"), | |
| 26355 | + /* 97 */ "String8" OpHelp("r[P2]='P4'"), | |
| 26356 | + /* 98 */ "Delete" OpHelp(""), | |
| 26357 | + /* 99 */ "ResetCount" OpHelp(""), | |
| 26358 | + /* 100 */ "SorterCompare" OpHelp("if key(P1)!=trim(r[P3],P4) goto P2"), | |
| 26359 | + /* 101 */ "SorterData" OpHelp("r[P2]=data"), | |
| 26360 | + /* 102 */ "RowKey" OpHelp("r[P2]=key"), | |
| 26361 | + /* 103 */ "RowData" OpHelp("r[P2]=data"), | |
| 26362 | + /* 104 */ "Rowid" OpHelp("r[P2]=rowid"), | |
| 26363 | + /* 105 */ "NullRow" OpHelp(""), | |
| 26364 | + /* 106 */ "Last" OpHelp(""), | |
| 26365 | + /* 107 */ "SorterSort" OpHelp(""), | |
| 26366 | + /* 108 */ "Sort" OpHelp(""), | |
| 26367 | + /* 109 */ "Rewind" OpHelp(""), | |
| 26368 | + /* 110 */ "SorterInsert" OpHelp(""), | |
| 26369 | + /* 111 */ "IdxInsert" OpHelp("key=r[P2]"), | |
| 26370 | + /* 112 */ "IdxDelete" OpHelp("key=r[P2@P3]"), | |
| 26371 | + /* 113 */ "IdxRowid" OpHelp("r[P2]=rowid"), | |
| 26372 | + /* 114 */ "IdxLE" OpHelp("key=r[P3@P4]"), | |
| 26373 | + /* 115 */ "IdxGT" OpHelp("key=r[P3@P4]"), | |
| 26374 | + /* 116 */ "IdxLT" OpHelp("key=r[P3@P4]"), | |
| 26375 | + /* 117 */ "IdxGE" OpHelp("key=r[P3@P4]"), | |
| 26376 | + /* 118 */ "Destroy" OpHelp(""), | |
| 26377 | + /* 119 */ "Clear" OpHelp(""), | |
| 26378 | + /* 120 */ "ResetSorter" OpHelp(""), | |
| 26379 | + /* 121 */ "CreateIndex" OpHelp("r[P2]=root iDb=P1"), | |
| 26380 | + /* 122 */ "CreateTable" OpHelp("r[P2]=root iDb=P1"), | |
| 26381 | + /* 123 */ "ParseSchema" OpHelp(""), | |
| 26382 | + /* 124 */ "LoadAnalysis" OpHelp(""), | |
| 26383 | + /* 125 */ "DropTable" OpHelp(""), | |
| 26384 | + /* 126 */ "DropIndex" OpHelp(""), | |
| 26385 | + /* 127 */ "DropTrigger" OpHelp(""), | |
| 26386 | + /* 128 */ "IntegrityCk" OpHelp(""), | |
| 26387 | + /* 129 */ "RowSetAdd" OpHelp("rowset(P1)=r[P2]"), | |
| 26388 | + /* 130 */ "RowSetRead" OpHelp("r[P3]=rowset(P1)"), | |
| 26389 | + /* 131 */ "RowSetTest" OpHelp("if r[P3] in rowset(P1) goto P2"), | |
| 26390 | + /* 132 */ "Program" OpHelp(""), | |
| 26391 | + /* 133 */ "Real" OpHelp("r[P2]=P4"), | |
| 26392 | + /* 134 */ "Param" OpHelp(""), | |
| 26393 | + /* 135 */ "FkCounter" OpHelp("fkctr[P1]+=P2"), | |
| 26394 | + /* 136 */ "FkIfZero" OpHelp("if fkctr[P1]==0 goto P2"), | |
| 26395 | + /* 137 */ "MemMax" OpHelp("r[P1]=max(r[P1],r[P2])"), | |
| 26396 | + /* 138 */ "IfPos" OpHelp("if r[P1]>0 then r[P1]-=P3, goto P2"), | |
| 26397 | + /* 139 */ "SetIfNotPos" OpHelp("if r[P1]<=0 then r[P2]=P3"), | |
| 26398 | + /* 140 */ "IfNotZero" OpHelp("if r[P1]!=0 then r[P1]-=P3, goto P2"), | |
| 26399 | + /* 141 */ "DecrJumpZero" OpHelp("if (--r[P1])==0 goto P2"), | |
| 26400 | + /* 142 */ "JumpZeroIncr" OpHelp("if (r[P1]++)==0 ) goto P2"), | |
| 26401 | + /* 143 */ "AggStep0" OpHelp("accum=r[P3] step(r[P2@P5])"), | |
| 26402 | + /* 144 */ "AggStep" OpHelp("accum=r[P3] step(r[P2@P5])"), | |
| 26403 | + /* 145 */ "AggFinal" OpHelp("accum=r[P1] N=P2"), | |
| 26404 | + /* 146 */ "IncrVacuum" OpHelp(""), | |
| 26405 | + /* 147 */ "Expire" OpHelp(""), | |
| 26406 | + /* 148 */ "TableLock" OpHelp("iDb=P1 root=P2 write=P3"), | |
| 26407 | + /* 149 */ "VBegin" OpHelp(""), | |
| 26408 | + /* 150 */ "VCreate" OpHelp(""), | |
| 26409 | + /* 151 */ "VDestroy" OpHelp(""), | |
| 26410 | + /* 152 */ "VOpen" OpHelp(""), | |
| 26411 | + /* 153 */ "VColumn" OpHelp("r[P3]=vcolumn(P2)"), | |
| 26412 | + /* 154 */ "VNext" OpHelp(""), | |
| 26413 | + /* 155 */ "VRename" OpHelp(""), | |
| 26414 | + /* 156 */ "Pagecount" OpHelp(""), | |
| 26415 | + /* 157 */ "MaxPgcnt" OpHelp(""), | |
| 26416 | + /* 158 */ "Init" OpHelp("Start at P2"), | |
| 26417 | + /* 159 */ "Noop" OpHelp(""), | |
| 26418 | + /* 160 */ "Explain" OpHelp(""), | |
| 26419 | 26419 | }; |
| 26420 | 26420 | return azName[i]; |
| 26421 | 26421 | } |
| 26422 | 26422 | #endif |
| 26423 | 26423 | |
| @@ -81055,11 +81055,11 @@ | ||
| 81055 | 81055 | pKeyInfo->nXField += (pKeyInfo->nField - nField); |
| 81056 | 81056 | pKeyInfo->nField = nField; |
| 81057 | 81057 | } |
| 81058 | 81058 | pSorter->pgsz = pgsz = sqlite3BtreeGetPageSize(db->aDb[0].pBt); |
| 81059 | 81059 | pSorter->nTask = nWorker + 1; |
| 81060 | - pSorter->iPrev = nWorker-1; | |
| 81060 | + pSorter->iPrev = (u8)(nWorker - 1); | |
| 81061 | 81061 | pSorter->bUseThreads = (pSorter->nTask>1); |
| 81062 | 81062 | pSorter->db = db; |
| 81063 | 81063 | for(i=0; i<pSorter->nTask; i++){ |
| 81064 | 81064 | SortSubtask *pTask = &pSorter->aTask[i]; |
| 81065 | 81065 | pTask->pSorter = pSorter; |
| @@ -105178,11 +105178,11 @@ | ||
| 105178 | 105178 | ** loading is supported. We need a dummy sqlite3Apis pointer for that |
| 105179 | 105179 | ** code if regular extension loading is not available. This is that |
| 105180 | 105180 | ** dummy pointer. |
| 105181 | 105181 | */ |
| 105182 | 105182 | #ifdef SQLITE_OMIT_LOAD_EXTENSION |
| 105183 | -static const sqlite3_api_routines sqlite3Apis; | |
| 105183 | +static const sqlite3_api_routines sqlite3Apis = { 0 }; | |
| 105184 | 105184 | #endif |
| 105185 | 105185 | |
| 105186 | 105186 | |
| 105187 | 105187 | /* |
| 105188 | 105188 | ** The following object holds the list of automatically loaded |
| @@ -165554,10 +165554,11 @@ | ||
| 165554 | 165554 | #endif |
| 165555 | 165555 | return rc; |
| 165556 | 165556 | } |
| 165557 | 165557 | |
| 165558 | 165558 | |
| 165559 | +#ifndef SQLITE_CORE | |
| 165559 | 165560 | #ifdef _WIN32 |
| 165560 | 165561 | __declspec(dllexport) |
| 165561 | 165562 | #endif |
| 165562 | 165563 | SQLITE_API int SQLITE_STDCALL sqlite3_json_init( |
| 165563 | 165564 | sqlite3 *db, |
| @@ -165566,10 +165567,11 @@ | ||
| 165566 | 165567 | ){ |
| 165567 | 165568 | SQLITE_EXTENSION_INIT2(pApi); |
| 165568 | 165569 | (void)pzErrMsg; /* Unused parameter */ |
| 165569 | 165570 | return sqlite3Json1Init(db); |
| 165570 | 165571 | } |
| 165572 | +#endif | |
| 165571 | 165573 | #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_JSON1) */ |
| 165572 | 165574 | |
| 165573 | 165575 | /************** End of json1.c ***********************************************/ |
| 165574 | 165576 | /************** Begin file fts5.c ********************************************/ |
| 165575 | 165577 | |
| @@ -168133,11 +168135,11 @@ | ||
| 168133 | 168135 | int *pRc, |
| 168134 | 168136 | HighlightContext *p, |
| 168135 | 168137 | const char *z, int n |
| 168136 | 168138 | ){ |
| 168137 | 168139 | if( *pRc==SQLITE_OK ){ |
| 168138 | - if( n<0 ) n = strlen(z); | |
| 168140 | + if( n<0 ) n = (int)strlen(z); | |
| 168139 | 168141 | p->zOut = sqlite3_mprintf("%z%.*s", p->zOut, n, z); |
| 168140 | 168142 | if( p->zOut==0 ) *pRc = SQLITE_NOMEM; |
| 168141 | 168143 | } |
| 168142 | 168144 | } |
| 168143 | 168145 | |
| @@ -168647,11 +168649,11 @@ | ||
| 168647 | 168649 | static void sqlite3Fts5BufferAppendString( |
| 168648 | 168650 | int *pRc, |
| 168649 | 168651 | Fts5Buffer *pBuf, |
| 168650 | 168652 | const char *zStr |
| 168651 | 168653 | ){ |
| 168652 | - int nStr = strlen(zStr); | |
| 168654 | + int nStr = (int)strlen(zStr); | |
| 168653 | 168655 | sqlite3Fts5BufferAppendBlob(pRc, pBuf, nStr+1, (const u8*)zStr); |
| 168654 | 168656 | pBuf->n--; |
| 168655 | 168657 | } |
| 168656 | 168658 | |
| 168657 | 168659 | /* |
| @@ -168819,11 +168821,11 @@ | ||
| 168819 | 168821 | */ |
| 168820 | 168822 | static char *sqlite3Fts5Strndup(int *pRc, const char *pIn, int nIn){ |
| 168821 | 168823 | char *zRet = 0; |
| 168822 | 168824 | if( *pRc==SQLITE_OK ){ |
| 168823 | 168825 | if( nIn<0 ){ |
| 168824 | - nIn = strlen(pIn); | |
| 168826 | + nIn = (int)strlen(pIn); | |
| 168825 | 168827 | } |
| 168826 | 168828 | zRet = (char*)sqlite3_malloc(nIn+1); |
| 168827 | 168829 | if( zRet ){ |
| 168828 | 168830 | memcpy(zRet, pIn, nIn); |
| 168829 | 168831 | zRet[nIn] = '\0'; |
| @@ -169072,11 +169074,11 @@ | ||
| 169072 | 169074 | const char *zCmd, /* Special command to parse */ |
| 169073 | 169075 | const char *zArg, /* Argument to parse */ |
| 169074 | 169076 | char **pzErr /* OUT: Error message */ |
| 169075 | 169077 | ){ |
| 169076 | 169078 | int rc = SQLITE_OK; |
| 169077 | - int nCmd = strlen(zCmd); | |
| 169079 | + int nCmd = (int)strlen(zCmd); | |
| 169078 | 169080 | if( sqlite3_strnicmp("prefix", zCmd, nCmd)==0 ){ |
| 169079 | 169081 | const int nByte = sizeof(int) * FTS5_MAX_PREFIX_INDEXES; |
| 169080 | 169082 | const char *p; |
| 169081 | 169083 | if( pConfig->aPrefix ){ |
| 169082 | 169084 | *pzErr = sqlite3_mprintf("multiple prefix=... directives"); |
| @@ -169109,11 +169111,11 @@ | ||
| 169109 | 169111 | return rc; |
| 169110 | 169112 | } |
| 169111 | 169113 | |
| 169112 | 169114 | if( sqlite3_strnicmp("tokenize", zCmd, nCmd)==0 ){ |
| 169113 | 169115 | const char *p = (const char*)zArg; |
| 169114 | - int nArg = strlen(zArg) + 1; | |
| 169116 | + int nArg = (int)strlen(zArg) + 1; | |
| 169115 | 169117 | char **azArg = sqlite3Fts5MallocZero(&rc, sizeof(char*) * nArg); |
| 169116 | 169118 | char *pDel = sqlite3Fts5MallocZero(&rc, nArg * 2); |
| 169117 | 169119 | char *pSpace = pDel; |
| 169118 | 169120 | |
| 169119 | 169121 | if( azArg && pSpace ){ |
| @@ -169225,11 +169227,11 @@ | ||
| 169225 | 169227 | char **pzOut, /* OUT: malloc'd buffer containing str/bw */ |
| 169226 | 169228 | int *pbQuoted /* OUT: Set to true if dequoting required */ |
| 169227 | 169229 | ){ |
| 169228 | 169230 | const char *zRet = 0; |
| 169229 | 169231 | |
| 169230 | - int nIn = strlen(zIn); | |
| 169232 | + int nIn = (int)strlen(zIn); | |
| 169231 | 169233 | char *zOut = sqlite3_malloc(nIn+1); |
| 169232 | 169234 | |
| 169233 | 169235 | assert( *pRc==SQLITE_OK ); |
| 169234 | 169236 | *pbQuoted = 0; |
| 169235 | 169237 | *pzOut = 0; |
| @@ -170635,11 +170637,11 @@ | ||
| 170635 | 170637 | if( p->pIter ){ |
| 170636 | 170638 | sqlite3Fts5IterClose(p->pIter); |
| 170637 | 170639 | p->pIter = 0; |
| 170638 | 170640 | } |
| 170639 | 170641 | rc = sqlite3Fts5IndexQuery( |
| 170640 | - pExpr->pIndex, p->zTerm, strlen(p->zTerm), | |
| 170642 | + pExpr->pIndex, p->zTerm, (int)strlen(p->zTerm), | |
| 170641 | 170643 | (pTerm->bPrefix ? FTS5INDEX_QUERY_PREFIX : 0) | |
| 170642 | 170644 | (pExpr->bDesc ? FTS5INDEX_QUERY_DESC : 0), |
| 170643 | 170645 | pNear->pColset, |
| 170644 | 170646 | &p->pIter |
| 170645 | 170647 | ); |
| @@ -171246,11 +171248,11 @@ | ||
| 171246 | 171248 | rc = fts5ParseStringFromToken(pToken, &z); |
| 171247 | 171249 | if( rc==SQLITE_OK ){ |
| 171248 | 171250 | int flags = FTS5_TOKENIZE_QUERY | (bPrefix ? FTS5_TOKENIZE_QUERY : 0); |
| 171249 | 171251 | int n; |
| 171250 | 171252 | sqlite3Fts5Dequote(z); |
| 171251 | - n = strlen(z); | |
| 171253 | + n = (int)strlen(z); | |
| 171252 | 171254 | rc = sqlite3Fts5Tokenize(pConfig, flags, z, n, &sCtx, fts5ParseTokenize); |
| 171253 | 171255 | } |
| 171254 | 171256 | sqlite3_free(z); |
| 171255 | 171257 | if( rc || (rc = sCtx.rc) ){ |
| 171256 | 171258 | pParse->rc = rc; |
| @@ -171319,11 +171321,12 @@ | ||
| 171319 | 171321 | for(i=0; rc==SQLITE_OK && i<pOrig->nTerm; i++){ |
| 171320 | 171322 | int tflags = 0; |
| 171321 | 171323 | Fts5ExprTerm *p; |
| 171322 | 171324 | for(p=&pOrig->aTerm[i]; p && rc==SQLITE_OK; p=p->pSynonym){ |
| 171323 | 171325 | const char *zTerm = p->zTerm; |
| 171324 | - rc = fts5ParseTokenize((void*)&sCtx, tflags, zTerm, strlen(zTerm), 0, 0); | |
| 171326 | + rc = fts5ParseTokenize((void*)&sCtx, tflags, zTerm, (int)strlen(zTerm), | |
| 171327 | + 0, 0); | |
| 171325 | 171328 | tflags = FTS5_TOKEN_COLOCATED; |
| 171326 | 171329 | } |
| 171327 | 171330 | if( rc==SQLITE_OK ){ |
| 171328 | 171331 | sCtx.pPhrase->aTerm[i].bPrefix = pOrig->aTerm[i].bPrefix; |
| 171329 | 171332 | } |
| @@ -171561,11 +171564,11 @@ | ||
| 171561 | 171564 | Fts5ExprTerm *p; |
| 171562 | 171565 | char *zQuoted; |
| 171563 | 171566 | |
| 171564 | 171567 | /* Determine the maximum amount of space required. */ |
| 171565 | 171568 | for(p=pTerm; p; p=p->pSynonym){ |
| 171566 | - nByte += strlen(pTerm->zTerm) * 2 + 3 + 2; | |
| 171569 | + nByte += (int)strlen(pTerm->zTerm) * 2 + 3 + 2; | |
| 171567 | 171570 | } |
| 171568 | 171571 | zQuoted = sqlite3_malloc(nByte); |
| 171569 | 171572 | |
| 171570 | 171573 | if( zQuoted ){ |
| 171571 | 171574 | int i = 0; |
| @@ -172134,11 +172137,11 @@ | ||
| 172134 | 172137 | for(i=0; i<pHash->nSlot; i++){ |
| 172135 | 172138 | while( apOld[i] ){ |
| 172136 | 172139 | int iHash; |
| 172137 | 172140 | Fts5HashEntry *p = apOld[i]; |
| 172138 | 172141 | apOld[i] = p->pHashNext; |
| 172139 | - iHash = fts5HashKey(nNew, (u8*)p->zKey, strlen(p->zKey)); | |
| 172142 | + iHash = fts5HashKey(nNew, (u8*)p->zKey, (int)strlen(p->zKey)); | |
| 172140 | 172143 | p->pHashNext = apNew[iHash]; |
| 172141 | 172144 | apNew[iHash] = p; |
| 172142 | 172145 | } |
| 172143 | 172146 | } |
| 172144 | 172147 | |
| @@ -172422,11 +172425,11 @@ | ||
| 172422 | 172425 | const u8 **ppDoclist, /* OUT: pointer to doclist */ |
| 172423 | 172426 | int *pnDoclist /* OUT: size of doclist in bytes */ |
| 172424 | 172427 | ){ |
| 172425 | 172428 | Fts5HashEntry *p; |
| 172426 | 172429 | if( (p = pHash->pScan) ){ |
| 172427 | - int nTerm = strlen(p->zKey); | |
| 172430 | + int nTerm = (int)strlen(p->zKey); | |
| 172428 | 172431 | fts5HashAddPoslistSize(p); |
| 172429 | 172432 | *pzTerm = p->zKey; |
| 172430 | 172433 | *ppDoclist = (const u8*)&p->zKey[nTerm+1]; |
| 172431 | 172434 | *pnDoclist = p->nData - (FTS5_HASHENTRYSIZE + nTerm + 1); |
| 172432 | 172435 | }else{ |
| @@ -174202,10 +174205,11 @@ | ||
| 174202 | 174205 | |
| 174203 | 174206 | }else if( pIter->pSeg==0 ){ |
| 174204 | 174207 | const u8 *pList = 0; |
| 174205 | 174208 | const char *zTerm = 0; |
| 174206 | 174209 | int nList = 0; |
| 174210 | + assert( (pIter->flags & FTS5_SEGITER_ONETERM) || pbNewTerm ); | |
| 174207 | 174211 | if( 0==(pIter->flags & FTS5_SEGITER_ONETERM) ){ |
| 174208 | 174212 | sqlite3Fts5HashScanNext(p->pHash); |
| 174209 | 174213 | sqlite3Fts5HashScanEntry(p->pHash, &zTerm, &pList, &nList); |
| 174210 | 174214 | } |
| 174211 | 174215 | if( pList==0 ){ |
| @@ -174214,13 +174218,14 @@ | ||
| 174214 | 174218 | }else{ |
| 174215 | 174219 | pIter->pLeaf->p = (u8*)pList; |
| 174216 | 174220 | pIter->pLeaf->nn = nList; |
| 174217 | 174221 | pIter->pLeaf->szLeaf = nList; |
| 174218 | 174222 | pIter->iEndofDoclist = nList+1; |
| 174219 | - sqlite3Fts5BufferSet(&p->rc, &pIter->term, strlen(zTerm), (u8*)zTerm); | |
| 174223 | + sqlite3Fts5BufferSet(&p->rc, &pIter->term, (int)strlen(zTerm), | |
| 174224 | + (u8*)zTerm); | |
| 174220 | 174225 | pIter->iLeafOffset = fts5GetVarint(pList, (u64*)&pIter->iRowid); |
| 174221 | - if( pbNewTerm ) *pbNewTerm = 1; | |
| 174226 | + *pbNewTerm = 1; | |
| 174222 | 174227 | } |
| 174223 | 174228 | }else{ |
| 174224 | 174229 | iOff = 0; |
| 174225 | 174230 | /* Next entry is not on the current page */ |
| 174226 | 174231 | while( iOff==0 ){ |
| @@ -174621,11 +174626,11 @@ | ||
| 174621 | 174626 | assert( p->rc==SQLITE_OK ); |
| 174622 | 174627 | |
| 174623 | 174628 | if( pTerm==0 || (flags & FTS5INDEX_QUERY_SCAN) ){ |
| 174624 | 174629 | p->rc = sqlite3Fts5HashScanInit(p->pHash, (const char*)pTerm, nTerm); |
| 174625 | 174630 | sqlite3Fts5HashScanEntry(p->pHash, (const char**)&z, &pList, &nList); |
| 174626 | - n = (z ? strlen((const char*)z) : 0); | |
| 174631 | + n = (z ? (int)strlen((const char*)z) : 0); | |
| 174627 | 174632 | }else{ |
| 174628 | 174633 | pIter->flags |= FTS5_SEGITER_ONETERM; |
| 174629 | 174634 | sqlite3Fts5HashQuery(p->pHash, (const char*)pTerm, nTerm, &pList, &nList); |
| 174630 | 174635 | z = pTerm; |
| 174631 | 174636 | n = nTerm; |
| @@ -176194,11 +176199,11 @@ | ||
| 176194 | 176199 | const u8 *pDoclist; /* Pointer to doclist for this term */ |
| 176195 | 176200 | int nDoclist; /* Size of doclist in bytes */ |
| 176196 | 176201 | |
| 176197 | 176202 | /* Write the term for this entry to disk. */ |
| 176198 | 176203 | sqlite3Fts5HashScanEntry(pHash, &zTerm, &pDoclist, &nDoclist); |
| 176199 | - fts5WriteAppendTerm(p, &writer, strlen(zTerm), (const u8*)zTerm); | |
| 176204 | + fts5WriteAppendTerm(p, &writer, (int)strlen(zTerm), (const u8*)zTerm); | |
| 176200 | 176205 | |
| 176201 | 176206 | assert( writer.bFirstRowidInPage==0 ); |
| 176202 | 176207 | if( pgsz>=(pBuf->n + pPgidx->n + nDoclist + 1) ){ |
| 176203 | 176208 | /* The entire doclist will fit on the current leaf. */ |
| 176204 | 176209 | fts5BufferSafeAppendBlob(pBuf, pDoclist, nDoclist); |
| @@ -176470,11 +176475,11 @@ | ||
| 176470 | 176475 | fts5ChunkIterate(p, pSeg, (void*)pBuf, fts5PoslistCallback); |
| 176471 | 176476 | }else{ |
| 176472 | 176477 | PoslistCallbackCtx sCtx; |
| 176473 | 176478 | sCtx.pBuf = pBuf; |
| 176474 | 176479 | sCtx.pColset = pColset; |
| 176475 | - sCtx.eState = pColset ? fts5IndexColsetTest(pColset, 0) : 1; | |
| 176480 | + sCtx.eState = fts5IndexColsetTest(pColset, 0); | |
| 176476 | 176481 | assert( sCtx.eState==0 || sCtx.eState==1 ); |
| 176477 | 176482 | fts5ChunkIterate(p, pSeg, (void*)&sCtx, fts5PoslistFilterCallback); |
| 176478 | 176483 | } |
| 176479 | 176484 | } |
| 176480 | 176485 | } |
| @@ -177632,11 +177637,10 @@ | ||
| 177632 | 177637 | fts5IntegrityCheckPgidx(p, pLeaf); |
| 177633 | 177638 | } |
| 177634 | 177639 | fts5DataRelease(pLeaf); |
| 177635 | 177640 | if( p->rc ) break; |
| 177636 | 177641 | |
| 177637 | - | |
| 177638 | 177642 | /* Now check that the iter.nEmpty leaves following the current leaf |
| 177639 | 177643 | ** (a) exist and (b) contain no terms. */ |
| 177640 | 177644 | fts5IndexIntegrityCheckEmpty( |
| 177641 | 177645 | p, pSeg, iIdxPrevLeaf+1, iDlidxPrevLeaf+1, iIdxLeaf-1 |
| 177642 | 177646 | ); |
| @@ -178618,11 +178622,14 @@ | ||
| 178618 | 178622 | ** extension is currently being used by a version of SQLite too old to |
| 178619 | 178623 | ** support index-info flags. In that case this function is a no-op. |
| 178620 | 178624 | */ |
| 178621 | 178625 | static void fts5SetUniqueFlag(sqlite3_index_info *pIdxInfo){ |
| 178622 | 178626 | #if SQLITE_VERSION_NUMBER>=3008012 |
| 178623 | - if( sqlite3_libversion_number()>=3008012 ){ | |
| 178627 | +#ifndef SQLITE_CORE | |
| 178628 | + if( sqlite3_libversion_number()>=3008012 ) | |
| 178629 | +#endif | |
| 178630 | + { | |
| 178624 | 178631 | pIdxInfo->idxFlags |= SQLITE_INDEX_SCAN_UNIQUE; |
| 178625 | 178632 | } |
| 178626 | 178633 | #endif |
| 178627 | 178634 | } |
| 178628 | 178635 | |
| @@ -180565,11 +180572,11 @@ | ||
| 180565 | 180572 | sqlite3_context *pCtx, /* Function call context */ |
| 180566 | 180573 | int nArg, /* Number of args */ |
| 180567 | 180574 | sqlite3_value **apVal /* Function arguments */ |
| 180568 | 180575 | ){ |
| 180569 | 180576 | assert( nArg==0 ); |
| 180570 | - sqlite3_result_text(pCtx, "fts5: 2015-10-14 12:29:53 a721fc0d89495518fe5612e2e3bbc60befd2e90d", -1, SQLITE_TRANSIENT); | |
| 180577 | + sqlite3_result_text(pCtx, "fts5: 2015-10-14 23:04:08 54127602b9a555f73f5e446b91e460386cb8fb17", -1, SQLITE_TRANSIENT); | |
| 180571 | 180578 | } |
| 180572 | 180579 | |
| 180573 | 180580 | static int fts5Init(sqlite3 *db){ |
| 180574 | 180581 | static const sqlite3_module fts5Mod = { |
| 180575 | 180582 | /* iVersion */ 2, |
| @@ -180968,14 +180975,14 @@ | ||
| 180968 | 180975 | rc = SQLITE_NOMEM; |
| 180969 | 180976 | }else{ |
| 180970 | 180977 | int i; |
| 180971 | 180978 | int iOff; |
| 180972 | 180979 | sqlite3_snprintf(nDefn, zDefn, "id INTEGER PRIMARY KEY"); |
| 180973 | - iOff = strlen(zDefn); | |
| 180980 | + iOff = (int)strlen(zDefn); | |
| 180974 | 180981 | for(i=0; i<pConfig->nCol; i++){ |
| 180975 | 180982 | sqlite3_snprintf(nDefn-iOff, &zDefn[iOff], ", c%d", i); |
| 180976 | - iOff += strlen(&zDefn[iOff]); | |
| 180983 | + iOff += (int)strlen(&zDefn[iOff]); | |
| 180977 | 180984 | } |
| 180978 | 180985 | rc = sqlite3Fts5CreateTable(pConfig, "content", zDefn, 0, pzErr); |
| 180979 | 180986 | } |
| 180980 | 180987 | sqlite3_free(zDefn); |
| 180981 | 180988 | } |
| @@ -181396,21 +181403,11 @@ | ||
| 181396 | 181403 | rc = fts5StorageNewRowid(p, piRowid); |
| 181397 | 181404 | } |
| 181398 | 181405 | }else{ |
| 181399 | 181406 | sqlite3_stmt *pInsert = 0; /* Statement to write %_content table */ |
| 181400 | 181407 | int i; /* Counter variable */ |
| 181401 | -#if 0 | |
| 181402 | - if( eConflict==SQLITE_REPLACE ){ | |
| 181403 | - eStmt = FTS5_STMT_REPLACE_CONTENT; | |
| 181404 | - rc = fts5StorageDeleteFromIndex(p, sqlite3_value_int64(apVal[1])); | |
| 181405 | - }else{ | |
| 181406 | - eStmt = FTS5_STMT_INSERT_CONTENT; | |
| 181407 | - } | |
| 181408 | -#endif | |
| 181409 | - if( rc==SQLITE_OK ){ | |
| 181410 | - rc = fts5StorageGetStmt(p, FTS5_STMT_INSERT_CONTENT, &pInsert, 0); | |
| 181411 | - } | |
| 181408 | + rc = fts5StorageGetStmt(p, FTS5_STMT_INSERT_CONTENT, &pInsert, 0); | |
| 181412 | 181409 | for(i=1; rc==SQLITE_OK && i<=pConfig->nCol+1; i++){ |
| 181413 | 181410 | rc = sqlite3_bind_value(pInsert, i, apVal[i]); |
| 181414 | 181411 | } |
| 181415 | 181412 | if( rc==SQLITE_OK ){ |
| 181416 | 181413 | sqlite3_step(pInsert); |
| @@ -182024,11 +182021,11 @@ | ||
| 182024 | 182021 | Unicode61Tokenizer *p, /* Tokenizer object */ |
| 182025 | 182022 | const char *z, /* Characters to treat as exceptions */ |
| 182026 | 182023 | int bTokenChars /* 1 for 'tokenchars', 0 for 'separators' */ |
| 182027 | 182024 | ){ |
| 182028 | 182025 | int rc = SQLITE_OK; |
| 182029 | - int n = strlen(z); | |
| 182026 | + int n = (int)strlen(z); | |
| 182030 | 182027 | int *aNew; |
| 182031 | 182028 | |
| 182032 | 182029 | if( n>0 ){ |
| 182033 | 182030 | aNew = (int*)sqlite3_realloc(p->aiException, (n+p->nException)*sizeof(int)); |
| 182034 | 182031 | if( aNew ){ |
| @@ -183888,12 +183885,12 @@ | ||
| 183888 | 183885 | }else{ |
| 183889 | 183886 | int nByte; /* Bytes of space to allocate */ |
| 183890 | 183887 | const char *zDb = bDb ? argv[3] : argv[1]; |
| 183891 | 183888 | const char *zTab = bDb ? argv[4] : argv[3]; |
| 183892 | 183889 | const char *zType = bDb ? argv[5] : argv[4]; |
| 183893 | - int nDb = strlen(zDb)+1; | |
| 183894 | - int nTab = strlen(zTab)+1; | |
| 183890 | + int nDb = (int)strlen(zDb)+1; | |
| 183891 | + int nTab = (int)strlen(zTab)+1; | |
| 183895 | 183892 | int eType; |
| 183896 | 183893 | |
| 183897 | 183894 | rc = fts5VocabTableType(zType, pzErr, &eType); |
| 183898 | 183895 | if( rc==SQLITE_OK ){ |
| 183899 | 183896 | assert( eType>=0 && eType<sizeof(azSchema)/sizeof(azSchema[0]) ); |
| 183900 | 183897 |
| --- src/sqlite3.c | |
| +++ src/sqlite3.c | |
| @@ -325,11 +325,11 @@ | |
| 325 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 326 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 327 | */ |
| 328 | #define SQLITE_VERSION "3.9.0" |
| 329 | #define SQLITE_VERSION_NUMBER 3009000 |
| 330 | #define SQLITE_SOURCE_ID "2015-10-14 12:29:53 a721fc0d89495518fe5612e2e3bbc60befd2e90d" |
| 331 | |
| 332 | /* |
| 333 | ** CAPI3REF: Run-Time Library Version Numbers |
| 334 | ** KEYWORDS: sqlite3_version, sqlite3_sourceid |
| 335 | ** |
| @@ -8156,11 +8156,10 @@ | |
| 8156 | |
| 8157 | |
| 8158 | #ifndef _FTS5_H |
| 8159 | #define _FTS5_H |
| 8160 | |
| 8161 | /* #include "sqlite3.h" */ |
| 8162 | |
| 8163 | #if 0 |
| 8164 | extern "C" { |
| 8165 | #endif |
| 8166 | |
| @@ -10431,11 +10430,11 @@ | |
| 10431 | ** header file that defines a number for each opcode used by the VDBE. |
| 10432 | */ |
| 10433 | /************** Include opcodes.h in the middle of vdbe.h ********************/ |
| 10434 | /************** Begin file opcodes.h *****************************************/ |
| 10435 | /* Automatically generated. Do not edit */ |
| 10436 | /* See the mkopcodeh.awk script for details */ |
| 10437 | #define OP_Savepoint 1 |
| 10438 | #define OP_AutoCommit 2 |
| 10439 | #define OP_Transaction 3 |
| 10440 | #define OP_SorterNext 4 |
| 10441 | #define OP_PrevIfOpen 5 |
| @@ -10592,11 +10591,10 @@ | |
| 10592 | #define OP_Pagecount 156 |
| 10593 | #define OP_MaxPgcnt 157 |
| 10594 | #define OP_Init 158 /* synopsis: Start at P2 */ |
| 10595 | #define OP_Noop 159 |
| 10596 | #define OP_Explain 160 |
| 10597 | |
| 10598 | |
| 10599 | /* Properties such as "out2" or "jump" that are specified in |
| 10600 | ** comments following the "case" for each opcode in the vdbe.c |
| 10601 | ** are encoded into bitvectors as follows: |
| 10602 | */ |
| @@ -26245,179 +26243,181 @@ | |
| 26245 | } |
| 26246 | |
| 26247 | /************** End of hash.c ************************************************/ |
| 26248 | /************** Begin file opcodes.c *****************************************/ |
| 26249 | /* Automatically generated. Do not edit */ |
| 26250 | /* See the mkopcodec.awk script for details. */ |
| 26251 | #if !defined(SQLITE_OMIT_EXPLAIN) || defined(VDBE_PROFILE) || defined(SQLITE_DEBUG) |
| 26252 | #if defined(SQLITE_ENABLE_EXPLAIN_COMMENTS) || defined(SQLITE_DEBUG) |
| 26253 | # define OpHelp(X) "\0" X |
| 26254 | #else |
| 26255 | # define OpHelp(X) |
| 26256 | #endif |
| 26257 | SQLITE_PRIVATE const char *sqlite3OpcodeName(int i){ |
| 26258 | static const char *const azName[] = { "?", |
| 26259 | /* 1 */ "Savepoint" OpHelp(""), |
| 26260 | /* 2 */ "AutoCommit" OpHelp(""), |
| 26261 | /* 3 */ "Transaction" OpHelp(""), |
| 26262 | /* 4 */ "SorterNext" OpHelp(""), |
| 26263 | /* 5 */ "PrevIfOpen" OpHelp(""), |
| 26264 | /* 6 */ "NextIfOpen" OpHelp(""), |
| 26265 | /* 7 */ "Prev" OpHelp(""), |
| 26266 | /* 8 */ "Next" OpHelp(""), |
| 26267 | /* 9 */ "Checkpoint" OpHelp(""), |
| 26268 | /* 10 */ "JournalMode" OpHelp(""), |
| 26269 | /* 11 */ "Vacuum" OpHelp(""), |
| 26270 | /* 12 */ "VFilter" OpHelp("iplan=r[P3] zplan='P4'"), |
| 26271 | /* 13 */ "VUpdate" OpHelp("data=r[P3@P2]"), |
| 26272 | /* 14 */ "Goto" OpHelp(""), |
| 26273 | /* 15 */ "Gosub" OpHelp(""), |
| 26274 | /* 16 */ "Return" OpHelp(""), |
| 26275 | /* 17 */ "InitCoroutine" OpHelp(""), |
| 26276 | /* 18 */ "EndCoroutine" OpHelp(""), |
| 26277 | /* 19 */ "Not" OpHelp("r[P2]= !r[P1]"), |
| 26278 | /* 20 */ "Yield" OpHelp(""), |
| 26279 | /* 21 */ "HaltIfNull" OpHelp("if r[P3]=null halt"), |
| 26280 | /* 22 */ "Halt" OpHelp(""), |
| 26281 | /* 23 */ "Integer" OpHelp("r[P2]=P1"), |
| 26282 | /* 24 */ "Int64" OpHelp("r[P2]=P4"), |
| 26283 | /* 25 */ "String" OpHelp("r[P2]='P4' (len=P1)"), |
| 26284 | /* 26 */ "Null" OpHelp("r[P2..P3]=NULL"), |
| 26285 | /* 27 */ "SoftNull" OpHelp("r[P1]=NULL"), |
| 26286 | /* 28 */ "Blob" OpHelp("r[P2]=P4 (len=P1)"), |
| 26287 | /* 29 */ "Variable" OpHelp("r[P2]=parameter(P1,P4)"), |
| 26288 | /* 30 */ "Move" OpHelp("r[P2@P3]=r[P1@P3]"), |
| 26289 | /* 31 */ "Copy" OpHelp("r[P2@P3+1]=r[P1@P3+1]"), |
| 26290 | /* 32 */ "SCopy" OpHelp("r[P2]=r[P1]"), |
| 26291 | /* 33 */ "ResultRow" OpHelp("output=r[P1@P2]"), |
| 26292 | /* 34 */ "CollSeq" OpHelp(""), |
| 26293 | /* 35 */ "Function0" OpHelp("r[P3]=func(r[P2@P5])"), |
| 26294 | /* 36 */ "Function" OpHelp("r[P3]=func(r[P2@P5])"), |
| 26295 | /* 37 */ "AddImm" OpHelp("r[P1]=r[P1]+P2"), |
| 26296 | /* 38 */ "MustBeInt" OpHelp(""), |
| 26297 | /* 39 */ "RealAffinity" OpHelp(""), |
| 26298 | /* 40 */ "Cast" OpHelp("affinity(r[P1])"), |
| 26299 | /* 41 */ "Permutation" OpHelp(""), |
| 26300 | /* 42 */ "Compare" OpHelp("r[P1@P3] <-> r[P2@P3]"), |
| 26301 | /* 43 */ "Jump" OpHelp(""), |
| 26302 | /* 44 */ "Once" OpHelp(""), |
| 26303 | /* 45 */ "If" OpHelp(""), |
| 26304 | /* 46 */ "IfNot" OpHelp(""), |
| 26305 | /* 47 */ "Column" OpHelp("r[P3]=PX"), |
| 26306 | /* 48 */ "Affinity" OpHelp("affinity(r[P1@P2])"), |
| 26307 | /* 49 */ "MakeRecord" OpHelp("r[P3]=mkrec(r[P1@P2])"), |
| 26308 | /* 50 */ "Count" OpHelp("r[P2]=count()"), |
| 26309 | /* 51 */ "ReadCookie" OpHelp(""), |
| 26310 | /* 52 */ "SetCookie" OpHelp(""), |
| 26311 | /* 53 */ "ReopenIdx" OpHelp("root=P2 iDb=P3"), |
| 26312 | /* 54 */ "OpenRead" OpHelp("root=P2 iDb=P3"), |
| 26313 | /* 55 */ "OpenWrite" OpHelp("root=P2 iDb=P3"), |
| 26314 | /* 56 */ "OpenAutoindex" OpHelp("nColumn=P2"), |
| 26315 | /* 57 */ "OpenEphemeral" OpHelp("nColumn=P2"), |
| 26316 | /* 58 */ "SorterOpen" OpHelp(""), |
| 26317 | /* 59 */ "SequenceTest" OpHelp("if( cursor[P1].ctr++ ) pc = P2"), |
| 26318 | /* 60 */ "OpenPseudo" OpHelp("P3 columns in r[P2]"), |
| 26319 | /* 61 */ "Close" OpHelp(""), |
| 26320 | /* 62 */ "ColumnsUsed" OpHelp(""), |
| 26321 | /* 63 */ "SeekLT" OpHelp("key=r[P3@P4]"), |
| 26322 | /* 64 */ "SeekLE" OpHelp("key=r[P3@P4]"), |
| 26323 | /* 65 */ "SeekGE" OpHelp("key=r[P3@P4]"), |
| 26324 | /* 66 */ "SeekGT" OpHelp("key=r[P3@P4]"), |
| 26325 | /* 67 */ "Seek" OpHelp("intkey=r[P2]"), |
| 26326 | /* 68 */ "NoConflict" OpHelp("key=r[P3@P4]"), |
| 26327 | /* 69 */ "NotFound" OpHelp("key=r[P3@P4]"), |
| 26328 | /* 70 */ "Found" OpHelp("key=r[P3@P4]"), |
| 26329 | /* 71 */ "Or" OpHelp("r[P3]=(r[P1] || r[P2])"), |
| 26330 | /* 72 */ "And" OpHelp("r[P3]=(r[P1] && r[P2])"), |
| 26331 | /* 73 */ "NotExists" OpHelp("intkey=r[P3]"), |
| 26332 | /* 74 */ "Sequence" OpHelp("r[P2]=cursor[P1].ctr++"), |
| 26333 | /* 75 */ "NewRowid" OpHelp("r[P2]=rowid"), |
| 26334 | /* 76 */ "IsNull" OpHelp("if r[P1]==NULL goto P2"), |
| 26335 | /* 77 */ "NotNull" OpHelp("if r[P1]!=NULL goto P2"), |
| 26336 | /* 78 */ "Ne" OpHelp("if r[P1]!=r[P3] goto P2"), |
| 26337 | /* 79 */ "Eq" OpHelp("if r[P1]==r[P3] goto P2"), |
| 26338 | /* 80 */ "Gt" OpHelp("if r[P1]>r[P3] goto P2"), |
| 26339 | /* 81 */ "Le" OpHelp("if r[P1]<=r[P3] goto P2"), |
| 26340 | /* 82 */ "Lt" OpHelp("if r[P1]<r[P3] goto P2"), |
| 26341 | /* 83 */ "Ge" OpHelp("if r[P1]>=r[P3] goto P2"), |
| 26342 | /* 84 */ "Insert" OpHelp("intkey=r[P3] data=r[P2]"), |
| 26343 | /* 85 */ "BitAnd" OpHelp("r[P3]=r[P1]&r[P2]"), |
| 26344 | /* 86 */ "BitOr" OpHelp("r[P3]=r[P1]|r[P2]"), |
| 26345 | /* 87 */ "ShiftLeft" OpHelp("r[P3]=r[P2]<<r[P1]"), |
| 26346 | /* 88 */ "ShiftRight" OpHelp("r[P3]=r[P2]>>r[P1]"), |
| 26347 | /* 89 */ "Add" OpHelp("r[P3]=r[P1]+r[P2]"), |
| 26348 | /* 90 */ "Subtract" OpHelp("r[P3]=r[P2]-r[P1]"), |
| 26349 | /* 91 */ "Multiply" OpHelp("r[P3]=r[P1]*r[P2]"), |
| 26350 | /* 92 */ "Divide" OpHelp("r[P3]=r[P2]/r[P1]"), |
| 26351 | /* 93 */ "Remainder" OpHelp("r[P3]=r[P2]%r[P1]"), |
| 26352 | /* 94 */ "Concat" OpHelp("r[P3]=r[P2]+r[P1]"), |
| 26353 | /* 95 */ "InsertInt" OpHelp("intkey=P3 data=r[P2]"), |
| 26354 | /* 96 */ "BitNot" OpHelp("r[P1]= ~r[P1]"), |
| 26355 | /* 97 */ "String8" OpHelp("r[P2]='P4'"), |
| 26356 | /* 98 */ "Delete" OpHelp(""), |
| 26357 | /* 99 */ "ResetCount" OpHelp(""), |
| 26358 | /* 100 */ "SorterCompare" OpHelp("if key(P1)!=trim(r[P3],P4) goto P2"), |
| 26359 | /* 101 */ "SorterData" OpHelp("r[P2]=data"), |
| 26360 | /* 102 */ "RowKey" OpHelp("r[P2]=key"), |
| 26361 | /* 103 */ "RowData" OpHelp("r[P2]=data"), |
| 26362 | /* 104 */ "Rowid" OpHelp("r[P2]=rowid"), |
| 26363 | /* 105 */ "NullRow" OpHelp(""), |
| 26364 | /* 106 */ "Last" OpHelp(""), |
| 26365 | /* 107 */ "SorterSort" OpHelp(""), |
| 26366 | /* 108 */ "Sort" OpHelp(""), |
| 26367 | /* 109 */ "Rewind" OpHelp(""), |
| 26368 | /* 110 */ "SorterInsert" OpHelp(""), |
| 26369 | /* 111 */ "IdxInsert" OpHelp("key=r[P2]"), |
| 26370 | /* 112 */ "IdxDelete" OpHelp("key=r[P2@P3]"), |
| 26371 | /* 113 */ "IdxRowid" OpHelp("r[P2]=rowid"), |
| 26372 | /* 114 */ "IdxLE" OpHelp("key=r[P3@P4]"), |
| 26373 | /* 115 */ "IdxGT" OpHelp("key=r[P3@P4]"), |
| 26374 | /* 116 */ "IdxLT" OpHelp("key=r[P3@P4]"), |
| 26375 | /* 117 */ "IdxGE" OpHelp("key=r[P3@P4]"), |
| 26376 | /* 118 */ "Destroy" OpHelp(""), |
| 26377 | /* 119 */ "Clear" OpHelp(""), |
| 26378 | /* 120 */ "ResetSorter" OpHelp(""), |
| 26379 | /* 121 */ "CreateIndex" OpHelp("r[P2]=root iDb=P1"), |
| 26380 | /* 122 */ "CreateTable" OpHelp("r[P2]=root iDb=P1"), |
| 26381 | /* 123 */ "ParseSchema" OpHelp(""), |
| 26382 | /* 124 */ "LoadAnalysis" OpHelp(""), |
| 26383 | /* 125 */ "DropTable" OpHelp(""), |
| 26384 | /* 126 */ "DropIndex" OpHelp(""), |
| 26385 | /* 127 */ "DropTrigger" OpHelp(""), |
| 26386 | /* 128 */ "IntegrityCk" OpHelp(""), |
| 26387 | /* 129 */ "RowSetAdd" OpHelp("rowset(P1)=r[P2]"), |
| 26388 | /* 130 */ "RowSetRead" OpHelp("r[P3]=rowset(P1)"), |
| 26389 | /* 131 */ "RowSetTest" OpHelp("if r[P3] in rowset(P1) goto P2"), |
| 26390 | /* 132 */ "Program" OpHelp(""), |
| 26391 | /* 133 */ "Real" OpHelp("r[P2]=P4"), |
| 26392 | /* 134 */ "Param" OpHelp(""), |
| 26393 | /* 135 */ "FkCounter" OpHelp("fkctr[P1]+=P2"), |
| 26394 | /* 136 */ "FkIfZero" OpHelp("if fkctr[P1]==0 goto P2"), |
| 26395 | /* 137 */ "MemMax" OpHelp("r[P1]=max(r[P1],r[P2])"), |
| 26396 | /* 138 */ "IfPos" OpHelp("if r[P1]>0 then r[P1]-=P3, goto P2"), |
| 26397 | /* 139 */ "SetIfNotPos" OpHelp("if r[P1]<=0 then r[P2]=P3"), |
| 26398 | /* 140 */ "IfNotZero" OpHelp("if r[P1]!=0 then r[P1]-=P3, goto P2"), |
| 26399 | /* 141 */ "DecrJumpZero" OpHelp("if (--r[P1])==0 goto P2"), |
| 26400 | /* 142 */ "JumpZeroIncr" OpHelp("if (r[P1]++)==0 ) goto P2"), |
| 26401 | /* 143 */ "AggStep0" OpHelp("accum=r[P3] step(r[P2@P5])"), |
| 26402 | /* 144 */ "AggStep" OpHelp("accum=r[P3] step(r[P2@P5])"), |
| 26403 | /* 145 */ "AggFinal" OpHelp("accum=r[P1] N=P2"), |
| 26404 | /* 146 */ "IncrVacuum" OpHelp(""), |
| 26405 | /* 147 */ "Expire" OpHelp(""), |
| 26406 | /* 148 */ "TableLock" OpHelp("iDb=P1 root=P2 write=P3"), |
| 26407 | /* 149 */ "VBegin" OpHelp(""), |
| 26408 | /* 150 */ "VCreate" OpHelp(""), |
| 26409 | /* 151 */ "VDestroy" OpHelp(""), |
| 26410 | /* 152 */ "VOpen" OpHelp(""), |
| 26411 | /* 153 */ "VColumn" OpHelp("r[P3]=vcolumn(P2)"), |
| 26412 | /* 154 */ "VNext" OpHelp(""), |
| 26413 | /* 155 */ "VRename" OpHelp(""), |
| 26414 | /* 156 */ "Pagecount" OpHelp(""), |
| 26415 | /* 157 */ "MaxPgcnt" OpHelp(""), |
| 26416 | /* 158 */ "Init" OpHelp("Start at P2"), |
| 26417 | /* 159 */ "Noop" OpHelp(""), |
| 26418 | /* 160 */ "Explain" OpHelp(""), |
| 26419 | }; |
| 26420 | return azName[i]; |
| 26421 | } |
| 26422 | #endif |
| 26423 | |
| @@ -81055,11 +81055,11 @@ | |
| 81055 | pKeyInfo->nXField += (pKeyInfo->nField - nField); |
| 81056 | pKeyInfo->nField = nField; |
| 81057 | } |
| 81058 | pSorter->pgsz = pgsz = sqlite3BtreeGetPageSize(db->aDb[0].pBt); |
| 81059 | pSorter->nTask = nWorker + 1; |
| 81060 | pSorter->iPrev = nWorker-1; |
| 81061 | pSorter->bUseThreads = (pSorter->nTask>1); |
| 81062 | pSorter->db = db; |
| 81063 | for(i=0; i<pSorter->nTask; i++){ |
| 81064 | SortSubtask *pTask = &pSorter->aTask[i]; |
| 81065 | pTask->pSorter = pSorter; |
| @@ -105178,11 +105178,11 @@ | |
| 105178 | ** loading is supported. We need a dummy sqlite3Apis pointer for that |
| 105179 | ** code if regular extension loading is not available. This is that |
| 105180 | ** dummy pointer. |
| 105181 | */ |
| 105182 | #ifdef SQLITE_OMIT_LOAD_EXTENSION |
| 105183 | static const sqlite3_api_routines sqlite3Apis; |
| 105184 | #endif |
| 105185 | |
| 105186 | |
| 105187 | /* |
| 105188 | ** The following object holds the list of automatically loaded |
| @@ -165554,10 +165554,11 @@ | |
| 165554 | #endif |
| 165555 | return rc; |
| 165556 | } |
| 165557 | |
| 165558 | |
| 165559 | #ifdef _WIN32 |
| 165560 | __declspec(dllexport) |
| 165561 | #endif |
| 165562 | SQLITE_API int SQLITE_STDCALL sqlite3_json_init( |
| 165563 | sqlite3 *db, |
| @@ -165566,10 +165567,11 @@ | |
| 165566 | ){ |
| 165567 | SQLITE_EXTENSION_INIT2(pApi); |
| 165568 | (void)pzErrMsg; /* Unused parameter */ |
| 165569 | return sqlite3Json1Init(db); |
| 165570 | } |
| 165571 | #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_JSON1) */ |
| 165572 | |
| 165573 | /************** End of json1.c ***********************************************/ |
| 165574 | /************** Begin file fts5.c ********************************************/ |
| 165575 | |
| @@ -168133,11 +168135,11 @@ | |
| 168133 | int *pRc, |
| 168134 | HighlightContext *p, |
| 168135 | const char *z, int n |
| 168136 | ){ |
| 168137 | if( *pRc==SQLITE_OK ){ |
| 168138 | if( n<0 ) n = strlen(z); |
| 168139 | p->zOut = sqlite3_mprintf("%z%.*s", p->zOut, n, z); |
| 168140 | if( p->zOut==0 ) *pRc = SQLITE_NOMEM; |
| 168141 | } |
| 168142 | } |
| 168143 | |
| @@ -168647,11 +168649,11 @@ | |
| 168647 | static void sqlite3Fts5BufferAppendString( |
| 168648 | int *pRc, |
| 168649 | Fts5Buffer *pBuf, |
| 168650 | const char *zStr |
| 168651 | ){ |
| 168652 | int nStr = strlen(zStr); |
| 168653 | sqlite3Fts5BufferAppendBlob(pRc, pBuf, nStr+1, (const u8*)zStr); |
| 168654 | pBuf->n--; |
| 168655 | } |
| 168656 | |
| 168657 | /* |
| @@ -168819,11 +168821,11 @@ | |
| 168819 | */ |
| 168820 | static char *sqlite3Fts5Strndup(int *pRc, const char *pIn, int nIn){ |
| 168821 | char *zRet = 0; |
| 168822 | if( *pRc==SQLITE_OK ){ |
| 168823 | if( nIn<0 ){ |
| 168824 | nIn = strlen(pIn); |
| 168825 | } |
| 168826 | zRet = (char*)sqlite3_malloc(nIn+1); |
| 168827 | if( zRet ){ |
| 168828 | memcpy(zRet, pIn, nIn); |
| 168829 | zRet[nIn] = '\0'; |
| @@ -169072,11 +169074,11 @@ | |
| 169072 | const char *zCmd, /* Special command to parse */ |
| 169073 | const char *zArg, /* Argument to parse */ |
| 169074 | char **pzErr /* OUT: Error message */ |
| 169075 | ){ |
| 169076 | int rc = SQLITE_OK; |
| 169077 | int nCmd = strlen(zCmd); |
| 169078 | if( sqlite3_strnicmp("prefix", zCmd, nCmd)==0 ){ |
| 169079 | const int nByte = sizeof(int) * FTS5_MAX_PREFIX_INDEXES; |
| 169080 | const char *p; |
| 169081 | if( pConfig->aPrefix ){ |
| 169082 | *pzErr = sqlite3_mprintf("multiple prefix=... directives"); |
| @@ -169109,11 +169111,11 @@ | |
| 169109 | return rc; |
| 169110 | } |
| 169111 | |
| 169112 | if( sqlite3_strnicmp("tokenize", zCmd, nCmd)==0 ){ |
| 169113 | const char *p = (const char*)zArg; |
| 169114 | int nArg = strlen(zArg) + 1; |
| 169115 | char **azArg = sqlite3Fts5MallocZero(&rc, sizeof(char*) * nArg); |
| 169116 | char *pDel = sqlite3Fts5MallocZero(&rc, nArg * 2); |
| 169117 | char *pSpace = pDel; |
| 169118 | |
| 169119 | if( azArg && pSpace ){ |
| @@ -169225,11 +169227,11 @@ | |
| 169225 | char **pzOut, /* OUT: malloc'd buffer containing str/bw */ |
| 169226 | int *pbQuoted /* OUT: Set to true if dequoting required */ |
| 169227 | ){ |
| 169228 | const char *zRet = 0; |
| 169229 | |
| 169230 | int nIn = strlen(zIn); |
| 169231 | char *zOut = sqlite3_malloc(nIn+1); |
| 169232 | |
| 169233 | assert( *pRc==SQLITE_OK ); |
| 169234 | *pbQuoted = 0; |
| 169235 | *pzOut = 0; |
| @@ -170635,11 +170637,11 @@ | |
| 170635 | if( p->pIter ){ |
| 170636 | sqlite3Fts5IterClose(p->pIter); |
| 170637 | p->pIter = 0; |
| 170638 | } |
| 170639 | rc = sqlite3Fts5IndexQuery( |
| 170640 | pExpr->pIndex, p->zTerm, strlen(p->zTerm), |
| 170641 | (pTerm->bPrefix ? FTS5INDEX_QUERY_PREFIX : 0) | |
| 170642 | (pExpr->bDesc ? FTS5INDEX_QUERY_DESC : 0), |
| 170643 | pNear->pColset, |
| 170644 | &p->pIter |
| 170645 | ); |
| @@ -171246,11 +171248,11 @@ | |
| 171246 | rc = fts5ParseStringFromToken(pToken, &z); |
| 171247 | if( rc==SQLITE_OK ){ |
| 171248 | int flags = FTS5_TOKENIZE_QUERY | (bPrefix ? FTS5_TOKENIZE_QUERY : 0); |
| 171249 | int n; |
| 171250 | sqlite3Fts5Dequote(z); |
| 171251 | n = strlen(z); |
| 171252 | rc = sqlite3Fts5Tokenize(pConfig, flags, z, n, &sCtx, fts5ParseTokenize); |
| 171253 | } |
| 171254 | sqlite3_free(z); |
| 171255 | if( rc || (rc = sCtx.rc) ){ |
| 171256 | pParse->rc = rc; |
| @@ -171319,11 +171321,12 @@ | |
| 171319 | for(i=0; rc==SQLITE_OK && i<pOrig->nTerm; i++){ |
| 171320 | int tflags = 0; |
| 171321 | Fts5ExprTerm *p; |
| 171322 | for(p=&pOrig->aTerm[i]; p && rc==SQLITE_OK; p=p->pSynonym){ |
| 171323 | const char *zTerm = p->zTerm; |
| 171324 | rc = fts5ParseTokenize((void*)&sCtx, tflags, zTerm, strlen(zTerm), 0, 0); |
| 171325 | tflags = FTS5_TOKEN_COLOCATED; |
| 171326 | } |
| 171327 | if( rc==SQLITE_OK ){ |
| 171328 | sCtx.pPhrase->aTerm[i].bPrefix = pOrig->aTerm[i].bPrefix; |
| 171329 | } |
| @@ -171561,11 +171564,11 @@ | |
| 171561 | Fts5ExprTerm *p; |
| 171562 | char *zQuoted; |
| 171563 | |
| 171564 | /* Determine the maximum amount of space required. */ |
| 171565 | for(p=pTerm; p; p=p->pSynonym){ |
| 171566 | nByte += strlen(pTerm->zTerm) * 2 + 3 + 2; |
| 171567 | } |
| 171568 | zQuoted = sqlite3_malloc(nByte); |
| 171569 | |
| 171570 | if( zQuoted ){ |
| 171571 | int i = 0; |
| @@ -172134,11 +172137,11 @@ | |
| 172134 | for(i=0; i<pHash->nSlot; i++){ |
| 172135 | while( apOld[i] ){ |
| 172136 | int iHash; |
| 172137 | Fts5HashEntry *p = apOld[i]; |
| 172138 | apOld[i] = p->pHashNext; |
| 172139 | iHash = fts5HashKey(nNew, (u8*)p->zKey, strlen(p->zKey)); |
| 172140 | p->pHashNext = apNew[iHash]; |
| 172141 | apNew[iHash] = p; |
| 172142 | } |
| 172143 | } |
| 172144 | |
| @@ -172422,11 +172425,11 @@ | |
| 172422 | const u8 **ppDoclist, /* OUT: pointer to doclist */ |
| 172423 | int *pnDoclist /* OUT: size of doclist in bytes */ |
| 172424 | ){ |
| 172425 | Fts5HashEntry *p; |
| 172426 | if( (p = pHash->pScan) ){ |
| 172427 | int nTerm = strlen(p->zKey); |
| 172428 | fts5HashAddPoslistSize(p); |
| 172429 | *pzTerm = p->zKey; |
| 172430 | *ppDoclist = (const u8*)&p->zKey[nTerm+1]; |
| 172431 | *pnDoclist = p->nData - (FTS5_HASHENTRYSIZE + nTerm + 1); |
| 172432 | }else{ |
| @@ -174202,10 +174205,11 @@ | |
| 174202 | |
| 174203 | }else if( pIter->pSeg==0 ){ |
| 174204 | const u8 *pList = 0; |
| 174205 | const char *zTerm = 0; |
| 174206 | int nList = 0; |
| 174207 | if( 0==(pIter->flags & FTS5_SEGITER_ONETERM) ){ |
| 174208 | sqlite3Fts5HashScanNext(p->pHash); |
| 174209 | sqlite3Fts5HashScanEntry(p->pHash, &zTerm, &pList, &nList); |
| 174210 | } |
| 174211 | if( pList==0 ){ |
| @@ -174214,13 +174218,14 @@ | |
| 174214 | }else{ |
| 174215 | pIter->pLeaf->p = (u8*)pList; |
| 174216 | pIter->pLeaf->nn = nList; |
| 174217 | pIter->pLeaf->szLeaf = nList; |
| 174218 | pIter->iEndofDoclist = nList+1; |
| 174219 | sqlite3Fts5BufferSet(&p->rc, &pIter->term, strlen(zTerm), (u8*)zTerm); |
| 174220 | pIter->iLeafOffset = fts5GetVarint(pList, (u64*)&pIter->iRowid); |
| 174221 | if( pbNewTerm ) *pbNewTerm = 1; |
| 174222 | } |
| 174223 | }else{ |
| 174224 | iOff = 0; |
| 174225 | /* Next entry is not on the current page */ |
| 174226 | while( iOff==0 ){ |
| @@ -174621,11 +174626,11 @@ | |
| 174621 | assert( p->rc==SQLITE_OK ); |
| 174622 | |
| 174623 | if( pTerm==0 || (flags & FTS5INDEX_QUERY_SCAN) ){ |
| 174624 | p->rc = sqlite3Fts5HashScanInit(p->pHash, (const char*)pTerm, nTerm); |
| 174625 | sqlite3Fts5HashScanEntry(p->pHash, (const char**)&z, &pList, &nList); |
| 174626 | n = (z ? strlen((const char*)z) : 0); |
| 174627 | }else{ |
| 174628 | pIter->flags |= FTS5_SEGITER_ONETERM; |
| 174629 | sqlite3Fts5HashQuery(p->pHash, (const char*)pTerm, nTerm, &pList, &nList); |
| 174630 | z = pTerm; |
| 174631 | n = nTerm; |
| @@ -176194,11 +176199,11 @@ | |
| 176194 | const u8 *pDoclist; /* Pointer to doclist for this term */ |
| 176195 | int nDoclist; /* Size of doclist in bytes */ |
| 176196 | |
| 176197 | /* Write the term for this entry to disk. */ |
| 176198 | sqlite3Fts5HashScanEntry(pHash, &zTerm, &pDoclist, &nDoclist); |
| 176199 | fts5WriteAppendTerm(p, &writer, strlen(zTerm), (const u8*)zTerm); |
| 176200 | |
| 176201 | assert( writer.bFirstRowidInPage==0 ); |
| 176202 | if( pgsz>=(pBuf->n + pPgidx->n + nDoclist + 1) ){ |
| 176203 | /* The entire doclist will fit on the current leaf. */ |
| 176204 | fts5BufferSafeAppendBlob(pBuf, pDoclist, nDoclist); |
| @@ -176470,11 +176475,11 @@ | |
| 176470 | fts5ChunkIterate(p, pSeg, (void*)pBuf, fts5PoslistCallback); |
| 176471 | }else{ |
| 176472 | PoslistCallbackCtx sCtx; |
| 176473 | sCtx.pBuf = pBuf; |
| 176474 | sCtx.pColset = pColset; |
| 176475 | sCtx.eState = pColset ? fts5IndexColsetTest(pColset, 0) : 1; |
| 176476 | assert( sCtx.eState==0 || sCtx.eState==1 ); |
| 176477 | fts5ChunkIterate(p, pSeg, (void*)&sCtx, fts5PoslistFilterCallback); |
| 176478 | } |
| 176479 | } |
| 176480 | } |
| @@ -177632,11 +177637,10 @@ | |
| 177632 | fts5IntegrityCheckPgidx(p, pLeaf); |
| 177633 | } |
| 177634 | fts5DataRelease(pLeaf); |
| 177635 | if( p->rc ) break; |
| 177636 | |
| 177637 | |
| 177638 | /* Now check that the iter.nEmpty leaves following the current leaf |
| 177639 | ** (a) exist and (b) contain no terms. */ |
| 177640 | fts5IndexIntegrityCheckEmpty( |
| 177641 | p, pSeg, iIdxPrevLeaf+1, iDlidxPrevLeaf+1, iIdxLeaf-1 |
| 177642 | ); |
| @@ -178618,11 +178622,14 @@ | |
| 178618 | ** extension is currently being used by a version of SQLite too old to |
| 178619 | ** support index-info flags. In that case this function is a no-op. |
| 178620 | */ |
| 178621 | static void fts5SetUniqueFlag(sqlite3_index_info *pIdxInfo){ |
| 178622 | #if SQLITE_VERSION_NUMBER>=3008012 |
| 178623 | if( sqlite3_libversion_number()>=3008012 ){ |
| 178624 | pIdxInfo->idxFlags |= SQLITE_INDEX_SCAN_UNIQUE; |
| 178625 | } |
| 178626 | #endif |
| 178627 | } |
| 178628 | |
| @@ -180565,11 +180572,11 @@ | |
| 180565 | sqlite3_context *pCtx, /* Function call context */ |
| 180566 | int nArg, /* Number of args */ |
| 180567 | sqlite3_value **apVal /* Function arguments */ |
| 180568 | ){ |
| 180569 | assert( nArg==0 ); |
| 180570 | sqlite3_result_text(pCtx, "fts5: 2015-10-14 12:29:53 a721fc0d89495518fe5612e2e3bbc60befd2e90d", -1, SQLITE_TRANSIENT); |
| 180571 | } |
| 180572 | |
| 180573 | static int fts5Init(sqlite3 *db){ |
| 180574 | static const sqlite3_module fts5Mod = { |
| 180575 | /* iVersion */ 2, |
| @@ -180968,14 +180975,14 @@ | |
| 180968 | rc = SQLITE_NOMEM; |
| 180969 | }else{ |
| 180970 | int i; |
| 180971 | int iOff; |
| 180972 | sqlite3_snprintf(nDefn, zDefn, "id INTEGER PRIMARY KEY"); |
| 180973 | iOff = strlen(zDefn); |
| 180974 | for(i=0; i<pConfig->nCol; i++){ |
| 180975 | sqlite3_snprintf(nDefn-iOff, &zDefn[iOff], ", c%d", i); |
| 180976 | iOff += strlen(&zDefn[iOff]); |
| 180977 | } |
| 180978 | rc = sqlite3Fts5CreateTable(pConfig, "content", zDefn, 0, pzErr); |
| 180979 | } |
| 180980 | sqlite3_free(zDefn); |
| 180981 | } |
| @@ -181396,21 +181403,11 @@ | |
| 181396 | rc = fts5StorageNewRowid(p, piRowid); |
| 181397 | } |
| 181398 | }else{ |
| 181399 | sqlite3_stmt *pInsert = 0; /* Statement to write %_content table */ |
| 181400 | int i; /* Counter variable */ |
| 181401 | #if 0 |
| 181402 | if( eConflict==SQLITE_REPLACE ){ |
| 181403 | eStmt = FTS5_STMT_REPLACE_CONTENT; |
| 181404 | rc = fts5StorageDeleteFromIndex(p, sqlite3_value_int64(apVal[1])); |
| 181405 | }else{ |
| 181406 | eStmt = FTS5_STMT_INSERT_CONTENT; |
| 181407 | } |
| 181408 | #endif |
| 181409 | if( rc==SQLITE_OK ){ |
| 181410 | rc = fts5StorageGetStmt(p, FTS5_STMT_INSERT_CONTENT, &pInsert, 0); |
| 181411 | } |
| 181412 | for(i=1; rc==SQLITE_OK && i<=pConfig->nCol+1; i++){ |
| 181413 | rc = sqlite3_bind_value(pInsert, i, apVal[i]); |
| 181414 | } |
| 181415 | if( rc==SQLITE_OK ){ |
| 181416 | sqlite3_step(pInsert); |
| @@ -182024,11 +182021,11 @@ | |
| 182024 | Unicode61Tokenizer *p, /* Tokenizer object */ |
| 182025 | const char *z, /* Characters to treat as exceptions */ |
| 182026 | int bTokenChars /* 1 for 'tokenchars', 0 for 'separators' */ |
| 182027 | ){ |
| 182028 | int rc = SQLITE_OK; |
| 182029 | int n = strlen(z); |
| 182030 | int *aNew; |
| 182031 | |
| 182032 | if( n>0 ){ |
| 182033 | aNew = (int*)sqlite3_realloc(p->aiException, (n+p->nException)*sizeof(int)); |
| 182034 | if( aNew ){ |
| @@ -183888,12 +183885,12 @@ | |
| 183888 | }else{ |
| 183889 | int nByte; /* Bytes of space to allocate */ |
| 183890 | const char *zDb = bDb ? argv[3] : argv[1]; |
| 183891 | const char *zTab = bDb ? argv[4] : argv[3]; |
| 183892 | const char *zType = bDb ? argv[5] : argv[4]; |
| 183893 | int nDb = strlen(zDb)+1; |
| 183894 | int nTab = strlen(zTab)+1; |
| 183895 | int eType; |
| 183896 | |
| 183897 | rc = fts5VocabTableType(zType, pzErr, &eType); |
| 183898 | if( rc==SQLITE_OK ){ |
| 183899 | assert( eType>=0 && eType<sizeof(azSchema)/sizeof(azSchema[0]) ); |
| 183900 |
| --- src/sqlite3.c | |
| +++ src/sqlite3.c | |
| @@ -325,11 +325,11 @@ | |
| 325 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 326 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 327 | */ |
| 328 | #define SQLITE_VERSION "3.9.0" |
| 329 | #define SQLITE_VERSION_NUMBER 3009000 |
| 330 | #define SQLITE_SOURCE_ID "2015-10-15 12:06:11 a61880c223c2229ecc3b4da7e5647eca17f7ddf5" |
| 331 | |
| 332 | /* |
| 333 | ** CAPI3REF: Run-Time Library Version Numbers |
| 334 | ** KEYWORDS: sqlite3_version, sqlite3_sourceid |
| 335 | ** |
| @@ -8156,11 +8156,10 @@ | |
| 8156 | |
| 8157 | |
| 8158 | #ifndef _FTS5_H |
| 8159 | #define _FTS5_H |
| 8160 | |
| 8161 | |
| 8162 | #if 0 |
| 8163 | extern "C" { |
| 8164 | #endif |
| 8165 | |
| @@ -10431,11 +10430,11 @@ | |
| 10430 | ** header file that defines a number for each opcode used by the VDBE. |
| 10431 | */ |
| 10432 | /************** Include opcodes.h in the middle of vdbe.h ********************/ |
| 10433 | /************** Begin file opcodes.h *****************************************/ |
| 10434 | /* Automatically generated. Do not edit */ |
| 10435 | /* See the tool/mkopcodeh.tcl script for details */ |
| 10436 | #define OP_Savepoint 1 |
| 10437 | #define OP_AutoCommit 2 |
| 10438 | #define OP_Transaction 3 |
| 10439 | #define OP_SorterNext 4 |
| 10440 | #define OP_PrevIfOpen 5 |
| @@ -10592,11 +10591,10 @@ | |
| 10591 | #define OP_Pagecount 156 |
| 10592 | #define OP_MaxPgcnt 157 |
| 10593 | #define OP_Init 158 /* synopsis: Start at P2 */ |
| 10594 | #define OP_Noop 159 |
| 10595 | #define OP_Explain 160 |
| 10596 | |
| 10597 | /* Properties such as "out2" or "jump" that are specified in |
| 10598 | ** comments following the "case" for each opcode in the vdbe.c |
| 10599 | ** are encoded into bitvectors as follows: |
| 10600 | */ |
| @@ -26245,179 +26243,181 @@ | |
| 26243 | } |
| 26244 | |
| 26245 | /************** End of hash.c ************************************************/ |
| 26246 | /************** Begin file opcodes.c *****************************************/ |
| 26247 | /* Automatically generated. Do not edit */ |
| 26248 | /* See the tool/mkopcodec.tcl script for details. */ |
| 26249 | #if !defined(SQLITE_OMIT_EXPLAIN) \ |
| 26250 | || defined(VDBE_PROFILE) \ |
| 26251 | || defined(SQLITE_DEBUG) |
| 26252 | #if defined(SQLITE_ENABLE_EXPLAIN_COMMENTS) || defined(SQLITE_DEBUG) |
| 26253 | # define OpHelp(X) "\0" X |
| 26254 | #else |
| 26255 | # define OpHelp(X) |
| 26256 | #endif |
| 26257 | SQLITE_PRIVATE const char *sqlite3OpcodeName(int i){ |
| 26258 | static const char *const azName[] = { "?", |
| 26259 | /* 1 */ "Savepoint" OpHelp(""), |
| 26260 | /* 2 */ "AutoCommit" OpHelp(""), |
| 26261 | /* 3 */ "Transaction" OpHelp(""), |
| 26262 | /* 4 */ "SorterNext" OpHelp(""), |
| 26263 | /* 5 */ "PrevIfOpen" OpHelp(""), |
| 26264 | /* 6 */ "NextIfOpen" OpHelp(""), |
| 26265 | /* 7 */ "Prev" OpHelp(""), |
| 26266 | /* 8 */ "Next" OpHelp(""), |
| 26267 | /* 9 */ "Checkpoint" OpHelp(""), |
| 26268 | /* 10 */ "JournalMode" OpHelp(""), |
| 26269 | /* 11 */ "Vacuum" OpHelp(""), |
| 26270 | /* 12 */ "VFilter" OpHelp("iplan=r[P3] zplan='P4'"), |
| 26271 | /* 13 */ "VUpdate" OpHelp("data=r[P3@P2]"), |
| 26272 | /* 14 */ "Goto" OpHelp(""), |
| 26273 | /* 15 */ "Gosub" OpHelp(""), |
| 26274 | /* 16 */ "Return" OpHelp(""), |
| 26275 | /* 17 */ "InitCoroutine" OpHelp(""), |
| 26276 | /* 18 */ "EndCoroutine" OpHelp(""), |
| 26277 | /* 19 */ "Not" OpHelp("r[P2]= !r[P1]"), |
| 26278 | /* 20 */ "Yield" OpHelp(""), |
| 26279 | /* 21 */ "HaltIfNull" OpHelp("if r[P3]=null halt"), |
| 26280 | /* 22 */ "Halt" OpHelp(""), |
| 26281 | /* 23 */ "Integer" OpHelp("r[P2]=P1"), |
| 26282 | /* 24 */ "Int64" OpHelp("r[P2]=P4"), |
| 26283 | /* 25 */ "String" OpHelp("r[P2]='P4' (len=P1)"), |
| 26284 | /* 26 */ "Null" OpHelp("r[P2..P3]=NULL"), |
| 26285 | /* 27 */ "SoftNull" OpHelp("r[P1]=NULL"), |
| 26286 | /* 28 */ "Blob" OpHelp("r[P2]=P4 (len=P1)"), |
| 26287 | /* 29 */ "Variable" OpHelp("r[P2]=parameter(P1,P4)"), |
| 26288 | /* 30 */ "Move" OpHelp("r[P2@P3]=r[P1@P3]"), |
| 26289 | /* 31 */ "Copy" OpHelp("r[P2@P3+1]=r[P1@P3+1]"), |
| 26290 | /* 32 */ "SCopy" OpHelp("r[P2]=r[P1]"), |
| 26291 | /* 33 */ "ResultRow" OpHelp("output=r[P1@P2]"), |
| 26292 | /* 34 */ "CollSeq" OpHelp(""), |
| 26293 | /* 35 */ "Function0" OpHelp("r[P3]=func(r[P2@P5])"), |
| 26294 | /* 36 */ "Function" OpHelp("r[P3]=func(r[P2@P5])"), |
| 26295 | /* 37 */ "AddImm" OpHelp("r[P1]=r[P1]+P2"), |
| 26296 | /* 38 */ "MustBeInt" OpHelp(""), |
| 26297 | /* 39 */ "RealAffinity" OpHelp(""), |
| 26298 | /* 40 */ "Cast" OpHelp("affinity(r[P1])"), |
| 26299 | /* 41 */ "Permutation" OpHelp(""), |
| 26300 | /* 42 */ "Compare" OpHelp("r[P1@P3] <-> r[P2@P3]"), |
| 26301 | /* 43 */ "Jump" OpHelp(""), |
| 26302 | /* 44 */ "Once" OpHelp(""), |
| 26303 | /* 45 */ "If" OpHelp(""), |
| 26304 | /* 46 */ "IfNot" OpHelp(""), |
| 26305 | /* 47 */ "Column" OpHelp("r[P3]=PX"), |
| 26306 | /* 48 */ "Affinity" OpHelp("affinity(r[P1@P2])"), |
| 26307 | /* 49 */ "MakeRecord" OpHelp("r[P3]=mkrec(r[P1@P2])"), |
| 26308 | /* 50 */ "Count" OpHelp("r[P2]=count()"), |
| 26309 | /* 51 */ "ReadCookie" OpHelp(""), |
| 26310 | /* 52 */ "SetCookie" OpHelp(""), |
| 26311 | /* 53 */ "ReopenIdx" OpHelp("root=P2 iDb=P3"), |
| 26312 | /* 54 */ "OpenRead" OpHelp("root=P2 iDb=P3"), |
| 26313 | /* 55 */ "OpenWrite" OpHelp("root=P2 iDb=P3"), |
| 26314 | /* 56 */ "OpenAutoindex" OpHelp("nColumn=P2"), |
| 26315 | /* 57 */ "OpenEphemeral" OpHelp("nColumn=P2"), |
| 26316 | /* 58 */ "SorterOpen" OpHelp(""), |
| 26317 | /* 59 */ "SequenceTest" OpHelp("if( cursor[P1].ctr++ ) pc = P2"), |
| 26318 | /* 60 */ "OpenPseudo" OpHelp("P3 columns in r[P2]"), |
| 26319 | /* 61 */ "Close" OpHelp(""), |
| 26320 | /* 62 */ "ColumnsUsed" OpHelp(""), |
| 26321 | /* 63 */ "SeekLT" OpHelp("key=r[P3@P4]"), |
| 26322 | /* 64 */ "SeekLE" OpHelp("key=r[P3@P4]"), |
| 26323 | /* 65 */ "SeekGE" OpHelp("key=r[P3@P4]"), |
| 26324 | /* 66 */ "SeekGT" OpHelp("key=r[P3@P4]"), |
| 26325 | /* 67 */ "Seek" OpHelp("intkey=r[P2]"), |
| 26326 | /* 68 */ "NoConflict" OpHelp("key=r[P3@P4]"), |
| 26327 | /* 69 */ "NotFound" OpHelp("key=r[P3@P4]"), |
| 26328 | /* 70 */ "Found" OpHelp("key=r[P3@P4]"), |
| 26329 | /* 71 */ "Or" OpHelp("r[P3]=(r[P1] || r[P2])"), |
| 26330 | /* 72 */ "And" OpHelp("r[P3]=(r[P1] && r[P2])"), |
| 26331 | /* 73 */ "NotExists" OpHelp("intkey=r[P3]"), |
| 26332 | /* 74 */ "Sequence" OpHelp("r[P2]=cursor[P1].ctr++"), |
| 26333 | /* 75 */ "NewRowid" OpHelp("r[P2]=rowid"), |
| 26334 | /* 76 */ "IsNull" OpHelp("if r[P1]==NULL goto P2"), |
| 26335 | /* 77 */ "NotNull" OpHelp("if r[P1]!=NULL goto P2"), |
| 26336 | /* 78 */ "Ne" OpHelp("if r[P1]!=r[P3] goto P2"), |
| 26337 | /* 79 */ "Eq" OpHelp("if r[P1]==r[P3] goto P2"), |
| 26338 | /* 80 */ "Gt" OpHelp("if r[P1]>r[P3] goto P2"), |
| 26339 | /* 81 */ "Le" OpHelp("if r[P1]<=r[P3] goto P2"), |
| 26340 | /* 82 */ "Lt" OpHelp("if r[P1]<r[P3] goto P2"), |
| 26341 | /* 83 */ "Ge" OpHelp("if r[P1]>=r[P3] goto P2"), |
| 26342 | /* 84 */ "Insert" OpHelp("intkey=r[P3] data=r[P2]"), |
| 26343 | /* 85 */ "BitAnd" OpHelp("r[P3]=r[P1]&r[P2]"), |
| 26344 | /* 86 */ "BitOr" OpHelp("r[P3]=r[P1]|r[P2]"), |
| 26345 | /* 87 */ "ShiftLeft" OpHelp("r[P3]=r[P2]<<r[P1]"), |
| 26346 | /* 88 */ "ShiftRight" OpHelp("r[P3]=r[P2]>>r[P1]"), |
| 26347 | /* 89 */ "Add" OpHelp("r[P3]=r[P1]+r[P2]"), |
| 26348 | /* 90 */ "Subtract" OpHelp("r[P3]=r[P2]-r[P1]"), |
| 26349 | /* 91 */ "Multiply" OpHelp("r[P3]=r[P1]*r[P2]"), |
| 26350 | /* 92 */ "Divide" OpHelp("r[P3]=r[P2]/r[P1]"), |
| 26351 | /* 93 */ "Remainder" OpHelp("r[P3]=r[P2]%r[P1]"), |
| 26352 | /* 94 */ "Concat" OpHelp("r[P3]=r[P2]+r[P1]"), |
| 26353 | /* 95 */ "InsertInt" OpHelp("intkey=P3 data=r[P2]"), |
| 26354 | /* 96 */ "BitNot" OpHelp("r[P1]= ~r[P1]"), |
| 26355 | /* 97 */ "String8" OpHelp("r[P2]='P4'"), |
| 26356 | /* 98 */ "Delete" OpHelp(""), |
| 26357 | /* 99 */ "ResetCount" OpHelp(""), |
| 26358 | /* 100 */ "SorterCompare" OpHelp("if key(P1)!=trim(r[P3],P4) goto P2"), |
| 26359 | /* 101 */ "SorterData" OpHelp("r[P2]=data"), |
| 26360 | /* 102 */ "RowKey" OpHelp("r[P2]=key"), |
| 26361 | /* 103 */ "RowData" OpHelp("r[P2]=data"), |
| 26362 | /* 104 */ "Rowid" OpHelp("r[P2]=rowid"), |
| 26363 | /* 105 */ "NullRow" OpHelp(""), |
| 26364 | /* 106 */ "Last" OpHelp(""), |
| 26365 | /* 107 */ "SorterSort" OpHelp(""), |
| 26366 | /* 108 */ "Sort" OpHelp(""), |
| 26367 | /* 109 */ "Rewind" OpHelp(""), |
| 26368 | /* 110 */ "SorterInsert" OpHelp(""), |
| 26369 | /* 111 */ "IdxInsert" OpHelp("key=r[P2]"), |
| 26370 | /* 112 */ "IdxDelete" OpHelp("key=r[P2@P3]"), |
| 26371 | /* 113 */ "IdxRowid" OpHelp("r[P2]=rowid"), |
| 26372 | /* 114 */ "IdxLE" OpHelp("key=r[P3@P4]"), |
| 26373 | /* 115 */ "IdxGT" OpHelp("key=r[P3@P4]"), |
| 26374 | /* 116 */ "IdxLT" OpHelp("key=r[P3@P4]"), |
| 26375 | /* 117 */ "IdxGE" OpHelp("key=r[P3@P4]"), |
| 26376 | /* 118 */ "Destroy" OpHelp(""), |
| 26377 | /* 119 */ "Clear" OpHelp(""), |
| 26378 | /* 120 */ "ResetSorter" OpHelp(""), |
| 26379 | /* 121 */ "CreateIndex" OpHelp("r[P2]=root iDb=P1"), |
| 26380 | /* 122 */ "CreateTable" OpHelp("r[P2]=root iDb=P1"), |
| 26381 | /* 123 */ "ParseSchema" OpHelp(""), |
| 26382 | /* 124 */ "LoadAnalysis" OpHelp(""), |
| 26383 | /* 125 */ "DropTable" OpHelp(""), |
| 26384 | /* 126 */ "DropIndex" OpHelp(""), |
| 26385 | /* 127 */ "DropTrigger" OpHelp(""), |
| 26386 | /* 128 */ "IntegrityCk" OpHelp(""), |
| 26387 | /* 129 */ "RowSetAdd" OpHelp("rowset(P1)=r[P2]"), |
| 26388 | /* 130 */ "RowSetRead" OpHelp("r[P3]=rowset(P1)"), |
| 26389 | /* 131 */ "RowSetTest" OpHelp("if r[P3] in rowset(P1) goto P2"), |
| 26390 | /* 132 */ "Program" OpHelp(""), |
| 26391 | /* 133 */ "Real" OpHelp("r[P2]=P4"), |
| 26392 | /* 134 */ "Param" OpHelp(""), |
| 26393 | /* 135 */ "FkCounter" OpHelp("fkctr[P1]+=P2"), |
| 26394 | /* 136 */ "FkIfZero" OpHelp("if fkctr[P1]==0 goto P2"), |
| 26395 | /* 137 */ "MemMax" OpHelp("r[P1]=max(r[P1],r[P2])"), |
| 26396 | /* 138 */ "IfPos" OpHelp("if r[P1]>0 then r[P1]-=P3, goto P2"), |
| 26397 | /* 139 */ "SetIfNotPos" OpHelp("if r[P1]<=0 then r[P2]=P3"), |
| 26398 | /* 140 */ "IfNotZero" OpHelp("if r[P1]!=0 then r[P1]-=P3, goto P2"), |
| 26399 | /* 141 */ "DecrJumpZero" OpHelp("if (--r[P1])==0 goto P2"), |
| 26400 | /* 142 */ "JumpZeroIncr" OpHelp("if (r[P1]++)==0 ) goto P2"), |
| 26401 | /* 143 */ "AggStep0" OpHelp("accum=r[P3] step(r[P2@P5])"), |
| 26402 | /* 144 */ "AggStep" OpHelp("accum=r[P3] step(r[P2@P5])"), |
| 26403 | /* 145 */ "AggFinal" OpHelp("accum=r[P1] N=P2"), |
| 26404 | /* 146 */ "IncrVacuum" OpHelp(""), |
| 26405 | /* 147 */ "Expire" OpHelp(""), |
| 26406 | /* 148 */ "TableLock" OpHelp("iDb=P1 root=P2 write=P3"), |
| 26407 | /* 149 */ "VBegin" OpHelp(""), |
| 26408 | /* 150 */ "VCreate" OpHelp(""), |
| 26409 | /* 151 */ "VDestroy" OpHelp(""), |
| 26410 | /* 152 */ "VOpen" OpHelp(""), |
| 26411 | /* 153 */ "VColumn" OpHelp("r[P3]=vcolumn(P2)"), |
| 26412 | /* 154 */ "VNext" OpHelp(""), |
| 26413 | /* 155 */ "VRename" OpHelp(""), |
| 26414 | /* 156 */ "Pagecount" OpHelp(""), |
| 26415 | /* 157 */ "MaxPgcnt" OpHelp(""), |
| 26416 | /* 158 */ "Init" OpHelp("Start at P2"), |
| 26417 | /* 159 */ "Noop" OpHelp(""), |
| 26418 | /* 160 */ "Explain" OpHelp(""), |
| 26419 | }; |
| 26420 | return azName[i]; |
| 26421 | } |
| 26422 | #endif |
| 26423 | |
| @@ -81055,11 +81055,11 @@ | |
| 81055 | pKeyInfo->nXField += (pKeyInfo->nField - nField); |
| 81056 | pKeyInfo->nField = nField; |
| 81057 | } |
| 81058 | pSorter->pgsz = pgsz = sqlite3BtreeGetPageSize(db->aDb[0].pBt); |
| 81059 | pSorter->nTask = nWorker + 1; |
| 81060 | pSorter->iPrev = (u8)(nWorker - 1); |
| 81061 | pSorter->bUseThreads = (pSorter->nTask>1); |
| 81062 | pSorter->db = db; |
| 81063 | for(i=0; i<pSorter->nTask; i++){ |
| 81064 | SortSubtask *pTask = &pSorter->aTask[i]; |
| 81065 | pTask->pSorter = pSorter; |
| @@ -105178,11 +105178,11 @@ | |
| 105178 | ** loading is supported. We need a dummy sqlite3Apis pointer for that |
| 105179 | ** code if regular extension loading is not available. This is that |
| 105180 | ** dummy pointer. |
| 105181 | */ |
| 105182 | #ifdef SQLITE_OMIT_LOAD_EXTENSION |
| 105183 | static const sqlite3_api_routines sqlite3Apis = { 0 }; |
| 105184 | #endif |
| 105185 | |
| 105186 | |
| 105187 | /* |
| 105188 | ** The following object holds the list of automatically loaded |
| @@ -165554,10 +165554,11 @@ | |
| 165554 | #endif |
| 165555 | return rc; |
| 165556 | } |
| 165557 | |
| 165558 | |
| 165559 | #ifndef SQLITE_CORE |
| 165560 | #ifdef _WIN32 |
| 165561 | __declspec(dllexport) |
| 165562 | #endif |
| 165563 | SQLITE_API int SQLITE_STDCALL sqlite3_json_init( |
| 165564 | sqlite3 *db, |
| @@ -165566,10 +165567,11 @@ | |
| 165567 | ){ |
| 165568 | SQLITE_EXTENSION_INIT2(pApi); |
| 165569 | (void)pzErrMsg; /* Unused parameter */ |
| 165570 | return sqlite3Json1Init(db); |
| 165571 | } |
| 165572 | #endif |
| 165573 | #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_JSON1) */ |
| 165574 | |
| 165575 | /************** End of json1.c ***********************************************/ |
| 165576 | /************** Begin file fts5.c ********************************************/ |
| 165577 | |
| @@ -168133,11 +168135,11 @@ | |
| 168135 | int *pRc, |
| 168136 | HighlightContext *p, |
| 168137 | const char *z, int n |
| 168138 | ){ |
| 168139 | if( *pRc==SQLITE_OK ){ |
| 168140 | if( n<0 ) n = (int)strlen(z); |
| 168141 | p->zOut = sqlite3_mprintf("%z%.*s", p->zOut, n, z); |
| 168142 | if( p->zOut==0 ) *pRc = SQLITE_NOMEM; |
| 168143 | } |
| 168144 | } |
| 168145 | |
| @@ -168647,11 +168649,11 @@ | |
| 168649 | static void sqlite3Fts5BufferAppendString( |
| 168650 | int *pRc, |
| 168651 | Fts5Buffer *pBuf, |
| 168652 | const char *zStr |
| 168653 | ){ |
| 168654 | int nStr = (int)strlen(zStr); |
| 168655 | sqlite3Fts5BufferAppendBlob(pRc, pBuf, nStr+1, (const u8*)zStr); |
| 168656 | pBuf->n--; |
| 168657 | } |
| 168658 | |
| 168659 | /* |
| @@ -168819,11 +168821,11 @@ | |
| 168821 | */ |
| 168822 | static char *sqlite3Fts5Strndup(int *pRc, const char *pIn, int nIn){ |
| 168823 | char *zRet = 0; |
| 168824 | if( *pRc==SQLITE_OK ){ |
| 168825 | if( nIn<0 ){ |
| 168826 | nIn = (int)strlen(pIn); |
| 168827 | } |
| 168828 | zRet = (char*)sqlite3_malloc(nIn+1); |
| 168829 | if( zRet ){ |
| 168830 | memcpy(zRet, pIn, nIn); |
| 168831 | zRet[nIn] = '\0'; |
| @@ -169072,11 +169074,11 @@ | |
| 169074 | const char *zCmd, /* Special command to parse */ |
| 169075 | const char *zArg, /* Argument to parse */ |
| 169076 | char **pzErr /* OUT: Error message */ |
| 169077 | ){ |
| 169078 | int rc = SQLITE_OK; |
| 169079 | int nCmd = (int)strlen(zCmd); |
| 169080 | if( sqlite3_strnicmp("prefix", zCmd, nCmd)==0 ){ |
| 169081 | const int nByte = sizeof(int) * FTS5_MAX_PREFIX_INDEXES; |
| 169082 | const char *p; |
| 169083 | if( pConfig->aPrefix ){ |
| 169084 | *pzErr = sqlite3_mprintf("multiple prefix=... directives"); |
| @@ -169109,11 +169111,11 @@ | |
| 169111 | return rc; |
| 169112 | } |
| 169113 | |
| 169114 | if( sqlite3_strnicmp("tokenize", zCmd, nCmd)==0 ){ |
| 169115 | const char *p = (const char*)zArg; |
| 169116 | int nArg = (int)strlen(zArg) + 1; |
| 169117 | char **azArg = sqlite3Fts5MallocZero(&rc, sizeof(char*) * nArg); |
| 169118 | char *pDel = sqlite3Fts5MallocZero(&rc, nArg * 2); |
| 169119 | char *pSpace = pDel; |
| 169120 | |
| 169121 | if( azArg && pSpace ){ |
| @@ -169225,11 +169227,11 @@ | |
| 169227 | char **pzOut, /* OUT: malloc'd buffer containing str/bw */ |
| 169228 | int *pbQuoted /* OUT: Set to true if dequoting required */ |
| 169229 | ){ |
| 169230 | const char *zRet = 0; |
| 169231 | |
| 169232 | int nIn = (int)strlen(zIn); |
| 169233 | char *zOut = sqlite3_malloc(nIn+1); |
| 169234 | |
| 169235 | assert( *pRc==SQLITE_OK ); |
| 169236 | *pbQuoted = 0; |
| 169237 | *pzOut = 0; |
| @@ -170635,11 +170637,11 @@ | |
| 170637 | if( p->pIter ){ |
| 170638 | sqlite3Fts5IterClose(p->pIter); |
| 170639 | p->pIter = 0; |
| 170640 | } |
| 170641 | rc = sqlite3Fts5IndexQuery( |
| 170642 | pExpr->pIndex, p->zTerm, (int)strlen(p->zTerm), |
| 170643 | (pTerm->bPrefix ? FTS5INDEX_QUERY_PREFIX : 0) | |
| 170644 | (pExpr->bDesc ? FTS5INDEX_QUERY_DESC : 0), |
| 170645 | pNear->pColset, |
| 170646 | &p->pIter |
| 170647 | ); |
| @@ -171246,11 +171248,11 @@ | |
| 171248 | rc = fts5ParseStringFromToken(pToken, &z); |
| 171249 | if( rc==SQLITE_OK ){ |
| 171250 | int flags = FTS5_TOKENIZE_QUERY | (bPrefix ? FTS5_TOKENIZE_QUERY : 0); |
| 171251 | int n; |
| 171252 | sqlite3Fts5Dequote(z); |
| 171253 | n = (int)strlen(z); |
| 171254 | rc = sqlite3Fts5Tokenize(pConfig, flags, z, n, &sCtx, fts5ParseTokenize); |
| 171255 | } |
| 171256 | sqlite3_free(z); |
| 171257 | if( rc || (rc = sCtx.rc) ){ |
| 171258 | pParse->rc = rc; |
| @@ -171319,11 +171321,12 @@ | |
| 171321 | for(i=0; rc==SQLITE_OK && i<pOrig->nTerm; i++){ |
| 171322 | int tflags = 0; |
| 171323 | Fts5ExprTerm *p; |
| 171324 | for(p=&pOrig->aTerm[i]; p && rc==SQLITE_OK; p=p->pSynonym){ |
| 171325 | const char *zTerm = p->zTerm; |
| 171326 | rc = fts5ParseTokenize((void*)&sCtx, tflags, zTerm, (int)strlen(zTerm), |
| 171327 | 0, 0); |
| 171328 | tflags = FTS5_TOKEN_COLOCATED; |
| 171329 | } |
| 171330 | if( rc==SQLITE_OK ){ |
| 171331 | sCtx.pPhrase->aTerm[i].bPrefix = pOrig->aTerm[i].bPrefix; |
| 171332 | } |
| @@ -171561,11 +171564,11 @@ | |
| 171564 | Fts5ExprTerm *p; |
| 171565 | char *zQuoted; |
| 171566 | |
| 171567 | /* Determine the maximum amount of space required. */ |
| 171568 | for(p=pTerm; p; p=p->pSynonym){ |
| 171569 | nByte += (int)strlen(pTerm->zTerm) * 2 + 3 + 2; |
| 171570 | } |
| 171571 | zQuoted = sqlite3_malloc(nByte); |
| 171572 | |
| 171573 | if( zQuoted ){ |
| 171574 | int i = 0; |
| @@ -172134,11 +172137,11 @@ | |
| 172137 | for(i=0; i<pHash->nSlot; i++){ |
| 172138 | while( apOld[i] ){ |
| 172139 | int iHash; |
| 172140 | Fts5HashEntry *p = apOld[i]; |
| 172141 | apOld[i] = p->pHashNext; |
| 172142 | iHash = fts5HashKey(nNew, (u8*)p->zKey, (int)strlen(p->zKey)); |
| 172143 | p->pHashNext = apNew[iHash]; |
| 172144 | apNew[iHash] = p; |
| 172145 | } |
| 172146 | } |
| 172147 | |
| @@ -172422,11 +172425,11 @@ | |
| 172425 | const u8 **ppDoclist, /* OUT: pointer to doclist */ |
| 172426 | int *pnDoclist /* OUT: size of doclist in bytes */ |
| 172427 | ){ |
| 172428 | Fts5HashEntry *p; |
| 172429 | if( (p = pHash->pScan) ){ |
| 172430 | int nTerm = (int)strlen(p->zKey); |
| 172431 | fts5HashAddPoslistSize(p); |
| 172432 | *pzTerm = p->zKey; |
| 172433 | *ppDoclist = (const u8*)&p->zKey[nTerm+1]; |
| 172434 | *pnDoclist = p->nData - (FTS5_HASHENTRYSIZE + nTerm + 1); |
| 172435 | }else{ |
| @@ -174202,10 +174205,11 @@ | |
| 174205 | |
| 174206 | }else if( pIter->pSeg==0 ){ |
| 174207 | const u8 *pList = 0; |
| 174208 | const char *zTerm = 0; |
| 174209 | int nList = 0; |
| 174210 | assert( (pIter->flags & FTS5_SEGITER_ONETERM) || pbNewTerm ); |
| 174211 | if( 0==(pIter->flags & FTS5_SEGITER_ONETERM) ){ |
| 174212 | sqlite3Fts5HashScanNext(p->pHash); |
| 174213 | sqlite3Fts5HashScanEntry(p->pHash, &zTerm, &pList, &nList); |
| 174214 | } |
| 174215 | if( pList==0 ){ |
| @@ -174214,13 +174218,14 @@ | |
| 174218 | }else{ |
| 174219 | pIter->pLeaf->p = (u8*)pList; |
| 174220 | pIter->pLeaf->nn = nList; |
| 174221 | pIter->pLeaf->szLeaf = nList; |
| 174222 | pIter->iEndofDoclist = nList+1; |
| 174223 | sqlite3Fts5BufferSet(&p->rc, &pIter->term, (int)strlen(zTerm), |
| 174224 | (u8*)zTerm); |
| 174225 | pIter->iLeafOffset = fts5GetVarint(pList, (u64*)&pIter->iRowid); |
| 174226 | *pbNewTerm = 1; |
| 174227 | } |
| 174228 | }else{ |
| 174229 | iOff = 0; |
| 174230 | /* Next entry is not on the current page */ |
| 174231 | while( iOff==0 ){ |
| @@ -174621,11 +174626,11 @@ | |
| 174626 | assert( p->rc==SQLITE_OK ); |
| 174627 | |
| 174628 | if( pTerm==0 || (flags & FTS5INDEX_QUERY_SCAN) ){ |
| 174629 | p->rc = sqlite3Fts5HashScanInit(p->pHash, (const char*)pTerm, nTerm); |
| 174630 | sqlite3Fts5HashScanEntry(p->pHash, (const char**)&z, &pList, &nList); |
| 174631 | n = (z ? (int)strlen((const char*)z) : 0); |
| 174632 | }else{ |
| 174633 | pIter->flags |= FTS5_SEGITER_ONETERM; |
| 174634 | sqlite3Fts5HashQuery(p->pHash, (const char*)pTerm, nTerm, &pList, &nList); |
| 174635 | z = pTerm; |
| 174636 | n = nTerm; |
| @@ -176194,11 +176199,11 @@ | |
| 176199 | const u8 *pDoclist; /* Pointer to doclist for this term */ |
| 176200 | int nDoclist; /* Size of doclist in bytes */ |
| 176201 | |
| 176202 | /* Write the term for this entry to disk. */ |
| 176203 | sqlite3Fts5HashScanEntry(pHash, &zTerm, &pDoclist, &nDoclist); |
| 176204 | fts5WriteAppendTerm(p, &writer, (int)strlen(zTerm), (const u8*)zTerm); |
| 176205 | |
| 176206 | assert( writer.bFirstRowidInPage==0 ); |
| 176207 | if( pgsz>=(pBuf->n + pPgidx->n + nDoclist + 1) ){ |
| 176208 | /* The entire doclist will fit on the current leaf. */ |
| 176209 | fts5BufferSafeAppendBlob(pBuf, pDoclist, nDoclist); |
| @@ -176470,11 +176475,11 @@ | |
| 176475 | fts5ChunkIterate(p, pSeg, (void*)pBuf, fts5PoslistCallback); |
| 176476 | }else{ |
| 176477 | PoslistCallbackCtx sCtx; |
| 176478 | sCtx.pBuf = pBuf; |
| 176479 | sCtx.pColset = pColset; |
| 176480 | sCtx.eState = fts5IndexColsetTest(pColset, 0); |
| 176481 | assert( sCtx.eState==0 || sCtx.eState==1 ); |
| 176482 | fts5ChunkIterate(p, pSeg, (void*)&sCtx, fts5PoslistFilterCallback); |
| 176483 | } |
| 176484 | } |
| 176485 | } |
| @@ -177632,11 +177637,10 @@ | |
| 177637 | fts5IntegrityCheckPgidx(p, pLeaf); |
| 177638 | } |
| 177639 | fts5DataRelease(pLeaf); |
| 177640 | if( p->rc ) break; |
| 177641 | |
| 177642 | /* Now check that the iter.nEmpty leaves following the current leaf |
| 177643 | ** (a) exist and (b) contain no terms. */ |
| 177644 | fts5IndexIntegrityCheckEmpty( |
| 177645 | p, pSeg, iIdxPrevLeaf+1, iDlidxPrevLeaf+1, iIdxLeaf-1 |
| 177646 | ); |
| @@ -178618,11 +178622,14 @@ | |
| 178622 | ** extension is currently being used by a version of SQLite too old to |
| 178623 | ** support index-info flags. In that case this function is a no-op. |
| 178624 | */ |
| 178625 | static void fts5SetUniqueFlag(sqlite3_index_info *pIdxInfo){ |
| 178626 | #if SQLITE_VERSION_NUMBER>=3008012 |
| 178627 | #ifndef SQLITE_CORE |
| 178628 | if( sqlite3_libversion_number()>=3008012 ) |
| 178629 | #endif |
| 178630 | { |
| 178631 | pIdxInfo->idxFlags |= SQLITE_INDEX_SCAN_UNIQUE; |
| 178632 | } |
| 178633 | #endif |
| 178634 | } |
| 178635 | |
| @@ -180565,11 +180572,11 @@ | |
| 180572 | sqlite3_context *pCtx, /* Function call context */ |
| 180573 | int nArg, /* Number of args */ |
| 180574 | sqlite3_value **apVal /* Function arguments */ |
| 180575 | ){ |
| 180576 | assert( nArg==0 ); |
| 180577 | sqlite3_result_text(pCtx, "fts5: 2015-10-14 23:04:08 54127602b9a555f73f5e446b91e460386cb8fb17", -1, SQLITE_TRANSIENT); |
| 180578 | } |
| 180579 | |
| 180580 | static int fts5Init(sqlite3 *db){ |
| 180581 | static const sqlite3_module fts5Mod = { |
| 180582 | /* iVersion */ 2, |
| @@ -180968,14 +180975,14 @@ | |
| 180975 | rc = SQLITE_NOMEM; |
| 180976 | }else{ |
| 180977 | int i; |
| 180978 | int iOff; |
| 180979 | sqlite3_snprintf(nDefn, zDefn, "id INTEGER PRIMARY KEY"); |
| 180980 | iOff = (int)strlen(zDefn); |
| 180981 | for(i=0; i<pConfig->nCol; i++){ |
| 180982 | sqlite3_snprintf(nDefn-iOff, &zDefn[iOff], ", c%d", i); |
| 180983 | iOff += (int)strlen(&zDefn[iOff]); |
| 180984 | } |
| 180985 | rc = sqlite3Fts5CreateTable(pConfig, "content", zDefn, 0, pzErr); |
| 180986 | } |
| 180987 | sqlite3_free(zDefn); |
| 180988 | } |
| @@ -181396,21 +181403,11 @@ | |
| 181403 | rc = fts5StorageNewRowid(p, piRowid); |
| 181404 | } |
| 181405 | }else{ |
| 181406 | sqlite3_stmt *pInsert = 0; /* Statement to write %_content table */ |
| 181407 | int i; /* Counter variable */ |
| 181408 | rc = fts5StorageGetStmt(p, FTS5_STMT_INSERT_CONTENT, &pInsert, 0); |
| 181409 | for(i=1; rc==SQLITE_OK && i<=pConfig->nCol+1; i++){ |
| 181410 | rc = sqlite3_bind_value(pInsert, i, apVal[i]); |
| 181411 | } |
| 181412 | if( rc==SQLITE_OK ){ |
| 181413 | sqlite3_step(pInsert); |
| @@ -182024,11 +182021,11 @@ | |
| 182021 | Unicode61Tokenizer *p, /* Tokenizer object */ |
| 182022 | const char *z, /* Characters to treat as exceptions */ |
| 182023 | int bTokenChars /* 1 for 'tokenchars', 0 for 'separators' */ |
| 182024 | ){ |
| 182025 | int rc = SQLITE_OK; |
| 182026 | int n = (int)strlen(z); |
| 182027 | int *aNew; |
| 182028 | |
| 182029 | if( n>0 ){ |
| 182030 | aNew = (int*)sqlite3_realloc(p->aiException, (n+p->nException)*sizeof(int)); |
| 182031 | if( aNew ){ |
| @@ -183888,12 +183885,12 @@ | |
| 183885 | }else{ |
| 183886 | int nByte; /* Bytes of space to allocate */ |
| 183887 | const char *zDb = bDb ? argv[3] : argv[1]; |
| 183888 | const char *zTab = bDb ? argv[4] : argv[3]; |
| 183889 | const char *zType = bDb ? argv[5] : argv[4]; |
| 183890 | int nDb = (int)strlen(zDb)+1; |
| 183891 | int nTab = (int)strlen(zTab)+1; |
| 183892 | int eType; |
| 183893 | |
| 183894 | rc = fts5VocabTableType(zType, pzErr, &eType); |
| 183895 | if( rc==SQLITE_OK ){ |
| 183896 | assert( eType>=0 && eType<sizeof(azSchema)/sizeof(azSchema[0]) ); |
| 183897 |
+1
-2
| --- src/sqlite3.h | ||
| +++ src/sqlite3.h | ||
| @@ -111,11 +111,11 @@ | ||
| 111 | 111 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 112 | 112 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 113 | 113 | */ |
| 114 | 114 | #define SQLITE_VERSION "3.9.0" |
| 115 | 115 | #define SQLITE_VERSION_NUMBER 3009000 |
| 116 | -#define SQLITE_SOURCE_ID "2015-10-14 12:29:53 a721fc0d89495518fe5612e2e3bbc60befd2e90d" | |
| 116 | +#define SQLITE_SOURCE_ID "2015-10-15 12:06:11 a61880c223c2229ecc3b4da7e5647eca17f7ddf5" | |
| 117 | 117 | |
| 118 | 118 | /* |
| 119 | 119 | ** CAPI3REF: Run-Time Library Version Numbers |
| 120 | 120 | ** KEYWORDS: sqlite3_version, sqlite3_sourceid |
| 121 | 121 | ** |
| @@ -7942,11 +7942,10 @@ | ||
| 7942 | 7942 | |
| 7943 | 7943 | |
| 7944 | 7944 | #ifndef _FTS5_H |
| 7945 | 7945 | #define _FTS5_H |
| 7946 | 7946 | |
| 7947 | -#include "sqlite3.h" | |
| 7948 | 7947 | |
| 7949 | 7948 | #ifdef __cplusplus |
| 7950 | 7949 | extern "C" { |
| 7951 | 7950 | #endif |
| 7952 | 7951 | |
| 7953 | 7952 |
| --- src/sqlite3.h | |
| +++ src/sqlite3.h | |
| @@ -111,11 +111,11 @@ | |
| 111 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 112 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 113 | */ |
| 114 | #define SQLITE_VERSION "3.9.0" |
| 115 | #define SQLITE_VERSION_NUMBER 3009000 |
| 116 | #define SQLITE_SOURCE_ID "2015-10-14 12:29:53 a721fc0d89495518fe5612e2e3bbc60befd2e90d" |
| 117 | |
| 118 | /* |
| 119 | ** CAPI3REF: Run-Time Library Version Numbers |
| 120 | ** KEYWORDS: sqlite3_version, sqlite3_sourceid |
| 121 | ** |
| @@ -7942,11 +7942,10 @@ | |
| 7942 | |
| 7943 | |
| 7944 | #ifndef _FTS5_H |
| 7945 | #define _FTS5_H |
| 7946 | |
| 7947 | #include "sqlite3.h" |
| 7948 | |
| 7949 | #ifdef __cplusplus |
| 7950 | extern "C" { |
| 7951 | #endif |
| 7952 | |
| 7953 |
| --- src/sqlite3.h | |
| +++ src/sqlite3.h | |
| @@ -111,11 +111,11 @@ | |
| 111 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 112 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 113 | */ |
| 114 | #define SQLITE_VERSION "3.9.0" |
| 115 | #define SQLITE_VERSION_NUMBER 3009000 |
| 116 | #define SQLITE_SOURCE_ID "2015-10-15 12:06:11 a61880c223c2229ecc3b4da7e5647eca17f7ddf5" |
| 117 | |
| 118 | /* |
| 119 | ** CAPI3REF: Run-Time Library Version Numbers |
| 120 | ** KEYWORDS: sqlite3_version, sqlite3_sourceid |
| 121 | ** |
| @@ -7942,11 +7942,10 @@ | |
| 7942 | |
| 7943 | |
| 7944 | #ifndef _FTS5_H |
| 7945 | #define _FTS5_H |
| 7946 | |
| 7947 | |
| 7948 | #ifdef __cplusplus |
| 7949 | extern "C" { |
| 7950 | #endif |
| 7951 | |
| 7952 |