| | @@ -1,8 +1,8 @@ |
| 1 | 1 | /****************************************************************************** |
| 2 | 2 | ** This file is an amalgamation of many separate C source files from SQLite |
| 3 | | -** version 3.6.19. By combining all the individual C code files into this |
| 3 | +** version 3.6.20. By combining all the individual C code files into this |
| 4 | 4 | ** single large file, the entire code can be compiled as a one 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% are more are commonly seen when SQLite is compiled as a single |
| 8 | 8 | ** translation unit. |
| | @@ -15,11 +15,11 @@ |
| 15 | 15 | ** of the embedded sqlite3.h header file.) Additional code files may be needed |
| 16 | 16 | ** if you want a wrapper to interface SQLite with your choice of programming |
| 17 | 17 | ** language. The code for the "sqlite3" command-line shell is also in a |
| 18 | 18 | ** separate file. This file contains only code for the core SQLite library. |
| 19 | 19 | ** |
| 20 | | -** This amalgamation was generated on 2009-10-14 11:34:12 UTC. |
| 20 | +** This amalgamation was generated on 2009-11-01 19:22:03 UTC. |
| 21 | 21 | */ |
| 22 | 22 | #define SQLITE_CORE 1 |
| 23 | 23 | #define SQLITE_AMALGAMATION 1 |
| 24 | 24 | #ifndef SQLITE_PRIVATE |
| 25 | 25 | # define SQLITE_PRIVATE static |
| | @@ -649,13 +649,13 @@ |
| 649 | 649 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 650 | 650 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 651 | 651 | ** |
| 652 | 652 | ** Requirements: [H10011] [H10014] |
| 653 | 653 | */ |
| 654 | | -#define SQLITE_VERSION "3.6.19" |
| 655 | | -#define SQLITE_VERSION_NUMBER 3006019 |
| 656 | | -#define SQLITE_SOURCE_ID "2009-10-14 11:33:55 c1d499afc50d54b376945b4efb65c56c787a073d" |
| 654 | +#define SQLITE_VERSION "3.6.20" |
| 655 | +#define SQLITE_VERSION_NUMBER 3006020 |
| 656 | +#define SQLITE_SOURCE_ID "2009-10-30 14:27:15 612952743da28e651512547fc0d3925f4c698eb4" |
| 657 | 657 | |
| 658 | 658 | /* |
| 659 | 659 | ** CAPI3REF: Run-Time Library Version Numbers {H10020} <S60100> |
| 660 | 660 | ** KEYWORDS: sqlite3_version |
| 661 | 661 | ** |
| | @@ -775,23 +775,13 @@ |
| 775 | 775 | /* |
| 776 | 776 | ** CAPI3REF: Closing A Database Connection {H12010} <S30100><S40200> |
| 777 | 777 | ** |
| 778 | 778 | ** This routine is the destructor for the [sqlite3] object. |
| 779 | 779 | ** |
| 780 | | -** Applications should [sqlite3_finalize | finalize] all [prepared statements] |
| 780 | +** Applications must [sqlite3_finalize | finalize] all [prepared statements] |
| 781 | 781 | ** and [sqlite3_blob_close | close] all [BLOB handles] associated with |
| 782 | 782 | ** the [sqlite3] object prior to attempting to close the object. |
| 783 | | -** The [sqlite3_next_stmt()] interface can be used to locate all |
| 784 | | -** [prepared statements] associated with a [database connection] if desired. |
| 785 | | -** Typical code might look like this: |
| 786 | | -** |
| 787 | | -** <blockquote><pre> |
| 788 | | -** sqlite3_stmt *pStmt; |
| 789 | | -** while( (pStmt = sqlite3_next_stmt(db, 0))!=0 ){ |
| 790 | | -** sqlite3_finalize(pStmt); |
| 791 | | -** } |
| 792 | | -** </pre></blockquote> |
| 793 | 783 | ** |
| 794 | 784 | ** If [sqlite3_close()] is invoked while a transaction is open, |
| 795 | 785 | ** the transaction is automatically rolled back. |
| 796 | 786 | ** |
| 797 | 787 | ** The C parameter to [sqlite3_close(C)] must be either a NULL |
| | @@ -1365,10 +1355,13 @@ |
| 1365 | 1355 | ** CAPI3REF: Initialize The SQLite Library {H10130} <S20000><S30100> |
| 1366 | 1356 | ** |
| 1367 | 1357 | ** The sqlite3_initialize() routine initializes the |
| 1368 | 1358 | ** SQLite library. The sqlite3_shutdown() routine |
| 1369 | 1359 | ** deallocates any resources that were allocated by sqlite3_initialize(). |
| 1360 | +** This routines are designed to aid in process initialization and |
| 1361 | +** shutdown on embedded systems. Workstation applications using |
| 1362 | +** SQLite normally do not need to invoke either of these routines. |
| 1370 | 1363 | ** |
| 1371 | 1364 | ** A call to sqlite3_initialize() is an "effective" call if it is |
| 1372 | 1365 | ** the first time sqlite3_initialize() is invoked during the lifetime of |
| 1373 | 1366 | ** the process, or if it is the first time sqlite3_initialize() is invoked |
| 1374 | 1367 | ** following a call to sqlite3_shutdown(). Only an effective call |
| | @@ -1376,15 +1369,21 @@ |
| 1376 | 1369 | ** are harmless no-ops. |
| 1377 | 1370 | ** |
| 1378 | 1371 | ** A call to sqlite3_shutdown() is an "effective" call if it is the first |
| 1379 | 1372 | ** call to sqlite3_shutdown() since the last sqlite3_initialize(). Only |
| 1380 | 1373 | ** an effective call to sqlite3_shutdown() does any deinitialization. |
| 1381 | | -** All other calls to sqlite3_shutdown() are harmless no-ops. |
| 1374 | +** All other valid calls to sqlite3_shutdown() are harmless no-ops. |
| 1382 | 1375 | ** |
| 1383 | | -** Among other things, sqlite3_initialize() shall invoke |
| 1376 | +** The sqlite3_initialize() interface is threadsafe, but sqlite3_shutdown() |
| 1377 | +** is not. The sqlite3_shutdown() interface must only be called from a |
| 1378 | +** single thread. All open [database connections] must be closed and all |
| 1379 | +** other SQLite resources must be deallocated prior to invoking |
| 1380 | +** sqlite3_shutdown(). |
| 1381 | +** |
| 1382 | +** Among other things, sqlite3_initialize() will invoke |
| 1384 | 1383 | ** sqlite3_os_init(). Similarly, sqlite3_shutdown() |
| 1385 | | -** shall invoke sqlite3_os_end(). |
| 1384 | +** will invoke sqlite3_os_end(). |
| 1386 | 1385 | ** |
| 1387 | 1386 | ** The sqlite3_initialize() routine returns [SQLITE_OK] on success. |
| 1388 | 1387 | ** If for some reason, sqlite3_initialize() is unable to initialize |
| 1389 | 1388 | ** the library (perhaps it is unable to allocate a needed resource such |
| 1390 | 1389 | ** as a mutex) it returns an [error code] other than [SQLITE_OK]. |
| | @@ -2926,11 +2925,11 @@ |
| 2926 | 2925 | ** recommended for all new programs. The two older interfaces are retained |
| 2927 | 2926 | ** for backwards compatibility, but their use is discouraged. |
| 2928 | 2927 | ** In the "v2" interfaces, the prepared statement |
| 2929 | 2928 | ** that is returned (the [sqlite3_stmt] object) contains a copy of the |
| 2930 | 2929 | ** original SQL text. This causes the [sqlite3_step()] interface to |
| 2931 | | -** behave a differently in two ways: |
| 2930 | +** behave a differently in three ways: |
| 2932 | 2931 | ** |
| 2933 | 2932 | ** <ol> |
| 2934 | 2933 | ** <li> |
| 2935 | 2934 | ** If the database schema changes, instead of returning [SQLITE_SCHEMA] as it |
| 2936 | 2935 | ** always used to do, [sqlite3_step()] will automatically recompile the SQL |
| | @@ -2948,10 +2947,18 @@ |
| 2948 | 2947 | ** [sqlite3_step()] would only return a generic [SQLITE_ERROR] result code |
| 2949 | 2948 | ** and you would have to make a second call to [sqlite3_reset()] in order |
| 2950 | 2949 | ** to find the underlying cause of the problem. With the "v2" prepare |
| 2951 | 2950 | ** interfaces, the underlying reason for the error is returned immediately. |
| 2952 | 2951 | ** </li> |
| 2952 | +** |
| 2953 | +** <li> |
| 2954 | +** ^If the value of a [parameter | host parameter] in the WHERE clause might |
| 2955 | +** change the query plan for a statement, then the statement may be |
| 2956 | +** automatically recompiled (as if there had been a schema change) on the first |
| 2957 | +** [sqlite3_step()] call following any change to the |
| 2958 | +** [sqlite3_bind_text | bindings] of the [parameter]. |
| 2959 | +** </li> |
| 2953 | 2960 | ** </ol> |
| 2954 | 2961 | ** |
| 2955 | 2962 | ** Requirements: |
| 2956 | 2963 | ** [H13011] [H13012] [H13013] [H13014] [H13015] [H13016] [H13019] [H13021] |
| 2957 | 2964 | ** |
| | @@ -3480,10 +3487,12 @@ |
| 3480 | 3487 | ** result row of a query. In every case the first argument is a pointer |
| 3481 | 3488 | ** to the [prepared statement] that is being evaluated (the [sqlite3_stmt*] |
| 3482 | 3489 | ** that was returned from [sqlite3_prepare_v2()] or one of its variants) |
| 3483 | 3490 | ** and the second argument is the index of the column for which information |
| 3484 | 3491 | ** should be returned. The leftmost column of the result set has the index 0. |
| 3492 | +** The number of columns in the result can be determined using |
| 3493 | +** [sqlite3_column_count()]. |
| 3485 | 3494 | ** |
| 3486 | 3495 | ** If the SQL statement does not currently point to a valid row, or if the |
| 3487 | 3496 | ** column index is out of range, the result is undefined. |
| 3488 | 3497 | ** These routines may only be called when the most recent call to |
| 3489 | 3498 | ** [sqlite3_step()] has returned [SQLITE_ROW] and neither |
| | @@ -7311,151 +7320,151 @@ |
| 7311 | 7320 | */ |
| 7312 | 7321 | /************** Include opcodes.h in the middle of vdbe.h ********************/ |
| 7313 | 7322 | /************** Begin file opcodes.h *****************************************/ |
| 7314 | 7323 | /* Automatically generated. Do not edit */ |
| 7315 | 7324 | /* See the mkopcodeh.awk script for details */ |
| 7316 | | -#define OP_VNext 1 |
| 7317 | | -#define OP_Affinity 2 |
| 7318 | | -#define OP_Column 3 |
| 7319 | | -#define OP_SetCookie 4 |
| 7320 | | -#define OP_Seek 5 |
| 7321 | | -#define OP_Real 130 /* same as TK_FLOAT */ |
| 7322 | | -#define OP_Sequence 6 |
| 7323 | | -#define OP_Savepoint 7 |
| 7324 | | -#define OP_Ge 80 /* same as TK_GE */ |
| 7325 | | -#define OP_RowKey 8 |
| 7326 | | -#define OP_SCopy 9 |
| 7327 | | -#define OP_Eq 76 /* same as TK_EQ */ |
| 7328 | | -#define OP_OpenWrite 10 |
| 7329 | | -#define OP_NotNull 74 /* same as TK_NOTNULL */ |
| 7330 | | -#define OP_If 11 |
| 7325 | +#define OP_ReadCookie 1 |
| 7326 | +#define OP_AutoCommit 2 |
| 7327 | +#define OP_Found 3 |
| 7328 | +#define OP_NullRow 4 |
| 7329 | +#define OP_Lt 79 /* same as TK_LT */ |
| 7330 | +#define OP_RowSetTest 5 |
| 7331 | +#define OP_Variable 6 |
| 7332 | +#define OP_RealAffinity 7 |
| 7333 | +#define OP_Sort 8 |
| 7334 | +#define OP_Affinity 9 |
| 7335 | +#define OP_IfNot 10 |
| 7336 | +#define OP_Gosub 11 |
| 7337 | +#define OP_Add 86 /* same as TK_PLUS */ |
| 7338 | +#define OP_NotFound 12 |
| 7339 | +#define OP_ResultRow 13 |
| 7340 | +#define OP_IsNull 73 /* same as TK_ISNULL */ |
| 7341 | +#define OP_SeekLe 14 |
| 7342 | +#define OP_Rowid 15 |
| 7343 | +#define OP_CreateIndex 16 |
| 7344 | +#define OP_Explain 17 |
| 7345 | +#define OP_DropIndex 18 |
| 7346 | +#define OP_Null 20 |
| 7347 | +#define OP_Program 21 |
| 7331 | 7348 | #define OP_ToInt 144 /* same as TK_TO_INT */ |
| 7332 | | -#define OP_String8 94 /* same as TK_STRING */ |
| 7333 | | -#define OP_CollSeq 12 |
| 7334 | | -#define OP_OpenRead 13 |
| 7335 | | -#define OP_Expire 14 |
| 7336 | | -#define OP_AutoCommit 15 |
| 7337 | | -#define OP_Gt 77 /* same as TK_GT */ |
| 7338 | | -#define OP_Pagecount 16 |
| 7339 | | -#define OP_IntegrityCk 17 |
| 7340 | | -#define OP_Sort 18 |
| 7341 | | -#define OP_Copy 20 |
| 7342 | | -#define OP_Trace 21 |
| 7343 | | -#define OP_Function 22 |
| 7344 | | -#define OP_IfNeg 23 |
| 7345 | | -#define OP_And 69 /* same as TK_AND */ |
| 7346 | | -#define OP_Subtract 87 /* same as TK_MINUS */ |
| 7347 | | -#define OP_Noop 24 |
| 7348 | | -#define OP_Program 25 |
| 7349 | | -#define OP_Return 26 |
| 7350 | | -#define OP_Remainder 90 /* same as TK_REM */ |
| 7351 | | -#define OP_NewRowid 27 |
| 7349 | +#define OP_Int64 22 |
| 7350 | +#define OP_LoadAnalysis 23 |
| 7351 | +#define OP_IdxInsert 24 |
| 7352 | +#define OP_VUpdate 25 |
| 7353 | +#define OP_Next 26 |
| 7354 | +#define OP_ToNumeric 143 /* same as TK_TO_NUMERIC*/ |
| 7355 | +#define OP_Ge 80 /* same as TK_GE */ |
| 7356 | +#define OP_BitNot 93 /* same as TK_BITNOT */ |
| 7357 | +#define OP_SeekLt 27 |
| 7358 | +#define OP_Rewind 28 |
| 7352 | 7359 | #define OP_Multiply 88 /* same as TK_STAR */ |
| 7353 | | -#define OP_FkCounter 28 |
| 7354 | | -#define OP_Variable 29 |
| 7355 | | -#define OP_String 30 |
| 7356 | | -#define OP_RealAffinity 31 |
| 7357 | | -#define OP_VRename 32 |
| 7358 | | -#define OP_ParseSchema 33 |
| 7359 | | -#define OP_VOpen 34 |
| 7360 | | -#define OP_Close 35 |
| 7361 | | -#define OP_CreateIndex 36 |
| 7362 | | -#define OP_IsUnique 37 |
| 7363 | | -#define OP_NotFound 38 |
| 7364 | | -#define OP_Int64 39 |
| 7365 | | -#define OP_MustBeInt 40 |
| 7366 | | -#define OP_Halt 41 |
| 7367 | | -#define OP_Rowid 42 |
| 7368 | | -#define OP_IdxLT 43 |
| 7369 | | -#define OP_AddImm 44 |
| 7370 | | -#define OP_RowData 45 |
| 7371 | | -#define OP_MemMax 46 |
| 7372 | | -#define OP_Or 68 /* same as TK_OR */ |
| 7373 | | -#define OP_NotExists 47 |
| 7374 | | -#define OP_Gosub 48 |
| 7375 | | -#define OP_Divide 89 /* same as TK_SLASH */ |
| 7376 | | -#define OP_Integer 49 |
| 7377 | | -#define OP_ToNumeric 143 /* same as TK_TO_NUMERIC*/ |
| 7378 | | -#define OP_Prev 50 |
| 7379 | | -#define OP_RowSetRead 51 |
| 7380 | | -#define OP_Concat 91 /* same as TK_CONCAT */ |
| 7381 | | -#define OP_RowSetAdd 52 |
| 7360 | +#define OP_ToReal 145 /* same as TK_TO_REAL */ |
| 7361 | +#define OP_Gt 77 /* same as TK_GT */ |
| 7362 | +#define OP_RowSetRead 29 |
| 7363 | +#define OP_Last 30 |
| 7364 | +#define OP_MustBeInt 31 |
| 7365 | +#define OP_Ne 75 /* same as TK_NE */ |
| 7366 | +#define OP_IncrVacuum 32 |
| 7367 | +#define OP_String 33 |
| 7368 | +#define OP_VFilter 34 |
| 7369 | +#define OP_Count 35 |
| 7370 | +#define OP_Close 36 |
| 7371 | +#define OP_AggFinal 37 |
| 7372 | +#define OP_RowData 38 |
| 7373 | +#define OP_IdxRowid 39 |
| 7374 | +#define OP_Param 40 |
| 7375 | +#define OP_Pagecount 41 |
| 7376 | +#define OP_BitOr 83 /* same as TK_BITOR */ |
| 7377 | +#define OP_NotNull 74 /* same as TK_NOTNULL */ |
| 7378 | +#define OP_SeekGe 42 |
| 7379 | +#define OP_Not 19 /* same as TK_NOT */ |
| 7380 | +#define OP_OpenPseudo 43 |
| 7381 | +#define OP_Halt 44 |
| 7382 | +#define OP_Compare 45 |
| 7383 | +#define OP_NewRowid 46 |
| 7384 | +#define OP_Real 130 /* same as TK_FLOAT */ |
| 7385 | +#define OP_IdxLT 47 |
| 7386 | +#define OP_SeekGt 48 |
| 7387 | +#define OP_MemMax 49 |
| 7388 | +#define OP_Function 50 |
| 7389 | +#define OP_IntegrityCk 51 |
| 7390 | +#define OP_Remainder 90 /* same as TK_REM */ |
| 7391 | +#define OP_FkCounter 52 |
| 7392 | +#define OP_SCopy 53 |
| 7393 | +#define OP_ShiftLeft 84 /* same as TK_LSHIFT */ |
| 7394 | +#define OP_IfNeg 54 |
| 7382 | 7395 | #define OP_BitAnd 82 /* same as TK_BITAND */ |
| 7383 | | -#define OP_VColumn 53 |
| 7384 | | -#define OP_CreateTable 54 |
| 7385 | | -#define OP_Last 55 |
| 7386 | | -#define OP_SeekLe 56 |
| 7387 | | -#define OP_IsNull 73 /* same as TK_ISNULL */ |
| 7388 | | -#define OP_IncrVacuum 57 |
| 7389 | | -#define OP_IdxRowid 58 |
| 7390 | | -#define OP_ShiftRight 85 /* same as TK_RSHIFT */ |
| 7391 | | -#define OP_ResetCount 59 |
| 7392 | | -#define OP_Yield 60 |
| 7393 | | -#define OP_DropTrigger 61 |
| 7394 | | -#define OP_DropIndex 62 |
| 7395 | | -#define OP_Param 63 |
| 7396 | | -#define OP_IdxGE 64 |
| 7397 | | -#define OP_IdxDelete 65 |
| 7398 | | -#define OP_Vacuum 66 |
| 7399 | | -#define OP_IfNot 67 |
| 7400 | | -#define OP_DropTable 70 |
| 7401 | | -#define OP_SeekLt 71 |
| 7402 | | -#define OP_MakeRecord 72 |
| 7396 | +#define OP_Or 68 /* same as TK_OR */ |
| 7397 | +#define OP_NotExists 55 |
| 7398 | +#define OP_VDestroy 56 |
| 7399 | +#define OP_IdxDelete 57 |
| 7400 | +#define OP_Vacuum 58 |
| 7401 | +#define OP_Copy 59 |
| 7402 | +#define OP_If 60 |
| 7403 | +#define OP_Jump 61 |
| 7404 | +#define OP_Destroy 62 |
| 7405 | +#define OP_AggStep 63 |
| 7406 | +#define OP_Clear 64 |
| 7407 | +#define OP_Insert 65 |
| 7408 | +#define OP_Permutation 66 |
| 7409 | +#define OP_VBegin 67 |
| 7410 | +#define OP_OpenEphemeral 70 |
| 7411 | +#define OP_IdxGE 71 |
| 7412 | +#define OP_Trace 72 |
| 7413 | +#define OP_Divide 89 /* same as TK_SLASH */ |
| 7414 | +#define OP_String8 94 /* same as TK_STRING */ |
| 7415 | +#define OP_Concat 91 /* same as TK_CONCAT */ |
| 7416 | +#define OP_MakeRecord 81 |
| 7417 | +#define OP_Yield 92 |
| 7418 | +#define OP_SetCookie 95 |
| 7419 | +#define OP_Prev 96 |
| 7420 | +#define OP_DropTrigger 97 |
| 7421 | +#define OP_FkIfZero 98 |
| 7422 | +#define OP_And 69 /* same as TK_AND */ |
| 7423 | +#define OP_VColumn 99 |
| 7424 | +#define OP_Return 100 |
| 7425 | +#define OP_OpenWrite 101 |
| 7426 | +#define OP_Integer 102 |
| 7427 | +#define OP_Transaction 103 |
| 7428 | +#define OP_IfPos 104 |
| 7429 | +#define OP_RowSetAdd 105 |
| 7430 | +#define OP_CollSeq 106 |
| 7431 | +#define OP_Savepoint 107 |
| 7432 | +#define OP_VRename 108 |
| 7403 | 7433 | #define OP_ToBlob 142 /* same as TK_TO_BLOB */ |
| 7404 | | -#define OP_ResultRow 81 |
| 7405 | | -#define OP_Delete 92 |
| 7406 | | -#define OP_AggFinal 95 |
| 7407 | | -#define OP_Compare 96 |
| 7408 | | -#define OP_ShiftLeft 84 /* same as TK_LSHIFT */ |
| 7409 | | -#define OP_Goto 97 |
| 7410 | | -#define OP_TableLock 98 |
| 7411 | | -#define OP_Clear 99 |
| 7412 | | -#define OP_Le 78 /* same as TK_LE */ |
| 7413 | | -#define OP_VerifyCookie 100 |
| 7414 | | -#define OP_AggStep 101 |
| 7434 | +#define OP_Sequence 109 |
| 7435 | +#define OP_ShiftRight 85 /* same as TK_RSHIFT */ |
| 7436 | +#define OP_HaltIfNull 110 |
| 7437 | +#define OP_VCreate 111 |
| 7438 | +#define OP_CreateTable 112 |
| 7439 | +#define OP_AddImm 113 |
| 7415 | 7440 | #define OP_ToText 141 /* same as TK_TO_TEXT */ |
| 7416 | | -#define OP_Not 19 /* same as TK_NOT */ |
| 7417 | | -#define OP_ToReal 145 /* same as TK_TO_REAL */ |
| 7418 | | -#define OP_Transaction 102 |
| 7419 | | -#define OP_VFilter 103 |
| 7420 | | -#define OP_Ne 75 /* same as TK_NE */ |
| 7421 | | -#define OP_VDestroy 104 |
| 7422 | | -#define OP_BitOr 83 /* same as TK_BITOR */ |
| 7423 | | -#define OP_Next 105 |
| 7424 | | -#define OP_Count 106 |
| 7425 | | -#define OP_IdxInsert 107 |
| 7426 | | -#define OP_Lt 79 /* same as TK_LT */ |
| 7427 | | -#define OP_FkIfZero 108 |
| 7428 | | -#define OP_SeekGe 109 |
| 7429 | | -#define OP_Insert 110 |
| 7430 | | -#define OP_Destroy 111 |
| 7431 | | -#define OP_ReadCookie 112 |
| 7432 | | -#define OP_RowSetTest 113 |
| 7433 | | -#define OP_LoadAnalysis 114 |
| 7434 | | -#define OP_Explain 115 |
| 7435 | | -#define OP_HaltIfNull 116 |
| 7436 | | -#define OP_OpenPseudo 117 |
| 7437 | | -#define OP_OpenEphemeral 118 |
| 7438 | | -#define OP_Null 119 |
| 7439 | | -#define OP_Move 120 |
| 7440 | | -#define OP_Blob 121 |
| 7441 | | -#define OP_Add 86 /* same as TK_PLUS */ |
| 7442 | | -#define OP_Rewind 122 |
| 7443 | | -#define OP_SeekGt 123 |
| 7444 | | -#define OP_VBegin 124 |
| 7445 | | -#define OP_VUpdate 125 |
| 7446 | | -#define OP_IfZero 126 |
| 7447 | | -#define OP_BitNot 93 /* same as TK_BITNOT */ |
| 7448 | | -#define OP_VCreate 127 |
| 7449 | | -#define OP_Found 128 |
| 7450 | | -#define OP_IfPos 129 |
| 7451 | | -#define OP_NullRow 131 |
| 7452 | | -#define OP_Jump 132 |
| 7453 | | -#define OP_Permutation 133 |
| 7441 | +#define OP_DropTable 114 |
| 7442 | +#define OP_IsUnique 115 |
| 7443 | +#define OP_VOpen 116 |
| 7444 | +#define OP_IfZero 117 |
| 7445 | +#define OP_Noop 118 |
| 7446 | +#define OP_InsertInt 119 |
| 7447 | +#define OP_RowKey 120 |
| 7448 | +#define OP_Expire 121 |
| 7449 | +#define OP_Delete 122 |
| 7450 | +#define OP_Subtract 87 /* same as TK_MINUS */ |
| 7451 | +#define OP_Blob 123 |
| 7452 | +#define OP_Move 124 |
| 7453 | +#define OP_Goto 125 |
| 7454 | +#define OP_ParseSchema 126 |
| 7455 | +#define OP_Eq 76 /* same as TK_EQ */ |
| 7456 | +#define OP_VNext 127 |
| 7457 | +#define OP_Seek 128 |
| 7458 | +#define OP_Le 78 /* same as TK_LE */ |
| 7459 | +#define OP_TableLock 129 |
| 7460 | +#define OP_VerifyCookie 131 |
| 7461 | +#define OP_Column 132 |
| 7462 | +#define OP_OpenRead 133 |
| 7463 | +#define OP_ResetCount 134 |
| 7454 | 7464 | |
| 7455 | 7465 | /* The following opcode values are never used */ |
| 7456 | | -#define OP_NotUsed_134 134 |
| 7457 | 7466 | #define OP_NotUsed_135 135 |
| 7458 | 7467 | #define OP_NotUsed_136 136 |
| 7459 | 7468 | #define OP_NotUsed_137 137 |
| 7460 | 7469 | #define OP_NotUsed_138 138 |
| 7461 | 7470 | #define OP_NotUsed_139 139 |
| | @@ -7471,27 +7480,27 @@ |
| 7471 | 7480 | #define OPFLG_IN1 0x0004 /* in1: P1 is an input */ |
| 7472 | 7481 | #define OPFLG_IN2 0x0008 /* in2: P2 is an input */ |
| 7473 | 7482 | #define OPFLG_IN3 0x0010 /* in3: P3 is an input */ |
| 7474 | 7483 | #define OPFLG_OUT3 0x0020 /* out3: P3 is an output */ |
| 7475 | 7484 | #define OPFLG_INITIALIZER {\ |
| 7476 | | -/* 0 */ 0x00, 0x01, 0x00, 0x00, 0x10, 0x08, 0x02, 0x00,\ |
| 7477 | | -/* 8 */ 0x00, 0x04, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00,\ |
| 7478 | | -/* 16 */ 0x02, 0x00, 0x01, 0x04, 0x04, 0x00, 0x00, 0x05,\ |
| 7479 | | -/* 24 */ 0x00, 0x01, 0x04, 0x02, 0x00, 0x00, 0x02, 0x04,\ |
| 7480 | | -/* 32 */ 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, 0x11, 0x02,\ |
| 7481 | | -/* 40 */ 0x05, 0x00, 0x02, 0x11, 0x04, 0x00, 0x08, 0x11,\ |
| 7482 | | -/* 48 */ 0x01, 0x02, 0x01, 0x21, 0x08, 0x00, 0x02, 0x01,\ |
| 7483 | | -/* 56 */ 0x11, 0x01, 0x02, 0x00, 0x04, 0x00, 0x00, 0x02,\ |
| 7484 | | -/* 64 */ 0x11, 0x00, 0x00, 0x05, 0x2c, 0x2c, 0x00, 0x11,\ |
| 7485 | +/* 0 */ 0x00, 0x02, 0x00, 0x11, 0x00, 0x15, 0x00, 0x04,\ |
| 7486 | +/* 8 */ 0x01, 0x00, 0x05, 0x01, 0x11, 0x00, 0x11, 0x02,\ |
| 7487 | +/* 16 */ 0x02, 0x00, 0x00, 0x04, 0x02, 0x01, 0x02, 0x00,\ |
| 7488 | +/* 24 */ 0x08, 0x00, 0x01, 0x11, 0x01, 0x21, 0x01, 0x05,\ |
| 7489 | +/* 32 */ 0x01, 0x02, 0x01, 0x02, 0x00, 0x00, 0x00, 0x02,\ |
| 7490 | +/* 40 */ 0x02, 0x02, 0x11, 0x00, 0x00, 0x00, 0x02, 0x11,\ |
| 7491 | +/* 48 */ 0x11, 0x08, 0x00, 0x00, 0x00, 0x04, 0x05, 0x11,\ |
| 7492 | +/* 56 */ 0x00, 0x00, 0x00, 0x04, 0x05, 0x01, 0x02, 0x00,\ |
| 7493 | +/* 64 */ 0x00, 0x00, 0x00, 0x00, 0x2c, 0x2c, 0x00, 0x11,\ |
| 7485 | 7494 | /* 72 */ 0x00, 0x05, 0x05, 0x15, 0x15, 0x15, 0x15, 0x15,\ |
| 7486 | 7495 | /* 80 */ 0x15, 0x00, 0x2c, 0x2c, 0x2c, 0x2c, 0x2c, 0x2c,\ |
| 7487 | | -/* 88 */ 0x2c, 0x2c, 0x2c, 0x2c, 0x00, 0x04, 0x02, 0x00,\ |
| 7488 | | -/* 96 */ 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,\ |
| 7489 | | -/* 104 */ 0x00, 0x01, 0x02, 0x08, 0x01, 0x11, 0x00, 0x02,\ |
| 7490 | | -/* 112 */ 0x02, 0x15, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02,\ |
| 7491 | | -/* 120 */ 0x00, 0x02, 0x01, 0x11, 0x00, 0x00, 0x05, 0x00,\ |
| 7492 | | -/* 128 */ 0x11, 0x05, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00,\ |
| 7496 | +/* 88 */ 0x2c, 0x2c, 0x2c, 0x2c, 0x04, 0x04, 0x02, 0x10,\ |
| 7497 | +/* 96 */ 0x01, 0x00, 0x01, 0x00, 0x04, 0x00, 0x02, 0x00,\ |
| 7498 | +/* 104 */ 0x05, 0x08, 0x00, 0x00, 0x00, 0x02, 0x10, 0x00,\ |
| 7499 | +/* 112 */ 0x02, 0x04, 0x00, 0x11, 0x00, 0x05, 0x00, 0x00,\ |
| 7500 | +/* 120 */ 0x00, 0x00, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01,\ |
| 7501 | +/* 128 */ 0x08, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00,\ |
| 7493 | 7502 | /* 136 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x04, 0x04,\ |
| 7494 | 7503 | /* 144 */ 0x04, 0x04,} |
| 7495 | 7504 | |
| 7496 | 7505 | /************** End of opcodes.h *********************************************/ |
| 7497 | 7506 | /************** Continuing where we left off in vdbe.h ***********************/ |
| | @@ -7534,14 +7543,13 @@ |
| 7534 | 7543 | SQLITE_PRIVATE sqlite3 *sqlite3VdbeDb(Vdbe*); |
| 7535 | 7544 | SQLITE_PRIVATE void sqlite3VdbeSetSql(Vdbe*, const char *z, int n, int); |
| 7536 | 7545 | SQLITE_PRIVATE void sqlite3VdbeSwap(Vdbe*,Vdbe*); |
| 7537 | 7546 | SQLITE_PRIVATE VdbeOp *sqlite3VdbeTakeOpArray(Vdbe*, int*, int*); |
| 7538 | 7547 | SQLITE_PRIVATE void sqlite3VdbeProgramDelete(sqlite3 *, SubProgram *, int); |
| 7548 | +SQLITE_PRIVATE sqlite3_value *sqlite3VdbeGetValue(Vdbe*, int, u8); |
| 7549 | +SQLITE_PRIVATE void sqlite3VdbeSetVarmask(Vdbe*, int); |
| 7539 | 7550 | |
| 7540 | | -#ifdef SQLITE_ENABLE_MEMORY_MANAGEMENT |
| 7541 | | -SQLITE_PRIVATE int sqlite3VdbeReleaseMemory(int); |
| 7542 | | -#endif |
| 7543 | 7551 | SQLITE_PRIVATE UnpackedRecord *sqlite3VdbeRecordUnpack(KeyInfo*,int,const void*,char*,int); |
| 7544 | 7552 | SQLITE_PRIVATE void sqlite3VdbeDeleteUnpackedRecord(UnpackedRecord*); |
| 7545 | 7553 | SQLITE_PRIVATE int sqlite3VdbeRecordCompare(int,const void*,UnpackedRecord*); |
| 7546 | 7554 | |
| 7547 | 7555 | |
| | @@ -9201,11 +9209,12 @@ |
| 9201 | 9209 | *********************************************************************/ |
| 9202 | 9210 | |
| 9203 | 9211 | int iTable; /* TK_COLUMN: cursor number of table holding column |
| 9204 | 9212 | ** TK_REGISTER: register number |
| 9205 | 9213 | ** TK_TRIGGER: 1 -> new, 0 -> old */ |
| 9206 | | - i16 iColumn; /* TK_COLUMN: column index. -1 for rowid */ |
| 9214 | + i16 iColumn; /* TK_COLUMN: column index. -1 for rowid. |
| 9215 | + ** TK_VARIABLE: variable number (always >= 1). */ |
| 9207 | 9216 | i16 iAgg; /* Which entry in pAggInfo->aCol[] or ->aFunc[] */ |
| 9208 | 9217 | i16 iRightJoinTable; /* If EP_FromJoin, the right table of the join */ |
| 9209 | 9218 | u8 flags2; /* Second set of flags. EP2_... */ |
| 9210 | 9219 | u8 op2; /* If a TK_REGISTER, the original value of Expr.op */ |
| 9211 | 9220 | AggInfo *pAggInfo; /* Used by TK_AGG_COLUMN and TK_AGG_FUNCTION */ |
| | @@ -9743,10 +9752,11 @@ |
| 9743 | 9752 | |
| 9744 | 9753 | int nVar; /* Number of '?' variables seen in the SQL so far */ |
| 9745 | 9754 | int nVarExpr; /* Number of used slots in apVarExpr[] */ |
| 9746 | 9755 | int nVarExprAlloc; /* Number of allocated slots in apVarExpr[] */ |
| 9747 | 9756 | Expr **apVarExpr; /* Pointers to :aaa and $aaaa wildcard expressions */ |
| 9757 | + Vdbe *pReprepare; /* VM being reprepared (sqlite3Reprepare()) */ |
| 9748 | 9758 | int nAlias; /* Number of aliased result set columns */ |
| 9749 | 9759 | int nAliasAlloc; /* Number of allocated slots for aAlias[] */ |
| 9750 | 9760 | int *aAlias; /* Register used to hold aliased result */ |
| 9751 | 9761 | u8 explain; /* True if the EXPLAIN flag is found on the query */ |
| 9752 | 9762 | Token sNameToken; /* Token with unqualified schema object name */ |
| | @@ -10252,11 +10262,10 @@ |
| 10252 | 10262 | SQLITE_PRIVATE char *sqlite3NameFromToken(sqlite3*, Token*); |
| 10253 | 10263 | SQLITE_PRIVATE int sqlite3ExprCompare(Expr*, Expr*); |
| 10254 | 10264 | SQLITE_PRIVATE void sqlite3ExprAnalyzeAggregates(NameContext*, Expr*); |
| 10255 | 10265 | SQLITE_PRIVATE void sqlite3ExprAnalyzeAggList(NameContext*,ExprList*); |
| 10256 | 10266 | SQLITE_PRIVATE Vdbe *sqlite3GetVdbe(Parse*); |
| 10257 | | -SQLITE_PRIVATE Expr *sqlite3CreateIdExpr(Parse *, const char*); |
| 10258 | 10267 | SQLITE_PRIVATE void sqlite3PrngSaveState(void); |
| 10259 | 10268 | SQLITE_PRIVATE void sqlite3PrngRestoreState(void); |
| 10260 | 10269 | SQLITE_PRIVATE void sqlite3PrngResetState(void); |
| 10261 | 10270 | SQLITE_PRIVATE void sqlite3RollbackAll(sqlite3*); |
| 10262 | 10271 | SQLITE_PRIVATE void sqlite3CodeVerifySchema(Parse*, int); |
| | @@ -10451,11 +10460,11 @@ |
| 10451 | 10460 | SQLITE_PRIVATE void sqlite3AlterFunctions(sqlite3*); |
| 10452 | 10461 | SQLITE_PRIVATE void sqlite3AlterRenameTable(Parse*, SrcList*, Token*); |
| 10453 | 10462 | SQLITE_PRIVATE int sqlite3GetToken(const unsigned char *, int *); |
| 10454 | 10463 | SQLITE_PRIVATE void sqlite3NestedParse(Parse*, const char*, ...); |
| 10455 | 10464 | SQLITE_PRIVATE void sqlite3ExpirePreparedStatements(sqlite3*); |
| 10456 | | -SQLITE_PRIVATE void sqlite3CodeSubselect(Parse *, Expr *, int, int); |
| 10465 | +SQLITE_PRIVATE int sqlite3CodeSubselect(Parse *, Expr *, int, int); |
| 10457 | 10466 | SQLITE_PRIVATE void sqlite3SelectPrep(Parse*, Select*, NameContext*); |
| 10458 | 10467 | SQLITE_PRIVATE int sqlite3ResolveExprNames(NameContext*, Expr*); |
| 10459 | 10468 | SQLITE_PRIVATE void sqlite3ResolveSelectNames(Parse*, Select*, NameContext*); |
| 10460 | 10469 | SQLITE_PRIVATE int sqlite3ResolveOrderGroupBy(Parse*, Select*, ExprList*, const char*); |
| 10461 | 10470 | SQLITE_PRIVATE void sqlite3ColumnDefault(Vdbe *, Table *, int, int); |
| | @@ -10486,10 +10495,11 @@ |
| 10486 | 10495 | SQLITE_PRIVATE void sqlite3StrAccumInit(StrAccum*, char*, int, int); |
| 10487 | 10496 | SQLITE_PRIVATE void sqlite3StrAccumAppend(StrAccum*,const char*,int); |
| 10488 | 10497 | SQLITE_PRIVATE char *sqlite3StrAccumFinish(StrAccum*); |
| 10489 | 10498 | SQLITE_PRIVATE void sqlite3StrAccumReset(StrAccum*); |
| 10490 | 10499 | SQLITE_PRIVATE void sqlite3SelectDestInit(SelectDest*,int,int); |
| 10500 | +SQLITE_PRIVATE Expr *sqlite3CreateColumnExpr(sqlite3 *, SrcList *, int, int); |
| 10491 | 10501 | |
| 10492 | 10502 | SQLITE_PRIVATE void sqlite3BackupRestart(sqlite3_backup *); |
| 10493 | 10503 | SQLITE_PRIVATE void sqlite3BackupUpdate(sqlite3_backup *, Pgno, const u8 *); |
| 10494 | 10504 | |
| 10495 | 10505 | /* |
| | @@ -15704,13 +15714,10 @@ |
| 15704 | 15714 | ** cache database pages that are not currently in use. |
| 15705 | 15715 | */ |
| 15706 | 15716 | SQLITE_API int sqlite3_release_memory(int n){ |
| 15707 | 15717 | #ifdef SQLITE_ENABLE_MEMORY_MANAGEMENT |
| 15708 | 15718 | int nRet = 0; |
| 15709 | | -#if 0 |
| 15710 | | - nRet += sqlite3VdbeReleaseMemory(n); |
| 15711 | | -#endif |
| 15712 | 15719 | nRet += sqlite3PcacheReleaseMemory(n-nRet); |
| 15713 | 15720 | return nRet; |
| 15714 | 15721 | #else |
| 15715 | 15722 | UNUSED_PARAMETER(n); |
| 15716 | 15723 | return SQLITE_OK; |
| | @@ -17828,10 +17835,11 @@ |
| 17828 | 17835 | #ifdef SQLITE_DEBUG |
| 17829 | 17836 | FILE *trace; /* Write an execution trace here, if not NULL */ |
| 17830 | 17837 | #endif |
| 17831 | 17838 | VdbeFrame *pFrame; /* Parent frame */ |
| 17832 | 17839 | int nFrame; /* Number of frames in pFrame list */ |
| 17840 | + u32 expmask; /* Binding to these vars invalidates VM */ |
| 17833 | 17841 | }; |
| 17834 | 17842 | |
| 17835 | 17843 | /* |
| 17836 | 17844 | ** The following are allowed values for Vdbe.magic |
| 17837 | 17845 | */ |
| | @@ -17890,13 +17898,11 @@ |
| 17890 | 17898 | SQLITE_PRIVATE int sqlite3VdbeOpcodeHasProperty(int, int); |
| 17891 | 17899 | SQLITE_PRIVATE int sqlite3VdbeMemGrow(Mem *pMem, int n, int preserve); |
| 17892 | 17900 | SQLITE_PRIVATE int sqlite3VdbeCloseStatement(Vdbe *, int); |
| 17893 | 17901 | SQLITE_PRIVATE void sqlite3VdbeFrameDelete(VdbeFrame*); |
| 17894 | 17902 | SQLITE_PRIVATE int sqlite3VdbeFrameRestore(VdbeFrame *); |
| 17895 | | -#ifdef SQLITE_ENABLE_MEMORY_MANAGEMENT |
| 17896 | | -SQLITE_PRIVATE int sqlite3VdbeReleaseBuffers(Vdbe *p); |
| 17897 | | -#endif |
| 17903 | +SQLITE_PRIVATE void sqlite3VdbeMemStoreType(Mem *pMem); |
| 17898 | 17904 | |
| 17899 | 17905 | #ifndef SQLITE_OMIT_FOREIGN_KEY |
| 17900 | 17906 | SQLITE_PRIVATE int sqlite3VdbeCheckFk(Vdbe *, int); |
| 17901 | 17907 | #else |
| 17902 | 17908 | # define sqlite3VdbeCheckFk(p,i) 0 |
| | @@ -17992,24 +17998,24 @@ |
| 17992 | 17998 | *zOut++ = (u8)(0x00DC + ((c>>8)&0x03)); \ |
| 17993 | 17999 | *zOut++ = (u8)(c&0x00FF); \ |
| 17994 | 18000 | } \ |
| 17995 | 18001 | } |
| 17996 | 18002 | |
| 17997 | | -#define READ_UTF16LE(zIn, c){ \ |
| 18003 | +#define READ_UTF16LE(zIn, TERM, c){ \ |
| 17998 | 18004 | c = (*zIn++); \ |
| 17999 | 18005 | c += ((*zIn++)<<8); \ |
| 18000 | | - if( c>=0xD800 && c<0xE000 ){ \ |
| 18006 | + if( c>=0xD800 && c<0xE000 && TERM ){ \ |
| 18001 | 18007 | int c2 = (*zIn++); \ |
| 18002 | 18008 | c2 += ((*zIn++)<<8); \ |
| 18003 | 18009 | c = (c2&0x03FF) + ((c&0x003F)<<10) + (((c&0x03C0)+0x0040)<<10); \ |
| 18004 | 18010 | } \ |
| 18005 | 18011 | } |
| 18006 | 18012 | |
| 18007 | | -#define READ_UTF16BE(zIn, c){ \ |
| 18013 | +#define READ_UTF16BE(zIn, TERM, c){ \ |
| 18008 | 18014 | c = ((*zIn++)<<8); \ |
| 18009 | 18015 | c += (*zIn++); \ |
| 18010 | | - if( c>=0xD800 && c<0xE000 ){ \ |
| 18016 | + if( c>=0xD800 && c<0xE000 && TERM ){ \ |
| 18011 | 18017 | int c2 = ((*zIn++)<<8); \ |
| 18012 | 18018 | c2 += (*zIn++); \ |
| 18013 | 18019 | c = (c2&0x03FF) + ((c&0x003F)<<10) + (((c&0x03C0)+0x0040)<<10); \ |
| 18014 | 18020 | } \ |
| 18015 | 18021 | } |
| | @@ -18190,17 +18196,17 @@ |
| 18190 | 18196 | }else{ |
| 18191 | 18197 | assert( desiredEnc==SQLITE_UTF8 ); |
| 18192 | 18198 | if( pMem->enc==SQLITE_UTF16LE ){ |
| 18193 | 18199 | /* UTF-16 Little-endian -> UTF-8 */ |
| 18194 | 18200 | while( zIn<zTerm ){ |
| 18195 | | - READ_UTF16LE(zIn, c); |
| 18201 | + READ_UTF16LE(zIn, zIn<zTerm, c); |
| 18196 | 18202 | WRITE_UTF8(z, c); |
| 18197 | 18203 | } |
| 18198 | 18204 | }else{ |
| 18199 | 18205 | /* UTF-16 Big-endian -> UTF-8 */ |
| 18200 | 18206 | while( zIn<zTerm ){ |
| 18201 | | - READ_UTF16BE(zIn, c); |
| 18207 | + READ_UTF16BE(zIn, zIn<zTerm, c); |
| 18202 | 18208 | WRITE_UTF8(z, c); |
| 18203 | 18209 | } |
| 18204 | 18210 | } |
| 18205 | 18211 | pMem->n = (int)(z - zOut); |
| 18206 | 18212 | } |
| | @@ -18366,35 +18372,27 @@ |
| 18366 | 18372 | return m.z; |
| 18367 | 18373 | } |
| 18368 | 18374 | #endif |
| 18369 | 18375 | |
| 18370 | 18376 | /* |
| 18371 | | -** pZ is a UTF-16 encoded unicode string at least nChar characters long. |
| 18377 | +** zIn is a UTF-16 encoded unicode string at least nChar characters long. |
| 18372 | 18378 | ** Return the number of bytes in the first nChar unicode characters |
| 18373 | 18379 | ** in pZ. nChar must be non-negative. |
| 18374 | 18380 | */ |
| 18375 | 18381 | SQLITE_PRIVATE int sqlite3Utf16ByteLen(const void *zIn, int nChar){ |
| 18376 | 18382 | int c; |
| 18377 | 18383 | unsigned char const *z = zIn; |
| 18378 | 18384 | int n = 0; |
| 18385 | + |
| 18379 | 18386 | if( SQLITE_UTF16NATIVE==SQLITE_UTF16BE ){ |
| 18380 | | - /* Using an "if (SQLITE_UTF16NATIVE==SQLITE_UTF16BE)" construct here |
| 18381 | | - ** and in other parts of this file means that at one branch will |
| 18382 | | - ** not be covered by coverage testing on any single host. But coverage |
| 18383 | | - ** will be complete if the tests are run on both a little-endian and |
| 18384 | | - ** big-endian host. Because both the UTF16NATIVE and SQLITE_UTF16BE |
| 18385 | | - ** macros are constant at compile time the compiler can determine |
| 18386 | | - ** which branch will be followed. It is therefore assumed that no runtime |
| 18387 | | - ** penalty is paid for this "if" statement. |
| 18388 | | - */ |
| 18389 | 18387 | while( n<nChar ){ |
| 18390 | | - READ_UTF16BE(z, c); |
| 18388 | + READ_UTF16BE(z, 1, c); |
| 18391 | 18389 | n++; |
| 18392 | 18390 | } |
| 18393 | 18391 | }else{ |
| 18394 | 18392 | while( n<nChar ){ |
| 18395 | | - READ_UTF16LE(z, c); |
| 18393 | + READ_UTF16LE(z, 1, c); |
| 18396 | 18394 | n++; |
| 18397 | 18395 | } |
| 18398 | 18396 | } |
| 18399 | 18397 | return (int)(z-(unsigned char const *)zIn); |
| 18400 | 18398 | } |
| | @@ -18432,11 +18430,11 @@ |
| 18432 | 18430 | WRITE_UTF16LE(z, i); |
| 18433 | 18431 | n = (int)(z-zBuf); |
| 18434 | 18432 | assert( n>0 && n<=4 ); |
| 18435 | 18433 | z[0] = 0; |
| 18436 | 18434 | z = zBuf; |
| 18437 | | - READ_UTF16LE(z, c); |
| 18435 | + READ_UTF16LE(z, 1, c); |
| 18438 | 18436 | assert( c==i ); |
| 18439 | 18437 | assert( (z-zBuf)==n ); |
| 18440 | 18438 | } |
| 18441 | 18439 | for(i=0; i<0x00110000; i++){ |
| 18442 | 18440 | if( i>=0xD800 && i<0xE000 ) continue; |
| | @@ -18444,11 +18442,11 @@ |
| 18444 | 18442 | WRITE_UTF16BE(z, i); |
| 18445 | 18443 | n = (int)(z-zBuf); |
| 18446 | 18444 | assert( n>0 && n<=4 ); |
| 18447 | 18445 | z[0] = 0; |
| 18448 | 18446 | z = zBuf; |
| 18449 | | - READ_UTF16BE(z, c); |
| 18447 | + READ_UTF16BE(z, 1, c); |
| 18450 | 18448 | assert( c==i ); |
| 18451 | 18449 | assert( (z-zBuf)==n ); |
| 18452 | 18450 | } |
| 18453 | 18451 | } |
| 18454 | 18452 | #endif /* SQLITE_TEST */ |
| | @@ -19834,91 +19832,91 @@ |
| 19834 | 19832 | /* Automatically generated. Do not edit */ |
| 19835 | 19833 | /* See the mkopcodec.awk script for details. */ |
| 19836 | 19834 | #if !defined(SQLITE_OMIT_EXPLAIN) || !defined(NDEBUG) || defined(VDBE_PROFILE) || defined(SQLITE_DEBUG) |
| 19837 | 19835 | SQLITE_PRIVATE const char *sqlite3OpcodeName(int i){ |
| 19838 | 19836 | static const char *const azName[] = { "?", |
| 19839 | | - /* 1 */ "VNext", |
| 19840 | | - /* 2 */ "Affinity", |
| 19841 | | - /* 3 */ "Column", |
| 19842 | | - /* 4 */ "SetCookie", |
| 19843 | | - /* 5 */ "Seek", |
| 19844 | | - /* 6 */ "Sequence", |
| 19845 | | - /* 7 */ "Savepoint", |
| 19846 | | - /* 8 */ "RowKey", |
| 19847 | | - /* 9 */ "SCopy", |
| 19848 | | - /* 10 */ "OpenWrite", |
| 19849 | | - /* 11 */ "If", |
| 19850 | | - /* 12 */ "CollSeq", |
| 19851 | | - /* 13 */ "OpenRead", |
| 19852 | | - /* 14 */ "Expire", |
| 19853 | | - /* 15 */ "AutoCommit", |
| 19854 | | - /* 16 */ "Pagecount", |
| 19855 | | - /* 17 */ "IntegrityCk", |
| 19856 | | - /* 18 */ "Sort", |
| 19837 | + /* 1 */ "ReadCookie", |
| 19838 | + /* 2 */ "AutoCommit", |
| 19839 | + /* 3 */ "Found", |
| 19840 | + /* 4 */ "NullRow", |
| 19841 | + /* 5 */ "RowSetTest", |
| 19842 | + /* 6 */ "Variable", |
| 19843 | + /* 7 */ "RealAffinity", |
| 19844 | + /* 8 */ "Sort", |
| 19845 | + /* 9 */ "Affinity", |
| 19846 | + /* 10 */ "IfNot", |
| 19847 | + /* 11 */ "Gosub", |
| 19848 | + /* 12 */ "NotFound", |
| 19849 | + /* 13 */ "ResultRow", |
| 19850 | + /* 14 */ "SeekLe", |
| 19851 | + /* 15 */ "Rowid", |
| 19852 | + /* 16 */ "CreateIndex", |
| 19853 | + /* 17 */ "Explain", |
| 19854 | + /* 18 */ "DropIndex", |
| 19857 | 19855 | /* 19 */ "Not", |
| 19858 | | - /* 20 */ "Copy", |
| 19859 | | - /* 21 */ "Trace", |
| 19860 | | - /* 22 */ "Function", |
| 19861 | | - /* 23 */ "IfNeg", |
| 19862 | | - /* 24 */ "Noop", |
| 19863 | | - /* 25 */ "Program", |
| 19864 | | - /* 26 */ "Return", |
| 19865 | | - /* 27 */ "NewRowid", |
| 19866 | | - /* 28 */ "FkCounter", |
| 19867 | | - /* 29 */ "Variable", |
| 19868 | | - /* 30 */ "String", |
| 19869 | | - /* 31 */ "RealAffinity", |
| 19870 | | - /* 32 */ "VRename", |
| 19871 | | - /* 33 */ "ParseSchema", |
| 19872 | | - /* 34 */ "VOpen", |
| 19873 | | - /* 35 */ "Close", |
| 19874 | | - /* 36 */ "CreateIndex", |
| 19875 | | - /* 37 */ "IsUnique", |
| 19876 | | - /* 38 */ "NotFound", |
| 19877 | | - /* 39 */ "Int64", |
| 19878 | | - /* 40 */ "MustBeInt", |
| 19879 | | - /* 41 */ "Halt", |
| 19880 | | - /* 42 */ "Rowid", |
| 19881 | | - /* 43 */ "IdxLT", |
| 19882 | | - /* 44 */ "AddImm", |
| 19883 | | - /* 45 */ "RowData", |
| 19884 | | - /* 46 */ "MemMax", |
| 19885 | | - /* 47 */ "NotExists", |
| 19886 | | - /* 48 */ "Gosub", |
| 19887 | | - /* 49 */ "Integer", |
| 19888 | | - /* 50 */ "Prev", |
| 19889 | | - /* 51 */ "RowSetRead", |
| 19890 | | - /* 52 */ "RowSetAdd", |
| 19891 | | - /* 53 */ "VColumn", |
| 19892 | | - /* 54 */ "CreateTable", |
| 19893 | | - /* 55 */ "Last", |
| 19894 | | - /* 56 */ "SeekLe", |
| 19895 | | - /* 57 */ "IncrVacuum", |
| 19896 | | - /* 58 */ "IdxRowid", |
| 19897 | | - /* 59 */ "ResetCount", |
| 19898 | | - /* 60 */ "Yield", |
| 19899 | | - /* 61 */ "DropTrigger", |
| 19900 | | - /* 62 */ "DropIndex", |
| 19901 | | - /* 63 */ "Param", |
| 19902 | | - /* 64 */ "IdxGE", |
| 19903 | | - /* 65 */ "IdxDelete", |
| 19904 | | - /* 66 */ "Vacuum", |
| 19905 | | - /* 67 */ "IfNot", |
| 19856 | + /* 20 */ "Null", |
| 19857 | + /* 21 */ "Program", |
| 19858 | + /* 22 */ "Int64", |
| 19859 | + /* 23 */ "LoadAnalysis", |
| 19860 | + /* 24 */ "IdxInsert", |
| 19861 | + /* 25 */ "VUpdate", |
| 19862 | + /* 26 */ "Next", |
| 19863 | + /* 27 */ "SeekLt", |
| 19864 | + /* 28 */ "Rewind", |
| 19865 | + /* 29 */ "RowSetRead", |
| 19866 | + /* 30 */ "Last", |
| 19867 | + /* 31 */ "MustBeInt", |
| 19868 | + /* 32 */ "IncrVacuum", |
| 19869 | + /* 33 */ "String", |
| 19870 | + /* 34 */ "VFilter", |
| 19871 | + /* 35 */ "Count", |
| 19872 | + /* 36 */ "Close", |
| 19873 | + /* 37 */ "AggFinal", |
| 19874 | + /* 38 */ "RowData", |
| 19875 | + /* 39 */ "IdxRowid", |
| 19876 | + /* 40 */ "Param", |
| 19877 | + /* 41 */ "Pagecount", |
| 19878 | + /* 42 */ "SeekGe", |
| 19879 | + /* 43 */ "OpenPseudo", |
| 19880 | + /* 44 */ "Halt", |
| 19881 | + /* 45 */ "Compare", |
| 19882 | + /* 46 */ "NewRowid", |
| 19883 | + /* 47 */ "IdxLT", |
| 19884 | + /* 48 */ "SeekGt", |
| 19885 | + /* 49 */ "MemMax", |
| 19886 | + /* 50 */ "Function", |
| 19887 | + /* 51 */ "IntegrityCk", |
| 19888 | + /* 52 */ "FkCounter", |
| 19889 | + /* 53 */ "SCopy", |
| 19890 | + /* 54 */ "IfNeg", |
| 19891 | + /* 55 */ "NotExists", |
| 19892 | + /* 56 */ "VDestroy", |
| 19893 | + /* 57 */ "IdxDelete", |
| 19894 | + /* 58 */ "Vacuum", |
| 19895 | + /* 59 */ "Copy", |
| 19896 | + /* 60 */ "If", |
| 19897 | + /* 61 */ "Jump", |
| 19898 | + /* 62 */ "Destroy", |
| 19899 | + /* 63 */ "AggStep", |
| 19900 | + /* 64 */ "Clear", |
| 19901 | + /* 65 */ "Insert", |
| 19902 | + /* 66 */ "Permutation", |
| 19903 | + /* 67 */ "VBegin", |
| 19906 | 19904 | /* 68 */ "Or", |
| 19907 | 19905 | /* 69 */ "And", |
| 19908 | | - /* 70 */ "DropTable", |
| 19909 | | - /* 71 */ "SeekLt", |
| 19910 | | - /* 72 */ "MakeRecord", |
| 19906 | + /* 70 */ "OpenEphemeral", |
| 19907 | + /* 71 */ "IdxGE", |
| 19908 | + /* 72 */ "Trace", |
| 19911 | 19909 | /* 73 */ "IsNull", |
| 19912 | 19910 | /* 74 */ "NotNull", |
| 19913 | 19911 | /* 75 */ "Ne", |
| 19914 | 19912 | /* 76 */ "Eq", |
| 19915 | 19913 | /* 77 */ "Gt", |
| 19916 | 19914 | /* 78 */ "Le", |
| 19917 | 19915 | /* 79 */ "Lt", |
| 19918 | 19916 | /* 80 */ "Ge", |
| 19919 | | - /* 81 */ "ResultRow", |
| 19917 | + /* 81 */ "MakeRecord", |
| 19920 | 19918 | /* 82 */ "BitAnd", |
| 19921 | 19919 | /* 83 */ "BitOr", |
| 19922 | 19920 | /* 84 */ "ShiftLeft", |
| 19923 | 19921 | /* 85 */ "ShiftRight", |
| 19924 | 19922 | /* 86 */ "Add", |
| | @@ -19925,53 +19923,53 @@ |
| 19925 | 19923 | /* 87 */ "Subtract", |
| 19926 | 19924 | /* 88 */ "Multiply", |
| 19927 | 19925 | /* 89 */ "Divide", |
| 19928 | 19926 | /* 90 */ "Remainder", |
| 19929 | 19927 | /* 91 */ "Concat", |
| 19930 | | - /* 92 */ "Delete", |
| 19928 | + /* 92 */ "Yield", |
| 19931 | 19929 | /* 93 */ "BitNot", |
| 19932 | 19930 | /* 94 */ "String8", |
| 19933 | | - /* 95 */ "AggFinal", |
| 19934 | | - /* 96 */ "Compare", |
| 19935 | | - /* 97 */ "Goto", |
| 19936 | | - /* 98 */ "TableLock", |
| 19937 | | - /* 99 */ "Clear", |
| 19938 | | - /* 100 */ "VerifyCookie", |
| 19939 | | - /* 101 */ "AggStep", |
| 19940 | | - /* 102 */ "Transaction", |
| 19941 | | - /* 103 */ "VFilter", |
| 19942 | | - /* 104 */ "VDestroy", |
| 19943 | | - /* 105 */ "Next", |
| 19944 | | - /* 106 */ "Count", |
| 19945 | | - /* 107 */ "IdxInsert", |
| 19946 | | - /* 108 */ "FkIfZero", |
| 19947 | | - /* 109 */ "SeekGe", |
| 19948 | | - /* 110 */ "Insert", |
| 19949 | | - /* 111 */ "Destroy", |
| 19950 | | - /* 112 */ "ReadCookie", |
| 19951 | | - /* 113 */ "RowSetTest", |
| 19952 | | - /* 114 */ "LoadAnalysis", |
| 19953 | | - /* 115 */ "Explain", |
| 19954 | | - /* 116 */ "HaltIfNull", |
| 19955 | | - /* 117 */ "OpenPseudo", |
| 19956 | | - /* 118 */ "OpenEphemeral", |
| 19957 | | - /* 119 */ "Null", |
| 19958 | | - /* 120 */ "Move", |
| 19959 | | - /* 121 */ "Blob", |
| 19960 | | - /* 122 */ "Rewind", |
| 19961 | | - /* 123 */ "SeekGt", |
| 19962 | | - /* 124 */ "VBegin", |
| 19963 | | - /* 125 */ "VUpdate", |
| 19964 | | - /* 126 */ "IfZero", |
| 19965 | | - /* 127 */ "VCreate", |
| 19966 | | - /* 128 */ "Found", |
| 19967 | | - /* 129 */ "IfPos", |
| 19931 | + /* 95 */ "SetCookie", |
| 19932 | + /* 96 */ "Prev", |
| 19933 | + /* 97 */ "DropTrigger", |
| 19934 | + /* 98 */ "FkIfZero", |
| 19935 | + /* 99 */ "VColumn", |
| 19936 | + /* 100 */ "Return", |
| 19937 | + /* 101 */ "OpenWrite", |
| 19938 | + /* 102 */ "Integer", |
| 19939 | + /* 103 */ "Transaction", |
| 19940 | + /* 104 */ "IfPos", |
| 19941 | + /* 105 */ "RowSetAdd", |
| 19942 | + /* 106 */ "CollSeq", |
| 19943 | + /* 107 */ "Savepoint", |
| 19944 | + /* 108 */ "VRename", |
| 19945 | + /* 109 */ "Sequence", |
| 19946 | + /* 110 */ "HaltIfNull", |
| 19947 | + /* 111 */ "VCreate", |
| 19948 | + /* 112 */ "CreateTable", |
| 19949 | + /* 113 */ "AddImm", |
| 19950 | + /* 114 */ "DropTable", |
| 19951 | + /* 115 */ "IsUnique", |
| 19952 | + /* 116 */ "VOpen", |
| 19953 | + /* 117 */ "IfZero", |
| 19954 | + /* 118 */ "Noop", |
| 19955 | + /* 119 */ "InsertInt", |
| 19956 | + /* 120 */ "RowKey", |
| 19957 | + /* 121 */ "Expire", |
| 19958 | + /* 122 */ "Delete", |
| 19959 | + /* 123 */ "Blob", |
| 19960 | + /* 124 */ "Move", |
| 19961 | + /* 125 */ "Goto", |
| 19962 | + /* 126 */ "ParseSchema", |
| 19963 | + /* 127 */ "VNext", |
| 19964 | + /* 128 */ "Seek", |
| 19965 | + /* 129 */ "TableLock", |
| 19968 | 19966 | /* 130 */ "Real", |
| 19969 | | - /* 131 */ "NullRow", |
| 19970 | | - /* 132 */ "Jump", |
| 19971 | | - /* 133 */ "Permutation", |
| 19972 | | - /* 134 */ "NotUsed_134", |
| 19967 | + /* 131 */ "VerifyCookie", |
| 19968 | + /* 132 */ "Column", |
| 19969 | + /* 133 */ "OpenRead", |
| 19970 | + /* 134 */ "ResetCount", |
| 19973 | 19971 | /* 135 */ "NotUsed_135", |
| 19974 | 19972 | /* 136 */ "NotUsed_136", |
| 19975 | 19973 | /* 137 */ "NotUsed_137", |
| 19976 | 19974 | /* 138 */ "NotUsed_138", |
| 19977 | 19975 | /* 139 */ "NotUsed_139", |
| | @@ -24102,11 +24100,12 @@ |
| 24102 | 24100 | |
| 24103 | 24101 | /* If control gets to this point, then actually go ahead and make |
| 24104 | 24102 | ** operating system calls for the specified lock. |
| 24105 | 24103 | */ |
| 24106 | 24104 | if( locktype==SHARED_LOCK ){ |
| 24107 | | - int lk, lrc1, lrc2, lrc1Errno; |
| 24105 | + int lk, lrc1, lrc2; |
| 24106 | + int lrc1Errno = 0; |
| 24108 | 24107 | |
| 24109 | 24108 | /* Now get the read-lock SHARED_LOCK */ |
| 24110 | 24109 | /* note that the quality of the randomness doesn't matter that much */ |
| 24111 | 24110 | lk = random(); |
| 24112 | 24111 | context->sharedByte = (lk & 0x7fffffff)%(SHARED_SIZE - 1); |
| | @@ -27247,11 +27246,11 @@ |
| 27247 | 27246 | ** Determine if we are dealing with WindowsCE - which has a much |
| 27248 | 27247 | ** reduced API. |
| 27249 | 27248 | */ |
| 27250 | 27249 | #if SQLITE_OS_WINCE |
| 27251 | 27250 | # define AreFileApisANSI() 1 |
| 27252 | | -# define GetDiskFreeSpaceW() 0 |
| 27251 | +# define FormatMessageW(a,b,c,d,e,f,g) 0 |
| 27253 | 27252 | #endif |
| 27254 | 27253 | |
| 27255 | 27254 | /* |
| 27256 | 27255 | ** WinCE lacks native support for file locking so we have to fake it |
| 27257 | 27256 | ** with some code of our own. |
| | @@ -28421,31 +28420,63 @@ |
| 28421 | 28420 | ** The return value of getLastErrorMsg |
| 28422 | 28421 | ** is zero if the error message fits in the buffer, or non-zero |
| 28423 | 28422 | ** otherwise (if the message was truncated). |
| 28424 | 28423 | */ |
| 28425 | 28424 | static int getLastErrorMsg(int nBuf, char *zBuf){ |
| 28426 | | - DWORD error = GetLastError(); |
| 28427 | | - |
| 28428 | | -#if SQLITE_OS_WINCE |
| 28429 | | - sqlite3_snprintf(nBuf, zBuf, "OsError 0x%x (%u)", error, error); |
| 28430 | | -#else |
| 28431 | 28425 | /* FormatMessage returns 0 on failure. Otherwise it |
| 28432 | 28426 | ** returns the number of TCHARs written to the output |
| 28433 | 28427 | ** buffer, excluding the terminating null char. |
| 28434 | 28428 | */ |
| 28435 | | - if (!FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM, |
| 28436 | | - NULL, |
| 28437 | | - error, |
| 28438 | | - 0, |
| 28439 | | - zBuf, |
| 28440 | | - nBuf-1, |
| 28441 | | - 0)) |
| 28442 | | - { |
| 28429 | + DWORD error = GetLastError(); |
| 28430 | + DWORD dwLen = 0; |
| 28431 | + char *zOut; |
| 28432 | + |
| 28433 | + if( isNT() ){ |
| 28434 | + WCHAR *zTempWide = NULL; |
| 28435 | + dwLen = FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, |
| 28436 | + NULL, |
| 28437 | + error, |
| 28438 | + 0, |
| 28439 | + (LPWSTR) &zTempWide, |
| 28440 | + 0, |
| 28441 | + 0); |
| 28442 | + if( dwLen > 0 ){ |
| 28443 | + /* allocate a buffer and convert to UTF8 */ |
| 28444 | + zOut = unicodeToUtf8(zTempWide); |
| 28445 | + /* free the system buffer allocated by FormatMessage */ |
| 28446 | + LocalFree(zTempWide); |
| 28447 | + } |
| 28448 | +/* isNT() is 1 if SQLITE_OS_WINCE==1, so this else is never executed. |
| 28449 | +** Since the ASCII version of these Windows API do not exist for WINCE, |
| 28450 | +** it's important to not reference them for WINCE builds. |
| 28451 | +*/ |
| 28452 | +#if SQLITE_OS_WINCE==0 |
| 28453 | + }else{ |
| 28454 | + char *zTemp = NULL; |
| 28455 | + dwLen = FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, |
| 28456 | + NULL, |
| 28457 | + error, |
| 28458 | + 0, |
| 28459 | + (LPSTR) &zTemp, |
| 28460 | + 0, |
| 28461 | + 0); |
| 28462 | + if( dwLen > 0 ){ |
| 28463 | + /* allocate a buffer and convert to UTF8 */ |
| 28464 | + zOut = sqlite3_win32_mbcs_to_utf8(zTemp); |
| 28465 | + /* free the system buffer allocated by FormatMessage */ |
| 28466 | + LocalFree(zTemp); |
| 28467 | + } |
| 28468 | +#endif |
| 28469 | + } |
| 28470 | + if( 0 == dwLen ){ |
| 28443 | 28471 | sqlite3_snprintf(nBuf, zBuf, "OsError 0x%x (%u)", error, error); |
| 28472 | + }else{ |
| 28473 | + /* copy a maximum of nBuf chars to output buffer */ |
| 28474 | + sqlite3_snprintf(nBuf, zBuf, "%s", zOut); |
| 28475 | + /* free the UTF8 buffer */ |
| 28476 | + free(zOut); |
| 28444 | 28477 | } |
| 28445 | | -#endif |
| 28446 | | - |
| 28447 | 28478 | return 0; |
| 28448 | 28479 | } |
| 28449 | 28480 | |
| 28450 | 28481 | /* |
| 28451 | 28482 | ** Open a file. |
| | @@ -28809,18 +28840,18 @@ |
| 28809 | 28840 | &bytesPerSector, |
| 28810 | 28841 | &dwDummy, |
| 28811 | 28842 | &dwDummy); |
| 28812 | 28843 | }else{ |
| 28813 | 28844 | /* trim path to just drive reference */ |
| 28814 | | - CHAR *p = (CHAR *)zConverted; |
| 28845 | + char *p = (char *)zConverted; |
| 28815 | 28846 | for(;*p;p++){ |
| 28816 | 28847 | if( *p == '\\' ){ |
| 28817 | 28848 | *p = '\0'; |
| 28818 | 28849 | break; |
| 28819 | 28850 | } |
| 28820 | 28851 | } |
| 28821 | | - dwRet = GetDiskFreeSpaceA((CHAR*)zConverted, |
| 28852 | + dwRet = GetDiskFreeSpaceA((char*)zConverted, |
| 28822 | 28853 | &dwDummy, |
| 28823 | 28854 | &bytesPerSector, |
| 28824 | 28855 | &dwDummy, |
| 28825 | 28856 | &dwDummy); |
| 28826 | 28857 | } |
| | @@ -36675,13 +36706,13 @@ |
| 36675 | 36706 | ** |
| 36676 | 36707 | ** FORMAT DETAILS |
| 36677 | 36708 | ** |
| 36678 | 36709 | ** The file is divided into pages. The first page is called page 1, |
| 36679 | 36710 | ** the second is page 2, and so forth. A page number of zero indicates |
| 36680 | | -** "no such page". The page size can be anything between 512 and 65536. |
| 36681 | | -** Each page can be either a btree page, a freelist page or an overflow |
| 36682 | | -** page. |
| 36711 | +** "no such page". The page size can be any power of 2 between 512 and 32768. |
| 36712 | +** Each page can be either a btree page, a freelist page, an overflow |
| 36713 | +** page, or a pointer-map page. |
| 36683 | 36714 | ** |
| 36684 | 36715 | ** The first page is always a btree page. The first 100 bytes of the first |
| 36685 | 36716 | ** page contain a special header (the "file header") that describes the file. |
| 36686 | 36717 | ** The format of the file header is as follows: |
| 36687 | 36718 | ** |
| | @@ -36955,12 +36986,12 @@ |
| 36955 | 36986 | ** is opaque to the database connection. The database connection cannot |
| 36956 | 36987 | ** see the internals of this structure and only deals with pointers to |
| 36957 | 36988 | ** this structure. |
| 36958 | 36989 | ** |
| 36959 | 36990 | ** For some database files, the same underlying database cache might be |
| 36960 | | -** shared between multiple connections. In that case, each contection |
| 36961 | | -** has it own pointer to this object. But each instance of this object |
| 36991 | +** shared between multiple connections. In that case, each connection |
| 36992 | +** has it own instance of this object. But each instance of this object |
| 36962 | 36993 | ** points to the same BtShared object. The database cache and the |
| 36963 | 36994 | ** schema associated with the database file are all contained within |
| 36964 | 36995 | ** the BtShared object. |
| 36965 | 36996 | ** |
| 36966 | 36997 | ** All fields in this structure are accessed under sqlite3.mutex. |
| | @@ -37097,11 +37128,11 @@ |
| 37097 | 37128 | ** b-tree within a database file. |
| 37098 | 37129 | ** |
| 37099 | 37130 | ** The entry is identified by its MemPage and the index in |
| 37100 | 37131 | ** MemPage.aCell[] of the entry. |
| 37101 | 37132 | ** |
| 37102 | | -** When a single database file can shared by two more database connections, |
| 37133 | +** A single database file can shared by two more database connections, |
| 37103 | 37134 | ** but cursors cannot be shared. Each cursor is associated with a |
| 37104 | 37135 | ** particular database connection identified BtCursor.pBtree.db. |
| 37105 | 37136 | ** |
| 37106 | 37137 | ** Fields in this structure are accessed under the BtShared.mutex |
| 37107 | 37138 | ** found at self->pBt->mutex. |
| | @@ -37701,26 +37732,28 @@ |
| 37701 | 37732 | |
| 37702 | 37733 | #ifndef SQLITE_OMIT_SHARED_CACHE |
| 37703 | 37734 | |
| 37704 | 37735 | #ifdef SQLITE_DEBUG |
| 37705 | 37736 | /* |
| 37706 | | -** This function is only used as part of an assert() statement. It checks |
| 37707 | | -** that connection p holds the required locks to read or write to the |
| 37708 | | -** b-tree with root page iRoot. If so, true is returned. Otherwise, false. |
| 37709 | | -** For example, when writing to a table b-tree with root-page iRoot via |
| 37737 | +**** This function is only used as part of an assert() statement. *** |
| 37738 | +** |
| 37739 | +** Check to see if pBtree holds the required locks to read or write to the |
| 37740 | +** table with root page iRoot. Return 1 if it does and 0 if not. |
| 37741 | +** |
| 37742 | +** For example, when writing to a table with root-page iRoot via |
| 37710 | 37743 | ** Btree connection pBtree: |
| 37711 | 37744 | ** |
| 37712 | 37745 | ** assert( hasSharedCacheTableLock(pBtree, iRoot, 0, WRITE_LOCK) ); |
| 37713 | 37746 | ** |
| 37714 | | -** When writing to an index b-tree that resides in a sharable database, the |
| 37747 | +** When writing to an index that resides in a sharable database, the |
| 37715 | 37748 | ** caller should have first obtained a lock specifying the root page of |
| 37716 | | -** the corresponding table b-tree. This makes things a bit more complicated, |
| 37717 | | -** as this module treats each b-tree as a separate structure. To determine |
| 37718 | | -** the table b-tree corresponding to the index b-tree being written, this |
| 37749 | +** the corresponding table. This makes things a bit more complicated, |
| 37750 | +** as this module treats each table as a separate structure. To determine |
| 37751 | +** the table corresponding to the index being written, this |
| 37719 | 37752 | ** function has to search through the database schema. |
| 37720 | 37753 | ** |
| 37721 | | -** Instead of a lock on the b-tree rooted at page iRoot, the caller may |
| 37754 | +** Instead of a lock on the table/index rooted at page iRoot, the caller may |
| 37722 | 37755 | ** hold a write-lock on the schema table (root page 1). This is also |
| 37723 | 37756 | ** acceptable. |
| 37724 | 37757 | */ |
| 37725 | 37758 | static int hasSharedCacheTableLock( |
| 37726 | 37759 | Btree *pBtree, /* Handle that must hold lock */ |
| | @@ -37730,23 +37763,28 @@ |
| 37730 | 37763 | ){ |
| 37731 | 37764 | Schema *pSchema = (Schema *)pBtree->pBt->pSchema; |
| 37732 | 37765 | Pgno iTab = 0; |
| 37733 | 37766 | BtLock *pLock; |
| 37734 | 37767 | |
| 37735 | | - /* If this b-tree database is not shareable, or if the client is reading |
| 37768 | + /* If this database is not shareable, or if the client is reading |
| 37736 | 37769 | ** and has the read-uncommitted flag set, then no lock is required. |
| 37737 | | - ** In these cases return true immediately. If the client is reading |
| 37738 | | - ** or writing an index b-tree, but the schema is not loaded, then return |
| 37739 | | - ** true also. In this case the lock is required, but it is too difficult |
| 37740 | | - ** to check if the client actually holds it. This doesn't happen very |
| 37741 | | - ** often. */ |
| 37770 | + ** Return true immediately. |
| 37771 | + */ |
| 37742 | 37772 | if( (pBtree->sharable==0) |
| 37743 | 37773 | || (eLockType==READ_LOCK && (pBtree->db->flags & SQLITE_ReadUncommitted)) |
| 37744 | | - || (isIndex && (!pSchema || (pSchema->flags&DB_SchemaLoaded)==0 )) |
| 37745 | 37774 | ){ |
| 37746 | 37775 | return 1; |
| 37747 | 37776 | } |
| 37777 | + |
| 37778 | + /* If the client is reading or writing an index and the schema is |
| 37779 | + ** not loaded, then it is too difficult to actually check to see if |
| 37780 | + ** the correct locks are held. So do not bother - just return true. |
| 37781 | + ** This case does not come up very often anyhow. |
| 37782 | + */ |
| 37783 | + if( isIndex && (!pSchema || (pSchema->flags&DB_SchemaLoaded)==0) ){ |
| 37784 | + return 1; |
| 37785 | + } |
| 37748 | 37786 | |
| 37749 | 37787 | /* Figure out the root-page that the lock should be held on. For table |
| 37750 | 37788 | ** b-trees, this is just the root page of the b-tree being read or |
| 37751 | 37789 | ** written. For index b-trees, it is the root page of the associated |
| 37752 | 37790 | ** table. */ |
| | @@ -37775,18 +37813,28 @@ |
| 37775 | 37813 | } |
| 37776 | 37814 | |
| 37777 | 37815 | /* Failed to find the required lock. */ |
| 37778 | 37816 | return 0; |
| 37779 | 37817 | } |
| 37780 | | - |
| 37781 | | -/* |
| 37782 | | -** This function is also used as part of assert() statements only. It |
| 37783 | | -** returns true if there exist one or more cursors open on the table |
| 37784 | | -** with root page iRoot that do not belong to either connection pBtree |
| 37785 | | -** or some other connection that has the read-uncommitted flag set. |
| 37786 | | -** |
| 37787 | | -** For example, before writing to page iRoot: |
| 37818 | +#endif /* SQLITE_DEBUG */ |
| 37819 | + |
| 37820 | +#ifdef SQLITE_DEBUG |
| 37821 | +/* |
| 37822 | +**** This function may be used as part of assert() statements only. **** |
| 37823 | +** |
| 37824 | +** Return true if it would be illegal for pBtree to write into the |
| 37825 | +** table or index rooted at iRoot because other shared connections are |
| 37826 | +** simultaneously reading that same table or index. |
| 37827 | +** |
| 37828 | +** It is illegal for pBtree to write if some other Btree object that |
| 37829 | +** shares the same BtShared object is currently reading or writing |
| 37830 | +** the iRoot table. Except, if the other Btree object has the |
| 37831 | +** read-uncommitted flag set, then it is OK for the other object to |
| 37832 | +** have a read cursor. |
| 37833 | +** |
| 37834 | +** For example, before writing to any part of the table or index |
| 37835 | +** rooted at page iRoot, one should call: |
| 37788 | 37836 | ** |
| 37789 | 37837 | ** assert( !hasReadConflicts(pBtree, iRoot) ); |
| 37790 | 37838 | */ |
| 37791 | 37839 | static int hasReadConflicts(Btree *pBtree, Pgno iRoot){ |
| 37792 | 37840 | BtCursor *p; |
| | @@ -37801,11 +37849,11 @@ |
| 37801 | 37849 | return 0; |
| 37802 | 37850 | } |
| 37803 | 37851 | #endif /* #ifdef SQLITE_DEBUG */ |
| 37804 | 37852 | |
| 37805 | 37853 | /* |
| 37806 | | -** Query to see if btree handle p may obtain a lock of type eLock |
| 37854 | +** Query to see if Btree handle p may obtain a lock of type eLock |
| 37807 | 37855 | ** (READ_LOCK or WRITE_LOCK) on the table with root-page iTab. Return |
| 37808 | 37856 | ** SQLITE_OK if the lock may be obtained (by calling |
| 37809 | 37857 | ** setSharedCacheTableLock()), or SQLITE_LOCKED if not. |
| 37810 | 37858 | */ |
| 37811 | 37859 | static int querySharedCacheTableLock(Btree *p, Pgno iTab, u8 eLock){ |
| | @@ -37822,11 +37870,11 @@ |
| 37822 | 37870 | ** must be an open write transaction on the file itself. |
| 37823 | 37871 | */ |
| 37824 | 37872 | assert( eLock==READ_LOCK || (p==pBt->pWriter && p->inTrans==TRANS_WRITE) ); |
| 37825 | 37873 | assert( eLock==READ_LOCK || pBt->inTransaction==TRANS_WRITE ); |
| 37826 | 37874 | |
| 37827 | | - /* This is a no-op if the shared-cache is not enabled */ |
| 37875 | + /* This routine is a no-op if the shared-cache is not enabled */ |
| 37828 | 37876 | if( !p->sharable ){ |
| 37829 | 37877 | return SQLITE_OK; |
| 37830 | 37878 | } |
| 37831 | 37879 | |
| 37832 | 37880 | /* If some other connection is holding an exclusive lock, the |
| | @@ -37868,14 +37916,14 @@ |
| 37868 | 37916 | ** by Btree handle p. Parameter eLock must be either READ_LOCK or |
| 37869 | 37917 | ** WRITE_LOCK. |
| 37870 | 37918 | ** |
| 37871 | 37919 | ** This function assumes the following: |
| 37872 | 37920 | ** |
| 37873 | | -** (a) The specified b-tree connection handle is connected to a sharable |
| 37874 | | -** b-tree database (one with the BtShared.sharable) flag set, and |
| 37921 | +** (a) The specified Btree object p is connected to a sharable |
| 37922 | +** database (one with the BtShared.sharable flag set), and |
| 37875 | 37923 | ** |
| 37876 | | -** (b) No other b-tree connection handle holds a lock that conflicts |
| 37924 | +** (b) No other Btree objects hold a lock that conflicts |
| 37877 | 37925 | ** with the requested lock (i.e. querySharedCacheTableLock() has |
| 37878 | 37926 | ** already been called and returned SQLITE_OK). |
| 37879 | 37927 | ** |
| 37880 | 37928 | ** SQLITE_OK is returned if the lock is added successfully. SQLITE_NOMEM |
| 37881 | 37929 | ** is returned if a malloc attempt fails. |
| | @@ -37936,13 +37984,13 @@ |
| 37936 | 37984 | #endif /* !SQLITE_OMIT_SHARED_CACHE */ |
| 37937 | 37985 | |
| 37938 | 37986 | #ifndef SQLITE_OMIT_SHARED_CACHE |
| 37939 | 37987 | /* |
| 37940 | 37988 | ** Release all the table locks (locks obtained via calls to |
| 37941 | | -** the setSharedCacheTableLock() procedure) held by Btree handle p. |
| 37989 | +** the setSharedCacheTableLock() procedure) held by Btree object p. |
| 37942 | 37990 | ** |
| 37943 | | -** This function assumes that handle p has an open read or write |
| 37991 | +** This function assumes that Btree p has an open read or write |
| 37944 | 37992 | ** transaction. If it does not, then the BtShared.isPending variable |
| 37945 | 37993 | ** may be incorrectly cleared. |
| 37946 | 37994 | */ |
| 37947 | 37995 | static void clearAllSharedCacheTableLocks(Btree *p){ |
| 37948 | 37996 | BtShared *pBt = p->pBt; |
| | @@ -37971,11 +38019,11 @@ |
| 37971 | 38019 | if( pBt->pWriter==p ){ |
| 37972 | 38020 | pBt->pWriter = 0; |
| 37973 | 38021 | pBt->isExclusive = 0; |
| 37974 | 38022 | pBt->isPending = 0; |
| 37975 | 38023 | }else if( pBt->nTransaction==2 ){ |
| 37976 | | - /* This function is called when connection p is concluding its |
| 38024 | + /* This function is called when Btree p is concluding its |
| 37977 | 38025 | ** transaction. If there currently exists a writer, and p is not |
| 37978 | 38026 | ** that writer, then the number of locks held by connections other |
| 37979 | 38027 | ** than the writer must be about to drop to zero. In this case |
| 37980 | 38028 | ** set the isPending flag to 0. |
| 37981 | 38029 | ** |
| | @@ -37985,11 +38033,11 @@ |
| 37985 | 38033 | pBt->isPending = 0; |
| 37986 | 38034 | } |
| 37987 | 38035 | } |
| 37988 | 38036 | |
| 37989 | 38037 | /* |
| 37990 | | -** This function changes all write-locks held by connection p to read-locks. |
| 38038 | +** This function changes all write-locks held by Btree p into read-locks. |
| 37991 | 38039 | */ |
| 37992 | 38040 | static void downgradeAllSharedCacheTableLocks(Btree *p){ |
| 37993 | 38041 | BtShared *pBt = p->pBt; |
| 37994 | 38042 | if( pBt->pWriter==p ){ |
| 37995 | 38043 | BtLock *pLock; |
| | @@ -38006,13 +38054,15 @@ |
| 38006 | 38054 | #endif /* SQLITE_OMIT_SHARED_CACHE */ |
| 38007 | 38055 | |
| 38008 | 38056 | static void releasePage(MemPage *pPage); /* Forward reference */ |
| 38009 | 38057 | |
| 38010 | 38058 | /* |
| 38011 | | -** Verify that the cursor holds a mutex on the BtShared |
| 38059 | +***** This routine is used inside of assert() only **** |
| 38060 | +** |
| 38061 | +** Verify that the cursor holds the mutex on its BtShared |
| 38012 | 38062 | */ |
| 38013 | | -#ifndef NDEBUG |
| 38063 | +#ifdef SQLITE_DEBUG |
| 38014 | 38064 | static int cursorHoldsMutex(BtCursor *p){ |
| 38015 | 38065 | return sqlite3_mutex_held(p->pBt->mutex); |
| 38016 | 38066 | } |
| 38017 | 38067 | #endif |
| 38018 | 38068 | |
| | @@ -38039,20 +38089,20 @@ |
| 38039 | 38089 | } |
| 38040 | 38090 | } |
| 38041 | 38091 | |
| 38042 | 38092 | /* |
| 38043 | 38093 | ** This function is called before modifying the contents of a table |
| 38044 | | -** b-tree to invalidate any incrblob cursors that are open on the |
| 38094 | +** to invalidate any incrblob cursors that are open on the |
| 38045 | 38095 | ** row or one of the rows being modified. |
| 38046 | 38096 | ** |
| 38047 | 38097 | ** If argument isClearTable is true, then the entire contents of the |
| 38048 | 38098 | ** table is about to be deleted. In this case invalidate all incrblob |
| 38049 | 38099 | ** cursors open on any row within the table with root-page pgnoRoot. |
| 38050 | 38100 | ** |
| 38051 | 38101 | ** Otherwise, if argument isClearTable is false, then the row with |
| 38052 | 38102 | ** rowid iRow is being replaced or deleted. In this case invalidate |
| 38053 | | -** only those incrblob cursors open on this specific row. |
| 38103 | +** only those incrblob cursors open on that specific row. |
| 38054 | 38104 | */ |
| 38055 | 38105 | static void invalidateIncrblobCursors( |
| 38056 | 38106 | Btree *pBtree, /* The database file to check */ |
| 38057 | 38107 | i64 iRow, /* The rowid that might be changing */ |
| 38058 | 38108 | int isClearTable /* True if all rows are being deleted */ |
| | @@ -38066,14 +38116,15 @@ |
| 38066 | 38116 | } |
| 38067 | 38117 | } |
| 38068 | 38118 | } |
| 38069 | 38119 | |
| 38070 | 38120 | #else |
| 38121 | + /* Stub functions when INCRBLOB is omitted */ |
| 38071 | 38122 | #define invalidateOverflowCache(x) |
| 38072 | 38123 | #define invalidateAllOverflowCache(x) |
| 38073 | 38124 | #define invalidateIncrblobCursors(x,y,z) |
| 38074 | | -#endif |
| 38125 | +#endif /* SQLITE_OMIT_INCRBLOB */ |
| 38075 | 38126 | |
| 38076 | 38127 | /* |
| 38077 | 38128 | ** Set bit pgno of the BtShared.pHasContent bitvec. This is called |
| 38078 | 38129 | ** when a page that previously contained data becomes a free-list leaf |
| 38079 | 38130 | ** page. |
| | @@ -38102,11 +38153,11 @@ |
| 38102 | 38153 | ** to restore the database to its original configuration. |
| 38103 | 38154 | ** |
| 38104 | 38155 | ** The solution is the BtShared.pHasContent bitvec. Whenever a page is |
| 38105 | 38156 | ** moved to become a free-list leaf page, the corresponding bit is |
| 38106 | 38157 | ** set in the bitvec. Whenever a leaf page is extracted from the free-list, |
| 38107 | | -** optimization 2 above is ommitted if the corresponding bit is already |
| 38158 | +** optimization 2 above is omitted if the corresponding bit is already |
| 38108 | 38159 | ** set in BtShared.pHasContent. The contents of the bitvec are cleared |
| 38109 | 38160 | ** at the end of every transaction. |
| 38110 | 38161 | */ |
| 38111 | 38162 | static int btreeSetHasContent(BtShared *pBt, Pgno pgno){ |
| 38112 | 38163 | int rc = SQLITE_OK; |
| | @@ -38198,12 +38249,12 @@ |
| 38198 | 38249 | invalidateOverflowCache(pCur); |
| 38199 | 38250 | return rc; |
| 38200 | 38251 | } |
| 38201 | 38252 | |
| 38202 | 38253 | /* |
| 38203 | | -** Save the positions of all cursors except pExcept open on the table |
| 38204 | | -** with root-page iRoot. Usually, this is called just before cursor |
| 38254 | +** Save the positions of all cursors (except pExcept) that are open on |
| 38255 | +** the table with root-page iRoot. Usually, this is called just before cursor |
| 38205 | 38256 | ** pExcept is used to modify the table (BtreeDelete() or BtreeInsert()). |
| 38206 | 38257 | */ |
| 38207 | 38258 | static int saveAllCursors(BtShared *pBt, Pgno iRoot, BtCursor *pExcept){ |
| 38208 | 38259 | BtCursor *p; |
| 38209 | 38260 | assert( sqlite3_mutex_held(pBt->mutex) ); |
| | @@ -38604,11 +38655,14 @@ |
| 38604 | 38655 | } |
| 38605 | 38656 | |
| 38606 | 38657 | assert( nSize==debuginfo.nSize ); |
| 38607 | 38658 | return (u16)nSize; |
| 38608 | 38659 | } |
| 38609 | | -#ifndef NDEBUG |
| 38660 | + |
| 38661 | +#ifdef SQLITE_DEBUG |
| 38662 | +/* This variation on cellSizePtr() is used inside of assert() statements |
| 38663 | +** only. */ |
| 38610 | 38664 | static u16 cellSize(MemPage *pPage, int iCell){ |
| 38611 | 38665 | return cellSizePtr(pPage, findCell(pPage, iCell)); |
| 38612 | 38666 | } |
| 38613 | 38667 | #endif |
| 38614 | 38668 | |
| | @@ -40576,22 +40630,17 @@ |
| 40576 | 40630 | ** This function is called from both BtreeCommitPhaseTwo() and BtreeRollback() |
| 40577 | 40631 | ** at the conclusion of a transaction. |
| 40578 | 40632 | */ |
| 40579 | 40633 | static void btreeEndTransaction(Btree *p){ |
| 40580 | 40634 | BtShared *pBt = p->pBt; |
| 40581 | | - BtCursor *pCsr; |
| 40582 | 40635 | assert( sqlite3BtreeHoldsMutex(p) ); |
| 40583 | 40636 | |
| 40584 | | - /* Search for a cursor held open by this b-tree connection. If one exists, |
| 40585 | | - ** then the transaction will be downgraded to a read-only transaction |
| 40586 | | - ** instead of actually concluded. A subsequent call to CommitPhaseTwo() |
| 40587 | | - ** or Rollback() will finish the transaction and unlock the database. */ |
| 40588 | | - for(pCsr=pBt->pCursor; pCsr && pCsr->pBtree!=p; pCsr=pCsr->pNext); |
| 40589 | | - assert( pCsr==0 || p->inTrans>TRANS_NONE ); |
| 40590 | | - |
| 40591 | 40637 | btreeClearHasContent(pBt); |
| 40592 | | - if( pCsr ){ |
| 40638 | + if( p->inTrans>TRANS_NONE && p->db->activeVdbeCnt>1 ){ |
| 40639 | + /* If there are other active statements that belong to this database |
| 40640 | + ** handle, downgrade to a read-only transaction. The other statements |
| 40641 | + ** may still be reading from the database. */ |
| 40593 | 40642 | downgradeAllSharedCacheTableLocks(p); |
| 40594 | 40643 | p->inTrans = TRANS_READ; |
| 40595 | 40644 | }else{ |
| 40596 | 40645 | /* If the handle had any kind of transaction open, decrement the |
| 40597 | 40646 | ** transaction count of the shared btree. If the transaction count |
| | @@ -44047,11 +44096,11 @@ |
| 44047 | 44096 | int appendBias, /* True if this is likely an append */ |
| 44048 | 44097 | int seekResult /* Result of prior MovetoUnpacked() call */ |
| 44049 | 44098 | ){ |
| 44050 | 44099 | int rc; |
| 44051 | 44100 | int loc = seekResult; /* -1: before desired location +1: after */ |
| 44052 | | - int szNew; |
| 44101 | + int szNew = 0; |
| 44053 | 44102 | int idx; |
| 44054 | 44103 | MemPage *pPage; |
| 44055 | 44104 | Btree *p = pCur->pBtree; |
| 44056 | 44105 | BtShared *pBt = p->pBt; |
| 44057 | 44106 | unsigned char *oldCell; |
| | @@ -47103,10 +47152,13 @@ |
| 47103 | 47152 | sqlite3VdbeMemSetStr(pVal, sqlite3HexToBlob(db, zVal, nVal), nVal/2, |
| 47104 | 47153 | 0, SQLITE_DYNAMIC); |
| 47105 | 47154 | } |
| 47106 | 47155 | #endif |
| 47107 | 47156 | |
| 47157 | + if( pVal ){ |
| 47158 | + sqlite3VdbeMemStoreType(pVal); |
| 47159 | + } |
| 47108 | 47160 | *ppVal = pVal; |
| 47109 | 47161 | return SQLITE_OK; |
| 47110 | 47162 | |
| 47111 | 47163 | no_mem: |
| 47112 | 47164 | db->mallocFailed = 1; |
| | @@ -47207,17 +47259,18 @@ |
| 47207 | 47259 | |
| 47208 | 47260 | /* |
| 47209 | 47261 | ** Remember the SQL string for a prepared statement. |
| 47210 | 47262 | */ |
| 47211 | 47263 | SQLITE_PRIVATE void sqlite3VdbeSetSql(Vdbe *p, const char *z, int n, int isPrepareV2){ |
| 47264 | + assert( isPrepareV2==1 || isPrepareV2==0 ); |
| 47212 | 47265 | if( p==0 ) return; |
| 47213 | 47266 | #ifdef SQLITE_OMIT_TRACE |
| 47214 | 47267 | if( !isPrepareV2 ) return; |
| 47215 | 47268 | #endif |
| 47216 | 47269 | assert( p->zSql==0 ); |
| 47217 | 47270 | p->zSql = sqlite3DbStrNDup(p->db, z, n); |
| 47218 | | - p->isPrepareV2 = isPrepareV2 ? 1 : 0; |
| 47271 | + p->isPrepareV2 = isPrepareV2; |
| 47219 | 47272 | } |
| 47220 | 47273 | |
| 47221 | 47274 | /* |
| 47222 | 47275 | ** Return the SQL associated with a prepared statement |
| 47223 | 47276 | */ |
| | @@ -48167,31 +48220,10 @@ |
| 48167 | 48220 | } |
| 48168 | 48221 | releaseMemArray(aMem, p->nChildMem); |
| 48169 | 48222 | sqlite3DbFree(p->v->db, p); |
| 48170 | 48223 | } |
| 48171 | 48224 | |
| 48172 | | - |
| 48173 | | -#ifdef SQLITE_ENABLE_MEMORY_MANAGEMENT |
| 48174 | | -SQLITE_PRIVATE int sqlite3VdbeReleaseBuffers(Vdbe *p){ |
| 48175 | | - int ii; |
| 48176 | | - int nFree = 0; |
| 48177 | | - assert( sqlite3_mutex_held(p->db->mutex) ); |
| 48178 | | - for(ii=1; ii<=p->nMem; ii++){ |
| 48179 | | - Mem *pMem = &p->aMem[ii]; |
| 48180 | | - if( pMem->flags & MEM_RowSet ){ |
| 48181 | | - sqlite3RowSetClear(pMem->u.pRowSet); |
| 48182 | | - } |
| 48183 | | - if( pMem->z && pMem->flags&MEM_Dyn ){ |
| 48184 | | - assert( !pMem->xDel ); |
| 48185 | | - nFree += sqlite3DbMallocSize(pMem->db, pMem->z); |
| 48186 | | - sqlite3VdbeMemRelease(pMem); |
| 48187 | | - } |
| 48188 | | - } |
| 48189 | | - return nFree; |
| 48190 | | -} |
| 48191 | | -#endif |
| 48192 | | - |
| 48193 | 48225 | #ifndef SQLITE_OMIT_EXPLAIN |
| 48194 | 48226 | /* |
| 48195 | 48227 | ** Give a listing of the program in the virtual machine. |
| 48196 | 48228 | ** |
| 48197 | 48229 | ** The interface is the same as sqlite3VdbeExec(). But instead of |
| | @@ -50176,10 +50208,49 @@ |
| 50176 | 50208 | ** Return the database associated with the Vdbe. |
| 50177 | 50209 | */ |
| 50178 | 50210 | SQLITE_PRIVATE sqlite3 *sqlite3VdbeDb(Vdbe *v){ |
| 50179 | 50211 | return v->db; |
| 50180 | 50212 | } |
| 50213 | + |
| 50214 | +/* |
| 50215 | +** Return a pointer to an sqlite3_value structure containing the value bound |
| 50216 | +** parameter iVar of VM v. Except, if the value is an SQL NULL, return |
| 50217 | +** 0 instead. Unless it is NULL, apply affinity aff (one of the SQLITE_AFF_* |
| 50218 | +** constants) to the value before returning it. |
| 50219 | +** |
| 50220 | +** The returned value must be freed by the caller using sqlite3ValueFree(). |
| 50221 | +*/ |
| 50222 | +SQLITE_PRIVATE sqlite3_value *sqlite3VdbeGetValue(Vdbe *v, int iVar, u8 aff){ |
| 50223 | + assert( iVar>0 ); |
| 50224 | + if( v ){ |
| 50225 | + Mem *pMem = &v->aVar[iVar-1]; |
| 50226 | + if( 0==(pMem->flags & MEM_Null) ){ |
| 50227 | + sqlite3_value *pRet = sqlite3ValueNew(v->db); |
| 50228 | + if( pRet ){ |
| 50229 | + sqlite3VdbeMemCopy((Mem *)pRet, pMem); |
| 50230 | + sqlite3ValueApplyAffinity(pRet, aff, SQLITE_UTF8); |
| 50231 | + sqlite3VdbeMemStoreType((Mem *)pRet); |
| 50232 | + } |
| 50233 | + return pRet; |
| 50234 | + } |
| 50235 | + } |
| 50236 | + return 0; |
| 50237 | +} |
| 50238 | + |
| 50239 | +/* |
| 50240 | +** Configure SQL variable iVar so that binding a new value to it signals |
| 50241 | +** to sqlite3_reoptimize() that re-preparing the statement may result |
| 50242 | +** in a better query plan. |
| 50243 | +*/ |
| 50244 | +SQLITE_PRIVATE void sqlite3VdbeSetVarmask(Vdbe *v, int iVar){ |
| 50245 | + assert( iVar>0 ); |
| 50246 | + if( iVar>32 ){ |
| 50247 | + v->expmask = 0xffffffff; |
| 50248 | + }else{ |
| 50249 | + v->expmask |= ((u32)1 << (iVar-1)); |
| 50250 | + } |
| 50251 | +} |
| 50181 | 50252 | |
| 50182 | 50253 | /************** End of vdbeaux.c *********************************************/ |
| 50183 | 50254 | /************** Begin file vdbeapi.c *****************************************/ |
| 50184 | 50255 | /* |
| 50185 | 50256 | ** 2004 May 26 |
| | @@ -50277,10 +50348,13 @@ |
| 50277 | 50348 | #endif |
| 50278 | 50349 | sqlite3_mutex_enter(mutex); |
| 50279 | 50350 | for(i=0; i<p->nVar; i++){ |
| 50280 | 50351 | sqlite3VdbeMemRelease(&p->aVar[i]); |
| 50281 | 50352 | p->aVar[i].flags = MEM_Null; |
| 50353 | + } |
| 50354 | + if( p->isPrepareV2 && p->expmask ){ |
| 50355 | + p->expired = 1; |
| 50282 | 50356 | } |
| 50283 | 50357 | sqlite3_mutex_leave(mutex); |
| 50284 | 50358 | return rc; |
| 50285 | 50359 | } |
| 50286 | 50360 | |
| | @@ -50483,11 +50557,11 @@ |
| 50483 | 50557 | if( db->mallocFailed ){ |
| 50484 | 50558 | return SQLITE_NOMEM; |
| 50485 | 50559 | } |
| 50486 | 50560 | |
| 50487 | 50561 | if( p->pc<=0 && p->expired ){ |
| 50488 | | - if( ALWAYS(p->rc==SQLITE_OK) ){ |
| 50562 | + if( ALWAYS(p->rc==SQLITE_OK || p->rc==SQLITE_SCHEMA) ){ |
| 50489 | 50563 | p->rc = SQLITE_SCHEMA; |
| 50490 | 50564 | } |
| 50491 | 50565 | rc = SQLITE_ERROR; |
| 50492 | 50566 | goto end_of_step; |
| 50493 | 50567 | } |
| | @@ -51093,10 +51167,19 @@ |
| 51093 | 51167 | i--; |
| 51094 | 51168 | pVar = &p->aVar[i]; |
| 51095 | 51169 | sqlite3VdbeMemRelease(pVar); |
| 51096 | 51170 | pVar->flags = MEM_Null; |
| 51097 | 51171 | sqlite3Error(p->db, SQLITE_OK, 0); |
| 51172 | + |
| 51173 | + /* If the bit corresponding to this variable in Vdbe.expmask is set, then |
| 51174 | + ** binding a new value to this variable invalidates the current query plan. |
| 51175 | + */ |
| 51176 | + if( p->isPrepareV2 && |
| 51177 | + ((i<32 && p->expmask & ((u32)1 << i)) || p->expmask==0xffffffff) |
| 51178 | + ){ |
| 51179 | + p->expired = 1; |
| 51180 | + } |
| 51098 | 51181 | return SQLITE_OK; |
| 51099 | 51182 | } |
| 51100 | 51183 | |
| 51101 | 51184 | /* |
| 51102 | 51185 | ** Bind a text or BLOB value. |
| | @@ -51342,10 +51425,16 @@ |
| 51342 | 51425 | SQLITE_API int sqlite3_transfer_bindings(sqlite3_stmt *pFromStmt, sqlite3_stmt *pToStmt){ |
| 51343 | 51426 | Vdbe *pFrom = (Vdbe*)pFromStmt; |
| 51344 | 51427 | Vdbe *pTo = (Vdbe*)pToStmt; |
| 51345 | 51428 | if( pFrom->nVar!=pTo->nVar ){ |
| 51346 | 51429 | return SQLITE_ERROR; |
| 51430 | + } |
| 51431 | + if( pTo->isPrepareV2 && pTo->expmask ){ |
| 51432 | + pTo->expired = 1; |
| 51433 | + } |
| 51434 | + if( pFrom->isPrepareV2 && pFrom->expmask ){ |
| 51435 | + pFrom->expired = 1; |
| 51347 | 51436 | } |
| 51348 | 51437 | return sqlite3TransferBindings(pFromStmt, pToStmt); |
| 51349 | 51438 | } |
| 51350 | 51439 | #endif |
| 51351 | 51440 | |
| | @@ -51538,16 +51627,14 @@ |
| 51538 | 51627 | #define ExpandBlob(P) (((P)->flags&MEM_Zero)?sqlite3VdbeMemExpandBlob(P):0) |
| 51539 | 51628 | |
| 51540 | 51629 | /* |
| 51541 | 51630 | ** Argument pMem points at a register that will be passed to a |
| 51542 | 51631 | ** user-defined function or returned to the user as the result of a query. |
| 51543 | | -** The second argument, 'db_enc' is the text encoding used by the vdbe for |
| 51544 | | -** register variables. This routine sets the pMem->enc and pMem->type |
| 51545 | | -** variables used by the sqlite3_value_*() routines. |
| 51632 | +** This routine sets the pMem->type variable used by the sqlite3_value_*() |
| 51633 | +** routines. |
| 51546 | 51634 | */ |
| 51547 | | -#define storeTypeInfo(A,B) _storeTypeInfo(A) |
| 51548 | | -static void _storeTypeInfo(Mem *pMem){ |
| 51635 | +SQLITE_PRIVATE void sqlite3VdbeMemStoreType(Mem *pMem){ |
| 51549 | 51636 | int flags = pMem->flags; |
| 51550 | 51637 | if( flags & MEM_Null ){ |
| 51551 | 51638 | pMem->type = SQLITE_NULL; |
| 51552 | 51639 | } |
| 51553 | 51640 | else if( flags & MEM_Int ){ |
| | @@ -51714,11 +51801,11 @@ |
| 51714 | 51801 | ** This is an EXPERIMENTAL api and is subject to change or removal. |
| 51715 | 51802 | */ |
| 51716 | 51803 | SQLITE_API int sqlite3_value_numeric_type(sqlite3_value *pVal){ |
| 51717 | 51804 | Mem *pMem = (Mem*)pVal; |
| 51718 | 51805 | applyNumericAffinity(pMem); |
| 51719 | | - storeTypeInfo(pMem, 0); |
| 51806 | + sqlite3VdbeMemStoreType(pMem); |
| 51720 | 51807 | return pMem->type; |
| 51721 | 51808 | } |
| 51722 | 51809 | |
| 51723 | 51810 | /* |
| 51724 | 51811 | ** Exported version of applyAffinity(). This one works on sqlite3_value*, |
| | @@ -52263,11 +52350,11 @@ |
| 52263 | 52350 | int res; /* Result of an sqlite3BtreeLast() */ |
| 52264 | 52351 | int cnt; /* Counter to limit the number of searches */ |
| 52265 | 52352 | Mem *pMem; /* Register holding largest rowid for AUTOINCREMENT */ |
| 52266 | 52353 | VdbeFrame *pFrame; /* Root frame of VDBE */ |
| 52267 | 52354 | } be; |
| 52268 | | - struct OP_Insert_stack_vars { |
| 52355 | + struct OP_InsertInt_stack_vars { |
| 52269 | 52356 | Mem *pData; /* MEM cell holding data for the record to be inserted */ |
| 52270 | 52357 | Mem *pKey; /* MEM cell holding key for the record */ |
| 52271 | 52358 | i64 iKey; /* The integer ROWID or key for the record to be inserted */ |
| 52272 | 52359 | VdbeCursor *pC; /* Cursor to table into which insert is written */ |
| 52273 | 52360 | int nZero; /* Number of zero-bytes to append */ |
| | @@ -52907,11 +52994,11 @@ |
| 52907 | 52994 | u.ab.p1 = pOp->p1 - 1; |
| 52908 | 52995 | u.ab.p2 = pOp->p2; |
| 52909 | 52996 | u.ab.n = pOp->p3; |
| 52910 | 52997 | assert( u.ab.p1>=0 && u.ab.p1+u.ab.n<=p->nVar ); |
| 52911 | 52998 | assert( u.ab.p2>=1 && u.ab.p2+u.ab.n-1<=p->nMem ); |
| 52912 | | - assert( pOp->p4.z==0 || pOp->p3==1 ); |
| 52999 | + assert( pOp->p4.z==0 || pOp->p3==1 || pOp->p3==0 ); |
| 52913 | 53000 | |
| 52914 | 53001 | while( u.ab.n-- > 0 ){ |
| 52915 | 53002 | u.ab.pVar = &p->aVar[u.ab.p1++]; |
| 52916 | 53003 | if( sqlite3VdbeMemTooBig(u.ab.pVar) ){ |
| 52917 | 53004 | goto too_big; |
| | @@ -53058,11 +53145,11 @@ |
| 53058 | 53145 | ** as side effect. |
| 53059 | 53146 | */ |
| 53060 | 53147 | u.ad.pMem = p->pResultSet = &p->aMem[pOp->p1]; |
| 53061 | 53148 | for(u.ad.i=0; u.ad.i<pOp->p2; u.ad.i++){ |
| 53062 | 53149 | sqlite3VdbeMemNulTerminate(&u.ad.pMem[u.ad.i]); |
| 53063 | | - storeTypeInfo(&u.ad.pMem[u.ad.i], encoding); |
| 53150 | + sqlite3VdbeMemStoreType(&u.ad.pMem[u.ad.i]); |
| 53064 | 53151 | REGISTER_TRACE(pOp->p1+u.ad.i, &u.ad.pMem[u.ad.i]); |
| 53065 | 53152 | } |
| 53066 | 53153 | if( db->mallocFailed ) goto no_mem; |
| 53067 | 53154 | |
| 53068 | 53155 | /* Return SQLITE_ROW |
| | @@ -53283,11 +53370,11 @@ |
| 53283 | 53370 | assert( u.ag.n==0 || (pOp->p2>0 && pOp->p2+u.ag.n<=p->nMem+1) ); |
| 53284 | 53371 | assert( pOp->p3<pOp->p2 || pOp->p3>=pOp->p2+u.ag.n ); |
| 53285 | 53372 | u.ag.pArg = &p->aMem[pOp->p2]; |
| 53286 | 53373 | for(u.ag.i=0; u.ag.i<u.ag.n; u.ag.i++, u.ag.pArg++){ |
| 53287 | 53374 | u.ag.apVal[u.ag.i] = u.ag.pArg; |
| 53288 | | - storeTypeInfo(u.ag.pArg, encoding); |
| 53375 | + sqlite3VdbeMemStoreType(u.ag.pArg); |
| 53289 | 53376 | REGISTER_TRACE(pOp->p2, u.ag.pArg); |
| 53290 | 53377 | } |
| 53291 | 53378 | |
| 53292 | 53379 | assert( pOp->p4type==P4_FUNCDEF || pOp->p4type==P4_VDBEFUNC ); |
| 53293 | 53380 | if( pOp->p4type==P4_FUNCDEF ){ |
| | @@ -54779,10 +54866,11 @@ |
| 54779 | 54866 | } |
| 54780 | 54867 | if( pOp->p1==1 ){ |
| 54781 | 54868 | /* Invalidate all prepared statements whenever the TEMP database |
| 54782 | 54869 | ** schema is changed. Ticket #1644 */ |
| 54783 | 54870 | sqlite3ExpirePreparedStatements(db); |
| 54871 | + p->expired = 0; |
| 54784 | 54872 | } |
| 54785 | 54873 | break; |
| 54786 | 54874 | } |
| 54787 | 54875 | |
| 54788 | 54876 | /* Opcode: VerifyCookie P1 P2 * |
| | @@ -54899,10 +54987,15 @@ |
| 54899 | 54987 | int wrFlag; |
| 54900 | 54988 | Btree *pX; |
| 54901 | 54989 | VdbeCursor *pCur; |
| 54902 | 54990 | Db *pDb; |
| 54903 | 54991 | #endif /* local variables moved into u.aw */ |
| 54992 | + |
| 54993 | + if( p->expired ){ |
| 54994 | + rc = SQLITE_ABORT; |
| 54995 | + break; |
| 54996 | + } |
| 54904 | 54997 | |
| 54905 | 54998 | u.aw.nField = 0; |
| 54906 | 54999 | u.aw.pKeyInfo = 0; |
| 54907 | 55000 | u.aw.p2 = pOp->p2; |
| 54908 | 55001 | u.aw.iDb = pOp->p3; |
| | @@ -55698,11 +55791,17 @@ |
| 55698 | 55791 | ** cause any problems.) |
| 55699 | 55792 | ** |
| 55700 | 55793 | ** This instruction only works on tables. The equivalent instruction |
| 55701 | 55794 | ** for indices is OP_IdxInsert. |
| 55702 | 55795 | */ |
| 55703 | | -case OP_Insert: { |
| 55796 | +/* Opcode: InsertInt P1 P2 P3 P4 P5 |
| 55797 | +** |
| 55798 | +** This works exactly like OP_Insert except that the key is the |
| 55799 | +** integer value P3, not the value of the integer stored in register P3. |
| 55800 | +*/ |
| 55801 | +case OP_Insert: |
| 55802 | +case OP_InsertInt: { |
| 55704 | 55803 | #if 0 /* local variables moved into u.bf */ |
| 55705 | 55804 | Mem *pData; /* MEM cell holding data for the record to be inserted */ |
| 55706 | 55805 | Mem *pKey; /* MEM cell holding key for the record */ |
| 55707 | 55806 | i64 iKey; /* The integer ROWID or key for the record to be inserted */ |
| 55708 | 55807 | VdbeCursor *pC; /* Cursor to table into which insert is written */ |
| | @@ -55712,24 +55811,30 @@ |
| 55712 | 55811 | const char *zTbl; /* Table name - used by the opdate hook */ |
| 55713 | 55812 | int op; /* Opcode for update hook: SQLITE_UPDATE or SQLITE_INSERT */ |
| 55714 | 55813 | #endif /* local variables moved into u.bf */ |
| 55715 | 55814 | |
| 55716 | 55815 | u.bf.pData = &p->aMem[pOp->p2]; |
| 55717 | | - u.bf.pKey = &p->aMem[pOp->p3]; |
| 55718 | 55816 | assert( pOp->p1>=0 && pOp->p1<p->nCursor ); |
| 55719 | 55817 | u.bf.pC = p->apCsr[pOp->p1]; |
| 55720 | 55818 | assert( u.bf.pC!=0 ); |
| 55721 | 55819 | assert( u.bf.pC->pCursor!=0 ); |
| 55722 | 55820 | assert( u.bf.pC->pseudoTableReg==0 ); |
| 55723 | | - assert( u.bf.pKey->flags & MEM_Int ); |
| 55724 | 55821 | assert( u.bf.pC->isTable ); |
| 55725 | 55822 | REGISTER_TRACE(pOp->p2, u.bf.pData); |
| 55726 | | - REGISTER_TRACE(pOp->p3, u.bf.pKey); |
| 55727 | 55823 | |
| 55728 | | - u.bf.iKey = u.bf.pKey->u.i; |
| 55824 | + if( pOp->opcode==OP_Insert ){ |
| 55825 | + u.bf.pKey = &p->aMem[pOp->p3]; |
| 55826 | + assert( u.bf.pKey->flags & MEM_Int ); |
| 55827 | + REGISTER_TRACE(pOp->p3, u.bf.pKey); |
| 55828 | + u.bf.iKey = u.bf.pKey->u.i; |
| 55829 | + }else{ |
| 55830 | + assert( pOp->opcode==OP_InsertInt ); |
| 55831 | + u.bf.iKey = pOp->p3; |
| 55832 | + } |
| 55833 | + |
| 55729 | 55834 | if( pOp->p5 & OPFLAG_NCHANGE ) p->nChange++; |
| 55730 | | - if( pOp->p5 & OPFLAG_LASTROWID ) db->lastRowid = u.bf.pKey->u.i; |
| 55835 | + if( pOp->p5 & OPFLAG_LASTROWID ) db->lastRowid = u.bf.iKey; |
| 55731 | 55836 | if( u.bf.pData->flags & MEM_Null ){ |
| 55732 | 55837 | u.bf.pData->z = 0; |
| 55733 | 55838 | u.bf.pData->n = 0; |
| 55734 | 55839 | }else{ |
| 55735 | 55840 | assert( u.bf.pData->flags & (MEM_Blob|MEM_Str) ); |
| | @@ -57043,11 +57148,11 @@ |
| 57043 | 57148 | u.cc.pRec = &p->aMem[pOp->p2]; |
| 57044 | 57149 | u.cc.apVal = p->apArg; |
| 57045 | 57150 | assert( u.cc.apVal || u.cc.n==0 ); |
| 57046 | 57151 | for(u.cc.i=0; u.cc.i<u.cc.n; u.cc.i++, u.cc.pRec++){ |
| 57047 | 57152 | u.cc.apVal[u.cc.i] = u.cc.pRec; |
| 57048 | | - storeTypeInfo(u.cc.pRec, encoding); |
| 57153 | + sqlite3VdbeMemStoreType(u.cc.pRec); |
| 57049 | 57154 | } |
| 57050 | 57155 | u.cc.ctx.pFunc = pOp->p4.pFunc; |
| 57051 | 57156 | assert( pOp->p3>0 && pOp->p3<=p->nMem ); |
| 57052 | 57157 | u.cc.ctx.pMem = u.cc.pMem = &p->aMem[pOp->p3]; |
| 57053 | 57158 | u.cc.pMem->n++; |
| | @@ -57341,11 +57446,11 @@ |
| 57341 | 57446 | { |
| 57342 | 57447 | u.ch.res = 0; |
| 57343 | 57448 | u.ch.apArg = p->apArg; |
| 57344 | 57449 | for(u.ch.i = 0; u.ch.i<u.ch.nArg; u.ch.i++){ |
| 57345 | 57450 | u.ch.apArg[u.ch.i] = &u.ch.pArgc[u.ch.i+1]; |
| 57346 | | - storeTypeInfo(u.ch.apArg[u.ch.i], 0); |
| 57451 | + sqlite3VdbeMemStoreType(u.ch.apArg[u.ch.i]); |
| 57347 | 57452 | } |
| 57348 | 57453 | |
| 57349 | 57454 | if( sqlite3SafetyOff(db) ) goto abort_due_to_misuse; |
| 57350 | 57455 | p->inVtabMethod = 1; |
| 57351 | 57456 | rc = u.ch.pModule->xFilter(u.ch.pVtabCursor, u.ch.iQuery, pOp->p4.z, u.ch.nArg, u.ch.apArg); |
| | @@ -57553,11 +57658,11 @@ |
| 57553 | 57658 | assert( pOp->p4type==P4_VTAB ); |
| 57554 | 57659 | if( ALWAYS(u.cl.pModule->xUpdate) ){ |
| 57555 | 57660 | u.cl.apArg = p->apArg; |
| 57556 | 57661 | u.cl.pX = &p->aMem[pOp->p3]; |
| 57557 | 57662 | for(u.cl.i=0; u.cl.i<u.cl.nArg; u.cl.i++){ |
| 57558 | | - storeTypeInfo(u.cl.pX, 0); |
| 57663 | + sqlite3VdbeMemStoreType(u.cl.pX); |
| 57559 | 57664 | u.cl.apArg[u.cl.i] = u.cl.pX; |
| 57560 | 57665 | u.cl.pX++; |
| 57561 | 57666 | } |
| 57562 | 57667 | if( sqlite3SafetyOff(db) ) goto abort_due_to_misuse; |
| 57563 | 57668 | rc = u.cl.pModule->xUpdate(u.cl.pVtab, u.cl.nArg, u.cl.apArg, &u.cl.rowid); |
| | @@ -59174,10 +59279,31 @@ |
| 59174 | 59279 | return WRC_Prune; |
| 59175 | 59280 | } else { |
| 59176 | 59281 | return WRC_Abort; |
| 59177 | 59282 | } |
| 59178 | 59283 | } |
| 59284 | + |
| 59285 | +/* |
| 59286 | +** Allocate and return a pointer to an expression to load the column iCol |
| 59287 | +** from datasource iSrc datasource in SrcList pSrc. |
| 59288 | +*/ |
| 59289 | +SQLITE_PRIVATE Expr *sqlite3CreateColumnExpr(sqlite3 *db, SrcList *pSrc, int iSrc, int iCol){ |
| 59290 | + Expr *p = sqlite3ExprAlloc(db, TK_COLUMN, 0, 0); |
| 59291 | + if( p ){ |
| 59292 | + struct SrcList_item *pItem = &pSrc->a[iSrc]; |
| 59293 | + p->pTab = pItem->pTab; |
| 59294 | + p->iTable = pItem->iCursor; |
| 59295 | + if( p->pTab->iPKey==iCol ){ |
| 59296 | + p->iColumn = -1; |
| 59297 | + }else{ |
| 59298 | + p->iColumn = iCol; |
| 59299 | + pItem->colUsed |= ((Bitmask)1)<<(iCol>=BMS ? BMS-1 : iCol); |
| 59300 | + } |
| 59301 | + ExprSetProperty(p, EP_Resolved); |
| 59302 | + } |
| 59303 | + return p; |
| 59304 | +} |
| 59179 | 59305 | |
| 59180 | 59306 | /* |
| 59181 | 59307 | ** This routine is callback for sqlite3WalkExpr(). |
| 59182 | 59308 | ** |
| 59183 | 59309 | ** Resolve symbolic names into TK_COLUMN operators for the current |
| | @@ -60522,16 +60648,16 @@ |
| 60522 | 60648 | assert( z!=0 ); |
| 60523 | 60649 | assert( z[0]!=0 ); |
| 60524 | 60650 | if( z[1]==0 ){ |
| 60525 | 60651 | /* Wildcard of the form "?". Assign the next variable number */ |
| 60526 | 60652 | assert( z[0]=='?' ); |
| 60527 | | - pExpr->iTable = ++pParse->nVar; |
| 60653 | + pExpr->iColumn = ++pParse->nVar; |
| 60528 | 60654 | }else if( z[0]=='?' ){ |
| 60529 | 60655 | /* Wildcard of the form "?nnn". Convert "nnn" to an integer and |
| 60530 | 60656 | ** use it as the variable number */ |
| 60531 | 60657 | int i; |
| 60532 | | - pExpr->iTable = i = atoi((char*)&z[1]); |
| 60658 | + pExpr->iColumn = i = atoi((char*)&z[1]); |
| 60533 | 60659 | testcase( i==0 ); |
| 60534 | 60660 | testcase( i==1 ); |
| 60535 | 60661 | testcase( i==db->aLimit[SQLITE_LIMIT_VARIABLE_NUMBER]-1 ); |
| 60536 | 60662 | testcase( i==db->aLimit[SQLITE_LIMIT_VARIABLE_NUMBER] ); |
| 60537 | 60663 | if( i<1 || i>db->aLimit[SQLITE_LIMIT_VARIABLE_NUMBER] ){ |
| | @@ -60551,16 +60677,16 @@ |
| 60551 | 60677 | n = sqlite3Strlen30(z); |
| 60552 | 60678 | for(i=0; i<pParse->nVarExpr; i++){ |
| 60553 | 60679 | Expr *pE = pParse->apVarExpr[i]; |
| 60554 | 60680 | assert( pE!=0 ); |
| 60555 | 60681 | if( memcmp(pE->u.zToken, z, n)==0 && pE->u.zToken[n]==0 ){ |
| 60556 | | - pExpr->iTable = pE->iTable; |
| 60682 | + pExpr->iColumn = pE->iColumn; |
| 60557 | 60683 | break; |
| 60558 | 60684 | } |
| 60559 | 60685 | } |
| 60560 | 60686 | if( i>=pParse->nVarExpr ){ |
| 60561 | | - pExpr->iTable = ++pParse->nVar; |
| 60687 | + pExpr->iColumn = ++pParse->nVar; |
| 60562 | 60688 | if( pParse->nVarExpr>=pParse->nVarExprAlloc-1 ){ |
| 60563 | 60689 | pParse->nVarExprAlloc += pParse->nVarExprAlloc + 10; |
| 60564 | 60690 | pParse->apVarExpr = |
| 60565 | 60691 | sqlite3DbReallocOrFree( |
| 60566 | 60692 | db, |
| | @@ -61322,10 +61448,12 @@ |
| 61322 | 61448 | SQLITE_PRIVATE int sqlite3FindInIndex(Parse *pParse, Expr *pX, int *prNotFound){ |
| 61323 | 61449 | Select *p; /* SELECT to the right of IN operator */ |
| 61324 | 61450 | int eType = 0; /* Type of RHS table. IN_INDEX_* */ |
| 61325 | 61451 | int iTab = pParse->nTab++; /* Cursor of the RHS table */ |
| 61326 | 61452 | int mustBeUnique = (prNotFound==0); /* True if RHS must be unique */ |
| 61453 | + |
| 61454 | + assert( pX->op==TK_IN ); |
| 61327 | 61455 | |
| 61328 | 61456 | /* Check to see if an existing table or index can be used to |
| 61329 | 61457 | ** satisfy the query. This is preferable to generating a new |
| 61330 | 61458 | ** ephemeral table. |
| 61331 | 61459 | */ |
| | @@ -61400,11 +61528,11 @@ |
| 61400 | 61528 | } |
| 61401 | 61529 | } |
| 61402 | 61530 | } |
| 61403 | 61531 | |
| 61404 | 61532 | if( eType==0 ){ |
| 61405 | | - /* Could not found an existing able or index to use as the RHS b-tree. |
| 61533 | + /* Could not found an existing table or index to use as the RHS b-tree. |
| 61406 | 61534 | ** We will have to generate an ephemeral table to do the job. |
| 61407 | 61535 | */ |
| 61408 | 61536 | int rMayHaveNull = 0; |
| 61409 | 61537 | eType = IN_INDEX_EPH; |
| 61410 | 61538 | if( prNotFound ){ |
| | @@ -61447,21 +61575,25 @@ |
| 61447 | 61575 | ** care of changing this register value to non-NULL if the RHS is NULL-free. |
| 61448 | 61576 | ** |
| 61449 | 61577 | ** If rMayHaveNull is zero, that means that the subquery is being used |
| 61450 | 61578 | ** for membership testing only. There is no need to initialize any |
| 61451 | 61579 | ** registers to indicate the presense or absence of NULLs on the RHS. |
| 61580 | +** |
| 61581 | +** For a SELECT or EXISTS operator, return the register that holds the |
| 61582 | +** result. For IN operators or if an error occurs, the return value is 0. |
| 61452 | 61583 | */ |
| 61453 | 61584 | #ifndef SQLITE_OMIT_SUBQUERY |
| 61454 | | -SQLITE_PRIVATE void sqlite3CodeSubselect( |
| 61585 | +SQLITE_PRIVATE int sqlite3CodeSubselect( |
| 61455 | 61586 | Parse *pParse, /* Parsing context */ |
| 61456 | 61587 | Expr *pExpr, /* The IN, SELECT, or EXISTS operator */ |
| 61457 | 61588 | int rMayHaveNull, /* Register that records whether NULLs exist in RHS */ |
| 61458 | 61589 | int isRowid /* If true, LHS of IN operator is a rowid */ |
| 61459 | 61590 | ){ |
| 61460 | 61591 | int testAddr = 0; /* One-time test address */ |
| 61592 | + int rReg = 0; /* Register storing resulting */ |
| 61461 | 61593 | Vdbe *v = sqlite3GetVdbe(pParse); |
| 61462 | | - if( NEVER(v==0) ) return; |
| 61594 | + if( NEVER(v==0) ) return 0; |
| 61463 | 61595 | sqlite3ExprCachePush(pParse); |
| 61464 | 61596 | |
| 61465 | 61597 | /* This code must be run in its entirety every time it is encountered |
| 61466 | 61598 | ** if any of the following is true: |
| 61467 | 61599 | ** |
| | @@ -61522,11 +61654,11 @@ |
| 61522 | 61654 | assert( !isRowid ); |
| 61523 | 61655 | sqlite3SelectDestInit(&dest, SRT_Set, pExpr->iTable); |
| 61524 | 61656 | dest.affinity = (u8)affinity; |
| 61525 | 61657 | assert( (pExpr->iTable&0x0000FFFF)==pExpr->iTable ); |
| 61526 | 61658 | if( sqlite3Select(pParse, pExpr->x.pSelect, &dest) ){ |
| 61527 | | - return; |
| 61659 | + return 0; |
| 61528 | 61660 | } |
| 61529 | 61661 | pEList = pExpr->x.pSelect->pEList; |
| 61530 | 61662 | if( ALWAYS(pEList!=0 && pEList->nExpr>0) ){ |
| 61531 | 61663 | keyInfo.aColl[0] = sqlite3BinaryCompareCollSeq(pParse, pExpr->pLeft, |
| 61532 | 61664 | pEList->a[0].pExpr); |
| | @@ -61553,10 +61685,11 @@ |
| 61553 | 61685 | r1 = sqlite3GetTempReg(pParse); |
| 61554 | 61686 | r2 = sqlite3GetTempReg(pParse); |
| 61555 | 61687 | sqlite3VdbeAddOp2(v, OP_Null, 0, r2); |
| 61556 | 61688 | for(i=pList->nExpr, pItem=pList->a; i>0; i--, pItem++){ |
| 61557 | 61689 | Expr *pE2 = pItem->pExpr; |
| 61690 | + int iValToIns; |
| 61558 | 61691 | |
| 61559 | 61692 | /* If the expression is not constant then we will need to |
| 61560 | 61693 | ** disable the test that was generated above that makes sure |
| 61561 | 61694 | ** this code only executes once. Because for a non-constant |
| 61562 | 61695 | ** expression we need to rerun this code each time. |
| | @@ -61565,18 +61698,23 @@ |
| 61565 | 61698 | sqlite3VdbeChangeToNoop(v, testAddr-1, 2); |
| 61566 | 61699 | testAddr = 0; |
| 61567 | 61700 | } |
| 61568 | 61701 | |
| 61569 | 61702 | /* Evaluate the expression and insert it into the temp table */ |
| 61570 | | - r3 = sqlite3ExprCodeTarget(pParse, pE2, r1); |
| 61571 | | - if( isRowid ){ |
| 61572 | | - sqlite3VdbeAddOp2(v, OP_MustBeInt, r3, sqlite3VdbeCurrentAddr(v)+2); |
| 61573 | | - sqlite3VdbeAddOp3(v, OP_Insert, pExpr->iTable, r2, r3); |
| 61703 | + if( isRowid && sqlite3ExprIsInteger(pE2, &iValToIns) ){ |
| 61704 | + sqlite3VdbeAddOp3(v, OP_InsertInt, pExpr->iTable, r2, iValToIns); |
| 61574 | 61705 | }else{ |
| 61575 | | - sqlite3VdbeAddOp4(v, OP_MakeRecord, r3, 1, r2, &affinity, 1); |
| 61576 | | - sqlite3ExprCacheAffinityChange(pParse, r3, 1); |
| 61577 | | - sqlite3VdbeAddOp2(v, OP_IdxInsert, pExpr->iTable, r2); |
| 61706 | + r3 = sqlite3ExprCodeTarget(pParse, pE2, r1); |
| 61707 | + if( isRowid ){ |
| 61708 | + sqlite3VdbeAddOp2(v, OP_MustBeInt, r3, |
| 61709 | + sqlite3VdbeCurrentAddr(v)+2); |
| 61710 | + sqlite3VdbeAddOp3(v, OP_Insert, pExpr->iTable, r2, r3); |
| 61711 | + }else{ |
| 61712 | + sqlite3VdbeAddOp4(v, OP_MakeRecord, r3, 1, r2, &affinity, 1); |
| 61713 | + sqlite3ExprCacheAffinityChange(pParse, r3, 1); |
| 61714 | + sqlite3VdbeAddOp2(v, OP_IdxInsert, pExpr->iTable, r2); |
| 61715 | + } |
| 61578 | 61716 | } |
| 61579 | 61717 | } |
| 61580 | 61718 | sqlite3ReleaseTempReg(pParse, r1); |
| 61581 | 61719 | sqlite3ReleaseTempReg(pParse, r2); |
| 61582 | 61720 | } |
| | @@ -61616,13 +61754,13 @@ |
| 61616 | 61754 | VdbeComment((v, "Init EXISTS result")); |
| 61617 | 61755 | } |
| 61618 | 61756 | sqlite3ExprDelete(pParse->db, pSel->pLimit); |
| 61619 | 61757 | pSel->pLimit = sqlite3PExpr(pParse, TK_INTEGER, 0, 0, &one); |
| 61620 | 61758 | if( sqlite3Select(pParse, pSel, &dest) ){ |
| 61621 | | - return; |
| 61759 | + return 0; |
| 61622 | 61760 | } |
| 61623 | | - pExpr->iColumn = (i16)dest.iParm; |
| 61761 | + rReg = dest.iParm; |
| 61624 | 61762 | ExprSetIrreducible(pExpr); |
| 61625 | 61763 | break; |
| 61626 | 61764 | } |
| 61627 | 61765 | } |
| 61628 | 61766 | |
| | @@ -61629,11 +61767,11 @@ |
| 61629 | 61767 | if( testAddr ){ |
| 61630 | 61768 | sqlite3VdbeJumpHere(v, testAddr-1); |
| 61631 | 61769 | } |
| 61632 | 61770 | sqlite3ExprCachePop(pParse, 1); |
| 61633 | 61771 | |
| 61634 | | - return; |
| 61772 | + return rReg; |
| 61635 | 61773 | } |
| 61636 | 61774 | #endif /* SQLITE_OMIT_SUBQUERY */ |
| 61637 | 61775 | |
| 61638 | 61776 | /* |
| 61639 | 61777 | ** Duplicate an 8-byte value |
| | @@ -62115,11 +62253,11 @@ |
| 62115 | 62253 | assert( !ExprHasProperty(pExpr, EP_IntValue) ); |
| 62116 | 62254 | assert( pExpr->u.zToken!=0 ); |
| 62117 | 62255 | assert( pExpr->u.zToken[0]!=0 ); |
| 62118 | 62256 | if( pExpr->u.zToken[1]==0 |
| 62119 | 62257 | && (pOp = sqlite3VdbeGetOp(v, -1))->opcode==OP_Variable |
| 62120 | | - && pOp->p1+pOp->p3==pExpr->iTable |
| 62258 | + && pOp->p1+pOp->p3==pExpr->iColumn |
| 62121 | 62259 | && pOp->p2+pOp->p3==target |
| 62122 | 62260 | && pOp->p4.z==0 |
| 62123 | 62261 | ){ |
| 62124 | 62262 | /* If the previous instruction was a copy of the previous unnamed |
| 62125 | 62263 | ** parameter into the previous register, then simply increment the |
| | @@ -62126,11 +62264,11 @@ |
| 62126 | 62264 | ** repeat count on the prior instruction rather than making a new |
| 62127 | 62265 | ** instruction. |
| 62128 | 62266 | */ |
| 62129 | 62267 | pOp->p3++; |
| 62130 | 62268 | }else{ |
| 62131 | | - sqlite3VdbeAddOp3(v, OP_Variable, pExpr->iTable, target, 1); |
| 62269 | + sqlite3VdbeAddOp3(v, OP_Variable, pExpr->iColumn, target, 1); |
| 62132 | 62270 | if( pExpr->u.zToken[1]!=0 ){ |
| 62133 | 62271 | sqlite3VdbeChangeP4(v, -1, pExpr->u.zToken, 0); |
| 62134 | 62272 | } |
| 62135 | 62273 | } |
| 62136 | 62274 | break; |
| | @@ -62386,12 +62524,11 @@ |
| 62386 | 62524 | #ifndef SQLITE_OMIT_SUBQUERY |
| 62387 | 62525 | case TK_EXISTS: |
| 62388 | 62526 | case TK_SELECT: { |
| 62389 | 62527 | testcase( op==TK_EXISTS ); |
| 62390 | 62528 | testcase( op==TK_SELECT ); |
| 62391 | | - sqlite3CodeSubselect(pParse, pExpr, 0, 0); |
| 62392 | | - inReg = pExpr->iColumn; |
| 62529 | + inReg = sqlite3CodeSubselect(pParse, pExpr, 0, 0); |
| 62393 | 62530 | break; |
| 62394 | 62531 | } |
| 62395 | 62532 | case TK_IN: { |
| 62396 | 62533 | int rNotFound = 0; |
| 62397 | 62534 | int rMayHaveNull = 0; |
| | @@ -62752,10 +62889,11 @@ |
| 62752 | 62889 | if( ALWAYS(pExpr->op!=TK_REGISTER) ){ |
| 62753 | 62890 | int iMem; |
| 62754 | 62891 | iMem = ++pParse->nMem; |
| 62755 | 62892 | sqlite3VdbeAddOp2(v, OP_Copy, inReg, iMem); |
| 62756 | 62893 | pExpr->iTable = iMem; |
| 62894 | + pExpr->op2 = pExpr->op; |
| 62757 | 62895 | pExpr->op = TK_REGISTER; |
| 62758 | 62896 | } |
| 62759 | 62897 | return inReg; |
| 62760 | 62898 | } |
| 62761 | 62899 | |
| | @@ -62825,10 +62963,11 @@ |
| 62825 | 62963 | ** expression. |
| 62826 | 62964 | */ |
| 62827 | 62965 | static int evalConstExpr(Walker *pWalker, Expr *pExpr){ |
| 62828 | 62966 | Parse *pParse = pWalker->pParse; |
| 62829 | 62967 | switch( pExpr->op ){ |
| 62968 | + case TK_IN: |
| 62830 | 62969 | case TK_REGISTER: { |
| 62831 | 62970 | return WRC_Prune; |
| 62832 | 62971 | } |
| 62833 | 62972 | case TK_FUNCTION: |
| 62834 | 62973 | case TK_AGG_FUNCTION: |
| | @@ -78185,10 +78324,11 @@ |
| 78185 | 78324 | static int sqlite3Prepare( |
| 78186 | 78325 | sqlite3 *db, /* Database handle. */ |
| 78187 | 78326 | const char *zSql, /* UTF-8 encoded SQL statement. */ |
| 78188 | 78327 | int nBytes, /* Length of zSql in bytes. */ |
| 78189 | 78328 | int saveSqlFlag, /* True to copy SQL text into the sqlite3_stmt */ |
| 78329 | + Vdbe *pReprepare, /* VM being reprepared */ |
| 78190 | 78330 | sqlite3_stmt **ppStmt, /* OUT: A pointer to the prepared statement */ |
| 78191 | 78331 | const char **pzTail /* OUT: End of parsed string */ |
| 78192 | 78332 | ){ |
| 78193 | 78333 | Parse *pParse; /* Parsing context */ |
| 78194 | 78334 | char *zErrMsg = 0; /* Error message */ |
| | @@ -78199,10 +78339,11 @@ |
| 78199 | 78339 | pParse = sqlite3StackAllocZero(db, sizeof(*pParse)); |
| 78200 | 78340 | if( pParse==0 ){ |
| 78201 | 78341 | rc = SQLITE_NOMEM; |
| 78202 | 78342 | goto end_prepare; |
| 78203 | 78343 | } |
| 78344 | + pParse->pReprepare = pReprepare; |
| 78204 | 78345 | |
| 78205 | 78346 | if( sqlite3SafetyOn(db) ){ |
| 78206 | 78347 | rc = SQLITE_MISUSE; |
| 78207 | 78348 | goto end_prepare; |
| 78208 | 78349 | } |
| | @@ -78356,10 +78497,11 @@ |
| 78356 | 78497 | static int sqlite3LockAndPrepare( |
| 78357 | 78498 | sqlite3 *db, /* Database handle. */ |
| 78358 | 78499 | const char *zSql, /* UTF-8 encoded SQL statement. */ |
| 78359 | 78500 | int nBytes, /* Length of zSql in bytes. */ |
| 78360 | 78501 | int saveSqlFlag, /* True to copy SQL text into the sqlite3_stmt */ |
| 78502 | + Vdbe *pOld, /* VM being reprepared */ |
| 78361 | 78503 | sqlite3_stmt **ppStmt, /* OUT: A pointer to the prepared statement */ |
| 78362 | 78504 | const char **pzTail /* OUT: End of parsed string */ |
| 78363 | 78505 | ){ |
| 78364 | 78506 | int rc; |
| 78365 | 78507 | assert( ppStmt!=0 ); |
| | @@ -78367,14 +78509,14 @@ |
| 78367 | 78509 | if( !sqlite3SafetyCheckOk(db) ){ |
| 78368 | 78510 | return SQLITE_MISUSE; |
| 78369 | 78511 | } |
| 78370 | 78512 | sqlite3_mutex_enter(db->mutex); |
| 78371 | 78513 | sqlite3BtreeEnterAll(db); |
| 78372 | | - rc = sqlite3Prepare(db, zSql, nBytes, saveSqlFlag, ppStmt, pzTail); |
| 78514 | + rc = sqlite3Prepare(db, zSql, nBytes, saveSqlFlag, pOld, ppStmt, pzTail); |
| 78373 | 78515 | if( rc==SQLITE_SCHEMA ){ |
| 78374 | 78516 | sqlite3_finalize(*ppStmt); |
| 78375 | | - rc = sqlite3Prepare(db, zSql, nBytes, saveSqlFlag, ppStmt, pzTail); |
| 78517 | + rc = sqlite3Prepare(db, zSql, nBytes, saveSqlFlag, pOld, ppStmt, pzTail); |
| 78376 | 78518 | } |
| 78377 | 78519 | sqlite3BtreeLeaveAll(db); |
| 78378 | 78520 | sqlite3_mutex_leave(db->mutex); |
| 78379 | 78521 | return rc; |
| 78380 | 78522 | } |
| | @@ -78396,11 +78538,11 @@ |
| 78396 | 78538 | assert( sqlite3_mutex_held(sqlite3VdbeDb(p)->mutex) ); |
| 78397 | 78539 | zSql = sqlite3_sql((sqlite3_stmt *)p); |
| 78398 | 78540 | assert( zSql!=0 ); /* Reprepare only called for prepare_v2() statements */ |
| 78399 | 78541 | db = sqlite3VdbeDb(p); |
| 78400 | 78542 | assert( sqlite3_mutex_held(db->mutex) ); |
| 78401 | | - rc = sqlite3LockAndPrepare(db, zSql, -1, 0, &pNew, 0); |
| 78543 | + rc = sqlite3LockAndPrepare(db, zSql, -1, 0, p, &pNew, 0); |
| 78402 | 78544 | if( rc ){ |
| 78403 | 78545 | if( rc==SQLITE_NOMEM ){ |
| 78404 | 78546 | db->mallocFailed = 1; |
| 78405 | 78547 | } |
| 78406 | 78548 | assert( pNew==0 ); |
| | @@ -78430,11 +78572,11 @@ |
| 78430 | 78572 | int nBytes, /* Length of zSql in bytes. */ |
| 78431 | 78573 | sqlite3_stmt **ppStmt, /* OUT: A pointer to the prepared statement */ |
| 78432 | 78574 | const char **pzTail /* OUT: End of parsed string */ |
| 78433 | 78575 | ){ |
| 78434 | 78576 | int rc; |
| 78435 | | - rc = sqlite3LockAndPrepare(db,zSql,nBytes,0,ppStmt,pzTail); |
| 78577 | + rc = sqlite3LockAndPrepare(db,zSql,nBytes,0,0,ppStmt,pzTail); |
| 78436 | 78578 | assert( rc==SQLITE_OK || ppStmt==0 || *ppStmt==0 ); /* VERIFY: F13021 */ |
| 78437 | 78579 | return rc; |
| 78438 | 78580 | } |
| 78439 | 78581 | SQLITE_API int sqlite3_prepare_v2( |
| 78440 | 78582 | sqlite3 *db, /* Database handle. */ |
| | @@ -78442,11 +78584,11 @@ |
| 78442 | 78584 | int nBytes, /* Length of zSql in bytes. */ |
| 78443 | 78585 | sqlite3_stmt **ppStmt, /* OUT: A pointer to the prepared statement */ |
| 78444 | 78586 | const char **pzTail /* OUT: End of parsed string */ |
| 78445 | 78587 | ){ |
| 78446 | 78588 | int rc; |
| 78447 | | - rc = sqlite3LockAndPrepare(db,zSql,nBytes,1,ppStmt,pzTail); |
| 78589 | + rc = sqlite3LockAndPrepare(db,zSql,nBytes,1,0,ppStmt,pzTail); |
| 78448 | 78590 | assert( rc==SQLITE_OK || ppStmt==0 || *ppStmt==0 ); /* VERIFY: F13021 */ |
| 78449 | 78591 | return rc; |
| 78450 | 78592 | } |
| 78451 | 78593 | |
| 78452 | 78594 | |
| | @@ -78476,11 +78618,11 @@ |
| 78476 | 78618 | return SQLITE_MISUSE; |
| 78477 | 78619 | } |
| 78478 | 78620 | sqlite3_mutex_enter(db->mutex); |
| 78479 | 78621 | zSql8 = sqlite3Utf16to8(db, zSql, nBytes); |
| 78480 | 78622 | if( zSql8 ){ |
| 78481 | | - rc = sqlite3LockAndPrepare(db, zSql8, -1, saveSqlFlag, ppStmt, &zTail8); |
| 78623 | + rc = sqlite3LockAndPrepare(db, zSql8, -1, saveSqlFlag, 0, ppStmt, &zTail8); |
| 78482 | 78624 | } |
| 78483 | 78625 | |
| 78484 | 78626 | if( zTail8 && pzTail ){ |
| 78485 | 78627 | /* If sqlite3_prepare returns a tail pointer, we calculate the |
| 78486 | 78628 | ** equivalent pointer into the UTF-16 string by counting the unicode |
| | @@ -78724,55 +78866,49 @@ |
| 78724 | 78866 | } |
| 78725 | 78867 | return -1; |
| 78726 | 78868 | } |
| 78727 | 78869 | |
| 78728 | 78870 | /* |
| 78729 | | -** Create an expression node for an identifier with the name of zName |
| 78730 | | -*/ |
| 78731 | | -SQLITE_PRIVATE Expr *sqlite3CreateIdExpr(Parse *pParse, const char *zName){ |
| 78732 | | - return sqlite3Expr(pParse->db, TK_ID, zName); |
| 78733 | | -} |
| 78734 | | - |
| 78735 | | -/* |
| 78736 | | -** Add a term to the WHERE expression in *ppExpr that requires the |
| 78737 | | -** zCol column to be equal in the two tables pTab1 and pTab2. |
| 78871 | +** This function is used to add terms implied by JOIN syntax to the |
| 78872 | +** WHERE clause expression of a SELECT statement. The new term, which |
| 78873 | +** is ANDed with the existing WHERE clause, is of the form: |
| 78874 | +** |
| 78875 | +** (tab1.col1 = tab2.col2) |
| 78876 | +** |
| 78877 | +** where tab1 is the iSrc'th table in SrcList pSrc and tab2 is the |
| 78878 | +** (iSrc+1)'th. Column col1 is column iColLeft of tab1, and col2 is |
| 78879 | +** column iColRight of tab2. |
| 78738 | 78880 | */ |
| 78739 | 78881 | static void addWhereTerm( |
| 78740 | | - Parse *pParse, /* Parsing context */ |
| 78741 | | - const char *zCol, /* Name of the column */ |
| 78742 | | - const Table *pTab1, /* First table */ |
| 78743 | | - const char *zAlias1, /* Alias for first table. May be NULL */ |
| 78744 | | - const Table *pTab2, /* Second table */ |
| 78745 | | - const char *zAlias2, /* Alias for second table. May be NULL */ |
| 78746 | | - int iRightJoinTable, /* VDBE cursor for the right table */ |
| 78747 | | - Expr **ppExpr, /* Add the equality term to this expression */ |
| 78748 | | - int isOuterJoin /* True if dealing with an OUTER join */ |
| 78882 | + Parse *pParse, /* Parsing context */ |
| 78883 | + SrcList *pSrc, /* List of tables in FROM clause */ |
| 78884 | + int iSrc, /* Index of first table to join in pSrc */ |
| 78885 | + int iColLeft, /* Index of column in first table */ |
| 78886 | + int iColRight, /* Index of column in second table */ |
| 78887 | + int isOuterJoin, /* True if this is an OUTER join */ |
| 78888 | + Expr **ppWhere /* IN/OUT: The WHERE clause to add to */ |
| 78749 | 78889 | ){ |
| 78750 | | - Expr *pE1a, *pE1b, *pE1c; |
| 78751 | | - Expr *pE2a, *pE2b, *pE2c; |
| 78752 | | - Expr *pE; |
| 78753 | | - |
| 78754 | | - pE1a = sqlite3CreateIdExpr(pParse, zCol); |
| 78755 | | - pE2a = sqlite3CreateIdExpr(pParse, zCol); |
| 78756 | | - if( zAlias1==0 ){ |
| 78757 | | - zAlias1 = pTab1->zName; |
| 78758 | | - } |
| 78759 | | - pE1b = sqlite3CreateIdExpr(pParse, zAlias1); |
| 78760 | | - if( zAlias2==0 ){ |
| 78761 | | - zAlias2 = pTab2->zName; |
| 78762 | | - } |
| 78763 | | - pE2b = sqlite3CreateIdExpr(pParse, zAlias2); |
| 78764 | | - pE1c = sqlite3PExpr(pParse, TK_DOT, pE1b, pE1a, 0); |
| 78765 | | - pE2c = sqlite3PExpr(pParse, TK_DOT, pE2b, pE2a, 0); |
| 78766 | | - pE = sqlite3PExpr(pParse, TK_EQ, pE1c, pE2c, 0); |
| 78767 | | - if( pE && isOuterJoin ){ |
| 78768 | | - ExprSetProperty(pE, EP_FromJoin); |
| 78769 | | - assert( !ExprHasAnyProperty(pE, EP_TokenOnly|EP_Reduced) ); |
| 78770 | | - ExprSetIrreducible(pE); |
| 78771 | | - pE->iRightJoinTable = (i16)iRightJoinTable; |
| 78772 | | - } |
| 78773 | | - *ppExpr = sqlite3ExprAnd(pParse->db,*ppExpr, pE); |
| 78890 | + sqlite3 *db = pParse->db; |
| 78891 | + Expr *pE1; |
| 78892 | + Expr *pE2; |
| 78893 | + Expr *pEq; |
| 78894 | + |
| 78895 | + assert( pSrc->nSrc>(iSrc+1) ); |
| 78896 | + assert( pSrc->a[iSrc].pTab ); |
| 78897 | + assert( pSrc->a[iSrc+1].pTab ); |
| 78898 | + |
| 78899 | + pE1 = sqlite3CreateColumnExpr(db, pSrc, iSrc, iColLeft); |
| 78900 | + pE2 = sqlite3CreateColumnExpr(db, pSrc, iSrc+1, iColRight); |
| 78901 | + |
| 78902 | + pEq = sqlite3PExpr(pParse, TK_EQ, pE1, pE2, 0); |
| 78903 | + if( pEq && isOuterJoin ){ |
| 78904 | + ExprSetProperty(pEq, EP_FromJoin); |
| 78905 | + assert( !ExprHasAnyProperty(pEq, EP_TokenOnly|EP_Reduced) ); |
| 78906 | + ExprSetIrreducible(pEq); |
| 78907 | + pEq->iRightJoinTable = (i16)pE2->iTable; |
| 78908 | + } |
| 78909 | + *ppWhere = sqlite3ExprAnd(db, *ppWhere, pEq); |
| 78774 | 78910 | } |
| 78775 | 78911 | |
| 78776 | 78912 | /* |
| 78777 | 78913 | ** Set the EP_FromJoin property on all terms of the given expression. |
| 78778 | 78914 | ** And set the Expr.iRightJoinTable to iTable for every term in the |
| | @@ -78850,15 +78986,13 @@ |
| 78850 | 78986 | "an ON or USING clause", 0); |
| 78851 | 78987 | return 1; |
| 78852 | 78988 | } |
| 78853 | 78989 | for(j=0; j<pLeftTab->nCol; j++){ |
| 78854 | 78990 | char *zName = pLeftTab->aCol[j].zName; |
| 78855 | | - if( columnIndex(pRightTab, zName)>=0 ){ |
| 78856 | | - addWhereTerm(pParse, zName, pLeftTab, pLeft->zAlias, |
| 78857 | | - pRightTab, pRight->zAlias, |
| 78858 | | - pRight->iCursor, &p->pWhere, isOuter); |
| 78859 | | - |
| 78991 | + int iRightCol = columnIndex(pRightTab, zName); |
| 78992 | + if( iRightCol>=0 ){ |
| 78993 | + addWhereTerm(pParse, pSrc, i, j, iRightCol, isOuter, &p->pWhere); |
| 78860 | 78994 | } |
| 78861 | 78995 | } |
| 78862 | 78996 | } |
| 78863 | 78997 | |
| 78864 | 78998 | /* Disallow both ON and USING clauses in the same join |
| | @@ -78887,18 +79021,18 @@ |
| 78887 | 79021 | */ |
| 78888 | 79022 | if( pRight->pUsing ){ |
| 78889 | 79023 | IdList *pList = pRight->pUsing; |
| 78890 | 79024 | for(j=0; j<pList->nId; j++){ |
| 78891 | 79025 | char *zName = pList->a[j].zName; |
| 78892 | | - if( columnIndex(pLeftTab, zName)<0 || columnIndex(pRightTab, zName)<0 ){ |
| 79026 | + int iLeftCol = columnIndex(pLeftTab, zName); |
| 79027 | + int iRightCol = columnIndex(pRightTab, zName); |
| 79028 | + if( iLeftCol<0 || iRightCol<0 ){ |
| 78893 | 79029 | sqlite3ErrorMsg(pParse, "cannot join using column %s - column " |
| 78894 | 79030 | "not present in both tables", zName); |
| 78895 | 79031 | return 1; |
| 78896 | 79032 | } |
| 78897 | | - addWhereTerm(pParse, zName, pLeftTab, pLeft->zAlias, |
| 78898 | | - pRightTab, pRight->zAlias, |
| 78899 | | - pRight->iCursor, &p->pWhere, isOuter); |
| 79033 | + addWhereTerm(pParse, pSrc, i, iLeftCol, iRightCol, isOuter, &p->pWhere); |
| 78900 | 79034 | } |
| 78901 | 79035 | } |
| 78902 | 79036 | } |
| 78903 | 79037 | return 0; |
| 78904 | 79038 | } |
| | @@ -84635,22 +84769,21 @@ |
| 84635 | 84769 | SelectDest dest; |
| 84636 | 84770 | |
| 84637 | 84771 | /* Construct the SELECT statement that will find the new values for |
| 84638 | 84772 | ** all updated rows. |
| 84639 | 84773 | */ |
| 84640 | | - pEList = sqlite3ExprListAppend(pParse, 0, |
| 84641 | | - sqlite3CreateIdExpr(pParse, "_rowid_")); |
| 84774 | + pEList = sqlite3ExprListAppend(pParse, 0, sqlite3Expr(db, TK_ID, "_rowid_")); |
| 84642 | 84775 | if( pRowid ){ |
| 84643 | 84776 | pEList = sqlite3ExprListAppend(pParse, pEList, |
| 84644 | 84777 | sqlite3ExprDup(db, pRowid, 0)); |
| 84645 | 84778 | } |
| 84646 | 84779 | assert( pTab->iPKey<0 ); |
| 84647 | 84780 | for(i=0; i<pTab->nCol; i++){ |
| 84648 | 84781 | if( aXRef[i]>=0 ){ |
| 84649 | 84782 | pExpr = sqlite3ExprDup(db, pChanges->a[aXRef[i]].pExpr, 0); |
| 84650 | 84783 | }else{ |
| 84651 | | - pExpr = sqlite3CreateIdExpr(pParse, pTab->aCol[i].zName); |
| 84784 | + pExpr = sqlite3Expr(db, TK_ID, pTab->aCol[i].zName); |
| 84652 | 84785 | } |
| 84653 | 84786 | pEList = sqlite3ExprListAppend(pParse, pEList, pExpr); |
| 84654 | 84787 | } |
| 84655 | 84788 | pSelect = sqlite3SelectNew(pParse, pEList, pSrc, pWhere, 0, 0, 0, 0, 0, 0); |
| 84656 | 84789 | |
| | @@ -84816,10 +84949,16 @@ |
| 84816 | 84949 | rc = execSql(db, zSql); |
| 84817 | 84950 | if( rc!=SQLITE_OK ) goto end_of_vacuum; |
| 84818 | 84951 | pDb = &db->aDb[db->nDb-1]; |
| 84819 | 84952 | assert( strcmp(db->aDb[db->nDb-1].zName,"vacuum_db")==0 ); |
| 84820 | 84953 | pTemp = db->aDb[db->nDb-1].pBt; |
| 84954 | + |
| 84955 | + /* The call to execSql() to attach the temp database has left the file |
| 84956 | + ** locked (as there was more than one active statement when the transaction |
| 84957 | + ** to read the schema was concluded. Unlock it here so that this doesn't |
| 84958 | + ** cause problems for the call to BtreeSetPageSize() below. */ |
| 84959 | + sqlite3BtreeCommit(pTemp); |
| 84821 | 84960 | |
| 84822 | 84961 | nRes = sqlite3BtreeGetReserve(pMain); |
| 84823 | 84962 | |
| 84824 | 84963 | /* A VACUUM cannot change the pagesize of an encrypted database. */ |
| 84825 | 84964 | #ifdef SQLITE_HAS_CODEC |
| | @@ -84870,17 +85009,17 @@ |
| 84870 | 85009 | "SELECT 'CREATE UNIQUE INDEX vacuum_db.' || substr(sql,21) " |
| 84871 | 85010 | " FROM sqlite_master WHERE sql LIKE 'CREATE UNIQUE INDEX %'"); |
| 84872 | 85011 | if( rc!=SQLITE_OK ) goto end_of_vacuum; |
| 84873 | 85012 | |
| 84874 | 85013 | /* Loop through the tables in the main database. For each, do |
| 84875 | | - ** an "INSERT INTO vacuum_db.xxx SELECT * FROM xxx;" to copy |
| 85014 | + ** an "INSERT INTO vacuum_db.xxx SELECT * FROM main.xxx;" to copy |
| 84876 | 85015 | ** the contents to the temporary database. |
| 84877 | 85016 | */ |
| 84878 | 85017 | rc = execExecSql(db, |
| 84879 | 85018 | "SELECT 'INSERT INTO vacuum_db.' || quote(name) " |
| 84880 | | - "|| ' SELECT * FROM ' || quote(name) || ';'" |
| 84881 | | - "FROM sqlite_master " |
| 85019 | + "|| ' SELECT * FROM main.' || quote(name) || ';'" |
| 85020 | + "FROM main.sqlite_master " |
| 84882 | 85021 | "WHERE type = 'table' AND name!='sqlite_sequence' " |
| 84883 | 85022 | " AND rootpage>0" |
| 84884 | 85023 | |
| 84885 | 85024 | ); |
| 84886 | 85025 | if( rc!=SQLITE_OK ) goto end_of_vacuum; |
| | @@ -84892,11 +85031,11 @@ |
| 84892 | 85031 | "FROM vacuum_db.sqlite_master WHERE name='sqlite_sequence' " |
| 84893 | 85032 | ); |
| 84894 | 85033 | if( rc!=SQLITE_OK ) goto end_of_vacuum; |
| 84895 | 85034 | rc = execExecSql(db, |
| 84896 | 85035 | "SELECT 'INSERT INTO vacuum_db.' || quote(name) " |
| 84897 | | - "|| ' SELECT * FROM ' || quote(name) || ';' " |
| 85036 | + "|| ' SELECT * FROM main.' || quote(name) || ';' " |
| 84898 | 85037 | "FROM vacuum_db.sqlite_master WHERE name=='sqlite_sequence';" |
| 84899 | 85038 | ); |
| 84900 | 85039 | if( rc!=SQLITE_OK ) goto end_of_vacuum; |
| 84901 | 85040 | |
| 84902 | 85041 | |
| | @@ -84906,11 +85045,11 @@ |
| 84906 | 85045 | ** from the SQLITE_MASTER table. |
| 84907 | 85046 | */ |
| 84908 | 85047 | rc = execSql(db, |
| 84909 | 85048 | "INSERT INTO vacuum_db.sqlite_master " |
| 84910 | 85049 | " SELECT type, name, tbl_name, rootpage, sql" |
| 84911 | | - " FROM sqlite_master" |
| 85050 | + " FROM main.sqlite_master" |
| 84912 | 85051 | " WHERE type='view' OR type='trigger'" |
| 84913 | 85052 | " OR (type='table' AND rootpage=0)" |
| 84914 | 85053 | ); |
| 84915 | 85054 | if( rc ) goto end_of_vacuum; |
| 84916 | 85055 | |
| | @@ -86580,59 +86719,103 @@ |
| 86580 | 86719 | ** literal that does not begin with a wildcard. |
| 86581 | 86720 | */ |
| 86582 | 86721 | static int isLikeOrGlob( |
| 86583 | 86722 | Parse *pParse, /* Parsing and code generating context */ |
| 86584 | 86723 | Expr *pExpr, /* Test this expression */ |
| 86585 | | - int *pnPattern, /* Number of non-wildcard prefix characters */ |
| 86724 | + Expr **ppPrefix, /* Pointer to TK_STRING expression with pattern prefix */ |
| 86586 | 86725 | int *pisComplete, /* True if the only wildcard is % in the last character */ |
| 86587 | 86726 | int *pnoCase /* True if uppercase is equivalent to lowercase */ |
| 86588 | 86727 | ){ |
| 86589 | | - const char *z; /* String on RHS of LIKE operator */ |
| 86728 | + const char *z = 0; /* String on RHS of LIKE operator */ |
| 86590 | 86729 | Expr *pRight, *pLeft; /* Right and left size of LIKE operator */ |
| 86591 | 86730 | ExprList *pList; /* List of operands to the LIKE operator */ |
| 86592 | 86731 | int c; /* One character in z[] */ |
| 86593 | 86732 | int cnt; /* Number of non-wildcard prefix characters */ |
| 86594 | 86733 | char wc[3]; /* Wildcard characters */ |
| 86595 | 86734 | CollSeq *pColl; /* Collating sequence for LHS */ |
| 86596 | 86735 | sqlite3 *db = pParse->db; /* Database connection */ |
| 86736 | + sqlite3_value *pVal = 0; |
| 86737 | + int op; /* Opcode of pRight */ |
| 86597 | 86738 | |
| 86598 | 86739 | if( !sqlite3IsLikeFunction(db, pExpr, pnoCase, wc) ){ |
| 86599 | 86740 | return 0; |
| 86600 | 86741 | } |
| 86601 | 86742 | #ifdef SQLITE_EBCDIC |
| 86602 | 86743 | if( *pnoCase ) return 0; |
| 86603 | 86744 | #endif |
| 86604 | 86745 | pList = pExpr->x.pList; |
| 86605 | | - pRight = pList->a[0].pExpr; |
| 86606 | | - if( pRight->op!=TK_STRING ){ |
| 86607 | | - return 0; |
| 86608 | | - } |
| 86609 | 86746 | pLeft = pList->a[1].pExpr; |
| 86610 | | - if( pLeft->op!=TK_COLUMN ){ |
| 86747 | + if( pLeft->op!=TK_COLUMN || sqlite3ExprAffinity(pLeft)!=SQLITE_AFF_TEXT ){ |
| 86748 | + /* IMP: R-02065-49465 The left-hand side of the LIKE or GLOB operator must |
| 86749 | + ** be the name of an indexed column with TEXT affinity. */ |
| 86611 | 86750 | return 0; |
| 86612 | 86751 | } |
| 86752 | + assert( pLeft->iColumn!=(-1) ); /* Because IPK never has AFF_TEXT */ |
| 86613 | 86753 | pColl = sqlite3ExprCollSeq(pParse, pLeft); |
| 86614 | | - assert( pColl!=0 || pLeft->iColumn==-1 ); |
| 86615 | | - if( pColl==0 ) return 0; |
| 86754 | + assert( pColl!=0 ); /* Every non-IPK column has a collating sequence */ |
| 86616 | 86755 | if( (pColl->type!=SQLITE_COLL_BINARY || *pnoCase) && |
| 86617 | 86756 | (pColl->type!=SQLITE_COLL_NOCASE || !*pnoCase) ){ |
| 86757 | + /* IMP: R-09003-32046 For the GLOB operator, the column must use the |
| 86758 | + ** default BINARY collating sequence. |
| 86759 | + ** IMP: R-41408-28306 For the LIKE operator, if case_sensitive_like mode |
| 86760 | + ** is enabled then the column must use the default BINARY collating |
| 86761 | + ** sequence, or if case_sensitive_like mode is disabled then the column |
| 86762 | + ** must use the built-in NOCASE collating sequence. |
| 86763 | + */ |
| 86618 | 86764 | return 0; |
| 86619 | 86765 | } |
| 86620 | | - if( sqlite3ExprAffinity(pLeft)!=SQLITE_AFF_TEXT ) return 0; |
| 86621 | | - z = pRight->u.zToken; |
| 86622 | | - if( ALWAYS(z) ){ |
| 86766 | + |
| 86767 | + pRight = pList->a[0].pExpr; |
| 86768 | + op = pRight->op; |
| 86769 | + if( op==TK_REGISTER ){ |
| 86770 | + op = pRight->op2; |
| 86771 | + } |
| 86772 | + if( op==TK_VARIABLE ){ |
| 86773 | + Vdbe *pReprepare = pParse->pReprepare; |
| 86774 | + pVal = sqlite3VdbeGetValue(pReprepare, pRight->iColumn, SQLITE_AFF_NONE); |
| 86775 | + if( pVal && sqlite3_value_type(pVal)==SQLITE_TEXT ){ |
| 86776 | + z = (char *)sqlite3_value_text(pVal); |
| 86777 | + } |
| 86778 | + sqlite3VdbeSetVarmask(pParse->pVdbe, pRight->iColumn); |
| 86779 | + assert( pRight->op==TK_VARIABLE || pRight->op==TK_REGISTER ); |
| 86780 | + }else if( op==TK_STRING ){ |
| 86781 | + z = pRight->u.zToken; |
| 86782 | + } |
| 86783 | + if( z ){ |
| 86623 | 86784 | cnt = 0; |
| 86624 | 86785 | while( (c=z[cnt])!=0 && c!=wc[0] && c!=wc[1] && c!=wc[2] ){ |
| 86625 | 86786 | cnt++; |
| 86626 | 86787 | } |
| 86627 | 86788 | if( cnt!=0 && c!=0 && 255!=(u8)z[cnt-1] ){ |
| 86789 | + Expr *pPrefix; |
| 86628 | 86790 | *pisComplete = z[cnt]==wc[0] && z[cnt+1]==0; |
| 86629 | | - *pnPattern = cnt; |
| 86630 | | - return 1; |
| 86791 | + pPrefix = sqlite3Expr(db, TK_STRING, z); |
| 86792 | + if( pPrefix ) pPrefix->u.zToken[cnt] = 0; |
| 86793 | + *ppPrefix = pPrefix; |
| 86794 | + if( op==TK_VARIABLE ){ |
| 86795 | + Vdbe *v = pParse->pVdbe; |
| 86796 | + sqlite3VdbeSetVarmask(v, pRight->iColumn); |
| 86797 | + if( *pisComplete && pRight->u.zToken[1] ){ |
| 86798 | + /* If the rhs of the LIKE expression is a variable, and the current |
| 86799 | + ** value of the variable means there is no need to invoke the LIKE |
| 86800 | + ** function, then no OP_Variable will be added to the program. |
| 86801 | + ** This causes problems for the sqlite3_bind_parameter_name() |
| 86802 | + ** API. To workaround them, add a dummy OP_Variable here. |
| 86803 | + */ |
| 86804 | + int r1 = sqlite3GetTempReg(pParse); |
| 86805 | + sqlite3ExprCodeTarget(pParse, pRight, r1); |
| 86806 | + sqlite3VdbeChangeP3(v, sqlite3VdbeCurrentAddr(v)-1, 0); |
| 86807 | + sqlite3ReleaseTempReg(pParse, r1); |
| 86808 | + } |
| 86809 | + } |
| 86810 | + }else{ |
| 86811 | + z = 0; |
| 86631 | 86812 | } |
| 86632 | 86813 | } |
| 86633 | | - return 0; |
| 86814 | + |
| 86815 | + sqlite3ValueFree(pVal); |
| 86816 | + return (z!=0); |
| 86634 | 86817 | } |
| 86635 | 86818 | #endif /* SQLITE_OMIT_LIKE_OPTIMIZATION */ |
| 86636 | 86819 | |
| 86637 | 86820 | |
| 86638 | 86821 | #ifndef SQLITE_OMIT_VIRTUALTABLE |
| | @@ -87009,14 +87192,14 @@ |
| 87009 | 87192 | WhereTerm *pTerm; /* The term to be analyzed */ |
| 87010 | 87193 | WhereMaskSet *pMaskSet; /* Set of table index masks */ |
| 87011 | 87194 | Expr *pExpr; /* The expression to be analyzed */ |
| 87012 | 87195 | Bitmask prereqLeft; /* Prerequesites of the pExpr->pLeft */ |
| 87013 | 87196 | Bitmask prereqAll; /* Prerequesites of pExpr */ |
| 87014 | | - Bitmask extraRight = 0; |
| 87015 | | - int nPattern; |
| 87016 | | - int isComplete; |
| 87017 | | - int noCase; |
| 87197 | + Bitmask extraRight = 0; /* */ |
| 87198 | + Expr *pStr1 = 0; /* RHS of LIKE/GLOB operator */ |
| 87199 | + int isComplete = 0; /* RHS of LIKE/GLOB ends with wildcard */ |
| 87200 | + int noCase = 0; /* LIKE/GLOB distinguishes case */ |
| 87018 | 87201 | int op; /* Top-level operator. pExpr->op */ |
| 87019 | 87202 | Parse *pParse = pWC->pParse; /* Parsing context */ |
| 87020 | 87203 | sqlite3 *db = pParse->db; /* Database connection */ |
| 87021 | 87204 | |
| 87022 | 87205 | if( db->mallocFailed ){ |
| | @@ -87147,25 +87330,25 @@ |
| 87147 | 87330 | ** x>='abc' AND x<'abd' AND x LIKE 'abc%' |
| 87148 | 87331 | ** |
| 87149 | 87332 | ** The last character of the prefix "abc" is incremented to form the |
| 87150 | 87333 | ** termination condition "abd". |
| 87151 | 87334 | */ |
| 87152 | | - if( isLikeOrGlob(pParse, pExpr, &nPattern, &isComplete, &noCase) |
| 87153 | | - && pWC->op==TK_AND ){ |
| 87154 | | - Expr *pLeft, *pRight; |
| 87155 | | - Expr *pStr1, *pStr2; |
| 87156 | | - Expr *pNewExpr1, *pNewExpr2; |
| 87157 | | - int idxNew1, idxNew2; |
| 87335 | + if( pWC->op==TK_AND |
| 87336 | + && isLikeOrGlob(pParse, pExpr, &pStr1, &isComplete, &noCase) |
| 87337 | + ){ |
| 87338 | + Expr *pLeft; /* LHS of LIKE/GLOB operator */ |
| 87339 | + Expr *pStr2; /* Copy of pStr1 - RHS of LIKE/GLOB operator */ |
| 87340 | + Expr *pNewExpr1; |
| 87341 | + Expr *pNewExpr2; |
| 87342 | + int idxNew1; |
| 87343 | + int idxNew2; |
| 87158 | 87344 | |
| 87159 | 87345 | pLeft = pExpr->x.pList->a[1].pExpr; |
| 87160 | | - pRight = pExpr->x.pList->a[0].pExpr; |
| 87161 | | - pStr1 = sqlite3Expr(db, TK_STRING, pRight->u.zToken); |
| 87162 | | - if( pStr1 ) pStr1->u.zToken[nPattern] = 0; |
| 87163 | 87346 | pStr2 = sqlite3ExprDup(db, pStr1, 0); |
| 87164 | 87347 | if( !db->mallocFailed ){ |
| 87165 | 87348 | u8 c, *pC; /* Last character before the first wildcard */ |
| 87166 | | - pC = (u8*)&pStr2->u.zToken[nPattern-1]; |
| 87349 | + pC = (u8*)&pStr2->u.zToken[sqlite3Strlen30(pStr2->u.zToken)-1]; |
| 87167 | 87350 | c = *pC; |
| 87168 | 87351 | if( noCase ){ |
| 87169 | 87352 | /* The point is to increment the last character before the first |
| 87170 | 87353 | ** wildcard. But if we increment '@', that will push it into the |
| 87171 | 87354 | ** alphabetic range where case conversions will mess up the |
| | @@ -87939,10 +88122,46 @@ |
| 87939 | 88122 | } |
| 87940 | 88123 | return SQLITE_OK; |
| 87941 | 88124 | } |
| 87942 | 88125 | #endif /* #ifdef SQLITE_ENABLE_STAT2 */ |
| 87943 | 88126 | |
| 88127 | +/* |
| 88128 | +** If expression pExpr represents a literal value, set *pp to point to |
| 88129 | +** an sqlite3_value structure containing the same value, with affinity |
| 88130 | +** aff applied to it, before returning. It is the responsibility of the |
| 88131 | +** caller to eventually release this structure by passing it to |
| 88132 | +** sqlite3ValueFree(). |
| 88133 | +** |
| 88134 | +** If the current parse is a recompile (sqlite3Reprepare()) and pExpr |
| 88135 | +** is an SQL variable that currently has a non-NULL value bound to it, |
| 88136 | +** create an sqlite3_value structure containing this value, again with |
| 88137 | +** affinity aff applied to it, instead. |
| 88138 | +** |
| 88139 | +** If neither of the above apply, set *pp to NULL. |
| 88140 | +** |
| 88141 | +** If an error occurs, return an error code. Otherwise, SQLITE_OK. |
| 88142 | +*/ |
| 88143 | +#ifdef SQLITE_ENABLE_STAT2 |
| 88144 | +static int valueFromExpr( |
| 88145 | + Parse *pParse, |
| 88146 | + Expr *pExpr, |
| 88147 | + u8 aff, |
| 88148 | + sqlite3_value **pp |
| 88149 | +){ |
| 88150 | + /* The evalConstExpr() function will have already converted any TK_VARIABLE |
| 88151 | + ** expression involved in an comparison into a TK_REGISTER. */ |
| 88152 | + assert( pExpr->op!=TK_VARIABLE ); |
| 88153 | + if( pExpr->op==TK_REGISTER && pExpr->op2==TK_VARIABLE ){ |
| 88154 | + int iVar = pExpr->iColumn; |
| 88155 | + sqlite3VdbeSetVarmask(pParse->pVdbe, iVar); |
| 88156 | + *pp = sqlite3VdbeGetValue(pParse->pReprepare, iVar, aff); |
| 88157 | + return SQLITE_OK; |
| 88158 | + } |
| 88159 | + return sqlite3ValueFromExpr(pParse->db, pExpr, SQLITE_UTF8, aff, pp); |
| 88160 | +} |
| 88161 | +#endif |
| 88162 | + |
| 87944 | 88163 | /* |
| 87945 | 88164 | ** This function is used to estimate the number of rows that will be visited |
| 87946 | 88165 | ** by scanning an index for a range of values. The range may have an upper |
| 87947 | 88166 | ** bound, a lower bound, or both. The WHERE clause terms that set the upper |
| 87948 | 88167 | ** and lower bounds are represented by pLower and pUpper respectively. For |
| | @@ -87991,27 +88210,26 @@ |
| 87991 | 88210 | int *piEst /* OUT: Return value */ |
| 87992 | 88211 | ){ |
| 87993 | 88212 | int rc = SQLITE_OK; |
| 87994 | 88213 | |
| 87995 | 88214 | #ifdef SQLITE_ENABLE_STAT2 |
| 87996 | | - sqlite3 *db = pParse->db; |
| 87997 | | - sqlite3_value *pLowerVal = 0; |
| 87998 | | - sqlite3_value *pUpperVal = 0; |
| 87999 | 88215 | |
| 88000 | 88216 | if( nEq==0 && p->aSample ){ |
| 88217 | + sqlite3_value *pLowerVal = 0; |
| 88218 | + sqlite3_value *pUpperVal = 0; |
| 88001 | 88219 | int iEst; |
| 88002 | 88220 | int iLower = 0; |
| 88003 | 88221 | int iUpper = SQLITE_INDEX_SAMPLES; |
| 88004 | | - u8 aff = p->pTable->aCol[0].affinity; |
| 88222 | + u8 aff = p->pTable->aCol[p->aiColumn[0]].affinity; |
| 88005 | 88223 | |
| 88006 | 88224 | if( pLower ){ |
| 88007 | 88225 | Expr *pExpr = pLower->pExpr->pRight; |
| 88008 | | - rc = sqlite3ValueFromExpr(db, pExpr, SQLITE_UTF8, aff, &pLowerVal); |
| 88226 | + rc = valueFromExpr(pParse, pExpr, aff, &pLowerVal); |
| 88009 | 88227 | } |
| 88010 | 88228 | if( rc==SQLITE_OK && pUpper ){ |
| 88011 | 88229 | Expr *pExpr = pUpper->pExpr->pRight; |
| 88012 | | - rc = sqlite3ValueFromExpr(db, pExpr, SQLITE_UTF8, aff, &pUpperVal); |
| 88230 | + rc = valueFromExpr(pParse, pExpr, aff, &pUpperVal); |
| 88013 | 88231 | } |
| 88014 | 88232 | |
| 88015 | 88233 | if( rc!=SQLITE_OK || (pLowerVal==0 && pUpperVal==0) ){ |
| 88016 | 88234 | sqlite3ValueFree(pLowerVal); |
| 88017 | 88235 | sqlite3ValueFree(pUpperVal); |
| | @@ -90177,469 +90395,469 @@ |
| 90177 | 90395 | ** yy_reduce_ofst[] For each state, the offset into yy_action for |
| 90178 | 90396 | ** shifting non-terminals after a reduce. |
| 90179 | 90397 | ** yy_default[] Default action for each state. |
| 90180 | 90398 | */ |
| 90181 | 90399 | static const YYACTIONTYPE yy_action[] = { |
| 90182 | | - /* 0 */ 312, 959, 182, 628, 2, 157, 219, 450, 24, 24, |
| 90183 | | - /* 10 */ 24, 24, 221, 26, 26, 26, 26, 27, 27, 28, |
| 90184 | | - /* 20 */ 28, 28, 29, 221, 424, 425, 30, 492, 33, 141, |
| 90185 | | - /* 30 */ 457, 463, 31, 26, 26, 26, 26, 27, 27, 28, |
| 90186 | | - /* 40 */ 28, 28, 29, 221, 28, 28, 28, 29, 221, 23, |
| 90187 | | - /* 50 */ 22, 32, 465, 466, 464, 464, 25, 25, 24, 24, |
| 90188 | | - /* 60 */ 24, 24, 293, 26, 26, 26, 26, 27, 27, 28, |
| 90189 | | - /* 70 */ 28, 28, 29, 221, 312, 450, 319, 479, 344, 208, |
| 90190 | | - /* 80 */ 47, 26, 26, 26, 26, 27, 27, 28, 28, 28, |
| 90191 | | - /* 90 */ 29, 221, 427, 428, 163, 339, 543, 368, 371, 372, |
| 90192 | | - /* 100 */ 521, 317, 472, 473, 457, 463, 296, 373, 294, 21, |
| 90193 | | - /* 110 */ 336, 367, 419, 416, 424, 425, 523, 1, 544, 446, |
| 90194 | | - /* 120 */ 80, 424, 425, 23, 22, 32, 465, 466, 464, 464, |
| 90195 | | - /* 130 */ 25, 25, 24, 24, 24, 24, 564, 26, 26, 26, |
| 90196 | | - /* 140 */ 26, 27, 27, 28, 28, 28, 29, 221, 312, 233, |
| 90197 | | - /* 150 */ 319, 441, 554, 152, 139, 263, 365, 268, 366, 160, |
| 90198 | | - /* 160 */ 551, 352, 332, 421, 222, 272, 362, 322, 218, 557, |
| 90199 | | - /* 170 */ 116, 339, 248, 574, 477, 223, 216, 573, 457, 463, |
| 90200 | | - /* 180 */ 450, 59, 427, 428, 295, 610, 336, 563, 538, 427, |
| 90201 | | - /* 190 */ 428, 385, 608, 609, 562, 446, 87, 23, 22, 32, |
| 90202 | | - /* 200 */ 465, 466, 464, 464, 25, 25, 24, 24, 24, 24, |
| 90203 | | - /* 210 */ 447, 26, 26, 26, 26, 27, 27, 28, 28, 28, |
| 90204 | | - /* 220 */ 29, 221, 312, 233, 477, 223, 576, 134, 139, 263, |
| 90205 | | - /* 230 */ 365, 268, 366, 160, 406, 354, 226, 498, 481, 272, |
| 90206 | | - /* 240 */ 339, 27, 27, 28, 28, 28, 29, 221, 450, 442, |
| 90207 | | - /* 250 */ 199, 540, 457, 463, 349, 336, 163, 551, 66, 368, |
| 90208 | | - /* 260 */ 371, 372, 450, 415, 446, 80, 522, 581, 401, 373, |
| 90209 | | - /* 270 */ 452, 23, 22, 32, 465, 466, 464, 464, 25, 25, |
| 90210 | | - /* 280 */ 24, 24, 24, 24, 447, 26, 26, 26, 26, 27, |
| 90211 | | - /* 290 */ 27, 28, 28, 28, 29, 221, 312, 339, 556, 607, |
| 90212 | | - /* 300 */ 197, 454, 454, 454, 546, 578, 352, 198, 607, 440, |
| 90213 | | - /* 310 */ 65, 351, 336, 426, 426, 399, 289, 424, 425, 606, |
| 90214 | | - /* 320 */ 605, 446, 73, 426, 214, 219, 457, 463, 606, 410, |
| 90215 | | - /* 330 */ 450, 241, 306, 196, 565, 479, 555, 208, 288, 29, |
| 90216 | | - /* 340 */ 221, 447, 4, 874, 504, 23, 22, 32, 465, 466, |
| 90217 | | - /* 350 */ 464, 464, 25, 25, 24, 24, 24, 24, 447, 26, |
| 90218 | | - /* 360 */ 26, 26, 26, 27, 27, 28, 28, 28, 29, 221, |
| 90219 | | - /* 370 */ 312, 163, 582, 339, 368, 371, 372, 314, 424, 425, |
| 90220 | | - /* 380 */ 604, 222, 397, 227, 373, 427, 428, 339, 336, 409, |
| 90221 | | - /* 390 */ 222, 478, 339, 30, 396, 33, 141, 446, 81, 62, |
| 90222 | | - /* 400 */ 457, 463, 336, 157, 400, 450, 504, 336, 438, 426, |
| 90223 | | - /* 410 */ 500, 446, 87, 41, 380, 613, 446, 80, 581, 23, |
| 90224 | | - /* 420 */ 22, 32, 465, 466, 464, 464, 25, 25, 24, 24, |
| 90225 | | - /* 430 */ 24, 24, 213, 26, 26, 26, 26, 27, 27, 28, |
| 90226 | | - /* 440 */ 28, 28, 29, 221, 312, 513, 427, 428, 517, 254, |
| 90227 | | - /* 450 */ 524, 386, 225, 339, 486, 363, 389, 339, 356, 443, |
| 90228 | | - /* 460 */ 494, 236, 30, 497, 33, 141, 399, 289, 336, 495, |
| 90229 | | - /* 470 */ 487, 501, 336, 450, 457, 463, 219, 446, 95, 445, |
| 90230 | | - /* 480 */ 68, 446, 95, 444, 424, 425, 488, 44, 348, 288, |
| 90231 | | - /* 490 */ 504, 424, 425, 23, 22, 32, 465, 466, 464, 464, |
| 90232 | | - /* 500 */ 25, 25, 24, 24, 24, 24, 391, 26, 26, 26, |
| 90233 | | - /* 510 */ 26, 27, 27, 28, 28, 28, 29, 221, 312, 361, |
| 90234 | | - /* 520 */ 556, 426, 520, 328, 191, 271, 339, 329, 247, 259, |
| 90235 | | - /* 530 */ 339, 566, 65, 249, 336, 426, 424, 425, 445, 516, |
| 90236 | | - /* 540 */ 426, 336, 444, 446, 9, 336, 556, 451, 457, 463, |
| 90237 | | - /* 550 */ 446, 74, 427, 428, 446, 69, 192, 618, 65, 427, |
| 90238 | | - /* 560 */ 428, 426, 323, 277, 16, 202, 189, 23, 22, 32, |
| 90239 | | - /* 570 */ 465, 466, 464, 464, 25, 25, 24, 24, 24, 24, |
| 90240 | | - /* 580 */ 255, 26, 26, 26, 26, 27, 27, 28, 28, 28, |
| 90241 | | - /* 590 */ 29, 221, 312, 339, 486, 426, 537, 235, 515, 447, |
| 90242 | | - /* 600 */ 339, 629, 419, 416, 427, 428, 217, 281, 336, 279, |
| 90243 | | - /* 610 */ 487, 203, 144, 526, 527, 336, 391, 446, 78, 429, |
| 90244 | | - /* 620 */ 430, 431, 457, 463, 446, 99, 488, 341, 528, 468, |
| 90245 | | - /* 630 */ 468, 426, 343, 472, 473, 626, 949, 474, 949, 529, |
| 90246 | | - /* 640 */ 447, 23, 22, 32, 465, 466, 464, 464, 25, 25, |
| 90247 | | - /* 650 */ 24, 24, 24, 24, 339, 26, 26, 26, 26, 27, |
| 90248 | | - /* 660 */ 27, 28, 28, 28, 29, 221, 312, 339, 162, 336, |
| 90249 | | - /* 670 */ 275, 283, 476, 376, 339, 579, 527, 346, 446, 98, |
| 90250 | | - /* 680 */ 622, 30, 336, 33, 141, 339, 426, 339, 508, 336, |
| 90251 | | - /* 690 */ 469, 446, 105, 418, 2, 222, 457, 463, 446, 101, |
| 90252 | | - /* 700 */ 336, 219, 336, 426, 161, 626, 948, 290, 948, 446, |
| 90253 | | - /* 710 */ 108, 446, 109, 398, 284, 23, 22, 32, 465, 466, |
| 90254 | | - /* 720 */ 464, 464, 25, 25, 24, 24, 24, 24, 339, 26, |
| 90255 | | - /* 730 */ 26, 26, 26, 27, 27, 28, 28, 28, 29, 221, |
| 90256 | | - /* 740 */ 312, 339, 271, 336, 339, 58, 535, 482, 143, 339, |
| 90257 | | - /* 750 */ 622, 318, 446, 133, 408, 257, 336, 426, 321, 336, |
| 90258 | | - /* 760 */ 357, 339, 272, 426, 336, 446, 135, 184, 446, 61, |
| 90259 | | - /* 770 */ 457, 463, 219, 446, 106, 426, 336, 493, 341, 234, |
| 90260 | | - /* 780 */ 468, 468, 621, 310, 407, 446, 102, 209, 144, 23, |
| 90261 | | - /* 790 */ 22, 32, 465, 466, 464, 464, 25, 25, 24, 24, |
| 90262 | | - /* 800 */ 24, 24, 339, 26, 26, 26, 26, 27, 27, 28, |
| 90263 | | - /* 810 */ 28, 28, 29, 221, 312, 339, 271, 336, 339, 341, |
| 90264 | | - /* 820 */ 538, 468, 468, 572, 383, 496, 446, 79, 499, 549, |
| 90265 | | - /* 830 */ 336, 426, 508, 336, 508, 341, 339, 468, 468, 446, |
| 90266 | | - /* 840 */ 103, 391, 446, 70, 457, 463, 572, 426, 40, 426, |
| 90267 | | - /* 850 */ 42, 336, 220, 324, 504, 341, 426, 468, 468, 18, |
| 90268 | | - /* 860 */ 446, 100, 266, 23, 22, 32, 465, 466, 464, 464, |
| 90269 | | - /* 870 */ 25, 25, 24, 24, 24, 24, 339, 26, 26, 26, |
| 90270 | | - /* 880 */ 26, 27, 27, 28, 28, 28, 29, 221, 312, 339, |
| 90271 | | - /* 890 */ 283, 336, 339, 261, 548, 384, 339, 327, 142, 550, |
| 90272 | | - /* 900 */ 446, 136, 475, 475, 336, 426, 185, 336, 499, 396, |
| 90273 | | - /* 910 */ 339, 336, 370, 446, 137, 256, 446, 138, 457, 463, |
| 90274 | | - /* 920 */ 446, 71, 499, 360, 426, 336, 161, 311, 623, 215, |
| 90275 | | - /* 930 */ 426, 359, 237, 412, 446, 82, 200, 23, 34, 32, |
| 90276 | | - /* 940 */ 465, 466, 464, 464, 25, 25, 24, 24, 24, 24, |
| 90277 | | - /* 950 */ 339, 26, 26, 26, 26, 27, 27, 28, 28, 28, |
| 90278 | | - /* 960 */ 29, 221, 312, 447, 271, 336, 339, 271, 340, 210, |
| 90279 | | - /* 970 */ 447, 172, 625, 211, 446, 83, 240, 552, 142, 426, |
| 90280 | | - /* 980 */ 321, 336, 426, 426, 339, 414, 331, 181, 458, 459, |
| 90281 | | - /* 990 */ 446, 72, 457, 463, 470, 506, 67, 158, 394, 336, |
| 90282 | | - /* 1000 */ 587, 325, 499, 447, 326, 311, 624, 447, 446, 84, |
| 90283 | | - /* 1010 */ 461, 462, 22, 32, 465, 466, 464, 464, 25, 25, |
| 90284 | | - /* 1020 */ 24, 24, 24, 24, 339, 26, 26, 26, 26, 27, |
| 90285 | | - /* 1030 */ 27, 28, 28, 28, 29, 221, 312, 460, 339, 336, |
| 90286 | | - /* 1040 */ 339, 283, 423, 393, 532, 533, 204, 205, 446, 85, |
| 90287 | | - /* 1050 */ 625, 392, 547, 336, 162, 336, 426, 426, 339, 435, |
| 90288 | | - /* 1060 */ 436, 339, 446, 104, 446, 86, 457, 463, 264, 291, |
| 90289 | | - /* 1070 */ 274, 49, 162, 336, 426, 426, 336, 297, 265, 542, |
| 90290 | | - /* 1080 */ 541, 405, 446, 88, 594, 446, 89, 32, 465, 466, |
| 90291 | | - /* 1090 */ 464, 464, 25, 25, 24, 24, 24, 24, 600, 26, |
| 90292 | | - /* 1100 */ 26, 26, 26, 27, 27, 28, 28, 28, 29, 221, |
| 90293 | | - /* 1110 */ 36, 345, 339, 3, 214, 8, 422, 335, 425, 437, |
| 90294 | | - /* 1120 */ 375, 148, 162, 36, 345, 339, 3, 336, 342, 432, |
| 90295 | | - /* 1130 */ 335, 425, 149, 577, 426, 162, 446, 90, 151, 339, |
| 90296 | | - /* 1140 */ 336, 342, 434, 339, 283, 433, 333, 347, 447, 446, |
| 90297 | | - /* 1150 */ 75, 588, 6, 158, 336, 448, 140, 481, 336, 426, |
| 90298 | | - /* 1160 */ 347, 453, 334, 446, 76, 49, 350, 446, 91, 7, |
| 90299 | | - /* 1170 */ 481, 426, 397, 283, 355, 250, 426, 39, 38, 251, |
| 90300 | | - /* 1180 */ 339, 426, 48, 353, 37, 337, 338, 596, 426, 452, |
| 90301 | | - /* 1190 */ 39, 38, 514, 252, 390, 336, 20, 37, 337, 338, |
| 90302 | | - /* 1200 */ 253, 43, 452, 206, 446, 92, 219, 449, 242, 243, |
| 90303 | | - /* 1210 */ 244, 150, 246, 283, 491, 593, 597, 490, 224, 258, |
| 90304 | | - /* 1220 */ 454, 454, 454, 455, 456, 10, 503, 183, 426, 178, |
| 90305 | | - /* 1230 */ 156, 301, 426, 454, 454, 454, 455, 456, 10, 339, |
| 90306 | | - /* 1240 */ 302, 426, 36, 345, 50, 3, 339, 505, 260, 335, |
| 90307 | | - /* 1250 */ 425, 262, 339, 176, 336, 581, 598, 358, 364, 175, |
| 90308 | | - /* 1260 */ 342, 336, 177, 446, 93, 46, 345, 336, 3, 339, |
| 90309 | | - /* 1270 */ 446, 94, 335, 425, 525, 339, 446, 77, 320, 347, |
| 90310 | | - /* 1280 */ 511, 339, 507, 342, 336, 589, 601, 56, 56, 481, |
| 90311 | | - /* 1290 */ 336, 512, 283, 446, 17, 531, 336, 426, 530, 446, |
| 90312 | | - /* 1300 */ 96, 534, 347, 404, 298, 446, 97, 426, 313, 39, |
| 90313 | | - /* 1310 */ 38, 267, 481, 219, 535, 536, 37, 337, 338, 283, |
| 90314 | | - /* 1320 */ 620, 452, 309, 283, 111, 19, 288, 509, 269, 424, |
| 90315 | | - /* 1330 */ 425, 539, 39, 38, 426, 238, 270, 411, 426, 37, |
| 90316 | | - /* 1340 */ 337, 338, 426, 426, 452, 558, 426, 307, 231, 276, |
| 90317 | | - /* 1350 */ 278, 426, 454, 454, 454, 455, 456, 10, 553, 280, |
| 90318 | | - /* 1360 */ 426, 559, 239, 230, 426, 426, 299, 282, 287, 481, |
| 90319 | | - /* 1370 */ 560, 388, 584, 232, 426, 454, 454, 454, 455, 456, |
| 90320 | | - /* 1380 */ 10, 561, 426, 426, 585, 395, 426, 426, 292, 194, |
| 90321 | | - /* 1390 */ 195, 592, 603, 300, 303, 308, 377, 522, 381, 426, |
| 90322 | | - /* 1400 */ 426, 452, 567, 426, 304, 617, 426, 426, 426, 426, |
| 90323 | | - /* 1410 */ 379, 53, 147, 165, 166, 167, 580, 212, 569, 426, |
| 90324 | | - /* 1420 */ 426, 285, 168, 570, 387, 120, 123, 187, 590, 402, |
| 90325 | | - /* 1430 */ 403, 125, 454, 454, 454, 330, 599, 614, 186, 126, |
| 90326 | | - /* 1440 */ 127, 128, 615, 616, 57, 60, 619, 107, 229, 64, |
| 90327 | | - /* 1450 */ 115, 420, 245, 130, 439, 180, 315, 207, 670, 316, |
| 90328 | | - /* 1460 */ 671, 467, 672, 153, 154, 35, 483, 471, 480, 188, |
| 90329 | | - /* 1470 */ 201, 155, 484, 5, 485, 489, 12, 502, 45, 11, |
| 90330 | | - /* 1480 */ 110, 145, 518, 519, 510, 228, 51, 112, 369, 273, |
| 90331 | | - /* 1490 */ 113, 159, 545, 52, 374, 114, 164, 265, 378, 190, |
| 90332 | | - /* 1500 */ 146, 568, 117, 158, 286, 382, 169, 119, 15, 583, |
| 90333 | | - /* 1510 */ 170, 171, 121, 586, 122, 54, 55, 13, 124, 591, |
| 90334 | | - /* 1520 */ 173, 174, 118, 575, 129, 595, 571, 131, 14, 132, |
| 90335 | | - /* 1530 */ 611, 63, 612, 193, 602, 179, 305, 413, 417, 960, |
| 90336 | | - /* 1540 */ 627, |
| 90400 | + /* 0 */ 312, 53, 494, 56, 143, 177, 181, 561, 44, 44, |
| 90401 | + /* 10 */ 44, 44, 224, 46, 46, 46, 46, 47, 47, 48, |
| 90402 | + /* 20 */ 48, 48, 49, 226, 511, 345, 209, 513, 501, 226, |
| 90403 | + /* 30 */ 550, 541, 54, 46, 46, 46, 46, 47, 47, 48, |
| 90404 | + /* 40 */ 48, 48, 49, 226, 48, 48, 48, 49, 226, 43, |
| 90405 | + /* 50 */ 41, 55, 539, 537, 540, 540, 45, 45, 44, 44, |
| 90406 | + /* 60 */ 44, 44, 252, 46, 46, 46, 46, 47, 47, 48, |
| 90407 | + /* 70 */ 48, 48, 49, 226, 312, 561, 321, 493, 429, 246, |
| 90408 | + /* 80 */ 60, 46, 46, 46, 46, 47, 47, 48, 48, 48, |
| 90409 | + /* 90 */ 49, 226, 613, 321, 493, 480, 477, 155, 426, 326, |
| 90410 | + /* 100 */ 369, 372, 373, 581, 550, 541, 311, 555, 155, 40, |
| 90411 | + /* 110 */ 374, 369, 372, 373, 47, 47, 48, 48, 48, 49, |
| 90412 | + /* 120 */ 226, 374, 536, 43, 41, 55, 539, 537, 540, 540, |
| 90413 | + /* 130 */ 45, 45, 44, 44, 44, 44, 301, 46, 46, 46, |
| 90414 | + /* 140 */ 46, 47, 47, 48, 48, 48, 49, 226, 312, 222, |
| 90415 | + /* 150 */ 210, 445, 431, 156, 139, 250, 366, 267, 367, 154, |
| 90416 | + /* 160 */ 509, 350, 513, 501, 561, 248, 222, 484, 513, 501, |
| 90417 | + /* 170 */ 340, 139, 250, 366, 267, 367, 154, 316, 550, 541, |
| 90418 | + /* 180 */ 609, 281, 248, 197, 565, 337, 309, 471, 428, 511, |
| 90419 | + /* 190 */ 582, 209, 556, 599, 566, 81, 493, 43, 41, 55, |
| 90420 | + /* 200 */ 539, 537, 540, 540, 45, 45, 44, 44, 44, 44, |
| 90421 | + /* 210 */ 471, 46, 46, 46, 46, 47, 47, 48, 48, 48, |
| 90422 | + /* 220 */ 49, 226, 312, 553, 553, 553, 287, 133, 517, 231, |
| 90423 | + /* 230 */ 480, 477, 561, 580, 355, 235, 480, 477, 483, 573, |
| 90424 | + /* 240 */ 340, 513, 501, 183, 591, 66, 571, 572, 493, 238, |
| 90425 | + /* 250 */ 205, 387, 550, 541, 155, 337, 390, 369, 372, 373, |
| 90426 | + /* 260 */ 959, 186, 490, 2, 566, 94, 466, 374, 195, 614, |
| 90427 | + /* 270 */ 198, 43, 41, 55, 539, 537, 540, 540, 45, 45, |
| 90428 | + /* 280 */ 44, 44, 44, 44, 565, 46, 46, 46, 46, 47, |
| 90429 | + /* 290 */ 47, 48, 48, 48, 49, 226, 312, 340, 570, 53, |
| 90430 | + /* 300 */ 618, 56, 143, 449, 565, 340, 353, 201, 141, 480, |
| 90431 | + /* 310 */ 477, 352, 337, 493, 400, 273, 200, 146, 569, 568, |
| 90432 | + /* 320 */ 337, 566, 71, 570, 224, 292, 550, 541, 361, 566, |
| 90433 | + /* 330 */ 94, 342, 483, 534, 534, 68, 360, 280, 493, 513, |
| 90434 | + /* 340 */ 501, 565, 381, 569, 410, 43, 41, 55, 539, 537, |
| 90435 | + /* 350 */ 540, 540, 45, 45, 44, 44, 44, 44, 462, 46, |
| 90436 | + /* 360 */ 46, 46, 46, 47, 47, 48, 48, 48, 49, 226, |
| 90437 | + /* 370 */ 312, 353, 468, 493, 246, 208, 363, 1, 340, 567, |
| 90438 | + /* 380 */ 230, 513, 501, 149, 333, 546, 4, 612, 617, 493, |
| 90439 | + /* 390 */ 240, 340, 112, 337, 611, 513, 501, 224, 212, 580, |
| 90440 | + /* 400 */ 550, 541, 566, 95, 409, 230, 337, 480, 477, 399, |
| 90441 | + /* 410 */ 482, 66, 471, 516, 493, 566, 94, 412, 466, 43, |
| 90442 | + /* 420 */ 41, 55, 539, 537, 540, 540, 45, 45, 44, 44, |
| 90443 | + /* 430 */ 44, 44, 565, 46, 46, 46, 46, 47, 47, 48, |
| 90444 | + /* 440 */ 48, 48, 49, 226, 312, 502, 585, 580, 329, 480, |
| 90445 | + /* 450 */ 477, 451, 513, 501, 592, 247, 332, 357, 615, 66, |
| 90446 | + /* 460 */ 150, 500, 493, 480, 477, 151, 400, 273, 53, 414, |
| 90447 | + /* 470 */ 56, 143, 215, 146, 550, 541, 224, 499, 617, 421, |
| 90448 | + /* 480 */ 317, 528, 524, 42, 282, 415, 594, 34, 476, 280, |
| 90449 | + /* 490 */ 420, 397, 203, 43, 41, 55, 539, 537, 540, 540, |
| 90450 | + /* 500 */ 45, 45, 44, 44, 44, 44, 493, 46, 46, 46, |
| 90451 | + /* 510 */ 46, 47, 47, 48, 48, 48, 49, 226, 312, 324, |
| 90452 | + /* 520 */ 480, 477, 435, 447, 439, 384, 565, 340, 284, 340, |
| 90453 | + /* 530 */ 241, 344, 528, 524, 53, 340, 56, 143, 620, 185, |
| 90454 | + /* 540 */ 461, 483, 337, 230, 337, 478, 217, 439, 550, 541, |
| 90455 | + /* 550 */ 337, 566, 95, 566, 89, 493, 596, 425, 227, 566, |
| 90456 | + /* 560 */ 81, 52, 459, 448, 440, 402, 584, 43, 41, 55, |
| 90457 | + /* 570 */ 539, 537, 540, 540, 45, 45, 44, 44, 44, 44, |
| 90458 | + /* 580 */ 565, 46, 46, 46, 46, 47, 47, 48, 48, 48, |
| 90459 | + /* 590 */ 49, 226, 312, 362, 230, 340, 259, 323, 491, 377, |
| 90460 | + /* 600 */ 234, 257, 458, 385, 398, 278, 283, 488, 337, 340, |
| 90461 | + /* 610 */ 337, 141, 340, 461, 340, 597, 493, 566, 9, 566, |
| 90462 | + /* 620 */ 96, 62, 550, 541, 337, 593, 401, 337, 493, 337, |
| 90463 | + /* 630 */ 151, 328, 157, 566, 85, 483, 566, 77, 566, 86, |
| 90464 | + /* 640 */ 874, 43, 41, 55, 539, 537, 540, 540, 45, 45, |
| 90465 | + /* 650 */ 44, 44, 44, 44, 340, 46, 46, 46, 46, 47, |
| 90466 | + /* 660 */ 47, 48, 48, 48, 49, 226, 312, 340, 444, 337, |
| 90467 | + /* 670 */ 364, 30, 443, 457, 502, 150, 327, 65, 566, 99, |
| 90468 | + /* 680 */ 340, 561, 337, 408, 324, 340, 386, 340, 248, 589, |
| 90469 | + /* 690 */ 500, 566, 137, 256, 574, 337, 550, 541, 579, 246, |
| 90470 | + /* 700 */ 337, 224, 337, 258, 566, 136, 499, 371, 349, 566, |
| 90471 | + /* 710 */ 138, 566, 101, 407, 493, 43, 41, 55, 539, 537, |
| 90472 | + /* 720 */ 540, 540, 45, 45, 44, 44, 44, 44, 340, 46, |
| 90473 | + /* 730 */ 46, 46, 46, 47, 47, 48, 48, 48, 49, 226, |
| 90474 | + /* 740 */ 312, 340, 229, 337, 340, 342, 252, 534, 534, 561, |
| 90475 | + /* 750 */ 522, 522, 566, 91, 574, 177, 337, 561, 579, 337, |
| 90476 | + /* 760 */ 340, 493, 58, 340, 38, 566, 88, 441, 566, 17, |
| 90477 | + /* 770 */ 550, 541, 508, 29, 306, 337, 452, 948, 337, 948, |
| 90478 | + /* 780 */ 629, 575, 416, 318, 566, 92, 192, 566, 73, 43, |
| 90479 | + /* 790 */ 41, 55, 539, 537, 540, 540, 45, 45, 44, 44, |
| 90480 | + /* 800 */ 44, 44, 340, 46, 46, 46, 46, 47, 47, 48, |
| 90481 | + /* 810 */ 48, 48, 49, 226, 312, 340, 246, 337, 340, 246, |
| 90482 | + /* 820 */ 270, 526, 340, 469, 299, 561, 566, 70, 202, 204, |
| 90483 | + /* 830 */ 337, 493, 507, 337, 493, 493, 340, 337, 493, 566, |
| 90484 | + /* 840 */ 90, 532, 566, 82, 550, 541, 566, 72, 557, 452, |
| 90485 | + /* 850 */ 949, 337, 949, 266, 598, 342, 150, 534, 534, 228, |
| 90486 | + /* 860 */ 566, 79, 533, 43, 41, 55, 539, 537, 540, 540, |
| 90487 | + /* 870 */ 45, 45, 44, 44, 44, 44, 340, 46, 46, 46, |
| 90488 | + /* 880 */ 46, 47, 47, 48, 48, 48, 49, 226, 312, 340, |
| 90489 | + /* 890 */ 246, 337, 340, 252, 526, 49, 226, 254, 549, 260, |
| 90490 | + /* 900 */ 566, 83, 588, 586, 337, 493, 606, 337, 493, 485, |
| 90491 | + /* 910 */ 340, 592, 392, 566, 69, 406, 566, 80, 550, 541, |
| 90492 | + /* 920 */ 342, 368, 534, 534, 253, 337, 150, 493, 604, 342, |
| 90493 | + /* 930 */ 223, 534, 534, 525, 566, 100, 285, 43, 57, 55, |
| 90494 | + /* 940 */ 539, 537, 540, 540, 45, 45, 44, 44, 44, 44, |
| 90495 | + /* 950 */ 340, 46, 46, 46, 46, 47, 47, 48, 48, 48, |
| 90496 | + /* 960 */ 49, 226, 312, 392, 246, 337, 340, 252, 575, 416, |
| 90497 | + /* 970 */ 351, 472, 276, 347, 566, 87, 279, 330, 493, 493, |
| 90498 | + /* 980 */ 496, 337, 493, 461, 340, 493, 493, 493, 548, 547, |
| 90499 | + /* 990 */ 566, 98, 550, 541, 498, 493, 172, 523, 493, 337, |
| 90500 | + /* 1000 */ 311, 577, 191, 243, 319, 423, 422, 530, 566, 105, |
| 90501 | + /* 1010 */ 544, 543, 41, 55, 539, 537, 540, 540, 45, 45, |
| 90502 | + /* 1020 */ 44, 44, 44, 44, 340, 46, 46, 46, 46, 47, |
| 90503 | + /* 1030 */ 47, 48, 48, 48, 49, 226, 312, 545, 340, 337, |
| 90504 | + /* 1040 */ 340, 246, 392, 207, 252, 445, 320, 489, 566, 103, |
| 90505 | + /* 1050 */ 627, 622, 519, 337, 232, 337, 493, 493, 340, 493, |
| 90506 | + /* 1060 */ 479, 340, 566, 108, 566, 109, 550, 541, 6, 607, |
| 90507 | + /* 1070 */ 608, 454, 2, 337, 492, 493, 337, 565, 517, 231, |
| 90508 | + /* 1080 */ 471, 322, 566, 134, 289, 566, 135, 55, 539, 537, |
| 90509 | + /* 1090 */ 540, 540, 45, 45, 44, 44, 44, 44, 487, 46, |
| 90510 | + /* 1100 */ 46, 46, 46, 47, 47, 48, 48, 48, 49, 226, |
| 90511 | + /* 1110 */ 23, 346, 340, 3, 397, 464, 422, 336, 501, 290, |
| 90512 | + /* 1120 */ 147, 214, 7, 23, 346, 340, 3, 337, 343, 493, |
| 90513 | + /* 1130 */ 336, 501, 463, 237, 172, 493, 566, 84, 475, 340, |
| 90514 | + /* 1140 */ 337, 343, 211, 340, 246, 225, 244, 348, 394, 566, |
| 90515 | + /* 1150 */ 75, 341, 18, 493, 337, 565, 393, 509, 337, 493, |
| 90516 | + /* 1160 */ 348, 493, 395, 566, 97, 245, 493, 566, 61, 274, |
| 90517 | + /* 1170 */ 509, 217, 16, 358, 189, 264, 565, 26, 25, 340, |
| 90518 | + /* 1180 */ 493, 236, 518, 310, 24, 338, 339, 304, 493, 556, |
| 90519 | + /* 1190 */ 26, 25, 450, 602, 337, 404, 120, 24, 338, 339, |
| 90520 | + /* 1200 */ 419, 169, 556, 566, 106, 565, 224, 117, 495, 27, |
| 90521 | + /* 1210 */ 346, 562, 3, 396, 187, 340, 336, 501, 179, 184, |
| 90522 | + /* 1220 */ 553, 553, 553, 552, 551, 11, 493, 343, 493, 398, |
| 90523 | + /* 1230 */ 337, 430, 8, 553, 553, 553, 552, 551, 11, 566, |
| 90524 | + /* 1240 */ 104, 335, 340, 255, 340, 616, 348, 340, 251, 331, |
| 90525 | + /* 1250 */ 340, 391, 558, 587, 50, 340, 509, 337, 493, 337, |
| 90526 | + /* 1260 */ 493, 365, 337, 493, 590, 337, 566, 78, 566, 102, |
| 90527 | + /* 1270 */ 337, 566, 76, 213, 566, 74, 26, 25, 610, 566, |
| 90528 | + /* 1280 */ 93, 378, 424, 24, 338, 339, 263, 583, 556, 220, |
| 90529 | + /* 1290 */ 140, 624, 294, 493, 300, 389, 23, 346, 376, 3, |
| 90530 | + /* 1300 */ 150, 493, 493, 336, 501, 493, 493, 493, 221, 493, |
| 90531 | + /* 1310 */ 493, 554, 268, 219, 343, 261, 515, 460, 418, 553, |
| 90532 | + /* 1320 */ 553, 553, 552, 551, 11, 595, 493, 493, 152, 206, |
| 90533 | + /* 1330 */ 493, 493, 493, 348, 272, 271, 269, 158, 302, 625, |
| 90534 | + /* 1340 */ 531, 521, 67, 509, 506, 520, 50, 628, 380, 600, |
| 90535 | + /* 1350 */ 173, 605, 123, 623, 493, 178, 37, 305, 308, 265, |
| 90536 | + /* 1360 */ 493, 620, 621, 26, 25, 165, 262, 307, 619, 166, |
| 90537 | + /* 1370 */ 24, 338, 339, 334, 436, 556, 427, 437, 33, 160, |
| 90538 | + /* 1380 */ 145, 466, 513, 501, 20, 148, 275, 122, 174, 359, |
| 90539 | + /* 1390 */ 442, 467, 486, 63, 36, 233, 42, 465, 512, 403, |
| 90540 | + /* 1400 */ 542, 182, 119, 113, 128, 132, 553, 553, 553, 552, |
| 90541 | + /* 1410 */ 551, 11, 39, 288, 538, 455, 291, 563, 388, 354, |
| 90542 | + /* 1420 */ 293, 295, 509, 31, 453, 356, 296, 325, 159, 405, |
| 90543 | + /* 1430 */ 286, 297, 564, 153, 313, 382, 35, 129, 303, 224, |
| 90544 | + /* 1440 */ 218, 121, 194, 196, 433, 107, 559, 242, 601, 216, |
| 90545 | + /* 1450 */ 428, 670, 280, 671, 556, 672, 162, 163, 32, 535, |
| 90546 | + /* 1460 */ 59, 505, 529, 411, 510, 190, 199, 176, 167, 504, |
| 90547 | + /* 1470 */ 503, 497, 5, 315, 314, 13, 19, 12, 474, 131, |
| 90548 | + /* 1480 */ 456, 144, 434, 432, 168, 553, 553, 553, 239, 51, |
| 90549 | + /* 1490 */ 603, 118, 111, 142, 249, 21, 124, 164, 379, 258, |
| 90550 | + /* 1500 */ 626, 188, 126, 172, 298, 383, 161, 370, 375, 114, |
| 90551 | + /* 1510 */ 15, 470, 481, 180, 125, 115, 127, 438, 446, 10, |
| 90552 | + /* 1520 */ 514, 110, 171, 527, 170, 116, 130, 560, 64, 14, |
| 90553 | + /* 1530 */ 175, 576, 578, 413, 277, 193, 417, 960, 473, 960, |
| 90554 | + /* 1540 */ 28, 960, 22, |
| 90337 | 90555 | }; |
| 90338 | 90556 | static const YYCODETYPE yy_lookahead[] = { |
| 90339 | | - /* 0 */ 19, 142, 143, 144, 145, 24, 115, 26, 77, 78, |
| 90340 | | - /* 10 */ 79, 80, 92, 82, 83, 84, 85, 86, 87, 88, |
| 90341 | | - /* 20 */ 89, 90, 91, 92, 26, 27, 222, 223, 224, 225, |
| 90557 | + /* 0 */ 19, 222, 223, 224, 225, 24, 35, 26, 77, 78, |
| 90558 | + /* 10 */ 79, 80, 115, 82, 83, 84, 85, 86, 87, 88, |
| 90559 | + /* 20 */ 89, 90, 91, 92, 166, 167, 168, 26, 27, 92, |
| 90342 | 90560 | /* 30 */ 49, 50, 81, 82, 83, 84, 85, 86, 87, 88, |
| 90343 | 90561 | /* 40 */ 89, 90, 91, 92, 88, 89, 90, 91, 92, 68, |
| 90344 | 90562 | /* 50 */ 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, |
| 90345 | | - /* 60 */ 79, 80, 16, 82, 83, 84, 85, 86, 87, 88, |
| 90346 | | - /* 70 */ 89, 90, 91, 92, 19, 94, 19, 166, 167, 168, |
| 90563 | + /* 60 */ 79, 80, 150, 82, 83, 84, 85, 86, 87, 88, |
| 90564 | + /* 70 */ 89, 90, 91, 92, 19, 94, 19, 165, 174, 150, |
| 90347 | 90565 | /* 80 */ 25, 82, 83, 84, 85, 86, 87, 88, 89, 90, |
| 90348 | | - /* 90 */ 91, 92, 94, 95, 96, 150, 36, 99, 100, 101, |
| 90349 | | - /* 100 */ 174, 169, 170, 171, 49, 50, 60, 109, 62, 54, |
| 90350 | | - /* 110 */ 165, 51, 1, 2, 26, 27, 174, 22, 58, 174, |
| 90351 | | - /* 120 */ 175, 26, 27, 68, 69, 70, 71, 72, 73, 74, |
| 90352 | | - /* 130 */ 75, 76, 77, 78, 79, 80, 186, 82, 83, 84, |
| 90566 | + /* 90 */ 91, 92, 186, 19, 165, 94, 95, 96, 174, 187, |
| 90567 | + /* 100 */ 99, 100, 101, 186, 49, 50, 22, 23, 96, 54, |
| 90568 | + /* 110 */ 109, 99, 100, 101, 86, 87, 88, 89, 90, 91, |
| 90569 | + /* 120 */ 92, 109, 193, 68, 69, 70, 71, 72, 73, 74, |
| 90570 | + /* 130 */ 75, 76, 77, 78, 79, 80, 195, 82, 83, 84, |
| 90353 | 90571 | /* 140 */ 85, 86, 87, 88, 89, 90, 91, 92, 19, 92, |
| 90354 | | - /* 150 */ 19, 172, 173, 96, 97, 98, 99, 100, 101, 102, |
| 90355 | | - /* 160 */ 181, 216, 146, 147, 232, 108, 221, 107, 152, 186, |
| 90356 | | - /* 170 */ 154, 150, 195, 30, 86, 87, 160, 34, 49, 50, |
| 90357 | | - /* 180 */ 26, 52, 94, 95, 138, 97, 165, 181, 182, 94, |
| 90358 | | - /* 190 */ 95, 48, 104, 105, 188, 174, 175, 68, 69, 70, |
| 90572 | + /* 150 */ 160, 67, 23, 96, 97, 98, 99, 100, 101, 102, |
| 90573 | + /* 160 */ 66, 191, 26, 27, 26, 108, 92, 208, 26, 27, |
| 90574 | + /* 170 */ 150, 97, 98, 99, 100, 101, 102, 155, 49, 50, |
| 90575 | + /* 180 */ 183, 150, 108, 25, 194, 165, 163, 166, 94, 166, |
| 90576 | + /* 190 */ 167, 168, 98, 183, 174, 175, 165, 68, 69, 70, |
| 90359 | 90577 | /* 200 */ 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, |
| 90360 | | - /* 210 */ 194, 82, 83, 84, 85, 86, 87, 88, 89, 90, |
| 90361 | | - /* 220 */ 91, 92, 19, 92, 86, 87, 21, 24, 97, 98, |
| 90362 | | - /* 230 */ 99, 100, 101, 102, 218, 214, 215, 208, 66, 108, |
| 90363 | | - /* 240 */ 150, 86, 87, 88, 89, 90, 91, 92, 94, 173, |
| 90364 | | - /* 250 */ 160, 183, 49, 50, 191, 165, 96, 181, 22, 99, |
| 90365 | | - /* 260 */ 100, 101, 26, 247, 174, 175, 94, 57, 63, 109, |
| 90366 | | - /* 270 */ 98, 68, 69, 70, 71, 72, 73, 74, 75, 76, |
| 90578 | + /* 210 */ 166, 82, 83, 84, 85, 86, 87, 88, 89, 90, |
| 90579 | + /* 220 */ 91, 92, 19, 129, 130, 131, 205, 24, 86, 87, |
| 90580 | + /* 230 */ 94, 95, 94, 150, 214, 215, 94, 95, 25, 97, |
| 90581 | + /* 240 */ 150, 26, 27, 23, 161, 162, 104, 105, 165, 205, |
| 90582 | + /* 250 */ 160, 229, 49, 50, 96, 165, 234, 99, 100, 101, |
| 90583 | + /* 260 */ 142, 143, 144, 145, 174, 175, 57, 109, 185, 186, |
| 90584 | + /* 270 */ 160, 68, 69, 70, 71, 72, 73, 74, 75, 76, |
| 90367 | 90585 | /* 280 */ 77, 78, 79, 80, 194, 82, 83, 84, 85, 86, |
| 90368 | | - /* 290 */ 87, 88, 89, 90, 91, 92, 19, 150, 150, 150, |
| 90369 | | - /* 300 */ 25, 129, 130, 131, 183, 100, 216, 160, 150, 161, |
| 90370 | | - /* 310 */ 162, 221, 165, 165, 165, 105, 106, 26, 27, 170, |
| 90371 | | - /* 320 */ 171, 174, 175, 165, 160, 115, 49, 50, 170, 171, |
| 90372 | | - /* 330 */ 94, 148, 163, 185, 186, 166, 167, 168, 128, 91, |
| 90373 | | - /* 340 */ 92, 194, 196, 138, 166, 68, 69, 70, 71, 72, |
| 90374 | | - /* 350 */ 73, 74, 75, 76, 77, 78, 79, 80, 194, 82, |
| 90586 | + /* 290 */ 87, 88, 89, 90, 91, 92, 19, 150, 150, 222, |
| 90587 | + /* 300 */ 23, 224, 225, 88, 194, 150, 216, 160, 95, 94, |
| 90588 | + /* 310 */ 95, 221, 165, 165, 105, 106, 206, 207, 170, 171, |
| 90589 | + /* 320 */ 165, 174, 175, 150, 115, 148, 49, 50, 19, 174, |
| 90590 | + /* 330 */ 175, 111, 119, 113, 114, 22, 27, 128, 165, 26, |
| 90591 | + /* 340 */ 27, 194, 237, 170, 171, 68, 69, 70, 71, 72, |
| 90592 | + /* 350 */ 73, 74, 75, 76, 77, 78, 79, 80, 150, 82, |
| 90375 | 90593 | /* 360 */ 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, |
| 90376 | | - /* 370 */ 19, 96, 11, 150, 99, 100, 101, 155, 26, 27, |
| 90377 | | - /* 380 */ 231, 232, 218, 205, 109, 94, 95, 150, 165, 231, |
| 90378 | | - /* 390 */ 232, 166, 150, 222, 150, 224, 225, 174, 175, 235, |
| 90379 | | - /* 400 */ 49, 50, 165, 24, 240, 26, 166, 165, 153, 165, |
| 90380 | | - /* 410 */ 119, 174, 175, 136, 237, 244, 174, 175, 57, 68, |
| 90594 | + /* 370 */ 19, 216, 11, 165, 150, 236, 221, 22, 150, 231, |
| 90595 | + /* 380 */ 232, 26, 27, 25, 146, 147, 196, 181, 182, 165, |
| 90596 | + /* 390 */ 152, 150, 154, 165, 188, 26, 27, 115, 160, 150, |
| 90597 | + /* 400 */ 49, 50, 174, 175, 231, 232, 165, 94, 95, 127, |
| 90598 | + /* 410 */ 161, 162, 166, 166, 165, 174, 175, 193, 57, 68, |
| 90381 | 90599 | /* 420 */ 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, |
| 90382 | | - /* 430 */ 79, 80, 236, 82, 83, 84, 85, 86, 87, 88, |
| 90383 | | - /* 440 */ 89, 90, 91, 92, 19, 205, 94, 95, 23, 226, |
| 90384 | | - /* 450 */ 165, 229, 215, 150, 12, 88, 234, 150, 216, 174, |
| 90385 | | - /* 460 */ 32, 217, 222, 25, 224, 225, 105, 106, 165, 41, |
| 90386 | | - /* 470 */ 28, 119, 165, 94, 49, 50, 115, 174, 175, 112, |
| 90387 | | - /* 480 */ 22, 174, 175, 116, 26, 27, 44, 136, 46, 128, |
| 90388 | | - /* 490 */ 166, 26, 27, 68, 69, 70, 71, 72, 73, 74, |
| 90389 | | - /* 500 */ 75, 76, 77, 78, 79, 80, 150, 82, 83, 84, |
| 90390 | | - /* 510 */ 85, 86, 87, 88, 89, 90, 91, 92, 19, 150, |
| 90391 | | - /* 520 */ 150, 165, 23, 220, 196, 150, 150, 220, 158, 205, |
| 90392 | | - /* 530 */ 150, 161, 162, 198, 165, 165, 26, 27, 112, 23, |
| 90393 | | - /* 540 */ 165, 165, 116, 174, 175, 165, 150, 166, 49, 50, |
| 90394 | | - /* 550 */ 174, 175, 94, 95, 174, 175, 118, 161, 162, 94, |
| 90395 | | - /* 560 */ 95, 165, 187, 16, 22, 160, 24, 68, 69, 70, |
| 90600 | + /* 430 */ 79, 80, 194, 82, 83, 84, 85, 86, 87, 88, |
| 90601 | + /* 440 */ 89, 90, 91, 92, 19, 12, 173, 150, 220, 94, |
| 90602 | + /* 450 */ 95, 205, 26, 27, 181, 158, 218, 216, 161, 162, |
| 90603 | + /* 460 */ 25, 28, 165, 94, 95, 50, 105, 106, 222, 245, |
| 90604 | + /* 470 */ 224, 225, 206, 207, 49, 50, 115, 44, 182, 46, |
| 90605 | + /* 480 */ 169, 170, 171, 125, 16, 247, 166, 136, 119, 128, |
| 90606 | + /* 490 */ 57, 150, 160, 68, 69, 70, 71, 72, 73, 74, |
| 90607 | + /* 500 */ 75, 76, 77, 78, 79, 80, 165, 82, 83, 84, |
| 90608 | + /* 510 */ 85, 86, 87, 88, 89, 90, 91, 92, 19, 104, |
| 90609 | + /* 520 */ 94, 95, 23, 21, 105, 106, 194, 150, 60, 150, |
| 90610 | + /* 530 */ 62, 169, 170, 171, 222, 150, 224, 225, 103, 23, |
| 90611 | + /* 540 */ 150, 25, 165, 232, 165, 119, 160, 128, 49, 50, |
| 90612 | + /* 550 */ 165, 174, 175, 174, 175, 165, 244, 165, 217, 174, |
| 90613 | + /* 560 */ 175, 136, 7, 8, 9, 63, 174, 68, 69, 70, |
| 90396 | 90614 | /* 570 */ 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, |
| 90397 | | - /* 580 */ 150, 82, 83, 84, 85, 86, 87, 88, 89, 90, |
| 90398 | | - /* 590 */ 91, 92, 19, 150, 12, 165, 23, 241, 88, 194, |
| 90399 | | - /* 600 */ 150, 0, 1, 2, 94, 95, 160, 60, 165, 62, |
| 90400 | | - /* 610 */ 28, 206, 207, 190, 191, 165, 150, 174, 175, 7, |
| 90401 | | - /* 620 */ 8, 9, 49, 50, 174, 175, 44, 111, 46, 113, |
| 90402 | | - /* 630 */ 114, 165, 169, 170, 171, 22, 23, 233, 25, 57, |
| 90403 | | - /* 640 */ 194, 68, 69, 70, 71, 72, 73, 74, 75, 76, |
| 90615 | + /* 580 */ 194, 82, 83, 84, 85, 86, 87, 88, 89, 90, |
| 90616 | + /* 590 */ 91, 92, 19, 150, 232, 150, 23, 220, 32, 19, |
| 90617 | + /* 600 */ 215, 150, 100, 213, 218, 226, 138, 41, 165, 150, |
| 90618 | + /* 610 */ 165, 95, 150, 150, 150, 177, 165, 174, 175, 174, |
| 90619 | + /* 620 */ 175, 235, 49, 50, 165, 177, 240, 165, 165, 165, |
| 90620 | + /* 630 */ 50, 248, 249, 174, 175, 119, 174, 175, 174, 175, |
| 90621 | + /* 640 */ 138, 68, 69, 70, 71, 72, 73, 74, 75, 76, |
| 90404 | 90622 | /* 650 */ 77, 78, 79, 80, 150, 82, 83, 84, 85, 86, |
| 90405 | | - /* 660 */ 87, 88, 89, 90, 91, 92, 19, 150, 25, 165, |
| 90406 | | - /* 670 */ 23, 150, 233, 19, 150, 190, 191, 228, 174, 175, |
| 90407 | | - /* 680 */ 67, 222, 165, 224, 225, 150, 165, 150, 150, 165, |
| 90408 | | - /* 690 */ 23, 174, 175, 144, 145, 232, 49, 50, 174, 175, |
| 90409 | | - /* 700 */ 165, 115, 165, 165, 50, 22, 23, 241, 25, 174, |
| 90410 | | - /* 710 */ 175, 174, 175, 127, 193, 68, 69, 70, 71, 72, |
| 90623 | + /* 660 */ 87, 88, 89, 90, 91, 92, 19, 150, 30, 165, |
| 90624 | + /* 670 */ 88, 24, 34, 23, 12, 25, 213, 22, 174, 175, |
| 90625 | + /* 680 */ 150, 26, 165, 97, 104, 150, 48, 150, 108, 166, |
| 90626 | + /* 690 */ 28, 174, 175, 98, 112, 165, 49, 50, 116, 150, |
| 90627 | + /* 700 */ 165, 115, 165, 108, 174, 175, 44, 178, 46, 174, |
| 90628 | + /* 710 */ 175, 174, 175, 127, 165, 68, 69, 70, 71, 72, |
| 90411 | 90629 | /* 720 */ 73, 74, 75, 76, 77, 78, 79, 80, 150, 82, |
| 90412 | 90630 | /* 730 */ 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, |
| 90413 | | - /* 740 */ 19, 150, 150, 165, 150, 24, 103, 23, 150, 150, |
| 90414 | | - /* 750 */ 67, 213, 174, 175, 97, 209, 165, 165, 104, 165, |
| 90415 | | - /* 760 */ 150, 150, 108, 165, 165, 174, 175, 23, 174, 175, |
| 90416 | | - /* 770 */ 49, 50, 115, 174, 175, 165, 165, 177, 111, 187, |
| 90417 | | - /* 780 */ 113, 114, 250, 251, 127, 174, 175, 206, 207, 68, |
| 90631 | + /* 740 */ 19, 150, 193, 165, 150, 111, 150, 113, 114, 94, |
| 90632 | + /* 750 */ 129, 130, 174, 175, 112, 24, 165, 26, 116, 165, |
| 90633 | + /* 760 */ 150, 165, 135, 150, 137, 174, 175, 23, 174, 175, |
| 90634 | + /* 770 */ 49, 50, 23, 52, 25, 165, 22, 23, 165, 25, |
| 90635 | + /* 780 */ 0, 1, 2, 187, 174, 175, 196, 174, 175, 68, |
| 90418 | 90636 | /* 790 */ 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, |
| 90419 | 90637 | /* 800 */ 79, 80, 150, 82, 83, 84, 85, 86, 87, 88, |
| 90420 | | - /* 810 */ 89, 90, 91, 92, 19, 150, 150, 165, 150, 111, |
| 90421 | | - /* 820 */ 182, 113, 114, 105, 106, 177, 174, 175, 25, 166, |
| 90422 | | - /* 830 */ 165, 165, 150, 165, 150, 111, 150, 113, 114, 174, |
| 90423 | | - /* 840 */ 175, 150, 174, 175, 49, 50, 128, 165, 135, 165, |
| 90424 | | - /* 850 */ 137, 165, 197, 187, 166, 111, 165, 113, 114, 204, |
| 90425 | | - /* 860 */ 174, 175, 177, 68, 69, 70, 71, 72, 73, 74, |
| 90638 | + /* 810 */ 89, 90, 91, 92, 19, 150, 150, 165, 150, 150, |
| 90639 | + /* 820 */ 150, 67, 150, 150, 198, 94, 174, 175, 105, 106, |
| 90640 | + /* 830 */ 165, 165, 23, 165, 165, 165, 150, 165, 165, 174, |
| 90641 | + /* 840 */ 175, 23, 174, 175, 49, 50, 174, 175, 166, 22, |
| 90642 | + /* 850 */ 23, 165, 25, 16, 23, 111, 25, 113, 114, 193, |
| 90643 | + /* 860 */ 174, 175, 193, 68, 69, 70, 71, 72, 73, 74, |
| 90426 | 90644 | /* 870 */ 75, 76, 77, 78, 79, 80, 150, 82, 83, 84, |
| 90427 | 90645 | /* 880 */ 85, 86, 87, 88, 89, 90, 91, 92, 19, 150, |
| 90428 | | - /* 890 */ 150, 165, 150, 205, 177, 213, 150, 213, 95, 177, |
| 90429 | | - /* 900 */ 174, 175, 129, 130, 165, 165, 23, 165, 25, 150, |
| 90430 | | - /* 910 */ 150, 165, 178, 174, 175, 150, 174, 175, 49, 50, |
| 90431 | | - /* 920 */ 174, 175, 119, 19, 165, 165, 50, 22, 23, 160, |
| 90432 | | - /* 930 */ 165, 27, 241, 193, 174, 175, 160, 68, 69, 70, |
| 90646 | + /* 890 */ 150, 165, 150, 150, 67, 91, 92, 60, 199, 62, |
| 90647 | + /* 900 */ 174, 175, 172, 173, 165, 165, 36, 165, 165, 25, |
| 90648 | + /* 910 */ 150, 181, 150, 174, 175, 209, 174, 175, 49, 50, |
| 90649 | + /* 920 */ 111, 51, 113, 114, 23, 165, 25, 165, 58, 111, |
| 90650 | + /* 930 */ 187, 113, 114, 193, 174, 175, 209, 68, 69, 70, |
| 90433 | 90651 | /* 940 */ 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, |
| 90434 | 90652 | /* 950 */ 150, 82, 83, 84, 85, 86, 87, 88, 89, 90, |
| 90435 | | - /* 960 */ 91, 92, 19, 194, 150, 165, 150, 150, 150, 160, |
| 90436 | | - /* 970 */ 194, 25, 67, 160, 174, 175, 217, 166, 95, 165, |
| 90437 | | - /* 980 */ 104, 165, 165, 165, 150, 245, 248, 249, 49, 50, |
| 90438 | | - /* 990 */ 174, 175, 49, 50, 23, 23, 25, 25, 242, 165, |
| 90439 | | - /* 1000 */ 199, 187, 119, 194, 187, 22, 23, 194, 174, 175, |
| 90653 | + /* 960 */ 91, 92, 19, 150, 150, 165, 150, 150, 1, 2, |
| 90654 | + /* 970 */ 150, 150, 150, 228, 174, 175, 242, 107, 165, 165, |
| 90655 | + /* 980 */ 150, 165, 165, 150, 150, 165, 165, 165, 49, 50, |
| 90656 | + /* 990 */ 174, 175, 49, 50, 23, 165, 25, 233, 165, 165, |
| 90657 | + /* 1000 */ 22, 23, 118, 241, 187, 190, 191, 193, 174, 175, |
| 90440 | 90658 | /* 1010 */ 71, 72, 69, 70, 71, 72, 73, 74, 75, 76, |
| 90441 | 90659 | /* 1020 */ 77, 78, 79, 80, 150, 82, 83, 84, 85, 86, |
| 90442 | 90660 | /* 1030 */ 87, 88, 89, 90, 91, 92, 19, 98, 150, 165, |
| 90443 | | - /* 1040 */ 150, 150, 150, 19, 7, 8, 105, 106, 174, 175, |
| 90444 | | - /* 1050 */ 67, 27, 23, 165, 25, 165, 165, 165, 150, 150, |
| 90445 | | - /* 1060 */ 150, 150, 174, 175, 174, 175, 49, 50, 98, 242, |
| 90446 | | - /* 1070 */ 23, 125, 25, 165, 165, 165, 165, 209, 108, 97, |
| 90447 | | - /* 1080 */ 98, 209, 174, 175, 193, 174, 175, 70, 71, 72, |
| 90448 | | - /* 1090 */ 73, 74, 75, 76, 77, 78, 79, 80, 199, 82, |
| 90661 | + /* 1040 */ 150, 150, 150, 160, 150, 67, 213, 199, 174, 175, |
| 90662 | + /* 1050 */ 7, 8, 233, 165, 241, 165, 165, 165, 150, 165, |
| 90663 | + /* 1060 */ 150, 150, 174, 175, 174, 175, 49, 50, 22, 97, |
| 90664 | + /* 1070 */ 98, 144, 145, 165, 177, 165, 165, 194, 86, 87, |
| 90665 | + /* 1080 */ 166, 187, 174, 175, 193, 174, 175, 70, 71, 72, |
| 90666 | + /* 1090 */ 73, 74, 75, 76, 77, 78, 79, 80, 177, 82, |
| 90449 | 90667 | /* 1100 */ 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, |
| 90450 | | - /* 1110 */ 19, 20, 150, 22, 160, 22, 149, 26, 27, 150, |
| 90451 | | - /* 1120 */ 23, 6, 25, 19, 20, 150, 22, 165, 37, 149, |
| 90452 | | - /* 1130 */ 26, 27, 151, 23, 165, 25, 174, 175, 151, 150, |
| 90453 | | - /* 1140 */ 165, 37, 13, 150, 150, 149, 149, 56, 194, 174, |
| 90454 | | - /* 1150 */ 175, 23, 25, 25, 165, 194, 150, 66, 165, 165, |
| 90455 | | - /* 1160 */ 56, 150, 159, 174, 175, 125, 150, 174, 175, 76, |
| 90456 | | - /* 1170 */ 66, 165, 218, 150, 122, 199, 165, 86, 87, 200, |
| 90457 | | - /* 1180 */ 150, 165, 123, 121, 93, 94, 95, 193, 165, 98, |
| 90458 | | - /* 1190 */ 86, 87, 88, 201, 240, 165, 124, 93, 94, 95, |
| 90459 | | - /* 1200 */ 202, 135, 98, 5, 174, 175, 115, 203, 10, 11, |
| 90460 | | - /* 1210 */ 12, 13, 14, 150, 157, 17, 193, 150, 227, 210, |
| 90461 | | - /* 1220 */ 129, 130, 131, 132, 133, 134, 150, 157, 165, 31, |
| 90462 | | - /* 1230 */ 117, 33, 165, 129, 130, 131, 132, 133, 134, 150, |
| 90463 | | - /* 1240 */ 42, 165, 19, 20, 104, 22, 150, 211, 210, 26, |
| 90464 | | - /* 1250 */ 27, 210, 150, 55, 165, 57, 193, 120, 104, 61, |
| 90465 | | - /* 1260 */ 37, 165, 64, 174, 175, 19, 20, 165, 22, 150, |
| 90466 | | - /* 1270 */ 174, 175, 26, 27, 176, 150, 174, 175, 47, 56, |
| 90467 | | - /* 1280 */ 211, 150, 150, 37, 165, 23, 23, 25, 25, 66, |
| 90468 | | - /* 1290 */ 165, 211, 150, 174, 175, 184, 165, 165, 176, 174, |
| 90469 | | - /* 1300 */ 175, 178, 56, 105, 106, 174, 175, 165, 110, 86, |
| 90470 | | - /* 1310 */ 87, 176, 66, 115, 103, 176, 93, 94, 95, 150, |
| 90471 | | - /* 1320 */ 23, 98, 25, 150, 22, 22, 128, 150, 150, 26, |
| 90472 | | - /* 1330 */ 27, 150, 86, 87, 165, 193, 150, 139, 165, 93, |
| 90473 | | - /* 1340 */ 94, 95, 165, 165, 98, 150, 165, 179, 92, 150, |
| 90474 | | - /* 1350 */ 150, 165, 129, 130, 131, 132, 133, 134, 184, 150, |
| 90475 | | - /* 1360 */ 165, 176, 193, 230, 165, 165, 193, 150, 150, 66, |
| 90476 | | - /* 1370 */ 176, 150, 150, 230, 165, 129, 130, 131, 132, 133, |
| 90477 | | - /* 1380 */ 134, 176, 165, 165, 150, 150, 165, 165, 150, 86, |
| 90478 | | - /* 1390 */ 87, 150, 150, 150, 150, 179, 18, 94, 45, 165, |
| 90479 | | - /* 1400 */ 165, 98, 157, 165, 150, 150, 165, 165, 165, 165, |
| 90480 | | - /* 1410 */ 157, 135, 68, 156, 156, 156, 189, 157, 157, 165, |
| 90481 | | - /* 1420 */ 165, 238, 156, 239, 157, 189, 22, 219, 199, 157, |
| 90482 | | - /* 1430 */ 18, 192, 129, 130, 131, 157, 199, 40, 219, 192, |
| 90483 | | - /* 1440 */ 192, 192, 157, 157, 243, 243, 38, 164, 180, 246, |
| 90484 | | - /* 1450 */ 180, 1, 15, 189, 23, 249, 252, 22, 117, 252, |
| 90485 | | - /* 1460 */ 117, 112, 117, 117, 117, 22, 11, 23, 23, 22, |
| 90486 | | - /* 1470 */ 22, 25, 23, 35, 23, 23, 35, 119, 25, 25, |
| 90487 | | - /* 1480 */ 22, 117, 23, 23, 27, 52, 22, 22, 52, 23, |
| 90488 | | - /* 1490 */ 22, 35, 29, 22, 52, 22, 102, 108, 19, 24, |
| 90489 | | - /* 1500 */ 39, 20, 104, 25, 138, 43, 104, 22, 5, 1, |
| 90490 | | - /* 1510 */ 117, 35, 107, 27, 126, 76, 76, 22, 118, 1, |
| 90491 | | - /* 1520 */ 16, 120, 53, 53, 118, 20, 59, 107, 22, 126, |
| 90492 | | - /* 1530 */ 23, 16, 23, 22, 127, 15, 140, 65, 3, 253, |
| 90493 | | - /* 1540 */ 4, |
| 90668 | + /* 1110 */ 19, 20, 150, 22, 150, 190, 191, 26, 27, 205, |
| 90669 | + /* 1120 */ 150, 160, 76, 19, 20, 150, 22, 165, 37, 165, |
| 90670 | + /* 1130 */ 26, 27, 23, 241, 25, 165, 174, 175, 150, 150, |
| 90671 | + /* 1140 */ 165, 37, 160, 150, 150, 197, 150, 56, 19, 174, |
| 90672 | + /* 1150 */ 175, 150, 204, 165, 165, 194, 27, 66, 165, 165, |
| 90673 | + /* 1160 */ 56, 165, 242, 174, 175, 150, 165, 174, 175, 209, |
| 90674 | + /* 1170 */ 66, 160, 22, 150, 24, 177, 194, 86, 87, 150, |
| 90675 | + /* 1180 */ 165, 217, 250, 251, 93, 94, 95, 193, 165, 98, |
| 90676 | + /* 1190 */ 86, 87, 88, 153, 165, 18, 192, 93, 94, 95, |
| 90677 | + /* 1200 */ 13, 151, 98, 174, 175, 194, 115, 22, 157, 19, |
| 90678 | + /* 1210 */ 20, 150, 22, 150, 219, 150, 26, 27, 117, 157, |
| 90679 | + /* 1220 */ 129, 130, 131, 132, 133, 134, 165, 37, 165, 218, |
| 90680 | + /* 1230 */ 165, 157, 25, 129, 130, 131, 132, 133, 134, 174, |
| 90681 | + /* 1240 */ 175, 159, 150, 150, 150, 150, 56, 150, 150, 47, |
| 90682 | + /* 1250 */ 150, 240, 23, 184, 25, 150, 66, 165, 165, 165, |
| 90683 | + /* 1260 */ 165, 104, 165, 165, 176, 165, 174, 175, 174, 175, |
| 90684 | + /* 1270 */ 165, 174, 175, 157, 174, 175, 86, 87, 150, 174, |
| 90685 | + /* 1280 */ 175, 18, 176, 93, 94, 95, 150, 150, 98, 92, |
| 90686 | + /* 1290 */ 150, 150, 150, 165, 150, 150, 19, 20, 23, 22, |
| 90687 | + /* 1300 */ 25, 165, 165, 26, 27, 165, 165, 165, 230, 165, |
| 90688 | + /* 1310 */ 165, 150, 150, 230, 37, 150, 150, 150, 184, 129, |
| 90689 | + /* 1320 */ 130, 131, 132, 133, 134, 176, 165, 165, 156, 5, |
| 90690 | + /* 1330 */ 165, 165, 165, 56, 10, 11, 12, 13, 14, 150, |
| 90691 | + /* 1340 */ 23, 17, 25, 66, 23, 150, 25, 176, 157, 176, |
| 90692 | + /* 1350 */ 156, 40, 22, 157, 165, 31, 243, 33, 179, 176, |
| 90693 | + /* 1360 */ 165, 103, 178, 86, 87, 156, 42, 179, 176, 6, |
| 90694 | + /* 1370 */ 93, 94, 95, 149, 157, 98, 149, 149, 22, 55, |
| 90695 | + /* 1380 */ 68, 57, 26, 27, 104, 61, 210, 189, 64, 120, |
| 90696 | + /* 1390 */ 157, 211, 38, 246, 135, 227, 125, 189, 199, 157, |
| 90697 | + /* 1400 */ 199, 219, 192, 192, 192, 189, 129, 130, 131, 132, |
| 90698 | + /* 1410 */ 133, 134, 124, 210, 149, 211, 210, 203, 157, 121, |
| 90699 | + /* 1420 */ 202, 201, 66, 123, 211, 122, 200, 157, 156, 105, |
| 90700 | + /* 1430 */ 106, 199, 194, 151, 110, 45, 135, 180, 238, 115, |
| 90701 | + /* 1440 */ 180, 126, 86, 87, 239, 164, 1, 15, 23, 22, |
| 90702 | + /* 1450 */ 94, 117, 128, 117, 98, 117, 117, 117, 243, 112, |
| 90703 | + /* 1460 */ 22, 11, 23, 139, 23, 22, 22, 25, 249, 23, |
| 90704 | + /* 1470 */ 23, 23, 35, 252, 252, 35, 25, 25, 119, 22, |
| 90705 | + /* 1480 */ 27, 117, 23, 23, 35, 129, 130, 131, 52, 22, |
| 90706 | + /* 1490 */ 29, 22, 22, 39, 23, 22, 22, 102, 19, 108, |
| 90707 | + /* 1500 */ 20, 24, 104, 25, 138, 43, 104, 52, 52, 22, |
| 90708 | + /* 1510 */ 5, 1, 27, 117, 107, 126, 53, 59, 53, 22, |
| 90709 | + /* 1520 */ 1, 118, 16, 20, 120, 107, 118, 127, 16, 22, |
| 90710 | + /* 1530 */ 15, 23, 23, 65, 140, 22, 3, 253, 4, 253, |
| 90711 | + /* 1540 */ 76, 253, 76, |
| 90494 | 90712 | }; |
| 90495 | | -#define YY_SHIFT_USE_DFLT (-110) |
| 90713 | +#define YY_SHIFT_USE_DFLT (-104) |
| 90496 | 90714 | #define YY_SHIFT_MAX 417 |
| 90497 | 90715 | static const short yy_shift_ofst[] = { |
| 90498 | | - /* 0 */ 111, 1091, 1198, 1091, 1223, 1223, -2, 88, 88, -19, |
| 90499 | | - /* 10 */ 1223, 1223, 1223, 1223, 1223, 210, 465, 129, 1104, 1223, |
| 90500 | | - /* 20 */ 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223, |
| 90501 | | - /* 30 */ 1223, 1223, 1246, 1223, 1223, 1223, 1223, 1223, 1223, 1223, |
| 90502 | | - /* 40 */ 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223, |
| 90503 | | - /* 50 */ 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223, |
| 90504 | | - /* 60 */ 1223, -49, 361, 465, 465, 154, 138, 138, -109, 55, |
| 90505 | | - /* 70 */ 203, 277, 351, 425, 499, 573, 647, 721, 795, 869, |
| 90716 | + /* 0 */ 967, 1091, 1324, 1091, 1277, 1277, 142, 142, 1, -19, |
| 90717 | + /* 10 */ 1277, 1277, 1277, 1277, 1277, 209, 136, 721, 1104, 1277, |
| 90718 | + /* 20 */ 1277, 1277, 1277, 1277, 1277, 1277, 1277, 1277, 1277, 1277, |
| 90719 | + /* 30 */ 1277, 1277, 1277, 1277, 1277, 1277, 1277, 1277, 1277, 1277, |
| 90720 | + /* 40 */ 1277, 1277, 1277, 1277, 1277, 1277, 1277, 1277, 1277, 1277, |
| 90721 | + /* 50 */ 1277, 1277, 1277, 1277, 1277, 1190, 1277, 1277, 1277, 1277, |
| 90722 | + /* 60 */ 1277, -49, 361, 136, 136, 992, 138, 992, -103, 55, |
| 90723 | + /* 70 */ 129, 499, 351, 647, 203, 277, 425, 573, 869, 795, |
| 90506 | 90724 | /* 80 */ 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, |
| 90507 | 90725 | /* 90 */ 795, 795, 795, 795, 795, 795, 795, 795, 943, 1017, |
| 90508 | | - /* 100 */ 1017, -69, -69, -69, -69, -1, -1, 57, 155, -44, |
| 90509 | | - /* 110 */ 465, 465, 465, 465, 465, 654, 205, 465, 465, 465, |
| 90510 | | - /* 120 */ 465, 465, 465, 465, 465, 465, 465, 465, 465, 465, |
| 90511 | | - /* 130 */ 465, 465, 465, 248, 154, -80, -110, -110, -110, 1303, |
| 90512 | | - /* 140 */ 131, 95, 291, 352, 458, 510, 582, 582, 465, 465, |
| 90513 | | - /* 150 */ 465, 465, 465, 465, 465, 465, 465, 465, 465, 465, |
| 90514 | | - /* 160 */ 465, 465, 465, 465, 465, 465, 465, 465, 465, 465, |
| 90515 | | - /* 170 */ 465, 465, 465, 465, 465, 465, 465, 465, 465, 465, |
| 90516 | | - /* 180 */ 613, 683, 601, 379, 379, 379, 657, 586, -109, -109, |
| 90517 | | - /* 190 */ -109, -110, -110, -110, 172, 172, 275, 160, 516, 667, |
| 90518 | | - /* 200 */ 724, 442, 744, 883, 60, 60, 612, 367, 236, 803, |
| 90519 | | - /* 210 */ 708, 708, 143, 718, 708, 708, 708, 708, 542, 426, |
| 90520 | | - /* 220 */ 438, 154, 773, 773, 713, 428, 428, 904, 428, 876, |
| 90521 | | - /* 230 */ 428, 154, 428, 154, 643, 1024, 946, 1024, 904, 904, |
| 90522 | | - /* 240 */ 946, 1115, 1115, 1115, 1115, 1129, 1129, 1127, -109, 1040, |
| 90523 | | - /* 250 */ 1052, 1059, 1062, 1072, 1066, 1113, 1113, 1140, 1137, 1140, |
| 90524 | | - /* 260 */ 1137, 1140, 1137, 1154, 1154, 1231, 1154, 1211, 1154, 1302, |
| 90525 | | - /* 270 */ 1256, 1256, 1231, 1154, 1154, 1154, 1302, 1378, 1113, 1378, |
| 90526 | | - /* 280 */ 1113, 1378, 1113, 1113, 1353, 1276, 1378, 1113, 1344, 1344, |
| 90527 | | - /* 290 */ 1404, 1040, 1113, 1412, 1412, 1412, 1412, 1040, 1344, 1404, |
| 90528 | | - /* 300 */ 1113, 1397, 1397, 1113, 1113, 1408, -110, -110, -110, -110, |
| 90529 | | - /* 310 */ -110, -110, 939, 46, 547, 905, 983, 971, 972, 970, |
| 90530 | | - /* 320 */ 1037, 941, 982, 1029, 1047, 1097, 1110, 1128, 1262, 1263, |
| 90531 | | - /* 330 */ 1093, 1297, 1450, 1437, 1431, 1435, 1341, 1343, 1345, 1346, |
| 90532 | | - /* 340 */ 1347, 1349, 1443, 1444, 1445, 1447, 1455, 1448, 1449, 1446, |
| 90533 | | - /* 350 */ 1451, 1452, 1453, 1438, 1454, 1441, 1453, 1358, 1458, 1456, |
| 90534 | | - /* 360 */ 1457, 1364, 1459, 1460, 1461, 1433, 1464, 1463, 1436, 1465, |
| 90535 | | - /* 370 */ 1466, 1468, 1471, 1442, 1473, 1394, 1389, 1479, 1481, 1475, |
| 90536 | | - /* 380 */ 1398, 1462, 1467, 1469, 1478, 1470, 1366, 1402, 1485, 1503, |
| 90537 | | - /* 390 */ 1508, 1393, 1476, 1486, 1405, 1439, 1440, 1388, 1495, 1400, |
| 90538 | | - /* 400 */ 1518, 1504, 1401, 1505, 1406, 1420, 1403, 1506, 1407, 1507, |
| 90539 | | - /* 410 */ 1509, 1515, 1472, 1520, 1396, 1511, 1535, 1536, |
| 90726 | + /* 100 */ 1017, -69, -69, -69, -69, -1, -1, 57, 28, -44, |
| 90727 | + /* 110 */ 136, 136, 502, 136, 136, 136, 136, 136, 136, 136, |
| 90728 | + /* 120 */ 136, 136, 136, 136, 136, 136, 136, 136, 136, 580, |
| 90729 | + /* 130 */ 136, 136, 136, 138, 804, -63, -104, -104, -104, 1356, |
| 90730 | + /* 140 */ 74, 426, 433, 355, 215, 433, 313, 369, 136, 136, |
| 90731 | + /* 150 */ 136, 136, 136, 136, 136, 136, 136, 754, 136, 136, |
| 90732 | + /* 160 */ 136, 136, 136, 136, 136, 136, 136, 827, 136, 136, |
| 90733 | + /* 170 */ 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, |
| 90734 | + /* 180 */ 136, 136, 586, 731, 731, 731, 780, 282, -103, -103, |
| 90735 | + /* 190 */ -103, -104, -104, -104, 94, 158, 94, 12, 220, 662, |
| 90736 | + /* 200 */ 516, 744, 870, 809, 870, 818, 555, 634, 419, 655, |
| 90737 | + /* 210 */ 634, 634, 634, 638, 634, 213, 582, 634, 415, 566, |
| 90738 | + /* 220 */ 138, 566, 138, 435, 642, 884, 138, 358, 309, 309, |
| 90739 | + /* 230 */ 621, 621, 1129, 627, 566, 566, 358, 1129, 309, 566, |
| 90740 | + /* 240 */ 1150, 1177, 1187, 1185, 1101, 1101, 1101, 1207, 1202, 1157, |
| 90741 | + /* 250 */ 1157, 1101, 1197, 1157, 1263, 1197, 1157, 1101, 1202, 1157, |
| 90742 | + /* 260 */ 1263, 1101, 1311, 1330, 1157, 1258, 1263, 1157, 1330, 1363, |
| 90743 | + /* 270 */ 1101, 1363, 1363, 1312, 1280, 1269, 1101, 1354, 1259, 1271, |
| 90744 | + /* 280 */ 1312, 1101, 1177, 1177, 1177, 1271, 1312, 1280, 1269, 1185, |
| 90745 | + /* 290 */ 1280, 1269, 1363, 1288, 1101, 1298, 1300, 1303, 1263, 1271, |
| 90746 | + /* 300 */ 1101, -103, 1187, 1301, 1390, 1311, -104, -104, -104, -104, |
| 90747 | + /* 310 */ -104, -104, 939, 468, 978, 84, 837, 1317, 650, 831, |
| 90748 | + /* 320 */ 971, 595, 1275, 1321, 723, 1046, 901, 1109, 749, 1229, |
| 90749 | + /* 330 */ 972, 1043, 1315, 1445, 1432, 1425, 1427, 1334, 1336, 1338, |
| 90750 | + /* 340 */ 1339, 1340, 1347, 1438, 1439, 1441, 1443, 1450, 1444, 1446, |
| 90751 | + /* 350 */ 1442, 1447, 1448, 1451, 1437, 1452, 1440, 1451, 1359, 1457, |
| 90752 | + /* 360 */ 1449, 1453, 1364, 1459, 1460, 1454, 1436, 1467, 1461, 1455, |
| 90753 | + /* 370 */ 1469, 1471, 1470, 1473, 1456, 1474, 1395, 1391, 1479, 1480, |
| 90754 | + /* 380 */ 1477, 1398, 1462, 1458, 1463, 1478, 1465, 1366, 1402, 1487, |
| 90755 | + /* 390 */ 1505, 1510, 1396, -29, 1485, 1407, 1464, 1466, 1389, 1497, |
| 90756 | + /* 400 */ 1403, 1519, 1506, 1404, 1503, 1408, 1418, 1507, 1400, 1508, |
| 90757 | + /* 410 */ 1509, 1512, 1468, 1515, 1394, 1513, 1533, 1534, |
| 90540 | 90758 | }; |
| 90541 | | -#define YY_REDUCE_USE_DFLT (-197) |
| 90759 | +#define YY_REDUCE_USE_DFLT (-222) |
| 90542 | 90760 | #define YY_REDUCE_MAX 311 |
| 90543 | 90761 | static const short yy_reduce_ofst[] = { |
| 90544 | | - /* 0 */ -141, 90, 16, 147, -55, 21, 148, 149, 158, 240, |
| 90545 | | - /* 10 */ 223, 237, 242, 303, 307, 164, 370, 171, 369, 376, |
| 90546 | | - /* 20 */ 380, 443, 450, 504, 517, 524, 535, 537, 578, 591, |
| 90547 | | - /* 30 */ 594, 599, 611, 652, 665, 668, 686, 726, 739, 742, |
| 90548 | | - /* 40 */ 746, 760, 800, 816, 834, 874, 888, 890, 908, 911, |
| 90549 | | - /* 50 */ 962, 975, 989, 993, 1030, 1089, 1096, 1102, 1119, 1125, |
| 90550 | | - /* 60 */ 1131, -196, 954, 740, 396, 169, -68, 463, 405, 459, |
| 90551 | | - /* 70 */ 459, 459, 459, 459, 459, 459, 459, 459, 459, 459, |
| 90552 | | - /* 80 */ 459, 459, 459, 459, 459, 459, 459, 459, 459, 459, |
| 90553 | | - /* 90 */ 459, 459, 459, 459, 459, 459, 459, 459, 459, 459, |
| 90554 | | - /* 100 */ 459, 459, 459, 459, 459, 459, 459, -21, 459, 459, |
| 90555 | | - /* 110 */ 538, 375, 592, 666, 814, 6, 222, 521, 682, 817, |
| 90556 | | - /* 120 */ 356, 244, 466, 684, 691, 891, 994, 1023, 1063, 1142, |
| 90557 | | - /* 130 */ 1169, 759, 1173, 459, -89, 459, 459, 459, 459, 285, |
| 90558 | | - /* 140 */ 76, 430, 598, 610, 765, 818, 423, 485, 892, 909, |
| 90559 | | - /* 150 */ 910, 969, 1006, 818, 1011, 1016, 1067, 1076, 1132, 1177, |
| 90560 | | - /* 160 */ 1178, 1181, 1186, 1195, 1199, 1200, 1209, 1217, 1218, 1221, |
| 90561 | | - /* 170 */ 1222, 1234, 1235, 1238, 1241, 1242, 1243, 1244, 1254, 1255, |
| 90562 | | - /* 180 */ 532, 532, 549, 178, 324, 688, 446, 769, 776, 809, |
| 90563 | | - /* 190 */ 813, 655, 581, 738, -74, -58, -50, -17, -23, -23, |
| 90564 | | - /* 200 */ -23, 63, -23, 29, 68, 121, 183, 146, 225, 29, |
| 90565 | | - /* 210 */ -23, -23, 196, 177, -23, -23, -23, -23, 255, 328, |
| 90566 | | - /* 220 */ 335, 381, 404, 439, 449, 600, 648, 546, 685, 638, |
| 90567 | | - /* 230 */ 717, 663, 722, 811, 734, 756, 801, 827, 868, 872, |
| 90568 | | - /* 240 */ 899, 967, 980, 996, 997, 981, 987, 1003, 961, 976, |
| 90569 | | - /* 250 */ 979, 992, 998, 1004, 991, 1057, 1070, 1009, 1036, 1038, |
| 90570 | | - /* 260 */ 1069, 1041, 1080, 1098, 1122, 1111, 1135, 1123, 1139, 1168, |
| 90571 | | - /* 270 */ 1133, 1143, 1174, 1185, 1194, 1205, 1216, 1257, 1245, 1258, |
| 90572 | | - /* 280 */ 1253, 1259, 1260, 1261, 1183, 1184, 1266, 1267, 1227, 1236, |
| 90573 | | - /* 290 */ 1208, 1229, 1272, 1239, 1247, 1248, 1249, 1237, 1264, 1219, |
| 90574 | | - /* 300 */ 1278, 1201, 1202, 1285, 1286, 1203, 1283, 1268, 1270, 1206, |
| 90575 | | - /* 310 */ 1204, 1207, |
| 90762 | + /* 0 */ 118, 90, 238, 147, 155, 20, 173, 148, 83, 246, |
| 90763 | + /* 10 */ 377, 379, 385, 241, 228, 386, 297, 312, 443, 445, |
| 90764 | + /* 20 */ 459, 462, 464, 504, 517, 530, 535, 537, 578, 591, |
| 90765 | + /* 30 */ 594, 610, 613, 652, 665, 668, 672, 686, 726, 739, |
| 90766 | + /* 40 */ 742, 760, 800, 816, 834, 874, 888, 890, 908, 911, |
| 90767 | + /* 50 */ 962, 975, 989, 993, 1029, 1065, 1092, 1094, 1097, 1100, |
| 90768 | + /* 60 */ 1105, -221, 1011, 249, 224, 311, 23, 362, 110, 77, |
| 90769 | + /* 70 */ 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, |
| 90770 | + /* 80 */ 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, |
| 90771 | + /* 90 */ 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, |
| 90772 | + /* 100 */ 77, 77, 77, 77, 77, 77, 77, 730, 77, 77, |
| 90773 | + /* 110 */ 813, -88, 22, 669, 596, 762, 341, 833, 743, 740, |
| 90774 | + /* 120 */ 814, 891, 892, 817, 894, 964, 994, 390, -71, 206, |
| 90775 | + /* 130 */ 549, 463, 666, -142, 77, 77, 77, 77, 77, 392, |
| 90776 | + /* 140 */ 273, 970, 815, 996, 1001, 925, 1015, 1023, 1061, 1063, |
| 90777 | + /* 150 */ 1093, 1095, 1098, 1128, 1136, 1137, 1140, 932, 1141, 1142, |
| 90778 | + /* 160 */ 1144, 1145, 1001, 1161, 1162, 1165, 1166, 932, 1167, 1189, |
| 90779 | + /* 170 */ 1195, 31, 208, 451, 670, 673, 820, 821, 822, 830, |
| 90780 | + /* 180 */ 988, 910, -10, 21, 44, 914, 927, 883, 961, 982, |
| 90781 | + /* 190 */ 332, 266, 948, 383, -96, -94, -76, -83, -59, -30, |
| 90782 | + /* 200 */ -41, -59, -3, -59, 10, -59, 177, -59, 105, 247, |
| 90783 | + /* 210 */ -59, -59, -59, 139, -59, -41, 190, -59, 296, 438, |
| 90784 | + /* 220 */ 320, 448, 523, 529, 590, 626, 682, 699, 706, 727, |
| 90785 | + /* 230 */ 764, 819, 734, 745, 897, 921, 848, 920, 960, 998, |
| 90786 | + /* 240 */ 1040, 1004, 1050, 995, 1051, 1062, 1074, 1082, 1069, 1088, |
| 90787 | + /* 250 */ 1106, 1116, 1078, 1149, 1172, 1083, 1171, 1191, 1134, 1173, |
| 90788 | + /* 260 */ 1194, 1196, 1113, 1179, 1183, 1184, 1209, 1192, 1188, 1224, |
| 90789 | + /* 270 */ 1217, 1227, 1228, 1198, 1176, 1180, 1233, 1147, 1168, 1199, |
| 90790 | + /* 280 */ 1208, 1242, 1210, 1211, 1212, 1201, 1216, 1203, 1204, 1182, |
| 90791 | + /* 290 */ 1206, 1213, 1265, 1214, 1261, 1218, 1220, 1226, 1272, 1232, |
| 90792 | + /* 300 */ 1270, 1238, 1282, 1205, 1200, 1215, 1219, 1257, 1260, 1281, |
| 90793 | + /* 310 */ 1221, 1222, |
| 90576 | 90794 | }; |
| 90577 | 90795 | static const YYACTIONTYPE yy_default[] = { |
| 90578 | | - /* 0 */ 634, 869, 958, 958, 869, 958, 958, 898, 898, 757, |
| 90579 | | - /* 10 */ 867, 958, 958, 958, 958, 958, 958, 932, 958, 958, |
| 90796 | + /* 0 */ 634, 869, 958, 958, 869, 958, 898, 898, 958, 757, |
| 90797 | + /* 10 */ 958, 867, 958, 958, 958, 958, 958, 932, 958, 958, |
| 90580 | 90798 | /* 20 */ 958, 958, 958, 958, 958, 958, 958, 958, 958, 958, |
| 90581 | 90799 | /* 30 */ 958, 958, 958, 958, 958, 958, 958, 958, 958, 958, |
| 90582 | 90800 | /* 40 */ 958, 958, 958, 958, 958, 958, 958, 958, 958, 958, |
| 90583 | 90801 | /* 50 */ 958, 958, 958, 958, 958, 958, 958, 958, 958, 958, |
| 90584 | | - /* 60 */ 958, 841, 958, 958, 958, 673, 898, 898, 761, 792, |
| 90585 | | - /* 70 */ 958, 958, 958, 958, 958, 958, 958, 958, 793, 958, |
| 90586 | | - /* 80 */ 871, 866, 862, 864, 863, 870, 794, 783, 790, 797, |
| 90587 | | - /* 90 */ 772, 911, 799, 800, 806, 807, 933, 931, 829, 828, |
| 90588 | | - /* 100 */ 847, 831, 845, 853, 846, 830, 840, 665, 832, 833, |
| 90589 | | - /* 110 */ 958, 958, 958, 958, 958, 726, 660, 958, 958, 958, |
| 90590 | | - /* 120 */ 958, 958, 958, 958, 958, 958, 958, 958, 958, 958, |
| 90591 | | - /* 130 */ 958, 958, 958, 834, 958, 835, 848, 849, 850, 958, |
| 90592 | | - /* 140 */ 958, 958, 958, 958, 958, 958, 958, 958, 640, 958, |
| 90802 | + /* 60 */ 958, 841, 958, 958, 958, 898, 673, 898, 761, 792, |
| 90803 | + /* 70 */ 958, 958, 958, 958, 958, 958, 958, 958, 958, 931, |
| 90804 | + /* 80 */ 793, 783, 911, 864, 806, 772, 800, 797, 933, 866, |
| 90805 | + /* 90 */ 863, 799, 790, 794, 871, 807, 870, 862, 829, 847, |
| 90806 | + /* 100 */ 828, 846, 853, 831, 845, 830, 840, 665, 832, 833, |
| 90807 | + /* 110 */ 958, 958, 660, 958, 958, 958, 958, 958, 958, 958, |
| 90808 | + /* 120 */ 958, 958, 958, 958, 958, 958, 958, 958, 958, 726, |
| 90809 | + /* 130 */ 958, 958, 958, 958, 834, 835, 849, 848, 850, 958, |
| 90810 | + /* 140 */ 958, 958, 958, 958, 958, 958, 958, 958, 882, 958, |
| 90593 | 90811 | /* 150 */ 958, 958, 958, 958, 958, 958, 958, 958, 958, 958, |
| 90594 | | - /* 160 */ 958, 958, 958, 958, 958, 958, 958, 958, 958, 958, |
| 90595 | | - /* 170 */ 958, 958, 958, 958, 958, 882, 958, 936, 938, 958, |
| 90596 | | - /* 180 */ 958, 958, 634, 757, 757, 757, 958, 958, 958, 958, |
| 90597 | | - /* 190 */ 958, 751, 761, 950, 958, 958, 717, 958, 958, 958, |
| 90598 | | - /* 200 */ 958, 958, 958, 958, 958, 958, 642, 749, 675, 759, |
| 90599 | | - /* 210 */ 662, 738, 904, 958, 923, 921, 740, 802, 958, 749, |
| 90600 | | - /* 220 */ 758, 958, 958, 958, 865, 786, 786, 774, 786, 696, |
| 90601 | | - /* 230 */ 786, 958, 786, 958, 699, 916, 796, 916, 774, 774, |
| 90602 | | - /* 240 */ 796, 639, 639, 639, 639, 650, 650, 716, 958, 796, |
| 90603 | | - /* 250 */ 787, 789, 779, 791, 958, 765, 765, 773, 778, 773, |
| 90604 | | - /* 260 */ 778, 773, 778, 728, 728, 713, 728, 699, 728, 875, |
| 90605 | | - /* 270 */ 879, 879, 713, 728, 728, 728, 875, 657, 765, 657, |
| 90606 | | - /* 280 */ 765, 657, 765, 765, 908, 910, 657, 765, 730, 730, |
| 90607 | | - /* 290 */ 808, 796, 765, 737, 737, 737, 737, 796, 730, 808, |
| 90608 | | - /* 300 */ 765, 935, 935, 765, 765, 943, 683, 701, 701, 950, |
| 90812 | + /* 160 */ 958, 958, 958, 958, 958, 958, 640, 958, 958, 958, |
| 90813 | + /* 170 */ 958, 958, 958, 958, 936, 958, 958, 958, 938, 958, |
| 90814 | + /* 180 */ 958, 958, 958, 757, 757, 757, 634, 958, 958, 958, |
| 90815 | + /* 190 */ 958, 761, 751, 950, 958, 717, 958, 958, 958, 958, |
| 90816 | + /* 200 */ 958, 958, 958, 958, 958, 958, 642, 921, 958, 675, |
| 90817 | + /* 210 */ 802, 662, 740, 904, 738, 759, 749, 923, 696, 786, |
| 90818 | + /* 220 */ 958, 786, 958, 699, 749, 758, 958, 796, 774, 774, |
| 90819 | + /* 230 */ 958, 958, 916, 865, 786, 786, 796, 916, 774, 786, |
| 90820 | + /* 240 */ 958, 737, 650, 808, 765, 765, 765, 716, 713, 728, |
| 90821 | + /* 250 */ 728, 765, 879, 728, 657, 879, 728, 765, 713, 728, |
| 90822 | + /* 260 */ 657, 765, 935, 875, 728, 699, 657, 728, 875, 639, |
| 90823 | + /* 270 */ 765, 639, 639, 730, 773, 778, 765, 943, 958, 796, |
| 90824 | + /* 280 */ 730, 765, 737, 737, 737, 796, 730, 773, 778, 808, |
| 90825 | + /* 290 */ 773, 778, 639, 791, 765, 779, 789, 787, 657, 796, |
| 90826 | + /* 300 */ 765, 958, 650, 910, 908, 935, 950, 701, 701, 683, |
| 90609 | 90827 | /* 310 */ 955, 955, 958, 958, 958, 958, 958, 958, 958, 958, |
| 90610 | | - /* 320 */ 958, 958, 958, 958, 958, 958, 958, 958, 958, 958, |
| 90611 | | - /* 330 */ 884, 958, 958, 648, 958, 667, 815, 820, 816, 958, |
| 90612 | | - /* 340 */ 817, 743, 958, 958, 958, 958, 958, 958, 958, 958, |
| 90613 | | - /* 350 */ 958, 958, 868, 958, 780, 958, 788, 958, 958, 958, |
| 90828 | + /* 320 */ 958, 958, 958, 958, 958, 884, 958, 958, 958, 958, |
| 90829 | + /* 330 */ 958, 958, 958, 958, 648, 958, 667, 815, 820, 816, |
| 90830 | + /* 340 */ 958, 817, 743, 958, 958, 958, 958, 958, 958, 958, |
| 90831 | + /* 350 */ 958, 958, 958, 868, 958, 780, 958, 788, 958, 958, |
| 90614 | 90832 | /* 360 */ 958, 958, 958, 958, 958, 958, 958, 958, 958, 958, |
| 90615 | 90833 | /* 370 */ 958, 958, 958, 958, 958, 958, 958, 958, 958, 958, |
| 90616 | | - /* 380 */ 958, 958, 958, 906, 907, 958, 958, 958, 958, 958, |
| 90617 | | - /* 390 */ 958, 914, 958, 958, 958, 958, 958, 958, 958, 958, |
| 90834 | + /* 380 */ 958, 958, 958, 958, 906, 907, 958, 958, 958, 958, |
| 90835 | + /* 390 */ 958, 958, 914, 958, 958, 958, 958, 958, 958, 958, |
| 90618 | 90836 | /* 400 */ 958, 958, 958, 958, 958, 958, 958, 958, 958, 958, |
| 90619 | | - /* 410 */ 958, 958, 942, 958, 958, 945, 635, 958, 630, 632, |
| 90620 | | - /* 420 */ 633, 637, 638, 641, 667, 668, 670, 671, 672, 643, |
| 90621 | | - /* 430 */ 644, 645, 646, 647, 649, 653, 651, 652, 654, 661, |
| 90622 | | - /* 440 */ 663, 682, 684, 686, 747, 748, 812, 741, 742, 746, |
| 90623 | | - /* 450 */ 669, 823, 814, 818, 819, 821, 822, 836, 837, 839, |
| 90624 | | - /* 460 */ 844, 852, 855, 838, 843, 851, 854, 744, 745, 858, |
| 90625 | | - /* 470 */ 676, 677, 680, 681, 894, 896, 895, 897, 679, 678, |
| 90626 | | - /* 480 */ 824, 827, 860, 861, 924, 925, 926, 927, 928, 856, |
| 90627 | | - /* 490 */ 766, 859, 842, 781, 784, 785, 782, 750, 760, 768, |
| 90628 | | - /* 500 */ 769, 770, 771, 755, 756, 762, 777, 810, 811, 775, |
| 90629 | | - /* 510 */ 776, 763, 764, 752, 753, 754, 857, 813, 825, 826, |
| 90630 | | - /* 520 */ 687, 688, 820, 689, 690, 691, 729, 732, 733, 734, |
| 90631 | | - /* 530 */ 692, 711, 714, 715, 693, 700, 694, 695, 702, 703, |
| 90632 | | - /* 540 */ 704, 706, 707, 708, 709, 710, 705, 876, 877, 880, |
| 90633 | | - /* 550 */ 878, 697, 698, 712, 685, 674, 666, 718, 721, 722, |
| 90634 | | - /* 560 */ 723, 724, 725, 727, 719, 720, 664, 655, 658, 767, |
| 90635 | | - /* 570 */ 900, 909, 905, 901, 902, 903, 659, 872, 873, 731, |
| 90636 | | - /* 580 */ 804, 805, 899, 912, 915, 917, 918, 919, 809, 920, |
| 90637 | | - /* 590 */ 922, 913, 947, 656, 735, 736, 739, 881, 929, 795, |
| 90638 | | - /* 600 */ 798, 801, 803, 883, 885, 887, 889, 890, 891, 892, |
| 90639 | | - /* 610 */ 893, 886, 888, 930, 934, 937, 939, 940, 941, 944, |
| 90640 | | - /* 620 */ 946, 951, 952, 953, 956, 957, 954, 636, 631, |
| 90837 | + /* 410 */ 958, 958, 942, 958, 958, 945, 635, 958, 711, 649, |
| 90838 | + /* 420 */ 734, 733, 732, 729, 691, 690, 689, 647, 820, 688, |
| 90839 | + /* 430 */ 767, 687, 826, 900, 825, 813, 937, 646, 909, 905, |
| 90840 | + /* 440 */ 645, 857, 939, 901, 902, 957, 903, 659, 644, 754, |
| 90841 | + /* 450 */ 753, 752, 954, 764, 630, 763, 776, 872, 873, 643, |
| 90842 | + /* 460 */ 775, 811, 810, 777, 731, 804, 805, 762, 899, 940, |
| 90843 | + /* 470 */ 912, 756, 755, 636, 771, 915, 770, 672, 769, 917, |
| 90844 | + /* 480 */ 671, 918, 941, 768, 760, 750, 944, 782, 785, 919, |
| 90845 | + /* 490 */ 631, 784, 781, 670, 842, 859, 766, 856, 809, 928, |
| 90846 | + /* 500 */ 927, 668, 926, 925, 924, 861, 920, 860, 946, 827, |
| 90847 | + /* 510 */ 824, 678, 922, 667, 913, 641, 679, 897, 951, 895, |
| 90848 | + /* 520 */ 947, 656, 896, 894, 681, 735, 952, 736, 680, 677, |
| 90849 | + /* 530 */ 739, 676, 858, 881, 745, 744, 929, 854, 638, 851, |
| 90850 | + /* 540 */ 843, 838, 795, 855, 852, 844, 637, 839, 837, 798, |
| 90851 | + /* 550 */ 836, 822, 821, 819, 818, 953, 814, 823, 801, 633, |
| 90852 | + /* 560 */ 803, 669, 883, 746, 742, 741, 812, 885, 887, 889, |
| 90853 | + /* 570 */ 890, 891, 892, 893, 748, 632, 886, 956, 888, 747, |
| 90854 | + /* 580 */ 666, 718, 674, 721, 686, 684, 685, 712, 682, 698, |
| 90855 | + /* 590 */ 722, 663, 697, 878, 880, 723, 930, 877, 876, 705, |
| 90856 | + /* 600 */ 724, 661, 654, 710, 709, 934, 708, 707, 706, 704, |
| 90857 | + /* 610 */ 652, 725, 727, 719, 720, 664, 703, 702, 695, 694, |
| 90858 | + /* 620 */ 700, 693, 715, 655, 651, 653, 658, 714, 692, |
| 90641 | 90859 | }; |
| 90642 | 90860 | #define YY_SZ_ACTTAB (int)(sizeof(yy_action)/sizeof(yy_action[0])) |
| 90643 | 90861 | |
| 90644 | 90862 | /* The next table maps tokens into fallback tokens. If a construct |
| 90645 | 90863 | ** like the following: |
| | @@ -92151,11 +92369,11 @@ |
| 92151 | 92369 | break; |
| 92152 | 92370 | case 69: /* ccons ::= COLLATE ids */ |
| 92153 | 92371 | {sqlite3AddCollateType(pParse, &yymsp[0].minor.yy0);} |
| 92154 | 92372 | break; |
| 92155 | 92373 | case 72: /* refargs ::= */ |
| 92156 | | -{ yygotominor.yy328 = OE_None * 0x000101; } |
| 92374 | +{ yygotominor.yy328 = OE_None*0x0101; /* EV: R-19803-45884 */} |
| 92157 | 92375 | break; |
| 92158 | 92376 | case 73: /* refargs ::= refargs refarg */ |
| 92159 | 92377 | { yygotominor.yy328 = (yymsp[-1].minor.yy328 & ~yymsp[0].minor.yy429.mask) | yymsp[0].minor.yy429.value; } |
| 92160 | 92378 | break; |
| 92161 | 92379 | case 74: /* refarg ::= MATCH nm */ |
| | @@ -92166,23 +92384,23 @@ |
| 92166 | 92384 | break; |
| 92167 | 92385 | case 76: /* refarg ::= ON UPDATE refact */ |
| 92168 | 92386 | { yygotominor.yy429.value = yymsp[0].minor.yy328<<8; yygotominor.yy429.mask = 0x00ff00; } |
| 92169 | 92387 | break; |
| 92170 | 92388 | case 77: /* refact ::= SET NULL */ |
| 92171 | | -{ yygotominor.yy328 = OE_SetNull; } |
| 92389 | +{ yygotominor.yy328 = OE_SetNull; /* EV: R-33326-45252 */} |
| 92172 | 92390 | break; |
| 92173 | 92391 | case 78: /* refact ::= SET DEFAULT */ |
| 92174 | | -{ yygotominor.yy328 = OE_SetDflt; } |
| 92392 | +{ yygotominor.yy328 = OE_SetDflt; /* EV: R-33326-45252 */} |
| 92175 | 92393 | break; |
| 92176 | 92394 | case 79: /* refact ::= CASCADE */ |
| 92177 | | -{ yygotominor.yy328 = OE_Cascade; } |
| 92395 | +{ yygotominor.yy328 = OE_Cascade; /* EV: R-33326-45252 */} |
| 92178 | 92396 | break; |
| 92179 | 92397 | case 80: /* refact ::= RESTRICT */ |
| 92180 | | -{ yygotominor.yy328 = OE_Restrict; } |
| 92398 | +{ yygotominor.yy328 = OE_Restrict; /* EV: R-33326-45252 */} |
| 92181 | 92399 | break; |
| 92182 | 92400 | case 81: /* refact ::= NO ACTION */ |
| 92183 | | -{ yygotominor.yy328 = OE_None; } |
| 92401 | +{ yygotominor.yy328 = OE_None; /* EV: R-33326-45252 */} |
| 92184 | 92402 | break; |
| 92185 | 92403 | case 83: /* defer_subclause ::= DEFERRABLE init_deferred_pred_opt */ |
| 92186 | 92404 | case 98: /* defer_subclause_opt ::= defer_subclause */ yytestcase(yyruleno==98); |
| 92187 | 92405 | case 100: /* onconf ::= ON CONFLICT resolvetype */ yytestcase(yyruleno==100); |
| 92188 | 92406 | case 103: /* resolvetype ::= raisetype */ yytestcase(yyruleno==103); |
| | @@ -93431,19 +93649,19 @@ |
| 93431 | 93649 | 0, 65, 6, 0, 48, 86, 98, 0, 115, 97, 0, 0, 45, |
| 93432 | 93650 | 0, 99, 24, 0, 17, 0, 119, 49, 23, 0, 5, 106, 25, |
| 93433 | 93651 | 92, 0, 0, 121, 102, 56, 120, 53, 28, 51, 0, 87, 0, |
| 93434 | 93652 | 96, 26, 0, 95, 0, 0, 0, 91, 88, 93, 84, 105, 14, |
| 93435 | 93653 | 39, 104, 0, 77, 0, 18, 85, 107, 32, 0, 117, 76, 109, |
| 93436 | | - 59, 46, 80, 0, 0, 90, 40, 0, 112, 0, 36, 0, 0, |
| 93437 | | - 29, 0, 82, 58, 60, 0, 20, 57, 0, 52, |
| 93654 | + 57, 46, 80, 0, 0, 90, 40, 0, 112, 0, 36, 0, 0, |
| 93655 | + 29, 0, 82, 59, 60, 0, 20, 58, 0, 52, |
| 93438 | 93656 | }; |
| 93439 | 93657 | static const unsigned char aNext[121] = { |
| 93440 | 93658 | 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, |
| 93441 | 93659 | 0, 2, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, |
| 93442 | 93660 | 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 93443 | 93661 | 0, 0, 0, 0, 0, 33, 21, 0, 0, 0, 43, 3, 47, |
| 93444 | | - 0, 0, 0, 0, 30, 54, 0, 0, 38, 0, 0, 0, 1, |
| 93662 | + 0, 0, 0, 0, 0, 30, 54, 0, 38, 0, 0, 0, 1, |
| 93445 | 93663 | 62, 0, 0, 63, 0, 41, 0, 0, 0, 0, 0, 0, 0, |
| 93446 | 93664 | 61, 0, 0, 0, 0, 31, 55, 16, 34, 10, 0, 0, 0, |
| 93447 | 93665 | 0, 0, 0, 0, 11, 68, 75, 0, 8, 0, 100, 94, 0, |
| 93448 | 93666 | 103, 0, 83, 0, 71, 0, 0, 110, 27, 37, 69, 79, 0, |
| 93449 | 93667 | 35, 64, 0, 0, |
| | @@ -93451,11 +93669,11 @@ |
| 93451 | 93669 | static const unsigned char aLen[121] = { |
| 93452 | 93670 | 7, 7, 5, 4, 6, 4, 5, 3, 6, 7, 3, 6, 6, |
| 93453 | 93671 | 7, 7, 3, 8, 2, 6, 5, 4, 4, 3, 10, 4, 6, |
| 93454 | 93672 | 11, 6, 2, 7, 5, 5, 9, 6, 9, 9, 7, 10, 10, |
| 93455 | 93673 | 4, 6, 2, 3, 4, 9, 2, 6, 5, 6, 6, 5, 6, |
| 93456 | | - 5, 5, 7, 7, 7, 2, 3, 4, 4, 7, 3, 6, 4, |
| 93674 | + 5, 5, 7, 7, 3, 7, 2, 4, 4, 7, 3, 6, 4, |
| 93457 | 93675 | 7, 6, 12, 6, 9, 4, 6, 5, 4, 7, 6, 5, 6, |
| 93458 | 93676 | 7, 5, 4, 5, 6, 5, 7, 3, 7, 13, 2, 2, 4, |
| 93459 | 93677 | 6, 6, 8, 5, 17, 12, 7, 8, 8, 2, 4, 4, 4, |
| 93460 | 93678 | 4, 4, 2, 2, 6, 5, 8, 5, 5, 8, 3, 5, 5, |
| 93461 | 93679 | 6, 4, 9, 3, |
| | @@ -93482,11 +93700,11 @@ |
| 93482 | 93700 | TK_ALTER, TK_RAISE, TK_EXCLUSIVE, TK_EXISTS, TK_SAVEPOINT, |
| 93483 | 93701 | TK_INTERSECT, TK_TRIGGER, TK_REFERENCES, TK_CONSTRAINT, TK_INTO, |
| 93484 | 93702 | TK_OFFSET, TK_OF, TK_SET, TK_TEMP, TK_TEMP, |
| 93485 | 93703 | TK_OR, TK_UNIQUE, TK_QUERY, TK_ATTACH, TK_HAVING, |
| 93486 | 93704 | TK_GROUP, TK_UPDATE, TK_BEGIN, TK_JOIN_KW, TK_RELEASE, |
| 93487 | | - TK_BETWEEN, TK_NOTNULL, TK_NO, TK_NOT, TK_NULL, |
| 93705 | + TK_BETWEEN, TK_NOT, TK_NOTNULL, TK_NO, TK_NULL, |
| 93488 | 93706 | TK_LIKE_KW, TK_CASCADE, TK_ASC, TK_DELETE, TK_CASE, |
| 93489 | 93707 | TK_COLLATE, TK_CREATE, TK_CTIME_KW, TK_DETACH, TK_IMMEDIATE, |
| 93490 | 93708 | TK_JOIN, TK_INSERT, TK_MATCH, TK_PLAN, TK_ANALYZE, |
| 93491 | 93709 | TK_PRAGMA, TK_ABORT, TK_VALUES, TK_VIRTUAL, TK_LIMIT, |
| 93492 | 93710 | TK_WHEN, TK_WHERE, TK_RENAME, TK_AFTER, TK_REPLACE, |
| | @@ -93560,13 +93778,13 @@ |
| 93560 | 93778 | testcase( i==51 ); /* UPDATE */ |
| 93561 | 93779 | testcase( i==52 ); /* BEGIN */ |
| 93562 | 93780 | testcase( i==53 ); /* INNER */ |
| 93563 | 93781 | testcase( i==54 ); /* RELEASE */ |
| 93564 | 93782 | testcase( i==55 ); /* BETWEEN */ |
| 93565 | | - testcase( i==56 ); /* NOTNULL */ |
| 93566 | | - testcase( i==57 ); /* NO */ |
| 93567 | | - testcase( i==58 ); /* NOT */ |
| 93783 | + testcase( i==56 ); /* NOT */ |
| 93784 | + testcase( i==57 ); /* NOTNULL */ |
| 93785 | + testcase( i==58 ); /* NO */ |
| 93568 | 93786 | testcase( i==59 ); /* NULL */ |
| 93569 | 93787 | testcase( i==60 ); /* LIKE */ |
| 93570 | 93788 | testcase( i==61 ); /* CASCADE */ |
| 93571 | 93789 | testcase( i==62 ); /* ASC */ |
| 93572 | 93790 | testcase( i==63 ); /* DELETE */ |
| | @@ -95956,12 +96174,12 @@ |
| 95956 | 96174 | # error SQLITE_MAX_ATTACHED must be between 0 and 30 |
| 95957 | 96175 | #endif |
| 95958 | 96176 | #if SQLITE_MAX_LIKE_PATTERN_LENGTH<1 |
| 95959 | 96177 | # error SQLITE_MAX_LIKE_PATTERN_LENGTH must be at least 1 |
| 95960 | 96178 | #endif |
| 95961 | | -#if SQLITE_MAX_VARIABLE_NUMBER<1 |
| 95962 | | -# error SQLITE_MAX_VARIABLE_NUMBER must be at least 1 |
| 96179 | +#if SQLITE_MAX_VARIABLE_NUMBER<1 || SQLITE_MAX_VARIABLE_NUMBER>32767 |
| 96180 | +# error SQLITE_MAX_VARIABLE_NUMBER must be between 1 and 32767 |
| 95963 | 96181 | #endif |
| 95964 | 96182 | #if SQLITE_MAX_COLUMN>32767 |
| 95965 | 96183 | # error SQLITE_MAX_COLUMN must not exceed 32767 |
| 95966 | 96184 | #endif |
| 95967 | 96185 | #if SQLITE_MAX_TRIGGER_DEPTH<1 |
| 95968 | 96186 | |