Fossil SCM

Update the built-in SQLite to the latest 3.35.0 alpha that includes support for the MATERIALIZED hints.

drh 2021-02-22 18:43 trunk
Commit d07cbeda71c3efb1b734bfe1098e0f095834aa0c47787195b5fc767ea675a53c
2 files changed +2921 -2699 +1 -1
+2921 -2699
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -1186,11 +1186,11 @@
11861186
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
11871187
** [sqlite_version()] and [sqlite_source_id()].
11881188
*/
11891189
#define SQLITE_VERSION "3.35.0"
11901190
#define SQLITE_VERSION_NUMBER 3035000
1191
-#define SQLITE_SOURCE_ID "2021-02-19 14:32:58 c844a331e78949850fde8ed95058cb34f863566944bc9e92e3ae042768f130e1"
1191
+#define SQLITE_SOURCE_ID "2021-02-22 16:42:09 b5a0778cc5a98a864bea72670f83262da940aceb91fa4cdf46ec097337a3alt1"
11921192
11931193
/*
11941194
** CAPI3REF: Run-Time Library Version Numbers
11951195
** KEYWORDS: sqlite3_version sqlite3_sourceid
11961196
**
@@ -14125,95 +14125,96 @@
1412514125
#define TK_GROUPS 92
1412614126
#define TK_OTHERS 93
1412714127
#define TK_TIES 94
1412814128
#define TK_GENERATED 95
1412914129
#define TK_ALWAYS 96
14130
-#define TK_REINDEX 97
14131
-#define TK_RENAME 98
14132
-#define TK_CTIME_KW 99
14133
-#define TK_ANY 100
14134
-#define TK_BITAND 101
14135
-#define TK_BITOR 102
14136
-#define TK_LSHIFT 103
14137
-#define TK_RSHIFT 104
14138
-#define TK_PLUS 105
14139
-#define TK_MINUS 106
14140
-#define TK_STAR 107
14141
-#define TK_SLASH 108
14142
-#define TK_REM 109
14143
-#define TK_CONCAT 110
14144
-#define TK_COLLATE 111
14145
-#define TK_BITNOT 112
14146
-#define TK_ON 113
14147
-#define TK_INDEXED 114
14148
-#define TK_STRING 115
14149
-#define TK_JOIN_KW 116
14150
-#define TK_CONSTRAINT 117
14151
-#define TK_DEFAULT 118
14152
-#define TK_NULL 119
14153
-#define TK_PRIMARY 120
14154
-#define TK_UNIQUE 121
14155
-#define TK_CHECK 122
14156
-#define TK_REFERENCES 123
14157
-#define TK_AUTOINCR 124
14158
-#define TK_INSERT 125
14159
-#define TK_DELETE 126
14160
-#define TK_UPDATE 127
14161
-#define TK_SET 128
14162
-#define TK_DEFERRABLE 129
14163
-#define TK_FOREIGN 130
14164
-#define TK_DROP 131
14165
-#define TK_UNION 132
14166
-#define TK_ALL 133
14167
-#define TK_EXCEPT 134
14168
-#define TK_INTERSECT 135
14169
-#define TK_SELECT 136
14170
-#define TK_VALUES 137
14171
-#define TK_DISTINCT 138
14172
-#define TK_DOT 139
14173
-#define TK_FROM 140
14174
-#define TK_JOIN 141
14175
-#define TK_USING 142
14176
-#define TK_ORDER 143
14177
-#define TK_GROUP 144
14178
-#define TK_HAVING 145
14179
-#define TK_LIMIT 146
14180
-#define TK_WHERE 147
14181
-#define TK_RETURNING 148
14182
-#define TK_INTO 149
14183
-#define TK_NOTHING 150
14184
-#define TK_FLOAT 151
14185
-#define TK_BLOB 152
14186
-#define TK_INTEGER 153
14187
-#define TK_VARIABLE 154
14188
-#define TK_CASE 155
14189
-#define TK_WHEN 156
14190
-#define TK_THEN 157
14191
-#define TK_ELSE 158
14192
-#define TK_INDEX 159
14193
-#define TK_ALTER 160
14194
-#define TK_ADD 161
14195
-#define TK_WINDOW 162
14196
-#define TK_OVER 163
14197
-#define TK_FILTER 164
14198
-#define TK_COLUMN 165
14199
-#define TK_AGG_FUNCTION 166
14200
-#define TK_AGG_COLUMN 167
14201
-#define TK_TRUEFALSE 168
14202
-#define TK_ISNOT 169
14203
-#define TK_FUNCTION 170
14204
-#define TK_UMINUS 171
14205
-#define TK_UPLUS 172
14206
-#define TK_TRUTH 173
14207
-#define TK_REGISTER 174
14208
-#define TK_VECTOR 175
14209
-#define TK_SELECT_COLUMN 176
14210
-#define TK_IF_NULL_ROW 177
14211
-#define TK_ASTERISK 178
14212
-#define TK_SPAN 179
14213
-#define TK_SPACE 180
14214
-#define TK_ILLEGAL 181
14130
+#define TK_MATERIALIZED 97
14131
+#define TK_REINDEX 98
14132
+#define TK_RENAME 99
14133
+#define TK_CTIME_KW 100
14134
+#define TK_ANY 101
14135
+#define TK_BITAND 102
14136
+#define TK_BITOR 103
14137
+#define TK_LSHIFT 104
14138
+#define TK_RSHIFT 105
14139
+#define TK_PLUS 106
14140
+#define TK_MINUS 107
14141
+#define TK_STAR 108
14142
+#define TK_SLASH 109
14143
+#define TK_REM 110
14144
+#define TK_CONCAT 111
14145
+#define TK_COLLATE 112
14146
+#define TK_BITNOT 113
14147
+#define TK_ON 114
14148
+#define TK_INDEXED 115
14149
+#define TK_STRING 116
14150
+#define TK_JOIN_KW 117
14151
+#define TK_CONSTRAINT 118
14152
+#define TK_DEFAULT 119
14153
+#define TK_NULL 120
14154
+#define TK_PRIMARY 121
14155
+#define TK_UNIQUE 122
14156
+#define TK_CHECK 123
14157
+#define TK_REFERENCES 124
14158
+#define TK_AUTOINCR 125
14159
+#define TK_INSERT 126
14160
+#define TK_DELETE 127
14161
+#define TK_UPDATE 128
14162
+#define TK_SET 129
14163
+#define TK_DEFERRABLE 130
14164
+#define TK_FOREIGN 131
14165
+#define TK_DROP 132
14166
+#define TK_UNION 133
14167
+#define TK_ALL 134
14168
+#define TK_EXCEPT 135
14169
+#define TK_INTERSECT 136
14170
+#define TK_SELECT 137
14171
+#define TK_VALUES 138
14172
+#define TK_DISTINCT 139
14173
+#define TK_DOT 140
14174
+#define TK_FROM 141
14175
+#define TK_JOIN 142
14176
+#define TK_USING 143
14177
+#define TK_ORDER 144
14178
+#define TK_GROUP 145
14179
+#define TK_HAVING 146
14180
+#define TK_LIMIT 147
14181
+#define TK_WHERE 148
14182
+#define TK_RETURNING 149
14183
+#define TK_INTO 150
14184
+#define TK_NOTHING 151
14185
+#define TK_FLOAT 152
14186
+#define TK_BLOB 153
14187
+#define TK_INTEGER 154
14188
+#define TK_VARIABLE 155
14189
+#define TK_CASE 156
14190
+#define TK_WHEN 157
14191
+#define TK_THEN 158
14192
+#define TK_ELSE 159
14193
+#define TK_INDEX 160
14194
+#define TK_ALTER 161
14195
+#define TK_ADD 162
14196
+#define TK_WINDOW 163
14197
+#define TK_OVER 164
14198
+#define TK_FILTER 165
14199
+#define TK_COLUMN 166
14200
+#define TK_AGG_FUNCTION 167
14201
+#define TK_AGG_COLUMN 168
14202
+#define TK_TRUEFALSE 169
14203
+#define TK_ISNOT 170
14204
+#define TK_FUNCTION 171
14205
+#define TK_UMINUS 172
14206
+#define TK_UPLUS 173
14207
+#define TK_TRUTH 174
14208
+#define TK_REGISTER 175
14209
+#define TK_VECTOR 176
14210
+#define TK_SELECT_COLUMN 177
14211
+#define TK_IF_NULL_ROW 178
14212
+#define TK_ASTERISK 179
14213
+#define TK_SPAN 180
14214
+#define TK_SPACE 181
14215
+#define TK_ILLEGAL 182
1421514216
1421614217
/************** End of parse.h ***********************************************/
1421714218
/************** Continuing where we left off in sqliteInt.h ******************/
1421814219
#include <stdio.h>
1421914220
#include <stdlib.h>
@@ -14764,10 +14765,12 @@
1476414765
typedef struct AuthContext AuthContext;
1476514766
typedef struct AutoincInfo AutoincInfo;
1476614767
typedef struct Bitvec Bitvec;
1476714768
typedef struct CollSeq CollSeq;
1476814769
typedef struct Column Column;
14770
+typedef struct Cte Cte;
14771
+typedef struct CteUse CteUse;
1476914772
typedef struct Db Db;
1477014773
typedef struct DbFixer DbFixer;
1477114774
typedef struct Schema Schema;
1477214775
typedef struct Expr Expr;
1477314776
typedef struct ExprList ExprList;
@@ -14793,10 +14796,11 @@
1479314796
typedef struct RowSet RowSet;
1479414797
typedef struct Savepoint Savepoint;
1479514798
typedef struct Select Select;
1479614799
typedef struct SQLiteThread SQLiteThread;
1479714800
typedef struct SelectDest SelectDest;
14801
+typedef struct SrcItem SrcItem;
1479814802
typedef struct SrcList SrcList;
1479914803
typedef struct sqlite3_str StrAccum; /* Internal alias for sqlite3_str */
1480014804
typedef struct Table Table;
1480114805
typedef struct TableLock TableLock;
1480214806
typedef struct Token Token;
@@ -15786,26 +15790,26 @@
1578615790
#define OP_ReopenIdx 96 /* synopsis: root=P2 iDb=P3 */
1578715791
#define OP_OpenRead 97 /* synopsis: root=P2 iDb=P3 */
1578815792
#define OP_OpenWrite 98 /* synopsis: root=P2 iDb=P3 */
1578915793
#define OP_OpenDup 99
1579015794
#define OP_OpenAutoindex 100 /* synopsis: nColumn=P2 */
15791
-#define OP_BitAnd 101 /* same as TK_BITAND, synopsis: r[P3]=r[P1]&r[P2] */
15792
-#define OP_BitOr 102 /* same as TK_BITOR, synopsis: r[P3]=r[P1]|r[P2] */
15793
-#define OP_ShiftLeft 103 /* same as TK_LSHIFT, synopsis: r[P3]=r[P2]<<r[P1] */
15794
-#define OP_ShiftRight 104 /* same as TK_RSHIFT, synopsis: r[P3]=r[P2]>>r[P1] */
15795
-#define OP_Add 105 /* same as TK_PLUS, synopsis: r[P3]=r[P1]+r[P2] */
15796
-#define OP_Subtract 106 /* same as TK_MINUS, synopsis: r[P3]=r[P2]-r[P1] */
15797
-#define OP_Multiply 107 /* same as TK_STAR, synopsis: r[P3]=r[P1]*r[P2] */
15798
-#define OP_Divide 108 /* same as TK_SLASH, synopsis: r[P3]=r[P2]/r[P1] */
15799
-#define OP_Remainder 109 /* same as TK_REM, synopsis: r[P3]=r[P2]%r[P1] */
15800
-#define OP_Concat 110 /* same as TK_CONCAT, synopsis: r[P3]=r[P2]+r[P1] */
15801
-#define OP_OpenEphemeral 111 /* synopsis: nColumn=P2 */
15802
-#define OP_BitNot 112 /* same as TK_BITNOT, synopsis: r[P2]= ~r[P1] */
15803
-#define OP_SorterOpen 113
15795
+#define OP_OpenEphemeral 101 /* synopsis: nColumn=P2 */
15796
+#define OP_BitAnd 102 /* same as TK_BITAND, synopsis: r[P3]=r[P1]&r[P2] */
15797
+#define OP_BitOr 103 /* same as TK_BITOR, synopsis: r[P3]=r[P1]|r[P2] */
15798
+#define OP_ShiftLeft 104 /* same as TK_LSHIFT, synopsis: r[P3]=r[P2]<<r[P1] */
15799
+#define OP_ShiftRight 105 /* same as TK_RSHIFT, synopsis: r[P3]=r[P2]>>r[P1] */
15800
+#define OP_Add 106 /* same as TK_PLUS, synopsis: r[P3]=r[P1]+r[P2] */
15801
+#define OP_Subtract 107 /* same as TK_MINUS, synopsis: r[P3]=r[P2]-r[P1] */
15802
+#define OP_Multiply 108 /* same as TK_STAR, synopsis: r[P3]=r[P1]*r[P2] */
15803
+#define OP_Divide 109 /* same as TK_SLASH, synopsis: r[P3]=r[P2]/r[P1] */
15804
+#define OP_Remainder 110 /* same as TK_REM, synopsis: r[P3]=r[P2]%r[P1] */
15805
+#define OP_Concat 111 /* same as TK_CONCAT, synopsis: r[P3]=r[P2]+r[P1] */
15806
+#define OP_SorterOpen 112
15807
+#define OP_BitNot 113 /* same as TK_BITNOT, synopsis: r[P2]= ~r[P1] */
1580415808
#define OP_SequenceTest 114 /* synopsis: if( cursor[P1].ctr++ ) pc = P2 */
15805
-#define OP_String8 115 /* same as TK_STRING, synopsis: r[P2]='P4' */
15806
-#define OP_OpenPseudo 116 /* synopsis: P3 columns in r[P2] */
15809
+#define OP_OpenPseudo 115 /* synopsis: P3 columns in r[P2] */
15810
+#define OP_String8 116 /* same as TK_STRING, synopsis: r[P2]='P4' */
1580715811
#define OP_Close 117
1580815812
#define OP_ColumnsUsed 118
1580915813
#define OP_SeekScan 119 /* synopsis: Scan-ahead up to P1 rows */
1581015814
#define OP_SeekHit 120 /* synopsis: set P2<=seekHit<=P3 */
1581115815
#define OP_Sequence 121 /* synopsis: r[P2]=cursor[P1].ctr++ */
@@ -15836,12 +15840,12 @@
1583615840
#define OP_DropTable 146
1583715841
#define OP_DropIndex 147
1583815842
#define OP_DropTrigger 148
1583915843
#define OP_IntegrityCk 149
1584015844
#define OP_RowSetAdd 150 /* synopsis: rowset(P1)=r[P2] */
15841
-#define OP_Real 151 /* same as TK_FLOAT, synopsis: r[P2]=P4 */
15842
-#define OP_Param 152
15845
+#define OP_Param 151
15846
+#define OP_Real 152 /* same as TK_FLOAT, synopsis: r[P2]=P4 */
1584315847
#define OP_FkCounter 153 /* synopsis: fkctr[P1]+=P2 */
1584415848
#define OP_MemMax 154 /* synopsis: r[P1]=max(r[P1],r[P2]) */
1584515849
#define OP_OffsetLimit 155 /* synopsis: if r[P1]>0 then r[P2]=r[P1]+max(0,r[P3]) else r[P2]=(-1) */
1584615850
#define OP_AggInverse 156 /* synopsis: accum=r[P3] inverse(r[P2@P5]) */
1584715851
#define OP_AggStep 157 /* synopsis: accum=r[P3] step(r[P2@P5]) */
@@ -15888,13 +15892,13 @@
1588815892
/* 56 */ 0x0b, 0x0b, 0x01, 0x03, 0x01, 0x01, 0x01, 0x00,\
1588915893
/* 64 */ 0x00, 0x02, 0x02, 0x08, 0x00, 0x10, 0x10, 0x10,\
1589015894
/* 72 */ 0x10, 0x00, 0x10, 0x10, 0x00, 0x00, 0x10, 0x10,\
1589115895
/* 80 */ 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, 0x00, 0x00,\
1589215896
/* 88 */ 0x12, 0x20, 0x00, 0x00, 0x00, 0x10, 0x10, 0x00,\
15893
-/* 96 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x26, 0x26, 0x26,\
15894
-/* 104 */ 0x26, 0x26, 0x26, 0x26, 0x26, 0x26, 0x26, 0x00,\
15895
-/* 112 */ 0x12, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00,\
15897
+/* 96 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x26, 0x26,\
15898
+/* 104 */ 0x26, 0x26, 0x26, 0x26, 0x26, 0x26, 0x26, 0x26,\
15899
+/* 112 */ 0x00, 0x12, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00,\
1589615900
/* 120 */ 0x00, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,\
1589715901
/* 128 */ 0x00, 0x00, 0x10, 0x00, 0x00, 0x04, 0x04, 0x00,\
1589815902
/* 136 */ 0x00, 0x10, 0x00, 0x10, 0x00, 0x00, 0x10, 0x00,\
1589915903
/* 144 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x10,\
1590015904
/* 152 */ 0x10, 0x00, 0x04, 0x1a, 0x00, 0x00, 0x00, 0x00,\
@@ -18376,10 +18380,49 @@
1837618380
int idx; /* Index in some Table.aCol[] of a column named zName */
1837718381
} *a;
1837818382
int nId; /* Number of identifiers on the list */
1837918383
};
1838018384
18385
+/*
18386
+** The SrcItem object represents a single term in the FROM clause of a query.
18387
+** The SrcList object is mostly an array of SrcItems.
18388
+*/
18389
+struct SrcItem {
18390
+ Schema *pSchema; /* Schema to which this item is fixed */
18391
+ char *zDatabase; /* Name of database holding this table */
18392
+ char *zName; /* Name of the table */
18393
+ char *zAlias; /* The "B" part of a "A AS B" phrase. zName is the "A" */
18394
+ Table *pTab; /* An SQL table corresponding to zName */
18395
+ Select *pSelect; /* A SELECT statement used in place of a table name */
18396
+ int addrFillSub; /* Address of subroutine to manifest a subquery */
18397
+ int regReturn; /* Register holding return address of addrFillSub */
18398
+ int regResult; /* Registers holding results of a co-routine */
18399
+ struct {
18400
+ u8 jointype; /* Type of join between this table and the previous */
18401
+ unsigned notIndexed :1; /* True if there is a NOT INDEXED clause */
18402
+ unsigned isIndexedBy :1; /* True if there is an INDEXED BY clause */
18403
+ unsigned isTabFunc :1; /* True if table-valued-function syntax */
18404
+ unsigned isCorrelated :1; /* True if sub-query is correlated */
18405
+ unsigned viaCoroutine :1; /* Implemented as a co-routine */
18406
+ unsigned isRecursive :1; /* True for recursive reference in WITH */
18407
+ unsigned fromDDL :1; /* Comes from sqlite_schema */
18408
+ unsigned isCte :1; /* This is a CTE */
18409
+ } fg;
18410
+ int iCursor; /* The VDBE cursor number used to access this table */
18411
+ Expr *pOn; /* The ON clause of a join */
18412
+ IdList *pUsing; /* The USING clause of a join */
18413
+ Bitmask colUsed; /* Bit N (1<<N) set if column N of pTab is used */
18414
+ union {
18415
+ char *zIndexedBy; /* Identifier from "INDEXED BY <zIndex>" clause */
18416
+ ExprList *pFuncArg; /* Arguments to table-valued-function */
18417
+ } u1;
18418
+ union {
18419
+ Index *pIBIndex; /* Index structure corresponding to u1.zIndexedBy */
18420
+ CteUse *pCteUse; /* CTE Usage info info fg.isCte is true */
18421
+ } u2;
18422
+};
18423
+
1838118424
/*
1838218425
** The following structure describes the FROM clause of a SELECT statement.
1838318426
** Each table or subquery in the FROM clause is a separate element of
1838418427
** the SrcList.a[] array.
1838518428
**
@@ -18398,40 +18441,11 @@
1839818441
** contains more than 63 columns and the 64-th or later column is used.
1839918442
*/
1840018443
struct SrcList {
1840118444
int nSrc; /* Number of tables or subqueries in the FROM clause */
1840218445
u32 nAlloc; /* Number of entries allocated in a[] below */
18403
- struct SrcList_item {
18404
- Schema *pSchema; /* Schema to which this item is fixed */
18405
- char *zDatabase; /* Name of database holding this table */
18406
- char *zName; /* Name of the table */
18407
- char *zAlias; /* The "B" part of a "A AS B" phrase. zName is the "A" */
18408
- Table *pTab; /* An SQL table corresponding to zName */
18409
- Select *pSelect; /* A SELECT statement used in place of a table name */
18410
- int addrFillSub; /* Address of subroutine to manifest a subquery */
18411
- int regReturn; /* Register holding return address of addrFillSub */
18412
- int regResult; /* Registers holding results of a co-routine */
18413
- struct {
18414
- u8 jointype; /* Type of join between this table and the previous */
18415
- unsigned notIndexed :1; /* True if there is a NOT INDEXED clause */
18416
- unsigned isIndexedBy :1; /* True if there is an INDEXED BY clause */
18417
- unsigned isTabFunc :1; /* True if table-valued-function syntax */
18418
- unsigned isCorrelated :1; /* True if sub-query is correlated */
18419
- unsigned viaCoroutine :1; /* Implemented as a co-routine */
18420
- unsigned isRecursive :1; /* True for recursive reference in WITH */
18421
- unsigned fromDDL :1; /* Comes from sqlite_schema */
18422
- } fg;
18423
- int iCursor; /* The VDBE cursor number used to access this table */
18424
- Expr *pOn; /* The ON clause of a join */
18425
- IdList *pUsing; /* The USING clause of a join */
18426
- Bitmask colUsed; /* Bit N (1<<N) set if column N of pTab is used */
18427
- union {
18428
- char *zIndexedBy; /* Identifier from "INDEXED BY <zIndex>" clause */
18429
- ExprList *pFuncArg; /* Arguments to table-valued-function */
18430
- } u1;
18431
- Index *pIBIndex; /* Index structure corresponding to u1.zIndexedBy */
18432
- } a[1]; /* One entry for each identifier on the list */
18446
+ SrcItem a[1]; /* One entry for each identifier on the list */
1843318447
};
1843418448
1843518449
/*
1843618450
** Permitted values of the SrcList.a.jointype field
1843718451
*/
@@ -19289,11 +19303,11 @@
1928919303
Select *pSelect; /* HAVING to WHERE clause ctx */
1929019304
struct WindowRewrite *pRewrite; /* Window rewrite context */
1929119305
struct WhereConst *pConst; /* WHERE clause constants */
1929219306
struct RenameCtx *pRename; /* RENAME COLUMN context */
1929319307
struct Table *pTab; /* Table of generated column */
19294
- struct SrcList_item *pSrcItem; /* A single FROM clause item */
19308
+ SrcItem *pSrcItem; /* A single FROM clause item */
1929519309
DbFixer *pFix;
1929619310
} u;
1929719311
};
1929819312
1929919313
/*
@@ -19334,23 +19348,58 @@
1933419348
#define WRC_Continue 0 /* Continue down into children */
1933519349
#define WRC_Prune 1 /* Omit children but continue walking siblings */
1933619350
#define WRC_Abort 2 /* Abandon the tree walk */
1933719351
1933819352
/*
19339
-** An instance of this structure represents a set of one or more CTEs
19340
-** (common table expressions) created by a single WITH clause.
19353
+** A single common table expression
19354
+*/
19355
+struct Cte {
19356
+ char *zName; /* Name of this CTE */
19357
+ ExprList *pCols; /* List of explicit column names, or NULL */
19358
+ Select *pSelect; /* The definition of this CTE */
19359
+ const char *zCteErr; /* Error message for circular references */
19360
+ CteUse *pUse; /* Usage information for this CTE */
19361
+ u8 eM10d; /* The MATERIALIZED flag */
19362
+};
19363
+
19364
+/*
19365
+** Allowed values for the materialized flag (eM10d):
19366
+*/
19367
+#define M10d_Yes 0 /* AS MATERIALIZED */
19368
+#define M10d_Any 1 /* Not specified. Query planner's choice */
19369
+#define M10d_No 2 /* AS NOT MATERIALIZED */
19370
+
19371
+/*
19372
+** An instance of the With object represents a WITH clause containing
19373
+** one or more CTEs (common table expressions).
1934119374
*/
1934219375
struct With {
19343
- int nCte; /* Number of CTEs in the WITH clause */
19344
- With *pOuter; /* Containing WITH clause, or NULL */
19345
- struct Cte { /* For each CTE in the WITH clause.... */
19346
- char *zName; /* Name of this CTE */
19347
- ExprList *pCols; /* List of explicit column names, or NULL */
19348
- Select *pSelect; /* The definition of this CTE */
19349
- const char *zCteErr; /* Error message for circular references */
19350
- } a[1];
19376
+ int nCte; /* Number of CTEs in the WITH clause */
19377
+ With *pOuter; /* Containing WITH clause, or NULL */
19378
+ Cte a[1]; /* For each CTE in the WITH clause.... */
1935119379
};
19380
+
19381
+/*
19382
+** The Cte object is not guaranteed to persist for the entire duration
19383
+** of code generation. (The query flattener or other parser tree
19384
+** edits might delete it.) The following object records information
19385
+** about each Common Table Expression that must be preserved for the
19386
+** duration of the parse.
19387
+**
19388
+** The CteUse objects are freed using sqlite3ParserAddCleanup() rather
19389
+** than sqlite3SelectDelete(), which is what enables them to persist
19390
+** until the end of code generation.
19391
+*/
19392
+struct CteUse {
19393
+ int nUse; /* Number of users of this CTE */
19394
+ int addrM9e; /* Start of subroutine to compute materialization */
19395
+ int regRtn; /* Return address register for addrM9e subroutine */
19396
+ int iCur; /* Ephemeral table holding the materialization */
19397
+ LogEst nRowEst; /* Estimated number of rows in the table */
19398
+ u8 eM10d; /* The MATERIALIZED flag */
19399
+};
19400
+
1935219401
1935319402
#ifdef SQLITE_DEBUG
1935419403
/*
1935519404
** An instance of the TreeView object is used for printing the content of
1935619405
** data structures on sqlite3DebugPrintf() using a tree-like view.
@@ -19807,11 +19856,11 @@
1980719856
SQLITE_PRIVATE SrcList *sqlite3SrcListAppend(Parse*, SrcList*, Token*, Token*);
1980819857
SQLITE_PRIVATE SrcList *sqlite3SrcListAppendFromTerm(Parse*, SrcList*, Token*, Token*,
1980919858
Token*, Select*, Expr*, IdList*);
1981019859
SQLITE_PRIVATE void sqlite3SrcListIndexedBy(Parse *, SrcList *, Token *);
1981119860
SQLITE_PRIVATE void sqlite3SrcListFuncArgs(Parse*, SrcList*, ExprList*);
19812
-SQLITE_PRIVATE int sqlite3IndexedByLookup(Parse *, struct SrcList_item *);
19861
+SQLITE_PRIVATE int sqlite3IndexedByLookup(Parse *, SrcItem *);
1981319862
SQLITE_PRIVATE void sqlite3SrcListShiftJoinType(SrcList*);
1981419863
SQLITE_PRIVATE void sqlite3SrcListAssignCursors(Parse*, SrcList*);
1981519864
SQLITE_PRIVATE void sqlite3IdListDelete(sqlite3*, IdList*);
1981619865
SQLITE_PRIVATE void sqlite3SrcListDelete(sqlite3*, SrcList*);
1981719866
SQLITE_PRIVATE Index *sqlite3AllocateIndexObject(sqlite3*,i16,int,char**);
@@ -19869,11 +19918,11 @@
1986919918
SQLITE_PRIVATE void sqlite3ExprIfFalseDup(Parse*, Expr*, int, int);
1987019919
SQLITE_PRIVATE Table *sqlite3FindTable(sqlite3*,const char*, const char*);
1987119920
#define LOCATE_VIEW 0x01
1987219921
#define LOCATE_NOERR 0x02
1987319922
SQLITE_PRIVATE Table *sqlite3LocateTable(Parse*,u32 flags,const char*, const char*);
19874
-SQLITE_PRIVATE Table *sqlite3LocateTableItem(Parse*,u32 flags,struct SrcList_item *);
19923
+SQLITE_PRIVATE Table *sqlite3LocateTableItem(Parse*,u32 flags,SrcItem *);
1987519924
SQLITE_PRIVATE Index *sqlite3FindIndex(sqlite3*,const char*, const char*);
1987619925
SQLITE_PRIVATE void sqlite3UnlinkAndDeleteTable(sqlite3*,int,const char*);
1987719926
SQLITE_PRIVATE void sqlite3UnlinkAndDeleteIndex(sqlite3*,int,const char*);
1987819927
SQLITE_PRIVATE void sqlite3Vacuum(Parse*,Token*,Expr*);
1987919928
SQLITE_PRIVATE int sqlite3RunVacuum(char**, sqlite3*, int, sqlite3_value*);
@@ -20164,11 +20213,11 @@
2016420213
SQLITE_PRIVATE void sqlite3NestedParse(Parse*, const char*, ...);
2016520214
SQLITE_PRIVATE void sqlite3ExpirePreparedStatements(sqlite3*, int);
2016620215
SQLITE_PRIVATE void sqlite3CodeRhsOfIN(Parse*, Expr*, int);
2016720216
SQLITE_PRIVATE int sqlite3CodeSubselect(Parse*, Expr*);
2016820217
SQLITE_PRIVATE void sqlite3SelectPrep(Parse*, Select*, NameContext*);
20169
-SQLITE_PRIVATE int sqlite3ExpandSubquery(Parse*, struct SrcList_item*);
20218
+SQLITE_PRIVATE int sqlite3ExpandSubquery(Parse*, SrcItem*);
2017020219
SQLITE_PRIVATE void sqlite3SelectWrongNumTermsError(Parse *pParse, Select *p);
2017120220
SQLITE_PRIVATE int sqlite3MatchEName(
2017220221
const struct ExprList_item*,
2017320222
const char*,
2017420223
const char*,
@@ -20336,11 +20385,11 @@
2033620385
SQLITE_PRIVATE FuncDef *sqlite3VtabOverloadFunction(sqlite3 *,FuncDef*, int nArg, Expr*);
2033720386
SQLITE_PRIVATE sqlite3_int64 sqlite3StmtCurrentTime(sqlite3_context*);
2033820387
SQLITE_PRIVATE int sqlite3VdbeParameterIndex(Vdbe*, const char*, int);
2033920388
SQLITE_PRIVATE int sqlite3TransferBindings(sqlite3_stmt *, sqlite3_stmt *);
2034020389
SQLITE_PRIVATE void sqlite3ParserReset(Parse*);
20341
-SQLITE_PRIVATE void sqlite3ParserAddCleanup(Parse*,void(*)(sqlite3*,void*),void*);
20390
+SQLITE_PRIVATE void *sqlite3ParserAddCleanup(Parse*,void(*)(sqlite3*,void*),void*);
2034220391
#ifdef SQLITE_ENABLE_NORMALIZE
2034320392
SQLITE_PRIVATE char *sqlite3Normalize(Vdbe*, const char*);
2034420393
#endif
2034520394
SQLITE_PRIVATE int sqlite3Reprepare(Vdbe*);
2034620395
SQLITE_PRIVATE void sqlite3ExprListCheckLength(Parse*, ExprList*, const char*);
@@ -20351,16 +20400,21 @@
2035120400
#ifndef SQLITE_OMIT_WAL
2035220401
SQLITE_PRIVATE int sqlite3Checkpoint(sqlite3*, int, int, int*, int*);
2035320402
SQLITE_PRIVATE int sqlite3WalDefaultHook(void*,sqlite3*,const char*,int);
2035420403
#endif
2035520404
#ifndef SQLITE_OMIT_CTE
20356
-SQLITE_PRIVATE With *sqlite3WithAdd(Parse*,With*,Token*,ExprList*,Select*);
20405
+SQLITE_PRIVATE Cte *sqlite3CteNew(Parse*,Token*,ExprList*,Select*,u8);
20406
+SQLITE_PRIVATE void sqlite3CteDelete(sqlite3*,Cte*);
20407
+SQLITE_PRIVATE With *sqlite3WithAdd(Parse*,With*,Cte*);
2035720408
SQLITE_PRIVATE void sqlite3WithDelete(sqlite3*,With*);
2035820409
SQLITE_PRIVATE void sqlite3WithPush(Parse*, With*, u8);
2035920410
#else
20360
-#define sqlite3WithPush(x,y,z)
20361
-#define sqlite3WithDelete(x,y)
20411
+# define sqlite3CteNew(P,T,E,S) ((void*)0)
20412
+# define sqlite3CteDelete(D,C)
20413
+# define sqlite3CteWithAdd(P,W,C) ((void*)0)
20414
+# define sqlite3WithDelete(x,y)
20415
+# define sqlite3WithPush(x,y,z)
2036220416
#endif
2036320417
#ifndef SQLITE_OMIT_UPSERT
2036420418
SQLITE_PRIVATE Upsert *sqlite3UpsertNew(sqlite3*,ExprList*,Expr*,ExprList*,Expr*,Upsert*);
2036520419
SQLITE_PRIVATE void sqlite3UpsertDelete(sqlite3*,Upsert*);
2036620420
SQLITE_PRIVATE Upsert *sqlite3UpsertDup(sqlite3*,Upsert*);
@@ -29210,11 +29264,11 @@
2921029264
break;
2921129265
}
2921229266
case etSRCLIST: {
2921329267
SrcList *pSrc;
2921429268
int k;
29215
- struct SrcList_item *pItem;
29269
+ SrcItem *pItem;
2921629270
if( (pAccum->printfFlags & SQLITE_PRINTF_INTERNAL)==0 ) return;
2921729271
pSrc = va_arg(ap, SrcList*);
2921829272
k = va_arg(ap, int);
2921929273
pItem = &pSrc->a[k];
2922029274
assert( bArgList==0 );
@@ -29778,11 +29832,14 @@
2977829832
sqlite3_str_appendf(&x, "%c%s", cSep, pCte->pCols->a[j].zEName);
2977929833
cSep = ',';
2978029834
}
2978129835
sqlite3_str_appendf(&x, ")");
2978229836
}
29783
- sqlite3_str_appendf(&x, " AS");
29837
+ if( pCte->pUse ){
29838
+ sqlite3_str_appendf(&x, " (pUse=0x%p, nUse=%d)", pCte->pUse,
29839
+ pCte->pUse->nUse);
29840
+ }
2978429841
sqlite3StrAccumFinish(&x);
2978529842
sqlite3TreeViewItem(pView, zLine, i<pWith->nCte-1);
2978629843
sqlite3TreeViewSelect(pView, pCte->pSelect, 0);
2978729844
sqlite3TreeViewPop(pView);
2978829845
}
@@ -29794,11 +29851,11 @@
2979429851
** Generate a human-readable description of a SrcList object.
2979529852
*/
2979629853
SQLITE_PRIVATE void sqlite3TreeViewSrcList(TreeView *pView, const SrcList *pSrc){
2979729854
int i;
2979829855
for(i=0; i<pSrc->nSrc; i++){
29799
- const struct SrcList_item *pItem = &pSrc->a[i];
29856
+ const SrcItem *pItem = &pSrc->a[i];
2980029857
StrAccum x;
2980129858
char zLine[100];
2980229859
sqlite3StrAccumInit(&x, 0, zLine, sizeof(zLine), 0);
2980329860
sqlite3_str_appendf(&x, "{%d:*}", pItem->iCursor);
2980429861
if( pItem->zDatabase ){
@@ -29817,10 +29874,13 @@
2981729874
sqlite3_str_appendf(&x, " LEFT-JOIN");
2981829875
}
2981929876
if( pItem->fg.fromDDL ){
2982029877
sqlite3_str_appendf(&x, " DDL");
2982129878
}
29879
+ if( pItem->fg.isCte ){
29880
+ sqlite3_str_appendf(&x, " CteUse=0x%p", pItem->u2.pCteUse);
29881
+ }
2982229882
sqlite3StrAccumFinish(&x);
2982329883
sqlite3TreeViewItem(pView, zLine, i<pSrc->nSrc-1);
2982429884
if( pItem->pSelect ){
2982529885
sqlite3TreeViewSelect(pView, pItem->pSelect, 0);
2982629886
}
@@ -33490,26 +33550,26 @@
3349033550
/* 96 */ "ReopenIdx" OpHelp("root=P2 iDb=P3"),
3349133551
/* 97 */ "OpenRead" OpHelp("root=P2 iDb=P3"),
3349233552
/* 98 */ "OpenWrite" OpHelp("root=P2 iDb=P3"),
3349333553
/* 99 */ "OpenDup" OpHelp(""),
3349433554
/* 100 */ "OpenAutoindex" OpHelp("nColumn=P2"),
33495
- /* 101 */ "BitAnd" OpHelp("r[P3]=r[P1]&r[P2]"),
33496
- /* 102 */ "BitOr" OpHelp("r[P3]=r[P1]|r[P2]"),
33497
- /* 103 */ "ShiftLeft" OpHelp("r[P3]=r[P2]<<r[P1]"),
33498
- /* 104 */ "ShiftRight" OpHelp("r[P3]=r[P2]>>r[P1]"),
33499
- /* 105 */ "Add" OpHelp("r[P3]=r[P1]+r[P2]"),
33500
- /* 106 */ "Subtract" OpHelp("r[P3]=r[P2]-r[P1]"),
33501
- /* 107 */ "Multiply" OpHelp("r[P3]=r[P1]*r[P2]"),
33502
- /* 108 */ "Divide" OpHelp("r[P3]=r[P2]/r[P1]"),
33503
- /* 109 */ "Remainder" OpHelp("r[P3]=r[P2]%r[P1]"),
33504
- /* 110 */ "Concat" OpHelp("r[P3]=r[P2]+r[P1]"),
33505
- /* 111 */ "OpenEphemeral" OpHelp("nColumn=P2"),
33506
- /* 112 */ "BitNot" OpHelp("r[P2]= ~r[P1]"),
33507
- /* 113 */ "SorterOpen" OpHelp(""),
33555
+ /* 101 */ "OpenEphemeral" OpHelp("nColumn=P2"),
33556
+ /* 102 */ "BitAnd" OpHelp("r[P3]=r[P1]&r[P2]"),
33557
+ /* 103 */ "BitOr" OpHelp("r[P3]=r[P1]|r[P2]"),
33558
+ /* 104 */ "ShiftLeft" OpHelp("r[P3]=r[P2]<<r[P1]"),
33559
+ /* 105 */ "ShiftRight" OpHelp("r[P3]=r[P2]>>r[P1]"),
33560
+ /* 106 */ "Add" OpHelp("r[P3]=r[P1]+r[P2]"),
33561
+ /* 107 */ "Subtract" OpHelp("r[P3]=r[P2]-r[P1]"),
33562
+ /* 108 */ "Multiply" OpHelp("r[P3]=r[P1]*r[P2]"),
33563
+ /* 109 */ "Divide" OpHelp("r[P3]=r[P2]/r[P1]"),
33564
+ /* 110 */ "Remainder" OpHelp("r[P3]=r[P2]%r[P1]"),
33565
+ /* 111 */ "Concat" OpHelp("r[P3]=r[P2]+r[P1]"),
33566
+ /* 112 */ "SorterOpen" OpHelp(""),
33567
+ /* 113 */ "BitNot" OpHelp("r[P2]= ~r[P1]"),
3350833568
/* 114 */ "SequenceTest" OpHelp("if( cursor[P1].ctr++ ) pc = P2"),
33509
- /* 115 */ "String8" OpHelp("r[P2]='P4'"),
33510
- /* 116 */ "OpenPseudo" OpHelp("P3 columns in r[P2]"),
33569
+ /* 115 */ "OpenPseudo" OpHelp("P3 columns in r[P2]"),
33570
+ /* 116 */ "String8" OpHelp("r[P2]='P4'"),
3351133571
/* 117 */ "Close" OpHelp(""),
3351233572
/* 118 */ "ColumnsUsed" OpHelp(""),
3351333573
/* 119 */ "SeekScan" OpHelp("Scan-ahead up to P1 rows"),
3351433574
/* 120 */ "SeekHit" OpHelp("set P2<=seekHit<=P3"),
3351533575
/* 121 */ "Sequence" OpHelp("r[P2]=cursor[P1].ctr++"),
@@ -33540,12 +33600,12 @@
3354033600
/* 146 */ "DropTable" OpHelp(""),
3354133601
/* 147 */ "DropIndex" OpHelp(""),
3354233602
/* 148 */ "DropTrigger" OpHelp(""),
3354333603
/* 149 */ "IntegrityCk" OpHelp(""),
3354433604
/* 150 */ "RowSetAdd" OpHelp("rowset(P1)=r[P2]"),
33545
- /* 151 */ "Real" OpHelp("r[P2]=P4"),
33546
- /* 152 */ "Param" OpHelp(""),
33605
+ /* 151 */ "Param" OpHelp(""),
33606
+ /* 152 */ "Real" OpHelp("r[P2]=P4"),
3354733607
/* 153 */ "FkCounter" OpHelp("fkctr[P1]+=P2"),
3354833608
/* 154 */ "MemMax" OpHelp("r[P1]=max(r[P1],r[P2])"),
3354933609
/* 155 */ "OffsetLimit" OpHelp("if r[P1]>0 then r[P2]=r[P1]+max(0,r[P3]) else r[P2]=(-1)"),
3355033610
/* 156 */ "AggInverse" OpHelp("accum=r[P3] inverse(r[P2@P5])"),
3355133611
/* 157 */ "AggStep" OpHelp("accum=r[P3] step(r[P2@P5])"),
@@ -89814,11 +89874,11 @@
8981489874
assert( aMem[pOp->p3].flags & MEM_Null );
8981589875
aMem[pOp->p3].n = 0;
8981689876
aMem[pOp->p3].z = "";
8981789877
}
8981889878
pCx = p->apCsr[pOp->p1];
89819
- if( pCx && pCx->pBtx ){
89879
+ if( pCx && ALWAYS(pCx->pBtx) ){
8982089880
/* If the ephermeral table is already open, erase all existing content
8982189881
** so that the table is empty again, rather than creating a new table. */
8982289882
assert( pCx->isEphemeral );
8982389883
pCx->seqCount = 0;
8982489884
pCx->cacheStatus = CACHE_STALE;
@@ -98419,11 +98479,11 @@
9841998479
** WRC_Abort or WRC_Continue;
9842098480
*/
9842198481
SQLITE_PRIVATE int sqlite3WalkSelectFrom(Walker *pWalker, Select *p){
9842298482
SrcList *pSrc;
9842398483
int i;
98424
- struct SrcList_item *pItem;
98484
+ SrcItem *pItem;
9842598485
9842698486
pSrc = p->pSrc;
9842798487
if( pSrc ){
9842898488
for(i=pSrc->nSrc, pItem=pSrc->a; i>0; i--, pItem++){
9842998489
if( pItem->pSelect && sqlite3WalkSelect(pWalker, pItem->pSelect) ){
@@ -98760,12 +98820,12 @@
9876098820
int i, j; /* Loop counters */
9876198821
int cnt = 0; /* Number of matching column names */
9876298822
int cntTab = 0; /* Number of matching table names */
9876398823
int nSubquery = 0; /* How many levels of subquery */
9876498824
sqlite3 *db = pParse->db; /* The database connection */
98765
- struct SrcList_item *pItem; /* Use for looping over pSrcList items */
98766
- struct SrcList_item *pMatch = 0; /* The matching pSrcList item */
98825
+ SrcItem *pItem; /* Use for looping over pSrcList items */
98826
+ SrcItem *pMatch = 0; /* The matching pSrcList item */
9876798827
NameContext *pTopNC = pNC; /* First namecontext in the list */
9876898828
Schema *pSchema = 0; /* Schema of the expression */
9876998829
int eNewExprOp = TK_COLUMN; /* New value for pExpr->op on success */
9877098830
Table *pTab = 0; /* Table hold the row */
9877198831
Column *pCol; /* A column of pTab */
@@ -99177,11 +99237,11 @@
9917799237
** from datasource iSrc in SrcList pSrc.
9917899238
*/
9917999239
SQLITE_PRIVATE Expr *sqlite3CreateColumnExpr(sqlite3 *db, SrcList *pSrc, int iSrc, int iCol){
9918099240
Expr *p = sqlite3ExprAlloc(db, TK_COLUMN, 0, 0);
9918199241
if( p ){
99182
- struct SrcList_item *pItem = &pSrc->a[iSrc];
99242
+ SrcItem *pItem = &pSrc->a[iSrc];
9918399243
Table *pTab = p->y.pTab = pItem->pTab;
9918499244
p->iTable = pItem->iCursor;
9918599245
if( p->y.pTab->iPKey==iCol ){
9918699246
p->iColumn = -1;
9918799247
}else{
@@ -99289,11 +99349,11 @@
9928999349
** clause processing on UPDATE and DELETE statements, and by
9929099350
** UPDATE ... FROM statement processing.
9929199351
*/
9929299352
case TK_ROW: {
9929399353
SrcList *pSrcList = pNC->pSrcList;
99294
- struct SrcList_item *pItem;
99354
+ SrcItem *pItem;
9929599355
assert( pSrcList && pSrcList->nSrc>=1 );
9929699356
pItem = pSrcList->a;
9929799357
pExpr->op = TK_COLUMN;
9929899358
pExpr->y.pTab = pItem->pTab;
9929999359
pExpr->iTable = pItem->iCursor;
@@ -100102,11 +100162,11 @@
100102100162
}
100103100163
100104100164
/* Recursively resolve names in all subqueries
100105100165
*/
100106100166
for(i=0; i<p->pSrc->nSrc; i++){
100107
- struct SrcList_item *pItem = &p->pSrc->a[i];
100167
+ SrcItem *pItem = &p->pSrc->a[i];
100108100168
if( pItem->pSelect && (pItem->pSelect->selFlags & SF_Resolved)==0 ){
100109100169
NameContext *pNC; /* Used to iterate name contexts */
100110100170
int nRef = 0; /* Refcount for pOuterNC and outer contexts */
100111100171
const char *zSavedContext = pParse->zAuthContext;
100112100172
@@ -100172,11 +100232,11 @@
100172100232
if( sqlite3ResolveExprNames(&sNC, p->pHaving) ) return WRC_Abort;
100173100233
if( sqlite3ResolveExprNames(&sNC, p->pWhere) ) return WRC_Abort;
100174100234
100175100235
/* Resolve names in table-valued-function arguments */
100176100236
for(i=0; i<p->pSrc->nSrc; i++){
100177
- struct SrcList_item *pItem = &p->pSrc->a[i];
100237
+ SrcItem *pItem = &p->pSrc->a[i];
100178100238
if( pItem->fg.isTabFunc
100179100239
&& sqlite3ResolveExprListNames(&sNC, pItem->u1.pFuncArg)
100180100240
){
100181100241
return WRC_Abort;
100182100242
}
@@ -102016,12 +102076,12 @@
102016102076
nByte = sizeof(*p) + (p->nSrc>0 ? sizeof(p->a[0]) * (p->nSrc-1) : 0);
102017102077
pNew = sqlite3DbMallocRawNN(db, nByte );
102018102078
if( pNew==0 ) return 0;
102019102079
pNew->nSrc = pNew->nAlloc = p->nSrc;
102020102080
for(i=0; i<p->nSrc; i++){
102021
- struct SrcList_item *pNewItem = &pNew->a[i];
102022
- struct SrcList_item *pOldItem = &p->a[i];
102081
+ SrcItem *pNewItem = &pNew->a[i];
102082
+ SrcItem *pOldItem = &p->a[i];
102023102083
Table *pTab;
102024102084
pNewItem->pSchema = pOldItem->pSchema;
102025102085
pNewItem->zDatabase = sqlite3DbStrDup(db, pOldItem->zDatabase);
102026102086
pNewItem->zName = sqlite3DbStrDup(db, pOldItem->zName);
102027102087
pNewItem->zAlias = sqlite3DbStrDup(db, pOldItem->zAlias);
@@ -102030,11 +102090,14 @@
102030102090
pNewItem->addrFillSub = pOldItem->addrFillSub;
102031102091
pNewItem->regReturn = pOldItem->regReturn;
102032102092
if( pNewItem->fg.isIndexedBy ){
102033102093
pNewItem->u1.zIndexedBy = sqlite3DbStrDup(db, pOldItem->u1.zIndexedBy);
102034102094
}
102035
- pNewItem->pIBIndex = pOldItem->pIBIndex;
102095
+ pNewItem->u2 = pOldItem->u2;
102096
+ if( pNewItem->fg.isCte ){
102097
+ pNewItem->u2.pCteUse->nUse++;
102098
+ }
102036102099
if( pNewItem->fg.isTabFunc ){
102037102100
pNewItem->u1.pFuncArg =
102038102101
sqlite3ExprListDup(db, pOldItem->u1.pFuncArg, flags);
102039102102
}
102040102103
pTab = pNewItem->pTab = pOldItem->pTab;
@@ -106347,11 +106410,11 @@
106347106410
testcase( pExpr->op==TK_AGG_COLUMN );
106348106411
testcase( pExpr->op==TK_COLUMN );
106349106412
/* Check to see if the column is in one of the tables in the FROM
106350106413
** clause of the aggregate query */
106351106414
if( ALWAYS(pSrcList!=0) ){
106352
- struct SrcList_item *pItem = pSrcList->a;
106415
+ SrcItem *pItem = pSrcList->a;
106353106416
for(i=0; i<pSrcList->nSrc; i++, pItem++){
106354106417
struct AggInfo_col *pCol;
106355106418
assert( !ExprHasProperty(pExpr, EP_TokenOnly|EP_Reduced) );
106356106419
if( pExpr->iTable==pItem->iCursor ){
106357106420
/* If we reach this point, it means that pExpr refers to a table
@@ -107802,11 +107865,11 @@
107802107865
if( rc==SQLITE_OK && pStep->zTarget ){
107803107866
SrcList *pSrc = sqlite3TriggerStepSrc(pParse, pStep);
107804107867
if( pSrc ){
107805107868
int i;
107806107869
for(i=0; i<pSrc->nSrc && rc==SQLITE_OK; i++){
107807
- struct SrcList_item *p = &pSrc->a[i];
107870
+ SrcItem *p = &pSrc->a[i];
107808107871
p->iCursor = pParse->nTab++;
107809107872
if( p->pSelect ){
107810107873
sqlite3SelectPrep(pParse, p->pSelect, 0);
107811107874
sqlite3ExpandSubquery(pParse, p);
107812107875
assert( i>0 );
@@ -108114,11 +108177,11 @@
108114108177
if( pSrc==0 ){
108115108178
assert( pWalker->pParse->db->mallocFailed );
108116108179
return WRC_Abort;
108117108180
}
108118108181
for(i=0; i<pSrc->nSrc; i++){
108119
- struct SrcList_item *pItem = &pSrc->a[i];
108182
+ SrcItem *pItem = &pSrc->a[i];
108120108183
if( pItem->pTab==p->pTab ){
108121108184
renameTokenFind(pWalker->pParse, p, pItem->zName);
108122108185
}
108123108186
}
108124108187
renameWalkWith(pWalker, pSelect);
@@ -108364,11 +108427,10 @@
108364108427
** Arguments:
108365108428
**
108366108429
** argv[0]: An integer - the index of the schema containing the table
108367108430
** argv[1]: CREATE TABLE statement to modify.
108368108431
** argv[2]: An integer - the index of the column to remove.
108369
-** argv[3]: Byte offset of first byte after last column definition in argv[1]
108370108432
**
108371108433
** The value returned is a string containing the CREATE TABLE statement
108372108434
** with column argv[2] removed.
108373108435
*/
108374108436
static void dropColumnFunc(
@@ -108378,11 +108440,10 @@
108378108440
){
108379108441
sqlite3 *db = sqlite3_context_db_handle(context);
108380108442
int iSchema = sqlite3_value_int(argv[0]);
108381108443
const char *zSql = (const char*)sqlite3_value_text(argv[1]);
108382108444
int iCol = sqlite3_value_int(argv[2]);
108383
- int iAddColOffset = sqlite3_value_int(argv[3]);
108384108445
const char *zDb = db->aDb[iSchema].zDbSName;
108385108446
int rc;
108386108447
Parse sParse;
108387108448
RenameToken *pCol;
108388108449
Table *pTab;
@@ -108395,11 +108456,11 @@
108395108456
#endif
108396108457
108397108458
rc = renameParseSql(&sParse, zDb, db, zSql, iSchema==1);
108398108459
if( rc!=SQLITE_OK ) goto drop_column_done;
108399108460
pTab = sParse.pNewTable;
108400
- if( iCol>=pTab->nCol ){
108461
+ if( pTab->nCol==1 || iCol>=pTab->nCol ){
108401108462
/* This can happen if the sqlite_schema table is corrupt */
108402108463
rc = SQLITE_CORRUPT_BKPT;
108403108464
goto drop_column_done;
108404108465
}
108405108466
@@ -108407,11 +108468,11 @@
108407108468
if( iCol<pTab->nCol-1 ){
108408108469
RenameToken *pEnd;
108409108470
pEnd = renameTokenFind(&sParse, 0, (void*)pTab->aCol[iCol+1].zName);
108410108471
zEnd = (const char*)pEnd->t.z;
108411108472
}else{
108412
- zEnd = (const char*)&zSql[iAddColOffset];
108473
+ zEnd = (const char*)&zSql[pTab->addColOffset];
108413108474
while( ALWAYS(pCol->t.z[0]!=0) && pCol->t.z[0]!=',' ) pCol->t.z--;
108414108475
}
108415108476
108416108477
zNew = sqlite3MPrintf(db, "%.*s%s", pCol->t.z-zSql, zSql, zEnd);
108417108478
sqlite3_result_text(context, zNew, -1, SQLITE_TRANSIENT);
@@ -108488,13 +108549,13 @@
108488108549
assert( iDb>=0 );
108489108550
zDb = db->aDb[iDb].zDbSName;
108490108551
renameTestSchema(pParse, zDb, iDb==1, "");
108491108552
sqlite3NestedParse(pParse,
108492108553
"UPDATE \"%w\"." DFLT_SCHEMA_TABLE " SET "
108493
- "sql = sqlite_drop_column(%d, sql, %d, %d) "
108554
+ "sql = sqlite_drop_column(%d, sql, %d) "
108494108555
"WHERE (type=='table' AND tbl_name=%Q COLLATE nocase)"
108495
- , zDb, iDb, iCol, pTab->addColOffset, pTab->zName
108556
+ , zDb, iDb, iCol, pTab->zName
108496108557
);
108497108558
108498108559
/* Drop and reload the database schema. */
108499108560
renameReloadSchema(pParse, iDb, INITFLAG_AlterDrop);
108500108561
renameTestSchema(pParse, zDb, iDb==1, "after drop column");
@@ -108556,11 +108617,11 @@
108556108617
SQLITE_PRIVATE void sqlite3AlterFunctions(void){
108557108618
static FuncDef aAlterTableFuncs[] = {
108558108619
INTERNAL_FUNCTION(sqlite_rename_column, 9, renameColumnFunc),
108559108620
INTERNAL_FUNCTION(sqlite_rename_table, 7, renameTableFunc),
108560108621
INTERNAL_FUNCTION(sqlite_rename_test, 6, renameTableTest),
108561
- INTERNAL_FUNCTION(sqlite_drop_column, 4, dropColumnFunc),
108622
+ INTERNAL_FUNCTION(sqlite_drop_column, 3, dropColumnFunc),
108562108623
};
108563108624
sqlite3InsertBuiltinFuncs(aAlterTableFuncs, ArraySize(aAlterTableFuncs));
108564108625
}
108565108626
#endif /* SQLITE_ALTER_TABLE */
108566108627
@@ -110968,11 +111029,11 @@
110968111029
** Select callback used by sqlite3FixAAAA() routines.
110969111030
*/
110970111031
static int fixSelectCb(Walker *p, Select *pSelect){
110971111032
DbFixer *pFix = p->u.pFix;
110972111033
int i;
110973
- struct SrcList_item *pItem;
111034
+ SrcItem *pItem;
110974111035
sqlite3 *db = pFix->pParse->db;
110975111036
int iDb = sqlite3FindDbName(db, pFix->zDb);
110976111037
SrcList *pList = pSelect->pSrc;
110977111038
110978111039
if( NEVER(pList==0) ) return WRC_Continue;
@@ -111856,11 +111917,11 @@
111856111917
** sqlite3FixSrcList() for details.
111857111918
*/
111858111919
SQLITE_PRIVATE Table *sqlite3LocateTableItem(
111859111920
Parse *pParse,
111860111921
u32 flags,
111861
- struct SrcList_item *p
111922
+ SrcItem *p
111862111923
){
111863111924
const char *zDb;
111864111925
assert( p->pSchema==0 || p->zDatabase==0 );
111865111926
if( p->pSchema ){
111866111927
int iDb = sqlite3SchemaToIndex(pParse->db, p->pSchema);
@@ -114036,24 +114097,21 @@
114036114097
sqlite3OomFault(db);
114037114098
return;
114038114099
}
114039114100
pParse->pNewTable = 0;
114040114101
db->mDbFlags |= DBFLAG_SchemaChange;
114102
+ }
114041114103
114042114104
#ifndef SQLITE_OMIT_ALTERTABLE
114043
- if( !p->pSelect ){
114044
- const char *zName = (const char *)pParse->sNameToken.z;
114045
- int nName;
114046
- assert( !pSelect && pCons && pEnd );
114047
- if( pCons->z==0 ){
114048
- pCons = pEnd;
114049
- }
114050
- nName = (int)((const char *)pCons->z - zName);
114051
- p->addColOffset = 13 + nName;
114052
- }
114053
-#endif
114054
- }
114105
+ if( !pSelect && !p->pSelect ){
114106
+ assert( pCons && pEnd );
114107
+ if( pCons->z==0 ){
114108
+ pCons = pEnd;
114109
+ }
114110
+ p->addColOffset = 13 + (int)(pCons->z - pParse->sNameToken.z);
114111
+ }
114112
+#endif
114055114113
}
114056114114
114057114115
#ifndef SQLITE_OMIT_VIEW
114058114116
/*
114059114117
** The parser calls this routine in order to create a new VIEW
@@ -115900,11 +115958,11 @@
115900115958
Parse *pParse, /* Parsing context, in which errors are reported */
115901115959
SrcList *pList, /* Append to this SrcList. NULL creates a new SrcList */
115902115960
Token *pTable, /* Table to append */
115903115961
Token *pDatabase /* Database of the table */
115904115962
){
115905
- struct SrcList_item *pItem;
115963
+ SrcItem *pItem;
115906115964
sqlite3 *db;
115907115965
assert( pDatabase==0 || pTable!=0 ); /* Cannot have C without B */
115908115966
assert( pParse!=0 );
115909115967
assert( pParse->db!=0 );
115910115968
db = pParse->db;
@@ -115941,11 +115999,11 @@
115941115999
/*
115942116000
** Assign VdbeCursor index numbers to all tables in a SrcList
115943116001
*/
115944116002
SQLITE_PRIVATE void sqlite3SrcListAssignCursors(Parse *pParse, SrcList *pList){
115945116003
int i;
115946
- struct SrcList_item *pItem;
116004
+ SrcItem *pItem;
115947116005
assert(pList || pParse->db->mallocFailed );
115948116006
if( pList ){
115949116007
for(i=0, pItem=pList->a; i<pList->nSrc; i++, pItem++){
115950116008
if( pItem->iCursor>=0 ) continue;
115951116009
pItem->iCursor = pParse->nTab++;
@@ -115959,11 +116017,11 @@
115959116017
/*
115960116018
** Delete an entire SrcList including all its substructure.
115961116019
*/
115962116020
SQLITE_PRIVATE void sqlite3SrcListDelete(sqlite3 *db, SrcList *pList){
115963116021
int i;
115964
- struct SrcList_item *pItem;
116022
+ SrcItem *pItem;
115965116023
if( pList==0 ) return;
115966116024
for(pItem=pList->a, i=0; i<pList->nSrc; i++, pItem++){
115967116025
if( pItem->zDatabase ) sqlite3DbFreeNN(db, pItem->zDatabase);
115968116026
sqlite3DbFree(db, pItem->zName);
115969116027
if( pItem->zAlias ) sqlite3DbFreeNN(db, pItem->zAlias);
@@ -116001,11 +116059,11 @@
116001116059
Token *pAlias, /* The right-hand side of the AS subexpression */
116002116060
Select *pSubquery, /* A subquery used in place of a table name */
116003116061
Expr *pOn, /* The ON clause of a join */
116004116062
IdList *pUsing /* The USING clause of a join */
116005116063
){
116006
- struct SrcList_item *pItem;
116064
+ SrcItem *pItem;
116007116065
sqlite3 *db = pParse->db;
116008116066
if( !p && (pOn || pUsing) ){
116009116067
sqlite3ErrorMsg(pParse, "a JOIN clause is required before %s",
116010116068
(pOn ? "ON" : "USING")
116011116069
);
@@ -116045,11 +116103,11 @@
116045116103
** element of the source-list passed as the second argument.
116046116104
*/
116047116105
SQLITE_PRIVATE void sqlite3SrcListIndexedBy(Parse *pParse, SrcList *p, Token *pIndexedBy){
116048116106
assert( pIndexedBy!=0 );
116049116107
if( p && pIndexedBy->n>0 ){
116050
- struct SrcList_item *pItem;
116108
+ SrcItem *pItem;
116051116109
assert( p->nSrc>0 );
116052116110
pItem = &p->a[p->nSrc-1];
116053116111
assert( pItem->fg.notIndexed==0 );
116054116112
assert( pItem->fg.isIndexedBy==0 );
116055116113
assert( pItem->fg.isTabFunc==0 );
@@ -116075,11 +116133,11 @@
116075116133
SrcList *pNew = sqlite3SrcListEnlarge(pParse, p1, p2->nSrc, 1);
116076116134
if( pNew==0 ){
116077116135
sqlite3SrcListDelete(pParse->db, p2);
116078116136
}else{
116079116137
p1 = pNew;
116080
- memcpy(&p1->a[1], p2->a, p2->nSrc*sizeof(struct SrcList_item));
116138
+ memcpy(&p1->a[1], p2->a, p2->nSrc*sizeof(SrcItem));
116081116139
sqlite3DbFree(pParse->db, p2);
116082116140
}
116083116141
}
116084116142
return p1;
116085116143
}
@@ -116088,11 +116146,11 @@
116088116146
** Add the list of function arguments to the SrcList entry for a
116089116147
** table-valued-function.
116090116148
*/
116091116149
SQLITE_PRIVATE void sqlite3SrcListFuncArgs(Parse *pParse, SrcList *p, ExprList *pList){
116092116150
if( p ){
116093
- struct SrcList_item *pItem = &p->a[p->nSrc-1];
116151
+ SrcItem *pItem = &p->a[p->nSrc-1];
116094116152
assert( pItem->fg.notIndexed==0 );
116095116153
assert( pItem->fg.isIndexedBy==0 );
116096116154
assert( pItem->fg.isTabFunc==0 );
116097116155
pItem->u1.pFuncArg = pList;
116098116156
pItem->fg.isTabFunc = 1;
@@ -116585,28 +116643,80 @@
116585116643
}
116586116644
return pKey;
116587116645
}
116588116646
116589116647
#ifndef SQLITE_OMIT_CTE
116648
+/*
116649
+** Create a new CTE object
116650
+*/
116651
+SQLITE_PRIVATE Cte *sqlite3CteNew(
116652
+ Parse *pParse, /* Parsing context */
116653
+ Token *pName, /* Name of the common-table */
116654
+ ExprList *pArglist, /* Optional column name list for the table */
116655
+ Select *pQuery, /* Query used to initialize the table */
116656
+ u8 eM10d /* The MATERIALIZED flag */
116657
+){
116658
+ Cte *pNew;
116659
+ sqlite3 *db = pParse->db;
116660
+
116661
+ pNew = sqlite3DbMallocZero(db, sizeof(*pNew));
116662
+ assert( pNew!=0 || db->mallocFailed );
116663
+
116664
+ if( db->mallocFailed ){
116665
+ sqlite3ExprListDelete(db, pArglist);
116666
+ sqlite3SelectDelete(db, pQuery);
116667
+ }else{
116668
+ pNew->pSelect = pQuery;
116669
+ pNew->pCols = pArglist;
116670
+ pNew->zName = sqlite3NameFromToken(pParse->db, pName);
116671
+ pNew->eM10d = eM10d;
116672
+ }
116673
+ return pNew;
116674
+}
116675
+
116676
+/*
116677
+** Clear information from a Cte object, but do not deallocate storage
116678
+** for the object itself.
116679
+*/
116680
+static void cteClear(sqlite3 *db, Cte *pCte){
116681
+ assert( pCte!=0 );
116682
+ sqlite3ExprListDelete(db, pCte->pCols);
116683
+ sqlite3SelectDelete(db, pCte->pSelect);
116684
+ sqlite3DbFree(db, pCte->zName);
116685
+}
116686
+
116687
+/*
116688
+** Free the contents of the CTE object passed as the second argument.
116689
+*/
116690
+SQLITE_PRIVATE void sqlite3CteDelete(sqlite3 *db, Cte *pCte){
116691
+ assert( pCte!=0 );
116692
+ cteClear(db, pCte);
116693
+ sqlite3DbFree(db, pCte);
116694
+}
116695
+
116590116696
/*
116591116697
** This routine is invoked once per CTE by the parser while parsing a
116592
-** WITH clause.
116698
+** WITH clause. The CTE described by teh third argument is added to
116699
+** the WITH clause of the second argument. If the second argument is
116700
+** NULL, then a new WITH argument is created.
116593116701
*/
116594116702
SQLITE_PRIVATE With *sqlite3WithAdd(
116595116703
Parse *pParse, /* Parsing context */
116596116704
With *pWith, /* Existing WITH clause, or NULL */
116597
- Token *pName, /* Name of the common-table */
116598
- ExprList *pArglist, /* Optional column name list for the table */
116599
- Select *pQuery /* Query used to initialize the table */
116705
+ Cte *pCte /* CTE to add to the WITH clause */
116600116706
){
116601116707
sqlite3 *db = pParse->db;
116602116708
With *pNew;
116603116709
char *zName;
116710
+
116711
+ if( pCte==0 ){
116712
+ return pWith;
116713
+ }
116604116714
116605116715
/* Check that the CTE name is unique within this WITH clause. If
116606116716
** not, store an error in the Parse structure. */
116607
- zName = sqlite3NameFromToken(pParse->db, pName);
116717
+ zName = pCte->zName;
116608116718
if( zName && pWith ){
116609116719
int i;
116610116720
for(i=0; i<pWith->nCte; i++){
116611116721
if( sqlite3StrICmp(zName, pWith->a[i].zName)==0 ){
116612116722
sqlite3ErrorMsg(pParse, "duplicate WITH table name: %s", zName);
@@ -116621,20 +116731,15 @@
116621116731
pNew = sqlite3DbMallocZero(db, sizeof(*pWith));
116622116732
}
116623116733
assert( (pNew!=0 && zName!=0) || db->mallocFailed );
116624116734
116625116735
if( db->mallocFailed ){
116626
- sqlite3ExprListDelete(db, pArglist);
116627
- sqlite3SelectDelete(db, pQuery);
116628
- sqlite3DbFree(db, zName);
116736
+ sqlite3CteDelete(db, pCte);
116629116737
pNew = pWith;
116630116738
}else{
116631
- pNew->a[pNew->nCte].pSelect = pQuery;
116632
- pNew->a[pNew->nCte].pCols = pArglist;
116633
- pNew->a[pNew->nCte].zName = zName;
116634
- pNew->a[pNew->nCte].zCteErr = 0;
116635
- pNew->nCte++;
116739
+ pNew->a[pNew->nCte++] = *pCte;
116740
+ sqlite3DbFree(db, pCte);
116636116741
}
116637116742
116638116743
return pNew;
116639116744
}
116640116745
@@ -116643,14 +116748,11 @@
116643116748
*/
116644116749
SQLITE_PRIVATE void sqlite3WithDelete(sqlite3 *db, With *pWith){
116645116750
if( pWith ){
116646116751
int i;
116647116752
for(i=0; i<pWith->nCte; i++){
116648
- struct Cte *pCte = &pWith->a[i];
116649
- sqlite3ExprListDelete(db, pCte->pCols);
116650
- sqlite3SelectDelete(db, pCte->pSelect);
116651
- sqlite3DbFree(db, pCte->zName);
116753
+ cteClear(db, &pWith->a[i]);
116652116754
}
116653116755
sqlite3DbFree(db, pWith);
116654116756
}
116655116757
}
116656116758
#endif /* !defined(SQLITE_OMIT_CTE) */
@@ -117225,21 +117327,21 @@
117225117327
** pSrc->a[0].pTab Pointer to the Table object
117226117328
** pSrc->a[0].pIndex Pointer to the INDEXED BY index, if there is one
117227117329
**
117228117330
*/
117229117331
SQLITE_PRIVATE Table *sqlite3SrcListLookup(Parse *pParse, SrcList *pSrc){
117230
- struct SrcList_item *pItem = pSrc->a;
117332
+ SrcItem *pItem = pSrc->a;
117231117333
Table *pTab;
117232117334
assert( pItem && pSrc->nSrc>=1 );
117233117335
pTab = sqlite3LocateTableItem(pParse, 0, pItem);
117234117336
sqlite3DeleteTable(pParse->db, pItem->pTab);
117235117337
pItem->pTab = pTab;
117236117338
if( pTab ){
117237117339
pTab->nTabRef++;
117238
- }
117239
- if( sqlite3IndexedByLookup(pParse, pItem) ){
117240
- pTab = 0;
117340
+ if( pItem->fg.isIndexedBy && sqlite3IndexedByLookup(pParse, pItem) ){
117341
+ pTab = 0;
117342
+ }
117241117343
}
117242117344
return pTab;
117243117345
}
117244117346
117245117347
/* Return true if table pTab is read-only.
@@ -117405,11 +117507,15 @@
117405117507
/* duplicate the FROM clause as it is needed by both the DELETE/UPDATE tree
117406117508
** and the SELECT subtree. */
117407117509
pSrc->a[0].pTab = 0;
117408117510
pSelectSrc = sqlite3SrcListDup(pParse->db, pSrc, 0);
117409117511
pSrc->a[0].pTab = pTab;
117410
- pSrc->a[0].pIBIndex = 0;
117512
+ if( pSrc->a[0].fg.isIndexedBy ){
117513
+ pSrc->a[0].u2.pIBIndex = 0;
117514
+ }else if( pSrc->a[0].fg.isCte ){
117515
+ pSrc->a[0].u2.pCteUse->nUse++;
117516
+ }
117411117517
117412117518
/* generate the SELECT expression tree. */
117413117519
pSelect = sqlite3SelectNew(pParse, pEList, pSelectSrc, pWhere, 0 ,0,
117414117520
pOrderBy,0,pLimit
117415117521
);
@@ -121473,11 +121579,11 @@
121473121579
121474121580
/* Create a SrcList structure containing the child table. We need the
121475121581
** child table as a SrcList for sqlite3WhereBegin() */
121476121582
pSrc = sqlite3SrcListAppend(pParse, 0, 0, 0);
121477121583
if( pSrc ){
121478
- struct SrcList_item *pItem = pSrc->a;
121584
+ SrcItem *pItem = pSrc->a;
121479121585
pItem->pTab = pFKey->pFrom;
121480121586
pItem->zName = pFKey->pFrom->zName;
121481121587
pItem->pTab->nTabRef++;
121482121588
pItem->iCursor = pParse->nTab++;
121483121589
@@ -124588,11 +124694,11 @@
124588124694
){
124589124695
sqlite3 *db = pParse->db;
124590124696
ExprList *pEList; /* The result set of the SELECT */
124591124697
Table *pSrc; /* The table in the FROM clause of SELECT */
124592124698
Index *pSrcIdx, *pDestIdx; /* Source and destination indices */
124593
- struct SrcList_item *pItem; /* An element of pSelect->pSrc */
124699
+ SrcItem *pItem; /* An element of pSelect->pSrc */
124594124700
int i; /* Loop counter */
124595124701
int iDbSrc; /* The database of pSrc */
124596124702
int iSrc, iDest; /* Cursors from source and destination */
124597124703
int addr1, addr2; /* Loop addresses */
124598124704
int emptyDestTest = 0; /* Address of test for empty pDest */
@@ -130473,11 +130579,11 @@
130473130579
** use-after-free errors following an OOM. The preferred way to do this is
130474130580
** to immediately follow the call to this routine with:
130475130581
**
130476130582
** testcase( pParse->earlyCleanup );
130477130583
*/
130478
-SQLITE_PRIVATE void sqlite3ParserAddCleanup(
130584
+SQLITE_PRIVATE void *sqlite3ParserAddCleanup(
130479130585
Parse *pParse, /* Destroy when this Parser finishes */
130480130586
void (*xCleanup)(sqlite3*,void*), /* The cleanup routine */
130481130587
void *pPtr /* Pointer to object to be cleaned up */
130482130588
){
130483130589
ParseCleanup *pCleanup = sqlite3DbMallocRaw(pParse->db, sizeof(*pCleanup));
@@ -130486,14 +130592,16 @@
130486130592
pParse->pCleanup = pCleanup;
130487130593
pCleanup->pPtr = pPtr;
130488130594
pCleanup->xCleanup = xCleanup;
130489130595
}else{
130490130596
xCleanup(pParse->db, pPtr);
130597
+ pPtr = 0;
130491130598
#if defined(SQLITE_DEBUG) || defined(SQLITE_COVERAGE_TEST)
130492130599
pParse->earlyCleanup = 1;
130493130600
#endif
130494130601
}
130602
+ return pPtr;
130495130603
}
130496130604
130497130605
/*
130498130606
** Compile the UTF-8 encoded SQL statement zSql into a statement handle.
130499130607
*/
@@ -131317,12 +131425,12 @@
131317131425
** This routine returns the number of errors encountered.
131318131426
*/
131319131427
static int sqliteProcessJoin(Parse *pParse, Select *p){
131320131428
SrcList *pSrc; /* All tables in the FROM clause */
131321131429
int i, j; /* Loop counters */
131322
- struct SrcList_item *pLeft; /* Left table being joined */
131323
- struct SrcList_item *pRight; /* Right table being joined */
131430
+ SrcItem *pLeft; /* Left table being joined */
131431
+ SrcItem *pRight; /* Right table being joined */
131324131432
131325131433
pSrc = p->pSrc;
131326131434
pLeft = &pSrc->a[0];
131327131435
pRight = &pLeft[1];
131328131436
for(i=0; i<pSrc->nSrc-1; i++, pRight++, pLeft++){
@@ -134479,11 +134587,11 @@
134479134587
SubstContext *pSubst, /* Description of the substitution */
134480134588
Select *p, /* SELECT statement in which to make substitutions */
134481134589
int doPrior /* Do substitutes on p->pPrior too */
134482134590
){
134483134591
SrcList *pSrc;
134484
- struct SrcList_item *pItem;
134592
+ SrcItem *pItem;
134485134593
int i;
134486134594
if( !p ) return;
134487134595
do{
134488134596
substExprList(pSubst, p->pEList);
134489134597
substExprList(pSubst, p->pGroupBy);
@@ -134509,21 +134617,21 @@
134509134617
**
134510134618
** This routine scans the entire SELECT statement and recomputes the
134511134619
** pSrcItem->colUsed mask.
134512134620
*/
134513134621
static int recomputeColumnsUsedExpr(Walker *pWalker, Expr *pExpr){
134514
- struct SrcList_item *pItem;
134622
+ SrcItem *pItem;
134515134623
if( pExpr->op!=TK_COLUMN ) return WRC_Continue;
134516134624
pItem = pWalker->u.pSrcItem;
134517134625
if( pItem->iCursor!=pExpr->iTable ) return WRC_Continue;
134518134626
if( pExpr->iColumn<0 ) return WRC_Continue;
134519134627
pItem->colUsed |= sqlite3ExprColUsed(pExpr);
134520134628
return WRC_Continue;
134521134629
}
134522134630
static void recomputeColumnsUsed(
134523134631
Select *pSelect, /* The complete SELECT statement */
134524
- struct SrcList_item *pSrcItem /* Which FROM clause item to recompute */
134632
+ SrcItem *pSrcItem /* Which FROM clause item to recompute */
134525134633
){
134526134634
Walker w;
134527134635
if( NEVER(pSrcItem->pTab==0) ) return;
134528134636
memset(&w, 0, sizeof(w));
134529134637
w.xExprCallback = recomputeColumnsUsedExpr;
@@ -134553,11 +134661,11 @@
134553134661
int *aCsrMap, /* Array to store cursor mappings in */
134554134662
SrcList *pSrc, /* FROM clause to renumber */
134555134663
int iExcept /* FROM clause item to skip */
134556134664
){
134557134665
int i;
134558
- struct SrcList_item *pItem;
134666
+ SrcItem *pItem;
134559134667
for(i=0, pItem=pSrc->a; i<pSrc->nSrc; i++, pItem++){
134560134668
if( i!=iExcept ){
134561134669
Select *p;
134562134670
pItem->iCursor = aCsrMap[pItem->iCursor] = pParse->nTab++;
134563134671
for(p=pItem->pSelect; p; p=p->pPrior){
@@ -134787,11 +134895,11 @@
134787134895
int iParent; /* VDBE cursor number of the pSub result set temp table */
134788134896
int iNewParent = -1;/* Replacement table for iParent */
134789134897
int isLeftJoin = 0; /* True if pSub is the right side of a LEFT JOIN */
134790134898
int i; /* Loop counter */
134791134899
Expr *pWhere; /* The WHERE clause */
134792
- struct SrcList_item *pSubitem; /* The subquery */
134900
+ SrcItem *pSubitem; /* The subquery */
134793134901
sqlite3 *db = pParse->db;
134794134902
Walker w; /* Walker to persist agginfo data */
134795134903
int *aCsrMap = 0;
134796134904
134797134905
/* Check to see if flattening is permitted. Return 0 if not.
@@ -135421,10 +135529,14 @@
135421135529
** then the (1,1,NULL) row would be suppressed.
135422135530
**
135423135531
** (6) The inner query features one or more window-functions (since
135424135532
** changes to the WHERE clause of the inner query could change the
135425135533
** window over which window functions are calculated).
135534
+**
135535
+** (7) The inner query is a Common Table Expression (CTE) that should
135536
+** be materialized. (This restriction is implemented in the calling
135537
+** routine.)
135426135538
**
135427135539
** Return 0 if no changes are made and non-zero if one or more WHERE clause
135428135540
** terms are duplicated into the subquery.
135429135541
*/
135430135542
static int pushDownWhereTerms(
@@ -135592,28 +135704,30 @@
135592135704
** INDEXED BY clause, then try to locate the specified index. If there
135593135705
** was such a clause and the named index cannot be found, return
135594135706
** SQLITE_ERROR and leave an error in pParse. Otherwise, populate
135595135707
** pFrom->pIndex and return SQLITE_OK.
135596135708
*/
135597
-SQLITE_PRIVATE int sqlite3IndexedByLookup(Parse *pParse, struct SrcList_item *pFrom){
135598
- if( pFrom->pTab && pFrom->fg.isIndexedBy ){
135599
- Table *pTab = pFrom->pTab;
135600
- char *zIndexedBy = pFrom->u1.zIndexedBy;
135601
- Index *pIdx;
135602
- for(pIdx=pTab->pIndex;
135603
- pIdx && sqlite3StrICmp(pIdx->zName, zIndexedBy);
135604
- pIdx=pIdx->pNext
135605
- );
135606
- if( !pIdx ){
135607
- sqlite3ErrorMsg(pParse, "no such index: %s", zIndexedBy, 0);
135608
- pParse->checkSchema = 1;
135609
- return SQLITE_ERROR;
135610
- }
135611
- pFrom->pIBIndex = pIdx;
135612
- }
135709
+SQLITE_PRIVATE int sqlite3IndexedByLookup(Parse *pParse, SrcItem *pFrom){
135710
+ Table *pTab = pFrom->pTab;
135711
+ char *zIndexedBy = pFrom->u1.zIndexedBy;
135712
+ Index *pIdx;
135713
+ assert( pTab!=0 );
135714
+ assert( pFrom->fg.isIndexedBy!=0 );
135715
+
135716
+ for(pIdx=pTab->pIndex;
135717
+ pIdx && sqlite3StrICmp(pIdx->zName, zIndexedBy);
135718
+ pIdx=pIdx->pNext
135719
+ );
135720
+ if( !pIdx ){
135721
+ sqlite3ErrorMsg(pParse, "no such index: %s", zIndexedBy, 0);
135722
+ pParse->checkSchema = 1;
135723
+ return SQLITE_ERROR;
135724
+ }
135725
+ pFrom->u2.pIBIndex = pIdx;
135613135726
return SQLITE_OK;
135614135727
}
135728
+
135615135729
/*
135616135730
** Detect compound SELECT statements that use an ORDER BY clause with
135617135731
** an alternative collating sequence.
135618135732
**
135619135733
** SELECT ... FROM t1 EXCEPT SELECT ... FROM t2 ORDER BY .. COLLATE ...
@@ -135696,11 +135810,11 @@
135696135810
/*
135697135811
** Check to see if the FROM clause term pFrom has table-valued function
135698135812
** arguments. If it does, leave an error message in pParse and return
135699135813
** non-zero, since pFrom is not allowed to be a table-valued function.
135700135814
*/
135701
-static int cannotBeFunction(Parse *pParse, struct SrcList_item *pFrom){
135815
+static int cannotBeFunction(Parse *pParse, SrcItem *pFrom){
135702135816
if( pFrom->fg.isTabFunc ){
135703135817
sqlite3ErrorMsg(pParse, "'%s' is not a function", pFrom->zName);
135704135818
return 1;
135705135819
}
135706135820
return 0;
@@ -135717,23 +135831,23 @@
135717135831
** If a non-NULL value is returned, set *ppContext to point to the With
135718135832
** object that the returned CTE belongs to.
135719135833
*/
135720135834
static struct Cte *searchWith(
135721135835
With *pWith, /* Current innermost WITH clause */
135722
- struct SrcList_item *pItem, /* FROM clause element to resolve */
135836
+ SrcItem *pItem, /* FROM clause element to resolve */
135723135837
With **ppContext /* OUT: WITH clause return value belongs to */
135724135838
){
135725
- const char *zName;
135726
- if( pItem->zDatabase==0 && (zName = pItem->zName)!=0 ){
135727
- With *p;
135728
- for(p=pWith; p; p=p->pOuter){
135729
- int i;
135730
- for(i=0; i<p->nCte; i++){
135731
- if( sqlite3StrICmp(zName, p->a[i].zName)==0 ){
135732
- *ppContext = p;
135733
- return &p->a[i];
135734
- }
135839
+ const char *zName = pItem->zName;
135840
+ With *p;
135841
+ assert( pItem->zDatabase==0 );
135842
+ assert( zName!=0 );
135843
+ for(p=pWith; p; p=p->pOuter){
135844
+ int i;
135845
+ for(i=0; i<p->nCte; i++){
135846
+ if( sqlite3StrICmp(zName, p->a[i].zName)==0 ){
135847
+ *ppContext = p;
135848
+ return &p->a[i];
135735135849
}
135736135850
}
135737135851
}
135738135852
return 0;
135739135853
}
@@ -135762,79 +135876,102 @@
135762135876
}
135763135877
}
135764135878
135765135879
/*
135766135880
** This function checks if argument pFrom refers to a CTE declared by
135767
-** a WITH clause on the stack currently maintained by the parser. And,
135768
-** if currently processing a CTE expression, if it is a recursive
135769
-** reference to the current CTE.
135770
-**
135771
-** If pFrom falls into either of the two categories above, pFrom->pTab
135772
-** and other fields are populated accordingly. The caller should check
135773
-** (pFrom->pTab!=0) to determine whether or not a successful match
135774
-** was found.
135775
-**
135776
-** Whether or not a match is found, SQLITE_OK is returned if no error
135777
-** occurs. If an error does occur, an error message is stored in the
135778
-** parser and some error code other than SQLITE_OK returned.
135779
-*/
135780
-static int withExpand(
135781
- Walker *pWalker,
135782
- struct SrcList_item *pFrom
135783
-){
135784
- Parse *pParse = pWalker->pParse;
135785
- sqlite3 *db = pParse->db;
135786
- struct Cte *pCte; /* Matched CTE (or NULL if no match) */
135787
- With *pWith; /* WITH clause that pCte belongs to */
135881
+** a WITH clause on the stack currently maintained by the parser (on the
135882
+** pParse->pWith linked list). And if currently processing a CTE
135883
+** CTE expression, through routine checks to see if the reference is
135884
+** a recursive reference to the CTE.
135885
+**
135886
+** If pFrom matches a CTE according to either of these two above, pFrom->pTab
135887
+** and other fields are populated accordingly.
135888
+**
135889
+** Return 0 if no match is found.
135890
+** Return 1 if a match is found.
135891
+** Return 2 if an error condition is detected.
135892
+*/
135893
+static int resolveFromTermToCte(
135894
+ Parse *pParse, /* The parsing context */
135895
+ Walker *pWalker, /* Current tree walker */
135896
+ SrcItem *pFrom /* The FROM clause term to check */
135897
+){
135898
+ Cte *pCte; /* Matched CTE (or NULL if no match) */
135899
+ With *pWith; /* The matching WITH */
135788135900
135789135901
assert( pFrom->pTab==0 );
135790
- if( pParse->nErr ){
135791
- return SQLITE_ERROR;
135902
+ if( pParse->pWith==0 ){
135903
+ /* There are no WITH clauses in the stack. No match is possible */
135904
+ return 0;
135792135905
}
135793
-
135906
+ if( pFrom->zDatabase!=0 ){
135907
+ /* The FROM term contains a schema qualifier (ex: main.t1) and so
135908
+ ** it cannot possibly be a CTE reference. */
135909
+ return 0;
135910
+ }
135794135911
pCte = searchWith(pParse->pWith, pFrom, &pWith);
135795135912
if( pCte ){
135913
+ sqlite3 *db = pParse->db;
135796135914
Table *pTab;
135797135915
ExprList *pEList;
135798135916
Select *pSel;
135799135917
Select *pLeft; /* Left-most SELECT statement */
135800135918
Select *pRecTerm; /* Left-most recursive term */
135801135919
int bMayRecursive; /* True if compound joined by UNION [ALL] */
135802135920
With *pSavedWith; /* Initial value of pParse->pWith */
135803135921
int iRecTab = -1; /* Cursor for recursive table */
135922
+ CteUse *pCteUse;
135804135923
135805135924
/* If pCte->zCteErr is non-NULL at this point, then this is an illegal
135806135925
** recursive reference to CTE pCte. Leave an error in pParse and return
135807135926
** early. If pCte->zCteErr is NULL, then this is not a recursive reference.
135808135927
** In this case, proceed. */
135809135928
if( pCte->zCteErr ){
135810135929
sqlite3ErrorMsg(pParse, pCte->zCteErr, pCte->zName);
135811
- return SQLITE_ERROR;
135930
+ return 2;
135812135931
}
135813
- if( cannotBeFunction(pParse, pFrom) ) return SQLITE_ERROR;
135932
+ if( cannotBeFunction(pParse, pFrom) ) return 2;
135814135933
135815135934
assert( pFrom->pTab==0 );
135816
- pFrom->pTab = pTab = sqlite3DbMallocZero(db, sizeof(Table));
135817
- if( pTab==0 ) return WRC_Abort;
135935
+ pTab = sqlite3DbMallocZero(db, sizeof(Table));
135936
+ if( pTab==0 ) return 2;
135937
+ pCteUse = pCte->pUse;
135938
+ if( pCteUse==0 ){
135939
+ pCte->pUse = pCteUse = sqlite3DbMallocZero(db, sizeof(pCteUse[0]));
135940
+ if( pCteUse==0
135941
+ || sqlite3ParserAddCleanup(pParse,sqlite3DbFree,pCteUse)==0
135942
+ ){
135943
+ sqlite3DbFree(db, pTab);
135944
+ return 2;
135945
+ }
135946
+ pCteUse->eM10d = pCte->eM10d;
135947
+ }
135948
+ pFrom->pTab = pTab;
135818135949
pTab->nTabRef = 1;
135819135950
pTab->zName = sqlite3DbStrDup(db, pCte->zName);
135820135951
pTab->iPKey = -1;
135821135952
pTab->nRowLogEst = 200; assert( 200==sqlite3LogEst(1048576) );
135822135953
pTab->tabFlags |= TF_Ephemeral | TF_NoVisibleRowid;
135823135954
pFrom->pSelect = sqlite3SelectDup(db, pCte->pSelect, 0);
135824
- if( db->mallocFailed ) return SQLITE_NOMEM_BKPT;
135955
+ if( db->mallocFailed ) return 2;
135825135956
assert( pFrom->pSelect );
135957
+ pFrom->fg.isCte = 1;
135958
+ pFrom->u2.pCteUse = pCteUse;
135959
+ pCteUse->nUse++;
135960
+ if( pCteUse->nUse>=2 && pCteUse->eM10d==M10d_Any ){
135961
+ pCteUse->eM10d = M10d_Yes;
135962
+ }
135826135963
135827135964
/* Check if this is a recursive CTE. */
135828135965
pRecTerm = pSel = pFrom->pSelect;
135829135966
bMayRecursive = ( pSel->op==TK_ALL || pSel->op==TK_UNION );
135830135967
while( bMayRecursive && pRecTerm->op==pSel->op ){
135831135968
int i;
135832135969
SrcList *pSrc = pRecTerm->pSrc;
135833135970
assert( pRecTerm->pPrior!=0 );
135834135971
for(i=0; i<pSrc->nSrc; i++){
135835
- struct SrcList_item *pItem = &pSrc->a[i];
135972
+ SrcItem *pItem = &pSrc->a[i];
135836135973
if( pItem->zDatabase==0
135837135974
&& pItem->zName!=0
135838135975
&& 0==sqlite3StrICmp(pItem->zName, pCte->zName)
135839135976
){
135840135977
pItem->pTab = pTab;
@@ -135842,11 +135979,11 @@
135842135979
pItem->fg.isRecursive = 1;
135843135980
if( pRecTerm->selFlags & SF_Recursive ){
135844135981
sqlite3ErrorMsg(pParse,
135845135982
"multiple references to recursive table: %s", pCte->zName
135846135983
);
135847
- return SQLITE_ERROR;
135984
+ return 2;
135848135985
}
135849135986
pRecTerm->selFlags |= SF_Recursive;
135850135987
if( iRecTab<0 ) iRecTab = pParse->nTab++;
135851135988
pItem->iCursor = iRecTab;
135852135989
}
@@ -135878,11 +136015,11 @@
135878136015
if( pEList && pEList->nExpr!=pCte->pCols->nExpr ){
135879136016
sqlite3ErrorMsg(pParse, "table %s has %d values for %d columns",
135880136017
pCte->zName, pEList->nExpr, pCte->pCols->nExpr
135881136018
);
135882136019
pParse->pWith = pSavedWith;
135883
- return SQLITE_ERROR;
136020
+ return 2;
135884136021
}
135885136022
pEList = pCte->pCols;
135886136023
}
135887136024
135888136025
sqlite3ColumnsFromExprList(pParse, pEList, &pTab->nCol, &pTab->aCol);
@@ -135894,13 +136031,13 @@
135894136031
}
135895136032
sqlite3WalkSelect(pWalker, pSel);
135896136033
}
135897136034
pCte->zCteErr = 0;
135898136035
pParse->pWith = pSavedWith;
136036
+ return 1; /* Success */
135899136037
}
135900
-
135901
- return SQLITE_OK;
136038
+ return 0; /* No match */
135902136039
}
135903136040
#endif
135904136041
135905136042
#ifndef SQLITE_OMIT_CTE
135906136043
/*
@@ -135930,11 +136067,11 @@
135930136067
** sub-query in the FROM clause of a SELECT statement. This function
135931136068
** allocates and populates the SrcList_item.pTab object. If successful,
135932136069
** SQLITE_OK is returned. Otherwise, if an OOM error is encountered,
135933136070
** SQLITE_NOMEM.
135934136071
*/
135935
-SQLITE_PRIVATE int sqlite3ExpandSubquery(Parse *pParse, struct SrcList_item *pFrom){
136072
+SQLITE_PRIVATE int sqlite3ExpandSubquery(Parse *pParse, SrcItem *pFrom){
135936136073
Select *pSel = pFrom->pSelect;
135937136074
Table *pTab;
135938136075
135939136076
assert( pSel );
135940136077
pFrom->pTab = pTab = sqlite3DbMallocZero(pParse->db, sizeof(Table));
@@ -135978,14 +136115,14 @@
135978136115
** and TABLE.* to be every column in TABLE.
135979136116
**
135980136117
*/
135981136118
static int selectExpander(Walker *pWalker, Select *p){
135982136119
Parse *pParse = pWalker->pParse;
135983
- int i, j, k;
136120
+ int i, j, k, rc;
135984136121
SrcList *pTabList;
135985136122
ExprList *pEList;
135986
- struct SrcList_item *pFrom;
136123
+ SrcItem *pFrom;
135987136124
sqlite3 *db = pParse->db;
135988136125
Expr *pE, *pRight, *pExpr;
135989136126
u16 selFlags = p->selFlags;
135990136127
u32 elistFlags = 0;
135991136128
@@ -136017,23 +136154,25 @@
136017136154
for(i=0, pFrom=pTabList->a; i<pTabList->nSrc; i++, pFrom++){
136018136155
Table *pTab;
136019136156
assert( pFrom->fg.isRecursive==0 || pFrom->pTab!=0 );
136020136157
if( pFrom->pTab ) continue;
136021136158
assert( pFrom->fg.isRecursive==0 );
136022
-#ifndef SQLITE_OMIT_CTE
136023
- if( withExpand(pWalker, pFrom) ) return WRC_Abort;
136024
- if( pFrom->pTab ) {} else
136025
-#endif
136026136159
if( pFrom->zName==0 ){
136027136160
#ifndef SQLITE_OMIT_SUBQUERY
136028136161
Select *pSel = pFrom->pSelect;
136029136162
/* A sub-query in the FROM clause of a SELECT */
136030136163
assert( pSel!=0 );
136031136164
assert( pFrom->pTab==0 );
136032136165
if( sqlite3WalkSelect(pWalker, pSel) ) return WRC_Abort;
136033136166
if( sqlite3ExpandSubquery(pParse, pFrom) ) return WRC_Abort;
136034136167
#endif
136168
+#ifndef SQLITE_OMIT_CTE
136169
+ }else if( (rc = resolveFromTermToCte(pParse, pWalker, pFrom))!=0 ){
136170
+ if( rc>1 ) return WRC_Abort;
136171
+ pTab = pFrom->pTab;
136172
+ assert( pTab!=0 );
136173
+#endif
136035136174
}else{
136036136175
/* An ordinary table or view name in the FROM clause */
136037136176
assert( pFrom->pTab==0 );
136038136177
pFrom->pTab = pTab = sqlite3LocateTableItem(pParse, 0, pFrom);
136039136178
if( pTab==0 ) return WRC_Abort;
@@ -136077,11 +136216,11 @@
136077136216
}
136078136217
#endif
136079136218
}
136080136219
136081136220
/* Locate the index named by the INDEXED BY clause, if any. */
136082
- if( sqlite3IndexedByLookup(pParse, pFrom) ){
136221
+ if( pFrom->fg.isIndexedBy && sqlite3IndexedByLookup(pParse, pFrom) ){
136083136222
return WRC_Abort;
136084136223
}
136085136224
}
136086136225
136087136226
/* Process NATURAL keywords, and ON and USING clauses of joins.
@@ -136320,11 +136459,11 @@
136320136459
*/
136321136460
static void selectAddSubqueryTypeInfo(Walker *pWalker, Select *p){
136322136461
Parse *pParse;
136323136462
int i;
136324136463
SrcList *pTabList;
136325
- struct SrcList_item *pFrom;
136464
+ SrcItem *pFrom;
136326136465
136327136466
assert( p->selFlags & SF_Resolved );
136328136467
if( p->selFlags & SF_HasTypeInfo ) return;
136329136468
p->selFlags |= SF_HasTypeInfo;
136330136469
pParse = pWalker->pParse;
@@ -136644,15 +136783,15 @@
136644136783
/*
136645136784
** Check to see if the pThis entry of pTabList is a self-join of a prior view.
136646136785
** If it is, then return the SrcList_item for the prior view. If it is not,
136647136786
** then return 0.
136648136787
*/
136649
-static struct SrcList_item *isSelfJoinView(
136788
+static SrcItem *isSelfJoinView(
136650136789
SrcList *pTabList, /* Search for self-joins in this FROM clause */
136651
- struct SrcList_item *pThis /* Search for prior reference to this subquery */
136790
+ SrcItem *pThis /* Search for prior reference to this subquery */
136652136791
){
136653
- struct SrcList_item *pItem;
136792
+ SrcItem *pItem;
136654136793
assert( pThis->pSelect!=0 );
136655136794
if( pThis->pSelect->selFlags & SF_PushDown ) return 0;
136656136795
for(pItem = pTabList->a; pItem<pThis; pItem++){
136657136796
Select *pS1;
136658136797
if( pItem->pSelect==0 ) continue;
@@ -136852,13 +136991,13 @@
136852136991
/* If the SF_UpdateFrom flag is set, then this function is being called
136853136992
** as part of populating the temp table for an UPDATE...FROM statement.
136854136993
** In this case, it is an error if the target object (pSrc->a[0]) name
136855136994
** or alias is duplicated within FROM clause (pSrc->a[1..n]). */
136856136995
if( p->selFlags & SF_UpdateFrom ){
136857
- struct SrcList_item *p0 = &p->pSrc->a[0];
136996
+ SrcItem *p0 = &p->pSrc->a[0];
136858136997
for(i=1; i<p->pSrc->nSrc; i++){
136859
- struct SrcList_item *p1 = &p->pSrc->a[i];
136998
+ SrcItem *p1 = &p->pSrc->a[i];
136860136999
if( p0->pTab==p1->pTab && 0==sqlite3_stricmp(p0->zAlias, p1->zAlias) ){
136861137000
sqlite3ErrorMsg(pParse,
136862137001
"target object/alias may not appear in FROM clause: %s",
136863137002
p0->zAlias ? p0->zAlias : p0->pTab->zName
136864137003
);
@@ -136892,11 +137031,11 @@
136892137031
/* Try to do various optimizations (flattening subqueries, and strength
136893137032
** reduction of join operators) in the FROM clause up into the main query
136894137033
*/
136895137034
#if !defined(SQLITE_OMIT_SUBQUERY) || !defined(SQLITE_OMIT_VIEW)
136896137035
for(i=0; !p->pPrior && i<pTabList->nSrc; i++){
136897
- struct SrcList_item *pItem = &pTabList->a[i];
137036
+ SrcItem *pItem = &pTabList->a[i];
136898137037
Select *pSub = pItem->pSelect;
136899137038
Table *pTab = pItem->pTab;
136900137039
136901137040
/* The expander should have already created transient Table objects
136902137041
** even for FROM clause elements such as subqueries that do not correspond
@@ -137026,11 +137165,12 @@
137026137165
/* For each term in the FROM clause, do two things:
137027137166
** (1) Authorized unreferenced tables
137028137167
** (2) Generate code for all sub-queries
137029137168
*/
137030137169
for(i=0; i<pTabList->nSrc; i++){
137031
- struct SrcList_item *pItem = &pTabList->a[i];
137170
+ SrcItem *pItem = &pTabList->a[i];
137171
+ SrcItem *pPrior;
137032137172
SelectDest dest;
137033137173
Select *pSub;
137034137174
#if !defined(SQLITE_OMIT_SUBQUERY) || !defined(SQLITE_OMIT_VIEW)
137035137175
const char *zSavedAuthContext;
137036137176
#endif
@@ -137086,10 +137226,11 @@
137086137226
137087137227
/* Make copies of constant WHERE-clause terms in the outer query down
137088137228
** inside the subquery. This can help the subquery to run more efficiently.
137089137229
*/
137090137230
if( OptimizationEnabled(db, SQLITE_PushDown)
137231
+ && (pItem->fg.isCte==0 || pItem->u2.pCteUse->eM10d!=M10d_Yes)
137091137232
&& pushDownWhereTerms(pParse, pSub, p->pWhere, pItem->iCursor,
137092137233
(pItem->fg.jointype & JT_OUTER)!=0)
137093137234
){
137094137235
#if SELECTTRACE_ENABLED
137095137236
if( sqlite3SelectTrace & 0x100 ){
@@ -137106,20 +137247,22 @@
137106137247
zSavedAuthContext = pParse->zAuthContext;
137107137248
pParse->zAuthContext = pItem->zName;
137108137249
137109137250
/* Generate code to implement the subquery
137110137251
**
137111
- ** The subquery is implemented as a co-routine if the subquery is
137112
- ** guaranteed to be the outer loop (so that it does not need to be
137113
- ** computed more than once)
137252
+ ** The subquery is implemented as a co-routine if:
137253
+ ** (1) the subquery is guaranteed to be the outer loop (so that
137254
+ ** it does not need to be computed more than once), and
137255
+ ** (2) the subquery is not a CTE that should be materialized
137114137256
**
137115
- ** TODO: Are there other reasons beside (1) to use a co-routine
137257
+ ** TODO: Are there other reasons beside (1) and (2) to use a co-routine
137116137258
** implementation?
137117137259
*/
137118137260
if( i==0
137119137261
&& (pTabList->nSrc==1
137120137262
|| (pTabList->a[1].fg.jointype&(JT_LEFT|JT_CROSS))!=0) /* (1) */
137263
+ && (pItem->fg.isCte==0 || pItem->u2.pCteUse->eM10d!=M10d_Yes) /* (2) */
137121137264
){
137122137265
/* Implement a co-routine that will return a single row of the result
137123137266
** set on each invocation.
137124137267
*/
137125137268
int addrTop = sqlite3VdbeCurrentAddr(v)+1;
@@ -137135,20 +137278,34 @@
137135137278
pItem->fg.viaCoroutine = 1;
137136137279
pItem->regResult = dest.iSdst;
137137137280
sqlite3VdbeEndCoroutine(v, pItem->regReturn);
137138137281
sqlite3VdbeJumpHere(v, addrTop-1);
137139137282
sqlite3ClearTempRegCache(pParse);
137283
+ }else if( pItem->fg.isCte && pItem->u2.pCteUse->addrM9e>0 ){
137284
+ /* This is a CTE for which materialization code has already been
137285
+ ** generated. Invoke the subroutine to compute the materialization,
137286
+ ** the make the pItem->iCursor be a copy of the ephemerial table that
137287
+ ** holds the result of the materialization. */
137288
+ CteUse *pCteUse = pItem->u2.pCteUse;
137289
+ sqlite3VdbeAddOp2(v, OP_Gosub, pCteUse->regRtn, pCteUse->addrM9e);
137290
+ if( pItem->iCursor!=pCteUse->iCur ){
137291
+ sqlite3VdbeAddOp2(v, OP_OpenDup, pItem->iCursor, pCteUse->iCur);
137292
+ }
137293
+ pSub->nSelectRow = pCteUse->nRowEst;
137294
+ }else if( (pPrior = isSelfJoinView(pTabList, pItem))!=0 ){
137295
+ /* This view has already been materialized by a prior entry in
137296
+ ** this same FROM clause. Reuse it. */
137297
+ if( pPrior->addrFillSub ){
137298
+ sqlite3VdbeAddOp2(v, OP_Gosub, pPrior->regReturn, pPrior->addrFillSub);
137299
+ }
137300
+ sqlite3VdbeAddOp2(v, OP_OpenDup, pItem->iCursor, pPrior->iCursor);
137301
+ pSub->nSelectRow = pPrior->pSelect->nSelectRow;
137140137302
}else{
137141
- /* Generate a subroutine that will fill an ephemeral table with
137142
- ** the content of this subquery. pItem->addrFillSub will point
137143
- ** to the address of the generated subroutine. pItem->regReturn
137144
- ** is a register allocated to hold the subroutine return address
137145
- */
137303
+ /* Generate a subroutine that will materialize the view. */
137146137304
int topAddr;
137147137305
int onceAddr = 0;
137148137306
int retAddr;
137149
- struct SrcList_item *pPrior;
137150137307
137151137308
testcase( pItem->addrFillSub==0 ); /* Ticket c52b09c7f38903b1311 */
137152137309
pItem->regReturn = ++pParse->nMem;
137153137310
topAddr = sqlite3VdbeAddOp2(v, OP_Integer, 0, pItem->regReturn);
137154137311
pItem->addrFillSub = topAddr+1;
@@ -137159,26 +137316,26 @@
137159137316
onceAddr = sqlite3VdbeAddOp0(v, OP_Once); VdbeCoverage(v);
137160137317
VdbeComment((v, "materialize \"%s\"", pItem->pTab->zName));
137161137318
}else{
137162137319
VdbeNoopComment((v, "materialize \"%s\"", pItem->pTab->zName));
137163137320
}
137164
- pPrior = isSelfJoinView(pTabList, pItem);
137165
- if( pPrior ){
137166
- sqlite3VdbeAddOp2(v, OP_OpenDup, pItem->iCursor, pPrior->iCursor);
137167
- assert( pPrior->pSelect!=0 );
137168
- pSub->nSelectRow = pPrior->pSelect->nSelectRow;
137169
- }else{
137170
- sqlite3SelectDestInit(&dest, SRT_EphemTab, pItem->iCursor);
137171
- ExplainQueryPlan((pParse, 1, "MATERIALIZE %u", pSub->selId));
137172
- sqlite3Select(pParse, pSub, &dest);
137173
- }
137321
+ sqlite3SelectDestInit(&dest, SRT_EphemTab, pItem->iCursor);
137322
+ ExplainQueryPlan((pParse, 1, "MATERIALIZE %u", pSub->selId));
137323
+ sqlite3Select(pParse, pSub, &dest);
137174137324
pItem->pTab->nRowLogEst = pSub->nSelectRow;
137175137325
if( onceAddr ) sqlite3VdbeJumpHere(v, onceAddr);
137176137326
retAddr = sqlite3VdbeAddOp1(v, OP_Return, pItem->regReturn);
137177137327
VdbeComment((v, "end %s", pItem->pTab->zName));
137178137328
sqlite3VdbeChangeP1(v, topAddr, retAddr);
137179137329
sqlite3ClearTempRegCache(pParse);
137330
+ if( pItem->fg.isCte ){
137331
+ CteUse *pCteUse = pItem->u2.pCteUse;
137332
+ pCteUse->addrM9e = pItem->addrFillSub;
137333
+ pCteUse->regRtn = pItem->regReturn;
137334
+ pCteUse->iCur = pItem->iCursor;
137335
+ pCteUse->nRowEst = pSub->nSelectRow;
137336
+ }
137180137337
}
137181137338
if( db->mallocFailed ) goto select_end;
137182137339
pParse->nHeight -= sqlite3SelectExprHeight(p);
137183137340
pParse->zAuthContext = zSavedAuthContext;
137184137341
#endif
@@ -143432,11 +143589,11 @@
143432143589
SQLITE_PRIVATE void sqlite3WhereSplit(WhereClause*,Expr*,u8);
143433143590
SQLITE_PRIVATE Bitmask sqlite3WhereExprUsage(WhereMaskSet*, Expr*);
143434143591
SQLITE_PRIVATE Bitmask sqlite3WhereExprUsageNN(WhereMaskSet*, Expr*);
143435143592
SQLITE_PRIVATE Bitmask sqlite3WhereExprListUsage(WhereMaskSet*, ExprList*);
143436143593
SQLITE_PRIVATE void sqlite3WhereExprAnalyze(SrcList*, WhereClause*);
143437
-SQLITE_PRIVATE void sqlite3WhereTabFuncArgs(Parse*, struct SrcList_item*, WhereClause*);
143594
+SQLITE_PRIVATE void sqlite3WhereTabFuncArgs(Parse*, SrcItem*, WhereClause*);
143438143595
143439143596
143440143597
143441143598
143442143599
@@ -143610,11 +143767,11 @@
143610143767
int ret = 0;
143611143768
#if !defined(SQLITE_DEBUG) && !defined(SQLITE_ENABLE_STMT_SCANSTATUS)
143612143769
if( sqlite3ParseToplevel(pParse)->explain==2 )
143613143770
#endif
143614143771
{
143615
- struct SrcList_item *pItem = &pTabList->a[pLevel->iFrom];
143772
+ SrcItem *pItem = &pTabList->a[pLevel->iFrom];
143616143773
Vdbe *v = pParse->pVdbe; /* VM being constructed */
143617143774
sqlite3 *db = pParse->db; /* Database handle */
143618143775
int isSearch; /* True for a SEARCH. False for SCAN. */
143619143776
WhereLoop *pLoop; /* The controlling WhereLoop object */
143620143777
u32 flags; /* Flags that describe this loop */
@@ -144403,11 +144560,11 @@
144403144560
144404144561
/*
144405144562
** Insert an OP_CursorHint instruction if it is appropriate to do so.
144406144563
*/
144407144564
static void codeCursorHint(
144408
- struct SrcList_item *pTabItem, /* FROM clause item */
144565
+ SrcItem *pTabItem, /* FROM clause item */
144409144566
WhereInfo *pWInfo, /* The where clause */
144410144567
WhereLevel *pLevel, /* Which loop to provide hints for */
144411144568
WhereTerm *pEndRange /* Hint this end-of-scan boundary term if not NULL */
144412144569
){
144413144570
Parse *pParse = pWInfo->pParse;
@@ -144778,11 +144935,11 @@
144778144935
int bRev; /* True if we need to scan in reverse order */
144779144936
WhereLoop *pLoop; /* The WhereLoop object being coded */
144780144937
WhereClause *pWC; /* Decomposition of the entire WHERE clause */
144781144938
WhereTerm *pTerm; /* A WHERE clause term */
144782144939
sqlite3 *db; /* Database connection */
144783
- struct SrcList_item *pTabItem; /* FROM clause term being coded */
144940
+ SrcItem *pTabItem; /* FROM clause term being coded */
144784144941
int addrBrk; /* Jump here to break out of the loop */
144785144942
int addrHalt; /* addrBrk for the outermost loop */
144786144943
int addrCont; /* Jump here to continue with next cycle */
144787144944
int iRowidReg = 0; /* Rowid is stored in this register, if not zero */
144788144945
int iReleaseReg = 0; /* Temp register to free before returning */
@@ -145566,11 +145723,11 @@
145566145723
** by this loop in the a[0] slot and all notReady tables in a[1..] slots.
145567145724
** This becomes the SrcList in the recursive call to sqlite3WhereBegin().
145568145725
*/
145569145726
if( pWInfo->nLevel>1 ){
145570145727
int nNotReady; /* The number of notReady tables */
145571
- struct SrcList_item *origSrc; /* Original list of tables */
145728
+ SrcItem *origSrc; /* Original list of tables */
145572145729
nNotReady = pWInfo->nLevel - iLevel - 1;
145573145730
pOrTab = sqlite3StackAllocRaw(db,
145574145731
sizeof(*pOrTab)+ nNotReady*sizeof(pOrTab->a[0]));
145575145732
if( pOrTab==0 ) return notReady;
145576145733
pOrTab->nAlloc = (u8)(nNotReady + 1);
@@ -147831,11 +147988,11 @@
147831147988
** Each function argument translates into an equality constraint against
147832147989
** a HIDDEN column in the table.
147833147990
*/
147834147991
SQLITE_PRIVATE void sqlite3WhereTabFuncArgs(
147835147992
Parse *pParse, /* Parsing context */
147836
- struct SrcList_item *pItem, /* The FROM clause term to process */
147993
+ SrcItem *pItem, /* The FROM clause term to process */
147837147994
WhereClause *pWC /* Xfer function arguments to here */
147838147995
){
147839147996
Table *pTab;
147840147997
int j, k;
147841147998
ExprList *pArgs;
@@ -148565,11 +148722,11 @@
148565148722
** could be used with an index to access pSrc, assuming an appropriate
148566148723
** index existed.
148567148724
*/
148568148725
static int termCanDriveIndex(
148569148726
WhereTerm *pTerm, /* WHERE clause term to check */
148570
- struct SrcList_item *pSrc, /* Table we are trying to access */
148727
+ SrcItem *pSrc, /* Table we are trying to access */
148571148728
Bitmask notReady /* Tables in outer loops of the join */
148572148729
){
148573148730
char aff;
148574148731
if( pTerm->leftCursor!=pSrc->iCursor ) return 0;
148575148732
if( (pTerm->eOperator & (WO_EQ|WO_IS))==0 ) return 0;
@@ -148599,11 +148756,11 @@
148599148756
** makes use of the automatic index.
148600148757
*/
148601148758
static void constructAutomaticIndex(
148602148759
Parse *pParse, /* The parsing context */
148603148760
WhereClause *pWC, /* The WHERE clause */
148604
- struct SrcList_item *pSrc, /* The FROM clause term to get the next index */
148761
+ SrcItem *pSrc, /* The FROM clause term to get the next index */
148605148762
Bitmask notReady, /* Mask of cursors that are not available */
148606148763
WhereLevel *pLevel /* Write new index here */
148607148764
){
148608148765
int nKeyCol; /* Number of columns in the constructed index */
148609148766
WhereTerm *pTerm; /* A single term of the WHERE clause */
@@ -148623,11 +148780,11 @@
148623148780
Bitmask idxCols; /* Bitmap of columns used for indexing */
148624148781
Bitmask extraCols; /* Bitmap of additional columns */
148625148782
u8 sentWarning = 0; /* True if a warnning has been issued */
148626148783
Expr *pPartial = 0; /* Partial Index Expression */
148627148784
int iContinue = 0; /* Jump here to skip excluded rows */
148628
- struct SrcList_item *pTabItem; /* FROM clause term being indexed */
148785
+ SrcItem *pTabItem; /* FROM clause term being indexed */
148629148786
int addrCounter = 0; /* Address where integer counter is initialized */
148630148787
int regBase; /* Array of registers where record is assembled */
148631148788
148632148789
/* Generate code to skip over the creation and initialization of the
148633148790
** transient index on 2nd and subsequent iterations of the loop. */
@@ -148807,11 +148964,11 @@
148807148964
*/
148808148965
static sqlite3_index_info *allocateIndexInfo(
148809148966
Parse *pParse, /* The parsing context */
148810148967
WhereClause *pWC, /* The WHERE clause being analyzed */
148811148968
Bitmask mUnusable, /* Ignore terms with these prereqs */
148812
- struct SrcList_item *pSrc, /* The FROM clause term that is the vtab */
148969
+ SrcItem *pSrc, /* The FROM clause term that is the vtab */
148813148970
ExprList *pOrderBy, /* The ORDER BY clause */
148814148971
u16 *pmNoOmit /* Mask of terms not to omit */
148815148972
){
148816148973
int i, j;
148817148974
int nTerm;
@@ -149705,11 +149862,11 @@
149705149862
** Print a WhereLoop object for debugging purposes
149706149863
*/
149707149864
SQLITE_PRIVATE void sqlite3WhereLoopPrint(WhereLoop *p, WhereClause *pWC){
149708149865
WhereInfo *pWInfo = pWC->pWInfo;
149709149866
int nb = 1+(pWInfo->pTabList->nSrc+3)/4;
149710
- struct SrcList_item *pItem = pWInfo->pTabList->a + p->iTab;
149867
+ SrcItem *pItem = pWInfo->pTabList->a + p->iTab;
149711149868
Table *pTab = pItem->pTab;
149712149869
Bitmask mAll = (((Bitmask)1)<<(nb*4)) - 1;
149713149870
sqlite3DebugPrintf("%c%2d.%0*llx.%0*llx", p->cId,
149714149871
p->iTab, nb, p->maskSelf, nb, p->prereq & mAll);
149715149872
sqlite3DebugPrintf(" %12s",
@@ -150316,11 +150473,11 @@
150316150473
** If pProbe->idxType==SQLITE_IDXTYPE_IPK, that means pIndex is
150317150474
** a fake index used for the INTEGER PRIMARY KEY.
150318150475
*/
150319150476
static int whereLoopAddBtreeIndex(
150320150477
WhereLoopBuilder *pBuilder, /* The WhereLoop factory */
150321
- struct SrcList_item *pSrc, /* FROM clause term being analyzed */
150478
+ SrcItem *pSrc, /* FROM clause term being analyzed */
150322150479
Index *pProbe, /* An index on pSrc */
150323150480
LogEst nInMul /* log(Number of iterations due to IN) */
150324150481
){
150325150482
WhereInfo *pWInfo = pBuilder->pWInfo; /* WHERE analyse context */
150326150483
Parse *pParse = pWInfo->pParse; /* Parsing context */
@@ -150807,11 +150964,11 @@
150807150964
Index *pProbe; /* An index we are evaluating */
150808150965
Index sPk; /* A fake index object for the primary key */
150809150966
LogEst aiRowEstPk[2]; /* The aiRowLogEst[] value for the sPk index */
150810150967
i16 aiColumnPk = -1; /* The aColumn[] value for the sPk index */
150811150968
SrcList *pTabList; /* The FROM clause */
150812
- struct SrcList_item *pSrc; /* The FROM clause btree term to add */
150969
+ SrcItem *pSrc; /* The FROM clause btree term to add */
150813150970
WhereLoop *pNew; /* Template WhereLoop object */
150814150971
int rc = SQLITE_OK; /* Return code */
150815150972
int iSortIdx = 1; /* Index number */
150816150973
int b; /* A boolean value */
150817150974
LogEst rSize; /* number of rows in the table */
@@ -150825,13 +150982,13 @@
150825150982
pSrc = pTabList->a + pNew->iTab;
150826150983
pTab = pSrc->pTab;
150827150984
pWC = pBuilder->pWC;
150828150985
assert( !IsVirtual(pSrc->pTab) );
150829150986
150830
- if( pSrc->pIBIndex ){
150987
+ if( pSrc->fg.isIndexedBy ){
150831150988
/* An INDEXED BY clause specifies a particular index to use */
150832
- pProbe = pSrc->pIBIndex;
150989
+ pProbe = pSrc->u2.pIBIndex;
150833150990
}else if( !HasRowid(pTab) ){
150834150991
pProbe = pTab->pIndex;
150835150992
}else{
150836150993
/* There is no INDEXED BY clause. Create a fake Index object in local
150837150994
** variable sPk to represent the rowid primary key index. Make this
@@ -150863,11 +151020,11 @@
150863151020
#ifndef SQLITE_OMIT_AUTOMATIC_INDEX
150864151021
/* Automatic indexes */
150865151022
if( !pBuilder->pOrSet /* Not part of an OR optimization */
150866151023
&& (pWInfo->wctrlFlags & WHERE_OR_SUBCLAUSE)==0
150867151024
&& (pWInfo->pParse->db->flags & SQLITE_AutoIndex)!=0
150868
- && pSrc->pIBIndex==0 /* Has no INDEXED BY clause */
151025
+ && !pSrc->fg.isIndexedBy /* Has no INDEXED BY clause */
150869151026
&& !pSrc->fg.notIndexed /* Has no NOT INDEXED clause */
150870151027
&& HasRowid(pTab) /* Not WITHOUT ROWID table. (FIXME: Why not?) */
150871151028
&& !pSrc->fg.isCorrelated /* Not a correlated subquery */
150872151029
&& !pSrc->fg.isRecursive /* Not a recursive common table expression. */
150873151030
){
@@ -150913,11 +151070,11 @@
150913151070
#endif /* SQLITE_OMIT_AUTOMATIC_INDEX */
150914151071
150915151072
/* Loop over all indices. If there was an INDEXED BY clause, then only
150916151073
** consider index pProbe. */
150917151074
for(; rc==SQLITE_OK && pProbe;
150918
- pProbe=(pSrc->pIBIndex ? 0 : pProbe->pNext), iSortIdx++
151075
+ pProbe=(pSrc->fg.isIndexedBy ? 0 : pProbe->pNext), iSortIdx++
150919151076
){
150920151077
int isLeft = (pSrc->fg.jointype & JT_OUTER)!=0;
150921151078
if( pProbe->pPartIdxWhere!=0
150922151079
&& !whereUsablePartialIndex(pSrc->iCursor, isLeft, pWC,
150923151080
pProbe->pPartIdxWhere)
@@ -151088,11 +151245,11 @@
151088151245
int i;
151089151246
int mxTerm;
151090151247
int rc = SQLITE_OK;
151091151248
WhereLoop *pNew = pBuilder->pNew;
151092151249
Parse *pParse = pBuilder->pWInfo->pParse;
151093
- struct SrcList_item *pSrc = &pBuilder->pWInfo->pTabList->a[pNew->iTab];
151250
+ SrcItem *pSrc = &pBuilder->pWInfo->pTabList->a[pNew->iTab];
151094151251
int nConstraint = pIdxInfo->nConstraint;
151095151252
151096151253
assert( (mUsable & mPrereq)==mPrereq );
151097151254
*pbIn = 0;
151098151255
pNew->prereq = mPrereq;
@@ -151280,11 +151437,11 @@
151280151437
){
151281151438
int rc = SQLITE_OK; /* Return code */
151282151439
WhereInfo *pWInfo; /* WHERE analysis context */
151283151440
Parse *pParse; /* The parsing context */
151284151441
WhereClause *pWC; /* The WHERE clause */
151285
- struct SrcList_item *pSrc; /* The FROM clause term to search */
151442
+ SrcItem *pSrc; /* The FROM clause term to search */
151286151443
sqlite3_index_info *p; /* Object to pass to xBestIndex() */
151287151444
int nConstraint; /* Number of constraints in p */
151288151445
int bIn; /* True if plan uses IN(...) operator */
151289151446
WhereLoop *pNew;
151290151447
Bitmask mBest; /* Tables used by best possible plan */
@@ -151408,11 +151565,11 @@
151408151565
int rc = SQLITE_OK;
151409151566
int iCur;
151410151567
WhereClause tempWC;
151411151568
WhereLoopBuilder sSubBuild;
151412151569
WhereOrSet sSum, sCur;
151413
- struct SrcList_item *pItem;
151570
+ SrcItem *pItem;
151414151571
151415151572
pWC = pBuilder->pWC;
151416151573
pWCEnd = pWC->a + pWC->nTerm;
151417151574
pNew = pBuilder->pNew;
151418151575
memset(&sSum, 0, sizeof(sSum));
@@ -151524,12 +151681,12 @@
151524151681
WhereInfo *pWInfo = pBuilder->pWInfo;
151525151682
Bitmask mPrereq = 0;
151526151683
Bitmask mPrior = 0;
151527151684
int iTab;
151528151685
SrcList *pTabList = pWInfo->pTabList;
151529
- struct SrcList_item *pItem;
151530
- struct SrcList_item *pEnd = &pTabList->a[pWInfo->nLevel];
151686
+ SrcItem *pItem;
151687
+ SrcItem *pEnd = &pTabList->a[pWInfo->nLevel];
151531151688
sqlite3 *db = pWInfo->pParse->db;
151532151689
int rc = SQLITE_OK;
151533151690
WhereLoop *pNew;
151534151691
151535151692
/* Loop over the tables in the join, from left to right */
@@ -151548,11 +151705,11 @@
151548151705
}else{
151549151706
mPrereq = 0;
151550151707
}
151551151708
#ifndef SQLITE_OMIT_VIRTUALTABLE
151552151709
if( IsVirtual(pItem->pTab) ){
151553
- struct SrcList_item *p;
151710
+ SrcItem *p;
151554151711
for(p=&pItem[1]; p<pEnd; p++){
151555151712
if( mUnusable || (p->fg.jointype & (JT_LEFT|JT_CROSS)) ){
151556151713
mUnusable |= sqlite3WhereGetMask(&pWInfo->sMaskSet, p->iCursor);
151557151714
}
151558151715
}
@@ -152403,11 +152560,11 @@
152403152560
** no-frills query planner. Return zero if this query needs the
152404152561
** general-purpose query planner.
152405152562
*/
152406152563
static int whereShortCut(WhereLoopBuilder *pBuilder){
152407152564
WhereInfo *pWInfo;
152408
- struct SrcList_item *pItem;
152565
+ SrcItem *pItem;
152409152566
WhereClause *pWC;
152410152567
WhereTerm *pTerm;
152411152568
WhereLoop *pLoop;
152412152569
int iCur;
152413152570
int j;
@@ -152933,11 +153090,11 @@
152933153090
if( sWLB.pOrderBy ){
152934153091
tabUsed |= sqlite3WhereExprListUsage(pMaskSet, sWLB.pOrderBy);
152935153092
}
152936153093
for(i=pWInfo->nLevel-1; i>=1; i--){
152937153094
WhereTerm *pTerm, *pEnd;
152938
- struct SrcList_item *pItem;
153095
+ SrcItem *pItem;
152939153096
pLoop = pWInfo->a[i].pWLoop;
152940153097
pItem = &pWInfo->pTabList->a[pLoop->iTab];
152941153098
if( (pItem->fg.jointype & JT_LEFT)==0 ) continue;
152942153099
if( (wctrlFlags & WHERE_WANT_DISTINCT)==0
152943153100
&& (pLoop->wsFlags & WHERE_ONEROW)==0
@@ -153023,11 +153180,11 @@
153023153180
** searching those tables.
153024153181
*/
153025153182
for(ii=0, pLevel=pWInfo->a; ii<nTabList; ii++, pLevel++){
153026153183
Table *pTab; /* Table to open */
153027153184
int iDb; /* Index of database containing table/index */
153028
- struct SrcList_item *pTabItem;
153185
+ SrcItem *pTabItem;
153029153186
153030153187
pTabItem = &pTabList->a[pLevel->iFrom];
153031153188
pTab = pTabItem->pTab;
153032153189
iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
153033153190
pLoop = pLevel->pWLoop;
@@ -153360,11 +153517,11 @@
153360153517
assert( pWInfo->nLevel<=pTabList->nSrc );
153361153518
for(i=0, pLevel=pWInfo->a; i<pWInfo->nLevel; i++, pLevel++){
153362153519
int k, last;
153363153520
VdbeOp *pOp, *pLastOp;
153364153521
Index *pIdx = 0;
153365
- struct SrcList_item *pTabItem = &pTabList->a[pLevel->iFrom];
153522
+ SrcItem *pTabItem = &pTabList->a[pLevel->iFrom];
153366153523
Table *pTab = pTabItem->pTab;
153367153524
assert( pTab!=0 );
153368153525
pLoop = pLevel->pWLoop;
153369153526
153370153527
/* For a co-routine, change all OP_Column references to the table of
@@ -156672,10 +156829,23 @@
156672156829
sqlite3ErrorMsg(pParse, "too many terms in compound SELECT");
156673156830
}
156674156831
}
156675156832
}
156676156833
156834
+ /* Attach a With object describing the WITH clause to a Select
156835
+ ** object describing the query for which the WITH clause is a prefix.
156836
+ */
156837
+ static Select *attachWithToSelect(Parse *pParse, Select *pSelect, With *pWith){
156838
+ if( pSelect ){
156839
+ pSelect->pWith = pWith;
156840
+ parserDoubleLinkSelect(pParse, pSelect);
156841
+ }else{
156842
+ sqlite3WithDelete(pParse->db, pWith);
156843
+ }
156844
+ return pSelect;
156845
+ }
156846
+
156677156847
156678156848
/* Construct a new Expr object from a single identifier. Use the
156679156849
** new Expr to populate pOut. Set the span of pOut to be the identifier
156680156850
** that created the expression.
156681156851
*/
@@ -156847,95 +157017,96 @@
156847157017
#define TK_GROUPS 92
156848157018
#define TK_OTHERS 93
156849157019
#define TK_TIES 94
156850157020
#define TK_GENERATED 95
156851157021
#define TK_ALWAYS 96
156852
-#define TK_REINDEX 97
156853
-#define TK_RENAME 98
156854
-#define TK_CTIME_KW 99
156855
-#define TK_ANY 100
156856
-#define TK_BITAND 101
156857
-#define TK_BITOR 102
156858
-#define TK_LSHIFT 103
156859
-#define TK_RSHIFT 104
156860
-#define TK_PLUS 105
156861
-#define TK_MINUS 106
156862
-#define TK_STAR 107
156863
-#define TK_SLASH 108
156864
-#define TK_REM 109
156865
-#define TK_CONCAT 110
156866
-#define TK_COLLATE 111
156867
-#define TK_BITNOT 112
156868
-#define TK_ON 113
156869
-#define TK_INDEXED 114
156870
-#define TK_STRING 115
156871
-#define TK_JOIN_KW 116
156872
-#define TK_CONSTRAINT 117
156873
-#define TK_DEFAULT 118
156874
-#define TK_NULL 119
156875
-#define TK_PRIMARY 120
156876
-#define TK_UNIQUE 121
156877
-#define TK_CHECK 122
156878
-#define TK_REFERENCES 123
156879
-#define TK_AUTOINCR 124
156880
-#define TK_INSERT 125
156881
-#define TK_DELETE 126
156882
-#define TK_UPDATE 127
156883
-#define TK_SET 128
156884
-#define TK_DEFERRABLE 129
156885
-#define TK_FOREIGN 130
156886
-#define TK_DROP 131
156887
-#define TK_UNION 132
156888
-#define TK_ALL 133
156889
-#define TK_EXCEPT 134
156890
-#define TK_INTERSECT 135
156891
-#define TK_SELECT 136
156892
-#define TK_VALUES 137
156893
-#define TK_DISTINCT 138
156894
-#define TK_DOT 139
156895
-#define TK_FROM 140
156896
-#define TK_JOIN 141
156897
-#define TK_USING 142
156898
-#define TK_ORDER 143
156899
-#define TK_GROUP 144
156900
-#define TK_HAVING 145
156901
-#define TK_LIMIT 146
156902
-#define TK_WHERE 147
156903
-#define TK_RETURNING 148
156904
-#define TK_INTO 149
156905
-#define TK_NOTHING 150
156906
-#define TK_FLOAT 151
156907
-#define TK_BLOB 152
156908
-#define TK_INTEGER 153
156909
-#define TK_VARIABLE 154
156910
-#define TK_CASE 155
156911
-#define TK_WHEN 156
156912
-#define TK_THEN 157
156913
-#define TK_ELSE 158
156914
-#define TK_INDEX 159
156915
-#define TK_ALTER 160
156916
-#define TK_ADD 161
156917
-#define TK_WINDOW 162
156918
-#define TK_OVER 163
156919
-#define TK_FILTER 164
156920
-#define TK_COLUMN 165
156921
-#define TK_AGG_FUNCTION 166
156922
-#define TK_AGG_COLUMN 167
156923
-#define TK_TRUEFALSE 168
156924
-#define TK_ISNOT 169
156925
-#define TK_FUNCTION 170
156926
-#define TK_UMINUS 171
156927
-#define TK_UPLUS 172
156928
-#define TK_TRUTH 173
156929
-#define TK_REGISTER 174
156930
-#define TK_VECTOR 175
156931
-#define TK_SELECT_COLUMN 176
156932
-#define TK_IF_NULL_ROW 177
156933
-#define TK_ASTERISK 178
156934
-#define TK_SPAN 179
156935
-#define TK_SPACE 180
156936
-#define TK_ILLEGAL 181
157022
+#define TK_MATERIALIZED 97
157023
+#define TK_REINDEX 98
157024
+#define TK_RENAME 99
157025
+#define TK_CTIME_KW 100
157026
+#define TK_ANY 101
157027
+#define TK_BITAND 102
157028
+#define TK_BITOR 103
157029
+#define TK_LSHIFT 104
157030
+#define TK_RSHIFT 105
157031
+#define TK_PLUS 106
157032
+#define TK_MINUS 107
157033
+#define TK_STAR 108
157034
+#define TK_SLASH 109
157035
+#define TK_REM 110
157036
+#define TK_CONCAT 111
157037
+#define TK_COLLATE 112
157038
+#define TK_BITNOT 113
157039
+#define TK_ON 114
157040
+#define TK_INDEXED 115
157041
+#define TK_STRING 116
157042
+#define TK_JOIN_KW 117
157043
+#define TK_CONSTRAINT 118
157044
+#define TK_DEFAULT 119
157045
+#define TK_NULL 120
157046
+#define TK_PRIMARY 121
157047
+#define TK_UNIQUE 122
157048
+#define TK_CHECK 123
157049
+#define TK_REFERENCES 124
157050
+#define TK_AUTOINCR 125
157051
+#define TK_INSERT 126
157052
+#define TK_DELETE 127
157053
+#define TK_UPDATE 128
157054
+#define TK_SET 129
157055
+#define TK_DEFERRABLE 130
157056
+#define TK_FOREIGN 131
157057
+#define TK_DROP 132
157058
+#define TK_UNION 133
157059
+#define TK_ALL 134
157060
+#define TK_EXCEPT 135
157061
+#define TK_INTERSECT 136
157062
+#define TK_SELECT 137
157063
+#define TK_VALUES 138
157064
+#define TK_DISTINCT 139
157065
+#define TK_DOT 140
157066
+#define TK_FROM 141
157067
+#define TK_JOIN 142
157068
+#define TK_USING 143
157069
+#define TK_ORDER 144
157070
+#define TK_GROUP 145
157071
+#define TK_HAVING 146
157072
+#define TK_LIMIT 147
157073
+#define TK_WHERE 148
157074
+#define TK_RETURNING 149
157075
+#define TK_INTO 150
157076
+#define TK_NOTHING 151
157077
+#define TK_FLOAT 152
157078
+#define TK_BLOB 153
157079
+#define TK_INTEGER 154
157080
+#define TK_VARIABLE 155
157081
+#define TK_CASE 156
157082
+#define TK_WHEN 157
157083
+#define TK_THEN 158
157084
+#define TK_ELSE 159
157085
+#define TK_INDEX 160
157086
+#define TK_ALTER 161
157087
+#define TK_ADD 162
157088
+#define TK_WINDOW 163
157089
+#define TK_OVER 164
157090
+#define TK_FILTER 165
157091
+#define TK_COLUMN 166
157092
+#define TK_AGG_FUNCTION 167
157093
+#define TK_AGG_COLUMN 168
157094
+#define TK_TRUEFALSE 169
157095
+#define TK_ISNOT 170
157096
+#define TK_FUNCTION 171
157097
+#define TK_UMINUS 172
157098
+#define TK_UPLUS 173
157099
+#define TK_TRUTH 174
157100
+#define TK_REGISTER 175
157101
+#define TK_VECTOR 176
157102
+#define TK_SELECT_COLUMN 177
157103
+#define TK_IF_NULL_ROW 178
157104
+#define TK_ASTERISK 179
157105
+#define TK_SPAN 180
157106
+#define TK_SPACE 181
157107
+#define TK_ILLEGAL 182
156937157108
#endif
156938157109
/**************** End token definitions ***************************************/
156939157110
156940157111
/* The next sections is a series of control #defines.
156941157112
** various aspects of the generated parser.
@@ -156991,32 +157162,33 @@
156991157162
#ifndef INTERFACE
156992157163
# define INTERFACE 1
156993157164
#endif
156994157165
/************* Begin control #defines *****************************************/
156995157166
#define YYCODETYPE unsigned short int
156996
-#define YYNOCODE 313
157167
+#define YYNOCODE 316
156997157168
#define YYACTIONTYPE unsigned short int
156998
-#define YYWILDCARD 100
157169
+#define YYWILDCARD 101
156999157170
#define sqlite3ParserTOKENTYPE Token
157000157171
typedef union {
157001157172
int yyinit;
157002157173
sqlite3ParserTOKENTYPE yy0;
157003
- Upsert* yy40;
157004
- TriggerStep* yy51;
157005
- With* yy105;
157006
- Select* yy293;
157007
- struct TrigEvent yy298;
157008
- struct FrameBound yy341;
157009
- ExprList* yy350;
157010
- Expr* yy354;
157011
- int yy412;
157012
- SrcList* yy457;
157013
- struct {int value; int mask;} yy463;
157014
- IdList* yy498;
157015
- Window* yy503;
157016
- const char* yy504;
157017
- u8 yy624;
157174
+ Window* yy19;
157175
+ struct TrigEvent yy50;
157176
+ int yy60;
157177
+ struct FrameBound yy113;
157178
+ Upsert* yy178;
157179
+ With* yy195;
157180
+ IdList* yy288;
157181
+ SrcList* yy291;
157182
+ Select* yy307;
157183
+ ExprList* yy338;
157184
+ TriggerStep* yy483;
157185
+ const char* yy528;
157186
+ u8 yy570;
157187
+ Expr* yy602;
157188
+ Cte* yy607;
157189
+ struct {int value; int mask;} yy615;
157018157190
} YYMINORTYPE;
157019157191
#ifndef YYSTACKDEPTH
157020157192
#define YYSTACKDEPTH 100
157021157193
#endif
157022157194
#define sqlite3ParserARG_SDECL
@@ -157028,22 +157200,22 @@
157028157200
#define sqlite3ParserCTX_PDECL ,Parse *pParse
157029157201
#define sqlite3ParserCTX_PARAM ,pParse
157030157202
#define sqlite3ParserCTX_FETCH Parse *pParse=yypParser->pParse;
157031157203
#define sqlite3ParserCTX_STORE yypParser->pParse=pParse;
157032157204
#define YYFALLBACK 1
157033
-#define YYNSTATE 573
157034
-#define YYNRULE 394
157035
-#define YYNRULE_WITH_ACTION 333
157036
-#define YYNTOKEN 182
157037
-#define YY_MAX_SHIFT 572
157205
+#define YYNSTATE 570
157206
+#define YYNRULE 398
157207
+#define YYNRULE_WITH_ACTION 337
157208
+#define YYNTOKEN 183
157209
+#define YY_MAX_SHIFT 569
157038157210
#define YY_MIN_SHIFTREDUCE 825
157039
-#define YY_MAX_SHIFTREDUCE 1218
157040
-#define YY_ERROR_ACTION 1219
157041
-#define YY_ACCEPT_ACTION 1220
157042
-#define YY_NO_ACTION 1221
157043
-#define YY_MIN_REDUCE 1222
157044
-#define YY_MAX_REDUCE 1615
157211
+#define YY_MAX_SHIFTREDUCE 1222
157212
+#define YY_ERROR_ACTION 1223
157213
+#define YY_ACCEPT_ACTION 1224
157214
+#define YY_NO_ACTION 1225
157215
+#define YY_MIN_REDUCE 1226
157216
+#define YY_MAX_REDUCE 1623
157045157217
/************* End control #defines *******************************************/
157046157218
#define YY_NLOOKAHEAD ((int)(sizeof(yy_lookahead)/sizeof(yy_lookahead[0])))
157047157219
157048157220
/* Define the yytestcase() macro to be a no-op if is not already defined
157049157221
** otherwise.
@@ -157106,605 +157278,604 @@
157106157278
** yy_reduce_ofst[] For each state, the offset into yy_action for
157107157279
** shifting non-terminals after a reduce.
157108157280
** yy_default[] Default action for each state.
157109157281
**
157110157282
*********** Begin parsing tables **********************************************/
157111
-#define YY_ACTTAB_COUNT (2017)
157283
+#define YY_ACTTAB_COUNT (2020)
157112157284
static const YYACTIONTYPE yy_action[] = {
157113
- /* 0 */ 566, 1253, 566, 197, 1576, 566, 1256, 566, 116, 113,
157114
- /* 10 */ 218, 566, 1263, 566, 488, 395, 116, 113, 218, 407,
157115
- /* 20 */ 359, 359, 42, 42, 42, 42, 471, 42, 42, 72,
157116
- /* 30 */ 72, 959, 1255, 72, 72, 72, 72, 1500, 1581, 960,
157117
- /* 40 */ 9, 889, 252, 123, 124, 114, 1196, 1196, 1035, 1038,
157118
- /* 50 */ 1028, 1028, 121, 121, 122, 122, 122, 122, 415, 407,
157119
- /* 60 */ 473, 1556, 572, 2, 1224, 1582, 548, 145, 147, 306,
157120
- /* 70 */ 548, 138, 548, 1296, 1296, 524, 566, 1193, 1304, 547,
157121
- /* 80 */ 523, 513, 167, 123, 124, 114, 1196, 1196, 1035, 1038,
157122
- /* 90 */ 1028, 1028, 121, 121, 122, 122, 122, 122, 72, 72,
157123
- /* 100 */ 282, 120, 120, 120, 120, 119, 119, 118, 118, 118,
157124
- /* 110 */ 117, 441, 274, 274, 274, 274, 446, 1172, 1537, 373,
157125
- /* 120 */ 1539, 1172, 372, 1537, 537, 563, 1144, 563, 1144, 407,
157126
- /* 130 */ 1078, 249, 215, 1193, 174, 529, 100, 305, 557, 229,
157127
- /* 140 */ 441, 120, 120, 120, 120, 119, 119, 118, 118, 118,
157128
- /* 150 */ 117, 441, 450, 123, 124, 114, 1196, 1196, 1035, 1038,
157129
- /* 160 */ 1028, 1028, 121, 121, 122, 122, 122, 122, 543, 450,
157130
- /* 170 */ 449, 445, 1172, 1173, 1174, 397, 1172, 1173, 1174, 125,
157131
- /* 180 */ 120, 120, 120, 120, 119, 119, 118, 118, 118, 117,
157132
- /* 190 */ 441, 119, 119, 118, 118, 118, 117, 441, 269, 407,
157133
- /* 200 */ 1553, 122, 122, 122, 122, 115, 381, 84, 377, 274,
157134
- /* 210 */ 274, 120, 120, 120, 120, 119, 119, 118, 118, 118,
157135
- /* 220 */ 117, 441, 563, 123, 124, 114, 1196, 1196, 1035, 1038,
157136
- /* 230 */ 1028, 1028, 121, 121, 122, 122, 122, 122, 407, 469,
157137
- /* 240 */ 1122, 1609, 450, 82, 1609, 462, 331, 81, 120, 120,
157138
- /* 250 */ 120, 120, 119, 119, 118, 118, 118, 117, 441, 116,
157139
- /* 260 */ 113, 218, 123, 124, 114, 1196, 1196, 1035, 1038, 1028,
157140
- /* 270 */ 1028, 121, 121, 122, 122, 122, 122, 566, 544, 1524,
157141
- /* 280 */ 880, 120, 120, 120, 120, 119, 119, 118, 118, 118,
157142
- /* 290 */ 117, 441, 118, 118, 118, 117, 441, 12, 197, 71,
157143
- /* 300 */ 71, 1139, 122, 122, 122, 122, 386, 407, 431, 1172,
157144
- /* 310 */ 400, 505, 533, 349, 1139, 166, 314, 1139, 1120, 881,
157145
- /* 320 */ 120, 120, 120, 120, 119, 119, 118, 118, 118, 117,
157146
- /* 330 */ 441, 123, 124, 114, 1196, 1196, 1035, 1038, 1028, 1028,
157147
- /* 340 */ 121, 121, 122, 122, 122, 122, 1172, 268, 268, 120,
157148
- /* 350 */ 120, 120, 120, 119, 119, 118, 118, 118, 117, 441,
157149
- /* 360 */ 563, 380, 1015, 1139, 1172, 1173, 1174, 241, 532, 565,
157150
- /* 370 */ 501, 498, 497, 429, 540, 478, 1139, 1532, 1006, 1139,
157151
- /* 380 */ 496, 6, 1005, 1396, 504, 1025, 1025, 1036, 1039, 120,
157152
- /* 390 */ 120, 120, 120, 119, 119, 118, 118, 118, 117, 441,
157153
- /* 400 */ 428, 1172, 1173, 1174, 1099, 1464, 260, 277, 357, 507,
157154
- /* 410 */ 352, 506, 246, 407, 1005, 1005, 1007, 345, 348, 1100,
157155
- /* 420 */ 241, 462, 331, 501, 498, 497, 371, 512, 1531, 359,
157156
- /* 430 */ 531, 360, 6, 496, 1101, 452, 203, 123, 124, 114,
157157
- /* 440 */ 1196, 1196, 1035, 1038, 1028, 1028, 121, 121, 122, 122,
157158
- /* 450 */ 122, 122, 522, 422, 1172, 900, 407, 571, 1029, 1224,
157159
- /* 460 */ 502, 321, 1274, 995, 306, 901, 138, 188, 1291, 426,
157160
- /* 470 */ 1270, 167, 488, 1304, 16, 16, 144, 860, 1291, 1273,
157161
- /* 480 */ 123, 124, 114, 1196, 1196, 1035, 1038, 1028, 1028, 121,
157162
- /* 490 */ 121, 122, 122, 122, 122, 120, 120, 120, 120, 119,
157163
- /* 500 */ 119, 118, 118, 118, 117, 441, 528, 274, 274, 1172,
157164
- /* 510 */ 1173, 1174, 1396, 566, 166, 329, 1499, 1015, 417, 374,
157165
- /* 520 */ 563, 488, 318, 1172, 320, 407, 305, 557, 375, 864,
157166
- /* 530 */ 182, 216, 860, 1006, 229, 72, 72, 1005, 120, 120,
157167
- /* 540 */ 120, 120, 119, 119, 118, 118, 118, 117, 441, 123,
157168
- /* 550 */ 124, 114, 1196, 1196, 1035, 1038, 1028, 1028, 121, 121,
157169
- /* 560 */ 122, 122, 122, 122, 407, 1463, 445, 1172, 857, 1005,
157170
- /* 570 */ 1005, 1007, 301, 1529, 116, 113, 218, 6, 1172, 1173,
157171
- /* 580 */ 1174, 183, 423, 116, 113, 218, 1172, 316, 123, 124,
157172
- /* 590 */ 114, 1196, 1196, 1035, 1038, 1028, 1028, 121, 121, 122,
157173
- /* 600 */ 122, 122, 122, 1469, 319, 946, 471, 120, 120, 120,
157174
- /* 610 */ 120, 119, 119, 118, 118, 118, 117, 441, 1172, 211,
157175
- /* 620 */ 1469, 1471, 1172, 1173, 1174, 920, 541, 1531, 477, 1172,
157176
- /* 630 */ 919, 6, 1172, 407, 925, 438, 437, 1157, 213, 511,
157177
- /* 640 */ 32, 1172, 1173, 1174, 280, 5, 120, 120, 120, 120,
157178
- /* 650 */ 119, 119, 118, 118, 118, 117, 441, 123, 124, 114,
157179
- /* 660 */ 1196, 1196, 1035, 1038, 1028, 1028, 121, 121, 122, 122,
157180
- /* 670 */ 122, 122, 407, 1172, 1173, 1174, 1016, 1172, 274, 274,
157181
- /* 680 */ 287, 1203, 1172, 1203, 1172, 1173, 1174, 1172, 1173, 1174,
157182
- /* 690 */ 566, 563, 167, 1469, 117, 441, 123, 124, 114, 1196,
157183
- /* 700 */ 1196, 1035, 1038, 1028, 1028, 121, 121, 122, 122, 122,
157184
- /* 710 */ 122, 945, 13, 13, 127, 120, 120, 120, 120, 119,
157185
- /* 720 */ 119, 118, 118, 118, 117, 441, 286, 420, 566, 451,
157186
- /* 730 */ 566, 1396, 1172, 1173, 1174, 1294, 1294, 1172, 1173, 1174,
157187
- /* 740 */ 97, 407, 995, 1611, 393, 1000, 488, 305, 557, 17,
157188
- /* 750 */ 72, 72, 72, 72, 120, 120, 120, 120, 119, 119,
157189
- /* 760 */ 118, 118, 118, 117, 441, 123, 124, 114, 1196, 1196,
157190
- /* 770 */ 1035, 1038, 1028, 1028, 121, 121, 122, 122, 122, 122,
157191
- /* 780 */ 407, 1220, 1, 1, 572, 2, 1224, 302, 418, 436,
157192
- /* 790 */ 1303, 306, 842, 138, 329, 457, 317, 404, 403, 566,
157193
- /* 800 */ 1304, 424, 3, 291, 123, 124, 114, 1196, 1196, 1035,
157194
- /* 810 */ 1038, 1028, 1028, 121, 121, 122, 122, 122, 122, 379,
157195
- /* 820 */ 566, 13, 13, 120, 120, 120, 120, 119, 119, 118,
157196
- /* 830 */ 118, 118, 117, 441, 274, 274, 425, 274, 274, 1172,
157197
- /* 840 */ 1308, 359, 13, 13, 1122, 1610, 12, 563, 1610, 407,
157198
- /* 850 */ 563, 460, 563, 1172, 560, 560, 560, 427, 439, 439,
157199
- /* 860 */ 439, 229, 120, 120, 120, 120, 119, 119, 118, 118,
157200
- /* 870 */ 118, 117, 441, 123, 124, 114, 1196, 1196, 1035, 1038,
157201
- /* 880 */ 1028, 1028, 121, 121, 122, 122, 122, 122, 146, 197,
157202
- /* 890 */ 417, 566, 1058, 445, 1172, 1173, 1174, 417, 471, 438,
157203
- /* 900 */ 437, 406, 564, 248, 914, 914, 566, 1200, 1172, 1173,
157204
- /* 910 */ 1174, 488, 1202, 72, 72, 493, 1510, 549, 102, 194,
157205
- /* 920 */ 1201, 566, 1120, 295, 461, 295, 1302, 252, 72, 72,
157206
- /* 930 */ 1456, 120, 120, 120, 120, 119, 119, 118, 118, 118,
157207
- /* 940 */ 117, 441, 245, 56, 56, 1203, 566, 1203, 566, 1242,
157208
- /* 950 */ 440, 274, 274, 566, 516, 1299, 566, 514, 566, 283,
157209
- /* 960 */ 274, 274, 1193, 519, 563, 548, 285, 343, 52, 52,
157210
- /* 970 */ 13, 13, 290, 563, 550, 13, 13, 566, 13, 13,
157211
- /* 980 */ 13, 13, 551, 274, 274, 294, 1411, 105, 274, 274,
157212
- /* 990 */ 191, 274, 274, 192, 1512, 545, 563, 274, 274, 57,
157213
- /* 1000 */ 57, 563, 275, 275, 563, 515, 447, 407, 271, 412,
157214
- /* 1010 */ 563, 944, 198, 305, 557, 563, 274, 274, 1193, 106,
157215
- /* 1020 */ 411, 104, 358, 1550, 1508, 348, 566, 407, 338, 563,
157216
- /* 1030 */ 341, 123, 124, 114, 1196, 1196, 1035, 1038, 1028, 1028,
157217
- /* 1040 */ 121, 121, 122, 122, 122, 122, 471, 407, 15, 15,
157218
- /* 1050 */ 477, 123, 124, 114, 1196, 1196, 1035, 1038, 1028, 1028,
157219
- /* 1060 */ 121, 121, 122, 122, 122, 122, 1083, 1083, 485, 360,
157220
- /* 1070 */ 477, 123, 112, 114, 1196, 1196, 1035, 1038, 1028, 1028,
157221
- /* 1080 */ 121, 121, 122, 122, 122, 122, 392, 1216, 309, 120,
157222
- /* 1090 */ 120, 120, 120, 119, 119, 118, 118, 118, 117, 441,
157223
- /* 1100 */ 99, 217, 482, 1176, 1410, 566, 479, 433, 543, 120,
157224
- /* 1110 */ 120, 120, 120, 119, 119, 118, 118, 118, 117, 441,
157225
- /* 1120 */ 292, 1080, 566, 1396, 566, 1080, 944, 44, 44, 120,
157226
- /* 1130 */ 120, 120, 120, 119, 119, 118, 118, 118, 117, 441,
157227
- /* 1140 */ 358, 1550, 539, 1099, 58, 58, 45, 45, 328, 407,
157228
- /* 1150 */ 1139, 830, 831, 832, 244, 243, 242, 483, 1100, 1176,
157229
- /* 1160 */ 1396, 538, 310, 1139, 1217, 488, 1139, 566, 293, 407,
157230
- /* 1170 */ 1150, 1245, 413, 1101, 124, 114, 1196, 1196, 1035, 1038,
157231
- /* 1180 */ 1028, 1028, 121, 121, 122, 122, 122, 122, 566, 59,
157232
- /* 1190 */ 59, 566, 509, 484, 554, 114, 1196, 1196, 1035, 1038,
157233
- /* 1200 */ 1028, 1028, 121, 121, 122, 122, 122, 122, 1530, 336,
157234
- /* 1210 */ 60, 60, 6, 61, 61, 392, 1121, 1528, 920, 1525,
157235
- /* 1220 */ 1150, 6, 566, 919, 566, 109, 558, 566, 4, 944,
157236
- /* 1230 */ 434, 120, 120, 120, 120, 119, 119, 118, 118, 118,
157237
- /* 1240 */ 117, 441, 561, 867, 62, 62, 63, 63, 566, 46,
157238
- /* 1250 */ 46, 120, 120, 120, 120, 119, 119, 118, 118, 118,
157239
- /* 1260 */ 117, 441, 566, 1139, 1527, 442, 1327, 566, 6, 566,
157240
- /* 1270 */ 47, 47, 566, 559, 413, 1272, 1139, 555, 142, 1139,
157241
- /* 1280 */ 566, 467, 305, 557, 48, 48, 566, 167, 546, 50,
157242
- /* 1290 */ 50, 51, 51, 1217, 64, 64, 959, 109, 558, 867,
157243
- /* 1300 */ 4, 566, 65, 65, 960, 1015, 566, 140, 66, 66,
157244
- /* 1310 */ 566, 107, 107, 566, 561, 852, 205, 566, 108, 217,
157245
- /* 1320 */ 442, 568, 567, 14, 14, 1005, 8, 525, 67, 67,
157246
- /* 1330 */ 566, 454, 129, 129, 222, 68, 68, 442, 455, 53,
157247
- /* 1340 */ 53, 405, 305, 557, 944, 414, 168, 211, 405, 555,
157248
- /* 1350 */ 111, 1192, 69, 69, 99, 464, 245, 1005, 1005, 1007,
157249
- /* 1360 */ 1008, 27, 468, 535, 566, 405, 566, 313, 534, 273,
157250
- /* 1370 */ 215, 852, 405, 566, 85, 202, 566, 1015, 566, 1211,
157251
- /* 1380 */ 566, 304, 566, 107, 107, 566, 70, 70, 54, 54,
157252
- /* 1390 */ 108, 405, 442, 568, 567, 153, 153, 1005, 154, 154,
157253
- /* 1400 */ 77, 77, 55, 55, 73, 73, 1117, 130, 130, 394,
157254
- /* 1410 */ 109, 558, 143, 4, 38, 566, 475, 300, 566, 463,
157255
- /* 1420 */ 279, 1340, 526, 412, 30, 226, 1077, 561, 1077, 1005,
157256
- /* 1430 */ 1005, 1007, 1008, 27, 1555, 1161, 444, 74, 74, 278,
157257
- /* 1440 */ 131, 131, 326, 1339, 390, 390, 389, 263, 387, 566,
157258
- /* 1450 */ 442, 839, 871, 308, 465, 31, 566, 879, 878, 356,
157259
- /* 1460 */ 327, 206, 555, 99, 223, 206, 312, 546, 1544, 355,
157260
- /* 1470 */ 997, 132, 132, 251, 311, 456, 535, 288, 128, 128,
157261
- /* 1480 */ 1065, 536, 109, 558, 470, 4, 566, 251, 1515, 472,
157262
- /* 1490 */ 1015, 566, 251, 276, 566, 332, 107, 107, 99, 561,
157263
- /* 1500 */ 1076, 566, 1076, 108, 225, 442, 568, 567, 152, 152,
157264
- /* 1510 */ 1005, 476, 158, 151, 151, 160, 136, 136, 494, 886,
157265
- /* 1520 */ 887, 247, 442, 135, 135, 346, 322, 566, 99, 1061,
157266
- /* 1530 */ 489, 224, 247, 566, 555, 1488, 1065, 1487, 953, 1009,
157267
- /* 1540 */ 228, 251, 1005, 1005, 1007, 1008, 27, 480, 535, 133,
157268
- /* 1550 */ 133, 566, 333, 534, 1336, 134, 134, 962, 963, 337,
157269
- /* 1560 */ 917, 340, 1015, 111, 850, 408, 342, 141, 107, 107,
157270
- /* 1570 */ 305, 557, 344, 76, 76, 108, 566, 442, 568, 567,
157271
- /* 1580 */ 1161, 444, 1005, 566, 278, 109, 558, 553, 4, 390,
157272
- /* 1590 */ 390, 389, 263, 387, 448, 1009, 839, 918, 78, 78,
157273
- /* 1600 */ 111, 566, 561, 1287, 566, 75, 75, 1271, 1334, 223,
157274
- /* 1610 */ 1569, 312, 351, 361, 1005, 1005, 1007, 1008, 27, 311,
157275
- /* 1620 */ 362, 1348, 1395, 43, 43, 442, 49, 49, 1323, 552,
157276
- /* 1630 */ 1401, 1252, 1244, 1233, 1232, 1234, 1563, 555, 200, 266,
157277
- /* 1640 */ 1320, 391, 11, 364, 221, 366, 368, 1382, 1377, 225,
157278
- /* 1650 */ 281, 453, 324, 330, 284, 1387, 474, 158, 208, 370,
157279
- /* 1660 */ 160, 1370, 325, 556, 195, 1015, 289, 499, 384, 354,
157280
- /* 1670 */ 1270, 107, 107, 924, 1386, 398, 224, 212, 108, 1460,
157281
- /* 1680 */ 442, 568, 567, 1459, 1566, 1005, 1211, 255, 1208, 1507,
157282
- /* 1690 */ 1505, 109, 558, 416, 4, 196, 207, 204, 170, 219,
157283
- /* 1700 */ 80, 84, 180, 1383, 1465, 83, 164, 172, 561, 458,
157284
- /* 1710 */ 408, 175, 176, 459, 177, 305, 557, 1005, 1005, 1007,
157285
- /* 1720 */ 1008, 27, 35, 178, 492, 231, 396, 97, 1389, 466,
157286
- /* 1730 */ 1388, 442, 481, 36, 1391, 184, 399, 90, 235, 448,
157287
- /* 1740 */ 1454, 1476, 267, 555, 487, 189, 237, 490, 339, 238,
157288
- /* 1750 */ 335, 1235, 239, 401, 508, 1281, 430, 1290, 1289, 101,
157289
- /* 1760 */ 558, 1288, 4, 92, 871, 213, 1580, 432, 1331, 527,
157290
- /* 1770 */ 96, 1015, 1260, 353, 402, 1579, 561, 107, 107, 1259,
157291
- /* 1780 */ 363, 1258, 1578, 1280, 108, 298, 442, 568, 567, 1549,
157292
- /* 1790 */ 518, 1005, 299, 521, 253, 1332, 365, 1535, 254, 442,
157293
- /* 1800 */ 1534, 435, 546, 10, 126, 378, 1440, 103, 530, 303,
157294
- /* 1810 */ 98, 555, 261, 1241, 34, 569, 199, 1313, 1330, 1329,
157295
- /* 1820 */ 367, 369, 376, 1005, 1005, 1007, 1008, 27, 1312, 382,
157296
- /* 1830 */ 1355, 1354, 383, 1167, 262, 264, 265, 570, 1230, 1015,
157297
- /* 1840 */ 155, 1225, 1492, 1493, 1491, 107, 107, 1490, 156, 139,
157298
- /* 1850 */ 296, 79, 108, 826, 442, 568, 567, 209, 157, 1005,
157299
- /* 1860 */ 443, 278, 201, 210, 307, 220, 390, 390, 389, 263,
157300
- /* 1870 */ 387, 137, 315, 839, 409, 1075, 1073, 410, 171, 169,
157301
- /* 1880 */ 159, 903, 173, 227, 1192, 230, 223, 323, 312, 1089,
157302
- /* 1890 */ 179, 1005, 1005, 1007, 1008, 27, 311, 161, 162, 419,
157303
- /* 1900 */ 421, 86, 181, 163, 87, 1092, 232, 88, 1088, 148,
157304
- /* 1910 */ 233, 18, 234, 89, 334, 1081, 251, 1205, 486, 236,
157305
- /* 1920 */ 186, 37, 841, 355, 491, 240, 225, 869, 187, 503,
157306
- /* 1930 */ 185, 495, 91, 19, 158, 347, 20, 160, 93, 350,
157307
- /* 1940 */ 500, 882, 297, 149, 94, 165, 510, 95, 1155, 150,
157308
- /* 1950 */ 1041, 1125, 39, 224, 40, 517, 1126, 214, 520, 270,
157309
- /* 1960 */ 272, 190, 947, 250, 111, 1143, 1141, 1145, 1149, 21,
157310
- /* 1970 */ 1129, 33, 542, 1148, 22, 23, 24, 25, 193, 952,
157311
- /* 1980 */ 99, 1056, 1042, 1040, 26, 1044, 1098, 408, 7, 1097,
157312
- /* 1990 */ 256, 257, 305, 557, 1045, 28, 41, 562, 1010, 851,
157313
- /* 2000 */ 110, 29, 913, 385, 388, 258, 259, 1163, 1162, 1571,
157314
- /* 2010 */ 1221, 1221, 1221, 1570, 1221, 1221, 448,
157285
+ /* 0 */ 563, 1295, 563, 1274, 168, 361, 115, 112, 218, 373,
157286
+ /* 10 */ 563, 1295, 374, 563, 488, 563, 115, 112, 218, 406,
157287
+ /* 20 */ 1300, 1300, 41, 41, 41, 41, 514, 1504, 520, 1298,
157288
+ /* 30 */ 1298, 959, 41, 41, 1257, 71, 71, 51, 51, 960,
157289
+ /* 40 */ 557, 557, 557, 122, 123, 113, 1200, 1200, 1035, 1038,
157290
+ /* 50 */ 1028, 1028, 120, 120, 121, 121, 121, 121, 414, 406,
157291
+ /* 60 */ 273, 273, 273, 273, 115, 112, 218, 115, 112, 218,
157292
+ /* 70 */ 197, 268, 545, 560, 515, 560, 1260, 563, 385, 248,
157293
+ /* 80 */ 215, 521, 399, 122, 123, 113, 1200, 1200, 1035, 1038,
157294
+ /* 90 */ 1028, 1028, 120, 120, 121, 121, 121, 121, 540, 13,
157295
+ /* 100 */ 13, 1259, 119, 119, 119, 119, 118, 118, 117, 117,
157296
+ /* 110 */ 117, 116, 441, 1176, 419, 1531, 446, 137, 512, 1539,
157297
+ /* 120 */ 1545, 372, 1547, 6, 371, 1176, 1148, 1584, 1148, 406,
157298
+ /* 130 */ 1545, 534, 115, 112, 218, 1267, 99, 441, 121, 121,
157299
+ /* 140 */ 121, 121, 119, 119, 119, 119, 118, 118, 117, 117,
157300
+ /* 150 */ 117, 116, 441, 122, 123, 113, 1200, 1200, 1035, 1038,
157301
+ /* 160 */ 1028, 1028, 120, 120, 121, 121, 121, 121, 197, 1176,
157302
+ /* 170 */ 1177, 1178, 241, 304, 554, 501, 498, 497, 473, 124,
157303
+ /* 180 */ 394, 1176, 1177, 1178, 1176, 496, 119, 119, 119, 119,
157304
+ /* 190 */ 118, 118, 117, 117, 117, 116, 441, 139, 540, 406,
157305
+ /* 200 */ 121, 121, 121, 121, 114, 117, 117, 117, 116, 441,
157306
+ /* 210 */ 541, 1532, 119, 119, 119, 119, 118, 118, 117, 117,
157307
+ /* 220 */ 117, 116, 441, 122, 123, 113, 1200, 1200, 1035, 1038,
157308
+ /* 230 */ 1028, 1028, 120, 120, 121, 121, 121, 121, 406, 320,
157309
+ /* 240 */ 1176, 1177, 1178, 81, 342, 1590, 396, 80, 119, 119,
157310
+ /* 250 */ 119, 119, 118, 118, 117, 117, 117, 116, 441, 1176,
157311
+ /* 260 */ 211, 450, 122, 123, 113, 1200, 1200, 1035, 1038, 1028,
157312
+ /* 270 */ 1028, 120, 120, 121, 121, 121, 121, 251, 450, 449,
157313
+ /* 280 */ 273, 273, 119, 119, 119, 119, 118, 118, 117, 117,
157314
+ /* 290 */ 117, 116, 441, 560, 1224, 1, 1, 569, 2, 1228,
157315
+ /* 300 */ 317, 1176, 319, 1561, 305, 337, 140, 340, 406, 430,
157316
+ /* 310 */ 469, 1533, 1197, 1308, 348, 1176, 1177, 1178, 168, 462,
157317
+ /* 320 */ 330, 119, 119, 119, 119, 118, 118, 117, 117, 117,
157318
+ /* 330 */ 116, 441, 122, 123, 113, 1200, 1200, 1035, 1038, 1028,
157319
+ /* 340 */ 1028, 120, 120, 121, 121, 121, 121, 273, 273, 563,
157320
+ /* 350 */ 83, 450, 416, 1564, 569, 2, 1228, 1176, 1177, 1178,
157321
+ /* 360 */ 560, 305, 471, 140, 944, 995, 860, 563, 467, 1197,
157322
+ /* 370 */ 1308, 13, 13, 137, 229, 118, 118, 117, 117, 117,
157323
+ /* 380 */ 116, 441, 96, 318, 946, 504, 424, 361, 562, 71,
157324
+ /* 390 */ 71, 119, 119, 119, 119, 118, 118, 117, 117, 117,
157325
+ /* 400 */ 116, 441, 427, 205, 273, 273, 445, 1015, 259, 276,
157326
+ /* 410 */ 356, 507, 351, 506, 246, 406, 959, 560, 328, 344,
157327
+ /* 420 */ 347, 315, 860, 1006, 960, 126, 545, 1005, 313, 304,
157328
+ /* 430 */ 554, 229, 538, 1539, 148, 544, 281, 6, 203, 122,
157329
+ /* 440 */ 123, 113, 1200, 1200, 1035, 1038, 1028, 1028, 120, 120,
157330
+ /* 450 */ 121, 121, 121, 121, 563, 217, 563, 12, 406, 1005,
157331
+ /* 460 */ 1005, 1007, 502, 445, 119, 119, 119, 119, 118, 118,
157332
+ /* 470 */ 117, 117, 117, 116, 441, 452, 71, 71, 70, 70,
157333
+ /* 480 */ 944, 137, 122, 123, 113, 1200, 1200, 1035, 1038, 1028,
157334
+ /* 490 */ 1028, 120, 120, 121, 121, 121, 121, 1530, 119, 119,
157335
+ /* 500 */ 119, 119, 118, 118, 117, 117, 117, 116, 441, 403,
157336
+ /* 510 */ 402, 241, 1176, 545, 501, 498, 497, 1468, 1143, 451,
157337
+ /* 520 */ 267, 267, 513, 1540, 496, 142, 1176, 6, 406, 530,
157338
+ /* 530 */ 194, 1143, 864, 560, 1143, 461, 182, 304, 554, 32,
157339
+ /* 540 */ 379, 119, 119, 119, 119, 118, 118, 117, 117, 117,
157340
+ /* 550 */ 116, 441, 122, 123, 113, 1200, 1200, 1035, 1038, 1028,
157341
+ /* 560 */ 1028, 120, 120, 121, 121, 121, 121, 406, 1176, 1177,
157342
+ /* 570 */ 1178, 857, 568, 1176, 1228, 925, 1176, 454, 361, 305,
157343
+ /* 580 */ 189, 140, 1176, 1177, 1178, 519, 529, 404, 1308, 183,
157344
+ /* 590 */ 1015, 122, 123, 113, 1200, 1200, 1035, 1038, 1028, 1028,
157345
+ /* 600 */ 120, 120, 121, 121, 121, 121, 1006, 16, 16, 370,
157346
+ /* 610 */ 1005, 119, 119, 119, 119, 118, 118, 117, 117, 117,
157347
+ /* 620 */ 116, 441, 273, 273, 1537, 150, 1176, 98, 6, 1176,
157348
+ /* 630 */ 1177, 1178, 1176, 1177, 1178, 560, 380, 406, 376, 438,
157349
+ /* 640 */ 437, 1161, 1005, 1005, 1007, 1025, 1025, 1036, 1039, 229,
157350
+ /* 650 */ 119, 119, 119, 119, 118, 118, 117, 117, 117, 116,
157351
+ /* 660 */ 441, 122, 123, 113, 1200, 1200, 1035, 1038, 1028, 1028,
157352
+ /* 670 */ 120, 120, 121, 121, 121, 121, 406, 1143, 1619, 392,
157353
+ /* 680 */ 1016, 445, 1176, 1177, 1178, 1207, 525, 1207, 1530, 995,
157354
+ /* 690 */ 1143, 304, 554, 1143, 5, 563, 543, 3, 361, 216,
157355
+ /* 700 */ 122, 123, 113, 1200, 1200, 1035, 1038, 1028, 1028, 120,
157356
+ /* 710 */ 120, 121, 121, 121, 121, 143, 563, 13, 13, 1029,
157357
+ /* 720 */ 119, 119, 119, 119, 118, 118, 117, 117, 117, 116,
157358
+ /* 730 */ 441, 1176, 426, 563, 1176, 563, 274, 274, 13, 13,
157359
+ /* 740 */ 1078, 1176, 328, 457, 316, 147, 406, 211, 361, 560,
157360
+ /* 750 */ 1000, 213, 511, 293, 477, 55, 55, 71, 71, 119,
157361
+ /* 760 */ 119, 119, 119, 118, 118, 117, 117, 117, 116, 441,
157362
+ /* 770 */ 122, 123, 113, 1200, 1200, 1035, 1038, 1028, 1028, 120,
157363
+ /* 780 */ 120, 121, 121, 121, 121, 406, 455, 1176, 1177, 1178,
157364
+ /* 790 */ 1176, 1177, 1178, 471, 526, 149, 404, 1176, 1177, 1178,
157365
+ /* 800 */ 105, 270, 103, 563, 944, 563, 116, 441, 1530, 122,
157366
+ /* 810 */ 123, 113, 1200, 1200, 1035, 1038, 1028, 1028, 120, 120,
157367
+ /* 820 */ 121, 121, 121, 121, 945, 13, 13, 13, 13, 119,
157368
+ /* 830 */ 119, 119, 119, 118, 118, 117, 117, 117, 116, 441,
157369
+ /* 840 */ 191, 563, 192, 563, 416, 439, 439, 439, 1083, 1083,
157370
+ /* 850 */ 485, 561, 285, 914, 914, 406, 462, 330, 1530, 830,
157371
+ /* 860 */ 831, 832, 206, 71, 71, 71, 71, 286, 119, 119,
157372
+ /* 870 */ 119, 119, 118, 118, 117, 117, 117, 116, 441, 122,
157373
+ /* 880 */ 123, 113, 1200, 1200, 1035, 1038, 1028, 1028, 120, 120,
157374
+ /* 890 */ 121, 121, 121, 121, 563, 217, 563, 1122, 1617, 406,
157375
+ /* 900 */ 300, 1617, 301, 416, 1278, 1473, 244, 243, 242, 1249,
157376
+ /* 910 */ 412, 556, 412, 282, 842, 279, 71, 71, 71, 71,
157377
+ /* 920 */ 944, 1415, 1473, 1475, 101, 113, 1200, 1200, 1035, 1038,
157378
+ /* 930 */ 1028, 1028, 120, 120, 121, 121, 121, 121, 119, 119,
157379
+ /* 940 */ 119, 119, 118, 118, 117, 117, 117, 116, 441, 273,
157380
+ /* 950 */ 273, 1099, 563, 436, 1143, 440, 563, 1122, 1618, 357,
157381
+ /* 960 */ 1558, 1618, 560, 546, 488, 197, 1100, 1143, 378, 290,
157382
+ /* 970 */ 1143, 1306, 284, 460, 71, 71, 1120, 405, 13, 13,
157383
+ /* 980 */ 145, 1101, 119, 119, 119, 119, 118, 118, 117, 117,
157384
+ /* 990 */ 117, 116, 441, 542, 104, 1473, 509, 273, 273, 294,
157385
+ /* 1000 */ 1514, 294, 900, 273, 273, 273, 273, 563, 1503, 563,
157386
+ /* 1010 */ 560, 545, 901, 464, 406, 1058, 560, 852, 560, 198,
157387
+ /* 1020 */ 547, 1080, 920, 404, 1400, 1080, 146, 919, 38, 56,
157388
+ /* 1030 */ 56, 15, 15, 563, 406, 12, 1120, 471, 122, 123,
157389
+ /* 1040 */ 113, 1200, 1200, 1035, 1038, 1028, 1028, 120, 120, 121,
157390
+ /* 1050 */ 121, 121, 121, 1460, 406, 43, 43, 483, 122, 123,
157391
+ /* 1060 */ 113, 1200, 1200, 1035, 1038, 1028, 1028, 120, 120, 121,
157392
+ /* 1070 */ 121, 121, 121, 563, 852, 9, 471, 251, 122, 111,
157393
+ /* 1080 */ 113, 1200, 1200, 1035, 1038, 1028, 1028, 120, 120, 121,
157394
+ /* 1090 */ 121, 121, 121, 563, 421, 57, 57, 119, 119, 119,
157395
+ /* 1100 */ 119, 118, 118, 117, 117, 117, 116, 441, 1176, 493,
157396
+ /* 1110 */ 563, 289, 1197, 478, 1516, 44, 44, 119, 119, 119,
157397
+ /* 1120 */ 119, 118, 118, 117, 117, 117, 116, 441, 880, 563,
157398
+ /* 1130 */ 536, 563, 58, 58, 488, 1414, 245, 119, 119, 119,
157399
+ /* 1140 */ 119, 118, 118, 117, 117, 117, 116, 441, 563, 535,
157400
+ /* 1150 */ 291, 59, 59, 60, 60, 438, 437, 406, 1154, 505,
157401
+ /* 1160 */ 304, 554, 477, 1204, 1176, 1177, 1178, 881, 1206, 1197,
157402
+ /* 1170 */ 61, 61, 1246, 357, 1558, 1538, 1205, 563, 1467, 6,
157403
+ /* 1180 */ 1176, 488, 123, 113, 1200, 1200, 1035, 1038, 1028, 1028,
157404
+ /* 1190 */ 120, 120, 121, 121, 121, 121, 1400, 1143, 410, 62,
157405
+ /* 1200 */ 62, 1207, 1099, 1207, 411, 447, 273, 273, 537, 1154,
157406
+ /* 1210 */ 1143, 108, 555, 1143, 4, 391, 1220, 1100, 1512, 560,
157407
+ /* 1220 */ 347, 516, 428, 548, 308, 1307, 1536, 1077, 558, 1077,
157408
+ /* 1230 */ 6, 488, 1101, 1400, 488, 309, 1176, 1177, 1178, 563,
157409
+ /* 1240 */ 119, 119, 119, 119, 118, 118, 117, 117, 117, 116,
157410
+ /* 1250 */ 441, 442, 278, 551, 563, 273, 273, 273, 273, 563,
157411
+ /* 1260 */ 327, 45, 45, 552, 563, 528, 422, 563, 560, 1400,
157412
+ /* 1270 */ 560, 108, 555, 137, 4, 1303, 46, 46, 335, 563,
157413
+ /* 1280 */ 482, 47, 47, 477, 479, 307, 49, 49, 558, 50,
157414
+ /* 1290 */ 50, 563, 1015, 563, 1221, 563, 1400, 563, 106, 106,
157415
+ /* 1300 */ 8, 63, 63, 423, 563, 107, 312, 442, 565, 564,
157416
+ /* 1310 */ 563, 442, 1005, 64, 64, 65, 65, 14, 14, 66,
157417
+ /* 1320 */ 66, 391, 1121, 552, 1312, 1180, 128, 128, 563, 304,
157418
+ /* 1330 */ 554, 563, 67, 67, 563, 359, 560, 532, 563, 484,
157419
+ /* 1340 */ 563, 1196, 531, 222, 1005, 1005, 1007, 1008, 27, 522,
157420
+ /* 1350 */ 52, 52, 1015, 68, 68, 563, 69, 69, 106, 106,
157421
+ /* 1360 */ 53, 53, 156, 156, 563, 107, 434, 442, 565, 564,
157422
+ /* 1370 */ 272, 215, 1005, 425, 563, 359, 563, 157, 157, 563,
157423
+ /* 1380 */ 1535, 292, 1180, 98, 6, 1344, 76, 76, 1215, 475,
157424
+ /* 1390 */ 413, 169, 226, 563, 245, 563, 54, 54, 72, 72,
157425
+ /* 1400 */ 1221, 129, 129, 1343, 1005, 1005, 1007, 1008, 27, 1563,
157426
+ /* 1410 */ 1165, 444, 456, 433, 277, 73, 73, 130, 130, 389,
157427
+ /* 1420 */ 389, 388, 262, 386, 1165, 444, 839, 1519, 277, 108,
157428
+ /* 1430 */ 555, 321, 4, 389, 389, 388, 262, 386, 563, 223,
157429
+ /* 1440 */ 839, 311, 468, 84, 202, 523, 558, 1492, 303, 310,
157430
+ /* 1450 */ 563, 110, 404, 223, 563, 311, 206, 30, 404, 277,
157431
+ /* 1460 */ 131, 131, 411, 310, 389, 389, 388, 262, 386, 442,
157432
+ /* 1470 */ 920, 839, 127, 127, 563, 919, 155, 155, 1491, 225,
157433
+ /* 1480 */ 563, 552, 871, 563, 223, 476, 311, 161, 31, 563,
157434
+ /* 1490 */ 135, 563, 480, 225, 310, 532, 154, 154, 332, 17,
157435
+ /* 1500 */ 533, 161, 136, 136, 135, 134, 134, 224, 228, 355,
157436
+ /* 1510 */ 1015, 132, 132, 133, 133, 1589, 106, 106, 889, 354,
157437
+ /* 1520 */ 563, 224, 563, 107, 225, 442, 565, 564, 1117, 275,
157438
+ /* 1530 */ 1005, 393, 161, 518, 563, 135, 108, 555, 417, 4,
157439
+ /* 1540 */ 1340, 407, 75, 75, 77, 77, 304, 554, 867, 563,
157440
+ /* 1550 */ 336, 563, 224, 558, 463, 407, 74, 74, 465, 1065,
157441
+ /* 1560 */ 304, 554, 1005, 1005, 1007, 1008, 27, 962, 963, 543,
157442
+ /* 1570 */ 448, 42, 42, 48, 48, 326, 442, 325, 98, 997,
157443
+ /* 1580 */ 470, 287, 250, 250, 448, 1009, 407, 472, 552, 339,
157444
+ /* 1590 */ 250, 304, 554, 879, 878, 331, 108, 555, 98, 4,
157445
+ /* 1600 */ 1277, 494, 532, 345, 247, 867, 98, 531, 341, 886,
157446
+ /* 1610 */ 887, 1126, 1076, 558, 1076, 448, 1065, 1015, 1061, 953,
157447
+ /* 1620 */ 343, 247, 250, 106, 106, 1291, 917, 1276, 850, 110,
157448
+ /* 1630 */ 107, 144, 442, 565, 564, 918, 442, 1005, 110, 1275,
157449
+ /* 1640 */ 350, 360, 1009, 1331, 1352, 299, 1399, 1577, 552, 1327,
157450
+ /* 1650 */ 1552, 550, 1338, 549, 1405, 1256, 1248, 1237, 1236, 1238,
157451
+ /* 1660 */ 1571, 489, 265, 200, 1324, 363, 365, 367, 11, 1005,
157452
+ /* 1670 */ 1005, 1007, 1008, 27, 390, 221, 1386, 1015, 280, 1391,
157453
+ /* 1680 */ 1381, 208, 323, 106, 106, 924, 1374, 453, 283, 324,
157454
+ /* 1690 */ 107, 474, 442, 565, 564, 1390, 499, 1005, 212, 288,
157455
+ /* 1700 */ 1274, 397, 353, 108, 555, 195, 4, 1464, 369, 1463,
157456
+ /* 1710 */ 1574, 1215, 1212, 329, 553, 171, 207, 383, 1511, 196,
157457
+ /* 1720 */ 558, 254, 1509, 415, 100, 555, 83, 4, 204, 1005,
157458
+ /* 1730 */ 1005, 1007, 1008, 27, 219, 79, 82, 1469, 180, 166,
157459
+ /* 1740 */ 173, 558, 458, 442, 175, 176, 177, 178, 35, 1387,
157460
+ /* 1750 */ 492, 459, 231, 1395, 96, 552, 1393, 1392, 395, 184,
157461
+ /* 1760 */ 481, 466, 36, 235, 442, 89, 398, 266, 487, 1480,
157462
+ /* 1770 */ 1458, 237, 188, 338, 508, 429, 552, 490, 400, 238,
157463
+ /* 1780 */ 334, 1239, 239, 1294, 1015, 1293, 1292, 1285, 91, 871,
157464
+ /* 1790 */ 106, 106, 213, 431, 1588, 432, 524, 107, 517, 442,
157465
+ /* 1800 */ 565, 564, 401, 1264, 1005, 1015, 1263, 1587, 352, 1262,
157466
+ /* 1810 */ 1557, 106, 106, 1586, 1284, 297, 298, 358, 107, 1335,
157467
+ /* 1820 */ 442, 565, 564, 95, 362, 1005, 253, 252, 435, 125,
157468
+ /* 1830 */ 543, 10, 1444, 1543, 377, 1542, 1005, 1005, 1007, 1008,
157469
+ /* 1840 */ 27, 302, 102, 97, 527, 1336, 260, 1317, 364, 1245,
157470
+ /* 1850 */ 1334, 34, 566, 1171, 366, 381, 375, 1005, 1005, 1007,
157471
+ /* 1860 */ 1008, 27, 1333, 1359, 368, 1316, 199, 382, 261, 263,
157472
+ /* 1870 */ 264, 1358, 158, 1496, 141, 1497, 1495, 567, 1234, 1229,
157473
+ /* 1880 */ 1494, 295, 159, 209, 210, 78, 826, 443, 201, 306,
157474
+ /* 1890 */ 220, 1075, 138, 1073, 160, 314, 162, 172, 1196, 174,
157475
+ /* 1900 */ 903, 227, 230, 322, 1089, 179, 163, 164, 418, 85,
157476
+ /* 1910 */ 420, 181, 170, 408, 409, 86, 87, 165, 88, 1092,
157477
+ /* 1920 */ 232, 233, 1088, 151, 18, 234, 1081, 250, 333, 185,
157478
+ /* 1930 */ 1209, 486, 236, 186, 37, 841, 491, 354, 240, 346,
157479
+ /* 1940 */ 503, 187, 90, 167, 19, 495, 20, 869, 500, 349,
157480
+ /* 1950 */ 92, 882, 296, 152, 93, 510, 1127, 1159, 153, 1041,
157481
+ /* 1960 */ 214, 1128, 39, 94, 269, 271, 952, 190, 947, 110,
157482
+ /* 1970 */ 1149, 1145, 1153, 249, 1133, 1147, 7, 33, 21, 193,
157483
+ /* 1980 */ 22, 23, 24, 25, 1152, 539, 98, 1056, 26, 1042,
157484
+ /* 1990 */ 1040, 1044, 1098, 1045, 1097, 256, 255, 28, 40, 387,
157485
+ /* 2000 */ 1010, 851, 109, 29, 1167, 559, 384, 257, 913, 258,
157486
+ /* 2010 */ 1166, 1579, 1225, 1225, 1225, 1225, 1225, 1225, 1225, 1578,
157315157487
};
157316157488
static const YYCODETYPE yy_lookahead[] = {
157317
- /* 0 */ 190, 212, 190, 190, 211, 190, 212, 190, 270, 271,
157318
- /* 10 */ 272, 190, 219, 190, 190, 202, 270, 271, 272, 19,
157319
- /* 20 */ 190, 190, 212, 213, 212, 213, 190, 212, 213, 212,
157320
- /* 30 */ 213, 31, 212, 212, 213, 212, 213, 291, 23, 39,
157321
- /* 40 */ 22, 26, 24, 43, 44, 45, 46, 47, 48, 49,
157322
- /* 50 */ 50, 51, 52, 53, 54, 55, 56, 57, 234, 19,
157323
- /* 60 */ 190, 184, 185, 186, 187, 226, 249, 237, 237, 192,
157324
- /* 70 */ 249, 194, 249, 231, 232, 258, 190, 59, 201, 258,
157325
- /* 80 */ 201, 258, 81, 43, 44, 45, 46, 47, 48, 49,
157326
- /* 90 */ 50, 51, 52, 53, 54, 55, 56, 57, 212, 213,
157327
- /* 100 */ 264, 101, 102, 103, 104, 105, 106, 107, 108, 109,
157328
- /* 110 */ 110, 111, 235, 236, 235, 236, 292, 59, 308, 309,
157329
- /* 120 */ 308, 59, 310, 308, 309, 248, 86, 248, 88, 19,
157330
- /* 130 */ 11, 252, 253, 115, 72, 249, 26, 136, 137, 262,
157331
- /* 140 */ 111, 101, 102, 103, 104, 105, 106, 107, 108, 109,
157332
- /* 150 */ 110, 111, 190, 43, 44, 45, 46, 47, 48, 49,
157333
- /* 160 */ 50, 51, 52, 53, 54, 55, 56, 57, 190, 207,
157334
- /* 170 */ 208, 294, 114, 115, 116, 201, 114, 115, 116, 69,
157335
- /* 180 */ 101, 102, 103, 104, 105, 106, 107, 108, 109, 110,
157336
- /* 190 */ 111, 105, 106, 107, 108, 109, 110, 111, 209, 19,
157337
- /* 200 */ 190, 54, 55, 56, 57, 58, 245, 149, 247, 235,
157338
- /* 210 */ 236, 101, 102, 103, 104, 105, 106, 107, 108, 109,
157339
- /* 220 */ 110, 111, 248, 43, 44, 45, 46, 47, 48, 49,
157340
- /* 230 */ 50, 51, 52, 53, 54, 55, 56, 57, 19, 265,
157341
- /* 240 */ 22, 23, 280, 24, 26, 126, 127, 67, 101, 102,
157342
- /* 250 */ 103, 104, 105, 106, 107, 108, 109, 110, 111, 270,
157343
- /* 260 */ 271, 272, 43, 44, 45, 46, 47, 48, 49, 50,
157344
- /* 270 */ 51, 52, 53, 54, 55, 56, 57, 190, 300, 301,
157345
- /* 280 */ 35, 101, 102, 103, 104, 105, 106, 107, 108, 109,
157346
- /* 290 */ 110, 111, 107, 108, 109, 110, 111, 209, 190, 212,
157347
- /* 300 */ 213, 76, 54, 55, 56, 57, 198, 19, 19, 59,
157348
- /* 310 */ 202, 66, 87, 24, 89, 190, 190, 92, 100, 74,
157349
- /* 320 */ 101, 102, 103, 104, 105, 106, 107, 108, 109, 110,
157350
- /* 330 */ 111, 43, 44, 45, 46, 47, 48, 49, 50, 51,
157351
- /* 340 */ 52, 53, 54, 55, 56, 57, 59, 235, 236, 101,
157352
- /* 350 */ 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
157353
- /* 360 */ 248, 274, 99, 76, 114, 115, 116, 117, 143, 190,
157354
- /* 370 */ 120, 121, 122, 128, 87, 287, 89, 303, 115, 92,
157355
- /* 380 */ 130, 307, 119, 190, 95, 46, 47, 48, 49, 101,
157356
- /* 390 */ 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
157357
- /* 400 */ 111, 114, 115, 116, 12, 279, 117, 118, 119, 120,
157358
- /* 410 */ 121, 122, 123, 19, 151, 152, 153, 23, 129, 27,
157359
- /* 420 */ 117, 126, 127, 120, 121, 122, 190, 302, 303, 190,
157360
- /* 430 */ 143, 190, 307, 130, 42, 265, 148, 43, 44, 45,
157361
- /* 440 */ 46, 47, 48, 49, 50, 51, 52, 53, 54, 55,
157362
- /* 450 */ 56, 57, 190, 260, 59, 63, 19, 185, 119, 187,
157363
- /* 460 */ 23, 16, 222, 73, 192, 73, 194, 72, 219, 228,
157364
- /* 470 */ 221, 81, 190, 201, 212, 213, 237, 59, 229, 222,
157365
- /* 480 */ 43, 44, 45, 46, 47, 48, 49, 50, 51, 52,
157366
- /* 490 */ 53, 54, 55, 56, 57, 101, 102, 103, 104, 105,
157367
- /* 500 */ 106, 107, 108, 109, 110, 111, 190, 235, 236, 114,
157368
- /* 510 */ 115, 116, 190, 190, 190, 125, 234, 99, 190, 215,
157369
- /* 520 */ 248, 190, 77, 59, 79, 19, 136, 137, 215, 23,
157370
- /* 530 */ 22, 190, 114, 115, 262, 212, 213, 119, 101, 102,
157371
- /* 540 */ 103, 104, 105, 106, 107, 108, 109, 110, 111, 43,
157372
- /* 550 */ 44, 45, 46, 47, 48, 49, 50, 51, 52, 53,
157373
- /* 560 */ 54, 55, 56, 57, 19, 234, 294, 59, 23, 151,
157374
- /* 570 */ 152, 153, 249, 303, 270, 271, 272, 307, 114, 115,
157375
- /* 580 */ 116, 22, 260, 270, 271, 272, 59, 259, 43, 44,
157376
- /* 590 */ 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
157377
- /* 600 */ 55, 56, 57, 190, 159, 141, 190, 101, 102, 103,
157378
- /* 610 */ 104, 105, 106, 107, 108, 109, 110, 111, 59, 26,
157379
- /* 620 */ 207, 208, 114, 115, 116, 133, 302, 303, 190, 59,
157380
- /* 630 */ 138, 307, 59, 19, 107, 105, 106, 23, 163, 164,
157381
- /* 640 */ 22, 114, 115, 116, 201, 22, 101, 102, 103, 104,
157382
- /* 650 */ 105, 106, 107, 108, 109, 110, 111, 43, 44, 45,
157383
- /* 660 */ 46, 47, 48, 49, 50, 51, 52, 53, 54, 55,
157384
- /* 670 */ 56, 57, 19, 114, 115, 116, 23, 59, 235, 236,
157385
- /* 680 */ 264, 151, 59, 153, 114, 115, 116, 114, 115, 116,
157386
- /* 690 */ 190, 248, 81, 280, 110, 111, 43, 44, 45, 46,
157387
- /* 700 */ 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
157388
- /* 710 */ 57, 141, 212, 213, 22, 101, 102, 103, 104, 105,
157389
- /* 720 */ 106, 107, 108, 109, 110, 111, 288, 227, 190, 118,
157390
- /* 730 */ 190, 190, 114, 115, 116, 231, 232, 114, 115, 116,
157391
- /* 740 */ 147, 19, 73, 297, 298, 23, 190, 136, 137, 22,
157392
- /* 750 */ 212, 213, 212, 213, 101, 102, 103, 104, 105, 106,
157393
- /* 760 */ 107, 108, 109, 110, 111, 43, 44, 45, 46, 47,
157394
- /* 770 */ 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
157395
- /* 780 */ 19, 182, 183, 184, 185, 186, 187, 249, 61, 249,
157396
- /* 790 */ 234, 192, 21, 194, 125, 126, 127, 105, 106, 190,
157397
- /* 800 */ 201, 260, 22, 201, 43, 44, 45, 46, 47, 48,
157398
- /* 810 */ 49, 50, 51, 52, 53, 54, 55, 56, 57, 190,
157399
- /* 820 */ 190, 212, 213, 101, 102, 103, 104, 105, 106, 107,
157400
- /* 830 */ 108, 109, 110, 111, 235, 236, 227, 235, 236, 59,
157401
- /* 840 */ 236, 190, 212, 213, 22, 23, 209, 248, 26, 19,
157402
- /* 850 */ 248, 80, 248, 59, 206, 207, 208, 227, 206, 207,
157403
- /* 860 */ 208, 262, 101, 102, 103, 104, 105, 106, 107, 108,
157404
- /* 870 */ 109, 110, 111, 43, 44, 45, 46, 47, 48, 49,
157405
- /* 880 */ 50, 51, 52, 53, 54, 55, 56, 57, 237, 190,
157406
- /* 890 */ 190, 190, 121, 294, 114, 115, 116, 190, 190, 105,
157407
- /* 900 */ 106, 202, 132, 26, 134, 135, 190, 113, 114, 115,
157408
- /* 910 */ 116, 190, 118, 212, 213, 19, 190, 201, 157, 282,
157409
- /* 920 */ 126, 190, 100, 224, 287, 226, 201, 24, 212, 213,
157410
- /* 930 */ 159, 101, 102, 103, 104, 105, 106, 107, 108, 109,
157411
- /* 940 */ 110, 111, 46, 212, 213, 151, 190, 153, 190, 201,
157412
- /* 950 */ 249, 235, 236, 190, 201, 234, 190, 201, 190, 259,
157413
- /* 960 */ 235, 236, 59, 201, 248, 249, 259, 16, 212, 213,
157414
- /* 970 */ 212, 213, 264, 248, 258, 212, 213, 190, 212, 213,
157415
- /* 980 */ 212, 213, 201, 235, 236, 227, 269, 157, 235, 236,
157416
- /* 990 */ 227, 235, 236, 227, 190, 227, 248, 235, 236, 212,
157417
- /* 1000 */ 213, 248, 235, 236, 248, 249, 190, 19, 23, 113,
157418
- /* 1010 */ 248, 26, 24, 136, 137, 248, 235, 236, 115, 156,
157419
- /* 1020 */ 195, 158, 305, 306, 190, 129, 190, 19, 77, 248,
157420
- /* 1030 */ 79, 43, 44, 45, 46, 47, 48, 49, 50, 51,
157421
- /* 1040 */ 52, 53, 54, 55, 56, 57, 190, 19, 212, 213,
157422
- /* 1050 */ 190, 43, 44, 45, 46, 47, 48, 49, 50, 51,
157423
- /* 1060 */ 52, 53, 54, 55, 56, 57, 125, 126, 127, 190,
157424
- /* 1070 */ 190, 43, 44, 45, 46, 47, 48, 49, 50, 51,
157425
- /* 1080 */ 52, 53, 54, 55, 56, 57, 22, 23, 190, 101,
157426
- /* 1090 */ 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
157427
- /* 1100 */ 26, 116, 277, 59, 269, 190, 281, 228, 190, 101,
157428
- /* 1110 */ 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
157429
- /* 1120 */ 264, 29, 190, 190, 190, 33, 141, 212, 213, 101,
157430
- /* 1130 */ 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
157431
- /* 1140 */ 305, 306, 66, 12, 212, 213, 212, 213, 288, 19,
157432
- /* 1150 */ 76, 7, 8, 9, 125, 126, 127, 65, 27, 115,
157433
- /* 1160 */ 190, 85, 190, 89, 100, 190, 92, 190, 288, 19,
157434
- /* 1170 */ 94, 204, 205, 42, 44, 45, 46, 47, 48, 49,
157435
- /* 1180 */ 50, 51, 52, 53, 54, 55, 56, 57, 190, 212,
157436
- /* 1190 */ 213, 190, 107, 260, 63, 45, 46, 47, 48, 49,
157437
- /* 1200 */ 50, 51, 52, 53, 54, 55, 56, 57, 303, 234,
157438
- /* 1210 */ 212, 213, 307, 212, 213, 22, 23, 303, 133, 301,
157439
- /* 1220 */ 144, 307, 190, 138, 190, 19, 20, 190, 22, 26,
157440
- /* 1230 */ 260, 101, 102, 103, 104, 105, 106, 107, 108, 109,
157441
- /* 1240 */ 110, 111, 36, 59, 212, 213, 212, 213, 190, 212,
157442
- /* 1250 */ 213, 101, 102, 103, 104, 105, 106, 107, 108, 109,
157443
- /* 1260 */ 110, 111, 190, 76, 303, 59, 254, 190, 307, 190,
157444
- /* 1270 */ 212, 213, 190, 204, 205, 222, 89, 71, 22, 92,
157445
- /* 1280 */ 190, 113, 136, 137, 212, 213, 190, 81, 143, 212,
157446
- /* 1290 */ 213, 212, 213, 100, 212, 213, 31, 19, 20, 115,
157447
- /* 1300 */ 22, 190, 212, 213, 39, 99, 190, 162, 212, 213,
157448
- /* 1310 */ 190, 105, 106, 190, 36, 59, 148, 190, 112, 116,
157449
- /* 1320 */ 114, 115, 116, 212, 213, 119, 48, 19, 212, 213,
157450
- /* 1330 */ 190, 240, 212, 213, 15, 212, 213, 59, 240, 212,
157451
- /* 1340 */ 213, 250, 136, 137, 141, 295, 296, 26, 250, 71,
157452
- /* 1350 */ 26, 26, 212, 213, 26, 240, 46, 151, 152, 153,
157453
- /* 1360 */ 154, 155, 240, 85, 190, 250, 190, 190, 90, 252,
157454
- /* 1370 */ 253, 115, 250, 190, 147, 148, 190, 99, 190, 60,
157455
- /* 1380 */ 190, 240, 190, 105, 106, 190, 212, 213, 212, 213,
157456
- /* 1390 */ 112, 250, 114, 115, 116, 212, 213, 119, 212, 213,
157457
- /* 1400 */ 212, 213, 212, 213, 212, 213, 23, 212, 213, 26,
157458
- /* 1410 */ 19, 20, 22, 22, 24, 190, 19, 251, 190, 127,
157459
- /* 1420 */ 98, 190, 114, 113, 22, 24, 151, 36, 153, 151,
157460
- /* 1430 */ 152, 153, 154, 155, 0, 1, 2, 212, 213, 5,
157461
- /* 1440 */ 212, 213, 150, 190, 10, 11, 12, 13, 14, 190,
157462
- /* 1450 */ 59, 17, 124, 131, 127, 53, 190, 118, 119, 119,
157463
- /* 1460 */ 23, 140, 71, 26, 30, 140, 32, 143, 312, 129,
157464
- /* 1470 */ 23, 212, 213, 26, 40, 190, 85, 150, 212, 213,
157465
- /* 1480 */ 59, 90, 19, 20, 23, 22, 190, 26, 190, 23,
157466
- /* 1490 */ 99, 190, 26, 22, 190, 23, 105, 106, 26, 36,
157467
- /* 1500 */ 151, 190, 153, 112, 70, 114, 115, 116, 212, 213,
157468
- /* 1510 */ 119, 114, 78, 212, 213, 81, 212, 213, 23, 7,
157469
- /* 1520 */ 8, 26, 59, 212, 213, 23, 190, 190, 26, 23,
157470
- /* 1530 */ 284, 97, 26, 190, 71, 190, 115, 190, 23, 59,
157471
- /* 1540 */ 139, 26, 151, 152, 153, 154, 155, 190, 85, 212,
157472
- /* 1550 */ 213, 190, 190, 90, 190, 212, 213, 83, 84, 190,
157473
- /* 1560 */ 23, 190, 99, 26, 23, 131, 190, 26, 105, 106,
157474
- /* 1570 */ 136, 137, 190, 212, 213, 112, 190, 114, 115, 116,
157475
- /* 1580 */ 1, 2, 119, 190, 5, 19, 20, 232, 22, 10,
157476
- /* 1590 */ 11, 12, 13, 14, 160, 115, 17, 23, 212, 213,
157477
- /* 1600 */ 26, 190, 36, 190, 190, 212, 213, 190, 190, 30,
157478
- /* 1610 */ 139, 32, 190, 190, 151, 152, 153, 154, 155, 40,
157479
- /* 1620 */ 190, 190, 190, 212, 213, 59, 212, 213, 190, 190,
157480
- /* 1630 */ 190, 190, 190, 190, 190, 190, 190, 71, 238, 283,
157481
- /* 1640 */ 251, 188, 239, 251, 293, 251, 251, 267, 263, 70,
157482
- /* 1650 */ 241, 255, 289, 241, 255, 267, 289, 78, 210, 255,
157483
- /* 1660 */ 81, 263, 242, 276, 245, 99, 242, 216, 241, 215,
157484
- /* 1670 */ 221, 105, 106, 107, 267, 267, 97, 225, 112, 215,
157485
- /* 1680 */ 114, 115, 116, 215, 193, 119, 60, 139, 38, 197,
157486
- /* 1690 */ 197, 19, 20, 197, 22, 245, 239, 148, 293, 293,
157487
- /* 1700 */ 290, 149, 22, 268, 279, 290, 43, 230, 36, 18,
157488
- /* 1710 */ 131, 233, 233, 197, 233, 136, 137, 151, 152, 153,
157489
- /* 1720 */ 154, 155, 266, 233, 18, 196, 242, 147, 268, 242,
157490
- /* 1730 */ 268, 59, 197, 266, 230, 230, 242, 156, 196, 160,
157491
- /* 1740 */ 242, 286, 197, 71, 62, 22, 196, 217, 197, 196,
157492
- /* 1750 */ 285, 197, 196, 217, 113, 223, 64, 214, 214, 19,
157493
- /* 1760 */ 20, 214, 22, 22, 124, 163, 220, 111, 257, 142,
157494
- /* 1770 */ 113, 99, 214, 214, 217, 220, 36, 105, 106, 216,
157495
- /* 1780 */ 256, 214, 214, 223, 112, 278, 114, 115, 116, 306,
157496
- /* 1790 */ 217, 119, 278, 217, 197, 257, 256, 311, 91, 59,
157497
- /* 1800 */ 311, 82, 143, 22, 146, 197, 273, 156, 144, 275,
157498
- /* 1810 */ 145, 71, 25, 200, 26, 199, 244, 246, 257, 257,
157499
- /* 1820 */ 256, 256, 245, 151, 152, 153, 154, 155, 246, 243,
157500
- /* 1830 */ 261, 261, 242, 13, 191, 191, 6, 189, 189, 99,
157501
- /* 1840 */ 203, 189, 209, 209, 209, 105, 106, 209, 203, 218,
157502
- /* 1850 */ 218, 209, 112, 4, 114, 115, 116, 210, 203, 119,
157503
- /* 1860 */ 3, 5, 22, 210, 161, 15, 10, 11, 12, 13,
157504
- /* 1870 */ 14, 16, 137, 17, 299, 23, 23, 299, 149, 296,
157505
- /* 1880 */ 128, 20, 140, 24, 26, 142, 30, 16, 32, 1,
157506
- /* 1890 */ 140, 151, 152, 153, 154, 155, 40, 128, 128, 61,
157507
- /* 1900 */ 37, 53, 149, 128, 53, 114, 34, 53, 1, 5,
157508
- /* 1910 */ 139, 22, 113, 53, 159, 68, 26, 75, 41, 139,
157509
- /* 1920 */ 113, 24, 20, 129, 19, 123, 70, 59, 22, 96,
157510
- /* 1930 */ 68, 67, 22, 22, 78, 23, 22, 81, 22, 24,
157511
- /* 1940 */ 67, 28, 67, 23, 147, 37, 22, 26, 23, 23,
157512
- /* 1950 */ 23, 23, 22, 97, 22, 24, 23, 139, 24, 23,
157513
- /* 1960 */ 23, 22, 141, 34, 26, 86, 88, 75, 75, 34,
157514
- /* 1970 */ 23, 22, 24, 93, 34, 34, 34, 34, 26, 114,
157515
- /* 1980 */ 26, 23, 23, 23, 34, 23, 23, 131, 44, 23,
157516
- /* 1990 */ 26, 22, 136, 137, 11, 22, 22, 26, 23, 23,
157517
- /* 2000 */ 22, 22, 133, 23, 15, 139, 139, 1, 1, 139,
157518
- /* 2010 */ 313, 313, 313, 139, 313, 313, 160, 313, 313, 313,
157519
- /* 2020 */ 313, 313, 313, 313, 313, 313, 313, 313, 313, 313,
157520
- /* 2030 */ 313, 313, 313, 313, 313, 313, 313, 313, 313, 313,
157521
- /* 2040 */ 313, 313, 313, 313, 313, 313, 313, 313, 313, 313,
157522
- /* 2050 */ 313, 313, 313, 313, 313, 313, 313, 313, 313, 313,
157523
- /* 2060 */ 313, 313, 313, 313, 313, 313, 313, 313, 313, 313,
157524
- /* 2070 */ 313, 313, 313, 313, 313, 313, 313, 313, 313, 313,
157525
- /* 2080 */ 313, 313, 313, 313, 313, 313, 313, 313, 313, 313,
157526
- /* 2090 */ 313, 313, 313, 313, 313, 313, 313, 313, 313, 313,
157527
- /* 2100 */ 313, 313, 313, 313, 313, 313, 313, 313, 313, 313,
157528
- /* 2110 */ 313, 313, 313, 313, 313, 313, 313, 313, 313, 313,
157529
- /* 2120 */ 313, 313, 313, 313, 313, 313, 313, 313, 313, 313,
157530
- /* 2130 */ 313, 313, 313, 313, 313, 313, 313, 313, 313, 313,
157531
- /* 2140 */ 313, 313, 313, 313, 313, 313, 313, 313, 313, 313,
157532
- /* 2150 */ 313, 313, 313, 313, 313, 313, 313, 313, 313, 313,
157533
- /* 2160 */ 313, 313, 313, 313, 313, 313, 313, 313, 313, 313,
157534
- /* 2170 */ 313, 313, 313, 313, 313, 313, 313, 313, 313, 313,
157535
- /* 2180 */ 313, 313, 313, 313, 313, 313, 313, 313, 313, 313,
157536
- /* 2190 */ 313, 313, 313, 313, 313, 313, 182, 182, 182,
157537
-};
157538
-#define YY_SHIFT_COUNT (572)
157489
+ /* 0 */ 191, 220, 191, 222, 191, 191, 271, 272, 273, 216,
157490
+ /* 10 */ 191, 230, 216, 191, 191, 191, 271, 272, 273, 19,
157491
+ /* 20 */ 232, 233, 213, 214, 213, 214, 202, 292, 202, 232,
157492
+ /* 30 */ 233, 31, 213, 214, 213, 213, 214, 213, 214, 39,
157493
+ /* 40 */ 207, 208, 209, 43, 44, 45, 46, 47, 48, 49,
157494
+ /* 50 */ 50, 51, 52, 53, 54, 55, 56, 57, 235, 19,
157495
+ /* 60 */ 236, 237, 236, 237, 271, 272, 273, 271, 272, 273,
157496
+ /* 70 */ 191, 210, 250, 249, 250, 249, 213, 191, 199, 253,
157497
+ /* 80 */ 254, 259, 203, 43, 44, 45, 46, 47, 48, 49,
157498
+ /* 90 */ 50, 51, 52, 53, 54, 55, 56, 57, 191, 213,
157499
+ /* 100 */ 214, 213, 102, 103, 104, 105, 106, 107, 108, 109,
157500
+ /* 110 */ 110, 111, 112, 59, 228, 301, 293, 81, 305, 306,
157501
+ /* 120 */ 311, 312, 311, 310, 313, 59, 86, 212, 88, 19,
157502
+ /* 130 */ 311, 312, 271, 272, 273, 220, 26, 112, 54, 55,
157503
+ /* 140 */ 56, 57, 102, 103, 104, 105, 106, 107, 108, 109,
157504
+ /* 150 */ 110, 111, 112, 43, 44, 45, 46, 47, 48, 49,
157505
+ /* 160 */ 50, 51, 52, 53, 54, 55, 56, 57, 191, 115,
157506
+ /* 170 */ 116, 117, 118, 137, 138, 121, 122, 123, 191, 69,
157507
+ /* 180 */ 203, 115, 116, 117, 59, 131, 102, 103, 104, 105,
157508
+ /* 190 */ 106, 107, 108, 109, 110, 111, 112, 72, 191, 19,
157509
+ /* 200 */ 54, 55, 56, 57, 58, 108, 109, 110, 111, 112,
157510
+ /* 210 */ 303, 304, 102, 103, 104, 105, 106, 107, 108, 109,
157511
+ /* 220 */ 110, 111, 112, 43, 44, 45, 46, 47, 48, 49,
157512
+ /* 230 */ 50, 51, 52, 53, 54, 55, 56, 57, 19, 16,
157513
+ /* 240 */ 115, 116, 117, 24, 16, 227, 202, 67, 102, 103,
157514
+ /* 250 */ 104, 105, 106, 107, 108, 109, 110, 111, 112, 59,
157515
+ /* 260 */ 26, 191, 43, 44, 45, 46, 47, 48, 49, 50,
157516
+ /* 270 */ 51, 52, 53, 54, 55, 56, 57, 24, 208, 209,
157517
+ /* 280 */ 236, 237, 102, 103, 104, 105, 106, 107, 108, 109,
157518
+ /* 290 */ 110, 111, 112, 249, 183, 184, 185, 186, 187, 188,
157519
+ /* 300 */ 77, 59, 79, 191, 193, 77, 195, 79, 19, 19,
157520
+ /* 310 */ 266, 304, 59, 202, 24, 115, 116, 117, 191, 127,
157521
+ /* 320 */ 128, 102, 103, 104, 105, 106, 107, 108, 109, 110,
157522
+ /* 330 */ 111, 112, 43, 44, 45, 46, 47, 48, 49, 50,
157523
+ /* 340 */ 51, 52, 53, 54, 55, 56, 57, 236, 237, 191,
157524
+ /* 350 */ 150, 281, 191, 185, 186, 187, 188, 115, 116, 117,
157525
+ /* 360 */ 249, 193, 191, 195, 26, 73, 59, 191, 114, 116,
157526
+ /* 370 */ 202, 213, 214, 81, 263, 106, 107, 108, 109, 110,
157527
+ /* 380 */ 111, 112, 148, 160, 142, 95, 228, 191, 191, 213,
157528
+ /* 390 */ 214, 102, 103, 104, 105, 106, 107, 108, 109, 110,
157529
+ /* 400 */ 111, 112, 112, 149, 236, 237, 295, 100, 118, 119,
157530
+ /* 410 */ 120, 121, 122, 123, 124, 19, 31, 249, 126, 23,
157531
+ /* 420 */ 130, 260, 115, 116, 39, 22, 250, 120, 191, 137,
157532
+ /* 430 */ 138, 263, 305, 306, 238, 259, 265, 310, 149, 43,
157533
+ /* 440 */ 44, 45, 46, 47, 48, 49, 50, 51, 52, 53,
157534
+ /* 450 */ 54, 55, 56, 57, 191, 117, 191, 210, 19, 152,
157535
+ /* 460 */ 153, 154, 23, 295, 102, 103, 104, 105, 106, 107,
157536
+ /* 470 */ 108, 109, 110, 111, 112, 266, 213, 214, 213, 214,
157537
+ /* 480 */ 142, 81, 43, 44, 45, 46, 47, 48, 49, 50,
157538
+ /* 490 */ 51, 52, 53, 54, 55, 56, 57, 301, 102, 103,
157539
+ /* 500 */ 104, 105, 106, 107, 108, 109, 110, 111, 112, 106,
157540
+ /* 510 */ 107, 118, 59, 250, 121, 122, 123, 280, 76, 119,
157541
+ /* 520 */ 236, 237, 259, 306, 131, 72, 59, 310, 19, 87,
157542
+ /* 530 */ 283, 89, 23, 249, 92, 288, 22, 137, 138, 22,
157543
+ /* 540 */ 275, 102, 103, 104, 105, 106, 107, 108, 109, 110,
157544
+ /* 550 */ 111, 112, 43, 44, 45, 46, 47, 48, 49, 50,
157545
+ /* 560 */ 51, 52, 53, 54, 55, 56, 57, 19, 115, 116,
157546
+ /* 570 */ 117, 23, 186, 59, 188, 108, 59, 241, 191, 193,
157547
+ /* 580 */ 26, 195, 115, 116, 117, 191, 144, 251, 202, 22,
157548
+ /* 590 */ 100, 43, 44, 45, 46, 47, 48, 49, 50, 51,
157549
+ /* 600 */ 52, 53, 54, 55, 56, 57, 116, 213, 214, 191,
157550
+ /* 610 */ 120, 102, 103, 104, 105, 106, 107, 108, 109, 110,
157551
+ /* 620 */ 111, 112, 236, 237, 306, 238, 59, 26, 310, 115,
157552
+ /* 630 */ 116, 117, 115, 116, 117, 249, 246, 19, 248, 106,
157553
+ /* 640 */ 107, 23, 152, 153, 154, 46, 47, 48, 49, 263,
157554
+ /* 650 */ 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
157555
+ /* 660 */ 112, 43, 44, 45, 46, 47, 48, 49, 50, 51,
157556
+ /* 670 */ 52, 53, 54, 55, 56, 57, 19, 76, 298, 299,
157557
+ /* 680 */ 23, 295, 115, 116, 117, 152, 191, 154, 301, 73,
157558
+ /* 690 */ 89, 137, 138, 92, 22, 191, 144, 22, 191, 191,
157559
+ /* 700 */ 43, 44, 45, 46, 47, 48, 49, 50, 51, 52,
157560
+ /* 710 */ 53, 54, 55, 56, 57, 163, 191, 213, 214, 120,
157561
+ /* 720 */ 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
157562
+ /* 730 */ 112, 59, 228, 191, 59, 191, 236, 237, 213, 214,
157563
+ /* 740 */ 11, 59, 126, 127, 128, 238, 19, 26, 191, 249,
157564
+ /* 750 */ 23, 164, 165, 228, 191, 213, 214, 213, 214, 102,
157565
+ /* 760 */ 103, 104, 105, 106, 107, 108, 109, 110, 111, 112,
157566
+ /* 770 */ 43, 44, 45, 46, 47, 48, 49, 50, 51, 52,
157567
+ /* 780 */ 53, 54, 55, 56, 57, 19, 241, 115, 116, 117,
157568
+ /* 790 */ 115, 116, 117, 191, 250, 238, 251, 115, 116, 117,
157569
+ /* 800 */ 157, 23, 159, 191, 26, 191, 111, 112, 301, 43,
157570
+ /* 810 */ 44, 45, 46, 47, 48, 49, 50, 51, 52, 53,
157571
+ /* 820 */ 54, 55, 56, 57, 142, 213, 214, 213, 214, 102,
157572
+ /* 830 */ 103, 104, 105, 106, 107, 108, 109, 110, 111, 112,
157573
+ /* 840 */ 228, 191, 228, 191, 191, 207, 208, 209, 126, 127,
157574
+ /* 850 */ 128, 133, 289, 135, 136, 19, 127, 128, 301, 7,
157575
+ /* 860 */ 8, 9, 141, 213, 214, 213, 214, 265, 102, 103,
157576
+ /* 870 */ 104, 105, 106, 107, 108, 109, 110, 111, 112, 43,
157577
+ /* 880 */ 44, 45, 46, 47, 48, 49, 50, 51, 52, 53,
157578
+ /* 890 */ 54, 55, 56, 57, 191, 117, 191, 22, 23, 19,
157579
+ /* 900 */ 250, 26, 250, 191, 223, 191, 126, 127, 128, 205,
157580
+ /* 910 */ 206, 205, 206, 260, 21, 202, 213, 214, 213, 214,
157581
+ /* 920 */ 142, 270, 208, 209, 158, 45, 46, 47, 48, 49,
157582
+ /* 930 */ 50, 51, 52, 53, 54, 55, 56, 57, 102, 103,
157583
+ /* 940 */ 104, 105, 106, 107, 108, 109, 110, 111, 112, 236,
157584
+ /* 950 */ 237, 12, 191, 250, 76, 250, 191, 22, 23, 308,
157585
+ /* 960 */ 309, 26, 249, 202, 191, 191, 27, 89, 191, 202,
157586
+ /* 970 */ 92, 202, 260, 80, 213, 214, 101, 203, 213, 214,
157587
+ /* 980 */ 22, 42, 102, 103, 104, 105, 106, 107, 108, 109,
157588
+ /* 990 */ 110, 111, 112, 228, 158, 281, 108, 236, 237, 225,
157589
+ /* 1000 */ 191, 227, 63, 236, 237, 236, 237, 191, 235, 191,
157590
+ /* 1010 */ 249, 250, 73, 241, 19, 122, 249, 59, 249, 24,
157591
+ /* 1020 */ 259, 29, 134, 251, 191, 33, 22, 139, 24, 213,
157592
+ /* 1030 */ 214, 213, 214, 191, 19, 210, 101, 191, 43, 44,
157593
+ /* 1040 */ 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
157594
+ /* 1050 */ 55, 56, 57, 160, 19, 213, 214, 65, 43, 44,
157595
+ /* 1060 */ 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
157596
+ /* 1070 */ 55, 56, 57, 191, 116, 22, 191, 24, 43, 44,
157597
+ /* 1080 */ 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
157598
+ /* 1090 */ 55, 56, 57, 191, 261, 213, 214, 102, 103, 104,
157599
+ /* 1100 */ 105, 106, 107, 108, 109, 110, 111, 112, 59, 19,
157600
+ /* 1110 */ 191, 265, 59, 288, 191, 213, 214, 102, 103, 104,
157601
+ /* 1120 */ 105, 106, 107, 108, 109, 110, 111, 112, 35, 191,
157602
+ /* 1130 */ 66, 191, 213, 214, 191, 270, 46, 102, 103, 104,
157603
+ /* 1140 */ 105, 106, 107, 108, 109, 110, 111, 112, 191, 85,
157604
+ /* 1150 */ 265, 213, 214, 213, 214, 106, 107, 19, 94, 66,
157605
+ /* 1160 */ 137, 138, 191, 114, 115, 116, 117, 74, 119, 116,
157606
+ /* 1170 */ 213, 214, 202, 308, 309, 306, 127, 191, 235, 310,
157607
+ /* 1180 */ 59, 191, 44, 45, 46, 47, 48, 49, 50, 51,
157608
+ /* 1190 */ 52, 53, 54, 55, 56, 57, 191, 76, 196, 213,
157609
+ /* 1200 */ 214, 152, 12, 154, 114, 191, 236, 237, 87, 145,
157610
+ /* 1210 */ 89, 19, 20, 92, 22, 22, 23, 27, 191, 249,
157611
+ /* 1220 */ 130, 202, 129, 202, 191, 235, 306, 152, 36, 154,
157612
+ /* 1230 */ 310, 191, 42, 191, 191, 191, 115, 116, 117, 191,
157613
+ /* 1240 */ 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
157614
+ /* 1250 */ 112, 59, 99, 63, 191, 236, 237, 236, 237, 191,
157615
+ /* 1260 */ 289, 213, 214, 71, 191, 144, 261, 191, 249, 191,
157616
+ /* 1270 */ 249, 19, 20, 81, 22, 235, 213, 214, 235, 191,
157617
+ /* 1280 */ 278, 213, 214, 191, 282, 132, 213, 214, 36, 213,
157618
+ /* 1290 */ 214, 191, 100, 191, 101, 191, 191, 191, 106, 107,
157619
+ /* 1300 */ 48, 213, 214, 261, 191, 113, 191, 115, 116, 117,
157620
+ /* 1310 */ 191, 59, 120, 213, 214, 213, 214, 213, 214, 213,
157621
+ /* 1320 */ 214, 22, 23, 71, 237, 59, 213, 214, 191, 137,
157622
+ /* 1330 */ 138, 191, 213, 214, 191, 191, 249, 85, 191, 261,
157623
+ /* 1340 */ 191, 26, 90, 15, 152, 153, 154, 155, 156, 19,
157624
+ /* 1350 */ 213, 214, 100, 213, 214, 191, 213, 214, 106, 107,
157625
+ /* 1360 */ 213, 214, 213, 214, 191, 113, 261, 115, 116, 117,
157626
+ /* 1370 */ 253, 254, 120, 229, 191, 191, 191, 213, 214, 191,
157627
+ /* 1380 */ 306, 289, 116, 26, 310, 191, 213, 214, 60, 19,
157628
+ /* 1390 */ 296, 297, 24, 191, 46, 191, 213, 214, 213, 214,
157629
+ /* 1400 */ 101, 213, 214, 191, 152, 153, 154, 155, 156, 0,
157630
+ /* 1410 */ 1, 2, 191, 229, 5, 213, 214, 213, 214, 10,
157631
+ /* 1420 */ 11, 12, 13, 14, 1, 2, 17, 191, 5, 19,
157632
+ /* 1430 */ 20, 191, 22, 10, 11, 12, 13, 14, 191, 30,
157633
+ /* 1440 */ 17, 32, 241, 148, 149, 115, 36, 191, 241, 40,
157634
+ /* 1450 */ 191, 26, 251, 30, 191, 32, 141, 22, 251, 5,
157635
+ /* 1460 */ 213, 214, 114, 40, 10, 11, 12, 13, 14, 59,
157636
+ /* 1470 */ 134, 17, 213, 214, 191, 139, 213, 214, 191, 70,
157637
+ /* 1480 */ 191, 71, 125, 191, 30, 115, 32, 78, 53, 191,
157638
+ /* 1490 */ 81, 191, 191, 70, 40, 85, 213, 214, 191, 22,
157639
+ /* 1500 */ 90, 78, 213, 214, 81, 213, 214, 98, 140, 120,
157640
+ /* 1510 */ 100, 213, 214, 213, 214, 23, 106, 107, 26, 130,
157641
+ /* 1520 */ 191, 98, 191, 113, 70, 115, 116, 117, 23, 22,
157642
+ /* 1530 */ 120, 26, 78, 19, 191, 81, 19, 20, 61, 22,
157643
+ /* 1540 */ 191, 132, 213, 214, 213, 214, 137, 138, 59, 191,
157644
+ /* 1550 */ 191, 191, 98, 36, 128, 132, 213, 214, 128, 59,
157645
+ /* 1560 */ 137, 138, 152, 153, 154, 155, 156, 83, 84, 144,
157646
+ /* 1570 */ 161, 213, 214, 213, 214, 23, 59, 151, 26, 23,
157647
+ /* 1580 */ 23, 151, 26, 26, 161, 59, 132, 23, 71, 191,
157648
+ /* 1590 */ 26, 137, 138, 119, 120, 23, 19, 20, 26, 22,
157649
+ /* 1600 */ 223, 23, 85, 23, 26, 116, 26, 90, 191, 7,
157650
+ /* 1610 */ 8, 97, 152, 36, 154, 161, 116, 100, 23, 23,
157651
+ /* 1620 */ 191, 26, 26, 106, 107, 191, 23, 223, 23, 26,
157652
+ /* 1630 */ 113, 26, 115, 116, 117, 23, 59, 120, 26, 191,
157653
+ /* 1640 */ 191, 191, 116, 255, 191, 252, 191, 140, 71, 191,
157654
+ /* 1650 */ 315, 233, 191, 191, 191, 191, 191, 191, 191, 191,
157655
+ /* 1660 */ 191, 285, 284, 239, 252, 252, 252, 252, 240, 152,
157656
+ /* 1670 */ 153, 154, 155, 156, 189, 294, 268, 100, 242, 268,
157657
+ /* 1680 */ 264, 211, 290, 106, 107, 108, 264, 256, 256, 243,
157658
+ /* 1690 */ 113, 290, 115, 116, 117, 268, 217, 120, 226, 243,
157659
+ /* 1700 */ 222, 268, 216, 19, 20, 246, 22, 216, 256, 216,
157660
+ /* 1710 */ 194, 60, 38, 242, 277, 294, 240, 242, 198, 246,
157661
+ /* 1720 */ 36, 140, 198, 198, 19, 20, 150, 22, 149, 152,
157662
+ /* 1730 */ 153, 154, 155, 156, 294, 291, 291, 280, 22, 43,
157663
+ /* 1740 */ 231, 36, 18, 59, 234, 234, 234, 234, 267, 269,
157664
+ /* 1750 */ 18, 198, 197, 231, 148, 71, 269, 269, 243, 231,
157665
+ /* 1760 */ 198, 243, 267, 197, 59, 157, 243, 198, 62, 287,
157666
+ /* 1770 */ 243, 197, 22, 198, 114, 64, 71, 218, 218, 197,
157667
+ /* 1780 */ 286, 198, 197, 215, 100, 215, 215, 224, 22, 125,
157668
+ /* 1790 */ 106, 107, 164, 24, 221, 112, 143, 113, 302, 115,
157669
+ /* 1800 */ 116, 117, 218, 215, 120, 100, 217, 221, 215, 215,
157670
+ /* 1810 */ 309, 106, 107, 215, 224, 279, 279, 218, 113, 258,
157671
+ /* 1820 */ 115, 116, 117, 114, 257, 120, 91, 198, 82, 147,
157672
+ /* 1830 */ 144, 22, 274, 314, 198, 314, 152, 153, 154, 155,
157673
+ /* 1840 */ 156, 276, 157, 146, 145, 258, 25, 247, 257, 201,
157674
+ /* 1850 */ 258, 26, 200, 13, 257, 244, 246, 152, 153, 154,
157675
+ /* 1860 */ 155, 156, 258, 262, 257, 247, 245, 243, 192, 192,
157676
+ /* 1870 */ 6, 262, 204, 210, 219, 210, 210, 190, 190, 190,
157677
+ /* 1880 */ 210, 219, 204, 211, 211, 210, 4, 3, 22, 162,
157678
+ /* 1890 */ 15, 23, 16, 23, 204, 138, 129, 150, 26, 141,
157679
+ /* 1900 */ 20, 24, 143, 16, 1, 141, 129, 129, 61, 53,
157680
+ /* 1910 */ 37, 150, 297, 300, 300, 53, 53, 129, 53, 115,
157681
+ /* 1920 */ 34, 140, 1, 5, 22, 114, 68, 26, 160, 68,
157682
+ /* 1930 */ 75, 41, 140, 114, 24, 20, 19, 130, 124, 23,
157683
+ /* 1940 */ 96, 22, 22, 37, 22, 67, 22, 59, 67, 24,
157684
+ /* 1950 */ 22, 28, 67, 23, 148, 22, 97, 23, 23, 23,
157685
+ /* 1960 */ 140, 23, 22, 26, 23, 23, 115, 22, 142, 26,
157686
+ /* 1970 */ 75, 88, 75, 34, 23, 86, 44, 22, 34, 26,
157687
+ /* 1980 */ 34, 34, 34, 34, 93, 24, 26, 23, 34, 23,
157688
+ /* 1990 */ 23, 23, 23, 11, 23, 22, 26, 22, 22, 15,
157689
+ /* 2000 */ 23, 23, 22, 22, 1, 26, 23, 140, 134, 140,
157690
+ /* 2010 */ 1, 140, 316, 316, 316, 316, 316, 316, 316, 140,
157691
+ /* 2020 */ 316, 316, 316, 316, 316, 316, 316, 316, 316, 316,
157692
+ /* 2030 */ 316, 316, 316, 316, 316, 316, 316, 316, 316, 316,
157693
+ /* 2040 */ 316, 316, 316, 316, 316, 316, 316, 316, 316, 316,
157694
+ /* 2050 */ 316, 316, 316, 316, 316, 316, 316, 316, 316, 316,
157695
+ /* 2060 */ 316, 316, 316, 316, 316, 316, 316, 316, 316, 316,
157696
+ /* 2070 */ 316, 316, 316, 316, 316, 316, 316, 316, 316, 316,
157697
+ /* 2080 */ 316, 316, 316, 316, 316, 316, 316, 316, 316, 316,
157698
+ /* 2090 */ 316, 316, 316, 316, 316, 316, 316, 316, 316, 316,
157699
+ /* 2100 */ 316, 316, 316, 316, 316, 316, 316, 316, 316, 316,
157700
+ /* 2110 */ 316, 316, 316, 316, 316, 316, 316, 316, 316, 316,
157701
+ /* 2120 */ 316, 316, 316, 316, 316, 316, 316, 316, 316, 316,
157702
+ /* 2130 */ 316, 316, 316, 316, 316, 316, 316, 316, 316, 316,
157703
+ /* 2140 */ 316, 316, 316, 316, 316, 316, 316, 316, 316, 316,
157704
+ /* 2150 */ 316, 316, 316, 316, 316, 316, 316, 316, 316, 316,
157705
+ /* 2160 */ 316, 316, 316, 316, 316, 316, 316, 316, 316, 316,
157706
+ /* 2170 */ 316, 316, 316, 316, 316, 316, 316, 316, 316, 316,
157707
+ /* 2180 */ 316, 316, 316, 316, 316, 316, 316, 316, 316, 316,
157708
+ /* 2190 */ 316, 316, 316, 316, 316, 316, 316, 316, 316, 316,
157709
+ /* 2200 */ 316, 316, 316,
157710
+};
157711
+#define YY_SHIFT_COUNT (569)
157539157712
#define YY_SHIFT_MIN (0)
157540
-#define YY_SHIFT_MAX (2007)
157713
+#define YY_SHIFT_MAX (2009)
157541157714
static const unsigned short int yy_shift_ofst[] = {
157542
- /* 0 */ 1579, 1434, 1856, 1206, 1206, 1, 1278, 1391, 1463, 1672,
157543
- /* 10 */ 1672, 1672, 390, 0, 0, 180, 1008, 1672, 1672, 1672,
157544
- /* 20 */ 1672, 1672, 1672, 1672, 1672, 1672, 1672, 1672, 1672, 1672,
157545
- /* 30 */ 794, 794, 287, 287, 250, 611, 1, 1, 1, 1,
157546
- /* 40 */ 1, 1, 40, 110, 219, 288, 394, 437, 506, 545,
157547
- /* 50 */ 614, 653, 722, 761, 830, 988, 1008, 1008, 1008, 1008,
157548
- /* 60 */ 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008,
157549
- /* 70 */ 1008, 1008, 1008, 1008, 1028, 1008, 1130, 1150, 1150, 1566,
157550
- /* 80 */ 1672, 1672, 1672, 1672, 1672, 1672, 1672, 1672, 1672, 1672,
157551
- /* 90 */ 1672, 1672, 1672, 1672, 1672, 1672, 1672, 1672, 1672, 1672,
157552
- /* 100 */ 1672, 1672, 1672, 1672, 1672, 1672, 1672, 1672, 1672, 1672,
157553
- /* 110 */ 1672, 1672, 1672, 1672, 1740, 1672, 1672, 1672, 1672, 1672,
157554
- /* 120 */ 1672, 1672, 1672, 1672, 1672, 1672, 1672, 1672, 147, 248,
157555
- /* 130 */ 248, 248, 248, 248, 79, 86, 185, 573, 771, 896,
157556
- /* 140 */ 573, 530, 530, 573, 877, 877, 877, 877, 295, 475,
157557
- /* 150 */ 475, 584, 29, 2017, 2017, 289, 289, 289, 58, 508,
157558
- /* 160 */ 62, 508, 508, 508, 392, 392, 225, 395, 218, 822,
157559
- /* 170 */ 573, 573, 573, 573, 573, 573, 573, 573, 573, 573,
157560
- /* 180 */ 573, 573, 573, 573, 573, 573, 573, 573, 573, 573,
157561
- /* 190 */ 573, 1074, 1074, 573, 119, 1187, 1187, 1044, 1044, 1145,
157562
- /* 200 */ 1146, 2017, 2017, 2017, 2017, 2017, 2017, 2017, 418, 263,
157563
- /* 210 */ 263, 559, 303, 618, 527, 623, 464, 570, 780, 573,
157564
- /* 220 */ 573, 573, 573, 573, 573, 573, 573, 573, 573, 669,
157565
- /* 230 */ 573, 573, 573, 573, 573, 573, 573, 573, 573, 573,
157566
- /* 240 */ 573, 573, 245, 245, 245, 573, 573, 573, 573, 985,
157567
- /* 250 */ 573, 573, 573, 18, 1076, 573, 573, 1131, 573, 573,
157568
- /* 260 */ 573, 573, 573, 573, 573, 573, 941, 1092, 770, 903,
157569
- /* 270 */ 903, 903, 903, 1203, 770, 770, 1085, 692, 1144, 1319,
157570
- /* 280 */ 1168, 1227, 1321, 1308, 1227, 1308, 1397, 593, 1168, 1168,
157571
- /* 290 */ 593, 1168, 1321, 1397, 1328, 15, 1310, 1265, 1265, 1265,
157572
- /* 300 */ 1308, 1324, 1324, 863, 1325, 492, 1390, 1626, 1626, 1548,
157573
- /* 310 */ 1548, 1650, 1650, 1548, 1552, 1549, 1680, 1663, 1691, 1691,
157574
- /* 320 */ 1691, 1691, 1548, 1706, 1580, 1549, 1549, 1580, 1680, 1663,
157575
- /* 330 */ 1580, 1663, 1580, 1548, 1706, 1581, 1682, 1548, 1706, 1723,
157576
- /* 340 */ 1548, 1706, 1548, 1706, 1723, 1641, 1641, 1641, 1692, 1741,
157577
- /* 350 */ 1741, 1723, 1641, 1640, 1641, 1692, 1641, 1641, 1602, 1723,
157578
- /* 360 */ 1656, 1656, 1723, 1627, 1657, 1627, 1657, 1627, 1657, 1627,
157579
- /* 370 */ 1657, 1548, 1707, 1707, 1719, 1719, 1658, 1659, 1781, 1548,
157580
- /* 380 */ 1651, 1658, 1665, 1664, 1580, 1787, 1788, 1820, 1820, 1830,
157581
- /* 390 */ 1830, 1830, 2017, 2017, 2017, 2017, 2017, 2017, 2017, 2017,
157582
- /* 400 */ 2017, 2017, 2017, 2017, 2017, 2017, 2017, 339, 445, 1064,
157583
- /* 410 */ 1193, 951, 1029, 1256, 1383, 1322, 1402, 1401, 1292, 1327,
157584
- /* 420 */ 1437, 727, 1447, 1461, 1466, 1472, 1495, 1502, 1184, 1339,
157585
- /* 430 */ 1512, 1340, 1421, 1506, 1515, 1474, 1537, 1275, 1349, 1541,
157586
- /* 440 */ 1574, 1480, 1471, 1849, 1857, 1840, 1703, 1850, 1855, 1852,
157587
- /* 450 */ 1853, 1735, 1729, 1752, 1858, 1858, 1859, 1742, 1861, 1743,
157588
- /* 460 */ 1871, 1888, 1750, 1769, 1858, 1770, 1838, 1863, 1858, 1753,
157589
- /* 470 */ 1848, 1851, 1854, 1860, 1775, 1791, 1872, 1771, 1907, 1904,
157590
- /* 480 */ 1889, 1799, 1755, 1847, 1890, 1862, 1842, 1877, 1780, 1807,
157591
- /* 490 */ 1897, 1902, 1905, 1794, 1802, 1906, 1864, 1910, 1911, 1912,
157592
- /* 500 */ 1914, 1873, 1868, 1915, 1833, 1913, 1916, 1875, 1908, 1920,
157593
- /* 510 */ 1797, 1924, 1925, 1926, 1927, 1921, 1928, 1930, 1931, 1933,
157594
- /* 520 */ 1932, 1934, 1818, 1936, 1937, 1865, 1929, 1939, 1821, 1938,
157595
- /* 530 */ 1935, 1940, 1941, 1942, 1878, 1892, 1879, 1944, 1893, 1880,
157596
- /* 540 */ 1943, 1947, 1949, 1948, 1952, 1954, 1950, 1958, 1938, 1959,
157597
- /* 550 */ 1960, 1962, 1963, 1964, 1966, 1969, 1983, 1973, 1974, 1975,
157598
- /* 560 */ 1976, 1978, 1979, 1971, 1869, 1866, 1867, 1870, 1874, 1980,
157599
- /* 570 */ 1989, 2006, 2007,
157600
-};
157601
-#define YY_REDUCE_COUNT (406)
157602
-#define YY_REDUCE_MIN (-262)
157603
-#define YY_REDUCE_MAX (1655)
157715
+ /* 0 */ 1423, 1409, 1454, 1192, 1192, 36, 1252, 1410, 1517, 1684,
157716
+ /* 10 */ 1684, 1684, 292, 0, 0, 180, 1015, 1684, 1684, 1684,
157717
+ /* 20 */ 1684, 1684, 1684, 1684, 1684, 1684, 1684, 1684, 1684, 1684,
157718
+ /* 30 */ 1049, 1049, 1121, 1121, 54, 400, 36, 36, 36, 36,
157719
+ /* 40 */ 36, 40, 110, 219, 289, 396, 439, 509, 548, 618,
157720
+ /* 50 */ 657, 727, 766, 836, 995, 1015, 1015, 1015, 1015, 1015,
157721
+ /* 60 */ 1015, 1015, 1015, 1015, 1015, 1015, 1015, 1015, 1015, 1015,
157722
+ /* 70 */ 1015, 1015, 1015, 1035, 1015, 1138, 880, 880, 1577, 1684,
157723
+ /* 80 */ 1684, 1684, 1684, 1684, 1684, 1684, 1684, 1684, 1684, 1684,
157724
+ /* 90 */ 1684, 1684, 1684, 1684, 1684, 1684, 1684, 1684, 1684, 1684,
157725
+ /* 100 */ 1684, 1684, 1684, 1684, 1684, 1684, 1684, 1684, 1684, 1684,
157726
+ /* 110 */ 1684, 1684, 1684, 1705, 1684, 1684, 1684, 1684, 1684, 1684,
157727
+ /* 120 */ 1684, 1684, 1684, 1684, 1684, 1684, 1684, 146, 84, 84,
157728
+ /* 130 */ 84, 84, 84, 362, 269, 125, 97, 453, 66, 66,
157729
+ /* 140 */ 893, 1090, 66, 66, 533, 533, 66, 554, 554, 554,
157730
+ /* 150 */ 554, 192, 587, 587, 695, 25, 2020, 2020, 290, 290,
157731
+ /* 160 */ 290, 200, 514, 514, 514, 514, 939, 939, 442, 875,
157732
+ /* 170 */ 935, 66, 66, 66, 66, 66, 66, 66, 66, 66,
157733
+ /* 180 */ 66, 66, 66, 66, 66, 66, 66, 66, 66, 66,
157734
+ /* 190 */ 66, 601, 601, 66, 729, 878, 878, 1266, 1266, 552,
157735
+ /* 200 */ 1023, 2020, 2020, 2020, 2020, 2020, 2020, 2020, 307, 490,
157736
+ /* 210 */ 490, 567, 393, 517, 467, 672, 242, 682, 675, 66,
157737
+ /* 220 */ 66, 66, 66, 66, 66, 66, 66, 66, 66, 616,
157738
+ /* 230 */ 66, 66, 66, 66, 66, 66, 66, 66, 66, 66,
157739
+ /* 240 */ 66, 66, 1093, 1093, 1093, 66, 66, 66, 778, 66,
157740
+ /* 250 */ 66, 66, 1053, 1064, 66, 66, 1190, 66, 66, 66,
157741
+ /* 260 */ 66, 66, 66, 66, 66, 722, 992, 718, 253, 253,
157742
+ /* 270 */ 253, 253, 338, 718, 718, 888, 403, 852, 1328, 254,
157743
+ /* 280 */ 1295, 721, 1330, 1295, 1330, 1370, 234, 254, 254, 234,
157744
+ /* 290 */ 254, 721, 1370, 1357, 1492, 1348, 385, 385, 385, 1330,
157745
+ /* 300 */ 1425, 1425, 643, 1315, 1336, 1004, 1651, 1651, 1581, 1581,
157746
+ /* 310 */ 1674, 1674, 1581, 1576, 1579, 1716, 1696, 1724, 1724, 1724,
157747
+ /* 320 */ 1724, 1581, 1732, 1606, 1579, 1579, 1606, 1716, 1696, 1606,
157748
+ /* 330 */ 1696, 1606, 1581, 1732, 1608, 1706, 1581, 1732, 1750, 1581,
157749
+ /* 340 */ 1732, 1581, 1732, 1750, 1660, 1660, 1660, 1711, 1766, 1766,
157750
+ /* 350 */ 1750, 1660, 1664, 1660, 1711, 1660, 1660, 1628, 1769, 1683,
157751
+ /* 360 */ 1683, 1750, 1653, 1709, 1653, 1709, 1653, 1709, 1653, 1709,
157752
+ /* 370 */ 1581, 1735, 1735, 1746, 1746, 1682, 1686, 1809, 1581, 1685,
157753
+ /* 380 */ 1682, 1697, 1699, 1606, 1821, 1825, 1840, 1840, 1864, 1864,
157754
+ /* 390 */ 1864, 2020, 2020, 2020, 2020, 2020, 2020, 2020, 2020, 2020,
157755
+ /* 400 */ 2020, 2020, 2020, 2020, 2020, 2020, 599, 223, 1193, 1299,
157756
+ /* 410 */ 228, 780, 958, 1505, 1153, 1435, 1368, 1426, 1430, 1552,
157757
+ /* 420 */ 1477, 1556, 1557, 1564, 1572, 1578, 1580, 1489, 1474, 1602,
157758
+ /* 430 */ 1389, 1514, 1500, 1595, 1596, 1484, 1603, 1075, 1460, 1605,
157759
+ /* 440 */ 1612, 1526, 1507, 1882, 1884, 1866, 1727, 1875, 1876, 1868,
157760
+ /* 450 */ 1870, 1757, 1747, 1767, 1872, 1872, 1877, 1758, 1880, 1759,
157761
+ /* 460 */ 1887, 1903, 1764, 1777, 1872, 1778, 1847, 1873, 1872, 1761,
157762
+ /* 470 */ 1856, 1862, 1863, 1865, 1788, 1804, 1886, 1781, 1921, 1918,
157763
+ /* 480 */ 1902, 1811, 1768, 1858, 1901, 1861, 1855, 1890, 1792, 1819,
157764
+ /* 490 */ 1910, 1915, 1917, 1807, 1814, 1919, 1878, 1920, 1922, 1916,
157765
+ /* 500 */ 1924, 1881, 1888, 1925, 1844, 1923, 1928, 1885, 1906, 1930,
157766
+ /* 510 */ 1806, 1933, 1934, 1935, 1936, 1937, 1938, 1940, 1859, 1820,
157767
+ /* 520 */ 1941, 1942, 1851, 1939, 1945, 1826, 1943, 1944, 1946, 1947,
157768
+ /* 530 */ 1948, 1883, 1895, 1889, 1932, 1897, 1891, 1949, 1951, 1955,
157769
+ /* 540 */ 1961, 1953, 1960, 1954, 1964, 1943, 1966, 1967, 1968, 1969,
157770
+ /* 550 */ 1970, 1971, 1973, 1982, 1975, 1976, 1977, 1978, 1980, 1981,
157771
+ /* 560 */ 1979, 1874, 1867, 1869, 1871, 1879, 1983, 1984, 2003, 2009,
157772
+};
157773
+#define YY_REDUCE_COUNT (405)
157774
+#define YY_REDUCE_MIN (-265)
157775
+#define YY_REDUCE_MAX (1690)
157604157776
static const short yy_reduce_ofst[] = {
157605
- /* 0 */ 599, -123, 272, 716, 756, -121, -190, -188, -185, -183,
157606
- /* 10 */ -179, -177, -26, 304, 313, -254, -11, 500, 609, 630,
157607
- /* 20 */ 758, -114, 763, 766, 323, 538, 768, 87, 540, 701,
157608
- /* 30 */ -38, 413, 125, 324, 699, 443, 602, 725, 748, 753,
157609
- /* 40 */ 762, 781, -262, -262, -262, -262, -262, -262, -262, -262,
157610
- /* 50 */ -262, -262, -262, -262, -262, -262, -262, -262, -262, -262,
157611
- /* 60 */ -262, -262, -262, -262, -262, -262, -262, -262, -262, -262,
157612
- /* 70 */ -262, -262, -262, -262, -262, -262, -262, -262, -262, 262,
157613
- /* 80 */ 731, 787, 836, 915, 932, 934, 977, 998, 1001, 1032,
157614
- /* 90 */ 1034, 1037, 1058, 1072, 1077, 1079, 1082, 1090, 1096, 1111,
157615
- /* 100 */ 1116, 1120, 1123, 1127, 1140, 1174, 1176, 1183, 1186, 1188,
157616
- /* 110 */ 1190, 1192, 1195, 1225, 1228, 1259, 1266, 1296, 1301, 1304,
157617
- /* 120 */ 1311, 1337, 1343, 1361, 1386, 1393, 1411, 1414, -262, -262,
157618
- /* 130 */ -262, -262, -262, -262, -262, -262, -262, -176, 825, 249,
157619
- /* 140 */ -22, 648, 652, 108, 112, 767, 112, 767, 637, 717,
157620
- /* 150 */ 835, -262, -262, -262, -262, -207, -207, -207, 126, -164,
157621
- /* 160 */ -170, 416, 708, 856, -158, 504, 74, -169, 446, 446,
157622
- /* 170 */ -187, 328, 700, 707, 239, 282, 331, 556, 721, 438,
157623
- /* 180 */ 193, 860, 322, 541, 880, 933, 975, 241, 651, 879,
157624
- /* 190 */ 970, 270, 905, 918, 88, 914, 961, 967, 1069, -39,
157625
- /* 200 */ 604, 1050, 1091, 1098, 1115, 1122, 1117, 1141, -211, -206,
157626
- /* 210 */ -180, -130, -161, 10, 179, 236, 316, 341, 629, 726,
157627
- /* 220 */ 804, 816, 834, 898, 972, 1177, 1231, 1253, 1285, 170,
157628
- /* 230 */ 1298, 1336, 1345, 1347, 1357, 1362, 1364, 1369, 1371, 1376,
157629
- /* 240 */ 1382, 1413, 240, 257, 1053, 1417, 1422, 1423, 1430, 1012,
157630
- /* 250 */ 1431, 1432, 1438, 1166, 1156, 1418, 1439, 1355, 1440, 179,
157631
- /* 260 */ 1441, 1442, 1443, 1444, 1445, 1446, 1246, 1356, 1400, 1389,
157632
- /* 270 */ 1392, 1394, 1395, 1012, 1400, 1400, 1403, 1448, 1453, 1351,
157633
- /* 280 */ 1380, 1385, 1409, 1396, 1398, 1399, 1363, 1420, 1388, 1407,
157634
- /* 290 */ 1424, 1408, 1412, 1367, 1451, 1452, 1449, 1454, 1464, 1468,
157635
- /* 300 */ 1404, 1419, 1450, 1387, 1427, 1457, 1491, 1405, 1406, 1492,
157636
- /* 310 */ 1493, 1410, 1415, 1496, 1425, 1435, 1456, 1477, 1478, 1479,
157637
- /* 320 */ 1481, 1490, 1516, 1529, 1484, 1460, 1462, 1487, 1467, 1504,
157638
- /* 330 */ 1494, 1505, 1498, 1535, 1542, 1455, 1465, 1545, 1550, 1530,
157639
- /* 340 */ 1551, 1553, 1554, 1556, 1536, 1543, 1544, 1547, 1532, 1546,
157640
- /* 350 */ 1555, 1557, 1558, 1563, 1559, 1560, 1567, 1568, 1483, 1573,
157641
- /* 360 */ 1507, 1514, 1576, 1511, 1524, 1538, 1540, 1561, 1564, 1562,
157642
- /* 370 */ 1565, 1597, 1486, 1489, 1569, 1570, 1571, 1577, 1533, 1608,
157643
- /* 380 */ 1534, 1582, 1572, 1586, 1590, 1613, 1616, 1643, 1644, 1648,
157644
- /* 390 */ 1649, 1652, 1575, 1578, 1583, 1637, 1633, 1634, 1635, 1638,
157645
- /* 400 */ 1645, 1631, 1632, 1647, 1653, 1642, 1655,
157777
+ /* 0 */ 111, 168, 386, 761, -176, -174, -191, -189, -181, -178,
157778
+ /* 10 */ 176, 263, 44, -207, -204, -265, -139, -114, 158, 504,
157779
+ /* 20 */ 525, 544, 612, 614, 650, 652, 765, 265, 703, 705,
157780
+ /* 30 */ 70, 714, -187, 127, 774, 713, 767, 769, 970, 1019,
157781
+ /* 40 */ 1021, -255, -255, -255, -255, -255, -255, -255, -255, -255,
157782
+ /* 50 */ -255, -255, -255, -255, -255, -255, -255, -255, -255, -255,
157783
+ /* 60 */ -255, -255, -255, -255, -255, -255, -255, -255, -255, -255,
157784
+ /* 70 */ -255, -255, -255, -255, -255, -255, -255, -255, 394, 542,
157785
+ /* 80 */ 816, 818, 842, 882, 902, 919, 938, 940, 957, 986,
157786
+ /* 90 */ 1048, 1063, 1068, 1073, 1076, 1088, 1100, 1102, 1104, 1106,
157787
+ /* 100 */ 1113, 1119, 1137, 1140, 1143, 1147, 1149, 1164, 1173, 1183,
157788
+ /* 110 */ 1185, 1188, 1202, 1204, 1247, 1259, 1263, 1283, 1289, 1292,
157789
+ /* 120 */ 1298, 1300, 1329, 1331, 1343, 1358, 1360, -255, -255, -255,
157790
+ /* 130 */ -255, -255, -255, -255, -255, 196, -255, 387, -177, 507,
157791
+ /* 140 */ 1002, -219, 557, -93, -167, 638, -121, 284, 500, 284,
157792
+ /* 150 */ 500, 247, 651, 865, -255, -255, -255, -255, -85, -85,
157793
+ /* 160 */ -85, 237, 171, 602, 846, 885, -212, -203, 217, 380,
157794
+ /* 170 */ 380, -23, 161, 653, 712, 773, 943, 990, 1040, 563,
157795
+ /* 180 */ 833, 971, 1005, 1042, 1092, 1078, 1043, 1144, 1184, -186,
157796
+ /* 190 */ 1105, 318, 869, 7, 825, 920, 1074, 704, 706, 390,
157797
+ /* 200 */ 1087, 1094, 336, 545, 772, 1201, 1117, 1207, -179, -137,
157798
+ /* 210 */ -112, -13, 18, 112, 197, 418, 495, 508, 777, 809,
157799
+ /* 220 */ 923, 1014, 1027, 1033, 1044, 1115, 1194, 1212, 1221, 209,
157800
+ /* 230 */ 1236, 1240, 1256, 1287, 1301, 1307, 1349, 1359, 1398, 1417,
157801
+ /* 240 */ 1429, 1434, 681, 1377, 1404, 1448, 1449, 1450, 1388, 1453,
157802
+ /* 250 */ 1455, 1458, 1393, 1335, 1461, 1462, 1418, 1463, 197, 1464,
157803
+ /* 260 */ 1465, 1466, 1467, 1468, 1469, 1376, 1378, 1424, 1412, 1413,
157804
+ /* 270 */ 1414, 1415, 1388, 1424, 1424, 1428, 1470, 1485, 1381, 1408,
157805
+ /* 280 */ 1416, 1436, 1431, 1422, 1432, 1392, 1446, 1411, 1427, 1456,
157806
+ /* 290 */ 1433, 1471, 1401, 1479, 1472, 1478, 1486, 1491, 1493, 1452,
157807
+ /* 300 */ 1459, 1473, 1437, 1475, 1476, 1516, 1421, 1440, 1520, 1524,
157808
+ /* 310 */ 1444, 1445, 1525, 1457, 1480, 1481, 1509, 1510, 1511, 1512,
157809
+ /* 320 */ 1513, 1553, 1555, 1515, 1487, 1488, 1518, 1495, 1522, 1523,
157810
+ /* 330 */ 1528, 1527, 1562, 1566, 1482, 1494, 1569, 1574, 1559, 1575,
157811
+ /* 340 */ 1582, 1583, 1585, 1560, 1568, 1570, 1571, 1563, 1573, 1586,
157812
+ /* 350 */ 1584, 1588, 1589, 1593, 1590, 1594, 1598, 1501, 1496, 1536,
157813
+ /* 360 */ 1537, 1599, 1561, 1567, 1587, 1591, 1592, 1597, 1604, 1607,
157814
+ /* 370 */ 1629, 1519, 1521, 1601, 1609, 1600, 1610, 1558, 1636, 1565,
157815
+ /* 380 */ 1618, 1621, 1611, 1624, 1648, 1652, 1676, 1677, 1687, 1688,
157816
+ /* 390 */ 1689, 1613, 1614, 1615, 1668, 1663, 1665, 1666, 1670, 1678,
157817
+ /* 400 */ 1655, 1662, 1672, 1673, 1675, 1690,
157646157818
};
157647157819
static const YYACTIONTYPE yy_default[] = {
157648
- /* 0 */ 1615, 1615, 1615, 1449, 1219, 1328, 1219, 1219, 1219, 1449,
157649
- /* 10 */ 1449, 1449, 1219, 1358, 1358, 1502, 1250, 1219, 1219, 1219,
157650
- /* 20 */ 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1448, 1219, 1219,
157651
- /* 30 */ 1219, 1219, 1533, 1533, 1219, 1219, 1219, 1219, 1219, 1219,
157652
- /* 40 */ 1219, 1219, 1219, 1367, 1219, 1374, 1219, 1219, 1219, 1219,
157653
- /* 50 */ 1219, 1450, 1451, 1219, 1219, 1219, 1501, 1503, 1466, 1381,
157654
- /* 60 */ 1380, 1379, 1378, 1484, 1345, 1372, 1365, 1369, 1444, 1445,
157655
- /* 70 */ 1443, 1447, 1451, 1450, 1219, 1368, 1415, 1429, 1414, 1219,
157656
- /* 80 */ 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219,
157657
- /* 90 */ 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219,
157658
- /* 100 */ 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219,
157659
- /* 110 */ 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219,
157660
- /* 120 */ 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1423, 1428,
157661
- /* 130 */ 1434, 1427, 1424, 1417, 1416, 1418, 1419, 1219, 1240, 1292,
157662
- /* 140 */ 1219, 1219, 1219, 1219, 1521, 1520, 1219, 1219, 1250, 1409,
157663
- /* 150 */ 1408, 1420, 1421, 1431, 1430, 1509, 1568, 1567, 1467, 1219,
157664
- /* 160 */ 1219, 1219, 1219, 1219, 1219, 1219, 1533, 1219, 1219, 1219,
157665
- /* 170 */ 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219,
157666
- /* 180 */ 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219,
157667
- /* 190 */ 1219, 1533, 1533, 1219, 1250, 1533, 1533, 1246, 1246, 1352,
157668
- /* 200 */ 1219, 1516, 1319, 1319, 1319, 1319, 1328, 1319, 1219, 1219,
157669
- /* 210 */ 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219,
157670
- /* 220 */ 1219, 1219, 1219, 1506, 1504, 1219, 1219, 1219, 1219, 1219,
157671
- /* 230 */ 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219,
157672
- /* 240 */ 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219,
157673
- /* 250 */ 1219, 1219, 1219, 1324, 1219, 1219, 1219, 1219, 1219, 1219,
157674
- /* 260 */ 1219, 1219, 1219, 1219, 1219, 1562, 1219, 1479, 1306, 1324,
157675
- /* 270 */ 1324, 1324, 1324, 1326, 1307, 1305, 1318, 1251, 1226, 1607,
157676
- /* 280 */ 1384, 1373, 1325, 1347, 1373, 1347, 1604, 1371, 1384, 1384,
157677
- /* 290 */ 1371, 1384, 1325, 1604, 1267, 1584, 1262, 1358, 1358, 1358,
157678
- /* 300 */ 1347, 1352, 1352, 1446, 1325, 1318, 1219, 1607, 1607, 1333,
157679
- /* 310 */ 1333, 1606, 1606, 1333, 1467, 1591, 1393, 1295, 1301, 1301,
157680
- /* 320 */ 1301, 1301, 1333, 1237, 1371, 1591, 1591, 1371, 1393, 1295,
157681
- /* 330 */ 1371, 1295, 1371, 1333, 1237, 1483, 1601, 1333, 1237, 1457,
157682
- /* 340 */ 1333, 1237, 1333, 1237, 1457, 1293, 1293, 1293, 1282, 1219,
157683
- /* 350 */ 1219, 1457, 1293, 1267, 1293, 1282, 1293, 1293, 1551, 1457,
157684
- /* 360 */ 1461, 1461, 1457, 1351, 1346, 1351, 1346, 1351, 1346, 1351,
157685
- /* 370 */ 1346, 1333, 1543, 1543, 1361, 1361, 1366, 1352, 1452, 1333,
157686
- /* 380 */ 1219, 1366, 1364, 1362, 1371, 1243, 1285, 1565, 1565, 1561,
157687
- /* 390 */ 1561, 1561, 1612, 1612, 1516, 1577, 1250, 1250, 1250, 1250,
157688
- /* 400 */ 1577, 1269, 1269, 1251, 1251, 1250, 1577, 1219, 1219, 1219,
157689
- /* 410 */ 1219, 1219, 1219, 1572, 1219, 1511, 1468, 1337, 1219, 1219,
157690
- /* 420 */ 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219,
157691
- /* 430 */ 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219,
157692
- /* 440 */ 1219, 1219, 1398, 1219, 1222, 1513, 1219, 1219, 1219, 1219,
157693
- /* 450 */ 1219, 1219, 1219, 1219, 1375, 1376, 1338, 1219, 1219, 1219,
157694
- /* 460 */ 1219, 1219, 1219, 1219, 1390, 1219, 1219, 1219, 1385, 1219,
157695
- /* 470 */ 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1603, 1219, 1219,
157696
- /* 480 */ 1219, 1219, 1219, 1219, 1482, 1481, 1219, 1219, 1335, 1219,
157697
- /* 490 */ 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219,
157698
- /* 500 */ 1219, 1219, 1265, 1219, 1219, 1219, 1219, 1219, 1219, 1219,
157699
- /* 510 */ 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219,
157700
- /* 520 */ 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1363,
157701
- /* 530 */ 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219,
157702
- /* 540 */ 1219, 1219, 1219, 1219, 1548, 1353, 1219, 1219, 1594, 1219,
157703
- /* 550 */ 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219,
157704
- /* 560 */ 1219, 1219, 1219, 1588, 1309, 1400, 1219, 1399, 1403, 1219,
157705
- /* 570 */ 1231, 1219, 1219,
157820
+ /* 0 */ 1623, 1623, 1623, 1453, 1223, 1332, 1223, 1223, 1223, 1453,
157821
+ /* 10 */ 1453, 1453, 1223, 1362, 1362, 1506, 1254, 1223, 1223, 1223,
157822
+ /* 20 */ 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1452, 1223, 1223,
157823
+ /* 30 */ 1223, 1223, 1541, 1541, 1223, 1223, 1223, 1223, 1223, 1223,
157824
+ /* 40 */ 1223, 1223, 1371, 1223, 1378, 1223, 1223, 1223, 1223, 1223,
157825
+ /* 50 */ 1454, 1455, 1223, 1223, 1223, 1505, 1507, 1470, 1385, 1384,
157826
+ /* 60 */ 1383, 1382, 1488, 1349, 1376, 1369, 1373, 1448, 1449, 1447,
157827
+ /* 70 */ 1451, 1455, 1454, 1223, 1372, 1419, 1433, 1418, 1223, 1223,
157828
+ /* 80 */ 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223,
157829
+ /* 90 */ 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223,
157830
+ /* 100 */ 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223,
157831
+ /* 110 */ 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223,
157832
+ /* 120 */ 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1427, 1432, 1438,
157833
+ /* 130 */ 1431, 1428, 1421, 1420, 1422, 1223, 1423, 1223, 1223, 1223,
157834
+ /* 140 */ 1244, 1296, 1223, 1223, 1223, 1223, 1223, 1525, 1524, 1223,
157835
+ /* 150 */ 1223, 1254, 1413, 1412, 1424, 1425, 1435, 1434, 1513, 1576,
157836
+ /* 160 */ 1575, 1471, 1223, 1223, 1223, 1223, 1223, 1223, 1541, 1223,
157837
+ /* 170 */ 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223,
157838
+ /* 180 */ 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223,
157839
+ /* 190 */ 1223, 1541, 1541, 1223, 1254, 1541, 1541, 1250, 1250, 1356,
157840
+ /* 200 */ 1223, 1520, 1323, 1323, 1323, 1323, 1332, 1323, 1223, 1223,
157841
+ /* 210 */ 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223,
157842
+ /* 220 */ 1223, 1223, 1223, 1510, 1508, 1223, 1223, 1223, 1223, 1223,
157843
+ /* 230 */ 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223,
157844
+ /* 240 */ 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223,
157845
+ /* 250 */ 1223, 1223, 1328, 1223, 1223, 1223, 1223, 1223, 1223, 1223,
157846
+ /* 260 */ 1223, 1223, 1223, 1223, 1570, 1223, 1483, 1310, 1328, 1328,
157847
+ /* 270 */ 1328, 1328, 1330, 1311, 1309, 1322, 1255, 1230, 1615, 1388,
157848
+ /* 280 */ 1377, 1329, 1351, 1377, 1351, 1612, 1375, 1388, 1388, 1375,
157849
+ /* 290 */ 1388, 1329, 1612, 1271, 1592, 1266, 1362, 1362, 1362, 1351,
157850
+ /* 300 */ 1356, 1356, 1450, 1329, 1322, 1223, 1615, 1615, 1337, 1337,
157851
+ /* 310 */ 1614, 1614, 1337, 1471, 1599, 1397, 1299, 1305, 1305, 1305,
157852
+ /* 320 */ 1305, 1337, 1241, 1375, 1599, 1599, 1375, 1397, 1299, 1375,
157853
+ /* 330 */ 1299, 1375, 1337, 1241, 1487, 1609, 1337, 1241, 1461, 1337,
157854
+ /* 340 */ 1241, 1337, 1241, 1461, 1297, 1297, 1297, 1286, 1223, 1223,
157855
+ /* 350 */ 1461, 1297, 1271, 1297, 1286, 1297, 1297, 1559, 1223, 1465,
157856
+ /* 360 */ 1465, 1461, 1355, 1350, 1355, 1350, 1355, 1350, 1355, 1350,
157857
+ /* 370 */ 1337, 1551, 1551, 1365, 1365, 1370, 1356, 1456, 1337, 1223,
157858
+ /* 380 */ 1370, 1368, 1366, 1375, 1247, 1289, 1573, 1573, 1569, 1569,
157859
+ /* 390 */ 1569, 1620, 1620, 1520, 1585, 1254, 1254, 1254, 1254, 1585,
157860
+ /* 400 */ 1273, 1273, 1255, 1255, 1254, 1585, 1223, 1223, 1223, 1223,
157861
+ /* 410 */ 1223, 1223, 1580, 1223, 1515, 1472, 1341, 1223, 1223, 1223,
157862
+ /* 420 */ 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223,
157863
+ /* 430 */ 1223, 1526, 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223,
157864
+ /* 440 */ 1223, 1223, 1402, 1223, 1226, 1517, 1223, 1223, 1223, 1223,
157865
+ /* 450 */ 1223, 1223, 1223, 1223, 1379, 1380, 1342, 1223, 1223, 1223,
157866
+ /* 460 */ 1223, 1223, 1223, 1223, 1394, 1223, 1223, 1223, 1389, 1223,
157867
+ /* 470 */ 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1611, 1223, 1223,
157868
+ /* 480 */ 1223, 1223, 1223, 1223, 1486, 1485, 1223, 1223, 1339, 1223,
157869
+ /* 490 */ 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223,
157870
+ /* 500 */ 1223, 1223, 1269, 1223, 1223, 1223, 1223, 1223, 1223, 1223,
157871
+ /* 510 */ 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223,
157872
+ /* 520 */ 1223, 1223, 1223, 1223, 1223, 1223, 1367, 1223, 1223, 1223,
157873
+ /* 530 */ 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223,
157874
+ /* 540 */ 1223, 1556, 1357, 1223, 1223, 1602, 1223, 1223, 1223, 1223,
157875
+ /* 550 */ 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223,
157876
+ /* 560 */ 1596, 1313, 1404, 1223, 1403, 1407, 1223, 1235, 1223, 1223,
157706157877
};
157707157878
/********** End of lemon-generated parsing tables *****************************/
157708157879
157709157880
/* The next table maps tokens (terminal symbols) into fallback tokens.
157710157881
** If a construct like the following:
@@ -157817,10 +157988,11 @@
157817157988
59, /* GROUPS => ID */
157818157989
59, /* OTHERS => ID */
157819157990
59, /* TIES => ID */
157820157991
59, /* GENERATED => ID */
157821157992
59, /* ALWAYS => ID */
157993
+ 59, /* MATERIALIZED => ID */
157822157994
59, /* REINDEX => ID */
157823157995
59, /* RENAME => ID */
157824157996
59, /* CTIME_KW => ID */
157825157997
0, /* ANY => nothing */
157826157998
0, /* BITAND => nothing */
@@ -158087,226 +158259,229 @@
158087158259
/* 92 */ "GROUPS",
158088158260
/* 93 */ "OTHERS",
158089158261
/* 94 */ "TIES",
158090158262
/* 95 */ "GENERATED",
158091158263
/* 96 */ "ALWAYS",
158092
- /* 97 */ "REINDEX",
158093
- /* 98 */ "RENAME",
158094
- /* 99 */ "CTIME_KW",
158095
- /* 100 */ "ANY",
158096
- /* 101 */ "BITAND",
158097
- /* 102 */ "BITOR",
158098
- /* 103 */ "LSHIFT",
158099
- /* 104 */ "RSHIFT",
158100
- /* 105 */ "PLUS",
158101
- /* 106 */ "MINUS",
158102
- /* 107 */ "STAR",
158103
- /* 108 */ "SLASH",
158104
- /* 109 */ "REM",
158105
- /* 110 */ "CONCAT",
158106
- /* 111 */ "COLLATE",
158107
- /* 112 */ "BITNOT",
158108
- /* 113 */ "ON",
158109
- /* 114 */ "INDEXED",
158110
- /* 115 */ "STRING",
158111
- /* 116 */ "JOIN_KW",
158112
- /* 117 */ "CONSTRAINT",
158113
- /* 118 */ "DEFAULT",
158114
- /* 119 */ "NULL",
158115
- /* 120 */ "PRIMARY",
158116
- /* 121 */ "UNIQUE",
158117
- /* 122 */ "CHECK",
158118
- /* 123 */ "REFERENCES",
158119
- /* 124 */ "AUTOINCR",
158120
- /* 125 */ "INSERT",
158121
- /* 126 */ "DELETE",
158122
- /* 127 */ "UPDATE",
158123
- /* 128 */ "SET",
158124
- /* 129 */ "DEFERRABLE",
158125
- /* 130 */ "FOREIGN",
158126
- /* 131 */ "DROP",
158127
- /* 132 */ "UNION",
158128
- /* 133 */ "ALL",
158129
- /* 134 */ "EXCEPT",
158130
- /* 135 */ "INTERSECT",
158131
- /* 136 */ "SELECT",
158132
- /* 137 */ "VALUES",
158133
- /* 138 */ "DISTINCT",
158134
- /* 139 */ "DOT",
158135
- /* 140 */ "FROM",
158136
- /* 141 */ "JOIN",
158137
- /* 142 */ "USING",
158138
- /* 143 */ "ORDER",
158139
- /* 144 */ "GROUP",
158140
- /* 145 */ "HAVING",
158141
- /* 146 */ "LIMIT",
158142
- /* 147 */ "WHERE",
158143
- /* 148 */ "RETURNING",
158144
- /* 149 */ "INTO",
158145
- /* 150 */ "NOTHING",
158146
- /* 151 */ "FLOAT",
158147
- /* 152 */ "BLOB",
158148
- /* 153 */ "INTEGER",
158149
- /* 154 */ "VARIABLE",
158150
- /* 155 */ "CASE",
158151
- /* 156 */ "WHEN",
158152
- /* 157 */ "THEN",
158153
- /* 158 */ "ELSE",
158154
- /* 159 */ "INDEX",
158155
- /* 160 */ "ALTER",
158156
- /* 161 */ "ADD",
158157
- /* 162 */ "WINDOW",
158158
- /* 163 */ "OVER",
158159
- /* 164 */ "FILTER",
158160
- /* 165 */ "COLUMN",
158161
- /* 166 */ "AGG_FUNCTION",
158162
- /* 167 */ "AGG_COLUMN",
158163
- /* 168 */ "TRUEFALSE",
158164
- /* 169 */ "ISNOT",
158165
- /* 170 */ "FUNCTION",
158166
- /* 171 */ "UMINUS",
158167
- /* 172 */ "UPLUS",
158168
- /* 173 */ "TRUTH",
158169
- /* 174 */ "REGISTER",
158170
- /* 175 */ "VECTOR",
158171
- /* 176 */ "SELECT_COLUMN",
158172
- /* 177 */ "IF_NULL_ROW",
158173
- /* 178 */ "ASTERISK",
158174
- /* 179 */ "SPAN",
158175
- /* 180 */ "SPACE",
158176
- /* 181 */ "ILLEGAL",
158177
- /* 182 */ "input",
158178
- /* 183 */ "cmdlist",
158179
- /* 184 */ "ecmd",
158180
- /* 185 */ "cmdx",
158181
- /* 186 */ "explain",
158182
- /* 187 */ "cmd",
158183
- /* 188 */ "transtype",
158184
- /* 189 */ "trans_opt",
158185
- /* 190 */ "nm",
158186
- /* 191 */ "savepoint_opt",
158187
- /* 192 */ "create_table",
158188
- /* 193 */ "create_table_args",
158189
- /* 194 */ "createkw",
158190
- /* 195 */ "temp",
158191
- /* 196 */ "ifnotexists",
158192
- /* 197 */ "dbnm",
158193
- /* 198 */ "columnlist",
158194
- /* 199 */ "conslist_opt",
158195
- /* 200 */ "table_options",
158196
- /* 201 */ "select",
158197
- /* 202 */ "columnname",
158198
- /* 203 */ "carglist",
158199
- /* 204 */ "typetoken",
158200
- /* 205 */ "typename",
158201
- /* 206 */ "signed",
158202
- /* 207 */ "plus_num",
158203
- /* 208 */ "minus_num",
158204
- /* 209 */ "scanpt",
158205
- /* 210 */ "scantok",
158206
- /* 211 */ "ccons",
158207
- /* 212 */ "term",
158208
- /* 213 */ "expr",
158209
- /* 214 */ "onconf",
158210
- /* 215 */ "sortorder",
158211
- /* 216 */ "autoinc",
158212
- /* 217 */ "eidlist_opt",
158213
- /* 218 */ "refargs",
158214
- /* 219 */ "defer_subclause",
158215
- /* 220 */ "generated",
158216
- /* 221 */ "refarg",
158217
- /* 222 */ "refact",
158218
- /* 223 */ "init_deferred_pred_opt",
158219
- /* 224 */ "conslist",
158220
- /* 225 */ "tconscomma",
158221
- /* 226 */ "tcons",
158222
- /* 227 */ "sortlist",
158223
- /* 228 */ "eidlist",
158224
- /* 229 */ "defer_subclause_opt",
158225
- /* 230 */ "orconf",
158226
- /* 231 */ "resolvetype",
158227
- /* 232 */ "raisetype",
158228
- /* 233 */ "ifexists",
158229
- /* 234 */ "fullname",
158230
- /* 235 */ "selectnowith",
158231
- /* 236 */ "oneselect",
158232
- /* 237 */ "wqlist",
158233
- /* 238 */ "multiselect_op",
158234
- /* 239 */ "distinct",
158235
- /* 240 */ "selcollist",
158236
- /* 241 */ "from",
158237
- /* 242 */ "where_opt",
158238
- /* 243 */ "groupby_opt",
158239
- /* 244 */ "having_opt",
158240
- /* 245 */ "orderby_opt",
158241
- /* 246 */ "limit_opt",
158242
- /* 247 */ "window_clause",
158243
- /* 248 */ "values",
158244
- /* 249 */ "nexprlist",
158245
- /* 250 */ "sclp",
158246
- /* 251 */ "as",
158247
- /* 252 */ "seltablist",
158248
- /* 253 */ "stl_prefix",
158249
- /* 254 */ "joinop",
158250
- /* 255 */ "indexed_opt",
158251
- /* 256 */ "on_opt",
158252
- /* 257 */ "using_opt",
158253
- /* 258 */ "exprlist",
158254
- /* 259 */ "xfullname",
158255
- /* 260 */ "idlist",
158256
- /* 261 */ "nulls",
158257
- /* 262 */ "with",
158258
- /* 263 */ "where_opt_ret",
158259
- /* 264 */ "setlist",
158260
- /* 265 */ "insert_cmd",
158261
- /* 266 */ "idlist_opt",
158262
- /* 267 */ "upsert",
158263
- /* 268 */ "returning",
158264
- /* 269 */ "filter_over",
158265
- /* 270 */ "likeop",
158266
- /* 271 */ "between_op",
158267
- /* 272 */ "in_op",
158268
- /* 273 */ "paren_exprlist",
158269
- /* 274 */ "case_operand",
158270
- /* 275 */ "case_exprlist",
158271
- /* 276 */ "case_else",
158272
- /* 277 */ "uniqueflag",
158273
- /* 278 */ "collate",
158274
- /* 279 */ "vinto",
158275
- /* 280 */ "nmnum",
158276
- /* 281 */ "trigger_decl",
158277
- /* 282 */ "trigger_cmd_list",
158278
- /* 283 */ "trigger_time",
158279
- /* 284 */ "trigger_event",
158280
- /* 285 */ "foreach_clause",
158281
- /* 286 */ "when_clause",
158282
- /* 287 */ "trigger_cmd",
158283
- /* 288 */ "trnm",
158284
- /* 289 */ "tridxby",
158285
- /* 290 */ "database_kw_opt",
158286
- /* 291 */ "key_opt",
158287
- /* 292 */ "add_column_fullname",
158288
- /* 293 */ "kwcolumn_opt",
158289
- /* 294 */ "create_vtab",
158290
- /* 295 */ "vtabarglist",
158291
- /* 296 */ "vtabarg",
158292
- /* 297 */ "vtabargtoken",
158293
- /* 298 */ "lp",
158294
- /* 299 */ "anylist",
158295
- /* 300 */ "windowdefn_list",
158296
- /* 301 */ "windowdefn",
158297
- /* 302 */ "window",
158298
- /* 303 */ "frame_opt",
158299
- /* 304 */ "part_opt",
158300
- /* 305 */ "filter_clause",
158301
- /* 306 */ "over_clause",
158302
- /* 307 */ "range_or_rows",
158303
- /* 308 */ "frame_bound",
158304
- /* 309 */ "frame_bound_s",
158305
- /* 310 */ "frame_bound_e",
158306
- /* 311 */ "frame_exclude_opt",
158307
- /* 312 */ "frame_exclude",
158264
+ /* 97 */ "MATERIALIZED",
158265
+ /* 98 */ "REINDEX",
158266
+ /* 99 */ "RENAME",
158267
+ /* 100 */ "CTIME_KW",
158268
+ /* 101 */ "ANY",
158269
+ /* 102 */ "BITAND",
158270
+ /* 103 */ "BITOR",
158271
+ /* 104 */ "LSHIFT",
158272
+ /* 105 */ "RSHIFT",
158273
+ /* 106 */ "PLUS",
158274
+ /* 107 */ "MINUS",
158275
+ /* 108 */ "STAR",
158276
+ /* 109 */ "SLASH",
158277
+ /* 110 */ "REM",
158278
+ /* 111 */ "CONCAT",
158279
+ /* 112 */ "COLLATE",
158280
+ /* 113 */ "BITNOT",
158281
+ /* 114 */ "ON",
158282
+ /* 115 */ "INDEXED",
158283
+ /* 116 */ "STRING",
158284
+ /* 117 */ "JOIN_KW",
158285
+ /* 118 */ "CONSTRAINT",
158286
+ /* 119 */ "DEFAULT",
158287
+ /* 120 */ "NULL",
158288
+ /* 121 */ "PRIMARY",
158289
+ /* 122 */ "UNIQUE",
158290
+ /* 123 */ "CHECK",
158291
+ /* 124 */ "REFERENCES",
158292
+ /* 125 */ "AUTOINCR",
158293
+ /* 126 */ "INSERT",
158294
+ /* 127 */ "DELETE",
158295
+ /* 128 */ "UPDATE",
158296
+ /* 129 */ "SET",
158297
+ /* 130 */ "DEFERRABLE",
158298
+ /* 131 */ "FOREIGN",
158299
+ /* 132 */ "DROP",
158300
+ /* 133 */ "UNION",
158301
+ /* 134 */ "ALL",
158302
+ /* 135 */ "EXCEPT",
158303
+ /* 136 */ "INTERSECT",
158304
+ /* 137 */ "SELECT",
158305
+ /* 138 */ "VALUES",
158306
+ /* 139 */ "DISTINCT",
158307
+ /* 140 */ "DOT",
158308
+ /* 141 */ "FROM",
158309
+ /* 142 */ "JOIN",
158310
+ /* 143 */ "USING",
158311
+ /* 144 */ "ORDER",
158312
+ /* 145 */ "GROUP",
158313
+ /* 146 */ "HAVING",
158314
+ /* 147 */ "LIMIT",
158315
+ /* 148 */ "WHERE",
158316
+ /* 149 */ "RETURNING",
158317
+ /* 150 */ "INTO",
158318
+ /* 151 */ "NOTHING",
158319
+ /* 152 */ "FLOAT",
158320
+ /* 153 */ "BLOB",
158321
+ /* 154 */ "INTEGER",
158322
+ /* 155 */ "VARIABLE",
158323
+ /* 156 */ "CASE",
158324
+ /* 157 */ "WHEN",
158325
+ /* 158 */ "THEN",
158326
+ /* 159 */ "ELSE",
158327
+ /* 160 */ "INDEX",
158328
+ /* 161 */ "ALTER",
158329
+ /* 162 */ "ADD",
158330
+ /* 163 */ "WINDOW",
158331
+ /* 164 */ "OVER",
158332
+ /* 165 */ "FILTER",
158333
+ /* 166 */ "COLUMN",
158334
+ /* 167 */ "AGG_FUNCTION",
158335
+ /* 168 */ "AGG_COLUMN",
158336
+ /* 169 */ "TRUEFALSE",
158337
+ /* 170 */ "ISNOT",
158338
+ /* 171 */ "FUNCTION",
158339
+ /* 172 */ "UMINUS",
158340
+ /* 173 */ "UPLUS",
158341
+ /* 174 */ "TRUTH",
158342
+ /* 175 */ "REGISTER",
158343
+ /* 176 */ "VECTOR",
158344
+ /* 177 */ "SELECT_COLUMN",
158345
+ /* 178 */ "IF_NULL_ROW",
158346
+ /* 179 */ "ASTERISK",
158347
+ /* 180 */ "SPAN",
158348
+ /* 181 */ "SPACE",
158349
+ /* 182 */ "ILLEGAL",
158350
+ /* 183 */ "input",
158351
+ /* 184 */ "cmdlist",
158352
+ /* 185 */ "ecmd",
158353
+ /* 186 */ "cmdx",
158354
+ /* 187 */ "explain",
158355
+ /* 188 */ "cmd",
158356
+ /* 189 */ "transtype",
158357
+ /* 190 */ "trans_opt",
158358
+ /* 191 */ "nm",
158359
+ /* 192 */ "savepoint_opt",
158360
+ /* 193 */ "create_table",
158361
+ /* 194 */ "create_table_args",
158362
+ /* 195 */ "createkw",
158363
+ /* 196 */ "temp",
158364
+ /* 197 */ "ifnotexists",
158365
+ /* 198 */ "dbnm",
158366
+ /* 199 */ "columnlist",
158367
+ /* 200 */ "conslist_opt",
158368
+ /* 201 */ "table_options",
158369
+ /* 202 */ "select",
158370
+ /* 203 */ "columnname",
158371
+ /* 204 */ "carglist",
158372
+ /* 205 */ "typetoken",
158373
+ /* 206 */ "typename",
158374
+ /* 207 */ "signed",
158375
+ /* 208 */ "plus_num",
158376
+ /* 209 */ "minus_num",
158377
+ /* 210 */ "scanpt",
158378
+ /* 211 */ "scantok",
158379
+ /* 212 */ "ccons",
158380
+ /* 213 */ "term",
158381
+ /* 214 */ "expr",
158382
+ /* 215 */ "onconf",
158383
+ /* 216 */ "sortorder",
158384
+ /* 217 */ "autoinc",
158385
+ /* 218 */ "eidlist_opt",
158386
+ /* 219 */ "refargs",
158387
+ /* 220 */ "defer_subclause",
158388
+ /* 221 */ "generated",
158389
+ /* 222 */ "refarg",
158390
+ /* 223 */ "refact",
158391
+ /* 224 */ "init_deferred_pred_opt",
158392
+ /* 225 */ "conslist",
158393
+ /* 226 */ "tconscomma",
158394
+ /* 227 */ "tcons",
158395
+ /* 228 */ "sortlist",
158396
+ /* 229 */ "eidlist",
158397
+ /* 230 */ "defer_subclause_opt",
158398
+ /* 231 */ "orconf",
158399
+ /* 232 */ "resolvetype",
158400
+ /* 233 */ "raisetype",
158401
+ /* 234 */ "ifexists",
158402
+ /* 235 */ "fullname",
158403
+ /* 236 */ "selectnowith",
158404
+ /* 237 */ "oneselect",
158405
+ /* 238 */ "wqlist",
158406
+ /* 239 */ "multiselect_op",
158407
+ /* 240 */ "distinct",
158408
+ /* 241 */ "selcollist",
158409
+ /* 242 */ "from",
158410
+ /* 243 */ "where_opt",
158411
+ /* 244 */ "groupby_opt",
158412
+ /* 245 */ "having_opt",
158413
+ /* 246 */ "orderby_opt",
158414
+ /* 247 */ "limit_opt",
158415
+ /* 248 */ "window_clause",
158416
+ /* 249 */ "values",
158417
+ /* 250 */ "nexprlist",
158418
+ /* 251 */ "sclp",
158419
+ /* 252 */ "as",
158420
+ /* 253 */ "seltablist",
158421
+ /* 254 */ "stl_prefix",
158422
+ /* 255 */ "joinop",
158423
+ /* 256 */ "indexed_opt",
158424
+ /* 257 */ "on_opt",
158425
+ /* 258 */ "using_opt",
158426
+ /* 259 */ "exprlist",
158427
+ /* 260 */ "xfullname",
158428
+ /* 261 */ "idlist",
158429
+ /* 262 */ "nulls",
158430
+ /* 263 */ "with",
158431
+ /* 264 */ "where_opt_ret",
158432
+ /* 265 */ "setlist",
158433
+ /* 266 */ "insert_cmd",
158434
+ /* 267 */ "idlist_opt",
158435
+ /* 268 */ "upsert",
158436
+ /* 269 */ "returning",
158437
+ /* 270 */ "filter_over",
158438
+ /* 271 */ "likeop",
158439
+ /* 272 */ "between_op",
158440
+ /* 273 */ "in_op",
158441
+ /* 274 */ "paren_exprlist",
158442
+ /* 275 */ "case_operand",
158443
+ /* 276 */ "case_exprlist",
158444
+ /* 277 */ "case_else",
158445
+ /* 278 */ "uniqueflag",
158446
+ /* 279 */ "collate",
158447
+ /* 280 */ "vinto",
158448
+ /* 281 */ "nmnum",
158449
+ /* 282 */ "trigger_decl",
158450
+ /* 283 */ "trigger_cmd_list",
158451
+ /* 284 */ "trigger_time",
158452
+ /* 285 */ "trigger_event",
158453
+ /* 286 */ "foreach_clause",
158454
+ /* 287 */ "when_clause",
158455
+ /* 288 */ "trigger_cmd",
158456
+ /* 289 */ "trnm",
158457
+ /* 290 */ "tridxby",
158458
+ /* 291 */ "database_kw_opt",
158459
+ /* 292 */ "key_opt",
158460
+ /* 293 */ "add_column_fullname",
158461
+ /* 294 */ "kwcolumn_opt",
158462
+ /* 295 */ "create_vtab",
158463
+ /* 296 */ "vtabarglist",
158464
+ /* 297 */ "vtabarg",
158465
+ /* 298 */ "vtabargtoken",
158466
+ /* 299 */ "lp",
158467
+ /* 300 */ "anylist",
158468
+ /* 301 */ "wqitem",
158469
+ /* 302 */ "wqas",
158470
+ /* 303 */ "windowdefn_list",
158471
+ /* 304 */ "windowdefn",
158472
+ /* 305 */ "window",
158473
+ /* 306 */ "frame_opt",
158474
+ /* 307 */ "part_opt",
158475
+ /* 308 */ "filter_clause",
158476
+ /* 309 */ "over_clause",
158477
+ /* 310 */ "range_or_rows",
158478
+ /* 311 */ "frame_bound",
158479
+ /* 312 */ "frame_bound_s",
158480
+ /* 313 */ "frame_bound_e",
158481
+ /* 314 */ "frame_exclude_opt",
158482
+ /* 315 */ "frame_exclude",
158308158483
};
158309158484
#endif /* defined(YYCOVERAGE) || !defined(NDEBUG) */
158310158485
158311158486
#ifndef NDEBUG
158312158487
/* For tracing reduce actions, the names of all rules are required.
@@ -158610,104 +158785,108 @@
158610158785
/* 295 */ "vtabargtoken ::= ANY",
158611158786
/* 296 */ "vtabargtoken ::= lp anylist RP",
158612158787
/* 297 */ "lp ::= LP",
158613158788
/* 298 */ "with ::= WITH wqlist",
158614158789
/* 299 */ "with ::= WITH RECURSIVE wqlist",
158615
- /* 300 */ "wqlist ::= nm eidlist_opt AS LP select RP",
158616
- /* 301 */ "wqlist ::= wqlist COMMA nm eidlist_opt AS LP select RP",
158617
- /* 302 */ "windowdefn_list ::= windowdefn",
158618
- /* 303 */ "windowdefn_list ::= windowdefn_list COMMA windowdefn",
158619
- /* 304 */ "windowdefn ::= nm AS LP window RP",
158620
- /* 305 */ "window ::= PARTITION BY nexprlist orderby_opt frame_opt",
158621
- /* 306 */ "window ::= nm PARTITION BY nexprlist orderby_opt frame_opt",
158622
- /* 307 */ "window ::= ORDER BY sortlist frame_opt",
158623
- /* 308 */ "window ::= nm ORDER BY sortlist frame_opt",
158624
- /* 309 */ "window ::= frame_opt",
158625
- /* 310 */ "window ::= nm frame_opt",
158626
- /* 311 */ "frame_opt ::=",
158627
- /* 312 */ "frame_opt ::= range_or_rows frame_bound_s frame_exclude_opt",
158628
- /* 313 */ "frame_opt ::= range_or_rows BETWEEN frame_bound_s AND frame_bound_e frame_exclude_opt",
158629
- /* 314 */ "range_or_rows ::= RANGE|ROWS|GROUPS",
158630
- /* 315 */ "frame_bound_s ::= frame_bound",
158631
- /* 316 */ "frame_bound_s ::= UNBOUNDED PRECEDING",
158632
- /* 317 */ "frame_bound_e ::= frame_bound",
158633
- /* 318 */ "frame_bound_e ::= UNBOUNDED FOLLOWING",
158634
- /* 319 */ "frame_bound ::= expr PRECEDING|FOLLOWING",
158635
- /* 320 */ "frame_bound ::= CURRENT ROW",
158636
- /* 321 */ "frame_exclude_opt ::=",
158637
- /* 322 */ "frame_exclude_opt ::= EXCLUDE frame_exclude",
158638
- /* 323 */ "frame_exclude ::= NO OTHERS",
158639
- /* 324 */ "frame_exclude ::= CURRENT ROW",
158640
- /* 325 */ "frame_exclude ::= GROUP|TIES",
158641
- /* 326 */ "window_clause ::= WINDOW windowdefn_list",
158642
- /* 327 */ "filter_over ::= filter_clause over_clause",
158643
- /* 328 */ "filter_over ::= over_clause",
158644
- /* 329 */ "filter_over ::= filter_clause",
158645
- /* 330 */ "over_clause ::= OVER LP window RP",
158646
- /* 331 */ "over_clause ::= OVER nm",
158647
- /* 332 */ "filter_clause ::= FILTER LP WHERE expr RP",
158648
- /* 333 */ "input ::= cmdlist",
158649
- /* 334 */ "cmdlist ::= cmdlist ecmd",
158650
- /* 335 */ "cmdlist ::= ecmd",
158651
- /* 336 */ "ecmd ::= SEMI",
158652
- /* 337 */ "ecmd ::= cmdx SEMI",
158653
- /* 338 */ "ecmd ::= explain cmdx SEMI",
158654
- /* 339 */ "trans_opt ::=",
158655
- /* 340 */ "trans_opt ::= TRANSACTION",
158656
- /* 341 */ "trans_opt ::= TRANSACTION nm",
158657
- /* 342 */ "savepoint_opt ::= SAVEPOINT",
158658
- /* 343 */ "savepoint_opt ::=",
158659
- /* 344 */ "cmd ::= create_table create_table_args",
158660
- /* 345 */ "columnlist ::= columnlist COMMA columnname carglist",
158661
- /* 346 */ "columnlist ::= columnname carglist",
158662
- /* 347 */ "nm ::= ID|INDEXED",
158663
- /* 348 */ "nm ::= STRING",
158664
- /* 349 */ "nm ::= JOIN_KW",
158665
- /* 350 */ "typetoken ::= typename",
158666
- /* 351 */ "typename ::= ID|STRING",
158667
- /* 352 */ "signed ::= plus_num",
158668
- /* 353 */ "signed ::= minus_num",
158669
- /* 354 */ "carglist ::= carglist ccons",
158670
- /* 355 */ "carglist ::=",
158671
- /* 356 */ "ccons ::= NULL onconf",
158672
- /* 357 */ "ccons ::= GENERATED ALWAYS AS generated",
158673
- /* 358 */ "ccons ::= AS generated",
158674
- /* 359 */ "conslist_opt ::= COMMA conslist",
158675
- /* 360 */ "conslist ::= conslist tconscomma tcons",
158676
- /* 361 */ "conslist ::= tcons",
158677
- /* 362 */ "tconscomma ::=",
158678
- /* 363 */ "defer_subclause_opt ::= defer_subclause",
158679
- /* 364 */ "resolvetype ::= raisetype",
158680
- /* 365 */ "selectnowith ::= oneselect",
158681
- /* 366 */ "oneselect ::= values",
158682
- /* 367 */ "sclp ::= selcollist COMMA",
158683
- /* 368 */ "as ::= ID|STRING",
158684
- /* 369 */ "returning ::=",
158685
- /* 370 */ "expr ::= term",
158686
- /* 371 */ "likeop ::= LIKE_KW|MATCH",
158687
- /* 372 */ "exprlist ::= nexprlist",
158688
- /* 373 */ "nmnum ::= plus_num",
158689
- /* 374 */ "nmnum ::= nm",
158690
- /* 375 */ "nmnum ::= ON",
158691
- /* 376 */ "nmnum ::= DELETE",
158692
- /* 377 */ "nmnum ::= DEFAULT",
158693
- /* 378 */ "plus_num ::= INTEGER|FLOAT",
158694
- /* 379 */ "foreach_clause ::=",
158695
- /* 380 */ "foreach_clause ::= FOR EACH ROW",
158696
- /* 381 */ "trnm ::= nm",
158697
- /* 382 */ "tridxby ::=",
158698
- /* 383 */ "database_kw_opt ::= DATABASE",
158699
- /* 384 */ "database_kw_opt ::=",
158700
- /* 385 */ "kwcolumn_opt ::=",
158701
- /* 386 */ "kwcolumn_opt ::= COLUMNKW",
158702
- /* 387 */ "vtabarglist ::= vtabarg",
158703
- /* 388 */ "vtabarglist ::= vtabarglist COMMA vtabarg",
158704
- /* 389 */ "vtabarg ::= vtabarg vtabargtoken",
158705
- /* 390 */ "anylist ::=",
158706
- /* 391 */ "anylist ::= anylist LP anylist RP",
158707
- /* 392 */ "anylist ::= anylist ANY",
158708
- /* 393 */ "with ::=",
158790
+ /* 300 */ "wqas ::= AS",
158791
+ /* 301 */ "wqas ::= AS MATERIALIZED",
158792
+ /* 302 */ "wqas ::= AS NOT MATERIALIZED",
158793
+ /* 303 */ "wqitem ::= nm eidlist_opt wqas LP select RP",
158794
+ /* 304 */ "wqlist ::= wqitem",
158795
+ /* 305 */ "wqlist ::= wqlist COMMA wqitem",
158796
+ /* 306 */ "windowdefn_list ::= windowdefn",
158797
+ /* 307 */ "windowdefn_list ::= windowdefn_list COMMA windowdefn",
158798
+ /* 308 */ "windowdefn ::= nm AS LP window RP",
158799
+ /* 309 */ "window ::= PARTITION BY nexprlist orderby_opt frame_opt",
158800
+ /* 310 */ "window ::= nm PARTITION BY nexprlist orderby_opt frame_opt",
158801
+ /* 311 */ "window ::= ORDER BY sortlist frame_opt",
158802
+ /* 312 */ "window ::= nm ORDER BY sortlist frame_opt",
158803
+ /* 313 */ "window ::= frame_opt",
158804
+ /* 314 */ "window ::= nm frame_opt",
158805
+ /* 315 */ "frame_opt ::=",
158806
+ /* 316 */ "frame_opt ::= range_or_rows frame_bound_s frame_exclude_opt",
158807
+ /* 317 */ "frame_opt ::= range_or_rows BETWEEN frame_bound_s AND frame_bound_e frame_exclude_opt",
158808
+ /* 318 */ "range_or_rows ::= RANGE|ROWS|GROUPS",
158809
+ /* 319 */ "frame_bound_s ::= frame_bound",
158810
+ /* 320 */ "frame_bound_s ::= UNBOUNDED PRECEDING",
158811
+ /* 321 */ "frame_bound_e ::= frame_bound",
158812
+ /* 322 */ "frame_bound_e ::= UNBOUNDED FOLLOWING",
158813
+ /* 323 */ "frame_bound ::= expr PRECEDING|FOLLOWING",
158814
+ /* 324 */ "frame_bound ::= CURRENT ROW",
158815
+ /* 325 */ "frame_exclude_opt ::=",
158816
+ /* 326 */ "frame_exclude_opt ::= EXCLUDE frame_exclude",
158817
+ /* 327 */ "frame_exclude ::= NO OTHERS",
158818
+ /* 328 */ "frame_exclude ::= CURRENT ROW",
158819
+ /* 329 */ "frame_exclude ::= GROUP|TIES",
158820
+ /* 330 */ "window_clause ::= WINDOW windowdefn_list",
158821
+ /* 331 */ "filter_over ::= filter_clause over_clause",
158822
+ /* 332 */ "filter_over ::= over_clause",
158823
+ /* 333 */ "filter_over ::= filter_clause",
158824
+ /* 334 */ "over_clause ::= OVER LP window RP",
158825
+ /* 335 */ "over_clause ::= OVER nm",
158826
+ /* 336 */ "filter_clause ::= FILTER LP WHERE expr RP",
158827
+ /* 337 */ "input ::= cmdlist",
158828
+ /* 338 */ "cmdlist ::= cmdlist ecmd",
158829
+ /* 339 */ "cmdlist ::= ecmd",
158830
+ /* 340 */ "ecmd ::= SEMI",
158831
+ /* 341 */ "ecmd ::= cmdx SEMI",
158832
+ /* 342 */ "ecmd ::= explain cmdx SEMI",
158833
+ /* 343 */ "trans_opt ::=",
158834
+ /* 344 */ "trans_opt ::= TRANSACTION",
158835
+ /* 345 */ "trans_opt ::= TRANSACTION nm",
158836
+ /* 346 */ "savepoint_opt ::= SAVEPOINT",
158837
+ /* 347 */ "savepoint_opt ::=",
158838
+ /* 348 */ "cmd ::= create_table create_table_args",
158839
+ /* 349 */ "columnlist ::= columnlist COMMA columnname carglist",
158840
+ /* 350 */ "columnlist ::= columnname carglist",
158841
+ /* 351 */ "nm ::= ID|INDEXED",
158842
+ /* 352 */ "nm ::= STRING",
158843
+ /* 353 */ "nm ::= JOIN_KW",
158844
+ /* 354 */ "typetoken ::= typename",
158845
+ /* 355 */ "typename ::= ID|STRING",
158846
+ /* 356 */ "signed ::= plus_num",
158847
+ /* 357 */ "signed ::= minus_num",
158848
+ /* 358 */ "carglist ::= carglist ccons",
158849
+ /* 359 */ "carglist ::=",
158850
+ /* 360 */ "ccons ::= NULL onconf",
158851
+ /* 361 */ "ccons ::= GENERATED ALWAYS AS generated",
158852
+ /* 362 */ "ccons ::= AS generated",
158853
+ /* 363 */ "conslist_opt ::= COMMA conslist",
158854
+ /* 364 */ "conslist ::= conslist tconscomma tcons",
158855
+ /* 365 */ "conslist ::= tcons",
158856
+ /* 366 */ "tconscomma ::=",
158857
+ /* 367 */ "defer_subclause_opt ::= defer_subclause",
158858
+ /* 368 */ "resolvetype ::= raisetype",
158859
+ /* 369 */ "selectnowith ::= oneselect",
158860
+ /* 370 */ "oneselect ::= values",
158861
+ /* 371 */ "sclp ::= selcollist COMMA",
158862
+ /* 372 */ "as ::= ID|STRING",
158863
+ /* 373 */ "returning ::=",
158864
+ /* 374 */ "expr ::= term",
158865
+ /* 375 */ "likeop ::= LIKE_KW|MATCH",
158866
+ /* 376 */ "exprlist ::= nexprlist",
158867
+ /* 377 */ "nmnum ::= plus_num",
158868
+ /* 378 */ "nmnum ::= nm",
158869
+ /* 379 */ "nmnum ::= ON",
158870
+ /* 380 */ "nmnum ::= DELETE",
158871
+ /* 381 */ "nmnum ::= DEFAULT",
158872
+ /* 382 */ "plus_num ::= INTEGER|FLOAT",
158873
+ /* 383 */ "foreach_clause ::=",
158874
+ /* 384 */ "foreach_clause ::= FOR EACH ROW",
158875
+ /* 385 */ "trnm ::= nm",
158876
+ /* 386 */ "tridxby ::=",
158877
+ /* 387 */ "database_kw_opt ::= DATABASE",
158878
+ /* 388 */ "database_kw_opt ::=",
158879
+ /* 389 */ "kwcolumn_opt ::=",
158880
+ /* 390 */ "kwcolumn_opt ::= COLUMNKW",
158881
+ /* 391 */ "vtabarglist ::= vtabarg",
158882
+ /* 392 */ "vtabarglist ::= vtabarglist COMMA vtabarg",
158883
+ /* 393 */ "vtabarg ::= vtabarg vtabargtoken",
158884
+ /* 394 */ "anylist ::=",
158885
+ /* 395 */ "anylist ::= anylist LP anylist RP",
158886
+ /* 396 */ "anylist ::= anylist ANY",
158887
+ /* 397 */ "with ::=",
158709158888
};
158710158889
#endif /* NDEBUG */
158711158890
158712158891
158713158892
#if YYSTACKDEPTH<=0
@@ -158829,103 +159008,103 @@
158829159008
** Note: during a reduce, the only symbols destroyed are those
158830159009
** which appear on the RHS of the rule, but which are *not* used
158831159010
** inside the C code.
158832159011
*/
158833159012
/********* Begin destructor definitions ***************************************/
158834
- case 201: /* select */
158835
- case 235: /* selectnowith */
158836
- case 236: /* oneselect */
158837
- case 248: /* values */
158838
-{
158839
-sqlite3SelectDelete(pParse->db, (yypminor->yy293));
158840
-}
158841
- break;
158842
- case 212: /* term */
158843
- case 213: /* expr */
158844
- case 242: /* where_opt */
158845
- case 244: /* having_opt */
158846
- case 256: /* on_opt */
158847
- case 263: /* where_opt_ret */
158848
- case 274: /* case_operand */
158849
- case 276: /* case_else */
158850
- case 279: /* vinto */
158851
- case 286: /* when_clause */
158852
- case 291: /* key_opt */
158853
- case 305: /* filter_clause */
158854
-{
158855
-sqlite3ExprDelete(pParse->db, (yypminor->yy354));
158856
-}
158857
- break;
158858
- case 217: /* eidlist_opt */
158859
- case 227: /* sortlist */
158860
- case 228: /* eidlist */
158861
- case 240: /* selcollist */
158862
- case 243: /* groupby_opt */
158863
- case 245: /* orderby_opt */
158864
- case 249: /* nexprlist */
158865
- case 250: /* sclp */
158866
- case 258: /* exprlist */
158867
- case 264: /* setlist */
158868
- case 273: /* paren_exprlist */
158869
- case 275: /* case_exprlist */
158870
- case 304: /* part_opt */
158871
-{
158872
-sqlite3ExprListDelete(pParse->db, (yypminor->yy350));
158873
-}
158874
- break;
158875
- case 234: /* fullname */
158876
- case 241: /* from */
158877
- case 252: /* seltablist */
158878
- case 253: /* stl_prefix */
158879
- case 259: /* xfullname */
158880
-{
158881
-sqlite3SrcListDelete(pParse->db, (yypminor->yy457));
158882
-}
158883
- break;
158884
- case 237: /* wqlist */
158885
-{
158886
-sqlite3WithDelete(pParse->db, (yypminor->yy105));
158887
-}
158888
- break;
158889
- case 247: /* window_clause */
158890
- case 300: /* windowdefn_list */
158891
-{
158892
-sqlite3WindowListDelete(pParse->db, (yypminor->yy503));
158893
-}
158894
- break;
158895
- case 257: /* using_opt */
158896
- case 260: /* idlist */
158897
- case 266: /* idlist_opt */
158898
-{
158899
-sqlite3IdListDelete(pParse->db, (yypminor->yy498));
158900
-}
158901
- break;
158902
- case 269: /* filter_over */
158903
- case 301: /* windowdefn */
158904
- case 302: /* window */
158905
- case 303: /* frame_opt */
158906
- case 306: /* over_clause */
158907
-{
158908
-sqlite3WindowDelete(pParse->db, (yypminor->yy503));
158909
-}
158910
- break;
158911
- case 282: /* trigger_cmd_list */
158912
- case 287: /* trigger_cmd */
158913
-{
158914
-sqlite3DeleteTriggerStep(pParse->db, (yypminor->yy51));
158915
-}
158916
- break;
158917
- case 284: /* trigger_event */
158918
-{
158919
-sqlite3IdListDelete(pParse->db, (yypminor->yy298).b);
158920
-}
158921
- break;
158922
- case 308: /* frame_bound */
158923
- case 309: /* frame_bound_s */
158924
- case 310: /* frame_bound_e */
158925
-{
158926
-sqlite3ExprDelete(pParse->db, (yypminor->yy341).pExpr);
159013
+ case 202: /* select */
159014
+ case 236: /* selectnowith */
159015
+ case 237: /* oneselect */
159016
+ case 249: /* values */
159017
+{
159018
+sqlite3SelectDelete(pParse->db, (yypminor->yy307));
159019
+}
159020
+ break;
159021
+ case 213: /* term */
159022
+ case 214: /* expr */
159023
+ case 243: /* where_opt */
159024
+ case 245: /* having_opt */
159025
+ case 257: /* on_opt */
159026
+ case 264: /* where_opt_ret */
159027
+ case 275: /* case_operand */
159028
+ case 277: /* case_else */
159029
+ case 280: /* vinto */
159030
+ case 287: /* when_clause */
159031
+ case 292: /* key_opt */
159032
+ case 308: /* filter_clause */
159033
+{
159034
+sqlite3ExprDelete(pParse->db, (yypminor->yy602));
159035
+}
159036
+ break;
159037
+ case 218: /* eidlist_opt */
159038
+ case 228: /* sortlist */
159039
+ case 229: /* eidlist */
159040
+ case 241: /* selcollist */
159041
+ case 244: /* groupby_opt */
159042
+ case 246: /* orderby_opt */
159043
+ case 250: /* nexprlist */
159044
+ case 251: /* sclp */
159045
+ case 259: /* exprlist */
159046
+ case 265: /* setlist */
159047
+ case 274: /* paren_exprlist */
159048
+ case 276: /* case_exprlist */
159049
+ case 307: /* part_opt */
159050
+{
159051
+sqlite3ExprListDelete(pParse->db, (yypminor->yy338));
159052
+}
159053
+ break;
159054
+ case 235: /* fullname */
159055
+ case 242: /* from */
159056
+ case 253: /* seltablist */
159057
+ case 254: /* stl_prefix */
159058
+ case 260: /* xfullname */
159059
+{
159060
+sqlite3SrcListDelete(pParse->db, (yypminor->yy291));
159061
+}
159062
+ break;
159063
+ case 238: /* wqlist */
159064
+{
159065
+sqlite3WithDelete(pParse->db, (yypminor->yy195));
159066
+}
159067
+ break;
159068
+ case 248: /* window_clause */
159069
+ case 303: /* windowdefn_list */
159070
+{
159071
+sqlite3WindowListDelete(pParse->db, (yypminor->yy19));
159072
+}
159073
+ break;
159074
+ case 258: /* using_opt */
159075
+ case 261: /* idlist */
159076
+ case 267: /* idlist_opt */
159077
+{
159078
+sqlite3IdListDelete(pParse->db, (yypminor->yy288));
159079
+}
159080
+ break;
159081
+ case 270: /* filter_over */
159082
+ case 304: /* windowdefn */
159083
+ case 305: /* window */
159084
+ case 306: /* frame_opt */
159085
+ case 309: /* over_clause */
159086
+{
159087
+sqlite3WindowDelete(pParse->db, (yypminor->yy19));
159088
+}
159089
+ break;
159090
+ case 283: /* trigger_cmd_list */
159091
+ case 288: /* trigger_cmd */
159092
+{
159093
+sqlite3DeleteTriggerStep(pParse->db, (yypminor->yy483));
159094
+}
159095
+ break;
159096
+ case 285: /* trigger_event */
159097
+{
159098
+sqlite3IdListDelete(pParse->db, (yypminor->yy50).b);
159099
+}
159100
+ break;
159101
+ case 311: /* frame_bound */
159102
+ case 312: /* frame_bound_s */
159103
+ case 313: /* frame_bound_e */
159104
+{
159105
+sqlite3ExprDelete(pParse->db, (yypminor->yy113).pExpr);
158927159106
}
158928159107
break;
158929159108
/********* End destructor definitions *****************************************/
158930159109
default: break; /* If no destructor action specified: do nothing */
158931159110
}
@@ -159212,404 +159391,408 @@
159212159391
}
159213159392
159214159393
/* For rule J, yyRuleInfoLhs[J] contains the symbol on the left-hand side
159215159394
** of that rule */
159216159395
static const YYCODETYPE yyRuleInfoLhs[] = {
159217
- 186, /* (0) explain ::= EXPLAIN */
159218
- 186, /* (1) explain ::= EXPLAIN QUERY PLAN */
159219
- 185, /* (2) cmdx ::= cmd */
159220
- 187, /* (3) cmd ::= BEGIN transtype trans_opt */
159221
- 188, /* (4) transtype ::= */
159222
- 188, /* (5) transtype ::= DEFERRED */
159223
- 188, /* (6) transtype ::= IMMEDIATE */
159224
- 188, /* (7) transtype ::= EXCLUSIVE */
159225
- 187, /* (8) cmd ::= COMMIT|END trans_opt */
159226
- 187, /* (9) cmd ::= ROLLBACK trans_opt */
159227
- 187, /* (10) cmd ::= SAVEPOINT nm */
159228
- 187, /* (11) cmd ::= RELEASE savepoint_opt nm */
159229
- 187, /* (12) cmd ::= ROLLBACK trans_opt TO savepoint_opt nm */
159230
- 192, /* (13) create_table ::= createkw temp TABLE ifnotexists nm dbnm */
159231
- 194, /* (14) createkw ::= CREATE */
159232
- 196, /* (15) ifnotexists ::= */
159233
- 196, /* (16) ifnotexists ::= IF NOT EXISTS */
159234
- 195, /* (17) temp ::= TEMP */
159235
- 195, /* (18) temp ::= */
159236
- 193, /* (19) create_table_args ::= LP columnlist conslist_opt RP table_options */
159237
- 193, /* (20) create_table_args ::= AS select */
159238
- 200, /* (21) table_options ::= */
159239
- 200, /* (22) table_options ::= WITHOUT nm */
159240
- 202, /* (23) columnname ::= nm typetoken */
159241
- 204, /* (24) typetoken ::= */
159242
- 204, /* (25) typetoken ::= typename LP signed RP */
159243
- 204, /* (26) typetoken ::= typename LP signed COMMA signed RP */
159244
- 205, /* (27) typename ::= typename ID|STRING */
159245
- 209, /* (28) scanpt ::= */
159246
- 210, /* (29) scantok ::= */
159247
- 211, /* (30) ccons ::= CONSTRAINT nm */
159248
- 211, /* (31) ccons ::= DEFAULT scantok term */
159249
- 211, /* (32) ccons ::= DEFAULT LP expr RP */
159250
- 211, /* (33) ccons ::= DEFAULT PLUS scantok term */
159251
- 211, /* (34) ccons ::= DEFAULT MINUS scantok term */
159252
- 211, /* (35) ccons ::= DEFAULT scantok ID|INDEXED */
159253
- 211, /* (36) ccons ::= NOT NULL onconf */
159254
- 211, /* (37) ccons ::= PRIMARY KEY sortorder onconf autoinc */
159255
- 211, /* (38) ccons ::= UNIQUE onconf */
159256
- 211, /* (39) ccons ::= CHECK LP expr RP */
159257
- 211, /* (40) ccons ::= REFERENCES nm eidlist_opt refargs */
159258
- 211, /* (41) ccons ::= defer_subclause */
159259
- 211, /* (42) ccons ::= COLLATE ID|STRING */
159260
- 220, /* (43) generated ::= LP expr RP */
159261
- 220, /* (44) generated ::= LP expr RP ID */
159262
- 216, /* (45) autoinc ::= */
159263
- 216, /* (46) autoinc ::= AUTOINCR */
159264
- 218, /* (47) refargs ::= */
159265
- 218, /* (48) refargs ::= refargs refarg */
159266
- 221, /* (49) refarg ::= MATCH nm */
159267
- 221, /* (50) refarg ::= ON INSERT refact */
159268
- 221, /* (51) refarg ::= ON DELETE refact */
159269
- 221, /* (52) refarg ::= ON UPDATE refact */
159270
- 222, /* (53) refact ::= SET NULL */
159271
- 222, /* (54) refact ::= SET DEFAULT */
159272
- 222, /* (55) refact ::= CASCADE */
159273
- 222, /* (56) refact ::= RESTRICT */
159274
- 222, /* (57) refact ::= NO ACTION */
159275
- 219, /* (58) defer_subclause ::= NOT DEFERRABLE init_deferred_pred_opt */
159276
- 219, /* (59) defer_subclause ::= DEFERRABLE init_deferred_pred_opt */
159277
- 223, /* (60) init_deferred_pred_opt ::= */
159278
- 223, /* (61) init_deferred_pred_opt ::= INITIALLY DEFERRED */
159279
- 223, /* (62) init_deferred_pred_opt ::= INITIALLY IMMEDIATE */
159280
- 199, /* (63) conslist_opt ::= */
159281
- 225, /* (64) tconscomma ::= COMMA */
159282
- 226, /* (65) tcons ::= CONSTRAINT nm */
159283
- 226, /* (66) tcons ::= PRIMARY KEY LP sortlist autoinc RP onconf */
159284
- 226, /* (67) tcons ::= UNIQUE LP sortlist RP onconf */
159285
- 226, /* (68) tcons ::= CHECK LP expr RP onconf */
159286
- 226, /* (69) tcons ::= FOREIGN KEY LP eidlist RP REFERENCES nm eidlist_opt refargs defer_subclause_opt */
159287
- 229, /* (70) defer_subclause_opt ::= */
159288
- 214, /* (71) onconf ::= */
159289
- 214, /* (72) onconf ::= ON CONFLICT resolvetype */
159290
- 230, /* (73) orconf ::= */
159291
- 230, /* (74) orconf ::= OR resolvetype */
159292
- 231, /* (75) resolvetype ::= IGNORE */
159293
- 231, /* (76) resolvetype ::= REPLACE */
159294
- 187, /* (77) cmd ::= DROP TABLE ifexists fullname */
159295
- 233, /* (78) ifexists ::= IF EXISTS */
159296
- 233, /* (79) ifexists ::= */
159297
- 187, /* (80) cmd ::= createkw temp VIEW ifnotexists nm dbnm eidlist_opt AS select */
159298
- 187, /* (81) cmd ::= DROP VIEW ifexists fullname */
159299
- 187, /* (82) cmd ::= select */
159300
- 201, /* (83) select ::= WITH wqlist selectnowith */
159301
- 201, /* (84) select ::= WITH RECURSIVE wqlist selectnowith */
159302
- 201, /* (85) select ::= selectnowith */
159303
- 235, /* (86) selectnowith ::= selectnowith multiselect_op oneselect */
159304
- 238, /* (87) multiselect_op ::= UNION */
159305
- 238, /* (88) multiselect_op ::= UNION ALL */
159306
- 238, /* (89) multiselect_op ::= EXCEPT|INTERSECT */
159307
- 236, /* (90) oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt orderby_opt limit_opt */
159308
- 236, /* (91) oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt window_clause orderby_opt limit_opt */
159309
- 248, /* (92) values ::= VALUES LP nexprlist RP */
159310
- 248, /* (93) values ::= values COMMA LP nexprlist RP */
159311
- 239, /* (94) distinct ::= DISTINCT */
159312
- 239, /* (95) distinct ::= ALL */
159313
- 239, /* (96) distinct ::= */
159314
- 250, /* (97) sclp ::= */
159315
- 240, /* (98) selcollist ::= sclp scanpt expr scanpt as */
159316
- 240, /* (99) selcollist ::= sclp scanpt STAR */
159317
- 240, /* (100) selcollist ::= sclp scanpt nm DOT STAR */
159318
- 251, /* (101) as ::= AS nm */
159319
- 251, /* (102) as ::= */
159320
- 241, /* (103) from ::= */
159321
- 241, /* (104) from ::= FROM seltablist */
159322
- 253, /* (105) stl_prefix ::= seltablist joinop */
159323
- 253, /* (106) stl_prefix ::= */
159324
- 252, /* (107) seltablist ::= stl_prefix nm dbnm as indexed_opt on_opt using_opt */
159325
- 252, /* (108) seltablist ::= stl_prefix nm dbnm LP exprlist RP as on_opt using_opt */
159326
- 252, /* (109) seltablist ::= stl_prefix LP select RP as on_opt using_opt */
159327
- 252, /* (110) seltablist ::= stl_prefix LP seltablist RP as on_opt using_opt */
159328
- 197, /* (111) dbnm ::= */
159329
- 197, /* (112) dbnm ::= DOT nm */
159330
- 234, /* (113) fullname ::= nm */
159331
- 234, /* (114) fullname ::= nm DOT nm */
159332
- 259, /* (115) xfullname ::= nm */
159333
- 259, /* (116) xfullname ::= nm DOT nm */
159334
- 259, /* (117) xfullname ::= nm DOT nm AS nm */
159335
- 259, /* (118) xfullname ::= nm AS nm */
159336
- 254, /* (119) joinop ::= COMMA|JOIN */
159337
- 254, /* (120) joinop ::= JOIN_KW JOIN */
159338
- 254, /* (121) joinop ::= JOIN_KW nm JOIN */
159339
- 254, /* (122) joinop ::= JOIN_KW nm nm JOIN */
159340
- 256, /* (123) on_opt ::= ON expr */
159341
- 256, /* (124) on_opt ::= */
159342
- 255, /* (125) indexed_opt ::= */
159343
- 255, /* (126) indexed_opt ::= INDEXED BY nm */
159344
- 255, /* (127) indexed_opt ::= NOT INDEXED */
159345
- 257, /* (128) using_opt ::= USING LP idlist RP */
159346
- 257, /* (129) using_opt ::= */
159347
- 245, /* (130) orderby_opt ::= */
159348
- 245, /* (131) orderby_opt ::= ORDER BY sortlist */
159349
- 227, /* (132) sortlist ::= sortlist COMMA expr sortorder nulls */
159350
- 227, /* (133) sortlist ::= expr sortorder nulls */
159351
- 215, /* (134) sortorder ::= ASC */
159352
- 215, /* (135) sortorder ::= DESC */
159353
- 215, /* (136) sortorder ::= */
159354
- 261, /* (137) nulls ::= NULLS FIRST */
159355
- 261, /* (138) nulls ::= NULLS LAST */
159356
- 261, /* (139) nulls ::= */
159357
- 243, /* (140) groupby_opt ::= */
159358
- 243, /* (141) groupby_opt ::= GROUP BY nexprlist */
159359
- 244, /* (142) having_opt ::= */
159360
- 244, /* (143) having_opt ::= HAVING expr */
159361
- 246, /* (144) limit_opt ::= */
159362
- 246, /* (145) limit_opt ::= LIMIT expr */
159363
- 246, /* (146) limit_opt ::= LIMIT expr OFFSET expr */
159364
- 246, /* (147) limit_opt ::= LIMIT expr COMMA expr */
159365
- 187, /* (148) cmd ::= with DELETE FROM xfullname indexed_opt where_opt_ret */
159366
- 242, /* (149) where_opt ::= */
159367
- 242, /* (150) where_opt ::= WHERE expr */
159368
- 263, /* (151) where_opt_ret ::= */
159369
- 263, /* (152) where_opt_ret ::= WHERE expr */
159370
- 263, /* (153) where_opt_ret ::= RETURNING selcollist */
159371
- 263, /* (154) where_opt_ret ::= WHERE expr RETURNING selcollist */
159372
- 187, /* (155) cmd ::= with UPDATE orconf xfullname indexed_opt SET setlist from where_opt_ret */
159373
- 264, /* (156) setlist ::= setlist COMMA nm EQ expr */
159374
- 264, /* (157) setlist ::= setlist COMMA LP idlist RP EQ expr */
159375
- 264, /* (158) setlist ::= nm EQ expr */
159376
- 264, /* (159) setlist ::= LP idlist RP EQ expr */
159377
- 187, /* (160) cmd ::= with insert_cmd INTO xfullname idlist_opt select upsert */
159378
- 187, /* (161) cmd ::= with insert_cmd INTO xfullname idlist_opt DEFAULT VALUES returning */
159379
- 267, /* (162) upsert ::= */
159380
- 267, /* (163) upsert ::= RETURNING selcollist */
159381
- 267, /* (164) upsert ::= ON CONFLICT LP sortlist RP where_opt DO UPDATE SET setlist where_opt upsert */
159382
- 267, /* (165) upsert ::= ON CONFLICT LP sortlist RP where_opt DO NOTHING upsert */
159383
- 267, /* (166) upsert ::= ON CONFLICT DO NOTHING returning */
159384
- 267, /* (167) upsert ::= ON CONFLICT DO UPDATE SET setlist where_opt returning */
159385
- 268, /* (168) returning ::= RETURNING selcollist */
159386
- 265, /* (169) insert_cmd ::= INSERT orconf */
159387
- 265, /* (170) insert_cmd ::= REPLACE */
159388
- 266, /* (171) idlist_opt ::= */
159389
- 266, /* (172) idlist_opt ::= LP idlist RP */
159390
- 260, /* (173) idlist ::= idlist COMMA nm */
159391
- 260, /* (174) idlist ::= nm */
159392
- 213, /* (175) expr ::= LP expr RP */
159393
- 213, /* (176) expr ::= ID|INDEXED */
159394
- 213, /* (177) expr ::= JOIN_KW */
159395
- 213, /* (178) expr ::= nm DOT nm */
159396
- 213, /* (179) expr ::= nm DOT nm DOT nm */
159397
- 212, /* (180) term ::= NULL|FLOAT|BLOB */
159398
- 212, /* (181) term ::= STRING */
159399
- 212, /* (182) term ::= INTEGER */
159400
- 213, /* (183) expr ::= VARIABLE */
159401
- 213, /* (184) expr ::= expr COLLATE ID|STRING */
159402
- 213, /* (185) expr ::= CAST LP expr AS typetoken RP */
159403
- 213, /* (186) expr ::= ID|INDEXED LP distinct exprlist RP */
159404
- 213, /* (187) expr ::= ID|INDEXED LP STAR RP */
159405
- 213, /* (188) expr ::= ID|INDEXED LP distinct exprlist RP filter_over */
159406
- 213, /* (189) expr ::= ID|INDEXED LP STAR RP filter_over */
159407
- 212, /* (190) term ::= CTIME_KW */
159408
- 213, /* (191) expr ::= LP nexprlist COMMA expr RP */
159409
- 213, /* (192) expr ::= expr AND expr */
159410
- 213, /* (193) expr ::= expr OR expr */
159411
- 213, /* (194) expr ::= expr LT|GT|GE|LE expr */
159412
- 213, /* (195) expr ::= expr EQ|NE expr */
159413
- 213, /* (196) expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr */
159414
- 213, /* (197) expr ::= expr PLUS|MINUS expr */
159415
- 213, /* (198) expr ::= expr STAR|SLASH|REM expr */
159416
- 213, /* (199) expr ::= expr CONCAT expr */
159417
- 270, /* (200) likeop ::= NOT LIKE_KW|MATCH */
159418
- 213, /* (201) expr ::= expr likeop expr */
159419
- 213, /* (202) expr ::= expr likeop expr ESCAPE expr */
159420
- 213, /* (203) expr ::= expr ISNULL|NOTNULL */
159421
- 213, /* (204) expr ::= expr NOT NULL */
159422
- 213, /* (205) expr ::= expr IS expr */
159423
- 213, /* (206) expr ::= expr IS NOT expr */
159424
- 213, /* (207) expr ::= NOT expr */
159425
- 213, /* (208) expr ::= BITNOT expr */
159426
- 213, /* (209) expr ::= PLUS|MINUS expr */
159427
- 271, /* (210) between_op ::= BETWEEN */
159428
- 271, /* (211) between_op ::= NOT BETWEEN */
159429
- 213, /* (212) expr ::= expr between_op expr AND expr */
159430
- 272, /* (213) in_op ::= IN */
159431
- 272, /* (214) in_op ::= NOT IN */
159432
- 213, /* (215) expr ::= expr in_op LP exprlist RP */
159433
- 213, /* (216) expr ::= LP select RP */
159434
- 213, /* (217) expr ::= expr in_op LP select RP */
159435
- 213, /* (218) expr ::= expr in_op nm dbnm paren_exprlist */
159436
- 213, /* (219) expr ::= EXISTS LP select RP */
159437
- 213, /* (220) expr ::= CASE case_operand case_exprlist case_else END */
159438
- 275, /* (221) case_exprlist ::= case_exprlist WHEN expr THEN expr */
159439
- 275, /* (222) case_exprlist ::= WHEN expr THEN expr */
159440
- 276, /* (223) case_else ::= ELSE expr */
159441
- 276, /* (224) case_else ::= */
159442
- 274, /* (225) case_operand ::= expr */
159443
- 274, /* (226) case_operand ::= */
159444
- 258, /* (227) exprlist ::= */
159445
- 249, /* (228) nexprlist ::= nexprlist COMMA expr */
159446
- 249, /* (229) nexprlist ::= expr */
159447
- 273, /* (230) paren_exprlist ::= */
159448
- 273, /* (231) paren_exprlist ::= LP exprlist RP */
159449
- 187, /* (232) cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP sortlist RP where_opt */
159450
- 277, /* (233) uniqueflag ::= UNIQUE */
159451
- 277, /* (234) uniqueflag ::= */
159452
- 217, /* (235) eidlist_opt ::= */
159453
- 217, /* (236) eidlist_opt ::= LP eidlist RP */
159454
- 228, /* (237) eidlist ::= eidlist COMMA nm collate sortorder */
159455
- 228, /* (238) eidlist ::= nm collate sortorder */
159456
- 278, /* (239) collate ::= */
159457
- 278, /* (240) collate ::= COLLATE ID|STRING */
159458
- 187, /* (241) cmd ::= DROP INDEX ifexists fullname */
159459
- 187, /* (242) cmd ::= VACUUM vinto */
159460
- 187, /* (243) cmd ::= VACUUM nm vinto */
159461
- 279, /* (244) vinto ::= INTO expr */
159462
- 279, /* (245) vinto ::= */
159463
- 187, /* (246) cmd ::= PRAGMA nm dbnm */
159464
- 187, /* (247) cmd ::= PRAGMA nm dbnm EQ nmnum */
159465
- 187, /* (248) cmd ::= PRAGMA nm dbnm LP nmnum RP */
159466
- 187, /* (249) cmd ::= PRAGMA nm dbnm EQ minus_num */
159467
- 187, /* (250) cmd ::= PRAGMA nm dbnm LP minus_num RP */
159468
- 207, /* (251) plus_num ::= PLUS INTEGER|FLOAT */
159469
- 208, /* (252) minus_num ::= MINUS INTEGER|FLOAT */
159470
- 187, /* (253) cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END */
159471
- 281, /* (254) trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause */
159472
- 283, /* (255) trigger_time ::= BEFORE|AFTER */
159473
- 283, /* (256) trigger_time ::= INSTEAD OF */
159474
- 283, /* (257) trigger_time ::= */
159475
- 284, /* (258) trigger_event ::= DELETE|INSERT */
159476
- 284, /* (259) trigger_event ::= UPDATE */
159477
- 284, /* (260) trigger_event ::= UPDATE OF idlist */
159478
- 286, /* (261) when_clause ::= */
159479
- 286, /* (262) when_clause ::= WHEN expr */
159480
- 282, /* (263) trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI */
159481
- 282, /* (264) trigger_cmd_list ::= trigger_cmd SEMI */
159482
- 288, /* (265) trnm ::= nm DOT nm */
159483
- 289, /* (266) tridxby ::= INDEXED BY nm */
159484
- 289, /* (267) tridxby ::= NOT INDEXED */
159485
- 287, /* (268) trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist from where_opt scanpt */
159486
- 287, /* (269) trigger_cmd ::= scanpt insert_cmd INTO trnm idlist_opt select upsert scanpt */
159487
- 287, /* (270) trigger_cmd ::= DELETE FROM trnm tridxby where_opt scanpt */
159488
- 287, /* (271) trigger_cmd ::= scanpt select scanpt */
159489
- 213, /* (272) expr ::= RAISE LP IGNORE RP */
159490
- 213, /* (273) expr ::= RAISE LP raisetype COMMA nm RP */
159491
- 232, /* (274) raisetype ::= ROLLBACK */
159492
- 232, /* (275) raisetype ::= ABORT */
159493
- 232, /* (276) raisetype ::= FAIL */
159494
- 187, /* (277) cmd ::= DROP TRIGGER ifexists fullname */
159495
- 187, /* (278) cmd ::= ATTACH database_kw_opt expr AS expr key_opt */
159496
- 187, /* (279) cmd ::= DETACH database_kw_opt expr */
159497
- 291, /* (280) key_opt ::= */
159498
- 291, /* (281) key_opt ::= KEY expr */
159499
- 187, /* (282) cmd ::= REINDEX */
159500
- 187, /* (283) cmd ::= REINDEX nm dbnm */
159501
- 187, /* (284) cmd ::= ANALYZE */
159502
- 187, /* (285) cmd ::= ANALYZE nm dbnm */
159503
- 187, /* (286) cmd ::= ALTER TABLE fullname RENAME TO nm */
159504
- 187, /* (287) cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt columnname carglist */
159505
- 187, /* (288) cmd ::= ALTER TABLE fullname DROP kwcolumn_opt nm */
159506
- 292, /* (289) add_column_fullname ::= fullname */
159507
- 187, /* (290) cmd ::= ALTER TABLE fullname RENAME kwcolumn_opt nm TO nm */
159508
- 187, /* (291) cmd ::= create_vtab */
159509
- 187, /* (292) cmd ::= create_vtab LP vtabarglist RP */
159510
- 294, /* (293) create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm */
159511
- 296, /* (294) vtabarg ::= */
159512
- 297, /* (295) vtabargtoken ::= ANY */
159513
- 297, /* (296) vtabargtoken ::= lp anylist RP */
159514
- 298, /* (297) lp ::= LP */
159515
- 262, /* (298) with ::= WITH wqlist */
159516
- 262, /* (299) with ::= WITH RECURSIVE wqlist */
159517
- 237, /* (300) wqlist ::= nm eidlist_opt AS LP select RP */
159518
- 237, /* (301) wqlist ::= wqlist COMMA nm eidlist_opt AS LP select RP */
159519
- 300, /* (302) windowdefn_list ::= windowdefn */
159520
- 300, /* (303) windowdefn_list ::= windowdefn_list COMMA windowdefn */
159521
- 301, /* (304) windowdefn ::= nm AS LP window RP */
159522
- 302, /* (305) window ::= PARTITION BY nexprlist orderby_opt frame_opt */
159523
- 302, /* (306) window ::= nm PARTITION BY nexprlist orderby_opt frame_opt */
159524
- 302, /* (307) window ::= ORDER BY sortlist frame_opt */
159525
- 302, /* (308) window ::= nm ORDER BY sortlist frame_opt */
159526
- 302, /* (309) window ::= frame_opt */
159527
- 302, /* (310) window ::= nm frame_opt */
159528
- 303, /* (311) frame_opt ::= */
159529
- 303, /* (312) frame_opt ::= range_or_rows frame_bound_s frame_exclude_opt */
159530
- 303, /* (313) frame_opt ::= range_or_rows BETWEEN frame_bound_s AND frame_bound_e frame_exclude_opt */
159531
- 307, /* (314) range_or_rows ::= RANGE|ROWS|GROUPS */
159532
- 309, /* (315) frame_bound_s ::= frame_bound */
159533
- 309, /* (316) frame_bound_s ::= UNBOUNDED PRECEDING */
159534
- 310, /* (317) frame_bound_e ::= frame_bound */
159535
- 310, /* (318) frame_bound_e ::= UNBOUNDED FOLLOWING */
159536
- 308, /* (319) frame_bound ::= expr PRECEDING|FOLLOWING */
159537
- 308, /* (320) frame_bound ::= CURRENT ROW */
159538
- 311, /* (321) frame_exclude_opt ::= */
159539
- 311, /* (322) frame_exclude_opt ::= EXCLUDE frame_exclude */
159540
- 312, /* (323) frame_exclude ::= NO OTHERS */
159541
- 312, /* (324) frame_exclude ::= CURRENT ROW */
159542
- 312, /* (325) frame_exclude ::= GROUP|TIES */
159543
- 247, /* (326) window_clause ::= WINDOW windowdefn_list */
159544
- 269, /* (327) filter_over ::= filter_clause over_clause */
159545
- 269, /* (328) filter_over ::= over_clause */
159546
- 269, /* (329) filter_over ::= filter_clause */
159547
- 306, /* (330) over_clause ::= OVER LP window RP */
159548
- 306, /* (331) over_clause ::= OVER nm */
159549
- 305, /* (332) filter_clause ::= FILTER LP WHERE expr RP */
159550
- 182, /* (333) input ::= cmdlist */
159551
- 183, /* (334) cmdlist ::= cmdlist ecmd */
159552
- 183, /* (335) cmdlist ::= ecmd */
159553
- 184, /* (336) ecmd ::= SEMI */
159554
- 184, /* (337) ecmd ::= cmdx SEMI */
159555
- 184, /* (338) ecmd ::= explain cmdx SEMI */
159556
- 189, /* (339) trans_opt ::= */
159557
- 189, /* (340) trans_opt ::= TRANSACTION */
159558
- 189, /* (341) trans_opt ::= TRANSACTION nm */
159559
- 191, /* (342) savepoint_opt ::= SAVEPOINT */
159560
- 191, /* (343) savepoint_opt ::= */
159561
- 187, /* (344) cmd ::= create_table create_table_args */
159562
- 198, /* (345) columnlist ::= columnlist COMMA columnname carglist */
159563
- 198, /* (346) columnlist ::= columnname carglist */
159564
- 190, /* (347) nm ::= ID|INDEXED */
159565
- 190, /* (348) nm ::= STRING */
159566
- 190, /* (349) nm ::= JOIN_KW */
159567
- 204, /* (350) typetoken ::= typename */
159568
- 205, /* (351) typename ::= ID|STRING */
159569
- 206, /* (352) signed ::= plus_num */
159570
- 206, /* (353) signed ::= minus_num */
159571
- 203, /* (354) carglist ::= carglist ccons */
159572
- 203, /* (355) carglist ::= */
159573
- 211, /* (356) ccons ::= NULL onconf */
159574
- 211, /* (357) ccons ::= GENERATED ALWAYS AS generated */
159575
- 211, /* (358) ccons ::= AS generated */
159576
- 199, /* (359) conslist_opt ::= COMMA conslist */
159577
- 224, /* (360) conslist ::= conslist tconscomma tcons */
159578
- 224, /* (361) conslist ::= tcons */
159579
- 225, /* (362) tconscomma ::= */
159580
- 229, /* (363) defer_subclause_opt ::= defer_subclause */
159581
- 231, /* (364) resolvetype ::= raisetype */
159582
- 235, /* (365) selectnowith ::= oneselect */
159583
- 236, /* (366) oneselect ::= values */
159584
- 250, /* (367) sclp ::= selcollist COMMA */
159585
- 251, /* (368) as ::= ID|STRING */
159586
- 268, /* (369) returning ::= */
159587
- 213, /* (370) expr ::= term */
159588
- 270, /* (371) likeop ::= LIKE_KW|MATCH */
159589
- 258, /* (372) exprlist ::= nexprlist */
159590
- 280, /* (373) nmnum ::= plus_num */
159591
- 280, /* (374) nmnum ::= nm */
159592
- 280, /* (375) nmnum ::= ON */
159593
- 280, /* (376) nmnum ::= DELETE */
159594
- 280, /* (377) nmnum ::= DEFAULT */
159595
- 207, /* (378) plus_num ::= INTEGER|FLOAT */
159596
- 285, /* (379) foreach_clause ::= */
159597
- 285, /* (380) foreach_clause ::= FOR EACH ROW */
159598
- 288, /* (381) trnm ::= nm */
159599
- 289, /* (382) tridxby ::= */
159600
- 290, /* (383) database_kw_opt ::= DATABASE */
159601
- 290, /* (384) database_kw_opt ::= */
159602
- 293, /* (385) kwcolumn_opt ::= */
159603
- 293, /* (386) kwcolumn_opt ::= COLUMNKW */
159604
- 295, /* (387) vtabarglist ::= vtabarg */
159605
- 295, /* (388) vtabarglist ::= vtabarglist COMMA vtabarg */
159606
- 296, /* (389) vtabarg ::= vtabarg vtabargtoken */
159607
- 299, /* (390) anylist ::= */
159608
- 299, /* (391) anylist ::= anylist LP anylist RP */
159609
- 299, /* (392) anylist ::= anylist ANY */
159610
- 262, /* (393) with ::= */
159396
+ 187, /* (0) explain ::= EXPLAIN */
159397
+ 187, /* (1) explain ::= EXPLAIN QUERY PLAN */
159398
+ 186, /* (2) cmdx ::= cmd */
159399
+ 188, /* (3) cmd ::= BEGIN transtype trans_opt */
159400
+ 189, /* (4) transtype ::= */
159401
+ 189, /* (5) transtype ::= DEFERRED */
159402
+ 189, /* (6) transtype ::= IMMEDIATE */
159403
+ 189, /* (7) transtype ::= EXCLUSIVE */
159404
+ 188, /* (8) cmd ::= COMMIT|END trans_opt */
159405
+ 188, /* (9) cmd ::= ROLLBACK trans_opt */
159406
+ 188, /* (10) cmd ::= SAVEPOINT nm */
159407
+ 188, /* (11) cmd ::= RELEASE savepoint_opt nm */
159408
+ 188, /* (12) cmd ::= ROLLBACK trans_opt TO savepoint_opt nm */
159409
+ 193, /* (13) create_table ::= createkw temp TABLE ifnotexists nm dbnm */
159410
+ 195, /* (14) createkw ::= CREATE */
159411
+ 197, /* (15) ifnotexists ::= */
159412
+ 197, /* (16) ifnotexists ::= IF NOT EXISTS */
159413
+ 196, /* (17) temp ::= TEMP */
159414
+ 196, /* (18) temp ::= */
159415
+ 194, /* (19) create_table_args ::= LP columnlist conslist_opt RP table_options */
159416
+ 194, /* (20) create_table_args ::= AS select */
159417
+ 201, /* (21) table_options ::= */
159418
+ 201, /* (22) table_options ::= WITHOUT nm */
159419
+ 203, /* (23) columnname ::= nm typetoken */
159420
+ 205, /* (24) typetoken ::= */
159421
+ 205, /* (25) typetoken ::= typename LP signed RP */
159422
+ 205, /* (26) typetoken ::= typename LP signed COMMA signed RP */
159423
+ 206, /* (27) typename ::= typename ID|STRING */
159424
+ 210, /* (28) scanpt ::= */
159425
+ 211, /* (29) scantok ::= */
159426
+ 212, /* (30) ccons ::= CONSTRAINT nm */
159427
+ 212, /* (31) ccons ::= DEFAULT scantok term */
159428
+ 212, /* (32) ccons ::= DEFAULT LP expr RP */
159429
+ 212, /* (33) ccons ::= DEFAULT PLUS scantok term */
159430
+ 212, /* (34) ccons ::= DEFAULT MINUS scantok term */
159431
+ 212, /* (35) ccons ::= DEFAULT scantok ID|INDEXED */
159432
+ 212, /* (36) ccons ::= NOT NULL onconf */
159433
+ 212, /* (37) ccons ::= PRIMARY KEY sortorder onconf autoinc */
159434
+ 212, /* (38) ccons ::= UNIQUE onconf */
159435
+ 212, /* (39) ccons ::= CHECK LP expr RP */
159436
+ 212, /* (40) ccons ::= REFERENCES nm eidlist_opt refargs */
159437
+ 212, /* (41) ccons ::= defer_subclause */
159438
+ 212, /* (42) ccons ::= COLLATE ID|STRING */
159439
+ 221, /* (43) generated ::= LP expr RP */
159440
+ 221, /* (44) generated ::= LP expr RP ID */
159441
+ 217, /* (45) autoinc ::= */
159442
+ 217, /* (46) autoinc ::= AUTOINCR */
159443
+ 219, /* (47) refargs ::= */
159444
+ 219, /* (48) refargs ::= refargs refarg */
159445
+ 222, /* (49) refarg ::= MATCH nm */
159446
+ 222, /* (50) refarg ::= ON INSERT refact */
159447
+ 222, /* (51) refarg ::= ON DELETE refact */
159448
+ 222, /* (52) refarg ::= ON UPDATE refact */
159449
+ 223, /* (53) refact ::= SET NULL */
159450
+ 223, /* (54) refact ::= SET DEFAULT */
159451
+ 223, /* (55) refact ::= CASCADE */
159452
+ 223, /* (56) refact ::= RESTRICT */
159453
+ 223, /* (57) refact ::= NO ACTION */
159454
+ 220, /* (58) defer_subclause ::= NOT DEFERRABLE init_deferred_pred_opt */
159455
+ 220, /* (59) defer_subclause ::= DEFERRABLE init_deferred_pred_opt */
159456
+ 224, /* (60) init_deferred_pred_opt ::= */
159457
+ 224, /* (61) init_deferred_pred_opt ::= INITIALLY DEFERRED */
159458
+ 224, /* (62) init_deferred_pred_opt ::= INITIALLY IMMEDIATE */
159459
+ 200, /* (63) conslist_opt ::= */
159460
+ 226, /* (64) tconscomma ::= COMMA */
159461
+ 227, /* (65) tcons ::= CONSTRAINT nm */
159462
+ 227, /* (66) tcons ::= PRIMARY KEY LP sortlist autoinc RP onconf */
159463
+ 227, /* (67) tcons ::= UNIQUE LP sortlist RP onconf */
159464
+ 227, /* (68) tcons ::= CHECK LP expr RP onconf */
159465
+ 227, /* (69) tcons ::= FOREIGN KEY LP eidlist RP REFERENCES nm eidlist_opt refargs defer_subclause_opt */
159466
+ 230, /* (70) defer_subclause_opt ::= */
159467
+ 215, /* (71) onconf ::= */
159468
+ 215, /* (72) onconf ::= ON CONFLICT resolvetype */
159469
+ 231, /* (73) orconf ::= */
159470
+ 231, /* (74) orconf ::= OR resolvetype */
159471
+ 232, /* (75) resolvetype ::= IGNORE */
159472
+ 232, /* (76) resolvetype ::= REPLACE */
159473
+ 188, /* (77) cmd ::= DROP TABLE ifexists fullname */
159474
+ 234, /* (78) ifexists ::= IF EXISTS */
159475
+ 234, /* (79) ifexists ::= */
159476
+ 188, /* (80) cmd ::= createkw temp VIEW ifnotexists nm dbnm eidlist_opt AS select */
159477
+ 188, /* (81) cmd ::= DROP VIEW ifexists fullname */
159478
+ 188, /* (82) cmd ::= select */
159479
+ 202, /* (83) select ::= WITH wqlist selectnowith */
159480
+ 202, /* (84) select ::= WITH RECURSIVE wqlist selectnowith */
159481
+ 202, /* (85) select ::= selectnowith */
159482
+ 236, /* (86) selectnowith ::= selectnowith multiselect_op oneselect */
159483
+ 239, /* (87) multiselect_op ::= UNION */
159484
+ 239, /* (88) multiselect_op ::= UNION ALL */
159485
+ 239, /* (89) multiselect_op ::= EXCEPT|INTERSECT */
159486
+ 237, /* (90) oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt orderby_opt limit_opt */
159487
+ 237, /* (91) oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt window_clause orderby_opt limit_opt */
159488
+ 249, /* (92) values ::= VALUES LP nexprlist RP */
159489
+ 249, /* (93) values ::= values COMMA LP nexprlist RP */
159490
+ 240, /* (94) distinct ::= DISTINCT */
159491
+ 240, /* (95) distinct ::= ALL */
159492
+ 240, /* (96) distinct ::= */
159493
+ 251, /* (97) sclp ::= */
159494
+ 241, /* (98) selcollist ::= sclp scanpt expr scanpt as */
159495
+ 241, /* (99) selcollist ::= sclp scanpt STAR */
159496
+ 241, /* (100) selcollist ::= sclp scanpt nm DOT STAR */
159497
+ 252, /* (101) as ::= AS nm */
159498
+ 252, /* (102) as ::= */
159499
+ 242, /* (103) from ::= */
159500
+ 242, /* (104) from ::= FROM seltablist */
159501
+ 254, /* (105) stl_prefix ::= seltablist joinop */
159502
+ 254, /* (106) stl_prefix ::= */
159503
+ 253, /* (107) seltablist ::= stl_prefix nm dbnm as indexed_opt on_opt using_opt */
159504
+ 253, /* (108) seltablist ::= stl_prefix nm dbnm LP exprlist RP as on_opt using_opt */
159505
+ 253, /* (109) seltablist ::= stl_prefix LP select RP as on_opt using_opt */
159506
+ 253, /* (110) seltablist ::= stl_prefix LP seltablist RP as on_opt using_opt */
159507
+ 198, /* (111) dbnm ::= */
159508
+ 198, /* (112) dbnm ::= DOT nm */
159509
+ 235, /* (113) fullname ::= nm */
159510
+ 235, /* (114) fullname ::= nm DOT nm */
159511
+ 260, /* (115) xfullname ::= nm */
159512
+ 260, /* (116) xfullname ::= nm DOT nm */
159513
+ 260, /* (117) xfullname ::= nm DOT nm AS nm */
159514
+ 260, /* (118) xfullname ::= nm AS nm */
159515
+ 255, /* (119) joinop ::= COMMA|JOIN */
159516
+ 255, /* (120) joinop ::= JOIN_KW JOIN */
159517
+ 255, /* (121) joinop ::= JOIN_KW nm JOIN */
159518
+ 255, /* (122) joinop ::= JOIN_KW nm nm JOIN */
159519
+ 257, /* (123) on_opt ::= ON expr */
159520
+ 257, /* (124) on_opt ::= */
159521
+ 256, /* (125) indexed_opt ::= */
159522
+ 256, /* (126) indexed_opt ::= INDEXED BY nm */
159523
+ 256, /* (127) indexed_opt ::= NOT INDEXED */
159524
+ 258, /* (128) using_opt ::= USING LP idlist RP */
159525
+ 258, /* (129) using_opt ::= */
159526
+ 246, /* (130) orderby_opt ::= */
159527
+ 246, /* (131) orderby_opt ::= ORDER BY sortlist */
159528
+ 228, /* (132) sortlist ::= sortlist COMMA expr sortorder nulls */
159529
+ 228, /* (133) sortlist ::= expr sortorder nulls */
159530
+ 216, /* (134) sortorder ::= ASC */
159531
+ 216, /* (135) sortorder ::= DESC */
159532
+ 216, /* (136) sortorder ::= */
159533
+ 262, /* (137) nulls ::= NULLS FIRST */
159534
+ 262, /* (138) nulls ::= NULLS LAST */
159535
+ 262, /* (139) nulls ::= */
159536
+ 244, /* (140) groupby_opt ::= */
159537
+ 244, /* (141) groupby_opt ::= GROUP BY nexprlist */
159538
+ 245, /* (142) having_opt ::= */
159539
+ 245, /* (143) having_opt ::= HAVING expr */
159540
+ 247, /* (144) limit_opt ::= */
159541
+ 247, /* (145) limit_opt ::= LIMIT expr */
159542
+ 247, /* (146) limit_opt ::= LIMIT expr OFFSET expr */
159543
+ 247, /* (147) limit_opt ::= LIMIT expr COMMA expr */
159544
+ 188, /* (148) cmd ::= with DELETE FROM xfullname indexed_opt where_opt_ret */
159545
+ 243, /* (149) where_opt ::= */
159546
+ 243, /* (150) where_opt ::= WHERE expr */
159547
+ 264, /* (151) where_opt_ret ::= */
159548
+ 264, /* (152) where_opt_ret ::= WHERE expr */
159549
+ 264, /* (153) where_opt_ret ::= RETURNING selcollist */
159550
+ 264, /* (154) where_opt_ret ::= WHERE expr RETURNING selcollist */
159551
+ 188, /* (155) cmd ::= with UPDATE orconf xfullname indexed_opt SET setlist from where_opt_ret */
159552
+ 265, /* (156) setlist ::= setlist COMMA nm EQ expr */
159553
+ 265, /* (157) setlist ::= setlist COMMA LP idlist RP EQ expr */
159554
+ 265, /* (158) setlist ::= nm EQ expr */
159555
+ 265, /* (159) setlist ::= LP idlist RP EQ expr */
159556
+ 188, /* (160) cmd ::= with insert_cmd INTO xfullname idlist_opt select upsert */
159557
+ 188, /* (161) cmd ::= with insert_cmd INTO xfullname idlist_opt DEFAULT VALUES returning */
159558
+ 268, /* (162) upsert ::= */
159559
+ 268, /* (163) upsert ::= RETURNING selcollist */
159560
+ 268, /* (164) upsert ::= ON CONFLICT LP sortlist RP where_opt DO UPDATE SET setlist where_opt upsert */
159561
+ 268, /* (165) upsert ::= ON CONFLICT LP sortlist RP where_opt DO NOTHING upsert */
159562
+ 268, /* (166) upsert ::= ON CONFLICT DO NOTHING returning */
159563
+ 268, /* (167) upsert ::= ON CONFLICT DO UPDATE SET setlist where_opt returning */
159564
+ 269, /* (168) returning ::= RETURNING selcollist */
159565
+ 266, /* (169) insert_cmd ::= INSERT orconf */
159566
+ 266, /* (170) insert_cmd ::= REPLACE */
159567
+ 267, /* (171) idlist_opt ::= */
159568
+ 267, /* (172) idlist_opt ::= LP idlist RP */
159569
+ 261, /* (173) idlist ::= idlist COMMA nm */
159570
+ 261, /* (174) idlist ::= nm */
159571
+ 214, /* (175) expr ::= LP expr RP */
159572
+ 214, /* (176) expr ::= ID|INDEXED */
159573
+ 214, /* (177) expr ::= JOIN_KW */
159574
+ 214, /* (178) expr ::= nm DOT nm */
159575
+ 214, /* (179) expr ::= nm DOT nm DOT nm */
159576
+ 213, /* (180) term ::= NULL|FLOAT|BLOB */
159577
+ 213, /* (181) term ::= STRING */
159578
+ 213, /* (182) term ::= INTEGER */
159579
+ 214, /* (183) expr ::= VARIABLE */
159580
+ 214, /* (184) expr ::= expr COLLATE ID|STRING */
159581
+ 214, /* (185) expr ::= CAST LP expr AS typetoken RP */
159582
+ 214, /* (186) expr ::= ID|INDEXED LP distinct exprlist RP */
159583
+ 214, /* (187) expr ::= ID|INDEXED LP STAR RP */
159584
+ 214, /* (188) expr ::= ID|INDEXED LP distinct exprlist RP filter_over */
159585
+ 214, /* (189) expr ::= ID|INDEXED LP STAR RP filter_over */
159586
+ 213, /* (190) term ::= CTIME_KW */
159587
+ 214, /* (191) expr ::= LP nexprlist COMMA expr RP */
159588
+ 214, /* (192) expr ::= expr AND expr */
159589
+ 214, /* (193) expr ::= expr OR expr */
159590
+ 214, /* (194) expr ::= expr LT|GT|GE|LE expr */
159591
+ 214, /* (195) expr ::= expr EQ|NE expr */
159592
+ 214, /* (196) expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr */
159593
+ 214, /* (197) expr ::= expr PLUS|MINUS expr */
159594
+ 214, /* (198) expr ::= expr STAR|SLASH|REM expr */
159595
+ 214, /* (199) expr ::= expr CONCAT expr */
159596
+ 271, /* (200) likeop ::= NOT LIKE_KW|MATCH */
159597
+ 214, /* (201) expr ::= expr likeop expr */
159598
+ 214, /* (202) expr ::= expr likeop expr ESCAPE expr */
159599
+ 214, /* (203) expr ::= expr ISNULL|NOTNULL */
159600
+ 214, /* (204) expr ::= expr NOT NULL */
159601
+ 214, /* (205) expr ::= expr IS expr */
159602
+ 214, /* (206) expr ::= expr IS NOT expr */
159603
+ 214, /* (207) expr ::= NOT expr */
159604
+ 214, /* (208) expr ::= BITNOT expr */
159605
+ 214, /* (209) expr ::= PLUS|MINUS expr */
159606
+ 272, /* (210) between_op ::= BETWEEN */
159607
+ 272, /* (211) between_op ::= NOT BETWEEN */
159608
+ 214, /* (212) expr ::= expr between_op expr AND expr */
159609
+ 273, /* (213) in_op ::= IN */
159610
+ 273, /* (214) in_op ::= NOT IN */
159611
+ 214, /* (215) expr ::= expr in_op LP exprlist RP */
159612
+ 214, /* (216) expr ::= LP select RP */
159613
+ 214, /* (217) expr ::= expr in_op LP select RP */
159614
+ 214, /* (218) expr ::= expr in_op nm dbnm paren_exprlist */
159615
+ 214, /* (219) expr ::= EXISTS LP select RP */
159616
+ 214, /* (220) expr ::= CASE case_operand case_exprlist case_else END */
159617
+ 276, /* (221) case_exprlist ::= case_exprlist WHEN expr THEN expr */
159618
+ 276, /* (222) case_exprlist ::= WHEN expr THEN expr */
159619
+ 277, /* (223) case_else ::= ELSE expr */
159620
+ 277, /* (224) case_else ::= */
159621
+ 275, /* (225) case_operand ::= expr */
159622
+ 275, /* (226) case_operand ::= */
159623
+ 259, /* (227) exprlist ::= */
159624
+ 250, /* (228) nexprlist ::= nexprlist COMMA expr */
159625
+ 250, /* (229) nexprlist ::= expr */
159626
+ 274, /* (230) paren_exprlist ::= */
159627
+ 274, /* (231) paren_exprlist ::= LP exprlist RP */
159628
+ 188, /* (232) cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP sortlist RP where_opt */
159629
+ 278, /* (233) uniqueflag ::= UNIQUE */
159630
+ 278, /* (234) uniqueflag ::= */
159631
+ 218, /* (235) eidlist_opt ::= */
159632
+ 218, /* (236) eidlist_opt ::= LP eidlist RP */
159633
+ 229, /* (237) eidlist ::= eidlist COMMA nm collate sortorder */
159634
+ 229, /* (238) eidlist ::= nm collate sortorder */
159635
+ 279, /* (239) collate ::= */
159636
+ 279, /* (240) collate ::= COLLATE ID|STRING */
159637
+ 188, /* (241) cmd ::= DROP INDEX ifexists fullname */
159638
+ 188, /* (242) cmd ::= VACUUM vinto */
159639
+ 188, /* (243) cmd ::= VACUUM nm vinto */
159640
+ 280, /* (244) vinto ::= INTO expr */
159641
+ 280, /* (245) vinto ::= */
159642
+ 188, /* (246) cmd ::= PRAGMA nm dbnm */
159643
+ 188, /* (247) cmd ::= PRAGMA nm dbnm EQ nmnum */
159644
+ 188, /* (248) cmd ::= PRAGMA nm dbnm LP nmnum RP */
159645
+ 188, /* (249) cmd ::= PRAGMA nm dbnm EQ minus_num */
159646
+ 188, /* (250) cmd ::= PRAGMA nm dbnm LP minus_num RP */
159647
+ 208, /* (251) plus_num ::= PLUS INTEGER|FLOAT */
159648
+ 209, /* (252) minus_num ::= MINUS INTEGER|FLOAT */
159649
+ 188, /* (253) cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END */
159650
+ 282, /* (254) trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause */
159651
+ 284, /* (255) trigger_time ::= BEFORE|AFTER */
159652
+ 284, /* (256) trigger_time ::= INSTEAD OF */
159653
+ 284, /* (257) trigger_time ::= */
159654
+ 285, /* (258) trigger_event ::= DELETE|INSERT */
159655
+ 285, /* (259) trigger_event ::= UPDATE */
159656
+ 285, /* (260) trigger_event ::= UPDATE OF idlist */
159657
+ 287, /* (261) when_clause ::= */
159658
+ 287, /* (262) when_clause ::= WHEN expr */
159659
+ 283, /* (263) trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI */
159660
+ 283, /* (264) trigger_cmd_list ::= trigger_cmd SEMI */
159661
+ 289, /* (265) trnm ::= nm DOT nm */
159662
+ 290, /* (266) tridxby ::= INDEXED BY nm */
159663
+ 290, /* (267) tridxby ::= NOT INDEXED */
159664
+ 288, /* (268) trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist from where_opt scanpt */
159665
+ 288, /* (269) trigger_cmd ::= scanpt insert_cmd INTO trnm idlist_opt select upsert scanpt */
159666
+ 288, /* (270) trigger_cmd ::= DELETE FROM trnm tridxby where_opt scanpt */
159667
+ 288, /* (271) trigger_cmd ::= scanpt select scanpt */
159668
+ 214, /* (272) expr ::= RAISE LP IGNORE RP */
159669
+ 214, /* (273) expr ::= RAISE LP raisetype COMMA nm RP */
159670
+ 233, /* (274) raisetype ::= ROLLBACK */
159671
+ 233, /* (275) raisetype ::= ABORT */
159672
+ 233, /* (276) raisetype ::= FAIL */
159673
+ 188, /* (277) cmd ::= DROP TRIGGER ifexists fullname */
159674
+ 188, /* (278) cmd ::= ATTACH database_kw_opt expr AS expr key_opt */
159675
+ 188, /* (279) cmd ::= DETACH database_kw_opt expr */
159676
+ 292, /* (280) key_opt ::= */
159677
+ 292, /* (281) key_opt ::= KEY expr */
159678
+ 188, /* (282) cmd ::= REINDEX */
159679
+ 188, /* (283) cmd ::= REINDEX nm dbnm */
159680
+ 188, /* (284) cmd ::= ANALYZE */
159681
+ 188, /* (285) cmd ::= ANALYZE nm dbnm */
159682
+ 188, /* (286) cmd ::= ALTER TABLE fullname RENAME TO nm */
159683
+ 188, /* (287) cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt columnname carglist */
159684
+ 188, /* (288) cmd ::= ALTER TABLE fullname DROP kwcolumn_opt nm */
159685
+ 293, /* (289) add_column_fullname ::= fullname */
159686
+ 188, /* (290) cmd ::= ALTER TABLE fullname RENAME kwcolumn_opt nm TO nm */
159687
+ 188, /* (291) cmd ::= create_vtab */
159688
+ 188, /* (292) cmd ::= create_vtab LP vtabarglist RP */
159689
+ 295, /* (293) create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm */
159690
+ 297, /* (294) vtabarg ::= */
159691
+ 298, /* (295) vtabargtoken ::= ANY */
159692
+ 298, /* (296) vtabargtoken ::= lp anylist RP */
159693
+ 299, /* (297) lp ::= LP */
159694
+ 263, /* (298) with ::= WITH wqlist */
159695
+ 263, /* (299) with ::= WITH RECURSIVE wqlist */
159696
+ 302, /* (300) wqas ::= AS */
159697
+ 302, /* (301) wqas ::= AS MATERIALIZED */
159698
+ 302, /* (302) wqas ::= AS NOT MATERIALIZED */
159699
+ 301, /* (303) wqitem ::= nm eidlist_opt wqas LP select RP */
159700
+ 238, /* (304) wqlist ::= wqitem */
159701
+ 238, /* (305) wqlist ::= wqlist COMMA wqitem */
159702
+ 303, /* (306) windowdefn_list ::= windowdefn */
159703
+ 303, /* (307) windowdefn_list ::= windowdefn_list COMMA windowdefn */
159704
+ 304, /* (308) windowdefn ::= nm AS LP window RP */
159705
+ 305, /* (309) window ::= PARTITION BY nexprlist orderby_opt frame_opt */
159706
+ 305, /* (310) window ::= nm PARTITION BY nexprlist orderby_opt frame_opt */
159707
+ 305, /* (311) window ::= ORDER BY sortlist frame_opt */
159708
+ 305, /* (312) window ::= nm ORDER BY sortlist frame_opt */
159709
+ 305, /* (313) window ::= frame_opt */
159710
+ 305, /* (314) window ::= nm frame_opt */
159711
+ 306, /* (315) frame_opt ::= */
159712
+ 306, /* (316) frame_opt ::= range_or_rows frame_bound_s frame_exclude_opt */
159713
+ 306, /* (317) frame_opt ::= range_or_rows BETWEEN frame_bound_s AND frame_bound_e frame_exclude_opt */
159714
+ 310, /* (318) range_or_rows ::= RANGE|ROWS|GROUPS */
159715
+ 312, /* (319) frame_bound_s ::= frame_bound */
159716
+ 312, /* (320) frame_bound_s ::= UNBOUNDED PRECEDING */
159717
+ 313, /* (321) frame_bound_e ::= frame_bound */
159718
+ 313, /* (322) frame_bound_e ::= UNBOUNDED FOLLOWING */
159719
+ 311, /* (323) frame_bound ::= expr PRECEDING|FOLLOWING */
159720
+ 311, /* (324) frame_bound ::= CURRENT ROW */
159721
+ 314, /* (325) frame_exclude_opt ::= */
159722
+ 314, /* (326) frame_exclude_opt ::= EXCLUDE frame_exclude */
159723
+ 315, /* (327) frame_exclude ::= NO OTHERS */
159724
+ 315, /* (328) frame_exclude ::= CURRENT ROW */
159725
+ 315, /* (329) frame_exclude ::= GROUP|TIES */
159726
+ 248, /* (330) window_clause ::= WINDOW windowdefn_list */
159727
+ 270, /* (331) filter_over ::= filter_clause over_clause */
159728
+ 270, /* (332) filter_over ::= over_clause */
159729
+ 270, /* (333) filter_over ::= filter_clause */
159730
+ 309, /* (334) over_clause ::= OVER LP window RP */
159731
+ 309, /* (335) over_clause ::= OVER nm */
159732
+ 308, /* (336) filter_clause ::= FILTER LP WHERE expr RP */
159733
+ 183, /* (337) input ::= cmdlist */
159734
+ 184, /* (338) cmdlist ::= cmdlist ecmd */
159735
+ 184, /* (339) cmdlist ::= ecmd */
159736
+ 185, /* (340) ecmd ::= SEMI */
159737
+ 185, /* (341) ecmd ::= cmdx SEMI */
159738
+ 185, /* (342) ecmd ::= explain cmdx SEMI */
159739
+ 190, /* (343) trans_opt ::= */
159740
+ 190, /* (344) trans_opt ::= TRANSACTION */
159741
+ 190, /* (345) trans_opt ::= TRANSACTION nm */
159742
+ 192, /* (346) savepoint_opt ::= SAVEPOINT */
159743
+ 192, /* (347) savepoint_opt ::= */
159744
+ 188, /* (348) cmd ::= create_table create_table_args */
159745
+ 199, /* (349) columnlist ::= columnlist COMMA columnname carglist */
159746
+ 199, /* (350) columnlist ::= columnname carglist */
159747
+ 191, /* (351) nm ::= ID|INDEXED */
159748
+ 191, /* (352) nm ::= STRING */
159749
+ 191, /* (353) nm ::= JOIN_KW */
159750
+ 205, /* (354) typetoken ::= typename */
159751
+ 206, /* (355) typename ::= ID|STRING */
159752
+ 207, /* (356) signed ::= plus_num */
159753
+ 207, /* (357) signed ::= minus_num */
159754
+ 204, /* (358) carglist ::= carglist ccons */
159755
+ 204, /* (359) carglist ::= */
159756
+ 212, /* (360) ccons ::= NULL onconf */
159757
+ 212, /* (361) ccons ::= GENERATED ALWAYS AS generated */
159758
+ 212, /* (362) ccons ::= AS generated */
159759
+ 200, /* (363) conslist_opt ::= COMMA conslist */
159760
+ 225, /* (364) conslist ::= conslist tconscomma tcons */
159761
+ 225, /* (365) conslist ::= tcons */
159762
+ 226, /* (366) tconscomma ::= */
159763
+ 230, /* (367) defer_subclause_opt ::= defer_subclause */
159764
+ 232, /* (368) resolvetype ::= raisetype */
159765
+ 236, /* (369) selectnowith ::= oneselect */
159766
+ 237, /* (370) oneselect ::= values */
159767
+ 251, /* (371) sclp ::= selcollist COMMA */
159768
+ 252, /* (372) as ::= ID|STRING */
159769
+ 269, /* (373) returning ::= */
159770
+ 214, /* (374) expr ::= term */
159771
+ 271, /* (375) likeop ::= LIKE_KW|MATCH */
159772
+ 259, /* (376) exprlist ::= nexprlist */
159773
+ 281, /* (377) nmnum ::= plus_num */
159774
+ 281, /* (378) nmnum ::= nm */
159775
+ 281, /* (379) nmnum ::= ON */
159776
+ 281, /* (380) nmnum ::= DELETE */
159777
+ 281, /* (381) nmnum ::= DEFAULT */
159778
+ 208, /* (382) plus_num ::= INTEGER|FLOAT */
159779
+ 286, /* (383) foreach_clause ::= */
159780
+ 286, /* (384) foreach_clause ::= FOR EACH ROW */
159781
+ 289, /* (385) trnm ::= nm */
159782
+ 290, /* (386) tridxby ::= */
159783
+ 291, /* (387) database_kw_opt ::= DATABASE */
159784
+ 291, /* (388) database_kw_opt ::= */
159785
+ 294, /* (389) kwcolumn_opt ::= */
159786
+ 294, /* (390) kwcolumn_opt ::= COLUMNKW */
159787
+ 296, /* (391) vtabarglist ::= vtabarg */
159788
+ 296, /* (392) vtabarglist ::= vtabarglist COMMA vtabarg */
159789
+ 297, /* (393) vtabarg ::= vtabarg vtabargtoken */
159790
+ 300, /* (394) anylist ::= */
159791
+ 300, /* (395) anylist ::= anylist LP anylist RP */
159792
+ 300, /* (396) anylist ::= anylist ANY */
159793
+ 263, /* (397) with ::= */
159611159794
};
159612159795
159613159796
/* For rule J, yyRuleInfoNRhs[J] contains the negative of the number
159614159797
** of symbols on the right-hand side of that rule. */
159615159798
static const signed char yyRuleInfoNRhs[] = {
@@ -159911,104 +160094,108 @@
159911160094
-1, /* (295) vtabargtoken ::= ANY */
159912160095
-3, /* (296) vtabargtoken ::= lp anylist RP */
159913160096
-1, /* (297) lp ::= LP */
159914160097
-2, /* (298) with ::= WITH wqlist */
159915160098
-3, /* (299) with ::= WITH RECURSIVE wqlist */
159916
- -6, /* (300) wqlist ::= nm eidlist_opt AS LP select RP */
159917
- -8, /* (301) wqlist ::= wqlist COMMA nm eidlist_opt AS LP select RP */
159918
- -1, /* (302) windowdefn_list ::= windowdefn */
159919
- -3, /* (303) windowdefn_list ::= windowdefn_list COMMA windowdefn */
159920
- -5, /* (304) windowdefn ::= nm AS LP window RP */
159921
- -5, /* (305) window ::= PARTITION BY nexprlist orderby_opt frame_opt */
159922
- -6, /* (306) window ::= nm PARTITION BY nexprlist orderby_opt frame_opt */
159923
- -4, /* (307) window ::= ORDER BY sortlist frame_opt */
159924
- -5, /* (308) window ::= nm ORDER BY sortlist frame_opt */
159925
- -1, /* (309) window ::= frame_opt */
159926
- -2, /* (310) window ::= nm frame_opt */
159927
- 0, /* (311) frame_opt ::= */
159928
- -3, /* (312) frame_opt ::= range_or_rows frame_bound_s frame_exclude_opt */
159929
- -6, /* (313) frame_opt ::= range_or_rows BETWEEN frame_bound_s AND frame_bound_e frame_exclude_opt */
159930
- -1, /* (314) range_or_rows ::= RANGE|ROWS|GROUPS */
159931
- -1, /* (315) frame_bound_s ::= frame_bound */
159932
- -2, /* (316) frame_bound_s ::= UNBOUNDED PRECEDING */
159933
- -1, /* (317) frame_bound_e ::= frame_bound */
159934
- -2, /* (318) frame_bound_e ::= UNBOUNDED FOLLOWING */
159935
- -2, /* (319) frame_bound ::= expr PRECEDING|FOLLOWING */
159936
- -2, /* (320) frame_bound ::= CURRENT ROW */
159937
- 0, /* (321) frame_exclude_opt ::= */
159938
- -2, /* (322) frame_exclude_opt ::= EXCLUDE frame_exclude */
159939
- -2, /* (323) frame_exclude ::= NO OTHERS */
159940
- -2, /* (324) frame_exclude ::= CURRENT ROW */
159941
- -1, /* (325) frame_exclude ::= GROUP|TIES */
159942
- -2, /* (326) window_clause ::= WINDOW windowdefn_list */
159943
- -2, /* (327) filter_over ::= filter_clause over_clause */
159944
- -1, /* (328) filter_over ::= over_clause */
159945
- -1, /* (329) filter_over ::= filter_clause */
159946
- -4, /* (330) over_clause ::= OVER LP window RP */
159947
- -2, /* (331) over_clause ::= OVER nm */
159948
- -5, /* (332) filter_clause ::= FILTER LP WHERE expr RP */
159949
- -1, /* (333) input ::= cmdlist */
159950
- -2, /* (334) cmdlist ::= cmdlist ecmd */
159951
- -1, /* (335) cmdlist ::= ecmd */
159952
- -1, /* (336) ecmd ::= SEMI */
159953
- -2, /* (337) ecmd ::= cmdx SEMI */
159954
- -3, /* (338) ecmd ::= explain cmdx SEMI */
159955
- 0, /* (339) trans_opt ::= */
159956
- -1, /* (340) trans_opt ::= TRANSACTION */
159957
- -2, /* (341) trans_opt ::= TRANSACTION nm */
159958
- -1, /* (342) savepoint_opt ::= SAVEPOINT */
159959
- 0, /* (343) savepoint_opt ::= */
159960
- -2, /* (344) cmd ::= create_table create_table_args */
159961
- -4, /* (345) columnlist ::= columnlist COMMA columnname carglist */
159962
- -2, /* (346) columnlist ::= columnname carglist */
159963
- -1, /* (347) nm ::= ID|INDEXED */
159964
- -1, /* (348) nm ::= STRING */
159965
- -1, /* (349) nm ::= JOIN_KW */
159966
- -1, /* (350) typetoken ::= typename */
159967
- -1, /* (351) typename ::= ID|STRING */
159968
- -1, /* (352) signed ::= plus_num */
159969
- -1, /* (353) signed ::= minus_num */
159970
- -2, /* (354) carglist ::= carglist ccons */
159971
- 0, /* (355) carglist ::= */
159972
- -2, /* (356) ccons ::= NULL onconf */
159973
- -4, /* (357) ccons ::= GENERATED ALWAYS AS generated */
159974
- -2, /* (358) ccons ::= AS generated */
159975
- -2, /* (359) conslist_opt ::= COMMA conslist */
159976
- -3, /* (360) conslist ::= conslist tconscomma tcons */
159977
- -1, /* (361) conslist ::= tcons */
159978
- 0, /* (362) tconscomma ::= */
159979
- -1, /* (363) defer_subclause_opt ::= defer_subclause */
159980
- -1, /* (364) resolvetype ::= raisetype */
159981
- -1, /* (365) selectnowith ::= oneselect */
159982
- -1, /* (366) oneselect ::= values */
159983
- -2, /* (367) sclp ::= selcollist COMMA */
159984
- -1, /* (368) as ::= ID|STRING */
159985
- 0, /* (369) returning ::= */
159986
- -1, /* (370) expr ::= term */
159987
- -1, /* (371) likeop ::= LIKE_KW|MATCH */
159988
- -1, /* (372) exprlist ::= nexprlist */
159989
- -1, /* (373) nmnum ::= plus_num */
159990
- -1, /* (374) nmnum ::= nm */
159991
- -1, /* (375) nmnum ::= ON */
159992
- -1, /* (376) nmnum ::= DELETE */
159993
- -1, /* (377) nmnum ::= DEFAULT */
159994
- -1, /* (378) plus_num ::= INTEGER|FLOAT */
159995
- 0, /* (379) foreach_clause ::= */
159996
- -3, /* (380) foreach_clause ::= FOR EACH ROW */
159997
- -1, /* (381) trnm ::= nm */
159998
- 0, /* (382) tridxby ::= */
159999
- -1, /* (383) database_kw_opt ::= DATABASE */
160000
- 0, /* (384) database_kw_opt ::= */
160001
- 0, /* (385) kwcolumn_opt ::= */
160002
- -1, /* (386) kwcolumn_opt ::= COLUMNKW */
160003
- -1, /* (387) vtabarglist ::= vtabarg */
160004
- -3, /* (388) vtabarglist ::= vtabarglist COMMA vtabarg */
160005
- -2, /* (389) vtabarg ::= vtabarg vtabargtoken */
160006
- 0, /* (390) anylist ::= */
160007
- -4, /* (391) anylist ::= anylist LP anylist RP */
160008
- -2, /* (392) anylist ::= anylist ANY */
160009
- 0, /* (393) with ::= */
160099
+ -1, /* (300) wqas ::= AS */
160100
+ -2, /* (301) wqas ::= AS MATERIALIZED */
160101
+ -3, /* (302) wqas ::= AS NOT MATERIALIZED */
160102
+ -6, /* (303) wqitem ::= nm eidlist_opt wqas LP select RP */
160103
+ -1, /* (304) wqlist ::= wqitem */
160104
+ -3, /* (305) wqlist ::= wqlist COMMA wqitem */
160105
+ -1, /* (306) windowdefn_list ::= windowdefn */
160106
+ -3, /* (307) windowdefn_list ::= windowdefn_list COMMA windowdefn */
160107
+ -5, /* (308) windowdefn ::= nm AS LP window RP */
160108
+ -5, /* (309) window ::= PARTITION BY nexprlist orderby_opt frame_opt */
160109
+ -6, /* (310) window ::= nm PARTITION BY nexprlist orderby_opt frame_opt */
160110
+ -4, /* (311) window ::= ORDER BY sortlist frame_opt */
160111
+ -5, /* (312) window ::= nm ORDER BY sortlist frame_opt */
160112
+ -1, /* (313) window ::= frame_opt */
160113
+ -2, /* (314) window ::= nm frame_opt */
160114
+ 0, /* (315) frame_opt ::= */
160115
+ -3, /* (316) frame_opt ::= range_or_rows frame_bound_s frame_exclude_opt */
160116
+ -6, /* (317) frame_opt ::= range_or_rows BETWEEN frame_bound_s AND frame_bound_e frame_exclude_opt */
160117
+ -1, /* (318) range_or_rows ::= RANGE|ROWS|GROUPS */
160118
+ -1, /* (319) frame_bound_s ::= frame_bound */
160119
+ -2, /* (320) frame_bound_s ::= UNBOUNDED PRECEDING */
160120
+ -1, /* (321) frame_bound_e ::= frame_bound */
160121
+ -2, /* (322) frame_bound_e ::= UNBOUNDED FOLLOWING */
160122
+ -2, /* (323) frame_bound ::= expr PRECEDING|FOLLOWING */
160123
+ -2, /* (324) frame_bound ::= CURRENT ROW */
160124
+ 0, /* (325) frame_exclude_opt ::= */
160125
+ -2, /* (326) frame_exclude_opt ::= EXCLUDE frame_exclude */
160126
+ -2, /* (327) frame_exclude ::= NO OTHERS */
160127
+ -2, /* (328) frame_exclude ::= CURRENT ROW */
160128
+ -1, /* (329) frame_exclude ::= GROUP|TIES */
160129
+ -2, /* (330) window_clause ::= WINDOW windowdefn_list */
160130
+ -2, /* (331) filter_over ::= filter_clause over_clause */
160131
+ -1, /* (332) filter_over ::= over_clause */
160132
+ -1, /* (333) filter_over ::= filter_clause */
160133
+ -4, /* (334) over_clause ::= OVER LP window RP */
160134
+ -2, /* (335) over_clause ::= OVER nm */
160135
+ -5, /* (336) filter_clause ::= FILTER LP WHERE expr RP */
160136
+ -1, /* (337) input ::= cmdlist */
160137
+ -2, /* (338) cmdlist ::= cmdlist ecmd */
160138
+ -1, /* (339) cmdlist ::= ecmd */
160139
+ -1, /* (340) ecmd ::= SEMI */
160140
+ -2, /* (341) ecmd ::= cmdx SEMI */
160141
+ -3, /* (342) ecmd ::= explain cmdx SEMI */
160142
+ 0, /* (343) trans_opt ::= */
160143
+ -1, /* (344) trans_opt ::= TRANSACTION */
160144
+ -2, /* (345) trans_opt ::= TRANSACTION nm */
160145
+ -1, /* (346) savepoint_opt ::= SAVEPOINT */
160146
+ 0, /* (347) savepoint_opt ::= */
160147
+ -2, /* (348) cmd ::= create_table create_table_args */
160148
+ -4, /* (349) columnlist ::= columnlist COMMA columnname carglist */
160149
+ -2, /* (350) columnlist ::= columnname carglist */
160150
+ -1, /* (351) nm ::= ID|INDEXED */
160151
+ -1, /* (352) nm ::= STRING */
160152
+ -1, /* (353) nm ::= JOIN_KW */
160153
+ -1, /* (354) typetoken ::= typename */
160154
+ -1, /* (355) typename ::= ID|STRING */
160155
+ -1, /* (356) signed ::= plus_num */
160156
+ -1, /* (357) signed ::= minus_num */
160157
+ -2, /* (358) carglist ::= carglist ccons */
160158
+ 0, /* (359) carglist ::= */
160159
+ -2, /* (360) ccons ::= NULL onconf */
160160
+ -4, /* (361) ccons ::= GENERATED ALWAYS AS generated */
160161
+ -2, /* (362) ccons ::= AS generated */
160162
+ -2, /* (363) conslist_opt ::= COMMA conslist */
160163
+ -3, /* (364) conslist ::= conslist tconscomma tcons */
160164
+ -1, /* (365) conslist ::= tcons */
160165
+ 0, /* (366) tconscomma ::= */
160166
+ -1, /* (367) defer_subclause_opt ::= defer_subclause */
160167
+ -1, /* (368) resolvetype ::= raisetype */
160168
+ -1, /* (369) selectnowith ::= oneselect */
160169
+ -1, /* (370) oneselect ::= values */
160170
+ -2, /* (371) sclp ::= selcollist COMMA */
160171
+ -1, /* (372) as ::= ID|STRING */
160172
+ 0, /* (373) returning ::= */
160173
+ -1, /* (374) expr ::= term */
160174
+ -1, /* (375) likeop ::= LIKE_KW|MATCH */
160175
+ -1, /* (376) exprlist ::= nexprlist */
160176
+ -1, /* (377) nmnum ::= plus_num */
160177
+ -1, /* (378) nmnum ::= nm */
160178
+ -1, /* (379) nmnum ::= ON */
160179
+ -1, /* (380) nmnum ::= DELETE */
160180
+ -1, /* (381) nmnum ::= DEFAULT */
160181
+ -1, /* (382) plus_num ::= INTEGER|FLOAT */
160182
+ 0, /* (383) foreach_clause ::= */
160183
+ -3, /* (384) foreach_clause ::= FOR EACH ROW */
160184
+ -1, /* (385) trnm ::= nm */
160185
+ 0, /* (386) tridxby ::= */
160186
+ -1, /* (387) database_kw_opt ::= DATABASE */
160187
+ 0, /* (388) database_kw_opt ::= */
160188
+ 0, /* (389) kwcolumn_opt ::= */
160189
+ -1, /* (390) kwcolumn_opt ::= COLUMNKW */
160190
+ -1, /* (391) vtabarglist ::= vtabarg */
160191
+ -3, /* (392) vtabarglist ::= vtabarglist COMMA vtabarg */
160192
+ -2, /* (393) vtabarg ::= vtabarg vtabargtoken */
160193
+ 0, /* (394) anylist ::= */
160194
+ -4, /* (395) anylist ::= anylist LP anylist RP */
160195
+ -2, /* (396) anylist ::= anylist ANY */
160196
+ 0, /* (397) with ::= */
160010160197
};
160011160198
160012160199
static void yy_accept(yyParser*); /* Forward Declaration */
160013160200
160014160201
/*
@@ -160056,20 +160243,20 @@
160056160243
break;
160057160244
case 2: /* cmdx ::= cmd */
160058160245
{ sqlite3FinishCoding(pParse); }
160059160246
break;
160060160247
case 3: /* cmd ::= BEGIN transtype trans_opt */
160061
-{sqlite3BeginTransaction(pParse, yymsp[-1].minor.yy412);}
160248
+{sqlite3BeginTransaction(pParse, yymsp[-1].minor.yy60);}
160062160249
break;
160063160250
case 4: /* transtype ::= */
160064
-{yymsp[1].minor.yy412 = TK_DEFERRED;}
160251
+{yymsp[1].minor.yy60 = TK_DEFERRED;}
160065160252
break;
160066160253
case 5: /* transtype ::= DEFERRED */
160067160254
case 6: /* transtype ::= IMMEDIATE */ yytestcase(yyruleno==6);
160068160255
case 7: /* transtype ::= EXCLUSIVE */ yytestcase(yyruleno==7);
160069
- case 314: /* range_or_rows ::= RANGE|ROWS|GROUPS */ yytestcase(yyruleno==314);
160070
-{yymsp[0].minor.yy412 = yymsp[0].major; /*A-overwrites-X*/}
160256
+ case 318: /* range_or_rows ::= RANGE|ROWS|GROUPS */ yytestcase(yyruleno==318);
160257
+{yymsp[0].minor.yy60 = yymsp[0].major; /*A-overwrites-X*/}
160071160258
break;
160072160259
case 8: /* cmd ::= COMMIT|END trans_opt */
160073160260
case 9: /* cmd ::= ROLLBACK trans_opt */ yytestcase(yyruleno==9);
160074160261
{sqlite3EndTransaction(pParse,yymsp[-1].major);}
160075160262
break;
@@ -160088,11 +160275,11 @@
160088160275
sqlite3Savepoint(pParse, SAVEPOINT_ROLLBACK, &yymsp[0].minor.yy0);
160089160276
}
160090160277
break;
160091160278
case 13: /* create_table ::= createkw temp TABLE ifnotexists nm dbnm */
160092160279
{
160093
- sqlite3StartTable(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,yymsp[-4].minor.yy412,0,0,yymsp[-2].minor.yy412);
160280
+ sqlite3StartTable(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,yymsp[-4].minor.yy60,0,0,yymsp[-2].minor.yy60);
160094160281
}
160095160282
break;
160096160283
case 14: /* createkw ::= CREATE */
160097160284
{disableLookaside(pParse);}
160098160285
break;
@@ -160103,36 +160290,36 @@
160103160290
case 60: /* init_deferred_pred_opt ::= */ yytestcase(yyruleno==60);
160104160291
case 70: /* defer_subclause_opt ::= */ yytestcase(yyruleno==70);
160105160292
case 79: /* ifexists ::= */ yytestcase(yyruleno==79);
160106160293
case 96: /* distinct ::= */ yytestcase(yyruleno==96);
160107160294
case 239: /* collate ::= */ yytestcase(yyruleno==239);
160108
-{yymsp[1].minor.yy412 = 0;}
160295
+{yymsp[1].minor.yy60 = 0;}
160109160296
break;
160110160297
case 16: /* ifnotexists ::= IF NOT EXISTS */
160111
-{yymsp[-2].minor.yy412 = 1;}
160298
+{yymsp[-2].minor.yy60 = 1;}
160112160299
break;
160113160300
case 17: /* temp ::= TEMP */
160114160301
case 46: /* autoinc ::= AUTOINCR */ yytestcase(yyruleno==46);
160115
-{yymsp[0].minor.yy412 = 1;}
160302
+{yymsp[0].minor.yy60 = 1;}
160116160303
break;
160117160304
case 19: /* create_table_args ::= LP columnlist conslist_opt RP table_options */
160118160305
{
160119
- sqlite3EndTable(pParse,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0,yymsp[0].minor.yy412,0);
160306
+ sqlite3EndTable(pParse,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0,yymsp[0].minor.yy60,0);
160120160307
}
160121160308
break;
160122160309
case 20: /* create_table_args ::= AS select */
160123160310
{
160124
- sqlite3EndTable(pParse,0,0,0,yymsp[0].minor.yy293);
160125
- sqlite3SelectDelete(pParse->db, yymsp[0].minor.yy293);
160311
+ sqlite3EndTable(pParse,0,0,0,yymsp[0].minor.yy307);
160312
+ sqlite3SelectDelete(pParse->db, yymsp[0].minor.yy307);
160126160313
}
160127160314
break;
160128160315
case 22: /* table_options ::= WITHOUT nm */
160129160316
{
160130160317
if( yymsp[0].minor.yy0.n==5 && sqlite3_strnicmp(yymsp[0].minor.yy0.z,"rowid",5)==0 ){
160131
- yymsp[-1].minor.yy412 = TF_WithoutRowid | TF_NoVisibleRowid;
160318
+ yymsp[-1].minor.yy60 = TF_WithoutRowid | TF_NoVisibleRowid;
160132160319
}else{
160133
- yymsp[-1].minor.yy412 = 0;
160320
+ yymsp[-1].minor.yy60 = 0;
160134160321
sqlite3ErrorMsg(pParse, "unknown table option: %.*s", yymsp[0].minor.yy0.n, yymsp[0].minor.yy0.z);
160135160322
}
160136160323
}
160137160324
break;
160138160325
case 23: /* columnname ::= nm typetoken */
@@ -160157,11 +160344,11 @@
160157160344
{yymsp[-1].minor.yy0.n=yymsp[0].minor.yy0.n+(int)(yymsp[0].minor.yy0.z-yymsp[-1].minor.yy0.z);}
160158160345
break;
160159160346
case 28: /* scanpt ::= */
160160160347
{
160161160348
assert( yyLookahead!=YYNOCODE );
160162
- yymsp[1].minor.yy504 = yyLookaheadToken.z;
160349
+ yymsp[1].minor.yy528 = yyLookaheadToken.z;
160163160350
}
160164160351
break;
160165160352
case 29: /* scantok ::= */
160166160353
{
160167160354
assert( yyLookahead!=YYNOCODE );
@@ -160171,21 +160358,21 @@
160171160358
case 30: /* ccons ::= CONSTRAINT nm */
160172160359
case 65: /* tcons ::= CONSTRAINT nm */ yytestcase(yyruleno==65);
160173160360
{pParse->constraintName = yymsp[0].minor.yy0;}
160174160361
break;
160175160362
case 31: /* ccons ::= DEFAULT scantok term */
160176
-{sqlite3AddDefaultValue(pParse,yymsp[0].minor.yy354,yymsp[-1].minor.yy0.z,&yymsp[-1].minor.yy0.z[yymsp[-1].minor.yy0.n]);}
160363
+{sqlite3AddDefaultValue(pParse,yymsp[0].minor.yy602,yymsp[-1].minor.yy0.z,&yymsp[-1].minor.yy0.z[yymsp[-1].minor.yy0.n]);}
160177160364
break;
160178160365
case 32: /* ccons ::= DEFAULT LP expr RP */
160179
-{sqlite3AddDefaultValue(pParse,yymsp[-1].minor.yy354,yymsp[-2].minor.yy0.z+1,yymsp[0].minor.yy0.z);}
160366
+{sqlite3AddDefaultValue(pParse,yymsp[-1].minor.yy602,yymsp[-2].minor.yy0.z+1,yymsp[0].minor.yy0.z);}
160180160367
break;
160181160368
case 33: /* ccons ::= DEFAULT PLUS scantok term */
160182
-{sqlite3AddDefaultValue(pParse,yymsp[0].minor.yy354,yymsp[-2].minor.yy0.z,&yymsp[-1].minor.yy0.z[yymsp[-1].minor.yy0.n]);}
160369
+{sqlite3AddDefaultValue(pParse,yymsp[0].minor.yy602,yymsp[-2].minor.yy0.z,&yymsp[-1].minor.yy0.z[yymsp[-1].minor.yy0.n]);}
160183160370
break;
160184160371
case 34: /* ccons ::= DEFAULT MINUS scantok term */
160185160372
{
160186
- Expr *p = sqlite3PExpr(pParse, TK_UMINUS, yymsp[0].minor.yy354, 0);
160373
+ Expr *p = sqlite3PExpr(pParse, TK_UMINUS, yymsp[0].minor.yy602, 0);
160187160374
sqlite3AddDefaultValue(pParse,p,yymsp[-2].minor.yy0.z,&yymsp[-1].minor.yy0.z[yymsp[-1].minor.yy0.n]);
160188160375
}
160189160376
break;
160190160377
case 35: /* ccons ::= DEFAULT scantok ID|INDEXED */
160191160378
{
@@ -160196,274 +160383,256 @@
160196160383
}
160197160384
sqlite3AddDefaultValue(pParse,p,yymsp[0].minor.yy0.z,yymsp[0].minor.yy0.z+yymsp[0].minor.yy0.n);
160198160385
}
160199160386
break;
160200160387
case 36: /* ccons ::= NOT NULL onconf */
160201
-{sqlite3AddNotNull(pParse, yymsp[0].minor.yy412);}
160388
+{sqlite3AddNotNull(pParse, yymsp[0].minor.yy60);}
160202160389
break;
160203160390
case 37: /* ccons ::= PRIMARY KEY sortorder onconf autoinc */
160204
-{sqlite3AddPrimaryKey(pParse,0,yymsp[-1].minor.yy412,yymsp[0].minor.yy412,yymsp[-2].minor.yy412);}
160391
+{sqlite3AddPrimaryKey(pParse,0,yymsp[-1].minor.yy60,yymsp[0].minor.yy60,yymsp[-2].minor.yy60);}
160205160392
break;
160206160393
case 38: /* ccons ::= UNIQUE onconf */
160207
-{sqlite3CreateIndex(pParse,0,0,0,0,yymsp[0].minor.yy412,0,0,0,0,
160394
+{sqlite3CreateIndex(pParse,0,0,0,0,yymsp[0].minor.yy60,0,0,0,0,
160208160395
SQLITE_IDXTYPE_UNIQUE);}
160209160396
break;
160210160397
case 39: /* ccons ::= CHECK LP expr RP */
160211
-{sqlite3AddCheckConstraint(pParse,yymsp[-1].minor.yy354,yymsp[-2].minor.yy0.z,yymsp[0].minor.yy0.z);}
160398
+{sqlite3AddCheckConstraint(pParse,yymsp[-1].minor.yy602,yymsp[-2].minor.yy0.z,yymsp[0].minor.yy0.z);}
160212160399
break;
160213160400
case 40: /* ccons ::= REFERENCES nm eidlist_opt refargs */
160214
-{sqlite3CreateForeignKey(pParse,0,&yymsp[-2].minor.yy0,yymsp[-1].minor.yy350,yymsp[0].minor.yy412);}
160401
+{sqlite3CreateForeignKey(pParse,0,&yymsp[-2].minor.yy0,yymsp[-1].minor.yy338,yymsp[0].minor.yy60);}
160215160402
break;
160216160403
case 41: /* ccons ::= defer_subclause */
160217
-{sqlite3DeferForeignKey(pParse,yymsp[0].minor.yy412);}
160404
+{sqlite3DeferForeignKey(pParse,yymsp[0].minor.yy60);}
160218160405
break;
160219160406
case 42: /* ccons ::= COLLATE ID|STRING */
160220160407
{sqlite3AddCollateType(pParse, &yymsp[0].minor.yy0);}
160221160408
break;
160222160409
case 43: /* generated ::= LP expr RP */
160223
-{sqlite3AddGenerated(pParse,yymsp[-1].minor.yy354,0);}
160410
+{sqlite3AddGenerated(pParse,yymsp[-1].minor.yy602,0);}
160224160411
break;
160225160412
case 44: /* generated ::= LP expr RP ID */
160226
-{sqlite3AddGenerated(pParse,yymsp[-2].minor.yy354,&yymsp[0].minor.yy0);}
160413
+{sqlite3AddGenerated(pParse,yymsp[-2].minor.yy602,&yymsp[0].minor.yy0);}
160227160414
break;
160228160415
case 47: /* refargs ::= */
160229
-{ yymsp[1].minor.yy412 = OE_None*0x0101; /* EV: R-19803-45884 */}
160416
+{ yymsp[1].minor.yy60 = OE_None*0x0101; /* EV: R-19803-45884 */}
160230160417
break;
160231160418
case 48: /* refargs ::= refargs refarg */
160232
-{ yymsp[-1].minor.yy412 = (yymsp[-1].minor.yy412 & ~yymsp[0].minor.yy463.mask) | yymsp[0].minor.yy463.value; }
160419
+{ yymsp[-1].minor.yy60 = (yymsp[-1].minor.yy60 & ~yymsp[0].minor.yy615.mask) | yymsp[0].minor.yy615.value; }
160233160420
break;
160234160421
case 49: /* refarg ::= MATCH nm */
160235
-{ yymsp[-1].minor.yy463.value = 0; yymsp[-1].minor.yy463.mask = 0x000000; }
160422
+{ yymsp[-1].minor.yy615.value = 0; yymsp[-1].minor.yy615.mask = 0x000000; }
160236160423
break;
160237160424
case 50: /* refarg ::= ON INSERT refact */
160238
-{ yymsp[-2].minor.yy463.value = 0; yymsp[-2].minor.yy463.mask = 0x000000; }
160425
+{ yymsp[-2].minor.yy615.value = 0; yymsp[-2].minor.yy615.mask = 0x000000; }
160239160426
break;
160240160427
case 51: /* refarg ::= ON DELETE refact */
160241
-{ yymsp[-2].minor.yy463.value = yymsp[0].minor.yy412; yymsp[-2].minor.yy463.mask = 0x0000ff; }
160428
+{ yymsp[-2].minor.yy615.value = yymsp[0].minor.yy60; yymsp[-2].minor.yy615.mask = 0x0000ff; }
160242160429
break;
160243160430
case 52: /* refarg ::= ON UPDATE refact */
160244
-{ yymsp[-2].minor.yy463.value = yymsp[0].minor.yy412<<8; yymsp[-2].minor.yy463.mask = 0x00ff00; }
160431
+{ yymsp[-2].minor.yy615.value = yymsp[0].minor.yy60<<8; yymsp[-2].minor.yy615.mask = 0x00ff00; }
160245160432
break;
160246160433
case 53: /* refact ::= SET NULL */
160247
-{ yymsp[-1].minor.yy412 = OE_SetNull; /* EV: R-33326-45252 */}
160434
+{ yymsp[-1].minor.yy60 = OE_SetNull; /* EV: R-33326-45252 */}
160248160435
break;
160249160436
case 54: /* refact ::= SET DEFAULT */
160250
-{ yymsp[-1].minor.yy412 = OE_SetDflt; /* EV: R-33326-45252 */}
160437
+{ yymsp[-1].minor.yy60 = OE_SetDflt; /* EV: R-33326-45252 */}
160251160438
break;
160252160439
case 55: /* refact ::= CASCADE */
160253
-{ yymsp[0].minor.yy412 = OE_Cascade; /* EV: R-33326-45252 */}
160440
+{ yymsp[0].minor.yy60 = OE_Cascade; /* EV: R-33326-45252 */}
160254160441
break;
160255160442
case 56: /* refact ::= RESTRICT */
160256
-{ yymsp[0].minor.yy412 = OE_Restrict; /* EV: R-33326-45252 */}
160443
+{ yymsp[0].minor.yy60 = OE_Restrict; /* EV: R-33326-45252 */}
160257160444
break;
160258160445
case 57: /* refact ::= NO ACTION */
160259
-{ yymsp[-1].minor.yy412 = OE_None; /* EV: R-33326-45252 */}
160446
+{ yymsp[-1].minor.yy60 = OE_None; /* EV: R-33326-45252 */}
160260160447
break;
160261160448
case 58: /* defer_subclause ::= NOT DEFERRABLE init_deferred_pred_opt */
160262
-{yymsp[-2].minor.yy412 = 0;}
160449
+{yymsp[-2].minor.yy60 = 0;}
160263160450
break;
160264160451
case 59: /* defer_subclause ::= DEFERRABLE init_deferred_pred_opt */
160265160452
case 74: /* orconf ::= OR resolvetype */ yytestcase(yyruleno==74);
160266160453
case 169: /* insert_cmd ::= INSERT orconf */ yytestcase(yyruleno==169);
160267
-{yymsp[-1].minor.yy412 = yymsp[0].minor.yy412;}
160454
+{yymsp[-1].minor.yy60 = yymsp[0].minor.yy60;}
160268160455
break;
160269160456
case 61: /* init_deferred_pred_opt ::= INITIALLY DEFERRED */
160270160457
case 78: /* ifexists ::= IF EXISTS */ yytestcase(yyruleno==78);
160271160458
case 211: /* between_op ::= NOT BETWEEN */ yytestcase(yyruleno==211);
160272160459
case 214: /* in_op ::= NOT IN */ yytestcase(yyruleno==214);
160273160460
case 240: /* collate ::= COLLATE ID|STRING */ yytestcase(yyruleno==240);
160274
-{yymsp[-1].minor.yy412 = 1;}
160461
+{yymsp[-1].minor.yy60 = 1;}
160275160462
break;
160276160463
case 62: /* init_deferred_pred_opt ::= INITIALLY IMMEDIATE */
160277
-{yymsp[-1].minor.yy412 = 0;}
160464
+{yymsp[-1].minor.yy60 = 0;}
160278160465
break;
160279160466
case 64: /* tconscomma ::= COMMA */
160280160467
{pParse->constraintName.n = 0;}
160281160468
break;
160282160469
case 66: /* tcons ::= PRIMARY KEY LP sortlist autoinc RP onconf */
160283
-{sqlite3AddPrimaryKey(pParse,yymsp[-3].minor.yy350,yymsp[0].minor.yy412,yymsp[-2].minor.yy412,0);}
160470
+{sqlite3AddPrimaryKey(pParse,yymsp[-3].minor.yy338,yymsp[0].minor.yy60,yymsp[-2].minor.yy60,0);}
160284160471
break;
160285160472
case 67: /* tcons ::= UNIQUE LP sortlist RP onconf */
160286
-{sqlite3CreateIndex(pParse,0,0,0,yymsp[-2].minor.yy350,yymsp[0].minor.yy412,0,0,0,0,
160473
+{sqlite3CreateIndex(pParse,0,0,0,yymsp[-2].minor.yy338,yymsp[0].minor.yy60,0,0,0,0,
160287160474
SQLITE_IDXTYPE_UNIQUE);}
160288160475
break;
160289160476
case 68: /* tcons ::= CHECK LP expr RP onconf */
160290
-{sqlite3AddCheckConstraint(pParse,yymsp[-2].minor.yy354,yymsp[-3].minor.yy0.z,yymsp[-1].minor.yy0.z);}
160477
+{sqlite3AddCheckConstraint(pParse,yymsp[-2].minor.yy602,yymsp[-3].minor.yy0.z,yymsp[-1].minor.yy0.z);}
160291160478
break;
160292160479
case 69: /* tcons ::= FOREIGN KEY LP eidlist RP REFERENCES nm eidlist_opt refargs defer_subclause_opt */
160293160480
{
160294
- sqlite3CreateForeignKey(pParse, yymsp[-6].minor.yy350, &yymsp[-3].minor.yy0, yymsp[-2].minor.yy350, yymsp[-1].minor.yy412);
160295
- sqlite3DeferForeignKey(pParse, yymsp[0].minor.yy412);
160481
+ sqlite3CreateForeignKey(pParse, yymsp[-6].minor.yy338, &yymsp[-3].minor.yy0, yymsp[-2].minor.yy338, yymsp[-1].minor.yy60);
160482
+ sqlite3DeferForeignKey(pParse, yymsp[0].minor.yy60);
160296160483
}
160297160484
break;
160298160485
case 71: /* onconf ::= */
160299160486
case 73: /* orconf ::= */ yytestcase(yyruleno==73);
160300
-{yymsp[1].minor.yy412 = OE_Default;}
160487
+{yymsp[1].minor.yy60 = OE_Default;}
160301160488
break;
160302160489
case 72: /* onconf ::= ON CONFLICT resolvetype */
160303
-{yymsp[-2].minor.yy412 = yymsp[0].minor.yy412;}
160490
+{yymsp[-2].minor.yy60 = yymsp[0].minor.yy60;}
160304160491
break;
160305160492
case 75: /* resolvetype ::= IGNORE */
160306
-{yymsp[0].minor.yy412 = OE_Ignore;}
160493
+{yymsp[0].minor.yy60 = OE_Ignore;}
160307160494
break;
160308160495
case 76: /* resolvetype ::= REPLACE */
160309160496
case 170: /* insert_cmd ::= REPLACE */ yytestcase(yyruleno==170);
160310
-{yymsp[0].minor.yy412 = OE_Replace;}
160497
+{yymsp[0].minor.yy60 = OE_Replace;}
160311160498
break;
160312160499
case 77: /* cmd ::= DROP TABLE ifexists fullname */
160313160500
{
160314
- sqlite3DropTable(pParse, yymsp[0].minor.yy457, 0, yymsp[-1].minor.yy412);
160501
+ sqlite3DropTable(pParse, yymsp[0].minor.yy291, 0, yymsp[-1].minor.yy60);
160315160502
}
160316160503
break;
160317160504
case 80: /* cmd ::= createkw temp VIEW ifnotexists nm dbnm eidlist_opt AS select */
160318160505
{
160319
- sqlite3CreateView(pParse, &yymsp[-8].minor.yy0, &yymsp[-4].minor.yy0, &yymsp[-3].minor.yy0, yymsp[-2].minor.yy350, yymsp[0].minor.yy293, yymsp[-7].minor.yy412, yymsp[-5].minor.yy412);
160506
+ sqlite3CreateView(pParse, &yymsp[-8].minor.yy0, &yymsp[-4].minor.yy0, &yymsp[-3].minor.yy0, yymsp[-2].minor.yy338, yymsp[0].minor.yy307, yymsp[-7].minor.yy60, yymsp[-5].minor.yy60);
160320160507
}
160321160508
break;
160322160509
case 81: /* cmd ::= DROP VIEW ifexists fullname */
160323160510
{
160324
- sqlite3DropTable(pParse, yymsp[0].minor.yy457, 1, yymsp[-1].minor.yy412);
160511
+ sqlite3DropTable(pParse, yymsp[0].minor.yy291, 1, yymsp[-1].minor.yy60);
160325160512
}
160326160513
break;
160327160514
case 82: /* cmd ::= select */
160328160515
{
160329160516
SelectDest dest = {SRT_Output, 0, 0, 0, 0, 0, 0};
160330
- sqlite3Select(pParse, yymsp[0].minor.yy293, &dest);
160331
- sqlite3SelectDelete(pParse->db, yymsp[0].minor.yy293);
160517
+ sqlite3Select(pParse, yymsp[0].minor.yy307, &dest);
160518
+ sqlite3SelectDelete(pParse->db, yymsp[0].minor.yy307);
160332160519
}
160333160520
break;
160334160521
case 83: /* select ::= WITH wqlist selectnowith */
160335
-{
160336
- Select *p = yymsp[0].minor.yy293;
160337
- if( p ){
160338
- p->pWith = yymsp[-1].minor.yy105;
160339
- parserDoubleLinkSelect(pParse, p);
160340
- }else{
160341
- sqlite3WithDelete(pParse->db, yymsp[-1].minor.yy105);
160342
- }
160343
- yymsp[-2].minor.yy293 = p;
160344
-}
160522
+{yymsp[-2].minor.yy307 = attachWithToSelect(pParse,yymsp[0].minor.yy307,yymsp[-1].minor.yy195);}
160345160523
break;
160346160524
case 84: /* select ::= WITH RECURSIVE wqlist selectnowith */
160347
-{
160348
- Select *p = yymsp[0].minor.yy293;
160349
- if( p ){
160350
- p->pWith = yymsp[-1].minor.yy105;
160351
- parserDoubleLinkSelect(pParse, p);
160352
- }else{
160353
- sqlite3WithDelete(pParse->db, yymsp[-1].minor.yy105);
160354
- }
160355
- yymsp[-3].minor.yy293 = p;
160356
-}
160525
+{yymsp[-3].minor.yy307 = attachWithToSelect(pParse,yymsp[0].minor.yy307,yymsp[-1].minor.yy195);}
160357160526
break;
160358160527
case 85: /* select ::= selectnowith */
160359160528
{
160360
- Select *p = yymsp[0].minor.yy293;
160529
+ Select *p = yymsp[0].minor.yy307;
160361160530
if( p ){
160362160531
parserDoubleLinkSelect(pParse, p);
160363160532
}
160364
- yymsp[0].minor.yy293 = p; /*A-overwrites-X*/
160533
+ yymsp[0].minor.yy307 = p; /*A-overwrites-X*/
160365160534
}
160366160535
break;
160367160536
case 86: /* selectnowith ::= selectnowith multiselect_op oneselect */
160368160537
{
160369
- Select *pRhs = yymsp[0].minor.yy293;
160370
- Select *pLhs = yymsp[-2].minor.yy293;
160538
+ Select *pRhs = yymsp[0].minor.yy307;
160539
+ Select *pLhs = yymsp[-2].minor.yy307;
160371160540
if( pRhs && pRhs->pPrior ){
160372160541
SrcList *pFrom;
160373160542
Token x;
160374160543
x.n = 0;
160375160544
parserDoubleLinkSelect(pParse, pRhs);
160376160545
pFrom = sqlite3SrcListAppendFromTerm(pParse,0,0,0,&x,pRhs,0,0);
160377160546
pRhs = sqlite3SelectNew(pParse,0,pFrom,0,0,0,0,0,0);
160378160547
}
160379160548
if( pRhs ){
160380
- pRhs->op = (u8)yymsp[-1].minor.yy412;
160549
+ pRhs->op = (u8)yymsp[-1].minor.yy60;
160381160550
pRhs->pPrior = pLhs;
160382160551
if( ALWAYS(pLhs) ) pLhs->selFlags &= ~SF_MultiValue;
160383160552
pRhs->selFlags &= ~SF_MultiValue;
160384
- if( yymsp[-1].minor.yy412!=TK_ALL ) pParse->hasCompound = 1;
160553
+ if( yymsp[-1].minor.yy60!=TK_ALL ) pParse->hasCompound = 1;
160385160554
}else{
160386160555
sqlite3SelectDelete(pParse->db, pLhs);
160387160556
}
160388
- yymsp[-2].minor.yy293 = pRhs;
160557
+ yymsp[-2].minor.yy307 = pRhs;
160389160558
}
160390160559
break;
160391160560
case 87: /* multiselect_op ::= UNION */
160392160561
case 89: /* multiselect_op ::= EXCEPT|INTERSECT */ yytestcase(yyruleno==89);
160393
-{yymsp[0].minor.yy412 = yymsp[0].major; /*A-overwrites-OP*/}
160562
+{yymsp[0].minor.yy60 = yymsp[0].major; /*A-overwrites-OP*/}
160394160563
break;
160395160564
case 88: /* multiselect_op ::= UNION ALL */
160396
-{yymsp[-1].minor.yy412 = TK_ALL;}
160565
+{yymsp[-1].minor.yy60 = TK_ALL;}
160397160566
break;
160398160567
case 90: /* oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt orderby_opt limit_opt */
160399160568
{
160400
- yymsp[-8].minor.yy293 = sqlite3SelectNew(pParse,yymsp[-6].minor.yy350,yymsp[-5].minor.yy457,yymsp[-4].minor.yy354,yymsp[-3].minor.yy350,yymsp[-2].minor.yy354,yymsp[-1].minor.yy350,yymsp[-7].minor.yy412,yymsp[0].minor.yy354);
160569
+ yymsp[-8].minor.yy307 = sqlite3SelectNew(pParse,yymsp[-6].minor.yy338,yymsp[-5].minor.yy291,yymsp[-4].minor.yy602,yymsp[-3].minor.yy338,yymsp[-2].minor.yy602,yymsp[-1].minor.yy338,yymsp[-7].minor.yy60,yymsp[0].minor.yy602);
160401160570
}
160402160571
break;
160403160572
case 91: /* oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt window_clause orderby_opt limit_opt */
160404160573
{
160405
- yymsp[-9].minor.yy293 = sqlite3SelectNew(pParse,yymsp[-7].minor.yy350,yymsp[-6].minor.yy457,yymsp[-5].minor.yy354,yymsp[-4].minor.yy350,yymsp[-3].minor.yy354,yymsp[-1].minor.yy350,yymsp[-8].minor.yy412,yymsp[0].minor.yy354);
160406
- if( yymsp[-9].minor.yy293 ){
160407
- yymsp[-9].minor.yy293->pWinDefn = yymsp[-2].minor.yy503;
160574
+ yymsp[-9].minor.yy307 = sqlite3SelectNew(pParse,yymsp[-7].minor.yy338,yymsp[-6].minor.yy291,yymsp[-5].minor.yy602,yymsp[-4].minor.yy338,yymsp[-3].minor.yy602,yymsp[-1].minor.yy338,yymsp[-8].minor.yy60,yymsp[0].minor.yy602);
160575
+ if( yymsp[-9].minor.yy307 ){
160576
+ yymsp[-9].minor.yy307->pWinDefn = yymsp[-2].minor.yy19;
160408160577
}else{
160409
- sqlite3WindowListDelete(pParse->db, yymsp[-2].minor.yy503);
160578
+ sqlite3WindowListDelete(pParse->db, yymsp[-2].minor.yy19);
160410160579
}
160411160580
}
160412160581
break;
160413160582
case 92: /* values ::= VALUES LP nexprlist RP */
160414160583
{
160415
- yymsp[-3].minor.yy293 = sqlite3SelectNew(pParse,yymsp[-1].minor.yy350,0,0,0,0,0,SF_Values,0);
160584
+ yymsp[-3].minor.yy307 = sqlite3SelectNew(pParse,yymsp[-1].minor.yy338,0,0,0,0,0,SF_Values,0);
160416160585
}
160417160586
break;
160418160587
case 93: /* values ::= values COMMA LP nexprlist RP */
160419160588
{
160420
- Select *pRight, *pLeft = yymsp[-4].minor.yy293;
160421
- pRight = sqlite3SelectNew(pParse,yymsp[-1].minor.yy350,0,0,0,0,0,SF_Values|SF_MultiValue,0);
160589
+ Select *pRight, *pLeft = yymsp[-4].minor.yy307;
160590
+ pRight = sqlite3SelectNew(pParse,yymsp[-1].minor.yy338,0,0,0,0,0,SF_Values|SF_MultiValue,0);
160422160591
if( ALWAYS(pLeft) ) pLeft->selFlags &= ~SF_MultiValue;
160423160592
if( pRight ){
160424160593
pRight->op = TK_ALL;
160425160594
pRight->pPrior = pLeft;
160426
- yymsp[-4].minor.yy293 = pRight;
160595
+ yymsp[-4].minor.yy307 = pRight;
160427160596
}else{
160428
- yymsp[-4].minor.yy293 = pLeft;
160597
+ yymsp[-4].minor.yy307 = pLeft;
160429160598
}
160430160599
}
160431160600
break;
160432160601
case 94: /* distinct ::= DISTINCT */
160433
-{yymsp[0].minor.yy412 = SF_Distinct;}
160602
+{yymsp[0].minor.yy60 = SF_Distinct;}
160434160603
break;
160435160604
case 95: /* distinct ::= ALL */
160436
-{yymsp[0].minor.yy412 = SF_All;}
160605
+{yymsp[0].minor.yy60 = SF_All;}
160437160606
break;
160438160607
case 97: /* sclp ::= */
160439160608
case 130: /* orderby_opt ::= */ yytestcase(yyruleno==130);
160440160609
case 140: /* groupby_opt ::= */ yytestcase(yyruleno==140);
160441160610
case 227: /* exprlist ::= */ yytestcase(yyruleno==227);
160442160611
case 230: /* paren_exprlist ::= */ yytestcase(yyruleno==230);
160443160612
case 235: /* eidlist_opt ::= */ yytestcase(yyruleno==235);
160444
-{yymsp[1].minor.yy350 = 0;}
160613
+{yymsp[1].minor.yy338 = 0;}
160445160614
break;
160446160615
case 98: /* selcollist ::= sclp scanpt expr scanpt as */
160447160616
{
160448
- yymsp[-4].minor.yy350 = sqlite3ExprListAppend(pParse, yymsp[-4].minor.yy350, yymsp[-2].minor.yy354);
160449
- if( yymsp[0].minor.yy0.n>0 ) sqlite3ExprListSetName(pParse, yymsp[-4].minor.yy350, &yymsp[0].minor.yy0, 1);
160450
- sqlite3ExprListSetSpan(pParse,yymsp[-4].minor.yy350,yymsp[-3].minor.yy504,yymsp[-1].minor.yy504);
160617
+ yymsp[-4].minor.yy338 = sqlite3ExprListAppend(pParse, yymsp[-4].minor.yy338, yymsp[-2].minor.yy602);
160618
+ if( yymsp[0].minor.yy0.n>0 ) sqlite3ExprListSetName(pParse, yymsp[-4].minor.yy338, &yymsp[0].minor.yy0, 1);
160619
+ sqlite3ExprListSetSpan(pParse,yymsp[-4].minor.yy338,yymsp[-3].minor.yy528,yymsp[-1].minor.yy528);
160451160620
}
160452160621
break;
160453160622
case 99: /* selcollist ::= sclp scanpt STAR */
160454160623
{
160455160624
Expr *p = sqlite3Expr(pParse->db, TK_ASTERISK, 0);
160456
- yymsp[-2].minor.yy350 = sqlite3ExprListAppend(pParse, yymsp[-2].minor.yy350, p);
160625
+ yymsp[-2].minor.yy338 = sqlite3ExprListAppend(pParse, yymsp[-2].minor.yy338, p);
160457160626
}
160458160627
break;
160459160628
case 100: /* selcollist ::= sclp scanpt nm DOT STAR */
160460160629
{
160461160630
Expr *pRight = sqlite3PExpr(pParse, TK_ASTERISK, 0, 0);
160462160631
Expr *pLeft = sqlite3ExprAlloc(pParse->db, TK_ID, &yymsp[-2].minor.yy0, 1);
160463160632
Expr *pDot = sqlite3PExpr(pParse, TK_DOT, pLeft, pRight);
160464
- yymsp[-4].minor.yy350 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy350, pDot);
160633
+ yymsp[-4].minor.yy338 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy338, pDot);
160465160634
}
160466160635
break;
160467160636
case 101: /* as ::= AS nm */
160468160637
case 112: /* dbnm ::= DOT nm */ yytestcase(yyruleno==112);
160469160638
case 251: /* plus_num ::= PLUS INTEGER|FLOAT */ yytestcase(yyruleno==251);
@@ -160470,49 +160639,49 @@
160470160639
case 252: /* minus_num ::= MINUS INTEGER|FLOAT */ yytestcase(yyruleno==252);
160471160640
{yymsp[-1].minor.yy0 = yymsp[0].minor.yy0;}
160472160641
break;
160473160642
case 103: /* from ::= */
160474160643
case 106: /* stl_prefix ::= */ yytestcase(yyruleno==106);
160475
-{yymsp[1].minor.yy457 = 0;}
160644
+{yymsp[1].minor.yy291 = 0;}
160476160645
break;
160477160646
case 104: /* from ::= FROM seltablist */
160478160647
{
160479
- yymsp[-1].minor.yy457 = yymsp[0].minor.yy457;
160480
- sqlite3SrcListShiftJoinType(yymsp[-1].minor.yy457);
160648
+ yymsp[-1].minor.yy291 = yymsp[0].minor.yy291;
160649
+ sqlite3SrcListShiftJoinType(yymsp[-1].minor.yy291);
160481160650
}
160482160651
break;
160483160652
case 105: /* stl_prefix ::= seltablist joinop */
160484160653
{
160485
- if( ALWAYS(yymsp[-1].minor.yy457 && yymsp[-1].minor.yy457->nSrc>0) ) yymsp[-1].minor.yy457->a[yymsp[-1].minor.yy457->nSrc-1].fg.jointype = (u8)yymsp[0].minor.yy412;
160654
+ if( ALWAYS(yymsp[-1].minor.yy291 && yymsp[-1].minor.yy291->nSrc>0) ) yymsp[-1].minor.yy291->a[yymsp[-1].minor.yy291->nSrc-1].fg.jointype = (u8)yymsp[0].minor.yy60;
160486160655
}
160487160656
break;
160488160657
case 107: /* seltablist ::= stl_prefix nm dbnm as indexed_opt on_opt using_opt */
160489160658
{
160490
- yymsp[-6].minor.yy457 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy457,&yymsp[-5].minor.yy0,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,0,yymsp[-1].minor.yy354,yymsp[0].minor.yy498);
160491
- sqlite3SrcListIndexedBy(pParse, yymsp[-6].minor.yy457, &yymsp[-2].minor.yy0);
160659
+ yymsp[-6].minor.yy291 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy291,&yymsp[-5].minor.yy0,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,0,yymsp[-1].minor.yy602,yymsp[0].minor.yy288);
160660
+ sqlite3SrcListIndexedBy(pParse, yymsp[-6].minor.yy291, &yymsp[-2].minor.yy0);
160492160661
}
160493160662
break;
160494160663
case 108: /* seltablist ::= stl_prefix nm dbnm LP exprlist RP as on_opt using_opt */
160495160664
{
160496
- yymsp[-8].minor.yy457 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-8].minor.yy457,&yymsp[-7].minor.yy0,&yymsp[-6].minor.yy0,&yymsp[-2].minor.yy0,0,yymsp[-1].minor.yy354,yymsp[0].minor.yy498);
160497
- sqlite3SrcListFuncArgs(pParse, yymsp[-8].minor.yy457, yymsp[-4].minor.yy350);
160665
+ yymsp[-8].minor.yy291 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-8].minor.yy291,&yymsp[-7].minor.yy0,&yymsp[-6].minor.yy0,&yymsp[-2].minor.yy0,0,yymsp[-1].minor.yy602,yymsp[0].minor.yy288);
160666
+ sqlite3SrcListFuncArgs(pParse, yymsp[-8].minor.yy291, yymsp[-4].minor.yy338);
160498160667
}
160499160668
break;
160500160669
case 109: /* seltablist ::= stl_prefix LP select RP as on_opt using_opt */
160501160670
{
160502
- yymsp[-6].minor.yy457 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy457,0,0,&yymsp[-2].minor.yy0,yymsp[-4].minor.yy293,yymsp[-1].minor.yy354,yymsp[0].minor.yy498);
160671
+ yymsp[-6].minor.yy291 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy291,0,0,&yymsp[-2].minor.yy0,yymsp[-4].minor.yy307,yymsp[-1].minor.yy602,yymsp[0].minor.yy288);
160503160672
}
160504160673
break;
160505160674
case 110: /* seltablist ::= stl_prefix LP seltablist RP as on_opt using_opt */
160506160675
{
160507
- if( yymsp[-6].minor.yy457==0 && yymsp[-2].minor.yy0.n==0 && yymsp[-1].minor.yy354==0 && yymsp[0].minor.yy498==0 ){
160508
- yymsp[-6].minor.yy457 = yymsp[-4].minor.yy457;
160509
- }else if( yymsp[-4].minor.yy457->nSrc==1 ){
160510
- yymsp[-6].minor.yy457 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy457,0,0,&yymsp[-2].minor.yy0,0,yymsp[-1].minor.yy354,yymsp[0].minor.yy498);
160511
- if( yymsp[-6].minor.yy457 ){
160512
- struct SrcList_item *pNew = &yymsp[-6].minor.yy457->a[yymsp[-6].minor.yy457->nSrc-1];
160513
- struct SrcList_item *pOld = yymsp[-4].minor.yy457->a;
160676
+ if( yymsp[-6].minor.yy291==0 && yymsp[-2].minor.yy0.n==0 && yymsp[-1].minor.yy602==0 && yymsp[0].minor.yy288==0 ){
160677
+ yymsp[-6].minor.yy291 = yymsp[-4].minor.yy291;
160678
+ }else if( yymsp[-4].minor.yy291->nSrc==1 ){
160679
+ yymsp[-6].minor.yy291 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy291,0,0,&yymsp[-2].minor.yy0,0,yymsp[-1].minor.yy602,yymsp[0].minor.yy288);
160680
+ if( yymsp[-6].minor.yy291 ){
160681
+ SrcItem *pNew = &yymsp[-6].minor.yy291->a[yymsp[-6].minor.yy291->nSrc-1];
160682
+ SrcItem *pOld = yymsp[-4].minor.yy291->a;
160514160683
pNew->zName = pOld->zName;
160515160684
pNew->zDatabase = pOld->zDatabase;
160516160685
pNew->pSelect = pOld->pSelect;
160517160686
if( pOld->fg.isTabFunc ){
160518160687
pNew->u1.pFuncArg = pOld->u1.pFuncArg;
@@ -160521,240 +160690,240 @@
160521160690
pNew->fg.isTabFunc = 1;
160522160691
}
160523160692
pOld->zName = pOld->zDatabase = 0;
160524160693
pOld->pSelect = 0;
160525160694
}
160526
- sqlite3SrcListDelete(pParse->db, yymsp[-4].minor.yy457);
160695
+ sqlite3SrcListDelete(pParse->db, yymsp[-4].minor.yy291);
160527160696
}else{
160528160697
Select *pSubquery;
160529
- sqlite3SrcListShiftJoinType(yymsp[-4].minor.yy457);
160530
- pSubquery = sqlite3SelectNew(pParse,0,yymsp[-4].minor.yy457,0,0,0,0,SF_NestedFrom,0);
160531
- yymsp[-6].minor.yy457 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy457,0,0,&yymsp[-2].minor.yy0,pSubquery,yymsp[-1].minor.yy354,yymsp[0].minor.yy498);
160698
+ sqlite3SrcListShiftJoinType(yymsp[-4].minor.yy291);
160699
+ pSubquery = sqlite3SelectNew(pParse,0,yymsp[-4].minor.yy291,0,0,0,0,SF_NestedFrom,0);
160700
+ yymsp[-6].minor.yy291 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy291,0,0,&yymsp[-2].minor.yy0,pSubquery,yymsp[-1].minor.yy602,yymsp[0].minor.yy288);
160532160701
}
160533160702
}
160534160703
break;
160535160704
case 111: /* dbnm ::= */
160536160705
case 125: /* indexed_opt ::= */ yytestcase(yyruleno==125);
160537160706
{yymsp[1].minor.yy0.z=0; yymsp[1].minor.yy0.n=0;}
160538160707
break;
160539160708
case 113: /* fullname ::= nm */
160540160709
{
160541
- yylhsminor.yy457 = sqlite3SrcListAppend(pParse,0,&yymsp[0].minor.yy0,0);
160542
- if( IN_RENAME_OBJECT && yylhsminor.yy457 ) sqlite3RenameTokenMap(pParse, yylhsminor.yy457->a[0].zName, &yymsp[0].minor.yy0);
160710
+ yylhsminor.yy291 = sqlite3SrcListAppend(pParse,0,&yymsp[0].minor.yy0,0);
160711
+ if( IN_RENAME_OBJECT && yylhsminor.yy291 ) sqlite3RenameTokenMap(pParse, yylhsminor.yy291->a[0].zName, &yymsp[0].minor.yy0);
160543160712
}
160544
- yymsp[0].minor.yy457 = yylhsminor.yy457;
160713
+ yymsp[0].minor.yy291 = yylhsminor.yy291;
160545160714
break;
160546160715
case 114: /* fullname ::= nm DOT nm */
160547160716
{
160548
- yylhsminor.yy457 = sqlite3SrcListAppend(pParse,0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0);
160549
- if( IN_RENAME_OBJECT && yylhsminor.yy457 ) sqlite3RenameTokenMap(pParse, yylhsminor.yy457->a[0].zName, &yymsp[0].minor.yy0);
160717
+ yylhsminor.yy291 = sqlite3SrcListAppend(pParse,0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0);
160718
+ if( IN_RENAME_OBJECT && yylhsminor.yy291 ) sqlite3RenameTokenMap(pParse, yylhsminor.yy291->a[0].zName, &yymsp[0].minor.yy0);
160550160719
}
160551
- yymsp[-2].minor.yy457 = yylhsminor.yy457;
160720
+ yymsp[-2].minor.yy291 = yylhsminor.yy291;
160552160721
break;
160553160722
case 115: /* xfullname ::= nm */
160554
-{yymsp[0].minor.yy457 = sqlite3SrcListAppend(pParse,0,&yymsp[0].minor.yy0,0); /*A-overwrites-X*/}
160723
+{yymsp[0].minor.yy291 = sqlite3SrcListAppend(pParse,0,&yymsp[0].minor.yy0,0); /*A-overwrites-X*/}
160555160724
break;
160556160725
case 116: /* xfullname ::= nm DOT nm */
160557
-{yymsp[-2].minor.yy457 = sqlite3SrcListAppend(pParse,0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0); /*A-overwrites-X*/}
160726
+{yymsp[-2].minor.yy291 = sqlite3SrcListAppend(pParse,0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0); /*A-overwrites-X*/}
160558160727
break;
160559160728
case 117: /* xfullname ::= nm DOT nm AS nm */
160560160729
{
160561
- yymsp[-4].minor.yy457 = sqlite3SrcListAppend(pParse,0,&yymsp[-4].minor.yy0,&yymsp[-2].minor.yy0); /*A-overwrites-X*/
160562
- if( yymsp[-4].minor.yy457 ) yymsp[-4].minor.yy457->a[0].zAlias = sqlite3NameFromToken(pParse->db, &yymsp[0].minor.yy0);
160730
+ yymsp[-4].minor.yy291 = sqlite3SrcListAppend(pParse,0,&yymsp[-4].minor.yy0,&yymsp[-2].minor.yy0); /*A-overwrites-X*/
160731
+ if( yymsp[-4].minor.yy291 ) yymsp[-4].minor.yy291->a[0].zAlias = sqlite3NameFromToken(pParse->db, &yymsp[0].minor.yy0);
160563160732
}
160564160733
break;
160565160734
case 118: /* xfullname ::= nm AS nm */
160566160735
{
160567
- yymsp[-2].minor.yy457 = sqlite3SrcListAppend(pParse,0,&yymsp[-2].minor.yy0,0); /*A-overwrites-X*/
160568
- if( yymsp[-2].minor.yy457 ) yymsp[-2].minor.yy457->a[0].zAlias = sqlite3NameFromToken(pParse->db, &yymsp[0].minor.yy0);
160736
+ yymsp[-2].minor.yy291 = sqlite3SrcListAppend(pParse,0,&yymsp[-2].minor.yy0,0); /*A-overwrites-X*/
160737
+ if( yymsp[-2].minor.yy291 ) yymsp[-2].minor.yy291->a[0].zAlias = sqlite3NameFromToken(pParse->db, &yymsp[0].minor.yy0);
160569160738
}
160570160739
break;
160571160740
case 119: /* joinop ::= COMMA|JOIN */
160572
-{ yymsp[0].minor.yy412 = JT_INNER; }
160741
+{ yymsp[0].minor.yy60 = JT_INNER; }
160573160742
break;
160574160743
case 120: /* joinop ::= JOIN_KW JOIN */
160575
-{yymsp[-1].minor.yy412 = sqlite3JoinType(pParse,&yymsp[-1].minor.yy0,0,0); /*X-overwrites-A*/}
160744
+{yymsp[-1].minor.yy60 = sqlite3JoinType(pParse,&yymsp[-1].minor.yy0,0,0); /*X-overwrites-A*/}
160576160745
break;
160577160746
case 121: /* joinop ::= JOIN_KW nm JOIN */
160578
-{yymsp[-2].minor.yy412 = sqlite3JoinType(pParse,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0,0); /*X-overwrites-A*/}
160747
+{yymsp[-2].minor.yy60 = sqlite3JoinType(pParse,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0,0); /*X-overwrites-A*/}
160579160748
break;
160580160749
case 122: /* joinop ::= JOIN_KW nm nm JOIN */
160581
-{yymsp[-3].minor.yy412 = sqlite3JoinType(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0);/*X-overwrites-A*/}
160750
+{yymsp[-3].minor.yy60 = sqlite3JoinType(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0);/*X-overwrites-A*/}
160582160751
break;
160583160752
case 123: /* on_opt ::= ON expr */
160584160753
case 143: /* having_opt ::= HAVING expr */ yytestcase(yyruleno==143);
160585160754
case 150: /* where_opt ::= WHERE expr */ yytestcase(yyruleno==150);
160586160755
case 152: /* where_opt_ret ::= WHERE expr */ yytestcase(yyruleno==152);
160587160756
case 223: /* case_else ::= ELSE expr */ yytestcase(yyruleno==223);
160588160757
case 244: /* vinto ::= INTO expr */ yytestcase(yyruleno==244);
160589
-{yymsp[-1].minor.yy354 = yymsp[0].minor.yy354;}
160758
+{yymsp[-1].minor.yy602 = yymsp[0].minor.yy602;}
160590160759
break;
160591160760
case 124: /* on_opt ::= */
160592160761
case 142: /* having_opt ::= */ yytestcase(yyruleno==142);
160593160762
case 144: /* limit_opt ::= */ yytestcase(yyruleno==144);
160594160763
case 149: /* where_opt ::= */ yytestcase(yyruleno==149);
160595160764
case 151: /* where_opt_ret ::= */ yytestcase(yyruleno==151);
160596160765
case 224: /* case_else ::= */ yytestcase(yyruleno==224);
160597160766
case 226: /* case_operand ::= */ yytestcase(yyruleno==226);
160598160767
case 245: /* vinto ::= */ yytestcase(yyruleno==245);
160599
-{yymsp[1].minor.yy354 = 0;}
160768
+{yymsp[1].minor.yy602 = 0;}
160600160769
break;
160601160770
case 126: /* indexed_opt ::= INDEXED BY nm */
160602160771
{yymsp[-2].minor.yy0 = yymsp[0].minor.yy0;}
160603160772
break;
160604160773
case 127: /* indexed_opt ::= NOT INDEXED */
160605160774
{yymsp[-1].minor.yy0.z=0; yymsp[-1].minor.yy0.n=1;}
160606160775
break;
160607160776
case 128: /* using_opt ::= USING LP idlist RP */
160608
-{yymsp[-3].minor.yy498 = yymsp[-1].minor.yy498;}
160777
+{yymsp[-3].minor.yy288 = yymsp[-1].minor.yy288;}
160609160778
break;
160610160779
case 129: /* using_opt ::= */
160611160780
case 171: /* idlist_opt ::= */ yytestcase(yyruleno==171);
160612
-{yymsp[1].minor.yy498 = 0;}
160781
+{yymsp[1].minor.yy288 = 0;}
160613160782
break;
160614160783
case 131: /* orderby_opt ::= ORDER BY sortlist */
160615160784
case 141: /* groupby_opt ::= GROUP BY nexprlist */ yytestcase(yyruleno==141);
160616
-{yymsp[-2].minor.yy350 = yymsp[0].minor.yy350;}
160785
+{yymsp[-2].minor.yy338 = yymsp[0].minor.yy338;}
160617160786
break;
160618160787
case 132: /* sortlist ::= sortlist COMMA expr sortorder nulls */
160619160788
{
160620
- yymsp[-4].minor.yy350 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy350,yymsp[-2].minor.yy354);
160621
- sqlite3ExprListSetSortOrder(yymsp[-4].minor.yy350,yymsp[-1].minor.yy412,yymsp[0].minor.yy412);
160789
+ yymsp[-4].minor.yy338 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy338,yymsp[-2].minor.yy602);
160790
+ sqlite3ExprListSetSortOrder(yymsp[-4].minor.yy338,yymsp[-1].minor.yy60,yymsp[0].minor.yy60);
160622160791
}
160623160792
break;
160624160793
case 133: /* sortlist ::= expr sortorder nulls */
160625160794
{
160626
- yymsp[-2].minor.yy350 = sqlite3ExprListAppend(pParse,0,yymsp[-2].minor.yy354); /*A-overwrites-Y*/
160627
- sqlite3ExprListSetSortOrder(yymsp[-2].minor.yy350,yymsp[-1].minor.yy412,yymsp[0].minor.yy412);
160795
+ yymsp[-2].minor.yy338 = sqlite3ExprListAppend(pParse,0,yymsp[-2].minor.yy602); /*A-overwrites-Y*/
160796
+ sqlite3ExprListSetSortOrder(yymsp[-2].minor.yy338,yymsp[-1].minor.yy60,yymsp[0].minor.yy60);
160628160797
}
160629160798
break;
160630160799
case 134: /* sortorder ::= ASC */
160631
-{yymsp[0].minor.yy412 = SQLITE_SO_ASC;}
160800
+{yymsp[0].minor.yy60 = SQLITE_SO_ASC;}
160632160801
break;
160633160802
case 135: /* sortorder ::= DESC */
160634
-{yymsp[0].minor.yy412 = SQLITE_SO_DESC;}
160803
+{yymsp[0].minor.yy60 = SQLITE_SO_DESC;}
160635160804
break;
160636160805
case 136: /* sortorder ::= */
160637160806
case 139: /* nulls ::= */ yytestcase(yyruleno==139);
160638
-{yymsp[1].minor.yy412 = SQLITE_SO_UNDEFINED;}
160807
+{yymsp[1].minor.yy60 = SQLITE_SO_UNDEFINED;}
160639160808
break;
160640160809
case 137: /* nulls ::= NULLS FIRST */
160641
-{yymsp[-1].minor.yy412 = SQLITE_SO_ASC;}
160810
+{yymsp[-1].minor.yy60 = SQLITE_SO_ASC;}
160642160811
break;
160643160812
case 138: /* nulls ::= NULLS LAST */
160644
-{yymsp[-1].minor.yy412 = SQLITE_SO_DESC;}
160813
+{yymsp[-1].minor.yy60 = SQLITE_SO_DESC;}
160645160814
break;
160646160815
case 145: /* limit_opt ::= LIMIT expr */
160647
-{yymsp[-1].minor.yy354 = sqlite3PExpr(pParse,TK_LIMIT,yymsp[0].minor.yy354,0);}
160816
+{yymsp[-1].minor.yy602 = sqlite3PExpr(pParse,TK_LIMIT,yymsp[0].minor.yy602,0);}
160648160817
break;
160649160818
case 146: /* limit_opt ::= LIMIT expr OFFSET expr */
160650
-{yymsp[-3].minor.yy354 = sqlite3PExpr(pParse,TK_LIMIT,yymsp[-2].minor.yy354,yymsp[0].minor.yy354);}
160819
+{yymsp[-3].minor.yy602 = sqlite3PExpr(pParse,TK_LIMIT,yymsp[-2].minor.yy602,yymsp[0].minor.yy602);}
160651160820
break;
160652160821
case 147: /* limit_opt ::= LIMIT expr COMMA expr */
160653
-{yymsp[-3].minor.yy354 = sqlite3PExpr(pParse,TK_LIMIT,yymsp[0].minor.yy354,yymsp[-2].minor.yy354);}
160822
+{yymsp[-3].minor.yy602 = sqlite3PExpr(pParse,TK_LIMIT,yymsp[0].minor.yy602,yymsp[-2].minor.yy602);}
160654160823
break;
160655160824
case 148: /* cmd ::= with DELETE FROM xfullname indexed_opt where_opt_ret */
160656160825
{
160657
- sqlite3SrcListIndexedBy(pParse, yymsp[-2].minor.yy457, &yymsp[-1].minor.yy0);
160658
- sqlite3DeleteFrom(pParse,yymsp[-2].minor.yy457,yymsp[0].minor.yy354,0,0);
160826
+ sqlite3SrcListIndexedBy(pParse, yymsp[-2].minor.yy291, &yymsp[-1].minor.yy0);
160827
+ sqlite3DeleteFrom(pParse,yymsp[-2].minor.yy291,yymsp[0].minor.yy602,0,0);
160659160828
}
160660160829
break;
160661160830
case 153: /* where_opt_ret ::= RETURNING selcollist */
160662
-{sqlite3AddReturning(pParse,yymsp[0].minor.yy350); yymsp[-1].minor.yy354 = 0;}
160831
+{sqlite3AddReturning(pParse,yymsp[0].minor.yy338); yymsp[-1].minor.yy602 = 0;}
160663160832
break;
160664160833
case 154: /* where_opt_ret ::= WHERE expr RETURNING selcollist */
160665
-{sqlite3AddReturning(pParse,yymsp[0].minor.yy350); yymsp[-3].minor.yy354 = yymsp[-2].minor.yy354;}
160834
+{sqlite3AddReturning(pParse,yymsp[0].minor.yy338); yymsp[-3].minor.yy602 = yymsp[-2].minor.yy602;}
160666160835
break;
160667160836
case 155: /* cmd ::= with UPDATE orconf xfullname indexed_opt SET setlist from where_opt_ret */
160668160837
{
160669
- sqlite3SrcListIndexedBy(pParse, yymsp[-5].minor.yy457, &yymsp[-4].minor.yy0);
160670
- sqlite3ExprListCheckLength(pParse,yymsp[-2].minor.yy350,"set list");
160671
- yymsp[-5].minor.yy457 = sqlite3SrcListAppendList(pParse, yymsp[-5].minor.yy457, yymsp[-1].minor.yy457);
160672
- sqlite3Update(pParse,yymsp[-5].minor.yy457,yymsp[-2].minor.yy350,yymsp[0].minor.yy354,yymsp[-6].minor.yy412,0,0,0);
160838
+ sqlite3SrcListIndexedBy(pParse, yymsp[-5].minor.yy291, &yymsp[-4].minor.yy0);
160839
+ sqlite3ExprListCheckLength(pParse,yymsp[-2].minor.yy338,"set list");
160840
+ yymsp[-5].minor.yy291 = sqlite3SrcListAppendList(pParse, yymsp[-5].minor.yy291, yymsp[-1].minor.yy291);
160841
+ sqlite3Update(pParse,yymsp[-5].minor.yy291,yymsp[-2].minor.yy338,yymsp[0].minor.yy602,yymsp[-6].minor.yy60,0,0,0);
160673160842
}
160674160843
break;
160675160844
case 156: /* setlist ::= setlist COMMA nm EQ expr */
160676160845
{
160677
- yymsp[-4].minor.yy350 = sqlite3ExprListAppend(pParse, yymsp[-4].minor.yy350, yymsp[0].minor.yy354);
160678
- sqlite3ExprListSetName(pParse, yymsp[-4].minor.yy350, &yymsp[-2].minor.yy0, 1);
160846
+ yymsp[-4].minor.yy338 = sqlite3ExprListAppend(pParse, yymsp[-4].minor.yy338, yymsp[0].minor.yy602);
160847
+ sqlite3ExprListSetName(pParse, yymsp[-4].minor.yy338, &yymsp[-2].minor.yy0, 1);
160679160848
}
160680160849
break;
160681160850
case 157: /* setlist ::= setlist COMMA LP idlist RP EQ expr */
160682160851
{
160683
- yymsp[-6].minor.yy350 = sqlite3ExprListAppendVector(pParse, yymsp[-6].minor.yy350, yymsp[-3].minor.yy498, yymsp[0].minor.yy354);
160852
+ yymsp[-6].minor.yy338 = sqlite3ExprListAppendVector(pParse, yymsp[-6].minor.yy338, yymsp[-3].minor.yy288, yymsp[0].minor.yy602);
160684160853
}
160685160854
break;
160686160855
case 158: /* setlist ::= nm EQ expr */
160687160856
{
160688
- yylhsminor.yy350 = sqlite3ExprListAppend(pParse, 0, yymsp[0].minor.yy354);
160689
- sqlite3ExprListSetName(pParse, yylhsminor.yy350, &yymsp[-2].minor.yy0, 1);
160857
+ yylhsminor.yy338 = sqlite3ExprListAppend(pParse, 0, yymsp[0].minor.yy602);
160858
+ sqlite3ExprListSetName(pParse, yylhsminor.yy338, &yymsp[-2].minor.yy0, 1);
160690160859
}
160691
- yymsp[-2].minor.yy350 = yylhsminor.yy350;
160860
+ yymsp[-2].minor.yy338 = yylhsminor.yy338;
160692160861
break;
160693160862
case 159: /* setlist ::= LP idlist RP EQ expr */
160694160863
{
160695
- yymsp[-4].minor.yy350 = sqlite3ExprListAppendVector(pParse, 0, yymsp[-3].minor.yy498, yymsp[0].minor.yy354);
160864
+ yymsp[-4].minor.yy338 = sqlite3ExprListAppendVector(pParse, 0, yymsp[-3].minor.yy288, yymsp[0].minor.yy602);
160696160865
}
160697160866
break;
160698160867
case 160: /* cmd ::= with insert_cmd INTO xfullname idlist_opt select upsert */
160699160868
{
160700
- sqlite3Insert(pParse, yymsp[-3].minor.yy457, yymsp[-1].minor.yy293, yymsp[-2].minor.yy498, yymsp[-5].minor.yy412, yymsp[0].minor.yy40);
160869
+ sqlite3Insert(pParse, yymsp[-3].minor.yy291, yymsp[-1].minor.yy307, yymsp[-2].minor.yy288, yymsp[-5].minor.yy60, yymsp[0].minor.yy178);
160701160870
}
160702160871
break;
160703160872
case 161: /* cmd ::= with insert_cmd INTO xfullname idlist_opt DEFAULT VALUES returning */
160704160873
{
160705
- sqlite3Insert(pParse, yymsp[-4].minor.yy457, 0, yymsp[-3].minor.yy498, yymsp[-6].minor.yy412, 0);
160874
+ sqlite3Insert(pParse, yymsp[-4].minor.yy291, 0, yymsp[-3].minor.yy288, yymsp[-6].minor.yy60, 0);
160706160875
}
160707160876
break;
160708160877
case 162: /* upsert ::= */
160709
-{ yymsp[1].minor.yy40 = 0; }
160878
+{ yymsp[1].minor.yy178 = 0; }
160710160879
break;
160711160880
case 163: /* upsert ::= RETURNING selcollist */
160712
-{ yymsp[-1].minor.yy40 = 0; sqlite3AddReturning(pParse,yymsp[0].minor.yy350); }
160881
+{ yymsp[-1].minor.yy178 = 0; sqlite3AddReturning(pParse,yymsp[0].minor.yy338); }
160713160882
break;
160714160883
case 164: /* upsert ::= ON CONFLICT LP sortlist RP where_opt DO UPDATE SET setlist where_opt upsert */
160715
-{ yymsp[-11].minor.yy40 = sqlite3UpsertNew(pParse->db,yymsp[-8].minor.yy350,yymsp[-6].minor.yy354,yymsp[-2].minor.yy350,yymsp[-1].minor.yy354,yymsp[0].minor.yy40);}
160884
+{ yymsp[-11].minor.yy178 = sqlite3UpsertNew(pParse->db,yymsp[-8].minor.yy338,yymsp[-6].minor.yy602,yymsp[-2].minor.yy338,yymsp[-1].minor.yy602,yymsp[0].minor.yy178);}
160716160885
break;
160717160886
case 165: /* upsert ::= ON CONFLICT LP sortlist RP where_opt DO NOTHING upsert */
160718
-{ yymsp[-8].minor.yy40 = sqlite3UpsertNew(pParse->db,yymsp[-5].minor.yy350,yymsp[-3].minor.yy354,0,0,yymsp[0].minor.yy40); }
160887
+{ yymsp[-8].minor.yy178 = sqlite3UpsertNew(pParse->db,yymsp[-5].minor.yy338,yymsp[-3].minor.yy602,0,0,yymsp[0].minor.yy178); }
160719160888
break;
160720160889
case 166: /* upsert ::= ON CONFLICT DO NOTHING returning */
160721
-{ yymsp[-4].minor.yy40 = sqlite3UpsertNew(pParse->db,0,0,0,0,0); }
160890
+{ yymsp[-4].minor.yy178 = sqlite3UpsertNew(pParse->db,0,0,0,0,0); }
160722160891
break;
160723160892
case 167: /* upsert ::= ON CONFLICT DO UPDATE SET setlist where_opt returning */
160724
-{ yymsp[-7].minor.yy40 = sqlite3UpsertNew(pParse->db,0,0,yymsp[-2].minor.yy350,yymsp[-1].minor.yy354,0);}
160893
+{ yymsp[-7].minor.yy178 = sqlite3UpsertNew(pParse->db,0,0,yymsp[-2].minor.yy338,yymsp[-1].minor.yy602,0);}
160725160894
break;
160726160895
case 168: /* returning ::= RETURNING selcollist */
160727
-{sqlite3AddReturning(pParse,yymsp[0].minor.yy350);}
160896
+{sqlite3AddReturning(pParse,yymsp[0].minor.yy338);}
160728160897
break;
160729160898
case 172: /* idlist_opt ::= LP idlist RP */
160730
-{yymsp[-2].minor.yy498 = yymsp[-1].minor.yy498;}
160899
+{yymsp[-2].minor.yy288 = yymsp[-1].minor.yy288;}
160731160900
break;
160732160901
case 173: /* idlist ::= idlist COMMA nm */
160733
-{yymsp[-2].minor.yy498 = sqlite3IdListAppend(pParse,yymsp[-2].minor.yy498,&yymsp[0].minor.yy0);}
160902
+{yymsp[-2].minor.yy288 = sqlite3IdListAppend(pParse,yymsp[-2].minor.yy288,&yymsp[0].minor.yy0);}
160734160903
break;
160735160904
case 174: /* idlist ::= nm */
160736
-{yymsp[0].minor.yy498 = sqlite3IdListAppend(pParse,0,&yymsp[0].minor.yy0); /*A-overwrites-Y*/}
160905
+{yymsp[0].minor.yy288 = sqlite3IdListAppend(pParse,0,&yymsp[0].minor.yy0); /*A-overwrites-Y*/}
160737160906
break;
160738160907
case 175: /* expr ::= LP expr RP */
160739
-{yymsp[-2].minor.yy354 = yymsp[-1].minor.yy354;}
160908
+{yymsp[-2].minor.yy602 = yymsp[-1].minor.yy602;}
160740160909
break;
160741160910
case 176: /* expr ::= ID|INDEXED */
160742160911
case 177: /* expr ::= JOIN_KW */ yytestcase(yyruleno==177);
160743
-{yymsp[0].minor.yy354=tokenExpr(pParse,TK_ID,yymsp[0].minor.yy0); /*A-overwrites-X*/}
160912
+{yymsp[0].minor.yy602=tokenExpr(pParse,TK_ID,yymsp[0].minor.yy0); /*A-overwrites-X*/}
160744160913
break;
160745160914
case 178: /* expr ::= nm DOT nm */
160746160915
{
160747160916
Expr *temp1 = sqlite3ExprAlloc(pParse->db, TK_ID, &yymsp[-2].minor.yy0, 1);
160748160917
Expr *temp2 = sqlite3ExprAlloc(pParse->db, TK_ID, &yymsp[0].minor.yy0, 1);
160749160918
if( IN_RENAME_OBJECT ){
160750160919
sqlite3RenameTokenMap(pParse, (void*)temp2, &yymsp[0].minor.yy0);
160751160920
sqlite3RenameTokenMap(pParse, (void*)temp1, &yymsp[-2].minor.yy0);
160752160921
}
160753
- yylhsminor.yy354 = sqlite3PExpr(pParse, TK_DOT, temp1, temp2);
160922
+ yylhsminor.yy602 = sqlite3PExpr(pParse, TK_DOT, temp1, temp2);
160754160923
}
160755
- yymsp[-2].minor.yy354 = yylhsminor.yy354;
160924
+ yymsp[-2].minor.yy602 = yylhsminor.yy602;
160756160925
break;
160757160926
case 179: /* expr ::= nm DOT nm DOT nm */
160758160927
{
160759160928
Expr *temp1 = sqlite3ExprAlloc(pParse->db, TK_ID, &yymsp[-4].minor.yy0, 1);
160760160929
Expr *temp2 = sqlite3ExprAlloc(pParse->db, TK_ID, &yymsp[-2].minor.yy0, 1);
@@ -160762,322 +160931,322 @@
160762160931
Expr *temp4 = sqlite3PExpr(pParse, TK_DOT, temp2, temp3);
160763160932
if( IN_RENAME_OBJECT ){
160764160933
sqlite3RenameTokenMap(pParse, (void*)temp3, &yymsp[0].minor.yy0);
160765160934
sqlite3RenameTokenMap(pParse, (void*)temp2, &yymsp[-2].minor.yy0);
160766160935
}
160767
- yylhsminor.yy354 = sqlite3PExpr(pParse, TK_DOT, temp1, temp4);
160936
+ yylhsminor.yy602 = sqlite3PExpr(pParse, TK_DOT, temp1, temp4);
160768160937
}
160769
- yymsp[-4].minor.yy354 = yylhsminor.yy354;
160938
+ yymsp[-4].minor.yy602 = yylhsminor.yy602;
160770160939
break;
160771160940
case 180: /* term ::= NULL|FLOAT|BLOB */
160772160941
case 181: /* term ::= STRING */ yytestcase(yyruleno==181);
160773
-{yymsp[0].minor.yy354=tokenExpr(pParse,yymsp[0].major,yymsp[0].minor.yy0); /*A-overwrites-X*/}
160942
+{yymsp[0].minor.yy602=tokenExpr(pParse,yymsp[0].major,yymsp[0].minor.yy0); /*A-overwrites-X*/}
160774160943
break;
160775160944
case 182: /* term ::= INTEGER */
160776160945
{
160777
- yylhsminor.yy354 = sqlite3ExprAlloc(pParse->db, TK_INTEGER, &yymsp[0].minor.yy0, 1);
160946
+ yylhsminor.yy602 = sqlite3ExprAlloc(pParse->db, TK_INTEGER, &yymsp[0].minor.yy0, 1);
160778160947
}
160779
- yymsp[0].minor.yy354 = yylhsminor.yy354;
160948
+ yymsp[0].minor.yy602 = yylhsminor.yy602;
160780160949
break;
160781160950
case 183: /* expr ::= VARIABLE */
160782160951
{
160783160952
if( !(yymsp[0].minor.yy0.z[0]=='#' && sqlite3Isdigit(yymsp[0].minor.yy0.z[1])) ){
160784160953
u32 n = yymsp[0].minor.yy0.n;
160785
- yymsp[0].minor.yy354 = tokenExpr(pParse, TK_VARIABLE, yymsp[0].minor.yy0);
160786
- sqlite3ExprAssignVarNumber(pParse, yymsp[0].minor.yy354, n);
160954
+ yymsp[0].minor.yy602 = tokenExpr(pParse, TK_VARIABLE, yymsp[0].minor.yy0);
160955
+ sqlite3ExprAssignVarNumber(pParse, yymsp[0].minor.yy602, n);
160787160956
}else{
160788160957
/* When doing a nested parse, one can include terms in an expression
160789160958
** that look like this: #1 #2 ... These terms refer to registers
160790160959
** in the virtual machine. #N is the N-th register. */
160791160960
Token t = yymsp[0].minor.yy0; /*A-overwrites-X*/
160792160961
assert( t.n>=2 );
160793160962
if( pParse->nested==0 ){
160794160963
sqlite3ErrorMsg(pParse, "near \"%T\": syntax error", &t);
160795
- yymsp[0].minor.yy354 = 0;
160964
+ yymsp[0].minor.yy602 = 0;
160796160965
}else{
160797
- yymsp[0].minor.yy354 = sqlite3PExpr(pParse, TK_REGISTER, 0, 0);
160798
- if( yymsp[0].minor.yy354 ) sqlite3GetInt32(&t.z[1], &yymsp[0].minor.yy354->iTable);
160966
+ yymsp[0].minor.yy602 = sqlite3PExpr(pParse, TK_REGISTER, 0, 0);
160967
+ if( yymsp[0].minor.yy602 ) sqlite3GetInt32(&t.z[1], &yymsp[0].minor.yy602->iTable);
160799160968
}
160800160969
}
160801160970
}
160802160971
break;
160803160972
case 184: /* expr ::= expr COLLATE ID|STRING */
160804160973
{
160805
- yymsp[-2].minor.yy354 = sqlite3ExprAddCollateToken(pParse, yymsp[-2].minor.yy354, &yymsp[0].minor.yy0, 1);
160974
+ yymsp[-2].minor.yy602 = sqlite3ExprAddCollateToken(pParse, yymsp[-2].minor.yy602, &yymsp[0].minor.yy0, 1);
160806160975
}
160807160976
break;
160808160977
case 185: /* expr ::= CAST LP expr AS typetoken RP */
160809160978
{
160810
- yymsp[-5].minor.yy354 = sqlite3ExprAlloc(pParse->db, TK_CAST, &yymsp[-1].minor.yy0, 1);
160811
- sqlite3ExprAttachSubtrees(pParse->db, yymsp[-5].minor.yy354, yymsp[-3].minor.yy354, 0);
160979
+ yymsp[-5].minor.yy602 = sqlite3ExprAlloc(pParse->db, TK_CAST, &yymsp[-1].minor.yy0, 1);
160980
+ sqlite3ExprAttachSubtrees(pParse->db, yymsp[-5].minor.yy602, yymsp[-3].minor.yy602, 0);
160812160981
}
160813160982
break;
160814160983
case 186: /* expr ::= ID|INDEXED LP distinct exprlist RP */
160815160984
{
160816
- yylhsminor.yy354 = sqlite3ExprFunction(pParse, yymsp[-1].minor.yy350, &yymsp[-4].minor.yy0, yymsp[-2].minor.yy412);
160985
+ yylhsminor.yy602 = sqlite3ExprFunction(pParse, yymsp[-1].minor.yy338, &yymsp[-4].minor.yy0, yymsp[-2].minor.yy60);
160817160986
}
160818
- yymsp[-4].minor.yy354 = yylhsminor.yy354;
160987
+ yymsp[-4].minor.yy602 = yylhsminor.yy602;
160819160988
break;
160820160989
case 187: /* expr ::= ID|INDEXED LP STAR RP */
160821160990
{
160822
- yylhsminor.yy354 = sqlite3ExprFunction(pParse, 0, &yymsp[-3].minor.yy0, 0);
160991
+ yylhsminor.yy602 = sqlite3ExprFunction(pParse, 0, &yymsp[-3].minor.yy0, 0);
160823160992
}
160824
- yymsp[-3].minor.yy354 = yylhsminor.yy354;
160993
+ yymsp[-3].minor.yy602 = yylhsminor.yy602;
160825160994
break;
160826160995
case 188: /* expr ::= ID|INDEXED LP distinct exprlist RP filter_over */
160827160996
{
160828
- yylhsminor.yy354 = sqlite3ExprFunction(pParse, yymsp[-2].minor.yy350, &yymsp[-5].minor.yy0, yymsp[-3].minor.yy412);
160829
- sqlite3WindowAttach(pParse, yylhsminor.yy354, yymsp[0].minor.yy503);
160997
+ yylhsminor.yy602 = sqlite3ExprFunction(pParse, yymsp[-2].minor.yy338, &yymsp[-5].minor.yy0, yymsp[-3].minor.yy60);
160998
+ sqlite3WindowAttach(pParse, yylhsminor.yy602, yymsp[0].minor.yy19);
160830160999
}
160831
- yymsp[-5].minor.yy354 = yylhsminor.yy354;
161000
+ yymsp[-5].minor.yy602 = yylhsminor.yy602;
160832161001
break;
160833161002
case 189: /* expr ::= ID|INDEXED LP STAR RP filter_over */
160834161003
{
160835
- yylhsminor.yy354 = sqlite3ExprFunction(pParse, 0, &yymsp[-4].minor.yy0, 0);
160836
- sqlite3WindowAttach(pParse, yylhsminor.yy354, yymsp[0].minor.yy503);
161004
+ yylhsminor.yy602 = sqlite3ExprFunction(pParse, 0, &yymsp[-4].minor.yy0, 0);
161005
+ sqlite3WindowAttach(pParse, yylhsminor.yy602, yymsp[0].minor.yy19);
160837161006
}
160838
- yymsp[-4].minor.yy354 = yylhsminor.yy354;
161007
+ yymsp[-4].minor.yy602 = yylhsminor.yy602;
160839161008
break;
160840161009
case 190: /* term ::= CTIME_KW */
160841161010
{
160842
- yylhsminor.yy354 = sqlite3ExprFunction(pParse, 0, &yymsp[0].minor.yy0, 0);
161011
+ yylhsminor.yy602 = sqlite3ExprFunction(pParse, 0, &yymsp[0].minor.yy0, 0);
160843161012
}
160844
- yymsp[0].minor.yy354 = yylhsminor.yy354;
161013
+ yymsp[0].minor.yy602 = yylhsminor.yy602;
160845161014
break;
160846161015
case 191: /* expr ::= LP nexprlist COMMA expr RP */
160847161016
{
160848
- ExprList *pList = sqlite3ExprListAppend(pParse, yymsp[-3].minor.yy350, yymsp[-1].minor.yy354);
160849
- yymsp[-4].minor.yy354 = sqlite3PExpr(pParse, TK_VECTOR, 0, 0);
160850
- if( yymsp[-4].minor.yy354 ){
160851
- yymsp[-4].minor.yy354->x.pList = pList;
161017
+ ExprList *pList = sqlite3ExprListAppend(pParse, yymsp[-3].minor.yy338, yymsp[-1].minor.yy602);
161018
+ yymsp[-4].minor.yy602 = sqlite3PExpr(pParse, TK_VECTOR, 0, 0);
161019
+ if( yymsp[-4].minor.yy602 ){
161020
+ yymsp[-4].minor.yy602->x.pList = pList;
160852161021
if( ALWAYS(pList->nExpr) ){
160853
- yymsp[-4].minor.yy354->flags |= pList->a[0].pExpr->flags & EP_Propagate;
161022
+ yymsp[-4].minor.yy602->flags |= pList->a[0].pExpr->flags & EP_Propagate;
160854161023
}
160855161024
}else{
160856161025
sqlite3ExprListDelete(pParse->db, pList);
160857161026
}
160858161027
}
160859161028
break;
160860161029
case 192: /* expr ::= expr AND expr */
160861
-{yymsp[-2].minor.yy354=sqlite3ExprAnd(pParse,yymsp[-2].minor.yy354,yymsp[0].minor.yy354);}
161030
+{yymsp[-2].minor.yy602=sqlite3ExprAnd(pParse,yymsp[-2].minor.yy602,yymsp[0].minor.yy602);}
160862161031
break;
160863161032
case 193: /* expr ::= expr OR expr */
160864161033
case 194: /* expr ::= expr LT|GT|GE|LE expr */ yytestcase(yyruleno==194);
160865161034
case 195: /* expr ::= expr EQ|NE expr */ yytestcase(yyruleno==195);
160866161035
case 196: /* expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr */ yytestcase(yyruleno==196);
160867161036
case 197: /* expr ::= expr PLUS|MINUS expr */ yytestcase(yyruleno==197);
160868161037
case 198: /* expr ::= expr STAR|SLASH|REM expr */ yytestcase(yyruleno==198);
160869161038
case 199: /* expr ::= expr CONCAT expr */ yytestcase(yyruleno==199);
160870
-{yymsp[-2].minor.yy354=sqlite3PExpr(pParse,yymsp[-1].major,yymsp[-2].minor.yy354,yymsp[0].minor.yy354);}
161039
+{yymsp[-2].minor.yy602=sqlite3PExpr(pParse,yymsp[-1].major,yymsp[-2].minor.yy602,yymsp[0].minor.yy602);}
160871161040
break;
160872161041
case 200: /* likeop ::= NOT LIKE_KW|MATCH */
160873161042
{yymsp[-1].minor.yy0=yymsp[0].minor.yy0; yymsp[-1].minor.yy0.n|=0x80000000; /*yymsp[-1].minor.yy0-overwrite-yymsp[0].minor.yy0*/}
160874161043
break;
160875161044
case 201: /* expr ::= expr likeop expr */
160876161045
{
160877161046
ExprList *pList;
160878161047
int bNot = yymsp[-1].minor.yy0.n & 0x80000000;
160879161048
yymsp[-1].minor.yy0.n &= 0x7fffffff;
160880
- pList = sqlite3ExprListAppend(pParse,0, yymsp[0].minor.yy354);
160881
- pList = sqlite3ExprListAppend(pParse,pList, yymsp[-2].minor.yy354);
160882
- yymsp[-2].minor.yy354 = sqlite3ExprFunction(pParse, pList, &yymsp[-1].minor.yy0, 0);
160883
- if( bNot ) yymsp[-2].minor.yy354 = sqlite3PExpr(pParse, TK_NOT, yymsp[-2].minor.yy354, 0);
160884
- if( yymsp[-2].minor.yy354 ) yymsp[-2].minor.yy354->flags |= EP_InfixFunc;
161049
+ pList = sqlite3ExprListAppend(pParse,0, yymsp[0].minor.yy602);
161050
+ pList = sqlite3ExprListAppend(pParse,pList, yymsp[-2].minor.yy602);
161051
+ yymsp[-2].minor.yy602 = sqlite3ExprFunction(pParse, pList, &yymsp[-1].minor.yy0, 0);
161052
+ if( bNot ) yymsp[-2].minor.yy602 = sqlite3PExpr(pParse, TK_NOT, yymsp[-2].minor.yy602, 0);
161053
+ if( yymsp[-2].minor.yy602 ) yymsp[-2].minor.yy602->flags |= EP_InfixFunc;
160885161054
}
160886161055
break;
160887161056
case 202: /* expr ::= expr likeop expr ESCAPE expr */
160888161057
{
160889161058
ExprList *pList;
160890161059
int bNot = yymsp[-3].minor.yy0.n & 0x80000000;
160891161060
yymsp[-3].minor.yy0.n &= 0x7fffffff;
160892
- pList = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy354);
160893
- pList = sqlite3ExprListAppend(pParse,pList, yymsp[-4].minor.yy354);
160894
- pList = sqlite3ExprListAppend(pParse,pList, yymsp[0].minor.yy354);
160895
- yymsp[-4].minor.yy354 = sqlite3ExprFunction(pParse, pList, &yymsp[-3].minor.yy0, 0);
160896
- if( bNot ) yymsp[-4].minor.yy354 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy354, 0);
160897
- if( yymsp[-4].minor.yy354 ) yymsp[-4].minor.yy354->flags |= EP_InfixFunc;
161061
+ pList = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy602);
161062
+ pList = sqlite3ExprListAppend(pParse,pList, yymsp[-4].minor.yy602);
161063
+ pList = sqlite3ExprListAppend(pParse,pList, yymsp[0].minor.yy602);
161064
+ yymsp[-4].minor.yy602 = sqlite3ExprFunction(pParse, pList, &yymsp[-3].minor.yy0, 0);
161065
+ if( bNot ) yymsp[-4].minor.yy602 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy602, 0);
161066
+ if( yymsp[-4].minor.yy602 ) yymsp[-4].minor.yy602->flags |= EP_InfixFunc;
160898161067
}
160899161068
break;
160900161069
case 203: /* expr ::= expr ISNULL|NOTNULL */
160901
-{yymsp[-1].minor.yy354 = sqlite3PExpr(pParse,yymsp[0].major,yymsp[-1].minor.yy354,0);}
161070
+{yymsp[-1].minor.yy602 = sqlite3PExpr(pParse,yymsp[0].major,yymsp[-1].minor.yy602,0);}
160902161071
break;
160903161072
case 204: /* expr ::= expr NOT NULL */
160904
-{yymsp[-2].minor.yy354 = sqlite3PExpr(pParse,TK_NOTNULL,yymsp[-2].minor.yy354,0);}
161073
+{yymsp[-2].minor.yy602 = sqlite3PExpr(pParse,TK_NOTNULL,yymsp[-2].minor.yy602,0);}
160905161074
break;
160906161075
case 205: /* expr ::= expr IS expr */
160907161076
{
160908
- yymsp[-2].minor.yy354 = sqlite3PExpr(pParse,TK_IS,yymsp[-2].minor.yy354,yymsp[0].minor.yy354);
160909
- binaryToUnaryIfNull(pParse, yymsp[0].minor.yy354, yymsp[-2].minor.yy354, TK_ISNULL);
161077
+ yymsp[-2].minor.yy602 = sqlite3PExpr(pParse,TK_IS,yymsp[-2].minor.yy602,yymsp[0].minor.yy602);
161078
+ binaryToUnaryIfNull(pParse, yymsp[0].minor.yy602, yymsp[-2].minor.yy602, TK_ISNULL);
160910161079
}
160911161080
break;
160912161081
case 206: /* expr ::= expr IS NOT expr */
160913161082
{
160914
- yymsp[-3].minor.yy354 = sqlite3PExpr(pParse,TK_ISNOT,yymsp[-3].minor.yy354,yymsp[0].minor.yy354);
160915
- binaryToUnaryIfNull(pParse, yymsp[0].minor.yy354, yymsp[-3].minor.yy354, TK_NOTNULL);
161083
+ yymsp[-3].minor.yy602 = sqlite3PExpr(pParse,TK_ISNOT,yymsp[-3].minor.yy602,yymsp[0].minor.yy602);
161084
+ binaryToUnaryIfNull(pParse, yymsp[0].minor.yy602, yymsp[-3].minor.yy602, TK_NOTNULL);
160916161085
}
160917161086
break;
160918161087
case 207: /* expr ::= NOT expr */
160919161088
case 208: /* expr ::= BITNOT expr */ yytestcase(yyruleno==208);
160920
-{yymsp[-1].minor.yy354 = sqlite3PExpr(pParse, yymsp[-1].major, yymsp[0].minor.yy354, 0);/*A-overwrites-B*/}
161089
+{yymsp[-1].minor.yy602 = sqlite3PExpr(pParse, yymsp[-1].major, yymsp[0].minor.yy602, 0);/*A-overwrites-B*/}
160921161090
break;
160922161091
case 209: /* expr ::= PLUS|MINUS expr */
160923161092
{
160924
- yymsp[-1].minor.yy354 = sqlite3PExpr(pParse, yymsp[-1].major==TK_PLUS ? TK_UPLUS : TK_UMINUS, yymsp[0].minor.yy354, 0);
161093
+ yymsp[-1].minor.yy602 = sqlite3PExpr(pParse, yymsp[-1].major==TK_PLUS ? TK_UPLUS : TK_UMINUS, yymsp[0].minor.yy602, 0);
160925161094
/*A-overwrites-B*/
160926161095
}
160927161096
break;
160928161097
case 210: /* between_op ::= BETWEEN */
160929161098
case 213: /* in_op ::= IN */ yytestcase(yyruleno==213);
160930
-{yymsp[0].minor.yy412 = 0;}
161099
+{yymsp[0].minor.yy60 = 0;}
160931161100
break;
160932161101
case 212: /* expr ::= expr between_op expr AND expr */
160933161102
{
160934
- ExprList *pList = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy354);
160935
- pList = sqlite3ExprListAppend(pParse,pList, yymsp[0].minor.yy354);
160936
- yymsp[-4].minor.yy354 = sqlite3PExpr(pParse, TK_BETWEEN, yymsp[-4].minor.yy354, 0);
160937
- if( yymsp[-4].minor.yy354 ){
160938
- yymsp[-4].minor.yy354->x.pList = pList;
161103
+ ExprList *pList = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy602);
161104
+ pList = sqlite3ExprListAppend(pParse,pList, yymsp[0].minor.yy602);
161105
+ yymsp[-4].minor.yy602 = sqlite3PExpr(pParse, TK_BETWEEN, yymsp[-4].minor.yy602, 0);
161106
+ if( yymsp[-4].minor.yy602 ){
161107
+ yymsp[-4].minor.yy602->x.pList = pList;
160939161108
}else{
160940161109
sqlite3ExprListDelete(pParse->db, pList);
160941161110
}
160942
- if( yymsp[-3].minor.yy412 ) yymsp[-4].minor.yy354 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy354, 0);
161111
+ if( yymsp[-3].minor.yy60 ) yymsp[-4].minor.yy602 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy602, 0);
160943161112
}
160944161113
break;
160945161114
case 215: /* expr ::= expr in_op LP exprlist RP */
160946161115
{
160947
- if( yymsp[-1].minor.yy350==0 ){
161116
+ if( yymsp[-1].minor.yy338==0 ){
160948161117
/* Expressions of the form
160949161118
**
160950161119
** expr1 IN ()
160951161120
** expr1 NOT IN ()
160952161121
**
160953161122
** simplify to constants 0 (false) and 1 (true), respectively,
160954161123
** regardless of the value of expr1.
160955161124
*/
160956
- sqlite3ExprUnmapAndDelete(pParse, yymsp[-4].minor.yy354);
160957
- yymsp[-4].minor.yy354 = sqlite3Expr(pParse->db, TK_INTEGER, yymsp[-3].minor.yy412 ? "1" : "0");
160958
- }else if( yymsp[-1].minor.yy350->nExpr==1 && sqlite3ExprIsConstant(yymsp[-1].minor.yy350->a[0].pExpr) ){
160959
- Expr *pRHS = yymsp[-1].minor.yy350->a[0].pExpr;
160960
- yymsp[-1].minor.yy350->a[0].pExpr = 0;
160961
- sqlite3ExprListDelete(pParse->db, yymsp[-1].minor.yy350);
161125
+ sqlite3ExprUnmapAndDelete(pParse, yymsp[-4].minor.yy602);
161126
+ yymsp[-4].minor.yy602 = sqlite3Expr(pParse->db, TK_INTEGER, yymsp[-3].minor.yy60 ? "1" : "0");
161127
+ }else if( yymsp[-1].minor.yy338->nExpr==1 && sqlite3ExprIsConstant(yymsp[-1].minor.yy338->a[0].pExpr) ){
161128
+ Expr *pRHS = yymsp[-1].minor.yy338->a[0].pExpr;
161129
+ yymsp[-1].minor.yy338->a[0].pExpr = 0;
161130
+ sqlite3ExprListDelete(pParse->db, yymsp[-1].minor.yy338);
160962161131
pRHS = sqlite3PExpr(pParse, TK_UPLUS, pRHS, 0);
160963
- yymsp[-4].minor.yy354 = sqlite3PExpr(pParse, TK_EQ, yymsp[-4].minor.yy354, pRHS);
160964
- if( yymsp[-3].minor.yy412 ) yymsp[-4].minor.yy354 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy354, 0);
160965
- }else{
160966
- yymsp[-4].minor.yy354 = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy354, 0);
160967
- if( yymsp[-4].minor.yy354 ){
160968
- yymsp[-4].minor.yy354->x.pList = yymsp[-1].minor.yy350;
160969
- sqlite3ExprSetHeightAndFlags(pParse, yymsp[-4].minor.yy354);
160970
- }else{
160971
- sqlite3ExprListDelete(pParse->db, yymsp[-1].minor.yy350);
160972
- }
160973
- if( yymsp[-3].minor.yy412 ) yymsp[-4].minor.yy354 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy354, 0);
161132
+ yymsp[-4].minor.yy602 = sqlite3PExpr(pParse, TK_EQ, yymsp[-4].minor.yy602, pRHS);
161133
+ if( yymsp[-3].minor.yy60 ) yymsp[-4].minor.yy602 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy602, 0);
161134
+ }else{
161135
+ yymsp[-4].minor.yy602 = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy602, 0);
161136
+ if( yymsp[-4].minor.yy602 ){
161137
+ yymsp[-4].minor.yy602->x.pList = yymsp[-1].minor.yy338;
161138
+ sqlite3ExprSetHeightAndFlags(pParse, yymsp[-4].minor.yy602);
161139
+ }else{
161140
+ sqlite3ExprListDelete(pParse->db, yymsp[-1].minor.yy338);
161141
+ }
161142
+ if( yymsp[-3].minor.yy60 ) yymsp[-4].minor.yy602 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy602, 0);
160974161143
}
160975161144
}
160976161145
break;
160977161146
case 216: /* expr ::= LP select RP */
160978161147
{
160979
- yymsp[-2].minor.yy354 = sqlite3PExpr(pParse, TK_SELECT, 0, 0);
160980
- sqlite3PExprAddSelect(pParse, yymsp[-2].minor.yy354, yymsp[-1].minor.yy293);
161148
+ yymsp[-2].minor.yy602 = sqlite3PExpr(pParse, TK_SELECT, 0, 0);
161149
+ sqlite3PExprAddSelect(pParse, yymsp[-2].minor.yy602, yymsp[-1].minor.yy307);
160981161150
}
160982161151
break;
160983161152
case 217: /* expr ::= expr in_op LP select RP */
160984161153
{
160985
- yymsp[-4].minor.yy354 = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy354, 0);
160986
- sqlite3PExprAddSelect(pParse, yymsp[-4].minor.yy354, yymsp[-1].minor.yy293);
160987
- if( yymsp[-3].minor.yy412 ) yymsp[-4].minor.yy354 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy354, 0);
161154
+ yymsp[-4].minor.yy602 = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy602, 0);
161155
+ sqlite3PExprAddSelect(pParse, yymsp[-4].minor.yy602, yymsp[-1].minor.yy307);
161156
+ if( yymsp[-3].minor.yy60 ) yymsp[-4].minor.yy602 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy602, 0);
160988161157
}
160989161158
break;
160990161159
case 218: /* expr ::= expr in_op nm dbnm paren_exprlist */
160991161160
{
160992161161
SrcList *pSrc = sqlite3SrcListAppend(pParse, 0,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0);
160993161162
Select *pSelect = sqlite3SelectNew(pParse, 0,pSrc,0,0,0,0,0,0);
160994
- if( yymsp[0].minor.yy350 ) sqlite3SrcListFuncArgs(pParse, pSelect ? pSrc : 0, yymsp[0].minor.yy350);
160995
- yymsp[-4].minor.yy354 = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy354, 0);
160996
- sqlite3PExprAddSelect(pParse, yymsp[-4].minor.yy354, pSelect);
160997
- if( yymsp[-3].minor.yy412 ) yymsp[-4].minor.yy354 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy354, 0);
161163
+ if( yymsp[0].minor.yy338 ) sqlite3SrcListFuncArgs(pParse, pSelect ? pSrc : 0, yymsp[0].minor.yy338);
161164
+ yymsp[-4].minor.yy602 = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy602, 0);
161165
+ sqlite3PExprAddSelect(pParse, yymsp[-4].minor.yy602, pSelect);
161166
+ if( yymsp[-3].minor.yy60 ) yymsp[-4].minor.yy602 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy602, 0);
160998161167
}
160999161168
break;
161000161169
case 219: /* expr ::= EXISTS LP select RP */
161001161170
{
161002161171
Expr *p;
161003
- p = yymsp[-3].minor.yy354 = sqlite3PExpr(pParse, TK_EXISTS, 0, 0);
161004
- sqlite3PExprAddSelect(pParse, p, yymsp[-1].minor.yy293);
161172
+ p = yymsp[-3].minor.yy602 = sqlite3PExpr(pParse, TK_EXISTS, 0, 0);
161173
+ sqlite3PExprAddSelect(pParse, p, yymsp[-1].minor.yy307);
161005161174
}
161006161175
break;
161007161176
case 220: /* expr ::= CASE case_operand case_exprlist case_else END */
161008161177
{
161009
- yymsp[-4].minor.yy354 = sqlite3PExpr(pParse, TK_CASE, yymsp[-3].minor.yy354, 0);
161010
- if( yymsp[-4].minor.yy354 ){
161011
- yymsp[-4].minor.yy354->x.pList = yymsp[-1].minor.yy354 ? sqlite3ExprListAppend(pParse,yymsp[-2].minor.yy350,yymsp[-1].minor.yy354) : yymsp[-2].minor.yy350;
161012
- sqlite3ExprSetHeightAndFlags(pParse, yymsp[-4].minor.yy354);
161178
+ yymsp[-4].minor.yy602 = sqlite3PExpr(pParse, TK_CASE, yymsp[-3].minor.yy602, 0);
161179
+ if( yymsp[-4].minor.yy602 ){
161180
+ yymsp[-4].minor.yy602->x.pList = yymsp[-1].minor.yy602 ? sqlite3ExprListAppend(pParse,yymsp[-2].minor.yy338,yymsp[-1].minor.yy602) : yymsp[-2].minor.yy338;
161181
+ sqlite3ExprSetHeightAndFlags(pParse, yymsp[-4].minor.yy602);
161013161182
}else{
161014
- sqlite3ExprListDelete(pParse->db, yymsp[-2].minor.yy350);
161015
- sqlite3ExprDelete(pParse->db, yymsp[-1].minor.yy354);
161183
+ sqlite3ExprListDelete(pParse->db, yymsp[-2].minor.yy338);
161184
+ sqlite3ExprDelete(pParse->db, yymsp[-1].minor.yy602);
161016161185
}
161017161186
}
161018161187
break;
161019161188
case 221: /* case_exprlist ::= case_exprlist WHEN expr THEN expr */
161020161189
{
161021
- yymsp[-4].minor.yy350 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy350, yymsp[-2].minor.yy354);
161022
- yymsp[-4].minor.yy350 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy350, yymsp[0].minor.yy354);
161190
+ yymsp[-4].minor.yy338 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy338, yymsp[-2].minor.yy602);
161191
+ yymsp[-4].minor.yy338 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy338, yymsp[0].minor.yy602);
161023161192
}
161024161193
break;
161025161194
case 222: /* case_exprlist ::= WHEN expr THEN expr */
161026161195
{
161027
- yymsp[-3].minor.yy350 = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy354);
161028
- yymsp[-3].minor.yy350 = sqlite3ExprListAppend(pParse,yymsp[-3].minor.yy350, yymsp[0].minor.yy354);
161196
+ yymsp[-3].minor.yy338 = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy602);
161197
+ yymsp[-3].minor.yy338 = sqlite3ExprListAppend(pParse,yymsp[-3].minor.yy338, yymsp[0].minor.yy602);
161029161198
}
161030161199
break;
161031161200
case 225: /* case_operand ::= expr */
161032
-{yymsp[0].minor.yy354 = yymsp[0].minor.yy354; /*A-overwrites-X*/}
161201
+{yymsp[0].minor.yy602 = yymsp[0].minor.yy602; /*A-overwrites-X*/}
161033161202
break;
161034161203
case 228: /* nexprlist ::= nexprlist COMMA expr */
161035
-{yymsp[-2].minor.yy350 = sqlite3ExprListAppend(pParse,yymsp[-2].minor.yy350,yymsp[0].minor.yy354);}
161204
+{yymsp[-2].minor.yy338 = sqlite3ExprListAppend(pParse,yymsp[-2].minor.yy338,yymsp[0].minor.yy602);}
161036161205
break;
161037161206
case 229: /* nexprlist ::= expr */
161038
-{yymsp[0].minor.yy350 = sqlite3ExprListAppend(pParse,0,yymsp[0].minor.yy354); /*A-overwrites-Y*/}
161207
+{yymsp[0].minor.yy338 = sqlite3ExprListAppend(pParse,0,yymsp[0].minor.yy602); /*A-overwrites-Y*/}
161039161208
break;
161040161209
case 231: /* paren_exprlist ::= LP exprlist RP */
161041161210
case 236: /* eidlist_opt ::= LP eidlist RP */ yytestcase(yyruleno==236);
161042
-{yymsp[-2].minor.yy350 = yymsp[-1].minor.yy350;}
161211
+{yymsp[-2].minor.yy338 = yymsp[-1].minor.yy338;}
161043161212
break;
161044161213
case 232: /* cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP sortlist RP where_opt */
161045161214
{
161046161215
sqlite3CreateIndex(pParse, &yymsp[-7].minor.yy0, &yymsp[-6].minor.yy0,
161047
- sqlite3SrcListAppend(pParse,0,&yymsp[-4].minor.yy0,0), yymsp[-2].minor.yy350, yymsp[-10].minor.yy412,
161048
- &yymsp[-11].minor.yy0, yymsp[0].minor.yy354, SQLITE_SO_ASC, yymsp[-8].minor.yy412, SQLITE_IDXTYPE_APPDEF);
161216
+ sqlite3SrcListAppend(pParse,0,&yymsp[-4].minor.yy0,0), yymsp[-2].minor.yy338, yymsp[-10].minor.yy60,
161217
+ &yymsp[-11].minor.yy0, yymsp[0].minor.yy602, SQLITE_SO_ASC, yymsp[-8].minor.yy60, SQLITE_IDXTYPE_APPDEF);
161049161218
if( IN_RENAME_OBJECT && pParse->pNewIndex ){
161050161219
sqlite3RenameTokenMap(pParse, pParse->pNewIndex->zName, &yymsp[-4].minor.yy0);
161051161220
}
161052161221
}
161053161222
break;
161054161223
case 233: /* uniqueflag ::= UNIQUE */
161055161224
case 275: /* raisetype ::= ABORT */ yytestcase(yyruleno==275);
161056
-{yymsp[0].minor.yy412 = OE_Abort;}
161225
+{yymsp[0].minor.yy60 = OE_Abort;}
161057161226
break;
161058161227
case 234: /* uniqueflag ::= */
161059
-{yymsp[1].minor.yy412 = OE_None;}
161228
+{yymsp[1].minor.yy60 = OE_None;}
161060161229
break;
161061161230
case 237: /* eidlist ::= eidlist COMMA nm collate sortorder */
161062161231
{
161063
- yymsp[-4].minor.yy350 = parserAddExprIdListTerm(pParse, yymsp[-4].minor.yy350, &yymsp[-2].minor.yy0, yymsp[-1].minor.yy412, yymsp[0].minor.yy412);
161232
+ yymsp[-4].minor.yy338 = parserAddExprIdListTerm(pParse, yymsp[-4].minor.yy338, &yymsp[-2].minor.yy0, yymsp[-1].minor.yy60, yymsp[0].minor.yy60);
161064161233
}
161065161234
break;
161066161235
case 238: /* eidlist ::= nm collate sortorder */
161067161236
{
161068
- yymsp[-2].minor.yy350 = parserAddExprIdListTerm(pParse, 0, &yymsp[-2].minor.yy0, yymsp[-1].minor.yy412, yymsp[0].minor.yy412); /*A-overwrites-Y*/
161237
+ yymsp[-2].minor.yy338 = parserAddExprIdListTerm(pParse, 0, &yymsp[-2].minor.yy0, yymsp[-1].minor.yy60, yymsp[0].minor.yy60); /*A-overwrites-Y*/
161069161238
}
161070161239
break;
161071161240
case 241: /* cmd ::= DROP INDEX ifexists fullname */
161072
-{sqlite3DropIndex(pParse, yymsp[0].minor.yy457, yymsp[-1].minor.yy412);}
161241
+{sqlite3DropIndex(pParse, yymsp[0].minor.yy291, yymsp[-1].minor.yy60);}
161073161242
break;
161074161243
case 242: /* cmd ::= VACUUM vinto */
161075
-{sqlite3Vacuum(pParse,0,yymsp[0].minor.yy354);}
161244
+{sqlite3Vacuum(pParse,0,yymsp[0].minor.yy602);}
161076161245
break;
161077161246
case 243: /* cmd ::= VACUUM nm vinto */
161078
-{sqlite3Vacuum(pParse,&yymsp[-1].minor.yy0,yymsp[0].minor.yy354);}
161247
+{sqlite3Vacuum(pParse,&yymsp[-1].minor.yy0,yymsp[0].minor.yy602);}
161079161248
break;
161080161249
case 246: /* cmd ::= PRAGMA nm dbnm */
161081161250
{sqlite3Pragma(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,0,0);}
161082161251
break;
161083161252
case 247: /* cmd ::= PRAGMA nm dbnm EQ nmnum */
@@ -161095,54 +161264,54 @@
161095161264
case 253: /* cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END */
161096161265
{
161097161266
Token all;
161098161267
all.z = yymsp[-3].minor.yy0.z;
161099161268
all.n = (int)(yymsp[0].minor.yy0.z - yymsp[-3].minor.yy0.z) + yymsp[0].minor.yy0.n;
161100
- sqlite3FinishTrigger(pParse, yymsp[-1].minor.yy51, &all);
161269
+ sqlite3FinishTrigger(pParse, yymsp[-1].minor.yy483, &all);
161101161270
}
161102161271
break;
161103161272
case 254: /* trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause */
161104161273
{
161105
- sqlite3BeginTrigger(pParse, &yymsp[-7].minor.yy0, &yymsp[-6].minor.yy0, yymsp[-5].minor.yy412, yymsp[-4].minor.yy298.a, yymsp[-4].minor.yy298.b, yymsp[-2].minor.yy457, yymsp[0].minor.yy354, yymsp[-10].minor.yy412, yymsp[-8].minor.yy412);
161274
+ sqlite3BeginTrigger(pParse, &yymsp[-7].minor.yy0, &yymsp[-6].minor.yy0, yymsp[-5].minor.yy60, yymsp[-4].minor.yy50.a, yymsp[-4].minor.yy50.b, yymsp[-2].minor.yy291, yymsp[0].minor.yy602, yymsp[-10].minor.yy60, yymsp[-8].minor.yy60);
161106161275
yymsp[-10].minor.yy0 = (yymsp[-6].minor.yy0.n==0?yymsp[-7].minor.yy0:yymsp[-6].minor.yy0); /*A-overwrites-T*/
161107161276
}
161108161277
break;
161109161278
case 255: /* trigger_time ::= BEFORE|AFTER */
161110
-{ yymsp[0].minor.yy412 = yymsp[0].major; /*A-overwrites-X*/ }
161279
+{ yymsp[0].minor.yy60 = yymsp[0].major; /*A-overwrites-X*/ }
161111161280
break;
161112161281
case 256: /* trigger_time ::= INSTEAD OF */
161113
-{ yymsp[-1].minor.yy412 = TK_INSTEAD;}
161282
+{ yymsp[-1].minor.yy60 = TK_INSTEAD;}
161114161283
break;
161115161284
case 257: /* trigger_time ::= */
161116
-{ yymsp[1].minor.yy412 = TK_BEFORE; }
161285
+{ yymsp[1].minor.yy60 = TK_BEFORE; }
161117161286
break;
161118161287
case 258: /* trigger_event ::= DELETE|INSERT */
161119161288
case 259: /* trigger_event ::= UPDATE */ yytestcase(yyruleno==259);
161120
-{yymsp[0].minor.yy298.a = yymsp[0].major; /*A-overwrites-X*/ yymsp[0].minor.yy298.b = 0;}
161289
+{yymsp[0].minor.yy50.a = yymsp[0].major; /*A-overwrites-X*/ yymsp[0].minor.yy50.b = 0;}
161121161290
break;
161122161291
case 260: /* trigger_event ::= UPDATE OF idlist */
161123
-{yymsp[-2].minor.yy298.a = TK_UPDATE; yymsp[-2].minor.yy298.b = yymsp[0].minor.yy498;}
161292
+{yymsp[-2].minor.yy50.a = TK_UPDATE; yymsp[-2].minor.yy50.b = yymsp[0].minor.yy288;}
161124161293
break;
161125161294
case 261: /* when_clause ::= */
161126161295
case 280: /* key_opt ::= */ yytestcase(yyruleno==280);
161127
-{ yymsp[1].minor.yy354 = 0; }
161296
+{ yymsp[1].minor.yy602 = 0; }
161128161297
break;
161129161298
case 262: /* when_clause ::= WHEN expr */
161130161299
case 281: /* key_opt ::= KEY expr */ yytestcase(yyruleno==281);
161131
-{ yymsp[-1].minor.yy354 = yymsp[0].minor.yy354; }
161300
+{ yymsp[-1].minor.yy602 = yymsp[0].minor.yy602; }
161132161301
break;
161133161302
case 263: /* trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI */
161134161303
{
161135
- assert( yymsp[-2].minor.yy51!=0 );
161136
- yymsp[-2].minor.yy51->pLast->pNext = yymsp[-1].minor.yy51;
161137
- yymsp[-2].minor.yy51->pLast = yymsp[-1].minor.yy51;
161304
+ assert( yymsp[-2].minor.yy483!=0 );
161305
+ yymsp[-2].minor.yy483->pLast->pNext = yymsp[-1].minor.yy483;
161306
+ yymsp[-2].minor.yy483->pLast = yymsp[-1].minor.yy483;
161138161307
}
161139161308
break;
161140161309
case 264: /* trigger_cmd_list ::= trigger_cmd SEMI */
161141161310
{
161142
- assert( yymsp[-1].minor.yy51!=0 );
161143
- yymsp[-1].minor.yy51->pLast = yymsp[-1].minor.yy51;
161311
+ assert( yymsp[-1].minor.yy483!=0 );
161312
+ yymsp[-1].minor.yy483->pLast = yymsp[-1].minor.yy483;
161144161313
}
161145161314
break;
161146161315
case 265: /* trnm ::= nm DOT nm */
161147161316
{
161148161317
yymsp[-2].minor.yy0 = yymsp[0].minor.yy0;
@@ -161164,62 +161333,62 @@
161164161333
"the NOT INDEXED clause is not allowed on UPDATE or DELETE statements "
161165161334
"within triggers");
161166161335
}
161167161336
break;
161168161337
case 268: /* trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist from where_opt scanpt */
161169
-{yylhsminor.yy51 = sqlite3TriggerUpdateStep(pParse, &yymsp[-6].minor.yy0, yymsp[-2].minor.yy457, yymsp[-3].minor.yy350, yymsp[-1].minor.yy354, yymsp[-7].minor.yy412, yymsp[-8].minor.yy0.z, yymsp[0].minor.yy504);}
161170
- yymsp[-8].minor.yy51 = yylhsminor.yy51;
161338
+{yylhsminor.yy483 = sqlite3TriggerUpdateStep(pParse, &yymsp[-6].minor.yy0, yymsp[-2].minor.yy291, yymsp[-3].minor.yy338, yymsp[-1].minor.yy602, yymsp[-7].minor.yy60, yymsp[-8].minor.yy0.z, yymsp[0].minor.yy528);}
161339
+ yymsp[-8].minor.yy483 = yylhsminor.yy483;
161171161340
break;
161172161341
case 269: /* trigger_cmd ::= scanpt insert_cmd INTO trnm idlist_opt select upsert scanpt */
161173161342
{
161174
- yylhsminor.yy51 = sqlite3TriggerInsertStep(pParse,&yymsp[-4].minor.yy0,yymsp[-3].minor.yy498,yymsp[-2].minor.yy293,yymsp[-6].minor.yy412,yymsp[-1].minor.yy40,yymsp[-7].minor.yy504,yymsp[0].minor.yy504);/*yylhsminor.yy51-overwrites-yymsp[-6].minor.yy412*/
161343
+ yylhsminor.yy483 = sqlite3TriggerInsertStep(pParse,&yymsp[-4].minor.yy0,yymsp[-3].minor.yy288,yymsp[-2].minor.yy307,yymsp[-6].minor.yy60,yymsp[-1].minor.yy178,yymsp[-7].minor.yy528,yymsp[0].minor.yy528);/*yylhsminor.yy483-overwrites-yymsp[-6].minor.yy60*/
161175161344
}
161176
- yymsp[-7].minor.yy51 = yylhsminor.yy51;
161345
+ yymsp[-7].minor.yy483 = yylhsminor.yy483;
161177161346
break;
161178161347
case 270: /* trigger_cmd ::= DELETE FROM trnm tridxby where_opt scanpt */
161179
-{yylhsminor.yy51 = sqlite3TriggerDeleteStep(pParse, &yymsp[-3].minor.yy0, yymsp[-1].minor.yy354, yymsp[-5].minor.yy0.z, yymsp[0].minor.yy504);}
161180
- yymsp[-5].minor.yy51 = yylhsminor.yy51;
161348
+{yylhsminor.yy483 = sqlite3TriggerDeleteStep(pParse, &yymsp[-3].minor.yy0, yymsp[-1].minor.yy602, yymsp[-5].minor.yy0.z, yymsp[0].minor.yy528);}
161349
+ yymsp[-5].minor.yy483 = yylhsminor.yy483;
161181161350
break;
161182161351
case 271: /* trigger_cmd ::= scanpt select scanpt */
161183
-{yylhsminor.yy51 = sqlite3TriggerSelectStep(pParse->db, yymsp[-1].minor.yy293, yymsp[-2].minor.yy504, yymsp[0].minor.yy504); /*yylhsminor.yy51-overwrites-yymsp[-1].minor.yy293*/}
161184
- yymsp[-2].minor.yy51 = yylhsminor.yy51;
161352
+{yylhsminor.yy483 = sqlite3TriggerSelectStep(pParse->db, yymsp[-1].minor.yy307, yymsp[-2].minor.yy528, yymsp[0].minor.yy528); /*yylhsminor.yy483-overwrites-yymsp[-1].minor.yy307*/}
161353
+ yymsp[-2].minor.yy483 = yylhsminor.yy483;
161185161354
break;
161186161355
case 272: /* expr ::= RAISE LP IGNORE RP */
161187161356
{
161188
- yymsp[-3].minor.yy354 = sqlite3PExpr(pParse, TK_RAISE, 0, 0);
161189
- if( yymsp[-3].minor.yy354 ){
161190
- yymsp[-3].minor.yy354->affExpr = OE_Ignore;
161357
+ yymsp[-3].minor.yy602 = sqlite3PExpr(pParse, TK_RAISE, 0, 0);
161358
+ if( yymsp[-3].minor.yy602 ){
161359
+ yymsp[-3].minor.yy602->affExpr = OE_Ignore;
161191161360
}
161192161361
}
161193161362
break;
161194161363
case 273: /* expr ::= RAISE LP raisetype COMMA nm RP */
161195161364
{
161196
- yymsp[-5].minor.yy354 = sqlite3ExprAlloc(pParse->db, TK_RAISE, &yymsp[-1].minor.yy0, 1);
161197
- if( yymsp[-5].minor.yy354 ) {
161198
- yymsp[-5].minor.yy354->affExpr = (char)yymsp[-3].minor.yy412;
161365
+ yymsp[-5].minor.yy602 = sqlite3ExprAlloc(pParse->db, TK_RAISE, &yymsp[-1].minor.yy0, 1);
161366
+ if( yymsp[-5].minor.yy602 ) {
161367
+ yymsp[-5].minor.yy602->affExpr = (char)yymsp[-3].minor.yy60;
161199161368
}
161200161369
}
161201161370
break;
161202161371
case 274: /* raisetype ::= ROLLBACK */
161203
-{yymsp[0].minor.yy412 = OE_Rollback;}
161372
+{yymsp[0].minor.yy60 = OE_Rollback;}
161204161373
break;
161205161374
case 276: /* raisetype ::= FAIL */
161206
-{yymsp[0].minor.yy412 = OE_Fail;}
161375
+{yymsp[0].minor.yy60 = OE_Fail;}
161207161376
break;
161208161377
case 277: /* cmd ::= DROP TRIGGER ifexists fullname */
161209161378
{
161210
- sqlite3DropTrigger(pParse,yymsp[0].minor.yy457,yymsp[-1].minor.yy412);
161379
+ sqlite3DropTrigger(pParse,yymsp[0].minor.yy291,yymsp[-1].minor.yy60);
161211161380
}
161212161381
break;
161213161382
case 278: /* cmd ::= ATTACH database_kw_opt expr AS expr key_opt */
161214161383
{
161215
- sqlite3Attach(pParse, yymsp[-3].minor.yy354, yymsp[-1].minor.yy354, yymsp[0].minor.yy354);
161384
+ sqlite3Attach(pParse, yymsp[-3].minor.yy602, yymsp[-1].minor.yy602, yymsp[0].minor.yy602);
161216161385
}
161217161386
break;
161218161387
case 279: /* cmd ::= DETACH database_kw_opt expr */
161219161388
{
161220
- sqlite3Detach(pParse, yymsp[0].minor.yy354);
161389
+ sqlite3Detach(pParse, yymsp[0].minor.yy602);
161221161390
}
161222161391
break;
161223161392
case 282: /* cmd ::= REINDEX */
161224161393
{sqlite3Reindex(pParse, 0, 0);}
161225161394
break;
@@ -161232,11 +161401,11 @@
161232161401
case 285: /* cmd ::= ANALYZE nm dbnm */
161233161402
{sqlite3Analyze(pParse, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0);}
161234161403
break;
161235161404
case 286: /* cmd ::= ALTER TABLE fullname RENAME TO nm */
161236161405
{
161237
- sqlite3AlterRenameTable(pParse,yymsp[-3].minor.yy457,&yymsp[0].minor.yy0);
161406
+ sqlite3AlterRenameTable(pParse,yymsp[-3].minor.yy291,&yymsp[0].minor.yy0);
161238161407
}
161239161408
break;
161240161409
case 287: /* cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt columnname carglist */
161241161410
{
161242161411
yymsp[-1].minor.yy0.n = (int)(pParse->sLastToken.z-yymsp[-1].minor.yy0.z) + pParse->sLastToken.n;
@@ -161243,22 +161412,22 @@
161243161412
sqlite3AlterFinishAddColumn(pParse, &yymsp[-1].minor.yy0);
161244161413
}
161245161414
break;
161246161415
case 288: /* cmd ::= ALTER TABLE fullname DROP kwcolumn_opt nm */
161247161416
{
161248
- sqlite3AlterDropColumn(pParse, yymsp[-3].minor.yy457, &yymsp[0].minor.yy0);
161417
+ sqlite3AlterDropColumn(pParse, yymsp[-3].minor.yy291, &yymsp[0].minor.yy0);
161249161418
}
161250161419
break;
161251161420
case 289: /* add_column_fullname ::= fullname */
161252161421
{
161253161422
disableLookaside(pParse);
161254
- sqlite3AlterBeginAddColumn(pParse, yymsp[0].minor.yy457);
161423
+ sqlite3AlterBeginAddColumn(pParse, yymsp[0].minor.yy291);
161255161424
}
161256161425
break;
161257161426
case 290: /* cmd ::= ALTER TABLE fullname RENAME kwcolumn_opt nm TO nm */
161258161427
{
161259
- sqlite3AlterRenameColumn(pParse, yymsp[-5].minor.yy457, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0);
161428
+ sqlite3AlterRenameColumn(pParse, yymsp[-5].minor.yy291, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0);
161260161429
}
161261161430
break;
161262161431
case 291: /* cmd ::= create_vtab */
161263161432
{sqlite3VtabFinishParse(pParse,0);}
161264161433
break;
@@ -161265,11 +161434,11 @@
161265161434
case 292: /* cmd ::= create_vtab LP vtabarglist RP */
161266161435
{sqlite3VtabFinishParse(pParse,&yymsp[0].minor.yy0);}
161267161436
break;
161268161437
case 293: /* create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm */
161269161438
{
161270
- sqlite3VtabBeginParse(pParse, &yymsp[-3].minor.yy0, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-4].minor.yy412);
161439
+ sqlite3VtabBeginParse(pParse, &yymsp[-3].minor.yy0, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-4].minor.yy60);
161271161440
}
161272161441
break;
161273161442
case 294: /* vtabarg ::= */
161274161443
{sqlite3VtabArgInit(pParse);}
161275161444
break;
@@ -161278,225 +161447,239 @@
161278161447
case 297: /* lp ::= LP */ yytestcase(yyruleno==297);
161279161448
{sqlite3VtabArgExtend(pParse,&yymsp[0].minor.yy0);}
161280161449
break;
161281161450
case 298: /* with ::= WITH wqlist */
161282161451
case 299: /* with ::= WITH RECURSIVE wqlist */ yytestcase(yyruleno==299);
161283
-{ sqlite3WithPush(pParse, yymsp[0].minor.yy105, 1); }
161284
- break;
161285
- case 300: /* wqlist ::= nm eidlist_opt AS LP select RP */
161286
-{
161287
- yymsp[-5].minor.yy105 = sqlite3WithAdd(pParse, 0, &yymsp[-5].minor.yy0, yymsp[-4].minor.yy350, yymsp[-1].minor.yy293); /*A-overwrites-X*/
161288
-}
161289
- break;
161290
- case 301: /* wqlist ::= wqlist COMMA nm eidlist_opt AS LP select RP */
161291
-{
161292
- yymsp[-7].minor.yy105 = sqlite3WithAdd(pParse, yymsp[-7].minor.yy105, &yymsp[-5].minor.yy0, yymsp[-4].minor.yy350, yymsp[-1].minor.yy293);
161293
-}
161294
- break;
161295
- case 302: /* windowdefn_list ::= windowdefn */
161296
-{ yylhsminor.yy503 = yymsp[0].minor.yy503; }
161297
- yymsp[0].minor.yy503 = yylhsminor.yy503;
161298
- break;
161299
- case 303: /* windowdefn_list ::= windowdefn_list COMMA windowdefn */
161300
-{
161301
- assert( yymsp[0].minor.yy503!=0 );
161302
- sqlite3WindowChain(pParse, yymsp[0].minor.yy503, yymsp[-2].minor.yy503);
161303
- yymsp[0].minor.yy503->pNextWin = yymsp[-2].minor.yy503;
161304
- yylhsminor.yy503 = yymsp[0].minor.yy503;
161305
-}
161306
- yymsp[-2].minor.yy503 = yylhsminor.yy503;
161307
- break;
161308
- case 304: /* windowdefn ::= nm AS LP window RP */
161309
-{
161310
- if( ALWAYS(yymsp[-1].minor.yy503) ){
161311
- yymsp[-1].minor.yy503->zName = sqlite3DbStrNDup(pParse->db, yymsp[-4].minor.yy0.z, yymsp[-4].minor.yy0.n);
161312
- }
161313
- yylhsminor.yy503 = yymsp[-1].minor.yy503;
161314
-}
161315
- yymsp[-4].minor.yy503 = yylhsminor.yy503;
161316
- break;
161317
- case 305: /* window ::= PARTITION BY nexprlist orderby_opt frame_opt */
161318
-{
161319
- yymsp[-4].minor.yy503 = sqlite3WindowAssemble(pParse, yymsp[0].minor.yy503, yymsp[-2].minor.yy350, yymsp[-1].minor.yy350, 0);
161320
-}
161321
- break;
161322
- case 306: /* window ::= nm PARTITION BY nexprlist orderby_opt frame_opt */
161323
-{
161324
- yylhsminor.yy503 = sqlite3WindowAssemble(pParse, yymsp[0].minor.yy503, yymsp[-2].minor.yy350, yymsp[-1].minor.yy350, &yymsp[-5].minor.yy0);
161325
-}
161326
- yymsp[-5].minor.yy503 = yylhsminor.yy503;
161327
- break;
161328
- case 307: /* window ::= ORDER BY sortlist frame_opt */
161329
-{
161330
- yymsp[-3].minor.yy503 = sqlite3WindowAssemble(pParse, yymsp[0].minor.yy503, 0, yymsp[-1].minor.yy350, 0);
161331
-}
161332
- break;
161333
- case 308: /* window ::= nm ORDER BY sortlist frame_opt */
161334
-{
161335
- yylhsminor.yy503 = sqlite3WindowAssemble(pParse, yymsp[0].minor.yy503, 0, yymsp[-1].minor.yy350, &yymsp[-4].minor.yy0);
161336
-}
161337
- yymsp[-4].minor.yy503 = yylhsminor.yy503;
161338
- break;
161339
- case 309: /* window ::= frame_opt */
161340
- case 328: /* filter_over ::= over_clause */ yytestcase(yyruleno==328);
161341
-{
161342
- yylhsminor.yy503 = yymsp[0].minor.yy503;
161343
-}
161344
- yymsp[0].minor.yy503 = yylhsminor.yy503;
161345
- break;
161346
- case 310: /* window ::= nm frame_opt */
161347
-{
161348
- yylhsminor.yy503 = sqlite3WindowAssemble(pParse, yymsp[0].minor.yy503, 0, 0, &yymsp[-1].minor.yy0);
161349
-}
161350
- yymsp[-1].minor.yy503 = yylhsminor.yy503;
161351
- break;
161352
- case 311: /* frame_opt ::= */
161353
-{
161354
- yymsp[1].minor.yy503 = sqlite3WindowAlloc(pParse, 0, TK_UNBOUNDED, 0, TK_CURRENT, 0, 0);
161355
-}
161356
- break;
161357
- case 312: /* frame_opt ::= range_or_rows frame_bound_s frame_exclude_opt */
161358
-{
161359
- yylhsminor.yy503 = sqlite3WindowAlloc(pParse, yymsp[-2].minor.yy412, yymsp[-1].minor.yy341.eType, yymsp[-1].minor.yy341.pExpr, TK_CURRENT, 0, yymsp[0].minor.yy624);
161360
-}
161361
- yymsp[-2].minor.yy503 = yylhsminor.yy503;
161362
- break;
161363
- case 313: /* frame_opt ::= range_or_rows BETWEEN frame_bound_s AND frame_bound_e frame_exclude_opt */
161364
-{
161365
- yylhsminor.yy503 = sqlite3WindowAlloc(pParse, yymsp[-5].minor.yy412, yymsp[-3].minor.yy341.eType, yymsp[-3].minor.yy341.pExpr, yymsp[-1].minor.yy341.eType, yymsp[-1].minor.yy341.pExpr, yymsp[0].minor.yy624);
161366
-}
161367
- yymsp[-5].minor.yy503 = yylhsminor.yy503;
161368
- break;
161369
- case 315: /* frame_bound_s ::= frame_bound */
161370
- case 317: /* frame_bound_e ::= frame_bound */ yytestcase(yyruleno==317);
161371
-{yylhsminor.yy341 = yymsp[0].minor.yy341;}
161372
- yymsp[0].minor.yy341 = yylhsminor.yy341;
161373
- break;
161374
- case 316: /* frame_bound_s ::= UNBOUNDED PRECEDING */
161375
- case 318: /* frame_bound_e ::= UNBOUNDED FOLLOWING */ yytestcase(yyruleno==318);
161376
- case 320: /* frame_bound ::= CURRENT ROW */ yytestcase(yyruleno==320);
161377
-{yylhsminor.yy341.eType = yymsp[-1].major; yylhsminor.yy341.pExpr = 0;}
161378
- yymsp[-1].minor.yy341 = yylhsminor.yy341;
161379
- break;
161380
- case 319: /* frame_bound ::= expr PRECEDING|FOLLOWING */
161381
-{yylhsminor.yy341.eType = yymsp[0].major; yylhsminor.yy341.pExpr = yymsp[-1].minor.yy354;}
161382
- yymsp[-1].minor.yy341 = yylhsminor.yy341;
161383
- break;
161384
- case 321: /* frame_exclude_opt ::= */
161385
-{yymsp[1].minor.yy624 = 0;}
161386
- break;
161387
- case 322: /* frame_exclude_opt ::= EXCLUDE frame_exclude */
161388
-{yymsp[-1].minor.yy624 = yymsp[0].minor.yy624;}
161389
- break;
161390
- case 323: /* frame_exclude ::= NO OTHERS */
161391
- case 324: /* frame_exclude ::= CURRENT ROW */ yytestcase(yyruleno==324);
161392
-{yymsp[-1].minor.yy624 = yymsp[-1].major; /*A-overwrites-X*/}
161393
- break;
161394
- case 325: /* frame_exclude ::= GROUP|TIES */
161395
-{yymsp[0].minor.yy624 = yymsp[0].major; /*A-overwrites-X*/}
161396
- break;
161397
- case 326: /* window_clause ::= WINDOW windowdefn_list */
161398
-{ yymsp[-1].minor.yy503 = yymsp[0].minor.yy503; }
161399
- break;
161400
- case 327: /* filter_over ::= filter_clause over_clause */
161401
-{
161402
- yymsp[0].minor.yy503->pFilter = yymsp[-1].minor.yy354;
161403
- yylhsminor.yy503 = yymsp[0].minor.yy503;
161404
-}
161405
- yymsp[-1].minor.yy503 = yylhsminor.yy503;
161406
- break;
161407
- case 329: /* filter_over ::= filter_clause */
161408
-{
161409
- yylhsminor.yy503 = (Window*)sqlite3DbMallocZero(pParse->db, sizeof(Window));
161410
- if( yylhsminor.yy503 ){
161411
- yylhsminor.yy503->eFrmType = TK_FILTER;
161412
- yylhsminor.yy503->pFilter = yymsp[0].minor.yy354;
161413
- }else{
161414
- sqlite3ExprDelete(pParse->db, yymsp[0].minor.yy354);
161415
- }
161416
-}
161417
- yymsp[0].minor.yy503 = yylhsminor.yy503;
161418
- break;
161419
- case 330: /* over_clause ::= OVER LP window RP */
161420
-{
161421
- yymsp[-3].minor.yy503 = yymsp[-1].minor.yy503;
161422
- assert( yymsp[-3].minor.yy503!=0 );
161423
-}
161424
- break;
161425
- case 331: /* over_clause ::= OVER nm */
161426
-{
161427
- yymsp[-1].minor.yy503 = (Window*)sqlite3DbMallocZero(pParse->db, sizeof(Window));
161428
- if( yymsp[-1].minor.yy503 ){
161429
- yymsp[-1].minor.yy503->zName = sqlite3DbStrNDup(pParse->db, yymsp[0].minor.yy0.z, yymsp[0].minor.yy0.n);
161430
- }
161431
-}
161432
- break;
161433
- case 332: /* filter_clause ::= FILTER LP WHERE expr RP */
161434
-{ yymsp[-4].minor.yy354 = yymsp[-1].minor.yy354; }
161452
+{ sqlite3WithPush(pParse, yymsp[0].minor.yy195, 1); }
161453
+ break;
161454
+ case 300: /* wqas ::= AS */
161455
+{yymsp[0].minor.yy570 = M10d_Any;}
161456
+ break;
161457
+ case 301: /* wqas ::= AS MATERIALIZED */
161458
+{yymsp[-1].minor.yy570 = M10d_Yes;}
161459
+ break;
161460
+ case 302: /* wqas ::= AS NOT MATERIALIZED */
161461
+{yymsp[-2].minor.yy570 = M10d_No;}
161462
+ break;
161463
+ case 303: /* wqitem ::= nm eidlist_opt wqas LP select RP */
161464
+{
161465
+ yymsp[-5].minor.yy607 = sqlite3CteNew(pParse, &yymsp[-5].minor.yy0, yymsp[-4].minor.yy338, yymsp[-1].minor.yy307, yymsp[-3].minor.yy570); /*A-overwrites-X*/
161466
+}
161467
+ break;
161468
+ case 304: /* wqlist ::= wqitem */
161469
+{
161470
+ yymsp[0].minor.yy195 = sqlite3WithAdd(pParse, 0, yymsp[0].minor.yy607); /*A-overwrites-X*/
161471
+}
161472
+ break;
161473
+ case 305: /* wqlist ::= wqlist COMMA wqitem */
161474
+{
161475
+ yymsp[-2].minor.yy195 = sqlite3WithAdd(pParse, yymsp[-2].minor.yy195, yymsp[0].minor.yy607);
161476
+}
161477
+ break;
161478
+ case 306: /* windowdefn_list ::= windowdefn */
161479
+{ yylhsminor.yy19 = yymsp[0].minor.yy19; }
161480
+ yymsp[0].minor.yy19 = yylhsminor.yy19;
161481
+ break;
161482
+ case 307: /* windowdefn_list ::= windowdefn_list COMMA windowdefn */
161483
+{
161484
+ assert( yymsp[0].minor.yy19!=0 );
161485
+ sqlite3WindowChain(pParse, yymsp[0].minor.yy19, yymsp[-2].minor.yy19);
161486
+ yymsp[0].minor.yy19->pNextWin = yymsp[-2].minor.yy19;
161487
+ yylhsminor.yy19 = yymsp[0].minor.yy19;
161488
+}
161489
+ yymsp[-2].minor.yy19 = yylhsminor.yy19;
161490
+ break;
161491
+ case 308: /* windowdefn ::= nm AS LP window RP */
161492
+{
161493
+ if( ALWAYS(yymsp[-1].minor.yy19) ){
161494
+ yymsp[-1].minor.yy19->zName = sqlite3DbStrNDup(pParse->db, yymsp[-4].minor.yy0.z, yymsp[-4].minor.yy0.n);
161495
+ }
161496
+ yylhsminor.yy19 = yymsp[-1].minor.yy19;
161497
+}
161498
+ yymsp[-4].minor.yy19 = yylhsminor.yy19;
161499
+ break;
161500
+ case 309: /* window ::= PARTITION BY nexprlist orderby_opt frame_opt */
161501
+{
161502
+ yymsp[-4].minor.yy19 = sqlite3WindowAssemble(pParse, yymsp[0].minor.yy19, yymsp[-2].minor.yy338, yymsp[-1].minor.yy338, 0);
161503
+}
161504
+ break;
161505
+ case 310: /* window ::= nm PARTITION BY nexprlist orderby_opt frame_opt */
161506
+{
161507
+ yylhsminor.yy19 = sqlite3WindowAssemble(pParse, yymsp[0].minor.yy19, yymsp[-2].minor.yy338, yymsp[-1].minor.yy338, &yymsp[-5].minor.yy0);
161508
+}
161509
+ yymsp[-5].minor.yy19 = yylhsminor.yy19;
161510
+ break;
161511
+ case 311: /* window ::= ORDER BY sortlist frame_opt */
161512
+{
161513
+ yymsp[-3].minor.yy19 = sqlite3WindowAssemble(pParse, yymsp[0].minor.yy19, 0, yymsp[-1].minor.yy338, 0);
161514
+}
161515
+ break;
161516
+ case 312: /* window ::= nm ORDER BY sortlist frame_opt */
161517
+{
161518
+ yylhsminor.yy19 = sqlite3WindowAssemble(pParse, yymsp[0].minor.yy19, 0, yymsp[-1].minor.yy338, &yymsp[-4].minor.yy0);
161519
+}
161520
+ yymsp[-4].minor.yy19 = yylhsminor.yy19;
161521
+ break;
161522
+ case 313: /* window ::= frame_opt */
161523
+ case 332: /* filter_over ::= over_clause */ yytestcase(yyruleno==332);
161524
+{
161525
+ yylhsminor.yy19 = yymsp[0].minor.yy19;
161526
+}
161527
+ yymsp[0].minor.yy19 = yylhsminor.yy19;
161528
+ break;
161529
+ case 314: /* window ::= nm frame_opt */
161530
+{
161531
+ yylhsminor.yy19 = sqlite3WindowAssemble(pParse, yymsp[0].minor.yy19, 0, 0, &yymsp[-1].minor.yy0);
161532
+}
161533
+ yymsp[-1].minor.yy19 = yylhsminor.yy19;
161534
+ break;
161535
+ case 315: /* frame_opt ::= */
161536
+{
161537
+ yymsp[1].minor.yy19 = sqlite3WindowAlloc(pParse, 0, TK_UNBOUNDED, 0, TK_CURRENT, 0, 0);
161538
+}
161539
+ break;
161540
+ case 316: /* frame_opt ::= range_or_rows frame_bound_s frame_exclude_opt */
161541
+{
161542
+ yylhsminor.yy19 = sqlite3WindowAlloc(pParse, yymsp[-2].minor.yy60, yymsp[-1].minor.yy113.eType, yymsp[-1].minor.yy113.pExpr, TK_CURRENT, 0, yymsp[0].minor.yy570);
161543
+}
161544
+ yymsp[-2].minor.yy19 = yylhsminor.yy19;
161545
+ break;
161546
+ case 317: /* frame_opt ::= range_or_rows BETWEEN frame_bound_s AND frame_bound_e frame_exclude_opt */
161547
+{
161548
+ yylhsminor.yy19 = sqlite3WindowAlloc(pParse, yymsp[-5].minor.yy60, yymsp[-3].minor.yy113.eType, yymsp[-3].minor.yy113.pExpr, yymsp[-1].minor.yy113.eType, yymsp[-1].minor.yy113.pExpr, yymsp[0].minor.yy570);
161549
+}
161550
+ yymsp[-5].minor.yy19 = yylhsminor.yy19;
161551
+ break;
161552
+ case 319: /* frame_bound_s ::= frame_bound */
161553
+ case 321: /* frame_bound_e ::= frame_bound */ yytestcase(yyruleno==321);
161554
+{yylhsminor.yy113 = yymsp[0].minor.yy113;}
161555
+ yymsp[0].minor.yy113 = yylhsminor.yy113;
161556
+ break;
161557
+ case 320: /* frame_bound_s ::= UNBOUNDED PRECEDING */
161558
+ case 322: /* frame_bound_e ::= UNBOUNDED FOLLOWING */ yytestcase(yyruleno==322);
161559
+ case 324: /* frame_bound ::= CURRENT ROW */ yytestcase(yyruleno==324);
161560
+{yylhsminor.yy113.eType = yymsp[-1].major; yylhsminor.yy113.pExpr = 0;}
161561
+ yymsp[-1].minor.yy113 = yylhsminor.yy113;
161562
+ break;
161563
+ case 323: /* frame_bound ::= expr PRECEDING|FOLLOWING */
161564
+{yylhsminor.yy113.eType = yymsp[0].major; yylhsminor.yy113.pExpr = yymsp[-1].minor.yy602;}
161565
+ yymsp[-1].minor.yy113 = yylhsminor.yy113;
161566
+ break;
161567
+ case 325: /* frame_exclude_opt ::= */
161568
+{yymsp[1].minor.yy570 = 0;}
161569
+ break;
161570
+ case 326: /* frame_exclude_opt ::= EXCLUDE frame_exclude */
161571
+{yymsp[-1].minor.yy570 = yymsp[0].minor.yy570;}
161572
+ break;
161573
+ case 327: /* frame_exclude ::= NO OTHERS */
161574
+ case 328: /* frame_exclude ::= CURRENT ROW */ yytestcase(yyruleno==328);
161575
+{yymsp[-1].minor.yy570 = yymsp[-1].major; /*A-overwrites-X*/}
161576
+ break;
161577
+ case 329: /* frame_exclude ::= GROUP|TIES */
161578
+{yymsp[0].minor.yy570 = yymsp[0].major; /*A-overwrites-X*/}
161579
+ break;
161580
+ case 330: /* window_clause ::= WINDOW windowdefn_list */
161581
+{ yymsp[-1].minor.yy19 = yymsp[0].minor.yy19; }
161582
+ break;
161583
+ case 331: /* filter_over ::= filter_clause over_clause */
161584
+{
161585
+ yymsp[0].minor.yy19->pFilter = yymsp[-1].minor.yy602;
161586
+ yylhsminor.yy19 = yymsp[0].minor.yy19;
161587
+}
161588
+ yymsp[-1].minor.yy19 = yylhsminor.yy19;
161589
+ break;
161590
+ case 333: /* filter_over ::= filter_clause */
161591
+{
161592
+ yylhsminor.yy19 = (Window*)sqlite3DbMallocZero(pParse->db, sizeof(Window));
161593
+ if( yylhsminor.yy19 ){
161594
+ yylhsminor.yy19->eFrmType = TK_FILTER;
161595
+ yylhsminor.yy19->pFilter = yymsp[0].minor.yy602;
161596
+ }else{
161597
+ sqlite3ExprDelete(pParse->db, yymsp[0].minor.yy602);
161598
+ }
161599
+}
161600
+ yymsp[0].minor.yy19 = yylhsminor.yy19;
161601
+ break;
161602
+ case 334: /* over_clause ::= OVER LP window RP */
161603
+{
161604
+ yymsp[-3].minor.yy19 = yymsp[-1].minor.yy19;
161605
+ assert( yymsp[-3].minor.yy19!=0 );
161606
+}
161607
+ break;
161608
+ case 335: /* over_clause ::= OVER nm */
161609
+{
161610
+ yymsp[-1].minor.yy19 = (Window*)sqlite3DbMallocZero(pParse->db, sizeof(Window));
161611
+ if( yymsp[-1].minor.yy19 ){
161612
+ yymsp[-1].minor.yy19->zName = sqlite3DbStrNDup(pParse->db, yymsp[0].minor.yy0.z, yymsp[0].minor.yy0.n);
161613
+ }
161614
+}
161615
+ break;
161616
+ case 336: /* filter_clause ::= FILTER LP WHERE expr RP */
161617
+{ yymsp[-4].minor.yy602 = yymsp[-1].minor.yy602; }
161435161618
break;
161436161619
default:
161437
- /* (333) input ::= cmdlist */ yytestcase(yyruleno==333);
161438
- /* (334) cmdlist ::= cmdlist ecmd */ yytestcase(yyruleno==334);
161439
- /* (335) cmdlist ::= ecmd (OPTIMIZED OUT) */ assert(yyruleno!=335);
161440
- /* (336) ecmd ::= SEMI */ yytestcase(yyruleno==336);
161441
- /* (337) ecmd ::= cmdx SEMI */ yytestcase(yyruleno==337);
161442
- /* (338) ecmd ::= explain cmdx SEMI (NEVER REDUCES) */ assert(yyruleno!=338);
161443
- /* (339) trans_opt ::= */ yytestcase(yyruleno==339);
161444
- /* (340) trans_opt ::= TRANSACTION */ yytestcase(yyruleno==340);
161445
- /* (341) trans_opt ::= TRANSACTION nm */ yytestcase(yyruleno==341);
161446
- /* (342) savepoint_opt ::= SAVEPOINT */ yytestcase(yyruleno==342);
161447
- /* (343) savepoint_opt ::= */ yytestcase(yyruleno==343);
161448
- /* (344) cmd ::= create_table create_table_args */ yytestcase(yyruleno==344);
161449
- /* (345) columnlist ::= columnlist COMMA columnname carglist */ yytestcase(yyruleno==345);
161450
- /* (346) columnlist ::= columnname carglist */ yytestcase(yyruleno==346);
161451
- /* (347) nm ::= ID|INDEXED */ yytestcase(yyruleno==347);
161452
- /* (348) nm ::= STRING */ yytestcase(yyruleno==348);
161453
- /* (349) nm ::= JOIN_KW */ yytestcase(yyruleno==349);
161454
- /* (350) typetoken ::= typename */ yytestcase(yyruleno==350);
161455
- /* (351) typename ::= ID|STRING */ yytestcase(yyruleno==351);
161456
- /* (352) signed ::= plus_num (OPTIMIZED OUT) */ assert(yyruleno!=352);
161457
- /* (353) signed ::= minus_num (OPTIMIZED OUT) */ assert(yyruleno!=353);
161458
- /* (354) carglist ::= carglist ccons */ yytestcase(yyruleno==354);
161459
- /* (355) carglist ::= */ yytestcase(yyruleno==355);
161460
- /* (356) ccons ::= NULL onconf */ yytestcase(yyruleno==356);
161461
- /* (357) ccons ::= GENERATED ALWAYS AS generated */ yytestcase(yyruleno==357);
161462
- /* (358) ccons ::= AS generated */ yytestcase(yyruleno==358);
161463
- /* (359) conslist_opt ::= COMMA conslist */ yytestcase(yyruleno==359);
161464
- /* (360) conslist ::= conslist tconscomma tcons */ yytestcase(yyruleno==360);
161465
- /* (361) conslist ::= tcons (OPTIMIZED OUT) */ assert(yyruleno!=361);
161466
- /* (362) tconscomma ::= */ yytestcase(yyruleno==362);
161467
- /* (363) defer_subclause_opt ::= defer_subclause (OPTIMIZED OUT) */ assert(yyruleno!=363);
161468
- /* (364) resolvetype ::= raisetype (OPTIMIZED OUT) */ assert(yyruleno!=364);
161469
- /* (365) selectnowith ::= oneselect (OPTIMIZED OUT) */ assert(yyruleno!=365);
161470
- /* (366) oneselect ::= values */ yytestcase(yyruleno==366);
161471
- /* (367) sclp ::= selcollist COMMA */ yytestcase(yyruleno==367);
161472
- /* (368) as ::= ID|STRING */ yytestcase(yyruleno==368);
161473
- /* (369) returning ::= */ yytestcase(yyruleno==369);
161474
- /* (370) expr ::= term (OPTIMIZED OUT) */ assert(yyruleno!=370);
161475
- /* (371) likeop ::= LIKE_KW|MATCH */ yytestcase(yyruleno==371);
161476
- /* (372) exprlist ::= nexprlist */ yytestcase(yyruleno==372);
161477
- /* (373) nmnum ::= plus_num (OPTIMIZED OUT) */ assert(yyruleno!=373);
161478
- /* (374) nmnum ::= nm (OPTIMIZED OUT) */ assert(yyruleno!=374);
161479
- /* (375) nmnum ::= ON */ yytestcase(yyruleno==375);
161480
- /* (376) nmnum ::= DELETE */ yytestcase(yyruleno==376);
161481
- /* (377) nmnum ::= DEFAULT */ yytestcase(yyruleno==377);
161482
- /* (378) plus_num ::= INTEGER|FLOAT */ yytestcase(yyruleno==378);
161483
- /* (379) foreach_clause ::= */ yytestcase(yyruleno==379);
161484
- /* (380) foreach_clause ::= FOR EACH ROW */ yytestcase(yyruleno==380);
161485
- /* (381) trnm ::= nm */ yytestcase(yyruleno==381);
161486
- /* (382) tridxby ::= */ yytestcase(yyruleno==382);
161487
- /* (383) database_kw_opt ::= DATABASE */ yytestcase(yyruleno==383);
161488
- /* (384) database_kw_opt ::= */ yytestcase(yyruleno==384);
161489
- /* (385) kwcolumn_opt ::= */ yytestcase(yyruleno==385);
161490
- /* (386) kwcolumn_opt ::= COLUMNKW */ yytestcase(yyruleno==386);
161491
- /* (387) vtabarglist ::= vtabarg */ yytestcase(yyruleno==387);
161492
- /* (388) vtabarglist ::= vtabarglist COMMA vtabarg */ yytestcase(yyruleno==388);
161493
- /* (389) vtabarg ::= vtabarg vtabargtoken */ yytestcase(yyruleno==389);
161494
- /* (390) anylist ::= */ yytestcase(yyruleno==390);
161495
- /* (391) anylist ::= anylist LP anylist RP */ yytestcase(yyruleno==391);
161496
- /* (392) anylist ::= anylist ANY */ yytestcase(yyruleno==392);
161497
- /* (393) with ::= */ yytestcase(yyruleno==393);
161620
+ /* (337) input ::= cmdlist */ yytestcase(yyruleno==337);
161621
+ /* (338) cmdlist ::= cmdlist ecmd */ yytestcase(yyruleno==338);
161622
+ /* (339) cmdlist ::= ecmd (OPTIMIZED OUT) */ assert(yyruleno!=339);
161623
+ /* (340) ecmd ::= SEMI */ yytestcase(yyruleno==340);
161624
+ /* (341) ecmd ::= cmdx SEMI */ yytestcase(yyruleno==341);
161625
+ /* (342) ecmd ::= explain cmdx SEMI (NEVER REDUCES) */ assert(yyruleno!=342);
161626
+ /* (343) trans_opt ::= */ yytestcase(yyruleno==343);
161627
+ /* (344) trans_opt ::= TRANSACTION */ yytestcase(yyruleno==344);
161628
+ /* (345) trans_opt ::= TRANSACTION nm */ yytestcase(yyruleno==345);
161629
+ /* (346) savepoint_opt ::= SAVEPOINT */ yytestcase(yyruleno==346);
161630
+ /* (347) savepoint_opt ::= */ yytestcase(yyruleno==347);
161631
+ /* (348) cmd ::= create_table create_table_args */ yytestcase(yyruleno==348);
161632
+ /* (349) columnlist ::= columnlist COMMA columnname carglist */ yytestcase(yyruleno==349);
161633
+ /* (350) columnlist ::= columnname carglist */ yytestcase(yyruleno==350);
161634
+ /* (351) nm ::= ID|INDEXED */ yytestcase(yyruleno==351);
161635
+ /* (352) nm ::= STRING */ yytestcase(yyruleno==352);
161636
+ /* (353) nm ::= JOIN_KW */ yytestcase(yyruleno==353);
161637
+ /* (354) typetoken ::= typename */ yytestcase(yyruleno==354);
161638
+ /* (355) typename ::= ID|STRING */ yytestcase(yyruleno==355);
161639
+ /* (356) signed ::= plus_num (OPTIMIZED OUT) */ assert(yyruleno!=356);
161640
+ /* (357) signed ::= minus_num (OPTIMIZED OUT) */ assert(yyruleno!=357);
161641
+ /* (358) carglist ::= carglist ccons */ yytestcase(yyruleno==358);
161642
+ /* (359) carglist ::= */ yytestcase(yyruleno==359);
161643
+ /* (360) ccons ::= NULL onconf */ yytestcase(yyruleno==360);
161644
+ /* (361) ccons ::= GENERATED ALWAYS AS generated */ yytestcase(yyruleno==361);
161645
+ /* (362) ccons ::= AS generated */ yytestcase(yyruleno==362);
161646
+ /* (363) conslist_opt ::= COMMA conslist */ yytestcase(yyruleno==363);
161647
+ /* (364) conslist ::= conslist tconscomma tcons */ yytestcase(yyruleno==364);
161648
+ /* (365) conslist ::= tcons (OPTIMIZED OUT) */ assert(yyruleno!=365);
161649
+ /* (366) tconscomma ::= */ yytestcase(yyruleno==366);
161650
+ /* (367) defer_subclause_opt ::= defer_subclause (OPTIMIZED OUT) */ assert(yyruleno!=367);
161651
+ /* (368) resolvetype ::= raisetype (OPTIMIZED OUT) */ assert(yyruleno!=368);
161652
+ /* (369) selectnowith ::= oneselect (OPTIMIZED OUT) */ assert(yyruleno!=369);
161653
+ /* (370) oneselect ::= values */ yytestcase(yyruleno==370);
161654
+ /* (371) sclp ::= selcollist COMMA */ yytestcase(yyruleno==371);
161655
+ /* (372) as ::= ID|STRING */ yytestcase(yyruleno==372);
161656
+ /* (373) returning ::= */ yytestcase(yyruleno==373);
161657
+ /* (374) expr ::= term (OPTIMIZED OUT) */ assert(yyruleno!=374);
161658
+ /* (375) likeop ::= LIKE_KW|MATCH */ yytestcase(yyruleno==375);
161659
+ /* (376) exprlist ::= nexprlist */ yytestcase(yyruleno==376);
161660
+ /* (377) nmnum ::= plus_num (OPTIMIZED OUT) */ assert(yyruleno!=377);
161661
+ /* (378) nmnum ::= nm (OPTIMIZED OUT) */ assert(yyruleno!=378);
161662
+ /* (379) nmnum ::= ON */ yytestcase(yyruleno==379);
161663
+ /* (380) nmnum ::= DELETE */ yytestcase(yyruleno==380);
161664
+ /* (381) nmnum ::= DEFAULT */ yytestcase(yyruleno==381);
161665
+ /* (382) plus_num ::= INTEGER|FLOAT */ yytestcase(yyruleno==382);
161666
+ /* (383) foreach_clause ::= */ yytestcase(yyruleno==383);
161667
+ /* (384) foreach_clause ::= FOR EACH ROW */ yytestcase(yyruleno==384);
161668
+ /* (385) trnm ::= nm */ yytestcase(yyruleno==385);
161669
+ /* (386) tridxby ::= */ yytestcase(yyruleno==386);
161670
+ /* (387) database_kw_opt ::= DATABASE */ yytestcase(yyruleno==387);
161671
+ /* (388) database_kw_opt ::= */ yytestcase(yyruleno==388);
161672
+ /* (389) kwcolumn_opt ::= */ yytestcase(yyruleno==389);
161673
+ /* (390) kwcolumn_opt ::= COLUMNKW */ yytestcase(yyruleno==390);
161674
+ /* (391) vtabarglist ::= vtabarg */ yytestcase(yyruleno==391);
161675
+ /* (392) vtabarglist ::= vtabarglist COMMA vtabarg */ yytestcase(yyruleno==392);
161676
+ /* (393) vtabarg ::= vtabarg vtabargtoken */ yytestcase(yyruleno==393);
161677
+ /* (394) anylist ::= */ yytestcase(yyruleno==394);
161678
+ /* (395) anylist ::= anylist LP anylist RP */ yytestcase(yyruleno==395);
161679
+ /* (396) anylist ::= anylist ANY */ yytestcase(yyruleno==396);
161680
+ /* (397) with ::= */ yytestcase(yyruleno==397);
161498161681
break;
161499161682
/********** End reduce actions ************************************************/
161500161683
};
161501161684
assert( yyruleno<sizeof(yyRuleInfoLhs)/sizeof(yyRuleInfoLhs[0]) );
161502161685
yygoto = yyRuleInfoLhs[yyruleno];
@@ -161999,25 +162182,25 @@
161999162182
** might be implemented more directly using a hand-written hash table.
162000162183
** But by using this automatically generated code, the size of the code
162001162184
** is substantially reduced. This is important for embedded applications
162002162185
** on platforms with limited memory.
162003162186
*/
162004
-/* Hash score: 229 */
162005
-/* zKWText[] encodes 994 bytes of keyword text in 657 bytes */
162187
+/* Hash score: 231 */
162188
+/* zKWText[] encodes 1007 bytes of keyword text in 667 bytes */
162006162189
/* REINDEXEDESCAPEACHECKEYBEFOREIGNOREGEXPLAINSTEADDATABASELECT */
162007162190
/* ABLEFTHENDEFERRABLELSEXCLUDELETEMPORARYISNULLSAVEPOINTERSECT */
162008162191
/* IESNOTNULLIKEXCEPTRANSACTIONATURALTERAISEXCLUSIVEXISTS */
162009162192
/* CONSTRAINTOFFSETRIGGERANGENERATEDETACHAVINGLOBEGINNEREFERENCES */
162010162193
/* UNIQUERYWITHOUTERELEASEATTACHBETWEENOTHINGROUPSCASCADEFAULT */
162011162194
/* CASECOLLATECREATECURRENT_DATEIMMEDIATEJOINSERTMATCHPLANALYZE */
162012
-/* PRAGMABORTUPDATEVALUESVIRTUALWAYSWHENWHERECURSIVEAFTERENAMEAND */
162013
-/* EFERREDISTINCTAUTOINCREMENTCASTCOLUMNCOMMITCONFLICTCROSS */
162014
-/* CURRENT_TIMESTAMPARTITIONDROPRECEDINGFAILASTFILTEREPLACEFIRST */
162015
-/* FOLLOWINGFROMFULLIMITIFORDERESTRICTOTHERSOVERETURNINGRIGHT */
162016
-/* ROLLBACKROWSUNBOUNDEDUNIONUSINGVACUUMVIEWINDOWBYINITIALLY */
162017
-/* PRIMARY */
162018
-static const char zKWText[656] = {
162195
+/* PRAGMATERIALIZEDEFERREDISTINCTUPDATEVALUESVIRTUALWAYSWHENWHERE */
162196
+/* CURSIVEABORTAFTERENAMEANDROPARTITIONAUTOINCREMENTCASTCOLUMN */
162197
+/* COMMITCONFLICTCROSSCURRENT_TIMESTAMPRECEDINGFAILASTFILTER */
162198
+/* EPLACEFIRSTFOLLOWINGFROMFULLIMITIFORDERESTRICTOTHERSOVER */
162199
+/* ETURNINGRIGHTROLLBACKROWSUNBOUNDEDUNIONUSINGVACUUMVIEWINDOWBY */
162200
+/* INITIALLYPRIMARY */
162201
+static const char zKWText[666] = {
162019162202
'R','E','I','N','D','E','X','E','D','E','S','C','A','P','E','A','C','H',
162020162203
'E','C','K','E','Y','B','E','F','O','R','E','I','G','N','O','R','E','G',
162021162204
'E','X','P','L','A','I','N','S','T','E','A','D','D','A','T','A','B','A',
162022162205
'S','E','L','E','C','T','A','B','L','E','F','T','H','E','N','D','E','F',
162023162206
'E','R','R','A','B','L','E','L','S','E','X','C','L','U','D','E','L','E',
@@ -162034,91 +162217,91 @@
162034162217
'E','N','O','T','H','I','N','G','R','O','U','P','S','C','A','S','C','A',
162035162218
'D','E','F','A','U','L','T','C','A','S','E','C','O','L','L','A','T','E',
162036162219
'C','R','E','A','T','E','C','U','R','R','E','N','T','_','D','A','T','E',
162037162220
'I','M','M','E','D','I','A','T','E','J','O','I','N','S','E','R','T','M',
162038162221
'A','T','C','H','P','L','A','N','A','L','Y','Z','E','P','R','A','G','M',
162039
- 'A','B','O','R','T','U','P','D','A','T','E','V','A','L','U','E','S','V',
162040
- 'I','R','T','U','A','L','W','A','Y','S','W','H','E','N','W','H','E','R',
162041
- 'E','C','U','R','S','I','V','E','A','F','T','E','R','E','N','A','M','E',
162042
- 'A','N','D','E','F','E','R','R','E','D','I','S','T','I','N','C','T','A',
162043
- 'U','T','O','I','N','C','R','E','M','E','N','T','C','A','S','T','C','O',
162044
- 'L','U','M','N','C','O','M','M','I','T','C','O','N','F','L','I','C','T',
162045
- 'C','R','O','S','S','C','U','R','R','E','N','T','_','T','I','M','E','S',
162046
- 'T','A','M','P','A','R','T','I','T','I','O','N','D','R','O','P','R','E',
162047
- 'C','E','D','I','N','G','F','A','I','L','A','S','T','F','I','L','T','E',
162048
- 'R','E','P','L','A','C','E','F','I','R','S','T','F','O','L','L','O','W',
162049
- 'I','N','G','F','R','O','M','F','U','L','L','I','M','I','T','I','F','O',
162050
- 'R','D','E','R','E','S','T','R','I','C','T','O','T','H','E','R','S','O',
162051
- 'V','E','R','E','T','U','R','N','I','N','G','R','I','G','H','T','R','O',
162052
- 'L','L','B','A','C','K','R','O','W','S','U','N','B','O','U','N','D','E',
162053
- 'D','U','N','I','O','N','U','S','I','N','G','V','A','C','U','U','M','V',
162054
- 'I','E','W','I','N','D','O','W','B','Y','I','N','I','T','I','A','L','L',
162055
- 'Y','P','R','I','M','A','R','Y',
162222
+ 'A','T','E','R','I','A','L','I','Z','E','D','E','F','E','R','R','E','D',
162223
+ 'I','S','T','I','N','C','T','U','P','D','A','T','E','V','A','L','U','E',
162224
+ 'S','V','I','R','T','U','A','L','W','A','Y','S','W','H','E','N','W','H',
162225
+ 'E','R','E','C','U','R','S','I','V','E','A','B','O','R','T','A','F','T',
162226
+ 'E','R','E','N','A','M','E','A','N','D','R','O','P','A','R','T','I','T',
162227
+ 'I','O','N','A','U','T','O','I','N','C','R','E','M','E','N','T','C','A',
162228
+ 'S','T','C','O','L','U','M','N','C','O','M','M','I','T','C','O','N','F',
162229
+ 'L','I','C','T','C','R','O','S','S','C','U','R','R','E','N','T','_','T',
162230
+ 'I','M','E','S','T','A','M','P','R','E','C','E','D','I','N','G','F','A',
162231
+ 'I','L','A','S','T','F','I','L','T','E','R','E','P','L','A','C','E','F',
162232
+ 'I','R','S','T','F','O','L','L','O','W','I','N','G','F','R','O','M','F',
162233
+ 'U','L','L','I','M','I','T','I','F','O','R','D','E','R','E','S','T','R',
162234
+ 'I','C','T','O','T','H','E','R','S','O','V','E','R','E','T','U','R','N',
162235
+ 'I','N','G','R','I','G','H','T','R','O','L','L','B','A','C','K','R','O',
162236
+ 'W','S','U','N','B','O','U','N','D','E','D','U','N','I','O','N','U','S',
162237
+ 'I','N','G','V','A','C','U','U','M','V','I','E','W','I','N','D','O','W',
162238
+ 'B','Y','I','N','I','T','I','A','L','L','Y','P','R','I','M','A','R','Y',
162056162239
};
162057162240
/* aKWHash[i] is the hash value for the i-th keyword */
162058162241
static const unsigned char aKWHash[127] = {
162059
- 84, 102, 133, 82, 114, 29, 0, 0, 91, 0, 85, 72, 0,
162060
- 53, 35, 86, 15, 0, 42, 94, 54, 126, 134, 19, 0, 0,
162061
- 139, 0, 40, 128, 0, 22, 104, 0, 9, 0, 0, 122, 80,
162062
- 0, 78, 6, 0, 65, 99, 146, 0, 135, 112, 0, 0, 48,
162063
- 0, 100, 24, 0, 17, 0, 27, 70, 23, 26, 5, 60, 141,
162064
- 107, 121, 0, 73, 101, 71, 144, 61, 119, 74, 0, 49, 0,
162065
- 11, 41, 0, 110, 0, 0, 0, 106, 10, 108, 113, 124, 14,
162066
- 50, 123, 0, 89, 0, 18, 120, 143, 56, 129, 138, 88, 83,
162067
- 37, 30, 125, 0, 0, 105, 51, 130, 127, 0, 34, 0, 0,
162068
- 131, 0, 95, 38, 39, 0, 20, 45, 116, 90,
162242
+ 84, 92, 134, 82, 105, 29, 0, 0, 94, 0, 85, 72, 0,
162243
+ 53, 35, 86, 15, 0, 42, 97, 54, 89, 135, 19, 0, 0,
162244
+ 140, 0, 40, 129, 0, 22, 107, 0, 9, 0, 0, 123, 80,
162245
+ 0, 78, 6, 0, 65, 103, 147, 0, 136, 115, 0, 0, 48,
162246
+ 0, 90, 24, 0, 17, 0, 27, 70, 23, 26, 5, 60, 142,
162247
+ 110, 122, 0, 73, 91, 71, 145, 61, 120, 74, 0, 49, 0,
162248
+ 11, 41, 0, 113, 0, 0, 0, 109, 10, 111, 116, 125, 14,
162249
+ 50, 124, 0, 100, 0, 18, 121, 144, 56, 130, 139, 88, 83,
162250
+ 37, 30, 126, 0, 0, 108, 51, 131, 128, 0, 34, 0, 0,
162251
+ 132, 0, 98, 38, 39, 0, 20, 45, 117, 93,
162069162252
};
162070162253
/* aKWNext[] forms the hash collision chain. If aKWHash[i]==0
162071162254
** then the i-th keyword has no more hash collisions. Otherwise,
162072162255
** the next keyword with the same hash is aKWHash[i]-1. */
162073
-static const unsigned char aKWNext[146] = {
162074
- 0, 0, 0, 0, 4, 0, 43, 0, 0, 103, 111, 0, 0,
162075
- 0, 2, 0, 0, 142, 0, 0, 0, 13, 0, 0, 0, 0,
162076
- 140, 0, 0, 118, 52, 0, 0, 136, 12, 0, 0, 62, 0,
162077
- 137, 0, 132, 0, 0, 36, 0, 0, 28, 77, 0, 0, 0,
162256
+static const unsigned char aKWNext[147] = {
162257
+ 0, 0, 0, 0, 4, 0, 43, 0, 0, 106, 114, 0, 0,
162258
+ 0, 2, 0, 0, 143, 0, 0, 0, 13, 0, 0, 0, 0,
162259
+ 141, 0, 0, 119, 52, 0, 0, 137, 12, 0, 0, 62, 0,
162260
+ 138, 0, 133, 0, 0, 36, 0, 0, 28, 77, 0, 0, 0,
162078162261
0, 59, 0, 47, 0, 0, 0, 0, 0, 0, 0, 0, 0,
162079
- 0, 69, 0, 0, 0, 0, 0, 145, 3, 0, 58, 0, 1,
162080
- 75, 0, 0, 0, 31, 0, 0, 0, 0, 0, 0, 64, 66,
162081
- 63, 0, 0, 0, 0, 46, 0, 16, 0, 115, 0, 0, 0,
162082
- 0, 0, 0, 0, 0, 0, 0, 81, 97, 0, 8, 0, 109,
162083
- 21, 7, 67, 0, 79, 93, 117, 0, 0, 68, 0, 0, 96,
162084
- 44, 0, 55, 0, 76, 0, 92, 32, 33, 57, 25, 0, 98,
162085
- 0, 0, 87,
162262
+ 0, 69, 0, 0, 0, 0, 0, 146, 3, 0, 58, 0, 1,
162263
+ 75, 0, 0, 0, 31, 0, 0, 0, 0, 0, 127, 0, 104,
162264
+ 0, 64, 66, 63, 0, 0, 0, 0, 0, 46, 0, 16, 8,
162265
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 81, 101, 0,
162266
+ 112, 21, 7, 67, 0, 79, 96, 118, 0, 0, 68, 0, 0,
162267
+ 99, 44, 0, 55, 0, 76, 0, 95, 32, 33, 57, 25, 0,
162268
+ 102, 0, 0, 87,
162086162269
};
162087162270
/* aKWLen[i] is the length (in bytes) of the i-th keyword */
162088
-static const unsigned char aKWLen[146] = {
162271
+static const unsigned char aKWLen[147] = {
162089162272
7, 7, 5, 4, 6, 4, 5, 3, 6, 7, 3, 6, 6,
162090162273
7, 7, 3, 8, 2, 6, 5, 4, 4, 3, 10, 4, 7,
162091162274
6, 9, 4, 2, 6, 5, 9, 9, 4, 7, 3, 2, 4,
162092162275
4, 6, 11, 6, 2, 7, 5, 5, 9, 6, 10, 4, 6,
162093162276
2, 3, 7, 5, 9, 6, 6, 4, 5, 5, 10, 6, 5,
162094162277
7, 4, 5, 7, 6, 7, 7, 6, 5, 7, 3, 7, 4,
162095
- 7, 6, 12, 9, 4, 6, 5, 4, 7, 6, 5, 6, 6,
162096
- 7, 6, 4, 5, 9, 5, 6, 3, 8, 8, 2, 13, 2,
162097
- 2, 4, 6, 6, 8, 5, 17, 12, 7, 9, 4, 9, 4,
162098
- 4, 6, 7, 5, 9, 4, 4, 5, 2, 5, 8, 6, 4,
162099
- 9, 5, 8, 4, 3, 9, 5, 5, 6, 4, 6, 2, 2,
162100
- 9, 3, 7,
162278
+ 7, 6, 12, 9, 4, 6, 5, 4, 7, 6, 12, 8, 8,
162279
+ 2, 6, 6, 7, 6, 4, 5, 9, 5, 5, 6, 3, 4,
162280
+ 9, 13, 2, 2, 4, 6, 6, 8, 5, 17, 12, 7, 9,
162281
+ 4, 4, 6, 7, 5, 9, 4, 4, 5, 2, 5, 8, 6,
162282
+ 4, 9, 5, 8, 4, 3, 9, 5, 5, 6, 4, 6, 2,
162283
+ 2, 9, 3, 7,
162101162284
};
162102162285
/* aKWOffset[i] is the index into zKWText[] of the start of
162103162286
** the text for the i-th keyword. */
162104
-static const unsigned short int aKWOffset[146] = {
162287
+static const unsigned short int aKWOffset[147] = {
162105162288
0, 2, 2, 8, 9, 14, 16, 20, 23, 25, 25, 29, 33,
162106162289
36, 41, 46, 48, 53, 54, 59, 62, 65, 67, 69, 78, 81,
162107162290
86, 90, 90, 94, 99, 101, 105, 111, 119, 123, 123, 123, 126,
162108162291
129, 132, 137, 142, 146, 147, 152, 156, 160, 168, 174, 181, 184,
162109162292
184, 187, 189, 195, 198, 206, 211, 216, 219, 222, 226, 236, 239,
162110162293
244, 244, 248, 252, 259, 265, 271, 277, 277, 283, 284, 288, 295,
162111
- 299, 306, 312, 324, 333, 335, 341, 346, 348, 355, 360, 365, 371,
162112
- 377, 382, 388, 392, 395, 404, 408, 414, 416, 423, 424, 431, 433,
162113
- 435, 444, 448, 454, 460, 468, 473, 473, 473, 489, 498, 501, 510,
162114
- 513, 517, 522, 529, 534, 543, 547, 550, 555, 557, 561, 569, 575,
162115
- 578, 587, 592, 600, 600, 604, 613, 618, 623, 629, 632, 635, 638,
162116
- 640, 645, 649,
162294
+ 299, 306, 312, 324, 333, 335, 341, 346, 348, 355, 359, 370, 377,
162295
+ 378, 385, 391, 397, 402, 408, 412, 415, 424, 429, 433, 439, 441,
162296
+ 444, 453, 455, 457, 466, 470, 476, 482, 490, 495, 495, 495, 511,
162297
+ 520, 523, 527, 532, 539, 544, 553, 557, 560, 565, 567, 571, 579,
162298
+ 585, 588, 597, 602, 610, 610, 614, 623, 628, 633, 639, 642, 645,
162299
+ 648, 650, 655, 659,
162117162300
};
162118162301
/* aKWCode[i] is the parser symbol code for the i-th keyword */
162119
-static const unsigned char aKWCode[146] = {
162302
+static const unsigned char aKWCode[147] = {
162120162303
TK_REINDEX, TK_INDEXED, TK_INDEX, TK_DESC, TK_ESCAPE,
162121162304
TK_EACH, TK_CHECK, TK_KEY, TK_BEFORE, TK_FOREIGN,
162122162305
TK_FOR, TK_IGNORE, TK_LIKE_KW, TK_EXPLAIN, TK_INSTEAD,
162123162306
TK_ADD, TK_DATABASE, TK_AS, TK_SELECT, TK_TABLE,
162124162307
TK_JOIN_KW, TK_THEN, TK_END, TK_DEFERRABLE, TK_ELSE,
@@ -162132,23 +162315,23 @@
162132162315
TK_BEGIN, TK_JOIN_KW, TK_REFERENCES, TK_UNIQUE, TK_QUERY,
162133162316
TK_WITHOUT, TK_WITH, TK_JOIN_KW, TK_RELEASE, TK_ATTACH,
162134162317
TK_BETWEEN, TK_NOTHING, TK_GROUPS, TK_GROUP, TK_CASCADE,
162135162318
TK_ASC, TK_DEFAULT, TK_CASE, TK_COLLATE, TK_CREATE,
162136162319
TK_CTIME_KW, TK_IMMEDIATE, TK_JOIN, TK_INSERT, TK_MATCH,
162137
- TK_PLAN, TK_ANALYZE, TK_PRAGMA, TK_ABORT, TK_UPDATE,
162138
- TK_VALUES, TK_VIRTUAL, TK_ALWAYS, TK_WHEN, TK_WHERE,
162139
- TK_RECURSIVE, TK_AFTER, TK_RENAME, TK_AND, TK_DEFERRED,
162140
- TK_DISTINCT, TK_IS, TK_AUTOINCR, TK_TO, TK_IN,
162141
- TK_CAST, TK_COLUMNKW, TK_COMMIT, TK_CONFLICT, TK_JOIN_KW,
162142
- TK_CTIME_KW, TK_CTIME_KW, TK_CURRENT, TK_PARTITION, TK_DROP,
162143
- TK_PRECEDING, TK_FAIL, TK_LAST, TK_FILTER, TK_REPLACE,
162144
- TK_FIRST, TK_FOLLOWING, TK_FROM, TK_JOIN_KW, TK_LIMIT,
162145
- TK_IF, TK_ORDER, TK_RESTRICT, TK_OTHERS, TK_OVER,
162146
- TK_RETURNING, TK_JOIN_KW, TK_ROLLBACK, TK_ROWS, TK_ROW,
162147
- TK_UNBOUNDED, TK_UNION, TK_USING, TK_VACUUM, TK_VIEW,
162148
- TK_WINDOW, TK_DO, TK_BY, TK_INITIALLY, TK_ALL,
162149
- TK_PRIMARY,
162320
+ TK_PLAN, TK_ANALYZE, TK_PRAGMA, TK_MATERIALIZED, TK_DEFERRED,
162321
+ TK_DISTINCT, TK_IS, TK_UPDATE, TK_VALUES, TK_VIRTUAL,
162322
+ TK_ALWAYS, TK_WHEN, TK_WHERE, TK_RECURSIVE, TK_ABORT,
162323
+ TK_AFTER, TK_RENAME, TK_AND, TK_DROP, TK_PARTITION,
162324
+ TK_AUTOINCR, TK_TO, TK_IN, TK_CAST, TK_COLUMNKW,
162325
+ TK_COMMIT, TK_CONFLICT, TK_JOIN_KW, TK_CTIME_KW, TK_CTIME_KW,
162326
+ TK_CURRENT, TK_PRECEDING, TK_FAIL, TK_LAST, TK_FILTER,
162327
+ TK_REPLACE, TK_FIRST, TK_FOLLOWING, TK_FROM, TK_JOIN_KW,
162328
+ TK_LIMIT, TK_IF, TK_ORDER, TK_RESTRICT, TK_OTHERS,
162329
+ TK_OVER, TK_RETURNING, TK_JOIN_KW, TK_ROLLBACK, TK_ROWS,
162330
+ TK_ROW, TK_UNBOUNDED, TK_UNION, TK_USING, TK_VACUUM,
162331
+ TK_VIEW, TK_WINDOW, TK_DO, TK_BY, TK_INITIALLY,
162332
+ TK_ALL, TK_PRIMARY,
162150162333
};
162151162334
/* Hash table decoded:
162152162335
** 0: INSERT
162153162336
** 1: IS
162154162337
** 2: ROLLBACK TRIGGER
@@ -162168,11 +162351,11 @@
162168162351
** 16: INSTEAD INDEXED
162169162352
** 17:
162170162353
** 18: TRANSACTION RIGHT
162171162354
** 19: WHEN
162172162355
** 20: SET HAVING
162173
-** 21: IF
162356
+** 21: MATERIALIZED IF
162174162357
** 22: ROWS
162175162358
** 23: SELECT
162176162359
** 24:
162177162360
** 25:
162178162361
** 26: VACUUM SAVEPOINT
@@ -162387,68 +162570,69 @@
162387162570
testcase( i==83 ); /* INSERT */
162388162571
testcase( i==84 ); /* MATCH */
162389162572
testcase( i==85 ); /* PLAN */
162390162573
testcase( i==86 ); /* ANALYZE */
162391162574
testcase( i==87 ); /* PRAGMA */
162392
- testcase( i==88 ); /* ABORT */
162393
- testcase( i==89 ); /* UPDATE */
162394
- testcase( i==90 ); /* VALUES */
162395
- testcase( i==91 ); /* VIRTUAL */
162396
- testcase( i==92 ); /* ALWAYS */
162397
- testcase( i==93 ); /* WHEN */
162398
- testcase( i==94 ); /* WHERE */
162399
- testcase( i==95 ); /* RECURSIVE */
162400
- testcase( i==96 ); /* AFTER */
162401
- testcase( i==97 ); /* RENAME */
162402
- testcase( i==98 ); /* AND */
162403
- testcase( i==99 ); /* DEFERRED */
162404
- testcase( i==100 ); /* DISTINCT */
162405
- testcase( i==101 ); /* IS */
162406
- testcase( i==102 ); /* AUTOINCREMENT */
162407
- testcase( i==103 ); /* TO */
162408
- testcase( i==104 ); /* IN */
162409
- testcase( i==105 ); /* CAST */
162410
- testcase( i==106 ); /* COLUMN */
162411
- testcase( i==107 ); /* COMMIT */
162412
- testcase( i==108 ); /* CONFLICT */
162413
- testcase( i==109 ); /* CROSS */
162414
- testcase( i==110 ); /* CURRENT_TIMESTAMP */
162415
- testcase( i==111 ); /* CURRENT_TIME */
162416
- testcase( i==112 ); /* CURRENT */
162417
- testcase( i==113 ); /* PARTITION */
162418
- testcase( i==114 ); /* DROP */
162419
- testcase( i==115 ); /* PRECEDING */
162420
- testcase( i==116 ); /* FAIL */
162421
- testcase( i==117 ); /* LAST */
162422
- testcase( i==118 ); /* FILTER */
162423
- testcase( i==119 ); /* REPLACE */
162424
- testcase( i==120 ); /* FIRST */
162425
- testcase( i==121 ); /* FOLLOWING */
162426
- testcase( i==122 ); /* FROM */
162427
- testcase( i==123 ); /* FULL */
162428
- testcase( i==124 ); /* LIMIT */
162429
- testcase( i==125 ); /* IF */
162430
- testcase( i==126 ); /* ORDER */
162431
- testcase( i==127 ); /* RESTRICT */
162432
- testcase( i==128 ); /* OTHERS */
162433
- testcase( i==129 ); /* OVER */
162434
- testcase( i==130 ); /* RETURNING */
162435
- testcase( i==131 ); /* RIGHT */
162436
- testcase( i==132 ); /* ROLLBACK */
162437
- testcase( i==133 ); /* ROWS */
162438
- testcase( i==134 ); /* ROW */
162439
- testcase( i==135 ); /* UNBOUNDED */
162440
- testcase( i==136 ); /* UNION */
162441
- testcase( i==137 ); /* USING */
162442
- testcase( i==138 ); /* VACUUM */
162443
- testcase( i==139 ); /* VIEW */
162444
- testcase( i==140 ); /* WINDOW */
162445
- testcase( i==141 ); /* DO */
162446
- testcase( i==142 ); /* BY */
162447
- testcase( i==143 ); /* INITIALLY */
162448
- testcase( i==144 ); /* ALL */
162449
- testcase( i==145 ); /* PRIMARY */
162575
+ testcase( i==88 ); /* MATERIALIZED */
162576
+ testcase( i==89 ); /* DEFERRED */
162577
+ testcase( i==90 ); /* DISTINCT */
162578
+ testcase( i==91 ); /* IS */
162579
+ testcase( i==92 ); /* UPDATE */
162580
+ testcase( i==93 ); /* VALUES */
162581
+ testcase( i==94 ); /* VIRTUAL */
162582
+ testcase( i==95 ); /* ALWAYS */
162583
+ testcase( i==96 ); /* WHEN */
162584
+ testcase( i==97 ); /* WHERE */
162585
+ testcase( i==98 ); /* RECURSIVE */
162586
+ testcase( i==99 ); /* ABORT */
162587
+ testcase( i==100 ); /* AFTER */
162588
+ testcase( i==101 ); /* RENAME */
162589
+ testcase( i==102 ); /* AND */
162590
+ testcase( i==103 ); /* DROP */
162591
+ testcase( i==104 ); /* PARTITION */
162592
+ testcase( i==105 ); /* AUTOINCREMENT */
162593
+ testcase( i==106 ); /* TO */
162594
+ testcase( i==107 ); /* IN */
162595
+ testcase( i==108 ); /* CAST */
162596
+ testcase( i==109 ); /* COLUMN */
162597
+ testcase( i==110 ); /* COMMIT */
162598
+ testcase( i==111 ); /* CONFLICT */
162599
+ testcase( i==112 ); /* CROSS */
162600
+ testcase( i==113 ); /* CURRENT_TIMESTAMP */
162601
+ testcase( i==114 ); /* CURRENT_TIME */
162602
+ testcase( i==115 ); /* CURRENT */
162603
+ testcase( i==116 ); /* PRECEDING */
162604
+ testcase( i==117 ); /* FAIL */
162605
+ testcase( i==118 ); /* LAST */
162606
+ testcase( i==119 ); /* FILTER */
162607
+ testcase( i==120 ); /* REPLACE */
162608
+ testcase( i==121 ); /* FIRST */
162609
+ testcase( i==122 ); /* FOLLOWING */
162610
+ testcase( i==123 ); /* FROM */
162611
+ testcase( i==124 ); /* FULL */
162612
+ testcase( i==125 ); /* LIMIT */
162613
+ testcase( i==126 ); /* IF */
162614
+ testcase( i==127 ); /* ORDER */
162615
+ testcase( i==128 ); /* RESTRICT */
162616
+ testcase( i==129 ); /* OTHERS */
162617
+ testcase( i==130 ); /* OVER */
162618
+ testcase( i==131 ); /* RETURNING */
162619
+ testcase( i==132 ); /* RIGHT */
162620
+ testcase( i==133 ); /* ROLLBACK */
162621
+ testcase( i==134 ); /* ROWS */
162622
+ testcase( i==135 ); /* ROW */
162623
+ testcase( i==136 ); /* UNBOUNDED */
162624
+ testcase( i==137 ); /* UNION */
162625
+ testcase( i==138 ); /* USING */
162626
+ testcase( i==139 ); /* VACUUM */
162627
+ testcase( i==140 ); /* VIEW */
162628
+ testcase( i==141 ); /* WINDOW */
162629
+ testcase( i==142 ); /* DO */
162630
+ testcase( i==143 ); /* BY */
162631
+ testcase( i==144 ); /* INITIALLY */
162632
+ testcase( i==145 ); /* ALL */
162633
+ testcase( i==146 ); /* PRIMARY */
162450162634
*pType = aKWCode[i];
162451162635
break;
162452162636
}
162453162637
}
162454162638
return n;
@@ -162456,11 +162640,11 @@
162456162640
SQLITE_PRIVATE int sqlite3KeywordCode(const unsigned char *z, int n){
162457162641
int id = TK_ID;
162458162642
keywordCode((char*)z, n, &id);
162459162643
return id;
162460162644
}
162461
-#define SQLITE_N_KEYWORD 146
162645
+#define SQLITE_N_KEYWORD 147
162462162646
SQLITE_API int sqlite3_keyword_name(int i,const char **pzName,int *pnName){
162463162647
if( i<0 || i>=SQLITE_N_KEYWORD ) return SQLITE_ERROR;
162464162648
*pzName = zKWText + aKWOffset[i];
162465162649
*pnName = aKWLen[i];
162466162650
return SQLITE_OK;
@@ -184069,27 +184253,31 @@
184069184253
if( pNode->block.a){
184070184254
rc = nodeReaderInit(&reader, pNode->block.a, pNode->block.n);
184071184255
while( reader.aNode && rc==SQLITE_OK ) rc = nodeReaderNext(&reader);
184072184256
blobGrowBuffer(&pNode->key, reader.term.n, &rc);
184073184257
if( rc==SQLITE_OK ){
184074
- memcpy(pNode->key.a, reader.term.a, reader.term.n);
184075
- pNode->key.n = reader.term.n;
184076
- if( i>0 ){
184077
- char *aBlock = 0;
184078
- int nBlock = 0;
184079
- pNode = &pWriter->aNodeWriter[i-1];
184080
- pNode->iBlock = reader.iChild;
184081
- rc = sqlite3Fts3ReadBlock(p, reader.iChild, &aBlock, &nBlock, 0);
184082
- blobGrowBuffer(&pNode->block,
184083
- MAX(nBlock, p->nNodeSize)+FTS3_NODE_PADDING, &rc
184084
- );
184085
- if( rc==SQLITE_OK ){
184086
- memcpy(pNode->block.a, aBlock, nBlock);
184087
- pNode->block.n = nBlock;
184088
- memset(&pNode->block.a[nBlock], 0, FTS3_NODE_PADDING);
184089
- }
184090
- sqlite3_free(aBlock);
184258
+ if( reader.term.n<=0 ){
184259
+ rc = FTS_CORRUPT_VTAB;
184260
+ }else{
184261
+ memcpy(pNode->key.a, reader.term.a, reader.term.n);
184262
+ pNode->key.n = reader.term.n;
184263
+ if( i>0 ){
184264
+ char *aBlock = 0;
184265
+ int nBlock = 0;
184266
+ pNode = &pWriter->aNodeWriter[i-1];
184267
+ pNode->iBlock = reader.iChild;
184268
+ rc = sqlite3Fts3ReadBlock(p, reader.iChild, &aBlock, &nBlock,0);
184269
+ blobGrowBuffer(&pNode->block,
184270
+ MAX(nBlock, p->nNodeSize)+FTS3_NODE_PADDING, &rc
184271
+ );
184272
+ if( rc==SQLITE_OK ){
184273
+ memcpy(pNode->block.a, aBlock, nBlock);
184274
+ pNode->block.n = nBlock;
184275
+ memset(&pNode->block.a[nBlock], 0, FTS3_NODE_PADDING);
184276
+ }
184277
+ sqlite3_free(aBlock);
184278
+ }
184091184279
}
184092184280
}
184093184281
}
184094184282
nodeReaderRelease(&reader);
184095184283
}
@@ -205169,10 +205357,11 @@
205169205357
struct sqlite3_changeset_iter {
205170205358
SessionInput in; /* Input buffer or stream */
205171205359
SessionBuffer tblhdr; /* Buffer to hold apValue/zTab/abPK/ */
205172205360
int bPatchset; /* True if this is a patchset */
205173205361
int bInvert; /* True to invert changeset */
205362
+ int bSkipEmpty; /* Skip noop UPDATE changes */
205174205363
int rc; /* Iterator error code */
205175205364
sqlite3_stmt *pConflict; /* Points to conflicting row, if any */
205176205365
char *zTab; /* Current table */
205177205366
int nCol; /* Number of columns in zTab */
205178205367
int op; /* Current operation */
@@ -207698,11 +207887,12 @@
207698207887
sqlite3_changeset_iter **pp, /* OUT: Changeset iterator handle */
207699207888
int (*xInput)(void *pIn, void *pData, int *pnData),
207700207889
void *pIn,
207701207890
int nChangeset, /* Size of buffer pChangeset in bytes */
207702207891
void *pChangeset, /* Pointer to buffer containing changeset */
207703
- int bInvert /* True to invert changeset */
207892
+ int bInvert, /* True to invert changeset */
207893
+ int bSkipEmpty /* True to skip empty UPDATE changes */
207704207894
){
207705207895
sqlite3_changeset_iter *pRet; /* Iterator to return */
207706207896
int nByte; /* Number of bytes to allocate for iterator */
207707207897
207708207898
assert( xInput==0 || (pChangeset==0 && nChangeset==0) );
@@ -207719,10 +207909,11 @@
207719207909
pRet->in.nData = nChangeset;
207720207910
pRet->in.xInput = xInput;
207721207911
pRet->in.pIn = pIn;
207722207912
pRet->in.bEof = (xInput ? 0 : 1);
207723207913
pRet->bInvert = bInvert;
207914
+ pRet->bSkipEmpty = bSkipEmpty;
207724207915
207725207916
/* Populate the output variable and return success. */
207726207917
*pp = pRet;
207727207918
return SQLITE_OK;
207728207919
}
@@ -207733,20 +207924,20 @@
207733207924
SQLITE_API int sqlite3changeset_start(
207734207925
sqlite3_changeset_iter **pp, /* OUT: Changeset iterator handle */
207735207926
int nChangeset, /* Size of buffer pChangeset in bytes */
207736207927
void *pChangeset /* Pointer to buffer containing changeset */
207737207928
){
207738
- return sessionChangesetStart(pp, 0, 0, nChangeset, pChangeset, 0);
207929
+ return sessionChangesetStart(pp, 0, 0, nChangeset, pChangeset, 0, 0);
207739207930
}
207740207931
SQLITE_API int sqlite3changeset_start_v2(
207741207932
sqlite3_changeset_iter **pp, /* OUT: Changeset iterator handle */
207742207933
int nChangeset, /* Size of buffer pChangeset in bytes */
207743207934
void *pChangeset, /* Pointer to buffer containing changeset */
207744207935
int flags
207745207936
){
207746207937
int bInvert = !!(flags & SQLITE_CHANGESETSTART_INVERT);
207747
- return sessionChangesetStart(pp, 0, 0, nChangeset, pChangeset, bInvert);
207938
+ return sessionChangesetStart(pp, 0, 0, nChangeset, pChangeset, bInvert, 0);
207748207939
}
207749207940
207750207941
/*
207751207942
** Streaming version of sqlite3changeset_start().
207752207943
*/
@@ -207753,20 +207944,20 @@
207753207944
SQLITE_API int sqlite3changeset_start_strm(
207754207945
sqlite3_changeset_iter **pp, /* OUT: Changeset iterator handle */
207755207946
int (*xInput)(void *pIn, void *pData, int *pnData),
207756207947
void *pIn
207757207948
){
207758
- return sessionChangesetStart(pp, xInput, pIn, 0, 0, 0);
207949
+ return sessionChangesetStart(pp, xInput, pIn, 0, 0, 0, 0);
207759207950
}
207760207951
SQLITE_API int sqlite3changeset_start_v2_strm(
207761207952
sqlite3_changeset_iter **pp, /* OUT: Changeset iterator handle */
207762207953
int (*xInput)(void *pIn, void *pData, int *pnData),
207763207954
void *pIn,
207764207955
int flags
207765207956
){
207766207957
int bInvert = !!(flags & SQLITE_CHANGESETSTART_INVERT);
207767
- return sessionChangesetStart(pp, xInput, pIn, 0, 0, bInvert);
207958
+ return sessionChangesetStart(pp, xInput, pIn, 0, 0, bInvert, 0);
207768207959
}
207769207960
207770207961
/*
207771207962
** If the SessionInput object passed as the only argument is a streaming
207772207963
** object and the buffer is full, discard some data to free up space.
@@ -207888,15 +208079,18 @@
207888208079
*/
207889208080
static int sessionReadRecord(
207890208081
SessionInput *pIn, /* Input data */
207891208082
int nCol, /* Number of values in record */
207892208083
u8 *abPK, /* Array of primary key flags, or NULL */
207893
- sqlite3_value **apOut /* Write values to this array */
208084
+ sqlite3_value **apOut, /* Write values to this array */
208085
+ int *pbEmpty
207894208086
){
207895208087
int i; /* Used to iterate through columns */
207896208088
int rc = SQLITE_OK;
207897208089
208090
+ assert( pbEmpty==0 || *pbEmpty==0 );
208091
+ if( pbEmpty ) *pbEmpty = 1;
207898208092
for(i=0; i<nCol && rc==SQLITE_OK; i++){
207899208093
int eType = 0; /* Type of value (SQLITE_NULL, TEXT etc.) */
207900208094
if( abPK && abPK[i]==0 ) continue;
207901208095
rc = sessionInputBuffer(pIn, 9);
207902208096
if( rc==SQLITE_OK ){
@@ -207904,10 +208098,11 @@
207904208098
rc = SQLITE_CORRUPT_BKPT;
207905208099
}else{
207906208100
eType = pIn->aData[pIn->iNext++];
207907208101
assert( apOut[i]==0 );
207908208102
if( eType ){
208103
+ if( pbEmpty ) *pbEmpty = 0;
207909208104
apOut[i] = sqlite3ValueNew(0);
207910208105
if( !apOut[i] ) rc = SQLITE_NOMEM;
207911208106
}
207912208107
}
207913208108
}
@@ -208083,35 +208278,31 @@
208083208278
}
208084208279
return (p->rc = rc);
208085208280
}
208086208281
208087208282
/*
208088
-** Advance the changeset iterator to the next change.
208089
-**
208090
-** If both paRec and pnRec are NULL, then this function works like the public
208091
-** API sqlite3changeset_next(). If SQLITE_ROW is returned, then the
208092
-** sqlite3changeset_new() and old() APIs may be used to query for values.
208093
-**
208094
-** Otherwise, if paRec and pnRec are not NULL, then a pointer to the change
208095
-** record is written to *paRec before returning and the number of bytes in
208096
-** the record to *pnRec.
208097
-**
208098
-** Either way, this function returns SQLITE_ROW if the iterator is
208099
-** successfully advanced to the next change in the changeset, an SQLite
208100
-** error code if an error occurs, or SQLITE_DONE if there are no further
208101
-** changes in the changeset.
208102
-*/
208103
-static int sessionChangesetNext(
208283
+** Advance the changeset iterator to the next change. The differences between
208284
+** this function and sessionChangesetNext() are that
208285
+**
208286
+** * If pbEmpty is not NULL and the change is a no-op UPDATE (an UPDATE
208287
+** that modifies no columns), this function sets (*pbEmpty) to 1.
208288
+**
208289
+** * If the iterator is configured to skip no-op UPDATEs,
208290
+** sessionChangesetNext() does that. This function does not.
208291
+*/
208292
+static int sessionChangesetNextOne(
208104208293
sqlite3_changeset_iter *p, /* Changeset iterator */
208105208294
u8 **paRec, /* If non-NULL, store record pointer here */
208106208295
int *pnRec, /* If non-NULL, store size of record here */
208107
- int *pbNew /* If non-NULL, true if new table */
208296
+ int *pbNew, /* If non-NULL, true if new table */
208297
+ int *pbEmpty
208108208298
){
208109208299
int i;
208110208300
u8 op;
208111208301
208112208302
assert( (paRec==0 && pnRec==0) || (paRec && pnRec) );
208303
+ assert( pbEmpty==0 || *pbEmpty==0 );
208113208304
208114208305
/* If the iterator is in the error-state, return immediately. */
208115208306
if( p->rc!=SQLITE_OK ) return p->rc;
208116208307
208117208308
/* Free the current contents of p->apValue[], if any. */
@@ -208180,17 +208371,17 @@
208180208371
sqlite3_value **apNew = (p->bInvert ? p->apValue : &p->apValue[p->nCol]);
208181208372
208182208373
/* If this is an UPDATE or DELETE, read the old.* record. */
208183208374
if( p->op!=SQLITE_INSERT && (p->bPatchset==0 || p->op==SQLITE_DELETE) ){
208184208375
u8 *abPK = p->bPatchset ? p->abPK : 0;
208185
- p->rc = sessionReadRecord(&p->in, p->nCol, abPK, apOld);
208376
+ p->rc = sessionReadRecord(&p->in, p->nCol, abPK, apOld, 0);
208186208377
if( p->rc!=SQLITE_OK ) return p->rc;
208187208378
}
208188208379
208189208380
/* If this is an INSERT or UPDATE, read the new.* record. */
208190208381
if( p->op!=SQLITE_DELETE ){
208191
- p->rc = sessionReadRecord(&p->in, p->nCol, 0, apNew);
208382
+ p->rc = sessionReadRecord(&p->in, p->nCol, 0, apNew, pbEmpty);
208192208383
if( p->rc!=SQLITE_OK ) return p->rc;
208193208384
}
208194208385
208195208386
if( (p->bPatchset || p->bInvert) && p->op==SQLITE_UPDATE ){
208196208387
/* If this is an UPDATE that is part of a patchset, then all PK and
@@ -208212,10 +208403,41 @@
208212208403
}
208213208404
}
208214208405
208215208406
return SQLITE_ROW;
208216208407
}
208408
+
208409
+/*
208410
+** Advance the changeset iterator to the next change.
208411
+**
208412
+** If both paRec and pnRec are NULL, then this function works like the public
208413
+** API sqlite3changeset_next(). If SQLITE_ROW is returned, then the
208414
+** sqlite3changeset_new() and old() APIs may be used to query for values.
208415
+**
208416
+** Otherwise, if paRec and pnRec are not NULL, then a pointer to the change
208417
+** record is written to *paRec before returning and the number of bytes in
208418
+** the record to *pnRec.
208419
+**
208420
+** Either way, this function returns SQLITE_ROW if the iterator is
208421
+** successfully advanced to the next change in the changeset, an SQLite
208422
+** error code if an error occurs, or SQLITE_DONE if there are no further
208423
+** changes in the changeset.
208424
+*/
208425
+static int sessionChangesetNext(
208426
+ sqlite3_changeset_iter *p, /* Changeset iterator */
208427
+ u8 **paRec, /* If non-NULL, store record pointer here */
208428
+ int *pnRec, /* If non-NULL, store size of record here */
208429
+ int *pbNew /* If non-NULL, true if new table */
208430
+){
208431
+ int bEmpty;
208432
+ int rc;
208433
+ do {
208434
+ bEmpty = 0;
208435
+ rc = sessionChangesetNextOne(p, paRec, pnRec, pbNew, &bEmpty);
208436
+ }while( rc==SQLITE_ROW && p->bSkipEmpty && bEmpty);
208437
+ return rc;
208438
+}
208217208439
208218208440
/*
208219208441
** Advance an iterator created by sqlite3changeset_start() to the next
208220208442
** change in the changeset. This function may return SQLITE_ROW, SQLITE_DONE
208221208443
** or SQLITE_CORRUPT.
@@ -208485,13 +208707,13 @@
208485208707
sessionAppendByte(&sOut, eType, &rc);
208486208708
sessionAppendByte(&sOut, pInput->aData[pInput->iNext+1], &rc);
208487208709
208488208710
/* Read the old.* and new.* records for the update change. */
208489208711
pInput->iNext += 2;
208490
- rc = sessionReadRecord(pInput, nCol, 0, &apVal[0]);
208712
+ rc = sessionReadRecord(pInput, nCol, 0, &apVal[0], 0);
208491208713
if( rc==SQLITE_OK ){
208492
- rc = sessionReadRecord(pInput, nCol, 0, &apVal[nCol]);
208714
+ rc = sessionReadRecord(pInput, nCol, 0, &apVal[nCol], 0);
208493208715
}
208494208716
208495208717
/* Write the new old.* record. Consists of the PK columns from the
208496208718
** original old.* record, and the other values from the original
208497208719
** new.* record. */
@@ -209435,11 +209657,11 @@
209435209657
sqlite3_changeset_iter *pIter2 = 0;
209436209658
SessionBuffer cons = pApply->constraints;
209437209659
memset(&pApply->constraints, 0, sizeof(SessionBuffer));
209438209660
209439209661
rc = sessionChangesetStart(
209440
- &pIter2, 0, 0, cons.nBuf, cons.aBuf, pApply->bInvertConstraints
209662
+ &pIter2, 0, 0, cons.nBuf, cons.aBuf, pApply->bInvertConstraints, 1
209441209663
);
209442209664
if( rc==SQLITE_OK ){
209443209665
size_t nByte = 2*pApply->nCol*sizeof(sqlite3_value*);
209444209666
int rc2;
209445209667
pIter2->bPatchset = bPatchset;
@@ -209691,12 +209913,12 @@
209691209913
void *pCtx, /* First argument passed to xConflict */
209692209914
void **ppRebase, int *pnRebase,
209693209915
int flags
209694209916
){
209695209917
sqlite3_changeset_iter *pIter; /* Iterator to skip through changeset */
209696
- int bInverse = !!(flags & SQLITE_CHANGESETAPPLY_INVERT);
209697
- int rc = sessionChangesetStart(&pIter, 0, 0, nChangeset, pChangeset,bInverse);
209918
+ int bInv = !!(flags & SQLITE_CHANGESETAPPLY_INVERT);
209919
+ int rc = sessionChangesetStart(&pIter, 0, 0, nChangeset, pChangeset, bInv, 1);
209698209920
if( rc==SQLITE_OK ){
209699209921
rc = sessionChangesetApply(
209700209922
db, pIter, xFilter, xConflict, pCtx, ppRebase, pnRebase, flags
209701209923
);
209702209924
}
@@ -209750,11 +209972,11 @@
209750209972
void **ppRebase, int *pnRebase,
209751209973
int flags
209752209974
){
209753209975
sqlite3_changeset_iter *pIter; /* Iterator to skip through changeset */
209754209976
int bInverse = !!(flags & SQLITE_CHANGESETAPPLY_INVERT);
209755
- int rc = sessionChangesetStart(&pIter, xInput, pIn, 0, 0, bInverse);
209977
+ int rc = sessionChangesetStart(&pIter, xInput, pIn, 0, 0, bInverse, 1);
209756209978
if( rc==SQLITE_OK ){
209757209979
rc = sessionChangesetApply(
209758209980
db, pIter, xFilter, xConflict, pCtx, ppRebase, pnRebase, flags
209759209981
);
209760209982
}
@@ -210370,11 +210592,11 @@
210370210592
*pOut++ = pIter->bIndirect;
210371210593
for(i=0; i<pIter->nCol; i++){
210372210594
int n1 = sessionSerialLen(a1);
210373210595
int n2 = sessionSerialLen(a2);
210374210596
if( pIter->abPK[i] || a2[0]==0 ){
210375
- if( !pIter->abPK[i] ) bData = 1;
210597
+ if( !pIter->abPK[i] && a1[0] ) bData = 1;
210376210598
memcpy(pOut, a1, n1);
210377210599
pOut += n1;
210378210600
}else if( a2[0]!=0xFF ){
210379210601
bData = 1;
210380210602
memcpy(pOut, a2, n2);
@@ -228768,11 +228990,11 @@
228768228990
int nArg, /* Number of args */
228769228991
sqlite3_value **apUnused /* Function arguments */
228770228992
){
228771228993
assert( nArg==0 );
228772228994
UNUSED_PARAM2(nArg, apUnused);
228773
- sqlite3_result_text(pCtx, "fts5: 2021-02-17 13:19:22 c46a94a624c2cc6c49ac916a206a913081e1628c24805987cabc75c9057ea36b", -1, SQLITE_TRANSIENT);
228995
+ sqlite3_result_text(pCtx, "fts5: 2021-02-22 11:07:25 b66a49570852cf118a372a6ac44be3070cf9b4254696f16315b7c79a614e6c35", -1, SQLITE_TRANSIENT);
228774228996
}
228775228997
228776228998
/*
228777228999
** Return true if zName is the extension on one of the shadow tables used
228778229000
** by this module.
@@ -233694,12 +233916,12 @@
233694233916
}
233695233917
#endif /* SQLITE_CORE */
233696233918
#endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_STMTVTAB) */
233697233919
233698233920
/************** End of stmt.c ************************************************/
233699
-#if __LINE__!=233699
233921
+#if __LINE__!=233921
233700233922
#undef SQLITE_SOURCE_ID
233701
-#define SQLITE_SOURCE_ID "2021-02-19 14:32:58 c844a331e78949850fde8ed95058cb34f863566944bc9e92e3ae042768f1alt2"
233923
+#define SQLITE_SOURCE_ID "2021-02-22 16:42:09 b5a0778cc5a98a864bea72670f83262da940aceb91fa4cdf46ec097337a3alt2"
233702233924
#endif
233703233925
/* Return the source-id for this library */
233704233926
SQLITE_API const char *sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; }
233705233927
/************************** End of sqlite3.c ******************************/
233706233928
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -1186,11 +1186,11 @@
1186 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
1187 ** [sqlite_version()] and [sqlite_source_id()].
1188 */
1189 #define SQLITE_VERSION "3.35.0"
1190 #define SQLITE_VERSION_NUMBER 3035000
1191 #define SQLITE_SOURCE_ID "2021-02-19 14:32:58 c844a331e78949850fde8ed95058cb34f863566944bc9e92e3ae042768f130e1"
1192
1193 /*
1194 ** CAPI3REF: Run-Time Library Version Numbers
1195 ** KEYWORDS: sqlite3_version sqlite3_sourceid
1196 **
@@ -14125,95 +14125,96 @@
14125 #define TK_GROUPS 92
14126 #define TK_OTHERS 93
14127 #define TK_TIES 94
14128 #define TK_GENERATED 95
14129 #define TK_ALWAYS 96
14130 #define TK_REINDEX 97
14131 #define TK_RENAME 98
14132 #define TK_CTIME_KW 99
14133 #define TK_ANY 100
14134 #define TK_BITAND 101
14135 #define TK_BITOR 102
14136 #define TK_LSHIFT 103
14137 #define TK_RSHIFT 104
14138 #define TK_PLUS 105
14139 #define TK_MINUS 106
14140 #define TK_STAR 107
14141 #define TK_SLASH 108
14142 #define TK_REM 109
14143 #define TK_CONCAT 110
14144 #define TK_COLLATE 111
14145 #define TK_BITNOT 112
14146 #define TK_ON 113
14147 #define TK_INDEXED 114
14148 #define TK_STRING 115
14149 #define TK_JOIN_KW 116
14150 #define TK_CONSTRAINT 117
14151 #define TK_DEFAULT 118
14152 #define TK_NULL 119
14153 #define TK_PRIMARY 120
14154 #define TK_UNIQUE 121
14155 #define TK_CHECK 122
14156 #define TK_REFERENCES 123
14157 #define TK_AUTOINCR 124
14158 #define TK_INSERT 125
14159 #define TK_DELETE 126
14160 #define TK_UPDATE 127
14161 #define TK_SET 128
14162 #define TK_DEFERRABLE 129
14163 #define TK_FOREIGN 130
14164 #define TK_DROP 131
14165 #define TK_UNION 132
14166 #define TK_ALL 133
14167 #define TK_EXCEPT 134
14168 #define TK_INTERSECT 135
14169 #define TK_SELECT 136
14170 #define TK_VALUES 137
14171 #define TK_DISTINCT 138
14172 #define TK_DOT 139
14173 #define TK_FROM 140
14174 #define TK_JOIN 141
14175 #define TK_USING 142
14176 #define TK_ORDER 143
14177 #define TK_GROUP 144
14178 #define TK_HAVING 145
14179 #define TK_LIMIT 146
14180 #define TK_WHERE 147
14181 #define TK_RETURNING 148
14182 #define TK_INTO 149
14183 #define TK_NOTHING 150
14184 #define TK_FLOAT 151
14185 #define TK_BLOB 152
14186 #define TK_INTEGER 153
14187 #define TK_VARIABLE 154
14188 #define TK_CASE 155
14189 #define TK_WHEN 156
14190 #define TK_THEN 157
14191 #define TK_ELSE 158
14192 #define TK_INDEX 159
14193 #define TK_ALTER 160
14194 #define TK_ADD 161
14195 #define TK_WINDOW 162
14196 #define TK_OVER 163
14197 #define TK_FILTER 164
14198 #define TK_COLUMN 165
14199 #define TK_AGG_FUNCTION 166
14200 #define TK_AGG_COLUMN 167
14201 #define TK_TRUEFALSE 168
14202 #define TK_ISNOT 169
14203 #define TK_FUNCTION 170
14204 #define TK_UMINUS 171
14205 #define TK_UPLUS 172
14206 #define TK_TRUTH 173
14207 #define TK_REGISTER 174
14208 #define TK_VECTOR 175
14209 #define TK_SELECT_COLUMN 176
14210 #define TK_IF_NULL_ROW 177
14211 #define TK_ASTERISK 178
14212 #define TK_SPAN 179
14213 #define TK_SPACE 180
14214 #define TK_ILLEGAL 181
 
14215
14216 /************** End of parse.h ***********************************************/
14217 /************** Continuing where we left off in sqliteInt.h ******************/
14218 #include <stdio.h>
14219 #include <stdlib.h>
@@ -14764,10 +14765,12 @@
14764 typedef struct AuthContext AuthContext;
14765 typedef struct AutoincInfo AutoincInfo;
14766 typedef struct Bitvec Bitvec;
14767 typedef struct CollSeq CollSeq;
14768 typedef struct Column Column;
 
 
14769 typedef struct Db Db;
14770 typedef struct DbFixer DbFixer;
14771 typedef struct Schema Schema;
14772 typedef struct Expr Expr;
14773 typedef struct ExprList ExprList;
@@ -14793,10 +14796,11 @@
14793 typedef struct RowSet RowSet;
14794 typedef struct Savepoint Savepoint;
14795 typedef struct Select Select;
14796 typedef struct SQLiteThread SQLiteThread;
14797 typedef struct SelectDest SelectDest;
 
14798 typedef struct SrcList SrcList;
14799 typedef struct sqlite3_str StrAccum; /* Internal alias for sqlite3_str */
14800 typedef struct Table Table;
14801 typedef struct TableLock TableLock;
14802 typedef struct Token Token;
@@ -15786,26 +15790,26 @@
15786 #define OP_ReopenIdx 96 /* synopsis: root=P2 iDb=P3 */
15787 #define OP_OpenRead 97 /* synopsis: root=P2 iDb=P3 */
15788 #define OP_OpenWrite 98 /* synopsis: root=P2 iDb=P3 */
15789 #define OP_OpenDup 99
15790 #define OP_OpenAutoindex 100 /* synopsis: nColumn=P2 */
15791 #define OP_BitAnd 101 /* same as TK_BITAND, synopsis: r[P3]=r[P1]&r[P2] */
15792 #define OP_BitOr 102 /* same as TK_BITOR, synopsis: r[P3]=r[P1]|r[P2] */
15793 #define OP_ShiftLeft 103 /* same as TK_LSHIFT, synopsis: r[P3]=r[P2]<<r[P1] */
15794 #define OP_ShiftRight 104 /* same as TK_RSHIFT, synopsis: r[P3]=r[P2]>>r[P1] */
15795 #define OP_Add 105 /* same as TK_PLUS, synopsis: r[P3]=r[P1]+r[P2] */
15796 #define OP_Subtract 106 /* same as TK_MINUS, synopsis: r[P3]=r[P2]-r[P1] */
15797 #define OP_Multiply 107 /* same as TK_STAR, synopsis: r[P3]=r[P1]*r[P2] */
15798 #define OP_Divide 108 /* same as TK_SLASH, synopsis: r[P3]=r[P2]/r[P1] */
15799 #define OP_Remainder 109 /* same as TK_REM, synopsis: r[P3]=r[P2]%r[P1] */
15800 #define OP_Concat 110 /* same as TK_CONCAT, synopsis: r[P3]=r[P2]+r[P1] */
15801 #define OP_OpenEphemeral 111 /* synopsis: nColumn=P2 */
15802 #define OP_BitNot 112 /* same as TK_BITNOT, synopsis: r[P2]= ~r[P1] */
15803 #define OP_SorterOpen 113
15804 #define OP_SequenceTest 114 /* synopsis: if( cursor[P1].ctr++ ) pc = P2 */
15805 #define OP_String8 115 /* same as TK_STRING, synopsis: r[P2]='P4' */
15806 #define OP_OpenPseudo 116 /* synopsis: P3 columns in r[P2] */
15807 #define OP_Close 117
15808 #define OP_ColumnsUsed 118
15809 #define OP_SeekScan 119 /* synopsis: Scan-ahead up to P1 rows */
15810 #define OP_SeekHit 120 /* synopsis: set P2<=seekHit<=P3 */
15811 #define OP_Sequence 121 /* synopsis: r[P2]=cursor[P1].ctr++ */
@@ -15836,12 +15840,12 @@
15836 #define OP_DropTable 146
15837 #define OP_DropIndex 147
15838 #define OP_DropTrigger 148
15839 #define OP_IntegrityCk 149
15840 #define OP_RowSetAdd 150 /* synopsis: rowset(P1)=r[P2] */
15841 #define OP_Real 151 /* same as TK_FLOAT, synopsis: r[P2]=P4 */
15842 #define OP_Param 152
15843 #define OP_FkCounter 153 /* synopsis: fkctr[P1]+=P2 */
15844 #define OP_MemMax 154 /* synopsis: r[P1]=max(r[P1],r[P2]) */
15845 #define OP_OffsetLimit 155 /* synopsis: if r[P1]>0 then r[P2]=r[P1]+max(0,r[P3]) else r[P2]=(-1) */
15846 #define OP_AggInverse 156 /* synopsis: accum=r[P3] inverse(r[P2@P5]) */
15847 #define OP_AggStep 157 /* synopsis: accum=r[P3] step(r[P2@P5]) */
@@ -15888,13 +15892,13 @@
15888 /* 56 */ 0x0b, 0x0b, 0x01, 0x03, 0x01, 0x01, 0x01, 0x00,\
15889 /* 64 */ 0x00, 0x02, 0x02, 0x08, 0x00, 0x10, 0x10, 0x10,\
15890 /* 72 */ 0x10, 0x00, 0x10, 0x10, 0x00, 0x00, 0x10, 0x10,\
15891 /* 80 */ 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, 0x00, 0x00,\
15892 /* 88 */ 0x12, 0x20, 0x00, 0x00, 0x00, 0x10, 0x10, 0x00,\
15893 /* 96 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x26, 0x26, 0x26,\
15894 /* 104 */ 0x26, 0x26, 0x26, 0x26, 0x26, 0x26, 0x26, 0x00,\
15895 /* 112 */ 0x12, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00,\
15896 /* 120 */ 0x00, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,\
15897 /* 128 */ 0x00, 0x00, 0x10, 0x00, 0x00, 0x04, 0x04, 0x00,\
15898 /* 136 */ 0x00, 0x10, 0x00, 0x10, 0x00, 0x00, 0x10, 0x00,\
15899 /* 144 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x10,\
15900 /* 152 */ 0x10, 0x00, 0x04, 0x1a, 0x00, 0x00, 0x00, 0x00,\
@@ -18376,10 +18380,49 @@
18376 int idx; /* Index in some Table.aCol[] of a column named zName */
18377 } *a;
18378 int nId; /* Number of identifiers on the list */
18379 };
18380
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
18381 /*
18382 ** The following structure describes the FROM clause of a SELECT statement.
18383 ** Each table or subquery in the FROM clause is a separate element of
18384 ** the SrcList.a[] array.
18385 **
@@ -18398,40 +18441,11 @@
18398 ** contains more than 63 columns and the 64-th or later column is used.
18399 */
18400 struct SrcList {
18401 int nSrc; /* Number of tables or subqueries in the FROM clause */
18402 u32 nAlloc; /* Number of entries allocated in a[] below */
18403 struct SrcList_item {
18404 Schema *pSchema; /* Schema to which this item is fixed */
18405 char *zDatabase; /* Name of database holding this table */
18406 char *zName; /* Name of the table */
18407 char *zAlias; /* The "B" part of a "A AS B" phrase. zName is the "A" */
18408 Table *pTab; /* An SQL table corresponding to zName */
18409 Select *pSelect; /* A SELECT statement used in place of a table name */
18410 int addrFillSub; /* Address of subroutine to manifest a subquery */
18411 int regReturn; /* Register holding return address of addrFillSub */
18412 int regResult; /* Registers holding results of a co-routine */
18413 struct {
18414 u8 jointype; /* Type of join between this table and the previous */
18415 unsigned notIndexed :1; /* True if there is a NOT INDEXED clause */
18416 unsigned isIndexedBy :1; /* True if there is an INDEXED BY clause */
18417 unsigned isTabFunc :1; /* True if table-valued-function syntax */
18418 unsigned isCorrelated :1; /* True if sub-query is correlated */
18419 unsigned viaCoroutine :1; /* Implemented as a co-routine */
18420 unsigned isRecursive :1; /* True for recursive reference in WITH */
18421 unsigned fromDDL :1; /* Comes from sqlite_schema */
18422 } fg;
18423 int iCursor; /* The VDBE cursor number used to access this table */
18424 Expr *pOn; /* The ON clause of a join */
18425 IdList *pUsing; /* The USING clause of a join */
18426 Bitmask colUsed; /* Bit N (1<<N) set if column N of pTab is used */
18427 union {
18428 char *zIndexedBy; /* Identifier from "INDEXED BY <zIndex>" clause */
18429 ExprList *pFuncArg; /* Arguments to table-valued-function */
18430 } u1;
18431 Index *pIBIndex; /* Index structure corresponding to u1.zIndexedBy */
18432 } a[1]; /* One entry for each identifier on the list */
18433 };
18434
18435 /*
18436 ** Permitted values of the SrcList.a.jointype field
18437 */
@@ -19289,11 +19303,11 @@
19289 Select *pSelect; /* HAVING to WHERE clause ctx */
19290 struct WindowRewrite *pRewrite; /* Window rewrite context */
19291 struct WhereConst *pConst; /* WHERE clause constants */
19292 struct RenameCtx *pRename; /* RENAME COLUMN context */
19293 struct Table *pTab; /* Table of generated column */
19294 struct SrcList_item *pSrcItem; /* A single FROM clause item */
19295 DbFixer *pFix;
19296 } u;
19297 };
19298
19299 /*
@@ -19334,23 +19348,58 @@
19334 #define WRC_Continue 0 /* Continue down into children */
19335 #define WRC_Prune 1 /* Omit children but continue walking siblings */
19336 #define WRC_Abort 2 /* Abandon the tree walk */
19337
19338 /*
19339 ** An instance of this structure represents a set of one or more CTEs
19340 ** (common table expressions) created by a single WITH clause.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19341 */
19342 struct With {
19343 int nCte; /* Number of CTEs in the WITH clause */
19344 With *pOuter; /* Containing WITH clause, or NULL */
19345 struct Cte { /* For each CTE in the WITH clause.... */
19346 char *zName; /* Name of this CTE */
19347 ExprList *pCols; /* List of explicit column names, or NULL */
19348 Select *pSelect; /* The definition of this CTE */
19349 const char *zCteErr; /* Error message for circular references */
19350 } a[1];
19351 };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19352
19353 #ifdef SQLITE_DEBUG
19354 /*
19355 ** An instance of the TreeView object is used for printing the content of
19356 ** data structures on sqlite3DebugPrintf() using a tree-like view.
@@ -19807,11 +19856,11 @@
19807 SQLITE_PRIVATE SrcList *sqlite3SrcListAppend(Parse*, SrcList*, Token*, Token*);
19808 SQLITE_PRIVATE SrcList *sqlite3SrcListAppendFromTerm(Parse*, SrcList*, Token*, Token*,
19809 Token*, Select*, Expr*, IdList*);
19810 SQLITE_PRIVATE void sqlite3SrcListIndexedBy(Parse *, SrcList *, Token *);
19811 SQLITE_PRIVATE void sqlite3SrcListFuncArgs(Parse*, SrcList*, ExprList*);
19812 SQLITE_PRIVATE int sqlite3IndexedByLookup(Parse *, struct SrcList_item *);
19813 SQLITE_PRIVATE void sqlite3SrcListShiftJoinType(SrcList*);
19814 SQLITE_PRIVATE void sqlite3SrcListAssignCursors(Parse*, SrcList*);
19815 SQLITE_PRIVATE void sqlite3IdListDelete(sqlite3*, IdList*);
19816 SQLITE_PRIVATE void sqlite3SrcListDelete(sqlite3*, SrcList*);
19817 SQLITE_PRIVATE Index *sqlite3AllocateIndexObject(sqlite3*,i16,int,char**);
@@ -19869,11 +19918,11 @@
19869 SQLITE_PRIVATE void sqlite3ExprIfFalseDup(Parse*, Expr*, int, int);
19870 SQLITE_PRIVATE Table *sqlite3FindTable(sqlite3*,const char*, const char*);
19871 #define LOCATE_VIEW 0x01
19872 #define LOCATE_NOERR 0x02
19873 SQLITE_PRIVATE Table *sqlite3LocateTable(Parse*,u32 flags,const char*, const char*);
19874 SQLITE_PRIVATE Table *sqlite3LocateTableItem(Parse*,u32 flags,struct SrcList_item *);
19875 SQLITE_PRIVATE Index *sqlite3FindIndex(sqlite3*,const char*, const char*);
19876 SQLITE_PRIVATE void sqlite3UnlinkAndDeleteTable(sqlite3*,int,const char*);
19877 SQLITE_PRIVATE void sqlite3UnlinkAndDeleteIndex(sqlite3*,int,const char*);
19878 SQLITE_PRIVATE void sqlite3Vacuum(Parse*,Token*,Expr*);
19879 SQLITE_PRIVATE int sqlite3RunVacuum(char**, sqlite3*, int, sqlite3_value*);
@@ -20164,11 +20213,11 @@
20164 SQLITE_PRIVATE void sqlite3NestedParse(Parse*, const char*, ...);
20165 SQLITE_PRIVATE void sqlite3ExpirePreparedStatements(sqlite3*, int);
20166 SQLITE_PRIVATE void sqlite3CodeRhsOfIN(Parse*, Expr*, int);
20167 SQLITE_PRIVATE int sqlite3CodeSubselect(Parse*, Expr*);
20168 SQLITE_PRIVATE void sqlite3SelectPrep(Parse*, Select*, NameContext*);
20169 SQLITE_PRIVATE int sqlite3ExpandSubquery(Parse*, struct SrcList_item*);
20170 SQLITE_PRIVATE void sqlite3SelectWrongNumTermsError(Parse *pParse, Select *p);
20171 SQLITE_PRIVATE int sqlite3MatchEName(
20172 const struct ExprList_item*,
20173 const char*,
20174 const char*,
@@ -20336,11 +20385,11 @@
20336 SQLITE_PRIVATE FuncDef *sqlite3VtabOverloadFunction(sqlite3 *,FuncDef*, int nArg, Expr*);
20337 SQLITE_PRIVATE sqlite3_int64 sqlite3StmtCurrentTime(sqlite3_context*);
20338 SQLITE_PRIVATE int sqlite3VdbeParameterIndex(Vdbe*, const char*, int);
20339 SQLITE_PRIVATE int sqlite3TransferBindings(sqlite3_stmt *, sqlite3_stmt *);
20340 SQLITE_PRIVATE void sqlite3ParserReset(Parse*);
20341 SQLITE_PRIVATE void sqlite3ParserAddCleanup(Parse*,void(*)(sqlite3*,void*),void*);
20342 #ifdef SQLITE_ENABLE_NORMALIZE
20343 SQLITE_PRIVATE char *sqlite3Normalize(Vdbe*, const char*);
20344 #endif
20345 SQLITE_PRIVATE int sqlite3Reprepare(Vdbe*);
20346 SQLITE_PRIVATE void sqlite3ExprListCheckLength(Parse*, ExprList*, const char*);
@@ -20351,16 +20400,21 @@
20351 #ifndef SQLITE_OMIT_WAL
20352 SQLITE_PRIVATE int sqlite3Checkpoint(sqlite3*, int, int, int*, int*);
20353 SQLITE_PRIVATE int sqlite3WalDefaultHook(void*,sqlite3*,const char*,int);
20354 #endif
20355 #ifndef SQLITE_OMIT_CTE
20356 SQLITE_PRIVATE With *sqlite3WithAdd(Parse*,With*,Token*,ExprList*,Select*);
 
 
20357 SQLITE_PRIVATE void sqlite3WithDelete(sqlite3*,With*);
20358 SQLITE_PRIVATE void sqlite3WithPush(Parse*, With*, u8);
20359 #else
20360 #define sqlite3WithPush(x,y,z)
20361 #define sqlite3WithDelete(x,y)
 
 
 
20362 #endif
20363 #ifndef SQLITE_OMIT_UPSERT
20364 SQLITE_PRIVATE Upsert *sqlite3UpsertNew(sqlite3*,ExprList*,Expr*,ExprList*,Expr*,Upsert*);
20365 SQLITE_PRIVATE void sqlite3UpsertDelete(sqlite3*,Upsert*);
20366 SQLITE_PRIVATE Upsert *sqlite3UpsertDup(sqlite3*,Upsert*);
@@ -29210,11 +29264,11 @@
29210 break;
29211 }
29212 case etSRCLIST: {
29213 SrcList *pSrc;
29214 int k;
29215 struct SrcList_item *pItem;
29216 if( (pAccum->printfFlags & SQLITE_PRINTF_INTERNAL)==0 ) return;
29217 pSrc = va_arg(ap, SrcList*);
29218 k = va_arg(ap, int);
29219 pItem = &pSrc->a[k];
29220 assert( bArgList==0 );
@@ -29778,11 +29832,14 @@
29778 sqlite3_str_appendf(&x, "%c%s", cSep, pCte->pCols->a[j].zEName);
29779 cSep = ',';
29780 }
29781 sqlite3_str_appendf(&x, ")");
29782 }
29783 sqlite3_str_appendf(&x, " AS");
 
 
 
29784 sqlite3StrAccumFinish(&x);
29785 sqlite3TreeViewItem(pView, zLine, i<pWith->nCte-1);
29786 sqlite3TreeViewSelect(pView, pCte->pSelect, 0);
29787 sqlite3TreeViewPop(pView);
29788 }
@@ -29794,11 +29851,11 @@
29794 ** Generate a human-readable description of a SrcList object.
29795 */
29796 SQLITE_PRIVATE void sqlite3TreeViewSrcList(TreeView *pView, const SrcList *pSrc){
29797 int i;
29798 for(i=0; i<pSrc->nSrc; i++){
29799 const struct SrcList_item *pItem = &pSrc->a[i];
29800 StrAccum x;
29801 char zLine[100];
29802 sqlite3StrAccumInit(&x, 0, zLine, sizeof(zLine), 0);
29803 sqlite3_str_appendf(&x, "{%d:*}", pItem->iCursor);
29804 if( pItem->zDatabase ){
@@ -29817,10 +29874,13 @@
29817 sqlite3_str_appendf(&x, " LEFT-JOIN");
29818 }
29819 if( pItem->fg.fromDDL ){
29820 sqlite3_str_appendf(&x, " DDL");
29821 }
 
 
 
29822 sqlite3StrAccumFinish(&x);
29823 sqlite3TreeViewItem(pView, zLine, i<pSrc->nSrc-1);
29824 if( pItem->pSelect ){
29825 sqlite3TreeViewSelect(pView, pItem->pSelect, 0);
29826 }
@@ -33490,26 +33550,26 @@
33490 /* 96 */ "ReopenIdx" OpHelp("root=P2 iDb=P3"),
33491 /* 97 */ "OpenRead" OpHelp("root=P2 iDb=P3"),
33492 /* 98 */ "OpenWrite" OpHelp("root=P2 iDb=P3"),
33493 /* 99 */ "OpenDup" OpHelp(""),
33494 /* 100 */ "OpenAutoindex" OpHelp("nColumn=P2"),
33495 /* 101 */ "BitAnd" OpHelp("r[P3]=r[P1]&r[P2]"),
33496 /* 102 */ "BitOr" OpHelp("r[P3]=r[P1]|r[P2]"),
33497 /* 103 */ "ShiftLeft" OpHelp("r[P3]=r[P2]<<r[P1]"),
33498 /* 104 */ "ShiftRight" OpHelp("r[P3]=r[P2]>>r[P1]"),
33499 /* 105 */ "Add" OpHelp("r[P3]=r[P1]+r[P2]"),
33500 /* 106 */ "Subtract" OpHelp("r[P3]=r[P2]-r[P1]"),
33501 /* 107 */ "Multiply" OpHelp("r[P3]=r[P1]*r[P2]"),
33502 /* 108 */ "Divide" OpHelp("r[P3]=r[P2]/r[P1]"),
33503 /* 109 */ "Remainder" OpHelp("r[P3]=r[P2]%r[P1]"),
33504 /* 110 */ "Concat" OpHelp("r[P3]=r[P2]+r[P1]"),
33505 /* 111 */ "OpenEphemeral" OpHelp("nColumn=P2"),
33506 /* 112 */ "BitNot" OpHelp("r[P2]= ~r[P1]"),
33507 /* 113 */ "SorterOpen" OpHelp(""),
33508 /* 114 */ "SequenceTest" OpHelp("if( cursor[P1].ctr++ ) pc = P2"),
33509 /* 115 */ "String8" OpHelp("r[P2]='P4'"),
33510 /* 116 */ "OpenPseudo" OpHelp("P3 columns in r[P2]"),
33511 /* 117 */ "Close" OpHelp(""),
33512 /* 118 */ "ColumnsUsed" OpHelp(""),
33513 /* 119 */ "SeekScan" OpHelp("Scan-ahead up to P1 rows"),
33514 /* 120 */ "SeekHit" OpHelp("set P2<=seekHit<=P3"),
33515 /* 121 */ "Sequence" OpHelp("r[P2]=cursor[P1].ctr++"),
@@ -33540,12 +33600,12 @@
33540 /* 146 */ "DropTable" OpHelp(""),
33541 /* 147 */ "DropIndex" OpHelp(""),
33542 /* 148 */ "DropTrigger" OpHelp(""),
33543 /* 149 */ "IntegrityCk" OpHelp(""),
33544 /* 150 */ "RowSetAdd" OpHelp("rowset(P1)=r[P2]"),
33545 /* 151 */ "Real" OpHelp("r[P2]=P4"),
33546 /* 152 */ "Param" OpHelp(""),
33547 /* 153 */ "FkCounter" OpHelp("fkctr[P1]+=P2"),
33548 /* 154 */ "MemMax" OpHelp("r[P1]=max(r[P1],r[P2])"),
33549 /* 155 */ "OffsetLimit" OpHelp("if r[P1]>0 then r[P2]=r[P1]+max(0,r[P3]) else r[P2]=(-1)"),
33550 /* 156 */ "AggInverse" OpHelp("accum=r[P3] inverse(r[P2@P5])"),
33551 /* 157 */ "AggStep" OpHelp("accum=r[P3] step(r[P2@P5])"),
@@ -89814,11 +89874,11 @@
89814 assert( aMem[pOp->p3].flags & MEM_Null );
89815 aMem[pOp->p3].n = 0;
89816 aMem[pOp->p3].z = "";
89817 }
89818 pCx = p->apCsr[pOp->p1];
89819 if( pCx && pCx->pBtx ){
89820 /* If the ephermeral table is already open, erase all existing content
89821 ** so that the table is empty again, rather than creating a new table. */
89822 assert( pCx->isEphemeral );
89823 pCx->seqCount = 0;
89824 pCx->cacheStatus = CACHE_STALE;
@@ -98419,11 +98479,11 @@
98419 ** WRC_Abort or WRC_Continue;
98420 */
98421 SQLITE_PRIVATE int sqlite3WalkSelectFrom(Walker *pWalker, Select *p){
98422 SrcList *pSrc;
98423 int i;
98424 struct SrcList_item *pItem;
98425
98426 pSrc = p->pSrc;
98427 if( pSrc ){
98428 for(i=pSrc->nSrc, pItem=pSrc->a; i>0; i--, pItem++){
98429 if( pItem->pSelect && sqlite3WalkSelect(pWalker, pItem->pSelect) ){
@@ -98760,12 +98820,12 @@
98760 int i, j; /* Loop counters */
98761 int cnt = 0; /* Number of matching column names */
98762 int cntTab = 0; /* Number of matching table names */
98763 int nSubquery = 0; /* How many levels of subquery */
98764 sqlite3 *db = pParse->db; /* The database connection */
98765 struct SrcList_item *pItem; /* Use for looping over pSrcList items */
98766 struct SrcList_item *pMatch = 0; /* The matching pSrcList item */
98767 NameContext *pTopNC = pNC; /* First namecontext in the list */
98768 Schema *pSchema = 0; /* Schema of the expression */
98769 int eNewExprOp = TK_COLUMN; /* New value for pExpr->op on success */
98770 Table *pTab = 0; /* Table hold the row */
98771 Column *pCol; /* A column of pTab */
@@ -99177,11 +99237,11 @@
99177 ** from datasource iSrc in SrcList pSrc.
99178 */
99179 SQLITE_PRIVATE Expr *sqlite3CreateColumnExpr(sqlite3 *db, SrcList *pSrc, int iSrc, int iCol){
99180 Expr *p = sqlite3ExprAlloc(db, TK_COLUMN, 0, 0);
99181 if( p ){
99182 struct SrcList_item *pItem = &pSrc->a[iSrc];
99183 Table *pTab = p->y.pTab = pItem->pTab;
99184 p->iTable = pItem->iCursor;
99185 if( p->y.pTab->iPKey==iCol ){
99186 p->iColumn = -1;
99187 }else{
@@ -99289,11 +99349,11 @@
99289 ** clause processing on UPDATE and DELETE statements, and by
99290 ** UPDATE ... FROM statement processing.
99291 */
99292 case TK_ROW: {
99293 SrcList *pSrcList = pNC->pSrcList;
99294 struct SrcList_item *pItem;
99295 assert( pSrcList && pSrcList->nSrc>=1 );
99296 pItem = pSrcList->a;
99297 pExpr->op = TK_COLUMN;
99298 pExpr->y.pTab = pItem->pTab;
99299 pExpr->iTable = pItem->iCursor;
@@ -100102,11 +100162,11 @@
100102 }
100103
100104 /* Recursively resolve names in all subqueries
100105 */
100106 for(i=0; i<p->pSrc->nSrc; i++){
100107 struct SrcList_item *pItem = &p->pSrc->a[i];
100108 if( pItem->pSelect && (pItem->pSelect->selFlags & SF_Resolved)==0 ){
100109 NameContext *pNC; /* Used to iterate name contexts */
100110 int nRef = 0; /* Refcount for pOuterNC and outer contexts */
100111 const char *zSavedContext = pParse->zAuthContext;
100112
@@ -100172,11 +100232,11 @@
100172 if( sqlite3ResolveExprNames(&sNC, p->pHaving) ) return WRC_Abort;
100173 if( sqlite3ResolveExprNames(&sNC, p->pWhere) ) return WRC_Abort;
100174
100175 /* Resolve names in table-valued-function arguments */
100176 for(i=0; i<p->pSrc->nSrc; i++){
100177 struct SrcList_item *pItem = &p->pSrc->a[i];
100178 if( pItem->fg.isTabFunc
100179 && sqlite3ResolveExprListNames(&sNC, pItem->u1.pFuncArg)
100180 ){
100181 return WRC_Abort;
100182 }
@@ -102016,12 +102076,12 @@
102016 nByte = sizeof(*p) + (p->nSrc>0 ? sizeof(p->a[0]) * (p->nSrc-1) : 0);
102017 pNew = sqlite3DbMallocRawNN(db, nByte );
102018 if( pNew==0 ) return 0;
102019 pNew->nSrc = pNew->nAlloc = p->nSrc;
102020 for(i=0; i<p->nSrc; i++){
102021 struct SrcList_item *pNewItem = &pNew->a[i];
102022 struct SrcList_item *pOldItem = &p->a[i];
102023 Table *pTab;
102024 pNewItem->pSchema = pOldItem->pSchema;
102025 pNewItem->zDatabase = sqlite3DbStrDup(db, pOldItem->zDatabase);
102026 pNewItem->zName = sqlite3DbStrDup(db, pOldItem->zName);
102027 pNewItem->zAlias = sqlite3DbStrDup(db, pOldItem->zAlias);
@@ -102030,11 +102090,14 @@
102030 pNewItem->addrFillSub = pOldItem->addrFillSub;
102031 pNewItem->regReturn = pOldItem->regReturn;
102032 if( pNewItem->fg.isIndexedBy ){
102033 pNewItem->u1.zIndexedBy = sqlite3DbStrDup(db, pOldItem->u1.zIndexedBy);
102034 }
102035 pNewItem->pIBIndex = pOldItem->pIBIndex;
 
 
 
102036 if( pNewItem->fg.isTabFunc ){
102037 pNewItem->u1.pFuncArg =
102038 sqlite3ExprListDup(db, pOldItem->u1.pFuncArg, flags);
102039 }
102040 pTab = pNewItem->pTab = pOldItem->pTab;
@@ -106347,11 +106410,11 @@
106347 testcase( pExpr->op==TK_AGG_COLUMN );
106348 testcase( pExpr->op==TK_COLUMN );
106349 /* Check to see if the column is in one of the tables in the FROM
106350 ** clause of the aggregate query */
106351 if( ALWAYS(pSrcList!=0) ){
106352 struct SrcList_item *pItem = pSrcList->a;
106353 for(i=0; i<pSrcList->nSrc; i++, pItem++){
106354 struct AggInfo_col *pCol;
106355 assert( !ExprHasProperty(pExpr, EP_TokenOnly|EP_Reduced) );
106356 if( pExpr->iTable==pItem->iCursor ){
106357 /* If we reach this point, it means that pExpr refers to a table
@@ -107802,11 +107865,11 @@
107802 if( rc==SQLITE_OK && pStep->zTarget ){
107803 SrcList *pSrc = sqlite3TriggerStepSrc(pParse, pStep);
107804 if( pSrc ){
107805 int i;
107806 for(i=0; i<pSrc->nSrc && rc==SQLITE_OK; i++){
107807 struct SrcList_item *p = &pSrc->a[i];
107808 p->iCursor = pParse->nTab++;
107809 if( p->pSelect ){
107810 sqlite3SelectPrep(pParse, p->pSelect, 0);
107811 sqlite3ExpandSubquery(pParse, p);
107812 assert( i>0 );
@@ -108114,11 +108177,11 @@
108114 if( pSrc==0 ){
108115 assert( pWalker->pParse->db->mallocFailed );
108116 return WRC_Abort;
108117 }
108118 for(i=0; i<pSrc->nSrc; i++){
108119 struct SrcList_item *pItem = &pSrc->a[i];
108120 if( pItem->pTab==p->pTab ){
108121 renameTokenFind(pWalker->pParse, p, pItem->zName);
108122 }
108123 }
108124 renameWalkWith(pWalker, pSelect);
@@ -108364,11 +108427,10 @@
108364 ** Arguments:
108365 **
108366 ** argv[0]: An integer - the index of the schema containing the table
108367 ** argv[1]: CREATE TABLE statement to modify.
108368 ** argv[2]: An integer - the index of the column to remove.
108369 ** argv[3]: Byte offset of first byte after last column definition in argv[1]
108370 **
108371 ** The value returned is a string containing the CREATE TABLE statement
108372 ** with column argv[2] removed.
108373 */
108374 static void dropColumnFunc(
@@ -108378,11 +108440,10 @@
108378 ){
108379 sqlite3 *db = sqlite3_context_db_handle(context);
108380 int iSchema = sqlite3_value_int(argv[0]);
108381 const char *zSql = (const char*)sqlite3_value_text(argv[1]);
108382 int iCol = sqlite3_value_int(argv[2]);
108383 int iAddColOffset = sqlite3_value_int(argv[3]);
108384 const char *zDb = db->aDb[iSchema].zDbSName;
108385 int rc;
108386 Parse sParse;
108387 RenameToken *pCol;
108388 Table *pTab;
@@ -108395,11 +108456,11 @@
108395 #endif
108396
108397 rc = renameParseSql(&sParse, zDb, db, zSql, iSchema==1);
108398 if( rc!=SQLITE_OK ) goto drop_column_done;
108399 pTab = sParse.pNewTable;
108400 if( iCol>=pTab->nCol ){
108401 /* This can happen if the sqlite_schema table is corrupt */
108402 rc = SQLITE_CORRUPT_BKPT;
108403 goto drop_column_done;
108404 }
108405
@@ -108407,11 +108468,11 @@
108407 if( iCol<pTab->nCol-1 ){
108408 RenameToken *pEnd;
108409 pEnd = renameTokenFind(&sParse, 0, (void*)pTab->aCol[iCol+1].zName);
108410 zEnd = (const char*)pEnd->t.z;
108411 }else{
108412 zEnd = (const char*)&zSql[iAddColOffset];
108413 while( ALWAYS(pCol->t.z[0]!=0) && pCol->t.z[0]!=',' ) pCol->t.z--;
108414 }
108415
108416 zNew = sqlite3MPrintf(db, "%.*s%s", pCol->t.z-zSql, zSql, zEnd);
108417 sqlite3_result_text(context, zNew, -1, SQLITE_TRANSIENT);
@@ -108488,13 +108549,13 @@
108488 assert( iDb>=0 );
108489 zDb = db->aDb[iDb].zDbSName;
108490 renameTestSchema(pParse, zDb, iDb==1, "");
108491 sqlite3NestedParse(pParse,
108492 "UPDATE \"%w\"." DFLT_SCHEMA_TABLE " SET "
108493 "sql = sqlite_drop_column(%d, sql, %d, %d) "
108494 "WHERE (type=='table' AND tbl_name=%Q COLLATE nocase)"
108495 , zDb, iDb, iCol, pTab->addColOffset, pTab->zName
108496 );
108497
108498 /* Drop and reload the database schema. */
108499 renameReloadSchema(pParse, iDb, INITFLAG_AlterDrop);
108500 renameTestSchema(pParse, zDb, iDb==1, "after drop column");
@@ -108556,11 +108617,11 @@
108556 SQLITE_PRIVATE void sqlite3AlterFunctions(void){
108557 static FuncDef aAlterTableFuncs[] = {
108558 INTERNAL_FUNCTION(sqlite_rename_column, 9, renameColumnFunc),
108559 INTERNAL_FUNCTION(sqlite_rename_table, 7, renameTableFunc),
108560 INTERNAL_FUNCTION(sqlite_rename_test, 6, renameTableTest),
108561 INTERNAL_FUNCTION(sqlite_drop_column, 4, dropColumnFunc),
108562 };
108563 sqlite3InsertBuiltinFuncs(aAlterTableFuncs, ArraySize(aAlterTableFuncs));
108564 }
108565 #endif /* SQLITE_ALTER_TABLE */
108566
@@ -110968,11 +111029,11 @@
110968 ** Select callback used by sqlite3FixAAAA() routines.
110969 */
110970 static int fixSelectCb(Walker *p, Select *pSelect){
110971 DbFixer *pFix = p->u.pFix;
110972 int i;
110973 struct SrcList_item *pItem;
110974 sqlite3 *db = pFix->pParse->db;
110975 int iDb = sqlite3FindDbName(db, pFix->zDb);
110976 SrcList *pList = pSelect->pSrc;
110977
110978 if( NEVER(pList==0) ) return WRC_Continue;
@@ -111856,11 +111917,11 @@
111856 ** sqlite3FixSrcList() for details.
111857 */
111858 SQLITE_PRIVATE Table *sqlite3LocateTableItem(
111859 Parse *pParse,
111860 u32 flags,
111861 struct SrcList_item *p
111862 ){
111863 const char *zDb;
111864 assert( p->pSchema==0 || p->zDatabase==0 );
111865 if( p->pSchema ){
111866 int iDb = sqlite3SchemaToIndex(pParse->db, p->pSchema);
@@ -114036,24 +114097,21 @@
114036 sqlite3OomFault(db);
114037 return;
114038 }
114039 pParse->pNewTable = 0;
114040 db->mDbFlags |= DBFLAG_SchemaChange;
 
114041
114042 #ifndef SQLITE_OMIT_ALTERTABLE
114043 if( !p->pSelect ){
114044 const char *zName = (const char *)pParse->sNameToken.z;
114045 int nName;
114046 assert( !pSelect && pCons && pEnd );
114047 if( pCons->z==0 ){
114048 pCons = pEnd;
114049 }
114050 nName = (int)((const char *)pCons->z - zName);
114051 p->addColOffset = 13 + nName;
114052 }
114053 #endif
114054 }
114055 }
114056
114057 #ifndef SQLITE_OMIT_VIEW
114058 /*
114059 ** The parser calls this routine in order to create a new VIEW
@@ -115900,11 +115958,11 @@
115900 Parse *pParse, /* Parsing context, in which errors are reported */
115901 SrcList *pList, /* Append to this SrcList. NULL creates a new SrcList */
115902 Token *pTable, /* Table to append */
115903 Token *pDatabase /* Database of the table */
115904 ){
115905 struct SrcList_item *pItem;
115906 sqlite3 *db;
115907 assert( pDatabase==0 || pTable!=0 ); /* Cannot have C without B */
115908 assert( pParse!=0 );
115909 assert( pParse->db!=0 );
115910 db = pParse->db;
@@ -115941,11 +115999,11 @@
115941 /*
115942 ** Assign VdbeCursor index numbers to all tables in a SrcList
115943 */
115944 SQLITE_PRIVATE void sqlite3SrcListAssignCursors(Parse *pParse, SrcList *pList){
115945 int i;
115946 struct SrcList_item *pItem;
115947 assert(pList || pParse->db->mallocFailed );
115948 if( pList ){
115949 for(i=0, pItem=pList->a; i<pList->nSrc; i++, pItem++){
115950 if( pItem->iCursor>=0 ) continue;
115951 pItem->iCursor = pParse->nTab++;
@@ -115959,11 +116017,11 @@
115959 /*
115960 ** Delete an entire SrcList including all its substructure.
115961 */
115962 SQLITE_PRIVATE void sqlite3SrcListDelete(sqlite3 *db, SrcList *pList){
115963 int i;
115964 struct SrcList_item *pItem;
115965 if( pList==0 ) return;
115966 for(pItem=pList->a, i=0; i<pList->nSrc; i++, pItem++){
115967 if( pItem->zDatabase ) sqlite3DbFreeNN(db, pItem->zDatabase);
115968 sqlite3DbFree(db, pItem->zName);
115969 if( pItem->zAlias ) sqlite3DbFreeNN(db, pItem->zAlias);
@@ -116001,11 +116059,11 @@
116001 Token *pAlias, /* The right-hand side of the AS subexpression */
116002 Select *pSubquery, /* A subquery used in place of a table name */
116003 Expr *pOn, /* The ON clause of a join */
116004 IdList *pUsing /* The USING clause of a join */
116005 ){
116006 struct SrcList_item *pItem;
116007 sqlite3 *db = pParse->db;
116008 if( !p && (pOn || pUsing) ){
116009 sqlite3ErrorMsg(pParse, "a JOIN clause is required before %s",
116010 (pOn ? "ON" : "USING")
116011 );
@@ -116045,11 +116103,11 @@
116045 ** element of the source-list passed as the second argument.
116046 */
116047 SQLITE_PRIVATE void sqlite3SrcListIndexedBy(Parse *pParse, SrcList *p, Token *pIndexedBy){
116048 assert( pIndexedBy!=0 );
116049 if( p && pIndexedBy->n>0 ){
116050 struct SrcList_item *pItem;
116051 assert( p->nSrc>0 );
116052 pItem = &p->a[p->nSrc-1];
116053 assert( pItem->fg.notIndexed==0 );
116054 assert( pItem->fg.isIndexedBy==0 );
116055 assert( pItem->fg.isTabFunc==0 );
@@ -116075,11 +116133,11 @@
116075 SrcList *pNew = sqlite3SrcListEnlarge(pParse, p1, p2->nSrc, 1);
116076 if( pNew==0 ){
116077 sqlite3SrcListDelete(pParse->db, p2);
116078 }else{
116079 p1 = pNew;
116080 memcpy(&p1->a[1], p2->a, p2->nSrc*sizeof(struct SrcList_item));
116081 sqlite3DbFree(pParse->db, p2);
116082 }
116083 }
116084 return p1;
116085 }
@@ -116088,11 +116146,11 @@
116088 ** Add the list of function arguments to the SrcList entry for a
116089 ** table-valued-function.
116090 */
116091 SQLITE_PRIVATE void sqlite3SrcListFuncArgs(Parse *pParse, SrcList *p, ExprList *pList){
116092 if( p ){
116093 struct SrcList_item *pItem = &p->a[p->nSrc-1];
116094 assert( pItem->fg.notIndexed==0 );
116095 assert( pItem->fg.isIndexedBy==0 );
116096 assert( pItem->fg.isTabFunc==0 );
116097 pItem->u1.pFuncArg = pList;
116098 pItem->fg.isTabFunc = 1;
@@ -116585,28 +116643,80 @@
116585 }
116586 return pKey;
116587 }
116588
116589 #ifndef SQLITE_OMIT_CTE
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
116590 /*
116591 ** This routine is invoked once per CTE by the parser while parsing a
116592 ** WITH clause.
 
 
116593 */
116594 SQLITE_PRIVATE With *sqlite3WithAdd(
116595 Parse *pParse, /* Parsing context */
116596 With *pWith, /* Existing WITH clause, or NULL */
116597 Token *pName, /* Name of the common-table */
116598 ExprList *pArglist, /* Optional column name list for the table */
116599 Select *pQuery /* Query used to initialize the table */
116600 ){
116601 sqlite3 *db = pParse->db;
116602 With *pNew;
116603 char *zName;
 
 
 
 
116604
116605 /* Check that the CTE name is unique within this WITH clause. If
116606 ** not, store an error in the Parse structure. */
116607 zName = sqlite3NameFromToken(pParse->db, pName);
116608 if( zName && pWith ){
116609 int i;
116610 for(i=0; i<pWith->nCte; i++){
116611 if( sqlite3StrICmp(zName, pWith->a[i].zName)==0 ){
116612 sqlite3ErrorMsg(pParse, "duplicate WITH table name: %s", zName);
@@ -116621,20 +116731,15 @@
116621 pNew = sqlite3DbMallocZero(db, sizeof(*pWith));
116622 }
116623 assert( (pNew!=0 && zName!=0) || db->mallocFailed );
116624
116625 if( db->mallocFailed ){
116626 sqlite3ExprListDelete(db, pArglist);
116627 sqlite3SelectDelete(db, pQuery);
116628 sqlite3DbFree(db, zName);
116629 pNew = pWith;
116630 }else{
116631 pNew->a[pNew->nCte].pSelect = pQuery;
116632 pNew->a[pNew->nCte].pCols = pArglist;
116633 pNew->a[pNew->nCte].zName = zName;
116634 pNew->a[pNew->nCte].zCteErr = 0;
116635 pNew->nCte++;
116636 }
116637
116638 return pNew;
116639 }
116640
@@ -116643,14 +116748,11 @@
116643 */
116644 SQLITE_PRIVATE void sqlite3WithDelete(sqlite3 *db, With *pWith){
116645 if( pWith ){
116646 int i;
116647 for(i=0; i<pWith->nCte; i++){
116648 struct Cte *pCte = &pWith->a[i];
116649 sqlite3ExprListDelete(db, pCte->pCols);
116650 sqlite3SelectDelete(db, pCte->pSelect);
116651 sqlite3DbFree(db, pCte->zName);
116652 }
116653 sqlite3DbFree(db, pWith);
116654 }
116655 }
116656 #endif /* !defined(SQLITE_OMIT_CTE) */
@@ -117225,21 +117327,21 @@
117225 ** pSrc->a[0].pTab Pointer to the Table object
117226 ** pSrc->a[0].pIndex Pointer to the INDEXED BY index, if there is one
117227 **
117228 */
117229 SQLITE_PRIVATE Table *sqlite3SrcListLookup(Parse *pParse, SrcList *pSrc){
117230 struct SrcList_item *pItem = pSrc->a;
117231 Table *pTab;
117232 assert( pItem && pSrc->nSrc>=1 );
117233 pTab = sqlite3LocateTableItem(pParse, 0, pItem);
117234 sqlite3DeleteTable(pParse->db, pItem->pTab);
117235 pItem->pTab = pTab;
117236 if( pTab ){
117237 pTab->nTabRef++;
117238 }
117239 if( sqlite3IndexedByLookup(pParse, pItem) ){
117240 pTab = 0;
117241 }
117242 return pTab;
117243 }
117244
117245 /* Return true if table pTab is read-only.
@@ -117405,11 +117507,15 @@
117405 /* duplicate the FROM clause as it is needed by both the DELETE/UPDATE tree
117406 ** and the SELECT subtree. */
117407 pSrc->a[0].pTab = 0;
117408 pSelectSrc = sqlite3SrcListDup(pParse->db, pSrc, 0);
117409 pSrc->a[0].pTab = pTab;
117410 pSrc->a[0].pIBIndex = 0;
 
 
 
 
117411
117412 /* generate the SELECT expression tree. */
117413 pSelect = sqlite3SelectNew(pParse, pEList, pSelectSrc, pWhere, 0 ,0,
117414 pOrderBy,0,pLimit
117415 );
@@ -121473,11 +121579,11 @@
121473
121474 /* Create a SrcList structure containing the child table. We need the
121475 ** child table as a SrcList for sqlite3WhereBegin() */
121476 pSrc = sqlite3SrcListAppend(pParse, 0, 0, 0);
121477 if( pSrc ){
121478 struct SrcList_item *pItem = pSrc->a;
121479 pItem->pTab = pFKey->pFrom;
121480 pItem->zName = pFKey->pFrom->zName;
121481 pItem->pTab->nTabRef++;
121482 pItem->iCursor = pParse->nTab++;
121483
@@ -124588,11 +124694,11 @@
124588 ){
124589 sqlite3 *db = pParse->db;
124590 ExprList *pEList; /* The result set of the SELECT */
124591 Table *pSrc; /* The table in the FROM clause of SELECT */
124592 Index *pSrcIdx, *pDestIdx; /* Source and destination indices */
124593 struct SrcList_item *pItem; /* An element of pSelect->pSrc */
124594 int i; /* Loop counter */
124595 int iDbSrc; /* The database of pSrc */
124596 int iSrc, iDest; /* Cursors from source and destination */
124597 int addr1, addr2; /* Loop addresses */
124598 int emptyDestTest = 0; /* Address of test for empty pDest */
@@ -130473,11 +130579,11 @@
130473 ** use-after-free errors following an OOM. The preferred way to do this is
130474 ** to immediately follow the call to this routine with:
130475 **
130476 ** testcase( pParse->earlyCleanup );
130477 */
130478 SQLITE_PRIVATE void sqlite3ParserAddCleanup(
130479 Parse *pParse, /* Destroy when this Parser finishes */
130480 void (*xCleanup)(sqlite3*,void*), /* The cleanup routine */
130481 void *pPtr /* Pointer to object to be cleaned up */
130482 ){
130483 ParseCleanup *pCleanup = sqlite3DbMallocRaw(pParse->db, sizeof(*pCleanup));
@@ -130486,14 +130592,16 @@
130486 pParse->pCleanup = pCleanup;
130487 pCleanup->pPtr = pPtr;
130488 pCleanup->xCleanup = xCleanup;
130489 }else{
130490 xCleanup(pParse->db, pPtr);
 
130491 #if defined(SQLITE_DEBUG) || defined(SQLITE_COVERAGE_TEST)
130492 pParse->earlyCleanup = 1;
130493 #endif
130494 }
 
130495 }
130496
130497 /*
130498 ** Compile the UTF-8 encoded SQL statement zSql into a statement handle.
130499 */
@@ -131317,12 +131425,12 @@
131317 ** This routine returns the number of errors encountered.
131318 */
131319 static int sqliteProcessJoin(Parse *pParse, Select *p){
131320 SrcList *pSrc; /* All tables in the FROM clause */
131321 int i, j; /* Loop counters */
131322 struct SrcList_item *pLeft; /* Left table being joined */
131323 struct SrcList_item *pRight; /* Right table being joined */
131324
131325 pSrc = p->pSrc;
131326 pLeft = &pSrc->a[0];
131327 pRight = &pLeft[1];
131328 for(i=0; i<pSrc->nSrc-1; i++, pRight++, pLeft++){
@@ -134479,11 +134587,11 @@
134479 SubstContext *pSubst, /* Description of the substitution */
134480 Select *p, /* SELECT statement in which to make substitutions */
134481 int doPrior /* Do substitutes on p->pPrior too */
134482 ){
134483 SrcList *pSrc;
134484 struct SrcList_item *pItem;
134485 int i;
134486 if( !p ) return;
134487 do{
134488 substExprList(pSubst, p->pEList);
134489 substExprList(pSubst, p->pGroupBy);
@@ -134509,21 +134617,21 @@
134509 **
134510 ** This routine scans the entire SELECT statement and recomputes the
134511 ** pSrcItem->colUsed mask.
134512 */
134513 static int recomputeColumnsUsedExpr(Walker *pWalker, Expr *pExpr){
134514 struct SrcList_item *pItem;
134515 if( pExpr->op!=TK_COLUMN ) return WRC_Continue;
134516 pItem = pWalker->u.pSrcItem;
134517 if( pItem->iCursor!=pExpr->iTable ) return WRC_Continue;
134518 if( pExpr->iColumn<0 ) return WRC_Continue;
134519 pItem->colUsed |= sqlite3ExprColUsed(pExpr);
134520 return WRC_Continue;
134521 }
134522 static void recomputeColumnsUsed(
134523 Select *pSelect, /* The complete SELECT statement */
134524 struct SrcList_item *pSrcItem /* Which FROM clause item to recompute */
134525 ){
134526 Walker w;
134527 if( NEVER(pSrcItem->pTab==0) ) return;
134528 memset(&w, 0, sizeof(w));
134529 w.xExprCallback = recomputeColumnsUsedExpr;
@@ -134553,11 +134661,11 @@
134553 int *aCsrMap, /* Array to store cursor mappings in */
134554 SrcList *pSrc, /* FROM clause to renumber */
134555 int iExcept /* FROM clause item to skip */
134556 ){
134557 int i;
134558 struct SrcList_item *pItem;
134559 for(i=0, pItem=pSrc->a; i<pSrc->nSrc; i++, pItem++){
134560 if( i!=iExcept ){
134561 Select *p;
134562 pItem->iCursor = aCsrMap[pItem->iCursor] = pParse->nTab++;
134563 for(p=pItem->pSelect; p; p=p->pPrior){
@@ -134787,11 +134895,11 @@
134787 int iParent; /* VDBE cursor number of the pSub result set temp table */
134788 int iNewParent = -1;/* Replacement table for iParent */
134789 int isLeftJoin = 0; /* True if pSub is the right side of a LEFT JOIN */
134790 int i; /* Loop counter */
134791 Expr *pWhere; /* The WHERE clause */
134792 struct SrcList_item *pSubitem; /* The subquery */
134793 sqlite3 *db = pParse->db;
134794 Walker w; /* Walker to persist agginfo data */
134795 int *aCsrMap = 0;
134796
134797 /* Check to see if flattening is permitted. Return 0 if not.
@@ -135421,10 +135529,14 @@
135421 ** then the (1,1,NULL) row would be suppressed.
135422 **
135423 ** (6) The inner query features one or more window-functions (since
135424 ** changes to the WHERE clause of the inner query could change the
135425 ** window over which window functions are calculated).
 
 
 
 
135426 **
135427 ** Return 0 if no changes are made and non-zero if one or more WHERE clause
135428 ** terms are duplicated into the subquery.
135429 */
135430 static int pushDownWhereTerms(
@@ -135592,28 +135704,30 @@
135592 ** INDEXED BY clause, then try to locate the specified index. If there
135593 ** was such a clause and the named index cannot be found, return
135594 ** SQLITE_ERROR and leave an error in pParse. Otherwise, populate
135595 ** pFrom->pIndex and return SQLITE_OK.
135596 */
135597 SQLITE_PRIVATE int sqlite3IndexedByLookup(Parse *pParse, struct SrcList_item *pFrom){
135598 if( pFrom->pTab && pFrom->fg.isIndexedBy ){
135599 Table *pTab = pFrom->pTab;
135600 char *zIndexedBy = pFrom->u1.zIndexedBy;
135601 Index *pIdx;
135602 for(pIdx=pTab->pIndex;
135603 pIdx && sqlite3StrICmp(pIdx->zName, zIndexedBy);
135604 pIdx=pIdx->pNext
135605 );
135606 if( !pIdx ){
135607 sqlite3ErrorMsg(pParse, "no such index: %s", zIndexedBy, 0);
135608 pParse->checkSchema = 1;
135609 return SQLITE_ERROR;
135610 }
135611 pFrom->pIBIndex = pIdx;
135612 }
 
135613 return SQLITE_OK;
135614 }
 
135615 /*
135616 ** Detect compound SELECT statements that use an ORDER BY clause with
135617 ** an alternative collating sequence.
135618 **
135619 ** SELECT ... FROM t1 EXCEPT SELECT ... FROM t2 ORDER BY .. COLLATE ...
@@ -135696,11 +135810,11 @@
135696 /*
135697 ** Check to see if the FROM clause term pFrom has table-valued function
135698 ** arguments. If it does, leave an error message in pParse and return
135699 ** non-zero, since pFrom is not allowed to be a table-valued function.
135700 */
135701 static int cannotBeFunction(Parse *pParse, struct SrcList_item *pFrom){
135702 if( pFrom->fg.isTabFunc ){
135703 sqlite3ErrorMsg(pParse, "'%s' is not a function", pFrom->zName);
135704 return 1;
135705 }
135706 return 0;
@@ -135717,23 +135831,23 @@
135717 ** If a non-NULL value is returned, set *ppContext to point to the With
135718 ** object that the returned CTE belongs to.
135719 */
135720 static struct Cte *searchWith(
135721 With *pWith, /* Current innermost WITH clause */
135722 struct SrcList_item *pItem, /* FROM clause element to resolve */
135723 With **ppContext /* OUT: WITH clause return value belongs to */
135724 ){
135725 const char *zName;
135726 if( pItem->zDatabase==0 && (zName = pItem->zName)!=0 ){
135727 With *p;
135728 for(p=pWith; p; p=p->pOuter){
135729 int i;
135730 for(i=0; i<p->nCte; i++){
135731 if( sqlite3StrICmp(zName, p->a[i].zName)==0 ){
135732 *ppContext = p;
135733 return &p->a[i];
135734 }
135735 }
135736 }
135737 }
135738 return 0;
135739 }
@@ -135762,79 +135876,102 @@
135762 }
135763 }
135764
135765 /*
135766 ** This function checks if argument pFrom refers to a CTE declared by
135767 ** a WITH clause on the stack currently maintained by the parser. And,
135768 ** if currently processing a CTE expression, if it is a recursive
135769 ** reference to the current CTE.
135770 **
135771 ** If pFrom falls into either of the two categories above, pFrom->pTab
135772 ** and other fields are populated accordingly. The caller should check
135773 ** (pFrom->pTab!=0) to determine whether or not a successful match
135774 ** was found.
135775 **
135776 ** Whether or not a match is found, SQLITE_OK is returned if no error
135777 ** occurs. If an error does occur, an error message is stored in the
135778 ** parser and some error code other than SQLITE_OK returned.
135779 */
135780 static int withExpand(
135781 Walker *pWalker,
135782 struct SrcList_item *pFrom
135783 ){
135784 Parse *pParse = pWalker->pParse;
135785 sqlite3 *db = pParse->db;
135786 struct Cte *pCte; /* Matched CTE (or NULL if no match) */
135787 With *pWith; /* WITH clause that pCte belongs to */
135788
135789 assert( pFrom->pTab==0 );
135790 if( pParse->nErr ){
135791 return SQLITE_ERROR;
 
135792 }
135793
 
 
 
 
135794 pCte = searchWith(pParse->pWith, pFrom, &pWith);
135795 if( pCte ){
 
135796 Table *pTab;
135797 ExprList *pEList;
135798 Select *pSel;
135799 Select *pLeft; /* Left-most SELECT statement */
135800 Select *pRecTerm; /* Left-most recursive term */
135801 int bMayRecursive; /* True if compound joined by UNION [ALL] */
135802 With *pSavedWith; /* Initial value of pParse->pWith */
135803 int iRecTab = -1; /* Cursor for recursive table */
 
135804
135805 /* If pCte->zCteErr is non-NULL at this point, then this is an illegal
135806 ** recursive reference to CTE pCte. Leave an error in pParse and return
135807 ** early. If pCte->zCteErr is NULL, then this is not a recursive reference.
135808 ** In this case, proceed. */
135809 if( pCte->zCteErr ){
135810 sqlite3ErrorMsg(pParse, pCte->zCteErr, pCte->zName);
135811 return SQLITE_ERROR;
135812 }
135813 if( cannotBeFunction(pParse, pFrom) ) return SQLITE_ERROR;
135814
135815 assert( pFrom->pTab==0 );
135816 pFrom->pTab = pTab = sqlite3DbMallocZero(db, sizeof(Table));
135817 if( pTab==0 ) return WRC_Abort;
 
 
 
 
 
 
 
 
 
 
 
 
135818 pTab->nTabRef = 1;
135819 pTab->zName = sqlite3DbStrDup(db, pCte->zName);
135820 pTab->iPKey = -1;
135821 pTab->nRowLogEst = 200; assert( 200==sqlite3LogEst(1048576) );
135822 pTab->tabFlags |= TF_Ephemeral | TF_NoVisibleRowid;
135823 pFrom->pSelect = sqlite3SelectDup(db, pCte->pSelect, 0);
135824 if( db->mallocFailed ) return SQLITE_NOMEM_BKPT;
135825 assert( pFrom->pSelect );
 
 
 
 
 
 
135826
135827 /* Check if this is a recursive CTE. */
135828 pRecTerm = pSel = pFrom->pSelect;
135829 bMayRecursive = ( pSel->op==TK_ALL || pSel->op==TK_UNION );
135830 while( bMayRecursive && pRecTerm->op==pSel->op ){
135831 int i;
135832 SrcList *pSrc = pRecTerm->pSrc;
135833 assert( pRecTerm->pPrior!=0 );
135834 for(i=0; i<pSrc->nSrc; i++){
135835 struct SrcList_item *pItem = &pSrc->a[i];
135836 if( pItem->zDatabase==0
135837 && pItem->zName!=0
135838 && 0==sqlite3StrICmp(pItem->zName, pCte->zName)
135839 ){
135840 pItem->pTab = pTab;
@@ -135842,11 +135979,11 @@
135842 pItem->fg.isRecursive = 1;
135843 if( pRecTerm->selFlags & SF_Recursive ){
135844 sqlite3ErrorMsg(pParse,
135845 "multiple references to recursive table: %s", pCte->zName
135846 );
135847 return SQLITE_ERROR;
135848 }
135849 pRecTerm->selFlags |= SF_Recursive;
135850 if( iRecTab<0 ) iRecTab = pParse->nTab++;
135851 pItem->iCursor = iRecTab;
135852 }
@@ -135878,11 +136015,11 @@
135878 if( pEList && pEList->nExpr!=pCte->pCols->nExpr ){
135879 sqlite3ErrorMsg(pParse, "table %s has %d values for %d columns",
135880 pCte->zName, pEList->nExpr, pCte->pCols->nExpr
135881 );
135882 pParse->pWith = pSavedWith;
135883 return SQLITE_ERROR;
135884 }
135885 pEList = pCte->pCols;
135886 }
135887
135888 sqlite3ColumnsFromExprList(pParse, pEList, &pTab->nCol, &pTab->aCol);
@@ -135894,13 +136031,13 @@
135894 }
135895 sqlite3WalkSelect(pWalker, pSel);
135896 }
135897 pCte->zCteErr = 0;
135898 pParse->pWith = pSavedWith;
 
135899 }
135900
135901 return SQLITE_OK;
135902 }
135903 #endif
135904
135905 #ifndef SQLITE_OMIT_CTE
135906 /*
@@ -135930,11 +136067,11 @@
135930 ** sub-query in the FROM clause of a SELECT statement. This function
135931 ** allocates and populates the SrcList_item.pTab object. If successful,
135932 ** SQLITE_OK is returned. Otherwise, if an OOM error is encountered,
135933 ** SQLITE_NOMEM.
135934 */
135935 SQLITE_PRIVATE int sqlite3ExpandSubquery(Parse *pParse, struct SrcList_item *pFrom){
135936 Select *pSel = pFrom->pSelect;
135937 Table *pTab;
135938
135939 assert( pSel );
135940 pFrom->pTab = pTab = sqlite3DbMallocZero(pParse->db, sizeof(Table));
@@ -135978,14 +136115,14 @@
135978 ** and TABLE.* to be every column in TABLE.
135979 **
135980 */
135981 static int selectExpander(Walker *pWalker, Select *p){
135982 Parse *pParse = pWalker->pParse;
135983 int i, j, k;
135984 SrcList *pTabList;
135985 ExprList *pEList;
135986 struct SrcList_item *pFrom;
135987 sqlite3 *db = pParse->db;
135988 Expr *pE, *pRight, *pExpr;
135989 u16 selFlags = p->selFlags;
135990 u32 elistFlags = 0;
135991
@@ -136017,23 +136154,25 @@
136017 for(i=0, pFrom=pTabList->a; i<pTabList->nSrc; i++, pFrom++){
136018 Table *pTab;
136019 assert( pFrom->fg.isRecursive==0 || pFrom->pTab!=0 );
136020 if( pFrom->pTab ) continue;
136021 assert( pFrom->fg.isRecursive==0 );
136022 #ifndef SQLITE_OMIT_CTE
136023 if( withExpand(pWalker, pFrom) ) return WRC_Abort;
136024 if( pFrom->pTab ) {} else
136025 #endif
136026 if( pFrom->zName==0 ){
136027 #ifndef SQLITE_OMIT_SUBQUERY
136028 Select *pSel = pFrom->pSelect;
136029 /* A sub-query in the FROM clause of a SELECT */
136030 assert( pSel!=0 );
136031 assert( pFrom->pTab==0 );
136032 if( sqlite3WalkSelect(pWalker, pSel) ) return WRC_Abort;
136033 if( sqlite3ExpandSubquery(pParse, pFrom) ) return WRC_Abort;
136034 #endif
 
 
 
 
 
 
136035 }else{
136036 /* An ordinary table or view name in the FROM clause */
136037 assert( pFrom->pTab==0 );
136038 pFrom->pTab = pTab = sqlite3LocateTableItem(pParse, 0, pFrom);
136039 if( pTab==0 ) return WRC_Abort;
@@ -136077,11 +136216,11 @@
136077 }
136078 #endif
136079 }
136080
136081 /* Locate the index named by the INDEXED BY clause, if any. */
136082 if( sqlite3IndexedByLookup(pParse, pFrom) ){
136083 return WRC_Abort;
136084 }
136085 }
136086
136087 /* Process NATURAL keywords, and ON and USING clauses of joins.
@@ -136320,11 +136459,11 @@
136320 */
136321 static void selectAddSubqueryTypeInfo(Walker *pWalker, Select *p){
136322 Parse *pParse;
136323 int i;
136324 SrcList *pTabList;
136325 struct SrcList_item *pFrom;
136326
136327 assert( p->selFlags & SF_Resolved );
136328 if( p->selFlags & SF_HasTypeInfo ) return;
136329 p->selFlags |= SF_HasTypeInfo;
136330 pParse = pWalker->pParse;
@@ -136644,15 +136783,15 @@
136644 /*
136645 ** Check to see if the pThis entry of pTabList is a self-join of a prior view.
136646 ** If it is, then return the SrcList_item for the prior view. If it is not,
136647 ** then return 0.
136648 */
136649 static struct SrcList_item *isSelfJoinView(
136650 SrcList *pTabList, /* Search for self-joins in this FROM clause */
136651 struct SrcList_item *pThis /* Search for prior reference to this subquery */
136652 ){
136653 struct SrcList_item *pItem;
136654 assert( pThis->pSelect!=0 );
136655 if( pThis->pSelect->selFlags & SF_PushDown ) return 0;
136656 for(pItem = pTabList->a; pItem<pThis; pItem++){
136657 Select *pS1;
136658 if( pItem->pSelect==0 ) continue;
@@ -136852,13 +136991,13 @@
136852 /* If the SF_UpdateFrom flag is set, then this function is being called
136853 ** as part of populating the temp table for an UPDATE...FROM statement.
136854 ** In this case, it is an error if the target object (pSrc->a[0]) name
136855 ** or alias is duplicated within FROM clause (pSrc->a[1..n]). */
136856 if( p->selFlags & SF_UpdateFrom ){
136857 struct SrcList_item *p0 = &p->pSrc->a[0];
136858 for(i=1; i<p->pSrc->nSrc; i++){
136859 struct SrcList_item *p1 = &p->pSrc->a[i];
136860 if( p0->pTab==p1->pTab && 0==sqlite3_stricmp(p0->zAlias, p1->zAlias) ){
136861 sqlite3ErrorMsg(pParse,
136862 "target object/alias may not appear in FROM clause: %s",
136863 p0->zAlias ? p0->zAlias : p0->pTab->zName
136864 );
@@ -136892,11 +137031,11 @@
136892 /* Try to do various optimizations (flattening subqueries, and strength
136893 ** reduction of join operators) in the FROM clause up into the main query
136894 */
136895 #if !defined(SQLITE_OMIT_SUBQUERY) || !defined(SQLITE_OMIT_VIEW)
136896 for(i=0; !p->pPrior && i<pTabList->nSrc; i++){
136897 struct SrcList_item *pItem = &pTabList->a[i];
136898 Select *pSub = pItem->pSelect;
136899 Table *pTab = pItem->pTab;
136900
136901 /* The expander should have already created transient Table objects
136902 ** even for FROM clause elements such as subqueries that do not correspond
@@ -137026,11 +137165,12 @@
137026 /* For each term in the FROM clause, do two things:
137027 ** (1) Authorized unreferenced tables
137028 ** (2) Generate code for all sub-queries
137029 */
137030 for(i=0; i<pTabList->nSrc; i++){
137031 struct SrcList_item *pItem = &pTabList->a[i];
 
137032 SelectDest dest;
137033 Select *pSub;
137034 #if !defined(SQLITE_OMIT_SUBQUERY) || !defined(SQLITE_OMIT_VIEW)
137035 const char *zSavedAuthContext;
137036 #endif
@@ -137086,10 +137226,11 @@
137086
137087 /* Make copies of constant WHERE-clause terms in the outer query down
137088 ** inside the subquery. This can help the subquery to run more efficiently.
137089 */
137090 if( OptimizationEnabled(db, SQLITE_PushDown)
 
137091 && pushDownWhereTerms(pParse, pSub, p->pWhere, pItem->iCursor,
137092 (pItem->fg.jointype & JT_OUTER)!=0)
137093 ){
137094 #if SELECTTRACE_ENABLED
137095 if( sqlite3SelectTrace & 0x100 ){
@@ -137106,20 +137247,22 @@
137106 zSavedAuthContext = pParse->zAuthContext;
137107 pParse->zAuthContext = pItem->zName;
137108
137109 /* Generate code to implement the subquery
137110 **
137111 ** The subquery is implemented as a co-routine if the subquery is
137112 ** guaranteed to be the outer loop (so that it does not need to be
137113 ** computed more than once)
 
137114 **
137115 ** TODO: Are there other reasons beside (1) to use a co-routine
137116 ** implementation?
137117 */
137118 if( i==0
137119 && (pTabList->nSrc==1
137120 || (pTabList->a[1].fg.jointype&(JT_LEFT|JT_CROSS))!=0) /* (1) */
 
137121 ){
137122 /* Implement a co-routine that will return a single row of the result
137123 ** set on each invocation.
137124 */
137125 int addrTop = sqlite3VdbeCurrentAddr(v)+1;
@@ -137135,20 +137278,34 @@
137135 pItem->fg.viaCoroutine = 1;
137136 pItem->regResult = dest.iSdst;
137137 sqlite3VdbeEndCoroutine(v, pItem->regReturn);
137138 sqlite3VdbeJumpHere(v, addrTop-1);
137139 sqlite3ClearTempRegCache(pParse);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
137140 }else{
137141 /* Generate a subroutine that will fill an ephemeral table with
137142 ** the content of this subquery. pItem->addrFillSub will point
137143 ** to the address of the generated subroutine. pItem->regReturn
137144 ** is a register allocated to hold the subroutine return address
137145 */
137146 int topAddr;
137147 int onceAddr = 0;
137148 int retAddr;
137149 struct SrcList_item *pPrior;
137150
137151 testcase( pItem->addrFillSub==0 ); /* Ticket c52b09c7f38903b1311 */
137152 pItem->regReturn = ++pParse->nMem;
137153 topAddr = sqlite3VdbeAddOp2(v, OP_Integer, 0, pItem->regReturn);
137154 pItem->addrFillSub = topAddr+1;
@@ -137159,26 +137316,26 @@
137159 onceAddr = sqlite3VdbeAddOp0(v, OP_Once); VdbeCoverage(v);
137160 VdbeComment((v, "materialize \"%s\"", pItem->pTab->zName));
137161 }else{
137162 VdbeNoopComment((v, "materialize \"%s\"", pItem->pTab->zName));
137163 }
137164 pPrior = isSelfJoinView(pTabList, pItem);
137165 if( pPrior ){
137166 sqlite3VdbeAddOp2(v, OP_OpenDup, pItem->iCursor, pPrior->iCursor);
137167 assert( pPrior->pSelect!=0 );
137168 pSub->nSelectRow = pPrior->pSelect->nSelectRow;
137169 }else{
137170 sqlite3SelectDestInit(&dest, SRT_EphemTab, pItem->iCursor);
137171 ExplainQueryPlan((pParse, 1, "MATERIALIZE %u", pSub->selId));
137172 sqlite3Select(pParse, pSub, &dest);
137173 }
137174 pItem->pTab->nRowLogEst = pSub->nSelectRow;
137175 if( onceAddr ) sqlite3VdbeJumpHere(v, onceAddr);
137176 retAddr = sqlite3VdbeAddOp1(v, OP_Return, pItem->regReturn);
137177 VdbeComment((v, "end %s", pItem->pTab->zName));
137178 sqlite3VdbeChangeP1(v, topAddr, retAddr);
137179 sqlite3ClearTempRegCache(pParse);
 
 
 
 
 
 
 
137180 }
137181 if( db->mallocFailed ) goto select_end;
137182 pParse->nHeight -= sqlite3SelectExprHeight(p);
137183 pParse->zAuthContext = zSavedAuthContext;
137184 #endif
@@ -143432,11 +143589,11 @@
143432 SQLITE_PRIVATE void sqlite3WhereSplit(WhereClause*,Expr*,u8);
143433 SQLITE_PRIVATE Bitmask sqlite3WhereExprUsage(WhereMaskSet*, Expr*);
143434 SQLITE_PRIVATE Bitmask sqlite3WhereExprUsageNN(WhereMaskSet*, Expr*);
143435 SQLITE_PRIVATE Bitmask sqlite3WhereExprListUsage(WhereMaskSet*, ExprList*);
143436 SQLITE_PRIVATE void sqlite3WhereExprAnalyze(SrcList*, WhereClause*);
143437 SQLITE_PRIVATE void sqlite3WhereTabFuncArgs(Parse*, struct SrcList_item*, WhereClause*);
143438
143439
143440
143441
143442
@@ -143610,11 +143767,11 @@
143610 int ret = 0;
143611 #if !defined(SQLITE_DEBUG) && !defined(SQLITE_ENABLE_STMT_SCANSTATUS)
143612 if( sqlite3ParseToplevel(pParse)->explain==2 )
143613 #endif
143614 {
143615 struct SrcList_item *pItem = &pTabList->a[pLevel->iFrom];
143616 Vdbe *v = pParse->pVdbe; /* VM being constructed */
143617 sqlite3 *db = pParse->db; /* Database handle */
143618 int isSearch; /* True for a SEARCH. False for SCAN. */
143619 WhereLoop *pLoop; /* The controlling WhereLoop object */
143620 u32 flags; /* Flags that describe this loop */
@@ -144403,11 +144560,11 @@
144403
144404 /*
144405 ** Insert an OP_CursorHint instruction if it is appropriate to do so.
144406 */
144407 static void codeCursorHint(
144408 struct SrcList_item *pTabItem, /* FROM clause item */
144409 WhereInfo *pWInfo, /* The where clause */
144410 WhereLevel *pLevel, /* Which loop to provide hints for */
144411 WhereTerm *pEndRange /* Hint this end-of-scan boundary term if not NULL */
144412 ){
144413 Parse *pParse = pWInfo->pParse;
@@ -144778,11 +144935,11 @@
144778 int bRev; /* True if we need to scan in reverse order */
144779 WhereLoop *pLoop; /* The WhereLoop object being coded */
144780 WhereClause *pWC; /* Decomposition of the entire WHERE clause */
144781 WhereTerm *pTerm; /* A WHERE clause term */
144782 sqlite3 *db; /* Database connection */
144783 struct SrcList_item *pTabItem; /* FROM clause term being coded */
144784 int addrBrk; /* Jump here to break out of the loop */
144785 int addrHalt; /* addrBrk for the outermost loop */
144786 int addrCont; /* Jump here to continue with next cycle */
144787 int iRowidReg = 0; /* Rowid is stored in this register, if not zero */
144788 int iReleaseReg = 0; /* Temp register to free before returning */
@@ -145566,11 +145723,11 @@
145566 ** by this loop in the a[0] slot and all notReady tables in a[1..] slots.
145567 ** This becomes the SrcList in the recursive call to sqlite3WhereBegin().
145568 */
145569 if( pWInfo->nLevel>1 ){
145570 int nNotReady; /* The number of notReady tables */
145571 struct SrcList_item *origSrc; /* Original list of tables */
145572 nNotReady = pWInfo->nLevel - iLevel - 1;
145573 pOrTab = sqlite3StackAllocRaw(db,
145574 sizeof(*pOrTab)+ nNotReady*sizeof(pOrTab->a[0]));
145575 if( pOrTab==0 ) return notReady;
145576 pOrTab->nAlloc = (u8)(nNotReady + 1);
@@ -147831,11 +147988,11 @@
147831 ** Each function argument translates into an equality constraint against
147832 ** a HIDDEN column in the table.
147833 */
147834 SQLITE_PRIVATE void sqlite3WhereTabFuncArgs(
147835 Parse *pParse, /* Parsing context */
147836 struct SrcList_item *pItem, /* The FROM clause term to process */
147837 WhereClause *pWC /* Xfer function arguments to here */
147838 ){
147839 Table *pTab;
147840 int j, k;
147841 ExprList *pArgs;
@@ -148565,11 +148722,11 @@
148565 ** could be used with an index to access pSrc, assuming an appropriate
148566 ** index existed.
148567 */
148568 static int termCanDriveIndex(
148569 WhereTerm *pTerm, /* WHERE clause term to check */
148570 struct SrcList_item *pSrc, /* Table we are trying to access */
148571 Bitmask notReady /* Tables in outer loops of the join */
148572 ){
148573 char aff;
148574 if( pTerm->leftCursor!=pSrc->iCursor ) return 0;
148575 if( (pTerm->eOperator & (WO_EQ|WO_IS))==0 ) return 0;
@@ -148599,11 +148756,11 @@
148599 ** makes use of the automatic index.
148600 */
148601 static void constructAutomaticIndex(
148602 Parse *pParse, /* The parsing context */
148603 WhereClause *pWC, /* The WHERE clause */
148604 struct SrcList_item *pSrc, /* The FROM clause term to get the next index */
148605 Bitmask notReady, /* Mask of cursors that are not available */
148606 WhereLevel *pLevel /* Write new index here */
148607 ){
148608 int nKeyCol; /* Number of columns in the constructed index */
148609 WhereTerm *pTerm; /* A single term of the WHERE clause */
@@ -148623,11 +148780,11 @@
148623 Bitmask idxCols; /* Bitmap of columns used for indexing */
148624 Bitmask extraCols; /* Bitmap of additional columns */
148625 u8 sentWarning = 0; /* True if a warnning has been issued */
148626 Expr *pPartial = 0; /* Partial Index Expression */
148627 int iContinue = 0; /* Jump here to skip excluded rows */
148628 struct SrcList_item *pTabItem; /* FROM clause term being indexed */
148629 int addrCounter = 0; /* Address where integer counter is initialized */
148630 int regBase; /* Array of registers where record is assembled */
148631
148632 /* Generate code to skip over the creation and initialization of the
148633 ** transient index on 2nd and subsequent iterations of the loop. */
@@ -148807,11 +148964,11 @@
148807 */
148808 static sqlite3_index_info *allocateIndexInfo(
148809 Parse *pParse, /* The parsing context */
148810 WhereClause *pWC, /* The WHERE clause being analyzed */
148811 Bitmask mUnusable, /* Ignore terms with these prereqs */
148812 struct SrcList_item *pSrc, /* The FROM clause term that is the vtab */
148813 ExprList *pOrderBy, /* The ORDER BY clause */
148814 u16 *pmNoOmit /* Mask of terms not to omit */
148815 ){
148816 int i, j;
148817 int nTerm;
@@ -149705,11 +149862,11 @@
149705 ** Print a WhereLoop object for debugging purposes
149706 */
149707 SQLITE_PRIVATE void sqlite3WhereLoopPrint(WhereLoop *p, WhereClause *pWC){
149708 WhereInfo *pWInfo = pWC->pWInfo;
149709 int nb = 1+(pWInfo->pTabList->nSrc+3)/4;
149710 struct SrcList_item *pItem = pWInfo->pTabList->a + p->iTab;
149711 Table *pTab = pItem->pTab;
149712 Bitmask mAll = (((Bitmask)1)<<(nb*4)) - 1;
149713 sqlite3DebugPrintf("%c%2d.%0*llx.%0*llx", p->cId,
149714 p->iTab, nb, p->maskSelf, nb, p->prereq & mAll);
149715 sqlite3DebugPrintf(" %12s",
@@ -150316,11 +150473,11 @@
150316 ** If pProbe->idxType==SQLITE_IDXTYPE_IPK, that means pIndex is
150317 ** a fake index used for the INTEGER PRIMARY KEY.
150318 */
150319 static int whereLoopAddBtreeIndex(
150320 WhereLoopBuilder *pBuilder, /* The WhereLoop factory */
150321 struct SrcList_item *pSrc, /* FROM clause term being analyzed */
150322 Index *pProbe, /* An index on pSrc */
150323 LogEst nInMul /* log(Number of iterations due to IN) */
150324 ){
150325 WhereInfo *pWInfo = pBuilder->pWInfo; /* WHERE analyse context */
150326 Parse *pParse = pWInfo->pParse; /* Parsing context */
@@ -150807,11 +150964,11 @@
150807 Index *pProbe; /* An index we are evaluating */
150808 Index sPk; /* A fake index object for the primary key */
150809 LogEst aiRowEstPk[2]; /* The aiRowLogEst[] value for the sPk index */
150810 i16 aiColumnPk = -1; /* The aColumn[] value for the sPk index */
150811 SrcList *pTabList; /* The FROM clause */
150812 struct SrcList_item *pSrc; /* The FROM clause btree term to add */
150813 WhereLoop *pNew; /* Template WhereLoop object */
150814 int rc = SQLITE_OK; /* Return code */
150815 int iSortIdx = 1; /* Index number */
150816 int b; /* A boolean value */
150817 LogEst rSize; /* number of rows in the table */
@@ -150825,13 +150982,13 @@
150825 pSrc = pTabList->a + pNew->iTab;
150826 pTab = pSrc->pTab;
150827 pWC = pBuilder->pWC;
150828 assert( !IsVirtual(pSrc->pTab) );
150829
150830 if( pSrc->pIBIndex ){
150831 /* An INDEXED BY clause specifies a particular index to use */
150832 pProbe = pSrc->pIBIndex;
150833 }else if( !HasRowid(pTab) ){
150834 pProbe = pTab->pIndex;
150835 }else{
150836 /* There is no INDEXED BY clause. Create a fake Index object in local
150837 ** variable sPk to represent the rowid primary key index. Make this
@@ -150863,11 +151020,11 @@
150863 #ifndef SQLITE_OMIT_AUTOMATIC_INDEX
150864 /* Automatic indexes */
150865 if( !pBuilder->pOrSet /* Not part of an OR optimization */
150866 && (pWInfo->wctrlFlags & WHERE_OR_SUBCLAUSE)==0
150867 && (pWInfo->pParse->db->flags & SQLITE_AutoIndex)!=0
150868 && pSrc->pIBIndex==0 /* Has no INDEXED BY clause */
150869 && !pSrc->fg.notIndexed /* Has no NOT INDEXED clause */
150870 && HasRowid(pTab) /* Not WITHOUT ROWID table. (FIXME: Why not?) */
150871 && !pSrc->fg.isCorrelated /* Not a correlated subquery */
150872 && !pSrc->fg.isRecursive /* Not a recursive common table expression. */
150873 ){
@@ -150913,11 +151070,11 @@
150913 #endif /* SQLITE_OMIT_AUTOMATIC_INDEX */
150914
150915 /* Loop over all indices. If there was an INDEXED BY clause, then only
150916 ** consider index pProbe. */
150917 for(; rc==SQLITE_OK && pProbe;
150918 pProbe=(pSrc->pIBIndex ? 0 : pProbe->pNext), iSortIdx++
150919 ){
150920 int isLeft = (pSrc->fg.jointype & JT_OUTER)!=0;
150921 if( pProbe->pPartIdxWhere!=0
150922 && !whereUsablePartialIndex(pSrc->iCursor, isLeft, pWC,
150923 pProbe->pPartIdxWhere)
@@ -151088,11 +151245,11 @@
151088 int i;
151089 int mxTerm;
151090 int rc = SQLITE_OK;
151091 WhereLoop *pNew = pBuilder->pNew;
151092 Parse *pParse = pBuilder->pWInfo->pParse;
151093 struct SrcList_item *pSrc = &pBuilder->pWInfo->pTabList->a[pNew->iTab];
151094 int nConstraint = pIdxInfo->nConstraint;
151095
151096 assert( (mUsable & mPrereq)==mPrereq );
151097 *pbIn = 0;
151098 pNew->prereq = mPrereq;
@@ -151280,11 +151437,11 @@
151280 ){
151281 int rc = SQLITE_OK; /* Return code */
151282 WhereInfo *pWInfo; /* WHERE analysis context */
151283 Parse *pParse; /* The parsing context */
151284 WhereClause *pWC; /* The WHERE clause */
151285 struct SrcList_item *pSrc; /* The FROM clause term to search */
151286 sqlite3_index_info *p; /* Object to pass to xBestIndex() */
151287 int nConstraint; /* Number of constraints in p */
151288 int bIn; /* True if plan uses IN(...) operator */
151289 WhereLoop *pNew;
151290 Bitmask mBest; /* Tables used by best possible plan */
@@ -151408,11 +151565,11 @@
151408 int rc = SQLITE_OK;
151409 int iCur;
151410 WhereClause tempWC;
151411 WhereLoopBuilder sSubBuild;
151412 WhereOrSet sSum, sCur;
151413 struct SrcList_item *pItem;
151414
151415 pWC = pBuilder->pWC;
151416 pWCEnd = pWC->a + pWC->nTerm;
151417 pNew = pBuilder->pNew;
151418 memset(&sSum, 0, sizeof(sSum));
@@ -151524,12 +151681,12 @@
151524 WhereInfo *pWInfo = pBuilder->pWInfo;
151525 Bitmask mPrereq = 0;
151526 Bitmask mPrior = 0;
151527 int iTab;
151528 SrcList *pTabList = pWInfo->pTabList;
151529 struct SrcList_item *pItem;
151530 struct SrcList_item *pEnd = &pTabList->a[pWInfo->nLevel];
151531 sqlite3 *db = pWInfo->pParse->db;
151532 int rc = SQLITE_OK;
151533 WhereLoop *pNew;
151534
151535 /* Loop over the tables in the join, from left to right */
@@ -151548,11 +151705,11 @@
151548 }else{
151549 mPrereq = 0;
151550 }
151551 #ifndef SQLITE_OMIT_VIRTUALTABLE
151552 if( IsVirtual(pItem->pTab) ){
151553 struct SrcList_item *p;
151554 for(p=&pItem[1]; p<pEnd; p++){
151555 if( mUnusable || (p->fg.jointype & (JT_LEFT|JT_CROSS)) ){
151556 mUnusable |= sqlite3WhereGetMask(&pWInfo->sMaskSet, p->iCursor);
151557 }
151558 }
@@ -152403,11 +152560,11 @@
152403 ** no-frills query planner. Return zero if this query needs the
152404 ** general-purpose query planner.
152405 */
152406 static int whereShortCut(WhereLoopBuilder *pBuilder){
152407 WhereInfo *pWInfo;
152408 struct SrcList_item *pItem;
152409 WhereClause *pWC;
152410 WhereTerm *pTerm;
152411 WhereLoop *pLoop;
152412 int iCur;
152413 int j;
@@ -152933,11 +153090,11 @@
152933 if( sWLB.pOrderBy ){
152934 tabUsed |= sqlite3WhereExprListUsage(pMaskSet, sWLB.pOrderBy);
152935 }
152936 for(i=pWInfo->nLevel-1; i>=1; i--){
152937 WhereTerm *pTerm, *pEnd;
152938 struct SrcList_item *pItem;
152939 pLoop = pWInfo->a[i].pWLoop;
152940 pItem = &pWInfo->pTabList->a[pLoop->iTab];
152941 if( (pItem->fg.jointype & JT_LEFT)==0 ) continue;
152942 if( (wctrlFlags & WHERE_WANT_DISTINCT)==0
152943 && (pLoop->wsFlags & WHERE_ONEROW)==0
@@ -153023,11 +153180,11 @@
153023 ** searching those tables.
153024 */
153025 for(ii=0, pLevel=pWInfo->a; ii<nTabList; ii++, pLevel++){
153026 Table *pTab; /* Table to open */
153027 int iDb; /* Index of database containing table/index */
153028 struct SrcList_item *pTabItem;
153029
153030 pTabItem = &pTabList->a[pLevel->iFrom];
153031 pTab = pTabItem->pTab;
153032 iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
153033 pLoop = pLevel->pWLoop;
@@ -153360,11 +153517,11 @@
153360 assert( pWInfo->nLevel<=pTabList->nSrc );
153361 for(i=0, pLevel=pWInfo->a; i<pWInfo->nLevel; i++, pLevel++){
153362 int k, last;
153363 VdbeOp *pOp, *pLastOp;
153364 Index *pIdx = 0;
153365 struct SrcList_item *pTabItem = &pTabList->a[pLevel->iFrom];
153366 Table *pTab = pTabItem->pTab;
153367 assert( pTab!=0 );
153368 pLoop = pLevel->pWLoop;
153369
153370 /* For a co-routine, change all OP_Column references to the table of
@@ -156672,10 +156829,23 @@
156672 sqlite3ErrorMsg(pParse, "too many terms in compound SELECT");
156673 }
156674 }
156675 }
156676
 
 
 
 
 
 
 
 
 
 
 
 
 
156677
156678 /* Construct a new Expr object from a single identifier. Use the
156679 ** new Expr to populate pOut. Set the span of pOut to be the identifier
156680 ** that created the expression.
156681 */
@@ -156847,95 +157017,96 @@
156847 #define TK_GROUPS 92
156848 #define TK_OTHERS 93
156849 #define TK_TIES 94
156850 #define TK_GENERATED 95
156851 #define TK_ALWAYS 96
156852 #define TK_REINDEX 97
156853 #define TK_RENAME 98
156854 #define TK_CTIME_KW 99
156855 #define TK_ANY 100
156856 #define TK_BITAND 101
156857 #define TK_BITOR 102
156858 #define TK_LSHIFT 103
156859 #define TK_RSHIFT 104
156860 #define TK_PLUS 105
156861 #define TK_MINUS 106
156862 #define TK_STAR 107
156863 #define TK_SLASH 108
156864 #define TK_REM 109
156865 #define TK_CONCAT 110
156866 #define TK_COLLATE 111
156867 #define TK_BITNOT 112
156868 #define TK_ON 113
156869 #define TK_INDEXED 114
156870 #define TK_STRING 115
156871 #define TK_JOIN_KW 116
156872 #define TK_CONSTRAINT 117
156873 #define TK_DEFAULT 118
156874 #define TK_NULL 119
156875 #define TK_PRIMARY 120
156876 #define TK_UNIQUE 121
156877 #define TK_CHECK 122
156878 #define TK_REFERENCES 123
156879 #define TK_AUTOINCR 124
156880 #define TK_INSERT 125
156881 #define TK_DELETE 126
156882 #define TK_UPDATE 127
156883 #define TK_SET 128
156884 #define TK_DEFERRABLE 129
156885 #define TK_FOREIGN 130
156886 #define TK_DROP 131
156887 #define TK_UNION 132
156888 #define TK_ALL 133
156889 #define TK_EXCEPT 134
156890 #define TK_INTERSECT 135
156891 #define TK_SELECT 136
156892 #define TK_VALUES 137
156893 #define TK_DISTINCT 138
156894 #define TK_DOT 139
156895 #define TK_FROM 140
156896 #define TK_JOIN 141
156897 #define TK_USING 142
156898 #define TK_ORDER 143
156899 #define TK_GROUP 144
156900 #define TK_HAVING 145
156901 #define TK_LIMIT 146
156902 #define TK_WHERE 147
156903 #define TK_RETURNING 148
156904 #define TK_INTO 149
156905 #define TK_NOTHING 150
156906 #define TK_FLOAT 151
156907 #define TK_BLOB 152
156908 #define TK_INTEGER 153
156909 #define TK_VARIABLE 154
156910 #define TK_CASE 155
156911 #define TK_WHEN 156
156912 #define TK_THEN 157
156913 #define TK_ELSE 158
156914 #define TK_INDEX 159
156915 #define TK_ALTER 160
156916 #define TK_ADD 161
156917 #define TK_WINDOW 162
156918 #define TK_OVER 163
156919 #define TK_FILTER 164
156920 #define TK_COLUMN 165
156921 #define TK_AGG_FUNCTION 166
156922 #define TK_AGG_COLUMN 167
156923 #define TK_TRUEFALSE 168
156924 #define TK_ISNOT 169
156925 #define TK_FUNCTION 170
156926 #define TK_UMINUS 171
156927 #define TK_UPLUS 172
156928 #define TK_TRUTH 173
156929 #define TK_REGISTER 174
156930 #define TK_VECTOR 175
156931 #define TK_SELECT_COLUMN 176
156932 #define TK_IF_NULL_ROW 177
156933 #define TK_ASTERISK 178
156934 #define TK_SPAN 179
156935 #define TK_SPACE 180
156936 #define TK_ILLEGAL 181
 
156937 #endif
156938 /**************** End token definitions ***************************************/
156939
156940 /* The next sections is a series of control #defines.
156941 ** various aspects of the generated parser.
@@ -156991,32 +157162,33 @@
156991 #ifndef INTERFACE
156992 # define INTERFACE 1
156993 #endif
156994 /************* Begin control #defines *****************************************/
156995 #define YYCODETYPE unsigned short int
156996 #define YYNOCODE 313
156997 #define YYACTIONTYPE unsigned short int
156998 #define YYWILDCARD 100
156999 #define sqlite3ParserTOKENTYPE Token
157000 typedef union {
157001 int yyinit;
157002 sqlite3ParserTOKENTYPE yy0;
157003 Upsert* yy40;
157004 TriggerStep* yy51;
157005 With* yy105;
157006 Select* yy293;
157007 struct TrigEvent yy298;
157008 struct FrameBound yy341;
157009 ExprList* yy350;
157010 Expr* yy354;
157011 int yy412;
157012 SrcList* yy457;
157013 struct {int value; int mask;} yy463;
157014 IdList* yy498;
157015 Window* yy503;
157016 const char* yy504;
157017 u8 yy624;
 
157018 } YYMINORTYPE;
157019 #ifndef YYSTACKDEPTH
157020 #define YYSTACKDEPTH 100
157021 #endif
157022 #define sqlite3ParserARG_SDECL
@@ -157028,22 +157200,22 @@
157028 #define sqlite3ParserCTX_PDECL ,Parse *pParse
157029 #define sqlite3ParserCTX_PARAM ,pParse
157030 #define sqlite3ParserCTX_FETCH Parse *pParse=yypParser->pParse;
157031 #define sqlite3ParserCTX_STORE yypParser->pParse=pParse;
157032 #define YYFALLBACK 1
157033 #define YYNSTATE 573
157034 #define YYNRULE 394
157035 #define YYNRULE_WITH_ACTION 333
157036 #define YYNTOKEN 182
157037 #define YY_MAX_SHIFT 572
157038 #define YY_MIN_SHIFTREDUCE 825
157039 #define YY_MAX_SHIFTREDUCE 1218
157040 #define YY_ERROR_ACTION 1219
157041 #define YY_ACCEPT_ACTION 1220
157042 #define YY_NO_ACTION 1221
157043 #define YY_MIN_REDUCE 1222
157044 #define YY_MAX_REDUCE 1615
157045 /************* End control #defines *******************************************/
157046 #define YY_NLOOKAHEAD ((int)(sizeof(yy_lookahead)/sizeof(yy_lookahead[0])))
157047
157048 /* Define the yytestcase() macro to be a no-op if is not already defined
157049 ** otherwise.
@@ -157106,605 +157278,604 @@
157106 ** yy_reduce_ofst[] For each state, the offset into yy_action for
157107 ** shifting non-terminals after a reduce.
157108 ** yy_default[] Default action for each state.
157109 **
157110 *********** Begin parsing tables **********************************************/
157111 #define YY_ACTTAB_COUNT (2017)
157112 static const YYACTIONTYPE yy_action[] = {
157113 /* 0 */ 566, 1253, 566, 197, 1576, 566, 1256, 566, 116, 113,
157114 /* 10 */ 218, 566, 1263, 566, 488, 395, 116, 113, 218, 407,
157115 /* 20 */ 359, 359, 42, 42, 42, 42, 471, 42, 42, 72,
157116 /* 30 */ 72, 959, 1255, 72, 72, 72, 72, 1500, 1581, 960,
157117 /* 40 */ 9, 889, 252, 123, 124, 114, 1196, 1196, 1035, 1038,
157118 /* 50 */ 1028, 1028, 121, 121, 122, 122, 122, 122, 415, 407,
157119 /* 60 */ 473, 1556, 572, 2, 1224, 1582, 548, 145, 147, 306,
157120 /* 70 */ 548, 138, 548, 1296, 1296, 524, 566, 1193, 1304, 547,
157121 /* 80 */ 523, 513, 167, 123, 124, 114, 1196, 1196, 1035, 1038,
157122 /* 90 */ 1028, 1028, 121, 121, 122, 122, 122, 122, 72, 72,
157123 /* 100 */ 282, 120, 120, 120, 120, 119, 119, 118, 118, 118,
157124 /* 110 */ 117, 441, 274, 274, 274, 274, 446, 1172, 1537, 373,
157125 /* 120 */ 1539, 1172, 372, 1537, 537, 563, 1144, 563, 1144, 407,
157126 /* 130 */ 1078, 249, 215, 1193, 174, 529, 100, 305, 557, 229,
157127 /* 140 */ 441, 120, 120, 120, 120, 119, 119, 118, 118, 118,
157128 /* 150 */ 117, 441, 450, 123, 124, 114, 1196, 1196, 1035, 1038,
157129 /* 160 */ 1028, 1028, 121, 121, 122, 122, 122, 122, 543, 450,
157130 /* 170 */ 449, 445, 1172, 1173, 1174, 397, 1172, 1173, 1174, 125,
157131 /* 180 */ 120, 120, 120, 120, 119, 119, 118, 118, 118, 117,
157132 /* 190 */ 441, 119, 119, 118, 118, 118, 117, 441, 269, 407,
157133 /* 200 */ 1553, 122, 122, 122, 122, 115, 381, 84, 377, 274,
157134 /* 210 */ 274, 120, 120, 120, 120, 119, 119, 118, 118, 118,
157135 /* 220 */ 117, 441, 563, 123, 124, 114, 1196, 1196, 1035, 1038,
157136 /* 230 */ 1028, 1028, 121, 121, 122, 122, 122, 122, 407, 469,
157137 /* 240 */ 1122, 1609, 450, 82, 1609, 462, 331, 81, 120, 120,
157138 /* 250 */ 120, 120, 119, 119, 118, 118, 118, 117, 441, 116,
157139 /* 260 */ 113, 218, 123, 124, 114, 1196, 1196, 1035, 1038, 1028,
157140 /* 270 */ 1028, 121, 121, 122, 122, 122, 122, 566, 544, 1524,
157141 /* 280 */ 880, 120, 120, 120, 120, 119, 119, 118, 118, 118,
157142 /* 290 */ 117, 441, 118, 118, 118, 117, 441, 12, 197, 71,
157143 /* 300 */ 71, 1139, 122, 122, 122, 122, 386, 407, 431, 1172,
157144 /* 310 */ 400, 505, 533, 349, 1139, 166, 314, 1139, 1120, 881,
157145 /* 320 */ 120, 120, 120, 120, 119, 119, 118, 118, 118, 117,
157146 /* 330 */ 441, 123, 124, 114, 1196, 1196, 1035, 1038, 1028, 1028,
157147 /* 340 */ 121, 121, 122, 122, 122, 122, 1172, 268, 268, 120,
157148 /* 350 */ 120, 120, 120, 119, 119, 118, 118, 118, 117, 441,
157149 /* 360 */ 563, 380, 1015, 1139, 1172, 1173, 1174, 241, 532, 565,
157150 /* 370 */ 501, 498, 497, 429, 540, 478, 1139, 1532, 1006, 1139,
157151 /* 380 */ 496, 6, 1005, 1396, 504, 1025, 1025, 1036, 1039, 120,
157152 /* 390 */ 120, 120, 120, 119, 119, 118, 118, 118, 117, 441,
157153 /* 400 */ 428, 1172, 1173, 1174, 1099, 1464, 260, 277, 357, 507,
157154 /* 410 */ 352, 506, 246, 407, 1005, 1005, 1007, 345, 348, 1100,
157155 /* 420 */ 241, 462, 331, 501, 498, 497, 371, 512, 1531, 359,
157156 /* 430 */ 531, 360, 6, 496, 1101, 452, 203, 123, 124, 114,
157157 /* 440 */ 1196, 1196, 1035, 1038, 1028, 1028, 121, 121, 122, 122,
157158 /* 450 */ 122, 122, 522, 422, 1172, 900, 407, 571, 1029, 1224,
157159 /* 460 */ 502, 321, 1274, 995, 306, 901, 138, 188, 1291, 426,
157160 /* 470 */ 1270, 167, 488, 1304, 16, 16, 144, 860, 1291, 1273,
157161 /* 480 */ 123, 124, 114, 1196, 1196, 1035, 1038, 1028, 1028, 121,
157162 /* 490 */ 121, 122, 122, 122, 122, 120, 120, 120, 120, 119,
157163 /* 500 */ 119, 118, 118, 118, 117, 441, 528, 274, 274, 1172,
157164 /* 510 */ 1173, 1174, 1396, 566, 166, 329, 1499, 1015, 417, 374,
157165 /* 520 */ 563, 488, 318, 1172, 320, 407, 305, 557, 375, 864,
157166 /* 530 */ 182, 216, 860, 1006, 229, 72, 72, 1005, 120, 120,
157167 /* 540 */ 120, 120, 119, 119, 118, 118, 118, 117, 441, 123,
157168 /* 550 */ 124, 114, 1196, 1196, 1035, 1038, 1028, 1028, 121, 121,
157169 /* 560 */ 122, 122, 122, 122, 407, 1463, 445, 1172, 857, 1005,
157170 /* 570 */ 1005, 1007, 301, 1529, 116, 113, 218, 6, 1172, 1173,
157171 /* 580 */ 1174, 183, 423, 116, 113, 218, 1172, 316, 123, 124,
157172 /* 590 */ 114, 1196, 1196, 1035, 1038, 1028, 1028, 121, 121, 122,
157173 /* 600 */ 122, 122, 122, 1469, 319, 946, 471, 120, 120, 120,
157174 /* 610 */ 120, 119, 119, 118, 118, 118, 117, 441, 1172, 211,
157175 /* 620 */ 1469, 1471, 1172, 1173, 1174, 920, 541, 1531, 477, 1172,
157176 /* 630 */ 919, 6, 1172, 407, 925, 438, 437, 1157, 213, 511,
157177 /* 640 */ 32, 1172, 1173, 1174, 280, 5, 120, 120, 120, 120,
157178 /* 650 */ 119, 119, 118, 118, 118, 117, 441, 123, 124, 114,
157179 /* 660 */ 1196, 1196, 1035, 1038, 1028, 1028, 121, 121, 122, 122,
157180 /* 670 */ 122, 122, 407, 1172, 1173, 1174, 1016, 1172, 274, 274,
157181 /* 680 */ 287, 1203, 1172, 1203, 1172, 1173, 1174, 1172, 1173, 1174,
157182 /* 690 */ 566, 563, 167, 1469, 117, 441, 123, 124, 114, 1196,
157183 /* 700 */ 1196, 1035, 1038, 1028, 1028, 121, 121, 122, 122, 122,
157184 /* 710 */ 122, 945, 13, 13, 127, 120, 120, 120, 120, 119,
157185 /* 720 */ 119, 118, 118, 118, 117, 441, 286, 420, 566, 451,
157186 /* 730 */ 566, 1396, 1172, 1173, 1174, 1294, 1294, 1172, 1173, 1174,
157187 /* 740 */ 97, 407, 995, 1611, 393, 1000, 488, 305, 557, 17,
157188 /* 750 */ 72, 72, 72, 72, 120, 120, 120, 120, 119, 119,
157189 /* 760 */ 118, 118, 118, 117, 441, 123, 124, 114, 1196, 1196,
157190 /* 770 */ 1035, 1038, 1028, 1028, 121, 121, 122, 122, 122, 122,
157191 /* 780 */ 407, 1220, 1, 1, 572, 2, 1224, 302, 418, 436,
157192 /* 790 */ 1303, 306, 842, 138, 329, 457, 317, 404, 403, 566,
157193 /* 800 */ 1304, 424, 3, 291, 123, 124, 114, 1196, 1196, 1035,
157194 /* 810 */ 1038, 1028, 1028, 121, 121, 122, 122, 122, 122, 379,
157195 /* 820 */ 566, 13, 13, 120, 120, 120, 120, 119, 119, 118,
157196 /* 830 */ 118, 118, 117, 441, 274, 274, 425, 274, 274, 1172,
157197 /* 840 */ 1308, 359, 13, 13, 1122, 1610, 12, 563, 1610, 407,
157198 /* 850 */ 563, 460, 563, 1172, 560, 560, 560, 427, 439, 439,
157199 /* 860 */ 439, 229, 120, 120, 120, 120, 119, 119, 118, 118,
157200 /* 870 */ 118, 117, 441, 123, 124, 114, 1196, 1196, 1035, 1038,
157201 /* 880 */ 1028, 1028, 121, 121, 122, 122, 122, 122, 146, 197,
157202 /* 890 */ 417, 566, 1058, 445, 1172, 1173, 1174, 417, 471, 438,
157203 /* 900 */ 437, 406, 564, 248, 914, 914, 566, 1200, 1172, 1173,
157204 /* 910 */ 1174, 488, 1202, 72, 72, 493, 1510, 549, 102, 194,
157205 /* 920 */ 1201, 566, 1120, 295, 461, 295, 1302, 252, 72, 72,
157206 /* 930 */ 1456, 120, 120, 120, 120, 119, 119, 118, 118, 118,
157207 /* 940 */ 117, 441, 245, 56, 56, 1203, 566, 1203, 566, 1242,
157208 /* 950 */ 440, 274, 274, 566, 516, 1299, 566, 514, 566, 283,
157209 /* 960 */ 274, 274, 1193, 519, 563, 548, 285, 343, 52, 52,
157210 /* 970 */ 13, 13, 290, 563, 550, 13, 13, 566, 13, 13,
157211 /* 980 */ 13, 13, 551, 274, 274, 294, 1411, 105, 274, 274,
157212 /* 990 */ 191, 274, 274, 192, 1512, 545, 563, 274, 274, 57,
157213 /* 1000 */ 57, 563, 275, 275, 563, 515, 447, 407, 271, 412,
157214 /* 1010 */ 563, 944, 198, 305, 557, 563, 274, 274, 1193, 106,
157215 /* 1020 */ 411, 104, 358, 1550, 1508, 348, 566, 407, 338, 563,
157216 /* 1030 */ 341, 123, 124, 114, 1196, 1196, 1035, 1038, 1028, 1028,
157217 /* 1040 */ 121, 121, 122, 122, 122, 122, 471, 407, 15, 15,
157218 /* 1050 */ 477, 123, 124, 114, 1196, 1196, 1035, 1038, 1028, 1028,
157219 /* 1060 */ 121, 121, 122, 122, 122, 122, 1083, 1083, 485, 360,
157220 /* 1070 */ 477, 123, 112, 114, 1196, 1196, 1035, 1038, 1028, 1028,
157221 /* 1080 */ 121, 121, 122, 122, 122, 122, 392, 1216, 309, 120,
157222 /* 1090 */ 120, 120, 120, 119, 119, 118, 118, 118, 117, 441,
157223 /* 1100 */ 99, 217, 482, 1176, 1410, 566, 479, 433, 543, 120,
157224 /* 1110 */ 120, 120, 120, 119, 119, 118, 118, 118, 117, 441,
157225 /* 1120 */ 292, 1080, 566, 1396, 566, 1080, 944, 44, 44, 120,
157226 /* 1130 */ 120, 120, 120, 119, 119, 118, 118, 118, 117, 441,
157227 /* 1140 */ 358, 1550, 539, 1099, 58, 58, 45, 45, 328, 407,
157228 /* 1150 */ 1139, 830, 831, 832, 244, 243, 242, 483, 1100, 1176,
157229 /* 1160 */ 1396, 538, 310, 1139, 1217, 488, 1139, 566, 293, 407,
157230 /* 1170 */ 1150, 1245, 413, 1101, 124, 114, 1196, 1196, 1035, 1038,
157231 /* 1180 */ 1028, 1028, 121, 121, 122, 122, 122, 122, 566, 59,
157232 /* 1190 */ 59, 566, 509, 484, 554, 114, 1196, 1196, 1035, 1038,
157233 /* 1200 */ 1028, 1028, 121, 121, 122, 122, 122, 122, 1530, 336,
157234 /* 1210 */ 60, 60, 6, 61, 61, 392, 1121, 1528, 920, 1525,
157235 /* 1220 */ 1150, 6, 566, 919, 566, 109, 558, 566, 4, 944,
157236 /* 1230 */ 434, 120, 120, 120, 120, 119, 119, 118, 118, 118,
157237 /* 1240 */ 117, 441, 561, 867, 62, 62, 63, 63, 566, 46,
157238 /* 1250 */ 46, 120, 120, 120, 120, 119, 119, 118, 118, 118,
157239 /* 1260 */ 117, 441, 566, 1139, 1527, 442, 1327, 566, 6, 566,
157240 /* 1270 */ 47, 47, 566, 559, 413, 1272, 1139, 555, 142, 1139,
157241 /* 1280 */ 566, 467, 305, 557, 48, 48, 566, 167, 546, 50,
157242 /* 1290 */ 50, 51, 51, 1217, 64, 64, 959, 109, 558, 867,
157243 /* 1300 */ 4, 566, 65, 65, 960, 1015, 566, 140, 66, 66,
157244 /* 1310 */ 566, 107, 107, 566, 561, 852, 205, 566, 108, 217,
157245 /* 1320 */ 442, 568, 567, 14, 14, 1005, 8, 525, 67, 67,
157246 /* 1330 */ 566, 454, 129, 129, 222, 68, 68, 442, 455, 53,
157247 /* 1340 */ 53, 405, 305, 557, 944, 414, 168, 211, 405, 555,
157248 /* 1350 */ 111, 1192, 69, 69, 99, 464, 245, 1005, 1005, 1007,
157249 /* 1360 */ 1008, 27, 468, 535, 566, 405, 566, 313, 534, 273,
157250 /* 1370 */ 215, 852, 405, 566, 85, 202, 566, 1015, 566, 1211,
157251 /* 1380 */ 566, 304, 566, 107, 107, 566, 70, 70, 54, 54,
157252 /* 1390 */ 108, 405, 442, 568, 567, 153, 153, 1005, 154, 154,
157253 /* 1400 */ 77, 77, 55, 55, 73, 73, 1117, 130, 130, 394,
157254 /* 1410 */ 109, 558, 143, 4, 38, 566, 475, 300, 566, 463,
157255 /* 1420 */ 279, 1340, 526, 412, 30, 226, 1077, 561, 1077, 1005,
157256 /* 1430 */ 1005, 1007, 1008, 27, 1555, 1161, 444, 74, 74, 278,
157257 /* 1440 */ 131, 131, 326, 1339, 390, 390, 389, 263, 387, 566,
157258 /* 1450 */ 442, 839, 871, 308, 465, 31, 566, 879, 878, 356,
157259 /* 1460 */ 327, 206, 555, 99, 223, 206, 312, 546, 1544, 355,
157260 /* 1470 */ 997, 132, 132, 251, 311, 456, 535, 288, 128, 128,
157261 /* 1480 */ 1065, 536, 109, 558, 470, 4, 566, 251, 1515, 472,
157262 /* 1490 */ 1015, 566, 251, 276, 566, 332, 107, 107, 99, 561,
157263 /* 1500 */ 1076, 566, 1076, 108, 225, 442, 568, 567, 152, 152,
157264 /* 1510 */ 1005, 476, 158, 151, 151, 160, 136, 136, 494, 886,
157265 /* 1520 */ 887, 247, 442, 135, 135, 346, 322, 566, 99, 1061,
157266 /* 1530 */ 489, 224, 247, 566, 555, 1488, 1065, 1487, 953, 1009,
157267 /* 1540 */ 228, 251, 1005, 1005, 1007, 1008, 27, 480, 535, 133,
157268 /* 1550 */ 133, 566, 333, 534, 1336, 134, 134, 962, 963, 337,
157269 /* 1560 */ 917, 340, 1015, 111, 850, 408, 342, 141, 107, 107,
157270 /* 1570 */ 305, 557, 344, 76, 76, 108, 566, 442, 568, 567,
157271 /* 1580 */ 1161, 444, 1005, 566, 278, 109, 558, 553, 4, 390,
157272 /* 1590 */ 390, 389, 263, 387, 448, 1009, 839, 918, 78, 78,
157273 /* 1600 */ 111, 566, 561, 1287, 566, 75, 75, 1271, 1334, 223,
157274 /* 1610 */ 1569, 312, 351, 361, 1005, 1005, 1007, 1008, 27, 311,
157275 /* 1620 */ 362, 1348, 1395, 43, 43, 442, 49, 49, 1323, 552,
157276 /* 1630 */ 1401, 1252, 1244, 1233, 1232, 1234, 1563, 555, 200, 266,
157277 /* 1640 */ 1320, 391, 11, 364, 221, 366, 368, 1382, 1377, 225,
157278 /* 1650 */ 281, 453, 324, 330, 284, 1387, 474, 158, 208, 370,
157279 /* 1660 */ 160, 1370, 325, 556, 195, 1015, 289, 499, 384, 354,
157280 /* 1670 */ 1270, 107, 107, 924, 1386, 398, 224, 212, 108, 1460,
157281 /* 1680 */ 442, 568, 567, 1459, 1566, 1005, 1211, 255, 1208, 1507,
157282 /* 1690 */ 1505, 109, 558, 416, 4, 196, 207, 204, 170, 219,
157283 /* 1700 */ 80, 84, 180, 1383, 1465, 83, 164, 172, 561, 458,
157284 /* 1710 */ 408, 175, 176, 459, 177, 305, 557, 1005, 1005, 1007,
157285 /* 1720 */ 1008, 27, 35, 178, 492, 231, 396, 97, 1389, 466,
157286 /* 1730 */ 1388, 442, 481, 36, 1391, 184, 399, 90, 235, 448,
157287 /* 1740 */ 1454, 1476, 267, 555, 487, 189, 237, 490, 339, 238,
157288 /* 1750 */ 335, 1235, 239, 401, 508, 1281, 430, 1290, 1289, 101,
157289 /* 1760 */ 558, 1288, 4, 92, 871, 213, 1580, 432, 1331, 527,
157290 /* 1770 */ 96, 1015, 1260, 353, 402, 1579, 561, 107, 107, 1259,
157291 /* 1780 */ 363, 1258, 1578, 1280, 108, 298, 442, 568, 567, 1549,
157292 /* 1790 */ 518, 1005, 299, 521, 253, 1332, 365, 1535, 254, 442,
157293 /* 1800 */ 1534, 435, 546, 10, 126, 378, 1440, 103, 530, 303,
157294 /* 1810 */ 98, 555, 261, 1241, 34, 569, 199, 1313, 1330, 1329,
157295 /* 1820 */ 367, 369, 376, 1005, 1005, 1007, 1008, 27, 1312, 382,
157296 /* 1830 */ 1355, 1354, 383, 1167, 262, 264, 265, 570, 1230, 1015,
157297 /* 1840 */ 155, 1225, 1492, 1493, 1491, 107, 107, 1490, 156, 139,
157298 /* 1850 */ 296, 79, 108, 826, 442, 568, 567, 209, 157, 1005,
157299 /* 1860 */ 443, 278, 201, 210, 307, 220, 390, 390, 389, 263,
157300 /* 1870 */ 387, 137, 315, 839, 409, 1075, 1073, 410, 171, 169,
157301 /* 1880 */ 159, 903, 173, 227, 1192, 230, 223, 323, 312, 1089,
157302 /* 1890 */ 179, 1005, 1005, 1007, 1008, 27, 311, 161, 162, 419,
157303 /* 1900 */ 421, 86, 181, 163, 87, 1092, 232, 88, 1088, 148,
157304 /* 1910 */ 233, 18, 234, 89, 334, 1081, 251, 1205, 486, 236,
157305 /* 1920 */ 186, 37, 841, 355, 491, 240, 225, 869, 187, 503,
157306 /* 1930 */ 185, 495, 91, 19, 158, 347, 20, 160, 93, 350,
157307 /* 1940 */ 500, 882, 297, 149, 94, 165, 510, 95, 1155, 150,
157308 /* 1950 */ 1041, 1125, 39, 224, 40, 517, 1126, 214, 520, 270,
157309 /* 1960 */ 272, 190, 947, 250, 111, 1143, 1141, 1145, 1149, 21,
157310 /* 1970 */ 1129, 33, 542, 1148, 22, 23, 24, 25, 193, 952,
157311 /* 1980 */ 99, 1056, 1042, 1040, 26, 1044, 1098, 408, 7, 1097,
157312 /* 1990 */ 256, 257, 305, 557, 1045, 28, 41, 562, 1010, 851,
157313 /* 2000 */ 110, 29, 913, 385, 388, 258, 259, 1163, 1162, 1571,
157314 /* 2010 */ 1221, 1221, 1221, 1570, 1221, 1221, 448,
157315 };
157316 static const YYCODETYPE yy_lookahead[] = {
157317 /* 0 */ 190, 212, 190, 190, 211, 190, 212, 190, 270, 271,
157318 /* 10 */ 272, 190, 219, 190, 190, 202, 270, 271, 272, 19,
157319 /* 20 */ 190, 190, 212, 213, 212, 213, 190, 212, 213, 212,
157320 /* 30 */ 213, 31, 212, 212, 213, 212, 213, 291, 23, 39,
157321 /* 40 */ 22, 26, 24, 43, 44, 45, 46, 47, 48, 49,
157322 /* 50 */ 50, 51, 52, 53, 54, 55, 56, 57, 234, 19,
157323 /* 60 */ 190, 184, 185, 186, 187, 226, 249, 237, 237, 192,
157324 /* 70 */ 249, 194, 249, 231, 232, 258, 190, 59, 201, 258,
157325 /* 80 */ 201, 258, 81, 43, 44, 45, 46, 47, 48, 49,
157326 /* 90 */ 50, 51, 52, 53, 54, 55, 56, 57, 212, 213,
157327 /* 100 */ 264, 101, 102, 103, 104, 105, 106, 107, 108, 109,
157328 /* 110 */ 110, 111, 235, 236, 235, 236, 292, 59, 308, 309,
157329 /* 120 */ 308, 59, 310, 308, 309, 248, 86, 248, 88, 19,
157330 /* 130 */ 11, 252, 253, 115, 72, 249, 26, 136, 137, 262,
157331 /* 140 */ 111, 101, 102, 103, 104, 105, 106, 107, 108, 109,
157332 /* 150 */ 110, 111, 190, 43, 44, 45, 46, 47, 48, 49,
157333 /* 160 */ 50, 51, 52, 53, 54, 55, 56, 57, 190, 207,
157334 /* 170 */ 208, 294, 114, 115, 116, 201, 114, 115, 116, 69,
157335 /* 180 */ 101, 102, 103, 104, 105, 106, 107, 108, 109, 110,
157336 /* 190 */ 111, 105, 106, 107, 108, 109, 110, 111, 209, 19,
157337 /* 200 */ 190, 54, 55, 56, 57, 58, 245, 149, 247, 235,
157338 /* 210 */ 236, 101, 102, 103, 104, 105, 106, 107, 108, 109,
157339 /* 220 */ 110, 111, 248, 43, 44, 45, 46, 47, 48, 49,
157340 /* 230 */ 50, 51, 52, 53, 54, 55, 56, 57, 19, 265,
157341 /* 240 */ 22, 23, 280, 24, 26, 126, 127, 67, 101, 102,
157342 /* 250 */ 103, 104, 105, 106, 107, 108, 109, 110, 111, 270,
157343 /* 260 */ 271, 272, 43, 44, 45, 46, 47, 48, 49, 50,
157344 /* 270 */ 51, 52, 53, 54, 55, 56, 57, 190, 300, 301,
157345 /* 280 */ 35, 101, 102, 103, 104, 105, 106, 107, 108, 109,
157346 /* 290 */ 110, 111, 107, 108, 109, 110, 111, 209, 190, 212,
157347 /* 300 */ 213, 76, 54, 55, 56, 57, 198, 19, 19, 59,
157348 /* 310 */ 202, 66, 87, 24, 89, 190, 190, 92, 100, 74,
157349 /* 320 */ 101, 102, 103, 104, 105, 106, 107, 108, 109, 110,
157350 /* 330 */ 111, 43, 44, 45, 46, 47, 48, 49, 50, 51,
157351 /* 340 */ 52, 53, 54, 55, 56, 57, 59, 235, 236, 101,
157352 /* 350 */ 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
157353 /* 360 */ 248, 274, 99, 76, 114, 115, 116, 117, 143, 190,
157354 /* 370 */ 120, 121, 122, 128, 87, 287, 89, 303, 115, 92,
157355 /* 380 */ 130, 307, 119, 190, 95, 46, 47, 48, 49, 101,
157356 /* 390 */ 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
157357 /* 400 */ 111, 114, 115, 116, 12, 279, 117, 118, 119, 120,
157358 /* 410 */ 121, 122, 123, 19, 151, 152, 153, 23, 129, 27,
157359 /* 420 */ 117, 126, 127, 120, 121, 122, 190, 302, 303, 190,
157360 /* 430 */ 143, 190, 307, 130, 42, 265, 148, 43, 44, 45,
157361 /* 440 */ 46, 47, 48, 49, 50, 51, 52, 53, 54, 55,
157362 /* 450 */ 56, 57, 190, 260, 59, 63, 19, 185, 119, 187,
157363 /* 460 */ 23, 16, 222, 73, 192, 73, 194, 72, 219, 228,
157364 /* 470 */ 221, 81, 190, 201, 212, 213, 237, 59, 229, 222,
157365 /* 480 */ 43, 44, 45, 46, 47, 48, 49, 50, 51, 52,
157366 /* 490 */ 53, 54, 55, 56, 57, 101, 102, 103, 104, 105,
157367 /* 500 */ 106, 107, 108, 109, 110, 111, 190, 235, 236, 114,
157368 /* 510 */ 115, 116, 190, 190, 190, 125, 234, 99, 190, 215,
157369 /* 520 */ 248, 190, 77, 59, 79, 19, 136, 137, 215, 23,
157370 /* 530 */ 22, 190, 114, 115, 262, 212, 213, 119, 101, 102,
157371 /* 540 */ 103, 104, 105, 106, 107, 108, 109, 110, 111, 43,
157372 /* 550 */ 44, 45, 46, 47, 48, 49, 50, 51, 52, 53,
157373 /* 560 */ 54, 55, 56, 57, 19, 234, 294, 59, 23, 151,
157374 /* 570 */ 152, 153, 249, 303, 270, 271, 272, 307, 114, 115,
157375 /* 580 */ 116, 22, 260, 270, 271, 272, 59, 259, 43, 44,
157376 /* 590 */ 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
157377 /* 600 */ 55, 56, 57, 190, 159, 141, 190, 101, 102, 103,
157378 /* 610 */ 104, 105, 106, 107, 108, 109, 110, 111, 59, 26,
157379 /* 620 */ 207, 208, 114, 115, 116, 133, 302, 303, 190, 59,
157380 /* 630 */ 138, 307, 59, 19, 107, 105, 106, 23, 163, 164,
157381 /* 640 */ 22, 114, 115, 116, 201, 22, 101, 102, 103, 104,
157382 /* 650 */ 105, 106, 107, 108, 109, 110, 111, 43, 44, 45,
157383 /* 660 */ 46, 47, 48, 49, 50, 51, 52, 53, 54, 55,
157384 /* 670 */ 56, 57, 19, 114, 115, 116, 23, 59, 235, 236,
157385 /* 680 */ 264, 151, 59, 153, 114, 115, 116, 114, 115, 116,
157386 /* 690 */ 190, 248, 81, 280, 110, 111, 43, 44, 45, 46,
157387 /* 700 */ 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
157388 /* 710 */ 57, 141, 212, 213, 22, 101, 102, 103, 104, 105,
157389 /* 720 */ 106, 107, 108, 109, 110, 111, 288, 227, 190, 118,
157390 /* 730 */ 190, 190, 114, 115, 116, 231, 232, 114, 115, 116,
157391 /* 740 */ 147, 19, 73, 297, 298, 23, 190, 136, 137, 22,
157392 /* 750 */ 212, 213, 212, 213, 101, 102, 103, 104, 105, 106,
157393 /* 760 */ 107, 108, 109, 110, 111, 43, 44, 45, 46, 47,
157394 /* 770 */ 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
157395 /* 780 */ 19, 182, 183, 184, 185, 186, 187, 249, 61, 249,
157396 /* 790 */ 234, 192, 21, 194, 125, 126, 127, 105, 106, 190,
157397 /* 800 */ 201, 260, 22, 201, 43, 44, 45, 46, 47, 48,
157398 /* 810 */ 49, 50, 51, 52, 53, 54, 55, 56, 57, 190,
157399 /* 820 */ 190, 212, 213, 101, 102, 103, 104, 105, 106, 107,
157400 /* 830 */ 108, 109, 110, 111, 235, 236, 227, 235, 236, 59,
157401 /* 840 */ 236, 190, 212, 213, 22, 23, 209, 248, 26, 19,
157402 /* 850 */ 248, 80, 248, 59, 206, 207, 208, 227, 206, 207,
157403 /* 860 */ 208, 262, 101, 102, 103, 104, 105, 106, 107, 108,
157404 /* 870 */ 109, 110, 111, 43, 44, 45, 46, 47, 48, 49,
157405 /* 880 */ 50, 51, 52, 53, 54, 55, 56, 57, 237, 190,
157406 /* 890 */ 190, 190, 121, 294, 114, 115, 116, 190, 190, 105,
157407 /* 900 */ 106, 202, 132, 26, 134, 135, 190, 113, 114, 115,
157408 /* 910 */ 116, 190, 118, 212, 213, 19, 190, 201, 157, 282,
157409 /* 920 */ 126, 190, 100, 224, 287, 226, 201, 24, 212, 213,
157410 /* 930 */ 159, 101, 102, 103, 104, 105, 106, 107, 108, 109,
157411 /* 940 */ 110, 111, 46, 212, 213, 151, 190, 153, 190, 201,
157412 /* 950 */ 249, 235, 236, 190, 201, 234, 190, 201, 190, 259,
157413 /* 960 */ 235, 236, 59, 201, 248, 249, 259, 16, 212, 213,
157414 /* 970 */ 212, 213, 264, 248, 258, 212, 213, 190, 212, 213,
157415 /* 980 */ 212, 213, 201, 235, 236, 227, 269, 157, 235, 236,
157416 /* 990 */ 227, 235, 236, 227, 190, 227, 248, 235, 236, 212,
157417 /* 1000 */ 213, 248, 235, 236, 248, 249, 190, 19, 23, 113,
157418 /* 1010 */ 248, 26, 24, 136, 137, 248, 235, 236, 115, 156,
157419 /* 1020 */ 195, 158, 305, 306, 190, 129, 190, 19, 77, 248,
157420 /* 1030 */ 79, 43, 44, 45, 46, 47, 48, 49, 50, 51,
157421 /* 1040 */ 52, 53, 54, 55, 56, 57, 190, 19, 212, 213,
157422 /* 1050 */ 190, 43, 44, 45, 46, 47, 48, 49, 50, 51,
157423 /* 1060 */ 52, 53, 54, 55, 56, 57, 125, 126, 127, 190,
157424 /* 1070 */ 190, 43, 44, 45, 46, 47, 48, 49, 50, 51,
157425 /* 1080 */ 52, 53, 54, 55, 56, 57, 22, 23, 190, 101,
157426 /* 1090 */ 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
157427 /* 1100 */ 26, 116, 277, 59, 269, 190, 281, 228, 190, 101,
157428 /* 1110 */ 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
157429 /* 1120 */ 264, 29, 190, 190, 190, 33, 141, 212, 213, 101,
157430 /* 1130 */ 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
157431 /* 1140 */ 305, 306, 66, 12, 212, 213, 212, 213, 288, 19,
157432 /* 1150 */ 76, 7, 8, 9, 125, 126, 127, 65, 27, 115,
157433 /* 1160 */ 190, 85, 190, 89, 100, 190, 92, 190, 288, 19,
157434 /* 1170 */ 94, 204, 205, 42, 44, 45, 46, 47, 48, 49,
157435 /* 1180 */ 50, 51, 52, 53, 54, 55, 56, 57, 190, 212,
157436 /* 1190 */ 213, 190, 107, 260, 63, 45, 46, 47, 48, 49,
157437 /* 1200 */ 50, 51, 52, 53, 54, 55, 56, 57, 303, 234,
157438 /* 1210 */ 212, 213, 307, 212, 213, 22, 23, 303, 133, 301,
157439 /* 1220 */ 144, 307, 190, 138, 190, 19, 20, 190, 22, 26,
157440 /* 1230 */ 260, 101, 102, 103, 104, 105, 106, 107, 108, 109,
157441 /* 1240 */ 110, 111, 36, 59, 212, 213, 212, 213, 190, 212,
157442 /* 1250 */ 213, 101, 102, 103, 104, 105, 106, 107, 108, 109,
157443 /* 1260 */ 110, 111, 190, 76, 303, 59, 254, 190, 307, 190,
157444 /* 1270 */ 212, 213, 190, 204, 205, 222, 89, 71, 22, 92,
157445 /* 1280 */ 190, 113, 136, 137, 212, 213, 190, 81, 143, 212,
157446 /* 1290 */ 213, 212, 213, 100, 212, 213, 31, 19, 20, 115,
157447 /* 1300 */ 22, 190, 212, 213, 39, 99, 190, 162, 212, 213,
157448 /* 1310 */ 190, 105, 106, 190, 36, 59, 148, 190, 112, 116,
157449 /* 1320 */ 114, 115, 116, 212, 213, 119, 48, 19, 212, 213,
157450 /* 1330 */ 190, 240, 212, 213, 15, 212, 213, 59, 240, 212,
157451 /* 1340 */ 213, 250, 136, 137, 141, 295, 296, 26, 250, 71,
157452 /* 1350 */ 26, 26, 212, 213, 26, 240, 46, 151, 152, 153,
157453 /* 1360 */ 154, 155, 240, 85, 190, 250, 190, 190, 90, 252,
157454 /* 1370 */ 253, 115, 250, 190, 147, 148, 190, 99, 190, 60,
157455 /* 1380 */ 190, 240, 190, 105, 106, 190, 212, 213, 212, 213,
157456 /* 1390 */ 112, 250, 114, 115, 116, 212, 213, 119, 212, 213,
157457 /* 1400 */ 212, 213, 212, 213, 212, 213, 23, 212, 213, 26,
157458 /* 1410 */ 19, 20, 22, 22, 24, 190, 19, 251, 190, 127,
157459 /* 1420 */ 98, 190, 114, 113, 22, 24, 151, 36, 153, 151,
157460 /* 1430 */ 152, 153, 154, 155, 0, 1, 2, 212, 213, 5,
157461 /* 1440 */ 212, 213, 150, 190, 10, 11, 12, 13, 14, 190,
157462 /* 1450 */ 59, 17, 124, 131, 127, 53, 190, 118, 119, 119,
157463 /* 1460 */ 23, 140, 71, 26, 30, 140, 32, 143, 312, 129,
157464 /* 1470 */ 23, 212, 213, 26, 40, 190, 85, 150, 212, 213,
157465 /* 1480 */ 59, 90, 19, 20, 23, 22, 190, 26, 190, 23,
157466 /* 1490 */ 99, 190, 26, 22, 190, 23, 105, 106, 26, 36,
157467 /* 1500 */ 151, 190, 153, 112, 70, 114, 115, 116, 212, 213,
157468 /* 1510 */ 119, 114, 78, 212, 213, 81, 212, 213, 23, 7,
157469 /* 1520 */ 8, 26, 59, 212, 213, 23, 190, 190, 26, 23,
157470 /* 1530 */ 284, 97, 26, 190, 71, 190, 115, 190, 23, 59,
157471 /* 1540 */ 139, 26, 151, 152, 153, 154, 155, 190, 85, 212,
157472 /* 1550 */ 213, 190, 190, 90, 190, 212, 213, 83, 84, 190,
157473 /* 1560 */ 23, 190, 99, 26, 23, 131, 190, 26, 105, 106,
157474 /* 1570 */ 136, 137, 190, 212, 213, 112, 190, 114, 115, 116,
157475 /* 1580 */ 1, 2, 119, 190, 5, 19, 20, 232, 22, 10,
157476 /* 1590 */ 11, 12, 13, 14, 160, 115, 17, 23, 212, 213,
157477 /* 1600 */ 26, 190, 36, 190, 190, 212, 213, 190, 190, 30,
157478 /* 1610 */ 139, 32, 190, 190, 151, 152, 153, 154, 155, 40,
157479 /* 1620 */ 190, 190, 190, 212, 213, 59, 212, 213, 190, 190,
157480 /* 1630 */ 190, 190, 190, 190, 190, 190, 190, 71, 238, 283,
157481 /* 1640 */ 251, 188, 239, 251, 293, 251, 251, 267, 263, 70,
157482 /* 1650 */ 241, 255, 289, 241, 255, 267, 289, 78, 210, 255,
157483 /* 1660 */ 81, 263, 242, 276, 245, 99, 242, 216, 241, 215,
157484 /* 1670 */ 221, 105, 106, 107, 267, 267, 97, 225, 112, 215,
157485 /* 1680 */ 114, 115, 116, 215, 193, 119, 60, 139, 38, 197,
157486 /* 1690 */ 197, 19, 20, 197, 22, 245, 239, 148, 293, 293,
157487 /* 1700 */ 290, 149, 22, 268, 279, 290, 43, 230, 36, 18,
157488 /* 1710 */ 131, 233, 233, 197, 233, 136, 137, 151, 152, 153,
157489 /* 1720 */ 154, 155, 266, 233, 18, 196, 242, 147, 268, 242,
157490 /* 1730 */ 268, 59, 197, 266, 230, 230, 242, 156, 196, 160,
157491 /* 1740 */ 242, 286, 197, 71, 62, 22, 196, 217, 197, 196,
157492 /* 1750 */ 285, 197, 196, 217, 113, 223, 64, 214, 214, 19,
157493 /* 1760 */ 20, 214, 22, 22, 124, 163, 220, 111, 257, 142,
157494 /* 1770 */ 113, 99, 214, 214, 217, 220, 36, 105, 106, 216,
157495 /* 1780 */ 256, 214, 214, 223, 112, 278, 114, 115, 116, 306,
157496 /* 1790 */ 217, 119, 278, 217, 197, 257, 256, 311, 91, 59,
157497 /* 1800 */ 311, 82, 143, 22, 146, 197, 273, 156, 144, 275,
157498 /* 1810 */ 145, 71, 25, 200, 26, 199, 244, 246, 257, 257,
157499 /* 1820 */ 256, 256, 245, 151, 152, 153, 154, 155, 246, 243,
157500 /* 1830 */ 261, 261, 242, 13, 191, 191, 6, 189, 189, 99,
157501 /* 1840 */ 203, 189, 209, 209, 209, 105, 106, 209, 203, 218,
157502 /* 1850 */ 218, 209, 112, 4, 114, 115, 116, 210, 203, 119,
157503 /* 1860 */ 3, 5, 22, 210, 161, 15, 10, 11, 12, 13,
157504 /* 1870 */ 14, 16, 137, 17, 299, 23, 23, 299, 149, 296,
157505 /* 1880 */ 128, 20, 140, 24, 26, 142, 30, 16, 32, 1,
157506 /* 1890 */ 140, 151, 152, 153, 154, 155, 40, 128, 128, 61,
157507 /* 1900 */ 37, 53, 149, 128, 53, 114, 34, 53, 1, 5,
157508 /* 1910 */ 139, 22, 113, 53, 159, 68, 26, 75, 41, 139,
157509 /* 1920 */ 113, 24, 20, 129, 19, 123, 70, 59, 22, 96,
157510 /* 1930 */ 68, 67, 22, 22, 78, 23, 22, 81, 22, 24,
157511 /* 1940 */ 67, 28, 67, 23, 147, 37, 22, 26, 23, 23,
157512 /* 1950 */ 23, 23, 22, 97, 22, 24, 23, 139, 24, 23,
157513 /* 1960 */ 23, 22, 141, 34, 26, 86, 88, 75, 75, 34,
157514 /* 1970 */ 23, 22, 24, 93, 34, 34, 34, 34, 26, 114,
157515 /* 1980 */ 26, 23, 23, 23, 34, 23, 23, 131, 44, 23,
157516 /* 1990 */ 26, 22, 136, 137, 11, 22, 22, 26, 23, 23,
157517 /* 2000 */ 22, 22, 133, 23, 15, 139, 139, 1, 1, 139,
157518 /* 2010 */ 313, 313, 313, 139, 313, 313, 160, 313, 313, 313,
157519 /* 2020 */ 313, 313, 313, 313, 313, 313, 313, 313, 313, 313,
157520 /* 2030 */ 313, 313, 313, 313, 313, 313, 313, 313, 313, 313,
157521 /* 2040 */ 313, 313, 313, 313, 313, 313, 313, 313, 313, 313,
157522 /* 2050 */ 313, 313, 313, 313, 313, 313, 313, 313, 313, 313,
157523 /* 2060 */ 313, 313, 313, 313, 313, 313, 313, 313, 313, 313,
157524 /* 2070 */ 313, 313, 313, 313, 313, 313, 313, 313, 313, 313,
157525 /* 2080 */ 313, 313, 313, 313, 313, 313, 313, 313, 313, 313,
157526 /* 2090 */ 313, 313, 313, 313, 313, 313, 313, 313, 313, 313,
157527 /* 2100 */ 313, 313, 313, 313, 313, 313, 313, 313, 313, 313,
157528 /* 2110 */ 313, 313, 313, 313, 313, 313, 313, 313, 313, 313,
157529 /* 2120 */ 313, 313, 313, 313, 313, 313, 313, 313, 313, 313,
157530 /* 2130 */ 313, 313, 313, 313, 313, 313, 313, 313, 313, 313,
157531 /* 2140 */ 313, 313, 313, 313, 313, 313, 313, 313, 313, 313,
157532 /* 2150 */ 313, 313, 313, 313, 313, 313, 313, 313, 313, 313,
157533 /* 2160 */ 313, 313, 313, 313, 313, 313, 313, 313, 313, 313,
157534 /* 2170 */ 313, 313, 313, 313, 313, 313, 313, 313, 313, 313,
157535 /* 2180 */ 313, 313, 313, 313, 313, 313, 313, 313, 313, 313,
157536 /* 2190 */ 313, 313, 313, 313, 313, 313, 182, 182, 182,
157537 };
157538 #define YY_SHIFT_COUNT (572)
 
157539 #define YY_SHIFT_MIN (0)
157540 #define YY_SHIFT_MAX (2007)
157541 static const unsigned short int yy_shift_ofst[] = {
157542 /* 0 */ 1579, 1434, 1856, 1206, 1206, 1, 1278, 1391, 1463, 1672,
157543 /* 10 */ 1672, 1672, 390, 0, 0, 180, 1008, 1672, 1672, 1672,
157544 /* 20 */ 1672, 1672, 1672, 1672, 1672, 1672, 1672, 1672, 1672, 1672,
157545 /* 30 */ 794, 794, 287, 287, 250, 611, 1, 1, 1, 1,
157546 /* 40 */ 1, 1, 40, 110, 219, 288, 394, 437, 506, 545,
157547 /* 50 */ 614, 653, 722, 761, 830, 988, 1008, 1008, 1008, 1008,
157548 /* 60 */ 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008,
157549 /* 70 */ 1008, 1008, 1008, 1008, 1028, 1008, 1130, 1150, 1150, 1566,
157550 /* 80 */ 1672, 1672, 1672, 1672, 1672, 1672, 1672, 1672, 1672, 1672,
157551 /* 90 */ 1672, 1672, 1672, 1672, 1672, 1672, 1672, 1672, 1672, 1672,
157552 /* 100 */ 1672, 1672, 1672, 1672, 1672, 1672, 1672, 1672, 1672, 1672,
157553 /* 110 */ 1672, 1672, 1672, 1672, 1740, 1672, 1672, 1672, 1672, 1672,
157554 /* 120 */ 1672, 1672, 1672, 1672, 1672, 1672, 1672, 1672, 147, 248,
157555 /* 130 */ 248, 248, 248, 248, 79, 86, 185, 573, 771, 896,
157556 /* 140 */ 573, 530, 530, 573, 877, 877, 877, 877, 295, 475,
157557 /* 150 */ 475, 584, 29, 2017, 2017, 289, 289, 289, 58, 508,
157558 /* 160 */ 62, 508, 508, 508, 392, 392, 225, 395, 218, 822,
157559 /* 170 */ 573, 573, 573, 573, 573, 573, 573, 573, 573, 573,
157560 /* 180 */ 573, 573, 573, 573, 573, 573, 573, 573, 573, 573,
157561 /* 190 */ 573, 1074, 1074, 573, 119, 1187, 1187, 1044, 1044, 1145,
157562 /* 200 */ 1146, 2017, 2017, 2017, 2017, 2017, 2017, 2017, 418, 263,
157563 /* 210 */ 263, 559, 303, 618, 527, 623, 464, 570, 780, 573,
157564 /* 220 */ 573, 573, 573, 573, 573, 573, 573, 573, 573, 669,
157565 /* 230 */ 573, 573, 573, 573, 573, 573, 573, 573, 573, 573,
157566 /* 240 */ 573, 573, 245, 245, 245, 573, 573, 573, 573, 985,
157567 /* 250 */ 573, 573, 573, 18, 1076, 573, 573, 1131, 573, 573,
157568 /* 260 */ 573, 573, 573, 573, 573, 573, 941, 1092, 770, 903,
157569 /* 270 */ 903, 903, 903, 1203, 770, 770, 1085, 692, 1144, 1319,
157570 /* 280 */ 1168, 1227, 1321, 1308, 1227, 1308, 1397, 593, 1168, 1168,
157571 /* 290 */ 593, 1168, 1321, 1397, 1328, 15, 1310, 1265, 1265, 1265,
157572 /* 300 */ 1308, 1324, 1324, 863, 1325, 492, 1390, 1626, 1626, 1548,
157573 /* 310 */ 1548, 1650, 1650, 1548, 1552, 1549, 1680, 1663, 1691, 1691,
157574 /* 320 */ 1691, 1691, 1548, 1706, 1580, 1549, 1549, 1580, 1680, 1663,
157575 /* 330 */ 1580, 1663, 1580, 1548, 1706, 1581, 1682, 1548, 1706, 1723,
157576 /* 340 */ 1548, 1706, 1548, 1706, 1723, 1641, 1641, 1641, 1692, 1741,
157577 /* 350 */ 1741, 1723, 1641, 1640, 1641, 1692, 1641, 1641, 1602, 1723,
157578 /* 360 */ 1656, 1656, 1723, 1627, 1657, 1627, 1657, 1627, 1657, 1627,
157579 /* 370 */ 1657, 1548, 1707, 1707, 1719, 1719, 1658, 1659, 1781, 1548,
157580 /* 380 */ 1651, 1658, 1665, 1664, 1580, 1787, 1788, 1820, 1820, 1830,
157581 /* 390 */ 1830, 1830, 2017, 2017, 2017, 2017, 2017, 2017, 2017, 2017,
157582 /* 400 */ 2017, 2017, 2017, 2017, 2017, 2017, 2017, 339, 445, 1064,
157583 /* 410 */ 1193, 951, 1029, 1256, 1383, 1322, 1402, 1401, 1292, 1327,
157584 /* 420 */ 1437, 727, 1447, 1461, 1466, 1472, 1495, 1502, 1184, 1339,
157585 /* 430 */ 1512, 1340, 1421, 1506, 1515, 1474, 1537, 1275, 1349, 1541,
157586 /* 440 */ 1574, 1480, 1471, 1849, 1857, 1840, 1703, 1850, 1855, 1852,
157587 /* 450 */ 1853, 1735, 1729, 1752, 1858, 1858, 1859, 1742, 1861, 1743,
157588 /* 460 */ 1871, 1888, 1750, 1769, 1858, 1770, 1838, 1863, 1858, 1753,
157589 /* 470 */ 1848, 1851, 1854, 1860, 1775, 1791, 1872, 1771, 1907, 1904,
157590 /* 480 */ 1889, 1799, 1755, 1847, 1890, 1862, 1842, 1877, 1780, 1807,
157591 /* 490 */ 1897, 1902, 1905, 1794, 1802, 1906, 1864, 1910, 1911, 1912,
157592 /* 500 */ 1914, 1873, 1868, 1915, 1833, 1913, 1916, 1875, 1908, 1920,
157593 /* 510 */ 1797, 1924, 1925, 1926, 1927, 1921, 1928, 1930, 1931, 1933,
157594 /* 520 */ 1932, 1934, 1818, 1936, 1937, 1865, 1929, 1939, 1821, 1938,
157595 /* 530 */ 1935, 1940, 1941, 1942, 1878, 1892, 1879, 1944, 1893, 1880,
157596 /* 540 */ 1943, 1947, 1949, 1948, 1952, 1954, 1950, 1958, 1938, 1959,
157597 /* 550 */ 1960, 1962, 1963, 1964, 1966, 1969, 1983, 1973, 1974, 1975,
157598 /* 560 */ 1976, 1978, 1979, 1971, 1869, 1866, 1867, 1870, 1874, 1980,
157599 /* 570 */ 1989, 2006, 2007,
157600 };
157601 #define YY_REDUCE_COUNT (406)
157602 #define YY_REDUCE_MIN (-262)
157603 #define YY_REDUCE_MAX (1655)
157604 static const short yy_reduce_ofst[] = {
157605 /* 0 */ 599, -123, 272, 716, 756, -121, -190, -188, -185, -183,
157606 /* 10 */ -179, -177, -26, 304, 313, -254, -11, 500, 609, 630,
157607 /* 20 */ 758, -114, 763, 766, 323, 538, 768, 87, 540, 701,
157608 /* 30 */ -38, 413, 125, 324, 699, 443, 602, 725, 748, 753,
157609 /* 40 */ 762, 781, -262, -262, -262, -262, -262, -262, -262, -262,
157610 /* 50 */ -262, -262, -262, -262, -262, -262, -262, -262, -262, -262,
157611 /* 60 */ -262, -262, -262, -262, -262, -262, -262, -262, -262, -262,
157612 /* 70 */ -262, -262, -262, -262, -262, -262, -262, -262, -262, 262,
157613 /* 80 */ 731, 787, 836, 915, 932, 934, 977, 998, 1001, 1032,
157614 /* 90 */ 1034, 1037, 1058, 1072, 1077, 1079, 1082, 1090, 1096, 1111,
157615 /* 100 */ 1116, 1120, 1123, 1127, 1140, 1174, 1176, 1183, 1186, 1188,
157616 /* 110 */ 1190, 1192, 1195, 1225, 1228, 1259, 1266, 1296, 1301, 1304,
157617 /* 120 */ 1311, 1337, 1343, 1361, 1386, 1393, 1411, 1414, -262, -262,
157618 /* 130 */ -262, -262, -262, -262, -262, -262, -262, -176, 825, 249,
157619 /* 140 */ -22, 648, 652, 108, 112, 767, 112, 767, 637, 717,
157620 /* 150 */ 835, -262, -262, -262, -262, -207, -207, -207, 126, -164,
157621 /* 160 */ -170, 416, 708, 856, -158, 504, 74, -169, 446, 446,
157622 /* 170 */ -187, 328, 700, 707, 239, 282, 331, 556, 721, 438,
157623 /* 180 */ 193, 860, 322, 541, 880, 933, 975, 241, 651, 879,
157624 /* 190 */ 970, 270, 905, 918, 88, 914, 961, 967, 1069, -39,
157625 /* 200 */ 604, 1050, 1091, 1098, 1115, 1122, 1117, 1141, -211, -206,
157626 /* 210 */ -180, -130, -161, 10, 179, 236, 316, 341, 629, 726,
157627 /* 220 */ 804, 816, 834, 898, 972, 1177, 1231, 1253, 1285, 170,
157628 /* 230 */ 1298, 1336, 1345, 1347, 1357, 1362, 1364, 1369, 1371, 1376,
157629 /* 240 */ 1382, 1413, 240, 257, 1053, 1417, 1422, 1423, 1430, 1012,
157630 /* 250 */ 1431, 1432, 1438, 1166, 1156, 1418, 1439, 1355, 1440, 179,
157631 /* 260 */ 1441, 1442, 1443, 1444, 1445, 1446, 1246, 1356, 1400, 1389,
157632 /* 270 */ 1392, 1394, 1395, 1012, 1400, 1400, 1403, 1448, 1453, 1351,
157633 /* 280 */ 1380, 1385, 1409, 1396, 1398, 1399, 1363, 1420, 1388, 1407,
157634 /* 290 */ 1424, 1408, 1412, 1367, 1451, 1452, 1449, 1454, 1464, 1468,
157635 /* 300 */ 1404, 1419, 1450, 1387, 1427, 1457, 1491, 1405, 1406, 1492,
157636 /* 310 */ 1493, 1410, 1415, 1496, 1425, 1435, 1456, 1477, 1478, 1479,
157637 /* 320 */ 1481, 1490, 1516, 1529, 1484, 1460, 1462, 1487, 1467, 1504,
157638 /* 330 */ 1494, 1505, 1498, 1535, 1542, 1455, 1465, 1545, 1550, 1530,
157639 /* 340 */ 1551, 1553, 1554, 1556, 1536, 1543, 1544, 1547, 1532, 1546,
157640 /* 350 */ 1555, 1557, 1558, 1563, 1559, 1560, 1567, 1568, 1483, 1573,
157641 /* 360 */ 1507, 1514, 1576, 1511, 1524, 1538, 1540, 1561, 1564, 1562,
157642 /* 370 */ 1565, 1597, 1486, 1489, 1569, 1570, 1571, 1577, 1533, 1608,
157643 /* 380 */ 1534, 1582, 1572, 1586, 1590, 1613, 1616, 1643, 1644, 1648,
157644 /* 390 */ 1649, 1652, 1575, 1578, 1583, 1637, 1633, 1634, 1635, 1638,
157645 /* 400 */ 1645, 1631, 1632, 1647, 1653, 1642, 1655,
157646 };
157647 static const YYACTIONTYPE yy_default[] = {
157648 /* 0 */ 1615, 1615, 1615, 1449, 1219, 1328, 1219, 1219, 1219, 1449,
157649 /* 10 */ 1449, 1449, 1219, 1358, 1358, 1502, 1250, 1219, 1219, 1219,
157650 /* 20 */ 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1448, 1219, 1219,
157651 /* 30 */ 1219, 1219, 1533, 1533, 1219, 1219, 1219, 1219, 1219, 1219,
157652 /* 40 */ 1219, 1219, 1219, 1367, 1219, 1374, 1219, 1219, 1219, 1219,
157653 /* 50 */ 1219, 1450, 1451, 1219, 1219, 1219, 1501, 1503, 1466, 1381,
157654 /* 60 */ 1380, 1379, 1378, 1484, 1345, 1372, 1365, 1369, 1444, 1445,
157655 /* 70 */ 1443, 1447, 1451, 1450, 1219, 1368, 1415, 1429, 1414, 1219,
157656 /* 80 */ 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219,
157657 /* 90 */ 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219,
157658 /* 100 */ 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219,
157659 /* 110 */ 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219,
157660 /* 120 */ 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1423, 1428,
157661 /* 130 */ 1434, 1427, 1424, 1417, 1416, 1418, 1419, 1219, 1240, 1292,
157662 /* 140 */ 1219, 1219, 1219, 1219, 1521, 1520, 1219, 1219, 1250, 1409,
157663 /* 150 */ 1408, 1420, 1421, 1431, 1430, 1509, 1568, 1567, 1467, 1219,
157664 /* 160 */ 1219, 1219, 1219, 1219, 1219, 1219, 1533, 1219, 1219, 1219,
157665 /* 170 */ 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219,
157666 /* 180 */ 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219,
157667 /* 190 */ 1219, 1533, 1533, 1219, 1250, 1533, 1533, 1246, 1246, 1352,
157668 /* 200 */ 1219, 1516, 1319, 1319, 1319, 1319, 1328, 1319, 1219, 1219,
157669 /* 210 */ 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219,
157670 /* 220 */ 1219, 1219, 1219, 1506, 1504, 1219, 1219, 1219, 1219, 1219,
157671 /* 230 */ 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219,
157672 /* 240 */ 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219,
157673 /* 250 */ 1219, 1219, 1219, 1324, 1219, 1219, 1219, 1219, 1219, 1219,
157674 /* 260 */ 1219, 1219, 1219, 1219, 1219, 1562, 1219, 1479, 1306, 1324,
157675 /* 270 */ 1324, 1324, 1324, 1326, 1307, 1305, 1318, 1251, 1226, 1607,
157676 /* 280 */ 1384, 1373, 1325, 1347, 1373, 1347, 1604, 1371, 1384, 1384,
157677 /* 290 */ 1371, 1384, 1325, 1604, 1267, 1584, 1262, 1358, 1358, 1358,
157678 /* 300 */ 1347, 1352, 1352, 1446, 1325, 1318, 1219, 1607, 1607, 1333,
157679 /* 310 */ 1333, 1606, 1606, 1333, 1467, 1591, 1393, 1295, 1301, 1301,
157680 /* 320 */ 1301, 1301, 1333, 1237, 1371, 1591, 1591, 1371, 1393, 1295,
157681 /* 330 */ 1371, 1295, 1371, 1333, 1237, 1483, 1601, 1333, 1237, 1457,
157682 /* 340 */ 1333, 1237, 1333, 1237, 1457, 1293, 1293, 1293, 1282, 1219,
157683 /* 350 */ 1219, 1457, 1293, 1267, 1293, 1282, 1293, 1293, 1551, 1457,
157684 /* 360 */ 1461, 1461, 1457, 1351, 1346, 1351, 1346, 1351, 1346, 1351,
157685 /* 370 */ 1346, 1333, 1543, 1543, 1361, 1361, 1366, 1352, 1452, 1333,
157686 /* 380 */ 1219, 1366, 1364, 1362, 1371, 1243, 1285, 1565, 1565, 1561,
157687 /* 390 */ 1561, 1561, 1612, 1612, 1516, 1577, 1250, 1250, 1250, 1250,
157688 /* 400 */ 1577, 1269, 1269, 1251, 1251, 1250, 1577, 1219, 1219, 1219,
157689 /* 410 */ 1219, 1219, 1219, 1572, 1219, 1511, 1468, 1337, 1219, 1219,
157690 /* 420 */ 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219,
157691 /* 430 */ 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219,
157692 /* 440 */ 1219, 1219, 1398, 1219, 1222, 1513, 1219, 1219, 1219, 1219,
157693 /* 450 */ 1219, 1219, 1219, 1219, 1375, 1376, 1338, 1219, 1219, 1219,
157694 /* 460 */ 1219, 1219, 1219, 1219, 1390, 1219, 1219, 1219, 1385, 1219,
157695 /* 470 */ 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1603, 1219, 1219,
157696 /* 480 */ 1219, 1219, 1219, 1219, 1482, 1481, 1219, 1219, 1335, 1219,
157697 /* 490 */ 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219,
157698 /* 500 */ 1219, 1219, 1265, 1219, 1219, 1219, 1219, 1219, 1219, 1219,
157699 /* 510 */ 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219,
157700 /* 520 */ 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1363,
157701 /* 530 */ 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219,
157702 /* 540 */ 1219, 1219, 1219, 1219, 1548, 1353, 1219, 1219, 1594, 1219,
157703 /* 550 */ 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219,
157704 /* 560 */ 1219, 1219, 1219, 1588, 1309, 1400, 1219, 1399, 1403, 1219,
157705 /* 570 */ 1231, 1219, 1219,
157706 };
157707 /********** End of lemon-generated parsing tables *****************************/
157708
157709 /* The next table maps tokens (terminal symbols) into fallback tokens.
157710 ** If a construct like the following:
@@ -157817,10 +157988,11 @@
157817 59, /* GROUPS => ID */
157818 59, /* OTHERS => ID */
157819 59, /* TIES => ID */
157820 59, /* GENERATED => ID */
157821 59, /* ALWAYS => ID */
 
157822 59, /* REINDEX => ID */
157823 59, /* RENAME => ID */
157824 59, /* CTIME_KW => ID */
157825 0, /* ANY => nothing */
157826 0, /* BITAND => nothing */
@@ -158087,226 +158259,229 @@
158087 /* 92 */ "GROUPS",
158088 /* 93 */ "OTHERS",
158089 /* 94 */ "TIES",
158090 /* 95 */ "GENERATED",
158091 /* 96 */ "ALWAYS",
158092 /* 97 */ "REINDEX",
158093 /* 98 */ "RENAME",
158094 /* 99 */ "CTIME_KW",
158095 /* 100 */ "ANY",
158096 /* 101 */ "BITAND",
158097 /* 102 */ "BITOR",
158098 /* 103 */ "LSHIFT",
158099 /* 104 */ "RSHIFT",
158100 /* 105 */ "PLUS",
158101 /* 106 */ "MINUS",
158102 /* 107 */ "STAR",
158103 /* 108 */ "SLASH",
158104 /* 109 */ "REM",
158105 /* 110 */ "CONCAT",
158106 /* 111 */ "COLLATE",
158107 /* 112 */ "BITNOT",
158108 /* 113 */ "ON",
158109 /* 114 */ "INDEXED",
158110 /* 115 */ "STRING",
158111 /* 116 */ "JOIN_KW",
158112 /* 117 */ "CONSTRAINT",
158113 /* 118 */ "DEFAULT",
158114 /* 119 */ "NULL",
158115 /* 120 */ "PRIMARY",
158116 /* 121 */ "UNIQUE",
158117 /* 122 */ "CHECK",
158118 /* 123 */ "REFERENCES",
158119 /* 124 */ "AUTOINCR",
158120 /* 125 */ "INSERT",
158121 /* 126 */ "DELETE",
158122 /* 127 */ "UPDATE",
158123 /* 128 */ "SET",
158124 /* 129 */ "DEFERRABLE",
158125 /* 130 */ "FOREIGN",
158126 /* 131 */ "DROP",
158127 /* 132 */ "UNION",
158128 /* 133 */ "ALL",
158129 /* 134 */ "EXCEPT",
158130 /* 135 */ "INTERSECT",
158131 /* 136 */ "SELECT",
158132 /* 137 */ "VALUES",
158133 /* 138 */ "DISTINCT",
158134 /* 139 */ "DOT",
158135 /* 140 */ "FROM",
158136 /* 141 */ "JOIN",
158137 /* 142 */ "USING",
158138 /* 143 */ "ORDER",
158139 /* 144 */ "GROUP",
158140 /* 145 */ "HAVING",
158141 /* 146 */ "LIMIT",
158142 /* 147 */ "WHERE",
158143 /* 148 */ "RETURNING",
158144 /* 149 */ "INTO",
158145 /* 150 */ "NOTHING",
158146 /* 151 */ "FLOAT",
158147 /* 152 */ "BLOB",
158148 /* 153 */ "INTEGER",
158149 /* 154 */ "VARIABLE",
158150 /* 155 */ "CASE",
158151 /* 156 */ "WHEN",
158152 /* 157 */ "THEN",
158153 /* 158 */ "ELSE",
158154 /* 159 */ "INDEX",
158155 /* 160 */ "ALTER",
158156 /* 161 */ "ADD",
158157 /* 162 */ "WINDOW",
158158 /* 163 */ "OVER",
158159 /* 164 */ "FILTER",
158160 /* 165 */ "COLUMN",
158161 /* 166 */ "AGG_FUNCTION",
158162 /* 167 */ "AGG_COLUMN",
158163 /* 168 */ "TRUEFALSE",
158164 /* 169 */ "ISNOT",
158165 /* 170 */ "FUNCTION",
158166 /* 171 */ "UMINUS",
158167 /* 172 */ "UPLUS",
158168 /* 173 */ "TRUTH",
158169 /* 174 */ "REGISTER",
158170 /* 175 */ "VECTOR",
158171 /* 176 */ "SELECT_COLUMN",
158172 /* 177 */ "IF_NULL_ROW",
158173 /* 178 */ "ASTERISK",
158174 /* 179 */ "SPAN",
158175 /* 180 */ "SPACE",
158176 /* 181 */ "ILLEGAL",
158177 /* 182 */ "input",
158178 /* 183 */ "cmdlist",
158179 /* 184 */ "ecmd",
158180 /* 185 */ "cmdx",
158181 /* 186 */ "explain",
158182 /* 187 */ "cmd",
158183 /* 188 */ "transtype",
158184 /* 189 */ "trans_opt",
158185 /* 190 */ "nm",
158186 /* 191 */ "savepoint_opt",
158187 /* 192 */ "create_table",
158188 /* 193 */ "create_table_args",
158189 /* 194 */ "createkw",
158190 /* 195 */ "temp",
158191 /* 196 */ "ifnotexists",
158192 /* 197 */ "dbnm",
158193 /* 198 */ "columnlist",
158194 /* 199 */ "conslist_opt",
158195 /* 200 */ "table_options",
158196 /* 201 */ "select",
158197 /* 202 */ "columnname",
158198 /* 203 */ "carglist",
158199 /* 204 */ "typetoken",
158200 /* 205 */ "typename",
158201 /* 206 */ "signed",
158202 /* 207 */ "plus_num",
158203 /* 208 */ "minus_num",
158204 /* 209 */ "scanpt",
158205 /* 210 */ "scantok",
158206 /* 211 */ "ccons",
158207 /* 212 */ "term",
158208 /* 213 */ "expr",
158209 /* 214 */ "onconf",
158210 /* 215 */ "sortorder",
158211 /* 216 */ "autoinc",
158212 /* 217 */ "eidlist_opt",
158213 /* 218 */ "refargs",
158214 /* 219 */ "defer_subclause",
158215 /* 220 */ "generated",
158216 /* 221 */ "refarg",
158217 /* 222 */ "refact",
158218 /* 223 */ "init_deferred_pred_opt",
158219 /* 224 */ "conslist",
158220 /* 225 */ "tconscomma",
158221 /* 226 */ "tcons",
158222 /* 227 */ "sortlist",
158223 /* 228 */ "eidlist",
158224 /* 229 */ "defer_subclause_opt",
158225 /* 230 */ "orconf",
158226 /* 231 */ "resolvetype",
158227 /* 232 */ "raisetype",
158228 /* 233 */ "ifexists",
158229 /* 234 */ "fullname",
158230 /* 235 */ "selectnowith",
158231 /* 236 */ "oneselect",
158232 /* 237 */ "wqlist",
158233 /* 238 */ "multiselect_op",
158234 /* 239 */ "distinct",
158235 /* 240 */ "selcollist",
158236 /* 241 */ "from",
158237 /* 242 */ "where_opt",
158238 /* 243 */ "groupby_opt",
158239 /* 244 */ "having_opt",
158240 /* 245 */ "orderby_opt",
158241 /* 246 */ "limit_opt",
158242 /* 247 */ "window_clause",
158243 /* 248 */ "values",
158244 /* 249 */ "nexprlist",
158245 /* 250 */ "sclp",
158246 /* 251 */ "as",
158247 /* 252 */ "seltablist",
158248 /* 253 */ "stl_prefix",
158249 /* 254 */ "joinop",
158250 /* 255 */ "indexed_opt",
158251 /* 256 */ "on_opt",
158252 /* 257 */ "using_opt",
158253 /* 258 */ "exprlist",
158254 /* 259 */ "xfullname",
158255 /* 260 */ "idlist",
158256 /* 261 */ "nulls",
158257 /* 262 */ "with",
158258 /* 263 */ "where_opt_ret",
158259 /* 264 */ "setlist",
158260 /* 265 */ "insert_cmd",
158261 /* 266 */ "idlist_opt",
158262 /* 267 */ "upsert",
158263 /* 268 */ "returning",
158264 /* 269 */ "filter_over",
158265 /* 270 */ "likeop",
158266 /* 271 */ "between_op",
158267 /* 272 */ "in_op",
158268 /* 273 */ "paren_exprlist",
158269 /* 274 */ "case_operand",
158270 /* 275 */ "case_exprlist",
158271 /* 276 */ "case_else",
158272 /* 277 */ "uniqueflag",
158273 /* 278 */ "collate",
158274 /* 279 */ "vinto",
158275 /* 280 */ "nmnum",
158276 /* 281 */ "trigger_decl",
158277 /* 282 */ "trigger_cmd_list",
158278 /* 283 */ "trigger_time",
158279 /* 284 */ "trigger_event",
158280 /* 285 */ "foreach_clause",
158281 /* 286 */ "when_clause",
158282 /* 287 */ "trigger_cmd",
158283 /* 288 */ "trnm",
158284 /* 289 */ "tridxby",
158285 /* 290 */ "database_kw_opt",
158286 /* 291 */ "key_opt",
158287 /* 292 */ "add_column_fullname",
158288 /* 293 */ "kwcolumn_opt",
158289 /* 294 */ "create_vtab",
158290 /* 295 */ "vtabarglist",
158291 /* 296 */ "vtabarg",
158292 /* 297 */ "vtabargtoken",
158293 /* 298 */ "lp",
158294 /* 299 */ "anylist",
158295 /* 300 */ "windowdefn_list",
158296 /* 301 */ "windowdefn",
158297 /* 302 */ "window",
158298 /* 303 */ "frame_opt",
158299 /* 304 */ "part_opt",
158300 /* 305 */ "filter_clause",
158301 /* 306 */ "over_clause",
158302 /* 307 */ "range_or_rows",
158303 /* 308 */ "frame_bound",
158304 /* 309 */ "frame_bound_s",
158305 /* 310 */ "frame_bound_e",
158306 /* 311 */ "frame_exclude_opt",
158307 /* 312 */ "frame_exclude",
 
 
 
158308 };
158309 #endif /* defined(YYCOVERAGE) || !defined(NDEBUG) */
158310
158311 #ifndef NDEBUG
158312 /* For tracing reduce actions, the names of all rules are required.
@@ -158610,104 +158785,108 @@
158610 /* 295 */ "vtabargtoken ::= ANY",
158611 /* 296 */ "vtabargtoken ::= lp anylist RP",
158612 /* 297 */ "lp ::= LP",
158613 /* 298 */ "with ::= WITH wqlist",
158614 /* 299 */ "with ::= WITH RECURSIVE wqlist",
158615 /* 300 */ "wqlist ::= nm eidlist_opt AS LP select RP",
158616 /* 301 */ "wqlist ::= wqlist COMMA nm eidlist_opt AS LP select RP",
158617 /* 302 */ "windowdefn_list ::= windowdefn",
158618 /* 303 */ "windowdefn_list ::= windowdefn_list COMMA windowdefn",
158619 /* 304 */ "windowdefn ::= nm AS LP window RP",
158620 /* 305 */ "window ::= PARTITION BY nexprlist orderby_opt frame_opt",
158621 /* 306 */ "window ::= nm PARTITION BY nexprlist orderby_opt frame_opt",
158622 /* 307 */ "window ::= ORDER BY sortlist frame_opt",
158623 /* 308 */ "window ::= nm ORDER BY sortlist frame_opt",
158624 /* 309 */ "window ::= frame_opt",
158625 /* 310 */ "window ::= nm frame_opt",
158626 /* 311 */ "frame_opt ::=",
158627 /* 312 */ "frame_opt ::= range_or_rows frame_bound_s frame_exclude_opt",
158628 /* 313 */ "frame_opt ::= range_or_rows BETWEEN frame_bound_s AND frame_bound_e frame_exclude_opt",
158629 /* 314 */ "range_or_rows ::= RANGE|ROWS|GROUPS",
158630 /* 315 */ "frame_bound_s ::= frame_bound",
158631 /* 316 */ "frame_bound_s ::= UNBOUNDED PRECEDING",
158632 /* 317 */ "frame_bound_e ::= frame_bound",
158633 /* 318 */ "frame_bound_e ::= UNBOUNDED FOLLOWING",
158634 /* 319 */ "frame_bound ::= expr PRECEDING|FOLLOWING",
158635 /* 320 */ "frame_bound ::= CURRENT ROW",
158636 /* 321 */ "frame_exclude_opt ::=",
158637 /* 322 */ "frame_exclude_opt ::= EXCLUDE frame_exclude",
158638 /* 323 */ "frame_exclude ::= NO OTHERS",
158639 /* 324 */ "frame_exclude ::= CURRENT ROW",
158640 /* 325 */ "frame_exclude ::= GROUP|TIES",
158641 /* 326 */ "window_clause ::= WINDOW windowdefn_list",
158642 /* 327 */ "filter_over ::= filter_clause over_clause",
158643 /* 328 */ "filter_over ::= over_clause",
158644 /* 329 */ "filter_over ::= filter_clause",
158645 /* 330 */ "over_clause ::= OVER LP window RP",
158646 /* 331 */ "over_clause ::= OVER nm",
158647 /* 332 */ "filter_clause ::= FILTER LP WHERE expr RP",
158648 /* 333 */ "input ::= cmdlist",
158649 /* 334 */ "cmdlist ::= cmdlist ecmd",
158650 /* 335 */ "cmdlist ::= ecmd",
158651 /* 336 */ "ecmd ::= SEMI",
158652 /* 337 */ "ecmd ::= cmdx SEMI",
158653 /* 338 */ "ecmd ::= explain cmdx SEMI",
158654 /* 339 */ "trans_opt ::=",
158655 /* 340 */ "trans_opt ::= TRANSACTION",
158656 /* 341 */ "trans_opt ::= TRANSACTION nm",
158657 /* 342 */ "savepoint_opt ::= SAVEPOINT",
158658 /* 343 */ "savepoint_opt ::=",
158659 /* 344 */ "cmd ::= create_table create_table_args",
158660 /* 345 */ "columnlist ::= columnlist COMMA columnname carglist",
158661 /* 346 */ "columnlist ::= columnname carglist",
158662 /* 347 */ "nm ::= ID|INDEXED",
158663 /* 348 */ "nm ::= STRING",
158664 /* 349 */ "nm ::= JOIN_KW",
158665 /* 350 */ "typetoken ::= typename",
158666 /* 351 */ "typename ::= ID|STRING",
158667 /* 352 */ "signed ::= plus_num",
158668 /* 353 */ "signed ::= minus_num",
158669 /* 354 */ "carglist ::= carglist ccons",
158670 /* 355 */ "carglist ::=",
158671 /* 356 */ "ccons ::= NULL onconf",
158672 /* 357 */ "ccons ::= GENERATED ALWAYS AS generated",
158673 /* 358 */ "ccons ::= AS generated",
158674 /* 359 */ "conslist_opt ::= COMMA conslist",
158675 /* 360 */ "conslist ::= conslist tconscomma tcons",
158676 /* 361 */ "conslist ::= tcons",
158677 /* 362 */ "tconscomma ::=",
158678 /* 363 */ "defer_subclause_opt ::= defer_subclause",
158679 /* 364 */ "resolvetype ::= raisetype",
158680 /* 365 */ "selectnowith ::= oneselect",
158681 /* 366 */ "oneselect ::= values",
158682 /* 367 */ "sclp ::= selcollist COMMA",
158683 /* 368 */ "as ::= ID|STRING",
158684 /* 369 */ "returning ::=",
158685 /* 370 */ "expr ::= term",
158686 /* 371 */ "likeop ::= LIKE_KW|MATCH",
158687 /* 372 */ "exprlist ::= nexprlist",
158688 /* 373 */ "nmnum ::= plus_num",
158689 /* 374 */ "nmnum ::= nm",
158690 /* 375 */ "nmnum ::= ON",
158691 /* 376 */ "nmnum ::= DELETE",
158692 /* 377 */ "nmnum ::= DEFAULT",
158693 /* 378 */ "plus_num ::= INTEGER|FLOAT",
158694 /* 379 */ "foreach_clause ::=",
158695 /* 380 */ "foreach_clause ::= FOR EACH ROW",
158696 /* 381 */ "trnm ::= nm",
158697 /* 382 */ "tridxby ::=",
158698 /* 383 */ "database_kw_opt ::= DATABASE",
158699 /* 384 */ "database_kw_opt ::=",
158700 /* 385 */ "kwcolumn_opt ::=",
158701 /* 386 */ "kwcolumn_opt ::= COLUMNKW",
158702 /* 387 */ "vtabarglist ::= vtabarg",
158703 /* 388 */ "vtabarglist ::= vtabarglist COMMA vtabarg",
158704 /* 389 */ "vtabarg ::= vtabarg vtabargtoken",
158705 /* 390 */ "anylist ::=",
158706 /* 391 */ "anylist ::= anylist LP anylist RP",
158707 /* 392 */ "anylist ::= anylist ANY",
158708 /* 393 */ "with ::=",
 
 
 
 
158709 };
158710 #endif /* NDEBUG */
158711
158712
158713 #if YYSTACKDEPTH<=0
@@ -158829,103 +159008,103 @@
158829 ** Note: during a reduce, the only symbols destroyed are those
158830 ** which appear on the RHS of the rule, but which are *not* used
158831 ** inside the C code.
158832 */
158833 /********* Begin destructor definitions ***************************************/
158834 case 201: /* select */
158835 case 235: /* selectnowith */
158836 case 236: /* oneselect */
158837 case 248: /* values */
158838 {
158839 sqlite3SelectDelete(pParse->db, (yypminor->yy293));
158840 }
158841 break;
158842 case 212: /* term */
158843 case 213: /* expr */
158844 case 242: /* where_opt */
158845 case 244: /* having_opt */
158846 case 256: /* on_opt */
158847 case 263: /* where_opt_ret */
158848 case 274: /* case_operand */
158849 case 276: /* case_else */
158850 case 279: /* vinto */
158851 case 286: /* when_clause */
158852 case 291: /* key_opt */
158853 case 305: /* filter_clause */
158854 {
158855 sqlite3ExprDelete(pParse->db, (yypminor->yy354));
158856 }
158857 break;
158858 case 217: /* eidlist_opt */
158859 case 227: /* sortlist */
158860 case 228: /* eidlist */
158861 case 240: /* selcollist */
158862 case 243: /* groupby_opt */
158863 case 245: /* orderby_opt */
158864 case 249: /* nexprlist */
158865 case 250: /* sclp */
158866 case 258: /* exprlist */
158867 case 264: /* setlist */
158868 case 273: /* paren_exprlist */
158869 case 275: /* case_exprlist */
158870 case 304: /* part_opt */
158871 {
158872 sqlite3ExprListDelete(pParse->db, (yypminor->yy350));
158873 }
158874 break;
158875 case 234: /* fullname */
158876 case 241: /* from */
158877 case 252: /* seltablist */
158878 case 253: /* stl_prefix */
158879 case 259: /* xfullname */
158880 {
158881 sqlite3SrcListDelete(pParse->db, (yypminor->yy457));
158882 }
158883 break;
158884 case 237: /* wqlist */
158885 {
158886 sqlite3WithDelete(pParse->db, (yypminor->yy105));
158887 }
158888 break;
158889 case 247: /* window_clause */
158890 case 300: /* windowdefn_list */
158891 {
158892 sqlite3WindowListDelete(pParse->db, (yypminor->yy503));
158893 }
158894 break;
158895 case 257: /* using_opt */
158896 case 260: /* idlist */
158897 case 266: /* idlist_opt */
158898 {
158899 sqlite3IdListDelete(pParse->db, (yypminor->yy498));
158900 }
158901 break;
158902 case 269: /* filter_over */
158903 case 301: /* windowdefn */
158904 case 302: /* window */
158905 case 303: /* frame_opt */
158906 case 306: /* over_clause */
158907 {
158908 sqlite3WindowDelete(pParse->db, (yypminor->yy503));
158909 }
158910 break;
158911 case 282: /* trigger_cmd_list */
158912 case 287: /* trigger_cmd */
158913 {
158914 sqlite3DeleteTriggerStep(pParse->db, (yypminor->yy51));
158915 }
158916 break;
158917 case 284: /* trigger_event */
158918 {
158919 sqlite3IdListDelete(pParse->db, (yypminor->yy298).b);
158920 }
158921 break;
158922 case 308: /* frame_bound */
158923 case 309: /* frame_bound_s */
158924 case 310: /* frame_bound_e */
158925 {
158926 sqlite3ExprDelete(pParse->db, (yypminor->yy341).pExpr);
158927 }
158928 break;
158929 /********* End destructor definitions *****************************************/
158930 default: break; /* If no destructor action specified: do nothing */
158931 }
@@ -159212,404 +159391,408 @@
159212 }
159213
159214 /* For rule J, yyRuleInfoLhs[J] contains the symbol on the left-hand side
159215 ** of that rule */
159216 static const YYCODETYPE yyRuleInfoLhs[] = {
159217 186, /* (0) explain ::= EXPLAIN */
159218 186, /* (1) explain ::= EXPLAIN QUERY PLAN */
159219 185, /* (2) cmdx ::= cmd */
159220 187, /* (3) cmd ::= BEGIN transtype trans_opt */
159221 188, /* (4) transtype ::= */
159222 188, /* (5) transtype ::= DEFERRED */
159223 188, /* (6) transtype ::= IMMEDIATE */
159224 188, /* (7) transtype ::= EXCLUSIVE */
159225 187, /* (8) cmd ::= COMMIT|END trans_opt */
159226 187, /* (9) cmd ::= ROLLBACK trans_opt */
159227 187, /* (10) cmd ::= SAVEPOINT nm */
159228 187, /* (11) cmd ::= RELEASE savepoint_opt nm */
159229 187, /* (12) cmd ::= ROLLBACK trans_opt TO savepoint_opt nm */
159230 192, /* (13) create_table ::= createkw temp TABLE ifnotexists nm dbnm */
159231 194, /* (14) createkw ::= CREATE */
159232 196, /* (15) ifnotexists ::= */
159233 196, /* (16) ifnotexists ::= IF NOT EXISTS */
159234 195, /* (17) temp ::= TEMP */
159235 195, /* (18) temp ::= */
159236 193, /* (19) create_table_args ::= LP columnlist conslist_opt RP table_options */
159237 193, /* (20) create_table_args ::= AS select */
159238 200, /* (21) table_options ::= */
159239 200, /* (22) table_options ::= WITHOUT nm */
159240 202, /* (23) columnname ::= nm typetoken */
159241 204, /* (24) typetoken ::= */
159242 204, /* (25) typetoken ::= typename LP signed RP */
159243 204, /* (26) typetoken ::= typename LP signed COMMA signed RP */
159244 205, /* (27) typename ::= typename ID|STRING */
159245 209, /* (28) scanpt ::= */
159246 210, /* (29) scantok ::= */
159247 211, /* (30) ccons ::= CONSTRAINT nm */
159248 211, /* (31) ccons ::= DEFAULT scantok term */
159249 211, /* (32) ccons ::= DEFAULT LP expr RP */
159250 211, /* (33) ccons ::= DEFAULT PLUS scantok term */
159251 211, /* (34) ccons ::= DEFAULT MINUS scantok term */
159252 211, /* (35) ccons ::= DEFAULT scantok ID|INDEXED */
159253 211, /* (36) ccons ::= NOT NULL onconf */
159254 211, /* (37) ccons ::= PRIMARY KEY sortorder onconf autoinc */
159255 211, /* (38) ccons ::= UNIQUE onconf */
159256 211, /* (39) ccons ::= CHECK LP expr RP */
159257 211, /* (40) ccons ::= REFERENCES nm eidlist_opt refargs */
159258 211, /* (41) ccons ::= defer_subclause */
159259 211, /* (42) ccons ::= COLLATE ID|STRING */
159260 220, /* (43) generated ::= LP expr RP */
159261 220, /* (44) generated ::= LP expr RP ID */
159262 216, /* (45) autoinc ::= */
159263 216, /* (46) autoinc ::= AUTOINCR */
159264 218, /* (47) refargs ::= */
159265 218, /* (48) refargs ::= refargs refarg */
159266 221, /* (49) refarg ::= MATCH nm */
159267 221, /* (50) refarg ::= ON INSERT refact */
159268 221, /* (51) refarg ::= ON DELETE refact */
159269 221, /* (52) refarg ::= ON UPDATE refact */
159270 222, /* (53) refact ::= SET NULL */
159271 222, /* (54) refact ::= SET DEFAULT */
159272 222, /* (55) refact ::= CASCADE */
159273 222, /* (56) refact ::= RESTRICT */
159274 222, /* (57) refact ::= NO ACTION */
159275 219, /* (58) defer_subclause ::= NOT DEFERRABLE init_deferred_pred_opt */
159276 219, /* (59) defer_subclause ::= DEFERRABLE init_deferred_pred_opt */
159277 223, /* (60) init_deferred_pred_opt ::= */
159278 223, /* (61) init_deferred_pred_opt ::= INITIALLY DEFERRED */
159279 223, /* (62) init_deferred_pred_opt ::= INITIALLY IMMEDIATE */
159280 199, /* (63) conslist_opt ::= */
159281 225, /* (64) tconscomma ::= COMMA */
159282 226, /* (65) tcons ::= CONSTRAINT nm */
159283 226, /* (66) tcons ::= PRIMARY KEY LP sortlist autoinc RP onconf */
159284 226, /* (67) tcons ::= UNIQUE LP sortlist RP onconf */
159285 226, /* (68) tcons ::= CHECK LP expr RP onconf */
159286 226, /* (69) tcons ::= FOREIGN KEY LP eidlist RP REFERENCES nm eidlist_opt refargs defer_subclause_opt */
159287 229, /* (70) defer_subclause_opt ::= */
159288 214, /* (71) onconf ::= */
159289 214, /* (72) onconf ::= ON CONFLICT resolvetype */
159290 230, /* (73) orconf ::= */
159291 230, /* (74) orconf ::= OR resolvetype */
159292 231, /* (75) resolvetype ::= IGNORE */
159293 231, /* (76) resolvetype ::= REPLACE */
159294 187, /* (77) cmd ::= DROP TABLE ifexists fullname */
159295 233, /* (78) ifexists ::= IF EXISTS */
159296 233, /* (79) ifexists ::= */
159297 187, /* (80) cmd ::= createkw temp VIEW ifnotexists nm dbnm eidlist_opt AS select */
159298 187, /* (81) cmd ::= DROP VIEW ifexists fullname */
159299 187, /* (82) cmd ::= select */
159300 201, /* (83) select ::= WITH wqlist selectnowith */
159301 201, /* (84) select ::= WITH RECURSIVE wqlist selectnowith */
159302 201, /* (85) select ::= selectnowith */
159303 235, /* (86) selectnowith ::= selectnowith multiselect_op oneselect */
159304 238, /* (87) multiselect_op ::= UNION */
159305 238, /* (88) multiselect_op ::= UNION ALL */
159306 238, /* (89) multiselect_op ::= EXCEPT|INTERSECT */
159307 236, /* (90) oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt orderby_opt limit_opt */
159308 236, /* (91) oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt window_clause orderby_opt limit_opt */
159309 248, /* (92) values ::= VALUES LP nexprlist RP */
159310 248, /* (93) values ::= values COMMA LP nexprlist RP */
159311 239, /* (94) distinct ::= DISTINCT */
159312 239, /* (95) distinct ::= ALL */
159313 239, /* (96) distinct ::= */
159314 250, /* (97) sclp ::= */
159315 240, /* (98) selcollist ::= sclp scanpt expr scanpt as */
159316 240, /* (99) selcollist ::= sclp scanpt STAR */
159317 240, /* (100) selcollist ::= sclp scanpt nm DOT STAR */
159318 251, /* (101) as ::= AS nm */
159319 251, /* (102) as ::= */
159320 241, /* (103) from ::= */
159321 241, /* (104) from ::= FROM seltablist */
159322 253, /* (105) stl_prefix ::= seltablist joinop */
159323 253, /* (106) stl_prefix ::= */
159324 252, /* (107) seltablist ::= stl_prefix nm dbnm as indexed_opt on_opt using_opt */
159325 252, /* (108) seltablist ::= stl_prefix nm dbnm LP exprlist RP as on_opt using_opt */
159326 252, /* (109) seltablist ::= stl_prefix LP select RP as on_opt using_opt */
159327 252, /* (110) seltablist ::= stl_prefix LP seltablist RP as on_opt using_opt */
159328 197, /* (111) dbnm ::= */
159329 197, /* (112) dbnm ::= DOT nm */
159330 234, /* (113) fullname ::= nm */
159331 234, /* (114) fullname ::= nm DOT nm */
159332 259, /* (115) xfullname ::= nm */
159333 259, /* (116) xfullname ::= nm DOT nm */
159334 259, /* (117) xfullname ::= nm DOT nm AS nm */
159335 259, /* (118) xfullname ::= nm AS nm */
159336 254, /* (119) joinop ::= COMMA|JOIN */
159337 254, /* (120) joinop ::= JOIN_KW JOIN */
159338 254, /* (121) joinop ::= JOIN_KW nm JOIN */
159339 254, /* (122) joinop ::= JOIN_KW nm nm JOIN */
159340 256, /* (123) on_opt ::= ON expr */
159341 256, /* (124) on_opt ::= */
159342 255, /* (125) indexed_opt ::= */
159343 255, /* (126) indexed_opt ::= INDEXED BY nm */
159344 255, /* (127) indexed_opt ::= NOT INDEXED */
159345 257, /* (128) using_opt ::= USING LP idlist RP */
159346 257, /* (129) using_opt ::= */
159347 245, /* (130) orderby_opt ::= */
159348 245, /* (131) orderby_opt ::= ORDER BY sortlist */
159349 227, /* (132) sortlist ::= sortlist COMMA expr sortorder nulls */
159350 227, /* (133) sortlist ::= expr sortorder nulls */
159351 215, /* (134) sortorder ::= ASC */
159352 215, /* (135) sortorder ::= DESC */
159353 215, /* (136) sortorder ::= */
159354 261, /* (137) nulls ::= NULLS FIRST */
159355 261, /* (138) nulls ::= NULLS LAST */
159356 261, /* (139) nulls ::= */
159357 243, /* (140) groupby_opt ::= */
159358 243, /* (141) groupby_opt ::= GROUP BY nexprlist */
159359 244, /* (142) having_opt ::= */
159360 244, /* (143) having_opt ::= HAVING expr */
159361 246, /* (144) limit_opt ::= */
159362 246, /* (145) limit_opt ::= LIMIT expr */
159363 246, /* (146) limit_opt ::= LIMIT expr OFFSET expr */
159364 246, /* (147) limit_opt ::= LIMIT expr COMMA expr */
159365 187, /* (148) cmd ::= with DELETE FROM xfullname indexed_opt where_opt_ret */
159366 242, /* (149) where_opt ::= */
159367 242, /* (150) where_opt ::= WHERE expr */
159368 263, /* (151) where_opt_ret ::= */
159369 263, /* (152) where_opt_ret ::= WHERE expr */
159370 263, /* (153) where_opt_ret ::= RETURNING selcollist */
159371 263, /* (154) where_opt_ret ::= WHERE expr RETURNING selcollist */
159372 187, /* (155) cmd ::= with UPDATE orconf xfullname indexed_opt SET setlist from where_opt_ret */
159373 264, /* (156) setlist ::= setlist COMMA nm EQ expr */
159374 264, /* (157) setlist ::= setlist COMMA LP idlist RP EQ expr */
159375 264, /* (158) setlist ::= nm EQ expr */
159376 264, /* (159) setlist ::= LP idlist RP EQ expr */
159377 187, /* (160) cmd ::= with insert_cmd INTO xfullname idlist_opt select upsert */
159378 187, /* (161) cmd ::= with insert_cmd INTO xfullname idlist_opt DEFAULT VALUES returning */
159379 267, /* (162) upsert ::= */
159380 267, /* (163) upsert ::= RETURNING selcollist */
159381 267, /* (164) upsert ::= ON CONFLICT LP sortlist RP where_opt DO UPDATE SET setlist where_opt upsert */
159382 267, /* (165) upsert ::= ON CONFLICT LP sortlist RP where_opt DO NOTHING upsert */
159383 267, /* (166) upsert ::= ON CONFLICT DO NOTHING returning */
159384 267, /* (167) upsert ::= ON CONFLICT DO UPDATE SET setlist where_opt returning */
159385 268, /* (168) returning ::= RETURNING selcollist */
159386 265, /* (169) insert_cmd ::= INSERT orconf */
159387 265, /* (170) insert_cmd ::= REPLACE */
159388 266, /* (171) idlist_opt ::= */
159389 266, /* (172) idlist_opt ::= LP idlist RP */
159390 260, /* (173) idlist ::= idlist COMMA nm */
159391 260, /* (174) idlist ::= nm */
159392 213, /* (175) expr ::= LP expr RP */
159393 213, /* (176) expr ::= ID|INDEXED */
159394 213, /* (177) expr ::= JOIN_KW */
159395 213, /* (178) expr ::= nm DOT nm */
159396 213, /* (179) expr ::= nm DOT nm DOT nm */
159397 212, /* (180) term ::= NULL|FLOAT|BLOB */
159398 212, /* (181) term ::= STRING */
159399 212, /* (182) term ::= INTEGER */
159400 213, /* (183) expr ::= VARIABLE */
159401 213, /* (184) expr ::= expr COLLATE ID|STRING */
159402 213, /* (185) expr ::= CAST LP expr AS typetoken RP */
159403 213, /* (186) expr ::= ID|INDEXED LP distinct exprlist RP */
159404 213, /* (187) expr ::= ID|INDEXED LP STAR RP */
159405 213, /* (188) expr ::= ID|INDEXED LP distinct exprlist RP filter_over */
159406 213, /* (189) expr ::= ID|INDEXED LP STAR RP filter_over */
159407 212, /* (190) term ::= CTIME_KW */
159408 213, /* (191) expr ::= LP nexprlist COMMA expr RP */
159409 213, /* (192) expr ::= expr AND expr */
159410 213, /* (193) expr ::= expr OR expr */
159411 213, /* (194) expr ::= expr LT|GT|GE|LE expr */
159412 213, /* (195) expr ::= expr EQ|NE expr */
159413 213, /* (196) expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr */
159414 213, /* (197) expr ::= expr PLUS|MINUS expr */
159415 213, /* (198) expr ::= expr STAR|SLASH|REM expr */
159416 213, /* (199) expr ::= expr CONCAT expr */
159417 270, /* (200) likeop ::= NOT LIKE_KW|MATCH */
159418 213, /* (201) expr ::= expr likeop expr */
159419 213, /* (202) expr ::= expr likeop expr ESCAPE expr */
159420 213, /* (203) expr ::= expr ISNULL|NOTNULL */
159421 213, /* (204) expr ::= expr NOT NULL */
159422 213, /* (205) expr ::= expr IS expr */
159423 213, /* (206) expr ::= expr IS NOT expr */
159424 213, /* (207) expr ::= NOT expr */
159425 213, /* (208) expr ::= BITNOT expr */
159426 213, /* (209) expr ::= PLUS|MINUS expr */
159427 271, /* (210) between_op ::= BETWEEN */
159428 271, /* (211) between_op ::= NOT BETWEEN */
159429 213, /* (212) expr ::= expr between_op expr AND expr */
159430 272, /* (213) in_op ::= IN */
159431 272, /* (214) in_op ::= NOT IN */
159432 213, /* (215) expr ::= expr in_op LP exprlist RP */
159433 213, /* (216) expr ::= LP select RP */
159434 213, /* (217) expr ::= expr in_op LP select RP */
159435 213, /* (218) expr ::= expr in_op nm dbnm paren_exprlist */
159436 213, /* (219) expr ::= EXISTS LP select RP */
159437 213, /* (220) expr ::= CASE case_operand case_exprlist case_else END */
159438 275, /* (221) case_exprlist ::= case_exprlist WHEN expr THEN expr */
159439 275, /* (222) case_exprlist ::= WHEN expr THEN expr */
159440 276, /* (223) case_else ::= ELSE expr */
159441 276, /* (224) case_else ::= */
159442 274, /* (225) case_operand ::= expr */
159443 274, /* (226) case_operand ::= */
159444 258, /* (227) exprlist ::= */
159445 249, /* (228) nexprlist ::= nexprlist COMMA expr */
159446 249, /* (229) nexprlist ::= expr */
159447 273, /* (230) paren_exprlist ::= */
159448 273, /* (231) paren_exprlist ::= LP exprlist RP */
159449 187, /* (232) cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP sortlist RP where_opt */
159450 277, /* (233) uniqueflag ::= UNIQUE */
159451 277, /* (234) uniqueflag ::= */
159452 217, /* (235) eidlist_opt ::= */
159453 217, /* (236) eidlist_opt ::= LP eidlist RP */
159454 228, /* (237) eidlist ::= eidlist COMMA nm collate sortorder */
159455 228, /* (238) eidlist ::= nm collate sortorder */
159456 278, /* (239) collate ::= */
159457 278, /* (240) collate ::= COLLATE ID|STRING */
159458 187, /* (241) cmd ::= DROP INDEX ifexists fullname */
159459 187, /* (242) cmd ::= VACUUM vinto */
159460 187, /* (243) cmd ::= VACUUM nm vinto */
159461 279, /* (244) vinto ::= INTO expr */
159462 279, /* (245) vinto ::= */
159463 187, /* (246) cmd ::= PRAGMA nm dbnm */
159464 187, /* (247) cmd ::= PRAGMA nm dbnm EQ nmnum */
159465 187, /* (248) cmd ::= PRAGMA nm dbnm LP nmnum RP */
159466 187, /* (249) cmd ::= PRAGMA nm dbnm EQ minus_num */
159467 187, /* (250) cmd ::= PRAGMA nm dbnm LP minus_num RP */
159468 207, /* (251) plus_num ::= PLUS INTEGER|FLOAT */
159469 208, /* (252) minus_num ::= MINUS INTEGER|FLOAT */
159470 187, /* (253) cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END */
159471 281, /* (254) trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause */
159472 283, /* (255) trigger_time ::= BEFORE|AFTER */
159473 283, /* (256) trigger_time ::= INSTEAD OF */
159474 283, /* (257) trigger_time ::= */
159475 284, /* (258) trigger_event ::= DELETE|INSERT */
159476 284, /* (259) trigger_event ::= UPDATE */
159477 284, /* (260) trigger_event ::= UPDATE OF idlist */
159478 286, /* (261) when_clause ::= */
159479 286, /* (262) when_clause ::= WHEN expr */
159480 282, /* (263) trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI */
159481 282, /* (264) trigger_cmd_list ::= trigger_cmd SEMI */
159482 288, /* (265) trnm ::= nm DOT nm */
159483 289, /* (266) tridxby ::= INDEXED BY nm */
159484 289, /* (267) tridxby ::= NOT INDEXED */
159485 287, /* (268) trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist from where_opt scanpt */
159486 287, /* (269) trigger_cmd ::= scanpt insert_cmd INTO trnm idlist_opt select upsert scanpt */
159487 287, /* (270) trigger_cmd ::= DELETE FROM trnm tridxby where_opt scanpt */
159488 287, /* (271) trigger_cmd ::= scanpt select scanpt */
159489 213, /* (272) expr ::= RAISE LP IGNORE RP */
159490 213, /* (273) expr ::= RAISE LP raisetype COMMA nm RP */
159491 232, /* (274) raisetype ::= ROLLBACK */
159492 232, /* (275) raisetype ::= ABORT */
159493 232, /* (276) raisetype ::= FAIL */
159494 187, /* (277) cmd ::= DROP TRIGGER ifexists fullname */
159495 187, /* (278) cmd ::= ATTACH database_kw_opt expr AS expr key_opt */
159496 187, /* (279) cmd ::= DETACH database_kw_opt expr */
159497 291, /* (280) key_opt ::= */
159498 291, /* (281) key_opt ::= KEY expr */
159499 187, /* (282) cmd ::= REINDEX */
159500 187, /* (283) cmd ::= REINDEX nm dbnm */
159501 187, /* (284) cmd ::= ANALYZE */
159502 187, /* (285) cmd ::= ANALYZE nm dbnm */
159503 187, /* (286) cmd ::= ALTER TABLE fullname RENAME TO nm */
159504 187, /* (287) cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt columnname carglist */
159505 187, /* (288) cmd ::= ALTER TABLE fullname DROP kwcolumn_opt nm */
159506 292, /* (289) add_column_fullname ::= fullname */
159507 187, /* (290) cmd ::= ALTER TABLE fullname RENAME kwcolumn_opt nm TO nm */
159508 187, /* (291) cmd ::= create_vtab */
159509 187, /* (292) cmd ::= create_vtab LP vtabarglist RP */
159510 294, /* (293) create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm */
159511 296, /* (294) vtabarg ::= */
159512 297, /* (295) vtabargtoken ::= ANY */
159513 297, /* (296) vtabargtoken ::= lp anylist RP */
159514 298, /* (297) lp ::= LP */
159515 262, /* (298) with ::= WITH wqlist */
159516 262, /* (299) with ::= WITH RECURSIVE wqlist */
159517 237, /* (300) wqlist ::= nm eidlist_opt AS LP select RP */
159518 237, /* (301) wqlist ::= wqlist COMMA nm eidlist_opt AS LP select RP */
159519 300, /* (302) windowdefn_list ::= windowdefn */
159520 300, /* (303) windowdefn_list ::= windowdefn_list COMMA windowdefn */
159521 301, /* (304) windowdefn ::= nm AS LP window RP */
159522 302, /* (305) window ::= PARTITION BY nexprlist orderby_opt frame_opt */
159523 302, /* (306) window ::= nm PARTITION BY nexprlist orderby_opt frame_opt */
159524 302, /* (307) window ::= ORDER BY sortlist frame_opt */
159525 302, /* (308) window ::= nm ORDER BY sortlist frame_opt */
159526 302, /* (309) window ::= frame_opt */
159527 302, /* (310) window ::= nm frame_opt */
159528 303, /* (311) frame_opt ::= */
159529 303, /* (312) frame_opt ::= range_or_rows frame_bound_s frame_exclude_opt */
159530 303, /* (313) frame_opt ::= range_or_rows BETWEEN frame_bound_s AND frame_bound_e frame_exclude_opt */
159531 307, /* (314) range_or_rows ::= RANGE|ROWS|GROUPS */
159532 309, /* (315) frame_bound_s ::= frame_bound */
159533 309, /* (316) frame_bound_s ::= UNBOUNDED PRECEDING */
159534 310, /* (317) frame_bound_e ::= frame_bound */
159535 310, /* (318) frame_bound_e ::= UNBOUNDED FOLLOWING */
159536 308, /* (319) frame_bound ::= expr PRECEDING|FOLLOWING */
159537 308, /* (320) frame_bound ::= CURRENT ROW */
159538 311, /* (321) frame_exclude_opt ::= */
159539 311, /* (322) frame_exclude_opt ::= EXCLUDE frame_exclude */
159540 312, /* (323) frame_exclude ::= NO OTHERS */
159541 312, /* (324) frame_exclude ::= CURRENT ROW */
159542 312, /* (325) frame_exclude ::= GROUP|TIES */
159543 247, /* (326) window_clause ::= WINDOW windowdefn_list */
159544 269, /* (327) filter_over ::= filter_clause over_clause */
159545 269, /* (328) filter_over ::= over_clause */
159546 269, /* (329) filter_over ::= filter_clause */
159547 306, /* (330) over_clause ::= OVER LP window RP */
159548 306, /* (331) over_clause ::= OVER nm */
159549 305, /* (332) filter_clause ::= FILTER LP WHERE expr RP */
159550 182, /* (333) input ::= cmdlist */
159551 183, /* (334) cmdlist ::= cmdlist ecmd */
159552 183, /* (335) cmdlist ::= ecmd */
159553 184, /* (336) ecmd ::= SEMI */
159554 184, /* (337) ecmd ::= cmdx SEMI */
159555 184, /* (338) ecmd ::= explain cmdx SEMI */
159556 189, /* (339) trans_opt ::= */
159557 189, /* (340) trans_opt ::= TRANSACTION */
159558 189, /* (341) trans_opt ::= TRANSACTION nm */
159559 191, /* (342) savepoint_opt ::= SAVEPOINT */
159560 191, /* (343) savepoint_opt ::= */
159561 187, /* (344) cmd ::= create_table create_table_args */
159562 198, /* (345) columnlist ::= columnlist COMMA columnname carglist */
159563 198, /* (346) columnlist ::= columnname carglist */
159564 190, /* (347) nm ::= ID|INDEXED */
159565 190, /* (348) nm ::= STRING */
159566 190, /* (349) nm ::= JOIN_KW */
159567 204, /* (350) typetoken ::= typename */
159568 205, /* (351) typename ::= ID|STRING */
159569 206, /* (352) signed ::= plus_num */
159570 206, /* (353) signed ::= minus_num */
159571 203, /* (354) carglist ::= carglist ccons */
159572 203, /* (355) carglist ::= */
159573 211, /* (356) ccons ::= NULL onconf */
159574 211, /* (357) ccons ::= GENERATED ALWAYS AS generated */
159575 211, /* (358) ccons ::= AS generated */
159576 199, /* (359) conslist_opt ::= COMMA conslist */
159577 224, /* (360) conslist ::= conslist tconscomma tcons */
159578 224, /* (361) conslist ::= tcons */
159579 225, /* (362) tconscomma ::= */
159580 229, /* (363) defer_subclause_opt ::= defer_subclause */
159581 231, /* (364) resolvetype ::= raisetype */
159582 235, /* (365) selectnowith ::= oneselect */
159583 236, /* (366) oneselect ::= values */
159584 250, /* (367) sclp ::= selcollist COMMA */
159585 251, /* (368) as ::= ID|STRING */
159586 268, /* (369) returning ::= */
159587 213, /* (370) expr ::= term */
159588 270, /* (371) likeop ::= LIKE_KW|MATCH */
159589 258, /* (372) exprlist ::= nexprlist */
159590 280, /* (373) nmnum ::= plus_num */
159591 280, /* (374) nmnum ::= nm */
159592 280, /* (375) nmnum ::= ON */
159593 280, /* (376) nmnum ::= DELETE */
159594 280, /* (377) nmnum ::= DEFAULT */
159595 207, /* (378) plus_num ::= INTEGER|FLOAT */
159596 285, /* (379) foreach_clause ::= */
159597 285, /* (380) foreach_clause ::= FOR EACH ROW */
159598 288, /* (381) trnm ::= nm */
159599 289, /* (382) tridxby ::= */
159600 290, /* (383) database_kw_opt ::= DATABASE */
159601 290, /* (384) database_kw_opt ::= */
159602 293, /* (385) kwcolumn_opt ::= */
159603 293, /* (386) kwcolumn_opt ::= COLUMNKW */
159604 295, /* (387) vtabarglist ::= vtabarg */
159605 295, /* (388) vtabarglist ::= vtabarglist COMMA vtabarg */
159606 296, /* (389) vtabarg ::= vtabarg vtabargtoken */
159607 299, /* (390) anylist ::= */
159608 299, /* (391) anylist ::= anylist LP anylist RP */
159609 299, /* (392) anylist ::= anylist ANY */
159610 262, /* (393) with ::= */
 
 
 
 
159611 };
159612
159613 /* For rule J, yyRuleInfoNRhs[J] contains the negative of the number
159614 ** of symbols on the right-hand side of that rule. */
159615 static const signed char yyRuleInfoNRhs[] = {
@@ -159911,104 +160094,108 @@
159911 -1, /* (295) vtabargtoken ::= ANY */
159912 -3, /* (296) vtabargtoken ::= lp anylist RP */
159913 -1, /* (297) lp ::= LP */
159914 -2, /* (298) with ::= WITH wqlist */
159915 -3, /* (299) with ::= WITH RECURSIVE wqlist */
159916 -6, /* (300) wqlist ::= nm eidlist_opt AS LP select RP */
159917 -8, /* (301) wqlist ::= wqlist COMMA nm eidlist_opt AS LP select RP */
159918 -1, /* (302) windowdefn_list ::= windowdefn */
159919 -3, /* (303) windowdefn_list ::= windowdefn_list COMMA windowdefn */
159920 -5, /* (304) windowdefn ::= nm AS LP window RP */
159921 -5, /* (305) window ::= PARTITION BY nexprlist orderby_opt frame_opt */
159922 -6, /* (306) window ::= nm PARTITION BY nexprlist orderby_opt frame_opt */
159923 -4, /* (307) window ::= ORDER BY sortlist frame_opt */
159924 -5, /* (308) window ::= nm ORDER BY sortlist frame_opt */
159925 -1, /* (309) window ::= frame_opt */
159926 -2, /* (310) window ::= nm frame_opt */
159927 0, /* (311) frame_opt ::= */
159928 -3, /* (312) frame_opt ::= range_or_rows frame_bound_s frame_exclude_opt */
159929 -6, /* (313) frame_opt ::= range_or_rows BETWEEN frame_bound_s AND frame_bound_e frame_exclude_opt */
159930 -1, /* (314) range_or_rows ::= RANGE|ROWS|GROUPS */
159931 -1, /* (315) frame_bound_s ::= frame_bound */
159932 -2, /* (316) frame_bound_s ::= UNBOUNDED PRECEDING */
159933 -1, /* (317) frame_bound_e ::= frame_bound */
159934 -2, /* (318) frame_bound_e ::= UNBOUNDED FOLLOWING */
159935 -2, /* (319) frame_bound ::= expr PRECEDING|FOLLOWING */
159936 -2, /* (320) frame_bound ::= CURRENT ROW */
159937 0, /* (321) frame_exclude_opt ::= */
159938 -2, /* (322) frame_exclude_opt ::= EXCLUDE frame_exclude */
159939 -2, /* (323) frame_exclude ::= NO OTHERS */
159940 -2, /* (324) frame_exclude ::= CURRENT ROW */
159941 -1, /* (325) frame_exclude ::= GROUP|TIES */
159942 -2, /* (326) window_clause ::= WINDOW windowdefn_list */
159943 -2, /* (327) filter_over ::= filter_clause over_clause */
159944 -1, /* (328) filter_over ::= over_clause */
159945 -1, /* (329) filter_over ::= filter_clause */
159946 -4, /* (330) over_clause ::= OVER LP window RP */
159947 -2, /* (331) over_clause ::= OVER nm */
159948 -5, /* (332) filter_clause ::= FILTER LP WHERE expr RP */
159949 -1, /* (333) input ::= cmdlist */
159950 -2, /* (334) cmdlist ::= cmdlist ecmd */
159951 -1, /* (335) cmdlist ::= ecmd */
159952 -1, /* (336) ecmd ::= SEMI */
159953 -2, /* (337) ecmd ::= cmdx SEMI */
159954 -3, /* (338) ecmd ::= explain cmdx SEMI */
159955 0, /* (339) trans_opt ::= */
159956 -1, /* (340) trans_opt ::= TRANSACTION */
159957 -2, /* (341) trans_opt ::= TRANSACTION nm */
159958 -1, /* (342) savepoint_opt ::= SAVEPOINT */
159959 0, /* (343) savepoint_opt ::= */
159960 -2, /* (344) cmd ::= create_table create_table_args */
159961 -4, /* (345) columnlist ::= columnlist COMMA columnname carglist */
159962 -2, /* (346) columnlist ::= columnname carglist */
159963 -1, /* (347) nm ::= ID|INDEXED */
159964 -1, /* (348) nm ::= STRING */
159965 -1, /* (349) nm ::= JOIN_KW */
159966 -1, /* (350) typetoken ::= typename */
159967 -1, /* (351) typename ::= ID|STRING */
159968 -1, /* (352) signed ::= plus_num */
159969 -1, /* (353) signed ::= minus_num */
159970 -2, /* (354) carglist ::= carglist ccons */
159971 0, /* (355) carglist ::= */
159972 -2, /* (356) ccons ::= NULL onconf */
159973 -4, /* (357) ccons ::= GENERATED ALWAYS AS generated */
159974 -2, /* (358) ccons ::= AS generated */
159975 -2, /* (359) conslist_opt ::= COMMA conslist */
159976 -3, /* (360) conslist ::= conslist tconscomma tcons */
159977 -1, /* (361) conslist ::= tcons */
159978 0, /* (362) tconscomma ::= */
159979 -1, /* (363) defer_subclause_opt ::= defer_subclause */
159980 -1, /* (364) resolvetype ::= raisetype */
159981 -1, /* (365) selectnowith ::= oneselect */
159982 -1, /* (366) oneselect ::= values */
159983 -2, /* (367) sclp ::= selcollist COMMA */
159984 -1, /* (368) as ::= ID|STRING */
159985 0, /* (369) returning ::= */
159986 -1, /* (370) expr ::= term */
159987 -1, /* (371) likeop ::= LIKE_KW|MATCH */
159988 -1, /* (372) exprlist ::= nexprlist */
159989 -1, /* (373) nmnum ::= plus_num */
159990 -1, /* (374) nmnum ::= nm */
159991 -1, /* (375) nmnum ::= ON */
159992 -1, /* (376) nmnum ::= DELETE */
159993 -1, /* (377) nmnum ::= DEFAULT */
159994 -1, /* (378) plus_num ::= INTEGER|FLOAT */
159995 0, /* (379) foreach_clause ::= */
159996 -3, /* (380) foreach_clause ::= FOR EACH ROW */
159997 -1, /* (381) trnm ::= nm */
159998 0, /* (382) tridxby ::= */
159999 -1, /* (383) database_kw_opt ::= DATABASE */
160000 0, /* (384) database_kw_opt ::= */
160001 0, /* (385) kwcolumn_opt ::= */
160002 -1, /* (386) kwcolumn_opt ::= COLUMNKW */
160003 -1, /* (387) vtabarglist ::= vtabarg */
160004 -3, /* (388) vtabarglist ::= vtabarglist COMMA vtabarg */
160005 -2, /* (389) vtabarg ::= vtabarg vtabargtoken */
160006 0, /* (390) anylist ::= */
160007 -4, /* (391) anylist ::= anylist LP anylist RP */
160008 -2, /* (392) anylist ::= anylist ANY */
160009 0, /* (393) with ::= */
 
 
 
 
160010 };
160011
160012 static void yy_accept(yyParser*); /* Forward Declaration */
160013
160014 /*
@@ -160056,20 +160243,20 @@
160056 break;
160057 case 2: /* cmdx ::= cmd */
160058 { sqlite3FinishCoding(pParse); }
160059 break;
160060 case 3: /* cmd ::= BEGIN transtype trans_opt */
160061 {sqlite3BeginTransaction(pParse, yymsp[-1].minor.yy412);}
160062 break;
160063 case 4: /* transtype ::= */
160064 {yymsp[1].minor.yy412 = TK_DEFERRED;}
160065 break;
160066 case 5: /* transtype ::= DEFERRED */
160067 case 6: /* transtype ::= IMMEDIATE */ yytestcase(yyruleno==6);
160068 case 7: /* transtype ::= EXCLUSIVE */ yytestcase(yyruleno==7);
160069 case 314: /* range_or_rows ::= RANGE|ROWS|GROUPS */ yytestcase(yyruleno==314);
160070 {yymsp[0].minor.yy412 = yymsp[0].major; /*A-overwrites-X*/}
160071 break;
160072 case 8: /* cmd ::= COMMIT|END trans_opt */
160073 case 9: /* cmd ::= ROLLBACK trans_opt */ yytestcase(yyruleno==9);
160074 {sqlite3EndTransaction(pParse,yymsp[-1].major);}
160075 break;
@@ -160088,11 +160275,11 @@
160088 sqlite3Savepoint(pParse, SAVEPOINT_ROLLBACK, &yymsp[0].minor.yy0);
160089 }
160090 break;
160091 case 13: /* create_table ::= createkw temp TABLE ifnotexists nm dbnm */
160092 {
160093 sqlite3StartTable(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,yymsp[-4].minor.yy412,0,0,yymsp[-2].minor.yy412);
160094 }
160095 break;
160096 case 14: /* createkw ::= CREATE */
160097 {disableLookaside(pParse);}
160098 break;
@@ -160103,36 +160290,36 @@
160103 case 60: /* init_deferred_pred_opt ::= */ yytestcase(yyruleno==60);
160104 case 70: /* defer_subclause_opt ::= */ yytestcase(yyruleno==70);
160105 case 79: /* ifexists ::= */ yytestcase(yyruleno==79);
160106 case 96: /* distinct ::= */ yytestcase(yyruleno==96);
160107 case 239: /* collate ::= */ yytestcase(yyruleno==239);
160108 {yymsp[1].minor.yy412 = 0;}
160109 break;
160110 case 16: /* ifnotexists ::= IF NOT EXISTS */
160111 {yymsp[-2].minor.yy412 = 1;}
160112 break;
160113 case 17: /* temp ::= TEMP */
160114 case 46: /* autoinc ::= AUTOINCR */ yytestcase(yyruleno==46);
160115 {yymsp[0].minor.yy412 = 1;}
160116 break;
160117 case 19: /* create_table_args ::= LP columnlist conslist_opt RP table_options */
160118 {
160119 sqlite3EndTable(pParse,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0,yymsp[0].minor.yy412,0);
160120 }
160121 break;
160122 case 20: /* create_table_args ::= AS select */
160123 {
160124 sqlite3EndTable(pParse,0,0,0,yymsp[0].minor.yy293);
160125 sqlite3SelectDelete(pParse->db, yymsp[0].minor.yy293);
160126 }
160127 break;
160128 case 22: /* table_options ::= WITHOUT nm */
160129 {
160130 if( yymsp[0].minor.yy0.n==5 && sqlite3_strnicmp(yymsp[0].minor.yy0.z,"rowid",5)==0 ){
160131 yymsp[-1].minor.yy412 = TF_WithoutRowid | TF_NoVisibleRowid;
160132 }else{
160133 yymsp[-1].minor.yy412 = 0;
160134 sqlite3ErrorMsg(pParse, "unknown table option: %.*s", yymsp[0].minor.yy0.n, yymsp[0].minor.yy0.z);
160135 }
160136 }
160137 break;
160138 case 23: /* columnname ::= nm typetoken */
@@ -160157,11 +160344,11 @@
160157 {yymsp[-1].minor.yy0.n=yymsp[0].minor.yy0.n+(int)(yymsp[0].minor.yy0.z-yymsp[-1].minor.yy0.z);}
160158 break;
160159 case 28: /* scanpt ::= */
160160 {
160161 assert( yyLookahead!=YYNOCODE );
160162 yymsp[1].minor.yy504 = yyLookaheadToken.z;
160163 }
160164 break;
160165 case 29: /* scantok ::= */
160166 {
160167 assert( yyLookahead!=YYNOCODE );
@@ -160171,21 +160358,21 @@
160171 case 30: /* ccons ::= CONSTRAINT nm */
160172 case 65: /* tcons ::= CONSTRAINT nm */ yytestcase(yyruleno==65);
160173 {pParse->constraintName = yymsp[0].minor.yy0;}
160174 break;
160175 case 31: /* ccons ::= DEFAULT scantok term */
160176 {sqlite3AddDefaultValue(pParse,yymsp[0].minor.yy354,yymsp[-1].minor.yy0.z,&yymsp[-1].minor.yy0.z[yymsp[-1].minor.yy0.n]);}
160177 break;
160178 case 32: /* ccons ::= DEFAULT LP expr RP */
160179 {sqlite3AddDefaultValue(pParse,yymsp[-1].minor.yy354,yymsp[-2].minor.yy0.z+1,yymsp[0].minor.yy0.z);}
160180 break;
160181 case 33: /* ccons ::= DEFAULT PLUS scantok term */
160182 {sqlite3AddDefaultValue(pParse,yymsp[0].minor.yy354,yymsp[-2].minor.yy0.z,&yymsp[-1].minor.yy0.z[yymsp[-1].minor.yy0.n]);}
160183 break;
160184 case 34: /* ccons ::= DEFAULT MINUS scantok term */
160185 {
160186 Expr *p = sqlite3PExpr(pParse, TK_UMINUS, yymsp[0].minor.yy354, 0);
160187 sqlite3AddDefaultValue(pParse,p,yymsp[-2].minor.yy0.z,&yymsp[-1].minor.yy0.z[yymsp[-1].minor.yy0.n]);
160188 }
160189 break;
160190 case 35: /* ccons ::= DEFAULT scantok ID|INDEXED */
160191 {
@@ -160196,274 +160383,256 @@
160196 }
160197 sqlite3AddDefaultValue(pParse,p,yymsp[0].minor.yy0.z,yymsp[0].minor.yy0.z+yymsp[0].minor.yy0.n);
160198 }
160199 break;
160200 case 36: /* ccons ::= NOT NULL onconf */
160201 {sqlite3AddNotNull(pParse, yymsp[0].minor.yy412);}
160202 break;
160203 case 37: /* ccons ::= PRIMARY KEY sortorder onconf autoinc */
160204 {sqlite3AddPrimaryKey(pParse,0,yymsp[-1].minor.yy412,yymsp[0].minor.yy412,yymsp[-2].minor.yy412);}
160205 break;
160206 case 38: /* ccons ::= UNIQUE onconf */
160207 {sqlite3CreateIndex(pParse,0,0,0,0,yymsp[0].minor.yy412,0,0,0,0,
160208 SQLITE_IDXTYPE_UNIQUE);}
160209 break;
160210 case 39: /* ccons ::= CHECK LP expr RP */
160211 {sqlite3AddCheckConstraint(pParse,yymsp[-1].minor.yy354,yymsp[-2].minor.yy0.z,yymsp[0].minor.yy0.z);}
160212 break;
160213 case 40: /* ccons ::= REFERENCES nm eidlist_opt refargs */
160214 {sqlite3CreateForeignKey(pParse,0,&yymsp[-2].minor.yy0,yymsp[-1].minor.yy350,yymsp[0].minor.yy412);}
160215 break;
160216 case 41: /* ccons ::= defer_subclause */
160217 {sqlite3DeferForeignKey(pParse,yymsp[0].minor.yy412);}
160218 break;
160219 case 42: /* ccons ::= COLLATE ID|STRING */
160220 {sqlite3AddCollateType(pParse, &yymsp[0].minor.yy0);}
160221 break;
160222 case 43: /* generated ::= LP expr RP */
160223 {sqlite3AddGenerated(pParse,yymsp[-1].minor.yy354,0);}
160224 break;
160225 case 44: /* generated ::= LP expr RP ID */
160226 {sqlite3AddGenerated(pParse,yymsp[-2].minor.yy354,&yymsp[0].minor.yy0);}
160227 break;
160228 case 47: /* refargs ::= */
160229 { yymsp[1].minor.yy412 = OE_None*0x0101; /* EV: R-19803-45884 */}
160230 break;
160231 case 48: /* refargs ::= refargs refarg */
160232 { yymsp[-1].minor.yy412 = (yymsp[-1].minor.yy412 & ~yymsp[0].minor.yy463.mask) | yymsp[0].minor.yy463.value; }
160233 break;
160234 case 49: /* refarg ::= MATCH nm */
160235 { yymsp[-1].minor.yy463.value = 0; yymsp[-1].minor.yy463.mask = 0x000000; }
160236 break;
160237 case 50: /* refarg ::= ON INSERT refact */
160238 { yymsp[-2].minor.yy463.value = 0; yymsp[-2].minor.yy463.mask = 0x000000; }
160239 break;
160240 case 51: /* refarg ::= ON DELETE refact */
160241 { yymsp[-2].minor.yy463.value = yymsp[0].minor.yy412; yymsp[-2].minor.yy463.mask = 0x0000ff; }
160242 break;
160243 case 52: /* refarg ::= ON UPDATE refact */
160244 { yymsp[-2].minor.yy463.value = yymsp[0].minor.yy412<<8; yymsp[-2].minor.yy463.mask = 0x00ff00; }
160245 break;
160246 case 53: /* refact ::= SET NULL */
160247 { yymsp[-1].minor.yy412 = OE_SetNull; /* EV: R-33326-45252 */}
160248 break;
160249 case 54: /* refact ::= SET DEFAULT */
160250 { yymsp[-1].minor.yy412 = OE_SetDflt; /* EV: R-33326-45252 */}
160251 break;
160252 case 55: /* refact ::= CASCADE */
160253 { yymsp[0].minor.yy412 = OE_Cascade; /* EV: R-33326-45252 */}
160254 break;
160255 case 56: /* refact ::= RESTRICT */
160256 { yymsp[0].minor.yy412 = OE_Restrict; /* EV: R-33326-45252 */}
160257 break;
160258 case 57: /* refact ::= NO ACTION */
160259 { yymsp[-1].minor.yy412 = OE_None; /* EV: R-33326-45252 */}
160260 break;
160261 case 58: /* defer_subclause ::= NOT DEFERRABLE init_deferred_pred_opt */
160262 {yymsp[-2].minor.yy412 = 0;}
160263 break;
160264 case 59: /* defer_subclause ::= DEFERRABLE init_deferred_pred_opt */
160265 case 74: /* orconf ::= OR resolvetype */ yytestcase(yyruleno==74);
160266 case 169: /* insert_cmd ::= INSERT orconf */ yytestcase(yyruleno==169);
160267 {yymsp[-1].minor.yy412 = yymsp[0].minor.yy412;}
160268 break;
160269 case 61: /* init_deferred_pred_opt ::= INITIALLY DEFERRED */
160270 case 78: /* ifexists ::= IF EXISTS */ yytestcase(yyruleno==78);
160271 case 211: /* between_op ::= NOT BETWEEN */ yytestcase(yyruleno==211);
160272 case 214: /* in_op ::= NOT IN */ yytestcase(yyruleno==214);
160273 case 240: /* collate ::= COLLATE ID|STRING */ yytestcase(yyruleno==240);
160274 {yymsp[-1].minor.yy412 = 1;}
160275 break;
160276 case 62: /* init_deferred_pred_opt ::= INITIALLY IMMEDIATE */
160277 {yymsp[-1].minor.yy412 = 0;}
160278 break;
160279 case 64: /* tconscomma ::= COMMA */
160280 {pParse->constraintName.n = 0;}
160281 break;
160282 case 66: /* tcons ::= PRIMARY KEY LP sortlist autoinc RP onconf */
160283 {sqlite3AddPrimaryKey(pParse,yymsp[-3].minor.yy350,yymsp[0].minor.yy412,yymsp[-2].minor.yy412,0);}
160284 break;
160285 case 67: /* tcons ::= UNIQUE LP sortlist RP onconf */
160286 {sqlite3CreateIndex(pParse,0,0,0,yymsp[-2].minor.yy350,yymsp[0].minor.yy412,0,0,0,0,
160287 SQLITE_IDXTYPE_UNIQUE);}
160288 break;
160289 case 68: /* tcons ::= CHECK LP expr RP onconf */
160290 {sqlite3AddCheckConstraint(pParse,yymsp[-2].minor.yy354,yymsp[-3].minor.yy0.z,yymsp[-1].minor.yy0.z);}
160291 break;
160292 case 69: /* tcons ::= FOREIGN KEY LP eidlist RP REFERENCES nm eidlist_opt refargs defer_subclause_opt */
160293 {
160294 sqlite3CreateForeignKey(pParse, yymsp[-6].minor.yy350, &yymsp[-3].minor.yy0, yymsp[-2].minor.yy350, yymsp[-1].minor.yy412);
160295 sqlite3DeferForeignKey(pParse, yymsp[0].minor.yy412);
160296 }
160297 break;
160298 case 71: /* onconf ::= */
160299 case 73: /* orconf ::= */ yytestcase(yyruleno==73);
160300 {yymsp[1].minor.yy412 = OE_Default;}
160301 break;
160302 case 72: /* onconf ::= ON CONFLICT resolvetype */
160303 {yymsp[-2].minor.yy412 = yymsp[0].minor.yy412;}
160304 break;
160305 case 75: /* resolvetype ::= IGNORE */
160306 {yymsp[0].minor.yy412 = OE_Ignore;}
160307 break;
160308 case 76: /* resolvetype ::= REPLACE */
160309 case 170: /* insert_cmd ::= REPLACE */ yytestcase(yyruleno==170);
160310 {yymsp[0].minor.yy412 = OE_Replace;}
160311 break;
160312 case 77: /* cmd ::= DROP TABLE ifexists fullname */
160313 {
160314 sqlite3DropTable(pParse, yymsp[0].minor.yy457, 0, yymsp[-1].minor.yy412);
160315 }
160316 break;
160317 case 80: /* cmd ::= createkw temp VIEW ifnotexists nm dbnm eidlist_opt AS select */
160318 {
160319 sqlite3CreateView(pParse, &yymsp[-8].minor.yy0, &yymsp[-4].minor.yy0, &yymsp[-3].minor.yy0, yymsp[-2].minor.yy350, yymsp[0].minor.yy293, yymsp[-7].minor.yy412, yymsp[-5].minor.yy412);
160320 }
160321 break;
160322 case 81: /* cmd ::= DROP VIEW ifexists fullname */
160323 {
160324 sqlite3DropTable(pParse, yymsp[0].minor.yy457, 1, yymsp[-1].minor.yy412);
160325 }
160326 break;
160327 case 82: /* cmd ::= select */
160328 {
160329 SelectDest dest = {SRT_Output, 0, 0, 0, 0, 0, 0};
160330 sqlite3Select(pParse, yymsp[0].minor.yy293, &dest);
160331 sqlite3SelectDelete(pParse->db, yymsp[0].minor.yy293);
160332 }
160333 break;
160334 case 83: /* select ::= WITH wqlist selectnowith */
160335 {
160336 Select *p = yymsp[0].minor.yy293;
160337 if( p ){
160338 p->pWith = yymsp[-1].minor.yy105;
160339 parserDoubleLinkSelect(pParse, p);
160340 }else{
160341 sqlite3WithDelete(pParse->db, yymsp[-1].minor.yy105);
160342 }
160343 yymsp[-2].minor.yy293 = p;
160344 }
160345 break;
160346 case 84: /* select ::= WITH RECURSIVE wqlist selectnowith */
160347 {
160348 Select *p = yymsp[0].minor.yy293;
160349 if( p ){
160350 p->pWith = yymsp[-1].minor.yy105;
160351 parserDoubleLinkSelect(pParse, p);
160352 }else{
160353 sqlite3WithDelete(pParse->db, yymsp[-1].minor.yy105);
160354 }
160355 yymsp[-3].minor.yy293 = p;
160356 }
160357 break;
160358 case 85: /* select ::= selectnowith */
160359 {
160360 Select *p = yymsp[0].minor.yy293;
160361 if( p ){
160362 parserDoubleLinkSelect(pParse, p);
160363 }
160364 yymsp[0].minor.yy293 = p; /*A-overwrites-X*/
160365 }
160366 break;
160367 case 86: /* selectnowith ::= selectnowith multiselect_op oneselect */
160368 {
160369 Select *pRhs = yymsp[0].minor.yy293;
160370 Select *pLhs = yymsp[-2].minor.yy293;
160371 if( pRhs && pRhs->pPrior ){
160372 SrcList *pFrom;
160373 Token x;
160374 x.n = 0;
160375 parserDoubleLinkSelect(pParse, pRhs);
160376 pFrom = sqlite3SrcListAppendFromTerm(pParse,0,0,0,&x,pRhs,0,0);
160377 pRhs = sqlite3SelectNew(pParse,0,pFrom,0,0,0,0,0,0);
160378 }
160379 if( pRhs ){
160380 pRhs->op = (u8)yymsp[-1].minor.yy412;
160381 pRhs->pPrior = pLhs;
160382 if( ALWAYS(pLhs) ) pLhs->selFlags &= ~SF_MultiValue;
160383 pRhs->selFlags &= ~SF_MultiValue;
160384 if( yymsp[-1].minor.yy412!=TK_ALL ) pParse->hasCompound = 1;
160385 }else{
160386 sqlite3SelectDelete(pParse->db, pLhs);
160387 }
160388 yymsp[-2].minor.yy293 = pRhs;
160389 }
160390 break;
160391 case 87: /* multiselect_op ::= UNION */
160392 case 89: /* multiselect_op ::= EXCEPT|INTERSECT */ yytestcase(yyruleno==89);
160393 {yymsp[0].minor.yy412 = yymsp[0].major; /*A-overwrites-OP*/}
160394 break;
160395 case 88: /* multiselect_op ::= UNION ALL */
160396 {yymsp[-1].minor.yy412 = TK_ALL;}
160397 break;
160398 case 90: /* oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt orderby_opt limit_opt */
160399 {
160400 yymsp[-8].minor.yy293 = sqlite3SelectNew(pParse,yymsp[-6].minor.yy350,yymsp[-5].minor.yy457,yymsp[-4].minor.yy354,yymsp[-3].minor.yy350,yymsp[-2].minor.yy354,yymsp[-1].minor.yy350,yymsp[-7].minor.yy412,yymsp[0].minor.yy354);
160401 }
160402 break;
160403 case 91: /* oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt window_clause orderby_opt limit_opt */
160404 {
160405 yymsp[-9].minor.yy293 = sqlite3SelectNew(pParse,yymsp[-7].minor.yy350,yymsp[-6].minor.yy457,yymsp[-5].minor.yy354,yymsp[-4].minor.yy350,yymsp[-3].minor.yy354,yymsp[-1].minor.yy350,yymsp[-8].minor.yy412,yymsp[0].minor.yy354);
160406 if( yymsp[-9].minor.yy293 ){
160407 yymsp[-9].minor.yy293->pWinDefn = yymsp[-2].minor.yy503;
160408 }else{
160409 sqlite3WindowListDelete(pParse->db, yymsp[-2].minor.yy503);
160410 }
160411 }
160412 break;
160413 case 92: /* values ::= VALUES LP nexprlist RP */
160414 {
160415 yymsp[-3].minor.yy293 = sqlite3SelectNew(pParse,yymsp[-1].minor.yy350,0,0,0,0,0,SF_Values,0);
160416 }
160417 break;
160418 case 93: /* values ::= values COMMA LP nexprlist RP */
160419 {
160420 Select *pRight, *pLeft = yymsp[-4].minor.yy293;
160421 pRight = sqlite3SelectNew(pParse,yymsp[-1].minor.yy350,0,0,0,0,0,SF_Values|SF_MultiValue,0);
160422 if( ALWAYS(pLeft) ) pLeft->selFlags &= ~SF_MultiValue;
160423 if( pRight ){
160424 pRight->op = TK_ALL;
160425 pRight->pPrior = pLeft;
160426 yymsp[-4].minor.yy293 = pRight;
160427 }else{
160428 yymsp[-4].minor.yy293 = pLeft;
160429 }
160430 }
160431 break;
160432 case 94: /* distinct ::= DISTINCT */
160433 {yymsp[0].minor.yy412 = SF_Distinct;}
160434 break;
160435 case 95: /* distinct ::= ALL */
160436 {yymsp[0].minor.yy412 = SF_All;}
160437 break;
160438 case 97: /* sclp ::= */
160439 case 130: /* orderby_opt ::= */ yytestcase(yyruleno==130);
160440 case 140: /* groupby_opt ::= */ yytestcase(yyruleno==140);
160441 case 227: /* exprlist ::= */ yytestcase(yyruleno==227);
160442 case 230: /* paren_exprlist ::= */ yytestcase(yyruleno==230);
160443 case 235: /* eidlist_opt ::= */ yytestcase(yyruleno==235);
160444 {yymsp[1].minor.yy350 = 0;}
160445 break;
160446 case 98: /* selcollist ::= sclp scanpt expr scanpt as */
160447 {
160448 yymsp[-4].minor.yy350 = sqlite3ExprListAppend(pParse, yymsp[-4].minor.yy350, yymsp[-2].minor.yy354);
160449 if( yymsp[0].minor.yy0.n>0 ) sqlite3ExprListSetName(pParse, yymsp[-4].minor.yy350, &yymsp[0].minor.yy0, 1);
160450 sqlite3ExprListSetSpan(pParse,yymsp[-4].minor.yy350,yymsp[-3].minor.yy504,yymsp[-1].minor.yy504);
160451 }
160452 break;
160453 case 99: /* selcollist ::= sclp scanpt STAR */
160454 {
160455 Expr *p = sqlite3Expr(pParse->db, TK_ASTERISK, 0);
160456 yymsp[-2].minor.yy350 = sqlite3ExprListAppend(pParse, yymsp[-2].minor.yy350, p);
160457 }
160458 break;
160459 case 100: /* selcollist ::= sclp scanpt nm DOT STAR */
160460 {
160461 Expr *pRight = sqlite3PExpr(pParse, TK_ASTERISK, 0, 0);
160462 Expr *pLeft = sqlite3ExprAlloc(pParse->db, TK_ID, &yymsp[-2].minor.yy0, 1);
160463 Expr *pDot = sqlite3PExpr(pParse, TK_DOT, pLeft, pRight);
160464 yymsp[-4].minor.yy350 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy350, pDot);
160465 }
160466 break;
160467 case 101: /* as ::= AS nm */
160468 case 112: /* dbnm ::= DOT nm */ yytestcase(yyruleno==112);
160469 case 251: /* plus_num ::= PLUS INTEGER|FLOAT */ yytestcase(yyruleno==251);
@@ -160470,49 +160639,49 @@
160470 case 252: /* minus_num ::= MINUS INTEGER|FLOAT */ yytestcase(yyruleno==252);
160471 {yymsp[-1].minor.yy0 = yymsp[0].minor.yy0;}
160472 break;
160473 case 103: /* from ::= */
160474 case 106: /* stl_prefix ::= */ yytestcase(yyruleno==106);
160475 {yymsp[1].minor.yy457 = 0;}
160476 break;
160477 case 104: /* from ::= FROM seltablist */
160478 {
160479 yymsp[-1].minor.yy457 = yymsp[0].minor.yy457;
160480 sqlite3SrcListShiftJoinType(yymsp[-1].minor.yy457);
160481 }
160482 break;
160483 case 105: /* stl_prefix ::= seltablist joinop */
160484 {
160485 if( ALWAYS(yymsp[-1].minor.yy457 && yymsp[-1].minor.yy457->nSrc>0) ) yymsp[-1].minor.yy457->a[yymsp[-1].minor.yy457->nSrc-1].fg.jointype = (u8)yymsp[0].minor.yy412;
160486 }
160487 break;
160488 case 107: /* seltablist ::= stl_prefix nm dbnm as indexed_opt on_opt using_opt */
160489 {
160490 yymsp[-6].minor.yy457 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy457,&yymsp[-5].minor.yy0,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,0,yymsp[-1].minor.yy354,yymsp[0].minor.yy498);
160491 sqlite3SrcListIndexedBy(pParse, yymsp[-6].minor.yy457, &yymsp[-2].minor.yy0);
160492 }
160493 break;
160494 case 108: /* seltablist ::= stl_prefix nm dbnm LP exprlist RP as on_opt using_opt */
160495 {
160496 yymsp[-8].minor.yy457 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-8].minor.yy457,&yymsp[-7].minor.yy0,&yymsp[-6].minor.yy0,&yymsp[-2].minor.yy0,0,yymsp[-1].minor.yy354,yymsp[0].minor.yy498);
160497 sqlite3SrcListFuncArgs(pParse, yymsp[-8].minor.yy457, yymsp[-4].minor.yy350);
160498 }
160499 break;
160500 case 109: /* seltablist ::= stl_prefix LP select RP as on_opt using_opt */
160501 {
160502 yymsp[-6].minor.yy457 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy457,0,0,&yymsp[-2].minor.yy0,yymsp[-4].minor.yy293,yymsp[-1].minor.yy354,yymsp[0].minor.yy498);
160503 }
160504 break;
160505 case 110: /* seltablist ::= stl_prefix LP seltablist RP as on_opt using_opt */
160506 {
160507 if( yymsp[-6].minor.yy457==0 && yymsp[-2].minor.yy0.n==0 && yymsp[-1].minor.yy354==0 && yymsp[0].minor.yy498==0 ){
160508 yymsp[-6].minor.yy457 = yymsp[-4].minor.yy457;
160509 }else if( yymsp[-4].minor.yy457->nSrc==1 ){
160510 yymsp[-6].minor.yy457 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy457,0,0,&yymsp[-2].minor.yy0,0,yymsp[-1].minor.yy354,yymsp[0].minor.yy498);
160511 if( yymsp[-6].minor.yy457 ){
160512 struct SrcList_item *pNew = &yymsp[-6].minor.yy457->a[yymsp[-6].minor.yy457->nSrc-1];
160513 struct SrcList_item *pOld = yymsp[-4].minor.yy457->a;
160514 pNew->zName = pOld->zName;
160515 pNew->zDatabase = pOld->zDatabase;
160516 pNew->pSelect = pOld->pSelect;
160517 if( pOld->fg.isTabFunc ){
160518 pNew->u1.pFuncArg = pOld->u1.pFuncArg;
@@ -160521,240 +160690,240 @@
160521 pNew->fg.isTabFunc = 1;
160522 }
160523 pOld->zName = pOld->zDatabase = 0;
160524 pOld->pSelect = 0;
160525 }
160526 sqlite3SrcListDelete(pParse->db, yymsp[-4].minor.yy457);
160527 }else{
160528 Select *pSubquery;
160529 sqlite3SrcListShiftJoinType(yymsp[-4].minor.yy457);
160530 pSubquery = sqlite3SelectNew(pParse,0,yymsp[-4].minor.yy457,0,0,0,0,SF_NestedFrom,0);
160531 yymsp[-6].minor.yy457 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy457,0,0,&yymsp[-2].minor.yy0,pSubquery,yymsp[-1].minor.yy354,yymsp[0].minor.yy498);
160532 }
160533 }
160534 break;
160535 case 111: /* dbnm ::= */
160536 case 125: /* indexed_opt ::= */ yytestcase(yyruleno==125);
160537 {yymsp[1].minor.yy0.z=0; yymsp[1].minor.yy0.n=0;}
160538 break;
160539 case 113: /* fullname ::= nm */
160540 {
160541 yylhsminor.yy457 = sqlite3SrcListAppend(pParse,0,&yymsp[0].minor.yy0,0);
160542 if( IN_RENAME_OBJECT && yylhsminor.yy457 ) sqlite3RenameTokenMap(pParse, yylhsminor.yy457->a[0].zName, &yymsp[0].minor.yy0);
160543 }
160544 yymsp[0].minor.yy457 = yylhsminor.yy457;
160545 break;
160546 case 114: /* fullname ::= nm DOT nm */
160547 {
160548 yylhsminor.yy457 = sqlite3SrcListAppend(pParse,0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0);
160549 if( IN_RENAME_OBJECT && yylhsminor.yy457 ) sqlite3RenameTokenMap(pParse, yylhsminor.yy457->a[0].zName, &yymsp[0].minor.yy0);
160550 }
160551 yymsp[-2].minor.yy457 = yylhsminor.yy457;
160552 break;
160553 case 115: /* xfullname ::= nm */
160554 {yymsp[0].minor.yy457 = sqlite3SrcListAppend(pParse,0,&yymsp[0].minor.yy0,0); /*A-overwrites-X*/}
160555 break;
160556 case 116: /* xfullname ::= nm DOT nm */
160557 {yymsp[-2].minor.yy457 = sqlite3SrcListAppend(pParse,0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0); /*A-overwrites-X*/}
160558 break;
160559 case 117: /* xfullname ::= nm DOT nm AS nm */
160560 {
160561 yymsp[-4].minor.yy457 = sqlite3SrcListAppend(pParse,0,&yymsp[-4].minor.yy0,&yymsp[-2].minor.yy0); /*A-overwrites-X*/
160562 if( yymsp[-4].minor.yy457 ) yymsp[-4].minor.yy457->a[0].zAlias = sqlite3NameFromToken(pParse->db, &yymsp[0].minor.yy0);
160563 }
160564 break;
160565 case 118: /* xfullname ::= nm AS nm */
160566 {
160567 yymsp[-2].minor.yy457 = sqlite3SrcListAppend(pParse,0,&yymsp[-2].minor.yy0,0); /*A-overwrites-X*/
160568 if( yymsp[-2].minor.yy457 ) yymsp[-2].minor.yy457->a[0].zAlias = sqlite3NameFromToken(pParse->db, &yymsp[0].minor.yy0);
160569 }
160570 break;
160571 case 119: /* joinop ::= COMMA|JOIN */
160572 { yymsp[0].minor.yy412 = JT_INNER; }
160573 break;
160574 case 120: /* joinop ::= JOIN_KW JOIN */
160575 {yymsp[-1].minor.yy412 = sqlite3JoinType(pParse,&yymsp[-1].minor.yy0,0,0); /*X-overwrites-A*/}
160576 break;
160577 case 121: /* joinop ::= JOIN_KW nm JOIN */
160578 {yymsp[-2].minor.yy412 = sqlite3JoinType(pParse,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0,0); /*X-overwrites-A*/}
160579 break;
160580 case 122: /* joinop ::= JOIN_KW nm nm JOIN */
160581 {yymsp[-3].minor.yy412 = sqlite3JoinType(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0);/*X-overwrites-A*/}
160582 break;
160583 case 123: /* on_opt ::= ON expr */
160584 case 143: /* having_opt ::= HAVING expr */ yytestcase(yyruleno==143);
160585 case 150: /* where_opt ::= WHERE expr */ yytestcase(yyruleno==150);
160586 case 152: /* where_opt_ret ::= WHERE expr */ yytestcase(yyruleno==152);
160587 case 223: /* case_else ::= ELSE expr */ yytestcase(yyruleno==223);
160588 case 244: /* vinto ::= INTO expr */ yytestcase(yyruleno==244);
160589 {yymsp[-1].minor.yy354 = yymsp[0].minor.yy354;}
160590 break;
160591 case 124: /* on_opt ::= */
160592 case 142: /* having_opt ::= */ yytestcase(yyruleno==142);
160593 case 144: /* limit_opt ::= */ yytestcase(yyruleno==144);
160594 case 149: /* where_opt ::= */ yytestcase(yyruleno==149);
160595 case 151: /* where_opt_ret ::= */ yytestcase(yyruleno==151);
160596 case 224: /* case_else ::= */ yytestcase(yyruleno==224);
160597 case 226: /* case_operand ::= */ yytestcase(yyruleno==226);
160598 case 245: /* vinto ::= */ yytestcase(yyruleno==245);
160599 {yymsp[1].minor.yy354 = 0;}
160600 break;
160601 case 126: /* indexed_opt ::= INDEXED BY nm */
160602 {yymsp[-2].minor.yy0 = yymsp[0].minor.yy0;}
160603 break;
160604 case 127: /* indexed_opt ::= NOT INDEXED */
160605 {yymsp[-1].minor.yy0.z=0; yymsp[-1].minor.yy0.n=1;}
160606 break;
160607 case 128: /* using_opt ::= USING LP idlist RP */
160608 {yymsp[-3].minor.yy498 = yymsp[-1].minor.yy498;}
160609 break;
160610 case 129: /* using_opt ::= */
160611 case 171: /* idlist_opt ::= */ yytestcase(yyruleno==171);
160612 {yymsp[1].minor.yy498 = 0;}
160613 break;
160614 case 131: /* orderby_opt ::= ORDER BY sortlist */
160615 case 141: /* groupby_opt ::= GROUP BY nexprlist */ yytestcase(yyruleno==141);
160616 {yymsp[-2].minor.yy350 = yymsp[0].minor.yy350;}
160617 break;
160618 case 132: /* sortlist ::= sortlist COMMA expr sortorder nulls */
160619 {
160620 yymsp[-4].minor.yy350 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy350,yymsp[-2].minor.yy354);
160621 sqlite3ExprListSetSortOrder(yymsp[-4].minor.yy350,yymsp[-1].minor.yy412,yymsp[0].minor.yy412);
160622 }
160623 break;
160624 case 133: /* sortlist ::= expr sortorder nulls */
160625 {
160626 yymsp[-2].minor.yy350 = sqlite3ExprListAppend(pParse,0,yymsp[-2].minor.yy354); /*A-overwrites-Y*/
160627 sqlite3ExprListSetSortOrder(yymsp[-2].minor.yy350,yymsp[-1].minor.yy412,yymsp[0].minor.yy412);
160628 }
160629 break;
160630 case 134: /* sortorder ::= ASC */
160631 {yymsp[0].minor.yy412 = SQLITE_SO_ASC;}
160632 break;
160633 case 135: /* sortorder ::= DESC */
160634 {yymsp[0].minor.yy412 = SQLITE_SO_DESC;}
160635 break;
160636 case 136: /* sortorder ::= */
160637 case 139: /* nulls ::= */ yytestcase(yyruleno==139);
160638 {yymsp[1].minor.yy412 = SQLITE_SO_UNDEFINED;}
160639 break;
160640 case 137: /* nulls ::= NULLS FIRST */
160641 {yymsp[-1].minor.yy412 = SQLITE_SO_ASC;}
160642 break;
160643 case 138: /* nulls ::= NULLS LAST */
160644 {yymsp[-1].minor.yy412 = SQLITE_SO_DESC;}
160645 break;
160646 case 145: /* limit_opt ::= LIMIT expr */
160647 {yymsp[-1].minor.yy354 = sqlite3PExpr(pParse,TK_LIMIT,yymsp[0].minor.yy354,0);}
160648 break;
160649 case 146: /* limit_opt ::= LIMIT expr OFFSET expr */
160650 {yymsp[-3].minor.yy354 = sqlite3PExpr(pParse,TK_LIMIT,yymsp[-2].minor.yy354,yymsp[0].minor.yy354);}
160651 break;
160652 case 147: /* limit_opt ::= LIMIT expr COMMA expr */
160653 {yymsp[-3].minor.yy354 = sqlite3PExpr(pParse,TK_LIMIT,yymsp[0].minor.yy354,yymsp[-2].minor.yy354);}
160654 break;
160655 case 148: /* cmd ::= with DELETE FROM xfullname indexed_opt where_opt_ret */
160656 {
160657 sqlite3SrcListIndexedBy(pParse, yymsp[-2].minor.yy457, &yymsp[-1].minor.yy0);
160658 sqlite3DeleteFrom(pParse,yymsp[-2].minor.yy457,yymsp[0].minor.yy354,0,0);
160659 }
160660 break;
160661 case 153: /* where_opt_ret ::= RETURNING selcollist */
160662 {sqlite3AddReturning(pParse,yymsp[0].minor.yy350); yymsp[-1].minor.yy354 = 0;}
160663 break;
160664 case 154: /* where_opt_ret ::= WHERE expr RETURNING selcollist */
160665 {sqlite3AddReturning(pParse,yymsp[0].minor.yy350); yymsp[-3].minor.yy354 = yymsp[-2].minor.yy354;}
160666 break;
160667 case 155: /* cmd ::= with UPDATE orconf xfullname indexed_opt SET setlist from where_opt_ret */
160668 {
160669 sqlite3SrcListIndexedBy(pParse, yymsp[-5].minor.yy457, &yymsp[-4].minor.yy0);
160670 sqlite3ExprListCheckLength(pParse,yymsp[-2].minor.yy350,"set list");
160671 yymsp[-5].minor.yy457 = sqlite3SrcListAppendList(pParse, yymsp[-5].minor.yy457, yymsp[-1].minor.yy457);
160672 sqlite3Update(pParse,yymsp[-5].minor.yy457,yymsp[-2].minor.yy350,yymsp[0].minor.yy354,yymsp[-6].minor.yy412,0,0,0);
160673 }
160674 break;
160675 case 156: /* setlist ::= setlist COMMA nm EQ expr */
160676 {
160677 yymsp[-4].minor.yy350 = sqlite3ExprListAppend(pParse, yymsp[-4].minor.yy350, yymsp[0].minor.yy354);
160678 sqlite3ExprListSetName(pParse, yymsp[-4].minor.yy350, &yymsp[-2].minor.yy0, 1);
160679 }
160680 break;
160681 case 157: /* setlist ::= setlist COMMA LP idlist RP EQ expr */
160682 {
160683 yymsp[-6].minor.yy350 = sqlite3ExprListAppendVector(pParse, yymsp[-6].minor.yy350, yymsp[-3].minor.yy498, yymsp[0].minor.yy354);
160684 }
160685 break;
160686 case 158: /* setlist ::= nm EQ expr */
160687 {
160688 yylhsminor.yy350 = sqlite3ExprListAppend(pParse, 0, yymsp[0].minor.yy354);
160689 sqlite3ExprListSetName(pParse, yylhsminor.yy350, &yymsp[-2].minor.yy0, 1);
160690 }
160691 yymsp[-2].minor.yy350 = yylhsminor.yy350;
160692 break;
160693 case 159: /* setlist ::= LP idlist RP EQ expr */
160694 {
160695 yymsp[-4].minor.yy350 = sqlite3ExprListAppendVector(pParse, 0, yymsp[-3].minor.yy498, yymsp[0].minor.yy354);
160696 }
160697 break;
160698 case 160: /* cmd ::= with insert_cmd INTO xfullname idlist_opt select upsert */
160699 {
160700 sqlite3Insert(pParse, yymsp[-3].minor.yy457, yymsp[-1].minor.yy293, yymsp[-2].minor.yy498, yymsp[-5].minor.yy412, yymsp[0].minor.yy40);
160701 }
160702 break;
160703 case 161: /* cmd ::= with insert_cmd INTO xfullname idlist_opt DEFAULT VALUES returning */
160704 {
160705 sqlite3Insert(pParse, yymsp[-4].minor.yy457, 0, yymsp[-3].minor.yy498, yymsp[-6].minor.yy412, 0);
160706 }
160707 break;
160708 case 162: /* upsert ::= */
160709 { yymsp[1].minor.yy40 = 0; }
160710 break;
160711 case 163: /* upsert ::= RETURNING selcollist */
160712 { yymsp[-1].minor.yy40 = 0; sqlite3AddReturning(pParse,yymsp[0].minor.yy350); }
160713 break;
160714 case 164: /* upsert ::= ON CONFLICT LP sortlist RP where_opt DO UPDATE SET setlist where_opt upsert */
160715 { yymsp[-11].minor.yy40 = sqlite3UpsertNew(pParse->db,yymsp[-8].minor.yy350,yymsp[-6].minor.yy354,yymsp[-2].minor.yy350,yymsp[-1].minor.yy354,yymsp[0].minor.yy40);}
160716 break;
160717 case 165: /* upsert ::= ON CONFLICT LP sortlist RP where_opt DO NOTHING upsert */
160718 { yymsp[-8].minor.yy40 = sqlite3UpsertNew(pParse->db,yymsp[-5].minor.yy350,yymsp[-3].minor.yy354,0,0,yymsp[0].minor.yy40); }
160719 break;
160720 case 166: /* upsert ::= ON CONFLICT DO NOTHING returning */
160721 { yymsp[-4].minor.yy40 = sqlite3UpsertNew(pParse->db,0,0,0,0,0); }
160722 break;
160723 case 167: /* upsert ::= ON CONFLICT DO UPDATE SET setlist where_opt returning */
160724 { yymsp[-7].minor.yy40 = sqlite3UpsertNew(pParse->db,0,0,yymsp[-2].minor.yy350,yymsp[-1].minor.yy354,0);}
160725 break;
160726 case 168: /* returning ::= RETURNING selcollist */
160727 {sqlite3AddReturning(pParse,yymsp[0].minor.yy350);}
160728 break;
160729 case 172: /* idlist_opt ::= LP idlist RP */
160730 {yymsp[-2].minor.yy498 = yymsp[-1].minor.yy498;}
160731 break;
160732 case 173: /* idlist ::= idlist COMMA nm */
160733 {yymsp[-2].minor.yy498 = sqlite3IdListAppend(pParse,yymsp[-2].minor.yy498,&yymsp[0].minor.yy0);}
160734 break;
160735 case 174: /* idlist ::= nm */
160736 {yymsp[0].minor.yy498 = sqlite3IdListAppend(pParse,0,&yymsp[0].minor.yy0); /*A-overwrites-Y*/}
160737 break;
160738 case 175: /* expr ::= LP expr RP */
160739 {yymsp[-2].minor.yy354 = yymsp[-1].minor.yy354;}
160740 break;
160741 case 176: /* expr ::= ID|INDEXED */
160742 case 177: /* expr ::= JOIN_KW */ yytestcase(yyruleno==177);
160743 {yymsp[0].minor.yy354=tokenExpr(pParse,TK_ID,yymsp[0].minor.yy0); /*A-overwrites-X*/}
160744 break;
160745 case 178: /* expr ::= nm DOT nm */
160746 {
160747 Expr *temp1 = sqlite3ExprAlloc(pParse->db, TK_ID, &yymsp[-2].minor.yy0, 1);
160748 Expr *temp2 = sqlite3ExprAlloc(pParse->db, TK_ID, &yymsp[0].minor.yy0, 1);
160749 if( IN_RENAME_OBJECT ){
160750 sqlite3RenameTokenMap(pParse, (void*)temp2, &yymsp[0].minor.yy0);
160751 sqlite3RenameTokenMap(pParse, (void*)temp1, &yymsp[-2].minor.yy0);
160752 }
160753 yylhsminor.yy354 = sqlite3PExpr(pParse, TK_DOT, temp1, temp2);
160754 }
160755 yymsp[-2].minor.yy354 = yylhsminor.yy354;
160756 break;
160757 case 179: /* expr ::= nm DOT nm DOT nm */
160758 {
160759 Expr *temp1 = sqlite3ExprAlloc(pParse->db, TK_ID, &yymsp[-4].minor.yy0, 1);
160760 Expr *temp2 = sqlite3ExprAlloc(pParse->db, TK_ID, &yymsp[-2].minor.yy0, 1);
@@ -160762,322 +160931,322 @@
160762 Expr *temp4 = sqlite3PExpr(pParse, TK_DOT, temp2, temp3);
160763 if( IN_RENAME_OBJECT ){
160764 sqlite3RenameTokenMap(pParse, (void*)temp3, &yymsp[0].minor.yy0);
160765 sqlite3RenameTokenMap(pParse, (void*)temp2, &yymsp[-2].minor.yy0);
160766 }
160767 yylhsminor.yy354 = sqlite3PExpr(pParse, TK_DOT, temp1, temp4);
160768 }
160769 yymsp[-4].minor.yy354 = yylhsminor.yy354;
160770 break;
160771 case 180: /* term ::= NULL|FLOAT|BLOB */
160772 case 181: /* term ::= STRING */ yytestcase(yyruleno==181);
160773 {yymsp[0].minor.yy354=tokenExpr(pParse,yymsp[0].major,yymsp[0].minor.yy0); /*A-overwrites-X*/}
160774 break;
160775 case 182: /* term ::= INTEGER */
160776 {
160777 yylhsminor.yy354 = sqlite3ExprAlloc(pParse->db, TK_INTEGER, &yymsp[0].minor.yy0, 1);
160778 }
160779 yymsp[0].minor.yy354 = yylhsminor.yy354;
160780 break;
160781 case 183: /* expr ::= VARIABLE */
160782 {
160783 if( !(yymsp[0].minor.yy0.z[0]=='#' && sqlite3Isdigit(yymsp[0].minor.yy0.z[1])) ){
160784 u32 n = yymsp[0].minor.yy0.n;
160785 yymsp[0].minor.yy354 = tokenExpr(pParse, TK_VARIABLE, yymsp[0].minor.yy0);
160786 sqlite3ExprAssignVarNumber(pParse, yymsp[0].minor.yy354, n);
160787 }else{
160788 /* When doing a nested parse, one can include terms in an expression
160789 ** that look like this: #1 #2 ... These terms refer to registers
160790 ** in the virtual machine. #N is the N-th register. */
160791 Token t = yymsp[0].minor.yy0; /*A-overwrites-X*/
160792 assert( t.n>=2 );
160793 if( pParse->nested==0 ){
160794 sqlite3ErrorMsg(pParse, "near \"%T\": syntax error", &t);
160795 yymsp[0].minor.yy354 = 0;
160796 }else{
160797 yymsp[0].minor.yy354 = sqlite3PExpr(pParse, TK_REGISTER, 0, 0);
160798 if( yymsp[0].minor.yy354 ) sqlite3GetInt32(&t.z[1], &yymsp[0].minor.yy354->iTable);
160799 }
160800 }
160801 }
160802 break;
160803 case 184: /* expr ::= expr COLLATE ID|STRING */
160804 {
160805 yymsp[-2].minor.yy354 = sqlite3ExprAddCollateToken(pParse, yymsp[-2].minor.yy354, &yymsp[0].minor.yy0, 1);
160806 }
160807 break;
160808 case 185: /* expr ::= CAST LP expr AS typetoken RP */
160809 {
160810 yymsp[-5].minor.yy354 = sqlite3ExprAlloc(pParse->db, TK_CAST, &yymsp[-1].minor.yy0, 1);
160811 sqlite3ExprAttachSubtrees(pParse->db, yymsp[-5].minor.yy354, yymsp[-3].minor.yy354, 0);
160812 }
160813 break;
160814 case 186: /* expr ::= ID|INDEXED LP distinct exprlist RP */
160815 {
160816 yylhsminor.yy354 = sqlite3ExprFunction(pParse, yymsp[-1].minor.yy350, &yymsp[-4].minor.yy0, yymsp[-2].minor.yy412);
160817 }
160818 yymsp[-4].minor.yy354 = yylhsminor.yy354;
160819 break;
160820 case 187: /* expr ::= ID|INDEXED LP STAR RP */
160821 {
160822 yylhsminor.yy354 = sqlite3ExprFunction(pParse, 0, &yymsp[-3].minor.yy0, 0);
160823 }
160824 yymsp[-3].minor.yy354 = yylhsminor.yy354;
160825 break;
160826 case 188: /* expr ::= ID|INDEXED LP distinct exprlist RP filter_over */
160827 {
160828 yylhsminor.yy354 = sqlite3ExprFunction(pParse, yymsp[-2].minor.yy350, &yymsp[-5].minor.yy0, yymsp[-3].minor.yy412);
160829 sqlite3WindowAttach(pParse, yylhsminor.yy354, yymsp[0].minor.yy503);
160830 }
160831 yymsp[-5].minor.yy354 = yylhsminor.yy354;
160832 break;
160833 case 189: /* expr ::= ID|INDEXED LP STAR RP filter_over */
160834 {
160835 yylhsminor.yy354 = sqlite3ExprFunction(pParse, 0, &yymsp[-4].minor.yy0, 0);
160836 sqlite3WindowAttach(pParse, yylhsminor.yy354, yymsp[0].minor.yy503);
160837 }
160838 yymsp[-4].minor.yy354 = yylhsminor.yy354;
160839 break;
160840 case 190: /* term ::= CTIME_KW */
160841 {
160842 yylhsminor.yy354 = sqlite3ExprFunction(pParse, 0, &yymsp[0].minor.yy0, 0);
160843 }
160844 yymsp[0].minor.yy354 = yylhsminor.yy354;
160845 break;
160846 case 191: /* expr ::= LP nexprlist COMMA expr RP */
160847 {
160848 ExprList *pList = sqlite3ExprListAppend(pParse, yymsp[-3].minor.yy350, yymsp[-1].minor.yy354);
160849 yymsp[-4].minor.yy354 = sqlite3PExpr(pParse, TK_VECTOR, 0, 0);
160850 if( yymsp[-4].minor.yy354 ){
160851 yymsp[-4].minor.yy354->x.pList = pList;
160852 if( ALWAYS(pList->nExpr) ){
160853 yymsp[-4].minor.yy354->flags |= pList->a[0].pExpr->flags & EP_Propagate;
160854 }
160855 }else{
160856 sqlite3ExprListDelete(pParse->db, pList);
160857 }
160858 }
160859 break;
160860 case 192: /* expr ::= expr AND expr */
160861 {yymsp[-2].minor.yy354=sqlite3ExprAnd(pParse,yymsp[-2].minor.yy354,yymsp[0].minor.yy354);}
160862 break;
160863 case 193: /* expr ::= expr OR expr */
160864 case 194: /* expr ::= expr LT|GT|GE|LE expr */ yytestcase(yyruleno==194);
160865 case 195: /* expr ::= expr EQ|NE expr */ yytestcase(yyruleno==195);
160866 case 196: /* expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr */ yytestcase(yyruleno==196);
160867 case 197: /* expr ::= expr PLUS|MINUS expr */ yytestcase(yyruleno==197);
160868 case 198: /* expr ::= expr STAR|SLASH|REM expr */ yytestcase(yyruleno==198);
160869 case 199: /* expr ::= expr CONCAT expr */ yytestcase(yyruleno==199);
160870 {yymsp[-2].minor.yy354=sqlite3PExpr(pParse,yymsp[-1].major,yymsp[-2].minor.yy354,yymsp[0].minor.yy354);}
160871 break;
160872 case 200: /* likeop ::= NOT LIKE_KW|MATCH */
160873 {yymsp[-1].minor.yy0=yymsp[0].minor.yy0; yymsp[-1].minor.yy0.n|=0x80000000; /*yymsp[-1].minor.yy0-overwrite-yymsp[0].minor.yy0*/}
160874 break;
160875 case 201: /* expr ::= expr likeop expr */
160876 {
160877 ExprList *pList;
160878 int bNot = yymsp[-1].minor.yy0.n & 0x80000000;
160879 yymsp[-1].minor.yy0.n &= 0x7fffffff;
160880 pList = sqlite3ExprListAppend(pParse,0, yymsp[0].minor.yy354);
160881 pList = sqlite3ExprListAppend(pParse,pList, yymsp[-2].minor.yy354);
160882 yymsp[-2].minor.yy354 = sqlite3ExprFunction(pParse, pList, &yymsp[-1].minor.yy0, 0);
160883 if( bNot ) yymsp[-2].minor.yy354 = sqlite3PExpr(pParse, TK_NOT, yymsp[-2].minor.yy354, 0);
160884 if( yymsp[-2].minor.yy354 ) yymsp[-2].minor.yy354->flags |= EP_InfixFunc;
160885 }
160886 break;
160887 case 202: /* expr ::= expr likeop expr ESCAPE expr */
160888 {
160889 ExprList *pList;
160890 int bNot = yymsp[-3].minor.yy0.n & 0x80000000;
160891 yymsp[-3].minor.yy0.n &= 0x7fffffff;
160892 pList = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy354);
160893 pList = sqlite3ExprListAppend(pParse,pList, yymsp[-4].minor.yy354);
160894 pList = sqlite3ExprListAppend(pParse,pList, yymsp[0].minor.yy354);
160895 yymsp[-4].minor.yy354 = sqlite3ExprFunction(pParse, pList, &yymsp[-3].minor.yy0, 0);
160896 if( bNot ) yymsp[-4].minor.yy354 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy354, 0);
160897 if( yymsp[-4].minor.yy354 ) yymsp[-4].minor.yy354->flags |= EP_InfixFunc;
160898 }
160899 break;
160900 case 203: /* expr ::= expr ISNULL|NOTNULL */
160901 {yymsp[-1].minor.yy354 = sqlite3PExpr(pParse,yymsp[0].major,yymsp[-1].minor.yy354,0);}
160902 break;
160903 case 204: /* expr ::= expr NOT NULL */
160904 {yymsp[-2].minor.yy354 = sqlite3PExpr(pParse,TK_NOTNULL,yymsp[-2].minor.yy354,0);}
160905 break;
160906 case 205: /* expr ::= expr IS expr */
160907 {
160908 yymsp[-2].minor.yy354 = sqlite3PExpr(pParse,TK_IS,yymsp[-2].minor.yy354,yymsp[0].minor.yy354);
160909 binaryToUnaryIfNull(pParse, yymsp[0].minor.yy354, yymsp[-2].minor.yy354, TK_ISNULL);
160910 }
160911 break;
160912 case 206: /* expr ::= expr IS NOT expr */
160913 {
160914 yymsp[-3].minor.yy354 = sqlite3PExpr(pParse,TK_ISNOT,yymsp[-3].minor.yy354,yymsp[0].minor.yy354);
160915 binaryToUnaryIfNull(pParse, yymsp[0].minor.yy354, yymsp[-3].minor.yy354, TK_NOTNULL);
160916 }
160917 break;
160918 case 207: /* expr ::= NOT expr */
160919 case 208: /* expr ::= BITNOT expr */ yytestcase(yyruleno==208);
160920 {yymsp[-1].minor.yy354 = sqlite3PExpr(pParse, yymsp[-1].major, yymsp[0].minor.yy354, 0);/*A-overwrites-B*/}
160921 break;
160922 case 209: /* expr ::= PLUS|MINUS expr */
160923 {
160924 yymsp[-1].minor.yy354 = sqlite3PExpr(pParse, yymsp[-1].major==TK_PLUS ? TK_UPLUS : TK_UMINUS, yymsp[0].minor.yy354, 0);
160925 /*A-overwrites-B*/
160926 }
160927 break;
160928 case 210: /* between_op ::= BETWEEN */
160929 case 213: /* in_op ::= IN */ yytestcase(yyruleno==213);
160930 {yymsp[0].minor.yy412 = 0;}
160931 break;
160932 case 212: /* expr ::= expr between_op expr AND expr */
160933 {
160934 ExprList *pList = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy354);
160935 pList = sqlite3ExprListAppend(pParse,pList, yymsp[0].minor.yy354);
160936 yymsp[-4].minor.yy354 = sqlite3PExpr(pParse, TK_BETWEEN, yymsp[-4].minor.yy354, 0);
160937 if( yymsp[-4].minor.yy354 ){
160938 yymsp[-4].minor.yy354->x.pList = pList;
160939 }else{
160940 sqlite3ExprListDelete(pParse->db, pList);
160941 }
160942 if( yymsp[-3].minor.yy412 ) yymsp[-4].minor.yy354 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy354, 0);
160943 }
160944 break;
160945 case 215: /* expr ::= expr in_op LP exprlist RP */
160946 {
160947 if( yymsp[-1].minor.yy350==0 ){
160948 /* Expressions of the form
160949 **
160950 ** expr1 IN ()
160951 ** expr1 NOT IN ()
160952 **
160953 ** simplify to constants 0 (false) and 1 (true), respectively,
160954 ** regardless of the value of expr1.
160955 */
160956 sqlite3ExprUnmapAndDelete(pParse, yymsp[-4].minor.yy354);
160957 yymsp[-4].minor.yy354 = sqlite3Expr(pParse->db, TK_INTEGER, yymsp[-3].minor.yy412 ? "1" : "0");
160958 }else if( yymsp[-1].minor.yy350->nExpr==1 && sqlite3ExprIsConstant(yymsp[-1].minor.yy350->a[0].pExpr) ){
160959 Expr *pRHS = yymsp[-1].minor.yy350->a[0].pExpr;
160960 yymsp[-1].minor.yy350->a[0].pExpr = 0;
160961 sqlite3ExprListDelete(pParse->db, yymsp[-1].minor.yy350);
160962 pRHS = sqlite3PExpr(pParse, TK_UPLUS, pRHS, 0);
160963 yymsp[-4].minor.yy354 = sqlite3PExpr(pParse, TK_EQ, yymsp[-4].minor.yy354, pRHS);
160964 if( yymsp[-3].minor.yy412 ) yymsp[-4].minor.yy354 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy354, 0);
160965 }else{
160966 yymsp[-4].minor.yy354 = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy354, 0);
160967 if( yymsp[-4].minor.yy354 ){
160968 yymsp[-4].minor.yy354->x.pList = yymsp[-1].minor.yy350;
160969 sqlite3ExprSetHeightAndFlags(pParse, yymsp[-4].minor.yy354);
160970 }else{
160971 sqlite3ExprListDelete(pParse->db, yymsp[-1].minor.yy350);
160972 }
160973 if( yymsp[-3].minor.yy412 ) yymsp[-4].minor.yy354 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy354, 0);
160974 }
160975 }
160976 break;
160977 case 216: /* expr ::= LP select RP */
160978 {
160979 yymsp[-2].minor.yy354 = sqlite3PExpr(pParse, TK_SELECT, 0, 0);
160980 sqlite3PExprAddSelect(pParse, yymsp[-2].minor.yy354, yymsp[-1].minor.yy293);
160981 }
160982 break;
160983 case 217: /* expr ::= expr in_op LP select RP */
160984 {
160985 yymsp[-4].minor.yy354 = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy354, 0);
160986 sqlite3PExprAddSelect(pParse, yymsp[-4].minor.yy354, yymsp[-1].minor.yy293);
160987 if( yymsp[-3].minor.yy412 ) yymsp[-4].minor.yy354 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy354, 0);
160988 }
160989 break;
160990 case 218: /* expr ::= expr in_op nm dbnm paren_exprlist */
160991 {
160992 SrcList *pSrc = sqlite3SrcListAppend(pParse, 0,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0);
160993 Select *pSelect = sqlite3SelectNew(pParse, 0,pSrc,0,0,0,0,0,0);
160994 if( yymsp[0].minor.yy350 ) sqlite3SrcListFuncArgs(pParse, pSelect ? pSrc : 0, yymsp[0].minor.yy350);
160995 yymsp[-4].minor.yy354 = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy354, 0);
160996 sqlite3PExprAddSelect(pParse, yymsp[-4].minor.yy354, pSelect);
160997 if( yymsp[-3].minor.yy412 ) yymsp[-4].minor.yy354 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy354, 0);
160998 }
160999 break;
161000 case 219: /* expr ::= EXISTS LP select RP */
161001 {
161002 Expr *p;
161003 p = yymsp[-3].minor.yy354 = sqlite3PExpr(pParse, TK_EXISTS, 0, 0);
161004 sqlite3PExprAddSelect(pParse, p, yymsp[-1].minor.yy293);
161005 }
161006 break;
161007 case 220: /* expr ::= CASE case_operand case_exprlist case_else END */
161008 {
161009 yymsp[-4].minor.yy354 = sqlite3PExpr(pParse, TK_CASE, yymsp[-3].minor.yy354, 0);
161010 if( yymsp[-4].minor.yy354 ){
161011 yymsp[-4].minor.yy354->x.pList = yymsp[-1].minor.yy354 ? sqlite3ExprListAppend(pParse,yymsp[-2].minor.yy350,yymsp[-1].minor.yy354) : yymsp[-2].minor.yy350;
161012 sqlite3ExprSetHeightAndFlags(pParse, yymsp[-4].minor.yy354);
161013 }else{
161014 sqlite3ExprListDelete(pParse->db, yymsp[-2].minor.yy350);
161015 sqlite3ExprDelete(pParse->db, yymsp[-1].minor.yy354);
161016 }
161017 }
161018 break;
161019 case 221: /* case_exprlist ::= case_exprlist WHEN expr THEN expr */
161020 {
161021 yymsp[-4].minor.yy350 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy350, yymsp[-2].minor.yy354);
161022 yymsp[-4].minor.yy350 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy350, yymsp[0].minor.yy354);
161023 }
161024 break;
161025 case 222: /* case_exprlist ::= WHEN expr THEN expr */
161026 {
161027 yymsp[-3].minor.yy350 = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy354);
161028 yymsp[-3].minor.yy350 = sqlite3ExprListAppend(pParse,yymsp[-3].minor.yy350, yymsp[0].minor.yy354);
161029 }
161030 break;
161031 case 225: /* case_operand ::= expr */
161032 {yymsp[0].minor.yy354 = yymsp[0].minor.yy354; /*A-overwrites-X*/}
161033 break;
161034 case 228: /* nexprlist ::= nexprlist COMMA expr */
161035 {yymsp[-2].minor.yy350 = sqlite3ExprListAppend(pParse,yymsp[-2].minor.yy350,yymsp[0].minor.yy354);}
161036 break;
161037 case 229: /* nexprlist ::= expr */
161038 {yymsp[0].minor.yy350 = sqlite3ExprListAppend(pParse,0,yymsp[0].minor.yy354); /*A-overwrites-Y*/}
161039 break;
161040 case 231: /* paren_exprlist ::= LP exprlist RP */
161041 case 236: /* eidlist_opt ::= LP eidlist RP */ yytestcase(yyruleno==236);
161042 {yymsp[-2].minor.yy350 = yymsp[-1].minor.yy350;}
161043 break;
161044 case 232: /* cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP sortlist RP where_opt */
161045 {
161046 sqlite3CreateIndex(pParse, &yymsp[-7].minor.yy0, &yymsp[-6].minor.yy0,
161047 sqlite3SrcListAppend(pParse,0,&yymsp[-4].minor.yy0,0), yymsp[-2].minor.yy350, yymsp[-10].minor.yy412,
161048 &yymsp[-11].minor.yy0, yymsp[0].minor.yy354, SQLITE_SO_ASC, yymsp[-8].minor.yy412, SQLITE_IDXTYPE_APPDEF);
161049 if( IN_RENAME_OBJECT && pParse->pNewIndex ){
161050 sqlite3RenameTokenMap(pParse, pParse->pNewIndex->zName, &yymsp[-4].minor.yy0);
161051 }
161052 }
161053 break;
161054 case 233: /* uniqueflag ::= UNIQUE */
161055 case 275: /* raisetype ::= ABORT */ yytestcase(yyruleno==275);
161056 {yymsp[0].minor.yy412 = OE_Abort;}
161057 break;
161058 case 234: /* uniqueflag ::= */
161059 {yymsp[1].minor.yy412 = OE_None;}
161060 break;
161061 case 237: /* eidlist ::= eidlist COMMA nm collate sortorder */
161062 {
161063 yymsp[-4].minor.yy350 = parserAddExprIdListTerm(pParse, yymsp[-4].minor.yy350, &yymsp[-2].minor.yy0, yymsp[-1].minor.yy412, yymsp[0].minor.yy412);
161064 }
161065 break;
161066 case 238: /* eidlist ::= nm collate sortorder */
161067 {
161068 yymsp[-2].minor.yy350 = parserAddExprIdListTerm(pParse, 0, &yymsp[-2].minor.yy0, yymsp[-1].minor.yy412, yymsp[0].minor.yy412); /*A-overwrites-Y*/
161069 }
161070 break;
161071 case 241: /* cmd ::= DROP INDEX ifexists fullname */
161072 {sqlite3DropIndex(pParse, yymsp[0].minor.yy457, yymsp[-1].minor.yy412);}
161073 break;
161074 case 242: /* cmd ::= VACUUM vinto */
161075 {sqlite3Vacuum(pParse,0,yymsp[0].minor.yy354);}
161076 break;
161077 case 243: /* cmd ::= VACUUM nm vinto */
161078 {sqlite3Vacuum(pParse,&yymsp[-1].minor.yy0,yymsp[0].minor.yy354);}
161079 break;
161080 case 246: /* cmd ::= PRAGMA nm dbnm */
161081 {sqlite3Pragma(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,0,0);}
161082 break;
161083 case 247: /* cmd ::= PRAGMA nm dbnm EQ nmnum */
@@ -161095,54 +161264,54 @@
161095 case 253: /* cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END */
161096 {
161097 Token all;
161098 all.z = yymsp[-3].minor.yy0.z;
161099 all.n = (int)(yymsp[0].minor.yy0.z - yymsp[-3].minor.yy0.z) + yymsp[0].minor.yy0.n;
161100 sqlite3FinishTrigger(pParse, yymsp[-1].minor.yy51, &all);
161101 }
161102 break;
161103 case 254: /* trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause */
161104 {
161105 sqlite3BeginTrigger(pParse, &yymsp[-7].minor.yy0, &yymsp[-6].minor.yy0, yymsp[-5].minor.yy412, yymsp[-4].minor.yy298.a, yymsp[-4].minor.yy298.b, yymsp[-2].minor.yy457, yymsp[0].minor.yy354, yymsp[-10].minor.yy412, yymsp[-8].minor.yy412);
161106 yymsp[-10].minor.yy0 = (yymsp[-6].minor.yy0.n==0?yymsp[-7].minor.yy0:yymsp[-6].minor.yy0); /*A-overwrites-T*/
161107 }
161108 break;
161109 case 255: /* trigger_time ::= BEFORE|AFTER */
161110 { yymsp[0].minor.yy412 = yymsp[0].major; /*A-overwrites-X*/ }
161111 break;
161112 case 256: /* trigger_time ::= INSTEAD OF */
161113 { yymsp[-1].minor.yy412 = TK_INSTEAD;}
161114 break;
161115 case 257: /* trigger_time ::= */
161116 { yymsp[1].minor.yy412 = TK_BEFORE; }
161117 break;
161118 case 258: /* trigger_event ::= DELETE|INSERT */
161119 case 259: /* trigger_event ::= UPDATE */ yytestcase(yyruleno==259);
161120 {yymsp[0].minor.yy298.a = yymsp[0].major; /*A-overwrites-X*/ yymsp[0].minor.yy298.b = 0;}
161121 break;
161122 case 260: /* trigger_event ::= UPDATE OF idlist */
161123 {yymsp[-2].minor.yy298.a = TK_UPDATE; yymsp[-2].minor.yy298.b = yymsp[0].minor.yy498;}
161124 break;
161125 case 261: /* when_clause ::= */
161126 case 280: /* key_opt ::= */ yytestcase(yyruleno==280);
161127 { yymsp[1].minor.yy354 = 0; }
161128 break;
161129 case 262: /* when_clause ::= WHEN expr */
161130 case 281: /* key_opt ::= KEY expr */ yytestcase(yyruleno==281);
161131 { yymsp[-1].minor.yy354 = yymsp[0].minor.yy354; }
161132 break;
161133 case 263: /* trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI */
161134 {
161135 assert( yymsp[-2].minor.yy51!=0 );
161136 yymsp[-2].minor.yy51->pLast->pNext = yymsp[-1].minor.yy51;
161137 yymsp[-2].minor.yy51->pLast = yymsp[-1].minor.yy51;
161138 }
161139 break;
161140 case 264: /* trigger_cmd_list ::= trigger_cmd SEMI */
161141 {
161142 assert( yymsp[-1].minor.yy51!=0 );
161143 yymsp[-1].minor.yy51->pLast = yymsp[-1].minor.yy51;
161144 }
161145 break;
161146 case 265: /* trnm ::= nm DOT nm */
161147 {
161148 yymsp[-2].minor.yy0 = yymsp[0].minor.yy0;
@@ -161164,62 +161333,62 @@
161164 "the NOT INDEXED clause is not allowed on UPDATE or DELETE statements "
161165 "within triggers");
161166 }
161167 break;
161168 case 268: /* trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist from where_opt scanpt */
161169 {yylhsminor.yy51 = sqlite3TriggerUpdateStep(pParse, &yymsp[-6].minor.yy0, yymsp[-2].minor.yy457, yymsp[-3].minor.yy350, yymsp[-1].minor.yy354, yymsp[-7].minor.yy412, yymsp[-8].minor.yy0.z, yymsp[0].minor.yy504);}
161170 yymsp[-8].minor.yy51 = yylhsminor.yy51;
161171 break;
161172 case 269: /* trigger_cmd ::= scanpt insert_cmd INTO trnm idlist_opt select upsert scanpt */
161173 {
161174 yylhsminor.yy51 = sqlite3TriggerInsertStep(pParse,&yymsp[-4].minor.yy0,yymsp[-3].minor.yy498,yymsp[-2].minor.yy293,yymsp[-6].minor.yy412,yymsp[-1].minor.yy40,yymsp[-7].minor.yy504,yymsp[0].minor.yy504);/*yylhsminor.yy51-overwrites-yymsp[-6].minor.yy412*/
161175 }
161176 yymsp[-7].minor.yy51 = yylhsminor.yy51;
161177 break;
161178 case 270: /* trigger_cmd ::= DELETE FROM trnm tridxby where_opt scanpt */
161179 {yylhsminor.yy51 = sqlite3TriggerDeleteStep(pParse, &yymsp[-3].minor.yy0, yymsp[-1].minor.yy354, yymsp[-5].minor.yy0.z, yymsp[0].minor.yy504);}
161180 yymsp[-5].minor.yy51 = yylhsminor.yy51;
161181 break;
161182 case 271: /* trigger_cmd ::= scanpt select scanpt */
161183 {yylhsminor.yy51 = sqlite3TriggerSelectStep(pParse->db, yymsp[-1].minor.yy293, yymsp[-2].minor.yy504, yymsp[0].minor.yy504); /*yylhsminor.yy51-overwrites-yymsp[-1].minor.yy293*/}
161184 yymsp[-2].minor.yy51 = yylhsminor.yy51;
161185 break;
161186 case 272: /* expr ::= RAISE LP IGNORE RP */
161187 {
161188 yymsp[-3].minor.yy354 = sqlite3PExpr(pParse, TK_RAISE, 0, 0);
161189 if( yymsp[-3].minor.yy354 ){
161190 yymsp[-3].minor.yy354->affExpr = OE_Ignore;
161191 }
161192 }
161193 break;
161194 case 273: /* expr ::= RAISE LP raisetype COMMA nm RP */
161195 {
161196 yymsp[-5].minor.yy354 = sqlite3ExprAlloc(pParse->db, TK_RAISE, &yymsp[-1].minor.yy0, 1);
161197 if( yymsp[-5].minor.yy354 ) {
161198 yymsp[-5].minor.yy354->affExpr = (char)yymsp[-3].minor.yy412;
161199 }
161200 }
161201 break;
161202 case 274: /* raisetype ::= ROLLBACK */
161203 {yymsp[0].minor.yy412 = OE_Rollback;}
161204 break;
161205 case 276: /* raisetype ::= FAIL */
161206 {yymsp[0].minor.yy412 = OE_Fail;}
161207 break;
161208 case 277: /* cmd ::= DROP TRIGGER ifexists fullname */
161209 {
161210 sqlite3DropTrigger(pParse,yymsp[0].minor.yy457,yymsp[-1].minor.yy412);
161211 }
161212 break;
161213 case 278: /* cmd ::= ATTACH database_kw_opt expr AS expr key_opt */
161214 {
161215 sqlite3Attach(pParse, yymsp[-3].minor.yy354, yymsp[-1].minor.yy354, yymsp[0].minor.yy354);
161216 }
161217 break;
161218 case 279: /* cmd ::= DETACH database_kw_opt expr */
161219 {
161220 sqlite3Detach(pParse, yymsp[0].minor.yy354);
161221 }
161222 break;
161223 case 282: /* cmd ::= REINDEX */
161224 {sqlite3Reindex(pParse, 0, 0);}
161225 break;
@@ -161232,11 +161401,11 @@
161232 case 285: /* cmd ::= ANALYZE nm dbnm */
161233 {sqlite3Analyze(pParse, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0);}
161234 break;
161235 case 286: /* cmd ::= ALTER TABLE fullname RENAME TO nm */
161236 {
161237 sqlite3AlterRenameTable(pParse,yymsp[-3].minor.yy457,&yymsp[0].minor.yy0);
161238 }
161239 break;
161240 case 287: /* cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt columnname carglist */
161241 {
161242 yymsp[-1].minor.yy0.n = (int)(pParse->sLastToken.z-yymsp[-1].minor.yy0.z) + pParse->sLastToken.n;
@@ -161243,22 +161412,22 @@
161243 sqlite3AlterFinishAddColumn(pParse, &yymsp[-1].minor.yy0);
161244 }
161245 break;
161246 case 288: /* cmd ::= ALTER TABLE fullname DROP kwcolumn_opt nm */
161247 {
161248 sqlite3AlterDropColumn(pParse, yymsp[-3].minor.yy457, &yymsp[0].minor.yy0);
161249 }
161250 break;
161251 case 289: /* add_column_fullname ::= fullname */
161252 {
161253 disableLookaside(pParse);
161254 sqlite3AlterBeginAddColumn(pParse, yymsp[0].minor.yy457);
161255 }
161256 break;
161257 case 290: /* cmd ::= ALTER TABLE fullname RENAME kwcolumn_opt nm TO nm */
161258 {
161259 sqlite3AlterRenameColumn(pParse, yymsp[-5].minor.yy457, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0);
161260 }
161261 break;
161262 case 291: /* cmd ::= create_vtab */
161263 {sqlite3VtabFinishParse(pParse,0);}
161264 break;
@@ -161265,11 +161434,11 @@
161265 case 292: /* cmd ::= create_vtab LP vtabarglist RP */
161266 {sqlite3VtabFinishParse(pParse,&yymsp[0].minor.yy0);}
161267 break;
161268 case 293: /* create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm */
161269 {
161270 sqlite3VtabBeginParse(pParse, &yymsp[-3].minor.yy0, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-4].minor.yy412);
161271 }
161272 break;
161273 case 294: /* vtabarg ::= */
161274 {sqlite3VtabArgInit(pParse);}
161275 break;
@@ -161278,225 +161447,239 @@
161278 case 297: /* lp ::= LP */ yytestcase(yyruleno==297);
161279 {sqlite3VtabArgExtend(pParse,&yymsp[0].minor.yy0);}
161280 break;
161281 case 298: /* with ::= WITH wqlist */
161282 case 299: /* with ::= WITH RECURSIVE wqlist */ yytestcase(yyruleno==299);
161283 { sqlite3WithPush(pParse, yymsp[0].minor.yy105, 1); }
161284 break;
161285 case 300: /* wqlist ::= nm eidlist_opt AS LP select RP */
161286 {
161287 yymsp[-5].minor.yy105 = sqlite3WithAdd(pParse, 0, &yymsp[-5].minor.yy0, yymsp[-4].minor.yy350, yymsp[-1].minor.yy293); /*A-overwrites-X*/
161288 }
161289 break;
161290 case 301: /* wqlist ::= wqlist COMMA nm eidlist_opt AS LP select RP */
161291 {
161292 yymsp[-7].minor.yy105 = sqlite3WithAdd(pParse, yymsp[-7].minor.yy105, &yymsp[-5].minor.yy0, yymsp[-4].minor.yy350, yymsp[-1].minor.yy293);
161293 }
161294 break;
161295 case 302: /* windowdefn_list ::= windowdefn */
161296 { yylhsminor.yy503 = yymsp[0].minor.yy503; }
161297 yymsp[0].minor.yy503 = yylhsminor.yy503;
161298 break;
161299 case 303: /* windowdefn_list ::= windowdefn_list COMMA windowdefn */
161300 {
161301 assert( yymsp[0].minor.yy503!=0 );
161302 sqlite3WindowChain(pParse, yymsp[0].minor.yy503, yymsp[-2].minor.yy503);
161303 yymsp[0].minor.yy503->pNextWin = yymsp[-2].minor.yy503;
161304 yylhsminor.yy503 = yymsp[0].minor.yy503;
161305 }
161306 yymsp[-2].minor.yy503 = yylhsminor.yy503;
161307 break;
161308 case 304: /* windowdefn ::= nm AS LP window RP */
161309 {
161310 if( ALWAYS(yymsp[-1].minor.yy503) ){
161311 yymsp[-1].minor.yy503->zName = sqlite3DbStrNDup(pParse->db, yymsp[-4].minor.yy0.z, yymsp[-4].minor.yy0.n);
161312 }
161313 yylhsminor.yy503 = yymsp[-1].minor.yy503;
161314 }
161315 yymsp[-4].minor.yy503 = yylhsminor.yy503;
161316 break;
161317 case 305: /* window ::= PARTITION BY nexprlist orderby_opt frame_opt */
161318 {
161319 yymsp[-4].minor.yy503 = sqlite3WindowAssemble(pParse, yymsp[0].minor.yy503, yymsp[-2].minor.yy350, yymsp[-1].minor.yy350, 0);
161320 }
161321 break;
161322 case 306: /* window ::= nm PARTITION BY nexprlist orderby_opt frame_opt */
161323 {
161324 yylhsminor.yy503 = sqlite3WindowAssemble(pParse, yymsp[0].minor.yy503, yymsp[-2].minor.yy350, yymsp[-1].minor.yy350, &yymsp[-5].minor.yy0);
161325 }
161326 yymsp[-5].minor.yy503 = yylhsminor.yy503;
161327 break;
161328 case 307: /* window ::= ORDER BY sortlist frame_opt */
161329 {
161330 yymsp[-3].minor.yy503 = sqlite3WindowAssemble(pParse, yymsp[0].minor.yy503, 0, yymsp[-1].minor.yy350, 0);
161331 }
161332 break;
161333 case 308: /* window ::= nm ORDER BY sortlist frame_opt */
161334 {
161335 yylhsminor.yy503 = sqlite3WindowAssemble(pParse, yymsp[0].minor.yy503, 0, yymsp[-1].minor.yy350, &yymsp[-4].minor.yy0);
161336 }
161337 yymsp[-4].minor.yy503 = yylhsminor.yy503;
161338 break;
161339 case 309: /* window ::= frame_opt */
161340 case 328: /* filter_over ::= over_clause */ yytestcase(yyruleno==328);
161341 {
161342 yylhsminor.yy503 = yymsp[0].minor.yy503;
161343 }
161344 yymsp[0].minor.yy503 = yylhsminor.yy503;
161345 break;
161346 case 310: /* window ::= nm frame_opt */
161347 {
161348 yylhsminor.yy503 = sqlite3WindowAssemble(pParse, yymsp[0].minor.yy503, 0, 0, &yymsp[-1].minor.yy0);
161349 }
161350 yymsp[-1].minor.yy503 = yylhsminor.yy503;
161351 break;
161352 case 311: /* frame_opt ::= */
161353 {
161354 yymsp[1].minor.yy503 = sqlite3WindowAlloc(pParse, 0, TK_UNBOUNDED, 0, TK_CURRENT, 0, 0);
161355 }
161356 break;
161357 case 312: /* frame_opt ::= range_or_rows frame_bound_s frame_exclude_opt */
161358 {
161359 yylhsminor.yy503 = sqlite3WindowAlloc(pParse, yymsp[-2].minor.yy412, yymsp[-1].minor.yy341.eType, yymsp[-1].minor.yy341.pExpr, TK_CURRENT, 0, yymsp[0].minor.yy624);
161360 }
161361 yymsp[-2].minor.yy503 = yylhsminor.yy503;
161362 break;
161363 case 313: /* frame_opt ::= range_or_rows BETWEEN frame_bound_s AND frame_bound_e frame_exclude_opt */
161364 {
161365 yylhsminor.yy503 = sqlite3WindowAlloc(pParse, yymsp[-5].minor.yy412, yymsp[-3].minor.yy341.eType, yymsp[-3].minor.yy341.pExpr, yymsp[-1].minor.yy341.eType, yymsp[-1].minor.yy341.pExpr, yymsp[0].minor.yy624);
161366 }
161367 yymsp[-5].minor.yy503 = yylhsminor.yy503;
161368 break;
161369 case 315: /* frame_bound_s ::= frame_bound */
161370 case 317: /* frame_bound_e ::= frame_bound */ yytestcase(yyruleno==317);
161371 {yylhsminor.yy341 = yymsp[0].minor.yy341;}
161372 yymsp[0].minor.yy341 = yylhsminor.yy341;
161373 break;
161374 case 316: /* frame_bound_s ::= UNBOUNDED PRECEDING */
161375 case 318: /* frame_bound_e ::= UNBOUNDED FOLLOWING */ yytestcase(yyruleno==318);
161376 case 320: /* frame_bound ::= CURRENT ROW */ yytestcase(yyruleno==320);
161377 {yylhsminor.yy341.eType = yymsp[-1].major; yylhsminor.yy341.pExpr = 0;}
161378 yymsp[-1].minor.yy341 = yylhsminor.yy341;
161379 break;
161380 case 319: /* frame_bound ::= expr PRECEDING|FOLLOWING */
161381 {yylhsminor.yy341.eType = yymsp[0].major; yylhsminor.yy341.pExpr = yymsp[-1].minor.yy354;}
161382 yymsp[-1].minor.yy341 = yylhsminor.yy341;
161383 break;
161384 case 321: /* frame_exclude_opt ::= */
161385 {yymsp[1].minor.yy624 = 0;}
161386 break;
161387 case 322: /* frame_exclude_opt ::= EXCLUDE frame_exclude */
161388 {yymsp[-1].minor.yy624 = yymsp[0].minor.yy624;}
161389 break;
161390 case 323: /* frame_exclude ::= NO OTHERS */
161391 case 324: /* frame_exclude ::= CURRENT ROW */ yytestcase(yyruleno==324);
161392 {yymsp[-1].minor.yy624 = yymsp[-1].major; /*A-overwrites-X*/}
161393 break;
161394 case 325: /* frame_exclude ::= GROUP|TIES */
161395 {yymsp[0].minor.yy624 = yymsp[0].major; /*A-overwrites-X*/}
161396 break;
161397 case 326: /* window_clause ::= WINDOW windowdefn_list */
161398 { yymsp[-1].minor.yy503 = yymsp[0].minor.yy503; }
161399 break;
161400 case 327: /* filter_over ::= filter_clause over_clause */
161401 {
161402 yymsp[0].minor.yy503->pFilter = yymsp[-1].minor.yy354;
161403 yylhsminor.yy503 = yymsp[0].minor.yy503;
161404 }
161405 yymsp[-1].minor.yy503 = yylhsminor.yy503;
161406 break;
161407 case 329: /* filter_over ::= filter_clause */
161408 {
161409 yylhsminor.yy503 = (Window*)sqlite3DbMallocZero(pParse->db, sizeof(Window));
161410 if( yylhsminor.yy503 ){
161411 yylhsminor.yy503->eFrmType = TK_FILTER;
161412 yylhsminor.yy503->pFilter = yymsp[0].minor.yy354;
161413 }else{
161414 sqlite3ExprDelete(pParse->db, yymsp[0].minor.yy354);
161415 }
161416 }
161417 yymsp[0].minor.yy503 = yylhsminor.yy503;
161418 break;
161419 case 330: /* over_clause ::= OVER LP window RP */
161420 {
161421 yymsp[-3].minor.yy503 = yymsp[-1].minor.yy503;
161422 assert( yymsp[-3].minor.yy503!=0 );
161423 }
161424 break;
161425 case 331: /* over_clause ::= OVER nm */
161426 {
161427 yymsp[-1].minor.yy503 = (Window*)sqlite3DbMallocZero(pParse->db, sizeof(Window));
161428 if( yymsp[-1].minor.yy503 ){
161429 yymsp[-1].minor.yy503->zName = sqlite3DbStrNDup(pParse->db, yymsp[0].minor.yy0.z, yymsp[0].minor.yy0.n);
161430 }
161431 }
161432 break;
161433 case 332: /* filter_clause ::= FILTER LP WHERE expr RP */
161434 { yymsp[-4].minor.yy354 = yymsp[-1].minor.yy354; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
161435 break;
161436 default:
161437 /* (333) input ::= cmdlist */ yytestcase(yyruleno==333);
161438 /* (334) cmdlist ::= cmdlist ecmd */ yytestcase(yyruleno==334);
161439 /* (335) cmdlist ::= ecmd (OPTIMIZED OUT) */ assert(yyruleno!=335);
161440 /* (336) ecmd ::= SEMI */ yytestcase(yyruleno==336);
161441 /* (337) ecmd ::= cmdx SEMI */ yytestcase(yyruleno==337);
161442 /* (338) ecmd ::= explain cmdx SEMI (NEVER REDUCES) */ assert(yyruleno!=338);
161443 /* (339) trans_opt ::= */ yytestcase(yyruleno==339);
161444 /* (340) trans_opt ::= TRANSACTION */ yytestcase(yyruleno==340);
161445 /* (341) trans_opt ::= TRANSACTION nm */ yytestcase(yyruleno==341);
161446 /* (342) savepoint_opt ::= SAVEPOINT */ yytestcase(yyruleno==342);
161447 /* (343) savepoint_opt ::= */ yytestcase(yyruleno==343);
161448 /* (344) cmd ::= create_table create_table_args */ yytestcase(yyruleno==344);
161449 /* (345) columnlist ::= columnlist COMMA columnname carglist */ yytestcase(yyruleno==345);
161450 /* (346) columnlist ::= columnname carglist */ yytestcase(yyruleno==346);
161451 /* (347) nm ::= ID|INDEXED */ yytestcase(yyruleno==347);
161452 /* (348) nm ::= STRING */ yytestcase(yyruleno==348);
161453 /* (349) nm ::= JOIN_KW */ yytestcase(yyruleno==349);
161454 /* (350) typetoken ::= typename */ yytestcase(yyruleno==350);
161455 /* (351) typename ::= ID|STRING */ yytestcase(yyruleno==351);
161456 /* (352) signed ::= plus_num (OPTIMIZED OUT) */ assert(yyruleno!=352);
161457 /* (353) signed ::= minus_num (OPTIMIZED OUT) */ assert(yyruleno!=353);
161458 /* (354) carglist ::= carglist ccons */ yytestcase(yyruleno==354);
161459 /* (355) carglist ::= */ yytestcase(yyruleno==355);
161460 /* (356) ccons ::= NULL onconf */ yytestcase(yyruleno==356);
161461 /* (357) ccons ::= GENERATED ALWAYS AS generated */ yytestcase(yyruleno==357);
161462 /* (358) ccons ::= AS generated */ yytestcase(yyruleno==358);
161463 /* (359) conslist_opt ::= COMMA conslist */ yytestcase(yyruleno==359);
161464 /* (360) conslist ::= conslist tconscomma tcons */ yytestcase(yyruleno==360);
161465 /* (361) conslist ::= tcons (OPTIMIZED OUT) */ assert(yyruleno!=361);
161466 /* (362) tconscomma ::= */ yytestcase(yyruleno==362);
161467 /* (363) defer_subclause_opt ::= defer_subclause (OPTIMIZED OUT) */ assert(yyruleno!=363);
161468 /* (364) resolvetype ::= raisetype (OPTIMIZED OUT) */ assert(yyruleno!=364);
161469 /* (365) selectnowith ::= oneselect (OPTIMIZED OUT) */ assert(yyruleno!=365);
161470 /* (366) oneselect ::= values */ yytestcase(yyruleno==366);
161471 /* (367) sclp ::= selcollist COMMA */ yytestcase(yyruleno==367);
161472 /* (368) as ::= ID|STRING */ yytestcase(yyruleno==368);
161473 /* (369) returning ::= */ yytestcase(yyruleno==369);
161474 /* (370) expr ::= term (OPTIMIZED OUT) */ assert(yyruleno!=370);
161475 /* (371) likeop ::= LIKE_KW|MATCH */ yytestcase(yyruleno==371);
161476 /* (372) exprlist ::= nexprlist */ yytestcase(yyruleno==372);
161477 /* (373) nmnum ::= plus_num (OPTIMIZED OUT) */ assert(yyruleno!=373);
161478 /* (374) nmnum ::= nm (OPTIMIZED OUT) */ assert(yyruleno!=374);
161479 /* (375) nmnum ::= ON */ yytestcase(yyruleno==375);
161480 /* (376) nmnum ::= DELETE */ yytestcase(yyruleno==376);
161481 /* (377) nmnum ::= DEFAULT */ yytestcase(yyruleno==377);
161482 /* (378) plus_num ::= INTEGER|FLOAT */ yytestcase(yyruleno==378);
161483 /* (379) foreach_clause ::= */ yytestcase(yyruleno==379);
161484 /* (380) foreach_clause ::= FOR EACH ROW */ yytestcase(yyruleno==380);
161485 /* (381) trnm ::= nm */ yytestcase(yyruleno==381);
161486 /* (382) tridxby ::= */ yytestcase(yyruleno==382);
161487 /* (383) database_kw_opt ::= DATABASE */ yytestcase(yyruleno==383);
161488 /* (384) database_kw_opt ::= */ yytestcase(yyruleno==384);
161489 /* (385) kwcolumn_opt ::= */ yytestcase(yyruleno==385);
161490 /* (386) kwcolumn_opt ::= COLUMNKW */ yytestcase(yyruleno==386);
161491 /* (387) vtabarglist ::= vtabarg */ yytestcase(yyruleno==387);
161492 /* (388) vtabarglist ::= vtabarglist COMMA vtabarg */ yytestcase(yyruleno==388);
161493 /* (389) vtabarg ::= vtabarg vtabargtoken */ yytestcase(yyruleno==389);
161494 /* (390) anylist ::= */ yytestcase(yyruleno==390);
161495 /* (391) anylist ::= anylist LP anylist RP */ yytestcase(yyruleno==391);
161496 /* (392) anylist ::= anylist ANY */ yytestcase(yyruleno==392);
161497 /* (393) with ::= */ yytestcase(yyruleno==393);
161498 break;
161499 /********** End reduce actions ************************************************/
161500 };
161501 assert( yyruleno<sizeof(yyRuleInfoLhs)/sizeof(yyRuleInfoLhs[0]) );
161502 yygoto = yyRuleInfoLhs[yyruleno];
@@ -161999,25 +162182,25 @@
161999 ** might be implemented more directly using a hand-written hash table.
162000 ** But by using this automatically generated code, the size of the code
162001 ** is substantially reduced. This is important for embedded applications
162002 ** on platforms with limited memory.
162003 */
162004 /* Hash score: 229 */
162005 /* zKWText[] encodes 994 bytes of keyword text in 657 bytes */
162006 /* REINDEXEDESCAPEACHECKEYBEFOREIGNOREGEXPLAINSTEADDATABASELECT */
162007 /* ABLEFTHENDEFERRABLELSEXCLUDELETEMPORARYISNULLSAVEPOINTERSECT */
162008 /* IESNOTNULLIKEXCEPTRANSACTIONATURALTERAISEXCLUSIVEXISTS */
162009 /* CONSTRAINTOFFSETRIGGERANGENERATEDETACHAVINGLOBEGINNEREFERENCES */
162010 /* UNIQUERYWITHOUTERELEASEATTACHBETWEENOTHINGROUPSCASCADEFAULT */
162011 /* CASECOLLATECREATECURRENT_DATEIMMEDIATEJOINSERTMATCHPLANALYZE */
162012 /* PRAGMABORTUPDATEVALUESVIRTUALWAYSWHENWHERECURSIVEAFTERENAMEAND */
162013 /* EFERREDISTINCTAUTOINCREMENTCASTCOLUMNCOMMITCONFLICTCROSS */
162014 /* CURRENT_TIMESTAMPARTITIONDROPRECEDINGFAILASTFILTEREPLACEFIRST */
162015 /* FOLLOWINGFROMFULLIMITIFORDERESTRICTOTHERSOVERETURNINGRIGHT */
162016 /* ROLLBACKROWSUNBOUNDEDUNIONUSINGVACUUMVIEWINDOWBYINITIALLY */
162017 /* PRIMARY */
162018 static const char zKWText[656] = {
162019 'R','E','I','N','D','E','X','E','D','E','S','C','A','P','E','A','C','H',
162020 'E','C','K','E','Y','B','E','F','O','R','E','I','G','N','O','R','E','G',
162021 'E','X','P','L','A','I','N','S','T','E','A','D','D','A','T','A','B','A',
162022 'S','E','L','E','C','T','A','B','L','E','F','T','H','E','N','D','E','F',
162023 'E','R','R','A','B','L','E','L','S','E','X','C','L','U','D','E','L','E',
@@ -162034,91 +162217,91 @@
162034 'E','N','O','T','H','I','N','G','R','O','U','P','S','C','A','S','C','A',
162035 'D','E','F','A','U','L','T','C','A','S','E','C','O','L','L','A','T','E',
162036 'C','R','E','A','T','E','C','U','R','R','E','N','T','_','D','A','T','E',
162037 'I','M','M','E','D','I','A','T','E','J','O','I','N','S','E','R','T','M',
162038 'A','T','C','H','P','L','A','N','A','L','Y','Z','E','P','R','A','G','M',
162039 'A','B','O','R','T','U','P','D','A','T','E','V','A','L','U','E','S','V',
162040 'I','R','T','U','A','L','W','A','Y','S','W','H','E','N','W','H','E','R',
162041 'E','C','U','R','S','I','V','E','A','F','T','E','R','E','N','A','M','E',
162042 'A','N','D','E','F','E','R','R','E','D','I','S','T','I','N','C','T','A',
162043 'U','T','O','I','N','C','R','E','M','E','N','T','C','A','S','T','C','O',
162044 'L','U','M','N','C','O','M','M','I','T','C','O','N','F','L','I','C','T',
162045 'C','R','O','S','S','C','U','R','R','E','N','T','_','T','I','M','E','S',
162046 'T','A','M','P','A','R','T','I','T','I','O','N','D','R','O','P','R','E',
162047 'C','E','D','I','N','G','F','A','I','L','A','S','T','F','I','L','T','E',
162048 'R','E','P','L','A','C','E','F','I','R','S','T','F','O','L','L','O','W',
162049 'I','N','G','F','R','O','M','F','U','L','L','I','M','I','T','I','F','O',
162050 'R','D','E','R','E','S','T','R','I','C','T','O','T','H','E','R','S','O',
162051 'V','E','R','E','T','U','R','N','I','N','G','R','I','G','H','T','R','O',
162052 'L','L','B','A','C','K','R','O','W','S','U','N','B','O','U','N','D','E',
162053 'D','U','N','I','O','N','U','S','I','N','G','V','A','C','U','U','M','V',
162054 'I','E','W','I','N','D','O','W','B','Y','I','N','I','T','I','A','L','L',
162055 'Y','P','R','I','M','A','R','Y',
162056 };
162057 /* aKWHash[i] is the hash value for the i-th keyword */
162058 static const unsigned char aKWHash[127] = {
162059 84, 102, 133, 82, 114, 29, 0, 0, 91, 0, 85, 72, 0,
162060 53, 35, 86, 15, 0, 42, 94, 54, 126, 134, 19, 0, 0,
162061 139, 0, 40, 128, 0, 22, 104, 0, 9, 0, 0, 122, 80,
162062 0, 78, 6, 0, 65, 99, 146, 0, 135, 112, 0, 0, 48,
162063 0, 100, 24, 0, 17, 0, 27, 70, 23, 26, 5, 60, 141,
162064 107, 121, 0, 73, 101, 71, 144, 61, 119, 74, 0, 49, 0,
162065 11, 41, 0, 110, 0, 0, 0, 106, 10, 108, 113, 124, 14,
162066 50, 123, 0, 89, 0, 18, 120, 143, 56, 129, 138, 88, 83,
162067 37, 30, 125, 0, 0, 105, 51, 130, 127, 0, 34, 0, 0,
162068 131, 0, 95, 38, 39, 0, 20, 45, 116, 90,
162069 };
162070 /* aKWNext[] forms the hash collision chain. If aKWHash[i]==0
162071 ** then the i-th keyword has no more hash collisions. Otherwise,
162072 ** the next keyword with the same hash is aKWHash[i]-1. */
162073 static const unsigned char aKWNext[146] = {
162074 0, 0, 0, 0, 4, 0, 43, 0, 0, 103, 111, 0, 0,
162075 0, 2, 0, 0, 142, 0, 0, 0, 13, 0, 0, 0, 0,
162076 140, 0, 0, 118, 52, 0, 0, 136, 12, 0, 0, 62, 0,
162077 137, 0, 132, 0, 0, 36, 0, 0, 28, 77, 0, 0, 0,
162078 0, 59, 0, 47, 0, 0, 0, 0, 0, 0, 0, 0, 0,
162079 0, 69, 0, 0, 0, 0, 0, 145, 3, 0, 58, 0, 1,
162080 75, 0, 0, 0, 31, 0, 0, 0, 0, 0, 0, 64, 66,
162081 63, 0, 0, 0, 0, 46, 0, 16, 0, 115, 0, 0, 0,
162082 0, 0, 0, 0, 0, 0, 0, 81, 97, 0, 8, 0, 109,
162083 21, 7, 67, 0, 79, 93, 117, 0, 0, 68, 0, 0, 96,
162084 44, 0, 55, 0, 76, 0, 92, 32, 33, 57, 25, 0, 98,
162085 0, 0, 87,
162086 };
162087 /* aKWLen[i] is the length (in bytes) of the i-th keyword */
162088 static const unsigned char aKWLen[146] = {
162089 7, 7, 5, 4, 6, 4, 5, 3, 6, 7, 3, 6, 6,
162090 7, 7, 3, 8, 2, 6, 5, 4, 4, 3, 10, 4, 7,
162091 6, 9, 4, 2, 6, 5, 9, 9, 4, 7, 3, 2, 4,
162092 4, 6, 11, 6, 2, 7, 5, 5, 9, 6, 10, 4, 6,
162093 2, 3, 7, 5, 9, 6, 6, 4, 5, 5, 10, 6, 5,
162094 7, 4, 5, 7, 6, 7, 7, 6, 5, 7, 3, 7, 4,
162095 7, 6, 12, 9, 4, 6, 5, 4, 7, 6, 5, 6, 6,
162096 7, 6, 4, 5, 9, 5, 6, 3, 8, 8, 2, 13, 2,
162097 2, 4, 6, 6, 8, 5, 17, 12, 7, 9, 4, 9, 4,
162098 4, 6, 7, 5, 9, 4, 4, 5, 2, 5, 8, 6, 4,
162099 9, 5, 8, 4, 3, 9, 5, 5, 6, 4, 6, 2, 2,
162100 9, 3, 7,
162101 };
162102 /* aKWOffset[i] is the index into zKWText[] of the start of
162103 ** the text for the i-th keyword. */
162104 static const unsigned short int aKWOffset[146] = {
162105 0, 2, 2, 8, 9, 14, 16, 20, 23, 25, 25, 29, 33,
162106 36, 41, 46, 48, 53, 54, 59, 62, 65, 67, 69, 78, 81,
162107 86, 90, 90, 94, 99, 101, 105, 111, 119, 123, 123, 123, 126,
162108 129, 132, 137, 142, 146, 147, 152, 156, 160, 168, 174, 181, 184,
162109 184, 187, 189, 195, 198, 206, 211, 216, 219, 222, 226, 236, 239,
162110 244, 244, 248, 252, 259, 265, 271, 277, 277, 283, 284, 288, 295,
162111 299, 306, 312, 324, 333, 335, 341, 346, 348, 355, 360, 365, 371,
162112 377, 382, 388, 392, 395, 404, 408, 414, 416, 423, 424, 431, 433,
162113 435, 444, 448, 454, 460, 468, 473, 473, 473, 489, 498, 501, 510,
162114 513, 517, 522, 529, 534, 543, 547, 550, 555, 557, 561, 569, 575,
162115 578, 587, 592, 600, 600, 604, 613, 618, 623, 629, 632, 635, 638,
162116 640, 645, 649,
162117 };
162118 /* aKWCode[i] is the parser symbol code for the i-th keyword */
162119 static const unsigned char aKWCode[146] = {
162120 TK_REINDEX, TK_INDEXED, TK_INDEX, TK_DESC, TK_ESCAPE,
162121 TK_EACH, TK_CHECK, TK_KEY, TK_BEFORE, TK_FOREIGN,
162122 TK_FOR, TK_IGNORE, TK_LIKE_KW, TK_EXPLAIN, TK_INSTEAD,
162123 TK_ADD, TK_DATABASE, TK_AS, TK_SELECT, TK_TABLE,
162124 TK_JOIN_KW, TK_THEN, TK_END, TK_DEFERRABLE, TK_ELSE,
@@ -162132,23 +162315,23 @@
162132 TK_BEGIN, TK_JOIN_KW, TK_REFERENCES, TK_UNIQUE, TK_QUERY,
162133 TK_WITHOUT, TK_WITH, TK_JOIN_KW, TK_RELEASE, TK_ATTACH,
162134 TK_BETWEEN, TK_NOTHING, TK_GROUPS, TK_GROUP, TK_CASCADE,
162135 TK_ASC, TK_DEFAULT, TK_CASE, TK_COLLATE, TK_CREATE,
162136 TK_CTIME_KW, TK_IMMEDIATE, TK_JOIN, TK_INSERT, TK_MATCH,
162137 TK_PLAN, TK_ANALYZE, TK_PRAGMA, TK_ABORT, TK_UPDATE,
162138 TK_VALUES, TK_VIRTUAL, TK_ALWAYS, TK_WHEN, TK_WHERE,
162139 TK_RECURSIVE, TK_AFTER, TK_RENAME, TK_AND, TK_DEFERRED,
162140 TK_DISTINCT, TK_IS, TK_AUTOINCR, TK_TO, TK_IN,
162141 TK_CAST, TK_COLUMNKW, TK_COMMIT, TK_CONFLICT, TK_JOIN_KW,
162142 TK_CTIME_KW, TK_CTIME_KW, TK_CURRENT, TK_PARTITION, TK_DROP,
162143 TK_PRECEDING, TK_FAIL, TK_LAST, TK_FILTER, TK_REPLACE,
162144 TK_FIRST, TK_FOLLOWING, TK_FROM, TK_JOIN_KW, TK_LIMIT,
162145 TK_IF, TK_ORDER, TK_RESTRICT, TK_OTHERS, TK_OVER,
162146 TK_RETURNING, TK_JOIN_KW, TK_ROLLBACK, TK_ROWS, TK_ROW,
162147 TK_UNBOUNDED, TK_UNION, TK_USING, TK_VACUUM, TK_VIEW,
162148 TK_WINDOW, TK_DO, TK_BY, TK_INITIALLY, TK_ALL,
162149 TK_PRIMARY,
162150 };
162151 /* Hash table decoded:
162152 ** 0: INSERT
162153 ** 1: IS
162154 ** 2: ROLLBACK TRIGGER
@@ -162168,11 +162351,11 @@
162168 ** 16: INSTEAD INDEXED
162169 ** 17:
162170 ** 18: TRANSACTION RIGHT
162171 ** 19: WHEN
162172 ** 20: SET HAVING
162173 ** 21: IF
162174 ** 22: ROWS
162175 ** 23: SELECT
162176 ** 24:
162177 ** 25:
162178 ** 26: VACUUM SAVEPOINT
@@ -162387,68 +162570,69 @@
162387 testcase( i==83 ); /* INSERT */
162388 testcase( i==84 ); /* MATCH */
162389 testcase( i==85 ); /* PLAN */
162390 testcase( i==86 ); /* ANALYZE */
162391 testcase( i==87 ); /* PRAGMA */
162392 testcase( i==88 ); /* ABORT */
162393 testcase( i==89 ); /* UPDATE */
162394 testcase( i==90 ); /* VALUES */
162395 testcase( i==91 ); /* VIRTUAL */
162396 testcase( i==92 ); /* ALWAYS */
162397 testcase( i==93 ); /* WHEN */
162398 testcase( i==94 ); /* WHERE */
162399 testcase( i==95 ); /* RECURSIVE */
162400 testcase( i==96 ); /* AFTER */
162401 testcase( i==97 ); /* RENAME */
162402 testcase( i==98 ); /* AND */
162403 testcase( i==99 ); /* DEFERRED */
162404 testcase( i==100 ); /* DISTINCT */
162405 testcase( i==101 ); /* IS */
162406 testcase( i==102 ); /* AUTOINCREMENT */
162407 testcase( i==103 ); /* TO */
162408 testcase( i==104 ); /* IN */
162409 testcase( i==105 ); /* CAST */
162410 testcase( i==106 ); /* COLUMN */
162411 testcase( i==107 ); /* COMMIT */
162412 testcase( i==108 ); /* CONFLICT */
162413 testcase( i==109 ); /* CROSS */
162414 testcase( i==110 ); /* CURRENT_TIMESTAMP */
162415 testcase( i==111 ); /* CURRENT_TIME */
162416 testcase( i==112 ); /* CURRENT */
162417 testcase( i==113 ); /* PARTITION */
162418 testcase( i==114 ); /* DROP */
162419 testcase( i==115 ); /* PRECEDING */
162420 testcase( i==116 ); /* FAIL */
162421 testcase( i==117 ); /* LAST */
162422 testcase( i==118 ); /* FILTER */
162423 testcase( i==119 ); /* REPLACE */
162424 testcase( i==120 ); /* FIRST */
162425 testcase( i==121 ); /* FOLLOWING */
162426 testcase( i==122 ); /* FROM */
162427 testcase( i==123 ); /* FULL */
162428 testcase( i==124 ); /* LIMIT */
162429 testcase( i==125 ); /* IF */
162430 testcase( i==126 ); /* ORDER */
162431 testcase( i==127 ); /* RESTRICT */
162432 testcase( i==128 ); /* OTHERS */
162433 testcase( i==129 ); /* OVER */
162434 testcase( i==130 ); /* RETURNING */
162435 testcase( i==131 ); /* RIGHT */
162436 testcase( i==132 ); /* ROLLBACK */
162437 testcase( i==133 ); /* ROWS */
162438 testcase( i==134 ); /* ROW */
162439 testcase( i==135 ); /* UNBOUNDED */
162440 testcase( i==136 ); /* UNION */
162441 testcase( i==137 ); /* USING */
162442 testcase( i==138 ); /* VACUUM */
162443 testcase( i==139 ); /* VIEW */
162444 testcase( i==140 ); /* WINDOW */
162445 testcase( i==141 ); /* DO */
162446 testcase( i==142 ); /* BY */
162447 testcase( i==143 ); /* INITIALLY */
162448 testcase( i==144 ); /* ALL */
162449 testcase( i==145 ); /* PRIMARY */
 
162450 *pType = aKWCode[i];
162451 break;
162452 }
162453 }
162454 return n;
@@ -162456,11 +162640,11 @@
162456 SQLITE_PRIVATE int sqlite3KeywordCode(const unsigned char *z, int n){
162457 int id = TK_ID;
162458 keywordCode((char*)z, n, &id);
162459 return id;
162460 }
162461 #define SQLITE_N_KEYWORD 146
162462 SQLITE_API int sqlite3_keyword_name(int i,const char **pzName,int *pnName){
162463 if( i<0 || i>=SQLITE_N_KEYWORD ) return SQLITE_ERROR;
162464 *pzName = zKWText + aKWOffset[i];
162465 *pnName = aKWLen[i];
162466 return SQLITE_OK;
@@ -184069,27 +184253,31 @@
184069 if( pNode->block.a){
184070 rc = nodeReaderInit(&reader, pNode->block.a, pNode->block.n);
184071 while( reader.aNode && rc==SQLITE_OK ) rc = nodeReaderNext(&reader);
184072 blobGrowBuffer(&pNode->key, reader.term.n, &rc);
184073 if( rc==SQLITE_OK ){
184074 memcpy(pNode->key.a, reader.term.a, reader.term.n);
184075 pNode->key.n = reader.term.n;
184076 if( i>0 ){
184077 char *aBlock = 0;
184078 int nBlock = 0;
184079 pNode = &pWriter->aNodeWriter[i-1];
184080 pNode->iBlock = reader.iChild;
184081 rc = sqlite3Fts3ReadBlock(p, reader.iChild, &aBlock, &nBlock, 0);
184082 blobGrowBuffer(&pNode->block,
184083 MAX(nBlock, p->nNodeSize)+FTS3_NODE_PADDING, &rc
184084 );
184085 if( rc==SQLITE_OK ){
184086 memcpy(pNode->block.a, aBlock, nBlock);
184087 pNode->block.n = nBlock;
184088 memset(&pNode->block.a[nBlock], 0, FTS3_NODE_PADDING);
184089 }
184090 sqlite3_free(aBlock);
 
 
 
 
184091 }
184092 }
184093 }
184094 nodeReaderRelease(&reader);
184095 }
@@ -205169,10 +205357,11 @@
205169 struct sqlite3_changeset_iter {
205170 SessionInput in; /* Input buffer or stream */
205171 SessionBuffer tblhdr; /* Buffer to hold apValue/zTab/abPK/ */
205172 int bPatchset; /* True if this is a patchset */
205173 int bInvert; /* True to invert changeset */
 
205174 int rc; /* Iterator error code */
205175 sqlite3_stmt *pConflict; /* Points to conflicting row, if any */
205176 char *zTab; /* Current table */
205177 int nCol; /* Number of columns in zTab */
205178 int op; /* Current operation */
@@ -207698,11 +207887,12 @@
207698 sqlite3_changeset_iter **pp, /* OUT: Changeset iterator handle */
207699 int (*xInput)(void *pIn, void *pData, int *pnData),
207700 void *pIn,
207701 int nChangeset, /* Size of buffer pChangeset in bytes */
207702 void *pChangeset, /* Pointer to buffer containing changeset */
207703 int bInvert /* True to invert changeset */
 
207704 ){
207705 sqlite3_changeset_iter *pRet; /* Iterator to return */
207706 int nByte; /* Number of bytes to allocate for iterator */
207707
207708 assert( xInput==0 || (pChangeset==0 && nChangeset==0) );
@@ -207719,10 +207909,11 @@
207719 pRet->in.nData = nChangeset;
207720 pRet->in.xInput = xInput;
207721 pRet->in.pIn = pIn;
207722 pRet->in.bEof = (xInput ? 0 : 1);
207723 pRet->bInvert = bInvert;
 
207724
207725 /* Populate the output variable and return success. */
207726 *pp = pRet;
207727 return SQLITE_OK;
207728 }
@@ -207733,20 +207924,20 @@
207733 SQLITE_API int sqlite3changeset_start(
207734 sqlite3_changeset_iter **pp, /* OUT: Changeset iterator handle */
207735 int nChangeset, /* Size of buffer pChangeset in bytes */
207736 void *pChangeset /* Pointer to buffer containing changeset */
207737 ){
207738 return sessionChangesetStart(pp, 0, 0, nChangeset, pChangeset, 0);
207739 }
207740 SQLITE_API int sqlite3changeset_start_v2(
207741 sqlite3_changeset_iter **pp, /* OUT: Changeset iterator handle */
207742 int nChangeset, /* Size of buffer pChangeset in bytes */
207743 void *pChangeset, /* Pointer to buffer containing changeset */
207744 int flags
207745 ){
207746 int bInvert = !!(flags & SQLITE_CHANGESETSTART_INVERT);
207747 return sessionChangesetStart(pp, 0, 0, nChangeset, pChangeset, bInvert);
207748 }
207749
207750 /*
207751 ** Streaming version of sqlite3changeset_start().
207752 */
@@ -207753,20 +207944,20 @@
207753 SQLITE_API int sqlite3changeset_start_strm(
207754 sqlite3_changeset_iter **pp, /* OUT: Changeset iterator handle */
207755 int (*xInput)(void *pIn, void *pData, int *pnData),
207756 void *pIn
207757 ){
207758 return sessionChangesetStart(pp, xInput, pIn, 0, 0, 0);
207759 }
207760 SQLITE_API int sqlite3changeset_start_v2_strm(
207761 sqlite3_changeset_iter **pp, /* OUT: Changeset iterator handle */
207762 int (*xInput)(void *pIn, void *pData, int *pnData),
207763 void *pIn,
207764 int flags
207765 ){
207766 int bInvert = !!(flags & SQLITE_CHANGESETSTART_INVERT);
207767 return sessionChangesetStart(pp, xInput, pIn, 0, 0, bInvert);
207768 }
207769
207770 /*
207771 ** If the SessionInput object passed as the only argument is a streaming
207772 ** object and the buffer is full, discard some data to free up space.
@@ -207888,15 +208079,18 @@
207888 */
207889 static int sessionReadRecord(
207890 SessionInput *pIn, /* Input data */
207891 int nCol, /* Number of values in record */
207892 u8 *abPK, /* Array of primary key flags, or NULL */
207893 sqlite3_value **apOut /* Write values to this array */
 
207894 ){
207895 int i; /* Used to iterate through columns */
207896 int rc = SQLITE_OK;
207897
 
 
207898 for(i=0; i<nCol && rc==SQLITE_OK; i++){
207899 int eType = 0; /* Type of value (SQLITE_NULL, TEXT etc.) */
207900 if( abPK && abPK[i]==0 ) continue;
207901 rc = sessionInputBuffer(pIn, 9);
207902 if( rc==SQLITE_OK ){
@@ -207904,10 +208098,11 @@
207904 rc = SQLITE_CORRUPT_BKPT;
207905 }else{
207906 eType = pIn->aData[pIn->iNext++];
207907 assert( apOut[i]==0 );
207908 if( eType ){
 
207909 apOut[i] = sqlite3ValueNew(0);
207910 if( !apOut[i] ) rc = SQLITE_NOMEM;
207911 }
207912 }
207913 }
@@ -208083,35 +208278,31 @@
208083 }
208084 return (p->rc = rc);
208085 }
208086
208087 /*
208088 ** Advance the changeset iterator to the next change.
208089 **
208090 ** If both paRec and pnRec are NULL, then this function works like the public
208091 ** API sqlite3changeset_next(). If SQLITE_ROW is returned, then the
208092 ** sqlite3changeset_new() and old() APIs may be used to query for values.
208093 **
208094 ** Otherwise, if paRec and pnRec are not NULL, then a pointer to the change
208095 ** record is written to *paRec before returning and the number of bytes in
208096 ** the record to *pnRec.
208097 **
208098 ** Either way, this function returns SQLITE_ROW if the iterator is
208099 ** successfully advanced to the next change in the changeset, an SQLite
208100 ** error code if an error occurs, or SQLITE_DONE if there are no further
208101 ** changes in the changeset.
208102 */
208103 static int sessionChangesetNext(
208104 sqlite3_changeset_iter *p, /* Changeset iterator */
208105 u8 **paRec, /* If non-NULL, store record pointer here */
208106 int *pnRec, /* If non-NULL, store size of record here */
208107 int *pbNew /* If non-NULL, true if new table */
 
208108 ){
208109 int i;
208110 u8 op;
208111
208112 assert( (paRec==0 && pnRec==0) || (paRec && pnRec) );
 
208113
208114 /* If the iterator is in the error-state, return immediately. */
208115 if( p->rc!=SQLITE_OK ) return p->rc;
208116
208117 /* Free the current contents of p->apValue[], if any. */
@@ -208180,17 +208371,17 @@
208180 sqlite3_value **apNew = (p->bInvert ? p->apValue : &p->apValue[p->nCol]);
208181
208182 /* If this is an UPDATE or DELETE, read the old.* record. */
208183 if( p->op!=SQLITE_INSERT && (p->bPatchset==0 || p->op==SQLITE_DELETE) ){
208184 u8 *abPK = p->bPatchset ? p->abPK : 0;
208185 p->rc = sessionReadRecord(&p->in, p->nCol, abPK, apOld);
208186 if( p->rc!=SQLITE_OK ) return p->rc;
208187 }
208188
208189 /* If this is an INSERT or UPDATE, read the new.* record. */
208190 if( p->op!=SQLITE_DELETE ){
208191 p->rc = sessionReadRecord(&p->in, p->nCol, 0, apNew);
208192 if( p->rc!=SQLITE_OK ) return p->rc;
208193 }
208194
208195 if( (p->bPatchset || p->bInvert) && p->op==SQLITE_UPDATE ){
208196 /* If this is an UPDATE that is part of a patchset, then all PK and
@@ -208212,10 +208403,41 @@
208212 }
208213 }
208214
208215 return SQLITE_ROW;
208216 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
208217
208218 /*
208219 ** Advance an iterator created by sqlite3changeset_start() to the next
208220 ** change in the changeset. This function may return SQLITE_ROW, SQLITE_DONE
208221 ** or SQLITE_CORRUPT.
@@ -208485,13 +208707,13 @@
208485 sessionAppendByte(&sOut, eType, &rc);
208486 sessionAppendByte(&sOut, pInput->aData[pInput->iNext+1], &rc);
208487
208488 /* Read the old.* and new.* records for the update change. */
208489 pInput->iNext += 2;
208490 rc = sessionReadRecord(pInput, nCol, 0, &apVal[0]);
208491 if( rc==SQLITE_OK ){
208492 rc = sessionReadRecord(pInput, nCol, 0, &apVal[nCol]);
208493 }
208494
208495 /* Write the new old.* record. Consists of the PK columns from the
208496 ** original old.* record, and the other values from the original
208497 ** new.* record. */
@@ -209435,11 +209657,11 @@
209435 sqlite3_changeset_iter *pIter2 = 0;
209436 SessionBuffer cons = pApply->constraints;
209437 memset(&pApply->constraints, 0, sizeof(SessionBuffer));
209438
209439 rc = sessionChangesetStart(
209440 &pIter2, 0, 0, cons.nBuf, cons.aBuf, pApply->bInvertConstraints
209441 );
209442 if( rc==SQLITE_OK ){
209443 size_t nByte = 2*pApply->nCol*sizeof(sqlite3_value*);
209444 int rc2;
209445 pIter2->bPatchset = bPatchset;
@@ -209691,12 +209913,12 @@
209691 void *pCtx, /* First argument passed to xConflict */
209692 void **ppRebase, int *pnRebase,
209693 int flags
209694 ){
209695 sqlite3_changeset_iter *pIter; /* Iterator to skip through changeset */
209696 int bInverse = !!(flags & SQLITE_CHANGESETAPPLY_INVERT);
209697 int rc = sessionChangesetStart(&pIter, 0, 0, nChangeset, pChangeset,bInverse);
209698 if( rc==SQLITE_OK ){
209699 rc = sessionChangesetApply(
209700 db, pIter, xFilter, xConflict, pCtx, ppRebase, pnRebase, flags
209701 );
209702 }
@@ -209750,11 +209972,11 @@
209750 void **ppRebase, int *pnRebase,
209751 int flags
209752 ){
209753 sqlite3_changeset_iter *pIter; /* Iterator to skip through changeset */
209754 int bInverse = !!(flags & SQLITE_CHANGESETAPPLY_INVERT);
209755 int rc = sessionChangesetStart(&pIter, xInput, pIn, 0, 0, bInverse);
209756 if( rc==SQLITE_OK ){
209757 rc = sessionChangesetApply(
209758 db, pIter, xFilter, xConflict, pCtx, ppRebase, pnRebase, flags
209759 );
209760 }
@@ -210370,11 +210592,11 @@
210370 *pOut++ = pIter->bIndirect;
210371 for(i=0; i<pIter->nCol; i++){
210372 int n1 = sessionSerialLen(a1);
210373 int n2 = sessionSerialLen(a2);
210374 if( pIter->abPK[i] || a2[0]==0 ){
210375 if( !pIter->abPK[i] ) bData = 1;
210376 memcpy(pOut, a1, n1);
210377 pOut += n1;
210378 }else if( a2[0]!=0xFF ){
210379 bData = 1;
210380 memcpy(pOut, a2, n2);
@@ -228768,11 +228990,11 @@
228768 int nArg, /* Number of args */
228769 sqlite3_value **apUnused /* Function arguments */
228770 ){
228771 assert( nArg==0 );
228772 UNUSED_PARAM2(nArg, apUnused);
228773 sqlite3_result_text(pCtx, "fts5: 2021-02-17 13:19:22 c46a94a624c2cc6c49ac916a206a913081e1628c24805987cabc75c9057ea36b", -1, SQLITE_TRANSIENT);
228774 }
228775
228776 /*
228777 ** Return true if zName is the extension on one of the shadow tables used
228778 ** by this module.
@@ -233694,12 +233916,12 @@
233694 }
233695 #endif /* SQLITE_CORE */
233696 #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_STMTVTAB) */
233697
233698 /************** End of stmt.c ************************************************/
233699 #if __LINE__!=233699
233700 #undef SQLITE_SOURCE_ID
233701 #define SQLITE_SOURCE_ID "2021-02-19 14:32:58 c844a331e78949850fde8ed95058cb34f863566944bc9e92e3ae042768f1alt2"
233702 #endif
233703 /* Return the source-id for this library */
233704 SQLITE_API const char *sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; }
233705 /************************** End of sqlite3.c ******************************/
233706
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -1186,11 +1186,11 @@
1186 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
1187 ** [sqlite_version()] and [sqlite_source_id()].
1188 */
1189 #define SQLITE_VERSION "3.35.0"
1190 #define SQLITE_VERSION_NUMBER 3035000
1191 #define SQLITE_SOURCE_ID "2021-02-22 16:42:09 b5a0778cc5a98a864bea72670f83262da940aceb91fa4cdf46ec097337a3alt1"
1192
1193 /*
1194 ** CAPI3REF: Run-Time Library Version Numbers
1195 ** KEYWORDS: sqlite3_version sqlite3_sourceid
1196 **
@@ -14125,95 +14125,96 @@
14125 #define TK_GROUPS 92
14126 #define TK_OTHERS 93
14127 #define TK_TIES 94
14128 #define TK_GENERATED 95
14129 #define TK_ALWAYS 96
14130 #define TK_MATERIALIZED 97
14131 #define TK_REINDEX 98
14132 #define TK_RENAME 99
14133 #define TK_CTIME_KW 100
14134 #define TK_ANY 101
14135 #define TK_BITAND 102
14136 #define TK_BITOR 103
14137 #define TK_LSHIFT 104
14138 #define TK_RSHIFT 105
14139 #define TK_PLUS 106
14140 #define TK_MINUS 107
14141 #define TK_STAR 108
14142 #define TK_SLASH 109
14143 #define TK_REM 110
14144 #define TK_CONCAT 111
14145 #define TK_COLLATE 112
14146 #define TK_BITNOT 113
14147 #define TK_ON 114
14148 #define TK_INDEXED 115
14149 #define TK_STRING 116
14150 #define TK_JOIN_KW 117
14151 #define TK_CONSTRAINT 118
14152 #define TK_DEFAULT 119
14153 #define TK_NULL 120
14154 #define TK_PRIMARY 121
14155 #define TK_UNIQUE 122
14156 #define TK_CHECK 123
14157 #define TK_REFERENCES 124
14158 #define TK_AUTOINCR 125
14159 #define TK_INSERT 126
14160 #define TK_DELETE 127
14161 #define TK_UPDATE 128
14162 #define TK_SET 129
14163 #define TK_DEFERRABLE 130
14164 #define TK_FOREIGN 131
14165 #define TK_DROP 132
14166 #define TK_UNION 133
14167 #define TK_ALL 134
14168 #define TK_EXCEPT 135
14169 #define TK_INTERSECT 136
14170 #define TK_SELECT 137
14171 #define TK_VALUES 138
14172 #define TK_DISTINCT 139
14173 #define TK_DOT 140
14174 #define TK_FROM 141
14175 #define TK_JOIN 142
14176 #define TK_USING 143
14177 #define TK_ORDER 144
14178 #define TK_GROUP 145
14179 #define TK_HAVING 146
14180 #define TK_LIMIT 147
14181 #define TK_WHERE 148
14182 #define TK_RETURNING 149
14183 #define TK_INTO 150
14184 #define TK_NOTHING 151
14185 #define TK_FLOAT 152
14186 #define TK_BLOB 153
14187 #define TK_INTEGER 154
14188 #define TK_VARIABLE 155
14189 #define TK_CASE 156
14190 #define TK_WHEN 157
14191 #define TK_THEN 158
14192 #define TK_ELSE 159
14193 #define TK_INDEX 160
14194 #define TK_ALTER 161
14195 #define TK_ADD 162
14196 #define TK_WINDOW 163
14197 #define TK_OVER 164
14198 #define TK_FILTER 165
14199 #define TK_COLUMN 166
14200 #define TK_AGG_FUNCTION 167
14201 #define TK_AGG_COLUMN 168
14202 #define TK_TRUEFALSE 169
14203 #define TK_ISNOT 170
14204 #define TK_FUNCTION 171
14205 #define TK_UMINUS 172
14206 #define TK_UPLUS 173
14207 #define TK_TRUTH 174
14208 #define TK_REGISTER 175
14209 #define TK_VECTOR 176
14210 #define TK_SELECT_COLUMN 177
14211 #define TK_IF_NULL_ROW 178
14212 #define TK_ASTERISK 179
14213 #define TK_SPAN 180
14214 #define TK_SPACE 181
14215 #define TK_ILLEGAL 182
14216
14217 /************** End of parse.h ***********************************************/
14218 /************** Continuing where we left off in sqliteInt.h ******************/
14219 #include <stdio.h>
14220 #include <stdlib.h>
@@ -14764,10 +14765,12 @@
14765 typedef struct AuthContext AuthContext;
14766 typedef struct AutoincInfo AutoincInfo;
14767 typedef struct Bitvec Bitvec;
14768 typedef struct CollSeq CollSeq;
14769 typedef struct Column Column;
14770 typedef struct Cte Cte;
14771 typedef struct CteUse CteUse;
14772 typedef struct Db Db;
14773 typedef struct DbFixer DbFixer;
14774 typedef struct Schema Schema;
14775 typedef struct Expr Expr;
14776 typedef struct ExprList ExprList;
@@ -14793,10 +14796,11 @@
14796 typedef struct RowSet RowSet;
14797 typedef struct Savepoint Savepoint;
14798 typedef struct Select Select;
14799 typedef struct SQLiteThread SQLiteThread;
14800 typedef struct SelectDest SelectDest;
14801 typedef struct SrcItem SrcItem;
14802 typedef struct SrcList SrcList;
14803 typedef struct sqlite3_str StrAccum; /* Internal alias for sqlite3_str */
14804 typedef struct Table Table;
14805 typedef struct TableLock TableLock;
14806 typedef struct Token Token;
@@ -15786,26 +15790,26 @@
15790 #define OP_ReopenIdx 96 /* synopsis: root=P2 iDb=P3 */
15791 #define OP_OpenRead 97 /* synopsis: root=P2 iDb=P3 */
15792 #define OP_OpenWrite 98 /* synopsis: root=P2 iDb=P3 */
15793 #define OP_OpenDup 99
15794 #define OP_OpenAutoindex 100 /* synopsis: nColumn=P2 */
15795 #define OP_OpenEphemeral 101 /* synopsis: nColumn=P2 */
15796 #define OP_BitAnd 102 /* same as TK_BITAND, synopsis: r[P3]=r[P1]&r[P2] */
15797 #define OP_BitOr 103 /* same as TK_BITOR, synopsis: r[P3]=r[P1]|r[P2] */
15798 #define OP_ShiftLeft 104 /* same as TK_LSHIFT, synopsis: r[P3]=r[P2]<<r[P1] */
15799 #define OP_ShiftRight 105 /* same as TK_RSHIFT, synopsis: r[P3]=r[P2]>>r[P1] */
15800 #define OP_Add 106 /* same as TK_PLUS, synopsis: r[P3]=r[P1]+r[P2] */
15801 #define OP_Subtract 107 /* same as TK_MINUS, synopsis: r[P3]=r[P2]-r[P1] */
15802 #define OP_Multiply 108 /* same as TK_STAR, synopsis: r[P3]=r[P1]*r[P2] */
15803 #define OP_Divide 109 /* same as TK_SLASH, synopsis: r[P3]=r[P2]/r[P1] */
15804 #define OP_Remainder 110 /* same as TK_REM, synopsis: r[P3]=r[P2]%r[P1] */
15805 #define OP_Concat 111 /* same as TK_CONCAT, synopsis: r[P3]=r[P2]+r[P1] */
15806 #define OP_SorterOpen 112
15807 #define OP_BitNot 113 /* same as TK_BITNOT, synopsis: r[P2]= ~r[P1] */
15808 #define OP_SequenceTest 114 /* synopsis: if( cursor[P1].ctr++ ) pc = P2 */
15809 #define OP_OpenPseudo 115 /* synopsis: P3 columns in r[P2] */
15810 #define OP_String8 116 /* same as TK_STRING, synopsis: r[P2]='P4' */
15811 #define OP_Close 117
15812 #define OP_ColumnsUsed 118
15813 #define OP_SeekScan 119 /* synopsis: Scan-ahead up to P1 rows */
15814 #define OP_SeekHit 120 /* synopsis: set P2<=seekHit<=P3 */
15815 #define OP_Sequence 121 /* synopsis: r[P2]=cursor[P1].ctr++ */
@@ -15836,12 +15840,12 @@
15840 #define OP_DropTable 146
15841 #define OP_DropIndex 147
15842 #define OP_DropTrigger 148
15843 #define OP_IntegrityCk 149
15844 #define OP_RowSetAdd 150 /* synopsis: rowset(P1)=r[P2] */
15845 #define OP_Param 151
15846 #define OP_Real 152 /* same as TK_FLOAT, synopsis: r[P2]=P4 */
15847 #define OP_FkCounter 153 /* synopsis: fkctr[P1]+=P2 */
15848 #define OP_MemMax 154 /* synopsis: r[P1]=max(r[P1],r[P2]) */
15849 #define OP_OffsetLimit 155 /* synopsis: if r[P1]>0 then r[P2]=r[P1]+max(0,r[P3]) else r[P2]=(-1) */
15850 #define OP_AggInverse 156 /* synopsis: accum=r[P3] inverse(r[P2@P5]) */
15851 #define OP_AggStep 157 /* synopsis: accum=r[P3] step(r[P2@P5]) */
@@ -15888,13 +15892,13 @@
15892 /* 56 */ 0x0b, 0x0b, 0x01, 0x03, 0x01, 0x01, 0x01, 0x00,\
15893 /* 64 */ 0x00, 0x02, 0x02, 0x08, 0x00, 0x10, 0x10, 0x10,\
15894 /* 72 */ 0x10, 0x00, 0x10, 0x10, 0x00, 0x00, 0x10, 0x10,\
15895 /* 80 */ 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, 0x00, 0x00,\
15896 /* 88 */ 0x12, 0x20, 0x00, 0x00, 0x00, 0x10, 0x10, 0x00,\
15897 /* 96 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x26, 0x26,\
15898 /* 104 */ 0x26, 0x26, 0x26, 0x26, 0x26, 0x26, 0x26, 0x26,\
15899 /* 112 */ 0x00, 0x12, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00,\
15900 /* 120 */ 0x00, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,\
15901 /* 128 */ 0x00, 0x00, 0x10, 0x00, 0x00, 0x04, 0x04, 0x00,\
15902 /* 136 */ 0x00, 0x10, 0x00, 0x10, 0x00, 0x00, 0x10, 0x00,\
15903 /* 144 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x10,\
15904 /* 152 */ 0x10, 0x00, 0x04, 0x1a, 0x00, 0x00, 0x00, 0x00,\
@@ -18376,10 +18380,49 @@
18380 int idx; /* Index in some Table.aCol[] of a column named zName */
18381 } *a;
18382 int nId; /* Number of identifiers on the list */
18383 };
18384
18385 /*
18386 ** The SrcItem object represents a single term in the FROM clause of a query.
18387 ** The SrcList object is mostly an array of SrcItems.
18388 */
18389 struct SrcItem {
18390 Schema *pSchema; /* Schema to which this item is fixed */
18391 char *zDatabase; /* Name of database holding this table */
18392 char *zName; /* Name of the table */
18393 char *zAlias; /* The "B" part of a "A AS B" phrase. zName is the "A" */
18394 Table *pTab; /* An SQL table corresponding to zName */
18395 Select *pSelect; /* A SELECT statement used in place of a table name */
18396 int addrFillSub; /* Address of subroutine to manifest a subquery */
18397 int regReturn; /* Register holding return address of addrFillSub */
18398 int regResult; /* Registers holding results of a co-routine */
18399 struct {
18400 u8 jointype; /* Type of join between this table and the previous */
18401 unsigned notIndexed :1; /* True if there is a NOT INDEXED clause */
18402 unsigned isIndexedBy :1; /* True if there is an INDEXED BY clause */
18403 unsigned isTabFunc :1; /* True if table-valued-function syntax */
18404 unsigned isCorrelated :1; /* True if sub-query is correlated */
18405 unsigned viaCoroutine :1; /* Implemented as a co-routine */
18406 unsigned isRecursive :1; /* True for recursive reference in WITH */
18407 unsigned fromDDL :1; /* Comes from sqlite_schema */
18408 unsigned isCte :1; /* This is a CTE */
18409 } fg;
18410 int iCursor; /* The VDBE cursor number used to access this table */
18411 Expr *pOn; /* The ON clause of a join */
18412 IdList *pUsing; /* The USING clause of a join */
18413 Bitmask colUsed; /* Bit N (1<<N) set if column N of pTab is used */
18414 union {
18415 char *zIndexedBy; /* Identifier from "INDEXED BY <zIndex>" clause */
18416 ExprList *pFuncArg; /* Arguments to table-valued-function */
18417 } u1;
18418 union {
18419 Index *pIBIndex; /* Index structure corresponding to u1.zIndexedBy */
18420 CteUse *pCteUse; /* CTE Usage info info fg.isCte is true */
18421 } u2;
18422 };
18423
18424 /*
18425 ** The following structure describes the FROM clause of a SELECT statement.
18426 ** Each table or subquery in the FROM clause is a separate element of
18427 ** the SrcList.a[] array.
18428 **
@@ -18398,40 +18441,11 @@
18441 ** contains more than 63 columns and the 64-th or later column is used.
18442 */
18443 struct SrcList {
18444 int nSrc; /* Number of tables or subqueries in the FROM clause */
18445 u32 nAlloc; /* Number of entries allocated in a[] below */
18446 SrcItem a[1]; /* One entry for each identifier on the list */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
18447 };
18448
18449 /*
18450 ** Permitted values of the SrcList.a.jointype field
18451 */
@@ -19289,11 +19303,11 @@
19303 Select *pSelect; /* HAVING to WHERE clause ctx */
19304 struct WindowRewrite *pRewrite; /* Window rewrite context */
19305 struct WhereConst *pConst; /* WHERE clause constants */
19306 struct RenameCtx *pRename; /* RENAME COLUMN context */
19307 struct Table *pTab; /* Table of generated column */
19308 SrcItem *pSrcItem; /* A single FROM clause item */
19309 DbFixer *pFix;
19310 } u;
19311 };
19312
19313 /*
@@ -19334,23 +19348,58 @@
19348 #define WRC_Continue 0 /* Continue down into children */
19349 #define WRC_Prune 1 /* Omit children but continue walking siblings */
19350 #define WRC_Abort 2 /* Abandon the tree walk */
19351
19352 /*
19353 ** A single common table expression
19354 */
19355 struct Cte {
19356 char *zName; /* Name of this CTE */
19357 ExprList *pCols; /* List of explicit column names, or NULL */
19358 Select *pSelect; /* The definition of this CTE */
19359 const char *zCteErr; /* Error message for circular references */
19360 CteUse *pUse; /* Usage information for this CTE */
19361 u8 eM10d; /* The MATERIALIZED flag */
19362 };
19363
19364 /*
19365 ** Allowed values for the materialized flag (eM10d):
19366 */
19367 #define M10d_Yes 0 /* AS MATERIALIZED */
19368 #define M10d_Any 1 /* Not specified. Query planner's choice */
19369 #define M10d_No 2 /* AS NOT MATERIALIZED */
19370
19371 /*
19372 ** An instance of the With object represents a WITH clause containing
19373 ** one or more CTEs (common table expressions).
19374 */
19375 struct With {
19376 int nCte; /* Number of CTEs in the WITH clause */
19377 With *pOuter; /* Containing WITH clause, or NULL */
19378 Cte a[1]; /* For each CTE in the WITH clause.... */
 
 
 
 
 
19379 };
19380
19381 /*
19382 ** The Cte object is not guaranteed to persist for the entire duration
19383 ** of code generation. (The query flattener or other parser tree
19384 ** edits might delete it.) The following object records information
19385 ** about each Common Table Expression that must be preserved for the
19386 ** duration of the parse.
19387 **
19388 ** The CteUse objects are freed using sqlite3ParserAddCleanup() rather
19389 ** than sqlite3SelectDelete(), which is what enables them to persist
19390 ** until the end of code generation.
19391 */
19392 struct CteUse {
19393 int nUse; /* Number of users of this CTE */
19394 int addrM9e; /* Start of subroutine to compute materialization */
19395 int regRtn; /* Return address register for addrM9e subroutine */
19396 int iCur; /* Ephemeral table holding the materialization */
19397 LogEst nRowEst; /* Estimated number of rows in the table */
19398 u8 eM10d; /* The MATERIALIZED flag */
19399 };
19400
19401
19402 #ifdef SQLITE_DEBUG
19403 /*
19404 ** An instance of the TreeView object is used for printing the content of
19405 ** data structures on sqlite3DebugPrintf() using a tree-like view.
@@ -19807,11 +19856,11 @@
19856 SQLITE_PRIVATE SrcList *sqlite3SrcListAppend(Parse*, SrcList*, Token*, Token*);
19857 SQLITE_PRIVATE SrcList *sqlite3SrcListAppendFromTerm(Parse*, SrcList*, Token*, Token*,
19858 Token*, Select*, Expr*, IdList*);
19859 SQLITE_PRIVATE void sqlite3SrcListIndexedBy(Parse *, SrcList *, Token *);
19860 SQLITE_PRIVATE void sqlite3SrcListFuncArgs(Parse*, SrcList*, ExprList*);
19861 SQLITE_PRIVATE int sqlite3IndexedByLookup(Parse *, SrcItem *);
19862 SQLITE_PRIVATE void sqlite3SrcListShiftJoinType(SrcList*);
19863 SQLITE_PRIVATE void sqlite3SrcListAssignCursors(Parse*, SrcList*);
19864 SQLITE_PRIVATE void sqlite3IdListDelete(sqlite3*, IdList*);
19865 SQLITE_PRIVATE void sqlite3SrcListDelete(sqlite3*, SrcList*);
19866 SQLITE_PRIVATE Index *sqlite3AllocateIndexObject(sqlite3*,i16,int,char**);
@@ -19869,11 +19918,11 @@
19918 SQLITE_PRIVATE void sqlite3ExprIfFalseDup(Parse*, Expr*, int, int);
19919 SQLITE_PRIVATE Table *sqlite3FindTable(sqlite3*,const char*, const char*);
19920 #define LOCATE_VIEW 0x01
19921 #define LOCATE_NOERR 0x02
19922 SQLITE_PRIVATE Table *sqlite3LocateTable(Parse*,u32 flags,const char*, const char*);
19923 SQLITE_PRIVATE Table *sqlite3LocateTableItem(Parse*,u32 flags,SrcItem *);
19924 SQLITE_PRIVATE Index *sqlite3FindIndex(sqlite3*,const char*, const char*);
19925 SQLITE_PRIVATE void sqlite3UnlinkAndDeleteTable(sqlite3*,int,const char*);
19926 SQLITE_PRIVATE void sqlite3UnlinkAndDeleteIndex(sqlite3*,int,const char*);
19927 SQLITE_PRIVATE void sqlite3Vacuum(Parse*,Token*,Expr*);
19928 SQLITE_PRIVATE int sqlite3RunVacuum(char**, sqlite3*, int, sqlite3_value*);
@@ -20164,11 +20213,11 @@
20213 SQLITE_PRIVATE void sqlite3NestedParse(Parse*, const char*, ...);
20214 SQLITE_PRIVATE void sqlite3ExpirePreparedStatements(sqlite3*, int);
20215 SQLITE_PRIVATE void sqlite3CodeRhsOfIN(Parse*, Expr*, int);
20216 SQLITE_PRIVATE int sqlite3CodeSubselect(Parse*, Expr*);
20217 SQLITE_PRIVATE void sqlite3SelectPrep(Parse*, Select*, NameContext*);
20218 SQLITE_PRIVATE int sqlite3ExpandSubquery(Parse*, SrcItem*);
20219 SQLITE_PRIVATE void sqlite3SelectWrongNumTermsError(Parse *pParse, Select *p);
20220 SQLITE_PRIVATE int sqlite3MatchEName(
20221 const struct ExprList_item*,
20222 const char*,
20223 const char*,
@@ -20336,11 +20385,11 @@
20385 SQLITE_PRIVATE FuncDef *sqlite3VtabOverloadFunction(sqlite3 *,FuncDef*, int nArg, Expr*);
20386 SQLITE_PRIVATE sqlite3_int64 sqlite3StmtCurrentTime(sqlite3_context*);
20387 SQLITE_PRIVATE int sqlite3VdbeParameterIndex(Vdbe*, const char*, int);
20388 SQLITE_PRIVATE int sqlite3TransferBindings(sqlite3_stmt *, sqlite3_stmt *);
20389 SQLITE_PRIVATE void sqlite3ParserReset(Parse*);
20390 SQLITE_PRIVATE void *sqlite3ParserAddCleanup(Parse*,void(*)(sqlite3*,void*),void*);
20391 #ifdef SQLITE_ENABLE_NORMALIZE
20392 SQLITE_PRIVATE char *sqlite3Normalize(Vdbe*, const char*);
20393 #endif
20394 SQLITE_PRIVATE int sqlite3Reprepare(Vdbe*);
20395 SQLITE_PRIVATE void sqlite3ExprListCheckLength(Parse*, ExprList*, const char*);
@@ -20351,16 +20400,21 @@
20400 #ifndef SQLITE_OMIT_WAL
20401 SQLITE_PRIVATE int sqlite3Checkpoint(sqlite3*, int, int, int*, int*);
20402 SQLITE_PRIVATE int sqlite3WalDefaultHook(void*,sqlite3*,const char*,int);
20403 #endif
20404 #ifndef SQLITE_OMIT_CTE
20405 SQLITE_PRIVATE Cte *sqlite3CteNew(Parse*,Token*,ExprList*,Select*,u8);
20406 SQLITE_PRIVATE void sqlite3CteDelete(sqlite3*,Cte*);
20407 SQLITE_PRIVATE With *sqlite3WithAdd(Parse*,With*,Cte*);
20408 SQLITE_PRIVATE void sqlite3WithDelete(sqlite3*,With*);
20409 SQLITE_PRIVATE void sqlite3WithPush(Parse*, With*, u8);
20410 #else
20411 # define sqlite3CteNew(P,T,E,S) ((void*)0)
20412 # define sqlite3CteDelete(D,C)
20413 # define sqlite3CteWithAdd(P,W,C) ((void*)0)
20414 # define sqlite3WithDelete(x,y)
20415 # define sqlite3WithPush(x,y,z)
20416 #endif
20417 #ifndef SQLITE_OMIT_UPSERT
20418 SQLITE_PRIVATE Upsert *sqlite3UpsertNew(sqlite3*,ExprList*,Expr*,ExprList*,Expr*,Upsert*);
20419 SQLITE_PRIVATE void sqlite3UpsertDelete(sqlite3*,Upsert*);
20420 SQLITE_PRIVATE Upsert *sqlite3UpsertDup(sqlite3*,Upsert*);
@@ -29210,11 +29264,11 @@
29264 break;
29265 }
29266 case etSRCLIST: {
29267 SrcList *pSrc;
29268 int k;
29269 SrcItem *pItem;
29270 if( (pAccum->printfFlags & SQLITE_PRINTF_INTERNAL)==0 ) return;
29271 pSrc = va_arg(ap, SrcList*);
29272 k = va_arg(ap, int);
29273 pItem = &pSrc->a[k];
29274 assert( bArgList==0 );
@@ -29778,11 +29832,14 @@
29832 sqlite3_str_appendf(&x, "%c%s", cSep, pCte->pCols->a[j].zEName);
29833 cSep = ',';
29834 }
29835 sqlite3_str_appendf(&x, ")");
29836 }
29837 if( pCte->pUse ){
29838 sqlite3_str_appendf(&x, " (pUse=0x%p, nUse=%d)", pCte->pUse,
29839 pCte->pUse->nUse);
29840 }
29841 sqlite3StrAccumFinish(&x);
29842 sqlite3TreeViewItem(pView, zLine, i<pWith->nCte-1);
29843 sqlite3TreeViewSelect(pView, pCte->pSelect, 0);
29844 sqlite3TreeViewPop(pView);
29845 }
@@ -29794,11 +29851,11 @@
29851 ** Generate a human-readable description of a SrcList object.
29852 */
29853 SQLITE_PRIVATE void sqlite3TreeViewSrcList(TreeView *pView, const SrcList *pSrc){
29854 int i;
29855 for(i=0; i<pSrc->nSrc; i++){
29856 const SrcItem *pItem = &pSrc->a[i];
29857 StrAccum x;
29858 char zLine[100];
29859 sqlite3StrAccumInit(&x, 0, zLine, sizeof(zLine), 0);
29860 sqlite3_str_appendf(&x, "{%d:*}", pItem->iCursor);
29861 if( pItem->zDatabase ){
@@ -29817,10 +29874,13 @@
29874 sqlite3_str_appendf(&x, " LEFT-JOIN");
29875 }
29876 if( pItem->fg.fromDDL ){
29877 sqlite3_str_appendf(&x, " DDL");
29878 }
29879 if( pItem->fg.isCte ){
29880 sqlite3_str_appendf(&x, " CteUse=0x%p", pItem->u2.pCteUse);
29881 }
29882 sqlite3StrAccumFinish(&x);
29883 sqlite3TreeViewItem(pView, zLine, i<pSrc->nSrc-1);
29884 if( pItem->pSelect ){
29885 sqlite3TreeViewSelect(pView, pItem->pSelect, 0);
29886 }
@@ -33490,26 +33550,26 @@
33550 /* 96 */ "ReopenIdx" OpHelp("root=P2 iDb=P3"),
33551 /* 97 */ "OpenRead" OpHelp("root=P2 iDb=P3"),
33552 /* 98 */ "OpenWrite" OpHelp("root=P2 iDb=P3"),
33553 /* 99 */ "OpenDup" OpHelp(""),
33554 /* 100 */ "OpenAutoindex" OpHelp("nColumn=P2"),
33555 /* 101 */ "OpenEphemeral" OpHelp("nColumn=P2"),
33556 /* 102 */ "BitAnd" OpHelp("r[P3]=r[P1]&r[P2]"),
33557 /* 103 */ "BitOr" OpHelp("r[P3]=r[P1]|r[P2]"),
33558 /* 104 */ "ShiftLeft" OpHelp("r[P3]=r[P2]<<r[P1]"),
33559 /* 105 */ "ShiftRight" OpHelp("r[P3]=r[P2]>>r[P1]"),
33560 /* 106 */ "Add" OpHelp("r[P3]=r[P1]+r[P2]"),
33561 /* 107 */ "Subtract" OpHelp("r[P3]=r[P2]-r[P1]"),
33562 /* 108 */ "Multiply" OpHelp("r[P3]=r[P1]*r[P2]"),
33563 /* 109 */ "Divide" OpHelp("r[P3]=r[P2]/r[P1]"),
33564 /* 110 */ "Remainder" OpHelp("r[P3]=r[P2]%r[P1]"),
33565 /* 111 */ "Concat" OpHelp("r[P3]=r[P2]+r[P1]"),
33566 /* 112 */ "SorterOpen" OpHelp(""),
33567 /* 113 */ "BitNot" OpHelp("r[P2]= ~r[P1]"),
33568 /* 114 */ "SequenceTest" OpHelp("if( cursor[P1].ctr++ ) pc = P2"),
33569 /* 115 */ "OpenPseudo" OpHelp("P3 columns in r[P2]"),
33570 /* 116 */ "String8" OpHelp("r[P2]='P4'"),
33571 /* 117 */ "Close" OpHelp(""),
33572 /* 118 */ "ColumnsUsed" OpHelp(""),
33573 /* 119 */ "SeekScan" OpHelp("Scan-ahead up to P1 rows"),
33574 /* 120 */ "SeekHit" OpHelp("set P2<=seekHit<=P3"),
33575 /* 121 */ "Sequence" OpHelp("r[P2]=cursor[P1].ctr++"),
@@ -33540,12 +33600,12 @@
33600 /* 146 */ "DropTable" OpHelp(""),
33601 /* 147 */ "DropIndex" OpHelp(""),
33602 /* 148 */ "DropTrigger" OpHelp(""),
33603 /* 149 */ "IntegrityCk" OpHelp(""),
33604 /* 150 */ "RowSetAdd" OpHelp("rowset(P1)=r[P2]"),
33605 /* 151 */ "Param" OpHelp(""),
33606 /* 152 */ "Real" OpHelp("r[P2]=P4"),
33607 /* 153 */ "FkCounter" OpHelp("fkctr[P1]+=P2"),
33608 /* 154 */ "MemMax" OpHelp("r[P1]=max(r[P1],r[P2])"),
33609 /* 155 */ "OffsetLimit" OpHelp("if r[P1]>0 then r[P2]=r[P1]+max(0,r[P3]) else r[P2]=(-1)"),
33610 /* 156 */ "AggInverse" OpHelp("accum=r[P3] inverse(r[P2@P5])"),
33611 /* 157 */ "AggStep" OpHelp("accum=r[P3] step(r[P2@P5])"),
@@ -89814,11 +89874,11 @@
89874 assert( aMem[pOp->p3].flags & MEM_Null );
89875 aMem[pOp->p3].n = 0;
89876 aMem[pOp->p3].z = "";
89877 }
89878 pCx = p->apCsr[pOp->p1];
89879 if( pCx && ALWAYS(pCx->pBtx) ){
89880 /* If the ephermeral table is already open, erase all existing content
89881 ** so that the table is empty again, rather than creating a new table. */
89882 assert( pCx->isEphemeral );
89883 pCx->seqCount = 0;
89884 pCx->cacheStatus = CACHE_STALE;
@@ -98419,11 +98479,11 @@
98479 ** WRC_Abort or WRC_Continue;
98480 */
98481 SQLITE_PRIVATE int sqlite3WalkSelectFrom(Walker *pWalker, Select *p){
98482 SrcList *pSrc;
98483 int i;
98484 SrcItem *pItem;
98485
98486 pSrc = p->pSrc;
98487 if( pSrc ){
98488 for(i=pSrc->nSrc, pItem=pSrc->a; i>0; i--, pItem++){
98489 if( pItem->pSelect && sqlite3WalkSelect(pWalker, pItem->pSelect) ){
@@ -98760,12 +98820,12 @@
98820 int i, j; /* Loop counters */
98821 int cnt = 0; /* Number of matching column names */
98822 int cntTab = 0; /* Number of matching table names */
98823 int nSubquery = 0; /* How many levels of subquery */
98824 sqlite3 *db = pParse->db; /* The database connection */
98825 SrcItem *pItem; /* Use for looping over pSrcList items */
98826 SrcItem *pMatch = 0; /* The matching pSrcList item */
98827 NameContext *pTopNC = pNC; /* First namecontext in the list */
98828 Schema *pSchema = 0; /* Schema of the expression */
98829 int eNewExprOp = TK_COLUMN; /* New value for pExpr->op on success */
98830 Table *pTab = 0; /* Table hold the row */
98831 Column *pCol; /* A column of pTab */
@@ -99177,11 +99237,11 @@
99237 ** from datasource iSrc in SrcList pSrc.
99238 */
99239 SQLITE_PRIVATE Expr *sqlite3CreateColumnExpr(sqlite3 *db, SrcList *pSrc, int iSrc, int iCol){
99240 Expr *p = sqlite3ExprAlloc(db, TK_COLUMN, 0, 0);
99241 if( p ){
99242 SrcItem *pItem = &pSrc->a[iSrc];
99243 Table *pTab = p->y.pTab = pItem->pTab;
99244 p->iTable = pItem->iCursor;
99245 if( p->y.pTab->iPKey==iCol ){
99246 p->iColumn = -1;
99247 }else{
@@ -99289,11 +99349,11 @@
99349 ** clause processing on UPDATE and DELETE statements, and by
99350 ** UPDATE ... FROM statement processing.
99351 */
99352 case TK_ROW: {
99353 SrcList *pSrcList = pNC->pSrcList;
99354 SrcItem *pItem;
99355 assert( pSrcList && pSrcList->nSrc>=1 );
99356 pItem = pSrcList->a;
99357 pExpr->op = TK_COLUMN;
99358 pExpr->y.pTab = pItem->pTab;
99359 pExpr->iTable = pItem->iCursor;
@@ -100102,11 +100162,11 @@
100162 }
100163
100164 /* Recursively resolve names in all subqueries
100165 */
100166 for(i=0; i<p->pSrc->nSrc; i++){
100167 SrcItem *pItem = &p->pSrc->a[i];
100168 if( pItem->pSelect && (pItem->pSelect->selFlags & SF_Resolved)==0 ){
100169 NameContext *pNC; /* Used to iterate name contexts */
100170 int nRef = 0; /* Refcount for pOuterNC and outer contexts */
100171 const char *zSavedContext = pParse->zAuthContext;
100172
@@ -100172,11 +100232,11 @@
100232 if( sqlite3ResolveExprNames(&sNC, p->pHaving) ) return WRC_Abort;
100233 if( sqlite3ResolveExprNames(&sNC, p->pWhere) ) return WRC_Abort;
100234
100235 /* Resolve names in table-valued-function arguments */
100236 for(i=0; i<p->pSrc->nSrc; i++){
100237 SrcItem *pItem = &p->pSrc->a[i];
100238 if( pItem->fg.isTabFunc
100239 && sqlite3ResolveExprListNames(&sNC, pItem->u1.pFuncArg)
100240 ){
100241 return WRC_Abort;
100242 }
@@ -102016,12 +102076,12 @@
102076 nByte = sizeof(*p) + (p->nSrc>0 ? sizeof(p->a[0]) * (p->nSrc-1) : 0);
102077 pNew = sqlite3DbMallocRawNN(db, nByte );
102078 if( pNew==0 ) return 0;
102079 pNew->nSrc = pNew->nAlloc = p->nSrc;
102080 for(i=0; i<p->nSrc; i++){
102081 SrcItem *pNewItem = &pNew->a[i];
102082 SrcItem *pOldItem = &p->a[i];
102083 Table *pTab;
102084 pNewItem->pSchema = pOldItem->pSchema;
102085 pNewItem->zDatabase = sqlite3DbStrDup(db, pOldItem->zDatabase);
102086 pNewItem->zName = sqlite3DbStrDup(db, pOldItem->zName);
102087 pNewItem->zAlias = sqlite3DbStrDup(db, pOldItem->zAlias);
@@ -102030,11 +102090,14 @@
102090 pNewItem->addrFillSub = pOldItem->addrFillSub;
102091 pNewItem->regReturn = pOldItem->regReturn;
102092 if( pNewItem->fg.isIndexedBy ){
102093 pNewItem->u1.zIndexedBy = sqlite3DbStrDup(db, pOldItem->u1.zIndexedBy);
102094 }
102095 pNewItem->u2 = pOldItem->u2;
102096 if( pNewItem->fg.isCte ){
102097 pNewItem->u2.pCteUse->nUse++;
102098 }
102099 if( pNewItem->fg.isTabFunc ){
102100 pNewItem->u1.pFuncArg =
102101 sqlite3ExprListDup(db, pOldItem->u1.pFuncArg, flags);
102102 }
102103 pTab = pNewItem->pTab = pOldItem->pTab;
@@ -106347,11 +106410,11 @@
106410 testcase( pExpr->op==TK_AGG_COLUMN );
106411 testcase( pExpr->op==TK_COLUMN );
106412 /* Check to see if the column is in one of the tables in the FROM
106413 ** clause of the aggregate query */
106414 if( ALWAYS(pSrcList!=0) ){
106415 SrcItem *pItem = pSrcList->a;
106416 for(i=0; i<pSrcList->nSrc; i++, pItem++){
106417 struct AggInfo_col *pCol;
106418 assert( !ExprHasProperty(pExpr, EP_TokenOnly|EP_Reduced) );
106419 if( pExpr->iTable==pItem->iCursor ){
106420 /* If we reach this point, it means that pExpr refers to a table
@@ -107802,11 +107865,11 @@
107865 if( rc==SQLITE_OK && pStep->zTarget ){
107866 SrcList *pSrc = sqlite3TriggerStepSrc(pParse, pStep);
107867 if( pSrc ){
107868 int i;
107869 for(i=0; i<pSrc->nSrc && rc==SQLITE_OK; i++){
107870 SrcItem *p = &pSrc->a[i];
107871 p->iCursor = pParse->nTab++;
107872 if( p->pSelect ){
107873 sqlite3SelectPrep(pParse, p->pSelect, 0);
107874 sqlite3ExpandSubquery(pParse, p);
107875 assert( i>0 );
@@ -108114,11 +108177,11 @@
108177 if( pSrc==0 ){
108178 assert( pWalker->pParse->db->mallocFailed );
108179 return WRC_Abort;
108180 }
108181 for(i=0; i<pSrc->nSrc; i++){
108182 SrcItem *pItem = &pSrc->a[i];
108183 if( pItem->pTab==p->pTab ){
108184 renameTokenFind(pWalker->pParse, p, pItem->zName);
108185 }
108186 }
108187 renameWalkWith(pWalker, pSelect);
@@ -108364,11 +108427,10 @@
108427 ** Arguments:
108428 **
108429 ** argv[0]: An integer - the index of the schema containing the table
108430 ** argv[1]: CREATE TABLE statement to modify.
108431 ** argv[2]: An integer - the index of the column to remove.
 
108432 **
108433 ** The value returned is a string containing the CREATE TABLE statement
108434 ** with column argv[2] removed.
108435 */
108436 static void dropColumnFunc(
@@ -108378,11 +108440,10 @@
108440 ){
108441 sqlite3 *db = sqlite3_context_db_handle(context);
108442 int iSchema = sqlite3_value_int(argv[0]);
108443 const char *zSql = (const char*)sqlite3_value_text(argv[1]);
108444 int iCol = sqlite3_value_int(argv[2]);
 
108445 const char *zDb = db->aDb[iSchema].zDbSName;
108446 int rc;
108447 Parse sParse;
108448 RenameToken *pCol;
108449 Table *pTab;
@@ -108395,11 +108456,11 @@
108456 #endif
108457
108458 rc = renameParseSql(&sParse, zDb, db, zSql, iSchema==1);
108459 if( rc!=SQLITE_OK ) goto drop_column_done;
108460 pTab = sParse.pNewTable;
108461 if( pTab->nCol==1 || iCol>=pTab->nCol ){
108462 /* This can happen if the sqlite_schema table is corrupt */
108463 rc = SQLITE_CORRUPT_BKPT;
108464 goto drop_column_done;
108465 }
108466
@@ -108407,11 +108468,11 @@
108468 if( iCol<pTab->nCol-1 ){
108469 RenameToken *pEnd;
108470 pEnd = renameTokenFind(&sParse, 0, (void*)pTab->aCol[iCol+1].zName);
108471 zEnd = (const char*)pEnd->t.z;
108472 }else{
108473 zEnd = (const char*)&zSql[pTab->addColOffset];
108474 while( ALWAYS(pCol->t.z[0]!=0) && pCol->t.z[0]!=',' ) pCol->t.z--;
108475 }
108476
108477 zNew = sqlite3MPrintf(db, "%.*s%s", pCol->t.z-zSql, zSql, zEnd);
108478 sqlite3_result_text(context, zNew, -1, SQLITE_TRANSIENT);
@@ -108488,13 +108549,13 @@
108549 assert( iDb>=0 );
108550 zDb = db->aDb[iDb].zDbSName;
108551 renameTestSchema(pParse, zDb, iDb==1, "");
108552 sqlite3NestedParse(pParse,
108553 "UPDATE \"%w\"." DFLT_SCHEMA_TABLE " SET "
108554 "sql = sqlite_drop_column(%d, sql, %d) "
108555 "WHERE (type=='table' AND tbl_name=%Q COLLATE nocase)"
108556 , zDb, iDb, iCol, pTab->zName
108557 );
108558
108559 /* Drop and reload the database schema. */
108560 renameReloadSchema(pParse, iDb, INITFLAG_AlterDrop);
108561 renameTestSchema(pParse, zDb, iDb==1, "after drop column");
@@ -108556,11 +108617,11 @@
108617 SQLITE_PRIVATE void sqlite3AlterFunctions(void){
108618 static FuncDef aAlterTableFuncs[] = {
108619 INTERNAL_FUNCTION(sqlite_rename_column, 9, renameColumnFunc),
108620 INTERNAL_FUNCTION(sqlite_rename_table, 7, renameTableFunc),
108621 INTERNAL_FUNCTION(sqlite_rename_test, 6, renameTableTest),
108622 INTERNAL_FUNCTION(sqlite_drop_column, 3, dropColumnFunc),
108623 };
108624 sqlite3InsertBuiltinFuncs(aAlterTableFuncs, ArraySize(aAlterTableFuncs));
108625 }
108626 #endif /* SQLITE_ALTER_TABLE */
108627
@@ -110968,11 +111029,11 @@
111029 ** Select callback used by sqlite3FixAAAA() routines.
111030 */
111031 static int fixSelectCb(Walker *p, Select *pSelect){
111032 DbFixer *pFix = p->u.pFix;
111033 int i;
111034 SrcItem *pItem;
111035 sqlite3 *db = pFix->pParse->db;
111036 int iDb = sqlite3FindDbName(db, pFix->zDb);
111037 SrcList *pList = pSelect->pSrc;
111038
111039 if( NEVER(pList==0) ) return WRC_Continue;
@@ -111856,11 +111917,11 @@
111917 ** sqlite3FixSrcList() for details.
111918 */
111919 SQLITE_PRIVATE Table *sqlite3LocateTableItem(
111920 Parse *pParse,
111921 u32 flags,
111922 SrcItem *p
111923 ){
111924 const char *zDb;
111925 assert( p->pSchema==0 || p->zDatabase==0 );
111926 if( p->pSchema ){
111927 int iDb = sqlite3SchemaToIndex(pParse->db, p->pSchema);
@@ -114036,24 +114097,21 @@
114097 sqlite3OomFault(db);
114098 return;
114099 }
114100 pParse->pNewTable = 0;
114101 db->mDbFlags |= DBFLAG_SchemaChange;
114102 }
114103
114104 #ifndef SQLITE_OMIT_ALTERTABLE
114105 if( !pSelect && !p->pSelect ){
114106 assert( pCons && pEnd );
114107 if( pCons->z==0 ){
114108 pCons = pEnd;
114109 }
114110 p->addColOffset = 13 + (int)(pCons->z - pParse->sNameToken.z);
114111 }
114112 #endif
 
 
 
 
114113 }
114114
114115 #ifndef SQLITE_OMIT_VIEW
114116 /*
114117 ** The parser calls this routine in order to create a new VIEW
@@ -115900,11 +115958,11 @@
115958 Parse *pParse, /* Parsing context, in which errors are reported */
115959 SrcList *pList, /* Append to this SrcList. NULL creates a new SrcList */
115960 Token *pTable, /* Table to append */
115961 Token *pDatabase /* Database of the table */
115962 ){
115963 SrcItem *pItem;
115964 sqlite3 *db;
115965 assert( pDatabase==0 || pTable!=0 ); /* Cannot have C without B */
115966 assert( pParse!=0 );
115967 assert( pParse->db!=0 );
115968 db = pParse->db;
@@ -115941,11 +115999,11 @@
115999 /*
116000 ** Assign VdbeCursor index numbers to all tables in a SrcList
116001 */
116002 SQLITE_PRIVATE void sqlite3SrcListAssignCursors(Parse *pParse, SrcList *pList){
116003 int i;
116004 SrcItem *pItem;
116005 assert(pList || pParse->db->mallocFailed );
116006 if( pList ){
116007 for(i=0, pItem=pList->a; i<pList->nSrc; i++, pItem++){
116008 if( pItem->iCursor>=0 ) continue;
116009 pItem->iCursor = pParse->nTab++;
@@ -115959,11 +116017,11 @@
116017 /*
116018 ** Delete an entire SrcList including all its substructure.
116019 */
116020 SQLITE_PRIVATE void sqlite3SrcListDelete(sqlite3 *db, SrcList *pList){
116021 int i;
116022 SrcItem *pItem;
116023 if( pList==0 ) return;
116024 for(pItem=pList->a, i=0; i<pList->nSrc; i++, pItem++){
116025 if( pItem->zDatabase ) sqlite3DbFreeNN(db, pItem->zDatabase);
116026 sqlite3DbFree(db, pItem->zName);
116027 if( pItem->zAlias ) sqlite3DbFreeNN(db, pItem->zAlias);
@@ -116001,11 +116059,11 @@
116059 Token *pAlias, /* The right-hand side of the AS subexpression */
116060 Select *pSubquery, /* A subquery used in place of a table name */
116061 Expr *pOn, /* The ON clause of a join */
116062 IdList *pUsing /* The USING clause of a join */
116063 ){
116064 SrcItem *pItem;
116065 sqlite3 *db = pParse->db;
116066 if( !p && (pOn || pUsing) ){
116067 sqlite3ErrorMsg(pParse, "a JOIN clause is required before %s",
116068 (pOn ? "ON" : "USING")
116069 );
@@ -116045,11 +116103,11 @@
116103 ** element of the source-list passed as the second argument.
116104 */
116105 SQLITE_PRIVATE void sqlite3SrcListIndexedBy(Parse *pParse, SrcList *p, Token *pIndexedBy){
116106 assert( pIndexedBy!=0 );
116107 if( p && pIndexedBy->n>0 ){
116108 SrcItem *pItem;
116109 assert( p->nSrc>0 );
116110 pItem = &p->a[p->nSrc-1];
116111 assert( pItem->fg.notIndexed==0 );
116112 assert( pItem->fg.isIndexedBy==0 );
116113 assert( pItem->fg.isTabFunc==0 );
@@ -116075,11 +116133,11 @@
116133 SrcList *pNew = sqlite3SrcListEnlarge(pParse, p1, p2->nSrc, 1);
116134 if( pNew==0 ){
116135 sqlite3SrcListDelete(pParse->db, p2);
116136 }else{
116137 p1 = pNew;
116138 memcpy(&p1->a[1], p2->a, p2->nSrc*sizeof(SrcItem));
116139 sqlite3DbFree(pParse->db, p2);
116140 }
116141 }
116142 return p1;
116143 }
@@ -116088,11 +116146,11 @@
116146 ** Add the list of function arguments to the SrcList entry for a
116147 ** table-valued-function.
116148 */
116149 SQLITE_PRIVATE void sqlite3SrcListFuncArgs(Parse *pParse, SrcList *p, ExprList *pList){
116150 if( p ){
116151 SrcItem *pItem = &p->a[p->nSrc-1];
116152 assert( pItem->fg.notIndexed==0 );
116153 assert( pItem->fg.isIndexedBy==0 );
116154 assert( pItem->fg.isTabFunc==0 );
116155 pItem->u1.pFuncArg = pList;
116156 pItem->fg.isTabFunc = 1;
@@ -116585,28 +116643,80 @@
116643 }
116644 return pKey;
116645 }
116646
116647 #ifndef SQLITE_OMIT_CTE
116648 /*
116649 ** Create a new CTE object
116650 */
116651 SQLITE_PRIVATE Cte *sqlite3CteNew(
116652 Parse *pParse, /* Parsing context */
116653 Token *pName, /* Name of the common-table */
116654 ExprList *pArglist, /* Optional column name list for the table */
116655 Select *pQuery, /* Query used to initialize the table */
116656 u8 eM10d /* The MATERIALIZED flag */
116657 ){
116658 Cte *pNew;
116659 sqlite3 *db = pParse->db;
116660
116661 pNew = sqlite3DbMallocZero(db, sizeof(*pNew));
116662 assert( pNew!=0 || db->mallocFailed );
116663
116664 if( db->mallocFailed ){
116665 sqlite3ExprListDelete(db, pArglist);
116666 sqlite3SelectDelete(db, pQuery);
116667 }else{
116668 pNew->pSelect = pQuery;
116669 pNew->pCols = pArglist;
116670 pNew->zName = sqlite3NameFromToken(pParse->db, pName);
116671 pNew->eM10d = eM10d;
116672 }
116673 return pNew;
116674 }
116675
116676 /*
116677 ** Clear information from a Cte object, but do not deallocate storage
116678 ** for the object itself.
116679 */
116680 static void cteClear(sqlite3 *db, Cte *pCte){
116681 assert( pCte!=0 );
116682 sqlite3ExprListDelete(db, pCte->pCols);
116683 sqlite3SelectDelete(db, pCte->pSelect);
116684 sqlite3DbFree(db, pCte->zName);
116685 }
116686
116687 /*
116688 ** Free the contents of the CTE object passed as the second argument.
116689 */
116690 SQLITE_PRIVATE void sqlite3CteDelete(sqlite3 *db, Cte *pCte){
116691 assert( pCte!=0 );
116692 cteClear(db, pCte);
116693 sqlite3DbFree(db, pCte);
116694 }
116695
116696 /*
116697 ** This routine is invoked once per CTE by the parser while parsing a
116698 ** WITH clause. The CTE described by teh third argument is added to
116699 ** the WITH clause of the second argument. If the second argument is
116700 ** NULL, then a new WITH argument is created.
116701 */
116702 SQLITE_PRIVATE With *sqlite3WithAdd(
116703 Parse *pParse, /* Parsing context */
116704 With *pWith, /* Existing WITH clause, or NULL */
116705 Cte *pCte /* CTE to add to the WITH clause */
 
 
116706 ){
116707 sqlite3 *db = pParse->db;
116708 With *pNew;
116709 char *zName;
116710
116711 if( pCte==0 ){
116712 return pWith;
116713 }
116714
116715 /* Check that the CTE name is unique within this WITH clause. If
116716 ** not, store an error in the Parse structure. */
116717 zName = pCte->zName;
116718 if( zName && pWith ){
116719 int i;
116720 for(i=0; i<pWith->nCte; i++){
116721 if( sqlite3StrICmp(zName, pWith->a[i].zName)==0 ){
116722 sqlite3ErrorMsg(pParse, "duplicate WITH table name: %s", zName);
@@ -116621,20 +116731,15 @@
116731 pNew = sqlite3DbMallocZero(db, sizeof(*pWith));
116732 }
116733 assert( (pNew!=0 && zName!=0) || db->mallocFailed );
116734
116735 if( db->mallocFailed ){
116736 sqlite3CteDelete(db, pCte);
 
 
116737 pNew = pWith;
116738 }else{
116739 pNew->a[pNew->nCte++] = *pCte;
116740 sqlite3DbFree(db, pCte);
 
 
 
116741 }
116742
116743 return pNew;
116744 }
116745
@@ -116643,14 +116748,11 @@
116748 */
116749 SQLITE_PRIVATE void sqlite3WithDelete(sqlite3 *db, With *pWith){
116750 if( pWith ){
116751 int i;
116752 for(i=0; i<pWith->nCte; i++){
116753 cteClear(db, &pWith->a[i]);
 
 
 
116754 }
116755 sqlite3DbFree(db, pWith);
116756 }
116757 }
116758 #endif /* !defined(SQLITE_OMIT_CTE) */
@@ -117225,21 +117327,21 @@
117327 ** pSrc->a[0].pTab Pointer to the Table object
117328 ** pSrc->a[0].pIndex Pointer to the INDEXED BY index, if there is one
117329 **
117330 */
117331 SQLITE_PRIVATE Table *sqlite3SrcListLookup(Parse *pParse, SrcList *pSrc){
117332 SrcItem *pItem = pSrc->a;
117333 Table *pTab;
117334 assert( pItem && pSrc->nSrc>=1 );
117335 pTab = sqlite3LocateTableItem(pParse, 0, pItem);
117336 sqlite3DeleteTable(pParse->db, pItem->pTab);
117337 pItem->pTab = pTab;
117338 if( pTab ){
117339 pTab->nTabRef++;
117340 if( pItem->fg.isIndexedBy && sqlite3IndexedByLookup(pParse, pItem) ){
117341 pTab = 0;
117342 }
117343 }
117344 return pTab;
117345 }
117346
117347 /* Return true if table pTab is read-only.
@@ -117405,11 +117507,15 @@
117507 /* duplicate the FROM clause as it is needed by both the DELETE/UPDATE tree
117508 ** and the SELECT subtree. */
117509 pSrc->a[0].pTab = 0;
117510 pSelectSrc = sqlite3SrcListDup(pParse->db, pSrc, 0);
117511 pSrc->a[0].pTab = pTab;
117512 if( pSrc->a[0].fg.isIndexedBy ){
117513 pSrc->a[0].u2.pIBIndex = 0;
117514 }else if( pSrc->a[0].fg.isCte ){
117515 pSrc->a[0].u2.pCteUse->nUse++;
117516 }
117517
117518 /* generate the SELECT expression tree. */
117519 pSelect = sqlite3SelectNew(pParse, pEList, pSelectSrc, pWhere, 0 ,0,
117520 pOrderBy,0,pLimit
117521 );
@@ -121473,11 +121579,11 @@
121579
121580 /* Create a SrcList structure containing the child table. We need the
121581 ** child table as a SrcList for sqlite3WhereBegin() */
121582 pSrc = sqlite3SrcListAppend(pParse, 0, 0, 0);
121583 if( pSrc ){
121584 SrcItem *pItem = pSrc->a;
121585 pItem->pTab = pFKey->pFrom;
121586 pItem->zName = pFKey->pFrom->zName;
121587 pItem->pTab->nTabRef++;
121588 pItem->iCursor = pParse->nTab++;
121589
@@ -124588,11 +124694,11 @@
124694 ){
124695 sqlite3 *db = pParse->db;
124696 ExprList *pEList; /* The result set of the SELECT */
124697 Table *pSrc; /* The table in the FROM clause of SELECT */
124698 Index *pSrcIdx, *pDestIdx; /* Source and destination indices */
124699 SrcItem *pItem; /* An element of pSelect->pSrc */
124700 int i; /* Loop counter */
124701 int iDbSrc; /* The database of pSrc */
124702 int iSrc, iDest; /* Cursors from source and destination */
124703 int addr1, addr2; /* Loop addresses */
124704 int emptyDestTest = 0; /* Address of test for empty pDest */
@@ -130473,11 +130579,11 @@
130579 ** use-after-free errors following an OOM. The preferred way to do this is
130580 ** to immediately follow the call to this routine with:
130581 **
130582 ** testcase( pParse->earlyCleanup );
130583 */
130584 SQLITE_PRIVATE void *sqlite3ParserAddCleanup(
130585 Parse *pParse, /* Destroy when this Parser finishes */
130586 void (*xCleanup)(sqlite3*,void*), /* The cleanup routine */
130587 void *pPtr /* Pointer to object to be cleaned up */
130588 ){
130589 ParseCleanup *pCleanup = sqlite3DbMallocRaw(pParse->db, sizeof(*pCleanup));
@@ -130486,14 +130592,16 @@
130592 pParse->pCleanup = pCleanup;
130593 pCleanup->pPtr = pPtr;
130594 pCleanup->xCleanup = xCleanup;
130595 }else{
130596 xCleanup(pParse->db, pPtr);
130597 pPtr = 0;
130598 #if defined(SQLITE_DEBUG) || defined(SQLITE_COVERAGE_TEST)
130599 pParse->earlyCleanup = 1;
130600 #endif
130601 }
130602 return pPtr;
130603 }
130604
130605 /*
130606 ** Compile the UTF-8 encoded SQL statement zSql into a statement handle.
130607 */
@@ -131317,12 +131425,12 @@
131425 ** This routine returns the number of errors encountered.
131426 */
131427 static int sqliteProcessJoin(Parse *pParse, Select *p){
131428 SrcList *pSrc; /* All tables in the FROM clause */
131429 int i, j; /* Loop counters */
131430 SrcItem *pLeft; /* Left table being joined */
131431 SrcItem *pRight; /* Right table being joined */
131432
131433 pSrc = p->pSrc;
131434 pLeft = &pSrc->a[0];
131435 pRight = &pLeft[1];
131436 for(i=0; i<pSrc->nSrc-1; i++, pRight++, pLeft++){
@@ -134479,11 +134587,11 @@
134587 SubstContext *pSubst, /* Description of the substitution */
134588 Select *p, /* SELECT statement in which to make substitutions */
134589 int doPrior /* Do substitutes on p->pPrior too */
134590 ){
134591 SrcList *pSrc;
134592 SrcItem *pItem;
134593 int i;
134594 if( !p ) return;
134595 do{
134596 substExprList(pSubst, p->pEList);
134597 substExprList(pSubst, p->pGroupBy);
@@ -134509,21 +134617,21 @@
134617 **
134618 ** This routine scans the entire SELECT statement and recomputes the
134619 ** pSrcItem->colUsed mask.
134620 */
134621 static int recomputeColumnsUsedExpr(Walker *pWalker, Expr *pExpr){
134622 SrcItem *pItem;
134623 if( pExpr->op!=TK_COLUMN ) return WRC_Continue;
134624 pItem = pWalker->u.pSrcItem;
134625 if( pItem->iCursor!=pExpr->iTable ) return WRC_Continue;
134626 if( pExpr->iColumn<0 ) return WRC_Continue;
134627 pItem->colUsed |= sqlite3ExprColUsed(pExpr);
134628 return WRC_Continue;
134629 }
134630 static void recomputeColumnsUsed(
134631 Select *pSelect, /* The complete SELECT statement */
134632 SrcItem *pSrcItem /* Which FROM clause item to recompute */
134633 ){
134634 Walker w;
134635 if( NEVER(pSrcItem->pTab==0) ) return;
134636 memset(&w, 0, sizeof(w));
134637 w.xExprCallback = recomputeColumnsUsedExpr;
@@ -134553,11 +134661,11 @@
134661 int *aCsrMap, /* Array to store cursor mappings in */
134662 SrcList *pSrc, /* FROM clause to renumber */
134663 int iExcept /* FROM clause item to skip */
134664 ){
134665 int i;
134666 SrcItem *pItem;
134667 for(i=0, pItem=pSrc->a; i<pSrc->nSrc; i++, pItem++){
134668 if( i!=iExcept ){
134669 Select *p;
134670 pItem->iCursor = aCsrMap[pItem->iCursor] = pParse->nTab++;
134671 for(p=pItem->pSelect; p; p=p->pPrior){
@@ -134787,11 +134895,11 @@
134895 int iParent; /* VDBE cursor number of the pSub result set temp table */
134896 int iNewParent = -1;/* Replacement table for iParent */
134897 int isLeftJoin = 0; /* True if pSub is the right side of a LEFT JOIN */
134898 int i; /* Loop counter */
134899 Expr *pWhere; /* The WHERE clause */
134900 SrcItem *pSubitem; /* The subquery */
134901 sqlite3 *db = pParse->db;
134902 Walker w; /* Walker to persist agginfo data */
134903 int *aCsrMap = 0;
134904
134905 /* Check to see if flattening is permitted. Return 0 if not.
@@ -135421,10 +135529,14 @@
135529 ** then the (1,1,NULL) row would be suppressed.
135530 **
135531 ** (6) The inner query features one or more window-functions (since
135532 ** changes to the WHERE clause of the inner query could change the
135533 ** window over which window functions are calculated).
135534 **
135535 ** (7) The inner query is a Common Table Expression (CTE) that should
135536 ** be materialized. (This restriction is implemented in the calling
135537 ** routine.)
135538 **
135539 ** Return 0 if no changes are made and non-zero if one or more WHERE clause
135540 ** terms are duplicated into the subquery.
135541 */
135542 static int pushDownWhereTerms(
@@ -135592,28 +135704,30 @@
135704 ** INDEXED BY clause, then try to locate the specified index. If there
135705 ** was such a clause and the named index cannot be found, return
135706 ** SQLITE_ERROR and leave an error in pParse. Otherwise, populate
135707 ** pFrom->pIndex and return SQLITE_OK.
135708 */
135709 SQLITE_PRIVATE int sqlite3IndexedByLookup(Parse *pParse, SrcItem *pFrom){
135710 Table *pTab = pFrom->pTab;
135711 char *zIndexedBy = pFrom->u1.zIndexedBy;
135712 Index *pIdx;
135713 assert( pTab!=0 );
135714 assert( pFrom->fg.isIndexedBy!=0 );
135715
135716 for(pIdx=pTab->pIndex;
135717 pIdx && sqlite3StrICmp(pIdx->zName, zIndexedBy);
135718 pIdx=pIdx->pNext
135719 );
135720 if( !pIdx ){
135721 sqlite3ErrorMsg(pParse, "no such index: %s", zIndexedBy, 0);
135722 pParse->checkSchema = 1;
135723 return SQLITE_ERROR;
135724 }
135725 pFrom->u2.pIBIndex = pIdx;
135726 return SQLITE_OK;
135727 }
135728
135729 /*
135730 ** Detect compound SELECT statements that use an ORDER BY clause with
135731 ** an alternative collating sequence.
135732 **
135733 ** SELECT ... FROM t1 EXCEPT SELECT ... FROM t2 ORDER BY .. COLLATE ...
@@ -135696,11 +135810,11 @@
135810 /*
135811 ** Check to see if the FROM clause term pFrom has table-valued function
135812 ** arguments. If it does, leave an error message in pParse and return
135813 ** non-zero, since pFrom is not allowed to be a table-valued function.
135814 */
135815 static int cannotBeFunction(Parse *pParse, SrcItem *pFrom){
135816 if( pFrom->fg.isTabFunc ){
135817 sqlite3ErrorMsg(pParse, "'%s' is not a function", pFrom->zName);
135818 return 1;
135819 }
135820 return 0;
@@ -135717,23 +135831,23 @@
135831 ** If a non-NULL value is returned, set *ppContext to point to the With
135832 ** object that the returned CTE belongs to.
135833 */
135834 static struct Cte *searchWith(
135835 With *pWith, /* Current innermost WITH clause */
135836 SrcItem *pItem, /* FROM clause element to resolve */
135837 With **ppContext /* OUT: WITH clause return value belongs to */
135838 ){
135839 const char *zName = pItem->zName;
135840 With *p;
135841 assert( pItem->zDatabase==0 );
135842 assert( zName!=0 );
135843 for(p=pWith; p; p=p->pOuter){
135844 int i;
135845 for(i=0; i<p->nCte; i++){
135846 if( sqlite3StrICmp(zName, p->a[i].zName)==0 ){
135847 *ppContext = p;
135848 return &p->a[i];
135849 }
135850 }
135851 }
135852 return 0;
135853 }
@@ -135762,79 +135876,102 @@
135876 }
135877 }
135878
135879 /*
135880 ** This function checks if argument pFrom refers to a CTE declared by
135881 ** a WITH clause on the stack currently maintained by the parser (on the
135882 ** pParse->pWith linked list). And if currently processing a CTE
135883 ** CTE expression, through routine checks to see if the reference is
135884 ** a recursive reference to the CTE.
135885 **
135886 ** If pFrom matches a CTE according to either of these two above, pFrom->pTab
135887 ** and other fields are populated accordingly.
135888 **
135889 ** Return 0 if no match is found.
135890 ** Return 1 if a match is found.
135891 ** Return 2 if an error condition is detected.
135892 */
135893 static int resolveFromTermToCte(
135894 Parse *pParse, /* The parsing context */
135895 Walker *pWalker, /* Current tree walker */
135896 SrcItem *pFrom /* The FROM clause term to check */
135897 ){
135898 Cte *pCte; /* Matched CTE (or NULL if no match) */
135899 With *pWith; /* The matching WITH */
 
 
135900
135901 assert( pFrom->pTab==0 );
135902 if( pParse->pWith==0 ){
135903 /* There are no WITH clauses in the stack. No match is possible */
135904 return 0;
135905 }
135906 if( pFrom->zDatabase!=0 ){
135907 /* The FROM term contains a schema qualifier (ex: main.t1) and so
135908 ** it cannot possibly be a CTE reference. */
135909 return 0;
135910 }
135911 pCte = searchWith(pParse->pWith, pFrom, &pWith);
135912 if( pCte ){
135913 sqlite3 *db = pParse->db;
135914 Table *pTab;
135915 ExprList *pEList;
135916 Select *pSel;
135917 Select *pLeft; /* Left-most SELECT statement */
135918 Select *pRecTerm; /* Left-most recursive term */
135919 int bMayRecursive; /* True if compound joined by UNION [ALL] */
135920 With *pSavedWith; /* Initial value of pParse->pWith */
135921 int iRecTab = -1; /* Cursor for recursive table */
135922 CteUse *pCteUse;
135923
135924 /* If pCte->zCteErr is non-NULL at this point, then this is an illegal
135925 ** recursive reference to CTE pCte. Leave an error in pParse and return
135926 ** early. If pCte->zCteErr is NULL, then this is not a recursive reference.
135927 ** In this case, proceed. */
135928 if( pCte->zCteErr ){
135929 sqlite3ErrorMsg(pParse, pCte->zCteErr, pCte->zName);
135930 return 2;
135931 }
135932 if( cannotBeFunction(pParse, pFrom) ) return 2;
135933
135934 assert( pFrom->pTab==0 );
135935 pTab = sqlite3DbMallocZero(db, sizeof(Table));
135936 if( pTab==0 ) return 2;
135937 pCteUse = pCte->pUse;
135938 if( pCteUse==0 ){
135939 pCte->pUse = pCteUse = sqlite3DbMallocZero(db, sizeof(pCteUse[0]));
135940 if( pCteUse==0
135941 || sqlite3ParserAddCleanup(pParse,sqlite3DbFree,pCteUse)==0
135942 ){
135943 sqlite3DbFree(db, pTab);
135944 return 2;
135945 }
135946 pCteUse->eM10d = pCte->eM10d;
135947 }
135948 pFrom->pTab = pTab;
135949 pTab->nTabRef = 1;
135950 pTab->zName = sqlite3DbStrDup(db, pCte->zName);
135951 pTab->iPKey = -1;
135952 pTab->nRowLogEst = 200; assert( 200==sqlite3LogEst(1048576) );
135953 pTab->tabFlags |= TF_Ephemeral | TF_NoVisibleRowid;
135954 pFrom->pSelect = sqlite3SelectDup(db, pCte->pSelect, 0);
135955 if( db->mallocFailed ) return 2;
135956 assert( pFrom->pSelect );
135957 pFrom->fg.isCte = 1;
135958 pFrom->u2.pCteUse = pCteUse;
135959 pCteUse->nUse++;
135960 if( pCteUse->nUse>=2 && pCteUse->eM10d==M10d_Any ){
135961 pCteUse->eM10d = M10d_Yes;
135962 }
135963
135964 /* Check if this is a recursive CTE. */
135965 pRecTerm = pSel = pFrom->pSelect;
135966 bMayRecursive = ( pSel->op==TK_ALL || pSel->op==TK_UNION );
135967 while( bMayRecursive && pRecTerm->op==pSel->op ){
135968 int i;
135969 SrcList *pSrc = pRecTerm->pSrc;
135970 assert( pRecTerm->pPrior!=0 );
135971 for(i=0; i<pSrc->nSrc; i++){
135972 SrcItem *pItem = &pSrc->a[i];
135973 if( pItem->zDatabase==0
135974 && pItem->zName!=0
135975 && 0==sqlite3StrICmp(pItem->zName, pCte->zName)
135976 ){
135977 pItem->pTab = pTab;
@@ -135842,11 +135979,11 @@
135979 pItem->fg.isRecursive = 1;
135980 if( pRecTerm->selFlags & SF_Recursive ){
135981 sqlite3ErrorMsg(pParse,
135982 "multiple references to recursive table: %s", pCte->zName
135983 );
135984 return 2;
135985 }
135986 pRecTerm->selFlags |= SF_Recursive;
135987 if( iRecTab<0 ) iRecTab = pParse->nTab++;
135988 pItem->iCursor = iRecTab;
135989 }
@@ -135878,11 +136015,11 @@
136015 if( pEList && pEList->nExpr!=pCte->pCols->nExpr ){
136016 sqlite3ErrorMsg(pParse, "table %s has %d values for %d columns",
136017 pCte->zName, pEList->nExpr, pCte->pCols->nExpr
136018 );
136019 pParse->pWith = pSavedWith;
136020 return 2;
136021 }
136022 pEList = pCte->pCols;
136023 }
136024
136025 sqlite3ColumnsFromExprList(pParse, pEList, &pTab->nCol, &pTab->aCol);
@@ -135894,13 +136031,13 @@
136031 }
136032 sqlite3WalkSelect(pWalker, pSel);
136033 }
136034 pCte->zCteErr = 0;
136035 pParse->pWith = pSavedWith;
136036 return 1; /* Success */
136037 }
136038 return 0; /* No match */
 
136039 }
136040 #endif
136041
136042 #ifndef SQLITE_OMIT_CTE
136043 /*
@@ -135930,11 +136067,11 @@
136067 ** sub-query in the FROM clause of a SELECT statement. This function
136068 ** allocates and populates the SrcList_item.pTab object. If successful,
136069 ** SQLITE_OK is returned. Otherwise, if an OOM error is encountered,
136070 ** SQLITE_NOMEM.
136071 */
136072 SQLITE_PRIVATE int sqlite3ExpandSubquery(Parse *pParse, SrcItem *pFrom){
136073 Select *pSel = pFrom->pSelect;
136074 Table *pTab;
136075
136076 assert( pSel );
136077 pFrom->pTab = pTab = sqlite3DbMallocZero(pParse->db, sizeof(Table));
@@ -135978,14 +136115,14 @@
136115 ** and TABLE.* to be every column in TABLE.
136116 **
136117 */
136118 static int selectExpander(Walker *pWalker, Select *p){
136119 Parse *pParse = pWalker->pParse;
136120 int i, j, k, rc;
136121 SrcList *pTabList;
136122 ExprList *pEList;
136123 SrcItem *pFrom;
136124 sqlite3 *db = pParse->db;
136125 Expr *pE, *pRight, *pExpr;
136126 u16 selFlags = p->selFlags;
136127 u32 elistFlags = 0;
136128
@@ -136017,23 +136154,25 @@
136154 for(i=0, pFrom=pTabList->a; i<pTabList->nSrc; i++, pFrom++){
136155 Table *pTab;
136156 assert( pFrom->fg.isRecursive==0 || pFrom->pTab!=0 );
136157 if( pFrom->pTab ) continue;
136158 assert( pFrom->fg.isRecursive==0 );
 
 
 
 
136159 if( pFrom->zName==0 ){
136160 #ifndef SQLITE_OMIT_SUBQUERY
136161 Select *pSel = pFrom->pSelect;
136162 /* A sub-query in the FROM clause of a SELECT */
136163 assert( pSel!=0 );
136164 assert( pFrom->pTab==0 );
136165 if( sqlite3WalkSelect(pWalker, pSel) ) return WRC_Abort;
136166 if( sqlite3ExpandSubquery(pParse, pFrom) ) return WRC_Abort;
136167 #endif
136168 #ifndef SQLITE_OMIT_CTE
136169 }else if( (rc = resolveFromTermToCte(pParse, pWalker, pFrom))!=0 ){
136170 if( rc>1 ) return WRC_Abort;
136171 pTab = pFrom->pTab;
136172 assert( pTab!=0 );
136173 #endif
136174 }else{
136175 /* An ordinary table or view name in the FROM clause */
136176 assert( pFrom->pTab==0 );
136177 pFrom->pTab = pTab = sqlite3LocateTableItem(pParse, 0, pFrom);
136178 if( pTab==0 ) return WRC_Abort;
@@ -136077,11 +136216,11 @@
136216 }
136217 #endif
136218 }
136219
136220 /* Locate the index named by the INDEXED BY clause, if any. */
136221 if( pFrom->fg.isIndexedBy && sqlite3IndexedByLookup(pParse, pFrom) ){
136222 return WRC_Abort;
136223 }
136224 }
136225
136226 /* Process NATURAL keywords, and ON and USING clauses of joins.
@@ -136320,11 +136459,11 @@
136459 */
136460 static void selectAddSubqueryTypeInfo(Walker *pWalker, Select *p){
136461 Parse *pParse;
136462 int i;
136463 SrcList *pTabList;
136464 SrcItem *pFrom;
136465
136466 assert( p->selFlags & SF_Resolved );
136467 if( p->selFlags & SF_HasTypeInfo ) return;
136468 p->selFlags |= SF_HasTypeInfo;
136469 pParse = pWalker->pParse;
@@ -136644,15 +136783,15 @@
136783 /*
136784 ** Check to see if the pThis entry of pTabList is a self-join of a prior view.
136785 ** If it is, then return the SrcList_item for the prior view. If it is not,
136786 ** then return 0.
136787 */
136788 static SrcItem *isSelfJoinView(
136789 SrcList *pTabList, /* Search for self-joins in this FROM clause */
136790 SrcItem *pThis /* Search for prior reference to this subquery */
136791 ){
136792 SrcItem *pItem;
136793 assert( pThis->pSelect!=0 );
136794 if( pThis->pSelect->selFlags & SF_PushDown ) return 0;
136795 for(pItem = pTabList->a; pItem<pThis; pItem++){
136796 Select *pS1;
136797 if( pItem->pSelect==0 ) continue;
@@ -136852,13 +136991,13 @@
136991 /* If the SF_UpdateFrom flag is set, then this function is being called
136992 ** as part of populating the temp table for an UPDATE...FROM statement.
136993 ** In this case, it is an error if the target object (pSrc->a[0]) name
136994 ** or alias is duplicated within FROM clause (pSrc->a[1..n]). */
136995 if( p->selFlags & SF_UpdateFrom ){
136996 SrcItem *p0 = &p->pSrc->a[0];
136997 for(i=1; i<p->pSrc->nSrc; i++){
136998 SrcItem *p1 = &p->pSrc->a[i];
136999 if( p0->pTab==p1->pTab && 0==sqlite3_stricmp(p0->zAlias, p1->zAlias) ){
137000 sqlite3ErrorMsg(pParse,
137001 "target object/alias may not appear in FROM clause: %s",
137002 p0->zAlias ? p0->zAlias : p0->pTab->zName
137003 );
@@ -136892,11 +137031,11 @@
137031 /* Try to do various optimizations (flattening subqueries, and strength
137032 ** reduction of join operators) in the FROM clause up into the main query
137033 */
137034 #if !defined(SQLITE_OMIT_SUBQUERY) || !defined(SQLITE_OMIT_VIEW)
137035 for(i=0; !p->pPrior && i<pTabList->nSrc; i++){
137036 SrcItem *pItem = &pTabList->a[i];
137037 Select *pSub = pItem->pSelect;
137038 Table *pTab = pItem->pTab;
137039
137040 /* The expander should have already created transient Table objects
137041 ** even for FROM clause elements such as subqueries that do not correspond
@@ -137026,11 +137165,12 @@
137165 /* For each term in the FROM clause, do two things:
137166 ** (1) Authorized unreferenced tables
137167 ** (2) Generate code for all sub-queries
137168 */
137169 for(i=0; i<pTabList->nSrc; i++){
137170 SrcItem *pItem = &pTabList->a[i];
137171 SrcItem *pPrior;
137172 SelectDest dest;
137173 Select *pSub;
137174 #if !defined(SQLITE_OMIT_SUBQUERY) || !defined(SQLITE_OMIT_VIEW)
137175 const char *zSavedAuthContext;
137176 #endif
@@ -137086,10 +137226,11 @@
137226
137227 /* Make copies of constant WHERE-clause terms in the outer query down
137228 ** inside the subquery. This can help the subquery to run more efficiently.
137229 */
137230 if( OptimizationEnabled(db, SQLITE_PushDown)
137231 && (pItem->fg.isCte==0 || pItem->u2.pCteUse->eM10d!=M10d_Yes)
137232 && pushDownWhereTerms(pParse, pSub, p->pWhere, pItem->iCursor,
137233 (pItem->fg.jointype & JT_OUTER)!=0)
137234 ){
137235 #if SELECTTRACE_ENABLED
137236 if( sqlite3SelectTrace & 0x100 ){
@@ -137106,20 +137247,22 @@
137247 zSavedAuthContext = pParse->zAuthContext;
137248 pParse->zAuthContext = pItem->zName;
137249
137250 /* Generate code to implement the subquery
137251 **
137252 ** The subquery is implemented as a co-routine if:
137253 ** (1) the subquery is guaranteed to be the outer loop (so that
137254 ** it does not need to be computed more than once), and
137255 ** (2) the subquery is not a CTE that should be materialized
137256 **
137257 ** TODO: Are there other reasons beside (1) and (2) to use a co-routine
137258 ** implementation?
137259 */
137260 if( i==0
137261 && (pTabList->nSrc==1
137262 || (pTabList->a[1].fg.jointype&(JT_LEFT|JT_CROSS))!=0) /* (1) */
137263 && (pItem->fg.isCte==0 || pItem->u2.pCteUse->eM10d!=M10d_Yes) /* (2) */
137264 ){
137265 /* Implement a co-routine that will return a single row of the result
137266 ** set on each invocation.
137267 */
137268 int addrTop = sqlite3VdbeCurrentAddr(v)+1;
@@ -137135,20 +137278,34 @@
137278 pItem->fg.viaCoroutine = 1;
137279 pItem->regResult = dest.iSdst;
137280 sqlite3VdbeEndCoroutine(v, pItem->regReturn);
137281 sqlite3VdbeJumpHere(v, addrTop-1);
137282 sqlite3ClearTempRegCache(pParse);
137283 }else if( pItem->fg.isCte && pItem->u2.pCteUse->addrM9e>0 ){
137284 /* This is a CTE for which materialization code has already been
137285 ** generated. Invoke the subroutine to compute the materialization,
137286 ** the make the pItem->iCursor be a copy of the ephemerial table that
137287 ** holds the result of the materialization. */
137288 CteUse *pCteUse = pItem->u2.pCteUse;
137289 sqlite3VdbeAddOp2(v, OP_Gosub, pCteUse->regRtn, pCteUse->addrM9e);
137290 if( pItem->iCursor!=pCteUse->iCur ){
137291 sqlite3VdbeAddOp2(v, OP_OpenDup, pItem->iCursor, pCteUse->iCur);
137292 }
137293 pSub->nSelectRow = pCteUse->nRowEst;
137294 }else if( (pPrior = isSelfJoinView(pTabList, pItem))!=0 ){
137295 /* This view has already been materialized by a prior entry in
137296 ** this same FROM clause. Reuse it. */
137297 if( pPrior->addrFillSub ){
137298 sqlite3VdbeAddOp2(v, OP_Gosub, pPrior->regReturn, pPrior->addrFillSub);
137299 }
137300 sqlite3VdbeAddOp2(v, OP_OpenDup, pItem->iCursor, pPrior->iCursor);
137301 pSub->nSelectRow = pPrior->pSelect->nSelectRow;
137302 }else{
137303 /* Generate a subroutine that will materialize the view. */
 
 
 
 
137304 int topAddr;
137305 int onceAddr = 0;
137306 int retAddr;
 
137307
137308 testcase( pItem->addrFillSub==0 ); /* Ticket c52b09c7f38903b1311 */
137309 pItem->regReturn = ++pParse->nMem;
137310 topAddr = sqlite3VdbeAddOp2(v, OP_Integer, 0, pItem->regReturn);
137311 pItem->addrFillSub = topAddr+1;
@@ -137159,26 +137316,26 @@
137316 onceAddr = sqlite3VdbeAddOp0(v, OP_Once); VdbeCoverage(v);
137317 VdbeComment((v, "materialize \"%s\"", pItem->pTab->zName));
137318 }else{
137319 VdbeNoopComment((v, "materialize \"%s\"", pItem->pTab->zName));
137320 }
137321 sqlite3SelectDestInit(&dest, SRT_EphemTab, pItem->iCursor);
137322 ExplainQueryPlan((pParse, 1, "MATERIALIZE %u", pSub->selId));
137323 sqlite3Select(pParse, pSub, &dest);
 
 
 
 
 
 
 
137324 pItem->pTab->nRowLogEst = pSub->nSelectRow;
137325 if( onceAddr ) sqlite3VdbeJumpHere(v, onceAddr);
137326 retAddr = sqlite3VdbeAddOp1(v, OP_Return, pItem->regReturn);
137327 VdbeComment((v, "end %s", pItem->pTab->zName));
137328 sqlite3VdbeChangeP1(v, topAddr, retAddr);
137329 sqlite3ClearTempRegCache(pParse);
137330 if( pItem->fg.isCte ){
137331 CteUse *pCteUse = pItem->u2.pCteUse;
137332 pCteUse->addrM9e = pItem->addrFillSub;
137333 pCteUse->regRtn = pItem->regReturn;
137334 pCteUse->iCur = pItem->iCursor;
137335 pCteUse->nRowEst = pSub->nSelectRow;
137336 }
137337 }
137338 if( db->mallocFailed ) goto select_end;
137339 pParse->nHeight -= sqlite3SelectExprHeight(p);
137340 pParse->zAuthContext = zSavedAuthContext;
137341 #endif
@@ -143432,11 +143589,11 @@
143589 SQLITE_PRIVATE void sqlite3WhereSplit(WhereClause*,Expr*,u8);
143590 SQLITE_PRIVATE Bitmask sqlite3WhereExprUsage(WhereMaskSet*, Expr*);
143591 SQLITE_PRIVATE Bitmask sqlite3WhereExprUsageNN(WhereMaskSet*, Expr*);
143592 SQLITE_PRIVATE Bitmask sqlite3WhereExprListUsage(WhereMaskSet*, ExprList*);
143593 SQLITE_PRIVATE void sqlite3WhereExprAnalyze(SrcList*, WhereClause*);
143594 SQLITE_PRIVATE void sqlite3WhereTabFuncArgs(Parse*, SrcItem*, WhereClause*);
143595
143596
143597
143598
143599
@@ -143610,11 +143767,11 @@
143767 int ret = 0;
143768 #if !defined(SQLITE_DEBUG) && !defined(SQLITE_ENABLE_STMT_SCANSTATUS)
143769 if( sqlite3ParseToplevel(pParse)->explain==2 )
143770 #endif
143771 {
143772 SrcItem *pItem = &pTabList->a[pLevel->iFrom];
143773 Vdbe *v = pParse->pVdbe; /* VM being constructed */
143774 sqlite3 *db = pParse->db; /* Database handle */
143775 int isSearch; /* True for a SEARCH. False for SCAN. */
143776 WhereLoop *pLoop; /* The controlling WhereLoop object */
143777 u32 flags; /* Flags that describe this loop */
@@ -144403,11 +144560,11 @@
144560
144561 /*
144562 ** Insert an OP_CursorHint instruction if it is appropriate to do so.
144563 */
144564 static void codeCursorHint(
144565 SrcItem *pTabItem, /* FROM clause item */
144566 WhereInfo *pWInfo, /* The where clause */
144567 WhereLevel *pLevel, /* Which loop to provide hints for */
144568 WhereTerm *pEndRange /* Hint this end-of-scan boundary term if not NULL */
144569 ){
144570 Parse *pParse = pWInfo->pParse;
@@ -144778,11 +144935,11 @@
144935 int bRev; /* True if we need to scan in reverse order */
144936 WhereLoop *pLoop; /* The WhereLoop object being coded */
144937 WhereClause *pWC; /* Decomposition of the entire WHERE clause */
144938 WhereTerm *pTerm; /* A WHERE clause term */
144939 sqlite3 *db; /* Database connection */
144940 SrcItem *pTabItem; /* FROM clause term being coded */
144941 int addrBrk; /* Jump here to break out of the loop */
144942 int addrHalt; /* addrBrk for the outermost loop */
144943 int addrCont; /* Jump here to continue with next cycle */
144944 int iRowidReg = 0; /* Rowid is stored in this register, if not zero */
144945 int iReleaseReg = 0; /* Temp register to free before returning */
@@ -145566,11 +145723,11 @@
145723 ** by this loop in the a[0] slot and all notReady tables in a[1..] slots.
145724 ** This becomes the SrcList in the recursive call to sqlite3WhereBegin().
145725 */
145726 if( pWInfo->nLevel>1 ){
145727 int nNotReady; /* The number of notReady tables */
145728 SrcItem *origSrc; /* Original list of tables */
145729 nNotReady = pWInfo->nLevel - iLevel - 1;
145730 pOrTab = sqlite3StackAllocRaw(db,
145731 sizeof(*pOrTab)+ nNotReady*sizeof(pOrTab->a[0]));
145732 if( pOrTab==0 ) return notReady;
145733 pOrTab->nAlloc = (u8)(nNotReady + 1);
@@ -147831,11 +147988,11 @@
147988 ** Each function argument translates into an equality constraint against
147989 ** a HIDDEN column in the table.
147990 */
147991 SQLITE_PRIVATE void sqlite3WhereTabFuncArgs(
147992 Parse *pParse, /* Parsing context */
147993 SrcItem *pItem, /* The FROM clause term to process */
147994 WhereClause *pWC /* Xfer function arguments to here */
147995 ){
147996 Table *pTab;
147997 int j, k;
147998 ExprList *pArgs;
@@ -148565,11 +148722,11 @@
148722 ** could be used with an index to access pSrc, assuming an appropriate
148723 ** index existed.
148724 */
148725 static int termCanDriveIndex(
148726 WhereTerm *pTerm, /* WHERE clause term to check */
148727 SrcItem *pSrc, /* Table we are trying to access */
148728 Bitmask notReady /* Tables in outer loops of the join */
148729 ){
148730 char aff;
148731 if( pTerm->leftCursor!=pSrc->iCursor ) return 0;
148732 if( (pTerm->eOperator & (WO_EQ|WO_IS))==0 ) return 0;
@@ -148599,11 +148756,11 @@
148756 ** makes use of the automatic index.
148757 */
148758 static void constructAutomaticIndex(
148759 Parse *pParse, /* The parsing context */
148760 WhereClause *pWC, /* The WHERE clause */
148761 SrcItem *pSrc, /* The FROM clause term to get the next index */
148762 Bitmask notReady, /* Mask of cursors that are not available */
148763 WhereLevel *pLevel /* Write new index here */
148764 ){
148765 int nKeyCol; /* Number of columns in the constructed index */
148766 WhereTerm *pTerm; /* A single term of the WHERE clause */
@@ -148623,11 +148780,11 @@
148780 Bitmask idxCols; /* Bitmap of columns used for indexing */
148781 Bitmask extraCols; /* Bitmap of additional columns */
148782 u8 sentWarning = 0; /* True if a warnning has been issued */
148783 Expr *pPartial = 0; /* Partial Index Expression */
148784 int iContinue = 0; /* Jump here to skip excluded rows */
148785 SrcItem *pTabItem; /* FROM clause term being indexed */
148786 int addrCounter = 0; /* Address where integer counter is initialized */
148787 int regBase; /* Array of registers where record is assembled */
148788
148789 /* Generate code to skip over the creation and initialization of the
148790 ** transient index on 2nd and subsequent iterations of the loop. */
@@ -148807,11 +148964,11 @@
148964 */
148965 static sqlite3_index_info *allocateIndexInfo(
148966 Parse *pParse, /* The parsing context */
148967 WhereClause *pWC, /* The WHERE clause being analyzed */
148968 Bitmask mUnusable, /* Ignore terms with these prereqs */
148969 SrcItem *pSrc, /* The FROM clause term that is the vtab */
148970 ExprList *pOrderBy, /* The ORDER BY clause */
148971 u16 *pmNoOmit /* Mask of terms not to omit */
148972 ){
148973 int i, j;
148974 int nTerm;
@@ -149705,11 +149862,11 @@
149862 ** Print a WhereLoop object for debugging purposes
149863 */
149864 SQLITE_PRIVATE void sqlite3WhereLoopPrint(WhereLoop *p, WhereClause *pWC){
149865 WhereInfo *pWInfo = pWC->pWInfo;
149866 int nb = 1+(pWInfo->pTabList->nSrc+3)/4;
149867 SrcItem *pItem = pWInfo->pTabList->a + p->iTab;
149868 Table *pTab = pItem->pTab;
149869 Bitmask mAll = (((Bitmask)1)<<(nb*4)) - 1;
149870 sqlite3DebugPrintf("%c%2d.%0*llx.%0*llx", p->cId,
149871 p->iTab, nb, p->maskSelf, nb, p->prereq & mAll);
149872 sqlite3DebugPrintf(" %12s",
@@ -150316,11 +150473,11 @@
150473 ** If pProbe->idxType==SQLITE_IDXTYPE_IPK, that means pIndex is
150474 ** a fake index used for the INTEGER PRIMARY KEY.
150475 */
150476 static int whereLoopAddBtreeIndex(
150477 WhereLoopBuilder *pBuilder, /* The WhereLoop factory */
150478 SrcItem *pSrc, /* FROM clause term being analyzed */
150479 Index *pProbe, /* An index on pSrc */
150480 LogEst nInMul /* log(Number of iterations due to IN) */
150481 ){
150482 WhereInfo *pWInfo = pBuilder->pWInfo; /* WHERE analyse context */
150483 Parse *pParse = pWInfo->pParse; /* Parsing context */
@@ -150807,11 +150964,11 @@
150964 Index *pProbe; /* An index we are evaluating */
150965 Index sPk; /* A fake index object for the primary key */
150966 LogEst aiRowEstPk[2]; /* The aiRowLogEst[] value for the sPk index */
150967 i16 aiColumnPk = -1; /* The aColumn[] value for the sPk index */
150968 SrcList *pTabList; /* The FROM clause */
150969 SrcItem *pSrc; /* The FROM clause btree term to add */
150970 WhereLoop *pNew; /* Template WhereLoop object */
150971 int rc = SQLITE_OK; /* Return code */
150972 int iSortIdx = 1; /* Index number */
150973 int b; /* A boolean value */
150974 LogEst rSize; /* number of rows in the table */
@@ -150825,13 +150982,13 @@
150982 pSrc = pTabList->a + pNew->iTab;
150983 pTab = pSrc->pTab;
150984 pWC = pBuilder->pWC;
150985 assert( !IsVirtual(pSrc->pTab) );
150986
150987 if( pSrc->fg.isIndexedBy ){
150988 /* An INDEXED BY clause specifies a particular index to use */
150989 pProbe = pSrc->u2.pIBIndex;
150990 }else if( !HasRowid(pTab) ){
150991 pProbe = pTab->pIndex;
150992 }else{
150993 /* There is no INDEXED BY clause. Create a fake Index object in local
150994 ** variable sPk to represent the rowid primary key index. Make this
@@ -150863,11 +151020,11 @@
151020 #ifndef SQLITE_OMIT_AUTOMATIC_INDEX
151021 /* Automatic indexes */
151022 if( !pBuilder->pOrSet /* Not part of an OR optimization */
151023 && (pWInfo->wctrlFlags & WHERE_OR_SUBCLAUSE)==0
151024 && (pWInfo->pParse->db->flags & SQLITE_AutoIndex)!=0
151025 && !pSrc->fg.isIndexedBy /* Has no INDEXED BY clause */
151026 && !pSrc->fg.notIndexed /* Has no NOT INDEXED clause */
151027 && HasRowid(pTab) /* Not WITHOUT ROWID table. (FIXME: Why not?) */
151028 && !pSrc->fg.isCorrelated /* Not a correlated subquery */
151029 && !pSrc->fg.isRecursive /* Not a recursive common table expression. */
151030 ){
@@ -150913,11 +151070,11 @@
151070 #endif /* SQLITE_OMIT_AUTOMATIC_INDEX */
151071
151072 /* Loop over all indices. If there was an INDEXED BY clause, then only
151073 ** consider index pProbe. */
151074 for(; rc==SQLITE_OK && pProbe;
151075 pProbe=(pSrc->fg.isIndexedBy ? 0 : pProbe->pNext), iSortIdx++
151076 ){
151077 int isLeft = (pSrc->fg.jointype & JT_OUTER)!=0;
151078 if( pProbe->pPartIdxWhere!=0
151079 && !whereUsablePartialIndex(pSrc->iCursor, isLeft, pWC,
151080 pProbe->pPartIdxWhere)
@@ -151088,11 +151245,11 @@
151245 int i;
151246 int mxTerm;
151247 int rc = SQLITE_OK;
151248 WhereLoop *pNew = pBuilder->pNew;
151249 Parse *pParse = pBuilder->pWInfo->pParse;
151250 SrcItem *pSrc = &pBuilder->pWInfo->pTabList->a[pNew->iTab];
151251 int nConstraint = pIdxInfo->nConstraint;
151252
151253 assert( (mUsable & mPrereq)==mPrereq );
151254 *pbIn = 0;
151255 pNew->prereq = mPrereq;
@@ -151280,11 +151437,11 @@
151437 ){
151438 int rc = SQLITE_OK; /* Return code */
151439 WhereInfo *pWInfo; /* WHERE analysis context */
151440 Parse *pParse; /* The parsing context */
151441 WhereClause *pWC; /* The WHERE clause */
151442 SrcItem *pSrc; /* The FROM clause term to search */
151443 sqlite3_index_info *p; /* Object to pass to xBestIndex() */
151444 int nConstraint; /* Number of constraints in p */
151445 int bIn; /* True if plan uses IN(...) operator */
151446 WhereLoop *pNew;
151447 Bitmask mBest; /* Tables used by best possible plan */
@@ -151408,11 +151565,11 @@
151565 int rc = SQLITE_OK;
151566 int iCur;
151567 WhereClause tempWC;
151568 WhereLoopBuilder sSubBuild;
151569 WhereOrSet sSum, sCur;
151570 SrcItem *pItem;
151571
151572 pWC = pBuilder->pWC;
151573 pWCEnd = pWC->a + pWC->nTerm;
151574 pNew = pBuilder->pNew;
151575 memset(&sSum, 0, sizeof(sSum));
@@ -151524,12 +151681,12 @@
151681 WhereInfo *pWInfo = pBuilder->pWInfo;
151682 Bitmask mPrereq = 0;
151683 Bitmask mPrior = 0;
151684 int iTab;
151685 SrcList *pTabList = pWInfo->pTabList;
151686 SrcItem *pItem;
151687 SrcItem *pEnd = &pTabList->a[pWInfo->nLevel];
151688 sqlite3 *db = pWInfo->pParse->db;
151689 int rc = SQLITE_OK;
151690 WhereLoop *pNew;
151691
151692 /* Loop over the tables in the join, from left to right */
@@ -151548,11 +151705,11 @@
151705 }else{
151706 mPrereq = 0;
151707 }
151708 #ifndef SQLITE_OMIT_VIRTUALTABLE
151709 if( IsVirtual(pItem->pTab) ){
151710 SrcItem *p;
151711 for(p=&pItem[1]; p<pEnd; p++){
151712 if( mUnusable || (p->fg.jointype & (JT_LEFT|JT_CROSS)) ){
151713 mUnusable |= sqlite3WhereGetMask(&pWInfo->sMaskSet, p->iCursor);
151714 }
151715 }
@@ -152403,11 +152560,11 @@
152560 ** no-frills query planner. Return zero if this query needs the
152561 ** general-purpose query planner.
152562 */
152563 static int whereShortCut(WhereLoopBuilder *pBuilder){
152564 WhereInfo *pWInfo;
152565 SrcItem *pItem;
152566 WhereClause *pWC;
152567 WhereTerm *pTerm;
152568 WhereLoop *pLoop;
152569 int iCur;
152570 int j;
@@ -152933,11 +153090,11 @@
153090 if( sWLB.pOrderBy ){
153091 tabUsed |= sqlite3WhereExprListUsage(pMaskSet, sWLB.pOrderBy);
153092 }
153093 for(i=pWInfo->nLevel-1; i>=1; i--){
153094 WhereTerm *pTerm, *pEnd;
153095 SrcItem *pItem;
153096 pLoop = pWInfo->a[i].pWLoop;
153097 pItem = &pWInfo->pTabList->a[pLoop->iTab];
153098 if( (pItem->fg.jointype & JT_LEFT)==0 ) continue;
153099 if( (wctrlFlags & WHERE_WANT_DISTINCT)==0
153100 && (pLoop->wsFlags & WHERE_ONEROW)==0
@@ -153023,11 +153180,11 @@
153180 ** searching those tables.
153181 */
153182 for(ii=0, pLevel=pWInfo->a; ii<nTabList; ii++, pLevel++){
153183 Table *pTab; /* Table to open */
153184 int iDb; /* Index of database containing table/index */
153185 SrcItem *pTabItem;
153186
153187 pTabItem = &pTabList->a[pLevel->iFrom];
153188 pTab = pTabItem->pTab;
153189 iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
153190 pLoop = pLevel->pWLoop;
@@ -153360,11 +153517,11 @@
153517 assert( pWInfo->nLevel<=pTabList->nSrc );
153518 for(i=0, pLevel=pWInfo->a; i<pWInfo->nLevel; i++, pLevel++){
153519 int k, last;
153520 VdbeOp *pOp, *pLastOp;
153521 Index *pIdx = 0;
153522 SrcItem *pTabItem = &pTabList->a[pLevel->iFrom];
153523 Table *pTab = pTabItem->pTab;
153524 assert( pTab!=0 );
153525 pLoop = pLevel->pWLoop;
153526
153527 /* For a co-routine, change all OP_Column references to the table of
@@ -156672,10 +156829,23 @@
156829 sqlite3ErrorMsg(pParse, "too many terms in compound SELECT");
156830 }
156831 }
156832 }
156833
156834 /* Attach a With object describing the WITH clause to a Select
156835 ** object describing the query for which the WITH clause is a prefix.
156836 */
156837 static Select *attachWithToSelect(Parse *pParse, Select *pSelect, With *pWith){
156838 if( pSelect ){
156839 pSelect->pWith = pWith;
156840 parserDoubleLinkSelect(pParse, pSelect);
156841 }else{
156842 sqlite3WithDelete(pParse->db, pWith);
156843 }
156844 return pSelect;
156845 }
156846
156847
156848 /* Construct a new Expr object from a single identifier. Use the
156849 ** new Expr to populate pOut. Set the span of pOut to be the identifier
156850 ** that created the expression.
156851 */
@@ -156847,95 +157017,96 @@
157017 #define TK_GROUPS 92
157018 #define TK_OTHERS 93
157019 #define TK_TIES 94
157020 #define TK_GENERATED 95
157021 #define TK_ALWAYS 96
157022 #define TK_MATERIALIZED 97
157023 #define TK_REINDEX 98
157024 #define TK_RENAME 99
157025 #define TK_CTIME_KW 100
157026 #define TK_ANY 101
157027 #define TK_BITAND 102
157028 #define TK_BITOR 103
157029 #define TK_LSHIFT 104
157030 #define TK_RSHIFT 105
157031 #define TK_PLUS 106
157032 #define TK_MINUS 107
157033 #define TK_STAR 108
157034 #define TK_SLASH 109
157035 #define TK_REM 110
157036 #define TK_CONCAT 111
157037 #define TK_COLLATE 112
157038 #define TK_BITNOT 113
157039 #define TK_ON 114
157040 #define TK_INDEXED 115
157041 #define TK_STRING 116
157042 #define TK_JOIN_KW 117
157043 #define TK_CONSTRAINT 118
157044 #define TK_DEFAULT 119
157045 #define TK_NULL 120
157046 #define TK_PRIMARY 121
157047 #define TK_UNIQUE 122
157048 #define TK_CHECK 123
157049 #define TK_REFERENCES 124
157050 #define TK_AUTOINCR 125
157051 #define TK_INSERT 126
157052 #define TK_DELETE 127
157053 #define TK_UPDATE 128
157054 #define TK_SET 129
157055 #define TK_DEFERRABLE 130
157056 #define TK_FOREIGN 131
157057 #define TK_DROP 132
157058 #define TK_UNION 133
157059 #define TK_ALL 134
157060 #define TK_EXCEPT 135
157061 #define TK_INTERSECT 136
157062 #define TK_SELECT 137
157063 #define TK_VALUES 138
157064 #define TK_DISTINCT 139
157065 #define TK_DOT 140
157066 #define TK_FROM 141
157067 #define TK_JOIN 142
157068 #define TK_USING 143
157069 #define TK_ORDER 144
157070 #define TK_GROUP 145
157071 #define TK_HAVING 146
157072 #define TK_LIMIT 147
157073 #define TK_WHERE 148
157074 #define TK_RETURNING 149
157075 #define TK_INTO 150
157076 #define TK_NOTHING 151
157077 #define TK_FLOAT 152
157078 #define TK_BLOB 153
157079 #define TK_INTEGER 154
157080 #define TK_VARIABLE 155
157081 #define TK_CASE 156
157082 #define TK_WHEN 157
157083 #define TK_THEN 158
157084 #define TK_ELSE 159
157085 #define TK_INDEX 160
157086 #define TK_ALTER 161
157087 #define TK_ADD 162
157088 #define TK_WINDOW 163
157089 #define TK_OVER 164
157090 #define TK_FILTER 165
157091 #define TK_COLUMN 166
157092 #define TK_AGG_FUNCTION 167
157093 #define TK_AGG_COLUMN 168
157094 #define TK_TRUEFALSE 169
157095 #define TK_ISNOT 170
157096 #define TK_FUNCTION 171
157097 #define TK_UMINUS 172
157098 #define TK_UPLUS 173
157099 #define TK_TRUTH 174
157100 #define TK_REGISTER 175
157101 #define TK_VECTOR 176
157102 #define TK_SELECT_COLUMN 177
157103 #define TK_IF_NULL_ROW 178
157104 #define TK_ASTERISK 179
157105 #define TK_SPAN 180
157106 #define TK_SPACE 181
157107 #define TK_ILLEGAL 182
157108 #endif
157109 /**************** End token definitions ***************************************/
157110
157111 /* The next sections is a series of control #defines.
157112 ** various aspects of the generated parser.
@@ -156991,32 +157162,33 @@
157162 #ifndef INTERFACE
157163 # define INTERFACE 1
157164 #endif
157165 /************* Begin control #defines *****************************************/
157166 #define YYCODETYPE unsigned short int
157167 #define YYNOCODE 316
157168 #define YYACTIONTYPE unsigned short int
157169 #define YYWILDCARD 101
157170 #define sqlite3ParserTOKENTYPE Token
157171 typedef union {
157172 int yyinit;
157173 sqlite3ParserTOKENTYPE yy0;
157174 Window* yy19;
157175 struct TrigEvent yy50;
157176 int yy60;
157177 struct FrameBound yy113;
157178 Upsert* yy178;
157179 With* yy195;
157180 IdList* yy288;
157181 SrcList* yy291;
157182 Select* yy307;
157183 ExprList* yy338;
157184 TriggerStep* yy483;
157185 const char* yy528;
157186 u8 yy570;
157187 Expr* yy602;
157188 Cte* yy607;
157189 struct {int value; int mask;} yy615;
157190 } YYMINORTYPE;
157191 #ifndef YYSTACKDEPTH
157192 #define YYSTACKDEPTH 100
157193 #endif
157194 #define sqlite3ParserARG_SDECL
@@ -157028,22 +157200,22 @@
157200 #define sqlite3ParserCTX_PDECL ,Parse *pParse
157201 #define sqlite3ParserCTX_PARAM ,pParse
157202 #define sqlite3ParserCTX_FETCH Parse *pParse=yypParser->pParse;
157203 #define sqlite3ParserCTX_STORE yypParser->pParse=pParse;
157204 #define YYFALLBACK 1
157205 #define YYNSTATE 570
157206 #define YYNRULE 398
157207 #define YYNRULE_WITH_ACTION 337
157208 #define YYNTOKEN 183
157209 #define YY_MAX_SHIFT 569
157210 #define YY_MIN_SHIFTREDUCE 825
157211 #define YY_MAX_SHIFTREDUCE 1222
157212 #define YY_ERROR_ACTION 1223
157213 #define YY_ACCEPT_ACTION 1224
157214 #define YY_NO_ACTION 1225
157215 #define YY_MIN_REDUCE 1226
157216 #define YY_MAX_REDUCE 1623
157217 /************* End control #defines *******************************************/
157218 #define YY_NLOOKAHEAD ((int)(sizeof(yy_lookahead)/sizeof(yy_lookahead[0])))
157219
157220 /* Define the yytestcase() macro to be a no-op if is not already defined
157221 ** otherwise.
@@ -157106,605 +157278,604 @@
157278 ** yy_reduce_ofst[] For each state, the offset into yy_action for
157279 ** shifting non-terminals after a reduce.
157280 ** yy_default[] Default action for each state.
157281 **
157282 *********** Begin parsing tables **********************************************/
157283 #define YY_ACTTAB_COUNT (2020)
157284 static const YYACTIONTYPE yy_action[] = {
157285 /* 0 */ 563, 1295, 563, 1274, 168, 361, 115, 112, 218, 373,
157286 /* 10 */ 563, 1295, 374, 563, 488, 563, 115, 112, 218, 406,
157287 /* 20 */ 1300, 1300, 41, 41, 41, 41, 514, 1504, 520, 1298,
157288 /* 30 */ 1298, 959, 41, 41, 1257, 71, 71, 51, 51, 960,
157289 /* 40 */ 557, 557, 557, 122, 123, 113, 1200, 1200, 1035, 1038,
157290 /* 50 */ 1028, 1028, 120, 120, 121, 121, 121, 121, 414, 406,
157291 /* 60 */ 273, 273, 273, 273, 115, 112, 218, 115, 112, 218,
157292 /* 70 */ 197, 268, 545, 560, 515, 560, 1260, 563, 385, 248,
157293 /* 80 */ 215, 521, 399, 122, 123, 113, 1200, 1200, 1035, 1038,
157294 /* 90 */ 1028, 1028, 120, 120, 121, 121, 121, 121, 540, 13,
157295 /* 100 */ 13, 1259, 119, 119, 119, 119, 118, 118, 117, 117,
157296 /* 110 */ 117, 116, 441, 1176, 419, 1531, 446, 137, 512, 1539,
157297 /* 120 */ 1545, 372, 1547, 6, 371, 1176, 1148, 1584, 1148, 406,
157298 /* 130 */ 1545, 534, 115, 112, 218, 1267, 99, 441, 121, 121,
157299 /* 140 */ 121, 121, 119, 119, 119, 119, 118, 118, 117, 117,
157300 /* 150 */ 117, 116, 441, 122, 123, 113, 1200, 1200, 1035, 1038,
157301 /* 160 */ 1028, 1028, 120, 120, 121, 121, 121, 121, 197, 1176,
157302 /* 170 */ 1177, 1178, 241, 304, 554, 501, 498, 497, 473, 124,
157303 /* 180 */ 394, 1176, 1177, 1178, 1176, 496, 119, 119, 119, 119,
157304 /* 190 */ 118, 118, 117, 117, 117, 116, 441, 139, 540, 406,
157305 /* 200 */ 121, 121, 121, 121, 114, 117, 117, 117, 116, 441,
157306 /* 210 */ 541, 1532, 119, 119, 119, 119, 118, 118, 117, 117,
157307 /* 220 */ 117, 116, 441, 122, 123, 113, 1200, 1200, 1035, 1038,
157308 /* 230 */ 1028, 1028, 120, 120, 121, 121, 121, 121, 406, 320,
157309 /* 240 */ 1176, 1177, 1178, 81, 342, 1590, 396, 80, 119, 119,
157310 /* 250 */ 119, 119, 118, 118, 117, 117, 117, 116, 441, 1176,
157311 /* 260 */ 211, 450, 122, 123, 113, 1200, 1200, 1035, 1038, 1028,
157312 /* 270 */ 1028, 120, 120, 121, 121, 121, 121, 251, 450, 449,
157313 /* 280 */ 273, 273, 119, 119, 119, 119, 118, 118, 117, 117,
157314 /* 290 */ 117, 116, 441, 560, 1224, 1, 1, 569, 2, 1228,
157315 /* 300 */ 317, 1176, 319, 1561, 305, 337, 140, 340, 406, 430,
157316 /* 310 */ 469, 1533, 1197, 1308, 348, 1176, 1177, 1178, 168, 462,
157317 /* 320 */ 330, 119, 119, 119, 119, 118, 118, 117, 117, 117,
157318 /* 330 */ 116, 441, 122, 123, 113, 1200, 1200, 1035, 1038, 1028,
157319 /* 340 */ 1028, 120, 120, 121, 121, 121, 121, 273, 273, 563,
157320 /* 350 */ 83, 450, 416, 1564, 569, 2, 1228, 1176, 1177, 1178,
157321 /* 360 */ 560, 305, 471, 140, 944, 995, 860, 563, 467, 1197,
157322 /* 370 */ 1308, 13, 13, 137, 229, 118, 118, 117, 117, 117,
157323 /* 380 */ 116, 441, 96, 318, 946, 504, 424, 361, 562, 71,
157324 /* 390 */ 71, 119, 119, 119, 119, 118, 118, 117, 117, 117,
157325 /* 400 */ 116, 441, 427, 205, 273, 273, 445, 1015, 259, 276,
157326 /* 410 */ 356, 507, 351, 506, 246, 406, 959, 560, 328, 344,
157327 /* 420 */ 347, 315, 860, 1006, 960, 126, 545, 1005, 313, 304,
157328 /* 430 */ 554, 229, 538, 1539, 148, 544, 281, 6, 203, 122,
157329 /* 440 */ 123, 113, 1200, 1200, 1035, 1038, 1028, 1028, 120, 120,
157330 /* 450 */ 121, 121, 121, 121, 563, 217, 563, 12, 406, 1005,
157331 /* 460 */ 1005, 1007, 502, 445, 119, 119, 119, 119, 118, 118,
157332 /* 470 */ 117, 117, 117, 116, 441, 452, 71, 71, 70, 70,
157333 /* 480 */ 944, 137, 122, 123, 113, 1200, 1200, 1035, 1038, 1028,
157334 /* 490 */ 1028, 120, 120, 121, 121, 121, 121, 1530, 119, 119,
157335 /* 500 */ 119, 119, 118, 118, 117, 117, 117, 116, 441, 403,
157336 /* 510 */ 402, 241, 1176, 545, 501, 498, 497, 1468, 1143, 451,
157337 /* 520 */ 267, 267, 513, 1540, 496, 142, 1176, 6, 406, 530,
157338 /* 530 */ 194, 1143, 864, 560, 1143, 461, 182, 304, 554, 32,
157339 /* 540 */ 379, 119, 119, 119, 119, 118, 118, 117, 117, 117,
157340 /* 550 */ 116, 441, 122, 123, 113, 1200, 1200, 1035, 1038, 1028,
157341 /* 560 */ 1028, 120, 120, 121, 121, 121, 121, 406, 1176, 1177,
157342 /* 570 */ 1178, 857, 568, 1176, 1228, 925, 1176, 454, 361, 305,
157343 /* 580 */ 189, 140, 1176, 1177, 1178, 519, 529, 404, 1308, 183,
157344 /* 590 */ 1015, 122, 123, 113, 1200, 1200, 1035, 1038, 1028, 1028,
157345 /* 600 */ 120, 120, 121, 121, 121, 121, 1006, 16, 16, 370,
157346 /* 610 */ 1005, 119, 119, 119, 119, 118, 118, 117, 117, 117,
157347 /* 620 */ 116, 441, 273, 273, 1537, 150, 1176, 98, 6, 1176,
157348 /* 630 */ 1177, 1178, 1176, 1177, 1178, 560, 380, 406, 376, 438,
157349 /* 640 */ 437, 1161, 1005, 1005, 1007, 1025, 1025, 1036, 1039, 229,
157350 /* 650 */ 119, 119, 119, 119, 118, 118, 117, 117, 117, 116,
157351 /* 660 */ 441, 122, 123, 113, 1200, 1200, 1035, 1038, 1028, 1028,
157352 /* 670 */ 120, 120, 121, 121, 121, 121, 406, 1143, 1619, 392,
157353 /* 680 */ 1016, 445, 1176, 1177, 1178, 1207, 525, 1207, 1530, 995,
157354 /* 690 */ 1143, 304, 554, 1143, 5, 563, 543, 3, 361, 216,
157355 /* 700 */ 122, 123, 113, 1200, 1200, 1035, 1038, 1028, 1028, 120,
157356 /* 710 */ 120, 121, 121, 121, 121, 143, 563, 13, 13, 1029,
157357 /* 720 */ 119, 119, 119, 119, 118, 118, 117, 117, 117, 116,
157358 /* 730 */ 441, 1176, 426, 563, 1176, 563, 274, 274, 13, 13,
157359 /* 740 */ 1078, 1176, 328, 457, 316, 147, 406, 211, 361, 560,
157360 /* 750 */ 1000, 213, 511, 293, 477, 55, 55, 71, 71, 119,
157361 /* 760 */ 119, 119, 119, 118, 118, 117, 117, 117, 116, 441,
157362 /* 770 */ 122, 123, 113, 1200, 1200, 1035, 1038, 1028, 1028, 120,
157363 /* 780 */ 120, 121, 121, 121, 121, 406, 455, 1176, 1177, 1178,
157364 /* 790 */ 1176, 1177, 1178, 471, 526, 149, 404, 1176, 1177, 1178,
157365 /* 800 */ 105, 270, 103, 563, 944, 563, 116, 441, 1530, 122,
157366 /* 810 */ 123, 113, 1200, 1200, 1035, 1038, 1028, 1028, 120, 120,
157367 /* 820 */ 121, 121, 121, 121, 945, 13, 13, 13, 13, 119,
157368 /* 830 */ 119, 119, 119, 118, 118, 117, 117, 117, 116, 441,
157369 /* 840 */ 191, 563, 192, 563, 416, 439, 439, 439, 1083, 1083,
157370 /* 850 */ 485, 561, 285, 914, 914, 406, 462, 330, 1530, 830,
157371 /* 860 */ 831, 832, 206, 71, 71, 71, 71, 286, 119, 119,
157372 /* 870 */ 119, 119, 118, 118, 117, 117, 117, 116, 441, 122,
157373 /* 880 */ 123, 113, 1200, 1200, 1035, 1038, 1028, 1028, 120, 120,
157374 /* 890 */ 121, 121, 121, 121, 563, 217, 563, 1122, 1617, 406,
157375 /* 900 */ 300, 1617, 301, 416, 1278, 1473, 244, 243, 242, 1249,
157376 /* 910 */ 412, 556, 412, 282, 842, 279, 71, 71, 71, 71,
157377 /* 920 */ 944, 1415, 1473, 1475, 101, 113, 1200, 1200, 1035, 1038,
157378 /* 930 */ 1028, 1028, 120, 120, 121, 121, 121, 121, 119, 119,
157379 /* 940 */ 119, 119, 118, 118, 117, 117, 117, 116, 441, 273,
157380 /* 950 */ 273, 1099, 563, 436, 1143, 440, 563, 1122, 1618, 357,
157381 /* 960 */ 1558, 1618, 560, 546, 488, 197, 1100, 1143, 378, 290,
157382 /* 970 */ 1143, 1306, 284, 460, 71, 71, 1120, 405, 13, 13,
157383 /* 980 */ 145, 1101, 119, 119, 119, 119, 118, 118, 117, 117,
157384 /* 990 */ 117, 116, 441, 542, 104, 1473, 509, 273, 273, 294,
157385 /* 1000 */ 1514, 294, 900, 273, 273, 273, 273, 563, 1503, 563,
157386 /* 1010 */ 560, 545, 901, 464, 406, 1058, 560, 852, 560, 198,
157387 /* 1020 */ 547, 1080, 920, 404, 1400, 1080, 146, 919, 38, 56,
157388 /* 1030 */ 56, 15, 15, 563, 406, 12, 1120, 471, 122, 123,
157389 /* 1040 */ 113, 1200, 1200, 1035, 1038, 1028, 1028, 120, 120, 121,
157390 /* 1050 */ 121, 121, 121, 1460, 406, 43, 43, 483, 122, 123,
157391 /* 1060 */ 113, 1200, 1200, 1035, 1038, 1028, 1028, 120, 120, 121,
157392 /* 1070 */ 121, 121, 121, 563, 852, 9, 471, 251, 122, 111,
157393 /* 1080 */ 113, 1200, 1200, 1035, 1038, 1028, 1028, 120, 120, 121,
157394 /* 1090 */ 121, 121, 121, 563, 421, 57, 57, 119, 119, 119,
157395 /* 1100 */ 119, 118, 118, 117, 117, 117, 116, 441, 1176, 493,
157396 /* 1110 */ 563, 289, 1197, 478, 1516, 44, 44, 119, 119, 119,
157397 /* 1120 */ 119, 118, 118, 117, 117, 117, 116, 441, 880, 563,
157398 /* 1130 */ 536, 563, 58, 58, 488, 1414, 245, 119, 119, 119,
157399 /* 1140 */ 119, 118, 118, 117, 117, 117, 116, 441, 563, 535,
157400 /* 1150 */ 291, 59, 59, 60, 60, 438, 437, 406, 1154, 505,
157401 /* 1160 */ 304, 554, 477, 1204, 1176, 1177, 1178, 881, 1206, 1197,
157402 /* 1170 */ 61, 61, 1246, 357, 1558, 1538, 1205, 563, 1467, 6,
157403 /* 1180 */ 1176, 488, 123, 113, 1200, 1200, 1035, 1038, 1028, 1028,
157404 /* 1190 */ 120, 120, 121, 121, 121, 121, 1400, 1143, 410, 62,
157405 /* 1200 */ 62, 1207, 1099, 1207, 411, 447, 273, 273, 537, 1154,
157406 /* 1210 */ 1143, 108, 555, 1143, 4, 391, 1220, 1100, 1512, 560,
157407 /* 1220 */ 347, 516, 428, 548, 308, 1307, 1536, 1077, 558, 1077,
157408 /* 1230 */ 6, 488, 1101, 1400, 488, 309, 1176, 1177, 1178, 563,
157409 /* 1240 */ 119, 119, 119, 119, 118, 118, 117, 117, 117, 116,
157410 /* 1250 */ 441, 442, 278, 551, 563, 273, 273, 273, 273, 563,
157411 /* 1260 */ 327, 45, 45, 552, 563, 528, 422, 563, 560, 1400,
157412 /* 1270 */ 560, 108, 555, 137, 4, 1303, 46, 46, 335, 563,
157413 /* 1280 */ 482, 47, 47, 477, 479, 307, 49, 49, 558, 50,
157414 /* 1290 */ 50, 563, 1015, 563, 1221, 563, 1400, 563, 106, 106,
157415 /* 1300 */ 8, 63, 63, 423, 563, 107, 312, 442, 565, 564,
157416 /* 1310 */ 563, 442, 1005, 64, 64, 65, 65, 14, 14, 66,
157417 /* 1320 */ 66, 391, 1121, 552, 1312, 1180, 128, 128, 563, 304,
157418 /* 1330 */ 554, 563, 67, 67, 563, 359, 560, 532, 563, 484,
157419 /* 1340 */ 563, 1196, 531, 222, 1005, 1005, 1007, 1008, 27, 522,
157420 /* 1350 */ 52, 52, 1015, 68, 68, 563, 69, 69, 106, 106,
157421 /* 1360 */ 53, 53, 156, 156, 563, 107, 434, 442, 565, 564,
157422 /* 1370 */ 272, 215, 1005, 425, 563, 359, 563, 157, 157, 563,
157423 /* 1380 */ 1535, 292, 1180, 98, 6, 1344, 76, 76, 1215, 475,
157424 /* 1390 */ 413, 169, 226, 563, 245, 563, 54, 54, 72, 72,
157425 /* 1400 */ 1221, 129, 129, 1343, 1005, 1005, 1007, 1008, 27, 1563,
157426 /* 1410 */ 1165, 444, 456, 433, 277, 73, 73, 130, 130, 389,
157427 /* 1420 */ 389, 388, 262, 386, 1165, 444, 839, 1519, 277, 108,
157428 /* 1430 */ 555, 321, 4, 389, 389, 388, 262, 386, 563, 223,
157429 /* 1440 */ 839, 311, 468, 84, 202, 523, 558, 1492, 303, 310,
157430 /* 1450 */ 563, 110, 404, 223, 563, 311, 206, 30, 404, 277,
157431 /* 1460 */ 131, 131, 411, 310, 389, 389, 388, 262, 386, 442,
157432 /* 1470 */ 920, 839, 127, 127, 563, 919, 155, 155, 1491, 225,
157433 /* 1480 */ 563, 552, 871, 563, 223, 476, 311, 161, 31, 563,
157434 /* 1490 */ 135, 563, 480, 225, 310, 532, 154, 154, 332, 17,
157435 /* 1500 */ 533, 161, 136, 136, 135, 134, 134, 224, 228, 355,
157436 /* 1510 */ 1015, 132, 132, 133, 133, 1589, 106, 106, 889, 354,
157437 /* 1520 */ 563, 224, 563, 107, 225, 442, 565, 564, 1117, 275,
157438 /* 1530 */ 1005, 393, 161, 518, 563, 135, 108, 555, 417, 4,
157439 /* 1540 */ 1340, 407, 75, 75, 77, 77, 304, 554, 867, 563,
157440 /* 1550 */ 336, 563, 224, 558, 463, 407, 74, 74, 465, 1065,
157441 /* 1560 */ 304, 554, 1005, 1005, 1007, 1008, 27, 962, 963, 543,
157442 /* 1570 */ 448, 42, 42, 48, 48, 326, 442, 325, 98, 997,
157443 /* 1580 */ 470, 287, 250, 250, 448, 1009, 407, 472, 552, 339,
157444 /* 1590 */ 250, 304, 554, 879, 878, 331, 108, 555, 98, 4,
157445 /* 1600 */ 1277, 494, 532, 345, 247, 867, 98, 531, 341, 886,
157446 /* 1610 */ 887, 1126, 1076, 558, 1076, 448, 1065, 1015, 1061, 953,
157447 /* 1620 */ 343, 247, 250, 106, 106, 1291, 917, 1276, 850, 110,
157448 /* 1630 */ 107, 144, 442, 565, 564, 918, 442, 1005, 110, 1275,
157449 /* 1640 */ 350, 360, 1009, 1331, 1352, 299, 1399, 1577, 552, 1327,
157450 /* 1650 */ 1552, 550, 1338, 549, 1405, 1256, 1248, 1237, 1236, 1238,
157451 /* 1660 */ 1571, 489, 265, 200, 1324, 363, 365, 367, 11, 1005,
157452 /* 1670 */ 1005, 1007, 1008, 27, 390, 221, 1386, 1015, 280, 1391,
157453 /* 1680 */ 1381, 208, 323, 106, 106, 924, 1374, 453, 283, 324,
157454 /* 1690 */ 107, 474, 442, 565, 564, 1390, 499, 1005, 212, 288,
157455 /* 1700 */ 1274, 397, 353, 108, 555, 195, 4, 1464, 369, 1463,
157456 /* 1710 */ 1574, 1215, 1212, 329, 553, 171, 207, 383, 1511, 196,
157457 /* 1720 */ 558, 254, 1509, 415, 100, 555, 83, 4, 204, 1005,
157458 /* 1730 */ 1005, 1007, 1008, 27, 219, 79, 82, 1469, 180, 166,
157459 /* 1740 */ 173, 558, 458, 442, 175, 176, 177, 178, 35, 1387,
157460 /* 1750 */ 492, 459, 231, 1395, 96, 552, 1393, 1392, 395, 184,
157461 /* 1760 */ 481, 466, 36, 235, 442, 89, 398, 266, 487, 1480,
157462 /* 1770 */ 1458, 237, 188, 338, 508, 429, 552, 490, 400, 238,
157463 /* 1780 */ 334, 1239, 239, 1294, 1015, 1293, 1292, 1285, 91, 871,
157464 /* 1790 */ 106, 106, 213, 431, 1588, 432, 524, 107, 517, 442,
157465 /* 1800 */ 565, 564, 401, 1264, 1005, 1015, 1263, 1587, 352, 1262,
157466 /* 1810 */ 1557, 106, 106, 1586, 1284, 297, 298, 358, 107, 1335,
157467 /* 1820 */ 442, 565, 564, 95, 362, 1005, 253, 252, 435, 125,
157468 /* 1830 */ 543, 10, 1444, 1543, 377, 1542, 1005, 1005, 1007, 1008,
157469 /* 1840 */ 27, 302, 102, 97, 527, 1336, 260, 1317, 364, 1245,
157470 /* 1850 */ 1334, 34, 566, 1171, 366, 381, 375, 1005, 1005, 1007,
157471 /* 1860 */ 1008, 27, 1333, 1359, 368, 1316, 199, 382, 261, 263,
157472 /* 1870 */ 264, 1358, 158, 1496, 141, 1497, 1495, 567, 1234, 1229,
157473 /* 1880 */ 1494, 295, 159, 209, 210, 78, 826, 443, 201, 306,
157474 /* 1890 */ 220, 1075, 138, 1073, 160, 314, 162, 172, 1196, 174,
157475 /* 1900 */ 903, 227, 230, 322, 1089, 179, 163, 164, 418, 85,
157476 /* 1910 */ 420, 181, 170, 408, 409, 86, 87, 165, 88, 1092,
157477 /* 1920 */ 232, 233, 1088, 151, 18, 234, 1081, 250, 333, 185,
157478 /* 1930 */ 1209, 486, 236, 186, 37, 841, 491, 354, 240, 346,
157479 /* 1940 */ 503, 187, 90, 167, 19, 495, 20, 869, 500, 349,
157480 /* 1950 */ 92, 882, 296, 152, 93, 510, 1127, 1159, 153, 1041,
157481 /* 1960 */ 214, 1128, 39, 94, 269, 271, 952, 190, 947, 110,
157482 /* 1970 */ 1149, 1145, 1153, 249, 1133, 1147, 7, 33, 21, 193,
157483 /* 1980 */ 22, 23, 24, 25, 1152, 539, 98, 1056, 26, 1042,
157484 /* 1990 */ 1040, 1044, 1098, 1045, 1097, 256, 255, 28, 40, 387,
157485 /* 2000 */ 1010, 851, 109, 29, 1167, 559, 384, 257, 913, 258,
157486 /* 2010 */ 1166, 1579, 1225, 1225, 1225, 1225, 1225, 1225, 1225, 1578,
157487 };
157488 static const YYCODETYPE yy_lookahead[] = {
157489 /* 0 */ 191, 220, 191, 222, 191, 191, 271, 272, 273, 216,
157490 /* 10 */ 191, 230, 216, 191, 191, 191, 271, 272, 273, 19,
157491 /* 20 */ 232, 233, 213, 214, 213, 214, 202, 292, 202, 232,
157492 /* 30 */ 233, 31, 213, 214, 213, 213, 214, 213, 214, 39,
157493 /* 40 */ 207, 208, 209, 43, 44, 45, 46, 47, 48, 49,
157494 /* 50 */ 50, 51, 52, 53, 54, 55, 56, 57, 235, 19,
157495 /* 60 */ 236, 237, 236, 237, 271, 272, 273, 271, 272, 273,
157496 /* 70 */ 191, 210, 250, 249, 250, 249, 213, 191, 199, 253,
157497 /* 80 */ 254, 259, 203, 43, 44, 45, 46, 47, 48, 49,
157498 /* 90 */ 50, 51, 52, 53, 54, 55, 56, 57, 191, 213,
157499 /* 100 */ 214, 213, 102, 103, 104, 105, 106, 107, 108, 109,
157500 /* 110 */ 110, 111, 112, 59, 228, 301, 293, 81, 305, 306,
157501 /* 120 */ 311, 312, 311, 310, 313, 59, 86, 212, 88, 19,
157502 /* 130 */ 311, 312, 271, 272, 273, 220, 26, 112, 54, 55,
157503 /* 140 */ 56, 57, 102, 103, 104, 105, 106, 107, 108, 109,
157504 /* 150 */ 110, 111, 112, 43, 44, 45, 46, 47, 48, 49,
157505 /* 160 */ 50, 51, 52, 53, 54, 55, 56, 57, 191, 115,
157506 /* 170 */ 116, 117, 118, 137, 138, 121, 122, 123, 191, 69,
157507 /* 180 */ 203, 115, 116, 117, 59, 131, 102, 103, 104, 105,
157508 /* 190 */ 106, 107, 108, 109, 110, 111, 112, 72, 191, 19,
157509 /* 200 */ 54, 55, 56, 57, 58, 108, 109, 110, 111, 112,
157510 /* 210 */ 303, 304, 102, 103, 104, 105, 106, 107, 108, 109,
157511 /* 220 */ 110, 111, 112, 43, 44, 45, 46, 47, 48, 49,
157512 /* 230 */ 50, 51, 52, 53, 54, 55, 56, 57, 19, 16,
157513 /* 240 */ 115, 116, 117, 24, 16, 227, 202, 67, 102, 103,
157514 /* 250 */ 104, 105, 106, 107, 108, 109, 110, 111, 112, 59,
157515 /* 260 */ 26, 191, 43, 44, 45, 46, 47, 48, 49, 50,
157516 /* 270 */ 51, 52, 53, 54, 55, 56, 57, 24, 208, 209,
157517 /* 280 */ 236, 237, 102, 103, 104, 105, 106, 107, 108, 109,
157518 /* 290 */ 110, 111, 112, 249, 183, 184, 185, 186, 187, 188,
157519 /* 300 */ 77, 59, 79, 191, 193, 77, 195, 79, 19, 19,
157520 /* 310 */ 266, 304, 59, 202, 24, 115, 116, 117, 191, 127,
157521 /* 320 */ 128, 102, 103, 104, 105, 106, 107, 108, 109, 110,
157522 /* 330 */ 111, 112, 43, 44, 45, 46, 47, 48, 49, 50,
157523 /* 340 */ 51, 52, 53, 54, 55, 56, 57, 236, 237, 191,
157524 /* 350 */ 150, 281, 191, 185, 186, 187, 188, 115, 116, 117,
157525 /* 360 */ 249, 193, 191, 195, 26, 73, 59, 191, 114, 116,
157526 /* 370 */ 202, 213, 214, 81, 263, 106, 107, 108, 109, 110,
157527 /* 380 */ 111, 112, 148, 160, 142, 95, 228, 191, 191, 213,
157528 /* 390 */ 214, 102, 103, 104, 105, 106, 107, 108, 109, 110,
157529 /* 400 */ 111, 112, 112, 149, 236, 237, 295, 100, 118, 119,
157530 /* 410 */ 120, 121, 122, 123, 124, 19, 31, 249, 126, 23,
157531 /* 420 */ 130, 260, 115, 116, 39, 22, 250, 120, 191, 137,
157532 /* 430 */ 138, 263, 305, 306, 238, 259, 265, 310, 149, 43,
157533 /* 440 */ 44, 45, 46, 47, 48, 49, 50, 51, 52, 53,
157534 /* 450 */ 54, 55, 56, 57, 191, 117, 191, 210, 19, 152,
157535 /* 460 */ 153, 154, 23, 295, 102, 103, 104, 105, 106, 107,
157536 /* 470 */ 108, 109, 110, 111, 112, 266, 213, 214, 213, 214,
157537 /* 480 */ 142, 81, 43, 44, 45, 46, 47, 48, 49, 50,
157538 /* 490 */ 51, 52, 53, 54, 55, 56, 57, 301, 102, 103,
157539 /* 500 */ 104, 105, 106, 107, 108, 109, 110, 111, 112, 106,
157540 /* 510 */ 107, 118, 59, 250, 121, 122, 123, 280, 76, 119,
157541 /* 520 */ 236, 237, 259, 306, 131, 72, 59, 310, 19, 87,
157542 /* 530 */ 283, 89, 23, 249, 92, 288, 22, 137, 138, 22,
157543 /* 540 */ 275, 102, 103, 104, 105, 106, 107, 108, 109, 110,
157544 /* 550 */ 111, 112, 43, 44, 45, 46, 47, 48, 49, 50,
157545 /* 560 */ 51, 52, 53, 54, 55, 56, 57, 19, 115, 116,
157546 /* 570 */ 117, 23, 186, 59, 188, 108, 59, 241, 191, 193,
157547 /* 580 */ 26, 195, 115, 116, 117, 191, 144, 251, 202, 22,
157548 /* 590 */ 100, 43, 44, 45, 46, 47, 48, 49, 50, 51,
157549 /* 600 */ 52, 53, 54, 55, 56, 57, 116, 213, 214, 191,
157550 /* 610 */ 120, 102, 103, 104, 105, 106, 107, 108, 109, 110,
157551 /* 620 */ 111, 112, 236, 237, 306, 238, 59, 26, 310, 115,
157552 /* 630 */ 116, 117, 115, 116, 117, 249, 246, 19, 248, 106,
157553 /* 640 */ 107, 23, 152, 153, 154, 46, 47, 48, 49, 263,
157554 /* 650 */ 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
157555 /* 660 */ 112, 43, 44, 45, 46, 47, 48, 49, 50, 51,
157556 /* 670 */ 52, 53, 54, 55, 56, 57, 19, 76, 298, 299,
157557 /* 680 */ 23, 295, 115, 116, 117, 152, 191, 154, 301, 73,
157558 /* 690 */ 89, 137, 138, 92, 22, 191, 144, 22, 191, 191,
157559 /* 700 */ 43, 44, 45, 46, 47, 48, 49, 50, 51, 52,
157560 /* 710 */ 53, 54, 55, 56, 57, 163, 191, 213, 214, 120,
157561 /* 720 */ 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
157562 /* 730 */ 112, 59, 228, 191, 59, 191, 236, 237, 213, 214,
157563 /* 740 */ 11, 59, 126, 127, 128, 238, 19, 26, 191, 249,
157564 /* 750 */ 23, 164, 165, 228, 191, 213, 214, 213, 214, 102,
157565 /* 760 */ 103, 104, 105, 106, 107, 108, 109, 110, 111, 112,
157566 /* 770 */ 43, 44, 45, 46, 47, 48, 49, 50, 51, 52,
157567 /* 780 */ 53, 54, 55, 56, 57, 19, 241, 115, 116, 117,
157568 /* 790 */ 115, 116, 117, 191, 250, 238, 251, 115, 116, 117,
157569 /* 800 */ 157, 23, 159, 191, 26, 191, 111, 112, 301, 43,
157570 /* 810 */ 44, 45, 46, 47, 48, 49, 50, 51, 52, 53,
157571 /* 820 */ 54, 55, 56, 57, 142, 213, 214, 213, 214, 102,
157572 /* 830 */ 103, 104, 105, 106, 107, 108, 109, 110, 111, 112,
157573 /* 840 */ 228, 191, 228, 191, 191, 207, 208, 209, 126, 127,
157574 /* 850 */ 128, 133, 289, 135, 136, 19, 127, 128, 301, 7,
157575 /* 860 */ 8, 9, 141, 213, 214, 213, 214, 265, 102, 103,
157576 /* 870 */ 104, 105, 106, 107, 108, 109, 110, 111, 112, 43,
157577 /* 880 */ 44, 45, 46, 47, 48, 49, 50, 51, 52, 53,
157578 /* 890 */ 54, 55, 56, 57, 191, 117, 191, 22, 23, 19,
157579 /* 900 */ 250, 26, 250, 191, 223, 191, 126, 127, 128, 205,
157580 /* 910 */ 206, 205, 206, 260, 21, 202, 213, 214, 213, 214,
157581 /* 920 */ 142, 270, 208, 209, 158, 45, 46, 47, 48, 49,
157582 /* 930 */ 50, 51, 52, 53, 54, 55, 56, 57, 102, 103,
157583 /* 940 */ 104, 105, 106, 107, 108, 109, 110, 111, 112, 236,
157584 /* 950 */ 237, 12, 191, 250, 76, 250, 191, 22, 23, 308,
157585 /* 960 */ 309, 26, 249, 202, 191, 191, 27, 89, 191, 202,
157586 /* 970 */ 92, 202, 260, 80, 213, 214, 101, 203, 213, 214,
157587 /* 980 */ 22, 42, 102, 103, 104, 105, 106, 107, 108, 109,
157588 /* 990 */ 110, 111, 112, 228, 158, 281, 108, 236, 237, 225,
157589 /* 1000 */ 191, 227, 63, 236, 237, 236, 237, 191, 235, 191,
157590 /* 1010 */ 249, 250, 73, 241, 19, 122, 249, 59, 249, 24,
157591 /* 1020 */ 259, 29, 134, 251, 191, 33, 22, 139, 24, 213,
157592 /* 1030 */ 214, 213, 214, 191, 19, 210, 101, 191, 43, 44,
157593 /* 1040 */ 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
157594 /* 1050 */ 55, 56, 57, 160, 19, 213, 214, 65, 43, 44,
157595 /* 1060 */ 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
157596 /* 1070 */ 55, 56, 57, 191, 116, 22, 191, 24, 43, 44,
157597 /* 1080 */ 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
157598 /* 1090 */ 55, 56, 57, 191, 261, 213, 214, 102, 103, 104,
157599 /* 1100 */ 105, 106, 107, 108, 109, 110, 111, 112, 59, 19,
157600 /* 1110 */ 191, 265, 59, 288, 191, 213, 214, 102, 103, 104,
157601 /* 1120 */ 105, 106, 107, 108, 109, 110, 111, 112, 35, 191,
157602 /* 1130 */ 66, 191, 213, 214, 191, 270, 46, 102, 103, 104,
157603 /* 1140 */ 105, 106, 107, 108, 109, 110, 111, 112, 191, 85,
157604 /* 1150 */ 265, 213, 214, 213, 214, 106, 107, 19, 94, 66,
157605 /* 1160 */ 137, 138, 191, 114, 115, 116, 117, 74, 119, 116,
157606 /* 1170 */ 213, 214, 202, 308, 309, 306, 127, 191, 235, 310,
157607 /* 1180 */ 59, 191, 44, 45, 46, 47, 48, 49, 50, 51,
157608 /* 1190 */ 52, 53, 54, 55, 56, 57, 191, 76, 196, 213,
157609 /* 1200 */ 214, 152, 12, 154, 114, 191, 236, 237, 87, 145,
157610 /* 1210 */ 89, 19, 20, 92, 22, 22, 23, 27, 191, 249,
157611 /* 1220 */ 130, 202, 129, 202, 191, 235, 306, 152, 36, 154,
157612 /* 1230 */ 310, 191, 42, 191, 191, 191, 115, 116, 117, 191,
157613 /* 1240 */ 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
157614 /* 1250 */ 112, 59, 99, 63, 191, 236, 237, 236, 237, 191,
157615 /* 1260 */ 289, 213, 214, 71, 191, 144, 261, 191, 249, 191,
157616 /* 1270 */ 249, 19, 20, 81, 22, 235, 213, 214, 235, 191,
157617 /* 1280 */ 278, 213, 214, 191, 282, 132, 213, 214, 36, 213,
157618 /* 1290 */ 214, 191, 100, 191, 101, 191, 191, 191, 106, 107,
157619 /* 1300 */ 48, 213, 214, 261, 191, 113, 191, 115, 116, 117,
157620 /* 1310 */ 191, 59, 120, 213, 214, 213, 214, 213, 214, 213,
157621 /* 1320 */ 214, 22, 23, 71, 237, 59, 213, 214, 191, 137,
157622 /* 1330 */ 138, 191, 213, 214, 191, 191, 249, 85, 191, 261,
157623 /* 1340 */ 191, 26, 90, 15, 152, 153, 154, 155, 156, 19,
157624 /* 1350 */ 213, 214, 100, 213, 214, 191, 213, 214, 106, 107,
157625 /* 1360 */ 213, 214, 213, 214, 191, 113, 261, 115, 116, 117,
157626 /* 1370 */ 253, 254, 120, 229, 191, 191, 191, 213, 214, 191,
157627 /* 1380 */ 306, 289, 116, 26, 310, 191, 213, 214, 60, 19,
157628 /* 1390 */ 296, 297, 24, 191, 46, 191, 213, 214, 213, 214,
157629 /* 1400 */ 101, 213, 214, 191, 152, 153, 154, 155, 156, 0,
157630 /* 1410 */ 1, 2, 191, 229, 5, 213, 214, 213, 214, 10,
157631 /* 1420 */ 11, 12, 13, 14, 1, 2, 17, 191, 5, 19,
157632 /* 1430 */ 20, 191, 22, 10, 11, 12, 13, 14, 191, 30,
157633 /* 1440 */ 17, 32, 241, 148, 149, 115, 36, 191, 241, 40,
157634 /* 1450 */ 191, 26, 251, 30, 191, 32, 141, 22, 251, 5,
157635 /* 1460 */ 213, 214, 114, 40, 10, 11, 12, 13, 14, 59,
157636 /* 1470 */ 134, 17, 213, 214, 191, 139, 213, 214, 191, 70,
157637 /* 1480 */ 191, 71, 125, 191, 30, 115, 32, 78, 53, 191,
157638 /* 1490 */ 81, 191, 191, 70, 40, 85, 213, 214, 191, 22,
157639 /* 1500 */ 90, 78, 213, 214, 81, 213, 214, 98, 140, 120,
157640 /* 1510 */ 100, 213, 214, 213, 214, 23, 106, 107, 26, 130,
157641 /* 1520 */ 191, 98, 191, 113, 70, 115, 116, 117, 23, 22,
157642 /* 1530 */ 120, 26, 78, 19, 191, 81, 19, 20, 61, 22,
157643 /* 1540 */ 191, 132, 213, 214, 213, 214, 137, 138, 59, 191,
157644 /* 1550 */ 191, 191, 98, 36, 128, 132, 213, 214, 128, 59,
157645 /* 1560 */ 137, 138, 152, 153, 154, 155, 156, 83, 84, 144,
157646 /* 1570 */ 161, 213, 214, 213, 214, 23, 59, 151, 26, 23,
157647 /* 1580 */ 23, 151, 26, 26, 161, 59, 132, 23, 71, 191,
157648 /* 1590 */ 26, 137, 138, 119, 120, 23, 19, 20, 26, 22,
157649 /* 1600 */ 223, 23, 85, 23, 26, 116, 26, 90, 191, 7,
157650 /* 1610 */ 8, 97, 152, 36, 154, 161, 116, 100, 23, 23,
157651 /* 1620 */ 191, 26, 26, 106, 107, 191, 23, 223, 23, 26,
157652 /* 1630 */ 113, 26, 115, 116, 117, 23, 59, 120, 26, 191,
157653 /* 1640 */ 191, 191, 116, 255, 191, 252, 191, 140, 71, 191,
157654 /* 1650 */ 315, 233, 191, 191, 191, 191, 191, 191, 191, 191,
157655 /* 1660 */ 191, 285, 284, 239, 252, 252, 252, 252, 240, 152,
157656 /* 1670 */ 153, 154, 155, 156, 189, 294, 268, 100, 242, 268,
157657 /* 1680 */ 264, 211, 290, 106, 107, 108, 264, 256, 256, 243,
157658 /* 1690 */ 113, 290, 115, 116, 117, 268, 217, 120, 226, 243,
157659 /* 1700 */ 222, 268, 216, 19, 20, 246, 22, 216, 256, 216,
157660 /* 1710 */ 194, 60, 38, 242, 277, 294, 240, 242, 198, 246,
157661 /* 1720 */ 36, 140, 198, 198, 19, 20, 150, 22, 149, 152,
157662 /* 1730 */ 153, 154, 155, 156, 294, 291, 291, 280, 22, 43,
157663 /* 1740 */ 231, 36, 18, 59, 234, 234, 234, 234, 267, 269,
157664 /* 1750 */ 18, 198, 197, 231, 148, 71, 269, 269, 243, 231,
157665 /* 1760 */ 198, 243, 267, 197, 59, 157, 243, 198, 62, 287,
157666 /* 1770 */ 243, 197, 22, 198, 114, 64, 71, 218, 218, 197,
157667 /* 1780 */ 286, 198, 197, 215, 100, 215, 215, 224, 22, 125,
157668 /* 1790 */ 106, 107, 164, 24, 221, 112, 143, 113, 302, 115,
157669 /* 1800 */ 116, 117, 218, 215, 120, 100, 217, 221, 215, 215,
157670 /* 1810 */ 309, 106, 107, 215, 224, 279, 279, 218, 113, 258,
157671 /* 1820 */ 115, 116, 117, 114, 257, 120, 91, 198, 82, 147,
157672 /* 1830 */ 144, 22, 274, 314, 198, 314, 152, 153, 154, 155,
157673 /* 1840 */ 156, 276, 157, 146, 145, 258, 25, 247, 257, 201,
157674 /* 1850 */ 258, 26, 200, 13, 257, 244, 246, 152, 153, 154,
157675 /* 1860 */ 155, 156, 258, 262, 257, 247, 245, 243, 192, 192,
157676 /* 1870 */ 6, 262, 204, 210, 219, 210, 210, 190, 190, 190,
157677 /* 1880 */ 210, 219, 204, 211, 211, 210, 4, 3, 22, 162,
157678 /* 1890 */ 15, 23, 16, 23, 204, 138, 129, 150, 26, 141,
157679 /* 1900 */ 20, 24, 143, 16, 1, 141, 129, 129, 61, 53,
157680 /* 1910 */ 37, 150, 297, 300, 300, 53, 53, 129, 53, 115,
157681 /* 1920 */ 34, 140, 1, 5, 22, 114, 68, 26, 160, 68,
157682 /* 1930 */ 75, 41, 140, 114, 24, 20, 19, 130, 124, 23,
157683 /* 1940 */ 96, 22, 22, 37, 22, 67, 22, 59, 67, 24,
157684 /* 1950 */ 22, 28, 67, 23, 148, 22, 97, 23, 23, 23,
157685 /* 1960 */ 140, 23, 22, 26, 23, 23, 115, 22, 142, 26,
157686 /* 1970 */ 75, 88, 75, 34, 23, 86, 44, 22, 34, 26,
157687 /* 1980 */ 34, 34, 34, 34, 93, 24, 26, 23, 34, 23,
157688 /* 1990 */ 23, 23, 23, 11, 23, 22, 26, 22, 22, 15,
157689 /* 2000 */ 23, 23, 22, 22, 1, 26, 23, 140, 134, 140,
157690 /* 2010 */ 1, 140, 316, 316, 316, 316, 316, 316, 316, 140,
157691 /* 2020 */ 316, 316, 316, 316, 316, 316, 316, 316, 316, 316,
157692 /* 2030 */ 316, 316, 316, 316, 316, 316, 316, 316, 316, 316,
157693 /* 2040 */ 316, 316, 316, 316, 316, 316, 316, 316, 316, 316,
157694 /* 2050 */ 316, 316, 316, 316, 316, 316, 316, 316, 316, 316,
157695 /* 2060 */ 316, 316, 316, 316, 316, 316, 316, 316, 316, 316,
157696 /* 2070 */ 316, 316, 316, 316, 316, 316, 316, 316, 316, 316,
157697 /* 2080 */ 316, 316, 316, 316, 316, 316, 316, 316, 316, 316,
157698 /* 2090 */ 316, 316, 316, 316, 316, 316, 316, 316, 316, 316,
157699 /* 2100 */ 316, 316, 316, 316, 316, 316, 316, 316, 316, 316,
157700 /* 2110 */ 316, 316, 316, 316, 316, 316, 316, 316, 316, 316,
157701 /* 2120 */ 316, 316, 316, 316, 316, 316, 316, 316, 316, 316,
157702 /* 2130 */ 316, 316, 316, 316, 316, 316, 316, 316, 316, 316,
157703 /* 2140 */ 316, 316, 316, 316, 316, 316, 316, 316, 316, 316,
157704 /* 2150 */ 316, 316, 316, 316, 316, 316, 316, 316, 316, 316,
157705 /* 2160 */ 316, 316, 316, 316, 316, 316, 316, 316, 316, 316,
157706 /* 2170 */ 316, 316, 316, 316, 316, 316, 316, 316, 316, 316,
157707 /* 2180 */ 316, 316, 316, 316, 316, 316, 316, 316, 316, 316,
157708 /* 2190 */ 316, 316, 316, 316, 316, 316, 316, 316, 316, 316,
157709 /* 2200 */ 316, 316, 316,
157710 };
157711 #define YY_SHIFT_COUNT (569)
157712 #define YY_SHIFT_MIN (0)
157713 #define YY_SHIFT_MAX (2009)
157714 static const unsigned short int yy_shift_ofst[] = {
157715 /* 0 */ 1423, 1409, 1454, 1192, 1192, 36, 1252, 1410, 1517, 1684,
157716 /* 10 */ 1684, 1684, 292, 0, 0, 180, 1015, 1684, 1684, 1684,
157717 /* 20 */ 1684, 1684, 1684, 1684, 1684, 1684, 1684, 1684, 1684, 1684,
157718 /* 30 */ 1049, 1049, 1121, 1121, 54, 400, 36, 36, 36, 36,
157719 /* 40 */ 36, 40, 110, 219, 289, 396, 439, 509, 548, 618,
157720 /* 50 */ 657, 727, 766, 836, 995, 1015, 1015, 1015, 1015, 1015,
157721 /* 60 */ 1015, 1015, 1015, 1015, 1015, 1015, 1015, 1015, 1015, 1015,
157722 /* 70 */ 1015, 1015, 1015, 1035, 1015, 1138, 880, 880, 1577, 1684,
157723 /* 80 */ 1684, 1684, 1684, 1684, 1684, 1684, 1684, 1684, 1684, 1684,
157724 /* 90 */ 1684, 1684, 1684, 1684, 1684, 1684, 1684, 1684, 1684, 1684,
157725 /* 100 */ 1684, 1684, 1684, 1684, 1684, 1684, 1684, 1684, 1684, 1684,
157726 /* 110 */ 1684, 1684, 1684, 1705, 1684, 1684, 1684, 1684, 1684, 1684,
157727 /* 120 */ 1684, 1684, 1684, 1684, 1684, 1684, 1684, 146, 84, 84,
157728 /* 130 */ 84, 84, 84, 362, 269, 125, 97, 453, 66, 66,
157729 /* 140 */ 893, 1090, 66, 66, 533, 533, 66, 554, 554, 554,
157730 /* 150 */ 554, 192, 587, 587, 695, 25, 2020, 2020, 290, 290,
157731 /* 160 */ 290, 200, 514, 514, 514, 514, 939, 939, 442, 875,
157732 /* 170 */ 935, 66, 66, 66, 66, 66, 66, 66, 66, 66,
157733 /* 180 */ 66, 66, 66, 66, 66, 66, 66, 66, 66, 66,
157734 /* 190 */ 66, 601, 601, 66, 729, 878, 878, 1266, 1266, 552,
157735 /* 200 */ 1023, 2020, 2020, 2020, 2020, 2020, 2020, 2020, 307, 490,
157736 /* 210 */ 490, 567, 393, 517, 467, 672, 242, 682, 675, 66,
157737 /* 220 */ 66, 66, 66, 66, 66, 66, 66, 66, 66, 616,
157738 /* 230 */ 66, 66, 66, 66, 66, 66, 66, 66, 66, 66,
157739 /* 240 */ 66, 66, 1093, 1093, 1093, 66, 66, 66, 778, 66,
157740 /* 250 */ 66, 66, 1053, 1064, 66, 66, 1190, 66, 66, 66,
157741 /* 260 */ 66, 66, 66, 66, 66, 722, 992, 718, 253, 253,
157742 /* 270 */ 253, 253, 338, 718, 718, 888, 403, 852, 1328, 254,
157743 /* 280 */ 1295, 721, 1330, 1295, 1330, 1370, 234, 254, 254, 234,
157744 /* 290 */ 254, 721, 1370, 1357, 1492, 1348, 385, 385, 385, 1330,
157745 /* 300 */ 1425, 1425, 643, 1315, 1336, 1004, 1651, 1651, 1581, 1581,
157746 /* 310 */ 1674, 1674, 1581, 1576, 1579, 1716, 1696, 1724, 1724, 1724,
157747 /* 320 */ 1724, 1581, 1732, 1606, 1579, 1579, 1606, 1716, 1696, 1606,
157748 /* 330 */ 1696, 1606, 1581, 1732, 1608, 1706, 1581, 1732, 1750, 1581,
157749 /* 340 */ 1732, 1581, 1732, 1750, 1660, 1660, 1660, 1711, 1766, 1766,
157750 /* 350 */ 1750, 1660, 1664, 1660, 1711, 1660, 1660, 1628, 1769, 1683,
157751 /* 360 */ 1683, 1750, 1653, 1709, 1653, 1709, 1653, 1709, 1653, 1709,
157752 /* 370 */ 1581, 1735, 1735, 1746, 1746, 1682, 1686, 1809, 1581, 1685,
157753 /* 380 */ 1682, 1697, 1699, 1606, 1821, 1825, 1840, 1840, 1864, 1864,
157754 /* 390 */ 1864, 2020, 2020, 2020, 2020, 2020, 2020, 2020, 2020, 2020,
157755 /* 400 */ 2020, 2020, 2020, 2020, 2020, 2020, 599, 223, 1193, 1299,
157756 /* 410 */ 228, 780, 958, 1505, 1153, 1435, 1368, 1426, 1430, 1552,
157757 /* 420 */ 1477, 1556, 1557, 1564, 1572, 1578, 1580, 1489, 1474, 1602,
157758 /* 430 */ 1389, 1514, 1500, 1595, 1596, 1484, 1603, 1075, 1460, 1605,
157759 /* 440 */ 1612, 1526, 1507, 1882, 1884, 1866, 1727, 1875, 1876, 1868,
157760 /* 450 */ 1870, 1757, 1747, 1767, 1872, 1872, 1877, 1758, 1880, 1759,
157761 /* 460 */ 1887, 1903, 1764, 1777, 1872, 1778, 1847, 1873, 1872, 1761,
157762 /* 470 */ 1856, 1862, 1863, 1865, 1788, 1804, 1886, 1781, 1921, 1918,
157763 /* 480 */ 1902, 1811, 1768, 1858, 1901, 1861, 1855, 1890, 1792, 1819,
157764 /* 490 */ 1910, 1915, 1917, 1807, 1814, 1919, 1878, 1920, 1922, 1916,
157765 /* 500 */ 1924, 1881, 1888, 1925, 1844, 1923, 1928, 1885, 1906, 1930,
157766 /* 510 */ 1806, 1933, 1934, 1935, 1936, 1937, 1938, 1940, 1859, 1820,
157767 /* 520 */ 1941, 1942, 1851, 1939, 1945, 1826, 1943, 1944, 1946, 1947,
157768 /* 530 */ 1948, 1883, 1895, 1889, 1932, 1897, 1891, 1949, 1951, 1955,
157769 /* 540 */ 1961, 1953, 1960, 1954, 1964, 1943, 1966, 1967, 1968, 1969,
157770 /* 550 */ 1970, 1971, 1973, 1982, 1975, 1976, 1977, 1978, 1980, 1981,
157771 /* 560 */ 1979, 1874, 1867, 1869, 1871, 1879, 1983, 1984, 2003, 2009,
157772 };
157773 #define YY_REDUCE_COUNT (405)
157774 #define YY_REDUCE_MIN (-265)
157775 #define YY_REDUCE_MAX (1690)
 
157776 static const short yy_reduce_ofst[] = {
157777 /* 0 */ 111, 168, 386, 761, -176, -174, -191, -189, -181, -178,
157778 /* 10 */ 176, 263, 44, -207, -204, -265, -139, -114, 158, 504,
157779 /* 20 */ 525, 544, 612, 614, 650, 652, 765, 265, 703, 705,
157780 /* 30 */ 70, 714, -187, 127, 774, 713, 767, 769, 970, 1019,
157781 /* 40 */ 1021, -255, -255, -255, -255, -255, -255, -255, -255, -255,
157782 /* 50 */ -255, -255, -255, -255, -255, -255, -255, -255, -255, -255,
157783 /* 60 */ -255, -255, -255, -255, -255, -255, -255, -255, -255, -255,
157784 /* 70 */ -255, -255, -255, -255, -255, -255, -255, -255, 394, 542,
157785 /* 80 */ 816, 818, 842, 882, 902, 919, 938, 940, 957, 986,
157786 /* 90 */ 1048, 1063, 1068, 1073, 1076, 1088, 1100, 1102, 1104, 1106,
157787 /* 100 */ 1113, 1119, 1137, 1140, 1143, 1147, 1149, 1164, 1173, 1183,
157788 /* 110 */ 1185, 1188, 1202, 1204, 1247, 1259, 1263, 1283, 1289, 1292,
157789 /* 120 */ 1298, 1300, 1329, 1331, 1343, 1358, 1360, -255, -255, -255,
157790 /* 130 */ -255, -255, -255, -255, -255, 196, -255, 387, -177, 507,
157791 /* 140 */ 1002, -219, 557, -93, -167, 638, -121, 284, 500, 284,
157792 /* 150 */ 500, 247, 651, 865, -255, -255, -255, -255, -85, -85,
157793 /* 160 */ -85, 237, 171, 602, 846, 885, -212, -203, 217, 380,
157794 /* 170 */ 380, -23, 161, 653, 712, 773, 943, 990, 1040, 563,
157795 /* 180 */ 833, 971, 1005, 1042, 1092, 1078, 1043, 1144, 1184, -186,
157796 /* 190 */ 1105, 318, 869, 7, 825, 920, 1074, 704, 706, 390,
157797 /* 200 */ 1087, 1094, 336, 545, 772, 1201, 1117, 1207, -179, -137,
157798 /* 210 */ -112, -13, 18, 112, 197, 418, 495, 508, 777, 809,
157799 /* 220 */ 923, 1014, 1027, 1033, 1044, 1115, 1194, 1212, 1221, 209,
157800 /* 230 */ 1236, 1240, 1256, 1287, 1301, 1307, 1349, 1359, 1398, 1417,
157801 /* 240 */ 1429, 1434, 681, 1377, 1404, 1448, 1449, 1450, 1388, 1453,
157802 /* 250 */ 1455, 1458, 1393, 1335, 1461, 1462, 1418, 1463, 197, 1464,
157803 /* 260 */ 1465, 1466, 1467, 1468, 1469, 1376, 1378, 1424, 1412, 1413,
157804 /* 270 */ 1414, 1415, 1388, 1424, 1424, 1428, 1470, 1485, 1381, 1408,
157805 /* 280 */ 1416, 1436, 1431, 1422, 1432, 1392, 1446, 1411, 1427, 1456,
157806 /* 290 */ 1433, 1471, 1401, 1479, 1472, 1478, 1486, 1491, 1493, 1452,
157807 /* 300 */ 1459, 1473, 1437, 1475, 1476, 1516, 1421, 1440, 1520, 1524,
157808 /* 310 */ 1444, 1445, 1525, 1457, 1480, 1481, 1509, 1510, 1511, 1512,
157809 /* 320 */ 1513, 1553, 1555, 1515, 1487, 1488, 1518, 1495, 1522, 1523,
157810 /* 330 */ 1528, 1527, 1562, 1566, 1482, 1494, 1569, 1574, 1559, 1575,
157811 /* 340 */ 1582, 1583, 1585, 1560, 1568, 1570, 1571, 1563, 1573, 1586,
157812 /* 350 */ 1584, 1588, 1589, 1593, 1590, 1594, 1598, 1501, 1496, 1536,
157813 /* 360 */ 1537, 1599, 1561, 1567, 1587, 1591, 1592, 1597, 1604, 1607,
157814 /* 370 */ 1629, 1519, 1521, 1601, 1609, 1600, 1610, 1558, 1636, 1565,
157815 /* 380 */ 1618, 1621, 1611, 1624, 1648, 1652, 1676, 1677, 1687, 1688,
157816 /* 390 */ 1689, 1613, 1614, 1615, 1668, 1663, 1665, 1666, 1670, 1678,
157817 /* 400 */ 1655, 1662, 1672, 1673, 1675, 1690,
157818 };
157819 static const YYACTIONTYPE yy_default[] = {
157820 /* 0 */ 1623, 1623, 1623, 1453, 1223, 1332, 1223, 1223, 1223, 1453,
157821 /* 10 */ 1453, 1453, 1223, 1362, 1362, 1506, 1254, 1223, 1223, 1223,
157822 /* 20 */ 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1452, 1223, 1223,
157823 /* 30 */ 1223, 1223, 1541, 1541, 1223, 1223, 1223, 1223, 1223, 1223,
157824 /* 40 */ 1223, 1223, 1371, 1223, 1378, 1223, 1223, 1223, 1223, 1223,
157825 /* 50 */ 1454, 1455, 1223, 1223, 1223, 1505, 1507, 1470, 1385, 1384,
157826 /* 60 */ 1383, 1382, 1488, 1349, 1376, 1369, 1373, 1448, 1449, 1447,
157827 /* 70 */ 1451, 1455, 1454, 1223, 1372, 1419, 1433, 1418, 1223, 1223,
157828 /* 80 */ 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223,
157829 /* 90 */ 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223,
157830 /* 100 */ 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223,
157831 /* 110 */ 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223,
157832 /* 120 */ 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1427, 1432, 1438,
157833 /* 130 */ 1431, 1428, 1421, 1420, 1422, 1223, 1423, 1223, 1223, 1223,
157834 /* 140 */ 1244, 1296, 1223, 1223, 1223, 1223, 1223, 1525, 1524, 1223,
157835 /* 150 */ 1223, 1254, 1413, 1412, 1424, 1425, 1435, 1434, 1513, 1576,
157836 /* 160 */ 1575, 1471, 1223, 1223, 1223, 1223, 1223, 1223, 1541, 1223,
157837 /* 170 */ 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223,
157838 /* 180 */ 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223,
157839 /* 190 */ 1223, 1541, 1541, 1223, 1254, 1541, 1541, 1250, 1250, 1356,
157840 /* 200 */ 1223, 1520, 1323, 1323, 1323, 1323, 1332, 1323, 1223, 1223,
157841 /* 210 */ 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223,
157842 /* 220 */ 1223, 1223, 1223, 1510, 1508, 1223, 1223, 1223, 1223, 1223,
157843 /* 230 */ 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223,
157844 /* 240 */ 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223,
157845 /* 250 */ 1223, 1223, 1328, 1223, 1223, 1223, 1223, 1223, 1223, 1223,
157846 /* 260 */ 1223, 1223, 1223, 1223, 1570, 1223, 1483, 1310, 1328, 1328,
157847 /* 270 */ 1328, 1328, 1330, 1311, 1309, 1322, 1255, 1230, 1615, 1388,
157848 /* 280 */ 1377, 1329, 1351, 1377, 1351, 1612, 1375, 1388, 1388, 1375,
157849 /* 290 */ 1388, 1329, 1612, 1271, 1592, 1266, 1362, 1362, 1362, 1351,
157850 /* 300 */ 1356, 1356, 1450, 1329, 1322, 1223, 1615, 1615, 1337, 1337,
157851 /* 310 */ 1614, 1614, 1337, 1471, 1599, 1397, 1299, 1305, 1305, 1305,
157852 /* 320 */ 1305, 1337, 1241, 1375, 1599, 1599, 1375, 1397, 1299, 1375,
157853 /* 330 */ 1299, 1375, 1337, 1241, 1487, 1609, 1337, 1241, 1461, 1337,
157854 /* 340 */ 1241, 1337, 1241, 1461, 1297, 1297, 1297, 1286, 1223, 1223,
157855 /* 350 */ 1461, 1297, 1271, 1297, 1286, 1297, 1297, 1559, 1223, 1465,
157856 /* 360 */ 1465, 1461, 1355, 1350, 1355, 1350, 1355, 1350, 1355, 1350,
157857 /* 370 */ 1337, 1551, 1551, 1365, 1365, 1370, 1356, 1456, 1337, 1223,
157858 /* 380 */ 1370, 1368, 1366, 1375, 1247, 1289, 1573, 1573, 1569, 1569,
157859 /* 390 */ 1569, 1620, 1620, 1520, 1585, 1254, 1254, 1254, 1254, 1585,
157860 /* 400 */ 1273, 1273, 1255, 1255, 1254, 1585, 1223, 1223, 1223, 1223,
157861 /* 410 */ 1223, 1223, 1580, 1223, 1515, 1472, 1341, 1223, 1223, 1223,
157862 /* 420 */ 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223,
157863 /* 430 */ 1223, 1526, 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223,
157864 /* 440 */ 1223, 1223, 1402, 1223, 1226, 1517, 1223, 1223, 1223, 1223,
157865 /* 450 */ 1223, 1223, 1223, 1223, 1379, 1380, 1342, 1223, 1223, 1223,
157866 /* 460 */ 1223, 1223, 1223, 1223, 1394, 1223, 1223, 1223, 1389, 1223,
157867 /* 470 */ 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1611, 1223, 1223,
157868 /* 480 */ 1223, 1223, 1223, 1223, 1486, 1485, 1223, 1223, 1339, 1223,
157869 /* 490 */ 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223,
157870 /* 500 */ 1223, 1223, 1269, 1223, 1223, 1223, 1223, 1223, 1223, 1223,
157871 /* 510 */ 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223,
157872 /* 520 */ 1223, 1223, 1223, 1223, 1223, 1223, 1367, 1223, 1223, 1223,
157873 /* 530 */ 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223,
157874 /* 540 */ 1223, 1556, 1357, 1223, 1223, 1602, 1223, 1223, 1223, 1223,
157875 /* 550 */ 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223,
157876 /* 560 */ 1596, 1313, 1404, 1223, 1403, 1407, 1223, 1235, 1223, 1223,
 
157877 };
157878 /********** End of lemon-generated parsing tables *****************************/
157879
157880 /* The next table maps tokens (terminal symbols) into fallback tokens.
157881 ** If a construct like the following:
@@ -157817,10 +157988,11 @@
157988 59, /* GROUPS => ID */
157989 59, /* OTHERS => ID */
157990 59, /* TIES => ID */
157991 59, /* GENERATED => ID */
157992 59, /* ALWAYS => ID */
157993 59, /* MATERIALIZED => ID */
157994 59, /* REINDEX => ID */
157995 59, /* RENAME => ID */
157996 59, /* CTIME_KW => ID */
157997 0, /* ANY => nothing */
157998 0, /* BITAND => nothing */
@@ -158087,226 +158259,229 @@
158259 /* 92 */ "GROUPS",
158260 /* 93 */ "OTHERS",
158261 /* 94 */ "TIES",
158262 /* 95 */ "GENERATED",
158263 /* 96 */ "ALWAYS",
158264 /* 97 */ "MATERIALIZED",
158265 /* 98 */ "REINDEX",
158266 /* 99 */ "RENAME",
158267 /* 100 */ "CTIME_KW",
158268 /* 101 */ "ANY",
158269 /* 102 */ "BITAND",
158270 /* 103 */ "BITOR",
158271 /* 104 */ "LSHIFT",
158272 /* 105 */ "RSHIFT",
158273 /* 106 */ "PLUS",
158274 /* 107 */ "MINUS",
158275 /* 108 */ "STAR",
158276 /* 109 */ "SLASH",
158277 /* 110 */ "REM",
158278 /* 111 */ "CONCAT",
158279 /* 112 */ "COLLATE",
158280 /* 113 */ "BITNOT",
158281 /* 114 */ "ON",
158282 /* 115 */ "INDEXED",
158283 /* 116 */ "STRING",
158284 /* 117 */ "JOIN_KW",
158285 /* 118 */ "CONSTRAINT",
158286 /* 119 */ "DEFAULT",
158287 /* 120 */ "NULL",
158288 /* 121 */ "PRIMARY",
158289 /* 122 */ "UNIQUE",
158290 /* 123 */ "CHECK",
158291 /* 124 */ "REFERENCES",
158292 /* 125 */ "AUTOINCR",
158293 /* 126 */ "INSERT",
158294 /* 127 */ "DELETE",
158295 /* 128 */ "UPDATE",
158296 /* 129 */ "SET",
158297 /* 130 */ "DEFERRABLE",
158298 /* 131 */ "FOREIGN",
158299 /* 132 */ "DROP",
158300 /* 133 */ "UNION",
158301 /* 134 */ "ALL",
158302 /* 135 */ "EXCEPT",
158303 /* 136 */ "INTERSECT",
158304 /* 137 */ "SELECT",
158305 /* 138 */ "VALUES",
158306 /* 139 */ "DISTINCT",
158307 /* 140 */ "DOT",
158308 /* 141 */ "FROM",
158309 /* 142 */ "JOIN",
158310 /* 143 */ "USING",
158311 /* 144 */ "ORDER",
158312 /* 145 */ "GROUP",
158313 /* 146 */ "HAVING",
158314 /* 147 */ "LIMIT",
158315 /* 148 */ "WHERE",
158316 /* 149 */ "RETURNING",
158317 /* 150 */ "INTO",
158318 /* 151 */ "NOTHING",
158319 /* 152 */ "FLOAT",
158320 /* 153 */ "BLOB",
158321 /* 154 */ "INTEGER",
158322 /* 155 */ "VARIABLE",
158323 /* 156 */ "CASE",
158324 /* 157 */ "WHEN",
158325 /* 158 */ "THEN",
158326 /* 159 */ "ELSE",
158327 /* 160 */ "INDEX",
158328 /* 161 */ "ALTER",
158329 /* 162 */ "ADD",
158330 /* 163 */ "WINDOW",
158331 /* 164 */ "OVER",
158332 /* 165 */ "FILTER",
158333 /* 166 */ "COLUMN",
158334 /* 167 */ "AGG_FUNCTION",
158335 /* 168 */ "AGG_COLUMN",
158336 /* 169 */ "TRUEFALSE",
158337 /* 170 */ "ISNOT",
158338 /* 171 */ "FUNCTION",
158339 /* 172 */ "UMINUS",
158340 /* 173 */ "UPLUS",
158341 /* 174 */ "TRUTH",
158342 /* 175 */ "REGISTER",
158343 /* 176 */ "VECTOR",
158344 /* 177 */ "SELECT_COLUMN",
158345 /* 178 */ "IF_NULL_ROW",
158346 /* 179 */ "ASTERISK",
158347 /* 180 */ "SPAN",
158348 /* 181 */ "SPACE",
158349 /* 182 */ "ILLEGAL",
158350 /* 183 */ "input",
158351 /* 184 */ "cmdlist",
158352 /* 185 */ "ecmd",
158353 /* 186 */ "cmdx",
158354 /* 187 */ "explain",
158355 /* 188 */ "cmd",
158356 /* 189 */ "transtype",
158357 /* 190 */ "trans_opt",
158358 /* 191 */ "nm",
158359 /* 192 */ "savepoint_opt",
158360 /* 193 */ "create_table",
158361 /* 194 */ "create_table_args",
158362 /* 195 */ "createkw",
158363 /* 196 */ "temp",
158364 /* 197 */ "ifnotexists",
158365 /* 198 */ "dbnm",
158366 /* 199 */ "columnlist",
158367 /* 200 */ "conslist_opt",
158368 /* 201 */ "table_options",
158369 /* 202 */ "select",
158370 /* 203 */ "columnname",
158371 /* 204 */ "carglist",
158372 /* 205 */ "typetoken",
158373 /* 206 */ "typename",
158374 /* 207 */ "signed",
158375 /* 208 */ "plus_num",
158376 /* 209 */ "minus_num",
158377 /* 210 */ "scanpt",
158378 /* 211 */ "scantok",
158379 /* 212 */ "ccons",
158380 /* 213 */ "term",
158381 /* 214 */ "expr",
158382 /* 215 */ "onconf",
158383 /* 216 */ "sortorder",
158384 /* 217 */ "autoinc",
158385 /* 218 */ "eidlist_opt",
158386 /* 219 */ "refargs",
158387 /* 220 */ "defer_subclause",
158388 /* 221 */ "generated",
158389 /* 222 */ "refarg",
158390 /* 223 */ "refact",
158391 /* 224 */ "init_deferred_pred_opt",
158392 /* 225 */ "conslist",
158393 /* 226 */ "tconscomma",
158394 /* 227 */ "tcons",
158395 /* 228 */ "sortlist",
158396 /* 229 */ "eidlist",
158397 /* 230 */ "defer_subclause_opt",
158398 /* 231 */ "orconf",
158399 /* 232 */ "resolvetype",
158400 /* 233 */ "raisetype",
158401 /* 234 */ "ifexists",
158402 /* 235 */ "fullname",
158403 /* 236 */ "selectnowith",
158404 /* 237 */ "oneselect",
158405 /* 238 */ "wqlist",
158406 /* 239 */ "multiselect_op",
158407 /* 240 */ "distinct",
158408 /* 241 */ "selcollist",
158409 /* 242 */ "from",
158410 /* 243 */ "where_opt",
158411 /* 244 */ "groupby_opt",
158412 /* 245 */ "having_opt",
158413 /* 246 */ "orderby_opt",
158414 /* 247 */ "limit_opt",
158415 /* 248 */ "window_clause",
158416 /* 249 */ "values",
158417 /* 250 */ "nexprlist",
158418 /* 251 */ "sclp",
158419 /* 252 */ "as",
158420 /* 253 */ "seltablist",
158421 /* 254 */ "stl_prefix",
158422 /* 255 */ "joinop",
158423 /* 256 */ "indexed_opt",
158424 /* 257 */ "on_opt",
158425 /* 258 */ "using_opt",
158426 /* 259 */ "exprlist",
158427 /* 260 */ "xfullname",
158428 /* 261 */ "idlist",
158429 /* 262 */ "nulls",
158430 /* 263 */ "with",
158431 /* 264 */ "where_opt_ret",
158432 /* 265 */ "setlist",
158433 /* 266 */ "insert_cmd",
158434 /* 267 */ "idlist_opt",
158435 /* 268 */ "upsert",
158436 /* 269 */ "returning",
158437 /* 270 */ "filter_over",
158438 /* 271 */ "likeop",
158439 /* 272 */ "between_op",
158440 /* 273 */ "in_op",
158441 /* 274 */ "paren_exprlist",
158442 /* 275 */ "case_operand",
158443 /* 276 */ "case_exprlist",
158444 /* 277 */ "case_else",
158445 /* 278 */ "uniqueflag",
158446 /* 279 */ "collate",
158447 /* 280 */ "vinto",
158448 /* 281 */ "nmnum",
158449 /* 282 */ "trigger_decl",
158450 /* 283 */ "trigger_cmd_list",
158451 /* 284 */ "trigger_time",
158452 /* 285 */ "trigger_event",
158453 /* 286 */ "foreach_clause",
158454 /* 287 */ "when_clause",
158455 /* 288 */ "trigger_cmd",
158456 /* 289 */ "trnm",
158457 /* 290 */ "tridxby",
158458 /* 291 */ "database_kw_opt",
158459 /* 292 */ "key_opt",
158460 /* 293 */ "add_column_fullname",
158461 /* 294 */ "kwcolumn_opt",
158462 /* 295 */ "create_vtab",
158463 /* 296 */ "vtabarglist",
158464 /* 297 */ "vtabarg",
158465 /* 298 */ "vtabargtoken",
158466 /* 299 */ "lp",
158467 /* 300 */ "anylist",
158468 /* 301 */ "wqitem",
158469 /* 302 */ "wqas",
158470 /* 303 */ "windowdefn_list",
158471 /* 304 */ "windowdefn",
158472 /* 305 */ "window",
158473 /* 306 */ "frame_opt",
158474 /* 307 */ "part_opt",
158475 /* 308 */ "filter_clause",
158476 /* 309 */ "over_clause",
158477 /* 310 */ "range_or_rows",
158478 /* 311 */ "frame_bound",
158479 /* 312 */ "frame_bound_s",
158480 /* 313 */ "frame_bound_e",
158481 /* 314 */ "frame_exclude_opt",
158482 /* 315 */ "frame_exclude",
158483 };
158484 #endif /* defined(YYCOVERAGE) || !defined(NDEBUG) */
158485
158486 #ifndef NDEBUG
158487 /* For tracing reduce actions, the names of all rules are required.
@@ -158610,104 +158785,108 @@
158785 /* 295 */ "vtabargtoken ::= ANY",
158786 /* 296 */ "vtabargtoken ::= lp anylist RP",
158787 /* 297 */ "lp ::= LP",
158788 /* 298 */ "with ::= WITH wqlist",
158789 /* 299 */ "with ::= WITH RECURSIVE wqlist",
158790 /* 300 */ "wqas ::= AS",
158791 /* 301 */ "wqas ::= AS MATERIALIZED",
158792 /* 302 */ "wqas ::= AS NOT MATERIALIZED",
158793 /* 303 */ "wqitem ::= nm eidlist_opt wqas LP select RP",
158794 /* 304 */ "wqlist ::= wqitem",
158795 /* 305 */ "wqlist ::= wqlist COMMA wqitem",
158796 /* 306 */ "windowdefn_list ::= windowdefn",
158797 /* 307 */ "windowdefn_list ::= windowdefn_list COMMA windowdefn",
158798 /* 308 */ "windowdefn ::= nm AS LP window RP",
158799 /* 309 */ "window ::= PARTITION BY nexprlist orderby_opt frame_opt",
158800 /* 310 */ "window ::= nm PARTITION BY nexprlist orderby_opt frame_opt",
158801 /* 311 */ "window ::= ORDER BY sortlist frame_opt",
158802 /* 312 */ "window ::= nm ORDER BY sortlist frame_opt",
158803 /* 313 */ "window ::= frame_opt",
158804 /* 314 */ "window ::= nm frame_opt",
158805 /* 315 */ "frame_opt ::=",
158806 /* 316 */ "frame_opt ::= range_or_rows frame_bound_s frame_exclude_opt",
158807 /* 317 */ "frame_opt ::= range_or_rows BETWEEN frame_bound_s AND frame_bound_e frame_exclude_opt",
158808 /* 318 */ "range_or_rows ::= RANGE|ROWS|GROUPS",
158809 /* 319 */ "frame_bound_s ::= frame_bound",
158810 /* 320 */ "frame_bound_s ::= UNBOUNDED PRECEDING",
158811 /* 321 */ "frame_bound_e ::= frame_bound",
158812 /* 322 */ "frame_bound_e ::= UNBOUNDED FOLLOWING",
158813 /* 323 */ "frame_bound ::= expr PRECEDING|FOLLOWING",
158814 /* 324 */ "frame_bound ::= CURRENT ROW",
158815 /* 325 */ "frame_exclude_opt ::=",
158816 /* 326 */ "frame_exclude_opt ::= EXCLUDE frame_exclude",
158817 /* 327 */ "frame_exclude ::= NO OTHERS",
158818 /* 328 */ "frame_exclude ::= CURRENT ROW",
158819 /* 329 */ "frame_exclude ::= GROUP|TIES",
158820 /* 330 */ "window_clause ::= WINDOW windowdefn_list",
158821 /* 331 */ "filter_over ::= filter_clause over_clause",
158822 /* 332 */ "filter_over ::= over_clause",
158823 /* 333 */ "filter_over ::= filter_clause",
158824 /* 334 */ "over_clause ::= OVER LP window RP",
158825 /* 335 */ "over_clause ::= OVER nm",
158826 /* 336 */ "filter_clause ::= FILTER LP WHERE expr RP",
158827 /* 337 */ "input ::= cmdlist",
158828 /* 338 */ "cmdlist ::= cmdlist ecmd",
158829 /* 339 */ "cmdlist ::= ecmd",
158830 /* 340 */ "ecmd ::= SEMI",
158831 /* 341 */ "ecmd ::= cmdx SEMI",
158832 /* 342 */ "ecmd ::= explain cmdx SEMI",
158833 /* 343 */ "trans_opt ::=",
158834 /* 344 */ "trans_opt ::= TRANSACTION",
158835 /* 345 */ "trans_opt ::= TRANSACTION nm",
158836 /* 346 */ "savepoint_opt ::= SAVEPOINT",
158837 /* 347 */ "savepoint_opt ::=",
158838 /* 348 */ "cmd ::= create_table create_table_args",
158839 /* 349 */ "columnlist ::= columnlist COMMA columnname carglist",
158840 /* 350 */ "columnlist ::= columnname carglist",
158841 /* 351 */ "nm ::= ID|INDEXED",
158842 /* 352 */ "nm ::= STRING",
158843 /* 353 */ "nm ::= JOIN_KW",
158844 /* 354 */ "typetoken ::= typename",
158845 /* 355 */ "typename ::= ID|STRING",
158846 /* 356 */ "signed ::= plus_num",
158847 /* 357 */ "signed ::= minus_num",
158848 /* 358 */ "carglist ::= carglist ccons",
158849 /* 359 */ "carglist ::=",
158850 /* 360 */ "ccons ::= NULL onconf",
158851 /* 361 */ "ccons ::= GENERATED ALWAYS AS generated",
158852 /* 362 */ "ccons ::= AS generated",
158853 /* 363 */ "conslist_opt ::= COMMA conslist",
158854 /* 364 */ "conslist ::= conslist tconscomma tcons",
158855 /* 365 */ "conslist ::= tcons",
158856 /* 366 */ "tconscomma ::=",
158857 /* 367 */ "defer_subclause_opt ::= defer_subclause",
158858 /* 368 */ "resolvetype ::= raisetype",
158859 /* 369 */ "selectnowith ::= oneselect",
158860 /* 370 */ "oneselect ::= values",
158861 /* 371 */ "sclp ::= selcollist COMMA",
158862 /* 372 */ "as ::= ID|STRING",
158863 /* 373 */ "returning ::=",
158864 /* 374 */ "expr ::= term",
158865 /* 375 */ "likeop ::= LIKE_KW|MATCH",
158866 /* 376 */ "exprlist ::= nexprlist",
158867 /* 377 */ "nmnum ::= plus_num",
158868 /* 378 */ "nmnum ::= nm",
158869 /* 379 */ "nmnum ::= ON",
158870 /* 380 */ "nmnum ::= DELETE",
158871 /* 381 */ "nmnum ::= DEFAULT",
158872 /* 382 */ "plus_num ::= INTEGER|FLOAT",
158873 /* 383 */ "foreach_clause ::=",
158874 /* 384 */ "foreach_clause ::= FOR EACH ROW",
158875 /* 385 */ "trnm ::= nm",
158876 /* 386 */ "tridxby ::=",
158877 /* 387 */ "database_kw_opt ::= DATABASE",
158878 /* 388 */ "database_kw_opt ::=",
158879 /* 389 */ "kwcolumn_opt ::=",
158880 /* 390 */ "kwcolumn_opt ::= COLUMNKW",
158881 /* 391 */ "vtabarglist ::= vtabarg",
158882 /* 392 */ "vtabarglist ::= vtabarglist COMMA vtabarg",
158883 /* 393 */ "vtabarg ::= vtabarg vtabargtoken",
158884 /* 394 */ "anylist ::=",
158885 /* 395 */ "anylist ::= anylist LP anylist RP",
158886 /* 396 */ "anylist ::= anylist ANY",
158887 /* 397 */ "with ::=",
158888 };
158889 #endif /* NDEBUG */
158890
158891
158892 #if YYSTACKDEPTH<=0
@@ -158829,103 +159008,103 @@
159008 ** Note: during a reduce, the only symbols destroyed are those
159009 ** which appear on the RHS of the rule, but which are *not* used
159010 ** inside the C code.
159011 */
159012 /********* Begin destructor definitions ***************************************/
159013 case 202: /* select */
159014 case 236: /* selectnowith */
159015 case 237: /* oneselect */
159016 case 249: /* values */
159017 {
159018 sqlite3SelectDelete(pParse->db, (yypminor->yy307));
159019 }
159020 break;
159021 case 213: /* term */
159022 case 214: /* expr */
159023 case 243: /* where_opt */
159024 case 245: /* having_opt */
159025 case 257: /* on_opt */
159026 case 264: /* where_opt_ret */
159027 case 275: /* case_operand */
159028 case 277: /* case_else */
159029 case 280: /* vinto */
159030 case 287: /* when_clause */
159031 case 292: /* key_opt */
159032 case 308: /* filter_clause */
159033 {
159034 sqlite3ExprDelete(pParse->db, (yypminor->yy602));
159035 }
159036 break;
159037 case 218: /* eidlist_opt */
159038 case 228: /* sortlist */
159039 case 229: /* eidlist */
159040 case 241: /* selcollist */
159041 case 244: /* groupby_opt */
159042 case 246: /* orderby_opt */
159043 case 250: /* nexprlist */
159044 case 251: /* sclp */
159045 case 259: /* exprlist */
159046 case 265: /* setlist */
159047 case 274: /* paren_exprlist */
159048 case 276: /* case_exprlist */
159049 case 307: /* part_opt */
159050 {
159051 sqlite3ExprListDelete(pParse->db, (yypminor->yy338));
159052 }
159053 break;
159054 case 235: /* fullname */
159055 case 242: /* from */
159056 case 253: /* seltablist */
159057 case 254: /* stl_prefix */
159058 case 260: /* xfullname */
159059 {
159060 sqlite3SrcListDelete(pParse->db, (yypminor->yy291));
159061 }
159062 break;
159063 case 238: /* wqlist */
159064 {
159065 sqlite3WithDelete(pParse->db, (yypminor->yy195));
159066 }
159067 break;
159068 case 248: /* window_clause */
159069 case 303: /* windowdefn_list */
159070 {
159071 sqlite3WindowListDelete(pParse->db, (yypminor->yy19));
159072 }
159073 break;
159074 case 258: /* using_opt */
159075 case 261: /* idlist */
159076 case 267: /* idlist_opt */
159077 {
159078 sqlite3IdListDelete(pParse->db, (yypminor->yy288));
159079 }
159080 break;
159081 case 270: /* filter_over */
159082 case 304: /* windowdefn */
159083 case 305: /* window */
159084 case 306: /* frame_opt */
159085 case 309: /* over_clause */
159086 {
159087 sqlite3WindowDelete(pParse->db, (yypminor->yy19));
159088 }
159089 break;
159090 case 283: /* trigger_cmd_list */
159091 case 288: /* trigger_cmd */
159092 {
159093 sqlite3DeleteTriggerStep(pParse->db, (yypminor->yy483));
159094 }
159095 break;
159096 case 285: /* trigger_event */
159097 {
159098 sqlite3IdListDelete(pParse->db, (yypminor->yy50).b);
159099 }
159100 break;
159101 case 311: /* frame_bound */
159102 case 312: /* frame_bound_s */
159103 case 313: /* frame_bound_e */
159104 {
159105 sqlite3ExprDelete(pParse->db, (yypminor->yy113).pExpr);
159106 }
159107 break;
159108 /********* End destructor definitions *****************************************/
159109 default: break; /* If no destructor action specified: do nothing */
159110 }
@@ -159212,404 +159391,408 @@
159391 }
159392
159393 /* For rule J, yyRuleInfoLhs[J] contains the symbol on the left-hand side
159394 ** of that rule */
159395 static const YYCODETYPE yyRuleInfoLhs[] = {
159396 187, /* (0) explain ::= EXPLAIN */
159397 187, /* (1) explain ::= EXPLAIN QUERY PLAN */
159398 186, /* (2) cmdx ::= cmd */
159399 188, /* (3) cmd ::= BEGIN transtype trans_opt */
159400 189, /* (4) transtype ::= */
159401 189, /* (5) transtype ::= DEFERRED */
159402 189, /* (6) transtype ::= IMMEDIATE */
159403 189, /* (7) transtype ::= EXCLUSIVE */
159404 188, /* (8) cmd ::= COMMIT|END trans_opt */
159405 188, /* (9) cmd ::= ROLLBACK trans_opt */
159406 188, /* (10) cmd ::= SAVEPOINT nm */
159407 188, /* (11) cmd ::= RELEASE savepoint_opt nm */
159408 188, /* (12) cmd ::= ROLLBACK trans_opt TO savepoint_opt nm */
159409 193, /* (13) create_table ::= createkw temp TABLE ifnotexists nm dbnm */
159410 195, /* (14) createkw ::= CREATE */
159411 197, /* (15) ifnotexists ::= */
159412 197, /* (16) ifnotexists ::= IF NOT EXISTS */
159413 196, /* (17) temp ::= TEMP */
159414 196, /* (18) temp ::= */
159415 194, /* (19) create_table_args ::= LP columnlist conslist_opt RP table_options */
159416 194, /* (20) create_table_args ::= AS select */
159417 201, /* (21) table_options ::= */
159418 201, /* (22) table_options ::= WITHOUT nm */
159419 203, /* (23) columnname ::= nm typetoken */
159420 205, /* (24) typetoken ::= */
159421 205, /* (25) typetoken ::= typename LP signed RP */
159422 205, /* (26) typetoken ::= typename LP signed COMMA signed RP */
159423 206, /* (27) typename ::= typename ID|STRING */
159424 210, /* (28) scanpt ::= */
159425 211, /* (29) scantok ::= */
159426 212, /* (30) ccons ::= CONSTRAINT nm */
159427 212, /* (31) ccons ::= DEFAULT scantok term */
159428 212, /* (32) ccons ::= DEFAULT LP expr RP */
159429 212, /* (33) ccons ::= DEFAULT PLUS scantok term */
159430 212, /* (34) ccons ::= DEFAULT MINUS scantok term */
159431 212, /* (35) ccons ::= DEFAULT scantok ID|INDEXED */
159432 212, /* (36) ccons ::= NOT NULL onconf */
159433 212, /* (37) ccons ::= PRIMARY KEY sortorder onconf autoinc */
159434 212, /* (38) ccons ::= UNIQUE onconf */
159435 212, /* (39) ccons ::= CHECK LP expr RP */
159436 212, /* (40) ccons ::= REFERENCES nm eidlist_opt refargs */
159437 212, /* (41) ccons ::= defer_subclause */
159438 212, /* (42) ccons ::= COLLATE ID|STRING */
159439 221, /* (43) generated ::= LP expr RP */
159440 221, /* (44) generated ::= LP expr RP ID */
159441 217, /* (45) autoinc ::= */
159442 217, /* (46) autoinc ::= AUTOINCR */
159443 219, /* (47) refargs ::= */
159444 219, /* (48) refargs ::= refargs refarg */
159445 222, /* (49) refarg ::= MATCH nm */
159446 222, /* (50) refarg ::= ON INSERT refact */
159447 222, /* (51) refarg ::= ON DELETE refact */
159448 222, /* (52) refarg ::= ON UPDATE refact */
159449 223, /* (53) refact ::= SET NULL */
159450 223, /* (54) refact ::= SET DEFAULT */
159451 223, /* (55) refact ::= CASCADE */
159452 223, /* (56) refact ::= RESTRICT */
159453 223, /* (57) refact ::= NO ACTION */
159454 220, /* (58) defer_subclause ::= NOT DEFERRABLE init_deferred_pred_opt */
159455 220, /* (59) defer_subclause ::= DEFERRABLE init_deferred_pred_opt */
159456 224, /* (60) init_deferred_pred_opt ::= */
159457 224, /* (61) init_deferred_pred_opt ::= INITIALLY DEFERRED */
159458 224, /* (62) init_deferred_pred_opt ::= INITIALLY IMMEDIATE */
159459 200, /* (63) conslist_opt ::= */
159460 226, /* (64) tconscomma ::= COMMA */
159461 227, /* (65) tcons ::= CONSTRAINT nm */
159462 227, /* (66) tcons ::= PRIMARY KEY LP sortlist autoinc RP onconf */
159463 227, /* (67) tcons ::= UNIQUE LP sortlist RP onconf */
159464 227, /* (68) tcons ::= CHECK LP expr RP onconf */
159465 227, /* (69) tcons ::= FOREIGN KEY LP eidlist RP REFERENCES nm eidlist_opt refargs defer_subclause_opt */
159466 230, /* (70) defer_subclause_opt ::= */
159467 215, /* (71) onconf ::= */
159468 215, /* (72) onconf ::= ON CONFLICT resolvetype */
159469 231, /* (73) orconf ::= */
159470 231, /* (74) orconf ::= OR resolvetype */
159471 232, /* (75) resolvetype ::= IGNORE */
159472 232, /* (76) resolvetype ::= REPLACE */
159473 188, /* (77) cmd ::= DROP TABLE ifexists fullname */
159474 234, /* (78) ifexists ::= IF EXISTS */
159475 234, /* (79) ifexists ::= */
159476 188, /* (80) cmd ::= createkw temp VIEW ifnotexists nm dbnm eidlist_opt AS select */
159477 188, /* (81) cmd ::= DROP VIEW ifexists fullname */
159478 188, /* (82) cmd ::= select */
159479 202, /* (83) select ::= WITH wqlist selectnowith */
159480 202, /* (84) select ::= WITH RECURSIVE wqlist selectnowith */
159481 202, /* (85) select ::= selectnowith */
159482 236, /* (86) selectnowith ::= selectnowith multiselect_op oneselect */
159483 239, /* (87) multiselect_op ::= UNION */
159484 239, /* (88) multiselect_op ::= UNION ALL */
159485 239, /* (89) multiselect_op ::= EXCEPT|INTERSECT */
159486 237, /* (90) oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt orderby_opt limit_opt */
159487 237, /* (91) oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt window_clause orderby_opt limit_opt */
159488 249, /* (92) values ::= VALUES LP nexprlist RP */
159489 249, /* (93) values ::= values COMMA LP nexprlist RP */
159490 240, /* (94) distinct ::= DISTINCT */
159491 240, /* (95) distinct ::= ALL */
159492 240, /* (96) distinct ::= */
159493 251, /* (97) sclp ::= */
159494 241, /* (98) selcollist ::= sclp scanpt expr scanpt as */
159495 241, /* (99) selcollist ::= sclp scanpt STAR */
159496 241, /* (100) selcollist ::= sclp scanpt nm DOT STAR */
159497 252, /* (101) as ::= AS nm */
159498 252, /* (102) as ::= */
159499 242, /* (103) from ::= */
159500 242, /* (104) from ::= FROM seltablist */
159501 254, /* (105) stl_prefix ::= seltablist joinop */
159502 254, /* (106) stl_prefix ::= */
159503 253, /* (107) seltablist ::= stl_prefix nm dbnm as indexed_opt on_opt using_opt */
159504 253, /* (108) seltablist ::= stl_prefix nm dbnm LP exprlist RP as on_opt using_opt */
159505 253, /* (109) seltablist ::= stl_prefix LP select RP as on_opt using_opt */
159506 253, /* (110) seltablist ::= stl_prefix LP seltablist RP as on_opt using_opt */
159507 198, /* (111) dbnm ::= */
159508 198, /* (112) dbnm ::= DOT nm */
159509 235, /* (113) fullname ::= nm */
159510 235, /* (114) fullname ::= nm DOT nm */
159511 260, /* (115) xfullname ::= nm */
159512 260, /* (116) xfullname ::= nm DOT nm */
159513 260, /* (117) xfullname ::= nm DOT nm AS nm */
159514 260, /* (118) xfullname ::= nm AS nm */
159515 255, /* (119) joinop ::= COMMA|JOIN */
159516 255, /* (120) joinop ::= JOIN_KW JOIN */
159517 255, /* (121) joinop ::= JOIN_KW nm JOIN */
159518 255, /* (122) joinop ::= JOIN_KW nm nm JOIN */
159519 257, /* (123) on_opt ::= ON expr */
159520 257, /* (124) on_opt ::= */
159521 256, /* (125) indexed_opt ::= */
159522 256, /* (126) indexed_opt ::= INDEXED BY nm */
159523 256, /* (127) indexed_opt ::= NOT INDEXED */
159524 258, /* (128) using_opt ::= USING LP idlist RP */
159525 258, /* (129) using_opt ::= */
159526 246, /* (130) orderby_opt ::= */
159527 246, /* (131) orderby_opt ::= ORDER BY sortlist */
159528 228, /* (132) sortlist ::= sortlist COMMA expr sortorder nulls */
159529 228, /* (133) sortlist ::= expr sortorder nulls */
159530 216, /* (134) sortorder ::= ASC */
159531 216, /* (135) sortorder ::= DESC */
159532 216, /* (136) sortorder ::= */
159533 262, /* (137) nulls ::= NULLS FIRST */
159534 262, /* (138) nulls ::= NULLS LAST */
159535 262, /* (139) nulls ::= */
159536 244, /* (140) groupby_opt ::= */
159537 244, /* (141) groupby_opt ::= GROUP BY nexprlist */
159538 245, /* (142) having_opt ::= */
159539 245, /* (143) having_opt ::= HAVING expr */
159540 247, /* (144) limit_opt ::= */
159541 247, /* (145) limit_opt ::= LIMIT expr */
159542 247, /* (146) limit_opt ::= LIMIT expr OFFSET expr */
159543 247, /* (147) limit_opt ::= LIMIT expr COMMA expr */
159544 188, /* (148) cmd ::= with DELETE FROM xfullname indexed_opt where_opt_ret */
159545 243, /* (149) where_opt ::= */
159546 243, /* (150) where_opt ::= WHERE expr */
159547 264, /* (151) where_opt_ret ::= */
159548 264, /* (152) where_opt_ret ::= WHERE expr */
159549 264, /* (153) where_opt_ret ::= RETURNING selcollist */
159550 264, /* (154) where_opt_ret ::= WHERE expr RETURNING selcollist */
159551 188, /* (155) cmd ::= with UPDATE orconf xfullname indexed_opt SET setlist from where_opt_ret */
159552 265, /* (156) setlist ::= setlist COMMA nm EQ expr */
159553 265, /* (157) setlist ::= setlist COMMA LP idlist RP EQ expr */
159554 265, /* (158) setlist ::= nm EQ expr */
159555 265, /* (159) setlist ::= LP idlist RP EQ expr */
159556 188, /* (160) cmd ::= with insert_cmd INTO xfullname idlist_opt select upsert */
159557 188, /* (161) cmd ::= with insert_cmd INTO xfullname idlist_opt DEFAULT VALUES returning */
159558 268, /* (162) upsert ::= */
159559 268, /* (163) upsert ::= RETURNING selcollist */
159560 268, /* (164) upsert ::= ON CONFLICT LP sortlist RP where_opt DO UPDATE SET setlist where_opt upsert */
159561 268, /* (165) upsert ::= ON CONFLICT LP sortlist RP where_opt DO NOTHING upsert */
159562 268, /* (166) upsert ::= ON CONFLICT DO NOTHING returning */
159563 268, /* (167) upsert ::= ON CONFLICT DO UPDATE SET setlist where_opt returning */
159564 269, /* (168) returning ::= RETURNING selcollist */
159565 266, /* (169) insert_cmd ::= INSERT orconf */
159566 266, /* (170) insert_cmd ::= REPLACE */
159567 267, /* (171) idlist_opt ::= */
159568 267, /* (172) idlist_opt ::= LP idlist RP */
159569 261, /* (173) idlist ::= idlist COMMA nm */
159570 261, /* (174) idlist ::= nm */
159571 214, /* (175) expr ::= LP expr RP */
159572 214, /* (176) expr ::= ID|INDEXED */
159573 214, /* (177) expr ::= JOIN_KW */
159574 214, /* (178) expr ::= nm DOT nm */
159575 214, /* (179) expr ::= nm DOT nm DOT nm */
159576 213, /* (180) term ::= NULL|FLOAT|BLOB */
159577 213, /* (181) term ::= STRING */
159578 213, /* (182) term ::= INTEGER */
159579 214, /* (183) expr ::= VARIABLE */
159580 214, /* (184) expr ::= expr COLLATE ID|STRING */
159581 214, /* (185) expr ::= CAST LP expr AS typetoken RP */
159582 214, /* (186) expr ::= ID|INDEXED LP distinct exprlist RP */
159583 214, /* (187) expr ::= ID|INDEXED LP STAR RP */
159584 214, /* (188) expr ::= ID|INDEXED LP distinct exprlist RP filter_over */
159585 214, /* (189) expr ::= ID|INDEXED LP STAR RP filter_over */
159586 213, /* (190) term ::= CTIME_KW */
159587 214, /* (191) expr ::= LP nexprlist COMMA expr RP */
159588 214, /* (192) expr ::= expr AND expr */
159589 214, /* (193) expr ::= expr OR expr */
159590 214, /* (194) expr ::= expr LT|GT|GE|LE expr */
159591 214, /* (195) expr ::= expr EQ|NE expr */
159592 214, /* (196) expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr */
159593 214, /* (197) expr ::= expr PLUS|MINUS expr */
159594 214, /* (198) expr ::= expr STAR|SLASH|REM expr */
159595 214, /* (199) expr ::= expr CONCAT expr */
159596 271, /* (200) likeop ::= NOT LIKE_KW|MATCH */
159597 214, /* (201) expr ::= expr likeop expr */
159598 214, /* (202) expr ::= expr likeop expr ESCAPE expr */
159599 214, /* (203) expr ::= expr ISNULL|NOTNULL */
159600 214, /* (204) expr ::= expr NOT NULL */
159601 214, /* (205) expr ::= expr IS expr */
159602 214, /* (206) expr ::= expr IS NOT expr */
159603 214, /* (207) expr ::= NOT expr */
159604 214, /* (208) expr ::= BITNOT expr */
159605 214, /* (209) expr ::= PLUS|MINUS expr */
159606 272, /* (210) between_op ::= BETWEEN */
159607 272, /* (211) between_op ::= NOT BETWEEN */
159608 214, /* (212) expr ::= expr between_op expr AND expr */
159609 273, /* (213) in_op ::= IN */
159610 273, /* (214) in_op ::= NOT IN */
159611 214, /* (215) expr ::= expr in_op LP exprlist RP */
159612 214, /* (216) expr ::= LP select RP */
159613 214, /* (217) expr ::= expr in_op LP select RP */
159614 214, /* (218) expr ::= expr in_op nm dbnm paren_exprlist */
159615 214, /* (219) expr ::= EXISTS LP select RP */
159616 214, /* (220) expr ::= CASE case_operand case_exprlist case_else END */
159617 276, /* (221) case_exprlist ::= case_exprlist WHEN expr THEN expr */
159618 276, /* (222) case_exprlist ::= WHEN expr THEN expr */
159619 277, /* (223) case_else ::= ELSE expr */
159620 277, /* (224) case_else ::= */
159621 275, /* (225) case_operand ::= expr */
159622 275, /* (226) case_operand ::= */
159623 259, /* (227) exprlist ::= */
159624 250, /* (228) nexprlist ::= nexprlist COMMA expr */
159625 250, /* (229) nexprlist ::= expr */
159626 274, /* (230) paren_exprlist ::= */
159627 274, /* (231) paren_exprlist ::= LP exprlist RP */
159628 188, /* (232) cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP sortlist RP where_opt */
159629 278, /* (233) uniqueflag ::= UNIQUE */
159630 278, /* (234) uniqueflag ::= */
159631 218, /* (235) eidlist_opt ::= */
159632 218, /* (236) eidlist_opt ::= LP eidlist RP */
159633 229, /* (237) eidlist ::= eidlist COMMA nm collate sortorder */
159634 229, /* (238) eidlist ::= nm collate sortorder */
159635 279, /* (239) collate ::= */
159636 279, /* (240) collate ::= COLLATE ID|STRING */
159637 188, /* (241) cmd ::= DROP INDEX ifexists fullname */
159638 188, /* (242) cmd ::= VACUUM vinto */
159639 188, /* (243) cmd ::= VACUUM nm vinto */
159640 280, /* (244) vinto ::= INTO expr */
159641 280, /* (245) vinto ::= */
159642 188, /* (246) cmd ::= PRAGMA nm dbnm */
159643 188, /* (247) cmd ::= PRAGMA nm dbnm EQ nmnum */
159644 188, /* (248) cmd ::= PRAGMA nm dbnm LP nmnum RP */
159645 188, /* (249) cmd ::= PRAGMA nm dbnm EQ minus_num */
159646 188, /* (250) cmd ::= PRAGMA nm dbnm LP minus_num RP */
159647 208, /* (251) plus_num ::= PLUS INTEGER|FLOAT */
159648 209, /* (252) minus_num ::= MINUS INTEGER|FLOAT */
159649 188, /* (253) cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END */
159650 282, /* (254) trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause */
159651 284, /* (255) trigger_time ::= BEFORE|AFTER */
159652 284, /* (256) trigger_time ::= INSTEAD OF */
159653 284, /* (257) trigger_time ::= */
159654 285, /* (258) trigger_event ::= DELETE|INSERT */
159655 285, /* (259) trigger_event ::= UPDATE */
159656 285, /* (260) trigger_event ::= UPDATE OF idlist */
159657 287, /* (261) when_clause ::= */
159658 287, /* (262) when_clause ::= WHEN expr */
159659 283, /* (263) trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI */
159660 283, /* (264) trigger_cmd_list ::= trigger_cmd SEMI */
159661 289, /* (265) trnm ::= nm DOT nm */
159662 290, /* (266) tridxby ::= INDEXED BY nm */
159663 290, /* (267) tridxby ::= NOT INDEXED */
159664 288, /* (268) trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist from where_opt scanpt */
159665 288, /* (269) trigger_cmd ::= scanpt insert_cmd INTO trnm idlist_opt select upsert scanpt */
159666 288, /* (270) trigger_cmd ::= DELETE FROM trnm tridxby where_opt scanpt */
159667 288, /* (271) trigger_cmd ::= scanpt select scanpt */
159668 214, /* (272) expr ::= RAISE LP IGNORE RP */
159669 214, /* (273) expr ::= RAISE LP raisetype COMMA nm RP */
159670 233, /* (274) raisetype ::= ROLLBACK */
159671 233, /* (275) raisetype ::= ABORT */
159672 233, /* (276) raisetype ::= FAIL */
159673 188, /* (277) cmd ::= DROP TRIGGER ifexists fullname */
159674 188, /* (278) cmd ::= ATTACH database_kw_opt expr AS expr key_opt */
159675 188, /* (279) cmd ::= DETACH database_kw_opt expr */
159676 292, /* (280) key_opt ::= */
159677 292, /* (281) key_opt ::= KEY expr */
159678 188, /* (282) cmd ::= REINDEX */
159679 188, /* (283) cmd ::= REINDEX nm dbnm */
159680 188, /* (284) cmd ::= ANALYZE */
159681 188, /* (285) cmd ::= ANALYZE nm dbnm */
159682 188, /* (286) cmd ::= ALTER TABLE fullname RENAME TO nm */
159683 188, /* (287) cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt columnname carglist */
159684 188, /* (288) cmd ::= ALTER TABLE fullname DROP kwcolumn_opt nm */
159685 293, /* (289) add_column_fullname ::= fullname */
159686 188, /* (290) cmd ::= ALTER TABLE fullname RENAME kwcolumn_opt nm TO nm */
159687 188, /* (291) cmd ::= create_vtab */
159688 188, /* (292) cmd ::= create_vtab LP vtabarglist RP */
159689 295, /* (293) create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm */
159690 297, /* (294) vtabarg ::= */
159691 298, /* (295) vtabargtoken ::= ANY */
159692 298, /* (296) vtabargtoken ::= lp anylist RP */
159693 299, /* (297) lp ::= LP */
159694 263, /* (298) with ::= WITH wqlist */
159695 263, /* (299) with ::= WITH RECURSIVE wqlist */
159696 302, /* (300) wqas ::= AS */
159697 302, /* (301) wqas ::= AS MATERIALIZED */
159698 302, /* (302) wqas ::= AS NOT MATERIALIZED */
159699 301, /* (303) wqitem ::= nm eidlist_opt wqas LP select RP */
159700 238, /* (304) wqlist ::= wqitem */
159701 238, /* (305) wqlist ::= wqlist COMMA wqitem */
159702 303, /* (306) windowdefn_list ::= windowdefn */
159703 303, /* (307) windowdefn_list ::= windowdefn_list COMMA windowdefn */
159704 304, /* (308) windowdefn ::= nm AS LP window RP */
159705 305, /* (309) window ::= PARTITION BY nexprlist orderby_opt frame_opt */
159706 305, /* (310) window ::= nm PARTITION BY nexprlist orderby_opt frame_opt */
159707 305, /* (311) window ::= ORDER BY sortlist frame_opt */
159708 305, /* (312) window ::= nm ORDER BY sortlist frame_opt */
159709 305, /* (313) window ::= frame_opt */
159710 305, /* (314) window ::= nm frame_opt */
159711 306, /* (315) frame_opt ::= */
159712 306, /* (316) frame_opt ::= range_or_rows frame_bound_s frame_exclude_opt */
159713 306, /* (317) frame_opt ::= range_or_rows BETWEEN frame_bound_s AND frame_bound_e frame_exclude_opt */
159714 310, /* (318) range_or_rows ::= RANGE|ROWS|GROUPS */
159715 312, /* (319) frame_bound_s ::= frame_bound */
159716 312, /* (320) frame_bound_s ::= UNBOUNDED PRECEDING */
159717 313, /* (321) frame_bound_e ::= frame_bound */
159718 313, /* (322) frame_bound_e ::= UNBOUNDED FOLLOWING */
159719 311, /* (323) frame_bound ::= expr PRECEDING|FOLLOWING */
159720 311, /* (324) frame_bound ::= CURRENT ROW */
159721 314, /* (325) frame_exclude_opt ::= */
159722 314, /* (326) frame_exclude_opt ::= EXCLUDE frame_exclude */
159723 315, /* (327) frame_exclude ::= NO OTHERS */
159724 315, /* (328) frame_exclude ::= CURRENT ROW */
159725 315, /* (329) frame_exclude ::= GROUP|TIES */
159726 248, /* (330) window_clause ::= WINDOW windowdefn_list */
159727 270, /* (331) filter_over ::= filter_clause over_clause */
159728 270, /* (332) filter_over ::= over_clause */
159729 270, /* (333) filter_over ::= filter_clause */
159730 309, /* (334) over_clause ::= OVER LP window RP */
159731 309, /* (335) over_clause ::= OVER nm */
159732 308, /* (336) filter_clause ::= FILTER LP WHERE expr RP */
159733 183, /* (337) input ::= cmdlist */
159734 184, /* (338) cmdlist ::= cmdlist ecmd */
159735 184, /* (339) cmdlist ::= ecmd */
159736 185, /* (340) ecmd ::= SEMI */
159737 185, /* (341) ecmd ::= cmdx SEMI */
159738 185, /* (342) ecmd ::= explain cmdx SEMI */
159739 190, /* (343) trans_opt ::= */
159740 190, /* (344) trans_opt ::= TRANSACTION */
159741 190, /* (345) trans_opt ::= TRANSACTION nm */
159742 192, /* (346) savepoint_opt ::= SAVEPOINT */
159743 192, /* (347) savepoint_opt ::= */
159744 188, /* (348) cmd ::= create_table create_table_args */
159745 199, /* (349) columnlist ::= columnlist COMMA columnname carglist */
159746 199, /* (350) columnlist ::= columnname carglist */
159747 191, /* (351) nm ::= ID|INDEXED */
159748 191, /* (352) nm ::= STRING */
159749 191, /* (353) nm ::= JOIN_KW */
159750 205, /* (354) typetoken ::= typename */
159751 206, /* (355) typename ::= ID|STRING */
159752 207, /* (356) signed ::= plus_num */
159753 207, /* (357) signed ::= minus_num */
159754 204, /* (358) carglist ::= carglist ccons */
159755 204, /* (359) carglist ::= */
159756 212, /* (360) ccons ::= NULL onconf */
159757 212, /* (361) ccons ::= GENERATED ALWAYS AS generated */
159758 212, /* (362) ccons ::= AS generated */
159759 200, /* (363) conslist_opt ::= COMMA conslist */
159760 225, /* (364) conslist ::= conslist tconscomma tcons */
159761 225, /* (365) conslist ::= tcons */
159762 226, /* (366) tconscomma ::= */
159763 230, /* (367) defer_subclause_opt ::= defer_subclause */
159764 232, /* (368) resolvetype ::= raisetype */
159765 236, /* (369) selectnowith ::= oneselect */
159766 237, /* (370) oneselect ::= values */
159767 251, /* (371) sclp ::= selcollist COMMA */
159768 252, /* (372) as ::= ID|STRING */
159769 269, /* (373) returning ::= */
159770 214, /* (374) expr ::= term */
159771 271, /* (375) likeop ::= LIKE_KW|MATCH */
159772 259, /* (376) exprlist ::= nexprlist */
159773 281, /* (377) nmnum ::= plus_num */
159774 281, /* (378) nmnum ::= nm */
159775 281, /* (379) nmnum ::= ON */
159776 281, /* (380) nmnum ::= DELETE */
159777 281, /* (381) nmnum ::= DEFAULT */
159778 208, /* (382) plus_num ::= INTEGER|FLOAT */
159779 286, /* (383) foreach_clause ::= */
159780 286, /* (384) foreach_clause ::= FOR EACH ROW */
159781 289, /* (385) trnm ::= nm */
159782 290, /* (386) tridxby ::= */
159783 291, /* (387) database_kw_opt ::= DATABASE */
159784 291, /* (388) database_kw_opt ::= */
159785 294, /* (389) kwcolumn_opt ::= */
159786 294, /* (390) kwcolumn_opt ::= COLUMNKW */
159787 296, /* (391) vtabarglist ::= vtabarg */
159788 296, /* (392) vtabarglist ::= vtabarglist COMMA vtabarg */
159789 297, /* (393) vtabarg ::= vtabarg vtabargtoken */
159790 300, /* (394) anylist ::= */
159791 300, /* (395) anylist ::= anylist LP anylist RP */
159792 300, /* (396) anylist ::= anylist ANY */
159793 263, /* (397) with ::= */
159794 };
159795
159796 /* For rule J, yyRuleInfoNRhs[J] contains the negative of the number
159797 ** of symbols on the right-hand side of that rule. */
159798 static const signed char yyRuleInfoNRhs[] = {
@@ -159911,104 +160094,108 @@
160094 -1, /* (295) vtabargtoken ::= ANY */
160095 -3, /* (296) vtabargtoken ::= lp anylist RP */
160096 -1, /* (297) lp ::= LP */
160097 -2, /* (298) with ::= WITH wqlist */
160098 -3, /* (299) with ::= WITH RECURSIVE wqlist */
160099 -1, /* (300) wqas ::= AS */
160100 -2, /* (301) wqas ::= AS MATERIALIZED */
160101 -3, /* (302) wqas ::= AS NOT MATERIALIZED */
160102 -6, /* (303) wqitem ::= nm eidlist_opt wqas LP select RP */
160103 -1, /* (304) wqlist ::= wqitem */
160104 -3, /* (305) wqlist ::= wqlist COMMA wqitem */
160105 -1, /* (306) windowdefn_list ::= windowdefn */
160106 -3, /* (307) windowdefn_list ::= windowdefn_list COMMA windowdefn */
160107 -5, /* (308) windowdefn ::= nm AS LP window RP */
160108 -5, /* (309) window ::= PARTITION BY nexprlist orderby_opt frame_opt */
160109 -6, /* (310) window ::= nm PARTITION BY nexprlist orderby_opt frame_opt */
160110 -4, /* (311) window ::= ORDER BY sortlist frame_opt */
160111 -5, /* (312) window ::= nm ORDER BY sortlist frame_opt */
160112 -1, /* (313) window ::= frame_opt */
160113 -2, /* (314) window ::= nm frame_opt */
160114 0, /* (315) frame_opt ::= */
160115 -3, /* (316) frame_opt ::= range_or_rows frame_bound_s frame_exclude_opt */
160116 -6, /* (317) frame_opt ::= range_or_rows BETWEEN frame_bound_s AND frame_bound_e frame_exclude_opt */
160117 -1, /* (318) range_or_rows ::= RANGE|ROWS|GROUPS */
160118 -1, /* (319) frame_bound_s ::= frame_bound */
160119 -2, /* (320) frame_bound_s ::= UNBOUNDED PRECEDING */
160120 -1, /* (321) frame_bound_e ::= frame_bound */
160121 -2, /* (322) frame_bound_e ::= UNBOUNDED FOLLOWING */
160122 -2, /* (323) frame_bound ::= expr PRECEDING|FOLLOWING */
160123 -2, /* (324) frame_bound ::= CURRENT ROW */
160124 0, /* (325) frame_exclude_opt ::= */
160125 -2, /* (326) frame_exclude_opt ::= EXCLUDE frame_exclude */
160126 -2, /* (327) frame_exclude ::= NO OTHERS */
160127 -2, /* (328) frame_exclude ::= CURRENT ROW */
160128 -1, /* (329) frame_exclude ::= GROUP|TIES */
160129 -2, /* (330) window_clause ::= WINDOW windowdefn_list */
160130 -2, /* (331) filter_over ::= filter_clause over_clause */
160131 -1, /* (332) filter_over ::= over_clause */
160132 -1, /* (333) filter_over ::= filter_clause */
160133 -4, /* (334) over_clause ::= OVER LP window RP */
160134 -2, /* (335) over_clause ::= OVER nm */
160135 -5, /* (336) filter_clause ::= FILTER LP WHERE expr RP */
160136 -1, /* (337) input ::= cmdlist */
160137 -2, /* (338) cmdlist ::= cmdlist ecmd */
160138 -1, /* (339) cmdlist ::= ecmd */
160139 -1, /* (340) ecmd ::= SEMI */
160140 -2, /* (341) ecmd ::= cmdx SEMI */
160141 -3, /* (342) ecmd ::= explain cmdx SEMI */
160142 0, /* (343) trans_opt ::= */
160143 -1, /* (344) trans_opt ::= TRANSACTION */
160144 -2, /* (345) trans_opt ::= TRANSACTION nm */
160145 -1, /* (346) savepoint_opt ::= SAVEPOINT */
160146 0, /* (347) savepoint_opt ::= */
160147 -2, /* (348) cmd ::= create_table create_table_args */
160148 -4, /* (349) columnlist ::= columnlist COMMA columnname carglist */
160149 -2, /* (350) columnlist ::= columnname carglist */
160150 -1, /* (351) nm ::= ID|INDEXED */
160151 -1, /* (352) nm ::= STRING */
160152 -1, /* (353) nm ::= JOIN_KW */
160153 -1, /* (354) typetoken ::= typename */
160154 -1, /* (355) typename ::= ID|STRING */
160155 -1, /* (356) signed ::= plus_num */
160156 -1, /* (357) signed ::= minus_num */
160157 -2, /* (358) carglist ::= carglist ccons */
160158 0, /* (359) carglist ::= */
160159 -2, /* (360) ccons ::= NULL onconf */
160160 -4, /* (361) ccons ::= GENERATED ALWAYS AS generated */
160161 -2, /* (362) ccons ::= AS generated */
160162 -2, /* (363) conslist_opt ::= COMMA conslist */
160163 -3, /* (364) conslist ::= conslist tconscomma tcons */
160164 -1, /* (365) conslist ::= tcons */
160165 0, /* (366) tconscomma ::= */
160166 -1, /* (367) defer_subclause_opt ::= defer_subclause */
160167 -1, /* (368) resolvetype ::= raisetype */
160168 -1, /* (369) selectnowith ::= oneselect */
160169 -1, /* (370) oneselect ::= values */
160170 -2, /* (371) sclp ::= selcollist COMMA */
160171 -1, /* (372) as ::= ID|STRING */
160172 0, /* (373) returning ::= */
160173 -1, /* (374) expr ::= term */
160174 -1, /* (375) likeop ::= LIKE_KW|MATCH */
160175 -1, /* (376) exprlist ::= nexprlist */
160176 -1, /* (377) nmnum ::= plus_num */
160177 -1, /* (378) nmnum ::= nm */
160178 -1, /* (379) nmnum ::= ON */
160179 -1, /* (380) nmnum ::= DELETE */
160180 -1, /* (381) nmnum ::= DEFAULT */
160181 -1, /* (382) plus_num ::= INTEGER|FLOAT */
160182 0, /* (383) foreach_clause ::= */
160183 -3, /* (384) foreach_clause ::= FOR EACH ROW */
160184 -1, /* (385) trnm ::= nm */
160185 0, /* (386) tridxby ::= */
160186 -1, /* (387) database_kw_opt ::= DATABASE */
160187 0, /* (388) database_kw_opt ::= */
160188 0, /* (389) kwcolumn_opt ::= */
160189 -1, /* (390) kwcolumn_opt ::= COLUMNKW */
160190 -1, /* (391) vtabarglist ::= vtabarg */
160191 -3, /* (392) vtabarglist ::= vtabarglist COMMA vtabarg */
160192 -2, /* (393) vtabarg ::= vtabarg vtabargtoken */
160193 0, /* (394) anylist ::= */
160194 -4, /* (395) anylist ::= anylist LP anylist RP */
160195 -2, /* (396) anylist ::= anylist ANY */
160196 0, /* (397) with ::= */
160197 };
160198
160199 static void yy_accept(yyParser*); /* Forward Declaration */
160200
160201 /*
@@ -160056,20 +160243,20 @@
160243 break;
160244 case 2: /* cmdx ::= cmd */
160245 { sqlite3FinishCoding(pParse); }
160246 break;
160247 case 3: /* cmd ::= BEGIN transtype trans_opt */
160248 {sqlite3BeginTransaction(pParse, yymsp[-1].minor.yy60);}
160249 break;
160250 case 4: /* transtype ::= */
160251 {yymsp[1].minor.yy60 = TK_DEFERRED;}
160252 break;
160253 case 5: /* transtype ::= DEFERRED */
160254 case 6: /* transtype ::= IMMEDIATE */ yytestcase(yyruleno==6);
160255 case 7: /* transtype ::= EXCLUSIVE */ yytestcase(yyruleno==7);
160256 case 318: /* range_or_rows ::= RANGE|ROWS|GROUPS */ yytestcase(yyruleno==318);
160257 {yymsp[0].minor.yy60 = yymsp[0].major; /*A-overwrites-X*/}
160258 break;
160259 case 8: /* cmd ::= COMMIT|END trans_opt */
160260 case 9: /* cmd ::= ROLLBACK trans_opt */ yytestcase(yyruleno==9);
160261 {sqlite3EndTransaction(pParse,yymsp[-1].major);}
160262 break;
@@ -160088,11 +160275,11 @@
160275 sqlite3Savepoint(pParse, SAVEPOINT_ROLLBACK, &yymsp[0].minor.yy0);
160276 }
160277 break;
160278 case 13: /* create_table ::= createkw temp TABLE ifnotexists nm dbnm */
160279 {
160280 sqlite3StartTable(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,yymsp[-4].minor.yy60,0,0,yymsp[-2].minor.yy60);
160281 }
160282 break;
160283 case 14: /* createkw ::= CREATE */
160284 {disableLookaside(pParse);}
160285 break;
@@ -160103,36 +160290,36 @@
160290 case 60: /* init_deferred_pred_opt ::= */ yytestcase(yyruleno==60);
160291 case 70: /* defer_subclause_opt ::= */ yytestcase(yyruleno==70);
160292 case 79: /* ifexists ::= */ yytestcase(yyruleno==79);
160293 case 96: /* distinct ::= */ yytestcase(yyruleno==96);
160294 case 239: /* collate ::= */ yytestcase(yyruleno==239);
160295 {yymsp[1].minor.yy60 = 0;}
160296 break;
160297 case 16: /* ifnotexists ::= IF NOT EXISTS */
160298 {yymsp[-2].minor.yy60 = 1;}
160299 break;
160300 case 17: /* temp ::= TEMP */
160301 case 46: /* autoinc ::= AUTOINCR */ yytestcase(yyruleno==46);
160302 {yymsp[0].minor.yy60 = 1;}
160303 break;
160304 case 19: /* create_table_args ::= LP columnlist conslist_opt RP table_options */
160305 {
160306 sqlite3EndTable(pParse,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0,yymsp[0].minor.yy60,0);
160307 }
160308 break;
160309 case 20: /* create_table_args ::= AS select */
160310 {
160311 sqlite3EndTable(pParse,0,0,0,yymsp[0].minor.yy307);
160312 sqlite3SelectDelete(pParse->db, yymsp[0].minor.yy307);
160313 }
160314 break;
160315 case 22: /* table_options ::= WITHOUT nm */
160316 {
160317 if( yymsp[0].minor.yy0.n==5 && sqlite3_strnicmp(yymsp[0].minor.yy0.z,"rowid",5)==0 ){
160318 yymsp[-1].minor.yy60 = TF_WithoutRowid | TF_NoVisibleRowid;
160319 }else{
160320 yymsp[-1].minor.yy60 = 0;
160321 sqlite3ErrorMsg(pParse, "unknown table option: %.*s", yymsp[0].minor.yy0.n, yymsp[0].minor.yy0.z);
160322 }
160323 }
160324 break;
160325 case 23: /* columnname ::= nm typetoken */
@@ -160157,11 +160344,11 @@
160344 {yymsp[-1].minor.yy0.n=yymsp[0].minor.yy0.n+(int)(yymsp[0].minor.yy0.z-yymsp[-1].minor.yy0.z);}
160345 break;
160346 case 28: /* scanpt ::= */
160347 {
160348 assert( yyLookahead!=YYNOCODE );
160349 yymsp[1].minor.yy528 = yyLookaheadToken.z;
160350 }
160351 break;
160352 case 29: /* scantok ::= */
160353 {
160354 assert( yyLookahead!=YYNOCODE );
@@ -160171,21 +160358,21 @@
160358 case 30: /* ccons ::= CONSTRAINT nm */
160359 case 65: /* tcons ::= CONSTRAINT nm */ yytestcase(yyruleno==65);
160360 {pParse->constraintName = yymsp[0].minor.yy0;}
160361 break;
160362 case 31: /* ccons ::= DEFAULT scantok term */
160363 {sqlite3AddDefaultValue(pParse,yymsp[0].minor.yy602,yymsp[-1].minor.yy0.z,&yymsp[-1].minor.yy0.z[yymsp[-1].minor.yy0.n]);}
160364 break;
160365 case 32: /* ccons ::= DEFAULT LP expr RP */
160366 {sqlite3AddDefaultValue(pParse,yymsp[-1].minor.yy602,yymsp[-2].minor.yy0.z+1,yymsp[0].minor.yy0.z);}
160367 break;
160368 case 33: /* ccons ::= DEFAULT PLUS scantok term */
160369 {sqlite3AddDefaultValue(pParse,yymsp[0].minor.yy602,yymsp[-2].minor.yy0.z,&yymsp[-1].minor.yy0.z[yymsp[-1].minor.yy0.n]);}
160370 break;
160371 case 34: /* ccons ::= DEFAULT MINUS scantok term */
160372 {
160373 Expr *p = sqlite3PExpr(pParse, TK_UMINUS, yymsp[0].minor.yy602, 0);
160374 sqlite3AddDefaultValue(pParse,p,yymsp[-2].minor.yy0.z,&yymsp[-1].minor.yy0.z[yymsp[-1].minor.yy0.n]);
160375 }
160376 break;
160377 case 35: /* ccons ::= DEFAULT scantok ID|INDEXED */
160378 {
@@ -160196,274 +160383,256 @@
160383 }
160384 sqlite3AddDefaultValue(pParse,p,yymsp[0].minor.yy0.z,yymsp[0].minor.yy0.z+yymsp[0].minor.yy0.n);
160385 }
160386 break;
160387 case 36: /* ccons ::= NOT NULL onconf */
160388 {sqlite3AddNotNull(pParse, yymsp[0].minor.yy60);}
160389 break;
160390 case 37: /* ccons ::= PRIMARY KEY sortorder onconf autoinc */
160391 {sqlite3AddPrimaryKey(pParse,0,yymsp[-1].minor.yy60,yymsp[0].minor.yy60,yymsp[-2].minor.yy60);}
160392 break;
160393 case 38: /* ccons ::= UNIQUE onconf */
160394 {sqlite3CreateIndex(pParse,0,0,0,0,yymsp[0].minor.yy60,0,0,0,0,
160395 SQLITE_IDXTYPE_UNIQUE);}
160396 break;
160397 case 39: /* ccons ::= CHECK LP expr RP */
160398 {sqlite3AddCheckConstraint(pParse,yymsp[-1].minor.yy602,yymsp[-2].minor.yy0.z,yymsp[0].minor.yy0.z);}
160399 break;
160400 case 40: /* ccons ::= REFERENCES nm eidlist_opt refargs */
160401 {sqlite3CreateForeignKey(pParse,0,&yymsp[-2].minor.yy0,yymsp[-1].minor.yy338,yymsp[0].minor.yy60);}
160402 break;
160403 case 41: /* ccons ::= defer_subclause */
160404 {sqlite3DeferForeignKey(pParse,yymsp[0].minor.yy60);}
160405 break;
160406 case 42: /* ccons ::= COLLATE ID|STRING */
160407 {sqlite3AddCollateType(pParse, &yymsp[0].minor.yy0);}
160408 break;
160409 case 43: /* generated ::= LP expr RP */
160410 {sqlite3AddGenerated(pParse,yymsp[-1].minor.yy602,0);}
160411 break;
160412 case 44: /* generated ::= LP expr RP ID */
160413 {sqlite3AddGenerated(pParse,yymsp[-2].minor.yy602,&yymsp[0].minor.yy0);}
160414 break;
160415 case 47: /* refargs ::= */
160416 { yymsp[1].minor.yy60 = OE_None*0x0101; /* EV: R-19803-45884 */}
160417 break;
160418 case 48: /* refargs ::= refargs refarg */
160419 { yymsp[-1].minor.yy60 = (yymsp[-1].minor.yy60 & ~yymsp[0].minor.yy615.mask) | yymsp[0].minor.yy615.value; }
160420 break;
160421 case 49: /* refarg ::= MATCH nm */
160422 { yymsp[-1].minor.yy615.value = 0; yymsp[-1].minor.yy615.mask = 0x000000; }
160423 break;
160424 case 50: /* refarg ::= ON INSERT refact */
160425 { yymsp[-2].minor.yy615.value = 0; yymsp[-2].minor.yy615.mask = 0x000000; }
160426 break;
160427 case 51: /* refarg ::= ON DELETE refact */
160428 { yymsp[-2].minor.yy615.value = yymsp[0].minor.yy60; yymsp[-2].minor.yy615.mask = 0x0000ff; }
160429 break;
160430 case 52: /* refarg ::= ON UPDATE refact */
160431 { yymsp[-2].minor.yy615.value = yymsp[0].minor.yy60<<8; yymsp[-2].minor.yy615.mask = 0x00ff00; }
160432 break;
160433 case 53: /* refact ::= SET NULL */
160434 { yymsp[-1].minor.yy60 = OE_SetNull; /* EV: R-33326-45252 */}
160435 break;
160436 case 54: /* refact ::= SET DEFAULT */
160437 { yymsp[-1].minor.yy60 = OE_SetDflt; /* EV: R-33326-45252 */}
160438 break;
160439 case 55: /* refact ::= CASCADE */
160440 { yymsp[0].minor.yy60 = OE_Cascade; /* EV: R-33326-45252 */}
160441 break;
160442 case 56: /* refact ::= RESTRICT */
160443 { yymsp[0].minor.yy60 = OE_Restrict; /* EV: R-33326-45252 */}
160444 break;
160445 case 57: /* refact ::= NO ACTION */
160446 { yymsp[-1].minor.yy60 = OE_None; /* EV: R-33326-45252 */}
160447 break;
160448 case 58: /* defer_subclause ::= NOT DEFERRABLE init_deferred_pred_opt */
160449 {yymsp[-2].minor.yy60 = 0;}
160450 break;
160451 case 59: /* defer_subclause ::= DEFERRABLE init_deferred_pred_opt */
160452 case 74: /* orconf ::= OR resolvetype */ yytestcase(yyruleno==74);
160453 case 169: /* insert_cmd ::= INSERT orconf */ yytestcase(yyruleno==169);
160454 {yymsp[-1].minor.yy60 = yymsp[0].minor.yy60;}
160455 break;
160456 case 61: /* init_deferred_pred_opt ::= INITIALLY DEFERRED */
160457 case 78: /* ifexists ::= IF EXISTS */ yytestcase(yyruleno==78);
160458 case 211: /* between_op ::= NOT BETWEEN */ yytestcase(yyruleno==211);
160459 case 214: /* in_op ::= NOT IN */ yytestcase(yyruleno==214);
160460 case 240: /* collate ::= COLLATE ID|STRING */ yytestcase(yyruleno==240);
160461 {yymsp[-1].minor.yy60 = 1;}
160462 break;
160463 case 62: /* init_deferred_pred_opt ::= INITIALLY IMMEDIATE */
160464 {yymsp[-1].minor.yy60 = 0;}
160465 break;
160466 case 64: /* tconscomma ::= COMMA */
160467 {pParse->constraintName.n = 0;}
160468 break;
160469 case 66: /* tcons ::= PRIMARY KEY LP sortlist autoinc RP onconf */
160470 {sqlite3AddPrimaryKey(pParse,yymsp[-3].minor.yy338,yymsp[0].minor.yy60,yymsp[-2].minor.yy60,0);}
160471 break;
160472 case 67: /* tcons ::= UNIQUE LP sortlist RP onconf */
160473 {sqlite3CreateIndex(pParse,0,0,0,yymsp[-2].minor.yy338,yymsp[0].minor.yy60,0,0,0,0,
160474 SQLITE_IDXTYPE_UNIQUE);}
160475 break;
160476 case 68: /* tcons ::= CHECK LP expr RP onconf */
160477 {sqlite3AddCheckConstraint(pParse,yymsp[-2].minor.yy602,yymsp[-3].minor.yy0.z,yymsp[-1].minor.yy0.z);}
160478 break;
160479 case 69: /* tcons ::= FOREIGN KEY LP eidlist RP REFERENCES nm eidlist_opt refargs defer_subclause_opt */
160480 {
160481 sqlite3CreateForeignKey(pParse, yymsp[-6].minor.yy338, &yymsp[-3].minor.yy0, yymsp[-2].minor.yy338, yymsp[-1].minor.yy60);
160482 sqlite3DeferForeignKey(pParse, yymsp[0].minor.yy60);
160483 }
160484 break;
160485 case 71: /* onconf ::= */
160486 case 73: /* orconf ::= */ yytestcase(yyruleno==73);
160487 {yymsp[1].minor.yy60 = OE_Default;}
160488 break;
160489 case 72: /* onconf ::= ON CONFLICT resolvetype */
160490 {yymsp[-2].minor.yy60 = yymsp[0].minor.yy60;}
160491 break;
160492 case 75: /* resolvetype ::= IGNORE */
160493 {yymsp[0].minor.yy60 = OE_Ignore;}
160494 break;
160495 case 76: /* resolvetype ::= REPLACE */
160496 case 170: /* insert_cmd ::= REPLACE */ yytestcase(yyruleno==170);
160497 {yymsp[0].minor.yy60 = OE_Replace;}
160498 break;
160499 case 77: /* cmd ::= DROP TABLE ifexists fullname */
160500 {
160501 sqlite3DropTable(pParse, yymsp[0].minor.yy291, 0, yymsp[-1].minor.yy60);
160502 }
160503 break;
160504 case 80: /* cmd ::= createkw temp VIEW ifnotexists nm dbnm eidlist_opt AS select */
160505 {
160506 sqlite3CreateView(pParse, &yymsp[-8].minor.yy0, &yymsp[-4].minor.yy0, &yymsp[-3].minor.yy0, yymsp[-2].minor.yy338, yymsp[0].minor.yy307, yymsp[-7].minor.yy60, yymsp[-5].minor.yy60);
160507 }
160508 break;
160509 case 81: /* cmd ::= DROP VIEW ifexists fullname */
160510 {
160511 sqlite3DropTable(pParse, yymsp[0].minor.yy291, 1, yymsp[-1].minor.yy60);
160512 }
160513 break;
160514 case 82: /* cmd ::= select */
160515 {
160516 SelectDest dest = {SRT_Output, 0, 0, 0, 0, 0, 0};
160517 sqlite3Select(pParse, yymsp[0].minor.yy307, &dest);
160518 sqlite3SelectDelete(pParse->db, yymsp[0].minor.yy307);
160519 }
160520 break;
160521 case 83: /* select ::= WITH wqlist selectnowith */
160522 {yymsp[-2].minor.yy307 = attachWithToSelect(pParse,yymsp[0].minor.yy307,yymsp[-1].minor.yy195);}
 
 
 
 
 
 
 
 
 
160523 break;
160524 case 84: /* select ::= WITH RECURSIVE wqlist selectnowith */
160525 {yymsp[-3].minor.yy307 = attachWithToSelect(pParse,yymsp[0].minor.yy307,yymsp[-1].minor.yy195);}
 
 
 
 
 
 
 
 
 
160526 break;
160527 case 85: /* select ::= selectnowith */
160528 {
160529 Select *p = yymsp[0].minor.yy307;
160530 if( p ){
160531 parserDoubleLinkSelect(pParse, p);
160532 }
160533 yymsp[0].minor.yy307 = p; /*A-overwrites-X*/
160534 }
160535 break;
160536 case 86: /* selectnowith ::= selectnowith multiselect_op oneselect */
160537 {
160538 Select *pRhs = yymsp[0].minor.yy307;
160539 Select *pLhs = yymsp[-2].minor.yy307;
160540 if( pRhs && pRhs->pPrior ){
160541 SrcList *pFrom;
160542 Token x;
160543 x.n = 0;
160544 parserDoubleLinkSelect(pParse, pRhs);
160545 pFrom = sqlite3SrcListAppendFromTerm(pParse,0,0,0,&x,pRhs,0,0);
160546 pRhs = sqlite3SelectNew(pParse,0,pFrom,0,0,0,0,0,0);
160547 }
160548 if( pRhs ){
160549 pRhs->op = (u8)yymsp[-1].minor.yy60;
160550 pRhs->pPrior = pLhs;
160551 if( ALWAYS(pLhs) ) pLhs->selFlags &= ~SF_MultiValue;
160552 pRhs->selFlags &= ~SF_MultiValue;
160553 if( yymsp[-1].minor.yy60!=TK_ALL ) pParse->hasCompound = 1;
160554 }else{
160555 sqlite3SelectDelete(pParse->db, pLhs);
160556 }
160557 yymsp[-2].minor.yy307 = pRhs;
160558 }
160559 break;
160560 case 87: /* multiselect_op ::= UNION */
160561 case 89: /* multiselect_op ::= EXCEPT|INTERSECT */ yytestcase(yyruleno==89);
160562 {yymsp[0].minor.yy60 = yymsp[0].major; /*A-overwrites-OP*/}
160563 break;
160564 case 88: /* multiselect_op ::= UNION ALL */
160565 {yymsp[-1].minor.yy60 = TK_ALL;}
160566 break;
160567 case 90: /* oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt orderby_opt limit_opt */
160568 {
160569 yymsp[-8].minor.yy307 = sqlite3SelectNew(pParse,yymsp[-6].minor.yy338,yymsp[-5].minor.yy291,yymsp[-4].minor.yy602,yymsp[-3].minor.yy338,yymsp[-2].minor.yy602,yymsp[-1].minor.yy338,yymsp[-7].minor.yy60,yymsp[0].minor.yy602);
160570 }
160571 break;
160572 case 91: /* oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt window_clause orderby_opt limit_opt */
160573 {
160574 yymsp[-9].minor.yy307 = sqlite3SelectNew(pParse,yymsp[-7].minor.yy338,yymsp[-6].minor.yy291,yymsp[-5].minor.yy602,yymsp[-4].minor.yy338,yymsp[-3].minor.yy602,yymsp[-1].minor.yy338,yymsp[-8].minor.yy60,yymsp[0].minor.yy602);
160575 if( yymsp[-9].minor.yy307 ){
160576 yymsp[-9].minor.yy307->pWinDefn = yymsp[-2].minor.yy19;
160577 }else{
160578 sqlite3WindowListDelete(pParse->db, yymsp[-2].minor.yy19);
160579 }
160580 }
160581 break;
160582 case 92: /* values ::= VALUES LP nexprlist RP */
160583 {
160584 yymsp[-3].minor.yy307 = sqlite3SelectNew(pParse,yymsp[-1].minor.yy338,0,0,0,0,0,SF_Values,0);
160585 }
160586 break;
160587 case 93: /* values ::= values COMMA LP nexprlist RP */
160588 {
160589 Select *pRight, *pLeft = yymsp[-4].minor.yy307;
160590 pRight = sqlite3SelectNew(pParse,yymsp[-1].minor.yy338,0,0,0,0,0,SF_Values|SF_MultiValue,0);
160591 if( ALWAYS(pLeft) ) pLeft->selFlags &= ~SF_MultiValue;
160592 if( pRight ){
160593 pRight->op = TK_ALL;
160594 pRight->pPrior = pLeft;
160595 yymsp[-4].minor.yy307 = pRight;
160596 }else{
160597 yymsp[-4].minor.yy307 = pLeft;
160598 }
160599 }
160600 break;
160601 case 94: /* distinct ::= DISTINCT */
160602 {yymsp[0].minor.yy60 = SF_Distinct;}
160603 break;
160604 case 95: /* distinct ::= ALL */
160605 {yymsp[0].minor.yy60 = SF_All;}
160606 break;
160607 case 97: /* sclp ::= */
160608 case 130: /* orderby_opt ::= */ yytestcase(yyruleno==130);
160609 case 140: /* groupby_opt ::= */ yytestcase(yyruleno==140);
160610 case 227: /* exprlist ::= */ yytestcase(yyruleno==227);
160611 case 230: /* paren_exprlist ::= */ yytestcase(yyruleno==230);
160612 case 235: /* eidlist_opt ::= */ yytestcase(yyruleno==235);
160613 {yymsp[1].minor.yy338 = 0;}
160614 break;
160615 case 98: /* selcollist ::= sclp scanpt expr scanpt as */
160616 {
160617 yymsp[-4].minor.yy338 = sqlite3ExprListAppend(pParse, yymsp[-4].minor.yy338, yymsp[-2].minor.yy602);
160618 if( yymsp[0].minor.yy0.n>0 ) sqlite3ExprListSetName(pParse, yymsp[-4].minor.yy338, &yymsp[0].minor.yy0, 1);
160619 sqlite3ExprListSetSpan(pParse,yymsp[-4].minor.yy338,yymsp[-3].minor.yy528,yymsp[-1].minor.yy528);
160620 }
160621 break;
160622 case 99: /* selcollist ::= sclp scanpt STAR */
160623 {
160624 Expr *p = sqlite3Expr(pParse->db, TK_ASTERISK, 0);
160625 yymsp[-2].minor.yy338 = sqlite3ExprListAppend(pParse, yymsp[-2].minor.yy338, p);
160626 }
160627 break;
160628 case 100: /* selcollist ::= sclp scanpt nm DOT STAR */
160629 {
160630 Expr *pRight = sqlite3PExpr(pParse, TK_ASTERISK, 0, 0);
160631 Expr *pLeft = sqlite3ExprAlloc(pParse->db, TK_ID, &yymsp[-2].minor.yy0, 1);
160632 Expr *pDot = sqlite3PExpr(pParse, TK_DOT, pLeft, pRight);
160633 yymsp[-4].minor.yy338 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy338, pDot);
160634 }
160635 break;
160636 case 101: /* as ::= AS nm */
160637 case 112: /* dbnm ::= DOT nm */ yytestcase(yyruleno==112);
160638 case 251: /* plus_num ::= PLUS INTEGER|FLOAT */ yytestcase(yyruleno==251);
@@ -160470,49 +160639,49 @@
160639 case 252: /* minus_num ::= MINUS INTEGER|FLOAT */ yytestcase(yyruleno==252);
160640 {yymsp[-1].minor.yy0 = yymsp[0].minor.yy0;}
160641 break;
160642 case 103: /* from ::= */
160643 case 106: /* stl_prefix ::= */ yytestcase(yyruleno==106);
160644 {yymsp[1].minor.yy291 = 0;}
160645 break;
160646 case 104: /* from ::= FROM seltablist */
160647 {
160648 yymsp[-1].minor.yy291 = yymsp[0].minor.yy291;
160649 sqlite3SrcListShiftJoinType(yymsp[-1].minor.yy291);
160650 }
160651 break;
160652 case 105: /* stl_prefix ::= seltablist joinop */
160653 {
160654 if( ALWAYS(yymsp[-1].minor.yy291 && yymsp[-1].minor.yy291->nSrc>0) ) yymsp[-1].minor.yy291->a[yymsp[-1].minor.yy291->nSrc-1].fg.jointype = (u8)yymsp[0].minor.yy60;
160655 }
160656 break;
160657 case 107: /* seltablist ::= stl_prefix nm dbnm as indexed_opt on_opt using_opt */
160658 {
160659 yymsp[-6].minor.yy291 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy291,&yymsp[-5].minor.yy0,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,0,yymsp[-1].minor.yy602,yymsp[0].minor.yy288);
160660 sqlite3SrcListIndexedBy(pParse, yymsp[-6].minor.yy291, &yymsp[-2].minor.yy0);
160661 }
160662 break;
160663 case 108: /* seltablist ::= stl_prefix nm dbnm LP exprlist RP as on_opt using_opt */
160664 {
160665 yymsp[-8].minor.yy291 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-8].minor.yy291,&yymsp[-7].minor.yy0,&yymsp[-6].minor.yy0,&yymsp[-2].minor.yy0,0,yymsp[-1].minor.yy602,yymsp[0].minor.yy288);
160666 sqlite3SrcListFuncArgs(pParse, yymsp[-8].minor.yy291, yymsp[-4].minor.yy338);
160667 }
160668 break;
160669 case 109: /* seltablist ::= stl_prefix LP select RP as on_opt using_opt */
160670 {
160671 yymsp[-6].minor.yy291 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy291,0,0,&yymsp[-2].minor.yy0,yymsp[-4].minor.yy307,yymsp[-1].minor.yy602,yymsp[0].minor.yy288);
160672 }
160673 break;
160674 case 110: /* seltablist ::= stl_prefix LP seltablist RP as on_opt using_opt */
160675 {
160676 if( yymsp[-6].minor.yy291==0 && yymsp[-2].minor.yy0.n==0 && yymsp[-1].minor.yy602==0 && yymsp[0].minor.yy288==0 ){
160677 yymsp[-6].minor.yy291 = yymsp[-4].minor.yy291;
160678 }else if( yymsp[-4].minor.yy291->nSrc==1 ){
160679 yymsp[-6].minor.yy291 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy291,0,0,&yymsp[-2].minor.yy0,0,yymsp[-1].minor.yy602,yymsp[0].minor.yy288);
160680 if( yymsp[-6].minor.yy291 ){
160681 SrcItem *pNew = &yymsp[-6].minor.yy291->a[yymsp[-6].minor.yy291->nSrc-1];
160682 SrcItem *pOld = yymsp[-4].minor.yy291->a;
160683 pNew->zName = pOld->zName;
160684 pNew->zDatabase = pOld->zDatabase;
160685 pNew->pSelect = pOld->pSelect;
160686 if( pOld->fg.isTabFunc ){
160687 pNew->u1.pFuncArg = pOld->u1.pFuncArg;
@@ -160521,240 +160690,240 @@
160690 pNew->fg.isTabFunc = 1;
160691 }
160692 pOld->zName = pOld->zDatabase = 0;
160693 pOld->pSelect = 0;
160694 }
160695 sqlite3SrcListDelete(pParse->db, yymsp[-4].minor.yy291);
160696 }else{
160697 Select *pSubquery;
160698 sqlite3SrcListShiftJoinType(yymsp[-4].minor.yy291);
160699 pSubquery = sqlite3SelectNew(pParse,0,yymsp[-4].minor.yy291,0,0,0,0,SF_NestedFrom,0);
160700 yymsp[-6].minor.yy291 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy291,0,0,&yymsp[-2].minor.yy0,pSubquery,yymsp[-1].minor.yy602,yymsp[0].minor.yy288);
160701 }
160702 }
160703 break;
160704 case 111: /* dbnm ::= */
160705 case 125: /* indexed_opt ::= */ yytestcase(yyruleno==125);
160706 {yymsp[1].minor.yy0.z=0; yymsp[1].minor.yy0.n=0;}
160707 break;
160708 case 113: /* fullname ::= nm */
160709 {
160710 yylhsminor.yy291 = sqlite3SrcListAppend(pParse,0,&yymsp[0].minor.yy0,0);
160711 if( IN_RENAME_OBJECT && yylhsminor.yy291 ) sqlite3RenameTokenMap(pParse, yylhsminor.yy291->a[0].zName, &yymsp[0].minor.yy0);
160712 }
160713 yymsp[0].minor.yy291 = yylhsminor.yy291;
160714 break;
160715 case 114: /* fullname ::= nm DOT nm */
160716 {
160717 yylhsminor.yy291 = sqlite3SrcListAppend(pParse,0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0);
160718 if( IN_RENAME_OBJECT && yylhsminor.yy291 ) sqlite3RenameTokenMap(pParse, yylhsminor.yy291->a[0].zName, &yymsp[0].minor.yy0);
160719 }
160720 yymsp[-2].minor.yy291 = yylhsminor.yy291;
160721 break;
160722 case 115: /* xfullname ::= nm */
160723 {yymsp[0].minor.yy291 = sqlite3SrcListAppend(pParse,0,&yymsp[0].minor.yy0,0); /*A-overwrites-X*/}
160724 break;
160725 case 116: /* xfullname ::= nm DOT nm */
160726 {yymsp[-2].minor.yy291 = sqlite3SrcListAppend(pParse,0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0); /*A-overwrites-X*/}
160727 break;
160728 case 117: /* xfullname ::= nm DOT nm AS nm */
160729 {
160730 yymsp[-4].minor.yy291 = sqlite3SrcListAppend(pParse,0,&yymsp[-4].minor.yy0,&yymsp[-2].minor.yy0); /*A-overwrites-X*/
160731 if( yymsp[-4].minor.yy291 ) yymsp[-4].minor.yy291->a[0].zAlias = sqlite3NameFromToken(pParse->db, &yymsp[0].minor.yy0);
160732 }
160733 break;
160734 case 118: /* xfullname ::= nm AS nm */
160735 {
160736 yymsp[-2].minor.yy291 = sqlite3SrcListAppend(pParse,0,&yymsp[-2].minor.yy0,0); /*A-overwrites-X*/
160737 if( yymsp[-2].minor.yy291 ) yymsp[-2].minor.yy291->a[0].zAlias = sqlite3NameFromToken(pParse->db, &yymsp[0].minor.yy0);
160738 }
160739 break;
160740 case 119: /* joinop ::= COMMA|JOIN */
160741 { yymsp[0].minor.yy60 = JT_INNER; }
160742 break;
160743 case 120: /* joinop ::= JOIN_KW JOIN */
160744 {yymsp[-1].minor.yy60 = sqlite3JoinType(pParse,&yymsp[-1].minor.yy0,0,0); /*X-overwrites-A*/}
160745 break;
160746 case 121: /* joinop ::= JOIN_KW nm JOIN */
160747 {yymsp[-2].minor.yy60 = sqlite3JoinType(pParse,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0,0); /*X-overwrites-A*/}
160748 break;
160749 case 122: /* joinop ::= JOIN_KW nm nm JOIN */
160750 {yymsp[-3].minor.yy60 = sqlite3JoinType(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0);/*X-overwrites-A*/}
160751 break;
160752 case 123: /* on_opt ::= ON expr */
160753 case 143: /* having_opt ::= HAVING expr */ yytestcase(yyruleno==143);
160754 case 150: /* where_opt ::= WHERE expr */ yytestcase(yyruleno==150);
160755 case 152: /* where_opt_ret ::= WHERE expr */ yytestcase(yyruleno==152);
160756 case 223: /* case_else ::= ELSE expr */ yytestcase(yyruleno==223);
160757 case 244: /* vinto ::= INTO expr */ yytestcase(yyruleno==244);
160758 {yymsp[-1].minor.yy602 = yymsp[0].minor.yy602;}
160759 break;
160760 case 124: /* on_opt ::= */
160761 case 142: /* having_opt ::= */ yytestcase(yyruleno==142);
160762 case 144: /* limit_opt ::= */ yytestcase(yyruleno==144);
160763 case 149: /* where_opt ::= */ yytestcase(yyruleno==149);
160764 case 151: /* where_opt_ret ::= */ yytestcase(yyruleno==151);
160765 case 224: /* case_else ::= */ yytestcase(yyruleno==224);
160766 case 226: /* case_operand ::= */ yytestcase(yyruleno==226);
160767 case 245: /* vinto ::= */ yytestcase(yyruleno==245);
160768 {yymsp[1].minor.yy602 = 0;}
160769 break;
160770 case 126: /* indexed_opt ::= INDEXED BY nm */
160771 {yymsp[-2].minor.yy0 = yymsp[0].minor.yy0;}
160772 break;
160773 case 127: /* indexed_opt ::= NOT INDEXED */
160774 {yymsp[-1].minor.yy0.z=0; yymsp[-1].minor.yy0.n=1;}
160775 break;
160776 case 128: /* using_opt ::= USING LP idlist RP */
160777 {yymsp[-3].minor.yy288 = yymsp[-1].minor.yy288;}
160778 break;
160779 case 129: /* using_opt ::= */
160780 case 171: /* idlist_opt ::= */ yytestcase(yyruleno==171);
160781 {yymsp[1].minor.yy288 = 0;}
160782 break;
160783 case 131: /* orderby_opt ::= ORDER BY sortlist */
160784 case 141: /* groupby_opt ::= GROUP BY nexprlist */ yytestcase(yyruleno==141);
160785 {yymsp[-2].minor.yy338 = yymsp[0].minor.yy338;}
160786 break;
160787 case 132: /* sortlist ::= sortlist COMMA expr sortorder nulls */
160788 {
160789 yymsp[-4].minor.yy338 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy338,yymsp[-2].minor.yy602);
160790 sqlite3ExprListSetSortOrder(yymsp[-4].minor.yy338,yymsp[-1].minor.yy60,yymsp[0].minor.yy60);
160791 }
160792 break;
160793 case 133: /* sortlist ::= expr sortorder nulls */
160794 {
160795 yymsp[-2].minor.yy338 = sqlite3ExprListAppend(pParse,0,yymsp[-2].minor.yy602); /*A-overwrites-Y*/
160796 sqlite3ExprListSetSortOrder(yymsp[-2].minor.yy338,yymsp[-1].minor.yy60,yymsp[0].minor.yy60);
160797 }
160798 break;
160799 case 134: /* sortorder ::= ASC */
160800 {yymsp[0].minor.yy60 = SQLITE_SO_ASC;}
160801 break;
160802 case 135: /* sortorder ::= DESC */
160803 {yymsp[0].minor.yy60 = SQLITE_SO_DESC;}
160804 break;
160805 case 136: /* sortorder ::= */
160806 case 139: /* nulls ::= */ yytestcase(yyruleno==139);
160807 {yymsp[1].minor.yy60 = SQLITE_SO_UNDEFINED;}
160808 break;
160809 case 137: /* nulls ::= NULLS FIRST */
160810 {yymsp[-1].minor.yy60 = SQLITE_SO_ASC;}
160811 break;
160812 case 138: /* nulls ::= NULLS LAST */
160813 {yymsp[-1].minor.yy60 = SQLITE_SO_DESC;}
160814 break;
160815 case 145: /* limit_opt ::= LIMIT expr */
160816 {yymsp[-1].minor.yy602 = sqlite3PExpr(pParse,TK_LIMIT,yymsp[0].minor.yy602,0);}
160817 break;
160818 case 146: /* limit_opt ::= LIMIT expr OFFSET expr */
160819 {yymsp[-3].minor.yy602 = sqlite3PExpr(pParse,TK_LIMIT,yymsp[-2].minor.yy602,yymsp[0].minor.yy602);}
160820 break;
160821 case 147: /* limit_opt ::= LIMIT expr COMMA expr */
160822 {yymsp[-3].minor.yy602 = sqlite3PExpr(pParse,TK_LIMIT,yymsp[0].minor.yy602,yymsp[-2].minor.yy602);}
160823 break;
160824 case 148: /* cmd ::= with DELETE FROM xfullname indexed_opt where_opt_ret */
160825 {
160826 sqlite3SrcListIndexedBy(pParse, yymsp[-2].minor.yy291, &yymsp[-1].minor.yy0);
160827 sqlite3DeleteFrom(pParse,yymsp[-2].minor.yy291,yymsp[0].minor.yy602,0,0);
160828 }
160829 break;
160830 case 153: /* where_opt_ret ::= RETURNING selcollist */
160831 {sqlite3AddReturning(pParse,yymsp[0].minor.yy338); yymsp[-1].minor.yy602 = 0;}
160832 break;
160833 case 154: /* where_opt_ret ::= WHERE expr RETURNING selcollist */
160834 {sqlite3AddReturning(pParse,yymsp[0].minor.yy338); yymsp[-3].minor.yy602 = yymsp[-2].minor.yy602;}
160835 break;
160836 case 155: /* cmd ::= with UPDATE orconf xfullname indexed_opt SET setlist from where_opt_ret */
160837 {
160838 sqlite3SrcListIndexedBy(pParse, yymsp[-5].minor.yy291, &yymsp[-4].minor.yy0);
160839 sqlite3ExprListCheckLength(pParse,yymsp[-2].minor.yy338,"set list");
160840 yymsp[-5].minor.yy291 = sqlite3SrcListAppendList(pParse, yymsp[-5].minor.yy291, yymsp[-1].minor.yy291);
160841 sqlite3Update(pParse,yymsp[-5].minor.yy291,yymsp[-2].minor.yy338,yymsp[0].minor.yy602,yymsp[-6].minor.yy60,0,0,0);
160842 }
160843 break;
160844 case 156: /* setlist ::= setlist COMMA nm EQ expr */
160845 {
160846 yymsp[-4].minor.yy338 = sqlite3ExprListAppend(pParse, yymsp[-4].minor.yy338, yymsp[0].minor.yy602);
160847 sqlite3ExprListSetName(pParse, yymsp[-4].minor.yy338, &yymsp[-2].minor.yy0, 1);
160848 }
160849 break;
160850 case 157: /* setlist ::= setlist COMMA LP idlist RP EQ expr */
160851 {
160852 yymsp[-6].minor.yy338 = sqlite3ExprListAppendVector(pParse, yymsp[-6].minor.yy338, yymsp[-3].minor.yy288, yymsp[0].minor.yy602);
160853 }
160854 break;
160855 case 158: /* setlist ::= nm EQ expr */
160856 {
160857 yylhsminor.yy338 = sqlite3ExprListAppend(pParse, 0, yymsp[0].minor.yy602);
160858 sqlite3ExprListSetName(pParse, yylhsminor.yy338, &yymsp[-2].minor.yy0, 1);
160859 }
160860 yymsp[-2].minor.yy338 = yylhsminor.yy338;
160861 break;
160862 case 159: /* setlist ::= LP idlist RP EQ expr */
160863 {
160864 yymsp[-4].minor.yy338 = sqlite3ExprListAppendVector(pParse, 0, yymsp[-3].minor.yy288, yymsp[0].minor.yy602);
160865 }
160866 break;
160867 case 160: /* cmd ::= with insert_cmd INTO xfullname idlist_opt select upsert */
160868 {
160869 sqlite3Insert(pParse, yymsp[-3].minor.yy291, yymsp[-1].minor.yy307, yymsp[-2].minor.yy288, yymsp[-5].minor.yy60, yymsp[0].minor.yy178);
160870 }
160871 break;
160872 case 161: /* cmd ::= with insert_cmd INTO xfullname idlist_opt DEFAULT VALUES returning */
160873 {
160874 sqlite3Insert(pParse, yymsp[-4].minor.yy291, 0, yymsp[-3].minor.yy288, yymsp[-6].minor.yy60, 0);
160875 }
160876 break;
160877 case 162: /* upsert ::= */
160878 { yymsp[1].minor.yy178 = 0; }
160879 break;
160880 case 163: /* upsert ::= RETURNING selcollist */
160881 { yymsp[-1].minor.yy178 = 0; sqlite3AddReturning(pParse,yymsp[0].minor.yy338); }
160882 break;
160883 case 164: /* upsert ::= ON CONFLICT LP sortlist RP where_opt DO UPDATE SET setlist where_opt upsert */
160884 { yymsp[-11].minor.yy178 = sqlite3UpsertNew(pParse->db,yymsp[-8].minor.yy338,yymsp[-6].minor.yy602,yymsp[-2].minor.yy338,yymsp[-1].minor.yy602,yymsp[0].minor.yy178);}
160885 break;
160886 case 165: /* upsert ::= ON CONFLICT LP sortlist RP where_opt DO NOTHING upsert */
160887 { yymsp[-8].minor.yy178 = sqlite3UpsertNew(pParse->db,yymsp[-5].minor.yy338,yymsp[-3].minor.yy602,0,0,yymsp[0].minor.yy178); }
160888 break;
160889 case 166: /* upsert ::= ON CONFLICT DO NOTHING returning */
160890 { yymsp[-4].minor.yy178 = sqlite3UpsertNew(pParse->db,0,0,0,0,0); }
160891 break;
160892 case 167: /* upsert ::= ON CONFLICT DO UPDATE SET setlist where_opt returning */
160893 { yymsp[-7].minor.yy178 = sqlite3UpsertNew(pParse->db,0,0,yymsp[-2].minor.yy338,yymsp[-1].minor.yy602,0);}
160894 break;
160895 case 168: /* returning ::= RETURNING selcollist */
160896 {sqlite3AddReturning(pParse,yymsp[0].minor.yy338);}
160897 break;
160898 case 172: /* idlist_opt ::= LP idlist RP */
160899 {yymsp[-2].minor.yy288 = yymsp[-1].minor.yy288;}
160900 break;
160901 case 173: /* idlist ::= idlist COMMA nm */
160902 {yymsp[-2].minor.yy288 = sqlite3IdListAppend(pParse,yymsp[-2].minor.yy288,&yymsp[0].minor.yy0);}
160903 break;
160904 case 174: /* idlist ::= nm */
160905 {yymsp[0].minor.yy288 = sqlite3IdListAppend(pParse,0,&yymsp[0].minor.yy0); /*A-overwrites-Y*/}
160906 break;
160907 case 175: /* expr ::= LP expr RP */
160908 {yymsp[-2].minor.yy602 = yymsp[-1].minor.yy602;}
160909 break;
160910 case 176: /* expr ::= ID|INDEXED */
160911 case 177: /* expr ::= JOIN_KW */ yytestcase(yyruleno==177);
160912 {yymsp[0].minor.yy602=tokenExpr(pParse,TK_ID,yymsp[0].minor.yy0); /*A-overwrites-X*/}
160913 break;
160914 case 178: /* expr ::= nm DOT nm */
160915 {
160916 Expr *temp1 = sqlite3ExprAlloc(pParse->db, TK_ID, &yymsp[-2].minor.yy0, 1);
160917 Expr *temp2 = sqlite3ExprAlloc(pParse->db, TK_ID, &yymsp[0].minor.yy0, 1);
160918 if( IN_RENAME_OBJECT ){
160919 sqlite3RenameTokenMap(pParse, (void*)temp2, &yymsp[0].minor.yy0);
160920 sqlite3RenameTokenMap(pParse, (void*)temp1, &yymsp[-2].minor.yy0);
160921 }
160922 yylhsminor.yy602 = sqlite3PExpr(pParse, TK_DOT, temp1, temp2);
160923 }
160924 yymsp[-2].minor.yy602 = yylhsminor.yy602;
160925 break;
160926 case 179: /* expr ::= nm DOT nm DOT nm */
160927 {
160928 Expr *temp1 = sqlite3ExprAlloc(pParse->db, TK_ID, &yymsp[-4].minor.yy0, 1);
160929 Expr *temp2 = sqlite3ExprAlloc(pParse->db, TK_ID, &yymsp[-2].minor.yy0, 1);
@@ -160762,322 +160931,322 @@
160931 Expr *temp4 = sqlite3PExpr(pParse, TK_DOT, temp2, temp3);
160932 if( IN_RENAME_OBJECT ){
160933 sqlite3RenameTokenMap(pParse, (void*)temp3, &yymsp[0].minor.yy0);
160934 sqlite3RenameTokenMap(pParse, (void*)temp2, &yymsp[-2].minor.yy0);
160935 }
160936 yylhsminor.yy602 = sqlite3PExpr(pParse, TK_DOT, temp1, temp4);
160937 }
160938 yymsp[-4].minor.yy602 = yylhsminor.yy602;
160939 break;
160940 case 180: /* term ::= NULL|FLOAT|BLOB */
160941 case 181: /* term ::= STRING */ yytestcase(yyruleno==181);
160942 {yymsp[0].minor.yy602=tokenExpr(pParse,yymsp[0].major,yymsp[0].minor.yy0); /*A-overwrites-X*/}
160943 break;
160944 case 182: /* term ::= INTEGER */
160945 {
160946 yylhsminor.yy602 = sqlite3ExprAlloc(pParse->db, TK_INTEGER, &yymsp[0].minor.yy0, 1);
160947 }
160948 yymsp[0].minor.yy602 = yylhsminor.yy602;
160949 break;
160950 case 183: /* expr ::= VARIABLE */
160951 {
160952 if( !(yymsp[0].minor.yy0.z[0]=='#' && sqlite3Isdigit(yymsp[0].minor.yy0.z[1])) ){
160953 u32 n = yymsp[0].minor.yy0.n;
160954 yymsp[0].minor.yy602 = tokenExpr(pParse, TK_VARIABLE, yymsp[0].minor.yy0);
160955 sqlite3ExprAssignVarNumber(pParse, yymsp[0].minor.yy602, n);
160956 }else{
160957 /* When doing a nested parse, one can include terms in an expression
160958 ** that look like this: #1 #2 ... These terms refer to registers
160959 ** in the virtual machine. #N is the N-th register. */
160960 Token t = yymsp[0].minor.yy0; /*A-overwrites-X*/
160961 assert( t.n>=2 );
160962 if( pParse->nested==0 ){
160963 sqlite3ErrorMsg(pParse, "near \"%T\": syntax error", &t);
160964 yymsp[0].minor.yy602 = 0;
160965 }else{
160966 yymsp[0].minor.yy602 = sqlite3PExpr(pParse, TK_REGISTER, 0, 0);
160967 if( yymsp[0].minor.yy602 ) sqlite3GetInt32(&t.z[1], &yymsp[0].minor.yy602->iTable);
160968 }
160969 }
160970 }
160971 break;
160972 case 184: /* expr ::= expr COLLATE ID|STRING */
160973 {
160974 yymsp[-2].minor.yy602 = sqlite3ExprAddCollateToken(pParse, yymsp[-2].minor.yy602, &yymsp[0].minor.yy0, 1);
160975 }
160976 break;
160977 case 185: /* expr ::= CAST LP expr AS typetoken RP */
160978 {
160979 yymsp[-5].minor.yy602 = sqlite3ExprAlloc(pParse->db, TK_CAST, &yymsp[-1].minor.yy0, 1);
160980 sqlite3ExprAttachSubtrees(pParse->db, yymsp[-5].minor.yy602, yymsp[-3].minor.yy602, 0);
160981 }
160982 break;
160983 case 186: /* expr ::= ID|INDEXED LP distinct exprlist RP */
160984 {
160985 yylhsminor.yy602 = sqlite3ExprFunction(pParse, yymsp[-1].minor.yy338, &yymsp[-4].minor.yy0, yymsp[-2].minor.yy60);
160986 }
160987 yymsp[-4].minor.yy602 = yylhsminor.yy602;
160988 break;
160989 case 187: /* expr ::= ID|INDEXED LP STAR RP */
160990 {
160991 yylhsminor.yy602 = sqlite3ExprFunction(pParse, 0, &yymsp[-3].minor.yy0, 0);
160992 }
160993 yymsp[-3].minor.yy602 = yylhsminor.yy602;
160994 break;
160995 case 188: /* expr ::= ID|INDEXED LP distinct exprlist RP filter_over */
160996 {
160997 yylhsminor.yy602 = sqlite3ExprFunction(pParse, yymsp[-2].minor.yy338, &yymsp[-5].minor.yy0, yymsp[-3].minor.yy60);
160998 sqlite3WindowAttach(pParse, yylhsminor.yy602, yymsp[0].minor.yy19);
160999 }
161000 yymsp[-5].minor.yy602 = yylhsminor.yy602;
161001 break;
161002 case 189: /* expr ::= ID|INDEXED LP STAR RP filter_over */
161003 {
161004 yylhsminor.yy602 = sqlite3ExprFunction(pParse, 0, &yymsp[-4].minor.yy0, 0);
161005 sqlite3WindowAttach(pParse, yylhsminor.yy602, yymsp[0].minor.yy19);
161006 }
161007 yymsp[-4].minor.yy602 = yylhsminor.yy602;
161008 break;
161009 case 190: /* term ::= CTIME_KW */
161010 {
161011 yylhsminor.yy602 = sqlite3ExprFunction(pParse, 0, &yymsp[0].minor.yy0, 0);
161012 }
161013 yymsp[0].minor.yy602 = yylhsminor.yy602;
161014 break;
161015 case 191: /* expr ::= LP nexprlist COMMA expr RP */
161016 {
161017 ExprList *pList = sqlite3ExprListAppend(pParse, yymsp[-3].minor.yy338, yymsp[-1].minor.yy602);
161018 yymsp[-4].minor.yy602 = sqlite3PExpr(pParse, TK_VECTOR, 0, 0);
161019 if( yymsp[-4].minor.yy602 ){
161020 yymsp[-4].minor.yy602->x.pList = pList;
161021 if( ALWAYS(pList->nExpr) ){
161022 yymsp[-4].minor.yy602->flags |= pList->a[0].pExpr->flags & EP_Propagate;
161023 }
161024 }else{
161025 sqlite3ExprListDelete(pParse->db, pList);
161026 }
161027 }
161028 break;
161029 case 192: /* expr ::= expr AND expr */
161030 {yymsp[-2].minor.yy602=sqlite3ExprAnd(pParse,yymsp[-2].minor.yy602,yymsp[0].minor.yy602);}
161031 break;
161032 case 193: /* expr ::= expr OR expr */
161033 case 194: /* expr ::= expr LT|GT|GE|LE expr */ yytestcase(yyruleno==194);
161034 case 195: /* expr ::= expr EQ|NE expr */ yytestcase(yyruleno==195);
161035 case 196: /* expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr */ yytestcase(yyruleno==196);
161036 case 197: /* expr ::= expr PLUS|MINUS expr */ yytestcase(yyruleno==197);
161037 case 198: /* expr ::= expr STAR|SLASH|REM expr */ yytestcase(yyruleno==198);
161038 case 199: /* expr ::= expr CONCAT expr */ yytestcase(yyruleno==199);
161039 {yymsp[-2].minor.yy602=sqlite3PExpr(pParse,yymsp[-1].major,yymsp[-2].minor.yy602,yymsp[0].minor.yy602);}
161040 break;
161041 case 200: /* likeop ::= NOT LIKE_KW|MATCH */
161042 {yymsp[-1].minor.yy0=yymsp[0].minor.yy0; yymsp[-1].minor.yy0.n|=0x80000000; /*yymsp[-1].minor.yy0-overwrite-yymsp[0].minor.yy0*/}
161043 break;
161044 case 201: /* expr ::= expr likeop expr */
161045 {
161046 ExprList *pList;
161047 int bNot = yymsp[-1].minor.yy0.n & 0x80000000;
161048 yymsp[-1].minor.yy0.n &= 0x7fffffff;
161049 pList = sqlite3ExprListAppend(pParse,0, yymsp[0].minor.yy602);
161050 pList = sqlite3ExprListAppend(pParse,pList, yymsp[-2].minor.yy602);
161051 yymsp[-2].minor.yy602 = sqlite3ExprFunction(pParse, pList, &yymsp[-1].minor.yy0, 0);
161052 if( bNot ) yymsp[-2].minor.yy602 = sqlite3PExpr(pParse, TK_NOT, yymsp[-2].minor.yy602, 0);
161053 if( yymsp[-2].minor.yy602 ) yymsp[-2].minor.yy602->flags |= EP_InfixFunc;
161054 }
161055 break;
161056 case 202: /* expr ::= expr likeop expr ESCAPE expr */
161057 {
161058 ExprList *pList;
161059 int bNot = yymsp[-3].minor.yy0.n & 0x80000000;
161060 yymsp[-3].minor.yy0.n &= 0x7fffffff;
161061 pList = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy602);
161062 pList = sqlite3ExprListAppend(pParse,pList, yymsp[-4].minor.yy602);
161063 pList = sqlite3ExprListAppend(pParse,pList, yymsp[0].minor.yy602);
161064 yymsp[-4].minor.yy602 = sqlite3ExprFunction(pParse, pList, &yymsp[-3].minor.yy0, 0);
161065 if( bNot ) yymsp[-4].minor.yy602 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy602, 0);
161066 if( yymsp[-4].minor.yy602 ) yymsp[-4].minor.yy602->flags |= EP_InfixFunc;
161067 }
161068 break;
161069 case 203: /* expr ::= expr ISNULL|NOTNULL */
161070 {yymsp[-1].minor.yy602 = sqlite3PExpr(pParse,yymsp[0].major,yymsp[-1].minor.yy602,0);}
161071 break;
161072 case 204: /* expr ::= expr NOT NULL */
161073 {yymsp[-2].minor.yy602 = sqlite3PExpr(pParse,TK_NOTNULL,yymsp[-2].minor.yy602,0);}
161074 break;
161075 case 205: /* expr ::= expr IS expr */
161076 {
161077 yymsp[-2].minor.yy602 = sqlite3PExpr(pParse,TK_IS,yymsp[-2].minor.yy602,yymsp[0].minor.yy602);
161078 binaryToUnaryIfNull(pParse, yymsp[0].minor.yy602, yymsp[-2].minor.yy602, TK_ISNULL);
161079 }
161080 break;
161081 case 206: /* expr ::= expr IS NOT expr */
161082 {
161083 yymsp[-3].minor.yy602 = sqlite3PExpr(pParse,TK_ISNOT,yymsp[-3].minor.yy602,yymsp[0].minor.yy602);
161084 binaryToUnaryIfNull(pParse, yymsp[0].minor.yy602, yymsp[-3].minor.yy602, TK_NOTNULL);
161085 }
161086 break;
161087 case 207: /* expr ::= NOT expr */
161088 case 208: /* expr ::= BITNOT expr */ yytestcase(yyruleno==208);
161089 {yymsp[-1].minor.yy602 = sqlite3PExpr(pParse, yymsp[-1].major, yymsp[0].minor.yy602, 0);/*A-overwrites-B*/}
161090 break;
161091 case 209: /* expr ::= PLUS|MINUS expr */
161092 {
161093 yymsp[-1].minor.yy602 = sqlite3PExpr(pParse, yymsp[-1].major==TK_PLUS ? TK_UPLUS : TK_UMINUS, yymsp[0].minor.yy602, 0);
161094 /*A-overwrites-B*/
161095 }
161096 break;
161097 case 210: /* between_op ::= BETWEEN */
161098 case 213: /* in_op ::= IN */ yytestcase(yyruleno==213);
161099 {yymsp[0].minor.yy60 = 0;}
161100 break;
161101 case 212: /* expr ::= expr between_op expr AND expr */
161102 {
161103 ExprList *pList = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy602);
161104 pList = sqlite3ExprListAppend(pParse,pList, yymsp[0].minor.yy602);
161105 yymsp[-4].minor.yy602 = sqlite3PExpr(pParse, TK_BETWEEN, yymsp[-4].minor.yy602, 0);
161106 if( yymsp[-4].minor.yy602 ){
161107 yymsp[-4].minor.yy602->x.pList = pList;
161108 }else{
161109 sqlite3ExprListDelete(pParse->db, pList);
161110 }
161111 if( yymsp[-3].minor.yy60 ) yymsp[-4].minor.yy602 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy602, 0);
161112 }
161113 break;
161114 case 215: /* expr ::= expr in_op LP exprlist RP */
161115 {
161116 if( yymsp[-1].minor.yy338==0 ){
161117 /* Expressions of the form
161118 **
161119 ** expr1 IN ()
161120 ** expr1 NOT IN ()
161121 **
161122 ** simplify to constants 0 (false) and 1 (true), respectively,
161123 ** regardless of the value of expr1.
161124 */
161125 sqlite3ExprUnmapAndDelete(pParse, yymsp[-4].minor.yy602);
161126 yymsp[-4].minor.yy602 = sqlite3Expr(pParse->db, TK_INTEGER, yymsp[-3].minor.yy60 ? "1" : "0");
161127 }else if( yymsp[-1].minor.yy338->nExpr==1 && sqlite3ExprIsConstant(yymsp[-1].minor.yy338->a[0].pExpr) ){
161128 Expr *pRHS = yymsp[-1].minor.yy338->a[0].pExpr;
161129 yymsp[-1].minor.yy338->a[0].pExpr = 0;
161130 sqlite3ExprListDelete(pParse->db, yymsp[-1].minor.yy338);
161131 pRHS = sqlite3PExpr(pParse, TK_UPLUS, pRHS, 0);
161132 yymsp[-4].minor.yy602 = sqlite3PExpr(pParse, TK_EQ, yymsp[-4].minor.yy602, pRHS);
161133 if( yymsp[-3].minor.yy60 ) yymsp[-4].minor.yy602 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy602, 0);
161134 }else{
161135 yymsp[-4].minor.yy602 = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy602, 0);
161136 if( yymsp[-4].minor.yy602 ){
161137 yymsp[-4].minor.yy602->x.pList = yymsp[-1].minor.yy338;
161138 sqlite3ExprSetHeightAndFlags(pParse, yymsp[-4].minor.yy602);
161139 }else{
161140 sqlite3ExprListDelete(pParse->db, yymsp[-1].minor.yy338);
161141 }
161142 if( yymsp[-3].minor.yy60 ) yymsp[-4].minor.yy602 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy602, 0);
161143 }
161144 }
161145 break;
161146 case 216: /* expr ::= LP select RP */
161147 {
161148 yymsp[-2].minor.yy602 = sqlite3PExpr(pParse, TK_SELECT, 0, 0);
161149 sqlite3PExprAddSelect(pParse, yymsp[-2].minor.yy602, yymsp[-1].minor.yy307);
161150 }
161151 break;
161152 case 217: /* expr ::= expr in_op LP select RP */
161153 {
161154 yymsp[-4].minor.yy602 = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy602, 0);
161155 sqlite3PExprAddSelect(pParse, yymsp[-4].minor.yy602, yymsp[-1].minor.yy307);
161156 if( yymsp[-3].minor.yy60 ) yymsp[-4].minor.yy602 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy602, 0);
161157 }
161158 break;
161159 case 218: /* expr ::= expr in_op nm dbnm paren_exprlist */
161160 {
161161 SrcList *pSrc = sqlite3SrcListAppend(pParse, 0,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0);
161162 Select *pSelect = sqlite3SelectNew(pParse, 0,pSrc,0,0,0,0,0,0);
161163 if( yymsp[0].minor.yy338 ) sqlite3SrcListFuncArgs(pParse, pSelect ? pSrc : 0, yymsp[0].minor.yy338);
161164 yymsp[-4].minor.yy602 = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy602, 0);
161165 sqlite3PExprAddSelect(pParse, yymsp[-4].minor.yy602, pSelect);
161166 if( yymsp[-3].minor.yy60 ) yymsp[-4].minor.yy602 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy602, 0);
161167 }
161168 break;
161169 case 219: /* expr ::= EXISTS LP select RP */
161170 {
161171 Expr *p;
161172 p = yymsp[-3].minor.yy602 = sqlite3PExpr(pParse, TK_EXISTS, 0, 0);
161173 sqlite3PExprAddSelect(pParse, p, yymsp[-1].minor.yy307);
161174 }
161175 break;
161176 case 220: /* expr ::= CASE case_operand case_exprlist case_else END */
161177 {
161178 yymsp[-4].minor.yy602 = sqlite3PExpr(pParse, TK_CASE, yymsp[-3].minor.yy602, 0);
161179 if( yymsp[-4].minor.yy602 ){
161180 yymsp[-4].minor.yy602->x.pList = yymsp[-1].minor.yy602 ? sqlite3ExprListAppend(pParse,yymsp[-2].minor.yy338,yymsp[-1].minor.yy602) : yymsp[-2].minor.yy338;
161181 sqlite3ExprSetHeightAndFlags(pParse, yymsp[-4].minor.yy602);
161182 }else{
161183 sqlite3ExprListDelete(pParse->db, yymsp[-2].minor.yy338);
161184 sqlite3ExprDelete(pParse->db, yymsp[-1].minor.yy602);
161185 }
161186 }
161187 break;
161188 case 221: /* case_exprlist ::= case_exprlist WHEN expr THEN expr */
161189 {
161190 yymsp[-4].minor.yy338 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy338, yymsp[-2].minor.yy602);
161191 yymsp[-4].minor.yy338 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy338, yymsp[0].minor.yy602);
161192 }
161193 break;
161194 case 222: /* case_exprlist ::= WHEN expr THEN expr */
161195 {
161196 yymsp[-3].minor.yy338 = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy602);
161197 yymsp[-3].minor.yy338 = sqlite3ExprListAppend(pParse,yymsp[-3].minor.yy338, yymsp[0].minor.yy602);
161198 }
161199 break;
161200 case 225: /* case_operand ::= expr */
161201 {yymsp[0].minor.yy602 = yymsp[0].minor.yy602; /*A-overwrites-X*/}
161202 break;
161203 case 228: /* nexprlist ::= nexprlist COMMA expr */
161204 {yymsp[-2].minor.yy338 = sqlite3ExprListAppend(pParse,yymsp[-2].minor.yy338,yymsp[0].minor.yy602);}
161205 break;
161206 case 229: /* nexprlist ::= expr */
161207 {yymsp[0].minor.yy338 = sqlite3ExprListAppend(pParse,0,yymsp[0].minor.yy602); /*A-overwrites-Y*/}
161208 break;
161209 case 231: /* paren_exprlist ::= LP exprlist RP */
161210 case 236: /* eidlist_opt ::= LP eidlist RP */ yytestcase(yyruleno==236);
161211 {yymsp[-2].minor.yy338 = yymsp[-1].minor.yy338;}
161212 break;
161213 case 232: /* cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP sortlist RP where_opt */
161214 {
161215 sqlite3CreateIndex(pParse, &yymsp[-7].minor.yy0, &yymsp[-6].minor.yy0,
161216 sqlite3SrcListAppend(pParse,0,&yymsp[-4].minor.yy0,0), yymsp[-2].minor.yy338, yymsp[-10].minor.yy60,
161217 &yymsp[-11].minor.yy0, yymsp[0].minor.yy602, SQLITE_SO_ASC, yymsp[-8].minor.yy60, SQLITE_IDXTYPE_APPDEF);
161218 if( IN_RENAME_OBJECT && pParse->pNewIndex ){
161219 sqlite3RenameTokenMap(pParse, pParse->pNewIndex->zName, &yymsp[-4].minor.yy0);
161220 }
161221 }
161222 break;
161223 case 233: /* uniqueflag ::= UNIQUE */
161224 case 275: /* raisetype ::= ABORT */ yytestcase(yyruleno==275);
161225 {yymsp[0].minor.yy60 = OE_Abort;}
161226 break;
161227 case 234: /* uniqueflag ::= */
161228 {yymsp[1].minor.yy60 = OE_None;}
161229 break;
161230 case 237: /* eidlist ::= eidlist COMMA nm collate sortorder */
161231 {
161232 yymsp[-4].minor.yy338 = parserAddExprIdListTerm(pParse, yymsp[-4].minor.yy338, &yymsp[-2].minor.yy0, yymsp[-1].minor.yy60, yymsp[0].minor.yy60);
161233 }
161234 break;
161235 case 238: /* eidlist ::= nm collate sortorder */
161236 {
161237 yymsp[-2].minor.yy338 = parserAddExprIdListTerm(pParse, 0, &yymsp[-2].minor.yy0, yymsp[-1].minor.yy60, yymsp[0].minor.yy60); /*A-overwrites-Y*/
161238 }
161239 break;
161240 case 241: /* cmd ::= DROP INDEX ifexists fullname */
161241 {sqlite3DropIndex(pParse, yymsp[0].minor.yy291, yymsp[-1].minor.yy60);}
161242 break;
161243 case 242: /* cmd ::= VACUUM vinto */
161244 {sqlite3Vacuum(pParse,0,yymsp[0].minor.yy602);}
161245 break;
161246 case 243: /* cmd ::= VACUUM nm vinto */
161247 {sqlite3Vacuum(pParse,&yymsp[-1].minor.yy0,yymsp[0].minor.yy602);}
161248 break;
161249 case 246: /* cmd ::= PRAGMA nm dbnm */
161250 {sqlite3Pragma(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,0,0);}
161251 break;
161252 case 247: /* cmd ::= PRAGMA nm dbnm EQ nmnum */
@@ -161095,54 +161264,54 @@
161264 case 253: /* cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END */
161265 {
161266 Token all;
161267 all.z = yymsp[-3].minor.yy0.z;
161268 all.n = (int)(yymsp[0].minor.yy0.z - yymsp[-3].minor.yy0.z) + yymsp[0].minor.yy0.n;
161269 sqlite3FinishTrigger(pParse, yymsp[-1].minor.yy483, &all);
161270 }
161271 break;
161272 case 254: /* trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause */
161273 {
161274 sqlite3BeginTrigger(pParse, &yymsp[-7].minor.yy0, &yymsp[-6].minor.yy0, yymsp[-5].minor.yy60, yymsp[-4].minor.yy50.a, yymsp[-4].minor.yy50.b, yymsp[-2].minor.yy291, yymsp[0].minor.yy602, yymsp[-10].minor.yy60, yymsp[-8].minor.yy60);
161275 yymsp[-10].minor.yy0 = (yymsp[-6].minor.yy0.n==0?yymsp[-7].minor.yy0:yymsp[-6].minor.yy0); /*A-overwrites-T*/
161276 }
161277 break;
161278 case 255: /* trigger_time ::= BEFORE|AFTER */
161279 { yymsp[0].minor.yy60 = yymsp[0].major; /*A-overwrites-X*/ }
161280 break;
161281 case 256: /* trigger_time ::= INSTEAD OF */
161282 { yymsp[-1].minor.yy60 = TK_INSTEAD;}
161283 break;
161284 case 257: /* trigger_time ::= */
161285 { yymsp[1].minor.yy60 = TK_BEFORE; }
161286 break;
161287 case 258: /* trigger_event ::= DELETE|INSERT */
161288 case 259: /* trigger_event ::= UPDATE */ yytestcase(yyruleno==259);
161289 {yymsp[0].minor.yy50.a = yymsp[0].major; /*A-overwrites-X*/ yymsp[0].minor.yy50.b = 0;}
161290 break;
161291 case 260: /* trigger_event ::= UPDATE OF idlist */
161292 {yymsp[-2].minor.yy50.a = TK_UPDATE; yymsp[-2].minor.yy50.b = yymsp[0].minor.yy288;}
161293 break;
161294 case 261: /* when_clause ::= */
161295 case 280: /* key_opt ::= */ yytestcase(yyruleno==280);
161296 { yymsp[1].minor.yy602 = 0; }
161297 break;
161298 case 262: /* when_clause ::= WHEN expr */
161299 case 281: /* key_opt ::= KEY expr */ yytestcase(yyruleno==281);
161300 { yymsp[-1].minor.yy602 = yymsp[0].minor.yy602; }
161301 break;
161302 case 263: /* trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI */
161303 {
161304 assert( yymsp[-2].minor.yy483!=0 );
161305 yymsp[-2].minor.yy483->pLast->pNext = yymsp[-1].minor.yy483;
161306 yymsp[-2].minor.yy483->pLast = yymsp[-1].minor.yy483;
161307 }
161308 break;
161309 case 264: /* trigger_cmd_list ::= trigger_cmd SEMI */
161310 {
161311 assert( yymsp[-1].minor.yy483!=0 );
161312 yymsp[-1].minor.yy483->pLast = yymsp[-1].minor.yy483;
161313 }
161314 break;
161315 case 265: /* trnm ::= nm DOT nm */
161316 {
161317 yymsp[-2].minor.yy0 = yymsp[0].minor.yy0;
@@ -161164,62 +161333,62 @@
161333 "the NOT INDEXED clause is not allowed on UPDATE or DELETE statements "
161334 "within triggers");
161335 }
161336 break;
161337 case 268: /* trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist from where_opt scanpt */
161338 {yylhsminor.yy483 = sqlite3TriggerUpdateStep(pParse, &yymsp[-6].minor.yy0, yymsp[-2].minor.yy291, yymsp[-3].minor.yy338, yymsp[-1].minor.yy602, yymsp[-7].minor.yy60, yymsp[-8].minor.yy0.z, yymsp[0].minor.yy528);}
161339 yymsp[-8].minor.yy483 = yylhsminor.yy483;
161340 break;
161341 case 269: /* trigger_cmd ::= scanpt insert_cmd INTO trnm idlist_opt select upsert scanpt */
161342 {
161343 yylhsminor.yy483 = sqlite3TriggerInsertStep(pParse,&yymsp[-4].minor.yy0,yymsp[-3].minor.yy288,yymsp[-2].minor.yy307,yymsp[-6].minor.yy60,yymsp[-1].minor.yy178,yymsp[-7].minor.yy528,yymsp[0].minor.yy528);/*yylhsminor.yy483-overwrites-yymsp[-6].minor.yy60*/
161344 }
161345 yymsp[-7].minor.yy483 = yylhsminor.yy483;
161346 break;
161347 case 270: /* trigger_cmd ::= DELETE FROM trnm tridxby where_opt scanpt */
161348 {yylhsminor.yy483 = sqlite3TriggerDeleteStep(pParse, &yymsp[-3].minor.yy0, yymsp[-1].minor.yy602, yymsp[-5].minor.yy0.z, yymsp[0].minor.yy528);}
161349 yymsp[-5].minor.yy483 = yylhsminor.yy483;
161350 break;
161351 case 271: /* trigger_cmd ::= scanpt select scanpt */
161352 {yylhsminor.yy483 = sqlite3TriggerSelectStep(pParse->db, yymsp[-1].minor.yy307, yymsp[-2].minor.yy528, yymsp[0].minor.yy528); /*yylhsminor.yy483-overwrites-yymsp[-1].minor.yy307*/}
161353 yymsp[-2].minor.yy483 = yylhsminor.yy483;
161354 break;
161355 case 272: /* expr ::= RAISE LP IGNORE RP */
161356 {
161357 yymsp[-3].minor.yy602 = sqlite3PExpr(pParse, TK_RAISE, 0, 0);
161358 if( yymsp[-3].minor.yy602 ){
161359 yymsp[-3].minor.yy602->affExpr = OE_Ignore;
161360 }
161361 }
161362 break;
161363 case 273: /* expr ::= RAISE LP raisetype COMMA nm RP */
161364 {
161365 yymsp[-5].minor.yy602 = sqlite3ExprAlloc(pParse->db, TK_RAISE, &yymsp[-1].minor.yy0, 1);
161366 if( yymsp[-5].minor.yy602 ) {
161367 yymsp[-5].minor.yy602->affExpr = (char)yymsp[-3].minor.yy60;
161368 }
161369 }
161370 break;
161371 case 274: /* raisetype ::= ROLLBACK */
161372 {yymsp[0].minor.yy60 = OE_Rollback;}
161373 break;
161374 case 276: /* raisetype ::= FAIL */
161375 {yymsp[0].minor.yy60 = OE_Fail;}
161376 break;
161377 case 277: /* cmd ::= DROP TRIGGER ifexists fullname */
161378 {
161379 sqlite3DropTrigger(pParse,yymsp[0].minor.yy291,yymsp[-1].minor.yy60);
161380 }
161381 break;
161382 case 278: /* cmd ::= ATTACH database_kw_opt expr AS expr key_opt */
161383 {
161384 sqlite3Attach(pParse, yymsp[-3].minor.yy602, yymsp[-1].minor.yy602, yymsp[0].minor.yy602);
161385 }
161386 break;
161387 case 279: /* cmd ::= DETACH database_kw_opt expr */
161388 {
161389 sqlite3Detach(pParse, yymsp[0].minor.yy602);
161390 }
161391 break;
161392 case 282: /* cmd ::= REINDEX */
161393 {sqlite3Reindex(pParse, 0, 0);}
161394 break;
@@ -161232,11 +161401,11 @@
161401 case 285: /* cmd ::= ANALYZE nm dbnm */
161402 {sqlite3Analyze(pParse, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0);}
161403 break;
161404 case 286: /* cmd ::= ALTER TABLE fullname RENAME TO nm */
161405 {
161406 sqlite3AlterRenameTable(pParse,yymsp[-3].minor.yy291,&yymsp[0].minor.yy0);
161407 }
161408 break;
161409 case 287: /* cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt columnname carglist */
161410 {
161411 yymsp[-1].minor.yy0.n = (int)(pParse->sLastToken.z-yymsp[-1].minor.yy0.z) + pParse->sLastToken.n;
@@ -161243,22 +161412,22 @@
161412 sqlite3AlterFinishAddColumn(pParse, &yymsp[-1].minor.yy0);
161413 }
161414 break;
161415 case 288: /* cmd ::= ALTER TABLE fullname DROP kwcolumn_opt nm */
161416 {
161417 sqlite3AlterDropColumn(pParse, yymsp[-3].minor.yy291, &yymsp[0].minor.yy0);
161418 }
161419 break;
161420 case 289: /* add_column_fullname ::= fullname */
161421 {
161422 disableLookaside(pParse);
161423 sqlite3AlterBeginAddColumn(pParse, yymsp[0].minor.yy291);
161424 }
161425 break;
161426 case 290: /* cmd ::= ALTER TABLE fullname RENAME kwcolumn_opt nm TO nm */
161427 {
161428 sqlite3AlterRenameColumn(pParse, yymsp[-5].minor.yy291, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0);
161429 }
161430 break;
161431 case 291: /* cmd ::= create_vtab */
161432 {sqlite3VtabFinishParse(pParse,0);}
161433 break;
@@ -161265,11 +161434,11 @@
161434 case 292: /* cmd ::= create_vtab LP vtabarglist RP */
161435 {sqlite3VtabFinishParse(pParse,&yymsp[0].minor.yy0);}
161436 break;
161437 case 293: /* create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm */
161438 {
161439 sqlite3VtabBeginParse(pParse, &yymsp[-3].minor.yy0, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-4].minor.yy60);
161440 }
161441 break;
161442 case 294: /* vtabarg ::= */
161443 {sqlite3VtabArgInit(pParse);}
161444 break;
@@ -161278,225 +161447,239 @@
161447 case 297: /* lp ::= LP */ yytestcase(yyruleno==297);
161448 {sqlite3VtabArgExtend(pParse,&yymsp[0].minor.yy0);}
161449 break;
161450 case 298: /* with ::= WITH wqlist */
161451 case 299: /* with ::= WITH RECURSIVE wqlist */ yytestcase(yyruleno==299);
161452 { sqlite3WithPush(pParse, yymsp[0].minor.yy195, 1); }
161453 break;
161454 case 300: /* wqas ::= AS */
161455 {yymsp[0].minor.yy570 = M10d_Any;}
161456 break;
161457 case 301: /* wqas ::= AS MATERIALIZED */
161458 {yymsp[-1].minor.yy570 = M10d_Yes;}
161459 break;
161460 case 302: /* wqas ::= AS NOT MATERIALIZED */
161461 {yymsp[-2].minor.yy570 = M10d_No;}
161462 break;
161463 case 303: /* wqitem ::= nm eidlist_opt wqas LP select RP */
161464 {
161465 yymsp[-5].minor.yy607 = sqlite3CteNew(pParse, &yymsp[-5].minor.yy0, yymsp[-4].minor.yy338, yymsp[-1].minor.yy307, yymsp[-3].minor.yy570); /*A-overwrites-X*/
161466 }
161467 break;
161468 case 304: /* wqlist ::= wqitem */
161469 {
161470 yymsp[0].minor.yy195 = sqlite3WithAdd(pParse, 0, yymsp[0].minor.yy607); /*A-overwrites-X*/
161471 }
161472 break;
161473 case 305: /* wqlist ::= wqlist COMMA wqitem */
161474 {
161475 yymsp[-2].minor.yy195 = sqlite3WithAdd(pParse, yymsp[-2].minor.yy195, yymsp[0].minor.yy607);
161476 }
161477 break;
161478 case 306: /* windowdefn_list ::= windowdefn */
161479 { yylhsminor.yy19 = yymsp[0].minor.yy19; }
161480 yymsp[0].minor.yy19 = yylhsminor.yy19;
161481 break;
161482 case 307: /* windowdefn_list ::= windowdefn_list COMMA windowdefn */
161483 {
161484 assert( yymsp[0].minor.yy19!=0 );
161485 sqlite3WindowChain(pParse, yymsp[0].minor.yy19, yymsp[-2].minor.yy19);
161486 yymsp[0].minor.yy19->pNextWin = yymsp[-2].minor.yy19;
161487 yylhsminor.yy19 = yymsp[0].minor.yy19;
161488 }
161489 yymsp[-2].minor.yy19 = yylhsminor.yy19;
161490 break;
161491 case 308: /* windowdefn ::= nm AS LP window RP */
161492 {
161493 if( ALWAYS(yymsp[-1].minor.yy19) ){
161494 yymsp[-1].minor.yy19->zName = sqlite3DbStrNDup(pParse->db, yymsp[-4].minor.yy0.z, yymsp[-4].minor.yy0.n);
161495 }
161496 yylhsminor.yy19 = yymsp[-1].minor.yy19;
161497 }
161498 yymsp[-4].minor.yy19 = yylhsminor.yy19;
161499 break;
161500 case 309: /* window ::= PARTITION BY nexprlist orderby_opt frame_opt */
161501 {
161502 yymsp[-4].minor.yy19 = sqlite3WindowAssemble(pParse, yymsp[0].minor.yy19, yymsp[-2].minor.yy338, yymsp[-1].minor.yy338, 0);
161503 }
161504 break;
161505 case 310: /* window ::= nm PARTITION BY nexprlist orderby_opt frame_opt */
161506 {
161507 yylhsminor.yy19 = sqlite3WindowAssemble(pParse, yymsp[0].minor.yy19, yymsp[-2].minor.yy338, yymsp[-1].minor.yy338, &yymsp[-5].minor.yy0);
161508 }
161509 yymsp[-5].minor.yy19 = yylhsminor.yy19;
161510 break;
161511 case 311: /* window ::= ORDER BY sortlist frame_opt */
161512 {
161513 yymsp[-3].minor.yy19 = sqlite3WindowAssemble(pParse, yymsp[0].minor.yy19, 0, yymsp[-1].minor.yy338, 0);
161514 }
161515 break;
161516 case 312: /* window ::= nm ORDER BY sortlist frame_opt */
161517 {
161518 yylhsminor.yy19 = sqlite3WindowAssemble(pParse, yymsp[0].minor.yy19, 0, yymsp[-1].minor.yy338, &yymsp[-4].minor.yy0);
161519 }
161520 yymsp[-4].minor.yy19 = yylhsminor.yy19;
161521 break;
161522 case 313: /* window ::= frame_opt */
161523 case 332: /* filter_over ::= over_clause */ yytestcase(yyruleno==332);
161524 {
161525 yylhsminor.yy19 = yymsp[0].minor.yy19;
161526 }
161527 yymsp[0].minor.yy19 = yylhsminor.yy19;
161528 break;
161529 case 314: /* window ::= nm frame_opt */
161530 {
161531 yylhsminor.yy19 = sqlite3WindowAssemble(pParse, yymsp[0].minor.yy19, 0, 0, &yymsp[-1].minor.yy0);
161532 }
161533 yymsp[-1].minor.yy19 = yylhsminor.yy19;
161534 break;
161535 case 315: /* frame_opt ::= */
161536 {
161537 yymsp[1].minor.yy19 = sqlite3WindowAlloc(pParse, 0, TK_UNBOUNDED, 0, TK_CURRENT, 0, 0);
161538 }
161539 break;
161540 case 316: /* frame_opt ::= range_or_rows frame_bound_s frame_exclude_opt */
161541 {
161542 yylhsminor.yy19 = sqlite3WindowAlloc(pParse, yymsp[-2].minor.yy60, yymsp[-1].minor.yy113.eType, yymsp[-1].minor.yy113.pExpr, TK_CURRENT, 0, yymsp[0].minor.yy570);
161543 }
161544 yymsp[-2].minor.yy19 = yylhsminor.yy19;
161545 break;
161546 case 317: /* frame_opt ::= range_or_rows BETWEEN frame_bound_s AND frame_bound_e frame_exclude_opt */
161547 {
161548 yylhsminor.yy19 = sqlite3WindowAlloc(pParse, yymsp[-5].minor.yy60, yymsp[-3].minor.yy113.eType, yymsp[-3].minor.yy113.pExpr, yymsp[-1].minor.yy113.eType, yymsp[-1].minor.yy113.pExpr, yymsp[0].minor.yy570);
161549 }
161550 yymsp[-5].minor.yy19 = yylhsminor.yy19;
161551 break;
161552 case 319: /* frame_bound_s ::= frame_bound */
161553 case 321: /* frame_bound_e ::= frame_bound */ yytestcase(yyruleno==321);
161554 {yylhsminor.yy113 = yymsp[0].minor.yy113;}
161555 yymsp[0].minor.yy113 = yylhsminor.yy113;
161556 break;
161557 case 320: /* frame_bound_s ::= UNBOUNDED PRECEDING */
161558 case 322: /* frame_bound_e ::= UNBOUNDED FOLLOWING */ yytestcase(yyruleno==322);
161559 case 324: /* frame_bound ::= CURRENT ROW */ yytestcase(yyruleno==324);
161560 {yylhsminor.yy113.eType = yymsp[-1].major; yylhsminor.yy113.pExpr = 0;}
161561 yymsp[-1].minor.yy113 = yylhsminor.yy113;
161562 break;
161563 case 323: /* frame_bound ::= expr PRECEDING|FOLLOWING */
161564 {yylhsminor.yy113.eType = yymsp[0].major; yylhsminor.yy113.pExpr = yymsp[-1].minor.yy602;}
161565 yymsp[-1].minor.yy113 = yylhsminor.yy113;
161566 break;
161567 case 325: /* frame_exclude_opt ::= */
161568 {yymsp[1].minor.yy570 = 0;}
161569 break;
161570 case 326: /* frame_exclude_opt ::= EXCLUDE frame_exclude */
161571 {yymsp[-1].minor.yy570 = yymsp[0].minor.yy570;}
161572 break;
161573 case 327: /* frame_exclude ::= NO OTHERS */
161574 case 328: /* frame_exclude ::= CURRENT ROW */ yytestcase(yyruleno==328);
161575 {yymsp[-1].minor.yy570 = yymsp[-1].major; /*A-overwrites-X*/}
161576 break;
161577 case 329: /* frame_exclude ::= GROUP|TIES */
161578 {yymsp[0].minor.yy570 = yymsp[0].major; /*A-overwrites-X*/}
161579 break;
161580 case 330: /* window_clause ::= WINDOW windowdefn_list */
161581 { yymsp[-1].minor.yy19 = yymsp[0].minor.yy19; }
161582 break;
161583 case 331: /* filter_over ::= filter_clause over_clause */
161584 {
161585 yymsp[0].minor.yy19->pFilter = yymsp[-1].minor.yy602;
161586 yylhsminor.yy19 = yymsp[0].minor.yy19;
161587 }
161588 yymsp[-1].minor.yy19 = yylhsminor.yy19;
161589 break;
161590 case 333: /* filter_over ::= filter_clause */
161591 {
161592 yylhsminor.yy19 = (Window*)sqlite3DbMallocZero(pParse->db, sizeof(Window));
161593 if( yylhsminor.yy19 ){
161594 yylhsminor.yy19->eFrmType = TK_FILTER;
161595 yylhsminor.yy19->pFilter = yymsp[0].minor.yy602;
161596 }else{
161597 sqlite3ExprDelete(pParse->db, yymsp[0].minor.yy602);
161598 }
161599 }
161600 yymsp[0].minor.yy19 = yylhsminor.yy19;
161601 break;
161602 case 334: /* over_clause ::= OVER LP window RP */
161603 {
161604 yymsp[-3].minor.yy19 = yymsp[-1].minor.yy19;
161605 assert( yymsp[-3].minor.yy19!=0 );
161606 }
161607 break;
161608 case 335: /* over_clause ::= OVER nm */
161609 {
161610 yymsp[-1].minor.yy19 = (Window*)sqlite3DbMallocZero(pParse->db, sizeof(Window));
161611 if( yymsp[-1].minor.yy19 ){
161612 yymsp[-1].minor.yy19->zName = sqlite3DbStrNDup(pParse->db, yymsp[0].minor.yy0.z, yymsp[0].minor.yy0.n);
161613 }
161614 }
161615 break;
161616 case 336: /* filter_clause ::= FILTER LP WHERE expr RP */
161617 { yymsp[-4].minor.yy602 = yymsp[-1].minor.yy602; }
161618 break;
161619 default:
161620 /* (337) input ::= cmdlist */ yytestcase(yyruleno==337);
161621 /* (338) cmdlist ::= cmdlist ecmd */ yytestcase(yyruleno==338);
161622 /* (339) cmdlist ::= ecmd (OPTIMIZED OUT) */ assert(yyruleno!=339);
161623 /* (340) ecmd ::= SEMI */ yytestcase(yyruleno==340);
161624 /* (341) ecmd ::= cmdx SEMI */ yytestcase(yyruleno==341);
161625 /* (342) ecmd ::= explain cmdx SEMI (NEVER REDUCES) */ assert(yyruleno!=342);
161626 /* (343) trans_opt ::= */ yytestcase(yyruleno==343);
161627 /* (344) trans_opt ::= TRANSACTION */ yytestcase(yyruleno==344);
161628 /* (345) trans_opt ::= TRANSACTION nm */ yytestcase(yyruleno==345);
161629 /* (346) savepoint_opt ::= SAVEPOINT */ yytestcase(yyruleno==346);
161630 /* (347) savepoint_opt ::= */ yytestcase(yyruleno==347);
161631 /* (348) cmd ::= create_table create_table_args */ yytestcase(yyruleno==348);
161632 /* (349) columnlist ::= columnlist COMMA columnname carglist */ yytestcase(yyruleno==349);
161633 /* (350) columnlist ::= columnname carglist */ yytestcase(yyruleno==350);
161634 /* (351) nm ::= ID|INDEXED */ yytestcase(yyruleno==351);
161635 /* (352) nm ::= STRING */ yytestcase(yyruleno==352);
161636 /* (353) nm ::= JOIN_KW */ yytestcase(yyruleno==353);
161637 /* (354) typetoken ::= typename */ yytestcase(yyruleno==354);
161638 /* (355) typename ::= ID|STRING */ yytestcase(yyruleno==355);
161639 /* (356) signed ::= plus_num (OPTIMIZED OUT) */ assert(yyruleno!=356);
161640 /* (357) signed ::= minus_num (OPTIMIZED OUT) */ assert(yyruleno!=357);
161641 /* (358) carglist ::= carglist ccons */ yytestcase(yyruleno==358);
161642 /* (359) carglist ::= */ yytestcase(yyruleno==359);
161643 /* (360) ccons ::= NULL onconf */ yytestcase(yyruleno==360);
161644 /* (361) ccons ::= GENERATED ALWAYS AS generated */ yytestcase(yyruleno==361);
161645 /* (362) ccons ::= AS generated */ yytestcase(yyruleno==362);
161646 /* (363) conslist_opt ::= COMMA conslist */ yytestcase(yyruleno==363);
161647 /* (364) conslist ::= conslist tconscomma tcons */ yytestcase(yyruleno==364);
161648 /* (365) conslist ::= tcons (OPTIMIZED OUT) */ assert(yyruleno!=365);
161649 /* (366) tconscomma ::= */ yytestcase(yyruleno==366);
161650 /* (367) defer_subclause_opt ::= defer_subclause (OPTIMIZED OUT) */ assert(yyruleno!=367);
161651 /* (368) resolvetype ::= raisetype (OPTIMIZED OUT) */ assert(yyruleno!=368);
161652 /* (369) selectnowith ::= oneselect (OPTIMIZED OUT) */ assert(yyruleno!=369);
161653 /* (370) oneselect ::= values */ yytestcase(yyruleno==370);
161654 /* (371) sclp ::= selcollist COMMA */ yytestcase(yyruleno==371);
161655 /* (372) as ::= ID|STRING */ yytestcase(yyruleno==372);
161656 /* (373) returning ::= */ yytestcase(yyruleno==373);
161657 /* (374) expr ::= term (OPTIMIZED OUT) */ assert(yyruleno!=374);
161658 /* (375) likeop ::= LIKE_KW|MATCH */ yytestcase(yyruleno==375);
161659 /* (376) exprlist ::= nexprlist */ yytestcase(yyruleno==376);
161660 /* (377) nmnum ::= plus_num (OPTIMIZED OUT) */ assert(yyruleno!=377);
161661 /* (378) nmnum ::= nm (OPTIMIZED OUT) */ assert(yyruleno!=378);
161662 /* (379) nmnum ::= ON */ yytestcase(yyruleno==379);
161663 /* (380) nmnum ::= DELETE */ yytestcase(yyruleno==380);
161664 /* (381) nmnum ::= DEFAULT */ yytestcase(yyruleno==381);
161665 /* (382) plus_num ::= INTEGER|FLOAT */ yytestcase(yyruleno==382);
161666 /* (383) foreach_clause ::= */ yytestcase(yyruleno==383);
161667 /* (384) foreach_clause ::= FOR EACH ROW */ yytestcase(yyruleno==384);
161668 /* (385) trnm ::= nm */ yytestcase(yyruleno==385);
161669 /* (386) tridxby ::= */ yytestcase(yyruleno==386);
161670 /* (387) database_kw_opt ::= DATABASE */ yytestcase(yyruleno==387);
161671 /* (388) database_kw_opt ::= */ yytestcase(yyruleno==388);
161672 /* (389) kwcolumn_opt ::= */ yytestcase(yyruleno==389);
161673 /* (390) kwcolumn_opt ::= COLUMNKW */ yytestcase(yyruleno==390);
161674 /* (391) vtabarglist ::= vtabarg */ yytestcase(yyruleno==391);
161675 /* (392) vtabarglist ::= vtabarglist COMMA vtabarg */ yytestcase(yyruleno==392);
161676 /* (393) vtabarg ::= vtabarg vtabargtoken */ yytestcase(yyruleno==393);
161677 /* (394) anylist ::= */ yytestcase(yyruleno==394);
161678 /* (395) anylist ::= anylist LP anylist RP */ yytestcase(yyruleno==395);
161679 /* (396) anylist ::= anylist ANY */ yytestcase(yyruleno==396);
161680 /* (397) with ::= */ yytestcase(yyruleno==397);
161681 break;
161682 /********** End reduce actions ************************************************/
161683 };
161684 assert( yyruleno<sizeof(yyRuleInfoLhs)/sizeof(yyRuleInfoLhs[0]) );
161685 yygoto = yyRuleInfoLhs[yyruleno];
@@ -161999,25 +162182,25 @@
162182 ** might be implemented more directly using a hand-written hash table.
162183 ** But by using this automatically generated code, the size of the code
162184 ** is substantially reduced. This is important for embedded applications
162185 ** on platforms with limited memory.
162186 */
162187 /* Hash score: 231 */
162188 /* zKWText[] encodes 1007 bytes of keyword text in 667 bytes */
162189 /* REINDEXEDESCAPEACHECKEYBEFOREIGNOREGEXPLAINSTEADDATABASELECT */
162190 /* ABLEFTHENDEFERRABLELSEXCLUDELETEMPORARYISNULLSAVEPOINTERSECT */
162191 /* IESNOTNULLIKEXCEPTRANSACTIONATURALTERAISEXCLUSIVEXISTS */
162192 /* CONSTRAINTOFFSETRIGGERANGENERATEDETACHAVINGLOBEGINNEREFERENCES */
162193 /* UNIQUERYWITHOUTERELEASEATTACHBETWEENOTHINGROUPSCASCADEFAULT */
162194 /* CASECOLLATECREATECURRENT_DATEIMMEDIATEJOINSERTMATCHPLANALYZE */
162195 /* PRAGMATERIALIZEDEFERREDISTINCTUPDATEVALUESVIRTUALWAYSWHENWHERE */
162196 /* CURSIVEABORTAFTERENAMEANDROPARTITIONAUTOINCREMENTCASTCOLUMN */
162197 /* COMMITCONFLICTCROSSCURRENT_TIMESTAMPRECEDINGFAILASTFILTER */
162198 /* EPLACEFIRSTFOLLOWINGFROMFULLIMITIFORDERESTRICTOTHERSOVER */
162199 /* ETURNINGRIGHTROLLBACKROWSUNBOUNDEDUNIONUSINGVACUUMVIEWINDOWBY */
162200 /* INITIALLYPRIMARY */
162201 static const char zKWText[666] = {
162202 'R','E','I','N','D','E','X','E','D','E','S','C','A','P','E','A','C','H',
162203 'E','C','K','E','Y','B','E','F','O','R','E','I','G','N','O','R','E','G',
162204 'E','X','P','L','A','I','N','S','T','E','A','D','D','A','T','A','B','A',
162205 'S','E','L','E','C','T','A','B','L','E','F','T','H','E','N','D','E','F',
162206 'E','R','R','A','B','L','E','L','S','E','X','C','L','U','D','E','L','E',
@@ -162034,91 +162217,91 @@
162217 'E','N','O','T','H','I','N','G','R','O','U','P','S','C','A','S','C','A',
162218 'D','E','F','A','U','L','T','C','A','S','E','C','O','L','L','A','T','E',
162219 'C','R','E','A','T','E','C','U','R','R','E','N','T','_','D','A','T','E',
162220 'I','M','M','E','D','I','A','T','E','J','O','I','N','S','E','R','T','M',
162221 'A','T','C','H','P','L','A','N','A','L','Y','Z','E','P','R','A','G','M',
162222 'A','T','E','R','I','A','L','I','Z','E','D','E','F','E','R','R','E','D',
162223 'I','S','T','I','N','C','T','U','P','D','A','T','E','V','A','L','U','E',
162224 'S','V','I','R','T','U','A','L','W','A','Y','S','W','H','E','N','W','H',
162225 'E','R','E','C','U','R','S','I','V','E','A','B','O','R','T','A','F','T',
162226 'E','R','E','N','A','M','E','A','N','D','R','O','P','A','R','T','I','T',
162227 'I','O','N','A','U','T','O','I','N','C','R','E','M','E','N','T','C','A',
162228 'S','T','C','O','L','U','M','N','C','O','M','M','I','T','C','O','N','F',
162229 'L','I','C','T','C','R','O','S','S','C','U','R','R','E','N','T','_','T',
162230 'I','M','E','S','T','A','M','P','R','E','C','E','D','I','N','G','F','A',
162231 'I','L','A','S','T','F','I','L','T','E','R','E','P','L','A','C','E','F',
162232 'I','R','S','T','F','O','L','L','O','W','I','N','G','F','R','O','M','F',
162233 'U','L','L','I','M','I','T','I','F','O','R','D','E','R','E','S','T','R',
162234 'I','C','T','O','T','H','E','R','S','O','V','E','R','E','T','U','R','N',
162235 'I','N','G','R','I','G','H','T','R','O','L','L','B','A','C','K','R','O',
162236 'W','S','U','N','B','O','U','N','D','E','D','U','N','I','O','N','U','S',
162237 'I','N','G','V','A','C','U','U','M','V','I','E','W','I','N','D','O','W',
162238 'B','Y','I','N','I','T','I','A','L','L','Y','P','R','I','M','A','R','Y',
162239 };
162240 /* aKWHash[i] is the hash value for the i-th keyword */
162241 static const unsigned char aKWHash[127] = {
162242 84, 92, 134, 82, 105, 29, 0, 0, 94, 0, 85, 72, 0,
162243 53, 35, 86, 15, 0, 42, 97, 54, 89, 135, 19, 0, 0,
162244 140, 0, 40, 129, 0, 22, 107, 0, 9, 0, 0, 123, 80,
162245 0, 78, 6, 0, 65, 103, 147, 0, 136, 115, 0, 0, 48,
162246 0, 90, 24, 0, 17, 0, 27, 70, 23, 26, 5, 60, 142,
162247 110, 122, 0, 73, 91, 71, 145, 61, 120, 74, 0, 49, 0,
162248 11, 41, 0, 113, 0, 0, 0, 109, 10, 111, 116, 125, 14,
162249 50, 124, 0, 100, 0, 18, 121, 144, 56, 130, 139, 88, 83,
162250 37, 30, 126, 0, 0, 108, 51, 131, 128, 0, 34, 0, 0,
162251 132, 0, 98, 38, 39, 0, 20, 45, 117, 93,
162252 };
162253 /* aKWNext[] forms the hash collision chain. If aKWHash[i]==0
162254 ** then the i-th keyword has no more hash collisions. Otherwise,
162255 ** the next keyword with the same hash is aKWHash[i]-1. */
162256 static const unsigned char aKWNext[147] = {
162257 0, 0, 0, 0, 4, 0, 43, 0, 0, 106, 114, 0, 0,
162258 0, 2, 0, 0, 143, 0, 0, 0, 13, 0, 0, 0, 0,
162259 141, 0, 0, 119, 52, 0, 0, 137, 12, 0, 0, 62, 0,
162260 138, 0, 133, 0, 0, 36, 0, 0, 28, 77, 0, 0, 0,
162261 0, 59, 0, 47, 0, 0, 0, 0, 0, 0, 0, 0, 0,
162262 0, 69, 0, 0, 0, 0, 0, 146, 3, 0, 58, 0, 1,
162263 75, 0, 0, 0, 31, 0, 0, 0, 0, 0, 127, 0, 104,
162264 0, 64, 66, 63, 0, 0, 0, 0, 0, 46, 0, 16, 8,
162265 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 81, 101, 0,
162266 112, 21, 7, 67, 0, 79, 96, 118, 0, 0, 68, 0, 0,
162267 99, 44, 0, 55, 0, 76, 0, 95, 32, 33, 57, 25, 0,
162268 102, 0, 0, 87,
162269 };
162270 /* aKWLen[i] is the length (in bytes) of the i-th keyword */
162271 static const unsigned char aKWLen[147] = {
162272 7, 7, 5, 4, 6, 4, 5, 3, 6, 7, 3, 6, 6,
162273 7, 7, 3, 8, 2, 6, 5, 4, 4, 3, 10, 4, 7,
162274 6, 9, 4, 2, 6, 5, 9, 9, 4, 7, 3, 2, 4,
162275 4, 6, 11, 6, 2, 7, 5, 5, 9, 6, 10, 4, 6,
162276 2, 3, 7, 5, 9, 6, 6, 4, 5, 5, 10, 6, 5,
162277 7, 4, 5, 7, 6, 7, 7, 6, 5, 7, 3, 7, 4,
162278 7, 6, 12, 9, 4, 6, 5, 4, 7, 6, 12, 8, 8,
162279 2, 6, 6, 7, 6, 4, 5, 9, 5, 5, 6, 3, 4,
162280 9, 13, 2, 2, 4, 6, 6, 8, 5, 17, 12, 7, 9,
162281 4, 4, 6, 7, 5, 9, 4, 4, 5, 2, 5, 8, 6,
162282 4, 9, 5, 8, 4, 3, 9, 5, 5, 6, 4, 6, 2,
162283 2, 9, 3, 7,
162284 };
162285 /* aKWOffset[i] is the index into zKWText[] of the start of
162286 ** the text for the i-th keyword. */
162287 static const unsigned short int aKWOffset[147] = {
162288 0, 2, 2, 8, 9, 14, 16, 20, 23, 25, 25, 29, 33,
162289 36, 41, 46, 48, 53, 54, 59, 62, 65, 67, 69, 78, 81,
162290 86, 90, 90, 94, 99, 101, 105, 111, 119, 123, 123, 123, 126,
162291 129, 132, 137, 142, 146, 147, 152, 156, 160, 168, 174, 181, 184,
162292 184, 187, 189, 195, 198, 206, 211, 216, 219, 222, 226, 236, 239,
162293 244, 244, 248, 252, 259, 265, 271, 277, 277, 283, 284, 288, 295,
162294 299, 306, 312, 324, 333, 335, 341, 346, 348, 355, 359, 370, 377,
162295 378, 385, 391, 397, 402, 408, 412, 415, 424, 429, 433, 439, 441,
162296 444, 453, 455, 457, 466, 470, 476, 482, 490, 495, 495, 495, 511,
162297 520, 523, 527, 532, 539, 544, 553, 557, 560, 565, 567, 571, 579,
162298 585, 588, 597, 602, 610, 610, 614, 623, 628, 633, 639, 642, 645,
162299 648, 650, 655, 659,
162300 };
162301 /* aKWCode[i] is the parser symbol code for the i-th keyword */
162302 static const unsigned char aKWCode[147] = {
162303 TK_REINDEX, TK_INDEXED, TK_INDEX, TK_DESC, TK_ESCAPE,
162304 TK_EACH, TK_CHECK, TK_KEY, TK_BEFORE, TK_FOREIGN,
162305 TK_FOR, TK_IGNORE, TK_LIKE_KW, TK_EXPLAIN, TK_INSTEAD,
162306 TK_ADD, TK_DATABASE, TK_AS, TK_SELECT, TK_TABLE,
162307 TK_JOIN_KW, TK_THEN, TK_END, TK_DEFERRABLE, TK_ELSE,
@@ -162132,23 +162315,23 @@
162315 TK_BEGIN, TK_JOIN_KW, TK_REFERENCES, TK_UNIQUE, TK_QUERY,
162316 TK_WITHOUT, TK_WITH, TK_JOIN_KW, TK_RELEASE, TK_ATTACH,
162317 TK_BETWEEN, TK_NOTHING, TK_GROUPS, TK_GROUP, TK_CASCADE,
162318 TK_ASC, TK_DEFAULT, TK_CASE, TK_COLLATE, TK_CREATE,
162319 TK_CTIME_KW, TK_IMMEDIATE, TK_JOIN, TK_INSERT, TK_MATCH,
162320 TK_PLAN, TK_ANALYZE, TK_PRAGMA, TK_MATERIALIZED, TK_DEFERRED,
162321 TK_DISTINCT, TK_IS, TK_UPDATE, TK_VALUES, TK_VIRTUAL,
162322 TK_ALWAYS, TK_WHEN, TK_WHERE, TK_RECURSIVE, TK_ABORT,
162323 TK_AFTER, TK_RENAME, TK_AND, TK_DROP, TK_PARTITION,
162324 TK_AUTOINCR, TK_TO, TK_IN, TK_CAST, TK_COLUMNKW,
162325 TK_COMMIT, TK_CONFLICT, TK_JOIN_KW, TK_CTIME_KW, TK_CTIME_KW,
162326 TK_CURRENT, TK_PRECEDING, TK_FAIL, TK_LAST, TK_FILTER,
162327 TK_REPLACE, TK_FIRST, TK_FOLLOWING, TK_FROM, TK_JOIN_KW,
162328 TK_LIMIT, TK_IF, TK_ORDER, TK_RESTRICT, TK_OTHERS,
162329 TK_OVER, TK_RETURNING, TK_JOIN_KW, TK_ROLLBACK, TK_ROWS,
162330 TK_ROW, TK_UNBOUNDED, TK_UNION, TK_USING, TK_VACUUM,
162331 TK_VIEW, TK_WINDOW, TK_DO, TK_BY, TK_INITIALLY,
162332 TK_ALL, TK_PRIMARY,
162333 };
162334 /* Hash table decoded:
162335 ** 0: INSERT
162336 ** 1: IS
162337 ** 2: ROLLBACK TRIGGER
@@ -162168,11 +162351,11 @@
162351 ** 16: INSTEAD INDEXED
162352 ** 17:
162353 ** 18: TRANSACTION RIGHT
162354 ** 19: WHEN
162355 ** 20: SET HAVING
162356 ** 21: MATERIALIZED IF
162357 ** 22: ROWS
162358 ** 23: SELECT
162359 ** 24:
162360 ** 25:
162361 ** 26: VACUUM SAVEPOINT
@@ -162387,68 +162570,69 @@
162570 testcase( i==83 ); /* INSERT */
162571 testcase( i==84 ); /* MATCH */
162572 testcase( i==85 ); /* PLAN */
162573 testcase( i==86 ); /* ANALYZE */
162574 testcase( i==87 ); /* PRAGMA */
162575 testcase( i==88 ); /* MATERIALIZED */
162576 testcase( i==89 ); /* DEFERRED */
162577 testcase( i==90 ); /* DISTINCT */
162578 testcase( i==91 ); /* IS */
162579 testcase( i==92 ); /* UPDATE */
162580 testcase( i==93 ); /* VALUES */
162581 testcase( i==94 ); /* VIRTUAL */
162582 testcase( i==95 ); /* ALWAYS */
162583 testcase( i==96 ); /* WHEN */
162584 testcase( i==97 ); /* WHERE */
162585 testcase( i==98 ); /* RECURSIVE */
162586 testcase( i==99 ); /* ABORT */
162587 testcase( i==100 ); /* AFTER */
162588 testcase( i==101 ); /* RENAME */
162589 testcase( i==102 ); /* AND */
162590 testcase( i==103 ); /* DROP */
162591 testcase( i==104 ); /* PARTITION */
162592 testcase( i==105 ); /* AUTOINCREMENT */
162593 testcase( i==106 ); /* TO */
162594 testcase( i==107 ); /* IN */
162595 testcase( i==108 ); /* CAST */
162596 testcase( i==109 ); /* COLUMN */
162597 testcase( i==110 ); /* COMMIT */
162598 testcase( i==111 ); /* CONFLICT */
162599 testcase( i==112 ); /* CROSS */
162600 testcase( i==113 ); /* CURRENT_TIMESTAMP */
162601 testcase( i==114 ); /* CURRENT_TIME */
162602 testcase( i==115 ); /* CURRENT */
162603 testcase( i==116 ); /* PRECEDING */
162604 testcase( i==117 ); /* FAIL */
162605 testcase( i==118 ); /* LAST */
162606 testcase( i==119 ); /* FILTER */
162607 testcase( i==120 ); /* REPLACE */
162608 testcase( i==121 ); /* FIRST */
162609 testcase( i==122 ); /* FOLLOWING */
162610 testcase( i==123 ); /* FROM */
162611 testcase( i==124 ); /* FULL */
162612 testcase( i==125 ); /* LIMIT */
162613 testcase( i==126 ); /* IF */
162614 testcase( i==127 ); /* ORDER */
162615 testcase( i==128 ); /* RESTRICT */
162616 testcase( i==129 ); /* OTHERS */
162617 testcase( i==130 ); /* OVER */
162618 testcase( i==131 ); /* RETURNING */
162619 testcase( i==132 ); /* RIGHT */
162620 testcase( i==133 ); /* ROLLBACK */
162621 testcase( i==134 ); /* ROWS */
162622 testcase( i==135 ); /* ROW */
162623 testcase( i==136 ); /* UNBOUNDED */
162624 testcase( i==137 ); /* UNION */
162625 testcase( i==138 ); /* USING */
162626 testcase( i==139 ); /* VACUUM */
162627 testcase( i==140 ); /* VIEW */
162628 testcase( i==141 ); /* WINDOW */
162629 testcase( i==142 ); /* DO */
162630 testcase( i==143 ); /* BY */
162631 testcase( i==144 ); /* INITIALLY */
162632 testcase( i==145 ); /* ALL */
162633 testcase( i==146 ); /* PRIMARY */
162634 *pType = aKWCode[i];
162635 break;
162636 }
162637 }
162638 return n;
@@ -162456,11 +162640,11 @@
162640 SQLITE_PRIVATE int sqlite3KeywordCode(const unsigned char *z, int n){
162641 int id = TK_ID;
162642 keywordCode((char*)z, n, &id);
162643 return id;
162644 }
162645 #define SQLITE_N_KEYWORD 147
162646 SQLITE_API int sqlite3_keyword_name(int i,const char **pzName,int *pnName){
162647 if( i<0 || i>=SQLITE_N_KEYWORD ) return SQLITE_ERROR;
162648 *pzName = zKWText + aKWOffset[i];
162649 *pnName = aKWLen[i];
162650 return SQLITE_OK;
@@ -184069,27 +184253,31 @@
184253 if( pNode->block.a){
184254 rc = nodeReaderInit(&reader, pNode->block.a, pNode->block.n);
184255 while( reader.aNode && rc==SQLITE_OK ) rc = nodeReaderNext(&reader);
184256 blobGrowBuffer(&pNode->key, reader.term.n, &rc);
184257 if( rc==SQLITE_OK ){
184258 if( reader.term.n<=0 ){
184259 rc = FTS_CORRUPT_VTAB;
184260 }else{
184261 memcpy(pNode->key.a, reader.term.a, reader.term.n);
184262 pNode->key.n = reader.term.n;
184263 if( i>0 ){
184264 char *aBlock = 0;
184265 int nBlock = 0;
184266 pNode = &pWriter->aNodeWriter[i-1];
184267 pNode->iBlock = reader.iChild;
184268 rc = sqlite3Fts3ReadBlock(p, reader.iChild, &aBlock, &nBlock,0);
184269 blobGrowBuffer(&pNode->block,
184270 MAX(nBlock, p->nNodeSize)+FTS3_NODE_PADDING, &rc
184271 );
184272 if( rc==SQLITE_OK ){
184273 memcpy(pNode->block.a, aBlock, nBlock);
184274 pNode->block.n = nBlock;
184275 memset(&pNode->block.a[nBlock], 0, FTS3_NODE_PADDING);
184276 }
184277 sqlite3_free(aBlock);
184278 }
184279 }
184280 }
184281 }
184282 nodeReaderRelease(&reader);
184283 }
@@ -205169,10 +205357,11 @@
205357 struct sqlite3_changeset_iter {
205358 SessionInput in; /* Input buffer or stream */
205359 SessionBuffer tblhdr; /* Buffer to hold apValue/zTab/abPK/ */
205360 int bPatchset; /* True if this is a patchset */
205361 int bInvert; /* True to invert changeset */
205362 int bSkipEmpty; /* Skip noop UPDATE changes */
205363 int rc; /* Iterator error code */
205364 sqlite3_stmt *pConflict; /* Points to conflicting row, if any */
205365 char *zTab; /* Current table */
205366 int nCol; /* Number of columns in zTab */
205367 int op; /* Current operation */
@@ -207698,11 +207887,12 @@
207887 sqlite3_changeset_iter **pp, /* OUT: Changeset iterator handle */
207888 int (*xInput)(void *pIn, void *pData, int *pnData),
207889 void *pIn,
207890 int nChangeset, /* Size of buffer pChangeset in bytes */
207891 void *pChangeset, /* Pointer to buffer containing changeset */
207892 int bInvert, /* True to invert changeset */
207893 int bSkipEmpty /* True to skip empty UPDATE changes */
207894 ){
207895 sqlite3_changeset_iter *pRet; /* Iterator to return */
207896 int nByte; /* Number of bytes to allocate for iterator */
207897
207898 assert( xInput==0 || (pChangeset==0 && nChangeset==0) );
@@ -207719,10 +207909,11 @@
207909 pRet->in.nData = nChangeset;
207910 pRet->in.xInput = xInput;
207911 pRet->in.pIn = pIn;
207912 pRet->in.bEof = (xInput ? 0 : 1);
207913 pRet->bInvert = bInvert;
207914 pRet->bSkipEmpty = bSkipEmpty;
207915
207916 /* Populate the output variable and return success. */
207917 *pp = pRet;
207918 return SQLITE_OK;
207919 }
@@ -207733,20 +207924,20 @@
207924 SQLITE_API int sqlite3changeset_start(
207925 sqlite3_changeset_iter **pp, /* OUT: Changeset iterator handle */
207926 int nChangeset, /* Size of buffer pChangeset in bytes */
207927 void *pChangeset /* Pointer to buffer containing changeset */
207928 ){
207929 return sessionChangesetStart(pp, 0, 0, nChangeset, pChangeset, 0, 0);
207930 }
207931 SQLITE_API int sqlite3changeset_start_v2(
207932 sqlite3_changeset_iter **pp, /* OUT: Changeset iterator handle */
207933 int nChangeset, /* Size of buffer pChangeset in bytes */
207934 void *pChangeset, /* Pointer to buffer containing changeset */
207935 int flags
207936 ){
207937 int bInvert = !!(flags & SQLITE_CHANGESETSTART_INVERT);
207938 return sessionChangesetStart(pp, 0, 0, nChangeset, pChangeset, bInvert, 0);
207939 }
207940
207941 /*
207942 ** Streaming version of sqlite3changeset_start().
207943 */
@@ -207753,20 +207944,20 @@
207944 SQLITE_API int sqlite3changeset_start_strm(
207945 sqlite3_changeset_iter **pp, /* OUT: Changeset iterator handle */
207946 int (*xInput)(void *pIn, void *pData, int *pnData),
207947 void *pIn
207948 ){
207949 return sessionChangesetStart(pp, xInput, pIn, 0, 0, 0, 0);
207950 }
207951 SQLITE_API int sqlite3changeset_start_v2_strm(
207952 sqlite3_changeset_iter **pp, /* OUT: Changeset iterator handle */
207953 int (*xInput)(void *pIn, void *pData, int *pnData),
207954 void *pIn,
207955 int flags
207956 ){
207957 int bInvert = !!(flags & SQLITE_CHANGESETSTART_INVERT);
207958 return sessionChangesetStart(pp, xInput, pIn, 0, 0, bInvert, 0);
207959 }
207960
207961 /*
207962 ** If the SessionInput object passed as the only argument is a streaming
207963 ** object and the buffer is full, discard some data to free up space.
@@ -207888,15 +208079,18 @@
208079 */
208080 static int sessionReadRecord(
208081 SessionInput *pIn, /* Input data */
208082 int nCol, /* Number of values in record */
208083 u8 *abPK, /* Array of primary key flags, or NULL */
208084 sqlite3_value **apOut, /* Write values to this array */
208085 int *pbEmpty
208086 ){
208087 int i; /* Used to iterate through columns */
208088 int rc = SQLITE_OK;
208089
208090 assert( pbEmpty==0 || *pbEmpty==0 );
208091 if( pbEmpty ) *pbEmpty = 1;
208092 for(i=0; i<nCol && rc==SQLITE_OK; i++){
208093 int eType = 0; /* Type of value (SQLITE_NULL, TEXT etc.) */
208094 if( abPK && abPK[i]==0 ) continue;
208095 rc = sessionInputBuffer(pIn, 9);
208096 if( rc==SQLITE_OK ){
@@ -207904,10 +208098,11 @@
208098 rc = SQLITE_CORRUPT_BKPT;
208099 }else{
208100 eType = pIn->aData[pIn->iNext++];
208101 assert( apOut[i]==0 );
208102 if( eType ){
208103 if( pbEmpty ) *pbEmpty = 0;
208104 apOut[i] = sqlite3ValueNew(0);
208105 if( !apOut[i] ) rc = SQLITE_NOMEM;
208106 }
208107 }
208108 }
@@ -208083,35 +208278,31 @@
208278 }
208279 return (p->rc = rc);
208280 }
208281
208282 /*
208283 ** Advance the changeset iterator to the next change. The differences between
208284 ** this function and sessionChangesetNext() are that
208285 **
208286 ** * If pbEmpty is not NULL and the change is a no-op UPDATE (an UPDATE
208287 ** that modifies no columns), this function sets (*pbEmpty) to 1.
208288 **
208289 ** * If the iterator is configured to skip no-op UPDATEs,
208290 ** sessionChangesetNext() does that. This function does not.
208291 */
208292 static int sessionChangesetNextOne(
 
 
 
 
 
 
208293 sqlite3_changeset_iter *p, /* Changeset iterator */
208294 u8 **paRec, /* If non-NULL, store record pointer here */
208295 int *pnRec, /* If non-NULL, store size of record here */
208296 int *pbNew, /* If non-NULL, true if new table */
208297 int *pbEmpty
208298 ){
208299 int i;
208300 u8 op;
208301
208302 assert( (paRec==0 && pnRec==0) || (paRec && pnRec) );
208303 assert( pbEmpty==0 || *pbEmpty==0 );
208304
208305 /* If the iterator is in the error-state, return immediately. */
208306 if( p->rc!=SQLITE_OK ) return p->rc;
208307
208308 /* Free the current contents of p->apValue[], if any. */
@@ -208180,17 +208371,17 @@
208371 sqlite3_value **apNew = (p->bInvert ? p->apValue : &p->apValue[p->nCol]);
208372
208373 /* If this is an UPDATE or DELETE, read the old.* record. */
208374 if( p->op!=SQLITE_INSERT && (p->bPatchset==0 || p->op==SQLITE_DELETE) ){
208375 u8 *abPK = p->bPatchset ? p->abPK : 0;
208376 p->rc = sessionReadRecord(&p->in, p->nCol, abPK, apOld, 0);
208377 if( p->rc!=SQLITE_OK ) return p->rc;
208378 }
208379
208380 /* If this is an INSERT or UPDATE, read the new.* record. */
208381 if( p->op!=SQLITE_DELETE ){
208382 p->rc = sessionReadRecord(&p->in, p->nCol, 0, apNew, pbEmpty);
208383 if( p->rc!=SQLITE_OK ) return p->rc;
208384 }
208385
208386 if( (p->bPatchset || p->bInvert) && p->op==SQLITE_UPDATE ){
208387 /* If this is an UPDATE that is part of a patchset, then all PK and
@@ -208212,10 +208403,41 @@
208403 }
208404 }
208405
208406 return SQLITE_ROW;
208407 }
208408
208409 /*
208410 ** Advance the changeset iterator to the next change.
208411 **
208412 ** If both paRec and pnRec are NULL, then this function works like the public
208413 ** API sqlite3changeset_next(). If SQLITE_ROW is returned, then the
208414 ** sqlite3changeset_new() and old() APIs may be used to query for values.
208415 **
208416 ** Otherwise, if paRec and pnRec are not NULL, then a pointer to the change
208417 ** record is written to *paRec before returning and the number of bytes in
208418 ** the record to *pnRec.
208419 **
208420 ** Either way, this function returns SQLITE_ROW if the iterator is
208421 ** successfully advanced to the next change in the changeset, an SQLite
208422 ** error code if an error occurs, or SQLITE_DONE if there are no further
208423 ** changes in the changeset.
208424 */
208425 static int sessionChangesetNext(
208426 sqlite3_changeset_iter *p, /* Changeset iterator */
208427 u8 **paRec, /* If non-NULL, store record pointer here */
208428 int *pnRec, /* If non-NULL, store size of record here */
208429 int *pbNew /* If non-NULL, true if new table */
208430 ){
208431 int bEmpty;
208432 int rc;
208433 do {
208434 bEmpty = 0;
208435 rc = sessionChangesetNextOne(p, paRec, pnRec, pbNew, &bEmpty);
208436 }while( rc==SQLITE_ROW && p->bSkipEmpty && bEmpty);
208437 return rc;
208438 }
208439
208440 /*
208441 ** Advance an iterator created by sqlite3changeset_start() to the next
208442 ** change in the changeset. This function may return SQLITE_ROW, SQLITE_DONE
208443 ** or SQLITE_CORRUPT.
@@ -208485,13 +208707,13 @@
208707 sessionAppendByte(&sOut, eType, &rc);
208708 sessionAppendByte(&sOut, pInput->aData[pInput->iNext+1], &rc);
208709
208710 /* Read the old.* and new.* records for the update change. */
208711 pInput->iNext += 2;
208712 rc = sessionReadRecord(pInput, nCol, 0, &apVal[0], 0);
208713 if( rc==SQLITE_OK ){
208714 rc = sessionReadRecord(pInput, nCol, 0, &apVal[nCol], 0);
208715 }
208716
208717 /* Write the new old.* record. Consists of the PK columns from the
208718 ** original old.* record, and the other values from the original
208719 ** new.* record. */
@@ -209435,11 +209657,11 @@
209657 sqlite3_changeset_iter *pIter2 = 0;
209658 SessionBuffer cons = pApply->constraints;
209659 memset(&pApply->constraints, 0, sizeof(SessionBuffer));
209660
209661 rc = sessionChangesetStart(
209662 &pIter2, 0, 0, cons.nBuf, cons.aBuf, pApply->bInvertConstraints, 1
209663 );
209664 if( rc==SQLITE_OK ){
209665 size_t nByte = 2*pApply->nCol*sizeof(sqlite3_value*);
209666 int rc2;
209667 pIter2->bPatchset = bPatchset;
@@ -209691,12 +209913,12 @@
209913 void *pCtx, /* First argument passed to xConflict */
209914 void **ppRebase, int *pnRebase,
209915 int flags
209916 ){
209917 sqlite3_changeset_iter *pIter; /* Iterator to skip through changeset */
209918 int bInv = !!(flags & SQLITE_CHANGESETAPPLY_INVERT);
209919 int rc = sessionChangesetStart(&pIter, 0, 0, nChangeset, pChangeset, bInv, 1);
209920 if( rc==SQLITE_OK ){
209921 rc = sessionChangesetApply(
209922 db, pIter, xFilter, xConflict, pCtx, ppRebase, pnRebase, flags
209923 );
209924 }
@@ -209750,11 +209972,11 @@
209972 void **ppRebase, int *pnRebase,
209973 int flags
209974 ){
209975 sqlite3_changeset_iter *pIter; /* Iterator to skip through changeset */
209976 int bInverse = !!(flags & SQLITE_CHANGESETAPPLY_INVERT);
209977 int rc = sessionChangesetStart(&pIter, xInput, pIn, 0, 0, bInverse, 1);
209978 if( rc==SQLITE_OK ){
209979 rc = sessionChangesetApply(
209980 db, pIter, xFilter, xConflict, pCtx, ppRebase, pnRebase, flags
209981 );
209982 }
@@ -210370,11 +210592,11 @@
210592 *pOut++ = pIter->bIndirect;
210593 for(i=0; i<pIter->nCol; i++){
210594 int n1 = sessionSerialLen(a1);
210595 int n2 = sessionSerialLen(a2);
210596 if( pIter->abPK[i] || a2[0]==0 ){
210597 if( !pIter->abPK[i] && a1[0] ) bData = 1;
210598 memcpy(pOut, a1, n1);
210599 pOut += n1;
210600 }else if( a2[0]!=0xFF ){
210601 bData = 1;
210602 memcpy(pOut, a2, n2);
@@ -228768,11 +228990,11 @@
228990 int nArg, /* Number of args */
228991 sqlite3_value **apUnused /* Function arguments */
228992 ){
228993 assert( nArg==0 );
228994 UNUSED_PARAM2(nArg, apUnused);
228995 sqlite3_result_text(pCtx, "fts5: 2021-02-22 11:07:25 b66a49570852cf118a372a6ac44be3070cf9b4254696f16315b7c79a614e6c35", -1, SQLITE_TRANSIENT);
228996 }
228997
228998 /*
228999 ** Return true if zName is the extension on one of the shadow tables used
229000 ** by this module.
@@ -233694,12 +233916,12 @@
233916 }
233917 #endif /* SQLITE_CORE */
233918 #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_STMTVTAB) */
233919
233920 /************** End of stmt.c ************************************************/
233921 #if __LINE__!=233921
233922 #undef SQLITE_SOURCE_ID
233923 #define SQLITE_SOURCE_ID "2021-02-22 16:42:09 b5a0778cc5a98a864bea72670f83262da940aceb91fa4cdf46ec097337a3alt2"
233924 #endif
233925 /* Return the source-id for this library */
233926 SQLITE_API const char *sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; }
233927 /************************** End of sqlite3.c ******************************/
233928
+1 -1
--- src/sqlite3.h
+++ src/sqlite3.h
@@ -123,11 +123,11 @@
123123
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
124124
** [sqlite_version()] and [sqlite_source_id()].
125125
*/
126126
#define SQLITE_VERSION "3.35.0"
127127
#define SQLITE_VERSION_NUMBER 3035000
128
-#define SQLITE_SOURCE_ID "2021-02-19 14:32:58 c844a331e78949850fde8ed95058cb34f863566944bc9e92e3ae042768f130e1"
128
+#define SQLITE_SOURCE_ID "2021-02-22 16:42:09 b5a0778cc5a98a864bea72670f83262da940aceb91fa4cdf46ec097337a3alt1"
129129
130130
/*
131131
** CAPI3REF: Run-Time Library Version Numbers
132132
** KEYWORDS: sqlite3_version sqlite3_sourceid
133133
**
134134
--- src/sqlite3.h
+++ src/sqlite3.h
@@ -123,11 +123,11 @@
123 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
124 ** [sqlite_version()] and [sqlite_source_id()].
125 */
126 #define SQLITE_VERSION "3.35.0"
127 #define SQLITE_VERSION_NUMBER 3035000
128 #define SQLITE_SOURCE_ID "2021-02-19 14:32:58 c844a331e78949850fde8ed95058cb34f863566944bc9e92e3ae042768f130e1"
129
130 /*
131 ** CAPI3REF: Run-Time Library Version Numbers
132 ** KEYWORDS: sqlite3_version sqlite3_sourceid
133 **
134
--- src/sqlite3.h
+++ src/sqlite3.h
@@ -123,11 +123,11 @@
123 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
124 ** [sqlite_version()] and [sqlite_source_id()].
125 */
126 #define SQLITE_VERSION "3.35.0"
127 #define SQLITE_VERSION_NUMBER 3035000
128 #define SQLITE_SOURCE_ID "2021-02-22 16:42:09 b5a0778cc5a98a864bea72670f83262da940aceb91fa4cdf46ec097337a3alt1"
129
130 /*
131 ** CAPI3REF: Run-Time Library Version Numbers
132 ** KEYWORDS: sqlite3_version sqlite3_sourceid
133 **
134

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button