Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Update the built-in SQLite to a version from the exists-to-join branch in the SQLite source tree, in order to beta-test the exists-to-join optimization. Fossil uses EXISTS operators in the WHERE clause of queries in many places and is therefore a good test case. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
b58b30512e88213cfc43a3ac252f41b4 |
User & Date: | drh 2024-06-11 18:44:53 |
Context
2024-06-14
| ||
00:06 | Temporary fix for a bad query plan caused by issues in SQLite. See forum post 6900455c28dcd3da. ... (check-in: 9866c97b user: drh tags: trunk) | |
2024-06-11
| ||
18:44 | Update the built-in SQLite to a version from the exists-to-join branch in the SQLite source tree, in order to beta-test the exists-to-join optimization. Fossil uses EXISTS operators in the WHERE clause of queries in many places and is therefore a good test case. ... (check-in: b58b3051 user: drh tags: trunk) | |
2024-06-09
| ||
10:53 | Typo fixes reported in forum post 10167c5f79. ... (check-in: 382a61e3 user: stephan tags: trunk) | |
Changes
Changes to extsrc/shell.c.
︙ | ︙ | |||
9406 9407 9408 9409 9410 9411 9412 | ** * Only the "inflate/deflate" (zlib) compression method is supported */ /* #include "sqlite3ext.h" */ SQLITE_EXTENSION_INIT1 #include <stdio.h> #include <string.h> #include <assert.h> | > | > | 9406 9407 9408 9409 9410 9411 9412 9413 9414 9415 9416 9417 9418 9419 9420 9421 9422 | ** * Only the "inflate/deflate" (zlib) compression method is supported */ /* #include "sqlite3ext.h" */ SQLITE_EXTENSION_INIT1 #include <stdio.h> #include <string.h> #include <assert.h> #ifndef SQLITE_NO_STDINT # include <stdint.h> #endif #include <zlib.h> #ifndef SQLITE_OMIT_VIRTUALTABLE #ifndef SQLITE_AMALGAMATION |
︙ | ︙ | |||
22456 22457 22458 22459 22460 22461 22462 22463 22464 22465 22466 22467 22468 22469 22470 22471 22472 22473 22474 22475 22476 22477 22478 22479 22480 22481 22482 22483 22484 22485 22486 | if( pArg->autoEQP>=AUTOEQP_trigger ){ sqlite3_db_config(db, SQLITE_DBCONFIG_TRIGGER_EQP, 1, 0); } pExplain = pStmt; sqlite3_reset(pExplain); rc = sqlite3_stmt_explain(pExplain, 2); if( rc==SQLITE_OK ){ while( sqlite3_step(pExplain)==SQLITE_ROW ){ const char *zEQPLine = (const char*)sqlite3_column_text(pExplain,3); int iEqpId = sqlite3_column_int(pExplain, 0); int iParentId = sqlite3_column_int(pExplain, 1); if( zEQPLine==0 ) zEQPLine = ""; if( zEQPLine[0]=='-' ) eqp_render(pArg, 0); eqp_append(pArg, iEqpId, iParentId, zEQPLine); } eqp_render(pArg, 0); } if( pArg->autoEQP>=AUTOEQP_full ){ /* Also do an EXPLAIN for ".eqp full" mode */ sqlite3_reset(pExplain); rc = sqlite3_stmt_explain(pExplain, 1); if( rc==SQLITE_OK ){ pArg->cMode = MODE_Explain; assert( sqlite3_stmt_isexplain(pExplain)==1 ); explain_data_prepare(pArg, pExplain); exec_prepared_stmt(pArg, pExplain); explain_data_delete(pArg); } } if( pArg->autoEQP>=AUTOEQP_trigger && triggerEQP==0 ){ sqlite3_db_config(db, SQLITE_DBCONFIG_TRIGGER_EQP, 0, 0); | > > | 22458 22459 22460 22461 22462 22463 22464 22465 22466 22467 22468 22469 22470 22471 22472 22473 22474 22475 22476 22477 22478 22479 22480 22481 22482 22483 22484 22485 22486 22487 22488 22489 22490 | if( pArg->autoEQP>=AUTOEQP_trigger ){ sqlite3_db_config(db, SQLITE_DBCONFIG_TRIGGER_EQP, 1, 0); } pExplain = pStmt; sqlite3_reset(pExplain); rc = sqlite3_stmt_explain(pExplain, 2); if( rc==SQLITE_OK ){ bind_prepared_stmt(pArg, pExplain); while( sqlite3_step(pExplain)==SQLITE_ROW ){ const char *zEQPLine = (const char*)sqlite3_column_text(pExplain,3); int iEqpId = sqlite3_column_int(pExplain, 0); int iParentId = sqlite3_column_int(pExplain, 1); if( zEQPLine==0 ) zEQPLine = ""; if( zEQPLine[0]=='-' ) eqp_render(pArg, 0); eqp_append(pArg, iEqpId, iParentId, zEQPLine); } eqp_render(pArg, 0); } if( pArg->autoEQP>=AUTOEQP_full ){ /* Also do an EXPLAIN for ".eqp full" mode */ sqlite3_reset(pExplain); rc = sqlite3_stmt_explain(pExplain, 1); if( rc==SQLITE_OK ){ pArg->cMode = MODE_Explain; assert( sqlite3_stmt_isexplain(pExplain)==1 ); bind_prepared_stmt(pArg, pExplain); explain_data_prepare(pArg, pExplain); exec_prepared_stmt(pArg, pExplain); explain_data_delete(pArg); } } if( pArg->autoEQP>=AUTOEQP_trigger && triggerEQP==0 ){ sqlite3_db_config(db, SQLITE_DBCONFIG_TRIGGER_EQP, 0, 0); |
︙ | ︙ | |||
27158 27159 27160 27161 27162 27163 27164 27165 27166 27167 27168 27169 27170 27171 | sqlite3_free(zRenames); } assert(dbCols==0); if( zColDefs==0 ){ eputf("%s: empty file\n", sCtx.zFile); import_cleanup(&sCtx); rc = 1; goto meta_command_exit; } zCreate = sqlite3_mprintf("%z%z\n", zCreate, zColDefs); if( zCreate==0 ){ import_cleanup(&sCtx); shell_out_of_memory(); } | > | 27162 27163 27164 27165 27166 27167 27168 27169 27170 27171 27172 27173 27174 27175 27176 | sqlite3_free(zRenames); } assert(dbCols==0); if( zColDefs==0 ){ eputf("%s: empty file\n", sCtx.zFile); import_cleanup(&sCtx); rc = 1; sqlite3_free(zCreate); goto meta_command_exit; } zCreate = sqlite3_mprintf("%z%z\n", zCreate, zColDefs); if( zCreate==0 ){ import_cleanup(&sCtx); shell_out_of_memory(); } |
︙ | ︙ | |||
29108 29109 29110 29111 29112 29113 29114 | {"json_selfcheck", SQLITE_TESTCTRL_JSON_SELFCHECK ,0,"BOOLEAN" }, {"localtime_fault", SQLITE_TESTCTRL_LOCALTIME_FAULT,0,"BOOLEAN" }, {"never_corrupt", SQLITE_TESTCTRL_NEVER_CORRUPT,1, "BOOLEAN" }, {"optimizations", SQLITE_TESTCTRL_OPTIMIZATIONS,0,"DISABLE-MASK" }, #ifdef YYCOVERAGE {"parser_coverage", SQLITE_TESTCTRL_PARSER_COVERAGE,0,"" }, #endif | | | 29113 29114 29115 29116 29117 29118 29119 29120 29121 29122 29123 29124 29125 29126 29127 | {"json_selfcheck", SQLITE_TESTCTRL_JSON_SELFCHECK ,0,"BOOLEAN" }, {"localtime_fault", SQLITE_TESTCTRL_LOCALTIME_FAULT,0,"BOOLEAN" }, {"never_corrupt", SQLITE_TESTCTRL_NEVER_CORRUPT,1, "BOOLEAN" }, {"optimizations", SQLITE_TESTCTRL_OPTIMIZATIONS,0,"DISABLE-MASK" }, #ifdef YYCOVERAGE {"parser_coverage", SQLITE_TESTCTRL_PARSER_COVERAGE,0,"" }, #endif {"pending_byte", SQLITE_TESTCTRL_PENDING_BYTE,1, "OFFSET " }, {"prng_restore", SQLITE_TESTCTRL_PRNG_RESTORE,0, "" }, {"prng_save", SQLITE_TESTCTRL_PRNG_SAVE, 0, "" }, {"prng_seed", SQLITE_TESTCTRL_PRNG_SEED, 0, "SEED ?db?" }, {"seek_count", SQLITE_TESTCTRL_SEEK_COUNT, 0, "" }, {"sorter_mmap", SQLITE_TESTCTRL_SORTER_MMAP, 0, "NMAX" }, {"tune", SQLITE_TESTCTRL_TUNE, 1, "ID VALUE" }, {"uselongdouble", SQLITE_TESTCTRL_USELONGDOUBLE,0,"?BOOLEAN|\"default\"?"}, |
︙ | ︙ | |||
30952 30953 30954 30955 30956 30957 30958 | ** command-line inputs, except for the argToSkip argument which contains ** the database filename. */ for(i=0; i<nCmd; i++){ if( azCmd[i][0]=='.' ){ rc = do_meta_command(azCmd[i], &data); if( rc ){ | < | > < | > | 30957 30958 30959 30960 30961 30962 30963 30964 30965 30966 30967 30968 30969 30970 30971 30972 30973 30974 30975 30976 30977 30978 30979 30980 30981 30982 30983 30984 30985 30986 | ** command-line inputs, except for the argToSkip argument which contains ** the database filename. */ for(i=0; i<nCmd; i++){ if( azCmd[i][0]=='.' ){ rc = do_meta_command(azCmd[i], &data); if( rc ){ if( rc==2 ) rc = 0; goto shell_main_exit; } }else{ open_db(&data, 0); echo_group_input(&data, azCmd[i]); rc = shell_exec(&data, azCmd[i], &zErrMsg); if( zErrMsg || rc ){ if( zErrMsg!=0 ){ eputf("Error: %s\n", zErrMsg); }else{ eputf("Error: unable to process SQL: %s\n", azCmd[i]); } sqlite3_free(zErrMsg); if( rc==0 ) rc = 1; goto shell_main_exit; } } } }else{ /* Run commands received from standard input */ if( stdin_is_interactive ){ |
︙ | ︙ | |||
31027 31028 31029 31030 31031 31032 31033 31034 31035 31036 31037 31038 31039 31040 | /* In WASM mode we have to leave the db state in place so that ** client code can "push" SQL into it after this call returns. */ #ifndef SQLITE_OMIT_VIRTUALTABLE if( data.expert.pExpert ){ expertFinish(&data, 1, 0); } #endif free(azCmd); set_table_name(&data, 0); if( data.db ){ session_close_all(&data, -1); close_db(data.db); } for(i=0; i<ArraySize(data.aAuxDb); i++){ | > | 31032 31033 31034 31035 31036 31037 31038 31039 31040 31041 31042 31043 31044 31045 31046 | /* In WASM mode we have to leave the db state in place so that ** client code can "push" SQL into it after this call returns. */ #ifndef SQLITE_OMIT_VIRTUALTABLE if( data.expert.pExpert ){ expertFinish(&data, 1, 0); } #endif shell_main_exit: free(azCmd); set_table_name(&data, 0); if( data.db ){ session_close_all(&data, -1); close_db(data.db); } for(i=0; i<ArraySize(data.aAuxDb); i++){ |
︙ | ︙ | |||
31059 31060 31061 31062 31063 31064 31065 | memset(&data, 0, sizeof(data)); #ifdef SQLITE_DEBUG if( sqlite3_memory_used()>mem_main_enter ){ eputf("Memory leaked: %u bytes\n", (unsigned int)(sqlite3_memory_used()-mem_main_enter)); } #endif | | > > | 31065 31066 31067 31068 31069 31070 31071 31072 31073 31074 31075 31076 31077 31078 31079 31080 31081 | memset(&data, 0, sizeof(data)); #ifdef SQLITE_DEBUG if( sqlite3_memory_used()>mem_main_enter ){ eputf("Memory leaked: %u bytes\n", (unsigned int)(sqlite3_memory_used()-mem_main_enter)); } #endif #else /* SQLITE_SHELL_FIDDLE... */ shell_main_exit: #endif return rc; } #ifdef SQLITE_SHELL_FIDDLE /* Only for emcc experimentation purposes. */ int fiddle_experiment(int a,int b){ |
︙ | ︙ |
Changes to extsrc/sqlite3.c.
︙ | ︙ | |||
14 15 16 17 18 19 20 | ** the text of this file. Search for "Begin file sqlite3.h" to find the start ** of the embedded sqlite3.h header file.) Additional code files may be needed ** if you want a wrapper to interface SQLite with your choice of programming ** language. The code for the "sqlite3" command-line shell is also in a ** separate file. This file contains only code for the core SQLite library. ** ** The content in this amalgamation comes from Fossil check-in | | | 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | ** the text of this file. Search for "Begin file sqlite3.h" to find the start ** of the embedded sqlite3.h header file.) Additional code files may be needed ** if you want a wrapper to interface SQLite with your choice of programming ** language. The code for the "sqlite3" command-line shell is also in a ** separate file. This file contains only code for the core SQLite library. ** ** The content in this amalgamation comes from Fossil check-in ** 33a3f327855b427ae6ba0057218d043a1417. */ #define SQLITE_CORE 1 #define SQLITE_AMALGAMATION 1 #ifndef SQLITE_PRIVATE # define SQLITE_PRIVATE static #endif /************** Begin file sqliteInt.h ***************************************/ |
︙ | ︙ | |||
457 458 459 460 461 462 463 | ** ** See also: [sqlite3_libversion()], ** [sqlite3_libversion_number()], [sqlite3_sourceid()], ** [sqlite_version()] and [sqlite_source_id()]. */ #define SQLITE_VERSION "3.47.0" #define SQLITE_VERSION_NUMBER 3047000 | | | 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 | ** ** See also: [sqlite3_libversion()], ** [sqlite3_libversion_number()], [sqlite3_sourceid()], ** [sqlite_version()] and [sqlite_source_id()]. */ #define SQLITE_VERSION "3.47.0" #define SQLITE_VERSION_NUMBER 3047000 #define SQLITE_SOURCE_ID "2024-06-11 18:22:48 33a3f327855b427ae6ba0057218d043a1417bc9d780728f47f23acdd836e1686" /* ** CAPI3REF: Run-Time Library Version Numbers ** KEYWORDS: sqlite3_version sqlite3_sourceid ** ** These interfaces provide the same information as the [SQLITE_VERSION], ** [SQLITE_VERSION_NUMBER], and [SQLITE_SOURCE_ID] C preprocessor macros |
︙ | ︙ | |||
11141 11142 11143 11144 11145 11146 11147 | #ifdef SQLITE_OMIT_FLOATING_POINT # undef double #endif #if defined(__wasi__) # undef SQLITE_WASI # define SQLITE_WASI 1 | < < | 11141 11142 11143 11144 11145 11146 11147 11148 11149 11150 11151 11152 11153 11154 | #ifdef SQLITE_OMIT_FLOATING_POINT # undef double #endif #if defined(__wasi__) # undef SQLITE_WASI # define SQLITE_WASI 1 # ifndef SQLITE_OMIT_LOAD_EXTENSION # define SQLITE_OMIT_LOAD_EXTENSION # endif # ifndef SQLITE_THREADSAFE # define SQLITE_THREADSAFE 0 # endif #endif |
︙ | ︙ | |||
14528 14529 14530 14531 14532 14533 14534 | #define TK_DESC 39 #define TK_DETACH 40 #define TK_EACH 41 #define TK_FAIL 42 #define TK_OR 43 #define TK_AND 44 #define TK_IS 45 | > | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | < | 14526 14527 14528 14529 14530 14531 14532 14533 14534 14535 14536 14537 14538 14539 14540 14541 14542 14543 14544 14545 14546 14547 14548 14549 14550 14551 14552 14553 14554 14555 14556 14557 14558 14559 14560 14561 14562 14563 14564 14565 14566 14567 14568 14569 14570 14571 14572 14573 14574 14575 14576 14577 14578 14579 14580 14581 14582 14583 14584 14585 14586 14587 14588 14589 14590 14591 14592 14593 14594 14595 14596 14597 14598 14599 14600 14601 14602 14603 14604 14605 14606 14607 14608 14609 14610 14611 14612 14613 14614 14615 14616 14617 14618 14619 14620 14621 14622 14623 14624 14625 14626 14627 14628 14629 14630 14631 14632 14633 14634 14635 14636 14637 14638 14639 14640 14641 14642 14643 14644 14645 14646 14647 14648 14649 14650 14651 14652 14653 14654 14655 14656 14657 14658 14659 14660 14661 14662 14663 14664 14665 | #define TK_DESC 39 #define TK_DETACH 40 #define TK_EACH 41 #define TK_FAIL 42 #define TK_OR 43 #define TK_AND 44 #define TK_IS 45 #define TK_ISNOT 46 #define TK_MATCH 47 #define TK_LIKE_KW 48 #define TK_BETWEEN 49 #define TK_IN 50 #define TK_ISNULL 51 #define TK_NOTNULL 52 #define TK_NE 53 #define TK_EQ 54 #define TK_GT 55 #define TK_LE 56 #define TK_LT 57 #define TK_GE 58 #define TK_ESCAPE 59 #define TK_ID 60 #define TK_COLUMNKW 61 #define TK_DO 62 #define TK_FOR 63 #define TK_IGNORE 64 #define TK_INITIALLY 65 #define TK_INSTEAD 66 #define TK_NO 67 #define TK_KEY 68 #define TK_OF 69 #define TK_OFFSET 70 #define TK_PRAGMA 71 #define TK_RAISE 72 #define TK_RECURSIVE 73 #define TK_REPLACE 74 #define TK_RESTRICT 75 #define TK_ROW 76 #define TK_ROWS 77 #define TK_TRIGGER 78 #define TK_VACUUM 79 #define TK_VIEW 80 #define TK_VIRTUAL 81 #define TK_WITH 82 #define TK_NULLS 83 #define TK_FIRST 84 #define TK_LAST 85 #define TK_CURRENT 86 #define TK_FOLLOWING 87 #define TK_PARTITION 88 #define TK_PRECEDING 89 #define TK_RANGE 90 #define TK_UNBOUNDED 91 #define TK_EXCLUDE 92 #define TK_GROUPS 93 #define TK_OTHERS 94 #define TK_TIES 95 #define TK_GENERATED 96 #define TK_ALWAYS 97 #define TK_MATERIALIZED 98 #define TK_REINDEX 99 #define TK_RENAME 100 #define TK_CTIME_KW 101 #define TK_ANY 102 #define TK_BITAND 103 #define TK_BITOR 104 #define TK_LSHIFT 105 #define TK_RSHIFT 106 #define TK_PLUS 107 #define TK_MINUS 108 #define TK_STAR 109 #define TK_SLASH 110 #define TK_REM 111 #define TK_CONCAT 112 #define TK_PTR 113 #define TK_COLLATE 114 #define TK_BITNOT 115 #define TK_ON 116 #define TK_INDEXED 117 #define TK_STRING 118 #define TK_JOIN_KW 119 #define TK_CONSTRAINT 120 #define TK_DEFAULT 121 #define TK_NULL 122 #define TK_PRIMARY 123 #define TK_UNIQUE 124 #define TK_CHECK 125 #define TK_REFERENCES 126 #define TK_AUTOINCR 127 #define TK_INSERT 128 #define TK_DELETE 129 #define TK_UPDATE 130 #define TK_SET 131 #define TK_DEFERRABLE 132 #define TK_FOREIGN 133 #define TK_DROP 134 #define TK_UNION 135 #define TK_ALL 136 #define TK_EXCEPT 137 #define TK_INTERSECT 138 #define TK_SELECT 139 #define TK_VALUES 140 #define TK_DISTINCT 141 #define TK_DOT 142 #define TK_FROM 143 #define TK_JOIN 144 #define TK_USING 145 #define TK_ORDER 146 #define TK_GROUP 147 #define TK_HAVING 148 #define TK_LIMIT 149 #define TK_WHERE 150 #define TK_RETURNING 151 #define TK_INTO 152 #define TK_NOTHING 153 #define TK_FLOAT 154 #define TK_BLOB 155 #define TK_INTEGER 156 #define TK_VARIABLE 157 #define TK_CASE 158 #define TK_WHEN 159 #define TK_THEN 160 #define TK_ELSE 161 #define TK_INDEX 162 #define TK_ALTER 163 #define TK_ADD 164 #define TK_WINDOW 165 #define TK_OVER 166 #define TK_FILTER 167 #define TK_COLUMN 168 #define TK_AGG_FUNCTION 169 #define TK_AGG_COLUMN 170 #define TK_TRUEFALSE 171 #define TK_FUNCTION 172 #define TK_UPLUS 173 #define TK_UMINUS 174 #define TK_TRUTH 175 #define TK_REGISTER 176 #define TK_VECTOR 177 #define TK_SELECT_COLUMN 178 |
︙ | ︙ | |||
15167 15168 15169 15170 15171 15172 15173 15174 15175 15176 15177 15178 15179 15180 | ** 0x00002000 Constant propagation ** 0x00004000 Push-down optimization ** 0x00008000 After all FROM-clause analysis ** 0x00010000 Beginning of DELETE/INSERT/UPDATE processing ** 0x00020000 Transform DISTINCT into GROUP BY ** 0x00040000 SELECT tree dump after all code has been generated ** 0x00080000 NOT NULL strength reduction */ /* ** Macros for "wheretrace" */ SQLITE_PRIVATE u32 sqlite3WhereTrace; #if defined(SQLITE_DEBUG) \ | > | 15165 15166 15167 15168 15169 15170 15171 15172 15173 15174 15175 15176 15177 15178 15179 | ** 0x00002000 Constant propagation ** 0x00004000 Push-down optimization ** 0x00008000 After all FROM-clause analysis ** 0x00010000 Beginning of DELETE/INSERT/UPDATE processing ** 0x00020000 Transform DISTINCT into GROUP BY ** 0x00040000 SELECT tree dump after all code has been generated ** 0x00080000 NOT NULL strength reduction ** 0x00100000 EXISTS-to-JOIN optimization */ /* ** Macros for "wheretrace" */ SQLITE_PRIVATE u32 sqlite3WhereTrace; #if defined(SQLITE_DEBUG) \ |
︙ | ︙ | |||
16659 16660 16661 16662 16663 16664 16665 | #define OP_Or 43 /* same as TK_OR, synopsis: r[P3]=(r[P1] || r[P2]) */ #define OP_And 44 /* same as TK_AND, synopsis: r[P3]=(r[P1] && r[P2]) */ #define OP_IdxGE 45 /* jump, synopsis: key=r[P3@P4] */ #define OP_RowSetRead 46 /* jump, synopsis: r[P3]=rowset(P1) */ #define OP_RowSetTest 47 /* jump, synopsis: if r[P3] in rowset(P1) goto P2 */ #define OP_Program 48 /* jump0 */ #define OP_FkIfZero 49 /* jump, synopsis: if fkctr[P1]==0 goto P2 */ | > | | | | | | | | | < | 16658 16659 16660 16661 16662 16663 16664 16665 16666 16667 16668 16669 16670 16671 16672 16673 16674 16675 16676 16677 16678 16679 16680 16681 | #define OP_Or 43 /* same as TK_OR, synopsis: r[P3]=(r[P1] || r[P2]) */ #define OP_And 44 /* same as TK_AND, synopsis: r[P3]=(r[P1] && r[P2]) */ #define OP_IdxGE 45 /* jump, synopsis: key=r[P3@P4] */ #define OP_RowSetRead 46 /* jump, synopsis: r[P3]=rowset(P1) */ #define OP_RowSetTest 47 /* jump, synopsis: if r[P3] in rowset(P1) goto P2 */ #define OP_Program 48 /* jump0 */ #define OP_FkIfZero 49 /* jump, synopsis: if fkctr[P1]==0 goto P2 */ #define OP_IfPos 50 /* jump, synopsis: if r[P1]>0 then r[P1]-=P3, goto P2 */ #define OP_IsNull 51 /* jump, same as TK_ISNULL, synopsis: if r[P1]==NULL goto P2 */ #define OP_NotNull 52 /* jump, same as TK_NOTNULL, synopsis: if r[P1]!=NULL goto P2 */ #define OP_Ne 53 /* jump, same as TK_NE, synopsis: IF r[P3]!=r[P1] */ #define OP_Eq 54 /* jump, same as TK_EQ, synopsis: IF r[P3]==r[P1] */ #define OP_Gt 55 /* jump, same as TK_GT, synopsis: IF r[P3]>r[P1] */ #define OP_Le 56 /* jump, same as TK_LE, synopsis: IF r[P3]<=r[P1] */ #define OP_Lt 57 /* jump, same as TK_LT, synopsis: IF r[P3]<r[P1] */ #define OP_Ge 58 /* jump, same as TK_GE, synopsis: IF r[P3]>=r[P1] */ #define OP_ElseEq 59 /* jump, same as TK_ESCAPE */ #define OP_IfNotZero 60 /* jump, synopsis: if r[P1]!=0 then r[P1]--, goto P2 */ #define OP_DecrJumpZero 61 /* jump, synopsis: if (--r[P1])==0 goto P2 */ #define OP_IncrVacuum 62 /* jump */ #define OP_VNext 63 /* jump */ #define OP_Filter 64 /* jump, synopsis: if key(P3@P4) not in filter(P1) goto P2 */ #define OP_PureFunc 65 /* synopsis: r[P3]=func(r[P2@NP]) */ #define OP_Function 66 /* synopsis: r[P3]=func(r[P2@NP]) */ |
︙ | ︙ | |||
16711 16712 16713 16714 16715 16716 16717 | #define OP_TypeCheck 95 /* synopsis: typecheck(r[P1@P2]) */ #define OP_Affinity 96 /* synopsis: affinity(r[P1@P2]) */ #define OP_MakeRecord 97 /* synopsis: r[P3]=mkrec(r[P1@P2]) */ #define OP_Count 98 /* synopsis: r[P2]=count() */ #define OP_ReadCookie 99 #define OP_SetCookie 100 #define OP_ReopenIdx 101 /* synopsis: root=P2 iDb=P3 */ | > | | | | | | | | | | < < | > < | > | 16710 16711 16712 16713 16714 16715 16716 16717 16718 16719 16720 16721 16722 16723 16724 16725 16726 16727 16728 16729 16730 16731 16732 16733 16734 16735 16736 16737 16738 16739 16740 | #define OP_TypeCheck 95 /* synopsis: typecheck(r[P1@P2]) */ #define OP_Affinity 96 /* synopsis: affinity(r[P1@P2]) */ #define OP_MakeRecord 97 /* synopsis: r[P3]=mkrec(r[P1@P2]) */ #define OP_Count 98 /* synopsis: r[P2]=count() */ #define OP_ReadCookie 99 #define OP_SetCookie 100 #define OP_ReopenIdx 101 /* synopsis: root=P2 iDb=P3 */ #define OP_OpenRead 102 /* synopsis: root=P2 iDb=P3 */ #define OP_BitAnd 103 /* same as TK_BITAND, synopsis: r[P3]=r[P1]&r[P2] */ #define OP_BitOr 104 /* same as TK_BITOR, synopsis: r[P3]=r[P1]|r[P2] */ #define OP_ShiftLeft 105 /* same as TK_LSHIFT, synopsis: r[P3]=r[P2]<<r[P1] */ #define OP_ShiftRight 106 /* same as TK_RSHIFT, synopsis: r[P3]=r[P2]>>r[P1] */ #define OP_Add 107 /* same as TK_PLUS, synopsis: r[P3]=r[P1]+r[P2] */ #define OP_Subtract 108 /* same as TK_MINUS, synopsis: r[P3]=r[P2]-r[P1] */ #define OP_Multiply 109 /* same as TK_STAR, synopsis: r[P3]=r[P1]*r[P2] */ #define OP_Divide 110 /* same as TK_SLASH, synopsis: r[P3]=r[P2]/r[P1] */ #define OP_Remainder 111 /* same as TK_REM, synopsis: r[P3]=r[P2]%r[P1] */ #define OP_Concat 112 /* same as TK_CONCAT, synopsis: r[P3]=r[P2]+r[P1] */ #define OP_OpenWrite 113 /* synopsis: root=P2 iDb=P3 */ #define OP_OpenDup 114 #define OP_BitNot 115 /* same as TK_BITNOT, synopsis: r[P2]= ~r[P1] */ #define OP_OpenAutoindex 116 /* synopsis: nColumn=P2 */ #define OP_OpenEphemeral 117 /* synopsis: nColumn=P2 */ #define OP_String8 118 /* same as TK_STRING, synopsis: r[P2]='P4' */ #define OP_SorterOpen 119 #define OP_SequenceTest 120 /* synopsis: if( cursor[P1].ctr++ ) pc = P2 */ #define OP_OpenPseudo 121 /* synopsis: P3 columns in r[P2] */ #define OP_Close 122 #define OP_ColumnsUsed 123 #define OP_SeekScan 124 /* synopsis: Scan-ahead up to P1 rows */ #define OP_SeekHit 125 /* synopsis: set P2<=seekHit<=P3 */ |
︙ | ︙ | |||
16762 16763 16764 16765 16766 16767 16768 | #define OP_ResetSorter 146 #define OP_CreateBtree 147 /* synopsis: r[P2]=root iDb=P1 flags=P3 */ #define OP_SqlExec 148 #define OP_ParseSchema 149 #define OP_LoadAnalysis 150 #define OP_DropTable 151 #define OP_DropIndex 152 | < | > | 16761 16762 16763 16764 16765 16766 16767 16768 16769 16770 16771 16772 16773 16774 16775 16776 | #define OP_ResetSorter 146 #define OP_CreateBtree 147 /* synopsis: r[P2]=root iDb=P1 flags=P3 */ #define OP_SqlExec 148 #define OP_ParseSchema 149 #define OP_LoadAnalysis 150 #define OP_DropTable 151 #define OP_DropIndex 152 #define OP_DropTrigger 153 #define OP_Real 154 /* same as TK_FLOAT, synopsis: r[P2]=P4 */ #define OP_IntegrityCk 155 #define OP_RowSetAdd 156 /* synopsis: rowset(P1)=r[P2] */ #define OP_Param 157 #define OP_FkCounter 158 /* synopsis: fkctr[P1]+=P2 */ #define OP_MemMax 159 /* synopsis: r[P1]=max(r[P1],r[P2]) */ #define OP_OffsetLimit 160 /* synopsis: if r[P1]>0 then r[P2]=r[P1]+max(0,r[P3]) else r[P2]=(-1) */ #define OP_AggInverse 161 /* synopsis: accum=r[P3] inverse(r[P2@P5]) */ |
︙ | ︙ | |||
16819 16820 16821 16822 16823 16824 16825 | #define OPFLG_INITIALIZER {\ /* 0 */ 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x41, 0x00,\ /* 8 */ 0x81, 0x01, 0x01, 0x81, 0x83, 0x83, 0x01, 0x01,\ /* 16 */ 0x03, 0x03, 0x01, 0x12, 0x01, 0xc9, 0xc9, 0xc9,\ /* 24 */ 0xc9, 0x01, 0x49, 0x49, 0x49, 0x49, 0xc9, 0x49,\ /* 32 */ 0xc1, 0x01, 0x41, 0x41, 0xc1, 0x01, 0x41, 0x41,\ /* 40 */ 0x41, 0x41, 0x41, 0x26, 0x26, 0x41, 0x23, 0x0b,\ | | | | | | | 16818 16819 16820 16821 16822 16823 16824 16825 16826 16827 16828 16829 16830 16831 16832 16833 16834 16835 16836 16837 16838 16839 16840 16841 16842 16843 16844 16845 | #define OPFLG_INITIALIZER {\ /* 0 */ 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x41, 0x00,\ /* 8 */ 0x81, 0x01, 0x01, 0x81, 0x83, 0x83, 0x01, 0x01,\ /* 16 */ 0x03, 0x03, 0x01, 0x12, 0x01, 0xc9, 0xc9, 0xc9,\ /* 24 */ 0xc9, 0x01, 0x49, 0x49, 0x49, 0x49, 0xc9, 0x49,\ /* 32 */ 0xc1, 0x01, 0x41, 0x41, 0xc1, 0x01, 0x41, 0x41,\ /* 40 */ 0x41, 0x41, 0x41, 0x26, 0x26, 0x41, 0x23, 0x0b,\ /* 48 */ 0x81, 0x01, 0x03, 0x03, 0x03, 0x0b, 0x0b, 0x0b,\ /* 56 */ 0x0b, 0x0b, 0x0b, 0x01, 0x03, 0x03, 0x01, 0x41,\ /* 64 */ 0x01, 0x00, 0x00, 0x02, 0x02, 0x08, 0x00, 0x10,\ /* 72 */ 0x10, 0x10, 0x00, 0x10, 0x00, 0x10, 0x10, 0x00,\ /* 80 */ 0x00, 0x10, 0x10, 0x00, 0x00, 0x00, 0x02, 0x02,\ /* 88 */ 0x02, 0x00, 0x00, 0x12, 0x1e, 0x20, 0x40, 0x00,\ /* 96 */ 0x00, 0x00, 0x10, 0x10, 0x00, 0x40, 0x40, 0x26,\ /* 104 */ 0x26, 0x26, 0x26, 0x26, 0x26, 0x26, 0x26, 0x26,\ /* 112 */ 0x26, 0x00, 0x40, 0x12, 0x40, 0x40, 0x10, 0x00,\ /* 120 */ 0x00, 0x00, 0x40, 0x00, 0x40, 0x40, 0x10, 0x10,\ /* 128 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x50,\ /* 136 */ 0x00, 0x40, 0x04, 0x04, 0x00, 0x40, 0x50, 0x40,\ /* 144 */ 0x10, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00,\ /* 152 */ 0x00, 0x00, 0x10, 0x00, 0x06, 0x10, 0x00, 0x04,\ /* 160 */ 0x1a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\ /* 168 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x10, 0x50,\ /* 176 */ 0x40, 0x00, 0x10, 0x10, 0x02, 0x12, 0x12, 0x00,\ /* 184 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,} /* The resolve3P2Values() routine is able to run faster if it knows ** the value of the largest JUMP opcode. The smaller the maximum |
︙ | ︙ | |||
17893 17894 17895 17896 17897 17898 17899 17900 17901 17902 17903 17904 17905 17906 | #define SQLITE_ReleaseReg 0x00400000 /* Use OP_ReleaseReg for testing */ #define SQLITE_FlttnUnionAll 0x00800000 /* Disable the UNION ALL flattener */ /* TH3 expects this value ^^^^^^^^^^ See flatten04.test */ #define SQLITE_IndexedExpr 0x01000000 /* Pull exprs from index when able */ #define SQLITE_Coroutines 0x02000000 /* Co-routines for subqueries */ #define SQLITE_NullUnusedCols 0x04000000 /* NULL unused columns in subqueries */ #define SQLITE_OnePass 0x08000000 /* Single-pass DELETE and UPDATE */ #define SQLITE_AllOpts 0xffffffff /* All optimizations */ /* ** Macros for testing whether or not optimizations are enabled or disabled. */ #define OptimizationDisabled(db, mask) (((db)->dbOptFlags&(mask))!=0) #define OptimizationEnabled(db, mask) (((db)->dbOptFlags&(mask))==0) | > | 17892 17893 17894 17895 17896 17897 17898 17899 17900 17901 17902 17903 17904 17905 17906 | #define SQLITE_ReleaseReg 0x00400000 /* Use OP_ReleaseReg for testing */ #define SQLITE_FlttnUnionAll 0x00800000 /* Disable the UNION ALL flattener */ /* TH3 expects this value ^^^^^^^^^^ See flatten04.test */ #define SQLITE_IndexedExpr 0x01000000 /* Pull exprs from index when able */ #define SQLITE_Coroutines 0x02000000 /* Co-routines for subqueries */ #define SQLITE_NullUnusedCols 0x04000000 /* NULL unused columns in subqueries */ #define SQLITE_OnePass 0x08000000 /* Single-pass DELETE and UPDATE */ #define SQLITE_ExistsToJoin 0x10000000 /* The EXISTS-to-JOIN optimization */ #define SQLITE_AllOpts 0xffffffff /* All optimizations */ /* ** Macros for testing whether or not optimizations are enabled or disabled. */ #define OptimizationDisabled(db, mask) (((db)->dbOptFlags&(mask))!=0) #define OptimizationEnabled(db, mask) (((db)->dbOptFlags&(mask))==0) |
︙ | ︙ | |||
19357 19358 19359 19360 19361 19362 19363 | #define WHERE_GROUPBY 0x0040 /* pOrderBy is really a GROUP BY */ #define WHERE_DISTINCTBY 0x0080 /* pOrderby is really a DISTINCT clause */ #define WHERE_WANT_DISTINCT 0x0100 /* All output needs to be distinct */ #define WHERE_SORTBYGROUP 0x0200 /* Support sqlite3WhereIsSorted() */ #define WHERE_AGG_DISTINCT 0x0400 /* Query is "SELECT agg(DISTINCT ...)" */ #define WHERE_ORDERBY_LIMIT 0x0800 /* ORDERBY+LIMIT on the inner loop */ #define WHERE_RIGHT_JOIN 0x1000 /* Processing a RIGHT JOIN */ | | | 19357 19358 19359 19360 19361 19362 19363 19364 19365 19366 19367 19368 19369 19370 19371 | #define WHERE_GROUPBY 0x0040 /* pOrderBy is really a GROUP BY */ #define WHERE_DISTINCTBY 0x0080 /* pOrderby is really a DISTINCT clause */ #define WHERE_WANT_DISTINCT 0x0100 /* All output needs to be distinct */ #define WHERE_SORTBYGROUP 0x0200 /* Support sqlite3WhereIsSorted() */ #define WHERE_AGG_DISTINCT 0x0400 /* Query is "SELECT agg(DISTINCT ...)" */ #define WHERE_ORDERBY_LIMIT 0x0800 /* ORDERBY+LIMIT on the inner loop */ #define WHERE_RIGHT_JOIN 0x1000 /* Processing a RIGHT JOIN */ #define WHERE_KEEP_ALL_JOINS 0x2000 /* Do not do the omit-noop-join opt */ #define WHERE_USE_LIMIT 0x4000 /* Use the LIMIT in cost estimates */ /* 0x8000 not currently used */ /* Allowed return values from sqlite3WhereIsDistinct() */ #define WHERE_DISTINCT_NOOP 0 /* DISTINCT keyword not used */ #define WHERE_DISTINCT_UNIQUE 1 /* No duplicates */ |
︙ | ︙ | |||
19429 19430 19431 19432 19433 19434 19435 | #define NC_SelfRef 0x00002e /* Combo: PartIdx, isCheck, GenCol, and IdxExpr */ #define NC_Subquery 0x000040 /* A subquery has been seen */ #define NC_UEList 0x000080 /* True if uNC.pEList is used */ #define NC_UAggInfo 0x000100 /* True if uNC.pAggInfo is used */ #define NC_UUpsert 0x000200 /* True if uNC.pUpsert is used */ #define NC_UBaseReg 0x000400 /* True if uNC.iBaseReg is used */ #define NC_MinMaxAgg 0x001000 /* min/max aggregates seen. See note above */ | | | 19429 19430 19431 19432 19433 19434 19435 19436 19437 19438 19439 19440 19441 19442 19443 | #define NC_SelfRef 0x00002e /* Combo: PartIdx, isCheck, GenCol, and IdxExpr */ #define NC_Subquery 0x000040 /* A subquery has been seen */ #define NC_UEList 0x000080 /* True if uNC.pEList is used */ #define NC_UAggInfo 0x000100 /* True if uNC.pAggInfo is used */ #define NC_UUpsert 0x000200 /* True if uNC.pUpsert is used */ #define NC_UBaseReg 0x000400 /* True if uNC.iBaseReg is used */ #define NC_MinMaxAgg 0x001000 /* min/max aggregates seen. See note above */ /* 0x002000 // available for reuse */ #define NC_AllowWin 0x004000 /* Window functions are allowed here */ #define NC_HasWin 0x008000 /* One or more window functions seen */ #define NC_IsDDL 0x010000 /* Resolving names in a CREATE statement */ #define NC_InAggFunc 0x020000 /* True if analyzing arguments to an agg func */ #define NC_FromDDL 0x040000 /* SQL text comes from sqlite_schema */ #define NC_NoSelect 0x080000 /* Do not descend into sub-selects */ #define NC_Where 0x100000 /* Processing WHERE clause of a SELECT */ |
︙ | ︙ | |||
19796 19797 19798 19799 19800 19801 19802 19803 19804 19805 19806 19807 19808 19809 | u8 mayAbort; /* True if statement may throw an ABORT exception */ u8 hasCompound; /* Need to invoke convertCompoundSelectToSubquery() */ u8 okConstFactor; /* OK to factor out constants */ u8 disableLookaside; /* Number of times lookaside has been disabled */ u8 prepFlags; /* SQLITE_PREPARE_* flags */ u8 withinRJSubrtn; /* Nesting level for RIGHT JOIN body subroutines */ u8 bHasWith; /* True if statement contains WITH */ #if defined(SQLITE_DEBUG) || defined(SQLITE_COVERAGE_TEST) u8 earlyCleanup; /* OOM inside sqlite3ParserAddCleanup() */ #endif #ifdef SQLITE_DEBUG u8 ifNotExists; /* Might be true if IF NOT EXISTS. Assert()s only */ #endif int nRangeReg; /* Size of the temporary register block */ | > | 19796 19797 19798 19799 19800 19801 19802 19803 19804 19805 19806 19807 19808 19809 19810 | u8 mayAbort; /* True if statement may throw an ABORT exception */ u8 hasCompound; /* Need to invoke convertCompoundSelectToSubquery() */ u8 okConstFactor; /* OK to factor out constants */ u8 disableLookaside; /* Number of times lookaside has been disabled */ u8 prepFlags; /* SQLITE_PREPARE_* flags */ u8 withinRJSubrtn; /* Nesting level for RIGHT JOIN body subroutines */ u8 bHasWith; /* True if statement contains WITH */ u8 bHasExists; /* Has a correlated "EXISTS (SELECT ....)" expression */ #if defined(SQLITE_DEBUG) || defined(SQLITE_COVERAGE_TEST) u8 earlyCleanup; /* OOM inside sqlite3ParserAddCleanup() */ #endif #ifdef SQLITE_DEBUG u8 ifNotExists; /* Might be true if IF NOT EXISTS. Assert()s only */ #endif int nRangeReg; /* Size of the temporary register block */ |
︙ | ︙ | |||
21057 21058 21059 21060 21061 21062 21063 | SQLITE_PRIVATE int sqlite3ExprIsConstant(Parse*,Expr*); SQLITE_PRIVATE int sqlite3ExprIsConstantOrFunction(Expr*, u8); SQLITE_PRIVATE int sqlite3ExprIsConstantOrGroupBy(Parse*, Expr*, ExprList*); SQLITE_PRIVATE int sqlite3ExprIsSingleTableConstraint(Expr*,const SrcList*,int,int); #ifdef SQLITE_ENABLE_CURSOR_HINTS SQLITE_PRIVATE int sqlite3ExprContainsSubquery(Expr*); #endif | | | 21058 21059 21060 21061 21062 21063 21064 21065 21066 21067 21068 21069 21070 21071 21072 | SQLITE_PRIVATE int sqlite3ExprIsConstant(Parse*,Expr*); SQLITE_PRIVATE int sqlite3ExprIsConstantOrFunction(Expr*, u8); SQLITE_PRIVATE int sqlite3ExprIsConstantOrGroupBy(Parse*, Expr*, ExprList*); SQLITE_PRIVATE int sqlite3ExprIsSingleTableConstraint(Expr*,const SrcList*,int,int); #ifdef SQLITE_ENABLE_CURSOR_HINTS SQLITE_PRIVATE int sqlite3ExprContainsSubquery(Expr*); #endif SQLITE_PRIVATE int sqlite3ExprIsInteger(const Expr*, int*, Parse*); SQLITE_PRIVATE int sqlite3ExprCanBeNull(const Expr*); SQLITE_PRIVATE int sqlite3ExprNeedsNoAffinityChange(const Expr*, char); SQLITE_PRIVATE int sqlite3IsRowid(const char*); SQLITE_PRIVATE const char *sqlite3RowidAlias(Table *pTab); SQLITE_PRIVATE void sqlite3GenerateRowDelete( Parse*,Table*,Trigger*,int,int,int,i16,u8,u8,u8,int); SQLITE_PRIVATE void sqlite3GenerateRowIndexDelete(Parse*, Table*, int, int, int*, int); |
︙ | ︙ | |||
24883 24884 24885 24886 24887 24888 24889 | float rLimit; /* Maximum NNN value for this transform */ float rXform; /* Constant used for this transform */ } aXformType[] = { /* 0 */ { 6, "second", 4.6427e+14, 1.0 }, /* 1 */ { 6, "minute", 7.7379e+12, 60.0 }, /* 2 */ { 4, "hour", 1.2897e+11, 3600.0 }, /* 3 */ { 3, "day", 5373485.0, 86400.0 }, | | | | 24884 24885 24886 24887 24888 24889 24890 24891 24892 24893 24894 24895 24896 24897 24898 24899 | float rLimit; /* Maximum NNN value for this transform */ float rXform; /* Constant used for this transform */ } aXformType[] = { /* 0 */ { 6, "second", 4.6427e+14, 1.0 }, /* 1 */ { 6, "minute", 7.7379e+12, 60.0 }, /* 2 */ { 4, "hour", 1.2897e+11, 3600.0 }, /* 3 */ { 3, "day", 5373485.0, 86400.0 }, /* 4 */ { 5, "month", 176546.0, 2592000.0 }, /* 5 */ { 4, "year", 14713.0, 31536000.0 }, }; /* ** If the DateTime p is raw number, try to figure out if it is ** a julian day number of a unix timestamp. Set the p value ** appropriately. */ |
︙ | ︙ | |||
35922 35923 35924 35925 35926 35927 35928 | return x; } /* ** Decode a floating-point value into an approximate decimal ** representation. ** | | > | < | > > > > > | 35923 35924 35925 35926 35927 35928 35929 35930 35931 35932 35933 35934 35935 35936 35937 35938 35939 35940 35941 35942 35943 35944 35945 35946 35947 35948 35949 35950 35951 35952 35953 35954 35955 35956 35957 | return x; } /* ** Decode a floating-point value into an approximate decimal ** representation. ** ** If iRound<=0 then round to -iRound significant digits to the ** the left of the decimal point, or to a maximum of mxRound total ** significant digits. ** ** If iRound>0 round to min(iRound,mxRound) significant digits total. ** ** mxRound must be positive. ** ** The significant digits of the decimal representation are ** stored in p->z[] which is a often (but not always) a pointer ** into the middle of p->zBuf[]. There are p->n significant digits. ** The p->z[] array is *not* zero-terminated. */ SQLITE_PRIVATE void sqlite3FpDecode(FpDecode *p, double r, int iRound, int mxRound){ int i; u64 v; int e, exp = 0; p->isSpecial = 0; p->z = p->zBuf; assert( mxRound>0 ); /* Convert negative numbers to positive. Deal with Infinity, 0.0, and ** NaN. */ if( r<0.0 ){ p->sign = '-'; r = -r; }else if( r==0.0 ){ |
︙ | ︙ | |||
37225 37226 37227 37228 37229 37230 37231 | /* 43 */ "Or" OpHelp("r[P3]=(r[P1] || r[P2])"), /* 44 */ "And" OpHelp("r[P3]=(r[P1] && r[P2])"), /* 45 */ "IdxGE" OpHelp("key=r[P3@P4]"), /* 46 */ "RowSetRead" OpHelp("r[P3]=rowset(P1)"), /* 47 */ "RowSetTest" OpHelp("if r[P3] in rowset(P1) goto P2"), /* 48 */ "Program" OpHelp(""), /* 49 */ "FkIfZero" OpHelp("if fkctr[P1]==0 goto P2"), | > | | | | | | | | | < | 37231 37232 37233 37234 37235 37236 37237 37238 37239 37240 37241 37242 37243 37244 37245 37246 37247 37248 37249 37250 37251 37252 37253 37254 | /* 43 */ "Or" OpHelp("r[P3]=(r[P1] || r[P2])"), /* 44 */ "And" OpHelp("r[P3]=(r[P1] && r[P2])"), /* 45 */ "IdxGE" OpHelp("key=r[P3@P4]"), /* 46 */ "RowSetRead" OpHelp("r[P3]=rowset(P1)"), /* 47 */ "RowSetTest" OpHelp("if r[P3] in rowset(P1) goto P2"), /* 48 */ "Program" OpHelp(""), /* 49 */ "FkIfZero" OpHelp("if fkctr[P1]==0 goto P2"), /* 50 */ "IfPos" OpHelp("if r[P1]>0 then r[P1]-=P3, goto P2"), /* 51 */ "IsNull" OpHelp("if r[P1]==NULL goto P2"), /* 52 */ "NotNull" OpHelp("if r[P1]!=NULL goto P2"), /* 53 */ "Ne" OpHelp("IF r[P3]!=r[P1]"), /* 54 */ "Eq" OpHelp("IF r[P3]==r[P1]"), /* 55 */ "Gt" OpHelp("IF r[P3]>r[P1]"), /* 56 */ "Le" OpHelp("IF r[P3]<=r[P1]"), /* 57 */ "Lt" OpHelp("IF r[P3]<r[P1]"), /* 58 */ "Ge" OpHelp("IF r[P3]>=r[P1]"), /* 59 */ "ElseEq" OpHelp(""), /* 60 */ "IfNotZero" OpHelp("if r[P1]!=0 then r[P1]--, goto P2"), /* 61 */ "DecrJumpZero" OpHelp("if (--r[P1])==0 goto P2"), /* 62 */ "IncrVacuum" OpHelp(""), /* 63 */ "VNext" OpHelp(""), /* 64 */ "Filter" OpHelp("if key(P3@P4) not in filter(P1) goto P2"), /* 65 */ "PureFunc" OpHelp("r[P3]=func(r[P2@NP])"), /* 66 */ "Function" OpHelp("r[P3]=func(r[P2@NP])"), |
︙ | ︙ | |||
37277 37278 37279 37280 37281 37282 37283 | /* 95 */ "TypeCheck" OpHelp("typecheck(r[P1@P2])"), /* 96 */ "Affinity" OpHelp("affinity(r[P1@P2])"), /* 97 */ "MakeRecord" OpHelp("r[P3]=mkrec(r[P1@P2])"), /* 98 */ "Count" OpHelp("r[P2]=count()"), /* 99 */ "ReadCookie" OpHelp(""), /* 100 */ "SetCookie" OpHelp(""), /* 101 */ "ReopenIdx" OpHelp("root=P2 iDb=P3"), | > | | | | | | | | | | < > | < < | > | 37283 37284 37285 37286 37287 37288 37289 37290 37291 37292 37293 37294 37295 37296 37297 37298 37299 37300 37301 37302 37303 37304 37305 37306 37307 37308 37309 37310 37311 37312 37313 | /* 95 */ "TypeCheck" OpHelp("typecheck(r[P1@P2])"), /* 96 */ "Affinity" OpHelp("affinity(r[P1@P2])"), /* 97 */ "MakeRecord" OpHelp("r[P3]=mkrec(r[P1@P2])"), /* 98 */ "Count" OpHelp("r[P2]=count()"), /* 99 */ "ReadCookie" OpHelp(""), /* 100 */ "SetCookie" OpHelp(""), /* 101 */ "ReopenIdx" OpHelp("root=P2 iDb=P3"), /* 102 */ "OpenRead" OpHelp("root=P2 iDb=P3"), /* 103 */ "BitAnd" OpHelp("r[P3]=r[P1]&r[P2]"), /* 104 */ "BitOr" OpHelp("r[P3]=r[P1]|r[P2]"), /* 105 */ "ShiftLeft" OpHelp("r[P3]=r[P2]<<r[P1]"), /* 106 */ "ShiftRight" OpHelp("r[P3]=r[P2]>>r[P1]"), /* 107 */ "Add" OpHelp("r[P3]=r[P1]+r[P2]"), /* 108 */ "Subtract" OpHelp("r[P3]=r[P2]-r[P1]"), /* 109 */ "Multiply" OpHelp("r[P3]=r[P1]*r[P2]"), /* 110 */ "Divide" OpHelp("r[P3]=r[P2]/r[P1]"), /* 111 */ "Remainder" OpHelp("r[P3]=r[P2]%r[P1]"), /* 112 */ "Concat" OpHelp("r[P3]=r[P2]+r[P1]"), /* 113 */ "OpenWrite" OpHelp("root=P2 iDb=P3"), /* 114 */ "OpenDup" OpHelp(""), /* 115 */ "BitNot" OpHelp("r[P2]= ~r[P1]"), /* 116 */ "OpenAutoindex" OpHelp("nColumn=P2"), /* 117 */ "OpenEphemeral" OpHelp("nColumn=P2"), /* 118 */ "String8" OpHelp("r[P2]='P4'"), /* 119 */ "SorterOpen" OpHelp(""), /* 120 */ "SequenceTest" OpHelp("if( cursor[P1].ctr++ ) pc = P2"), /* 121 */ "OpenPseudo" OpHelp("P3 columns in r[P2]"), /* 122 */ "Close" OpHelp(""), /* 123 */ "ColumnsUsed" OpHelp(""), /* 124 */ "SeekScan" OpHelp("Scan-ahead up to P1 rows"), /* 125 */ "SeekHit" OpHelp("set P2<=seekHit<=P3"), |
︙ | ︙ | |||
37328 37329 37330 37331 37332 37333 37334 | /* 146 */ "ResetSorter" OpHelp(""), /* 147 */ "CreateBtree" OpHelp("r[P2]=root iDb=P1 flags=P3"), /* 148 */ "SqlExec" OpHelp(""), /* 149 */ "ParseSchema" OpHelp(""), /* 150 */ "LoadAnalysis" OpHelp(""), /* 151 */ "DropTable" OpHelp(""), /* 152 */ "DropIndex" OpHelp(""), | > | < | 37334 37335 37336 37337 37338 37339 37340 37341 37342 37343 37344 37345 37346 37347 37348 37349 | /* 146 */ "ResetSorter" OpHelp(""), /* 147 */ "CreateBtree" OpHelp("r[P2]=root iDb=P1 flags=P3"), /* 148 */ "SqlExec" OpHelp(""), /* 149 */ "ParseSchema" OpHelp(""), /* 150 */ "LoadAnalysis" OpHelp(""), /* 151 */ "DropTable" OpHelp(""), /* 152 */ "DropIndex" OpHelp(""), /* 153 */ "DropTrigger" OpHelp(""), /* 154 */ "Real" OpHelp("r[P2]=P4"), /* 155 */ "IntegrityCk" OpHelp(""), /* 156 */ "RowSetAdd" OpHelp("rowset(P1)=r[P2]"), /* 157 */ "Param" OpHelp(""), /* 158 */ "FkCounter" OpHelp("fkctr[P1]+=P2"), /* 159 */ "MemMax" OpHelp("r[P1]=max(r[P1],r[P2])"), /* 160 */ "OffsetLimit" OpHelp("if r[P1]>0 then r[P2]=r[P1]+max(0,r[P3]) else r[P2]=(-1)"), /* 161 */ "AggInverse" OpHelp("accum=r[P3] inverse(r[P2@P5])"), |
︙ | ︙ | |||
42343 42344 42345 42346 42347 42348 42349 | }else{ pFile->ctrlFlags |= mask; } } /* Forward declaration */ static int unixGetTempname(int nBuf, char *zBuf); | | | 42349 42350 42351 42352 42353 42354 42355 42356 42357 42358 42359 42360 42361 42362 42363 | }else{ pFile->ctrlFlags |= mask; } } /* Forward declaration */ static int unixGetTempname(int nBuf, char *zBuf); #if !defined(SQLITE_WASI) && !defined(SQLITE_OMIT_WAL) static int unixFcntlExternalReader(unixFile*, int*); #endif /* ** Information and control of an open file handle. */ static int unixFileControl(sqlite3_file *id, int op, void *pArg){ |
︙ | ︙ | |||
42470 42471 42472 42473 42474 42475 42476 | case SQLITE_FCNTL_SET_LOCKPROXYFILE: case SQLITE_FCNTL_GET_LOCKPROXYFILE: { return proxyFileControl(id,op,pArg); } #endif /* SQLITE_ENABLE_LOCKING_STYLE && defined(__APPLE__) */ case SQLITE_FCNTL_EXTERNAL_READER: { | | | 42476 42477 42478 42479 42480 42481 42482 42483 42484 42485 42486 42487 42488 42489 42490 | case SQLITE_FCNTL_SET_LOCKPROXYFILE: case SQLITE_FCNTL_GET_LOCKPROXYFILE: { return proxyFileControl(id,op,pArg); } #endif /* SQLITE_ENABLE_LOCKING_STYLE && defined(__APPLE__) */ case SQLITE_FCNTL_EXTERNAL_READER: { #if !defined(SQLITE_WASI) && !defined(SQLITE_OMIT_WAL) return unixFcntlExternalReader((unixFile*)id, (int*)pArg); #else *(int*)pArg = 0; return SQLITE_OK; #endif } } |
︙ | ︙ | |||
42643 42644 42645 42646 42647 42648 42649 | #else return (int)sysconf(_SC_PAGESIZE); #endif } #endif /* !defined(SQLITE_OMIT_WAL) || SQLITE_MAX_MMAP_SIZE>0 */ | | | 42649 42650 42651 42652 42653 42654 42655 42656 42657 42658 42659 42660 42661 42662 42663 | #else return (int)sysconf(_SC_PAGESIZE); #endif } #endif /* !defined(SQLITE_OMIT_WAL) || SQLITE_MAX_MMAP_SIZE>0 */ #if !defined(SQLITE_WASI) && !defined(SQLITE_OMIT_WAL) /* ** Object used to represent an shared memory buffer. ** ** When multiple threads all reference the same wal-index, each thread ** has its own unixShm object, but they all point to a single instance ** of this unixShmNode object. In other words, each wal-index is opened |
︙ | ︙ | |||
102132 102133 102134 102135 102136 102137 102138 | } break; } #endif /* Opcode: Noop * * * * * ** | | < > | | > | > > > > > > > > > > > > > > | | | 102138 102139 102140 102141 102142 102143 102144 102145 102146 102147 102148 102149 102150 102151 102152 102153 102154 102155 102156 102157 102158 102159 102160 102161 102162 102163 102164 102165 102166 102167 102168 102169 102170 102171 102172 102173 102174 | } break; } #endif /* Opcode: Noop * * * * * ** ** Do nothing. Continue downward to the next opcode. */ /* Opcode: Explain P1 P2 P3 P4 * ** ** This is the same as OP_Noop during normal query execution. The ** purpose of this opcode is to hold information about the query ** plan for the purpose of EXPLAIN QUERY PLAN output. ** ** The P4 value is human-readable text that describes the query plan ** element. Something like "SCAN t1" or "SEARCH t2 USING INDEX t2x1". ** ** The P1 value is the ID of the current element and P2 is the parent ** element for the case of nested query plan elements. If P2 is zero ** then this element is a top-level element. ** ** For loop elements, P3 is the estimated code of each invocation of this ** element. ** ** As with all opcodes, the meanings of the parameters for OP_Explain ** are subject to change from one release to the next. Applications ** should not attempt to interpret or use any of the information ** contined in the OP_Explain opcode. The information provided by this ** opcode is intended for testing and debugging use only. */ default: { /* This is really OP_Noop, OP_Explain */ assert( pOp->opcode==OP_Noop || pOp->opcode==OP_Explain ); break; } |
︙ | ︙ | |||
106968 106969 106970 106971 106972 106973 106974 | /* ** Return TRUE (non-zero) if zTab is a valid name for the schema table pTab. */ static SQLITE_NOINLINE int isValidSchemaTableName( const char *zTab, /* Name as it appears in the SQL */ Table *pTab, /* The schema table we are trying to match */ | | | | 106989 106990 106991 106992 106993 106994 106995 106996 106997 106998 106999 107000 107001 107002 107003 107004 107005 107006 107007 107008 107009 107010 107011 107012 107013 107014 | /* ** Return TRUE (non-zero) if zTab is a valid name for the schema table pTab. */ static SQLITE_NOINLINE int isValidSchemaTableName( const char *zTab, /* Name as it appears in the SQL */ Table *pTab, /* The schema table we are trying to match */ const char *zDb /* non-NULL if a database qualifier is present */ ){ const char *zLegacy; assert( pTab!=0 ); assert( pTab->tnum==1 ); if( sqlite3StrNICmp(zTab, "sqlite_", 7)!=0 ) return 0; zLegacy = pTab->zName; if( strcmp(zLegacy+7, &LEGACY_TEMP_SCHEMA_TABLE[7])==0 ){ if( sqlite3StrICmp(zTab+7, &PREFERRED_TEMP_SCHEMA_TABLE[7])==0 ){ return 1; } if( zDb==0 ) return 0; if( sqlite3StrICmp(zTab+7, &LEGACY_SCHEMA_TABLE[7])==0 ) return 1; if( sqlite3StrICmp(zTab+7, &PREFERRED_SCHEMA_TABLE[7])==0 ) return 1; }else{ if( sqlite3StrICmp(zTab+7, &PREFERRED_SCHEMA_TABLE[7])==0 ) return 1; } return 0; } |
︙ | ︙ | |||
107162 107163 107164 107165 107166 107167 107168 | } if( pItem->zAlias!=0 ){ if( sqlite3StrICmp(zTab, pItem->zAlias)!=0 ){ continue; } }else if( sqlite3StrICmp(zTab, pTab->zName)!=0 ){ if( pTab->tnum!=1 ) continue; | | | 107183 107184 107185 107186 107187 107188 107189 107190 107191 107192 107193 107194 107195 107196 107197 | } if( pItem->zAlias!=0 ){ if( sqlite3StrICmp(zTab, pItem->zAlias)!=0 ){ continue; } }else if( sqlite3StrICmp(zTab, pTab->zName)!=0 ){ if( pTab->tnum!=1 ) continue; if( !isValidSchemaTableName(zTab, pTab, zDb) ) continue; } assert( ExprUseYTab(pExpr) ); if( IN_RENAME_OBJECT && pItem->zAlias ){ sqlite3RenameTokenRemap(pParse, 0, (void*)&pExpr->y.pTab); } } hCol = sqlite3StrIHash(zCol); |
︙ | ︙ | |||
108107 108108 108109 108110 108111 108112 108113 108114 108115 108116 108117 108118 108119 108120 | }else{ sqlite3WalkSelect(pWalker, pExpr->x.pSelect); } assert( pNC->nRef>=nRef ); if( nRef!=pNC->nRef ){ ExprSetProperty(pExpr, EP_VarSelect); pExpr->x.pSelect->selFlags |= SF_Correlated; } pNC->ncFlags |= NC_Subquery; } break; } case TK_VARIABLE: { testcase( pNC->ncFlags & NC_IsCheck ); | > | 108128 108129 108130 108131 108132 108133 108134 108135 108136 108137 108138 108139 108140 108141 108142 | }else{ sqlite3WalkSelect(pWalker, pExpr->x.pSelect); } assert( pNC->nRef>=nRef ); if( nRef!=pNC->nRef ){ ExprSetProperty(pExpr, EP_VarSelect); pExpr->x.pSelect->selFlags |= SF_Correlated; if( pExpr->op==TK_EXISTS ) pParse->bHasExists = 1; } pNC->ncFlags |= NC_Subquery; } break; } case TK_VARIABLE: { testcase( pNC->ncFlags & NC_IsCheck ); |
︙ | ︙ | |||
108245 108246 108247 108248 108249 108250 108251 | int i; /* Loop counter */ ExprList *pEList; /* The columns of the result set */ NameContext nc; /* Name context for resolving pE */ sqlite3 *db; /* Database connection */ int rc; /* Return code from subprocedures */ u8 savedSuppErr; /* Saved value of db->suppressErr */ | | | 108267 108268 108269 108270 108271 108272 108273 108274 108275 108276 108277 108278 108279 108280 108281 | int i; /* Loop counter */ ExprList *pEList; /* The columns of the result set */ NameContext nc; /* Name context for resolving pE */ sqlite3 *db; /* Database connection */ int rc; /* Return code from subprocedures */ u8 savedSuppErr; /* Saved value of db->suppressErr */ assert( sqlite3ExprIsInteger(pE, &i, 0)==0 ); pEList = pSelect->pEList; /* Resolve all names in the ORDER BY term expression */ memset(&nc, 0, sizeof(nc)); nc.pParse = pParse; nc.pSrcList = pSelect->pSrc; |
︙ | ︙ | |||
108344 108345 108346 108347 108348 108349 108350 | assert( pEList!=0 ); for(i=0, pItem=pOrderBy->a; i<pOrderBy->nExpr; i++, pItem++){ int iCol = -1; Expr *pE, *pDup; if( pItem->fg.done ) continue; pE = sqlite3ExprSkipCollateAndLikely(pItem->pExpr); if( NEVER(pE==0) ) continue; | | | 108366 108367 108368 108369 108370 108371 108372 108373 108374 108375 108376 108377 108378 108379 108380 | assert( pEList!=0 ); for(i=0, pItem=pOrderBy->a; i<pOrderBy->nExpr; i++, pItem++){ int iCol = -1; Expr *pE, *pDup; if( pItem->fg.done ) continue; pE = sqlite3ExprSkipCollateAndLikely(pItem->pExpr); if( NEVER(pE==0) ) continue; if( sqlite3ExprIsInteger(pE, &iCol, 0) ){ if( iCol<=0 || iCol>pEList->nExpr ){ resolveOutOfRangeError(pParse, "ORDER", i+1, pEList->nExpr, pE); return 1; } }else{ iCol = resolveAsName(pParse, pEList, pE); if( iCol==0 ){ |
︙ | ︙ | |||
108529 108530 108531 108532 108533 108534 108535 | ** a copy of the iCol-th result-set column. The subsequent call to ** sqlite3ResolveOrderGroupBy() will convert the expression to a ** copy of the iCol-th result-set expression. */ pItem->u.x.iOrderByCol = (u16)iCol; continue; } } | | | 108551 108552 108553 108554 108555 108556 108557 108558 108559 108560 108561 108562 108563 108564 108565 | ** a copy of the iCol-th result-set column. The subsequent call to ** sqlite3ResolveOrderGroupBy() will convert the expression to a ** copy of the iCol-th result-set expression. */ pItem->u.x.iOrderByCol = (u16)iCol; continue; } } if( sqlite3ExprIsInteger(pE2, &iCol, 0) ){ /* The ORDER BY term is an integer constant. Again, set the column ** number so that sqlite3ResolveOrderGroupBy() will convert the ** order-by term to a copy of the result-set expression */ if( iCol<1 || iCol>0xffff ){ resolveOutOfRangeError(pParse, zType, i+1, nResult, pE2); return 1; } |
︙ | ︙ | |||
111813 111814 111815 111816 111817 111818 111819 111820 | #endif /* ** If the expression p codes a constant integer that is small enough ** to fit in a 32-bit integer, return 1 and put the value of the integer ** in *pValue. If the expression is not an integer or if it is too big ** to fit in a signed 32-bit integer, return 0 and leave *pValue unchanged. */ | > > > > | | | > > > > > > > > > > > > > > > > > > > > | 111835 111836 111837 111838 111839 111840 111841 111842 111843 111844 111845 111846 111847 111848 111849 111850 111851 111852 111853 111854 111855 111856 111857 111858 111859 111860 111861 111862 111863 111864 111865 111866 111867 111868 111869 111870 111871 111872 111873 111874 111875 111876 111877 111878 111879 111880 111881 111882 111883 111884 111885 111886 111887 111888 111889 111890 111891 111892 111893 111894 111895 111896 111897 111898 111899 | #endif /* ** If the expression p codes a constant integer that is small enough ** to fit in a 32-bit integer, return 1 and put the value of the integer ** in *pValue. If the expression is not an integer or if it is too big ** to fit in a signed 32-bit integer, return 0 and leave *pValue unchanged. ** ** If the pParse pointer is provided, then allow the expression p to be ** a parameter (TK_VARIABLE) that is bound to an integer. ** But if pParse is NULL, then p must be a pure integer literal. */ SQLITE_PRIVATE int sqlite3ExprIsInteger(const Expr *p, int *pValue, Parse *pParse){ int rc = 0; if( NEVER(p==0) ) return 0; /* Used to only happen following on OOM */ /* If an expression is an integer literal that fits in a signed 32-bit ** integer, then the EP_IntValue flag will have already been set */ assert( p->op!=TK_INTEGER || (p->flags & EP_IntValue)!=0 || sqlite3GetInt32(p->u.zToken, &rc)==0 ); if( p->flags & EP_IntValue ){ *pValue = p->u.iValue; return 1; } switch( p->op ){ case TK_UPLUS: { rc = sqlite3ExprIsInteger(p->pLeft, pValue, 0); break; } case TK_UMINUS: { int v = 0; if( sqlite3ExprIsInteger(p->pLeft, &v, 0) ){ assert( ((unsigned int)v)!=0x80000000 ); *pValue = -v; rc = 1; } break; } case TK_VARIABLE: { sqlite3_value *pVal; if( pParse==0 ) break; if( NEVER(pParse->pVdbe==0) ) break; if( (pParse->db->flags & SQLITE_EnableQPSG)!=0 ) break; sqlite3VdbeSetVarmask(pParse->pVdbe, p->iColumn); pVal = sqlite3VdbeGetBoundValue(pParse->pReprepare, p->iColumn, SQLITE_AFF_BLOB); if( pVal ){ if( sqlite3_value_type(pVal)==SQLITE_INTEGER ){ sqlite3_int64 vv = sqlite3_value_int64(pVal); if( vv == (vv & 0x7fffffff) ){ /* non-negative numbers only */ *pValue = (int)vv; rc = 1; } } sqlite3ValueFree(pVal); } break; } default: break; } return rc; } /* |
︙ | ︙ | |||
126428 126429 126430 126431 126432 126433 126434 | /* ** Append the contents of SrcList p2 to SrcList p1 and return the resulting ** SrcList. Or, if an error occurs, return NULL. In all cases, p1 and p2 ** are deleted by this function. */ SQLITE_PRIVATE SrcList *sqlite3SrcListAppendList(Parse *pParse, SrcList *p1, SrcList *p2){ | | > | | > > | 126474 126475 126476 126477 126478 126479 126480 126481 126482 126483 126484 126485 126486 126487 126488 126489 126490 126491 126492 126493 126494 126495 126496 126497 126498 | /* ** Append the contents of SrcList p2 to SrcList p1 and return the resulting ** SrcList. Or, if an error occurs, return NULL. In all cases, p1 and p2 ** are deleted by this function. */ SQLITE_PRIVATE SrcList *sqlite3SrcListAppendList(Parse *pParse, SrcList *p1, SrcList *p2){ assert( p1 ); if( p2 ){ int nOld = p1->nSrc; SrcList *pNew = sqlite3SrcListEnlarge(pParse, p1, p2->nSrc, nOld); if( pNew==0 ){ sqlite3SrcListDelete(pParse->db, p2); }else{ p1 = pNew; memcpy(&p1->a[nOld], p2->a, p2->nSrc*sizeof(SrcItem)); assert( nOld==1 || (p2->nSrc==1 && (p2->a[0].fg.jointype&JT_LTORJ)==0) ); assert( p1->nSrc>=2 ); sqlite3DbFree(pParse->db, p2); p1->a[0].fg.jointype |= (JT_LTORJ & p1->a[1].fg.jointype); } } return p1; } |
︙ | ︙ | |||
131207 131208 131209 131210 131211 131212 131213 131214 131215 131216 131217 131218 131219 131220 | int y, z; char zBuf[100]; UNUSED_PARAMETER(argc); assert( argc==3 ); x = sqlite3_value_double(argv[0]); y = sqlite3_value_int(argv[1]); z = sqlite3_value_int(argv[2]); sqlite3FpDecode(&s, x, y, z); if( s.isSpecial==2 ){ sqlite3_snprintf(sizeof(zBuf), zBuf, "NaN"); }else{ sqlite3_snprintf(sizeof(zBuf), zBuf, "%c%.*s/%d", s.sign, s.n, s.z, s.iDP); } sqlite3_result_text(context, zBuf, -1, SQLITE_TRANSIENT); | > | 131256 131257 131258 131259 131260 131261 131262 131263 131264 131265 131266 131267 131268 131269 131270 | int y, z; char zBuf[100]; UNUSED_PARAMETER(argc); assert( argc==3 ); x = sqlite3_value_double(argv[0]); y = sqlite3_value_int(argv[1]); z = sqlite3_value_int(argv[2]); if( z<=0 ) z = 1; sqlite3FpDecode(&s, x, y, z); if( s.isSpecial==2 ){ sqlite3_snprintf(sizeof(zBuf), zBuf, "NaN"); }else{ sqlite3_snprintf(sizeof(zBuf), zBuf, "%c%.*s/%d", s.sign, s.n, s.z, s.iDP); } sqlite3_result_text(context, zBuf, -1, SQLITE_TRANSIENT); |
︙ | ︙ | |||
145395 145396 145397 145398 145399 145400 145401 | */ if( pLimit ){ assert( pLimit->op==TK_LIMIT ); assert( pLimit->pLeft!=0 ); p->iLimit = iLimit = ++pParse->nMem; v = sqlite3GetVdbe(pParse); assert( v!=0 ); | | | 145445 145446 145447 145448 145449 145450 145451 145452 145453 145454 145455 145456 145457 145458 145459 | */ if( pLimit ){ assert( pLimit->op==TK_LIMIT ); assert( pLimit->pLeft!=0 ); p->iLimit = iLimit = ++pParse->nMem; v = sqlite3GetVdbe(pParse); assert( v!=0 ); if( sqlite3ExprIsInteger(pLimit->pLeft, &n, pParse) ){ sqlite3VdbeAddOp2(v, OP_Integer, n, iLimit); VdbeComment((v, "LIMIT counter")); if( n==0 ){ sqlite3VdbeGoto(v, iBreak); }else if( n>=0 && p->nSelectRow>sqlite3LogEst((u64)n) ){ p->nSelectRow = sqlite3LogEst((u64)n); p->selFlags |= SF_FixedLimit; |
︙ | ︙ | |||
145875 145876 145877 145878 145879 145880 145881 | TREETRACE(0x200, pParse, p, ("multiSelect UNION ALL right...\n")); rc = sqlite3Select(pParse, p, &dest); testcase( rc!=SQLITE_OK ); pDelete = p->pPrior; p->pPrior = pPrior; p->nSelectRow = sqlite3LogEstAdd(p->nSelectRow, pPrior->nSelectRow); if( p->pLimit | | | 145925 145926 145927 145928 145929 145930 145931 145932 145933 145934 145935 145936 145937 145938 145939 | TREETRACE(0x200, pParse, p, ("multiSelect UNION ALL right...\n")); rc = sqlite3Select(pParse, p, &dest); testcase( rc!=SQLITE_OK ); pDelete = p->pPrior; p->pPrior = pPrior; p->nSelectRow = sqlite3LogEstAdd(p->nSelectRow, pPrior->nSelectRow); if( p->pLimit && sqlite3ExprIsInteger(p->pLimit->pLeft, &nLimit, pParse) && nLimit>0 && p->nSelectRow > sqlite3LogEst((u64)nLimit) ){ p->nSelectRow = sqlite3LogEst((u64)nLimit); } if( addr ){ sqlite3VdbeJumpHere(v, addr); } |
︙ | ︙ | |||
150185 150186 150187 150188 150189 150190 150191 150192 150193 150194 150195 150196 150197 150198 | if( i==0 ) break; i--; pItem--; if( pItem->pSelect!=0 ) return 0; /* (1c-i) */ } return 1; } /* ** Generate code for the SELECT statement given in the p argument. ** ** The results are returned according to the SelectDest structure. ** See comments in sqliteInt.h for further information. ** | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 150235 150236 150237 150238 150239 150240 150241 150242 150243 150244 150245 150246 150247 150248 150249 150250 150251 150252 150253 150254 150255 150256 150257 150258 150259 150260 150261 150262 150263 150264 150265 150266 150267 150268 150269 150270 150271 150272 150273 150274 150275 150276 150277 150278 150279 150280 150281 150282 150283 150284 150285 150286 150287 150288 150289 150290 150291 150292 150293 150294 150295 150296 150297 150298 150299 150300 150301 150302 150303 150304 150305 150306 150307 150308 150309 150310 150311 150312 150313 150314 150315 150316 150317 150318 150319 150320 150321 150322 150323 150324 150325 150326 150327 150328 150329 150330 150331 150332 150333 150334 150335 150336 150337 150338 150339 150340 150341 150342 150343 150344 150345 150346 150347 150348 150349 150350 150351 150352 150353 150354 150355 150356 150357 150358 150359 150360 150361 150362 150363 150364 150365 150366 150367 150368 150369 150370 150371 150372 150373 150374 150375 150376 150377 150378 150379 150380 150381 150382 150383 150384 150385 150386 150387 150388 150389 150390 150391 150392 150393 150394 150395 150396 150397 150398 150399 150400 | if( i==0 ) break; i--; pItem--; if( pItem->pSelect!=0 ) return 0; /* (1c-i) */ } return 1; } /* ** sqlite3WalkExpr() callback used by exprReferencesTable(). */ static int exprReferencesTableExprCb(Walker *pWalker, Expr *pExpr){ if( pExpr->op==TK_COLUMN && pExpr->iTable==pWalker->u.iCur ){ pWalker->eCode = 1; } return WRC_Continue; } /* ** Return true if the expression passed as the first argument refers ** to cursor number iCur. Otherwise return false. */ static int exprReferencesTable(Expr *pExpr, int iCur){ Walker w; memset(&w, 0, sizeof(w)); w.u.iCur = iCur; w.xExprCallback = exprReferencesTableExprCb; w.xSelectCallback = sqlite3SelectWalkNoop; sqlite3WalkExpr(&w, pExpr); return w.eCode; } /* ** Index pIdx is a UNIQUE index on the table accessed by cursor number ** iCsr. This function returns a mask of the index columns that are ** constrained to match a single, non-NULL value by the WHERE clause ** passed as the 4th argument. For example, if the index is: ** ** CREATE UNIQUE INDEX idx ON tbl(a, b, c); ** ** and pWhere: ** ** WHERE a=? AND c=? ** ** then this function returns 5. */ static u64 findConstIdxTerms( Parse *pParse, int iCsr, Index *pIdx, Expr *pWhere ){ u64 m = 0; if( pWhere->op==TK_AND ){ m = findConstIdxTerms(pParse, iCsr, pIdx, pWhere->pLeft); m |= findConstIdxTerms(pParse, iCsr, pIdx, pWhere->pRight); }else if( pWhere->op==TK_EQ ){ Expr *pLeft = sqlite3ExprSkipCollateAndLikely(pWhere->pLeft); Expr *pRight = sqlite3ExprSkipCollateAndLikely(pWhere->pRight); if( pRight->op==TK_COLUMN && pRight->iTable==iCsr ){ SWAP(Expr*, pLeft, pRight); } if( pLeft->op==TK_COLUMN && pLeft->iTable==iCsr && exprReferencesTable(pRight, iCsr)==0 ){ if( pIdx ){ int ii; for(ii=0; ii<pIdx->nKeyCol; ii++){ assert( pIdx->azColl[ii] ); if( pLeft->iColumn==pIdx->aiColumn[ii] ){ CollSeq *pColl = sqlite3ExprCompareCollSeq(pParse, pWhere); if( pColl && sqlite3StrICmp(pColl->zName, pIdx->azColl[ii])==0 ){ m |= ((u64)1 << ii); break; } } } }else{ if( pLeft->iColumn<0 ) m = 1; } } } return m; } /* ** Argument pWhere is the WHERE clause belonging to SELECT statement p. This ** function attempts to transform expressions of the form: ** ** EXISTS (SELECT ...) ** ** into joins. For example, given ** ** CREATE TABLE sailors(sid INTEGER PRIMARY KEY, name TEXT); ** CREATE TABLE reserves(sid INT, day DATE, PRIMARY KEY(sid, day)); ** ** SELECT name FROM sailors AS S WHERE EXISTS ( ** SELECT * FROM reserves AS R WHERE S.sid = R.sid AND R.day = '2022-10-25' ** ); ** ** the SELECT statement may be transformed as follows: ** ** SELECT name FROM sailors AS S, reserves AS R ** WHERE S.sid = R.sid AND R.day = '2022-10-25'; */ static void existsToJoin(Parse *pParse, Select *p, Expr *pWhere){ if( pWhere && p->pSrc->nSrc>0 && pParse->db->mallocFailed==0 ){ if( pWhere->op==TK_AND ){ Expr *pRight = pWhere->pRight; existsToJoin(pParse, p, pWhere->pLeft); existsToJoin(pParse, p, pRight); } else if( pWhere->op==TK_EXISTS ){ Select *pSub = pWhere->x.pSelect; if( pSub->pSrc->nSrc==1 && (pSub->selFlags & (SF_Aggregate|SF_Correlated))==SF_Correlated && pSub->pWhere ){ int bTransform = 0; /* True if EXISTS can be made into join */ Table *pTab = pSub->pSrc->a[0].pTab; int iCsr = pSub->pSrc->a[0].iCursor; Index *pIdx; if( HasRowid(pTab) && findConstIdxTerms(pParse, iCsr, 0,pSub->pWhere) ){ bTransform = 1; } for(pIdx=pTab->pIndex; pIdx && bTransform==0; pIdx=pIdx->pNext){ if( pIdx->onError && pIdx->nKeyCol<=63 ){ u64 c = findConstIdxTerms(pParse, iCsr, pIdx, pSub->pWhere); if( c==((u64)1 << pIdx->nKeyCol)-1 ){ bTransform = 1; } } } if( bTransform ){ memset(pWhere, 0, sizeof(*pWhere)); pWhere->op = TK_INTEGER; pWhere->u.iValue = 1; ExprSetProperty(pWhere, EP_IntValue); assert( p->pWhere!=0 ); p->pSrc = sqlite3SrcListAppendList(pParse, p->pSrc, pSub->pSrc); p->pWhere = sqlite3PExpr(pParse, TK_AND, p->pWhere, pSub->pWhere); pSub->pWhere = 0; pSub->pSrc = 0; sqlite3ParserAddCleanup(pParse, sqlite3SelectDeleteGeneric, pSub); #if TREETRACE_ENABLED if( sqlite3TreeTrace & 0x100000 ){ TREETRACE(0x100000,pParse,p, ("After EXISTS-to-JOIN optimization:\n")); sqlite3TreeViewSelect(0, p, 0); } #endif } } } } } /* ** Generate code for the SELECT statement given in the p argument. ** ** The results are returned according to the SelectDest structure. ** See comments in sqliteInt.h for further information. ** |
︙ | ︙ | |||
150511 150512 150513 150514 150515 150516 150517 150518 150519 150520 150521 150522 150523 150524 | sqlite3TreeViewSelect(0, p, 0); } #endif if( p->pNext==0 ) ExplainQueryPlanPop(pParse); return rc; } #endif /* Do the WHERE-clause constant propagation optimization if this is ** a join. No need to speed time on this operation for non-join queries ** as the equivalent optimization will be handled by query planner in ** sqlite3WhereBegin(). */ if( p->pWhere!=0 | > > > > > > > | 150713 150714 150715 150716 150717 150718 150719 150720 150721 150722 150723 150724 150725 150726 150727 150728 150729 150730 150731 150732 150733 | sqlite3TreeViewSelect(0, p, 0); } #endif if( p->pNext==0 ) ExplainQueryPlanPop(pParse); return rc; } #endif /* If there may be an "EXISTS (SELECT ...)" in the WHERE clause, attempt ** to change it into a join. */ if( pParse->bHasExists && OptimizationEnabled(db,SQLITE_ExistsToJoin) ){ existsToJoin(pParse, p, p->pWhere); pTabList = p->pSrc; } /* Do the WHERE-clause constant propagation optimization if this is ** a join. No need to speed time on this operation for non-join queries ** as the equivalent optimization will be handled by query planner in ** sqlite3WhereBegin(). */ if( p->pWhere!=0 |
︙ | ︙ | |||
151234 151235 151236 151237 151238 151239 151240 | sqlite3VdbeAddOp3(v, OP_Column, sortPTab, j, iBMem+j); }else{ pAggInfo->directMode = 1; sqlite3ExprCode(pParse, pGroupBy->a[j].pExpr, iBMem+j); } if( iOrderByCol ){ | > > > | > | 151443 151444 151445 151446 151447 151448 151449 151450 151451 151452 151453 151454 151455 151456 151457 151458 151459 151460 151461 | sqlite3VdbeAddOp3(v, OP_Column, sortPTab, j, iBMem+j); }else{ pAggInfo->directMode = 1; sqlite3ExprCode(pParse, pGroupBy->a[j].pExpr, iBMem+j); } if( iOrderByCol ){ Expr *pX = p->pEList->a[iOrderByCol-1].pExpr; Expr *pBase = sqlite3ExprSkipCollateAndLikely(pX); if( ALWAYS(pBase!=0) && pBase->op!=TK_AGG_COLUMN ){ sqlite3ExprToRegister(pX, iAMem+j); } } } sqlite3VdbeAddOp4(v, OP_Compare, iAMem, iBMem, pGroupBy->nExpr, (char*)sqlite3KeyInfoRef(pKeyInfo), P4_KEYINFO); addr1 = sqlite3VdbeCurrentAddr(v); sqlite3VdbeAddOp3(v, OP_Jump, addr1+1, 0, addr1+1); VdbeCoverage(v); |
︙ | ︙ | |||
157656 157657 157658 157659 157660 157661 157662 | }else{ sqlite3_str_append(&str, " (~1 row)", 9); } #endif zMsg = sqlite3StrAccumFinish(&str); sqlite3ExplainBreakpoint("",zMsg); ret = sqlite3VdbeAddOp4(v, OP_Explain, sqlite3VdbeCurrentAddr(v), | | > | 157869 157870 157871 157872 157873 157874 157875 157876 157877 157878 157879 157880 157881 157882 157883 157884 | }else{ sqlite3_str_append(&str, " (~1 row)", 9); } #endif zMsg = sqlite3StrAccumFinish(&str); sqlite3ExplainBreakpoint("",zMsg); ret = sqlite3VdbeAddOp4(v, OP_Explain, sqlite3VdbeCurrentAddr(v), pParse->addrExplain, pLoop->rRun, zMsg, P4_DYNAMIC); } return ret; } /* ** Add a single OP_Explain opcode that describes a Bloom filter. ** |
︙ | ︙ | |||
158040 158041 158042 158043 158044 158045 158046 158047 158048 158049 158050 158051 158052 158053 | sqlite3TreeViewExpr(0, pNew, 0); #endif } } return pNew; } /* ** Generate code for a single equality term of the WHERE clause. An equality ** term can be either X=expr or X IN (...). pTerm is the term to be ** coded. ** ** The current value for the constraint is left in a register, the index | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 158254 158255 158256 158257 158258 158259 158260 158261 158262 158263 158264 158265 158266 158267 158268 158269 158270 158271 158272 158273 158274 158275 158276 158277 158278 158279 158280 158281 158282 158283 158284 158285 158286 158287 158288 158289 158290 158291 158292 158293 158294 158295 158296 158297 158298 158299 158300 158301 158302 158303 158304 158305 158306 158307 158308 158309 158310 158311 158312 158313 158314 158315 158316 158317 158318 158319 158320 158321 158322 158323 158324 158325 158326 158327 158328 158329 158330 158331 158332 158333 158334 158335 158336 158337 158338 158339 158340 158341 158342 158343 158344 158345 158346 158347 158348 158349 158350 158351 158352 158353 158354 158355 158356 158357 158358 158359 158360 158361 158362 158363 158364 158365 158366 158367 158368 158369 158370 158371 158372 158373 158374 158375 158376 158377 158378 158379 158380 158381 158382 158383 158384 158385 158386 158387 158388 158389 158390 158391 158392 158393 158394 158395 158396 158397 158398 158399 158400 158401 158402 158403 158404 158405 158406 158407 158408 | sqlite3TreeViewExpr(0, pNew, 0); #endif } } return pNew; } #ifndef SQLITE_OMIT_SUBQUERY /* ** Generate code for a single X IN (....) term of the WHERE clause. ** ** This is a special-case of codeEqualityTerm() that works for IN operators ** only. It is broken out into a subroutine because this case is ** uncommon and by splitting it off into a subroutine, the common case ** runs faster. ** ** The current value for the constraint is left in register iTarget. ** This routine sets up a loop that will iterate over all values of X. */ static SQLITE_NOINLINE void codeINTerm( Parse *pParse, /* The parsing context */ WhereTerm *pTerm, /* The term of the WHERE clause to be coded */ WhereLevel *pLevel, /* The level of the FROM clause we are working on */ int iEq, /* Index of the equality term within this level */ int bRev, /* True for reverse-order IN operations */ int iTarget /* Attempt to leave results in this register */ ){ Expr *pX = pTerm->pExpr; int eType = IN_INDEX_NOOP; int iTab; struct InLoop *pIn; WhereLoop *pLoop = pLevel->pWLoop; Vdbe *v = pParse->pVdbe; int i; int nEq = 0; int *aiMap = 0; if( (pLoop->wsFlags & WHERE_VIRTUALTABLE)==0 && pLoop->u.btree.pIndex!=0 && pLoop->u.btree.pIndex->aSortOrder[iEq] ){ testcase( iEq==0 ); testcase( bRev ); bRev = !bRev; } assert( pX->op==TK_IN ); for(i=0; i<iEq; i++){ if( pLoop->aLTerm[i] && pLoop->aLTerm[i]->pExpr==pX ){ disableTerm(pLevel, pTerm); return; } } for(i=iEq;i<pLoop->nLTerm; i++){ assert( pLoop->aLTerm[i]!=0 ); if( pLoop->aLTerm[i]->pExpr==pX ) nEq++; } iTab = 0; if( !ExprUseXSelect(pX) || pX->x.pSelect->pEList->nExpr==1 ){ eType = sqlite3FindInIndex(pParse, pX, IN_INDEX_LOOP, 0, 0, &iTab); }else{ Expr *pExpr = pTerm->pExpr; if( pExpr->iTable==0 || !ExprHasProperty(pExpr, EP_Subrtn) ){ sqlite3 *db = pParse->db; pX = removeUnindexableInClauseTerms(pParse, iEq, pLoop, pX); if( !db->mallocFailed ){ aiMap = (int*)sqlite3DbMallocZero(pParse->db, sizeof(int)*nEq); eType = sqlite3FindInIndex(pParse, pX, IN_INDEX_LOOP, 0, aiMap,&iTab); pExpr->iTable = iTab; } sqlite3ExprDelete(db, pX); }else{ int n = sqlite3ExprVectorSize(pX->pLeft); aiMap = (int*)sqlite3DbMallocZero(pParse->db, sizeof(int)*MAX(nEq,n)); eType = sqlite3FindInIndex(pParse, pX, IN_INDEX_LOOP, 0, aiMap, &iTab); } pX = pExpr; } if( eType==IN_INDEX_INDEX_DESC ){ testcase( bRev ); bRev = !bRev; } sqlite3VdbeAddOp2(v, bRev ? OP_Last : OP_Rewind, iTab, 0); VdbeCoverageIf(v, bRev); VdbeCoverageIf(v, !bRev); assert( (pLoop->wsFlags & WHERE_MULTI_OR)==0 ); pLoop->wsFlags |= WHERE_IN_ABLE; if( pLevel->u.in.nIn==0 ){ pLevel->addrNxt = sqlite3VdbeMakeLabel(pParse); } if( iEq>0 && (pLoop->wsFlags & WHERE_IN_SEEKSCAN)==0 ){ pLoop->wsFlags |= WHERE_IN_EARLYOUT; } i = pLevel->u.in.nIn; pLevel->u.in.nIn += nEq; pLevel->u.in.aInLoop = sqlite3WhereRealloc(pTerm->pWC->pWInfo, pLevel->u.in.aInLoop, sizeof(pLevel->u.in.aInLoop[0])*pLevel->u.in.nIn); pIn = pLevel->u.in.aInLoop; if( pIn ){ int iMap = 0; /* Index in aiMap[] */ pIn += i; for(i=iEq;i<pLoop->nLTerm; i++){ if( pLoop->aLTerm[i]->pExpr==pX ){ int iOut = iTarget + i - iEq; if( eType==IN_INDEX_ROWID ){ pIn->addrInTop = sqlite3VdbeAddOp2(v, OP_Rowid, iTab, iOut); }else{ int iCol = aiMap ? aiMap[iMap++] : 0; pIn->addrInTop = sqlite3VdbeAddOp3(v,OP_Column,iTab, iCol, iOut); } sqlite3VdbeAddOp1(v, OP_IsNull, iOut); VdbeCoverage(v); if( i==iEq ){ pIn->iCur = iTab; pIn->eEndLoopOp = bRev ? OP_Prev : OP_Next; if( iEq>0 ){ pIn->iBase = iTarget - i; pIn->nPrefix = i; }else{ pIn->nPrefix = 0; } }else{ pIn->eEndLoopOp = OP_Noop; } pIn++; } } testcase( iEq>0 && (pLoop->wsFlags & WHERE_IN_SEEKSCAN)==0 && (pLoop->wsFlags & WHERE_VIRTUALTABLE)!=0 ); if( iEq>0 && (pLoop->wsFlags & (WHERE_IN_SEEKSCAN|WHERE_VIRTUALTABLE))==0 ){ sqlite3VdbeAddOp3(v, OP_SeekHit, pLevel->iIdxCur, 0, iEq); } }else{ pLevel->u.in.nIn = 0; } sqlite3DbFree(pParse->db, aiMap); } #endif /* ** Generate code for a single equality term of the WHERE clause. An equality ** term can be either X=expr or X IN (...). pTerm is the term to be ** coded. ** ** The current value for the constraint is left in a register, the index |
︙ | ︙ | |||
158065 158066 158067 158068 158069 158070 158071 | WhereTerm *pTerm, /* The term of the WHERE clause to be coded */ WhereLevel *pLevel, /* The level of the FROM clause we are working on */ int iEq, /* Index of the equality term within this level */ int bRev, /* True for reverse-order IN operations */ int iTarget /* Attempt to leave results in this register */ ){ Expr *pX = pTerm->pExpr; | < | < < < < < < < < < < < < < < < < | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 158420 158421 158422 158423 158424 158425 158426 158427 158428 158429 158430 158431 158432 158433 158434 158435 158436 158437 158438 158439 158440 158441 158442 158443 158444 158445 158446 158447 | WhereTerm *pTerm, /* The term of the WHERE clause to be coded */ WhereLevel *pLevel, /* The level of the FROM clause we are working on */ int iEq, /* Index of the equality term within this level */ int bRev, /* True for reverse-order IN operations */ int iTarget /* Attempt to leave results in this register */ ){ Expr *pX = pTerm->pExpr; int iReg; /* Register holding results */ assert( pLevel->pWLoop->aLTerm[iEq]==pTerm ); assert( iTarget>0 ); if( pX->op==TK_EQ || pX->op==TK_IS ){ iReg = sqlite3ExprCodeTarget(pParse, pX->pRight, iTarget); }else if( pX->op==TK_ISNULL ){ iReg = iTarget; sqlite3VdbeAddOp2(pParse->pVdbe, OP_Null, 0, iReg); #ifndef SQLITE_OMIT_SUBQUERY }else{ assert( pX->op==TK_IN ); iReg = iTarget; codeINTerm(pParse, pTerm, pLevel, iEq, bRev, iTarget); #endif } /* As an optimization, try to disable the WHERE clause term that is ** driving the index as it will always be true. The correct answer is ** obtained regardless, but we might get the answer with fewer CPU cycles ** by omitting the term. |
︙ | ︙ | |||
160401 160402 160403 160404 160405 160406 160407 | ** "=", "<", ">", "<=", ">=", "IN", "IS", and "IS NULL" */ static int allowedOp(int op){ assert( TK_GT>TK_EQ && TK_GT<TK_GE ); assert( TK_LT>TK_EQ && TK_LT<TK_GE ); assert( TK_LE>TK_EQ && TK_LE<TK_GE ); assert( TK_GE==TK_EQ+4 ); | > > > > > | | 160642 160643 160644 160645 160646 160647 160648 160649 160650 160651 160652 160653 160654 160655 160656 160657 160658 160659 160660 160661 | ** "=", "<", ">", "<=", ">=", "IN", "IS", and "IS NULL" */ static int allowedOp(int op){ assert( TK_GT>TK_EQ && TK_GT<TK_GE ); assert( TK_LT>TK_EQ && TK_LT<TK_GE ); assert( TK_LE>TK_EQ && TK_LE<TK_GE ); assert( TK_GE==TK_EQ+4 ); assert( TK_IN<TK_EQ ); assert( TK_IS<TK_EQ ); assert( TK_ISNULL<TK_EQ ); if( op>TK_GE ) return 0; if( op>=TK_EQ ) return 1; return op==TK_IN || op==TK_ISNULL || op==TK_IS; } /* ** Commute a comparison operator. Expressions of the form "X op Y" ** are converted into "Y op X". */ static u16 exprCommute(Parse *pParse, Expr *pExpr){ |
︙ | ︙ | |||
160434 160435 160436 160437 160438 160439 160440 | /* ** Translate from TK_xx operator to WO_xx bitmask. */ static u16 operatorMask(int op){ u16 c; assert( allowedOp(op) ); | > > > | > | < < < | 160680 160681 160682 160683 160684 160685 160686 160687 160688 160689 160690 160691 160692 160693 160694 160695 160696 160697 160698 160699 160700 160701 160702 160703 | /* ** Translate from TK_xx operator to WO_xx bitmask. */ static u16 operatorMask(int op){ u16 c; assert( allowedOp(op) ); if( op>=TK_EQ ){ assert( (WO_EQ<<(op-TK_EQ)) < 0x7fff ); c = (u16)(WO_EQ<<(op-TK_EQ)); }else if( op==TK_IN ){ c = WO_IN; }else if( op==TK_ISNULL ){ c = WO_ISNULL; }else{ assert( op==TK_IS ); c = WO_IS; } assert( op!=TK_ISNULL || c==WO_ISNULL ); assert( op!=TK_IN || c==WO_IN ); assert( op!=TK_EQ || c==WO_EQ ); assert( op!=TK_LT || c==WO_LT ); assert( op!=TK_LE || c==WO_LE ); assert( op!=TK_GT || c==WO_GT ); |
︙ | ︙ | |||
160729 160730 160731 160732 160733 160734 160735 160736 160737 160738 160739 160740 160741 160742 | *peOp2 = i; *ppRight = pList->a[1].pExpr; *ppLeft = pCol; return 1; } } } }else if( pExpr->op==TK_NE || pExpr->op==TK_ISNOT || pExpr->op==TK_NOTNULL ){ int res = 0; Expr *pLeft = pExpr->pLeft; Expr *pRight = pExpr->pRight; assert( pLeft->op!=TK_COLUMN || (ExprUseYTab(pLeft) && pLeft->y.pTab!=0) ); if( ExprIsVtab(pLeft) ){ res++; | > > > > > > > | 160976 160977 160978 160979 160980 160981 160982 160983 160984 160985 160986 160987 160988 160989 160990 160991 160992 160993 160994 160995 160996 | *peOp2 = i; *ppRight = pList->a[1].pExpr; *ppLeft = pCol; return 1; } } } }else if( pExpr->op>=TK_EQ ){ /* Comparison operators are a common case. Save a few comparisons for ** that common case by terminating early. */ assert( TK_NE < TK_EQ ); assert( TK_ISNOT < TK_EQ ); assert( TK_NOTNULL < TK_EQ ); return 0; }else if( pExpr->op==TK_NE || pExpr->op==TK_ISNOT || pExpr->op==TK_NOTNULL ){ int res = 0; Expr *pLeft = pExpr->pLeft; Expr *pRight = pExpr->pRight; assert( pLeft->op!=TK_COLUMN || (ExprUseYTab(pLeft) && pLeft->y.pTab!=0) ); if( ExprIsVtab(pLeft) ){ res++; |
︙ | ︙ | |||
161870 161871 161872 161873 161874 161875 161876 | int eMatchOp /* SQLITE_INDEX_CONSTRAINT_LIMIT or _OFFSET */ ){ Parse *pParse = pWC->pWInfo->pParse; sqlite3 *db = pParse->db; Expr *pNew; int iVal = 0; | | | 162124 162125 162126 162127 162128 162129 162130 162131 162132 162133 162134 162135 162136 162137 162138 | int eMatchOp /* SQLITE_INDEX_CONSTRAINT_LIMIT or _OFFSET */ ){ Parse *pParse = pWC->pWInfo->pParse; sqlite3 *db = pParse->db; Expr *pNew; int iVal = 0; if( sqlite3ExprIsInteger(pExpr, &iVal, pParse) && iVal>=0 ){ Expr *pVal = sqlite3Expr(db, TK_INTEGER, 0); if( pVal==0 ) return; ExprSetProperty(pVal, EP_IntValue); pVal->u.iValue = iVal; pNew = sqlite3PExpr(pParse, TK_MATCH, 0, pVal); }else{ Expr *pVal = sqlite3Expr(db, TK_REGISTER, 0); |
︙ | ︙ | |||
163522 163523 163524 163525 163526 163527 163528 163529 163530 163531 163532 163533 163534 163535 | sqlite3VdbeJumpHere(v, addrOnce); pParse->pIdxEpr = saved_pIdxEpr; pParse->pIdxPartExpr = saved_pIdxPartExpr; } #ifndef SQLITE_OMIT_VIRTUALTABLE /* ** Allocate and populate an sqlite3_index_info structure. It is the ** responsibility of the caller to eventually release the structure ** by passing the pointer returned by this function to freeIndexInfo(). */ static sqlite3_index_info *allocateIndexInfo( WhereInfo *pWInfo, /* The WHERE clause */ | > > > > > > > > > > > > > > | 163776 163777 163778 163779 163780 163781 163782 163783 163784 163785 163786 163787 163788 163789 163790 163791 163792 163793 163794 163795 163796 163797 163798 163799 163800 163801 163802 163803 | sqlite3VdbeJumpHere(v, addrOnce); pParse->pIdxEpr = saved_pIdxEpr; pParse->pIdxPartExpr = saved_pIdxPartExpr; } #ifndef SQLITE_OMIT_VIRTUALTABLE /* ** Return term iTerm of the WhereClause passed as the first argument. Terms ** are numbered from 0 upwards, starting with the terms in pWC->a[], then ** those in pWC->pOuter->a[] (if any), and so on. */ static WhereTerm *termFromWhereClause(WhereClause *pWC, int iTerm){ WhereClause *p; for(p=pWC; p; p=p->pOuter){ if( iTerm<p->nTerm ) return &p->a[iTerm]; iTerm -= p->nTerm; } return 0; } /* ** Allocate and populate an sqlite3_index_info structure. It is the ** responsibility of the caller to eventually release the structure ** by passing the pointer returned by this function to freeIndexInfo(). */ static sqlite3_index_info *allocateIndexInfo( WhereInfo *pWInfo, /* The WHERE clause */ |
︙ | ︙ | |||
163548 163549 163550 163551 163552 163553 163554 163555 163556 163557 163558 163559 163560 163561 163562 163563 163564 | WhereTerm *pTerm; int nOrderBy; sqlite3_index_info *pIdxInfo; u16 mNoOmit = 0; const Table *pTab; int eDistinct = 0; ExprList *pOrderBy = pWInfo->pOrderBy; assert( pSrc!=0 ); pTab = pSrc->pTab; assert( pTab!=0 ); assert( IsVirtual(pTab) ); /* Find all WHERE clause constraints referring to this virtual table. ** Mark each term with the TERM_OK flag. Set nTerm to the number of ** terms found. */ | > > | | | | | | | | | | | | | | | | | | | | | > | 163816 163817 163818 163819 163820 163821 163822 163823 163824 163825 163826 163827 163828 163829 163830 163831 163832 163833 163834 163835 163836 163837 163838 163839 163840 163841 163842 163843 163844 163845 163846 163847 163848 163849 163850 163851 163852 163853 163854 163855 163856 163857 163858 163859 163860 163861 163862 163863 163864 | WhereTerm *pTerm; int nOrderBy; sqlite3_index_info *pIdxInfo; u16 mNoOmit = 0; const Table *pTab; int eDistinct = 0; ExprList *pOrderBy = pWInfo->pOrderBy; WhereClause *p; assert( pSrc!=0 ); pTab = pSrc->pTab; assert( pTab!=0 ); assert( IsVirtual(pTab) ); /* Find all WHERE clause constraints referring to this virtual table. ** Mark each term with the TERM_OK flag. Set nTerm to the number of ** terms found. */ for(p=pWC, nTerm=0; p; p=p->pOuter){ for(i=0, pTerm=p->a; i<p->nTerm; i++, pTerm++){ pTerm->wtFlags &= ~TERM_OK; if( pTerm->leftCursor != pSrc->iCursor ) continue; if( pTerm->prereqRight & mUnusable ) continue; assert( IsPowerOfTwo(pTerm->eOperator & ~WO_EQUIV) ); testcase( pTerm->eOperator & WO_IN ); testcase( pTerm->eOperator & WO_ISNULL ); testcase( pTerm->eOperator & WO_IS ); testcase( pTerm->eOperator & WO_ALL ); if( (pTerm->eOperator & ~(WO_EQUIV))==0 ) continue; if( pTerm->wtFlags & TERM_VNULL ) continue; assert( (pTerm->eOperator & (WO_OR|WO_AND))==0 ); assert( pTerm->u.x.leftColumn>=XN_ROWID ); assert( pTerm->u.x.leftColumn<pTab->nCol ); if( (pSrc->fg.jointype & (JT_LEFT|JT_LTORJ|JT_RIGHT))!=0 && !constraintCompatibleWithOuterJoin(pTerm,pSrc) ){ continue; } nTerm++; pTerm->wtFlags |= TERM_OK; } } /* If the ORDER BY clause contains only columns in the current ** virtual table then allocate space for the aOrderBy part of ** the sqlite3_index_info structure. */ nOrderBy = 0; |
︙ | ︙ | |||
163658 163659 163660 163661 163662 163663 163664 | pIdxInfo->aConstraint = pIdxCons; pIdxInfo->aOrderBy = pIdxOrderBy; pIdxInfo->aConstraintUsage = pUsage; pHidden->pWC = pWC; pHidden->pParse = pParse; pHidden->eDistinct = eDistinct; pHidden->mIn = 0; | > > | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | > > > > > > > > > > > > > | 163929 163930 163931 163932 163933 163934 163935 163936 163937 163938 163939 163940 163941 163942 163943 163944 163945 163946 163947 163948 163949 163950 163951 163952 163953 163954 163955 163956 163957 163958 163959 163960 163961 163962 163963 163964 163965 163966 163967 163968 163969 163970 163971 163972 163973 163974 163975 163976 163977 163978 163979 163980 163981 163982 163983 163984 163985 163986 163987 163988 163989 163990 163991 163992 163993 163994 163995 163996 163997 163998 163999 164000 164001 164002 164003 164004 164005 164006 164007 164008 164009 164010 164011 164012 164013 164014 164015 164016 164017 164018 164019 164020 164021 164022 164023 164024 164025 164026 164027 164028 164029 164030 164031 164032 164033 164034 | pIdxInfo->aConstraint = pIdxCons; pIdxInfo->aOrderBy = pIdxOrderBy; pIdxInfo->aConstraintUsage = pUsage; pHidden->pWC = pWC; pHidden->pParse = pParse; pHidden->eDistinct = eDistinct; pHidden->mIn = 0; for(p=pWC, i=j=0; p; p=p->pOuter){ int nLast = i+p->nTerm;; for(pTerm=p->a; i<nLast; i++, pTerm++){ u16 op; if( (pTerm->wtFlags & TERM_OK)==0 ) continue; pIdxCons[j].iColumn = pTerm->u.x.leftColumn; pIdxCons[j].iTermOffset = i; op = pTerm->eOperator & WO_ALL; if( op==WO_IN ){ if( (pTerm->wtFlags & TERM_SLICE)==0 ){ pHidden->mIn |= SMASKBIT32(j); } op = WO_EQ; } if( op==WO_AUX ){ pIdxCons[j].op = pTerm->eMatchOp; }else if( op & (WO_ISNULL|WO_IS) ){ if( op==WO_ISNULL ){ pIdxCons[j].op = SQLITE_INDEX_CONSTRAINT_ISNULL; }else{ pIdxCons[j].op = SQLITE_INDEX_CONSTRAINT_IS; } }else{ pIdxCons[j].op = (u8)op; /* The direct assignment in the previous line is possible only because ** the WO_ and SQLITE_INDEX_CONSTRAINT_ codes are identical. The ** following asserts verify this fact. */ assert( WO_EQ==SQLITE_INDEX_CONSTRAINT_EQ ); assert( WO_LT==SQLITE_INDEX_CONSTRAINT_LT ); assert( WO_LE==SQLITE_INDEX_CONSTRAINT_LE ); assert( WO_GT==SQLITE_INDEX_CONSTRAINT_GT ); assert( WO_GE==SQLITE_INDEX_CONSTRAINT_GE ); assert( pTerm->eOperator&(WO_IN|WO_EQ|WO_LT|WO_LE|WO_GT|WO_GE|WO_AUX) ); if( op & (WO_LT|WO_LE|WO_GT|WO_GE) && sqlite3ExprIsVector(pTerm->pExpr->pRight) ){ testcase( j!=i ); if( j<16 ) mNoOmit |= (1 << j); if( op==WO_LT ) pIdxCons[j].op = WO_LE; if( op==WO_GT ) pIdxCons[j].op = WO_GE; } } j++; } } assert( j==nTerm ); pIdxInfo->nConstraint = j; for(i=j=0; i<nOrderBy; i++){ Expr *pExpr = pOrderBy->a[i].pExpr; if( sqlite3ExprIsConstant(0, pExpr) ) continue; assert( pExpr->op==TK_COLUMN || (pExpr->op==TK_COLLATE && pExpr->pLeft->op==TK_COLUMN && pExpr->iColumn==pExpr->pLeft->iColumn) ); pIdxOrderBy[j].iColumn = pExpr->iColumn; pIdxOrderBy[j].desc = pOrderBy->a[i].fg.sortFlags & KEYINFO_ORDER_DESC; j++; } pIdxInfo->nOrderBy = j; *pmNoOmit = mNoOmit; return pIdxInfo; } /* ** Free and zero the sqlite3_index_info.idxStr value if needed. */ static void freeIdxStr(sqlite3_index_info *pIdxInfo){ if( pIdxInfo->needToFreeIdxStr ){ sqlite3_free(pIdxInfo->idxStr); pIdxInfo->idxStr = 0; pIdxInfo->needToFreeIdxStr = 0; } } /* ** Free an sqlite3_index_info structure allocated by allocateIndexInfo() ** and possibly modified by xBestIndex methods. */ static void freeIndexInfo(sqlite3 *db, sqlite3_index_info *pIdxInfo){ HiddenIndexInfo *pHidden; int i; assert( pIdxInfo!=0 ); pHidden = (HiddenIndexInfo*)&pIdxInfo[1]; assert( pHidden->pParse!=0 ); assert( pHidden->pParse->db==db ); for(i=0; i<pIdxInfo->nConstraint; i++){ sqlite3ValueFree(pHidden->aRhs[i]); /* IMP: R-14553-25174 */ pHidden->aRhs[i] = 0; } freeIdxStr(pIdxInfo); sqlite3DbFree(db, pIdxInfo); } /* ** The table object reference passed as the second argument to this function ** must represent a virtual table. This function invokes the xBestIndex() ** method of the virtual table with the sqlite3_index_info object that |
︙ | ︙ | |||
165086 165087 165088 165089 165090 165091 165092 | pLoop->nOut--; if( (pTerm->eOperator&(WO_EQ|WO_IS))!=0 && (pTerm->wtFlags & TERM_HIGHTRUTH)==0 /* tag-20200224-1 */ ){ Expr *pRight = pTerm->pExpr->pRight; int k = 0; testcase( pTerm->pExpr->op==TK_IS ); | | | 165372 165373 165374 165375 165376 165377 165378 165379 165380 165381 165382 165383 165384 165385 165386 | pLoop->nOut--; if( (pTerm->eOperator&(WO_EQ|WO_IS))!=0 && (pTerm->wtFlags & TERM_HIGHTRUTH)==0 /* tag-20200224-1 */ ){ Expr *pRight = pTerm->pExpr->pRight; int k = 0; testcase( pTerm->pExpr->op==TK_IS ); if( sqlite3ExprIsInteger(pRight, &k, 0) && k>=(-1) && k<=1 ){ k = 10; }else{ k = 20; } if( iReduce<k ){ pTerm->wtFlags |= TERM_HEURTRUTH; iReduce = k; |
︙ | ︙ | |||
166335 166336 166337 166338 166339 166340 166341 | *pbIn = 0; pNew->prereq = mPrereq; /* Set the usable flag on the subset of constraints identified by ** arguments mUsable and mExclude. */ pIdxCons = *(struct sqlite3_index_constraint**)&pIdxInfo->aConstraint; for(i=0; i<nConstraint; i++, pIdxCons++){ | | | 166621 166622 166623 166624 166625 166626 166627 166628 166629 166630 166631 166632 166633 166634 166635 | *pbIn = 0; pNew->prereq = mPrereq; /* Set the usable flag on the subset of constraints identified by ** arguments mUsable and mExclude. */ pIdxCons = *(struct sqlite3_index_constraint**)&pIdxInfo->aConstraint; for(i=0; i<nConstraint; i++, pIdxCons++){ WhereTerm *pTerm = termFromWhereClause(pWC, pIdxCons->iTermOffset); pIdxCons->usable = 0; if( (pTerm->prereqRight & mUsable)==pTerm->prereqRight && (pTerm->eOperator & mExclude)==0 && (pbRetryLimit || !isLimitTerm(pTerm)) ){ pIdxCons->usable = 1; } |
︙ | ︙ | |||
166366 166367 166368 166369 166370 166371 166372 166373 166374 166375 166376 166377 166378 166379 166380 166381 166382 166383 166384 166385 166386 166387 166388 166389 | if( rc ){ if( rc==SQLITE_CONSTRAINT ){ /* If the xBestIndex method returns SQLITE_CONSTRAINT, that means ** that the particular combination of parameters provided is unusable. ** Make no entries in the loop table. */ WHERETRACE(0xffffffff, (" ^^^^--- non-viable plan rejected!\n")); return SQLITE_OK; } return rc; } mxTerm = -1; assert( pNew->nLSlot>=nConstraint ); memset(pNew->aLTerm, 0, sizeof(pNew->aLTerm[0])*nConstraint ); memset(&pNew->u.vtab, 0, sizeof(pNew->u.vtab)); pIdxCons = *(struct sqlite3_index_constraint**)&pIdxInfo->aConstraint; for(i=0; i<nConstraint; i++, pIdxCons++){ int iTerm; if( (iTerm = pUsage[i].argvIndex - 1)>=0 ){ WhereTerm *pTerm; int j = pIdxCons->iTermOffset; if( iTerm>=nConstraint || j<0 | > | | < | 166652 166653 166654 166655 166656 166657 166658 166659 166660 166661 166662 166663 166664 166665 166666 166667 166668 166669 166670 166671 166672 166673 166674 166675 166676 166677 166678 166679 166680 166681 166682 166683 166684 166685 166686 166687 166688 166689 166690 166691 166692 166693 166694 | if( rc ){ if( rc==SQLITE_CONSTRAINT ){ /* If the xBestIndex method returns SQLITE_CONSTRAINT, that means ** that the particular combination of parameters provided is unusable. ** Make no entries in the loop table. */ WHERETRACE(0xffffffff, (" ^^^^--- non-viable plan rejected!\n")); freeIdxStr(pIdxInfo); return SQLITE_OK; } return rc; } mxTerm = -1; assert( pNew->nLSlot>=nConstraint ); memset(pNew->aLTerm, 0, sizeof(pNew->aLTerm[0])*nConstraint ); memset(&pNew->u.vtab, 0, sizeof(pNew->u.vtab)); pIdxCons = *(struct sqlite3_index_constraint**)&pIdxInfo->aConstraint; for(i=0; i<nConstraint; i++, pIdxCons++){ int iTerm; if( (iTerm = pUsage[i].argvIndex - 1)>=0 ){ WhereTerm *pTerm; int j = pIdxCons->iTermOffset; if( iTerm>=nConstraint || j<0 || (pTerm = termFromWhereClause(pWC, j))==0 || pNew->aLTerm[iTerm]!=0 || pIdxCons->usable==0 ){ sqlite3ErrorMsg(pParse,"%s.xBestIndex malfunction",pSrc->pTab->zName); freeIdxStr(pIdxInfo); return SQLITE_ERROR; } testcase( iTerm==nConstraint-1 ); testcase( j==0 ); testcase( j==pWC->nTerm-1 ); pNew->prereq |= pTerm->prereqRight; assert( iTerm<pNew->nLSlot ); pNew->aLTerm[iTerm] = pTerm; if( iTerm>mxTerm ) mxTerm = iTerm; testcase( iTerm==15 ); testcase( iTerm==16 ); if( pUsage[i].omit ){ |
︙ | ︙ | |||
166439 166440 166441 166442 166443 166444 166445 | /* If there is an IN(...) term handled as an == (separate call to ** xFilter for each value on the RHS of the IN) and a LIMIT or ** OFFSET term handled as well, the plan is unusable. Similarly, ** if there is a LIMIT/OFFSET and there are other unused terms, ** the plan cannot be used. In these cases set variable *pbRetryLimit ** to true to tell the caller to retry with LIMIT and OFFSET ** disabled. */ | < < | < < | | 166725 166726 166727 166728 166729 166730 166731 166732 166733 166734 166735 166736 166737 166738 166739 166740 166741 166742 166743 166744 166745 166746 166747 166748 166749 166750 166751 166752 | /* If there is an IN(...) term handled as an == (separate call to ** xFilter for each value on the RHS of the IN) and a LIMIT or ** OFFSET term handled as well, the plan is unusable. Similarly, ** if there is a LIMIT/OFFSET and there are other unused terms, ** the plan cannot be used. In these cases set variable *pbRetryLimit ** to true to tell the caller to retry with LIMIT and OFFSET ** disabled. */ freeIdxStr(pIdxInfo); *pbRetryLimit = 1; return SQLITE_OK; } } } pNew->nLTerm = mxTerm+1; for(i=0; i<=mxTerm; i++){ if( pNew->aLTerm[i]==0 ){ /* The non-zero argvIdx values must be contiguous. Raise an ** error if they are not */ sqlite3ErrorMsg(pParse,"%s.xBestIndex malfunction",pSrc->pTab->zName); freeIdxStr(pIdxInfo); return SQLITE_ERROR; } } assert( pNew->nLTerm<=pNew->nLSlot ); pNew->u.vtab.idxNum = pIdxInfo->idxNum; pNew->u.vtab.needFree = pIdxInfo->needToFreeIdxStr; pIdxInfo->needToFreeIdxStr = 0; |
︙ | ︙ | |||
166511 166512 166513 166514 166515 166516 166517 | */ SQLITE_API const char *sqlite3_vtab_collation(sqlite3_index_info *pIdxInfo, int iCons){ HiddenIndexInfo *pHidden = (HiddenIndexInfo*)&pIdxInfo[1]; const char *zRet = 0; if( iCons>=0 && iCons<pIdxInfo->nConstraint ){ CollSeq *pC = 0; int iTerm = pIdxInfo->aConstraint[iCons].iTermOffset; | | | 166793 166794 166795 166796 166797 166798 166799 166800 166801 166802 166803 166804 166805 166806 166807 | */ SQLITE_API const char *sqlite3_vtab_collation(sqlite3_index_info *pIdxInfo, int iCons){ HiddenIndexInfo *pHidden = (HiddenIndexInfo*)&pIdxInfo[1]; const char *zRet = 0; if( iCons>=0 && iCons<pIdxInfo->nConstraint ){ CollSeq *pC = 0; int iTerm = pIdxInfo->aConstraint[iCons].iTermOffset; Expr *pX = termFromWhereClause(pHidden->pWC, iTerm)->pExpr; if( pX->pLeft ){ pC = sqlite3ExprCompareCollSeq(pHidden->pParse, pX); } zRet = (pC ? pC->zName : sqlite3StrBINARY); } return zRet; } |
︙ | ︙ | |||
166557 166558 166559 166560 166561 166562 166563 | HiddenIndexInfo *pH = (HiddenIndexInfo*)&pIdxInfo[1]; sqlite3_value *pVal = 0; int rc = SQLITE_OK; if( iCons<0 || iCons>=pIdxInfo->nConstraint ){ rc = SQLITE_MISUSE_BKPT; /* EV: R-30545-25046 */ }else{ if( pH->aRhs[iCons]==0 ){ | > | > | 166839 166840 166841 166842 166843 166844 166845 166846 166847 166848 166849 166850 166851 166852 166853 166854 166855 | HiddenIndexInfo *pH = (HiddenIndexInfo*)&pIdxInfo[1]; sqlite3_value *pVal = 0; int rc = SQLITE_OK; if( iCons<0 || iCons>=pIdxInfo->nConstraint ){ rc = SQLITE_MISUSE_BKPT; /* EV: R-30545-25046 */ }else{ if( pH->aRhs[iCons]==0 ){ WhereTerm *pTerm = termFromWhereClause( pH->pWC, pIdxInfo->aConstraint[iCons].iTermOffset ); rc = sqlite3ValueFromExpr( pH->pParse->db, pTerm->pExpr->pRight, ENC(pH->pParse->db), SQLITE_AFF_BLOB, &pH->aRhs[iCons] ); testcase( rc!=SQLITE_OK ); } pVal = pH->aRhs[iCons]; |
︙ | ︙ | |||
166713 166714 166715 166716 166717 166718 166719 | /* Call xBestIndex once for each distinct value of (prereqRight & ~mPrereq) ** in the set of terms that apply to the current virtual table. */ while( rc==SQLITE_OK ){ int i; Bitmask mNext = ALLBITS; assert( mNext>0 ); for(i=0; i<nConstraint; i++){ | < | < > | 166997 166998 166999 167000 167001 167002 167003 167004 167005 167006 167007 167008 167009 167010 167011 167012 | /* Call xBestIndex once for each distinct value of (prereqRight & ~mPrereq) ** in the set of terms that apply to the current virtual table. */ while( rc==SQLITE_OK ){ int i; Bitmask mNext = ALLBITS; assert( mNext>0 ); for(i=0; i<nConstraint; i++){ int iTerm = p->aConstraint[i].iTermOffset; Bitmask mThis = termFromWhereClause(pWC, iTerm)->prereqRight & ~mPrereq; if( mThis>mPrev && mThis<mNext ) mNext = mThis; } mPrev = mNext; if( mNext==ALLBITS ) break; if( mNext==mBest || mNext==mBestNoIn ) continue; WHERETRACE(0x800, (" VirtualOne: mPrev=%04llx mNext=%04llx\n", (sqlite3_uint64)mPrev, (sqlite3_uint64)mNext)); |
︙ | ︙ | |||
166751 166752 166753 166754 166755 166756 166757 | if( rc==SQLITE_OK && seenZeroNoIN==0 ){ WHERETRACE(0x800, (" VirtualOne: all disabled and w/o IN\n")); rc = whereLoopAddVirtualOne( pBuilder, mPrereq, mPrereq, WO_IN, p, mNoOmit, &bIn, 0); } } | < | 167034 167035 167036 167037 167038 167039 167040 167041 167042 167043 167044 167045 167046 167047 | if( rc==SQLITE_OK && seenZeroNoIN==0 ){ WHERETRACE(0x800, (" VirtualOne: all disabled and w/o IN\n")); rc = whereLoopAddVirtualOne( pBuilder, mPrereq, mPrereq, WO_IN, p, mNoOmit, &bIn, 0); } } freeIndexInfo(pParse->db, p); WHERETRACE(0x800, ("END %s.addVirtual(), rc=%d\n", pSrc->pTab->zName, rc)); return rc; } #endif /* SQLITE_OMIT_VIRTUALTABLE */ /* |
︙ | ︙ | |||
167438 167439 167440 167441 167442 167443 167444 | ** 12 otherwise ** ** For the purposes of SQLite, a star-query is defined as a query ** with a large central table that is joined against four or more ** smaller tables. The central table is called the "fact" table. ** The smaller tables that get joined are "dimension tables". ** | | | | 167720 167721 167722 167723 167724 167725 167726 167727 167728 167729 167730 167731 167732 167733 167734 167735 167736 167737 167738 167739 167740 167741 167742 167743 167744 167745 167746 | ** 12 otherwise ** ** For the purposes of SQLite, a star-query is defined as a query ** with a large central table that is joined against four or more ** smaller tables. The central table is called the "fact" table. ** The smaller tables that get joined are "dimension tables". ** ** SIDE EFFECT: (and really the whole point of this subroutine) ** ** If pWInfo describes a star-query, then the cost on WhereLoops for the ** fact table is reduced. This heuristic helps keep fact tables in ** outer loops. Without this heuristic, paths with fact tables in outer ** loops tend to get pruned by the mxChoice limit on the number of paths, ** resulting in poor query plans. The total amount of heuristic cost ** adjustment is stored in pWInfo->nOutStarDelta and the cost adjustment ** for each WhereLoop is stored in its rStarDelta field. */ static int computeMxChoice(WhereInfo *pWInfo, LogEst nRowEst){ int nLoop = pWInfo->nLevel; /* Number of terms in the join */ if( nRowEst==0 && nLoop>=5 ){ /* Check to see if we are dealing with a star schema and if so, reduce ** the cost of fact tables relative to dimension tables, as a heuristic ** to help keep the fact tables in outer loops. */ int iLoop; /* Counter over join terms */ Bitmask m; /* Bitmask for current loop */ assert( pWInfo->nOutStarDelta==0 ); |
︙ | ︙ | |||
168166 168167 168168 168169 168170 168171 168172 168173 168174 168175 168176 168177 168178 168179 | ** 5) The table must not have an inner-join ON or USING clause if there is ** a RIGHT JOIN anywhere in the query. Otherwise the ON/USING clause ** might move from the right side to the left side of the RIGHT JOIN. ** Note: Due to (2), this condition can only arise if the table is ** the right-most table of a subquery that was flattened into the ** main query and that subquery was the right-hand operand of an ** inner join that held an ON or USING clause. ** ** For example, given: ** ** CREATE TABLE t1(ipk INTEGER PRIMARY KEY, v1); ** CREATE TABLE t2(ipk INTEGER PRIMARY KEY, v2); ** CREATE TABLE t3(ipk INTEGER PRIMARY KEY, v3); ** | > > > > | 168448 168449 168450 168451 168452 168453 168454 168455 168456 168457 168458 168459 168460 168461 168462 168463 168464 168465 | ** 5) The table must not have an inner-join ON or USING clause if there is ** a RIGHT JOIN anywhere in the query. Otherwise the ON/USING clause ** might move from the right side to the left side of the RIGHT JOIN. ** Note: Due to (2), this condition can only arise if the table is ** the right-most table of a subquery that was flattened into the ** main query and that subquery was the right-hand operand of an ** inner join that held an ON or USING clause. ** 6) The ORDER BY clause has 63 or fewer terms ** 7) The omit-noop-join optimization is enabled. ** ** Items (1), (6), and (7) are checked by the caller. ** ** For example, given: ** ** CREATE TABLE t1(ipk INTEGER PRIMARY KEY, v1); ** CREATE TABLE t2(ipk INTEGER PRIMARY KEY, v2); ** CREATE TABLE t3(ipk INTEGER PRIMARY KEY, v3); ** |
︙ | ︙ | |||
168580 168581 168582 168583 168584 168585 168586 168587 168588 168589 168590 168591 168592 168593 | memset(&sWLB, 0, sizeof(sWLB)); /* An ORDER/GROUP BY clause of more than 63 terms cannot be optimized */ testcase( pOrderBy && pOrderBy->nExpr==BMS-1 ); if( pOrderBy && pOrderBy->nExpr>=BMS ){ pOrderBy = 0; wctrlFlags &= ~WHERE_WANT_DISTINCT; } /* The number of tables in the FROM clause is limited by the number of ** bits in a Bitmask */ testcase( pTabList->nSrc==BMS ); if( pTabList->nSrc>BMS ){ | > | 168866 168867 168868 168869 168870 168871 168872 168873 168874 168875 168876 168877 168878 168879 168880 | memset(&sWLB, 0, sizeof(sWLB)); /* An ORDER/GROUP BY clause of more than 63 terms cannot be optimized */ testcase( pOrderBy && pOrderBy->nExpr==BMS-1 ); if( pOrderBy && pOrderBy->nExpr>=BMS ){ pOrderBy = 0; wctrlFlags &= ~WHERE_WANT_DISTINCT; wctrlFlags |= WHERE_KEEP_ALL_JOINS; /* Disable omit-noop-join opt */ } /* The number of tables in the FROM clause is limited by the number of ** bits in a Bitmask */ testcase( pTabList->nSrc==BMS ); if( pTabList->nSrc>BMS ){ |
︙ | ︙ | |||
168880 168881 168882 168883 168884 168885 168886 | ** procedure to keep the sqlite3WhereBegin() procedure from becoming ** too large. If sqlite3WhereBegin() becomes too large, that prevents ** some C-compiler optimizers from in-lining the ** sqlite3WhereCodeOneLoopStart() procedure, and it is important to ** in-line sqlite3WhereCodeOneLoopStart() for performance reasons. */ notReady = ~(Bitmask)0; | | | | | | 169167 169168 169169 169170 169171 169172 169173 169174 169175 169176 169177 169178 169179 169180 169181 169182 169183 169184 | ** procedure to keep the sqlite3WhereBegin() procedure from becoming ** too large. If sqlite3WhereBegin() becomes too large, that prevents ** some C-compiler optimizers from in-lining the ** sqlite3WhereCodeOneLoopStart() procedure, and it is important to ** in-line sqlite3WhereCodeOneLoopStart() for performance reasons. */ notReady = ~(Bitmask)0; if( pWInfo->nLevel>=2 /* Must be a join, or this opt8n is pointless */ && pResultSet!=0 /* Condition (1) */ && 0==(wctrlFlags & (WHERE_AGG_DISTINCT|WHERE_KEEP_ALL_JOINS)) /* (1),(6) */ && OptimizationEnabled(db, SQLITE_OmitNoopJoin) /* (7) */ ){ notReady = whereOmitNoopJoin(pWInfo, notReady); nTabList = pWInfo->nLevel; assert( nTabList>0 ); } /* Check to see if there are any SEARCH loops that might benefit from |
︙ | ︙ | |||
170477 170478 170479 170480 170481 170482 170483 | sqlite3ExprDelete(db, pDup); break; } if( bIntToNull ){ int iDummy; Expr *pSub; pSub = sqlite3ExprSkipCollateAndLikely(pDup); | | | 170764 170765 170766 170767 170768 170769 170770 170771 170772 170773 170774 170775 170776 170777 170778 | sqlite3ExprDelete(db, pDup); break; } if( bIntToNull ){ int iDummy; Expr *pSub; pSub = sqlite3ExprSkipCollateAndLikely(pDup); if( sqlite3ExprIsInteger(pSub, &iDummy, 0) ){ pSub->op = TK_NULL; pSub->flags &= ~(EP_IntValue|EP_IsTrue|EP_IsFalse); pSub->u.zToken = 0; } } pList = sqlite3ExprListAppend(pParse, pList, pDup); if( pList ) pList->a[nInit+i].fg.sortFlags = pAppend->a[i].fg.sortFlags; |
︙ | ︙ | |||
172954 172955 172956 172957 172958 172959 172960 | #define TK_DESC 39 #define TK_DETACH 40 #define TK_EACH 41 #define TK_FAIL 42 #define TK_OR 43 #define TK_AND 44 #define TK_IS 45 | > | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | < | 173241 173242 173243 173244 173245 173246 173247 173248 173249 173250 173251 173252 173253 173254 173255 173256 173257 173258 173259 173260 173261 173262 173263 173264 173265 173266 173267 173268 173269 173270 173271 173272 173273 173274 173275 173276 173277 173278 173279 173280 173281 173282 173283 173284 173285 173286 173287 173288 173289 173290 173291 173292 173293 173294 173295 173296 173297 173298 173299 173300 173301 173302 173303 173304 173305 173306 173307 173308 173309 173310 173311 173312 173313 173314 173315 173316 173317 173318 173319 173320 173321 173322 173323 173324 173325 173326 173327 173328 173329 173330 173331 173332 173333 173334 173335 173336 173337 173338 173339 173340 173341 173342 173343 173344 173345 173346 173347 173348 173349 173350 173351 173352 173353 173354 173355 173356 173357 173358 173359 173360 173361 173362 173363 173364 173365 173366 173367 173368 173369 173370 173371 173372 173373 173374 173375 173376 173377 173378 173379 173380 | #define TK_DESC 39 #define TK_DETACH 40 #define TK_EACH 41 #define TK_FAIL 42 #define TK_OR 43 #define TK_AND 44 #define TK_IS 45 #define TK_ISNOT 46 #define TK_MATCH 47 #define TK_LIKE_KW 48 #define TK_BETWEEN 49 #define TK_IN 50 #define TK_ISNULL 51 #define TK_NOTNULL 52 #define TK_NE 53 #define TK_EQ 54 #define TK_GT 55 #define TK_LE 56 #define TK_LT 57 #define TK_GE 58 #define TK_ESCAPE 59 #define TK_ID 60 #define TK_COLUMNKW 61 #define TK_DO 62 #define TK_FOR 63 #define TK_IGNORE 64 #define TK_INITIALLY 65 #define TK_INSTEAD 66 #define TK_NO 67 #define TK_KEY 68 #define TK_OF 69 #define TK_OFFSET 70 #define TK_PRAGMA 71 #define TK_RAISE 72 #define TK_RECURSIVE 73 #define TK_REPLACE 74 #define TK_RESTRICT 75 #define TK_ROW 76 #define TK_ROWS 77 #define TK_TRIGGER 78 #define TK_VACUUM 79 #define TK_VIEW 80 #define TK_VIRTUAL 81 #define TK_WITH 82 #define TK_NULLS 83 #define TK_FIRST 84 #define TK_LAST 85 #define TK_CURRENT 86 #define TK_FOLLOWING 87 #define TK_PARTITION 88 #define TK_PRECEDING 89 #define TK_RANGE 90 #define TK_UNBOUNDED 91 #define TK_EXCLUDE 92 #define TK_GROUPS 93 #define TK_OTHERS 94 #define TK_TIES 95 #define TK_GENERATED 96 #define TK_ALWAYS 97 #define TK_MATERIALIZED 98 #define TK_REINDEX 99 #define TK_RENAME 100 #define TK_CTIME_KW 101 #define TK_ANY 102 #define TK_BITAND 103 #define TK_BITOR 104 #define TK_LSHIFT 105 #define TK_RSHIFT 106 #define TK_PLUS 107 #define TK_MINUS 108 #define TK_STAR 109 #define TK_SLASH 110 #define TK_REM 111 #define TK_CONCAT 112 #define TK_PTR 113 #define TK_COLLATE 114 #define TK_BITNOT 115 #define TK_ON 116 #define TK_INDEXED 117 #define TK_STRING 118 #define TK_JOIN_KW 119 #define TK_CONSTRAINT 120 #define TK_DEFAULT 121 #define TK_NULL 122 #define TK_PRIMARY 123 #define TK_UNIQUE 124 #define TK_CHECK 125 #define TK_REFERENCES 126 #define TK_AUTOINCR 127 #define TK_INSERT 128 #define TK_DELETE 129 #define TK_UPDATE 130 #define TK_SET 131 #define TK_DEFERRABLE 132 #define TK_FOREIGN 133 #define TK_DROP 134 #define TK_UNION 135 #define TK_ALL 136 #define TK_EXCEPT 137 #define TK_INTERSECT 138 #define TK_SELECT 139 #define TK_VALUES 140 #define TK_DISTINCT 141 #define TK_DOT 142 #define TK_FROM 143 #define TK_JOIN 144 #define TK_USING 145 #define TK_ORDER 146 #define TK_GROUP 147 #define TK_HAVING 148 #define TK_LIMIT 149 #define TK_WHERE 150 #define TK_RETURNING 151 #define TK_INTO 152 #define TK_NOTHING 153 #define TK_FLOAT 154 #define TK_BLOB 155 #define TK_INTEGER 156 #define TK_VARIABLE 157 #define TK_CASE 158 #define TK_WHEN 159 #define TK_THEN 160 #define TK_ELSE 161 #define TK_INDEX 162 #define TK_ALTER 163 #define TK_ADD 164 #define TK_WINDOW 165 #define TK_OVER 166 #define TK_FILTER 167 #define TK_COLUMN 168 #define TK_AGG_FUNCTION 169 #define TK_AGG_COLUMN 170 #define TK_TRUEFALSE 171 #define TK_FUNCTION 172 #define TK_UPLUS 173 #define TK_UMINUS 174 #define TK_TRUTH 175 #define TK_REGISTER 176 #define TK_VECTOR 177 #define TK_SELECT_COLUMN 178 |
︙ | ︙ | |||
173160 173161 173162 173163 173164 173165 173166 | #ifndef INTERFACE # define INTERFACE 1 #endif /************* Begin control #defines *****************************************/ #define YYCODETYPE unsigned short int #define YYNOCODE 322 #define YYACTIONTYPE unsigned short int | | | 173447 173448 173449 173450 173451 173452 173453 173454 173455 173456 173457 173458 173459 173460 173461 | #ifndef INTERFACE # define INTERFACE 1 #endif /************* Begin control #defines *****************************************/ #define YYCODETYPE unsigned short int #define YYNOCODE 322 #define YYACTIONTYPE unsigned short int #define YYWILDCARD 102 #define sqlite3ParserTOKENTYPE Token typedef union { int yyinit; sqlite3ParserTOKENTYPE yy0; ExprList* yy14; With* yy59; Cte* yy67; |
︙ | ︙ | |||
173297 173298 173299 173300 173301 173302 173303 | ** yy_shift_ofst[] For each state, the offset into yy_action for ** shifting terminals. ** yy_reduce_ofst[] For each state, the offset into yy_action for ** shifting non-terminals after a reduce. ** yy_default[] Default action for each state. ** *********** Begin parsing tables **********************************************/ | | | | | | | | | | | | | | | | | | | | | | | < | < < | < | | | | | > | > | < < | | | | | | | | | | > > | | | | | | | > | < | | | < | > | | | > > > | | | > | | < | | > | | < < | | > | | < | | | | > | < | | | | | | | | | | | | | | | | | | | | > | < | | | | > | < | | | | | | | | > > | > > > > > > > > > > | | | | | | | | | | < | | | | < | | | | | | < < | < | | | | | | | | | | < < < < | < < < | | | | | | | | | | | | | | | | | | | | > > > > < < < < | | | | | | | | | | | | | | | < | > | | | | | < | > | | > > > > | | | | | | | | | | | | | | | | | | | | | | | | | | | < < < < | > | | | < | | | > | > | | < | | | > | | > > | | | | | | < < | < < < < < | < < | < | | | | | | | | | | | | | | | | > | > > > | | | > | < | | > > > > | > > | | | | | | | | | | | | | | > | < | | | | > | < | | | | | | < | | | | | | | | | | | > | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | < < | > > | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | < | > | | | | | | | | > > > > | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 173584 173585 173586 173587 173588 173589 173590 173591 173592 173593 173594 173595 173596 173597 173598 173599 173600 173601 173602 173603 173604 173605 173606 173607 173608 173609 173610 173611 173612 173613 173614 173615 173616 173617 173618 173619 173620 173621 173622 173623 173624 173625 173626 173627 173628 173629 173630 173631 173632 173633 173634 173635 173636 173637 173638 173639 173640 173641 173642 173643 173644 173645 173646 173647 173648 173649 173650 173651 173652 173653 173654 173655 173656 173657 173658 173659 173660 173661 173662 173663 173664 173665 173666 173667 173668 173669 173670 173671 173672 173673 173674 173675 173676 173677 173678 173679 173680 173681 173682 173683 173684 173685 173686 173687 173688 173689 173690 173691 173692 173693 173694 173695 173696 173697 173698 173699 173700 173701 173702 173703 173704 173705 173706 173707 173708 173709 173710 173711 173712 173713 173714 173715 173716 173717 173718 173719 173720 173721 173722 173723 173724 173725 173726 173727 173728 173729 173730 173731 173732 173733 173734 173735 173736 173737 173738 173739 173740 173741 173742 173743 173744 173745 173746 173747 173748 173749 173750 173751 173752 173753 173754 173755 173756 173757 173758 173759 173760 173761 173762 173763 173764 173765 173766 173767 173768 173769 173770 173771 173772 173773 173774 173775 173776 173777 173778 173779 173780 173781 173782 173783 173784 173785 173786 173787 173788 173789 173790 173791 173792 173793 173794 173795 173796 173797 173798 173799 173800 173801 173802 173803 173804 173805 173806 173807 173808 173809 173810 173811 173812 173813 173814 173815 173816 173817 173818 173819 173820 173821 173822 173823 173824 173825 173826 173827 173828 173829 173830 173831 173832 173833 173834 173835 173836 173837 173838 173839 173840 173841 173842 173843 173844 173845 173846 173847 173848 173849 173850 173851 173852 173853 173854 173855 173856 173857 173858 173859 173860 173861 173862 173863 173864 173865 173866 173867 173868 173869 173870 173871 173872 173873 173874 173875 173876 173877 173878 173879 173880 173881 173882 173883 173884 173885 173886 173887 173888 173889 173890 173891 173892 173893 173894 173895 173896 173897 173898 173899 173900 173901 173902 173903 173904 173905 173906 173907 173908 173909 173910 173911 173912 173913 173914 173915 173916 173917 173918 173919 173920 173921 173922 173923 173924 173925 173926 173927 173928 173929 173930 173931 173932 173933 173934 173935 173936 173937 173938 173939 173940 173941 173942 173943 173944 173945 173946 173947 173948 173949 173950 173951 173952 173953 173954 173955 173956 173957 173958 173959 173960 173961 173962 173963 173964 173965 173966 173967 173968 173969 173970 173971 173972 173973 173974 173975 173976 173977 173978 173979 173980 173981 173982 173983 173984 173985 173986 173987 173988 173989 173990 173991 173992 173993 173994 173995 173996 173997 173998 173999 174000 174001 174002 174003 174004 174005 174006 174007 174008 174009 174010 174011 174012 174013 174014 174015 174016 174017 174018 174019 174020 174021 174022 174023 174024 174025 174026 174027 174028 174029 174030 174031 174032 174033 174034 174035 174036 174037 174038 174039 174040 174041 174042 174043 174044 174045 174046 174047 174048 174049 174050 174051 174052 174053 174054 174055 174056 174057 174058 174059 174060 174061 174062 174063 174064 174065 174066 174067 174068 174069 174070 174071 174072 174073 174074 174075 174076 174077 174078 174079 174080 174081 174082 174083 174084 174085 174086 174087 174088 174089 174090 174091 174092 174093 174094 174095 174096 174097 174098 174099 174100 174101 174102 174103 174104 174105 174106 174107 174108 174109 174110 174111 174112 174113 174114 174115 174116 174117 174118 174119 174120 174121 174122 174123 174124 174125 174126 174127 174128 174129 174130 174131 174132 174133 174134 174135 174136 174137 174138 174139 174140 174141 174142 174143 174144 174145 174146 174147 174148 174149 174150 174151 174152 174153 174154 174155 174156 174157 174158 174159 174160 174161 174162 174163 174164 174165 174166 174167 174168 174169 174170 174171 174172 174173 | ** yy_shift_ofst[] For each state, the offset into yy_action for ** shifting terminals. ** yy_reduce_ofst[] For each state, the offset into yy_action for ** shifting non-terminals after a reduce. ** yy_default[] Default action for each state. ** *********** Begin parsing tables **********************************************/ #define YY_ACTTAB_COUNT (2207) static const YYACTIONTYPE yy_action[] = { /* 0 */ 130, 127, 234, 282, 282, 1328, 576, 1307, 460, 289, /* 10 */ 289, 576, 1622, 381, 576, 1328, 573, 576, 562, 413, /* 20 */ 1300, 1542, 573, 481, 562, 524, 460, 459, 558, 82, /* 30 */ 82, 983, 294, 375, 51, 51, 498, 61, 61, 984, /* 40 */ 82, 82, 1577, 137, 138, 91, 7, 1228, 1228, 1063, /* 50 */ 1066, 1053, 1053, 135, 135, 136, 136, 136, 136, 413, /* 60 */ 288, 288, 182, 288, 288, 481, 536, 288, 288, 130, /* 70 */ 127, 234, 432, 573, 525, 562, 573, 557, 562, 1290, /* 80 */ 573, 421, 562, 137, 138, 91, 559, 1228, 1228, 1063, /* 90 */ 1066, 1053, 1053, 135, 135, 136, 136, 136, 136, 296, /* 100 */ 460, 398, 1249, 134, 134, 134, 134, 133, 133, 132, /* 110 */ 132, 132, 131, 128, 451, 44, 1050, 1050, 1064, 1067, /* 120 */ 1255, 1, 1, 582, 2, 1259, 581, 1174, 1259, 1174, /* 130 */ 321, 413, 155, 321, 1584, 155, 379, 112, 498, 1341, /* 140 */ 456, 299, 1341, 134, 134, 134, 134, 133, 133, 132, /* 150 */ 132, 132, 131, 128, 451, 137, 138, 91, 1105, 1228, /* 160 */ 1228, 1063, 1066, 1053, 1053, 135, 135, 136, 136, 136, /* 170 */ 136, 1204, 320, 567, 288, 288, 283, 288, 288, 523, /* 180 */ 523, 1250, 139, 1541, 7, 214, 503, 573, 1169, 562, /* 190 */ 573, 1054, 562, 136, 136, 136, 136, 129, 401, 547, /* 200 */ 487, 1169, 245, 1568, 1169, 245, 133, 133, 132, 132, /* 210 */ 132, 131, 128, 451, 261, 134, 134, 134, 134, 133, /* 220 */ 133, 132, 132, 132, 131, 128, 451, 451, 1204, 1205, /* 230 */ 1204, 130, 127, 234, 455, 413, 182, 455, 130, 127, /* 240 */ 234, 134, 134, 134, 134, 133, 133, 132, 132, 132, /* 250 */ 131, 128, 451, 136, 136, 136, 136, 538, 576, 137, /* 260 */ 138, 91, 261, 1228, 1228, 1063, 1066, 1053, 1053, 135, /* 270 */ 135, 136, 136, 136, 136, 44, 472, 346, 1204, 472, /* 280 */ 346, 51, 51, 418, 93, 157, 134, 134, 134, 134, /* 290 */ 133, 133, 132, 132, 132, 131, 128, 451, 166, 363, /* 300 */ 298, 134, 134, 134, 134, 133, 133, 132, 132, 132, /* 310 */ 131, 128, 451, 1293, 461, 1570, 423, 377, 275, 134, /* 320 */ 134, 134, 134, 133, 133, 132, 132, 132, 131, 128, /* 330 */ 451, 418, 320, 567, 1292, 1204, 1205, 1204, 257, 413, /* 340 */ 483, 511, 508, 507, 94, 132, 132, 132, 131, 128, /* 350 */ 451, 506, 1204, 548, 548, 388, 576, 384, 7, 413, /* 360 */ 550, 229, 522, 137, 138, 91, 530, 1228, 1228, 1063, /* 370 */ 1066, 1053, 1053, 135, 135, 136, 136, 136, 136, 51, /* 380 */ 51, 1582, 380, 137, 138, 91, 331, 1228, 1228, 1063, /* 390 */ 1066, 1053, 1053, 135, 135, 136, 136, 136, 136, 320, /* 400 */ 567, 288, 288, 320, 567, 1602, 582, 2, 1259, 1204, /* 410 */ 1205, 1204, 1628, 321, 573, 155, 562, 576, 1511, 264, /* 420 */ 231, 520, 1341, 134, 134, 134, 134, 133, 133, 132, /* 430 */ 132, 132, 131, 128, 451, 519, 1511, 1513, 1333, 1333, /* 440 */ 82, 82, 498, 134, 134, 134, 134, 133, 133, 132, /* 450 */ 132, 132, 131, 128, 451, 1435, 257, 288, 288, 511, /* 460 */ 508, 507, 944, 1568, 413, 1019, 1204, 943, 360, 506, /* 470 */ 573, 1598, 562, 44, 575, 551, 551, 557, 1107, 1582, /* 480 */ 544, 576, 1107, 40, 417, 245, 531, 1505, 137, 138, /* 490 */ 91, 219, 1228, 1228, 1063, 1066, 1053, 1053, 135, 135, /* 500 */ 136, 136, 136, 136, 81, 81, 1281, 1204, 413, 553, /* 510 */ 1511, 48, 512, 448, 447, 493, 578, 455, 578, 344, /* 520 */ 45, 1204, 1233, 1204, 1205, 1204, 428, 1235, 158, 882, /* 530 */ 320, 567, 137, 138, 91, 1234, 1228, 1228, 1063, 1066, /* 540 */ 1053, 1053, 135, 135, 136, 136, 136, 136, 134, 134, /* 550 */ 134, 134, 133, 133, 132, 132, 132, 131, 128, 451, /* 560 */ 1236, 576, 1236, 329, 1204, 1205, 1204, 387, 492, 403, /* 570 */ 1040, 382, 489, 123, 568, 1569, 4, 377, 1204, 1205, /* 580 */ 1204, 570, 570, 570, 82, 82, 882, 1029, 1331, 1331, /* 590 */ 571, 1028, 134, 134, 134, 134, 133, 133, 132, 132, /* 600 */ 132, 131, 128, 451, 288, 288, 1281, 1204, 576, 423, /* 610 */ 576, 1568, 413, 423, 452, 378, 886, 573, 1279, 562, /* 620 */ 46, 557, 532, 1028, 1028, 1030, 565, 130, 127, 234, /* 630 */ 556, 82, 82, 82, 82, 479, 137, 138, 91, 462, /* 640 */ 1228, 1228, 1063, 1066, 1053, 1053, 135, 135, 136, 136, /* 650 */ 136, 136, 1188, 487, 1506, 1040, 413, 6, 1204, 50, /* 660 */ 879, 121, 121, 948, 1204, 1205, 1204, 358, 557, 122, /* 670 */ 316, 452, 577, 452, 535, 1204, 1028, 439, 303, 212, /* 680 */ 137, 138, 91, 213, 1228, 1228, 1063, 1066, 1053, 1053, /* 690 */ 135, 135, 136, 136, 136, 136, 134, 134, 134, 134, /* 700 */ 133, 133, 132, 132, 132, 131, 128, 451, 1028, 1028, /* 710 */ 1030, 1031, 35, 288, 288, 1204, 1205, 1204, 1040, 1339, /* 720 */ 533, 123, 568, 1569, 4, 377, 573, 1019, 562, 353, /* 730 */ 1277, 356, 1204, 1205, 1204, 1029, 488, 1188, 571, 1028, /* 740 */ 134, 134, 134, 134, 133, 133, 132, 132, 132, 131, /* 750 */ 128, 451, 576, 343, 288, 288, 449, 449, 449, 971, /* 760 */ 413, 1627, 452, 911, 1187, 288, 288, 573, 464, 562, /* 770 */ 238, 1028, 1028, 1030, 565, 82, 82, 498, 573, 411, /* 780 */ 562, 344, 467, 332, 137, 138, 91, 197, 1228, 1228, /* 790 */ 1063, 1066, 1053, 1053, 135, 135, 136, 136, 136, 136, /* 800 */ 1188, 528, 1169, 1040, 413, 1110, 1110, 495, 1041, 121, /* 810 */ 121, 1204, 317, 540, 862, 1169, 1244, 122, 1169, 452, /* 820 */ 577, 452, 1340, 198, 1028, 1204, 481, 526, 137, 138, /* 830 */ 91, 560, 1228, 1228, 1063, 1066, 1053, 1053, 135, 135, /* 840 */ 136, 136, 136, 136, 134, 134, 134, 134, 133, 133, /* 850 */ 132, 132, 132, 131, 128, 451, 1028, 1028, 1030, 1031, /* 860 */ 35, 1204, 288, 288, 1204, 477, 288, 288, 1204, 1205, /* 870 */ 1204, 539, 481, 437, 470, 573, 1451, 562, 364, 573, /* 880 */ 1153, 562, 1204, 1205, 1204, 1188, 5, 576, 134, 134, /* 890 */ 134, 134, 133, 133, 132, 132, 132, 131, 128, 451, /* 900 */ 221, 214, 302, 96, 1149, 1657, 232, 1657, 413, 392, /* 910 */ 19, 19, 1024, 949, 406, 373, 1595, 1085, 1204, 1205, /* 920 */ 1204, 1204, 1205, 1204, 1204, 426, 1149, 1658, 413, 1658, /* 930 */ 1659, 399, 137, 138, 91, 3, 1228, 1228, 1063, 1066, /* 940 */ 1053, 1053, 135, 135, 136, 136, 136, 136, 304, 1311, /* 950 */ 514, 1204, 137, 138, 91, 1498, 1228, 1228, 1063, 1066, /* 960 */ 1053, 1053, 135, 135, 136, 136, 136, 136, 434, 131, /* 970 */ 128, 451, 375, 1204, 274, 291, 372, 517, 367, 516, /* 980 */ 262, 1204, 1205, 1204, 1147, 227, 363, 448, 447, 1435, /* 990 */ 1568, 1310, 134, 134, 134, 134, 133, 133, 132, 132, /* 1000 */ 132, 131, 128, 451, 1568, 576, 1147, 487, 1204, 1205, /* 1010 */ 1204, 442, 134, 134, 134, 134, 133, 133, 132, 132, /* 1020 */ 132, 131, 128, 451, 386, 576, 485, 576, 19, 19, /* 1030 */ 1204, 1205, 1204, 1345, 1236, 970, 1236, 574, 47, 936, /* 1040 */ 936, 473, 413, 431, 1552, 573, 1125, 562, 19, 19, /* 1050 */ 19, 19, 49, 336, 850, 851, 852, 111, 1368, 315, /* 1060 */ 429, 576, 413, 433, 341, 306, 137, 138, 91, 115, /* 1070 */ 1228, 1228, 1063, 1066, 1053, 1053, 135, 135, 136, 136, /* 1080 */ 136, 136, 576, 1309, 82, 82, 137, 138, 91, 529, /* 1090 */ 1228, 1228, 1063, 1066, 1053, 1053, 135, 135, 136, 136, /* 1100 */ 136, 136, 1569, 222, 377, 19, 19, 305, 1126, 1169, /* 1110 */ 398, 1148, 22, 22, 498, 333, 1569, 335, 377, 576, /* 1120 */ 438, 445, 1169, 1127, 486, 1169, 134, 134, 134, 134, /* 1130 */ 133, 133, 132, 132, 132, 131, 128, 451, 1128, 576, /* 1140 */ 902, 576, 145, 145, 6, 576, 134, 134, 134, 134, /* 1150 */ 133, 133, 132, 132, 132, 131, 128, 451, 214, 1336, /* 1160 */ 922, 576, 19, 19, 19, 19, 1282, 419, 19, 19, /* 1170 */ 923, 412, 515, 141, 576, 1169, 413, 206, 465, 207, /* 1180 */ 903, 215, 1575, 552, 147, 147, 7, 227, 1169, 411, /* 1190 */ 1250, 1169, 120, 307, 117, 307, 413, 66, 66, 334, /* 1200 */ 137, 138, 91, 119, 1228, 1228, 1063, 1066, 1053, 1053, /* 1210 */ 135, 135, 136, 136, 136, 136, 413, 285, 209, 969, /* 1220 */ 137, 138, 91, 471, 1228, 1228, 1063, 1066, 1053, 1053, /* 1230 */ 135, 135, 136, 136, 136, 136, 435, 10, 1450, 267, /* 1240 */ 137, 126, 91, 1435, 1228, 1228, 1063, 1066, 1053, 1053, /* 1250 */ 135, 135, 136, 136, 136, 136, 1435, 1435, 410, 409, /* 1260 */ 134, 134, 134, 134, 133, 133, 132, 132, 132, 131, /* 1270 */ 128, 451, 576, 969, 576, 1224, 498, 373, 1595, 1554, /* 1280 */ 134, 134, 134, 134, 133, 133, 132, 132, 132, 131, /* 1290 */ 128, 451, 532, 457, 576, 82, 82, 82, 82, 111, /* 1300 */ 134, 134, 134, 134, 133, 133, 132, 132, 132, 131, /* 1310 */ 128, 451, 109, 233, 430, 1576, 546, 67, 67, 7, /* 1320 */ 413, 351, 550, 1550, 260, 259, 258, 494, 443, 569, /* 1330 */ 419, 983, 446, 1224, 450, 545, 1207, 576, 969, 984, /* 1340 */ 413, 475, 1449, 1574, 1180, 138, 91, 7, 1228, 1228, /* 1350 */ 1063, 1066, 1053, 1053, 135, 135, 136, 136, 136, 136, /* 1360 */ 21, 21, 267, 576, 300, 1126, 91, 233, 1228, 1228, /* 1370 */ 1063, 1066, 1053, 1053, 135, 135, 136, 136, 136, 136, /* 1380 */ 1127, 373, 1595, 161, 1573, 16, 53, 53, 7, 108, /* 1390 */ 533, 38, 969, 125, 1207, 1128, 1180, 576, 1224, 123, /* 1400 */ 568, 893, 4, 324, 134, 134, 134, 134, 133, 133, /* 1410 */ 132, 132, 132, 131, 128, 451, 571, 564, 534, 576, /* 1420 */ 68, 68, 576, 39, 134, 134, 134, 134, 133, 133, /* 1430 */ 132, 132, 132, 131, 128, 451, 576, 160, 1571, 1223, /* 1440 */ 452, 576, 54, 54, 576, 69, 69, 576, 1366, 576, /* 1450 */ 420, 184, 565, 463, 297, 576, 1224, 463, 297, 70, /* 1460 */ 70, 576, 44, 474, 71, 71, 576, 72, 72, 576, /* 1470 */ 73, 73, 55, 55, 411, 874, 242, 576, 56, 56, /* 1480 */ 576, 1040, 576, 478, 57, 57, 576, 121, 121, 59, /* 1490 */ 59, 23, 60, 60, 411, 122, 319, 452, 577, 452, /* 1500 */ 74, 74, 1028, 75, 75, 76, 76, 411, 290, 20, /* 1510 */ 20, 108, 287, 231, 553, 123, 568, 325, 4, 320, /* 1520 */ 567, 97, 218, 944, 1144, 328, 400, 576, 943, 576, /* 1530 */ 1380, 424, 571, 874, 1028, 1028, 1030, 1031, 35, 293, /* 1540 */ 534, 576, 1104, 576, 1104, 9, 576, 342, 576, 111, /* 1550 */ 77, 77, 143, 143, 576, 205, 452, 222, 1379, 889, /* 1560 */ 576, 901, 900, 1188, 144, 144, 78, 78, 565, 62, /* 1570 */ 62, 79, 79, 323, 1021, 576, 266, 63, 63, 908, /* 1580 */ 909, 1589, 542, 80, 80, 576, 371, 541, 123, 568, /* 1590 */ 480, 4, 266, 482, 244, 266, 370, 1040, 64, 64, /* 1600 */ 576, 466, 576, 121, 121, 571, 1557, 576, 170, 170, /* 1610 */ 576, 122, 576, 452, 577, 452, 576, 889, 1028, 576, /* 1620 */ 165, 576, 111, 171, 171, 87, 87, 337, 1616, 452, /* 1630 */ 65, 65, 1530, 83, 83, 146, 146, 986, 987, 84, /* 1640 */ 84, 565, 168, 168, 148, 148, 1092, 347, 1032, 111, /* 1650 */ 1028, 1028, 1030, 1031, 35, 542, 1103, 576, 1103, 576, /* 1660 */ 543, 123, 568, 504, 4, 263, 576, 361, 1529, 111, /* 1670 */ 1040, 1088, 576, 263, 576, 490, 121, 121, 571, 1188, /* 1680 */ 142, 142, 169, 169, 122, 576, 452, 577, 452, 162, /* 1690 */ 162, 1028, 576, 563, 576, 152, 152, 151, 151, 348, /* 1700 */ 1376, 974, 452, 266, 1092, 942, 1032, 125, 149, 149, /* 1710 */ 939, 576, 125, 576, 565, 150, 150, 86, 86, 872, /* 1720 */ 352, 159, 576, 1028, 1028, 1030, 1031, 35, 542, 941, /* 1730 */ 576, 125, 355, 541, 88, 88, 85, 85, 357, 359, /* 1740 */ 1324, 1308, 366, 1040, 376, 52, 52, 499, 1389, 121, /* 1750 */ 121, 1434, 1188, 58, 58, 1362, 1374, 122, 1439, 452, /* 1760 */ 577, 452, 1289, 167, 1028, 1280, 280, 1268, 1267, 1269, /* 1770 */ 1609, 1359, 312, 313, 12, 314, 397, 1421, 224, 1416, /* 1780 */ 295, 237, 1409, 339, 340, 1426, 301, 345, 484, 228, /* 1790 */ 1371, 1307, 1372, 1370, 1425, 404, 1028, 1028, 1030, 1031, /* 1800 */ 35, 1601, 1192, 454, 509, 369, 292, 1502, 210, 1501, /* 1810 */ 1369, 396, 396, 395, 277, 393, 211, 566, 859, 1612, /* 1820 */ 1244, 123, 568, 391, 4, 1188, 223, 270, 1549, 1547, /* 1830 */ 1241, 239, 186, 327, 422, 96, 195, 220, 571, 235, /* 1840 */ 180, 326, 188, 468, 190, 1507, 191, 192, 92, 193, /* 1850 */ 469, 95, 1422, 13, 502, 247, 1430, 109, 199, 402, /* 1860 */ 476, 405, 452, 1496, 1428, 1427, 14, 491, 251, 102, /* 1870 */ 497, 1518, 241, 281, 565, 253, 203, 354, 500, 254, /* 1880 */ 175, 1270, 407, 43, 350, 518, 1327, 436, 255, 1326, /* 1890 */ 1325, 1318, 104, 893, 1626, 229, 408, 440, 1625, 441, /* 1900 */ 240, 310, 1296, 1040, 311, 1317, 527, 1594, 1297, 121, /* 1910 */ 121, 368, 1295, 1624, 268, 269, 1580, 122, 1579, 452, /* 1920 */ 577, 452, 374, 444, 1028, 1394, 1393, 140, 553, 90, /* 1930 */ 568, 11, 4, 1483, 383, 414, 385, 110, 116, 216, /* 1940 */ 320, 567, 1350, 555, 42, 318, 571, 537, 1349, 389, /* 1950 */ 390, 579, 1198, 276, 279, 278, 1028, 1028, 1030, 1031, /* 1960 */ 35, 580, 415, 1265, 458, 1260, 416, 185, 1534, 172, /* 1970 */ 452, 1535, 173, 156, 308, 846, 1533, 1532, 453, 217, /* 1980 */ 225, 89, 565, 174, 322, 1188, 226, 236, 1102, 154, /* 1990 */ 1100, 330, 176, 187, 1223, 189, 925, 338, 243, 1116, /* 2000 */ 246, 194, 177, 178, 425, 427, 98, 99, 196, 100, /* 2010 */ 101, 1040, 179, 1119, 248, 1115, 249, 121, 121, 24, /* 2020 */ 163, 250, 349, 1108, 266, 122, 1238, 452, 577, 452, /* 2030 */ 1192, 454, 1028, 200, 292, 496, 252, 201, 861, 396, /* 2040 */ 396, 395, 277, 393, 15, 501, 859, 370, 292, 256, /* 2050 */ 202, 554, 505, 396, 396, 395, 277, 393, 103, 239, /* 2060 */ 859, 327, 25, 26, 1028, 1028, 1030, 1031, 35, 326, /* 2070 */ 362, 510, 891, 239, 365, 327, 513, 904, 105, 309, /* 2080 */ 164, 181, 27, 326, 106, 521, 107, 1185, 1069, 1155, /* 2090 */ 17, 1154, 284, 1188, 286, 978, 265, 204, 125, 1171, /* 2100 */ 241, 230, 972, 1175, 28, 1160, 29, 1179, 175, 1173, /* 2110 */ 30, 43, 31, 1178, 241, 32, 41, 549, 8, 33, /* 2120 */ 208, 111, 175, 1083, 1070, 43, 113, 1068, 240, 114, /* 2130 */ 1072, 34, 1073, 561, 1124, 118, 271, 36, 18, 1194, /* 2140 */ 1033, 873, 240, 935, 124, 37, 272, 273, 1617, 572, /* 2150 */ 183, 153, 394, 1193, 1256, 1256, 1256, 1256, 1256, 1256, /* 2160 */ 1256, 1256, 1256, 414, 1256, 1256, 1256, 1256, 320, 567, /* 2170 */ 1256, 1256, 1256, 1256, 1256, 1256, 1256, 414, 1256, 1256, /* 2180 */ 1256, 1256, 320, 567, 1256, 1256, 1256, 1256, 1256, 1256, /* 2190 */ 1256, 1256, 458, 1256, 1256, 1256, 1256, 1256, 1256, 1256, /* 2200 */ 1256, 1256, 1256, 1256, 1256, 1256, 458, }; static const YYCODETYPE yy_lookahead[] = { /* 0 */ 276, 277, 278, 240, 241, 224, 194, 226, 194, 240, /* 10 */ 241, 194, 216, 220, 194, 234, 253, 194, 255, 19, /* 20 */ 224, 297, 253, 194, 255, 205, 212, 213, 205, 217, /* 30 */ 218, 31, 205, 194, 217, 218, 194, 217, 218, 39, /* 40 */ 217, 218, 312, 43, 44, 45, 316, 47, 48, 49, /* 50 */ 50, 51, 52, 53, 54, 55, 56, 57, 58, 19, /* 60 */ 240, 241, 194, 240, 241, 194, 254, 240, 241, 276, /* 70 */ 277, 278, 233, 253, 254, 255, 253, 254, 255, 217, /* 80 */ 253, 239, 255, 43, 44, 45, 263, 47, 48, 49, /* 90 */ 50, 51, 52, 53, 54, 55, 56, 57, 58, 270, /* 100 */ 286, 22, 23, 103, 104, 105, 106, 107, 108, 109, /* 110 */ 110, 111, 112, 113, 114, 82, 47, 48, 49, 50, /* 120 */ 186, 187, 188, 189, 190, 191, 189, 87, 191, 89, /* 130 */ 196, 19, 198, 196, 317, 198, 319, 25, 194, 205, /* 140 */ 298, 270, 205, 103, 104, 105, 106, 107, 108, 109, /* 150 */ 110, 111, 112, 113, 114, 43, 44, 45, 11, 47, /* 160 */ 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, /* 170 */ 58, 60, 139, 140, 240, 241, 214, 240, 241, 311, /* 180 */ 312, 102, 70, 239, 316, 194, 19, 253, 77, 255, /* 190 */ 253, 122, 255, 55, 56, 57, 58, 59, 207, 88, /* 200 */ 194, 90, 268, 194, 93, 268, 107, 108, 109, 110, /* 210 */ 111, 112, 113, 114, 47, 103, 104, 105, 106, 107, /* 220 */ 108, 109, 110, 111, 112, 113, 114, 114, 117, 118, /* 230 */ 119, 276, 277, 278, 300, 19, 194, 300, 276, 277, /* 240 */ 278, 103, 104, 105, 106, 107, 108, 109, 110, 111, /* 250 */ 112, 113, 114, 55, 56, 57, 58, 146, 194, 43, /* 260 */ 44, 45, 47, 47, 48, 49, 50, 51, 52, 53, /* 270 */ 54, 55, 56, 57, 58, 82, 129, 130, 60, 129, /* 280 */ 130, 217, 218, 116, 68, 25, 103, 104, 105, 106, /* 290 */ 107, 108, 109, 110, 111, 112, 113, 114, 23, 132, /* 300 */ 294, 103, 104, 105, 106, 107, 108, 109, 110, 111, /* 310 */ 112, 113, 114, 217, 121, 306, 194, 308, 26, 103, /* 320 */ 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, /* 330 */ 114, 116, 139, 140, 217, 117, 118, 119, 120, 19, /* 340 */ 194, 123, 124, 125, 24, 109, 110, 111, 112, 113, /* 350 */ 114, 133, 60, 311, 312, 250, 194, 252, 316, 19, /* 360 */ 194, 166, 167, 43, 44, 45, 205, 47, 48, 49, /* 370 */ 50, 51, 52, 53, 54, 55, 56, 57, 58, 217, /* 380 */ 218, 317, 318, 43, 44, 45, 264, 47, 48, 49, /* 390 */ 50, 51, 52, 53, 54, 55, 56, 57, 58, 139, /* 400 */ 140, 240, 241, 139, 140, 188, 189, 190, 191, 117, /* 410 */ 118, 119, 231, 196, 253, 198, 255, 194, 194, 258, /* 420 */ 259, 146, 205, 103, 104, 105, 106, 107, 108, 109, /* 430 */ 110, 111, 112, 113, 114, 109, 212, 213, 236, 237, /* 440 */ 217, 218, 194, 103, 104, 105, 106, 107, 108, 109, /* 450 */ 110, 111, 112, 113, 114, 194, 120, 240, 241, 123, /* 460 */ 124, 125, 136, 194, 19, 74, 60, 141, 23, 133, /* 470 */ 253, 194, 255, 82, 194, 309, 310, 254, 29, 317, /* 480 */ 318, 194, 33, 22, 199, 268, 263, 239, 43, 44, /* 490 */ 45, 151, 47, 48, 49, 50, 51, 52, 53, 54, /* 500 */ 55, 56, 57, 58, 217, 218, 194, 60, 19, 146, /* 510 */ 286, 242, 23, 107, 108, 66, 204, 300, 206, 128, /* 520 */ 73, 60, 116, 117, 118, 119, 265, 121, 165, 60, /* 530 */ 139, 140, 43, 44, 45, 129, 47, 48, 49, 50, /* 540 */ 51, 52, 53, 54, 55, 56, 57, 58, 103, 104, /* 550 */ 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, /* 560 */ 154, 194, 156, 194, 117, 118, 119, 280, 283, 205, /* 570 */ 101, 220, 287, 19, 20, 306, 22, 308, 117, 118, /* 580 */ 119, 211, 212, 213, 217, 218, 117, 118, 236, 237, /* 590 */ 36, 122, 103, 104, 105, 106, 107, 108, 109, 110, /* 600 */ 111, 112, 113, 114, 240, 241, 194, 60, 194, 194, /* 610 */ 194, 194, 19, 194, 60, 194, 23, 253, 206, 255, /* 620 */ 73, 254, 19, 154, 155, 156, 72, 276, 277, 278, /* 630 */ 263, 217, 218, 217, 218, 271, 43, 44, 45, 271, /* 640 */ 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, /* 650 */ 57, 58, 183, 194, 285, 101, 19, 214, 60, 242, /* 660 */ 23, 107, 108, 109, 117, 118, 119, 16, 254, 115, /* 670 */ 254, 117, 118, 119, 194, 60, 122, 263, 205, 264, /* 680 */ 43, 44, 45, 264, 47, 48, 49, 50, 51, 52, /* 690 */ 53, 54, 55, 56, 57, 58, 103, 104, 105, 106, /* 700 */ 107, 108, 109, 110, 111, 112, 113, 114, 154, 155, /* 710 */ 156, 157, 158, 240, 241, 117, 118, 119, 101, 205, /* 720 */ 117, 19, 20, 306, 22, 308, 253, 74, 255, 78, /* 730 */ 205, 80, 117, 118, 119, 118, 293, 183, 36, 122, /* 740 */ 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, /* 750 */ 113, 114, 194, 294, 240, 241, 211, 212, 213, 144, /* 760 */ 19, 23, 60, 25, 23, 240, 241, 253, 245, 255, /* 770 */ 15, 154, 155, 156, 72, 217, 218, 194, 253, 256, /* 780 */ 255, 128, 129, 130, 43, 44, 45, 22, 47, 48, /* 790 */ 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, /* 800 */ 183, 19, 77, 101, 19, 128, 129, 130, 23, 107, /* 810 */ 108, 60, 254, 88, 21, 90, 61, 115, 93, 117, /* 820 */ 118, 119, 239, 22, 122, 60, 194, 205, 43, 44, /* 830 */ 45, 205, 47, 48, 49, 50, 51, 52, 53, 54, /* 840 */ 55, 56, 57, 58, 103, 104, 105, 106, 107, 108, /* 850 */ 109, 110, 111, 112, 113, 114, 154, 155, 156, 157, /* 860 */ 158, 60, 240, 241, 60, 116, 240, 241, 117, 118, /* 870 */ 119, 146, 194, 19, 81, 253, 275, 255, 24, 253, /* 880 */ 98, 255, 117, 118, 119, 183, 22, 194, 103, 104, /* 890 */ 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, /* 900 */ 151, 194, 270, 152, 22, 23, 194, 25, 19, 202, /* 910 */ 217, 218, 23, 109, 207, 314, 315, 124, 117, 118, /* 920 */ 119, 117, 118, 119, 60, 232, 22, 23, 19, 25, /* 930 */ 303, 304, 43, 44, 45, 22, 47, 48, 49, 50, /* 940 */ 51, 52, 53, 54, 55, 56, 57, 58, 270, 227, /* 950 */ 96, 60, 43, 44, 45, 162, 47, 48, 49, 50, /* 960 */ 51, 52, 53, 54, 55, 56, 57, 58, 114, 112, /* 970 */ 113, 114, 194, 60, 120, 121, 122, 123, 124, 125, /* 980 */ 126, 117, 118, 119, 102, 25, 132, 107, 108, 194, /* 990 */ 194, 227, 103, 104, 105, 106, 107, 108, 109, 110, /* 1000 */ 111, 112, 113, 114, 194, 194, 102, 194, 117, 118, /* 1010 */ 119, 233, 103, 104, 105, 106, 107, 108, 109, 110, /* 1020 */ 111, 112, 113, 114, 194, 194, 19, 194, 217, 218, /* 1030 */ 117, 118, 119, 241, 154, 144, 156, 135, 242, 137, /* 1040 */ 138, 130, 19, 232, 194, 253, 23, 255, 217, 218, /* 1050 */ 217, 218, 242, 16, 7, 8, 9, 25, 261, 262, /* 1060 */ 265, 194, 19, 232, 153, 232, 43, 44, 45, 160, /* 1070 */ 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, /* 1080 */ 57, 58, 194, 227, 217, 218, 43, 44, 45, 194, /* 1090 */ 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, /* 1100 */ 57, 58, 306, 143, 308, 217, 218, 294, 12, 77, /* 1110 */ 22, 23, 217, 218, 194, 78, 306, 80, 308, 194, /* 1120 */ 232, 254, 90, 27, 117, 93, 103, 104, 105, 106, /* 1130 */ 107, 108, 109, 110, 111, 112, 113, 114, 42, 194, /* 1140 */ 35, 194, 217, 218, 214, 194, 103, 104, 105, 106, /* 1150 */ 107, 108, 109, 110, 111, 112, 113, 114, 194, 239, /* 1160 */ 64, 194, 217, 218, 217, 218, 209, 210, 217, 218, /* 1170 */ 74, 207, 67, 22, 194, 77, 19, 232, 245, 232, /* 1180 */ 75, 24, 312, 232, 217, 218, 316, 25, 90, 256, /* 1190 */ 102, 93, 159, 229, 161, 231, 19, 217, 218, 162, /* 1200 */ 43, 44, 45, 160, 47, 48, 49, 50, 51, 52, /* 1210 */ 53, 54, 55, 56, 57, 58, 19, 23, 288, 25, /* 1220 */ 43, 44, 45, 293, 47, 48, 49, 50, 51, 52, /* 1230 */ 53, 54, 55, 56, 57, 58, 131, 22, 275, 24, /* 1240 */ 43, 44, 45, 194, 47, 48, 49, 50, 51, 52, /* 1250 */ 53, 54, 55, 56, 57, 58, 194, 194, 107, 108, /* 1260 */ 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, /* 1270 */ 113, 114, 194, 25, 194, 60, 194, 314, 315, 194, /* 1280 */ 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, /* 1290 */ 113, 114, 19, 194, 194, 217, 218, 217, 218, 25, /* 1300 */ 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, /* 1310 */ 113, 114, 150, 119, 265, 312, 67, 217, 218, 316, /* 1320 */ 19, 239, 194, 194, 128, 129, 130, 265, 265, 209, /* 1330 */ 210, 31, 254, 118, 254, 86, 60, 194, 144, 39, /* 1340 */ 19, 130, 275, 312, 95, 44, 45, 316, 47, 48, /* 1350 */ 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, /* 1360 */ 217, 218, 24, 194, 153, 12, 45, 119, 47, 48, /* 1370 */ 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, /* 1380 */ 27, 314, 315, 22, 312, 24, 217, 218, 316, 116, /* 1390 */ 117, 22, 144, 25, 118, 42, 147, 194, 60, 19, /* 1400 */ 20, 127, 22, 194, 103, 104, 105, 106, 107, 108, /* 1410 */ 109, 110, 111, 112, 113, 114, 36, 64, 145, 194, /* 1420 */ 217, 218, 194, 54, 103, 104, 105, 106, 107, 108, /* 1430 */ 109, 110, 111, 112, 113, 114, 194, 22, 310, 25, /* 1440 */ 60, 194, 217, 218, 194, 217, 218, 194, 260, 194, /* 1450 */ 301, 302, 72, 262, 262, 194, 118, 266, 266, 217, /* 1460 */ 218, 194, 82, 245, 217, 218, 194, 217, 218, 194, /* 1470 */ 217, 218, 217, 218, 256, 60, 24, 194, 217, 218, /* 1480 */ 194, 101, 194, 245, 217, 218, 194, 107, 108, 217, /* 1490 */ 218, 22, 217, 218, 256, 115, 245, 117, 118, 119, /* 1500 */ 217, 218, 122, 217, 218, 217, 218, 256, 22, 217, /* 1510 */ 218, 116, 258, 259, 146, 19, 20, 194, 22, 139, /* 1520 */ 140, 150, 151, 136, 23, 194, 25, 194, 141, 194, /* 1530 */ 194, 62, 36, 118, 154, 155, 156, 157, 158, 100, /* 1540 */ 145, 194, 154, 194, 156, 49, 194, 23, 194, 25, /* 1550 */ 217, 218, 217, 218, 194, 257, 60, 143, 194, 60, /* 1560 */ 194, 121, 122, 183, 217, 218, 217, 218, 72, 217, /* 1570 */ 218, 217, 218, 134, 23, 194, 25, 217, 218, 7, /* 1580 */ 8, 321, 86, 217, 218, 194, 122, 91, 19, 20, /* 1590 */ 23, 22, 25, 23, 142, 25, 132, 101, 217, 218, /* 1600 */ 194, 194, 194, 107, 108, 36, 194, 194, 217, 218, /* 1610 */ 194, 115, 194, 117, 118, 119, 194, 118, 122, 194, /* 1620 */ 23, 194, 25, 217, 218, 217, 218, 194, 142, 60, /* 1630 */ 217, 218, 194, 217, 218, 217, 218, 84, 85, 217, /* 1640 */ 218, 72, 217, 218, 217, 218, 60, 23, 60, 25, /* 1650 */ 154, 155, 156, 157, 158, 86, 154, 194, 156, 194, /* 1660 */ 91, 19, 20, 23, 22, 25, 194, 23, 194, 25, /* 1670 */ 101, 23, 194, 25, 194, 194, 107, 108, 36, 183, /* 1680 */ 217, 218, 217, 218, 115, 194, 117, 118, 119, 217, /* 1690 */ 218, 122, 194, 237, 194, 217, 218, 217, 218, 194, /* 1700 */ 194, 23, 60, 25, 118, 23, 118, 25, 217, 218, /* 1710 */ 23, 194, 25, 194, 72, 217, 218, 217, 218, 23, /* 1720 */ 194, 25, 194, 154, 155, 156, 157, 158, 86, 23, /* 1730 */ 194, 25, 194, 91, 217, 218, 217, 218, 194, 194, /* 1740 */ 194, 194, 194, 101, 194, 217, 218, 290, 194, 107, /* 1750 */ 108, 194, 183, 217, 218, 194, 194, 115, 194, 117, /* 1760 */ 118, 119, 194, 243, 122, 194, 289, 194, 194, 194, /* 1770 */ 194, 257, 257, 257, 244, 257, 192, 273, 215, 269, /* 1780 */ 246, 299, 269, 295, 247, 273, 247, 246, 295, 230, /* 1790 */ 261, 226, 261, 261, 273, 273, 154, 155, 156, 157, /* 1800 */ 158, 0, 1, 2, 221, 220, 5, 220, 250, 220, /* 1810 */ 261, 10, 11, 12, 13, 14, 250, 282, 17, 197, /* 1820 */ 61, 19, 20, 246, 22, 183, 244, 142, 201, 201, /* 1830 */ 38, 30, 299, 32, 201, 152, 22, 151, 36, 299, /* 1840 */ 43, 40, 235, 18, 238, 285, 238, 238, 296, 238, /* 1850 */ 201, 296, 274, 272, 18, 200, 235, 150, 235, 247, /* 1860 */ 247, 247, 60, 247, 274, 274, 272, 201, 200, 159, /* 1870 */ 63, 292, 71, 201, 72, 200, 22, 201, 222, 200, /* 1880 */ 79, 201, 222, 82, 291, 116, 219, 65, 200, 219, /* 1890 */ 219, 228, 22, 127, 225, 166, 222, 24, 225, 114, /* 1900 */ 99, 284, 221, 101, 284, 228, 307, 315, 219, 107, /* 1910 */ 108, 219, 219, 219, 201, 92, 320, 115, 320, 117, /* 1920 */ 118, 119, 222, 83, 122, 267, 267, 149, 146, 19, /* 1930 */ 20, 22, 22, 279, 250, 134, 201, 148, 159, 249, /* 1940 */ 139, 140, 251, 141, 25, 281, 36, 147, 251, 248, /* 1950 */ 247, 203, 13, 195, 6, 195, 154, 155, 156, 157, /* 1960 */ 158, 193, 305, 193, 163, 193, 305, 302, 214, 208, /* 1970 */ 60, 214, 208, 223, 223, 4, 214, 214, 3, 22, /* 1980 */ 215, 214, 72, 208, 164, 183, 215, 15, 23, 16, /* 1990 */ 23, 140, 131, 152, 25, 143, 20, 16, 24, 1, /* 2000 */ 145, 143, 131, 131, 62, 37, 54, 54, 152, 54, /* 2010 */ 54, 101, 131, 117, 34, 1, 142, 107, 108, 22, /* 2020 */ 5, 116, 162, 69, 25, 115, 76, 117, 118, 119, /* 2030 */ 1, 2, 122, 69, 5, 41, 142, 116, 20, 10, /* 2040 */ 11, 12, 13, 14, 24, 19, 17, 132, 5, 126, /* 2050 */ 22, 141, 68, 10, 11, 12, 13, 14, 22, 30, /* 2060 */ 17, 32, 22, 22, 154, 155, 156, 157, 158, 40, /* 2070 */ 23, 68, 60, 30, 24, 32, 97, 28, 22, 68, /* 2080 */ 23, 37, 34, 40, 150, 22, 25, 23, 23, 23, /* 2090 */ 22, 98, 23, 183, 23, 117, 34, 22, 25, 89, /* 2100 */ 71, 142, 144, 76, 34, 23, 34, 76, 79, 87, /* 2110 */ 34, 82, 34, 94, 71, 34, 22, 24, 44, 34, /* 2120 */ 25, 25, 79, 23, 23, 82, 143, 23, 99, 143, /* 2130 */ 23, 22, 11, 25, 23, 25, 22, 22, 22, 1, /* 2140 */ 23, 23, 99, 136, 22, 22, 142, 142, 142, 25, /* 2150 */ 25, 23, 15, 1, 322, 322, 322, 322, 322, 322, /* 2160 */ 322, 322, 322, 134, 322, 322, 322, 322, 139, 140, /* 2170 */ 322, 322, 322, 322, 322, 322, 322, 134, 322, 322, /* 2180 */ 322, 322, 139, 140, 322, 322, 322, 322, 322, 322, /* 2190 */ 322, 322, 163, 322, 322, 322, 322, 322, 322, 322, /* 2200 */ 322, 322, 322, 322, 322, 322, 163, 322, 322, 322, /* 2210 */ 322, 322, 322, 322, 322, 322, 322, 322, 322, 322, /* 2220 */ 322, 322, 322, 322, 322, 322, 322, 322, 322, 322, /* 2230 */ 322, 322, 322, 322, 322, 322, 322, 322, 322, 322, /* 2240 */ 322, 322, 322, 322, 322, 322, 322, 322, 322, 322, /* 2250 */ 322, 322, 322, 322, 322, 322, 322, 322, 322, 322, /* 2260 */ 322, 322, 322, 322, 322, 322, 322, 322, 322, 322, /* 2270 */ 322, 322, 322, 322, 322, 322, 322, 322, 322, 322, /* 2280 */ 322, 322, 322, 322, 322, 322, 322, 322, 322, 322, /* 2290 */ 322, 322, 322, 322, 322, 322, 322, 322, 322, 322, /* 2300 */ 322, 322, 322, 322, 322, 322, 322, 322, 322, 322, /* 2310 */ 322, 322, 322, 322, 322, 322, 322, 322, 322, 322, /* 2320 */ 322, 322, 322, 322, 322, 322, 322, 322, 322, 322, /* 2330 */ 322, 322, 322, 322, 322, 322, 322, 322, 322, 322, /* 2340 */ 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, /* 2350 */ 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, /* 2360 */ 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, /* 2370 */ 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, /* 2380 */ 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, /* 2390 */ 186, 186, 186, }; #define YY_SHIFT_COUNT (582) #define YY_SHIFT_MIN (0) #define YY_SHIFT_MAX (2152) static const unsigned short int yy_shift_ofst[] = { /* 0 */ 2029, 1801, 2043, 1380, 1380, 33, 391, 1496, 1569, 1642, /* 10 */ 702, 702, 702, 193, 33, 33, 33, 33, 33, 0, /* 20 */ 0, 216, 1177, 702, 702, 702, 702, 702, 702, 702, /* 30 */ 702, 702, 702, 702, 702, 702, 702, 702, 406, 406, /* 40 */ 111, 111, 218, 447, 547, 598, 598, 260, 260, 260, /* 50 */ 260, 40, 112, 320, 340, 445, 489, 593, 637, 741, /* 60 */ 785, 889, 909, 1023, 1043, 1157, 1177, 1177, 1177, 1177, /* 70 */ 1177, 1177, 1177, 1177, 1177, 1177, 1177, 1177, 1177, 1177, /* 80 */ 1177, 1177, 1177, 1177, 1197, 1177, 1301, 1321, 1321, 554, /* 90 */ 1802, 1910, 702, 702, 702, 702, 702, 702, 702, 702, /* 100 */ 702, 702, 702, 702, 702, 702, 702, 702, 702, 702, /* 110 */ 702, 702, 702, 702, 702, 702, 702, 702, 702, 702, /* 120 */ 702, 702, 702, 702, 702, 702, 702, 702, 702, 702, /* 130 */ 702, 702, 702, 702, 702, 702, 702, 702, 702, 702, /* 140 */ 702, 702, 138, 198, 198, 198, 198, 198, 198, 198, /* 150 */ 183, 99, 236, 292, 598, 793, 167, 598, 598, 880, /* 160 */ 880, 598, 857, 150, 195, 195, 195, 264, 113, 113, /* 170 */ 2207, 2207, 854, 854, 854, 751, 765, 765, 765, 765, /* 180 */ 1096, 1096, 725, 292, 882, 904, 598, 598, 598, 598, /* 190 */ 598, 598, 598, 598, 598, 598, 598, 598, 598, 598, /* 200 */ 598, 598, 598, 598, 598, 1273, 1032, 1032, 598, 147, /* 210 */ 1098, 1098, 603, 603, 1276, 1276, 363, 2207, 2207, 2207, /* 220 */ 2207, 2207, 2207, 2207, 469, 617, 617, 801, 336, 461, /* 230 */ 804, 864, 615, 891, 913, 598, 598, 598, 598, 598, /* 240 */ 598, 598, 598, 598, 598, 653, 598, 598, 598, 598, /* 250 */ 598, 598, 598, 598, 598, 598, 598, 598, 1105, 1105, /* 260 */ 1105, 598, 598, 598, 1194, 598, 598, 598, 1215, 1249, /* 270 */ 598, 1353, 598, 598, 598, 598, 598, 598, 598, 598, /* 280 */ 677, 449, 902, 1338, 1338, 1338, 1338, 1248, 902, 902, /* 290 */ 326, 1151, 1047, 755, 749, 1371, 960, 1371, 1007, 1162, /* 300 */ 749, 749, 1162, 749, 960, 1007, 1274, 738, 215, 1300, /* 310 */ 1300, 1300, 1395, 1395, 1395, 1395, 1368, 1368, 1033, 1414, /* 320 */ 1387, 1361, 1759, 1759, 1685, 1685, 1792, 1792, 1685, 1683, /* 330 */ 1686, 1814, 1797, 1825, 1825, 1825, 1825, 1685, 1836, 1707, /* 340 */ 1686, 1686, 1707, 1814, 1797, 1707, 1797, 1707, 1685, 1836, /* 350 */ 1710, 1807, 1685, 1836, 1854, 1685, 1836, 1685, 1836, 1854, /* 360 */ 1769, 1769, 1769, 1822, 1870, 1870, 1854, 1769, 1766, 1769, /* 370 */ 1822, 1769, 1769, 1729, 1873, 1785, 1785, 1854, 1685, 1823, /* 380 */ 1823, 1840, 1840, 1778, 1782, 1909, 1685, 1779, 1778, 1789, /* 390 */ 1800, 1707, 1919, 1939, 1939, 1948, 1948, 1948, 2207, 2207, /* 400 */ 2207, 2207, 2207, 2207, 2207, 2207, 2207, 2207, 2207, 2207, /* 410 */ 2207, 2207, 2207, 69, 1037, 79, 1088, 651, 1196, 1415, /* 420 */ 1501, 1439, 1369, 1452, 911, 1211, 1524, 1469, 1551, 1567, /* 430 */ 1570, 1624, 1640, 1644, 1499, 1440, 1572, 1464, 1597, 275, /* 440 */ 782, 1586, 1648, 1678, 1553, 1682, 1687, 1388, 1502, 1696, /* 450 */ 1706, 1588, 1486, 1971, 1975, 1957, 1820, 1972, 1973, 1965, /* 460 */ 1967, 1851, 1841, 1861, 1969, 1969, 1974, 1852, 1976, 1855, /* 470 */ 1981, 1998, 1858, 1871, 1969, 1872, 1942, 1968, 1969, 1856, /* 480 */ 1952, 1953, 1955, 1956, 1881, 1896, 1980, 1874, 2014, 2015, /* 490 */ 1997, 1905, 1860, 1954, 1999, 1964, 1950, 1994, 1894, 1921, /* 500 */ 2020, 2018, 2026, 1915, 1923, 2028, 1984, 2036, 2040, 2047, /* 510 */ 2041, 2003, 2012, 2050, 1979, 2049, 2056, 2011, 2044, 2057, /* 520 */ 2048, 1934, 2063, 2064, 2065, 2061, 2066, 2068, 1993, 1959, /* 530 */ 2069, 2071, 1978, 2062, 2075, 1958, 2073, 2070, 2072, 2076, /* 540 */ 2078, 2010, 2027, 2022, 2074, 2031, 2019, 2081, 2082, 2094, /* 550 */ 2093, 2095, 2096, 2085, 1983, 1986, 2100, 2073, 2101, 2104, /* 560 */ 2107, 2109, 2108, 2110, 2111, 2114, 2121, 2115, 2116, 2117, /* 570 */ 2118, 2122, 2123, 2124, 2007, 2004, 2005, 2006, 2125, 2128, /* 580 */ 2137, 2138, 2152, }; #define YY_REDUCE_COUNT (412) #define YY_REDUCE_MIN (-276) #define YY_REDUCE_MAX (1775) static const short yy_reduce_ofst[] = { /* 0 */ -66, 217, -63, -177, -180, 161, 364, 64, -183, 162, /* 10 */ 223, 367, 414, -173, 473, 514, 525, 622, 626, -207, /* 20 */ 351, -276, -38, 693, 811, 831, 833, 888, -188, 945, /* 30 */ 947, 416, 558, 951, 867, 287, 1078, 1080, -186, 224, /* 40 */ -132, 42, 964, 269, 417, 796, 810, -237, -231, -237, /* 50 */ -231, -45, -45, -45, -45, -45, -45, -45, -45, -45, /* 60 */ -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, /* 70 */ -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, /* 80 */ -45, -45, -45, -45, -45, -45, -45, -45, -45, 895, /* 90 */ 925, 967, 980, 1100, 1143, 1169, 1203, 1225, 1228, 1242, /* 100 */ 1247, 1250, 1253, 1255, 1261, 1267, 1272, 1275, 1283, 1286, /* 110 */ 1288, 1292, 1333, 1335, 1347, 1349, 1352, 1354, 1360, 1366, /* 120 */ 1381, 1391, 1406, 1408, 1413, 1416, 1418, 1422, 1425, 1427, /* 130 */ 1463, 1465, 1472, 1478, 1480, 1491, 1498, 1500, 1517, 1519, /* 140 */ 1528, 1536, -45, -45, -45, -45, -45, -45, -45, -45, /* 150 */ -45, -45, -45, 312, -158, 285, -219, 9, 166, 370, /* 160 */ 545, 707, -45, 930, 601, 963, 1067, 792, -45, -45, /* 170 */ -45, -45, -204, -204, -204, 369, -171, -129, 632, 678, /* 180 */ 202, 352, -270, 412, 627, 627, -9, 122, 415, 419, /* 190 */ -56, 248, 583, 920, 6, 261, 459, 795, 1049, 813, /* 200 */ 1062, 1082, -161, 778, 1063, 797, 870, 1003, 1128, 443, /* 210 */ 1031, 1072, 1191, 1192, 957, 1120, 105, 1149, 523, 933, /* 220 */ 1218, 1238, 1254, 1251, -138, 96, 117, 146, 181, 277, /* 230 */ 280, 421, 480, 712, 830, 850, 1085, 1099, 1129, 1209, /* 240 */ 1323, 1331, 1336, 1364, 1407, 368, 1412, 1433, 1438, 1474, /* 250 */ 1481, 1505, 1506, 1526, 1538, 1544, 1545, 1546, 722, 764, /* 260 */ 856, 1547, 1548, 1550, 1188, 1554, 1557, 1561, 1298, 1260, /* 270 */ 1562, 1456, 1564, 280, 1568, 1571, 1573, 1574, 1575, 1576, /* 280 */ 1457, 1477, 1520, 1514, 1515, 1516, 1518, 1188, 1520, 1520, /* 290 */ 1530, 1563, 1584, 1482, 1504, 1510, 1534, 1513, 1488, 1537, /* 300 */ 1512, 1521, 1539, 1522, 1541, 1493, 1583, 1559, 1565, 1585, /* 310 */ 1587, 1589, 1529, 1531, 1532, 1549, 1558, 1566, 1535, 1577, /* 320 */ 1582, 1622, 1533, 1540, 1627, 1628, 1552, 1555, 1633, 1560, /* 330 */ 1578, 1581, 1607, 1606, 1608, 1609, 1611, 1649, 1655, 1612, /* 340 */ 1590, 1591, 1613, 1594, 1621, 1614, 1623, 1616, 1666, 1668, /* 350 */ 1579, 1593, 1672, 1675, 1656, 1676, 1679, 1680, 1688, 1660, /* 360 */ 1667, 1670, 1671, 1663, 1669, 1673, 1674, 1689, 1681, 1692, /* 370 */ 1677, 1693, 1694, 1592, 1599, 1617, 1620, 1700, 1713, 1596, /* 380 */ 1598, 1658, 1659, 1691, 1684, 1654, 1735, 1664, 1697, 1690, /* 390 */ 1701, 1703, 1748, 1758, 1760, 1768, 1770, 1772, 1657, 1661, /* 400 */ 1665, 1761, 1754, 1757, 1762, 1763, 1764, 1750, 1751, 1765, /* 410 */ 1771, 1767, 1775, }; static const YYACTIONTYPE yy_default[] = { /* 0 */ 1663, 1663, 1663, 1491, 1254, 1367, 1254, 1254, 1254, 1254, /* 10 */ 1491, 1491, 1491, 1254, 1254, 1254, 1254, 1254, 1254, 1397, /* 20 */ 1397, 1544, 1287, 1254, 1254, 1254, 1254, 1254, 1254, 1254, /* 30 */ 1254, 1254, 1254, 1254, 1254, 1490, 1254, 1254, 1254, 1254, /* 40 */ 1578, 1578, 1254, 1254, 1254, 1254, 1254, 1563, 1562, 1254, |
︙ | ︙ | |||
173947 173948 173949 173950 173951 173952 173953 | ** to revert to identifiers if they keyword does not apply in the context where ** it appears. */ #ifdef YYFALLBACK static const YYCODETYPE yyFallback[] = { 0, /* $ => nothing */ 0, /* SEMI => nothing */ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | > | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 174242 174243 174244 174245 174246 174247 174248 174249 174250 174251 174252 174253 174254 174255 174256 174257 174258 174259 174260 174261 174262 174263 174264 174265 174266 174267 174268 174269 174270 174271 174272 174273 174274 174275 174276 174277 174278 174279 174280 174281 174282 174283 174284 174285 174286 174287 174288 174289 174290 174291 174292 174293 174294 174295 174296 174297 174298 174299 174300 174301 174302 174303 174304 174305 174306 174307 174308 174309 174310 174311 174312 174313 174314 174315 174316 174317 174318 174319 174320 174321 174322 174323 174324 174325 174326 174327 174328 174329 174330 174331 174332 174333 174334 174335 174336 174337 174338 174339 174340 174341 174342 174343 174344 174345 174346 174347 174348 174349 174350 174351 174352 174353 174354 174355 | ** to revert to identifiers if they keyword does not apply in the context where ** it appears. */ #ifdef YYFALLBACK static const YYCODETYPE yyFallback[] = { 0, /* $ => nothing */ 0, /* SEMI => nothing */ 60, /* EXPLAIN => ID */ 60, /* QUERY => ID */ 60, /* PLAN => ID */ 60, /* BEGIN => ID */ 0, /* TRANSACTION => nothing */ 60, /* DEFERRED => ID */ 60, /* IMMEDIATE => ID */ 60, /* EXCLUSIVE => ID */ 0, /* COMMIT => nothing */ 60, /* END => ID */ 60, /* ROLLBACK => ID */ 60, /* SAVEPOINT => ID */ 60, /* RELEASE => ID */ 0, /* TO => nothing */ 0, /* TABLE => nothing */ 0, /* CREATE => nothing */ 60, /* IF => ID */ 0, /* NOT => nothing */ 0, /* EXISTS => nothing */ 60, /* TEMP => ID */ 0, /* LP => nothing */ 0, /* RP => nothing */ 0, /* AS => nothing */ 0, /* COMMA => nothing */ 60, /* WITHOUT => ID */ 60, /* ABORT => ID */ 60, /* ACTION => ID */ 60, /* AFTER => ID */ 60, /* ANALYZE => ID */ 60, /* ASC => ID */ 60, /* ATTACH => ID */ 60, /* BEFORE => ID */ 60, /* BY => ID */ 60, /* CASCADE => ID */ 60, /* CAST => ID */ 60, /* CONFLICT => ID */ 60, /* DATABASE => ID */ 60, /* DESC => ID */ 60, /* DETACH => ID */ 60, /* EACH => ID */ 60, /* FAIL => ID */ 0, /* OR => nothing */ 0, /* AND => nothing */ 0, /* IS => nothing */ 0, /* ISNOT => nothing */ 60, /* MATCH => ID */ 60, /* LIKE_KW => ID */ 0, /* BETWEEN => nothing */ 0, /* IN => nothing */ 0, /* ISNULL => nothing */ 0, /* NOTNULL => nothing */ 0, /* NE => nothing */ 0, /* EQ => nothing */ 0, /* GT => nothing */ 0, /* LE => nothing */ 0, /* LT => nothing */ 0, /* GE => nothing */ 0, /* ESCAPE => nothing */ 0, /* ID => nothing */ 60, /* COLUMNKW => ID */ 60, /* DO => ID */ 60, /* FOR => ID */ 60, /* IGNORE => ID */ 60, /* INITIALLY => ID */ 60, /* INSTEAD => ID */ 60, /* NO => ID */ 60, /* KEY => ID */ 60, /* OF => ID */ 60, /* OFFSET => ID */ 60, /* PRAGMA => ID */ 60, /* RAISE => ID */ 60, /* RECURSIVE => ID */ 60, /* REPLACE => ID */ 60, /* RESTRICT => ID */ 60, /* ROW => ID */ 60, /* ROWS => ID */ 60, /* TRIGGER => ID */ 60, /* VACUUM => ID */ 60, /* VIEW => ID */ 60, /* VIRTUAL => ID */ 60, /* WITH => ID */ 60, /* NULLS => ID */ 60, /* FIRST => ID */ 60, /* LAST => ID */ 60, /* CURRENT => ID */ 60, /* FOLLOWING => ID */ 60, /* PARTITION => ID */ 60, /* PRECEDING => ID */ 60, /* RANGE => ID */ 60, /* UNBOUNDED => ID */ 60, /* EXCLUDE => ID */ 60, /* GROUPS => ID */ 60, /* OTHERS => ID */ 60, /* TIES => ID */ 60, /* GENERATED => ID */ 60, /* ALWAYS => ID */ 60, /* MATERIALIZED => ID */ 60, /* REINDEX => ID */ 60, /* RENAME => ID */ 60, /* CTIME_KW => ID */ 0, /* ANY => nothing */ 0, /* BITAND => nothing */ 0, /* BITOR => nothing */ 0, /* LSHIFT => nothing */ 0, /* RSHIFT => nothing */ 0, /* PLUS => nothing */ 0, /* MINUS => nothing */ |
︙ | ︙ | |||
174116 174117 174118 174119 174120 174121 174122 | 0, /* WINDOW => nothing */ 0, /* OVER => nothing */ 0, /* FILTER => nothing */ 0, /* COLUMN => nothing */ 0, /* AGG_FUNCTION => nothing */ 0, /* AGG_COLUMN => nothing */ 0, /* TRUEFALSE => nothing */ | < | 174412 174413 174414 174415 174416 174417 174418 174419 174420 174421 174422 174423 174424 174425 | 0, /* WINDOW => nothing */ 0, /* OVER => nothing */ 0, /* FILTER => nothing */ 0, /* COLUMN => nothing */ 0, /* AGG_FUNCTION => nothing */ 0, /* AGG_COLUMN => nothing */ 0, /* TRUEFALSE => nothing */ 0, /* FUNCTION => nothing */ 0, /* UPLUS => nothing */ 0, /* UMINUS => nothing */ 0, /* TRUTH => nothing */ 0, /* REGISTER => nothing */ 0, /* VECTOR => nothing */ 0, /* SELECT_COLUMN => nothing */ |
︙ | ︙ | |||
174260 174261 174262 174263 174264 174265 174266 | /* 39 */ "DESC", /* 40 */ "DETACH", /* 41 */ "EACH", /* 42 */ "FAIL", /* 43 */ "OR", /* 44 */ "AND", /* 45 */ "IS", | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 174555 174556 174557 174558 174559 174560 174561 174562 174563 174564 174565 174566 174567 174568 174569 174570 174571 174572 174573 174574 174575 174576 174577 174578 174579 174580 174581 174582 174583 174584 174585 174586 174587 174588 174589 174590 174591 174592 174593 174594 174595 174596 174597 174598 174599 174600 174601 174602 174603 174604 174605 174606 174607 174608 174609 174610 174611 174612 174613 174614 174615 174616 174617 174618 174619 174620 174621 174622 174623 174624 174625 174626 174627 174628 174629 174630 174631 174632 174633 174634 174635 174636 174637 174638 174639 174640 174641 174642 174643 174644 174645 174646 174647 174648 174649 174650 174651 174652 174653 174654 174655 174656 174657 174658 174659 174660 174661 174662 174663 174664 174665 174666 174667 174668 174669 174670 174671 174672 174673 174674 174675 174676 174677 174678 174679 174680 174681 174682 174683 174684 174685 174686 174687 174688 174689 174690 174691 174692 174693 174694 | /* 39 */ "DESC", /* 40 */ "DETACH", /* 41 */ "EACH", /* 42 */ "FAIL", /* 43 */ "OR", /* 44 */ "AND", /* 45 */ "IS", /* 46 */ "ISNOT", /* 47 */ "MATCH", /* 48 */ "LIKE_KW", /* 49 */ "BETWEEN", /* 50 */ "IN", /* 51 */ "ISNULL", /* 52 */ "NOTNULL", /* 53 */ "NE", /* 54 */ "EQ", /* 55 */ "GT", /* 56 */ "LE", /* 57 */ "LT", /* 58 */ "GE", /* 59 */ "ESCAPE", /* 60 */ "ID", /* 61 */ "COLUMNKW", /* 62 */ "DO", /* 63 */ "FOR", /* 64 */ "IGNORE", /* 65 */ "INITIALLY", /* 66 */ "INSTEAD", /* 67 */ "NO", /* 68 */ "KEY", /* 69 */ "OF", /* 70 */ "OFFSET", /* 71 */ "PRAGMA", /* 72 */ "RAISE", /* 73 */ "RECURSIVE", /* 74 */ "REPLACE", /* 75 */ "RESTRICT", /* 76 */ "ROW", /* 77 */ "ROWS", /* 78 */ "TRIGGER", /* 79 */ "VACUUM", /* 80 */ "VIEW", /* 81 */ "VIRTUAL", /* 82 */ "WITH", /* 83 */ "NULLS", /* 84 */ "FIRST", /* 85 */ "LAST", /* 86 */ "CURRENT", /* 87 */ "FOLLOWING", /* 88 */ "PARTITION", /* 89 */ "PRECEDING", /* 90 */ "RANGE", /* 91 */ "UNBOUNDED", /* 92 */ "EXCLUDE", /* 93 */ "GROUPS", /* 94 */ "OTHERS", /* 95 */ "TIES", /* 96 */ "GENERATED", /* 97 */ "ALWAYS", /* 98 */ "MATERIALIZED", /* 99 */ "REINDEX", /* 100 */ "RENAME", /* 101 */ "CTIME_KW", /* 102 */ "ANY", /* 103 */ "BITAND", /* 104 */ "BITOR", /* 105 */ "LSHIFT", /* 106 */ "RSHIFT", /* 107 */ "PLUS", /* 108 */ "MINUS", /* 109 */ "STAR", /* 110 */ "SLASH", /* 111 */ "REM", /* 112 */ "CONCAT", /* 113 */ "PTR", /* 114 */ "COLLATE", /* 115 */ "BITNOT", /* 116 */ "ON", /* 117 */ "INDEXED", /* 118 */ "STRING", /* 119 */ "JOIN_KW", /* 120 */ "CONSTRAINT", /* 121 */ "DEFAULT", /* 122 */ "NULL", /* 123 */ "PRIMARY", /* 124 */ "UNIQUE", /* 125 */ "CHECK", /* 126 */ "REFERENCES", /* 127 */ "AUTOINCR", /* 128 */ "INSERT", /* 129 */ "DELETE", /* 130 */ "UPDATE", /* 131 */ "SET", /* 132 */ "DEFERRABLE", /* 133 */ "FOREIGN", /* 134 */ "DROP", /* 135 */ "UNION", /* 136 */ "ALL", /* 137 */ "EXCEPT", /* 138 */ "INTERSECT", /* 139 */ "SELECT", /* 140 */ "VALUES", /* 141 */ "DISTINCT", /* 142 */ "DOT", /* 143 */ "FROM", /* 144 */ "JOIN", /* 145 */ "USING", /* 146 */ "ORDER", /* 147 */ "GROUP", /* 148 */ "HAVING", /* 149 */ "LIMIT", /* 150 */ "WHERE", /* 151 */ "RETURNING", /* 152 */ "INTO", /* 153 */ "NOTHING", /* 154 */ "FLOAT", /* 155 */ "BLOB", /* 156 */ "INTEGER", /* 157 */ "VARIABLE", /* 158 */ "CASE", /* 159 */ "WHEN", /* 160 */ "THEN", /* 161 */ "ELSE", /* 162 */ "INDEX", /* 163 */ "ALTER", /* 164 */ "ADD", /* 165 */ "WINDOW", /* 166 */ "OVER", /* 167 */ "FILTER", /* 168 */ "COLUMN", /* 169 */ "AGG_FUNCTION", /* 170 */ "AGG_COLUMN", /* 171 */ "TRUEFALSE", /* 172 */ "FUNCTION", /* 173 */ "UPLUS", /* 174 */ "UMINUS", /* 175 */ "TRUTH", /* 176 */ "REGISTER", /* 177 */ "VECTOR", /* 178 */ "SELECT_COLUMN", |
︙ | ︙ | |||
236535 236536 236537 236538 236539 236540 236541 | */ static void sqlite3Fts5ConfigFree(Fts5Config *pConfig){ if( pConfig ){ int i; if( pConfig->t.pTok ){ pConfig->t.pTokApi->xDelete(pConfig->t.pTok); } | | | 236830 236831 236832 236833 236834 236835 236836 236837 236838 236839 236840 236841 236842 236843 236844 | */ static void sqlite3Fts5ConfigFree(Fts5Config *pConfig){ if( pConfig ){ int i; if( pConfig->t.pTok ){ pConfig->t.pTokApi->xDelete(pConfig->t.pTok); } sqlite3_free((char*)pConfig->t.azArg); sqlite3_free(pConfig->zDb); sqlite3_free(pConfig->zName); for(i=0; i<pConfig->nCol; i++){ sqlite3_free(pConfig->azCol[i]); } sqlite3_free(pConfig->azCol); sqlite3_free(pConfig->aPrefix); |
︙ | ︙ | |||
250350 250351 250352 250353 250354 250355 250356 | ** Equality constraint against the rowid: "=" ** A < or <= against the rowid: "<" ** A > or >= against the rowid: ">" ** ** This function ensures that there is at most one "r" or "=". And that if ** there exists an "=" then there is no "<" or ">". ** | | > < | | 250645 250646 250647 250648 250649 250650 250651 250652 250653 250654 250655 250656 250657 250658 250659 250660 250661 250662 250663 | ** Equality constraint against the rowid: "=" ** A < or <= against the rowid: "<" ** A > or >= against the rowid: ">" ** ** This function ensures that there is at most one "r" or "=". And that if ** there exists an "=" then there is no "<" or ">". ** ** If an unusable MATCH operator is present in the WHERE clause, then ** SQLITE_CONSTRAINT is returned. ** ** Costs are assigned as follows: ** ** a) If a MATCH operator is present, the cost depends on the other ** constraints also present. As follows: ** ** * No other constraints: cost=1000.0 ** * One rowid range constraint: cost=750.0 ** * Both rowid range constraints: cost=500.0 ** * An == rowid constraint: cost=100.0 |
︙ | ︙ | |||
250386 250387 250388 250389 250390 250391 250392 | char *idxStr; int iIdxStr = 0; int iCons = 0; int bSeenEq = 0; int bSeenGt = 0; int bSeenLt = 0; | | | 250681 250682 250683 250684 250685 250686 250687 250688 250689 250690 250691 250692 250693 250694 250695 | char *idxStr; int iIdxStr = 0; int iCons = 0; int bSeenEq = 0; int bSeenGt = 0; int bSeenLt = 0; int nSeenMatch = 0; int bSeenRank = 0; assert( SQLITE_INDEX_CONSTRAINT_EQ<SQLITE_INDEX_CONSTRAINT_MATCH ); assert( SQLITE_INDEX_CONSTRAINT_GT<SQLITE_INDEX_CONSTRAINT_MATCH ); assert( SQLITE_INDEX_CONSTRAINT_LE<SQLITE_INDEX_CONSTRAINT_MATCH ); assert( SQLITE_INDEX_CONSTRAINT_GE<SQLITE_INDEX_CONSTRAINT_MATCH ); |
︙ | ︙ | |||
250417 250418 250419 250420 250421 250422 250423 | int iCol = p->iColumn; if( p->op==SQLITE_INDEX_CONSTRAINT_MATCH || (p->op==SQLITE_INDEX_CONSTRAINT_EQ && iCol>=nCol) ){ /* A MATCH operator or equivalent */ if( p->usable==0 || iCol<0 ){ /* As there exists an unusable MATCH constraint this is an | | < < < | | | | 250712 250713 250714 250715 250716 250717 250718 250719 250720 250721 250722 250723 250724 250725 250726 250727 250728 250729 250730 250731 250732 250733 250734 250735 250736 250737 250738 250739 250740 250741 250742 250743 250744 250745 250746 250747 250748 250749 250750 250751 | int iCol = p->iColumn; if( p->op==SQLITE_INDEX_CONSTRAINT_MATCH || (p->op==SQLITE_INDEX_CONSTRAINT_EQ && iCol>=nCol) ){ /* A MATCH operator or equivalent */ if( p->usable==0 || iCol<0 ){ /* As there exists an unusable MATCH constraint this is an ** unusable plan. Return SQLITE_CONSTRAINT. */ return SQLITE_CONSTRAINT; }else{ if( iCol==nCol+1 ){ if( bSeenRank ) continue; idxStr[iIdxStr++] = 'r'; bSeenRank = 1; }else if( iCol>=0 ){ nSeenMatch++; idxStr[iIdxStr++] = 'M'; sqlite3_snprintf(6, &idxStr[iIdxStr], "%d", iCol); idxStr += strlen(&idxStr[iIdxStr]); assert( idxStr[iIdxStr]=='\0' ); } pInfo->aConstraintUsage[i].argvIndex = ++iCons; pInfo->aConstraintUsage[i].omit = 1; } }else if( p->usable ){ if( iCol>=0 && iCol<nCol && fts5UsePatternMatch(pConfig, p) ){ assert( p->op==FTS5_PATTERN_LIKE || p->op==FTS5_PATTERN_GLOB ); idxStr[iIdxStr++] = p->op==FTS5_PATTERN_LIKE ? 'L' : 'G'; sqlite3_snprintf(6, &idxStr[iIdxStr], "%d", iCol); idxStr += strlen(&idxStr[iIdxStr]); pInfo->aConstraintUsage[i].argvIndex = ++iCons; assert( idxStr[iIdxStr]=='\0' ); nSeenMatch++; }else if( bSeenEq==0 && p->op==SQLITE_INDEX_CONSTRAINT_EQ && iCol<0 ){ idxStr[iIdxStr++] = '='; bSeenEq = 1; pInfo->aConstraintUsage[i].argvIndex = ++iCons; } } } |
︙ | ︙ | |||
250482 250483 250484 250485 250486 250487 250488 | /* Set idxFlags flags for the ORDER BY clause ** ** Note that tokendata=1 tables cannot currently handle "ORDER BY rowid DESC". */ if( pInfo->nOrderBy==1 ){ int iSort = pInfo->aOrderBy[0].iColumn; | | | | | | > > > | | 250774 250775 250776 250777 250778 250779 250780 250781 250782 250783 250784 250785 250786 250787 250788 250789 250790 250791 250792 250793 250794 250795 250796 250797 250798 250799 250800 250801 250802 250803 250804 250805 250806 250807 250808 250809 250810 250811 250812 250813 | /* Set idxFlags flags for the ORDER BY clause ** ** Note that tokendata=1 tables cannot currently handle "ORDER BY rowid DESC". */ if( pInfo->nOrderBy==1 ){ int iSort = pInfo->aOrderBy[0].iColumn; if( iSort==(pConfig->nCol+1) && nSeenMatch>0 ){ idxFlags |= FTS5_BI_ORDER_RANK; }else if( iSort==-1 && (!pInfo->aOrderBy[0].desc || !pConfig->bTokendata) ){ idxFlags |= FTS5_BI_ORDER_ROWID; } if( BitFlagTest(idxFlags, FTS5_BI_ORDER_RANK|FTS5_BI_ORDER_ROWID) ){ pInfo->orderByConsumed = 1; if( pInfo->aOrderBy[0].desc ){ idxFlags |= FTS5_BI_ORDER_DESC; } } } /* Calculate the estimated cost based on the flags set in idxFlags. */ if( bSeenEq ){ pInfo->estimatedCost = nSeenMatch ? 1000.0 : 10.0; if( nSeenMatch==0 ) fts5SetUniqueFlag(pInfo); }else if( bSeenLt && bSeenGt ){ pInfo->estimatedCost = nSeenMatch ? 5000.0 : 250000.0; }else if( bSeenLt || bSeenGt ){ pInfo->estimatedCost = nSeenMatch ? 7500.0 : 750000.0; }else{ pInfo->estimatedCost = nSeenMatch ? 10000.0 : 1000000.0; } for(i=1; i<nSeenMatch; i++){ pInfo->estimatedCost *= 0.4; } pInfo->idxNum = idxFlags; return SQLITE_OK; } static int fts5NewTransaction(Fts5FullTable *pTab){ |
︙ | ︙ | |||
251520 251521 251522 251523 251524 251525 251526 251527 251528 251529 251530 251531 251532 251533 | if( pConfig->bContentlessDelete ){ fts5SetVtabError(pTab, "'delete' may not be used with a contentless_delete=1 table" ); rc = SQLITE_ERROR; }else{ rc = fts5SpecialDelete(pTab, apVal); } }else{ rc = fts5SpecialInsert(pTab, z, apVal[2 + pConfig->nCol + 1]); } }else{ /* A regular INSERT, UPDATE or DELETE statement. The trick here is that ** any conflict on the rowid value must be detected before any | > | 251815 251816 251817 251818 251819 251820 251821 251822 251823 251824 251825 251826 251827 251828 251829 | if( pConfig->bContentlessDelete ){ fts5SetVtabError(pTab, "'delete' may not be used with a contentless_delete=1 table" ); rc = SQLITE_ERROR; }else{ rc = fts5SpecialDelete(pTab, apVal); bUpdateOrDelete = 1; } }else{ rc = fts5SpecialInsert(pTab, z, apVal[2 + pConfig->nCol + 1]); } }else{ /* A regular INSERT, UPDATE or DELETE statement. The trick here is that ** any conflict on the rowid value must be detected before any |
︙ | ︙ | |||
252773 252774 252775 252776 252777 252778 252779 | static void fts5SourceIdFunc( sqlite3_context *pCtx, /* Function call context */ int nArg, /* Number of args */ sqlite3_value **apUnused /* Function arguments */ ){ assert( nArg==0 ); UNUSED_PARAM2(nArg, apUnused); | | | 253069 253070 253071 253072 253073 253074 253075 253076 253077 253078 253079 253080 253081 253082 253083 | static void fts5SourceIdFunc( sqlite3_context *pCtx, /* Function call context */ int nArg, /* Number of args */ sqlite3_value **apUnused /* Function arguments */ ){ assert( nArg==0 ); UNUSED_PARAM2(nArg, apUnused); sqlite3_result_text(pCtx, "fts5: 2024-06-11 17:37:36 5f25a9518a675efbd0525cc2f5595ee7bc7122be7cfecdf6b20c909185dea370", -1, SQLITE_TRANSIENT); } /* ** Return true if zName is the extension on one of the shadow tables used ** by this module. */ static int fts5ShadowName(const char *zName){ |
︙ | ︙ |
Changes to extsrc/sqlite3.h.
︙ | ︙ | |||
144 145 146 147 148 149 150 | ** ** See also: [sqlite3_libversion()], ** [sqlite3_libversion_number()], [sqlite3_sourceid()], ** [sqlite_version()] and [sqlite_source_id()]. */ #define SQLITE_VERSION "3.47.0" #define SQLITE_VERSION_NUMBER 3047000 | | | 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 | ** ** See also: [sqlite3_libversion()], ** [sqlite3_libversion_number()], [sqlite3_sourceid()], ** [sqlite_version()] and [sqlite_source_id()]. */ #define SQLITE_VERSION "3.47.0" #define SQLITE_VERSION_NUMBER 3047000 #define SQLITE_SOURCE_ID "2024-06-11 18:22:48 33a3f327855b427ae6ba0057218d043a1417bc9d780728f47f23acdd836e1686" /* ** CAPI3REF: Run-Time Library Version Numbers ** KEYWORDS: sqlite3_version sqlite3_sourceid ** ** These interfaces provide the same information as the [SQLITE_VERSION], ** [SQLITE_VERSION_NUMBER], and [SQLITE_SOURCE_ID] C preprocessor macros |
︙ | ︙ | |||
10828 10829 10830 10831 10832 10833 10834 | #ifdef SQLITE_OMIT_FLOATING_POINT # undef double #endif #if defined(__wasi__) # undef SQLITE_WASI # define SQLITE_WASI 1 | < < | 10828 10829 10830 10831 10832 10833 10834 10835 10836 10837 10838 10839 10840 10841 | #ifdef SQLITE_OMIT_FLOATING_POINT # undef double #endif #if defined(__wasi__) # undef SQLITE_WASI # define SQLITE_WASI 1 # ifndef SQLITE_OMIT_LOAD_EXTENSION # define SQLITE_OMIT_LOAD_EXTENSION # endif # ifndef SQLITE_THREADSAFE # define SQLITE_THREADSAFE 0 # endif #endif |
︙ | ︙ |