| | @@ -452,11 +452,11 @@ |
| 452 | 452 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 453 | 453 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 454 | 454 | */ |
| 455 | 455 | #define SQLITE_VERSION "3.39.0" |
| 456 | 456 | #define SQLITE_VERSION_NUMBER 3039000 |
| 457 | | -#define SQLITE_SOURCE_ID "2022-05-10 00:24:01 c6c3115f3a008cf9b0d7c5c812f17e38c8a75a904032c5f05f0bea03a7340527" |
| 457 | +#define SQLITE_SOURCE_ID "2022-06-15 16:26:37 56c60a35ea457f06db58ec3f694a1ae16fd03e6625da1d7879d63d72bbcb1c62" |
| 458 | 458 | |
| 459 | 459 | /* |
| 460 | 460 | ** CAPI3REF: Run-Time Library Version Numbers |
| 461 | 461 | ** KEYWORDS: sqlite3_version sqlite3_sourceid |
| 462 | 462 | ** |
| | @@ -6580,10 +6580,32 @@ |
| 6580 | 6580 | ** to the [sqlite3_prepare_v2()] call (or its variants) that was used to |
| 6581 | 6581 | ** create the statement in the first place. |
| 6582 | 6582 | */ |
| 6583 | 6583 | SQLITE_API sqlite3 *sqlite3_db_handle(sqlite3_stmt*); |
| 6584 | 6584 | |
| 6585 | +/* |
| 6586 | +** CAPI3REF: Return The Schema Name For A Database Connection |
| 6587 | +** METHOD: sqlite3 |
| 6588 | +** |
| 6589 | +** ^The sqlite3_db_name(D,N) interface returns a pointer to the schema name |
| 6590 | +** for the N-th database on database connection D, or a NULL pointer of N is |
| 6591 | +** out of range. An N alue of 0 means the main database file. An N of 1 is |
| 6592 | +** the "temp" schema. Larger values of N correspond to various ATTACH-ed |
| 6593 | +** databases. |
| 6594 | +** |
| 6595 | +** Space to hold the string that is returned by sqlite3_db_name() is managed |
| 6596 | +** by SQLite itself. The string might be deallocated by any operation that |
| 6597 | +** changes the schema, including [ATTACH] or [DETACH] or calls to |
| 6598 | +** [sqlite3_serialize()] or [sqlite3_deserialize()], even operations that |
| 6599 | +** occur on a different thread. Applications that need to |
| 6600 | +** remember the string long-term should make their own copy. Applications that |
| 6601 | +** are accessing the same database connection simultaneously on multiple |
| 6602 | +** threads should mutex-protect calls to this API and should make their own |
| 6603 | +** private copy of the result prior to releasing the mutex. |
| 6604 | +*/ |
| 6605 | +SQLITE_API const char *sqlite3_db_name(sqlite3 *db, int N); |
| 6606 | + |
| 6585 | 6607 | /* |
| 6586 | 6608 | ** CAPI3REF: Return The Filename For A Database Connection |
| 6587 | 6609 | ** METHOD: sqlite3 |
| 6588 | 6610 | ** |
| 6589 | 6611 | ** ^The sqlite3_db_filename(D,N) interface returns a pointer to the filename |
| | @@ -15702,17 +15724,18 @@ |
| 15702 | 15724 | #define OP_VInitIn 174 /* synopsis: r[P2]=ValueList(P1,P3) */ |
| 15703 | 15725 | #define OP_VColumn 175 /* synopsis: r[P3]=vcolumn(P2) */ |
| 15704 | 15726 | #define OP_VRename 176 |
| 15705 | 15727 | #define OP_Pagecount 177 |
| 15706 | 15728 | #define OP_MaxPgcnt 178 |
| 15707 | | -#define OP_FilterAdd 179 /* synopsis: filter(P1) += key(P3@P4) */ |
| 15708 | | -#define OP_Trace 180 |
| 15709 | | -#define OP_CursorHint 181 |
| 15710 | | -#define OP_ReleaseReg 182 /* synopsis: release r[P1@P2] mask P3 */ |
| 15711 | | -#define OP_Noop 183 |
| 15712 | | -#define OP_Explain 184 |
| 15713 | | -#define OP_Abortable 185 |
| 15729 | +#define OP_ClrSubtype 179 /* synopsis: r[P1].subtype = 0 */ |
| 15730 | +#define OP_FilterAdd 180 /* synopsis: filter(P1) += key(P3@P4) */ |
| 15731 | +#define OP_Trace 181 |
| 15732 | +#define OP_CursorHint 182 |
| 15733 | +#define OP_ReleaseReg 183 /* synopsis: release r[P1@P2] mask P3 */ |
| 15734 | +#define OP_Noop 184 |
| 15735 | +#define OP_Explain 185 |
| 15736 | +#define OP_Abortable 186 |
| 15714 | 15737 | |
| 15715 | 15738 | /* Properties such as "out2" or "jump" that are specified in |
| 15716 | 15739 | ** comments following the "case" for each opcode in the vdbe.c |
| 15717 | 15740 | ** are encoded into bitvectors as follows: |
| 15718 | 15741 | */ |
| | @@ -15743,12 +15766,12 @@ |
| 15743 | 15766 | /* 136 */ 0x00, 0x00, 0x04, 0x04, 0x00, 0x00, 0x10, 0x00,\ |
| 15744 | 15767 | /* 144 */ 0x10, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00,\ |
| 15745 | 15768 | /* 152 */ 0x00, 0x10, 0x00, 0x00, 0x06, 0x10, 0x00, 0x04,\ |
| 15746 | 15769 | /* 160 */ 0x1a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\ |
| 15747 | 15770 | /* 168 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00,\ |
| 15748 | | -/* 176 */ 0x00, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,\ |
| 15749 | | -/* 184 */ 0x00, 0x00,} |
| 15771 | +/* 176 */ 0x00, 0x10, 0x10, 0x02, 0x00, 0x00, 0x00, 0x00,\ |
| 15772 | +/* 184 */ 0x00, 0x00, 0x00,} |
| 15750 | 15773 | |
| 15751 | 15774 | /* The resolve3P2Values() routine is able to run faster if it knows |
| 15752 | 15775 | ** the value of the largest JUMP opcode. The smaller the maximum |
| 15753 | 15776 | ** JUMP opcode the better, so the mkopcodeh.tcl script that |
| 15754 | 15777 | ** generated this include file strives to group all JUMP opcodes |
| | @@ -16285,10 +16308,17 @@ |
| 16285 | 16308 | /* Maximum pathname length. Note: FILENAME_MAX defined by stdio.h |
| 16286 | 16309 | */ |
| 16287 | 16310 | #ifndef SQLITE_MAX_PATHLEN |
| 16288 | 16311 | # define SQLITE_MAX_PATHLEN FILENAME_MAX |
| 16289 | 16312 | #endif |
| 16313 | + |
| 16314 | +/* Maximum number of symlinks that will be resolved while trying to |
| 16315 | +** expand a filename in xFullPathname() in the VFS. |
| 16316 | +*/ |
| 16317 | +#ifndef SQLITE_MAX_SYMLINK |
| 16318 | +# define SQLITE_MAX_SYMLINK 200 |
| 16319 | +#endif |
| 16290 | 16320 | |
| 16291 | 16321 | /* |
| 16292 | 16322 | ** The default size of a disk sector |
| 16293 | 16323 | */ |
| 16294 | 16324 | #ifndef SQLITE_DEFAULT_SECTOR_SIZE |
| | @@ -17157,11 +17187,11 @@ |
| 17157 | 17187 | #define SQLITE_FUNC_CONSTANT 0x0800 /* Constant inputs give a constant output */ |
| 17158 | 17188 | #define SQLITE_FUNC_MINMAX 0x1000 /* True for min() and max() aggregates */ |
| 17159 | 17189 | #define SQLITE_FUNC_SLOCHNG 0x2000 /* "Slow Change". Value constant during a |
| 17160 | 17190 | ** single query - might change over time */ |
| 17161 | 17191 | #define SQLITE_FUNC_TEST 0x4000 /* Built-in testing functions */ |
| 17162 | | -#define SQLITE_FUNC_OFFSET 0x8000 /* Built-in sqlite_offset() function */ |
| 17192 | +/* 0x8000 -- available for reuse */ |
| 17163 | 17193 | #define SQLITE_FUNC_WINDOW 0x00010000 /* Built-in window-only function */ |
| 17164 | 17194 | #define SQLITE_FUNC_INTERNAL 0x00040000 /* For use by NestedParse() only */ |
| 17165 | 17195 | #define SQLITE_FUNC_DIRECT 0x00080000 /* Not for use in TRIGGERs or VIEWs */ |
| 17166 | 17196 | #define SQLITE_FUNC_SUBTYPE 0x00100000 /* Result likely to have sub-type */ |
| 17167 | 17197 | #define SQLITE_FUNC_UNSAFE 0x00200000 /* Function has side effects */ |
| | @@ -17174,10 +17204,11 @@ |
| 17174 | 17204 | #define INLINEFUNC_implies_nonnull_row 1 |
| 17175 | 17205 | #define INLINEFUNC_expr_implies_expr 2 |
| 17176 | 17206 | #define INLINEFUNC_expr_compare 3 |
| 17177 | 17207 | #define INLINEFUNC_affinity 4 |
| 17178 | 17208 | #define INLINEFUNC_iif 5 |
| 17209 | +#define INLINEFUNC_sqlite_offset 6 |
| 17179 | 17210 | #define INLINEFUNC_unlikely 99 /* Default case */ |
| 17180 | 17211 | |
| 17181 | 17212 | /* |
| 17182 | 17213 | ** The following three macros, FUNCTION(), LIKEFUNC() and AGGREGATE() are |
| 17183 | 17214 | ** used to create the initializers for the FuncDef structures. |
| | @@ -18120,11 +18151,11 @@ |
| 18120 | 18151 | ynVar iColumn; /* TK_COLUMN: column index. -1 for rowid. |
| 18121 | 18152 | ** TK_VARIABLE: variable number (always >= 1). |
| 18122 | 18153 | ** TK_SELECT_COLUMN: column of the result vector */ |
| 18123 | 18154 | i16 iAgg; /* Which entry in pAggInfo->aCol[] or ->aFunc[] */ |
| 18124 | 18155 | union { |
| 18125 | | - int iJoin; /* If EP_FromJoin, the right table of the join */ |
| 18156 | + int iJoin; /* If EP_OuterON or EP_InnerON, the right table */ |
| 18126 | 18157 | int iOfst; /* else: start of token from start of statement */ |
| 18127 | 18158 | } w; |
| 18128 | 18159 | AggInfo *pAggInfo; /* Used by TK_AGG_COLUMN and TK_AGG_FUNCTION */ |
| 18129 | 18160 | union { |
| 18130 | 18161 | Table *pTab; /* TK_COLUMN: Table containing column. Can be NULL |
| | @@ -18141,33 +18172,33 @@ |
| 18141 | 18172 | ** Value restrictions: |
| 18142 | 18173 | ** |
| 18143 | 18174 | ** EP_Agg == NC_HasAgg == SF_HasAgg |
| 18144 | 18175 | ** EP_Win == NC_HasWin |
| 18145 | 18176 | */ |
| 18146 | | -#define EP_FromJoin 0x000001 /* Originates in ON/USING clause of outer join */ |
| 18147 | | -#define EP_Distinct 0x000002 /* Aggregate function with DISTINCT keyword */ |
| 18148 | | -#define EP_HasFunc 0x000004 /* Contains one or more functions of any kind */ |
| 18149 | | -#define EP_FixedCol 0x000008 /* TK_Column with a known fixed value */ |
| 18177 | +#define EP_OuterON 0x000001 /* Originates in ON/USING clause of outer join */ |
| 18178 | +#define EP_InnerON 0x000002 /* Originates in ON/USING of an inner join */ |
| 18179 | +#define EP_Distinct 0x000004 /* Aggregate function with DISTINCT keyword */ |
| 18180 | +#define EP_HasFunc 0x000008 /* Contains one or more functions of any kind */ |
| 18150 | 18181 | #define EP_Agg 0x000010 /* Contains one or more aggregate functions */ |
| 18151 | | -#define EP_VarSelect 0x000020 /* pSelect is correlated, not constant */ |
| 18152 | | -#define EP_DblQuoted 0x000040 /* token.z was originally in "..." */ |
| 18153 | | -#define EP_InfixFunc 0x000080 /* True for an infix function: LIKE, GLOB, etc */ |
| 18154 | | -#define EP_Collate 0x000100 /* Tree contains a TK_COLLATE operator */ |
| 18155 | | -#define EP_Commuted 0x000200 /* Comparison operator has been commuted */ |
| 18156 | | -#define EP_IntValue 0x000400 /* Integer value contained in u.iValue */ |
| 18157 | | -#define EP_xIsSelect 0x000800 /* x.pSelect is valid (otherwise x.pList is) */ |
| 18158 | | -#define EP_Skip 0x001000 /* Operator does not contribute to affinity */ |
| 18159 | | -#define EP_Reduced 0x002000 /* Expr struct EXPR_REDUCEDSIZE bytes only */ |
| 18160 | | -#define EP_TokenOnly 0x004000 /* Expr struct EXPR_TOKENONLYSIZE bytes only */ |
| 18182 | +#define EP_FixedCol 0x000020 /* TK_Column with a known fixed value */ |
| 18183 | +#define EP_VarSelect 0x000040 /* pSelect is correlated, not constant */ |
| 18184 | +#define EP_DblQuoted 0x000080 /* token.z was originally in "..." */ |
| 18185 | +#define EP_InfixFunc 0x000100 /* True for an infix function: LIKE, GLOB, etc */ |
| 18186 | +#define EP_Collate 0x000200 /* Tree contains a TK_COLLATE operator */ |
| 18187 | +#define EP_Commuted 0x000400 /* Comparison operator has been commuted */ |
| 18188 | +#define EP_IntValue 0x000800 /* Integer value contained in u.iValue */ |
| 18189 | +#define EP_xIsSelect 0x001000 /* x.pSelect is valid (otherwise x.pList is) */ |
| 18190 | +#define EP_Skip 0x002000 /* Operator does not contribute to affinity */ |
| 18191 | +#define EP_Reduced 0x004000 /* Expr struct EXPR_REDUCEDSIZE bytes only */ |
| 18161 | 18192 | #define EP_Win 0x008000 /* Contains window functions */ |
| 18162 | | -#define EP_MemToken 0x010000 /* Need to sqlite3DbFree() Expr.zToken */ |
| 18163 | | -#define EP_IfNullRow 0x020000 /* The TK_IF_NULL_ROW opcode */ |
| 18164 | | -#define EP_Unlikely 0x040000 /* unlikely() or likelihood() function */ |
| 18165 | | -#define EP_ConstFunc 0x080000 /* A SQLITE_FUNC_CONSTANT or _SLOCHNG function */ |
| 18166 | | -#define EP_CanBeNull 0x100000 /* Can be null despite NOT NULL constraint */ |
| 18167 | | -#define EP_Subquery 0x200000 /* Tree contains a TK_SELECT operator */ |
| 18168 | | -#define EP_InnerJoin 0x400000 /* Originates in ON/USING of an inner join */ |
| 18193 | +#define EP_TokenOnly 0x010000 /* Expr struct EXPR_TOKENONLYSIZE bytes only */ |
| 18194 | +#define EP_MemToken 0x020000 /* Need to sqlite3DbFree() Expr.zToken */ |
| 18195 | +#define EP_IfNullRow 0x040000 /* The TK_IF_NULL_ROW opcode */ |
| 18196 | +#define EP_Unlikely 0x080000 /* unlikely() or likelihood() function */ |
| 18197 | +#define EP_ConstFunc 0x100000 /* A SQLITE_FUNC_CONSTANT or _SLOCHNG function */ |
| 18198 | +#define EP_CanBeNull 0x200000 /* Can be null despite NOT NULL constraint */ |
| 18199 | +#define EP_Subquery 0x400000 /* Tree contains a TK_SELECT operator */ |
| 18169 | 18200 | #define EP_Leaf 0x800000 /* Expr.pLeft, .pRight, .u.pSelect all NULL */ |
| 18170 | 18201 | #define EP_WinFunc 0x1000000 /* TK_FUNCTION with Expr.y.pWin set */ |
| 18171 | 18202 | #define EP_Subrtn 0x2000000 /* Uses Expr.y.sub. TK_IN, _SELECT, or _EXISTS */ |
| 18172 | 18203 | #define EP_Quoted 0x4000000 /* TK_ID was originally quoted */ |
| 18173 | 18204 | #define EP_Static 0x8000000 /* Held in memory not obtained from malloc() */ |
| | @@ -18186,12 +18217,12 @@ |
| 18186 | 18217 | */ |
| 18187 | 18218 | #define ExprHasProperty(E,P) (((E)->flags&(P))!=0) |
| 18188 | 18219 | #define ExprHasAllProperty(E,P) (((E)->flags&(P))==(P)) |
| 18189 | 18220 | #define ExprSetProperty(E,P) (E)->flags|=(P) |
| 18190 | 18221 | #define ExprClearProperty(E,P) (E)->flags&=~(P) |
| 18191 | | -#define ExprAlwaysTrue(E) (((E)->flags&(EP_FromJoin|EP_IsTrue))==EP_IsTrue) |
| 18192 | | -#define ExprAlwaysFalse(E) (((E)->flags&(EP_FromJoin|EP_IsFalse))==EP_IsFalse) |
| 18222 | +#define ExprAlwaysTrue(E) (((E)->flags&(EP_OuterON|EP_IsTrue))==EP_IsTrue) |
| 18223 | +#define ExprAlwaysFalse(E) (((E)->flags&(EP_OuterON|EP_IsFalse))==EP_IsFalse) |
| 18193 | 18224 | |
| 18194 | 18225 | /* Macros used to ensure that the correct members of unions are accessed |
| 18195 | 18226 | ** in Expr. |
| 18196 | 18227 | */ |
| 18197 | 18228 | #define ExprUseUToken(E) (((E)->flags&EP_IntValue)==0) |
| | @@ -18366,16 +18397,18 @@ |
| 18366 | 18397 | u8 jointype; /* Type of join between this table and the previous */ |
| 18367 | 18398 | unsigned notIndexed :1; /* True if there is a NOT INDEXED clause */ |
| 18368 | 18399 | unsigned isIndexedBy :1; /* True if there is an INDEXED BY clause */ |
| 18369 | 18400 | unsigned isTabFunc :1; /* True if table-valued-function syntax */ |
| 18370 | 18401 | unsigned isCorrelated :1; /* True if sub-query is correlated */ |
| 18402 | + unsigned isMaterialized:1; /* This is a materialized view */ |
| 18371 | 18403 | unsigned viaCoroutine :1; /* Implemented as a co-routine */ |
| 18372 | 18404 | unsigned isRecursive :1; /* True for recursive reference in WITH */ |
| 18373 | 18405 | unsigned fromDDL :1; /* Comes from sqlite_schema */ |
| 18374 | 18406 | unsigned isCte :1; /* This is a CTE */ |
| 18375 | 18407 | unsigned notCte :1; /* This item may not match a CTE */ |
| 18376 | 18408 | unsigned isUsing :1; /* u3.pUsing is valid */ |
| 18409 | + unsigned isOn :1; /* u3.pOn was once valid and non-NULL */ |
| 18377 | 18410 | unsigned isSynthUsing :1; /* u3.pUsing is synthensized from NATURAL */ |
| 18378 | 18411 | unsigned isNestedFrom :1; /* pSelect is a SF_NestedFrom subquery */ |
| 18379 | 18412 | } fg; |
| 18380 | 18413 | int iCursor; /* The VDBE cursor number used to access this table */ |
| 18381 | 18414 | union { |
| | @@ -20595,11 +20628,10 @@ |
| 20595 | 20628 | ** Allowed flags for the 3rd parameter to sqlite3FindInIndex(). |
| 20596 | 20629 | */ |
| 20597 | 20630 | #define IN_INDEX_NOOP_OK 0x0001 /* OK to return IN_INDEX_NOOP */ |
| 20598 | 20631 | #define IN_INDEX_MEMBERSHIP 0x0002 /* IN operator used for membership test */ |
| 20599 | 20632 | #define IN_INDEX_LOOP 0x0004 /* IN operator used as a loop */ |
| 20600 | | -#define IN_INDEX_REUSE_CUR 0x0008 /* Reuse prior table cursor */ |
| 20601 | 20633 | SQLITE_PRIVATE int sqlite3FindInIndex(Parse *, Expr *, u32, int*, int*, int*); |
| 20602 | 20634 | |
| 20603 | 20635 | SQLITE_PRIVATE int sqlite3JournalOpen(sqlite3_vfs *, const char *, sqlite3_file *, int, int); |
| 20604 | 20636 | SQLITE_PRIVATE int sqlite3JournalSize(sqlite3_vfs *); |
| 20605 | 20637 | #if defined(SQLITE_ENABLE_ATOMIC_WRITE) \ |
| | @@ -22224,11 +22256,11 @@ |
| 22224 | 22256 | u8 wrFlag; /* The wrFlag argument to sqlite3BtreeCursor() */ |
| 22225 | 22257 | #endif |
| 22226 | 22258 | Bool isEphemeral:1; /* True for an ephemeral table */ |
| 22227 | 22259 | Bool useRandomRowid:1; /* Generate new record numbers semi-randomly */ |
| 22228 | 22260 | Bool isOrdered:1; /* True if the table is not BTREE_UNORDERED */ |
| 22229 | | - Bool hasBeenDuped:1; /* This cursor was source or target of OP_OpenDup */ |
| 22261 | + Bool noReuse:1; /* OpenEphemeral may not reuse this cursor */ |
| 22230 | 22262 | u16 seekHit; /* See the OP_SeekHit and OP_IfNoHope opcodes */ |
| 22231 | 22263 | union { /* pBtx for isEphermeral. pAltMap otherwise */ |
| 22232 | 22264 | Btree *pBtx; /* Separate file holding temporary table */ |
| 22233 | 22265 | u32 *aAltMap; /* Mapping from table to index column numbers */ |
| 22234 | 22266 | } ub; |
| | @@ -30545,11 +30577,13 @@ |
| 30545 | 30577 | /* |
| 30546 | 30578 | ** If pExpr has a byte offset for the start of a token, record that as |
| 30547 | 30579 | ** as the error offset. |
| 30548 | 30580 | */ |
| 30549 | 30581 | SQLITE_PRIVATE void sqlite3RecordErrorOffsetOfExpr(sqlite3 *db, const Expr *pExpr){ |
| 30550 | | - while( pExpr && (ExprHasProperty(pExpr,EP_FromJoin) || pExpr->w.iOfst<=0) ){ |
| 30582 | + while( pExpr |
| 30583 | + && (ExprHasProperty(pExpr,EP_OuterON|EP_InnerON) || pExpr->w.iOfst<=0) |
| 30584 | + ){ |
| 30551 | 30585 | pExpr = pExpr->pLeft; |
| 30552 | 30586 | } |
| 30553 | 30587 | if( pExpr==0 ) return; |
| 30554 | 30588 | db->errByteOffset = pExpr->w.iOfst; |
| 30555 | 30589 | } |
| | @@ -31196,10 +31230,13 @@ |
| 31196 | 31230 | sqlite3_str_appendf(&x, " DDL"); |
| 31197 | 31231 | } |
| 31198 | 31232 | if( pItem->fg.isCte ){ |
| 31199 | 31233 | sqlite3_str_appendf(&x, " CteUse=0x%p", pItem->u2.pCteUse); |
| 31200 | 31234 | } |
| 31235 | + if( pItem->fg.isOn || (pItem->fg.isUsing==0 && pItem->u3.pOn!=0) ){ |
| 31236 | + sqlite3_str_appendf(&x, " ON"); |
| 31237 | + } |
| 31201 | 31238 | sqlite3StrAccumFinish(&x); |
| 31202 | 31239 | sqlite3TreeViewItem(pView, zLine, i<pSrc->nSrc-1); |
| 31203 | 31240 | n = 0; |
| 31204 | 31241 | if( pItem->pSelect ) n++; |
| 31205 | 31242 | if( pItem->fg.isTabFunc ) n++; |
| | @@ -31470,12 +31507,15 @@ |
| 31470 | 31507 | if( pExpr->flags || pExpr->affExpr || pExpr->vvaFlags ){ |
| 31471 | 31508 | StrAccum x; |
| 31472 | 31509 | sqlite3StrAccumInit(&x, 0, zFlgs, sizeof(zFlgs), 0); |
| 31473 | 31510 | sqlite3_str_appendf(&x, " fg.af=%x.%c", |
| 31474 | 31511 | pExpr->flags, pExpr->affExpr ? pExpr->affExpr : 'n'); |
| 31475 | | - if( ExprHasProperty(pExpr, EP_FromJoin) ){ |
| 31476 | | - sqlite3_str_appendf(&x, " iJoin=%d", pExpr->w.iJoin); |
| 31512 | + if( ExprHasProperty(pExpr, EP_OuterON) ){ |
| 31513 | + sqlite3_str_appendf(&x, " outer.iJoin=%d", pExpr->w.iJoin); |
| 31514 | + } |
| 31515 | + if( ExprHasProperty(pExpr, EP_InnerON) ){ |
| 31516 | + sqlite3_str_appendf(&x, " inner.iJoin=%d", pExpr->w.iJoin); |
| 31477 | 31517 | } |
| 31478 | 31518 | if( ExprHasProperty(pExpr, EP_FromDDL) ){ |
| 31479 | 31519 | sqlite3_str_appendf(&x, " DDL"); |
| 31480 | 31520 | } |
| 31481 | 31521 | if( ExprHasVVAProperty(pExpr, EP_Immutable) ){ |
| | @@ -35398,17 +35438,18 @@ |
| 35398 | 35438 | /* 174 */ "VInitIn" OpHelp("r[P2]=ValueList(P1,P3)"), |
| 35399 | 35439 | /* 175 */ "VColumn" OpHelp("r[P3]=vcolumn(P2)"), |
| 35400 | 35440 | /* 176 */ "VRename" OpHelp(""), |
| 35401 | 35441 | /* 177 */ "Pagecount" OpHelp(""), |
| 35402 | 35442 | /* 178 */ "MaxPgcnt" OpHelp(""), |
| 35403 | | - /* 179 */ "FilterAdd" OpHelp("filter(P1) += key(P3@P4)"), |
| 35404 | | - /* 180 */ "Trace" OpHelp(""), |
| 35405 | | - /* 181 */ "CursorHint" OpHelp(""), |
| 35406 | | - /* 182 */ "ReleaseReg" OpHelp("release r[P1@P2] mask P3"), |
| 35407 | | - /* 183 */ "Noop" OpHelp(""), |
| 35408 | | - /* 184 */ "Explain" OpHelp(""), |
| 35409 | | - /* 185 */ "Abortable" OpHelp(""), |
| 35443 | + /* 179 */ "ClrSubtype" OpHelp("r[P1].subtype = 0"), |
| 35444 | + /* 180 */ "FilterAdd" OpHelp("filter(P1) += key(P3@P4)"), |
| 35445 | + /* 181 */ "Trace" OpHelp(""), |
| 35446 | + /* 182 */ "CursorHint" OpHelp(""), |
| 35447 | + /* 183 */ "ReleaseReg" OpHelp("release r[P1@P2] mask P3"), |
| 35448 | + /* 184 */ "Noop" OpHelp(""), |
| 35449 | + /* 185 */ "Explain" OpHelp(""), |
| 35450 | + /* 186 */ "Abortable" OpHelp(""), |
| 35410 | 35451 | }; |
| 35411 | 35452 | return azName[i]; |
| 35412 | 35453 | } |
| 35413 | 35454 | #endif |
| 35414 | 35455 | |
| | @@ -41837,90 +41878,103 @@ |
| 41837 | 41878 | } |
| 41838 | 41879 | return SQLITE_OK; |
| 41839 | 41880 | } |
| 41840 | 41881 | |
| 41841 | 41882 | /* |
| 41842 | | -** If the last component of the pathname in z[0]..z[j-1] is something |
| 41843 | | -** other than ".." then back it out and return true. If the last |
| 41844 | | -** component is empty or if it is ".." then return false. |
| 41845 | | -*/ |
| 41846 | | -static int unixBackupDir(const char *z, int *pJ){ |
| 41847 | | - int j = *pJ; |
| 41848 | | - int i; |
| 41849 | | - if( j<=0 ) return 0; |
| 41850 | | - for(i=j-1; i>0 && z[i-1]!='/'; i--){} |
| 41851 | | - if( i==0 ) return 0; |
| 41852 | | - if( z[i]=='.' && i==j-2 && z[i+1]=='.' ) return 0; |
| 41853 | | - *pJ = i-1; |
| 41854 | | - return 1; |
| 41855 | | -} |
| 41856 | | - |
| 41857 | | -/* |
| 41858 | | -** Convert a relative pathname into a full pathname. Also |
| 41859 | | -** simplify the pathname as follows: |
| 41860 | | -** |
| 41861 | | -** Remove all instances of /./ |
| 41862 | | -** Remove all isntances of /X/../ for any X |
| 41863 | | -*/ |
| 41864 | | -static int mkFullPathname( |
| 41865 | | - const char *zPath, /* Input path */ |
| 41866 | | - char *zOut, /* Output buffer */ |
| 41867 | | - int nOut /* Allocated size of buffer zOut */ |
| 41868 | | -){ |
| 41869 | | - int nPath = sqlite3Strlen30(zPath); |
| 41870 | | - int iOff = 0; |
| 41871 | | - int i, j; |
| 41872 | | - if( zPath[0]!='/' ){ |
| 41873 | | - if( osGetcwd(zOut, nOut-2)==0 ){ |
| 41874 | | - return unixLogError(SQLITE_CANTOPEN_BKPT, "getcwd", zPath); |
| 41875 | | - } |
| 41876 | | - iOff = sqlite3Strlen30(zOut); |
| 41877 | | - zOut[iOff++] = '/'; |
| 41878 | | - } |
| 41879 | | - if( (iOff+nPath+1)>nOut ){ |
| 41880 | | - /* SQLite assumes that xFullPathname() nul-terminates the output buffer |
| 41881 | | - ** even if it returns an error. */ |
| 41882 | | - zOut[iOff] = '\0'; |
| 41883 | | - return SQLITE_CANTOPEN_BKPT; |
| 41884 | | - } |
| 41885 | | - sqlite3_snprintf(nOut-iOff, &zOut[iOff], "%s", zPath); |
| 41886 | | - |
| 41887 | | - /* Remove duplicate '/' characters. Except, two // at the beginning |
| 41888 | | - ** of a pathname is allowed since this is important on windows. */ |
| 41889 | | - for(i=j=1; zOut[i]; i++){ |
| 41890 | | - zOut[j++] = zOut[i]; |
| 41891 | | - while( zOut[i]=='/' && zOut[i+1]=='/' ) i++; |
| 41892 | | - } |
| 41893 | | - zOut[j] = 0; |
| 41894 | | - |
| 41895 | | - assert( zOut[0]=='/' ); |
| 41896 | | - for(i=j=0; zOut[i]; i++){ |
| 41897 | | - if( zOut[i]=='/' ){ |
| 41898 | | - /* Skip over internal "/." directory components */ |
| 41899 | | - if( zOut[i+1]=='.' && zOut[i+2]=='/' ){ |
| 41900 | | - i += 1; |
| 41901 | | - continue; |
| 41902 | | - } |
| 41903 | | - |
| 41904 | | - /* If this is a "/.." directory component then back out the |
| 41905 | | - ** previous term of the directory if it is something other than "..". |
| 41906 | | - */ |
| 41907 | | - if( zOut[i+1]=='.' |
| 41908 | | - && zOut[i+2]=='.' |
| 41909 | | - && zOut[i+3]=='/' |
| 41910 | | - && unixBackupDir(zOut, &j) |
| 41911 | | - ){ |
| 41912 | | - i += 2; |
| 41913 | | - continue; |
| 41914 | | - } |
| 41915 | | - } |
| 41916 | | - if( ALWAYS(j>=0) ) zOut[j] = zOut[i]; |
| 41917 | | - j++; |
| 41918 | | - } |
| 41919 | | - if( NEVER(j==0) ) zOut[j++] = '/'; |
| 41920 | | - zOut[j] = 0; |
| 41921 | | - return SQLITE_OK; |
| 41883 | +** A pathname under construction |
| 41884 | +*/ |
| 41885 | +typedef struct DbPath DbPath; |
| 41886 | +struct DbPath { |
| 41887 | + int rc; /* Non-zero following any error */ |
| 41888 | + int nSymlink; /* Number of symlinks resolved */ |
| 41889 | + char *zOut; /* Write the pathname here */ |
| 41890 | + int nOut; /* Bytes of space available to zOut[] */ |
| 41891 | + int nUsed; /* Bytes of zOut[] currently being used */ |
| 41892 | +}; |
| 41893 | + |
| 41894 | +/* Forward reference */ |
| 41895 | +static void appendAllPathElements(DbPath*,const char*); |
| 41896 | + |
| 41897 | +/* |
| 41898 | +** Append a single path element to the DbPath under construction |
| 41899 | +*/ |
| 41900 | +static void appendOnePathElement( |
| 41901 | + DbPath *pPath, /* Path under construction, to which to append zName */ |
| 41902 | + const char *zName, /* Name to append to pPath. Not zero-terminated */ |
| 41903 | + int nName /* Number of significant bytes in zName */ |
| 41904 | +){ |
| 41905 | + assert( nName>0 ); |
| 41906 | + assert( zName!=0 ); |
| 41907 | + if( zName[0]=='.' ){ |
| 41908 | + if( nName==1 ) return; |
| 41909 | + if( zName[1]=='.' && nName==2 ){ |
| 41910 | + if( pPath->nUsed<=1 ){ |
| 41911 | + pPath->rc = SQLITE_ERROR; |
| 41912 | + return; |
| 41913 | + } |
| 41914 | + assert( pPath->zOut[0]=='/' ); |
| 41915 | + while( pPath->zOut[--pPath->nUsed]!='/' ){} |
| 41916 | + return; |
| 41917 | + } |
| 41918 | + } |
| 41919 | + if( pPath->nUsed + nName + 2 >= pPath->nOut ){ |
| 41920 | + pPath->rc = SQLITE_ERROR; |
| 41921 | + return; |
| 41922 | + } |
| 41923 | + pPath->zOut[pPath->nUsed++] = '/'; |
| 41924 | + memcpy(&pPath->zOut[pPath->nUsed], zName, nName); |
| 41925 | + pPath->nUsed += nName; |
| 41926 | +#if defined(HAVE_READLINK) && defined(HAVE_LSTAT) |
| 41927 | + if( pPath->rc==SQLITE_OK ){ |
| 41928 | + const char *zIn; |
| 41929 | + struct stat buf; |
| 41930 | + pPath->zOut[pPath->nUsed] = 0; |
| 41931 | + zIn = pPath->zOut; |
| 41932 | + if( osLstat(zIn, &buf)!=0 ){ |
| 41933 | + if( errno!=ENOENT ){ |
| 41934 | + pPath->rc = unixLogError(SQLITE_CANTOPEN_BKPT, "lstat", zIn); |
| 41935 | + } |
| 41936 | + }else if( S_ISLNK(buf.st_mode) ){ |
| 41937 | + ssize_t got; |
| 41938 | + char zLnk[SQLITE_MAX_PATHLEN+2]; |
| 41939 | + if( pPath->nSymlink++ > SQLITE_MAX_SYMLINK ){ |
| 41940 | + pPath->rc = SQLITE_CANTOPEN_BKPT; |
| 41941 | + return; |
| 41942 | + } |
| 41943 | + got = osReadlink(zIn, zLnk, sizeof(zLnk)-2); |
| 41944 | + if( got<=0 || got>=(ssize_t)sizeof(zLnk)-2 ){ |
| 41945 | + pPath->rc = unixLogError(SQLITE_CANTOPEN_BKPT, "readlink", zIn); |
| 41946 | + return; |
| 41947 | + } |
| 41948 | + zLnk[got] = 0; |
| 41949 | + if( zLnk[0]=='/' ){ |
| 41950 | + pPath->nUsed = 0; |
| 41951 | + }else{ |
| 41952 | + pPath->nUsed -= nName + 1; |
| 41953 | + } |
| 41954 | + appendAllPathElements(pPath, zLnk); |
| 41955 | + } |
| 41956 | + } |
| 41957 | +#endif |
| 41958 | +} |
| 41959 | + |
| 41960 | +/* |
| 41961 | +** Append all path elements in zPath to the DbPath under construction. |
| 41962 | +*/ |
| 41963 | +static void appendAllPathElements( |
| 41964 | + DbPath *pPath, /* Path under construction, to which to append zName */ |
| 41965 | + const char *zPath /* Path to append to pPath. Is zero-terminated */ |
| 41966 | +){ |
| 41967 | + int i = 0; |
| 41968 | + int j = 0; |
| 41969 | + do{ |
| 41970 | + while( zPath[i] && zPath[i]!='/' ){ i++; } |
| 41971 | + if( i>j ){ |
| 41972 | + appendOnePathElement(pPath, &zPath[j], i-j); |
| 41973 | + } |
| 41974 | + j = i+1; |
| 41975 | + }while( zPath[i++] ); |
| 41922 | 41976 | } |
| 41923 | 41977 | |
| 41924 | 41978 | /* |
| 41925 | 41979 | ** Turn a relative pathname into a full pathname. The relative path |
| 41926 | 41980 | ** is stored as a nul-terminated string in the buffer pointed to by |
| | @@ -41934,89 +41988,30 @@ |
| 41934 | 41988 | sqlite3_vfs *pVfs, /* Pointer to vfs object */ |
| 41935 | 41989 | const char *zPath, /* Possibly relative input path */ |
| 41936 | 41990 | int nOut, /* Size of output buffer in bytes */ |
| 41937 | 41991 | char *zOut /* Output buffer */ |
| 41938 | 41992 | ){ |
| 41939 | | -#if !defined(HAVE_READLINK) || !defined(HAVE_LSTAT) |
| 41940 | | - return mkFullPathname(zPath, zOut, nOut); |
| 41941 | | -#else |
| 41942 | | - int rc = SQLITE_OK; |
| 41943 | | - int nByte; |
| 41944 | | - int nLink = 0; /* Number of symbolic links followed so far */ |
| 41945 | | - const char *zIn = zPath; /* Input path for each iteration of loop */ |
| 41946 | | - char *zDel = 0; |
| 41947 | | - |
| 41948 | | - assert( pVfs->mxPathname==MAX_PATHNAME ); |
| 41993 | + DbPath path; |
| 41949 | 41994 | UNUSED_PARAMETER(pVfs); |
| 41950 | | - |
| 41951 | | - /* It's odd to simulate an io-error here, but really this is just |
| 41952 | | - ** using the io-error infrastructure to test that SQLite handles this |
| 41953 | | - ** function failing. This function could fail if, for example, the |
| 41954 | | - ** current working directory has been unlinked. |
| 41955 | | - */ |
| 41956 | | - SimulateIOError( return SQLITE_ERROR ); |
| 41957 | | - |
| 41958 | | - do { |
| 41959 | | - |
| 41960 | | - /* Call stat() on path zIn. Set bLink to true if the path is a symbolic |
| 41961 | | - ** link, or false otherwise. */ |
| 41962 | | - int bLink = 0; |
| 41963 | | - struct stat buf; |
| 41964 | | - if( osLstat(zIn, &buf)!=0 ){ |
| 41965 | | - if( errno!=ENOENT ){ |
| 41966 | | - rc = unixLogError(SQLITE_CANTOPEN_BKPT, "lstat", zIn); |
| 41967 | | - } |
| 41968 | | - }else{ |
| 41969 | | - bLink = S_ISLNK(buf.st_mode); |
| 41970 | | - } |
| 41971 | | - |
| 41972 | | - if( bLink ){ |
| 41973 | | - nLink++; |
| 41974 | | - if( zDel==0 ){ |
| 41975 | | - zDel = sqlite3_malloc(nOut); |
| 41976 | | - if( zDel==0 ) rc = SQLITE_NOMEM_BKPT; |
| 41977 | | - }else if( nLink>=SQLITE_MAX_SYMLINKS ){ |
| 41978 | | - rc = SQLITE_CANTOPEN_BKPT; |
| 41979 | | - } |
| 41980 | | - |
| 41981 | | - if( rc==SQLITE_OK ){ |
| 41982 | | - nByte = osReadlink(zIn, zDel, nOut-1); |
| 41983 | | - if( nByte<0 ){ |
| 41984 | | - rc = unixLogError(SQLITE_CANTOPEN_BKPT, "readlink", zIn); |
| 41985 | | - }else{ |
| 41986 | | - if( zDel[0]!='/' ){ |
| 41987 | | - int n; |
| 41988 | | - for(n = sqlite3Strlen30(zIn); n>0 && zIn[n-1]!='/'; n--); |
| 41989 | | - if( nByte+n+1>nOut ){ |
| 41990 | | - rc = SQLITE_CANTOPEN_BKPT; |
| 41991 | | - }else{ |
| 41992 | | - memmove(&zDel[n], zDel, nByte+1); |
| 41993 | | - memcpy(zDel, zIn, n); |
| 41994 | | - nByte += n; |
| 41995 | | - } |
| 41996 | | - } |
| 41997 | | - zDel[nByte] = '\0'; |
| 41998 | | - } |
| 41999 | | - } |
| 42000 | | - |
| 42001 | | - zIn = zDel; |
| 42002 | | - } |
| 42003 | | - |
| 42004 | | - assert( rc!=SQLITE_OK || zIn!=zOut || zIn[0]=='/' ); |
| 42005 | | - if( rc==SQLITE_OK && zIn!=zOut ){ |
| 42006 | | - rc = mkFullPathname(zIn, zOut, nOut); |
| 42007 | | - } |
| 42008 | | - if( bLink==0 ) break; |
| 42009 | | - zIn = zOut; |
| 42010 | | - }while( rc==SQLITE_OK ); |
| 42011 | | - |
| 42012 | | - sqlite3_free(zDel); |
| 42013 | | - if( rc==SQLITE_OK && nLink ) rc = SQLITE_OK_SYMLINK; |
| 42014 | | - return rc; |
| 42015 | | -#endif /* HAVE_READLINK && HAVE_LSTAT */ |
| 42016 | | -} |
| 42017 | | - |
| 41995 | + path.rc = 0; |
| 41996 | + path.nUsed = 0; |
| 41997 | + path.nSymlink = 0; |
| 41998 | + path.nOut = nOut; |
| 41999 | + path.zOut = zOut; |
| 42000 | + if( zPath[0]!='/' ){ |
| 42001 | + char zPwd[SQLITE_MAX_PATHLEN+2]; |
| 42002 | + if( osGetcwd(zPwd, sizeof(zPwd)-2)==0 ){ |
| 42003 | + return unixLogError(SQLITE_CANTOPEN_BKPT, "getcwd", zPath); |
| 42004 | + } |
| 42005 | + appendAllPathElements(&path, zPwd); |
| 42006 | + } |
| 42007 | + appendAllPathElements(&path, zPath); |
| 42008 | + zOut[path.nUsed] = 0; |
| 42009 | + if( path.rc || path.nUsed<2 ) return SQLITE_CANTOPEN_BKPT; |
| 42010 | + if( path.nSymlink ) return SQLITE_OK_SYMLINK; |
| 42011 | + return SQLITE_OK; |
| 42012 | +} |
| 42018 | 42013 | |
| 42019 | 42014 | #ifndef SQLITE_OMIT_LOAD_EXTENSION |
| 42020 | 42015 | /* |
| 42021 | 42016 | ** Interfaces for opening a shared library, finding entry points |
| 42022 | 42017 | ** within the shared library, and closing the shared library. |
| | @@ -56473,10 +56468,11 @@ |
| 56473 | 56468 | }else if( (currentSize+szPage)<=newSize ){ |
| 56474 | 56469 | char *pTmp = pPager->pTmpSpace; |
| 56475 | 56470 | memset(pTmp, 0, szPage); |
| 56476 | 56471 | testcase( (newSize-szPage) == currentSize ); |
| 56477 | 56472 | testcase( (newSize-szPage) > currentSize ); |
| 56473 | + sqlite3OsFileControlHint(pPager->fd, SQLITE_FCNTL_SIZE_HINT, &newSize); |
| 56478 | 56474 | rc = sqlite3OsWrite(pPager->fd, pTmp, szPage, newSize-szPage); |
| 56479 | 56475 | } |
| 56480 | 56476 | if( rc==SQLITE_OK ){ |
| 56481 | 56477 | pPager->dbFileSize = nPage; |
| 56482 | 56478 | } |
| | @@ -70725,16 +70721,21 @@ |
| 70725 | 70721 | eMode = BTALLOC_LE; |
| 70726 | 70722 | iNear = nFin; |
| 70727 | 70723 | } |
| 70728 | 70724 | do { |
| 70729 | 70725 | MemPage *pFreePg; |
| 70726 | + Pgno dbSize = btreePagecount(pBt); |
| 70730 | 70727 | rc = allocateBtreePage(pBt, &pFreePg, &iFreePg, iNear, eMode); |
| 70731 | 70728 | if( rc!=SQLITE_OK ){ |
| 70732 | 70729 | releasePage(pLastPg); |
| 70733 | 70730 | return rc; |
| 70734 | 70731 | } |
| 70735 | 70732 | releasePage(pFreePg); |
| 70733 | + if( iFreePg>dbSize ){ |
| 70734 | + releasePage(pLastPg); |
| 70735 | + return SQLITE_CORRUPT_BKPT; |
| 70736 | + } |
| 70736 | 70737 | }while( bCommit && iFreePg>nFin ); |
| 70737 | 70738 | assert( iFreePg<iLastPg ); |
| 70738 | 70739 | |
| 70739 | 70740 | rc = relocatePage(pBt, pLastPg, eType, iPtrPage, iFreePg, bCommit); |
| 70740 | 70741 | releasePage(pLastPg); |
| | @@ -75957,11 +75958,11 @@ |
| 75957 | 75958 | } |
| 75958 | 75959 | |
| 75959 | 75960 | TRACE(("INSERT: table=%d nkey=%lld ndata=%d page=%d %s\n", |
| 75960 | 75961 | pCur->pgnoRoot, pX->nKey, pX->nData, pPage->pgno, |
| 75961 | 75962 | loc==0 ? "overwrite" : "new entry")); |
| 75962 | | - assert( pPage->isInit ); |
| 75963 | + assert( pPage->isInit || CORRUPT_DB ); |
| 75963 | 75964 | newCell = pBt->pTmpSpace; |
| 75964 | 75965 | assert( newCell!=0 ); |
| 75965 | 75966 | if( flags & BTREE_PREFORMAT ){ |
| 75966 | 75967 | rc = SQLITE_OK; |
| 75967 | 75968 | szNew = pBt->nPreformatSize; |
| | @@ -80239,12 +80240,12 @@ |
| 80239 | 80240 | assert( !ExprHasProperty(pExpr, EP_IntValue) ); |
| 80240 | 80241 | aff = sqlite3AffinityType(pExpr->u.zToken,0); |
| 80241 | 80242 | rc = valueFromExpr(db, pExpr->pLeft, enc, aff, ppVal, pCtx); |
| 80242 | 80243 | testcase( rc!=SQLITE_OK ); |
| 80243 | 80244 | if( *ppVal ){ |
| 80244 | | - sqlite3VdbeMemCast(*ppVal, aff, SQLITE_UTF8); |
| 80245 | | - sqlite3ValueApplyAffinity(*ppVal, affinity, SQLITE_UTF8); |
| 80245 | + sqlite3VdbeMemCast(*ppVal, aff, enc); |
| 80246 | + sqlite3ValueApplyAffinity(*ppVal, affinity, enc); |
| 80246 | 80247 | } |
| 80247 | 80248 | return rc; |
| 80248 | 80249 | } |
| 80249 | 80250 | |
| 80250 | 80251 | /* Handle negative integers in a single step. This is needed in the |
| | @@ -82215,15 +82216,13 @@ |
| 82215 | 82216 | if( c=='4' ){ |
| 82216 | 82217 | sqlite3_str_appendall(&x, zP4); |
| 82217 | 82218 | }else if( c=='X' ){ |
| 82218 | 82219 | if( pOp->zComment && pOp->zComment[0] ){ |
| 82219 | 82220 | sqlite3_str_appendall(&x, pOp->zComment); |
| 82220 | | - }else{ |
| 82221 | | - sqlite3_str_appendall(&x, zSynopsis+1); |
| 82221 | + seenCom = 1; |
| 82222 | + break; |
| 82222 | 82223 | } |
| 82223 | | - seenCom = 1; |
| 82224 | | - break; |
| 82225 | 82224 | }else{ |
| 82226 | 82225 | int v1 = translateP(c, pOp); |
| 82227 | 82226 | int v2; |
| 82228 | 82227 | if( strncmp(zSynopsis+ii+1, "@P", 2)==0 ){ |
| 82229 | 82228 | ii += 3; |
| | @@ -89770,14 +89769,19 @@ |
| 89770 | 89769 | pOut++; |
| 89771 | 89770 | }while( --n ); |
| 89772 | 89771 | break; |
| 89773 | 89772 | } |
| 89774 | 89773 | |
| 89775 | | -/* Opcode: Copy P1 P2 P3 * * |
| 89774 | +/* Opcode: Copy P1 P2 P3 * P5 |
| 89776 | 89775 | ** Synopsis: r[P2@P3+1]=r[P1@P3+1] |
| 89777 | 89776 | ** |
| 89778 | 89777 | ** Make a copy of registers P1..P1+P3 into registers P2..P2+P3. |
| 89778 | +** |
| 89779 | +** If the 0x0002 bit of P5 is set then also clear the MEM_Subtype flag in the |
| 89780 | +** destination. The 0x0001 bit of P5 indicates that this Copy opcode cannot |
| 89781 | +** be merged. The 0x0001 bit is used by the query planner and does not |
| 89782 | +** come into play during query execution. |
| 89779 | 89783 | ** |
| 89780 | 89784 | ** This instruction makes a deep copy of the value. A duplicate |
| 89781 | 89785 | ** is made of any string or blob constant. See also OP_SCopy. |
| 89782 | 89786 | */ |
| 89783 | 89787 | case OP_Copy: { |
| | @@ -89789,10 +89793,13 @@ |
| 89789 | 89793 | assert( pOut!=pIn1 ); |
| 89790 | 89794 | while( 1 ){ |
| 89791 | 89795 | memAboutToChange(p, pOut); |
| 89792 | 89796 | sqlite3VdbeMemShallowCopy(pOut, pIn1, MEM_Ephem); |
| 89793 | 89797 | Deephemeralize(pOut); |
| 89798 | + if( (pOut->flags & MEM_Subtype)!=0 && (pOp->p5 & 0x0002)!=0 ){ |
| 89799 | + pOut->flags &= ~MEM_Subtype; |
| 89800 | + } |
| 89794 | 89801 | #ifdef SQLITE_DEBUG |
| 89795 | 89802 | pOut->pScopyFrom = 0; |
| 89796 | 89803 | #endif |
| 89797 | 89804 | REGISTER_TRACE(pOp->p2+pOp->p3-n, pOut); |
| 89798 | 89805 | if( (n--)==0 ) break; |
| | @@ -92171,10 +92178,15 @@ |
| 92171 | 92178 | if( db->aDb[pOp->p1].pSchema->schema_cookie!=iMeta ){ |
| 92172 | 92179 | sqlite3ResetOneSchema(db, pOp->p1); |
| 92173 | 92180 | } |
| 92174 | 92181 | p->expired = 1; |
| 92175 | 92182 | rc = SQLITE_SCHEMA; |
| 92183 | + |
| 92184 | + /* Set changeCntOn to 0 to prevent the value returned by sqlite3_changes() |
| 92185 | + ** from being modified in sqlite3VdbeHalt(). If this statement is |
| 92186 | + ** reprepared, changeCntOn will be set again. */ |
| 92187 | + p->changeCntOn = 0; |
| 92176 | 92188 | } |
| 92177 | 92189 | if( rc ) goto abort_due_to_error; |
| 92178 | 92190 | break; |
| 92179 | 92191 | } |
| 92180 | 92192 | |
| | @@ -92470,12 +92482,12 @@ |
| 92470 | 92482 | pCx->pKeyInfo = pOrig->pKeyInfo; |
| 92471 | 92483 | pCx->isTable = pOrig->isTable; |
| 92472 | 92484 | pCx->pgnoRoot = pOrig->pgnoRoot; |
| 92473 | 92485 | pCx->isOrdered = pOrig->isOrdered; |
| 92474 | 92486 | pCx->ub.pBtx = pOrig->ub.pBtx; |
| 92475 | | - pCx->hasBeenDuped = 1; |
| 92476 | | - pOrig->hasBeenDuped = 1; |
| 92487 | + pCx->noReuse = 1; |
| 92488 | + pOrig->noReuse = 1; |
| 92477 | 92489 | rc = sqlite3BtreeCursor(pCx->ub.pBtx, pCx->pgnoRoot, BTREE_WRCSR, |
| 92478 | 92490 | pCx->pKeyInfo, pCx->uc.pCursor); |
| 92479 | 92491 | /* The sqlite3BtreeCursor() routine can only fail for the first cursor |
| 92480 | 92492 | ** opened for a database. Since there is already an open cursor when this |
| 92481 | 92493 | ** opcode is run, the sqlite3BtreeCursor() cannot fail */ |
| | @@ -92538,11 +92550,11 @@ |
| 92538 | 92550 | assert( aMem[pOp->p3].flags & MEM_Null ); |
| 92539 | 92551 | aMem[pOp->p3].n = 0; |
| 92540 | 92552 | aMem[pOp->p3].z = ""; |
| 92541 | 92553 | } |
| 92542 | 92554 | pCx = p->apCsr[pOp->p1]; |
| 92543 | | - if( pCx && !pCx->hasBeenDuped && ALWAYS(pOp->p2<=pCx->nField) ){ |
| 92555 | + if( pCx && !pCx->noReuse && ALWAYS(pOp->p2<=pCx->nField) ){ |
| 92544 | 92556 | /* If the ephermeral table is already open and has no duplicates from |
| 92545 | 92557 | ** OP_OpenDup, then erase all existing content so that the table is |
| 92546 | 92558 | ** empty again, rather than creating a new table. */ |
| 92547 | 92559 | assert( pCx->isEphemeral ); |
| 92548 | 92560 | pCx->seqCount = 0; |
| | @@ -94125,10 +94137,11 @@ |
| 94125 | 94137 | ** pseudo-cursor that always gives null rows. */ |
| 94126 | 94138 | pC = allocateCursor(p, pOp->p1, 1, CURTYPE_PSEUDO); |
| 94127 | 94139 | if( pC==0 ) goto no_mem; |
| 94128 | 94140 | pC->seekResult = 0; |
| 94129 | 94141 | pC->isTable = 1; |
| 94142 | + pC->noReuse = 1; |
| 94130 | 94143 | pC->uc.pCursor = sqlite3BtreeFakeValidCursor(); |
| 94131 | 94144 | } |
| 94132 | 94145 | pC->nullRow = 1; |
| 94133 | 94146 | pC->cacheStatus = CACHE_STALE; |
| 94134 | 94147 | if( pC->eCurType==CURTYPE_BTREE ){ |
| | @@ -96257,18 +96270,18 @@ |
| 96257 | 96270 | Mem *pDest; |
| 96258 | 96271 | sqlite3_context sContext; |
| 96259 | 96272 | |
| 96260 | 96273 | VdbeCursor *pCur = p->apCsr[pOp->p1]; |
| 96261 | 96274 | assert( pCur!=0 ); |
| 96262 | | - assert( pCur->eCurType==CURTYPE_VTAB ); |
| 96263 | 96275 | assert( pOp->p3>0 && pOp->p3<=(p->nMem+1 - p->nCursor) ); |
| 96264 | 96276 | pDest = &aMem[pOp->p3]; |
| 96265 | 96277 | memAboutToChange(p, pDest); |
| 96266 | 96278 | if( pCur->nullRow ){ |
| 96267 | 96279 | sqlite3VdbeMemSetNull(pDest); |
| 96268 | 96280 | break; |
| 96269 | 96281 | } |
| 96282 | + assert( pCur->eCurType==CURTYPE_VTAB ); |
| 96270 | 96283 | pVtab = pCur->uc.pVCur->pVtab; |
| 96271 | 96284 | pModule = pVtab->pModule; |
| 96272 | 96285 | assert( pModule->xColumn ); |
| 96273 | 96286 | memset(&sContext, 0, sizeof(sContext)); |
| 96274 | 96287 | sContext.pOut = pDest; |
| | @@ -96591,10 +96604,21 @@ |
| 96591 | 96604 | |
| 96592 | 96605 | REGISTER_TRACE(pOp->p3, pOut); |
| 96593 | 96606 | UPDATE_MAX_BLOBSIZE(pOut); |
| 96594 | 96607 | break; |
| 96595 | 96608 | } |
| 96609 | + |
| 96610 | +/* Opcode: ClrSubtype P1 * * * * |
| 96611 | +** Synopsis: r[P1].subtype = 0 |
| 96612 | +** |
| 96613 | +** Clear the subtype from register P1. |
| 96614 | +*/ |
| 96615 | +case OP_ClrSubtype: { /* in1 */ |
| 96616 | + pIn1 = &aMem[pOp->p1]; |
| 96617 | + pIn1->flags &= ~MEM_Subtype; |
| 96618 | + break; |
| 96619 | +} |
| 96596 | 96620 | |
| 96597 | 96621 | /* Opcode: FilterAdd P1 * P3 P4 * |
| 96598 | 96622 | ** Synopsis: filter(P1) += key(P3@P4) |
| 96599 | 96623 | ** |
| 96600 | 96624 | ** Compute a hash on the P4 registers starting with r[P3] and |
| | @@ -102345,11 +102369,11 @@ |
| 102345 | 102369 | for(i=0, p=pNC; p && i<ArraySize(anRef); p=p->pNext, i++){ |
| 102346 | 102370 | anRef[i] = p->nRef; |
| 102347 | 102371 | } |
| 102348 | 102372 | sqlite3WalkExpr(pWalker, pExpr->pLeft); |
| 102349 | 102373 | if( 0==sqlite3ExprCanBeNull(pExpr->pLeft) && !IN_RENAME_OBJECT ){ |
| 102350 | | - testcase( ExprHasProperty(pExpr, EP_FromJoin) ); |
| 102374 | + testcase( ExprHasProperty(pExpr, EP_OuterON) ); |
| 102351 | 102375 | assert( !ExprHasProperty(pExpr, EP_IntValue) ); |
| 102352 | 102376 | if( pExpr->op==TK_NOTNULL ){ |
| 102353 | 102377 | pExpr->u.zToken = "true"; |
| 102354 | 102378 | ExprSetProperty(pExpr, EP_IsTrue); |
| 102355 | 102379 | }else{ |
| | @@ -104636,10 +104660,11 @@ |
| 104636 | 104660 | pNew = sqlite3ExprAlloc(db, TK_FUNCTION, pToken, 1); |
| 104637 | 104661 | if( pNew==0 ){ |
| 104638 | 104662 | sqlite3ExprListDelete(db, pList); /* Avoid memory leak when malloc fails */ |
| 104639 | 104663 | return 0; |
| 104640 | 104664 | } |
| 104665 | + assert( !ExprHasProperty(pNew, EP_InnerON|EP_OuterON) ); |
| 104641 | 104666 | pNew->w.iOfst = (int)(pToken->z - pParse->zTail); |
| 104642 | 104667 | if( pList |
| 104643 | 104668 | && pList->nExpr > pParse->db->aLimit[SQLITE_LIMIT_FUNCTION_ARG] |
| 104644 | 104669 | && !pParse->nested |
| 104645 | 104670 | ){ |
| | @@ -104914,11 +104939,11 @@ |
| 104914 | 104939 | #endif |
| 104915 | 104940 | ){ |
| 104916 | 104941 | nSize = EXPR_FULLSIZE; |
| 104917 | 104942 | }else{ |
| 104918 | 104943 | assert( !ExprHasProperty(p, EP_TokenOnly|EP_Reduced) ); |
| 104919 | | - assert( !ExprHasProperty(p, EP_FromJoin) ); |
| 104944 | + assert( !ExprHasProperty(p, EP_OuterON) ); |
| 104920 | 104945 | assert( !ExprHasProperty(p, EP_MemToken) ); |
| 104921 | 104946 | assert( !ExprHasVVAProperty(p, EP_NoReduce) ); |
| 104922 | 104947 | if( p->pLeft || p->x.pList ){ |
| 104923 | 104948 | nSize = EXPR_REDUCEDSIZE | EP_Reduced; |
| 104924 | 104949 | }else{ |
| | @@ -105740,11 +105765,11 @@ |
| 105740 | 105765 | static int exprNodeIsConstant(Walker *pWalker, Expr *pExpr){ |
| 105741 | 105766 | |
| 105742 | 105767 | /* If pWalker->eCode is 2 then any term of the expression that comes from |
| 105743 | 105768 | ** the ON or USING clauses of an outer join disqualifies the expression |
| 105744 | 105769 | ** from being considered constant. */ |
| 105745 | | - if( pWalker->eCode==2 && ExprHasProperty(pExpr, EP_FromJoin) ){ |
| 105770 | + if( pWalker->eCode==2 && ExprHasProperty(pExpr, EP_OuterON) ){ |
| 105746 | 105771 | pWalker->eCode = 0; |
| 105747 | 105772 | return WRC_Abort; |
| 105748 | 105773 | } |
| 105749 | 105774 | |
| 105750 | 105775 | switch( pExpr->op ){ |
| | @@ -105887,14 +105912,14 @@ |
| 105887 | 105912 | SQLITE_PRIVATE int sqlite3ExprIsTableConstraint(Expr *pExpr, const SrcItem *pSrc){ |
| 105888 | 105913 | if( pSrc->fg.jointype & JT_LTORJ ){ |
| 105889 | 105914 | return 0; /* rule (3) */ |
| 105890 | 105915 | } |
| 105891 | 105916 | if( pSrc->fg.jointype & JT_LEFT ){ |
| 105892 | | - if( !ExprHasProperty(pExpr, EP_FromJoin) ) return 0; /* rule (4a) */ |
| 105917 | + if( !ExprHasProperty(pExpr, EP_OuterON) ) return 0; /* rule (4a) */ |
| 105893 | 105918 | if( pExpr->w.iJoin!=pSrc->iCursor ) return 0; /* rule (4b) */ |
| 105894 | 105919 | }else{ |
| 105895 | | - if( ExprHasProperty(pExpr, EP_FromJoin) ) return 0; /* rule (5) */ |
| 105920 | + if( ExprHasProperty(pExpr, EP_OuterON) ) return 0; /* rule (5) */ |
| 105896 | 105921 | } |
| 105897 | 105922 | return sqlite3ExprIsTableConstant(pExpr, pSrc->iCursor); /* rules (1), (2) */ |
| 105898 | 105923 | } |
| 105899 | 105924 | |
| 105900 | 105925 | |
| | @@ -106312,15 +106337,11 @@ |
| 106312 | 106337 | int mustBeUnique; /* True if RHS must be unique */ |
| 106313 | 106338 | Vdbe *v = sqlite3GetVdbe(pParse); /* Virtual machine being coded */ |
| 106314 | 106339 | |
| 106315 | 106340 | assert( pX->op==TK_IN ); |
| 106316 | 106341 | mustBeUnique = (inFlags & IN_INDEX_LOOP)!=0; |
| 106317 | | - if( pX->iTable && (inFlags & IN_INDEX_REUSE_CUR)!=0 ){ |
| 106318 | | - iTab = pX->iTable; |
| 106319 | | - }else{ |
| 106320 | | - iTab = pParse->nTab++; |
| 106321 | | - } |
| 106342 | + iTab = pParse->nTab++; |
| 106322 | 106343 | |
| 106323 | 106344 | /* If the RHS of this IN(...) operator is a SELECT, and if it matters |
| 106324 | 106345 | ** whether or not the SELECT result contains NULL values, check whether |
| 106325 | 106346 | ** or not NULL is actually possible (it may not be, for example, due |
| 106326 | 106347 | ** to NOT NULL constraints in the schema). If no NULL values are possible, |
| | @@ -106650,13 +106671,12 @@ |
| 106650 | 106671 | pExpr->x.pSelect->selId)); |
| 106651 | 106672 | } |
| 106652 | 106673 | assert( ExprUseYSub(pExpr) ); |
| 106653 | 106674 | sqlite3VdbeAddOp2(v, OP_Gosub, pExpr->y.sub.regReturn, |
| 106654 | 106675 | pExpr->y.sub.iAddr); |
| 106655 | | - if( iTab!=pExpr->iTable ){ |
| 106656 | | - sqlite3VdbeAddOp2(v, OP_OpenDup, iTab, pExpr->iTable); |
| 106657 | | - } |
| 106676 | + assert( iTab!=pExpr->iTable ); |
| 106677 | + sqlite3VdbeAddOp2(v, OP_OpenDup, iTab, pExpr->iTable); |
| 106658 | 106678 | sqlite3VdbeJumpHere(v, addrOnce); |
| 106659 | 106679 | return; |
| 106660 | 106680 | } |
| 106661 | 106681 | |
| 106662 | 106682 | /* Begin coding the subroutine */ |
| | @@ -107526,11 +107546,21 @@ |
| 107526 | 107546 | memset(&caseExpr, 0, sizeof(caseExpr)); |
| 107527 | 107547 | caseExpr.op = TK_CASE; |
| 107528 | 107548 | caseExpr.x.pList = pFarg; |
| 107529 | 107549 | return sqlite3ExprCodeTarget(pParse, &caseExpr, target); |
| 107530 | 107550 | } |
| 107531 | | - |
| 107551 | +#ifdef SQLITE_ENABLE_OFFSET_SQL_FUNC |
| 107552 | + case INLINEFUNC_sqlite_offset: { |
| 107553 | + Expr *pArg = pFarg->a[0].pExpr; |
| 107554 | + if( pArg->op==TK_COLUMN && pArg->iTable>=0 ){ |
| 107555 | + sqlite3VdbeAddOp3(v, OP_Offset, pArg->iTable, pArg->iColumn, target); |
| 107556 | + }else{ |
| 107557 | + sqlite3VdbeAddOp2(v, OP_Null, 0, target); |
| 107558 | + } |
| 107559 | + break; |
| 107560 | + } |
| 107561 | +#endif |
| 107532 | 107562 | default: { |
| 107533 | 107563 | /* The UNLIKELY() function is a no-op. The result is the value |
| 107534 | 107564 | ** of the first argument. |
| 107535 | 107565 | */ |
| 107536 | 107566 | assert( nFarg==1 || nFarg==2 ); |
| | @@ -108065,24 +108095,12 @@ |
| 108065 | 108095 | #endif |
| 108066 | 108096 | if( pDef->funcFlags & SQLITE_FUNC_NEEDCOLL ){ |
| 108067 | 108097 | if( !pColl ) pColl = db->pDfltColl; |
| 108068 | 108098 | sqlite3VdbeAddOp4(v, OP_CollSeq, 0, 0, 0, (char *)pColl, P4_COLLSEQ); |
| 108069 | 108099 | } |
| 108070 | | -#ifdef SQLITE_ENABLE_OFFSET_SQL_FUNC |
| 108071 | | - if( (pDef->funcFlags & SQLITE_FUNC_OFFSET)!=0 && ALWAYS(pFarg!=0) ){ |
| 108072 | | - Expr *pArg = pFarg->a[0].pExpr; |
| 108073 | | - if( pArg->op==TK_COLUMN ){ |
| 108074 | | - sqlite3VdbeAddOp3(v, OP_Offset, pArg->iTable, pArg->iColumn, target); |
| 108075 | | - }else{ |
| 108076 | | - sqlite3VdbeAddOp2(v, OP_Null, 0, target); |
| 108077 | | - } |
| 108078 | | - }else |
| 108079 | | -#endif |
| 108080 | | - { |
| 108081 | | - sqlite3VdbeAddFunctionCall(pParse, constMask, r1, target, nFarg, |
| 108082 | | - pDef, pExpr->op2); |
| 108083 | | - } |
| 108100 | + sqlite3VdbeAddFunctionCall(pParse, constMask, r1, target, nFarg, |
| 108101 | + pDef, pExpr->op2); |
| 108084 | 108102 | if( nFarg ){ |
| 108085 | 108103 | if( constMask==0 ){ |
| 108086 | 108104 | sqlite3ReleaseTempRange(pParse, r1, nFarg); |
| 108087 | 108105 | }else{ |
| 108088 | 108106 | sqlite3VdbeReleaseRegisters(pParse, r1, nFarg, constMask, 1); |
| | @@ -108149,13 +108167,29 @@ |
| 108149 | 108167 | ** Z is stored in pExpr->pList->a[1].pExpr. |
| 108150 | 108168 | */ |
| 108151 | 108169 | case TK_BETWEEN: { |
| 108152 | 108170 | exprCodeBetween(pParse, pExpr, target, 0, 0); |
| 108153 | 108171 | return target; |
| 108172 | + } |
| 108173 | + case TK_COLLATE: { |
| 108174 | + if( !ExprHasProperty(pExpr, EP_Collate) |
| 108175 | + && ALWAYS(pExpr->pLeft) |
| 108176 | + && pExpr->pLeft->op==TK_FUNCTION |
| 108177 | + ){ |
| 108178 | + inReg = sqlite3ExprCodeTarget(pParse, pExpr->pLeft, target); |
| 108179 | + if( inReg!=target ){ |
| 108180 | + sqlite3VdbeAddOp2(v, OP_SCopy, inReg, target); |
| 108181 | + inReg = target; |
| 108182 | + } |
| 108183 | + sqlite3VdbeAddOp1(v, OP_ClrSubtype, inReg); |
| 108184 | + return inReg; |
| 108185 | + }else{ |
| 108186 | + pExpr = pExpr->pLeft; |
| 108187 | + goto expr_code_doover; /* 2018-04-28: Prevent deep recursion. */ |
| 108188 | + } |
| 108154 | 108189 | } |
| 108155 | 108190 | case TK_SPAN: |
| 108156 | | - case TK_COLLATE: |
| 108157 | 108191 | case TK_UPLUS: { |
| 108158 | 108192 | pExpr = pExpr->pLeft; |
| 108159 | 108193 | goto expr_code_doover; /* 2018-04-28: Prevent deep recursion. OSSFuzz. */ |
| 108160 | 108194 | } |
| 108161 | 108195 | |
| | @@ -108645,12 +108679,12 @@ |
| 108645 | 108679 | }else{ |
| 108646 | 108680 | /* Mark the expression is being from the ON or USING clause of a join |
| 108647 | 108681 | ** so that the sqlite3ExprCodeTarget() routine will not attempt to move |
| 108648 | 108682 | ** it into the Parse.pConstExpr list. We should use a new bit for this, |
| 108649 | 108683 | ** for clarity, but we are out of bits in the Expr.flags field so we |
| 108650 | | - ** have to reuse the EP_FromJoin bit. Bummer. */ |
| 108651 | | - pDel->flags |= EP_FromJoin; |
| 108684 | + ** have to reuse the EP_OuterON bit. Bummer. */ |
| 108685 | + pDel->flags |= EP_OuterON; |
| 108652 | 108686 | sqlite3ExprCodeTarget(pParse, &exprAnd, dest); |
| 108653 | 108687 | } |
| 108654 | 108688 | sqlite3ReleaseTempReg(pParse, regFree1); |
| 108655 | 108689 | } |
| 108656 | 108690 | sqlite3ExprDelete(db, pDel); |
| | @@ -109331,11 +109365,11 @@ |
| 109331 | 109365 | ** (never setting pWalker->eCode) is a harmless missed optimization. |
| 109332 | 109366 | */ |
| 109333 | 109367 | static int impliesNotNullRow(Walker *pWalker, Expr *pExpr){ |
| 109334 | 109368 | testcase( pExpr->op==TK_AGG_COLUMN ); |
| 109335 | 109369 | testcase( pExpr->op==TK_AGG_FUNCTION ); |
| 109336 | | - if( ExprHasProperty(pExpr, EP_FromJoin) ) return WRC_Prune; |
| 109370 | + if( ExprHasProperty(pExpr, EP_OuterON) ) return WRC_Prune; |
| 109337 | 109371 | switch( pExpr->op ){ |
| 109338 | 109372 | case TK_ISNOT: |
| 109339 | 109373 | case TK_ISNULL: |
| 109340 | 109374 | case TK_NOTNULL: |
| 109341 | 109375 | case TK_IS: |
| | @@ -109428,11 +109462,11 @@ |
| 109428 | 109462 | ** is NULL. A false negative is merely a missed optimization opportunity. |
| 109429 | 109463 | ** |
| 109430 | 109464 | ** False positives are not allowed, however. A false positive may result |
| 109431 | 109465 | ** in an incorrect answer. |
| 109432 | 109466 | ** |
| 109433 | | -** Terms of p that are marked with EP_FromJoin (and hence that come from |
| 109467 | +** Terms of p that are marked with EP_OuterON (and hence that come from |
| 109434 | 109468 | ** the ON or USING clauses of OUTER JOINS) are excluded from the analysis. |
| 109435 | 109469 | ** |
| 109436 | 109470 | ** This routine is used to check if a LEFT JOIN can be converted into |
| 109437 | 109471 | ** an ordinary JOIN. The p argument is the WHERE clause. If the WHERE |
| 109438 | 109472 | ** clause requires that some column of the right table of the LEFT JOIN |
| | @@ -111302,31 +111336,37 @@ |
| 111302 | 111336 | if( pParse->nErr ) rc = pParse->rc; |
| 111303 | 111337 | } |
| 111304 | 111338 | if( rc==SQLITE_OK && pStep->zTarget ){ |
| 111305 | 111339 | SrcList *pSrc = sqlite3TriggerStepSrc(pParse, pStep); |
| 111306 | 111340 | if( pSrc ){ |
| 111307 | | - int i; |
| 111308 | | - for(i=0; i<pSrc->nSrc && rc==SQLITE_OK; i++){ |
| 111309 | | - SrcItem *p = &pSrc->a[i]; |
| 111310 | | - p->iCursor = pParse->nTab++; |
| 111311 | | - if( p->pSelect ){ |
| 111312 | | - sqlite3SelectPrep(pParse, p->pSelect, 0); |
| 111313 | | - sqlite3ExpandSubquery(pParse, p); |
| 111314 | | - assert( i>0 ); |
| 111315 | | - assert( pStep->pFrom->a[i-1].pSelect ); |
| 111316 | | - sqlite3SelectPrep(pParse, pStep->pFrom->a[i-1].pSelect, 0); |
| 111317 | | - }else{ |
| 111318 | | - p->pTab = sqlite3LocateTableItem(pParse, 0, p); |
| 111319 | | - if( p->pTab==0 ){ |
| 111320 | | - rc = SQLITE_ERROR; |
| 111321 | | - }else{ |
| 111322 | | - p->pTab->nTabRef++; |
| 111323 | | - rc = sqlite3ViewGetColumnNames(pParse, p->pTab); |
| 111341 | + Select *pSel = sqlite3SelectNew( |
| 111342 | + pParse, pStep->pExprList, pSrc, 0, 0, 0, 0, 0, 0 |
| 111343 | + ); |
| 111344 | + if( pSel==0 ){ |
| 111345 | + pStep->pExprList = 0; |
| 111346 | + pSrc = 0; |
| 111347 | + rc = SQLITE_NOMEM; |
| 111348 | + }else{ |
| 111349 | + sqlite3SelectPrep(pParse, pSel, 0); |
| 111350 | + rc = pParse->nErr ? SQLITE_ERROR : SQLITE_OK; |
| 111351 | + assert( pStep->pExprList==0 || pStep->pExprList==pSel->pEList ); |
| 111352 | + assert( pSrc==pSel->pSrc ); |
| 111353 | + if( pStep->pExprList ) pSel->pEList = 0; |
| 111354 | + pSel->pSrc = 0; |
| 111355 | + sqlite3SelectDelete(db, pSel); |
| 111356 | + } |
| 111357 | + if( pStep->pFrom ){ |
| 111358 | + int i; |
| 111359 | + for(i=0; i<pStep->pFrom->nSrc && rc==SQLITE_OK; i++){ |
| 111360 | + SrcItem *p = &pStep->pFrom->a[i]; |
| 111361 | + if( p->pSelect ){ |
| 111362 | + sqlite3SelectPrep(pParse, p->pSelect, 0); |
| 111324 | 111363 | } |
| 111325 | 111364 | } |
| 111326 | 111365 | } |
| 111327 | | - if( rc==SQLITE_OK && db->mallocFailed ){ |
| 111366 | + |
| 111367 | + if( db->mallocFailed ){ |
| 111328 | 111368 | rc = SQLITE_NOMEM; |
| 111329 | 111369 | } |
| 111330 | 111370 | sNC.pSrcList = pSrc; |
| 111331 | 111371 | if( rc==SQLITE_OK && pStep->pWhere ){ |
| 111332 | 111372 | rc = sqlite3ResolveExprNames(&sNC, pStep->pWhere); |
| | @@ -111773,10 +111813,19 @@ |
| 111773 | 111813 | if( rc==SQLITE_OK ){ |
| 111774 | 111814 | renameWalkTrigger(&sWalker, pTrigger); |
| 111775 | 111815 | for(pStep=pTrigger->step_list; pStep; pStep=pStep->pNext){ |
| 111776 | 111816 | if( pStep->zTarget && 0==sqlite3_stricmp(pStep->zTarget, zOld) ){ |
| 111777 | 111817 | renameTokenFind(&sParse, &sCtx, pStep->zTarget); |
| 111818 | + } |
| 111819 | + if( pStep->pFrom ){ |
| 111820 | + int i; |
| 111821 | + for(i=0; i<pStep->pFrom->nSrc; i++){ |
| 111822 | + SrcItem *pItem = &pStep->pFrom->a[i]; |
| 111823 | + if( 0==sqlite3_stricmp(pItem->zName, zOld) ){ |
| 111824 | + renameTokenFind(&sParse, &sCtx, pItem->zName); |
| 111825 | + } |
| 111826 | + } |
| 111778 | 111827 | } |
| 111779 | 111828 | } |
| 111780 | 111829 | } |
| 111781 | 111830 | } |
| 111782 | 111831 | } |
| | @@ -124372,15 +124421,15 @@ |
| 124372 | 124421 | }else{ |
| 124373 | 124422 | ans = log(x); |
| 124374 | 124423 | switch( SQLITE_PTR_TO_INT(sqlite3_user_data(context)) ){ |
| 124375 | 124424 | case 1: |
| 124376 | 124425 | /* Convert from natural logarithm to log base 10 */ |
| 124377 | | - ans *= 1.0/M_LN10; |
| 124426 | + ans /= M_LN10; |
| 124378 | 124427 | break; |
| 124379 | 124428 | case 2: |
| 124380 | 124429 | /* Convert from natural logarithm to log base 2 */ |
| 124381 | | - ans *= 1.0/M_LN2; |
| 124430 | + ans /= M_LN2; |
| 124382 | 124431 | break; |
| 124383 | 124432 | default: |
| 124384 | 124433 | break; |
| 124385 | 124434 | } |
| 124386 | 124435 | } |
| | @@ -124515,12 +124564,11 @@ |
| 124515 | 124564 | #endif /* SQLITE_OMIT_COMPILEOPTION_DIAGS */ |
| 124516 | 124565 | INLINE_FUNC(unlikely, 1, INLINEFUNC_unlikely, SQLITE_FUNC_UNLIKELY), |
| 124517 | 124566 | INLINE_FUNC(likelihood, 2, INLINEFUNC_unlikely, SQLITE_FUNC_UNLIKELY), |
| 124518 | 124567 | INLINE_FUNC(likely, 1, INLINEFUNC_unlikely, SQLITE_FUNC_UNLIKELY), |
| 124519 | 124568 | #ifdef SQLITE_ENABLE_OFFSET_SQL_FUNC |
| 124520 | | - {1, SQLITE_FUNC_BUILTIN|SQLITE_UTF8|SQLITE_FUNC_OFFSET|SQLITE_FUNC_TYPEOF, |
| 124521 | | - 0, 0, noopFunc, 0, 0, 0, "sqlite_offset", {0} }, |
| 124569 | + INLINE_FUNC(sqlite_offset, 1, INLINEFUNC_sqlite_offset, 0 ), |
| 124522 | 124570 | #endif |
| 124523 | 124571 | FUNCTION(ltrim, 1, 1, 0, trimFunc ), |
| 124524 | 124572 | FUNCTION(ltrim, 2, 1, 0, trimFunc ), |
| 124525 | 124573 | FUNCTION(rtrim, 1, 2, 0, trimFunc ), |
| 124526 | 124574 | FUNCTION(rtrim, 2, 2, 0, trimFunc ), |
| | @@ -129800,10 +129848,11 @@ |
| 129800 | 129848 | /* Version 3.39.0 and later */ |
| 129801 | 129849 | int (*deserialize)(sqlite3*,const char*,unsigned char*, |
| 129802 | 129850 | sqlite3_int64,sqlite3_int64,unsigned); |
| 129803 | 129851 | unsigned char *(*serialize)(sqlite3*,const char *,sqlite3_int64*, |
| 129804 | 129852 | unsigned int); |
| 129853 | + const char *(*db_name)(sqlite3*,int); |
| 129805 | 129854 | }; |
| 129806 | 129855 | |
| 129807 | 129856 | /* |
| 129808 | 129857 | ** This is the function signature used for all extension entry points. It |
| 129809 | 129858 | ** is also defined in the file "loadext.c". |
| | @@ -130118,14 +130167,16 @@ |
| 130118 | 130167 | #define sqlite3_vtab_rhs_value sqlite3_api->vtab_rhs_value |
| 130119 | 130168 | #define sqlite3_vtab_distinct sqlite3_api->vtab_distinct |
| 130120 | 130169 | #define sqlite3_vtab_in sqlite3_api->vtab_in |
| 130121 | 130170 | #define sqlite3_vtab_in_first sqlite3_api->vtab_in_first |
| 130122 | 130171 | #define sqlite3_vtab_in_next sqlite3_api->vtab_in_next |
| 130172 | +/* Version 3.39.0 and later */ |
| 130123 | 130173 | #ifndef SQLITE_OMIT_DESERIALIZE |
| 130124 | 130174 | #define sqlite3_deserialize sqlite3_api->deserialize |
| 130125 | 130175 | #define sqlite3_serialize sqlite3_api->serialize |
| 130126 | 130176 | #endif |
| 130177 | +#define sqlite3_db_name sqlite3_api->db_name |
| 130127 | 130178 | #endif /* !defined(SQLITE_CORE) && !defined(SQLITE_OMIT_LOAD_EXTENSION) */ |
| 130128 | 130179 | |
| 130129 | 130180 | #if !defined(SQLITE_CORE) && !defined(SQLITE_OMIT_LOAD_EXTENSION) |
| 130130 | 130181 | /* This case when the file really is being compiled as a loadable |
| 130131 | 130182 | ** extension */ |
| | @@ -130629,15 +130680,16 @@ |
| 130629 | 130680 | 0, |
| 130630 | 130681 | #endif |
| 130631 | 130682 | /* Version 3.39.0 and later */ |
| 130632 | 130683 | #ifndef SQLITE_OMIT_DESERIALIZE |
| 130633 | 130684 | sqlite3_deserialize, |
| 130634 | | - sqlite3_serialize |
| 130685 | + sqlite3_serialize, |
| 130635 | 130686 | #else |
| 130687 | + 0, |
| 130636 | 130688 | 0, |
| 130637 | | - 0 |
| 130638 | 130689 | #endif |
| 130690 | + sqlite3_db_name |
| 130639 | 130691 | }; |
| 130640 | 130692 | |
| 130641 | 130693 | /* True if x is the directory separator character |
| 130642 | 130694 | */ |
| 130643 | 130695 | #if SQLITE_OS_WIN |
| | @@ -135849,15 +135901,15 @@ |
| 135849 | 135901 | } |
| 135850 | 135902 | return 0; |
| 135851 | 135903 | } |
| 135852 | 135904 | |
| 135853 | 135905 | /* |
| 135854 | | -** Set the EP_FromJoin property on all terms of the given expression. |
| 135906 | +** Set the EP_OuterON property on all terms of the given expression. |
| 135855 | 135907 | ** And set the Expr.w.iJoin to iTable for every term in the |
| 135856 | 135908 | ** expression. |
| 135857 | 135909 | ** |
| 135858 | | -** The EP_FromJoin property is used on terms of an expression to tell |
| 135910 | +** The EP_OuterON property is used on terms of an expression to tell |
| 135859 | 135911 | ** the OUTER JOIN processing logic that this term is part of the |
| 135860 | 135912 | ** join restriction specified in the ON or USING clause and not a part |
| 135861 | 135913 | ** of the more general WHERE clause. These terms are moved over to the |
| 135862 | 135914 | ** WHERE clause during join processing but we need to remember that they |
| 135863 | 135915 | ** originated in the ON or USING clause. |
| | @@ -135875,11 +135927,11 @@ |
| 135875 | 135927 | ** defer the handling of t1.x=5, it will be processed immediately |
| 135876 | 135928 | ** after the t1 loop and rows with t1.x!=5 will never appear in |
| 135877 | 135929 | ** the output, which is incorrect. |
| 135878 | 135930 | */ |
| 135879 | 135931 | SQLITE_PRIVATE void sqlite3SetJoinExpr(Expr *p, int iTable, u32 joinFlag){ |
| 135880 | | - assert( joinFlag==EP_FromJoin || joinFlag==EP_InnerJoin ); |
| 135932 | + assert( joinFlag==EP_OuterON || joinFlag==EP_InnerON ); |
| 135881 | 135933 | while( p ){ |
| 135882 | 135934 | ExprSetProperty(p, joinFlag); |
| 135883 | 135935 | assert( !ExprHasProperty(p, EP_TokenOnly|EP_Reduced) ); |
| 135884 | 135936 | ExprSetVVAProperty(p, EP_NoReduce); |
| 135885 | 135937 | p->w.iJoin = iTable; |
| | @@ -135896,35 +135948,41 @@ |
| 135896 | 135948 | p = p->pRight; |
| 135897 | 135949 | } |
| 135898 | 135950 | } |
| 135899 | 135951 | |
| 135900 | 135952 | /* Undo the work of sqlite3SetJoinExpr(). In the expression p, convert every |
| 135901 | | -** term that is marked with EP_FromJoin and w.iJoin==iTable into |
| 135902 | | -** an ordinary term that omits the EP_FromJoin mark. |
| 135953 | +** term that is marked with EP_OuterON and w.iJoin==iTable into |
| 135954 | +** an ordinary term that omits the EP_OuterON mark. |
| 135903 | 135955 | ** |
| 135904 | 135956 | ** This happens when a LEFT JOIN is simplified into an ordinary JOIN. |
| 135957 | +** |
| 135958 | +** If nullable is true, that means that Expr p might evaluate to NULL even |
| 135959 | +** if it is a reference to a NOT NULL column. This can happen, for example, |
| 135960 | +** if the table that p references is on the left side of a RIGHT JOIN. |
| 135961 | +** If nullable is true, then take care to not remove the EP_CanBeNull bit. |
| 135962 | +** See forum thread https://sqlite.org/forum/forumpost/b40696f50145d21c |
| 135905 | 135963 | */ |
| 135906 | | -static void unsetJoinExpr(Expr *p, int iTable){ |
| 135964 | +static void unsetJoinExpr(Expr *p, int iTable, int nullable){ |
| 135907 | 135965 | while( p ){ |
| 135908 | | - if( ExprHasProperty(p, EP_FromJoin) |
| 135966 | + if( ExprHasProperty(p, EP_OuterON) |
| 135909 | 135967 | && (iTable<0 || p->w.iJoin==iTable) ){ |
| 135910 | | - ExprClearProperty(p, EP_FromJoin); |
| 135911 | | - ExprSetProperty(p, EP_InnerJoin); |
| 135968 | + ExprClearProperty(p, EP_OuterON); |
| 135969 | + ExprSetProperty(p, EP_InnerON); |
| 135912 | 135970 | } |
| 135913 | | - if( p->op==TK_COLUMN && p->iTable==iTable ){ |
| 135971 | + if( p->op==TK_COLUMN && p->iTable==iTable && !nullable ){ |
| 135914 | 135972 | ExprClearProperty(p, EP_CanBeNull); |
| 135915 | 135973 | } |
| 135916 | 135974 | if( p->op==TK_FUNCTION ){ |
| 135917 | 135975 | assert( ExprUseXList(p) ); |
| 135918 | 135976 | if( p->x.pList ){ |
| 135919 | 135977 | int i; |
| 135920 | 135978 | for(i=0; i<p->x.pList->nExpr; i++){ |
| 135921 | | - unsetJoinExpr(p->x.pList->a[i].pExpr, iTable); |
| 135979 | + unsetJoinExpr(p->x.pList->a[i].pExpr, iTable, nullable); |
| 135922 | 135980 | } |
| 135923 | 135981 | } |
| 135924 | 135982 | } |
| 135925 | | - unsetJoinExpr(p->pLeft, iTable); |
| 135983 | + unsetJoinExpr(p->pLeft, iTable, nullable); |
| 135926 | 135984 | p = p->pRight; |
| 135927 | 135985 | } |
| 135928 | 135986 | } |
| 135929 | 135987 | |
| 135930 | 135988 | /* |
| | @@ -135934,12 +135992,12 @@ |
| 135934 | 135992 | ** do not need to be concerned with NATURAL joins and we only have |
| 135935 | 135993 | ** think about USING joins. |
| 135936 | 135994 | ** |
| 135937 | 135995 | ** * ON and USING clauses result in extra terms being added to the |
| 135938 | 135996 | ** WHERE clause to enforce the specified constraints. The extra |
| 135939 | | -** WHERE clause terms will be tagged with EP_FromJoin or |
| 135940 | | -** EP_InnerJoin so that we know that they originated in ON/USING. |
| 135997 | +** WHERE clause terms will be tagged with EP_OuterON or |
| 135998 | +** EP_InnerON so that we know that they originated in ON/USING. |
| 135941 | 135999 | ** |
| 135942 | 136000 | ** The terms of a FROM clause are contained in the Select.pSrc structure. |
| 135943 | 136001 | ** The left most table is the first entry in Select.pSrc. The right-most |
| 135944 | 136002 | ** table is the last entry. The join operator is held in the entry to |
| 135945 | 136003 | ** the right. Thus entry 1 contains the join operator for the join between |
| | @@ -135960,11 +136018,11 @@ |
| 135960 | 136018 | for(i=0; i<pSrc->nSrc-1; i++, pRight++, pLeft++){ |
| 135961 | 136019 | Table *pRightTab = pRight->pTab; |
| 135962 | 136020 | u32 joinType; |
| 135963 | 136021 | |
| 135964 | 136022 | if( NEVER(pLeft->pTab==0 || pRightTab==0) ) continue; |
| 135965 | | - joinType = (pRight->fg.jointype & JT_OUTER)!=0 ? EP_FromJoin : EP_InnerJoin; |
| 136023 | + joinType = (pRight->fg.jointype & JT_OUTER)!=0 ? EP_OuterON : EP_InnerON; |
| 135966 | 136024 | |
| 135967 | 136025 | /* If this is a NATURAL join, synthesize an approprate USING clause |
| 135968 | 136026 | ** to specify which columns should be joined. |
| 135969 | 136027 | */ |
| 135970 | 136028 | if( pRight->fg.jointype & JT_NATURAL ){ |
| | @@ -136081,10 +136139,11 @@ |
| 136081 | 136139 | */ |
| 136082 | 136140 | else if( pRight->u3.pOn ){ |
| 136083 | 136141 | sqlite3SetJoinExpr(pRight->u3.pOn, pRight->iCursor, joinType); |
| 136084 | 136142 | p->pWhere = sqlite3ExprAnd(pParse, p->pWhere, pRight->u3.pOn); |
| 136085 | 136143 | pRight->u3.pOn = 0; |
| 136144 | + pRight->fg.isOn = 1; |
| 136086 | 136145 | } |
| 136087 | 136146 | } |
| 136088 | 136147 | return 0; |
| 136089 | 136148 | } |
| 136090 | 136149 | |
| | @@ -137664,14 +137723,15 @@ |
| 137664 | 137723 | pColExpr = pColExpr->pRight; |
| 137665 | 137724 | assert( pColExpr!=0 ); |
| 137666 | 137725 | } |
| 137667 | 137726 | if( pColExpr->op==TK_COLUMN |
| 137668 | 137727 | && ALWAYS( ExprUseYTab(pColExpr) ) |
| 137669 | | - && (pTab = pColExpr->y.pTab)!=0 |
| 137728 | + && ALWAYS( pColExpr->y.pTab!=0 ) |
| 137670 | 137729 | ){ |
| 137671 | 137730 | /* For columns use the column name name */ |
| 137672 | 137731 | int iCol = pColExpr->iColumn; |
| 137732 | + pTab = pColExpr->y.pTab; |
| 137673 | 137733 | if( iCol<0 ) iCol = pTab->iPKey; |
| 137674 | 137734 | zName = iCol>=0 ? pTab->aCol[iCol].zCnName : "rowid"; |
| 137675 | 137735 | }else if( pColExpr->op==TK_ID ){ |
| 137676 | 137736 | assert( !ExprHasProperty(pColExpr, EP_IntValue) ); |
| 137677 | 137737 | zName = pColExpr->u.zToken; |
| | @@ -139233,13 +139293,14 @@ |
| 139233 | 139293 | static Expr *substExpr( |
| 139234 | 139294 | SubstContext *pSubst, /* Description of the substitution */ |
| 139235 | 139295 | Expr *pExpr /* Expr in which substitution occurs */ |
| 139236 | 139296 | ){ |
| 139237 | 139297 | if( pExpr==0 ) return 0; |
| 139238 | | - if( ExprHasProperty(pExpr, EP_FromJoin) |
| 139298 | + if( ExprHasProperty(pExpr, EP_OuterON|EP_InnerON) |
| 139239 | 139299 | && pExpr->w.iJoin==pSubst->iTable |
| 139240 | 139300 | ){ |
| 139301 | + testcase( ExprHasProperty(pExpr, EP_InnerON) ); |
| 139241 | 139302 | pExpr->w.iJoin = pSubst->iNewTable; |
| 139242 | 139303 | } |
| 139243 | 139304 | if( pExpr->op==TK_COLUMN |
| 139244 | 139305 | && pExpr->iTable==pSubst->iTable |
| 139245 | 139306 | && !ExprHasProperty(pExpr, EP_FixedCol) |
| | @@ -139274,16 +139335,21 @@ |
| 139274 | 139335 | return pExpr; |
| 139275 | 139336 | } |
| 139276 | 139337 | if( pSubst->isOuterJoin ){ |
| 139277 | 139338 | ExprSetProperty(pNew, EP_CanBeNull); |
| 139278 | 139339 | } |
| 139279 | | - if( ExprHasProperty(pExpr,EP_FromJoin|EP_InnerJoin) ){ |
| 139340 | + if( ExprHasProperty(pExpr,EP_OuterON|EP_InnerON) ){ |
| 139280 | 139341 | sqlite3SetJoinExpr(pNew, pExpr->w.iJoin, |
| 139281 | | - pExpr->flags & (EP_FromJoin|EP_InnerJoin)); |
| 139342 | + pExpr->flags & (EP_OuterON|EP_InnerON)); |
| 139282 | 139343 | } |
| 139283 | 139344 | sqlite3ExprDelete(db, pExpr); |
| 139284 | 139345 | pExpr = pNew; |
| 139346 | + if( pExpr->op==TK_TRUEFALSE ){ |
| 139347 | + pExpr->u.iValue = sqlite3ExprTruthValue(pExpr); |
| 139348 | + pExpr->op = TK_INTEGER; |
| 139349 | + ExprSetProperty(pExpr, EP_IntValue); |
| 139350 | + } |
| 139285 | 139351 | |
| 139286 | 139352 | /* Ensure that the expression now has an implicit collation sequence, |
| 139287 | 139353 | ** just as it did when it was a column of a view or sub-query. */ |
| 139288 | 139354 | if( pExpr->op!=TK_COLUMN && pExpr->op!=TK_COLLATE ){ |
| 139289 | 139355 | CollSeq *pColl = sqlite3ExprCollSeq(pSubst->pParse, pExpr); |
| | @@ -139440,11 +139506,11 @@ |
| 139440 | 139506 | static int renumberCursorsCb(Walker *pWalker, Expr *pExpr){ |
| 139441 | 139507 | int op = pExpr->op; |
| 139442 | 139508 | if( op==TK_COLUMN || op==TK_IF_NULL_ROW ){ |
| 139443 | 139509 | renumberCursorDoMapping(pWalker, &pExpr->iTable); |
| 139444 | 139510 | } |
| 139445 | | - if( ExprHasProperty(pExpr, EP_FromJoin) ){ |
| 139511 | + if( ExprHasProperty(pExpr, EP_OuterON) ){ |
| 139446 | 139512 | renumberCursorDoMapping(pWalker, &pExpr->w.iJoin); |
| 139447 | 139513 | } |
| 139448 | 139514 | return WRC_Continue; |
| 139449 | 139515 | } |
| 139450 | 139516 | |
| | @@ -139633,10 +139699,15 @@ |
| 139633 | 139699 | ** (27) The subquery may not contain a FULL or RIGHT JOIN unless it |
| 139634 | 139700 | ** is the first element of the parent query. |
| 139635 | 139701 | ** |
| 139636 | 139702 | ** (28) The subquery is not a MATERIALIZED CTE. |
| 139637 | 139703 | ** |
| 139704 | +** (29) Either the subquery is not the right-hand operand of a join with an |
| 139705 | +** ON or USING clause nor the right-hand operand of a NATURAL JOIN, or |
| 139706 | +** the right-most table within the FROM clause of the subquery |
| 139707 | +** is not part of an outer join. |
| 139708 | +** |
| 139638 | 139709 | ** |
| 139639 | 139710 | ** In this routine, the "p" parameter is a pointer to the outer query. |
| 139640 | 139711 | ** The subquery is p->pSrc->a[iFrom]. isAgg is true if the outer query |
| 139641 | 139712 | ** uses aggregates. |
| 139642 | 139713 | ** |
| | @@ -139759,10 +139830,39 @@ |
| 139759 | 139830 | return 0; /* Restriction (27) */ |
| 139760 | 139831 | } |
| 139761 | 139832 | if( pSubitem->fg.isCte && pSubitem->u2.pCteUse->eM10d==M10d_Yes ){ |
| 139762 | 139833 | return 0; /* (28) */ |
| 139763 | 139834 | } |
| 139835 | + |
| 139836 | + /* Restriction (29): |
| 139837 | + ** |
| 139838 | + ** We do not want two constraints on the same term of the flattened |
| 139839 | + ** query where one constraint has EP_InnerON and the other is EP_OuterON. |
| 139840 | + ** To prevent this, one or the other of the following conditions must be |
| 139841 | + ** false: |
| 139842 | + ** |
| 139843 | + ** (29a) The right-most entry in the FROM clause of the subquery |
| 139844 | + ** must not be part of an outer join. |
| 139845 | + ** |
| 139846 | + ** (29b) The subquery itself must not be the right operand of a |
| 139847 | + ** NATURAL join or a join that as an ON or USING clause. |
| 139848 | + ** |
| 139849 | + ** These conditions are sufficient to keep an EP_OuterON from being |
| 139850 | + ** flattened into an EP_InnerON. Restrictions (3a) and (27) prevent |
| 139851 | + ** an EP_InnerON from being flattened into an EP_OuterON. |
| 139852 | + */ |
| 139853 | + if( pSubSrc->nSrc>=2 |
| 139854 | + && (pSubSrc->a[pSubSrc->nSrc-1].fg.jointype & JT_OUTER)!=0 |
| 139855 | + ){ |
| 139856 | + if( (pSubitem->fg.jointype & JT_NATURAL)!=0 |
| 139857 | + || pSubitem->fg.isUsing |
| 139858 | + || NEVER(pSubitem->u3.pOn!=0) /* ON clause already shifted into WHERE */ |
| 139859 | + || pSubitem->fg.isOn |
| 139860 | + ){ |
| 139861 | + return 0; |
| 139862 | + } |
| 139863 | + } |
| 139764 | 139864 | |
| 139765 | 139865 | /* Restriction (17): If the sub-query is a compound SELECT, then it must |
| 139766 | 139866 | ** use only the UNION ALL operator. And none of the simple select queries |
| 139767 | 139867 | ** that make up the compound SELECT are allowed to be aggregate or distinct |
| 139768 | 139868 | ** queries. |
| | @@ -140018,11 +140118,11 @@ |
| 140018 | 140118 | pSub->pOrderBy = 0; |
| 140019 | 140119 | } |
| 140020 | 140120 | pWhere = pSub->pWhere; |
| 140021 | 140121 | pSub->pWhere = 0; |
| 140022 | 140122 | if( isOuterJoin>0 ){ |
| 140023 | | - sqlite3SetJoinExpr(pWhere, iNewParent, EP_FromJoin); |
| 140123 | + sqlite3SetJoinExpr(pWhere, iNewParent, EP_OuterON); |
| 140024 | 140124 | } |
| 140025 | 140125 | if( pWhere ){ |
| 140026 | 140126 | if( pParent->pWhere ){ |
| 140027 | 140127 | pParent->pWhere = sqlite3PExpr(pParse, TK_AND, pWhere, pParent->pWhere); |
| 140028 | 140128 | }else{ |
| | @@ -140151,11 +140251,15 @@ |
| 140151 | 140251 | ** found, add it to the pConst structure. |
| 140152 | 140252 | */ |
| 140153 | 140253 | static void findConstInWhere(WhereConst *pConst, Expr *pExpr){ |
| 140154 | 140254 | Expr *pRight, *pLeft; |
| 140155 | 140255 | if( NEVER(pExpr==0) ) return; |
| 140156 | | - if( ExprHasProperty(pExpr, EP_FromJoin) ) return; |
| 140256 | + if( ExprHasProperty(pExpr, EP_OuterON|EP_InnerON) ){ |
| 140257 | + testcase( ExprHasProperty(pExpr, EP_OuterON) ); |
| 140258 | + testcase( ExprHasProperty(pExpr, EP_InnerON) ); |
| 140259 | + return; |
| 140260 | + } |
| 140157 | 140261 | if( pExpr->op==TK_AND ){ |
| 140158 | 140262 | findConstInWhere(pConst, pExpr->pRight); |
| 140159 | 140263 | findConstInWhere(pConst, pExpr->pLeft); |
| 140160 | 140264 | return; |
| 140161 | 140265 | } |
| | @@ -140187,13 +140291,13 @@ |
| 140187 | 140291 | int bIgnoreAffBlob |
| 140188 | 140292 | ){ |
| 140189 | 140293 | int i; |
| 140190 | 140294 | if( pConst->pOomFault[0] ) return WRC_Prune; |
| 140191 | 140295 | if( pExpr->op!=TK_COLUMN ) return WRC_Continue; |
| 140192 | | - if( ExprHasProperty(pExpr, EP_FixedCol|EP_FromJoin) ){ |
| 140296 | + if( ExprHasProperty(pExpr, EP_FixedCol|EP_OuterON) ){ |
| 140193 | 140297 | testcase( ExprHasProperty(pExpr, EP_FixedCol) ); |
| 140194 | | - testcase( ExprHasProperty(pExpr, EP_FromJoin) ); |
| 140298 | + testcase( ExprHasProperty(pExpr, EP_OuterON) ); |
| 140195 | 140299 | return WRC_Continue; |
| 140196 | 140300 | } |
| 140197 | 140301 | for(i=0; i<pConst->nConst; i++){ |
| 140198 | 140302 | Expr *pColumn = pConst->apExpr[i*2]; |
| 140199 | 140303 | if( pColumn==pExpr ) continue; |
| | @@ -140474,16 +140578,16 @@ |
| 140474 | 140578 | pWhere = pWhere->pLeft; |
| 140475 | 140579 | } |
| 140476 | 140580 | |
| 140477 | 140581 | #if 0 /* Legacy code. Checks now done by sqlite3ExprIsTableConstraint() */ |
| 140478 | 140582 | if( isLeftJoin |
| 140479 | | - && (ExprHasProperty(pWhere,EP_FromJoin)==0 |
| 140583 | + && (ExprHasProperty(pWhere,EP_OuterON)==0 |
| 140480 | 140584 | || pWhere->w.iJoin!=iCursor) |
| 140481 | 140585 | ){ |
| 140482 | 140586 | return 0; /* restriction (4) */ |
| 140483 | 140587 | } |
| 140484 | | - if( ExprHasProperty(pWhere,EP_FromJoin) |
| 140588 | + if( ExprHasProperty(pWhere,EP_OuterON) |
| 140485 | 140589 | && pWhere->w.iJoin!=iCursor |
| 140486 | 140590 | ){ |
| 140487 | 140591 | return 0; /* restriction (5) */ |
| 140488 | 140592 | } |
| 140489 | 140593 | #endif |
| | @@ -140492,11 +140596,11 @@ |
| 140492 | 140596 | nChng++; |
| 140493 | 140597 | pSubq->selFlags |= SF_PushDown; |
| 140494 | 140598 | while( pSubq ){ |
| 140495 | 140599 | SubstContext x; |
| 140496 | 140600 | pNew = sqlite3ExprDup(pParse->db, pWhere, 0); |
| 140497 | | - unsetJoinExpr(pNew, -1); |
| 140601 | + unsetJoinExpr(pNew, -1, 1); |
| 140498 | 140602 | x.pParse = pParse; |
| 140499 | 140603 | x.iTable = pSrc->iCursor; |
| 140500 | 140604 | x.iNewTable = pSrc->iCursor; |
| 140501 | 140605 | x.isOuterJoin = 0; |
| 140502 | 140606 | x.pEList = pSubq->pEList; |
| | @@ -141988,10 +142092,33 @@ |
| 141988 | 142092 | } |
| 141989 | 142093 | #endif |
| 141990 | 142094 | return 1; |
| 141991 | 142095 | } |
| 141992 | 142096 | #endif /* SQLITE_COUNTOFVIEW_OPTIMIZATION */ |
| 142097 | + |
| 142098 | +/* |
| 142099 | +** If any term of pSrc, or any SF_NestedFrom sub-query, is not the same |
| 142100 | +** as pSrcItem but has the same alias as p0, then return true. |
| 142101 | +** Otherwise return false. |
| 142102 | +*/ |
| 142103 | +static int sameSrcAlias(SrcItem *p0, SrcList *pSrc){ |
| 142104 | + int i; |
| 142105 | + for(i=0; i<pSrc->nSrc; i++){ |
| 142106 | + SrcItem *p1 = &pSrc->a[i]; |
| 142107 | + if( p1==p0 ) continue; |
| 142108 | + if( p0->pTab==p1->pTab && 0==sqlite3_stricmp(p0->zAlias, p1->zAlias) ){ |
| 142109 | + return 1; |
| 142110 | + } |
| 142111 | + if( p1->pSelect |
| 142112 | + && (p1->pSelect->selFlags & SF_NestedFrom)!=0 |
| 142113 | + && sameSrcAlias(p0, p1->pSelect->pSrc) |
| 142114 | + ){ |
| 142115 | + return 1; |
| 142116 | + } |
| 142117 | + } |
| 142118 | + return 0; |
| 142119 | +} |
| 141993 | 142120 | |
| 141994 | 142121 | /* |
| 141995 | 142122 | ** Generate code for the SELECT statement given in the p argument. |
| 141996 | 142123 | ** |
| 141997 | 142124 | ** The results are returned according to the SelectDest structure. |
| | @@ -142093,19 +142220,16 @@ |
| 142093 | 142220 | ** systems handle this case differently, and not all the same way, |
| 142094 | 142221 | ** which is just confusing. To avoid this, we follow PG's lead and |
| 142095 | 142222 | ** disallow it altogether. */ |
| 142096 | 142223 | if( p->selFlags & SF_UFSrcCheck ){ |
| 142097 | 142224 | SrcItem *p0 = &p->pSrc->a[0]; |
| 142098 | | - for(i=1; i<p->pSrc->nSrc; i++){ |
| 142099 | | - SrcItem *p1 = &p->pSrc->a[i]; |
| 142100 | | - if( p0->pTab==p1->pTab && 0==sqlite3_stricmp(p0->zAlias, p1->zAlias) ){ |
| 142101 | | - sqlite3ErrorMsg(pParse, |
| 142102 | | - "target object/alias may not appear in FROM clause: %s", |
| 142103 | | - p0->zAlias ? p0->zAlias : p0->pTab->zName |
| 142104 | | - ); |
| 142105 | | - goto select_end; |
| 142106 | | - } |
| 142225 | + if( sameSrcAlias(p0, p->pSrc) ){ |
| 142226 | + sqlite3ErrorMsg(pParse, |
| 142227 | + "target object/alias may not appear in FROM clause: %s", |
| 142228 | + p0->zAlias ? p0->zAlias : p0->pTab->zName |
| 142229 | + ); |
| 142230 | + goto select_end; |
| 142107 | 142231 | } |
| 142108 | 142232 | |
| 142109 | 142233 | /* Clear the SF_UFSrcCheck flag. The check has already been performed, |
| 142110 | 142234 | ** and leaving this flag set can cause errors if a compound sub-query |
| 142111 | 142235 | ** in p->pSrc is flattened into this query and this function called |
| | @@ -142156,11 +142280,12 @@ |
| 142156 | 142280 | && OptimizationEnabled(db, SQLITE_SimplifyJoin) |
| 142157 | 142281 | ){ |
| 142158 | 142282 | SELECTTRACE(0x100,pParse,p, |
| 142159 | 142283 | ("LEFT-JOIN simplifies to JOIN on term %d\n",i)); |
| 142160 | 142284 | pItem->fg.jointype &= ~(JT_LEFT|JT_OUTER); |
| 142161 | | - unsetJoinExpr(p->pWhere, pItem->iCursor); |
| 142285 | + unsetJoinExpr(p->pWhere, pItem->iCursor, |
| 142286 | + pTabList->a[0].fg.jointype & JT_LTORJ); |
| 142162 | 142287 | } |
| 142163 | 142288 | |
| 142164 | 142289 | /* No futher action if this term of the FROM clause is no a subquery */ |
| 142165 | 142290 | if( pSub==0 ) continue; |
| 142166 | 142291 | |
| | @@ -142376,11 +142501,11 @@ |
| 142376 | 142501 | zSavedAuthContext = pParse->zAuthContext; |
| 142377 | 142502 | pParse->zAuthContext = pItem->zName; |
| 142378 | 142503 | |
| 142379 | 142504 | /* Generate code to implement the subquery |
| 142380 | 142505 | ** |
| 142381 | | - ** The subquery is implemented as a co-routine all of the following are |
| 142506 | + ** The subquery is implemented as a co-routine all if the following are |
| 142382 | 142507 | ** true: |
| 142383 | 142508 | ** |
| 142384 | 142509 | ** (1) the subquery is guaranteed to be the outer loop (so that |
| 142385 | 142510 | ** it does not need to be computed more than once), and |
| 142386 | 142511 | ** (2) the subquery is not a CTE that should be materialized |
| | @@ -142434,15 +142559,15 @@ |
| 142434 | 142559 | /* Materialize the view. If the view is not correlated, generate a |
| 142435 | 142560 | ** subroutine to do the materialization so that subsequent uses of |
| 142436 | 142561 | ** the same view can reuse the materialization. */ |
| 142437 | 142562 | int topAddr; |
| 142438 | 142563 | int onceAddr = 0; |
| 142439 | | - int retAddr; |
| 142440 | 142564 | |
| 142441 | 142565 | pItem->regReturn = ++pParse->nMem; |
| 142442 | | - topAddr = sqlite3VdbeAddOp2(v, OP_Integer, 0, pItem->regReturn); |
| 142566 | + topAddr = sqlite3VdbeAddOp0(v, OP_Goto); |
| 142443 | 142567 | pItem->addrFillSub = topAddr+1; |
| 142568 | + pItem->fg.isMaterialized = 1; |
| 142444 | 142569 | if( pItem->fg.isCorrelated==0 ){ |
| 142445 | 142570 | /* If the subquery is not correlated and if we are not inside of |
| 142446 | 142571 | ** a trigger, then we only need to compute the value of the subquery |
| 142447 | 142572 | ** once. */ |
| 142448 | 142573 | onceAddr = sqlite3VdbeAddOp0(v, OP_Once); VdbeCoverage(v); |
| | @@ -142453,13 +142578,13 @@ |
| 142453 | 142578 | sqlite3SelectDestInit(&dest, SRT_EphemTab, pItem->iCursor); |
| 142454 | 142579 | ExplainQueryPlan((pParse, 1, "MATERIALIZE %!S", pItem)); |
| 142455 | 142580 | sqlite3Select(pParse, pSub, &dest); |
| 142456 | 142581 | pItem->pTab->nRowLogEst = pSub->nSelectRow; |
| 142457 | 142582 | if( onceAddr ) sqlite3VdbeJumpHere(v, onceAddr); |
| 142458 | | - retAddr = sqlite3VdbeAddOp1(v, OP_Return, pItem->regReturn); |
| 142583 | + sqlite3VdbeAddOp2(v, OP_Return, pItem->regReturn, topAddr+1); |
| 142459 | 142584 | VdbeComment((v, "end %!S", pItem)); |
| 142460 | | - sqlite3VdbeChangeP1(v, topAddr, retAddr); |
| 142585 | + sqlite3VdbeJumpHere(v, topAddr); |
| 142461 | 142586 | sqlite3ClearTempRegCache(pParse); |
| 142462 | 142587 | if( pItem->fg.isCte && pItem->fg.isCorrelated==0 ){ |
| 142463 | 142588 | CteUse *pCteUse = pItem->u2.pCteUse; |
| 142464 | 142589 | pCteUse->addrM9e = pItem->addrFillSub; |
| 142465 | 142590 | pCteUse->regRtn = pItem->regReturn; |
| | @@ -143178,11 +143303,11 @@ |
| 143178 | 143303 | } |
| 143179 | 143304 | SELECTTRACE(1,pParse,p,("WhereBegin returns\n")); |
| 143180 | 143305 | eDist = sqlite3WhereIsDistinct(pWInfo); |
| 143181 | 143306 | updateAccumulator(pParse, regAcc, pAggInfo, eDist); |
| 143182 | 143307 | if( eDist!=WHERE_DISTINCT_NOOP ){ |
| 143183 | | - struct AggInfo_func *pF = &pAggInfo->aFunc[0]; |
| 143308 | + struct AggInfo_func *pF = pAggInfo->aFunc; |
| 143184 | 143309 | if( pF ){ |
| 143185 | 143310 | fixDistinctOpenEph(pParse, eDist, pF->iDistinct, pF->iDistAddr); |
| 143186 | 143311 | } |
| 143187 | 143312 | } |
| 143188 | 143313 | |
| | @@ -143977,11 +144102,11 @@ |
| 143977 | 144102 | ** sees an UPDATE statement inside the body of a CREATE TRIGGER. |
| 143978 | 144103 | */ |
| 143979 | 144104 | SQLITE_PRIVATE TriggerStep *sqlite3TriggerUpdateStep( |
| 143980 | 144105 | Parse *pParse, /* Parser */ |
| 143981 | 144106 | Token *pTableName, /* Name of the table to be updated */ |
| 143982 | | - SrcList *pFrom, |
| 144107 | + SrcList *pFrom, /* FROM clause for an UPDATE-FROM, or NULL */ |
| 143983 | 144108 | ExprList *pEList, /* The SET clause: list of column and new values */ |
| 143984 | 144109 | Expr *pWhere, /* The WHERE clause */ |
| 143985 | 144110 | u8 orconf, /* The conflict algorithm. (OE_Abort, OE_Ignore, etc) */ |
| 143986 | 144111 | const char *zStart, /* Start of SQL text */ |
| 143987 | 144112 | const char *zEnd /* End of SQL text */ |
| | @@ -144313,10 +144438,18 @@ |
| 144313 | 144438 | if( pSchema!=db->aDb[1].pSchema ){ |
| 144314 | 144439 | pSrc->a[0].pSchema = pSchema; |
| 144315 | 144440 | } |
| 144316 | 144441 | if( pStep->pFrom ){ |
| 144317 | 144442 | SrcList *pDup = sqlite3SrcListDup(db, pStep->pFrom, 0); |
| 144443 | + if( pDup && pDup->nSrc>1 && !IN_RENAME_OBJECT ){ |
| 144444 | + Select *pSubquery; |
| 144445 | + Token as; |
| 144446 | + pSubquery = sqlite3SelectNew(pParse,0,pDup,0,0,0,0,SF_NestedFrom,0); |
| 144447 | + as.n = 0; |
| 144448 | + as.z = 0; |
| 144449 | + pDup = sqlite3SrcListAppendFromTerm(pParse,0,0,0,&as,pSubquery,0); |
| 144450 | + } |
| 144318 | 144451 | pSrc = sqlite3SrcListAppendList(pParse, pSrc, pDup); |
| 144319 | 144452 | } |
| 144320 | 144453 | }else{ |
| 144321 | 144454 | sqlite3DbFree(db, zName); |
| 144322 | 144455 | } |
| | @@ -145944,11 +146077,11 @@ |
| 145944 | 146077 | if( pPk ){ |
| 145945 | 146078 | sqlite3VdbeAddOp4Int(v, OP_NotFound,iDataCur,labelContinue,regKey,nKey); |
| 145946 | 146079 | }else{ |
| 145947 | 146080 | sqlite3VdbeAddOp3(v, OP_NotExists, iDataCur, labelContinue,regOldRowid); |
| 145948 | 146081 | } |
| 145949 | | - VdbeCoverageNeverTaken(v); |
| 146082 | + VdbeCoverage(v); |
| 145950 | 146083 | } |
| 145951 | 146084 | |
| 145952 | 146085 | /* Do FK constraint checks. */ |
| 145953 | 146086 | if( hasFK ){ |
| 145954 | 146087 | sqlite3FkCheck(pParse, pTab, regOldRowid, 0, aXRef, chngKey); |
| | @@ -148402,11 +148535,11 @@ |
| 148402 | 148535 | ** This object is a header on a block of allocated memory that will be |
| 148403 | 148536 | ** automatically freed when its WInfo oject is destructed. |
| 148404 | 148537 | */ |
| 148405 | 148538 | struct WhereMemBlock { |
| 148406 | 148539 | WhereMemBlock *pNext; /* Next block in the chain */ |
| 148407 | | - u8 sz; /* Bytes of space */ |
| 148540 | + u64 sz; /* Bytes of space */ |
| 148408 | 148541 | }; |
| 148409 | 148542 | |
| 148410 | 148543 | /* |
| 148411 | 148544 | ** Extra information attached to a WhereLevel that is a RIGHT JOIN. |
| 148412 | 148545 | */ |
| | @@ -148973,12 +149106,13 @@ |
| 148973 | 149106 | #define WO_ISNULL 0x0100 |
| 148974 | 149107 | #define WO_OR 0x0200 /* Two or more OR-connected terms */ |
| 148975 | 149108 | #define WO_AND 0x0400 /* Two or more AND-connected terms */ |
| 148976 | 149109 | #define WO_EQUIV 0x0800 /* Of the form A==B, both columns */ |
| 148977 | 149110 | #define WO_NOOP 0x1000 /* This term does not restrict search space */ |
| 149111 | +#define WO_ROWVAL 0x2000 /* A row-value term */ |
| 148978 | 149112 | |
| 148979 | | -#define WO_ALL 0x1fff /* Mask of all possible WO_* values */ |
| 149113 | +#define WO_ALL 0x3fff /* Mask of all possible WO_* values */ |
| 148980 | 149114 | #define WO_SINGLE 0x01ff /* Mask of all non-compound WO_* values */ |
| 148981 | 149115 | |
| 148982 | 149116 | /* |
| 148983 | 149117 | ** These are definitions of bits in the WhereLoop.wsFlags field. |
| 148984 | 149118 | ** The particular combination of bits in each WhereLoop help to |
| | @@ -149344,11 +149478,11 @@ |
| 149344 | 149478 | */ |
| 149345 | 149479 | static void disableTerm(WhereLevel *pLevel, WhereTerm *pTerm){ |
| 149346 | 149480 | int nLoop = 0; |
| 149347 | 149481 | assert( pTerm!=0 ); |
| 149348 | 149482 | while( (pTerm->wtFlags & TERM_CODED)==0 |
| 149349 | | - && (pLevel->iLeftJoin==0 || ExprHasProperty(pTerm->pExpr, EP_FromJoin)) |
| 149483 | + && (pLevel->iLeftJoin==0 || ExprHasProperty(pTerm->pExpr, EP_OuterON)) |
| 149350 | 149484 | && (pLevel->notReady & pTerm->prereqAll)==0 |
| 149351 | 149485 | ){ |
| 149352 | 149486 | if( nLoop && (pTerm->wtFlags & TERM_LIKE)!=0 ){ |
| 149353 | 149487 | pTerm->wtFlags |= TERM_LIKECOND; |
| 149354 | 149488 | }else{ |
| | @@ -149617,12 +149751,11 @@ |
| 149617 | 149751 | pExpr->iTable = iTab; |
| 149618 | 149752 | } |
| 149619 | 149753 | sqlite3ExprDelete(db, pX); |
| 149620 | 149754 | }else{ |
| 149621 | 149755 | aiMap = (int*)sqlite3DbMallocZero(pParse->db, sizeof(int)*nEq); |
| 149622 | | - eType = sqlite3FindInIndex(pParse, pX, IN_INDEX_LOOP|IN_INDEX_REUSE_CUR, 0, aiMap,&iTab); |
| 149623 | | - iTab = pExpr->iTable; |
| 149756 | + eType = sqlite3FindInIndex(pParse, pX, IN_INDEX_LOOP, 0, aiMap, &iTab); |
| 149624 | 149757 | } |
| 149625 | 149758 | pX = pExpr; |
| 149626 | 149759 | } |
| 149627 | 149760 | |
| 149628 | 149761 | if( eType==IN_INDEX_INDEX_DESC ){ |
| | @@ -150066,20 +150199,20 @@ |
| 150066 | 150199 | ** |
| 150067 | 150200 | ** are also excluded. See codeCursorHintIsOrFunction() for details. |
| 150068 | 150201 | */ |
| 150069 | 150202 | if( pTabItem->fg.jointype & JT_LEFT ){ |
| 150070 | 150203 | Expr *pExpr = pTerm->pExpr; |
| 150071 | | - if( !ExprHasProperty(pExpr, EP_FromJoin) |
| 150204 | + if( !ExprHasProperty(pExpr, EP_OuterON) |
| 150072 | 150205 | || pExpr->w.iJoin!=pTabItem->iCursor |
| 150073 | 150206 | ){ |
| 150074 | 150207 | sWalker.eCode = 0; |
| 150075 | 150208 | sWalker.xExprCallback = codeCursorHintIsOrFunction; |
| 150076 | 150209 | sqlite3WalkExpr(&sWalker, pTerm->pExpr); |
| 150077 | 150210 | if( sWalker.eCode ) continue; |
| 150078 | 150211 | } |
| 150079 | 150212 | }else{ |
| 150080 | | - if( ExprHasProperty(pTerm->pExpr, EP_FromJoin) ) continue; |
| 150213 | + if( ExprHasProperty(pTerm->pExpr, EP_OuterON) ) continue; |
| 150081 | 150214 | } |
| 150082 | 150215 | |
| 150083 | 150216 | /* All terms in pWLoop->aLTerm[] except pEndRange are used to initialize |
| 150084 | 150217 | ** the cursor. These terms are not needed as hints for a pure range |
| 150085 | 150218 | ** scan (that has no == terms) so omit them. */ |
| | @@ -151406,11 +151539,11 @@ |
| 151406 | 151539 | WhereInfo *pSubWInfo; /* Info for single OR-term scan */ |
| 151407 | 151540 | Expr *pOrExpr = pOrTerm->pExpr; /* Current OR clause term */ |
| 151408 | 151541 | Expr *pDelete; /* Local copy of OR clause term */ |
| 151409 | 151542 | int jmp1 = 0; /* Address of jump operation */ |
| 151410 | 151543 | testcase( (pTabItem[0].fg.jointype & JT_LEFT)!=0 |
| 151411 | | - && !ExprHasProperty(pOrExpr, EP_FromJoin) |
| 151544 | + && !ExprHasProperty(pOrExpr, EP_OuterON) |
| 151412 | 151545 | ); /* See TH3 vtab25.400 and ticket 614b25314c766238 */ |
| 151413 | 151546 | pDelete = pOrExpr = sqlite3ExprDup(db, pOrExpr, 0); |
| 151414 | 151547 | if( db->mallocFailed ){ |
| 151415 | 151548 | sqlite3ExprDelete(db, pDelete); |
| 151416 | 151549 | continue; |
| | @@ -151614,16 +151747,26 @@ |
| 151614 | 151747 | pWInfo->untestedTerms = 1; |
| 151615 | 151748 | continue; |
| 151616 | 151749 | } |
| 151617 | 151750 | pE = pTerm->pExpr; |
| 151618 | 151751 | assert( pE!=0 ); |
| 151619 | | - if( (pTabItem->fg.jointype & (JT_LEFT|JT_LTORJ)) |
| 151620 | | - && !ExprHasProperty(pE,EP_FromJoin|EP_InnerJoin) |
| 151621 | | - ){ |
| 151622 | | - continue; |
| 151752 | + if( pTabItem->fg.jointype & (JT_LEFT|JT_LTORJ|JT_RIGHT) ){ |
| 151753 | + if( !ExprHasProperty(pE,EP_OuterON|EP_InnerON) ){ |
| 151754 | + /* Defer processing WHERE clause constraints until after outer |
| 151755 | + ** join processing. tag-20220513a */ |
| 151756 | + continue; |
| 151757 | + }else if( (pTabItem->fg.jointype & JT_LEFT)==JT_LEFT |
| 151758 | + && !ExprHasProperty(pE,EP_OuterON) ){ |
| 151759 | + continue; |
| 151760 | + }else{ |
| 151761 | + Bitmask m = sqlite3WhereGetMask(&pWInfo->sMaskSet, pE->w.iJoin); |
| 151762 | + if( m & pLevel->notReady ){ |
| 151763 | + /* An ON clause that is not ripe */ |
| 151764 | + continue; |
| 151765 | + } |
| 151766 | + } |
| 151623 | 151767 | } |
| 151624 | | - |
| 151625 | 151768 | if( iLoop==1 && !sqlite3ExprCoveredByIndex(pE, pLevel->iTabCur, pIdx) ){ |
| 151626 | 151769 | iNext = 2; |
| 151627 | 151770 | continue; |
| 151628 | 151771 | } |
| 151629 | 151772 | if( iLoop<3 && (pTerm->wtFlags & TERM_VARSELECT) ){ |
| | @@ -151678,19 +151821,19 @@ |
| 151678 | 151821 | WhereTerm *pAlt; |
| 151679 | 151822 | if( pTerm->wtFlags & (TERM_VIRTUAL|TERM_CODED) ) continue; |
| 151680 | 151823 | if( (pTerm->eOperator & (WO_EQ|WO_IS))==0 ) continue; |
| 151681 | 151824 | if( (pTerm->eOperator & WO_EQUIV)==0 ) continue; |
| 151682 | 151825 | if( pTerm->leftCursor!=iCur ) continue; |
| 151683 | | - if( pTabItem->fg.jointype & (JT_LEFT|JT_LTORJ) ) continue; |
| 151826 | + if( pTabItem->fg.jointype & (JT_LEFT|JT_LTORJ|JT_RIGHT) ) continue; |
| 151684 | 151827 | pE = pTerm->pExpr; |
| 151685 | 151828 | #ifdef WHERETRACE_ENABLED /* 0x800 */ |
| 151686 | 151829 | if( sqlite3WhereTrace & 0x800 ){ |
| 151687 | 151830 | sqlite3DebugPrintf("Coding transitive constraint:\n"); |
| 151688 | 151831 | sqlite3WhereTermPrint(pTerm, pWC->nTerm-j); |
| 151689 | 151832 | } |
| 151690 | 151833 | #endif |
| 151691 | | - assert( !ExprHasProperty(pE, EP_FromJoin) ); |
| 151834 | + assert( !ExprHasProperty(pE, EP_OuterON) ); |
| 151692 | 151835 | assert( (pTerm->prereqRight & pLevel->notReady)!=0 ); |
| 151693 | 151836 | assert( (pTerm->eOperator & (WO_OR|WO_AND))==0 ); |
| 151694 | 151837 | pAlt = sqlite3WhereFindTerm(pWC, iCur, pTerm->u.x.leftColumn, notReady, |
| 151695 | 151838 | WO_EQ|WO_IN|WO_IS, 0); |
| 151696 | 151839 | if( pAlt==0 ) continue; |
| | @@ -151757,22 +151900,12 @@ |
| 151757 | 151900 | */ |
| 151758 | 151901 | if( pLevel->iLeftJoin ){ |
| 151759 | 151902 | pLevel->addrFirst = sqlite3VdbeCurrentAddr(v); |
| 151760 | 151903 | sqlite3VdbeAddOp2(v, OP_Integer, 1, pLevel->iLeftJoin); |
| 151761 | 151904 | VdbeComment((v, "record LEFT JOIN hit")); |
| 151762 | | - for(pTerm=pWC->a, j=0; j<pWC->nBase; j++, pTerm++){ |
| 151763 | | - testcase( pTerm->wtFlags & TERM_VIRTUAL ); |
| 151764 | | - testcase( pTerm->wtFlags & TERM_CODED ); |
| 151765 | | - if( pTerm->wtFlags & (TERM_VIRTUAL|TERM_CODED) ) continue; |
| 151766 | | - if( (pTerm->prereqAll & pLevel->notReady)!=0 ){ |
| 151767 | | - assert( pWInfo->untestedTerms ); |
| 151768 | | - continue; |
| 151769 | | - } |
| 151770 | | - if( pTabItem->fg.jointype & JT_LTORJ ) continue; |
| 151771 | | - assert( pTerm->pExpr ); |
| 151772 | | - sqlite3ExprIfFalse(pParse, pTerm->pExpr, addrCont, SQLITE_JUMPIFNULL); |
| 151773 | | - pTerm->wtFlags |= TERM_CODED; |
| 151905 | + if( pLevel->pRJ==0 ){ |
| 151906 | + goto code_outer_join_constraints; /* WHERE clause constraints */ |
| 151774 | 151907 | } |
| 151775 | 151908 | } |
| 151776 | 151909 | |
| 151777 | 151910 | if( pLevel->pRJ ){ |
| 151778 | 151911 | /* Create a subroutine used to process all interior loops and code |
| | @@ -151784,10 +151917,30 @@ |
| 151784 | 151917 | WhereRightJoin *pRJ = pLevel->pRJ; |
| 151785 | 151918 | sqlite3VdbeAddOp2(v, OP_BeginSubrtn, 0, pRJ->regReturn); |
| 151786 | 151919 | pRJ->addrSubrtn = sqlite3VdbeCurrentAddr(v); |
| 151787 | 151920 | assert( pParse->withinRJSubrtn < 255 ); |
| 151788 | 151921 | pParse->withinRJSubrtn++; |
| 151922 | + |
| 151923 | + /* WHERE clause constraints must be deferred until after outer join |
| 151924 | + ** row elimination has completed, since WHERE clause constraints apply |
| 151925 | + ** to the results of the OUTER JOIN. The following loop generates the |
| 151926 | + ** appropriate WHERE clause constraint checks. tag-20220513a. |
| 151927 | + */ |
| 151928 | + code_outer_join_constraints: |
| 151929 | + for(pTerm=pWC->a, j=0; j<pWC->nBase; j++, pTerm++){ |
| 151930 | + testcase( pTerm->wtFlags & TERM_VIRTUAL ); |
| 151931 | + testcase( pTerm->wtFlags & TERM_CODED ); |
| 151932 | + if( pTerm->wtFlags & (TERM_VIRTUAL|TERM_CODED) ) continue; |
| 151933 | + if( (pTerm->prereqAll & pLevel->notReady)!=0 ){ |
| 151934 | + assert( pWInfo->untestedTerms ); |
| 151935 | + continue; |
| 151936 | + } |
| 151937 | + if( pTabItem->fg.jointype & JT_LTORJ ) continue; |
| 151938 | + assert( pTerm->pExpr ); |
| 151939 | + sqlite3ExprIfFalse(pParse, pTerm->pExpr, addrCont, SQLITE_JUMPIFNULL); |
| 151940 | + pTerm->wtFlags |= TERM_CODED; |
| 151941 | + } |
| 151789 | 151942 | } |
| 151790 | 151943 | |
| 151791 | 151944 | #if WHERETRACE_ENABLED /* 0x20800 */ |
| 151792 | 151945 | if( sqlite3WhereTrace & 0x20000 ){ |
| 151793 | 151946 | sqlite3DebugPrintf("All WHERE-clause terms after coding level %d:\n", |
| | @@ -151837,13 +151990,17 @@ |
| 151837 | 151990 | } |
| 151838 | 151991 | if( (pTabItem->fg.jointype & JT_LTORJ)==0 ){ |
| 151839 | 151992 | mAll |= pLoop->maskSelf; |
| 151840 | 151993 | for(k=0; k<pWC->nTerm; k++){ |
| 151841 | 151994 | WhereTerm *pTerm = &pWC->a[k]; |
| 151842 | | - if( pTerm->wtFlags & TERM_VIRTUAL ) break; |
| 151995 | + if( (pTerm->wtFlags & (TERM_VIRTUAL|TERM_SLICE))!=0 |
| 151996 | + && pTerm->eOperator!=WO_ROWVAL |
| 151997 | + ){ |
| 151998 | + break; |
| 151999 | + } |
| 151843 | 152000 | if( pTerm->prereqAll & ~mAll ) continue; |
| 151844 | | - if( ExprHasProperty(pTerm->pExpr, EP_FromJoin|EP_InnerJoin) ) continue; |
| 152001 | + if( ExprHasProperty(pTerm->pExpr, EP_OuterON|EP_InnerON) ) continue; |
| 151845 | 152002 | pSubWhere = sqlite3ExprAnd(pParse, pSubWhere, |
| 151846 | 152003 | sqlite3ExprDup(pParse->db, pTerm->pExpr, 0)); |
| 151847 | 152004 | } |
| 151848 | 152005 | } |
| 151849 | 152006 | sFrom.nSrc = 1; |
| | @@ -152351,12 +152508,12 @@ |
| 152351 | 152508 | /* |
| 152352 | 152509 | ** If the pBase expression originated in the ON or USING clause of |
| 152353 | 152510 | ** a join, then transfer the appropriate markings over to derived. |
| 152354 | 152511 | */ |
| 152355 | 152512 | static void transferJoinMarkings(Expr *pDerived, Expr *pBase){ |
| 152356 | | - if( pDerived ){ |
| 152357 | | - pDerived->flags |= pBase->flags & EP_FromJoin; |
| 152513 | + if( pDerived && ExprHasProperty(pBase, EP_OuterON|EP_InnerON) ){ |
| 152514 | + pDerived->flags |= pBase->flags & (EP_OuterON|EP_InnerON); |
| 152358 | 152515 | pDerived->w.iJoin = pBase->w.iJoin; |
| 152359 | 152516 | } |
| 152360 | 152517 | } |
| 152361 | 152518 | |
| 152362 | 152519 | /* |
| | @@ -152807,11 +152964,11 @@ |
| 152807 | 152964 | static int termIsEquivalence(Parse *pParse, Expr *pExpr){ |
| 152808 | 152965 | char aff1, aff2; |
| 152809 | 152966 | CollSeq *pColl; |
| 152810 | 152967 | if( !OptimizationEnabled(pParse->db, SQLITE_Transitive) ) return 0; |
| 152811 | 152968 | if( pExpr->op!=TK_EQ && pExpr->op!=TK_IS ) return 0; |
| 152812 | | - if( ExprHasProperty(pExpr, EP_FromJoin) ) return 0; |
| 152969 | + if( ExprHasProperty(pExpr, EP_OuterON) ) return 0; |
| 152813 | 152970 | aff1 = sqlite3ExprAffinity(pExpr->pLeft); |
| 152814 | 152971 | aff2 = sqlite3ExprAffinity(pExpr->pRight); |
| 152815 | 152972 | if( aff1!=aff2 |
| 152816 | 152973 | && (!sqlite3IsNumericAffinity(aff1) || !sqlite3IsNumericAffinity(aff2)) |
| 152817 | 152974 | ){ |
| | @@ -152995,22 +153152,30 @@ |
| 152995 | 153152 | |
| 152996 | 153153 | #ifdef SQLITE_DEBUG |
| 152997 | 153154 | if( prereqAll!=sqlite3WhereExprUsageNN(pMaskSet, pExpr) ){ |
| 152998 | 153155 | printf("\n*** Incorrect prereqAll computed for:\n"); |
| 152999 | 153156 | sqlite3TreeViewExpr(0,pExpr,0); |
| 153000 | | - abort(); |
| 153157 | + assert( 0 ); |
| 153001 | 153158 | } |
| 153002 | 153159 | #endif |
| 153003 | 153160 | |
| 153004 | | - if( ExprHasProperty(pExpr, EP_FromJoin) ){ |
| 153161 | + if( ExprHasProperty(pExpr, EP_OuterON|EP_InnerON) ){ |
| 153005 | 153162 | Bitmask x = sqlite3WhereGetMask(pMaskSet, pExpr->w.iJoin); |
| 153006 | | - prereqAll |= x; |
| 153007 | | - extraRight = x-1; /* ON clause terms may not be used with an index |
| 153008 | | - ** on left table of a LEFT JOIN. Ticket #3015 */ |
| 153009 | | - if( (prereqAll>>1)>=x ){ |
| 153010 | | - sqlite3ErrorMsg(pParse, "ON clause references tables to its right"); |
| 153011 | | - return; |
| 153163 | + if( ExprHasProperty(pExpr, EP_OuterON) ){ |
| 153164 | + prereqAll |= x; |
| 153165 | + extraRight = x-1; /* ON clause terms may not be used with an index |
| 153166 | + ** on left table of a LEFT JOIN. Ticket #3015 */ |
| 153167 | + if( (prereqAll>>1)>=x ){ |
| 153168 | + sqlite3ErrorMsg(pParse, "ON clause references tables to its right"); |
| 153169 | + return; |
| 153170 | + } |
| 153171 | + }else if( (prereqAll>>1)>=x ){ |
| 153172 | + /* The ON clause of an INNER JOIN references a table to its right. |
| 153173 | + ** Most other SQL database engines raise an error. But all versions |
| 153174 | + ** of SQLite going back to 3.0.0 have just put the ON clause constraint |
| 153175 | + ** into the WHERE clause and carried on. */ |
| 153176 | + ExprClearProperty(pExpr, EP_InnerON); |
| 153012 | 153177 | } |
| 153013 | 153178 | } |
| 153014 | 153179 | pTerm->prereqAll = prereqAll; |
| 153015 | 153180 | pTerm->leftCursor = -1; |
| 153016 | 153181 | pTerm->iParent = -1; |
| | @@ -153074,11 +153239,11 @@ |
| 153074 | 153239 | pNew->prereqRight = prereqLeft | extraRight; |
| 153075 | 153240 | pNew->prereqAll = prereqAll; |
| 153076 | 153241 | pNew->eOperator = (operatorMask(pDup->op) + eExtraOp) & opMask; |
| 153077 | 153242 | }else |
| 153078 | 153243 | if( op==TK_ISNULL |
| 153079 | | - && !ExprHasProperty(pExpr,EP_FromJoin) |
| 153244 | + && !ExprHasProperty(pExpr,EP_OuterON) |
| 153080 | 153245 | && 0==sqlite3ExprCanBeNull(pLeft) |
| 153081 | 153246 | ){ |
| 153082 | 153247 | assert( !ExprHasProperty(pExpr, EP_IntValue) ); |
| 153083 | 153248 | pExpr->op = TK_TRUEFALSE; |
| 153084 | 153249 | pExpr->u.zToken = "false"; |
| | @@ -153145,11 +153310,11 @@ |
| 153145 | 153310 | ** The virtual term must be tagged with TERM_VNULL. |
| 153146 | 153311 | */ |
| 153147 | 153312 | else if( pExpr->op==TK_NOTNULL ){ |
| 153148 | 153313 | if( pExpr->pLeft->op==TK_COLUMN |
| 153149 | 153314 | && pExpr->pLeft->iColumn>=0 |
| 153150 | | - && !ExprHasProperty(pExpr, EP_FromJoin) |
| 153315 | + && !ExprHasProperty(pExpr, EP_OuterON) |
| 153151 | 153316 | ){ |
| 153152 | 153317 | Expr *pNewExpr; |
| 153153 | 153318 | Expr *pLeft = pExpr->pLeft; |
| 153154 | 153319 | int idxNew; |
| 153155 | 153320 | WhereTerm *pNewTerm; |
| | @@ -153293,11 +153458,11 @@ |
| 153293 | 153458 | idxNew = whereClauseInsert(pWC, pNew, TERM_DYNAMIC|TERM_SLICE); |
| 153294 | 153459 | exprAnalyze(pSrc, pWC, idxNew); |
| 153295 | 153460 | } |
| 153296 | 153461 | pTerm = &pWC->a[idxTerm]; |
| 153297 | 153462 | pTerm->wtFlags |= TERM_CODED|TERM_VIRTUAL; /* Disable the original */ |
| 153298 | | - pTerm->eOperator = 0; |
| 153463 | + pTerm->eOperator = WO_ROWVAL; |
| 153299 | 153464 | } |
| 153300 | 153465 | |
| 153301 | 153466 | /* If there is a vector IN term - e.g. "(a, b) IN (SELECT ...)" - create |
| 153302 | 153467 | ** a virtual term for each vector component. The expression object |
| 153303 | 153468 | ** used by each such virtual term is pExpr (the full vector IN(...) |
| | @@ -153349,12 +153514,12 @@ |
| 153349 | 153514 | prereqColumn = sqlite3WhereExprUsage(pMaskSet, pLeft); |
| 153350 | 153515 | if( (prereqExpr & prereqColumn)==0 ){ |
| 153351 | 153516 | Expr *pNewExpr; |
| 153352 | 153517 | pNewExpr = sqlite3PExpr(pParse, TK_MATCH, |
| 153353 | 153518 | 0, sqlite3ExprDup(db, pRight, 0)); |
| 153354 | | - if( ExprHasProperty(pExpr, EP_FromJoin) && pNewExpr ){ |
| 153355 | | - ExprSetProperty(pNewExpr, EP_FromJoin); |
| 153519 | + if( ExprHasProperty(pExpr, EP_OuterON) && pNewExpr ){ |
| 153520 | + ExprSetProperty(pNewExpr, EP_OuterON); |
| 153356 | 153521 | pNewExpr->w.iJoin = pExpr->w.iJoin; |
| 153357 | 153522 | } |
| 153358 | 153523 | idxNew = whereClauseInsert(pWC, pNewExpr, TERM_VIRTUAL|TERM_DYNAMIC); |
| 153359 | 153524 | testcase( idxNew==0 ); |
| 153360 | 153525 | pNewTerm = &pWC->a[idxNew]; |
| | @@ -153494,11 +153659,11 @@ |
| 153494 | 153659 | for(ii=0; ii<pWC->nTerm; ii++){ |
| 153495 | 153660 | if( pWC->a[ii].wtFlags & TERM_CODED ){ |
| 153496 | 153661 | /* This term is a vector operation that has been decomposed into |
| 153497 | 153662 | ** other, subsequent terms. It can be ignored. See tag-20220128a */ |
| 153498 | 153663 | assert( pWC->a[ii].wtFlags & TERM_VIRTUAL ); |
| 153499 | | - assert( pWC->a[ii].eOperator==0 ); |
| 153664 | + assert( pWC->a[ii].eOperator==WO_ROWVAL ); |
| 153500 | 153665 | continue; |
| 153501 | 153666 | } |
| 153502 | 153667 | if( pWC->a[ii].leftCursor!=iCsr ) return; |
| 153503 | 153668 | } |
| 153504 | 153669 | |
| | @@ -153717,13 +153882,13 @@ |
| 153717 | 153882 | pItem->colUsed |= sqlite3ExprColUsed(pColRef); |
| 153718 | 153883 | pRhs = sqlite3PExpr(pParse, TK_UPLUS, |
| 153719 | 153884 | sqlite3ExprDup(pParse->db, pArgs->a[j].pExpr, 0), 0); |
| 153720 | 153885 | pTerm = sqlite3PExpr(pParse, TK_EQ, pColRef, pRhs); |
| 153721 | 153886 | if( pItem->fg.jointype & (JT_LEFT|JT_LTORJ) ){ |
| 153722 | | - joinType = EP_FromJoin; |
| 153887 | + joinType = EP_OuterON; |
| 153723 | 153888 | }else{ |
| 153724 | | - joinType = EP_InnerJoin; |
| 153889 | + joinType = EP_InnerON; |
| 153725 | 153890 | } |
| 153726 | 153891 | sqlite3SetJoinExpr(pTerm, pItem->iCursor, joinType); |
| 153727 | 153892 | whereClauseInsert(pWC, pTerm, TERM_DYNAMIC); |
| 153728 | 153893 | } |
| 153729 | 153894 | } |
| | @@ -154060,11 +154225,11 @@ |
| 154060 | 154225 | if( pTerm->leftCursor==iCur |
| 154061 | 154226 | && pTerm->u.x.leftColumn==iColumn |
| 154062 | 154227 | && (iColumn!=XN_EXPR |
| 154063 | 154228 | || sqlite3ExprCompareSkip(pTerm->pExpr->pLeft, |
| 154064 | 154229 | pScan->pIdxExpr,iCur)==0) |
| 154065 | | - && (pScan->iEquiv<=1 || !ExprHasProperty(pTerm->pExpr, EP_FromJoin)) |
| 154230 | + && (pScan->iEquiv<=1 || !ExprHasProperty(pTerm->pExpr, EP_OuterON)) |
| 154066 | 154231 | ){ |
| 154067 | 154232 | if( (pTerm->eOperator & WO_EQUIV)!=0 |
| 154068 | 154233 | && pScan->nEquiv<ArraySize(pScan->aiCur) |
| 154069 | 154234 | && (pX = whereRightSubexprIsColumn(pTerm->pExpr))!=0 |
| 154070 | 154235 | ){ |
| | @@ -154412,10 +154577,11 @@ |
| 154412 | 154577 | if( pOp->opcode==OP_Column ){ |
| 154413 | 154578 | pOp->opcode = OP_Copy; |
| 154414 | 154579 | pOp->p1 = pOp->p2 + iRegister; |
| 154415 | 154580 | pOp->p2 = pOp->p3; |
| 154416 | 154581 | pOp->p3 = 0; |
| 154582 | + pOp->p5 = 2; /* Cause the MEM_Subtype flag to be cleared */ |
| 154417 | 154583 | }else if( pOp->opcode==OP_Rowid ){ |
| 154418 | 154584 | pOp->opcode = OP_Sequence; |
| 154419 | 154585 | pOp->p1 = iAutoidxCur; |
| 154420 | 154586 | #ifdef SQLITE_ALLOW_ROWID_IN_VIEW |
| 154421 | 154587 | if( iAutoidxCur==0 ){ |
| | @@ -154486,18 +154652,21 @@ |
| 154486 | 154652 | const Bitmask notReady /* Tables in outer loops of the join */ |
| 154487 | 154653 | ){ |
| 154488 | 154654 | char aff; |
| 154489 | 154655 | if( pTerm->leftCursor!=pSrc->iCursor ) return 0; |
| 154490 | 154656 | if( (pTerm->eOperator & (WO_EQ|WO_IS))==0 ) return 0; |
| 154491 | | - if( (pSrc->fg.jointype & (JT_LEFT|JT_LTORJ))!=0 |
| 154492 | | - && !ExprHasProperty(pTerm->pExpr, EP_FromJoin) |
| 154493 | | - && (pTerm->eOperator & WO_IS) |
| 154494 | | - ){ |
| 154495 | | - /* Cannot use an IS term from the WHERE clause as an index driver for |
| 154496 | | - ** the RHS of a LEFT JOIN or for the LHS of a RIGHT JOIN. Such a term |
| 154497 | | - ** can only be used if it is from the ON clause. */ |
| 154498 | | - return 0; |
| 154657 | + assert( (pSrc->fg.jointype & JT_RIGHT)==0 ); |
| 154658 | + if( (pSrc->fg.jointype & (JT_LEFT|JT_LTORJ|JT_RIGHT))!=0 ){ |
| 154659 | + testcase( (pSrc->fg.jointype & (JT_LEFT|JT_LTORJ|JT_RIGHT))==JT_LEFT ); |
| 154660 | + testcase( (pSrc->fg.jointype & (JT_LEFT|JT_LTORJ|JT_RIGHT))==JT_LTORJ ); |
| 154661 | + testcase( ExprHasProperty(pTerm->pExpr, EP_OuterON) ) |
| 154662 | + testcase( ExprHasProperty(pTerm->pExpr, EP_InnerON) ); |
| 154663 | + if( !ExprHasProperty(pTerm->pExpr, EP_OuterON|EP_InnerON) |
| 154664 | + || pTerm->pExpr->w.iJoin != pSrc->iCursor |
| 154665 | + ){ |
| 154666 | + return 0; /* See tag-20191211-001 */ |
| 154667 | + } |
| 154499 | 154668 | } |
| 154500 | 154669 | if( (pTerm->prereqRight & notReady)!=0 ) return 0; |
| 154501 | 154670 | assert( (pTerm->eOperator & (WO_OR|WO_AND))==0 ); |
| 154502 | 154671 | if( pTerm->u.x.leftColumn<0 ) return 0; |
| 154503 | 154672 | aff = pSrc->pTab->aCol[pTerm->u.x.leftColumn].affinity; |
| | @@ -154907,17 +155076,24 @@ |
| 154907 | 155076 | assert( (pTerm->eOperator & (WO_OR|WO_AND))==0 ); |
| 154908 | 155077 | assert( pTerm->u.x.leftColumn>=XN_ROWID ); |
| 154909 | 155078 | assert( pTerm->u.x.leftColumn<pTab->nCol ); |
| 154910 | 155079 | |
| 154911 | 155080 | /* tag-20191211-002: WHERE-clause constraints are not useful to the |
| 154912 | | - ** right-hand table of a LEFT JOIN nor to the left-hand table of a |
| 155081 | + ** right-hand table of a LEFT JOIN nor to the either table of a |
| 154913 | 155082 | ** RIGHT JOIN. See tag-20191211-001 for the |
| 154914 | 155083 | ** equivalent restriction for ordinary tables. */ |
| 154915 | | - if( (pSrc->fg.jointype & (JT_LEFT|JT_LTORJ))!=0 |
| 154916 | | - && !ExprHasProperty(pTerm->pExpr, EP_FromJoin) |
| 154917 | | - ){ |
| 154918 | | - continue; |
| 155084 | + if( (pSrc->fg.jointype & (JT_LEFT|JT_LTORJ|JT_RIGHT))!=0 ){ |
| 155085 | + testcase( (pSrc->fg.jointype & (JT_LEFT|JT_LTORJ|JT_RIGHT))==JT_LEFT ); |
| 155086 | + testcase( (pSrc->fg.jointype & (JT_LEFT|JT_LTORJ|JT_RIGHT))==JT_RIGHT ); |
| 155087 | + testcase( (pSrc->fg.jointype & (JT_LEFT|JT_LTORJ|JT_RIGHT))==JT_LTORJ ); |
| 155088 | + testcase( ExprHasProperty(pTerm->pExpr, EP_OuterON) ); |
| 155089 | + testcase( ExprHasProperty(pTerm->pExpr, EP_InnerON) ); |
| 155090 | + if( !ExprHasProperty(pTerm->pExpr, EP_OuterON|EP_InnerON) |
| 155091 | + || pTerm->pExpr->w.iJoin != pSrc->iCursor |
| 155092 | + ){ |
| 155093 | + continue; |
| 155094 | + } |
| 154919 | 155095 | } |
| 154920 | 155096 | nTerm++; |
| 154921 | 155097 | pTerm->wtFlags |= TERM_OK; |
| 154922 | 155098 | } |
| 154923 | 155099 | |
| | @@ -155789,11 +155965,11 @@ |
| 155789 | 155965 | char zType[8]; |
| 155790 | 155966 | char zLeft[50]; |
| 155791 | 155967 | memcpy(zType, "....", 5); |
| 155792 | 155968 | if( pTerm->wtFlags & TERM_VIRTUAL ) zType[0] = 'V'; |
| 155793 | 155969 | if( pTerm->eOperator & WO_EQUIV ) zType[1] = 'E'; |
| 155794 | | - if( ExprHasProperty(pTerm->pExpr, EP_FromJoin) ) zType[2] = 'L'; |
| 155970 | + if( ExprHasProperty(pTerm->pExpr, EP_OuterON) ) zType[2] = 'L'; |
| 155795 | 155971 | if( pTerm->wtFlags & TERM_CODED ) zType[3] = 'C'; |
| 155796 | 155972 | if( pTerm->eOperator & WO_SINGLE ){ |
| 155797 | 155973 | assert( (pTerm->eOperator & (WO_OR|WO_AND))==0 ); |
| 155798 | 155974 | sqlite3_snprintf(sizeof(zLeft),zLeft,"left={%d:%d}", |
| 155799 | 155975 | pTerm->leftCursor, pTerm->u.x.leftColumn); |
| | @@ -156563,16 +156739,32 @@ |
| 156563 | 156739 | ** to mix with a lower range bound from some other source */ |
| 156564 | 156740 | if( pTerm->wtFlags & TERM_LIKEOPT && pTerm->eOperator==WO_LT ) continue; |
| 156565 | 156741 | |
| 156566 | 156742 | /* tag-20191211-001: Do not allow constraints from the WHERE clause to |
| 156567 | 156743 | ** be used by the right table of a LEFT JOIN nor by the left table of a |
| 156568 | | - ** RIGHT JOIN. Only constraints in the |
| 156569 | | - ** ON clause are allowed. See tag-20191211-002 for the vtab equivalent. */ |
| 156570 | | - if( (pSrc->fg.jointype & (JT_LEFT|JT_LTORJ))!=0 |
| 156571 | | - && !ExprHasProperty(pTerm->pExpr, EP_FromJoin|EP_InnerJoin) |
| 156572 | | - ){ |
| 156573 | | - continue; |
| 156744 | + ** RIGHT JOIN. Only constraints in the ON clause are allowed. |
| 156745 | + ** See tag-20191211-002 for the vtab equivalent. |
| 156746 | + ** |
| 156747 | + ** 2022-06-06: See https://sqlite.org/forum/forumpost/206d99a16dd9212f |
| 156748 | + ** for an example of a WHERE clause constraints that may not be used on |
| 156749 | + ** the right table of a RIGHT JOIN because the constraint implies a |
| 156750 | + ** not-NULL condition on the left table of the RIGHT JOIN. |
| 156751 | + ** |
| 156752 | + ** 2022-06-10: The same condition applies to termCanDriveIndex() above. |
| 156753 | + ** https://sqlite.org/forum/forumpost/51e6959f61 |
| 156754 | + */ |
| 156755 | + if( (pSrc->fg.jointype & (JT_LEFT|JT_LTORJ|JT_RIGHT))!=0 ){ |
| 156756 | + testcase( (pSrc->fg.jointype & (JT_LEFT|JT_LTORJ|JT_RIGHT))==JT_LEFT ); |
| 156757 | + testcase( (pSrc->fg.jointype & (JT_LEFT|JT_LTORJ|JT_RIGHT))==JT_RIGHT ); |
| 156758 | + testcase( (pSrc->fg.jointype & (JT_LEFT|JT_LTORJ|JT_RIGHT))==JT_LTORJ ); |
| 156759 | + testcase( ExprHasProperty(pTerm->pExpr, EP_OuterON) ) |
| 156760 | + testcase( ExprHasProperty(pTerm->pExpr, EP_InnerON) ); |
| 156761 | + if( !ExprHasProperty(pTerm->pExpr, EP_OuterON|EP_InnerON) |
| 156762 | + || pTerm->pExpr->w.iJoin != pSrc->iCursor |
| 156763 | + ){ |
| 156764 | + continue; |
| 156765 | + } |
| 156574 | 156766 | } |
| 156575 | 156767 | |
| 156576 | 156768 | if( IsUniqueIndex(pProbe) && saved_nEq==pProbe->nKeyCol-1 ){ |
| 156577 | 156769 | pBuilder->bldFlags1 |= SQLITE_BLDF1_UNIQUE; |
| 156578 | 156770 | }else{ |
| | @@ -156920,27 +157112,30 @@ |
| 156920 | 157112 | /* Check to see if a partial index with pPartIndexWhere can be used |
| 156921 | 157113 | ** in the current query. Return true if it can be and false if not. |
| 156922 | 157114 | */ |
| 156923 | 157115 | static int whereUsablePartialIndex( |
| 156924 | 157116 | int iTab, /* The table for which we want an index */ |
| 156925 | | - int isLeft, /* True if iTab is the right table of a LEFT JOIN */ |
| 157117 | + u8 jointype, /* The JT_* flags on the join */ |
| 156926 | 157118 | WhereClause *pWC, /* The WHERE clause of the query */ |
| 156927 | 157119 | Expr *pWhere /* The WHERE clause from the partial index */ |
| 156928 | 157120 | ){ |
| 156929 | 157121 | int i; |
| 156930 | 157122 | WhereTerm *pTerm; |
| 156931 | | - Parse *pParse = pWC->pWInfo->pParse; |
| 157123 | + Parse *pParse; |
| 157124 | + |
| 157125 | + if( jointype & JT_LTORJ ) return 0; |
| 157126 | + pParse = pWC->pWInfo->pParse; |
| 156932 | 157127 | while( pWhere->op==TK_AND ){ |
| 156933 | | - if( !whereUsablePartialIndex(iTab,isLeft,pWC,pWhere->pLeft) ) return 0; |
| 157128 | + if( !whereUsablePartialIndex(iTab,jointype,pWC,pWhere->pLeft) ) return 0; |
| 156934 | 157129 | pWhere = pWhere->pRight; |
| 156935 | 157130 | } |
| 156936 | 157131 | if( pParse->db->flags & SQLITE_EnableQPSG ) pParse = 0; |
| 156937 | 157132 | for(i=0, pTerm=pWC->a; i<pWC->nTerm; i++, pTerm++){ |
| 156938 | 157133 | Expr *pExpr; |
| 156939 | 157134 | pExpr = pTerm->pExpr; |
| 156940 | | - if( (!ExprHasProperty(pExpr, EP_FromJoin) || pExpr->w.iJoin==iTab) |
| 156941 | | - && (isLeft==0 || ExprHasProperty(pExpr, EP_FromJoin)) |
| 157135 | + if( (!ExprHasProperty(pExpr, EP_OuterON) || pExpr->w.iJoin==iTab) |
| 157136 | + && ((jointype & JT_OUTER)==0 || ExprHasProperty(pExpr, EP_OuterON)) |
| 156942 | 157137 | && sqlite3ExprImpliesExpr(pParse, pExpr, pWhere, iTab) |
| 156943 | 157138 | && (pTerm->wtFlags & TERM_VNULL)==0 |
| 156944 | 157139 | ){ |
| 156945 | 157140 | return 1; |
| 156946 | 157141 | } |
| | @@ -157102,13 +157297,12 @@ |
| 157102 | 157297 | /* Loop over all indices. If there was an INDEXED BY clause, then only |
| 157103 | 157298 | ** consider index pProbe. */ |
| 157104 | 157299 | for(; rc==SQLITE_OK && pProbe; |
| 157105 | 157300 | pProbe=(pSrc->fg.isIndexedBy ? 0 : pProbe->pNext), iSortIdx++ |
| 157106 | 157301 | ){ |
| 157107 | | - int isLeft = (pSrc->fg.jointype & JT_OUTER)!=0; |
| 157108 | 157302 | if( pProbe->pPartIdxWhere!=0 |
| 157109 | | - && !whereUsablePartialIndex(pSrc->iCursor, isLeft, pWC, |
| 157303 | + && !whereUsablePartialIndex(pSrc->iCursor, pSrc->fg.jointype, pWC, |
| 157110 | 157304 | pProbe->pPartIdxWhere) |
| 157111 | 157305 | ){ |
| 157112 | 157306 | testcase( pNew->iTab!=pSrc->iCursor ); /* See ticket [98d973b8f5] */ |
| 157113 | 157307 | continue; /* Partial index inappropriate for this query */ |
| 157114 | 157308 | } |
| | @@ -157212,11 +157406,18 @@ |
| 157212 | 157406 | |
| 157213 | 157407 | pNew->rRun = sqlite3LogEstAdd(pNew->rRun, nLookup); |
| 157214 | 157408 | } |
| 157215 | 157409 | ApplyCostMultiplier(pNew->rRun, pTab->costMult); |
| 157216 | 157410 | whereLoopOutputAdjust(pWC, pNew, rSize); |
| 157217 | | - rc = whereLoopInsert(pBuilder, pNew); |
| 157411 | + if( (pSrc->fg.jointype & JT_RIGHT)!=0 && pProbe->aColExpr ){ |
| 157412 | + /* Do not do an SCAN of a index-on-expression in a RIGHT JOIN |
| 157413 | + ** because the cursor used to access the index might not be |
| 157414 | + ** positioned to the correct row during the right-join no-match |
| 157415 | + ** loop. */ |
| 157416 | + }else{ |
| 157417 | + rc = whereLoopInsert(pBuilder, pNew); |
| 157418 | + } |
| 157218 | 157419 | pNew->nOut = rSize; |
| 157219 | 157420 | if( rc ) break; |
| 157220 | 157421 | } |
| 157221 | 157422 | } |
| 157222 | 157423 | |
| | @@ -157387,10 +157588,11 @@ |
| 157387 | 157588 | pIdxInfo->orderByConsumed = 0; |
| 157388 | 157589 | pIdxInfo->idxFlags &= ~SQLITE_INDEX_SCAN_UNIQUE; |
| 157389 | 157590 | *pbIn = 1; assert( (mExclude & WO_IN)==0 ); |
| 157390 | 157591 | } |
| 157391 | 157592 | |
| 157593 | + assert( pbRetryLimit || !isLimitTerm(pTerm) ); |
| 157392 | 157594 | if( isLimitTerm(pTerm) && *pbIn ){ |
| 157393 | 157595 | /* If there is an IN(...) term handled as an == (separate call to |
| 157394 | 157596 | ** xFilter for each value on the RHS of the IN) and a LIMIT or |
| 157395 | 157597 | ** OFFSET term handled as well, the plan is unusable. Set output |
| 157396 | 157598 | ** variable *pbRetryLimit to true to tell the caller to retry with |
| | @@ -157860,11 +158062,13 @@ |
| 157860 | 158062 | SrcList *pTabList = pWInfo->pTabList; |
| 157861 | 158063 | SrcItem *pItem; |
| 157862 | 158064 | SrcItem *pEnd = &pTabList->a[pWInfo->nLevel]; |
| 157863 | 158065 | sqlite3 *db = pWInfo->pParse->db; |
| 157864 | 158066 | int rc = SQLITE_OK; |
| 158067 | + int bFirstPastRJ = 0; |
| 157865 | 158068 | WhereLoop *pNew; |
| 158069 | + |
| 157866 | 158070 | |
| 157867 | 158071 | /* Loop over the tables in the join, from left to right */ |
| 157868 | 158072 | pNew = pBuilder->pNew; |
| 157869 | 158073 | whereLoopInit(pNew); |
| 157870 | 158074 | pBuilder->iPlanLimit = SQLITE_QUERY_PLANNER_LIMIT; |
| | @@ -157871,14 +158075,17 @@ |
| 157871 | 158075 | for(iTab=0, pItem=pTabList->a; pItem<pEnd; iTab++, pItem++){ |
| 157872 | 158076 | Bitmask mUnusable = 0; |
| 157873 | 158077 | pNew->iTab = iTab; |
| 157874 | 158078 | pBuilder->iPlanLimit += SQLITE_QUERY_PLANNER_LIMIT_INCR; |
| 157875 | 158079 | pNew->maskSelf = sqlite3WhereGetMask(&pWInfo->sMaskSet, pItem->iCursor); |
| 157876 | | - if( (pItem->fg.jointype & (JT_OUTER|JT_CROSS))!=0 ){ |
| 157877 | | - /* This condition is true when pItem is the FROM clause term on the |
| 157878 | | - ** right-hand-side of a OUTER or CROSS JOIN. */ |
| 158080 | + if( bFirstPastRJ || (pItem->fg.jointype & (JT_OUTER|JT_CROSS))!=0 ){ |
| 158081 | + /* Add prerequisites to prevent reordering of FROM clause terms |
| 158082 | + ** across CROSS joins and outer joins. The bFirstPastRJ boolean |
| 158083 | + ** prevents the right operand of a RIGHT JOIN from being swapped with |
| 158084 | + ** other elements even further to the right. */ |
| 157879 | 158085 | mPrereq |= mPrior; |
| 158086 | + bFirstPastRJ = (pItem->fg.jointype & JT_RIGHT)!=0; |
| 157880 | 158087 | } |
| 157881 | 158088 | #ifndef SQLITE_OMIT_VIRTUALTABLE |
| 157882 | 158089 | if( IsVirtual(pItem->pTab) ){ |
| 157883 | 158090 | SrcItem *p; |
| 157884 | 158091 | for(p=&pItem[1]; p<pEnd; p++){ |
| | @@ -158944,11 +159151,11 @@ |
| 158944 | 159151 | } |
| 158945 | 159152 | if( (tabUsed & pLoop->maskSelf)!=0 ) continue; |
| 158946 | 159153 | pEnd = pWInfo->sWC.a + pWInfo->sWC.nTerm; |
| 158947 | 159154 | for(pTerm=pWInfo->sWC.a; pTerm<pEnd; pTerm++){ |
| 158948 | 159155 | if( (pTerm->prereqAll & pLoop->maskSelf)!=0 ){ |
| 158949 | | - if( !ExprHasProperty(pTerm->pExpr, EP_FromJoin) |
| 159156 | + if( !ExprHasProperty(pTerm->pExpr, EP_OuterON) |
| 158950 | 159157 | || pTerm->pExpr->w.iJoin!=pItem->iCursor |
| 158951 | 159158 | ){ |
| 158952 | 159159 | break; |
| 158953 | 159160 | } |
| 158954 | 159161 | } |
| | @@ -159570,10 +159777,11 @@ |
| 159570 | 159777 | op = OP_ReopenIdx; |
| 159571 | 159778 | }else{ |
| 159572 | 159779 | iIndexCur = pParse->nTab++; |
| 159573 | 159780 | } |
| 159574 | 159781 | pLevel->iIdxCur = iIndexCur; |
| 159782 | + assert( pIx!=0 ); |
| 159575 | 159783 | assert( pIx->pSchema==pTab->pSchema ); |
| 159576 | 159784 | assert( iIndexCur>=0 ); |
| 159577 | 159785 | if( op ){ |
| 159578 | 159786 | sqlite3VdbeAddOp3(v, op, iIndexCur, pIx->tnum, iDb); |
| 159579 | 159787 | sqlite3VdbeSetP4KeyInfo(pParse, pIx); |
| | @@ -159645,13 +159853,24 @@ |
| 159645 | 159853 | ** program. |
| 159646 | 159854 | */ |
| 159647 | 159855 | for(ii=0; ii<nTabList; ii++){ |
| 159648 | 159856 | int addrExplain; |
| 159649 | 159857 | int wsFlags; |
| 159858 | + SrcItem *pSrc; |
| 159650 | 159859 | if( pParse->nErr ) goto whereBeginError; |
| 159651 | 159860 | pLevel = &pWInfo->a[ii]; |
| 159652 | 159861 | wsFlags = pLevel->pWLoop->wsFlags; |
| 159862 | + pSrc = &pTabList->a[pLevel->iFrom]; |
| 159863 | + if( pSrc->fg.isMaterialized ){ |
| 159864 | + if( pSrc->fg.isCorrelated ){ |
| 159865 | + sqlite3VdbeAddOp2(v, OP_Gosub, pSrc->regReturn, pSrc->addrFillSub); |
| 159866 | + }else{ |
| 159867 | + int iOnce = sqlite3VdbeAddOp0(v, OP_Once); VdbeCoverage(v); |
| 159868 | + sqlite3VdbeAddOp2(v, OP_Gosub, pSrc->regReturn, pSrc->addrFillSub); |
| 159869 | + sqlite3VdbeJumpHere(v, iOnce); |
| 159870 | + } |
| 159871 | + } |
| 159653 | 159872 | if( (wsFlags & (WHERE_AUTO_INDEX|WHERE_BLOOMFILTER))!=0 ){ |
| 159654 | 159873 | if( (wsFlags & WHERE_AUTO_INDEX)!=0 ){ |
| 159655 | 159874 | #ifndef SQLITE_OMIT_AUTOMATIC_INDEX |
| 159656 | 159875 | constructAutomaticIndex(pParse, &pWInfo->sWC, |
| 159657 | 159876 | &pTabList->a[pLevel->iFrom], notReady, pLevel); |
| | @@ -159739,10 +159958,11 @@ |
| 159739 | 159958 | WhereLevel *pLevel; |
| 159740 | 159959 | WhereLoop *pLoop; |
| 159741 | 159960 | SrcList *pTabList = pWInfo->pTabList; |
| 159742 | 159961 | sqlite3 *db = pParse->db; |
| 159743 | 159962 | int iEnd = sqlite3VdbeCurrentAddr(v); |
| 159963 | + int nRJ = 0; |
| 159744 | 159964 | |
| 159745 | 159965 | /* Generate loop termination code. |
| 159746 | 159966 | */ |
| 159747 | 159967 | VdbeModuleComment((v, "End WHERE-core")); |
| 159748 | 159968 | for(i=pWInfo->nLevel-1; i>=0; i--){ |
| | @@ -159755,12 +159975,11 @@ |
| 159755 | 159975 | sqlite3VdbeResolveLabel(v, pLevel->addrCont); |
| 159756 | 159976 | pLevel->addrCont = 0; |
| 159757 | 159977 | pRJ->endSubrtn = sqlite3VdbeCurrentAddr(v); |
| 159758 | 159978 | sqlite3VdbeAddOp3(v, OP_Return, pRJ->regReturn, pRJ->addrSubrtn, 1); |
| 159759 | 159979 | VdbeCoverage(v); |
| 159760 | | - assert( pParse->withinRJSubrtn>0 ); |
| 159761 | | - pParse->withinRJSubrtn--; |
| 159980 | + nRJ++; |
| 159762 | 159981 | } |
| 159763 | 159982 | pLoop = pLevel->pWLoop; |
| 159764 | 159983 | if( pLevel->op!=OP_Noop ){ |
| 159765 | 159984 | #ifndef SQLITE_DISABLE_SKIPAHEAD_DISTINCT |
| 159766 | 159985 | int addrSeek = 0; |
| | @@ -159898,10 +160117,11 @@ |
| 159898 | 160117 | VdbeModuleComment((v, "End WHERE-loop%d: %s", i, |
| 159899 | 160118 | pWInfo->pTabList->a[pLevel->iFrom].pTab->zName)); |
| 159900 | 160119 | } |
| 159901 | 160120 | |
| 159902 | 160121 | assert( pWInfo->nLevel<=pTabList->nSrc ); |
| 160122 | + if( pWInfo->pExprMods ) whereUndoExprMods(pWInfo); |
| 159903 | 160123 | for(i=0, pLevel=pWInfo->a; i<pWInfo->nLevel; i++, pLevel++){ |
| 159904 | 160124 | int k, last; |
| 159905 | 160125 | VdbeOp *pOp, *pLastOp; |
| 159906 | 160126 | Index *pIdx = 0; |
| 159907 | 160127 | SrcItem *pTabItem = &pTabList->a[pLevel->iFrom]; |
| | @@ -160034,13 +160254,13 @@ |
| 160034 | 160254 | */ |
| 160035 | 160255 | sqlite3VdbeResolveLabel(v, pWInfo->iBreak); |
| 160036 | 160256 | |
| 160037 | 160257 | /* Final cleanup |
| 160038 | 160258 | */ |
| 160039 | | - if( pWInfo->pExprMods ) whereUndoExprMods(pWInfo); |
| 160040 | 160259 | pParse->nQueryLoop = pWInfo->savedNQueryLoop; |
| 160041 | 160260 | whereInfoFree(db, pWInfo); |
| 160261 | + pParse->withinRJSubrtn -= nRJ; |
| 160042 | 160262 | return; |
| 160043 | 160263 | } |
| 160044 | 160264 | |
| 160045 | 160265 | /************** End of where.c ***********************************************/ |
| 160046 | 160266 | /************** Begin file window.c ******************************************/ |
| | @@ -163662,22 +163882,22 @@ |
| 163662 | 163882 | #define sqlite3ParserCTX_PDECL ,Parse *pParse |
| 163663 | 163883 | #define sqlite3ParserCTX_PARAM ,pParse |
| 163664 | 163884 | #define sqlite3ParserCTX_FETCH Parse *pParse=yypParser->pParse; |
| 163665 | 163885 | #define sqlite3ParserCTX_STORE yypParser->pParse=pParse; |
| 163666 | 163886 | #define YYFALLBACK 1 |
| 163667 | | -#define YYNSTATE 570 |
| 163668 | | -#define YYNRULE 403 |
| 163669 | | -#define YYNRULE_WITH_ACTION 340 |
| 163887 | +#define YYNSTATE 576 |
| 163888 | +#define YYNRULE 405 |
| 163889 | +#define YYNRULE_WITH_ACTION 342 |
| 163670 | 163890 | #define YYNTOKEN 185 |
| 163671 | | -#define YY_MAX_SHIFT 569 |
| 163672 | | -#define YY_MIN_SHIFTREDUCE 829 |
| 163673 | | -#define YY_MAX_SHIFTREDUCE 1231 |
| 163674 | | -#define YY_ERROR_ACTION 1232 |
| 163675 | | -#define YY_ACCEPT_ACTION 1233 |
| 163676 | | -#define YY_NO_ACTION 1234 |
| 163677 | | -#define YY_MIN_REDUCE 1235 |
| 163678 | | -#define YY_MAX_REDUCE 1637 |
| 163891 | +#define YY_MAX_SHIFT 575 |
| 163892 | +#define YY_MIN_SHIFTREDUCE 835 |
| 163893 | +#define YY_MAX_SHIFTREDUCE 1239 |
| 163894 | +#define YY_ERROR_ACTION 1240 |
| 163895 | +#define YY_ACCEPT_ACTION 1241 |
| 163896 | +#define YY_NO_ACTION 1242 |
| 163897 | +#define YY_MIN_REDUCE 1243 |
| 163898 | +#define YY_MAX_REDUCE 1647 |
| 163679 | 163899 | /************* End control #defines *******************************************/ |
| 163680 | 163900 | #define YY_NLOOKAHEAD ((int)(sizeof(yy_lookahead)/sizeof(yy_lookahead[0]))) |
| 163681 | 163901 | |
| 163682 | 163902 | /* Define the yytestcase() macro to be a no-op if is not already defined |
| 163683 | 163903 | ** otherwise. |
| | @@ -163740,219 +163960,222 @@ |
| 163740 | 163960 | ** yy_reduce_ofst[] For each state, the offset into yy_action for |
| 163741 | 163961 | ** shifting non-terminals after a reduce. |
| 163742 | 163962 | ** yy_default[] Default action for each state. |
| 163743 | 163963 | ** |
| 163744 | 163964 | *********** Begin parsing tables **********************************************/ |
| 163745 | | -#define YY_ACTTAB_COUNT (2064) |
| 163965 | +#define YY_ACTTAB_COUNT (2098) |
| 163746 | 163966 | static const YYACTIONTYPE yy_action[] = { |
| 163747 | | - /* 0 */ 562, 204, 562, 116, 112, 225, 562, 116, 112, 225, |
| 163748 | | - /* 10 */ 562, 1306, 373, 1285, 404, 556, 556, 556, 562, 405, |
| 163749 | | - /* 20 */ 374, 1306, 1268, 41, 41, 41, 41, 204, 1516, 71, |
| 163750 | | - /* 30 */ 71, 965, 415, 41, 41, 487, 299, 275, 299, 966, |
| 163751 | | - /* 40 */ 393, 71, 71, 123, 124, 114, 1209, 1209, 1042, 1045, |
| 163752 | | - /* 50 */ 1034, 1034, 121, 121, 122, 122, 122, 122, 472, 405, |
| 163753 | | - /* 60 */ 1233, 1, 1, 569, 2, 1237, 544, 116, 112, 225, |
| 163754 | | - /* 70 */ 313, 476, 142, 476, 520, 116, 112, 225, 525, 1319, |
| 163755 | | - /* 80 */ 413, 519, 138, 123, 124, 114, 1209, 1209, 1042, 1045, |
| 163756 | | - /* 90 */ 1034, 1034, 121, 121, 122, 122, 122, 122, 116, 112, |
| 163757 | | - /* 100 */ 225, 323, 120, 120, 120, 120, 119, 119, 118, 118, |
| 163758 | | - /* 110 */ 118, 117, 113, 440, 280, 280, 280, 280, 438, 438, |
| 163759 | | - /* 120 */ 438, 1557, 372, 1559, 1184, 371, 1155, 559, 1155, 559, |
| 163760 | | - /* 130 */ 405, 1557, 533, 255, 222, 440, 99, 141, 445, 312, |
| 163761 | | - /* 140 */ 553, 236, 120, 120, 120, 120, 119, 119, 118, 118, |
| 163762 | | - /* 150 */ 118, 117, 113, 440, 123, 124, 114, 1209, 1209, 1042, |
| 163763 | | - /* 160 */ 1045, 1034, 1034, 121, 121, 122, 122, 122, 122, 138, |
| 163764 | | - /* 170 */ 290, 1184, 335, 444, 118, 118, 118, 117, 113, 440, |
| 163765 | | - /* 180 */ 125, 1184, 1185, 1186, 144, 437, 436, 562, 117, 113, |
| 163766 | | - /* 190 */ 440, 122, 122, 122, 122, 115, 120, 120, 120, 120, |
| 163767 | | - /* 200 */ 119, 119, 118, 118, 118, 117, 113, 440, 450, 110, |
| 163768 | | - /* 210 */ 13, 13, 542, 120, 120, 120, 120, 119, 119, 118, |
| 163769 | | - /* 220 */ 118, 118, 117, 113, 440, 418, 312, 553, 1184, 1185, |
| 163770 | | - /* 230 */ 1186, 145, 1216, 405, 1216, 122, 122, 122, 122, 120, |
| 163771 | | - /* 240 */ 120, 120, 120, 119, 119, 118, 118, 118, 117, 113, |
| 163772 | | - /* 250 */ 440, 461, 338, 1031, 1031, 1043, 1046, 123, 124, 114, |
| 163773 | | - /* 260 */ 1209, 1209, 1042, 1045, 1034, 1034, 121, 121, 122, 122, |
| 163774 | | - /* 270 */ 122, 122, 1271, 518, 218, 1184, 562, 405, 220, 510, |
| 163775 | | - /* 280 */ 171, 80, 81, 120, 120, 120, 120, 119, 119, 118, |
| 163776 | | - /* 290 */ 118, 118, 117, 113, 440, 1001, 16, 16, 1184, 55, |
| 163777 | | - /* 300 */ 55, 123, 124, 114, 1209, 1209, 1042, 1045, 1034, 1034, |
| 163778 | | - /* 310 */ 121, 121, 122, 122, 122, 122, 120, 120, 120, 120, |
| 163779 | | - /* 320 */ 119, 119, 118, 118, 118, 117, 113, 440, 1035, 542, |
| 163780 | | - /* 330 */ 1184, 369, 1184, 1185, 1186, 248, 1426, 395, 500, 497, |
| 163781 | | - /* 340 */ 496, 108, 554, 560, 4, 920, 920, 429, 495, 336, |
| 163782 | | - /* 350 */ 456, 324, 356, 390, 1229, 1184, 1185, 1186, 557, 562, |
| 163783 | | - /* 360 */ 120, 120, 120, 120, 119, 119, 118, 118, 118, 117, |
| 163784 | | - /* 370 */ 113, 440, 280, 280, 365, 1570, 1597, 437, 436, 150, |
| 163785 | | - /* 380 */ 405, 441, 71, 71, 1278, 559, 1213, 1184, 1185, 1186, |
| 163786 | | - /* 390 */ 83, 1215, 267, 551, 539, 511, 1551, 562, 96, 1214, |
| 163787 | | - /* 400 */ 6, 1270, 468, 138, 123, 124, 114, 1209, 1209, 1042, |
| 163788 | | - /* 410 */ 1045, 1034, 1034, 121, 121, 122, 122, 122, 122, 544, |
| 163789 | | - /* 420 */ 13, 13, 1021, 503, 1216, 1184, 1216, 543, 106, 106, |
| 163790 | | - /* 430 */ 218, 562, 1230, 171, 562, 423, 107, 193, 441, 564, |
| 163791 | | - /* 440 */ 563, 426, 1542, 1011, 321, 545, 1184, 266, 283, 364, |
| 163792 | | - /* 450 */ 506, 359, 505, 253, 71, 71, 539, 71, 71, 355, |
| 163793 | | - /* 460 */ 312, 553, 1603, 120, 120, 120, 120, 119, 119, 118, |
| 163794 | | - /* 470 */ 118, 118, 117, 113, 440, 1011, 1011, 1013, 1014, 27, |
| 163795 | | - /* 480 */ 280, 280, 1184, 1185, 1186, 1150, 562, 1602, 405, 895, |
| 163796 | | - /* 490 */ 186, 544, 352, 559, 544, 931, 529, 513, 1150, 512, |
| 163797 | | - /* 500 */ 409, 1150, 546, 1184, 1185, 1186, 562, 540, 1544, 51, |
| 163798 | | - /* 510 */ 51, 210, 123, 124, 114, 1209, 1209, 1042, 1045, 1034, |
| 163799 | | - /* 520 */ 1034, 121, 121, 122, 122, 122, 122, 1184, 470, 56, |
| 163800 | | - /* 530 */ 56, 405, 280, 280, 1480, 501, 119, 119, 118, 118, |
| 163801 | | - /* 540 */ 118, 117, 113, 440, 1001, 559, 514, 213, 537, 1551, |
| 163802 | | - /* 550 */ 312, 553, 138, 6, 528, 123, 124, 114, 1209, 1209, |
| 163803 | | - /* 560 */ 1042, 1045, 1034, 1034, 121, 121, 122, 122, 122, 122, |
| 163804 | | - /* 570 */ 1545, 120, 120, 120, 120, 119, 119, 118, 118, 118, |
| 163805 | | - /* 580 */ 117, 113, 440, 481, 1184, 1185, 1186, 478, 277, 1259, |
| 163806 | | - /* 590 */ 951, 248, 1184, 369, 500, 497, 496, 1184, 336, 565, |
| 163807 | | - /* 600 */ 1184, 565, 405, 288, 495, 951, 870, 187, 476, 312, |
| 163808 | | - /* 610 */ 553, 380, 286, 376, 120, 120, 120, 120, 119, 119, |
| 163809 | | - /* 620 */ 118, 118, 118, 117, 113, 440, 123, 124, 114, 1209, |
| 163810 | | - /* 630 */ 1209, 1042, 1045, 1034, 1034, 121, 121, 122, 122, 122, |
| 163811 | | - /* 640 */ 122, 405, 390, 1128, 1184, 863, 98, 280, 280, 1184, |
| 163812 | | - /* 650 */ 1185, 1186, 369, 1085, 1184, 1185, 1186, 1184, 1185, 1186, |
| 163813 | | - /* 660 */ 559, 451, 32, 369, 229, 123, 124, 114, 1209, 1209, |
| 163814 | | - /* 670 */ 1042, 1045, 1034, 1034, 121, 121, 122, 122, 122, 122, |
| 163815 | | - /* 680 */ 1425, 953, 562, 224, 952, 120, 120, 120, 120, 119, |
| 163816 | | - /* 690 */ 119, 118, 118, 118, 117, 113, 440, 1150, 224, 1184, |
| 163817 | | - /* 700 */ 153, 1184, 1185, 1186, 1543, 13, 13, 297, 951, 1224, |
| 163818 | | - /* 710 */ 1150, 149, 405, 1150, 369, 1573, 1168, 5, 365, 1570, |
| 163819 | | - /* 720 */ 425, 1230, 3, 951, 120, 120, 120, 120, 119, 119, |
| 163820 | | - /* 730 */ 118, 118, 118, 117, 113, 440, 123, 124, 114, 1209, |
| 163821 | | - /* 740 */ 1209, 1042, 1045, 1034, 1034, 121, 121, 122, 122, 122, |
| 163822 | | - /* 750 */ 122, 405, 204, 561, 1184, 1022, 1184, 1185, 1186, 1184, |
| 163823 | | - /* 760 */ 384, 846, 151, 1542, 282, 398, 1090, 1090, 484, 562, |
| 163824 | | - /* 770 */ 461, 338, 1311, 1311, 1542, 123, 124, 114, 1209, 1209, |
| 163825 | | - /* 780 */ 1042, 1045, 1034, 1034, 121, 121, 122, 122, 122, 122, |
| 163826 | | - /* 790 */ 127, 562, 13, 13, 370, 120, 120, 120, 120, 119, |
| 163827 | | - /* 800 */ 119, 118, 118, 118, 117, 113, 440, 298, 562, 449, |
| 163828 | | - /* 810 */ 524, 1184, 1185, 1186, 13, 13, 1184, 1185, 1186, 1289, |
| 163829 | | - /* 820 */ 459, 1259, 405, 1309, 1309, 1542, 1006, 449, 448, 196, |
| 163830 | | - /* 830 */ 295, 71, 71, 1257, 120, 120, 120, 120, 119, 119, |
| 163831 | | - /* 840 */ 118, 118, 118, 117, 113, 440, 123, 124, 114, 1209, |
| 163832 | | - /* 850 */ 1209, 1042, 1045, 1034, 1034, 121, 121, 122, 122, 122, |
| 163833 | | - /* 860 */ 122, 405, 223, 1065, 1150, 280, 280, 415, 308, 274, |
| 163834 | | - /* 870 */ 274, 281, 281, 1411, 402, 401, 378, 1150, 559, 562, |
| 163835 | | - /* 880 */ 1150, 1188, 559, 1590, 559, 123, 124, 114, 1209, 1209, |
| 163836 | | - /* 890 */ 1042, 1045, 1034, 1034, 121, 121, 122, 122, 122, 122, |
| 163837 | | - /* 900 */ 449, 1472, 13, 13, 1526, 120, 120, 120, 120, 119, |
| 163838 | | - /* 910 */ 119, 118, 118, 118, 117, 113, 440, 197, 562, 350, |
| 163839 | | - /* 920 */ 1576, 569, 2, 1237, 834, 835, 836, 1552, 313, 1204, |
| 163840 | | - /* 930 */ 142, 6, 405, 251, 250, 249, 202, 1319, 9, 1188, |
| 163841 | | - /* 940 */ 258, 71, 71, 420, 120, 120, 120, 120, 119, 119, |
| 163842 | | - /* 950 */ 118, 118, 118, 117, 113, 440, 123, 124, 114, 1209, |
| 163843 | | - /* 960 */ 1209, 1042, 1045, 1034, 1034, 121, 121, 122, 122, 122, |
| 163844 | | - /* 970 */ 122, 562, 280, 280, 562, 1205, 405, 568, 309, 1237, |
| 163845 | | - /* 980 */ 345, 1288, 348, 415, 313, 559, 142, 487, 521, 1633, |
| 163846 | | - /* 990 */ 391, 367, 487, 1319, 70, 70, 1287, 71, 71, 236, |
| 163847 | | - /* 1000 */ 1317, 101, 114, 1209, 1209, 1042, 1045, 1034, 1034, 121, |
| 163848 | | - /* 1010 */ 121, 122, 122, 122, 122, 120, 120, 120, 120, 119, |
| 163849 | | - /* 1020 */ 119, 118, 118, 118, 117, 113, 440, 1106, 280, 280, |
| 163850 | | - /* 1030 */ 424, 444, 1515, 1205, 435, 280, 280, 1479, 1344, 307, |
| 163851 | | - /* 1040 */ 470, 559, 1107, 965, 487, 487, 213, 1255, 559, 1528, |
| 163852 | | - /* 1050 */ 562, 966, 203, 562, 1021, 236, 379, 1108, 515, 120, |
| 163853 | | - /* 1060 */ 120, 120, 120, 119, 119, 118, 118, 118, 117, 113, |
| 163854 | | - /* 1070 */ 440, 1012, 104, 71, 71, 1011, 13, 13, 906, 562, |
| 163855 | | - /* 1080 */ 1485, 562, 280, 280, 95, 522, 487, 444, 907, 1318, |
| 163856 | | - /* 1090 */ 1314, 541, 405, 280, 280, 559, 147, 205, 1485, 1487, |
| 163857 | | - /* 1100 */ 258, 446, 15, 15, 43, 43, 559, 1011, 1011, 1013, |
| 163858 | | - /* 1110 */ 439, 328, 405, 523, 12, 291, 123, 124, 114, 1209, |
| 163859 | | - /* 1120 */ 1209, 1042, 1045, 1034, 1034, 121, 121, 122, 122, 122, |
| 163860 | | - /* 1130 */ 122, 343, 405, 858, 1524, 1205, 123, 124, 114, 1209, |
| 163861 | | - /* 1140 */ 1209, 1042, 1045, 1034, 1034, 121, 121, 122, 122, 122, |
| 163862 | | - /* 1150 */ 122, 1129, 1631, 470, 1631, 367, 123, 111, 114, 1209, |
| 163863 | | - /* 1160 */ 1209, 1042, 1045, 1034, 1034, 121, 121, 122, 122, 122, |
| 163864 | | - /* 1170 */ 122, 1485, 325, 470, 327, 120, 120, 120, 120, 119, |
| 163865 | | - /* 1180 */ 119, 118, 118, 118, 117, 113, 440, 199, 1411, 562, |
| 163866 | | - /* 1190 */ 1286, 858, 460, 1205, 432, 120, 120, 120, 120, 119, |
| 163867 | | - /* 1200 */ 119, 118, 118, 118, 117, 113, 440, 547, 1129, 1632, |
| 163868 | | - /* 1210 */ 535, 1632, 57, 57, 886, 120, 120, 120, 120, 119, |
| 163869 | | - /* 1220 */ 119, 118, 118, 118, 117, 113, 440, 562, 294, 534, |
| 163870 | | - /* 1230 */ 1127, 1411, 1549, 1550, 1323, 405, 6, 6, 1161, 1260, |
| 163871 | | - /* 1240 */ 411, 316, 280, 280, 1411, 504, 559, 521, 296, 453, |
| 163872 | | - /* 1250 */ 44, 44, 562, 887, 12, 559, 326, 474, 421, 403, |
| 163873 | | - /* 1260 */ 124, 114, 1209, 1209, 1042, 1045, 1034, 1034, 121, 121, |
| 163874 | | - /* 1270 */ 122, 122, 122, 122, 562, 58, 58, 284, 1184, 1411, |
| 163875 | | - /* 1280 */ 492, 454, 388, 388, 387, 269, 385, 1127, 1548, 843, |
| 163876 | | - /* 1290 */ 1161, 403, 6, 562, 317, 1150, 466, 59, 59, 1547, |
| 163877 | | - /* 1300 */ 1106, 422, 230, 6, 319, 252, 536, 252, 1150, 427, |
| 163878 | | - /* 1310 */ 562, 1150, 318, 17, 483, 1107, 60, 60, 120, 120, |
| 163879 | | - /* 1320 */ 120, 120, 119, 119, 118, 118, 118, 117, 113, 440, |
| 163880 | | - /* 1330 */ 1108, 212, 477, 61, 61, 1184, 1185, 1186, 108, 554, |
| 163881 | | - /* 1340 */ 320, 4, 232, 452, 522, 562, 233, 452, 562, 433, |
| 163882 | | - /* 1350 */ 164, 550, 416, 137, 475, 557, 562, 289, 562, 1087, |
| 163883 | | - /* 1360 */ 562, 289, 562, 1087, 527, 562, 866, 8, 62, 62, |
| 163884 | | - /* 1370 */ 231, 45, 45, 562, 410, 562, 410, 562, 441, 46, |
| 163885 | | - /* 1380 */ 46, 47, 47, 49, 49, 50, 50, 195, 63, 63, |
| 163886 | | - /* 1390 */ 551, 562, 355, 562, 98, 482, 64, 64, 65, 65, |
| 163887 | | - /* 1400 */ 14, 14, 555, 411, 531, 406, 562, 1021, 562, 530, |
| 163888 | | - /* 1410 */ 312, 553, 312, 553, 66, 66, 129, 129, 562, 1021, |
| 163889 | | - /* 1420 */ 562, 508, 926, 866, 1012, 106, 106, 925, 1011, 67, |
| 163890 | | - /* 1430 */ 67, 52, 52, 107, 447, 441, 564, 563, 412, 173, |
| 163891 | | - /* 1440 */ 1011, 68, 68, 69, 69, 562, 463, 562, 926, 467, |
| 163892 | | - /* 1450 */ 1356, 279, 222, 925, 311, 1355, 403, 562, 455, 403, |
| 163893 | | - /* 1460 */ 1011, 1011, 1013, 235, 403, 84, 209, 1342, 53, 53, |
| 163894 | | - /* 1470 */ 159, 159, 1011, 1011, 1013, 1014, 27, 1575, 1172, 443, |
| 163895 | | - /* 1480 */ 160, 160, 284, 95, 105, 1531, 103, 388, 388, 387, |
| 163896 | | - /* 1490 */ 269, 385, 562, 873, 843, 877, 562, 108, 554, 462, |
| 163897 | | - /* 1500 */ 4, 562, 148, 30, 38, 562, 1124, 230, 392, 319, |
| 163898 | | - /* 1510 */ 108, 554, 523, 4, 557, 76, 76, 318, 562, 54, |
| 163899 | | - /* 1520 */ 54, 562, 333, 464, 72, 72, 329, 557, 130, 130, |
| 163900 | | - /* 1530 */ 562, 285, 1504, 562, 31, 1503, 562, 441, 334, 479, |
| 163901 | | - /* 1540 */ 98, 73, 73, 340, 157, 157, 292, 232, 1072, 551, |
| 163902 | | - /* 1550 */ 441, 873, 1352, 131, 131, 164, 132, 132, 137, 128, |
| 163903 | | - /* 1560 */ 128, 1564, 551, 531, 562, 315, 562, 344, 532, 1003, |
| 163904 | | - /* 1570 */ 469, 257, 257, 885, 884, 231, 531, 562, 1021, 562, |
| 163905 | | - /* 1580 */ 471, 530, 257, 363, 106, 106, 517, 158, 158, 152, |
| 163906 | | - /* 1590 */ 152, 1021, 107, 362, 441, 564, 563, 106, 106, 1011, |
| 163907 | | - /* 1600 */ 136, 136, 135, 135, 562, 107, 1072, 441, 564, 563, |
| 163908 | | - /* 1610 */ 406, 347, 1011, 562, 349, 312, 553, 562, 339, 562, |
| 163909 | | - /* 1620 */ 98, 493, 353, 254, 98, 892, 893, 133, 133, 351, |
| 163910 | | - /* 1630 */ 1302, 1011, 1011, 1013, 1014, 27, 134, 134, 1015, 447, |
| 163911 | | - /* 1640 */ 75, 75, 77, 77, 1011, 1011, 1013, 1014, 27, 1172, |
| 163912 | | - /* 1650 */ 443, 562, 358, 284, 108, 554, 368, 4, 388, 388, |
| 163913 | | - /* 1660 */ 387, 269, 385, 562, 1133, 843, 562, 1068, 956, 254, |
| 163914 | | - /* 1670 */ 257, 557, 968, 969, 74, 74, 549, 923, 230, 110, |
| 163915 | | - /* 1680 */ 319, 108, 554, 1084, 4, 1084, 42, 42, 318, 48, |
| 163916 | | - /* 1690 */ 48, 1083, 1365, 1083, 441, 856, 1015, 146, 557, 924, |
| 163917 | | - /* 1700 */ 1410, 110, 1338, 1350, 548, 1416, 551, 1267, 207, 1258, |
| 163918 | | - /* 1710 */ 1246, 1245, 1247, 1583, 11, 488, 272, 215, 232, 1335, |
| 163919 | | - /* 1720 */ 304, 441, 305, 306, 389, 228, 164, 1397, 1392, 137, |
| 163920 | | - /* 1730 */ 287, 331, 332, 551, 293, 1021, 1385, 337, 473, 200, |
| 163921 | | - /* 1740 */ 361, 106, 106, 930, 498, 1402, 231, 1401, 1285, 107, |
| 163922 | | - /* 1750 */ 396, 441, 564, 563, 219, 1476, 1011, 1347, 1475, 1348, |
| 163923 | | - /* 1760 */ 1346, 1345, 1021, 1224, 552, 1586, 261, 1221, 106, 106, |
| 163924 | | - /* 1770 */ 1523, 201, 383, 1521, 214, 414, 107, 83, 441, 564, |
| 163925 | | - /* 1780 */ 563, 406, 211, 1011, 175, 1398, 312, 553, 1011, 1011, |
| 163926 | | - /* 1790 */ 1013, 1014, 27, 226, 184, 169, 100, 554, 79, 4, |
| 163927 | | - /* 1800 */ 82, 457, 35, 179, 458, 177, 491, 238, 96, 1481, |
| 163928 | | - /* 1810 */ 447, 180, 1404, 557, 181, 1011, 1011, 1013, 1014, 27, |
| 163929 | | - /* 1820 */ 182, 1403, 394, 36, 465, 1406, 397, 188, 1470, 480, |
| 163930 | | - /* 1830 */ 242, 89, 1492, 486, 342, 244, 441, 273, 192, 346, |
| 163931 | | - /* 1840 */ 489, 245, 399, 1248, 428, 246, 507, 1296, 551, 91, |
| 163932 | | - /* 1850 */ 877, 1305, 1304, 220, 1601, 1295, 1303, 430, 431, 516, |
| 163933 | | - /* 1860 */ 1569, 259, 400, 302, 1600, 1275, 303, 260, 360, 1274, |
| 163934 | | - /* 1870 */ 1273, 1599, 366, 1555, 434, 1554, 1370, 1021, 1369, 542, |
| 163935 | | - /* 1880 */ 126, 10, 1456, 106, 106, 377, 102, 97, 310, 526, |
| 163936 | | - /* 1890 */ 34, 107, 566, 441, 564, 563, 1178, 271, 1011, 268, |
| 163937 | | - /* 1900 */ 270, 567, 1243, 1238, 206, 1328, 375, 381, 1327, 382, |
| 163938 | | - /* 1910 */ 407, 161, 174, 408, 1508, 1509, 143, 300, 830, 162, |
| 163939 | | - /* 1920 */ 1507, 1506, 163, 442, 208, 314, 227, 216, 217, 78, |
| 163940 | | - /* 1930 */ 1011, 1011, 1013, 1014, 27, 140, 1082, 322, 1080, 165, |
| 163941 | | - /* 1940 */ 176, 1204, 234, 178, 909, 330, 237, 1096, 183, 166, |
| 163942 | | - /* 1950 */ 167, 417, 85, 86, 419, 185, 87, 88, 168, 1099, |
| 163943 | | - /* 1960 */ 239, 1095, 240, 154, 18, 241, 341, 1218, 257, 1088, |
| 163944 | | - /* 1970 */ 243, 485, 190, 189, 37, 845, 490, 362, 247, 494, |
| 163945 | | - /* 1980 */ 357, 191, 875, 90, 19, 502, 354, 20, 499, 92, |
| 163946 | | - /* 1990 */ 170, 155, 888, 93, 301, 509, 94, 1166, 156, 1048, |
| 163947 | | - /* 2000 */ 1135, 39, 221, 1134, 276, 278, 256, 194, 110, 960, |
| 163948 | | - /* 2010 */ 954, 1156, 21, 1152, 22, 1160, 1140, 1154, 23, 33, |
| 163949 | | - /* 2020 */ 24, 1159, 25, 538, 26, 198, 98, 1063, 1049, 1047, |
| 163950 | | - /* 2030 */ 1051, 7, 1105, 262, 1104, 263, 1052, 28, 40, 558, |
| 163951 | | - /* 2040 */ 1016, 857, 109, 29, 919, 386, 139, 172, 264, 265, |
| 163952 | | - /* 2050 */ 1174, 1592, 1173, 1234, 1234, 1234, 1234, 1234, 1234, 1234, |
| 163953 | | - /* 2060 */ 1234, 1234, 1234, 1591, |
| 163967 | + /* 0 */ 568, 208, 568, 118, 115, 229, 568, 118, 115, 229, |
| 163968 | + /* 10 */ 568, 1314, 377, 1293, 408, 562, 562, 562, 568, 409, |
| 163969 | + /* 20 */ 378, 1314, 1276, 41, 41, 41, 41, 208, 1526, 71, |
| 163970 | + /* 30 */ 71, 971, 419, 41, 41, 491, 303, 279, 303, 972, |
| 163971 | + /* 40 */ 397, 71, 71, 125, 126, 80, 1217, 1217, 1050, 1053, |
| 163972 | + /* 50 */ 1040, 1040, 123, 123, 124, 124, 124, 124, 476, 409, |
| 163973 | + /* 60 */ 1241, 1, 1, 575, 2, 1245, 550, 118, 115, 229, |
| 163974 | + /* 70 */ 317, 480, 146, 480, 524, 118, 115, 229, 529, 1327, |
| 163975 | + /* 80 */ 417, 523, 142, 125, 126, 80, 1217, 1217, 1050, 1053, |
| 163976 | + /* 90 */ 1040, 1040, 123, 123, 124, 124, 124, 124, 118, 115, |
| 163977 | + /* 100 */ 229, 327, 122, 122, 122, 122, 121, 121, 120, 120, |
| 163978 | + /* 110 */ 120, 119, 116, 444, 284, 284, 284, 284, 442, 442, |
| 163979 | + /* 120 */ 442, 1567, 376, 1569, 1192, 375, 1163, 565, 1163, 565, |
| 163980 | + /* 130 */ 409, 1567, 537, 259, 226, 444, 101, 145, 449, 316, |
| 163981 | + /* 140 */ 559, 240, 122, 122, 122, 122, 121, 121, 120, 120, |
| 163982 | + /* 150 */ 120, 119, 116, 444, 125, 126, 80, 1217, 1217, 1050, |
| 163983 | + /* 160 */ 1053, 1040, 1040, 123, 123, 124, 124, 124, 124, 142, |
| 163984 | + /* 170 */ 294, 1192, 339, 448, 120, 120, 120, 119, 116, 444, |
| 163985 | + /* 180 */ 127, 1192, 1193, 1194, 148, 441, 440, 568, 119, 116, |
| 163986 | + /* 190 */ 444, 124, 124, 124, 124, 117, 122, 122, 122, 122, |
| 163987 | + /* 200 */ 121, 121, 120, 120, 120, 119, 116, 444, 454, 113, |
| 163988 | + /* 210 */ 13, 13, 546, 122, 122, 122, 122, 121, 121, 120, |
| 163989 | + /* 220 */ 120, 120, 119, 116, 444, 422, 316, 559, 1192, 1193, |
| 163990 | + /* 230 */ 1194, 149, 1224, 409, 1224, 124, 124, 124, 124, 122, |
| 163991 | + /* 240 */ 122, 122, 122, 121, 121, 120, 120, 120, 119, 116, |
| 163992 | + /* 250 */ 444, 465, 342, 1037, 1037, 1051, 1054, 125, 126, 80, |
| 163993 | + /* 260 */ 1217, 1217, 1050, 1053, 1040, 1040, 123, 123, 124, 124, |
| 163994 | + /* 270 */ 124, 124, 1279, 522, 222, 1192, 568, 409, 224, 514, |
| 163995 | + /* 280 */ 175, 82, 83, 122, 122, 122, 122, 121, 121, 120, |
| 163996 | + /* 290 */ 120, 120, 119, 116, 444, 1007, 16, 16, 1192, 133, |
| 163997 | + /* 300 */ 133, 125, 126, 80, 1217, 1217, 1050, 1053, 1040, 1040, |
| 163998 | + /* 310 */ 123, 123, 124, 124, 124, 124, 122, 122, 122, 122, |
| 163999 | + /* 320 */ 121, 121, 120, 120, 120, 119, 116, 444, 1041, 546, |
| 164000 | + /* 330 */ 1192, 373, 1192, 1193, 1194, 252, 1434, 399, 504, 501, |
| 164001 | + /* 340 */ 500, 111, 560, 566, 4, 926, 926, 433, 499, 340, |
| 164002 | + /* 350 */ 460, 328, 360, 394, 1237, 1192, 1193, 1194, 563, 568, |
| 164003 | + /* 360 */ 122, 122, 122, 122, 121, 121, 120, 120, 120, 119, |
| 164004 | + /* 370 */ 116, 444, 284, 284, 369, 1580, 1607, 441, 440, 154, |
| 164005 | + /* 380 */ 409, 445, 71, 71, 1286, 565, 1221, 1192, 1193, 1194, |
| 164006 | + /* 390 */ 85, 1223, 271, 557, 543, 515, 1561, 568, 98, 1222, |
| 164007 | + /* 400 */ 6, 1278, 472, 142, 125, 126, 80, 1217, 1217, 1050, |
| 164008 | + /* 410 */ 1053, 1040, 1040, 123, 123, 124, 124, 124, 124, 550, |
| 164009 | + /* 420 */ 13, 13, 1027, 507, 1224, 1192, 1224, 549, 109, 109, |
| 164010 | + /* 430 */ 222, 568, 1238, 175, 568, 427, 110, 197, 445, 570, |
| 164011 | + /* 440 */ 569, 430, 1552, 1017, 325, 551, 1192, 270, 287, 368, |
| 164012 | + /* 450 */ 510, 363, 509, 257, 71, 71, 543, 71, 71, 359, |
| 164013 | + /* 460 */ 316, 559, 1613, 122, 122, 122, 122, 121, 121, 120, |
| 164014 | + /* 470 */ 120, 120, 119, 116, 444, 1017, 1017, 1019, 1020, 27, |
| 164015 | + /* 480 */ 284, 284, 1192, 1193, 1194, 1158, 568, 1612, 409, 901, |
| 164016 | + /* 490 */ 190, 550, 356, 565, 550, 937, 533, 517, 1158, 516, |
| 164017 | + /* 500 */ 413, 1158, 552, 1192, 1193, 1194, 568, 544, 1554, 51, |
| 164018 | + /* 510 */ 51, 214, 125, 126, 80, 1217, 1217, 1050, 1053, 1040, |
| 164019 | + /* 520 */ 1040, 123, 123, 124, 124, 124, 124, 1192, 474, 135, |
| 164020 | + /* 530 */ 135, 409, 284, 284, 1490, 505, 121, 121, 120, 120, |
| 164021 | + /* 540 */ 120, 119, 116, 444, 1007, 565, 518, 217, 541, 1561, |
| 164022 | + /* 550 */ 316, 559, 142, 6, 532, 125, 126, 80, 1217, 1217, |
| 164023 | + /* 560 */ 1050, 1053, 1040, 1040, 123, 123, 124, 124, 124, 124, |
| 164024 | + /* 570 */ 1555, 122, 122, 122, 122, 121, 121, 120, 120, 120, |
| 164025 | + /* 580 */ 119, 116, 444, 485, 1192, 1193, 1194, 482, 281, 1267, |
| 164026 | + /* 590 */ 957, 252, 1192, 373, 504, 501, 500, 1192, 340, 571, |
| 164027 | + /* 600 */ 1192, 571, 409, 292, 499, 957, 876, 191, 480, 316, |
| 164028 | + /* 610 */ 559, 384, 290, 380, 122, 122, 122, 122, 121, 121, |
| 164029 | + /* 620 */ 120, 120, 120, 119, 116, 444, 125, 126, 80, 1217, |
| 164030 | + /* 630 */ 1217, 1050, 1053, 1040, 1040, 123, 123, 124, 124, 124, |
| 164031 | + /* 640 */ 124, 409, 394, 1136, 1192, 869, 100, 284, 284, 1192, |
| 164032 | + /* 650 */ 1193, 1194, 373, 1093, 1192, 1193, 1194, 1192, 1193, 1194, |
| 164033 | + /* 660 */ 565, 455, 32, 373, 233, 125, 126, 80, 1217, 1217, |
| 164034 | + /* 670 */ 1050, 1053, 1040, 1040, 123, 123, 124, 124, 124, 124, |
| 164035 | + /* 680 */ 1433, 959, 568, 228, 958, 122, 122, 122, 122, 121, |
| 164036 | + /* 690 */ 121, 120, 120, 120, 119, 116, 444, 1158, 228, 1192, |
| 164037 | + /* 700 */ 157, 1192, 1193, 1194, 1553, 13, 13, 301, 957, 1232, |
| 164038 | + /* 710 */ 1158, 153, 409, 1158, 373, 1583, 1176, 5, 369, 1580, |
| 164039 | + /* 720 */ 429, 1238, 3, 957, 122, 122, 122, 122, 121, 121, |
| 164040 | + /* 730 */ 120, 120, 120, 119, 116, 444, 125, 126, 80, 1217, |
| 164041 | + /* 740 */ 1217, 1050, 1053, 1040, 1040, 123, 123, 124, 124, 124, |
| 164042 | + /* 750 */ 124, 409, 208, 567, 1192, 1028, 1192, 1193, 1194, 1192, |
| 164043 | + /* 760 */ 388, 852, 155, 1552, 286, 402, 1098, 1098, 488, 568, |
| 164044 | + /* 770 */ 465, 342, 1319, 1319, 1552, 125, 126, 80, 1217, 1217, |
| 164045 | + /* 780 */ 1050, 1053, 1040, 1040, 123, 123, 124, 124, 124, 124, |
| 164046 | + /* 790 */ 129, 568, 13, 13, 374, 122, 122, 122, 122, 121, |
| 164047 | + /* 800 */ 121, 120, 120, 120, 119, 116, 444, 302, 568, 453, |
| 164048 | + /* 810 */ 528, 1192, 1193, 1194, 13, 13, 1192, 1193, 1194, 1297, |
| 164049 | + /* 820 */ 463, 1267, 409, 1317, 1317, 1552, 1012, 453, 452, 200, |
| 164050 | + /* 830 */ 299, 71, 71, 1265, 122, 122, 122, 122, 121, 121, |
| 164051 | + /* 840 */ 120, 120, 120, 119, 116, 444, 125, 126, 80, 1217, |
| 164052 | + /* 850 */ 1217, 1050, 1053, 1040, 1040, 123, 123, 124, 124, 124, |
| 164053 | + /* 860 */ 124, 409, 227, 1073, 1158, 284, 284, 419, 312, 278, |
| 164054 | + /* 870 */ 278, 285, 285, 1419, 406, 405, 382, 1158, 565, 568, |
| 164055 | + /* 880 */ 1158, 1196, 565, 1600, 565, 125, 126, 80, 1217, 1217, |
| 164056 | + /* 890 */ 1050, 1053, 1040, 1040, 123, 123, 124, 124, 124, 124, |
| 164057 | + /* 900 */ 453, 1482, 13, 13, 1536, 122, 122, 122, 122, 121, |
| 164058 | + /* 910 */ 121, 120, 120, 120, 119, 116, 444, 201, 568, 354, |
| 164059 | + /* 920 */ 1586, 575, 2, 1245, 840, 841, 842, 1562, 317, 1212, |
| 164060 | + /* 930 */ 146, 6, 409, 255, 254, 253, 206, 1327, 9, 1196, |
| 164061 | + /* 940 */ 262, 71, 71, 424, 122, 122, 122, 122, 121, 121, |
| 164062 | + /* 950 */ 120, 120, 120, 119, 116, 444, 125, 126, 80, 1217, |
| 164063 | + /* 960 */ 1217, 1050, 1053, 1040, 1040, 123, 123, 124, 124, 124, |
| 164064 | + /* 970 */ 124, 568, 284, 284, 568, 1213, 409, 574, 313, 1245, |
| 164065 | + /* 980 */ 349, 1296, 352, 419, 317, 565, 146, 491, 525, 1643, |
| 164066 | + /* 990 */ 395, 371, 491, 1327, 70, 70, 1295, 71, 71, 240, |
| 164067 | + /* 1000 */ 1325, 104, 80, 1217, 1217, 1050, 1053, 1040, 1040, 123, |
| 164068 | + /* 1010 */ 123, 124, 124, 124, 124, 122, 122, 122, 122, 121, |
| 164069 | + /* 1020 */ 121, 120, 120, 120, 119, 116, 444, 1114, 284, 284, |
| 164070 | + /* 1030 */ 428, 448, 1525, 1213, 439, 284, 284, 1489, 1352, 311, |
| 164071 | + /* 1040 */ 474, 565, 1115, 971, 491, 491, 217, 1263, 565, 1538, |
| 164072 | + /* 1050 */ 568, 972, 207, 568, 1027, 240, 383, 1116, 519, 122, |
| 164073 | + /* 1060 */ 122, 122, 122, 121, 121, 120, 120, 120, 119, 116, |
| 164074 | + /* 1070 */ 444, 1018, 107, 71, 71, 1017, 13, 13, 912, 568, |
| 164075 | + /* 1080 */ 1495, 568, 284, 284, 97, 526, 491, 448, 913, 1326, |
| 164076 | + /* 1090 */ 1322, 545, 409, 284, 284, 565, 151, 209, 1495, 1497, |
| 164077 | + /* 1100 */ 262, 450, 55, 55, 56, 56, 565, 1017, 1017, 1019, |
| 164078 | + /* 1110 */ 443, 332, 409, 527, 12, 295, 125, 126, 80, 1217, |
| 164079 | + /* 1120 */ 1217, 1050, 1053, 1040, 1040, 123, 123, 124, 124, 124, |
| 164080 | + /* 1130 */ 124, 347, 409, 864, 1534, 1213, 125, 126, 80, 1217, |
| 164081 | + /* 1140 */ 1217, 1050, 1053, 1040, 1040, 123, 123, 124, 124, 124, |
| 164082 | + /* 1150 */ 124, 1137, 1641, 474, 1641, 371, 125, 114, 80, 1217, |
| 164083 | + /* 1160 */ 1217, 1050, 1053, 1040, 1040, 123, 123, 124, 124, 124, |
| 164084 | + /* 1170 */ 124, 1495, 329, 474, 331, 122, 122, 122, 122, 121, |
| 164085 | + /* 1180 */ 121, 120, 120, 120, 119, 116, 444, 203, 1419, 568, |
| 164086 | + /* 1190 */ 1294, 864, 464, 1213, 436, 122, 122, 122, 122, 121, |
| 164087 | + /* 1200 */ 121, 120, 120, 120, 119, 116, 444, 553, 1137, 1642, |
| 164088 | + /* 1210 */ 539, 1642, 15, 15, 892, 122, 122, 122, 122, 121, |
| 164089 | + /* 1220 */ 121, 120, 120, 120, 119, 116, 444, 568, 298, 538, |
| 164090 | + /* 1230 */ 1135, 1419, 1559, 1560, 1331, 409, 6, 6, 1169, 1268, |
| 164091 | + /* 1240 */ 415, 320, 284, 284, 1419, 508, 565, 525, 300, 457, |
| 164092 | + /* 1250 */ 43, 43, 568, 893, 12, 565, 330, 478, 425, 407, |
| 164093 | + /* 1260 */ 126, 80, 1217, 1217, 1050, 1053, 1040, 1040, 123, 123, |
| 164094 | + /* 1270 */ 124, 124, 124, 124, 568, 57, 57, 288, 1192, 1419, |
| 164095 | + /* 1280 */ 496, 458, 392, 392, 391, 273, 389, 1135, 1558, 849, |
| 164096 | + /* 1290 */ 1169, 407, 6, 568, 321, 1158, 470, 44, 44, 1557, |
| 164097 | + /* 1300 */ 1114, 426, 234, 6, 323, 256, 540, 256, 1158, 431, |
| 164098 | + /* 1310 */ 568, 1158, 322, 17, 487, 1115, 58, 58, 122, 122, |
| 164099 | + /* 1320 */ 122, 122, 121, 121, 120, 120, 120, 119, 116, 444, |
| 164100 | + /* 1330 */ 1116, 216, 481, 59, 59, 1192, 1193, 1194, 111, 560, |
| 164101 | + /* 1340 */ 324, 4, 236, 456, 526, 568, 237, 456, 568, 437, |
| 164102 | + /* 1350 */ 168, 556, 420, 141, 479, 563, 568, 293, 568, 1095, |
| 164103 | + /* 1360 */ 568, 293, 568, 1095, 531, 568, 872, 8, 60, 60, |
| 164104 | + /* 1370 */ 235, 61, 61, 568, 414, 568, 414, 568, 445, 62, |
| 164105 | + /* 1380 */ 62, 45, 45, 46, 46, 47, 47, 199, 49, 49, |
| 164106 | + /* 1390 */ 557, 568, 359, 568, 100, 486, 50, 50, 63, 63, |
| 164107 | + /* 1400 */ 64, 64, 561, 415, 535, 410, 568, 1027, 568, 534, |
| 164108 | + /* 1410 */ 316, 559, 316, 559, 65, 65, 14, 14, 568, 1027, |
| 164109 | + /* 1420 */ 568, 512, 932, 872, 1018, 109, 109, 931, 1017, 66, |
| 164110 | + /* 1430 */ 66, 131, 131, 110, 451, 445, 570, 569, 416, 177, |
| 164111 | + /* 1440 */ 1017, 132, 132, 67, 67, 568, 467, 568, 932, 471, |
| 164112 | + /* 1450 */ 1364, 283, 226, 931, 315, 1363, 407, 568, 459, 407, |
| 164113 | + /* 1460 */ 1017, 1017, 1019, 239, 407, 86, 213, 1350, 52, 52, |
| 164114 | + /* 1470 */ 68, 68, 1017, 1017, 1019, 1020, 27, 1585, 1180, 447, |
| 164115 | + /* 1480 */ 69, 69, 288, 97, 108, 1541, 106, 392, 392, 391, |
| 164116 | + /* 1490 */ 273, 389, 568, 879, 849, 883, 568, 111, 560, 466, |
| 164117 | + /* 1500 */ 4, 568, 152, 30, 38, 568, 1132, 234, 396, 323, |
| 164118 | + /* 1510 */ 111, 560, 527, 4, 563, 53, 53, 322, 568, 163, |
| 164119 | + /* 1520 */ 163, 568, 337, 468, 164, 164, 333, 563, 76, 76, |
| 164120 | + /* 1530 */ 568, 289, 1514, 568, 31, 1513, 568, 445, 338, 483, |
| 164121 | + /* 1540 */ 100, 54, 54, 344, 72, 72, 296, 236, 1080, 557, |
| 164122 | + /* 1550 */ 445, 879, 1360, 134, 134, 168, 73, 73, 141, 161, |
| 164123 | + /* 1560 */ 161, 1574, 557, 535, 568, 319, 568, 348, 536, 1009, |
| 164124 | + /* 1570 */ 473, 261, 261, 891, 890, 235, 535, 568, 1027, 568, |
| 164125 | + /* 1580 */ 475, 534, 261, 367, 109, 109, 521, 136, 136, 130, |
| 164126 | + /* 1590 */ 130, 1027, 110, 366, 445, 570, 569, 109, 109, 1017, |
| 164127 | + /* 1600 */ 162, 162, 156, 156, 568, 110, 1080, 445, 570, 569, |
| 164128 | + /* 1610 */ 410, 351, 1017, 568, 353, 316, 559, 568, 343, 568, |
| 164129 | + /* 1620 */ 100, 497, 357, 258, 100, 898, 899, 140, 140, 355, |
| 164130 | + /* 1630 */ 1310, 1017, 1017, 1019, 1020, 27, 139, 139, 362, 451, |
| 164131 | + /* 1640 */ 137, 137, 138, 138, 1017, 1017, 1019, 1020, 27, 1180, |
| 164132 | + /* 1650 */ 447, 568, 372, 288, 111, 560, 1021, 4, 392, 392, |
| 164133 | + /* 1660 */ 391, 273, 389, 568, 1141, 849, 568, 1076, 568, 258, |
| 164134 | + /* 1670 */ 492, 563, 568, 211, 75, 75, 555, 962, 234, 261, |
| 164135 | + /* 1680 */ 323, 111, 560, 929, 4, 113, 77, 77, 322, 74, |
| 164136 | + /* 1690 */ 74, 42, 42, 1373, 445, 48, 48, 1418, 563, 974, |
| 164137 | + /* 1700 */ 975, 1092, 1091, 1092, 1091, 862, 557, 150, 930, 1346, |
| 164138 | + /* 1710 */ 113, 1358, 554, 1424, 1021, 1275, 1266, 1254, 236, 1253, |
| 164139 | + /* 1720 */ 1255, 445, 1593, 1343, 308, 276, 168, 309, 11, 141, |
| 164140 | + /* 1730 */ 393, 310, 232, 557, 1405, 1027, 335, 291, 1400, 219, |
| 164141 | + /* 1740 */ 336, 109, 109, 936, 297, 1410, 235, 341, 477, 110, |
| 164142 | + /* 1750 */ 502, 445, 570, 569, 1393, 1409, 1017, 400, 1293, 365, |
| 164143 | + /* 1760 */ 223, 1486, 1027, 1485, 1355, 1356, 1354, 1353, 109, 109, |
| 164144 | + /* 1770 */ 204, 1596, 1232, 558, 265, 218, 110, 205, 445, 570, |
| 164145 | + /* 1780 */ 569, 410, 387, 1017, 1533, 179, 316, 559, 1017, 1017, |
| 164146 | + /* 1790 */ 1019, 1020, 27, 230, 1531, 1229, 79, 560, 85, 4, |
| 164147 | + /* 1800 */ 418, 215, 548, 81, 84, 188, 1406, 173, 181, 461, |
| 164148 | + /* 1810 */ 451, 35, 462, 563, 183, 1017, 1017, 1019, 1020, 27, |
| 164149 | + /* 1820 */ 184, 1491, 185, 186, 495, 242, 98, 398, 1412, 36, |
| 164150 | + /* 1830 */ 1411, 484, 91, 469, 401, 1414, 445, 192, 1480, 246, |
| 164151 | + /* 1840 */ 1502, 490, 346, 277, 248, 196, 493, 511, 557, 350, |
| 164152 | + /* 1850 */ 1256, 249, 250, 403, 1313, 1312, 111, 560, 432, 4, |
| 164153 | + /* 1860 */ 1311, 1304, 93, 1611, 883, 1610, 224, 404, 434, 520, |
| 164154 | + /* 1870 */ 263, 435, 1579, 563, 1283, 1282, 364, 1027, 306, 1281, |
| 164155 | + /* 1880 */ 264, 1609, 1565, 109, 109, 370, 1303, 307, 1564, 438, |
| 164156 | + /* 1890 */ 128, 110, 1378, 445, 570, 569, 445, 546, 1017, 10, |
| 164157 | + /* 1900 */ 1466, 105, 381, 1377, 34, 572, 99, 1336, 557, 314, |
| 164158 | + /* 1910 */ 1186, 530, 272, 274, 379, 210, 1335, 547, 385, 386, |
| 164159 | + /* 1920 */ 275, 573, 1251, 1246, 411, 412, 1518, 165, 178, 1519, |
| 164160 | + /* 1930 */ 1017, 1017, 1019, 1020, 27, 1517, 1516, 1027, 78, 147, |
| 164161 | + /* 1940 */ 166, 220, 221, 109, 109, 836, 304, 167, 446, 212, |
| 164162 | + /* 1950 */ 318, 110, 231, 445, 570, 569, 144, 1090, 1017, 1088, |
| 164163 | + /* 1960 */ 326, 180, 169, 1212, 182, 334, 238, 915, 241, 1104, |
| 164164 | + /* 1970 */ 187, 170, 171, 421, 87, 88, 423, 189, 89, 90, |
| 164165 | + /* 1980 */ 172, 1107, 243, 1103, 244, 158, 18, 245, 345, 247, |
| 164166 | + /* 1990 */ 1017, 1017, 1019, 1020, 27, 261, 1096, 193, 1226, 489, |
| 164167 | + /* 2000 */ 194, 37, 366, 851, 494, 251, 195, 506, 92, 19, |
| 164168 | + /* 2010 */ 498, 358, 20, 503, 881, 361, 94, 894, 305, 159, |
| 164169 | + /* 2020 */ 513, 39, 95, 1174, 160, 1056, 966, 1143, 96, 174, |
| 164170 | + /* 2030 */ 1142, 225, 280, 282, 198, 960, 113, 1164, 1160, 260, |
| 164171 | + /* 2040 */ 21, 22, 23, 1162, 1168, 1167, 1148, 24, 33, 25, |
| 164172 | + /* 2050 */ 202, 542, 26, 100, 1071, 102, 1057, 103, 7, 1055, |
| 164173 | + /* 2060 */ 1059, 1113, 1060, 1112, 266, 267, 28, 40, 390, 1022, |
| 164174 | + /* 2070 */ 863, 112, 29, 564, 1182, 1181, 268, 176, 143, 925, |
| 164175 | + /* 2080 */ 1242, 1242, 1242, 1242, 1242, 1242, 1242, 1242, 1242, 1242, |
| 164176 | + /* 2090 */ 1242, 1242, 1242, 1242, 269, 1602, 1242, 1601, |
| 163954 | 164177 | }; |
| 163955 | 164178 | static const YYCODETYPE yy_lookahead[] = { |
| 163956 | 164179 | /* 0 */ 193, 193, 193, 274, 275, 276, 193, 274, 275, 276, |
| 163957 | 164180 | /* 10 */ 193, 223, 219, 225, 206, 210, 211, 212, 193, 19, |
| 163958 | 164181 | /* 20 */ 219, 233, 216, 216, 217, 216, 217, 193, 295, 216, |
| | @@ -164114,57 +164337,57 @@ |
| 164114 | 164337 | /* 1580 */ 23, 90, 25, 121, 106, 107, 19, 216, 217, 216, |
| 164115 | 164338 | /* 1590 */ 217, 100, 114, 131, 116, 117, 118, 106, 107, 121, |
| 164116 | 164339 | /* 1600 */ 216, 217, 216, 217, 193, 114, 117, 116, 117, 118, |
| 164117 | 164340 | /* 1610 */ 133, 193, 121, 193, 193, 138, 139, 193, 23, 193, |
| 164118 | 164341 | /* 1620 */ 25, 23, 23, 25, 25, 7, 8, 216, 217, 193, |
| 164119 | | - /* 1630 */ 193, 153, 154, 155, 156, 157, 216, 217, 59, 162, |
| 164342 | + /* 1630 */ 193, 153, 154, 155, 156, 157, 216, 217, 193, 162, |
| 164120 | 164343 | /* 1640 */ 216, 217, 216, 217, 153, 154, 155, 156, 157, 1, |
| 164121 | | - /* 1650 */ 2, 193, 193, 5, 19, 20, 193, 22, 10, 11, |
| 164122 | | - /* 1660 */ 12, 13, 14, 193, 97, 17, 193, 23, 23, 25, |
| 164123 | | - /* 1670 */ 25, 36, 83, 84, 216, 217, 236, 23, 30, 25, |
| 164124 | | - /* 1680 */ 32, 19, 20, 153, 22, 155, 216, 217, 40, 216, |
| 164125 | | - /* 1690 */ 217, 153, 193, 155, 59, 23, 117, 25, 36, 23, |
| 164126 | | - /* 1700 */ 193, 25, 193, 193, 193, 193, 71, 193, 242, 193, |
| 164127 | | - /* 1710 */ 193, 193, 193, 193, 243, 288, 287, 214, 70, 255, |
| 164128 | | - /* 1720 */ 255, 59, 255, 255, 191, 297, 78, 271, 267, 81, |
| 164129 | | - /* 1730 */ 245, 293, 246, 71, 246, 100, 267, 245, 293, 249, |
| 164130 | | - /* 1740 */ 219, 106, 107, 108, 220, 271, 98, 271, 225, 114, |
| 164131 | | - /* 1750 */ 271, 116, 117, 118, 229, 219, 121, 259, 219, 259, |
| 164132 | | - /* 1760 */ 259, 259, 100, 60, 280, 196, 141, 38, 106, 107, |
| 164133 | | - /* 1770 */ 200, 249, 245, 200, 243, 200, 114, 151, 116, 117, |
| 164134 | | - /* 1780 */ 118, 133, 150, 121, 297, 272, 138, 139, 153, 154, |
| 164135 | | - /* 1790 */ 155, 156, 157, 297, 22, 43, 19, 20, 294, 22, |
| 164136 | | - /* 1800 */ 294, 18, 270, 237, 200, 234, 18, 199, 149, 283, |
| 164137 | | - /* 1810 */ 162, 237, 272, 36, 237, 153, 154, 155, 156, 157, |
| 164138 | | - /* 1820 */ 237, 272, 246, 270, 246, 234, 246, 234, 246, 200, |
| 164139 | | - /* 1830 */ 199, 158, 290, 62, 289, 199, 59, 200, 22, 200, |
| 164140 | | - /* 1840 */ 221, 199, 221, 200, 64, 199, 115, 227, 71, 22, |
| 164141 | | - /* 1850 */ 126, 218, 218, 165, 224, 227, 218, 24, 113, 305, |
| 164142 | | - /* 1860 */ 312, 200, 221, 282, 224, 218, 282, 91, 218, 220, |
| 164143 | | - /* 1870 */ 218, 218, 221, 317, 82, 317, 265, 100, 265, 145, |
| 164144 | | - /* 1880 */ 148, 22, 277, 106, 107, 200, 158, 147, 279, 146, |
| 164145 | | - /* 1890 */ 25, 114, 202, 116, 117, 118, 13, 6, 121, 194, |
| 164146 | | - /* 1900 */ 194, 192, 192, 192, 248, 250, 249, 247, 250, 246, |
| 164147 | | - /* 1910 */ 303, 207, 300, 303, 213, 213, 222, 222, 4, 207, |
| 164148 | | - /* 1920 */ 213, 213, 207, 3, 22, 163, 15, 214, 214, 213, |
| 164149 | | - /* 1930 */ 153, 154, 155, 156, 157, 16, 23, 139, 23, 130, |
| 164150 | | - /* 1940 */ 151, 25, 24, 142, 20, 16, 144, 1, 142, 130, |
| 164151 | | - /* 1950 */ 130, 61, 53, 53, 37, 151, 53, 53, 130, 116, |
| 164152 | | - /* 1960 */ 34, 1, 141, 5, 22, 115, 161, 75, 25, 68, |
| 164153 | | - /* 1970 */ 141, 41, 115, 68, 24, 20, 19, 131, 125, 67, |
| 164154 | | - /* 1980 */ 24, 22, 59, 22, 22, 96, 23, 22, 67, 22, |
| 164155 | | - /* 1990 */ 37, 23, 28, 149, 67, 22, 25, 23, 23, 23, |
| 164156 | | - /* 2000 */ 23, 22, 141, 97, 23, 23, 34, 22, 25, 116, |
| 164157 | | - /* 2010 */ 143, 75, 34, 88, 34, 75, 23, 86, 34, 22, |
| 164158 | | - /* 2020 */ 34, 93, 34, 24, 34, 25, 25, 23, 23, 23, |
| 164159 | | - /* 2030 */ 23, 44, 23, 25, 23, 22, 11, 22, 22, 25, |
| 164160 | | - /* 2040 */ 23, 23, 22, 22, 135, 15, 23, 25, 141, 141, |
| 164161 | | - /* 2050 */ 1, 141, 1, 319, 319, 319, 319, 319, 319, 319, |
| 164162 | | - /* 2060 */ 319, 319, 319, 141, 319, 319, 319, 319, 319, 319, |
| 164163 | | - /* 2070 */ 319, 319, 319, 319, 319, 319, 319, 319, 319, 319, |
| 164344 | + /* 1650 */ 2, 193, 193, 5, 19, 20, 59, 22, 10, 11, |
| 164345 | + /* 1660 */ 12, 13, 14, 193, 97, 17, 193, 23, 193, 25, |
| 164346 | + /* 1670 */ 288, 36, 193, 242, 216, 217, 236, 23, 30, 25, |
| 164347 | + /* 1680 */ 32, 19, 20, 23, 22, 25, 216, 217, 40, 216, |
| 164348 | + /* 1690 */ 217, 216, 217, 193, 59, 216, 217, 193, 36, 83, |
| 164349 | + /* 1700 */ 84, 153, 153, 155, 155, 23, 71, 25, 23, 193, |
| 164350 | + /* 1710 */ 25, 193, 193, 193, 117, 193, 193, 193, 70, 193, |
| 164351 | + /* 1720 */ 193, 59, 193, 255, 255, 287, 78, 255, 243, 81, |
| 164352 | + /* 1730 */ 191, 255, 297, 71, 271, 100, 293, 245, 267, 214, |
| 164353 | + /* 1740 */ 246, 106, 107, 108, 246, 271, 98, 245, 293, 114, |
| 164354 | + /* 1750 */ 220, 116, 117, 118, 267, 271, 121, 271, 225, 219, |
| 164355 | + /* 1760 */ 229, 219, 100, 219, 259, 259, 259, 259, 106, 107, |
| 164356 | + /* 1770 */ 249, 196, 60, 280, 141, 243, 114, 249, 116, 117, |
| 164357 | + /* 1780 */ 118, 133, 245, 121, 200, 297, 138, 139, 153, 154, |
| 164358 | + /* 1790 */ 155, 156, 157, 297, 200, 38, 19, 20, 151, 22, |
| 164359 | + /* 1800 */ 200, 150, 140, 294, 294, 22, 272, 43, 234, 18, |
| 164360 | + /* 1810 */ 162, 270, 200, 36, 237, 153, 154, 155, 156, 157, |
| 164361 | + /* 1820 */ 237, 283, 237, 237, 18, 199, 149, 246, 272, 270, |
| 164362 | + /* 1830 */ 272, 200, 158, 246, 246, 234, 59, 234, 246, 199, |
| 164363 | + /* 1840 */ 290, 62, 289, 200, 199, 22, 221, 115, 71, 200, |
| 164364 | + /* 1850 */ 200, 199, 199, 221, 218, 218, 19, 20, 64, 22, |
| 164365 | + /* 1860 */ 218, 227, 22, 224, 126, 224, 165, 221, 24, 305, |
| 164366 | + /* 1870 */ 200, 113, 312, 36, 218, 220, 218, 100, 282, 218, |
| 164367 | + /* 1880 */ 91, 218, 317, 106, 107, 221, 227, 282, 317, 82, |
| 164368 | + /* 1890 */ 148, 114, 265, 116, 117, 118, 59, 145, 121, 22, |
| 164369 | + /* 1900 */ 277, 158, 200, 265, 25, 202, 147, 250, 71, 279, |
| 164370 | + /* 1910 */ 13, 146, 194, 194, 249, 248, 250, 140, 247, 246, |
| 164371 | + /* 1920 */ 6, 192, 192, 192, 303, 303, 213, 207, 300, 213, |
| 164372 | + /* 1930 */ 153, 154, 155, 156, 157, 213, 213, 100, 213, 222, |
| 164373 | + /* 1940 */ 207, 214, 214, 106, 107, 4, 222, 207, 3, 22, |
| 164374 | + /* 1950 */ 163, 114, 15, 116, 117, 118, 16, 23, 121, 23, |
| 164375 | + /* 1960 */ 139, 151, 130, 25, 142, 16, 24, 20, 144, 1, |
| 164376 | + /* 1970 */ 142, 130, 130, 61, 53, 53, 37, 151, 53, 53, |
| 164377 | + /* 1980 */ 130, 116, 34, 1, 141, 5, 22, 115, 161, 141, |
| 164378 | + /* 1990 */ 153, 154, 155, 156, 157, 25, 68, 68, 75, 41, |
| 164379 | + /* 2000 */ 115, 24, 131, 20, 19, 125, 22, 96, 22, 22, |
| 164380 | + /* 2010 */ 67, 23, 22, 67, 59, 24, 22, 28, 67, 23, |
| 164381 | + /* 2020 */ 22, 22, 149, 23, 23, 23, 116, 23, 25, 37, |
| 164382 | + /* 2030 */ 97, 141, 23, 23, 22, 143, 25, 75, 88, 34, |
| 164383 | + /* 2040 */ 34, 34, 34, 86, 75, 93, 23, 34, 22, 34, |
| 164384 | + /* 2050 */ 25, 24, 34, 25, 23, 142, 23, 142, 44, 23, |
| 164385 | + /* 2060 */ 23, 23, 11, 23, 25, 22, 22, 22, 15, 23, |
| 164386 | + /* 2070 */ 23, 22, 22, 25, 1, 1, 141, 25, 23, 135, |
| 164164 | 164387 | /* 2080 */ 319, 319, 319, 319, 319, 319, 319, 319, 319, 319, |
| 164165 | | - /* 2090 */ 319, 319, 319, 319, 319, 319, 319, 319, 319, 319, |
| 164388 | + /* 2090 */ 319, 319, 319, 319, 141, 141, 319, 141, 319, 319, |
| 164166 | 164389 | /* 2100 */ 319, 319, 319, 319, 319, 319, 319, 319, 319, 319, |
| 164167 | 164390 | /* 2110 */ 319, 319, 319, 319, 319, 319, 319, 319, 319, 319, |
| 164168 | 164391 | /* 2120 */ 319, 319, 319, 319, 319, 319, 319, 319, 319, 319, |
| 164169 | 164392 | /* 2130 */ 319, 319, 319, 319, 319, 319, 319, 319, 319, 319, |
| 164170 | 164393 | /* 2140 */ 319, 319, 319, 319, 319, 319, 319, 319, 319, 319, |
| | @@ -164175,77 +164398,82 @@ |
| 164175 | 164398 | /* 2190 */ 319, 319, 319, 319, 319, 319, 319, 319, 319, 319, |
| 164176 | 164399 | /* 2200 */ 319, 319, 319, 319, 319, 319, 319, 319, 319, 319, |
| 164177 | 164400 | /* 2210 */ 319, 319, 319, 319, 319, 319, 319, 319, 319, 319, |
| 164178 | 164401 | /* 2220 */ 319, 319, 319, 319, 319, 319, 319, 319, 319, 319, |
| 164179 | 164402 | /* 2230 */ 319, 319, 319, 319, 319, 319, 319, 319, 319, 319, |
| 164180 | | - /* 2240 */ 319, 319, 319, 319, 319, 319, 319, 319, 319, |
| 164403 | + /* 2240 */ 319, 319, 319, 319, 319, 319, 319, 319, 319, 319, |
| 164404 | + /* 2250 */ 319, 319, 319, 319, 319, 319, 319, 319, 319, 319, |
| 164405 | + /* 2260 */ 319, 319, 319, 319, 319, 319, 319, 319, 319, 319, |
| 164406 | + /* 2270 */ 319, 319, 319, 319, 319, 319, 319, 319, 319, 319, |
| 164407 | + /* 2280 */ 319, 319, 319, |
| 164181 | 164408 | }; |
| 164182 | | -#define YY_SHIFT_COUNT (569) |
| 164409 | +#define YY_SHIFT_COUNT (575) |
| 164183 | 164410 | #define YY_SHIFT_MIN (0) |
| 164184 | | -#define YY_SHIFT_MAX (2051) |
| 164411 | +#define YY_SHIFT_MAX (2074) |
| 164185 | 164412 | static const unsigned short int yy_shift_ofst[] = { |
| 164186 | | - /* 0 */ 1648, 1477, 1272, 322, 322, 1, 1319, 1478, 1491, 1662, |
| 164187 | | - /* 10 */ 1662, 1662, 471, 0, 0, 214, 1093, 1662, 1662, 1662, |
| 164188 | | - /* 20 */ 1662, 1662, 1662, 1662, 1662, 1662, 1662, 1662, 1662, 1662, |
| 164413 | + /* 0 */ 1648, 1477, 1272, 322, 322, 1, 1319, 1478, 1491, 1837, |
| 164414 | + /* 10 */ 1837, 1837, 471, 0, 0, 214, 1093, 1837, 1837, 1837, |
| 164415 | + /* 20 */ 1837, 1837, 1837, 1837, 1837, 1837, 1837, 1837, 1837, 1837, |
| 164189 | 164416 | /* 30 */ 271, 271, 1219, 1219, 216, 88, 1, 1, 1, 1, |
| 164190 | 164417 | /* 40 */ 1, 40, 111, 258, 361, 469, 512, 583, 622, 693, |
| 164191 | 164418 | /* 50 */ 732, 803, 842, 913, 1073, 1093, 1093, 1093, 1093, 1093, |
| 164192 | 164419 | /* 60 */ 1093, 1093, 1093, 1093, 1093, 1093, 1093, 1093, 1093, 1093, |
| 164193 | 164420 | /* 70 */ 1093, 1093, 1093, 1113, 1093, 1216, 957, 957, 1635, 1662, |
| 164194 | | - /* 80 */ 1662, 1662, 1662, 1662, 1662, 1662, 1662, 1662, 1662, 1662, |
| 164195 | | - /* 90 */ 1662, 1662, 1662, 1662, 1662, 1662, 1662, 1662, 1662, 1662, |
| 164196 | | - /* 100 */ 1662, 1662, 1662, 1662, 1662, 1662, 1662, 1662, 1662, 1662, |
| 164197 | | - /* 110 */ 1662, 1662, 1662, 1662, 1777, 1662, 1662, 1662, 1662, 1662, |
| 164198 | | - /* 120 */ 1662, 1662, 1662, 1662, 1662, 1662, 1662, 1662, 137, 181, |
| 164199 | | - /* 130 */ 181, 181, 181, 181, 94, 430, 66, 65, 112, 366, |
| 164200 | | - /* 140 */ 533, 533, 740, 1261, 533, 533, 79, 79, 533, 412, |
| 164201 | | - /* 150 */ 412, 412, 77, 412, 123, 113, 113, 22, 22, 2064, |
| 164202 | | - /* 160 */ 2064, 328, 328, 328, 239, 468, 468, 468, 468, 1015, |
| 164203 | | - /* 170 */ 1015, 409, 366, 1129, 1186, 533, 533, 533, 533, 533, |
| 164421 | + /* 80 */ 1777, 1837, 1837, 1837, 1837, 1837, 1837, 1837, 1837, 1837, |
| 164422 | + /* 90 */ 1837, 1837, 1837, 1837, 1837, 1837, 1837, 1837, 1837, 1837, |
| 164423 | + /* 100 */ 1837, 1837, 1837, 1837, 1837, 1837, 1837, 1837, 1837, 1837, |
| 164424 | + /* 110 */ 1837, 1837, 1837, 1837, 1837, 1837, 1837, 1837, 1837, 1837, |
| 164425 | + /* 120 */ 1837, 1837, 1837, 1837, 1837, 1837, 1837, 1837, 1837, 1837, |
| 164426 | + /* 130 */ 137, 181, 181, 181, 181, 181, 181, 181, 94, 430, |
| 164427 | + /* 140 */ 66, 65, 112, 366, 533, 533, 740, 1261, 533, 533, |
| 164428 | + /* 150 */ 79, 79, 533, 412, 412, 412, 77, 412, 123, 113, |
| 164429 | + /* 160 */ 113, 22, 22, 2098, 2098, 328, 328, 328, 239, 468, |
| 164430 | + /* 170 */ 468, 468, 468, 1015, 1015, 409, 366, 1129, 1186, 533, |
| 164204 | 164431 | /* 180 */ 533, 533, 533, 533, 533, 533, 533, 533, 533, 533, |
| 164205 | | - /* 190 */ 533, 533, 533, 533, 533, 969, 621, 621, 533, 642, |
| 164206 | | - /* 200 */ 788, 788, 1228, 1228, 822, 822, 67, 1274, 2064, 2064, |
| 164207 | | - /* 210 */ 2064, 2064, 2064, 2064, 2064, 1307, 954, 954, 585, 472, |
| 164208 | | - /* 220 */ 640, 387, 695, 538, 541, 700, 533, 533, 533, 533, |
| 164209 | | - /* 230 */ 533, 533, 533, 533, 533, 533, 222, 533, 533, 533, |
| 164210 | | - /* 240 */ 533, 533, 533, 533, 533, 533, 533, 533, 533, 1179, |
| 164211 | | - /* 250 */ 1179, 1179, 533, 533, 533, 565, 533, 533, 533, 916, |
| 164212 | | - /* 260 */ 1144, 533, 533, 1288, 533, 533, 533, 533, 533, 533, |
| 164213 | | - /* 270 */ 533, 533, 639, 1330, 209, 1076, 1076, 1076, 1076, 580, |
| 164214 | | - /* 280 */ 209, 209, 1313, 768, 917, 649, 1181, 1316, 405, 1316, |
| 164215 | | - /* 290 */ 1238, 249, 1181, 1181, 249, 1181, 405, 1238, 1369, 464, |
| 164216 | | - /* 300 */ 1259, 1012, 1012, 1012, 1368, 1368, 1368, 1368, 184, 184, |
| 164217 | | - /* 310 */ 1326, 904, 1287, 1480, 1703, 1703, 1625, 1625, 1729, 1729, |
| 164218 | | - /* 320 */ 1625, 1626, 1632, 1772, 1752, 1783, 1783, 1783, 1783, 1625, |
| 164219 | | - /* 330 */ 1788, 1659, 1632, 1632, 1659, 1772, 1752, 1659, 1752, 1659, |
| 164220 | | - /* 340 */ 1625, 1788, 1673, 1771, 1625, 1788, 1816, 1625, 1788, 1625, |
| 164221 | | - /* 350 */ 1788, 1816, 1731, 1731, 1731, 1780, 1827, 1827, 1816, 1731, |
| 164222 | | - /* 360 */ 1724, 1731, 1780, 1731, 1731, 1688, 1833, 1745, 1745, 1816, |
| 164223 | | - /* 370 */ 1625, 1776, 1776, 1792, 1792, 1732, 1734, 1859, 1625, 1728, |
| 164224 | | - /* 380 */ 1732, 1740, 1743, 1659, 1865, 1883, 1883, 1891, 1891, 1891, |
| 164225 | | - /* 390 */ 2064, 2064, 2064, 2064, 2064, 2064, 2064, 2064, 2064, 2064, |
| 164226 | | - /* 400 */ 2064, 2064, 2064, 2064, 2064, 207, 1095, 331, 620, 903, |
| 164227 | | - /* 410 */ 806, 1074, 1483, 1432, 1481, 1322, 1370, 1394, 1515, 1291, |
| 164228 | | - /* 420 */ 1546, 1547, 1557, 1595, 1598, 1599, 1434, 1453, 1618, 1462, |
| 164229 | | - /* 430 */ 1567, 1489, 1644, 1645, 1589, 1654, 1530, 1538, 1672, 1676, |
| 164230 | | - /* 440 */ 1579, 742, 1914, 1920, 1902, 1762, 1911, 1919, 1913, 1915, |
| 164231 | | - /* 450 */ 1798, 1789, 1809, 1916, 1916, 1918, 1801, 1924, 1802, 1929, |
| 164232 | | - /* 460 */ 1946, 1806, 1819, 1916, 1820, 1890, 1917, 1916, 1804, 1899, |
| 164233 | | - /* 470 */ 1900, 1903, 1904, 1828, 1843, 1926, 1821, 1960, 1958, 1942, |
| 164234 | | - /* 480 */ 1850, 1805, 1901, 1943, 1905, 1892, 1930, 1829, 1857, 1950, |
| 164235 | | - /* 490 */ 1955, 1957, 1846, 1853, 1959, 1912, 1961, 1962, 1963, 1965, |
| 164236 | | - /* 500 */ 1921, 1923, 1956, 1889, 1964, 1967, 1927, 1953, 1968, 1844, |
| 164237 | | - /* 510 */ 1973, 1974, 1975, 1976, 1971, 1977, 1979, 1906, 1861, 1981, |
| 164238 | | - /* 520 */ 1982, 1893, 1972, 1985, 1867, 1983, 1978, 1980, 1984, 1986, |
| 164239 | | - /* 530 */ 1925, 1936, 1931, 1987, 1940, 1928, 1988, 1993, 1997, 1999, |
| 164240 | | - /* 540 */ 2000, 2001, 1990, 2004, 1983, 2005, 2006, 2007, 2009, 2008, |
| 164241 | | - /* 550 */ 2011, 2013, 2025, 2015, 2016, 2017, 2018, 2020, 2021, 2014, |
| 164242 | | - /* 560 */ 1909, 1907, 1908, 1910, 1922, 2022, 2023, 2030, 2049, 2051, |
| 164432 | + /* 190 */ 533, 533, 533, 533, 533, 533, 533, 533, 533, 969, |
| 164433 | + /* 200 */ 621, 621, 533, 642, 788, 788, 1228, 1228, 822, 822, |
| 164434 | + /* 210 */ 67, 1274, 2098, 2098, 2098, 2098, 2098, 2098, 2098, 1307, |
| 164435 | + /* 220 */ 954, 954, 585, 472, 640, 387, 695, 538, 541, 700, |
| 164436 | + /* 230 */ 533, 533, 533, 533, 533, 533, 533, 533, 533, 533, |
| 164437 | + /* 240 */ 222, 533, 533, 533, 533, 533, 533, 533, 533, 533, |
| 164438 | + /* 250 */ 533, 533, 533, 1179, 1179, 1179, 533, 533, 533, 565, |
| 164439 | + /* 260 */ 533, 533, 533, 916, 1144, 533, 533, 1288, 533, 533, |
| 164440 | + /* 270 */ 533, 533, 533, 533, 533, 533, 639, 1330, 209, 1076, |
| 164441 | + /* 280 */ 1076, 1076, 1076, 580, 209, 209, 1313, 768, 917, 649, |
| 164442 | + /* 290 */ 1181, 1316, 405, 1316, 1238, 249, 1181, 1181, 249, 1181, |
| 164443 | + /* 300 */ 405, 1238, 1369, 464, 1259, 1012, 1012, 1012, 1368, 1368, |
| 164444 | + /* 310 */ 1368, 1368, 184, 184, 1326, 904, 1287, 1480, 1712, 1712, |
| 164445 | + /* 320 */ 1633, 1633, 1757, 1757, 1633, 1647, 1651, 1783, 1764, 1791, |
| 164446 | + /* 330 */ 1791, 1791, 1791, 1633, 1806, 1677, 1651, 1651, 1677, 1783, |
| 164447 | + /* 340 */ 1764, 1677, 1764, 1677, 1633, 1806, 1674, 1779, 1633, 1806, |
| 164448 | + /* 350 */ 1823, 1633, 1806, 1633, 1806, 1823, 1732, 1732, 1732, 1794, |
| 164449 | + /* 360 */ 1840, 1840, 1823, 1732, 1738, 1732, 1794, 1732, 1732, 1701, |
| 164450 | + /* 370 */ 1844, 1758, 1758, 1823, 1633, 1789, 1789, 1807, 1807, 1742, |
| 164451 | + /* 380 */ 1752, 1877, 1633, 1743, 1742, 1759, 1765, 1677, 1879, 1897, |
| 164452 | + /* 390 */ 1897, 1914, 1914, 1914, 2098, 2098, 2098, 2098, 2098, 2098, |
| 164453 | + /* 400 */ 2098, 2098, 2098, 2098, 2098, 2098, 2098, 2098, 2098, 207, |
| 164454 | + /* 410 */ 1095, 331, 620, 903, 806, 1074, 1483, 1432, 1481, 1322, |
| 164455 | + /* 420 */ 1370, 1394, 1515, 1291, 1546, 1547, 1557, 1595, 1598, 1599, |
| 164456 | + /* 430 */ 1434, 1453, 1618, 1462, 1567, 1489, 1644, 1654, 1616, 1660, |
| 164457 | + /* 440 */ 1548, 1549, 1682, 1685, 1597, 742, 1941, 1945, 1927, 1787, |
| 164458 | + /* 450 */ 1937, 1940, 1934, 1936, 1821, 1810, 1832, 1938, 1938, 1942, |
| 164459 | + /* 460 */ 1822, 1947, 1824, 1949, 1968, 1828, 1841, 1938, 1842, 1912, |
| 164460 | + /* 470 */ 1939, 1938, 1826, 1921, 1922, 1925, 1926, 1850, 1865, 1948, |
| 164461 | + /* 480 */ 1843, 1982, 1980, 1964, 1872, 1827, 1928, 1970, 1929, 1923, |
| 164462 | + /* 490 */ 1958, 1848, 1885, 1977, 1983, 1985, 1871, 1880, 1984, 1943, |
| 164463 | + /* 500 */ 1986, 1987, 1988, 1990, 1946, 1955, 1991, 1911, 1989, 1994, |
| 164464 | + /* 510 */ 1951, 1992, 1996, 1873, 1998, 2000, 2001, 2002, 2003, 2004, |
| 164465 | + /* 520 */ 1999, 1933, 1890, 2009, 2010, 1910, 2005, 2012, 1892, 2011, |
| 164466 | + /* 530 */ 2006, 2007, 2008, 2013, 1950, 1962, 1957, 2014, 1969, 1952, |
| 164467 | + /* 540 */ 2015, 2023, 2026, 2027, 2025, 2028, 2018, 1913, 1915, 2031, |
| 164468 | + /* 550 */ 2011, 2033, 2036, 2037, 2038, 2039, 2040, 2043, 2051, 2044, |
| 164469 | + /* 560 */ 2045, 2046, 2047, 2049, 2050, 2048, 1944, 1935, 1953, 1954, |
| 164470 | + /* 570 */ 1956, 2052, 2055, 2053, 2073, 2074, |
| 164243 | 164471 | }; |
| 164244 | | -#define YY_REDUCE_COUNT (404) |
| 164472 | +#define YY_REDUCE_COUNT (408) |
| 164245 | 164473 | #define YY_REDUCE_MIN (-271) |
| 164246 | | -#define YY_REDUCE_MAX (1716) |
| 164474 | +#define YY_REDUCE_MAX (1740) |
| 164247 | 164475 | static const short yy_reduce_ofst[] = { |
| 164248 | 164476 | /* 0 */ -125, 733, 789, 241, 293, -123, -193, -191, -183, -187, |
| 164249 | 164477 | /* 10 */ 166, 238, 133, -207, -199, -267, -176, -6, 204, 489, |
| 164250 | 164478 | /* 20 */ 576, -175, 598, 686, 615, 725, 860, 778, 781, 857, |
| 164251 | 164479 | /* 30 */ 616, 887, 87, 240, -192, 408, 626, 796, 843, 854, |
| | @@ -164255,98 +164483,99 @@ |
| 164255 | 164483 | /* 70 */ -271, -271, -271, -271, -271, -271, -271, -271, 80, 83, |
| 164256 | 164484 | /* 80 */ 313, 886, 888, 996, 1034, 1059, 1081, 1100, 1117, 1152, |
| 164257 | 164485 | /* 90 */ 1155, 1163, 1165, 1167, 1169, 1172, 1180, 1182, 1184, 1198, |
| 164258 | 164486 | /* 100 */ 1200, 1213, 1215, 1225, 1227, 1252, 1254, 1264, 1299, 1303, |
| 164259 | 164487 | /* 110 */ 1308, 1312, 1325, 1328, 1337, 1340, 1343, 1371, 1373, 1384, |
| 164260 | | - /* 120 */ 1386, 1411, 1420, 1424, 1426, 1458, 1470, 1473, -271, -271, |
| 164261 | | - /* 130 */ -271, -271, -271, -271, -271, -271, -271, 138, 459, 396, |
| 164262 | | - /* 140 */ -158, 470, 302, -212, 521, 201, -195, -92, 559, 630, |
| 164263 | | - /* 150 */ 632, 630, -271, 632, 901, 63, 407, -271, -271, -271, |
| 164264 | | - /* 160 */ -271, 161, 161, 161, 251, 335, 847, 960, 980, 537, |
| 164265 | | - /* 170 */ 588, 618, 628, 688, 688, -166, -161, 674, 790, 794, |
| 164266 | | - /* 180 */ 799, 851, 852, -122, 680, -120, 995, 1038, 415, 1051, |
| 164267 | | - /* 190 */ 893, 798, 962, 400, 1086, 779, 923, 924, 263, 1041, |
| 164268 | | - /* 200 */ 979, 990, 1083, 1097, 1031, 1194, 362, 994, 1139, 1005, |
| 164269 | | - /* 210 */ 1037, 1202, 1205, 1195, 1210, -194, 56, 185, -135, 232, |
| 164270 | | - /* 220 */ 522, 560, 601, 617, 669, 683, 711, 856, 908, 941, |
| 164271 | | - /* 230 */ 1048, 1101, 1147, 1257, 1262, 1265, 392, 1292, 1333, 1339, |
| 164272 | | - /* 240 */ 1342, 1346, 1350, 1359, 1374, 1418, 1421, 1436, 1437, 593, |
| 164273 | | - /* 250 */ 755, 770, 997, 1459, 1463, 1209, 1499, 1507, 1509, 1132, |
| 164274 | | - /* 260 */ 1243, 1510, 1511, 1440, 1512, 560, 1514, 1516, 1517, 1518, |
| 164275 | | - /* 270 */ 1519, 1520, 1427, 1429, 1466, 1464, 1465, 1467, 1468, 1209, |
| 164276 | | - /* 280 */ 1466, 1466, 1471, 1503, 1533, 1428, 1456, 1461, 1485, 1469, |
| 164277 | | - /* 290 */ 1438, 1486, 1474, 1476, 1488, 1479, 1492, 1445, 1524, 1525, |
| 164278 | | - /* 300 */ 1523, 1521, 1536, 1539, 1498, 1500, 1501, 1502, 1490, 1522, |
| 164279 | | - /* 310 */ 1484, 1527, 1531, 1569, 1487, 1496, 1570, 1573, 1504, 1506, |
| 164280 | | - /* 320 */ 1575, 1526, 1513, 1532, 1571, 1566, 1574, 1577, 1583, 1604, |
| 164281 | | - /* 330 */ 1608, 1576, 1540, 1549, 1578, 1553, 1591, 1580, 1593, 1582, |
| 164282 | | - /* 340 */ 1629, 1631, 1542, 1545, 1637, 1636, 1619, 1639, 1642, 1643, |
| 164283 | | - /* 350 */ 1646, 1621, 1633, 1634, 1638, 1620, 1630, 1640, 1641, 1647, |
| 164284 | | - /* 360 */ 1649, 1650, 1628, 1652, 1653, 1548, 1554, 1581, 1584, 1651, |
| 164285 | | - /* 370 */ 1661, 1556, 1558, 1611, 1613, 1655, 1657, 1605, 1685, 1609, |
| 164286 | | - /* 380 */ 1658, 1656, 1660, 1663, 1690, 1705, 1706, 1709, 1710, 1711, |
| 164287 | | - /* 390 */ 1607, 1610, 1612, 1704, 1701, 1702, 1707, 1708, 1712, 1694, |
| 164288 | | - /* 400 */ 1695, 1713, 1714, 1716, 1715, |
| 164488 | + /* 120 */ 1386, 1411, 1420, 1424, 1426, 1458, 1470, 1473, 1475, 1479, |
| 164489 | + /* 130 */ -271, -271, -271, -271, -271, -271, -271, -271, -271, -271, |
| 164490 | + /* 140 */ -271, 138, 459, 396, -158, 470, 302, -212, 521, 201, |
| 164491 | + /* 150 */ -195, -92, 559, 630, 632, 630, -271, 632, 901, 63, |
| 164492 | + /* 160 */ 407, -271, -271, -271, -271, 161, 161, 161, 251, 335, |
| 164493 | + /* 170 */ 847, 960, 980, 537, 588, 618, 628, 688, 688, -166, |
| 164494 | + /* 180 */ -161, 674, 790, 794, 799, 851, 852, -122, 680, -120, |
| 164495 | + /* 190 */ 995, 1038, 415, 1051, 893, 798, 962, 400, 1086, 779, |
| 164496 | + /* 200 */ 923, 924, 263, 1041, 979, 990, 1083, 1097, 1031, 1194, |
| 164497 | + /* 210 */ 362, 994, 1139, 1005, 1037, 1202, 1205, 1195, 1210, -194, |
| 164498 | + /* 220 */ 56, 185, -135, 232, 522, 560, 601, 617, 669, 683, |
| 164499 | + /* 230 */ 711, 856, 908, 941, 1048, 1101, 1147, 1257, 1262, 1265, |
| 164500 | + /* 240 */ 392, 1292, 1333, 1339, 1342, 1346, 1350, 1359, 1374, 1418, |
| 164501 | + /* 250 */ 1421, 1436, 1437, 593, 755, 770, 997, 1445, 1459, 1209, |
| 164502 | + /* 260 */ 1500, 1504, 1516, 1132, 1243, 1518, 1519, 1440, 1520, 560, |
| 164503 | + /* 270 */ 1522, 1523, 1524, 1526, 1527, 1529, 1382, 1438, 1431, 1468, |
| 164504 | + /* 280 */ 1469, 1472, 1476, 1209, 1431, 1431, 1485, 1525, 1539, 1435, |
| 164505 | + /* 290 */ 1463, 1471, 1492, 1487, 1443, 1494, 1474, 1484, 1498, 1486, |
| 164506 | + /* 300 */ 1502, 1455, 1530, 1531, 1533, 1540, 1542, 1544, 1505, 1506, |
| 164507 | + /* 310 */ 1507, 1508, 1521, 1528, 1493, 1537, 1532, 1575, 1488, 1496, |
| 164508 | + /* 320 */ 1584, 1594, 1509, 1510, 1600, 1538, 1534, 1541, 1574, 1577, |
| 164509 | + /* 330 */ 1583, 1585, 1586, 1612, 1626, 1581, 1556, 1558, 1587, 1559, |
| 164510 | + /* 340 */ 1601, 1588, 1603, 1592, 1631, 1640, 1550, 1553, 1643, 1645, |
| 164511 | + /* 350 */ 1625, 1649, 1652, 1650, 1653, 1632, 1636, 1637, 1642, 1634, |
| 164512 | + /* 360 */ 1639, 1641, 1646, 1656, 1655, 1658, 1659, 1661, 1663, 1560, |
| 164513 | + /* 370 */ 1564, 1596, 1605, 1664, 1670, 1565, 1571, 1627, 1638, 1657, |
| 164514 | + /* 380 */ 1665, 1623, 1702, 1630, 1666, 1667, 1671, 1673, 1703, 1718, |
| 164515 | + /* 390 */ 1719, 1729, 1730, 1731, 1621, 1622, 1628, 1720, 1713, 1716, |
| 164516 | + /* 400 */ 1722, 1723, 1733, 1717, 1724, 1727, 1728, 1725, 1740, |
| 164289 | 164517 | }; |
| 164290 | 164518 | static const YYACTIONTYPE yy_default[] = { |
| 164291 | | - /* 0 */ 1637, 1637, 1637, 1465, 1232, 1343, 1232, 1232, 1232, 1465, |
| 164292 | | - /* 10 */ 1465, 1465, 1232, 1373, 1373, 1518, 1265, 1232, 1232, 1232, |
| 164293 | | - /* 20 */ 1232, 1232, 1232, 1232, 1232, 1232, 1232, 1464, 1232, 1232, |
| 164294 | | - /* 30 */ 1232, 1232, 1553, 1553, 1232, 1232, 1232, 1232, 1232, 1232, |
| 164295 | | - /* 40 */ 1232, 1232, 1382, 1232, 1389, 1232, 1232, 1232, 1232, 1232, |
| 164296 | | - /* 50 */ 1466, 1467, 1232, 1232, 1232, 1517, 1519, 1482, 1396, 1395, |
| 164297 | | - /* 60 */ 1394, 1393, 1500, 1361, 1387, 1380, 1384, 1460, 1461, 1459, |
| 164298 | | - /* 70 */ 1463, 1467, 1466, 1232, 1383, 1430, 1444, 1429, 1232, 1232, |
| 164299 | | - /* 80 */ 1232, 1232, 1232, 1232, 1232, 1232, 1232, 1232, 1232, 1232, |
| 164300 | | - /* 90 */ 1232, 1232, 1232, 1232, 1232, 1232, 1232, 1232, 1232, 1232, |
| 164301 | | - /* 100 */ 1232, 1232, 1232, 1232, 1232, 1232, 1232, 1232, 1232, 1232, |
| 164302 | | - /* 110 */ 1232, 1232, 1232, 1232, 1232, 1232, 1232, 1232, 1232, 1232, |
| 164303 | | - /* 120 */ 1232, 1232, 1232, 1232, 1232, 1232, 1232, 1232, 1438, 1443, |
| 164304 | | - /* 130 */ 1450, 1442, 1439, 1432, 1431, 1433, 1434, 1232, 1232, 1256, |
| 164305 | | - /* 140 */ 1232, 1232, 1253, 1307, 1232, 1232, 1232, 1232, 1232, 1537, |
| 164306 | | - /* 150 */ 1536, 1232, 1435, 1232, 1265, 1424, 1423, 1447, 1436, 1446, |
| 164307 | | - /* 160 */ 1445, 1525, 1589, 1588, 1483, 1232, 1232, 1232, 1232, 1232, |
| 164308 | | - /* 170 */ 1232, 1553, 1232, 1232, 1232, 1232, 1232, 1232, 1232, 1232, |
| 164309 | | - /* 180 */ 1232, 1232, 1232, 1232, 1232, 1232, 1232, 1232, 1232, 1232, |
| 164310 | | - /* 190 */ 1232, 1232, 1232, 1232, 1232, 1363, 1553, 1553, 1232, 1265, |
| 164311 | | - /* 200 */ 1553, 1553, 1364, 1364, 1261, 1261, 1367, 1232, 1532, 1334, |
| 164312 | | - /* 210 */ 1334, 1334, 1334, 1343, 1334, 1232, 1232, 1232, 1232, 1232, |
| 164313 | | - /* 220 */ 1232, 1232, 1232, 1232, 1232, 1232, 1232, 1232, 1232, 1232, |
| 164314 | | - /* 230 */ 1522, 1520, 1232, 1232, 1232, 1232, 1232, 1232, 1232, 1232, |
| 164315 | | - /* 240 */ 1232, 1232, 1232, 1232, 1232, 1232, 1232, 1232, 1232, 1232, |
| 164316 | | - /* 250 */ 1232, 1232, 1232, 1232, 1232, 1232, 1232, 1232, 1232, 1339, |
| 164317 | | - /* 260 */ 1232, 1232, 1232, 1232, 1232, 1232, 1232, 1232, 1232, 1232, |
| 164318 | | - /* 270 */ 1232, 1582, 1232, 1495, 1321, 1339, 1339, 1339, 1339, 1341, |
| 164319 | | - /* 280 */ 1322, 1320, 1333, 1266, 1239, 1629, 1399, 1388, 1340, 1388, |
| 164320 | | - /* 290 */ 1626, 1386, 1399, 1399, 1386, 1399, 1340, 1626, 1282, 1605, |
| 164321 | | - /* 300 */ 1277, 1373, 1373, 1373, 1363, 1363, 1363, 1363, 1367, 1367, |
| 164322 | | - /* 310 */ 1462, 1340, 1333, 1232, 1629, 1629, 1349, 1349, 1628, 1628, |
| 164323 | | - /* 320 */ 1349, 1483, 1613, 1408, 1310, 1316, 1316, 1316, 1316, 1349, |
| 164324 | | - /* 330 */ 1250, 1386, 1613, 1613, 1386, 1408, 1310, 1386, 1310, 1386, |
| 164325 | | - /* 340 */ 1349, 1250, 1499, 1623, 1349, 1250, 1473, 1349, 1250, 1349, |
| 164326 | | - /* 350 */ 1250, 1473, 1308, 1308, 1308, 1297, 1232, 1232, 1473, 1308, |
| 164327 | | - /* 360 */ 1282, 1308, 1297, 1308, 1308, 1571, 1232, 1477, 1477, 1473, |
| 164328 | | - /* 370 */ 1349, 1563, 1563, 1376, 1376, 1381, 1367, 1468, 1349, 1232, |
| 164329 | | - /* 380 */ 1381, 1379, 1377, 1386, 1300, 1585, 1585, 1581, 1581, 1581, |
| 164330 | | - /* 390 */ 1634, 1634, 1532, 1598, 1265, 1265, 1265, 1265, 1598, 1284, |
| 164331 | | - /* 400 */ 1284, 1266, 1266, 1265, 1598, 1232, 1232, 1232, 1232, 1232, |
| 164332 | | - /* 410 */ 1232, 1593, 1232, 1527, 1484, 1353, 1232, 1232, 1232, 1232, |
| 164333 | | - /* 420 */ 1232, 1232, 1232, 1232, 1232, 1232, 1232, 1232, 1232, 1232, |
| 164334 | | - /* 430 */ 1538, 1232, 1232, 1232, 1232, 1232, 1232, 1232, 1232, 1232, |
| 164335 | | - /* 440 */ 1232, 1413, 1232, 1235, 1529, 1232, 1232, 1232, 1232, 1232, |
| 164336 | | - /* 450 */ 1232, 1232, 1232, 1390, 1391, 1354, 1232, 1232, 1232, 1232, |
| 164337 | | - /* 460 */ 1232, 1232, 1232, 1405, 1232, 1232, 1232, 1400, 1232, 1232, |
| 164338 | | - /* 470 */ 1232, 1232, 1232, 1232, 1232, 1232, 1625, 1232, 1232, 1232, |
| 164339 | | - /* 480 */ 1232, 1232, 1232, 1498, 1497, 1232, 1232, 1351, 1232, 1232, |
| 164340 | | - /* 490 */ 1232, 1232, 1232, 1232, 1232, 1232, 1232, 1232, 1232, 1232, |
| 164341 | | - /* 500 */ 1232, 1280, 1232, 1232, 1232, 1232, 1232, 1232, 1232, 1232, |
| 164342 | | - /* 510 */ 1232, 1232, 1232, 1232, 1232, 1232, 1232, 1232, 1232, 1232, |
| 164343 | | - /* 520 */ 1232, 1232, 1232, 1232, 1232, 1378, 1232, 1232, 1232, 1232, |
| 164344 | | - /* 530 */ 1232, 1232, 1232, 1232, 1232, 1232, 1232, 1232, 1232, 1232, |
| 164345 | | - /* 540 */ 1568, 1368, 1232, 1232, 1616, 1232, 1232, 1232, 1232, 1232, |
| 164346 | | - /* 550 */ 1232, 1232, 1232, 1232, 1232, 1232, 1232, 1232, 1232, 1609, |
| 164347 | | - /* 560 */ 1324, 1415, 1232, 1414, 1418, 1254, 1232, 1244, 1232, 1232, |
| 164519 | + /* 0 */ 1647, 1647, 1647, 1475, 1240, 1351, 1240, 1240, 1240, 1475, |
| 164520 | + /* 10 */ 1475, 1475, 1240, 1381, 1381, 1528, 1273, 1240, 1240, 1240, |
| 164521 | + /* 20 */ 1240, 1240, 1240, 1240, 1240, 1240, 1240, 1474, 1240, 1240, |
| 164522 | + /* 30 */ 1240, 1240, 1563, 1563, 1240, 1240, 1240, 1240, 1240, 1240, |
| 164523 | + /* 40 */ 1240, 1240, 1390, 1240, 1397, 1240, 1240, 1240, 1240, 1240, |
| 164524 | + /* 50 */ 1476, 1477, 1240, 1240, 1240, 1527, 1529, 1492, 1404, 1403, |
| 164525 | + /* 60 */ 1402, 1401, 1510, 1369, 1395, 1388, 1392, 1470, 1471, 1469, |
| 164526 | + /* 70 */ 1473, 1477, 1476, 1240, 1391, 1438, 1454, 1437, 1240, 1240, |
| 164527 | + /* 80 */ 1240, 1240, 1240, 1240, 1240, 1240, 1240, 1240, 1240, 1240, |
| 164528 | + /* 90 */ 1240, 1240, 1240, 1240, 1240, 1240, 1240, 1240, 1240, 1240, |
| 164529 | + /* 100 */ 1240, 1240, 1240, 1240, 1240, 1240, 1240, 1240, 1240, 1240, |
| 164530 | + /* 110 */ 1240, 1240, 1240, 1240, 1240, 1240, 1240, 1240, 1240, 1240, |
| 164531 | + /* 120 */ 1240, 1240, 1240, 1240, 1240, 1240, 1240, 1240, 1240, 1240, |
| 164532 | + /* 130 */ 1446, 1453, 1452, 1451, 1460, 1450, 1447, 1440, 1439, 1441, |
| 164533 | + /* 140 */ 1442, 1240, 1240, 1264, 1240, 1240, 1261, 1315, 1240, 1240, |
| 164534 | + /* 150 */ 1240, 1240, 1240, 1547, 1546, 1240, 1443, 1240, 1273, 1432, |
| 164535 | + /* 160 */ 1431, 1457, 1444, 1456, 1455, 1535, 1599, 1598, 1493, 1240, |
| 164536 | + /* 170 */ 1240, 1240, 1240, 1240, 1240, 1563, 1240, 1240, 1240, 1240, |
| 164537 | + /* 180 */ 1240, 1240, 1240, 1240, 1240, 1240, 1240, 1240, 1240, 1240, |
| 164538 | + /* 190 */ 1240, 1240, 1240, 1240, 1240, 1240, 1240, 1240, 1240, 1371, |
| 164539 | + /* 200 */ 1563, 1563, 1240, 1273, 1563, 1563, 1372, 1372, 1269, 1269, |
| 164540 | + /* 210 */ 1375, 1240, 1542, 1342, 1342, 1342, 1342, 1351, 1342, 1240, |
| 164541 | + /* 220 */ 1240, 1240, 1240, 1240, 1240, 1240, 1240, 1240, 1240, 1240, |
| 164542 | + /* 230 */ 1240, 1240, 1240, 1240, 1532, 1530, 1240, 1240, 1240, 1240, |
| 164543 | + /* 240 */ 1240, 1240, 1240, 1240, 1240, 1240, 1240, 1240, 1240, 1240, |
| 164544 | + /* 250 */ 1240, 1240, 1240, 1240, 1240, 1240, 1240, 1240, 1240, 1240, |
| 164545 | + /* 260 */ 1240, 1240, 1240, 1347, 1240, 1240, 1240, 1240, 1240, 1240, |
| 164546 | + /* 270 */ 1240, 1240, 1240, 1240, 1240, 1592, 1240, 1505, 1329, 1347, |
| 164547 | + /* 280 */ 1347, 1347, 1347, 1349, 1330, 1328, 1341, 1274, 1247, 1639, |
| 164548 | + /* 290 */ 1407, 1396, 1348, 1396, 1636, 1394, 1407, 1407, 1394, 1407, |
| 164549 | + /* 300 */ 1348, 1636, 1290, 1615, 1285, 1381, 1381, 1381, 1371, 1371, |
| 164550 | + /* 310 */ 1371, 1371, 1375, 1375, 1472, 1348, 1341, 1240, 1639, 1639, |
| 164551 | + /* 320 */ 1357, 1357, 1638, 1638, 1357, 1493, 1623, 1416, 1318, 1324, |
| 164552 | + /* 330 */ 1324, 1324, 1324, 1357, 1258, 1394, 1623, 1623, 1394, 1416, |
| 164553 | + /* 340 */ 1318, 1394, 1318, 1394, 1357, 1258, 1509, 1633, 1357, 1258, |
| 164554 | + /* 350 */ 1483, 1357, 1258, 1357, 1258, 1483, 1316, 1316, 1316, 1305, |
| 164555 | + /* 360 */ 1240, 1240, 1483, 1316, 1290, 1316, 1305, 1316, 1316, 1581, |
| 164556 | + /* 370 */ 1240, 1487, 1487, 1483, 1357, 1573, 1573, 1384, 1384, 1389, |
| 164557 | + /* 380 */ 1375, 1478, 1357, 1240, 1389, 1387, 1385, 1394, 1308, 1595, |
| 164558 | + /* 390 */ 1595, 1591, 1591, 1591, 1644, 1644, 1542, 1608, 1273, 1273, |
| 164559 | + /* 400 */ 1273, 1273, 1608, 1292, 1292, 1274, 1274, 1273, 1608, 1240, |
| 164560 | + /* 410 */ 1240, 1240, 1240, 1240, 1240, 1603, 1240, 1537, 1494, 1361, |
| 164561 | + /* 420 */ 1240, 1240, 1240, 1240, 1240, 1240, 1240, 1240, 1240, 1240, |
| 164562 | + /* 430 */ 1240, 1240, 1240, 1240, 1548, 1240, 1240, 1240, 1240, 1240, |
| 164563 | + /* 440 */ 1240, 1240, 1240, 1240, 1240, 1421, 1240, 1243, 1539, 1240, |
| 164564 | + /* 450 */ 1240, 1240, 1240, 1240, 1240, 1240, 1240, 1398, 1399, 1362, |
| 164565 | + /* 460 */ 1240, 1240, 1240, 1240, 1240, 1240, 1240, 1413, 1240, 1240, |
| 164566 | + /* 470 */ 1240, 1408, 1240, 1240, 1240, 1240, 1240, 1240, 1240, 1240, |
| 164567 | + /* 480 */ 1635, 1240, 1240, 1240, 1240, 1240, 1240, 1508, 1507, 1240, |
| 164568 | + /* 490 */ 1240, 1359, 1240, 1240, 1240, 1240, 1240, 1240, 1240, 1240, |
| 164569 | + /* 500 */ 1240, 1240, 1240, 1240, 1240, 1288, 1240, 1240, 1240, 1240, |
| 164570 | + /* 510 */ 1240, 1240, 1240, 1240, 1240, 1240, 1240, 1240, 1240, 1240, |
| 164571 | + /* 520 */ 1240, 1240, 1240, 1240, 1240, 1240, 1240, 1240, 1240, 1386, |
| 164572 | + /* 530 */ 1240, 1240, 1240, 1240, 1240, 1240, 1240, 1240, 1240, 1240, |
| 164573 | + /* 540 */ 1240, 1240, 1240, 1240, 1578, 1376, 1240, 1240, 1240, 1240, |
| 164574 | + /* 550 */ 1626, 1240, 1240, 1240, 1240, 1240, 1240, 1240, 1240, 1240, |
| 164575 | + /* 560 */ 1240, 1240, 1240, 1240, 1240, 1619, 1332, 1423, 1240, 1422, |
| 164576 | + /* 570 */ 1426, 1262, 1240, 1252, 1240, 1240, |
| 164348 | 164577 | }; |
| 164349 | 164578 | /********** End of lemon-generated parsing tables *****************************/ |
| 164350 | 164579 | |
| 164351 | 164580 | /* The next table maps tokens (terminal symbols) into fallback tokens. |
| 164352 | 164581 | ** If a construct like the following: |
| | @@ -165170,204 +165399,206 @@ |
| 165170 | 165399 | /* 204 */ "expr ::= expr likeop expr ESCAPE expr", |
| 165171 | 165400 | /* 205 */ "expr ::= expr ISNULL|NOTNULL", |
| 165172 | 165401 | /* 206 */ "expr ::= expr NOT NULL", |
| 165173 | 165402 | /* 207 */ "expr ::= expr IS expr", |
| 165174 | 165403 | /* 208 */ "expr ::= expr IS NOT expr", |
| 165175 | | - /* 209 */ "expr ::= NOT expr", |
| 165176 | | - /* 210 */ "expr ::= BITNOT expr", |
| 165177 | | - /* 211 */ "expr ::= PLUS|MINUS expr", |
| 165178 | | - /* 212 */ "expr ::= expr PTR expr", |
| 165179 | | - /* 213 */ "between_op ::= BETWEEN", |
| 165180 | | - /* 214 */ "between_op ::= NOT BETWEEN", |
| 165181 | | - /* 215 */ "expr ::= expr between_op expr AND expr", |
| 165182 | | - /* 216 */ "in_op ::= IN", |
| 165183 | | - /* 217 */ "in_op ::= NOT IN", |
| 165184 | | - /* 218 */ "expr ::= expr in_op LP exprlist RP", |
| 165185 | | - /* 219 */ "expr ::= LP select RP", |
| 165186 | | - /* 220 */ "expr ::= expr in_op LP select RP", |
| 165187 | | - /* 221 */ "expr ::= expr in_op nm dbnm paren_exprlist", |
| 165188 | | - /* 222 */ "expr ::= EXISTS LP select RP", |
| 165189 | | - /* 223 */ "expr ::= CASE case_operand case_exprlist case_else END", |
| 165190 | | - /* 224 */ "case_exprlist ::= case_exprlist WHEN expr THEN expr", |
| 165191 | | - /* 225 */ "case_exprlist ::= WHEN expr THEN expr", |
| 165192 | | - /* 226 */ "case_else ::= ELSE expr", |
| 165193 | | - /* 227 */ "case_else ::=", |
| 165194 | | - /* 228 */ "case_operand ::= expr", |
| 165195 | | - /* 229 */ "case_operand ::=", |
| 165196 | | - /* 230 */ "exprlist ::=", |
| 165197 | | - /* 231 */ "nexprlist ::= nexprlist COMMA expr", |
| 165198 | | - /* 232 */ "nexprlist ::= expr", |
| 165199 | | - /* 233 */ "paren_exprlist ::=", |
| 165200 | | - /* 234 */ "paren_exprlist ::= LP exprlist RP", |
| 165201 | | - /* 235 */ "cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP sortlist RP where_opt", |
| 165202 | | - /* 236 */ "uniqueflag ::= UNIQUE", |
| 165203 | | - /* 237 */ "uniqueflag ::=", |
| 165204 | | - /* 238 */ "eidlist_opt ::=", |
| 165205 | | - /* 239 */ "eidlist_opt ::= LP eidlist RP", |
| 165206 | | - /* 240 */ "eidlist ::= eidlist COMMA nm collate sortorder", |
| 165207 | | - /* 241 */ "eidlist ::= nm collate sortorder", |
| 165208 | | - /* 242 */ "collate ::=", |
| 165209 | | - /* 243 */ "collate ::= COLLATE ID|STRING", |
| 165210 | | - /* 244 */ "cmd ::= DROP INDEX ifexists fullname", |
| 165211 | | - /* 245 */ "cmd ::= VACUUM vinto", |
| 165212 | | - /* 246 */ "cmd ::= VACUUM nm vinto", |
| 165213 | | - /* 247 */ "vinto ::= INTO expr", |
| 165214 | | - /* 248 */ "vinto ::=", |
| 165215 | | - /* 249 */ "cmd ::= PRAGMA nm dbnm", |
| 165216 | | - /* 250 */ "cmd ::= PRAGMA nm dbnm EQ nmnum", |
| 165217 | | - /* 251 */ "cmd ::= PRAGMA nm dbnm LP nmnum RP", |
| 165218 | | - /* 252 */ "cmd ::= PRAGMA nm dbnm EQ minus_num", |
| 165219 | | - /* 253 */ "cmd ::= PRAGMA nm dbnm LP minus_num RP", |
| 165220 | | - /* 254 */ "plus_num ::= PLUS INTEGER|FLOAT", |
| 165221 | | - /* 255 */ "minus_num ::= MINUS INTEGER|FLOAT", |
| 165222 | | - /* 256 */ "cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END", |
| 165223 | | - /* 257 */ "trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause", |
| 165224 | | - /* 258 */ "trigger_time ::= BEFORE|AFTER", |
| 165225 | | - /* 259 */ "trigger_time ::= INSTEAD OF", |
| 165226 | | - /* 260 */ "trigger_time ::=", |
| 165227 | | - /* 261 */ "trigger_event ::= DELETE|INSERT", |
| 165228 | | - /* 262 */ "trigger_event ::= UPDATE", |
| 165229 | | - /* 263 */ "trigger_event ::= UPDATE OF idlist", |
| 165230 | | - /* 264 */ "when_clause ::=", |
| 165231 | | - /* 265 */ "when_clause ::= WHEN expr", |
| 165232 | | - /* 266 */ "trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI", |
| 165233 | | - /* 267 */ "trigger_cmd_list ::= trigger_cmd SEMI", |
| 165234 | | - /* 268 */ "trnm ::= nm DOT nm", |
| 165235 | | - /* 269 */ "tridxby ::= INDEXED BY nm", |
| 165236 | | - /* 270 */ "tridxby ::= NOT INDEXED", |
| 165237 | | - /* 271 */ "trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist from where_opt scanpt", |
| 165238 | | - /* 272 */ "trigger_cmd ::= scanpt insert_cmd INTO trnm idlist_opt select upsert scanpt", |
| 165239 | | - /* 273 */ "trigger_cmd ::= DELETE FROM trnm tridxby where_opt scanpt", |
| 165240 | | - /* 274 */ "trigger_cmd ::= scanpt select scanpt", |
| 165241 | | - /* 275 */ "expr ::= RAISE LP IGNORE RP", |
| 165242 | | - /* 276 */ "expr ::= RAISE LP raisetype COMMA nm RP", |
| 165243 | | - /* 277 */ "raisetype ::= ROLLBACK", |
| 165244 | | - /* 278 */ "raisetype ::= ABORT", |
| 165245 | | - /* 279 */ "raisetype ::= FAIL", |
| 165246 | | - /* 280 */ "cmd ::= DROP TRIGGER ifexists fullname", |
| 165247 | | - /* 281 */ "cmd ::= ATTACH database_kw_opt expr AS expr key_opt", |
| 165248 | | - /* 282 */ "cmd ::= DETACH database_kw_opt expr", |
| 165249 | | - /* 283 */ "key_opt ::=", |
| 165250 | | - /* 284 */ "key_opt ::= KEY expr", |
| 165251 | | - /* 285 */ "cmd ::= REINDEX", |
| 165252 | | - /* 286 */ "cmd ::= REINDEX nm dbnm", |
| 165253 | | - /* 287 */ "cmd ::= ANALYZE", |
| 165254 | | - /* 288 */ "cmd ::= ANALYZE nm dbnm", |
| 165255 | | - /* 289 */ "cmd ::= ALTER TABLE fullname RENAME TO nm", |
| 165256 | | - /* 290 */ "cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt columnname carglist", |
| 165257 | | - /* 291 */ "cmd ::= ALTER TABLE fullname DROP kwcolumn_opt nm", |
| 165258 | | - /* 292 */ "add_column_fullname ::= fullname", |
| 165259 | | - /* 293 */ "cmd ::= ALTER TABLE fullname RENAME kwcolumn_opt nm TO nm", |
| 165260 | | - /* 294 */ "cmd ::= create_vtab", |
| 165261 | | - /* 295 */ "cmd ::= create_vtab LP vtabarglist RP", |
| 165262 | | - /* 296 */ "create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm", |
| 165263 | | - /* 297 */ "vtabarg ::=", |
| 165264 | | - /* 298 */ "vtabargtoken ::= ANY", |
| 165265 | | - /* 299 */ "vtabargtoken ::= lp anylist RP", |
| 165266 | | - /* 300 */ "lp ::= LP", |
| 165267 | | - /* 301 */ "with ::= WITH wqlist", |
| 165268 | | - /* 302 */ "with ::= WITH RECURSIVE wqlist", |
| 165269 | | - /* 303 */ "wqas ::= AS", |
| 165270 | | - /* 304 */ "wqas ::= AS MATERIALIZED", |
| 165271 | | - /* 305 */ "wqas ::= AS NOT MATERIALIZED", |
| 165272 | | - /* 306 */ "wqitem ::= nm eidlist_opt wqas LP select RP", |
| 165273 | | - /* 307 */ "wqlist ::= wqitem", |
| 165274 | | - /* 308 */ "wqlist ::= wqlist COMMA wqitem", |
| 165275 | | - /* 309 */ "windowdefn_list ::= windowdefn", |
| 165276 | | - /* 310 */ "windowdefn_list ::= windowdefn_list COMMA windowdefn", |
| 165277 | | - /* 311 */ "windowdefn ::= nm AS LP window RP", |
| 165278 | | - /* 312 */ "window ::= PARTITION BY nexprlist orderby_opt frame_opt", |
| 165279 | | - /* 313 */ "window ::= nm PARTITION BY nexprlist orderby_opt frame_opt", |
| 165280 | | - /* 314 */ "window ::= ORDER BY sortlist frame_opt", |
| 165281 | | - /* 315 */ "window ::= nm ORDER BY sortlist frame_opt", |
| 165282 | | - /* 316 */ "window ::= frame_opt", |
| 165283 | | - /* 317 */ "window ::= nm frame_opt", |
| 165284 | | - /* 318 */ "frame_opt ::=", |
| 165285 | | - /* 319 */ "frame_opt ::= range_or_rows frame_bound_s frame_exclude_opt", |
| 165286 | | - /* 320 */ "frame_opt ::= range_or_rows BETWEEN frame_bound_s AND frame_bound_e frame_exclude_opt", |
| 165287 | | - /* 321 */ "range_or_rows ::= RANGE|ROWS|GROUPS", |
| 165288 | | - /* 322 */ "frame_bound_s ::= frame_bound", |
| 165289 | | - /* 323 */ "frame_bound_s ::= UNBOUNDED PRECEDING", |
| 165290 | | - /* 324 */ "frame_bound_e ::= frame_bound", |
| 165291 | | - /* 325 */ "frame_bound_e ::= UNBOUNDED FOLLOWING", |
| 165292 | | - /* 326 */ "frame_bound ::= expr PRECEDING|FOLLOWING", |
| 165293 | | - /* 327 */ "frame_bound ::= CURRENT ROW", |
| 165294 | | - /* 328 */ "frame_exclude_opt ::=", |
| 165295 | | - /* 329 */ "frame_exclude_opt ::= EXCLUDE frame_exclude", |
| 165296 | | - /* 330 */ "frame_exclude ::= NO OTHERS", |
| 165297 | | - /* 331 */ "frame_exclude ::= CURRENT ROW", |
| 165298 | | - /* 332 */ "frame_exclude ::= GROUP|TIES", |
| 165299 | | - /* 333 */ "window_clause ::= WINDOW windowdefn_list", |
| 165300 | | - /* 334 */ "filter_over ::= filter_clause over_clause", |
| 165301 | | - /* 335 */ "filter_over ::= over_clause", |
| 165302 | | - /* 336 */ "filter_over ::= filter_clause", |
| 165303 | | - /* 337 */ "over_clause ::= OVER LP window RP", |
| 165304 | | - /* 338 */ "over_clause ::= OVER nm", |
| 165305 | | - /* 339 */ "filter_clause ::= FILTER LP WHERE expr RP", |
| 165306 | | - /* 340 */ "input ::= cmdlist", |
| 165307 | | - /* 341 */ "cmdlist ::= cmdlist ecmd", |
| 165308 | | - /* 342 */ "cmdlist ::= ecmd", |
| 165309 | | - /* 343 */ "ecmd ::= SEMI", |
| 165310 | | - /* 344 */ "ecmd ::= cmdx SEMI", |
| 165311 | | - /* 345 */ "ecmd ::= explain cmdx SEMI", |
| 165312 | | - /* 346 */ "trans_opt ::=", |
| 165313 | | - /* 347 */ "trans_opt ::= TRANSACTION", |
| 165314 | | - /* 348 */ "trans_opt ::= TRANSACTION nm", |
| 165315 | | - /* 349 */ "savepoint_opt ::= SAVEPOINT", |
| 165316 | | - /* 350 */ "savepoint_opt ::=", |
| 165317 | | - /* 351 */ "cmd ::= create_table create_table_args", |
| 165318 | | - /* 352 */ "table_option_set ::= table_option", |
| 165319 | | - /* 353 */ "columnlist ::= columnlist COMMA columnname carglist", |
| 165320 | | - /* 354 */ "columnlist ::= columnname carglist", |
| 165321 | | - /* 355 */ "nm ::= ID|INDEXED", |
| 165322 | | - /* 356 */ "nm ::= STRING", |
| 165323 | | - /* 357 */ "nm ::= JOIN_KW", |
| 165324 | | - /* 358 */ "typetoken ::= typename", |
| 165325 | | - /* 359 */ "typename ::= ID|STRING", |
| 165326 | | - /* 360 */ "signed ::= plus_num", |
| 165327 | | - /* 361 */ "signed ::= minus_num", |
| 165328 | | - /* 362 */ "carglist ::= carglist ccons", |
| 165329 | | - /* 363 */ "carglist ::=", |
| 165330 | | - /* 364 */ "ccons ::= NULL onconf", |
| 165331 | | - /* 365 */ "ccons ::= GENERATED ALWAYS AS generated", |
| 165332 | | - /* 366 */ "ccons ::= AS generated", |
| 165333 | | - /* 367 */ "conslist_opt ::= COMMA conslist", |
| 165334 | | - /* 368 */ "conslist ::= conslist tconscomma tcons", |
| 165335 | | - /* 369 */ "conslist ::= tcons", |
| 165336 | | - /* 370 */ "tconscomma ::=", |
| 165337 | | - /* 371 */ "defer_subclause_opt ::= defer_subclause", |
| 165338 | | - /* 372 */ "resolvetype ::= raisetype", |
| 165339 | | - /* 373 */ "selectnowith ::= oneselect", |
| 165340 | | - /* 374 */ "oneselect ::= values", |
| 165341 | | - /* 375 */ "sclp ::= selcollist COMMA", |
| 165342 | | - /* 376 */ "as ::= ID|STRING", |
| 165343 | | - /* 377 */ "indexed_opt ::= indexed_by", |
| 165344 | | - /* 378 */ "returning ::=", |
| 165345 | | - /* 379 */ "expr ::= term", |
| 165346 | | - /* 380 */ "likeop ::= LIKE_KW|MATCH", |
| 165347 | | - /* 381 */ "exprlist ::= nexprlist", |
| 165348 | | - /* 382 */ "nmnum ::= plus_num", |
| 165349 | | - /* 383 */ "nmnum ::= nm", |
| 165350 | | - /* 384 */ "nmnum ::= ON", |
| 165351 | | - /* 385 */ "nmnum ::= DELETE", |
| 165352 | | - /* 386 */ "nmnum ::= DEFAULT", |
| 165353 | | - /* 387 */ "plus_num ::= INTEGER|FLOAT", |
| 165354 | | - /* 388 */ "foreach_clause ::=", |
| 165355 | | - /* 389 */ "foreach_clause ::= FOR EACH ROW", |
| 165356 | | - /* 390 */ "trnm ::= nm", |
| 165357 | | - /* 391 */ "tridxby ::=", |
| 165358 | | - /* 392 */ "database_kw_opt ::= DATABASE", |
| 165359 | | - /* 393 */ "database_kw_opt ::=", |
| 165360 | | - /* 394 */ "kwcolumn_opt ::=", |
| 165361 | | - /* 395 */ "kwcolumn_opt ::= COLUMNKW", |
| 165362 | | - /* 396 */ "vtabarglist ::= vtabarg", |
| 165363 | | - /* 397 */ "vtabarglist ::= vtabarglist COMMA vtabarg", |
| 165364 | | - /* 398 */ "vtabarg ::= vtabarg vtabargtoken", |
| 165365 | | - /* 399 */ "anylist ::=", |
| 165366 | | - /* 400 */ "anylist ::= anylist LP anylist RP", |
| 165367 | | - /* 401 */ "anylist ::= anylist ANY", |
| 165368 | | - /* 402 */ "with ::=", |
| 165404 | + /* 209 */ "expr ::= expr IS NOT DISTINCT FROM expr", |
| 165405 | + /* 210 */ "expr ::= expr IS DISTINCT FROM expr", |
| 165406 | + /* 211 */ "expr ::= NOT expr", |
| 165407 | + /* 212 */ "expr ::= BITNOT expr", |
| 165408 | + /* 213 */ "expr ::= PLUS|MINUS expr", |
| 165409 | + /* 214 */ "expr ::= expr PTR expr", |
| 165410 | + /* 215 */ "between_op ::= BETWEEN", |
| 165411 | + /* 216 */ "between_op ::= NOT BETWEEN", |
| 165412 | + /* 217 */ "expr ::= expr between_op expr AND expr", |
| 165413 | + /* 218 */ "in_op ::= IN", |
| 165414 | + /* 219 */ "in_op ::= NOT IN", |
| 165415 | + /* 220 */ "expr ::= expr in_op LP exprlist RP", |
| 165416 | + /* 221 */ "expr ::= LP select RP", |
| 165417 | + /* 222 */ "expr ::= expr in_op LP select RP", |
| 165418 | + /* 223 */ "expr ::= expr in_op nm dbnm paren_exprlist", |
| 165419 | + /* 224 */ "expr ::= EXISTS LP select RP", |
| 165420 | + /* 225 */ "expr ::= CASE case_operand case_exprlist case_else END", |
| 165421 | + /* 226 */ "case_exprlist ::= case_exprlist WHEN expr THEN expr", |
| 165422 | + /* 227 */ "case_exprlist ::= WHEN expr THEN expr", |
| 165423 | + /* 228 */ "case_else ::= ELSE expr", |
| 165424 | + /* 229 */ "case_else ::=", |
| 165425 | + /* 230 */ "case_operand ::= expr", |
| 165426 | + /* 231 */ "case_operand ::=", |
| 165427 | + /* 232 */ "exprlist ::=", |
| 165428 | + /* 233 */ "nexprlist ::= nexprlist COMMA expr", |
| 165429 | + /* 234 */ "nexprlist ::= expr", |
| 165430 | + /* 235 */ "paren_exprlist ::=", |
| 165431 | + /* 236 */ "paren_exprlist ::= LP exprlist RP", |
| 165432 | + /* 237 */ "cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP sortlist RP where_opt", |
| 165433 | + /* 238 */ "uniqueflag ::= UNIQUE", |
| 165434 | + /* 239 */ "uniqueflag ::=", |
| 165435 | + /* 240 */ "eidlist_opt ::=", |
| 165436 | + /* 241 */ "eidlist_opt ::= LP eidlist RP", |
| 165437 | + /* 242 */ "eidlist ::= eidlist COMMA nm collate sortorder", |
| 165438 | + /* 243 */ "eidlist ::= nm collate sortorder", |
| 165439 | + /* 244 */ "collate ::=", |
| 165440 | + /* 245 */ "collate ::= COLLATE ID|STRING", |
| 165441 | + /* 246 */ "cmd ::= DROP INDEX ifexists fullname", |
| 165442 | + /* 247 */ "cmd ::= VACUUM vinto", |
| 165443 | + /* 248 */ "cmd ::= VACUUM nm vinto", |
| 165444 | + /* 249 */ "vinto ::= INTO expr", |
| 165445 | + /* 250 */ "vinto ::=", |
| 165446 | + /* 251 */ "cmd ::= PRAGMA nm dbnm", |
| 165447 | + /* 252 */ "cmd ::= PRAGMA nm dbnm EQ nmnum", |
| 165448 | + /* 253 */ "cmd ::= PRAGMA nm dbnm LP nmnum RP", |
| 165449 | + /* 254 */ "cmd ::= PRAGMA nm dbnm EQ minus_num", |
| 165450 | + /* 255 */ "cmd ::= PRAGMA nm dbnm LP minus_num RP", |
| 165451 | + /* 256 */ "plus_num ::= PLUS INTEGER|FLOAT", |
| 165452 | + /* 257 */ "minus_num ::= MINUS INTEGER|FLOAT", |
| 165453 | + /* 258 */ "cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END", |
| 165454 | + /* 259 */ "trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause", |
| 165455 | + /* 260 */ "trigger_time ::= BEFORE|AFTER", |
| 165456 | + /* 261 */ "trigger_time ::= INSTEAD OF", |
| 165457 | + /* 262 */ "trigger_time ::=", |
| 165458 | + /* 263 */ "trigger_event ::= DELETE|INSERT", |
| 165459 | + /* 264 */ "trigger_event ::= UPDATE", |
| 165460 | + /* 265 */ "trigger_event ::= UPDATE OF idlist", |
| 165461 | + /* 266 */ "when_clause ::=", |
| 165462 | + /* 267 */ "when_clause ::= WHEN expr", |
| 165463 | + /* 268 */ "trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI", |
| 165464 | + /* 269 */ "trigger_cmd_list ::= trigger_cmd SEMI", |
| 165465 | + /* 270 */ "trnm ::= nm DOT nm", |
| 165466 | + /* 271 */ "tridxby ::= INDEXED BY nm", |
| 165467 | + /* 272 */ "tridxby ::= NOT INDEXED", |
| 165468 | + /* 273 */ "trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist from where_opt scanpt", |
| 165469 | + /* 274 */ "trigger_cmd ::= scanpt insert_cmd INTO trnm idlist_opt select upsert scanpt", |
| 165470 | + /* 275 */ "trigger_cmd ::= DELETE FROM trnm tridxby where_opt scanpt", |
| 165471 | + /* 276 */ "trigger_cmd ::= scanpt select scanpt", |
| 165472 | + /* 277 */ "expr ::= RAISE LP IGNORE RP", |
| 165473 | + /* 278 */ "expr ::= RAISE LP raisetype COMMA nm RP", |
| 165474 | + /* 279 */ "raisetype ::= ROLLBACK", |
| 165475 | + /* 280 */ "raisetype ::= ABORT", |
| 165476 | + /* 281 */ "raisetype ::= FAIL", |
| 165477 | + /* 282 */ "cmd ::= DROP TRIGGER ifexists fullname", |
| 165478 | + /* 283 */ "cmd ::= ATTACH database_kw_opt expr AS expr key_opt", |
| 165479 | + /* 284 */ "cmd ::= DETACH database_kw_opt expr", |
| 165480 | + /* 285 */ "key_opt ::=", |
| 165481 | + /* 286 */ "key_opt ::= KEY expr", |
| 165482 | + /* 287 */ "cmd ::= REINDEX", |
| 165483 | + /* 288 */ "cmd ::= REINDEX nm dbnm", |
| 165484 | + /* 289 */ "cmd ::= ANALYZE", |
| 165485 | + /* 290 */ "cmd ::= ANALYZE nm dbnm", |
| 165486 | + /* 291 */ "cmd ::= ALTER TABLE fullname RENAME TO nm", |
| 165487 | + /* 292 */ "cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt columnname carglist", |
| 165488 | + /* 293 */ "cmd ::= ALTER TABLE fullname DROP kwcolumn_opt nm", |
| 165489 | + /* 294 */ "add_column_fullname ::= fullname", |
| 165490 | + /* 295 */ "cmd ::= ALTER TABLE fullname RENAME kwcolumn_opt nm TO nm", |
| 165491 | + /* 296 */ "cmd ::= create_vtab", |
| 165492 | + /* 297 */ "cmd ::= create_vtab LP vtabarglist RP", |
| 165493 | + /* 298 */ "create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm", |
| 165494 | + /* 299 */ "vtabarg ::=", |
| 165495 | + /* 300 */ "vtabargtoken ::= ANY", |
| 165496 | + /* 301 */ "vtabargtoken ::= lp anylist RP", |
| 165497 | + /* 302 */ "lp ::= LP", |
| 165498 | + /* 303 */ "with ::= WITH wqlist", |
| 165499 | + /* 304 */ "with ::= WITH RECURSIVE wqlist", |
| 165500 | + /* 305 */ "wqas ::= AS", |
| 165501 | + /* 306 */ "wqas ::= AS MATERIALIZED", |
| 165502 | + /* 307 */ "wqas ::= AS NOT MATERIALIZED", |
| 165503 | + /* 308 */ "wqitem ::= nm eidlist_opt wqas LP select RP", |
| 165504 | + /* 309 */ "wqlist ::= wqitem", |
| 165505 | + /* 310 */ "wqlist ::= wqlist COMMA wqitem", |
| 165506 | + /* 311 */ "windowdefn_list ::= windowdefn", |
| 165507 | + /* 312 */ "windowdefn_list ::= windowdefn_list COMMA windowdefn", |
| 165508 | + /* 313 */ "windowdefn ::= nm AS LP window RP", |
| 165509 | + /* 314 */ "window ::= PARTITION BY nexprlist orderby_opt frame_opt", |
| 165510 | + /* 315 */ "window ::= nm PARTITION BY nexprlist orderby_opt frame_opt", |
| 165511 | + /* 316 */ "window ::= ORDER BY sortlist frame_opt", |
| 165512 | + /* 317 */ "window ::= nm ORDER BY sortlist frame_opt", |
| 165513 | + /* 318 */ "window ::= frame_opt", |
| 165514 | + /* 319 */ "window ::= nm frame_opt", |
| 165515 | + /* 320 */ "frame_opt ::=", |
| 165516 | + /* 321 */ "frame_opt ::= range_or_rows frame_bound_s frame_exclude_opt", |
| 165517 | + /* 322 */ "frame_opt ::= range_or_rows BETWEEN frame_bound_s AND frame_bound_e frame_exclude_opt", |
| 165518 | + /* 323 */ "range_or_rows ::= RANGE|ROWS|GROUPS", |
| 165519 | + /* 324 */ "frame_bound_s ::= frame_bound", |
| 165520 | + /* 325 */ "frame_bound_s ::= UNBOUNDED PRECEDING", |
| 165521 | + /* 326 */ "frame_bound_e ::= frame_bound", |
| 165522 | + /* 327 */ "frame_bound_e ::= UNBOUNDED FOLLOWING", |
| 165523 | + /* 328 */ "frame_bound ::= expr PRECEDING|FOLLOWING", |
| 165524 | + /* 329 */ "frame_bound ::= CURRENT ROW", |
| 165525 | + /* 330 */ "frame_exclude_opt ::=", |
| 165526 | + /* 331 */ "frame_exclude_opt ::= EXCLUDE frame_exclude", |
| 165527 | + /* 332 */ "frame_exclude ::= NO OTHERS", |
| 165528 | + /* 333 */ "frame_exclude ::= CURRENT ROW", |
| 165529 | + /* 334 */ "frame_exclude ::= GROUP|TIES", |
| 165530 | + /* 335 */ "window_clause ::= WINDOW windowdefn_list", |
| 165531 | + /* 336 */ "filter_over ::= filter_clause over_clause", |
| 165532 | + /* 337 */ "filter_over ::= over_clause", |
| 165533 | + /* 338 */ "filter_over ::= filter_clause", |
| 165534 | + /* 339 */ "over_clause ::= OVER LP window RP", |
| 165535 | + /* 340 */ "over_clause ::= OVER nm", |
| 165536 | + /* 341 */ "filter_clause ::= FILTER LP WHERE expr RP", |
| 165537 | + /* 342 */ "input ::= cmdlist", |
| 165538 | + /* 343 */ "cmdlist ::= cmdlist ecmd", |
| 165539 | + /* 344 */ "cmdlist ::= ecmd", |
| 165540 | + /* 345 */ "ecmd ::= SEMI", |
| 165541 | + /* 346 */ "ecmd ::= cmdx SEMI", |
| 165542 | + /* 347 */ "ecmd ::= explain cmdx SEMI", |
| 165543 | + /* 348 */ "trans_opt ::=", |
| 165544 | + /* 349 */ "trans_opt ::= TRANSACTION", |
| 165545 | + /* 350 */ "trans_opt ::= TRANSACTION nm", |
| 165546 | + /* 351 */ "savepoint_opt ::= SAVEPOINT", |
| 165547 | + /* 352 */ "savepoint_opt ::=", |
| 165548 | + /* 353 */ "cmd ::= create_table create_table_args", |
| 165549 | + /* 354 */ "table_option_set ::= table_option", |
| 165550 | + /* 355 */ "columnlist ::= columnlist COMMA columnname carglist", |
| 165551 | + /* 356 */ "columnlist ::= columnname carglist", |
| 165552 | + /* 357 */ "nm ::= ID|INDEXED", |
| 165553 | + /* 358 */ "nm ::= STRING", |
| 165554 | + /* 359 */ "nm ::= JOIN_KW", |
| 165555 | + /* 360 */ "typetoken ::= typename", |
| 165556 | + /* 361 */ "typename ::= ID|STRING", |
| 165557 | + /* 362 */ "signed ::= plus_num", |
| 165558 | + /* 363 */ "signed ::= minus_num", |
| 165559 | + /* 364 */ "carglist ::= carglist ccons", |
| 165560 | + /* 365 */ "carglist ::=", |
| 165561 | + /* 366 */ "ccons ::= NULL onconf", |
| 165562 | + /* 367 */ "ccons ::= GENERATED ALWAYS AS generated", |
| 165563 | + /* 368 */ "ccons ::= AS generated", |
| 165564 | + /* 369 */ "conslist_opt ::= COMMA conslist", |
| 165565 | + /* 370 */ "conslist ::= conslist tconscomma tcons", |
| 165566 | + /* 371 */ "conslist ::= tcons", |
| 165567 | + /* 372 */ "tconscomma ::=", |
| 165568 | + /* 373 */ "defer_subclause_opt ::= defer_subclause", |
| 165569 | + /* 374 */ "resolvetype ::= raisetype", |
| 165570 | + /* 375 */ "selectnowith ::= oneselect", |
| 165571 | + /* 376 */ "oneselect ::= values", |
| 165572 | + /* 377 */ "sclp ::= selcollist COMMA", |
| 165573 | + /* 378 */ "as ::= ID|STRING", |
| 165574 | + /* 379 */ "indexed_opt ::= indexed_by", |
| 165575 | + /* 380 */ "returning ::=", |
| 165576 | + /* 381 */ "expr ::= term", |
| 165577 | + /* 382 */ "likeop ::= LIKE_KW|MATCH", |
| 165578 | + /* 383 */ "exprlist ::= nexprlist", |
| 165579 | + /* 384 */ "nmnum ::= plus_num", |
| 165580 | + /* 385 */ "nmnum ::= nm", |
| 165581 | + /* 386 */ "nmnum ::= ON", |
| 165582 | + /* 387 */ "nmnum ::= DELETE", |
| 165583 | + /* 388 */ "nmnum ::= DEFAULT", |
| 165584 | + /* 389 */ "plus_num ::= INTEGER|FLOAT", |
| 165585 | + /* 390 */ "foreach_clause ::=", |
| 165586 | + /* 391 */ "foreach_clause ::= FOR EACH ROW", |
| 165587 | + /* 392 */ "trnm ::= nm", |
| 165588 | + /* 393 */ "tridxby ::=", |
| 165589 | + /* 394 */ "database_kw_opt ::= DATABASE", |
| 165590 | + /* 395 */ "database_kw_opt ::=", |
| 165591 | + /* 396 */ "kwcolumn_opt ::=", |
| 165592 | + /* 397 */ "kwcolumn_opt ::= COLUMNKW", |
| 165593 | + /* 398 */ "vtabarglist ::= vtabarg", |
| 165594 | + /* 399 */ "vtabarglist ::= vtabarglist COMMA vtabarg", |
| 165595 | + /* 400 */ "vtabarg ::= vtabarg vtabargtoken", |
| 165596 | + /* 401 */ "anylist ::=", |
| 165597 | + /* 402 */ "anylist ::= anylist LP anylist RP", |
| 165598 | + /* 403 */ "anylist ::= anylist ANY", |
| 165599 | + /* 404 */ "with ::=", |
| 165369 | 165600 | }; |
| 165370 | 165601 | #endif /* NDEBUG */ |
| 165371 | 165602 | |
| 165372 | 165603 | |
| 165373 | 165604 | #if YYSTACKDEPTH<=0 |
| | @@ -166079,204 +166310,206 @@ |
| 166079 | 166310 | 217, /* (204) expr ::= expr likeop expr ESCAPE expr */ |
| 166080 | 166311 | 217, /* (205) expr ::= expr ISNULL|NOTNULL */ |
| 166081 | 166312 | 217, /* (206) expr ::= expr NOT NULL */ |
| 166082 | 166313 | 217, /* (207) expr ::= expr IS expr */ |
| 166083 | 166314 | 217, /* (208) expr ::= expr IS NOT expr */ |
| 166084 | | - 217, /* (209) expr ::= NOT expr */ |
| 166085 | | - 217, /* (210) expr ::= BITNOT expr */ |
| 166086 | | - 217, /* (211) expr ::= PLUS|MINUS expr */ |
| 166087 | | - 217, /* (212) expr ::= expr PTR expr */ |
| 166088 | | - 275, /* (213) between_op ::= BETWEEN */ |
| 166089 | | - 275, /* (214) between_op ::= NOT BETWEEN */ |
| 166090 | | - 217, /* (215) expr ::= expr between_op expr AND expr */ |
| 166091 | | - 276, /* (216) in_op ::= IN */ |
| 166092 | | - 276, /* (217) in_op ::= NOT IN */ |
| 166093 | | - 217, /* (218) expr ::= expr in_op LP exprlist RP */ |
| 166094 | | - 217, /* (219) expr ::= LP select RP */ |
| 166095 | | - 217, /* (220) expr ::= expr in_op LP select RP */ |
| 166096 | | - 217, /* (221) expr ::= expr in_op nm dbnm paren_exprlist */ |
| 166097 | | - 217, /* (222) expr ::= EXISTS LP select RP */ |
| 166098 | | - 217, /* (223) expr ::= CASE case_operand case_exprlist case_else END */ |
| 166099 | | - 279, /* (224) case_exprlist ::= case_exprlist WHEN expr THEN expr */ |
| 166100 | | - 279, /* (225) case_exprlist ::= WHEN expr THEN expr */ |
| 166101 | | - 280, /* (226) case_else ::= ELSE expr */ |
| 166102 | | - 280, /* (227) case_else ::= */ |
| 166103 | | - 278, /* (228) case_operand ::= expr */ |
| 166104 | | - 278, /* (229) case_operand ::= */ |
| 166105 | | - 261, /* (230) exprlist ::= */ |
| 166106 | | - 253, /* (231) nexprlist ::= nexprlist COMMA expr */ |
| 166107 | | - 253, /* (232) nexprlist ::= expr */ |
| 166108 | | - 277, /* (233) paren_exprlist ::= */ |
| 166109 | | - 277, /* (234) paren_exprlist ::= LP exprlist RP */ |
| 166110 | | - 190, /* (235) cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP sortlist RP where_opt */ |
| 166111 | | - 281, /* (236) uniqueflag ::= UNIQUE */ |
| 166112 | | - 281, /* (237) uniqueflag ::= */ |
| 166113 | | - 221, /* (238) eidlist_opt ::= */ |
| 166114 | | - 221, /* (239) eidlist_opt ::= LP eidlist RP */ |
| 166115 | | - 232, /* (240) eidlist ::= eidlist COMMA nm collate sortorder */ |
| 166116 | | - 232, /* (241) eidlist ::= nm collate sortorder */ |
| 166117 | | - 282, /* (242) collate ::= */ |
| 166118 | | - 282, /* (243) collate ::= COLLATE ID|STRING */ |
| 166119 | | - 190, /* (244) cmd ::= DROP INDEX ifexists fullname */ |
| 166120 | | - 190, /* (245) cmd ::= VACUUM vinto */ |
| 166121 | | - 190, /* (246) cmd ::= VACUUM nm vinto */ |
| 166122 | | - 283, /* (247) vinto ::= INTO expr */ |
| 166123 | | - 283, /* (248) vinto ::= */ |
| 166124 | | - 190, /* (249) cmd ::= PRAGMA nm dbnm */ |
| 166125 | | - 190, /* (250) cmd ::= PRAGMA nm dbnm EQ nmnum */ |
| 166126 | | - 190, /* (251) cmd ::= PRAGMA nm dbnm LP nmnum RP */ |
| 166127 | | - 190, /* (252) cmd ::= PRAGMA nm dbnm EQ minus_num */ |
| 166128 | | - 190, /* (253) cmd ::= PRAGMA nm dbnm LP minus_num RP */ |
| 166129 | | - 211, /* (254) plus_num ::= PLUS INTEGER|FLOAT */ |
| 166130 | | - 212, /* (255) minus_num ::= MINUS INTEGER|FLOAT */ |
| 166131 | | - 190, /* (256) cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END */ |
| 166132 | | - 285, /* (257) trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause */ |
| 166133 | | - 287, /* (258) trigger_time ::= BEFORE|AFTER */ |
| 166134 | | - 287, /* (259) trigger_time ::= INSTEAD OF */ |
| 166135 | | - 287, /* (260) trigger_time ::= */ |
| 166136 | | - 288, /* (261) trigger_event ::= DELETE|INSERT */ |
| 166137 | | - 288, /* (262) trigger_event ::= UPDATE */ |
| 166138 | | - 288, /* (263) trigger_event ::= UPDATE OF idlist */ |
| 166139 | | - 290, /* (264) when_clause ::= */ |
| 166140 | | - 290, /* (265) when_clause ::= WHEN expr */ |
| 166141 | | - 286, /* (266) trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI */ |
| 166142 | | - 286, /* (267) trigger_cmd_list ::= trigger_cmd SEMI */ |
| 166143 | | - 292, /* (268) trnm ::= nm DOT nm */ |
| 166144 | | - 293, /* (269) tridxby ::= INDEXED BY nm */ |
| 166145 | | - 293, /* (270) tridxby ::= NOT INDEXED */ |
| 166146 | | - 291, /* (271) trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist from where_opt scanpt */ |
| 166147 | | - 291, /* (272) trigger_cmd ::= scanpt insert_cmd INTO trnm idlist_opt select upsert scanpt */ |
| 166148 | | - 291, /* (273) trigger_cmd ::= DELETE FROM trnm tridxby where_opt scanpt */ |
| 166149 | | - 291, /* (274) trigger_cmd ::= scanpt select scanpt */ |
| 166150 | | - 217, /* (275) expr ::= RAISE LP IGNORE RP */ |
| 166151 | | - 217, /* (276) expr ::= RAISE LP raisetype COMMA nm RP */ |
| 166152 | | - 236, /* (277) raisetype ::= ROLLBACK */ |
| 166153 | | - 236, /* (278) raisetype ::= ABORT */ |
| 166154 | | - 236, /* (279) raisetype ::= FAIL */ |
| 166155 | | - 190, /* (280) cmd ::= DROP TRIGGER ifexists fullname */ |
| 166156 | | - 190, /* (281) cmd ::= ATTACH database_kw_opt expr AS expr key_opt */ |
| 166157 | | - 190, /* (282) cmd ::= DETACH database_kw_opt expr */ |
| 166158 | | - 295, /* (283) key_opt ::= */ |
| 166159 | | - 295, /* (284) key_opt ::= KEY expr */ |
| 166160 | | - 190, /* (285) cmd ::= REINDEX */ |
| 166161 | | - 190, /* (286) cmd ::= REINDEX nm dbnm */ |
| 166162 | | - 190, /* (287) cmd ::= ANALYZE */ |
| 166163 | | - 190, /* (288) cmd ::= ANALYZE nm dbnm */ |
| 166164 | | - 190, /* (289) cmd ::= ALTER TABLE fullname RENAME TO nm */ |
| 166165 | | - 190, /* (290) cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt columnname carglist */ |
| 166166 | | - 190, /* (291) cmd ::= ALTER TABLE fullname DROP kwcolumn_opt nm */ |
| 166167 | | - 296, /* (292) add_column_fullname ::= fullname */ |
| 166168 | | - 190, /* (293) cmd ::= ALTER TABLE fullname RENAME kwcolumn_opt nm TO nm */ |
| 166169 | | - 190, /* (294) cmd ::= create_vtab */ |
| 166170 | | - 190, /* (295) cmd ::= create_vtab LP vtabarglist RP */ |
| 166171 | | - 298, /* (296) create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm */ |
| 166172 | | - 300, /* (297) vtabarg ::= */ |
| 166173 | | - 301, /* (298) vtabargtoken ::= ANY */ |
| 166174 | | - 301, /* (299) vtabargtoken ::= lp anylist RP */ |
| 166175 | | - 302, /* (300) lp ::= LP */ |
| 166176 | | - 266, /* (301) with ::= WITH wqlist */ |
| 166177 | | - 266, /* (302) with ::= WITH RECURSIVE wqlist */ |
| 166178 | | - 305, /* (303) wqas ::= AS */ |
| 166179 | | - 305, /* (304) wqas ::= AS MATERIALIZED */ |
| 166180 | | - 305, /* (305) wqas ::= AS NOT MATERIALIZED */ |
| 166181 | | - 304, /* (306) wqitem ::= nm eidlist_opt wqas LP select RP */ |
| 166182 | | - 241, /* (307) wqlist ::= wqitem */ |
| 166183 | | - 241, /* (308) wqlist ::= wqlist COMMA wqitem */ |
| 166184 | | - 306, /* (309) windowdefn_list ::= windowdefn */ |
| 166185 | | - 306, /* (310) windowdefn_list ::= windowdefn_list COMMA windowdefn */ |
| 166186 | | - 307, /* (311) windowdefn ::= nm AS LP window RP */ |
| 166187 | | - 308, /* (312) window ::= PARTITION BY nexprlist orderby_opt frame_opt */ |
| 166188 | | - 308, /* (313) window ::= nm PARTITION BY nexprlist orderby_opt frame_opt */ |
| 166189 | | - 308, /* (314) window ::= ORDER BY sortlist frame_opt */ |
| 166190 | | - 308, /* (315) window ::= nm ORDER BY sortlist frame_opt */ |
| 166191 | | - 308, /* (316) window ::= frame_opt */ |
| 166192 | | - 308, /* (317) window ::= nm frame_opt */ |
| 166193 | | - 309, /* (318) frame_opt ::= */ |
| 166194 | | - 309, /* (319) frame_opt ::= range_or_rows frame_bound_s frame_exclude_opt */ |
| 166195 | | - 309, /* (320) frame_opt ::= range_or_rows BETWEEN frame_bound_s AND frame_bound_e frame_exclude_opt */ |
| 166196 | | - 313, /* (321) range_or_rows ::= RANGE|ROWS|GROUPS */ |
| 166197 | | - 315, /* (322) frame_bound_s ::= frame_bound */ |
| 166198 | | - 315, /* (323) frame_bound_s ::= UNBOUNDED PRECEDING */ |
| 166199 | | - 316, /* (324) frame_bound_e ::= frame_bound */ |
| 166200 | | - 316, /* (325) frame_bound_e ::= UNBOUNDED FOLLOWING */ |
| 166201 | | - 314, /* (326) frame_bound ::= expr PRECEDING|FOLLOWING */ |
| 166202 | | - 314, /* (327) frame_bound ::= CURRENT ROW */ |
| 166203 | | - 317, /* (328) frame_exclude_opt ::= */ |
| 166204 | | - 317, /* (329) frame_exclude_opt ::= EXCLUDE frame_exclude */ |
| 166205 | | - 318, /* (330) frame_exclude ::= NO OTHERS */ |
| 166206 | | - 318, /* (331) frame_exclude ::= CURRENT ROW */ |
| 166207 | | - 318, /* (332) frame_exclude ::= GROUP|TIES */ |
| 166208 | | - 251, /* (333) window_clause ::= WINDOW windowdefn_list */ |
| 166209 | | - 273, /* (334) filter_over ::= filter_clause over_clause */ |
| 166210 | | - 273, /* (335) filter_over ::= over_clause */ |
| 166211 | | - 273, /* (336) filter_over ::= filter_clause */ |
| 166212 | | - 312, /* (337) over_clause ::= OVER LP window RP */ |
| 166213 | | - 312, /* (338) over_clause ::= OVER nm */ |
| 166214 | | - 311, /* (339) filter_clause ::= FILTER LP WHERE expr RP */ |
| 166215 | | - 185, /* (340) input ::= cmdlist */ |
| 166216 | | - 186, /* (341) cmdlist ::= cmdlist ecmd */ |
| 166217 | | - 186, /* (342) cmdlist ::= ecmd */ |
| 166218 | | - 187, /* (343) ecmd ::= SEMI */ |
| 166219 | | - 187, /* (344) ecmd ::= cmdx SEMI */ |
| 166220 | | - 187, /* (345) ecmd ::= explain cmdx SEMI */ |
| 166221 | | - 192, /* (346) trans_opt ::= */ |
| 166222 | | - 192, /* (347) trans_opt ::= TRANSACTION */ |
| 166223 | | - 192, /* (348) trans_opt ::= TRANSACTION nm */ |
| 166224 | | - 194, /* (349) savepoint_opt ::= SAVEPOINT */ |
| 166225 | | - 194, /* (350) savepoint_opt ::= */ |
| 166226 | | - 190, /* (351) cmd ::= create_table create_table_args */ |
| 166227 | | - 203, /* (352) table_option_set ::= table_option */ |
| 166228 | | - 201, /* (353) columnlist ::= columnlist COMMA columnname carglist */ |
| 166229 | | - 201, /* (354) columnlist ::= columnname carglist */ |
| 166230 | | - 193, /* (355) nm ::= ID|INDEXED */ |
| 166231 | | - 193, /* (356) nm ::= STRING */ |
| 166232 | | - 193, /* (357) nm ::= JOIN_KW */ |
| 166233 | | - 208, /* (358) typetoken ::= typename */ |
| 166234 | | - 209, /* (359) typename ::= ID|STRING */ |
| 166235 | | - 210, /* (360) signed ::= plus_num */ |
| 166236 | | - 210, /* (361) signed ::= minus_num */ |
| 166237 | | - 207, /* (362) carglist ::= carglist ccons */ |
| 166238 | | - 207, /* (363) carglist ::= */ |
| 166239 | | - 215, /* (364) ccons ::= NULL onconf */ |
| 166240 | | - 215, /* (365) ccons ::= GENERATED ALWAYS AS generated */ |
| 166241 | | - 215, /* (366) ccons ::= AS generated */ |
| 166242 | | - 202, /* (367) conslist_opt ::= COMMA conslist */ |
| 166243 | | - 228, /* (368) conslist ::= conslist tconscomma tcons */ |
| 166244 | | - 228, /* (369) conslist ::= tcons */ |
| 166245 | | - 229, /* (370) tconscomma ::= */ |
| 166246 | | - 233, /* (371) defer_subclause_opt ::= defer_subclause */ |
| 166247 | | - 235, /* (372) resolvetype ::= raisetype */ |
| 166248 | | - 239, /* (373) selectnowith ::= oneselect */ |
| 166249 | | - 240, /* (374) oneselect ::= values */ |
| 166250 | | - 254, /* (375) sclp ::= selcollist COMMA */ |
| 166251 | | - 255, /* (376) as ::= ID|STRING */ |
| 166252 | | - 264, /* (377) indexed_opt ::= indexed_by */ |
| 166253 | | - 272, /* (378) returning ::= */ |
| 166254 | | - 217, /* (379) expr ::= term */ |
| 166255 | | - 274, /* (380) likeop ::= LIKE_KW|MATCH */ |
| 166256 | | - 261, /* (381) exprlist ::= nexprlist */ |
| 166257 | | - 284, /* (382) nmnum ::= plus_num */ |
| 166258 | | - 284, /* (383) nmnum ::= nm */ |
| 166259 | | - 284, /* (384) nmnum ::= ON */ |
| 166260 | | - 284, /* (385) nmnum ::= DELETE */ |
| 166261 | | - 284, /* (386) nmnum ::= DEFAULT */ |
| 166262 | | - 211, /* (387) plus_num ::= INTEGER|FLOAT */ |
| 166263 | | - 289, /* (388) foreach_clause ::= */ |
| 166264 | | - 289, /* (389) foreach_clause ::= FOR EACH ROW */ |
| 166265 | | - 292, /* (390) trnm ::= nm */ |
| 166266 | | - 293, /* (391) tridxby ::= */ |
| 166267 | | - 294, /* (392) database_kw_opt ::= DATABASE */ |
| 166268 | | - 294, /* (393) database_kw_opt ::= */ |
| 166269 | | - 297, /* (394) kwcolumn_opt ::= */ |
| 166270 | | - 297, /* (395) kwcolumn_opt ::= COLUMNKW */ |
| 166271 | | - 299, /* (396) vtabarglist ::= vtabarg */ |
| 166272 | | - 299, /* (397) vtabarglist ::= vtabarglist COMMA vtabarg */ |
| 166273 | | - 300, /* (398) vtabarg ::= vtabarg vtabargtoken */ |
| 166274 | | - 303, /* (399) anylist ::= */ |
| 166275 | | - 303, /* (400) anylist ::= anylist LP anylist RP */ |
| 166276 | | - 303, /* (401) anylist ::= anylist ANY */ |
| 166277 | | - 266, /* (402) with ::= */ |
| 166315 | + 217, /* (209) expr ::= expr IS NOT DISTINCT FROM expr */ |
| 166316 | + 217, /* (210) expr ::= expr IS DISTINCT FROM expr */ |
| 166317 | + 217, /* (211) expr ::= NOT expr */ |
| 166318 | + 217, /* (212) expr ::= BITNOT expr */ |
| 166319 | + 217, /* (213) expr ::= PLUS|MINUS expr */ |
| 166320 | + 217, /* (214) expr ::= expr PTR expr */ |
| 166321 | + 275, /* (215) between_op ::= BETWEEN */ |
| 166322 | + 275, /* (216) between_op ::= NOT BETWEEN */ |
| 166323 | + 217, /* (217) expr ::= expr between_op expr AND expr */ |
| 166324 | + 276, /* (218) in_op ::= IN */ |
| 166325 | + 276, /* (219) in_op ::= NOT IN */ |
| 166326 | + 217, /* (220) expr ::= expr in_op LP exprlist RP */ |
| 166327 | + 217, /* (221) expr ::= LP select RP */ |
| 166328 | + 217, /* (222) expr ::= expr in_op LP select RP */ |
| 166329 | + 217, /* (223) expr ::= expr in_op nm dbnm paren_exprlist */ |
| 166330 | + 217, /* (224) expr ::= EXISTS LP select RP */ |
| 166331 | + 217, /* (225) expr ::= CASE case_operand case_exprlist case_else END */ |
| 166332 | + 279, /* (226) case_exprlist ::= case_exprlist WHEN expr THEN expr */ |
| 166333 | + 279, /* (227) case_exprlist ::= WHEN expr THEN expr */ |
| 166334 | + 280, /* (228) case_else ::= ELSE expr */ |
| 166335 | + 280, /* (229) case_else ::= */ |
| 166336 | + 278, /* (230) case_operand ::= expr */ |
| 166337 | + 278, /* (231) case_operand ::= */ |
| 166338 | + 261, /* (232) exprlist ::= */ |
| 166339 | + 253, /* (233) nexprlist ::= nexprlist COMMA expr */ |
| 166340 | + 253, /* (234) nexprlist ::= expr */ |
| 166341 | + 277, /* (235) paren_exprlist ::= */ |
| 166342 | + 277, /* (236) paren_exprlist ::= LP exprlist RP */ |
| 166343 | + 190, /* (237) cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP sortlist RP where_opt */ |
| 166344 | + 281, /* (238) uniqueflag ::= UNIQUE */ |
| 166345 | + 281, /* (239) uniqueflag ::= */ |
| 166346 | + 221, /* (240) eidlist_opt ::= */ |
| 166347 | + 221, /* (241) eidlist_opt ::= LP eidlist RP */ |
| 166348 | + 232, /* (242) eidlist ::= eidlist COMMA nm collate sortorder */ |
| 166349 | + 232, /* (243) eidlist ::= nm collate sortorder */ |
| 166350 | + 282, /* (244) collate ::= */ |
| 166351 | + 282, /* (245) collate ::= COLLATE ID|STRING */ |
| 166352 | + 190, /* (246) cmd ::= DROP INDEX ifexists fullname */ |
| 166353 | + 190, /* (247) cmd ::= VACUUM vinto */ |
| 166354 | + 190, /* (248) cmd ::= VACUUM nm vinto */ |
| 166355 | + 283, /* (249) vinto ::= INTO expr */ |
| 166356 | + 283, /* (250) vinto ::= */ |
| 166357 | + 190, /* (251) cmd ::= PRAGMA nm dbnm */ |
| 166358 | + 190, /* (252) cmd ::= PRAGMA nm dbnm EQ nmnum */ |
| 166359 | + 190, /* (253) cmd ::= PRAGMA nm dbnm LP nmnum RP */ |
| 166360 | + 190, /* (254) cmd ::= PRAGMA nm dbnm EQ minus_num */ |
| 166361 | + 190, /* (255) cmd ::= PRAGMA nm dbnm LP minus_num RP */ |
| 166362 | + 211, /* (256) plus_num ::= PLUS INTEGER|FLOAT */ |
| 166363 | + 212, /* (257) minus_num ::= MINUS INTEGER|FLOAT */ |
| 166364 | + 190, /* (258) cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END */ |
| 166365 | + 285, /* (259) trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause */ |
| 166366 | + 287, /* (260) trigger_time ::= BEFORE|AFTER */ |
| 166367 | + 287, /* (261) trigger_time ::= INSTEAD OF */ |
| 166368 | + 287, /* (262) trigger_time ::= */ |
| 166369 | + 288, /* (263) trigger_event ::= DELETE|INSERT */ |
| 166370 | + 288, /* (264) trigger_event ::= UPDATE */ |
| 166371 | + 288, /* (265) trigger_event ::= UPDATE OF idlist */ |
| 166372 | + 290, /* (266) when_clause ::= */ |
| 166373 | + 290, /* (267) when_clause ::= WHEN expr */ |
| 166374 | + 286, /* (268) trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI */ |
| 166375 | + 286, /* (269) trigger_cmd_list ::= trigger_cmd SEMI */ |
| 166376 | + 292, /* (270) trnm ::= nm DOT nm */ |
| 166377 | + 293, /* (271) tridxby ::= INDEXED BY nm */ |
| 166378 | + 293, /* (272) tridxby ::= NOT INDEXED */ |
| 166379 | + 291, /* (273) trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist from where_opt scanpt */ |
| 166380 | + 291, /* (274) trigger_cmd ::= scanpt insert_cmd INTO trnm idlist_opt select upsert scanpt */ |
| 166381 | + 291, /* (275) trigger_cmd ::= DELETE FROM trnm tridxby where_opt scanpt */ |
| 166382 | + 291, /* (276) trigger_cmd ::= scanpt select scanpt */ |
| 166383 | + 217, /* (277) expr ::= RAISE LP IGNORE RP */ |
| 166384 | + 217, /* (278) expr ::= RAISE LP raisetype COMMA nm RP */ |
| 166385 | + 236, /* (279) raisetype ::= ROLLBACK */ |
| 166386 | + 236, /* (280) raisetype ::= ABORT */ |
| 166387 | + 236, /* (281) raisetype ::= FAIL */ |
| 166388 | + 190, /* (282) cmd ::= DROP TRIGGER ifexists fullname */ |
| 166389 | + 190, /* (283) cmd ::= ATTACH database_kw_opt expr AS expr key_opt */ |
| 166390 | + 190, /* (284) cmd ::= DETACH database_kw_opt expr */ |
| 166391 | + 295, /* (285) key_opt ::= */ |
| 166392 | + 295, /* (286) key_opt ::= KEY expr */ |
| 166393 | + 190, /* (287) cmd ::= REINDEX */ |
| 166394 | + 190, /* (288) cmd ::= REINDEX nm dbnm */ |
| 166395 | + 190, /* (289) cmd ::= ANALYZE */ |
| 166396 | + 190, /* (290) cmd ::= ANALYZE nm dbnm */ |
| 166397 | + 190, /* (291) cmd ::= ALTER TABLE fullname RENAME TO nm */ |
| 166398 | + 190, /* (292) cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt columnname carglist */ |
| 166399 | + 190, /* (293) cmd ::= ALTER TABLE fullname DROP kwcolumn_opt nm */ |
| 166400 | + 296, /* (294) add_column_fullname ::= fullname */ |
| 166401 | + 190, /* (295) cmd ::= ALTER TABLE fullname RENAME kwcolumn_opt nm TO nm */ |
| 166402 | + 190, /* (296) cmd ::= create_vtab */ |
| 166403 | + 190, /* (297) cmd ::= create_vtab LP vtabarglist RP */ |
| 166404 | + 298, /* (298) create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm */ |
| 166405 | + 300, /* (299) vtabarg ::= */ |
| 166406 | + 301, /* (300) vtabargtoken ::= ANY */ |
| 166407 | + 301, /* (301) vtabargtoken ::= lp anylist RP */ |
| 166408 | + 302, /* (302) lp ::= LP */ |
| 166409 | + 266, /* (303) with ::= WITH wqlist */ |
| 166410 | + 266, /* (304) with ::= WITH RECURSIVE wqlist */ |
| 166411 | + 305, /* (305) wqas ::= AS */ |
| 166412 | + 305, /* (306) wqas ::= AS MATERIALIZED */ |
| 166413 | + 305, /* (307) wqas ::= AS NOT MATERIALIZED */ |
| 166414 | + 304, /* (308) wqitem ::= nm eidlist_opt wqas LP select RP */ |
| 166415 | + 241, /* (309) wqlist ::= wqitem */ |
| 166416 | + 241, /* (310) wqlist ::= wqlist COMMA wqitem */ |
| 166417 | + 306, /* (311) windowdefn_list ::= windowdefn */ |
| 166418 | + 306, /* (312) windowdefn_list ::= windowdefn_list COMMA windowdefn */ |
| 166419 | + 307, /* (313) windowdefn ::= nm AS LP window RP */ |
| 166420 | + 308, /* (314) window ::= PARTITION BY nexprlist orderby_opt frame_opt */ |
| 166421 | + 308, /* (315) window ::= nm PARTITION BY nexprlist orderby_opt frame_opt */ |
| 166422 | + 308, /* (316) window ::= ORDER BY sortlist frame_opt */ |
| 166423 | + 308, /* (317) window ::= nm ORDER BY sortlist frame_opt */ |
| 166424 | + 308, /* (318) window ::= frame_opt */ |
| 166425 | + 308, /* (319) window ::= nm frame_opt */ |
| 166426 | + 309, /* (320) frame_opt ::= */ |
| 166427 | + 309, /* (321) frame_opt ::= range_or_rows frame_bound_s frame_exclude_opt */ |
| 166428 | + 309, /* (322) frame_opt ::= range_or_rows BETWEEN frame_bound_s AND frame_bound_e frame_exclude_opt */ |
| 166429 | + 313, /* (323) range_or_rows ::= RANGE|ROWS|GROUPS */ |
| 166430 | + 315, /* (324) frame_bound_s ::= frame_bound */ |
| 166431 | + 315, /* (325) frame_bound_s ::= UNBOUNDED PRECEDING */ |
| 166432 | + 316, /* (326) frame_bound_e ::= frame_bound */ |
| 166433 | + 316, /* (327) frame_bound_e ::= UNBOUNDED FOLLOWING */ |
| 166434 | + 314, /* (328) frame_bound ::= expr PRECEDING|FOLLOWING */ |
| 166435 | + 314, /* (329) frame_bound ::= CURRENT ROW */ |
| 166436 | + 317, /* (330) frame_exclude_opt ::= */ |
| 166437 | + 317, /* (331) frame_exclude_opt ::= EXCLUDE frame_exclude */ |
| 166438 | + 318, /* (332) frame_exclude ::= NO OTHERS */ |
| 166439 | + 318, /* (333) frame_exclude ::= CURRENT ROW */ |
| 166440 | + 318, /* (334) frame_exclude ::= GROUP|TIES */ |
| 166441 | + 251, /* (335) window_clause ::= WINDOW windowdefn_list */ |
| 166442 | + 273, /* (336) filter_over ::= filter_clause over_clause */ |
| 166443 | + 273, /* (337) filter_over ::= over_clause */ |
| 166444 | + 273, /* (338) filter_over ::= filter_clause */ |
| 166445 | + 312, /* (339) over_clause ::= OVER LP window RP */ |
| 166446 | + 312, /* (340) over_clause ::= OVER nm */ |
| 166447 | + 311, /* (341) filter_clause ::= FILTER LP WHERE expr RP */ |
| 166448 | + 185, /* (342) input ::= cmdlist */ |
| 166449 | + 186, /* (343) cmdlist ::= cmdlist ecmd */ |
| 166450 | + 186, /* (344) cmdlist ::= ecmd */ |
| 166451 | + 187, /* (345) ecmd ::= SEMI */ |
| 166452 | + 187, /* (346) ecmd ::= cmdx SEMI */ |
| 166453 | + 187, /* (347) ecmd ::= explain cmdx SEMI */ |
| 166454 | + 192, /* (348) trans_opt ::= */ |
| 166455 | + 192, /* (349) trans_opt ::= TRANSACTION */ |
| 166456 | + 192, /* (350) trans_opt ::= TRANSACTION nm */ |
| 166457 | + 194, /* (351) savepoint_opt ::= SAVEPOINT */ |
| 166458 | + 194, /* (352) savepoint_opt ::= */ |
| 166459 | + 190, /* (353) cmd ::= create_table create_table_args */ |
| 166460 | + 203, /* (354) table_option_set ::= table_option */ |
| 166461 | + 201, /* (355) columnlist ::= columnlist COMMA columnname carglist */ |
| 166462 | + 201, /* (356) columnlist ::= columnname carglist */ |
| 166463 | + 193, /* (357) nm ::= ID|INDEXED */ |
| 166464 | + 193, /* (358) nm ::= STRING */ |
| 166465 | + 193, /* (359) nm ::= JOIN_KW */ |
| 166466 | + 208, /* (360) typetoken ::= typename */ |
| 166467 | + 209, /* (361) typename ::= ID|STRING */ |
| 166468 | + 210, /* (362) signed ::= plus_num */ |
| 166469 | + 210, /* (363) signed ::= minus_num */ |
| 166470 | + 207, /* (364) carglist ::= carglist ccons */ |
| 166471 | + 207, /* (365) carglist ::= */ |
| 166472 | + 215, /* (366) ccons ::= NULL onconf */ |
| 166473 | + 215, /* (367) ccons ::= GENERATED ALWAYS AS generated */ |
| 166474 | + 215, /* (368) ccons ::= AS generated */ |
| 166475 | + 202, /* (369) conslist_opt ::= COMMA conslist */ |
| 166476 | + 228, /* (370) conslist ::= conslist tconscomma tcons */ |
| 166477 | + 228, /* (371) conslist ::= tcons */ |
| 166478 | + 229, /* (372) tconscomma ::= */ |
| 166479 | + 233, /* (373) defer_subclause_opt ::= defer_subclause */ |
| 166480 | + 235, /* (374) resolvetype ::= raisetype */ |
| 166481 | + 239, /* (375) selectnowith ::= oneselect */ |
| 166482 | + 240, /* (376) oneselect ::= values */ |
| 166483 | + 254, /* (377) sclp ::= selcollist COMMA */ |
| 166484 | + 255, /* (378) as ::= ID|STRING */ |
| 166485 | + 264, /* (379) indexed_opt ::= indexed_by */ |
| 166486 | + 272, /* (380) returning ::= */ |
| 166487 | + 217, /* (381) expr ::= term */ |
| 166488 | + 274, /* (382) likeop ::= LIKE_KW|MATCH */ |
| 166489 | + 261, /* (383) exprlist ::= nexprlist */ |
| 166490 | + 284, /* (384) nmnum ::= plus_num */ |
| 166491 | + 284, /* (385) nmnum ::= nm */ |
| 166492 | + 284, /* (386) nmnum ::= ON */ |
| 166493 | + 284, /* (387) nmnum ::= DELETE */ |
| 166494 | + 284, /* (388) nmnum ::= DEFAULT */ |
| 166495 | + 211, /* (389) plus_num ::= INTEGER|FLOAT */ |
| 166496 | + 289, /* (390) foreach_clause ::= */ |
| 166497 | + 289, /* (391) foreach_clause ::= FOR EACH ROW */ |
| 166498 | + 292, /* (392) trnm ::= nm */ |
| 166499 | + 293, /* (393) tridxby ::= */ |
| 166500 | + 294, /* (394) database_kw_opt ::= DATABASE */ |
| 166501 | + 294, /* (395) database_kw_opt ::= */ |
| 166502 | + 297, /* (396) kwcolumn_opt ::= */ |
| 166503 | + 297, /* (397) kwcolumn_opt ::= COLUMNKW */ |
| 166504 | + 299, /* (398) vtabarglist ::= vtabarg */ |
| 166505 | + 299, /* (399) vtabarglist ::= vtabarglist COMMA vtabarg */ |
| 166506 | + 300, /* (400) vtabarg ::= vtabarg vtabargtoken */ |
| 166507 | + 303, /* (401) anylist ::= */ |
| 166508 | + 303, /* (402) anylist ::= anylist LP anylist RP */ |
| 166509 | + 303, /* (403) anylist ::= anylist ANY */ |
| 166510 | + 266, /* (404) with ::= */ |
| 166278 | 166511 | }; |
| 166279 | 166512 | |
| 166280 | 166513 | /* For rule J, yyRuleInfoNRhs[J] contains the negative of the number |
| 166281 | 166514 | ** of symbols on the right-hand side of that rule. */ |
| 166282 | 166515 | static const signed char yyRuleInfoNRhs[] = { |
| | @@ -166487,204 +166720,206 @@ |
| 166487 | 166720 | -5, /* (204) expr ::= expr likeop expr ESCAPE expr */ |
| 166488 | 166721 | -2, /* (205) expr ::= expr ISNULL|NOTNULL */ |
| 166489 | 166722 | -3, /* (206) expr ::= expr NOT NULL */ |
| 166490 | 166723 | -3, /* (207) expr ::= expr IS expr */ |
| 166491 | 166724 | -4, /* (208) expr ::= expr IS NOT expr */ |
| 166492 | | - -2, /* (209) expr ::= NOT expr */ |
| 166493 | | - -2, /* (210) expr ::= BITNOT expr */ |
| 166494 | | - -2, /* (211) expr ::= PLUS|MINUS expr */ |
| 166495 | | - -3, /* (212) expr ::= expr PTR expr */ |
| 166496 | | - -1, /* (213) between_op ::= BETWEEN */ |
| 166497 | | - -2, /* (214) between_op ::= NOT BETWEEN */ |
| 166498 | | - -5, /* (215) expr ::= expr between_op expr AND expr */ |
| 166499 | | - -1, /* (216) in_op ::= IN */ |
| 166500 | | - -2, /* (217) in_op ::= NOT IN */ |
| 166501 | | - -5, /* (218) expr ::= expr in_op LP exprlist RP */ |
| 166502 | | - -3, /* (219) expr ::= LP select RP */ |
| 166503 | | - -5, /* (220) expr ::= expr in_op LP select RP */ |
| 166504 | | - -5, /* (221) expr ::= expr in_op nm dbnm paren_exprlist */ |
| 166505 | | - -4, /* (222) expr ::= EXISTS LP select RP */ |
| 166506 | | - -5, /* (223) expr ::= CASE case_operand case_exprlist case_else END */ |
| 166507 | | - -5, /* (224) case_exprlist ::= case_exprlist WHEN expr THEN expr */ |
| 166508 | | - -4, /* (225) case_exprlist ::= WHEN expr THEN expr */ |
| 166509 | | - -2, /* (226) case_else ::= ELSE expr */ |
| 166510 | | - 0, /* (227) case_else ::= */ |
| 166511 | | - -1, /* (228) case_operand ::= expr */ |
| 166512 | | - 0, /* (229) case_operand ::= */ |
| 166513 | | - 0, /* (230) exprlist ::= */ |
| 166514 | | - -3, /* (231) nexprlist ::= nexprlist COMMA expr */ |
| 166515 | | - -1, /* (232) nexprlist ::= expr */ |
| 166516 | | - 0, /* (233) paren_exprlist ::= */ |
| 166517 | | - -3, /* (234) paren_exprlist ::= LP exprlist RP */ |
| 166518 | | - -12, /* (235) cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP sortlist RP where_opt */ |
| 166519 | | - -1, /* (236) uniqueflag ::= UNIQUE */ |
| 166520 | | - 0, /* (237) uniqueflag ::= */ |
| 166521 | | - 0, /* (238) eidlist_opt ::= */ |
| 166522 | | - -3, /* (239) eidlist_opt ::= LP eidlist RP */ |
| 166523 | | - -5, /* (240) eidlist ::= eidlist COMMA nm collate sortorder */ |
| 166524 | | - -3, /* (241) eidlist ::= nm collate sortorder */ |
| 166525 | | - 0, /* (242) collate ::= */ |
| 166526 | | - -2, /* (243) collate ::= COLLATE ID|STRING */ |
| 166527 | | - -4, /* (244) cmd ::= DROP INDEX ifexists fullname */ |
| 166528 | | - -2, /* (245) cmd ::= VACUUM vinto */ |
| 166529 | | - -3, /* (246) cmd ::= VACUUM nm vinto */ |
| 166530 | | - -2, /* (247) vinto ::= INTO expr */ |
| 166531 | | - 0, /* (248) vinto ::= */ |
| 166532 | | - -3, /* (249) cmd ::= PRAGMA nm dbnm */ |
| 166533 | | - -5, /* (250) cmd ::= PRAGMA nm dbnm EQ nmnum */ |
| 166534 | | - -6, /* (251) cmd ::= PRAGMA nm dbnm LP nmnum RP */ |
| 166535 | | - -5, /* (252) cmd ::= PRAGMA nm dbnm EQ minus_num */ |
| 166536 | | - -6, /* (253) cmd ::= PRAGMA nm dbnm LP minus_num RP */ |
| 166537 | | - -2, /* (254) plus_num ::= PLUS INTEGER|FLOAT */ |
| 166538 | | - -2, /* (255) minus_num ::= MINUS INTEGER|FLOAT */ |
| 166539 | | - -5, /* (256) cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END */ |
| 166540 | | - -11, /* (257) trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause */ |
| 166541 | | - -1, /* (258) trigger_time ::= BEFORE|AFTER */ |
| 166542 | | - -2, /* (259) trigger_time ::= INSTEAD OF */ |
| 166543 | | - 0, /* (260) trigger_time ::= */ |
| 166544 | | - -1, /* (261) trigger_event ::= DELETE|INSERT */ |
| 166545 | | - -1, /* (262) trigger_event ::= UPDATE */ |
| 166546 | | - -3, /* (263) trigger_event ::= UPDATE OF idlist */ |
| 166547 | | - 0, /* (264) when_clause ::= */ |
| 166548 | | - -2, /* (265) when_clause ::= WHEN expr */ |
| 166549 | | - -3, /* (266) trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI */ |
| 166550 | | - -2, /* (267) trigger_cmd_list ::= trigger_cmd SEMI */ |
| 166551 | | - -3, /* (268) trnm ::= nm DOT nm */ |
| 166552 | | - -3, /* (269) tridxby ::= INDEXED BY nm */ |
| 166553 | | - -2, /* (270) tridxby ::= NOT INDEXED */ |
| 166554 | | - -9, /* (271) trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist from where_opt scanpt */ |
| 166555 | | - -8, /* (272) trigger_cmd ::= scanpt insert_cmd INTO trnm idlist_opt select upsert scanpt */ |
| 166556 | | - -6, /* (273) trigger_cmd ::= DELETE FROM trnm tridxby where_opt scanpt */ |
| 166557 | | - -3, /* (274) trigger_cmd ::= scanpt select scanpt */ |
| 166558 | | - -4, /* (275) expr ::= RAISE LP IGNORE RP */ |
| 166559 | | - -6, /* (276) expr ::= RAISE LP raisetype COMMA nm RP */ |
| 166560 | | - -1, /* (277) raisetype ::= ROLLBACK */ |
| 166561 | | - -1, /* (278) raisetype ::= ABORT */ |
| 166562 | | - -1, /* (279) raisetype ::= FAIL */ |
| 166563 | | - -4, /* (280) cmd ::= DROP TRIGGER ifexists fullname */ |
| 166564 | | - -6, /* (281) cmd ::= ATTACH database_kw_opt expr AS expr key_opt */ |
| 166565 | | - -3, /* (282) cmd ::= DETACH database_kw_opt expr */ |
| 166566 | | - 0, /* (283) key_opt ::= */ |
| 166567 | | - -2, /* (284) key_opt ::= KEY expr */ |
| 166568 | | - -1, /* (285) cmd ::= REINDEX */ |
| 166569 | | - -3, /* (286) cmd ::= REINDEX nm dbnm */ |
| 166570 | | - -1, /* (287) cmd ::= ANALYZE */ |
| 166571 | | - -3, /* (288) cmd ::= ANALYZE nm dbnm */ |
| 166572 | | - -6, /* (289) cmd ::= ALTER TABLE fullname RENAME TO nm */ |
| 166573 | | - -7, /* (290) cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt columnname carglist */ |
| 166574 | | - -6, /* (291) cmd ::= ALTER TABLE fullname DROP kwcolumn_opt nm */ |
| 166575 | | - -1, /* (292) add_column_fullname ::= fullname */ |
| 166576 | | - -8, /* (293) cmd ::= ALTER TABLE fullname RENAME kwcolumn_opt nm TO nm */ |
| 166577 | | - -1, /* (294) cmd ::= create_vtab */ |
| 166578 | | - -4, /* (295) cmd ::= create_vtab LP vtabarglist RP */ |
| 166579 | | - -8, /* (296) create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm */ |
| 166580 | | - 0, /* (297) vtabarg ::= */ |
| 166581 | | - -1, /* (298) vtabargtoken ::= ANY */ |
| 166582 | | - -3, /* (299) vtabargtoken ::= lp anylist RP */ |
| 166583 | | - -1, /* (300) lp ::= LP */ |
| 166584 | | - -2, /* (301) with ::= WITH wqlist */ |
| 166585 | | - -3, /* (302) with ::= WITH RECURSIVE wqlist */ |
| 166586 | | - -1, /* (303) wqas ::= AS */ |
| 166587 | | - -2, /* (304) wqas ::= AS MATERIALIZED */ |
| 166588 | | - -3, /* (305) wqas ::= AS NOT MATERIALIZED */ |
| 166589 | | - -6, /* (306) wqitem ::= nm eidlist_opt wqas LP select RP */ |
| 166590 | | - -1, /* (307) wqlist ::= wqitem */ |
| 166591 | | - -3, /* (308) wqlist ::= wqlist COMMA wqitem */ |
| 166592 | | - -1, /* (309) windowdefn_list ::= windowdefn */ |
| 166593 | | - -3, /* (310) windowdefn_list ::= windowdefn_list COMMA windowdefn */ |
| 166594 | | - -5, /* (311) windowdefn ::= nm AS LP window RP */ |
| 166595 | | - -5, /* (312) window ::= PARTITION BY nexprlist orderby_opt frame_opt */ |
| 166596 | | - -6, /* (313) window ::= nm PARTITION BY nexprlist orderby_opt frame_opt */ |
| 166597 | | - -4, /* (314) window ::= ORDER BY sortlist frame_opt */ |
| 166598 | | - -5, /* (315) window ::= nm ORDER BY sortlist frame_opt */ |
| 166599 | | - -1, /* (316) window ::= frame_opt */ |
| 166600 | | - -2, /* (317) window ::= nm frame_opt */ |
| 166601 | | - 0, /* (318) frame_opt ::= */ |
| 166602 | | - -3, /* (319) frame_opt ::= range_or_rows frame_bound_s frame_exclude_opt */ |
| 166603 | | - -6, /* (320) frame_opt ::= range_or_rows BETWEEN frame_bound_s AND frame_bound_e frame_exclude_opt */ |
| 166604 | | - -1, /* (321) range_or_rows ::= RANGE|ROWS|GROUPS */ |
| 166605 | | - -1, /* (322) frame_bound_s ::= frame_bound */ |
| 166606 | | - -2, /* (323) frame_bound_s ::= UNBOUNDED PRECEDING */ |
| 166607 | | - -1, /* (324) frame_bound_e ::= frame_bound */ |
| 166608 | | - -2, /* (325) frame_bound_e ::= UNBOUNDED FOLLOWING */ |
| 166609 | | - -2, /* (326) frame_bound ::= expr PRECEDING|FOLLOWING */ |
| 166610 | | - -2, /* (327) frame_bound ::= CURRENT ROW */ |
| 166611 | | - 0, /* (328) frame_exclude_opt ::= */ |
| 166612 | | - -2, /* (329) frame_exclude_opt ::= EXCLUDE frame_exclude */ |
| 166613 | | - -2, /* (330) frame_exclude ::= NO OTHERS */ |
| 166614 | | - -2, /* (331) frame_exclude ::= CURRENT ROW */ |
| 166615 | | - -1, /* (332) frame_exclude ::= GROUP|TIES */ |
| 166616 | | - -2, /* (333) window_clause ::= WINDOW windowdefn_list */ |
| 166617 | | - -2, /* (334) filter_over ::= filter_clause over_clause */ |
| 166618 | | - -1, /* (335) filter_over ::= over_clause */ |
| 166619 | | - -1, /* (336) filter_over ::= filter_clause */ |
| 166620 | | - -4, /* (337) over_clause ::= OVER LP window RP */ |
| 166621 | | - -2, /* (338) over_clause ::= OVER nm */ |
| 166622 | | - -5, /* (339) filter_clause ::= FILTER LP WHERE expr RP */ |
| 166623 | | - -1, /* (340) input ::= cmdlist */ |
| 166624 | | - -2, /* (341) cmdlist ::= cmdlist ecmd */ |
| 166625 | | - -1, /* (342) cmdlist ::= ecmd */ |
| 166626 | | - -1, /* (343) ecmd ::= SEMI */ |
| 166627 | | - -2, /* (344) ecmd ::= cmdx SEMI */ |
| 166628 | | - -3, /* (345) ecmd ::= explain cmdx SEMI */ |
| 166629 | | - 0, /* (346) trans_opt ::= */ |
| 166630 | | - -1, /* (347) trans_opt ::= TRANSACTION */ |
| 166631 | | - -2, /* (348) trans_opt ::= TRANSACTION nm */ |
| 166632 | | - -1, /* (349) savepoint_opt ::= SAVEPOINT */ |
| 166633 | | - 0, /* (350) savepoint_opt ::= */ |
| 166634 | | - -2, /* (351) cmd ::= create_table create_table_args */ |
| 166635 | | - -1, /* (352) table_option_set ::= table_option */ |
| 166636 | | - -4, /* (353) columnlist ::= columnlist COMMA columnname carglist */ |
| 166637 | | - -2, /* (354) columnlist ::= columnname carglist */ |
| 166638 | | - -1, /* (355) nm ::= ID|INDEXED */ |
| 166639 | | - -1, /* (356) nm ::= STRING */ |
| 166640 | | - -1, /* (357) nm ::= JOIN_KW */ |
| 166641 | | - -1, /* (358) typetoken ::= typename */ |
| 166642 | | - -1, /* (359) typename ::= ID|STRING */ |
| 166643 | | - -1, /* (360) signed ::= plus_num */ |
| 166644 | | - -1, /* (361) signed ::= minus_num */ |
| 166645 | | - -2, /* (362) carglist ::= carglist ccons */ |
| 166646 | | - 0, /* (363) carglist ::= */ |
| 166647 | | - -2, /* (364) ccons ::= NULL onconf */ |
| 166648 | | - -4, /* (365) ccons ::= GENERATED ALWAYS AS generated */ |
| 166649 | | - -2, /* (366) ccons ::= AS generated */ |
| 166650 | | - -2, /* (367) conslist_opt ::= COMMA conslist */ |
| 166651 | | - -3, /* (368) conslist ::= conslist tconscomma tcons */ |
| 166652 | | - -1, /* (369) conslist ::= tcons */ |
| 166653 | | - 0, /* (370) tconscomma ::= */ |
| 166654 | | - -1, /* (371) defer_subclause_opt ::= defer_subclause */ |
| 166655 | | - -1, /* (372) resolvetype ::= raisetype */ |
| 166656 | | - -1, /* (373) selectnowith ::= oneselect */ |
| 166657 | | - -1, /* (374) oneselect ::= values */ |
| 166658 | | - -2, /* (375) sclp ::= selcollist COMMA */ |
| 166659 | | - -1, /* (376) as ::= ID|STRING */ |
| 166660 | | - -1, /* (377) indexed_opt ::= indexed_by */ |
| 166661 | | - 0, /* (378) returning ::= */ |
| 166662 | | - -1, /* (379) expr ::= term */ |
| 166663 | | - -1, /* (380) likeop ::= LIKE_KW|MATCH */ |
| 166664 | | - -1, /* (381) exprlist ::= nexprlist */ |
| 166665 | | - -1, /* (382) nmnum ::= plus_num */ |
| 166666 | | - -1, /* (383) nmnum ::= nm */ |
| 166667 | | - -1, /* (384) nmnum ::= ON */ |
| 166668 | | - -1, /* (385) nmnum ::= DELETE */ |
| 166669 | | - -1, /* (386) nmnum ::= DEFAULT */ |
| 166670 | | - -1, /* (387) plus_num ::= INTEGER|FLOAT */ |
| 166671 | | - 0, /* (388) foreach_clause ::= */ |
| 166672 | | - -3, /* (389) foreach_clause ::= FOR EACH ROW */ |
| 166673 | | - -1, /* (390) trnm ::= nm */ |
| 166674 | | - 0, /* (391) tridxby ::= */ |
| 166675 | | - -1, /* (392) database_kw_opt ::= DATABASE */ |
| 166676 | | - 0, /* (393) database_kw_opt ::= */ |
| 166677 | | - 0, /* (394) kwcolumn_opt ::= */ |
| 166678 | | - -1, /* (395) kwcolumn_opt ::= COLUMNKW */ |
| 166679 | | - -1, /* (396) vtabarglist ::= vtabarg */ |
| 166680 | | - -3, /* (397) vtabarglist ::= vtabarglist COMMA vtabarg */ |
| 166681 | | - -2, /* (398) vtabarg ::= vtabarg vtabargtoken */ |
| 166682 | | - 0, /* (399) anylist ::= */ |
| 166683 | | - -4, /* (400) anylist ::= anylist LP anylist RP */ |
| 166684 | | - -2, /* (401) anylist ::= anylist ANY */ |
| 166685 | | - 0, /* (402) with ::= */ |
| 166725 | + -6, /* (209) expr ::= expr IS NOT DISTINCT FROM expr */ |
| 166726 | + -5, /* (210) expr ::= expr IS DISTINCT FROM expr */ |
| 166727 | + -2, /* (211) expr ::= NOT expr */ |
| 166728 | + -2, /* (212) expr ::= BITNOT expr */ |
| 166729 | + -2, /* (213) expr ::= PLUS|MINUS expr */ |
| 166730 | + -3, /* (214) expr ::= expr PTR expr */ |
| 166731 | + -1, /* (215) between_op ::= BETWEEN */ |
| 166732 | + -2, /* (216) between_op ::= NOT BETWEEN */ |
| 166733 | + -5, /* (217) expr ::= expr between_op expr AND expr */ |
| 166734 | + -1, /* (218) in_op ::= IN */ |
| 166735 | + -2, /* (219) in_op ::= NOT IN */ |
| 166736 | + -5, /* (220) expr ::= expr in_op LP exprlist RP */ |
| 166737 | + -3, /* (221) expr ::= LP select RP */ |
| 166738 | + -5, /* (222) expr ::= expr in_op LP select RP */ |
| 166739 | + -5, /* (223) expr ::= expr in_op nm dbnm paren_exprlist */ |
| 166740 | + -4, /* (224) expr ::= EXISTS LP select RP */ |
| 166741 | + -5, /* (225) expr ::= CASE case_operand case_exprlist case_else END */ |
| 166742 | + -5, /* (226) case_exprlist ::= case_exprlist WHEN expr THEN expr */ |
| 166743 | + -4, /* (227) case_exprlist ::= WHEN expr THEN expr */ |
| 166744 | + -2, /* (228) case_else ::= ELSE expr */ |
| 166745 | + 0, /* (229) case_else ::= */ |
| 166746 | + -1, /* (230) case_operand ::= expr */ |
| 166747 | + 0, /* (231) case_operand ::= */ |
| 166748 | + 0, /* (232) exprlist ::= */ |
| 166749 | + -3, /* (233) nexprlist ::= nexprlist COMMA expr */ |
| 166750 | + -1, /* (234) nexprlist ::= expr */ |
| 166751 | + 0, /* (235) paren_exprlist ::= */ |
| 166752 | + -3, /* (236) paren_exprlist ::= LP exprlist RP */ |
| 166753 | + -12, /* (237) cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP sortlist RP where_opt */ |
| 166754 | + -1, /* (238) uniqueflag ::= UNIQUE */ |
| 166755 | + 0, /* (239) uniqueflag ::= */ |
| 166756 | + 0, /* (240) eidlist_opt ::= */ |
| 166757 | + -3, /* (241) eidlist_opt ::= LP eidlist RP */ |
| 166758 | + -5, /* (242) eidlist ::= eidlist COMMA nm collate sortorder */ |
| 166759 | + -3, /* (243) eidlist ::= nm collate sortorder */ |
| 166760 | + 0, /* (244) collate ::= */ |
| 166761 | + -2, /* (245) collate ::= COLLATE ID|STRING */ |
| 166762 | + -4, /* (246) cmd ::= DROP INDEX ifexists fullname */ |
| 166763 | + -2, /* (247) cmd ::= VACUUM vinto */ |
| 166764 | + -3, /* (248) cmd ::= VACUUM nm vinto */ |
| 166765 | + -2, /* (249) vinto ::= INTO expr */ |
| 166766 | + 0, /* (250) vinto ::= */ |
| 166767 | + -3, /* (251) cmd ::= PRAGMA nm dbnm */ |
| 166768 | + -5, /* (252) cmd ::= PRAGMA nm dbnm EQ nmnum */ |
| 166769 | + -6, /* (253) cmd ::= PRAGMA nm dbnm LP nmnum RP */ |
| 166770 | + -5, /* (254) cmd ::= PRAGMA nm dbnm EQ minus_num */ |
| 166771 | + -6, /* (255) cmd ::= PRAGMA nm dbnm LP minus_num RP */ |
| 166772 | + -2, /* (256) plus_num ::= PLUS INTEGER|FLOAT */ |
| 166773 | + -2, /* (257) minus_num ::= MINUS INTEGER|FLOAT */ |
| 166774 | + -5, /* (258) cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END */ |
| 166775 | + -11, /* (259) trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause */ |
| 166776 | + -1, /* (260) trigger_time ::= BEFORE|AFTER */ |
| 166777 | + -2, /* (261) trigger_time ::= INSTEAD OF */ |
| 166778 | + 0, /* (262) trigger_time ::= */ |
| 166779 | + -1, /* (263) trigger_event ::= DELETE|INSERT */ |
| 166780 | + -1, /* (264) trigger_event ::= UPDATE */ |
| 166781 | + -3, /* (265) trigger_event ::= UPDATE OF idlist */ |
| 166782 | + 0, /* (266) when_clause ::= */ |
| 166783 | + -2, /* (267) when_clause ::= WHEN expr */ |
| 166784 | + -3, /* (268) trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI */ |
| 166785 | + -2, /* (269) trigger_cmd_list ::= trigger_cmd SEMI */ |
| 166786 | + -3, /* (270) trnm ::= nm DOT nm */ |
| 166787 | + -3, /* (271) tridxby ::= INDEXED BY nm */ |
| 166788 | + -2, /* (272) tridxby ::= NOT INDEXED */ |
| 166789 | + -9, /* (273) trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist from where_opt scanpt */ |
| 166790 | + -8, /* (274) trigger_cmd ::= scanpt insert_cmd INTO trnm idlist_opt select upsert scanpt */ |
| 166791 | + -6, /* (275) trigger_cmd ::= DELETE FROM trnm tridxby where_opt scanpt */ |
| 166792 | + -3, /* (276) trigger_cmd ::= scanpt select scanpt */ |
| 166793 | + -4, /* (277) expr ::= RAISE LP IGNORE RP */ |
| 166794 | + -6, /* (278) expr ::= RAISE LP raisetype COMMA nm RP */ |
| 166795 | + -1, /* (279) raisetype ::= ROLLBACK */ |
| 166796 | + -1, /* (280) raisetype ::= ABORT */ |
| 166797 | + -1, /* (281) raisetype ::= FAIL */ |
| 166798 | + -4, /* (282) cmd ::= DROP TRIGGER ifexists fullname */ |
| 166799 | + -6, /* (283) cmd ::= ATTACH database_kw_opt expr AS expr key_opt */ |
| 166800 | + -3, /* (284) cmd ::= DETACH database_kw_opt expr */ |
| 166801 | + 0, /* (285) key_opt ::= */ |
| 166802 | + -2, /* (286) key_opt ::= KEY expr */ |
| 166803 | + -1, /* (287) cmd ::= REINDEX */ |
| 166804 | + -3, /* (288) cmd ::= REINDEX nm dbnm */ |
| 166805 | + -1, /* (289) cmd ::= ANALYZE */ |
| 166806 | + -3, /* (290) cmd ::= ANALYZE nm dbnm */ |
| 166807 | + -6, /* (291) cmd ::= ALTER TABLE fullname RENAME TO nm */ |
| 166808 | + -7, /* (292) cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt columnname carglist */ |
| 166809 | + -6, /* (293) cmd ::= ALTER TABLE fullname DROP kwcolumn_opt nm */ |
| 166810 | + -1, /* (294) add_column_fullname ::= fullname */ |
| 166811 | + -8, /* (295) cmd ::= ALTER TABLE fullname RENAME kwcolumn_opt nm TO nm */ |
| 166812 | + -1, /* (296) cmd ::= create_vtab */ |
| 166813 | + -4, /* (297) cmd ::= create_vtab LP vtabarglist RP */ |
| 166814 | + -8, /* (298) create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm */ |
| 166815 | + 0, /* (299) vtabarg ::= */ |
| 166816 | + -1, /* (300) vtabargtoken ::= ANY */ |
| 166817 | + -3, /* (301) vtabargtoken ::= lp anylist RP */ |
| 166818 | + -1, /* (302) lp ::= LP */ |
| 166819 | + -2, /* (303) with ::= WITH wqlist */ |
| 166820 | + -3, /* (304) with ::= WITH RECURSIVE wqlist */ |
| 166821 | + -1, /* (305) wqas ::= AS */ |
| 166822 | + -2, /* (306) wqas ::= AS MATERIALIZED */ |
| 166823 | + -3, /* (307) wqas ::= AS NOT MATERIALIZED */ |
| 166824 | + -6, /* (308) wqitem ::= nm eidlist_opt wqas LP select RP */ |
| 166825 | + -1, /* (309) wqlist ::= wqitem */ |
| 166826 | + -3, /* (310) wqlist ::= wqlist COMMA wqitem */ |
| 166827 | + -1, /* (311) windowdefn_list ::= windowdefn */ |
| 166828 | + -3, /* (312) windowdefn_list ::= windowdefn_list COMMA windowdefn */ |
| 166829 | + -5, /* (313) windowdefn ::= nm AS LP window RP */ |
| 166830 | + -5, /* (314) window ::= PARTITION BY nexprlist orderby_opt frame_opt */ |
| 166831 | + -6, /* (315) window ::= nm PARTITION BY nexprlist orderby_opt frame_opt */ |
| 166832 | + -4, /* (316) window ::= ORDER BY sortlist frame_opt */ |
| 166833 | + -5, /* (317) window ::= nm ORDER BY sortlist frame_opt */ |
| 166834 | + -1, /* (318) window ::= frame_opt */ |
| 166835 | + -2, /* (319) window ::= nm frame_opt */ |
| 166836 | + 0, /* (320) frame_opt ::= */ |
| 166837 | + -3, /* (321) frame_opt ::= range_or_rows frame_bound_s frame_exclude_opt */ |
| 166838 | + -6, /* (322) frame_opt ::= range_or_rows BETWEEN frame_bound_s AND frame_bound_e frame_exclude_opt */ |
| 166839 | + -1, /* (323) range_or_rows ::= RANGE|ROWS|GROUPS */ |
| 166840 | + -1, /* (324) frame_bound_s ::= frame_bound */ |
| 166841 | + -2, /* (325) frame_bound_s ::= UNBOUNDED PRECEDING */ |
| 166842 | + -1, /* (326) frame_bound_e ::= frame_bound */ |
| 166843 | + -2, /* (327) frame_bound_e ::= UNBOUNDED FOLLOWING */ |
| 166844 | + -2, /* (328) frame_bound ::= expr PRECEDING|FOLLOWING */ |
| 166845 | + -2, /* (329) frame_bound ::= CURRENT ROW */ |
| 166846 | + 0, /* (330) frame_exclude_opt ::= */ |
| 166847 | + -2, /* (331) frame_exclude_opt ::= EXCLUDE frame_exclude */ |
| 166848 | + -2, /* (332) frame_exclude ::= NO OTHERS */ |
| 166849 | + -2, /* (333) frame_exclude ::= CURRENT ROW */ |
| 166850 | + -1, /* (334) frame_exclude ::= GROUP|TIES */ |
| 166851 | + -2, /* (335) window_clause ::= WINDOW windowdefn_list */ |
| 166852 | + -2, /* (336) filter_over ::= filter_clause over_clause */ |
| 166853 | + -1, /* (337) filter_over ::= over_clause */ |
| 166854 | + -1, /* (338) filter_over ::= filter_clause */ |
| 166855 | + -4, /* (339) over_clause ::= OVER LP window RP */ |
| 166856 | + -2, /* (340) over_clause ::= OVER nm */ |
| 166857 | + -5, /* (341) filter_clause ::= FILTER LP WHERE expr RP */ |
| 166858 | + -1, /* (342) input ::= cmdlist */ |
| 166859 | + -2, /* (343) cmdlist ::= cmdlist ecmd */ |
| 166860 | + -1, /* (344) cmdlist ::= ecmd */ |
| 166861 | + -1, /* (345) ecmd ::= SEMI */ |
| 166862 | + -2, /* (346) ecmd ::= cmdx SEMI */ |
| 166863 | + -3, /* (347) ecmd ::= explain cmdx SEMI */ |
| 166864 | + 0, /* (348) trans_opt ::= */ |
| 166865 | + -1, /* (349) trans_opt ::= TRANSACTION */ |
| 166866 | + -2, /* (350) trans_opt ::= TRANSACTION nm */ |
| 166867 | + -1, /* (351) savepoint_opt ::= SAVEPOINT */ |
| 166868 | + 0, /* (352) savepoint_opt ::= */ |
| 166869 | + -2, /* (353) cmd ::= create_table create_table_args */ |
| 166870 | + -1, /* (354) table_option_set ::= table_option */ |
| 166871 | + -4, /* (355) columnlist ::= columnlist COMMA columnname carglist */ |
| 166872 | + -2, /* (356) columnlist ::= columnname carglist */ |
| 166873 | + -1, /* (357) nm ::= ID|INDEXED */ |
| 166874 | + -1, /* (358) nm ::= STRING */ |
| 166875 | + -1, /* (359) nm ::= JOIN_KW */ |
| 166876 | + -1, /* (360) typetoken ::= typename */ |
| 166877 | + -1, /* (361) typename ::= ID|STRING */ |
| 166878 | + -1, /* (362) signed ::= plus_num */ |
| 166879 | + -1, /* (363) signed ::= minus_num */ |
| 166880 | + -2, /* (364) carglist ::= carglist ccons */ |
| 166881 | + 0, /* (365) carglist ::= */ |
| 166882 | + -2, /* (366) ccons ::= NULL onconf */ |
| 166883 | + -4, /* (367) ccons ::= GENERATED ALWAYS AS generated */ |
| 166884 | + -2, /* (368) ccons ::= AS generated */ |
| 166885 | + -2, /* (369) conslist_opt ::= COMMA conslist */ |
| 166886 | + -3, /* (370) conslist ::= conslist tconscomma tcons */ |
| 166887 | + -1, /* (371) conslist ::= tcons */ |
| 166888 | + 0, /* (372) tconscomma ::= */ |
| 166889 | + -1, /* (373) defer_subclause_opt ::= defer_subclause */ |
| 166890 | + -1, /* (374) resolvetype ::= raisetype */ |
| 166891 | + -1, /* (375) selectnowith ::= oneselect */ |
| 166892 | + -1, /* (376) oneselect ::= values */ |
| 166893 | + -2, /* (377) sclp ::= selcollist COMMA */ |
| 166894 | + -1, /* (378) as ::= ID|STRING */ |
| 166895 | + -1, /* (379) indexed_opt ::= indexed_by */ |
| 166896 | + 0, /* (380) returning ::= */ |
| 166897 | + -1, /* (381) expr ::= term */ |
| 166898 | + -1, /* (382) likeop ::= LIKE_KW|MATCH */ |
| 166899 | + -1, /* (383) exprlist ::= nexprlist */ |
| 166900 | + -1, /* (384) nmnum ::= plus_num */ |
| 166901 | + -1, /* (385) nmnum ::= nm */ |
| 166902 | + -1, /* (386) nmnum ::= ON */ |
| 166903 | + -1, /* (387) nmnum ::= DELETE */ |
| 166904 | + -1, /* (388) nmnum ::= DEFAULT */ |
| 166905 | + -1, /* (389) plus_num ::= INTEGER|FLOAT */ |
| 166906 | + 0, /* (390) foreach_clause ::= */ |
| 166907 | + -3, /* (391) foreach_clause ::= FOR EACH ROW */ |
| 166908 | + -1, /* (392) trnm ::= nm */ |
| 166909 | + 0, /* (393) tridxby ::= */ |
| 166910 | + -1, /* (394) database_kw_opt ::= DATABASE */ |
| 166911 | + 0, /* (395) database_kw_opt ::= */ |
| 166912 | + 0, /* (396) kwcolumn_opt ::= */ |
| 166913 | + -1, /* (397) kwcolumn_opt ::= COLUMNKW */ |
| 166914 | + -1, /* (398) vtabarglist ::= vtabarg */ |
| 166915 | + -3, /* (399) vtabarglist ::= vtabarglist COMMA vtabarg */ |
| 166916 | + -2, /* (400) vtabarg ::= vtabarg vtabargtoken */ |
| 166917 | + 0, /* (401) anylist ::= */ |
| 166918 | + -4, /* (402) anylist ::= anylist LP anylist RP */ |
| 166919 | + -2, /* (403) anylist ::= anylist ANY */ |
| 166920 | + 0, /* (404) with ::= */ |
| 166686 | 166921 | }; |
| 166687 | 166922 | |
| 166688 | 166923 | static void yy_accept(yyParser*); /* Forward Declaration */ |
| 166689 | 166924 | |
| 166690 | 166925 | /* |
| | @@ -166740,11 +166975,11 @@ |
| 166740 | 166975 | {yymsp[1].minor.yy394 = TK_DEFERRED;} |
| 166741 | 166976 | break; |
| 166742 | 166977 | case 5: /* transtype ::= DEFERRED */ |
| 166743 | 166978 | case 6: /* transtype ::= IMMEDIATE */ yytestcase(yyruleno==6); |
| 166744 | 166979 | case 7: /* transtype ::= EXCLUSIVE */ yytestcase(yyruleno==7); |
| 166745 | | - case 321: /* range_or_rows ::= RANGE|ROWS|GROUPS */ yytestcase(yyruleno==321); |
| 166980 | + case 323: /* range_or_rows ::= RANGE|ROWS|GROUPS */ yytestcase(yyruleno==323); |
| 166746 | 166981 | {yymsp[0].minor.yy394 = yymsp[0].major; /*A-overwrites-X*/} |
| 166747 | 166982 | break; |
| 166748 | 166983 | case 8: /* cmd ::= COMMIT|END trans_opt */ |
| 166749 | 166984 | case 9: /* cmd ::= ROLLBACK trans_opt */ yytestcase(yyruleno==9); |
| 166750 | 166985 | {sqlite3EndTransaction(pParse,yymsp[-1].major);} |
| | @@ -166777,11 +167012,11 @@ |
| 166777 | 167012 | case 47: /* autoinc ::= */ yytestcase(yyruleno==47); |
| 166778 | 167013 | case 62: /* init_deferred_pred_opt ::= */ yytestcase(yyruleno==62); |
| 166779 | 167014 | case 72: /* defer_subclause_opt ::= */ yytestcase(yyruleno==72); |
| 166780 | 167015 | case 81: /* ifexists ::= */ yytestcase(yyruleno==81); |
| 166781 | 167016 | case 98: /* distinct ::= */ yytestcase(yyruleno==98); |
| 166782 | | - case 242: /* collate ::= */ yytestcase(yyruleno==242); |
| 167017 | + case 244: /* collate ::= */ yytestcase(yyruleno==244); |
| 166783 | 167018 | {yymsp[1].minor.yy394 = 0;} |
| 166784 | 167019 | break; |
| 166785 | 167020 | case 16: /* ifnotexists ::= IF NOT EXISTS */ |
| 166786 | 167021 | {yymsp[-2].minor.yy394 = 1;} |
| 166787 | 167022 | break; |
| | @@ -166961,13 +167196,13 @@ |
| 166961 | 167196 | case 171: /* insert_cmd ::= INSERT orconf */ yytestcase(yyruleno==171); |
| 166962 | 167197 | {yymsp[-1].minor.yy394 = yymsp[0].minor.yy394;} |
| 166963 | 167198 | break; |
| 166964 | 167199 | case 63: /* init_deferred_pred_opt ::= INITIALLY DEFERRED */ |
| 166965 | 167200 | case 80: /* ifexists ::= IF EXISTS */ yytestcase(yyruleno==80); |
| 166966 | | - case 214: /* between_op ::= NOT BETWEEN */ yytestcase(yyruleno==214); |
| 166967 | | - case 217: /* in_op ::= NOT IN */ yytestcase(yyruleno==217); |
| 166968 | | - case 243: /* collate ::= COLLATE ID|STRING */ yytestcase(yyruleno==243); |
| 167201 | + case 216: /* between_op ::= NOT BETWEEN */ yytestcase(yyruleno==216); |
| 167202 | + case 219: /* in_op ::= NOT IN */ yytestcase(yyruleno==219); |
| 167203 | + case 245: /* collate ::= COLLATE ID|STRING */ yytestcase(yyruleno==245); |
| 166969 | 167204 | {yymsp[-1].minor.yy394 = 1;} |
| 166970 | 167205 | break; |
| 166971 | 167206 | case 64: /* init_deferred_pred_opt ::= INITIALLY IMMEDIATE */ |
| 166972 | 167207 | {yymsp[-1].minor.yy394 = 0;} |
| 166973 | 167208 | break; |
| | @@ -167113,13 +167348,13 @@ |
| 167113 | 167348 | {yymsp[0].minor.yy394 = SF_All;} |
| 167114 | 167349 | break; |
| 167115 | 167350 | case 99: /* sclp ::= */ |
| 167116 | 167351 | case 132: /* orderby_opt ::= */ yytestcase(yyruleno==132); |
| 167117 | 167352 | case 142: /* groupby_opt ::= */ yytestcase(yyruleno==142); |
| 167118 | | - case 230: /* exprlist ::= */ yytestcase(yyruleno==230); |
| 167119 | | - case 233: /* paren_exprlist ::= */ yytestcase(yyruleno==233); |
| 167120 | | - case 238: /* eidlist_opt ::= */ yytestcase(yyruleno==238); |
| 167353 | + case 232: /* exprlist ::= */ yytestcase(yyruleno==232); |
| 167354 | + case 235: /* paren_exprlist ::= */ yytestcase(yyruleno==235); |
| 167355 | + case 240: /* eidlist_opt ::= */ yytestcase(yyruleno==240); |
| 167121 | 167356 | {yymsp[1].minor.yy322 = 0;} |
| 167122 | 167357 | break; |
| 167123 | 167358 | case 100: /* selcollist ::= sclp scanpt expr scanpt as */ |
| 167124 | 167359 | { |
| 167125 | 167360 | yymsp[-4].minor.yy322 = sqlite3ExprListAppend(pParse, yymsp[-4].minor.yy322, yymsp[-2].minor.yy528); |
| | @@ -167141,12 +167376,12 @@ |
| 167141 | 167376 | yymsp[-4].minor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy322, pDot); |
| 167142 | 167377 | } |
| 167143 | 167378 | break; |
| 167144 | 167379 | case 103: /* as ::= AS nm */ |
| 167145 | 167380 | case 115: /* dbnm ::= DOT nm */ yytestcase(yyruleno==115); |
| 167146 | | - case 254: /* plus_num ::= PLUS INTEGER|FLOAT */ yytestcase(yyruleno==254); |
| 167147 | | - case 255: /* minus_num ::= MINUS INTEGER|FLOAT */ yytestcase(yyruleno==255); |
| 167381 | + case 256: /* plus_num ::= PLUS INTEGER|FLOAT */ yytestcase(yyruleno==256); |
| 167382 | + case 257: /* minus_num ::= MINUS INTEGER|FLOAT */ yytestcase(yyruleno==257); |
| 167148 | 167383 | {yymsp[-1].minor.yy0 = yymsp[0].minor.yy0;} |
| 167149 | 167384 | break; |
| 167150 | 167385 | case 105: /* from ::= */ |
| 167151 | 167386 | case 108: /* stl_prefix ::= */ yytestcase(yyruleno==108); |
| 167152 | 167387 | {yymsp[1].minor.yy131 = 0;} |
| | @@ -167314,20 +167549,20 @@ |
| 167314 | 167549 | break; |
| 167315 | 167550 | case 144: /* having_opt ::= */ |
| 167316 | 167551 | case 146: /* limit_opt ::= */ yytestcase(yyruleno==146); |
| 167317 | 167552 | case 151: /* where_opt ::= */ yytestcase(yyruleno==151); |
| 167318 | 167553 | case 153: /* where_opt_ret ::= */ yytestcase(yyruleno==153); |
| 167319 | | - case 227: /* case_else ::= */ yytestcase(yyruleno==227); |
| 167320 | | - case 229: /* case_operand ::= */ yytestcase(yyruleno==229); |
| 167321 | | - case 248: /* vinto ::= */ yytestcase(yyruleno==248); |
| 167554 | + case 229: /* case_else ::= */ yytestcase(yyruleno==229); |
| 167555 | + case 231: /* case_operand ::= */ yytestcase(yyruleno==231); |
| 167556 | + case 250: /* vinto ::= */ yytestcase(yyruleno==250); |
| 167322 | 167557 | {yymsp[1].minor.yy528 = 0;} |
| 167323 | 167558 | break; |
| 167324 | 167559 | case 145: /* having_opt ::= HAVING expr */ |
| 167325 | 167560 | case 152: /* where_opt ::= WHERE expr */ yytestcase(yyruleno==152); |
| 167326 | 167561 | case 154: /* where_opt_ret ::= WHERE expr */ yytestcase(yyruleno==154); |
| 167327 | | - case 226: /* case_else ::= ELSE expr */ yytestcase(yyruleno==226); |
| 167328 | | - case 247: /* vinto ::= INTO expr */ yytestcase(yyruleno==247); |
| 167562 | + case 228: /* case_else ::= ELSE expr */ yytestcase(yyruleno==228); |
| 167563 | + case 249: /* vinto ::= INTO expr */ yytestcase(yyruleno==249); |
| 167329 | 167564 | {yymsp[-1].minor.yy528 = yymsp[0].minor.yy528;} |
| 167330 | 167565 | break; |
| 167331 | 167566 | case 147: /* limit_opt ::= LIMIT expr */ |
| 167332 | 167567 | {yymsp[-1].minor.yy528 = sqlite3PExpr(pParse,TK_LIMIT,yymsp[0].minor.yy528,0);} |
| 167333 | 167568 | break; |
| | @@ -167351,11 +167586,22 @@ |
| 167351 | 167586 | break; |
| 167352 | 167587 | case 157: /* cmd ::= with UPDATE orconf xfullname indexed_opt SET setlist from where_opt_ret */ |
| 167353 | 167588 | { |
| 167354 | 167589 | sqlite3SrcListIndexedBy(pParse, yymsp[-5].minor.yy131, &yymsp[-4].minor.yy0); |
| 167355 | 167590 | sqlite3ExprListCheckLength(pParse,yymsp[-2].minor.yy322,"set list"); |
| 167356 | | - yymsp[-5].minor.yy131 = sqlite3SrcListAppendList(pParse, yymsp[-5].minor.yy131, yymsp[-1].minor.yy131); |
| 167591 | + if( yymsp[-1].minor.yy131 ){ |
| 167592 | + SrcList *pFromClause = yymsp[-1].minor.yy131; |
| 167593 | + if( pFromClause->nSrc>1 ){ |
| 167594 | + Select *pSubquery; |
| 167595 | + Token as; |
| 167596 | + pSubquery = sqlite3SelectNew(pParse,0,pFromClause,0,0,0,0,SF_NestedFrom,0); |
| 167597 | + as.n = 0; |
| 167598 | + as.z = 0; |
| 167599 | + pFromClause = sqlite3SrcListAppendFromTerm(pParse,0,0,0,&as,pSubquery,0); |
| 167600 | + } |
| 167601 | + yymsp[-5].minor.yy131 = sqlite3SrcListAppendList(pParse, yymsp[-5].minor.yy131, pFromClause); |
| 167602 | + } |
| 167357 | 167603 | sqlite3Update(pParse,yymsp[-5].minor.yy131,yymsp[-2].minor.yy322,yymsp[0].minor.yy528,yymsp[-6].minor.yy394,0,0,0); |
| 167358 | 167604 | } |
| 167359 | 167605 | break; |
| 167360 | 167606 | case 158: /* setlist ::= setlist COMMA nm EQ expr */ |
| 167361 | 167607 | { |
| | @@ -167597,33 +167843,45 @@ |
| 167597 | 167843 | { |
| 167598 | 167844 | yymsp[-3].minor.yy528 = sqlite3PExpr(pParse,TK_ISNOT,yymsp[-3].minor.yy528,yymsp[0].minor.yy528); |
| 167599 | 167845 | binaryToUnaryIfNull(pParse, yymsp[0].minor.yy528, yymsp[-3].minor.yy528, TK_NOTNULL); |
| 167600 | 167846 | } |
| 167601 | 167847 | break; |
| 167602 | | - case 209: /* expr ::= NOT expr */ |
| 167603 | | - case 210: /* expr ::= BITNOT expr */ yytestcase(yyruleno==210); |
| 167848 | + case 209: /* expr ::= expr IS NOT DISTINCT FROM expr */ |
| 167849 | +{ |
| 167850 | + yymsp[-5].minor.yy528 = sqlite3PExpr(pParse,TK_IS,yymsp[-5].minor.yy528,yymsp[0].minor.yy528); |
| 167851 | + binaryToUnaryIfNull(pParse, yymsp[0].minor.yy528, yymsp[-5].minor.yy528, TK_ISNULL); |
| 167852 | +} |
| 167853 | + break; |
| 167854 | + case 210: /* expr ::= expr IS DISTINCT FROM expr */ |
| 167855 | +{ |
| 167856 | + yymsp[-4].minor.yy528 = sqlite3PExpr(pParse,TK_ISNOT,yymsp[-4].minor.yy528,yymsp[0].minor.yy528); |
| 167857 | + binaryToUnaryIfNull(pParse, yymsp[0].minor.yy528, yymsp[-4].minor.yy528, TK_NOTNULL); |
| 167858 | +} |
| 167859 | + break; |
| 167860 | + case 211: /* expr ::= NOT expr */ |
| 167861 | + case 212: /* expr ::= BITNOT expr */ yytestcase(yyruleno==212); |
| 167604 | 167862 | {yymsp[-1].minor.yy528 = sqlite3PExpr(pParse, yymsp[-1].major, yymsp[0].minor.yy528, 0);/*A-overwrites-B*/} |
| 167605 | 167863 | break; |
| 167606 | | - case 211: /* expr ::= PLUS|MINUS expr */ |
| 167864 | + case 213: /* expr ::= PLUS|MINUS expr */ |
| 167607 | 167865 | { |
| 167608 | 167866 | yymsp[-1].minor.yy528 = sqlite3PExpr(pParse, yymsp[-1].major==TK_PLUS ? TK_UPLUS : TK_UMINUS, yymsp[0].minor.yy528, 0); |
| 167609 | 167867 | /*A-overwrites-B*/ |
| 167610 | 167868 | } |
| 167611 | 167869 | break; |
| 167612 | | - case 212: /* expr ::= expr PTR expr */ |
| 167870 | + case 214: /* expr ::= expr PTR expr */ |
| 167613 | 167871 | { |
| 167614 | 167872 | ExprList *pList = sqlite3ExprListAppend(pParse, 0, yymsp[-2].minor.yy528); |
| 167615 | 167873 | pList = sqlite3ExprListAppend(pParse, pList, yymsp[0].minor.yy528); |
| 167616 | 167874 | yylhsminor.yy528 = sqlite3ExprFunction(pParse, pList, &yymsp[-1].minor.yy0, 0); |
| 167617 | 167875 | } |
| 167618 | 167876 | yymsp[-2].minor.yy528 = yylhsminor.yy528; |
| 167619 | 167877 | break; |
| 167620 | | - case 213: /* between_op ::= BETWEEN */ |
| 167621 | | - case 216: /* in_op ::= IN */ yytestcase(yyruleno==216); |
| 167878 | + case 215: /* between_op ::= BETWEEN */ |
| 167879 | + case 218: /* in_op ::= IN */ yytestcase(yyruleno==218); |
| 167622 | 167880 | {yymsp[0].minor.yy394 = 0;} |
| 167623 | 167881 | break; |
| 167624 | | - case 215: /* expr ::= expr between_op expr AND expr */ |
| 167882 | + case 217: /* expr ::= expr between_op expr AND expr */ |
| 167625 | 167883 | { |
| 167626 | 167884 | ExprList *pList = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy528); |
| 167627 | 167885 | pList = sqlite3ExprListAppend(pParse,pList, yymsp[0].minor.yy528); |
| 167628 | 167886 | yymsp[-4].minor.yy528 = sqlite3PExpr(pParse, TK_BETWEEN, yymsp[-4].minor.yy528, 0); |
| 167629 | 167887 | if( yymsp[-4].minor.yy528 ){ |
| | @@ -167632,11 +167890,11 @@ |
| 167632 | 167890 | sqlite3ExprListDelete(pParse->db, pList); |
| 167633 | 167891 | } |
| 167634 | 167892 | if( yymsp[-3].minor.yy394 ) yymsp[-4].minor.yy528 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy528, 0); |
| 167635 | 167893 | } |
| 167636 | 167894 | break; |
| 167637 | | - case 218: /* expr ::= expr in_op LP exprlist RP */ |
| 167895 | + case 220: /* expr ::= expr in_op LP exprlist RP */ |
| 167638 | 167896 | { |
| 167639 | 167897 | if( yymsp[-1].minor.yy322==0 ){ |
| 167640 | 167898 | /* Expressions of the form |
| 167641 | 167899 | ** |
| 167642 | 167900 | ** expr1 IN () |
| | @@ -167644,11 +167902,12 @@ |
| 167644 | 167902 | ** |
| 167645 | 167903 | ** simplify to constants 0 (false) and 1 (true), respectively, |
| 167646 | 167904 | ** regardless of the value of expr1. |
| 167647 | 167905 | */ |
| 167648 | 167906 | sqlite3ExprUnmapAndDelete(pParse, yymsp[-4].minor.yy528); |
| 167649 | | - yymsp[-4].minor.yy528 = sqlite3Expr(pParse->db, TK_INTEGER, yymsp[-3].minor.yy394 ? "1" : "0"); |
| 167907 | + yymsp[-4].minor.yy528 = sqlite3Expr(pParse->db, TK_STRING, yymsp[-3].minor.yy394 ? "true" : "false"); |
| 167908 | + if( yymsp[-4].minor.yy528 ) sqlite3ExprIdToTrueFalse(yymsp[-4].minor.yy528); |
| 167650 | 167909 | }else{ |
| 167651 | 167910 | Expr *pRHS = yymsp[-1].minor.yy322->a[0].pExpr; |
| 167652 | 167911 | if( yymsp[-1].minor.yy322->nExpr==1 && sqlite3ExprIsConstant(pRHS) && yymsp[-4].minor.yy528->op!=TK_VECTOR ){ |
| 167653 | 167912 | yymsp[-1].minor.yy322->a[0].pExpr = 0; |
| 167654 | 167913 | sqlite3ExprListDelete(pParse->db, yymsp[-1].minor.yy322); |
| | @@ -167672,41 +167931,41 @@ |
| 167672 | 167931 | } |
| 167673 | 167932 | if( yymsp[-3].minor.yy394 ) yymsp[-4].minor.yy528 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy528, 0); |
| 167674 | 167933 | } |
| 167675 | 167934 | } |
| 167676 | 167935 | break; |
| 167677 | | - case 219: /* expr ::= LP select RP */ |
| 167936 | + case 221: /* expr ::= LP select RP */ |
| 167678 | 167937 | { |
| 167679 | 167938 | yymsp[-2].minor.yy528 = sqlite3PExpr(pParse, TK_SELECT, 0, 0); |
| 167680 | 167939 | sqlite3PExprAddSelect(pParse, yymsp[-2].minor.yy528, yymsp[-1].minor.yy47); |
| 167681 | 167940 | } |
| 167682 | 167941 | break; |
| 167683 | | - case 220: /* expr ::= expr in_op LP select RP */ |
| 167942 | + case 222: /* expr ::= expr in_op LP select RP */ |
| 167684 | 167943 | { |
| 167685 | 167944 | yymsp[-4].minor.yy528 = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy528, 0); |
| 167686 | 167945 | sqlite3PExprAddSelect(pParse, yymsp[-4].minor.yy528, yymsp[-1].minor.yy47); |
| 167687 | 167946 | if( yymsp[-3].minor.yy394 ) yymsp[-4].minor.yy528 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy528, 0); |
| 167688 | 167947 | } |
| 167689 | 167948 | break; |
| 167690 | | - case 221: /* expr ::= expr in_op nm dbnm paren_exprlist */ |
| 167949 | + case 223: /* expr ::= expr in_op nm dbnm paren_exprlist */ |
| 167691 | 167950 | { |
| 167692 | 167951 | SrcList *pSrc = sqlite3SrcListAppend(pParse, 0,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0); |
| 167693 | 167952 | Select *pSelect = sqlite3SelectNew(pParse, 0,pSrc,0,0,0,0,0,0); |
| 167694 | 167953 | if( yymsp[0].minor.yy322 ) sqlite3SrcListFuncArgs(pParse, pSelect ? pSrc : 0, yymsp[0].minor.yy322); |
| 167695 | 167954 | yymsp[-4].minor.yy528 = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy528, 0); |
| 167696 | 167955 | sqlite3PExprAddSelect(pParse, yymsp[-4].minor.yy528, pSelect); |
| 167697 | 167956 | if( yymsp[-3].minor.yy394 ) yymsp[-4].minor.yy528 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy528, 0); |
| 167698 | 167957 | } |
| 167699 | 167958 | break; |
| 167700 | | - case 222: /* expr ::= EXISTS LP select RP */ |
| 167959 | + case 224: /* expr ::= EXISTS LP select RP */ |
| 167701 | 167960 | { |
| 167702 | 167961 | Expr *p; |
| 167703 | 167962 | p = yymsp[-3].minor.yy528 = sqlite3PExpr(pParse, TK_EXISTS, 0, 0); |
| 167704 | 167963 | sqlite3PExprAddSelect(pParse, p, yymsp[-1].minor.yy47); |
| 167705 | 167964 | } |
| 167706 | 167965 | break; |
| 167707 | | - case 223: /* expr ::= CASE case_operand case_exprlist case_else END */ |
| 167966 | + case 225: /* expr ::= CASE case_operand case_exprlist case_else END */ |
| 167708 | 167967 | { |
| 167709 | 167968 | yymsp[-4].minor.yy528 = sqlite3PExpr(pParse, TK_CASE, yymsp[-3].minor.yy528, 0); |
| 167710 | 167969 | if( yymsp[-4].minor.yy528 ){ |
| 167711 | 167970 | yymsp[-4].minor.yy528->x.pList = yymsp[-1].minor.yy528 ? sqlite3ExprListAppend(pParse,yymsp[-2].minor.yy322,yymsp[-1].minor.yy528) : yymsp[-2].minor.yy322; |
| 167712 | 167971 | sqlite3ExprSetHeightAndFlags(pParse, yymsp[-4].minor.yy528); |
| | @@ -167714,406 +167973,406 @@ |
| 167714 | 167973 | sqlite3ExprListDelete(pParse->db, yymsp[-2].minor.yy322); |
| 167715 | 167974 | sqlite3ExprDelete(pParse->db, yymsp[-1].minor.yy528); |
| 167716 | 167975 | } |
| 167717 | 167976 | } |
| 167718 | 167977 | break; |
| 167719 | | - case 224: /* case_exprlist ::= case_exprlist WHEN expr THEN expr */ |
| 167978 | + case 226: /* case_exprlist ::= case_exprlist WHEN expr THEN expr */ |
| 167720 | 167979 | { |
| 167721 | 167980 | yymsp[-4].minor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy322, yymsp[-2].minor.yy528); |
| 167722 | 167981 | yymsp[-4].minor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy322, yymsp[0].minor.yy528); |
| 167723 | 167982 | } |
| 167724 | 167983 | break; |
| 167725 | | - case 225: /* case_exprlist ::= WHEN expr THEN expr */ |
| 167984 | + case 227: /* case_exprlist ::= WHEN expr THEN expr */ |
| 167726 | 167985 | { |
| 167727 | 167986 | yymsp[-3].minor.yy322 = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy528); |
| 167728 | 167987 | yymsp[-3].minor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-3].minor.yy322, yymsp[0].minor.yy528); |
| 167729 | 167988 | } |
| 167730 | 167989 | break; |
| 167731 | | - case 228: /* case_operand ::= expr */ |
| 167990 | + case 230: /* case_operand ::= expr */ |
| 167732 | 167991 | {yymsp[0].minor.yy528 = yymsp[0].minor.yy528; /*A-overwrites-X*/} |
| 167733 | 167992 | break; |
| 167734 | | - case 231: /* nexprlist ::= nexprlist COMMA expr */ |
| 167993 | + case 233: /* nexprlist ::= nexprlist COMMA expr */ |
| 167735 | 167994 | {yymsp[-2].minor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-2].minor.yy322,yymsp[0].minor.yy528);} |
| 167736 | 167995 | break; |
| 167737 | | - case 232: /* nexprlist ::= expr */ |
| 167996 | + case 234: /* nexprlist ::= expr */ |
| 167738 | 167997 | {yymsp[0].minor.yy322 = sqlite3ExprListAppend(pParse,0,yymsp[0].minor.yy528); /*A-overwrites-Y*/} |
| 167739 | 167998 | break; |
| 167740 | | - case 234: /* paren_exprlist ::= LP exprlist RP */ |
| 167741 | | - case 239: /* eidlist_opt ::= LP eidlist RP */ yytestcase(yyruleno==239); |
| 167999 | + case 236: /* paren_exprlist ::= LP exprlist RP */ |
| 168000 | + case 241: /* eidlist_opt ::= LP eidlist RP */ yytestcase(yyruleno==241); |
| 167742 | 168001 | {yymsp[-2].minor.yy322 = yymsp[-1].minor.yy322;} |
| 167743 | 168002 | break; |
| 167744 | | - case 235: /* cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP sortlist RP where_opt */ |
| 168003 | + case 237: /* cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP sortlist RP where_opt */ |
| 167745 | 168004 | { |
| 167746 | 168005 | sqlite3CreateIndex(pParse, &yymsp[-7].minor.yy0, &yymsp[-6].minor.yy0, |
| 167747 | 168006 | sqlite3SrcListAppend(pParse,0,&yymsp[-4].minor.yy0,0), yymsp[-2].minor.yy322, yymsp[-10].minor.yy394, |
| 167748 | 168007 | &yymsp[-11].minor.yy0, yymsp[0].minor.yy528, SQLITE_SO_ASC, yymsp[-8].minor.yy394, SQLITE_IDXTYPE_APPDEF); |
| 167749 | 168008 | if( IN_RENAME_OBJECT && pParse->pNewIndex ){ |
| 167750 | 168009 | sqlite3RenameTokenMap(pParse, pParse->pNewIndex->zName, &yymsp[-4].minor.yy0); |
| 167751 | 168010 | } |
| 167752 | 168011 | } |
| 167753 | 168012 | break; |
| 167754 | | - case 236: /* uniqueflag ::= UNIQUE */ |
| 167755 | | - case 278: /* raisetype ::= ABORT */ yytestcase(yyruleno==278); |
| 168013 | + case 238: /* uniqueflag ::= UNIQUE */ |
| 168014 | + case 280: /* raisetype ::= ABORT */ yytestcase(yyruleno==280); |
| 167756 | 168015 | {yymsp[0].minor.yy394 = OE_Abort;} |
| 167757 | 168016 | break; |
| 167758 | | - case 237: /* uniqueflag ::= */ |
| 168017 | + case 239: /* uniqueflag ::= */ |
| 167759 | 168018 | {yymsp[1].minor.yy394 = OE_None;} |
| 167760 | 168019 | break; |
| 167761 | | - case 240: /* eidlist ::= eidlist COMMA nm collate sortorder */ |
| 168020 | + case 242: /* eidlist ::= eidlist COMMA nm collate sortorder */ |
| 167762 | 168021 | { |
| 167763 | 168022 | yymsp[-4].minor.yy322 = parserAddExprIdListTerm(pParse, yymsp[-4].minor.yy322, &yymsp[-2].minor.yy0, yymsp[-1].minor.yy394, yymsp[0].minor.yy394); |
| 167764 | 168023 | } |
| 167765 | 168024 | break; |
| 167766 | | - case 241: /* eidlist ::= nm collate sortorder */ |
| 168025 | + case 243: /* eidlist ::= nm collate sortorder */ |
| 167767 | 168026 | { |
| 167768 | 168027 | yymsp[-2].minor.yy322 = parserAddExprIdListTerm(pParse, 0, &yymsp[-2].minor.yy0, yymsp[-1].minor.yy394, yymsp[0].minor.yy394); /*A-overwrites-Y*/ |
| 167769 | 168028 | } |
| 167770 | 168029 | break; |
| 167771 | | - case 244: /* cmd ::= DROP INDEX ifexists fullname */ |
| 168030 | + case 246: /* cmd ::= DROP INDEX ifexists fullname */ |
| 167772 | 168031 | {sqlite3DropIndex(pParse, yymsp[0].minor.yy131, yymsp[-1].minor.yy394);} |
| 167773 | 168032 | break; |
| 167774 | | - case 245: /* cmd ::= VACUUM vinto */ |
| 168033 | + case 247: /* cmd ::= VACUUM vinto */ |
| 167775 | 168034 | {sqlite3Vacuum(pParse,0,yymsp[0].minor.yy528);} |
| 167776 | 168035 | break; |
| 167777 | | - case 246: /* cmd ::= VACUUM nm vinto */ |
| 168036 | + case 248: /* cmd ::= VACUUM nm vinto */ |
| 167778 | 168037 | {sqlite3Vacuum(pParse,&yymsp[-1].minor.yy0,yymsp[0].minor.yy528);} |
| 167779 | 168038 | break; |
| 167780 | | - case 249: /* cmd ::= PRAGMA nm dbnm */ |
| 168039 | + case 251: /* cmd ::= PRAGMA nm dbnm */ |
| 167781 | 168040 | {sqlite3Pragma(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,0,0);} |
| 167782 | 168041 | break; |
| 167783 | | - case 250: /* cmd ::= PRAGMA nm dbnm EQ nmnum */ |
| 168042 | + case 252: /* cmd ::= PRAGMA nm dbnm EQ nmnum */ |
| 167784 | 168043 | {sqlite3Pragma(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0,0);} |
| 167785 | 168044 | break; |
| 167786 | | - case 251: /* cmd ::= PRAGMA nm dbnm LP nmnum RP */ |
| 168045 | + case 253: /* cmd ::= PRAGMA nm dbnm LP nmnum RP */ |
| 167787 | 168046 | {sqlite3Pragma(pParse,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,&yymsp[-1].minor.yy0,0);} |
| 167788 | 168047 | break; |
| 167789 | | - case 252: /* cmd ::= PRAGMA nm dbnm EQ minus_num */ |
| 168048 | + case 254: /* cmd ::= PRAGMA nm dbnm EQ minus_num */ |
| 167790 | 168049 | {sqlite3Pragma(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0,1);} |
| 167791 | 168050 | break; |
| 167792 | | - case 253: /* cmd ::= PRAGMA nm dbnm LP minus_num RP */ |
| 168051 | + case 255: /* cmd ::= PRAGMA nm dbnm LP minus_num RP */ |
| 167793 | 168052 | {sqlite3Pragma(pParse,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,&yymsp[-1].minor.yy0,1);} |
| 167794 | 168053 | break; |
| 167795 | | - case 256: /* cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END */ |
| 168054 | + case 258: /* cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END */ |
| 167796 | 168055 | { |
| 167797 | 168056 | Token all; |
| 167798 | 168057 | all.z = yymsp[-3].minor.yy0.z; |
| 167799 | 168058 | all.n = (int)(yymsp[0].minor.yy0.z - yymsp[-3].minor.yy0.z) + yymsp[0].minor.yy0.n; |
| 167800 | 168059 | sqlite3FinishTrigger(pParse, yymsp[-1].minor.yy33, &all); |
| 167801 | 168060 | } |
| 167802 | 168061 | break; |
| 167803 | | - case 257: /* trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause */ |
| 168062 | + case 259: /* trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause */ |
| 167804 | 168063 | { |
| 167805 | 168064 | sqlite3BeginTrigger(pParse, &yymsp[-7].minor.yy0, &yymsp[-6].minor.yy0, yymsp[-5].minor.yy394, yymsp[-4].minor.yy180.a, yymsp[-4].minor.yy180.b, yymsp[-2].minor.yy131, yymsp[0].minor.yy528, yymsp[-10].minor.yy394, yymsp[-8].minor.yy394); |
| 167806 | 168065 | yymsp[-10].minor.yy0 = (yymsp[-6].minor.yy0.n==0?yymsp[-7].minor.yy0:yymsp[-6].minor.yy0); /*A-overwrites-T*/ |
| 167807 | 168066 | } |
| 167808 | 168067 | break; |
| 167809 | | - case 258: /* trigger_time ::= BEFORE|AFTER */ |
| 168068 | + case 260: /* trigger_time ::= BEFORE|AFTER */ |
| 167810 | 168069 | { yymsp[0].minor.yy394 = yymsp[0].major; /*A-overwrites-X*/ } |
| 167811 | 168070 | break; |
| 167812 | | - case 259: /* trigger_time ::= INSTEAD OF */ |
| 168071 | + case 261: /* trigger_time ::= INSTEAD OF */ |
| 167813 | 168072 | { yymsp[-1].minor.yy394 = TK_INSTEAD;} |
| 167814 | 168073 | break; |
| 167815 | | - case 260: /* trigger_time ::= */ |
| 168074 | + case 262: /* trigger_time ::= */ |
| 167816 | 168075 | { yymsp[1].minor.yy394 = TK_BEFORE; } |
| 167817 | 168076 | break; |
| 167818 | | - case 261: /* trigger_event ::= DELETE|INSERT */ |
| 167819 | | - case 262: /* trigger_event ::= UPDATE */ yytestcase(yyruleno==262); |
| 168077 | + case 263: /* trigger_event ::= DELETE|INSERT */ |
| 168078 | + case 264: /* trigger_event ::= UPDATE */ yytestcase(yyruleno==264); |
| 167820 | 168079 | {yymsp[0].minor.yy180.a = yymsp[0].major; /*A-overwrites-X*/ yymsp[0].minor.yy180.b = 0;} |
| 167821 | 168080 | break; |
| 167822 | | - case 263: /* trigger_event ::= UPDATE OF idlist */ |
| 168081 | + case 265: /* trigger_event ::= UPDATE OF idlist */ |
| 167823 | 168082 | {yymsp[-2].minor.yy180.a = TK_UPDATE; yymsp[-2].minor.yy180.b = yymsp[0].minor.yy254;} |
| 167824 | 168083 | break; |
| 167825 | | - case 264: /* when_clause ::= */ |
| 167826 | | - case 283: /* key_opt ::= */ yytestcase(yyruleno==283); |
| 168084 | + case 266: /* when_clause ::= */ |
| 168085 | + case 285: /* key_opt ::= */ yytestcase(yyruleno==285); |
| 167827 | 168086 | { yymsp[1].minor.yy528 = 0; } |
| 167828 | 168087 | break; |
| 167829 | | - case 265: /* when_clause ::= WHEN expr */ |
| 167830 | | - case 284: /* key_opt ::= KEY expr */ yytestcase(yyruleno==284); |
| 168088 | + case 267: /* when_clause ::= WHEN expr */ |
| 168089 | + case 286: /* key_opt ::= KEY expr */ yytestcase(yyruleno==286); |
| 167831 | 168090 | { yymsp[-1].minor.yy528 = yymsp[0].minor.yy528; } |
| 167832 | 168091 | break; |
| 167833 | | - case 266: /* trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI */ |
| 168092 | + case 268: /* trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI */ |
| 167834 | 168093 | { |
| 167835 | 168094 | assert( yymsp[-2].minor.yy33!=0 ); |
| 167836 | 168095 | yymsp[-2].minor.yy33->pLast->pNext = yymsp[-1].minor.yy33; |
| 167837 | 168096 | yymsp[-2].minor.yy33->pLast = yymsp[-1].minor.yy33; |
| 167838 | 168097 | } |
| 167839 | 168098 | break; |
| 167840 | | - case 267: /* trigger_cmd_list ::= trigger_cmd SEMI */ |
| 168099 | + case 269: /* trigger_cmd_list ::= trigger_cmd SEMI */ |
| 167841 | 168100 | { |
| 167842 | 168101 | assert( yymsp[-1].minor.yy33!=0 ); |
| 167843 | 168102 | yymsp[-1].minor.yy33->pLast = yymsp[-1].minor.yy33; |
| 167844 | 168103 | } |
| 167845 | 168104 | break; |
| 167846 | | - case 268: /* trnm ::= nm DOT nm */ |
| 168105 | + case 270: /* trnm ::= nm DOT nm */ |
| 167847 | 168106 | { |
| 167848 | 168107 | yymsp[-2].minor.yy0 = yymsp[0].minor.yy0; |
| 167849 | 168108 | sqlite3ErrorMsg(pParse, |
| 167850 | 168109 | "qualified table names are not allowed on INSERT, UPDATE, and DELETE " |
| 167851 | 168110 | "statements within triggers"); |
| 167852 | 168111 | } |
| 167853 | 168112 | break; |
| 167854 | | - case 269: /* tridxby ::= INDEXED BY nm */ |
| 168113 | + case 271: /* tridxby ::= INDEXED BY nm */ |
| 167855 | 168114 | { |
| 167856 | 168115 | sqlite3ErrorMsg(pParse, |
| 167857 | 168116 | "the INDEXED BY clause is not allowed on UPDATE or DELETE statements " |
| 167858 | 168117 | "within triggers"); |
| 167859 | 168118 | } |
| 167860 | 168119 | break; |
| 167861 | | - case 270: /* tridxby ::= NOT INDEXED */ |
| 168120 | + case 272: /* tridxby ::= NOT INDEXED */ |
| 167862 | 168121 | { |
| 167863 | 168122 | sqlite3ErrorMsg(pParse, |
| 167864 | 168123 | "the NOT INDEXED clause is not allowed on UPDATE or DELETE statements " |
| 167865 | 168124 | "within triggers"); |
| 167866 | 168125 | } |
| 167867 | 168126 | break; |
| 167868 | | - case 271: /* trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist from where_opt scanpt */ |
| 168127 | + case 273: /* trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist from where_opt scanpt */ |
| 167869 | 168128 | {yylhsminor.yy33 = sqlite3TriggerUpdateStep(pParse, &yymsp[-6].minor.yy0, yymsp[-2].minor.yy131, yymsp[-3].minor.yy322, yymsp[-1].minor.yy528, yymsp[-7].minor.yy394, yymsp[-8].minor.yy0.z, yymsp[0].minor.yy522);} |
| 167870 | 168129 | yymsp[-8].minor.yy33 = yylhsminor.yy33; |
| 167871 | 168130 | break; |
| 167872 | | - case 272: /* trigger_cmd ::= scanpt insert_cmd INTO trnm idlist_opt select upsert scanpt */ |
| 168131 | + case 274: /* trigger_cmd ::= scanpt insert_cmd INTO trnm idlist_opt select upsert scanpt */ |
| 167873 | 168132 | { |
| 167874 | 168133 | yylhsminor.yy33 = sqlite3TriggerInsertStep(pParse,&yymsp[-4].minor.yy0,yymsp[-3].minor.yy254,yymsp[-2].minor.yy47,yymsp[-6].minor.yy394,yymsp[-1].minor.yy444,yymsp[-7].minor.yy522,yymsp[0].minor.yy522);/*yylhsminor.yy33-overwrites-yymsp[-6].minor.yy394*/ |
| 167875 | 168134 | } |
| 167876 | 168135 | yymsp[-7].minor.yy33 = yylhsminor.yy33; |
| 167877 | 168136 | break; |
| 167878 | | - case 273: /* trigger_cmd ::= DELETE FROM trnm tridxby where_opt scanpt */ |
| 168137 | + case 275: /* trigger_cmd ::= DELETE FROM trnm tridxby where_opt scanpt */ |
| 167879 | 168138 | {yylhsminor.yy33 = sqlite3TriggerDeleteStep(pParse, &yymsp[-3].minor.yy0, yymsp[-1].minor.yy528, yymsp[-5].minor.yy0.z, yymsp[0].minor.yy522);} |
| 167880 | 168139 | yymsp[-5].minor.yy33 = yylhsminor.yy33; |
| 167881 | 168140 | break; |
| 167882 | | - case 274: /* trigger_cmd ::= scanpt select scanpt */ |
| 168141 | + case 276: /* trigger_cmd ::= scanpt select scanpt */ |
| 167883 | 168142 | {yylhsminor.yy33 = sqlite3TriggerSelectStep(pParse->db, yymsp[-1].minor.yy47, yymsp[-2].minor.yy522, yymsp[0].minor.yy522); /*yylhsminor.yy33-overwrites-yymsp[-1].minor.yy47*/} |
| 167884 | 168143 | yymsp[-2].minor.yy33 = yylhsminor.yy33; |
| 167885 | 168144 | break; |
| 167886 | | - case 275: /* expr ::= RAISE LP IGNORE RP */ |
| 168145 | + case 277: /* expr ::= RAISE LP IGNORE RP */ |
| 167887 | 168146 | { |
| 167888 | 168147 | yymsp[-3].minor.yy528 = sqlite3PExpr(pParse, TK_RAISE, 0, 0); |
| 167889 | 168148 | if( yymsp[-3].minor.yy528 ){ |
| 167890 | 168149 | yymsp[-3].minor.yy528->affExpr = OE_Ignore; |
| 167891 | 168150 | } |
| 167892 | 168151 | } |
| 167893 | 168152 | break; |
| 167894 | | - case 276: /* expr ::= RAISE LP raisetype COMMA nm RP */ |
| 168153 | + case 278: /* expr ::= RAISE LP raisetype COMMA nm RP */ |
| 167895 | 168154 | { |
| 167896 | 168155 | yymsp[-5].minor.yy528 = sqlite3ExprAlloc(pParse->db, TK_RAISE, &yymsp[-1].minor.yy0, 1); |
| 167897 | 168156 | if( yymsp[-5].minor.yy528 ) { |
| 167898 | 168157 | yymsp[-5].minor.yy528->affExpr = (char)yymsp[-3].minor.yy394; |
| 167899 | 168158 | } |
| 167900 | 168159 | } |
| 167901 | 168160 | break; |
| 167902 | | - case 277: /* raisetype ::= ROLLBACK */ |
| 168161 | + case 279: /* raisetype ::= ROLLBACK */ |
| 167903 | 168162 | {yymsp[0].minor.yy394 = OE_Rollback;} |
| 167904 | 168163 | break; |
| 167905 | | - case 279: /* raisetype ::= FAIL */ |
| 168164 | + case 281: /* raisetype ::= FAIL */ |
| 167906 | 168165 | {yymsp[0].minor.yy394 = OE_Fail;} |
| 167907 | 168166 | break; |
| 167908 | | - case 280: /* cmd ::= DROP TRIGGER ifexists fullname */ |
| 168167 | + case 282: /* cmd ::= DROP TRIGGER ifexists fullname */ |
| 167909 | 168168 | { |
| 167910 | 168169 | sqlite3DropTrigger(pParse,yymsp[0].minor.yy131,yymsp[-1].minor.yy394); |
| 167911 | 168170 | } |
| 167912 | 168171 | break; |
| 167913 | | - case 281: /* cmd ::= ATTACH database_kw_opt expr AS expr key_opt */ |
| 168172 | + case 283: /* cmd ::= ATTACH database_kw_opt expr AS expr key_opt */ |
| 167914 | 168173 | { |
| 167915 | 168174 | sqlite3Attach(pParse, yymsp[-3].minor.yy528, yymsp[-1].minor.yy528, yymsp[0].minor.yy528); |
| 167916 | 168175 | } |
| 167917 | 168176 | break; |
| 167918 | | - case 282: /* cmd ::= DETACH database_kw_opt expr */ |
| 168177 | + case 284: /* cmd ::= DETACH database_kw_opt expr */ |
| 167919 | 168178 | { |
| 167920 | 168179 | sqlite3Detach(pParse, yymsp[0].minor.yy528); |
| 167921 | 168180 | } |
| 167922 | 168181 | break; |
| 167923 | | - case 285: /* cmd ::= REINDEX */ |
| 168182 | + case 287: /* cmd ::= REINDEX */ |
| 167924 | 168183 | {sqlite3Reindex(pParse, 0, 0);} |
| 167925 | 168184 | break; |
| 167926 | | - case 286: /* cmd ::= REINDEX nm dbnm */ |
| 168185 | + case 288: /* cmd ::= REINDEX nm dbnm */ |
| 167927 | 168186 | {sqlite3Reindex(pParse, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0);} |
| 167928 | 168187 | break; |
| 167929 | | - case 287: /* cmd ::= ANALYZE */ |
| 168188 | + case 289: /* cmd ::= ANALYZE */ |
| 167930 | 168189 | {sqlite3Analyze(pParse, 0, 0);} |
| 167931 | 168190 | break; |
| 167932 | | - case 288: /* cmd ::= ANALYZE nm dbnm */ |
| 168191 | + case 290: /* cmd ::= ANALYZE nm dbnm */ |
| 167933 | 168192 | {sqlite3Analyze(pParse, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0);} |
| 167934 | 168193 | break; |
| 167935 | | - case 289: /* cmd ::= ALTER TABLE fullname RENAME TO nm */ |
| 168194 | + case 291: /* cmd ::= ALTER TABLE fullname RENAME TO nm */ |
| 167936 | 168195 | { |
| 167937 | 168196 | sqlite3AlterRenameTable(pParse,yymsp[-3].minor.yy131,&yymsp[0].minor.yy0); |
| 167938 | 168197 | } |
| 167939 | 168198 | break; |
| 167940 | | - case 290: /* cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt columnname carglist */ |
| 168199 | + case 292: /* cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt columnname carglist */ |
| 167941 | 168200 | { |
| 167942 | 168201 | yymsp[-1].minor.yy0.n = (int)(pParse->sLastToken.z-yymsp[-1].minor.yy0.z) + pParse->sLastToken.n; |
| 167943 | 168202 | sqlite3AlterFinishAddColumn(pParse, &yymsp[-1].minor.yy0); |
| 167944 | 168203 | } |
| 167945 | 168204 | break; |
| 167946 | | - case 291: /* cmd ::= ALTER TABLE fullname DROP kwcolumn_opt nm */ |
| 168205 | + case 293: /* cmd ::= ALTER TABLE fullname DROP kwcolumn_opt nm */ |
| 167947 | 168206 | { |
| 167948 | 168207 | sqlite3AlterDropColumn(pParse, yymsp[-3].minor.yy131, &yymsp[0].minor.yy0); |
| 167949 | 168208 | } |
| 167950 | 168209 | break; |
| 167951 | | - case 292: /* add_column_fullname ::= fullname */ |
| 168210 | + case 294: /* add_column_fullname ::= fullname */ |
| 167952 | 168211 | { |
| 167953 | 168212 | disableLookaside(pParse); |
| 167954 | 168213 | sqlite3AlterBeginAddColumn(pParse, yymsp[0].minor.yy131); |
| 167955 | 168214 | } |
| 167956 | 168215 | break; |
| 167957 | | - case 293: /* cmd ::= ALTER TABLE fullname RENAME kwcolumn_opt nm TO nm */ |
| 168216 | + case 295: /* cmd ::= ALTER TABLE fullname RENAME kwcolumn_opt nm TO nm */ |
| 167958 | 168217 | { |
| 167959 | 168218 | sqlite3AlterRenameColumn(pParse, yymsp[-5].minor.yy131, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); |
| 167960 | 168219 | } |
| 167961 | 168220 | break; |
| 167962 | | - case 294: /* cmd ::= create_vtab */ |
| 168221 | + case 296: /* cmd ::= create_vtab */ |
| 167963 | 168222 | {sqlite3VtabFinishParse(pParse,0);} |
| 167964 | 168223 | break; |
| 167965 | | - case 295: /* cmd ::= create_vtab LP vtabarglist RP */ |
| 168224 | + case 297: /* cmd ::= create_vtab LP vtabarglist RP */ |
| 167966 | 168225 | {sqlite3VtabFinishParse(pParse,&yymsp[0].minor.yy0);} |
| 167967 | 168226 | break; |
| 167968 | | - case 296: /* create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm */ |
| 168227 | + case 298: /* create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm */ |
| 167969 | 168228 | { |
| 167970 | 168229 | sqlite3VtabBeginParse(pParse, &yymsp[-3].minor.yy0, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-4].minor.yy394); |
| 167971 | 168230 | } |
| 167972 | 168231 | break; |
| 167973 | | - case 297: /* vtabarg ::= */ |
| 168232 | + case 299: /* vtabarg ::= */ |
| 167974 | 168233 | {sqlite3VtabArgInit(pParse);} |
| 167975 | 168234 | break; |
| 167976 | | - case 298: /* vtabargtoken ::= ANY */ |
| 167977 | | - case 299: /* vtabargtoken ::= lp anylist RP */ yytestcase(yyruleno==299); |
| 167978 | | - case 300: /* lp ::= LP */ yytestcase(yyruleno==300); |
| 168235 | + case 300: /* vtabargtoken ::= ANY */ |
| 168236 | + case 301: /* vtabargtoken ::= lp anylist RP */ yytestcase(yyruleno==301); |
| 168237 | + case 302: /* lp ::= LP */ yytestcase(yyruleno==302); |
| 167979 | 168238 | {sqlite3VtabArgExtend(pParse,&yymsp[0].minor.yy0);} |
| 167980 | 168239 | break; |
| 167981 | | - case 301: /* with ::= WITH wqlist */ |
| 167982 | | - case 302: /* with ::= WITH RECURSIVE wqlist */ yytestcase(yyruleno==302); |
| 168240 | + case 303: /* with ::= WITH wqlist */ |
| 168241 | + case 304: /* with ::= WITH RECURSIVE wqlist */ yytestcase(yyruleno==304); |
| 167983 | 168242 | { sqlite3WithPush(pParse, yymsp[0].minor.yy521, 1); } |
| 167984 | 168243 | break; |
| 167985 | | - case 303: /* wqas ::= AS */ |
| 168244 | + case 305: /* wqas ::= AS */ |
| 167986 | 168245 | {yymsp[0].minor.yy516 = M10d_Any;} |
| 167987 | 168246 | break; |
| 167988 | | - case 304: /* wqas ::= AS MATERIALIZED */ |
| 168247 | + case 306: /* wqas ::= AS MATERIALIZED */ |
| 167989 | 168248 | {yymsp[-1].minor.yy516 = M10d_Yes;} |
| 167990 | 168249 | break; |
| 167991 | | - case 305: /* wqas ::= AS NOT MATERIALIZED */ |
| 168250 | + case 307: /* wqas ::= AS NOT MATERIALIZED */ |
| 167992 | 168251 | {yymsp[-2].minor.yy516 = M10d_No;} |
| 167993 | 168252 | break; |
| 167994 | | - case 306: /* wqitem ::= nm eidlist_opt wqas LP select RP */ |
| 168253 | + case 308: /* wqitem ::= nm eidlist_opt wqas LP select RP */ |
| 167995 | 168254 | { |
| 167996 | 168255 | yymsp[-5].minor.yy385 = sqlite3CteNew(pParse, &yymsp[-5].minor.yy0, yymsp[-4].minor.yy322, yymsp[-1].minor.yy47, yymsp[-3].minor.yy516); /*A-overwrites-X*/ |
| 167997 | 168256 | } |
| 167998 | 168257 | break; |
| 167999 | | - case 307: /* wqlist ::= wqitem */ |
| 168258 | + case 309: /* wqlist ::= wqitem */ |
| 168000 | 168259 | { |
| 168001 | 168260 | yymsp[0].minor.yy521 = sqlite3WithAdd(pParse, 0, yymsp[0].minor.yy385); /*A-overwrites-X*/ |
| 168002 | 168261 | } |
| 168003 | 168262 | break; |
| 168004 | | - case 308: /* wqlist ::= wqlist COMMA wqitem */ |
| 168263 | + case 310: /* wqlist ::= wqlist COMMA wqitem */ |
| 168005 | 168264 | { |
| 168006 | 168265 | yymsp[-2].minor.yy521 = sqlite3WithAdd(pParse, yymsp[-2].minor.yy521, yymsp[0].minor.yy385); |
| 168007 | 168266 | } |
| 168008 | 168267 | break; |
| 168009 | | - case 309: /* windowdefn_list ::= windowdefn */ |
| 168268 | + case 311: /* windowdefn_list ::= windowdefn */ |
| 168010 | 168269 | { yylhsminor.yy41 = yymsp[0].minor.yy41; } |
| 168011 | 168270 | yymsp[0].minor.yy41 = yylhsminor.yy41; |
| 168012 | 168271 | break; |
| 168013 | | - case 310: /* windowdefn_list ::= windowdefn_list COMMA windowdefn */ |
| 168272 | + case 312: /* windowdefn_list ::= windowdefn_list COMMA windowdefn */ |
| 168014 | 168273 | { |
| 168015 | 168274 | assert( yymsp[0].minor.yy41!=0 ); |
| 168016 | 168275 | sqlite3WindowChain(pParse, yymsp[0].minor.yy41, yymsp[-2].minor.yy41); |
| 168017 | 168276 | yymsp[0].minor.yy41->pNextWin = yymsp[-2].minor.yy41; |
| 168018 | 168277 | yylhsminor.yy41 = yymsp[0].minor.yy41; |
| 168019 | 168278 | } |
| 168020 | 168279 | yymsp[-2].minor.yy41 = yylhsminor.yy41; |
| 168021 | 168280 | break; |
| 168022 | | - case 311: /* windowdefn ::= nm AS LP window RP */ |
| 168281 | + case 313: /* windowdefn ::= nm AS LP window RP */ |
| 168023 | 168282 | { |
| 168024 | 168283 | if( ALWAYS(yymsp[-1].minor.yy41) ){ |
| 168025 | 168284 | yymsp[-1].minor.yy41->zName = sqlite3DbStrNDup(pParse->db, yymsp[-4].minor.yy0.z, yymsp[-4].minor.yy0.n); |
| 168026 | 168285 | } |
| 168027 | 168286 | yylhsminor.yy41 = yymsp[-1].minor.yy41; |
| 168028 | 168287 | } |
| 168029 | 168288 | yymsp[-4].minor.yy41 = yylhsminor.yy41; |
| 168030 | 168289 | break; |
| 168031 | | - case 312: /* window ::= PARTITION BY nexprlist orderby_opt frame_opt */ |
| 168290 | + case 314: /* window ::= PARTITION BY nexprlist orderby_opt frame_opt */ |
| 168032 | 168291 | { |
| 168033 | 168292 | yymsp[-4].minor.yy41 = sqlite3WindowAssemble(pParse, yymsp[0].minor.yy41, yymsp[-2].minor.yy322, yymsp[-1].minor.yy322, 0); |
| 168034 | 168293 | } |
| 168035 | 168294 | break; |
| 168036 | | - case 313: /* window ::= nm PARTITION BY nexprlist orderby_opt frame_opt */ |
| 168295 | + case 315: /* window ::= nm PARTITION BY nexprlist orderby_opt frame_opt */ |
| 168037 | 168296 | { |
| 168038 | 168297 | yylhsminor.yy41 = sqlite3WindowAssemble(pParse, yymsp[0].minor.yy41, yymsp[-2].minor.yy322, yymsp[-1].minor.yy322, &yymsp[-5].minor.yy0); |
| 168039 | 168298 | } |
| 168040 | 168299 | yymsp[-5].minor.yy41 = yylhsminor.yy41; |
| 168041 | 168300 | break; |
| 168042 | | - case 314: /* window ::= ORDER BY sortlist frame_opt */ |
| 168301 | + case 316: /* window ::= ORDER BY sortlist frame_opt */ |
| 168043 | 168302 | { |
| 168044 | 168303 | yymsp[-3].minor.yy41 = sqlite3WindowAssemble(pParse, yymsp[0].minor.yy41, 0, yymsp[-1].minor.yy322, 0); |
| 168045 | 168304 | } |
| 168046 | 168305 | break; |
| 168047 | | - case 315: /* window ::= nm ORDER BY sortlist frame_opt */ |
| 168306 | + case 317: /* window ::= nm ORDER BY sortlist frame_opt */ |
| 168048 | 168307 | { |
| 168049 | 168308 | yylhsminor.yy41 = sqlite3WindowAssemble(pParse, yymsp[0].minor.yy41, 0, yymsp[-1].minor.yy322, &yymsp[-4].minor.yy0); |
| 168050 | 168309 | } |
| 168051 | 168310 | yymsp[-4].minor.yy41 = yylhsminor.yy41; |
| 168052 | 168311 | break; |
| 168053 | | - case 316: /* window ::= frame_opt */ |
| 168054 | | - case 335: /* filter_over ::= over_clause */ yytestcase(yyruleno==335); |
| 168312 | + case 318: /* window ::= frame_opt */ |
| 168313 | + case 337: /* filter_over ::= over_clause */ yytestcase(yyruleno==337); |
| 168055 | 168314 | { |
| 168056 | 168315 | yylhsminor.yy41 = yymsp[0].minor.yy41; |
| 168057 | 168316 | } |
| 168058 | 168317 | yymsp[0].minor.yy41 = yylhsminor.yy41; |
| 168059 | 168318 | break; |
| 168060 | | - case 317: /* window ::= nm frame_opt */ |
| 168319 | + case 319: /* window ::= nm frame_opt */ |
| 168061 | 168320 | { |
| 168062 | 168321 | yylhsminor.yy41 = sqlite3WindowAssemble(pParse, yymsp[0].minor.yy41, 0, 0, &yymsp[-1].minor.yy0); |
| 168063 | 168322 | } |
| 168064 | 168323 | yymsp[-1].minor.yy41 = yylhsminor.yy41; |
| 168065 | 168324 | break; |
| 168066 | | - case 318: /* frame_opt ::= */ |
| 168325 | + case 320: /* frame_opt ::= */ |
| 168067 | 168326 | { |
| 168068 | 168327 | yymsp[1].minor.yy41 = sqlite3WindowAlloc(pParse, 0, TK_UNBOUNDED, 0, TK_CURRENT, 0, 0); |
| 168069 | 168328 | } |
| 168070 | 168329 | break; |
| 168071 | | - case 319: /* frame_opt ::= range_or_rows frame_bound_s frame_exclude_opt */ |
| 168330 | + case 321: /* frame_opt ::= range_or_rows frame_bound_s frame_exclude_opt */ |
| 168072 | 168331 | { |
| 168073 | 168332 | yylhsminor.yy41 = sqlite3WindowAlloc(pParse, yymsp[-2].minor.yy394, yymsp[-1].minor.yy595.eType, yymsp[-1].minor.yy595.pExpr, TK_CURRENT, 0, yymsp[0].minor.yy516); |
| 168074 | 168333 | } |
| 168075 | 168334 | yymsp[-2].minor.yy41 = yylhsminor.yy41; |
| 168076 | 168335 | break; |
| 168077 | | - case 320: /* frame_opt ::= range_or_rows BETWEEN frame_bound_s AND frame_bound_e frame_exclude_opt */ |
| 168336 | + case 322: /* frame_opt ::= range_or_rows BETWEEN frame_bound_s AND frame_bound_e frame_exclude_opt */ |
| 168078 | 168337 | { |
| 168079 | 168338 | yylhsminor.yy41 = sqlite3WindowAlloc(pParse, yymsp[-5].minor.yy394, yymsp[-3].minor.yy595.eType, yymsp[-3].minor.yy595.pExpr, yymsp[-1].minor.yy595.eType, yymsp[-1].minor.yy595.pExpr, yymsp[0].minor.yy516); |
| 168080 | 168339 | } |
| 168081 | 168340 | yymsp[-5].minor.yy41 = yylhsminor.yy41; |
| 168082 | 168341 | break; |
| 168083 | | - case 322: /* frame_bound_s ::= frame_bound */ |
| 168084 | | - case 324: /* frame_bound_e ::= frame_bound */ yytestcase(yyruleno==324); |
| 168342 | + case 324: /* frame_bound_s ::= frame_bound */ |
| 168343 | + case 326: /* frame_bound_e ::= frame_bound */ yytestcase(yyruleno==326); |
| 168085 | 168344 | {yylhsminor.yy595 = yymsp[0].minor.yy595;} |
| 168086 | 168345 | yymsp[0].minor.yy595 = yylhsminor.yy595; |
| 168087 | 168346 | break; |
| 168088 | | - case 323: /* frame_bound_s ::= UNBOUNDED PRECEDING */ |
| 168089 | | - case 325: /* frame_bound_e ::= UNBOUNDED FOLLOWING */ yytestcase(yyruleno==325); |
| 168090 | | - case 327: /* frame_bound ::= CURRENT ROW */ yytestcase(yyruleno==327); |
| 168347 | + case 325: /* frame_bound_s ::= UNBOUNDED PRECEDING */ |
| 168348 | + case 327: /* frame_bound_e ::= UNBOUNDED FOLLOWING */ yytestcase(yyruleno==327); |
| 168349 | + case 329: /* frame_bound ::= CURRENT ROW */ yytestcase(yyruleno==329); |
| 168091 | 168350 | {yylhsminor.yy595.eType = yymsp[-1].major; yylhsminor.yy595.pExpr = 0;} |
| 168092 | 168351 | yymsp[-1].minor.yy595 = yylhsminor.yy595; |
| 168093 | 168352 | break; |
| 168094 | | - case 326: /* frame_bound ::= expr PRECEDING|FOLLOWING */ |
| 168353 | + case 328: /* frame_bound ::= expr PRECEDING|FOLLOWING */ |
| 168095 | 168354 | {yylhsminor.yy595.eType = yymsp[0].major; yylhsminor.yy595.pExpr = yymsp[-1].minor.yy528;} |
| 168096 | 168355 | yymsp[-1].minor.yy595 = yylhsminor.yy595; |
| 168097 | 168356 | break; |
| 168098 | | - case 328: /* frame_exclude_opt ::= */ |
| 168357 | + case 330: /* frame_exclude_opt ::= */ |
| 168099 | 168358 | {yymsp[1].minor.yy516 = 0;} |
| 168100 | 168359 | break; |
| 168101 | | - case 329: /* frame_exclude_opt ::= EXCLUDE frame_exclude */ |
| 168360 | + case 331: /* frame_exclude_opt ::= EXCLUDE frame_exclude */ |
| 168102 | 168361 | {yymsp[-1].minor.yy516 = yymsp[0].minor.yy516;} |
| 168103 | 168362 | break; |
| 168104 | | - case 330: /* frame_exclude ::= NO OTHERS */ |
| 168105 | | - case 331: /* frame_exclude ::= CURRENT ROW */ yytestcase(yyruleno==331); |
| 168363 | + case 332: /* frame_exclude ::= NO OTHERS */ |
| 168364 | + case 333: /* frame_exclude ::= CURRENT ROW */ yytestcase(yyruleno==333); |
| 168106 | 168365 | {yymsp[-1].minor.yy516 = yymsp[-1].major; /*A-overwrites-X*/} |
| 168107 | 168366 | break; |
| 168108 | | - case 332: /* frame_exclude ::= GROUP|TIES */ |
| 168367 | + case 334: /* frame_exclude ::= GROUP|TIES */ |
| 168109 | 168368 | {yymsp[0].minor.yy516 = yymsp[0].major; /*A-overwrites-X*/} |
| 168110 | 168369 | break; |
| 168111 | | - case 333: /* window_clause ::= WINDOW windowdefn_list */ |
| 168370 | + case 335: /* window_clause ::= WINDOW windowdefn_list */ |
| 168112 | 168371 | { yymsp[-1].minor.yy41 = yymsp[0].minor.yy41; } |
| 168113 | 168372 | break; |
| 168114 | | - case 334: /* filter_over ::= filter_clause over_clause */ |
| 168373 | + case 336: /* filter_over ::= filter_clause over_clause */ |
| 168115 | 168374 | { |
| 168116 | 168375 | if( yymsp[0].minor.yy41 ){ |
| 168117 | 168376 | yymsp[0].minor.yy41->pFilter = yymsp[-1].minor.yy528; |
| 168118 | 168377 | }else{ |
| 168119 | 168378 | sqlite3ExprDelete(pParse->db, yymsp[-1].minor.yy528); |
| | @@ -168120,11 +168379,11 @@ |
| 168120 | 168379 | } |
| 168121 | 168380 | yylhsminor.yy41 = yymsp[0].minor.yy41; |
| 168122 | 168381 | } |
| 168123 | 168382 | yymsp[-1].minor.yy41 = yylhsminor.yy41; |
| 168124 | 168383 | break; |
| 168125 | | - case 336: /* filter_over ::= filter_clause */ |
| 168384 | + case 338: /* filter_over ::= filter_clause */ |
| 168126 | 168385 | { |
| 168127 | 168386 | yylhsminor.yy41 = (Window*)sqlite3DbMallocZero(pParse->db, sizeof(Window)); |
| 168128 | 168387 | if( yylhsminor.yy41 ){ |
| 168129 | 168388 | yylhsminor.yy41->eFrmType = TK_FILTER; |
| 168130 | 168389 | yylhsminor.yy41->pFilter = yymsp[0].minor.yy528; |
| | @@ -168132,91 +168391,91 @@ |
| 168132 | 168391 | sqlite3ExprDelete(pParse->db, yymsp[0].minor.yy528); |
| 168133 | 168392 | } |
| 168134 | 168393 | } |
| 168135 | 168394 | yymsp[0].minor.yy41 = yylhsminor.yy41; |
| 168136 | 168395 | break; |
| 168137 | | - case 337: /* over_clause ::= OVER LP window RP */ |
| 168396 | + case 339: /* over_clause ::= OVER LP window RP */ |
| 168138 | 168397 | { |
| 168139 | 168398 | yymsp[-3].minor.yy41 = yymsp[-1].minor.yy41; |
| 168140 | 168399 | assert( yymsp[-3].minor.yy41!=0 ); |
| 168141 | 168400 | } |
| 168142 | 168401 | break; |
| 168143 | | - case 338: /* over_clause ::= OVER nm */ |
| 168402 | + case 340: /* over_clause ::= OVER nm */ |
| 168144 | 168403 | { |
| 168145 | 168404 | yymsp[-1].minor.yy41 = (Window*)sqlite3DbMallocZero(pParse->db, sizeof(Window)); |
| 168146 | 168405 | if( yymsp[-1].minor.yy41 ){ |
| 168147 | 168406 | yymsp[-1].minor.yy41->zName = sqlite3DbStrNDup(pParse->db, yymsp[0].minor.yy0.z, yymsp[0].minor.yy0.n); |
| 168148 | 168407 | } |
| 168149 | 168408 | } |
| 168150 | 168409 | break; |
| 168151 | | - case 339: /* filter_clause ::= FILTER LP WHERE expr RP */ |
| 168410 | + case 341: /* filter_clause ::= FILTER LP WHERE expr RP */ |
| 168152 | 168411 | { yymsp[-4].minor.yy528 = yymsp[-1].minor.yy528; } |
| 168153 | 168412 | break; |
| 168154 | 168413 | default: |
| 168155 | | - /* (340) input ::= cmdlist */ yytestcase(yyruleno==340); |
| 168156 | | - /* (341) cmdlist ::= cmdlist ecmd */ yytestcase(yyruleno==341); |
| 168157 | | - /* (342) cmdlist ::= ecmd (OPTIMIZED OUT) */ assert(yyruleno!=342); |
| 168158 | | - /* (343) ecmd ::= SEMI */ yytestcase(yyruleno==343); |
| 168159 | | - /* (344) ecmd ::= cmdx SEMI */ yytestcase(yyruleno==344); |
| 168160 | | - /* (345) ecmd ::= explain cmdx SEMI (NEVER REDUCES) */ assert(yyruleno!=345); |
| 168161 | | - /* (346) trans_opt ::= */ yytestcase(yyruleno==346); |
| 168162 | | - /* (347) trans_opt ::= TRANSACTION */ yytestcase(yyruleno==347); |
| 168163 | | - /* (348) trans_opt ::= TRANSACTION nm */ yytestcase(yyruleno==348); |
| 168164 | | - /* (349) savepoint_opt ::= SAVEPOINT */ yytestcase(yyruleno==349); |
| 168165 | | - /* (350) savepoint_opt ::= */ yytestcase(yyruleno==350); |
| 168166 | | - /* (351) cmd ::= create_table create_table_args */ yytestcase(yyruleno==351); |
| 168167 | | - /* (352) table_option_set ::= table_option (OPTIMIZED OUT) */ assert(yyruleno!=352); |
| 168168 | | - /* (353) columnlist ::= columnlist COMMA columnname carglist */ yytestcase(yyruleno==353); |
| 168169 | | - /* (354) columnlist ::= columnname carglist */ yytestcase(yyruleno==354); |
| 168170 | | - /* (355) nm ::= ID|INDEXED */ yytestcase(yyruleno==355); |
| 168171 | | - /* (356) nm ::= STRING */ yytestcase(yyruleno==356); |
| 168172 | | - /* (357) nm ::= JOIN_KW */ yytestcase(yyruleno==357); |
| 168173 | | - /* (358) typetoken ::= typename */ yytestcase(yyruleno==358); |
| 168174 | | - /* (359) typename ::= ID|STRING */ yytestcase(yyruleno==359); |
| 168175 | | - /* (360) signed ::= plus_num (OPTIMIZED OUT) */ assert(yyruleno!=360); |
| 168176 | | - /* (361) signed ::= minus_num (OPTIMIZED OUT) */ assert(yyruleno!=361); |
| 168177 | | - /* (362) carglist ::= carglist ccons */ yytestcase(yyruleno==362); |
| 168178 | | - /* (363) carglist ::= */ yytestcase(yyruleno==363); |
| 168179 | | - /* (364) ccons ::= NULL onconf */ yytestcase(yyruleno==364); |
| 168180 | | - /* (365) ccons ::= GENERATED ALWAYS AS generated */ yytestcase(yyruleno==365); |
| 168181 | | - /* (366) ccons ::= AS generated */ yytestcase(yyruleno==366); |
| 168182 | | - /* (367) conslist_opt ::= COMMA conslist */ yytestcase(yyruleno==367); |
| 168183 | | - /* (368) conslist ::= conslist tconscomma tcons */ yytestcase(yyruleno==368); |
| 168184 | | - /* (369) conslist ::= tcons (OPTIMIZED OUT) */ assert(yyruleno!=369); |
| 168185 | | - /* (370) tconscomma ::= */ yytestcase(yyruleno==370); |
| 168186 | | - /* (371) defer_subclause_opt ::= defer_subclause (OPTIMIZED OUT) */ assert(yyruleno!=371); |
| 168187 | | - /* (372) resolvetype ::= raisetype (OPTIMIZED OUT) */ assert(yyruleno!=372); |
| 168188 | | - /* (373) selectnowith ::= oneselect (OPTIMIZED OUT) */ assert(yyruleno!=373); |
| 168189 | | - /* (374) oneselect ::= values */ yytestcase(yyruleno==374); |
| 168190 | | - /* (375) sclp ::= selcollist COMMA */ yytestcase(yyruleno==375); |
| 168191 | | - /* (376) as ::= ID|STRING */ yytestcase(yyruleno==376); |
| 168192 | | - /* (377) indexed_opt ::= indexed_by (OPTIMIZED OUT) */ assert(yyruleno!=377); |
| 168193 | | - /* (378) returning ::= */ yytestcase(yyruleno==378); |
| 168194 | | - /* (379) expr ::= term (OPTIMIZED OUT) */ assert(yyruleno!=379); |
| 168195 | | - /* (380) likeop ::= LIKE_KW|MATCH */ yytestcase(yyruleno==380); |
| 168196 | | - /* (381) exprlist ::= nexprlist */ yytestcase(yyruleno==381); |
| 168197 | | - /* (382) nmnum ::= plus_num (OPTIMIZED OUT) */ assert(yyruleno!=382); |
| 168198 | | - /* (383) nmnum ::= nm (OPTIMIZED OUT) */ assert(yyruleno!=383); |
| 168199 | | - /* (384) nmnum ::= ON */ yytestcase(yyruleno==384); |
| 168200 | | - /* (385) nmnum ::= DELETE */ yytestcase(yyruleno==385); |
| 168201 | | - /* (386) nmnum ::= DEFAULT */ yytestcase(yyruleno==386); |
| 168202 | | - /* (387) plus_num ::= INTEGER|FLOAT */ yytestcase(yyruleno==387); |
| 168203 | | - /* (388) foreach_clause ::= */ yytestcase(yyruleno==388); |
| 168204 | | - /* (389) foreach_clause ::= FOR EACH ROW */ yytestcase(yyruleno==389); |
| 168205 | | - /* (390) trnm ::= nm */ yytestcase(yyruleno==390); |
| 168206 | | - /* (391) tridxby ::= */ yytestcase(yyruleno==391); |
| 168207 | | - /* (392) database_kw_opt ::= DATABASE */ yytestcase(yyruleno==392); |
| 168208 | | - /* (393) database_kw_opt ::= */ yytestcase(yyruleno==393); |
| 168209 | | - /* (394) kwcolumn_opt ::= */ yytestcase(yyruleno==394); |
| 168210 | | - /* (395) kwcolumn_opt ::= COLUMNKW */ yytestcase(yyruleno==395); |
| 168211 | | - /* (396) vtabarglist ::= vtabarg */ yytestcase(yyruleno==396); |
| 168212 | | - /* (397) vtabarglist ::= vtabarglist COMMA vtabarg */ yytestcase(yyruleno==397); |
| 168213 | | - /* (398) vtabarg ::= vtabarg vtabargtoken */ yytestcase(yyruleno==398); |
| 168214 | | - /* (399) anylist ::= */ yytestcase(yyruleno==399); |
| 168215 | | - /* (400) anylist ::= anylist LP anylist RP */ yytestcase(yyruleno==400); |
| 168216 | | - /* (401) anylist ::= anylist ANY */ yytestcase(yyruleno==401); |
| 168217 | | - /* (402) with ::= */ yytestcase(yyruleno==402); |
| 168414 | + /* (342) input ::= cmdlist */ yytestcase(yyruleno==342); |
| 168415 | + /* (343) cmdlist ::= cmdlist ecmd */ yytestcase(yyruleno==343); |
| 168416 | + /* (344) cmdlist ::= ecmd (OPTIMIZED OUT) */ assert(yyruleno!=344); |
| 168417 | + /* (345) ecmd ::= SEMI */ yytestcase(yyruleno==345); |
| 168418 | + /* (346) ecmd ::= cmdx SEMI */ yytestcase(yyruleno==346); |
| 168419 | + /* (347) ecmd ::= explain cmdx SEMI (NEVER REDUCES) */ assert(yyruleno!=347); |
| 168420 | + /* (348) trans_opt ::= */ yytestcase(yyruleno==348); |
| 168421 | + /* (349) trans_opt ::= TRANSACTION */ yytestcase(yyruleno==349); |
| 168422 | + /* (350) trans_opt ::= TRANSACTION nm */ yytestcase(yyruleno==350); |
| 168423 | + /* (351) savepoint_opt ::= SAVEPOINT */ yytestcase(yyruleno==351); |
| 168424 | + /* (352) savepoint_opt ::= */ yytestcase(yyruleno==352); |
| 168425 | + /* (353) cmd ::= create_table create_table_args */ yytestcase(yyruleno==353); |
| 168426 | + /* (354) table_option_set ::= table_option (OPTIMIZED OUT) */ assert(yyruleno!=354); |
| 168427 | + /* (355) columnlist ::= columnlist COMMA columnname carglist */ yytestcase(yyruleno==355); |
| 168428 | + /* (356) columnlist ::= columnname carglist */ yytestcase(yyruleno==356); |
| 168429 | + /* (357) nm ::= ID|INDEXED */ yytestcase(yyruleno==357); |
| 168430 | + /* (358) nm ::= STRING */ yytestcase(yyruleno==358); |
| 168431 | + /* (359) nm ::= JOIN_KW */ yytestcase(yyruleno==359); |
| 168432 | + /* (360) typetoken ::= typename */ yytestcase(yyruleno==360); |
| 168433 | + /* (361) typename ::= ID|STRING */ yytestcase(yyruleno==361); |
| 168434 | + /* (362) signed ::= plus_num (OPTIMIZED OUT) */ assert(yyruleno!=362); |
| 168435 | + /* (363) signed ::= minus_num (OPTIMIZED OUT) */ assert(yyruleno!=363); |
| 168436 | + /* (364) carglist ::= carglist ccons */ yytestcase(yyruleno==364); |
| 168437 | + /* (365) carglist ::= */ yytestcase(yyruleno==365); |
| 168438 | + /* (366) ccons ::= NULL onconf */ yytestcase(yyruleno==366); |
| 168439 | + /* (367) ccons ::= GENERATED ALWAYS AS generated */ yytestcase(yyruleno==367); |
| 168440 | + /* (368) ccons ::= AS generated */ yytestcase(yyruleno==368); |
| 168441 | + /* (369) conslist_opt ::= COMMA conslist */ yytestcase(yyruleno==369); |
| 168442 | + /* (370) conslist ::= conslist tconscomma tcons */ yytestcase(yyruleno==370); |
| 168443 | + /* (371) conslist ::= tcons (OPTIMIZED OUT) */ assert(yyruleno!=371); |
| 168444 | + /* (372) tconscomma ::= */ yytestcase(yyruleno==372); |
| 168445 | + /* (373) defer_subclause_opt ::= defer_subclause (OPTIMIZED OUT) */ assert(yyruleno!=373); |
| 168446 | + /* (374) resolvetype ::= raisetype (OPTIMIZED OUT) */ assert(yyruleno!=374); |
| 168447 | + /* (375) selectnowith ::= oneselect (OPTIMIZED OUT) */ assert(yyruleno!=375); |
| 168448 | + /* (376) oneselect ::= values */ yytestcase(yyruleno==376); |
| 168449 | + /* (377) sclp ::= selcollist COMMA */ yytestcase(yyruleno==377); |
| 168450 | + /* (378) as ::= ID|STRING */ yytestcase(yyruleno==378); |
| 168451 | + /* (379) indexed_opt ::= indexed_by (OPTIMIZED OUT) */ assert(yyruleno!=379); |
| 168452 | + /* (380) returning ::= */ yytestcase(yyruleno==380); |
| 168453 | + /* (381) expr ::= term (OPTIMIZED OUT) */ assert(yyruleno!=381); |
| 168454 | + /* (382) likeop ::= LIKE_KW|MATCH */ yytestcase(yyruleno==382); |
| 168455 | + /* (383) exprlist ::= nexprlist */ yytestcase(yyruleno==383); |
| 168456 | + /* (384) nmnum ::= plus_num (OPTIMIZED OUT) */ assert(yyruleno!=384); |
| 168457 | + /* (385) nmnum ::= nm (OPTIMIZED OUT) */ assert(yyruleno!=385); |
| 168458 | + /* (386) nmnum ::= ON */ yytestcase(yyruleno==386); |
| 168459 | + /* (387) nmnum ::= DELETE */ yytestcase(yyruleno==387); |
| 168460 | + /* (388) nmnum ::= DEFAULT */ yytestcase(yyruleno==388); |
| 168461 | + /* (389) plus_num ::= INTEGER|FLOAT */ yytestcase(yyruleno==389); |
| 168462 | + /* (390) foreach_clause ::= */ yytestcase(yyruleno==390); |
| 168463 | + /* (391) foreach_clause ::= FOR EACH ROW */ yytestcase(yyruleno==391); |
| 168464 | + /* (392) trnm ::= nm */ yytestcase(yyruleno==392); |
| 168465 | + /* (393) tridxby ::= */ yytestcase(yyruleno==393); |
| 168466 | + /* (394) database_kw_opt ::= DATABASE */ yytestcase(yyruleno==394); |
| 168467 | + /* (395) database_kw_opt ::= */ yytestcase(yyruleno==395); |
| 168468 | + /* (396) kwcolumn_opt ::= */ yytestcase(yyruleno==396); |
| 168469 | + /* (397) kwcolumn_opt ::= COLUMNKW */ yytestcase(yyruleno==397); |
| 168470 | + /* (398) vtabarglist ::= vtabarg */ yytestcase(yyruleno==398); |
| 168471 | + /* (399) vtabarglist ::= vtabarglist COMMA vtabarg */ yytestcase(yyruleno==399); |
| 168472 | + /* (400) vtabarg ::= vtabarg vtabargtoken */ yytestcase(yyruleno==400); |
| 168473 | + /* (401) anylist ::= */ yytestcase(yyruleno==401); |
| 168474 | + /* (402) anylist ::= anylist LP anylist RP */ yytestcase(yyruleno==402); |
| 168475 | + /* (403) anylist ::= anylist ANY */ yytestcase(yyruleno==403); |
| 168476 | + /* (404) with ::= */ yytestcase(yyruleno==404); |
| 168218 | 168477 | break; |
| 168219 | 168478 | /********** End reduce actions ************************************************/ |
| 168220 | 168479 | }; |
| 168221 | 168480 | assert( yyruleno<sizeof(yyRuleInfoLhs)/sizeof(yyRuleInfoLhs[0]) ); |
| 168222 | 168481 | yygoto = yyRuleInfoLhs[yyruleno]; |
| | @@ -174912,10 +175171,28 @@ |
| 174912 | 175171 | */ |
| 174913 | 175172 | SQLITE_PRIVATE Btree *sqlite3DbNameToBtree(sqlite3 *db, const char *zDbName){ |
| 174914 | 175173 | int iDb = zDbName ? sqlite3FindDbName(db, zDbName) : 0; |
| 174915 | 175174 | return iDb<0 ? 0 : db->aDb[iDb].pBt; |
| 174916 | 175175 | } |
| 175176 | + |
| 175177 | +/* |
| 175178 | +** Return the name of the N-th database schema. Return NULL if N is out |
| 175179 | +** of range. |
| 175180 | +*/ |
| 175181 | +SQLITE_API const char *sqlite3_db_name(sqlite3 *db, int N){ |
| 175182 | +#ifdef SQLITE_ENABLE_API_ARMOR |
| 175183 | + if( !sqlite3SafetyCheckOk(db) ){ |
| 175184 | + (void)SQLITE_MISUSE_BKPT; |
| 175185 | + return 0; |
| 175186 | + } |
| 175187 | +#endif |
| 175188 | + if( N<0 || N>=db->nDb ){ |
| 175189 | + return 0; |
| 175190 | + }else{ |
| 175191 | + return db->aDb[N].zDbSName; |
| 175192 | + } |
| 175193 | +} |
| 174917 | 175194 | |
| 174918 | 175195 | /* |
| 174919 | 175196 | ** Return the filename of the database associated with a database |
| 174920 | 175197 | ** connection. |
| 174921 | 175198 | */ |
| | @@ -190551,10 +190828,12 @@ |
| 190551 | 190828 | if( rc==SQLITE_OK ){ |
| 190552 | 190829 | if( pNode->key.n ){ |
| 190553 | 190830 | pBlk->n += sqlite3Fts3PutVarint(&pBlk->a[pBlk->n], nPrefix); |
| 190554 | 190831 | } |
| 190555 | 190832 | pBlk->n += sqlite3Fts3PutVarint(&pBlk->a[pBlk->n], nSuffix); |
| 190833 | + assert( nPrefix+nSuffix<=nTerm ); |
| 190834 | + assert( nPrefix>=0 ); |
| 190556 | 190835 | memcpy(&pBlk->a[pBlk->n], &zTerm[nPrefix], nSuffix); |
| 190557 | 190836 | pBlk->n += nSuffix; |
| 190558 | 190837 | |
| 190559 | 190838 | memcpy(pNode->key.a, zTerm, nTerm); |
| 190560 | 190839 | pNode->key.n = nTerm; |
| | @@ -190673,10 +190952,11 @@ |
| 190673 | 190952 | NodeWriter *pLeaf; /* Object used to write leaf nodes */ |
| 190674 | 190953 | |
| 190675 | 190954 | pLeaf = &pWriter->aNodeWriter[0]; |
| 190676 | 190955 | nPrefix = fts3PrefixCompress(pLeaf->key.a, pLeaf->key.n, zTerm, nTerm); |
| 190677 | 190956 | nSuffix = nTerm - nPrefix; |
| 190957 | + if(nSuffix<=0 ) return FTS_CORRUPT_VTAB; |
| 190678 | 190958 | |
| 190679 | 190959 | nSpace = sqlite3Fts3VarintLen(nPrefix); |
| 190680 | 190960 | nSpace += sqlite3Fts3VarintLen(nSuffix) + nSuffix; |
| 190681 | 190961 | nSpace += sqlite3Fts3VarintLen(nDoclist) + nDoclist; |
| 190682 | 190962 | |
| | @@ -236295,11 +236575,11 @@ |
| 236295 | 236575 | int nArg, /* Number of args */ |
| 236296 | 236576 | sqlite3_value **apUnused /* Function arguments */ |
| 236297 | 236577 | ){ |
| 236298 | 236578 | assert( nArg==0 ); |
| 236299 | 236579 | UNUSED_PARAM2(nArg, apUnused); |
| 236300 | | - sqlite3_result_text(pCtx, "fts5: 2022-05-10 00:24:01 c6c3115f3a008cf9b0d7c5c812f17e38c8a75a904032c5f05f0bea03a7340527", -1, SQLITE_TRANSIENT); |
| 236580 | + sqlite3_result_text(pCtx, "fts5: 2022-06-15 16:26:37 56c60a35ea457f06db58ec3f694a1ae16fd03e6625da1d7879d63d72bbcb1c62", -1, SQLITE_TRANSIENT); |
| 236301 | 236581 | } |
| 236302 | 236582 | |
| 236303 | 236583 | /* |
| 236304 | 236584 | ** Return true if zName is the extension on one of the shadow tables used |
| 236305 | 236585 | ** by this module. |
| 236306 | 236586 | |