| | @@ -1,8 +1,8 @@ |
| 1 | 1 | /****************************************************************************** |
| 2 | 2 | ** This file is an amalgamation of many separate C source files from SQLite |
| 3 | | -** version 3.37.0. By combining all the individual C code files into this |
| 3 | +** version 3.38.0. By combining all the individual C code files into this |
| 4 | 4 | ** single large file, the entire code can be compiled as a single translation |
| 5 | 5 | ** unit. This allows many compilers to do optimizations that would not be |
| 6 | 6 | ** possible if the files were compiled separately. Performance improvements |
| 7 | 7 | ** of 5% or more are commonly seen when SQLite is compiled as a single |
| 8 | 8 | ** translation unit. |
| | @@ -450,13 +450,13 @@ |
| 450 | 450 | ** |
| 451 | 451 | ** See also: [sqlite3_libversion()], |
| 452 | 452 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 453 | 453 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 454 | 454 | */ |
| 455 | | -#define SQLITE_VERSION "3.37.0" |
| 456 | | -#define SQLITE_VERSION_NUMBER 3037000 |
| 457 | | -#define SQLITE_SOURCE_ID "2021-11-22 16:06:57 0f567b61072e214c40cae1441889f83622a975f429b41803dfbed687718731c8" |
| 455 | +#define SQLITE_VERSION "3.38.0" |
| 456 | +#define SQLITE_VERSION_NUMBER 3038000 |
| 457 | +#define SQLITE_SOURCE_ID "2021-12-09 20:06:18 633bfeeea2bccdd44126acf3f61ecca163c9d933bdc787a2c18a697dc9406882" |
| 458 | 458 | |
| 459 | 459 | /* |
| 460 | 460 | ** CAPI3REF: Run-Time Library Version Numbers |
| 461 | 461 | ** KEYWORDS: sqlite3_version sqlite3_sourceid |
| 462 | 462 | ** |
| | @@ -8248,11 +8248,12 @@ |
| 8248 | 8248 | #define SQLITE_TESTCTRL_PRNG_SEED 28 |
| 8249 | 8249 | #define SQLITE_TESTCTRL_EXTRA_SCHEMA_CHECKS 29 |
| 8250 | 8250 | #define SQLITE_TESTCTRL_SEEK_COUNT 30 |
| 8251 | 8251 | #define SQLITE_TESTCTRL_TRACEFLAGS 31 |
| 8252 | 8252 | #define SQLITE_TESTCTRL_TUNE 32 |
| 8253 | | -#define SQLITE_TESTCTRL_LAST 32 /* Largest TESTCTRL */ |
| 8253 | +#define SQLITE_TESTCTRL_LOGEST 33 |
| 8254 | +#define SQLITE_TESTCTRL_LAST 33 /* Largest TESTCTRL */ |
| 8254 | 8255 | |
| 8255 | 8256 | /* |
| 8256 | 8257 | ** CAPI3REF: SQL Keyword Checking |
| 8257 | 8258 | ** |
| 8258 | 8259 | ** These routines provide access to the set of SQL language keywords |
| | @@ -8770,10 +8771,20 @@ |
| 8770 | 8771 | ** <dd>^This is the number of times that the prepared statement has |
| 8771 | 8772 | ** been run. A single "run" for the purposes of this counter is one |
| 8772 | 8773 | ** or more calls to [sqlite3_step()] followed by a call to [sqlite3_reset()]. |
| 8773 | 8774 | ** The counter is incremented on the first [sqlite3_step()] call of each |
| 8774 | 8775 | ** cycle. |
| 8776 | +** |
| 8777 | +** [[SQLITE_STMTSTATUS_FILTER_MISS]] |
| 8778 | +** [[SQLITE_STMTSTATUS_FILTER HIT]] |
| 8779 | +** <dt>SQLITE_STMTSTATUS_FILTER_HIT<br> |
| 8780 | +** SQLITE_STMTSTATUS_FILTER_MISS</dt> |
| 8781 | +** <dd>^SQLITE_STMTSTATUS_FILTER_HIT is the number of times that a join |
| 8782 | +** step was bypassed because a Bloom filter returned not-found. The |
| 8783 | +** corresponding SQLITE_STMTSTATUS_FILTER_MISS value is the number of |
| 8784 | +** times that the Bloom filter returned a find, and thus the join step |
| 8785 | +** had to be processed as normal. |
| 8775 | 8786 | ** |
| 8776 | 8787 | ** [[SQLITE_STMTSTATUS_MEMUSED]] <dt>SQLITE_STMTSTATUS_MEMUSED</dt> |
| 8777 | 8788 | ** <dd>^This is the approximate number of bytes of heap memory |
| 8778 | 8789 | ** used to store the prepared statement. ^This value is not actually |
| 8779 | 8790 | ** a counter, and so the resetFlg parameter to sqlite3_stmt_status() |
| | @@ -8785,10 +8796,12 @@ |
| 8785 | 8796 | #define SQLITE_STMTSTATUS_SORT 2 |
| 8786 | 8797 | #define SQLITE_STMTSTATUS_AUTOINDEX 3 |
| 8787 | 8798 | #define SQLITE_STMTSTATUS_VM_STEP 4 |
| 8788 | 8799 | #define SQLITE_STMTSTATUS_REPREPARE 5 |
| 8789 | 8800 | #define SQLITE_STMTSTATUS_RUN 6 |
| 8801 | +#define SQLITE_STMTSTATUS_FILTER_MISS 7 |
| 8802 | +#define SQLITE_STMTSTATUS_FILTER_HIT 8 |
| 8790 | 8803 | #define SQLITE_STMTSTATUS_MEMUSED 99 |
| 8791 | 8804 | |
| 8792 | 8805 | /* |
| 8793 | 8806 | ** CAPI3REF: Custom Page Cache Object |
| 8794 | 8807 | ** |
| | @@ -13552,14 +13565,14 @@ |
| 13552 | 13565 | #define TK_DETACH 40 |
| 13553 | 13566 | #define TK_EACH 41 |
| 13554 | 13567 | #define TK_FAIL 42 |
| 13555 | 13568 | #define TK_OR 43 |
| 13556 | 13569 | #define TK_AND 44 |
| 13557 | | -#define TK_IS 45 |
| 13558 | | -#define TK_MATCH 46 |
| 13559 | | -#define TK_LIKE_KW 47 |
| 13560 | | -#define TK_BETWEEN 48 |
| 13570 | +#define TK_MATCH 45 |
| 13571 | +#define TK_LIKE_KW 46 |
| 13572 | +#define TK_BETWEEN 47 |
| 13573 | +#define TK_IS 48 |
| 13561 | 13574 | #define TK_IN 49 |
| 13562 | 13575 | #define TK_ISNULL 50 |
| 13563 | 13576 | #define TK_NOTNULL 51 |
| 13564 | 13577 | #define TK_NE 52 |
| 13565 | 13578 | #define TK_EQ 53 |
| | @@ -13796,11 +13809,11 @@ |
| 13796 | 13809 | ** The default initial allocation for the pagecache when using separate |
| 13797 | 13810 | ** pagecaches for each database connection. A positive number is the |
| 13798 | 13811 | ** number of pages. A negative number N translations means that a buffer |
| 13799 | 13812 | ** of -1024*N bytes is allocated and used for as many pages as it will hold. |
| 13800 | 13813 | ** |
| 13801 | | -** The default value of "20" was choosen to minimize the run-time of the |
| 13814 | +** The default value of "20" was chosen to minimize the run-time of the |
| 13802 | 13815 | ** speedtest1 test program with options: --shrink-memory --reprepare |
| 13803 | 13816 | */ |
| 13804 | 13817 | #ifndef SQLITE_DEFAULT_PCACHE_INITSZ |
| 13805 | 13818 | # define SQLITE_DEFAULT_PCACHE_INITSZ 20 |
| 13806 | 13819 | #endif |
| | @@ -15251,49 +15264,49 @@ |
| 15251 | 15264 | #define OP_ElseEq 58 /* jump, same as TK_ESCAPE */ |
| 15252 | 15265 | #define OP_IfNotZero 59 /* jump, synopsis: if r[P1]!=0 then r[P1]--, goto P2 */ |
| 15253 | 15266 | #define OP_DecrJumpZero 60 /* jump, synopsis: if (--r[P1])==0 goto P2 */ |
| 15254 | 15267 | #define OP_IncrVacuum 61 /* jump */ |
| 15255 | 15268 | #define OP_VNext 62 /* jump */ |
| 15256 | | -#define OP_Init 63 /* jump, synopsis: Start at P2 */ |
| 15257 | | -#define OP_PureFunc 64 /* synopsis: r[P3]=func(r[P2@NP]) */ |
| 15258 | | -#define OP_Function 65 /* synopsis: r[P3]=func(r[P2@NP]) */ |
| 15259 | | -#define OP_Return 66 |
| 15260 | | -#define OP_EndCoroutine 67 |
| 15261 | | -#define OP_HaltIfNull 68 /* synopsis: if r[P3]=null halt */ |
| 15262 | | -#define OP_Halt 69 |
| 15263 | | -#define OP_Integer 70 /* synopsis: r[P2]=P1 */ |
| 15264 | | -#define OP_Int64 71 /* synopsis: r[P2]=P4 */ |
| 15265 | | -#define OP_String 72 /* synopsis: r[P2]='P4' (len=P1) */ |
| 15266 | | -#define OP_Null 73 /* synopsis: r[P2..P3]=NULL */ |
| 15267 | | -#define OP_SoftNull 74 /* synopsis: r[P1]=NULL */ |
| 15268 | | -#define OP_Blob 75 /* synopsis: r[P2]=P4 (len=P1) */ |
| 15269 | | -#define OP_Variable 76 /* synopsis: r[P2]=parameter(P1,P4) */ |
| 15270 | | -#define OP_Move 77 /* synopsis: r[P2@P3]=r[P1@P3] */ |
| 15271 | | -#define OP_Copy 78 /* synopsis: r[P2@P3+1]=r[P1@P3+1] */ |
| 15272 | | -#define OP_SCopy 79 /* synopsis: r[P2]=r[P1] */ |
| 15273 | | -#define OP_IntCopy 80 /* synopsis: r[P2]=r[P1] */ |
| 15274 | | -#define OP_ChngCntRow 81 /* synopsis: output=r[P1] */ |
| 15275 | | -#define OP_ResultRow 82 /* synopsis: output=r[P1@P2] */ |
| 15276 | | -#define OP_CollSeq 83 |
| 15277 | | -#define OP_AddImm 84 /* synopsis: r[P1]=r[P1]+P2 */ |
| 15278 | | -#define OP_RealAffinity 85 |
| 15279 | | -#define OP_Cast 86 /* synopsis: affinity(r[P1]) */ |
| 15280 | | -#define OP_Permutation 87 |
| 15281 | | -#define OP_Compare 88 /* synopsis: r[P1@P3] <-> r[P2@P3] */ |
| 15282 | | -#define OP_IsTrue 89 /* synopsis: r[P2] = coalesce(r[P1]==TRUE,P3) ^ P4 */ |
| 15283 | | -#define OP_ZeroOrNull 90 /* synopsis: r[P2] = 0 OR NULL */ |
| 15284 | | -#define OP_Offset 91 /* synopsis: r[P3] = sqlite_offset(P1) */ |
| 15285 | | -#define OP_Column 92 /* synopsis: r[P3]=PX */ |
| 15286 | | -#define OP_TypeCheck 93 /* synopsis: typecheck(r[P1@P2]) */ |
| 15287 | | -#define OP_Affinity 94 /* synopsis: affinity(r[P1@P2]) */ |
| 15288 | | -#define OP_MakeRecord 95 /* synopsis: r[P3]=mkrec(r[P1@P2]) */ |
| 15289 | | -#define OP_Count 96 /* synopsis: r[P2]=count() */ |
| 15290 | | -#define OP_ReadCookie 97 |
| 15291 | | -#define OP_SetCookie 98 |
| 15292 | | -#define OP_ReopenIdx 99 /* synopsis: root=P2 iDb=P3 */ |
| 15293 | | -#define OP_OpenRead 100 /* synopsis: root=P2 iDb=P3 */ |
| 15294 | | -#define OP_OpenWrite 101 /* synopsis: root=P2 iDb=P3 */ |
| 15269 | +#define OP_Filter 63 /* jump, synopsis: if key(P3@P4) not in filter(P1) goto P2 */ |
| 15270 | +#define OP_Init 64 /* jump, synopsis: Start at P2 */ |
| 15271 | +#define OP_PureFunc 65 /* synopsis: r[P3]=func(r[P2@NP]) */ |
| 15272 | +#define OP_Function 66 /* synopsis: r[P3]=func(r[P2@NP]) */ |
| 15273 | +#define OP_Return 67 |
| 15274 | +#define OP_EndCoroutine 68 |
| 15275 | +#define OP_HaltIfNull 69 /* synopsis: if r[P3]=null halt */ |
| 15276 | +#define OP_Halt 70 |
| 15277 | +#define OP_Integer 71 /* synopsis: r[P2]=P1 */ |
| 15278 | +#define OP_Int64 72 /* synopsis: r[P2]=P4 */ |
| 15279 | +#define OP_String 73 /* synopsis: r[P2]='P4' (len=P1) */ |
| 15280 | +#define OP_Null 74 /* synopsis: r[P2..P3]=NULL */ |
| 15281 | +#define OP_SoftNull 75 /* synopsis: r[P1]=NULL */ |
| 15282 | +#define OP_Blob 76 /* synopsis: r[P2]=P4 (len=P1) */ |
| 15283 | +#define OP_Variable 77 /* synopsis: r[P2]=parameter(P1,P4) */ |
| 15284 | +#define OP_Move 78 /* synopsis: r[P2@P3]=r[P1@P3] */ |
| 15285 | +#define OP_Copy 79 /* synopsis: r[P2@P3+1]=r[P1@P3+1] */ |
| 15286 | +#define OP_SCopy 80 /* synopsis: r[P2]=r[P1] */ |
| 15287 | +#define OP_IntCopy 81 /* synopsis: r[P2]=r[P1] */ |
| 15288 | +#define OP_FkCheck 82 |
| 15289 | +#define OP_ResultRow 83 /* synopsis: output=r[P1@P2] */ |
| 15290 | +#define OP_CollSeq 84 |
| 15291 | +#define OP_AddImm 85 /* synopsis: r[P1]=r[P1]+P2 */ |
| 15292 | +#define OP_RealAffinity 86 |
| 15293 | +#define OP_Cast 87 /* synopsis: affinity(r[P1]) */ |
| 15294 | +#define OP_Permutation 88 |
| 15295 | +#define OP_Compare 89 /* synopsis: r[P1@P3] <-> r[P2@P3] */ |
| 15296 | +#define OP_IsTrue 90 /* synopsis: r[P2] = coalesce(r[P1]==TRUE,P3) ^ P4 */ |
| 15297 | +#define OP_ZeroOrNull 91 /* synopsis: r[P2] = 0 OR NULL */ |
| 15298 | +#define OP_Offset 92 /* synopsis: r[P3] = sqlite_offset(P1) */ |
| 15299 | +#define OP_Column 93 /* synopsis: r[P3]=PX */ |
| 15300 | +#define OP_TypeCheck 94 /* synopsis: typecheck(r[P1@P2]) */ |
| 15301 | +#define OP_Affinity 95 /* synopsis: affinity(r[P1@P2]) */ |
| 15302 | +#define OP_MakeRecord 96 /* synopsis: r[P3]=mkrec(r[P1@P2]) */ |
| 15303 | +#define OP_Count 97 /* synopsis: r[P2]=count() */ |
| 15304 | +#define OP_ReadCookie 98 |
| 15305 | +#define OP_SetCookie 99 |
| 15306 | +#define OP_ReopenIdx 100 /* synopsis: root=P2 iDb=P3 */ |
| 15307 | +#define OP_OpenRead 101 /* synopsis: root=P2 iDb=P3 */ |
| 15295 | 15308 | #define OP_BitAnd 102 /* same as TK_BITAND, synopsis: r[P3]=r[P1]&r[P2] */ |
| 15296 | 15309 | #define OP_BitOr 103 /* same as TK_BITOR, synopsis: r[P3]=r[P1]|r[P2] */ |
| 15297 | 15310 | #define OP_ShiftLeft 104 /* same as TK_LSHIFT, synopsis: r[P3]=r[P2]<<r[P1] */ |
| 15298 | 15311 | #define OP_ShiftRight 105 /* same as TK_RSHIFT, synopsis: r[P3]=r[P2]>>r[P1] */ |
| 15299 | 15312 | #define OP_Add 106 /* same as TK_PLUS, synopsis: r[P3]=r[P1]+r[P2] */ |
| | @@ -15300,80 +15313,82 @@ |
| 15300 | 15313 | #define OP_Subtract 107 /* same as TK_MINUS, synopsis: r[P3]=r[P2]-r[P1] */ |
| 15301 | 15314 | #define OP_Multiply 108 /* same as TK_STAR, synopsis: r[P3]=r[P1]*r[P2] */ |
| 15302 | 15315 | #define OP_Divide 109 /* same as TK_SLASH, synopsis: r[P3]=r[P2]/r[P1] */ |
| 15303 | 15316 | #define OP_Remainder 110 /* same as TK_REM, synopsis: r[P3]=r[P2]%r[P1] */ |
| 15304 | 15317 | #define OP_Concat 111 /* same as TK_CONCAT, synopsis: r[P3]=r[P2]+r[P1] */ |
| 15305 | | -#define OP_OpenDup 112 |
| 15318 | +#define OP_OpenWrite 112 /* synopsis: root=P2 iDb=P3 */ |
| 15306 | 15319 | #define OP_BitNot 113 /* same as TK_BITNOT, synopsis: r[P2]= ~r[P1] */ |
| 15307 | | -#define OP_OpenAutoindex 114 /* synopsis: nColumn=P2 */ |
| 15308 | | -#define OP_OpenEphemeral 115 /* synopsis: nColumn=P2 */ |
| 15320 | +#define OP_OpenDup 114 |
| 15321 | +#define OP_OpenAutoindex 115 /* synopsis: nColumn=P2 */ |
| 15309 | 15322 | #define OP_String8 116 /* same as TK_STRING, synopsis: r[P2]='P4' */ |
| 15310 | | -#define OP_SorterOpen 117 |
| 15311 | | -#define OP_SequenceTest 118 /* synopsis: if( cursor[P1].ctr++ ) pc = P2 */ |
| 15312 | | -#define OP_OpenPseudo 119 /* synopsis: P3 columns in r[P2] */ |
| 15313 | | -#define OP_Close 120 |
| 15314 | | -#define OP_ColumnsUsed 121 |
| 15315 | | -#define OP_SeekScan 122 /* synopsis: Scan-ahead up to P1 rows */ |
| 15316 | | -#define OP_SeekHit 123 /* synopsis: set P2<=seekHit<=P3 */ |
| 15317 | | -#define OP_Sequence 124 /* synopsis: r[P2]=cursor[P1].ctr++ */ |
| 15318 | | -#define OP_NewRowid 125 /* synopsis: r[P2]=rowid */ |
| 15319 | | -#define OP_Insert 126 /* synopsis: intkey=r[P3] data=r[P2] */ |
| 15320 | | -#define OP_RowCell 127 |
| 15321 | | -#define OP_Delete 128 |
| 15322 | | -#define OP_ResetCount 129 |
| 15323 | | -#define OP_SorterCompare 130 /* synopsis: if key(P1)!=trim(r[P3],P4) goto P2 */ |
| 15324 | | -#define OP_SorterData 131 /* synopsis: r[P2]=data */ |
| 15325 | | -#define OP_RowData 132 /* synopsis: r[P2]=data */ |
| 15326 | | -#define OP_Rowid 133 /* synopsis: r[P2]=rowid */ |
| 15327 | | -#define OP_NullRow 134 |
| 15328 | | -#define OP_SeekEnd 135 |
| 15329 | | -#define OP_IdxInsert 136 /* synopsis: key=r[P2] */ |
| 15330 | | -#define OP_SorterInsert 137 /* synopsis: key=r[P2] */ |
| 15331 | | -#define OP_IdxDelete 138 /* synopsis: key=r[P2@P3] */ |
| 15332 | | -#define OP_DeferredSeek 139 /* synopsis: Move P3 to P1.rowid if needed */ |
| 15333 | | -#define OP_IdxRowid 140 /* synopsis: r[P2]=rowid */ |
| 15334 | | -#define OP_FinishSeek 141 |
| 15335 | | -#define OP_Destroy 142 |
| 15336 | | -#define OP_Clear 143 |
| 15337 | | -#define OP_ResetSorter 144 |
| 15338 | | -#define OP_CreateBtree 145 /* synopsis: r[P2]=root iDb=P1 flags=P3 */ |
| 15339 | | -#define OP_SqlExec 146 |
| 15340 | | -#define OP_ParseSchema 147 |
| 15341 | | -#define OP_LoadAnalysis 148 |
| 15342 | | -#define OP_DropTable 149 |
| 15343 | | -#define OP_DropIndex 150 |
| 15344 | | -#define OP_DropTrigger 151 |
| 15323 | +#define OP_OpenEphemeral 117 /* synopsis: nColumn=P2 */ |
| 15324 | +#define OP_SorterOpen 118 |
| 15325 | +#define OP_SequenceTest 119 /* synopsis: if( cursor[P1].ctr++ ) pc = P2 */ |
| 15326 | +#define OP_OpenPseudo 120 /* synopsis: P3 columns in r[P2] */ |
| 15327 | +#define OP_Close 121 |
| 15328 | +#define OP_ColumnsUsed 122 |
| 15329 | +#define OP_SeekScan 123 /* synopsis: Scan-ahead up to P1 rows */ |
| 15330 | +#define OP_SeekHit 124 /* synopsis: set P2<=seekHit<=P3 */ |
| 15331 | +#define OP_Sequence 125 /* synopsis: r[P2]=cursor[P1].ctr++ */ |
| 15332 | +#define OP_NewRowid 126 /* synopsis: r[P2]=rowid */ |
| 15333 | +#define OP_Insert 127 /* synopsis: intkey=r[P3] data=r[P2] */ |
| 15334 | +#define OP_RowCell 128 |
| 15335 | +#define OP_Delete 129 |
| 15336 | +#define OP_ResetCount 130 |
| 15337 | +#define OP_SorterCompare 131 /* synopsis: if key(P1)!=trim(r[P3],P4) goto P2 */ |
| 15338 | +#define OP_SorterData 132 /* synopsis: r[P2]=data */ |
| 15339 | +#define OP_RowData 133 /* synopsis: r[P2]=data */ |
| 15340 | +#define OP_Rowid 134 /* synopsis: r[P2]=rowid */ |
| 15341 | +#define OP_NullRow 135 |
| 15342 | +#define OP_SeekEnd 136 |
| 15343 | +#define OP_IdxInsert 137 /* synopsis: key=r[P2] */ |
| 15344 | +#define OP_SorterInsert 138 /* synopsis: key=r[P2] */ |
| 15345 | +#define OP_IdxDelete 139 /* synopsis: key=r[P2@P3] */ |
| 15346 | +#define OP_DeferredSeek 140 /* synopsis: Move P3 to P1.rowid if needed */ |
| 15347 | +#define OP_IdxRowid 141 /* synopsis: r[P2]=rowid */ |
| 15348 | +#define OP_FinishSeek 142 |
| 15349 | +#define OP_Destroy 143 |
| 15350 | +#define OP_Clear 144 |
| 15351 | +#define OP_ResetSorter 145 |
| 15352 | +#define OP_CreateBtree 146 /* synopsis: r[P2]=root iDb=P1 flags=P3 */ |
| 15353 | +#define OP_SqlExec 147 |
| 15354 | +#define OP_ParseSchema 148 |
| 15355 | +#define OP_LoadAnalysis 149 |
| 15356 | +#define OP_DropTable 150 |
| 15357 | +#define OP_DropIndex 151 |
| 15345 | 15358 | #define OP_Real 152 /* same as TK_FLOAT, synopsis: r[P2]=P4 */ |
| 15346 | | -#define OP_IntegrityCk 153 |
| 15347 | | -#define OP_RowSetAdd 154 /* synopsis: rowset(P1)=r[P2] */ |
| 15348 | | -#define OP_Param 155 |
| 15349 | | -#define OP_FkCounter 156 /* synopsis: fkctr[P1]+=P2 */ |
| 15350 | | -#define OP_MemMax 157 /* synopsis: r[P1]=max(r[P1],r[P2]) */ |
| 15351 | | -#define OP_OffsetLimit 158 /* synopsis: if r[P1]>0 then r[P2]=r[P1]+max(0,r[P3]) else r[P2]=(-1) */ |
| 15352 | | -#define OP_AggInverse 159 /* synopsis: accum=r[P3] inverse(r[P2@P5]) */ |
| 15353 | | -#define OP_AggStep 160 /* synopsis: accum=r[P3] step(r[P2@P5]) */ |
| 15354 | | -#define OP_AggStep1 161 /* synopsis: accum=r[P3] step(r[P2@P5]) */ |
| 15355 | | -#define OP_AggValue 162 /* synopsis: r[P3]=value N=P2 */ |
| 15356 | | -#define OP_AggFinal 163 /* synopsis: accum=r[P1] N=P2 */ |
| 15357 | | -#define OP_Expire 164 |
| 15358 | | -#define OP_CursorLock 165 |
| 15359 | | -#define OP_CursorUnlock 166 |
| 15360 | | -#define OP_TableLock 167 /* synopsis: iDb=P1 root=P2 write=P3 */ |
| 15361 | | -#define OP_VBegin 168 |
| 15362 | | -#define OP_VCreate 169 |
| 15363 | | -#define OP_VDestroy 170 |
| 15364 | | -#define OP_VOpen 171 |
| 15365 | | -#define OP_VColumn 172 /* synopsis: r[P3]=vcolumn(P2) */ |
| 15366 | | -#define OP_VRename 173 |
| 15367 | | -#define OP_Pagecount 174 |
| 15368 | | -#define OP_MaxPgcnt 175 |
| 15369 | | -#define OP_Trace 176 |
| 15370 | | -#define OP_CursorHint 177 |
| 15371 | | -#define OP_ReleaseReg 178 /* synopsis: release r[P1@P2] mask P3 */ |
| 15372 | | -#define OP_Noop 179 |
| 15373 | | -#define OP_Explain 180 |
| 15374 | | -#define OP_Abortable 181 |
| 15359 | +#define OP_DropTrigger 153 |
| 15360 | +#define OP_IntegrityCk 154 |
| 15361 | +#define OP_RowSetAdd 155 /* synopsis: rowset(P1)=r[P2] */ |
| 15362 | +#define OP_Param 156 |
| 15363 | +#define OP_FkCounter 157 /* synopsis: fkctr[P1]+=P2 */ |
| 15364 | +#define OP_MemMax 158 /* synopsis: r[P1]=max(r[P1],r[P2]) */ |
| 15365 | +#define OP_OffsetLimit 159 /* synopsis: if r[P1]>0 then r[P2]=r[P1]+max(0,r[P3]) else r[P2]=(-1) */ |
| 15366 | +#define OP_AggInverse 160 /* synopsis: accum=r[P3] inverse(r[P2@P5]) */ |
| 15367 | +#define OP_AggStep 161 /* synopsis: accum=r[P3] step(r[P2@P5]) */ |
| 15368 | +#define OP_AggStep1 162 /* synopsis: accum=r[P3] step(r[P2@P5]) */ |
| 15369 | +#define OP_AggValue 163 /* synopsis: r[P3]=value N=P2 */ |
| 15370 | +#define OP_AggFinal 164 /* synopsis: accum=r[P1] N=P2 */ |
| 15371 | +#define OP_Expire 165 |
| 15372 | +#define OP_CursorLock 166 |
| 15373 | +#define OP_CursorUnlock 167 |
| 15374 | +#define OP_TableLock 168 /* synopsis: iDb=P1 root=P2 write=P3 */ |
| 15375 | +#define OP_VBegin 169 |
| 15376 | +#define OP_VCreate 170 |
| 15377 | +#define OP_VDestroy 171 |
| 15378 | +#define OP_VOpen 172 |
| 15379 | +#define OP_VColumn 173 /* synopsis: r[P3]=vcolumn(P2) */ |
| 15380 | +#define OP_VRename 174 |
| 15381 | +#define OP_Pagecount 175 |
| 15382 | +#define OP_MaxPgcnt 176 |
| 15383 | +#define OP_FilterAdd 177 /* synopsis: filter(P1) += key(P3@P4) */ |
| 15384 | +#define OP_Trace 178 |
| 15385 | +#define OP_CursorHint 179 |
| 15386 | +#define OP_ReleaseReg 180 /* synopsis: release r[P1@P2] mask P3 */ |
| 15387 | +#define OP_Noop 181 |
| 15388 | +#define OP_Explain 182 |
| 15389 | +#define OP_Abortable 183 |
| 15375 | 15390 | |
| 15376 | 15391 | /* Properties such as "out2" or "jump" that are specified in |
| 15377 | 15392 | ** comments following the "case" for each opcode in the vdbe.c |
| 15378 | 15393 | ** are encoded into bitvectors as follows: |
| 15379 | 15394 | */ |
| | @@ -15390,33 +15405,34 @@ |
| 15390 | 15405 | /* 24 */ 0x09, 0x09, 0x09, 0x01, 0x09, 0x09, 0x09, 0x09,\ |
| 15391 | 15406 | /* 32 */ 0x09, 0x09, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,\ |
| 15392 | 15407 | /* 40 */ 0x01, 0x01, 0x01, 0x26, 0x26, 0x23, 0x0b, 0x01,\ |
| 15393 | 15408 | /* 48 */ 0x01, 0x03, 0x03, 0x03, 0x0b, 0x0b, 0x0b, 0x0b,\ |
| 15394 | 15409 | /* 56 */ 0x0b, 0x0b, 0x01, 0x03, 0x03, 0x01, 0x01, 0x01,\ |
| 15395 | | -/* 64 */ 0x00, 0x00, 0x02, 0x02, 0x08, 0x00, 0x10, 0x10,\ |
| 15396 | | -/* 72 */ 0x10, 0x10, 0x00, 0x10, 0x10, 0x00, 0x00, 0x10,\ |
| 15397 | | -/* 80 */ 0x10, 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, 0x00,\ |
| 15398 | | -/* 88 */ 0x00, 0x12, 0x1e, 0x20, 0x00, 0x00, 0x00, 0x00,\ |
| 15399 | | -/* 96 */ 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x26, 0x26,\ |
| 15410 | +/* 64 */ 0x01, 0x00, 0x00, 0x02, 0x02, 0x08, 0x00, 0x10,\ |
| 15411 | +/* 72 */ 0x10, 0x10, 0x10, 0x00, 0x10, 0x10, 0x00, 0x00,\ |
| 15412 | +/* 80 */ 0x10, 0x10, 0x00, 0x00, 0x00, 0x02, 0x02, 0x02,\ |
| 15413 | +/* 88 */ 0x00, 0x00, 0x12, 0x1e, 0x20, 0x00, 0x00, 0x00,\ |
| 15414 | +/* 96 */ 0x00, 0x10, 0x10, 0x00, 0x00, 0x00, 0x26, 0x26,\ |
| 15400 | 15415 | /* 104 */ 0x26, 0x26, 0x26, 0x26, 0x26, 0x26, 0x26, 0x26,\ |
| 15401 | 15416 | /* 112 */ 0x00, 0x12, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00,\ |
| 15402 | | -/* 120 */ 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0x00, 0x00,\ |
| 15403 | | -/* 128 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00,\ |
| 15404 | | -/* 136 */ 0x04, 0x04, 0x00, 0x00, 0x10, 0x00, 0x10, 0x00,\ |
| 15405 | | -/* 144 */ 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\ |
| 15406 | | -/* 152 */ 0x10, 0x00, 0x06, 0x10, 0x00, 0x04, 0x1a, 0x00,\ |
| 15417 | +/* 120 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0x00,\ |
| 15418 | +/* 128 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00,\ |
| 15419 | +/* 136 */ 0x00, 0x04, 0x04, 0x00, 0x00, 0x10, 0x00, 0x10,\ |
| 15420 | +/* 144 */ 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,\ |
| 15421 | +/* 152 */ 0x10, 0x00, 0x00, 0x06, 0x10, 0x00, 0x04, 0x1a,\ |
| 15407 | 15422 | /* 160 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\ |
| 15408 | | -/* 168 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10,\ |
| 15409 | | -/* 176 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,} |
| 15423 | +/* 168 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10,\ |
| 15424 | +/* 176 */ 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\ |
| 15425 | +} |
| 15410 | 15426 | |
| 15411 | 15427 | /* The resolve3P2Values() routine is able to run faster if it knows |
| 15412 | 15428 | ** the value of the largest JUMP opcode. The smaller the maximum |
| 15413 | 15429 | ** JUMP opcode the better, so the mkopcodeh.tcl script that |
| 15414 | 15430 | ** generated this include file strives to group all JUMP opcodes |
| 15415 | 15431 | ** together near the beginning of the list. |
| 15416 | 15432 | */ |
| 15417 | | -#define SQLITE_MX_JUMP_OPCODE 63 /* Maximum JUMP opcode */ |
| 15433 | +#define SQLITE_MX_JUMP_OPCODE 64 /* Maximum JUMP opcode */ |
| 15418 | 15434 | |
| 15419 | 15435 | /************** End of opcodes.h *********************************************/ |
| 15420 | 15436 | /************** Continuing where we left off in vdbe.h ***********************/ |
| 15421 | 15437 | |
| 15422 | 15438 | /* |
| | @@ -16707,10 +16723,12 @@ |
| 16707 | 16723 | #define SQLITE_PropagateConst 0x00008000 /* The constant propagation opt */ |
| 16708 | 16724 | #define SQLITE_MinMaxOpt 0x00010000 /* The min/max optimization */ |
| 16709 | 16725 | #define SQLITE_SeekScan 0x00020000 /* The OP_SeekScan optimization */ |
| 16710 | 16726 | #define SQLITE_OmitOrderBy 0x00040000 /* Omit pointless ORDER BY */ |
| 16711 | 16727 | /* TH3 expects this value ^^^^^^^^^^ to be 0x40000. Coordinate any change */ |
| 16728 | +#define SQLITE_BloomFilter 0x00080000 /* Use a Bloom filter on searches */ |
| 16729 | +#define SQLITE_BloomPulldown 0x00100000 /* Run Bloom filters early */ |
| 16712 | 16730 | #define SQLITE_AllOpts 0xffffffff /* All optimizations */ |
| 16713 | 16731 | |
| 16714 | 16732 | /* |
| 16715 | 16733 | ** Macros for testing whether or not optimizations are enabled or disabled. |
| 16716 | 16734 | */ |
| | @@ -19509,10 +19527,11 @@ |
| 19509 | 19527 | SQLITE_PRIVATE int sqlite3IsReadOnly(Parse*, Table*, int); |
| 19510 | 19528 | SQLITE_PRIVATE void sqlite3OpenTable(Parse*, int iCur, int iDb, Table*, int); |
| 19511 | 19529 | #if defined(SQLITE_ENABLE_UPDATE_DELETE_LIMIT) && !defined(SQLITE_OMIT_SUBQUERY) |
| 19512 | 19530 | SQLITE_PRIVATE Expr *sqlite3LimitWhere(Parse*,SrcList*,Expr*,ExprList*,Expr*,char*); |
| 19513 | 19531 | #endif |
| 19532 | +SQLITE_PRIVATE void sqlite3CodeChangeCount(Vdbe*,int,const char*); |
| 19514 | 19533 | SQLITE_PRIVATE void sqlite3DeleteFrom(Parse*, SrcList*, Expr*, ExprList*, Expr*); |
| 19515 | 19534 | SQLITE_PRIVATE void sqlite3Update(Parse*, SrcList*, ExprList*,Expr*,int,ExprList*,Expr*, |
| 19516 | 19535 | Upsert*); |
| 19517 | 19536 | SQLITE_PRIVATE WhereInfo *sqlite3WhereBegin(Parse*,SrcList*,Expr*,ExprList*,ExprList*,u16,int); |
| 19518 | 19537 | SQLITE_PRIVATE void sqlite3WhereEnd(WhereInfo*); |
| | @@ -19719,18 +19738,12 @@ |
| 19719 | 19738 | #endif |
| 19720 | 19739 | SQLITE_PRIVATE int sqlite3Utf8CharLen(const char *pData, int nByte); |
| 19721 | 19740 | SQLITE_PRIVATE u32 sqlite3Utf8Read(const u8**); |
| 19722 | 19741 | SQLITE_PRIVATE LogEst sqlite3LogEst(u64); |
| 19723 | 19742 | SQLITE_PRIVATE LogEst sqlite3LogEstAdd(LogEst,LogEst); |
| 19724 | | -#ifndef SQLITE_OMIT_VIRTUALTABLE |
| 19725 | 19743 | SQLITE_PRIVATE LogEst sqlite3LogEstFromDouble(double); |
| 19726 | | -#endif |
| 19727 | | -#if defined(SQLITE_ENABLE_STMT_SCANSTATUS) || \ |
| 19728 | | - defined(SQLITE_ENABLE_STAT4) || \ |
| 19729 | | - defined(SQLITE_EXPLAIN_ESTIMATED_ROWS) |
| 19730 | 19744 | SQLITE_PRIVATE u64 sqlite3LogEstToInt(LogEst); |
| 19731 | | -#endif |
| 19732 | 19745 | SQLITE_PRIVATE VList *sqlite3VListAdd(sqlite3*,VList*,const char*,int,int); |
| 19733 | 19746 | SQLITE_PRIVATE const char *sqlite3VListNumToName(VList*,int); |
| 19734 | 19747 | SQLITE_PRIVATE int sqlite3VListNameToNum(VList*,const char*,int); |
| 19735 | 19748 | |
| 19736 | 19749 | /* |
| | @@ -22106,11 +22119,11 @@ |
| 22106 | 22119 | bft usesStmtJournal:1; /* True if uses a statement journal */ |
| 22107 | 22120 | bft readOnly:1; /* True for statements that do not write */ |
| 22108 | 22121 | bft bIsReader:1; /* True for statements that read */ |
| 22109 | 22122 | yDbMask btreeMask; /* Bitmask of db->aDb[] entries referenced */ |
| 22110 | 22123 | yDbMask lockMask; /* Subset of btreeMask that requires a lock */ |
| 22111 | | - u32 aCounter[7]; /* Counters used by sqlite3_stmt_status() */ |
| 22124 | + u32 aCounter[9]; /* Counters used by sqlite3_stmt_status() */ |
| 22112 | 22125 | char *zSql; /* Text of the SQL statement that generated this */ |
| 22113 | 22126 | #ifdef SQLITE_ENABLE_NORMALIZE |
| 22114 | 22127 | char *zNormSql; /* Normalization of the associated SQL statement */ |
| 22115 | 22128 | DblquoteStr *pDblStr; /* List of double-quoted string literals */ |
| 22116 | 22129 | #endif |
| | @@ -22214,11 +22227,11 @@ |
| 22214 | 22227 | #endif |
| 22215 | 22228 | SQLITE_PRIVATE int sqlite3VdbeMemSetRowSet(Mem*); |
| 22216 | 22229 | SQLITE_PRIVATE int sqlite3VdbeMemMakeWriteable(Mem*); |
| 22217 | 22230 | SQLITE_PRIVATE int sqlite3VdbeMemStringify(Mem*, u8, u8); |
| 22218 | 22231 | SQLITE_PRIVATE int sqlite3IntFloatCompare(i64,double); |
| 22219 | | -SQLITE_PRIVATE i64 sqlite3VdbeIntValue(Mem*); |
| 22232 | +SQLITE_PRIVATE i64 sqlite3VdbeIntValue(const Mem*); |
| 22220 | 22233 | SQLITE_PRIVATE int sqlite3VdbeMemIntegerify(Mem*); |
| 22221 | 22234 | SQLITE_PRIVATE double sqlite3VdbeRealValue(Mem*); |
| 22222 | 22235 | SQLITE_PRIVATE int sqlite3VdbeBooleanValue(Mem*, int ifNull); |
| 22223 | 22236 | SQLITE_PRIVATE void sqlite3VdbeIntegerAffinity(Mem*); |
| 22224 | 22237 | SQLITE_PRIVATE int sqlite3VdbeMemRealify(Mem*); |
| | @@ -23212,11 +23225,13 @@ |
| 23212 | 23225 | pX = localtime(t); |
| 23213 | 23226 | #ifndef SQLITE_UNTESTABLE |
| 23214 | 23227 | if( sqlite3GlobalConfig.bLocaltimeFault ) pX = 0; |
| 23215 | 23228 | #endif |
| 23216 | 23229 | if( pX ) *pTm = *pX; |
| 23230 | +#if SQLITE_THREADSAFE>0 |
| 23217 | 23231 | sqlite3_mutex_leave(mutex); |
| 23232 | +#endif |
| 23218 | 23233 | rc = pX==0; |
| 23219 | 23234 | #else |
| 23220 | 23235 | #ifndef SQLITE_UNTESTABLE |
| 23221 | 23236 | if( sqlite3GlobalConfig.bLocaltimeFault ) return 1; |
| 23222 | 23237 | #endif |
| | @@ -23351,10 +23366,49 @@ |
| 23351 | 23366 | DateTime *p /* The date/time value to be modified */ |
| 23352 | 23367 | ){ |
| 23353 | 23368 | int rc = 1; |
| 23354 | 23369 | double r; |
| 23355 | 23370 | switch(sqlite3UpperToLower[(u8)z[0]] ){ |
| 23371 | + case 'a': { |
| 23372 | + /* |
| 23373 | + ** auto |
| 23374 | + ** |
| 23375 | + ** If rawS is available, then interpret as a julian day number, or |
| 23376 | + ** a unix timestamp, depending on its magnitude. |
| 23377 | + */ |
| 23378 | + if( sqlite3_stricmp(z, "auto")==0 ){ |
| 23379 | + if( !p->rawS || p->validJD ){ |
| 23380 | + rc = 0; |
| 23381 | + p->rawS = 0; |
| 23382 | + }else if( p->s>=-210866760000 && p->s<=253402300799 ){ |
| 23383 | + r = p->s*1000.0 + 210866760000000.0; |
| 23384 | + clearYMD_HMS_TZ(p); |
| 23385 | + p->iJD = (sqlite3_int64)(r + 0.5); |
| 23386 | + p->validJD = 1; |
| 23387 | + p->rawS = 0; |
| 23388 | + rc = 0; |
| 23389 | + } |
| 23390 | + } |
| 23391 | + break; |
| 23392 | + } |
| 23393 | + case 'j': { |
| 23394 | + /* |
| 23395 | + ** julianday |
| 23396 | + ** |
| 23397 | + ** Always interpret the prior number as a julian-day value. If this |
| 23398 | + ** is not the first modifier, or if the prior argument is not a numeric |
| 23399 | + ** value in the allowed range of julian day numbers understood by |
| 23400 | + ** SQLite (0..5373484.5) then the result will be NULL. |
| 23401 | + */ |
| 23402 | + if( sqlite3_stricmp(z, "julianday")==0 ){ |
| 23403 | + if( p->validJD && p->rawS ){ |
| 23404 | + rc = 0; |
| 23405 | + p->rawS = 0; |
| 23406 | + } |
| 23407 | + } |
| 23408 | + break; |
| 23409 | + } |
| 23356 | 23410 | #ifndef SQLITE_OMIT_LOCALTIME |
| 23357 | 23411 | case 'l': { |
| 23358 | 23412 | /* localtime |
| 23359 | 23413 | ** |
| 23360 | 23414 | ** Assuming the current time value is UTC (a.k.a. GMT), shift it to |
| | @@ -23614,10 +23668,28 @@ |
| 23614 | 23668 | if( isDate(context, argc, argv, &x)==0 ){ |
| 23615 | 23669 | computeJD(&x); |
| 23616 | 23670 | sqlite3_result_double(context, x.iJD/86400000.0); |
| 23617 | 23671 | } |
| 23618 | 23672 | } |
| 23673 | + |
| 23674 | +/* |
| 23675 | +** unixepoch( TIMESTRING, MOD, MOD, ...) |
| 23676 | +** |
| 23677 | +** Return the number of seconds (including fractional seconds) since |
| 23678 | +** the unix epoch of 1970-01-01 00:00:00 GMT. |
| 23679 | +*/ |
| 23680 | +static void unixepochFunc( |
| 23681 | + sqlite3_context *context, |
| 23682 | + int argc, |
| 23683 | + sqlite3_value **argv |
| 23684 | +){ |
| 23685 | + DateTime x; |
| 23686 | + if( isDate(context, argc, argv, &x)==0 ){ |
| 23687 | + computeJD(&x); |
| 23688 | + sqlite3_result_int64(context, x.iJD/1000 - 21086676*(i64)10000); |
| 23689 | + } |
| 23690 | +} |
| 23619 | 23691 | |
| 23620 | 23692 | /* |
| 23621 | 23693 | ** datetime( TIMESTRING, MOD, MOD, ...) |
| 23622 | 23694 | ** |
| 23623 | 23695 | ** Return YYYY-MM-DD HH:MM:SS |
| | @@ -23891,10 +23963,11 @@ |
| 23891 | 23963 | */ |
| 23892 | 23964 | SQLITE_PRIVATE void sqlite3RegisterDateTimeFunctions(void){ |
| 23893 | 23965 | static FuncDef aDateTimeFuncs[] = { |
| 23894 | 23966 | #ifndef SQLITE_OMIT_DATETIME_FUNCS |
| 23895 | 23967 | PURE_DATE(julianday, -1, 0, 0, juliandayFunc ), |
| 23968 | + PURE_DATE(unixepoch, -1, 0, 0, unixepochFunc ), |
| 23896 | 23969 | PURE_DATE(date, -1, 0, 0, dateFunc ), |
| 23897 | 23970 | PURE_DATE(time, -1, 0, 0, timeFunc ), |
| 23898 | 23971 | PURE_DATE(datetime, -1, 0, 0, datetimeFunc ), |
| 23899 | 23972 | PURE_DATE(strftime, -1, 0, 0, strftimeFunc ), |
| 23900 | 23973 | DFUNCTION(current_time, 0, 0, 0, ctimeFunc ), |
| | @@ -33608,11 +33681,10 @@ |
| 33608 | 33681 | #endif |
| 33609 | 33682 | } |
| 33610 | 33683 | return a[x&7] + y - 10; |
| 33611 | 33684 | } |
| 33612 | 33685 | |
| 33613 | | -#ifndef SQLITE_OMIT_VIRTUALTABLE |
| 33614 | 33686 | /* |
| 33615 | 33687 | ** Convert a double into a LogEst |
| 33616 | 33688 | ** In other words, compute an approximation for 10*log2(x). |
| 33617 | 33689 | */ |
| 33618 | 33690 | SQLITE_PRIVATE LogEst sqlite3LogEstFromDouble(double x){ |
| | @@ -33623,38 +33695,23 @@ |
| 33623 | 33695 | if( x<=2000000000 ) return sqlite3LogEst((u64)x); |
| 33624 | 33696 | memcpy(&a, &x, 8); |
| 33625 | 33697 | e = (a>>52) - 1022; |
| 33626 | 33698 | return e*10; |
| 33627 | 33699 | } |
| 33628 | | -#endif /* SQLITE_OMIT_VIRTUALTABLE */ |
| 33629 | 33700 | |
| 33630 | | -#if defined(SQLITE_ENABLE_STMT_SCANSTATUS) || \ |
| 33631 | | - defined(SQLITE_ENABLE_STAT4) || \ |
| 33632 | | - defined(SQLITE_EXPLAIN_ESTIMATED_ROWS) |
| 33633 | 33701 | /* |
| 33634 | 33702 | ** Convert a LogEst into an integer. |
| 33635 | | -** |
| 33636 | | -** Note that this routine is only used when one or more of various |
| 33637 | | -** non-standard compile-time options is enabled. |
| 33638 | 33703 | */ |
| 33639 | 33704 | SQLITE_PRIVATE u64 sqlite3LogEstToInt(LogEst x){ |
| 33640 | 33705 | u64 n; |
| 33641 | 33706 | n = x%10; |
| 33642 | 33707 | x /= 10; |
| 33643 | 33708 | if( n>=5 ) n -= 2; |
| 33644 | 33709 | else if( n>=1 ) n -= 1; |
| 33645 | | -#if defined(SQLITE_ENABLE_STMT_SCANSTATUS) || \ |
| 33646 | | - defined(SQLITE_EXPLAIN_ESTIMATED_ROWS) |
| 33647 | 33710 | if( x>60 ) return (u64)LARGEST_INT64; |
| 33648 | | -#else |
| 33649 | | - /* If only SQLITE_ENABLE_STAT4 is on, then the largest input |
| 33650 | | - ** possible to this routine is 310, resulting in a maximum x of 31 */ |
| 33651 | | - assert( x<=60 ); |
| 33652 | | -#endif |
| 33653 | 33711 | return x>=3 ? (n+8)<<(x-3) : (n+8)>>(3-x); |
| 33654 | 33712 | } |
| 33655 | | -#endif /* defined SCANSTAT or STAT4 or ESTIMATED_ROWS */ |
| 33656 | 33713 | |
| 33657 | 33714 | /* |
| 33658 | 33715 | ** Add a new name/number pair to a VList. This might require that the |
| 33659 | 33716 | ** VList object be reallocated, so return the new VList. If an OOM |
| 33660 | 33717 | ** error occurs, the original VList returned and the |
| | @@ -34104,49 +34161,49 @@ |
| 34104 | 34161 | /* 58 */ "ElseEq" OpHelp(""), |
| 34105 | 34162 | /* 59 */ "IfNotZero" OpHelp("if r[P1]!=0 then r[P1]--, goto P2"), |
| 34106 | 34163 | /* 60 */ "DecrJumpZero" OpHelp("if (--r[P1])==0 goto P2"), |
| 34107 | 34164 | /* 61 */ "IncrVacuum" OpHelp(""), |
| 34108 | 34165 | /* 62 */ "VNext" OpHelp(""), |
| 34109 | | - /* 63 */ "Init" OpHelp("Start at P2"), |
| 34110 | | - /* 64 */ "PureFunc" OpHelp("r[P3]=func(r[P2@NP])"), |
| 34111 | | - /* 65 */ "Function" OpHelp("r[P3]=func(r[P2@NP])"), |
| 34112 | | - /* 66 */ "Return" OpHelp(""), |
| 34113 | | - /* 67 */ "EndCoroutine" OpHelp(""), |
| 34114 | | - /* 68 */ "HaltIfNull" OpHelp("if r[P3]=null halt"), |
| 34115 | | - /* 69 */ "Halt" OpHelp(""), |
| 34116 | | - /* 70 */ "Integer" OpHelp("r[P2]=P1"), |
| 34117 | | - /* 71 */ "Int64" OpHelp("r[P2]=P4"), |
| 34118 | | - /* 72 */ "String" OpHelp("r[P2]='P4' (len=P1)"), |
| 34119 | | - /* 73 */ "Null" OpHelp("r[P2..P3]=NULL"), |
| 34120 | | - /* 74 */ "SoftNull" OpHelp("r[P1]=NULL"), |
| 34121 | | - /* 75 */ "Blob" OpHelp("r[P2]=P4 (len=P1)"), |
| 34122 | | - /* 76 */ "Variable" OpHelp("r[P2]=parameter(P1,P4)"), |
| 34123 | | - /* 77 */ "Move" OpHelp("r[P2@P3]=r[P1@P3]"), |
| 34124 | | - /* 78 */ "Copy" OpHelp("r[P2@P3+1]=r[P1@P3+1]"), |
| 34125 | | - /* 79 */ "SCopy" OpHelp("r[P2]=r[P1]"), |
| 34126 | | - /* 80 */ "IntCopy" OpHelp("r[P2]=r[P1]"), |
| 34127 | | - /* 81 */ "ChngCntRow" OpHelp("output=r[P1]"), |
| 34128 | | - /* 82 */ "ResultRow" OpHelp("output=r[P1@P2]"), |
| 34129 | | - /* 83 */ "CollSeq" OpHelp(""), |
| 34130 | | - /* 84 */ "AddImm" OpHelp("r[P1]=r[P1]+P2"), |
| 34131 | | - /* 85 */ "RealAffinity" OpHelp(""), |
| 34132 | | - /* 86 */ "Cast" OpHelp("affinity(r[P1])"), |
| 34133 | | - /* 87 */ "Permutation" OpHelp(""), |
| 34134 | | - /* 88 */ "Compare" OpHelp("r[P1@P3] <-> r[P2@P3]"), |
| 34135 | | - /* 89 */ "IsTrue" OpHelp("r[P2] = coalesce(r[P1]==TRUE,P3) ^ P4"), |
| 34136 | | - /* 90 */ "ZeroOrNull" OpHelp("r[P2] = 0 OR NULL"), |
| 34137 | | - /* 91 */ "Offset" OpHelp("r[P3] = sqlite_offset(P1)"), |
| 34138 | | - /* 92 */ "Column" OpHelp("r[P3]=PX"), |
| 34139 | | - /* 93 */ "TypeCheck" OpHelp("typecheck(r[P1@P2])"), |
| 34140 | | - /* 94 */ "Affinity" OpHelp("affinity(r[P1@P2])"), |
| 34141 | | - /* 95 */ "MakeRecord" OpHelp("r[P3]=mkrec(r[P1@P2])"), |
| 34142 | | - /* 96 */ "Count" OpHelp("r[P2]=count()"), |
| 34143 | | - /* 97 */ "ReadCookie" OpHelp(""), |
| 34144 | | - /* 98 */ "SetCookie" OpHelp(""), |
| 34145 | | - /* 99 */ "ReopenIdx" OpHelp("root=P2 iDb=P3"), |
| 34146 | | - /* 100 */ "OpenRead" OpHelp("root=P2 iDb=P3"), |
| 34147 | | - /* 101 */ "OpenWrite" OpHelp("root=P2 iDb=P3"), |
| 34166 | + /* 63 */ "Filter" OpHelp("if key(P3@P4) not in filter(P1) goto P2"), |
| 34167 | + /* 64 */ "Init" OpHelp("Start at P2"), |
| 34168 | + /* 65 */ "PureFunc" OpHelp("r[P3]=func(r[P2@NP])"), |
| 34169 | + /* 66 */ "Function" OpHelp("r[P3]=func(r[P2@NP])"), |
| 34170 | + /* 67 */ "Return" OpHelp(""), |
| 34171 | + /* 68 */ "EndCoroutine" OpHelp(""), |
| 34172 | + /* 69 */ "HaltIfNull" OpHelp("if r[P3]=null halt"), |
| 34173 | + /* 70 */ "Halt" OpHelp(""), |
| 34174 | + /* 71 */ "Integer" OpHelp("r[P2]=P1"), |
| 34175 | + /* 72 */ "Int64" OpHelp("r[P2]=P4"), |
| 34176 | + /* 73 */ "String" OpHelp("r[P2]='P4' (len=P1)"), |
| 34177 | + /* 74 */ "Null" OpHelp("r[P2..P3]=NULL"), |
| 34178 | + /* 75 */ "SoftNull" OpHelp("r[P1]=NULL"), |
| 34179 | + /* 76 */ "Blob" OpHelp("r[P2]=P4 (len=P1)"), |
| 34180 | + /* 77 */ "Variable" OpHelp("r[P2]=parameter(P1,P4)"), |
| 34181 | + /* 78 */ "Move" OpHelp("r[P2@P3]=r[P1@P3]"), |
| 34182 | + /* 79 */ "Copy" OpHelp("r[P2@P3+1]=r[P1@P3+1]"), |
| 34183 | + /* 80 */ "SCopy" OpHelp("r[P2]=r[P1]"), |
| 34184 | + /* 81 */ "IntCopy" OpHelp("r[P2]=r[P1]"), |
| 34185 | + /* 82 */ "FkCheck" OpHelp(""), |
| 34186 | + /* 83 */ "ResultRow" OpHelp("output=r[P1@P2]"), |
| 34187 | + /* 84 */ "CollSeq" OpHelp(""), |
| 34188 | + /* 85 */ "AddImm" OpHelp("r[P1]=r[P1]+P2"), |
| 34189 | + /* 86 */ "RealAffinity" OpHelp(""), |
| 34190 | + /* 87 */ "Cast" OpHelp("affinity(r[P1])"), |
| 34191 | + /* 88 */ "Permutation" OpHelp(""), |
| 34192 | + /* 89 */ "Compare" OpHelp("r[P1@P3] <-> r[P2@P3]"), |
| 34193 | + /* 90 */ "IsTrue" OpHelp("r[P2] = coalesce(r[P1]==TRUE,P3) ^ P4"), |
| 34194 | + /* 91 */ "ZeroOrNull" OpHelp("r[P2] = 0 OR NULL"), |
| 34195 | + /* 92 */ "Offset" OpHelp("r[P3] = sqlite_offset(P1)"), |
| 34196 | + /* 93 */ "Column" OpHelp("r[P3]=PX"), |
| 34197 | + /* 94 */ "TypeCheck" OpHelp("typecheck(r[P1@P2])"), |
| 34198 | + /* 95 */ "Affinity" OpHelp("affinity(r[P1@P2])"), |
| 34199 | + /* 96 */ "MakeRecord" OpHelp("r[P3]=mkrec(r[P1@P2])"), |
| 34200 | + /* 97 */ "Count" OpHelp("r[P2]=count()"), |
| 34201 | + /* 98 */ "ReadCookie" OpHelp(""), |
| 34202 | + /* 99 */ "SetCookie" OpHelp(""), |
| 34203 | + /* 100 */ "ReopenIdx" OpHelp("root=P2 iDb=P3"), |
| 34204 | + /* 101 */ "OpenRead" OpHelp("root=P2 iDb=P3"), |
| 34148 | 34205 | /* 102 */ "BitAnd" OpHelp("r[P3]=r[P1]&r[P2]"), |
| 34149 | 34206 | /* 103 */ "BitOr" OpHelp("r[P3]=r[P1]|r[P2]"), |
| 34150 | 34207 | /* 104 */ "ShiftLeft" OpHelp("r[P3]=r[P2]<<r[P1]"), |
| 34151 | 34208 | /* 105 */ "ShiftRight" OpHelp("r[P3]=r[P2]>>r[P1]"), |
| 34152 | 34209 | /* 106 */ "Add" OpHelp("r[P3]=r[P1]+r[P2]"), |
| | @@ -34153,80 +34210,82 @@ |
| 34153 | 34210 | /* 107 */ "Subtract" OpHelp("r[P3]=r[P2]-r[P1]"), |
| 34154 | 34211 | /* 108 */ "Multiply" OpHelp("r[P3]=r[P1]*r[P2]"), |
| 34155 | 34212 | /* 109 */ "Divide" OpHelp("r[P3]=r[P2]/r[P1]"), |
| 34156 | 34213 | /* 110 */ "Remainder" OpHelp("r[P3]=r[P2]%r[P1]"), |
| 34157 | 34214 | /* 111 */ "Concat" OpHelp("r[P3]=r[P2]+r[P1]"), |
| 34158 | | - /* 112 */ "OpenDup" OpHelp(""), |
| 34215 | + /* 112 */ "OpenWrite" OpHelp("root=P2 iDb=P3"), |
| 34159 | 34216 | /* 113 */ "BitNot" OpHelp("r[P2]= ~r[P1]"), |
| 34160 | | - /* 114 */ "OpenAutoindex" OpHelp("nColumn=P2"), |
| 34161 | | - /* 115 */ "OpenEphemeral" OpHelp("nColumn=P2"), |
| 34217 | + /* 114 */ "OpenDup" OpHelp(""), |
| 34218 | + /* 115 */ "OpenAutoindex" OpHelp("nColumn=P2"), |
| 34162 | 34219 | /* 116 */ "String8" OpHelp("r[P2]='P4'"), |
| 34163 | | - /* 117 */ "SorterOpen" OpHelp(""), |
| 34164 | | - /* 118 */ "SequenceTest" OpHelp("if( cursor[P1].ctr++ ) pc = P2"), |
| 34165 | | - /* 119 */ "OpenPseudo" OpHelp("P3 columns in r[P2]"), |
| 34166 | | - /* 120 */ "Close" OpHelp(""), |
| 34167 | | - /* 121 */ "ColumnsUsed" OpHelp(""), |
| 34168 | | - /* 122 */ "SeekScan" OpHelp("Scan-ahead up to P1 rows"), |
| 34169 | | - /* 123 */ "SeekHit" OpHelp("set P2<=seekHit<=P3"), |
| 34170 | | - /* 124 */ "Sequence" OpHelp("r[P2]=cursor[P1].ctr++"), |
| 34171 | | - /* 125 */ "NewRowid" OpHelp("r[P2]=rowid"), |
| 34172 | | - /* 126 */ "Insert" OpHelp("intkey=r[P3] data=r[P2]"), |
| 34173 | | - /* 127 */ "RowCell" OpHelp(""), |
| 34174 | | - /* 128 */ "Delete" OpHelp(""), |
| 34175 | | - /* 129 */ "ResetCount" OpHelp(""), |
| 34176 | | - /* 130 */ "SorterCompare" OpHelp("if key(P1)!=trim(r[P3],P4) goto P2"), |
| 34177 | | - /* 131 */ "SorterData" OpHelp("r[P2]=data"), |
| 34178 | | - /* 132 */ "RowData" OpHelp("r[P2]=data"), |
| 34179 | | - /* 133 */ "Rowid" OpHelp("r[P2]=rowid"), |
| 34180 | | - /* 134 */ "NullRow" OpHelp(""), |
| 34181 | | - /* 135 */ "SeekEnd" OpHelp(""), |
| 34182 | | - /* 136 */ "IdxInsert" OpHelp("key=r[P2]"), |
| 34183 | | - /* 137 */ "SorterInsert" OpHelp("key=r[P2]"), |
| 34184 | | - /* 138 */ "IdxDelete" OpHelp("key=r[P2@P3]"), |
| 34185 | | - /* 139 */ "DeferredSeek" OpHelp("Move P3 to P1.rowid if needed"), |
| 34186 | | - /* 140 */ "IdxRowid" OpHelp("r[P2]=rowid"), |
| 34187 | | - /* 141 */ "FinishSeek" OpHelp(""), |
| 34188 | | - /* 142 */ "Destroy" OpHelp(""), |
| 34189 | | - /* 143 */ "Clear" OpHelp(""), |
| 34190 | | - /* 144 */ "ResetSorter" OpHelp(""), |
| 34191 | | - /* 145 */ "CreateBtree" OpHelp("r[P2]=root iDb=P1 flags=P3"), |
| 34192 | | - /* 146 */ "SqlExec" OpHelp(""), |
| 34193 | | - /* 147 */ "ParseSchema" OpHelp(""), |
| 34194 | | - /* 148 */ "LoadAnalysis" OpHelp(""), |
| 34195 | | - /* 149 */ "DropTable" OpHelp(""), |
| 34196 | | - /* 150 */ "DropIndex" OpHelp(""), |
| 34197 | | - /* 151 */ "DropTrigger" OpHelp(""), |
| 34220 | + /* 117 */ "OpenEphemeral" OpHelp("nColumn=P2"), |
| 34221 | + /* 118 */ "SorterOpen" OpHelp(""), |
| 34222 | + /* 119 */ "SequenceTest" OpHelp("if( cursor[P1].ctr++ ) pc = P2"), |
| 34223 | + /* 120 */ "OpenPseudo" OpHelp("P3 columns in r[P2]"), |
| 34224 | + /* 121 */ "Close" OpHelp(""), |
| 34225 | + /* 122 */ "ColumnsUsed" OpHelp(""), |
| 34226 | + /* 123 */ "SeekScan" OpHelp("Scan-ahead up to P1 rows"), |
| 34227 | + /* 124 */ "SeekHit" OpHelp("set P2<=seekHit<=P3"), |
| 34228 | + /* 125 */ "Sequence" OpHelp("r[P2]=cursor[P1].ctr++"), |
| 34229 | + /* 126 */ "NewRowid" OpHelp("r[P2]=rowid"), |
| 34230 | + /* 127 */ "Insert" OpHelp("intkey=r[P3] data=r[P2]"), |
| 34231 | + /* 128 */ "RowCell" OpHelp(""), |
| 34232 | + /* 129 */ "Delete" OpHelp(""), |
| 34233 | + /* 130 */ "ResetCount" OpHelp(""), |
| 34234 | + /* 131 */ "SorterCompare" OpHelp("if key(P1)!=trim(r[P3],P4) goto P2"), |
| 34235 | + /* 132 */ "SorterData" OpHelp("r[P2]=data"), |
| 34236 | + /* 133 */ "RowData" OpHelp("r[P2]=data"), |
| 34237 | + /* 134 */ "Rowid" OpHelp("r[P2]=rowid"), |
| 34238 | + /* 135 */ "NullRow" OpHelp(""), |
| 34239 | + /* 136 */ "SeekEnd" OpHelp(""), |
| 34240 | + /* 137 */ "IdxInsert" OpHelp("key=r[P2]"), |
| 34241 | + /* 138 */ "SorterInsert" OpHelp("key=r[P2]"), |
| 34242 | + /* 139 */ "IdxDelete" OpHelp("key=r[P2@P3]"), |
| 34243 | + /* 140 */ "DeferredSeek" OpHelp("Move P3 to P1.rowid if needed"), |
| 34244 | + /* 141 */ "IdxRowid" OpHelp("r[P2]=rowid"), |
| 34245 | + /* 142 */ "FinishSeek" OpHelp(""), |
| 34246 | + /* 143 */ "Destroy" OpHelp(""), |
| 34247 | + /* 144 */ "Clear" OpHelp(""), |
| 34248 | + /* 145 */ "ResetSorter" OpHelp(""), |
| 34249 | + /* 146 */ "CreateBtree" OpHelp("r[P2]=root iDb=P1 flags=P3"), |
| 34250 | + /* 147 */ "SqlExec" OpHelp(""), |
| 34251 | + /* 148 */ "ParseSchema" OpHelp(""), |
| 34252 | + /* 149 */ "LoadAnalysis" OpHelp(""), |
| 34253 | + /* 150 */ "DropTable" OpHelp(""), |
| 34254 | + /* 151 */ "DropIndex" OpHelp(""), |
| 34198 | 34255 | /* 152 */ "Real" OpHelp("r[P2]=P4"), |
| 34199 | | - /* 153 */ "IntegrityCk" OpHelp(""), |
| 34200 | | - /* 154 */ "RowSetAdd" OpHelp("rowset(P1)=r[P2]"), |
| 34201 | | - /* 155 */ "Param" OpHelp(""), |
| 34202 | | - /* 156 */ "FkCounter" OpHelp("fkctr[P1]+=P2"), |
| 34203 | | - /* 157 */ "MemMax" OpHelp("r[P1]=max(r[P1],r[P2])"), |
| 34204 | | - /* 158 */ "OffsetLimit" OpHelp("if r[P1]>0 then r[P2]=r[P1]+max(0,r[P3]) else r[P2]=(-1)"), |
| 34205 | | - /* 159 */ "AggInverse" OpHelp("accum=r[P3] inverse(r[P2@P5])"), |
| 34206 | | - /* 160 */ "AggStep" OpHelp("accum=r[P3] step(r[P2@P5])"), |
| 34207 | | - /* 161 */ "AggStep1" OpHelp("accum=r[P3] step(r[P2@P5])"), |
| 34208 | | - /* 162 */ "AggValue" OpHelp("r[P3]=value N=P2"), |
| 34209 | | - /* 163 */ "AggFinal" OpHelp("accum=r[P1] N=P2"), |
| 34210 | | - /* 164 */ "Expire" OpHelp(""), |
| 34211 | | - /* 165 */ "CursorLock" OpHelp(""), |
| 34212 | | - /* 166 */ "CursorUnlock" OpHelp(""), |
| 34213 | | - /* 167 */ "TableLock" OpHelp("iDb=P1 root=P2 write=P3"), |
| 34214 | | - /* 168 */ "VBegin" OpHelp(""), |
| 34215 | | - /* 169 */ "VCreate" OpHelp(""), |
| 34216 | | - /* 170 */ "VDestroy" OpHelp(""), |
| 34217 | | - /* 171 */ "VOpen" OpHelp(""), |
| 34218 | | - /* 172 */ "VColumn" OpHelp("r[P3]=vcolumn(P2)"), |
| 34219 | | - /* 173 */ "VRename" OpHelp(""), |
| 34220 | | - /* 174 */ "Pagecount" OpHelp(""), |
| 34221 | | - /* 175 */ "MaxPgcnt" OpHelp(""), |
| 34222 | | - /* 176 */ "Trace" OpHelp(""), |
| 34223 | | - /* 177 */ "CursorHint" OpHelp(""), |
| 34224 | | - /* 178 */ "ReleaseReg" OpHelp("release r[P1@P2] mask P3"), |
| 34225 | | - /* 179 */ "Noop" OpHelp(""), |
| 34226 | | - /* 180 */ "Explain" OpHelp(""), |
| 34227 | | - /* 181 */ "Abortable" OpHelp(""), |
| 34256 | + /* 153 */ "DropTrigger" OpHelp(""), |
| 34257 | + /* 154 */ "IntegrityCk" OpHelp(""), |
| 34258 | + /* 155 */ "RowSetAdd" OpHelp("rowset(P1)=r[P2]"), |
| 34259 | + /* 156 */ "Param" OpHelp(""), |
| 34260 | + /* 157 */ "FkCounter" OpHelp("fkctr[P1]+=P2"), |
| 34261 | + /* 158 */ "MemMax" OpHelp("r[P1]=max(r[P1],r[P2])"), |
| 34262 | + /* 159 */ "OffsetLimit" OpHelp("if r[P1]>0 then r[P2]=r[P1]+max(0,r[P3]) else r[P2]=(-1)"), |
| 34263 | + /* 160 */ "AggInverse" OpHelp("accum=r[P3] inverse(r[P2@P5])"), |
| 34264 | + /* 161 */ "AggStep" OpHelp("accum=r[P3] step(r[P2@P5])"), |
| 34265 | + /* 162 */ "AggStep1" OpHelp("accum=r[P3] step(r[P2@P5])"), |
| 34266 | + /* 163 */ "AggValue" OpHelp("r[P3]=value N=P2"), |
| 34267 | + /* 164 */ "AggFinal" OpHelp("accum=r[P1] N=P2"), |
| 34268 | + /* 165 */ "Expire" OpHelp(""), |
| 34269 | + /* 166 */ "CursorLock" OpHelp(""), |
| 34270 | + /* 167 */ "CursorUnlock" OpHelp(""), |
| 34271 | + /* 168 */ "TableLock" OpHelp("iDb=P1 root=P2 write=P3"), |
| 34272 | + /* 169 */ "VBegin" OpHelp(""), |
| 34273 | + /* 170 */ "VCreate" OpHelp(""), |
| 34274 | + /* 171 */ "VDestroy" OpHelp(""), |
| 34275 | + /* 172 */ "VOpen" OpHelp(""), |
| 34276 | + /* 173 */ "VColumn" OpHelp("r[P3]=vcolumn(P2)"), |
| 34277 | + /* 174 */ "VRename" OpHelp(""), |
| 34278 | + /* 175 */ "Pagecount" OpHelp(""), |
| 34279 | + /* 176 */ "MaxPgcnt" OpHelp(""), |
| 34280 | + /* 177 */ "FilterAdd" OpHelp("filter(P1) += key(P3@P4)"), |
| 34281 | + /* 178 */ "Trace" OpHelp(""), |
| 34282 | + /* 179 */ "CursorHint" OpHelp(""), |
| 34283 | + /* 180 */ "ReleaseReg" OpHelp("release r[P1@P2] mask P3"), |
| 34284 | + /* 181 */ "Noop" OpHelp(""), |
| 34285 | + /* 182 */ "Explain" OpHelp(""), |
| 34286 | + /* 183 */ "Abortable" OpHelp(""), |
| 34228 | 34287 | }; |
| 34229 | 34288 | return azName[i]; |
| 34230 | 34289 | } |
| 34231 | 34290 | #endif |
| 34232 | 34291 | |
| | @@ -68263,34 +68322,42 @@ |
| 68263 | 68322 | /* |
| 68264 | 68323 | ** Make sure pBt->pTmpSpace points to an allocation of |
| 68265 | 68324 | ** MX_CELL_SIZE(pBt) bytes with a 4-byte prefix for a left-child |
| 68266 | 68325 | ** pointer. |
| 68267 | 68326 | */ |
| 68268 | | -static void allocateTempSpace(BtShared *pBt){ |
| 68269 | | - if( !pBt->pTmpSpace ){ |
| 68270 | | - pBt->pTmpSpace = sqlite3PageMalloc( pBt->pageSize ); |
| 68271 | | - |
| 68272 | | - /* One of the uses of pBt->pTmpSpace is to format cells before |
| 68273 | | - ** inserting them into a leaf page (function fillInCell()). If |
| 68274 | | - ** a cell is less than 4 bytes in size, it is rounded up to 4 bytes |
| 68275 | | - ** by the various routines that manipulate binary cells. Which |
| 68276 | | - ** can mean that fillInCell() only initializes the first 2 or 3 |
| 68277 | | - ** bytes of pTmpSpace, but that the first 4 bytes are copied from |
| 68278 | | - ** it into a database page. This is not actually a problem, but it |
| 68279 | | - ** does cause a valgrind error when the 1 or 2 bytes of unitialized |
| 68280 | | - ** data is passed to system call write(). So to avoid this error, |
| 68281 | | - ** zero the first 4 bytes of temp space here. |
| 68282 | | - ** |
| 68283 | | - ** Also: Provide four bytes of initialized space before the |
| 68284 | | - ** beginning of pTmpSpace as an area available to prepend the |
| 68285 | | - ** left-child pointer to the beginning of a cell. |
| 68286 | | - */ |
| 68287 | | - if( pBt->pTmpSpace ){ |
| 68288 | | - memset(pBt->pTmpSpace, 0, 8); |
| 68289 | | - pBt->pTmpSpace += 4; |
| 68290 | | - } |
| 68291 | | - } |
| 68327 | +static SQLITE_NOINLINE int allocateTempSpace(BtShared *pBt){ |
| 68328 | + assert( pBt!=0 ); |
| 68329 | + assert( pBt->pTmpSpace==0 ); |
| 68330 | + /* This routine is called only by btreeCursor() when allocating the |
| 68331 | + ** first write cursor for the BtShared object */ |
| 68332 | + assert( pBt->pCursor!=0 && (pBt->pCursor->curFlags & BTCF_WriteFlag)!=0 ); |
| 68333 | + pBt->pTmpSpace = sqlite3PageMalloc( pBt->pageSize ); |
| 68334 | + if( pBt->pTmpSpace==0 ){ |
| 68335 | + BtCursor *pCur = pBt->pCursor; |
| 68336 | + pBt->pCursor = pCur->pNext; /* Unlink the cursor */ |
| 68337 | + memset(pCur, 0, sizeof(*pCur)); |
| 68338 | + return SQLITE_NOMEM_BKPT; |
| 68339 | + } |
| 68340 | + |
| 68341 | + /* One of the uses of pBt->pTmpSpace is to format cells before |
| 68342 | + ** inserting them into a leaf page (function fillInCell()). If |
| 68343 | + ** a cell is less than 4 bytes in size, it is rounded up to 4 bytes |
| 68344 | + ** by the various routines that manipulate binary cells. Which |
| 68345 | + ** can mean that fillInCell() only initializes the first 2 or 3 |
| 68346 | + ** bytes of pTmpSpace, but that the first 4 bytes are copied from |
| 68347 | + ** it into a database page. This is not actually a problem, but it |
| 68348 | + ** does cause a valgrind error when the 1 or 2 bytes of unitialized |
| 68349 | + ** data is passed to system call write(). So to avoid this error, |
| 68350 | + ** zero the first 4 bytes of temp space here. |
| 68351 | + ** |
| 68352 | + ** Also: Provide four bytes of initialized space before the |
| 68353 | + ** beginning of pTmpSpace as an area available to prepend the |
| 68354 | + ** left-child pointer to the beginning of a cell. |
| 68355 | + */ |
| 68356 | + memset(pBt->pTmpSpace, 0, 8); |
| 68357 | + pBt->pTmpSpace += 4; |
| 68358 | + return SQLITE_OK; |
| 68292 | 68359 | } |
| 68293 | 68360 | |
| 68294 | 68361 | /* |
| 68295 | 68362 | ** Free the pBt->pTmpSpace allocation |
| 68296 | 68363 | */ |
| | @@ -70027,14 +70094,10 @@ |
| 70027 | 70094 | assert( p->inTrans>TRANS_NONE ); |
| 70028 | 70095 | assert( wrFlag==0 || p->inTrans==TRANS_WRITE ); |
| 70029 | 70096 | assert( pBt->pPage1 && pBt->pPage1->aData ); |
| 70030 | 70097 | assert( wrFlag==0 || (pBt->btsFlags & BTS_READ_ONLY)==0 ); |
| 70031 | 70098 | |
| 70032 | | - if( wrFlag ){ |
| 70033 | | - allocateTempSpace(pBt); |
| 70034 | | - if( pBt->pTmpSpace==0 ) return SQLITE_NOMEM_BKPT; |
| 70035 | | - } |
| 70036 | 70099 | if( iTable<=1 ){ |
| 70037 | 70100 | if( iTable<1 ){ |
| 70038 | 70101 | return SQLITE_CORRUPT_BKPT; |
| 70039 | 70102 | }else if( btreePagecount(pBt)==0 ){ |
| 70040 | 70103 | assert( wrFlag==0 ); |
| | @@ -70047,23 +70110,29 @@ |
| 70047 | 70110 | pCur->pgnoRoot = iTable; |
| 70048 | 70111 | pCur->iPage = -1; |
| 70049 | 70112 | pCur->pKeyInfo = pKeyInfo; |
| 70050 | 70113 | pCur->pBtree = p; |
| 70051 | 70114 | pCur->pBt = pBt; |
| 70052 | | - pCur->curFlags = wrFlag ? BTCF_WriteFlag : 0; |
| 70053 | | - pCur->curPagerFlags = wrFlag ? 0 : PAGER_GET_READONLY; |
| 70115 | + pCur->curFlags = 0; |
| 70054 | 70116 | /* If there are two or more cursors on the same btree, then all such |
| 70055 | 70117 | ** cursors *must* have the BTCF_Multiple flag set. */ |
| 70056 | 70118 | for(pX=pBt->pCursor; pX; pX=pX->pNext){ |
| 70057 | 70119 | if( pX->pgnoRoot==iTable ){ |
| 70058 | 70120 | pX->curFlags |= BTCF_Multiple; |
| 70059 | | - pCur->curFlags |= BTCF_Multiple; |
| 70121 | + pCur->curFlags = BTCF_Multiple; |
| 70060 | 70122 | } |
| 70061 | 70123 | } |
| 70124 | + pCur->eState = CURSOR_INVALID; |
| 70062 | 70125 | pCur->pNext = pBt->pCursor; |
| 70063 | 70126 | pBt->pCursor = pCur; |
| 70064 | | - pCur->eState = CURSOR_INVALID; |
| 70127 | + if( wrFlag ){ |
| 70128 | + pCur->curFlags |= BTCF_WriteFlag; |
| 70129 | + pCur->curPagerFlags = 0; |
| 70130 | + if( pBt->pTmpSpace==0 ) return allocateTempSpace(pBt); |
| 70131 | + }else{ |
| 70132 | + pCur->curPagerFlags = PAGER_GET_READONLY; |
| 70133 | + } |
| 70065 | 70134 | return SQLITE_OK; |
| 70066 | 70135 | } |
| 70067 | 70136 | static int btreeCursorWithLock( |
| 70068 | 70137 | Btree *p, /* The btree */ |
| 70069 | 70138 | Pgno iTable, /* Root page of table to open */ |
| | @@ -77812,16 +77881,16 @@ |
| 77812 | 77881 | ** it into an integer and return that. If pMem represents an |
| 77813 | 77882 | ** an SQL-NULL value, return 0. |
| 77814 | 77883 | ** |
| 77815 | 77884 | ** If pMem represents a string value, its encoding might be changed. |
| 77816 | 77885 | */ |
| 77817 | | -static SQLITE_NOINLINE i64 memIntValue(Mem *pMem){ |
| 77886 | +static SQLITE_NOINLINE i64 memIntValue(const Mem *pMem){ |
| 77818 | 77887 | i64 value = 0; |
| 77819 | 77888 | sqlite3Atoi64(pMem->z, &value, pMem->n, pMem->enc); |
| 77820 | 77889 | return value; |
| 77821 | 77890 | } |
| 77822 | | -SQLITE_PRIVATE i64 sqlite3VdbeIntValue(Mem *pMem){ |
| 77891 | +SQLITE_PRIVATE i64 sqlite3VdbeIntValue(const Mem *pMem){ |
| 77823 | 77892 | int flags; |
| 77824 | 77893 | assert( pMem!=0 ); |
| 77825 | 77894 | assert( pMem->db==0 || sqlite3_mutex_held(pMem->db->mutex) ); |
| 77826 | 77895 | assert( EIGHT_BYTE_ALIGNMENT(pMem) ); |
| 77827 | 77896 | flags = pMem->flags; |
| | @@ -87366,10 +87435,35 @@ |
| 87366 | 87435 | }else{ |
| 87367 | 87436 | pOut->flags = MEM_Int; |
| 87368 | 87437 | return pOut; |
| 87369 | 87438 | } |
| 87370 | 87439 | } |
| 87440 | + |
| 87441 | +/* |
| 87442 | +** Compute a bloom filter hash using pOp->p4.i registers from aMem[] beginning |
| 87443 | +** with pOp->p3. Return the hash. |
| 87444 | +*/ |
| 87445 | +static u64 filterHash(const Mem *aMem, const Op *pOp){ |
| 87446 | + int i, mx; |
| 87447 | + u64 h = 0; |
| 87448 | + |
| 87449 | + i = pOp->p3; |
| 87450 | + assert( pOp->p4type==P4_INT32 ); |
| 87451 | + mx = i + pOp->p4.i; |
| 87452 | + for(i=pOp->p3, mx=i+pOp->p4.i; i<mx; i++){ |
| 87453 | + const Mem *p = &aMem[i]; |
| 87454 | + if( p->flags & (MEM_Int|MEM_IntReal) ){ |
| 87455 | + h += p->u.i; |
| 87456 | + }else if( p->flags & MEM_Real ){ |
| 87457 | + h += sqlite3VdbeIntValue(p); |
| 87458 | + }else if( p->flags & (MEM_Str|MEM_Blob) ){ |
| 87459 | + h += p->n; |
| 87460 | + if( p->flags & MEM_Zero ) h += p->u.nZero; |
| 87461 | + } |
| 87462 | + } |
| 87463 | + return h; |
| 87464 | +} |
| 87371 | 87465 | |
| 87372 | 87466 | /* |
| 87373 | 87467 | ** Return the symbolic name for the data type of a pMem |
| 87374 | 87468 | */ |
| 87375 | 87469 | static const char *vdbeMemTypeName(Mem *pMem){ |
| | @@ -88021,16 +88115,22 @@ |
| 88021 | 88115 | |
| 88022 | 88116 | /* Opcode: Blob P1 P2 * P4 * |
| 88023 | 88117 | ** Synopsis: r[P2]=P4 (len=P1) |
| 88024 | 88118 | ** |
| 88025 | 88119 | ** P4 points to a blob of data P1 bytes long. Store this |
| 88026 | | -** blob in register P2. |
| 88120 | +** blob in register P2. If P4 is a NULL pointer, then construct |
| 88121 | +** a zero-filled blob that is P1 bytes long in P2. |
| 88027 | 88122 | */ |
| 88028 | 88123 | case OP_Blob: { /* out2 */ |
| 88029 | 88124 | assert( pOp->p1 <= SQLITE_MAX_LENGTH ); |
| 88030 | 88125 | pOut = out2Prerelease(p, pOp); |
| 88031 | | - sqlite3VdbeMemSetStr(pOut, pOp->p4.z, pOp->p1, 0, 0); |
| 88126 | + if( pOp->p4.z==0 ){ |
| 88127 | + sqlite3VdbeMemSetZeroBlob(pOut, pOp->p1); |
| 88128 | + if( sqlite3VdbeMemExpandBlob(pOut) ) goto no_mem; |
| 88129 | + }else{ |
| 88130 | + sqlite3VdbeMemSetStr(pOut, pOp->p4.z, pOp->p1, 0, 0); |
| 88131 | + } |
| 88032 | 88132 | pOut->enc = encoding; |
| 88033 | 88133 | UPDATE_MAX_BLOBSIZE(pOut); |
| 88034 | 88134 | break; |
| 88035 | 88135 | } |
| 88036 | 88136 | |
| | @@ -88175,28 +88275,26 @@ |
| 88175 | 88275 | pOut = &aMem[pOp->p2]; |
| 88176 | 88276 | sqlite3VdbeMemSetInt64(pOut, pIn1->u.i); |
| 88177 | 88277 | break; |
| 88178 | 88278 | } |
| 88179 | 88279 | |
| 88180 | | -/* Opcode: ChngCntRow P1 P2 * * * |
| 88181 | | -** Synopsis: output=r[P1] |
| 88182 | | -** |
| 88183 | | -** Output value in register P1 as the chance count for a DML statement, |
| 88184 | | -** due to the "PRAGMA count_changes=ON" setting. Or, if there was a |
| 88185 | | -** foreign key error in the statement, trigger the error now. |
| 88186 | | -** |
| 88187 | | -** This opcode is a variant of OP_ResultRow that checks the foreign key |
| 88188 | | -** immediate constraint count and throws an error if the count is |
| 88189 | | -** non-zero. The P2 opcode must be 1. |
| 88190 | | -*/ |
| 88191 | | -case OP_ChngCntRow: { |
| 88192 | | - assert( pOp->p2==1 ); |
| 88280 | +/* Opcode: FkCheck * * * * * |
| 88281 | +** |
| 88282 | +** Halt with an SQLITE_CONSTRAINT error if there are any unresolved |
| 88283 | +** foreign key constraint violations. If there are no foreign key |
| 88284 | +** constraint violations, this is a no-op. |
| 88285 | +** |
| 88286 | +** FK constraint violations are also checked when the prepared statement |
| 88287 | +** exits. This opcode is used to raise foreign key constraint errors prior |
| 88288 | +** to returning results such as a row change count or the result of a |
| 88289 | +** RETURNING clause. |
| 88290 | +*/ |
| 88291 | +case OP_FkCheck: { |
| 88193 | 88292 | if( (rc = sqlite3VdbeCheckFk(p,0))!=SQLITE_OK ){ |
| 88194 | 88293 | goto abort_due_to_error; |
| 88195 | 88294 | } |
| 88196 | | - /* Fall through to the next case, OP_ResultRow */ |
| 88197 | | - /* no break */ deliberate_fall_through |
| 88295 | + break; |
| 88198 | 88296 | } |
| 88199 | 88297 | |
| 88200 | 88298 | /* Opcode: ResultRow P1 P2 * * * |
| 88201 | 88299 | ** Synopsis: output=r[P1@P2] |
| 88202 | 88300 | ** |
| | @@ -90039,11 +90137,11 @@ |
| 90039 | 90137 | assert( pOp->p3>0 && pOp->p3<=(p->nMem+1 - p->nCursor) ); |
| 90040 | 90138 | REGISTER_TRACE(pOp->p3, pOut); |
| 90041 | 90139 | break; |
| 90042 | 90140 | } |
| 90043 | 90141 | |
| 90044 | | -/* Opcode: Count P1 P2 p3 * * |
| 90142 | +/* Opcode: Count P1 P2 P3 * * |
| 90045 | 90143 | ** Synopsis: r[P2]=count() |
| 90046 | 90144 | ** |
| 90047 | 90145 | ** Store the number of entries (an integer value) in the table or index |
| 90048 | 90146 | ** opened by cursor P1 in register P2. |
| 90049 | 90147 | ** |
| | @@ -94824,10 +94922,81 @@ |
| 94824 | 94922 | |
| 94825 | 94923 | REGISTER_TRACE(pOp->p3, pOut); |
| 94826 | 94924 | UPDATE_MAX_BLOBSIZE(pOut); |
| 94827 | 94925 | break; |
| 94828 | 94926 | } |
| 94927 | + |
| 94928 | +/* Opcode: FilterAdd P1 * P3 P4 * |
| 94929 | +** Synopsis: filter(P1) += key(P3@P4) |
| 94930 | +** |
| 94931 | +** Compute a hash on the P4 registers starting with r[P3] and |
| 94932 | +** add that hash to the bloom filter contained in r[P1]. |
| 94933 | +*/ |
| 94934 | +case OP_FilterAdd: { |
| 94935 | + u64 h; |
| 94936 | + |
| 94937 | + assert( pOp->p1>0 && pOp->p1<=(p->nMem+1 - p->nCursor) ); |
| 94938 | + pIn1 = &aMem[pOp->p1]; |
| 94939 | + assert( pIn1->flags & MEM_Blob ); |
| 94940 | + assert( pIn1->n>0 ); |
| 94941 | + h = filterHash(aMem, pOp); |
| 94942 | +#ifdef SQLITE_DEBUG |
| 94943 | + if( db->flags&SQLITE_VdbeTrace ){ |
| 94944 | + int ii; |
| 94945 | + for(ii=pOp->p3; ii<pOp->p3+pOp->p4.i; ii++){ |
| 94946 | + registerTrace(ii, &aMem[ii]); |
| 94947 | + } |
| 94948 | + printf("hash: %llu modulo %d -> %u\n", h, pIn1->n, (int)(h%pIn1->n)); |
| 94949 | + } |
| 94950 | +#endif |
| 94951 | + h %= pIn1->n; |
| 94952 | + pIn1->z[h/8] |= 1<<(h&7); |
| 94953 | + break; |
| 94954 | +} |
| 94955 | + |
| 94956 | +/* Opcode: Filter P1 P2 P3 P4 * |
| 94957 | +** Synopsis: if key(P3@P4) not in filter(P1) goto P2 |
| 94958 | +** |
| 94959 | +** Compute a hash on the key contained in the P4 registers starting |
| 94960 | +** with r[P3]. Check to see if that hash is found in the |
| 94961 | +** bloom filter hosted by register P1. If it is not present then |
| 94962 | +** maybe jump to P2. Otherwise fall through. |
| 94963 | +** |
| 94964 | +** False negatives are harmless. It is always safe to fall through, |
| 94965 | +** even if the value is in the bloom filter. A false negative causes |
| 94966 | +** more CPU cycles to be used, but it should still yield the correct |
| 94967 | +** answer. However, an incorrect answer may well arise from a |
| 94968 | +** false positive - if the jump is taken when it should fall through. |
| 94969 | +*/ |
| 94970 | +case OP_Filter: { /* jump */ |
| 94971 | + u64 h; |
| 94972 | + |
| 94973 | + assert( pOp->p1>0 && pOp->p1<=(p->nMem+1 - p->nCursor) ); |
| 94974 | + pIn1 = &aMem[pOp->p1]; |
| 94975 | + assert( (pIn1->flags & MEM_Blob)!=0 ); |
| 94976 | + assert( pIn1->n >= 1 ); |
| 94977 | + h = filterHash(aMem, pOp); |
| 94978 | +#ifdef SQLITE_DEBUG |
| 94979 | + if( db->flags&SQLITE_VdbeTrace ){ |
| 94980 | + int ii; |
| 94981 | + for(ii=pOp->p3; ii<pOp->p3+pOp->p4.i; ii++){ |
| 94982 | + registerTrace(ii, &aMem[ii]); |
| 94983 | + } |
| 94984 | + printf("hash: %llu modulo %d -> %u\n", h, pIn1->n, (int)(h%pIn1->n)); |
| 94985 | + } |
| 94986 | +#endif |
| 94987 | + h %= pIn1->n; |
| 94988 | + if( (pIn1->z[h/8] & (1<<(h&7)))==0 ){ |
| 94989 | + VdbeBranchTaken(1, 2); |
| 94990 | + p->aCounter[SQLITE_STMTSTATUS_FILTER_HIT]++; |
| 94991 | + goto jump_to_p2; |
| 94992 | + }else{ |
| 94993 | + p->aCounter[SQLITE_STMTSTATUS_FILTER_MISS]++; |
| 94994 | + VdbeBranchTaken(0, 2); |
| 94995 | + } |
| 94996 | + break; |
| 94997 | +} |
| 94829 | 94998 | |
| 94830 | 94999 | /* Opcode: Trace P1 P2 * P4 * |
| 94831 | 95000 | ** |
| 94832 | 95001 | ** Write P4 on the statement trace output if statement tracing is |
| 94833 | 95002 | ** enabled. |
| | @@ -104083,11 +104252,11 @@ |
| 104083 | 104252 | case TK_COLUMN: |
| 104084 | 104253 | assert( ExprUseYTab(p) ); |
| 104085 | 104254 | return ExprHasProperty(p, EP_CanBeNull) || |
| 104086 | 104255 | p->y.pTab==0 || /* Reference to column of index on expression */ |
| 104087 | 104256 | (p->iColumn>=0 |
| 104088 | | - && ALWAYS(p->y.pTab->aCol!=0) /* Defense against OOM problems */ |
| 104257 | + && p->y.pTab->aCol!=0 /* Possible due to prior error */ |
| 104089 | 104258 | && p->y.pTab->aCol[p->iColumn].notNull==0); |
| 104090 | 104259 | default: |
| 104091 | 104260 | return 1; |
| 104092 | 104261 | } |
| 104093 | 104262 | } |
| | @@ -107514,11 +107683,11 @@ |
| 107514 | 107683 | ** implement sqlite3ReferencesSrcList(). |
| 107515 | 107684 | */ |
| 107516 | 107685 | struct RefSrcList { |
| 107517 | 107686 | sqlite3 *db; /* Database connection used for sqlite3DbRealloc() */ |
| 107518 | 107687 | SrcList *pRef; /* Looking for references to these tables */ |
| 107519 | | - int nExclude; /* Number of tables to exclude from the search */ |
| 107688 | + i64 nExclude; /* Number of tables to exclude from the search */ |
| 107520 | 107689 | int *aiExclude; /* Cursor IDs for tables to exclude from the search */ |
| 107521 | 107690 | }; |
| 107522 | 107691 | |
| 107523 | 107692 | /* |
| 107524 | 107693 | ** Walker SELECT callbacks for sqlite3ReferencesSrcList(). |
| | @@ -107529,11 +107698,12 @@ |
| 107529 | 107698 | ** When leaving the subquery, remove those entries from the exclude list. |
| 107530 | 107699 | */ |
| 107531 | 107700 | static int selectRefEnter(Walker *pWalker, Select *pSelect){ |
| 107532 | 107701 | struct RefSrcList *p = pWalker->u.pRefSrcList; |
| 107533 | 107702 | SrcList *pSrc = pSelect->pSrc; |
| 107534 | | - int i, j, *piNew; |
| 107703 | + i64 i, j; |
| 107704 | + int *piNew; |
| 107535 | 107705 | if( pSrc->nSrc==0 ) return WRC_Continue; |
| 107536 | 107706 | j = p->nExclude; |
| 107537 | 107707 | p->nExclude += pSrc->nSrc; |
| 107538 | 107708 | piNew = sqlite3DbRealloc(p->db, p->aiExclude, p->nExclude*sizeof(int)); |
| 107539 | 107709 | if( piNew==0 ){ |
| | @@ -113192,10 +113362,11 @@ |
| 113192 | 113362 | int reg; |
| 113193 | 113363 | |
| 113194 | 113364 | if( pReturning->nRetCol==0 ){ |
| 113195 | 113365 | assert( CORRUPT_DB ); |
| 113196 | 113366 | }else{ |
| 113367 | + sqlite3VdbeAddOp0(v, OP_FkCheck); |
| 113197 | 113368 | addrRewind = |
| 113198 | 113369 | sqlite3VdbeAddOp1(v, OP_Rewind, pReturning->iRetCur); |
| 113199 | 113370 | VdbeCoverage(v); |
| 113200 | 113371 | reg = pReturning->iRetReg; |
| 113201 | 113372 | for(i=0; i<pReturning->nRetCol; i++){ |
| | @@ -113761,12 +113932,12 @@ |
| 113761 | 113932 | SQLITE_PRIVATE void sqlite3ColumnSetColl( |
| 113762 | 113933 | sqlite3 *db, |
| 113763 | 113934 | Column *pCol, |
| 113764 | 113935 | const char *zColl |
| 113765 | 113936 | ){ |
| 113766 | | - int nColl; |
| 113767 | | - int n; |
| 113937 | + i64 nColl; |
| 113938 | + i64 n; |
| 113768 | 113939 | char *zNew; |
| 113769 | 113940 | assert( zColl!=0 ); |
| 113770 | 113941 | n = sqlite3Strlen30(pCol->zCnName) + 1; |
| 113771 | 113942 | if( pCol->colFlags & COLFLAG_HASTYPE ){ |
| 113772 | 113943 | n += sqlite3Strlen30(pCol->zCnName+n) + 1; |
| | @@ -114567,11 +114738,11 @@ |
| 114567 | 114738 | break; |
| 114568 | 114739 | } |
| 114569 | 114740 | } |
| 114570 | 114741 | } |
| 114571 | 114742 | |
| 114572 | | - z = sqlite3DbMallocRaw(db, sName.n + 1 + sType.n + (sType.n>0) ); |
| 114743 | + z = sqlite3DbMallocRaw(db, (i64)sName.n + 1 + (i64)sType.n + (sType.n>0) ); |
| 114573 | 114744 | if( z==0 ) return; |
| 114574 | 114745 | if( IN_RENAME_OBJECT ) sqlite3RenameTokenMap(pParse, (void*)z, &sName); |
| 114575 | 114746 | memcpy(z, sName.z, sName.n); |
| 114576 | 114747 | z[sName.n] = 0; |
| 114577 | 114748 | sqlite3Dequote(z); |
| | @@ -114581,11 +114752,11 @@ |
| 114581 | 114752 | sqlite3ErrorMsg(pParse, "duplicate column name: %s", z); |
| 114582 | 114753 | sqlite3DbFree(db, z); |
| 114583 | 114754 | return; |
| 114584 | 114755 | } |
| 114585 | 114756 | } |
| 114586 | | - aNew = sqlite3DbRealloc(db,p->aCol,(p->nCol+1)*sizeof(p->aCol[0])); |
| 114757 | + aNew = sqlite3DbRealloc(db,p->aCol,((i64)p->nCol+1)*sizeof(p->aCol[0])); |
| 114587 | 114758 | if( aNew==0 ){ |
| 114588 | 114759 | sqlite3DbFree(db, z); |
| 114589 | 114760 | return; |
| 114590 | 114761 | } |
| 114591 | 114762 | p->aCol = aNew; |
| | @@ -116594,11 +116765,11 @@ |
| 116594 | 116765 | sqlite3 *db = pParse->db; |
| 116595 | 116766 | #ifndef SQLITE_OMIT_FOREIGN_KEY |
| 116596 | 116767 | FKey *pFKey = 0; |
| 116597 | 116768 | FKey *pNextTo; |
| 116598 | 116769 | Table *p = pParse->pNewTable; |
| 116599 | | - int nByte; |
| 116770 | + i64 nByte; |
| 116600 | 116771 | int i; |
| 116601 | 116772 | int nCol; |
| 116602 | 116773 | char *z; |
| 116603 | 116774 | |
| 116604 | 116775 | assert( pTo!=0 ); |
| | @@ -117424,17 +117595,17 @@ |
| 117424 | 117595 | } |
| 117425 | 117596 | |
| 117426 | 117597 | /* Add an entry in sqlite_schema for this index |
| 117427 | 117598 | */ |
| 117428 | 117599 | sqlite3NestedParse(pParse, |
| 117429 | | - "INSERT INTO %Q." LEGACY_SCHEMA_TABLE " VALUES('index',%Q,%Q,#%d,%Q);", |
| 117430 | | - db->aDb[iDb].zDbSName, |
| 117431 | | - pIndex->zName, |
| 117432 | | - pTab->zName, |
| 117433 | | - iMem, |
| 117434 | | - zStmt |
| 117435 | | - ); |
| 117600 | + "INSERT INTO %Q." LEGACY_SCHEMA_TABLE " VALUES('index',%Q,%Q,#%d,%Q);", |
| 117601 | + db->aDb[iDb].zDbSName, |
| 117602 | + pIndex->zName, |
| 117603 | + pTab->zName, |
| 117604 | + iMem, |
| 117605 | + zStmt |
| 117606 | + ); |
| 117436 | 117607 | sqlite3DbFree(db, zStmt); |
| 117437 | 117608 | |
| 117438 | 117609 | /* Fill the index with data and reparse the schema. Code an OP_Expire |
| 117439 | 117610 | ** to invalidate all pre-compiled statements. |
| 117440 | 117611 | */ |
| | @@ -117978,11 +118149,11 @@ |
| 117978 | 118149 | pItem->pSelect = pSubquery; |
| 117979 | 118150 | pItem->pOn = pOn; |
| 117980 | 118151 | pItem->pUsing = pUsing; |
| 117981 | 118152 | return p; |
| 117982 | 118153 | |
| 117983 | | - append_from_error: |
| 118154 | +append_from_error: |
| 117984 | 118155 | assert( p==0 ); |
| 117985 | 118156 | sqlite3ExprDelete(db, pOn); |
| 117986 | 118157 | sqlite3IdListDelete(db, pUsing); |
| 117987 | 118158 | sqlite3SelectDelete(db, pSubquery); |
| 117988 | 118159 | return 0; |
| | @@ -119234,10 +119405,20 @@ |
| 119234 | 119405 | pTab = 0; |
| 119235 | 119406 | } |
| 119236 | 119407 | } |
| 119237 | 119408 | return pTab; |
| 119238 | 119409 | } |
| 119410 | + |
| 119411 | +/* Generate byte-code that will report the number of rows modified |
| 119412 | +** by a DELETE, INSERT, or UPDATE statement. |
| 119413 | +*/ |
| 119414 | +SQLITE_PRIVATE void sqlite3CodeChangeCount(Vdbe *v, int regCounter, const char *zColName){ |
| 119415 | + sqlite3VdbeAddOp0(v, OP_FkCheck); |
| 119416 | + sqlite3VdbeAddOp2(v, OP_ResultRow, regCounter, 1); |
| 119417 | + sqlite3VdbeSetNumCols(v, 1); |
| 119418 | + sqlite3VdbeSetColName(v, 0, COLNAME_NAME, zColName, SQLITE_STATIC); |
| 119419 | +} |
| 119239 | 119420 | |
| 119240 | 119421 | /* Return true if table pTab is read-only. |
| 119241 | 119422 | ** |
| 119242 | 119423 | ** A table is read-only if any of the following are true: |
| 119243 | 119424 | ** |
| | @@ -119810,13 +119991,11 @@ |
| 119810 | 119991 | /* Return the number of rows that were deleted. If this routine is |
| 119811 | 119992 | ** generating code because of a call to sqlite3NestedParse(), do not |
| 119812 | 119993 | ** invoke the callback function. |
| 119813 | 119994 | */ |
| 119814 | 119995 | if( memCnt ){ |
| 119815 | | - sqlite3VdbeAddOp2(v, OP_ChngCntRow, memCnt, 1); |
| 119816 | | - sqlite3VdbeSetNumCols(v, 1); |
| 119817 | | - sqlite3VdbeSetColName(v, 0, COLNAME_NAME, "rows deleted", SQLITE_STATIC); |
| 119996 | + sqlite3CodeChangeCount(v, memCnt, "rows deleted"); |
| 119818 | 119997 | } |
| 119819 | 119998 | |
| 119820 | 119999 | delete_from_cleanup: |
| 119821 | 120000 | sqlite3AuthContextPop(&sContext); |
| 119822 | 120001 | sqlite3SrcListDelete(db, pTabList); |
| | @@ -125370,13 +125549,11 @@ |
| 125370 | 125549 | ** Return the number of rows inserted. If this routine is |
| 125371 | 125550 | ** generating code because of a call to sqlite3NestedParse(), do not |
| 125372 | 125551 | ** invoke the callback function. |
| 125373 | 125552 | */ |
| 125374 | 125553 | if( regRowCount ){ |
| 125375 | | - sqlite3VdbeAddOp2(v, OP_ChngCntRow, regRowCount, 1); |
| 125376 | | - sqlite3VdbeSetNumCols(v, 1); |
| 125377 | | - sqlite3VdbeSetColName(v, 0, COLNAME_NAME, "rows inserted", SQLITE_STATIC); |
| 125554 | + sqlite3CodeChangeCount(v, regRowCount, "rows inserted"); |
| 125378 | 125555 | } |
| 125379 | 125556 | |
| 125380 | 125557 | insert_cleanup: |
| 125381 | 125558 | sqlite3SrcListDelete(db, pTabList); |
| 125382 | 125559 | sqlite3ExprListDelete(db, pList); |
| | @@ -133002,10 +133179,11 @@ |
| 133002 | 133179 | /* Make multiple attempts to compile the SQL, until it either succeeds |
| 133003 | 133180 | ** or encounters a permanent error. A schema problem after one schema |
| 133004 | 133181 | ** reset is considered a permanent error. */ |
| 133005 | 133182 | rc = sqlite3Prepare(db, zSql, nBytes, prepFlags, pOld, ppStmt, pzTail); |
| 133006 | 133183 | assert( rc==SQLITE_OK || *ppStmt==0 ); |
| 133184 | + if( rc==SQLITE_OK || db->mallocFailed ) break; |
| 133007 | 133185 | }while( rc==SQLITE_ERROR_RETRY |
| 133008 | 133186 | || (rc==SQLITE_SCHEMA && (sqlite3ResetOneSchema(db,-1), cnt++)==0) ); |
| 133009 | 133187 | sqlite3BtreeLeaveAll(db); |
| 133010 | 133188 | rc = sqlite3ApiExit(db, rc); |
| 133011 | 133189 | assert( (rc&db->errMask)==rc ); |
| | @@ -135418,11 +135596,11 @@ |
| 135418 | 135596 | memset(&sNC, 0, sizeof(sNC)); |
| 135419 | 135597 | sNC.pSrcList = pSelect->pSrc; |
| 135420 | 135598 | a = pSelect->pEList->a; |
| 135421 | 135599 | for(i=0, pCol=pTab->aCol; i<pTab->nCol; i++, pCol++){ |
| 135422 | 135600 | const char *zType; |
| 135423 | | - int n, m; |
| 135601 | + i64 n, m; |
| 135424 | 135602 | pTab->tabFlags |= (pCol->colFlags & COLFLAG_NOINSERT); |
| 135425 | 135603 | p = a[i].pExpr; |
| 135426 | 135604 | zType = columnType(&sNC, p, 0, 0, 0); |
| 135427 | 135605 | /* pCol->szEst = ... // Column size est for SELECT tables never used */ |
| 135428 | 135606 | pCol->affinity = sqlite3ExprAffinity(p); |
| | @@ -137404,11 +137582,11 @@ |
| 137404 | 137582 | /* Restriction (23) */ |
| 137405 | 137583 | if( (p->selFlags & SF_Recursive) ) return 0; |
| 137406 | 137584 | |
| 137407 | 137585 | if( pSrc->nSrc>1 ){ |
| 137408 | 137586 | if( pParse->nSelect>500 ) return 0; |
| 137409 | | - aCsrMap = sqlite3DbMallocZero(db, (pParse->nTab+1)*sizeof(int)); |
| 137587 | + aCsrMap = sqlite3DbMallocZero(db, ((i64)pParse->nTab+1)*sizeof(int)); |
| 137410 | 137588 | if( aCsrMap ) aCsrMap[0] = pParse->nTab; |
| 137411 | 137589 | } |
| 137412 | 137590 | } |
| 137413 | 137591 | |
| 137414 | 137592 | /***** If we reach this point, flattening is permitted. *****/ |
| | @@ -138175,15 +138353,15 @@ |
| 138175 | 138353 | ** |
| 138176 | 138354 | ** where table is a database table, not a sub-select or view. If the query |
| 138177 | 138355 | ** does match this pattern, then a pointer to the Table object representing |
| 138178 | 138356 | ** <tbl> is returned. Otherwise, NULL is returned. |
| 138179 | 138357 | ** |
| 138180 | | -** This routine a condition for the count optimization. A correct answer |
| 138181 | | -** is obtained (though perhaps more slowly) if this routine returns NULL when |
| 138182 | | -** it could have returned a table pointer. But returning the pointer when |
| 138183 | | -** NULL should have been returned can result in incorrect answers and/or |
| 138184 | | -** crashes. So, when in doubt, return NULL. |
| 138358 | +** This routine checks to see if it is safe to use the count optimization. |
| 138359 | +** A correct answer is still obtained (though perhaps more slowly) if |
| 138360 | +** this routine returns NULL when it could have returned a table pointer. |
| 138361 | +** But returning the pointer when NULL should have been returned can |
| 138362 | +** result in incorrect answers and/or crashes. So, when in doubt, return NULL. |
| 138185 | 138363 | */ |
| 138186 | 138364 | static Table *isSimpleCount(Select *p, AggInfo *pAggInfo){ |
| 138187 | 138365 | Table *pTab; |
| 138188 | 138366 | Expr *pExpr; |
| 138189 | 138367 | |
| | @@ -143493,13 +143671,11 @@ |
| 143493 | 143671 | /* |
| 143494 | 143672 | ** Return the number of rows that were changed, if we are tracking |
| 143495 | 143673 | ** that information. |
| 143496 | 143674 | */ |
| 143497 | 143675 | if( regRowCount ){ |
| 143498 | | - sqlite3VdbeAddOp2(v, OP_ChngCntRow, regRowCount, 1); |
| 143499 | | - sqlite3VdbeSetNumCols(v, 1); |
| 143500 | | - sqlite3VdbeSetColName(v, 0, COLNAME_NAME, "rows updated", SQLITE_STATIC); |
| 143676 | + sqlite3CodeChangeCount(v, regRowCount, "rows updated"); |
| 143501 | 143677 | } |
| 143502 | 143678 | |
| 143503 | 143679 | update_cleanup: |
| 143504 | 143680 | sqlite3AuthContextPop(&sContext); |
| 143505 | 143681 | sqlite3DbFree(db, aXRef); /* Also frees aRegIdx[] and aToOpen[] */ |
| | @@ -145869,10 +146045,11 @@ |
| 145869 | 146045 | int addrBignull; /* Jump here for next part of big-null scan */ |
| 145870 | 146046 | #ifndef SQLITE_LIKE_DOESNT_MATCH_BLOBS |
| 145871 | 146047 | u32 iLikeRepCntr; /* LIKE range processing counter register (times 2) */ |
| 145872 | 146048 | int addrLikeRep; /* LIKE range processing address */ |
| 145873 | 146049 | #endif |
| 146050 | + int regFilter; /* Bloom filter */ |
| 145874 | 146051 | u8 iFrom; /* Which entry in the FROM clause */ |
| 145875 | 146052 | u8 op, p3, p5; /* Opcode, P3 & P5 of the opcode that ends the loop */ |
| 145876 | 146053 | int p1, p2; /* Operands of the opcode used to end the loop */ |
| 145877 | 146054 | union { /* Information that depends on pWLoop->wsFlags */ |
| 145878 | 146055 | struct { |
| | @@ -146097,15 +146274,15 @@ |
| 146097 | 146274 | struct WhereScan { |
| 146098 | 146275 | WhereClause *pOrigWC; /* Original, innermost WhereClause */ |
| 146099 | 146276 | WhereClause *pWC; /* WhereClause currently being scanned */ |
| 146100 | 146277 | const char *zCollName; /* Required collating sequence, if not NULL */ |
| 146101 | 146278 | Expr *pIdxExpr; /* Search for this index expression */ |
| 146102 | | - char idxaff; /* Must match this affinity, if zCollName!=NULL */ |
| 146103 | | - unsigned char nEquiv; /* Number of entries in aiCur[] and aiColumn[] */ |
| 146104 | | - unsigned char iEquiv; /* Next unused slot in aiCur[] and aiColumn[] */ |
| 146279 | + int k; /* Resume scanning at this->pWC->a[this->k] */ |
| 146105 | 146280 | u32 opMask; /* Acceptable operators */ |
| 146106 | | - int k; /* Resume scanning at this->pWC->a[this->k] */ |
| 146281 | + char idxaff; /* Must match this affinity, if zCollName!=NULL */ |
| 146282 | + unsigned char iEquiv; /* Current slot in aiCur[] and aiColumn[] */ |
| 146283 | + unsigned char nEquiv; /* Number of entries in aiCur[] and aiColumn[] */ |
| 146107 | 146284 | int aiCur[11]; /* Cursors in the equivalence class */ |
| 146108 | 146285 | i16 aiColumn[11]; /* Corresponding column number in the eq-class */ |
| 146109 | 146286 | }; |
| 146110 | 146287 | |
| 146111 | 146288 | /* |
| | @@ -146125,10 +146302,11 @@ |
| 146125 | 146302 | WhereClause *pOuter; /* Outer conjunction */ |
| 146126 | 146303 | u8 op; /* Split operator. TK_AND or TK_OR */ |
| 146127 | 146304 | u8 hasOr; /* True if any a[].eOperator is WO_OR */ |
| 146128 | 146305 | int nTerm; /* Number of terms */ |
| 146129 | 146306 | int nSlot; /* Number of entries in a[] */ |
| 146307 | + int nBase; /* Number of terms through the last non-Virtual */ |
| 146130 | 146308 | WhereTerm *a; /* Each a[] describes a term of the WHERE cluase */ |
| 146131 | 146309 | #if defined(SQLITE_SMALL_STACK) |
| 146132 | 146310 | WhereTerm aStatic[1]; /* Initial static space for a[] */ |
| 146133 | 146311 | #else |
| 146134 | 146312 | WhereTerm aStatic[8]; /* Initial static space for a[] */ |
| | @@ -146182,15 +146360,10 @@ |
| 146182 | 146360 | int bVarSelect; /* Used by sqlite3WhereExprUsage() */ |
| 146183 | 146361 | int n; /* Number of assigned cursor values */ |
| 146184 | 146362 | int ix[BMS]; /* Cursor assigned to each bit */ |
| 146185 | 146363 | }; |
| 146186 | 146364 | |
| 146187 | | -/* |
| 146188 | | -** Initialize a WhereMaskSet object |
| 146189 | | -*/ |
| 146190 | | -#define initMaskSet(P) (P)->n=0 |
| 146191 | | - |
| 146192 | 146365 | /* |
| 146193 | 146366 | ** This object is a convenience wrapper holding all information needed |
| 146194 | 146367 | ** to construct WhereLoop objects for a particular query. |
| 146195 | 146368 | */ |
| 146196 | 146369 | struct WhereLoopBuilder { |
| | @@ -146315,12 +146488,18 @@ |
| 146315 | 146488 | Parse *pParse, /* Parse context */ |
| 146316 | 146489 | SrcList *pTabList, /* Table list this loop refers to */ |
| 146317 | 146490 | WhereLevel *pLevel, /* Scan to write OP_Explain opcode for */ |
| 146318 | 146491 | u16 wctrlFlags /* Flags passed to sqlite3WhereBegin() */ |
| 146319 | 146492 | ); |
| 146493 | +SQLITE_PRIVATE int sqlite3WhereExplainBloomFilter( |
| 146494 | + const Parse *pParse, /* Parse context */ |
| 146495 | + const WhereInfo *pWInfo, /* WHERE clause */ |
| 146496 | + const WhereLevel *pLevel /* Bloom filter on this level */ |
| 146497 | +); |
| 146320 | 146498 | #else |
| 146321 | 146499 | # define sqlite3WhereExplainOneScan(u,v,w,x) 0 |
| 146500 | +# define sqlite3WhereExplainBloomFilter(u,v,w) 0 |
| 146322 | 146501 | #endif /* SQLITE_OMIT_EXPLAIN */ |
| 146323 | 146502 | #ifdef SQLITE_ENABLE_STMT_SCANSTATUS |
| 146324 | 146503 | SQLITE_PRIVATE void sqlite3WhereAddScanStatus( |
| 146325 | 146504 | Vdbe *v, /* Vdbe to add scanstatus entry to */ |
| 146326 | 146505 | SrcList *pSrclist, /* FROM clause pLvl reads data from */ |
| | @@ -146409,10 +146588,12 @@ |
| 146409 | 146588 | #define WHERE_PARTIALIDX 0x00020000 /* The automatic index is partial */ |
| 146410 | 146589 | #define WHERE_IN_EARLYOUT 0x00040000 /* Perhaps quit IN loops early */ |
| 146411 | 146590 | #define WHERE_BIGNULL_SORT 0x00080000 /* Column nEq of index is BIGNULL */ |
| 146412 | 146591 | #define WHERE_IN_SEEKSCAN 0x00100000 /* Seek-scan optimization for IN */ |
| 146413 | 146592 | #define WHERE_TRANSCONS 0x00200000 /* Uses a transitive constraint */ |
| 146593 | +#define WHERE_BLOOMFILTER 0x00400000 /* Consider using a Bloom-filter */ |
| 146594 | +#define WHERE_SELFCULL 0x00800000 /* nOut reduced by extra WHERE terms */ |
| 146414 | 146595 | |
| 146415 | 146596 | #endif /* !defined(SQLITE_WHEREINT_H) */ |
| 146416 | 146597 | |
| 146417 | 146598 | /************** End of whereInt.h ********************************************/ |
| 146418 | 146599 | /************** Continuing where we left off in wherecode.c ******************/ |
| | @@ -146571,23 +146752,31 @@ |
| 146571 | 146752 | sqlite3_str_append(&str, " USING ", 7); |
| 146572 | 146753 | sqlite3_str_appendf(&str, zFmt, pIdx->zName); |
| 146573 | 146754 | explainIndexRange(&str, pLoop); |
| 146574 | 146755 | } |
| 146575 | 146756 | }else if( (flags & WHERE_IPK)!=0 && (flags & WHERE_CONSTRAINT)!=0 ){ |
| 146576 | | - const char *zRangeOp; |
| 146757 | + char cRangeOp; |
| 146758 | +#if 0 /* Better output, but breaks many tests */ |
| 146759 | + const Table *pTab = pItem->pTab; |
| 146760 | + const char *zRowid = pTab->iPKey>=0 ? pTab->aCol[pTab->iPKey].zCnName: |
| 146761 | + "rowid"; |
| 146762 | +#else |
| 146763 | + const char *zRowid = "rowid"; |
| 146764 | +#endif |
| 146765 | + sqlite3_str_appendf(&str, " USING INTEGER PRIMARY KEY (%s", zRowid); |
| 146577 | 146766 | if( flags&(WHERE_COLUMN_EQ|WHERE_COLUMN_IN) ){ |
| 146578 | | - zRangeOp = "="; |
| 146767 | + cRangeOp = '='; |
| 146579 | 146768 | }else if( (flags&WHERE_BOTH_LIMIT)==WHERE_BOTH_LIMIT ){ |
| 146580 | | - zRangeOp = ">? AND rowid<"; |
| 146769 | + sqlite3_str_appendf(&str, ">? AND %s", zRowid); |
| 146770 | + cRangeOp = '<'; |
| 146581 | 146771 | }else if( flags&WHERE_BTM_LIMIT ){ |
| 146582 | | - zRangeOp = ">"; |
| 146772 | + cRangeOp = '>'; |
| 146583 | 146773 | }else{ |
| 146584 | 146774 | assert( flags&WHERE_TOP_LIMIT); |
| 146585 | | - zRangeOp = "<"; |
| 146775 | + cRangeOp = '<'; |
| 146586 | 146776 | } |
| 146587 | | - sqlite3_str_appendf(&str, |
| 146588 | | - " USING INTEGER PRIMARY KEY (rowid%s?)",zRangeOp); |
| 146777 | + sqlite3_str_appendf(&str, "%c?)", cRangeOp); |
| 146589 | 146778 | } |
| 146590 | 146779 | #ifndef SQLITE_OMIT_VIRTUALTABLE |
| 146591 | 146780 | else if( (flags & WHERE_VIRTUALTABLE)!=0 ){ |
| 146592 | 146781 | sqlite3_str_appendf(&str, " VIRTUAL TABLE INDEX %d:%s", |
| 146593 | 146782 | pLoop->u.vtab.idxNum, pLoop->u.vtab.idxStr); |
| | @@ -146606,10 +146795,60 @@ |
| 146606 | 146795 | ret = sqlite3VdbeAddOp4(v, OP_Explain, sqlite3VdbeCurrentAddr(v), |
| 146607 | 146796 | pParse->addrExplain, 0, zMsg,P4_DYNAMIC); |
| 146608 | 146797 | } |
| 146609 | 146798 | return ret; |
| 146610 | 146799 | } |
| 146800 | + |
| 146801 | +/* |
| 146802 | +** Add a single OP_Explain opcode that describes a Bloom filter. |
| 146803 | +** |
| 146804 | +** Or if not processing EXPLAIN QUERY PLAN and not in a SQLITE_DEBUG and/or |
| 146805 | +** SQLITE_ENABLE_STMT_SCANSTATUS build, then OP_Explain opcodes are not |
| 146806 | +** required and this routine is a no-op. |
| 146807 | +** |
| 146808 | +** If an OP_Explain opcode is added to the VM, its address is returned. |
| 146809 | +** Otherwise, if no OP_Explain is coded, zero is returned. |
| 146810 | +*/ |
| 146811 | +SQLITE_PRIVATE int sqlite3WhereExplainBloomFilter( |
| 146812 | + const Parse *pParse, /* Parse context */ |
| 146813 | + const WhereInfo *pWInfo, /* WHERE clause */ |
| 146814 | + const WhereLevel *pLevel /* Bloom filter on this level */ |
| 146815 | +){ |
| 146816 | + int ret = 0; |
| 146817 | + SrcItem *pItem = &pWInfo->pTabList->a[pLevel->iFrom]; |
| 146818 | + Vdbe *v = pParse->pVdbe; /* VM being constructed */ |
| 146819 | + sqlite3 *db = pParse->db; /* Database handle */ |
| 146820 | + char *zMsg; /* Text to add to EQP output */ |
| 146821 | + int i; /* Loop counter */ |
| 146822 | + WhereLoop *pLoop; /* The where loop */ |
| 146823 | + StrAccum str; /* EQP output string */ |
| 146824 | + char zBuf[100]; /* Initial space for EQP output string */ |
| 146825 | + |
| 146826 | + sqlite3StrAccumInit(&str, db, zBuf, sizeof(zBuf), SQLITE_MAX_LENGTH); |
| 146827 | + str.printfFlags = SQLITE_PRINTF_INTERNAL; |
| 146828 | + sqlite3_str_appendf(&str, "BLOOM FILTER ON %S (", pItem); |
| 146829 | + pLoop = pLevel->pWLoop; |
| 146830 | + if( pLoop->wsFlags & WHERE_IPK ){ |
| 146831 | + const Table *pTab = pItem->pTab; |
| 146832 | + if( pTab->iPKey>=0 ){ |
| 146833 | + sqlite3_str_appendf(&str, "%s=?", pTab->aCol[pTab->iPKey].zCnName); |
| 146834 | + }else{ |
| 146835 | + sqlite3_str_appendf(&str, "rowid=?"); |
| 146836 | + } |
| 146837 | + }else{ |
| 146838 | + for(i=pLoop->nSkip; i<pLoop->u.btree.nEq; i++){ |
| 146839 | + const char *z = explainIndexColumnName(pLoop->u.btree.pIndex, i); |
| 146840 | + if( i>pLoop->nSkip ) sqlite3_str_append(&str, " AND ", 5); |
| 146841 | + sqlite3_str_appendf(&str, "%s=?", z); |
| 146842 | + } |
| 146843 | + } |
| 146844 | + sqlite3_str_append(&str, ")", 1); |
| 146845 | + zMsg = sqlite3StrAccumFinish(&str); |
| 146846 | + ret = sqlite3VdbeAddOp4(v, OP_Explain, sqlite3VdbeCurrentAddr(v), |
| 146847 | + pParse->addrExplain, 0, zMsg,P4_DYNAMIC); |
| 146848 | + return ret; |
| 146849 | +} |
| 146611 | 146850 | #endif /* SQLITE_OMIT_EXPLAIN */ |
| 146612 | 146851 | |
| 146613 | 146852 | #ifdef SQLITE_ENABLE_STMT_SCANSTATUS |
| 146614 | 146853 | /* |
| 146615 | 146854 | ** Configure the VM passed as the first argument with an |
| | @@ -147365,11 +147604,11 @@ |
| 147365 | 147604 | sHint.pIdx = pLoop->u.btree.pIndex; |
| 147366 | 147605 | memset(&sWalker, 0, sizeof(sWalker)); |
| 147367 | 147606 | sWalker.pParse = pParse; |
| 147368 | 147607 | sWalker.u.pCCurHint = &sHint; |
| 147369 | 147608 | pWC = &pWInfo->sWC; |
| 147370 | | - for(i=0; i<pWC->nTerm; i++){ |
| 147609 | + for(i=0; i<pWC->nBase; i++){ |
| 147371 | 147610 | pTerm = &pWC->a[i]; |
| 147372 | 147611 | if( pTerm->wtFlags & (TERM_VIRTUAL|TERM_CODED) ) continue; |
| 147373 | 147612 | if( pTerm->prereqAll & pLevel->notReady ) continue; |
| 147374 | 147613 | |
| 147375 | 147614 | /* Any terms specified as part of the ON(...) clause for any LEFT |
| | @@ -147695,10 +147934,67 @@ |
| 147695 | 147934 | if( sqlite3ExprCompare(0, pExpr, pTruth, iTabCur)==0 ){ |
| 147696 | 147935 | pTerm->wtFlags |= TERM_CODED; |
| 147697 | 147936 | } |
| 147698 | 147937 | } |
| 147699 | 147938 | } |
| 147939 | + |
| 147940 | +/* |
| 147941 | +** This routine is called right after An OP_Filter has been generated and |
| 147942 | +** before the corresponding index search has been performed. This routine |
| 147943 | +** checks to see if there are additional Bloom filters in inner loops that |
| 147944 | +** can be checked prior to doing the index lookup. If there are available |
| 147945 | +** inner-loop Bloom filters, then evaluate those filters now, before the |
| 147946 | +** index lookup. The idea is that a Bloom filter check is way faster than |
| 147947 | +** an index lookup, and the Bloom filter might return false, meaning that |
| 147948 | +** the index lookup can be skipped. |
| 147949 | +** |
| 147950 | +** We know that an inner loop uses a Bloom filter because it has the |
| 147951 | +** WhereLevel.regFilter set. If an inner-loop Bloom filter is checked, |
| 147952 | +** then clear the WhereLevel.regFilter value to prevent the Bloom filter |
| 147953 | +** from being checked a second time when the inner loop is evaluated. |
| 147954 | +*/ |
| 147955 | +static SQLITE_NOINLINE void filterPullDown( |
| 147956 | + Parse *pParse, /* Parsing context */ |
| 147957 | + WhereInfo *pWInfo, /* Complete information about the WHERE clause */ |
| 147958 | + int iLevel, /* Which level of pWInfo->a[] should be coded */ |
| 147959 | + int addrNxt, /* Jump here to bypass inner loops */ |
| 147960 | + Bitmask notReady /* Loops that are not ready */ |
| 147961 | +){ |
| 147962 | + while( ++iLevel < pWInfo->nLevel ){ |
| 147963 | + WhereLevel *pLevel = &pWInfo->a[iLevel]; |
| 147964 | + WhereLoop *pLoop = pLevel->pWLoop; |
| 147965 | + if( pLevel->regFilter==0 ) continue; |
| 147966 | + /* ,--- Because constructBloomFilter() has will not have set |
| 147967 | + ** vvvvv--' pLevel->regFilter if this were true. */ |
| 147968 | + if( NEVER(pLoop->prereq & notReady) ) continue; |
| 147969 | + if( pLoop->wsFlags & WHERE_IPK ){ |
| 147970 | + WhereTerm *pTerm = pLoop->aLTerm[0]; |
| 147971 | + int regRowid; |
| 147972 | + assert( pTerm!=0 ); |
| 147973 | + assert( pTerm->pExpr!=0 ); |
| 147974 | + testcase( pTerm->wtFlags & TERM_VIRTUAL ); |
| 147975 | + regRowid = sqlite3GetTempReg(pParse); |
| 147976 | + regRowid = codeEqualityTerm(pParse, pTerm, pLevel, 0, 0, regRowid); |
| 147977 | + sqlite3VdbeAddOp4Int(pParse->pVdbe, OP_Filter, pLevel->regFilter, |
| 147978 | + addrNxt, regRowid, 1); |
| 147979 | + VdbeCoverage(pParse->pVdbe); |
| 147980 | + }else{ |
| 147981 | + u16 nEq = pLoop->u.btree.nEq; |
| 147982 | + int r1; |
| 147983 | + char *zStartAff; |
| 147984 | + |
| 147985 | + assert( pLoop->wsFlags & WHERE_INDEXED ); |
| 147986 | + r1 = codeAllEqualityTerms(pParse,pLevel,0,0,&zStartAff); |
| 147987 | + codeApplyAffinity(pParse, r1, nEq, zStartAff); |
| 147988 | + sqlite3DbFree(pParse->db, zStartAff); |
| 147989 | + sqlite3VdbeAddOp4Int(pParse->pVdbe, OP_Filter, pLevel->regFilter, |
| 147990 | + addrNxt, r1, nEq); |
| 147991 | + VdbeCoverage(pParse->pVdbe); |
| 147992 | + } |
| 147993 | + pLevel->regFilter = 0; |
| 147994 | + } |
| 147995 | +} |
| 147700 | 147996 | |
| 147701 | 147997 | /* |
| 147702 | 147998 | ** Generate code for the start of the iLevel-th loop in the WHERE clause |
| 147703 | 147999 | ** implementation described by pWInfo. |
| 147704 | 148000 | */ |
| | @@ -147906,10 +148202,16 @@ |
| 147906 | 148202 | testcase( pTerm->wtFlags & TERM_VIRTUAL ); |
| 147907 | 148203 | iReleaseReg = ++pParse->nMem; |
| 147908 | 148204 | iRowidReg = codeEqualityTerm(pParse, pTerm, pLevel, 0, bRev, iReleaseReg); |
| 147909 | 148205 | if( iRowidReg!=iReleaseReg ) sqlite3ReleaseTempReg(pParse, iReleaseReg); |
| 147910 | 148206 | addrNxt = pLevel->addrNxt; |
| 148207 | + if( pLevel->regFilter ){ |
| 148208 | + sqlite3VdbeAddOp4Int(v, OP_Filter, pLevel->regFilter, addrNxt, |
| 148209 | + iRowidReg, 1); |
| 148210 | + VdbeCoverage(v); |
| 148211 | + filterPullDown(pParse, pWInfo, iLevel, addrNxt, notReady); |
| 148212 | + } |
| 147911 | 148213 | sqlite3VdbeAddOp3(v, OP_SeekRowid, iCur, addrNxt, iRowidReg); |
| 147912 | 148214 | VdbeCoverage(v); |
| 147913 | 148215 | pLevel->op = OP_Noop; |
| 147914 | 148216 | }else if( (pLoop->wsFlags & WHERE_IPK)!=0 |
| 147915 | 148217 | && (pLoop->wsFlags & WHERE_COLUMN_RANGE)!=0 |
| | @@ -148231,10 +148533,16 @@ |
| 148231 | 148533 | }else{ |
| 148232 | 148534 | if( regBignull ){ |
| 148233 | 148535 | sqlite3VdbeAddOp2(v, OP_Integer, 1, regBignull); |
| 148234 | 148536 | VdbeComment((v, "NULL-scan pass ctr")); |
| 148235 | 148537 | } |
| 148538 | + if( pLevel->regFilter ){ |
| 148539 | + sqlite3VdbeAddOp4Int(v, OP_Filter, pLevel->regFilter, addrNxt, |
| 148540 | + regBase, nEq); |
| 148541 | + VdbeCoverage(v); |
| 148542 | + filterPullDown(pParse, pWInfo, iLevel, addrNxt, notReady); |
| 148543 | + } |
| 148236 | 148544 | |
| 148237 | 148545 | op = aStartOp[(start_constraints<<2) + (startEq<<1) + bRev]; |
| 148238 | 148546 | assert( op!=0 ); |
| 148239 | 148547 | if( (pLoop->wsFlags & WHERE_IN_SEEKSCAN)!=0 && op==OP_SeekGE ){ |
| 148240 | 148548 | assert( regBignull==0 ); |
| | @@ -148862,11 +149170,11 @@ |
| 148862 | 149170 | ** Example: If the WHERE clause contains "t1.a=t2.b" and "t2.b=123" |
| 148863 | 149171 | ** and we are coding the t1 loop and the t2 loop has not yet coded, |
| 148864 | 149172 | ** then we cannot use the "t1.a=t2.b" constraint, but we can code |
| 148865 | 149173 | ** the implied "t1.a=123" constraint. |
| 148866 | 149174 | */ |
| 148867 | | - for(pTerm=pWC->a, j=pWC->nTerm; j>0; j--, pTerm++){ |
| 149175 | + for(pTerm=pWC->a, j=pWC->nBase; j>0; j--, pTerm++){ |
| 148868 | 149176 | Expr *pE, sEAlt; |
| 148869 | 149177 | WhereTerm *pAlt; |
| 148870 | 149178 | if( pTerm->wtFlags & (TERM_VIRTUAL|TERM_CODED) ) continue; |
| 148871 | 149179 | if( (pTerm->eOperator & (WO_EQ|WO_IS))==0 ) continue; |
| 148872 | 149180 | if( (pTerm->eOperator & WO_EQUIV)==0 ) continue; |
| | @@ -148907,11 +149215,11 @@ |
| 148907 | 149215 | */ |
| 148908 | 149216 | if( pLevel->iLeftJoin ){ |
| 148909 | 149217 | pLevel->addrFirst = sqlite3VdbeCurrentAddr(v); |
| 148910 | 149218 | sqlite3VdbeAddOp2(v, OP_Integer, 1, pLevel->iLeftJoin); |
| 148911 | 149219 | VdbeComment((v, "record LEFT JOIN hit")); |
| 148912 | | - for(pTerm=pWC->a, j=0; j<pWC->nTerm; j++, pTerm++){ |
| 149220 | + for(pTerm=pWC->a, j=0; j<pWC->nBase; j++, pTerm++){ |
| 148913 | 149221 | testcase( pTerm->wtFlags & TERM_VIRTUAL ); |
| 148914 | 149222 | testcase( pTerm->wtFlags & TERM_CODED ); |
| 148915 | 149223 | if( pTerm->wtFlags & (TERM_VIRTUAL|TERM_CODED) ) continue; |
| 148916 | 149224 | if( (pTerm->prereqAll & pLevel->notReady)!=0 ){ |
| 148917 | 149225 | assert( pWInfo->untestedTerms ); |
| | @@ -149018,10 +149326,11 @@ |
| 149018 | 149326 | sqlite3DbFree(db, pOld); |
| 149019 | 149327 | } |
| 149020 | 149328 | pWC->nSlot = sqlite3DbMallocSize(db, pWC->a)/sizeof(pWC->a[0]); |
| 149021 | 149329 | } |
| 149022 | 149330 | pTerm = &pWC->a[idx = pWC->nTerm++]; |
| 149331 | + if( (wtFlags & TERM_VIRTUAL)==0 ) pWC->nBase = pWC->nTerm; |
| 149023 | 149332 | if( p && ExprHasProperty(p, EP_Unlikely) ){ |
| 149024 | 149333 | pTerm->truthProb = sqlite3LogEst(p->iTable) - 270; |
| 149025 | 149334 | }else{ |
| 149026 | 149335 | pTerm->truthProb = 1; |
| 149027 | 149336 | } |
| | @@ -150009,14 +150318,17 @@ |
| 150009 | 150318 | int nLeft; /* Number of elements on left side vector */ |
| 150010 | 150319 | |
| 150011 | 150320 | if( db->mallocFailed ){ |
| 150012 | 150321 | return; |
| 150013 | 150322 | } |
| 150323 | + assert( pWC->nTerm > idxTerm ); |
| 150014 | 150324 | pTerm = &pWC->a[idxTerm]; |
| 150015 | 150325 | pMaskSet = &pWInfo->sMaskSet; |
| 150016 | 150326 | pExpr = pTerm->pExpr; |
| 150327 | + assert( pExpr!=0 ); /* Because malloc() has not failed */ |
| 150017 | 150328 | assert( pExpr->op!=TK_AS && pExpr->op!=TK_COLLATE ); |
| 150329 | + pMaskSet->bVarSelect = 0; |
| 150018 | 150330 | prereqLeft = sqlite3WhereExprUsage(pMaskSet, pExpr->pLeft); |
| 150019 | 150331 | op = pExpr->op; |
| 150020 | 150332 | if( op==TK_IN ){ |
| 150021 | 150333 | assert( pExpr->pRight==0 ); |
| 150022 | 150334 | if( sqlite3ExprCheckIN(pParse, pExpr) ) return; |
| | @@ -150023,18 +150335,32 @@ |
| 150023 | 150335 | if( ExprUseXSelect(pExpr) ){ |
| 150024 | 150336 | pTerm->prereqRight = exprSelectUsage(pMaskSet, pExpr->x.pSelect); |
| 150025 | 150337 | }else{ |
| 150026 | 150338 | pTerm->prereqRight = sqlite3WhereExprListUsage(pMaskSet, pExpr->x.pList); |
| 150027 | 150339 | } |
| 150028 | | - }else if( op==TK_ISNULL ){ |
| 150029 | | - pTerm->prereqRight = 0; |
| 150340 | + prereqAll = prereqLeft | pTerm->prereqRight; |
| 150030 | 150341 | }else{ |
| 150031 | 150342 | pTerm->prereqRight = sqlite3WhereExprUsage(pMaskSet, pExpr->pRight); |
| 150343 | + if( pExpr->pLeft==0 |
| 150344 | + || ExprHasProperty(pExpr, EP_xIsSelect|EP_IfNullRow) |
| 150345 | + || pExpr->x.pList!=0 |
| 150346 | + ){ |
| 150347 | + prereqAll = sqlite3WhereExprUsageNN(pMaskSet, pExpr); |
| 150348 | + }else{ |
| 150349 | + prereqAll = prereqLeft | pTerm->prereqRight; |
| 150350 | + } |
| 150032 | 150351 | } |
| 150033 | | - pMaskSet->bVarSelect = 0; |
| 150034 | | - prereqAll = sqlite3WhereExprUsageNN(pMaskSet, pExpr); |
| 150035 | 150352 | if( pMaskSet->bVarSelect ) pTerm->wtFlags |= TERM_VARSELECT; |
| 150353 | + |
| 150354 | +#ifdef SQLITE_DEBUG |
| 150355 | + if( prereqAll!=sqlite3WhereExprUsageNN(pMaskSet, pExpr) ){ |
| 150356 | + printf("\n*** Incorrect prereqAll computed for:\n"); |
| 150357 | + sqlite3TreeViewExpr(0,pExpr,0); |
| 150358 | + abort(); |
| 150359 | + } |
| 150360 | +#endif |
| 150361 | + |
| 150036 | 150362 | if( ExprHasProperty(pExpr, EP_FromJoin) ){ |
| 150037 | 150363 | Bitmask x = sqlite3WhereGetMask(pMaskSet, pExpr->iRightJoinTable); |
| 150038 | 150364 | prereqAll |= x; |
| 150039 | 150365 | extraRight = x-1; /* ON clause terms may not be used with an index |
| 150040 | 150366 | ** on left table of a LEFT JOIN. Ticket #3015 */ |
| | @@ -150454,10 +150780,11 @@ |
| 150454 | 150780 | ){ |
| 150455 | 150781 | pWC->pWInfo = pWInfo; |
| 150456 | 150782 | pWC->hasOr = 0; |
| 150457 | 150783 | pWC->pOuter = 0; |
| 150458 | 150784 | pWC->nTerm = 0; |
| 150785 | + pWC->nBase = 0; |
| 150459 | 150786 | pWC->nSlot = ArraySize(pWC->aStatic); |
| 150460 | 150787 | pWC->a = pWC->aStatic; |
| 150461 | 150788 | } |
| 150462 | 150789 | |
| 150463 | 150790 | /* |
| | @@ -150464,21 +150791,37 @@ |
| 150464 | 150791 | ** Deallocate a WhereClause structure. The WhereClause structure |
| 150465 | 150792 | ** itself is not freed. This routine is the inverse of |
| 150466 | 150793 | ** sqlite3WhereClauseInit(). |
| 150467 | 150794 | */ |
| 150468 | 150795 | SQLITE_PRIVATE void sqlite3WhereClauseClear(WhereClause *pWC){ |
| 150469 | | - int i; |
| 150470 | | - WhereTerm *a; |
| 150471 | 150796 | sqlite3 *db = pWC->pWInfo->pParse->db; |
| 150472 | | - for(i=pWC->nTerm-1, a=pWC->a; i>=0; i--, a++){ |
| 150473 | | - if( a->wtFlags & TERM_DYNAMIC ){ |
| 150474 | | - sqlite3ExprDelete(db, a->pExpr); |
| 150475 | | - } |
| 150476 | | - if( a->wtFlags & TERM_ORINFO ){ |
| 150477 | | - whereOrInfoDelete(db, a->u.pOrInfo); |
| 150478 | | - }else if( a->wtFlags & TERM_ANDINFO ){ |
| 150479 | | - whereAndInfoDelete(db, a->u.pAndInfo); |
| 150797 | + assert( pWC->nTerm>=pWC->nBase ); |
| 150798 | + if( pWC->nTerm>0 ){ |
| 150799 | + WhereTerm *a = pWC->a; |
| 150800 | + WhereTerm *aLast = &pWC->a[pWC->nTerm-1]; |
| 150801 | +#ifdef SQLITE_DEBUG |
| 150802 | + int i; |
| 150803 | + /* Verify that every term past pWC->nBase is virtual */ |
| 150804 | + for(i=pWC->nBase; i<pWC->nTerm; i++){ |
| 150805 | + assert( (pWC->a[i].wtFlags & TERM_VIRTUAL)!=0 ); |
| 150806 | + } |
| 150807 | +#endif |
| 150808 | + while(1){ |
| 150809 | + if( a->wtFlags & TERM_DYNAMIC ){ |
| 150810 | + sqlite3ExprDelete(db, a->pExpr); |
| 150811 | + } |
| 150812 | + if( a->wtFlags & (TERM_ORINFO|TERM_ANDINFO) ){ |
| 150813 | + if( a->wtFlags & TERM_ORINFO ){ |
| 150814 | + assert( (a->wtFlags & TERM_ANDINFO)==0 ); |
| 150815 | + whereOrInfoDelete(db, a->u.pOrInfo); |
| 150816 | + }else{ |
| 150817 | + assert( (a->wtFlags & TERM_ANDINFO)!=0 ); |
| 150818 | + whereAndInfoDelete(db, a->u.pAndInfo); |
| 150819 | + } |
| 150820 | + } |
| 150821 | + if( a==aLast ) break; |
| 150822 | + a++; |
| 150480 | 150823 | } |
| 150481 | 150824 | } |
| 150482 | 150825 | if( pWC->a!=pWC->aStatic ){ |
| 150483 | 150826 | sqlite3DbFree(db, pWC->a); |
| 150484 | 150827 | } |
| | @@ -150487,19 +150830,42 @@ |
| 150487 | 150830 | |
| 150488 | 150831 | /* |
| 150489 | 150832 | ** These routines walk (recursively) an expression tree and generate |
| 150490 | 150833 | ** a bitmask indicating which tables are used in that expression |
| 150491 | 150834 | ** tree. |
| 150835 | +** |
| 150836 | +** sqlite3WhereExprUsage(MaskSet, Expr) -> |
| 150837 | +** |
| 150838 | +** Return a Bitmask of all tables referenced by Expr. Expr can be |
| 150839 | +** be NULL, in which case 0 is returned. |
| 150840 | +** |
| 150841 | +** sqlite3WhereExprUsageNN(MaskSet, Expr) -> |
| 150842 | +** |
| 150843 | +** Same as sqlite3WhereExprUsage() except that Expr must not be |
| 150844 | +** NULL. The "NN" suffix on the name stands for "Not Null". |
| 150845 | +** |
| 150846 | +** sqlite3WhereExprListUsage(MaskSet, ExprList) -> |
| 150847 | +** |
| 150848 | +** Return a Bitmask of all tables referenced by every expression |
| 150849 | +** in the expression list ExprList. ExprList can be NULL, in which |
| 150850 | +** case 0 is returned. |
| 150851 | +** |
| 150852 | +** sqlite3WhereExprUsageFull(MaskSet, ExprList) -> |
| 150853 | +** |
| 150854 | +** Internal use only. Called only by sqlite3WhereExprUsageNN() for |
| 150855 | +** complex expressions that require pushing register values onto |
| 150856 | +** the stack. Many calls to sqlite3WhereExprUsageNN() do not need |
| 150857 | +** the more complex analysis done by this routine. Hence, the |
| 150858 | +** computations done by this routine are broken out into a separate |
| 150859 | +** "no-inline" function to avoid the stack push overhead in the |
| 150860 | +** common case where it is not needed. |
| 150492 | 150861 | */ |
| 150493 | | -SQLITE_PRIVATE Bitmask sqlite3WhereExprUsageNN(WhereMaskSet *pMaskSet, Expr *p){ |
| 150862 | +static SQLITE_NOINLINE Bitmask sqlite3WhereExprUsageFull( |
| 150863 | + WhereMaskSet *pMaskSet, |
| 150864 | + Expr *p |
| 150865 | +){ |
| 150494 | 150866 | Bitmask mask; |
| 150495 | | - if( p->op==TK_COLUMN && !ExprHasProperty(p, EP_FixedCol) ){ |
| 150496 | | - return sqlite3WhereGetMask(pMaskSet, p->iTable); |
| 150497 | | - }else if( ExprHasProperty(p, EP_TokenOnly|EP_Leaf) ){ |
| 150498 | | - assert( p->op!=TK_IF_NULL_ROW ); |
| 150499 | | - return 0; |
| 150500 | | - } |
| 150501 | 150867 | mask = (p->op==TK_IF_NULL_ROW) ? sqlite3WhereGetMask(pMaskSet, p->iTable) : 0; |
| 150502 | 150868 | if( p->pLeft ) mask |= sqlite3WhereExprUsageNN(pMaskSet, p->pLeft); |
| 150503 | 150869 | if( p->pRight ){ |
| 150504 | 150870 | mask |= sqlite3WhereExprUsageNN(pMaskSet, p->pRight); |
| 150505 | 150871 | assert( p->x.pList==0 ); |
| | @@ -150516,10 +150882,19 @@ |
| 150516 | 150882 | mask |= sqlite3WhereExprListUsage(pMaskSet, p->y.pWin->pOrderBy); |
| 150517 | 150883 | mask |= sqlite3WhereExprUsage(pMaskSet, p->y.pWin->pFilter); |
| 150518 | 150884 | } |
| 150519 | 150885 | #endif |
| 150520 | 150886 | return mask; |
| 150887 | +} |
| 150888 | +SQLITE_PRIVATE Bitmask sqlite3WhereExprUsageNN(WhereMaskSet *pMaskSet, Expr *p){ |
| 150889 | + if( p->op==TK_COLUMN && !ExprHasProperty(p, EP_FixedCol) ){ |
| 150890 | + return sqlite3WhereGetMask(pMaskSet, p->iTable); |
| 150891 | + }else if( ExprHasProperty(p, EP_TokenOnly|EP_Leaf) ){ |
| 150892 | + assert( p->op!=TK_IF_NULL_ROW ); |
| 150893 | + return 0; |
| 150894 | + } |
| 150895 | + return sqlite3WhereExprUsageFull(pMaskSet, p); |
| 150521 | 150896 | } |
| 150522 | 150897 | SQLITE_PRIVATE Bitmask sqlite3WhereExprUsage(WhereMaskSet *pMaskSet, Expr *p){ |
| 150523 | 150898 | return p ? sqlite3WhereExprUsageNN(pMaskSet,p) : 0; |
| 150524 | 150899 | } |
| 150525 | 150900 | SQLITE_PRIVATE Bitmask sqlite3WhereExprListUsage(WhereMaskSet *pMaskSet, ExprList *pList){ |
| | @@ -150834,11 +151209,16 @@ |
| 150834 | 151209 | ** iCursor is not in the set. |
| 150835 | 151210 | */ |
| 150836 | 151211 | SQLITE_PRIVATE Bitmask sqlite3WhereGetMask(WhereMaskSet *pMaskSet, int iCursor){ |
| 150837 | 151212 | int i; |
| 150838 | 151213 | assert( pMaskSet->n<=(int)sizeof(Bitmask)*8 ); |
| 150839 | | - for(i=0; i<pMaskSet->n; i++){ |
| 151214 | + assert( pMaskSet->n>0 || pMaskSet->ix[0]<0 ); |
| 151215 | + assert( iCursor>=-1 ); |
| 151216 | + if( pMaskSet->ix[0]==iCursor ){ |
| 151217 | + return 1; |
| 151218 | + } |
| 151219 | + for(i=1; i<pMaskSet->n; i++){ |
| 150840 | 151220 | if( pMaskSet->ix[i]==iCursor ){ |
| 150841 | 151221 | return MASKBIT(i); |
| 150842 | 151222 | } |
| 150843 | 151223 | } |
| 150844 | 151224 | return 0; |
| | @@ -151019,20 +151399,20 @@ |
| 151019 | 151399 | pScan->nEquiv = 1; |
| 151020 | 151400 | pScan->iEquiv = 1; |
| 151021 | 151401 | if( pIdx ){ |
| 151022 | 151402 | int j = iColumn; |
| 151023 | 151403 | iColumn = pIdx->aiColumn[j]; |
| 151024 | | - if( iColumn==XN_EXPR ){ |
| 151404 | + if( iColumn==pIdx->pTable->iPKey ){ |
| 151405 | + iColumn = XN_ROWID; |
| 151406 | + }else if( iColumn>=0 ){ |
| 151407 | + pScan->idxaff = pIdx->pTable->aCol[iColumn].affinity; |
| 151408 | + pScan->zCollName = pIdx->azColl[j]; |
| 151409 | + }else if( iColumn==XN_EXPR ){ |
| 151025 | 151410 | pScan->pIdxExpr = pIdx->aColExpr->a[j].pExpr; |
| 151026 | 151411 | pScan->zCollName = pIdx->azColl[j]; |
| 151027 | 151412 | pScan->aiColumn[0] = XN_EXPR; |
| 151028 | 151413 | return whereScanInitIndexExpr(pScan); |
| 151029 | | - }else if( iColumn==pIdx->pTable->iPKey ){ |
| 151030 | | - iColumn = XN_ROWID; |
| 151031 | | - }else if( iColumn>=0 ){ |
| 151032 | | - pScan->idxaff = pIdx->pTable->aCol[iColumn].affinity; |
| 151033 | | - pScan->zCollName = pIdx->azColl[j]; |
| 151034 | 151414 | } |
| 151035 | 151415 | }else if( iColumn==XN_EXPR ){ |
| 151036 | 151416 | return 0; |
| 151037 | 151417 | } |
| 151038 | 151418 | pScan->aiColumn[0] = iColumn; |
| | @@ -151312,13 +151692,13 @@ |
| 151312 | 151692 | ** Return TRUE if the WHERE clause term pTerm is of a form where it |
| 151313 | 151693 | ** could be used with an index to access pSrc, assuming an appropriate |
| 151314 | 151694 | ** index existed. |
| 151315 | 151695 | */ |
| 151316 | 151696 | static int termCanDriveIndex( |
| 151317 | | - WhereTerm *pTerm, /* WHERE clause term to check */ |
| 151318 | | - SrcItem *pSrc, /* Table we are trying to access */ |
| 151319 | | - Bitmask notReady /* Tables in outer loops of the join */ |
| 151697 | + const WhereTerm *pTerm, /* WHERE clause term to check */ |
| 151698 | + const SrcItem *pSrc, /* Table we are trying to access */ |
| 151699 | + const Bitmask notReady /* Tables in outer loops of the join */ |
| 151320 | 151700 | ){ |
| 151321 | 151701 | char aff; |
| 151322 | 151702 | if( pTerm->leftCursor!=pSrc->iCursor ) return 0; |
| 151323 | 151703 | if( (pTerm->eOperator & (WO_EQ|WO_IS))==0 ) return 0; |
| 151324 | 151704 | if( (pSrc->fg.jointype & JT_LEFT) |
| | @@ -151345,15 +151725,15 @@ |
| 151345 | 151725 | /* |
| 151346 | 151726 | ** Generate code to construct the Index object for an automatic index |
| 151347 | 151727 | ** and to set up the WhereLevel object pLevel so that the code generator |
| 151348 | 151728 | ** makes use of the automatic index. |
| 151349 | 151729 | */ |
| 151350 | | -static void constructAutomaticIndex( |
| 151730 | +static SQLITE_NOINLINE void constructAutomaticIndex( |
| 151351 | 151731 | Parse *pParse, /* The parsing context */ |
| 151352 | | - WhereClause *pWC, /* The WHERE clause */ |
| 151353 | | - SrcItem *pSrc, /* The FROM clause term to get the next index */ |
| 151354 | | - Bitmask notReady, /* Mask of cursors that are not available */ |
| 151732 | + const WhereClause *pWC, /* The WHERE clause */ |
| 151733 | + const SrcItem *pSrc, /* The FROM clause term to get the next index */ |
| 151734 | + const Bitmask notReady, /* Mask of cursors that are not available */ |
| 151355 | 151735 | WhereLevel *pLevel /* Write new index here */ |
| 151356 | 151736 | ){ |
| 151357 | 151737 | int nKeyCol; /* Number of columns in the constructed index */ |
| 151358 | 151738 | WhereTerm *pTerm; /* A single term of the WHERE clause */ |
| 151359 | 151739 | WhereTerm *pWCEnd; /* End of pWC->a[] */ |
| | @@ -151391,17 +151771,17 @@ |
| 151391 | 151771 | pWCEnd = &pWC->a[pWC->nTerm]; |
| 151392 | 151772 | pLoop = pLevel->pWLoop; |
| 151393 | 151773 | idxCols = 0; |
| 151394 | 151774 | for(pTerm=pWC->a; pTerm<pWCEnd; pTerm++){ |
| 151395 | 151775 | Expr *pExpr = pTerm->pExpr; |
| 151396 | | - assert( !ExprHasProperty(pExpr, EP_FromJoin) /* prereq always non-zero */ |
| 151397 | | - || pExpr->iRightJoinTable!=pSrc->iCursor /* for the right-hand */ |
| 151398 | | - || pLoop->prereq!=0 ); /* table of a LEFT JOIN */ |
| 151399 | | - if( pLoop->prereq==0 |
| 151400 | | - && (pTerm->wtFlags & TERM_VIRTUAL)==0 |
| 151401 | | - && !ExprHasProperty(pExpr, EP_FromJoin) |
| 151402 | | - && sqlite3ExprIsTableConstant(pExpr, pSrc->iCursor) ){ |
| 151776 | + /* Make the automatic index a partial index if there are terms in the |
| 151777 | + ** WHERE clause (or the ON clause of a LEFT join) that constrain which |
| 151778 | + ** rows of the target table (pSrc) that can be used. */ |
| 151779 | + if( (pTerm->wtFlags & TERM_VIRTUAL)==0 |
| 151780 | + && ((pSrc->fg.jointype&JT_LEFT)==0 || ExprHasProperty(pExpr,EP_FromJoin)) |
| 151781 | + && sqlite3ExprIsTableConstant(pExpr, pSrc->iCursor) |
| 151782 | + ){ |
| 151403 | 151783 | pPartial = sqlite3ExprAnd(pParse, pPartial, |
| 151404 | 151784 | sqlite3ExprDup(pParse->db, pExpr, 0)); |
| 151405 | 151785 | } |
| 151406 | 151786 | if( termCanDriveIndex(pTerm, pSrc, notReady) ){ |
| 151407 | 151787 | int iCol; |
| | @@ -151504,10 +151884,14 @@ |
| 151504 | 151884 | assert( pLevel->iIdxCur>=0 ); |
| 151505 | 151885 | pLevel->iIdxCur = pParse->nTab++; |
| 151506 | 151886 | sqlite3VdbeAddOp2(v, OP_OpenAutoindex, pLevel->iIdxCur, nKeyCol+1); |
| 151507 | 151887 | sqlite3VdbeSetP4KeyInfo(pParse, pIdx); |
| 151508 | 151888 | VdbeComment((v, "for %s", pTable->zName)); |
| 151889 | + if( OptimizationEnabled(pParse->db, SQLITE_BloomFilter) ){ |
| 151890 | + pLevel->regFilter = ++pParse->nMem; |
| 151891 | + sqlite3VdbeAddOp2(v, OP_Blob, 10000, pLevel->regFilter); |
| 151892 | + } |
| 151509 | 151893 | |
| 151510 | 151894 | /* Fill the automatic index with content */ |
| 151511 | 151895 | pTabItem = &pWC->pWInfo->pTabList->a[pLevel->iFrom]; |
| 151512 | 151896 | if( pTabItem->fg.viaCoroutine ){ |
| 151513 | 151897 | int regYield = pTabItem->regReturn; |
| | @@ -151526,10 +151910,14 @@ |
| 151526 | 151910 | } |
| 151527 | 151911 | regRecord = sqlite3GetTempReg(pParse); |
| 151528 | 151912 | regBase = sqlite3GenerateIndexKey( |
| 151529 | 151913 | pParse, pIdx, pLevel->iTabCur, regRecord, 0, 0, 0, 0 |
| 151530 | 151914 | ); |
| 151915 | + if( pLevel->regFilter ){ |
| 151916 | + sqlite3VdbeAddOp4Int(v, OP_FilterAdd, pLevel->regFilter, 0, |
| 151917 | + regBase, pLoop->u.btree.nEq); |
| 151918 | + } |
| 151531 | 151919 | sqlite3VdbeAddOp2(v, OP_IdxInsert, pLevel->iIdxCur, regRecord); |
| 151532 | 151920 | sqlite3VdbeChangeP5(v, OPFLAG_USESEEKRESULT); |
| 151533 | 151921 | if( pPartial ) sqlite3VdbeResolveLabel(v, iContinue); |
| 151534 | 151922 | if( pTabItem->fg.viaCoroutine ){ |
| 151535 | 151923 | sqlite3VdbeChangeP2(v, addrCounter, regBase+n); |
| | @@ -151551,10 +151939,127 @@ |
| 151551 | 151939 | |
| 151552 | 151940 | end_auto_index_create: |
| 151553 | 151941 | sqlite3ExprDelete(pParse->db, pPartial); |
| 151554 | 151942 | } |
| 151555 | 151943 | #endif /* SQLITE_OMIT_AUTOMATIC_INDEX */ |
| 151944 | + |
| 151945 | +/* |
| 151946 | +** Generate bytecode that will initialize a Bloom filter that is appropriate |
| 151947 | +** for pLevel. |
| 151948 | +** |
| 151949 | +** If there are inner loops within pLevel that have the WHERE_BLOOMFILTER |
| 151950 | +** flag set, initialize a Bloomfilter for them as well. Except don't do |
| 151951 | +** this recursive initialization if the SQLITE_BloomPulldown optimization has |
| 151952 | +** been turned off. |
| 151953 | +** |
| 151954 | +** When the Bloom filter is initialized, the WHERE_BLOOMFILTER flag is cleared |
| 151955 | +** from the loop, but the regFilter value is set to a register that implements |
| 151956 | +** the Bloom filter. When regFilter is positive, the |
| 151957 | +** sqlite3WhereCodeOneLoopStart() will generate code to test the Bloom filter |
| 151958 | +** and skip the subsequence B-Tree seek if the Bloom filter indicates that |
| 151959 | +** no matching rows exist. |
| 151960 | +** |
| 151961 | +** This routine may only be called if it has previously been determined that |
| 151962 | +** the loop would benefit from a Bloom filter, and the WHERE_BLOOMFILTER bit |
| 151963 | +** is set. |
| 151964 | +*/ |
| 151965 | +static SQLITE_NOINLINE void constructBloomFilter( |
| 151966 | + WhereInfo *pWInfo, /* The WHERE clause */ |
| 151967 | + int iLevel, /* Index in pWInfo->a[] that is pLevel */ |
| 151968 | + WhereLevel *pLevel, /* Make a Bloom filter for this FROM term */ |
| 151969 | + Bitmask notReady /* Loops that are not ready */ |
| 151970 | +){ |
| 151971 | + int addrOnce; /* Address of opening OP_Once */ |
| 151972 | + int addrTop; /* Address of OP_Rewind */ |
| 151973 | + int addrCont; /* Jump here to skip a row */ |
| 151974 | + const WhereTerm *pTerm; /* For looping over WHERE clause terms */ |
| 151975 | + const WhereTerm *pWCEnd; /* Last WHERE clause term */ |
| 151976 | + Parse *pParse = pWInfo->pParse; /* Parsing context */ |
| 151977 | + Vdbe *v = pParse->pVdbe; /* VDBE under construction */ |
| 151978 | + WhereLoop *pLoop = pLevel->pWLoop; /* The loop being coded */ |
| 151979 | + int iCur; /* Cursor for table getting the filter */ |
| 151980 | + |
| 151981 | + assert( pLoop!=0 ); |
| 151982 | + assert( v!=0 ); |
| 151983 | + assert( pLoop->wsFlags & WHERE_BLOOMFILTER ); |
| 151984 | + |
| 151985 | + addrOnce = sqlite3VdbeAddOp0(v, OP_Once); VdbeCoverage(v); |
| 151986 | + do{ |
| 151987 | + const SrcItem *pItem; |
| 151988 | + const Table *pTab; |
| 151989 | + u64 sz; |
| 151990 | + sqlite3WhereExplainBloomFilter(pParse, pWInfo, pLevel); |
| 151991 | + addrCont = sqlite3VdbeMakeLabel(pParse); |
| 151992 | + iCur = pLevel->iTabCur; |
| 151993 | + pLevel->regFilter = ++pParse->nMem; |
| 151994 | + |
| 151995 | + /* The Bloom filter is a Blob held in a register. Initialize it |
| 151996 | + ** to zero-filled blob of at least 80K bits, but maybe more if the |
| 151997 | + ** estimated size of the table is larger. We could actually |
| 151998 | + ** measure the size of the table at run-time using OP_Count with |
| 151999 | + ** P3==1 and use that value to initialize the blob. But that makes |
| 152000 | + ** testing complicated. By basing the blob size on the value in the |
| 152001 | + ** sqlite_stat1 table, testing is much easier. |
| 152002 | + */ |
| 152003 | + pItem = &pWInfo->pTabList->a[pLevel->iFrom]; |
| 152004 | + assert( pItem!=0 ); |
| 152005 | + pTab = pItem->pTab; |
| 152006 | + assert( pTab!=0 ); |
| 152007 | + sz = sqlite3LogEstToInt(pTab->nRowLogEst); |
| 152008 | + if( sz<10000 ){ |
| 152009 | + sz = 10000; |
| 152010 | + }else if( sz>10000000 ){ |
| 152011 | + sz = 10000000; |
| 152012 | + } |
| 152013 | + sqlite3VdbeAddOp2(v, OP_Blob, (int)sz, pLevel->regFilter); |
| 152014 | + |
| 152015 | + addrTop = sqlite3VdbeAddOp1(v, OP_Rewind, iCur); VdbeCoverage(v); |
| 152016 | + pWCEnd = &pWInfo->sWC.a[pWInfo->sWC.nTerm]; |
| 152017 | + for(pTerm=pWInfo->sWC.a; pTerm<pWCEnd; pTerm++){ |
| 152018 | + Expr *pExpr = pTerm->pExpr; |
| 152019 | + if( (pTerm->wtFlags & TERM_VIRTUAL)==0 |
| 152020 | + && sqlite3ExprIsTableConstant(pExpr, iCur) |
| 152021 | + ){ |
| 152022 | + sqlite3ExprIfFalse(pParse, pTerm->pExpr, addrCont, SQLITE_JUMPIFNULL); |
| 152023 | + } |
| 152024 | + } |
| 152025 | + if( pLoop->wsFlags & WHERE_IPK ){ |
| 152026 | + int r1 = sqlite3GetTempReg(pParse); |
| 152027 | + sqlite3VdbeAddOp2(v, OP_Rowid, iCur, r1); |
| 152028 | + sqlite3VdbeAddOp4Int(v, OP_FilterAdd, pLevel->regFilter, 0, r1, 1); |
| 152029 | + sqlite3ReleaseTempReg(pParse, r1); |
| 152030 | + }else{ |
| 152031 | + Index *pIdx = pLoop->u.btree.pIndex; |
| 152032 | + int n = pLoop->u.btree.nEq; |
| 152033 | + int r1 = sqlite3GetTempRange(pParse, n); |
| 152034 | + int jj; |
| 152035 | + for(jj=0; jj<n; jj++){ |
| 152036 | + int iCol = pIdx->aiColumn[jj]; |
| 152037 | + assert( pIdx->pTable==pItem->pTab ); |
| 152038 | + sqlite3ExprCodeGetColumnOfTable(v, pIdx->pTable, iCur, iCol,r1+jj); |
| 152039 | + } |
| 152040 | + sqlite3VdbeAddOp4Int(v, OP_FilterAdd, pLevel->regFilter, 0, r1, n); |
| 152041 | + sqlite3ReleaseTempRange(pParse, r1, n); |
| 152042 | + } |
| 152043 | + sqlite3VdbeResolveLabel(v, addrCont); |
| 152044 | + sqlite3VdbeAddOp2(v, OP_Next, pLevel->iTabCur, addrTop+1); |
| 152045 | + VdbeCoverage(v); |
| 152046 | + sqlite3VdbeJumpHere(v, addrTop); |
| 152047 | + pLoop->wsFlags &= ~WHERE_BLOOMFILTER; |
| 152048 | + if( OptimizationDisabled(pParse->db, SQLITE_BloomPulldown) ) break; |
| 152049 | + while( iLevel < pWInfo->nLevel ){ |
| 152050 | + iLevel++; |
| 152051 | + pLevel = &pWInfo->a[iLevel]; |
| 152052 | + pLoop = pLevel->pWLoop; |
| 152053 | + if( pLoop==0 ) continue; |
| 152054 | + if( pLoop->prereq & notReady ) continue; |
| 152055 | + if( pLoop->wsFlags & WHERE_BLOOMFILTER ) break; |
| 152056 | + } |
| 152057 | + }while( iLevel < pWInfo->nLevel ); |
| 152058 | + sqlite3VdbeJumpHere(v, addrOnce); |
| 152059 | +} |
| 152060 | + |
| 151556 | 152061 | |
| 151557 | 152062 | #ifndef SQLITE_OMIT_VIRTUALTABLE |
| 151558 | 152063 | /* |
| 151559 | 152064 | ** Allocate and populate an sqlite3_index_info structure. It is the |
| 151560 | 152065 | ** responsibility of the caller to eventually release the structure |
| | @@ -152494,13 +152999,13 @@ |
| 152494 | 152999 | } |
| 152495 | 153000 | sqlite3DebugPrintf(" %-19s", z); |
| 152496 | 153001 | sqlite3_free(z); |
| 152497 | 153002 | } |
| 152498 | 153003 | if( p->wsFlags & WHERE_SKIPSCAN ){ |
| 152499 | | - sqlite3DebugPrintf(" f %05x %d-%d", p->wsFlags, p->nLTerm,p->nSkip); |
| 153004 | + sqlite3DebugPrintf(" f %06x %d-%d", p->wsFlags, p->nLTerm,p->nSkip); |
| 152500 | 153005 | }else{ |
| 152501 | | - sqlite3DebugPrintf(" f %05x N %d", p->wsFlags, p->nLTerm); |
| 153006 | + sqlite3DebugPrintf(" f %06x N %d", p->wsFlags, p->nLTerm); |
| 152502 | 153007 | } |
| 152503 | 153008 | sqlite3DebugPrintf(" cost %d,%d,%d\n", p->rSetup, p->rRun, p->nOut); |
| 152504 | 153009 | if( p->nLTerm && (sqlite3WhereTrace & 0x100)!=0 ){ |
| 152505 | 153010 | int i; |
| 152506 | 153011 | for(i=0; i<p->nLTerm; i++){ |
| | @@ -152956,22 +153461,29 @@ |
| 152956 | 153461 | Bitmask notAllowed = ~(pLoop->prereq|pLoop->maskSelf); |
| 152957 | 153462 | int i, j; |
| 152958 | 153463 | LogEst iReduce = 0; /* pLoop->nOut should not exceed nRow-iReduce */ |
| 152959 | 153464 | |
| 152960 | 153465 | assert( (pLoop->wsFlags & WHERE_AUTO_INDEX)==0 ); |
| 152961 | | - for(i=pWC->nTerm, pTerm=pWC->a; i>0; i--, pTerm++){ |
| 153466 | + for(i=pWC->nBase, pTerm=pWC->a; i>0; i--, pTerm++){ |
| 152962 | 153467 | assert( pTerm!=0 ); |
| 152963 | | - if( (pTerm->wtFlags & TERM_VIRTUAL)!=0 ) break; |
| 153468 | + if( (pTerm->prereqAll & notAllowed)!=0 ) continue; |
| 152964 | 153469 | if( (pTerm->prereqAll & pLoop->maskSelf)==0 ) continue; |
| 152965 | | - if( (pTerm->prereqAll & notAllowed)!=0 ) continue; |
| 153470 | + if( (pTerm->wtFlags & TERM_VIRTUAL)!=0 ) continue; |
| 152966 | 153471 | for(j=pLoop->nLTerm-1; j>=0; j--){ |
| 152967 | 153472 | pX = pLoop->aLTerm[j]; |
| 152968 | 153473 | if( pX==0 ) continue; |
| 152969 | 153474 | if( pX==pTerm ) break; |
| 152970 | 153475 | if( pX->iParent>=0 && (&pWC->a[pX->iParent])==pTerm ) break; |
| 152971 | 153476 | } |
| 152972 | 153477 | if( j<0 ){ |
| 153478 | + if( pLoop->maskSelf==pTerm->prereqAll ){ |
| 153479 | + /* If there are extra terms in the WHERE clause not used by an index |
| 153480 | + ** that depend only on the table being scanned, and that will tend to |
| 153481 | + ** cause many rows to be omitted, then mark that table as |
| 153482 | + ** "self-culling". */ |
| 153483 | + pLoop->wsFlags |= WHERE_SELFCULL; |
| 153484 | + } |
| 152973 | 153485 | if( pTerm->truthProb<=0 ){ |
| 152974 | 153486 | /* If a truth probability is specified using the likelihood() hints, |
| 152975 | 153487 | ** then use the probability provided by the application. */ |
| 152976 | 153488 | pLoop->nOut += pTerm->truthProb; |
| 152977 | 153489 | }else{ |
| | @@ -152995,11 +153507,13 @@ |
| 152995 | 153507 | } |
| 152996 | 153508 | } |
| 152997 | 153509 | } |
| 152998 | 153510 | } |
| 152999 | 153511 | } |
| 153000 | | - if( pLoop->nOut > nRow-iReduce ) pLoop->nOut = nRow - iReduce; |
| 153512 | + if( pLoop->nOut > nRow-iReduce ){ |
| 153513 | + pLoop->nOut = nRow - iReduce; |
| 153514 | + } |
| 153001 | 153515 | } |
| 153002 | 153516 | |
| 153003 | 153517 | /* |
| 153004 | 153518 | ** Term pTerm is a vector range comparison operation. The first comparison |
| 153005 | 153519 | ** in the vector can be optimized using column nEq of the index. This |
| | @@ -154231,10 +154745,11 @@ |
| 154231 | 154745 | }else if( pOrTerm->leftCursor==iCur ){ |
| 154232 | 154746 | tempWC.pWInfo = pWC->pWInfo; |
| 154233 | 154747 | tempWC.pOuter = pWC; |
| 154234 | 154748 | tempWC.op = TK_AND; |
| 154235 | 154749 | tempWC.nTerm = 1; |
| 154750 | + tempWC.nBase = 1; |
| 154236 | 154751 | tempWC.a = pOrTerm; |
| 154237 | 154752 | sSubBuild.pWC = &tempWC; |
| 154238 | 154753 | }else{ |
| 154239 | 154754 | continue; |
| 154240 | 154755 | } |
| | @@ -155337,10 +155852,154 @@ |
| 155337 | 155852 | } |
| 155338 | 155853 | # define WHERETRACE_ALL_LOOPS(W,C) showAllWhereLoops(W,C) |
| 155339 | 155854 | #else |
| 155340 | 155855 | # define WHERETRACE_ALL_LOOPS(W,C) |
| 155341 | 155856 | #endif |
| 155857 | + |
| 155858 | +/* Attempt to omit tables from a join that do not affect the result. |
| 155859 | +** For a table to not affect the result, the following must be true: |
| 155860 | +** |
| 155861 | +** 1) The query must not be an aggregate. |
| 155862 | +** 2) The table must be the RHS of a LEFT JOIN. |
| 155863 | +** 3) Either the query must be DISTINCT, or else the ON or USING clause |
| 155864 | +** must contain a constraint that limits the scan of the table to |
| 155865 | +** at most a single row. |
| 155866 | +** 4) The table must not be referenced by any part of the query apart |
| 155867 | +** from its own USING or ON clause. |
| 155868 | +** |
| 155869 | +** For example, given: |
| 155870 | +** |
| 155871 | +** CREATE TABLE t1(ipk INTEGER PRIMARY KEY, v1); |
| 155872 | +** CREATE TABLE t2(ipk INTEGER PRIMARY KEY, v2); |
| 155873 | +** CREATE TABLE t3(ipk INTEGER PRIMARY KEY, v3); |
| 155874 | +** |
| 155875 | +** then table t2 can be omitted from the following: |
| 155876 | +** |
| 155877 | +** SELECT v1, v3 FROM t1 |
| 155878 | +** LEFT JOIN t2 ON (t1.ipk=t2.ipk) |
| 155879 | +** LEFT JOIN t3 ON (t1.ipk=t3.ipk) |
| 155880 | +** |
| 155881 | +** or from: |
| 155882 | +** |
| 155883 | +** SELECT DISTINCT v1, v3 FROM t1 |
| 155884 | +** LEFT JOIN t2 |
| 155885 | +** LEFT JOIN t3 ON (t1.ipk=t3.ipk) |
| 155886 | +*/ |
| 155887 | +static SQLITE_NOINLINE Bitmask whereOmitNoopJoin( |
| 155888 | + WhereInfo *pWInfo, |
| 155889 | + Bitmask notReady |
| 155890 | +){ |
| 155891 | + int i; |
| 155892 | + Bitmask tabUsed; |
| 155893 | + |
| 155894 | + /* Preconditions checked by the caller */ |
| 155895 | + assert( pWInfo->nLevel>=2 ); |
| 155896 | + assert( OptimizationEnabled(pWInfo->pParse->db, SQLITE_OmitNoopJoin) ); |
| 155897 | + |
| 155898 | + /* These two preconditions checked by the caller combine to guarantee |
| 155899 | + ** condition (1) of the header comment */ |
| 155900 | + assert( pWInfo->pResultSet!=0 ); |
| 155901 | + assert( 0==(pWInfo->wctrlFlags & WHERE_AGG_DISTINCT) ); |
| 155902 | + |
| 155903 | + tabUsed = sqlite3WhereExprListUsage(&pWInfo->sMaskSet, pWInfo->pResultSet); |
| 155904 | + if( pWInfo->pOrderBy ){ |
| 155905 | + tabUsed |= sqlite3WhereExprListUsage(&pWInfo->sMaskSet, pWInfo->pOrderBy); |
| 155906 | + } |
| 155907 | + for(i=pWInfo->nLevel-1; i>=1; i--){ |
| 155908 | + WhereTerm *pTerm, *pEnd; |
| 155909 | + SrcItem *pItem; |
| 155910 | + WhereLoop *pLoop; |
| 155911 | + pLoop = pWInfo->a[i].pWLoop; |
| 155912 | + pItem = &pWInfo->pTabList->a[pLoop->iTab]; |
| 155913 | + if( (pItem->fg.jointype & JT_LEFT)==0 ) continue; |
| 155914 | + if( (pWInfo->wctrlFlags & WHERE_WANT_DISTINCT)==0 |
| 155915 | + && (pLoop->wsFlags & WHERE_ONEROW)==0 |
| 155916 | + ){ |
| 155917 | + continue; |
| 155918 | + } |
| 155919 | + if( (tabUsed & pLoop->maskSelf)!=0 ) continue; |
| 155920 | + pEnd = pWInfo->sWC.a + pWInfo->sWC.nTerm; |
| 155921 | + for(pTerm=pWInfo->sWC.a; pTerm<pEnd; pTerm++){ |
| 155922 | + if( (pTerm->prereqAll & pLoop->maskSelf)!=0 ){ |
| 155923 | + if( !ExprHasProperty(pTerm->pExpr, EP_FromJoin) |
| 155924 | + || pTerm->pExpr->iRightJoinTable!=pItem->iCursor |
| 155925 | + ){ |
| 155926 | + break; |
| 155927 | + } |
| 155928 | + } |
| 155929 | + } |
| 155930 | + if( pTerm<pEnd ) continue; |
| 155931 | + WHERETRACE(0xffff, ("-> drop loop %c not used\n", pLoop->cId)); |
| 155932 | + notReady &= ~pLoop->maskSelf; |
| 155933 | + for(pTerm=pWInfo->sWC.a; pTerm<pEnd; pTerm++){ |
| 155934 | + if( (pTerm->prereqAll & pLoop->maskSelf)!=0 ){ |
| 155935 | + pTerm->wtFlags |= TERM_CODED; |
| 155936 | + } |
| 155937 | + } |
| 155938 | + if( i!=pWInfo->nLevel-1 ){ |
| 155939 | + int nByte = (pWInfo->nLevel-1-i) * sizeof(WhereLevel); |
| 155940 | + memmove(&pWInfo->a[i], &pWInfo->a[i+1], nByte); |
| 155941 | + } |
| 155942 | + pWInfo->nLevel--; |
| 155943 | + assert( pWInfo->nLevel>0 ); |
| 155944 | + } |
| 155945 | + return notReady; |
| 155946 | +} |
| 155947 | + |
| 155948 | +/* |
| 155949 | +** Check to see if there are any SEARCH loops that might benefit from |
| 155950 | +** using a Bloom filter. Consider a Bloom filter if: |
| 155951 | +** |
| 155952 | +** (1) The SEARCH happens more than N times where N is the number |
| 155953 | +** of rows in the table that is being considered for the Bloom |
| 155954 | +** filter. |
| 155955 | +** (2) Some searches are expected to find zero rows. (This is determined |
| 155956 | +** by the WHERE_SELFCULL flag on the term.) |
| 155957 | +** (3) Bloom-filter processing is not disabled. (Checked by the |
| 155958 | +** caller.) |
| 155959 | +** (4) The size of the table being searched is known by ANALYZE. |
| 155960 | +** |
| 155961 | +** This block of code merely checks to see if a Bloom filter would be |
| 155962 | +** appropriate, and if so sets the WHERE_BLOOMFILTER flag on the |
| 155963 | +** WhereLoop. The implementation of the Bloom filter comes further |
| 155964 | +** down where the code for each WhereLoop is generated. |
| 155965 | +*/ |
| 155966 | +static SQLITE_NOINLINE void whereCheckIfBloomFilterIsUseful( |
| 155967 | + const WhereInfo *pWInfo |
| 155968 | +){ |
| 155969 | + int i; |
| 155970 | + LogEst nSearch; |
| 155971 | + |
| 155972 | + assert( pWInfo->nLevel>=2 ); |
| 155973 | + assert( OptimizationEnabled(pWInfo->pParse->db, SQLITE_BloomFilter) ); |
| 155974 | + nSearch = pWInfo->a[0].pWLoop->nOut; |
| 155975 | + for(i=1; i<pWInfo->nLevel; i++){ |
| 155976 | + WhereLoop *pLoop = pWInfo->a[i].pWLoop; |
| 155977 | + const int reqFlags = (WHERE_SELFCULL|WHERE_COLUMN_EQ); |
| 155978 | + if( (pLoop->wsFlags & reqFlags)==reqFlags |
| 155979 | + /* vvvvvv--- Always the case if WHERE_COLUMN_EQ is defined */ |
| 155980 | + && ALWAYS((pLoop->wsFlags & (WHERE_IPK|WHERE_INDEXED))!=0) |
| 155981 | + ){ |
| 155982 | + SrcItem *pItem = &pWInfo->pTabList->a[pLoop->iTab]; |
| 155983 | + Table *pTab = pItem->pTab; |
| 155984 | + pTab->tabFlags |= TF_StatsUsed; |
| 155985 | + if( nSearch > pTab->nRowLogEst |
| 155986 | + && (pTab->tabFlags & TF_HasStat1)!=0 |
| 155987 | + ){ |
| 155988 | + testcase( pItem->fg.jointype & JT_LEFT ); |
| 155989 | + pLoop->wsFlags |= WHERE_BLOOMFILTER; |
| 155990 | + pLoop->wsFlags &= ~WHERE_IDX_ONLY; |
| 155991 | + WHERETRACE(0xffff, ( |
| 155992 | + "-> use Bloom-filter on loop %c because there are ~%.1e " |
| 155993 | + "lookups into %s which has only ~%.1e rows\n", |
| 155994 | + pLoop->cId, (double)sqlite3LogEstToInt(nSearch), pTab->zName, |
| 155995 | + (double)sqlite3LogEstToInt(pTab->nRowLogEst))); |
| 155996 | + } |
| 155997 | + } |
| 155998 | + nSearch += pLoop->nOut; |
| 155999 | + } |
| 156000 | +} |
| 155342 | 156001 | |
| 155343 | 156002 | /* |
| 155344 | 156003 | ** Generate the beginning of the loop used for WHERE clause processing. |
| 155345 | 156004 | ** The return value is a pointer to an opaque structure that contains |
| 155346 | 156005 | ** information needed to terminate the loop. Later, the calling routine |
| | @@ -155468,16 +156127,10 @@ |
| 155468 | 156127 | /* An ORDER/GROUP BY clause of more than 63 terms cannot be optimized */ |
| 155469 | 156128 | testcase( pOrderBy && pOrderBy->nExpr==BMS-1 ); |
| 155470 | 156129 | if( pOrderBy && pOrderBy->nExpr>=BMS ) pOrderBy = 0; |
| 155471 | 156130 | sWLB.pOrderBy = pOrderBy; |
| 155472 | 156131 | |
| 155473 | | - /* Disable the DISTINCT optimization if SQLITE_DistinctOpt is set via |
| 155474 | | - ** sqlite3_test_ctrl(SQLITE_TESTCTRL_OPTIMIZATIONS,...) */ |
| 155475 | | - if( OptimizationDisabled(db, SQLITE_DistinctOpt) ){ |
| 155476 | | - wctrlFlags &= ~WHERE_WANT_DISTINCT; |
| 155477 | | - } |
| 155478 | | - |
| 155479 | 156132 | /* The number of tables in the FROM clause is limited by the number of |
| 155480 | 156133 | ** bits in a Bitmask |
| 155481 | 156134 | */ |
| 155482 | 156135 | testcase( pTabList->nSrc==BMS ); |
| 155483 | 156136 | if( pTabList->nSrc>BMS ){ |
| | @@ -155520,10 +156173,14 @@ |
| 155520 | 156173 | memset(&pWInfo->nOBSat, 0, |
| 155521 | 156174 | offsetof(WhereInfo,sWC) - offsetof(WhereInfo,nOBSat)); |
| 155522 | 156175 | memset(&pWInfo->a[0], 0, sizeof(WhereLoop)+nTabList*sizeof(WhereLevel)); |
| 155523 | 156176 | assert( pWInfo->eOnePass==ONEPASS_OFF ); /* ONEPASS defaults to OFF */ |
| 155524 | 156177 | pMaskSet = &pWInfo->sMaskSet; |
| 156178 | + pMaskSet->n = 0; |
| 156179 | + pMaskSet->ix[0] = -99; /* Initialize ix[0] to a value that can never be |
| 156180 | + ** a valid cursor number, to avoid an initial |
| 156181 | + ** test for pMaskSet->n==0 in sqlite3WhereGetMask() */ |
| 155525 | 156182 | sWLB.pWInfo = pWInfo; |
| 155526 | 156183 | sWLB.pWC = &pWInfo->sWC; |
| 155527 | 156184 | sWLB.pNew = (WhereLoop*)(((char*)pWInfo)+nByteWInfo); |
| 155528 | 156185 | assert( EIGHT_BYTE_ALIGNMENT(sWLB.pNew) ); |
| 155529 | 156186 | whereLoopInit(sWLB.pNew); |
| | @@ -155532,19 +156189,20 @@ |
| 155532 | 156189 | #endif |
| 155533 | 156190 | |
| 155534 | 156191 | /* Split the WHERE clause into separate subexpressions where each |
| 155535 | 156192 | ** subexpression is separated by an AND operator. |
| 155536 | 156193 | */ |
| 155537 | | - initMaskSet(pMaskSet); |
| 155538 | 156194 | sqlite3WhereClauseInit(&pWInfo->sWC, pWInfo); |
| 155539 | 156195 | sqlite3WhereSplit(&pWInfo->sWC, pWhere, TK_AND); |
| 155540 | 156196 | |
| 155541 | 156197 | /* Special case: No FROM clause |
| 155542 | 156198 | */ |
| 155543 | 156199 | if( nTabList==0 ){ |
| 155544 | 156200 | if( pOrderBy ) pWInfo->nOBSat = pOrderBy->nExpr; |
| 155545 | | - if( wctrlFlags & WHERE_WANT_DISTINCT ){ |
| 156201 | + if( (wctrlFlags & WHERE_WANT_DISTINCT)!=0 |
| 156202 | + && OptimizationEnabled(db, SQLITE_DistinctOpt) |
| 156203 | + ){ |
| 155546 | 156204 | pWInfo->eDistinct = WHERE_DISTINCT_UNIQUE; |
| 155547 | 156205 | } |
| 155548 | 156206 | ExplainQueryPlan((pParse, 0, "SCAN CONSTANT ROW")); |
| 155549 | 156207 | }else{ |
| 155550 | 156208 | /* Assign a bit from the bitmask to every term in the FROM clause. |
| | @@ -155591,21 +156249,26 @@ |
| 155591 | 156249 | ** preserves SQLite's legacy behaviour in the following two cases: |
| 155592 | 156250 | ** |
| 155593 | 156251 | ** FROM ... WHERE random()>0; -- eval random() once per row |
| 155594 | 156252 | ** FROM ... WHERE (SELECT random())>0; -- eval random() once overall |
| 155595 | 156253 | */ |
| 155596 | | - for(ii=0; ii<sWLB.pWC->nTerm; ii++){ |
| 156254 | + for(ii=0; ii<sWLB.pWC->nBase; ii++){ |
| 155597 | 156255 | WhereTerm *pT = &sWLB.pWC->a[ii]; |
| 155598 | 156256 | if( pT->wtFlags & TERM_VIRTUAL ) continue; |
| 155599 | 156257 | if( pT->prereqAll==0 && (nTabList==0 || exprIsDeterministic(pT->pExpr)) ){ |
| 155600 | 156258 | sqlite3ExprIfFalse(pParse, pT->pExpr, pWInfo->iBreak, SQLITE_JUMPIFNULL); |
| 155601 | 156259 | pT->wtFlags |= TERM_CODED; |
| 155602 | 156260 | } |
| 155603 | 156261 | } |
| 155604 | 156262 | |
| 155605 | 156263 | if( wctrlFlags & WHERE_WANT_DISTINCT ){ |
| 155606 | | - if( isDistinctRedundant(pParse, pTabList, &pWInfo->sWC, pResultSet) ){ |
| 156264 | + if( OptimizationDisabled(db, SQLITE_DistinctOpt) ){ |
| 156265 | + /* Disable the DISTINCT optimization if SQLITE_DistinctOpt is set via |
| 156266 | + ** sqlite3_test_ctrl(SQLITE_TESTCTRL_OPTIMIZATIONS,...) */ |
| 156267 | + wctrlFlags &= ~WHERE_WANT_DISTINCT; |
| 156268 | + pWInfo->wctrlFlags &= ~WHERE_WANT_DISTINCT; |
| 156269 | + }else if( isDistinctRedundant(pParse, pTabList, &pWInfo->sWC, pResultSet) ){ |
| 155607 | 156270 | /* The DISTINCT marking is pointless. Ignore it. */ |
| 155608 | 156271 | pWInfo->eDistinct = WHERE_DISTINCT_UNIQUE; |
| 155609 | 156272 | }else if( pOrderBy==0 ){ |
| 155610 | 156273 | /* Try to ORDER BY the result set to make distinct processing easier */ |
| 155611 | 156274 | pWInfo->wctrlFlags |= WHERE_DISTINCTBY; |
| | @@ -155702,88 +156365,40 @@ |
| 155702 | 156365 | sqlite3WhereLoopPrint(pWInfo->a[ii].pWLoop, sWLB.pWC); |
| 155703 | 156366 | } |
| 155704 | 156367 | } |
| 155705 | 156368 | #endif |
| 155706 | 156369 | |
| 155707 | | - /* Attempt to omit tables from the join that do not affect the result. |
| 155708 | | - ** For a table to not affect the result, the following must be true: |
| 155709 | | - ** |
| 155710 | | - ** 1) The query must not be an aggregate. |
| 155711 | | - ** 2) The table must be the RHS of a LEFT JOIN. |
| 155712 | | - ** 3) Either the query must be DISTINCT, or else the ON or USING clause |
| 155713 | | - ** must contain a constraint that limits the scan of the table to |
| 155714 | | - ** at most a single row. |
| 155715 | | - ** 4) The table must not be referenced by any part of the query apart |
| 155716 | | - ** from its own USING or ON clause. |
| 155717 | | - ** |
| 155718 | | - ** For example, given: |
| 155719 | | - ** |
| 155720 | | - ** CREATE TABLE t1(ipk INTEGER PRIMARY KEY, v1); |
| 155721 | | - ** CREATE TABLE t2(ipk INTEGER PRIMARY KEY, v2); |
| 155722 | | - ** CREATE TABLE t3(ipk INTEGER PRIMARY KEY, v3); |
| 155723 | | - ** |
| 155724 | | - ** then table t2 can be omitted from the following: |
| 155725 | | - ** |
| 155726 | | - ** SELECT v1, v3 FROM t1 |
| 155727 | | - ** LEFT JOIN t2 ON (t1.ipk=t2.ipk) |
| 155728 | | - ** LEFT JOIN t3 ON (t1.ipk=t3.ipk) |
| 155729 | | - ** |
| 155730 | | - ** or from: |
| 155731 | | - ** |
| 155732 | | - ** SELECT DISTINCT v1, v3 FROM t1 |
| 155733 | | - ** LEFT JOIN t2 |
| 155734 | | - ** LEFT JOIN t3 ON (t1.ipk=t3.ipk) |
| 156370 | + /* Attempt to omit tables from a join that do not affect the result. |
| 156371 | + ** See the comment on whereOmitNoopJoin() for further information. |
| 156372 | + ** |
| 156373 | + ** This query optimization is factored out into a separate "no-inline" |
| 156374 | + ** procedure to keep the sqlite3WhereBegin() procedure from becoming |
| 156375 | + ** too large. If sqlite3WhereBegin() becomes too large, that prevents |
| 156376 | + ** some C-compiler optimizers from in-lining the |
| 156377 | + ** sqlite3WhereCodeOneLoopStart() procedure, and it is important to |
| 156378 | + ** in-line sqlite3WhereCodeOneLoopStart() for performance reasons. |
| 155735 | 156379 | */ |
| 155736 | 156380 | notReady = ~(Bitmask)0; |
| 155737 | 156381 | if( pWInfo->nLevel>=2 |
| 155738 | 156382 | && pResultSet!=0 /* these two combine to guarantee */ |
| 155739 | 156383 | && 0==(wctrlFlags & WHERE_AGG_DISTINCT) /* condition (1) above */ |
| 155740 | 156384 | && OptimizationEnabled(db, SQLITE_OmitNoopJoin) |
| 155741 | 156385 | ){ |
| 155742 | | - int i; |
| 155743 | | - Bitmask tabUsed = sqlite3WhereExprListUsage(pMaskSet, pResultSet); |
| 155744 | | - if( sWLB.pOrderBy ){ |
| 155745 | | - tabUsed |= sqlite3WhereExprListUsage(pMaskSet, sWLB.pOrderBy); |
| 155746 | | - } |
| 155747 | | - for(i=pWInfo->nLevel-1; i>=1; i--){ |
| 155748 | | - WhereTerm *pTerm, *pEnd; |
| 155749 | | - SrcItem *pItem; |
| 155750 | | - pLoop = pWInfo->a[i].pWLoop; |
| 155751 | | - pItem = &pWInfo->pTabList->a[pLoop->iTab]; |
| 155752 | | - if( (pItem->fg.jointype & JT_LEFT)==0 ) continue; |
| 155753 | | - if( (wctrlFlags & WHERE_WANT_DISTINCT)==0 |
| 155754 | | - && (pLoop->wsFlags & WHERE_ONEROW)==0 |
| 155755 | | - ){ |
| 155756 | | - continue; |
| 155757 | | - } |
| 155758 | | - if( (tabUsed & pLoop->maskSelf)!=0 ) continue; |
| 155759 | | - pEnd = sWLB.pWC->a + sWLB.pWC->nTerm; |
| 155760 | | - for(pTerm=sWLB.pWC->a; pTerm<pEnd; pTerm++){ |
| 155761 | | - if( (pTerm->prereqAll & pLoop->maskSelf)!=0 ){ |
| 155762 | | - if( !ExprHasProperty(pTerm->pExpr, EP_FromJoin) |
| 155763 | | - || pTerm->pExpr->iRightJoinTable!=pItem->iCursor |
| 155764 | | - ){ |
| 155765 | | - break; |
| 155766 | | - } |
| 155767 | | - } |
| 155768 | | - } |
| 155769 | | - if( pTerm<pEnd ) continue; |
| 155770 | | - WHERETRACE(0xffff, ("-> drop loop %c not used\n", pLoop->cId)); |
| 155771 | | - notReady &= ~pLoop->maskSelf; |
| 155772 | | - for(pTerm=sWLB.pWC->a; pTerm<pEnd; pTerm++){ |
| 155773 | | - if( (pTerm->prereqAll & pLoop->maskSelf)!=0 ){ |
| 155774 | | - pTerm->wtFlags |= TERM_CODED; |
| 155775 | | - } |
| 155776 | | - } |
| 155777 | | - if( i!=pWInfo->nLevel-1 ){ |
| 155778 | | - int nByte = (pWInfo->nLevel-1-i) * sizeof(WhereLevel); |
| 155779 | | - memmove(&pWInfo->a[i], &pWInfo->a[i+1], nByte); |
| 155780 | | - } |
| 155781 | | - pWInfo->nLevel--; |
| 155782 | | - nTabList--; |
| 155783 | | - } |
| 155784 | | - } |
| 156386 | + notReady = whereOmitNoopJoin(pWInfo, notReady); |
| 156387 | + nTabList = pWInfo->nLevel; |
| 156388 | + assert( nTabList>0 ); |
| 156389 | + } |
| 156390 | + |
| 156391 | + /* Check to see if there are any SEARCH loops that might benefit from |
| 156392 | + ** using a Bloom filter. |
| 156393 | + */ |
| 156394 | + if( pWInfo->nLevel>=2 |
| 156395 | + && OptimizationEnabled(db, SQLITE_BloomFilter) |
| 156396 | + ){ |
| 156397 | + whereCheckIfBloomFilterIsUseful(pWInfo); |
| 156398 | + } |
| 156399 | + |
| 155785 | 156400 | #if defined(WHERETRACE_ENABLED) |
| 155786 | 156401 | if( sqlite3WhereTrace & 0x100 ){ /* Display all terms of the WHERE clause */ |
| 155787 | 156402 | sqlite3DebugPrintf("---- WHERE clause at end of analysis:\n"); |
| 155788 | 156403 | sqlite3WhereClausePrint(sWLB.pWC); |
| 155789 | 156404 | } |
| | @@ -155968,17 +156583,21 @@ |
| 155968 | 156583 | int addrExplain; |
| 155969 | 156584 | int wsFlags; |
| 155970 | 156585 | if( pParse->nErr ) goto whereBeginError; |
| 155971 | 156586 | pLevel = &pWInfo->a[ii]; |
| 155972 | 156587 | wsFlags = pLevel->pWLoop->wsFlags; |
| 156588 | + if( (wsFlags & (WHERE_AUTO_INDEX|WHERE_BLOOMFILTER))!=0 ){ |
| 156589 | + if( (wsFlags & WHERE_AUTO_INDEX)!=0 ){ |
| 155973 | 156590 | #ifndef SQLITE_OMIT_AUTOMATIC_INDEX |
| 155974 | | - if( (pLevel->pWLoop->wsFlags & WHERE_AUTO_INDEX)!=0 ){ |
| 155975 | | - constructAutomaticIndex(pParse, &pWInfo->sWC, |
| 155976 | | - &pTabList->a[pLevel->iFrom], notReady, pLevel); |
| 156591 | + constructAutomaticIndex(pParse, &pWInfo->sWC, |
| 156592 | + &pTabList->a[pLevel->iFrom], notReady, pLevel); |
| 156593 | +#endif |
| 156594 | + }else{ |
| 156595 | + constructBloomFilter(pWInfo, ii, pLevel, notReady); |
| 156596 | + } |
| 155977 | 156597 | if( db->mallocFailed ) goto whereBeginError; |
| 155978 | 156598 | } |
| 155979 | | -#endif |
| 155980 | 156599 | addrExplain = sqlite3WhereExplainOneScan( |
| 155981 | 156600 | pParse, pTabList, pLevel, wctrlFlags |
| 155982 | 156601 | ); |
| 155983 | 156602 | pLevel->addrBody = sqlite3VdbeCurrentAddr(v); |
| 155984 | 156603 | notReady = sqlite3WhereCodeOneLoopStart(pParse,v,pWInfo,ii,pLevel,notReady); |
| | @@ -159701,14 +160320,14 @@ |
| 159701 | 160320 | #define TK_DETACH 40 |
| 159702 | 160321 | #define TK_EACH 41 |
| 159703 | 160322 | #define TK_FAIL 42 |
| 159704 | 160323 | #define TK_OR 43 |
| 159705 | 160324 | #define TK_AND 44 |
| 159706 | | -#define TK_IS 45 |
| 159707 | | -#define TK_MATCH 46 |
| 159708 | | -#define TK_LIKE_KW 47 |
| 159709 | | -#define TK_BETWEEN 48 |
| 160325 | +#define TK_MATCH 45 |
| 160326 | +#define TK_LIKE_KW 46 |
| 160327 | +#define TK_BETWEEN 47 |
| 160328 | +#define TK_IS 48 |
| 159710 | 160329 | #define TK_IN 49 |
| 159711 | 160330 | #define TK_ISNULL 50 |
| 159712 | 160331 | #define TK_NOTNULL 51 |
| 159713 | 160332 | #define TK_NE 52 |
| 159714 | 160333 | #define TK_EQ 53 |
| | @@ -160016,216 +160635,215 @@ |
| 160016 | 160635 | ** yy_reduce_ofst[] For each state, the offset into yy_action for |
| 160017 | 160636 | ** shifting non-terminals after a reduce. |
| 160018 | 160637 | ** yy_default[] Default action for each state. |
| 160019 | 160638 | ** |
| 160020 | 160639 | *********** Begin parsing tables **********************************************/ |
| 160021 | | -#define YY_ACTTAB_COUNT (2037) |
| 160640 | +#define YY_ACTTAB_COUNT (2022) |
| 160022 | 160641 | static const YYACTIONTYPE yy_action[] = { |
| 160023 | 160642 | /* 0 */ 564, 115, 112, 220, 169, 199, 115, 112, 220, 564, |
| 160024 | 160643 | /* 10 */ 375, 1266, 564, 376, 564, 270, 1309, 1309, 406, 407, |
| 160025 | 160644 | /* 20 */ 1084, 199, 1513, 41, 41, 515, 489, 521, 558, 558, |
| 160026 | 160645 | /* 30 */ 558, 965, 41, 41, 395, 41, 41, 51, 51, 966, |
| 160027 | | - /* 40 */ 296, 1269, 296, 122, 123, 113, 1207, 1207, 1041, 1044, |
| 160646 | + /* 40 */ 296, 1269, 296, 122, 123, 1207, 1207, 1041, 113, 1044, |
| 160028 | 160647 | /* 50 */ 1034, 1034, 120, 120, 121, 121, 121, 121, 564, 407, |
| 160029 | 160648 | /* 60 */ 275, 275, 275, 275, 1268, 115, 112, 220, 115, 112, |
| 160030 | 160649 | /* 70 */ 220, 1512, 846, 561, 516, 561, 115, 112, 220, 250, |
| 160031 | | - /* 80 */ 217, 71, 71, 122, 123, 113, 1207, 1207, 1041, 1044, |
| 160650 | + /* 80 */ 217, 71, 71, 122, 123, 1207, 1207, 1041, 113, 1044, |
| 160032 | 160651 | /* 90 */ 1034, 1034, 120, 120, 121, 121, 121, 121, 440, 440, |
| 160033 | 160652 | /* 100 */ 440, 1149, 119, 119, 119, 119, 118, 118, 117, 117, |
| 160034 | 160653 | /* 110 */ 117, 116, 442, 1183, 1149, 116, 442, 1149, 546, 513, |
| 160035 | | - /* 120 */ 1548, 1554, 374, 442, 6, 1183, 1154, 522, 1154, 407, |
| 160654 | + /* 120 */ 1548, 1554, 374, 213, 6, 169, 1154, 522, 1154, 407, |
| 160036 | 160655 | /* 130 */ 1556, 461, 373, 1554, 535, 99, 463, 332, 121, 121, |
| 160037 | 160656 | /* 140 */ 121, 121, 119, 119, 119, 119, 118, 118, 117, 117, |
| 160038 | | - /* 150 */ 117, 116, 442, 122, 123, 113, 1207, 1207, 1041, 1044, |
| 160657 | + /* 150 */ 117, 116, 442, 122, 123, 1207, 1207, 1041, 113, 1044, |
| 160039 | 160658 | /* 160 */ 1034, 1034, 120, 120, 121, 121, 121, 121, 1257, 1183, |
| 160040 | 160659 | /* 170 */ 1184, 1185, 243, 1064, 564, 502, 499, 498, 567, 124, |
| 160041 | | - /* 180 */ 567, 1183, 1184, 1185, 474, 497, 119, 119, 119, 119, |
| 160660 | + /* 180 */ 567, 1128, 1627, 344, 1627, 497, 119, 119, 119, 119, |
| 160042 | 160661 | /* 190 */ 118, 118, 117, 117, 117, 116, 442, 70, 70, 407, |
| 160043 | 160662 | /* 200 */ 121, 121, 121, 121, 114, 117, 117, 117, 116, 442, |
| 160044 | | - /* 210 */ 1409, 1469, 119, 119, 119, 119, 118, 118, 117, 117, |
| 160045 | | - /* 220 */ 117, 116, 442, 122, 123, 113, 1207, 1207, 1041, 1044, |
| 160046 | | - /* 230 */ 1034, 1034, 120, 120, 121, 121, 121, 121, 407, 1031, |
| 160047 | | - /* 240 */ 1031, 1042, 1045, 81, 382, 541, 378, 80, 119, 119, |
| 160663 | + /* 210 */ 474, 1469, 119, 119, 119, 119, 118, 118, 117, 117, |
| 160664 | + /* 220 */ 117, 116, 442, 122, 123, 1207, 1207, 1041, 113, 1044, |
| 160665 | + /* 230 */ 1034, 1034, 120, 120, 121, 121, 121, 121, 407, 208, |
| 160666 | + /* 240 */ 539, 1548, 1424, 81, 339, 6, 342, 80, 119, 119, |
| 160048 | 160667 | /* 250 */ 119, 119, 118, 118, 117, 117, 117, 116, 442, 381, |
| 160049 | | - /* 260 */ 463, 332, 122, 123, 113, 1207, 1207, 1041, 1044, 1034, |
| 160050 | | - /* 270 */ 1034, 120, 120, 121, 121, 121, 121, 262, 215, 512, |
| 160051 | | - /* 280 */ 1424, 422, 119, 119, 119, 119, 118, 118, 117, 117, |
| 160668 | + /* 260 */ 1126, 442, 122, 123, 1207, 1207, 1041, 113, 1044, 1034, |
| 160669 | + /* 270 */ 1034, 120, 120, 121, 121, 121, 121, 262, 463, 332, |
| 160670 | + /* 280 */ 359, 1567, 119, 119, 119, 119, 118, 118, 117, 117, |
| 160052 | 160671 | /* 290 */ 117, 116, 442, 1231, 1, 1, 571, 2, 1235, 1573, |
| 160053 | | - /* 300 */ 571, 2, 1235, 307, 1149, 141, 1600, 307, 407, 141, |
| 160054 | | - /* 310 */ 1183, 361, 1317, 1035, 866, 531, 1317, 1149, 359, 1567, |
| 160672 | + /* 300 */ 571, 2, 1235, 307, 1149, 141, 417, 307, 407, 141, |
| 160673 | + /* 310 */ 1183, 98, 1317, 489, 866, 531, 1317, 1149, 215, 512, |
| 160055 | 160674 | /* 320 */ 1149, 119, 119, 119, 119, 118, 118, 117, 117, 117, |
| 160056 | | - /* 330 */ 116, 442, 122, 123, 113, 1207, 1207, 1041, 1044, 1034, |
| 160675 | + /* 330 */ 116, 442, 122, 123, 1207, 1207, 1041, 113, 1044, 1034, |
| 160057 | 160676 | /* 340 */ 1034, 120, 120, 121, 121, 121, 121, 275, 275, 1001, |
| 160058 | | - /* 350 */ 426, 275, 275, 1128, 1627, 1021, 1627, 137, 542, 1541, |
| 160059 | | - /* 360 */ 561, 272, 950, 950, 561, 1423, 1183, 1184, 1185, 1594, |
| 160060 | | - /* 370 */ 866, 1012, 530, 315, 231, 1011, 468, 1276, 231, 119, |
| 160677 | + /* 350 */ 1257, 275, 275, 1128, 1628, 1021, 1628, 137, 415, 1600, |
| 160678 | + /* 360 */ 561, 272, 1255, 950, 561, 1423, 1183, 1184, 1185, 1594, |
| 160679 | + /* 370 */ 866, 1012, 530, 315, 231, 1011, 317, 1276, 231, 119, |
| 160061 | 160680 | /* 380 */ 119, 119, 119, 118, 118, 117, 117, 117, 116, 442, |
| 160062 | 160681 | /* 390 */ 1570, 119, 119, 119, 119, 118, 118, 117, 117, 117, |
| 160063 | 160682 | /* 400 */ 116, 442, 330, 359, 1567, 564, 446, 1011, 1011, 1013, |
| 160064 | | - /* 410 */ 446, 207, 564, 306, 555, 407, 363, 1021, 363, 346, |
| 160683 | + /* 410 */ 446, 877, 564, 306, 555, 407, 447, 1021, 563, 346, |
| 160065 | 160684 | /* 420 */ 184, 118, 118, 117, 117, 117, 116, 442, 71, 71, |
| 160066 | 160685 | /* 430 */ 439, 438, 1126, 1012, 472, 71, 71, 1011, 205, 122, |
| 160067 | | - /* 440 */ 123, 113, 1207, 1207, 1041, 1044, 1034, 1034, 120, 120, |
| 160068 | | - /* 450 */ 121, 121, 121, 121, 219, 219, 472, 1183, 407, 570, |
| 160069 | | - /* 460 */ 1183, 1235, 503, 1477, 149, 546, 307, 489, 141, 1011, |
| 160070 | | - /* 470 */ 1011, 1013, 546, 140, 545, 1317, 1214, 191, 1214, 950, |
| 160071 | | - /* 480 */ 950, 514, 122, 123, 113, 1207, 1207, 1041, 1044, 1034, |
| 160072 | | - /* 490 */ 1034, 120, 120, 121, 121, 121, 121, 563, 119, 119, |
| 160686 | + /* 440 */ 123, 1207, 1207, 1041, 113, 1044, 1034, 1034, 120, 120, |
| 160687 | + /* 450 */ 121, 121, 121, 121, 1304, 219, 1283, 1183, 407, 570, |
| 160688 | + /* 460 */ 1183, 1235, 503, 1477, 1304, 546, 307, 489, 141, 1011, |
| 160689 | + /* 470 */ 1011, 1013, 546, 140, 545, 1317, 1214, 382, 1214, 378, |
| 160690 | + /* 480 */ 950, 514, 122, 123, 1207, 1207, 1041, 113, 1044, 1034, |
| 160691 | + /* 490 */ 1034, 120, 120, 121, 121, 121, 121, 472, 119, 119, |
| 160073 | 160692 | /* 500 */ 119, 119, 118, 118, 117, 117, 117, 116, 442, 283, |
| 160074 | | - /* 510 */ 275, 275, 415, 1183, 1184, 1185, 1183, 1184, 1185, 372, |
| 160075 | | - /* 520 */ 1183, 243, 344, 561, 502, 499, 498, 1539, 407, 1540, |
| 160076 | | - /* 530 */ 1183, 288, 870, 143, 497, 1549, 185, 231, 9, 6, |
| 160693 | + /* 510 */ 275, 275, 1476, 1183, 1184, 1185, 1183, 1184, 1185, 417, |
| 160694 | + /* 520 */ 1183, 243, 541, 561, 502, 499, 498, 1001, 407, 478, |
| 160695 | + /* 530 */ 1183, 472, 870, 143, 497, 1549, 185, 231, 9, 6, |
| 160077 | 160696 | /* 540 */ 253, 119, 119, 119, 119, 118, 118, 117, 117, 117, |
| 160078 | | - /* 550 */ 116, 442, 122, 123, 113, 1207, 1207, 1041, 1044, 1034, |
| 160079 | | - /* 560 */ 1034, 120, 120, 121, 121, 121, 121, 407, 137, 446, |
| 160080 | | - /* 570 */ 447, 863, 169, 1183, 397, 1204, 1183, 1184, 1185, 931, |
| 160081 | | - /* 580 */ 526, 1001, 98, 339, 564, 342, 1183, 1184, 1185, 306, |
| 160082 | | - /* 590 */ 555, 122, 123, 113, 1207, 1207, 1041, 1044, 1034, 1034, |
| 160083 | | - /* 600 */ 120, 120, 121, 121, 121, 121, 452, 71, 71, 275, |
| 160697 | + /* 550 */ 116, 442, 122, 123, 1207, 1207, 1041, 113, 1044, 1034, |
| 160698 | + /* 560 */ 1034, 120, 120, 121, 121, 121, 121, 407, 372, 446, |
| 160699 | + /* 570 */ 363, 863, 288, 1183, 397, 1204, 1183, 1184, 1185, 931, |
| 160700 | + /* 580 */ 330, 458, 318, 526, 564, 541, 1183, 1184, 1185, 284, |
| 160701 | + /* 590 */ 1183, 122, 123, 1207, 1207, 1041, 113, 1044, 1034, 1034, |
| 160702 | + /* 600 */ 120, 120, 121, 121, 121, 121, 291, 71, 71, 275, |
| 160084 | 160703 | /* 610 */ 275, 119, 119, 119, 119, 118, 118, 117, 117, 117, |
| 160085 | | - /* 620 */ 116, 442, 561, 417, 306, 555, 1183, 1307, 1307, 1183, |
| 160086 | | - /* 630 */ 1184, 1185, 1204, 1149, 330, 458, 318, 407, 363, 470, |
| 160087 | | - /* 640 */ 431, 1167, 32, 541, 527, 350, 1149, 1629, 393, 1149, |
| 160704 | + /* 620 */ 116, 442, 561, 1031, 1031, 1042, 1183, 1045, 287, 1183, |
| 160705 | + /* 630 */ 1184, 1185, 1204, 137, 218, 542, 1541, 407, 363, 470, |
| 160706 | + /* 640 */ 431, 1167, 32, 363, 527, 350, 1183, 1184, 1185, 380, |
| 160088 | 160707 | /* 650 */ 119, 119, 119, 119, 118, 118, 117, 117, 117, 116, |
| 160089 | | - /* 660 */ 442, 122, 123, 113, 1207, 1207, 1041, 1044, 1034, 1034, |
| 160090 | | - /* 670 */ 120, 120, 121, 121, 121, 121, 407, 199, 472, 1183, |
| 160091 | | - /* 680 */ 1022, 472, 1183, 1184, 1185, 386, 151, 539, 1548, 277, |
| 160092 | | - /* 690 */ 400, 137, 6, 317, 5, 564, 562, 3, 920, 920, |
| 160093 | | - /* 700 */ 122, 123, 113, 1207, 1207, 1041, 1044, 1034, 1034, 120, |
| 160708 | + /* 660 */ 442, 122, 123, 1207, 1207, 1041, 113, 1044, 1034, 1034, |
| 160709 | + /* 670 */ 120, 120, 121, 121, 121, 121, 407, 392, 1227, 1183, |
| 160710 | + /* 680 */ 1022, 1540, 1183, 1184, 1185, 1523, 149, 1307, 1307, 306, |
| 160711 | + /* 690 */ 555, 151, 1546, 361, 5, 564, 6, 3, 1035, 1542, |
| 160712 | + /* 700 */ 122, 123, 1207, 1207, 1041, 113, 1044, 1034, 1034, 120, |
| 160094 | 160713 | /* 710 */ 120, 121, 121, 121, 121, 411, 505, 83, 71, 71, |
| 160095 | 160714 | /* 720 */ 119, 119, 119, 119, 118, 118, 117, 117, 117, 116, |
| 160096 | | - /* 730 */ 442, 1183, 218, 428, 1183, 1183, 1184, 1185, 363, 261, |
| 160097 | | - /* 740 */ 278, 358, 508, 353, 507, 248, 407, 306, 555, 1539, |
| 160098 | | - /* 750 */ 1006, 349, 363, 291, 489, 302, 293, 1542, 281, 119, |
| 160715 | + /* 730 */ 442, 1183, 426, 428, 1183, 1183, 1184, 1185, 191, 261, |
| 160716 | + /* 740 */ 278, 358, 508, 353, 507, 248, 407, 455, 137, 1539, |
| 160717 | + /* 750 */ 1006, 349, 363, 472, 1539, 302, 1228, 405, 281, 119, |
| 160099 | 160718 | /* 760 */ 119, 119, 119, 118, 118, 117, 117, 117, 116, 442, |
| 160100 | | - /* 770 */ 122, 123, 113, 1207, 1207, 1041, 1044, 1034, 1034, 120, |
| 160101 | | - /* 780 */ 120, 121, 121, 121, 121, 407, 148, 1183, 1184, 1185, |
| 160102 | | - /* 790 */ 1183, 1184, 1185, 275, 275, 1304, 1257, 1283, 483, 1476, |
| 160103 | | - /* 800 */ 150, 489, 480, 564, 1187, 1304, 561, 1587, 1255, 122, |
| 160104 | | - /* 810 */ 123, 113, 1207, 1207, 1041, 1044, 1034, 1034, 120, 120, |
| 160105 | | - /* 820 */ 121, 121, 121, 121, 564, 886, 13, 13, 520, 119, |
| 160719 | + /* 770 */ 122, 123, 1207, 1207, 1041, 113, 1044, 1034, 1034, 120, |
| 160720 | + /* 780 */ 120, 121, 121, 121, 121, 407, 452, 1183, 1184, 1185, |
| 160721 | + /* 790 */ 1183, 1184, 1185, 275, 275, 269, 269, 489, 483, 1525, |
| 160722 | + /* 800 */ 148, 363, 480, 564, 306, 555, 561, 489, 561, 122, |
| 160723 | + /* 810 */ 123, 1207, 1207, 1041, 113, 1044, 1034, 1034, 120, 120, |
| 160724 | + /* 820 */ 121, 121, 121, 121, 564, 886, 13, 13, 293, 119, |
| 160106 | 160725 | /* 830 */ 119, 119, 119, 118, 118, 117, 117, 117, 116, 442, |
| 160107 | | - /* 840 */ 1183, 420, 417, 564, 269, 269, 1316, 13, 13, 1539, |
| 160108 | | - /* 850 */ 1546, 16, 16, 322, 6, 407, 506, 561, 1089, 1089, |
| 160109 | | - /* 860 */ 486, 1187, 425, 1539, 887, 292, 71, 71, 119, 119, |
| 160726 | + /* 840 */ 1183, 420, 1316, 564, 98, 417, 199, 13, 13, 150, |
| 160727 | + /* 850 */ 306, 555, 1312, 322, 386, 407, 506, 478, 562, 400, |
| 160728 | + /* 860 */ 920, 920, 425, 1539, 887, 292, 71, 71, 119, 119, |
| 160110 | 160729 | /* 870 */ 119, 119, 118, 118, 117, 117, 117, 116, 442, 122, |
| 160111 | | - /* 880 */ 123, 113, 1207, 1207, 1041, 1044, 1034, 1034, 120, 120, |
| 160112 | | - /* 890 */ 121, 121, 121, 121, 564, 12, 1183, 1184, 1185, 407, |
| 160113 | | - /* 900 */ 275, 275, 451, 303, 834, 835, 836, 417, 489, 276, |
| 160114 | | - /* 910 */ 276, 1547, 284, 561, 319, 6, 321, 71, 71, 429, |
| 160115 | | - /* 920 */ 451, 450, 561, 952, 101, 113, 1207, 1207, 1041, 1044, |
| 160730 | + /* 880 */ 123, 1207, 1207, 1041, 113, 1044, 1034, 1034, 120, 120, |
| 160731 | + /* 890 */ 121, 121, 121, 121, 564, 1149, 1183, 1184, 1185, 407, |
| 160732 | + /* 900 */ 275, 275, 451, 303, 1089, 1089, 486, 448, 1149, 276, |
| 160733 | + /* 910 */ 276, 1149, 1539, 561, 319, 286, 321, 71, 71, 429, |
| 160734 | + /* 920 */ 451, 450, 561, 952, 101, 1207, 1207, 1041, 113, 1044, |
| 160116 | 160735 | /* 930 */ 1034, 1034, 120, 120, 121, 121, 121, 121, 119, 119, |
| 160117 | 160736 | /* 940 */ 119, 119, 118, 118, 117, 117, 117, 116, 442, 1105, |
| 160118 | | - /* 950 */ 1183, 489, 564, 1312, 437, 455, 478, 564, 246, 245, |
| 160119 | | - /* 960 */ 244, 1409, 1545, 547, 1106, 405, 6, 1544, 196, 1258, |
| 160120 | | - /* 970 */ 413, 6, 105, 462, 103, 71, 71, 286, 564, 1107, |
| 160737 | + /* 950 */ 1183, 1547, 564, 12, 437, 6, 329, 564, 834, 835, |
| 160738 | + /* 960 */ 836, 1629, 393, 547, 1106, 246, 245, 244, 1545, 1258, |
| 160739 | + /* 970 */ 413, 1521, 6, 1086, 310, 71, 71, 1086, 564, 1107, |
| 160121 | 160740 | /* 980 */ 13, 13, 119, 119, 119, 119, 118, 118, 117, 117, |
| 160122 | | - /* 990 */ 117, 116, 442, 451, 104, 427, 337, 320, 275, 275, |
| 160123 | | - /* 1000 */ 906, 13, 13, 564, 1482, 1105, 1183, 1184, 1185, 126, |
| 160124 | | - /* 1010 */ 907, 561, 546, 564, 407, 478, 295, 1321, 253, 200, |
| 160125 | | - /* 1020 */ 1106, 548, 1482, 1484, 280, 1409, 55, 55, 1287, 561, |
| 160126 | | - /* 1030 */ 478, 380, 423, 951, 407, 1107, 71, 71, 122, 123, |
| 160127 | | - /* 1040 */ 113, 1207, 1207, 1041, 1044, 1034, 1034, 120, 120, 121, |
| 160128 | | - /* 1050 */ 121, 121, 121, 1204, 407, 287, 552, 309, 122, 123, |
| 160129 | | - /* 1060 */ 113, 1207, 1207, 1041, 1044, 1034, 1034, 120, 120, 121, |
| 160130 | | - /* 1070 */ 121, 121, 121, 441, 1128, 1628, 146, 1628, 122, 111, |
| 160131 | | - /* 1080 */ 113, 1207, 1207, 1041, 1044, 1034, 1034, 120, 120, 121, |
| 160132 | | - /* 1090 */ 121, 121, 121, 404, 403, 1482, 424, 119, 119, 119, |
| 160741 | + /* 990 */ 117, 116, 442, 451, 104, 427, 537, 320, 275, 275, |
| 160742 | + /* 1000 */ 906, 13, 13, 520, 1482, 1105, 1183, 1184, 1185, 484, |
| 160743 | + /* 1010 */ 907, 561, 546, 564, 407, 536, 295, 478, 253, 200, |
| 160744 | + /* 1020 */ 1106, 548, 1482, 1484, 1160, 1409, 16, 16, 126, 557, |
| 160745 | + /* 1030 */ 413, 479, 311, 951, 407, 1107, 71, 71, 122, 123, |
| 160746 | + /* 1040 */ 1207, 1207, 1041, 113, 1044, 1034, 1034, 120, 120, 121, |
| 160747 | + /* 1050 */ 121, 121, 121, 1204, 407, 544, 552, 314, 122, 123, |
| 160748 | + /* 1060 */ 1207, 1207, 1041, 113, 1044, 1034, 1034, 120, 120, 121, |
| 160749 | + /* 1070 */ 121, 121, 121, 441, 144, 1160, 468, 146, 122, 111, |
| 160750 | + /* 1080 */ 1207, 1207, 1041, 113, 1044, 1034, 1034, 120, 120, 121, |
| 160751 | + /* 1090 */ 121, 121, 121, 247, 12, 1482, 422, 119, 119, 119, |
| 160133 | 160752 | /* 1100 */ 119, 118, 118, 117, 117, 117, 116, 442, 1183, 564, |
| 160134 | | - /* 1110 */ 1204, 544, 1086, 858, 329, 361, 1086, 119, 119, 119, |
| 160135 | | - /* 1120 */ 119, 118, 118, 117, 117, 117, 116, 442, 564, 294, |
| 160136 | | - /* 1130 */ 144, 523, 56, 56, 224, 564, 510, 119, 119, 119, |
| 160137 | | - /* 1140 */ 119, 118, 118, 117, 117, 117, 116, 442, 484, 1409, |
| 160138 | | - /* 1150 */ 537, 15, 15, 1126, 434, 439, 438, 407, 13, 13, |
| 160139 | | - /* 1160 */ 1523, 12, 926, 1211, 1183, 1184, 1185, 925, 1213, 536, |
| 160140 | | - /* 1170 */ 858, 557, 413, 193, 1525, 494, 1212, 448, 1160, 1222, |
| 160141 | | - /* 1180 */ 1183, 564, 123, 113, 1207, 1207, 1041, 1044, 1034, 1034, |
| 160142 | | - /* 1190 */ 120, 120, 121, 121, 121, 121, 1521, 1149, 564, 965, |
| 160143 | | - /* 1200 */ 564, 1214, 247, 1214, 13, 13, 1409, 966, 538, 564, |
| 160144 | | - /* 1210 */ 1149, 108, 556, 1149, 4, 310, 392, 1227, 17, 194, |
| 160145 | | - /* 1220 */ 485, 43, 43, 57, 57, 306, 555, 524, 559, 1160, |
| 160146 | | - /* 1230 */ 464, 564, 44, 44, 392, 1127, 1183, 1184, 1185, 479, |
| 160753 | + /* 1110 */ 1204, 207, 404, 403, 858, 950, 294, 119, 119, 119, |
| 160754 | + /* 1120 */ 119, 118, 118, 117, 117, 117, 116, 442, 564, 30, |
| 160755 | + /* 1130 */ 564, 1409, 55, 55, 1599, 564, 895, 119, 119, 119, |
| 160756 | + /* 1140 */ 119, 118, 118, 117, 117, 117, 116, 442, 510, 1409, |
| 160757 | + /* 1150 */ 1409, 56, 56, 15, 15, 439, 438, 407, 13, 13, |
| 160758 | + /* 1160 */ 31, 1187, 412, 1211, 1183, 1184, 1185, 196, 1213, 306, |
| 160759 | + /* 1170 */ 555, 858, 462, 193, 926, 564, 1212, 489, 361, 925, |
| 160760 | + /* 1180 */ 1183, 564, 123, 1207, 1207, 1041, 113, 1044, 1034, 1034, |
| 160761 | + /* 1190 */ 120, 120, 121, 121, 121, 121, 1544, 1149, 43, 43, |
| 160762 | + /* 1200 */ 6, 1214, 423, 1214, 13, 13, 564, 219, 538, 494, |
| 160763 | + /* 1210 */ 1149, 108, 556, 1149, 4, 392, 1127, 434, 1187, 194, |
| 160764 | + /* 1220 */ 424, 485, 337, 1315, 414, 171, 1253, 1321, 559, 57, |
| 160765 | + /* 1230 */ 57, 564, 950, 564, 224, 247, 1183, 1184, 1185, 561, |
| 160147 | 160766 | /* 1240 */ 119, 119, 119, 119, 118, 118, 117, 117, 117, 116, |
| 160148 | | - /* 1250 */ 442, 443, 564, 327, 13, 13, 564, 418, 1315, 414, |
| 160149 | | - /* 1260 */ 171, 564, 311, 553, 213, 529, 1253, 564, 517, 543, |
| 160150 | | - /* 1270 */ 412, 108, 556, 137, 4, 58, 58, 435, 314, 59, |
| 160151 | | - /* 1280 */ 59, 274, 217, 549, 60, 60, 349, 476, 559, 1353, |
| 160152 | | - /* 1290 */ 61, 61, 1021, 275, 275, 1228, 213, 564, 106, 106, |
| 160153 | | - /* 1300 */ 8, 275, 275, 275, 275, 107, 561, 443, 566, 565, |
| 160154 | | - /* 1310 */ 564, 443, 1011, 1228, 561, 564, 561, 564, 275, 275, |
| 160155 | | - /* 1320 */ 62, 62, 1352, 553, 247, 456, 564, 98, 110, 306, |
| 160156 | | - /* 1330 */ 555, 561, 564, 45, 45, 405, 1203, 533, 46, 46, |
| 160157 | | - /* 1340 */ 47, 47, 532, 465, 1011, 1011, 1013, 1014, 27, 49, |
| 160158 | | - /* 1350 */ 49, 564, 1021, 405, 469, 50, 50, 564, 106, 106, |
| 160159 | | - /* 1360 */ 305, 564, 84, 204, 405, 107, 564, 443, 566, 565, |
| 160160 | | - /* 1370 */ 405, 564, 1011, 564, 63, 63, 564, 1599, 564, 895, |
| 160161 | | - /* 1380 */ 64, 64, 457, 477, 65, 65, 147, 96, 38, 14, |
| 160162 | | - /* 1390 */ 14, 1528, 412, 564, 66, 66, 128, 128, 926, 67, |
| 160163 | | - /* 1400 */ 67, 52, 52, 925, 1011, 1011, 1013, 1014, 27, 1572, |
| 160164 | | - /* 1410 */ 1171, 445, 208, 1123, 279, 394, 68, 68, 228, 390, |
| 160165 | | - /* 1420 */ 390, 389, 264, 387, 1171, 445, 843, 877, 279, 108, |
| 160166 | | - /* 1430 */ 556, 453, 4, 390, 390, 389, 264, 387, 564, 225, |
| 160167 | | - /* 1440 */ 843, 313, 328, 1003, 98, 252, 559, 544, 471, 312, |
| 160168 | | - /* 1450 */ 252, 564, 208, 225, 564, 313, 473, 30, 252, 279, |
| 160169 | | - /* 1460 */ 466, 69, 69, 312, 390, 390, 389, 264, 387, 443, |
| 160170 | | - /* 1470 */ 333, 843, 98, 564, 53, 53, 323, 157, 157, 227, |
| 160171 | | - /* 1480 */ 495, 553, 249, 289, 225, 564, 313, 162, 31, 1501, |
| 160172 | | - /* 1490 */ 135, 564, 1500, 227, 312, 533, 158, 158, 885, 884, |
| 160173 | | - /* 1500 */ 534, 162, 873, 301, 135, 564, 481, 226, 76, 76, |
| 160174 | | - /* 1510 */ 1021, 347, 1071, 98, 54, 54, 106, 106, 1067, 564, |
| 160175 | | - /* 1520 */ 249, 226, 519, 107, 227, 443, 566, 565, 72, 72, |
| 160176 | | - /* 1530 */ 1011, 334, 162, 564, 230, 135, 108, 556, 959, 4, |
| 160177 | | - /* 1540 */ 252, 408, 129, 129, 564, 1349, 306, 555, 564, 923, |
| 160178 | | - /* 1550 */ 564, 110, 226, 559, 564, 408, 73, 73, 564, 873, |
| 160179 | | - /* 1560 */ 306, 555, 1011, 1011, 1013, 1014, 27, 130, 130, 1071, |
| 160180 | | - /* 1570 */ 449, 131, 131, 127, 127, 357, 443, 156, 156, 892, |
| 160181 | | - /* 1580 */ 893, 155, 155, 338, 449, 356, 408, 564, 553, 968, |
| 160182 | | - /* 1590 */ 969, 306, 555, 1015, 341, 564, 108, 556, 564, 4, |
| 160183 | | - /* 1600 */ 1132, 1286, 533, 564, 856, 343, 145, 532, 345, 1300, |
| 160184 | | - /* 1610 */ 136, 136, 1083, 559, 1083, 449, 564, 1021, 134, 134, |
| 160185 | | - /* 1620 */ 1284, 132, 132, 106, 106, 1285, 133, 133, 564, 352, |
| 160186 | | - /* 1630 */ 107, 564, 443, 566, 565, 1340, 443, 1011, 362, 75, |
| 160187 | | - /* 1640 */ 75, 1082, 564, 1082, 564, 924, 1561, 110, 553, 551, |
| 160188 | | - /* 1650 */ 1015, 77, 77, 1361, 74, 74, 1408, 1336, 1347, 550, |
| 160189 | | - /* 1660 */ 1414, 1265, 1256, 1244, 1243, 42, 42, 48, 48, 1011, |
| 160190 | | - /* 1670 */ 1011, 1013, 1014, 27, 1245, 1580, 490, 1021, 267, 202, |
| 160191 | | - /* 1680 */ 1333, 365, 11, 106, 106, 930, 367, 210, 369, 391, |
| 160192 | | - /* 1690 */ 107, 1395, 443, 566, 565, 223, 1390, 1011, 500, 454, |
| 160193 | | - /* 1700 */ 282, 1400, 285, 108, 556, 214, 4, 325, 1383, 1283, |
| 160194 | | - /* 1710 */ 475, 355, 1473, 1583, 1472, 1399, 371, 1222, 326, 398, |
| 160195 | | - /* 1720 */ 559, 290, 331, 197, 100, 556, 209, 4, 198, 1011, |
| 160196 | | - /* 1730 */ 1011, 1013, 1014, 27, 385, 256, 1520, 1518, 554, 1219, |
| 160197 | | - /* 1740 */ 416, 559, 83, 443, 173, 206, 182, 221, 459, 167, |
| 160198 | | - /* 1750 */ 177, 460, 175, 493, 233, 553, 79, 178, 1396, 179, |
| 160199 | | - /* 1760 */ 35, 180, 96, 1402, 443, 396, 36, 467, 1478, 1401, |
| 160200 | | - /* 1770 */ 482, 237, 1404, 399, 82, 186, 553, 1467, 89, 488, |
| 160201 | | - /* 1780 */ 190, 268, 239, 491, 1021, 340, 240, 401, 1246, 1489, |
| 160202 | | - /* 1790 */ 106, 106, 336, 509, 1294, 241, 1303, 107, 430, 443, |
| 160203 | | - /* 1800 */ 566, 565, 1302, 91, 1011, 1021, 1598, 1301, 1273, 215, |
| 160204 | | - /* 1810 */ 1597, 106, 106, 402, 877, 432, 354, 1272, 107, 1271, |
| 160205 | | - /* 1820 */ 443, 566, 565, 1596, 1566, 1011, 1293, 433, 518, 299, |
| 160206 | | - /* 1830 */ 300, 360, 95, 525, 1344, 364, 1011, 1011, 1013, 1014, |
| 160207 | | - /* 1840 */ 27, 254, 255, 1552, 436, 1551, 125, 544, 10, 379, |
| 160208 | | - /* 1850 */ 1326, 1453, 102, 97, 1345, 528, 304, 1011, 1011, 1013, |
| 160209 | | - /* 1860 */ 1014, 27, 366, 377, 1343, 1342, 368, 370, 1325, 384, |
| 160210 | | - /* 1870 */ 201, 383, 34, 1368, 1367, 568, 1177, 266, 263, 265, |
| 160211 | | - /* 1880 */ 1505, 159, 569, 1241, 1236, 1506, 160, 142, 1504, 1503, |
| 160212 | | - /* 1890 */ 297, 211, 830, 161, 212, 78, 444, 203, 308, 222, |
| 160213 | | - /* 1900 */ 1081, 139, 1079, 316, 174, 163, 1203, 229, 176, 909, |
| 160214 | | - /* 1910 */ 324, 232, 1095, 181, 409, 410, 172, 164, 165, 419, |
| 160215 | | - /* 1920 */ 183, 85, 86, 421, 166, 87, 88, 1098, 1094, 234, |
| 160216 | | - /* 1930 */ 235, 152, 18, 236, 335, 1087, 1216, 252, 187, 487, |
| 160217 | | - /* 1940 */ 238, 188, 37, 845, 492, 356, 242, 496, 351, 501, |
| 160218 | | - /* 1950 */ 189, 90, 19, 504, 348, 20, 875, 92, 298, 168, |
| 160219 | | - /* 1960 */ 888, 153, 93, 511, 94, 1165, 154, 1047, 1134, 39, |
| 160220 | | - /* 1970 */ 216, 1133, 271, 273, 958, 192, 953, 110, 1151, 1155, |
| 160221 | | - /* 1980 */ 251, 7, 21, 1159, 1139, 22, 1153, 33, 23, 24, |
| 160222 | | - /* 1990 */ 25, 540, 1158, 195, 98, 1062, 26, 1048, 1046, 1050, |
| 160223 | | - /* 2000 */ 1104, 1051, 1103, 257, 258, 28, 40, 1173, 1016, 857, |
| 160224 | | - /* 2010 */ 109, 29, 560, 388, 138, 1172, 259, 170, 260, 1232, |
| 160225 | | - /* 2020 */ 1232, 919, 1232, 1232, 1232, 1232, 1232, 1232, 1232, 1232, |
| 160226 | | - /* 2030 */ 1232, 1232, 1589, 1232, 1232, 1232, 1588, |
| 160767 | + /* 1250 */ 442, 443, 564, 517, 13, 13, 44, 44, 275, 275, |
| 160768 | + /* 1260 */ 1409, 275, 275, 553, 1353, 529, 213, 549, 456, 543, |
| 160769 | + /* 1270 */ 465, 561, 564, 137, 561, 58, 58, 469, 405, 1222, |
| 160770 | + /* 1280 */ 405, 274, 217, 108, 556, 110, 4, 405, 275, 275, |
| 160771 | + /* 1290 */ 564, 1352, 1021, 564, 1228, 59, 59, 523, 106, 106, |
| 160772 | + /* 1300 */ 559, 561, 275, 275, 412, 107, 457, 443, 566, 565, |
| 160773 | + /* 1310 */ 564, 8, 1011, 60, 60, 561, 61, 61, 564, 965, |
| 160774 | + /* 1320 */ 349, 926, 305, 443, 84, 204, 925, 966, 564, 306, |
| 160775 | + /* 1330 */ 555, 435, 405, 62, 62, 553, 476, 105, 564, 103, |
| 160776 | + /* 1340 */ 464, 45, 45, 1203, 1011, 1011, 1013, 1014, 27, 533, |
| 160777 | + /* 1350 */ 564, 46, 46, 453, 532, 1572, 1171, 445, 1528, 564, |
| 160778 | + /* 1360 */ 279, 47, 47, 327, 1021, 390, 390, 389, 264, 387, |
| 160779 | + /* 1370 */ 106, 106, 843, 49, 49, 108, 556, 107, 4, 443, |
| 160780 | + /* 1380 */ 566, 565, 50, 50, 1011, 225, 564, 313, 564, 96, |
| 160781 | + /* 1390 */ 564, 228, 559, 524, 147, 312, 38, 1123, 564, 394, |
| 160782 | + /* 1400 */ 466, 328, 280, 98, 544, 564, 17, 564, 323, 63, |
| 160783 | + /* 1410 */ 63, 64, 64, 65, 65, 443, 1011, 1011, 1013, 1014, |
| 160784 | + /* 1420 */ 27, 14, 14, 289, 564, 227, 564, 553, 66, 66, |
| 160785 | + /* 1430 */ 128, 128, 477, 162, 564, 309, 135, 564, 1003, 277, |
| 160786 | + /* 1440 */ 252, 533, 564, 1501, 564, 418, 534, 67, 67, 52, |
| 160787 | + /* 1450 */ 52, 564, 1287, 226, 564, 1500, 1021, 68, 68, 208, |
| 160788 | + /* 1460 */ 69, 69, 106, 106, 1286, 53, 53, 157, 157, 107, |
| 160789 | + /* 1470 */ 873, 443, 566, 565, 158, 158, 1011, 76, 76, 564, |
| 160790 | + /* 1480 */ 357, 564, 108, 556, 471, 4, 252, 408, 885, 884, |
| 160791 | + /* 1490 */ 356, 564, 306, 555, 564, 473, 564, 252, 481, 559, |
| 160792 | + /* 1500 */ 564, 334, 54, 54, 72, 72, 564, 230, 1011, 1011, |
| 160793 | + /* 1510 */ 1013, 1014, 27, 564, 129, 129, 449, 73, 73, 130, |
| 160794 | + /* 1520 */ 130, 564, 443, 131, 131, 519, 564, 873, 564, 127, |
| 160795 | + /* 1530 */ 127, 333, 1071, 98, 553, 1349, 156, 156, 564, 495, |
| 160796 | + /* 1540 */ 347, 249, 98, 338, 155, 155, 892, 893, 533, 136, |
| 160797 | + /* 1550 */ 136, 134, 134, 532, 341, 1171, 445, 1587, 564, 279, |
| 160798 | + /* 1560 */ 343, 132, 132, 1021, 390, 390, 389, 264, 387, 106, |
| 160799 | + /* 1570 */ 106, 843, 564, 1067, 564, 249, 107, 564, 443, 566, |
| 160800 | + /* 1580 */ 565, 133, 133, 1011, 225, 1015, 313, 108, 556, 1071, |
| 160801 | + /* 1590 */ 4, 345, 968, 969, 312, 75, 75, 77, 77, 1300, |
| 160802 | + /* 1600 */ 74, 74, 564, 1132, 559, 564, 108, 556, 959, 4, |
| 160803 | + /* 1610 */ 252, 923, 1083, 110, 1083, 1011, 1011, 1013, 1014, 27, |
| 160804 | + /* 1620 */ 1082, 1285, 1082, 559, 227, 42, 42, 443, 48, 48, |
| 160805 | + /* 1630 */ 1284, 856, 162, 145, 924, 135, 110, 352, 362, 553, |
| 160806 | + /* 1640 */ 1340, 1361, 1015, 1408, 1336, 301, 443, 1561, 1347, 550, |
| 160807 | + /* 1650 */ 1414, 551, 226, 202, 1265, 1333, 1256, 1244, 553, 1243, |
| 160808 | + /* 1660 */ 490, 1245, 1580, 267, 11, 391, 210, 223, 1021, 1390, |
| 160809 | + /* 1670 */ 1395, 282, 365, 367, 106, 106, 930, 369, 454, 285, |
| 160810 | + /* 1680 */ 1383, 107, 325, 443, 566, 565, 408, 1021, 1011, 326, |
| 160811 | + /* 1690 */ 475, 306, 555, 106, 106, 100, 556, 500, 4, 1400, |
| 160812 | + /* 1700 */ 107, 1399, 443, 566, 565, 398, 1283, 1011, 214, 355, |
| 160813 | + /* 1710 */ 1473, 290, 559, 1472, 1583, 449, 554, 371, 331, 197, |
| 160814 | + /* 1720 */ 1011, 1011, 1013, 1014, 27, 198, 209, 385, 1222, 173, |
| 160815 | + /* 1730 */ 221, 256, 1520, 1518, 1219, 443, 79, 416, 206, 1011, |
| 160816 | + /* 1740 */ 1011, 1013, 1014, 27, 83, 279, 182, 553, 82, 167, |
| 160817 | + /* 1750 */ 390, 390, 389, 264, 387, 35, 1396, 843, 1478, 459, |
| 160818 | + /* 1760 */ 175, 177, 460, 493, 178, 179, 180, 233, 96, 396, |
| 160819 | + /* 1770 */ 225, 1402, 313, 1401, 36, 1404, 1021, 467, 186, 482, |
| 160820 | + /* 1780 */ 312, 399, 106, 106, 237, 1467, 89, 1489, 488, 107, |
| 160821 | + /* 1790 */ 239, 443, 566, 565, 268, 336, 1011, 190, 491, 340, |
| 160822 | + /* 1800 */ 240, 401, 1246, 241, 509, 1294, 430, 1303, 91, 877, |
| 160823 | + /* 1810 */ 227, 215, 1566, 1302, 1301, 1273, 1598, 432, 162, 518, |
| 160824 | + /* 1820 */ 1272, 135, 1597, 354, 402, 433, 1271, 1596, 1011, 1011, |
| 160825 | + /* 1830 */ 1013, 1014, 27, 1293, 299, 360, 300, 525, 226, 95, |
| 160826 | + /* 1840 */ 254, 255, 1344, 364, 436, 125, 544, 1552, 10, 1453, |
| 160827 | + /* 1850 */ 379, 1551, 102, 304, 97, 528, 34, 568, 1177, 263, |
| 160828 | + /* 1860 */ 265, 266, 569, 1241, 1236, 172, 409, 410, 159, 383, |
| 160829 | + /* 1870 */ 377, 366, 408, 1345, 1343, 368, 370, 306, 555, 1342, |
| 160830 | + /* 1880 */ 1326, 1325, 1368, 201, 384, 1367, 1505, 1506, 160, 1504, |
| 160831 | + /* 1890 */ 1503, 142, 161, 211, 212, 78, 830, 444, 203, 308, |
| 160832 | + /* 1900 */ 297, 449, 222, 1081, 139, 1079, 316, 174, 163, 1203, |
| 160833 | + /* 1910 */ 229, 176, 232, 909, 324, 1095, 164, 181, 165, 419, |
| 160834 | + /* 1920 */ 421, 183, 85, 86, 87, 88, 166, 1098, 235, 234, |
| 160835 | + /* 1930 */ 1094, 152, 18, 236, 335, 1087, 252, 1216, 487, 238, |
| 160836 | + /* 1940 */ 37, 187, 188, 845, 492, 356, 242, 348, 496, 189, |
| 160837 | + /* 1950 */ 90, 93, 19, 20, 168, 875, 501, 351, 92, 504, |
| 160838 | + /* 1960 */ 888, 153, 511, 1133, 1165, 154, 298, 1047, 94, 1134, |
| 160839 | + /* 1970 */ 39, 958, 216, 271, 273, 192, 953, 110, 1151, 251, |
| 160840 | + /* 1980 */ 1155, 21, 1159, 22, 1158, 1139, 1153, 33, 23, 24, |
| 160841 | + /* 1990 */ 540, 25, 195, 98, 26, 1062, 1048, 1046, 1050, 1104, |
| 160842 | + /* 2000 */ 7, 1103, 257, 258, 1051, 28, 40, 560, 1016, 857, |
| 160843 | + /* 2010 */ 109, 29, 919, 138, 259, 260, 170, 1589, 388, 1588, |
| 160844 | + /* 2020 */ 1173, 1172, |
| 160227 | 160845 | }; |
| 160228 | 160846 | static const YYCODETYPE yy_lookahead[] = { |
| 160229 | 160847 | /* 0 */ 192, 273, 274, 275, 192, 192, 273, 274, 275, 192, |
| 160230 | 160848 | /* 10 */ 218, 215, 192, 218, 192, 212, 234, 235, 205, 19, |
| 160231 | 160849 | /* 20 */ 11, 192, 294, 215, 216, 203, 192, 203, 209, 210, |
| | @@ -160236,202 +160854,202 @@ |
| 160236 | 160854 | /* 70 */ 275, 237, 21, 251, 252, 251, 273, 274, 275, 255, |
| 160237 | 160855 | /* 80 */ 256, 215, 216, 43, 44, 45, 46, 47, 48, 49, |
| 160238 | 160856 | /* 90 */ 50, 51, 52, 53, 54, 55, 56, 57, 209, 210, |
| 160239 | 160857 | /* 100 */ 211, 76, 102, 103, 104, 105, 106, 107, 108, 109, |
| 160240 | 160858 | /* 110 */ 110, 111, 112, 59, 89, 111, 112, 92, 252, 307, |
| 160241 | | - /* 120 */ 308, 313, 314, 112, 312, 59, 86, 261, 88, 19, |
| 160859 | + /* 120 */ 308, 313, 314, 25, 312, 192, 86, 261, 88, 19, |
| 160242 | 160860 | /* 130 */ 313, 80, 315, 313, 314, 25, 127, 128, 54, 55, |
| 160243 | 160861 | /* 140 */ 56, 57, 102, 103, 104, 105, 106, 107, 108, 109, |
| 160244 | 160862 | /* 150 */ 110, 111, 112, 43, 44, 45, 46, 47, 48, 49, |
| 160245 | 160863 | /* 160 */ 50, 51, 52, 53, 54, 55, 56, 57, 192, 115, |
| 160246 | 160864 | /* 170 */ 116, 117, 118, 122, 192, 121, 122, 123, 202, 69, |
| 160247 | | - /* 180 */ 204, 115, 116, 117, 192, 131, 102, 103, 104, 105, |
| 160865 | + /* 180 */ 204, 22, 23, 16, 25, 131, 102, 103, 104, 105, |
| 160248 | 160866 | /* 190 */ 106, 107, 108, 109, 110, 111, 112, 215, 216, 19, |
| 160249 | 160867 | /* 200 */ 54, 55, 56, 57, 58, 108, 109, 110, 111, 112, |
| 160250 | 160868 | /* 210 */ 192, 160, 102, 103, 104, 105, 106, 107, 108, 109, |
| 160251 | 160869 | /* 220 */ 110, 111, 112, 43, 44, 45, 46, 47, 48, 49, |
| 160252 | | - /* 230 */ 50, 51, 52, 53, 54, 55, 56, 57, 19, 46, |
| 160253 | | - /* 240 */ 47, 48, 49, 24, 248, 192, 250, 67, 102, 103, |
| 160870 | + /* 230 */ 50, 51, 52, 53, 54, 55, 56, 57, 19, 141, |
| 160871 | + /* 240 */ 307, 308, 272, 24, 77, 312, 79, 67, 102, 103, |
| 160254 | 160872 | /* 250 */ 104, 105, 106, 107, 108, 109, 110, 111, 112, 277, |
| 160255 | | - /* 260 */ 127, 128, 43, 44, 45, 46, 47, 48, 49, 50, |
| 160256 | | - /* 270 */ 51, 52, 53, 54, 55, 56, 57, 26, 164, 165, |
| 160257 | | - /* 280 */ 272, 263, 102, 103, 104, 105, 106, 107, 108, 109, |
| 160873 | + /* 260 */ 101, 112, 43, 44, 45, 46, 47, 48, 49, 50, |
| 160874 | + /* 270 */ 51, 52, 53, 54, 55, 56, 57, 26, 127, 128, |
| 160875 | + /* 280 */ 310, 311, 102, 103, 104, 105, 106, 107, 108, 109, |
| 160258 | 160876 | /* 290 */ 110, 111, 112, 184, 185, 186, 187, 188, 189, 186, |
| 160259 | | - /* 300 */ 187, 188, 189, 194, 76, 196, 229, 194, 19, 196, |
| 160260 | | - /* 310 */ 59, 192, 203, 120, 59, 87, 203, 89, 310, 311, |
| 160877 | + /* 300 */ 187, 188, 189, 194, 76, 196, 192, 194, 19, 196, |
| 160878 | + /* 310 */ 59, 25, 203, 192, 59, 87, 203, 89, 164, 165, |
| 160261 | 160879 | /* 320 */ 92, 102, 103, 104, 105, 106, 107, 108, 109, 110, |
| 160262 | 160880 | /* 330 */ 111, 112, 43, 44, 45, 46, 47, 48, 49, 50, |
| 160263 | 160881 | /* 340 */ 51, 52, 53, 54, 55, 56, 57, 238, 239, 73, |
| 160264 | | - /* 350 */ 231, 238, 239, 22, 23, 100, 25, 81, 305, 306, |
| 160265 | | - /* 360 */ 251, 23, 25, 25, 251, 272, 115, 116, 117, 214, |
| 160266 | | - /* 370 */ 115, 116, 144, 192, 265, 120, 114, 222, 265, 102, |
| 160882 | + /* 350 */ 192, 238, 239, 22, 23, 100, 25, 81, 237, 229, |
| 160883 | + /* 360 */ 251, 23, 204, 25, 251, 272, 115, 116, 117, 214, |
| 160884 | + /* 370 */ 115, 116, 144, 192, 265, 120, 262, 222, 265, 102, |
| 160267 | 160885 | /* 380 */ 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, |
| 160268 | 160886 | /* 390 */ 192, 102, 103, 104, 105, 106, 107, 108, 109, 110, |
| 160269 | 160887 | /* 400 */ 111, 112, 126, 310, 311, 192, 297, 152, 153, 154, |
| 160270 | | - /* 410 */ 297, 149, 192, 137, 138, 19, 192, 100, 192, 23, |
| 160888 | + /* 410 */ 297, 125, 192, 137, 138, 19, 295, 100, 192, 23, |
| 160271 | 160889 | /* 420 */ 22, 106, 107, 108, 109, 110, 111, 112, 215, 216, |
| 160272 | 160890 | /* 430 */ 106, 107, 101, 116, 192, 215, 216, 120, 149, 43, |
| 160273 | 160891 | /* 440 */ 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, |
| 160274 | | - /* 450 */ 54, 55, 56, 57, 117, 117, 192, 59, 19, 187, |
| 160275 | | - /* 460 */ 59, 189, 23, 282, 240, 252, 194, 192, 196, 152, |
| 160276 | | - /* 470 */ 153, 154, 252, 72, 261, 203, 152, 25, 154, 142, |
| 160892 | + /* 450 */ 54, 55, 56, 57, 222, 117, 224, 59, 19, 187, |
| 160893 | + /* 460 */ 59, 189, 23, 282, 232, 252, 194, 192, 196, 152, |
| 160894 | + /* 470 */ 153, 154, 252, 72, 261, 203, 152, 248, 154, 250, |
| 160277 | 160895 | /* 480 */ 142, 261, 43, 44, 45, 46, 47, 48, 49, 50, |
| 160278 | 160896 | /* 490 */ 51, 52, 53, 54, 55, 56, 57, 192, 102, 103, |
| 160279 | 160897 | /* 500 */ 104, 105, 106, 107, 108, 109, 110, 111, 112, 267, |
| 160280 | 160898 | /* 510 */ 238, 239, 237, 115, 116, 117, 115, 116, 117, 192, |
| 160281 | | - /* 520 */ 59, 118, 16, 251, 121, 122, 123, 303, 19, 303, |
| 160282 | | - /* 530 */ 59, 267, 23, 72, 131, 308, 22, 265, 22, 312, |
| 160899 | + /* 520 */ 59, 118, 192, 251, 121, 122, 123, 73, 19, 192, |
| 160900 | + /* 530 */ 59, 192, 23, 72, 131, 308, 22, 265, 22, 312, |
| 160283 | 160901 | /* 540 */ 24, 102, 103, 104, 105, 106, 107, 108, 109, 110, |
| 160284 | 160902 | /* 550 */ 111, 112, 43, 44, 45, 46, 47, 48, 49, 50, |
| 160285 | | - /* 560 */ 51, 52, 53, 54, 55, 56, 57, 19, 81, 297, |
| 160286 | | - /* 570 */ 295, 23, 192, 59, 203, 59, 115, 116, 117, 108, |
| 160287 | | - /* 580 */ 192, 73, 25, 77, 192, 79, 115, 116, 117, 137, |
| 160288 | | - /* 590 */ 138, 43, 44, 45, 46, 47, 48, 49, 50, 51, |
| 160289 | | - /* 600 */ 52, 53, 54, 55, 56, 57, 119, 215, 216, 238, |
| 160903 | + /* 560 */ 51, 52, 53, 54, 55, 56, 57, 19, 192, 297, |
| 160904 | + /* 570 */ 192, 23, 267, 59, 203, 59, 115, 116, 117, 108, |
| 160905 | + /* 580 */ 126, 127, 128, 192, 192, 192, 115, 116, 117, 262, |
| 160906 | + /* 590 */ 59, 43, 44, 45, 46, 47, 48, 49, 50, 51, |
| 160907 | + /* 600 */ 52, 53, 54, 55, 56, 57, 267, 215, 216, 238, |
| 160290 | 160908 | /* 610 */ 239, 102, 103, 104, 105, 106, 107, 108, 109, 110, |
| 160291 | | - /* 620 */ 111, 112, 251, 192, 137, 138, 59, 234, 235, 115, |
| 160292 | | - /* 630 */ 116, 117, 116, 76, 126, 127, 128, 19, 192, 268, |
| 160293 | | - /* 640 */ 19, 23, 22, 192, 252, 24, 89, 300, 301, 92, |
| 160909 | + /* 620 */ 111, 112, 251, 45, 46, 47, 59, 49, 291, 115, |
| 160910 | + /* 630 */ 116, 117, 116, 81, 192, 305, 306, 19, 192, 268, |
| 160911 | + /* 640 */ 19, 23, 22, 192, 252, 24, 115, 116, 117, 192, |
| 160294 | 160912 | /* 650 */ 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, |
| 160295 | 160913 | /* 660 */ 112, 43, 44, 45, 46, 47, 48, 49, 50, 51, |
| 160296 | | - /* 670 */ 52, 53, 54, 55, 56, 57, 19, 192, 192, 59, |
| 160297 | | - /* 680 */ 23, 192, 115, 116, 117, 200, 240, 307, 308, 22, |
| 160298 | | - /* 690 */ 205, 81, 312, 262, 22, 192, 133, 22, 135, 136, |
| 160914 | + /* 670 */ 52, 53, 54, 55, 56, 57, 19, 22, 23, 59, |
| 160915 | + /* 680 */ 23, 303, 115, 116, 117, 192, 240, 234, 235, 137, |
| 160916 | + /* 690 */ 138, 240, 308, 192, 22, 192, 312, 22, 120, 306, |
| 160299 | 160917 | /* 700 */ 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, |
| 160300 | 160918 | /* 710 */ 53, 54, 55, 56, 57, 197, 95, 150, 215, 216, |
| 160301 | 160919 | /* 720 */ 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, |
| 160302 | | - /* 730 */ 112, 59, 192, 112, 59, 115, 116, 117, 192, 118, |
| 160303 | | - /* 740 */ 119, 120, 121, 122, 123, 124, 19, 137, 138, 303, |
| 160304 | | - /* 750 */ 23, 130, 192, 267, 192, 252, 267, 306, 203, 102, |
| 160920 | + /* 730 */ 112, 59, 231, 112, 59, 115, 116, 117, 25, 118, |
| 160921 | + /* 740 */ 119, 120, 121, 122, 123, 124, 19, 243, 81, 303, |
| 160922 | + /* 750 */ 23, 130, 192, 192, 303, 252, 101, 253, 203, 102, |
| 160305 | 160923 | /* 760 */ 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, |
| 160306 | 160924 | /* 770 */ 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, |
| 160307 | | - /* 780 */ 53, 54, 55, 56, 57, 19, 240, 115, 116, 117, |
| 160308 | | - /* 790 */ 115, 116, 117, 238, 239, 222, 192, 224, 280, 237, |
| 160309 | | - /* 800 */ 240, 192, 284, 192, 59, 232, 251, 140, 204, 43, |
| 160925 | + /* 780 */ 53, 54, 55, 56, 57, 19, 119, 115, 116, 117, |
| 160926 | + /* 790 */ 115, 116, 117, 238, 239, 238, 239, 192, 280, 192, |
| 160927 | + /* 800 */ 240, 192, 284, 192, 137, 138, 251, 192, 251, 43, |
| 160310 | 160928 | /* 810 */ 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, |
| 160311 | | - /* 820 */ 54, 55, 56, 57, 192, 35, 215, 216, 192, 102, |
| 160929 | + /* 820 */ 54, 55, 56, 57, 192, 35, 215, 216, 267, 102, |
| 160312 | 160930 | /* 830 */ 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, |
| 160313 | | - /* 840 */ 59, 230, 192, 192, 238, 239, 237, 215, 216, 303, |
| 160314 | | - /* 850 */ 308, 215, 216, 16, 312, 19, 66, 251, 126, 127, |
| 160315 | | - /* 860 */ 128, 116, 230, 303, 74, 203, 215, 216, 102, 103, |
| 160931 | + /* 840 */ 59, 230, 237, 192, 25, 192, 192, 215, 216, 240, |
| 160932 | + /* 850 */ 137, 138, 237, 16, 200, 19, 66, 192, 133, 205, |
| 160933 | + /* 860 */ 135, 136, 230, 303, 74, 203, 215, 216, 102, 103, |
| 160316 | 160934 | /* 870 */ 104, 105, 106, 107, 108, 109, 110, 111, 112, 43, |
| 160317 | 160935 | /* 880 */ 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, |
| 160318 | | - /* 890 */ 54, 55, 56, 57, 192, 212, 115, 116, 117, 19, |
| 160319 | | - /* 900 */ 238, 239, 192, 252, 7, 8, 9, 192, 192, 238, |
| 160320 | | - /* 910 */ 239, 308, 262, 251, 77, 312, 79, 215, 216, 129, |
| 160936 | + /* 890 */ 54, 55, 56, 57, 192, 76, 115, 116, 117, 19, |
| 160937 | + /* 900 */ 238, 239, 192, 252, 126, 127, 128, 192, 89, 238, |
| 160938 | + /* 910 */ 239, 92, 303, 251, 77, 262, 79, 215, 216, 129, |
| 160321 | 160939 | /* 920 */ 210, 211, 251, 142, 158, 45, 46, 47, 48, 49, |
| 160322 | 160940 | /* 930 */ 50, 51, 52, 53, 54, 55, 56, 57, 102, 103, |
| 160323 | 160941 | /* 940 */ 104, 105, 106, 107, 108, 109, 110, 111, 112, 12, |
| 160324 | | - /* 950 */ 59, 192, 192, 237, 252, 243, 192, 192, 126, 127, |
| 160325 | | - /* 960 */ 128, 192, 308, 203, 27, 253, 312, 308, 285, 207, |
| 160326 | | - /* 970 */ 208, 312, 157, 290, 159, 215, 216, 262, 192, 42, |
| 160942 | + /* 950 */ 59, 308, 192, 212, 252, 312, 291, 192, 7, 8, |
| 160943 | + /* 960 */ 9, 300, 301, 203, 27, 126, 127, 128, 308, 207, |
| 160944 | + /* 970 */ 208, 192, 312, 29, 192, 215, 216, 33, 192, 42, |
| 160327 | 160945 | /* 980 */ 215, 216, 102, 103, 104, 105, 106, 107, 108, 109, |
| 160328 | | - /* 990 */ 110, 111, 112, 283, 158, 230, 237, 160, 238, 239, |
| 160329 | | - /* 1000 */ 63, 215, 216, 192, 192, 12, 115, 116, 117, 22, |
| 160330 | | - /* 1010 */ 73, 251, 252, 192, 19, 192, 230, 239, 24, 24, |
| 160331 | | - /* 1020 */ 27, 261, 210, 211, 99, 192, 215, 216, 225, 251, |
| 160332 | | - /* 1030 */ 192, 192, 263, 142, 19, 42, 215, 216, 43, 44, |
| 160946 | + /* 990 */ 110, 111, 112, 283, 158, 230, 66, 160, 238, 239, |
| 160947 | + /* 1000 */ 63, 215, 216, 192, 192, 12, 115, 116, 117, 65, |
| 160948 | + /* 1010 */ 73, 251, 252, 192, 19, 85, 230, 192, 24, 24, |
| 160949 | + /* 1020 */ 27, 261, 210, 211, 94, 192, 215, 216, 22, 207, |
| 160950 | + /* 1030 */ 208, 290, 192, 142, 19, 42, 215, 216, 43, 44, |
| 160333 | 160951 | /* 1040 */ 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, |
| 160334 | | - /* 1050 */ 55, 56, 57, 59, 19, 291, 63, 132, 43, 44, |
| 160952 | + /* 1050 */ 55, 56, 57, 59, 19, 144, 63, 192, 43, 44, |
| 160335 | 160953 | /* 1060 */ 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, |
| 160336 | | - /* 1070 */ 55, 56, 57, 252, 22, 23, 22, 25, 43, 44, |
| 160954 | + /* 1070 */ 55, 56, 57, 252, 163, 145, 114, 22, 43, 44, |
| 160337 | 160955 | /* 1080 */ 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, |
| 160338 | | - /* 1090 */ 55, 56, 57, 106, 107, 283, 263, 102, 103, 104, |
| 160956 | + /* 1090 */ 55, 56, 57, 45, 212, 283, 263, 102, 103, 104, |
| 160339 | 160957 | /* 1100 */ 105, 106, 107, 108, 109, 110, 111, 112, 59, 192, |
| 160340 | | - /* 1110 */ 116, 144, 29, 59, 291, 192, 33, 102, 103, 104, |
| 160341 | | - /* 1120 */ 105, 106, 107, 108, 109, 110, 111, 112, 192, 291, |
| 160342 | | - /* 1130 */ 163, 19, 215, 216, 15, 192, 108, 102, 103, 104, |
| 160343 | | - /* 1140 */ 105, 106, 107, 108, 109, 110, 111, 112, 65, 192, |
| 160344 | | - /* 1150 */ 66, 215, 216, 101, 231, 106, 107, 19, 215, 216, |
| 160345 | | - /* 1160 */ 192, 212, 134, 114, 115, 116, 117, 139, 119, 85, |
| 160346 | | - /* 1170 */ 116, 207, 208, 230, 192, 19, 127, 192, 94, 60, |
| 160958 | + /* 1110 */ 116, 149, 106, 107, 59, 25, 291, 102, 103, 104, |
| 160959 | + /* 1120 */ 105, 106, 107, 108, 109, 110, 111, 112, 192, 22, |
| 160960 | + /* 1130 */ 192, 192, 215, 216, 23, 192, 25, 102, 103, 104, |
| 160961 | + /* 1140 */ 105, 106, 107, 108, 109, 110, 111, 112, 108, 192, |
| 160962 | + /* 1150 */ 192, 215, 216, 215, 216, 106, 107, 19, 215, 216, |
| 160963 | + /* 1160 */ 53, 59, 114, 114, 115, 116, 117, 285, 119, 137, |
| 160964 | + /* 1170 */ 138, 116, 290, 230, 134, 192, 127, 192, 192, 139, |
| 160347 | 160965 | /* 1180 */ 59, 192, 44, 45, 46, 47, 48, 49, 50, 51, |
| 160348 | | - /* 1190 */ 52, 53, 54, 55, 56, 57, 192, 76, 192, 31, |
| 160349 | | - /* 1200 */ 192, 152, 46, 154, 215, 216, 192, 39, 87, 192, |
| 160350 | | - /* 1210 */ 89, 19, 20, 92, 22, 192, 22, 23, 22, 230, |
| 160351 | | - /* 1220 */ 263, 215, 216, 215, 216, 137, 138, 115, 36, 145, |
| 160352 | | - /* 1230 */ 128, 192, 215, 216, 22, 23, 115, 116, 117, 290, |
| 160966 | + /* 1190 */ 52, 53, 54, 55, 56, 57, 308, 76, 215, 216, |
| 160967 | + /* 1200 */ 312, 152, 263, 154, 215, 216, 192, 117, 87, 19, |
| 160968 | + /* 1210 */ 89, 19, 20, 92, 22, 22, 23, 231, 116, 230, |
| 160969 | + /* 1220 */ 263, 263, 237, 203, 298, 299, 203, 239, 36, 215, |
| 160970 | + /* 1230 */ 216, 192, 142, 192, 15, 45, 115, 116, 117, 251, |
| 160353 | 160971 | /* 1240 */ 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, |
| 160354 | | - /* 1250 */ 112, 59, 192, 151, 215, 216, 192, 61, 203, 298, |
| 160355 | | - /* 1260 */ 299, 192, 192, 71, 25, 144, 203, 192, 203, 230, |
| 160356 | | - /* 1270 */ 114, 19, 20, 81, 22, 215, 216, 263, 192, 215, |
| 160357 | | - /* 1280 */ 216, 255, 256, 203, 215, 216, 130, 19, 36, 192, |
| 160358 | | - /* 1290 */ 215, 216, 100, 238, 239, 101, 25, 192, 106, 107, |
| 160359 | | - /* 1300 */ 48, 238, 239, 238, 239, 113, 251, 115, 116, 117, |
| 160360 | | - /* 1310 */ 192, 59, 120, 101, 251, 192, 251, 192, 238, 239, |
| 160361 | | - /* 1320 */ 215, 216, 192, 71, 46, 243, 192, 25, 25, 137, |
| 160362 | | - /* 1330 */ 138, 251, 192, 215, 216, 253, 25, 85, 215, 216, |
| 160363 | | - /* 1340 */ 215, 216, 90, 243, 152, 153, 154, 155, 156, 215, |
| 160364 | | - /* 1350 */ 216, 192, 100, 253, 243, 215, 216, 192, 106, 107, |
| 160365 | | - /* 1360 */ 243, 192, 148, 149, 253, 113, 192, 115, 116, 117, |
| 160366 | | - /* 1370 */ 253, 192, 120, 192, 215, 216, 192, 23, 192, 25, |
| 160367 | | - /* 1380 */ 215, 216, 192, 115, 215, 216, 22, 148, 24, 215, |
| 160368 | | - /* 1390 */ 216, 192, 114, 192, 215, 216, 215, 216, 134, 215, |
| 160369 | | - /* 1400 */ 216, 215, 216, 139, 152, 153, 154, 155, 156, 0, |
| 160370 | | - /* 1410 */ 1, 2, 141, 23, 5, 25, 215, 216, 24, 10, |
| 160371 | | - /* 1420 */ 11, 12, 13, 14, 1, 2, 17, 125, 5, 19, |
| 160372 | | - /* 1430 */ 20, 268, 22, 10, 11, 12, 13, 14, 192, 30, |
| 160373 | | - /* 1440 */ 17, 32, 23, 23, 25, 25, 36, 144, 23, 40, |
| 160374 | | - /* 1450 */ 25, 192, 141, 30, 192, 32, 23, 22, 25, 5, |
| 160375 | | - /* 1460 */ 128, 215, 216, 40, 10, 11, 12, 13, 14, 59, |
| 160376 | | - /* 1470 */ 23, 17, 25, 192, 215, 216, 192, 215, 216, 70, |
| 160377 | | - /* 1480 */ 23, 71, 25, 151, 30, 192, 32, 78, 53, 192, |
| 160378 | | - /* 1490 */ 81, 192, 192, 70, 40, 85, 215, 216, 119, 120, |
| 160379 | | - /* 1500 */ 90, 78, 59, 254, 81, 192, 192, 98, 215, 216, |
| 160380 | | - /* 1510 */ 100, 23, 59, 25, 215, 216, 106, 107, 23, 192, |
| 160381 | | - /* 1520 */ 25, 98, 19, 113, 70, 115, 116, 117, 215, 216, |
| 160382 | | - /* 1530 */ 120, 192, 78, 192, 140, 81, 19, 20, 23, 22, |
| 160383 | | - /* 1540 */ 25, 132, 215, 216, 192, 192, 137, 138, 192, 23, |
| 160384 | | - /* 1550 */ 192, 25, 98, 36, 192, 132, 215, 216, 192, 116, |
| 160385 | | - /* 1560 */ 137, 138, 152, 153, 154, 155, 156, 215, 216, 116, |
| 160386 | | - /* 1570 */ 161, 215, 216, 215, 216, 120, 59, 215, 216, 7, |
| 160387 | | - /* 1580 */ 8, 215, 216, 192, 161, 130, 132, 192, 71, 83, |
| 160388 | | - /* 1590 */ 84, 137, 138, 59, 192, 192, 19, 20, 192, 22, |
| 160389 | | - /* 1600 */ 97, 225, 85, 192, 23, 192, 25, 90, 192, 192, |
| 160390 | | - /* 1610 */ 215, 216, 152, 36, 154, 161, 192, 100, 215, 216, |
| 160391 | | - /* 1620 */ 192, 215, 216, 106, 107, 225, 215, 216, 192, 192, |
| 160392 | | - /* 1630 */ 113, 192, 115, 116, 117, 257, 59, 120, 192, 215, |
| 160393 | | - /* 1640 */ 216, 152, 192, 154, 192, 23, 317, 25, 71, 235, |
| 160394 | | - /* 1650 */ 116, 215, 216, 192, 215, 216, 192, 192, 192, 192, |
| 160395 | | - /* 1660 */ 192, 192, 192, 192, 192, 215, 216, 215, 216, 152, |
| 160396 | | - /* 1670 */ 153, 154, 155, 156, 192, 192, 287, 100, 286, 241, |
| 160397 | | - /* 1680 */ 254, 254, 242, 106, 107, 108, 254, 213, 254, 190, |
| 160398 | | - /* 1690 */ 113, 270, 115, 116, 117, 296, 266, 120, 219, 258, |
| 160399 | | - /* 1700 */ 244, 270, 258, 19, 20, 228, 22, 292, 266, 224, |
| 160400 | | - /* 1710 */ 292, 218, 218, 195, 218, 270, 258, 60, 245, 270, |
| 160401 | | - /* 1720 */ 36, 245, 244, 248, 19, 20, 242, 22, 248, 152, |
| 160402 | | - /* 1730 */ 153, 154, 155, 156, 244, 140, 199, 199, 279, 38, |
| 160403 | | - /* 1740 */ 199, 36, 150, 59, 296, 149, 22, 296, 18, 43, |
| 160404 | | - /* 1750 */ 236, 199, 233, 18, 198, 71, 293, 236, 271, 236, |
| 160405 | | - /* 1760 */ 269, 236, 148, 271, 59, 245, 269, 245, 282, 271, |
| 160406 | | - /* 1770 */ 199, 198, 233, 245, 293, 233, 71, 245, 157, 62, |
| 160407 | | - /* 1780 */ 22, 199, 198, 220, 100, 199, 198, 220, 199, 289, |
| 160408 | | - /* 1790 */ 106, 107, 288, 114, 226, 198, 217, 113, 64, 115, |
| 160409 | | - /* 1800 */ 116, 117, 217, 22, 120, 100, 223, 217, 217, 164, |
| 160410 | | - /* 1810 */ 223, 106, 107, 220, 125, 24, 217, 219, 113, 217, |
| 160411 | | - /* 1820 */ 115, 116, 117, 217, 311, 120, 226, 112, 304, 281, |
| 160412 | | - /* 1830 */ 281, 220, 114, 143, 260, 259, 152, 153, 154, 155, |
| 160413 | | - /* 1840 */ 156, 199, 91, 316, 82, 316, 147, 144, 22, 199, |
| 160414 | | - /* 1850 */ 249, 276, 157, 146, 260, 145, 278, 152, 153, 154, |
| 160415 | | - /* 1860 */ 155, 156, 259, 248, 260, 260, 259, 259, 249, 245, |
| 160416 | | - /* 1870 */ 247, 246, 25, 264, 264, 201, 13, 6, 193, 193, |
| 160417 | | - /* 1880 */ 212, 206, 191, 191, 191, 212, 206, 221, 212, 212, |
| 160418 | | - /* 1890 */ 221, 213, 4, 206, 213, 212, 3, 22, 162, 15, |
| 160419 | | - /* 1900 */ 23, 16, 23, 138, 150, 129, 25, 24, 141, 20, |
| 160420 | | - /* 1910 */ 16, 143, 1, 141, 302, 302, 299, 129, 129, 61, |
| 160421 | | - /* 1920 */ 150, 53, 53, 37, 129, 53, 53, 115, 1, 34, |
| 160422 | | - /* 1930 */ 140, 5, 22, 114, 160, 68, 75, 25, 68, 41, |
| 160423 | | - /* 1940 */ 140, 114, 24, 20, 19, 130, 124, 67, 24, 67, |
| 160424 | | - /* 1950 */ 22, 22, 22, 96, 23, 22, 59, 22, 67, 37, |
| 160425 | | - /* 1960 */ 28, 23, 148, 22, 25, 23, 23, 23, 23, 22, |
| 160426 | | - /* 1970 */ 140, 97, 23, 23, 115, 22, 142, 25, 88, 75, |
| 160427 | | - /* 1980 */ 34, 44, 34, 75, 23, 34, 86, 22, 34, 34, |
| 160428 | | - /* 1990 */ 34, 24, 93, 25, 25, 23, 34, 23, 23, 23, |
| 160429 | | - /* 2000 */ 23, 11, 23, 25, 22, 22, 22, 1, 23, 23, |
| 160430 | | - /* 2010 */ 22, 22, 25, 15, 23, 1, 140, 25, 140, 318, |
| 160431 | | - /* 2020 */ 318, 134, 318, 318, 318, 318, 318, 318, 318, 318, |
| 160432 | | - /* 2030 */ 318, 318, 140, 318, 318, 318, 140, 318, 318, 318, |
| 160972 | + /* 1250 */ 112, 59, 192, 203, 215, 216, 215, 216, 238, 239, |
| 160973 | + /* 1260 */ 192, 238, 239, 71, 192, 144, 25, 203, 243, 230, |
| 160974 | + /* 1270 */ 243, 251, 192, 81, 251, 215, 216, 243, 253, 60, |
| 160975 | + /* 1280 */ 253, 255, 256, 19, 20, 25, 22, 253, 238, 239, |
| 160976 | + /* 1290 */ 192, 192, 100, 192, 101, 215, 216, 19, 106, 107, |
| 160977 | + /* 1300 */ 36, 251, 238, 239, 114, 113, 192, 115, 116, 117, |
| 160978 | + /* 1310 */ 192, 47, 120, 215, 216, 251, 215, 216, 192, 31, |
| 160979 | + /* 1320 */ 130, 134, 243, 59, 148, 149, 139, 39, 192, 137, |
| 160980 | + /* 1330 */ 138, 263, 253, 215, 216, 71, 19, 157, 192, 159, |
| 160981 | + /* 1340 */ 128, 215, 216, 25, 152, 153, 154, 155, 156, 85, |
| 160982 | + /* 1350 */ 192, 215, 216, 268, 90, 0, 1, 2, 192, 192, |
| 160983 | + /* 1360 */ 5, 215, 216, 151, 100, 10, 11, 12, 13, 14, |
| 160984 | + /* 1370 */ 106, 107, 17, 215, 216, 19, 20, 113, 22, 115, |
| 160985 | + /* 1380 */ 116, 117, 215, 216, 120, 30, 192, 32, 192, 148, |
| 160986 | + /* 1390 */ 192, 24, 36, 115, 22, 40, 24, 23, 192, 25, |
| 160987 | + /* 1400 */ 128, 23, 99, 25, 144, 192, 22, 192, 192, 215, |
| 160988 | + /* 1410 */ 216, 215, 216, 215, 216, 59, 152, 153, 154, 155, |
| 160989 | + /* 1420 */ 156, 215, 216, 151, 192, 70, 192, 71, 215, 216, |
| 160990 | + /* 1430 */ 215, 216, 115, 78, 192, 132, 81, 192, 23, 22, |
| 160991 | + /* 1440 */ 25, 85, 192, 192, 192, 61, 90, 215, 216, 215, |
| 160992 | + /* 1450 */ 216, 192, 225, 98, 192, 192, 100, 215, 216, 141, |
| 160993 | + /* 1460 */ 215, 216, 106, 107, 225, 215, 216, 215, 216, 113, |
| 160994 | + /* 1470 */ 59, 115, 116, 117, 215, 216, 120, 215, 216, 192, |
| 160995 | + /* 1480 */ 120, 192, 19, 20, 23, 22, 25, 132, 119, 120, |
| 160996 | + /* 1490 */ 130, 192, 137, 138, 192, 23, 192, 25, 192, 36, |
| 160997 | + /* 1500 */ 192, 192, 215, 216, 215, 216, 192, 140, 152, 153, |
| 160998 | + /* 1510 */ 154, 155, 156, 192, 215, 216, 161, 215, 216, 215, |
| 160999 | + /* 1520 */ 216, 192, 59, 215, 216, 19, 192, 116, 192, 215, |
| 161000 | + /* 1530 */ 216, 23, 59, 25, 71, 192, 215, 216, 192, 23, |
| 161001 | + /* 1540 */ 23, 25, 25, 192, 215, 216, 7, 8, 85, 215, |
| 161002 | + /* 1550 */ 216, 215, 216, 90, 192, 1, 2, 140, 192, 5, |
| 161003 | + /* 1560 */ 192, 215, 216, 100, 10, 11, 12, 13, 14, 106, |
| 161004 | + /* 1570 */ 107, 17, 192, 23, 192, 25, 113, 192, 115, 116, |
| 161005 | + /* 1580 */ 117, 215, 216, 120, 30, 59, 32, 19, 20, 116, |
| 161006 | + /* 1590 */ 22, 192, 83, 84, 40, 215, 216, 215, 216, 192, |
| 161007 | + /* 1600 */ 215, 216, 192, 97, 36, 192, 19, 20, 23, 22, |
| 161008 | + /* 1610 */ 25, 23, 152, 25, 154, 152, 153, 154, 155, 156, |
| 161009 | + /* 1620 */ 152, 225, 154, 36, 70, 215, 216, 59, 215, 216, |
| 161010 | + /* 1630 */ 192, 23, 78, 25, 23, 81, 25, 192, 192, 71, |
| 161011 | + /* 1640 */ 257, 192, 116, 192, 192, 254, 59, 317, 192, 192, |
| 161012 | + /* 1650 */ 192, 235, 98, 241, 192, 254, 192, 192, 71, 192, |
| 161013 | + /* 1660 */ 287, 192, 192, 286, 242, 190, 213, 296, 100, 266, |
| 161014 | + /* 1670 */ 270, 244, 254, 254, 106, 107, 108, 254, 258, 258, |
| 161015 | + /* 1680 */ 266, 113, 292, 115, 116, 117, 132, 100, 120, 245, |
| 161016 | + /* 1690 */ 292, 137, 138, 106, 107, 19, 20, 219, 22, 270, |
| 161017 | + /* 1700 */ 113, 270, 115, 116, 117, 270, 224, 120, 228, 218, |
| 161018 | + /* 1710 */ 218, 245, 36, 218, 195, 161, 279, 258, 244, 248, |
| 161019 | + /* 1720 */ 152, 153, 154, 155, 156, 248, 242, 244, 60, 296, |
| 161020 | + /* 1730 */ 296, 140, 199, 199, 38, 59, 293, 199, 149, 152, |
| 161021 | + /* 1740 */ 153, 154, 155, 156, 150, 5, 22, 71, 293, 43, |
| 161022 | + /* 1750 */ 10, 11, 12, 13, 14, 269, 271, 17, 282, 18, |
| 161023 | + /* 1760 */ 233, 236, 199, 18, 236, 236, 236, 198, 148, 245, |
| 161024 | + /* 1770 */ 30, 271, 32, 271, 269, 233, 100, 245, 233, 199, |
| 161025 | + /* 1780 */ 40, 245, 106, 107, 198, 245, 157, 289, 62, 113, |
| 161026 | + /* 1790 */ 198, 115, 116, 117, 199, 288, 120, 22, 220, 199, |
| 161027 | + /* 1800 */ 198, 220, 199, 198, 114, 226, 64, 217, 22, 125, |
| 161028 | + /* 1810 */ 70, 164, 311, 217, 217, 217, 223, 24, 78, 304, |
| 161029 | + /* 1820 */ 219, 81, 223, 217, 220, 112, 217, 217, 152, 153, |
| 161030 | + /* 1830 */ 154, 155, 156, 226, 281, 220, 281, 143, 98, 114, |
| 161031 | + /* 1840 */ 199, 91, 260, 259, 82, 147, 144, 316, 22, 276, |
| 161032 | + /* 1850 */ 199, 316, 157, 278, 146, 145, 25, 201, 13, 193, |
| 161033 | + /* 1860 */ 193, 6, 191, 191, 191, 299, 302, 302, 206, 246, |
| 161034 | + /* 1870 */ 248, 259, 132, 260, 260, 259, 259, 137, 138, 260, |
| 161035 | + /* 1880 */ 249, 249, 264, 247, 245, 264, 212, 212, 206, 212, |
| 161036 | + /* 1890 */ 212, 221, 206, 213, 213, 212, 4, 3, 22, 162, |
| 161037 | + /* 1900 */ 221, 161, 15, 23, 16, 23, 138, 150, 129, 25, |
| 161038 | + /* 1910 */ 24, 141, 143, 20, 16, 1, 129, 141, 129, 61, |
| 161039 | + /* 1920 */ 37, 150, 53, 53, 53, 53, 129, 115, 140, 34, |
| 161040 | + /* 1930 */ 1, 5, 22, 114, 160, 68, 25, 75, 41, 140, |
| 161041 | + /* 1940 */ 24, 68, 114, 20, 19, 130, 124, 23, 67, 22, |
| 161042 | + /* 1950 */ 22, 148, 22, 22, 37, 59, 67, 24, 22, 96, |
| 161043 | + /* 1960 */ 28, 23, 22, 97, 23, 23, 67, 23, 25, 23, |
| 161044 | + /* 1970 */ 22, 115, 140, 23, 23, 22, 142, 25, 88, 34, |
| 161045 | + /* 1980 */ 75, 34, 75, 34, 93, 23, 86, 22, 34, 34, |
| 161046 | + /* 1990 */ 24, 34, 25, 25, 34, 23, 23, 23, 23, 23, |
| 161047 | + /* 2000 */ 44, 23, 25, 22, 11, 22, 22, 25, 23, 23, |
| 161048 | + /* 2010 */ 22, 22, 134, 23, 140, 140, 25, 140, 15, 140, |
| 161049 | + /* 2020 */ 1, 1, 318, 318, 318, 318, 318, 318, 318, 318, |
| 161050 | + /* 2030 */ 318, 318, 318, 318, 318, 318, 318, 318, 318, 318, |
| 160433 | 161051 | /* 2040 */ 318, 318, 318, 318, 318, 318, 318, 318, 318, 318, |
| 160434 | 161052 | /* 2050 */ 318, 318, 318, 318, 318, 318, 318, 318, 318, 318, |
| 160435 | 161053 | /* 2060 */ 318, 318, 318, 318, 318, 318, 318, 318, 318, 318, |
| 160436 | 161054 | /* 2070 */ 318, 318, 318, 318, 318, 318, 318, 318, 318, 318, |
| 160437 | 161055 | /* 2080 */ 318, 318, 318, 318, 318, 318, 318, 318, 318, 318, |
| | @@ -160444,122 +161062,120 @@ |
| 160444 | 161062 | /* 2150 */ 318, 318, 318, 318, 318, 318, 318, 318, 318, 318, |
| 160445 | 161063 | /* 2160 */ 318, 318, 318, 318, 318, 318, 318, 318, 318, 318, |
| 160446 | 161064 | /* 2170 */ 318, 318, 318, 318, 318, 318, 318, 318, 318, 318, |
| 160447 | 161065 | /* 2180 */ 318, 318, 318, 318, 318, 318, 318, 318, 318, 318, |
| 160448 | 161066 | /* 2190 */ 318, 318, 318, 318, 318, 318, 318, 318, 318, 318, |
| 160449 | | - /* 2200 */ 318, 318, 318, 318, 318, 318, 318, 318, 318, 318, |
| 160450 | | - /* 2210 */ 318, 318, 318, 318, 318, 318, 318, 318, 318, 318, |
| 160451 | | - /* 2220 */ 318, |
| 161067 | + /* 2200 */ 318, 318, 318, 318, 318, 318, |
| 160452 | 161068 | }; |
| 160453 | 161069 | #define YY_SHIFT_COUNT (571) |
| 160454 | 161070 | #define YY_SHIFT_MIN (0) |
| 160455 | | -#define YY_SHIFT_MAX (2014) |
| 161071 | +#define YY_SHIFT_MAX (2020) |
| 160456 | 161072 | static const unsigned short int yy_shift_ofst[] = { |
| 160457 | | - /* 0 */ 1423, 1409, 1454, 1192, 1192, 610, 1252, 1410, 1517, 1684, |
| 160458 | | - /* 10 */ 1684, 1684, 276, 0, 0, 180, 1015, 1684, 1684, 1684, |
| 160459 | | - /* 20 */ 1684, 1684, 1684, 1684, 1684, 1684, 1684, 1684, 1684, 1684, |
| 160460 | | - /* 30 */ 1049, 1049, 1121, 1121, 54, 487, 610, 610, 610, 610, |
| 160461 | | - /* 40 */ 610, 40, 110, 219, 289, 396, 439, 509, 548, 618, |
| 161073 | + /* 0 */ 1554, 1355, 1740, 1192, 1192, 552, 1264, 1356, 1463, 1587, |
| 161074 | + /* 10 */ 1587, 1587, 276, 0, 0, 180, 1015, 1587, 1587, 1587, |
| 161075 | + /* 20 */ 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, |
| 161076 | + /* 30 */ 1049, 1049, 1121, 1121, 54, 667, 552, 552, 552, 552, |
| 161077 | + /* 40 */ 552, 40, 110, 219, 289, 396, 439, 509, 548, 618, |
| 160462 | 161078 | /* 50 */ 657, 727, 766, 836, 995, 1015, 1015, 1015, 1015, 1015, |
| 160463 | 161079 | /* 60 */ 1015, 1015, 1015, 1015, 1015, 1015, 1015, 1015, 1015, 1015, |
| 160464 | | - /* 70 */ 1015, 1015, 1015, 1035, 1015, 1138, 880, 880, 1577, 1684, |
| 160465 | | - /* 80 */ 1684, 1684, 1684, 1684, 1684, 1684, 1684, 1684, 1684, 1684, |
| 160466 | | - /* 90 */ 1684, 1684, 1684, 1684, 1684, 1684, 1684, 1684, 1684, 1684, |
| 160467 | | - /* 100 */ 1684, 1684, 1684, 1684, 1684, 1684, 1684, 1684, 1684, 1684, |
| 160468 | | - /* 110 */ 1684, 1684, 1684, 1705, 1684, 1684, 1684, 1684, 1684, 1684, |
| 160469 | | - /* 120 */ 1684, 1684, 1684, 1684, 1684, 1684, 1684, 146, 84, 84, |
| 160470 | | - /* 130 */ 84, 84, 84, 277, 315, 401, 97, 461, 251, 66, |
| 160471 | | - /* 140 */ 66, 51, 1156, 66, 66, 324, 324, 66, 452, 452, |
| 160472 | | - /* 150 */ 452, 452, 133, 114, 114, 4, 11, 2037, 2037, 621, |
| 161080 | + /* 70 */ 1015, 1015, 1015, 1035, 1015, 1138, 880, 880, 1568, 1587, |
| 161081 | + /* 80 */ 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, |
| 161082 | + /* 90 */ 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, |
| 161083 | + /* 100 */ 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, |
| 161084 | + /* 110 */ 1587, 1587, 1587, 1676, 1587, 1587, 1587, 1587, 1587, 1587, |
| 161085 | + /* 120 */ 1587, 1587, 1587, 1587, 1587, 1587, 1587, 146, 84, 84, |
| 161086 | + /* 130 */ 84, 84, 84, 277, 315, 401, 97, 461, 251, 531, |
| 161087 | + /* 140 */ 531, 51, 1190, 531, 531, 324, 324, 531, 713, 713, |
| 161088 | + /* 150 */ 713, 713, 151, 154, 154, 4, 149, 2022, 2022, 621, |
| 160473 | 161089 | /* 160 */ 621, 621, 567, 398, 398, 398, 398, 937, 937, 228, |
| 160474 | | - /* 170 */ 251, 331, 1052, 66, 66, 66, 66, 66, 66, 66, |
| 160475 | | - /* 180 */ 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, |
| 160476 | | - /* 190 */ 66, 66, 66, 557, 557, 66, 9, 25, 25, 745, |
| 160477 | | - /* 200 */ 745, 967, 1088, 2037, 2037, 2037, 2037, 2037, 2037, 2037, |
| 161090 | + /* 170 */ 251, 159, 331, 531, 531, 531, 531, 531, 531, 531, |
| 161091 | + /* 180 */ 531, 531, 531, 531, 531, 531, 531, 531, 531, 531, |
| 161092 | + /* 190 */ 531, 531, 531, 819, 819, 531, 9, 25, 25, 1102, |
| 161093 | + /* 200 */ 1102, 911, 1032, 2022, 2022, 2022, 2022, 2022, 2022, 2022, |
| 160478 | 161094 | /* 210 */ 255, 317, 317, 514, 403, 620, 471, 672, 781, 891, |
| 160479 | | - /* 220 */ 675, 66, 66, 66, 66, 66, 66, 66, 66, 66, |
| 160480 | | - /* 230 */ 66, 508, 66, 66, 66, 66, 66, 66, 66, 66, |
| 160481 | | - /* 240 */ 66, 66, 66, 66, 790, 790, 790, 66, 66, 66, |
| 160482 | | - /* 250 */ 338, 66, 66, 66, 516, 1084, 66, 66, 993, 66, |
| 160483 | | - /* 260 */ 66, 66, 66, 66, 66, 66, 66, 732, 1083, 563, |
| 160484 | | - /* 270 */ 994, 994, 994, 994, 337, 563, 563, 1028, 987, 897, |
| 160485 | | - /* 280 */ 1119, 262, 1214, 1271, 1112, 1214, 1112, 1268, 1239, 262, |
| 160486 | | - /* 290 */ 262, 1239, 262, 1271, 1268, 1302, 1354, 1278, 1168, 1168, |
| 160487 | | - /* 300 */ 1168, 1112, 1303, 1303, 815, 1311, 1264, 1364, 1657, 1657, |
| 160488 | | - /* 310 */ 1595, 1595, 1701, 1701, 1595, 1592, 1596, 1724, 1706, 1730, |
| 160489 | | - /* 320 */ 1730, 1730, 1730, 1595, 1735, 1614, 1596, 1596, 1614, 1724, |
| 160490 | | - /* 330 */ 1706, 1614, 1706, 1614, 1595, 1735, 1621, 1717, 1595, 1735, |
| 160491 | | - /* 340 */ 1758, 1595, 1735, 1595, 1735, 1758, 1679, 1679, 1679, 1734, |
| 160492 | | - /* 350 */ 1781, 1781, 1758, 1679, 1689, 1679, 1734, 1679, 1679, 1645, |
| 160493 | | - /* 360 */ 1791, 1715, 1715, 1758, 1690, 1718, 1690, 1718, 1690, 1718, |
| 160494 | | - /* 370 */ 1690, 1718, 1595, 1751, 1751, 1762, 1762, 1699, 1703, 1826, |
| 160495 | | - /* 380 */ 1595, 1695, 1699, 1707, 1710, 1614, 1847, 1863, 1863, 1871, |
| 160496 | | - /* 390 */ 1871, 1871, 2037, 2037, 2037, 2037, 2037, 2037, 2037, 2037, |
| 160497 | | - /* 400 */ 2037, 2037, 2037, 2037, 2037, 2037, 2037, 193, 837, 1194, |
| 160498 | | - /* 410 */ 1212, 506, 832, 1054, 1390, 925, 1435, 1394, 1102, 1332, |
| 160499 | | - /* 420 */ 1419, 1196, 1420, 1425, 1433, 1447, 1457, 1488, 1443, 1379, |
| 160500 | | - /* 430 */ 1572, 1455, 1503, 1453, 1495, 1515, 1506, 1526, 1460, 1489, |
| 160501 | | - /* 440 */ 1581, 1622, 1534, 667, 1888, 1893, 1875, 1736, 1884, 1885, |
| 160502 | | - /* 450 */ 1877, 1879, 1765, 1754, 1776, 1881, 1881, 1883, 1767, 1889, |
| 160503 | | - /* 460 */ 1768, 1894, 1911, 1772, 1788, 1881, 1789, 1858, 1886, 1881, |
| 160504 | | - /* 470 */ 1770, 1868, 1869, 1872, 1873, 1795, 1812, 1895, 1790, 1927, |
| 160505 | | - /* 480 */ 1926, 1910, 1819, 1774, 1867, 1912, 1870, 1861, 1898, 1800, |
| 160506 | | - /* 490 */ 1827, 1918, 1923, 1925, 1815, 1822, 1928, 1880, 1929, 1930, |
| 160507 | | - /* 500 */ 1931, 1933, 1882, 1897, 1924, 1857, 1932, 1935, 1891, 1922, |
| 160508 | | - /* 510 */ 1938, 1814, 1941, 1942, 1943, 1944, 1939, 1945, 1947, 1874, |
| 160509 | | - /* 520 */ 1830, 1949, 1950, 1859, 1946, 1953, 1834, 1952, 1948, 1951, |
| 160510 | | - /* 530 */ 1954, 1955, 1890, 1904, 1900, 1937, 1908, 1899, 1956, 1961, |
| 160511 | | - /* 540 */ 1965, 1967, 1968, 1969, 1962, 1972, 1952, 1974, 1975, 1976, |
| 160512 | | - /* 550 */ 1977, 1978, 1979, 1982, 1990, 1983, 1984, 1985, 1986, 1988, |
| 160513 | | - /* 560 */ 1989, 1987, 1887, 1876, 1878, 1892, 1896, 1992, 1991, 1998, |
| 160514 | | - /* 570 */ 2006, 2014, |
| 161095 | + /* 220 */ 675, 531, 531, 531, 531, 531, 531, 531, 531, 531, |
| 161096 | + /* 230 */ 531, 454, 531, 531, 531, 531, 531, 531, 531, 531, |
| 161097 | + /* 240 */ 531, 531, 531, 531, 790, 790, 790, 531, 531, 531, |
| 161098 | + /* 250 */ 338, 531, 531, 531, 516, 930, 531, 531, 993, 531, |
| 161099 | + /* 260 */ 531, 531, 531, 531, 531, 531, 531, 778, 944, 725, |
| 161100 | + /* 270 */ 994, 994, 994, 994, 1090, 725, 725, 1040, 1006, 951, |
| 161101 | + /* 280 */ 1219, 962, 1176, 98, 1278, 1176, 1278, 1317, 1241, 962, |
| 161102 | + /* 290 */ 962, 1241, 962, 98, 1317, 286, 1111, 1048, 1288, 1288, |
| 161103 | + /* 300 */ 1288, 1278, 1260, 1260, 1180, 1318, 1187, 1372, 1668, 1668, |
| 161104 | + /* 310 */ 1591, 1591, 1696, 1696, 1591, 1594, 1589, 1724, 1706, 1741, |
| 161105 | + /* 320 */ 1741, 1741, 1741, 1591, 1745, 1620, 1589, 1589, 1620, 1724, |
| 161106 | + /* 330 */ 1706, 1620, 1706, 1620, 1591, 1745, 1629, 1726, 1591, 1745, |
| 161107 | + /* 340 */ 1775, 1591, 1745, 1591, 1745, 1775, 1690, 1690, 1690, 1742, |
| 161108 | + /* 350 */ 1786, 1786, 1775, 1690, 1684, 1690, 1742, 1690, 1690, 1647, |
| 161109 | + /* 360 */ 1793, 1713, 1713, 1775, 1694, 1725, 1694, 1725, 1694, 1725, |
| 161110 | + /* 370 */ 1694, 1725, 1591, 1750, 1750, 1762, 1762, 1698, 1702, 1826, |
| 161111 | + /* 380 */ 1591, 1695, 1698, 1708, 1710, 1620, 1831, 1845, 1845, 1855, |
| 161112 | + /* 390 */ 1855, 1855, 2022, 2022, 2022, 2022, 2022, 2022, 2022, 2022, |
| 161113 | + /* 400 */ 2022, 2022, 2022, 2022, 2022, 2022, 2022, 578, 837, 655, |
| 161114 | + /* 410 */ 1193, 167, 839, 1055, 1374, 1303, 1107, 1367, 1212, 1272, |
| 161115 | + /* 420 */ 1378, 1384, 1415, 1461, 1472, 1508, 1516, 1517, 1411, 1369, |
| 161116 | + /* 430 */ 1539, 1360, 1506, 1473, 1550, 1585, 1509, 1588, 1460, 1468, |
| 161117 | + /* 440 */ 1608, 1611, 1526, 1417, 1892, 1894, 1876, 1737, 1887, 1888, |
| 161118 | + /* 450 */ 1880, 1882, 1768, 1757, 1779, 1884, 1884, 1886, 1770, 1893, |
| 161119 | + /* 460 */ 1769, 1898, 1914, 1776, 1787, 1884, 1789, 1858, 1883, 1884, |
| 161120 | + /* 470 */ 1771, 1869, 1870, 1871, 1872, 1797, 1812, 1895, 1788, 1929, |
| 161121 | + /* 480 */ 1926, 1910, 1819, 1774, 1867, 1911, 1873, 1862, 1897, 1799, |
| 161122 | + /* 490 */ 1828, 1916, 1923, 1925, 1815, 1822, 1927, 1881, 1928, 1930, |
| 161123 | + /* 500 */ 1924, 1931, 1889, 1896, 1933, 1863, 1932, 1936, 1899, 1917, |
| 161124 | + /* 510 */ 1938, 1803, 1940, 1941, 1942, 1944, 1943, 1946, 1948, 1866, |
| 161125 | + /* 520 */ 1832, 1950, 1951, 1856, 1945, 1953, 1834, 1952, 1947, 1949, |
| 161126 | + /* 530 */ 1954, 1955, 1890, 1905, 1900, 1956, 1907, 1891, 1957, 1962, |
| 161127 | + /* 540 */ 1965, 1966, 1967, 1968, 1960, 1972, 1952, 1973, 1974, 1975, |
| 161128 | + /* 550 */ 1976, 1977, 1978, 1981, 1993, 1983, 1984, 1985, 1986, 1988, |
| 161129 | + /* 560 */ 1989, 1982, 1878, 1874, 1875, 1877, 1879, 1991, 1990, 2003, |
| 161130 | + /* 570 */ 2019, 2020, |
| 160515 | 161131 | }; |
| 160516 | 161132 | #define YY_REDUCE_COUNT (406) |
| 160517 | 161133 | #define YY_REDUCE_MIN (-272) |
| 160518 | | -#define YY_REDUCE_MAX (1693) |
| 161134 | +#define YY_REDUCE_MAX (1686) |
| 160519 | 161135 | static const short yy_reduce_ofst[] = { |
| 160520 | 161136 | /* 0 */ 109, 113, 272, 760, -178, -176, -192, -183, -180, -134, |
| 160521 | 161137 | /* 10 */ 213, 220, 371, -208, -205, -272, -197, 611, 632, 765, |
| 160522 | 161138 | /* 20 */ 786, 392, 943, 989, 503, 651, 1039, -18, 702, 821, |
| 160523 | | - /* 30 */ 710, 812, -188, 380, -187, 555, 662, 1055, 1063, 1065, |
| 160524 | | - /* 40 */ 1080, -267, -267, -267, -267, -267, -267, -267, -267, -267, |
| 161139 | + /* 30 */ 710, 812, -188, -67, -187, 555, 662, 1020, 1023, 1050, |
| 161140 | + /* 40 */ 1064, -267, -267, -267, -267, -267, -267, -267, -267, -267, |
| 160525 | 161141 | /* 50 */ -267, -267, -267, -267, -267, -267, -267, -267, -267, -267, |
| 160526 | 161142 | /* 60 */ -267, -267, -267, -267, -267, -267, -267, -267, -267, -267, |
| 160527 | | - /* 70 */ -267, -267, -267, -267, -267, -267, -267, -267, 636, 811, |
| 160528 | | - /* 80 */ 917, 936, 1006, 1008, 1017, 1060, 1064, 1069, 1075, 1105, |
| 160529 | | - /* 90 */ 1118, 1123, 1125, 1134, 1140, 1159, 1165, 1169, 1174, 1179, |
| 160530 | | - /* 100 */ 1181, 1184, 1186, 1201, 1246, 1259, 1262, 1281, 1293, 1299, |
| 160531 | | - /* 110 */ 1313, 1327, 1341, 1352, 1356, 1358, 1362, 1366, 1395, 1403, |
| 160532 | | - /* 120 */ 1406, 1411, 1424, 1436, 1439, 1450, 1452, -267, -267, -267, |
| 160533 | | - /* 130 */ -267, -267, -267, -267, -267, 224, -267, 446, -24, 275, |
| 160534 | | - /* 140 */ 546, 518, 573, 560, 53, -181, -111, 485, 606, 671, |
| 160535 | | - /* 150 */ 606, 671, 683, 8, 93, -267, -267, -267, -267, 155, |
| 160536 | | - /* 160 */ 155, 155, 181, 242, 264, 486, 489, -218, 393, 227, |
| 160537 | | - /* 170 */ 604, 347, 347, -171, 431, 650, 715, -166, 562, 609, |
| 160538 | | - /* 180 */ 716, 764, 18, 823, 769, 833, 838, 957, 759, 119, |
| 160539 | | - /* 190 */ 923, 226, 1014, 542, 603, 451, 949, 654, 659, 762, |
| 160540 | | - /* 200 */ 964, -4, 778, 961, 712, 1082, 1100, 1111, 1026, 1117, |
| 160541 | | - /* 210 */ -204, -174, -151, -8, 77, 198, 305, 327, 388, 540, |
| 160542 | | - /* 220 */ 839, 968, 982, 985, 1004, 1023, 1070, 1086, 1097, 1130, |
| 160543 | | - /* 230 */ 1190, 1163, 1199, 1284, 1297, 1300, 1314, 1339, 1353, 1391, |
| 160544 | | - /* 240 */ 1402, 1413, 1416, 1417, 803, 1376, 1400, 1428, 1437, 1446, |
| 160545 | | - /* 250 */ 1378, 1461, 1464, 1465, 1249, 1329, 1466, 1467, 1414, 1468, |
| 160546 | | - /* 260 */ 305, 1469, 1470, 1471, 1472, 1482, 1483, 1389, 1392, 1438, |
| 160547 | | - /* 270 */ 1426, 1427, 1432, 1434, 1378, 1438, 1438, 1440, 1474, 1499, |
| 160548 | | - /* 280 */ 1399, 1421, 1430, 1456, 1441, 1442, 1444, 1415, 1473, 1431, |
| 160549 | | - /* 290 */ 1445, 1476, 1449, 1478, 1418, 1479, 1477, 1485, 1493, 1494, |
| 160550 | | - /* 300 */ 1496, 1458, 1475, 1480, 1459, 1490, 1484, 1518, 1448, 1451, |
| 160551 | | - /* 310 */ 1537, 1538, 1463, 1481, 1541, 1486, 1487, 1491, 1519, 1514, |
| 160552 | | - /* 320 */ 1521, 1523, 1525, 1552, 1556, 1520, 1492, 1498, 1522, 1497, |
| 160553 | | - /* 330 */ 1539, 1528, 1542, 1532, 1571, 1573, 1500, 1504, 1582, 1584, |
| 160554 | | - /* 340 */ 1563, 1586, 1588, 1589, 1597, 1567, 1579, 1585, 1590, 1568, |
| 160555 | | - /* 350 */ 1583, 1587, 1593, 1591, 1598, 1599, 1600, 1602, 1606, 1513, |
| 160556 | | - /* 360 */ 1524, 1548, 1549, 1611, 1574, 1576, 1594, 1603, 1604, 1607, |
| 160557 | | - /* 370 */ 1605, 1608, 1642, 1527, 1529, 1609, 1610, 1601, 1615, 1575, |
| 160558 | | - /* 380 */ 1650, 1578, 1619, 1623, 1625, 1624, 1674, 1685, 1686, 1691, |
| 160559 | | - /* 390 */ 1692, 1693, 1612, 1613, 1617, 1675, 1668, 1673, 1676, 1677, |
| 160560 | | - /* 400 */ 1680, 1666, 1669, 1678, 1681, 1683, 1687, |
| 161143 | + /* 70 */ -267, -267, -267, -267, -267, -267, -267, -267, 811, 917, |
| 161144 | + /* 80 */ 936, 938, 983, 1014, 1041, 1060, 1080, 1098, 1101, 1118, |
| 161145 | + /* 90 */ 1126, 1136, 1146, 1158, 1167, 1194, 1196, 1198, 1206, 1213, |
| 161146 | + /* 100 */ 1215, 1232, 1234, 1242, 1245, 1250, 1252, 1259, 1262, 1287, |
| 161147 | + /* 110 */ 1289, 1299, 1302, 1304, 1308, 1314, 1321, 1329, 1334, 1336, |
| 161148 | + /* 120 */ 1346, 1366, 1380, 1382, 1385, 1410, 1413, -267, -267, -267, |
| 161149 | + /* 130 */ -267, -267, -267, -267, -267, 446, -267, 451, -24, 121, |
| 161150 | + /* 140 */ 560, 518, 232, 609, 330, -181, -111, 654, 557, 671, |
| 161151 | + /* 150 */ 557, 671, 882, -30, 93, -267, -267, -267, -267, 155, |
| 161152 | + /* 160 */ 155, 155, 181, 242, 305, 339, 561, -218, 453, 227, |
| 161153 | + /* 170 */ 158, 661, 661, -171, 114, 327, 653, -166, 275, 605, |
| 161154 | + /* 180 */ 615, 337, 833, 665, 939, 957, 825, 958, 985, 501, |
| 161155 | + /* 190 */ 986, 378, 1068, 384, 643, 393, 741, 660, 888, 762, |
| 161156 | + /* 200 */ 822, 229, 988, 926, 504, 1025, 1027, 1034, 1026, 1079, |
| 161157 | + /* 210 */ -204, -174, -151, 18, 130, 198, 226, 376, 391, 442, |
| 161158 | + /* 220 */ 457, 493, 607, 715, 779, 782, 840, 865, 1072, 1099, |
| 161159 | + /* 230 */ 1114, 1085, 1166, 1216, 1251, 1263, 1306, 1309, 1343, 1351, |
| 161160 | + /* 240 */ 1362, 1368, 1399, 1407, 1227, 1239, 1396, 1438, 1445, 1446, |
| 161161 | + /* 250 */ 1383, 1449, 1451, 1452, 1391, 1330, 1456, 1457, 1416, 1458, |
| 161162 | + /* 260 */ 226, 1462, 1464, 1465, 1467, 1469, 1470, 1373, 1377, 1412, |
| 161163 | + /* 270 */ 1401, 1418, 1419, 1423, 1383, 1412, 1412, 1422, 1453, 1475, |
| 161164 | + /* 280 */ 1371, 1400, 1403, 1427, 1420, 1414, 1421, 1390, 1444, 1429, |
| 161165 | + /* 290 */ 1431, 1466, 1435, 1474, 1398, 1478, 1480, 1482, 1491, 1492, |
| 161166 | + /* 300 */ 1495, 1459, 1471, 1477, 1437, 1483, 1484, 1519, 1433, 1434, |
| 161167 | + /* 310 */ 1533, 1534, 1443, 1455, 1538, 1476, 1485, 1486, 1527, 1525, |
| 161168 | + /* 320 */ 1528, 1529, 1530, 1563, 1569, 1524, 1500, 1502, 1532, 1505, |
| 161169 | + /* 330 */ 1542, 1536, 1545, 1540, 1580, 1586, 1498, 1507, 1595, 1592, |
| 161170 | + /* 340 */ 1578, 1600, 1602, 1603, 1605, 1581, 1590, 1596, 1597, 1579, |
| 161171 | + /* 350 */ 1593, 1599, 1604, 1598, 1601, 1606, 1607, 1609, 1610, 1501, |
| 161172 | + /* 360 */ 1515, 1553, 1555, 1615, 1582, 1584, 1613, 1612, 1614, 1616, |
| 161173 | + /* 370 */ 1619, 1617, 1641, 1531, 1535, 1618, 1621, 1631, 1622, 1573, |
| 161174 | + /* 380 */ 1651, 1575, 1632, 1636, 1623, 1639, 1656, 1666, 1667, 1671, |
| 161175 | + /* 390 */ 1672, 1673, 1564, 1565, 1566, 1662, 1674, 1675, 1677, 1678, |
| 161176 | + /* 400 */ 1682, 1670, 1679, 1680, 1681, 1683, 1686, |
| 160561 | 161177 | }; |
| 160562 | 161178 | static const YYACTIONTYPE yy_default[] = { |
| 160563 | 161179 | /* 0 */ 1633, 1633, 1633, 1462, 1230, 1341, 1230, 1230, 1230, 1462, |
| 160564 | 161180 | /* 10 */ 1462, 1462, 1230, 1371, 1371, 1515, 1263, 1230, 1230, 1230, |
| 160565 | 161181 | /* 20 */ 1230, 1230, 1230, 1230, 1230, 1230, 1230, 1461, 1230, 1230, |
| | @@ -160680,14 +161296,14 @@ |
| 160680 | 161296 | 59, /* DETACH => ID */ |
| 160681 | 161297 | 59, /* EACH => ID */ |
| 160682 | 161298 | 59, /* FAIL => ID */ |
| 160683 | 161299 | 0, /* OR => nothing */ |
| 160684 | 161300 | 0, /* AND => nothing */ |
| 160685 | | - 0, /* IS => nothing */ |
| 160686 | 161301 | 59, /* MATCH => ID */ |
| 160687 | 161302 | 59, /* LIKE_KW => ID */ |
| 160688 | 161303 | 0, /* BETWEEN => nothing */ |
| 161304 | + 0, /* IS => nothing */ |
| 160689 | 161305 | 0, /* IN => nothing */ |
| 160690 | 161306 | 0, /* ISNULL => nothing */ |
| 160691 | 161307 | 0, /* NOTNULL => nothing */ |
| 160692 | 161308 | 0, /* NE => nothing */ |
| 160693 | 161309 | 0, /* EQ => nothing */ |
| | @@ -160952,14 +161568,14 @@ |
| 160952 | 161568 | /* 40 */ "DETACH", |
| 160953 | 161569 | /* 41 */ "EACH", |
| 160954 | 161570 | /* 42 */ "FAIL", |
| 160955 | 161571 | /* 43 */ "OR", |
| 160956 | 161572 | /* 44 */ "AND", |
| 160957 | | - /* 45 */ "IS", |
| 160958 | | - /* 46 */ "MATCH", |
| 160959 | | - /* 47 */ "LIKE_KW", |
| 160960 | | - /* 48 */ "BETWEEN", |
| 161573 | + /* 45 */ "MATCH", |
| 161574 | + /* 46 */ "LIKE_KW", |
| 161575 | + /* 47 */ "BETWEEN", |
| 161576 | + /* 48 */ "IS", |
| 160961 | 161577 | /* 49 */ "IN", |
| 160962 | 161578 | /* 50 */ "ISNULL", |
| 160963 | 161579 | /* 51 */ "NOTNULL", |
| 160964 | 161580 | /* 52 */ "NE", |
| 160965 | 161581 | /* 53 */ "EQ", |
| | @@ -169408,10 +170024,12 @@ |
| 169408 | 170024 | } |
| 169409 | 170025 | oldLimit = db->aLimit[limitId]; |
| 169410 | 170026 | if( newLimit>=0 ){ /* IMP: R-52476-28732 */ |
| 169411 | 170027 | if( newLimit>aHardLimit[limitId] ){ |
| 169412 | 170028 | newLimit = aHardLimit[limitId]; /* IMP: R-51463-25634 */ |
| 170029 | + }else if( newLimit<1 && limitId==SQLITE_LIMIT_LENGTH ){ |
| 170030 | + newLimit = 1; |
| 169413 | 170031 | } |
| 169414 | 170032 | db->aLimit[limitId] = newLimit; |
| 169415 | 170033 | } |
| 169416 | 170034 | return oldLimit; /* IMP: R-53341-35419 */ |
| 169417 | 170035 | } |
| | @@ -170811,16 +171429,20 @@ |
| 170811 | 171429 | ** the schema to be reparsed the next time it is needed. This has the |
| 170812 | 171430 | ** effect of erasing all imposter tables. |
| 170813 | 171431 | */ |
| 170814 | 171432 | case SQLITE_TESTCTRL_IMPOSTER: { |
| 170815 | 171433 | sqlite3 *db = va_arg(ap, sqlite3*); |
| 171434 | + int iDb; |
| 170816 | 171435 | sqlite3_mutex_enter(db->mutex); |
| 170817 | | - db->init.iDb = sqlite3FindDbName(db, va_arg(ap,const char*)); |
| 170818 | | - db->init.busy = db->init.imposterTable = va_arg(ap,int); |
| 170819 | | - db->init.newTnum = va_arg(ap,int); |
| 170820 | | - if( db->init.busy==0 && db->init.newTnum>0 ){ |
| 170821 | | - sqlite3ResetAllSchemasOfConnection(db); |
| 171436 | + iDb = sqlite3FindDbName(db, va_arg(ap,const char*)); |
| 171437 | + if( iDb>=0 ){ |
| 171438 | + db->init.iDb = iDb; |
| 171439 | + db->init.busy = db->init.imposterTable = va_arg(ap,int); |
| 171440 | + db->init.newTnum = va_arg(ap,int); |
| 171441 | + if( db->init.busy==0 && db->init.newTnum>0 ){ |
| 171442 | + sqlite3ResetAllSchemasOfConnection(db); |
| 171443 | + } |
| 170822 | 171444 | } |
| 170823 | 171445 | sqlite3_mutex_leave(db->mutex); |
| 170824 | 171446 | break; |
| 170825 | 171447 | } |
| 170826 | 171448 | |
| | @@ -170891,10 +171513,30 @@ |
| 170891 | 171513 | case 2: *ptr = sqlite3WhereTrace; break; |
| 170892 | 171514 | case 3: sqlite3WhereTrace = *ptr; break; |
| 170893 | 171515 | } |
| 170894 | 171516 | break; |
| 170895 | 171517 | } |
| 171518 | + |
| 171519 | + /* sqlite3_test_control(SQLITE_TESTCTRL_LOGEST, |
| 171520 | + ** double fIn, // Input value |
| 171521 | + ** int *pLogEst, // sqlite3LogEstFromDouble(fIn) |
| 171522 | + ** u64 *pInt, // sqlite3LogEstToInt(*pLogEst) |
| 171523 | + ** int *pLogEst2 // sqlite3LogEst(*pInt) |
| 171524 | + ** ); |
| 171525 | + ** |
| 171526 | + ** Test access for the LogEst conversion routines. |
| 171527 | + */ |
| 171528 | + case SQLITE_TESTCTRL_LOGEST: { |
| 171529 | + double rIn = va_arg(ap, double); |
| 171530 | + LogEst rLogEst = sqlite3LogEstFromDouble(rIn); |
| 171531 | + u64 iInt = sqlite3LogEstToInt(rLogEst); |
| 171532 | + va_arg(ap, int*)[0] = rLogEst; |
| 171533 | + va_arg(ap, u64*)[0] = iInt; |
| 171534 | + va_arg(ap, int*)[0] = sqlite3LogEst(iInt); |
| 171535 | + break; |
| 171536 | + } |
| 171537 | + |
| 170896 | 171538 | |
| 170897 | 171539 | #if defined(SQLITE_DEBUG) && !defined(SQLITE_OMIT_WSD) |
| 170898 | 171540 | /* sqlite3_test_control(SQLITE_TESTCTRL_TUNE, id, *piValue) |
| 170899 | 171541 | ** |
| 170900 | 171542 | ** If "id" is an integer between 1 and SQLITE_NTUNE then set the value |
| | @@ -203302,11 +203944,11 @@ |
| 203302 | 203944 | ** |
| 203303 | 203945 | ** If the expression cannot be created, NULL is returned. In this case, |
| 203304 | 203946 | ** the caller has to use an OFFSET clause to extract only the required |
| 203305 | 203947 | ** rows from the sourct table, just as it does for an RBU update operation. |
| 203306 | 203948 | */ |
| 203307 | | -char *rbuVacuumIndexStart( |
| 203949 | +static char *rbuVacuumIndexStart( |
| 203308 | 203950 | sqlite3rbu *p, /* RBU handle */ |
| 203309 | 203951 | RbuObjIter *pIter /* RBU iterator object */ |
| 203310 | 203952 | ){ |
| 203311 | 203953 | char *zOrder = 0; |
| 203312 | 203954 | char *zLhs = 0; |
| | @@ -223727,11 +224369,11 @@ |
| 223727 | 224369 | ** an error occurs, (*pRc) is set to an SQLite error code before returning. |
| 223728 | 224370 | */ |
| 223729 | 224371 | static void fts5StructureMakeWritable(int *pRc, Fts5Structure **pp){ |
| 223730 | 224372 | Fts5Structure *p = *pp; |
| 223731 | 224373 | if( *pRc==SQLITE_OK && p->nRef>1 ){ |
| 223732 | | - int nByte = sizeof(Fts5Structure)+(p->nLevel-1)*sizeof(Fts5StructureLevel); |
| 224374 | + i64 nByte = sizeof(Fts5Structure)+(p->nLevel-1)*sizeof(Fts5StructureLevel); |
| 223733 | 224375 | Fts5Structure *pNew; |
| 223734 | 224376 | pNew = (Fts5Structure*)sqlite3Fts5MallocZero(pRc, nByte); |
| 223735 | 224377 | if( pNew ){ |
| 223736 | 224378 | int i; |
| 223737 | 224379 | memcpy(pNew, p, nByte); |
| | @@ -224756,12 +225398,16 @@ |
| 224756 | 225398 | } |
| 224757 | 225399 | }else{ |
| 224758 | 225400 | int iRowidOff; |
| 224759 | 225401 | iRowidOff = fts5LeafFirstRowidOff(pNew); |
| 224760 | 225402 | if( iRowidOff ){ |
| 224761 | | - pIter->pLeaf = pNew; |
| 224762 | | - pIter->iLeafOffset = iRowidOff; |
| 225403 | + if( iRowidOff>=pNew->szLeaf ){ |
| 225404 | + p->rc = FTS5_CORRUPT; |
| 225405 | + }else{ |
| 225406 | + pIter->pLeaf = pNew; |
| 225407 | + pIter->iLeafOffset = iRowidOff; |
| 225408 | + } |
| 224763 | 225409 | } |
| 224764 | 225410 | } |
| 224765 | 225411 | |
| 224766 | 225412 | if( pIter->pLeaf ){ |
| 224767 | 225413 | u8 *a = &pIter->pLeaf->p[pIter->iLeafOffset]; |
| | @@ -232486,11 +233132,11 @@ |
| 232486 | 233132 | int nArg, /* Number of args */ |
| 232487 | 233133 | sqlite3_value **apUnused /* Function arguments */ |
| 232488 | 233134 | ){ |
| 232489 | 233135 | assert( nArg==0 ); |
| 232490 | 233136 | UNUSED_PARAM2(nArg, apUnused); |
| 232491 | | - sqlite3_result_text(pCtx, "fts5: 2021-11-22 16:06:57 0f567b61072e214c40cae1441889f83622a975f429b41803dfbed687718731c8", -1, SQLITE_TRANSIENT); |
| 233137 | + sqlite3_result_text(pCtx, "fts5: 2021-12-09 20:06:18 633bfeeea2bccdd44126acf3f61ecca163c9d933bdc787a2c18a697dc9406882", -1, SQLITE_TRANSIENT); |
| 232492 | 233138 | } |
| 232493 | 233139 | |
| 232494 | 233140 | /* |
| 232495 | 233141 | ** Return true if zName is the extension on one of the shadow tables used |
| 232496 | 233142 | ** by this module. |
| | @@ -236703,11 +237349,11 @@ |
| 236703 | 237349 | rc = sqlite3Fts5FlushToDisk(pFts5); |
| 236704 | 237350 | } |
| 236705 | 237351 | } |
| 236706 | 237352 | |
| 236707 | 237353 | if( rc==SQLITE_OK ){ |
| 236708 | | - int nByte = pFts5->pConfig->nCol * sizeof(i64)*2 + sizeof(Fts5VocabCursor); |
| 237354 | + i64 nByte = pFts5->pConfig->nCol * sizeof(i64)*2 + sizeof(Fts5VocabCursor); |
| 236709 | 237355 | pCsr = (Fts5VocabCursor*)sqlite3Fts5MallocZero(&rc, nByte); |
| 236710 | 237356 | } |
| 236711 | 237357 | |
| 236712 | 237358 | if( pCsr ){ |
| 236713 | 237359 | pCsr->pFts5 = pFts5; |
| 236714 | 237360 | |