Fossil SCM

Update the built-in SQLite to the 3.8.3 beta that includes support for common table expressions and recursive queries.

drh 2014-01-18 17:01 trunk
Commit 27ef534d48706f02042b8000ab534d618dc40cf5
--- src/report.c
+++ src/report.c
@@ -197,10 +197,15 @@
197197
}else if( !g.perm.RdAddr && strncmp(zArg2, "private_", 8)==0 ){
198198
rc = SQLITE_IGNORE;
199199
}
200200
break;
201201
}
202
+ case SQLITE_RECURSIVE: {
203
+ *(char**)pError = mprintf("recursive queries are not allowed");
204
+ rc = SQLITE_DENY;
205
+ break;
206
+ }
202207
default: {
203208
*(char**)pError = mprintf("only SELECT statements are allowed");
204209
rc = SQLITE_DENY;
205210
break;
206211
}
207212
--- src/report.c
+++ src/report.c
@@ -197,10 +197,15 @@
197 }else if( !g.perm.RdAddr && strncmp(zArg2, "private_", 8)==0 ){
198 rc = SQLITE_IGNORE;
199 }
200 break;
201 }
 
 
 
 
 
202 default: {
203 *(char**)pError = mprintf("only SELECT statements are allowed");
204 rc = SQLITE_DENY;
205 break;
206 }
207
--- src/report.c
+++ src/report.c
@@ -197,10 +197,15 @@
197 }else if( !g.perm.RdAddr && strncmp(zArg2, "private_", 8)==0 ){
198 rc = SQLITE_IGNORE;
199 }
200 break;
201 }
202 case SQLITE_RECURSIVE: {
203 *(char**)pError = mprintf("recursive queries are not allowed");
204 rc = SQLITE_DENY;
205 break;
206 }
207 default: {
208 *(char**)pError = mprintf("only SELECT statements are allowed");
209 rc = SQLITE_DENY;
210 break;
211 }
212
--- src/shell.c
+++ src/shell.c
@@ -595,10 +595,11 @@
595595
** Output the given string with characters that are special to
596596
** HTML escaped.
597597
*/
598598
static void output_html_string(FILE *out, const char *z){
599599
int i;
600
+ if( z==0 ) z = "";
600601
while( *z ){
601602
for(i=0; z[i]
602603
&& z[i]!='<'
603604
&& z[i]!='&'
604605
&& z[i]!='>'
605606
--- src/shell.c
+++ src/shell.c
@@ -595,10 +595,11 @@
595 ** Output the given string with characters that are special to
596 ** HTML escaped.
597 */
598 static void output_html_string(FILE *out, const char *z){
599 int i;
 
600 while( *z ){
601 for(i=0; z[i]
602 && z[i]!='<'
603 && z[i]!='&'
604 && z[i]!='>'
605
--- src/shell.c
+++ src/shell.c
@@ -595,10 +595,11 @@
595 ** Output the given string with characters that are special to
596 ** HTML escaped.
597 */
598 static void output_html_string(FILE *out, const char *z){
599 int i;
600 if( z==0 ) z = "";
601 while( *z ){
602 for(i=0; z[i]
603 && z[i]!='<'
604 && z[i]!='&'
605 && z[i]!='>'
606
+3127 -2628
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -135,11 +135,11 @@
135135
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
136136
** [sqlite_version()] and [sqlite_source_id()].
137137
*/
138138
#define SQLITE_VERSION "3.8.3"
139139
#define SQLITE_VERSION_NUMBER 3008003
140
-#define SQLITE_SOURCE_ID "2014-01-04 15:17:04 4e725f53131d3584319c710c8710a068989543c6"
140
+#define SQLITE_SOURCE_ID "2014-01-18 15:22:53 2ad4583c0cc7988f0dfe78fd0a2eb0fdb92d835a"
141141
142142
/*
143143
** CAPI3REF: Run-Time Library Version Numbers
144144
** KEYWORDS: sqlite3_version, sqlite3_sourceid
145145
**
@@ -2592,10 +2592,11 @@
25922592
#define SQLITE_CREATE_VTABLE 29 /* Table Name Module Name */
25932593
#define SQLITE_DROP_VTABLE 30 /* Table Name Module Name */
25942594
#define SQLITE_FUNCTION 31 /* NULL Function Name */
25952595
#define SQLITE_SAVEPOINT 32 /* Operation Savepoint Name */
25962596
#define SQLITE_COPY 0 /* No longer used */
2597
+#define SQLITE_RECURSIVE 33 /* NULL NULL */
25972598
25982599
/*
25992600
** CAPI3REF: Tracing And Profiling Functions
26002601
**
26012602
** These routines register callback functions that can be used for
@@ -8040,167 +8041,169 @@
80408041
80418042
/************** End of hash.h ************************************************/
80428043
/************** Continuing where we left off in sqliteInt.h ******************/
80438044
/************** Include parse.h in the middle of sqliteInt.h *****************/
80448045
/************** Begin file parse.h *******************************************/
8045
-#define TK_SEMI 1
8046
-#define TK_EXPLAIN 2
8047
-#define TK_QUERY 3
8048
-#define TK_PLAN 4
8049
-#define TK_BEGIN 5
8050
-#define TK_TRANSACTION 6
8051
-#define TK_DEFERRED 7
8052
-#define TK_IMMEDIATE 8
8053
-#define TK_EXCLUSIVE 9
8054
-#define TK_COMMIT 10
8055
-#define TK_END 11
8056
-#define TK_ROLLBACK 12
8057
-#define TK_SAVEPOINT 13
8058
-#define TK_RELEASE 14
8059
-#define TK_TO 15
8060
-#define TK_TABLE 16
8061
-#define TK_CREATE 17
8062
-#define TK_IF 18
8063
-#define TK_NOT 19
8064
-#define TK_EXISTS 20
8065
-#define TK_TEMP 21
8066
-#define TK_LP 22
8067
-#define TK_RP 23
8068
-#define TK_AS 24
8069
-#define TK_WITHOUT 25
8070
-#define TK_COMMA 26
8071
-#define TK_ID 27
8072
-#define TK_INDEXED 28
8073
-#define TK_ABORT 29
8074
-#define TK_ACTION 30
8075
-#define TK_AFTER 31
8076
-#define TK_ANALYZE 32
8077
-#define TK_ASC 33
8078
-#define TK_ATTACH 34
8079
-#define TK_BEFORE 35
8080
-#define TK_BY 36
8081
-#define TK_CASCADE 37
8082
-#define TK_CAST 38
8083
-#define TK_COLUMNKW 39
8084
-#define TK_CONFLICT 40
8085
-#define TK_DATABASE 41
8086
-#define TK_DESC 42
8087
-#define TK_DETACH 43
8088
-#define TK_EACH 44
8089
-#define TK_FAIL 45
8090
-#define TK_FOR 46
8091
-#define TK_IGNORE 47
8092
-#define TK_INITIALLY 48
8093
-#define TK_INSTEAD 49
8094
-#define TK_LIKE_KW 50
8095
-#define TK_MATCH 51
8096
-#define TK_NO 52
8097
-#define TK_KEY 53
8098
-#define TK_OF 54
8099
-#define TK_OFFSET 55
8100
-#define TK_PRAGMA 56
8101
-#define TK_RAISE 57
8102
-#define TK_REPLACE 58
8103
-#define TK_RESTRICT 59
8104
-#define TK_ROW 60
8105
-#define TK_TRIGGER 61
8106
-#define TK_VACUUM 62
8107
-#define TK_VIEW 63
8108
-#define TK_VIRTUAL 64
8109
-#define TK_REINDEX 65
8110
-#define TK_RENAME 66
8111
-#define TK_CTIME_KW 67
8112
-#define TK_ANY 68
8113
-#define TK_OR 69
8114
-#define TK_AND 70
8115
-#define TK_IS 71
8116
-#define TK_BETWEEN 72
8117
-#define TK_IN 73
8118
-#define TK_ISNULL 74
8119
-#define TK_NOTNULL 75
8120
-#define TK_NE 76
8121
-#define TK_EQ 77
8122
-#define TK_GT 78
8123
-#define TK_LE 79
8124
-#define TK_LT 80
8125
-#define TK_GE 81
8126
-#define TK_ESCAPE 82
8127
-#define TK_BITAND 83
8128
-#define TK_BITOR 84
8129
-#define TK_LSHIFT 85
8130
-#define TK_RSHIFT 86
8131
-#define TK_PLUS 87
8132
-#define TK_MINUS 88
8133
-#define TK_STAR 89
8134
-#define TK_SLASH 90
8135
-#define TK_REM 91
8136
-#define TK_CONCAT 92
8137
-#define TK_COLLATE 93
8138
-#define TK_BITNOT 94
8139
-#define TK_STRING 95
8140
-#define TK_JOIN_KW 96
8141
-#define TK_CONSTRAINT 97
8142
-#define TK_DEFAULT 98
8143
-#define TK_NULL 99
8144
-#define TK_PRIMARY 100
8145
-#define TK_UNIQUE 101
8146
-#define TK_CHECK 102
8147
-#define TK_REFERENCES 103
8148
-#define TK_AUTOINCR 104
8149
-#define TK_ON 105
8150
-#define TK_INSERT 106
8151
-#define TK_DELETE 107
8152
-#define TK_UPDATE 108
8153
-#define TK_SET 109
8154
-#define TK_DEFERRABLE 110
8155
-#define TK_FOREIGN 111
8156
-#define TK_DROP 112
8157
-#define TK_UNION 113
8158
-#define TK_ALL 114
8159
-#define TK_EXCEPT 115
8160
-#define TK_INTERSECT 116
8161
-#define TK_SELECT 117
8162
-#define TK_DISTINCT 118
8163
-#define TK_DOT 119
8164
-#define TK_FROM 120
8165
-#define TK_JOIN 121
8166
-#define TK_USING 122
8167
-#define TK_ORDER 123
8168
-#define TK_GROUP 124
8169
-#define TK_HAVING 125
8170
-#define TK_LIMIT 126
8171
-#define TK_WHERE 127
8172
-#define TK_INTO 128
8173
-#define TK_VALUES 129
8174
-#define TK_INTEGER 130
8175
-#define TK_FLOAT 131
8176
-#define TK_BLOB 132
8177
-#define TK_REGISTER 133
8178
-#define TK_VARIABLE 134
8179
-#define TK_CASE 135
8180
-#define TK_WHEN 136
8181
-#define TK_THEN 137
8182
-#define TK_ELSE 138
8183
-#define TK_INDEX 139
8184
-#define TK_ALTER 140
8185
-#define TK_ADD 141
8186
-#define TK_TO_TEXT 142
8187
-#define TK_TO_BLOB 143
8188
-#define TK_TO_NUMERIC 144
8189
-#define TK_TO_INT 145
8190
-#define TK_TO_REAL 146
8191
-#define TK_ISNOT 147
8192
-#define TK_END_OF_FILE 148
8193
-#define TK_ILLEGAL 149
8194
-#define TK_SPACE 150
8195
-#define TK_UNCLOSED_STRING 151
8196
-#define TK_FUNCTION 152
8197
-#define TK_COLUMN 153
8198
-#define TK_AGG_FUNCTION 154
8199
-#define TK_AGG_COLUMN 155
8200
-#define TK_UMINUS 156
8201
-#define TK_UPLUS 157
8046
+#define TK_SEMI 1
8047
+#define TK_EXPLAIN 2
8048
+#define TK_QUERY 3
8049
+#define TK_PLAN 4
8050
+#define TK_BEGIN 5
8051
+#define TK_TRANSACTION 6
8052
+#define TK_DEFERRED 7
8053
+#define TK_IMMEDIATE 8
8054
+#define TK_EXCLUSIVE 9
8055
+#define TK_COMMIT 10
8056
+#define TK_END 11
8057
+#define TK_ROLLBACK 12
8058
+#define TK_SAVEPOINT 13
8059
+#define TK_RELEASE 14
8060
+#define TK_TO 15
8061
+#define TK_TABLE 16
8062
+#define TK_CREATE 17
8063
+#define TK_IF 18
8064
+#define TK_NOT 19
8065
+#define TK_EXISTS 20
8066
+#define TK_TEMP 21
8067
+#define TK_LP 22
8068
+#define TK_RP 23
8069
+#define TK_AS 24
8070
+#define TK_WITHOUT 25
8071
+#define TK_COMMA 26
8072
+#define TK_ID 27
8073
+#define TK_INDEXED 28
8074
+#define TK_ABORT 29
8075
+#define TK_ACTION 30
8076
+#define TK_AFTER 31
8077
+#define TK_ANALYZE 32
8078
+#define TK_ASC 33
8079
+#define TK_ATTACH 34
8080
+#define TK_BEFORE 35
8081
+#define TK_BY 36
8082
+#define TK_CASCADE 37
8083
+#define TK_CAST 38
8084
+#define TK_COLUMNKW 39
8085
+#define TK_CONFLICT 40
8086
+#define TK_DATABASE 41
8087
+#define TK_DESC 42
8088
+#define TK_DETACH 43
8089
+#define TK_EACH 44
8090
+#define TK_FAIL 45
8091
+#define TK_FOR 46
8092
+#define TK_IGNORE 47
8093
+#define TK_INITIALLY 48
8094
+#define TK_INSTEAD 49
8095
+#define TK_LIKE_KW 50
8096
+#define TK_MATCH 51
8097
+#define TK_NO 52
8098
+#define TK_KEY 53
8099
+#define TK_OF 54
8100
+#define TK_OFFSET 55
8101
+#define TK_PRAGMA 56
8102
+#define TK_RAISE 57
8103
+#define TK_RECURSIVE 58
8104
+#define TK_REPLACE 59
8105
+#define TK_RESTRICT 60
8106
+#define TK_ROW 61
8107
+#define TK_TRIGGER 62
8108
+#define TK_VACUUM 63
8109
+#define TK_VIEW 64
8110
+#define TK_VIRTUAL 65
8111
+#define TK_WITH 66
8112
+#define TK_REINDEX 67
8113
+#define TK_RENAME 68
8114
+#define TK_CTIME_KW 69
8115
+#define TK_ANY 70
8116
+#define TK_OR 71
8117
+#define TK_AND 72
8118
+#define TK_IS 73
8119
+#define TK_BETWEEN 74
8120
+#define TK_IN 75
8121
+#define TK_ISNULL 76
8122
+#define TK_NOTNULL 77
8123
+#define TK_NE 78
8124
+#define TK_EQ 79
8125
+#define TK_GT 80
8126
+#define TK_LE 81
8127
+#define TK_LT 82
8128
+#define TK_GE 83
8129
+#define TK_ESCAPE 84
8130
+#define TK_BITAND 85
8131
+#define TK_BITOR 86
8132
+#define TK_LSHIFT 87
8133
+#define TK_RSHIFT 88
8134
+#define TK_PLUS 89
8135
+#define TK_MINUS 90
8136
+#define TK_STAR 91
8137
+#define TK_SLASH 92
8138
+#define TK_REM 93
8139
+#define TK_CONCAT 94
8140
+#define TK_COLLATE 95
8141
+#define TK_BITNOT 96
8142
+#define TK_STRING 97
8143
+#define TK_JOIN_KW 98
8144
+#define TK_CONSTRAINT 99
8145
+#define TK_DEFAULT 100
8146
+#define TK_NULL 101
8147
+#define TK_PRIMARY 102
8148
+#define TK_UNIQUE 103
8149
+#define TK_CHECK 104
8150
+#define TK_REFERENCES 105
8151
+#define TK_AUTOINCR 106
8152
+#define TK_ON 107
8153
+#define TK_INSERT 108
8154
+#define TK_DELETE 109
8155
+#define TK_UPDATE 110
8156
+#define TK_SET 111
8157
+#define TK_DEFERRABLE 112
8158
+#define TK_FOREIGN 113
8159
+#define TK_DROP 114
8160
+#define TK_UNION 115
8161
+#define TK_ALL 116
8162
+#define TK_EXCEPT 117
8163
+#define TK_INTERSECT 118
8164
+#define TK_SELECT 119
8165
+#define TK_VALUES 120
8166
+#define TK_DISTINCT 121
8167
+#define TK_DOT 122
8168
+#define TK_FROM 123
8169
+#define TK_JOIN 124
8170
+#define TK_USING 125
8171
+#define TK_ORDER 126
8172
+#define TK_GROUP 127
8173
+#define TK_HAVING 128
8174
+#define TK_LIMIT 129
8175
+#define TK_WHERE 130
8176
+#define TK_INTO 131
8177
+#define TK_INTEGER 132
8178
+#define TK_FLOAT 133
8179
+#define TK_BLOB 134
8180
+#define TK_VARIABLE 135
8181
+#define TK_CASE 136
8182
+#define TK_WHEN 137
8183
+#define TK_THEN 138
8184
+#define TK_ELSE 139
8185
+#define TK_INDEX 140
8186
+#define TK_ALTER 141
8187
+#define TK_ADD 142
8188
+#define TK_TO_TEXT 143
8189
+#define TK_TO_BLOB 144
8190
+#define TK_TO_NUMERIC 145
8191
+#define TK_TO_INT 146
8192
+#define TK_TO_REAL 147
8193
+#define TK_ISNOT 148
8194
+#define TK_END_OF_FILE 149
8195
+#define TK_ILLEGAL 150
8196
+#define TK_SPACE 151
8197
+#define TK_UNCLOSED_STRING 152
8198
+#define TK_FUNCTION 153
8199
+#define TK_COLUMN 154
8200
+#define TK_AGG_FUNCTION 155
8201
+#define TK_AGG_COLUMN 156
8202
+#define TK_UMINUS 157
8203
+#define TK_UPLUS 158
8204
+#define TK_REGISTER 159
82028205
82038206
/************** End of parse.h ***********************************************/
82048207
/************** Continuing where we left off in sqliteInt.h ******************/
82058208
#include <stdio.h>
82068209
#include <stdlib.h>
@@ -8645,10 +8648,11 @@
86458648
typedef struct UnpackedRecord UnpackedRecord;
86468649
typedef struct VTable VTable;
86478650
typedef struct VtabCtx VtabCtx;
86488651
typedef struct Walker Walker;
86498652
typedef struct WhereInfo WhereInfo;
8653
+typedef struct With With;
86508654
86518655
/*
86528656
** Defer sourcing vdbe.h and btree.h until after the "u8" and
86538657
** "BusyHandler" typedefs. vdbe.h also requires a few of the opaque
86548658
** pointer types (i.e. FuncDef) defined above.
@@ -9124,109 +9128,110 @@
91249128
#define OP_VerifyCookie 49
91259129
#define OP_OpenRead 50 /* synopsis: root=P2 iDb=P3 */
91269130
#define OP_OpenWrite 51 /* synopsis: root=P2 iDb=P3 */
91279131
#define OP_OpenAutoindex 52 /* synopsis: nColumn=P2 */
91289132
#define OP_OpenEphemeral 53 /* synopsis: nColumn=P2 */
9129
-#define OP_SorterOpen 54
9130
-#define OP_OpenPseudo 55 /* synopsis: content in r[P2@P3] */
9131
-#define OP_Close 56
9132
-#define OP_SeekLt 57 /* synopsis: key=r[P3@P4] */
9133
-#define OP_SeekLe 58 /* synopsis: key=r[P3@P4] */
9134
-#define OP_SeekGe 59 /* synopsis: key=r[P3@P4] */
9135
-#define OP_SeekGt 60 /* synopsis: key=r[P3@P4] */
9136
-#define OP_Seek 61 /* synopsis: intkey=r[P2] */
9137
-#define OP_NoConflict 62 /* synopsis: key=r[P3@P4] */
9138
-#define OP_NotFound 63 /* synopsis: key=r[P3@P4] */
9139
-#define OP_Found 64 /* synopsis: key=r[P3@P4] */
9140
-#define OP_NotExists 65 /* synopsis: intkey=r[P3] */
9141
-#define OP_Sequence 66 /* synopsis: r[P2]=rowid */
9142
-#define OP_NewRowid 67 /* synopsis: r[P2]=rowid */
9143
-#define OP_Insert 68 /* synopsis: intkey=r[P3] data=r[P2] */
9144
-#define OP_Or 69 /* same as TK_OR, synopsis: r[P3]=(r[P1] || r[P2]) */
9145
-#define OP_And 70 /* same as TK_AND, synopsis: r[P3]=(r[P1] && r[P2]) */
9146
-#define OP_InsertInt 71 /* synopsis: intkey=P3 data=r[P2] */
9147
-#define OP_Delete 72
9148
-#define OP_ResetCount 73
9149
-#define OP_IsNull 74 /* same as TK_ISNULL, synopsis: if r[P1]==NULL goto P2 */
9150
-#define OP_NotNull 75 /* same as TK_NOTNULL, synopsis: if r[P1]!=NULL goto P2 */
9151
-#define OP_Ne 76 /* same as TK_NE, synopsis: if r[P1]!=r[P3] goto P2 */
9152
-#define OP_Eq 77 /* same as TK_EQ, synopsis: if r[P1]==r[P3] goto P2 */
9153
-#define OP_Gt 78 /* same as TK_GT, synopsis: if r[P1]>r[P3] goto P2 */
9154
-#define OP_Le 79 /* same as TK_LE, synopsis: if r[P1]<=r[P3] goto P2 */
9155
-#define OP_Lt 80 /* same as TK_LT, synopsis: if r[P1]<r[P3] goto P2 */
9156
-#define OP_Ge 81 /* same as TK_GE, synopsis: if r[P1]>=r[P3] goto P2 */
9157
-#define OP_SorterCompare 82 /* synopsis: if key(P1)!=rtrim(r[P3],P4) goto P2 */
9158
-#define OP_BitAnd 83 /* same as TK_BITAND, synopsis: r[P3]=r[P1]&r[P2] */
9159
-#define OP_BitOr 84 /* same as TK_BITOR, synopsis: r[P3]=r[P1]|r[P2] */
9160
-#define OP_ShiftLeft 85 /* same as TK_LSHIFT, synopsis: r[P3]=r[P2]<<r[P1] */
9161
-#define OP_ShiftRight 86 /* same as TK_RSHIFT, synopsis: r[P3]=r[P2]>>r[P1] */
9162
-#define OP_Add 87 /* same as TK_PLUS, synopsis: r[P3]=r[P1]+r[P2] */
9163
-#define OP_Subtract 88 /* same as TK_MINUS, synopsis: r[P3]=r[P2]-r[P1] */
9164
-#define OP_Multiply 89 /* same as TK_STAR, synopsis: r[P3]=r[P1]*r[P2] */
9165
-#define OP_Divide 90 /* same as TK_SLASH, synopsis: r[P3]=r[P2]/r[P1] */
9166
-#define OP_Remainder 91 /* same as TK_REM, synopsis: r[P3]=r[P2]%r[P1] */
9167
-#define OP_Concat 92 /* same as TK_CONCAT, synopsis: r[P3]=r[P2]+r[P1] */
9168
-#define OP_SorterData 93 /* synopsis: r[P2]=data */
9169
-#define OP_BitNot 94 /* same as TK_BITNOT, synopsis: r[P1]= ~r[P1] */
9170
-#define OP_String8 95 /* same as TK_STRING, synopsis: r[P2]='P4' */
9171
-#define OP_RowKey 96 /* synopsis: r[P2]=key */
9172
-#define OP_RowData 97 /* synopsis: r[P2]=data */
9173
-#define OP_Rowid 98 /* synopsis: r[P2]=rowid */
9174
-#define OP_NullRow 99
9175
-#define OP_Last 100
9176
-#define OP_SorterSort 101
9177
-#define OP_Sort 102
9178
-#define OP_Rewind 103
9179
-#define OP_SorterInsert 104
9180
-#define OP_IdxInsert 105 /* synopsis: key=r[P2] */
9181
-#define OP_IdxDelete 106 /* synopsis: key=r[P2@P3] */
9182
-#define OP_IdxRowid 107 /* synopsis: r[P2]=rowid */
9183
-#define OP_IdxLT 108 /* synopsis: key=r[P3@P4] */
9184
-#define OP_IdxGE 109 /* synopsis: key=r[P3@P4] */
9185
-#define OP_Destroy 110
9186
-#define OP_Clear 111
9187
-#define OP_CreateIndex 112 /* synopsis: r[P2]=root iDb=P1 */
9188
-#define OP_CreateTable 113 /* synopsis: r[P2]=root iDb=P1 */
9189
-#define OP_ParseSchema 114
9190
-#define OP_LoadAnalysis 115
9191
-#define OP_DropTable 116
9192
-#define OP_DropIndex 117
9193
-#define OP_DropTrigger 118
9194
-#define OP_IntegrityCk 119
9195
-#define OP_RowSetAdd 120 /* synopsis: rowset(P1)=r[P2] */
9196
-#define OP_RowSetRead 121 /* synopsis: r[P3]=rowset(P1) */
9197
-#define OP_RowSetTest 122 /* synopsis: if r[P3] in rowset(P1) goto P2 */
9198
-#define OP_Program 123
9199
-#define OP_Param 124
9200
-#define OP_FkCounter 125 /* synopsis: fkctr[P1]+=P2 */
9201
-#define OP_FkIfZero 126 /* synopsis: if fkctr[P1]==0 goto P2 */
9202
-#define OP_MemMax 127 /* synopsis: r[P1]=max(r[P1],r[P2]) */
9203
-#define OP_IfPos 128 /* synopsis: if r[P1]>0 goto P2 */
9204
-#define OP_IfNeg 129 /* synopsis: if r[P1]<0 goto P2 */
9205
-#define OP_IfZero 130 /* synopsis: r[P1]+=P3, if r[P1]==0 goto P2 */
9206
-#define OP_Real 131 /* same as TK_FLOAT, synopsis: r[P2]=P4 */
9133
+#define OP_SwapCursors 54
9134
+#define OP_SorterOpen 55
9135
+#define OP_OpenPseudo 56 /* synopsis: content in r[P2@P3] */
9136
+#define OP_Close 57
9137
+#define OP_SeekLt 58 /* synopsis: key=r[P3@P4] */
9138
+#define OP_SeekLe 59 /* synopsis: key=r[P3@P4] */
9139
+#define OP_SeekGe 60 /* synopsis: key=r[P3@P4] */
9140
+#define OP_SeekGt 61 /* synopsis: key=r[P3@P4] */
9141
+#define OP_Seek 62 /* synopsis: intkey=r[P2] */
9142
+#define OP_NoConflict 63 /* synopsis: key=r[P3@P4] */
9143
+#define OP_NotFound 64 /* synopsis: key=r[P3@P4] */
9144
+#define OP_Found 65 /* synopsis: key=r[P3@P4] */
9145
+#define OP_NotExists 66 /* synopsis: intkey=r[P3] */
9146
+#define OP_Sequence 67 /* synopsis: r[P2]=rowid */
9147
+#define OP_NewRowid 68 /* synopsis: r[P2]=rowid */
9148
+#define OP_Insert 69 /* synopsis: intkey=r[P3] data=r[P2] */
9149
+#define OP_InsertInt 70 /* synopsis: intkey=P3 data=r[P2] */
9150
+#define OP_Or 71 /* same as TK_OR, synopsis: r[P3]=(r[P1] || r[P2]) */
9151
+#define OP_And 72 /* same as TK_AND, synopsis: r[P3]=(r[P1] && r[P2]) */
9152
+#define OP_Delete 73
9153
+#define OP_ResetCount 74
9154
+#define OP_SorterCompare 75 /* synopsis: if key(P1)!=rtrim(r[P3],P4) goto P2 */
9155
+#define OP_IsNull 76 /* same as TK_ISNULL, synopsis: if r[P1]==NULL goto P2 */
9156
+#define OP_NotNull 77 /* same as TK_NOTNULL, synopsis: if r[P1]!=NULL goto P2 */
9157
+#define OP_Ne 78 /* same as TK_NE, synopsis: if r[P1]!=r[P3] goto P2 */
9158
+#define OP_Eq 79 /* same as TK_EQ, synopsis: if r[P1]==r[P3] goto P2 */
9159
+#define OP_Gt 80 /* same as TK_GT, synopsis: if r[P1]>r[P3] goto P2 */
9160
+#define OP_Le 81 /* same as TK_LE, synopsis: if r[P1]<=r[P3] goto P2 */
9161
+#define OP_Lt 82 /* same as TK_LT, synopsis: if r[P1]<r[P3] goto P2 */
9162
+#define OP_Ge 83 /* same as TK_GE, synopsis: if r[P1]>=r[P3] goto P2 */
9163
+#define OP_SorterData 84 /* synopsis: r[P2]=data */
9164
+#define OP_BitAnd 85 /* same as TK_BITAND, synopsis: r[P3]=r[P1]&r[P2] */
9165
+#define OP_BitOr 86 /* same as TK_BITOR, synopsis: r[P3]=r[P1]|r[P2] */
9166
+#define OP_ShiftLeft 87 /* same as TK_LSHIFT, synopsis: r[P3]=r[P2]<<r[P1] */
9167
+#define OP_ShiftRight 88 /* same as TK_RSHIFT, synopsis: r[P3]=r[P2]>>r[P1] */
9168
+#define OP_Add 89 /* same as TK_PLUS, synopsis: r[P3]=r[P1]+r[P2] */
9169
+#define OP_Subtract 90 /* same as TK_MINUS, synopsis: r[P3]=r[P2]-r[P1] */
9170
+#define OP_Multiply 91 /* same as TK_STAR, synopsis: r[P3]=r[P1]*r[P2] */
9171
+#define OP_Divide 92 /* same as TK_SLASH, synopsis: r[P3]=r[P2]/r[P1] */
9172
+#define OP_Remainder 93 /* same as TK_REM, synopsis: r[P3]=r[P2]%r[P1] */
9173
+#define OP_Concat 94 /* same as TK_CONCAT, synopsis: r[P3]=r[P2]+r[P1] */
9174
+#define OP_RowKey 95 /* synopsis: r[P2]=key */
9175
+#define OP_BitNot 96 /* same as TK_BITNOT, synopsis: r[P1]= ~r[P1] */
9176
+#define OP_String8 97 /* same as TK_STRING, synopsis: r[P2]='P4' */
9177
+#define OP_RowData 98 /* synopsis: r[P2]=data */
9178
+#define OP_Rowid 99 /* synopsis: r[P2]=rowid */
9179
+#define OP_NullRow 100
9180
+#define OP_Last 101
9181
+#define OP_SorterSort 102
9182
+#define OP_Sort 103
9183
+#define OP_Rewind 104
9184
+#define OP_SorterInsert 105
9185
+#define OP_IdxInsert 106 /* synopsis: key=r[P2] */
9186
+#define OP_IdxDelete 107 /* synopsis: key=r[P2@P3] */
9187
+#define OP_IdxRowid 108 /* synopsis: r[P2]=rowid */
9188
+#define OP_IdxLT 109 /* synopsis: key=r[P3@P4] */
9189
+#define OP_IdxGE 110 /* synopsis: key=r[P3@P4] */
9190
+#define OP_Destroy 111
9191
+#define OP_Clear 112
9192
+#define OP_CreateIndex 113 /* synopsis: r[P2]=root iDb=P1 */
9193
+#define OP_CreateTable 114 /* synopsis: r[P2]=root iDb=P1 */
9194
+#define OP_ParseSchema 115
9195
+#define OP_LoadAnalysis 116
9196
+#define OP_DropTable 117
9197
+#define OP_DropIndex 118
9198
+#define OP_DropTrigger 119
9199
+#define OP_IntegrityCk 120
9200
+#define OP_RowSetAdd 121 /* synopsis: rowset(P1)=r[P2] */
9201
+#define OP_RowSetRead 122 /* synopsis: r[P3]=rowset(P1) */
9202
+#define OP_RowSetTest 123 /* synopsis: if r[P3] in rowset(P1) goto P2 */
9203
+#define OP_Program 124
9204
+#define OP_Param 125
9205
+#define OP_FkCounter 126 /* synopsis: fkctr[P1]+=P2 */
9206
+#define OP_FkIfZero 127 /* synopsis: if fkctr[P1]==0 goto P2 */
9207
+#define OP_MemMax 128 /* synopsis: r[P1]=max(r[P1],r[P2]) */
9208
+#define OP_IfPos 129 /* synopsis: if r[P1]>0 goto P2 */
9209
+#define OP_IfNeg 130 /* synopsis: if r[P1]<0 goto P2 */
9210
+#define OP_IfZero 131 /* synopsis: r[P1]+=P3, if r[P1]==0 goto P2 */
92079211
#define OP_AggFinal 132 /* synopsis: accum=r[P1] N=P2 */
9208
-#define OP_IncrVacuum 133
9209
-#define OP_Expire 134
9210
-#define OP_TableLock 135 /* synopsis: iDb=P1 root=P2 write=P3 */
9211
-#define OP_VBegin 136
9212
-#define OP_VCreate 137
9213
-#define OP_VDestroy 138
9214
-#define OP_VOpen 139
9215
-#define OP_VColumn 140 /* synopsis: r[P3]=vcolumn(P2) */
9216
-#define OP_VNext 141
9217
-#define OP_ToText 142 /* same as TK_TO_TEXT */
9218
-#define OP_ToBlob 143 /* same as TK_TO_BLOB */
9219
-#define OP_ToNumeric 144 /* same as TK_TO_NUMERIC */
9220
-#define OP_ToInt 145 /* same as TK_TO_INT */
9221
-#define OP_ToReal 146 /* same as TK_TO_REAL */
9222
-#define OP_VRename 147
9223
-#define OP_Pagecount 148
9224
-#define OP_MaxPgcnt 149
9225
-#define OP_Trace 150
9226
-#define OP_Noop 151
9227
-#define OP_Explain 152
9212
+#define OP_Real 133 /* same as TK_FLOAT, synopsis: r[P2]=P4 */
9213
+#define OP_IncrVacuum 134
9214
+#define OP_Expire 135
9215
+#define OP_TableLock 136 /* synopsis: iDb=P1 root=P2 write=P3 */
9216
+#define OP_VBegin 137
9217
+#define OP_VCreate 138
9218
+#define OP_VDestroy 139
9219
+#define OP_VOpen 140
9220
+#define OP_VColumn 141 /* synopsis: r[P3]=vcolumn(P2) */
9221
+#define OP_VNext 142
9222
+#define OP_ToText 143 /* same as TK_TO_TEXT */
9223
+#define OP_ToBlob 144 /* same as TK_TO_BLOB */
9224
+#define OP_ToNumeric 145 /* same as TK_TO_NUMERIC */
9225
+#define OP_ToInt 146 /* same as TK_TO_INT */
9226
+#define OP_ToReal 147 /* same as TK_TO_REAL */
9227
+#define OP_VRename 148
9228
+#define OP_Pagecount 149
9229
+#define OP_MaxPgcnt 150
9230
+#define OP_Trace 151
9231
+#define OP_Noop 152
9232
+#define OP_Explain 153
92289233
92299234
92309235
/* Properties such as "out2" or "jump" that are specified in
92319236
** comments following the "case" for each opcode in the vdbe.c
92329237
** are encoded into bitvectors as follows:
@@ -9244,23 +9249,23 @@
92449249
/* 16 */ 0x01, 0x01, 0x04, 0x24, 0x04, 0x10, 0x00, 0x02,\
92459250
/* 24 */ 0x02, 0x02, 0x02, 0x02, 0x02, 0x00, 0x00, 0x20,\
92469251
/* 32 */ 0x00, 0x00, 0x04, 0x05, 0x04, 0x00, 0x00, 0x01,\
92479252
/* 40 */ 0x01, 0x05, 0x05, 0x00, 0x00, 0x00, 0x02, 0x02,\
92489253
/* 48 */ 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\
9249
-/* 56 */ 0x00, 0x11, 0x11, 0x11, 0x11, 0x08, 0x11, 0x11,\
9250
-/* 64 */ 0x11, 0x11, 0x02, 0x02, 0x00, 0x4c, 0x4c, 0x00,\
9251
-/* 72 */ 0x00, 0x00, 0x05, 0x05, 0x15, 0x15, 0x15, 0x15,\
9252
-/* 80 */ 0x15, 0x15, 0x00, 0x4c, 0x4c, 0x4c, 0x4c, 0x4c,\
9253
-/* 88 */ 0x4c, 0x4c, 0x4c, 0x4c, 0x4c, 0x00, 0x24, 0x02,\
9254
-/* 96 */ 0x00, 0x00, 0x02, 0x00, 0x01, 0x01, 0x01, 0x01,\
9255
-/* 104 */ 0x08, 0x08, 0x00, 0x02, 0x01, 0x01, 0x02, 0x00,\
9256
-/* 112 */ 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\
9257
-/* 120 */ 0x0c, 0x45, 0x15, 0x01, 0x02, 0x00, 0x01, 0x08,\
9258
-/* 128 */ 0x05, 0x05, 0x05, 0x02, 0x00, 0x01, 0x00, 0x00,\
9259
-/* 136 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x04, 0x04,\
9260
-/* 144 */ 0x04, 0x04, 0x04, 0x00, 0x02, 0x02, 0x00, 0x00,\
9261
-/* 152 */ 0x00,}
9254
+/* 56 */ 0x00, 0x00, 0x11, 0x11, 0x11, 0x11, 0x08, 0x11,\
9255
+/* 64 */ 0x11, 0x11, 0x11, 0x02, 0x02, 0x00, 0x00, 0x4c,\
9256
+/* 72 */ 0x4c, 0x00, 0x00, 0x00, 0x05, 0x05, 0x15, 0x15,\
9257
+/* 80 */ 0x15, 0x15, 0x15, 0x15, 0x00, 0x4c, 0x4c, 0x4c,\
9258
+/* 88 */ 0x4c, 0x4c, 0x4c, 0x4c, 0x4c, 0x4c, 0x4c, 0x00,\
9259
+/* 96 */ 0x24, 0x02, 0x00, 0x02, 0x00, 0x01, 0x01, 0x01,\
9260
+/* 104 */ 0x01, 0x08, 0x08, 0x00, 0x02, 0x01, 0x01, 0x02,\
9261
+/* 112 */ 0x00, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00,\
9262
+/* 120 */ 0x00, 0x0c, 0x45, 0x15, 0x01, 0x02, 0x00, 0x01,\
9263
+/* 128 */ 0x08, 0x05, 0x05, 0x05, 0x00, 0x02, 0x01, 0x00,\
9264
+/* 136 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x04,\
9265
+/* 144 */ 0x04, 0x04, 0x04, 0x04, 0x00, 0x02, 0x02, 0x00,\
9266
+/* 152 */ 0x00, 0x00,}
92629267
92639268
/************** End of opcodes.h *********************************************/
92649269
/************** Continuing where we left off in vdbe.h ***********************/
92659270
92669271
/*
@@ -9280,11 +9285,11 @@
92809285
SQLITE_PRIVATE void sqlite3VdbeChangeP2(Vdbe*, u32 addr, int P2);
92819286
SQLITE_PRIVATE void sqlite3VdbeChangeP3(Vdbe*, u32 addr, int P3);
92829287
SQLITE_PRIVATE void sqlite3VdbeChangeP5(Vdbe*, u8 P5);
92839288
SQLITE_PRIVATE void sqlite3VdbeJumpHere(Vdbe*, int addr);
92849289
SQLITE_PRIVATE void sqlite3VdbeChangeToNoop(Vdbe*, int addr);
9285
-SQLITE_PRIVATE void sqlite3VdbeDeleteLastOpcode(Vdbe*);
9290
+SQLITE_PRIVATE int sqlite3VdbeDeletePriorOpcode(Vdbe*, u8 op);
92869291
SQLITE_PRIVATE void sqlite3VdbeChangeP4(Vdbe*, int addr, const char *zP4, int N);
92879292
SQLITE_PRIVATE void sqlite3VdbeSetP4KeyInfo(Parse*, Index*);
92889293
SQLITE_PRIVATE void sqlite3VdbeUsesBtree(Vdbe*, int);
92899294
SQLITE_PRIVATE VdbeOp *sqlite3VdbeGetOp(Vdbe*, int);
92909295
SQLITE_PRIVATE int sqlite3VdbeMakeLabel(Vdbe*);
@@ -10746,18 +10751,19 @@
1074610751
Schema *pSchema; /* Schema that contains this table */
1074710752
Table *pNextZombie; /* Next on the Parse.pZombieTab list */
1074810753
};
1074910754
1075010755
/*
10751
-** Allowed values for Tabe.tabFlags.
10756
+** Allowed values for Table.tabFlags.
1075210757
*/
1075310758
#define TF_Readonly 0x01 /* Read-only system table */
1075410759
#define TF_Ephemeral 0x02 /* An ephemeral table */
1075510760
#define TF_HasPrimaryKey 0x04 /* Table has a primary key */
1075610761
#define TF_Autoincrement 0x08 /* Integer primary key is autoincrement */
1075710762
#define TF_Virtual 0x10 /* Is a virtual table */
1075810763
#define TF_WithoutRowid 0x20 /* No rowid used. PRIMARY KEY is the key */
10764
+#define TF_Recursive 0x40 /* Recursive reference within CTE */
1075910765
1076010766
1076110767
/*
1076210768
** Test to see whether or not a table is a virtual table. This is
1076310769
** done as a macro so that it will be optimized out when virtual
@@ -11335,10 +11341,11 @@
1133511341
int regReturn; /* Register holding return address of addrFillSub */
1133611342
u8 jointype; /* Type of join between this able and the previous */
1133711343
unsigned notIndexed :1; /* True if there is a NOT INDEXED clause */
1133811344
unsigned isCorrelated :1; /* True if sub-query is correlated */
1133911345
unsigned viaCoroutine :1; /* Implemented as a co-routine */
11346
+ unsigned isRecursive :1; /* True for recursive reference in WITH */
1134011347
#ifndef SQLITE_OMIT_EXPLAIN
1134111348
u8 iSelectId; /* If pSelect!=0, the id of the sub-select in EQP */
1134211349
#endif
1134311350
int iCursor; /* The VDBE cursor number used to access this table */
1134411351
Expr *pOn; /* The ON clause of a join */
@@ -11461,10 +11468,11 @@
1146111468
Select *pPrior; /* Prior select in a compound select statement */
1146211469
Select *pNext; /* Next select to the left in a compound */
1146311470
Select *pRightmost; /* Right-most select in a compound select statement */
1146411471
Expr *pLimit; /* LIMIT expression. NULL means not used. */
1146511472
Expr *pOffset; /* OFFSET expression. NULL means not used. */
11473
+ With *pWith; /* WITH clause attached to this select. Or NULL. */
1146611474
};
1146711475
1146811476
/*
1146911477
** Allowed values for Select.selFlags. The "SF" prefix stands for
1147011478
** "Select Flag".
@@ -11478,10 +11486,11 @@
1147811486
#define SF_UseSorter 0x0040 /* Sort using a sorter */
1147911487
#define SF_Values 0x0080 /* Synthesized from VALUES clause */
1148011488
#define SF_Materialize 0x0100 /* Force materialization of views */
1148111489
#define SF_NestedFrom 0x0200 /* Part of a parenthesized FROM clause */
1148211490
#define SF_MaybeConvert 0x0400 /* Need convertCompoundSelectToSubquery() */
11491
+#define SF_Recursive 0x0800 /* The recursive part of a recursive CTE */
1148311492
1148411493
1148511494
/*
1148611495
** The results of a select can be distributed in several ways. The
1148711496
** "SRT" prefix means "SELECT Result Type".
@@ -11498,10 +11507,11 @@
1149811507
#define SRT_Mem 6 /* Store result in a memory cell */
1149911508
#define SRT_Set 7 /* Store results as keys in an index */
1150011509
#define SRT_Table 8 /* Store result as data with an automatic rowid */
1150111510
#define SRT_EphemTab 9 /* Create transient tab and store like SRT_Table */
1150211511
#define SRT_Coroutine 10 /* Generate a single row of result */
11512
+#define SRT_DistTable 11 /* Like SRT_TABLE, but unique results only */
1150311513
1150411514
/*
1150511515
** An instance of this object describes where to put of the results of
1150611516
** a SELECT statement.
1150711517
*/
@@ -11611,10 +11621,11 @@
1161111621
int nSet; /* Number of sets used so far */
1161211622
int nOnce; /* Number of OP_Once instructions so far */
1161311623
int nOpAlloc; /* Number of slots allocated for Vdbe.aOp[] */
1161411624
int nLabel; /* Number of labels used */
1161511625
int *aLabel; /* Space to hold the labels */
11626
+ int iFixedOp; /* Never back out opcodes iFixedOp-1 or earlier */
1161611627
int ckBase; /* Base register of data during check constraints */
1161711628
int iPartIdxTab; /* Table corresponding to a partial index */
1161811629
int iCacheLevel; /* ColCache valid when aColCache[].iLevel<=iCacheLevel */
1161911630
int iCacheCnt; /* Counter used to generate aColCache[].lru values */
1162011631
struct yColCache {
@@ -11681,10 +11692,12 @@
1168111692
Token sArg; /* Complete text of a module argument */
1168211693
Table **apVtabLock; /* Pointer to virtual tables needing locking */
1168311694
#endif
1168411695
Table *pZombieTab; /* List of Table objects to delete after code gen */
1168511696
TriggerPrg *pTriggerPrg; /* Linked list of coded triggers */
11697
+ With *pWith; /* Current WITH clause, or NULL */
11698
+ u8 bFreeWith; /* True if pWith should be freed with parser */
1168611699
};
1168711700
1168811701
/*
1168911702
** Return true if currently inside an sqlite3_declare_vtab() call.
1169011703
*/
@@ -11800,11 +11813,11 @@
1180011813
u8 orconf; /* OE_Rollback etc. */
1180111814
Trigger *pTrig; /* The trigger that this step is a part of */
1180211815
Select *pSelect; /* SELECT statment or RHS of INSERT INTO .. SELECT ... */
1180311816
Token target; /* Target table for DELETE, UPDATE, INSERT */
1180411817
Expr *pWhere; /* The WHERE clause for DELETE or UPDATE steps */
11805
- ExprList *pExprList; /* SET clause for UPDATE. VALUES clause for INSERT */
11818
+ ExprList *pExprList; /* SET clause for UPDATE. */
1180611819
IdList *pIdList; /* Column names for INSERT */
1180711820
TriggerStep *pNext; /* Next in the link-list */
1180811821
TriggerStep *pLast; /* Last element in link-list. Valid for 1st elem only */
1180911822
};
1181011823
@@ -11922,13 +11935,13 @@
1192211935
** Context pointer passed down through the tree-walk.
1192311936
*/
1192411937
struct Walker {
1192511938
int (*xExprCallback)(Walker*, Expr*); /* Callback for expressions */
1192611939
int (*xSelectCallback)(Walker*,Select*); /* Callback for SELECTs */
11940
+ void (*xSelectCallback2)(Walker*,Select*);/* Second callback for SELECTs */
1192711941
Parse *pParse; /* Parser context. */
1192811942
int walkerDepth; /* Number of subqueries */
11929
- u8 bSelectDepthFirst; /* Do subqueries first */
1193011943
union { /* Extra data for callback */
1193111944
NameContext *pNC; /* Naming context */
1193211945
int i; /* Integer value */
1193311946
SrcList *pSrcList; /* FROM clause */
1193411947
struct SrcCount *pSrcCount; /* Counting column references */
@@ -11947,10 +11960,25 @@
1194711960
** callbacks.
1194811961
*/
1194911962
#define WRC_Continue 0 /* Continue down into children */
1195011963
#define WRC_Prune 1 /* Omit children but continue walking siblings */
1195111964
#define WRC_Abort 2 /* Abandon the tree walk */
11965
+
11966
+/*
11967
+** An instance of this structure represents a set of one or more CTEs
11968
+** (common table expressions) created by a single WITH clause.
11969
+*/
11970
+struct With {
11971
+ int nCte; /* Number of CTEs in the WITH clause */
11972
+ With *pOuter; /* Containing WITH clause, or NULL */
11973
+ struct Cte { /* For each CTE in the WITH clause.... */
11974
+ char *zName; /* Name of this CTE */
11975
+ ExprList *pCols; /* List of explicit column names, or NULL */
11976
+ Select *pSelect; /* The definition of this CTE */
11977
+ const char *zErr; /* Error message for circular references */
11978
+ } a[1];
11979
+};
1195211980
1195311981
/*
1195411982
** Assuming zIn points to the first byte of a UTF-8 character,
1195511983
** advance zIn to point to the first byte of the next UTF-8 character.
1195611984
*/
@@ -12215,11 +12243,11 @@
1221512243
#else
1221612244
# define sqlite3AutoincrementBegin(X)
1221712245
# define sqlite3AutoincrementEnd(X)
1221812246
#endif
1221912247
SQLITE_PRIVATE int sqlite3CodeCoroutine(Parse*, Select*, SelectDest*);
12220
-SQLITE_PRIVATE void sqlite3Insert(Parse*, SrcList*, ExprList*, Select*, IdList*, int);
12248
+SQLITE_PRIVATE void sqlite3Insert(Parse*, SrcList*, Select*, IdList*, int);
1222112249
SQLITE_PRIVATE void *sqlite3ArrayAllocate(sqlite3*,void*,int,int*,int*);
1222212250
SQLITE_PRIVATE IdList *sqlite3IdListAppend(sqlite3*, IdList*, Token*);
1222312251
SQLITE_PRIVATE int sqlite3IdListIndex(IdList*,const char*);
1222412252
SQLITE_PRIVATE SrcList *sqlite3SrcListEnlarge(sqlite3*, SrcList*, int, int);
1222512253
SQLITE_PRIVATE SrcList *sqlite3SrcListAppend(sqlite3*, SrcList*, Token*, Token*);
@@ -12309,11 +12337,11 @@
1230912337
SQLITE_PRIVATE void sqlite3ExprCodeIsNullJump(Vdbe*, const Expr*, int, int);
1231012338
SQLITE_PRIVATE int sqlite3ExprNeedsNoAffinityChange(const Expr*, char);
1231112339
SQLITE_PRIVATE int sqlite3IsRowid(const char*);
1231212340
SQLITE_PRIVATE void sqlite3GenerateRowDelete(Parse*,Table*,Trigger*,int,int,int,i16,u8,u8,u8);
1231312341
SQLITE_PRIVATE void sqlite3GenerateRowIndexDelete(Parse*, Table*, int, int, int*);
12314
-SQLITE_PRIVATE int sqlite3GenerateIndexKey(Parse*, Index*, int, int, int, int*);
12342
+SQLITE_PRIVATE int sqlite3GenerateIndexKey(Parse*, Index*, int, int, int, int*,Index*,int);
1231512343
SQLITE_PRIVATE void sqlite3GenerateConstraintChecks(Parse*,Table*,int*,int,int,int,int,
1231612344
u8,u8,int,int*);
1231712345
SQLITE_PRIVATE void sqlite3CompleteInsertion(Parse*,Table*,int,int,int,int*,int,int,int);
1231812346
SQLITE_PRIVATE int sqlite3OpenTableAndIndices(Parse*, Table*, int, int, u8*, int*, int*);
1231912347
SQLITE_PRIVATE void sqlite3BeginWriteOperation(Parse*, int, int);
@@ -12353,11 +12381,11 @@
1235312381
SQLITE_PRIVATE void sqlite3CodeRowTriggerDirect(Parse *, Trigger *, Table *, int, int, int);
1235412382
void sqliteViewTriggers(Parse*, Table*, Expr*, int, ExprList*);
1235512383
SQLITE_PRIVATE void sqlite3DeleteTriggerStep(sqlite3*, TriggerStep*);
1235612384
SQLITE_PRIVATE TriggerStep *sqlite3TriggerSelectStep(sqlite3*,Select*);
1235712385
SQLITE_PRIVATE TriggerStep *sqlite3TriggerInsertStep(sqlite3*,Token*, IdList*,
12358
- ExprList*,Select*,u8);
12386
+ Select*,u8);
1235912387
SQLITE_PRIVATE TriggerStep *sqlite3TriggerUpdateStep(sqlite3*,Token*,ExprList*, Expr*, u8);
1236012388
SQLITE_PRIVATE TriggerStep *sqlite3TriggerDeleteStep(sqlite3*,Token*, Expr*);
1236112389
SQLITE_PRIVATE void sqlite3DeleteTrigger(sqlite3*, Trigger*);
1236212390
SQLITE_PRIVATE void sqlite3UnlinkAndDeleteTrigger(sqlite3*,int,const char*);
1236312391
SQLITE_PRIVATE u32 sqlite3TriggerColmask(Parse*,Trigger*,ExprList*,int,int,Table*,int);
@@ -12646,10 +12674,18 @@
1264612674
SQLITE_PRIVATE const char *sqlite3JournalModename(int);
1264712675
#ifndef SQLITE_OMIT_WAL
1264812676
SQLITE_PRIVATE int sqlite3Checkpoint(sqlite3*, int, int, int*, int*);
1264912677
SQLITE_PRIVATE int sqlite3WalDefaultHook(void*,sqlite3*,const char*,int);
1265012678
#endif
12679
+#ifndef SQLITE_OMIT_CTE
12680
+SQLITE_PRIVATE With *sqlite3WithAdd(Parse*,With*,Token*,ExprList*,Select*);
12681
+SQLITE_PRIVATE void sqlite3WithDelete(sqlite3*,With*);
12682
+SQLITE_PRIVATE void sqlite3WithPush(Parse*, With*, u8);
12683
+#else
12684
+#define sqlite3WithPush(x,y,z)
12685
+#define sqlite3WithDelete(x,y)
12686
+#endif
1265112687
1265212688
/* Declarations for functions in fkey.c. All of these are replaced by
1265312689
** no-op macros if OMIT_FOREIGN_KEY is defined. In this case no foreign
1265412690
** key functionality is available. If OMIT_TRIGGER is defined but
1265512691
** OMIT_FOREIGN_KEY is not, only some of the functions are no-oped. In
@@ -23143,109 +23179,110 @@
2314323179
/* 49 */ "VerifyCookie" OpHelp(""),
2314423180
/* 50 */ "OpenRead" OpHelp("root=P2 iDb=P3"),
2314523181
/* 51 */ "OpenWrite" OpHelp("root=P2 iDb=P3"),
2314623182
/* 52 */ "OpenAutoindex" OpHelp("nColumn=P2"),
2314723183
/* 53 */ "OpenEphemeral" OpHelp("nColumn=P2"),
23148
- /* 54 */ "SorterOpen" OpHelp(""),
23149
- /* 55 */ "OpenPseudo" OpHelp("content in r[P2@P3]"),
23150
- /* 56 */ "Close" OpHelp(""),
23151
- /* 57 */ "SeekLt" OpHelp("key=r[P3@P4]"),
23152
- /* 58 */ "SeekLe" OpHelp("key=r[P3@P4]"),
23153
- /* 59 */ "SeekGe" OpHelp("key=r[P3@P4]"),
23154
- /* 60 */ "SeekGt" OpHelp("key=r[P3@P4]"),
23155
- /* 61 */ "Seek" OpHelp("intkey=r[P2]"),
23156
- /* 62 */ "NoConflict" OpHelp("key=r[P3@P4]"),
23157
- /* 63 */ "NotFound" OpHelp("key=r[P3@P4]"),
23158
- /* 64 */ "Found" OpHelp("key=r[P3@P4]"),
23159
- /* 65 */ "NotExists" OpHelp("intkey=r[P3]"),
23160
- /* 66 */ "Sequence" OpHelp("r[P2]=rowid"),
23161
- /* 67 */ "NewRowid" OpHelp("r[P2]=rowid"),
23162
- /* 68 */ "Insert" OpHelp("intkey=r[P3] data=r[P2]"),
23163
- /* 69 */ "Or" OpHelp("r[P3]=(r[P1] || r[P2])"),
23164
- /* 70 */ "And" OpHelp("r[P3]=(r[P1] && r[P2])"),
23165
- /* 71 */ "InsertInt" OpHelp("intkey=P3 data=r[P2]"),
23166
- /* 72 */ "Delete" OpHelp(""),
23167
- /* 73 */ "ResetCount" OpHelp(""),
23168
- /* 74 */ "IsNull" OpHelp("if r[P1]==NULL goto P2"),
23169
- /* 75 */ "NotNull" OpHelp("if r[P1]!=NULL goto P2"),
23170
- /* 76 */ "Ne" OpHelp("if r[P1]!=r[P3] goto P2"),
23171
- /* 77 */ "Eq" OpHelp("if r[P1]==r[P3] goto P2"),
23172
- /* 78 */ "Gt" OpHelp("if r[P1]>r[P3] goto P2"),
23173
- /* 79 */ "Le" OpHelp("if r[P1]<=r[P3] goto P2"),
23174
- /* 80 */ "Lt" OpHelp("if r[P1]<r[P3] goto P2"),
23175
- /* 81 */ "Ge" OpHelp("if r[P1]>=r[P3] goto P2"),
23176
- /* 82 */ "SorterCompare" OpHelp("if key(P1)!=rtrim(r[P3],P4) goto P2"),
23177
- /* 83 */ "BitAnd" OpHelp("r[P3]=r[P1]&r[P2]"),
23178
- /* 84 */ "BitOr" OpHelp("r[P3]=r[P1]|r[P2]"),
23179
- /* 85 */ "ShiftLeft" OpHelp("r[P3]=r[P2]<<r[P1]"),
23180
- /* 86 */ "ShiftRight" OpHelp("r[P3]=r[P2]>>r[P1]"),
23181
- /* 87 */ "Add" OpHelp("r[P3]=r[P1]+r[P2]"),
23182
- /* 88 */ "Subtract" OpHelp("r[P3]=r[P2]-r[P1]"),
23183
- /* 89 */ "Multiply" OpHelp("r[P3]=r[P1]*r[P2]"),
23184
- /* 90 */ "Divide" OpHelp("r[P3]=r[P2]/r[P1]"),
23185
- /* 91 */ "Remainder" OpHelp("r[P3]=r[P2]%r[P1]"),
23186
- /* 92 */ "Concat" OpHelp("r[P3]=r[P2]+r[P1]"),
23187
- /* 93 */ "SorterData" OpHelp("r[P2]=data"),
23188
- /* 94 */ "BitNot" OpHelp("r[P1]= ~r[P1]"),
23189
- /* 95 */ "String8" OpHelp("r[P2]='P4'"),
23190
- /* 96 */ "RowKey" OpHelp("r[P2]=key"),
23191
- /* 97 */ "RowData" OpHelp("r[P2]=data"),
23192
- /* 98 */ "Rowid" OpHelp("r[P2]=rowid"),
23193
- /* 99 */ "NullRow" OpHelp(""),
23194
- /* 100 */ "Last" OpHelp(""),
23195
- /* 101 */ "SorterSort" OpHelp(""),
23196
- /* 102 */ "Sort" OpHelp(""),
23197
- /* 103 */ "Rewind" OpHelp(""),
23198
- /* 104 */ "SorterInsert" OpHelp(""),
23199
- /* 105 */ "IdxInsert" OpHelp("key=r[P2]"),
23200
- /* 106 */ "IdxDelete" OpHelp("key=r[P2@P3]"),
23201
- /* 107 */ "IdxRowid" OpHelp("r[P2]=rowid"),
23202
- /* 108 */ "IdxLT" OpHelp("key=r[P3@P4]"),
23203
- /* 109 */ "IdxGE" OpHelp("key=r[P3@P4]"),
23204
- /* 110 */ "Destroy" OpHelp(""),
23205
- /* 111 */ "Clear" OpHelp(""),
23206
- /* 112 */ "CreateIndex" OpHelp("r[P2]=root iDb=P1"),
23207
- /* 113 */ "CreateTable" OpHelp("r[P2]=root iDb=P1"),
23208
- /* 114 */ "ParseSchema" OpHelp(""),
23209
- /* 115 */ "LoadAnalysis" OpHelp(""),
23210
- /* 116 */ "DropTable" OpHelp(""),
23211
- /* 117 */ "DropIndex" OpHelp(""),
23212
- /* 118 */ "DropTrigger" OpHelp(""),
23213
- /* 119 */ "IntegrityCk" OpHelp(""),
23214
- /* 120 */ "RowSetAdd" OpHelp("rowset(P1)=r[P2]"),
23215
- /* 121 */ "RowSetRead" OpHelp("r[P3]=rowset(P1)"),
23216
- /* 122 */ "RowSetTest" OpHelp("if r[P3] in rowset(P1) goto P2"),
23217
- /* 123 */ "Program" OpHelp(""),
23218
- /* 124 */ "Param" OpHelp(""),
23219
- /* 125 */ "FkCounter" OpHelp("fkctr[P1]+=P2"),
23220
- /* 126 */ "FkIfZero" OpHelp("if fkctr[P1]==0 goto P2"),
23221
- /* 127 */ "MemMax" OpHelp("r[P1]=max(r[P1],r[P2])"),
23222
- /* 128 */ "IfPos" OpHelp("if r[P1]>0 goto P2"),
23223
- /* 129 */ "IfNeg" OpHelp("if r[P1]<0 goto P2"),
23224
- /* 130 */ "IfZero" OpHelp("r[P1]+=P3, if r[P1]==0 goto P2"),
23225
- /* 131 */ "Real" OpHelp("r[P2]=P4"),
23184
+ /* 54 */ "SwapCursors" OpHelp(""),
23185
+ /* 55 */ "SorterOpen" OpHelp(""),
23186
+ /* 56 */ "OpenPseudo" OpHelp("content in r[P2@P3]"),
23187
+ /* 57 */ "Close" OpHelp(""),
23188
+ /* 58 */ "SeekLt" OpHelp("key=r[P3@P4]"),
23189
+ /* 59 */ "SeekLe" OpHelp("key=r[P3@P4]"),
23190
+ /* 60 */ "SeekGe" OpHelp("key=r[P3@P4]"),
23191
+ /* 61 */ "SeekGt" OpHelp("key=r[P3@P4]"),
23192
+ /* 62 */ "Seek" OpHelp("intkey=r[P2]"),
23193
+ /* 63 */ "NoConflict" OpHelp("key=r[P3@P4]"),
23194
+ /* 64 */ "NotFound" OpHelp("key=r[P3@P4]"),
23195
+ /* 65 */ "Found" OpHelp("key=r[P3@P4]"),
23196
+ /* 66 */ "NotExists" OpHelp("intkey=r[P3]"),
23197
+ /* 67 */ "Sequence" OpHelp("r[P2]=rowid"),
23198
+ /* 68 */ "NewRowid" OpHelp("r[P2]=rowid"),
23199
+ /* 69 */ "Insert" OpHelp("intkey=r[P3] data=r[P2]"),
23200
+ /* 70 */ "InsertInt" OpHelp("intkey=P3 data=r[P2]"),
23201
+ /* 71 */ "Or" OpHelp("r[P3]=(r[P1] || r[P2])"),
23202
+ /* 72 */ "And" OpHelp("r[P3]=(r[P1] && r[P2])"),
23203
+ /* 73 */ "Delete" OpHelp(""),
23204
+ /* 74 */ "ResetCount" OpHelp(""),
23205
+ /* 75 */ "SorterCompare" OpHelp("if key(P1)!=rtrim(r[P3],P4) goto P2"),
23206
+ /* 76 */ "IsNull" OpHelp("if r[P1]==NULL goto P2"),
23207
+ /* 77 */ "NotNull" OpHelp("if r[P1]!=NULL goto P2"),
23208
+ /* 78 */ "Ne" OpHelp("if r[P1]!=r[P3] goto P2"),
23209
+ /* 79 */ "Eq" OpHelp("if r[P1]==r[P3] goto P2"),
23210
+ /* 80 */ "Gt" OpHelp("if r[P1]>r[P3] goto P2"),
23211
+ /* 81 */ "Le" OpHelp("if r[P1]<=r[P3] goto P2"),
23212
+ /* 82 */ "Lt" OpHelp("if r[P1]<r[P3] goto P2"),
23213
+ /* 83 */ "Ge" OpHelp("if r[P1]>=r[P3] goto P2"),
23214
+ /* 84 */ "SorterData" OpHelp("r[P2]=data"),
23215
+ /* 85 */ "BitAnd" OpHelp("r[P3]=r[P1]&r[P2]"),
23216
+ /* 86 */ "BitOr" OpHelp("r[P3]=r[P1]|r[P2]"),
23217
+ /* 87 */ "ShiftLeft" OpHelp("r[P3]=r[P2]<<r[P1]"),
23218
+ /* 88 */ "ShiftRight" OpHelp("r[P3]=r[P2]>>r[P1]"),
23219
+ /* 89 */ "Add" OpHelp("r[P3]=r[P1]+r[P2]"),
23220
+ /* 90 */ "Subtract" OpHelp("r[P3]=r[P2]-r[P1]"),
23221
+ /* 91 */ "Multiply" OpHelp("r[P3]=r[P1]*r[P2]"),
23222
+ /* 92 */ "Divide" OpHelp("r[P3]=r[P2]/r[P1]"),
23223
+ /* 93 */ "Remainder" OpHelp("r[P3]=r[P2]%r[P1]"),
23224
+ /* 94 */ "Concat" OpHelp("r[P3]=r[P2]+r[P1]"),
23225
+ /* 95 */ "RowKey" OpHelp("r[P2]=key"),
23226
+ /* 96 */ "BitNot" OpHelp("r[P1]= ~r[P1]"),
23227
+ /* 97 */ "String8" OpHelp("r[P2]='P4'"),
23228
+ /* 98 */ "RowData" OpHelp("r[P2]=data"),
23229
+ /* 99 */ "Rowid" OpHelp("r[P2]=rowid"),
23230
+ /* 100 */ "NullRow" OpHelp(""),
23231
+ /* 101 */ "Last" OpHelp(""),
23232
+ /* 102 */ "SorterSort" OpHelp(""),
23233
+ /* 103 */ "Sort" OpHelp(""),
23234
+ /* 104 */ "Rewind" OpHelp(""),
23235
+ /* 105 */ "SorterInsert" OpHelp(""),
23236
+ /* 106 */ "IdxInsert" OpHelp("key=r[P2]"),
23237
+ /* 107 */ "IdxDelete" OpHelp("key=r[P2@P3]"),
23238
+ /* 108 */ "IdxRowid" OpHelp("r[P2]=rowid"),
23239
+ /* 109 */ "IdxLT" OpHelp("key=r[P3@P4]"),
23240
+ /* 110 */ "IdxGE" OpHelp("key=r[P3@P4]"),
23241
+ /* 111 */ "Destroy" OpHelp(""),
23242
+ /* 112 */ "Clear" OpHelp(""),
23243
+ /* 113 */ "CreateIndex" OpHelp("r[P2]=root iDb=P1"),
23244
+ /* 114 */ "CreateTable" OpHelp("r[P2]=root iDb=P1"),
23245
+ /* 115 */ "ParseSchema" OpHelp(""),
23246
+ /* 116 */ "LoadAnalysis" OpHelp(""),
23247
+ /* 117 */ "DropTable" OpHelp(""),
23248
+ /* 118 */ "DropIndex" OpHelp(""),
23249
+ /* 119 */ "DropTrigger" OpHelp(""),
23250
+ /* 120 */ "IntegrityCk" OpHelp(""),
23251
+ /* 121 */ "RowSetAdd" OpHelp("rowset(P1)=r[P2]"),
23252
+ /* 122 */ "RowSetRead" OpHelp("r[P3]=rowset(P1)"),
23253
+ /* 123 */ "RowSetTest" OpHelp("if r[P3] in rowset(P1) goto P2"),
23254
+ /* 124 */ "Program" OpHelp(""),
23255
+ /* 125 */ "Param" OpHelp(""),
23256
+ /* 126 */ "FkCounter" OpHelp("fkctr[P1]+=P2"),
23257
+ /* 127 */ "FkIfZero" OpHelp("if fkctr[P1]==0 goto P2"),
23258
+ /* 128 */ "MemMax" OpHelp("r[P1]=max(r[P1],r[P2])"),
23259
+ /* 129 */ "IfPos" OpHelp("if r[P1]>0 goto P2"),
23260
+ /* 130 */ "IfNeg" OpHelp("if r[P1]<0 goto P2"),
23261
+ /* 131 */ "IfZero" OpHelp("r[P1]+=P3, if r[P1]==0 goto P2"),
2322623262
/* 132 */ "AggFinal" OpHelp("accum=r[P1] N=P2"),
23227
- /* 133 */ "IncrVacuum" OpHelp(""),
23228
- /* 134 */ "Expire" OpHelp(""),
23229
- /* 135 */ "TableLock" OpHelp("iDb=P1 root=P2 write=P3"),
23230
- /* 136 */ "VBegin" OpHelp(""),
23231
- /* 137 */ "VCreate" OpHelp(""),
23232
- /* 138 */ "VDestroy" OpHelp(""),
23233
- /* 139 */ "VOpen" OpHelp(""),
23234
- /* 140 */ "VColumn" OpHelp("r[P3]=vcolumn(P2)"),
23235
- /* 141 */ "VNext" OpHelp(""),
23236
- /* 142 */ "ToText" OpHelp(""),
23237
- /* 143 */ "ToBlob" OpHelp(""),
23238
- /* 144 */ "ToNumeric" OpHelp(""),
23239
- /* 145 */ "ToInt" OpHelp(""),
23240
- /* 146 */ "ToReal" OpHelp(""),
23241
- /* 147 */ "VRename" OpHelp(""),
23242
- /* 148 */ "Pagecount" OpHelp(""),
23243
- /* 149 */ "MaxPgcnt" OpHelp(""),
23244
- /* 150 */ "Trace" OpHelp(""),
23245
- /* 151 */ "Noop" OpHelp(""),
23246
- /* 152 */ "Explain" OpHelp(""),
23263
+ /* 133 */ "Real" OpHelp("r[P2]=P4"),
23264
+ /* 134 */ "IncrVacuum" OpHelp(""),
23265
+ /* 135 */ "Expire" OpHelp(""),
23266
+ /* 136 */ "TableLock" OpHelp("iDb=P1 root=P2 write=P3"),
23267
+ /* 137 */ "VBegin" OpHelp(""),
23268
+ /* 138 */ "VCreate" OpHelp(""),
23269
+ /* 139 */ "VDestroy" OpHelp(""),
23270
+ /* 140 */ "VOpen" OpHelp(""),
23271
+ /* 141 */ "VColumn" OpHelp("r[P3]=vcolumn(P2)"),
23272
+ /* 142 */ "VNext" OpHelp(""),
23273
+ /* 143 */ "ToText" OpHelp(""),
23274
+ /* 144 */ "ToBlob" OpHelp(""),
23275
+ /* 145 */ "ToNumeric" OpHelp(""),
23276
+ /* 146 */ "ToInt" OpHelp(""),
23277
+ /* 147 */ "ToReal" OpHelp(""),
23278
+ /* 148 */ "VRename" OpHelp(""),
23279
+ /* 149 */ "Pagecount" OpHelp(""),
23280
+ /* 150 */ "MaxPgcnt" OpHelp(""),
23281
+ /* 151 */ "Trace" OpHelp(""),
23282
+ /* 152 */ "Noop" OpHelp(""),
23283
+ /* 153 */ "Explain" OpHelp(""),
2324723284
};
2324823285
return azName[i];
2324923286
}
2325023287
#endif
2325123288
@@ -28306,14 +28343,14 @@
2830628343
** Or, if the third argument is NULL, then this function is being called
2830728344
** to inform the VFS layer that, according to POSIX, any existing mapping
2830828345
** may now be invalid and should be unmapped.
2830928346
*/
2831028347
static int unixUnfetch(sqlite3_file *fd, i64 iOff, void *p){
28348
+#if SQLITE_MAX_MMAP_SIZE>0
2831128349
unixFile *pFd = (unixFile *)fd; /* The underlying database file */
2831228350
UNUSED_PARAMETER(iOff);
2831328351
28314
-#if SQLITE_MAX_MMAP_SIZE>0
2831528352
/* If p==0 (unmap the entire file) then there must be no outstanding
2831628353
** xFetch references. Or, if p!=0 (meaning it is an xFetch reference),
2831728354
** then there must be at least one outstanding. */
2831828355
assert( (p==0)==(pFd->nFetchOut==0) );
2831928356
@@ -28325,10 +28362,14 @@
2832528362
}else{
2832628363
unixUnmapfile(pFd);
2832728364
}
2832828365
2832928366
assert( pFd->nFetchOut>=0 );
28367
+#else
28368
+ UNUSED_PARAMETER(fd);
28369
+ UNUSED_PARAMETER(p);
28370
+ UNUSED_PARAMETER(iOff);
2833028371
#endif
2833128372
return SQLITE_OK;
2833228373
}
2833328374
2833428375
/*
@@ -34366,11 +34407,11 @@
3436634407
sqlite3_mutex_enter(sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MASTER));
3436734408
}
3436834409
static void winShmLeaveMutex(void){
3436934410
sqlite3_mutex_leave(sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MASTER));
3437034411
}
34371
-#ifdef SQLITE_DEBUG
34412
+#ifndef NDEBUG
3437234413
static int winShmMutexHeld(void) {
3437334414
return sqlite3_mutex_held(sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MASTER));
3437434415
}
3437534416
#endif
3437634417
@@ -57919,18 +57960,20 @@
5791957960
){
5792057961
MemPage *pPage;
5792157962
int rc;
5792257963
unsigned char *pCell;
5792357964
int i;
57965
+ int hdr;
5792457966
5792557967
assert( sqlite3_mutex_held(pBt->mutex) );
5792657968
if( pgno>btreePagecount(pBt) ){
5792757969
return SQLITE_CORRUPT_BKPT;
5792857970
}
5792957971
5793057972
rc = getAndInitPage(pBt, pgno, &pPage, 0);
5793157973
if( rc ) return rc;
57974
+ hdr = pPage->hdrOffset;
5793257975
for(i=0; i<pPage->nCell; i++){
5793357976
pCell = findCell(pPage, i);
5793457977
if( !pPage->leaf ){
5793557978
rc = clearDatabasePage(pBt, get4byte(pCell), 1, pnChange);
5793657979
if( rc ) goto cleardatabasepage_out;
@@ -57937,20 +57980,20 @@
5793757980
}
5793857981
rc = clearCell(pPage, pCell);
5793957982
if( rc ) goto cleardatabasepage_out;
5794057983
}
5794157984
if( !pPage->leaf ){
57942
- rc = clearDatabasePage(pBt, get4byte(&pPage->aData[8]), 1, pnChange);
57985
+ rc = clearDatabasePage(pBt, get4byte(&pPage->aData[hdr+8]), 1, pnChange);
5794357986
if( rc ) goto cleardatabasepage_out;
5794457987
}else if( pnChange ){
5794557988
assert( pPage->intKey );
5794657989
*pnChange += pPage->nCell;
5794757990
}
5794857991
if( freePageFlag ){
5794957992
freePage(pPage, &rc);
5795057993
}else if( (rc = sqlite3PagerWrite(pPage->pDbPage))==0 ){
57951
- zeroPage(pPage, pPage->aData[0] | PTF_LEAF);
57994
+ zeroPage(pPage, pPage->aData[hdr] | PTF_LEAF);
5795257995
}
5795357996
5795457997
cleardatabasepage_out:
5795557998
releasePage(pPage);
5795657999
return rc;
@@ -61463,10 +61506,11 @@
6146361506
assert( v->magic==VDBE_MAGIC_INIT );
6146461507
assert( j<p->nLabel );
6146561508
if( j>=0 && p->aLabel ){
6146661509
p->aLabel[j] = v->nOp;
6146761510
}
61511
+ p->iFixedOp = v->nOp - 1;
6146861512
}
6146961513
6147061514
/*
6147161515
** Mark the VDBE as one that can only be run one time.
6147261516
*/
@@ -61811,11 +61855,12 @@
6181161855
/*
6181261856
** Change the P2 operand of instruction addr so that it points to
6181361857
** the address of the next instruction to be coded.
6181461858
*/
6181561859
SQLITE_PRIVATE void sqlite3VdbeJumpHere(Vdbe *p, int addr){
61816
- if( ALWAYS(addr>=0) ) sqlite3VdbeChangeP2(p, addr, p->nOp);
61860
+ sqlite3VdbeChangeP2(p, addr, p->nOp);
61861
+ p->pParse->iFixedOp = p->nOp - 1;
6181761862
}
6181861863
6181961864
6182061865
/*
6182161866
** If the input FuncDef structure is ephemeral, then free it. If
@@ -61916,12 +61961,17 @@
6191661961
}
6191761962
6191861963
/*
6191961964
** Remove the last opcode inserted
6192061965
*/
61921
-SQLITE_PRIVATE void sqlite3VdbeDeleteLastOpcode(Vdbe *p){
61922
- p->nOp--;
61966
+SQLITE_PRIVATE int sqlite3VdbeDeletePriorOpcode(Vdbe *p, u8 op){
61967
+ if( (p->nOp-1)>(p->pParse->iFixedOp) && p->aOp[p->nOp-1].opcode==op ){
61968
+ sqlite3VdbeChangeToNoop(p, p->nOp-1);
61969
+ return 1;
61970
+ }else{
61971
+ return 0;
61972
+ }
6192361973
}
6192461974
6192561975
/*
6192661976
** Change the value of the P4 operand for a specific instruction.
6192761977
** This routine is useful when a large program is loaded from a
@@ -69688,10 +69738,37 @@
6968869738
}
6968969739
pCx->isOrdered = (pOp->p5!=BTREE_UNORDERED);
6969069740
break;
6969169741
}
6969269742
69743
+#ifndef SQLITE_OMIT_CTE
69744
+/* Opcode: SwapCursors P1 P2 * * *
69745
+**
69746
+** Parameters P1 and P2 are both cursors opened by the OpenEphemeral
69747
+** opcode. This opcode deletes the contents of epheremal table P1,
69748
+** then renames P2 to P1 and P1 to P2. In other words, following this
69749
+** opcode cursor P2 is open on an empty table and P1 is open on the
69750
+** table that was initially accessed by P2.
69751
+*/
69752
+case OP_SwapCursors: {
69753
+ Mem tmp;
69754
+ VdbeCursor *pTmp;
69755
+
69756
+ tmp = p->aMem[p->nMem - pOp->p1];
69757
+ p->aMem[p->nMem - pOp->p1] = p->aMem[p->nMem - pOp->p2];
69758
+ p->aMem[p->nMem - pOp->p2] = tmp;
69759
+
69760
+ pTmp = p->apCsr[pOp->p1];
69761
+ p->apCsr[pOp->p1] = p->apCsr[pOp->p2];
69762
+ p->apCsr[pOp->p2] = pTmp;
69763
+
69764
+ assert( pTmp->isTable );
69765
+ rc = sqlite3BtreeClearTable(pTmp->pBt, MASTER_ROOT, 0);
69766
+ break;
69767
+}
69768
+#endif /* ifndef SQLITE_OMIT_CTE */
69769
+
6969369770
/* Opcode: SorterOpen P1 * * P4 *
6969469771
**
6969569772
** This opcode works like OP_OpenEphemeral except that it opens
6969669773
** a transient index that is specifically designed to sort large
6969769774
** tables using an external merge-sort algorithm.
@@ -74781,42 +74858,43 @@
7478174858
}
7478274859
7478374860
/*
7478474861
** Call sqlite3WalkExpr() for every expression in Select statement p.
7478574862
** Invoke sqlite3WalkSelect() for subqueries in the FROM clause and
74786
-** on the compound select chain, p->pPrior. Invoke the xSelectCallback()
74787
-** either before or after the walk of expressions and FROM clause, depending
74788
-** on whether pWalker->bSelectDepthFirst is false or true, respectively.
74863
+** on the compound select chain, p->pPrior.
74864
+**
74865
+** If it is not NULL, the xSelectCallback() callback is invoked before
74866
+** the walk of the expressions and FROM clause. The xSelectCallback2()
74867
+** method, if it is not NULL, is invoked following the walk of the
74868
+** expressions and FROM clause.
7478974869
**
7479074870
** Return WRC_Continue under normal conditions. Return WRC_Abort if
7479174871
** there is an abort request.
7479274872
**
7479374873
** If the Walker does not have an xSelectCallback() then this routine
7479474874
** is a no-op returning WRC_Continue.
7479574875
*/
7479674876
SQLITE_PRIVATE int sqlite3WalkSelect(Walker *pWalker, Select *p){
7479774877
int rc;
74798
- if( p==0 || pWalker->xSelectCallback==0 ) return WRC_Continue;
74878
+ if( p==0 || (pWalker->xSelectCallback==0 && pWalker->xSelectCallback2==0) ){
74879
+ return WRC_Continue;
74880
+ }
7479974881
rc = WRC_Continue;
7480074882
pWalker->walkerDepth++;
7480174883
while( p ){
74802
- if( !pWalker->bSelectDepthFirst ){
74884
+ if( pWalker->xSelectCallback ){
7480374885
rc = pWalker->xSelectCallback(pWalker, p);
7480474886
if( rc ) break;
7480574887
}
7480674888
if( sqlite3WalkSelectExpr(pWalker, p)
7480774889
|| sqlite3WalkSelectFrom(pWalker, p)
7480874890
){
7480974891
pWalker->walkerDepth--;
7481074892
return WRC_Abort;
7481174893
}
74812
- if( pWalker->bSelectDepthFirst ){
74813
- rc = pWalker->xSelectCallback(pWalker, p);
74814
- /* Depth-first search is currently only used for
74815
- ** selectAddSubqueryTypeInfo() and that routine always returns
74816
- ** WRC_Continue (0). So the following branch is never taken. */
74817
- if( NEVER(rc) ) break;
74894
+ if( pWalker->xSelectCallback2 ){
74895
+ pWalker->xSelectCallback2(pWalker, p);
7481874896
}
7481974897
p = p->pPrior;
7482074898
}
7482174899
pWalker->walkerDepth--;
7482274900
return rc & WRC_Abort;
@@ -77170,10 +77248,37 @@
7717077248
}
7717177249
}
7717277250
return pNew;
7717377251
}
7717477252
77253
+/*
77254
+** Create and return a deep copy of the object passed as the second
77255
+** argument. If an OOM condition is encountered, NULL is returned
77256
+** and the db->mallocFailed flag set.
77257
+*/
77258
+#ifndef SQLITE_OMIT_CTE
77259
+static With *withDup(sqlite3 *db, With *p){
77260
+ With *pRet = 0;
77261
+ if( p ){
77262
+ int nByte = sizeof(*p) + sizeof(p->a[0]) * (p->nCte-1);
77263
+ pRet = sqlite3DbMallocZero(db, nByte);
77264
+ if( pRet ){
77265
+ int i;
77266
+ pRet->nCte = p->nCte;
77267
+ for(i=0; i<p->nCte; i++){
77268
+ pRet->a[i].pSelect = sqlite3SelectDup(db, p->a[i].pSelect, 0);
77269
+ pRet->a[i].pCols = sqlite3ExprListDup(db, p->a[i].pCols, 0);
77270
+ pRet->a[i].zName = sqlite3DbStrDup(db, p->a[i].zName);
77271
+ }
77272
+ }
77273
+ }
77274
+ return pRet;
77275
+}
77276
+#else
77277
+# define withDup(x,y) 0
77278
+#endif
77279
+
7717577280
/*
7717677281
** The following group of routines make deep copies of expressions,
7717777282
** expression lists, ID lists, and select statements. The copies can
7717877283
** be deleted (by being passed to their respective ...Delete() routines)
7717977284
** without effecting the originals.
@@ -77250,10 +77355,11 @@
7725077355
pNewItem->iCursor = pOldItem->iCursor;
7725177356
pNewItem->addrFillSub = pOldItem->addrFillSub;
7725277357
pNewItem->regReturn = pOldItem->regReturn;
7725377358
pNewItem->isCorrelated = pOldItem->isCorrelated;
7725477359
pNewItem->viaCoroutine = pOldItem->viaCoroutine;
77360
+ pNewItem->isRecursive = pOldItem->isRecursive;
7725577361
pNewItem->zIndex = sqlite3DbStrDup(db, pOldItem->zIndex);
7725677362
pNewItem->notIndexed = pOldItem->notIndexed;
7725777363
pNewItem->pIndex = pOldItem->pIndex;
7725877364
pTab = pNewItem->pTab = pOldItem->pTab;
7725977365
if( pTab ){
@@ -77311,10 +77417,11 @@
7731177417
pNew->selFlags = p->selFlags & ~SF_UsesEphemeral;
7731277418
pNew->pRightmost = 0;
7731377419
pNew->addrOpenEphm[0] = -1;
7731477420
pNew->addrOpenEphm[1] = -1;
7731577421
pNew->addrOpenEphm[2] = -1;
77422
+ pNew->pWith = withDup(db, p->pWith);
7731677423
return pNew;
7731777424
}
7731877425
#else
7731977426
SQLITE_PRIVATE Select *sqlite3SelectDup(sqlite3 *db, Select *p, int flags){
7732077427
assert( p==0 );
@@ -77830,13 +77937,15 @@
7783077937
pTab = p->pSrc->a[0].pTab;
7783177938
pExpr = p->pEList->a[0].pExpr;
7783277939
iCol = (i16)pExpr->iColumn;
7783377940
7783477941
/* Code an OP_VerifyCookie and OP_TableLock for <table>. */
77835
- iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
77836
- sqlite3CodeVerifySchema(pParse, iDb);
77837
- sqlite3TableLock(pParse, iDb, pTab->tnum, 0, pTab->zName);
77942
+ if( ALWAYS(pTab->pSchema) ){
77943
+ iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
77944
+ sqlite3CodeVerifySchema(pParse, iDb);
77945
+ sqlite3TableLock(pParse, iDb, pTab->tnum, 0, pTab->zName);
77946
+ }
7783877947
7783977948
/* This function is only called from two places. In both cases the vdbe
7784077949
** has already been allocated. So assume sqlite3GetVdbe() is always
7784177950
** successful here.
7784277951
*/
@@ -79663,11 +79772,11 @@
7966379772
sqlite3ExplainPush(pOut);
7966479773
for(i=0; i<pList->nExpr; i++){
7966579774
sqlite3ExplainPrintf(pOut, "item[%d] = ", i);
7966679775
sqlite3ExplainPush(pOut);
7966779776
sqlite3ExplainExpr(pOut, pList->a[i].pExpr);
79668
- sqlite3ExplainPop(pOut, 1);
79777
+ sqlite3ExplainPop(pOut);
7966979778
if( pList->a[i].zName ){
7967079779
sqlite3ExplainPrintf(pOut, " AS %s", pList->a[i].zName);
7967179780
}
7967279781
if( pList->a[i].bSpanIsTab ){
7967379782
sqlite3ExplainPrintf(pOut, " (%s)", pList->a[i].zSpan);
@@ -84091,10 +84200,11 @@
8409184200
*/
8409284201
v = sqlite3GetVdbe(pParse);
8409384202
assert( !pParse->isMultiWrite
8409484203
|| sqlite3VdbeAssertMayAbort(v, pParse->mayAbort));
8409584204
if( v ){
84205
+ while( sqlite3VdbeDeletePriorOpcode(v, OP_Close) ){}
8409684206
sqlite3VdbeAddOp0(v, OP_Halt);
8409784207
8409884208
/* The cookie mask contains one bit for each database file open.
8409984209
** (Bit 0 is for main, bit 1 is for temp, and so forth.) Bits are
8410084210
** set for each database that is used. Generate code to start a
@@ -85402,14 +85512,14 @@
8540285512
i = *pIdx;
8540385513
8540485514
for(j=0; zIdent[j]; j++){
8540585515
if( !sqlite3Isalnum(zIdent[j]) && zIdent[j]!='_' ) break;
8540685516
}
85407
- needQuote = sqlite3Isdigit(zIdent[0]) || sqlite3KeywordCode(zIdent, j)!=TK_ID;
85408
- if( !needQuote ){
85409
- needQuote = zIdent[j];
85410
- }
85517
+ needQuote = sqlite3Isdigit(zIdent[0])
85518
+ || sqlite3KeywordCode(zIdent, j)!=TK_ID
85519
+ || zIdent[j]!=0
85520
+ || j==0;
8541185521
8541285522
if( needQuote ) z[i++] = '"';
8541385523
for(j=0; zIdent[j]; j++){
8541485524
z[i++] = zIdent[j];
8541585525
if( zIdent[j]=='"' ) z[i++] = '"';
@@ -86628,11 +86738,11 @@
8662886738
** records into the sorter. */
8662986739
sqlite3OpenTable(pParse, iTab, iDb, pTab, OP_OpenRead);
8663086740
addr1 = sqlite3VdbeAddOp2(v, OP_Rewind, iTab, 0);
8663186741
regRecord = sqlite3GetTempReg(pParse);
8663286742
86633
- sqlite3GenerateIndexKey(pParse, pIndex, iTab, regRecord, 0, &iPartIdxLabel);
86743
+ sqlite3GenerateIndexKey(pParse,pIndex,iTab,regRecord,0,&iPartIdxLabel,0,0);
8663486744
sqlite3VdbeAddOp2(v, OP_SorterInsert, iSorter, regRecord);
8663586745
sqlite3VdbeResolveLabel(v, iPartIdxLabel);
8663686746
sqlite3VdbeAddOp2(v, OP_Next, iTab, addr1+1);
8663786747
sqlite3VdbeJumpHere(v, addr1);
8663886748
if( memRootPage<0 ) sqlite3VdbeAddOp2(v, OP_Clear, tnum, iDb);
@@ -88149,10 +88259,80 @@
8814988259
}
8815088260
}
8815188261
return sqlite3KeyInfoRef(pIdx->pKeyInfo);
8815288262
}
8815388263
88264
+#ifndef SQLITE_OMIT_CTE
88265
+/*
88266
+** This routine is invoked once per CTE by the parser while parsing a
88267
+** WITH clause.
88268
+*/
88269
+SQLITE_PRIVATE With *sqlite3WithAdd(
88270
+ Parse *pParse, /* Parsing context */
88271
+ With *pWith, /* Existing WITH clause, or NULL */
88272
+ Token *pName, /* Name of the common-table */
88273
+ ExprList *pArglist, /* Optional column name list for the table */
88274
+ Select *pQuery /* Query used to initialize the table */
88275
+){
88276
+ sqlite3 *db = pParse->db;
88277
+ With *pNew;
88278
+ char *zName;
88279
+
88280
+ /* Check that the CTE name is unique within this WITH clause. If
88281
+ ** not, store an error in the Parse structure. */
88282
+ zName = sqlite3NameFromToken(pParse->db, pName);
88283
+ if( zName && pWith ){
88284
+ int i;
88285
+ for(i=0; i<pWith->nCte; i++){
88286
+ if( sqlite3StrICmp(zName, pWith->a[i].zName)==0 ){
88287
+ sqlite3ErrorMsg(pParse, "duplicate WITH table name: %s", zName);
88288
+ }
88289
+ }
88290
+ }
88291
+
88292
+ if( pWith ){
88293
+ int nByte = sizeof(*pWith) + (sizeof(pWith->a[1]) * pWith->nCte);
88294
+ pNew = sqlite3DbRealloc(db, pWith, nByte);
88295
+ }else{
88296
+ pNew = sqlite3DbMallocZero(db, sizeof(*pWith));
88297
+ }
88298
+ assert( zName!=0 || pNew==0 );
88299
+ assert( db->mallocFailed==0 || pNew==0 );
88300
+
88301
+ if( pNew==0 ){
88302
+ sqlite3ExprListDelete(db, pArglist);
88303
+ sqlite3SelectDelete(db, pQuery);
88304
+ sqlite3DbFree(db, zName);
88305
+ pNew = pWith;
88306
+ }else{
88307
+ pNew->a[pNew->nCte].pSelect = pQuery;
88308
+ pNew->a[pNew->nCte].pCols = pArglist;
88309
+ pNew->a[pNew->nCte].zName = zName;
88310
+ pNew->a[pNew->nCte].zErr = 0;
88311
+ pNew->nCte++;
88312
+ }
88313
+
88314
+ return pNew;
88315
+}
88316
+
88317
+/*
88318
+** Free the contents of the With object passed as the second argument.
88319
+*/
88320
+SQLITE_PRIVATE void sqlite3WithDelete(sqlite3 *db, With *pWith){
88321
+ if( pWith ){
88322
+ int i;
88323
+ for(i=0; i<pWith->nCte; i++){
88324
+ struct Cte *pCte = &pWith->a[i];
88325
+ sqlite3ExprListDelete(db, pCte->pCols);
88326
+ sqlite3SelectDelete(db, pCte->pSelect);
88327
+ sqlite3DbFree(db, pCte->zName);
88328
+ }
88329
+ sqlite3DbFree(db, pWith);
88330
+ }
88331
+}
88332
+#endif /* !defined(SQLITE_OMIT_CTE) */
88333
+
8815488334
/************** End of build.c ***********************************************/
8815588335
/************** Begin file callback.c ****************************************/
8815688336
/*
8815788337
** 2005 May 23
8815888338
**
@@ -89347,13 +89527,14 @@
8934789527
int iDataCur, /* Cursor of table holding data. */
8934889528
int iIdxCur, /* First index cursor */
8934989529
int *aRegIdx /* Only delete if aRegIdx!=0 && aRegIdx[i]>0 */
8935089530
){
8935189531
int i; /* Index loop counter */
89352
- int r1; /* Register holding an index key */
89532
+ int r1 = -1; /* Register holding an index key */
8935389533
int iPartIdxLabel; /* Jump destination for skipping partial index entries */
8935489534
Index *pIdx; /* Current index */
89535
+ Index *pPrior = 0; /* Prior index */
8935589536
Vdbe *v; /* The prepared statement under construction */
8935689537
Index *pPk; /* PRIMARY KEY index, or NULL for rowid tables */
8935789538
8935889539
v = pParse->pVdbe;
8935989540
pPk = HasRowid(pTab) ? 0 : sqlite3PrimaryKeyIndex(pTab);
@@ -89360,14 +89541,16 @@
8936089541
for(i=0, pIdx=pTab->pIndex; pIdx; i++, pIdx=pIdx->pNext){
8936189542
assert( iIdxCur+i!=iDataCur || pPk==pIdx );
8936289543
if( aRegIdx!=0 && aRegIdx[i]==0 ) continue;
8936389544
if( pIdx==pPk ) continue;
8936489545
VdbeModuleComment((v, "GenRowIdxDel for %s", pIdx->zName));
89365
- r1 = sqlite3GenerateIndexKey(pParse, pIdx, iDataCur, 0, 1, &iPartIdxLabel);
89546
+ r1 = sqlite3GenerateIndexKey(pParse, pIdx, iDataCur, 0, 1,
89547
+ &iPartIdxLabel, pPrior, r1);
8936689548
sqlite3VdbeAddOp3(v, OP_IdxDelete, iIdxCur+i, r1,
8936789549
pIdx->uniqNotNull ? pIdx->nKeyCol : pIdx->nColumn);
8936889550
sqlite3VdbeResolveLabel(v, iPartIdxLabel);
89551
+ pPrior = pIdx;
8936989552
}
8937089553
}
8937189554
8937289555
/*
8937389556
** Generate code that will assemble an index key and stores it in register
@@ -89385,18 +89568,31 @@
8938589568
** to that label if pIdx is a partial index that should be skipped.
8938689569
** A partial index should be skipped if its WHERE clause evaluates
8938789570
** to false or null. If pIdx is not a partial index, *piPartIdxLabel
8938889571
** will be set to zero which is an empty label that is ignored by
8938989572
** sqlite3VdbeResolveLabel().
89573
+**
89574
+** The pPrior and regPrior parameters are used to implement a cache to
89575
+** avoid unnecessary register loads. If pPrior is not NULL, then it is
89576
+** a pointer to a different index for which an index key has just been
89577
+** computed into register regPrior. If the current pIdx index is generating
89578
+** its key into the same sequence of registers and if pPrior and pIdx share
89579
+** a column in common, then the register corresponding to that column already
89580
+** holds the correct value and the loading of that register is skipped.
89581
+** This optimization is helpful when doing a DELETE or an INTEGRITY_CHECK
89582
+** on a table with multiple indices, and especially with the ROWID or
89583
+** PRIMARY KEY columns of the index.
8939089584
*/
8939189585
SQLITE_PRIVATE int sqlite3GenerateIndexKey(
8939289586
Parse *pParse, /* Parsing context */
8939389587
Index *pIdx, /* The index for which to generate a key */
8939489588
int iDataCur, /* Cursor number from which to take column data */
8939589589
int regOut, /* Put the new key into this register if not 0 */
8939689590
int prefixOnly, /* Compute only a unique prefix of the key */
89397
- int *piPartIdxLabel /* OUT: Jump to this label to skip partial index */
89591
+ int *piPartIdxLabel, /* OUT: Jump to this label to skip partial index */
89592
+ Index *pPrior, /* Previously generated index key */
89593
+ int regPrior /* Register holding previous generated key */
8939889594
){
8939989595
Vdbe *v = pParse->pVdbe;
8940089596
int j;
8940189597
Table *pTab = pIdx->pTable;
8940289598
int regBase;
@@ -89412,22 +89608,22 @@
8941289608
*piPartIdxLabel = 0;
8941389609
}
8941489610
}
8941589611
nCol = (prefixOnly && pIdx->uniqNotNull) ? pIdx->nKeyCol : pIdx->nColumn;
8941689612
regBase = sqlite3GetTempRange(pParse, nCol);
89613
+ if( pPrior && (regBase!=regPrior || pPrior->pPartIdxWhere) ) pPrior = 0;
8941789614
for(j=0; j<nCol; j++){
89615
+ if( pPrior && pPrior->aiColumn[j]==pIdx->aiColumn[j] ) continue;
8941889616
sqlite3ExprCodeGetColumnOfTable(v, pTab, iDataCur, pIdx->aiColumn[j],
8941989617
regBase+j);
8942089618
/* If the column affinity is REAL but the number is an integer, then it
8942189619
** might be stored in the table as an integer (using a compact
8942289620
** representation) then converted to REAL by an OP_RealAffinity opcode.
8942389621
** But we are getting ready to store this value back into an index, where
8942489622
** it should be converted by to INTEGER again. So omit the OP_RealAffinity
8942589623
** opcode if it is present */
89426
- if( sqlite3VdbeGetOp(v, -1)->opcode==OP_RealAffinity ){
89427
- sqlite3VdbeDeleteLastOpcode(v);
89428
- }
89624
+ sqlite3VdbeDeletePriorOpcode(v, OP_RealAffinity);
8942989625
}
8943089626
if( regOut ){
8943189627
sqlite3VdbeAddOp3(v, OP_MakeRecord, regBase, nCol, regOut);
8943289628
}
8943389629
sqlite3ReleaseTempRange(pParse, regBase, nCol);
@@ -93086,11 +93282,10 @@
9308693282
** D: cleanup
9308793283
*/
9308893284
SQLITE_PRIVATE void sqlite3Insert(
9308993285
Parse *pParse, /* Parser context */
9309093286
SrcList *pTabList, /* Name of table into which we are inserting */
93091
- ExprList *pList, /* List of values to be inserted */
9309293287
Select *pSelect, /* A SELECT statement to use as the data source */
9309393288
IdList *pColumn, /* Column names corresponding to IDLIST. */
9309493289
int onError /* How to handle constraint errors */
9309593290
){
9309693291
sqlite3 *db; /* The main database structure */
@@ -93114,10 +93309,11 @@
9311493309
SelectDest dest; /* Destination for SELECT on rhs of INSERT */
9311593310
int iDb; /* Index of database holding TABLE */
9311693311
Db *pDb; /* The database containing table being inserted into */
9311793312
int appendFlag = 0; /* True if the insert is likely to be an append */
9311893313
int withoutRowid; /* 0 for normal table. 1 for WITHOUT ROWID table */
93314
+ ExprList *pList = 0; /* List of VALUES() to be inserted */
9311993315
9312093316
/* Register allocations */
9312193317
int regFromSelect = 0;/* Base register for data coming from SELECT */
9312293318
int regAutoinc = 0; /* Register holding the AUTOINCREMENT counter */
9312393319
int regRowCount = 0; /* Memory cell used for the row counter */
@@ -93136,10 +93332,21 @@
9313693332
db = pParse->db;
9313793333
memset(&dest, 0, sizeof(dest));
9313893334
if( pParse->nErr || db->mallocFailed ){
9313993335
goto insert_cleanup;
9314093336
}
93337
+
93338
+ /* If the Select object is really just a simple VALUES() list with a
93339
+ ** single row values (the common case) then keep that one row of values
93340
+ ** and go ahead and discard the Select object
93341
+ */
93342
+ if( pSelect && (pSelect->selFlags & SF_Values)!=0 && pSelect->pPrior==0 ){
93343
+ pList = pSelect->pEList;
93344
+ pSelect->pEList = 0;
93345
+ sqlite3SelectDelete(db, pSelect);
93346
+ pSelect = 0;
93347
+ }
9314193348
9314293349
/* Locate the table into which we will be inserting new information.
9314393350
*/
9314493351
assert( pTabList->nSrc==1 );
9314593352
zTab = pTabList->a[0].zName;
@@ -94392,10 +94599,16 @@
9439294599
int destHasUniqueIdx = 0; /* True if pDest has a UNIQUE index */
9439394600
int regData, regRowid; /* Registers holding data and rowid */
9439494601
9439594602
if( pSelect==0 ){
9439694603
return 0; /* Must be of the form INSERT INTO ... SELECT ... */
94604
+ }
94605
+ if( pParse->pWith || pSelect->pWith ){
94606
+ /* Do not attempt to process this query if there are an WITH clauses
94607
+ ** attached to it. Proceeding may generate a false "no such table: xxx"
94608
+ ** error if pSelect reads from a CTE named "xxx". */
94609
+ return 0;
9439794610
}
9439894611
if( sqlite3TriggerList(pParse, pDest) ){
9439994612
return 0; /* tab1 must not have triggers */
9440094613
}
9440194614
#ifndef SQLITE_OMIT_VIRTUALTABLE
@@ -97891,12 +98104,14 @@
9789198104
/* Make sure all the indices are constructed correctly.
9789298105
*/
9789398106
for(x=sqliteHashFirst(pTbls); x && !isQuick; x=sqliteHashNext(x)){
9789498107
Table *pTab = sqliteHashData(x);
9789598108
Index *pIdx, *pPk;
98109
+ Index *pPrior = 0;
9789698110
int loopTop;
9789798111
int iDataCur, iIdxCur;
98112
+ int r1 = -1;
9789898113
9789998114
if( pTab->pIndex==0 ) continue;
9790098115
pPk = HasRowid(pTab) ? 0 : sqlite3PrimaryKeyIndex(pTab);
9790198116
addr = sqlite3VdbeAddOp1(v, OP_IfPos, 1); /* Stop if out of errors */
9790298117
sqlite3VdbeAddOp2(v, OP_Halt, 0, 0);
@@ -97911,13 +98126,14 @@
9791198126
pParse->nMem = MAX(pParse->nMem, 8+j);
9791298127
sqlite3VdbeAddOp2(v, OP_Rewind, iDataCur, 0);
9791398128
loopTop = sqlite3VdbeAddOp2(v, OP_AddImm, 7, 1);
9791498129
for(j=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, j++){
9791598130
int jmp2, jmp3, jmp4;
97916
- int r1;
9791798131
if( pPk==pIdx ) continue;
97918
- r1 = sqlite3GenerateIndexKey(pParse, pIdx, iDataCur, 0, 0, &jmp3);
98132
+ r1 = sqlite3GenerateIndexKey(pParse, pIdx, iDataCur, 0, 0, &jmp3,
98133
+ pPrior, r1);
98134
+ pPrior = pIdx;
9791998135
sqlite3VdbeAddOp2(v, OP_AddImm, 8+j, 1); /* increment entry count */
9792098136
jmp2 = sqlite3VdbeAddOp4Int(v, OP_Found, iIdxCur+j, 0, r1,
9792198137
pIdx->nColumn);
9792298138
sqlite3VdbeAddOp2(v, OP_AddImm, 1, -1); /* Decrement error limit */
9792398139
sqlite3VdbeAddOp4(v, OP_String8, 0, 3, 0, "row ", P4_STATIC);
@@ -99229,10 +99445,11 @@
9922999445
sqlite3ExprDelete(db, p->pHaving);
9923099446
sqlite3ExprListDelete(db, p->pOrderBy);
9923199447
sqlite3SelectDelete(db, p->pPrior);
9923299448
sqlite3ExprDelete(db, p->pLimit);
9923399449
sqlite3ExprDelete(db, p->pOffset);
99450
+ sqlite3WithDelete(db, p->pWith);
9923499451
}
9923599452
9923699453
/*
9923799454
** Initialize a SelectDest structure.
9923899455
*/
@@ -99890,16 +100107,30 @@
99890100107
}
99891100108
#endif
99892100109
99893100110
/* Store the result as data using a unique key.
99894100111
*/
100112
+ case SRT_DistTable:
99895100113
case SRT_Table:
99896100114
case SRT_EphemTab: {
99897100115
int r1 = sqlite3GetTempReg(pParse);
99898100116
testcase( eDest==SRT_Table );
99899100117
testcase( eDest==SRT_EphemTab );
99900100118
sqlite3VdbeAddOp3(v, OP_MakeRecord, regResult, nColumn, r1);
100119
+#ifndef SQLITE_OMIT_CTE
100120
+ if( eDest==SRT_DistTable ){
100121
+ /* If the destination is DistTable, then cursor (iParm+1) is open
100122
+ ** on an ephemeral index. If the current row is already present
100123
+ ** in the index, do not write it to the output. If not, add the
100124
+ ** current row to the index and proceed with writing it to the
100125
+ ** output table as well. */
100126
+ int addr = sqlite3VdbeCurrentAddr(v) + 4;
100127
+ sqlite3VdbeAddOp4Int(v, OP_Found, iParm+1, addr, r1, 0);
100128
+ sqlite3VdbeAddOp2(v, OP_IdxInsert, iParm+1, r1);
100129
+ assert( pOrderBy==0 );
100130
+ }
100131
+#endif
99901100132
if( pOrderBy ){
99902100133
pushOntoSorter(pParse, pOrderBy, p, r1);
99903100134
}else{
99904100135
int r2 = sqlite3GetTempReg(pParse);
99905100136
sqlite3VdbeAddOp2(v, OP_NewRowid, iParm, r2);
@@ -100402,11 +100633,11 @@
100402100633
sNC.pSrcList = pS->pSrc;
100403100634
sNC.pNext = pNC;
100404100635
sNC.pParse = pNC->pParse;
100405100636
zType = columnType(&sNC, p,&zOrigDb,&zOrigTab,&zOrigCol, &estWidth);
100406100637
}
100407
- }else if( ALWAYS(pTab->pSchema) ){
100638
+ }else if( pTab->pSchema ){
100408100639
/* A real table */
100409100640
assert( !pS );
100410100641
if( iCol<0 ) iCol = pTab->iPKey;
100411100642
assert( iCol==-1 || (iCol>=0 && iCol<pTab->nCol) );
100412100643
#ifdef SQLITE_ENABLE_COLUMN_METADATA
@@ -100563,12 +100794,13 @@
100563100794
sqlite3VdbeSetColName(v, i, COLNAME_NAME, zName, SQLITE_DYNAMIC);
100564100795
}else{
100565100796
sqlite3VdbeSetColName(v, i, COLNAME_NAME, zCol, SQLITE_TRANSIENT);
100566100797
}
100567100798
}else{
100568
- sqlite3VdbeSetColName(v, i, COLNAME_NAME,
100569
- sqlite3DbStrDup(db, pEList->a[i].zSpan), SQLITE_DYNAMIC);
100799
+ const char *z = pEList->a[i].zSpan;
100800
+ z = z==0 ? sqlite3MPrintf(db, "column%d", i+1) : sqlite3DbStrDup(db, z);
100801
+ sqlite3VdbeSetColName(v, i, COLNAME_NAME, z, SQLITE_DYNAMIC);
100570100802
}
100571100803
}
100572100804
generateColumnTypes(pParse, pTabList, pEList);
100573100805
}
100574100806
@@ -100928,10 +101160,11 @@
100928101160
100929101161
/* Make sure there is no ORDER BY or LIMIT clause on prior SELECTs. Only
100930101162
** the last (right-most) SELECT in the series may have an ORDER BY or LIMIT.
100931101163
*/
100932101164
assert( p && p->pPrior ); /* Calling function guarantees this much */
101165
+ assert( (p->selFlags & SF_Recursive)==0 || p->op==TK_ALL || p->op==TK_UNION );
100933101166
db = pParse->db;
100934101167
pPrior = p->pPrior;
100935101168
assert( pPrior->pRightmost!=pPrior );
100936101169
assert( pPrior->pRightmost==p->pRightmost );
100937101170
dest = *pDest;
@@ -100972,16 +101205,96 @@
100972101205
" do not have the same number of result columns", selectOpName(p->op));
100973101206
}
100974101207
rc = 1;
100975101208
goto multi_select_end;
100976101209
}
101210
+
101211
+#ifndef SQLITE_OMIT_CTE
101212
+ if( p->selFlags & SF_Recursive ){
101213
+ SrcList *pSrc = p->pSrc;
101214
+ int nCol = p->pEList->nExpr;
101215
+ int addrNext;
101216
+ int addrSwap;
101217
+ int iCont, iBreak;
101218
+ int tmp1; /* Intermediate table */
101219
+ int tmp2; /* Next intermediate table */
101220
+ int tmp3 = 0; /* To ensure unique results if UNION */
101221
+ int eDest = SRT_Table;
101222
+ SelectDest tmp2dest;
101223
+ int i;
101224
+
101225
+ /* Check that there is no ORDER BY or LIMIT clause. Neither of these
101226
+ ** are supported on recursive queries. */
101227
+ assert( p->pOffset==0 || p->pLimit );
101228
+ if( p->pOrderBy || p->pLimit ){
101229
+ sqlite3ErrorMsg(pParse, "%s in a recursive query",
101230
+ p->pOrderBy ? "ORDER BY" : "LIMIT"
101231
+ );
101232
+ goto multi_select_end;
101233
+ }
101234
+
101235
+ if( sqlite3AuthCheck(pParse, SQLITE_RECURSIVE, 0, 0, 0) ){
101236
+ goto multi_select_end;
101237
+ }
101238
+ iBreak = sqlite3VdbeMakeLabel(v);
101239
+ iCont = sqlite3VdbeMakeLabel(v);
101240
+
101241
+ for(i=0; ALWAYS(i<pSrc->nSrc); i++){
101242
+ if( pSrc->a[i].isRecursive ){
101243
+ tmp1 = pSrc->a[i].iCursor;
101244
+ break;
101245
+ }
101246
+ }
101247
+
101248
+ tmp2 = pParse->nTab++;
101249
+ if( p->op==TK_UNION ){
101250
+ eDest = SRT_DistTable;
101251
+ tmp3 = pParse->nTab++;
101252
+ }
101253
+ sqlite3SelectDestInit(&tmp2dest, eDest, tmp2);
101254
+
101255
+ sqlite3VdbeAddOp2(v, OP_OpenEphemeral, tmp1, nCol);
101256
+ sqlite3VdbeAddOp2(v, OP_OpenEphemeral, tmp2, nCol);
101257
+ if( tmp3 ){
101258
+ p->addrOpenEphm[0] = sqlite3VdbeAddOp2(v, OP_OpenEphemeral, tmp3, 0);
101259
+ p->selFlags |= SF_UsesEphemeral;
101260
+ }
101261
+
101262
+ /* Store the results of the initial SELECT in tmp2. */
101263
+ rc = sqlite3Select(pParse, pPrior, &tmp2dest);
101264
+ if( rc ) goto multi_select_end;
101265
+
101266
+ /* Clear tmp1. Then switch the contents of tmp1 and tmp2. Then return
101267
+ ** the contents of tmp1 to the caller. Or, if tmp1 is empty at this
101268
+ ** point, the recursive query has finished - jump to address iBreak. */
101269
+ addrSwap = sqlite3VdbeAddOp2(v, OP_SwapCursors, tmp1, tmp2);
101270
+ sqlite3VdbeAddOp2(v, OP_Rewind, tmp1, iBreak);
101271
+ addrNext = sqlite3VdbeCurrentAddr(v);
101272
+ selectInnerLoop(pParse, p, p->pEList, tmp1, p->pEList->nExpr,
101273
+ 0, 0, &dest, iCont, iBreak);
101274
+ sqlite3VdbeResolveLabel(v, iCont);
101275
+ sqlite3VdbeAddOp2(v, OP_Next, tmp1, addrNext);
101276
+
101277
+ /* Execute the recursive SELECT. Store the results in tmp2. While this
101278
+ ** SELECT is running, the contents of tmp1 are read by recursive
101279
+ ** references to the current CTE. */
101280
+ p->pPrior = 0;
101281
+ rc = sqlite3Select(pParse, p, &tmp2dest);
101282
+ assert( p->pPrior==0 );
101283
+ p->pPrior = pPrior;
101284
+ if( rc ) goto multi_select_end;
101285
+
101286
+ sqlite3VdbeAddOp2(v, OP_Goto, 0, addrSwap);
101287
+ sqlite3VdbeResolveLabel(v, iBreak);
101288
+ }else
101289
+#endif
100977101290
100978101291
/* Compound SELECTs that have an ORDER BY clause are handled separately.
100979101292
*/
100980101293
if( p->pOrderBy ){
100981101294
return multiSelectOrderBy(pParse, p, pDest);
100982
- }
101295
+ }else
100983101296
100984101297
/* Generate code for the left and right SELECT statements.
100985101298
*/
100986101299
switch( p->op ){
100987101300
case TK_ALL: {
@@ -102040,10 +102353,18 @@
102040102353
** appear as unmodified result columns in the outer query. But we
102041102354
** have other optimizations in mind to deal with that case.
102042102355
**
102043102356
** (21) The subquery does not use LIMIT or the outer query is not
102044102357
** DISTINCT. (See ticket [752e1646fc]).
102358
+**
102359
+** (22) The subquery is not a recursive CTE.
102360
+**
102361
+** (23) The parent is not a recursive CTE, or the sub-query is not a
102362
+** compound query. This restriction is because transforming the
102363
+** parent to a compound query confuses the code that handles
102364
+** recursive queries in multiSelect().
102365
+**
102045102366
**
102046102367
** In this routine, the "p" parameter is a pointer to the outer query.
102047102368
** The subquery is p->pSrc->a[iFrom]. isAgg is true if the outer query
102048102369
** uses aggregates and subqueryIsAgg is true if the subquery uses aggregates.
102049102370
**
@@ -102112,10 +102433,12 @@
102112102433
if( isAgg && pSub->pOrderBy ) return 0; /* Restriction (16) */
102113102434
if( pSub->pLimit && p->pWhere ) return 0; /* Restriction (19) */
102114102435
if( pSub->pLimit && (p->selFlags & SF_Distinct)!=0 ){
102115102436
return 0; /* Restriction (21) */
102116102437
}
102438
+ if( pSub->selFlags & SF_Recursive ) return 0; /* Restriction (22) */
102439
+ if( (p->selFlags & SF_Recursive) && pSub->pPrior ) return 0; /* (23) */
102117102440
102118102441
/* OBSOLETE COMMENT 1:
102119102442
** Restriction 3: If the subquery is a join, make sure the subquery is
102120102443
** not used as the right operand of an outer join. Examples of why this
102121102444
** is not allowed:
@@ -102593,10 +102916,200 @@
102593102916
pNew->pLimit = 0;
102594102917
pNew->pOffset = 0;
102595102918
return WRC_Continue;
102596102919
}
102597102920
102921
+#ifndef SQLITE_OMIT_CTE
102922
+/*
102923
+** Argument pWith (which may be NULL) points to a linked list of nested
102924
+** WITH contexts, from inner to outermost. If the table identified by
102925
+** FROM clause element pItem is really a common-table-expression (CTE)
102926
+** then return a pointer to the CTE definition for that table. Otherwise
102927
+** return NULL.
102928
+**
102929
+** If a non-NULL value is returned, set *ppContext to point to the With
102930
+** object that the returned CTE belongs to.
102931
+*/
102932
+static struct Cte *searchWith(
102933
+ With *pWith, /* Current outermost WITH clause */
102934
+ struct SrcList_item *pItem, /* FROM clause element to resolve */
102935
+ With **ppContext /* OUT: WITH clause return value belongs to */
102936
+){
102937
+ const char *zName;
102938
+ if( pItem->zDatabase==0 && (zName = pItem->zName)!=0 ){
102939
+ With *p;
102940
+ for(p=pWith; p; p=p->pOuter){
102941
+ int i;
102942
+ for(i=0; i<p->nCte; i++){
102943
+ if( sqlite3StrICmp(zName, p->a[i].zName)==0 ){
102944
+ *ppContext = p;
102945
+ return &p->a[i];
102946
+ }
102947
+ }
102948
+ }
102949
+ }
102950
+ return 0;
102951
+}
102952
+
102953
+/* The code generator maintains a stack of active WITH clauses
102954
+** with the inner-most WITH clause being at the top of the stack.
102955
+**
102956
+** This routine pushes the WITH clause passed as the second argument
102957
+** onto the top of the stack. If argument bFree is true, then this
102958
+** WITH clause will never be popped from the stack. In this case it
102959
+** should be freed along with the Parse object. In other cases, when
102960
+** bFree==0, the With object will be freed along with the SELECT
102961
+** statement with which it is associated.
102962
+*/
102963
+SQLITE_PRIVATE void sqlite3WithPush(Parse *pParse, With *pWith, u8 bFree){
102964
+ assert( bFree==0 || pParse->pWith==0 );
102965
+ if( pWith ){
102966
+ pWith->pOuter = pParse->pWith;
102967
+ pParse->pWith = pWith;
102968
+ pParse->bFreeWith = bFree;
102969
+ }
102970
+}
102971
+
102972
+/*
102973
+** This function checks if argument pFrom refers to a CTE declared by
102974
+** a WITH clause on the stack currently maintained by the parser. And,
102975
+** if currently processing a CTE expression, if it is a recursive
102976
+** reference to the current CTE.
102977
+**
102978
+** If pFrom falls into either of the two categories above, pFrom->pTab
102979
+** and other fields are populated accordingly. The caller should check
102980
+** (pFrom->pTab!=0) to determine whether or not a successful match
102981
+** was found.
102982
+**
102983
+** Whether or not a match is found, SQLITE_OK is returned if no error
102984
+** occurs. If an error does occur, an error message is stored in the
102985
+** parser and some error code other than SQLITE_OK returned.
102986
+*/
102987
+static int withExpand(
102988
+ Walker *pWalker,
102989
+ struct SrcList_item *pFrom
102990
+){
102991
+ Parse *pParse = pWalker->pParse;
102992
+ sqlite3 *db = pParse->db;
102993
+ struct Cte *pCte; /* Matched CTE (or NULL if no match) */
102994
+ With *pWith; /* WITH clause that pCte belongs to */
102995
+
102996
+ assert( pFrom->pTab==0 );
102997
+
102998
+ pCte = searchWith(pParse->pWith, pFrom, &pWith);
102999
+ if( pCte ){
103000
+ Table *pTab;
103001
+ ExprList *pEList;
103002
+ Select *pSel;
103003
+ Select *pLeft; /* Left-most SELECT statement */
103004
+ int bMayRecursive; /* True if compound joined by UNION [ALL] */
103005
+ With *pSavedWith; /* Initial value of pParse->pWith */
103006
+
103007
+ /* If pCte->zErr is non-NULL at this point, then this is an illegal
103008
+ ** recursive reference to CTE pCte. Leave an error in pParse and return
103009
+ ** early. If pCte->zErr is NULL, then this is not a recursive reference.
103010
+ ** In this case, proceed. */
103011
+ if( pCte->zErr ){
103012
+ sqlite3ErrorMsg(pParse, pCte->zErr, pCte->zName);
103013
+ return SQLITE_ERROR;
103014
+ }
103015
+
103016
+ pFrom->pTab = pTab = sqlite3DbMallocZero(db, sizeof(Table));
103017
+ if( pTab==0 ) return WRC_Abort;
103018
+ pTab->nRef = 1;
103019
+ pTab->zName = sqlite3DbStrDup(db, pCte->zName);
103020
+ pTab->iPKey = -1;
103021
+ pTab->nRowEst = 1048576;
103022
+ pTab->tabFlags |= TF_Ephemeral;
103023
+ pFrom->pSelect = sqlite3SelectDup(db, pCte->pSelect, 0);
103024
+ if( db->mallocFailed ) return SQLITE_NOMEM;
103025
+ assert( pFrom->pSelect );
103026
+
103027
+ /* Check if this is a recursive CTE. */
103028
+ pSel = pFrom->pSelect;
103029
+ bMayRecursive = ( pSel->op==TK_ALL || pSel->op==TK_UNION );
103030
+ if( bMayRecursive ){
103031
+ int i;
103032
+ SrcList *pSrc = pFrom->pSelect->pSrc;
103033
+ for(i=0; i<pSrc->nSrc; i++){
103034
+ struct SrcList_item *pItem = &pSrc->a[i];
103035
+ if( pItem->zDatabase==0
103036
+ && pItem->zName!=0
103037
+ && 0==sqlite3StrICmp(pItem->zName, pCte->zName)
103038
+ ){
103039
+ pItem->pTab = pTab;
103040
+ pItem->isRecursive = 1;
103041
+ pTab->nRef++;
103042
+ pSel->selFlags |= SF_Recursive;
103043
+ }
103044
+ }
103045
+ }
103046
+
103047
+ /* Only one recursive reference is permitted. */
103048
+ if( pTab->nRef>2 ){
103049
+ sqlite3ErrorMsg(
103050
+ pParse, "multiple references to recursive table: %s", pCte->zName
103051
+ );
103052
+ return SQLITE_ERROR;
103053
+ }
103054
+ assert( pTab->nRef==1 || ((pSel->selFlags&SF_Recursive) && pTab->nRef==2 ));
103055
+
103056
+ pCte->zErr = "circular reference: %s";
103057
+ pSavedWith = pParse->pWith;
103058
+ pParse->pWith = pWith;
103059
+ sqlite3WalkSelect(pWalker, bMayRecursive ? pSel->pPrior : pSel);
103060
+
103061
+ for(pLeft=pSel; pLeft->pPrior; pLeft=pLeft->pPrior);
103062
+ pEList = pLeft->pEList;
103063
+ if( pCte->pCols ){
103064
+ if( pEList->nExpr!=pCte->pCols->nExpr ){
103065
+ sqlite3ErrorMsg(pParse, "table %s has %d values for %d columns",
103066
+ pCte->zName, pEList->nExpr, pCte->pCols->nExpr
103067
+ );
103068
+ pParse->pWith = pSavedWith;
103069
+ return SQLITE_ERROR;
103070
+ }
103071
+ pEList = pCte->pCols;
103072
+ }
103073
+
103074
+ selectColumnsFromExprList(pParse, pEList, &pTab->nCol, &pTab->aCol);
103075
+ if( bMayRecursive ){
103076
+ if( pSel->selFlags & SF_Recursive ){
103077
+ pCte->zErr = "multiple recursive references: %s";
103078
+ }else{
103079
+ pCte->zErr = "recursive reference in a subquery: %s";
103080
+ }
103081
+ sqlite3WalkSelect(pWalker, pSel);
103082
+ }
103083
+ pCte->zErr = 0;
103084
+ pParse->pWith = pSavedWith;
103085
+ }
103086
+
103087
+ return SQLITE_OK;
103088
+}
103089
+#endif
103090
+
103091
+#ifndef SQLITE_OMIT_CTE
103092
+/*
103093
+** If the SELECT passed as the second argument has an associated WITH
103094
+** clause, pop it from the stack stored as part of the Parse object.
103095
+**
103096
+** This function is used as the xSelectCallback2() callback by
103097
+** sqlite3SelectExpand() when walking a SELECT tree to resolve table
103098
+** names and other FROM clause elements.
103099
+*/
103100
+static void selectPopWith(Walker *pWalker, Select *p){
103101
+ Parse *pParse = pWalker->pParse;
103102
+ if( p->pWith ){
103103
+ assert( pParse->pWith==p->pWith );
103104
+ pParse->pWith = p->pWith->pOuter;
103105
+ }
103106
+}
103107
+#else
103108
+#define selectPopWith 0
103109
+#endif
103110
+
102598103111
/*
102599103112
** This routine is a Walker callback for "expanding" a SELECT statement.
102600103113
** "Expanding" means to do the following:
102601103114
**
102602103115
** (1) Make sure VDBE cursor numbers have been assigned to every
@@ -102636,10 +103149,11 @@
102636103149
if( NEVER(p->pSrc==0) || (selFlags & SF_Expanded)!=0 ){
102637103150
return WRC_Prune;
102638103151
}
102639103152
pTabList = p->pSrc;
102640103153
pEList = p->pEList;
103154
+ sqlite3WithPush(pParse, p->pWith, 0);
102641103155
102642103156
/* Make sure cursor numbers have been assigned to all entries in
102643103157
** the FROM clause of the SELECT statement.
102644103158
*/
102645103159
sqlite3SrcListAssignCursors(pParse, pTabList);
@@ -102648,16 +103162,25 @@
102648103162
** an entry of the FROM clause is a subquery instead of a table or view,
102649103163
** then create a transient table structure to describe the subquery.
102650103164
*/
102651103165
for(i=0, pFrom=pTabList->a; i<pTabList->nSrc; i++, pFrom++){
102652103166
Table *pTab;
103167
+ assert( pFrom->isRecursive==0 || pFrom->pTab );
103168
+ if( pFrom->isRecursive ) continue;
102653103169
if( pFrom->pTab!=0 ){
102654103170
/* This statement has already been prepared. There is no need
102655103171
** to go further. */
102656103172
assert( i==0 );
103173
+#ifndef SQLITE_OMIT_CTE
103174
+ selectPopWith(pWalker, p);
103175
+#endif
102657103176
return WRC_Prune;
102658103177
}
103178
+#ifndef SQLITE_OMIT_CTE
103179
+ if( withExpand(pWalker, pFrom) ) return WRC_Abort;
103180
+ if( pFrom->pTab ) {} else
103181
+#endif
102659103182
if( pFrom->zName==0 ){
102660103183
#ifndef SQLITE_OMIT_SUBQUERY
102661103184
Select *pSel = pFrom->pSelect;
102662103185
/* A sub-query in the FROM clause of a SELECT */
102663103186
assert( pSel!=0 );
@@ -102916,10 +103439,11 @@
102916103439
if( pParse->hasCompound ){
102917103440
w.xSelectCallback = convertCompoundSelectToSubquery;
102918103441
sqlite3WalkSelect(&w, pSelect);
102919103442
}
102920103443
w.xSelectCallback = selectExpander;
103444
+ w.xSelectCallback2 = selectPopWith;
102921103445
sqlite3WalkSelect(&w, pSelect);
102922103446
}
102923103447
102924103448
102925103449
#ifndef SQLITE_OMIT_SUBQUERY
@@ -102934,11 +103458,11 @@
102934103458
** The Table structure that represents the result set was constructed
102935103459
** by selectExpander() but the type and collation information was omitted
102936103460
** at that point because identifiers had not yet been resolved. This
102937103461
** routine is called after identifier resolution.
102938103462
*/
102939
-static int selectAddSubqueryTypeInfo(Walker *pWalker, Select *p){
103463
+static void selectAddSubqueryTypeInfo(Walker *pWalker, Select *p){
102940103464
Parse *pParse;
102941103465
int i;
102942103466
SrcList *pTabList;
102943103467
struct SrcList_item *pFrom;
102944103468
@@ -102950,17 +103474,17 @@
102950103474
for(i=0, pFrom=pTabList->a; i<pTabList->nSrc; i++, pFrom++){
102951103475
Table *pTab = pFrom->pTab;
102952103476
if( ALWAYS(pTab!=0) && (pTab->tabFlags & TF_Ephemeral)!=0 ){
102953103477
/* A sub-query in the FROM clause of a SELECT */
102954103478
Select *pSel = pFrom->pSelect;
102955
- assert( pSel );
102956
- while( pSel->pPrior ) pSel = pSel->pPrior;
102957
- selectAddColumnTypeAndCollation(pParse, pTab, pSel);
103479
+ if( pSel ){
103480
+ while( pSel->pPrior ) pSel = pSel->pPrior;
103481
+ selectAddColumnTypeAndCollation(pParse, pTab, pSel);
103482
+ }
102958103483
}
102959103484
}
102960103485
}
102961
- return WRC_Continue;
102962103486
}
102963103487
#endif
102964103488
102965103489
102966103490
/*
@@ -102972,14 +103496,13 @@
102972103496
*/
102973103497
static void sqlite3SelectAddTypeInfo(Parse *pParse, Select *pSelect){
102974103498
#ifndef SQLITE_OMIT_SUBQUERY
102975103499
Walker w;
102976103500
memset(&w, 0, sizeof(w));
102977
- w.xSelectCallback = selectAddSubqueryTypeInfo;
103501
+ w.xSelectCallback2 = selectAddSubqueryTypeInfo;
102978103502
w.xExprCallback = exprWalkNoop;
102979103503
w.pParse = pParse;
102980
- w.bSelectDepthFirst = 1;
102981103504
sqlite3WalkSelect(&w, pSelect);
102982103505
#endif
102983103506
}
102984103507
102985103508
@@ -104723,29 +105246,25 @@
104723105246
*/
104724105247
SQLITE_PRIVATE TriggerStep *sqlite3TriggerInsertStep(
104725105248
sqlite3 *db, /* The database connection */
104726105249
Token *pTableName, /* Name of the table into which we insert */
104727105250
IdList *pColumn, /* List of columns in pTableName to insert into */
104728
- ExprList *pEList, /* The VALUE clause: a list of values to be inserted */
104729105251
Select *pSelect, /* A SELECT statement that supplies values */
104730105252
u8 orconf /* The conflict algorithm (OE_Abort, OE_Replace, etc.) */
104731105253
){
104732105254
TriggerStep *pTriggerStep;
104733105255
104734
- assert(pEList == 0 || pSelect == 0);
104735
- assert(pEList != 0 || pSelect != 0 || db->mallocFailed);
105256
+ assert(pSelect != 0 || db->mallocFailed);
104736105257
104737105258
pTriggerStep = triggerStepAllocate(db, TK_INSERT, pTableName);
104738105259
if( pTriggerStep ){
104739105260
pTriggerStep->pSelect = sqlite3SelectDup(db, pSelect, EXPRDUP_REDUCE);
104740105261
pTriggerStep->pIdList = pColumn;
104741
- pTriggerStep->pExprList = sqlite3ExprListDup(db, pEList, EXPRDUP_REDUCE);
104742105262
pTriggerStep->orconf = orconf;
104743105263
}else{
104744105264
sqlite3IdListDelete(db, pColumn);
104745105265
}
104746
- sqlite3ExprListDelete(db, pEList);
104747105266
sqlite3SelectDelete(db, pSelect);
104748105267
104749105268
return pTriggerStep;
104750105269
}
104751105270
@@ -105079,11 +105598,10 @@
105079105598
break;
105080105599
}
105081105600
case TK_INSERT: {
105082105601
sqlite3Insert(pParse,
105083105602
targetSrcList(pParse, pStep),
105084
- sqlite3ExprListDup(db, pStep->pExprList, 0),
105085105603
sqlite3SelectDup(db, pStep->pSelect, 0),
105086105604
sqlite3IdListDup(db, pStep->pIdList),
105087105605
pParse->eOrconf
105088105606
);
105089105607
break;
@@ -108830,11 +109348,11 @@
108830109348
** be the name of an indexed column with TEXT affinity. */
108831109349
return 0;
108832109350
}
108833109351
assert( pLeft->iColumn!=(-1) ); /* Because IPK never has AFF_TEXT */
108834109352
108835
- pRight = pList->a[0].pExpr;
109353
+ pRight = sqlite3ExprSkipCollate(pList->a[0].pExpr);
108836109354
op = pRight->op;
108837109355
if( op==TK_VARIABLE ){
108838109356
Vdbe *pReprepare = pParse->pReprepare;
108839109357
int iCol = pRight->iColumn;
108840109358
pVal = sqlite3VdbeGetBoundValue(pReprepare, iCol, SQLITE_AFF_NONE);
@@ -109873,11 +110391,11 @@
109873110391
VdbeComment((v, "for %s", pTable->zName));
109874110392
109875110393
/* Fill the automatic index with content */
109876110394
addrTop = sqlite3VdbeAddOp1(v, OP_Rewind, pLevel->iTabCur);
109877110395
regRecord = sqlite3GetTempReg(pParse);
109878
- sqlite3GenerateIndexKey(pParse, pIdx, pLevel->iTabCur, regRecord, 0, 0);
110396
+ sqlite3GenerateIndexKey(pParse, pIdx, pLevel->iTabCur, regRecord, 0, 0, 0, 0);
109879110397
sqlite3VdbeAddOp2(v, OP_IdxInsert, pLevel->iIdxCur, regRecord);
109880110398
sqlite3VdbeChangeP5(v, OPFLAG_USESEEKRESULT);
109881110399
sqlite3VdbeAddOp2(v, OP_Next, pLevel->iTabCur, addrTop+1);
109882110400
sqlite3VdbeChangeP5(v, SQLITE_STMTSTATUS_AUTOINDEX);
109883110401
sqlite3VdbeJumpHere(v, addrTop);
@@ -112359,10 +112877,11 @@
112359112877
&& pSrc->pIndex==0
112360112878
&& !pSrc->viaCoroutine
112361112879
&& !pSrc->notIndexed
112362112880
&& HasRowid(pTab)
112363112881
&& !pSrc->isCorrelated
112882
+ && !pSrc->isRecursive
112364112883
){
112365112884
/* Generate auto-index WhereLoops */
112366112885
WhereTerm *pTerm;
112367112886
WhereTerm *pWCEnd = pWC->a + pWC->nTerm;
112368112887
for(pTerm=pWC->a; rc==SQLITE_OK && pTerm<pWCEnd; pTerm++){
@@ -114129,18 +114648,10 @@
114129114648
/*
114130114649
** An instance of this structure holds the ATTACH key and the key type.
114131114650
*/
114132114651
struct AttachKey { int type; Token key; };
114133114652
114134
-/*
114135
-** One or more VALUES claues
114136
-*/
114137
-struct ValueList {
114138
- ExprList *pList;
114139
- Select *pSelect;
114140
-};
114141
-
114142114653
114143114654
/* This is a utility routine used to set the ExprSpan.zStart and
114144114655
** ExprSpan.zEnd values of pOut so that the span covers the complete
114145114656
** range of text beginning with pStart and going to the end of pEnd.
114146114657
*/
@@ -114260,42 +114771,42 @@
114260114771
** YYNRULE the number of rules in the grammar
114261114772
** YYERRORSYMBOL is the code number of the error symbol. If not
114262114773
** defined, then do no error processing.
114263114774
*/
114264114775
#define YYCODETYPE unsigned char
114265
-#define YYNOCODE 253
114776
+#define YYNOCODE 254
114266114777
#define YYACTIONTYPE unsigned short int
114267
-#define YYWILDCARD 68
114778
+#define YYWILDCARD 70
114268114779
#define sqlite3ParserTOKENTYPE Token
114269114780
typedef union {
114270114781
int yyinit;
114271114782
sqlite3ParserTOKENTYPE yy0;
114272
- int yy4;
114273
- struct TrigEvent yy90;
114274
- ExprSpan yy118;
114275
- u16 yy177;
114276
- TriggerStep* yy203;
114277
- u8 yy210;
114278
- struct {int value; int mask;} yy215;
114279
- SrcList* yy259;
114280
- struct ValueList yy260;
114281
- struct LimitVal yy292;
114282
- Expr* yy314;
114283
- ExprList* yy322;
114284
- struct LikeOp yy342;
114285
- IdList* yy384;
114286
- Select* yy387;
114783
+ Select* yy3;
114784
+ ExprList* yy14;
114785
+ With* yy59;
114786
+ SrcList* yy65;
114787
+ struct LikeOp yy96;
114788
+ Expr* yy132;
114789
+ u8 yy186;
114790
+ int yy328;
114791
+ ExprSpan yy346;
114792
+ struct TrigEvent yy378;
114793
+ u16 yy381;
114794
+ IdList* yy408;
114795
+ struct {int value; int mask;} yy429;
114796
+ TriggerStep* yy473;
114797
+ struct LimitVal yy476;
114287114798
} YYMINORTYPE;
114288114799
#ifndef YYSTACKDEPTH
114289114800
#define YYSTACKDEPTH 100
114290114801
#endif
114291114802
#define sqlite3ParserARG_SDECL Parse *pParse;
114292114803
#define sqlite3ParserARG_PDECL ,Parse *pParse
114293114804
#define sqlite3ParserARG_FETCH Parse *pParse = yypParser->pParse
114294114805
#define sqlite3ParserARG_STORE yypParser->pParse = pParse
114295
-#define YYNSTATE 631
114296
-#define YYNRULE 329
114806
+#define YYNSTATE 642
114807
+#define YYNRULE 327
114297114808
#define YYFALLBACK 1
114298114809
#define YY_NO_ACTION (YYNSTATE+YYNRULE+2)
114299114810
#define YY_ACCEPT_ACTION (YYNSTATE+YYNRULE+1)
114300114811
#define YY_ERROR_ACTION (YYNSTATE+YYNRULE)
114301114812
@@ -114361,484 +114872,467 @@
114361114872
** shifting terminals.
114362114873
** yy_reduce_ofst[] For each state, the offset into yy_action for
114363114874
** shifting non-terminals after a reduce.
114364114875
** yy_default[] Default action for each state.
114365114876
*/
114366
-#define YY_ACTTAB_COUNT (1582)
114877
+#define YY_ACTTAB_COUNT (1497)
114367114878
static const YYACTIONTYPE yy_action[] = {
114368
- /* 0 */ 312, 961, 185, 420, 2, 171, 516, 515, 597, 56,
114369
- /* 10 */ 56, 56, 56, 49, 54, 54, 54, 54, 53, 53,
114370
- /* 20 */ 52, 52, 52, 51, 234, 197, 196, 195, 624, 623,
114371
- /* 30 */ 301, 590, 584, 56, 56, 56, 56, 156, 54, 54,
114372
- /* 40 */ 54, 54, 53, 53, 52, 52, 52, 51, 234, 628,
114373
- /* 50 */ 57, 58, 48, 582, 581, 583, 583, 55, 55, 56,
114374
- /* 60 */ 56, 56, 56, 466, 54, 54, 54, 54, 53, 53,
114375
- /* 70 */ 52, 52, 52, 51, 234, 312, 597, 52, 52, 52,
114376
- /* 80 */ 51, 234, 33, 54, 54, 54, 54, 53, 53, 52,
114377
- /* 90 */ 52, 52, 51, 234, 624, 623, 621, 620, 165, 624,
114378
- /* 100 */ 623, 383, 380, 379, 214, 328, 590, 584, 624, 623,
114379
- /* 110 */ 467, 59, 378, 619, 618, 617, 53, 53, 52, 52,
114380
- /* 120 */ 52, 51, 234, 506, 507, 57, 58, 48, 582, 581,
114381
- /* 130 */ 583, 583, 55, 55, 56, 56, 56, 56, 30, 54,
114382
- /* 140 */ 54, 54, 54, 53, 53, 52, 52, 52, 51, 234,
114383
- /* 150 */ 312, 50, 47, 146, 233, 232, 207, 474, 256, 349,
114384
- /* 160 */ 255, 475, 621, 620, 554, 438, 298, 621, 620, 236,
114385
- /* 170 */ 674, 435, 440, 553, 439, 366, 621, 620, 540, 224,
114386
- /* 180 */ 551, 590, 584, 176, 138, 282, 386, 277, 385, 168,
114387
- /* 190 */ 600, 422, 951, 548, 622, 951, 273, 572, 572, 566,
114388
- /* 200 */ 57, 58, 48, 582, 581, 583, 583, 55, 55, 56,
114389
- /* 210 */ 56, 56, 56, 354, 54, 54, 54, 54, 53, 53,
114390
- /* 220 */ 52, 52, 52, 51, 234, 312, 561, 526, 62, 675,
114391
- /* 230 */ 132, 595, 410, 348, 579, 579, 492, 426, 577, 419,
114392
- /* 240 */ 627, 65, 329, 560, 441, 237, 676, 123, 607, 67,
114393
- /* 250 */ 542, 532, 622, 170, 205, 500, 590, 584, 166, 559,
114394
- /* 260 */ 622, 403, 593, 593, 593, 442, 443, 271, 422, 950,
114395
- /* 270 */ 166, 223, 950, 483, 190, 57, 58, 48, 582, 581,
114396
- /* 280 */ 583, 583, 55, 55, 56, 56, 56, 56, 600, 54,
114397
- /* 290 */ 54, 54, 54, 53, 53, 52, 52, 52, 51, 234,
114398
- /* 300 */ 312, 441, 412, 376, 175, 165, 166, 391, 383, 380,
114399
- /* 310 */ 379, 342, 412, 203, 426, 66, 392, 622, 415, 378,
114400
- /* 320 */ 597, 166, 442, 338, 444, 571, 601, 74, 415, 624,
114401
- /* 330 */ 623, 590, 584, 624, 623, 174, 601, 92, 333, 171,
114402
- /* 340 */ 1, 410, 597, 579, 579, 624, 623, 600, 306, 425,
114403
- /* 350 */ 57, 58, 48, 582, 581, 583, 583, 55, 55, 56,
114404
- /* 360 */ 56, 56, 56, 580, 54, 54, 54, 54, 53, 53,
114405
- /* 370 */ 52, 52, 52, 51, 234, 312, 472, 262, 399, 68,
114406
- /* 380 */ 412, 339, 571, 389, 624, 623, 578, 602, 597, 589,
114407
- /* 390 */ 588, 603, 412, 622, 423, 533, 415, 621, 620, 513,
114408
- /* 400 */ 257, 621, 620, 166, 601, 91, 590, 584, 415, 45,
114409
- /* 410 */ 597, 586, 585, 621, 620, 250, 601, 92, 39, 347,
114410
- /* 420 */ 576, 336, 597, 547, 567, 57, 58, 48, 582, 581,
114411
- /* 430 */ 583, 583, 55, 55, 56, 56, 56, 56, 587, 54,
114412
- /* 440 */ 54, 54, 54, 53, 53, 52, 52, 52, 51, 234,
114413
- /* 450 */ 312, 561, 621, 620, 531, 291, 470, 188, 399, 375,
114414
- /* 460 */ 247, 492, 249, 350, 412, 476, 476, 368, 560, 299,
114415
- /* 470 */ 334, 412, 281, 482, 67, 565, 410, 622, 579, 579,
114416
- /* 480 */ 415, 590, 584, 280, 559, 467, 520, 415, 601, 92,
114417
- /* 490 */ 597, 167, 544, 36, 877, 601, 16, 519, 564, 6,
114418
- /* 500 */ 57, 58, 48, 582, 581, 583, 583, 55, 55, 56,
114419
- /* 510 */ 56, 56, 56, 200, 54, 54, 54, 54, 53, 53,
114420
- /* 520 */ 52, 52, 52, 51, 234, 312, 183, 412, 236, 528,
114421
- /* 530 */ 395, 535, 358, 256, 349, 255, 397, 412, 248, 182,
114422
- /* 540 */ 353, 359, 549, 415, 236, 317, 563, 50, 47, 146,
114423
- /* 550 */ 273, 601, 73, 415, 7, 311, 590, 584, 568, 493,
114424
- /* 560 */ 213, 601, 92, 233, 232, 410, 173, 579, 579, 330,
114425
- /* 570 */ 575, 574, 631, 629, 332, 57, 58, 48, 582, 581,
114426
- /* 580 */ 583, 583, 55, 55, 56, 56, 56, 56, 199, 54,
114427
- /* 590 */ 54, 54, 54, 53, 53, 52, 52, 52, 51, 234,
114428
- /* 600 */ 312, 492, 340, 320, 511, 505, 572, 572, 460, 562,
114429
- /* 610 */ 549, 170, 145, 430, 67, 558, 410, 622, 579, 579,
114430
- /* 620 */ 384, 236, 600, 412, 408, 575, 574, 504, 572, 572,
114431
- /* 630 */ 571, 590, 584, 353, 198, 143, 268, 549, 316, 415,
114432
- /* 640 */ 306, 424, 207, 50, 47, 146, 167, 601, 69, 546,
114433
- /* 650 */ 57, 58, 48, 582, 581, 583, 583, 55, 55, 56,
114434
- /* 660 */ 56, 56, 56, 555, 54, 54, 54, 54, 53, 53,
114435
- /* 670 */ 52, 52, 52, 51, 234, 312, 600, 326, 412, 270,
114436
- /* 680 */ 145, 264, 274, 266, 459, 571, 423, 35, 412, 568,
114437
- /* 690 */ 407, 213, 428, 388, 415, 308, 212, 143, 622, 354,
114438
- /* 700 */ 317, 12, 601, 94, 415, 549, 590, 584, 50, 47,
114439
- /* 710 */ 146, 365, 601, 97, 552, 362, 318, 147, 602, 361,
114440
- /* 720 */ 325, 15, 603, 187, 206, 57, 58, 48, 582, 581,
114441
- /* 730 */ 583, 583, 55, 55, 56, 56, 56, 56, 412, 54,
114442
- /* 740 */ 54, 54, 54, 53, 53, 52, 52, 52, 51, 234,
114443
- /* 750 */ 312, 412, 35, 412, 415, 22, 630, 2, 600, 50,
114444
- /* 760 */ 47, 146, 601, 95, 412, 485, 510, 415, 412, 415,
114445
- /* 770 */ 412, 11, 235, 486, 412, 601, 104, 601, 103, 19,
114446
- /* 780 */ 415, 590, 584, 352, 415, 40, 415, 38, 601, 105,
114447
- /* 790 */ 415, 32, 601, 106, 601, 133, 544, 169, 601, 134,
114448
- /* 800 */ 57, 58, 48, 582, 581, 583, 583, 55, 55, 56,
114449
- /* 810 */ 56, 56, 56, 412, 54, 54, 54, 54, 53, 53,
114450
- /* 820 */ 52, 52, 52, 51, 234, 312, 412, 274, 412, 415,
114451
- /* 830 */ 412, 274, 274, 274, 201, 230, 721, 601, 98, 484,
114452
- /* 840 */ 427, 307, 415, 622, 415, 540, 415, 622, 622, 622,
114453
- /* 850 */ 601, 102, 601, 101, 601, 93, 590, 584, 262, 21,
114454
- /* 860 */ 129, 622, 522, 521, 554, 222, 469, 521, 600, 324,
114455
- /* 870 */ 323, 322, 211, 553, 622, 57, 58, 48, 582, 581,
114456
- /* 880 */ 583, 583, 55, 55, 56, 56, 56, 56, 412, 54,
114457
- /* 890 */ 54, 54, 54, 53, 53, 52, 52, 52, 51, 234,
114458
- /* 900 */ 312, 412, 261, 412, 415, 412, 600, 210, 625, 367,
114459
- /* 910 */ 51, 234, 601, 100, 538, 606, 142, 415, 355, 415,
114460
- /* 920 */ 412, 415, 412, 496, 622, 601, 77, 601, 96, 601,
114461
- /* 930 */ 137, 590, 584, 530, 622, 529, 415, 141, 415, 28,
114462
- /* 940 */ 524, 600, 229, 544, 601, 136, 601, 135, 604, 204,
114463
- /* 950 */ 57, 58, 48, 582, 581, 583, 583, 55, 55, 56,
114464
- /* 960 */ 56, 56, 56, 412, 54, 54, 54, 54, 53, 53,
114465
- /* 970 */ 52, 52, 52, 51, 234, 312, 412, 360, 412, 415,
114466
- /* 980 */ 412, 360, 286, 600, 503, 220, 127, 601, 76, 629,
114467
- /* 990 */ 332, 382, 415, 622, 415, 540, 415, 622, 412, 613,
114468
- /* 1000 */ 601, 90, 601, 89, 601, 75, 590, 584, 341, 272,
114469
- /* 1010 */ 377, 622, 126, 27, 415, 622, 164, 544, 125, 280,
114470
- /* 1020 */ 373, 122, 601, 88, 480, 57, 46, 48, 582, 581,
114471
- /* 1030 */ 583, 583, 55, 55, 56, 56, 56, 56, 412, 54,
114472
- /* 1040 */ 54, 54, 54, 53, 53, 52, 52, 52, 51, 234,
114473
- /* 1050 */ 312, 412, 360, 412, 415, 412, 284, 186, 369, 321,
114474
- /* 1060 */ 477, 170, 601, 87, 121, 473, 221, 415, 622, 415,
114475
- /* 1070 */ 254, 415, 412, 355, 412, 601, 99, 601, 86, 601,
114476
- /* 1080 */ 17, 590, 584, 259, 612, 120, 159, 158, 415, 622,
114477
- /* 1090 */ 415, 14, 465, 157, 462, 25, 601, 85, 601, 84,
114478
- /* 1100 */ 622, 58, 48, 582, 581, 583, 583, 55, 55, 56,
114479
- /* 1110 */ 56, 56, 56, 412, 54, 54, 54, 54, 53, 53,
114480
- /* 1120 */ 52, 52, 52, 51, 234, 312, 412, 262, 412, 415,
114481
- /* 1130 */ 412, 262, 118, 611, 117, 24, 10, 601, 83, 351,
114482
- /* 1140 */ 216, 219, 415, 622, 415, 608, 415, 622, 412, 622,
114483
- /* 1150 */ 601, 72, 601, 71, 601, 82, 590, 584, 262, 4,
114484
- /* 1160 */ 605, 622, 458, 115, 415, 456, 252, 154, 452, 110,
114485
- /* 1170 */ 108, 453, 601, 81, 622, 451, 622, 48, 582, 581,
114486
- /* 1180 */ 583, 583, 55, 55, 56, 56, 56, 56, 412, 54,
114487
- /* 1190 */ 54, 54, 54, 53, 53, 52, 52, 52, 51, 234,
114488
- /* 1200 */ 44, 406, 450, 3, 415, 412, 262, 107, 416, 623,
114489
- /* 1210 */ 446, 437, 601, 80, 436, 335, 238, 189, 411, 409,
114490
- /* 1220 */ 594, 415, 622, 44, 406, 401, 3, 412, 557, 601,
114491
- /* 1230 */ 70, 416, 623, 412, 622, 149, 622, 421, 404, 64,
114492
- /* 1240 */ 412, 622, 409, 415, 622, 331, 139, 148, 566, 415,
114493
- /* 1250 */ 449, 601, 18, 228, 124, 626, 415, 601, 79, 315,
114494
- /* 1260 */ 181, 404, 412, 545, 601, 78, 262, 541, 41, 42,
114495
- /* 1270 */ 534, 566, 390, 202, 262, 43, 414, 413, 415, 622,
114496
- /* 1280 */ 595, 314, 622, 622, 180, 539, 601, 92, 415, 276,
114497
- /* 1290 */ 622, 41, 42, 509, 616, 615, 601, 9, 43, 414,
114498
- /* 1300 */ 413, 622, 418, 595, 262, 622, 275, 600, 614, 622,
114499
- /* 1310 */ 218, 593, 593, 593, 592, 591, 13, 178, 217, 417,
114500
- /* 1320 */ 622, 236, 622, 44, 406, 490, 3, 269, 399, 267,
114501
- /* 1330 */ 609, 416, 623, 400, 593, 593, 593, 592, 591, 13,
114502
- /* 1340 */ 265, 622, 409, 622, 263, 622, 34, 406, 244, 3,
114503
- /* 1350 */ 258, 363, 464, 463, 416, 623, 622, 356, 251, 8,
114504
- /* 1360 */ 622, 404, 177, 599, 455, 409, 622, 622, 622, 622,
114505
- /* 1370 */ 445, 566, 243, 622, 622, 236, 295, 240, 31, 239,
114506
- /* 1380 */ 622, 431, 30, 396, 404, 290, 622, 294, 622, 293,
114507
- /* 1390 */ 144, 41, 42, 622, 566, 622, 394, 622, 43, 414,
114508
- /* 1400 */ 413, 622, 289, 595, 398, 60, 622, 292, 37, 231,
114509
- /* 1410 */ 598, 172, 622, 29, 41, 42, 393, 523, 622, 556,
114510
- /* 1420 */ 184, 43, 414, 413, 287, 387, 595, 543, 285, 518,
114511
- /* 1430 */ 537, 536, 517, 327, 593, 593, 593, 592, 591, 13,
114512
- /* 1440 */ 215, 283, 278, 514, 513, 304, 303, 302, 179, 300,
114513
- /* 1450 */ 512, 310, 454, 128, 227, 226, 309, 593, 593, 593,
114514
- /* 1460 */ 592, 591, 13, 494, 489, 225, 488, 150, 487, 242,
114515
- /* 1470 */ 163, 61, 374, 481, 162, 161, 624, 623, 241, 372,
114516
- /* 1480 */ 209, 479, 370, 260, 26, 160, 478, 364, 468, 471,
114517
- /* 1490 */ 140, 152, 119, 467, 131, 116, 155, 153, 345, 457,
114518
- /* 1500 */ 151, 346, 130, 114, 113, 112, 111, 448, 319, 23,
114519
- /* 1510 */ 109, 434, 20, 433, 432, 429, 566, 610, 573, 596,
114520
- /* 1520 */ 63, 405, 191, 279, 510, 296, 498, 288, 570, 495,
114521
- /* 1530 */ 499, 497, 461, 194, 5, 305, 193, 192, 381, 569,
114522
- /* 1540 */ 357, 256, 344, 245, 526, 246, 253, 313, 595, 343,
114523
- /* 1550 */ 447, 297, 236, 402, 550, 491, 508, 502, 501, 527,
114524
- /* 1560 */ 234, 208, 525, 962, 962, 962, 371, 962, 962, 962,
114525
- /* 1570 */ 962, 962, 962, 962, 962, 337, 962, 962, 962, 593,
114526
- /* 1580 */ 593, 593,
114879
+ /* 0 */ 306, 212, 432, 955, 639, 191, 955, 295, 559, 88,
114880
+ /* 10 */ 88, 88, 88, 81, 86, 86, 86, 86, 85, 85,
114881
+ /* 20 */ 84, 84, 84, 83, 330, 185, 184, 183, 635, 635,
114882
+ /* 30 */ 292, 606, 606, 88, 88, 88, 88, 683, 86, 86,
114883
+ /* 40 */ 86, 86, 85, 85, 84, 84, 84, 83, 330, 16,
114884
+ /* 50 */ 436, 597, 89, 90, 80, 600, 599, 601, 601, 87,
114885
+ /* 60 */ 87, 88, 88, 88, 88, 684, 86, 86, 86, 86,
114886
+ /* 70 */ 85, 85, 84, 84, 84, 83, 330, 306, 559, 84,
114887
+ /* 80 */ 84, 84, 83, 330, 65, 86, 86, 86, 86, 85,
114888
+ /* 90 */ 85, 84, 84, 84, 83, 330, 635, 635, 634, 633,
114889
+ /* 100 */ 182, 682, 550, 379, 376, 375, 17, 322, 606, 606,
114890
+ /* 110 */ 371, 198, 479, 91, 374, 82, 79, 165, 85, 85,
114891
+ /* 120 */ 84, 84, 84, 83, 330, 598, 635, 635, 107, 89,
114892
+ /* 130 */ 90, 80, 600, 599, 601, 601, 87, 87, 88, 88,
114893
+ /* 140 */ 88, 88, 186, 86, 86, 86, 86, 85, 85, 84,
114894
+ /* 150 */ 84, 84, 83, 330, 306, 594, 594, 142, 328, 327,
114895
+ /* 160 */ 484, 249, 344, 238, 635, 635, 634, 633, 585, 448,
114896
+ /* 170 */ 526, 525, 229, 388, 1, 394, 450, 584, 449, 635,
114897
+ /* 180 */ 635, 635, 635, 319, 395, 606, 606, 199, 157, 273,
114898
+ /* 190 */ 382, 268, 381, 187, 635, 635, 634, 633, 311, 555,
114899
+ /* 200 */ 266, 593, 593, 266, 347, 588, 89, 90, 80, 600,
114900
+ /* 210 */ 599, 601, 601, 87, 87, 88, 88, 88, 88, 478,
114901
+ /* 220 */ 86, 86, 86, 86, 85, 85, 84, 84, 84, 83,
114902
+ /* 230 */ 330, 306, 272, 536, 634, 633, 146, 610, 197, 310,
114903
+ /* 240 */ 575, 182, 482, 271, 379, 376, 375, 506, 21, 634,
114904
+ /* 250 */ 633, 634, 633, 635, 635, 374, 611, 574, 548, 440,
114905
+ /* 260 */ 111, 563, 606, 606, 634, 633, 324, 479, 608, 608,
114906
+ /* 270 */ 608, 300, 435, 573, 119, 407, 210, 162, 562, 883,
114907
+ /* 280 */ 592, 592, 306, 89, 90, 80, 600, 599, 601, 601,
114908
+ /* 290 */ 87, 87, 88, 88, 88, 88, 506, 86, 86, 86,
114909
+ /* 300 */ 86, 85, 85, 84, 84, 84, 83, 330, 620, 111,
114910
+ /* 310 */ 635, 635, 361, 606, 606, 358, 249, 349, 248, 433,
114911
+ /* 320 */ 243, 479, 586, 634, 633, 195, 611, 93, 119, 221,
114912
+ /* 330 */ 575, 497, 534, 534, 89, 90, 80, 600, 599, 601,
114913
+ /* 340 */ 601, 87, 87, 88, 88, 88, 88, 574, 86, 86,
114914
+ /* 350 */ 86, 86, 85, 85, 84, 84, 84, 83, 330, 306,
114915
+ /* 360 */ 77, 429, 638, 573, 589, 530, 240, 230, 242, 105,
114916
+ /* 370 */ 249, 349, 248, 515, 588, 208, 460, 529, 564, 173,
114917
+ /* 380 */ 634, 633, 970, 144, 430, 2, 424, 228, 380, 557,
114918
+ /* 390 */ 606, 606, 190, 153, 159, 158, 514, 51, 632, 631,
114919
+ /* 400 */ 630, 71, 536, 432, 954, 196, 610, 954, 614, 45,
114920
+ /* 410 */ 18, 89, 90, 80, 600, 599, 601, 601, 87, 87,
114921
+ /* 420 */ 88, 88, 88, 88, 261, 86, 86, 86, 86, 85,
114922
+ /* 430 */ 85, 84, 84, 84, 83, 330, 306, 608, 608, 608,
114923
+ /* 440 */ 542, 424, 402, 385, 241, 506, 451, 320, 211, 543,
114924
+ /* 450 */ 164, 436, 386, 293, 451, 587, 108, 496, 111, 334,
114925
+ /* 460 */ 391, 591, 424, 614, 27, 452, 453, 606, 606, 72,
114926
+ /* 470 */ 257, 70, 259, 452, 339, 342, 564, 582, 68, 415,
114927
+ /* 480 */ 469, 328, 327, 62, 614, 45, 110, 393, 89, 90,
114928
+ /* 490 */ 80, 600, 599, 601, 601, 87, 87, 88, 88, 88,
114929
+ /* 500 */ 88, 152, 86, 86, 86, 86, 85, 85, 84, 84,
114930
+ /* 510 */ 84, 83, 330, 306, 110, 499, 520, 538, 402, 389,
114931
+ /* 520 */ 424, 110, 566, 500, 593, 593, 454, 82, 79, 165,
114932
+ /* 530 */ 424, 591, 384, 564, 340, 615, 188, 162, 424, 350,
114933
+ /* 540 */ 616, 424, 614, 44, 606, 606, 445, 582, 300, 434,
114934
+ /* 550 */ 151, 19, 614, 9, 568, 580, 348, 615, 469, 567,
114935
+ /* 560 */ 614, 26, 616, 614, 45, 89, 90, 80, 600, 599,
114936
+ /* 570 */ 601, 601, 87, 87, 88, 88, 88, 88, 411, 86,
114937
+ /* 580 */ 86, 86, 86, 85, 85, 84, 84, 84, 83, 330,
114938
+ /* 590 */ 306, 579, 110, 578, 521, 282, 433, 398, 400, 255,
114939
+ /* 600 */ 486, 82, 79, 165, 487, 164, 82, 79, 165, 488,
114940
+ /* 610 */ 488, 364, 387, 424, 544, 544, 509, 350, 362, 155,
114941
+ /* 620 */ 191, 606, 606, 559, 642, 640, 333, 82, 79, 165,
114942
+ /* 630 */ 305, 564, 507, 312, 357, 614, 45, 329, 596, 595,
114943
+ /* 640 */ 194, 337, 89, 90, 80, 600, 599, 601, 601, 87,
114944
+ /* 650 */ 87, 88, 88, 88, 88, 424, 86, 86, 86, 86,
114945
+ /* 660 */ 85, 85, 84, 84, 84, 83, 330, 306, 20, 323,
114946
+ /* 670 */ 150, 263, 211, 543, 421, 596, 595, 614, 22, 424,
114947
+ /* 680 */ 193, 424, 284, 424, 391, 424, 509, 424, 577, 424,
114948
+ /* 690 */ 186, 335, 424, 559, 424, 313, 120, 546, 606, 606,
114949
+ /* 700 */ 67, 614, 47, 614, 50, 614, 48, 614, 100, 614,
114950
+ /* 710 */ 99, 614, 101, 576, 614, 102, 614, 109, 326, 89,
114951
+ /* 720 */ 90, 80, 600, 599, 601, 601, 87, 87, 88, 88,
114952
+ /* 730 */ 88, 88, 424, 86, 86, 86, 86, 85, 85, 84,
114953
+ /* 740 */ 84, 84, 83, 330, 306, 424, 311, 424, 585, 54,
114954
+ /* 750 */ 424, 516, 517, 590, 614, 112, 424, 584, 424, 572,
114955
+ /* 760 */ 424, 195, 424, 571, 424, 67, 424, 614, 94, 614,
114956
+ /* 770 */ 98, 424, 614, 97, 264, 606, 606, 195, 614, 46,
114957
+ /* 780 */ 614, 96, 614, 30, 614, 49, 614, 115, 614, 114,
114958
+ /* 790 */ 418, 229, 388, 614, 113, 306, 89, 90, 80, 600,
114959
+ /* 800 */ 599, 601, 601, 87, 87, 88, 88, 88, 88, 424,
114960
+ /* 810 */ 86, 86, 86, 86, 85, 85, 84, 84, 84, 83,
114961
+ /* 820 */ 330, 119, 424, 590, 110, 372, 606, 606, 195, 53,
114962
+ /* 830 */ 250, 614, 29, 195, 472, 438, 729, 190, 302, 498,
114963
+ /* 840 */ 14, 523, 641, 2, 614, 43, 306, 89, 90, 80,
114964
+ /* 850 */ 600, 599, 601, 601, 87, 87, 88, 88, 88, 88,
114965
+ /* 860 */ 424, 86, 86, 86, 86, 85, 85, 84, 84, 84,
114966
+ /* 870 */ 83, 330, 424, 613, 964, 964, 354, 606, 606, 420,
114967
+ /* 880 */ 312, 64, 614, 42, 391, 355, 283, 437, 301, 255,
114968
+ /* 890 */ 414, 410, 495, 492, 614, 28, 471, 306, 89, 90,
114969
+ /* 900 */ 80, 600, 599, 601, 601, 87, 87, 88, 88, 88,
114970
+ /* 910 */ 88, 424, 86, 86, 86, 86, 85, 85, 84, 84,
114971
+ /* 920 */ 84, 83, 330, 424, 110, 110, 110, 110, 606, 606,
114972
+ /* 930 */ 110, 254, 13, 614, 41, 532, 531, 283, 481, 531,
114973
+ /* 940 */ 457, 284, 119, 561, 356, 614, 40, 284, 306, 89,
114974
+ /* 950 */ 78, 80, 600, 599, 601, 601, 87, 87, 88, 88,
114975
+ /* 960 */ 88, 88, 424, 86, 86, 86, 86, 85, 85, 84,
114976
+ /* 970 */ 84, 84, 83, 330, 110, 424, 341, 220, 555, 606,
114977
+ /* 980 */ 606, 351, 555, 318, 614, 95, 413, 255, 83, 330,
114978
+ /* 990 */ 284, 284, 255, 640, 333, 356, 255, 614, 39, 306,
114979
+ /* 1000 */ 356, 90, 80, 600, 599, 601, 601, 87, 87, 88,
114980
+ /* 1010 */ 88, 88, 88, 424, 86, 86, 86, 86, 85, 85,
114981
+ /* 1020 */ 84, 84, 84, 83, 330, 424, 317, 316, 141, 465,
114982
+ /* 1030 */ 606, 606, 219, 619, 463, 614, 10, 417, 462, 255,
114983
+ /* 1040 */ 189, 510, 553, 351, 207, 363, 161, 614, 38, 315,
114984
+ /* 1050 */ 218, 255, 255, 80, 600, 599, 601, 601, 87, 87,
114985
+ /* 1060 */ 88, 88, 88, 88, 424, 86, 86, 86, 86, 85,
114986
+ /* 1070 */ 85, 84, 84, 84, 83, 330, 76, 419, 255, 3,
114987
+ /* 1080 */ 878, 461, 424, 247, 331, 331, 614, 37, 217, 76,
114988
+ /* 1090 */ 419, 390, 3, 216, 215, 422, 4, 331, 331, 424,
114989
+ /* 1100 */ 547, 12, 424, 545, 614, 36, 424, 541, 422, 424,
114990
+ /* 1110 */ 540, 424, 214, 424, 408, 424, 539, 403, 605, 605,
114991
+ /* 1120 */ 237, 614, 25, 119, 614, 24, 588, 408, 614, 45,
114992
+ /* 1130 */ 118, 614, 35, 614, 34, 614, 33, 614, 23, 588,
114993
+ /* 1140 */ 60, 223, 603, 602, 513, 378, 73, 74, 140, 139,
114994
+ /* 1150 */ 424, 110, 265, 75, 426, 425, 59, 424, 610, 73,
114995
+ /* 1160 */ 74, 549, 402, 404, 424, 373, 75, 426, 425, 604,
114996
+ /* 1170 */ 138, 610, 614, 11, 392, 76, 419, 181, 3, 614,
114997
+ /* 1180 */ 32, 271, 369, 331, 331, 493, 614, 31, 149, 608,
114998
+ /* 1190 */ 608, 608, 607, 15, 422, 365, 614, 8, 137, 489,
114999
+ /* 1200 */ 136, 190, 608, 608, 608, 607, 15, 485, 176, 135,
115000
+ /* 1210 */ 7, 252, 477, 408, 174, 133, 175, 474, 57, 56,
115001
+ /* 1220 */ 132, 130, 119, 76, 419, 588, 3, 468, 245, 464,
115002
+ /* 1230 */ 171, 331, 331, 125, 123, 456, 447, 122, 446, 104,
115003
+ /* 1240 */ 336, 231, 422, 166, 154, 73, 74, 332, 116, 431,
115004
+ /* 1250 */ 121, 309, 75, 426, 425, 222, 106, 610, 308, 637,
115005
+ /* 1260 */ 204, 408, 629, 627, 628, 6, 200, 428, 427, 290,
115006
+ /* 1270 */ 203, 622, 201, 588, 62, 63, 289, 66, 419, 399,
115007
+ /* 1280 */ 3, 401, 288, 92, 143, 331, 331, 287, 608, 608,
115008
+ /* 1290 */ 608, 607, 15, 73, 74, 227, 422, 325, 69, 416,
115009
+ /* 1300 */ 75, 426, 425, 612, 412, 610, 192, 61, 569, 209,
115010
+ /* 1310 */ 396, 226, 278, 225, 383, 408, 527, 558, 276, 533,
115011
+ /* 1320 */ 552, 528, 321, 523, 370, 508, 180, 588, 494, 179,
115012
+ /* 1330 */ 366, 117, 253, 269, 522, 503, 608, 608, 608, 607,
115013
+ /* 1340 */ 15, 551, 502, 58, 274, 524, 178, 73, 74, 304,
115014
+ /* 1350 */ 501, 368, 303, 206, 75, 426, 425, 491, 360, 610,
115015
+ /* 1360 */ 213, 177, 483, 131, 345, 298, 297, 296, 202, 294,
115016
+ /* 1370 */ 480, 490, 466, 134, 172, 129, 444, 346, 470, 128,
115017
+ /* 1380 */ 314, 459, 103, 127, 126, 148, 124, 167, 443, 235,
115018
+ /* 1390 */ 608, 608, 608, 607, 15, 442, 439, 623, 234, 299,
115019
+ /* 1400 */ 145, 583, 291, 377, 581, 160, 119, 156, 270, 636,
115020
+ /* 1410 */ 971, 169, 279, 626, 520, 625, 473, 624, 170, 621,
115021
+ /* 1420 */ 618, 119, 168, 55, 409, 423, 537, 609, 286, 285,
115022
+ /* 1430 */ 405, 570, 560, 556, 5, 52, 458, 554, 147, 267,
115023
+ /* 1440 */ 519, 504, 518, 406, 262, 239, 260, 512, 343, 511,
115024
+ /* 1450 */ 258, 353, 565, 256, 224, 251, 359, 277, 275, 476,
115025
+ /* 1460 */ 475, 246, 352, 244, 467, 455, 236, 233, 232, 307,
115026
+ /* 1470 */ 441, 281, 205, 163, 397, 280, 535, 505, 330, 617,
115027
+ /* 1480 */ 971, 971, 971, 971, 367, 971, 971, 971, 971, 971,
115028
+ /* 1490 */ 971, 971, 971, 971, 971, 971, 338,
114527115029
};
114528115030
static const YYCODETYPE yy_lookahead[] = {
114529
- /* 0 */ 19, 143, 144, 145, 146, 24, 7, 8, 27, 78,
114530
- /* 10 */ 79, 80, 81, 82, 83, 84, 85, 86, 87, 88,
114531
- /* 20 */ 89, 90, 91, 92, 93, 106, 107, 108, 27, 28,
114532
- /* 30 */ 15, 50, 51, 78, 79, 80, 81, 26, 83, 84,
114533
- /* 40 */ 85, 86, 87, 88, 89, 90, 91, 92, 93, 1,
114534
- /* 50 */ 69, 70, 71, 72, 73, 74, 75, 76, 77, 78,
114535
- /* 60 */ 79, 80, 81, 11, 83, 84, 85, 86, 87, 88,
114536
- /* 70 */ 89, 90, 91, 92, 93, 19, 95, 89, 90, 91,
114537
- /* 80 */ 92, 93, 26, 83, 84, 85, 86, 87, 88, 89,
114538
- /* 90 */ 90, 91, 92, 93, 27, 28, 95, 96, 97, 27,
114539
- /* 100 */ 28, 100, 101, 102, 22, 19, 50, 51, 27, 28,
114540
- /* 110 */ 58, 55, 111, 7, 8, 9, 87, 88, 89, 90,
114541
- /* 120 */ 91, 92, 93, 98, 99, 69, 70, 71, 72, 73,
114542
- /* 130 */ 74, 75, 76, 77, 78, 79, 80, 81, 127, 83,
114543
- /* 140 */ 84, 85, 86, 87, 88, 89, 90, 91, 92, 93,
114544
- /* 150 */ 19, 223, 224, 225, 87, 88, 162, 31, 106, 107,
114545
- /* 160 */ 108, 35, 95, 96, 33, 98, 23, 95, 96, 117,
114546
- /* 170 */ 119, 243, 105, 42, 107, 49, 95, 96, 151, 93,
114547
- /* 180 */ 26, 50, 51, 97, 98, 99, 100, 101, 102, 103,
114548
- /* 190 */ 196, 22, 23, 121, 167, 26, 110, 130, 131, 67,
114549
- /* 200 */ 69, 70, 71, 72, 73, 74, 75, 76, 77, 78,
114550
- /* 210 */ 79, 80, 81, 219, 83, 84, 85, 86, 87, 88,
114551
- /* 220 */ 89, 90, 91, 92, 93, 19, 12, 95, 234, 119,
114552
- /* 230 */ 24, 99, 113, 239, 115, 116, 151, 68, 23, 147,
114553
- /* 240 */ 148, 26, 215, 29, 151, 153, 119, 155, 163, 164,
114554
- /* 250 */ 23, 23, 167, 26, 162, 23, 50, 51, 26, 45,
114555
- /* 260 */ 167, 47, 130, 131, 132, 172, 173, 23, 22, 23,
114556
- /* 270 */ 26, 186, 26, 188, 120, 69, 70, 71, 72, 73,
114557
- /* 280 */ 74, 75, 76, 77, 78, 79, 80, 81, 196, 83,
114558
- /* 290 */ 84, 85, 86, 87, 88, 89, 90, 91, 92, 93,
114559
- /* 300 */ 19, 151, 151, 23, 119, 97, 26, 19, 100, 101,
114560
- /* 310 */ 102, 219, 151, 162, 68, 22, 28, 167, 167, 111,
114561
- /* 320 */ 27, 26, 172, 173, 231, 232, 175, 176, 167, 27,
114562
- /* 330 */ 28, 50, 51, 27, 28, 119, 175, 176, 246, 24,
114563
- /* 340 */ 22, 113, 27, 115, 116, 27, 28, 196, 22, 23,
114564
- /* 350 */ 69, 70, 71, 72, 73, 74, 75, 76, 77, 78,
114565
- /* 360 */ 79, 80, 81, 114, 83, 84, 85, 86, 87, 88,
114566
- /* 370 */ 89, 90, 91, 92, 93, 19, 21, 151, 217, 22,
114567
- /* 380 */ 151, 231, 232, 222, 27, 28, 23, 114, 95, 50,
114568
- /* 390 */ 51, 118, 151, 167, 68, 89, 167, 95, 96, 104,
114569
- /* 400 */ 23, 95, 96, 26, 175, 176, 50, 51, 167, 22,
114570
- /* 410 */ 95, 72, 73, 95, 96, 16, 175, 176, 137, 64,
114571
- /* 420 */ 23, 195, 27, 121, 23, 69, 70, 71, 72, 73,
114572
- /* 430 */ 74, 75, 76, 77, 78, 79, 80, 81, 99, 83,
114573
- /* 440 */ 84, 85, 86, 87, 88, 89, 90, 91, 92, 93,
114574
- /* 450 */ 19, 12, 95, 96, 23, 226, 101, 22, 217, 19,
114575
- /* 460 */ 61, 151, 63, 222, 151, 106, 107, 108, 29, 159,
114576
- /* 470 */ 244, 151, 99, 163, 164, 23, 113, 167, 115, 116,
114577
- /* 480 */ 167, 50, 51, 110, 45, 58, 47, 167, 175, 176,
114578
- /* 490 */ 95, 51, 168, 137, 139, 175, 176, 58, 11, 22,
114579
- /* 500 */ 69, 70, 71, 72, 73, 74, 75, 76, 77, 78,
114580
- /* 510 */ 79, 80, 81, 22, 83, 84, 85, 86, 87, 88,
114581
- /* 520 */ 89, 90, 91, 92, 93, 19, 23, 151, 117, 23,
114582
- /* 530 */ 217, 207, 19, 106, 107, 108, 216, 151, 139, 23,
114583
- /* 540 */ 129, 28, 26, 167, 117, 105, 23, 223, 224, 225,
114584
- /* 550 */ 110, 175, 176, 167, 77, 165, 50, 51, 168, 169,
114585
- /* 560 */ 170, 175, 176, 87, 88, 113, 26, 115, 116, 171,
114586
- /* 570 */ 172, 173, 0, 1, 2, 69, 70, 71, 72, 73,
114587
- /* 580 */ 74, 75, 76, 77, 78, 79, 80, 81, 162, 83,
114588
- /* 590 */ 84, 85, 86, 87, 88, 89, 90, 91, 92, 93,
114589
- /* 600 */ 19, 151, 98, 217, 23, 37, 130, 131, 23, 23,
114590
- /* 610 */ 26, 26, 96, 163, 164, 23, 113, 167, 115, 116,
114591
- /* 620 */ 52, 117, 196, 151, 171, 172, 173, 59, 130, 131,
114592
- /* 630 */ 232, 50, 51, 129, 208, 209, 16, 121, 156, 167,
114593
- /* 640 */ 22, 23, 162, 223, 224, 225, 51, 175, 176, 121,
114594
- /* 650 */ 69, 70, 71, 72, 73, 74, 75, 76, 77, 78,
114595
- /* 660 */ 79, 80, 81, 178, 83, 84, 85, 86, 87, 88,
114596
- /* 670 */ 89, 90, 91, 92, 93, 19, 196, 109, 151, 23,
114597
- /* 680 */ 96, 61, 151, 63, 23, 232, 68, 26, 151, 168,
114598
- /* 690 */ 169, 170, 23, 89, 167, 26, 208, 209, 167, 219,
114599
- /* 700 */ 105, 36, 175, 176, 167, 121, 50, 51, 223, 224,
114600
- /* 710 */ 225, 229, 175, 176, 178, 233, 247, 248, 114, 239,
114601
- /* 720 */ 189, 22, 118, 24, 162, 69, 70, 71, 72, 73,
114602
- /* 730 */ 74, 75, 76, 77, 78, 79, 80, 81, 151, 83,
114603
- /* 740 */ 84, 85, 86, 87, 88, 89, 90, 91, 92, 93,
114604
- /* 750 */ 19, 151, 26, 151, 167, 24, 145, 146, 196, 223,
114605
- /* 760 */ 224, 225, 175, 176, 151, 182, 183, 167, 151, 167,
114606
- /* 770 */ 151, 36, 199, 190, 151, 175, 176, 175, 176, 206,
114607
- /* 780 */ 167, 50, 51, 221, 167, 136, 167, 138, 175, 176,
114608
- /* 790 */ 167, 26, 175, 176, 175, 176, 168, 36, 175, 176,
114609
- /* 800 */ 69, 70, 71, 72, 73, 74, 75, 76, 77, 78,
114610
- /* 810 */ 79, 80, 81, 151, 83, 84, 85, 86, 87, 88,
114611
- /* 820 */ 89, 90, 91, 92, 93, 19, 151, 151, 151, 167,
114612
- /* 830 */ 151, 151, 151, 151, 162, 207, 23, 175, 176, 26,
114613
- /* 840 */ 249, 250, 167, 167, 167, 151, 167, 167, 167, 167,
114614
- /* 850 */ 175, 176, 175, 176, 175, 176, 50, 51, 151, 53,
114615
- /* 860 */ 22, 167, 192, 193, 33, 189, 192, 193, 196, 189,
114616
- /* 870 */ 189, 189, 162, 42, 167, 69, 70, 71, 72, 73,
114617
- /* 880 */ 74, 75, 76, 77, 78, 79, 80, 81, 151, 83,
114618
- /* 890 */ 84, 85, 86, 87, 88, 89, 90, 91, 92, 93,
114619
- /* 900 */ 19, 151, 195, 151, 167, 151, 196, 162, 151, 215,
114620
- /* 910 */ 92, 93, 175, 176, 28, 174, 119, 167, 151, 167,
114621
- /* 920 */ 151, 167, 151, 182, 167, 175, 176, 175, 176, 175,
114622
- /* 930 */ 176, 50, 51, 23, 167, 23, 167, 40, 167, 22,
114623
- /* 940 */ 167, 196, 53, 168, 175, 176, 175, 176, 175, 162,
114624
- /* 950 */ 69, 70, 71, 72, 73, 74, 75, 76, 77, 78,
114625
- /* 960 */ 79, 80, 81, 151, 83, 84, 85, 86, 87, 88,
114626
- /* 970 */ 89, 90, 91, 92, 93, 19, 151, 151, 151, 167,
114627
- /* 980 */ 151, 151, 207, 196, 30, 218, 22, 175, 176, 1,
114628
- /* 990 */ 2, 53, 167, 167, 167, 151, 167, 167, 151, 151,
114629
- /* 1000 */ 175, 176, 175, 176, 175, 176, 50, 51, 221, 23,
114630
- /* 1010 */ 53, 167, 22, 22, 167, 167, 103, 168, 22, 110,
114631
- /* 1020 */ 19, 105, 175, 176, 20, 69, 70, 71, 72, 73,
114632
- /* 1030 */ 74, 75, 76, 77, 78, 79, 80, 81, 151, 83,
114633
- /* 1040 */ 84, 85, 86, 87, 88, 89, 90, 91, 92, 93,
114634
- /* 1050 */ 19, 151, 151, 151, 167, 151, 207, 24, 44, 215,
114635
- /* 1060 */ 60, 26, 175, 176, 54, 54, 240, 167, 167, 167,
114636
- /* 1070 */ 240, 167, 151, 151, 151, 175, 176, 175, 176, 175,
114637
- /* 1080 */ 176, 50, 51, 139, 151, 22, 105, 119, 167, 167,
114638
- /* 1090 */ 167, 5, 1, 36, 28, 77, 175, 176, 175, 176,
114639
- /* 1100 */ 167, 70, 71, 72, 73, 74, 75, 76, 77, 78,
114640
- /* 1110 */ 79, 80, 81, 151, 83, 84, 85, 86, 87, 88,
114641
- /* 1120 */ 89, 90, 91, 92, 93, 19, 151, 151, 151, 167,
114642
- /* 1130 */ 151, 151, 109, 151, 128, 77, 22, 175, 176, 26,
114643
- /* 1140 */ 218, 240, 167, 167, 167, 151, 167, 167, 151, 167,
114644
- /* 1150 */ 175, 176, 175, 176, 175, 176, 50, 51, 151, 22,
114645
- /* 1160 */ 151, 167, 23, 120, 167, 1, 16, 122, 20, 120,
114646
- /* 1170 */ 109, 195, 175, 176, 167, 195, 167, 71, 72, 73,
114647
- /* 1180 */ 74, 75, 76, 77, 78, 79, 80, 81, 151, 83,
114648
- /* 1190 */ 84, 85, 86, 87, 88, 89, 90, 91, 92, 93,
114649
- /* 1200 */ 19, 20, 195, 22, 167, 151, 151, 128, 27, 28,
114650
- /* 1210 */ 129, 23, 175, 176, 23, 66, 141, 22, 151, 38,
114651
- /* 1220 */ 151, 167, 167, 19, 20, 151, 22, 151, 151, 175,
114652
- /* 1230 */ 176, 27, 28, 151, 167, 15, 167, 4, 57, 16,
114653
- /* 1240 */ 151, 167, 38, 167, 167, 3, 166, 248, 67, 167,
114654
- /* 1250 */ 195, 175, 176, 181, 181, 150, 167, 175, 176, 251,
114655
- /* 1260 */ 6, 57, 151, 151, 175, 176, 151, 151, 87, 88,
114656
- /* 1270 */ 89, 67, 151, 162, 151, 94, 95, 96, 167, 167,
114657
- /* 1280 */ 99, 251, 167, 167, 152, 151, 175, 176, 167, 151,
114658
- /* 1290 */ 167, 87, 88, 151, 150, 150, 175, 176, 94, 95,
114659
- /* 1300 */ 96, 167, 150, 99, 151, 167, 151, 196, 13, 167,
114660
- /* 1310 */ 195, 130, 131, 132, 133, 134, 135, 152, 195, 160,
114661
- /* 1320 */ 167, 117, 167, 19, 20, 151, 22, 151, 217, 151,
114662
- /* 1330 */ 161, 27, 28, 222, 130, 131, 132, 133, 134, 135,
114663
- /* 1340 */ 151, 167, 38, 167, 151, 167, 19, 20, 195, 22,
114664
- /* 1350 */ 151, 151, 151, 151, 27, 28, 167, 151, 151, 26,
114665
- /* 1360 */ 167, 57, 25, 196, 151, 38, 167, 167, 167, 167,
114666
- /* 1370 */ 151, 67, 151, 167, 167, 117, 201, 151, 125, 151,
114667
- /* 1380 */ 167, 151, 127, 124, 57, 151, 167, 202, 167, 203,
114668
- /* 1390 */ 151, 87, 88, 167, 67, 167, 151, 167, 94, 95,
114669
- /* 1400 */ 96, 167, 151, 99, 123, 126, 167, 204, 136, 227,
114670
- /* 1410 */ 205, 119, 167, 105, 87, 88, 122, 177, 167, 158,
114671
- /* 1420 */ 158, 94, 95, 96, 212, 105, 99, 213, 212, 177,
114672
- /* 1430 */ 213, 213, 185, 48, 130, 131, 132, 133, 134, 135,
114673
- /* 1440 */ 5, 212, 177, 179, 104, 10, 11, 12, 13, 14,
114674
- /* 1450 */ 177, 180, 17, 22, 230, 93, 180, 130, 131, 132,
114675
- /* 1460 */ 133, 134, 135, 185, 177, 230, 177, 32, 177, 34,
114676
- /* 1470 */ 157, 22, 18, 158, 157, 157, 27, 28, 43, 158,
114677
- /* 1480 */ 158, 158, 46, 237, 136, 157, 238, 158, 191, 201,
114678
- /* 1490 */ 69, 56, 191, 58, 220, 22, 157, 62, 18, 201,
114679
- /* 1500 */ 65, 158, 220, 194, 194, 194, 194, 201, 158, 242,
114680
- /* 1510 */ 191, 41, 242, 158, 158, 39, 67, 154, 232, 168,
114681
- /* 1520 */ 245, 228, 198, 178, 183, 200, 168, 211, 232, 168,
114682
- /* 1530 */ 178, 178, 201, 187, 198, 149, 87, 88, 179, 168,
114683
- /* 1540 */ 241, 106, 107, 108, 95, 211, 241, 112, 99, 211,
114684
- /* 1550 */ 201, 197, 117, 193, 210, 188, 184, 184, 184, 175,
114685
- /* 1560 */ 93, 235, 175, 252, 252, 252, 236, 252, 252, 252,
114686
- /* 1570 */ 252, 252, 252, 252, 252, 140, 252, 252, 252, 130,
114687
- /* 1580 */ 131, 132,
114688
-};
114689
-#define YY_SHIFT_USE_DFLT (-82)
114690
-#define YY_SHIFT_COUNT (419)
114691
-#define YY_SHIFT_MIN (-81)
114692
-#define YY_SHIFT_MAX (1480)
115031
+ /* 0 */ 19, 22, 22, 23, 1, 24, 26, 15, 27, 80,
115032
+ /* 10 */ 81, 82, 83, 84, 85, 86, 87, 88, 89, 90,
115033
+ /* 20 */ 91, 92, 93, 94, 95, 108, 109, 110, 27, 28,
115034
+ /* 30 */ 23, 50, 51, 80, 81, 82, 83, 122, 85, 86,
115035
+ /* 40 */ 87, 88, 89, 90, 91, 92, 93, 94, 95, 22,
115036
+ /* 50 */ 70, 23, 71, 72, 73, 74, 75, 76, 77, 78,
115037
+ /* 60 */ 79, 80, 81, 82, 83, 122, 85, 86, 87, 88,
115038
+ /* 70 */ 89, 90, 91, 92, 93, 94, 95, 19, 97, 91,
115039
+ /* 80 */ 92, 93, 94, 95, 26, 85, 86, 87, 88, 89,
115040
+ /* 90 */ 90, 91, 92, 93, 94, 95, 27, 28, 97, 98,
115041
+ /* 100 */ 99, 122, 211, 102, 103, 104, 79, 19, 50, 51,
115042
+ /* 110 */ 19, 122, 59, 55, 113, 224, 225, 226, 89, 90,
115043
+ /* 120 */ 91, 92, 93, 94, 95, 23, 27, 28, 26, 71,
115044
+ /* 130 */ 72, 73, 74, 75, 76, 77, 78, 79, 80, 81,
115045
+ /* 140 */ 82, 83, 51, 85, 86, 87, 88, 89, 90, 91,
115046
+ /* 150 */ 92, 93, 94, 95, 19, 132, 133, 58, 89, 90,
115047
+ /* 160 */ 21, 108, 109, 110, 27, 28, 97, 98, 33, 100,
115048
+ /* 170 */ 7, 8, 119, 120, 22, 19, 107, 42, 109, 27,
115049
+ /* 180 */ 28, 27, 28, 95, 28, 50, 51, 99, 100, 101,
115050
+ /* 190 */ 102, 103, 104, 105, 27, 28, 97, 98, 107, 152,
115051
+ /* 200 */ 112, 132, 133, 112, 65, 69, 71, 72, 73, 74,
115052
+ /* 210 */ 75, 76, 77, 78, 79, 80, 81, 82, 83, 11,
115053
+ /* 220 */ 85, 86, 87, 88, 89, 90, 91, 92, 93, 94,
115054
+ /* 230 */ 95, 19, 101, 97, 97, 98, 24, 101, 122, 157,
115055
+ /* 240 */ 12, 99, 103, 112, 102, 103, 104, 152, 22, 97,
115056
+ /* 250 */ 98, 97, 98, 27, 28, 113, 27, 29, 91, 164,
115057
+ /* 260 */ 165, 124, 50, 51, 97, 98, 219, 59, 132, 133,
115058
+ /* 270 */ 134, 22, 23, 45, 66, 47, 212, 213, 124, 140,
115059
+ /* 280 */ 132, 133, 19, 71, 72, 73, 74, 75, 76, 77,
115060
+ /* 290 */ 78, 79, 80, 81, 82, 83, 152, 85, 86, 87,
115061
+ /* 300 */ 88, 89, 90, 91, 92, 93, 94, 95, 164, 165,
115062
+ /* 310 */ 27, 28, 230, 50, 51, 233, 108, 109, 110, 70,
115063
+ /* 320 */ 16, 59, 23, 97, 98, 26, 97, 22, 66, 185,
115064
+ /* 330 */ 12, 187, 27, 28, 71, 72, 73, 74, 75, 76,
115065
+ /* 340 */ 77, 78, 79, 80, 81, 82, 83, 29, 85, 86,
115066
+ /* 350 */ 87, 88, 89, 90, 91, 92, 93, 94, 95, 19,
115067
+ /* 360 */ 22, 148, 149, 45, 23, 47, 62, 154, 64, 156,
115068
+ /* 370 */ 108, 109, 110, 37, 69, 23, 163, 59, 26, 26,
115069
+ /* 380 */ 97, 98, 144, 145, 146, 147, 152, 200, 52, 23,
115070
+ /* 390 */ 50, 51, 26, 22, 89, 90, 60, 210, 7, 8,
115071
+ /* 400 */ 9, 138, 97, 22, 23, 26, 101, 26, 174, 175,
115072
+ /* 410 */ 197, 71, 72, 73, 74, 75, 76, 77, 78, 79,
115073
+ /* 420 */ 80, 81, 82, 83, 16, 85, 86, 87, 88, 89,
115074
+ /* 430 */ 90, 91, 92, 93, 94, 95, 19, 132, 133, 134,
115075
+ /* 440 */ 23, 152, 208, 209, 140, 152, 152, 111, 195, 196,
115076
+ /* 450 */ 98, 70, 163, 160, 152, 23, 22, 164, 165, 246,
115077
+ /* 460 */ 207, 27, 152, 174, 175, 171, 172, 50, 51, 137,
115078
+ /* 470 */ 62, 139, 64, 171, 172, 222, 124, 27, 138, 24,
115079
+ /* 480 */ 163, 89, 90, 130, 174, 175, 197, 163, 71, 72,
115080
+ /* 490 */ 73, 74, 75, 76, 77, 78, 79, 80, 81, 82,
115081
+ /* 500 */ 83, 22, 85, 86, 87, 88, 89, 90, 91, 92,
115082
+ /* 510 */ 93, 94, 95, 19, 197, 181, 182, 23, 208, 209,
115083
+ /* 520 */ 152, 197, 26, 189, 132, 133, 232, 224, 225, 226,
115084
+ /* 530 */ 152, 97, 91, 26, 232, 116, 212, 213, 152, 222,
115085
+ /* 540 */ 121, 152, 174, 175, 50, 51, 243, 97, 22, 23,
115086
+ /* 550 */ 22, 234, 174, 175, 177, 23, 239, 116, 163, 177,
115087
+ /* 560 */ 174, 175, 121, 174, 175, 71, 72, 73, 74, 75,
115088
+ /* 570 */ 76, 77, 78, 79, 80, 81, 82, 83, 24, 85,
115089
+ /* 580 */ 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
115090
+ /* 590 */ 19, 23, 197, 11, 23, 227, 70, 208, 220, 152,
115091
+ /* 600 */ 31, 224, 225, 226, 35, 98, 224, 225, 226, 108,
115092
+ /* 610 */ 109, 110, 115, 152, 117, 118, 27, 222, 49, 123,
115093
+ /* 620 */ 24, 50, 51, 27, 0, 1, 2, 224, 225, 226,
115094
+ /* 630 */ 166, 124, 168, 169, 239, 174, 175, 170, 171, 172,
115095
+ /* 640 */ 22, 194, 71, 72, 73, 74, 75, 76, 77, 78,
115096
+ /* 650 */ 79, 80, 81, 82, 83, 152, 85, 86, 87, 88,
115097
+ /* 660 */ 89, 90, 91, 92, 93, 94, 95, 19, 22, 208,
115098
+ /* 670 */ 24, 23, 195, 196, 170, 171, 172, 174, 175, 152,
115099
+ /* 680 */ 26, 152, 152, 152, 207, 152, 97, 152, 23, 152,
115100
+ /* 690 */ 51, 244, 152, 97, 152, 247, 248, 23, 50, 51,
115101
+ /* 700 */ 26, 174, 175, 174, 175, 174, 175, 174, 175, 174,
115102
+ /* 710 */ 175, 174, 175, 23, 174, 175, 174, 175, 188, 71,
115103
+ /* 720 */ 72, 73, 74, 75, 76, 77, 78, 79, 80, 81,
115104
+ /* 730 */ 82, 83, 152, 85, 86, 87, 88, 89, 90, 91,
115105
+ /* 740 */ 92, 93, 94, 95, 19, 152, 107, 152, 33, 24,
115106
+ /* 750 */ 152, 100, 101, 27, 174, 175, 152, 42, 152, 23,
115107
+ /* 760 */ 152, 26, 152, 23, 152, 26, 152, 174, 175, 174,
115108
+ /* 770 */ 175, 152, 174, 175, 23, 50, 51, 26, 174, 175,
115109
+ /* 780 */ 174, 175, 174, 175, 174, 175, 174, 175, 174, 175,
115110
+ /* 790 */ 163, 119, 120, 174, 175, 19, 71, 72, 73, 74,
115111
+ /* 800 */ 75, 76, 77, 78, 79, 80, 81, 82, 83, 152,
115112
+ /* 810 */ 85, 86, 87, 88, 89, 90, 91, 92, 93, 94,
115113
+ /* 820 */ 95, 66, 152, 97, 197, 23, 50, 51, 26, 53,
115114
+ /* 830 */ 23, 174, 175, 26, 23, 23, 23, 26, 26, 26,
115115
+ /* 840 */ 36, 106, 146, 147, 174, 175, 19, 71, 72, 73,
115116
+ /* 850 */ 74, 75, 76, 77, 78, 79, 80, 81, 82, 83,
115117
+ /* 860 */ 152, 85, 86, 87, 88, 89, 90, 91, 92, 93,
115118
+ /* 870 */ 94, 95, 152, 196, 119, 120, 19, 50, 51, 168,
115119
+ /* 880 */ 169, 26, 174, 175, 207, 28, 152, 249, 250, 152,
115120
+ /* 890 */ 163, 163, 163, 163, 174, 175, 163, 19, 71, 72,
115121
+ /* 900 */ 73, 74, 75, 76, 77, 78, 79, 80, 81, 82,
115122
+ /* 910 */ 83, 152, 85, 86, 87, 88, 89, 90, 91, 92,
115123
+ /* 920 */ 93, 94, 95, 152, 197, 197, 197, 197, 50, 51,
115124
+ /* 930 */ 197, 194, 36, 174, 175, 191, 192, 152, 191, 192,
115125
+ /* 940 */ 163, 152, 66, 124, 152, 174, 175, 152, 19, 71,
115126
+ /* 950 */ 72, 73, 74, 75, 76, 77, 78, 79, 80, 81,
115127
+ /* 960 */ 82, 83, 152, 85, 86, 87, 88, 89, 90, 91,
115128
+ /* 970 */ 92, 93, 94, 95, 197, 152, 100, 188, 152, 50,
115129
+ /* 980 */ 51, 152, 152, 188, 174, 175, 252, 152, 94, 95,
115130
+ /* 990 */ 152, 152, 152, 1, 2, 152, 152, 174, 175, 19,
115131
+ /* 1000 */ 152, 72, 73, 74, 75, 76, 77, 78, 79, 80,
115132
+ /* 1010 */ 81, 82, 83, 152, 85, 86, 87, 88, 89, 90,
115133
+ /* 1020 */ 91, 92, 93, 94, 95, 152, 188, 188, 22, 194,
115134
+ /* 1030 */ 50, 51, 240, 173, 194, 174, 175, 252, 194, 152,
115135
+ /* 1040 */ 36, 181, 28, 152, 23, 219, 122, 174, 175, 219,
115136
+ /* 1050 */ 221, 152, 152, 73, 74, 75, 76, 77, 78, 79,
115137
+ /* 1060 */ 80, 81, 82, 83, 152, 85, 86, 87, 88, 89,
115138
+ /* 1070 */ 90, 91, 92, 93, 94, 95, 19, 20, 152, 22,
115139
+ /* 1080 */ 23, 194, 152, 240, 27, 28, 174, 175, 240, 19,
115140
+ /* 1090 */ 20, 26, 22, 194, 194, 38, 22, 27, 28, 152,
115141
+ /* 1100 */ 23, 22, 152, 116, 174, 175, 152, 23, 38, 152,
115142
+ /* 1110 */ 23, 152, 221, 152, 57, 152, 23, 163, 50, 51,
115143
+ /* 1120 */ 194, 174, 175, 66, 174, 175, 69, 57, 174, 175,
115144
+ /* 1130 */ 40, 174, 175, 174, 175, 174, 175, 174, 175, 69,
115145
+ /* 1140 */ 22, 53, 74, 75, 30, 53, 89, 90, 22, 22,
115146
+ /* 1150 */ 152, 197, 23, 96, 97, 98, 22, 152, 101, 89,
115147
+ /* 1160 */ 90, 91, 208, 209, 152, 53, 96, 97, 98, 101,
115148
+ /* 1170 */ 22, 101, 174, 175, 152, 19, 20, 105, 22, 174,
115149
+ /* 1180 */ 175, 112, 19, 27, 28, 20, 174, 175, 24, 132,
115150
+ /* 1190 */ 133, 134, 135, 136, 38, 44, 174, 175, 107, 61,
115151
+ /* 1200 */ 54, 26, 132, 133, 134, 135, 136, 54, 107, 22,
115152
+ /* 1210 */ 5, 140, 1, 57, 36, 111, 122, 28, 79, 79,
115153
+ /* 1220 */ 131, 123, 66, 19, 20, 69, 22, 1, 16, 20,
115154
+ /* 1230 */ 125, 27, 28, 123, 111, 120, 23, 131, 23, 16,
115155
+ /* 1240 */ 68, 142, 38, 15, 22, 89, 90, 3, 167, 4,
115156
+ /* 1250 */ 248, 251, 96, 97, 98, 180, 180, 101, 251, 151,
115157
+ /* 1260 */ 6, 57, 151, 13, 151, 26, 25, 151, 161, 202,
115158
+ /* 1270 */ 153, 162, 153, 69, 130, 128, 203, 19, 20, 127,
115159
+ /* 1280 */ 22, 126, 204, 129, 22, 27, 28, 205, 132, 133,
115160
+ /* 1290 */ 134, 135, 136, 89, 90, 231, 38, 95, 137, 179,
115161
+ /* 1300 */ 96, 97, 98, 206, 179, 101, 122, 107, 159, 159,
115162
+ /* 1310 */ 125, 231, 216, 228, 107, 57, 184, 217, 216, 176,
115163
+ /* 1320 */ 217, 176, 48, 106, 18, 184, 158, 69, 159, 158,
115164
+ /* 1330 */ 46, 71, 237, 176, 176, 176, 132, 133, 134, 135,
115165
+ /* 1340 */ 136, 217, 176, 137, 216, 178, 158, 89, 90, 179,
115166
+ /* 1350 */ 176, 159, 179, 159, 96, 97, 98, 159, 159, 101,
115167
+ /* 1360 */ 5, 158, 202, 22, 18, 10, 11, 12, 13, 14,
115168
+ /* 1370 */ 190, 238, 17, 190, 158, 193, 41, 159, 202, 193,
115169
+ /* 1380 */ 159, 202, 245, 193, 193, 223, 190, 32, 159, 34,
115170
+ /* 1390 */ 132, 133, 134, 135, 136, 159, 39, 155, 43, 150,
115171
+ /* 1400 */ 223, 177, 201, 178, 177, 186, 66, 199, 177, 152,
115172
+ /* 1410 */ 253, 56, 215, 152, 182, 152, 202, 152, 63, 152,
115173
+ /* 1420 */ 152, 66, 67, 242, 229, 152, 174, 152, 152, 152,
115174
+ /* 1430 */ 152, 152, 152, 152, 199, 242, 202, 152, 198, 152,
115175
+ /* 1440 */ 152, 152, 183, 192, 152, 215, 152, 183, 215, 183,
115176
+ /* 1450 */ 152, 241, 214, 152, 211, 152, 152, 211, 211, 152,
115177
+ /* 1460 */ 152, 241, 152, 152, 152, 152, 152, 152, 152, 114,
115178
+ /* 1470 */ 152, 152, 235, 152, 152, 152, 174, 187, 95, 174,
115179
+ /* 1480 */ 253, 253, 253, 253, 236, 253, 253, 253, 253, 253,
115180
+ /* 1490 */ 253, 253, 253, 253, 253, 253, 141,
115181
+};
115182
+#define YY_SHIFT_USE_DFLT (-86)
115183
+#define YY_SHIFT_COUNT (429)
115184
+#define YY_SHIFT_MIN (-85)
115185
+#define YY_SHIFT_MAX (1383)
114693115186
static const short yy_shift_ofst[] = {
114694
- /* 0 */ 988, 1204, 1435, 1204, 1304, 1304, 67, 67, 1, -19,
114695
- /* 10 */ 1304, 1304, 1304, 1304, 427, 81, 131, 131, 806, 1181,
114696
- /* 20 */ 1304, 1304, 1304, 1304, 1304, 1304, 1304, 1304, 1304, 1304,
114697
- /* 30 */ 1304, 1304, 1304, 1304, 1304, 1304, 1304, 1304, 1304, 1304,
114698
- /* 40 */ 1304, 1304, 1304, 1304, 1304, 1304, 1304, 1304, 1327, 1304,
114699
- /* 50 */ 1304, 1304, 1304, 1304, 1304, 1304, 1304, 1304, 1304, 1304,
114700
- /* 60 */ 1304, 1304, 52, 81, 81, 476, 476, 395, 1258, 56,
114701
- /* 70 */ 731, 656, 581, 506, 431, 356, 281, 206, 881, 881,
114702
- /* 80 */ 881, 881, 881, 881, 881, 881, 881, 881, 881, 881,
114703
- /* 90 */ 881, 881, 881, 956, 881, 1031, 1106, 1106, -69, -45,
114704
- /* 100 */ -45, -45, -45, -45, 0, 29, -12, 81, 81, 81,
114705
- /* 110 */ 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
114706
- /* 120 */ 81, 81, 81, 355, 440, 81, 81, 81, 81, 81,
114707
- /* 130 */ 504, 411, 395, 818, 1467, -82, -82, -82, 1449, 86,
114708
- /* 140 */ 439, 439, 306, 357, 302, 72, 318, 246, 169, 81,
114709
- /* 150 */ 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
114710
- /* 160 */ 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
114711
- /* 170 */ 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
114712
- /* 180 */ 81, 81, 315, 315, 315, 572, 1258, 1258, 1258, -82,
114713
- /* 190 */ -82, -82, 132, 132, 208, 568, 568, 568, 516, 503,
114714
- /* 200 */ 214, 452, 363, 228, 119, 119, 119, 119, 359, 126,
114715
- /* 210 */ 119, 119, 584, 293, 604, 106, 11, 288, 288, 513,
114716
- /* 220 */ 11, 513, 295, 813, 395, 831, 395, 831, 595, 831,
114717
- /* 230 */ 288, 649, 498, 498, 395, 154, 273, 699, 1476, 1292,
114718
- /* 240 */ 1292, 1470, 1470, 1292, 1473, 1421, 1255, 1480, 1480, 1480,
114719
- /* 250 */ 1480, 1292, 1454, 1255, 1473, 1421, 1421, 1255, 1292, 1454,
114720
- /* 260 */ 1348, 1436, 1292, 1292, 1454, 1292, 1454, 1292, 1454, 1431,
114721
- /* 270 */ 1320, 1320, 1320, 1385, 1362, 1362, 1431, 1320, 1340, 1320,
114722
- /* 280 */ 1385, 1320, 1320, 1294, 1308, 1294, 1308, 1294, 1308, 1292,
114723
- /* 290 */ 1292, 1272, 1279, 1281, 1253, 1259, 1255, 1258, 1337, 1333,
114724
- /* 300 */ 1295, 1295, 1254, 1254, 1254, 1254, -82, -82, -82, -82,
114725
- /* 310 */ -82, -82, 339, 399, 618, 326, 620, -81, 669, 477,
114726
- /* 320 */ 661, 585, 377, 280, 244, 232, 25, -1, 373, 227,
114727
- /* 330 */ 215, 1233, 1242, 1195, 1075, 1220, 1149, 1223, 1191, 1188,
114728
- /* 340 */ 1081, 1113, 1079, 1061, 1049, 1148, 1045, 1150, 1164, 1043,
114729
- /* 350 */ 1139, 1137, 1113, 1114, 1006, 1058, 1018, 1023, 1066, 1057,
114730
- /* 360 */ 968, 1091, 1086, 1063, 981, 944, 1011, 1035, 1010, 1000,
114731
- /* 370 */ 1014, 916, 1033, 1004, 1001, 909, 913, 996, 957, 991,
114732
- /* 380 */ 990, 986, 964, 938, 954, 917, 889, 897, 912, 910,
114733
- /* 390 */ 797, 886, 761, 838, 528, 726, 735, 765, 665, 726,
114734
- /* 400 */ 592, 586, 540, 523, 491, 487, 435, 401, 397, 387,
114735
- /* 410 */ 249, 216, 185, 127, 110, 51, 82, 143, 15, 48,
115187
+ /* 0 */ 992, 1057, 1355, 1156, 1204, 1204, 1, 262, -19, 135,
115188
+ /* 10 */ 135, 776, 1204, 1204, 1204, 1204, 69, 69, 53, 208,
115189
+ /* 20 */ 283, 755, 58, 725, 648, 571, 494, 417, 340, 263,
115190
+ /* 30 */ 212, 827, 827, 827, 827, 827, 827, 827, 827, 827,
115191
+ /* 40 */ 827, 827, 827, 827, 827, 827, 878, 827, 929, 980,
115192
+ /* 50 */ 980, 1070, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204,
115193
+ /* 60 */ 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204,
115194
+ /* 70 */ 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204,
115195
+ /* 80 */ 1258, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204,
115196
+ /* 90 */ 1204, 1204, 1204, 1204, -71, -47, -47, -47, -47, -47,
115197
+ /* 100 */ 0, 29, -12, 283, 283, 139, 91, 392, 392, 894,
115198
+ /* 110 */ 672, 726, 1383, -86, -86, -86, 88, 318, 318, 99,
115199
+ /* 120 */ 381, -20, 283, 283, 283, 283, 283, 283, 283, 283,
115200
+ /* 130 */ 283, 283, 283, 283, 283, 283, 283, 283, 283, 283,
115201
+ /* 140 */ 283, 283, 283, 283, 624, 876, 726, 672, 1340, 1340,
115202
+ /* 150 */ 1340, 1340, 1340, 1340, -86, -86, -86, 305, 136, 136,
115203
+ /* 160 */ 142, 167, 226, 154, 137, 152, 283, 283, 283, 283,
115204
+ /* 170 */ 283, 283, 283, 283, 283, 283, 283, 283, 283, 283,
115205
+ /* 180 */ 283, 283, 283, 336, 336, 336, 283, 283, 352, 283,
115206
+ /* 190 */ 283, 283, 283, 283, 228, 283, 283, 283, 283, 283,
115207
+ /* 200 */ 283, 283, 283, 283, 283, 501, 569, 596, 596, 596,
115208
+ /* 210 */ 507, 497, 441, 391, 353, 156, 156, 857, 353, 857,
115209
+ /* 220 */ 735, 813, 639, 715, 156, 332, 715, 715, 496, 419,
115210
+ /* 230 */ 646, 1357, 1184, 1184, 1335, 1335, 1184, 1341, 1260, 1144,
115211
+ /* 240 */ 1346, 1346, 1346, 1346, 1184, 1306, 1144, 1341, 1260, 1260,
115212
+ /* 250 */ 1144, 1184, 1306, 1206, 1284, 1184, 1184, 1306, 1184, 1306,
115213
+ /* 260 */ 1184, 1306, 1262, 1207, 1207, 1207, 1274, 1262, 1207, 1217,
115214
+ /* 270 */ 1207, 1274, 1207, 1207, 1185, 1200, 1185, 1200, 1185, 1200,
115215
+ /* 280 */ 1184, 1184, 1161, 1262, 1202, 1202, 1262, 1154, 1155, 1147,
115216
+ /* 290 */ 1152, 1144, 1241, 1239, 1250, 1250, 1254, 1254, 1254, 1254,
115217
+ /* 300 */ -86, -86, -86, -86, -86, -86, 1068, 304, 526, 249,
115218
+ /* 310 */ 408, -83, 434, 812, 27, 811, 807, 802, 751, 589,
115219
+ /* 320 */ 651, 163, 131, 674, 366, 450, 299, 148, 23, 102,
115220
+ /* 330 */ 229, -21, 1245, 1244, 1222, 1099, 1228, 1172, 1223, 1215,
115221
+ /* 340 */ 1213, 1115, 1106, 1123, 1110, 1209, 1105, 1212, 1226, 1098,
115222
+ /* 350 */ 1089, 1140, 1139, 1104, 1189, 1178, 1094, 1211, 1205, 1187,
115223
+ /* 360 */ 1101, 1071, 1153, 1175, 1146, 1138, 1151, 1091, 1164, 1165,
115224
+ /* 370 */ 1163, 1069, 1072, 1148, 1112, 1134, 1127, 1129, 1126, 1092,
115225
+ /* 380 */ 1114, 1118, 1088, 1090, 1093, 1087, 1084, 987, 1079, 1077,
115226
+ /* 390 */ 1074, 1065, 924, 1021, 1014, 1004, 1006, 819, 739, 896,
115227
+ /* 400 */ 855, 804, 739, 740, 736, 690, 654, 665, 618, 582,
115228
+ /* 410 */ 568, 528, 554, 379, 532, 479, 455, 379, 432, 371,
115229
+ /* 420 */ 341, 28, 338, 116, -11, -57, -85, 7, -8, 3,
114736115230
};
114737
-#define YY_REDUCE_USE_DFLT (-143)
114738
-#define YY_REDUCE_COUNT (311)
114739
-#define YY_REDUCE_MIN (-142)
114740
-#define YY_REDUCE_MAX (1387)
115231
+#define YY_REDUCE_USE_DFLT (-110)
115232
+#define YY_REDUCE_COUNT (305)
115233
+#define YY_REDUCE_MIN (-109)
115234
+#define YY_REDUCE_MAX (1323)
114741115235
static const short yy_reduce_ofst[] = {
114742
- /* 0 */ -142, 1111, 92, 151, 241, 161, 150, 93, 85, 324,
114743
- /* 10 */ 386, 313, 320, 229, -6, 310, 536, 485, -72, 1121,
114744
- /* 20 */ 1089, 1082, 1076, 1054, 1037, 997, 979, 977, 975, 962,
114745
- /* 30 */ 923, 921, 904, 902, 900, 887, 847, 829, 827, 825,
114746
- /* 40 */ 812, 771, 769, 754, 752, 750, 737, 679, 677, 675,
114747
- /* 50 */ 662, 623, 619, 617, 613, 602, 600, 587, 537, 527,
114748
- /* 60 */ 472, 376, 480, 450, 226, 453, 398, 390, 426, 420,
114749
- /* 70 */ 420, 420, 420, 420, 420, 420, 420, 420, 420, 420,
114750
- /* 80 */ 420, 420, 420, 420, 420, 420, 420, 420, 420, 420,
114751
- /* 90 */ 420, 420, 420, 420, 420, 420, 420, 420, 420, 420,
114752
- /* 100 */ 420, 420, 420, 420, 420, 420, 420, 1153, 922, 1123,
114753
- /* 110 */ 1115, 1055, 1007, 980, 976, 901, 844, 830, 767, 826,
114754
- /* 120 */ 682, 694, 707, 482, 583, 681, 680, 676, 531, 27,
114755
- /* 130 */ 787, 562, 521, 420, 420, 420, 420, 420, 773, 741,
114756
- /* 140 */ 674, 670, 1067, 1251, 1245, 1239, 1234, 591, 591, 1230,
114757
- /* 150 */ 1228, 1226, 1221, 1219, 1213, 1207, 1206, 1202, 1201, 1200,
114758
- /* 160 */ 1199, 1193, 1189, 1178, 1176, 1174, 1155, 1142, 1138, 1134,
114759
- /* 170 */ 1116, 1112, 1077, 1074, 1069, 1067, 1009, 994, 982, 933,
114760
- /* 180 */ 848, 757, 849, 775, 628, 611, 745, 710, 672, 469,
114761
- /* 190 */ 488, 573, 1387, 1384, 1367, 1374, 1373, 1372, 1344, 1354,
114762
- /* 200 */ 1360, 1354, 1354, 1354, 1354, 1354, 1354, 1354, 1330, 1326,
114763
- /* 210 */ 1354, 1354, 1344, 1371, 1336, 1386, 1349, 1338, 1334, 1305,
114764
- /* 220 */ 1331, 1299, 1359, 1346, 1361, 1353, 1358, 1352, 1341, 1345,
114765
- /* 230 */ 1316, 1293, 1296, 1286, 1351, 1325, 1324, 1363, 1275, 1356,
114766
- /* 240 */ 1355, 1270, 1267, 1350, 1282, 1319, 1306, 1312, 1311, 1310,
114767
- /* 250 */ 1309, 1343, 1339, 1298, 1274, 1301, 1297, 1288, 1329, 1328,
114768
- /* 260 */ 1248, 1246, 1323, 1322, 1318, 1321, 1317, 1315, 1313, 1276,
114769
- /* 270 */ 1291, 1289, 1287, 1278, 1235, 1224, 1271, 1273, 1264, 1265,
114770
- /* 280 */ 1247, 1252, 1240, 1218, 1229, 1217, 1216, 1214, 1212, 1262,
114771
- /* 290 */ 1261, 1182, 1205, 1203, 1186, 1185, 1175, 1167, 1169, 1159,
114772
- /* 300 */ 1165, 1132, 1152, 1145, 1144, 1105, 1030, 1008, 999, 1073,
114773
- /* 310 */ 1072, 1080,
115236
+ /* 0 */ 238, 954, 213, 289, 310, 234, 144, 317, -109, 382,
115237
+ /* 10 */ 377, 303, 461, 389, 378, 368, 302, 294, 253, 395,
115238
+ /* 20 */ 293, 324, 403, 403, 403, 403, 403, 403, 403, 403,
115239
+ /* 30 */ 403, 403, 403, 403, 403, 403, 403, 403, 403, 403,
115240
+ /* 40 */ 403, 403, 403, 403, 403, 403, 403, 403, 403, 403,
115241
+ /* 50 */ 403, 1022, 1012, 1005, 998, 963, 961, 959, 957, 950,
115242
+ /* 60 */ 947, 930, 912, 873, 861, 823, 810, 771, 759, 720,
115243
+ /* 70 */ 708, 670, 657, 619, 614, 612, 610, 608, 606, 604,
115244
+ /* 80 */ 598, 595, 593, 580, 542, 540, 537, 535, 533, 531,
115245
+ /* 90 */ 529, 527, 503, 386, 403, 403, 403, 403, 403, 403,
115246
+ /* 100 */ 403, 403, 403, 95, 447, 82, 334, 504, 467, 403,
115247
+ /* 110 */ 477, 464, 403, 403, 403, 403, 860, 747, 744, 785,
115248
+ /* 120 */ 638, 638, 926, 891, 900, 899, 887, 844, 840, 835,
115249
+ /* 130 */ 848, 830, 843, 829, 792, 839, 826, 737, 838, 795,
115250
+ /* 140 */ 789, 47, 734, 530, 696, 777, 711, 677, 733, 730,
115251
+ /* 150 */ 729, 728, 727, 627, 448, 64, 187, 1305, 1302, 1252,
115252
+ /* 160 */ 1290, 1273, 1323, 1322, 1321, 1319, 1318, 1316, 1315, 1314,
115253
+ /* 170 */ 1313, 1312, 1311, 1310, 1308, 1307, 1304, 1303, 1301, 1298,
115254
+ /* 180 */ 1294, 1292, 1289, 1266, 1264, 1259, 1288, 1287, 1238, 1285,
115255
+ /* 190 */ 1281, 1280, 1279, 1278, 1251, 1277, 1276, 1275, 1273, 1268,
115256
+ /* 200 */ 1267, 1265, 1263, 1261, 1257, 1248, 1237, 1247, 1246, 1243,
115257
+ /* 210 */ 1238, 1240, 1235, 1249, 1234, 1233, 1230, 1220, 1214, 1210,
115258
+ /* 220 */ 1225, 1219, 1232, 1231, 1197, 1195, 1227, 1224, 1201, 1208,
115259
+ /* 230 */ 1242, 1137, 1236, 1229, 1193, 1181, 1221, 1177, 1196, 1179,
115260
+ /* 240 */ 1191, 1190, 1186, 1182, 1218, 1216, 1176, 1162, 1183, 1180,
115261
+ /* 250 */ 1160, 1199, 1203, 1133, 1095, 1198, 1194, 1188, 1192, 1171,
115262
+ /* 260 */ 1169, 1168, 1173, 1174, 1166, 1159, 1141, 1170, 1158, 1167,
115263
+ /* 270 */ 1157, 1132, 1145, 1143, 1124, 1128, 1103, 1102, 1100, 1096,
115264
+ /* 280 */ 1150, 1149, 1085, 1125, 1080, 1064, 1120, 1097, 1082, 1078,
115265
+ /* 290 */ 1073, 1067, 1109, 1107, 1119, 1117, 1116, 1113, 1111, 1108,
115266
+ /* 300 */ 1007, 1000, 1002, 1076, 1075, 1081,
114774115267
};
114775115268
static const YYACTIONTYPE yy_default[] = {
114776
- /* 0 */ 636, 872, 960, 960, 872, 872, 960, 960, 960, 762,
114777
- /* 10 */ 960, 960, 960, 870, 960, 960, 790, 790, 934, 960,
114778
- /* 20 */ 960, 960, 960, 960, 960, 960, 960, 960, 960, 960,
114779
- /* 30 */ 960, 960, 960, 960, 960, 960, 960, 960, 960, 960,
114780
- /* 40 */ 960, 960, 960, 960, 960, 960, 960, 960, 960, 960,
114781
- /* 50 */ 960, 960, 960, 960, 960, 960, 960, 960, 960, 960,
114782
- /* 60 */ 960, 960, 960, 960, 960, 960, 960, 677, 766, 796,
114783
- /* 70 */ 960, 960, 960, 960, 960, 960, 960, 960, 933, 935,
114784
- /* 80 */ 804, 803, 913, 777, 801, 794, 798, 873, 866, 867,
114785
- /* 90 */ 865, 869, 874, 960, 797, 833, 850, 832, 844, 849,
114786
- /* 100 */ 856, 848, 845, 835, 834, 836, 837, 960, 960, 960,
114787
- /* 110 */ 960, 960, 960, 960, 960, 960, 960, 960, 960, 960,
114788
- /* 120 */ 960, 960, 960, 662, 731, 960, 960, 960, 960, 960,
114789
- /* 130 */ 960, 960, 960, 838, 839, 853, 852, 851, 960, 669,
114790
- /* 140 */ 960, 960, 960, 960, 960, 960, 960, 960, 960, 960,
114791
- /* 150 */ 940, 938, 960, 885, 960, 960, 960, 960, 960, 960,
114792
- /* 160 */ 960, 960, 960, 960, 960, 960, 960, 960, 960, 960,
114793
- /* 170 */ 960, 960, 960, 960, 960, 960, 960, 960, 960, 960,
114794
- /* 180 */ 960, 642, 762, 762, 762, 636, 960, 960, 960, 952,
114795
- /* 190 */ 766, 756, 960, 960, 960, 960, 960, 960, 960, 960,
114796
- /* 200 */ 960, 960, 960, 960, 806, 745, 923, 925, 960, 906,
114797
- /* 210 */ 743, 664, 764, 679, 754, 644, 800, 779, 779, 918,
114798
- /* 220 */ 800, 918, 702, 725, 960, 790, 960, 790, 699, 790,
114799
- /* 230 */ 779, 868, 960, 960, 960, 763, 754, 960, 945, 770,
114800
- /* 240 */ 770, 937, 937, 770, 812, 735, 800, 742, 742, 742,
114801
- /* 250 */ 742, 770, 659, 800, 812, 735, 735, 800, 770, 659,
114802
- /* 260 */ 912, 910, 770, 770, 659, 770, 659, 770, 659, 878,
114803
- /* 270 */ 733, 733, 733, 717, 882, 882, 878, 733, 702, 733,
114804
- /* 280 */ 717, 733, 733, 783, 778, 783, 778, 783, 778, 770,
114805
- /* 290 */ 770, 960, 795, 784, 793, 791, 800, 960, 665, 720,
114806
- /* 300 */ 652, 652, 641, 641, 641, 641, 957, 957, 952, 704,
114807
- /* 310 */ 704, 687, 960, 960, 960, 960, 960, 960, 960, 887,
114808
- /* 320 */ 960, 960, 960, 960, 960, 960, 960, 960, 960, 960,
114809
- /* 330 */ 960, 960, 637, 947, 960, 960, 944, 960, 960, 960,
114810
- /* 340 */ 960, 805, 960, 960, 960, 960, 960, 960, 960, 960,
114811
- /* 350 */ 960, 960, 922, 960, 960, 960, 960, 960, 960, 960,
114812
- /* 360 */ 916, 960, 960, 960, 960, 960, 960, 909, 908, 960,
114813
- /* 370 */ 960, 960, 960, 960, 960, 960, 960, 960, 960, 960,
114814
- /* 380 */ 960, 960, 960, 960, 960, 960, 960, 960, 960, 960,
114815
- /* 390 */ 960, 960, 960, 960, 960, 792, 960, 785, 960, 871,
114816
- /* 400 */ 960, 960, 960, 960, 960, 960, 960, 960, 960, 960,
114817
- /* 410 */ 748, 821, 960, 820, 824, 819, 671, 960, 650, 960,
114818
- /* 420 */ 633, 638, 956, 959, 958, 955, 954, 953, 948, 946,
114819
- /* 430 */ 943, 942, 941, 939, 936, 932, 891, 889, 896, 895,
114820
- /* 440 */ 894, 893, 892, 890, 888, 886, 807, 802, 799, 931,
114821
- /* 450 */ 884, 744, 741, 740, 658, 949, 915, 924, 811, 810,
114822
- /* 460 */ 813, 921, 920, 919, 917, 914, 901, 809, 808, 736,
114823
- /* 470 */ 876, 875, 661, 905, 904, 903, 907, 911, 902, 772,
114824
- /* 480 */ 660, 657, 668, 723, 724, 732, 730, 729, 728, 727,
114825
- /* 490 */ 726, 722, 670, 678, 716, 701, 700, 881, 883, 880,
114826
- /* 500 */ 879, 709, 708, 714, 713, 712, 711, 710, 707, 706,
114827
- /* 510 */ 705, 698, 697, 703, 696, 719, 718, 715, 695, 739,
114828
- /* 520 */ 738, 737, 734, 694, 693, 692, 824, 691, 690, 830,
114829
- /* 530 */ 829, 817, 860, 759, 758, 757, 769, 768, 781, 780,
114830
- /* 540 */ 815, 814, 782, 767, 761, 760, 776, 775, 774, 773,
114831
- /* 550 */ 765, 755, 787, 789, 788, 786, 862, 771, 859, 930,
114832
- /* 560 */ 929, 928, 927, 926, 864, 863, 831, 828, 682, 683,
114833
- /* 570 */ 899, 898, 900, 897, 685, 684, 681, 680, 861, 750,
114834
- /* 580 */ 749, 857, 854, 846, 842, 858, 855, 847, 843, 841,
114835
- /* 590 */ 840, 826, 825, 823, 822, 818, 827, 673, 751, 747,
114836
- /* 600 */ 746, 816, 753, 752, 689, 688, 686, 667, 666, 663,
114837
- /* 610 */ 656, 654, 653, 655, 651, 649, 648, 647, 646, 645,
114838
- /* 620 */ 676, 675, 674, 672, 671, 643, 640, 639, 635, 634,
114839
- /* 630 */ 632,
115269
+ /* 0 */ 647, 964, 964, 964, 878, 878, 969, 964, 774, 802,
115270
+ /* 10 */ 802, 938, 969, 969, 969, 876, 969, 969, 969, 964,
115271
+ /* 20 */ 969, 778, 808, 969, 969, 969, 969, 969, 969, 969,
115272
+ /* 30 */ 969, 937, 939, 816, 815, 918, 789, 813, 806, 810,
115273
+ /* 40 */ 879, 872, 873, 871, 875, 880, 969, 809, 841, 856,
115274
+ /* 50 */ 840, 969, 969, 969, 969, 969, 969, 969, 969, 969,
115275
+ /* 60 */ 969, 969, 969, 969, 969, 969, 969, 969, 969, 969,
115276
+ /* 70 */ 969, 969, 969, 969, 969, 969, 969, 969, 969, 969,
115277
+ /* 80 */ 969, 969, 969, 969, 969, 969, 969, 969, 969, 969,
115278
+ /* 90 */ 969, 969, 969, 969, 850, 855, 862, 854, 851, 843,
115279
+ /* 100 */ 842, 844, 845, 969, 969, 673, 739, 969, 969, 846,
115280
+ /* 110 */ 969, 685, 847, 859, 858, 857, 680, 969, 969, 969,
115281
+ /* 120 */ 969, 969, 969, 969, 969, 969, 969, 969, 969, 969,
115282
+ /* 130 */ 969, 969, 969, 969, 969, 969, 969, 969, 969, 969,
115283
+ /* 140 */ 969, 969, 969, 969, 647, 964, 969, 969, 964, 964,
115284
+ /* 150 */ 964, 964, 964, 964, 956, 778, 768, 969, 969, 969,
115285
+ /* 160 */ 969, 969, 969, 969, 969, 969, 969, 944, 942, 969,
115286
+ /* 170 */ 891, 969, 969, 969, 969, 969, 969, 969, 969, 969,
115287
+ /* 180 */ 969, 969, 969, 969, 969, 969, 969, 969, 969, 969,
115288
+ /* 190 */ 969, 969, 969, 969, 969, 969, 969, 969, 969, 969,
115289
+ /* 200 */ 969, 969, 969, 969, 653, 969, 911, 774, 774, 774,
115290
+ /* 210 */ 776, 754, 766, 655, 812, 791, 791, 923, 812, 923,
115291
+ /* 220 */ 710, 733, 707, 802, 791, 874, 802, 802, 775, 766,
115292
+ /* 230 */ 969, 949, 782, 782, 941, 941, 782, 821, 743, 812,
115293
+ /* 240 */ 750, 750, 750, 750, 782, 670, 812, 821, 743, 743,
115294
+ /* 250 */ 812, 782, 670, 917, 915, 782, 782, 670, 782, 670,
115295
+ /* 260 */ 782, 670, 884, 741, 741, 741, 725, 884, 741, 710,
115296
+ /* 270 */ 741, 725, 741, 741, 795, 790, 795, 790, 795, 790,
115297
+ /* 280 */ 782, 782, 969, 884, 888, 888, 884, 807, 796, 805,
115298
+ /* 290 */ 803, 812, 676, 728, 663, 663, 652, 652, 652, 652,
115299
+ /* 300 */ 961, 961, 956, 712, 712, 695, 969, 969, 969, 969,
115300
+ /* 310 */ 969, 969, 687, 969, 893, 969, 969, 969, 969, 969,
115301
+ /* 320 */ 969, 969, 969, 969, 969, 969, 969, 969, 969, 969,
115302
+ /* 330 */ 969, 828, 969, 648, 951, 969, 969, 948, 969, 969,
115303
+ /* 340 */ 969, 969, 969, 969, 969, 969, 969, 969, 969, 969,
115304
+ /* 350 */ 969, 969, 969, 969, 969, 969, 921, 969, 969, 969,
115305
+ /* 360 */ 969, 969, 969, 914, 913, 969, 969, 969, 969, 969,
115306
+ /* 370 */ 969, 969, 969, 969, 969, 969, 969, 969, 969, 969,
115307
+ /* 380 */ 969, 969, 969, 969, 969, 969, 969, 757, 969, 969,
115308
+ /* 390 */ 969, 761, 969, 969, 969, 969, 969, 969, 804, 969,
115309
+ /* 400 */ 797, 969, 877, 969, 969, 969, 969, 969, 969, 969,
115310
+ /* 410 */ 969, 969, 969, 966, 969, 969, 969, 965, 969, 969,
115311
+ /* 420 */ 969, 969, 969, 830, 969, 829, 833, 969, 661, 969,
115312
+ /* 430 */ 644, 649, 960, 963, 962, 959, 958, 957, 952, 950,
115313
+ /* 440 */ 947, 946, 945, 943, 940, 936, 897, 895, 902, 901,
115314
+ /* 450 */ 900, 899, 898, 896, 894, 892, 818, 817, 814, 811,
115315
+ /* 460 */ 753, 935, 890, 752, 749, 748, 669, 953, 920, 929,
115316
+ /* 470 */ 928, 927, 822, 926, 925, 924, 922, 919, 906, 820,
115317
+ /* 480 */ 819, 744, 882, 881, 672, 910, 909, 908, 912, 916,
115318
+ /* 490 */ 907, 784, 751, 671, 668, 675, 679, 731, 732, 740,
115319
+ /* 500 */ 738, 737, 736, 735, 734, 730, 681, 686, 724, 709,
115320
+ /* 510 */ 708, 717, 716, 722, 721, 720, 719, 718, 715, 714,
115321
+ /* 520 */ 713, 706, 705, 711, 704, 727, 726, 723, 703, 747,
115322
+ /* 530 */ 746, 745, 742, 702, 701, 700, 833, 699, 698, 838,
115323
+ /* 540 */ 837, 866, 826, 755, 759, 758, 762, 763, 771, 770,
115324
+ /* 550 */ 769, 780, 781, 793, 792, 824, 823, 794, 779, 773,
115325
+ /* 560 */ 772, 788, 787, 786, 785, 777, 767, 799, 798, 868,
115326
+ /* 570 */ 783, 867, 865, 934, 933, 932, 931, 930, 870, 967,
115327
+ /* 580 */ 968, 887, 889, 886, 801, 800, 885, 869, 839, 836,
115328
+ /* 590 */ 690, 691, 905, 904, 903, 693, 692, 689, 688, 863,
115329
+ /* 600 */ 860, 852, 864, 861, 853, 849, 848, 834, 832, 831,
115330
+ /* 610 */ 827, 835, 760, 756, 825, 765, 764, 697, 696, 694,
115331
+ /* 620 */ 678, 677, 674, 667, 665, 664, 666, 662, 660, 659,
115332
+ /* 630 */ 658, 657, 656, 684, 683, 682, 654, 651, 650, 646,
115333
+ /* 640 */ 645, 643,
114840115334
};
114841115335
114842115336
/* The next table maps tokens into fallback tokens. If a construct
114843115337
** like the following:
114844115338
**
@@ -114907,17 +115401,19 @@
114907115401
27, /* KEY => ID */
114908115402
27, /* OF => ID */
114909115403
27, /* OFFSET => ID */
114910115404
27, /* PRAGMA => ID */
114911115405
27, /* RAISE => ID */
115406
+ 27, /* RECURSIVE => ID */
114912115407
27, /* REPLACE => ID */
114913115408
27, /* RESTRICT => ID */
114914115409
27, /* ROW => ID */
114915115410
27, /* TRIGGER => ID */
114916115411
27, /* VACUUM => ID */
114917115412
27, /* VIEW => ID */
114918115413
27, /* VIRTUAL => ID */
115414
+ 27, /* WITH => ID */
114919115415
27, /* REINDEX => ID */
114920115416
27, /* RENAME => ID */
114921115417
27, /* CTIME_KW => ID */
114922115418
};
114923115419
#endif /* YYFALLBACK */
@@ -115009,59 +115505,60 @@
115009115505
"BY", "CASCADE", "CAST", "COLUMNKW",
115010115506
"CONFLICT", "DATABASE", "DESC", "DETACH",
115011115507
"EACH", "FAIL", "FOR", "IGNORE",
115012115508
"INITIALLY", "INSTEAD", "LIKE_KW", "MATCH",
115013115509
"NO", "KEY", "OF", "OFFSET",
115014
- "PRAGMA", "RAISE", "REPLACE", "RESTRICT",
115015
- "ROW", "TRIGGER", "VACUUM", "VIEW",
115016
- "VIRTUAL", "REINDEX", "RENAME", "CTIME_KW",
115017
- "ANY", "OR", "AND", "IS",
115018
- "BETWEEN", "IN", "ISNULL", "NOTNULL",
115019
- "NE", "EQ", "GT", "LE",
115020
- "LT", "GE", "ESCAPE", "BITAND",
115021
- "BITOR", "LSHIFT", "RSHIFT", "PLUS",
115022
- "MINUS", "STAR", "SLASH", "REM",
115023
- "CONCAT", "COLLATE", "BITNOT", "STRING",
115024
- "JOIN_KW", "CONSTRAINT", "DEFAULT", "NULL",
115025
- "PRIMARY", "UNIQUE", "CHECK", "REFERENCES",
115026
- "AUTOINCR", "ON", "INSERT", "DELETE",
115027
- "UPDATE", "SET", "DEFERRABLE", "FOREIGN",
115028
- "DROP", "UNION", "ALL", "EXCEPT",
115029
- "INTERSECT", "SELECT", "DISTINCT", "DOT",
115030
- "FROM", "JOIN", "USING", "ORDER",
115031
- "GROUP", "HAVING", "LIMIT", "WHERE",
115032
- "INTO", "VALUES", "INTEGER", "FLOAT",
115033
- "BLOB", "REGISTER", "VARIABLE", "CASE",
115034
- "WHEN", "THEN", "ELSE", "INDEX",
115035
- "ALTER", "ADD", "error", "input",
115036
- "cmdlist", "ecmd", "explain", "cmdx",
115037
- "cmd", "transtype", "trans_opt", "nm",
115038
- "savepoint_opt", "create_table", "create_table_args", "createkw",
115039
- "temp", "ifnotexists", "dbnm", "columnlist",
115040
- "conslist_opt", "table_options", "select", "column",
115041
- "columnid", "type", "carglist", "id",
115042
- "ids", "typetoken", "typename", "signed",
115043
- "plus_num", "minus_num", "ccons", "term",
115044
- "expr", "onconf", "sortorder", "autoinc",
115045
- "idxlist_opt", "refargs", "defer_subclause", "refarg",
115046
- "refact", "init_deferred_pred_opt", "conslist", "tconscomma",
115047
- "tcons", "idxlist", "defer_subclause_opt", "orconf",
115048
- "resolvetype", "raisetype", "ifexists", "fullname",
115049
- "oneselect", "multiselect_op", "distinct", "selcollist",
115050
- "from", "where_opt", "groupby_opt", "having_opt",
115051
- "orderby_opt", "limit_opt", "sclp", "as",
115510
+ "PRAGMA", "RAISE", "RECURSIVE", "REPLACE",
115511
+ "RESTRICT", "ROW", "TRIGGER", "VACUUM",
115512
+ "VIEW", "VIRTUAL", "WITH", "REINDEX",
115513
+ "RENAME", "CTIME_KW", "ANY", "OR",
115514
+ "AND", "IS", "BETWEEN", "IN",
115515
+ "ISNULL", "NOTNULL", "NE", "EQ",
115516
+ "GT", "LE", "LT", "GE",
115517
+ "ESCAPE", "BITAND", "BITOR", "LSHIFT",
115518
+ "RSHIFT", "PLUS", "MINUS", "STAR",
115519
+ "SLASH", "REM", "CONCAT", "COLLATE",
115520
+ "BITNOT", "STRING", "JOIN_KW", "CONSTRAINT",
115521
+ "DEFAULT", "NULL", "PRIMARY", "UNIQUE",
115522
+ "CHECK", "REFERENCES", "AUTOINCR", "ON",
115523
+ "INSERT", "DELETE", "UPDATE", "SET",
115524
+ "DEFERRABLE", "FOREIGN", "DROP", "UNION",
115525
+ "ALL", "EXCEPT", "INTERSECT", "SELECT",
115526
+ "VALUES", "DISTINCT", "DOT", "FROM",
115527
+ "JOIN", "USING", "ORDER", "GROUP",
115528
+ "HAVING", "LIMIT", "WHERE", "INTO",
115529
+ "INTEGER", "FLOAT", "BLOB", "VARIABLE",
115530
+ "CASE", "WHEN", "THEN", "ELSE",
115531
+ "INDEX", "ALTER", "ADD", "error",
115532
+ "input", "cmdlist", "ecmd", "explain",
115533
+ "cmdx", "cmd", "transtype", "trans_opt",
115534
+ "nm", "savepoint_opt", "create_table", "create_table_args",
115535
+ "createkw", "temp", "ifnotexists", "dbnm",
115536
+ "columnlist", "conslist_opt", "table_options", "select",
115537
+ "column", "columnid", "type", "carglist",
115538
+ "typetoken", "typename", "signed", "plus_num",
115539
+ "minus_num", "ccons", "term", "expr",
115540
+ "onconf", "sortorder", "autoinc", "idxlist_opt",
115541
+ "refargs", "defer_subclause", "refarg", "refact",
115542
+ "init_deferred_pred_opt", "conslist", "tconscomma", "tcons",
115543
+ "idxlist", "defer_subclause_opt", "orconf", "resolvetype",
115544
+ "raisetype", "ifexists", "fullname", "selectnowith",
115545
+ "oneselect", "with", "multiselect_op", "distinct",
115546
+ "selcollist", "from", "where_opt", "groupby_opt",
115547
+ "having_opt", "orderby_opt", "limit_opt", "values",
115548
+ "nexprlist", "exprlist", "sclp", "as",
115052115549
"seltablist", "stl_prefix", "joinop", "indexed_opt",
115053115550
"on_opt", "using_opt", "joinop2", "idlist",
115054
- "sortlist", "nexprlist", "setlist", "insert_cmd",
115055
- "inscollist_opt", "valuelist", "exprlist", "likeop",
115056
- "between_op", "in_op", "case_operand", "case_exprlist",
115057
- "case_else", "uniqueflag", "collate", "nmnum",
115058
- "number", "trigger_decl", "trigger_cmd_list", "trigger_time",
115551
+ "sortlist", "setlist", "insert_cmd", "inscollist_opt",
115552
+ "likeop", "between_op", "in_op", "case_operand",
115553
+ "case_exprlist", "case_else", "uniqueflag", "collate",
115554
+ "nmnum", "trigger_decl", "trigger_cmd_list", "trigger_time",
115059115555
"trigger_event", "foreach_clause", "when_clause", "trigger_cmd",
115060115556
"trnm", "tridxby", "database_kw_opt", "key_opt",
115061115557
"add_column_fullname", "kwcolumn_opt", "create_vtab", "vtabarglist",
115062115558
"vtabarg", "vtabargtoken", "lp", "anylist",
115559
+ "wqlist",
115063115560
};
115064115561
#endif /* NDEBUG */
115065115562
115066115563
#ifndef NDEBUG
115067115564
/* For tracing reduce actions, the names of all rules are required.
@@ -115105,299 +115602,297 @@
115105115602
/* 35 */ "table_options ::= WITHOUT nm",
115106115603
/* 36 */ "columnlist ::= columnlist COMMA column",
115107115604
/* 37 */ "columnlist ::= column",
115108115605
/* 38 */ "column ::= columnid type carglist",
115109115606
/* 39 */ "columnid ::= nm",
115110
- /* 40 */ "id ::= ID",
115111
- /* 41 */ "id ::= INDEXED",
115112
- /* 42 */ "ids ::= ID|STRING",
115113
- /* 43 */ "nm ::= id",
115114
- /* 44 */ "nm ::= STRING",
115115
- /* 45 */ "nm ::= JOIN_KW",
115116
- /* 46 */ "type ::=",
115117
- /* 47 */ "type ::= typetoken",
115118
- /* 48 */ "typetoken ::= typename",
115119
- /* 49 */ "typetoken ::= typename LP signed RP",
115120
- /* 50 */ "typetoken ::= typename LP signed COMMA signed RP",
115121
- /* 51 */ "typename ::= ids",
115122
- /* 52 */ "typename ::= typename ids",
115123
- /* 53 */ "signed ::= plus_num",
115124
- /* 54 */ "signed ::= minus_num",
115125
- /* 55 */ "carglist ::= carglist ccons",
115126
- /* 56 */ "carglist ::=",
115127
- /* 57 */ "ccons ::= CONSTRAINT nm",
115128
- /* 58 */ "ccons ::= DEFAULT term",
115129
- /* 59 */ "ccons ::= DEFAULT LP expr RP",
115130
- /* 60 */ "ccons ::= DEFAULT PLUS term",
115131
- /* 61 */ "ccons ::= DEFAULT MINUS term",
115132
- /* 62 */ "ccons ::= DEFAULT id",
115133
- /* 63 */ "ccons ::= NULL onconf",
115134
- /* 64 */ "ccons ::= NOT NULL onconf",
115135
- /* 65 */ "ccons ::= PRIMARY KEY sortorder onconf autoinc",
115136
- /* 66 */ "ccons ::= UNIQUE onconf",
115137
- /* 67 */ "ccons ::= CHECK LP expr RP",
115138
- /* 68 */ "ccons ::= REFERENCES nm idxlist_opt refargs",
115139
- /* 69 */ "ccons ::= defer_subclause",
115140
- /* 70 */ "ccons ::= COLLATE ids",
115141
- /* 71 */ "autoinc ::=",
115142
- /* 72 */ "autoinc ::= AUTOINCR",
115143
- /* 73 */ "refargs ::=",
115144
- /* 74 */ "refargs ::= refargs refarg",
115145
- /* 75 */ "refarg ::= MATCH nm",
115146
- /* 76 */ "refarg ::= ON INSERT refact",
115147
- /* 77 */ "refarg ::= ON DELETE refact",
115148
- /* 78 */ "refarg ::= ON UPDATE refact",
115149
- /* 79 */ "refact ::= SET NULL",
115150
- /* 80 */ "refact ::= SET DEFAULT",
115151
- /* 81 */ "refact ::= CASCADE",
115152
- /* 82 */ "refact ::= RESTRICT",
115153
- /* 83 */ "refact ::= NO ACTION",
115154
- /* 84 */ "defer_subclause ::= NOT DEFERRABLE init_deferred_pred_opt",
115155
- /* 85 */ "defer_subclause ::= DEFERRABLE init_deferred_pred_opt",
115156
- /* 86 */ "init_deferred_pred_opt ::=",
115157
- /* 87 */ "init_deferred_pred_opt ::= INITIALLY DEFERRED",
115158
- /* 88 */ "init_deferred_pred_opt ::= INITIALLY IMMEDIATE",
115159
- /* 89 */ "conslist_opt ::=",
115160
- /* 90 */ "conslist_opt ::= COMMA conslist",
115161
- /* 91 */ "conslist ::= conslist tconscomma tcons",
115162
- /* 92 */ "conslist ::= tcons",
115163
- /* 93 */ "tconscomma ::= COMMA",
115164
- /* 94 */ "tconscomma ::=",
115165
- /* 95 */ "tcons ::= CONSTRAINT nm",
115166
- /* 96 */ "tcons ::= PRIMARY KEY LP idxlist autoinc RP onconf",
115167
- /* 97 */ "tcons ::= UNIQUE LP idxlist RP onconf",
115168
- /* 98 */ "tcons ::= CHECK LP expr RP onconf",
115169
- /* 99 */ "tcons ::= FOREIGN KEY LP idxlist RP REFERENCES nm idxlist_opt refargs defer_subclause_opt",
115170
- /* 100 */ "defer_subclause_opt ::=",
115171
- /* 101 */ "defer_subclause_opt ::= defer_subclause",
115172
- /* 102 */ "onconf ::=",
115173
- /* 103 */ "onconf ::= ON CONFLICT resolvetype",
115174
- /* 104 */ "orconf ::=",
115175
- /* 105 */ "orconf ::= OR resolvetype",
115176
- /* 106 */ "resolvetype ::= raisetype",
115177
- /* 107 */ "resolvetype ::= IGNORE",
115178
- /* 108 */ "resolvetype ::= REPLACE",
115179
- /* 109 */ "cmd ::= DROP TABLE ifexists fullname",
115180
- /* 110 */ "ifexists ::= IF EXISTS",
115181
- /* 111 */ "ifexists ::=",
115182
- /* 112 */ "cmd ::= createkw temp VIEW ifnotexists nm dbnm AS select",
115183
- /* 113 */ "cmd ::= DROP VIEW ifexists fullname",
115184
- /* 114 */ "cmd ::= select",
115185
- /* 115 */ "select ::= oneselect",
115186
- /* 116 */ "select ::= select multiselect_op oneselect",
115187
- /* 117 */ "multiselect_op ::= UNION",
115188
- /* 118 */ "multiselect_op ::= UNION ALL",
115189
- /* 119 */ "multiselect_op ::= EXCEPT|INTERSECT",
115190
- /* 120 */ "oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt orderby_opt limit_opt",
115191
- /* 121 */ "distinct ::= DISTINCT",
115192
- /* 122 */ "distinct ::= ALL",
115193
- /* 123 */ "distinct ::=",
115194
- /* 124 */ "sclp ::= selcollist COMMA",
115195
- /* 125 */ "sclp ::=",
115196
- /* 126 */ "selcollist ::= sclp expr as",
115197
- /* 127 */ "selcollist ::= sclp STAR",
115198
- /* 128 */ "selcollist ::= sclp nm DOT STAR",
115199
- /* 129 */ "as ::= AS nm",
115200
- /* 130 */ "as ::= ids",
115201
- /* 131 */ "as ::=",
115202
- /* 132 */ "from ::=",
115203
- /* 133 */ "from ::= FROM seltablist",
115204
- /* 134 */ "stl_prefix ::= seltablist joinop",
115205
- /* 135 */ "stl_prefix ::=",
115206
- /* 136 */ "seltablist ::= stl_prefix nm dbnm as indexed_opt on_opt using_opt",
115207
- /* 137 */ "seltablist ::= stl_prefix LP select RP as on_opt using_opt",
115208
- /* 138 */ "seltablist ::= stl_prefix LP seltablist RP as on_opt using_opt",
115209
- /* 139 */ "dbnm ::=",
115210
- /* 140 */ "dbnm ::= DOT nm",
115211
- /* 141 */ "fullname ::= nm dbnm",
115212
- /* 142 */ "joinop ::= COMMA|JOIN",
115213
- /* 143 */ "joinop ::= JOIN_KW JOIN",
115214
- /* 144 */ "joinop ::= JOIN_KW nm JOIN",
115215
- /* 145 */ "joinop ::= JOIN_KW nm nm JOIN",
115216
- /* 146 */ "on_opt ::= ON expr",
115217
- /* 147 */ "on_opt ::=",
115218
- /* 148 */ "indexed_opt ::=",
115219
- /* 149 */ "indexed_opt ::= INDEXED BY nm",
115220
- /* 150 */ "indexed_opt ::= NOT INDEXED",
115221
- /* 151 */ "using_opt ::= USING LP idlist RP",
115222
- /* 152 */ "using_opt ::=",
115223
- /* 153 */ "orderby_opt ::=",
115224
- /* 154 */ "orderby_opt ::= ORDER BY sortlist",
115225
- /* 155 */ "sortlist ::= sortlist COMMA expr sortorder",
115226
- /* 156 */ "sortlist ::= expr sortorder",
115227
- /* 157 */ "sortorder ::= ASC",
115228
- /* 158 */ "sortorder ::= DESC",
115229
- /* 159 */ "sortorder ::=",
115230
- /* 160 */ "groupby_opt ::=",
115231
- /* 161 */ "groupby_opt ::= GROUP BY nexprlist",
115232
- /* 162 */ "having_opt ::=",
115233
- /* 163 */ "having_opt ::= HAVING expr",
115234
- /* 164 */ "limit_opt ::=",
115235
- /* 165 */ "limit_opt ::= LIMIT expr",
115236
- /* 166 */ "limit_opt ::= LIMIT expr OFFSET expr",
115237
- /* 167 */ "limit_opt ::= LIMIT expr COMMA expr",
115238
- /* 168 */ "cmd ::= DELETE FROM fullname indexed_opt where_opt",
115239
- /* 169 */ "where_opt ::=",
115240
- /* 170 */ "where_opt ::= WHERE expr",
115241
- /* 171 */ "cmd ::= UPDATE orconf fullname indexed_opt SET setlist where_opt",
115242
- /* 172 */ "setlist ::= setlist COMMA nm EQ expr",
115243
- /* 173 */ "setlist ::= nm EQ expr",
115244
- /* 174 */ "cmd ::= insert_cmd INTO fullname inscollist_opt valuelist",
115245
- /* 175 */ "cmd ::= insert_cmd INTO fullname inscollist_opt select",
115246
- /* 176 */ "cmd ::= insert_cmd INTO fullname inscollist_opt DEFAULT VALUES",
115607
+ /* 40 */ "nm ::= ID|INDEXED",
115608
+ /* 41 */ "nm ::= STRING",
115609
+ /* 42 */ "nm ::= JOIN_KW",
115610
+ /* 43 */ "type ::=",
115611
+ /* 44 */ "type ::= typetoken",
115612
+ /* 45 */ "typetoken ::= typename",
115613
+ /* 46 */ "typetoken ::= typename LP signed RP",
115614
+ /* 47 */ "typetoken ::= typename LP signed COMMA signed RP",
115615
+ /* 48 */ "typename ::= ID|STRING",
115616
+ /* 49 */ "typename ::= typename ID|STRING",
115617
+ /* 50 */ "signed ::= plus_num",
115618
+ /* 51 */ "signed ::= minus_num",
115619
+ /* 52 */ "carglist ::= carglist ccons",
115620
+ /* 53 */ "carglist ::=",
115621
+ /* 54 */ "ccons ::= CONSTRAINT nm",
115622
+ /* 55 */ "ccons ::= DEFAULT term",
115623
+ /* 56 */ "ccons ::= DEFAULT LP expr RP",
115624
+ /* 57 */ "ccons ::= DEFAULT PLUS term",
115625
+ /* 58 */ "ccons ::= DEFAULT MINUS term",
115626
+ /* 59 */ "ccons ::= DEFAULT ID|INDEXED",
115627
+ /* 60 */ "ccons ::= NULL onconf",
115628
+ /* 61 */ "ccons ::= NOT NULL onconf",
115629
+ /* 62 */ "ccons ::= PRIMARY KEY sortorder onconf autoinc",
115630
+ /* 63 */ "ccons ::= UNIQUE onconf",
115631
+ /* 64 */ "ccons ::= CHECK LP expr RP",
115632
+ /* 65 */ "ccons ::= REFERENCES nm idxlist_opt refargs",
115633
+ /* 66 */ "ccons ::= defer_subclause",
115634
+ /* 67 */ "ccons ::= COLLATE ID|STRING",
115635
+ /* 68 */ "autoinc ::=",
115636
+ /* 69 */ "autoinc ::= AUTOINCR",
115637
+ /* 70 */ "refargs ::=",
115638
+ /* 71 */ "refargs ::= refargs refarg",
115639
+ /* 72 */ "refarg ::= MATCH nm",
115640
+ /* 73 */ "refarg ::= ON INSERT refact",
115641
+ /* 74 */ "refarg ::= ON DELETE refact",
115642
+ /* 75 */ "refarg ::= ON UPDATE refact",
115643
+ /* 76 */ "refact ::= SET NULL",
115644
+ /* 77 */ "refact ::= SET DEFAULT",
115645
+ /* 78 */ "refact ::= CASCADE",
115646
+ /* 79 */ "refact ::= RESTRICT",
115647
+ /* 80 */ "refact ::= NO ACTION",
115648
+ /* 81 */ "defer_subclause ::= NOT DEFERRABLE init_deferred_pred_opt",
115649
+ /* 82 */ "defer_subclause ::= DEFERRABLE init_deferred_pred_opt",
115650
+ /* 83 */ "init_deferred_pred_opt ::=",
115651
+ /* 84 */ "init_deferred_pred_opt ::= INITIALLY DEFERRED",
115652
+ /* 85 */ "init_deferred_pred_opt ::= INITIALLY IMMEDIATE",
115653
+ /* 86 */ "conslist_opt ::=",
115654
+ /* 87 */ "conslist_opt ::= COMMA conslist",
115655
+ /* 88 */ "conslist ::= conslist tconscomma tcons",
115656
+ /* 89 */ "conslist ::= tcons",
115657
+ /* 90 */ "tconscomma ::= COMMA",
115658
+ /* 91 */ "tconscomma ::=",
115659
+ /* 92 */ "tcons ::= CONSTRAINT nm",
115660
+ /* 93 */ "tcons ::= PRIMARY KEY LP idxlist autoinc RP onconf",
115661
+ /* 94 */ "tcons ::= UNIQUE LP idxlist RP onconf",
115662
+ /* 95 */ "tcons ::= CHECK LP expr RP onconf",
115663
+ /* 96 */ "tcons ::= FOREIGN KEY LP idxlist RP REFERENCES nm idxlist_opt refargs defer_subclause_opt",
115664
+ /* 97 */ "defer_subclause_opt ::=",
115665
+ /* 98 */ "defer_subclause_opt ::= defer_subclause",
115666
+ /* 99 */ "onconf ::=",
115667
+ /* 100 */ "onconf ::= ON CONFLICT resolvetype",
115668
+ /* 101 */ "orconf ::=",
115669
+ /* 102 */ "orconf ::= OR resolvetype",
115670
+ /* 103 */ "resolvetype ::= raisetype",
115671
+ /* 104 */ "resolvetype ::= IGNORE",
115672
+ /* 105 */ "resolvetype ::= REPLACE",
115673
+ /* 106 */ "cmd ::= DROP TABLE ifexists fullname",
115674
+ /* 107 */ "ifexists ::= IF EXISTS",
115675
+ /* 108 */ "ifexists ::=",
115676
+ /* 109 */ "cmd ::= createkw temp VIEW ifnotexists nm dbnm AS select",
115677
+ /* 110 */ "cmd ::= DROP VIEW ifexists fullname",
115678
+ /* 111 */ "cmd ::= select",
115679
+ /* 112 */ "select ::= with selectnowith",
115680
+ /* 113 */ "selectnowith ::= oneselect",
115681
+ /* 114 */ "selectnowith ::= selectnowith multiselect_op oneselect",
115682
+ /* 115 */ "multiselect_op ::= UNION",
115683
+ /* 116 */ "multiselect_op ::= UNION ALL",
115684
+ /* 117 */ "multiselect_op ::= EXCEPT|INTERSECT",
115685
+ /* 118 */ "oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt orderby_opt limit_opt",
115686
+ /* 119 */ "oneselect ::= values",
115687
+ /* 120 */ "values ::= VALUES LP nexprlist RP",
115688
+ /* 121 */ "values ::= values COMMA LP exprlist RP",
115689
+ /* 122 */ "distinct ::= DISTINCT",
115690
+ /* 123 */ "distinct ::= ALL",
115691
+ /* 124 */ "distinct ::=",
115692
+ /* 125 */ "sclp ::= selcollist COMMA",
115693
+ /* 126 */ "sclp ::=",
115694
+ /* 127 */ "selcollist ::= sclp expr as",
115695
+ /* 128 */ "selcollist ::= sclp STAR",
115696
+ /* 129 */ "selcollist ::= sclp nm DOT STAR",
115697
+ /* 130 */ "as ::= AS nm",
115698
+ /* 131 */ "as ::= ID|STRING",
115699
+ /* 132 */ "as ::=",
115700
+ /* 133 */ "from ::=",
115701
+ /* 134 */ "from ::= FROM seltablist",
115702
+ /* 135 */ "stl_prefix ::= seltablist joinop",
115703
+ /* 136 */ "stl_prefix ::=",
115704
+ /* 137 */ "seltablist ::= stl_prefix nm dbnm as indexed_opt on_opt using_opt",
115705
+ /* 138 */ "seltablist ::= stl_prefix LP select RP as on_opt using_opt",
115706
+ /* 139 */ "seltablist ::= stl_prefix LP seltablist RP as on_opt using_opt",
115707
+ /* 140 */ "dbnm ::=",
115708
+ /* 141 */ "dbnm ::= DOT nm",
115709
+ /* 142 */ "fullname ::= nm dbnm",
115710
+ /* 143 */ "joinop ::= COMMA|JOIN",
115711
+ /* 144 */ "joinop ::= JOIN_KW JOIN",
115712
+ /* 145 */ "joinop ::= JOIN_KW nm JOIN",
115713
+ /* 146 */ "joinop ::= JOIN_KW nm nm JOIN",
115714
+ /* 147 */ "on_opt ::= ON expr",
115715
+ /* 148 */ "on_opt ::=",
115716
+ /* 149 */ "indexed_opt ::=",
115717
+ /* 150 */ "indexed_opt ::= INDEXED BY nm",
115718
+ /* 151 */ "indexed_opt ::= NOT INDEXED",
115719
+ /* 152 */ "using_opt ::= USING LP idlist RP",
115720
+ /* 153 */ "using_opt ::=",
115721
+ /* 154 */ "orderby_opt ::=",
115722
+ /* 155 */ "orderby_opt ::= ORDER BY sortlist",
115723
+ /* 156 */ "sortlist ::= sortlist COMMA expr sortorder",
115724
+ /* 157 */ "sortlist ::= expr sortorder",
115725
+ /* 158 */ "sortorder ::= ASC",
115726
+ /* 159 */ "sortorder ::= DESC",
115727
+ /* 160 */ "sortorder ::=",
115728
+ /* 161 */ "groupby_opt ::=",
115729
+ /* 162 */ "groupby_opt ::= GROUP BY nexprlist",
115730
+ /* 163 */ "having_opt ::=",
115731
+ /* 164 */ "having_opt ::= HAVING expr",
115732
+ /* 165 */ "limit_opt ::=",
115733
+ /* 166 */ "limit_opt ::= LIMIT expr",
115734
+ /* 167 */ "limit_opt ::= LIMIT expr OFFSET expr",
115735
+ /* 168 */ "limit_opt ::= LIMIT expr COMMA expr",
115736
+ /* 169 */ "cmd ::= with DELETE FROM fullname indexed_opt where_opt",
115737
+ /* 170 */ "where_opt ::=",
115738
+ /* 171 */ "where_opt ::= WHERE expr",
115739
+ /* 172 */ "cmd ::= with UPDATE orconf fullname indexed_opt SET setlist where_opt",
115740
+ /* 173 */ "setlist ::= setlist COMMA nm EQ expr",
115741
+ /* 174 */ "setlist ::= nm EQ expr",
115742
+ /* 175 */ "cmd ::= with insert_cmd INTO fullname inscollist_opt select",
115743
+ /* 176 */ "cmd ::= with insert_cmd INTO fullname inscollist_opt DEFAULT VALUES",
115247115744
/* 177 */ "insert_cmd ::= INSERT orconf",
115248115745
/* 178 */ "insert_cmd ::= REPLACE",
115249
- /* 179 */ "valuelist ::= VALUES LP nexprlist RP",
115250
- /* 180 */ "valuelist ::= valuelist COMMA LP exprlist RP",
115251
- /* 181 */ "inscollist_opt ::=",
115252
- /* 182 */ "inscollist_opt ::= LP idlist RP",
115253
- /* 183 */ "idlist ::= idlist COMMA nm",
115254
- /* 184 */ "idlist ::= nm",
115255
- /* 185 */ "expr ::= term",
115256
- /* 186 */ "expr ::= LP expr RP",
115257
- /* 187 */ "term ::= NULL",
115258
- /* 188 */ "expr ::= id",
115259
- /* 189 */ "expr ::= JOIN_KW",
115260
- /* 190 */ "expr ::= nm DOT nm",
115261
- /* 191 */ "expr ::= nm DOT nm DOT nm",
115262
- /* 192 */ "term ::= INTEGER|FLOAT|BLOB",
115263
- /* 193 */ "term ::= STRING",
115264
- /* 194 */ "expr ::= REGISTER",
115265
- /* 195 */ "expr ::= VARIABLE",
115266
- /* 196 */ "expr ::= expr COLLATE ids",
115267
- /* 197 */ "expr ::= CAST LP expr AS typetoken RP",
115268
- /* 198 */ "expr ::= ID LP distinct exprlist RP",
115269
- /* 199 */ "expr ::= ID LP STAR RP",
115270
- /* 200 */ "term ::= CTIME_KW",
115271
- /* 201 */ "expr ::= expr AND expr",
115272
- /* 202 */ "expr ::= expr OR expr",
115273
- /* 203 */ "expr ::= expr LT|GT|GE|LE expr",
115274
- /* 204 */ "expr ::= expr EQ|NE expr",
115275
- /* 205 */ "expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr",
115276
- /* 206 */ "expr ::= expr PLUS|MINUS expr",
115277
- /* 207 */ "expr ::= expr STAR|SLASH|REM expr",
115278
- /* 208 */ "expr ::= expr CONCAT expr",
115279
- /* 209 */ "likeop ::= LIKE_KW",
115280
- /* 210 */ "likeop ::= NOT LIKE_KW",
115281
- /* 211 */ "likeop ::= MATCH",
115282
- /* 212 */ "likeop ::= NOT MATCH",
115283
- /* 213 */ "expr ::= expr likeop expr",
115284
- /* 214 */ "expr ::= expr likeop expr ESCAPE expr",
115285
- /* 215 */ "expr ::= expr ISNULL|NOTNULL",
115286
- /* 216 */ "expr ::= expr NOT NULL",
115287
- /* 217 */ "expr ::= expr IS expr",
115288
- /* 218 */ "expr ::= expr IS NOT expr",
115289
- /* 219 */ "expr ::= NOT expr",
115290
- /* 220 */ "expr ::= BITNOT expr",
115291
- /* 221 */ "expr ::= MINUS expr",
115292
- /* 222 */ "expr ::= PLUS expr",
115293
- /* 223 */ "between_op ::= BETWEEN",
115294
- /* 224 */ "between_op ::= NOT BETWEEN",
115295
- /* 225 */ "expr ::= expr between_op expr AND expr",
115296
- /* 226 */ "in_op ::= IN",
115297
- /* 227 */ "in_op ::= NOT IN",
115298
- /* 228 */ "expr ::= expr in_op LP exprlist RP",
115299
- /* 229 */ "expr ::= LP select RP",
115300
- /* 230 */ "expr ::= expr in_op LP select RP",
115301
- /* 231 */ "expr ::= expr in_op nm dbnm",
115302
- /* 232 */ "expr ::= EXISTS LP select RP",
115303
- /* 233 */ "expr ::= CASE case_operand case_exprlist case_else END",
115304
- /* 234 */ "case_exprlist ::= case_exprlist WHEN expr THEN expr",
115305
- /* 235 */ "case_exprlist ::= WHEN expr THEN expr",
115306
- /* 236 */ "case_else ::= ELSE expr",
115307
- /* 237 */ "case_else ::=",
115308
- /* 238 */ "case_operand ::= expr",
115309
- /* 239 */ "case_operand ::=",
115310
- /* 240 */ "exprlist ::= nexprlist",
115311
- /* 241 */ "exprlist ::=",
115312
- /* 242 */ "nexprlist ::= nexprlist COMMA expr",
115313
- /* 243 */ "nexprlist ::= expr",
115314
- /* 244 */ "cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP idxlist RP where_opt",
115315
- /* 245 */ "uniqueflag ::= UNIQUE",
115316
- /* 246 */ "uniqueflag ::=",
115317
- /* 247 */ "idxlist_opt ::=",
115318
- /* 248 */ "idxlist_opt ::= LP idxlist RP",
115319
- /* 249 */ "idxlist ::= idxlist COMMA nm collate sortorder",
115320
- /* 250 */ "idxlist ::= nm collate sortorder",
115321
- /* 251 */ "collate ::=",
115322
- /* 252 */ "collate ::= COLLATE ids",
115323
- /* 253 */ "cmd ::= DROP INDEX ifexists fullname",
115324
- /* 254 */ "cmd ::= VACUUM",
115325
- /* 255 */ "cmd ::= VACUUM nm",
115326
- /* 256 */ "cmd ::= PRAGMA nm dbnm",
115327
- /* 257 */ "cmd ::= PRAGMA nm dbnm EQ nmnum",
115328
- /* 258 */ "cmd ::= PRAGMA nm dbnm LP nmnum RP",
115329
- /* 259 */ "cmd ::= PRAGMA nm dbnm EQ minus_num",
115330
- /* 260 */ "cmd ::= PRAGMA nm dbnm LP minus_num RP",
115331
- /* 261 */ "nmnum ::= plus_num",
115332
- /* 262 */ "nmnum ::= nm",
115333
- /* 263 */ "nmnum ::= ON",
115334
- /* 264 */ "nmnum ::= DELETE",
115335
- /* 265 */ "nmnum ::= DEFAULT",
115336
- /* 266 */ "plus_num ::= PLUS number",
115337
- /* 267 */ "plus_num ::= number",
115338
- /* 268 */ "minus_num ::= MINUS number",
115339
- /* 269 */ "number ::= INTEGER|FLOAT",
115340
- /* 270 */ "cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END",
115341
- /* 271 */ "trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause",
115342
- /* 272 */ "trigger_time ::= BEFORE",
115343
- /* 273 */ "trigger_time ::= AFTER",
115344
- /* 274 */ "trigger_time ::= INSTEAD OF",
115345
- /* 275 */ "trigger_time ::=",
115346
- /* 276 */ "trigger_event ::= DELETE|INSERT",
115347
- /* 277 */ "trigger_event ::= UPDATE",
115348
- /* 278 */ "trigger_event ::= UPDATE OF idlist",
115349
- /* 279 */ "foreach_clause ::=",
115350
- /* 280 */ "foreach_clause ::= FOR EACH ROW",
115351
- /* 281 */ "when_clause ::=",
115352
- /* 282 */ "when_clause ::= WHEN expr",
115353
- /* 283 */ "trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI",
115354
- /* 284 */ "trigger_cmd_list ::= trigger_cmd SEMI",
115355
- /* 285 */ "trnm ::= nm",
115356
- /* 286 */ "trnm ::= nm DOT nm",
115357
- /* 287 */ "tridxby ::=",
115358
- /* 288 */ "tridxby ::= INDEXED BY nm",
115359
- /* 289 */ "tridxby ::= NOT INDEXED",
115360
- /* 290 */ "trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist where_opt",
115361
- /* 291 */ "trigger_cmd ::= insert_cmd INTO trnm inscollist_opt valuelist",
115362
- /* 292 */ "trigger_cmd ::= insert_cmd INTO trnm inscollist_opt select",
115363
- /* 293 */ "trigger_cmd ::= DELETE FROM trnm tridxby where_opt",
115364
- /* 294 */ "trigger_cmd ::= select",
115365
- /* 295 */ "expr ::= RAISE LP IGNORE RP",
115366
- /* 296 */ "expr ::= RAISE LP raisetype COMMA nm RP",
115367
- /* 297 */ "raisetype ::= ROLLBACK",
115368
- /* 298 */ "raisetype ::= ABORT",
115369
- /* 299 */ "raisetype ::= FAIL",
115370
- /* 300 */ "cmd ::= DROP TRIGGER ifexists fullname",
115371
- /* 301 */ "cmd ::= ATTACH database_kw_opt expr AS expr key_opt",
115372
- /* 302 */ "cmd ::= DETACH database_kw_opt expr",
115373
- /* 303 */ "key_opt ::=",
115374
- /* 304 */ "key_opt ::= KEY expr",
115375
- /* 305 */ "database_kw_opt ::= DATABASE",
115376
- /* 306 */ "database_kw_opt ::=",
115377
- /* 307 */ "cmd ::= REINDEX",
115378
- /* 308 */ "cmd ::= REINDEX nm dbnm",
115379
- /* 309 */ "cmd ::= ANALYZE",
115380
- /* 310 */ "cmd ::= ANALYZE nm dbnm",
115381
- /* 311 */ "cmd ::= ALTER TABLE fullname RENAME TO nm",
115382
- /* 312 */ "cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt column",
115383
- /* 313 */ "add_column_fullname ::= fullname",
115384
- /* 314 */ "kwcolumn_opt ::=",
115385
- /* 315 */ "kwcolumn_opt ::= COLUMNKW",
115386
- /* 316 */ "cmd ::= create_vtab",
115387
- /* 317 */ "cmd ::= create_vtab LP vtabarglist RP",
115388
- /* 318 */ "create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm",
115389
- /* 319 */ "vtabarglist ::= vtabarg",
115390
- /* 320 */ "vtabarglist ::= vtabarglist COMMA vtabarg",
115391
- /* 321 */ "vtabarg ::=",
115392
- /* 322 */ "vtabarg ::= vtabarg vtabargtoken",
115393
- /* 323 */ "vtabargtoken ::= ANY",
115394
- /* 324 */ "vtabargtoken ::= lp anylist RP",
115395
- /* 325 */ "lp ::= LP",
115396
- /* 326 */ "anylist ::=",
115397
- /* 327 */ "anylist ::= anylist LP anylist RP",
115398
- /* 328 */ "anylist ::= anylist ANY",
115746
+ /* 179 */ "inscollist_opt ::=",
115747
+ /* 180 */ "inscollist_opt ::= LP idlist RP",
115748
+ /* 181 */ "idlist ::= idlist COMMA nm",
115749
+ /* 182 */ "idlist ::= nm",
115750
+ /* 183 */ "expr ::= term",
115751
+ /* 184 */ "expr ::= LP expr RP",
115752
+ /* 185 */ "term ::= NULL",
115753
+ /* 186 */ "expr ::= ID|INDEXED",
115754
+ /* 187 */ "expr ::= JOIN_KW",
115755
+ /* 188 */ "expr ::= nm DOT nm",
115756
+ /* 189 */ "expr ::= nm DOT nm DOT nm",
115757
+ /* 190 */ "term ::= INTEGER|FLOAT|BLOB",
115758
+ /* 191 */ "term ::= STRING",
115759
+ /* 192 */ "expr ::= VARIABLE",
115760
+ /* 193 */ "expr ::= expr COLLATE ID|STRING",
115761
+ /* 194 */ "expr ::= CAST LP expr AS typetoken RP",
115762
+ /* 195 */ "expr ::= ID|INDEXED LP distinct exprlist RP",
115763
+ /* 196 */ "expr ::= ID|INDEXED LP STAR RP",
115764
+ /* 197 */ "term ::= CTIME_KW",
115765
+ /* 198 */ "expr ::= expr AND expr",
115766
+ /* 199 */ "expr ::= expr OR expr",
115767
+ /* 200 */ "expr ::= expr LT|GT|GE|LE expr",
115768
+ /* 201 */ "expr ::= expr EQ|NE expr",
115769
+ /* 202 */ "expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr",
115770
+ /* 203 */ "expr ::= expr PLUS|MINUS expr",
115771
+ /* 204 */ "expr ::= expr STAR|SLASH|REM expr",
115772
+ /* 205 */ "expr ::= expr CONCAT expr",
115773
+ /* 206 */ "likeop ::= LIKE_KW|MATCH",
115774
+ /* 207 */ "likeop ::= NOT LIKE_KW|MATCH",
115775
+ /* 208 */ "expr ::= expr likeop expr",
115776
+ /* 209 */ "expr ::= expr likeop expr ESCAPE expr",
115777
+ /* 210 */ "expr ::= expr ISNULL|NOTNULL",
115778
+ /* 211 */ "expr ::= expr NOT NULL",
115779
+ /* 212 */ "expr ::= expr IS expr",
115780
+ /* 213 */ "expr ::= expr IS NOT expr",
115781
+ /* 214 */ "expr ::= NOT expr",
115782
+ /* 215 */ "expr ::= BITNOT expr",
115783
+ /* 216 */ "expr ::= MINUS expr",
115784
+ /* 217 */ "expr ::= PLUS expr",
115785
+ /* 218 */ "between_op ::= BETWEEN",
115786
+ /* 219 */ "between_op ::= NOT BETWEEN",
115787
+ /* 220 */ "expr ::= expr between_op expr AND expr",
115788
+ /* 221 */ "in_op ::= IN",
115789
+ /* 222 */ "in_op ::= NOT IN",
115790
+ /* 223 */ "expr ::= expr in_op LP exprlist RP",
115791
+ /* 224 */ "expr ::= LP select RP",
115792
+ /* 225 */ "expr ::= expr in_op LP select RP",
115793
+ /* 226 */ "expr ::= expr in_op nm dbnm",
115794
+ /* 227 */ "expr ::= EXISTS LP select RP",
115795
+ /* 228 */ "expr ::= CASE case_operand case_exprlist case_else END",
115796
+ /* 229 */ "case_exprlist ::= case_exprlist WHEN expr THEN expr",
115797
+ /* 230 */ "case_exprlist ::= WHEN expr THEN expr",
115798
+ /* 231 */ "case_else ::= ELSE expr",
115799
+ /* 232 */ "case_else ::=",
115800
+ /* 233 */ "case_operand ::= expr",
115801
+ /* 234 */ "case_operand ::=",
115802
+ /* 235 */ "exprlist ::= nexprlist",
115803
+ /* 236 */ "exprlist ::=",
115804
+ /* 237 */ "nexprlist ::= nexprlist COMMA expr",
115805
+ /* 238 */ "nexprlist ::= expr",
115806
+ /* 239 */ "cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP idxlist RP where_opt",
115807
+ /* 240 */ "uniqueflag ::= UNIQUE",
115808
+ /* 241 */ "uniqueflag ::=",
115809
+ /* 242 */ "idxlist_opt ::=",
115810
+ /* 243 */ "idxlist_opt ::= LP idxlist RP",
115811
+ /* 244 */ "idxlist ::= idxlist COMMA nm collate sortorder",
115812
+ /* 245 */ "idxlist ::= nm collate sortorder",
115813
+ /* 246 */ "collate ::=",
115814
+ /* 247 */ "collate ::= COLLATE ID|STRING",
115815
+ /* 248 */ "cmd ::= DROP INDEX ifexists fullname",
115816
+ /* 249 */ "cmd ::= VACUUM",
115817
+ /* 250 */ "cmd ::= VACUUM nm",
115818
+ /* 251 */ "cmd ::= PRAGMA nm dbnm",
115819
+ /* 252 */ "cmd ::= PRAGMA nm dbnm EQ nmnum",
115820
+ /* 253 */ "cmd ::= PRAGMA nm dbnm LP nmnum RP",
115821
+ /* 254 */ "cmd ::= PRAGMA nm dbnm EQ minus_num",
115822
+ /* 255 */ "cmd ::= PRAGMA nm dbnm LP minus_num RP",
115823
+ /* 256 */ "nmnum ::= plus_num",
115824
+ /* 257 */ "nmnum ::= nm",
115825
+ /* 258 */ "nmnum ::= ON",
115826
+ /* 259 */ "nmnum ::= DELETE",
115827
+ /* 260 */ "nmnum ::= DEFAULT",
115828
+ /* 261 */ "plus_num ::= PLUS INTEGER|FLOAT",
115829
+ /* 262 */ "plus_num ::= INTEGER|FLOAT",
115830
+ /* 263 */ "minus_num ::= MINUS INTEGER|FLOAT",
115831
+ /* 264 */ "cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END",
115832
+ /* 265 */ "trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause",
115833
+ /* 266 */ "trigger_time ::= BEFORE",
115834
+ /* 267 */ "trigger_time ::= AFTER",
115835
+ /* 268 */ "trigger_time ::= INSTEAD OF",
115836
+ /* 269 */ "trigger_time ::=",
115837
+ /* 270 */ "trigger_event ::= DELETE|INSERT",
115838
+ /* 271 */ "trigger_event ::= UPDATE",
115839
+ /* 272 */ "trigger_event ::= UPDATE OF idlist",
115840
+ /* 273 */ "foreach_clause ::=",
115841
+ /* 274 */ "foreach_clause ::= FOR EACH ROW",
115842
+ /* 275 */ "when_clause ::=",
115843
+ /* 276 */ "when_clause ::= WHEN expr",
115844
+ /* 277 */ "trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI",
115845
+ /* 278 */ "trigger_cmd_list ::= trigger_cmd SEMI",
115846
+ /* 279 */ "trnm ::= nm",
115847
+ /* 280 */ "trnm ::= nm DOT nm",
115848
+ /* 281 */ "tridxby ::=",
115849
+ /* 282 */ "tridxby ::= INDEXED BY nm",
115850
+ /* 283 */ "tridxby ::= NOT INDEXED",
115851
+ /* 284 */ "trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist where_opt",
115852
+ /* 285 */ "trigger_cmd ::= insert_cmd INTO trnm inscollist_opt select",
115853
+ /* 286 */ "trigger_cmd ::= DELETE FROM trnm tridxby where_opt",
115854
+ /* 287 */ "trigger_cmd ::= select",
115855
+ /* 288 */ "expr ::= RAISE LP IGNORE RP",
115856
+ /* 289 */ "expr ::= RAISE LP raisetype COMMA nm RP",
115857
+ /* 290 */ "raisetype ::= ROLLBACK",
115858
+ /* 291 */ "raisetype ::= ABORT",
115859
+ /* 292 */ "raisetype ::= FAIL",
115860
+ /* 293 */ "cmd ::= DROP TRIGGER ifexists fullname",
115861
+ /* 294 */ "cmd ::= ATTACH database_kw_opt expr AS expr key_opt",
115862
+ /* 295 */ "cmd ::= DETACH database_kw_opt expr",
115863
+ /* 296 */ "key_opt ::=",
115864
+ /* 297 */ "key_opt ::= KEY expr",
115865
+ /* 298 */ "database_kw_opt ::= DATABASE",
115866
+ /* 299 */ "database_kw_opt ::=",
115867
+ /* 300 */ "cmd ::= REINDEX",
115868
+ /* 301 */ "cmd ::= REINDEX nm dbnm",
115869
+ /* 302 */ "cmd ::= ANALYZE",
115870
+ /* 303 */ "cmd ::= ANALYZE nm dbnm",
115871
+ /* 304 */ "cmd ::= ALTER TABLE fullname RENAME TO nm",
115872
+ /* 305 */ "cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt column",
115873
+ /* 306 */ "add_column_fullname ::= fullname",
115874
+ /* 307 */ "kwcolumn_opt ::=",
115875
+ /* 308 */ "kwcolumn_opt ::= COLUMNKW",
115876
+ /* 309 */ "cmd ::= create_vtab",
115877
+ /* 310 */ "cmd ::= create_vtab LP vtabarglist RP",
115878
+ /* 311 */ "create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm",
115879
+ /* 312 */ "vtabarglist ::= vtabarg",
115880
+ /* 313 */ "vtabarglist ::= vtabarglist COMMA vtabarg",
115881
+ /* 314 */ "vtabarg ::=",
115882
+ /* 315 */ "vtabarg ::= vtabarg vtabargtoken",
115883
+ /* 316 */ "vtabargtoken ::= ANY",
115884
+ /* 317 */ "vtabargtoken ::= lp anylist RP",
115885
+ /* 318 */ "lp ::= LP",
115886
+ /* 319 */ "anylist ::=",
115887
+ /* 320 */ "anylist ::= anylist LP anylist RP",
115888
+ /* 321 */ "anylist ::= anylist ANY",
115889
+ /* 322 */ "with ::=",
115890
+ /* 323 */ "with ::= WITH wqlist",
115891
+ /* 324 */ "with ::= WITH RECURSIVE wqlist",
115892
+ /* 325 */ "wqlist ::= nm idxlist_opt AS LP select RP",
115893
+ /* 326 */ "wqlist ::= wqlist COMMA nm idxlist_opt AS LP select RP",
115399115894
};
115400115895
#endif /* NDEBUG */
115401115896
115402115897
115403115898
#if YYSTACKDEPTH<=0
@@ -115472,80 +115967,80 @@
115472115967
**
115473115968
** Note: during a reduce, the only symbols destroyed are those
115474115969
** which appear on the RHS of the rule, but which are not used
115475115970
** inside the C code.
115476115971
*/
115477
- case 162: /* select */
115972
+ case 163: /* select */
115973
+ case 195: /* selectnowith */
115478115974
case 196: /* oneselect */
115479
-{
115480
-sqlite3SelectDelete(pParse->db, (yypminor->yy387));
115481
-}
115482
- break;
115483
- case 175: /* term */
115484
- case 176: /* expr */
115485
-{
115486
-sqlite3ExprDelete(pParse->db, (yypminor->yy118).pExpr);
115487
-}
115488
- break;
115489
- case 180: /* idxlist_opt */
115490
- case 189: /* idxlist */
115491
- case 199: /* selcollist */
115492
- case 202: /* groupby_opt */
115493
- case 204: /* orderby_opt */
115494
- case 206: /* sclp */
115495
- case 216: /* sortlist */
115496
- case 217: /* nexprlist */
115497
- case 218: /* setlist */
115498
- case 222: /* exprlist */
115499
- case 227: /* case_exprlist */
115500
-{
115501
-sqlite3ExprListDelete(pParse->db, (yypminor->yy322));
115502
-}
115503
- break;
115504
- case 195: /* fullname */
115505
- case 200: /* from */
115506
- case 208: /* seltablist */
115507
- case 209: /* stl_prefix */
115508
-{
115509
-sqlite3SrcListDelete(pParse->db, (yypminor->yy259));
115510
-}
115511
- break;
115512
- case 201: /* where_opt */
115513
- case 203: /* having_opt */
115514
- case 212: /* on_opt */
115515
- case 226: /* case_operand */
115516
- case 228: /* case_else */
115975
+ case 207: /* values */
115976
+{
115977
+sqlite3SelectDelete(pParse->db, (yypminor->yy3));
115978
+}
115979
+ break;
115980
+ case 174: /* term */
115981
+ case 175: /* expr */
115982
+{
115983
+sqlite3ExprDelete(pParse->db, (yypminor->yy346).pExpr);
115984
+}
115985
+ break;
115986
+ case 179: /* idxlist_opt */
115987
+ case 188: /* idxlist */
115988
+ case 200: /* selcollist */
115989
+ case 203: /* groupby_opt */
115990
+ case 205: /* orderby_opt */
115991
+ case 208: /* nexprlist */
115992
+ case 209: /* exprlist */
115993
+ case 210: /* sclp */
115994
+ case 220: /* sortlist */
115995
+ case 221: /* setlist */
115996
+ case 228: /* case_exprlist */
115997
+{
115998
+sqlite3ExprListDelete(pParse->db, (yypminor->yy14));
115999
+}
116000
+ break;
116001
+ case 194: /* fullname */
116002
+ case 201: /* from */
116003
+ case 212: /* seltablist */
116004
+ case 213: /* stl_prefix */
116005
+{
116006
+sqlite3SrcListDelete(pParse->db, (yypminor->yy65));
116007
+}
116008
+ break;
116009
+ case 197: /* with */
116010
+ case 252: /* wqlist */
116011
+{
116012
+sqlite3WithDelete(pParse->db, (yypminor->yy59));
116013
+}
116014
+ break;
116015
+ case 202: /* where_opt */
116016
+ case 204: /* having_opt */
116017
+ case 216: /* on_opt */
116018
+ case 227: /* case_operand */
116019
+ case 229: /* case_else */
115517116020
case 238: /* when_clause */
115518116021
case 243: /* key_opt */
115519116022
{
115520
-sqlite3ExprDelete(pParse->db, (yypminor->yy314));
115521
-}
115522
- break;
115523
- case 213: /* using_opt */
115524
- case 215: /* idlist */
115525
- case 220: /* inscollist_opt */
115526
-{
115527
-sqlite3IdListDelete(pParse->db, (yypminor->yy384));
115528
-}
115529
- break;
115530
- case 221: /* valuelist */
115531
-{
115532
-
115533
- sqlite3ExprListDelete(pParse->db, (yypminor->yy260).pList);
115534
- sqlite3SelectDelete(pParse->db, (yypminor->yy260).pSelect);
115535
-
116023
+sqlite3ExprDelete(pParse->db, (yypminor->yy132));
116024
+}
116025
+ break;
116026
+ case 217: /* using_opt */
116027
+ case 219: /* idlist */
116028
+ case 223: /* inscollist_opt */
116029
+{
116030
+sqlite3IdListDelete(pParse->db, (yypminor->yy408));
115536116031
}
115537116032
break;
115538116033
case 234: /* trigger_cmd_list */
115539116034
case 239: /* trigger_cmd */
115540116035
{
115541
-sqlite3DeleteTriggerStep(pParse->db, (yypminor->yy203));
116036
+sqlite3DeleteTriggerStep(pParse->db, (yypminor->yy473));
115542116037
}
115543116038
break;
115544116039
case 236: /* trigger_event */
115545116040
{
115546
-sqlite3IdListDelete(pParse->db, (yypminor->yy90).b);
116041
+sqlite3IdListDelete(pParse->db, (yypminor->yy378).b);
115547116042
}
115548116043
break;
115549116044
default: break; /* If no destructor action specified: do nothing */
115550116045
}
115551116046
}
@@ -115786,281 +116281,275 @@
115786116281
*/
115787116282
static const struct {
115788116283
YYCODETYPE lhs; /* Symbol on the left-hand side of the rule */
115789116284
unsigned char nrhs; /* Number of right-hand side symbols in the rule */
115790116285
} yyRuleInfo[] = {
115791
- { 143, 1 },
115792
- { 144, 2 },
115793
- { 144, 1 },
115794
- { 145, 1 },
115795
- { 145, 3 },
115796
- { 146, 0 },
115797
- { 146, 1 },
115798
- { 146, 3 },
115799
- { 147, 1 },
115800
- { 148, 3 },
115801
- { 150, 0 },
115802
- { 150, 1 },
115803
- { 150, 2 },
115804
- { 149, 0 },
115805
- { 149, 1 },
115806
- { 149, 1 },
115807
- { 149, 1 },
115808
- { 148, 2 },
115809
- { 148, 2 },
115810
- { 148, 2 },
115811
- { 152, 1 },
115812
- { 152, 0 },
115813
- { 148, 2 },
115814
- { 148, 3 },
115815
- { 148, 5 },
115816
- { 148, 2 },
115817
- { 153, 6 },
115818
- { 155, 1 },
115819
- { 157, 0 },
115820
- { 157, 3 },
115821
- { 156, 1 },
115822
- { 156, 0 },
115823
- { 154, 5 },
115824
- { 154, 2 },
115825
- { 161, 0 },
115826
- { 161, 2 },
115827
- { 159, 3 },
115828
- { 159, 1 },
115829
- { 163, 3 },
115830
- { 164, 1 },
115831
- { 167, 1 },
115832
- { 167, 1 },
115833
- { 168, 1 },
115834
- { 151, 1 },
115835
- { 151, 1 },
115836
- { 151, 1 },
115837
- { 165, 0 },
115838
- { 165, 1 },
115839
- { 169, 1 },
115840
- { 169, 4 },
115841
- { 169, 6 },
115842
- { 170, 1 },
115843
- { 170, 2 },
115844
- { 171, 1 },
115845
- { 171, 1 },
115846
- { 166, 2 },
115847
- { 166, 0 },
115848
- { 174, 2 },
115849
- { 174, 2 },
115850
- { 174, 4 },
115851
- { 174, 3 },
115852
- { 174, 3 },
115853
- { 174, 2 },
115854
- { 174, 2 },
115855
- { 174, 3 },
115856
- { 174, 5 },
115857
- { 174, 2 },
115858
- { 174, 4 },
115859
- { 174, 4 },
115860
- { 174, 1 },
115861
- { 174, 2 },
115862
- { 179, 0 },
115863
- { 179, 1 },
115864
- { 181, 0 },
115865
- { 181, 2 },
115866
- { 183, 2 },
115867
- { 183, 3 },
115868
- { 183, 3 },
115869
- { 183, 3 },
115870
- { 184, 2 },
115871
- { 184, 2 },
115872
- { 184, 1 },
115873
- { 184, 1 },
115874
- { 184, 2 },
115875
- { 182, 3 },
115876
- { 182, 2 },
115877
- { 185, 0 },
115878
- { 185, 2 },
115879
- { 185, 2 },
115880
- { 160, 0 },
115881
- { 160, 2 },
115882
- { 186, 3 },
115883
- { 186, 1 },
115884
- { 187, 1 },
115885
- { 187, 0 },
115886
- { 188, 2 },
115887
- { 188, 7 },
115888
- { 188, 5 },
115889
- { 188, 5 },
115890
- { 188, 10 },
115891
- { 190, 0 },
115892
- { 190, 1 },
115893
- { 177, 0 },
115894
- { 177, 3 },
115895
- { 191, 0 },
115896
- { 191, 2 },
115897
- { 192, 1 },
115898
- { 192, 1 },
115899
- { 192, 1 },
115900
- { 148, 4 },
115901
- { 194, 2 },
115902
- { 194, 0 },
115903
- { 148, 8 },
115904
- { 148, 4 },
115905
- { 148, 1 },
115906
- { 162, 1 },
115907
- { 162, 3 },
115908
- { 197, 1 },
115909
- { 197, 2 },
115910
- { 197, 1 },
115911
- { 196, 9 },
115912
- { 198, 1 },
115913
- { 198, 1 },
115914
- { 198, 0 },
115915
- { 206, 2 },
115916
- { 206, 0 },
115917
- { 199, 3 },
115918
- { 199, 2 },
115919
- { 199, 4 },
115920
- { 207, 2 },
115921
- { 207, 1 },
115922
- { 207, 0 },
115923
- { 200, 0 },
115924
- { 200, 2 },
115925
- { 209, 2 },
115926
- { 209, 0 },
115927
- { 208, 7 },
115928
- { 208, 7 },
115929
- { 208, 7 },
115930
- { 158, 0 },
115931
- { 158, 2 },
115932
- { 195, 2 },
115933
- { 210, 1 },
115934
- { 210, 2 },
115935
- { 210, 3 },
115936
- { 210, 4 },
115937
- { 212, 2 },
115938
- { 212, 0 },
115939
- { 211, 0 },
115940
- { 211, 3 },
115941
- { 211, 2 },
115942
- { 213, 4 },
115943
- { 213, 0 },
115944
- { 204, 0 },
115945
- { 204, 3 },
115946
- { 216, 4 },
115947
- { 216, 2 },
115948
- { 178, 1 },
115949
- { 178, 1 },
115950
- { 178, 0 },
115951
- { 202, 0 },
115952
- { 202, 3 },
115953
- { 203, 0 },
115954
- { 203, 2 },
115955
- { 205, 0 },
115956
- { 205, 2 },
115957
- { 205, 4 },
115958
- { 205, 4 },
115959
- { 148, 5 },
115960
- { 201, 0 },
115961
- { 201, 2 },
115962
- { 148, 7 },
115963
- { 218, 5 },
115964
- { 218, 3 },
115965
- { 148, 5 },
115966
- { 148, 5 },
115967
- { 148, 6 },
115968
- { 219, 2 },
115969
- { 219, 1 },
115970
- { 221, 4 },
115971
- { 221, 5 },
115972
- { 220, 0 },
115973
- { 220, 3 },
115974
- { 215, 3 },
115975
- { 215, 1 },
115976
- { 176, 1 },
115977
- { 176, 3 },
115978
- { 175, 1 },
115979
- { 176, 1 },
115980
- { 176, 1 },
115981
- { 176, 3 },
115982
- { 176, 5 },
115983
- { 175, 1 },
115984
- { 175, 1 },
115985
- { 176, 1 },
115986
- { 176, 1 },
115987
- { 176, 3 },
115988
- { 176, 6 },
115989
- { 176, 5 },
115990
- { 176, 4 },
115991
- { 175, 1 },
115992
- { 176, 3 },
115993
- { 176, 3 },
115994
- { 176, 3 },
115995
- { 176, 3 },
115996
- { 176, 3 },
115997
- { 176, 3 },
115998
- { 176, 3 },
115999
- { 176, 3 },
116000
- { 223, 1 },
116001
- { 223, 2 },
116002
- { 223, 1 },
116003
- { 223, 2 },
116004
- { 176, 3 },
116005
- { 176, 5 },
116006
- { 176, 2 },
116007
- { 176, 3 },
116008
- { 176, 3 },
116009
- { 176, 4 },
116010
- { 176, 2 },
116011
- { 176, 2 },
116012
- { 176, 2 },
116013
- { 176, 2 },
116014
- { 224, 1 },
116015
- { 224, 2 },
116016
- { 176, 5 },
116017
- { 225, 1 },
116018
- { 225, 2 },
116019
- { 176, 5 },
116020
- { 176, 3 },
116021
- { 176, 5 },
116022
- { 176, 4 },
116023
- { 176, 4 },
116024
- { 176, 5 },
116025
- { 227, 5 },
116026
- { 227, 4 },
116027
- { 228, 2 },
116028
- { 228, 0 },
116029
- { 226, 1 },
116030
- { 226, 0 },
116031
- { 222, 1 },
116032
- { 222, 0 },
116033
- { 217, 3 },
116034
- { 217, 1 },
116035
- { 148, 12 },
116036
- { 229, 1 },
116037
- { 229, 0 },
116038
- { 180, 0 },
116039
- { 180, 3 },
116040
- { 189, 5 },
116041
- { 189, 3 },
116042
- { 230, 0 },
116043
- { 230, 2 },
116044
- { 148, 4 },
116045
- { 148, 1 },
116046
- { 148, 2 },
116047
- { 148, 3 },
116048
- { 148, 5 },
116049
- { 148, 6 },
116050
- { 148, 5 },
116051
- { 148, 6 },
116052
- { 231, 1 },
116053
- { 231, 1 },
116054
- { 231, 1 },
116055
- { 231, 1 },
116056
- { 231, 1 },
116057
- { 172, 2 },
116058
- { 172, 1 },
116059
- { 173, 2 },
116060
- { 232, 1 },
116061
- { 148, 5 },
116286
+ { 144, 1 },
116287
+ { 145, 2 },
116288
+ { 145, 1 },
116289
+ { 146, 1 },
116290
+ { 146, 3 },
116291
+ { 147, 0 },
116292
+ { 147, 1 },
116293
+ { 147, 3 },
116294
+ { 148, 1 },
116295
+ { 149, 3 },
116296
+ { 151, 0 },
116297
+ { 151, 1 },
116298
+ { 151, 2 },
116299
+ { 150, 0 },
116300
+ { 150, 1 },
116301
+ { 150, 1 },
116302
+ { 150, 1 },
116303
+ { 149, 2 },
116304
+ { 149, 2 },
116305
+ { 149, 2 },
116306
+ { 153, 1 },
116307
+ { 153, 0 },
116308
+ { 149, 2 },
116309
+ { 149, 3 },
116310
+ { 149, 5 },
116311
+ { 149, 2 },
116312
+ { 154, 6 },
116313
+ { 156, 1 },
116314
+ { 158, 0 },
116315
+ { 158, 3 },
116316
+ { 157, 1 },
116317
+ { 157, 0 },
116318
+ { 155, 5 },
116319
+ { 155, 2 },
116320
+ { 162, 0 },
116321
+ { 162, 2 },
116322
+ { 160, 3 },
116323
+ { 160, 1 },
116324
+ { 164, 3 },
116325
+ { 165, 1 },
116326
+ { 152, 1 },
116327
+ { 152, 1 },
116328
+ { 152, 1 },
116329
+ { 166, 0 },
116330
+ { 166, 1 },
116331
+ { 168, 1 },
116332
+ { 168, 4 },
116333
+ { 168, 6 },
116334
+ { 169, 1 },
116335
+ { 169, 2 },
116336
+ { 170, 1 },
116337
+ { 170, 1 },
116338
+ { 167, 2 },
116339
+ { 167, 0 },
116340
+ { 173, 2 },
116341
+ { 173, 2 },
116342
+ { 173, 4 },
116343
+ { 173, 3 },
116344
+ { 173, 3 },
116345
+ { 173, 2 },
116346
+ { 173, 2 },
116347
+ { 173, 3 },
116348
+ { 173, 5 },
116349
+ { 173, 2 },
116350
+ { 173, 4 },
116351
+ { 173, 4 },
116352
+ { 173, 1 },
116353
+ { 173, 2 },
116354
+ { 178, 0 },
116355
+ { 178, 1 },
116356
+ { 180, 0 },
116357
+ { 180, 2 },
116358
+ { 182, 2 },
116359
+ { 182, 3 },
116360
+ { 182, 3 },
116361
+ { 182, 3 },
116362
+ { 183, 2 },
116363
+ { 183, 2 },
116364
+ { 183, 1 },
116365
+ { 183, 1 },
116366
+ { 183, 2 },
116367
+ { 181, 3 },
116368
+ { 181, 2 },
116369
+ { 184, 0 },
116370
+ { 184, 2 },
116371
+ { 184, 2 },
116372
+ { 161, 0 },
116373
+ { 161, 2 },
116374
+ { 185, 3 },
116375
+ { 185, 1 },
116376
+ { 186, 1 },
116377
+ { 186, 0 },
116378
+ { 187, 2 },
116379
+ { 187, 7 },
116380
+ { 187, 5 },
116381
+ { 187, 5 },
116382
+ { 187, 10 },
116383
+ { 189, 0 },
116384
+ { 189, 1 },
116385
+ { 176, 0 },
116386
+ { 176, 3 },
116387
+ { 190, 0 },
116388
+ { 190, 2 },
116389
+ { 191, 1 },
116390
+ { 191, 1 },
116391
+ { 191, 1 },
116392
+ { 149, 4 },
116393
+ { 193, 2 },
116394
+ { 193, 0 },
116395
+ { 149, 8 },
116396
+ { 149, 4 },
116397
+ { 149, 1 },
116398
+ { 163, 2 },
116399
+ { 195, 1 },
116400
+ { 195, 3 },
116401
+ { 198, 1 },
116402
+ { 198, 2 },
116403
+ { 198, 1 },
116404
+ { 196, 9 },
116405
+ { 196, 1 },
116406
+ { 207, 4 },
116407
+ { 207, 5 },
116408
+ { 199, 1 },
116409
+ { 199, 1 },
116410
+ { 199, 0 },
116411
+ { 210, 2 },
116412
+ { 210, 0 },
116413
+ { 200, 3 },
116414
+ { 200, 2 },
116415
+ { 200, 4 },
116416
+ { 211, 2 },
116417
+ { 211, 1 },
116418
+ { 211, 0 },
116419
+ { 201, 0 },
116420
+ { 201, 2 },
116421
+ { 213, 2 },
116422
+ { 213, 0 },
116423
+ { 212, 7 },
116424
+ { 212, 7 },
116425
+ { 212, 7 },
116426
+ { 159, 0 },
116427
+ { 159, 2 },
116428
+ { 194, 2 },
116429
+ { 214, 1 },
116430
+ { 214, 2 },
116431
+ { 214, 3 },
116432
+ { 214, 4 },
116433
+ { 216, 2 },
116434
+ { 216, 0 },
116435
+ { 215, 0 },
116436
+ { 215, 3 },
116437
+ { 215, 2 },
116438
+ { 217, 4 },
116439
+ { 217, 0 },
116440
+ { 205, 0 },
116441
+ { 205, 3 },
116442
+ { 220, 4 },
116443
+ { 220, 2 },
116444
+ { 177, 1 },
116445
+ { 177, 1 },
116446
+ { 177, 0 },
116447
+ { 203, 0 },
116448
+ { 203, 3 },
116449
+ { 204, 0 },
116450
+ { 204, 2 },
116451
+ { 206, 0 },
116452
+ { 206, 2 },
116453
+ { 206, 4 },
116454
+ { 206, 4 },
116455
+ { 149, 6 },
116456
+ { 202, 0 },
116457
+ { 202, 2 },
116458
+ { 149, 8 },
116459
+ { 221, 5 },
116460
+ { 221, 3 },
116461
+ { 149, 6 },
116462
+ { 149, 7 },
116463
+ { 222, 2 },
116464
+ { 222, 1 },
116465
+ { 223, 0 },
116466
+ { 223, 3 },
116467
+ { 219, 3 },
116468
+ { 219, 1 },
116469
+ { 175, 1 },
116470
+ { 175, 3 },
116471
+ { 174, 1 },
116472
+ { 175, 1 },
116473
+ { 175, 1 },
116474
+ { 175, 3 },
116475
+ { 175, 5 },
116476
+ { 174, 1 },
116477
+ { 174, 1 },
116478
+ { 175, 1 },
116479
+ { 175, 3 },
116480
+ { 175, 6 },
116481
+ { 175, 5 },
116482
+ { 175, 4 },
116483
+ { 174, 1 },
116484
+ { 175, 3 },
116485
+ { 175, 3 },
116486
+ { 175, 3 },
116487
+ { 175, 3 },
116488
+ { 175, 3 },
116489
+ { 175, 3 },
116490
+ { 175, 3 },
116491
+ { 175, 3 },
116492
+ { 224, 1 },
116493
+ { 224, 2 },
116494
+ { 175, 3 },
116495
+ { 175, 5 },
116496
+ { 175, 2 },
116497
+ { 175, 3 },
116498
+ { 175, 3 },
116499
+ { 175, 4 },
116500
+ { 175, 2 },
116501
+ { 175, 2 },
116502
+ { 175, 2 },
116503
+ { 175, 2 },
116504
+ { 225, 1 },
116505
+ { 225, 2 },
116506
+ { 175, 5 },
116507
+ { 226, 1 },
116508
+ { 226, 2 },
116509
+ { 175, 5 },
116510
+ { 175, 3 },
116511
+ { 175, 5 },
116512
+ { 175, 4 },
116513
+ { 175, 4 },
116514
+ { 175, 5 },
116515
+ { 228, 5 },
116516
+ { 228, 4 },
116517
+ { 229, 2 },
116518
+ { 229, 0 },
116519
+ { 227, 1 },
116520
+ { 227, 0 },
116521
+ { 209, 1 },
116522
+ { 209, 0 },
116523
+ { 208, 3 },
116524
+ { 208, 1 },
116525
+ { 149, 12 },
116526
+ { 230, 1 },
116527
+ { 230, 0 },
116528
+ { 179, 0 },
116529
+ { 179, 3 },
116530
+ { 188, 5 },
116531
+ { 188, 3 },
116532
+ { 231, 0 },
116533
+ { 231, 2 },
116534
+ { 149, 4 },
116535
+ { 149, 1 },
116536
+ { 149, 2 },
116537
+ { 149, 3 },
116538
+ { 149, 5 },
116539
+ { 149, 6 },
116540
+ { 149, 5 },
116541
+ { 149, 6 },
116542
+ { 232, 1 },
116543
+ { 232, 1 },
116544
+ { 232, 1 },
116545
+ { 232, 1 },
116546
+ { 232, 1 },
116547
+ { 171, 2 },
116548
+ { 171, 1 },
116549
+ { 172, 2 },
116550
+ { 149, 5 },
116062116551
{ 233, 11 },
116063116552
{ 235, 1 },
116064116553
{ 235, 1 },
116065116554
{ 235, 2 },
116066116555
{ 235, 0 },
@@ -116079,35 +116568,34 @@
116079116568
{ 241, 3 },
116080116569
{ 241, 2 },
116081116570
{ 239, 7 },
116082116571
{ 239, 5 },
116083116572
{ 239, 5 },
116084
- { 239, 5 },
116085116573
{ 239, 1 },
116086
- { 176, 4 },
116087
- { 176, 6 },
116088
- { 193, 1 },
116089
- { 193, 1 },
116090
- { 193, 1 },
116091
- { 148, 4 },
116092
- { 148, 6 },
116093
- { 148, 3 },
116574
+ { 175, 4 },
116575
+ { 175, 6 },
116576
+ { 192, 1 },
116577
+ { 192, 1 },
116578
+ { 192, 1 },
116579
+ { 149, 4 },
116580
+ { 149, 6 },
116581
+ { 149, 3 },
116094116582
{ 243, 0 },
116095116583
{ 243, 2 },
116096116584
{ 242, 1 },
116097116585
{ 242, 0 },
116098
- { 148, 1 },
116099
- { 148, 3 },
116100
- { 148, 1 },
116101
- { 148, 3 },
116102
- { 148, 6 },
116103
- { 148, 6 },
116586
+ { 149, 1 },
116587
+ { 149, 3 },
116588
+ { 149, 1 },
116589
+ { 149, 3 },
116590
+ { 149, 6 },
116591
+ { 149, 6 },
116104116592
{ 244, 1 },
116105116593
{ 245, 0 },
116106116594
{ 245, 1 },
116107
- { 148, 1 },
116108
- { 148, 4 },
116595
+ { 149, 1 },
116596
+ { 149, 4 },
116109116597
{ 246, 8 },
116110116598
{ 247, 1 },
116111116599
{ 247, 3 },
116112116600
{ 248, 0 },
116113116601
{ 248, 2 },
@@ -116115,10 +116603,15 @@
116115116603
{ 249, 3 },
116116116604
{ 250, 1 },
116117116605
{ 251, 0 },
116118116606
{ 251, 4 },
116119116607
{ 251, 2 },
116608
+ { 197, 0 },
116609
+ { 197, 2 },
116610
+ { 197, 3 },
116611
+ { 252, 6 },
116612
+ { 252, 8 },
116120116613
};
116121116614
116122116615
static void yy_accept(yyParser*); /* Forward Declaration */
116123116616
116124116617
/*
@@ -116182,21 +116675,21 @@
116182116675
break;
116183116676
case 8: /* cmdx ::= cmd */
116184116677
{ sqlite3FinishCoding(pParse); }
116185116678
break;
116186116679
case 9: /* cmd ::= BEGIN transtype trans_opt */
116187
-{sqlite3BeginTransaction(pParse, yymsp[-1].minor.yy4);}
116680
+{sqlite3BeginTransaction(pParse, yymsp[-1].minor.yy328);}
116188116681
break;
116189116682
case 13: /* transtype ::= */
116190
-{yygotominor.yy4 = TK_DEFERRED;}
116683
+{yygotominor.yy328 = TK_DEFERRED;}
116191116684
break;
116192116685
case 14: /* transtype ::= DEFERRED */
116193116686
case 15: /* transtype ::= IMMEDIATE */ yytestcase(yyruleno==15);
116194116687
case 16: /* transtype ::= EXCLUSIVE */ yytestcase(yyruleno==16);
116195
- case 117: /* multiselect_op ::= UNION */ yytestcase(yyruleno==117);
116196
- case 119: /* multiselect_op ::= EXCEPT|INTERSECT */ yytestcase(yyruleno==119);
116197
-{yygotominor.yy4 = yymsp[0].major;}
116688
+ case 115: /* multiselect_op ::= UNION */ yytestcase(yyruleno==115);
116689
+ case 117: /* multiselect_op ::= EXCEPT|INTERSECT */ yytestcase(yyruleno==117);
116690
+{yygotominor.yy328 = yymsp[0].major;}
116198116691
break;
116199116692
case 17: /* cmd ::= COMMIT trans_opt */
116200116693
case 18: /* cmd ::= END trans_opt */ yytestcase(yyruleno==18);
116201116694
{sqlite3CommitTransaction(pParse);}
116202116695
break;
@@ -116218,11 +116711,11 @@
116218116711
sqlite3Savepoint(pParse, SAVEPOINT_ROLLBACK, &yymsp[0].minor.yy0);
116219116712
}
116220116713
break;
116221116714
case 26: /* create_table ::= createkw temp TABLE ifnotexists nm dbnm */
116222116715
{
116223
- sqlite3StartTable(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,yymsp[-4].minor.yy4,0,0,yymsp[-2].minor.yy4);
116716
+ sqlite3StartTable(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,yymsp[-4].minor.yy328,0,0,yymsp[-2].minor.yy328);
116224116717
}
116225116718
break;
116226116719
case 27: /* createkw ::= CREATE */
116227116720
{
116228116721
pParse->db->lookaside.bEnabled = 0;
@@ -116229,49 +116722,49 @@
116229116722
yygotominor.yy0 = yymsp[0].minor.yy0;
116230116723
}
116231116724
break;
116232116725
case 28: /* ifnotexists ::= */
116233116726
case 31: /* temp ::= */ yytestcase(yyruleno==31);
116234
- case 71: /* autoinc ::= */ yytestcase(yyruleno==71);
116235
- case 84: /* defer_subclause ::= NOT DEFERRABLE init_deferred_pred_opt */ yytestcase(yyruleno==84);
116236
- case 86: /* init_deferred_pred_opt ::= */ yytestcase(yyruleno==86);
116237
- case 88: /* init_deferred_pred_opt ::= INITIALLY IMMEDIATE */ yytestcase(yyruleno==88);
116238
- case 100: /* defer_subclause_opt ::= */ yytestcase(yyruleno==100);
116239
- case 111: /* ifexists ::= */ yytestcase(yyruleno==111);
116240
- case 223: /* between_op ::= BETWEEN */ yytestcase(yyruleno==223);
116241
- case 226: /* in_op ::= IN */ yytestcase(yyruleno==226);
116242
-{yygotominor.yy4 = 0;}
116727
+ case 68: /* autoinc ::= */ yytestcase(yyruleno==68);
116728
+ case 81: /* defer_subclause ::= NOT DEFERRABLE init_deferred_pred_opt */ yytestcase(yyruleno==81);
116729
+ case 83: /* init_deferred_pred_opt ::= */ yytestcase(yyruleno==83);
116730
+ case 85: /* init_deferred_pred_opt ::= INITIALLY IMMEDIATE */ yytestcase(yyruleno==85);
116731
+ case 97: /* defer_subclause_opt ::= */ yytestcase(yyruleno==97);
116732
+ case 108: /* ifexists ::= */ yytestcase(yyruleno==108);
116733
+ case 218: /* between_op ::= BETWEEN */ yytestcase(yyruleno==218);
116734
+ case 221: /* in_op ::= IN */ yytestcase(yyruleno==221);
116735
+{yygotominor.yy328 = 0;}
116243116736
break;
116244116737
case 29: /* ifnotexists ::= IF NOT EXISTS */
116245116738
case 30: /* temp ::= TEMP */ yytestcase(yyruleno==30);
116246
- case 72: /* autoinc ::= AUTOINCR */ yytestcase(yyruleno==72);
116247
- case 87: /* init_deferred_pred_opt ::= INITIALLY DEFERRED */ yytestcase(yyruleno==87);
116248
- case 110: /* ifexists ::= IF EXISTS */ yytestcase(yyruleno==110);
116249
- case 224: /* between_op ::= NOT BETWEEN */ yytestcase(yyruleno==224);
116250
- case 227: /* in_op ::= NOT IN */ yytestcase(yyruleno==227);
116251
-{yygotominor.yy4 = 1;}
116739
+ case 69: /* autoinc ::= AUTOINCR */ yytestcase(yyruleno==69);
116740
+ case 84: /* init_deferred_pred_opt ::= INITIALLY DEFERRED */ yytestcase(yyruleno==84);
116741
+ case 107: /* ifexists ::= IF EXISTS */ yytestcase(yyruleno==107);
116742
+ case 219: /* between_op ::= NOT BETWEEN */ yytestcase(yyruleno==219);
116743
+ case 222: /* in_op ::= NOT IN */ yytestcase(yyruleno==222);
116744
+{yygotominor.yy328 = 1;}
116252116745
break;
116253116746
case 32: /* create_table_args ::= LP columnlist conslist_opt RP table_options */
116254116747
{
116255
- sqlite3EndTable(pParse,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0,yymsp[0].minor.yy210,0);
116748
+ sqlite3EndTable(pParse,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0,yymsp[0].minor.yy186,0);
116256116749
}
116257116750
break;
116258116751
case 33: /* create_table_args ::= AS select */
116259116752
{
116260
- sqlite3EndTable(pParse,0,0,0,yymsp[0].minor.yy387);
116261
- sqlite3SelectDelete(pParse->db, yymsp[0].minor.yy387);
116753
+ sqlite3EndTable(pParse,0,0,0,yymsp[0].minor.yy3);
116754
+ sqlite3SelectDelete(pParse->db, yymsp[0].minor.yy3);
116262116755
}
116263116756
break;
116264116757
case 34: /* table_options ::= */
116265
-{yygotominor.yy210 = 0;}
116758
+{yygotominor.yy186 = 0;}
116266116759
break;
116267116760
case 35: /* table_options ::= WITHOUT nm */
116268116761
{
116269116762
if( yymsp[0].minor.yy0.n==5 && sqlite3_strnicmp(yymsp[0].minor.yy0.z,"rowid",5)==0 ){
116270
- yygotominor.yy210 = TF_WithoutRowid;
116763
+ yygotominor.yy186 = TF_WithoutRowid;
116271116764
}else{
116272
- yygotominor.yy210 = 0;
116765
+ yygotominor.yy186 = 0;
116273116766
sqlite3ErrorMsg(pParse, "unknown table option: %.*s", yymsp[0].minor.yy0.n, yymsp[0].minor.yy0.z);
116274116767
}
116275116768
}
116276116769
break;
116277116770
case 38: /* column ::= columnid type carglist */
@@ -116285,1004 +116778,1016 @@
116285116778
sqlite3AddColumn(pParse,&yymsp[0].minor.yy0);
116286116779
yygotominor.yy0 = yymsp[0].minor.yy0;
116287116780
pParse->constraintName.n = 0;
116288116781
}
116289116782
break;
116290
- case 40: /* id ::= ID */
116291
- case 41: /* id ::= INDEXED */ yytestcase(yyruleno==41);
116292
- case 42: /* ids ::= ID|STRING */ yytestcase(yyruleno==42);
116293
- case 43: /* nm ::= id */ yytestcase(yyruleno==43);
116294
- case 44: /* nm ::= STRING */ yytestcase(yyruleno==44);
116295
- case 45: /* nm ::= JOIN_KW */ yytestcase(yyruleno==45);
116296
- case 48: /* typetoken ::= typename */ yytestcase(yyruleno==48);
116297
- case 51: /* typename ::= ids */ yytestcase(yyruleno==51);
116298
- case 129: /* as ::= AS nm */ yytestcase(yyruleno==129);
116299
- case 130: /* as ::= ids */ yytestcase(yyruleno==130);
116300
- case 140: /* dbnm ::= DOT nm */ yytestcase(yyruleno==140);
116301
- case 149: /* indexed_opt ::= INDEXED BY nm */ yytestcase(yyruleno==149);
116302
- case 252: /* collate ::= COLLATE ids */ yytestcase(yyruleno==252);
116303
- case 261: /* nmnum ::= plus_num */ yytestcase(yyruleno==261);
116304
- case 262: /* nmnum ::= nm */ yytestcase(yyruleno==262);
116305
- case 263: /* nmnum ::= ON */ yytestcase(yyruleno==263);
116306
- case 264: /* nmnum ::= DELETE */ yytestcase(yyruleno==264);
116307
- case 265: /* nmnum ::= DEFAULT */ yytestcase(yyruleno==265);
116308
- case 266: /* plus_num ::= PLUS number */ yytestcase(yyruleno==266);
116309
- case 267: /* plus_num ::= number */ yytestcase(yyruleno==267);
116310
- case 268: /* minus_num ::= MINUS number */ yytestcase(yyruleno==268);
116311
- case 269: /* number ::= INTEGER|FLOAT */ yytestcase(yyruleno==269);
116312
- case 285: /* trnm ::= nm */ yytestcase(yyruleno==285);
116783
+ case 40: /* nm ::= ID|INDEXED */
116784
+ case 41: /* nm ::= STRING */ yytestcase(yyruleno==41);
116785
+ case 42: /* nm ::= JOIN_KW */ yytestcase(yyruleno==42);
116786
+ case 45: /* typetoken ::= typename */ yytestcase(yyruleno==45);
116787
+ case 48: /* typename ::= ID|STRING */ yytestcase(yyruleno==48);
116788
+ case 130: /* as ::= AS nm */ yytestcase(yyruleno==130);
116789
+ case 131: /* as ::= ID|STRING */ yytestcase(yyruleno==131);
116790
+ case 141: /* dbnm ::= DOT nm */ yytestcase(yyruleno==141);
116791
+ case 150: /* indexed_opt ::= INDEXED BY nm */ yytestcase(yyruleno==150);
116792
+ case 247: /* collate ::= COLLATE ID|STRING */ yytestcase(yyruleno==247);
116793
+ case 256: /* nmnum ::= plus_num */ yytestcase(yyruleno==256);
116794
+ case 257: /* nmnum ::= nm */ yytestcase(yyruleno==257);
116795
+ case 258: /* nmnum ::= ON */ yytestcase(yyruleno==258);
116796
+ case 259: /* nmnum ::= DELETE */ yytestcase(yyruleno==259);
116797
+ case 260: /* nmnum ::= DEFAULT */ yytestcase(yyruleno==260);
116798
+ case 261: /* plus_num ::= PLUS INTEGER|FLOAT */ yytestcase(yyruleno==261);
116799
+ case 262: /* plus_num ::= INTEGER|FLOAT */ yytestcase(yyruleno==262);
116800
+ case 263: /* minus_num ::= MINUS INTEGER|FLOAT */ yytestcase(yyruleno==263);
116801
+ case 279: /* trnm ::= nm */ yytestcase(yyruleno==279);
116313116802
{yygotominor.yy0 = yymsp[0].minor.yy0;}
116314116803
break;
116315
- case 47: /* type ::= typetoken */
116804
+ case 44: /* type ::= typetoken */
116316116805
{sqlite3AddColumnType(pParse,&yymsp[0].minor.yy0);}
116317116806
break;
116318
- case 49: /* typetoken ::= typename LP signed RP */
116807
+ case 46: /* typetoken ::= typename LP signed RP */
116319116808
{
116320116809
yygotominor.yy0.z = yymsp[-3].minor.yy0.z;
116321116810
yygotominor.yy0.n = (int)(&yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n] - yymsp[-3].minor.yy0.z);
116322116811
}
116323116812
break;
116324
- case 50: /* typetoken ::= typename LP signed COMMA signed RP */
116813
+ case 47: /* typetoken ::= typename LP signed COMMA signed RP */
116325116814
{
116326116815
yygotominor.yy0.z = yymsp[-5].minor.yy0.z;
116327116816
yygotominor.yy0.n = (int)(&yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n] - yymsp[-5].minor.yy0.z);
116328116817
}
116329116818
break;
116330
- case 52: /* typename ::= typename ids */
116819
+ case 49: /* typename ::= typename ID|STRING */
116331116820
{yygotominor.yy0.z=yymsp[-1].minor.yy0.z; yygotominor.yy0.n=yymsp[0].minor.yy0.n+(int)(yymsp[0].minor.yy0.z-yymsp[-1].minor.yy0.z);}
116332116821
break;
116333
- case 57: /* ccons ::= CONSTRAINT nm */
116334
- case 95: /* tcons ::= CONSTRAINT nm */ yytestcase(yyruleno==95);
116822
+ case 54: /* ccons ::= CONSTRAINT nm */
116823
+ case 92: /* tcons ::= CONSTRAINT nm */ yytestcase(yyruleno==92);
116335116824
{pParse->constraintName = yymsp[0].minor.yy0;}
116336116825
break;
116337
- case 58: /* ccons ::= DEFAULT term */
116338
- case 60: /* ccons ::= DEFAULT PLUS term */ yytestcase(yyruleno==60);
116339
-{sqlite3AddDefaultValue(pParse,&yymsp[0].minor.yy118);}
116340
- break;
116341
- case 59: /* ccons ::= DEFAULT LP expr RP */
116342
-{sqlite3AddDefaultValue(pParse,&yymsp[-1].minor.yy118);}
116343
- break;
116344
- case 61: /* ccons ::= DEFAULT MINUS term */
116826
+ case 55: /* ccons ::= DEFAULT term */
116827
+ case 57: /* ccons ::= DEFAULT PLUS term */ yytestcase(yyruleno==57);
116828
+{sqlite3AddDefaultValue(pParse,&yymsp[0].minor.yy346);}
116829
+ break;
116830
+ case 56: /* ccons ::= DEFAULT LP expr RP */
116831
+{sqlite3AddDefaultValue(pParse,&yymsp[-1].minor.yy346);}
116832
+ break;
116833
+ case 58: /* ccons ::= DEFAULT MINUS term */
116345116834
{
116346116835
ExprSpan v;
116347
- v.pExpr = sqlite3PExpr(pParse, TK_UMINUS, yymsp[0].minor.yy118.pExpr, 0, 0);
116836
+ v.pExpr = sqlite3PExpr(pParse, TK_UMINUS, yymsp[0].minor.yy346.pExpr, 0, 0);
116348116837
v.zStart = yymsp[-1].minor.yy0.z;
116349
- v.zEnd = yymsp[0].minor.yy118.zEnd;
116838
+ v.zEnd = yymsp[0].minor.yy346.zEnd;
116350116839
sqlite3AddDefaultValue(pParse,&v);
116351116840
}
116352116841
break;
116353
- case 62: /* ccons ::= DEFAULT id */
116842
+ case 59: /* ccons ::= DEFAULT ID|INDEXED */
116354116843
{
116355116844
ExprSpan v;
116356116845
spanExpr(&v, pParse, TK_STRING, &yymsp[0].minor.yy0);
116357116846
sqlite3AddDefaultValue(pParse,&v);
116358116847
}
116359116848
break;
116360
- case 64: /* ccons ::= NOT NULL onconf */
116361
-{sqlite3AddNotNull(pParse, yymsp[0].minor.yy4);}
116362
- break;
116363
- case 65: /* ccons ::= PRIMARY KEY sortorder onconf autoinc */
116364
-{sqlite3AddPrimaryKey(pParse,0,yymsp[-1].minor.yy4,yymsp[0].minor.yy4,yymsp[-2].minor.yy4);}
116365
- break;
116366
- case 66: /* ccons ::= UNIQUE onconf */
116367
-{sqlite3CreateIndex(pParse,0,0,0,0,yymsp[0].minor.yy4,0,0,0,0);}
116368
- break;
116369
- case 67: /* ccons ::= CHECK LP expr RP */
116370
-{sqlite3AddCheckConstraint(pParse,yymsp[-1].minor.yy118.pExpr);}
116371
- break;
116372
- case 68: /* ccons ::= REFERENCES nm idxlist_opt refargs */
116373
-{sqlite3CreateForeignKey(pParse,0,&yymsp[-2].minor.yy0,yymsp[-1].minor.yy322,yymsp[0].minor.yy4);}
116374
- break;
116375
- case 69: /* ccons ::= defer_subclause */
116376
-{sqlite3DeferForeignKey(pParse,yymsp[0].minor.yy4);}
116377
- break;
116378
- case 70: /* ccons ::= COLLATE ids */
116849
+ case 61: /* ccons ::= NOT NULL onconf */
116850
+{sqlite3AddNotNull(pParse, yymsp[0].minor.yy328);}
116851
+ break;
116852
+ case 62: /* ccons ::= PRIMARY KEY sortorder onconf autoinc */
116853
+{sqlite3AddPrimaryKey(pParse,0,yymsp[-1].minor.yy328,yymsp[0].minor.yy328,yymsp[-2].minor.yy328);}
116854
+ break;
116855
+ case 63: /* ccons ::= UNIQUE onconf */
116856
+{sqlite3CreateIndex(pParse,0,0,0,0,yymsp[0].minor.yy328,0,0,0,0);}
116857
+ break;
116858
+ case 64: /* ccons ::= CHECK LP expr RP */
116859
+{sqlite3AddCheckConstraint(pParse,yymsp[-1].minor.yy346.pExpr);}
116860
+ break;
116861
+ case 65: /* ccons ::= REFERENCES nm idxlist_opt refargs */
116862
+{sqlite3CreateForeignKey(pParse,0,&yymsp[-2].minor.yy0,yymsp[-1].minor.yy14,yymsp[0].minor.yy328);}
116863
+ break;
116864
+ case 66: /* ccons ::= defer_subclause */
116865
+{sqlite3DeferForeignKey(pParse,yymsp[0].minor.yy328);}
116866
+ break;
116867
+ case 67: /* ccons ::= COLLATE ID|STRING */
116379116868
{sqlite3AddCollateType(pParse, &yymsp[0].minor.yy0);}
116380116869
break;
116381
- case 73: /* refargs ::= */
116382
-{ yygotominor.yy4 = OE_None*0x0101; /* EV: R-19803-45884 */}
116383
- break;
116384
- case 74: /* refargs ::= refargs refarg */
116385
-{ yygotominor.yy4 = (yymsp[-1].minor.yy4 & ~yymsp[0].minor.yy215.mask) | yymsp[0].minor.yy215.value; }
116386
- break;
116387
- case 75: /* refarg ::= MATCH nm */
116388
- case 76: /* refarg ::= ON INSERT refact */ yytestcase(yyruleno==76);
116389
-{ yygotominor.yy215.value = 0; yygotominor.yy215.mask = 0x000000; }
116390
- break;
116391
- case 77: /* refarg ::= ON DELETE refact */
116392
-{ yygotominor.yy215.value = yymsp[0].minor.yy4; yygotominor.yy215.mask = 0x0000ff; }
116393
- break;
116394
- case 78: /* refarg ::= ON UPDATE refact */
116395
-{ yygotominor.yy215.value = yymsp[0].minor.yy4<<8; yygotominor.yy215.mask = 0x00ff00; }
116396
- break;
116397
- case 79: /* refact ::= SET NULL */
116398
-{ yygotominor.yy4 = OE_SetNull; /* EV: R-33326-45252 */}
116399
- break;
116400
- case 80: /* refact ::= SET DEFAULT */
116401
-{ yygotominor.yy4 = OE_SetDflt; /* EV: R-33326-45252 */}
116402
- break;
116403
- case 81: /* refact ::= CASCADE */
116404
-{ yygotominor.yy4 = OE_Cascade; /* EV: R-33326-45252 */}
116405
- break;
116406
- case 82: /* refact ::= RESTRICT */
116407
-{ yygotominor.yy4 = OE_Restrict; /* EV: R-33326-45252 */}
116408
- break;
116409
- case 83: /* refact ::= NO ACTION */
116410
-{ yygotominor.yy4 = OE_None; /* EV: R-33326-45252 */}
116411
- break;
116412
- case 85: /* defer_subclause ::= DEFERRABLE init_deferred_pred_opt */
116413
- case 101: /* defer_subclause_opt ::= defer_subclause */ yytestcase(yyruleno==101);
116414
- case 103: /* onconf ::= ON CONFLICT resolvetype */ yytestcase(yyruleno==103);
116415
- case 106: /* resolvetype ::= raisetype */ yytestcase(yyruleno==106);
116416
-{yygotominor.yy4 = yymsp[0].minor.yy4;}
116417
- break;
116418
- case 89: /* conslist_opt ::= */
116870
+ case 70: /* refargs ::= */
116871
+{ yygotominor.yy328 = OE_None*0x0101; /* EV: R-19803-45884 */}
116872
+ break;
116873
+ case 71: /* refargs ::= refargs refarg */
116874
+{ yygotominor.yy328 = (yymsp[-1].minor.yy328 & ~yymsp[0].minor.yy429.mask) | yymsp[0].minor.yy429.value; }
116875
+ break;
116876
+ case 72: /* refarg ::= MATCH nm */
116877
+ case 73: /* refarg ::= ON INSERT refact */ yytestcase(yyruleno==73);
116878
+{ yygotominor.yy429.value = 0; yygotominor.yy429.mask = 0x000000; }
116879
+ break;
116880
+ case 74: /* refarg ::= ON DELETE refact */
116881
+{ yygotominor.yy429.value = yymsp[0].minor.yy328; yygotominor.yy429.mask = 0x0000ff; }
116882
+ break;
116883
+ case 75: /* refarg ::= ON UPDATE refact */
116884
+{ yygotominor.yy429.value = yymsp[0].minor.yy328<<8; yygotominor.yy429.mask = 0x00ff00; }
116885
+ break;
116886
+ case 76: /* refact ::= SET NULL */
116887
+{ yygotominor.yy328 = OE_SetNull; /* EV: R-33326-45252 */}
116888
+ break;
116889
+ case 77: /* refact ::= SET DEFAULT */
116890
+{ yygotominor.yy328 = OE_SetDflt; /* EV: R-33326-45252 */}
116891
+ break;
116892
+ case 78: /* refact ::= CASCADE */
116893
+{ yygotominor.yy328 = OE_Cascade; /* EV: R-33326-45252 */}
116894
+ break;
116895
+ case 79: /* refact ::= RESTRICT */
116896
+{ yygotominor.yy328 = OE_Restrict; /* EV: R-33326-45252 */}
116897
+ break;
116898
+ case 80: /* refact ::= NO ACTION */
116899
+{ yygotominor.yy328 = OE_None; /* EV: R-33326-45252 */}
116900
+ break;
116901
+ case 82: /* defer_subclause ::= DEFERRABLE init_deferred_pred_opt */
116902
+ case 98: /* defer_subclause_opt ::= defer_subclause */ yytestcase(yyruleno==98);
116903
+ case 100: /* onconf ::= ON CONFLICT resolvetype */ yytestcase(yyruleno==100);
116904
+ case 103: /* resolvetype ::= raisetype */ yytestcase(yyruleno==103);
116905
+{yygotominor.yy328 = yymsp[0].minor.yy328;}
116906
+ break;
116907
+ case 86: /* conslist_opt ::= */
116419116908
{yygotominor.yy0.n = 0; yygotominor.yy0.z = 0;}
116420116909
break;
116421
- case 90: /* conslist_opt ::= COMMA conslist */
116910
+ case 87: /* conslist_opt ::= COMMA conslist */
116422116911
{yygotominor.yy0 = yymsp[-1].minor.yy0;}
116423116912
break;
116424
- case 93: /* tconscomma ::= COMMA */
116913
+ case 90: /* tconscomma ::= COMMA */
116425116914
{pParse->constraintName.n = 0;}
116426116915
break;
116427
- case 96: /* tcons ::= PRIMARY KEY LP idxlist autoinc RP onconf */
116428
-{sqlite3AddPrimaryKey(pParse,yymsp[-3].minor.yy322,yymsp[0].minor.yy4,yymsp[-2].minor.yy4,0);}
116429
- break;
116430
- case 97: /* tcons ::= UNIQUE LP idxlist RP onconf */
116431
-{sqlite3CreateIndex(pParse,0,0,0,yymsp[-2].minor.yy322,yymsp[0].minor.yy4,0,0,0,0);}
116432
- break;
116433
- case 98: /* tcons ::= CHECK LP expr RP onconf */
116434
-{sqlite3AddCheckConstraint(pParse,yymsp[-2].minor.yy118.pExpr);}
116435
- break;
116436
- case 99: /* tcons ::= FOREIGN KEY LP idxlist RP REFERENCES nm idxlist_opt refargs defer_subclause_opt */
116437
-{
116438
- sqlite3CreateForeignKey(pParse, yymsp[-6].minor.yy322, &yymsp[-3].minor.yy0, yymsp[-2].minor.yy322, yymsp[-1].minor.yy4);
116439
- sqlite3DeferForeignKey(pParse, yymsp[0].minor.yy4);
116440
-}
116441
- break;
116442
- case 102: /* onconf ::= */
116443
-{yygotominor.yy4 = OE_Default;}
116444
- break;
116445
- case 104: /* orconf ::= */
116446
-{yygotominor.yy210 = OE_Default;}
116447
- break;
116448
- case 105: /* orconf ::= OR resolvetype */
116449
-{yygotominor.yy210 = (u8)yymsp[0].minor.yy4;}
116450
- break;
116451
- case 107: /* resolvetype ::= IGNORE */
116452
-{yygotominor.yy4 = OE_Ignore;}
116453
- break;
116454
- case 108: /* resolvetype ::= REPLACE */
116455
-{yygotominor.yy4 = OE_Replace;}
116456
- break;
116457
- case 109: /* cmd ::= DROP TABLE ifexists fullname */
116458
-{
116459
- sqlite3DropTable(pParse, yymsp[0].minor.yy259, 0, yymsp[-1].minor.yy4);
116460
-}
116461
- break;
116462
- case 112: /* cmd ::= createkw temp VIEW ifnotexists nm dbnm AS select */
116463
-{
116464
- sqlite3CreateView(pParse, &yymsp[-7].minor.yy0, &yymsp[-3].minor.yy0, &yymsp[-2].minor.yy0, yymsp[0].minor.yy387, yymsp[-6].minor.yy4, yymsp[-4].minor.yy4);
116465
-}
116466
- break;
116467
- case 113: /* cmd ::= DROP VIEW ifexists fullname */
116468
-{
116469
- sqlite3DropTable(pParse, yymsp[0].minor.yy259, 1, yymsp[-1].minor.yy4);
116470
-}
116471
- break;
116472
- case 114: /* cmd ::= select */
116916
+ case 93: /* tcons ::= PRIMARY KEY LP idxlist autoinc RP onconf */
116917
+{sqlite3AddPrimaryKey(pParse,yymsp[-3].minor.yy14,yymsp[0].minor.yy328,yymsp[-2].minor.yy328,0);}
116918
+ break;
116919
+ case 94: /* tcons ::= UNIQUE LP idxlist RP onconf */
116920
+{sqlite3CreateIndex(pParse,0,0,0,yymsp[-2].minor.yy14,yymsp[0].minor.yy328,0,0,0,0);}
116921
+ break;
116922
+ case 95: /* tcons ::= CHECK LP expr RP onconf */
116923
+{sqlite3AddCheckConstraint(pParse,yymsp[-2].minor.yy346.pExpr);}
116924
+ break;
116925
+ case 96: /* tcons ::= FOREIGN KEY LP idxlist RP REFERENCES nm idxlist_opt refargs defer_subclause_opt */
116926
+{
116927
+ sqlite3CreateForeignKey(pParse, yymsp[-6].minor.yy14, &yymsp[-3].minor.yy0, yymsp[-2].minor.yy14, yymsp[-1].minor.yy328);
116928
+ sqlite3DeferForeignKey(pParse, yymsp[0].minor.yy328);
116929
+}
116930
+ break;
116931
+ case 99: /* onconf ::= */
116932
+{yygotominor.yy328 = OE_Default;}
116933
+ break;
116934
+ case 101: /* orconf ::= */
116935
+{yygotominor.yy186 = OE_Default;}
116936
+ break;
116937
+ case 102: /* orconf ::= OR resolvetype */
116938
+{yygotominor.yy186 = (u8)yymsp[0].minor.yy328;}
116939
+ break;
116940
+ case 104: /* resolvetype ::= IGNORE */
116941
+{yygotominor.yy328 = OE_Ignore;}
116942
+ break;
116943
+ case 105: /* resolvetype ::= REPLACE */
116944
+{yygotominor.yy328 = OE_Replace;}
116945
+ break;
116946
+ case 106: /* cmd ::= DROP TABLE ifexists fullname */
116947
+{
116948
+ sqlite3DropTable(pParse, yymsp[0].minor.yy65, 0, yymsp[-1].minor.yy328);
116949
+}
116950
+ break;
116951
+ case 109: /* cmd ::= createkw temp VIEW ifnotexists nm dbnm AS select */
116952
+{
116953
+ sqlite3CreateView(pParse, &yymsp[-7].minor.yy0, &yymsp[-3].minor.yy0, &yymsp[-2].minor.yy0, yymsp[0].minor.yy3, yymsp[-6].minor.yy328, yymsp[-4].minor.yy328);
116954
+}
116955
+ break;
116956
+ case 110: /* cmd ::= DROP VIEW ifexists fullname */
116957
+{
116958
+ sqlite3DropTable(pParse, yymsp[0].minor.yy65, 1, yymsp[-1].minor.yy328);
116959
+}
116960
+ break;
116961
+ case 111: /* cmd ::= select */
116473116962
{
116474116963
SelectDest dest = {SRT_Output, 0, 0, 0, 0};
116475
- sqlite3Select(pParse, yymsp[0].minor.yy387, &dest);
116964
+ sqlite3Select(pParse, yymsp[0].minor.yy3, &dest);
116476116965
sqlite3ExplainBegin(pParse->pVdbe);
116477
- sqlite3ExplainSelect(pParse->pVdbe, yymsp[0].minor.yy387);
116966
+ sqlite3ExplainSelect(pParse->pVdbe, yymsp[0].minor.yy3);
116478116967
sqlite3ExplainFinish(pParse->pVdbe);
116479
- sqlite3SelectDelete(pParse->db, yymsp[0].minor.yy387);
116480
-}
116481
- break;
116482
- case 115: /* select ::= oneselect */
116483
-{yygotominor.yy387 = yymsp[0].minor.yy387;}
116484
- break;
116485
- case 116: /* select ::= select multiselect_op oneselect */
116486
-{
116487
- if( yymsp[0].minor.yy387 ){
116488
- yymsp[0].minor.yy387->op = (u8)yymsp[-1].minor.yy4;
116489
- yymsp[0].minor.yy387->pPrior = yymsp[-2].minor.yy387;
116490
- if( yymsp[-1].minor.yy4!=TK_ALL ) pParse->hasCompound = 1;
116491
- }else{
116492
- sqlite3SelectDelete(pParse->db, yymsp[-2].minor.yy387);
116493
- }
116494
- yygotominor.yy387 = yymsp[0].minor.yy387;
116495
-}
116496
- break;
116497
- case 118: /* multiselect_op ::= UNION ALL */
116498
-{yygotominor.yy4 = TK_ALL;}
116499
- break;
116500
- case 120: /* oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt orderby_opt limit_opt */
116501
-{
116502
- yygotominor.yy387 = sqlite3SelectNew(pParse,yymsp[-6].minor.yy322,yymsp[-5].minor.yy259,yymsp[-4].minor.yy314,yymsp[-3].minor.yy322,yymsp[-2].minor.yy314,yymsp[-1].minor.yy322,yymsp[-7].minor.yy177,yymsp[0].minor.yy292.pLimit,yymsp[0].minor.yy292.pOffset);
116503
-}
116504
- break;
116505
- case 121: /* distinct ::= DISTINCT */
116506
-{yygotominor.yy177 = SF_Distinct;}
116507
- break;
116508
- case 122: /* distinct ::= ALL */
116509
- case 123: /* distinct ::= */ yytestcase(yyruleno==123);
116510
-{yygotominor.yy177 = 0;}
116511
- break;
116512
- case 124: /* sclp ::= selcollist COMMA */
116513
- case 248: /* idxlist_opt ::= LP idxlist RP */ yytestcase(yyruleno==248);
116514
-{yygotominor.yy322 = yymsp[-1].minor.yy322;}
116515
- break;
116516
- case 125: /* sclp ::= */
116517
- case 153: /* orderby_opt ::= */ yytestcase(yyruleno==153);
116518
- case 160: /* groupby_opt ::= */ yytestcase(yyruleno==160);
116519
- case 241: /* exprlist ::= */ yytestcase(yyruleno==241);
116520
- case 247: /* idxlist_opt ::= */ yytestcase(yyruleno==247);
116521
-{yygotominor.yy322 = 0;}
116522
- break;
116523
- case 126: /* selcollist ::= sclp expr as */
116524
-{
116525
- yygotominor.yy322 = sqlite3ExprListAppend(pParse, yymsp[-2].minor.yy322, yymsp[-1].minor.yy118.pExpr);
116526
- if( yymsp[0].minor.yy0.n>0 ) sqlite3ExprListSetName(pParse, yygotominor.yy322, &yymsp[0].minor.yy0, 1);
116527
- sqlite3ExprListSetSpan(pParse,yygotominor.yy322,&yymsp[-1].minor.yy118);
116528
-}
116529
- break;
116530
- case 127: /* selcollist ::= sclp STAR */
116968
+ sqlite3SelectDelete(pParse->db, yymsp[0].minor.yy3);
116969
+}
116970
+ break;
116971
+ case 112: /* select ::= with selectnowith */
116972
+{
116973
+ if( yymsp[0].minor.yy3 ){
116974
+ yymsp[0].minor.yy3->pWith = yymsp[-1].minor.yy59;
116975
+ }else{
116976
+ sqlite3WithDelete(pParse->db, yymsp[-1].minor.yy59);
116977
+ }
116978
+ yygotominor.yy3 = yymsp[0].minor.yy3;
116979
+}
116980
+ break;
116981
+ case 113: /* selectnowith ::= oneselect */
116982
+ case 119: /* oneselect ::= values */ yytestcase(yyruleno==119);
116983
+{yygotominor.yy3 = yymsp[0].minor.yy3;}
116984
+ break;
116985
+ case 114: /* selectnowith ::= selectnowith multiselect_op oneselect */
116986
+{
116987
+ if( yymsp[0].minor.yy3 ){
116988
+ yymsp[0].minor.yy3->op = (u8)yymsp[-1].minor.yy328;
116989
+ yymsp[0].minor.yy3->pPrior = yymsp[-2].minor.yy3;
116990
+ if( yymsp[-1].minor.yy328!=TK_ALL ) pParse->hasCompound = 1;
116991
+ }else{
116992
+ sqlite3SelectDelete(pParse->db, yymsp[-2].minor.yy3);
116993
+ }
116994
+ yygotominor.yy3 = yymsp[0].minor.yy3;
116995
+}
116996
+ break;
116997
+ case 116: /* multiselect_op ::= UNION ALL */
116998
+{yygotominor.yy328 = TK_ALL;}
116999
+ break;
117000
+ case 118: /* oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt orderby_opt limit_opt */
117001
+{
117002
+ yygotominor.yy3 = sqlite3SelectNew(pParse,yymsp[-6].minor.yy14,yymsp[-5].minor.yy65,yymsp[-4].minor.yy132,yymsp[-3].minor.yy14,yymsp[-2].minor.yy132,yymsp[-1].minor.yy14,yymsp[-7].minor.yy381,yymsp[0].minor.yy476.pLimit,yymsp[0].minor.yy476.pOffset);
117003
+}
117004
+ break;
117005
+ case 120: /* values ::= VALUES LP nexprlist RP */
117006
+{
117007
+ yygotominor.yy3 = sqlite3SelectNew(pParse,yymsp[-1].minor.yy14,0,0,0,0,0,SF_Values,0,0);
117008
+}
117009
+ break;
117010
+ case 121: /* values ::= values COMMA LP exprlist RP */
117011
+{
117012
+ Select *pRight = sqlite3SelectNew(pParse,yymsp[-1].minor.yy14,0,0,0,0,0,SF_Values,0,0);
117013
+ if( pRight ){
117014
+ pRight->op = TK_ALL;
117015
+ pRight->pPrior = yymsp[-4].minor.yy3;
117016
+ yygotominor.yy3 = pRight;
117017
+ }else{
117018
+ yygotominor.yy3 = yymsp[-4].minor.yy3;
117019
+ }
117020
+}
117021
+ break;
117022
+ case 122: /* distinct ::= DISTINCT */
117023
+{yygotominor.yy381 = SF_Distinct;}
117024
+ break;
117025
+ case 123: /* distinct ::= ALL */
117026
+ case 124: /* distinct ::= */ yytestcase(yyruleno==124);
117027
+{yygotominor.yy381 = 0;}
117028
+ break;
117029
+ case 125: /* sclp ::= selcollist COMMA */
117030
+ case 243: /* idxlist_opt ::= LP idxlist RP */ yytestcase(yyruleno==243);
117031
+{yygotominor.yy14 = yymsp[-1].minor.yy14;}
117032
+ break;
117033
+ case 126: /* sclp ::= */
117034
+ case 154: /* orderby_opt ::= */ yytestcase(yyruleno==154);
117035
+ case 161: /* groupby_opt ::= */ yytestcase(yyruleno==161);
117036
+ case 236: /* exprlist ::= */ yytestcase(yyruleno==236);
117037
+ case 242: /* idxlist_opt ::= */ yytestcase(yyruleno==242);
117038
+{yygotominor.yy14 = 0;}
117039
+ break;
117040
+ case 127: /* selcollist ::= sclp expr as */
117041
+{
117042
+ yygotominor.yy14 = sqlite3ExprListAppend(pParse, yymsp[-2].minor.yy14, yymsp[-1].minor.yy346.pExpr);
117043
+ if( yymsp[0].minor.yy0.n>0 ) sqlite3ExprListSetName(pParse, yygotominor.yy14, &yymsp[0].minor.yy0, 1);
117044
+ sqlite3ExprListSetSpan(pParse,yygotominor.yy14,&yymsp[-1].minor.yy346);
117045
+}
117046
+ break;
117047
+ case 128: /* selcollist ::= sclp STAR */
116531117048
{
116532117049
Expr *p = sqlite3Expr(pParse->db, TK_ALL, 0);
116533
- yygotominor.yy322 = sqlite3ExprListAppend(pParse, yymsp[-1].minor.yy322, p);
117050
+ yygotominor.yy14 = sqlite3ExprListAppend(pParse, yymsp[-1].minor.yy14, p);
116534117051
}
116535117052
break;
116536
- case 128: /* selcollist ::= sclp nm DOT STAR */
117053
+ case 129: /* selcollist ::= sclp nm DOT STAR */
116537117054
{
116538117055
Expr *pRight = sqlite3PExpr(pParse, TK_ALL, 0, 0, &yymsp[0].minor.yy0);
116539117056
Expr *pLeft = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-2].minor.yy0);
116540117057
Expr *pDot = sqlite3PExpr(pParse, TK_DOT, pLeft, pRight, 0);
116541
- yygotominor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-3].minor.yy322, pDot);
117058
+ yygotominor.yy14 = sqlite3ExprListAppend(pParse,yymsp[-3].minor.yy14, pDot);
116542117059
}
116543117060
break;
116544
- case 131: /* as ::= */
117061
+ case 132: /* as ::= */
116545117062
{yygotominor.yy0.n = 0;}
116546117063
break;
116547
- case 132: /* from ::= */
116548
-{yygotominor.yy259 = sqlite3DbMallocZero(pParse->db, sizeof(*yygotominor.yy259));}
116549
- break;
116550
- case 133: /* from ::= FROM seltablist */
116551
-{
116552
- yygotominor.yy259 = yymsp[0].minor.yy259;
116553
- sqlite3SrcListShiftJoinType(yygotominor.yy259);
116554
-}
116555
- break;
116556
- case 134: /* stl_prefix ::= seltablist joinop */
116557
-{
116558
- yygotominor.yy259 = yymsp[-1].minor.yy259;
116559
- if( ALWAYS(yygotominor.yy259 && yygotominor.yy259->nSrc>0) ) yygotominor.yy259->a[yygotominor.yy259->nSrc-1].jointype = (u8)yymsp[0].minor.yy4;
116560
-}
116561
- break;
116562
- case 135: /* stl_prefix ::= */
116563
-{yygotominor.yy259 = 0;}
116564
- break;
116565
- case 136: /* seltablist ::= stl_prefix nm dbnm as indexed_opt on_opt using_opt */
116566
-{
116567
- yygotominor.yy259 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy259,&yymsp[-5].minor.yy0,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,0,yymsp[-1].minor.yy314,yymsp[0].minor.yy384);
116568
- sqlite3SrcListIndexedBy(pParse, yygotominor.yy259, &yymsp[-2].minor.yy0);
116569
-}
116570
- break;
116571
- case 137: /* seltablist ::= stl_prefix LP select RP as on_opt using_opt */
116572
-{
116573
- yygotominor.yy259 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy259,0,0,&yymsp[-2].minor.yy0,yymsp[-4].minor.yy387,yymsp[-1].minor.yy314,yymsp[0].minor.yy384);
116574
- }
116575
- break;
116576
- case 138: /* seltablist ::= stl_prefix LP seltablist RP as on_opt using_opt */
116577
-{
116578
- if( yymsp[-6].minor.yy259==0 && yymsp[-2].minor.yy0.n==0 && yymsp[-1].minor.yy314==0 && yymsp[0].minor.yy384==0 ){
116579
- yygotominor.yy259 = yymsp[-4].minor.yy259;
116580
- }else if( yymsp[-4].minor.yy259->nSrc==1 ){
116581
- yygotominor.yy259 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy259,0,0,&yymsp[-2].minor.yy0,0,yymsp[-1].minor.yy314,yymsp[0].minor.yy384);
116582
- if( yygotominor.yy259 ){
116583
- struct SrcList_item *pNew = &yygotominor.yy259->a[yygotominor.yy259->nSrc-1];
116584
- struct SrcList_item *pOld = yymsp[-4].minor.yy259->a;
117064
+ case 133: /* from ::= */
117065
+{yygotominor.yy65 = sqlite3DbMallocZero(pParse->db, sizeof(*yygotominor.yy65));}
117066
+ break;
117067
+ case 134: /* from ::= FROM seltablist */
117068
+{
117069
+ yygotominor.yy65 = yymsp[0].minor.yy65;
117070
+ sqlite3SrcListShiftJoinType(yygotominor.yy65);
117071
+}
117072
+ break;
117073
+ case 135: /* stl_prefix ::= seltablist joinop */
117074
+{
117075
+ yygotominor.yy65 = yymsp[-1].minor.yy65;
117076
+ if( ALWAYS(yygotominor.yy65 && yygotominor.yy65->nSrc>0) ) yygotominor.yy65->a[yygotominor.yy65->nSrc-1].jointype = (u8)yymsp[0].minor.yy328;
117077
+}
117078
+ break;
117079
+ case 136: /* stl_prefix ::= */
117080
+{yygotominor.yy65 = 0;}
117081
+ break;
117082
+ case 137: /* seltablist ::= stl_prefix nm dbnm as indexed_opt on_opt using_opt */
117083
+{
117084
+ yygotominor.yy65 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy65,&yymsp[-5].minor.yy0,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,0,yymsp[-1].minor.yy132,yymsp[0].minor.yy408);
117085
+ sqlite3SrcListIndexedBy(pParse, yygotominor.yy65, &yymsp[-2].minor.yy0);
117086
+}
117087
+ break;
117088
+ case 138: /* seltablist ::= stl_prefix LP select RP as on_opt using_opt */
117089
+{
117090
+ yygotominor.yy65 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy65,0,0,&yymsp[-2].minor.yy0,yymsp[-4].minor.yy3,yymsp[-1].minor.yy132,yymsp[0].minor.yy408);
117091
+ }
117092
+ break;
117093
+ case 139: /* seltablist ::= stl_prefix LP seltablist RP as on_opt using_opt */
117094
+{
117095
+ if( yymsp[-6].minor.yy65==0 && yymsp[-2].minor.yy0.n==0 && yymsp[-1].minor.yy132==0 && yymsp[0].minor.yy408==0 ){
117096
+ yygotominor.yy65 = yymsp[-4].minor.yy65;
117097
+ }else if( yymsp[-4].minor.yy65->nSrc==1 ){
117098
+ yygotominor.yy65 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy65,0,0,&yymsp[-2].minor.yy0,0,yymsp[-1].minor.yy132,yymsp[0].minor.yy408);
117099
+ if( yygotominor.yy65 ){
117100
+ struct SrcList_item *pNew = &yygotominor.yy65->a[yygotominor.yy65->nSrc-1];
117101
+ struct SrcList_item *pOld = yymsp[-4].minor.yy65->a;
116585117102
pNew->zName = pOld->zName;
116586117103
pNew->zDatabase = pOld->zDatabase;
116587117104
pNew->pSelect = pOld->pSelect;
116588117105
pOld->zName = pOld->zDatabase = 0;
116589117106
pOld->pSelect = 0;
116590117107
}
116591
- sqlite3SrcListDelete(pParse->db, yymsp[-4].minor.yy259);
117108
+ sqlite3SrcListDelete(pParse->db, yymsp[-4].minor.yy65);
116592117109
}else{
116593117110
Select *pSubquery;
116594
- sqlite3SrcListShiftJoinType(yymsp[-4].minor.yy259);
116595
- pSubquery = sqlite3SelectNew(pParse,0,yymsp[-4].minor.yy259,0,0,0,0,SF_NestedFrom,0,0);
116596
- yygotominor.yy259 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy259,0,0,&yymsp[-2].minor.yy0,pSubquery,yymsp[-1].minor.yy314,yymsp[0].minor.yy384);
117111
+ sqlite3SrcListShiftJoinType(yymsp[-4].minor.yy65);
117112
+ pSubquery = sqlite3SelectNew(pParse,0,yymsp[-4].minor.yy65,0,0,0,0,SF_NestedFrom,0,0);
117113
+ yygotominor.yy65 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy65,0,0,&yymsp[-2].minor.yy0,pSubquery,yymsp[-1].minor.yy132,yymsp[0].minor.yy408);
116597117114
}
116598117115
}
116599117116
break;
116600
- case 139: /* dbnm ::= */
116601
- case 148: /* indexed_opt ::= */ yytestcase(yyruleno==148);
117117
+ case 140: /* dbnm ::= */
117118
+ case 149: /* indexed_opt ::= */ yytestcase(yyruleno==149);
116602117119
{yygotominor.yy0.z=0; yygotominor.yy0.n=0;}
116603117120
break;
116604
- case 141: /* fullname ::= nm dbnm */
116605
-{yygotominor.yy259 = sqlite3SrcListAppend(pParse->db,0,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0);}
116606
- break;
116607
- case 142: /* joinop ::= COMMA|JOIN */
116608
-{ yygotominor.yy4 = JT_INNER; }
116609
- break;
116610
- case 143: /* joinop ::= JOIN_KW JOIN */
116611
-{ yygotominor.yy4 = sqlite3JoinType(pParse,&yymsp[-1].minor.yy0,0,0); }
116612
- break;
116613
- case 144: /* joinop ::= JOIN_KW nm JOIN */
116614
-{ yygotominor.yy4 = sqlite3JoinType(pParse,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0,0); }
116615
- break;
116616
- case 145: /* joinop ::= JOIN_KW nm nm JOIN */
116617
-{ yygotominor.yy4 = sqlite3JoinType(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0); }
116618
- break;
116619
- case 146: /* on_opt ::= ON expr */
116620
- case 163: /* having_opt ::= HAVING expr */ yytestcase(yyruleno==163);
116621
- case 170: /* where_opt ::= WHERE expr */ yytestcase(yyruleno==170);
116622
- case 236: /* case_else ::= ELSE expr */ yytestcase(yyruleno==236);
116623
- case 238: /* case_operand ::= expr */ yytestcase(yyruleno==238);
116624
-{yygotominor.yy314 = yymsp[0].minor.yy118.pExpr;}
116625
- break;
116626
- case 147: /* on_opt ::= */
116627
- case 162: /* having_opt ::= */ yytestcase(yyruleno==162);
116628
- case 169: /* where_opt ::= */ yytestcase(yyruleno==169);
116629
- case 237: /* case_else ::= */ yytestcase(yyruleno==237);
116630
- case 239: /* case_operand ::= */ yytestcase(yyruleno==239);
116631
-{yygotominor.yy314 = 0;}
116632
- break;
116633
- case 150: /* indexed_opt ::= NOT INDEXED */
117121
+ case 142: /* fullname ::= nm dbnm */
117122
+{yygotominor.yy65 = sqlite3SrcListAppend(pParse->db,0,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0);}
117123
+ break;
117124
+ case 143: /* joinop ::= COMMA|JOIN */
117125
+{ yygotominor.yy328 = JT_INNER; }
117126
+ break;
117127
+ case 144: /* joinop ::= JOIN_KW JOIN */
117128
+{ yygotominor.yy328 = sqlite3JoinType(pParse,&yymsp[-1].minor.yy0,0,0); }
117129
+ break;
117130
+ case 145: /* joinop ::= JOIN_KW nm JOIN */
117131
+{ yygotominor.yy328 = sqlite3JoinType(pParse,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0,0); }
117132
+ break;
117133
+ case 146: /* joinop ::= JOIN_KW nm nm JOIN */
117134
+{ yygotominor.yy328 = sqlite3JoinType(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0); }
117135
+ break;
117136
+ case 147: /* on_opt ::= ON expr */
117137
+ case 164: /* having_opt ::= HAVING expr */ yytestcase(yyruleno==164);
117138
+ case 171: /* where_opt ::= WHERE expr */ yytestcase(yyruleno==171);
117139
+ case 231: /* case_else ::= ELSE expr */ yytestcase(yyruleno==231);
117140
+ case 233: /* case_operand ::= expr */ yytestcase(yyruleno==233);
117141
+{yygotominor.yy132 = yymsp[0].minor.yy346.pExpr;}
117142
+ break;
117143
+ case 148: /* on_opt ::= */
117144
+ case 163: /* having_opt ::= */ yytestcase(yyruleno==163);
117145
+ case 170: /* where_opt ::= */ yytestcase(yyruleno==170);
117146
+ case 232: /* case_else ::= */ yytestcase(yyruleno==232);
117147
+ case 234: /* case_operand ::= */ yytestcase(yyruleno==234);
117148
+{yygotominor.yy132 = 0;}
117149
+ break;
117150
+ case 151: /* indexed_opt ::= NOT INDEXED */
116634117151
{yygotominor.yy0.z=0; yygotominor.yy0.n=1;}
116635117152
break;
116636
- case 151: /* using_opt ::= USING LP idlist RP */
116637
- case 182: /* inscollist_opt ::= LP idlist RP */ yytestcase(yyruleno==182);
116638
-{yygotominor.yy384 = yymsp[-1].minor.yy384;}
116639
- break;
116640
- case 152: /* using_opt ::= */
116641
- case 181: /* inscollist_opt ::= */ yytestcase(yyruleno==181);
116642
-{yygotominor.yy384 = 0;}
116643
- break;
116644
- case 154: /* orderby_opt ::= ORDER BY sortlist */
116645
- case 161: /* groupby_opt ::= GROUP BY nexprlist */ yytestcase(yyruleno==161);
116646
- case 240: /* exprlist ::= nexprlist */ yytestcase(yyruleno==240);
116647
-{yygotominor.yy322 = yymsp[0].minor.yy322;}
116648
- break;
116649
- case 155: /* sortlist ::= sortlist COMMA expr sortorder */
116650
-{
116651
- yygotominor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-3].minor.yy322,yymsp[-1].minor.yy118.pExpr);
116652
- if( yygotominor.yy322 ) yygotominor.yy322->a[yygotominor.yy322->nExpr-1].sortOrder = (u8)yymsp[0].minor.yy4;
116653
-}
116654
- break;
116655
- case 156: /* sortlist ::= expr sortorder */
116656
-{
116657
- yygotominor.yy322 = sqlite3ExprListAppend(pParse,0,yymsp[-1].minor.yy118.pExpr);
116658
- if( yygotominor.yy322 && ALWAYS(yygotominor.yy322->a) ) yygotominor.yy322->a[0].sortOrder = (u8)yymsp[0].minor.yy4;
116659
-}
116660
- break;
116661
- case 157: /* sortorder ::= ASC */
116662
- case 159: /* sortorder ::= */ yytestcase(yyruleno==159);
116663
-{yygotominor.yy4 = SQLITE_SO_ASC;}
116664
- break;
116665
- case 158: /* sortorder ::= DESC */
116666
-{yygotominor.yy4 = SQLITE_SO_DESC;}
116667
- break;
116668
- case 164: /* limit_opt ::= */
116669
-{yygotominor.yy292.pLimit = 0; yygotominor.yy292.pOffset = 0;}
116670
- break;
116671
- case 165: /* limit_opt ::= LIMIT expr */
116672
-{yygotominor.yy292.pLimit = yymsp[0].minor.yy118.pExpr; yygotominor.yy292.pOffset = 0;}
116673
- break;
116674
- case 166: /* limit_opt ::= LIMIT expr OFFSET expr */
116675
-{yygotominor.yy292.pLimit = yymsp[-2].minor.yy118.pExpr; yygotominor.yy292.pOffset = yymsp[0].minor.yy118.pExpr;}
116676
- break;
116677
- case 167: /* limit_opt ::= LIMIT expr COMMA expr */
116678
-{yygotominor.yy292.pOffset = yymsp[-2].minor.yy118.pExpr; yygotominor.yy292.pLimit = yymsp[0].minor.yy118.pExpr;}
116679
- break;
116680
- case 168: /* cmd ::= DELETE FROM fullname indexed_opt where_opt */
116681
-{
116682
- sqlite3SrcListIndexedBy(pParse, yymsp[-2].minor.yy259, &yymsp[-1].minor.yy0);
116683
- sqlite3DeleteFrom(pParse,yymsp[-2].minor.yy259,yymsp[0].minor.yy314);
116684
-}
116685
- break;
116686
- case 171: /* cmd ::= UPDATE orconf fullname indexed_opt SET setlist where_opt */
116687
-{
116688
- sqlite3SrcListIndexedBy(pParse, yymsp[-4].minor.yy259, &yymsp[-3].minor.yy0);
116689
- sqlite3ExprListCheckLength(pParse,yymsp[-1].minor.yy322,"set list");
116690
- sqlite3Update(pParse,yymsp[-4].minor.yy259,yymsp[-1].minor.yy322,yymsp[0].minor.yy314,yymsp[-5].minor.yy210);
116691
-}
116692
- break;
116693
- case 172: /* setlist ::= setlist COMMA nm EQ expr */
116694
-{
116695
- yygotominor.yy322 = sqlite3ExprListAppend(pParse, yymsp[-4].minor.yy322, yymsp[0].minor.yy118.pExpr);
116696
- sqlite3ExprListSetName(pParse, yygotominor.yy322, &yymsp[-2].minor.yy0, 1);
116697
-}
116698
- break;
116699
- case 173: /* setlist ::= nm EQ expr */
116700
-{
116701
- yygotominor.yy322 = sqlite3ExprListAppend(pParse, 0, yymsp[0].minor.yy118.pExpr);
116702
- sqlite3ExprListSetName(pParse, yygotominor.yy322, &yymsp[-2].minor.yy0, 1);
116703
-}
116704
- break;
116705
- case 174: /* cmd ::= insert_cmd INTO fullname inscollist_opt valuelist */
116706
-{sqlite3Insert(pParse, yymsp[-2].minor.yy259, yymsp[0].minor.yy260.pList, yymsp[0].minor.yy260.pSelect, yymsp[-1].minor.yy384, yymsp[-4].minor.yy210);}
116707
- break;
116708
- case 175: /* cmd ::= insert_cmd INTO fullname inscollist_opt select */
116709
-{sqlite3Insert(pParse, yymsp[-2].minor.yy259, 0, yymsp[0].minor.yy387, yymsp[-1].minor.yy384, yymsp[-4].minor.yy210);}
116710
- break;
116711
- case 176: /* cmd ::= insert_cmd INTO fullname inscollist_opt DEFAULT VALUES */
116712
-{sqlite3Insert(pParse, yymsp[-3].minor.yy259, 0, 0, yymsp[-2].minor.yy384, yymsp[-5].minor.yy210);}
117153
+ case 152: /* using_opt ::= USING LP idlist RP */
117154
+ case 180: /* inscollist_opt ::= LP idlist RP */ yytestcase(yyruleno==180);
117155
+{yygotominor.yy408 = yymsp[-1].minor.yy408;}
117156
+ break;
117157
+ case 153: /* using_opt ::= */
117158
+ case 179: /* inscollist_opt ::= */ yytestcase(yyruleno==179);
117159
+{yygotominor.yy408 = 0;}
117160
+ break;
117161
+ case 155: /* orderby_opt ::= ORDER BY sortlist */
117162
+ case 162: /* groupby_opt ::= GROUP BY nexprlist */ yytestcase(yyruleno==162);
117163
+ case 235: /* exprlist ::= nexprlist */ yytestcase(yyruleno==235);
117164
+{yygotominor.yy14 = yymsp[0].minor.yy14;}
117165
+ break;
117166
+ case 156: /* sortlist ::= sortlist COMMA expr sortorder */
117167
+{
117168
+ yygotominor.yy14 = sqlite3ExprListAppend(pParse,yymsp[-3].minor.yy14,yymsp[-1].minor.yy346.pExpr);
117169
+ if( yygotominor.yy14 ) yygotominor.yy14->a[yygotominor.yy14->nExpr-1].sortOrder = (u8)yymsp[0].minor.yy328;
117170
+}
117171
+ break;
117172
+ case 157: /* sortlist ::= expr sortorder */
117173
+{
117174
+ yygotominor.yy14 = sqlite3ExprListAppend(pParse,0,yymsp[-1].minor.yy346.pExpr);
117175
+ if( yygotominor.yy14 && ALWAYS(yygotominor.yy14->a) ) yygotominor.yy14->a[0].sortOrder = (u8)yymsp[0].minor.yy328;
117176
+}
117177
+ break;
117178
+ case 158: /* sortorder ::= ASC */
117179
+ case 160: /* sortorder ::= */ yytestcase(yyruleno==160);
117180
+{yygotominor.yy328 = SQLITE_SO_ASC;}
117181
+ break;
117182
+ case 159: /* sortorder ::= DESC */
117183
+{yygotominor.yy328 = SQLITE_SO_DESC;}
117184
+ break;
117185
+ case 165: /* limit_opt ::= */
117186
+{yygotominor.yy476.pLimit = 0; yygotominor.yy476.pOffset = 0;}
117187
+ break;
117188
+ case 166: /* limit_opt ::= LIMIT expr */
117189
+{yygotominor.yy476.pLimit = yymsp[0].minor.yy346.pExpr; yygotominor.yy476.pOffset = 0;}
117190
+ break;
117191
+ case 167: /* limit_opt ::= LIMIT expr OFFSET expr */
117192
+{yygotominor.yy476.pLimit = yymsp[-2].minor.yy346.pExpr; yygotominor.yy476.pOffset = yymsp[0].minor.yy346.pExpr;}
117193
+ break;
117194
+ case 168: /* limit_opt ::= LIMIT expr COMMA expr */
117195
+{yygotominor.yy476.pOffset = yymsp[-2].minor.yy346.pExpr; yygotominor.yy476.pLimit = yymsp[0].minor.yy346.pExpr;}
117196
+ break;
117197
+ case 169: /* cmd ::= with DELETE FROM fullname indexed_opt where_opt */
117198
+{
117199
+ sqlite3WithPush(pParse, yymsp[-5].minor.yy59, 1);
117200
+ sqlite3SrcListIndexedBy(pParse, yymsp[-2].minor.yy65, &yymsp[-1].minor.yy0);
117201
+ sqlite3DeleteFrom(pParse,yymsp[-2].minor.yy65,yymsp[0].minor.yy132);
117202
+}
117203
+ break;
117204
+ case 172: /* cmd ::= with UPDATE orconf fullname indexed_opt SET setlist where_opt */
117205
+{
117206
+ sqlite3WithPush(pParse, yymsp[-7].minor.yy59, 1);
117207
+ sqlite3SrcListIndexedBy(pParse, yymsp[-4].minor.yy65, &yymsp[-3].minor.yy0);
117208
+ sqlite3ExprListCheckLength(pParse,yymsp[-1].minor.yy14,"set list");
117209
+ sqlite3Update(pParse,yymsp[-4].minor.yy65,yymsp[-1].minor.yy14,yymsp[0].minor.yy132,yymsp[-5].minor.yy186);
117210
+}
117211
+ break;
117212
+ case 173: /* setlist ::= setlist COMMA nm EQ expr */
117213
+{
117214
+ yygotominor.yy14 = sqlite3ExprListAppend(pParse, yymsp[-4].minor.yy14, yymsp[0].minor.yy346.pExpr);
117215
+ sqlite3ExprListSetName(pParse, yygotominor.yy14, &yymsp[-2].minor.yy0, 1);
117216
+}
117217
+ break;
117218
+ case 174: /* setlist ::= nm EQ expr */
117219
+{
117220
+ yygotominor.yy14 = sqlite3ExprListAppend(pParse, 0, yymsp[0].minor.yy346.pExpr);
117221
+ sqlite3ExprListSetName(pParse, yygotominor.yy14, &yymsp[-2].minor.yy0, 1);
117222
+}
117223
+ break;
117224
+ case 175: /* cmd ::= with insert_cmd INTO fullname inscollist_opt select */
117225
+{
117226
+ sqlite3WithPush(pParse, yymsp[-5].minor.yy59, 1);
117227
+ sqlite3Insert(pParse, yymsp[-2].minor.yy65, yymsp[0].minor.yy3, yymsp[-1].minor.yy408, yymsp[-4].minor.yy186);
117228
+}
117229
+ break;
117230
+ case 176: /* cmd ::= with insert_cmd INTO fullname inscollist_opt DEFAULT VALUES */
117231
+{
117232
+ sqlite3WithPush(pParse, yymsp[-6].minor.yy59, 1);
117233
+ sqlite3Insert(pParse, yymsp[-3].minor.yy65, 0, yymsp[-2].minor.yy408, yymsp[-5].minor.yy186);
117234
+}
116713117235
break;
116714117236
case 177: /* insert_cmd ::= INSERT orconf */
116715
-{yygotominor.yy210 = yymsp[0].minor.yy210;}
117237
+{yygotominor.yy186 = yymsp[0].minor.yy186;}
116716117238
break;
116717117239
case 178: /* insert_cmd ::= REPLACE */
116718
-{yygotominor.yy210 = OE_Replace;}
116719
- break;
116720
- case 179: /* valuelist ::= VALUES LP nexprlist RP */
116721
-{
116722
- yygotominor.yy260.pList = yymsp[-1].minor.yy322;
116723
- yygotominor.yy260.pSelect = 0;
116724
-}
116725
- break;
116726
- case 180: /* valuelist ::= valuelist COMMA LP exprlist RP */
116727
-{
116728
- Select *pRight = sqlite3SelectNew(pParse, yymsp[-1].minor.yy322, 0, 0, 0, 0, 0, 0, 0, 0);
116729
- if( yymsp[-4].minor.yy260.pList ){
116730
- yymsp[-4].minor.yy260.pSelect = sqlite3SelectNew(pParse, yymsp[-4].minor.yy260.pList, 0, 0, 0, 0, 0, 0, 0, 0);
116731
- yymsp[-4].minor.yy260.pList = 0;
116732
- }
116733
- yygotominor.yy260.pList = 0;
116734
- if( yymsp[-4].minor.yy260.pSelect==0 || pRight==0 ){
116735
- sqlite3SelectDelete(pParse->db, pRight);
116736
- sqlite3SelectDelete(pParse->db, yymsp[-4].minor.yy260.pSelect);
116737
- yygotominor.yy260.pSelect = 0;
116738
- }else{
116739
- pRight->op = TK_ALL;
116740
- pRight->pPrior = yymsp[-4].minor.yy260.pSelect;
116741
- pRight->selFlags |= SF_Values;
116742
- pRight->pPrior->selFlags |= SF_Values;
116743
- yygotominor.yy260.pSelect = pRight;
116744
- }
116745
-}
116746
- break;
116747
- case 183: /* idlist ::= idlist COMMA nm */
116748
-{yygotominor.yy384 = sqlite3IdListAppend(pParse->db,yymsp[-2].minor.yy384,&yymsp[0].minor.yy0);}
116749
- break;
116750
- case 184: /* idlist ::= nm */
116751
-{yygotominor.yy384 = sqlite3IdListAppend(pParse->db,0,&yymsp[0].minor.yy0);}
116752
- break;
116753
- case 185: /* expr ::= term */
116754
-{yygotominor.yy118 = yymsp[0].minor.yy118;}
116755
- break;
116756
- case 186: /* expr ::= LP expr RP */
116757
-{yygotominor.yy118.pExpr = yymsp[-1].minor.yy118.pExpr; spanSet(&yygotominor.yy118,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0);}
116758
- break;
116759
- case 187: /* term ::= NULL */
116760
- case 192: /* term ::= INTEGER|FLOAT|BLOB */ yytestcase(yyruleno==192);
116761
- case 193: /* term ::= STRING */ yytestcase(yyruleno==193);
116762
-{spanExpr(&yygotominor.yy118, pParse, yymsp[0].major, &yymsp[0].minor.yy0);}
116763
- break;
116764
- case 188: /* expr ::= id */
116765
- case 189: /* expr ::= JOIN_KW */ yytestcase(yyruleno==189);
116766
-{spanExpr(&yygotominor.yy118, pParse, TK_ID, &yymsp[0].minor.yy0);}
116767
- break;
116768
- case 190: /* expr ::= nm DOT nm */
117240
+{yygotominor.yy186 = OE_Replace;}
117241
+ break;
117242
+ case 181: /* idlist ::= idlist COMMA nm */
117243
+{yygotominor.yy408 = sqlite3IdListAppend(pParse->db,yymsp[-2].minor.yy408,&yymsp[0].minor.yy0);}
117244
+ break;
117245
+ case 182: /* idlist ::= nm */
117246
+{yygotominor.yy408 = sqlite3IdListAppend(pParse->db,0,&yymsp[0].minor.yy0);}
117247
+ break;
117248
+ case 183: /* expr ::= term */
117249
+{yygotominor.yy346 = yymsp[0].minor.yy346;}
117250
+ break;
117251
+ case 184: /* expr ::= LP expr RP */
117252
+{yygotominor.yy346.pExpr = yymsp[-1].minor.yy346.pExpr; spanSet(&yygotominor.yy346,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0);}
117253
+ break;
117254
+ case 185: /* term ::= NULL */
117255
+ case 190: /* term ::= INTEGER|FLOAT|BLOB */ yytestcase(yyruleno==190);
117256
+ case 191: /* term ::= STRING */ yytestcase(yyruleno==191);
117257
+{spanExpr(&yygotominor.yy346, pParse, yymsp[0].major, &yymsp[0].minor.yy0);}
117258
+ break;
117259
+ case 186: /* expr ::= ID|INDEXED */
117260
+ case 187: /* expr ::= JOIN_KW */ yytestcase(yyruleno==187);
117261
+{spanExpr(&yygotominor.yy346, pParse, TK_ID, &yymsp[0].minor.yy0);}
117262
+ break;
117263
+ case 188: /* expr ::= nm DOT nm */
116769117264
{
116770117265
Expr *temp1 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-2].minor.yy0);
116771117266
Expr *temp2 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[0].minor.yy0);
116772
- yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_DOT, temp1, temp2, 0);
116773
- spanSet(&yygotominor.yy118,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0);
117267
+ yygotominor.yy346.pExpr = sqlite3PExpr(pParse, TK_DOT, temp1, temp2, 0);
117268
+ spanSet(&yygotominor.yy346,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0);
116774117269
}
116775117270
break;
116776
- case 191: /* expr ::= nm DOT nm DOT nm */
117271
+ case 189: /* expr ::= nm DOT nm DOT nm */
116777117272
{
116778117273
Expr *temp1 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-4].minor.yy0);
116779117274
Expr *temp2 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-2].minor.yy0);
116780117275
Expr *temp3 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[0].minor.yy0);
116781117276
Expr *temp4 = sqlite3PExpr(pParse, TK_DOT, temp2, temp3, 0);
116782
- yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_DOT, temp1, temp4, 0);
116783
- spanSet(&yygotominor.yy118,&yymsp[-4].minor.yy0,&yymsp[0].minor.yy0);
116784
-}
116785
- break;
116786
- case 194: /* expr ::= REGISTER */
116787
-{
116788
- /* When doing a nested parse, one can include terms in an expression
116789
- ** that look like this: #1 #2 ... These terms refer to registers
116790
- ** in the virtual machine. #N is the N-th register. */
116791
- if( pParse->nested==0 ){
116792
- sqlite3ErrorMsg(pParse, "near \"%T\": syntax error", &yymsp[0].minor.yy0);
116793
- yygotominor.yy118.pExpr = 0;
116794
- }else{
116795
- yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_REGISTER, 0, 0, &yymsp[0].minor.yy0);
116796
- if( yygotominor.yy118.pExpr ) sqlite3GetInt32(&yymsp[0].minor.yy0.z[1], &yygotominor.yy118.pExpr->iTable);
116797
- }
116798
- spanSet(&yygotominor.yy118, &yymsp[0].minor.yy0, &yymsp[0].minor.yy0);
116799
-}
116800
- break;
116801
- case 195: /* expr ::= VARIABLE */
116802
-{
116803
- spanExpr(&yygotominor.yy118, pParse, TK_VARIABLE, &yymsp[0].minor.yy0);
116804
- sqlite3ExprAssignVarNumber(pParse, yygotominor.yy118.pExpr);
116805
- spanSet(&yygotominor.yy118, &yymsp[0].minor.yy0, &yymsp[0].minor.yy0);
116806
-}
116807
- break;
116808
- case 196: /* expr ::= expr COLLATE ids */
116809
-{
116810
- yygotominor.yy118.pExpr = sqlite3ExprAddCollateToken(pParse, yymsp[-2].minor.yy118.pExpr, &yymsp[0].minor.yy0);
116811
- yygotominor.yy118.zStart = yymsp[-2].minor.yy118.zStart;
116812
- yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
116813
-}
116814
- break;
116815
- case 197: /* expr ::= CAST LP expr AS typetoken RP */
116816
-{
116817
- yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_CAST, yymsp[-3].minor.yy118.pExpr, 0, &yymsp[-1].minor.yy0);
116818
- spanSet(&yygotominor.yy118,&yymsp[-5].minor.yy0,&yymsp[0].minor.yy0);
116819
-}
116820
- break;
116821
- case 198: /* expr ::= ID LP distinct exprlist RP */
116822
-{
116823
- if( yymsp[-1].minor.yy322 && yymsp[-1].minor.yy322->nExpr>pParse->db->aLimit[SQLITE_LIMIT_FUNCTION_ARG] ){
116824
- sqlite3ErrorMsg(pParse, "too many arguments on function %T", &yymsp[-4].minor.yy0);
116825
- }
116826
- yygotominor.yy118.pExpr = sqlite3ExprFunction(pParse, yymsp[-1].minor.yy322, &yymsp[-4].minor.yy0);
116827
- spanSet(&yygotominor.yy118,&yymsp[-4].minor.yy0,&yymsp[0].minor.yy0);
116828
- if( yymsp[-2].minor.yy177 && yygotominor.yy118.pExpr ){
116829
- yygotominor.yy118.pExpr->flags |= EP_Distinct;
116830
- }
116831
-}
116832
- break;
116833
- case 199: /* expr ::= ID LP STAR RP */
116834
-{
116835
- yygotominor.yy118.pExpr = sqlite3ExprFunction(pParse, 0, &yymsp[-3].minor.yy0);
116836
- spanSet(&yygotominor.yy118,&yymsp[-3].minor.yy0,&yymsp[0].minor.yy0);
116837
-}
116838
- break;
116839
- case 200: /* term ::= CTIME_KW */
116840
-{
116841
- yygotominor.yy118.pExpr = sqlite3ExprFunction(pParse, 0, &yymsp[0].minor.yy0);
116842
- spanSet(&yygotominor.yy118, &yymsp[0].minor.yy0, &yymsp[0].minor.yy0);
116843
-}
116844
- break;
116845
- case 201: /* expr ::= expr AND expr */
116846
- case 202: /* expr ::= expr OR expr */ yytestcase(yyruleno==202);
116847
- case 203: /* expr ::= expr LT|GT|GE|LE expr */ yytestcase(yyruleno==203);
116848
- case 204: /* expr ::= expr EQ|NE expr */ yytestcase(yyruleno==204);
116849
- case 205: /* expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr */ yytestcase(yyruleno==205);
116850
- case 206: /* expr ::= expr PLUS|MINUS expr */ yytestcase(yyruleno==206);
116851
- case 207: /* expr ::= expr STAR|SLASH|REM expr */ yytestcase(yyruleno==207);
116852
- case 208: /* expr ::= expr CONCAT expr */ yytestcase(yyruleno==208);
116853
-{spanBinaryExpr(&yygotominor.yy118,pParse,yymsp[-1].major,&yymsp[-2].minor.yy118,&yymsp[0].minor.yy118);}
116854
- break;
116855
- case 209: /* likeop ::= LIKE_KW */
116856
- case 211: /* likeop ::= MATCH */ yytestcase(yyruleno==211);
116857
-{yygotominor.yy342.eOperator = yymsp[0].minor.yy0; yygotominor.yy342.bNot = 0;}
116858
- break;
116859
- case 210: /* likeop ::= NOT LIKE_KW */
116860
- case 212: /* likeop ::= NOT MATCH */ yytestcase(yyruleno==212);
116861
-{yygotominor.yy342.eOperator = yymsp[0].minor.yy0; yygotominor.yy342.bNot = 1;}
116862
- break;
116863
- case 213: /* expr ::= expr likeop expr */
116864
-{
116865
- ExprList *pList;
116866
- pList = sqlite3ExprListAppend(pParse,0, yymsp[0].minor.yy118.pExpr);
116867
- pList = sqlite3ExprListAppend(pParse,pList, yymsp[-2].minor.yy118.pExpr);
116868
- yygotominor.yy118.pExpr = sqlite3ExprFunction(pParse, pList, &yymsp[-1].minor.yy342.eOperator);
116869
- if( yymsp[-1].minor.yy342.bNot ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0);
116870
- yygotominor.yy118.zStart = yymsp[-2].minor.yy118.zStart;
116871
- yygotominor.yy118.zEnd = yymsp[0].minor.yy118.zEnd;
116872
- if( yygotominor.yy118.pExpr ) yygotominor.yy118.pExpr->flags |= EP_InfixFunc;
116873
-}
116874
- break;
116875
- case 214: /* expr ::= expr likeop expr ESCAPE expr */
116876
-{
116877
- ExprList *pList;
116878
- pList = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy118.pExpr);
116879
- pList = sqlite3ExprListAppend(pParse,pList, yymsp[-4].minor.yy118.pExpr);
116880
- pList = sqlite3ExprListAppend(pParse,pList, yymsp[0].minor.yy118.pExpr);
116881
- yygotominor.yy118.pExpr = sqlite3ExprFunction(pParse, pList, &yymsp[-3].minor.yy342.eOperator);
116882
- if( yymsp[-3].minor.yy342.bNot ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0);
116883
- yygotominor.yy118.zStart = yymsp[-4].minor.yy118.zStart;
116884
- yygotominor.yy118.zEnd = yymsp[0].minor.yy118.zEnd;
116885
- if( yygotominor.yy118.pExpr ) yygotominor.yy118.pExpr->flags |= EP_InfixFunc;
116886
-}
116887
- break;
116888
- case 215: /* expr ::= expr ISNULL|NOTNULL */
116889
-{spanUnaryPostfix(&yygotominor.yy118,pParse,yymsp[0].major,&yymsp[-1].minor.yy118,&yymsp[0].minor.yy0);}
116890
- break;
116891
- case 216: /* expr ::= expr NOT NULL */
116892
-{spanUnaryPostfix(&yygotominor.yy118,pParse,TK_NOTNULL,&yymsp[-2].minor.yy118,&yymsp[0].minor.yy0);}
116893
- break;
116894
- case 217: /* expr ::= expr IS expr */
116895
-{
116896
- spanBinaryExpr(&yygotominor.yy118,pParse,TK_IS,&yymsp[-2].minor.yy118,&yymsp[0].minor.yy118);
116897
- binaryToUnaryIfNull(pParse, yymsp[0].minor.yy118.pExpr, yygotominor.yy118.pExpr, TK_ISNULL);
116898
-}
116899
- break;
116900
- case 218: /* expr ::= expr IS NOT expr */
116901
-{
116902
- spanBinaryExpr(&yygotominor.yy118,pParse,TK_ISNOT,&yymsp[-3].minor.yy118,&yymsp[0].minor.yy118);
116903
- binaryToUnaryIfNull(pParse, yymsp[0].minor.yy118.pExpr, yygotominor.yy118.pExpr, TK_NOTNULL);
116904
-}
116905
- break;
116906
- case 219: /* expr ::= NOT expr */
116907
- case 220: /* expr ::= BITNOT expr */ yytestcase(yyruleno==220);
116908
-{spanUnaryPrefix(&yygotominor.yy118,pParse,yymsp[-1].major,&yymsp[0].minor.yy118,&yymsp[-1].minor.yy0);}
116909
- break;
116910
- case 221: /* expr ::= MINUS expr */
116911
-{spanUnaryPrefix(&yygotominor.yy118,pParse,TK_UMINUS,&yymsp[0].minor.yy118,&yymsp[-1].minor.yy0);}
116912
- break;
116913
- case 222: /* expr ::= PLUS expr */
116914
-{spanUnaryPrefix(&yygotominor.yy118,pParse,TK_UPLUS,&yymsp[0].minor.yy118,&yymsp[-1].minor.yy0);}
116915
- break;
116916
- case 225: /* expr ::= expr between_op expr AND expr */
116917
-{
116918
- ExprList *pList = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy118.pExpr);
116919
- pList = sqlite3ExprListAppend(pParse,pList, yymsp[0].minor.yy118.pExpr);
116920
- yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_BETWEEN, yymsp[-4].minor.yy118.pExpr, 0, 0);
116921
- if( yygotominor.yy118.pExpr ){
116922
- yygotominor.yy118.pExpr->x.pList = pList;
117277
+ yygotominor.yy346.pExpr = sqlite3PExpr(pParse, TK_DOT, temp1, temp4, 0);
117278
+ spanSet(&yygotominor.yy346,&yymsp[-4].minor.yy0,&yymsp[0].minor.yy0);
117279
+}
117280
+ break;
117281
+ case 192: /* expr ::= VARIABLE */
117282
+{
117283
+ if( yymsp[0].minor.yy0.n>=2 && yymsp[0].minor.yy0.z[0]=='#' && sqlite3Isdigit(yymsp[0].minor.yy0.z[1]) ){
117284
+ /* When doing a nested parse, one can include terms in an expression
117285
+ ** that look like this: #1 #2 ... These terms refer to registers
117286
+ ** in the virtual machine. #N is the N-th register. */
117287
+ if( pParse->nested==0 ){
117288
+ sqlite3ErrorMsg(pParse, "near \"%T\": syntax error", &yymsp[0].minor.yy0);
117289
+ yygotominor.yy346.pExpr = 0;
117290
+ }else{
117291
+ yygotominor.yy346.pExpr = sqlite3PExpr(pParse, TK_REGISTER, 0, 0, &yymsp[0].minor.yy0);
117292
+ if( yygotominor.yy346.pExpr ) sqlite3GetInt32(&yymsp[0].minor.yy0.z[1], &yygotominor.yy346.pExpr->iTable);
117293
+ }
117294
+ }else{
117295
+ spanExpr(&yygotominor.yy346, pParse, TK_VARIABLE, &yymsp[0].minor.yy0);
117296
+ sqlite3ExprAssignVarNumber(pParse, yygotominor.yy346.pExpr);
117297
+ }
117298
+ spanSet(&yygotominor.yy346, &yymsp[0].minor.yy0, &yymsp[0].minor.yy0);
117299
+}
117300
+ break;
117301
+ case 193: /* expr ::= expr COLLATE ID|STRING */
117302
+{
117303
+ yygotominor.yy346.pExpr = sqlite3ExprAddCollateToken(pParse, yymsp[-2].minor.yy346.pExpr, &yymsp[0].minor.yy0);
117304
+ yygotominor.yy346.zStart = yymsp[-2].minor.yy346.zStart;
117305
+ yygotominor.yy346.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
117306
+}
117307
+ break;
117308
+ case 194: /* expr ::= CAST LP expr AS typetoken RP */
117309
+{
117310
+ yygotominor.yy346.pExpr = sqlite3PExpr(pParse, TK_CAST, yymsp[-3].minor.yy346.pExpr, 0, &yymsp[-1].minor.yy0);
117311
+ spanSet(&yygotominor.yy346,&yymsp[-5].minor.yy0,&yymsp[0].minor.yy0);
117312
+}
117313
+ break;
117314
+ case 195: /* expr ::= ID|INDEXED LP distinct exprlist RP */
117315
+{
117316
+ if( yymsp[-1].minor.yy14 && yymsp[-1].minor.yy14->nExpr>pParse->db->aLimit[SQLITE_LIMIT_FUNCTION_ARG] ){
117317
+ sqlite3ErrorMsg(pParse, "too many arguments on function %T", &yymsp[-4].minor.yy0);
117318
+ }
117319
+ yygotominor.yy346.pExpr = sqlite3ExprFunction(pParse, yymsp[-1].minor.yy14, &yymsp[-4].minor.yy0);
117320
+ spanSet(&yygotominor.yy346,&yymsp[-4].minor.yy0,&yymsp[0].minor.yy0);
117321
+ if( yymsp[-2].minor.yy381 && yygotominor.yy346.pExpr ){
117322
+ yygotominor.yy346.pExpr->flags |= EP_Distinct;
117323
+ }
117324
+}
117325
+ break;
117326
+ case 196: /* expr ::= ID|INDEXED LP STAR RP */
117327
+{
117328
+ yygotominor.yy346.pExpr = sqlite3ExprFunction(pParse, 0, &yymsp[-3].minor.yy0);
117329
+ spanSet(&yygotominor.yy346,&yymsp[-3].minor.yy0,&yymsp[0].minor.yy0);
117330
+}
117331
+ break;
117332
+ case 197: /* term ::= CTIME_KW */
117333
+{
117334
+ yygotominor.yy346.pExpr = sqlite3ExprFunction(pParse, 0, &yymsp[0].minor.yy0);
117335
+ spanSet(&yygotominor.yy346, &yymsp[0].minor.yy0, &yymsp[0].minor.yy0);
117336
+}
117337
+ break;
117338
+ case 198: /* expr ::= expr AND expr */
117339
+ case 199: /* expr ::= expr OR expr */ yytestcase(yyruleno==199);
117340
+ case 200: /* expr ::= expr LT|GT|GE|LE expr */ yytestcase(yyruleno==200);
117341
+ case 201: /* expr ::= expr EQ|NE expr */ yytestcase(yyruleno==201);
117342
+ case 202: /* expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr */ yytestcase(yyruleno==202);
117343
+ case 203: /* expr ::= expr PLUS|MINUS expr */ yytestcase(yyruleno==203);
117344
+ case 204: /* expr ::= expr STAR|SLASH|REM expr */ yytestcase(yyruleno==204);
117345
+ case 205: /* expr ::= expr CONCAT expr */ yytestcase(yyruleno==205);
117346
+{spanBinaryExpr(&yygotominor.yy346,pParse,yymsp[-1].major,&yymsp[-2].minor.yy346,&yymsp[0].minor.yy346);}
117347
+ break;
117348
+ case 206: /* likeop ::= LIKE_KW|MATCH */
117349
+{yygotominor.yy96.eOperator = yymsp[0].minor.yy0; yygotominor.yy96.bNot = 0;}
117350
+ break;
117351
+ case 207: /* likeop ::= NOT LIKE_KW|MATCH */
117352
+{yygotominor.yy96.eOperator = yymsp[0].minor.yy0; yygotominor.yy96.bNot = 1;}
117353
+ break;
117354
+ case 208: /* expr ::= expr likeop expr */
117355
+{
117356
+ ExprList *pList;
117357
+ pList = sqlite3ExprListAppend(pParse,0, yymsp[0].minor.yy346.pExpr);
117358
+ pList = sqlite3ExprListAppend(pParse,pList, yymsp[-2].minor.yy346.pExpr);
117359
+ yygotominor.yy346.pExpr = sqlite3ExprFunction(pParse, pList, &yymsp[-1].minor.yy96.eOperator);
117360
+ if( yymsp[-1].minor.yy96.bNot ) yygotominor.yy346.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy346.pExpr, 0, 0);
117361
+ yygotominor.yy346.zStart = yymsp[-2].minor.yy346.zStart;
117362
+ yygotominor.yy346.zEnd = yymsp[0].minor.yy346.zEnd;
117363
+ if( yygotominor.yy346.pExpr ) yygotominor.yy346.pExpr->flags |= EP_InfixFunc;
117364
+}
117365
+ break;
117366
+ case 209: /* expr ::= expr likeop expr ESCAPE expr */
117367
+{
117368
+ ExprList *pList;
117369
+ pList = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy346.pExpr);
117370
+ pList = sqlite3ExprListAppend(pParse,pList, yymsp[-4].minor.yy346.pExpr);
117371
+ pList = sqlite3ExprListAppend(pParse,pList, yymsp[0].minor.yy346.pExpr);
117372
+ yygotominor.yy346.pExpr = sqlite3ExprFunction(pParse, pList, &yymsp[-3].minor.yy96.eOperator);
117373
+ if( yymsp[-3].minor.yy96.bNot ) yygotominor.yy346.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy346.pExpr, 0, 0);
117374
+ yygotominor.yy346.zStart = yymsp[-4].minor.yy346.zStart;
117375
+ yygotominor.yy346.zEnd = yymsp[0].minor.yy346.zEnd;
117376
+ if( yygotominor.yy346.pExpr ) yygotominor.yy346.pExpr->flags |= EP_InfixFunc;
117377
+}
117378
+ break;
117379
+ case 210: /* expr ::= expr ISNULL|NOTNULL */
117380
+{spanUnaryPostfix(&yygotominor.yy346,pParse,yymsp[0].major,&yymsp[-1].minor.yy346,&yymsp[0].minor.yy0);}
117381
+ break;
117382
+ case 211: /* expr ::= expr NOT NULL */
117383
+{spanUnaryPostfix(&yygotominor.yy346,pParse,TK_NOTNULL,&yymsp[-2].minor.yy346,&yymsp[0].minor.yy0);}
117384
+ break;
117385
+ case 212: /* expr ::= expr IS expr */
117386
+{
117387
+ spanBinaryExpr(&yygotominor.yy346,pParse,TK_IS,&yymsp[-2].minor.yy346,&yymsp[0].minor.yy346);
117388
+ binaryToUnaryIfNull(pParse, yymsp[0].minor.yy346.pExpr, yygotominor.yy346.pExpr, TK_ISNULL);
117389
+}
117390
+ break;
117391
+ case 213: /* expr ::= expr IS NOT expr */
117392
+{
117393
+ spanBinaryExpr(&yygotominor.yy346,pParse,TK_ISNOT,&yymsp[-3].minor.yy346,&yymsp[0].minor.yy346);
117394
+ binaryToUnaryIfNull(pParse, yymsp[0].minor.yy346.pExpr, yygotominor.yy346.pExpr, TK_NOTNULL);
117395
+}
117396
+ break;
117397
+ case 214: /* expr ::= NOT expr */
117398
+ case 215: /* expr ::= BITNOT expr */ yytestcase(yyruleno==215);
117399
+{spanUnaryPrefix(&yygotominor.yy346,pParse,yymsp[-1].major,&yymsp[0].minor.yy346,&yymsp[-1].minor.yy0);}
117400
+ break;
117401
+ case 216: /* expr ::= MINUS expr */
117402
+{spanUnaryPrefix(&yygotominor.yy346,pParse,TK_UMINUS,&yymsp[0].minor.yy346,&yymsp[-1].minor.yy0);}
117403
+ break;
117404
+ case 217: /* expr ::= PLUS expr */
117405
+{spanUnaryPrefix(&yygotominor.yy346,pParse,TK_UPLUS,&yymsp[0].minor.yy346,&yymsp[-1].minor.yy0);}
117406
+ break;
117407
+ case 220: /* expr ::= expr between_op expr AND expr */
117408
+{
117409
+ ExprList *pList = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy346.pExpr);
117410
+ pList = sqlite3ExprListAppend(pParse,pList, yymsp[0].minor.yy346.pExpr);
117411
+ yygotominor.yy346.pExpr = sqlite3PExpr(pParse, TK_BETWEEN, yymsp[-4].minor.yy346.pExpr, 0, 0);
117412
+ if( yygotominor.yy346.pExpr ){
117413
+ yygotominor.yy346.pExpr->x.pList = pList;
116923117414
}else{
116924117415
sqlite3ExprListDelete(pParse->db, pList);
116925117416
}
116926
- if( yymsp[-3].minor.yy4 ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0);
116927
- yygotominor.yy118.zStart = yymsp[-4].minor.yy118.zStart;
116928
- yygotominor.yy118.zEnd = yymsp[0].minor.yy118.zEnd;
116929
-}
116930
- break;
116931
- case 228: /* expr ::= expr in_op LP exprlist RP */
116932
-{
116933
- if( yymsp[-1].minor.yy322==0 ){
117417
+ if( yymsp[-3].minor.yy328 ) yygotominor.yy346.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy346.pExpr, 0, 0);
117418
+ yygotominor.yy346.zStart = yymsp[-4].minor.yy346.zStart;
117419
+ yygotominor.yy346.zEnd = yymsp[0].minor.yy346.zEnd;
117420
+}
117421
+ break;
117422
+ case 223: /* expr ::= expr in_op LP exprlist RP */
117423
+{
117424
+ if( yymsp[-1].minor.yy14==0 ){
116934117425
/* Expressions of the form
116935117426
**
116936117427
** expr1 IN ()
116937117428
** expr1 NOT IN ()
116938117429
**
116939117430
** simplify to constants 0 (false) and 1 (true), respectively,
116940117431
** regardless of the value of expr1.
116941117432
*/
116942
- yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_INTEGER, 0, 0, &sqlite3IntTokens[yymsp[-3].minor.yy4]);
116943
- sqlite3ExprDelete(pParse->db, yymsp[-4].minor.yy118.pExpr);
116944
- }else{
116945
- yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy118.pExpr, 0, 0);
116946
- if( yygotominor.yy118.pExpr ){
116947
- yygotominor.yy118.pExpr->x.pList = yymsp[-1].minor.yy322;
116948
- sqlite3ExprSetHeight(pParse, yygotominor.yy118.pExpr);
116949
- }else{
116950
- sqlite3ExprListDelete(pParse->db, yymsp[-1].minor.yy322);
116951
- }
116952
- if( yymsp[-3].minor.yy4 ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0);
116953
- }
116954
- yygotominor.yy118.zStart = yymsp[-4].minor.yy118.zStart;
116955
- yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
116956
- }
116957
- break;
116958
- case 229: /* expr ::= LP select RP */
116959
-{
116960
- yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_SELECT, 0, 0, 0);
116961
- if( yygotominor.yy118.pExpr ){
116962
- yygotominor.yy118.pExpr->x.pSelect = yymsp[-1].minor.yy387;
116963
- ExprSetProperty(yygotominor.yy118.pExpr, EP_xIsSelect);
116964
- sqlite3ExprSetHeight(pParse, yygotominor.yy118.pExpr);
116965
- }else{
116966
- sqlite3SelectDelete(pParse->db, yymsp[-1].minor.yy387);
116967
- }
116968
- yygotominor.yy118.zStart = yymsp[-2].minor.yy0.z;
116969
- yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
116970
- }
116971
- break;
116972
- case 230: /* expr ::= expr in_op LP select RP */
116973
-{
116974
- yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy118.pExpr, 0, 0);
116975
- if( yygotominor.yy118.pExpr ){
116976
- yygotominor.yy118.pExpr->x.pSelect = yymsp[-1].minor.yy387;
116977
- ExprSetProperty(yygotominor.yy118.pExpr, EP_xIsSelect);
116978
- sqlite3ExprSetHeight(pParse, yygotominor.yy118.pExpr);
116979
- }else{
116980
- sqlite3SelectDelete(pParse->db, yymsp[-1].minor.yy387);
116981
- }
116982
- if( yymsp[-3].minor.yy4 ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0);
116983
- yygotominor.yy118.zStart = yymsp[-4].minor.yy118.zStart;
116984
- yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
116985
- }
116986
- break;
116987
- case 231: /* expr ::= expr in_op nm dbnm */
117433
+ yygotominor.yy346.pExpr = sqlite3PExpr(pParse, TK_INTEGER, 0, 0, &sqlite3IntTokens[yymsp[-3].minor.yy328]);
117434
+ sqlite3ExprDelete(pParse->db, yymsp[-4].minor.yy346.pExpr);
117435
+ }else{
117436
+ yygotominor.yy346.pExpr = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy346.pExpr, 0, 0);
117437
+ if( yygotominor.yy346.pExpr ){
117438
+ yygotominor.yy346.pExpr->x.pList = yymsp[-1].minor.yy14;
117439
+ sqlite3ExprSetHeight(pParse, yygotominor.yy346.pExpr);
117440
+ }else{
117441
+ sqlite3ExprListDelete(pParse->db, yymsp[-1].minor.yy14);
117442
+ }
117443
+ if( yymsp[-3].minor.yy328 ) yygotominor.yy346.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy346.pExpr, 0, 0);
117444
+ }
117445
+ yygotominor.yy346.zStart = yymsp[-4].minor.yy346.zStart;
117446
+ yygotominor.yy346.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
117447
+ }
117448
+ break;
117449
+ case 224: /* expr ::= LP select RP */
117450
+{
117451
+ yygotominor.yy346.pExpr = sqlite3PExpr(pParse, TK_SELECT, 0, 0, 0);
117452
+ if( yygotominor.yy346.pExpr ){
117453
+ yygotominor.yy346.pExpr->x.pSelect = yymsp[-1].minor.yy3;
117454
+ ExprSetProperty(yygotominor.yy346.pExpr, EP_xIsSelect);
117455
+ sqlite3ExprSetHeight(pParse, yygotominor.yy346.pExpr);
117456
+ }else{
117457
+ sqlite3SelectDelete(pParse->db, yymsp[-1].minor.yy3);
117458
+ }
117459
+ yygotominor.yy346.zStart = yymsp[-2].minor.yy0.z;
117460
+ yygotominor.yy346.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
117461
+ }
117462
+ break;
117463
+ case 225: /* expr ::= expr in_op LP select RP */
117464
+{
117465
+ yygotominor.yy346.pExpr = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy346.pExpr, 0, 0);
117466
+ if( yygotominor.yy346.pExpr ){
117467
+ yygotominor.yy346.pExpr->x.pSelect = yymsp[-1].minor.yy3;
117468
+ ExprSetProperty(yygotominor.yy346.pExpr, EP_xIsSelect);
117469
+ sqlite3ExprSetHeight(pParse, yygotominor.yy346.pExpr);
117470
+ }else{
117471
+ sqlite3SelectDelete(pParse->db, yymsp[-1].minor.yy3);
117472
+ }
117473
+ if( yymsp[-3].minor.yy328 ) yygotominor.yy346.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy346.pExpr, 0, 0);
117474
+ yygotominor.yy346.zStart = yymsp[-4].minor.yy346.zStart;
117475
+ yygotominor.yy346.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
117476
+ }
117477
+ break;
117478
+ case 226: /* expr ::= expr in_op nm dbnm */
116988117479
{
116989117480
SrcList *pSrc = sqlite3SrcListAppend(pParse->db, 0,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0);
116990
- yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_IN, yymsp[-3].minor.yy118.pExpr, 0, 0);
116991
- if( yygotominor.yy118.pExpr ){
116992
- yygotominor.yy118.pExpr->x.pSelect = sqlite3SelectNew(pParse, 0,pSrc,0,0,0,0,0,0,0);
116993
- ExprSetProperty(yygotominor.yy118.pExpr, EP_xIsSelect);
116994
- sqlite3ExprSetHeight(pParse, yygotominor.yy118.pExpr);
117481
+ yygotominor.yy346.pExpr = sqlite3PExpr(pParse, TK_IN, yymsp[-3].minor.yy346.pExpr, 0, 0);
117482
+ if( yygotominor.yy346.pExpr ){
117483
+ yygotominor.yy346.pExpr->x.pSelect = sqlite3SelectNew(pParse, 0,pSrc,0,0,0,0,0,0,0);
117484
+ ExprSetProperty(yygotominor.yy346.pExpr, EP_xIsSelect);
117485
+ sqlite3ExprSetHeight(pParse, yygotominor.yy346.pExpr);
116995117486
}else{
116996117487
sqlite3SrcListDelete(pParse->db, pSrc);
116997117488
}
116998
- if( yymsp[-2].minor.yy4 ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0);
116999
- yygotominor.yy118.zStart = yymsp[-3].minor.yy118.zStart;
117000
- yygotominor.yy118.zEnd = yymsp[0].minor.yy0.z ? &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n] : &yymsp[-1].minor.yy0.z[yymsp[-1].minor.yy0.n];
117001
- }
117002
- break;
117003
- case 232: /* expr ::= EXISTS LP select RP */
117004
-{
117005
- Expr *p = yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_EXISTS, 0, 0, 0);
117489
+ if( yymsp[-2].minor.yy328 ) yygotominor.yy346.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy346.pExpr, 0, 0);
117490
+ yygotominor.yy346.zStart = yymsp[-3].minor.yy346.zStart;
117491
+ yygotominor.yy346.zEnd = yymsp[0].minor.yy0.z ? &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n] : &yymsp[-1].minor.yy0.z[yymsp[-1].minor.yy0.n];
117492
+ }
117493
+ break;
117494
+ case 227: /* expr ::= EXISTS LP select RP */
117495
+{
117496
+ Expr *p = yygotominor.yy346.pExpr = sqlite3PExpr(pParse, TK_EXISTS, 0, 0, 0);
117006117497
if( p ){
117007
- p->x.pSelect = yymsp[-1].minor.yy387;
117498
+ p->x.pSelect = yymsp[-1].minor.yy3;
117008117499
ExprSetProperty(p, EP_xIsSelect);
117009117500
sqlite3ExprSetHeight(pParse, p);
117010117501
}else{
117011
- sqlite3SelectDelete(pParse->db, yymsp[-1].minor.yy387);
117012
- }
117013
- yygotominor.yy118.zStart = yymsp[-3].minor.yy0.z;
117014
- yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
117015
- }
117016
- break;
117017
- case 233: /* expr ::= CASE case_operand case_exprlist case_else END */
117018
-{
117019
- yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_CASE, yymsp[-3].minor.yy314, 0, 0);
117020
- if( yygotominor.yy118.pExpr ){
117021
- yygotominor.yy118.pExpr->x.pList = yymsp[-1].minor.yy314 ? sqlite3ExprListAppend(pParse,yymsp[-2].minor.yy322,yymsp[-1].minor.yy314) : yymsp[-2].minor.yy322;
117022
- sqlite3ExprSetHeight(pParse, yygotominor.yy118.pExpr);
117023
- }else{
117024
- sqlite3ExprListDelete(pParse->db, yymsp[-2].minor.yy322);
117025
- sqlite3ExprDelete(pParse->db, yymsp[-1].minor.yy314);
117026
- }
117027
- yygotominor.yy118.zStart = yymsp[-4].minor.yy0.z;
117028
- yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
117029
-}
117030
- break;
117031
- case 234: /* case_exprlist ::= case_exprlist WHEN expr THEN expr */
117032
-{
117033
- yygotominor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy322, yymsp[-2].minor.yy118.pExpr);
117034
- yygotominor.yy322 = sqlite3ExprListAppend(pParse,yygotominor.yy322, yymsp[0].minor.yy118.pExpr);
117035
-}
117036
- break;
117037
- case 235: /* case_exprlist ::= WHEN expr THEN expr */
117038
-{
117039
- yygotominor.yy322 = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy118.pExpr);
117040
- yygotominor.yy322 = sqlite3ExprListAppend(pParse,yygotominor.yy322, yymsp[0].minor.yy118.pExpr);
117041
-}
117042
- break;
117043
- case 242: /* nexprlist ::= nexprlist COMMA expr */
117044
-{yygotominor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-2].minor.yy322,yymsp[0].minor.yy118.pExpr);}
117045
- break;
117046
- case 243: /* nexprlist ::= expr */
117047
-{yygotominor.yy322 = sqlite3ExprListAppend(pParse,0,yymsp[0].minor.yy118.pExpr);}
117048
- break;
117049
- case 244: /* cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP idxlist RP where_opt */
117502
+ sqlite3SelectDelete(pParse->db, yymsp[-1].minor.yy3);
117503
+ }
117504
+ yygotominor.yy346.zStart = yymsp[-3].minor.yy0.z;
117505
+ yygotominor.yy346.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
117506
+ }
117507
+ break;
117508
+ case 228: /* expr ::= CASE case_operand case_exprlist case_else END */
117509
+{
117510
+ yygotominor.yy346.pExpr = sqlite3PExpr(pParse, TK_CASE, yymsp[-3].minor.yy132, 0, 0);
117511
+ if( yygotominor.yy346.pExpr ){
117512
+ yygotominor.yy346.pExpr->x.pList = yymsp[-1].minor.yy132 ? sqlite3ExprListAppend(pParse,yymsp[-2].minor.yy14,yymsp[-1].minor.yy132) : yymsp[-2].minor.yy14;
117513
+ sqlite3ExprSetHeight(pParse, yygotominor.yy346.pExpr);
117514
+ }else{
117515
+ sqlite3ExprListDelete(pParse->db, yymsp[-2].minor.yy14);
117516
+ sqlite3ExprDelete(pParse->db, yymsp[-1].minor.yy132);
117517
+ }
117518
+ yygotominor.yy346.zStart = yymsp[-4].minor.yy0.z;
117519
+ yygotominor.yy346.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
117520
+}
117521
+ break;
117522
+ case 229: /* case_exprlist ::= case_exprlist WHEN expr THEN expr */
117523
+{
117524
+ yygotominor.yy14 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy14, yymsp[-2].minor.yy346.pExpr);
117525
+ yygotominor.yy14 = sqlite3ExprListAppend(pParse,yygotominor.yy14, yymsp[0].minor.yy346.pExpr);
117526
+}
117527
+ break;
117528
+ case 230: /* case_exprlist ::= WHEN expr THEN expr */
117529
+{
117530
+ yygotominor.yy14 = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy346.pExpr);
117531
+ yygotominor.yy14 = sqlite3ExprListAppend(pParse,yygotominor.yy14, yymsp[0].minor.yy346.pExpr);
117532
+}
117533
+ break;
117534
+ case 237: /* nexprlist ::= nexprlist COMMA expr */
117535
+{yygotominor.yy14 = sqlite3ExprListAppend(pParse,yymsp[-2].minor.yy14,yymsp[0].minor.yy346.pExpr);}
117536
+ break;
117537
+ case 238: /* nexprlist ::= expr */
117538
+{yygotominor.yy14 = sqlite3ExprListAppend(pParse,0,yymsp[0].minor.yy346.pExpr);}
117539
+ break;
117540
+ case 239: /* cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP idxlist RP where_opt */
117050117541
{
117051117542
sqlite3CreateIndex(pParse, &yymsp[-7].minor.yy0, &yymsp[-6].minor.yy0,
117052
- sqlite3SrcListAppend(pParse->db,0,&yymsp[-4].minor.yy0,0), yymsp[-2].minor.yy322, yymsp[-10].minor.yy4,
117053
- &yymsp[-11].minor.yy0, yymsp[0].minor.yy314, SQLITE_SO_ASC, yymsp[-8].minor.yy4);
117054
-}
117055
- break;
117056
- case 245: /* uniqueflag ::= UNIQUE */
117057
- case 298: /* raisetype ::= ABORT */ yytestcase(yyruleno==298);
117058
-{yygotominor.yy4 = OE_Abort;}
117059
- break;
117060
- case 246: /* uniqueflag ::= */
117061
-{yygotominor.yy4 = OE_None;}
117062
- break;
117063
- case 249: /* idxlist ::= idxlist COMMA nm collate sortorder */
117064
-{
117065
- Expr *p = sqlite3ExprAddCollateToken(pParse, 0, &yymsp[-1].minor.yy0);
117066
- yygotominor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy322, p);
117067
- sqlite3ExprListSetName(pParse,yygotominor.yy322,&yymsp[-2].minor.yy0,1);
117068
- sqlite3ExprListCheckLength(pParse, yygotominor.yy322, "index");
117069
- if( yygotominor.yy322 ) yygotominor.yy322->a[yygotominor.yy322->nExpr-1].sortOrder = (u8)yymsp[0].minor.yy4;
117070
-}
117071
- break;
117072
- case 250: /* idxlist ::= nm collate sortorder */
117073
-{
117074
- Expr *p = sqlite3ExprAddCollateToken(pParse, 0, &yymsp[-1].minor.yy0);
117075
- yygotominor.yy322 = sqlite3ExprListAppend(pParse,0, p);
117076
- sqlite3ExprListSetName(pParse, yygotominor.yy322, &yymsp[-2].minor.yy0, 1);
117077
- sqlite3ExprListCheckLength(pParse, yygotominor.yy322, "index");
117078
- if( yygotominor.yy322 ) yygotominor.yy322->a[yygotominor.yy322->nExpr-1].sortOrder = (u8)yymsp[0].minor.yy4;
117079
-}
117080
- break;
117081
- case 251: /* collate ::= */
117543
+ sqlite3SrcListAppend(pParse->db,0,&yymsp[-4].minor.yy0,0), yymsp[-2].minor.yy14, yymsp[-10].minor.yy328,
117544
+ &yymsp[-11].minor.yy0, yymsp[0].minor.yy132, SQLITE_SO_ASC, yymsp[-8].minor.yy328);
117545
+}
117546
+ break;
117547
+ case 240: /* uniqueflag ::= UNIQUE */
117548
+ case 291: /* raisetype ::= ABORT */ yytestcase(yyruleno==291);
117549
+{yygotominor.yy328 = OE_Abort;}
117550
+ break;
117551
+ case 241: /* uniqueflag ::= */
117552
+{yygotominor.yy328 = OE_None;}
117553
+ break;
117554
+ case 244: /* idxlist ::= idxlist COMMA nm collate sortorder */
117555
+{
117556
+ Expr *p = sqlite3ExprAddCollateToken(pParse, 0, &yymsp[-1].minor.yy0);
117557
+ yygotominor.yy14 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy14, p);
117558
+ sqlite3ExprListSetName(pParse,yygotominor.yy14,&yymsp[-2].minor.yy0,1);
117559
+ sqlite3ExprListCheckLength(pParse, yygotominor.yy14, "index");
117560
+ if( yygotominor.yy14 ) yygotominor.yy14->a[yygotominor.yy14->nExpr-1].sortOrder = (u8)yymsp[0].minor.yy328;
117561
+}
117562
+ break;
117563
+ case 245: /* idxlist ::= nm collate sortorder */
117564
+{
117565
+ Expr *p = sqlite3ExprAddCollateToken(pParse, 0, &yymsp[-1].minor.yy0);
117566
+ yygotominor.yy14 = sqlite3ExprListAppend(pParse,0, p);
117567
+ sqlite3ExprListSetName(pParse, yygotominor.yy14, &yymsp[-2].minor.yy0, 1);
117568
+ sqlite3ExprListCheckLength(pParse, yygotominor.yy14, "index");
117569
+ if( yygotominor.yy14 ) yygotominor.yy14->a[yygotominor.yy14->nExpr-1].sortOrder = (u8)yymsp[0].minor.yy328;
117570
+}
117571
+ break;
117572
+ case 246: /* collate ::= */
117082117573
{yygotominor.yy0.z = 0; yygotominor.yy0.n = 0;}
117083117574
break;
117084
- case 253: /* cmd ::= DROP INDEX ifexists fullname */
117085
-{sqlite3DropIndex(pParse, yymsp[0].minor.yy259, yymsp[-1].minor.yy4);}
117575
+ case 248: /* cmd ::= DROP INDEX ifexists fullname */
117576
+{sqlite3DropIndex(pParse, yymsp[0].minor.yy65, yymsp[-1].minor.yy328);}
117086117577
break;
117087
- case 254: /* cmd ::= VACUUM */
117088
- case 255: /* cmd ::= VACUUM nm */ yytestcase(yyruleno==255);
117578
+ case 249: /* cmd ::= VACUUM */
117579
+ case 250: /* cmd ::= VACUUM nm */ yytestcase(yyruleno==250);
117089117580
{sqlite3Vacuum(pParse);}
117090117581
break;
117091
- case 256: /* cmd ::= PRAGMA nm dbnm */
117582
+ case 251: /* cmd ::= PRAGMA nm dbnm */
117092117583
{sqlite3Pragma(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,0,0);}
117093117584
break;
117094
- case 257: /* cmd ::= PRAGMA nm dbnm EQ nmnum */
117585
+ case 252: /* cmd ::= PRAGMA nm dbnm EQ nmnum */
117095117586
{sqlite3Pragma(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0,0);}
117096117587
break;
117097
- case 258: /* cmd ::= PRAGMA nm dbnm LP nmnum RP */
117588
+ case 253: /* cmd ::= PRAGMA nm dbnm LP nmnum RP */
117098117589
{sqlite3Pragma(pParse,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,&yymsp[-1].minor.yy0,0);}
117099117590
break;
117100
- case 259: /* cmd ::= PRAGMA nm dbnm EQ minus_num */
117591
+ case 254: /* cmd ::= PRAGMA nm dbnm EQ minus_num */
117101117592
{sqlite3Pragma(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0,1);}
117102117593
break;
117103
- case 260: /* cmd ::= PRAGMA nm dbnm LP minus_num RP */
117594
+ case 255: /* cmd ::= PRAGMA nm dbnm LP minus_num RP */
117104117595
{sqlite3Pragma(pParse,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,&yymsp[-1].minor.yy0,1);}
117105117596
break;
117106
- case 270: /* cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END */
117597
+ case 264: /* cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END */
117107117598
{
117108117599
Token all;
117109117600
all.z = yymsp[-3].minor.yy0.z;
117110117601
all.n = (int)(yymsp[0].minor.yy0.z - yymsp[-3].minor.yy0.z) + yymsp[0].minor.yy0.n;
117111
- sqlite3FinishTrigger(pParse, yymsp[-1].minor.yy203, &all);
117602
+ sqlite3FinishTrigger(pParse, yymsp[-1].minor.yy473, &all);
117112117603
}
117113117604
break;
117114
- case 271: /* trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause */
117605
+ case 265: /* trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause */
117115117606
{
117116
- sqlite3BeginTrigger(pParse, &yymsp[-7].minor.yy0, &yymsp[-6].minor.yy0, yymsp[-5].minor.yy4, yymsp[-4].minor.yy90.a, yymsp[-4].minor.yy90.b, yymsp[-2].minor.yy259, yymsp[0].minor.yy314, yymsp[-10].minor.yy4, yymsp[-8].minor.yy4);
117607
+ sqlite3BeginTrigger(pParse, &yymsp[-7].minor.yy0, &yymsp[-6].minor.yy0, yymsp[-5].minor.yy328, yymsp[-4].minor.yy378.a, yymsp[-4].minor.yy378.b, yymsp[-2].minor.yy65, yymsp[0].minor.yy132, yymsp[-10].minor.yy328, yymsp[-8].minor.yy328);
117117117608
yygotominor.yy0 = (yymsp[-6].minor.yy0.n==0?yymsp[-7].minor.yy0:yymsp[-6].minor.yy0);
117118117609
}
117119117610
break;
117120
- case 272: /* trigger_time ::= BEFORE */
117121
- case 275: /* trigger_time ::= */ yytestcase(yyruleno==275);
117122
-{ yygotominor.yy4 = TK_BEFORE; }
117123
- break;
117124
- case 273: /* trigger_time ::= AFTER */
117125
-{ yygotominor.yy4 = TK_AFTER; }
117126
- break;
117127
- case 274: /* trigger_time ::= INSTEAD OF */
117128
-{ yygotominor.yy4 = TK_INSTEAD;}
117129
- break;
117130
- case 276: /* trigger_event ::= DELETE|INSERT */
117131
- case 277: /* trigger_event ::= UPDATE */ yytestcase(yyruleno==277);
117132
-{yygotominor.yy90.a = yymsp[0].major; yygotominor.yy90.b = 0;}
117133
- break;
117134
- case 278: /* trigger_event ::= UPDATE OF idlist */
117135
-{yygotominor.yy90.a = TK_UPDATE; yygotominor.yy90.b = yymsp[0].minor.yy384;}
117136
- break;
117137
- case 281: /* when_clause ::= */
117138
- case 303: /* key_opt ::= */ yytestcase(yyruleno==303);
117139
-{ yygotominor.yy314 = 0; }
117140
- break;
117141
- case 282: /* when_clause ::= WHEN expr */
117142
- case 304: /* key_opt ::= KEY expr */ yytestcase(yyruleno==304);
117143
-{ yygotominor.yy314 = yymsp[0].minor.yy118.pExpr; }
117144
- break;
117145
- case 283: /* trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI */
117146
-{
117147
- assert( yymsp[-2].minor.yy203!=0 );
117148
- yymsp[-2].minor.yy203->pLast->pNext = yymsp[-1].minor.yy203;
117149
- yymsp[-2].minor.yy203->pLast = yymsp[-1].minor.yy203;
117150
- yygotominor.yy203 = yymsp[-2].minor.yy203;
117151
-}
117152
- break;
117153
- case 284: /* trigger_cmd_list ::= trigger_cmd SEMI */
117154
-{
117155
- assert( yymsp[-1].minor.yy203!=0 );
117156
- yymsp[-1].minor.yy203->pLast = yymsp[-1].minor.yy203;
117157
- yygotominor.yy203 = yymsp[-1].minor.yy203;
117158
-}
117159
- break;
117160
- case 286: /* trnm ::= nm DOT nm */
117611
+ case 266: /* trigger_time ::= BEFORE */
117612
+ case 269: /* trigger_time ::= */ yytestcase(yyruleno==269);
117613
+{ yygotominor.yy328 = TK_BEFORE; }
117614
+ break;
117615
+ case 267: /* trigger_time ::= AFTER */
117616
+{ yygotominor.yy328 = TK_AFTER; }
117617
+ break;
117618
+ case 268: /* trigger_time ::= INSTEAD OF */
117619
+{ yygotominor.yy328 = TK_INSTEAD;}
117620
+ break;
117621
+ case 270: /* trigger_event ::= DELETE|INSERT */
117622
+ case 271: /* trigger_event ::= UPDATE */ yytestcase(yyruleno==271);
117623
+{yygotominor.yy378.a = yymsp[0].major; yygotominor.yy378.b = 0;}
117624
+ break;
117625
+ case 272: /* trigger_event ::= UPDATE OF idlist */
117626
+{yygotominor.yy378.a = TK_UPDATE; yygotominor.yy378.b = yymsp[0].minor.yy408;}
117627
+ break;
117628
+ case 275: /* when_clause ::= */
117629
+ case 296: /* key_opt ::= */ yytestcase(yyruleno==296);
117630
+{ yygotominor.yy132 = 0; }
117631
+ break;
117632
+ case 276: /* when_clause ::= WHEN expr */
117633
+ case 297: /* key_opt ::= KEY expr */ yytestcase(yyruleno==297);
117634
+{ yygotominor.yy132 = yymsp[0].minor.yy346.pExpr; }
117635
+ break;
117636
+ case 277: /* trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI */
117637
+{
117638
+ assert( yymsp[-2].minor.yy473!=0 );
117639
+ yymsp[-2].minor.yy473->pLast->pNext = yymsp[-1].minor.yy473;
117640
+ yymsp[-2].minor.yy473->pLast = yymsp[-1].minor.yy473;
117641
+ yygotominor.yy473 = yymsp[-2].minor.yy473;
117642
+}
117643
+ break;
117644
+ case 278: /* trigger_cmd_list ::= trigger_cmd SEMI */
117645
+{
117646
+ assert( yymsp[-1].minor.yy473!=0 );
117647
+ yymsp[-1].minor.yy473->pLast = yymsp[-1].minor.yy473;
117648
+ yygotominor.yy473 = yymsp[-1].minor.yy473;
117649
+}
117650
+ break;
117651
+ case 280: /* trnm ::= nm DOT nm */
117161117652
{
117162117653
yygotominor.yy0 = yymsp[0].minor.yy0;
117163117654
sqlite3ErrorMsg(pParse,
117164117655
"qualified table names are not allowed on INSERT, UPDATE, and DELETE "
117165117656
"statements within triggers");
117166117657
}
117167117658
break;
117168
- case 288: /* tridxby ::= INDEXED BY nm */
117659
+ case 282: /* tridxby ::= INDEXED BY nm */
117169117660
{
117170117661
sqlite3ErrorMsg(pParse,
117171117662
"the INDEXED BY clause is not allowed on UPDATE or DELETE statements "
117172117663
"within triggers");
117173117664
}
117174117665
break;
117175
- case 289: /* tridxby ::= NOT INDEXED */
117666
+ case 283: /* tridxby ::= NOT INDEXED */
117176117667
{
117177117668
sqlite3ErrorMsg(pParse,
117178117669
"the NOT INDEXED clause is not allowed on UPDATE or DELETE statements "
117179117670
"within triggers");
117180117671
}
117181117672
break;
117182
- case 290: /* trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist where_opt */
117183
-{ yygotominor.yy203 = sqlite3TriggerUpdateStep(pParse->db, &yymsp[-4].minor.yy0, yymsp[-1].minor.yy322, yymsp[0].minor.yy314, yymsp[-5].minor.yy210); }
117184
- break;
117185
- case 291: /* trigger_cmd ::= insert_cmd INTO trnm inscollist_opt valuelist */
117186
-{yygotominor.yy203 = sqlite3TriggerInsertStep(pParse->db, &yymsp[-2].minor.yy0, yymsp[-1].minor.yy384, yymsp[0].minor.yy260.pList, yymsp[0].minor.yy260.pSelect, yymsp[-4].minor.yy210);}
117187
- break;
117188
- case 292: /* trigger_cmd ::= insert_cmd INTO trnm inscollist_opt select */
117189
-{yygotominor.yy203 = sqlite3TriggerInsertStep(pParse->db, &yymsp[-2].minor.yy0, yymsp[-1].minor.yy384, 0, yymsp[0].minor.yy387, yymsp[-4].minor.yy210);}
117190
- break;
117191
- case 293: /* trigger_cmd ::= DELETE FROM trnm tridxby where_opt */
117192
-{yygotominor.yy203 = sqlite3TriggerDeleteStep(pParse->db, &yymsp[-2].minor.yy0, yymsp[0].minor.yy314);}
117193
- break;
117194
- case 294: /* trigger_cmd ::= select */
117195
-{yygotominor.yy203 = sqlite3TriggerSelectStep(pParse->db, yymsp[0].minor.yy387); }
117196
- break;
117197
- case 295: /* expr ::= RAISE LP IGNORE RP */
117198
-{
117199
- yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_RAISE, 0, 0, 0);
117200
- if( yygotominor.yy118.pExpr ){
117201
- yygotominor.yy118.pExpr->affinity = OE_Ignore;
117202
- }
117203
- yygotominor.yy118.zStart = yymsp[-3].minor.yy0.z;
117204
- yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
117205
-}
117206
- break;
117207
- case 296: /* expr ::= RAISE LP raisetype COMMA nm RP */
117208
-{
117209
- yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_RAISE, 0, 0, &yymsp[-1].minor.yy0);
117210
- if( yygotominor.yy118.pExpr ) {
117211
- yygotominor.yy118.pExpr->affinity = (char)yymsp[-3].minor.yy4;
117212
- }
117213
- yygotominor.yy118.zStart = yymsp[-5].minor.yy0.z;
117214
- yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
117215
-}
117216
- break;
117217
- case 297: /* raisetype ::= ROLLBACK */
117218
-{yygotominor.yy4 = OE_Rollback;}
117219
- break;
117220
- case 299: /* raisetype ::= FAIL */
117221
-{yygotominor.yy4 = OE_Fail;}
117222
- break;
117223
- case 300: /* cmd ::= DROP TRIGGER ifexists fullname */
117224
-{
117225
- sqlite3DropTrigger(pParse,yymsp[0].minor.yy259,yymsp[-1].minor.yy4);
117226
-}
117227
- break;
117228
- case 301: /* cmd ::= ATTACH database_kw_opt expr AS expr key_opt */
117229
-{
117230
- sqlite3Attach(pParse, yymsp[-3].minor.yy118.pExpr, yymsp[-1].minor.yy118.pExpr, yymsp[0].minor.yy314);
117231
-}
117232
- break;
117233
- case 302: /* cmd ::= DETACH database_kw_opt expr */
117234
-{
117235
- sqlite3Detach(pParse, yymsp[0].minor.yy118.pExpr);
117236
-}
117237
- break;
117238
- case 307: /* cmd ::= REINDEX */
117673
+ case 284: /* trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist where_opt */
117674
+{ yygotominor.yy473 = sqlite3TriggerUpdateStep(pParse->db, &yymsp[-4].minor.yy0, yymsp[-1].minor.yy14, yymsp[0].minor.yy132, yymsp[-5].minor.yy186); }
117675
+ break;
117676
+ case 285: /* trigger_cmd ::= insert_cmd INTO trnm inscollist_opt select */
117677
+{yygotominor.yy473 = sqlite3TriggerInsertStep(pParse->db, &yymsp[-2].minor.yy0, yymsp[-1].minor.yy408, yymsp[0].minor.yy3, yymsp[-4].minor.yy186);}
117678
+ break;
117679
+ case 286: /* trigger_cmd ::= DELETE FROM trnm tridxby where_opt */
117680
+{yygotominor.yy473 = sqlite3TriggerDeleteStep(pParse->db, &yymsp[-2].minor.yy0, yymsp[0].minor.yy132);}
117681
+ break;
117682
+ case 287: /* trigger_cmd ::= select */
117683
+{yygotominor.yy473 = sqlite3TriggerSelectStep(pParse->db, yymsp[0].minor.yy3); }
117684
+ break;
117685
+ case 288: /* expr ::= RAISE LP IGNORE RP */
117686
+{
117687
+ yygotominor.yy346.pExpr = sqlite3PExpr(pParse, TK_RAISE, 0, 0, 0);
117688
+ if( yygotominor.yy346.pExpr ){
117689
+ yygotominor.yy346.pExpr->affinity = OE_Ignore;
117690
+ }
117691
+ yygotominor.yy346.zStart = yymsp[-3].minor.yy0.z;
117692
+ yygotominor.yy346.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
117693
+}
117694
+ break;
117695
+ case 289: /* expr ::= RAISE LP raisetype COMMA nm RP */
117696
+{
117697
+ yygotominor.yy346.pExpr = sqlite3PExpr(pParse, TK_RAISE, 0, 0, &yymsp[-1].minor.yy0);
117698
+ if( yygotominor.yy346.pExpr ) {
117699
+ yygotominor.yy346.pExpr->affinity = (char)yymsp[-3].minor.yy328;
117700
+ }
117701
+ yygotominor.yy346.zStart = yymsp[-5].minor.yy0.z;
117702
+ yygotominor.yy346.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
117703
+}
117704
+ break;
117705
+ case 290: /* raisetype ::= ROLLBACK */
117706
+{yygotominor.yy328 = OE_Rollback;}
117707
+ break;
117708
+ case 292: /* raisetype ::= FAIL */
117709
+{yygotominor.yy328 = OE_Fail;}
117710
+ break;
117711
+ case 293: /* cmd ::= DROP TRIGGER ifexists fullname */
117712
+{
117713
+ sqlite3DropTrigger(pParse,yymsp[0].minor.yy65,yymsp[-1].minor.yy328);
117714
+}
117715
+ break;
117716
+ case 294: /* cmd ::= ATTACH database_kw_opt expr AS expr key_opt */
117717
+{
117718
+ sqlite3Attach(pParse, yymsp[-3].minor.yy346.pExpr, yymsp[-1].minor.yy346.pExpr, yymsp[0].minor.yy132);
117719
+}
117720
+ break;
117721
+ case 295: /* cmd ::= DETACH database_kw_opt expr */
117722
+{
117723
+ sqlite3Detach(pParse, yymsp[0].minor.yy346.pExpr);
117724
+}
117725
+ break;
117726
+ case 300: /* cmd ::= REINDEX */
117239117727
{sqlite3Reindex(pParse, 0, 0);}
117240117728
break;
117241
- case 308: /* cmd ::= REINDEX nm dbnm */
117729
+ case 301: /* cmd ::= REINDEX nm dbnm */
117242117730
{sqlite3Reindex(pParse, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0);}
117243117731
break;
117244
- case 309: /* cmd ::= ANALYZE */
117732
+ case 302: /* cmd ::= ANALYZE */
117245117733
{sqlite3Analyze(pParse, 0, 0);}
117246117734
break;
117247
- case 310: /* cmd ::= ANALYZE nm dbnm */
117735
+ case 303: /* cmd ::= ANALYZE nm dbnm */
117248117736
{sqlite3Analyze(pParse, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0);}
117249117737
break;
117250
- case 311: /* cmd ::= ALTER TABLE fullname RENAME TO nm */
117738
+ case 304: /* cmd ::= ALTER TABLE fullname RENAME TO nm */
117251117739
{
117252
- sqlite3AlterRenameTable(pParse,yymsp[-3].minor.yy259,&yymsp[0].minor.yy0);
117740
+ sqlite3AlterRenameTable(pParse,yymsp[-3].minor.yy65,&yymsp[0].minor.yy0);
117253117741
}
117254117742
break;
117255
- case 312: /* cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt column */
117743
+ case 305: /* cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt column */
117256117744
{
117257117745
sqlite3AlterFinishAddColumn(pParse, &yymsp[0].minor.yy0);
117258117746
}
117259117747
break;
117260
- case 313: /* add_column_fullname ::= fullname */
117748
+ case 306: /* add_column_fullname ::= fullname */
117261117749
{
117262117750
pParse->db->lookaside.bEnabled = 0;
117263
- sqlite3AlterBeginAddColumn(pParse, yymsp[0].minor.yy259);
117751
+ sqlite3AlterBeginAddColumn(pParse, yymsp[0].minor.yy65);
117264117752
}
117265117753
break;
117266
- case 316: /* cmd ::= create_vtab */
117754
+ case 309: /* cmd ::= create_vtab */
117267117755
{sqlite3VtabFinishParse(pParse,0);}
117268117756
break;
117269
- case 317: /* cmd ::= create_vtab LP vtabarglist RP */
117757
+ case 310: /* cmd ::= create_vtab LP vtabarglist RP */
117270117758
{sqlite3VtabFinishParse(pParse,&yymsp[0].minor.yy0);}
117271117759
break;
117272
- case 318: /* create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm */
117760
+ case 311: /* create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm */
117273117761
{
117274
- sqlite3VtabBeginParse(pParse, &yymsp[-3].minor.yy0, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-4].minor.yy4);
117762
+ sqlite3VtabBeginParse(pParse, &yymsp[-3].minor.yy0, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-4].minor.yy328);
117275117763
}
117276117764
break;
117277
- case 321: /* vtabarg ::= */
117765
+ case 314: /* vtabarg ::= */
117278117766
{sqlite3VtabArgInit(pParse);}
117279117767
break;
117280
- case 323: /* vtabargtoken ::= ANY */
117281
- case 324: /* vtabargtoken ::= lp anylist RP */ yytestcase(yyruleno==324);
117282
- case 325: /* lp ::= LP */ yytestcase(yyruleno==325);
117768
+ case 316: /* vtabargtoken ::= ANY */
117769
+ case 317: /* vtabargtoken ::= lp anylist RP */ yytestcase(yyruleno==317);
117770
+ case 318: /* lp ::= LP */ yytestcase(yyruleno==318);
117283117771
{sqlite3VtabArgExtend(pParse,&yymsp[0].minor.yy0);}
117772
+ break;
117773
+ case 322: /* with ::= */
117774
+{yygotominor.yy59 = 0;}
117775
+ break;
117776
+ case 323: /* with ::= WITH wqlist */
117777
+ case 324: /* with ::= WITH RECURSIVE wqlist */ yytestcase(yyruleno==324);
117778
+{ yygotominor.yy59 = yymsp[0].minor.yy59; }
117779
+ break;
117780
+ case 325: /* wqlist ::= nm idxlist_opt AS LP select RP */
117781
+{
117782
+ yygotominor.yy59 = sqlite3WithAdd(pParse, 0, &yymsp[-5].minor.yy0, yymsp[-4].minor.yy14, yymsp[-1].minor.yy3);
117783
+}
117784
+ break;
117785
+ case 326: /* wqlist ::= wqlist COMMA nm idxlist_opt AS LP select RP */
117786
+{
117787
+ yygotominor.yy59 = sqlite3WithAdd(pParse, yymsp[-7].minor.yy59, &yymsp[-5].minor.yy0, yymsp[-4].minor.yy14, yymsp[-1].minor.yy3);
117788
+}
117284117789
break;
117285117790
default:
117286117791
/* (0) input ::= cmdlist */ yytestcase(yyruleno==0);
117287117792
/* (1) cmdlist ::= cmdlist ecmd */ yytestcase(yyruleno==1);
117288117793
/* (2) cmdlist ::= ecmd */ yytestcase(yyruleno==2);
@@ -117294,32 +117799,32 @@
117294117799
/* (20) savepoint_opt ::= SAVEPOINT */ yytestcase(yyruleno==20);
117295117800
/* (21) savepoint_opt ::= */ yytestcase(yyruleno==21);
117296117801
/* (25) cmd ::= create_table create_table_args */ yytestcase(yyruleno==25);
117297117802
/* (36) columnlist ::= columnlist COMMA column */ yytestcase(yyruleno==36);
117298117803
/* (37) columnlist ::= column */ yytestcase(yyruleno==37);
117299
- /* (46) type ::= */ yytestcase(yyruleno==46);
117300
- /* (53) signed ::= plus_num */ yytestcase(yyruleno==53);
117301
- /* (54) signed ::= minus_num */ yytestcase(yyruleno==54);
117302
- /* (55) carglist ::= carglist ccons */ yytestcase(yyruleno==55);
117303
- /* (56) carglist ::= */ yytestcase(yyruleno==56);
117304
- /* (63) ccons ::= NULL onconf */ yytestcase(yyruleno==63);
117305
- /* (91) conslist ::= conslist tconscomma tcons */ yytestcase(yyruleno==91);
117306
- /* (92) conslist ::= tcons */ yytestcase(yyruleno==92);
117307
- /* (94) tconscomma ::= */ yytestcase(yyruleno==94);
117308
- /* (279) foreach_clause ::= */ yytestcase(yyruleno==279);
117309
- /* (280) foreach_clause ::= FOR EACH ROW */ yytestcase(yyruleno==280);
117310
- /* (287) tridxby ::= */ yytestcase(yyruleno==287);
117311
- /* (305) database_kw_opt ::= DATABASE */ yytestcase(yyruleno==305);
117312
- /* (306) database_kw_opt ::= */ yytestcase(yyruleno==306);
117313
- /* (314) kwcolumn_opt ::= */ yytestcase(yyruleno==314);
117314
- /* (315) kwcolumn_opt ::= COLUMNKW */ yytestcase(yyruleno==315);
117315
- /* (319) vtabarglist ::= vtabarg */ yytestcase(yyruleno==319);
117316
- /* (320) vtabarglist ::= vtabarglist COMMA vtabarg */ yytestcase(yyruleno==320);
117317
- /* (322) vtabarg ::= vtabarg vtabargtoken */ yytestcase(yyruleno==322);
117318
- /* (326) anylist ::= */ yytestcase(yyruleno==326);
117319
- /* (327) anylist ::= anylist LP anylist RP */ yytestcase(yyruleno==327);
117320
- /* (328) anylist ::= anylist ANY */ yytestcase(yyruleno==328);
117804
+ /* (43) type ::= */ yytestcase(yyruleno==43);
117805
+ /* (50) signed ::= plus_num */ yytestcase(yyruleno==50);
117806
+ /* (51) signed ::= minus_num */ yytestcase(yyruleno==51);
117807
+ /* (52) carglist ::= carglist ccons */ yytestcase(yyruleno==52);
117808
+ /* (53) carglist ::= */ yytestcase(yyruleno==53);
117809
+ /* (60) ccons ::= NULL onconf */ yytestcase(yyruleno==60);
117810
+ /* (88) conslist ::= conslist tconscomma tcons */ yytestcase(yyruleno==88);
117811
+ /* (89) conslist ::= tcons */ yytestcase(yyruleno==89);
117812
+ /* (91) tconscomma ::= */ yytestcase(yyruleno==91);
117813
+ /* (273) foreach_clause ::= */ yytestcase(yyruleno==273);
117814
+ /* (274) foreach_clause ::= FOR EACH ROW */ yytestcase(yyruleno==274);
117815
+ /* (281) tridxby ::= */ yytestcase(yyruleno==281);
117816
+ /* (298) database_kw_opt ::= DATABASE */ yytestcase(yyruleno==298);
117817
+ /* (299) database_kw_opt ::= */ yytestcase(yyruleno==299);
117818
+ /* (307) kwcolumn_opt ::= */ yytestcase(yyruleno==307);
117819
+ /* (308) kwcolumn_opt ::= COLUMNKW */ yytestcase(yyruleno==308);
117820
+ /* (312) vtabarglist ::= vtabarg */ yytestcase(yyruleno==312);
117821
+ /* (313) vtabarglist ::= vtabarglist COMMA vtabarg */ yytestcase(yyruleno==313);
117822
+ /* (315) vtabarg ::= vtabarg vtabargtoken */ yytestcase(yyruleno==315);
117823
+ /* (319) anylist ::= */ yytestcase(yyruleno==319);
117824
+ /* (320) anylist ::= anylist LP anylist RP */ yytestcase(yyruleno==320);
117825
+ /* (321) anylist ::= anylist ANY */ yytestcase(yyruleno==321);
117321117826
break;
117322117827
};
117323117828
assert( yyruleno>=0 && yyruleno<sizeof(yyRuleInfo)/sizeof(yyRuleInfo[0]) );
117324117829
yygoto = yyRuleInfo[yyruleno].lhs;
117325117830
yysize = yyRuleInfo[yyruleno].nrhs;
@@ -117654,24 +118159,24 @@
117654118159
** might be implemented more directly using a hand-written hash table.
117655118160
** But by using this automatically generated code, the size of the code
117656118161
** is substantially reduced. This is important for embedded applications
117657118162
** on platforms with limited memory.
117658118163
*/
117659
-/* Hash score: 177 */
118164
+/* Hash score: 182 */
117660118165
static int keywordCode(const char *z, int n){
117661
- /* zText[] encodes 819 bytes of keywords in 545 bytes */
118166
+ /* zText[] encodes 834 bytes of keywords in 554 bytes */
117662118167
/* REINDEXEDESCAPEACHECKEYBEFOREIGNOREGEXPLAINSTEADDATABASELECT */
117663118168
/* ABLEFTHENDEFERRABLELSEXCEPTRANSACTIONATURALTERAISEXCLUSIVE */
117664118169
/* XISTSAVEPOINTERSECTRIGGEREFERENCESCONSTRAINTOFFSETEMPORARY */
117665
- /* UNIQUERYWITHOUTERELEASEATTACHAVINGROUPDATEBEGINNERENAMEBETWEEN */
117666
- /* OTNULLIKECASCADELETECASECOLLATECREATECURRENT_DATEDETACH */
118170
+ /* UNIQUERYWITHOUTERELEASEATTACHAVINGROUPDATEBEGINNERECURSIVE */
118171
+ /* BETWEENOTNULLIKECASCADELETECASECOLLATECREATECURRENT_DATEDETACH */
117667118172
/* IMMEDIATEJOINSERTMATCHPLANALYZEPRAGMABORTVALUESVIRTUALIMITWHEN */
117668
- /* WHEREPLACEAFTERESTRICTANDEFAULTAUTOINCREMENTCASTCOLUMNCOMMIT */
118173
+ /* WHERENAMEAFTEREPLACEANDEFAULTAUTOINCREMENTCASTCOLUMNCOMMIT */
117669118174
/* CONFLICTCROSSCURRENT_TIMESTAMPRIMARYDEFERREDISTINCTDROPFAIL */
117670
- /* FROMFULLGLOBYIFISNULLORDERIGHTROLLBACKROWUNIONUSINGVACUUMVIEW */
117671
- /* INITIALLY */
117672
- static const char zText[544] = {
118175
+ /* FROMFULLGLOBYIFISNULLORDERESTRICTRIGHTROLLBACKROWUNIONUSING */
118176
+ /* VACUUMVIEWINITIALLY */
118177
+ static const char zText[553] = {
117673118178
'R','E','I','N','D','E','X','E','D','E','S','C','A','P','E','A','C','H',
117674118179
'E','C','K','E','Y','B','E','F','O','R','E','I','G','N','O','R','E','G',
117675118180
'E','X','P','L','A','I','N','S','T','E','A','D','D','A','T','A','B','A',
117676118181
'S','E','L','E','C','T','A','B','L','E','F','T','H','E','N','D','E','F',
117677118182
'E','R','R','A','B','L','E','L','S','E','X','C','E','P','T','R','A','N',
@@ -117680,104 +118185,104 @@
117680118185
'P','O','I','N','T','E','R','S','E','C','T','R','I','G','G','E','R','E',
117681118186
'F','E','R','E','N','C','E','S','C','O','N','S','T','R','A','I','N','T',
117682118187
'O','F','F','S','E','T','E','M','P','O','R','A','R','Y','U','N','I','Q',
117683118188
'U','E','R','Y','W','I','T','H','O','U','T','E','R','E','L','E','A','S',
117684118189
'E','A','T','T','A','C','H','A','V','I','N','G','R','O','U','P','D','A',
117685
- 'T','E','B','E','G','I','N','N','E','R','E','N','A','M','E','B','E','T',
117686
- 'W','E','E','N','O','T','N','U','L','L','I','K','E','C','A','S','C','A',
117687
- 'D','E','L','E','T','E','C','A','S','E','C','O','L','L','A','T','E','C',
117688
- 'R','E','A','T','E','C','U','R','R','E','N','T','_','D','A','T','E','D',
117689
- 'E','T','A','C','H','I','M','M','E','D','I','A','T','E','J','O','I','N',
117690
- 'S','E','R','T','M','A','T','C','H','P','L','A','N','A','L','Y','Z','E',
117691
- 'P','R','A','G','M','A','B','O','R','T','V','A','L','U','E','S','V','I',
117692
- 'R','T','U','A','L','I','M','I','T','W','H','E','N','W','H','E','R','E',
117693
- 'P','L','A','C','E','A','F','T','E','R','E','S','T','R','I','C','T','A',
117694
- 'N','D','E','F','A','U','L','T','A','U','T','O','I','N','C','R','E','M',
117695
- 'E','N','T','C','A','S','T','C','O','L','U','M','N','C','O','M','M','I',
117696
- 'T','C','O','N','F','L','I','C','T','C','R','O','S','S','C','U','R','R',
117697
- 'E','N','T','_','T','I','M','E','S','T','A','M','P','R','I','M','A','R',
117698
- 'Y','D','E','F','E','R','R','E','D','I','S','T','I','N','C','T','D','R',
117699
- 'O','P','F','A','I','L','F','R','O','M','F','U','L','L','G','L','O','B',
117700
- 'Y','I','F','I','S','N','U','L','L','O','R','D','E','R','I','G','H','T',
117701
- 'R','O','L','L','B','A','C','K','R','O','W','U','N','I','O','N','U','S',
117702
- 'I','N','G','V','A','C','U','U','M','V','I','E','W','I','N','I','T','I',
117703
- 'A','L','L','Y',
118190
+ 'T','E','B','E','G','I','N','N','E','R','E','C','U','R','S','I','V','E',
118191
+ 'B','E','T','W','E','E','N','O','T','N','U','L','L','I','K','E','C','A',
118192
+ 'S','C','A','D','E','L','E','T','E','C','A','S','E','C','O','L','L','A',
118193
+ 'T','E','C','R','E','A','T','E','C','U','R','R','E','N','T','_','D','A',
118194
+ 'T','E','D','E','T','A','C','H','I','M','M','E','D','I','A','T','E','J',
118195
+ 'O','I','N','S','E','R','T','M','A','T','C','H','P','L','A','N','A','L',
118196
+ 'Y','Z','E','P','R','A','G','M','A','B','O','R','T','V','A','L','U','E',
118197
+ 'S','V','I','R','T','U','A','L','I','M','I','T','W','H','E','N','W','H',
118198
+ 'E','R','E','N','A','M','E','A','F','T','E','R','E','P','L','A','C','E',
118199
+ 'A','N','D','E','F','A','U','L','T','A','U','T','O','I','N','C','R','E',
118200
+ 'M','E','N','T','C','A','S','T','C','O','L','U','M','N','C','O','M','M',
118201
+ 'I','T','C','O','N','F','L','I','C','T','C','R','O','S','S','C','U','R',
118202
+ 'R','E','N','T','_','T','I','M','E','S','T','A','M','P','R','I','M','A',
118203
+ 'R','Y','D','E','F','E','R','R','E','D','I','S','T','I','N','C','T','D',
118204
+ 'R','O','P','F','A','I','L','F','R','O','M','F','U','L','L','G','L','O',
118205
+ 'B','Y','I','F','I','S','N','U','L','L','O','R','D','E','R','E','S','T',
118206
+ 'R','I','C','T','R','I','G','H','T','R','O','L','L','B','A','C','K','R',
118207
+ 'O','W','U','N','I','O','N','U','S','I','N','G','V','A','C','U','U','M',
118208
+ 'V','I','E','W','I','N','I','T','I','A','L','L','Y',
117704118209
};
117705118210
static const unsigned char aHash[127] = {
117706
- 75, 104, 115, 73, 0, 45, 0, 0, 81, 0, 76, 0, 0,
117707
- 42, 12, 77, 15, 0, 114, 84, 53, 111, 0, 19, 0, 0,
117708
- 119, 0, 117, 88, 0, 22, 92, 0, 9, 0, 0, 69, 70,
117709
- 0, 68, 6, 0, 48, 89, 101, 0, 116, 100, 0, 0, 44,
117710
- 0, 102, 24, 0, 17, 0, 120, 52, 23, 0, 5, 109, 25,
117711
- 95, 0, 0, 122, 105, 59, 121, 56, 28, 54, 0, 90, 0,
117712
- 99, 26, 0, 98, 0, 0, 0, 94, 91, 96, 87, 108, 14,
117713
- 39, 107, 0, 80, 0, 18, 86, 110, 32, 0, 118, 79, 112,
117714
- 61, 46, 83, 0, 0, 93, 40, 0, 113, 0, 36, 0, 0,
117715
- 29, 0, 85, 62, 63, 0, 20, 60, 0, 55,
118211
+ 76, 105, 117, 74, 0, 45, 0, 0, 82, 0, 77, 0, 0,
118212
+ 42, 12, 78, 15, 0, 116, 85, 54, 112, 0, 19, 0, 0,
118213
+ 121, 0, 119, 115, 0, 22, 93, 0, 9, 0, 0, 70, 71,
118214
+ 0, 69, 6, 0, 48, 90, 102, 0, 118, 101, 0, 0, 44,
118215
+ 0, 103, 24, 0, 17, 0, 122, 53, 23, 0, 5, 110, 25,
118216
+ 96, 0, 0, 124, 106, 60, 123, 57, 28, 55, 0, 91, 0,
118217
+ 100, 26, 0, 99, 0, 0, 0, 95, 92, 97, 88, 109, 14,
118218
+ 39, 108, 0, 81, 0, 18, 89, 111, 32, 0, 120, 80, 113,
118219
+ 62, 46, 84, 0, 0, 94, 40, 59, 114, 0, 36, 0, 0,
118220
+ 29, 0, 86, 63, 64, 0, 20, 61, 0, 56,
117716118221
};
117717
- static const unsigned char aNext[122] = {
118222
+ static const unsigned char aNext[124] = {
117718118223
0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0,
117719118224
0, 2, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0,
117720118225
0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
117721
- 0, 0, 0, 0, 33, 0, 21, 0, 0, 0, 0, 0, 0,
117722
- 43, 3, 47, 0, 0, 0, 0, 30, 0, 57, 0, 38, 0,
117723
- 0, 0, 1, 65, 0, 0, 66, 0, 41, 0, 0, 0, 0,
117724
- 0, 0, 49, 64, 0, 0, 0, 51, 31, 0, 16, 34, 10,
117725
- 0, 0, 0, 0, 0, 0, 0, 11, 71, 78, 0, 8, 0,
117726
- 103, 97, 0, 106, 0, 58, 0, 74, 50, 27, 37, 72, 82,
117727
- 0, 35, 67, 0, 0,
118226
+ 0, 0, 0, 0, 33, 0, 21, 0, 0, 0, 0, 0, 50,
118227
+ 0, 43, 3, 47, 0, 0, 0, 0, 30, 0, 58, 0, 38,
118228
+ 0, 0, 0, 1, 66, 0, 0, 67, 0, 41, 0, 0, 0,
118229
+ 0, 0, 0, 49, 65, 0, 0, 0, 0, 31, 52, 16, 34,
118230
+ 10, 0, 0, 0, 0, 0, 0, 0, 11, 72, 79, 0, 8,
118231
+ 0, 104, 98, 0, 107, 0, 87, 0, 75, 51, 0, 27, 37,
118232
+ 73, 83, 0, 35, 68, 0, 0,
117728118233
};
117729
- static const unsigned char aLen[122] = {
118234
+ static const unsigned char aLen[124] = {
117730118235
7, 7, 5, 4, 6, 4, 5, 3, 6, 7, 3, 6, 6,
117731118236
7, 7, 3, 8, 2, 6, 5, 4, 4, 3, 10, 4, 6,
117732118237
11, 6, 2, 7, 5, 5, 9, 6, 9, 9, 7, 10, 10,
117733
- 4, 6, 2, 3, 9, 4, 2, 6, 5, 7, 5, 7, 6,
117734
- 6, 5, 6, 5, 5, 6, 7, 7, 3, 2, 4, 4, 7,
117735
- 3, 6, 4, 7, 6, 12, 6, 9, 4, 6, 5, 4, 7,
117736
- 6, 5, 6, 7, 5, 4, 5, 7, 5, 8, 3, 7, 13,
117737
- 2, 2, 4, 6, 6, 8, 5, 17, 12, 7, 8, 8, 2,
117738
- 4, 4, 4, 4, 4, 2, 2, 6, 5, 5, 8, 3, 5,
117739
- 5, 6, 4, 9, 3,
118238
+ 4, 6, 2, 3, 9, 4, 2, 6, 5, 7, 4, 5, 7,
118239
+ 6, 6, 5, 6, 5, 5, 9, 7, 7, 3, 2, 4, 4,
118240
+ 7, 3, 6, 4, 7, 6, 12, 6, 9, 4, 6, 5, 4,
118241
+ 7, 6, 5, 6, 7, 5, 4, 5, 6, 5, 7, 3, 7,
118242
+ 13, 2, 2, 4, 6, 6, 8, 5, 17, 12, 7, 8, 8,
118243
+ 2, 4, 4, 4, 4, 4, 2, 2, 6, 5, 8, 5, 8,
118244
+ 3, 5, 5, 6, 4, 9, 3,
117740118245
};
117741
- static const unsigned short int aOffset[122] = {
118246
+ static const unsigned short int aOffset[124] = {
117742118247
0, 2, 2, 8, 9, 14, 16, 20, 23, 25, 25, 29, 33,
117743118248
36, 41, 46, 48, 53, 54, 59, 62, 65, 67, 69, 78, 81,
117744118249
86, 91, 95, 96, 101, 105, 109, 117, 122, 128, 136, 142, 152,
117745
- 159, 162, 162, 165, 167, 167, 171, 176, 179, 184, 188, 192, 199,
117746
- 204, 209, 212, 218, 221, 225, 231, 237, 237, 237, 240, 243, 247,
117747
- 248, 252, 258, 262, 269, 275, 287, 293, 302, 304, 310, 315, 317,
117748
- 324, 329, 334, 340, 346, 351, 355, 358, 365, 369, 377, 379, 386,
117749
- 388, 390, 399, 403, 409, 415, 423, 428, 428, 444, 451, 458, 459,
117750
- 466, 470, 474, 478, 482, 485, 487, 489, 495, 499, 504, 512, 515,
117751
- 520, 525, 531, 535, 540,
118250
+ 159, 162, 162, 165, 167, 167, 171, 176, 179, 184, 184, 188, 192,
118251
+ 199, 204, 209, 212, 218, 221, 225, 234, 240, 240, 240, 243, 246,
118252
+ 250, 251, 255, 261, 265, 272, 278, 290, 296, 305, 307, 313, 318,
118253
+ 320, 327, 332, 337, 343, 349, 354, 358, 361, 367, 371, 378, 380,
118254
+ 387, 389, 391, 400, 404, 410, 416, 424, 429, 429, 445, 452, 459,
118255
+ 460, 467, 471, 475, 479, 483, 486, 488, 490, 496, 500, 508, 513,
118256
+ 521, 524, 529, 534, 540, 544, 549,
117752118257
};
117753
- static const unsigned char aCode[122] = {
118258
+ static const unsigned char aCode[124] = {
117754118259
TK_REINDEX, TK_INDEXED, TK_INDEX, TK_DESC, TK_ESCAPE,
117755118260
TK_EACH, TK_CHECK, TK_KEY, TK_BEFORE, TK_FOREIGN,
117756118261
TK_FOR, TK_IGNORE, TK_LIKE_KW, TK_EXPLAIN, TK_INSTEAD,
117757118262
TK_ADD, TK_DATABASE, TK_AS, TK_SELECT, TK_TABLE,
117758118263
TK_JOIN_KW, TK_THEN, TK_END, TK_DEFERRABLE, TK_ELSE,
117759118264
TK_EXCEPT, TK_TRANSACTION,TK_ACTION, TK_ON, TK_JOIN_KW,
117760118265
TK_ALTER, TK_RAISE, TK_EXCLUSIVE, TK_EXISTS, TK_SAVEPOINT,
117761118266
TK_INTERSECT, TK_TRIGGER, TK_REFERENCES, TK_CONSTRAINT, TK_INTO,
117762118267
TK_OFFSET, TK_OF, TK_SET, TK_TEMP, TK_TEMP,
117763
- TK_OR, TK_UNIQUE, TK_QUERY, TK_WITHOUT, TK_JOIN_KW,
117764
- TK_RELEASE, TK_ATTACH, TK_HAVING, TK_GROUP, TK_UPDATE,
117765
- TK_BEGIN, TK_JOIN_KW, TK_RENAME, TK_BETWEEN, TK_NOTNULL,
117766
- TK_NOT, TK_NO, TK_NULL, TK_LIKE_KW, TK_CASCADE,
117767
- TK_ASC, TK_DELETE, TK_CASE, TK_COLLATE, TK_CREATE,
117768
- TK_CTIME_KW, TK_DETACH, TK_IMMEDIATE, TK_JOIN, TK_INSERT,
117769
- TK_MATCH, TK_PLAN, TK_ANALYZE, TK_PRAGMA, TK_ABORT,
117770
- TK_VALUES, TK_VIRTUAL, TK_LIMIT, TK_WHEN, TK_WHERE,
117771
- TK_REPLACE, TK_AFTER, TK_RESTRICT, TK_AND, TK_DEFAULT,
117772
- TK_AUTOINCR, TK_TO, TK_IN, TK_CAST, TK_COLUMNKW,
117773
- TK_COMMIT, TK_CONFLICT, TK_JOIN_KW, TK_CTIME_KW, TK_CTIME_KW,
117774
- TK_PRIMARY, TK_DEFERRED, TK_DISTINCT, TK_IS, TK_DROP,
117775
- TK_FAIL, TK_FROM, TK_JOIN_KW, TK_LIKE_KW, TK_BY,
117776
- TK_IF, TK_ISNULL, TK_ORDER, TK_JOIN_KW, TK_ROLLBACK,
117777
- TK_ROW, TK_UNION, TK_USING, TK_VACUUM, TK_VIEW,
117778
- TK_INITIALLY, TK_ALL,
118268
+ TK_OR, TK_UNIQUE, TK_QUERY, TK_WITHOUT, TK_WITH,
118269
+ TK_JOIN_KW, TK_RELEASE, TK_ATTACH, TK_HAVING, TK_GROUP,
118270
+ TK_UPDATE, TK_BEGIN, TK_JOIN_KW, TK_RECURSIVE, TK_BETWEEN,
118271
+ TK_NOTNULL, TK_NOT, TK_NO, TK_NULL, TK_LIKE_KW,
118272
+ TK_CASCADE, TK_ASC, TK_DELETE, TK_CASE, TK_COLLATE,
118273
+ TK_CREATE, TK_CTIME_KW, TK_DETACH, TK_IMMEDIATE, TK_JOIN,
118274
+ TK_INSERT, TK_MATCH, TK_PLAN, TK_ANALYZE, TK_PRAGMA,
118275
+ TK_ABORT, TK_VALUES, TK_VIRTUAL, TK_LIMIT, TK_WHEN,
118276
+ TK_WHERE, TK_RENAME, TK_AFTER, TK_REPLACE, TK_AND,
118277
+ TK_DEFAULT, TK_AUTOINCR, TK_TO, TK_IN, TK_CAST,
118278
+ TK_COLUMNKW, TK_COMMIT, TK_CONFLICT, TK_JOIN_KW, TK_CTIME_KW,
118279
+ TK_CTIME_KW, TK_PRIMARY, TK_DEFERRED, TK_DISTINCT, TK_IS,
118280
+ TK_DROP, TK_FAIL, TK_FROM, TK_JOIN_KW, TK_LIKE_KW,
118281
+ TK_BY, TK_IF, TK_ISNULL, TK_ORDER, TK_RESTRICT,
118282
+ TK_JOIN_KW, TK_ROLLBACK, TK_ROW, TK_UNION, TK_USING,
118283
+ TK_VACUUM, TK_VIEW, TK_INITIALLY, TK_ALL,
117779118284
};
117780118285
int h, i;
117781118286
if( n<2 ) return TK_ID;
117782118287
h = ((charMap(z[0])*4) ^
117783118288
(charMap(z[n-1])*3) ^
@@ -117831,92 +118336,94 @@
117831118336
testcase( i==44 ); /* TEMP */
117832118337
testcase( i==45 ); /* OR */
117833118338
testcase( i==46 ); /* UNIQUE */
117834118339
testcase( i==47 ); /* QUERY */
117835118340
testcase( i==48 ); /* WITHOUT */
117836
- testcase( i==49 ); /* OUTER */
117837
- testcase( i==50 ); /* RELEASE */
117838
- testcase( i==51 ); /* ATTACH */
117839
- testcase( i==52 ); /* HAVING */
117840
- testcase( i==53 ); /* GROUP */
117841
- testcase( i==54 ); /* UPDATE */
117842
- testcase( i==55 ); /* BEGIN */
117843
- testcase( i==56 ); /* INNER */
117844
- testcase( i==57 ); /* RENAME */
117845
- testcase( i==58 ); /* BETWEEN */
117846
- testcase( i==59 ); /* NOTNULL */
117847
- testcase( i==60 ); /* NOT */
117848
- testcase( i==61 ); /* NO */
117849
- testcase( i==62 ); /* NULL */
117850
- testcase( i==63 ); /* LIKE */
117851
- testcase( i==64 ); /* CASCADE */
117852
- testcase( i==65 ); /* ASC */
117853
- testcase( i==66 ); /* DELETE */
117854
- testcase( i==67 ); /* CASE */
117855
- testcase( i==68 ); /* COLLATE */
117856
- testcase( i==69 ); /* CREATE */
117857
- testcase( i==70 ); /* CURRENT_DATE */
117858
- testcase( i==71 ); /* DETACH */
117859
- testcase( i==72 ); /* IMMEDIATE */
117860
- testcase( i==73 ); /* JOIN */
117861
- testcase( i==74 ); /* INSERT */
117862
- testcase( i==75 ); /* MATCH */
117863
- testcase( i==76 ); /* PLAN */
117864
- testcase( i==77 ); /* ANALYZE */
117865
- testcase( i==78 ); /* PRAGMA */
117866
- testcase( i==79 ); /* ABORT */
117867
- testcase( i==80 ); /* VALUES */
117868
- testcase( i==81 ); /* VIRTUAL */
117869
- testcase( i==82 ); /* LIMIT */
117870
- testcase( i==83 ); /* WHEN */
117871
- testcase( i==84 ); /* WHERE */
117872
- testcase( i==85 ); /* REPLACE */
117873
- testcase( i==86 ); /* AFTER */
117874
- testcase( i==87 ); /* RESTRICT */
117875
- testcase( i==88 ); /* AND */
117876
- testcase( i==89 ); /* DEFAULT */
117877
- testcase( i==90 ); /* AUTOINCREMENT */
117878
- testcase( i==91 ); /* TO */
117879
- testcase( i==92 ); /* IN */
117880
- testcase( i==93 ); /* CAST */
117881
- testcase( i==94 ); /* COLUMN */
117882
- testcase( i==95 ); /* COMMIT */
117883
- testcase( i==96 ); /* CONFLICT */
117884
- testcase( i==97 ); /* CROSS */
117885
- testcase( i==98 ); /* CURRENT_TIMESTAMP */
117886
- testcase( i==99 ); /* CURRENT_TIME */
117887
- testcase( i==100 ); /* PRIMARY */
117888
- testcase( i==101 ); /* DEFERRED */
117889
- testcase( i==102 ); /* DISTINCT */
117890
- testcase( i==103 ); /* IS */
117891
- testcase( i==104 ); /* DROP */
117892
- testcase( i==105 ); /* FAIL */
117893
- testcase( i==106 ); /* FROM */
117894
- testcase( i==107 ); /* FULL */
117895
- testcase( i==108 ); /* GLOB */
117896
- testcase( i==109 ); /* BY */
117897
- testcase( i==110 ); /* IF */
117898
- testcase( i==111 ); /* ISNULL */
117899
- testcase( i==112 ); /* ORDER */
117900
- testcase( i==113 ); /* RIGHT */
117901
- testcase( i==114 ); /* ROLLBACK */
117902
- testcase( i==115 ); /* ROW */
117903
- testcase( i==116 ); /* UNION */
117904
- testcase( i==117 ); /* USING */
117905
- testcase( i==118 ); /* VACUUM */
117906
- testcase( i==119 ); /* VIEW */
117907
- testcase( i==120 ); /* INITIALLY */
117908
- testcase( i==121 ); /* ALL */
118341
+ testcase( i==49 ); /* WITH */
118342
+ testcase( i==50 ); /* OUTER */
118343
+ testcase( i==51 ); /* RELEASE */
118344
+ testcase( i==52 ); /* ATTACH */
118345
+ testcase( i==53 ); /* HAVING */
118346
+ testcase( i==54 ); /* GROUP */
118347
+ testcase( i==55 ); /* UPDATE */
118348
+ testcase( i==56 ); /* BEGIN */
118349
+ testcase( i==57 ); /* INNER */
118350
+ testcase( i==58 ); /* RECURSIVE */
118351
+ testcase( i==59 ); /* BETWEEN */
118352
+ testcase( i==60 ); /* NOTNULL */
118353
+ testcase( i==61 ); /* NOT */
118354
+ testcase( i==62 ); /* NO */
118355
+ testcase( i==63 ); /* NULL */
118356
+ testcase( i==64 ); /* LIKE */
118357
+ testcase( i==65 ); /* CASCADE */
118358
+ testcase( i==66 ); /* ASC */
118359
+ testcase( i==67 ); /* DELETE */
118360
+ testcase( i==68 ); /* CASE */
118361
+ testcase( i==69 ); /* COLLATE */
118362
+ testcase( i==70 ); /* CREATE */
118363
+ testcase( i==71 ); /* CURRENT_DATE */
118364
+ testcase( i==72 ); /* DETACH */
118365
+ testcase( i==73 ); /* IMMEDIATE */
118366
+ testcase( i==74 ); /* JOIN */
118367
+ testcase( i==75 ); /* INSERT */
118368
+ testcase( i==76 ); /* MATCH */
118369
+ testcase( i==77 ); /* PLAN */
118370
+ testcase( i==78 ); /* ANALYZE */
118371
+ testcase( i==79 ); /* PRAGMA */
118372
+ testcase( i==80 ); /* ABORT */
118373
+ testcase( i==81 ); /* VALUES */
118374
+ testcase( i==82 ); /* VIRTUAL */
118375
+ testcase( i==83 ); /* LIMIT */
118376
+ testcase( i==84 ); /* WHEN */
118377
+ testcase( i==85 ); /* WHERE */
118378
+ testcase( i==86 ); /* RENAME */
118379
+ testcase( i==87 ); /* AFTER */
118380
+ testcase( i==88 ); /* REPLACE */
118381
+ testcase( i==89 ); /* AND */
118382
+ testcase( i==90 ); /* DEFAULT */
118383
+ testcase( i==91 ); /* AUTOINCREMENT */
118384
+ testcase( i==92 ); /* TO */
118385
+ testcase( i==93 ); /* IN */
118386
+ testcase( i==94 ); /* CAST */
118387
+ testcase( i==95 ); /* COLUMN */
118388
+ testcase( i==96 ); /* COMMIT */
118389
+ testcase( i==97 ); /* CONFLICT */
118390
+ testcase( i==98 ); /* CROSS */
118391
+ testcase( i==99 ); /* CURRENT_TIMESTAMP */
118392
+ testcase( i==100 ); /* CURRENT_TIME */
118393
+ testcase( i==101 ); /* PRIMARY */
118394
+ testcase( i==102 ); /* DEFERRED */
118395
+ testcase( i==103 ); /* DISTINCT */
118396
+ testcase( i==104 ); /* IS */
118397
+ testcase( i==105 ); /* DROP */
118398
+ testcase( i==106 ); /* FAIL */
118399
+ testcase( i==107 ); /* FROM */
118400
+ testcase( i==108 ); /* FULL */
118401
+ testcase( i==109 ); /* GLOB */
118402
+ testcase( i==110 ); /* BY */
118403
+ testcase( i==111 ); /* IF */
118404
+ testcase( i==112 ); /* ISNULL */
118405
+ testcase( i==113 ); /* ORDER */
118406
+ testcase( i==114 ); /* RESTRICT */
118407
+ testcase( i==115 ); /* RIGHT */
118408
+ testcase( i==116 ); /* ROLLBACK */
118409
+ testcase( i==117 ); /* ROW */
118410
+ testcase( i==118 ); /* UNION */
118411
+ testcase( i==119 ); /* USING */
118412
+ testcase( i==120 ); /* VACUUM */
118413
+ testcase( i==121 ); /* VIEW */
118414
+ testcase( i==122 ); /* INITIALLY */
118415
+ testcase( i==123 ); /* ALL */
117909118416
return aCode[i];
117910118417
}
117911118418
}
117912118419
return TK_ID;
117913118420
}
117914118421
SQLITE_PRIVATE int sqlite3KeywordCode(const unsigned char *z, int n){
117915118422
return keywordCode((char*)z, n);
117916118423
}
117917
-#define SQLITE_N_KEYWORD 122
118424
+#define SQLITE_N_KEYWORD 124
117918118425
117919118426
/************** End of keywordhash.h *****************************************/
117920118427
/************** Continuing where we left off in tokenize.c *******************/
117921118428
117922118429
@@ -118156,28 +118663,19 @@
118156118663
case '?': {
118157118664
*tokenType = TK_VARIABLE;
118158118665
for(i=1; sqlite3Isdigit(z[i]); i++){}
118159118666
return i;
118160118667
}
118161
- case '#': {
118162
- for(i=1; sqlite3Isdigit(z[i]); i++){}
118163
- if( i>1 ){
118164
- /* Parameters of the form #NNN (where NNN is a number) are used
118165
- ** internally by sqlite3NestedParse. */
118166
- *tokenType = TK_REGISTER;
118167
- return i;
118168
- }
118169
- /* Fall through into the next case if the '#' is not followed by
118170
- ** a digit. Try to match #AAAA where AAAA is a parameter name. */
118171
- }
118172118668
#ifndef SQLITE_OMIT_TCL_VARIABLE
118173118669
case '$':
118174118670
#endif
118175118671
case '@': /* For compatibility with MS SQL Server */
118672
+ case '#':
118176118673
case ':': {
118177118674
int n = 0;
118178
- testcase( z[0]=='$' ); testcase( z[0]=='@' ); testcase( z[0]==':' );
118675
+ testcase( z[0]=='$' ); testcase( z[0]=='@' );
118676
+ testcase( z[0]==':' ); testcase( z[0]=='#' );
118179118677
*tokenType = TK_VARIABLE;
118180118678
for(i=1; (c=z[i])!=0; i++){
118181118679
if( IdChar(c) ){
118182118680
n++;
118183118681
#ifndef SQLITE_OMIT_TCL_VARIABLE
@@ -118356,10 +118854,11 @@
118356118854
** will take responsibility for freeing the Table structure.
118357118855
*/
118358118856
sqlite3DeleteTable(db, pParse->pNewTable);
118359118857
}
118360118858
118859
+ if( pParse->bFreeWith ) sqlite3WithDelete(db, pParse->pWith);
118361118860
sqlite3DeleteTrigger(db, pParse->pNewTrigger);
118362118861
for(i=pParse->nzVar-1; i>=0; i--) sqlite3DbFree(db, pParse->azVar[i]);
118363118862
sqlite3DbFree(db, pParse->azVar);
118364118863
while( pParse->pAinc ){
118365118864
AutoincInfo *p = pParse->pAinc;
@@ -124841,11 +125340,11 @@
124841125340
/*
124842125341
** Set the pIdxInfo->estimatedRows variable to nRow. Unless this
124843125342
** extension is currently being used by a version of SQLite too old to
124844125343
** support estimatedRows. In that case this function is a no-op.
124845125344
*/
124846
-static void setEstimatedRows(sqlite3_index_info *pIdxInfo, i64 nRow){
125345
+static void fts3SetEstimatedRows(sqlite3_index_info *pIdxInfo, i64 nRow){
124847125346
#if SQLITE_VERSION_NUMBER>=3008002
124848125347
if( sqlite3_libversion_number()>=3008002 ){
124849125348
pIdxInfo->estimatedRows = nRow;
124850125349
}
124851125350
#endif
@@ -124885,11 +125384,11 @@
124885125384
** of the overall query plan the user will see an "unable to use
124886125385
** function MATCH in the requested context" error. To discourage
124887125386
** this, return a very high cost here. */
124888125387
pInfo->idxNum = FTS3_FULLSCAN_SEARCH;
124889125388
pInfo->estimatedCost = 1e50;
124890
- setEstimatedRows(pInfo, ((sqlite3_int64)1) << 50);
125389
+ fts3SetEstimatedRows(pInfo, ((sqlite3_int64)1) << 50);
124891125390
return SQLITE_OK;
124892125391
}
124893125392
continue;
124894125393
}
124895125394
124896125395
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -135,11 +135,11 @@
135 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
136 ** [sqlite_version()] and [sqlite_source_id()].
137 */
138 #define SQLITE_VERSION "3.8.3"
139 #define SQLITE_VERSION_NUMBER 3008003
140 #define SQLITE_SOURCE_ID "2014-01-04 15:17:04 4e725f53131d3584319c710c8710a068989543c6"
141
142 /*
143 ** CAPI3REF: Run-Time Library Version Numbers
144 ** KEYWORDS: sqlite3_version, sqlite3_sourceid
145 **
@@ -2592,10 +2592,11 @@
2592 #define SQLITE_CREATE_VTABLE 29 /* Table Name Module Name */
2593 #define SQLITE_DROP_VTABLE 30 /* Table Name Module Name */
2594 #define SQLITE_FUNCTION 31 /* NULL Function Name */
2595 #define SQLITE_SAVEPOINT 32 /* Operation Savepoint Name */
2596 #define SQLITE_COPY 0 /* No longer used */
 
2597
2598 /*
2599 ** CAPI3REF: Tracing And Profiling Functions
2600 **
2601 ** These routines register callback functions that can be used for
@@ -8040,167 +8041,169 @@
8040
8041 /************** End of hash.h ************************************************/
8042 /************** Continuing where we left off in sqliteInt.h ******************/
8043 /************** Include parse.h in the middle of sqliteInt.h *****************/
8044 /************** Begin file parse.h *******************************************/
8045 #define TK_SEMI 1
8046 #define TK_EXPLAIN 2
8047 #define TK_QUERY 3
8048 #define TK_PLAN 4
8049 #define TK_BEGIN 5
8050 #define TK_TRANSACTION 6
8051 #define TK_DEFERRED 7
8052 #define TK_IMMEDIATE 8
8053 #define TK_EXCLUSIVE 9
8054 #define TK_COMMIT 10
8055 #define TK_END 11
8056 #define TK_ROLLBACK 12
8057 #define TK_SAVEPOINT 13
8058 #define TK_RELEASE 14
8059 #define TK_TO 15
8060 #define TK_TABLE 16
8061 #define TK_CREATE 17
8062 #define TK_IF 18
8063 #define TK_NOT 19
8064 #define TK_EXISTS 20
8065 #define TK_TEMP 21
8066 #define TK_LP 22
8067 #define TK_RP 23
8068 #define TK_AS 24
8069 #define TK_WITHOUT 25
8070 #define TK_COMMA 26
8071 #define TK_ID 27
8072 #define TK_INDEXED 28
8073 #define TK_ABORT 29
8074 #define TK_ACTION 30
8075 #define TK_AFTER 31
8076 #define TK_ANALYZE 32
8077 #define TK_ASC 33
8078 #define TK_ATTACH 34
8079 #define TK_BEFORE 35
8080 #define TK_BY 36
8081 #define TK_CASCADE 37
8082 #define TK_CAST 38
8083 #define TK_COLUMNKW 39
8084 #define TK_CONFLICT 40
8085 #define TK_DATABASE 41
8086 #define TK_DESC 42
8087 #define TK_DETACH 43
8088 #define TK_EACH 44
8089 #define TK_FAIL 45
8090 #define TK_FOR 46
8091 #define TK_IGNORE 47
8092 #define TK_INITIALLY 48
8093 #define TK_INSTEAD 49
8094 #define TK_LIKE_KW 50
8095 #define TK_MATCH 51
8096 #define TK_NO 52
8097 #define TK_KEY 53
8098 #define TK_OF 54
8099 #define TK_OFFSET 55
8100 #define TK_PRAGMA 56
8101 #define TK_RAISE 57
8102 #define TK_REPLACE 58
8103 #define TK_RESTRICT 59
8104 #define TK_ROW 60
8105 #define TK_TRIGGER 61
8106 #define TK_VACUUM 62
8107 #define TK_VIEW 63
8108 #define TK_VIRTUAL 64
8109 #define TK_REINDEX 65
8110 #define TK_RENAME 66
8111 #define TK_CTIME_KW 67
8112 #define TK_ANY 68
8113 #define TK_OR 69
8114 #define TK_AND 70
8115 #define TK_IS 71
8116 #define TK_BETWEEN 72
8117 #define TK_IN 73
8118 #define TK_ISNULL 74
8119 #define TK_NOTNULL 75
8120 #define TK_NE 76
8121 #define TK_EQ 77
8122 #define TK_GT 78
8123 #define TK_LE 79
8124 #define TK_LT 80
8125 #define TK_GE 81
8126 #define TK_ESCAPE 82
8127 #define TK_BITAND 83
8128 #define TK_BITOR 84
8129 #define TK_LSHIFT 85
8130 #define TK_RSHIFT 86
8131 #define TK_PLUS 87
8132 #define TK_MINUS 88
8133 #define TK_STAR 89
8134 #define TK_SLASH 90
8135 #define TK_REM 91
8136 #define TK_CONCAT 92
8137 #define TK_COLLATE 93
8138 #define TK_BITNOT 94
8139 #define TK_STRING 95
8140 #define TK_JOIN_KW 96
8141 #define TK_CONSTRAINT 97
8142 #define TK_DEFAULT 98
8143 #define TK_NULL 99
8144 #define TK_PRIMARY 100
8145 #define TK_UNIQUE 101
8146 #define TK_CHECK 102
8147 #define TK_REFERENCES 103
8148 #define TK_AUTOINCR 104
8149 #define TK_ON 105
8150 #define TK_INSERT 106
8151 #define TK_DELETE 107
8152 #define TK_UPDATE 108
8153 #define TK_SET 109
8154 #define TK_DEFERRABLE 110
8155 #define TK_FOREIGN 111
8156 #define TK_DROP 112
8157 #define TK_UNION 113
8158 #define TK_ALL 114
8159 #define TK_EXCEPT 115
8160 #define TK_INTERSECT 116
8161 #define TK_SELECT 117
8162 #define TK_DISTINCT 118
8163 #define TK_DOT 119
8164 #define TK_FROM 120
8165 #define TK_JOIN 121
8166 #define TK_USING 122
8167 #define TK_ORDER 123
8168 #define TK_GROUP 124
8169 #define TK_HAVING 125
8170 #define TK_LIMIT 126
8171 #define TK_WHERE 127
8172 #define TK_INTO 128
8173 #define TK_VALUES 129
8174 #define TK_INTEGER 130
8175 #define TK_FLOAT 131
8176 #define TK_BLOB 132
8177 #define TK_REGISTER 133
8178 #define TK_VARIABLE 134
8179 #define TK_CASE 135
8180 #define TK_WHEN 136
8181 #define TK_THEN 137
8182 #define TK_ELSE 138
8183 #define TK_INDEX 139
8184 #define TK_ALTER 140
8185 #define TK_ADD 141
8186 #define TK_TO_TEXT 142
8187 #define TK_TO_BLOB 143
8188 #define TK_TO_NUMERIC 144
8189 #define TK_TO_INT 145
8190 #define TK_TO_REAL 146
8191 #define TK_ISNOT 147
8192 #define TK_END_OF_FILE 148
8193 #define TK_ILLEGAL 149
8194 #define TK_SPACE 150
8195 #define TK_UNCLOSED_STRING 151
8196 #define TK_FUNCTION 152
8197 #define TK_COLUMN 153
8198 #define TK_AGG_FUNCTION 154
8199 #define TK_AGG_COLUMN 155
8200 #define TK_UMINUS 156
8201 #define TK_UPLUS 157
 
 
8202
8203 /************** End of parse.h ***********************************************/
8204 /************** Continuing where we left off in sqliteInt.h ******************/
8205 #include <stdio.h>
8206 #include <stdlib.h>
@@ -8645,10 +8648,11 @@
8645 typedef struct UnpackedRecord UnpackedRecord;
8646 typedef struct VTable VTable;
8647 typedef struct VtabCtx VtabCtx;
8648 typedef struct Walker Walker;
8649 typedef struct WhereInfo WhereInfo;
 
8650
8651 /*
8652 ** Defer sourcing vdbe.h and btree.h until after the "u8" and
8653 ** "BusyHandler" typedefs. vdbe.h also requires a few of the opaque
8654 ** pointer types (i.e. FuncDef) defined above.
@@ -9124,109 +9128,110 @@
9124 #define OP_VerifyCookie 49
9125 #define OP_OpenRead 50 /* synopsis: root=P2 iDb=P3 */
9126 #define OP_OpenWrite 51 /* synopsis: root=P2 iDb=P3 */
9127 #define OP_OpenAutoindex 52 /* synopsis: nColumn=P2 */
9128 #define OP_OpenEphemeral 53 /* synopsis: nColumn=P2 */
9129 #define OP_SorterOpen 54
9130 #define OP_OpenPseudo 55 /* synopsis: content in r[P2@P3] */
9131 #define OP_Close 56
9132 #define OP_SeekLt 57 /* synopsis: key=r[P3@P4] */
9133 #define OP_SeekLe 58 /* synopsis: key=r[P3@P4] */
9134 #define OP_SeekGe 59 /* synopsis: key=r[P3@P4] */
9135 #define OP_SeekGt 60 /* synopsis: key=r[P3@P4] */
9136 #define OP_Seek 61 /* synopsis: intkey=r[P2] */
9137 #define OP_NoConflict 62 /* synopsis: key=r[P3@P4] */
9138 #define OP_NotFound 63 /* synopsis: key=r[P3@P4] */
9139 #define OP_Found 64 /* synopsis: key=r[P3@P4] */
9140 #define OP_NotExists 65 /* synopsis: intkey=r[P3] */
9141 #define OP_Sequence 66 /* synopsis: r[P2]=rowid */
9142 #define OP_NewRowid 67 /* synopsis: r[P2]=rowid */
9143 #define OP_Insert 68 /* synopsis: intkey=r[P3] data=r[P2] */
9144 #define OP_Or 69 /* same as TK_OR, synopsis: r[P3]=(r[P1] || r[P2]) */
9145 #define OP_And 70 /* same as TK_AND, synopsis: r[P3]=(r[P1] && r[P2]) */
9146 #define OP_InsertInt 71 /* synopsis: intkey=P3 data=r[P2] */
9147 #define OP_Delete 72
9148 #define OP_ResetCount 73
9149 #define OP_IsNull 74 /* same as TK_ISNULL, synopsis: if r[P1]==NULL goto P2 */
9150 #define OP_NotNull 75 /* same as TK_NOTNULL, synopsis: if r[P1]!=NULL goto P2 */
9151 #define OP_Ne 76 /* same as TK_NE, synopsis: if r[P1]!=r[P3] goto P2 */
9152 #define OP_Eq 77 /* same as TK_EQ, synopsis: if r[P1]==r[P3] goto P2 */
9153 #define OP_Gt 78 /* same as TK_GT, synopsis: if r[P1]>r[P3] goto P2 */
9154 #define OP_Le 79 /* same as TK_LE, synopsis: if r[P1]<=r[P3] goto P2 */
9155 #define OP_Lt 80 /* same as TK_LT, synopsis: if r[P1]<r[P3] goto P2 */
9156 #define OP_Ge 81 /* same as TK_GE, synopsis: if r[P1]>=r[P3] goto P2 */
9157 #define OP_SorterCompare 82 /* synopsis: if key(P1)!=rtrim(r[P3],P4) goto P2 */
9158 #define OP_BitAnd 83 /* same as TK_BITAND, synopsis: r[P3]=r[P1]&r[P2] */
9159 #define OP_BitOr 84 /* same as TK_BITOR, synopsis: r[P3]=r[P1]|r[P2] */
9160 #define OP_ShiftLeft 85 /* same as TK_LSHIFT, synopsis: r[P3]=r[P2]<<r[P1] */
9161 #define OP_ShiftRight 86 /* same as TK_RSHIFT, synopsis: r[P3]=r[P2]>>r[P1] */
9162 #define OP_Add 87 /* same as TK_PLUS, synopsis: r[P3]=r[P1]+r[P2] */
9163 #define OP_Subtract 88 /* same as TK_MINUS, synopsis: r[P3]=r[P2]-r[P1] */
9164 #define OP_Multiply 89 /* same as TK_STAR, synopsis: r[P3]=r[P1]*r[P2] */
9165 #define OP_Divide 90 /* same as TK_SLASH, synopsis: r[P3]=r[P2]/r[P1] */
9166 #define OP_Remainder 91 /* same as TK_REM, synopsis: r[P3]=r[P2]%r[P1] */
9167 #define OP_Concat 92 /* same as TK_CONCAT, synopsis: r[P3]=r[P2]+r[P1] */
9168 #define OP_SorterData 93 /* synopsis: r[P2]=data */
9169 #define OP_BitNot 94 /* same as TK_BITNOT, synopsis: r[P1]= ~r[P1] */
9170 #define OP_String8 95 /* same as TK_STRING, synopsis: r[P2]='P4' */
9171 #define OP_RowKey 96 /* synopsis: r[P2]=key */
9172 #define OP_RowData 97 /* synopsis: r[P2]=data */
9173 #define OP_Rowid 98 /* synopsis: r[P2]=rowid */
9174 #define OP_NullRow 99
9175 #define OP_Last 100
9176 #define OP_SorterSort 101
9177 #define OP_Sort 102
9178 #define OP_Rewind 103
9179 #define OP_SorterInsert 104
9180 #define OP_IdxInsert 105 /* synopsis: key=r[P2] */
9181 #define OP_IdxDelete 106 /* synopsis: key=r[P2@P3] */
9182 #define OP_IdxRowid 107 /* synopsis: r[P2]=rowid */
9183 #define OP_IdxLT 108 /* synopsis: key=r[P3@P4] */
9184 #define OP_IdxGE 109 /* synopsis: key=r[P3@P4] */
9185 #define OP_Destroy 110
9186 #define OP_Clear 111
9187 #define OP_CreateIndex 112 /* synopsis: r[P2]=root iDb=P1 */
9188 #define OP_CreateTable 113 /* synopsis: r[P2]=root iDb=P1 */
9189 #define OP_ParseSchema 114
9190 #define OP_LoadAnalysis 115
9191 #define OP_DropTable 116
9192 #define OP_DropIndex 117
9193 #define OP_DropTrigger 118
9194 #define OP_IntegrityCk 119
9195 #define OP_RowSetAdd 120 /* synopsis: rowset(P1)=r[P2] */
9196 #define OP_RowSetRead 121 /* synopsis: r[P3]=rowset(P1) */
9197 #define OP_RowSetTest 122 /* synopsis: if r[P3] in rowset(P1) goto P2 */
9198 #define OP_Program 123
9199 #define OP_Param 124
9200 #define OP_FkCounter 125 /* synopsis: fkctr[P1]+=P2 */
9201 #define OP_FkIfZero 126 /* synopsis: if fkctr[P1]==0 goto P2 */
9202 #define OP_MemMax 127 /* synopsis: r[P1]=max(r[P1],r[P2]) */
9203 #define OP_IfPos 128 /* synopsis: if r[P1]>0 goto P2 */
9204 #define OP_IfNeg 129 /* synopsis: if r[P1]<0 goto P2 */
9205 #define OP_IfZero 130 /* synopsis: r[P1]+=P3, if r[P1]==0 goto P2 */
9206 #define OP_Real 131 /* same as TK_FLOAT, synopsis: r[P2]=P4 */
9207 #define OP_AggFinal 132 /* synopsis: accum=r[P1] N=P2 */
9208 #define OP_IncrVacuum 133
9209 #define OP_Expire 134
9210 #define OP_TableLock 135 /* synopsis: iDb=P1 root=P2 write=P3 */
9211 #define OP_VBegin 136
9212 #define OP_VCreate 137
9213 #define OP_VDestroy 138
9214 #define OP_VOpen 139
9215 #define OP_VColumn 140 /* synopsis: r[P3]=vcolumn(P2) */
9216 #define OP_VNext 141
9217 #define OP_ToText 142 /* same as TK_TO_TEXT */
9218 #define OP_ToBlob 143 /* same as TK_TO_BLOB */
9219 #define OP_ToNumeric 144 /* same as TK_TO_NUMERIC */
9220 #define OP_ToInt 145 /* same as TK_TO_INT */
9221 #define OP_ToReal 146 /* same as TK_TO_REAL */
9222 #define OP_VRename 147
9223 #define OP_Pagecount 148
9224 #define OP_MaxPgcnt 149
9225 #define OP_Trace 150
9226 #define OP_Noop 151
9227 #define OP_Explain 152
 
9228
9229
9230 /* Properties such as "out2" or "jump" that are specified in
9231 ** comments following the "case" for each opcode in the vdbe.c
9232 ** are encoded into bitvectors as follows:
@@ -9244,23 +9249,23 @@
9244 /* 16 */ 0x01, 0x01, 0x04, 0x24, 0x04, 0x10, 0x00, 0x02,\
9245 /* 24 */ 0x02, 0x02, 0x02, 0x02, 0x02, 0x00, 0x00, 0x20,\
9246 /* 32 */ 0x00, 0x00, 0x04, 0x05, 0x04, 0x00, 0x00, 0x01,\
9247 /* 40 */ 0x01, 0x05, 0x05, 0x00, 0x00, 0x00, 0x02, 0x02,\
9248 /* 48 */ 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\
9249 /* 56 */ 0x00, 0x11, 0x11, 0x11, 0x11, 0x08, 0x11, 0x11,\
9250 /* 64 */ 0x11, 0x11, 0x02, 0x02, 0x00, 0x4c, 0x4c, 0x00,\
9251 /* 72 */ 0x00, 0x00, 0x05, 0x05, 0x15, 0x15, 0x15, 0x15,\
9252 /* 80 */ 0x15, 0x15, 0x00, 0x4c, 0x4c, 0x4c, 0x4c, 0x4c,\
9253 /* 88 */ 0x4c, 0x4c, 0x4c, 0x4c, 0x4c, 0x00, 0x24, 0x02,\
9254 /* 96 */ 0x00, 0x00, 0x02, 0x00, 0x01, 0x01, 0x01, 0x01,\
9255 /* 104 */ 0x08, 0x08, 0x00, 0x02, 0x01, 0x01, 0x02, 0x00,\
9256 /* 112 */ 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\
9257 /* 120 */ 0x0c, 0x45, 0x15, 0x01, 0x02, 0x00, 0x01, 0x08,\
9258 /* 128 */ 0x05, 0x05, 0x05, 0x02, 0x00, 0x01, 0x00, 0x00,\
9259 /* 136 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x04, 0x04,\
9260 /* 144 */ 0x04, 0x04, 0x04, 0x00, 0x02, 0x02, 0x00, 0x00,\
9261 /* 152 */ 0x00,}
9262
9263 /************** End of opcodes.h *********************************************/
9264 /************** Continuing where we left off in vdbe.h ***********************/
9265
9266 /*
@@ -9280,11 +9285,11 @@
9280 SQLITE_PRIVATE void sqlite3VdbeChangeP2(Vdbe*, u32 addr, int P2);
9281 SQLITE_PRIVATE void sqlite3VdbeChangeP3(Vdbe*, u32 addr, int P3);
9282 SQLITE_PRIVATE void sqlite3VdbeChangeP5(Vdbe*, u8 P5);
9283 SQLITE_PRIVATE void sqlite3VdbeJumpHere(Vdbe*, int addr);
9284 SQLITE_PRIVATE void sqlite3VdbeChangeToNoop(Vdbe*, int addr);
9285 SQLITE_PRIVATE void sqlite3VdbeDeleteLastOpcode(Vdbe*);
9286 SQLITE_PRIVATE void sqlite3VdbeChangeP4(Vdbe*, int addr, const char *zP4, int N);
9287 SQLITE_PRIVATE void sqlite3VdbeSetP4KeyInfo(Parse*, Index*);
9288 SQLITE_PRIVATE void sqlite3VdbeUsesBtree(Vdbe*, int);
9289 SQLITE_PRIVATE VdbeOp *sqlite3VdbeGetOp(Vdbe*, int);
9290 SQLITE_PRIVATE int sqlite3VdbeMakeLabel(Vdbe*);
@@ -10746,18 +10751,19 @@
10746 Schema *pSchema; /* Schema that contains this table */
10747 Table *pNextZombie; /* Next on the Parse.pZombieTab list */
10748 };
10749
10750 /*
10751 ** Allowed values for Tabe.tabFlags.
10752 */
10753 #define TF_Readonly 0x01 /* Read-only system table */
10754 #define TF_Ephemeral 0x02 /* An ephemeral table */
10755 #define TF_HasPrimaryKey 0x04 /* Table has a primary key */
10756 #define TF_Autoincrement 0x08 /* Integer primary key is autoincrement */
10757 #define TF_Virtual 0x10 /* Is a virtual table */
10758 #define TF_WithoutRowid 0x20 /* No rowid used. PRIMARY KEY is the key */
 
10759
10760
10761 /*
10762 ** Test to see whether or not a table is a virtual table. This is
10763 ** done as a macro so that it will be optimized out when virtual
@@ -11335,10 +11341,11 @@
11335 int regReturn; /* Register holding return address of addrFillSub */
11336 u8 jointype; /* Type of join between this able and the previous */
11337 unsigned notIndexed :1; /* True if there is a NOT INDEXED clause */
11338 unsigned isCorrelated :1; /* True if sub-query is correlated */
11339 unsigned viaCoroutine :1; /* Implemented as a co-routine */
 
11340 #ifndef SQLITE_OMIT_EXPLAIN
11341 u8 iSelectId; /* If pSelect!=0, the id of the sub-select in EQP */
11342 #endif
11343 int iCursor; /* The VDBE cursor number used to access this table */
11344 Expr *pOn; /* The ON clause of a join */
@@ -11461,10 +11468,11 @@
11461 Select *pPrior; /* Prior select in a compound select statement */
11462 Select *pNext; /* Next select to the left in a compound */
11463 Select *pRightmost; /* Right-most select in a compound select statement */
11464 Expr *pLimit; /* LIMIT expression. NULL means not used. */
11465 Expr *pOffset; /* OFFSET expression. NULL means not used. */
 
11466 };
11467
11468 /*
11469 ** Allowed values for Select.selFlags. The "SF" prefix stands for
11470 ** "Select Flag".
@@ -11478,10 +11486,11 @@
11478 #define SF_UseSorter 0x0040 /* Sort using a sorter */
11479 #define SF_Values 0x0080 /* Synthesized from VALUES clause */
11480 #define SF_Materialize 0x0100 /* Force materialization of views */
11481 #define SF_NestedFrom 0x0200 /* Part of a parenthesized FROM clause */
11482 #define SF_MaybeConvert 0x0400 /* Need convertCompoundSelectToSubquery() */
 
11483
11484
11485 /*
11486 ** The results of a select can be distributed in several ways. The
11487 ** "SRT" prefix means "SELECT Result Type".
@@ -11498,10 +11507,11 @@
11498 #define SRT_Mem 6 /* Store result in a memory cell */
11499 #define SRT_Set 7 /* Store results as keys in an index */
11500 #define SRT_Table 8 /* Store result as data with an automatic rowid */
11501 #define SRT_EphemTab 9 /* Create transient tab and store like SRT_Table */
11502 #define SRT_Coroutine 10 /* Generate a single row of result */
 
11503
11504 /*
11505 ** An instance of this object describes where to put of the results of
11506 ** a SELECT statement.
11507 */
@@ -11611,10 +11621,11 @@
11611 int nSet; /* Number of sets used so far */
11612 int nOnce; /* Number of OP_Once instructions so far */
11613 int nOpAlloc; /* Number of slots allocated for Vdbe.aOp[] */
11614 int nLabel; /* Number of labels used */
11615 int *aLabel; /* Space to hold the labels */
 
11616 int ckBase; /* Base register of data during check constraints */
11617 int iPartIdxTab; /* Table corresponding to a partial index */
11618 int iCacheLevel; /* ColCache valid when aColCache[].iLevel<=iCacheLevel */
11619 int iCacheCnt; /* Counter used to generate aColCache[].lru values */
11620 struct yColCache {
@@ -11681,10 +11692,12 @@
11681 Token sArg; /* Complete text of a module argument */
11682 Table **apVtabLock; /* Pointer to virtual tables needing locking */
11683 #endif
11684 Table *pZombieTab; /* List of Table objects to delete after code gen */
11685 TriggerPrg *pTriggerPrg; /* Linked list of coded triggers */
 
 
11686 };
11687
11688 /*
11689 ** Return true if currently inside an sqlite3_declare_vtab() call.
11690 */
@@ -11800,11 +11813,11 @@
11800 u8 orconf; /* OE_Rollback etc. */
11801 Trigger *pTrig; /* The trigger that this step is a part of */
11802 Select *pSelect; /* SELECT statment or RHS of INSERT INTO .. SELECT ... */
11803 Token target; /* Target table for DELETE, UPDATE, INSERT */
11804 Expr *pWhere; /* The WHERE clause for DELETE or UPDATE steps */
11805 ExprList *pExprList; /* SET clause for UPDATE. VALUES clause for INSERT */
11806 IdList *pIdList; /* Column names for INSERT */
11807 TriggerStep *pNext; /* Next in the link-list */
11808 TriggerStep *pLast; /* Last element in link-list. Valid for 1st elem only */
11809 };
11810
@@ -11922,13 +11935,13 @@
11922 ** Context pointer passed down through the tree-walk.
11923 */
11924 struct Walker {
11925 int (*xExprCallback)(Walker*, Expr*); /* Callback for expressions */
11926 int (*xSelectCallback)(Walker*,Select*); /* Callback for SELECTs */
 
11927 Parse *pParse; /* Parser context. */
11928 int walkerDepth; /* Number of subqueries */
11929 u8 bSelectDepthFirst; /* Do subqueries first */
11930 union { /* Extra data for callback */
11931 NameContext *pNC; /* Naming context */
11932 int i; /* Integer value */
11933 SrcList *pSrcList; /* FROM clause */
11934 struct SrcCount *pSrcCount; /* Counting column references */
@@ -11947,10 +11960,25 @@
11947 ** callbacks.
11948 */
11949 #define WRC_Continue 0 /* Continue down into children */
11950 #define WRC_Prune 1 /* Omit children but continue walking siblings */
11951 #define WRC_Abort 2 /* Abandon the tree walk */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11952
11953 /*
11954 ** Assuming zIn points to the first byte of a UTF-8 character,
11955 ** advance zIn to point to the first byte of the next UTF-8 character.
11956 */
@@ -12215,11 +12243,11 @@
12215 #else
12216 # define sqlite3AutoincrementBegin(X)
12217 # define sqlite3AutoincrementEnd(X)
12218 #endif
12219 SQLITE_PRIVATE int sqlite3CodeCoroutine(Parse*, Select*, SelectDest*);
12220 SQLITE_PRIVATE void sqlite3Insert(Parse*, SrcList*, ExprList*, Select*, IdList*, int);
12221 SQLITE_PRIVATE void *sqlite3ArrayAllocate(sqlite3*,void*,int,int*,int*);
12222 SQLITE_PRIVATE IdList *sqlite3IdListAppend(sqlite3*, IdList*, Token*);
12223 SQLITE_PRIVATE int sqlite3IdListIndex(IdList*,const char*);
12224 SQLITE_PRIVATE SrcList *sqlite3SrcListEnlarge(sqlite3*, SrcList*, int, int);
12225 SQLITE_PRIVATE SrcList *sqlite3SrcListAppend(sqlite3*, SrcList*, Token*, Token*);
@@ -12309,11 +12337,11 @@
12309 SQLITE_PRIVATE void sqlite3ExprCodeIsNullJump(Vdbe*, const Expr*, int, int);
12310 SQLITE_PRIVATE int sqlite3ExprNeedsNoAffinityChange(const Expr*, char);
12311 SQLITE_PRIVATE int sqlite3IsRowid(const char*);
12312 SQLITE_PRIVATE void sqlite3GenerateRowDelete(Parse*,Table*,Trigger*,int,int,int,i16,u8,u8,u8);
12313 SQLITE_PRIVATE void sqlite3GenerateRowIndexDelete(Parse*, Table*, int, int, int*);
12314 SQLITE_PRIVATE int sqlite3GenerateIndexKey(Parse*, Index*, int, int, int, int*);
12315 SQLITE_PRIVATE void sqlite3GenerateConstraintChecks(Parse*,Table*,int*,int,int,int,int,
12316 u8,u8,int,int*);
12317 SQLITE_PRIVATE void sqlite3CompleteInsertion(Parse*,Table*,int,int,int,int*,int,int,int);
12318 SQLITE_PRIVATE int sqlite3OpenTableAndIndices(Parse*, Table*, int, int, u8*, int*, int*);
12319 SQLITE_PRIVATE void sqlite3BeginWriteOperation(Parse*, int, int);
@@ -12353,11 +12381,11 @@
12353 SQLITE_PRIVATE void sqlite3CodeRowTriggerDirect(Parse *, Trigger *, Table *, int, int, int);
12354 void sqliteViewTriggers(Parse*, Table*, Expr*, int, ExprList*);
12355 SQLITE_PRIVATE void sqlite3DeleteTriggerStep(sqlite3*, TriggerStep*);
12356 SQLITE_PRIVATE TriggerStep *sqlite3TriggerSelectStep(sqlite3*,Select*);
12357 SQLITE_PRIVATE TriggerStep *sqlite3TriggerInsertStep(sqlite3*,Token*, IdList*,
12358 ExprList*,Select*,u8);
12359 SQLITE_PRIVATE TriggerStep *sqlite3TriggerUpdateStep(sqlite3*,Token*,ExprList*, Expr*, u8);
12360 SQLITE_PRIVATE TriggerStep *sqlite3TriggerDeleteStep(sqlite3*,Token*, Expr*);
12361 SQLITE_PRIVATE void sqlite3DeleteTrigger(sqlite3*, Trigger*);
12362 SQLITE_PRIVATE void sqlite3UnlinkAndDeleteTrigger(sqlite3*,int,const char*);
12363 SQLITE_PRIVATE u32 sqlite3TriggerColmask(Parse*,Trigger*,ExprList*,int,int,Table*,int);
@@ -12646,10 +12674,18 @@
12646 SQLITE_PRIVATE const char *sqlite3JournalModename(int);
12647 #ifndef SQLITE_OMIT_WAL
12648 SQLITE_PRIVATE int sqlite3Checkpoint(sqlite3*, int, int, int*, int*);
12649 SQLITE_PRIVATE int sqlite3WalDefaultHook(void*,sqlite3*,const char*,int);
12650 #endif
 
 
 
 
 
 
 
 
12651
12652 /* Declarations for functions in fkey.c. All of these are replaced by
12653 ** no-op macros if OMIT_FOREIGN_KEY is defined. In this case no foreign
12654 ** key functionality is available. If OMIT_TRIGGER is defined but
12655 ** OMIT_FOREIGN_KEY is not, only some of the functions are no-oped. In
@@ -23143,109 +23179,110 @@
23143 /* 49 */ "VerifyCookie" OpHelp(""),
23144 /* 50 */ "OpenRead" OpHelp("root=P2 iDb=P3"),
23145 /* 51 */ "OpenWrite" OpHelp("root=P2 iDb=P3"),
23146 /* 52 */ "OpenAutoindex" OpHelp("nColumn=P2"),
23147 /* 53 */ "OpenEphemeral" OpHelp("nColumn=P2"),
23148 /* 54 */ "SorterOpen" OpHelp(""),
23149 /* 55 */ "OpenPseudo" OpHelp("content in r[P2@P3]"),
23150 /* 56 */ "Close" OpHelp(""),
23151 /* 57 */ "SeekLt" OpHelp("key=r[P3@P4]"),
23152 /* 58 */ "SeekLe" OpHelp("key=r[P3@P4]"),
23153 /* 59 */ "SeekGe" OpHelp("key=r[P3@P4]"),
23154 /* 60 */ "SeekGt" OpHelp("key=r[P3@P4]"),
23155 /* 61 */ "Seek" OpHelp("intkey=r[P2]"),
23156 /* 62 */ "NoConflict" OpHelp("key=r[P3@P4]"),
23157 /* 63 */ "NotFound" OpHelp("key=r[P3@P4]"),
23158 /* 64 */ "Found" OpHelp("key=r[P3@P4]"),
23159 /* 65 */ "NotExists" OpHelp("intkey=r[P3]"),
23160 /* 66 */ "Sequence" OpHelp("r[P2]=rowid"),
23161 /* 67 */ "NewRowid" OpHelp("r[P2]=rowid"),
23162 /* 68 */ "Insert" OpHelp("intkey=r[P3] data=r[P2]"),
23163 /* 69 */ "Or" OpHelp("r[P3]=(r[P1] || r[P2])"),
23164 /* 70 */ "And" OpHelp("r[P3]=(r[P1] && r[P2])"),
23165 /* 71 */ "InsertInt" OpHelp("intkey=P3 data=r[P2]"),
23166 /* 72 */ "Delete" OpHelp(""),
23167 /* 73 */ "ResetCount" OpHelp(""),
23168 /* 74 */ "IsNull" OpHelp("if r[P1]==NULL goto P2"),
23169 /* 75 */ "NotNull" OpHelp("if r[P1]!=NULL goto P2"),
23170 /* 76 */ "Ne" OpHelp("if r[P1]!=r[P3] goto P2"),
23171 /* 77 */ "Eq" OpHelp("if r[P1]==r[P3] goto P2"),
23172 /* 78 */ "Gt" OpHelp("if r[P1]>r[P3] goto P2"),
23173 /* 79 */ "Le" OpHelp("if r[P1]<=r[P3] goto P2"),
23174 /* 80 */ "Lt" OpHelp("if r[P1]<r[P3] goto P2"),
23175 /* 81 */ "Ge" OpHelp("if r[P1]>=r[P3] goto P2"),
23176 /* 82 */ "SorterCompare" OpHelp("if key(P1)!=rtrim(r[P3],P4) goto P2"),
23177 /* 83 */ "BitAnd" OpHelp("r[P3]=r[P1]&r[P2]"),
23178 /* 84 */ "BitOr" OpHelp("r[P3]=r[P1]|r[P2]"),
23179 /* 85 */ "ShiftLeft" OpHelp("r[P3]=r[P2]<<r[P1]"),
23180 /* 86 */ "ShiftRight" OpHelp("r[P3]=r[P2]>>r[P1]"),
23181 /* 87 */ "Add" OpHelp("r[P3]=r[P1]+r[P2]"),
23182 /* 88 */ "Subtract" OpHelp("r[P3]=r[P2]-r[P1]"),
23183 /* 89 */ "Multiply" OpHelp("r[P3]=r[P1]*r[P2]"),
23184 /* 90 */ "Divide" OpHelp("r[P3]=r[P2]/r[P1]"),
23185 /* 91 */ "Remainder" OpHelp("r[P3]=r[P2]%r[P1]"),
23186 /* 92 */ "Concat" OpHelp("r[P3]=r[P2]+r[P1]"),
23187 /* 93 */ "SorterData" OpHelp("r[P2]=data"),
23188 /* 94 */ "BitNot" OpHelp("r[P1]= ~r[P1]"),
23189 /* 95 */ "String8" OpHelp("r[P2]='P4'"),
23190 /* 96 */ "RowKey" OpHelp("r[P2]=key"),
23191 /* 97 */ "RowData" OpHelp("r[P2]=data"),
23192 /* 98 */ "Rowid" OpHelp("r[P2]=rowid"),
23193 /* 99 */ "NullRow" OpHelp(""),
23194 /* 100 */ "Last" OpHelp(""),
23195 /* 101 */ "SorterSort" OpHelp(""),
23196 /* 102 */ "Sort" OpHelp(""),
23197 /* 103 */ "Rewind" OpHelp(""),
23198 /* 104 */ "SorterInsert" OpHelp(""),
23199 /* 105 */ "IdxInsert" OpHelp("key=r[P2]"),
23200 /* 106 */ "IdxDelete" OpHelp("key=r[P2@P3]"),
23201 /* 107 */ "IdxRowid" OpHelp("r[P2]=rowid"),
23202 /* 108 */ "IdxLT" OpHelp("key=r[P3@P4]"),
23203 /* 109 */ "IdxGE" OpHelp("key=r[P3@P4]"),
23204 /* 110 */ "Destroy" OpHelp(""),
23205 /* 111 */ "Clear" OpHelp(""),
23206 /* 112 */ "CreateIndex" OpHelp("r[P2]=root iDb=P1"),
23207 /* 113 */ "CreateTable" OpHelp("r[P2]=root iDb=P1"),
23208 /* 114 */ "ParseSchema" OpHelp(""),
23209 /* 115 */ "LoadAnalysis" OpHelp(""),
23210 /* 116 */ "DropTable" OpHelp(""),
23211 /* 117 */ "DropIndex" OpHelp(""),
23212 /* 118 */ "DropTrigger" OpHelp(""),
23213 /* 119 */ "IntegrityCk" OpHelp(""),
23214 /* 120 */ "RowSetAdd" OpHelp("rowset(P1)=r[P2]"),
23215 /* 121 */ "RowSetRead" OpHelp("r[P3]=rowset(P1)"),
23216 /* 122 */ "RowSetTest" OpHelp("if r[P3] in rowset(P1) goto P2"),
23217 /* 123 */ "Program" OpHelp(""),
23218 /* 124 */ "Param" OpHelp(""),
23219 /* 125 */ "FkCounter" OpHelp("fkctr[P1]+=P2"),
23220 /* 126 */ "FkIfZero" OpHelp("if fkctr[P1]==0 goto P2"),
23221 /* 127 */ "MemMax" OpHelp("r[P1]=max(r[P1],r[P2])"),
23222 /* 128 */ "IfPos" OpHelp("if r[P1]>0 goto P2"),
23223 /* 129 */ "IfNeg" OpHelp("if r[P1]<0 goto P2"),
23224 /* 130 */ "IfZero" OpHelp("r[P1]+=P3, if r[P1]==0 goto P2"),
23225 /* 131 */ "Real" OpHelp("r[P2]=P4"),
23226 /* 132 */ "AggFinal" OpHelp("accum=r[P1] N=P2"),
23227 /* 133 */ "IncrVacuum" OpHelp(""),
23228 /* 134 */ "Expire" OpHelp(""),
23229 /* 135 */ "TableLock" OpHelp("iDb=P1 root=P2 write=P3"),
23230 /* 136 */ "VBegin" OpHelp(""),
23231 /* 137 */ "VCreate" OpHelp(""),
23232 /* 138 */ "VDestroy" OpHelp(""),
23233 /* 139 */ "VOpen" OpHelp(""),
23234 /* 140 */ "VColumn" OpHelp("r[P3]=vcolumn(P2)"),
23235 /* 141 */ "VNext" OpHelp(""),
23236 /* 142 */ "ToText" OpHelp(""),
23237 /* 143 */ "ToBlob" OpHelp(""),
23238 /* 144 */ "ToNumeric" OpHelp(""),
23239 /* 145 */ "ToInt" OpHelp(""),
23240 /* 146 */ "ToReal" OpHelp(""),
23241 /* 147 */ "VRename" OpHelp(""),
23242 /* 148 */ "Pagecount" OpHelp(""),
23243 /* 149 */ "MaxPgcnt" OpHelp(""),
23244 /* 150 */ "Trace" OpHelp(""),
23245 /* 151 */ "Noop" OpHelp(""),
23246 /* 152 */ "Explain" OpHelp(""),
 
23247 };
23248 return azName[i];
23249 }
23250 #endif
23251
@@ -28306,14 +28343,14 @@
28306 ** Or, if the third argument is NULL, then this function is being called
28307 ** to inform the VFS layer that, according to POSIX, any existing mapping
28308 ** may now be invalid and should be unmapped.
28309 */
28310 static int unixUnfetch(sqlite3_file *fd, i64 iOff, void *p){
 
28311 unixFile *pFd = (unixFile *)fd; /* The underlying database file */
28312 UNUSED_PARAMETER(iOff);
28313
28314 #if SQLITE_MAX_MMAP_SIZE>0
28315 /* If p==0 (unmap the entire file) then there must be no outstanding
28316 ** xFetch references. Or, if p!=0 (meaning it is an xFetch reference),
28317 ** then there must be at least one outstanding. */
28318 assert( (p==0)==(pFd->nFetchOut==0) );
28319
@@ -28325,10 +28362,14 @@
28325 }else{
28326 unixUnmapfile(pFd);
28327 }
28328
28329 assert( pFd->nFetchOut>=0 );
 
 
 
 
28330 #endif
28331 return SQLITE_OK;
28332 }
28333
28334 /*
@@ -34366,11 +34407,11 @@
34366 sqlite3_mutex_enter(sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MASTER));
34367 }
34368 static void winShmLeaveMutex(void){
34369 sqlite3_mutex_leave(sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MASTER));
34370 }
34371 #ifdef SQLITE_DEBUG
34372 static int winShmMutexHeld(void) {
34373 return sqlite3_mutex_held(sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MASTER));
34374 }
34375 #endif
34376
@@ -57919,18 +57960,20 @@
57919 ){
57920 MemPage *pPage;
57921 int rc;
57922 unsigned char *pCell;
57923 int i;
 
57924
57925 assert( sqlite3_mutex_held(pBt->mutex) );
57926 if( pgno>btreePagecount(pBt) ){
57927 return SQLITE_CORRUPT_BKPT;
57928 }
57929
57930 rc = getAndInitPage(pBt, pgno, &pPage, 0);
57931 if( rc ) return rc;
 
57932 for(i=0; i<pPage->nCell; i++){
57933 pCell = findCell(pPage, i);
57934 if( !pPage->leaf ){
57935 rc = clearDatabasePage(pBt, get4byte(pCell), 1, pnChange);
57936 if( rc ) goto cleardatabasepage_out;
@@ -57937,20 +57980,20 @@
57937 }
57938 rc = clearCell(pPage, pCell);
57939 if( rc ) goto cleardatabasepage_out;
57940 }
57941 if( !pPage->leaf ){
57942 rc = clearDatabasePage(pBt, get4byte(&pPage->aData[8]), 1, pnChange);
57943 if( rc ) goto cleardatabasepage_out;
57944 }else if( pnChange ){
57945 assert( pPage->intKey );
57946 *pnChange += pPage->nCell;
57947 }
57948 if( freePageFlag ){
57949 freePage(pPage, &rc);
57950 }else if( (rc = sqlite3PagerWrite(pPage->pDbPage))==0 ){
57951 zeroPage(pPage, pPage->aData[0] | PTF_LEAF);
57952 }
57953
57954 cleardatabasepage_out:
57955 releasePage(pPage);
57956 return rc;
@@ -61463,10 +61506,11 @@
61463 assert( v->magic==VDBE_MAGIC_INIT );
61464 assert( j<p->nLabel );
61465 if( j>=0 && p->aLabel ){
61466 p->aLabel[j] = v->nOp;
61467 }
 
61468 }
61469
61470 /*
61471 ** Mark the VDBE as one that can only be run one time.
61472 */
@@ -61811,11 +61855,12 @@
61811 /*
61812 ** Change the P2 operand of instruction addr so that it points to
61813 ** the address of the next instruction to be coded.
61814 */
61815 SQLITE_PRIVATE void sqlite3VdbeJumpHere(Vdbe *p, int addr){
61816 if( ALWAYS(addr>=0) ) sqlite3VdbeChangeP2(p, addr, p->nOp);
 
61817 }
61818
61819
61820 /*
61821 ** If the input FuncDef structure is ephemeral, then free it. If
@@ -61916,12 +61961,17 @@
61916 }
61917
61918 /*
61919 ** Remove the last opcode inserted
61920 */
61921 SQLITE_PRIVATE void sqlite3VdbeDeleteLastOpcode(Vdbe *p){
61922 p->nOp--;
 
 
 
 
 
61923 }
61924
61925 /*
61926 ** Change the value of the P4 operand for a specific instruction.
61927 ** This routine is useful when a large program is loaded from a
@@ -69688,10 +69738,37 @@
69688 }
69689 pCx->isOrdered = (pOp->p5!=BTREE_UNORDERED);
69690 break;
69691 }
69692
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
69693 /* Opcode: SorterOpen P1 * * P4 *
69694 **
69695 ** This opcode works like OP_OpenEphemeral except that it opens
69696 ** a transient index that is specifically designed to sort large
69697 ** tables using an external merge-sort algorithm.
@@ -74781,42 +74858,43 @@
74781 }
74782
74783 /*
74784 ** Call sqlite3WalkExpr() for every expression in Select statement p.
74785 ** Invoke sqlite3WalkSelect() for subqueries in the FROM clause and
74786 ** on the compound select chain, p->pPrior. Invoke the xSelectCallback()
74787 ** either before or after the walk of expressions and FROM clause, depending
74788 ** on whether pWalker->bSelectDepthFirst is false or true, respectively.
 
 
 
74789 **
74790 ** Return WRC_Continue under normal conditions. Return WRC_Abort if
74791 ** there is an abort request.
74792 **
74793 ** If the Walker does not have an xSelectCallback() then this routine
74794 ** is a no-op returning WRC_Continue.
74795 */
74796 SQLITE_PRIVATE int sqlite3WalkSelect(Walker *pWalker, Select *p){
74797 int rc;
74798 if( p==0 || pWalker->xSelectCallback==0 ) return WRC_Continue;
 
 
74799 rc = WRC_Continue;
74800 pWalker->walkerDepth++;
74801 while( p ){
74802 if( !pWalker->bSelectDepthFirst ){
74803 rc = pWalker->xSelectCallback(pWalker, p);
74804 if( rc ) break;
74805 }
74806 if( sqlite3WalkSelectExpr(pWalker, p)
74807 || sqlite3WalkSelectFrom(pWalker, p)
74808 ){
74809 pWalker->walkerDepth--;
74810 return WRC_Abort;
74811 }
74812 if( pWalker->bSelectDepthFirst ){
74813 rc = pWalker->xSelectCallback(pWalker, p);
74814 /* Depth-first search is currently only used for
74815 ** selectAddSubqueryTypeInfo() and that routine always returns
74816 ** WRC_Continue (0). So the following branch is never taken. */
74817 if( NEVER(rc) ) break;
74818 }
74819 p = p->pPrior;
74820 }
74821 pWalker->walkerDepth--;
74822 return rc & WRC_Abort;
@@ -77170,10 +77248,37 @@
77170 }
77171 }
77172 return pNew;
77173 }
77174
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
77175 /*
77176 ** The following group of routines make deep copies of expressions,
77177 ** expression lists, ID lists, and select statements. The copies can
77178 ** be deleted (by being passed to their respective ...Delete() routines)
77179 ** without effecting the originals.
@@ -77250,10 +77355,11 @@
77250 pNewItem->iCursor = pOldItem->iCursor;
77251 pNewItem->addrFillSub = pOldItem->addrFillSub;
77252 pNewItem->regReturn = pOldItem->regReturn;
77253 pNewItem->isCorrelated = pOldItem->isCorrelated;
77254 pNewItem->viaCoroutine = pOldItem->viaCoroutine;
 
77255 pNewItem->zIndex = sqlite3DbStrDup(db, pOldItem->zIndex);
77256 pNewItem->notIndexed = pOldItem->notIndexed;
77257 pNewItem->pIndex = pOldItem->pIndex;
77258 pTab = pNewItem->pTab = pOldItem->pTab;
77259 if( pTab ){
@@ -77311,10 +77417,11 @@
77311 pNew->selFlags = p->selFlags & ~SF_UsesEphemeral;
77312 pNew->pRightmost = 0;
77313 pNew->addrOpenEphm[0] = -1;
77314 pNew->addrOpenEphm[1] = -1;
77315 pNew->addrOpenEphm[2] = -1;
 
77316 return pNew;
77317 }
77318 #else
77319 SQLITE_PRIVATE Select *sqlite3SelectDup(sqlite3 *db, Select *p, int flags){
77320 assert( p==0 );
@@ -77830,13 +77937,15 @@
77830 pTab = p->pSrc->a[0].pTab;
77831 pExpr = p->pEList->a[0].pExpr;
77832 iCol = (i16)pExpr->iColumn;
77833
77834 /* Code an OP_VerifyCookie and OP_TableLock for <table>. */
77835 iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
77836 sqlite3CodeVerifySchema(pParse, iDb);
77837 sqlite3TableLock(pParse, iDb, pTab->tnum, 0, pTab->zName);
 
 
77838
77839 /* This function is only called from two places. In both cases the vdbe
77840 ** has already been allocated. So assume sqlite3GetVdbe() is always
77841 ** successful here.
77842 */
@@ -79663,11 +79772,11 @@
79663 sqlite3ExplainPush(pOut);
79664 for(i=0; i<pList->nExpr; i++){
79665 sqlite3ExplainPrintf(pOut, "item[%d] = ", i);
79666 sqlite3ExplainPush(pOut);
79667 sqlite3ExplainExpr(pOut, pList->a[i].pExpr);
79668 sqlite3ExplainPop(pOut, 1);
79669 if( pList->a[i].zName ){
79670 sqlite3ExplainPrintf(pOut, " AS %s", pList->a[i].zName);
79671 }
79672 if( pList->a[i].bSpanIsTab ){
79673 sqlite3ExplainPrintf(pOut, " (%s)", pList->a[i].zSpan);
@@ -84091,10 +84200,11 @@
84091 */
84092 v = sqlite3GetVdbe(pParse);
84093 assert( !pParse->isMultiWrite
84094 || sqlite3VdbeAssertMayAbort(v, pParse->mayAbort));
84095 if( v ){
 
84096 sqlite3VdbeAddOp0(v, OP_Halt);
84097
84098 /* The cookie mask contains one bit for each database file open.
84099 ** (Bit 0 is for main, bit 1 is for temp, and so forth.) Bits are
84100 ** set for each database that is used. Generate code to start a
@@ -85402,14 +85512,14 @@
85402 i = *pIdx;
85403
85404 for(j=0; zIdent[j]; j++){
85405 if( !sqlite3Isalnum(zIdent[j]) && zIdent[j]!='_' ) break;
85406 }
85407 needQuote = sqlite3Isdigit(zIdent[0]) || sqlite3KeywordCode(zIdent, j)!=TK_ID;
85408 if( !needQuote ){
85409 needQuote = zIdent[j];
85410 }
85411
85412 if( needQuote ) z[i++] = '"';
85413 for(j=0; zIdent[j]; j++){
85414 z[i++] = zIdent[j];
85415 if( zIdent[j]=='"' ) z[i++] = '"';
@@ -86628,11 +86738,11 @@
86628 ** records into the sorter. */
86629 sqlite3OpenTable(pParse, iTab, iDb, pTab, OP_OpenRead);
86630 addr1 = sqlite3VdbeAddOp2(v, OP_Rewind, iTab, 0);
86631 regRecord = sqlite3GetTempReg(pParse);
86632
86633 sqlite3GenerateIndexKey(pParse, pIndex, iTab, regRecord, 0, &iPartIdxLabel);
86634 sqlite3VdbeAddOp2(v, OP_SorterInsert, iSorter, regRecord);
86635 sqlite3VdbeResolveLabel(v, iPartIdxLabel);
86636 sqlite3VdbeAddOp2(v, OP_Next, iTab, addr1+1);
86637 sqlite3VdbeJumpHere(v, addr1);
86638 if( memRootPage<0 ) sqlite3VdbeAddOp2(v, OP_Clear, tnum, iDb);
@@ -88149,10 +88259,80 @@
88149 }
88150 }
88151 return sqlite3KeyInfoRef(pIdx->pKeyInfo);
88152 }
88153
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
88154 /************** End of build.c ***********************************************/
88155 /************** Begin file callback.c ****************************************/
88156 /*
88157 ** 2005 May 23
88158 **
@@ -89347,13 +89527,14 @@
89347 int iDataCur, /* Cursor of table holding data. */
89348 int iIdxCur, /* First index cursor */
89349 int *aRegIdx /* Only delete if aRegIdx!=0 && aRegIdx[i]>0 */
89350 ){
89351 int i; /* Index loop counter */
89352 int r1; /* Register holding an index key */
89353 int iPartIdxLabel; /* Jump destination for skipping partial index entries */
89354 Index *pIdx; /* Current index */
 
89355 Vdbe *v; /* The prepared statement under construction */
89356 Index *pPk; /* PRIMARY KEY index, or NULL for rowid tables */
89357
89358 v = pParse->pVdbe;
89359 pPk = HasRowid(pTab) ? 0 : sqlite3PrimaryKeyIndex(pTab);
@@ -89360,14 +89541,16 @@
89360 for(i=0, pIdx=pTab->pIndex; pIdx; i++, pIdx=pIdx->pNext){
89361 assert( iIdxCur+i!=iDataCur || pPk==pIdx );
89362 if( aRegIdx!=0 && aRegIdx[i]==0 ) continue;
89363 if( pIdx==pPk ) continue;
89364 VdbeModuleComment((v, "GenRowIdxDel for %s", pIdx->zName));
89365 r1 = sqlite3GenerateIndexKey(pParse, pIdx, iDataCur, 0, 1, &iPartIdxLabel);
 
89366 sqlite3VdbeAddOp3(v, OP_IdxDelete, iIdxCur+i, r1,
89367 pIdx->uniqNotNull ? pIdx->nKeyCol : pIdx->nColumn);
89368 sqlite3VdbeResolveLabel(v, iPartIdxLabel);
 
89369 }
89370 }
89371
89372 /*
89373 ** Generate code that will assemble an index key and stores it in register
@@ -89385,18 +89568,31 @@
89385 ** to that label if pIdx is a partial index that should be skipped.
89386 ** A partial index should be skipped if its WHERE clause evaluates
89387 ** to false or null. If pIdx is not a partial index, *piPartIdxLabel
89388 ** will be set to zero which is an empty label that is ignored by
89389 ** sqlite3VdbeResolveLabel().
 
 
 
 
 
 
 
 
 
 
 
89390 */
89391 SQLITE_PRIVATE int sqlite3GenerateIndexKey(
89392 Parse *pParse, /* Parsing context */
89393 Index *pIdx, /* The index for which to generate a key */
89394 int iDataCur, /* Cursor number from which to take column data */
89395 int regOut, /* Put the new key into this register if not 0 */
89396 int prefixOnly, /* Compute only a unique prefix of the key */
89397 int *piPartIdxLabel /* OUT: Jump to this label to skip partial index */
 
 
89398 ){
89399 Vdbe *v = pParse->pVdbe;
89400 int j;
89401 Table *pTab = pIdx->pTable;
89402 int regBase;
@@ -89412,22 +89608,22 @@
89412 *piPartIdxLabel = 0;
89413 }
89414 }
89415 nCol = (prefixOnly && pIdx->uniqNotNull) ? pIdx->nKeyCol : pIdx->nColumn;
89416 regBase = sqlite3GetTempRange(pParse, nCol);
 
89417 for(j=0; j<nCol; j++){
 
89418 sqlite3ExprCodeGetColumnOfTable(v, pTab, iDataCur, pIdx->aiColumn[j],
89419 regBase+j);
89420 /* If the column affinity is REAL but the number is an integer, then it
89421 ** might be stored in the table as an integer (using a compact
89422 ** representation) then converted to REAL by an OP_RealAffinity opcode.
89423 ** But we are getting ready to store this value back into an index, where
89424 ** it should be converted by to INTEGER again. So omit the OP_RealAffinity
89425 ** opcode if it is present */
89426 if( sqlite3VdbeGetOp(v, -1)->opcode==OP_RealAffinity ){
89427 sqlite3VdbeDeleteLastOpcode(v);
89428 }
89429 }
89430 if( regOut ){
89431 sqlite3VdbeAddOp3(v, OP_MakeRecord, regBase, nCol, regOut);
89432 }
89433 sqlite3ReleaseTempRange(pParse, regBase, nCol);
@@ -93086,11 +93282,10 @@
93086 ** D: cleanup
93087 */
93088 SQLITE_PRIVATE void sqlite3Insert(
93089 Parse *pParse, /* Parser context */
93090 SrcList *pTabList, /* Name of table into which we are inserting */
93091 ExprList *pList, /* List of values to be inserted */
93092 Select *pSelect, /* A SELECT statement to use as the data source */
93093 IdList *pColumn, /* Column names corresponding to IDLIST. */
93094 int onError /* How to handle constraint errors */
93095 ){
93096 sqlite3 *db; /* The main database structure */
@@ -93114,10 +93309,11 @@
93114 SelectDest dest; /* Destination for SELECT on rhs of INSERT */
93115 int iDb; /* Index of database holding TABLE */
93116 Db *pDb; /* The database containing table being inserted into */
93117 int appendFlag = 0; /* True if the insert is likely to be an append */
93118 int withoutRowid; /* 0 for normal table. 1 for WITHOUT ROWID table */
 
93119
93120 /* Register allocations */
93121 int regFromSelect = 0;/* Base register for data coming from SELECT */
93122 int regAutoinc = 0; /* Register holding the AUTOINCREMENT counter */
93123 int regRowCount = 0; /* Memory cell used for the row counter */
@@ -93136,10 +93332,21 @@
93136 db = pParse->db;
93137 memset(&dest, 0, sizeof(dest));
93138 if( pParse->nErr || db->mallocFailed ){
93139 goto insert_cleanup;
93140 }
 
 
 
 
 
 
 
 
 
 
 
93141
93142 /* Locate the table into which we will be inserting new information.
93143 */
93144 assert( pTabList->nSrc==1 );
93145 zTab = pTabList->a[0].zName;
@@ -94392,10 +94599,16 @@
94392 int destHasUniqueIdx = 0; /* True if pDest has a UNIQUE index */
94393 int regData, regRowid; /* Registers holding data and rowid */
94394
94395 if( pSelect==0 ){
94396 return 0; /* Must be of the form INSERT INTO ... SELECT ... */
 
 
 
 
 
 
94397 }
94398 if( sqlite3TriggerList(pParse, pDest) ){
94399 return 0; /* tab1 must not have triggers */
94400 }
94401 #ifndef SQLITE_OMIT_VIRTUALTABLE
@@ -97891,12 +98104,14 @@
97891 /* Make sure all the indices are constructed correctly.
97892 */
97893 for(x=sqliteHashFirst(pTbls); x && !isQuick; x=sqliteHashNext(x)){
97894 Table *pTab = sqliteHashData(x);
97895 Index *pIdx, *pPk;
 
97896 int loopTop;
97897 int iDataCur, iIdxCur;
 
97898
97899 if( pTab->pIndex==0 ) continue;
97900 pPk = HasRowid(pTab) ? 0 : sqlite3PrimaryKeyIndex(pTab);
97901 addr = sqlite3VdbeAddOp1(v, OP_IfPos, 1); /* Stop if out of errors */
97902 sqlite3VdbeAddOp2(v, OP_Halt, 0, 0);
@@ -97911,13 +98126,14 @@
97911 pParse->nMem = MAX(pParse->nMem, 8+j);
97912 sqlite3VdbeAddOp2(v, OP_Rewind, iDataCur, 0);
97913 loopTop = sqlite3VdbeAddOp2(v, OP_AddImm, 7, 1);
97914 for(j=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, j++){
97915 int jmp2, jmp3, jmp4;
97916 int r1;
97917 if( pPk==pIdx ) continue;
97918 r1 = sqlite3GenerateIndexKey(pParse, pIdx, iDataCur, 0, 0, &jmp3);
 
 
97919 sqlite3VdbeAddOp2(v, OP_AddImm, 8+j, 1); /* increment entry count */
97920 jmp2 = sqlite3VdbeAddOp4Int(v, OP_Found, iIdxCur+j, 0, r1,
97921 pIdx->nColumn);
97922 sqlite3VdbeAddOp2(v, OP_AddImm, 1, -1); /* Decrement error limit */
97923 sqlite3VdbeAddOp4(v, OP_String8, 0, 3, 0, "row ", P4_STATIC);
@@ -99229,10 +99445,11 @@
99229 sqlite3ExprDelete(db, p->pHaving);
99230 sqlite3ExprListDelete(db, p->pOrderBy);
99231 sqlite3SelectDelete(db, p->pPrior);
99232 sqlite3ExprDelete(db, p->pLimit);
99233 sqlite3ExprDelete(db, p->pOffset);
 
99234 }
99235
99236 /*
99237 ** Initialize a SelectDest structure.
99238 */
@@ -99890,16 +100107,30 @@
99890 }
99891 #endif
99892
99893 /* Store the result as data using a unique key.
99894 */
 
99895 case SRT_Table:
99896 case SRT_EphemTab: {
99897 int r1 = sqlite3GetTempReg(pParse);
99898 testcase( eDest==SRT_Table );
99899 testcase( eDest==SRT_EphemTab );
99900 sqlite3VdbeAddOp3(v, OP_MakeRecord, regResult, nColumn, r1);
 
 
 
 
 
 
 
 
 
 
 
 
 
99901 if( pOrderBy ){
99902 pushOntoSorter(pParse, pOrderBy, p, r1);
99903 }else{
99904 int r2 = sqlite3GetTempReg(pParse);
99905 sqlite3VdbeAddOp2(v, OP_NewRowid, iParm, r2);
@@ -100402,11 +100633,11 @@
100402 sNC.pSrcList = pS->pSrc;
100403 sNC.pNext = pNC;
100404 sNC.pParse = pNC->pParse;
100405 zType = columnType(&sNC, p,&zOrigDb,&zOrigTab,&zOrigCol, &estWidth);
100406 }
100407 }else if( ALWAYS(pTab->pSchema) ){
100408 /* A real table */
100409 assert( !pS );
100410 if( iCol<0 ) iCol = pTab->iPKey;
100411 assert( iCol==-1 || (iCol>=0 && iCol<pTab->nCol) );
100412 #ifdef SQLITE_ENABLE_COLUMN_METADATA
@@ -100563,12 +100794,13 @@
100563 sqlite3VdbeSetColName(v, i, COLNAME_NAME, zName, SQLITE_DYNAMIC);
100564 }else{
100565 sqlite3VdbeSetColName(v, i, COLNAME_NAME, zCol, SQLITE_TRANSIENT);
100566 }
100567 }else{
100568 sqlite3VdbeSetColName(v, i, COLNAME_NAME,
100569 sqlite3DbStrDup(db, pEList->a[i].zSpan), SQLITE_DYNAMIC);
 
100570 }
100571 }
100572 generateColumnTypes(pParse, pTabList, pEList);
100573 }
100574
@@ -100928,10 +101160,11 @@
100928
100929 /* Make sure there is no ORDER BY or LIMIT clause on prior SELECTs. Only
100930 ** the last (right-most) SELECT in the series may have an ORDER BY or LIMIT.
100931 */
100932 assert( p && p->pPrior ); /* Calling function guarantees this much */
 
100933 db = pParse->db;
100934 pPrior = p->pPrior;
100935 assert( pPrior->pRightmost!=pPrior );
100936 assert( pPrior->pRightmost==p->pRightmost );
100937 dest = *pDest;
@@ -100972,16 +101205,96 @@
100972 " do not have the same number of result columns", selectOpName(p->op));
100973 }
100974 rc = 1;
100975 goto multi_select_end;
100976 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
100977
100978 /* Compound SELECTs that have an ORDER BY clause are handled separately.
100979 */
100980 if( p->pOrderBy ){
100981 return multiSelectOrderBy(pParse, p, pDest);
100982 }
100983
100984 /* Generate code for the left and right SELECT statements.
100985 */
100986 switch( p->op ){
100987 case TK_ALL: {
@@ -102040,10 +102353,18 @@
102040 ** appear as unmodified result columns in the outer query. But we
102041 ** have other optimizations in mind to deal with that case.
102042 **
102043 ** (21) The subquery does not use LIMIT or the outer query is not
102044 ** DISTINCT. (See ticket [752e1646fc]).
 
 
 
 
 
 
 
 
102045 **
102046 ** In this routine, the "p" parameter is a pointer to the outer query.
102047 ** The subquery is p->pSrc->a[iFrom]. isAgg is true if the outer query
102048 ** uses aggregates and subqueryIsAgg is true if the subquery uses aggregates.
102049 **
@@ -102112,10 +102433,12 @@
102112 if( isAgg && pSub->pOrderBy ) return 0; /* Restriction (16) */
102113 if( pSub->pLimit && p->pWhere ) return 0; /* Restriction (19) */
102114 if( pSub->pLimit && (p->selFlags & SF_Distinct)!=0 ){
102115 return 0; /* Restriction (21) */
102116 }
 
 
102117
102118 /* OBSOLETE COMMENT 1:
102119 ** Restriction 3: If the subquery is a join, make sure the subquery is
102120 ** not used as the right operand of an outer join. Examples of why this
102121 ** is not allowed:
@@ -102593,10 +102916,200 @@
102593 pNew->pLimit = 0;
102594 pNew->pOffset = 0;
102595 return WRC_Continue;
102596 }
102597
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
102598 /*
102599 ** This routine is a Walker callback for "expanding" a SELECT statement.
102600 ** "Expanding" means to do the following:
102601 **
102602 ** (1) Make sure VDBE cursor numbers have been assigned to every
@@ -102636,10 +103149,11 @@
102636 if( NEVER(p->pSrc==0) || (selFlags & SF_Expanded)!=0 ){
102637 return WRC_Prune;
102638 }
102639 pTabList = p->pSrc;
102640 pEList = p->pEList;
 
102641
102642 /* Make sure cursor numbers have been assigned to all entries in
102643 ** the FROM clause of the SELECT statement.
102644 */
102645 sqlite3SrcListAssignCursors(pParse, pTabList);
@@ -102648,16 +103162,25 @@
102648 ** an entry of the FROM clause is a subquery instead of a table or view,
102649 ** then create a transient table structure to describe the subquery.
102650 */
102651 for(i=0, pFrom=pTabList->a; i<pTabList->nSrc; i++, pFrom++){
102652 Table *pTab;
 
 
102653 if( pFrom->pTab!=0 ){
102654 /* This statement has already been prepared. There is no need
102655 ** to go further. */
102656 assert( i==0 );
 
 
 
102657 return WRC_Prune;
102658 }
 
 
 
 
102659 if( pFrom->zName==0 ){
102660 #ifndef SQLITE_OMIT_SUBQUERY
102661 Select *pSel = pFrom->pSelect;
102662 /* A sub-query in the FROM clause of a SELECT */
102663 assert( pSel!=0 );
@@ -102916,10 +103439,11 @@
102916 if( pParse->hasCompound ){
102917 w.xSelectCallback = convertCompoundSelectToSubquery;
102918 sqlite3WalkSelect(&w, pSelect);
102919 }
102920 w.xSelectCallback = selectExpander;
 
102921 sqlite3WalkSelect(&w, pSelect);
102922 }
102923
102924
102925 #ifndef SQLITE_OMIT_SUBQUERY
@@ -102934,11 +103458,11 @@
102934 ** The Table structure that represents the result set was constructed
102935 ** by selectExpander() but the type and collation information was omitted
102936 ** at that point because identifiers had not yet been resolved. This
102937 ** routine is called after identifier resolution.
102938 */
102939 static int selectAddSubqueryTypeInfo(Walker *pWalker, Select *p){
102940 Parse *pParse;
102941 int i;
102942 SrcList *pTabList;
102943 struct SrcList_item *pFrom;
102944
@@ -102950,17 +103474,17 @@
102950 for(i=0, pFrom=pTabList->a; i<pTabList->nSrc; i++, pFrom++){
102951 Table *pTab = pFrom->pTab;
102952 if( ALWAYS(pTab!=0) && (pTab->tabFlags & TF_Ephemeral)!=0 ){
102953 /* A sub-query in the FROM clause of a SELECT */
102954 Select *pSel = pFrom->pSelect;
102955 assert( pSel );
102956 while( pSel->pPrior ) pSel = pSel->pPrior;
102957 selectAddColumnTypeAndCollation(pParse, pTab, pSel);
 
102958 }
102959 }
102960 }
102961 return WRC_Continue;
102962 }
102963 #endif
102964
102965
102966 /*
@@ -102972,14 +103496,13 @@
102972 */
102973 static void sqlite3SelectAddTypeInfo(Parse *pParse, Select *pSelect){
102974 #ifndef SQLITE_OMIT_SUBQUERY
102975 Walker w;
102976 memset(&w, 0, sizeof(w));
102977 w.xSelectCallback = selectAddSubqueryTypeInfo;
102978 w.xExprCallback = exprWalkNoop;
102979 w.pParse = pParse;
102980 w.bSelectDepthFirst = 1;
102981 sqlite3WalkSelect(&w, pSelect);
102982 #endif
102983 }
102984
102985
@@ -104723,29 +105246,25 @@
104723 */
104724 SQLITE_PRIVATE TriggerStep *sqlite3TriggerInsertStep(
104725 sqlite3 *db, /* The database connection */
104726 Token *pTableName, /* Name of the table into which we insert */
104727 IdList *pColumn, /* List of columns in pTableName to insert into */
104728 ExprList *pEList, /* The VALUE clause: a list of values to be inserted */
104729 Select *pSelect, /* A SELECT statement that supplies values */
104730 u8 orconf /* The conflict algorithm (OE_Abort, OE_Replace, etc.) */
104731 ){
104732 TriggerStep *pTriggerStep;
104733
104734 assert(pEList == 0 || pSelect == 0);
104735 assert(pEList != 0 || pSelect != 0 || db->mallocFailed);
104736
104737 pTriggerStep = triggerStepAllocate(db, TK_INSERT, pTableName);
104738 if( pTriggerStep ){
104739 pTriggerStep->pSelect = sqlite3SelectDup(db, pSelect, EXPRDUP_REDUCE);
104740 pTriggerStep->pIdList = pColumn;
104741 pTriggerStep->pExprList = sqlite3ExprListDup(db, pEList, EXPRDUP_REDUCE);
104742 pTriggerStep->orconf = orconf;
104743 }else{
104744 sqlite3IdListDelete(db, pColumn);
104745 }
104746 sqlite3ExprListDelete(db, pEList);
104747 sqlite3SelectDelete(db, pSelect);
104748
104749 return pTriggerStep;
104750 }
104751
@@ -105079,11 +105598,10 @@
105079 break;
105080 }
105081 case TK_INSERT: {
105082 sqlite3Insert(pParse,
105083 targetSrcList(pParse, pStep),
105084 sqlite3ExprListDup(db, pStep->pExprList, 0),
105085 sqlite3SelectDup(db, pStep->pSelect, 0),
105086 sqlite3IdListDup(db, pStep->pIdList),
105087 pParse->eOrconf
105088 );
105089 break;
@@ -108830,11 +109348,11 @@
108830 ** be the name of an indexed column with TEXT affinity. */
108831 return 0;
108832 }
108833 assert( pLeft->iColumn!=(-1) ); /* Because IPK never has AFF_TEXT */
108834
108835 pRight = pList->a[0].pExpr;
108836 op = pRight->op;
108837 if( op==TK_VARIABLE ){
108838 Vdbe *pReprepare = pParse->pReprepare;
108839 int iCol = pRight->iColumn;
108840 pVal = sqlite3VdbeGetBoundValue(pReprepare, iCol, SQLITE_AFF_NONE);
@@ -109873,11 +110391,11 @@
109873 VdbeComment((v, "for %s", pTable->zName));
109874
109875 /* Fill the automatic index with content */
109876 addrTop = sqlite3VdbeAddOp1(v, OP_Rewind, pLevel->iTabCur);
109877 regRecord = sqlite3GetTempReg(pParse);
109878 sqlite3GenerateIndexKey(pParse, pIdx, pLevel->iTabCur, regRecord, 0, 0);
109879 sqlite3VdbeAddOp2(v, OP_IdxInsert, pLevel->iIdxCur, regRecord);
109880 sqlite3VdbeChangeP5(v, OPFLAG_USESEEKRESULT);
109881 sqlite3VdbeAddOp2(v, OP_Next, pLevel->iTabCur, addrTop+1);
109882 sqlite3VdbeChangeP5(v, SQLITE_STMTSTATUS_AUTOINDEX);
109883 sqlite3VdbeJumpHere(v, addrTop);
@@ -112359,10 +112877,11 @@
112359 && pSrc->pIndex==0
112360 && !pSrc->viaCoroutine
112361 && !pSrc->notIndexed
112362 && HasRowid(pTab)
112363 && !pSrc->isCorrelated
 
112364 ){
112365 /* Generate auto-index WhereLoops */
112366 WhereTerm *pTerm;
112367 WhereTerm *pWCEnd = pWC->a + pWC->nTerm;
112368 for(pTerm=pWC->a; rc==SQLITE_OK && pTerm<pWCEnd; pTerm++){
@@ -114129,18 +114648,10 @@
114129 /*
114130 ** An instance of this structure holds the ATTACH key and the key type.
114131 */
114132 struct AttachKey { int type; Token key; };
114133
114134 /*
114135 ** One or more VALUES claues
114136 */
114137 struct ValueList {
114138 ExprList *pList;
114139 Select *pSelect;
114140 };
114141
114142
114143 /* This is a utility routine used to set the ExprSpan.zStart and
114144 ** ExprSpan.zEnd values of pOut so that the span covers the complete
114145 ** range of text beginning with pStart and going to the end of pEnd.
114146 */
@@ -114260,42 +114771,42 @@
114260 ** YYNRULE the number of rules in the grammar
114261 ** YYERRORSYMBOL is the code number of the error symbol. If not
114262 ** defined, then do no error processing.
114263 */
114264 #define YYCODETYPE unsigned char
114265 #define YYNOCODE 253
114266 #define YYACTIONTYPE unsigned short int
114267 #define YYWILDCARD 68
114268 #define sqlite3ParserTOKENTYPE Token
114269 typedef union {
114270 int yyinit;
114271 sqlite3ParserTOKENTYPE yy0;
114272 int yy4;
114273 struct TrigEvent yy90;
114274 ExprSpan yy118;
114275 u16 yy177;
114276 TriggerStep* yy203;
114277 u8 yy210;
114278 struct {int value; int mask;} yy215;
114279 SrcList* yy259;
114280 struct ValueList yy260;
114281 struct LimitVal yy292;
114282 Expr* yy314;
114283 ExprList* yy322;
114284 struct LikeOp yy342;
114285 IdList* yy384;
114286 Select* yy387;
114287 } YYMINORTYPE;
114288 #ifndef YYSTACKDEPTH
114289 #define YYSTACKDEPTH 100
114290 #endif
114291 #define sqlite3ParserARG_SDECL Parse *pParse;
114292 #define sqlite3ParserARG_PDECL ,Parse *pParse
114293 #define sqlite3ParserARG_FETCH Parse *pParse = yypParser->pParse
114294 #define sqlite3ParserARG_STORE yypParser->pParse = pParse
114295 #define YYNSTATE 631
114296 #define YYNRULE 329
114297 #define YYFALLBACK 1
114298 #define YY_NO_ACTION (YYNSTATE+YYNRULE+2)
114299 #define YY_ACCEPT_ACTION (YYNSTATE+YYNRULE+1)
114300 #define YY_ERROR_ACTION (YYNSTATE+YYNRULE)
114301
@@ -114361,484 +114872,467 @@
114361 ** shifting terminals.
114362 ** yy_reduce_ofst[] For each state, the offset into yy_action for
114363 ** shifting non-terminals after a reduce.
114364 ** yy_default[] Default action for each state.
114365 */
114366 #define YY_ACTTAB_COUNT (1582)
114367 static const YYACTIONTYPE yy_action[] = {
114368 /* 0 */ 312, 961, 185, 420, 2, 171, 516, 515, 597, 56,
114369 /* 10 */ 56, 56, 56, 49, 54, 54, 54, 54, 53, 53,
114370 /* 20 */ 52, 52, 52, 51, 234, 197, 196, 195, 624, 623,
114371 /* 30 */ 301, 590, 584, 56, 56, 56, 56, 156, 54, 54,
114372 /* 40 */ 54, 54, 53, 53, 52, 52, 52, 51, 234, 628,
114373 /* 50 */ 57, 58, 48, 582, 581, 583, 583, 55, 55, 56,
114374 /* 60 */ 56, 56, 56, 466, 54, 54, 54, 54, 53, 53,
114375 /* 70 */ 52, 52, 52, 51, 234, 312, 597, 52, 52, 52,
114376 /* 80 */ 51, 234, 33, 54, 54, 54, 54, 53, 53, 52,
114377 /* 90 */ 52, 52, 51, 234, 624, 623, 621, 620, 165, 624,
114378 /* 100 */ 623, 383, 380, 379, 214, 328, 590, 584, 624, 623,
114379 /* 110 */ 467, 59, 378, 619, 618, 617, 53, 53, 52, 52,
114380 /* 120 */ 52, 51, 234, 506, 507, 57, 58, 48, 582, 581,
114381 /* 130 */ 583, 583, 55, 55, 56, 56, 56, 56, 30, 54,
114382 /* 140 */ 54, 54, 54, 53, 53, 52, 52, 52, 51, 234,
114383 /* 150 */ 312, 50, 47, 146, 233, 232, 207, 474, 256, 349,
114384 /* 160 */ 255, 475, 621, 620, 554, 438, 298, 621, 620, 236,
114385 /* 170 */ 674, 435, 440, 553, 439, 366, 621, 620, 540, 224,
114386 /* 180 */ 551, 590, 584, 176, 138, 282, 386, 277, 385, 168,
114387 /* 190 */ 600, 422, 951, 548, 622, 951, 273, 572, 572, 566,
114388 /* 200 */ 57, 58, 48, 582, 581, 583, 583, 55, 55, 56,
114389 /* 210 */ 56, 56, 56, 354, 54, 54, 54, 54, 53, 53,
114390 /* 220 */ 52, 52, 52, 51, 234, 312, 561, 526, 62, 675,
114391 /* 230 */ 132, 595, 410, 348, 579, 579, 492, 426, 577, 419,
114392 /* 240 */ 627, 65, 329, 560, 441, 237, 676, 123, 607, 67,
114393 /* 250 */ 542, 532, 622, 170, 205, 500, 590, 584, 166, 559,
114394 /* 260 */ 622, 403, 593, 593, 593, 442, 443, 271, 422, 950,
114395 /* 270 */ 166, 223, 950, 483, 190, 57, 58, 48, 582, 581,
114396 /* 280 */ 583, 583, 55, 55, 56, 56, 56, 56, 600, 54,
114397 /* 290 */ 54, 54, 54, 53, 53, 52, 52, 52, 51, 234,
114398 /* 300 */ 312, 441, 412, 376, 175, 165, 166, 391, 383, 380,
114399 /* 310 */ 379, 342, 412, 203, 426, 66, 392, 622, 415, 378,
114400 /* 320 */ 597, 166, 442, 338, 444, 571, 601, 74, 415, 624,
114401 /* 330 */ 623, 590, 584, 624, 623, 174, 601, 92, 333, 171,
114402 /* 340 */ 1, 410, 597, 579, 579, 624, 623, 600, 306, 425,
114403 /* 350 */ 57, 58, 48, 582, 581, 583, 583, 55, 55, 56,
114404 /* 360 */ 56, 56, 56, 580, 54, 54, 54, 54, 53, 53,
114405 /* 370 */ 52, 52, 52, 51, 234, 312, 472, 262, 399, 68,
114406 /* 380 */ 412, 339, 571, 389, 624, 623, 578, 602, 597, 589,
114407 /* 390 */ 588, 603, 412, 622, 423, 533, 415, 621, 620, 513,
114408 /* 400 */ 257, 621, 620, 166, 601, 91, 590, 584, 415, 45,
114409 /* 410 */ 597, 586, 585, 621, 620, 250, 601, 92, 39, 347,
114410 /* 420 */ 576, 336, 597, 547, 567, 57, 58, 48, 582, 581,
114411 /* 430 */ 583, 583, 55, 55, 56, 56, 56, 56, 587, 54,
114412 /* 440 */ 54, 54, 54, 53, 53, 52, 52, 52, 51, 234,
114413 /* 450 */ 312, 561, 621, 620, 531, 291, 470, 188, 399, 375,
114414 /* 460 */ 247, 492, 249, 350, 412, 476, 476, 368, 560, 299,
114415 /* 470 */ 334, 412, 281, 482, 67, 565, 410, 622, 579, 579,
114416 /* 480 */ 415, 590, 584, 280, 559, 467, 520, 415, 601, 92,
114417 /* 490 */ 597, 167, 544, 36, 877, 601, 16, 519, 564, 6,
114418 /* 500 */ 57, 58, 48, 582, 581, 583, 583, 55, 55, 56,
114419 /* 510 */ 56, 56, 56, 200, 54, 54, 54, 54, 53, 53,
114420 /* 520 */ 52, 52, 52, 51, 234, 312, 183, 412, 236, 528,
114421 /* 530 */ 395, 535, 358, 256, 349, 255, 397, 412, 248, 182,
114422 /* 540 */ 353, 359, 549, 415, 236, 317, 563, 50, 47, 146,
114423 /* 550 */ 273, 601, 73, 415, 7, 311, 590, 584, 568, 493,
114424 /* 560 */ 213, 601, 92, 233, 232, 410, 173, 579, 579, 330,
114425 /* 570 */ 575, 574, 631, 629, 332, 57, 58, 48, 582, 581,
114426 /* 580 */ 583, 583, 55, 55, 56, 56, 56, 56, 199, 54,
114427 /* 590 */ 54, 54, 54, 53, 53, 52, 52, 52, 51, 234,
114428 /* 600 */ 312, 492, 340, 320, 511, 505, 572, 572, 460, 562,
114429 /* 610 */ 549, 170, 145, 430, 67, 558, 410, 622, 579, 579,
114430 /* 620 */ 384, 236, 600, 412, 408, 575, 574, 504, 572, 572,
114431 /* 630 */ 571, 590, 584, 353, 198, 143, 268, 549, 316, 415,
114432 /* 640 */ 306, 424, 207, 50, 47, 146, 167, 601, 69, 546,
114433 /* 650 */ 57, 58, 48, 582, 581, 583, 583, 55, 55, 56,
114434 /* 660 */ 56, 56, 56, 555, 54, 54, 54, 54, 53, 53,
114435 /* 670 */ 52, 52, 52, 51, 234, 312, 600, 326, 412, 270,
114436 /* 680 */ 145, 264, 274, 266, 459, 571, 423, 35, 412, 568,
114437 /* 690 */ 407, 213, 428, 388, 415, 308, 212, 143, 622, 354,
114438 /* 700 */ 317, 12, 601, 94, 415, 549, 590, 584, 50, 47,
114439 /* 710 */ 146, 365, 601, 97, 552, 362, 318, 147, 602, 361,
114440 /* 720 */ 325, 15, 603, 187, 206, 57, 58, 48, 582, 581,
114441 /* 730 */ 583, 583, 55, 55, 56, 56, 56, 56, 412, 54,
114442 /* 740 */ 54, 54, 54, 53, 53, 52, 52, 52, 51, 234,
114443 /* 750 */ 312, 412, 35, 412, 415, 22, 630, 2, 600, 50,
114444 /* 760 */ 47, 146, 601, 95, 412, 485, 510, 415, 412, 415,
114445 /* 770 */ 412, 11, 235, 486, 412, 601, 104, 601, 103, 19,
114446 /* 780 */ 415, 590, 584, 352, 415, 40, 415, 38, 601, 105,
114447 /* 790 */ 415, 32, 601, 106, 601, 133, 544, 169, 601, 134,
114448 /* 800 */ 57, 58, 48, 582, 581, 583, 583, 55, 55, 56,
114449 /* 810 */ 56, 56, 56, 412, 54, 54, 54, 54, 53, 53,
114450 /* 820 */ 52, 52, 52, 51, 234, 312, 412, 274, 412, 415,
114451 /* 830 */ 412, 274, 274, 274, 201, 230, 721, 601, 98, 484,
114452 /* 840 */ 427, 307, 415, 622, 415, 540, 415, 622, 622, 622,
114453 /* 850 */ 601, 102, 601, 101, 601, 93, 590, 584, 262, 21,
114454 /* 860 */ 129, 622, 522, 521, 554, 222, 469, 521, 600, 324,
114455 /* 870 */ 323, 322, 211, 553, 622, 57, 58, 48, 582, 581,
114456 /* 880 */ 583, 583, 55, 55, 56, 56, 56, 56, 412, 54,
114457 /* 890 */ 54, 54, 54, 53, 53, 52, 52, 52, 51, 234,
114458 /* 900 */ 312, 412, 261, 412, 415, 412, 600, 210, 625, 367,
114459 /* 910 */ 51, 234, 601, 100, 538, 606, 142, 415, 355, 415,
114460 /* 920 */ 412, 415, 412, 496, 622, 601, 77, 601, 96, 601,
114461 /* 930 */ 137, 590, 584, 530, 622, 529, 415, 141, 415, 28,
114462 /* 940 */ 524, 600, 229, 544, 601, 136, 601, 135, 604, 204,
114463 /* 950 */ 57, 58, 48, 582, 581, 583, 583, 55, 55, 56,
114464 /* 960 */ 56, 56, 56, 412, 54, 54, 54, 54, 53, 53,
114465 /* 970 */ 52, 52, 52, 51, 234, 312, 412, 360, 412, 415,
114466 /* 980 */ 412, 360, 286, 600, 503, 220, 127, 601, 76, 629,
114467 /* 990 */ 332, 382, 415, 622, 415, 540, 415, 622, 412, 613,
114468 /* 1000 */ 601, 90, 601, 89, 601, 75, 590, 584, 341, 272,
114469 /* 1010 */ 377, 622, 126, 27, 415, 622, 164, 544, 125, 280,
114470 /* 1020 */ 373, 122, 601, 88, 480, 57, 46, 48, 582, 581,
114471 /* 1030 */ 583, 583, 55, 55, 56, 56, 56, 56, 412, 54,
114472 /* 1040 */ 54, 54, 54, 53, 53, 52, 52, 52, 51, 234,
114473 /* 1050 */ 312, 412, 360, 412, 415, 412, 284, 186, 369, 321,
114474 /* 1060 */ 477, 170, 601, 87, 121, 473, 221, 415, 622, 415,
114475 /* 1070 */ 254, 415, 412, 355, 412, 601, 99, 601, 86, 601,
114476 /* 1080 */ 17, 590, 584, 259, 612, 120, 159, 158, 415, 622,
114477 /* 1090 */ 415, 14, 465, 157, 462, 25, 601, 85, 601, 84,
114478 /* 1100 */ 622, 58, 48, 582, 581, 583, 583, 55, 55, 56,
114479 /* 1110 */ 56, 56, 56, 412, 54, 54, 54, 54, 53, 53,
114480 /* 1120 */ 52, 52, 52, 51, 234, 312, 412, 262, 412, 415,
114481 /* 1130 */ 412, 262, 118, 611, 117, 24, 10, 601, 83, 351,
114482 /* 1140 */ 216, 219, 415, 622, 415, 608, 415, 622, 412, 622,
114483 /* 1150 */ 601, 72, 601, 71, 601, 82, 590, 584, 262, 4,
114484 /* 1160 */ 605, 622, 458, 115, 415, 456, 252, 154, 452, 110,
114485 /* 1170 */ 108, 453, 601, 81, 622, 451, 622, 48, 582, 581,
114486 /* 1180 */ 583, 583, 55, 55, 56, 56, 56, 56, 412, 54,
114487 /* 1190 */ 54, 54, 54, 53, 53, 52, 52, 52, 51, 234,
114488 /* 1200 */ 44, 406, 450, 3, 415, 412, 262, 107, 416, 623,
114489 /* 1210 */ 446, 437, 601, 80, 436, 335, 238, 189, 411, 409,
114490 /* 1220 */ 594, 415, 622, 44, 406, 401, 3, 412, 557, 601,
114491 /* 1230 */ 70, 416, 623, 412, 622, 149, 622, 421, 404, 64,
114492 /* 1240 */ 412, 622, 409, 415, 622, 331, 139, 148, 566, 415,
114493 /* 1250 */ 449, 601, 18, 228, 124, 626, 415, 601, 79, 315,
114494 /* 1260 */ 181, 404, 412, 545, 601, 78, 262, 541, 41, 42,
114495 /* 1270 */ 534, 566, 390, 202, 262, 43, 414, 413, 415, 622,
114496 /* 1280 */ 595, 314, 622, 622, 180, 539, 601, 92, 415, 276,
114497 /* 1290 */ 622, 41, 42, 509, 616, 615, 601, 9, 43, 414,
114498 /* 1300 */ 413, 622, 418, 595, 262, 622, 275, 600, 614, 622,
114499 /* 1310 */ 218, 593, 593, 593, 592, 591, 13, 178, 217, 417,
114500 /* 1320 */ 622, 236, 622, 44, 406, 490, 3, 269, 399, 267,
114501 /* 1330 */ 609, 416, 623, 400, 593, 593, 593, 592, 591, 13,
114502 /* 1340 */ 265, 622, 409, 622, 263, 622, 34, 406, 244, 3,
114503 /* 1350 */ 258, 363, 464, 463, 416, 623, 622, 356, 251, 8,
114504 /* 1360 */ 622, 404, 177, 599, 455, 409, 622, 622, 622, 622,
114505 /* 1370 */ 445, 566, 243, 622, 622, 236, 295, 240, 31, 239,
114506 /* 1380 */ 622, 431, 30, 396, 404, 290, 622, 294, 622, 293,
114507 /* 1390 */ 144, 41, 42, 622, 566, 622, 394, 622, 43, 414,
114508 /* 1400 */ 413, 622, 289, 595, 398, 60, 622, 292, 37, 231,
114509 /* 1410 */ 598, 172, 622, 29, 41, 42, 393, 523, 622, 556,
114510 /* 1420 */ 184, 43, 414, 413, 287, 387, 595, 543, 285, 518,
114511 /* 1430 */ 537, 536, 517, 327, 593, 593, 593, 592, 591, 13,
114512 /* 1440 */ 215, 283, 278, 514, 513, 304, 303, 302, 179, 300,
114513 /* 1450 */ 512, 310, 454, 128, 227, 226, 309, 593, 593, 593,
114514 /* 1460 */ 592, 591, 13, 494, 489, 225, 488, 150, 487, 242,
114515 /* 1470 */ 163, 61, 374, 481, 162, 161, 624, 623, 241, 372,
114516 /* 1480 */ 209, 479, 370, 260, 26, 160, 478, 364, 468, 471,
114517 /* 1490 */ 140, 152, 119, 467, 131, 116, 155, 153, 345, 457,
114518 /* 1500 */ 151, 346, 130, 114, 113, 112, 111, 448, 319, 23,
114519 /* 1510 */ 109, 434, 20, 433, 432, 429, 566, 610, 573, 596,
114520 /* 1520 */ 63, 405, 191, 279, 510, 296, 498, 288, 570, 495,
114521 /* 1530 */ 499, 497, 461, 194, 5, 305, 193, 192, 381, 569,
114522 /* 1540 */ 357, 256, 344, 245, 526, 246, 253, 313, 595, 343,
114523 /* 1550 */ 447, 297, 236, 402, 550, 491, 508, 502, 501, 527,
114524 /* 1560 */ 234, 208, 525, 962, 962, 962, 371, 962, 962, 962,
114525 /* 1570 */ 962, 962, 962, 962, 962, 337, 962, 962, 962, 593,
114526 /* 1580 */ 593, 593,
114527 };
114528 static const YYCODETYPE yy_lookahead[] = {
114529 /* 0 */ 19, 143, 144, 145, 146, 24, 7, 8, 27, 78,
114530 /* 10 */ 79, 80, 81, 82, 83, 84, 85, 86, 87, 88,
114531 /* 20 */ 89, 90, 91, 92, 93, 106, 107, 108, 27, 28,
114532 /* 30 */ 15, 50, 51, 78, 79, 80, 81, 26, 83, 84,
114533 /* 40 */ 85, 86, 87, 88, 89, 90, 91, 92, 93, 1,
114534 /* 50 */ 69, 70, 71, 72, 73, 74, 75, 76, 77, 78,
114535 /* 60 */ 79, 80, 81, 11, 83, 84, 85, 86, 87, 88,
114536 /* 70 */ 89, 90, 91, 92, 93, 19, 95, 89, 90, 91,
114537 /* 80 */ 92, 93, 26, 83, 84, 85, 86, 87, 88, 89,
114538 /* 90 */ 90, 91, 92, 93, 27, 28, 95, 96, 97, 27,
114539 /* 100 */ 28, 100, 101, 102, 22, 19, 50, 51, 27, 28,
114540 /* 110 */ 58, 55, 111, 7, 8, 9, 87, 88, 89, 90,
114541 /* 120 */ 91, 92, 93, 98, 99, 69, 70, 71, 72, 73,
114542 /* 130 */ 74, 75, 76, 77, 78, 79, 80, 81, 127, 83,
114543 /* 140 */ 84, 85, 86, 87, 88, 89, 90, 91, 92, 93,
114544 /* 150 */ 19, 223, 224, 225, 87, 88, 162, 31, 106, 107,
114545 /* 160 */ 108, 35, 95, 96, 33, 98, 23, 95, 96, 117,
114546 /* 170 */ 119, 243, 105, 42, 107, 49, 95, 96, 151, 93,
114547 /* 180 */ 26, 50, 51, 97, 98, 99, 100, 101, 102, 103,
114548 /* 190 */ 196, 22, 23, 121, 167, 26, 110, 130, 131, 67,
114549 /* 200 */ 69, 70, 71, 72, 73, 74, 75, 76, 77, 78,
114550 /* 210 */ 79, 80, 81, 219, 83, 84, 85, 86, 87, 88,
114551 /* 220 */ 89, 90, 91, 92, 93, 19, 12, 95, 234, 119,
114552 /* 230 */ 24, 99, 113, 239, 115, 116, 151, 68, 23, 147,
114553 /* 240 */ 148, 26, 215, 29, 151, 153, 119, 155, 163, 164,
114554 /* 250 */ 23, 23, 167, 26, 162, 23, 50, 51, 26, 45,
114555 /* 260 */ 167, 47, 130, 131, 132, 172, 173, 23, 22, 23,
114556 /* 270 */ 26, 186, 26, 188, 120, 69, 70, 71, 72, 73,
114557 /* 280 */ 74, 75, 76, 77, 78, 79, 80, 81, 196, 83,
114558 /* 290 */ 84, 85, 86, 87, 88, 89, 90, 91, 92, 93,
114559 /* 300 */ 19, 151, 151, 23, 119, 97, 26, 19, 100, 101,
114560 /* 310 */ 102, 219, 151, 162, 68, 22, 28, 167, 167, 111,
114561 /* 320 */ 27, 26, 172, 173, 231, 232, 175, 176, 167, 27,
114562 /* 330 */ 28, 50, 51, 27, 28, 119, 175, 176, 246, 24,
114563 /* 340 */ 22, 113, 27, 115, 116, 27, 28, 196, 22, 23,
114564 /* 350 */ 69, 70, 71, 72, 73, 74, 75, 76, 77, 78,
114565 /* 360 */ 79, 80, 81, 114, 83, 84, 85, 86, 87, 88,
114566 /* 370 */ 89, 90, 91, 92, 93, 19, 21, 151, 217, 22,
114567 /* 380 */ 151, 231, 232, 222, 27, 28, 23, 114, 95, 50,
114568 /* 390 */ 51, 118, 151, 167, 68, 89, 167, 95, 96, 104,
114569 /* 400 */ 23, 95, 96, 26, 175, 176, 50, 51, 167, 22,
114570 /* 410 */ 95, 72, 73, 95, 96, 16, 175, 176, 137, 64,
114571 /* 420 */ 23, 195, 27, 121, 23, 69, 70, 71, 72, 73,
114572 /* 430 */ 74, 75, 76, 77, 78, 79, 80, 81, 99, 83,
114573 /* 440 */ 84, 85, 86, 87, 88, 89, 90, 91, 92, 93,
114574 /* 450 */ 19, 12, 95, 96, 23, 226, 101, 22, 217, 19,
114575 /* 460 */ 61, 151, 63, 222, 151, 106, 107, 108, 29, 159,
114576 /* 470 */ 244, 151, 99, 163, 164, 23, 113, 167, 115, 116,
114577 /* 480 */ 167, 50, 51, 110, 45, 58, 47, 167, 175, 176,
114578 /* 490 */ 95, 51, 168, 137, 139, 175, 176, 58, 11, 22,
114579 /* 500 */ 69, 70, 71, 72, 73, 74, 75, 76, 77, 78,
114580 /* 510 */ 79, 80, 81, 22, 83, 84, 85, 86, 87, 88,
114581 /* 520 */ 89, 90, 91, 92, 93, 19, 23, 151, 117, 23,
114582 /* 530 */ 217, 207, 19, 106, 107, 108, 216, 151, 139, 23,
114583 /* 540 */ 129, 28, 26, 167, 117, 105, 23, 223, 224, 225,
114584 /* 550 */ 110, 175, 176, 167, 77, 165, 50, 51, 168, 169,
114585 /* 560 */ 170, 175, 176, 87, 88, 113, 26, 115, 116, 171,
114586 /* 570 */ 172, 173, 0, 1, 2, 69, 70, 71, 72, 73,
114587 /* 580 */ 74, 75, 76, 77, 78, 79, 80, 81, 162, 83,
114588 /* 590 */ 84, 85, 86, 87, 88, 89, 90, 91, 92, 93,
114589 /* 600 */ 19, 151, 98, 217, 23, 37, 130, 131, 23, 23,
114590 /* 610 */ 26, 26, 96, 163, 164, 23, 113, 167, 115, 116,
114591 /* 620 */ 52, 117, 196, 151, 171, 172, 173, 59, 130, 131,
114592 /* 630 */ 232, 50, 51, 129, 208, 209, 16, 121, 156, 167,
114593 /* 640 */ 22, 23, 162, 223, 224, 225, 51, 175, 176, 121,
114594 /* 650 */ 69, 70, 71, 72, 73, 74, 75, 76, 77, 78,
114595 /* 660 */ 79, 80, 81, 178, 83, 84, 85, 86, 87, 88,
114596 /* 670 */ 89, 90, 91, 92, 93, 19, 196, 109, 151, 23,
114597 /* 680 */ 96, 61, 151, 63, 23, 232, 68, 26, 151, 168,
114598 /* 690 */ 169, 170, 23, 89, 167, 26, 208, 209, 167, 219,
114599 /* 700 */ 105, 36, 175, 176, 167, 121, 50, 51, 223, 224,
114600 /* 710 */ 225, 229, 175, 176, 178, 233, 247, 248, 114, 239,
114601 /* 720 */ 189, 22, 118, 24, 162, 69, 70, 71, 72, 73,
114602 /* 730 */ 74, 75, 76, 77, 78, 79, 80, 81, 151, 83,
114603 /* 740 */ 84, 85, 86, 87, 88, 89, 90, 91, 92, 93,
114604 /* 750 */ 19, 151, 26, 151, 167, 24, 145, 146, 196, 223,
114605 /* 760 */ 224, 225, 175, 176, 151, 182, 183, 167, 151, 167,
114606 /* 770 */ 151, 36, 199, 190, 151, 175, 176, 175, 176, 206,
114607 /* 780 */ 167, 50, 51, 221, 167, 136, 167, 138, 175, 176,
114608 /* 790 */ 167, 26, 175, 176, 175, 176, 168, 36, 175, 176,
114609 /* 800 */ 69, 70, 71, 72, 73, 74, 75, 76, 77, 78,
114610 /* 810 */ 79, 80, 81, 151, 83, 84, 85, 86, 87, 88,
114611 /* 820 */ 89, 90, 91, 92, 93, 19, 151, 151, 151, 167,
114612 /* 830 */ 151, 151, 151, 151, 162, 207, 23, 175, 176, 26,
114613 /* 840 */ 249, 250, 167, 167, 167, 151, 167, 167, 167, 167,
114614 /* 850 */ 175, 176, 175, 176, 175, 176, 50, 51, 151, 53,
114615 /* 860 */ 22, 167, 192, 193, 33, 189, 192, 193, 196, 189,
114616 /* 870 */ 189, 189, 162, 42, 167, 69, 70, 71, 72, 73,
114617 /* 880 */ 74, 75, 76, 77, 78, 79, 80, 81, 151, 83,
114618 /* 890 */ 84, 85, 86, 87, 88, 89, 90, 91, 92, 93,
114619 /* 900 */ 19, 151, 195, 151, 167, 151, 196, 162, 151, 215,
114620 /* 910 */ 92, 93, 175, 176, 28, 174, 119, 167, 151, 167,
114621 /* 920 */ 151, 167, 151, 182, 167, 175, 176, 175, 176, 175,
114622 /* 930 */ 176, 50, 51, 23, 167, 23, 167, 40, 167, 22,
114623 /* 940 */ 167, 196, 53, 168, 175, 176, 175, 176, 175, 162,
114624 /* 950 */ 69, 70, 71, 72, 73, 74, 75, 76, 77, 78,
114625 /* 960 */ 79, 80, 81, 151, 83, 84, 85, 86, 87, 88,
114626 /* 970 */ 89, 90, 91, 92, 93, 19, 151, 151, 151, 167,
114627 /* 980 */ 151, 151, 207, 196, 30, 218, 22, 175, 176, 1,
114628 /* 990 */ 2, 53, 167, 167, 167, 151, 167, 167, 151, 151,
114629 /* 1000 */ 175, 176, 175, 176, 175, 176, 50, 51, 221, 23,
114630 /* 1010 */ 53, 167, 22, 22, 167, 167, 103, 168, 22, 110,
114631 /* 1020 */ 19, 105, 175, 176, 20, 69, 70, 71, 72, 73,
114632 /* 1030 */ 74, 75, 76, 77, 78, 79, 80, 81, 151, 83,
114633 /* 1040 */ 84, 85, 86, 87, 88, 89, 90, 91, 92, 93,
114634 /* 1050 */ 19, 151, 151, 151, 167, 151, 207, 24, 44, 215,
114635 /* 1060 */ 60, 26, 175, 176, 54, 54, 240, 167, 167, 167,
114636 /* 1070 */ 240, 167, 151, 151, 151, 175, 176, 175, 176, 175,
114637 /* 1080 */ 176, 50, 51, 139, 151, 22, 105, 119, 167, 167,
114638 /* 1090 */ 167, 5, 1, 36, 28, 77, 175, 176, 175, 176,
114639 /* 1100 */ 167, 70, 71, 72, 73, 74, 75, 76, 77, 78,
114640 /* 1110 */ 79, 80, 81, 151, 83, 84, 85, 86, 87, 88,
114641 /* 1120 */ 89, 90, 91, 92, 93, 19, 151, 151, 151, 167,
114642 /* 1130 */ 151, 151, 109, 151, 128, 77, 22, 175, 176, 26,
114643 /* 1140 */ 218, 240, 167, 167, 167, 151, 167, 167, 151, 167,
114644 /* 1150 */ 175, 176, 175, 176, 175, 176, 50, 51, 151, 22,
114645 /* 1160 */ 151, 167, 23, 120, 167, 1, 16, 122, 20, 120,
114646 /* 1170 */ 109, 195, 175, 176, 167, 195, 167, 71, 72, 73,
114647 /* 1180 */ 74, 75, 76, 77, 78, 79, 80, 81, 151, 83,
114648 /* 1190 */ 84, 85, 86, 87, 88, 89, 90, 91, 92, 93,
114649 /* 1200 */ 19, 20, 195, 22, 167, 151, 151, 128, 27, 28,
114650 /* 1210 */ 129, 23, 175, 176, 23, 66, 141, 22, 151, 38,
114651 /* 1220 */ 151, 167, 167, 19, 20, 151, 22, 151, 151, 175,
114652 /* 1230 */ 176, 27, 28, 151, 167, 15, 167, 4, 57, 16,
114653 /* 1240 */ 151, 167, 38, 167, 167, 3, 166, 248, 67, 167,
114654 /* 1250 */ 195, 175, 176, 181, 181, 150, 167, 175, 176, 251,
114655 /* 1260 */ 6, 57, 151, 151, 175, 176, 151, 151, 87, 88,
114656 /* 1270 */ 89, 67, 151, 162, 151, 94, 95, 96, 167, 167,
114657 /* 1280 */ 99, 251, 167, 167, 152, 151, 175, 176, 167, 151,
114658 /* 1290 */ 167, 87, 88, 151, 150, 150, 175, 176, 94, 95,
114659 /* 1300 */ 96, 167, 150, 99, 151, 167, 151, 196, 13, 167,
114660 /* 1310 */ 195, 130, 131, 132, 133, 134, 135, 152, 195, 160,
114661 /* 1320 */ 167, 117, 167, 19, 20, 151, 22, 151, 217, 151,
114662 /* 1330 */ 161, 27, 28, 222, 130, 131, 132, 133, 134, 135,
114663 /* 1340 */ 151, 167, 38, 167, 151, 167, 19, 20, 195, 22,
114664 /* 1350 */ 151, 151, 151, 151, 27, 28, 167, 151, 151, 26,
114665 /* 1360 */ 167, 57, 25, 196, 151, 38, 167, 167, 167, 167,
114666 /* 1370 */ 151, 67, 151, 167, 167, 117, 201, 151, 125, 151,
114667 /* 1380 */ 167, 151, 127, 124, 57, 151, 167, 202, 167, 203,
114668 /* 1390 */ 151, 87, 88, 167, 67, 167, 151, 167, 94, 95,
114669 /* 1400 */ 96, 167, 151, 99, 123, 126, 167, 204, 136, 227,
114670 /* 1410 */ 205, 119, 167, 105, 87, 88, 122, 177, 167, 158,
114671 /* 1420 */ 158, 94, 95, 96, 212, 105, 99, 213, 212, 177,
114672 /* 1430 */ 213, 213, 185, 48, 130, 131, 132, 133, 134, 135,
114673 /* 1440 */ 5, 212, 177, 179, 104, 10, 11, 12, 13, 14,
114674 /* 1450 */ 177, 180, 17, 22, 230, 93, 180, 130, 131, 132,
114675 /* 1460 */ 133, 134, 135, 185, 177, 230, 177, 32, 177, 34,
114676 /* 1470 */ 157, 22, 18, 158, 157, 157, 27, 28, 43, 158,
114677 /* 1480 */ 158, 158, 46, 237, 136, 157, 238, 158, 191, 201,
114678 /* 1490 */ 69, 56, 191, 58, 220, 22, 157, 62, 18, 201,
114679 /* 1500 */ 65, 158, 220, 194, 194, 194, 194, 201, 158, 242,
114680 /* 1510 */ 191, 41, 242, 158, 158, 39, 67, 154, 232, 168,
114681 /* 1520 */ 245, 228, 198, 178, 183, 200, 168, 211, 232, 168,
114682 /* 1530 */ 178, 178, 201, 187, 198, 149, 87, 88, 179, 168,
114683 /* 1540 */ 241, 106, 107, 108, 95, 211, 241, 112, 99, 211,
114684 /* 1550 */ 201, 197, 117, 193, 210, 188, 184, 184, 184, 175,
114685 /* 1560 */ 93, 235, 175, 252, 252, 252, 236, 252, 252, 252,
114686 /* 1570 */ 252, 252, 252, 252, 252, 140, 252, 252, 252, 130,
114687 /* 1580 */ 131, 132,
114688 };
114689 #define YY_SHIFT_USE_DFLT (-82)
114690 #define YY_SHIFT_COUNT (419)
114691 #define YY_SHIFT_MIN (-81)
114692 #define YY_SHIFT_MAX (1480)
114693 static const short yy_shift_ofst[] = {
114694 /* 0 */ 988, 1204, 1435, 1204, 1304, 1304, 67, 67, 1, -19,
114695 /* 10 */ 1304, 1304, 1304, 1304, 427, 81, 131, 131, 806, 1181,
114696 /* 20 */ 1304, 1304, 1304, 1304, 1304, 1304, 1304, 1304, 1304, 1304,
114697 /* 30 */ 1304, 1304, 1304, 1304, 1304, 1304, 1304, 1304, 1304, 1304,
114698 /* 40 */ 1304, 1304, 1304, 1304, 1304, 1304, 1304, 1304, 1327, 1304,
114699 /* 50 */ 1304, 1304, 1304, 1304, 1304, 1304, 1304, 1304, 1304, 1304,
114700 /* 60 */ 1304, 1304, 52, 81, 81, 476, 476, 395, 1258, 56,
114701 /* 70 */ 731, 656, 581, 506, 431, 356, 281, 206, 881, 881,
114702 /* 80 */ 881, 881, 881, 881, 881, 881, 881, 881, 881, 881,
114703 /* 90 */ 881, 881, 881, 956, 881, 1031, 1106, 1106, -69, -45,
114704 /* 100 */ -45, -45, -45, -45, 0, 29, -12, 81, 81, 81,
114705 /* 110 */ 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
114706 /* 120 */ 81, 81, 81, 355, 440, 81, 81, 81, 81, 81,
114707 /* 130 */ 504, 411, 395, 818, 1467, -82, -82, -82, 1449, 86,
114708 /* 140 */ 439, 439, 306, 357, 302, 72, 318, 246, 169, 81,
114709 /* 150 */ 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
114710 /* 160 */ 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
114711 /* 170 */ 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
114712 /* 180 */ 81, 81, 315, 315, 315, 572, 1258, 1258, 1258, -82,
114713 /* 190 */ -82, -82, 132, 132, 208, 568, 568, 568, 516, 503,
114714 /* 200 */ 214, 452, 363, 228, 119, 119, 119, 119, 359, 126,
114715 /* 210 */ 119, 119, 584, 293, 604, 106, 11, 288, 288, 513,
114716 /* 220 */ 11, 513, 295, 813, 395, 831, 395, 831, 595, 831,
114717 /* 230 */ 288, 649, 498, 498, 395, 154, 273, 699, 1476, 1292,
114718 /* 240 */ 1292, 1470, 1470, 1292, 1473, 1421, 1255, 1480, 1480, 1480,
114719 /* 250 */ 1480, 1292, 1454, 1255, 1473, 1421, 1421, 1255, 1292, 1454,
114720 /* 260 */ 1348, 1436, 1292, 1292, 1454, 1292, 1454, 1292, 1454, 1431,
114721 /* 270 */ 1320, 1320, 1320, 1385, 1362, 1362, 1431, 1320, 1340, 1320,
114722 /* 280 */ 1385, 1320, 1320, 1294, 1308, 1294, 1308, 1294, 1308, 1292,
114723 /* 290 */ 1292, 1272, 1279, 1281, 1253, 1259, 1255, 1258, 1337, 1333,
114724 /* 300 */ 1295, 1295, 1254, 1254, 1254, 1254, -82, -82, -82, -82,
114725 /* 310 */ -82, -82, 339, 399, 618, 326, 620, -81, 669, 477,
114726 /* 320 */ 661, 585, 377, 280, 244, 232, 25, -1, 373, 227,
114727 /* 330 */ 215, 1233, 1242, 1195, 1075, 1220, 1149, 1223, 1191, 1188,
114728 /* 340 */ 1081, 1113, 1079, 1061, 1049, 1148, 1045, 1150, 1164, 1043,
114729 /* 350 */ 1139, 1137, 1113, 1114, 1006, 1058, 1018, 1023, 1066, 1057,
114730 /* 360 */ 968, 1091, 1086, 1063, 981, 944, 1011, 1035, 1010, 1000,
114731 /* 370 */ 1014, 916, 1033, 1004, 1001, 909, 913, 996, 957, 991,
114732 /* 380 */ 990, 986, 964, 938, 954, 917, 889, 897, 912, 910,
114733 /* 390 */ 797, 886, 761, 838, 528, 726, 735, 765, 665, 726,
114734 /* 400 */ 592, 586, 540, 523, 491, 487, 435, 401, 397, 387,
114735 /* 410 */ 249, 216, 185, 127, 110, 51, 82, 143, 15, 48,
 
114736 };
114737 #define YY_REDUCE_USE_DFLT (-143)
114738 #define YY_REDUCE_COUNT (311)
114739 #define YY_REDUCE_MIN (-142)
114740 #define YY_REDUCE_MAX (1387)
114741 static const short yy_reduce_ofst[] = {
114742 /* 0 */ -142, 1111, 92, 151, 241, 161, 150, 93, 85, 324,
114743 /* 10 */ 386, 313, 320, 229, -6, 310, 536, 485, -72, 1121,
114744 /* 20 */ 1089, 1082, 1076, 1054, 1037, 997, 979, 977, 975, 962,
114745 /* 30 */ 923, 921, 904, 902, 900, 887, 847, 829, 827, 825,
114746 /* 40 */ 812, 771, 769, 754, 752, 750, 737, 679, 677, 675,
114747 /* 50 */ 662, 623, 619, 617, 613, 602, 600, 587, 537, 527,
114748 /* 60 */ 472, 376, 480, 450, 226, 453, 398, 390, 426, 420,
114749 /* 70 */ 420, 420, 420, 420, 420, 420, 420, 420, 420, 420,
114750 /* 80 */ 420, 420, 420, 420, 420, 420, 420, 420, 420, 420,
114751 /* 90 */ 420, 420, 420, 420, 420, 420, 420, 420, 420, 420,
114752 /* 100 */ 420, 420, 420, 420, 420, 420, 420, 1153, 922, 1123,
114753 /* 110 */ 1115, 1055, 1007, 980, 976, 901, 844, 830, 767, 826,
114754 /* 120 */ 682, 694, 707, 482, 583, 681, 680, 676, 531, 27,
114755 /* 130 */ 787, 562, 521, 420, 420, 420, 420, 420, 773, 741,
114756 /* 140 */ 674, 670, 1067, 1251, 1245, 1239, 1234, 591, 591, 1230,
114757 /* 150 */ 1228, 1226, 1221, 1219, 1213, 1207, 1206, 1202, 1201, 1200,
114758 /* 160 */ 1199, 1193, 1189, 1178, 1176, 1174, 1155, 1142, 1138, 1134,
114759 /* 170 */ 1116, 1112, 1077, 1074, 1069, 1067, 1009, 994, 982, 933,
114760 /* 180 */ 848, 757, 849, 775, 628, 611, 745, 710, 672, 469,
114761 /* 190 */ 488, 573, 1387, 1384, 1367, 1374, 1373, 1372, 1344, 1354,
114762 /* 200 */ 1360, 1354, 1354, 1354, 1354, 1354, 1354, 1354, 1330, 1326,
114763 /* 210 */ 1354, 1354, 1344, 1371, 1336, 1386, 1349, 1338, 1334, 1305,
114764 /* 220 */ 1331, 1299, 1359, 1346, 1361, 1353, 1358, 1352, 1341, 1345,
114765 /* 230 */ 1316, 1293, 1296, 1286, 1351, 1325, 1324, 1363, 1275, 1356,
114766 /* 240 */ 1355, 1270, 1267, 1350, 1282, 1319, 1306, 1312, 1311, 1310,
114767 /* 250 */ 1309, 1343, 1339, 1298, 1274, 1301, 1297, 1288, 1329, 1328,
114768 /* 260 */ 1248, 1246, 1323, 1322, 1318, 1321, 1317, 1315, 1313, 1276,
114769 /* 270 */ 1291, 1289, 1287, 1278, 1235, 1224, 1271, 1273, 1264, 1265,
114770 /* 280 */ 1247, 1252, 1240, 1218, 1229, 1217, 1216, 1214, 1212, 1262,
114771 /* 290 */ 1261, 1182, 1205, 1203, 1186, 1185, 1175, 1167, 1169, 1159,
114772 /* 300 */ 1165, 1132, 1152, 1145, 1144, 1105, 1030, 1008, 999, 1073,
114773 /* 310 */ 1072, 1080,
114774 };
114775 static const YYACTIONTYPE yy_default[] = {
114776 /* 0 */ 636, 872, 960, 960, 872, 872, 960, 960, 960, 762,
114777 /* 10 */ 960, 960, 960, 870, 960, 960, 790, 790, 934, 960,
114778 /* 20 */ 960, 960, 960, 960, 960, 960, 960, 960, 960, 960,
114779 /* 30 */ 960, 960, 960, 960, 960, 960, 960, 960, 960, 960,
114780 /* 40 */ 960, 960, 960, 960, 960, 960, 960, 960, 960, 960,
114781 /* 50 */ 960, 960, 960, 960, 960, 960, 960, 960, 960, 960,
114782 /* 60 */ 960, 960, 960, 960, 960, 960, 960, 677, 766, 796,
114783 /* 70 */ 960, 960, 960, 960, 960, 960, 960, 960, 933, 935,
114784 /* 80 */ 804, 803, 913, 777, 801, 794, 798, 873, 866, 867,
114785 /* 90 */ 865, 869, 874, 960, 797, 833, 850, 832, 844, 849,
114786 /* 100 */ 856, 848, 845, 835, 834, 836, 837, 960, 960, 960,
114787 /* 110 */ 960, 960, 960, 960, 960, 960, 960, 960, 960, 960,
114788 /* 120 */ 960, 960, 960, 662, 731, 960, 960, 960, 960, 960,
114789 /* 130 */ 960, 960, 960, 838, 839, 853, 852, 851, 960, 669,
114790 /* 140 */ 960, 960, 960, 960, 960, 960, 960, 960, 960, 960,
114791 /* 150 */ 940, 938, 960, 885, 960, 960, 960, 960, 960, 960,
114792 /* 160 */ 960, 960, 960, 960, 960, 960, 960, 960, 960, 960,
114793 /* 170 */ 960, 960, 960, 960, 960, 960, 960, 960, 960, 960,
114794 /* 180 */ 960, 642, 762, 762, 762, 636, 960, 960, 960, 952,
114795 /* 190 */ 766, 756, 960, 960, 960, 960, 960, 960, 960, 960,
114796 /* 200 */ 960, 960, 960, 960, 806, 745, 923, 925, 960, 906,
114797 /* 210 */ 743, 664, 764, 679, 754, 644, 800, 779, 779, 918,
114798 /* 220 */ 800, 918, 702, 725, 960, 790, 960, 790, 699, 790,
114799 /* 230 */ 779, 868, 960, 960, 960, 763, 754, 960, 945, 770,
114800 /* 240 */ 770, 937, 937, 770, 812, 735, 800, 742, 742, 742,
114801 /* 250 */ 742, 770, 659, 800, 812, 735, 735, 800, 770, 659,
114802 /* 260 */ 912, 910, 770, 770, 659, 770, 659, 770, 659, 878,
114803 /* 270 */ 733, 733, 733, 717, 882, 882, 878, 733, 702, 733,
114804 /* 280 */ 717, 733, 733, 783, 778, 783, 778, 783, 778, 770,
114805 /* 290 */ 770, 960, 795, 784, 793, 791, 800, 960, 665, 720,
114806 /* 300 */ 652, 652, 641, 641, 641, 641, 957, 957, 952, 704,
114807 /* 310 */ 704, 687, 960, 960, 960, 960, 960, 960, 960, 887,
114808 /* 320 */ 960, 960, 960, 960, 960, 960, 960, 960, 960, 960,
114809 /* 330 */ 960, 960, 637, 947, 960, 960, 944, 960, 960, 960,
114810 /* 340 */ 960, 805, 960, 960, 960, 960, 960, 960, 960, 960,
114811 /* 350 */ 960, 960, 922, 960, 960, 960, 960, 960, 960, 960,
114812 /* 360 */ 916, 960, 960, 960, 960, 960, 960, 909, 908, 960,
114813 /* 370 */ 960, 960, 960, 960, 960, 960, 960, 960, 960, 960,
114814 /* 380 */ 960, 960, 960, 960, 960, 960, 960, 960, 960, 960,
114815 /* 390 */ 960, 960, 960, 960, 960, 792, 960, 785, 960, 871,
114816 /* 400 */ 960, 960, 960, 960, 960, 960, 960, 960, 960, 960,
114817 /* 410 */ 748, 821, 960, 820, 824, 819, 671, 960, 650, 960,
114818 /* 420 */ 633, 638, 956, 959, 958, 955, 954, 953, 948, 946,
114819 /* 430 */ 943, 942, 941, 939, 936, 932, 891, 889, 896, 895,
114820 /* 440 */ 894, 893, 892, 890, 888, 886, 807, 802, 799, 931,
114821 /* 450 */ 884, 744, 741, 740, 658, 949, 915, 924, 811, 810,
114822 /* 460 */ 813, 921, 920, 919, 917, 914, 901, 809, 808, 736,
114823 /* 470 */ 876, 875, 661, 905, 904, 903, 907, 911, 902, 772,
114824 /* 480 */ 660, 657, 668, 723, 724, 732, 730, 729, 728, 727,
114825 /* 490 */ 726, 722, 670, 678, 716, 701, 700, 881, 883, 880,
114826 /* 500 */ 879, 709, 708, 714, 713, 712, 711, 710, 707, 706,
114827 /* 510 */ 705, 698, 697, 703, 696, 719, 718, 715, 695, 739,
114828 /* 520 */ 738, 737, 734, 694, 693, 692, 824, 691, 690, 830,
114829 /* 530 */ 829, 817, 860, 759, 758, 757, 769, 768, 781, 780,
114830 /* 540 */ 815, 814, 782, 767, 761, 760, 776, 775, 774, 773,
114831 /* 550 */ 765, 755, 787, 789, 788, 786, 862, 771, 859, 930,
114832 /* 560 */ 929, 928, 927, 926, 864, 863, 831, 828, 682, 683,
114833 /* 570 */ 899, 898, 900, 897, 685, 684, 681, 680, 861, 750,
114834 /* 580 */ 749, 857, 854, 846, 842, 858, 855, 847, 843, 841,
114835 /* 590 */ 840, 826, 825, 823, 822, 818, 827, 673, 751, 747,
114836 /* 600 */ 746, 816, 753, 752, 689, 688, 686, 667, 666, 663,
114837 /* 610 */ 656, 654, 653, 655, 651, 649, 648, 647, 646, 645,
114838 /* 620 */ 676, 675, 674, 672, 671, 643, 640, 639, 635, 634,
114839 /* 630 */ 632,
 
114840 };
114841
114842 /* The next table maps tokens into fallback tokens. If a construct
114843 ** like the following:
114844 **
@@ -114907,17 +115401,19 @@
114907 27, /* KEY => ID */
114908 27, /* OF => ID */
114909 27, /* OFFSET => ID */
114910 27, /* PRAGMA => ID */
114911 27, /* RAISE => ID */
 
114912 27, /* REPLACE => ID */
114913 27, /* RESTRICT => ID */
114914 27, /* ROW => ID */
114915 27, /* TRIGGER => ID */
114916 27, /* VACUUM => ID */
114917 27, /* VIEW => ID */
114918 27, /* VIRTUAL => ID */
 
114919 27, /* REINDEX => ID */
114920 27, /* RENAME => ID */
114921 27, /* CTIME_KW => ID */
114922 };
114923 #endif /* YYFALLBACK */
@@ -115009,59 +115505,60 @@
115009 "BY", "CASCADE", "CAST", "COLUMNKW",
115010 "CONFLICT", "DATABASE", "DESC", "DETACH",
115011 "EACH", "FAIL", "FOR", "IGNORE",
115012 "INITIALLY", "INSTEAD", "LIKE_KW", "MATCH",
115013 "NO", "KEY", "OF", "OFFSET",
115014 "PRAGMA", "RAISE", "REPLACE", "RESTRICT",
115015 "ROW", "TRIGGER", "VACUUM", "VIEW",
115016 "VIRTUAL", "REINDEX", "RENAME", "CTIME_KW",
115017 "ANY", "OR", "AND", "IS",
115018 "BETWEEN", "IN", "ISNULL", "NOTNULL",
115019 "NE", "EQ", "GT", "LE",
115020 "LT", "GE", "ESCAPE", "BITAND",
115021 "BITOR", "LSHIFT", "RSHIFT", "PLUS",
115022 "MINUS", "STAR", "SLASH", "REM",
115023 "CONCAT", "COLLATE", "BITNOT", "STRING",
115024 "JOIN_KW", "CONSTRAINT", "DEFAULT", "NULL",
115025 "PRIMARY", "UNIQUE", "CHECK", "REFERENCES",
115026 "AUTOINCR", "ON", "INSERT", "DELETE",
115027 "UPDATE", "SET", "DEFERRABLE", "FOREIGN",
115028 "DROP", "UNION", "ALL", "EXCEPT",
115029 "INTERSECT", "SELECT", "DISTINCT", "DOT",
115030 "FROM", "JOIN", "USING", "ORDER",
115031 "GROUP", "HAVING", "LIMIT", "WHERE",
115032 "INTO", "VALUES", "INTEGER", "FLOAT",
115033 "BLOB", "REGISTER", "VARIABLE", "CASE",
115034 "WHEN", "THEN", "ELSE", "INDEX",
115035 "ALTER", "ADD", "error", "input",
115036 "cmdlist", "ecmd", "explain", "cmdx",
115037 "cmd", "transtype", "trans_opt", "nm",
115038 "savepoint_opt", "create_table", "create_table_args", "createkw",
115039 "temp", "ifnotexists", "dbnm", "columnlist",
115040 "conslist_opt", "table_options", "select", "column",
115041 "columnid", "type", "carglist", "id",
115042 "ids", "typetoken", "typename", "signed",
115043 "plus_num", "minus_num", "ccons", "term",
115044 "expr", "onconf", "sortorder", "autoinc",
115045 "idxlist_opt", "refargs", "defer_subclause", "refarg",
115046 "refact", "init_deferred_pred_opt", "conslist", "tconscomma",
115047 "tcons", "idxlist", "defer_subclause_opt", "orconf",
115048 "resolvetype", "raisetype", "ifexists", "fullname",
115049 "oneselect", "multiselect_op", "distinct", "selcollist",
115050 "from", "where_opt", "groupby_opt", "having_opt",
115051 "orderby_opt", "limit_opt", "sclp", "as",
 
115052 "seltablist", "stl_prefix", "joinop", "indexed_opt",
115053 "on_opt", "using_opt", "joinop2", "idlist",
115054 "sortlist", "nexprlist", "setlist", "insert_cmd",
115055 "inscollist_opt", "valuelist", "exprlist", "likeop",
115056 "between_op", "in_op", "case_operand", "case_exprlist",
115057 "case_else", "uniqueflag", "collate", "nmnum",
115058 "number", "trigger_decl", "trigger_cmd_list", "trigger_time",
115059 "trigger_event", "foreach_clause", "when_clause", "trigger_cmd",
115060 "trnm", "tridxby", "database_kw_opt", "key_opt",
115061 "add_column_fullname", "kwcolumn_opt", "create_vtab", "vtabarglist",
115062 "vtabarg", "vtabargtoken", "lp", "anylist",
 
115063 };
115064 #endif /* NDEBUG */
115065
115066 #ifndef NDEBUG
115067 /* For tracing reduce actions, the names of all rules are required.
@@ -115105,299 +115602,297 @@
115105 /* 35 */ "table_options ::= WITHOUT nm",
115106 /* 36 */ "columnlist ::= columnlist COMMA column",
115107 /* 37 */ "columnlist ::= column",
115108 /* 38 */ "column ::= columnid type carglist",
115109 /* 39 */ "columnid ::= nm",
115110 /* 40 */ "id ::= ID",
115111 /* 41 */ "id ::= INDEXED",
115112 /* 42 */ "ids ::= ID|STRING",
115113 /* 43 */ "nm ::= id",
115114 /* 44 */ "nm ::= STRING",
115115 /* 45 */ "nm ::= JOIN_KW",
115116 /* 46 */ "type ::=",
115117 /* 47 */ "type ::= typetoken",
115118 /* 48 */ "typetoken ::= typename",
115119 /* 49 */ "typetoken ::= typename LP signed RP",
115120 /* 50 */ "typetoken ::= typename LP signed COMMA signed RP",
115121 /* 51 */ "typename ::= ids",
115122 /* 52 */ "typename ::= typename ids",
115123 /* 53 */ "signed ::= plus_num",
115124 /* 54 */ "signed ::= minus_num",
115125 /* 55 */ "carglist ::= carglist ccons",
115126 /* 56 */ "carglist ::=",
115127 /* 57 */ "ccons ::= CONSTRAINT nm",
115128 /* 58 */ "ccons ::= DEFAULT term",
115129 /* 59 */ "ccons ::= DEFAULT LP expr RP",
115130 /* 60 */ "ccons ::= DEFAULT PLUS term",
115131 /* 61 */ "ccons ::= DEFAULT MINUS term",
115132 /* 62 */ "ccons ::= DEFAULT id",
115133 /* 63 */ "ccons ::= NULL onconf",
115134 /* 64 */ "ccons ::= NOT NULL onconf",
115135 /* 65 */ "ccons ::= PRIMARY KEY sortorder onconf autoinc",
115136 /* 66 */ "ccons ::= UNIQUE onconf",
115137 /* 67 */ "ccons ::= CHECK LP expr RP",
115138 /* 68 */ "ccons ::= REFERENCES nm idxlist_opt refargs",
115139 /* 69 */ "ccons ::= defer_subclause",
115140 /* 70 */ "ccons ::= COLLATE ids",
115141 /* 71 */ "autoinc ::=",
115142 /* 72 */ "autoinc ::= AUTOINCR",
115143 /* 73 */ "refargs ::=",
115144 /* 74 */ "refargs ::= refargs refarg",
115145 /* 75 */ "refarg ::= MATCH nm",
115146 /* 76 */ "refarg ::= ON INSERT refact",
115147 /* 77 */ "refarg ::= ON DELETE refact",
115148 /* 78 */ "refarg ::= ON UPDATE refact",
115149 /* 79 */ "refact ::= SET NULL",
115150 /* 80 */ "refact ::= SET DEFAULT",
115151 /* 81 */ "refact ::= CASCADE",
115152 /* 82 */ "refact ::= RESTRICT",
115153 /* 83 */ "refact ::= NO ACTION",
115154 /* 84 */ "defer_subclause ::= NOT DEFERRABLE init_deferred_pred_opt",
115155 /* 85 */ "defer_subclause ::= DEFERRABLE init_deferred_pred_opt",
115156 /* 86 */ "init_deferred_pred_opt ::=",
115157 /* 87 */ "init_deferred_pred_opt ::= INITIALLY DEFERRED",
115158 /* 88 */ "init_deferred_pred_opt ::= INITIALLY IMMEDIATE",
115159 /* 89 */ "conslist_opt ::=",
115160 /* 90 */ "conslist_opt ::= COMMA conslist",
115161 /* 91 */ "conslist ::= conslist tconscomma tcons",
115162 /* 92 */ "conslist ::= tcons",
115163 /* 93 */ "tconscomma ::= COMMA",
115164 /* 94 */ "tconscomma ::=",
115165 /* 95 */ "tcons ::= CONSTRAINT nm",
115166 /* 96 */ "tcons ::= PRIMARY KEY LP idxlist autoinc RP onconf",
115167 /* 97 */ "tcons ::= UNIQUE LP idxlist RP onconf",
115168 /* 98 */ "tcons ::= CHECK LP expr RP onconf",
115169 /* 99 */ "tcons ::= FOREIGN KEY LP idxlist RP REFERENCES nm idxlist_opt refargs defer_subclause_opt",
115170 /* 100 */ "defer_subclause_opt ::=",
115171 /* 101 */ "defer_subclause_opt ::= defer_subclause",
115172 /* 102 */ "onconf ::=",
115173 /* 103 */ "onconf ::= ON CONFLICT resolvetype",
115174 /* 104 */ "orconf ::=",
115175 /* 105 */ "orconf ::= OR resolvetype",
115176 /* 106 */ "resolvetype ::= raisetype",
115177 /* 107 */ "resolvetype ::= IGNORE",
115178 /* 108 */ "resolvetype ::= REPLACE",
115179 /* 109 */ "cmd ::= DROP TABLE ifexists fullname",
115180 /* 110 */ "ifexists ::= IF EXISTS",
115181 /* 111 */ "ifexists ::=",
115182 /* 112 */ "cmd ::= createkw temp VIEW ifnotexists nm dbnm AS select",
115183 /* 113 */ "cmd ::= DROP VIEW ifexists fullname",
115184 /* 114 */ "cmd ::= select",
115185 /* 115 */ "select ::= oneselect",
115186 /* 116 */ "select ::= select multiselect_op oneselect",
115187 /* 117 */ "multiselect_op ::= UNION",
115188 /* 118 */ "multiselect_op ::= UNION ALL",
115189 /* 119 */ "multiselect_op ::= EXCEPT|INTERSECT",
115190 /* 120 */ "oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt orderby_opt limit_opt",
115191 /* 121 */ "distinct ::= DISTINCT",
115192 /* 122 */ "distinct ::= ALL",
115193 /* 123 */ "distinct ::=",
115194 /* 124 */ "sclp ::= selcollist COMMA",
115195 /* 125 */ "sclp ::=",
115196 /* 126 */ "selcollist ::= sclp expr as",
115197 /* 127 */ "selcollist ::= sclp STAR",
115198 /* 128 */ "selcollist ::= sclp nm DOT STAR",
115199 /* 129 */ "as ::= AS nm",
115200 /* 130 */ "as ::= ids",
115201 /* 131 */ "as ::=",
115202 /* 132 */ "from ::=",
115203 /* 133 */ "from ::= FROM seltablist",
115204 /* 134 */ "stl_prefix ::= seltablist joinop",
115205 /* 135 */ "stl_prefix ::=",
115206 /* 136 */ "seltablist ::= stl_prefix nm dbnm as indexed_opt on_opt using_opt",
115207 /* 137 */ "seltablist ::= stl_prefix LP select RP as on_opt using_opt",
115208 /* 138 */ "seltablist ::= stl_prefix LP seltablist RP as on_opt using_opt",
115209 /* 139 */ "dbnm ::=",
115210 /* 140 */ "dbnm ::= DOT nm",
115211 /* 141 */ "fullname ::= nm dbnm",
115212 /* 142 */ "joinop ::= COMMA|JOIN",
115213 /* 143 */ "joinop ::= JOIN_KW JOIN",
115214 /* 144 */ "joinop ::= JOIN_KW nm JOIN",
115215 /* 145 */ "joinop ::= JOIN_KW nm nm JOIN",
115216 /* 146 */ "on_opt ::= ON expr",
115217 /* 147 */ "on_opt ::=",
115218 /* 148 */ "indexed_opt ::=",
115219 /* 149 */ "indexed_opt ::= INDEXED BY nm",
115220 /* 150 */ "indexed_opt ::= NOT INDEXED",
115221 /* 151 */ "using_opt ::= USING LP idlist RP",
115222 /* 152 */ "using_opt ::=",
115223 /* 153 */ "orderby_opt ::=",
115224 /* 154 */ "orderby_opt ::= ORDER BY sortlist",
115225 /* 155 */ "sortlist ::= sortlist COMMA expr sortorder",
115226 /* 156 */ "sortlist ::= expr sortorder",
115227 /* 157 */ "sortorder ::= ASC",
115228 /* 158 */ "sortorder ::= DESC",
115229 /* 159 */ "sortorder ::=",
115230 /* 160 */ "groupby_opt ::=",
115231 /* 161 */ "groupby_opt ::= GROUP BY nexprlist",
115232 /* 162 */ "having_opt ::=",
115233 /* 163 */ "having_opt ::= HAVING expr",
115234 /* 164 */ "limit_opt ::=",
115235 /* 165 */ "limit_opt ::= LIMIT expr",
115236 /* 166 */ "limit_opt ::= LIMIT expr OFFSET expr",
115237 /* 167 */ "limit_opt ::= LIMIT expr COMMA expr",
115238 /* 168 */ "cmd ::= DELETE FROM fullname indexed_opt where_opt",
115239 /* 169 */ "where_opt ::=",
115240 /* 170 */ "where_opt ::= WHERE expr",
115241 /* 171 */ "cmd ::= UPDATE orconf fullname indexed_opt SET setlist where_opt",
115242 /* 172 */ "setlist ::= setlist COMMA nm EQ expr",
115243 /* 173 */ "setlist ::= nm EQ expr",
115244 /* 174 */ "cmd ::= insert_cmd INTO fullname inscollist_opt valuelist",
115245 /* 175 */ "cmd ::= insert_cmd INTO fullname inscollist_opt select",
115246 /* 176 */ "cmd ::= insert_cmd INTO fullname inscollist_opt DEFAULT VALUES",
115247 /* 177 */ "insert_cmd ::= INSERT orconf",
115248 /* 178 */ "insert_cmd ::= REPLACE",
115249 /* 179 */ "valuelist ::= VALUES LP nexprlist RP",
115250 /* 180 */ "valuelist ::= valuelist COMMA LP exprlist RP",
115251 /* 181 */ "inscollist_opt ::=",
115252 /* 182 */ "inscollist_opt ::= LP idlist RP",
115253 /* 183 */ "idlist ::= idlist COMMA nm",
115254 /* 184 */ "idlist ::= nm",
115255 /* 185 */ "expr ::= term",
115256 /* 186 */ "expr ::= LP expr RP",
115257 /* 187 */ "term ::= NULL",
115258 /* 188 */ "expr ::= id",
115259 /* 189 */ "expr ::= JOIN_KW",
115260 /* 190 */ "expr ::= nm DOT nm",
115261 /* 191 */ "expr ::= nm DOT nm DOT nm",
115262 /* 192 */ "term ::= INTEGER|FLOAT|BLOB",
115263 /* 193 */ "term ::= STRING",
115264 /* 194 */ "expr ::= REGISTER",
115265 /* 195 */ "expr ::= VARIABLE",
115266 /* 196 */ "expr ::= expr COLLATE ids",
115267 /* 197 */ "expr ::= CAST LP expr AS typetoken RP",
115268 /* 198 */ "expr ::= ID LP distinct exprlist RP",
115269 /* 199 */ "expr ::= ID LP STAR RP",
115270 /* 200 */ "term ::= CTIME_KW",
115271 /* 201 */ "expr ::= expr AND expr",
115272 /* 202 */ "expr ::= expr OR expr",
115273 /* 203 */ "expr ::= expr LT|GT|GE|LE expr",
115274 /* 204 */ "expr ::= expr EQ|NE expr",
115275 /* 205 */ "expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr",
115276 /* 206 */ "expr ::= expr PLUS|MINUS expr",
115277 /* 207 */ "expr ::= expr STAR|SLASH|REM expr",
115278 /* 208 */ "expr ::= expr CONCAT expr",
115279 /* 209 */ "likeop ::= LIKE_KW",
115280 /* 210 */ "likeop ::= NOT LIKE_KW",
115281 /* 211 */ "likeop ::= MATCH",
115282 /* 212 */ "likeop ::= NOT MATCH",
115283 /* 213 */ "expr ::= expr likeop expr",
115284 /* 214 */ "expr ::= expr likeop expr ESCAPE expr",
115285 /* 215 */ "expr ::= expr ISNULL|NOTNULL",
115286 /* 216 */ "expr ::= expr NOT NULL",
115287 /* 217 */ "expr ::= expr IS expr",
115288 /* 218 */ "expr ::= expr IS NOT expr",
115289 /* 219 */ "expr ::= NOT expr",
115290 /* 220 */ "expr ::= BITNOT expr",
115291 /* 221 */ "expr ::= MINUS expr",
115292 /* 222 */ "expr ::= PLUS expr",
115293 /* 223 */ "between_op ::= BETWEEN",
115294 /* 224 */ "between_op ::= NOT BETWEEN",
115295 /* 225 */ "expr ::= expr between_op expr AND expr",
115296 /* 226 */ "in_op ::= IN",
115297 /* 227 */ "in_op ::= NOT IN",
115298 /* 228 */ "expr ::= expr in_op LP exprlist RP",
115299 /* 229 */ "expr ::= LP select RP",
115300 /* 230 */ "expr ::= expr in_op LP select RP",
115301 /* 231 */ "expr ::= expr in_op nm dbnm",
115302 /* 232 */ "expr ::= EXISTS LP select RP",
115303 /* 233 */ "expr ::= CASE case_operand case_exprlist case_else END",
115304 /* 234 */ "case_exprlist ::= case_exprlist WHEN expr THEN expr",
115305 /* 235 */ "case_exprlist ::= WHEN expr THEN expr",
115306 /* 236 */ "case_else ::= ELSE expr",
115307 /* 237 */ "case_else ::=",
115308 /* 238 */ "case_operand ::= expr",
115309 /* 239 */ "case_operand ::=",
115310 /* 240 */ "exprlist ::= nexprlist",
115311 /* 241 */ "exprlist ::=",
115312 /* 242 */ "nexprlist ::= nexprlist COMMA expr",
115313 /* 243 */ "nexprlist ::= expr",
115314 /* 244 */ "cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP idxlist RP where_opt",
115315 /* 245 */ "uniqueflag ::= UNIQUE",
115316 /* 246 */ "uniqueflag ::=",
115317 /* 247 */ "idxlist_opt ::=",
115318 /* 248 */ "idxlist_opt ::= LP idxlist RP",
115319 /* 249 */ "idxlist ::= idxlist COMMA nm collate sortorder",
115320 /* 250 */ "idxlist ::= nm collate sortorder",
115321 /* 251 */ "collate ::=",
115322 /* 252 */ "collate ::= COLLATE ids",
115323 /* 253 */ "cmd ::= DROP INDEX ifexists fullname",
115324 /* 254 */ "cmd ::= VACUUM",
115325 /* 255 */ "cmd ::= VACUUM nm",
115326 /* 256 */ "cmd ::= PRAGMA nm dbnm",
115327 /* 257 */ "cmd ::= PRAGMA nm dbnm EQ nmnum",
115328 /* 258 */ "cmd ::= PRAGMA nm dbnm LP nmnum RP",
115329 /* 259 */ "cmd ::= PRAGMA nm dbnm EQ minus_num",
115330 /* 260 */ "cmd ::= PRAGMA nm dbnm LP minus_num RP",
115331 /* 261 */ "nmnum ::= plus_num",
115332 /* 262 */ "nmnum ::= nm",
115333 /* 263 */ "nmnum ::= ON",
115334 /* 264 */ "nmnum ::= DELETE",
115335 /* 265 */ "nmnum ::= DEFAULT",
115336 /* 266 */ "plus_num ::= PLUS number",
115337 /* 267 */ "plus_num ::= number",
115338 /* 268 */ "minus_num ::= MINUS number",
115339 /* 269 */ "number ::= INTEGER|FLOAT",
115340 /* 270 */ "cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END",
115341 /* 271 */ "trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause",
115342 /* 272 */ "trigger_time ::= BEFORE",
115343 /* 273 */ "trigger_time ::= AFTER",
115344 /* 274 */ "trigger_time ::= INSTEAD OF",
115345 /* 275 */ "trigger_time ::=",
115346 /* 276 */ "trigger_event ::= DELETE|INSERT",
115347 /* 277 */ "trigger_event ::= UPDATE",
115348 /* 278 */ "trigger_event ::= UPDATE OF idlist",
115349 /* 279 */ "foreach_clause ::=",
115350 /* 280 */ "foreach_clause ::= FOR EACH ROW",
115351 /* 281 */ "when_clause ::=",
115352 /* 282 */ "when_clause ::= WHEN expr",
115353 /* 283 */ "trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI",
115354 /* 284 */ "trigger_cmd_list ::= trigger_cmd SEMI",
115355 /* 285 */ "trnm ::= nm",
115356 /* 286 */ "trnm ::= nm DOT nm",
115357 /* 287 */ "tridxby ::=",
115358 /* 288 */ "tridxby ::= INDEXED BY nm",
115359 /* 289 */ "tridxby ::= NOT INDEXED",
115360 /* 290 */ "trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist where_opt",
115361 /* 291 */ "trigger_cmd ::= insert_cmd INTO trnm inscollist_opt valuelist",
115362 /* 292 */ "trigger_cmd ::= insert_cmd INTO trnm inscollist_opt select",
115363 /* 293 */ "trigger_cmd ::= DELETE FROM trnm tridxby where_opt",
115364 /* 294 */ "trigger_cmd ::= select",
115365 /* 295 */ "expr ::= RAISE LP IGNORE RP",
115366 /* 296 */ "expr ::= RAISE LP raisetype COMMA nm RP",
115367 /* 297 */ "raisetype ::= ROLLBACK",
115368 /* 298 */ "raisetype ::= ABORT",
115369 /* 299 */ "raisetype ::= FAIL",
115370 /* 300 */ "cmd ::= DROP TRIGGER ifexists fullname",
115371 /* 301 */ "cmd ::= ATTACH database_kw_opt expr AS expr key_opt",
115372 /* 302 */ "cmd ::= DETACH database_kw_opt expr",
115373 /* 303 */ "key_opt ::=",
115374 /* 304 */ "key_opt ::= KEY expr",
115375 /* 305 */ "database_kw_opt ::= DATABASE",
115376 /* 306 */ "database_kw_opt ::=",
115377 /* 307 */ "cmd ::= REINDEX",
115378 /* 308 */ "cmd ::= REINDEX nm dbnm",
115379 /* 309 */ "cmd ::= ANALYZE",
115380 /* 310 */ "cmd ::= ANALYZE nm dbnm",
115381 /* 311 */ "cmd ::= ALTER TABLE fullname RENAME TO nm",
115382 /* 312 */ "cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt column",
115383 /* 313 */ "add_column_fullname ::= fullname",
115384 /* 314 */ "kwcolumn_opt ::=",
115385 /* 315 */ "kwcolumn_opt ::= COLUMNKW",
115386 /* 316 */ "cmd ::= create_vtab",
115387 /* 317 */ "cmd ::= create_vtab LP vtabarglist RP",
115388 /* 318 */ "create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm",
115389 /* 319 */ "vtabarglist ::= vtabarg",
115390 /* 320 */ "vtabarglist ::= vtabarglist COMMA vtabarg",
115391 /* 321 */ "vtabarg ::=",
115392 /* 322 */ "vtabarg ::= vtabarg vtabargtoken",
115393 /* 323 */ "vtabargtoken ::= ANY",
115394 /* 324 */ "vtabargtoken ::= lp anylist RP",
115395 /* 325 */ "lp ::= LP",
115396 /* 326 */ "anylist ::=",
115397 /* 327 */ "anylist ::= anylist LP anylist RP",
115398 /* 328 */ "anylist ::= anylist ANY",
115399 };
115400 #endif /* NDEBUG */
115401
115402
115403 #if YYSTACKDEPTH<=0
@@ -115472,80 +115967,80 @@
115472 **
115473 ** Note: during a reduce, the only symbols destroyed are those
115474 ** which appear on the RHS of the rule, but which are not used
115475 ** inside the C code.
115476 */
115477 case 162: /* select */
 
115478 case 196: /* oneselect */
115479 {
115480 sqlite3SelectDelete(pParse->db, (yypminor->yy387));
115481 }
115482 break;
115483 case 175: /* term */
115484 case 176: /* expr */
115485 {
115486 sqlite3ExprDelete(pParse->db, (yypminor->yy118).pExpr);
115487 }
115488 break;
115489 case 180: /* idxlist_opt */
115490 case 189: /* idxlist */
115491 case 199: /* selcollist */
115492 case 202: /* groupby_opt */
115493 case 204: /* orderby_opt */
115494 case 206: /* sclp */
115495 case 216: /* sortlist */
115496 case 217: /* nexprlist */
115497 case 218: /* setlist */
115498 case 222: /* exprlist */
115499 case 227: /* case_exprlist */
115500 {
115501 sqlite3ExprListDelete(pParse->db, (yypminor->yy322));
115502 }
115503 break;
115504 case 195: /* fullname */
115505 case 200: /* from */
115506 case 208: /* seltablist */
115507 case 209: /* stl_prefix */
115508 {
115509 sqlite3SrcListDelete(pParse->db, (yypminor->yy259));
115510 }
115511 break;
115512 case 201: /* where_opt */
115513 case 203: /* having_opt */
115514 case 212: /* on_opt */
115515 case 226: /* case_operand */
115516 case 228: /* case_else */
 
 
 
 
 
 
 
115517 case 238: /* when_clause */
115518 case 243: /* key_opt */
115519 {
115520 sqlite3ExprDelete(pParse->db, (yypminor->yy314));
115521 }
115522 break;
115523 case 213: /* using_opt */
115524 case 215: /* idlist */
115525 case 220: /* inscollist_opt */
115526 {
115527 sqlite3IdListDelete(pParse->db, (yypminor->yy384));
115528 }
115529 break;
115530 case 221: /* valuelist */
115531 {
115532
115533 sqlite3ExprListDelete(pParse->db, (yypminor->yy260).pList);
115534 sqlite3SelectDelete(pParse->db, (yypminor->yy260).pSelect);
115535
115536 }
115537 break;
115538 case 234: /* trigger_cmd_list */
115539 case 239: /* trigger_cmd */
115540 {
115541 sqlite3DeleteTriggerStep(pParse->db, (yypminor->yy203));
115542 }
115543 break;
115544 case 236: /* trigger_event */
115545 {
115546 sqlite3IdListDelete(pParse->db, (yypminor->yy90).b);
115547 }
115548 break;
115549 default: break; /* If no destructor action specified: do nothing */
115550 }
115551 }
@@ -115786,281 +116281,275 @@
115786 */
115787 static const struct {
115788 YYCODETYPE lhs; /* Symbol on the left-hand side of the rule */
115789 unsigned char nrhs; /* Number of right-hand side symbols in the rule */
115790 } yyRuleInfo[] = {
115791 { 143, 1 },
115792 { 144, 2 },
115793 { 144, 1 },
115794 { 145, 1 },
115795 { 145, 3 },
115796 { 146, 0 },
115797 { 146, 1 },
115798 { 146, 3 },
115799 { 147, 1 },
115800 { 148, 3 },
115801 { 150, 0 },
115802 { 150, 1 },
115803 { 150, 2 },
115804 { 149, 0 },
115805 { 149, 1 },
115806 { 149, 1 },
115807 { 149, 1 },
115808 { 148, 2 },
115809 { 148, 2 },
115810 { 148, 2 },
115811 { 152, 1 },
115812 { 152, 0 },
115813 { 148, 2 },
115814 { 148, 3 },
115815 { 148, 5 },
115816 { 148, 2 },
115817 { 153, 6 },
115818 { 155, 1 },
115819 { 157, 0 },
115820 { 157, 3 },
115821 { 156, 1 },
115822 { 156, 0 },
115823 { 154, 5 },
115824 { 154, 2 },
115825 { 161, 0 },
115826 { 161, 2 },
115827 { 159, 3 },
115828 { 159, 1 },
115829 { 163, 3 },
115830 { 164, 1 },
115831 { 167, 1 },
115832 { 167, 1 },
115833 { 168, 1 },
115834 { 151, 1 },
115835 { 151, 1 },
115836 { 151, 1 },
115837 { 165, 0 },
115838 { 165, 1 },
115839 { 169, 1 },
115840 { 169, 4 },
115841 { 169, 6 },
115842 { 170, 1 },
115843 { 170, 2 },
115844 { 171, 1 },
115845 { 171, 1 },
115846 { 166, 2 },
115847 { 166, 0 },
115848 { 174, 2 },
115849 { 174, 2 },
115850 { 174, 4 },
115851 { 174, 3 },
115852 { 174, 3 },
115853 { 174, 2 },
115854 { 174, 2 },
115855 { 174, 3 },
115856 { 174, 5 },
115857 { 174, 2 },
115858 { 174, 4 },
115859 { 174, 4 },
115860 { 174, 1 },
115861 { 174, 2 },
115862 { 179, 0 },
115863 { 179, 1 },
115864 { 181, 0 },
115865 { 181, 2 },
115866 { 183, 2 },
115867 { 183, 3 },
115868 { 183, 3 },
115869 { 183, 3 },
115870 { 184, 2 },
115871 { 184, 2 },
115872 { 184, 1 },
115873 { 184, 1 },
115874 { 184, 2 },
115875 { 182, 3 },
115876 { 182, 2 },
115877 { 185, 0 },
115878 { 185, 2 },
115879 { 185, 2 },
115880 { 160, 0 },
115881 { 160, 2 },
115882 { 186, 3 },
115883 { 186, 1 },
115884 { 187, 1 },
115885 { 187, 0 },
115886 { 188, 2 },
115887 { 188, 7 },
115888 { 188, 5 },
115889 { 188, 5 },
115890 { 188, 10 },
115891 { 190, 0 },
115892 { 190, 1 },
115893 { 177, 0 },
115894 { 177, 3 },
115895 { 191, 0 },
115896 { 191, 2 },
115897 { 192, 1 },
115898 { 192, 1 },
115899 { 192, 1 },
115900 { 148, 4 },
115901 { 194, 2 },
115902 { 194, 0 },
115903 { 148, 8 },
115904 { 148, 4 },
115905 { 148, 1 },
115906 { 162, 1 },
115907 { 162, 3 },
115908 { 197, 1 },
115909 { 197, 2 },
115910 { 197, 1 },
115911 { 196, 9 },
115912 { 198, 1 },
115913 { 198, 1 },
115914 { 198, 0 },
115915 { 206, 2 },
115916 { 206, 0 },
115917 { 199, 3 },
115918 { 199, 2 },
115919 { 199, 4 },
115920 { 207, 2 },
115921 { 207, 1 },
115922 { 207, 0 },
115923 { 200, 0 },
115924 { 200, 2 },
115925 { 209, 2 },
115926 { 209, 0 },
115927 { 208, 7 },
115928 { 208, 7 },
115929 { 208, 7 },
115930 { 158, 0 },
115931 { 158, 2 },
115932 { 195, 2 },
115933 { 210, 1 },
115934 { 210, 2 },
115935 { 210, 3 },
115936 { 210, 4 },
115937 { 212, 2 },
115938 { 212, 0 },
115939 { 211, 0 },
115940 { 211, 3 },
115941 { 211, 2 },
115942 { 213, 4 },
115943 { 213, 0 },
115944 { 204, 0 },
115945 { 204, 3 },
115946 { 216, 4 },
115947 { 216, 2 },
115948 { 178, 1 },
115949 { 178, 1 },
115950 { 178, 0 },
115951 { 202, 0 },
115952 { 202, 3 },
115953 { 203, 0 },
115954 { 203, 2 },
115955 { 205, 0 },
115956 { 205, 2 },
115957 { 205, 4 },
115958 { 205, 4 },
115959 { 148, 5 },
115960 { 201, 0 },
115961 { 201, 2 },
115962 { 148, 7 },
115963 { 218, 5 },
115964 { 218, 3 },
115965 { 148, 5 },
115966 { 148, 5 },
115967 { 148, 6 },
115968 { 219, 2 },
115969 { 219, 1 },
115970 { 221, 4 },
115971 { 221, 5 },
115972 { 220, 0 },
115973 { 220, 3 },
115974 { 215, 3 },
115975 { 215, 1 },
115976 { 176, 1 },
115977 { 176, 3 },
115978 { 175, 1 },
115979 { 176, 1 },
115980 { 176, 1 },
115981 { 176, 3 },
115982 { 176, 5 },
115983 { 175, 1 },
115984 { 175, 1 },
115985 { 176, 1 },
115986 { 176, 1 },
115987 { 176, 3 },
115988 { 176, 6 },
115989 { 176, 5 },
115990 { 176, 4 },
115991 { 175, 1 },
115992 { 176, 3 },
115993 { 176, 3 },
115994 { 176, 3 },
115995 { 176, 3 },
115996 { 176, 3 },
115997 { 176, 3 },
115998 { 176, 3 },
115999 { 176, 3 },
116000 { 223, 1 },
116001 { 223, 2 },
116002 { 223, 1 },
116003 { 223, 2 },
116004 { 176, 3 },
116005 { 176, 5 },
116006 { 176, 2 },
116007 { 176, 3 },
116008 { 176, 3 },
116009 { 176, 4 },
116010 { 176, 2 },
116011 { 176, 2 },
116012 { 176, 2 },
116013 { 176, 2 },
116014 { 224, 1 },
116015 { 224, 2 },
116016 { 176, 5 },
116017 { 225, 1 },
116018 { 225, 2 },
116019 { 176, 5 },
116020 { 176, 3 },
116021 { 176, 5 },
116022 { 176, 4 },
116023 { 176, 4 },
116024 { 176, 5 },
116025 { 227, 5 },
116026 { 227, 4 },
116027 { 228, 2 },
116028 { 228, 0 },
116029 { 226, 1 },
116030 { 226, 0 },
116031 { 222, 1 },
116032 { 222, 0 },
116033 { 217, 3 },
116034 { 217, 1 },
116035 { 148, 12 },
116036 { 229, 1 },
116037 { 229, 0 },
116038 { 180, 0 },
116039 { 180, 3 },
116040 { 189, 5 },
116041 { 189, 3 },
116042 { 230, 0 },
116043 { 230, 2 },
116044 { 148, 4 },
116045 { 148, 1 },
116046 { 148, 2 },
116047 { 148, 3 },
116048 { 148, 5 },
116049 { 148, 6 },
116050 { 148, 5 },
116051 { 148, 6 },
116052 { 231, 1 },
116053 { 231, 1 },
116054 { 231, 1 },
116055 { 231, 1 },
116056 { 231, 1 },
116057 { 172, 2 },
116058 { 172, 1 },
116059 { 173, 2 },
116060 { 232, 1 },
116061 { 148, 5 },
116062 { 233, 11 },
116063 { 235, 1 },
116064 { 235, 1 },
116065 { 235, 2 },
116066 { 235, 0 },
@@ -116079,35 +116568,34 @@
116079 { 241, 3 },
116080 { 241, 2 },
116081 { 239, 7 },
116082 { 239, 5 },
116083 { 239, 5 },
116084 { 239, 5 },
116085 { 239, 1 },
116086 { 176, 4 },
116087 { 176, 6 },
116088 { 193, 1 },
116089 { 193, 1 },
116090 { 193, 1 },
116091 { 148, 4 },
116092 { 148, 6 },
116093 { 148, 3 },
116094 { 243, 0 },
116095 { 243, 2 },
116096 { 242, 1 },
116097 { 242, 0 },
116098 { 148, 1 },
116099 { 148, 3 },
116100 { 148, 1 },
116101 { 148, 3 },
116102 { 148, 6 },
116103 { 148, 6 },
116104 { 244, 1 },
116105 { 245, 0 },
116106 { 245, 1 },
116107 { 148, 1 },
116108 { 148, 4 },
116109 { 246, 8 },
116110 { 247, 1 },
116111 { 247, 3 },
116112 { 248, 0 },
116113 { 248, 2 },
@@ -116115,10 +116603,15 @@
116115 { 249, 3 },
116116 { 250, 1 },
116117 { 251, 0 },
116118 { 251, 4 },
116119 { 251, 2 },
 
 
 
 
 
116120 };
116121
116122 static void yy_accept(yyParser*); /* Forward Declaration */
116123
116124 /*
@@ -116182,21 +116675,21 @@
116182 break;
116183 case 8: /* cmdx ::= cmd */
116184 { sqlite3FinishCoding(pParse); }
116185 break;
116186 case 9: /* cmd ::= BEGIN transtype trans_opt */
116187 {sqlite3BeginTransaction(pParse, yymsp[-1].minor.yy4);}
116188 break;
116189 case 13: /* transtype ::= */
116190 {yygotominor.yy4 = TK_DEFERRED;}
116191 break;
116192 case 14: /* transtype ::= DEFERRED */
116193 case 15: /* transtype ::= IMMEDIATE */ yytestcase(yyruleno==15);
116194 case 16: /* transtype ::= EXCLUSIVE */ yytestcase(yyruleno==16);
116195 case 117: /* multiselect_op ::= UNION */ yytestcase(yyruleno==117);
116196 case 119: /* multiselect_op ::= EXCEPT|INTERSECT */ yytestcase(yyruleno==119);
116197 {yygotominor.yy4 = yymsp[0].major;}
116198 break;
116199 case 17: /* cmd ::= COMMIT trans_opt */
116200 case 18: /* cmd ::= END trans_opt */ yytestcase(yyruleno==18);
116201 {sqlite3CommitTransaction(pParse);}
116202 break;
@@ -116218,11 +116711,11 @@
116218 sqlite3Savepoint(pParse, SAVEPOINT_ROLLBACK, &yymsp[0].minor.yy0);
116219 }
116220 break;
116221 case 26: /* create_table ::= createkw temp TABLE ifnotexists nm dbnm */
116222 {
116223 sqlite3StartTable(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,yymsp[-4].minor.yy4,0,0,yymsp[-2].minor.yy4);
116224 }
116225 break;
116226 case 27: /* createkw ::= CREATE */
116227 {
116228 pParse->db->lookaside.bEnabled = 0;
@@ -116229,49 +116722,49 @@
116229 yygotominor.yy0 = yymsp[0].minor.yy0;
116230 }
116231 break;
116232 case 28: /* ifnotexists ::= */
116233 case 31: /* temp ::= */ yytestcase(yyruleno==31);
116234 case 71: /* autoinc ::= */ yytestcase(yyruleno==71);
116235 case 84: /* defer_subclause ::= NOT DEFERRABLE init_deferred_pred_opt */ yytestcase(yyruleno==84);
116236 case 86: /* init_deferred_pred_opt ::= */ yytestcase(yyruleno==86);
116237 case 88: /* init_deferred_pred_opt ::= INITIALLY IMMEDIATE */ yytestcase(yyruleno==88);
116238 case 100: /* defer_subclause_opt ::= */ yytestcase(yyruleno==100);
116239 case 111: /* ifexists ::= */ yytestcase(yyruleno==111);
116240 case 223: /* between_op ::= BETWEEN */ yytestcase(yyruleno==223);
116241 case 226: /* in_op ::= IN */ yytestcase(yyruleno==226);
116242 {yygotominor.yy4 = 0;}
116243 break;
116244 case 29: /* ifnotexists ::= IF NOT EXISTS */
116245 case 30: /* temp ::= TEMP */ yytestcase(yyruleno==30);
116246 case 72: /* autoinc ::= AUTOINCR */ yytestcase(yyruleno==72);
116247 case 87: /* init_deferred_pred_opt ::= INITIALLY DEFERRED */ yytestcase(yyruleno==87);
116248 case 110: /* ifexists ::= IF EXISTS */ yytestcase(yyruleno==110);
116249 case 224: /* between_op ::= NOT BETWEEN */ yytestcase(yyruleno==224);
116250 case 227: /* in_op ::= NOT IN */ yytestcase(yyruleno==227);
116251 {yygotominor.yy4 = 1;}
116252 break;
116253 case 32: /* create_table_args ::= LP columnlist conslist_opt RP table_options */
116254 {
116255 sqlite3EndTable(pParse,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0,yymsp[0].minor.yy210,0);
116256 }
116257 break;
116258 case 33: /* create_table_args ::= AS select */
116259 {
116260 sqlite3EndTable(pParse,0,0,0,yymsp[0].minor.yy387);
116261 sqlite3SelectDelete(pParse->db, yymsp[0].minor.yy387);
116262 }
116263 break;
116264 case 34: /* table_options ::= */
116265 {yygotominor.yy210 = 0;}
116266 break;
116267 case 35: /* table_options ::= WITHOUT nm */
116268 {
116269 if( yymsp[0].minor.yy0.n==5 && sqlite3_strnicmp(yymsp[0].minor.yy0.z,"rowid",5)==0 ){
116270 yygotominor.yy210 = TF_WithoutRowid;
116271 }else{
116272 yygotominor.yy210 = 0;
116273 sqlite3ErrorMsg(pParse, "unknown table option: %.*s", yymsp[0].minor.yy0.n, yymsp[0].minor.yy0.z);
116274 }
116275 }
116276 break;
116277 case 38: /* column ::= columnid type carglist */
@@ -116285,1004 +116778,1016 @@
116285 sqlite3AddColumn(pParse,&yymsp[0].minor.yy0);
116286 yygotominor.yy0 = yymsp[0].minor.yy0;
116287 pParse->constraintName.n = 0;
116288 }
116289 break;
116290 case 40: /* id ::= ID */
116291 case 41: /* id ::= INDEXED */ yytestcase(yyruleno==41);
116292 case 42: /* ids ::= ID|STRING */ yytestcase(yyruleno==42);
116293 case 43: /* nm ::= id */ yytestcase(yyruleno==43);
116294 case 44: /* nm ::= STRING */ yytestcase(yyruleno==44);
116295 case 45: /* nm ::= JOIN_KW */ yytestcase(yyruleno==45);
116296 case 48: /* typetoken ::= typename */ yytestcase(yyruleno==48);
116297 case 51: /* typename ::= ids */ yytestcase(yyruleno==51);
116298 case 129: /* as ::= AS nm */ yytestcase(yyruleno==129);
116299 case 130: /* as ::= ids */ yytestcase(yyruleno==130);
116300 case 140: /* dbnm ::= DOT nm */ yytestcase(yyruleno==140);
116301 case 149: /* indexed_opt ::= INDEXED BY nm */ yytestcase(yyruleno==149);
116302 case 252: /* collate ::= COLLATE ids */ yytestcase(yyruleno==252);
116303 case 261: /* nmnum ::= plus_num */ yytestcase(yyruleno==261);
116304 case 262: /* nmnum ::= nm */ yytestcase(yyruleno==262);
116305 case 263: /* nmnum ::= ON */ yytestcase(yyruleno==263);
116306 case 264: /* nmnum ::= DELETE */ yytestcase(yyruleno==264);
116307 case 265: /* nmnum ::= DEFAULT */ yytestcase(yyruleno==265);
116308 case 266: /* plus_num ::= PLUS number */ yytestcase(yyruleno==266);
116309 case 267: /* plus_num ::= number */ yytestcase(yyruleno==267);
116310 case 268: /* minus_num ::= MINUS number */ yytestcase(yyruleno==268);
116311 case 269: /* number ::= INTEGER|FLOAT */ yytestcase(yyruleno==269);
116312 case 285: /* trnm ::= nm */ yytestcase(yyruleno==285);
116313 {yygotominor.yy0 = yymsp[0].minor.yy0;}
116314 break;
116315 case 47: /* type ::= typetoken */
116316 {sqlite3AddColumnType(pParse,&yymsp[0].minor.yy0);}
116317 break;
116318 case 49: /* typetoken ::= typename LP signed RP */
116319 {
116320 yygotominor.yy0.z = yymsp[-3].minor.yy0.z;
116321 yygotominor.yy0.n = (int)(&yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n] - yymsp[-3].minor.yy0.z);
116322 }
116323 break;
116324 case 50: /* typetoken ::= typename LP signed COMMA signed RP */
116325 {
116326 yygotominor.yy0.z = yymsp[-5].minor.yy0.z;
116327 yygotominor.yy0.n = (int)(&yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n] - yymsp[-5].minor.yy0.z);
116328 }
116329 break;
116330 case 52: /* typename ::= typename ids */
116331 {yygotominor.yy0.z=yymsp[-1].minor.yy0.z; yygotominor.yy0.n=yymsp[0].minor.yy0.n+(int)(yymsp[0].minor.yy0.z-yymsp[-1].minor.yy0.z);}
116332 break;
116333 case 57: /* ccons ::= CONSTRAINT nm */
116334 case 95: /* tcons ::= CONSTRAINT nm */ yytestcase(yyruleno==95);
116335 {pParse->constraintName = yymsp[0].minor.yy0;}
116336 break;
116337 case 58: /* ccons ::= DEFAULT term */
116338 case 60: /* ccons ::= DEFAULT PLUS term */ yytestcase(yyruleno==60);
116339 {sqlite3AddDefaultValue(pParse,&yymsp[0].minor.yy118);}
116340 break;
116341 case 59: /* ccons ::= DEFAULT LP expr RP */
116342 {sqlite3AddDefaultValue(pParse,&yymsp[-1].minor.yy118);}
116343 break;
116344 case 61: /* ccons ::= DEFAULT MINUS term */
116345 {
116346 ExprSpan v;
116347 v.pExpr = sqlite3PExpr(pParse, TK_UMINUS, yymsp[0].minor.yy118.pExpr, 0, 0);
116348 v.zStart = yymsp[-1].minor.yy0.z;
116349 v.zEnd = yymsp[0].minor.yy118.zEnd;
116350 sqlite3AddDefaultValue(pParse,&v);
116351 }
116352 break;
116353 case 62: /* ccons ::= DEFAULT id */
116354 {
116355 ExprSpan v;
116356 spanExpr(&v, pParse, TK_STRING, &yymsp[0].minor.yy0);
116357 sqlite3AddDefaultValue(pParse,&v);
116358 }
116359 break;
116360 case 64: /* ccons ::= NOT NULL onconf */
116361 {sqlite3AddNotNull(pParse, yymsp[0].minor.yy4);}
116362 break;
116363 case 65: /* ccons ::= PRIMARY KEY sortorder onconf autoinc */
116364 {sqlite3AddPrimaryKey(pParse,0,yymsp[-1].minor.yy4,yymsp[0].minor.yy4,yymsp[-2].minor.yy4);}
116365 break;
116366 case 66: /* ccons ::= UNIQUE onconf */
116367 {sqlite3CreateIndex(pParse,0,0,0,0,yymsp[0].minor.yy4,0,0,0,0);}
116368 break;
116369 case 67: /* ccons ::= CHECK LP expr RP */
116370 {sqlite3AddCheckConstraint(pParse,yymsp[-1].minor.yy118.pExpr);}
116371 break;
116372 case 68: /* ccons ::= REFERENCES nm idxlist_opt refargs */
116373 {sqlite3CreateForeignKey(pParse,0,&yymsp[-2].minor.yy0,yymsp[-1].minor.yy322,yymsp[0].minor.yy4);}
116374 break;
116375 case 69: /* ccons ::= defer_subclause */
116376 {sqlite3DeferForeignKey(pParse,yymsp[0].minor.yy4);}
116377 break;
116378 case 70: /* ccons ::= COLLATE ids */
116379 {sqlite3AddCollateType(pParse, &yymsp[0].minor.yy0);}
116380 break;
116381 case 73: /* refargs ::= */
116382 { yygotominor.yy4 = OE_None*0x0101; /* EV: R-19803-45884 */}
116383 break;
116384 case 74: /* refargs ::= refargs refarg */
116385 { yygotominor.yy4 = (yymsp[-1].minor.yy4 & ~yymsp[0].minor.yy215.mask) | yymsp[0].minor.yy215.value; }
116386 break;
116387 case 75: /* refarg ::= MATCH nm */
116388 case 76: /* refarg ::= ON INSERT refact */ yytestcase(yyruleno==76);
116389 { yygotominor.yy215.value = 0; yygotominor.yy215.mask = 0x000000; }
116390 break;
116391 case 77: /* refarg ::= ON DELETE refact */
116392 { yygotominor.yy215.value = yymsp[0].minor.yy4; yygotominor.yy215.mask = 0x0000ff; }
116393 break;
116394 case 78: /* refarg ::= ON UPDATE refact */
116395 { yygotominor.yy215.value = yymsp[0].minor.yy4<<8; yygotominor.yy215.mask = 0x00ff00; }
116396 break;
116397 case 79: /* refact ::= SET NULL */
116398 { yygotominor.yy4 = OE_SetNull; /* EV: R-33326-45252 */}
116399 break;
116400 case 80: /* refact ::= SET DEFAULT */
116401 { yygotominor.yy4 = OE_SetDflt; /* EV: R-33326-45252 */}
116402 break;
116403 case 81: /* refact ::= CASCADE */
116404 { yygotominor.yy4 = OE_Cascade; /* EV: R-33326-45252 */}
116405 break;
116406 case 82: /* refact ::= RESTRICT */
116407 { yygotominor.yy4 = OE_Restrict; /* EV: R-33326-45252 */}
116408 break;
116409 case 83: /* refact ::= NO ACTION */
116410 { yygotominor.yy4 = OE_None; /* EV: R-33326-45252 */}
116411 break;
116412 case 85: /* defer_subclause ::= DEFERRABLE init_deferred_pred_opt */
116413 case 101: /* defer_subclause_opt ::= defer_subclause */ yytestcase(yyruleno==101);
116414 case 103: /* onconf ::= ON CONFLICT resolvetype */ yytestcase(yyruleno==103);
116415 case 106: /* resolvetype ::= raisetype */ yytestcase(yyruleno==106);
116416 {yygotominor.yy4 = yymsp[0].minor.yy4;}
116417 break;
116418 case 89: /* conslist_opt ::= */
116419 {yygotominor.yy0.n = 0; yygotominor.yy0.z = 0;}
116420 break;
116421 case 90: /* conslist_opt ::= COMMA conslist */
116422 {yygotominor.yy0 = yymsp[-1].minor.yy0;}
116423 break;
116424 case 93: /* tconscomma ::= COMMA */
116425 {pParse->constraintName.n = 0;}
116426 break;
116427 case 96: /* tcons ::= PRIMARY KEY LP idxlist autoinc RP onconf */
116428 {sqlite3AddPrimaryKey(pParse,yymsp[-3].minor.yy322,yymsp[0].minor.yy4,yymsp[-2].minor.yy4,0);}
116429 break;
116430 case 97: /* tcons ::= UNIQUE LP idxlist RP onconf */
116431 {sqlite3CreateIndex(pParse,0,0,0,yymsp[-2].minor.yy322,yymsp[0].minor.yy4,0,0,0,0);}
116432 break;
116433 case 98: /* tcons ::= CHECK LP expr RP onconf */
116434 {sqlite3AddCheckConstraint(pParse,yymsp[-2].minor.yy118.pExpr);}
116435 break;
116436 case 99: /* tcons ::= FOREIGN KEY LP idxlist RP REFERENCES nm idxlist_opt refargs defer_subclause_opt */
116437 {
116438 sqlite3CreateForeignKey(pParse, yymsp[-6].minor.yy322, &yymsp[-3].minor.yy0, yymsp[-2].minor.yy322, yymsp[-1].minor.yy4);
116439 sqlite3DeferForeignKey(pParse, yymsp[0].minor.yy4);
116440 }
116441 break;
116442 case 102: /* onconf ::= */
116443 {yygotominor.yy4 = OE_Default;}
116444 break;
116445 case 104: /* orconf ::= */
116446 {yygotominor.yy210 = OE_Default;}
116447 break;
116448 case 105: /* orconf ::= OR resolvetype */
116449 {yygotominor.yy210 = (u8)yymsp[0].minor.yy4;}
116450 break;
116451 case 107: /* resolvetype ::= IGNORE */
116452 {yygotominor.yy4 = OE_Ignore;}
116453 break;
116454 case 108: /* resolvetype ::= REPLACE */
116455 {yygotominor.yy4 = OE_Replace;}
116456 break;
116457 case 109: /* cmd ::= DROP TABLE ifexists fullname */
116458 {
116459 sqlite3DropTable(pParse, yymsp[0].minor.yy259, 0, yymsp[-1].minor.yy4);
116460 }
116461 break;
116462 case 112: /* cmd ::= createkw temp VIEW ifnotexists nm dbnm AS select */
116463 {
116464 sqlite3CreateView(pParse, &yymsp[-7].minor.yy0, &yymsp[-3].minor.yy0, &yymsp[-2].minor.yy0, yymsp[0].minor.yy387, yymsp[-6].minor.yy4, yymsp[-4].minor.yy4);
116465 }
116466 break;
116467 case 113: /* cmd ::= DROP VIEW ifexists fullname */
116468 {
116469 sqlite3DropTable(pParse, yymsp[0].minor.yy259, 1, yymsp[-1].minor.yy4);
116470 }
116471 break;
116472 case 114: /* cmd ::= select */
116473 {
116474 SelectDest dest = {SRT_Output, 0, 0, 0, 0};
116475 sqlite3Select(pParse, yymsp[0].minor.yy387, &dest);
116476 sqlite3ExplainBegin(pParse->pVdbe);
116477 sqlite3ExplainSelect(pParse->pVdbe, yymsp[0].minor.yy387);
116478 sqlite3ExplainFinish(pParse->pVdbe);
116479 sqlite3SelectDelete(pParse->db, yymsp[0].minor.yy387);
116480 }
116481 break;
116482 case 115: /* select ::= oneselect */
116483 {yygotominor.yy387 = yymsp[0].minor.yy387;}
116484 break;
116485 case 116: /* select ::= select multiselect_op oneselect */
116486 {
116487 if( yymsp[0].minor.yy387 ){
116488 yymsp[0].minor.yy387->op = (u8)yymsp[-1].minor.yy4;
116489 yymsp[0].minor.yy387->pPrior = yymsp[-2].minor.yy387;
116490 if( yymsp[-1].minor.yy4!=TK_ALL ) pParse->hasCompound = 1;
116491 }else{
116492 sqlite3SelectDelete(pParse->db, yymsp[-2].minor.yy387);
116493 }
116494 yygotominor.yy387 = yymsp[0].minor.yy387;
116495 }
116496 break;
116497 case 118: /* multiselect_op ::= UNION ALL */
116498 {yygotominor.yy4 = TK_ALL;}
116499 break;
116500 case 120: /* oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt orderby_opt limit_opt */
116501 {
116502 yygotominor.yy387 = sqlite3SelectNew(pParse,yymsp[-6].minor.yy322,yymsp[-5].minor.yy259,yymsp[-4].minor.yy314,yymsp[-3].minor.yy322,yymsp[-2].minor.yy314,yymsp[-1].minor.yy322,yymsp[-7].minor.yy177,yymsp[0].minor.yy292.pLimit,yymsp[0].minor.yy292.pOffset);
116503 }
116504 break;
116505 case 121: /* distinct ::= DISTINCT */
116506 {yygotominor.yy177 = SF_Distinct;}
116507 break;
116508 case 122: /* distinct ::= ALL */
116509 case 123: /* distinct ::= */ yytestcase(yyruleno==123);
116510 {yygotominor.yy177 = 0;}
116511 break;
116512 case 124: /* sclp ::= selcollist COMMA */
116513 case 248: /* idxlist_opt ::= LP idxlist RP */ yytestcase(yyruleno==248);
116514 {yygotominor.yy322 = yymsp[-1].minor.yy322;}
116515 break;
116516 case 125: /* sclp ::= */
116517 case 153: /* orderby_opt ::= */ yytestcase(yyruleno==153);
116518 case 160: /* groupby_opt ::= */ yytestcase(yyruleno==160);
116519 case 241: /* exprlist ::= */ yytestcase(yyruleno==241);
116520 case 247: /* idxlist_opt ::= */ yytestcase(yyruleno==247);
116521 {yygotominor.yy322 = 0;}
116522 break;
116523 case 126: /* selcollist ::= sclp expr as */
116524 {
116525 yygotominor.yy322 = sqlite3ExprListAppend(pParse, yymsp[-2].minor.yy322, yymsp[-1].minor.yy118.pExpr);
116526 if( yymsp[0].minor.yy0.n>0 ) sqlite3ExprListSetName(pParse, yygotominor.yy322, &yymsp[0].minor.yy0, 1);
116527 sqlite3ExprListSetSpan(pParse,yygotominor.yy322,&yymsp[-1].minor.yy118);
116528 }
116529 break;
116530 case 127: /* selcollist ::= sclp STAR */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
116531 {
116532 Expr *p = sqlite3Expr(pParse->db, TK_ALL, 0);
116533 yygotominor.yy322 = sqlite3ExprListAppend(pParse, yymsp[-1].minor.yy322, p);
116534 }
116535 break;
116536 case 128: /* selcollist ::= sclp nm DOT STAR */
116537 {
116538 Expr *pRight = sqlite3PExpr(pParse, TK_ALL, 0, 0, &yymsp[0].minor.yy0);
116539 Expr *pLeft = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-2].minor.yy0);
116540 Expr *pDot = sqlite3PExpr(pParse, TK_DOT, pLeft, pRight, 0);
116541 yygotominor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-3].minor.yy322, pDot);
116542 }
116543 break;
116544 case 131: /* as ::= */
116545 {yygotominor.yy0.n = 0;}
116546 break;
116547 case 132: /* from ::= */
116548 {yygotominor.yy259 = sqlite3DbMallocZero(pParse->db, sizeof(*yygotominor.yy259));}
116549 break;
116550 case 133: /* from ::= FROM seltablist */
116551 {
116552 yygotominor.yy259 = yymsp[0].minor.yy259;
116553 sqlite3SrcListShiftJoinType(yygotominor.yy259);
116554 }
116555 break;
116556 case 134: /* stl_prefix ::= seltablist joinop */
116557 {
116558 yygotominor.yy259 = yymsp[-1].minor.yy259;
116559 if( ALWAYS(yygotominor.yy259 && yygotominor.yy259->nSrc>0) ) yygotominor.yy259->a[yygotominor.yy259->nSrc-1].jointype = (u8)yymsp[0].minor.yy4;
116560 }
116561 break;
116562 case 135: /* stl_prefix ::= */
116563 {yygotominor.yy259 = 0;}
116564 break;
116565 case 136: /* seltablist ::= stl_prefix nm dbnm as indexed_opt on_opt using_opt */
116566 {
116567 yygotominor.yy259 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy259,&yymsp[-5].minor.yy0,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,0,yymsp[-1].minor.yy314,yymsp[0].minor.yy384);
116568 sqlite3SrcListIndexedBy(pParse, yygotominor.yy259, &yymsp[-2].minor.yy0);
116569 }
116570 break;
116571 case 137: /* seltablist ::= stl_prefix LP select RP as on_opt using_opt */
116572 {
116573 yygotominor.yy259 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy259,0,0,&yymsp[-2].minor.yy0,yymsp[-4].minor.yy387,yymsp[-1].minor.yy314,yymsp[0].minor.yy384);
116574 }
116575 break;
116576 case 138: /* seltablist ::= stl_prefix LP seltablist RP as on_opt using_opt */
116577 {
116578 if( yymsp[-6].minor.yy259==0 && yymsp[-2].minor.yy0.n==0 && yymsp[-1].minor.yy314==0 && yymsp[0].minor.yy384==0 ){
116579 yygotominor.yy259 = yymsp[-4].minor.yy259;
116580 }else if( yymsp[-4].minor.yy259->nSrc==1 ){
116581 yygotominor.yy259 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy259,0,0,&yymsp[-2].minor.yy0,0,yymsp[-1].minor.yy314,yymsp[0].minor.yy384);
116582 if( yygotominor.yy259 ){
116583 struct SrcList_item *pNew = &yygotominor.yy259->a[yygotominor.yy259->nSrc-1];
116584 struct SrcList_item *pOld = yymsp[-4].minor.yy259->a;
116585 pNew->zName = pOld->zName;
116586 pNew->zDatabase = pOld->zDatabase;
116587 pNew->pSelect = pOld->pSelect;
116588 pOld->zName = pOld->zDatabase = 0;
116589 pOld->pSelect = 0;
116590 }
116591 sqlite3SrcListDelete(pParse->db, yymsp[-4].minor.yy259);
116592 }else{
116593 Select *pSubquery;
116594 sqlite3SrcListShiftJoinType(yymsp[-4].minor.yy259);
116595 pSubquery = sqlite3SelectNew(pParse,0,yymsp[-4].minor.yy259,0,0,0,0,SF_NestedFrom,0,0);
116596 yygotominor.yy259 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy259,0,0,&yymsp[-2].minor.yy0,pSubquery,yymsp[-1].minor.yy314,yymsp[0].minor.yy384);
116597 }
116598 }
116599 break;
116600 case 139: /* dbnm ::= */
116601 case 148: /* indexed_opt ::= */ yytestcase(yyruleno==148);
116602 {yygotominor.yy0.z=0; yygotominor.yy0.n=0;}
116603 break;
116604 case 141: /* fullname ::= nm dbnm */
116605 {yygotominor.yy259 = sqlite3SrcListAppend(pParse->db,0,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0);}
116606 break;
116607 case 142: /* joinop ::= COMMA|JOIN */
116608 { yygotominor.yy4 = JT_INNER; }
116609 break;
116610 case 143: /* joinop ::= JOIN_KW JOIN */
116611 { yygotominor.yy4 = sqlite3JoinType(pParse,&yymsp[-1].minor.yy0,0,0); }
116612 break;
116613 case 144: /* joinop ::= JOIN_KW nm JOIN */
116614 { yygotominor.yy4 = sqlite3JoinType(pParse,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0,0); }
116615 break;
116616 case 145: /* joinop ::= JOIN_KW nm nm JOIN */
116617 { yygotominor.yy4 = sqlite3JoinType(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0); }
116618 break;
116619 case 146: /* on_opt ::= ON expr */
116620 case 163: /* having_opt ::= HAVING expr */ yytestcase(yyruleno==163);
116621 case 170: /* where_opt ::= WHERE expr */ yytestcase(yyruleno==170);
116622 case 236: /* case_else ::= ELSE expr */ yytestcase(yyruleno==236);
116623 case 238: /* case_operand ::= expr */ yytestcase(yyruleno==238);
116624 {yygotominor.yy314 = yymsp[0].minor.yy118.pExpr;}
116625 break;
116626 case 147: /* on_opt ::= */
116627 case 162: /* having_opt ::= */ yytestcase(yyruleno==162);
116628 case 169: /* where_opt ::= */ yytestcase(yyruleno==169);
116629 case 237: /* case_else ::= */ yytestcase(yyruleno==237);
116630 case 239: /* case_operand ::= */ yytestcase(yyruleno==239);
116631 {yygotominor.yy314 = 0;}
116632 break;
116633 case 150: /* indexed_opt ::= NOT INDEXED */
116634 {yygotominor.yy0.z=0; yygotominor.yy0.n=1;}
116635 break;
116636 case 151: /* using_opt ::= USING LP idlist RP */
116637 case 182: /* inscollist_opt ::= LP idlist RP */ yytestcase(yyruleno==182);
116638 {yygotominor.yy384 = yymsp[-1].minor.yy384;}
116639 break;
116640 case 152: /* using_opt ::= */
116641 case 181: /* inscollist_opt ::= */ yytestcase(yyruleno==181);
116642 {yygotominor.yy384 = 0;}
116643 break;
116644 case 154: /* orderby_opt ::= ORDER BY sortlist */
116645 case 161: /* groupby_opt ::= GROUP BY nexprlist */ yytestcase(yyruleno==161);
116646 case 240: /* exprlist ::= nexprlist */ yytestcase(yyruleno==240);
116647 {yygotominor.yy322 = yymsp[0].minor.yy322;}
116648 break;
116649 case 155: /* sortlist ::= sortlist COMMA expr sortorder */
116650 {
116651 yygotominor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-3].minor.yy322,yymsp[-1].minor.yy118.pExpr);
116652 if( yygotominor.yy322 ) yygotominor.yy322->a[yygotominor.yy322->nExpr-1].sortOrder = (u8)yymsp[0].minor.yy4;
116653 }
116654 break;
116655 case 156: /* sortlist ::= expr sortorder */
116656 {
116657 yygotominor.yy322 = sqlite3ExprListAppend(pParse,0,yymsp[-1].minor.yy118.pExpr);
116658 if( yygotominor.yy322 && ALWAYS(yygotominor.yy322->a) ) yygotominor.yy322->a[0].sortOrder = (u8)yymsp[0].minor.yy4;
116659 }
116660 break;
116661 case 157: /* sortorder ::= ASC */
116662 case 159: /* sortorder ::= */ yytestcase(yyruleno==159);
116663 {yygotominor.yy4 = SQLITE_SO_ASC;}
116664 break;
116665 case 158: /* sortorder ::= DESC */
116666 {yygotominor.yy4 = SQLITE_SO_DESC;}
116667 break;
116668 case 164: /* limit_opt ::= */
116669 {yygotominor.yy292.pLimit = 0; yygotominor.yy292.pOffset = 0;}
116670 break;
116671 case 165: /* limit_opt ::= LIMIT expr */
116672 {yygotominor.yy292.pLimit = yymsp[0].minor.yy118.pExpr; yygotominor.yy292.pOffset = 0;}
116673 break;
116674 case 166: /* limit_opt ::= LIMIT expr OFFSET expr */
116675 {yygotominor.yy292.pLimit = yymsp[-2].minor.yy118.pExpr; yygotominor.yy292.pOffset = yymsp[0].minor.yy118.pExpr;}
116676 break;
116677 case 167: /* limit_opt ::= LIMIT expr COMMA expr */
116678 {yygotominor.yy292.pOffset = yymsp[-2].minor.yy118.pExpr; yygotominor.yy292.pLimit = yymsp[0].minor.yy118.pExpr;}
116679 break;
116680 case 168: /* cmd ::= DELETE FROM fullname indexed_opt where_opt */
116681 {
116682 sqlite3SrcListIndexedBy(pParse, yymsp[-2].minor.yy259, &yymsp[-1].minor.yy0);
116683 sqlite3DeleteFrom(pParse,yymsp[-2].minor.yy259,yymsp[0].minor.yy314);
116684 }
116685 break;
116686 case 171: /* cmd ::= UPDATE orconf fullname indexed_opt SET setlist where_opt */
116687 {
116688 sqlite3SrcListIndexedBy(pParse, yymsp[-4].minor.yy259, &yymsp[-3].minor.yy0);
116689 sqlite3ExprListCheckLength(pParse,yymsp[-1].minor.yy322,"set list");
116690 sqlite3Update(pParse,yymsp[-4].minor.yy259,yymsp[-1].minor.yy322,yymsp[0].minor.yy314,yymsp[-5].minor.yy210);
116691 }
116692 break;
116693 case 172: /* setlist ::= setlist COMMA nm EQ expr */
116694 {
116695 yygotominor.yy322 = sqlite3ExprListAppend(pParse, yymsp[-4].minor.yy322, yymsp[0].minor.yy118.pExpr);
116696 sqlite3ExprListSetName(pParse, yygotominor.yy322, &yymsp[-2].minor.yy0, 1);
116697 }
116698 break;
116699 case 173: /* setlist ::= nm EQ expr */
116700 {
116701 yygotominor.yy322 = sqlite3ExprListAppend(pParse, 0, yymsp[0].minor.yy118.pExpr);
116702 sqlite3ExprListSetName(pParse, yygotominor.yy322, &yymsp[-2].minor.yy0, 1);
116703 }
116704 break;
116705 case 174: /* cmd ::= insert_cmd INTO fullname inscollist_opt valuelist */
116706 {sqlite3Insert(pParse, yymsp[-2].minor.yy259, yymsp[0].minor.yy260.pList, yymsp[0].minor.yy260.pSelect, yymsp[-1].minor.yy384, yymsp[-4].minor.yy210);}
116707 break;
116708 case 175: /* cmd ::= insert_cmd INTO fullname inscollist_opt select */
116709 {sqlite3Insert(pParse, yymsp[-2].minor.yy259, 0, yymsp[0].minor.yy387, yymsp[-1].minor.yy384, yymsp[-4].minor.yy210);}
116710 break;
116711 case 176: /* cmd ::= insert_cmd INTO fullname inscollist_opt DEFAULT VALUES */
116712 {sqlite3Insert(pParse, yymsp[-3].minor.yy259, 0, 0, yymsp[-2].minor.yy384, yymsp[-5].minor.yy210);}
 
 
 
 
 
116713 break;
116714 case 177: /* insert_cmd ::= INSERT orconf */
116715 {yygotominor.yy210 = yymsp[0].minor.yy210;}
116716 break;
116717 case 178: /* insert_cmd ::= REPLACE */
116718 {yygotominor.yy210 = OE_Replace;}
116719 break;
116720 case 179: /* valuelist ::= VALUES LP nexprlist RP */
116721 {
116722 yygotominor.yy260.pList = yymsp[-1].minor.yy322;
116723 yygotominor.yy260.pSelect = 0;
116724 }
116725 break;
116726 case 180: /* valuelist ::= valuelist COMMA LP exprlist RP */
116727 {
116728 Select *pRight = sqlite3SelectNew(pParse, yymsp[-1].minor.yy322, 0, 0, 0, 0, 0, 0, 0, 0);
116729 if( yymsp[-4].minor.yy260.pList ){
116730 yymsp[-4].minor.yy260.pSelect = sqlite3SelectNew(pParse, yymsp[-4].minor.yy260.pList, 0, 0, 0, 0, 0, 0, 0, 0);
116731 yymsp[-4].minor.yy260.pList = 0;
116732 }
116733 yygotominor.yy260.pList = 0;
116734 if( yymsp[-4].minor.yy260.pSelect==0 || pRight==0 ){
116735 sqlite3SelectDelete(pParse->db, pRight);
116736 sqlite3SelectDelete(pParse->db, yymsp[-4].minor.yy260.pSelect);
116737 yygotominor.yy260.pSelect = 0;
116738 }else{
116739 pRight->op = TK_ALL;
116740 pRight->pPrior = yymsp[-4].minor.yy260.pSelect;
116741 pRight->selFlags |= SF_Values;
116742 pRight->pPrior->selFlags |= SF_Values;
116743 yygotominor.yy260.pSelect = pRight;
116744 }
116745 }
116746 break;
116747 case 183: /* idlist ::= idlist COMMA nm */
116748 {yygotominor.yy384 = sqlite3IdListAppend(pParse->db,yymsp[-2].minor.yy384,&yymsp[0].minor.yy0);}
116749 break;
116750 case 184: /* idlist ::= nm */
116751 {yygotominor.yy384 = sqlite3IdListAppend(pParse->db,0,&yymsp[0].minor.yy0);}
116752 break;
116753 case 185: /* expr ::= term */
116754 {yygotominor.yy118 = yymsp[0].minor.yy118;}
116755 break;
116756 case 186: /* expr ::= LP expr RP */
116757 {yygotominor.yy118.pExpr = yymsp[-1].minor.yy118.pExpr; spanSet(&yygotominor.yy118,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0);}
116758 break;
116759 case 187: /* term ::= NULL */
116760 case 192: /* term ::= INTEGER|FLOAT|BLOB */ yytestcase(yyruleno==192);
116761 case 193: /* term ::= STRING */ yytestcase(yyruleno==193);
116762 {spanExpr(&yygotominor.yy118, pParse, yymsp[0].major, &yymsp[0].minor.yy0);}
116763 break;
116764 case 188: /* expr ::= id */
116765 case 189: /* expr ::= JOIN_KW */ yytestcase(yyruleno==189);
116766 {spanExpr(&yygotominor.yy118, pParse, TK_ID, &yymsp[0].minor.yy0);}
116767 break;
116768 case 190: /* expr ::= nm DOT nm */
116769 {
116770 Expr *temp1 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-2].minor.yy0);
116771 Expr *temp2 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[0].minor.yy0);
116772 yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_DOT, temp1, temp2, 0);
116773 spanSet(&yygotominor.yy118,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0);
116774 }
116775 break;
116776 case 191: /* expr ::= nm DOT nm DOT nm */
116777 {
116778 Expr *temp1 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-4].minor.yy0);
116779 Expr *temp2 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-2].minor.yy0);
116780 Expr *temp3 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[0].minor.yy0);
116781 Expr *temp4 = sqlite3PExpr(pParse, TK_DOT, temp2, temp3, 0);
116782 yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_DOT, temp1, temp4, 0);
116783 spanSet(&yygotominor.yy118,&yymsp[-4].minor.yy0,&yymsp[0].minor.yy0);
116784 }
116785 break;
116786 case 194: /* expr ::= REGISTER */
116787 {
116788 /* When doing a nested parse, one can include terms in an expression
116789 ** that look like this: #1 #2 ... These terms refer to registers
116790 ** in the virtual machine. #N is the N-th register. */
116791 if( pParse->nested==0 ){
116792 sqlite3ErrorMsg(pParse, "near \"%T\": syntax error", &yymsp[0].minor.yy0);
116793 yygotominor.yy118.pExpr = 0;
116794 }else{
116795 yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_REGISTER, 0, 0, &yymsp[0].minor.yy0);
116796 if( yygotominor.yy118.pExpr ) sqlite3GetInt32(&yymsp[0].minor.yy0.z[1], &yygotominor.yy118.pExpr->iTable);
116797 }
116798 spanSet(&yygotominor.yy118, &yymsp[0].minor.yy0, &yymsp[0].minor.yy0);
116799 }
116800 break;
116801 case 195: /* expr ::= VARIABLE */
116802 {
116803 spanExpr(&yygotominor.yy118, pParse, TK_VARIABLE, &yymsp[0].minor.yy0);
116804 sqlite3ExprAssignVarNumber(pParse, yygotominor.yy118.pExpr);
116805 spanSet(&yygotominor.yy118, &yymsp[0].minor.yy0, &yymsp[0].minor.yy0);
116806 }
116807 break;
116808 case 196: /* expr ::= expr COLLATE ids */
116809 {
116810 yygotominor.yy118.pExpr = sqlite3ExprAddCollateToken(pParse, yymsp[-2].minor.yy118.pExpr, &yymsp[0].minor.yy0);
116811 yygotominor.yy118.zStart = yymsp[-2].minor.yy118.zStart;
116812 yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
116813 }
116814 break;
116815 case 197: /* expr ::= CAST LP expr AS typetoken RP */
116816 {
116817 yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_CAST, yymsp[-3].minor.yy118.pExpr, 0, &yymsp[-1].minor.yy0);
116818 spanSet(&yygotominor.yy118,&yymsp[-5].minor.yy0,&yymsp[0].minor.yy0);
116819 }
116820 break;
116821 case 198: /* expr ::= ID LP distinct exprlist RP */
116822 {
116823 if( yymsp[-1].minor.yy322 && yymsp[-1].minor.yy322->nExpr>pParse->db->aLimit[SQLITE_LIMIT_FUNCTION_ARG] ){
116824 sqlite3ErrorMsg(pParse, "too many arguments on function %T", &yymsp[-4].minor.yy0);
116825 }
116826 yygotominor.yy118.pExpr = sqlite3ExprFunction(pParse, yymsp[-1].minor.yy322, &yymsp[-4].minor.yy0);
116827 spanSet(&yygotominor.yy118,&yymsp[-4].minor.yy0,&yymsp[0].minor.yy0);
116828 if( yymsp[-2].minor.yy177 && yygotominor.yy118.pExpr ){
116829 yygotominor.yy118.pExpr->flags |= EP_Distinct;
116830 }
116831 }
116832 break;
116833 case 199: /* expr ::= ID LP STAR RP */
116834 {
116835 yygotominor.yy118.pExpr = sqlite3ExprFunction(pParse, 0, &yymsp[-3].minor.yy0);
116836 spanSet(&yygotominor.yy118,&yymsp[-3].minor.yy0,&yymsp[0].minor.yy0);
116837 }
116838 break;
116839 case 200: /* term ::= CTIME_KW */
116840 {
116841 yygotominor.yy118.pExpr = sqlite3ExprFunction(pParse, 0, &yymsp[0].minor.yy0);
116842 spanSet(&yygotominor.yy118, &yymsp[0].minor.yy0, &yymsp[0].minor.yy0);
116843 }
116844 break;
116845 case 201: /* expr ::= expr AND expr */
116846 case 202: /* expr ::= expr OR expr */ yytestcase(yyruleno==202);
116847 case 203: /* expr ::= expr LT|GT|GE|LE expr */ yytestcase(yyruleno==203);
116848 case 204: /* expr ::= expr EQ|NE expr */ yytestcase(yyruleno==204);
116849 case 205: /* expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr */ yytestcase(yyruleno==205);
116850 case 206: /* expr ::= expr PLUS|MINUS expr */ yytestcase(yyruleno==206);
116851 case 207: /* expr ::= expr STAR|SLASH|REM expr */ yytestcase(yyruleno==207);
116852 case 208: /* expr ::= expr CONCAT expr */ yytestcase(yyruleno==208);
116853 {spanBinaryExpr(&yygotominor.yy118,pParse,yymsp[-1].major,&yymsp[-2].minor.yy118,&yymsp[0].minor.yy118);}
116854 break;
116855 case 209: /* likeop ::= LIKE_KW */
116856 case 211: /* likeop ::= MATCH */ yytestcase(yyruleno==211);
116857 {yygotominor.yy342.eOperator = yymsp[0].minor.yy0; yygotominor.yy342.bNot = 0;}
116858 break;
116859 case 210: /* likeop ::= NOT LIKE_KW */
116860 case 212: /* likeop ::= NOT MATCH */ yytestcase(yyruleno==212);
116861 {yygotominor.yy342.eOperator = yymsp[0].minor.yy0; yygotominor.yy342.bNot = 1;}
116862 break;
116863 case 213: /* expr ::= expr likeop expr */
116864 {
116865 ExprList *pList;
116866 pList = sqlite3ExprListAppend(pParse,0, yymsp[0].minor.yy118.pExpr);
116867 pList = sqlite3ExprListAppend(pParse,pList, yymsp[-2].minor.yy118.pExpr);
116868 yygotominor.yy118.pExpr = sqlite3ExprFunction(pParse, pList, &yymsp[-1].minor.yy342.eOperator);
116869 if( yymsp[-1].minor.yy342.bNot ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0);
116870 yygotominor.yy118.zStart = yymsp[-2].minor.yy118.zStart;
116871 yygotominor.yy118.zEnd = yymsp[0].minor.yy118.zEnd;
116872 if( yygotominor.yy118.pExpr ) yygotominor.yy118.pExpr->flags |= EP_InfixFunc;
116873 }
116874 break;
116875 case 214: /* expr ::= expr likeop expr ESCAPE expr */
116876 {
116877 ExprList *pList;
116878 pList = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy118.pExpr);
116879 pList = sqlite3ExprListAppend(pParse,pList, yymsp[-4].minor.yy118.pExpr);
116880 pList = sqlite3ExprListAppend(pParse,pList, yymsp[0].minor.yy118.pExpr);
116881 yygotominor.yy118.pExpr = sqlite3ExprFunction(pParse, pList, &yymsp[-3].minor.yy342.eOperator);
116882 if( yymsp[-3].minor.yy342.bNot ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0);
116883 yygotominor.yy118.zStart = yymsp[-4].minor.yy118.zStart;
116884 yygotominor.yy118.zEnd = yymsp[0].minor.yy118.zEnd;
116885 if( yygotominor.yy118.pExpr ) yygotominor.yy118.pExpr->flags |= EP_InfixFunc;
116886 }
116887 break;
116888 case 215: /* expr ::= expr ISNULL|NOTNULL */
116889 {spanUnaryPostfix(&yygotominor.yy118,pParse,yymsp[0].major,&yymsp[-1].minor.yy118,&yymsp[0].minor.yy0);}
116890 break;
116891 case 216: /* expr ::= expr NOT NULL */
116892 {spanUnaryPostfix(&yygotominor.yy118,pParse,TK_NOTNULL,&yymsp[-2].minor.yy118,&yymsp[0].minor.yy0);}
116893 break;
116894 case 217: /* expr ::= expr IS expr */
116895 {
116896 spanBinaryExpr(&yygotominor.yy118,pParse,TK_IS,&yymsp[-2].minor.yy118,&yymsp[0].minor.yy118);
116897 binaryToUnaryIfNull(pParse, yymsp[0].minor.yy118.pExpr, yygotominor.yy118.pExpr, TK_ISNULL);
116898 }
116899 break;
116900 case 218: /* expr ::= expr IS NOT expr */
116901 {
116902 spanBinaryExpr(&yygotominor.yy118,pParse,TK_ISNOT,&yymsp[-3].minor.yy118,&yymsp[0].minor.yy118);
116903 binaryToUnaryIfNull(pParse, yymsp[0].minor.yy118.pExpr, yygotominor.yy118.pExpr, TK_NOTNULL);
116904 }
116905 break;
116906 case 219: /* expr ::= NOT expr */
116907 case 220: /* expr ::= BITNOT expr */ yytestcase(yyruleno==220);
116908 {spanUnaryPrefix(&yygotominor.yy118,pParse,yymsp[-1].major,&yymsp[0].minor.yy118,&yymsp[-1].minor.yy0);}
116909 break;
116910 case 221: /* expr ::= MINUS expr */
116911 {spanUnaryPrefix(&yygotominor.yy118,pParse,TK_UMINUS,&yymsp[0].minor.yy118,&yymsp[-1].minor.yy0);}
116912 break;
116913 case 222: /* expr ::= PLUS expr */
116914 {spanUnaryPrefix(&yygotominor.yy118,pParse,TK_UPLUS,&yymsp[0].minor.yy118,&yymsp[-1].minor.yy0);}
116915 break;
116916 case 225: /* expr ::= expr between_op expr AND expr */
116917 {
116918 ExprList *pList = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy118.pExpr);
116919 pList = sqlite3ExprListAppend(pParse,pList, yymsp[0].minor.yy118.pExpr);
116920 yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_BETWEEN, yymsp[-4].minor.yy118.pExpr, 0, 0);
116921 if( yygotominor.yy118.pExpr ){
116922 yygotominor.yy118.pExpr->x.pList = pList;
116923 }else{
116924 sqlite3ExprListDelete(pParse->db, pList);
116925 }
116926 if( yymsp[-3].minor.yy4 ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0);
116927 yygotominor.yy118.zStart = yymsp[-4].minor.yy118.zStart;
116928 yygotominor.yy118.zEnd = yymsp[0].minor.yy118.zEnd;
116929 }
116930 break;
116931 case 228: /* expr ::= expr in_op LP exprlist RP */
116932 {
116933 if( yymsp[-1].minor.yy322==0 ){
116934 /* Expressions of the form
116935 **
116936 ** expr1 IN ()
116937 ** expr1 NOT IN ()
116938 **
116939 ** simplify to constants 0 (false) and 1 (true), respectively,
116940 ** regardless of the value of expr1.
116941 */
116942 yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_INTEGER, 0, 0, &sqlite3IntTokens[yymsp[-3].minor.yy4]);
116943 sqlite3ExprDelete(pParse->db, yymsp[-4].minor.yy118.pExpr);
116944 }else{
116945 yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy118.pExpr, 0, 0);
116946 if( yygotominor.yy118.pExpr ){
116947 yygotominor.yy118.pExpr->x.pList = yymsp[-1].minor.yy322;
116948 sqlite3ExprSetHeight(pParse, yygotominor.yy118.pExpr);
116949 }else{
116950 sqlite3ExprListDelete(pParse->db, yymsp[-1].minor.yy322);
116951 }
116952 if( yymsp[-3].minor.yy4 ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0);
116953 }
116954 yygotominor.yy118.zStart = yymsp[-4].minor.yy118.zStart;
116955 yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
116956 }
116957 break;
116958 case 229: /* expr ::= LP select RP */
116959 {
116960 yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_SELECT, 0, 0, 0);
116961 if( yygotominor.yy118.pExpr ){
116962 yygotominor.yy118.pExpr->x.pSelect = yymsp[-1].minor.yy387;
116963 ExprSetProperty(yygotominor.yy118.pExpr, EP_xIsSelect);
116964 sqlite3ExprSetHeight(pParse, yygotominor.yy118.pExpr);
116965 }else{
116966 sqlite3SelectDelete(pParse->db, yymsp[-1].minor.yy387);
116967 }
116968 yygotominor.yy118.zStart = yymsp[-2].minor.yy0.z;
116969 yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
116970 }
116971 break;
116972 case 230: /* expr ::= expr in_op LP select RP */
116973 {
116974 yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy118.pExpr, 0, 0);
116975 if( yygotominor.yy118.pExpr ){
116976 yygotominor.yy118.pExpr->x.pSelect = yymsp[-1].minor.yy387;
116977 ExprSetProperty(yygotominor.yy118.pExpr, EP_xIsSelect);
116978 sqlite3ExprSetHeight(pParse, yygotominor.yy118.pExpr);
116979 }else{
116980 sqlite3SelectDelete(pParse->db, yymsp[-1].minor.yy387);
116981 }
116982 if( yymsp[-3].minor.yy4 ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0);
116983 yygotominor.yy118.zStart = yymsp[-4].minor.yy118.zStart;
116984 yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
116985 }
116986 break;
116987 case 231: /* expr ::= expr in_op nm dbnm */
116988 {
116989 SrcList *pSrc = sqlite3SrcListAppend(pParse->db, 0,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0);
116990 yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_IN, yymsp[-3].minor.yy118.pExpr, 0, 0);
116991 if( yygotominor.yy118.pExpr ){
116992 yygotominor.yy118.pExpr->x.pSelect = sqlite3SelectNew(pParse, 0,pSrc,0,0,0,0,0,0,0);
116993 ExprSetProperty(yygotominor.yy118.pExpr, EP_xIsSelect);
116994 sqlite3ExprSetHeight(pParse, yygotominor.yy118.pExpr);
116995 }else{
116996 sqlite3SrcListDelete(pParse->db, pSrc);
116997 }
116998 if( yymsp[-2].minor.yy4 ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0);
116999 yygotominor.yy118.zStart = yymsp[-3].minor.yy118.zStart;
117000 yygotominor.yy118.zEnd = yymsp[0].minor.yy0.z ? &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n] : &yymsp[-1].minor.yy0.z[yymsp[-1].minor.yy0.n];
117001 }
117002 break;
117003 case 232: /* expr ::= EXISTS LP select RP */
117004 {
117005 Expr *p = yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_EXISTS, 0, 0, 0);
117006 if( p ){
117007 p->x.pSelect = yymsp[-1].minor.yy387;
117008 ExprSetProperty(p, EP_xIsSelect);
117009 sqlite3ExprSetHeight(pParse, p);
117010 }else{
117011 sqlite3SelectDelete(pParse->db, yymsp[-1].minor.yy387);
117012 }
117013 yygotominor.yy118.zStart = yymsp[-3].minor.yy0.z;
117014 yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
117015 }
117016 break;
117017 case 233: /* expr ::= CASE case_operand case_exprlist case_else END */
117018 {
117019 yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_CASE, yymsp[-3].minor.yy314, 0, 0);
117020 if( yygotominor.yy118.pExpr ){
117021 yygotominor.yy118.pExpr->x.pList = yymsp[-1].minor.yy314 ? sqlite3ExprListAppend(pParse,yymsp[-2].minor.yy322,yymsp[-1].minor.yy314) : yymsp[-2].minor.yy322;
117022 sqlite3ExprSetHeight(pParse, yygotominor.yy118.pExpr);
117023 }else{
117024 sqlite3ExprListDelete(pParse->db, yymsp[-2].minor.yy322);
117025 sqlite3ExprDelete(pParse->db, yymsp[-1].minor.yy314);
117026 }
117027 yygotominor.yy118.zStart = yymsp[-4].minor.yy0.z;
117028 yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
117029 }
117030 break;
117031 case 234: /* case_exprlist ::= case_exprlist WHEN expr THEN expr */
117032 {
117033 yygotominor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy322, yymsp[-2].minor.yy118.pExpr);
117034 yygotominor.yy322 = sqlite3ExprListAppend(pParse,yygotominor.yy322, yymsp[0].minor.yy118.pExpr);
117035 }
117036 break;
117037 case 235: /* case_exprlist ::= WHEN expr THEN expr */
117038 {
117039 yygotominor.yy322 = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy118.pExpr);
117040 yygotominor.yy322 = sqlite3ExprListAppend(pParse,yygotominor.yy322, yymsp[0].minor.yy118.pExpr);
117041 }
117042 break;
117043 case 242: /* nexprlist ::= nexprlist COMMA expr */
117044 {yygotominor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-2].minor.yy322,yymsp[0].minor.yy118.pExpr);}
117045 break;
117046 case 243: /* nexprlist ::= expr */
117047 {yygotominor.yy322 = sqlite3ExprListAppend(pParse,0,yymsp[0].minor.yy118.pExpr);}
117048 break;
117049 case 244: /* cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP idxlist RP where_opt */
117050 {
117051 sqlite3CreateIndex(pParse, &yymsp[-7].minor.yy0, &yymsp[-6].minor.yy0,
117052 sqlite3SrcListAppend(pParse->db,0,&yymsp[-4].minor.yy0,0), yymsp[-2].minor.yy322, yymsp[-10].minor.yy4,
117053 &yymsp[-11].minor.yy0, yymsp[0].minor.yy314, SQLITE_SO_ASC, yymsp[-8].minor.yy4);
117054 }
117055 break;
117056 case 245: /* uniqueflag ::= UNIQUE */
117057 case 298: /* raisetype ::= ABORT */ yytestcase(yyruleno==298);
117058 {yygotominor.yy4 = OE_Abort;}
117059 break;
117060 case 246: /* uniqueflag ::= */
117061 {yygotominor.yy4 = OE_None;}
117062 break;
117063 case 249: /* idxlist ::= idxlist COMMA nm collate sortorder */
117064 {
117065 Expr *p = sqlite3ExprAddCollateToken(pParse, 0, &yymsp[-1].minor.yy0);
117066 yygotominor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy322, p);
117067 sqlite3ExprListSetName(pParse,yygotominor.yy322,&yymsp[-2].minor.yy0,1);
117068 sqlite3ExprListCheckLength(pParse, yygotominor.yy322, "index");
117069 if( yygotominor.yy322 ) yygotominor.yy322->a[yygotominor.yy322->nExpr-1].sortOrder = (u8)yymsp[0].minor.yy4;
117070 }
117071 break;
117072 case 250: /* idxlist ::= nm collate sortorder */
117073 {
117074 Expr *p = sqlite3ExprAddCollateToken(pParse, 0, &yymsp[-1].minor.yy0);
117075 yygotominor.yy322 = sqlite3ExprListAppend(pParse,0, p);
117076 sqlite3ExprListSetName(pParse, yygotominor.yy322, &yymsp[-2].minor.yy0, 1);
117077 sqlite3ExprListCheckLength(pParse, yygotominor.yy322, "index");
117078 if( yygotominor.yy322 ) yygotominor.yy322->a[yygotominor.yy322->nExpr-1].sortOrder = (u8)yymsp[0].minor.yy4;
117079 }
117080 break;
117081 case 251: /* collate ::= */
117082 {yygotominor.yy0.z = 0; yygotominor.yy0.n = 0;}
117083 break;
117084 case 253: /* cmd ::= DROP INDEX ifexists fullname */
117085 {sqlite3DropIndex(pParse, yymsp[0].minor.yy259, yymsp[-1].minor.yy4);}
117086 break;
117087 case 254: /* cmd ::= VACUUM */
117088 case 255: /* cmd ::= VACUUM nm */ yytestcase(yyruleno==255);
117089 {sqlite3Vacuum(pParse);}
117090 break;
117091 case 256: /* cmd ::= PRAGMA nm dbnm */
117092 {sqlite3Pragma(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,0,0);}
117093 break;
117094 case 257: /* cmd ::= PRAGMA nm dbnm EQ nmnum */
117095 {sqlite3Pragma(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0,0);}
117096 break;
117097 case 258: /* cmd ::= PRAGMA nm dbnm LP nmnum RP */
117098 {sqlite3Pragma(pParse,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,&yymsp[-1].minor.yy0,0);}
117099 break;
117100 case 259: /* cmd ::= PRAGMA nm dbnm EQ minus_num */
117101 {sqlite3Pragma(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0,1);}
117102 break;
117103 case 260: /* cmd ::= PRAGMA nm dbnm LP minus_num RP */
117104 {sqlite3Pragma(pParse,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,&yymsp[-1].minor.yy0,1);}
117105 break;
117106 case 270: /* cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END */
117107 {
117108 Token all;
117109 all.z = yymsp[-3].minor.yy0.z;
117110 all.n = (int)(yymsp[0].minor.yy0.z - yymsp[-3].minor.yy0.z) + yymsp[0].minor.yy0.n;
117111 sqlite3FinishTrigger(pParse, yymsp[-1].minor.yy203, &all);
117112 }
117113 break;
117114 case 271: /* trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause */
117115 {
117116 sqlite3BeginTrigger(pParse, &yymsp[-7].minor.yy0, &yymsp[-6].minor.yy0, yymsp[-5].minor.yy4, yymsp[-4].minor.yy90.a, yymsp[-4].minor.yy90.b, yymsp[-2].minor.yy259, yymsp[0].minor.yy314, yymsp[-10].minor.yy4, yymsp[-8].minor.yy4);
117117 yygotominor.yy0 = (yymsp[-6].minor.yy0.n==0?yymsp[-7].minor.yy0:yymsp[-6].minor.yy0);
117118 }
117119 break;
117120 case 272: /* trigger_time ::= BEFORE */
117121 case 275: /* trigger_time ::= */ yytestcase(yyruleno==275);
117122 { yygotominor.yy4 = TK_BEFORE; }
117123 break;
117124 case 273: /* trigger_time ::= AFTER */
117125 { yygotominor.yy4 = TK_AFTER; }
117126 break;
117127 case 274: /* trigger_time ::= INSTEAD OF */
117128 { yygotominor.yy4 = TK_INSTEAD;}
117129 break;
117130 case 276: /* trigger_event ::= DELETE|INSERT */
117131 case 277: /* trigger_event ::= UPDATE */ yytestcase(yyruleno==277);
117132 {yygotominor.yy90.a = yymsp[0].major; yygotominor.yy90.b = 0;}
117133 break;
117134 case 278: /* trigger_event ::= UPDATE OF idlist */
117135 {yygotominor.yy90.a = TK_UPDATE; yygotominor.yy90.b = yymsp[0].minor.yy384;}
117136 break;
117137 case 281: /* when_clause ::= */
117138 case 303: /* key_opt ::= */ yytestcase(yyruleno==303);
117139 { yygotominor.yy314 = 0; }
117140 break;
117141 case 282: /* when_clause ::= WHEN expr */
117142 case 304: /* key_opt ::= KEY expr */ yytestcase(yyruleno==304);
117143 { yygotominor.yy314 = yymsp[0].minor.yy118.pExpr; }
117144 break;
117145 case 283: /* trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI */
117146 {
117147 assert( yymsp[-2].minor.yy203!=0 );
117148 yymsp[-2].minor.yy203->pLast->pNext = yymsp[-1].minor.yy203;
117149 yymsp[-2].minor.yy203->pLast = yymsp[-1].minor.yy203;
117150 yygotominor.yy203 = yymsp[-2].minor.yy203;
117151 }
117152 break;
117153 case 284: /* trigger_cmd_list ::= trigger_cmd SEMI */
117154 {
117155 assert( yymsp[-1].minor.yy203!=0 );
117156 yymsp[-1].minor.yy203->pLast = yymsp[-1].minor.yy203;
117157 yygotominor.yy203 = yymsp[-1].minor.yy203;
117158 }
117159 break;
117160 case 286: /* trnm ::= nm DOT nm */
117161 {
117162 yygotominor.yy0 = yymsp[0].minor.yy0;
117163 sqlite3ErrorMsg(pParse,
117164 "qualified table names are not allowed on INSERT, UPDATE, and DELETE "
117165 "statements within triggers");
117166 }
117167 break;
117168 case 288: /* tridxby ::= INDEXED BY nm */
117169 {
117170 sqlite3ErrorMsg(pParse,
117171 "the INDEXED BY clause is not allowed on UPDATE or DELETE statements "
117172 "within triggers");
117173 }
117174 break;
117175 case 289: /* tridxby ::= NOT INDEXED */
117176 {
117177 sqlite3ErrorMsg(pParse,
117178 "the NOT INDEXED clause is not allowed on UPDATE or DELETE statements "
117179 "within triggers");
117180 }
117181 break;
117182 case 290: /* trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist where_opt */
117183 { yygotominor.yy203 = sqlite3TriggerUpdateStep(pParse->db, &yymsp[-4].minor.yy0, yymsp[-1].minor.yy322, yymsp[0].minor.yy314, yymsp[-5].minor.yy210); }
117184 break;
117185 case 291: /* trigger_cmd ::= insert_cmd INTO trnm inscollist_opt valuelist */
117186 {yygotominor.yy203 = sqlite3TriggerInsertStep(pParse->db, &yymsp[-2].minor.yy0, yymsp[-1].minor.yy384, yymsp[0].minor.yy260.pList, yymsp[0].minor.yy260.pSelect, yymsp[-4].minor.yy210);}
117187 break;
117188 case 292: /* trigger_cmd ::= insert_cmd INTO trnm inscollist_opt select */
117189 {yygotominor.yy203 = sqlite3TriggerInsertStep(pParse->db, &yymsp[-2].minor.yy0, yymsp[-1].minor.yy384, 0, yymsp[0].minor.yy387, yymsp[-4].minor.yy210);}
117190 break;
117191 case 293: /* trigger_cmd ::= DELETE FROM trnm tridxby where_opt */
117192 {yygotominor.yy203 = sqlite3TriggerDeleteStep(pParse->db, &yymsp[-2].minor.yy0, yymsp[0].minor.yy314);}
117193 break;
117194 case 294: /* trigger_cmd ::= select */
117195 {yygotominor.yy203 = sqlite3TriggerSelectStep(pParse->db, yymsp[0].minor.yy387); }
117196 break;
117197 case 295: /* expr ::= RAISE LP IGNORE RP */
117198 {
117199 yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_RAISE, 0, 0, 0);
117200 if( yygotominor.yy118.pExpr ){
117201 yygotominor.yy118.pExpr->affinity = OE_Ignore;
117202 }
117203 yygotominor.yy118.zStart = yymsp[-3].minor.yy0.z;
117204 yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
117205 }
117206 break;
117207 case 296: /* expr ::= RAISE LP raisetype COMMA nm RP */
117208 {
117209 yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_RAISE, 0, 0, &yymsp[-1].minor.yy0);
117210 if( yygotominor.yy118.pExpr ) {
117211 yygotominor.yy118.pExpr->affinity = (char)yymsp[-3].minor.yy4;
117212 }
117213 yygotominor.yy118.zStart = yymsp[-5].minor.yy0.z;
117214 yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
117215 }
117216 break;
117217 case 297: /* raisetype ::= ROLLBACK */
117218 {yygotominor.yy4 = OE_Rollback;}
117219 break;
117220 case 299: /* raisetype ::= FAIL */
117221 {yygotominor.yy4 = OE_Fail;}
117222 break;
117223 case 300: /* cmd ::= DROP TRIGGER ifexists fullname */
117224 {
117225 sqlite3DropTrigger(pParse,yymsp[0].minor.yy259,yymsp[-1].minor.yy4);
117226 }
117227 break;
117228 case 301: /* cmd ::= ATTACH database_kw_opt expr AS expr key_opt */
117229 {
117230 sqlite3Attach(pParse, yymsp[-3].minor.yy118.pExpr, yymsp[-1].minor.yy118.pExpr, yymsp[0].minor.yy314);
117231 }
117232 break;
117233 case 302: /* cmd ::= DETACH database_kw_opt expr */
117234 {
117235 sqlite3Detach(pParse, yymsp[0].minor.yy118.pExpr);
117236 }
117237 break;
117238 case 307: /* cmd ::= REINDEX */
117239 {sqlite3Reindex(pParse, 0, 0);}
117240 break;
117241 case 308: /* cmd ::= REINDEX nm dbnm */
117242 {sqlite3Reindex(pParse, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0);}
117243 break;
117244 case 309: /* cmd ::= ANALYZE */
117245 {sqlite3Analyze(pParse, 0, 0);}
117246 break;
117247 case 310: /* cmd ::= ANALYZE nm dbnm */
117248 {sqlite3Analyze(pParse, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0);}
117249 break;
117250 case 311: /* cmd ::= ALTER TABLE fullname RENAME TO nm */
117251 {
117252 sqlite3AlterRenameTable(pParse,yymsp[-3].minor.yy259,&yymsp[0].minor.yy0);
117253 }
117254 break;
117255 case 312: /* cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt column */
117256 {
117257 sqlite3AlterFinishAddColumn(pParse, &yymsp[0].minor.yy0);
117258 }
117259 break;
117260 case 313: /* add_column_fullname ::= fullname */
117261 {
117262 pParse->db->lookaside.bEnabled = 0;
117263 sqlite3AlterBeginAddColumn(pParse, yymsp[0].minor.yy259);
117264 }
117265 break;
117266 case 316: /* cmd ::= create_vtab */
117267 {sqlite3VtabFinishParse(pParse,0);}
117268 break;
117269 case 317: /* cmd ::= create_vtab LP vtabarglist RP */
117270 {sqlite3VtabFinishParse(pParse,&yymsp[0].minor.yy0);}
117271 break;
117272 case 318: /* create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm */
117273 {
117274 sqlite3VtabBeginParse(pParse, &yymsp[-3].minor.yy0, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-4].minor.yy4);
117275 }
117276 break;
117277 case 321: /* vtabarg ::= */
117278 {sqlite3VtabArgInit(pParse);}
117279 break;
117280 case 323: /* vtabargtoken ::= ANY */
117281 case 324: /* vtabargtoken ::= lp anylist RP */ yytestcase(yyruleno==324);
117282 case 325: /* lp ::= LP */ yytestcase(yyruleno==325);
117283 {sqlite3VtabArgExtend(pParse,&yymsp[0].minor.yy0);}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
117284 break;
117285 default:
117286 /* (0) input ::= cmdlist */ yytestcase(yyruleno==0);
117287 /* (1) cmdlist ::= cmdlist ecmd */ yytestcase(yyruleno==1);
117288 /* (2) cmdlist ::= ecmd */ yytestcase(yyruleno==2);
@@ -117294,32 +117799,32 @@
117294 /* (20) savepoint_opt ::= SAVEPOINT */ yytestcase(yyruleno==20);
117295 /* (21) savepoint_opt ::= */ yytestcase(yyruleno==21);
117296 /* (25) cmd ::= create_table create_table_args */ yytestcase(yyruleno==25);
117297 /* (36) columnlist ::= columnlist COMMA column */ yytestcase(yyruleno==36);
117298 /* (37) columnlist ::= column */ yytestcase(yyruleno==37);
117299 /* (46) type ::= */ yytestcase(yyruleno==46);
117300 /* (53) signed ::= plus_num */ yytestcase(yyruleno==53);
117301 /* (54) signed ::= minus_num */ yytestcase(yyruleno==54);
117302 /* (55) carglist ::= carglist ccons */ yytestcase(yyruleno==55);
117303 /* (56) carglist ::= */ yytestcase(yyruleno==56);
117304 /* (63) ccons ::= NULL onconf */ yytestcase(yyruleno==63);
117305 /* (91) conslist ::= conslist tconscomma tcons */ yytestcase(yyruleno==91);
117306 /* (92) conslist ::= tcons */ yytestcase(yyruleno==92);
117307 /* (94) tconscomma ::= */ yytestcase(yyruleno==94);
117308 /* (279) foreach_clause ::= */ yytestcase(yyruleno==279);
117309 /* (280) foreach_clause ::= FOR EACH ROW */ yytestcase(yyruleno==280);
117310 /* (287) tridxby ::= */ yytestcase(yyruleno==287);
117311 /* (305) database_kw_opt ::= DATABASE */ yytestcase(yyruleno==305);
117312 /* (306) database_kw_opt ::= */ yytestcase(yyruleno==306);
117313 /* (314) kwcolumn_opt ::= */ yytestcase(yyruleno==314);
117314 /* (315) kwcolumn_opt ::= COLUMNKW */ yytestcase(yyruleno==315);
117315 /* (319) vtabarglist ::= vtabarg */ yytestcase(yyruleno==319);
117316 /* (320) vtabarglist ::= vtabarglist COMMA vtabarg */ yytestcase(yyruleno==320);
117317 /* (322) vtabarg ::= vtabarg vtabargtoken */ yytestcase(yyruleno==322);
117318 /* (326) anylist ::= */ yytestcase(yyruleno==326);
117319 /* (327) anylist ::= anylist LP anylist RP */ yytestcase(yyruleno==327);
117320 /* (328) anylist ::= anylist ANY */ yytestcase(yyruleno==328);
117321 break;
117322 };
117323 assert( yyruleno>=0 && yyruleno<sizeof(yyRuleInfo)/sizeof(yyRuleInfo[0]) );
117324 yygoto = yyRuleInfo[yyruleno].lhs;
117325 yysize = yyRuleInfo[yyruleno].nrhs;
@@ -117654,24 +118159,24 @@
117654 ** might be implemented more directly using a hand-written hash table.
117655 ** But by using this automatically generated code, the size of the code
117656 ** is substantially reduced. This is important for embedded applications
117657 ** on platforms with limited memory.
117658 */
117659 /* Hash score: 177 */
117660 static int keywordCode(const char *z, int n){
117661 /* zText[] encodes 819 bytes of keywords in 545 bytes */
117662 /* REINDEXEDESCAPEACHECKEYBEFOREIGNOREGEXPLAINSTEADDATABASELECT */
117663 /* ABLEFTHENDEFERRABLELSEXCEPTRANSACTIONATURALTERAISEXCLUSIVE */
117664 /* XISTSAVEPOINTERSECTRIGGEREFERENCESCONSTRAINTOFFSETEMPORARY */
117665 /* UNIQUERYWITHOUTERELEASEATTACHAVINGROUPDATEBEGINNERENAMEBETWEEN */
117666 /* OTNULLIKECASCADELETECASECOLLATECREATECURRENT_DATEDETACH */
117667 /* IMMEDIATEJOINSERTMATCHPLANALYZEPRAGMABORTVALUESVIRTUALIMITWHEN */
117668 /* WHEREPLACEAFTERESTRICTANDEFAULTAUTOINCREMENTCASTCOLUMNCOMMIT */
117669 /* CONFLICTCROSSCURRENT_TIMESTAMPRIMARYDEFERREDISTINCTDROPFAIL */
117670 /* FROMFULLGLOBYIFISNULLORDERIGHTROLLBACKROWUNIONUSINGVACUUMVIEW */
117671 /* INITIALLY */
117672 static const char zText[544] = {
117673 'R','E','I','N','D','E','X','E','D','E','S','C','A','P','E','A','C','H',
117674 'E','C','K','E','Y','B','E','F','O','R','E','I','G','N','O','R','E','G',
117675 'E','X','P','L','A','I','N','S','T','E','A','D','D','A','T','A','B','A',
117676 'S','E','L','E','C','T','A','B','L','E','F','T','H','E','N','D','E','F',
117677 'E','R','R','A','B','L','E','L','S','E','X','C','E','P','T','R','A','N',
@@ -117680,104 +118185,104 @@
117680 'P','O','I','N','T','E','R','S','E','C','T','R','I','G','G','E','R','E',
117681 'F','E','R','E','N','C','E','S','C','O','N','S','T','R','A','I','N','T',
117682 'O','F','F','S','E','T','E','M','P','O','R','A','R','Y','U','N','I','Q',
117683 'U','E','R','Y','W','I','T','H','O','U','T','E','R','E','L','E','A','S',
117684 'E','A','T','T','A','C','H','A','V','I','N','G','R','O','U','P','D','A',
117685 'T','E','B','E','G','I','N','N','E','R','E','N','A','M','E','B','E','T',
117686 'W','E','E','N','O','T','N','U','L','L','I','K','E','C','A','S','C','A',
117687 'D','E','L','E','T','E','C','A','S','E','C','O','L','L','A','T','E','C',
117688 'R','E','A','T','E','C','U','R','R','E','N','T','_','D','A','T','E','D',
117689 'E','T','A','C','H','I','M','M','E','D','I','A','T','E','J','O','I','N',
117690 'S','E','R','T','M','A','T','C','H','P','L','A','N','A','L','Y','Z','E',
117691 'P','R','A','G','M','A','B','O','R','T','V','A','L','U','E','S','V','I',
117692 'R','T','U','A','L','I','M','I','T','W','H','E','N','W','H','E','R','E',
117693 'P','L','A','C','E','A','F','T','E','R','E','S','T','R','I','C','T','A',
117694 'N','D','E','F','A','U','L','T','A','U','T','O','I','N','C','R','E','M',
117695 'E','N','T','C','A','S','T','C','O','L','U','M','N','C','O','M','M','I',
117696 'T','C','O','N','F','L','I','C','T','C','R','O','S','S','C','U','R','R',
117697 'E','N','T','_','T','I','M','E','S','T','A','M','P','R','I','M','A','R',
117698 'Y','D','E','F','E','R','R','E','D','I','S','T','I','N','C','T','D','R',
117699 'O','P','F','A','I','L','F','R','O','M','F','U','L','L','G','L','O','B',
117700 'Y','I','F','I','S','N','U','L','L','O','R','D','E','R','I','G','H','T',
117701 'R','O','L','L','B','A','C','K','R','O','W','U','N','I','O','N','U','S',
117702 'I','N','G','V','A','C','U','U','M','V','I','E','W','I','N','I','T','I',
117703 'A','L','L','Y',
117704 };
117705 static const unsigned char aHash[127] = {
117706 75, 104, 115, 73, 0, 45, 0, 0, 81, 0, 76, 0, 0,
117707 42, 12, 77, 15, 0, 114, 84, 53, 111, 0, 19, 0, 0,
117708 119, 0, 117, 88, 0, 22, 92, 0, 9, 0, 0, 69, 70,
117709 0, 68, 6, 0, 48, 89, 101, 0, 116, 100, 0, 0, 44,
117710 0, 102, 24, 0, 17, 0, 120, 52, 23, 0, 5, 109, 25,
117711 95, 0, 0, 122, 105, 59, 121, 56, 28, 54, 0, 90, 0,
117712 99, 26, 0, 98, 0, 0, 0, 94, 91, 96, 87, 108, 14,
117713 39, 107, 0, 80, 0, 18, 86, 110, 32, 0, 118, 79, 112,
117714 61, 46, 83, 0, 0, 93, 40, 0, 113, 0, 36, 0, 0,
117715 29, 0, 85, 62, 63, 0, 20, 60, 0, 55,
117716 };
117717 static const unsigned char aNext[122] = {
117718 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0,
117719 0, 2, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0,
117720 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
117721 0, 0, 0, 0, 33, 0, 21, 0, 0, 0, 0, 0, 0,
117722 43, 3, 47, 0, 0, 0, 0, 30, 0, 57, 0, 38, 0,
117723 0, 0, 1, 65, 0, 0, 66, 0, 41, 0, 0, 0, 0,
117724 0, 0, 49, 64, 0, 0, 0, 51, 31, 0, 16, 34, 10,
117725 0, 0, 0, 0, 0, 0, 0, 11, 71, 78, 0, 8, 0,
117726 103, 97, 0, 106, 0, 58, 0, 74, 50, 27, 37, 72, 82,
117727 0, 35, 67, 0, 0,
117728 };
117729 static const unsigned char aLen[122] = {
117730 7, 7, 5, 4, 6, 4, 5, 3, 6, 7, 3, 6, 6,
117731 7, 7, 3, 8, 2, 6, 5, 4, 4, 3, 10, 4, 6,
117732 11, 6, 2, 7, 5, 5, 9, 6, 9, 9, 7, 10, 10,
117733 4, 6, 2, 3, 9, 4, 2, 6, 5, 7, 5, 7, 6,
117734 6, 5, 6, 5, 5, 6, 7, 7, 3, 2, 4, 4, 7,
117735 3, 6, 4, 7, 6, 12, 6, 9, 4, 6, 5, 4, 7,
117736 6, 5, 6, 7, 5, 4, 5, 7, 5, 8, 3, 7, 13,
117737 2, 2, 4, 6, 6, 8, 5, 17, 12, 7, 8, 8, 2,
117738 4, 4, 4, 4, 4, 2, 2, 6, 5, 5, 8, 3, 5,
117739 5, 6, 4, 9, 3,
117740 };
117741 static const unsigned short int aOffset[122] = {
117742 0, 2, 2, 8, 9, 14, 16, 20, 23, 25, 25, 29, 33,
117743 36, 41, 46, 48, 53, 54, 59, 62, 65, 67, 69, 78, 81,
117744 86, 91, 95, 96, 101, 105, 109, 117, 122, 128, 136, 142, 152,
117745 159, 162, 162, 165, 167, 167, 171, 176, 179, 184, 188, 192, 199,
117746 204, 209, 212, 218, 221, 225, 231, 237, 237, 237, 240, 243, 247,
117747 248, 252, 258, 262, 269, 275, 287, 293, 302, 304, 310, 315, 317,
117748 324, 329, 334, 340, 346, 351, 355, 358, 365, 369, 377, 379, 386,
117749 388, 390, 399, 403, 409, 415, 423, 428, 428, 444, 451, 458, 459,
117750 466, 470, 474, 478, 482, 485, 487, 489, 495, 499, 504, 512, 515,
117751 520, 525, 531, 535, 540,
117752 };
117753 static const unsigned char aCode[122] = {
117754 TK_REINDEX, TK_INDEXED, TK_INDEX, TK_DESC, TK_ESCAPE,
117755 TK_EACH, TK_CHECK, TK_KEY, TK_BEFORE, TK_FOREIGN,
117756 TK_FOR, TK_IGNORE, TK_LIKE_KW, TK_EXPLAIN, TK_INSTEAD,
117757 TK_ADD, TK_DATABASE, TK_AS, TK_SELECT, TK_TABLE,
117758 TK_JOIN_KW, TK_THEN, TK_END, TK_DEFERRABLE, TK_ELSE,
117759 TK_EXCEPT, TK_TRANSACTION,TK_ACTION, TK_ON, TK_JOIN_KW,
117760 TK_ALTER, TK_RAISE, TK_EXCLUSIVE, TK_EXISTS, TK_SAVEPOINT,
117761 TK_INTERSECT, TK_TRIGGER, TK_REFERENCES, TK_CONSTRAINT, TK_INTO,
117762 TK_OFFSET, TK_OF, TK_SET, TK_TEMP, TK_TEMP,
117763 TK_OR, TK_UNIQUE, TK_QUERY, TK_WITHOUT, TK_JOIN_KW,
117764 TK_RELEASE, TK_ATTACH, TK_HAVING, TK_GROUP, TK_UPDATE,
117765 TK_BEGIN, TK_JOIN_KW, TK_RENAME, TK_BETWEEN, TK_NOTNULL,
117766 TK_NOT, TK_NO, TK_NULL, TK_LIKE_KW, TK_CASCADE,
117767 TK_ASC, TK_DELETE, TK_CASE, TK_COLLATE, TK_CREATE,
117768 TK_CTIME_KW, TK_DETACH, TK_IMMEDIATE, TK_JOIN, TK_INSERT,
117769 TK_MATCH, TK_PLAN, TK_ANALYZE, TK_PRAGMA, TK_ABORT,
117770 TK_VALUES, TK_VIRTUAL, TK_LIMIT, TK_WHEN, TK_WHERE,
117771 TK_REPLACE, TK_AFTER, TK_RESTRICT, TK_AND, TK_DEFAULT,
117772 TK_AUTOINCR, TK_TO, TK_IN, TK_CAST, TK_COLUMNKW,
117773 TK_COMMIT, TK_CONFLICT, TK_JOIN_KW, TK_CTIME_KW, TK_CTIME_KW,
117774 TK_PRIMARY, TK_DEFERRED, TK_DISTINCT, TK_IS, TK_DROP,
117775 TK_FAIL, TK_FROM, TK_JOIN_KW, TK_LIKE_KW, TK_BY,
117776 TK_IF, TK_ISNULL, TK_ORDER, TK_JOIN_KW, TK_ROLLBACK,
117777 TK_ROW, TK_UNION, TK_USING, TK_VACUUM, TK_VIEW,
117778 TK_INITIALLY, TK_ALL,
117779 };
117780 int h, i;
117781 if( n<2 ) return TK_ID;
117782 h = ((charMap(z[0])*4) ^
117783 (charMap(z[n-1])*3) ^
@@ -117831,92 +118336,94 @@
117831 testcase( i==44 ); /* TEMP */
117832 testcase( i==45 ); /* OR */
117833 testcase( i==46 ); /* UNIQUE */
117834 testcase( i==47 ); /* QUERY */
117835 testcase( i==48 ); /* WITHOUT */
117836 testcase( i==49 ); /* OUTER */
117837 testcase( i==50 ); /* RELEASE */
117838 testcase( i==51 ); /* ATTACH */
117839 testcase( i==52 ); /* HAVING */
117840 testcase( i==53 ); /* GROUP */
117841 testcase( i==54 ); /* UPDATE */
117842 testcase( i==55 ); /* BEGIN */
117843 testcase( i==56 ); /* INNER */
117844 testcase( i==57 ); /* RENAME */
117845 testcase( i==58 ); /* BETWEEN */
117846 testcase( i==59 ); /* NOTNULL */
117847 testcase( i==60 ); /* NOT */
117848 testcase( i==61 ); /* NO */
117849 testcase( i==62 ); /* NULL */
117850 testcase( i==63 ); /* LIKE */
117851 testcase( i==64 ); /* CASCADE */
117852 testcase( i==65 ); /* ASC */
117853 testcase( i==66 ); /* DELETE */
117854 testcase( i==67 ); /* CASE */
117855 testcase( i==68 ); /* COLLATE */
117856 testcase( i==69 ); /* CREATE */
117857 testcase( i==70 ); /* CURRENT_DATE */
117858 testcase( i==71 ); /* DETACH */
117859 testcase( i==72 ); /* IMMEDIATE */
117860 testcase( i==73 ); /* JOIN */
117861 testcase( i==74 ); /* INSERT */
117862 testcase( i==75 ); /* MATCH */
117863 testcase( i==76 ); /* PLAN */
117864 testcase( i==77 ); /* ANALYZE */
117865 testcase( i==78 ); /* PRAGMA */
117866 testcase( i==79 ); /* ABORT */
117867 testcase( i==80 ); /* VALUES */
117868 testcase( i==81 ); /* VIRTUAL */
117869 testcase( i==82 ); /* LIMIT */
117870 testcase( i==83 ); /* WHEN */
117871 testcase( i==84 ); /* WHERE */
117872 testcase( i==85 ); /* REPLACE */
117873 testcase( i==86 ); /* AFTER */
117874 testcase( i==87 ); /* RESTRICT */
117875 testcase( i==88 ); /* AND */
117876 testcase( i==89 ); /* DEFAULT */
117877 testcase( i==90 ); /* AUTOINCREMENT */
117878 testcase( i==91 ); /* TO */
117879 testcase( i==92 ); /* IN */
117880 testcase( i==93 ); /* CAST */
117881 testcase( i==94 ); /* COLUMN */
117882 testcase( i==95 ); /* COMMIT */
117883 testcase( i==96 ); /* CONFLICT */
117884 testcase( i==97 ); /* CROSS */
117885 testcase( i==98 ); /* CURRENT_TIMESTAMP */
117886 testcase( i==99 ); /* CURRENT_TIME */
117887 testcase( i==100 ); /* PRIMARY */
117888 testcase( i==101 ); /* DEFERRED */
117889 testcase( i==102 ); /* DISTINCT */
117890 testcase( i==103 ); /* IS */
117891 testcase( i==104 ); /* DROP */
117892 testcase( i==105 ); /* FAIL */
117893 testcase( i==106 ); /* FROM */
117894 testcase( i==107 ); /* FULL */
117895 testcase( i==108 ); /* GLOB */
117896 testcase( i==109 ); /* BY */
117897 testcase( i==110 ); /* IF */
117898 testcase( i==111 ); /* ISNULL */
117899 testcase( i==112 ); /* ORDER */
117900 testcase( i==113 ); /* RIGHT */
117901 testcase( i==114 ); /* ROLLBACK */
117902 testcase( i==115 ); /* ROW */
117903 testcase( i==116 ); /* UNION */
117904 testcase( i==117 ); /* USING */
117905 testcase( i==118 ); /* VACUUM */
117906 testcase( i==119 ); /* VIEW */
117907 testcase( i==120 ); /* INITIALLY */
117908 testcase( i==121 ); /* ALL */
 
 
117909 return aCode[i];
117910 }
117911 }
117912 return TK_ID;
117913 }
117914 SQLITE_PRIVATE int sqlite3KeywordCode(const unsigned char *z, int n){
117915 return keywordCode((char*)z, n);
117916 }
117917 #define SQLITE_N_KEYWORD 122
117918
117919 /************** End of keywordhash.h *****************************************/
117920 /************** Continuing where we left off in tokenize.c *******************/
117921
117922
@@ -118156,28 +118663,19 @@
118156 case '?': {
118157 *tokenType = TK_VARIABLE;
118158 for(i=1; sqlite3Isdigit(z[i]); i++){}
118159 return i;
118160 }
118161 case '#': {
118162 for(i=1; sqlite3Isdigit(z[i]); i++){}
118163 if( i>1 ){
118164 /* Parameters of the form #NNN (where NNN is a number) are used
118165 ** internally by sqlite3NestedParse. */
118166 *tokenType = TK_REGISTER;
118167 return i;
118168 }
118169 /* Fall through into the next case if the '#' is not followed by
118170 ** a digit. Try to match #AAAA where AAAA is a parameter name. */
118171 }
118172 #ifndef SQLITE_OMIT_TCL_VARIABLE
118173 case '$':
118174 #endif
118175 case '@': /* For compatibility with MS SQL Server */
 
118176 case ':': {
118177 int n = 0;
118178 testcase( z[0]=='$' ); testcase( z[0]=='@' ); testcase( z[0]==':' );
 
118179 *tokenType = TK_VARIABLE;
118180 for(i=1; (c=z[i])!=0; i++){
118181 if( IdChar(c) ){
118182 n++;
118183 #ifndef SQLITE_OMIT_TCL_VARIABLE
@@ -118356,10 +118854,11 @@
118356 ** will take responsibility for freeing the Table structure.
118357 */
118358 sqlite3DeleteTable(db, pParse->pNewTable);
118359 }
118360
 
118361 sqlite3DeleteTrigger(db, pParse->pNewTrigger);
118362 for(i=pParse->nzVar-1; i>=0; i--) sqlite3DbFree(db, pParse->azVar[i]);
118363 sqlite3DbFree(db, pParse->azVar);
118364 while( pParse->pAinc ){
118365 AutoincInfo *p = pParse->pAinc;
@@ -124841,11 +125340,11 @@
124841 /*
124842 ** Set the pIdxInfo->estimatedRows variable to nRow. Unless this
124843 ** extension is currently being used by a version of SQLite too old to
124844 ** support estimatedRows. In that case this function is a no-op.
124845 */
124846 static void setEstimatedRows(sqlite3_index_info *pIdxInfo, i64 nRow){
124847 #if SQLITE_VERSION_NUMBER>=3008002
124848 if( sqlite3_libversion_number()>=3008002 ){
124849 pIdxInfo->estimatedRows = nRow;
124850 }
124851 #endif
@@ -124885,11 +125384,11 @@
124885 ** of the overall query plan the user will see an "unable to use
124886 ** function MATCH in the requested context" error. To discourage
124887 ** this, return a very high cost here. */
124888 pInfo->idxNum = FTS3_FULLSCAN_SEARCH;
124889 pInfo->estimatedCost = 1e50;
124890 setEstimatedRows(pInfo, ((sqlite3_int64)1) << 50);
124891 return SQLITE_OK;
124892 }
124893 continue;
124894 }
124895
124896
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -135,11 +135,11 @@
135 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
136 ** [sqlite_version()] and [sqlite_source_id()].
137 */
138 #define SQLITE_VERSION "3.8.3"
139 #define SQLITE_VERSION_NUMBER 3008003
140 #define SQLITE_SOURCE_ID "2014-01-18 15:22:53 2ad4583c0cc7988f0dfe78fd0a2eb0fdb92d835a"
141
142 /*
143 ** CAPI3REF: Run-Time Library Version Numbers
144 ** KEYWORDS: sqlite3_version, sqlite3_sourceid
145 **
@@ -2592,10 +2592,11 @@
2592 #define SQLITE_CREATE_VTABLE 29 /* Table Name Module Name */
2593 #define SQLITE_DROP_VTABLE 30 /* Table Name Module Name */
2594 #define SQLITE_FUNCTION 31 /* NULL Function Name */
2595 #define SQLITE_SAVEPOINT 32 /* Operation Savepoint Name */
2596 #define SQLITE_COPY 0 /* No longer used */
2597 #define SQLITE_RECURSIVE 33 /* NULL NULL */
2598
2599 /*
2600 ** CAPI3REF: Tracing And Profiling Functions
2601 **
2602 ** These routines register callback functions that can be used for
@@ -8040,167 +8041,169 @@
8041
8042 /************** End of hash.h ************************************************/
8043 /************** Continuing where we left off in sqliteInt.h ******************/
8044 /************** Include parse.h in the middle of sqliteInt.h *****************/
8045 /************** Begin file parse.h *******************************************/
8046 #define TK_SEMI 1
8047 #define TK_EXPLAIN 2
8048 #define TK_QUERY 3
8049 #define TK_PLAN 4
8050 #define TK_BEGIN 5
8051 #define TK_TRANSACTION 6
8052 #define TK_DEFERRED 7
8053 #define TK_IMMEDIATE 8
8054 #define TK_EXCLUSIVE 9
8055 #define TK_COMMIT 10
8056 #define TK_END 11
8057 #define TK_ROLLBACK 12
8058 #define TK_SAVEPOINT 13
8059 #define TK_RELEASE 14
8060 #define TK_TO 15
8061 #define TK_TABLE 16
8062 #define TK_CREATE 17
8063 #define TK_IF 18
8064 #define TK_NOT 19
8065 #define TK_EXISTS 20
8066 #define TK_TEMP 21
8067 #define TK_LP 22
8068 #define TK_RP 23
8069 #define TK_AS 24
8070 #define TK_WITHOUT 25
8071 #define TK_COMMA 26
8072 #define TK_ID 27
8073 #define TK_INDEXED 28
8074 #define TK_ABORT 29
8075 #define TK_ACTION 30
8076 #define TK_AFTER 31
8077 #define TK_ANALYZE 32
8078 #define TK_ASC 33
8079 #define TK_ATTACH 34
8080 #define TK_BEFORE 35
8081 #define TK_BY 36
8082 #define TK_CASCADE 37
8083 #define TK_CAST 38
8084 #define TK_COLUMNKW 39
8085 #define TK_CONFLICT 40
8086 #define TK_DATABASE 41
8087 #define TK_DESC 42
8088 #define TK_DETACH 43
8089 #define TK_EACH 44
8090 #define TK_FAIL 45
8091 #define TK_FOR 46
8092 #define TK_IGNORE 47
8093 #define TK_INITIALLY 48
8094 #define TK_INSTEAD 49
8095 #define TK_LIKE_KW 50
8096 #define TK_MATCH 51
8097 #define TK_NO 52
8098 #define TK_KEY 53
8099 #define TK_OF 54
8100 #define TK_OFFSET 55
8101 #define TK_PRAGMA 56
8102 #define TK_RAISE 57
8103 #define TK_RECURSIVE 58
8104 #define TK_REPLACE 59
8105 #define TK_RESTRICT 60
8106 #define TK_ROW 61
8107 #define TK_TRIGGER 62
8108 #define TK_VACUUM 63
8109 #define TK_VIEW 64
8110 #define TK_VIRTUAL 65
8111 #define TK_WITH 66
8112 #define TK_REINDEX 67
8113 #define TK_RENAME 68
8114 #define TK_CTIME_KW 69
8115 #define TK_ANY 70
8116 #define TK_OR 71
8117 #define TK_AND 72
8118 #define TK_IS 73
8119 #define TK_BETWEEN 74
8120 #define TK_IN 75
8121 #define TK_ISNULL 76
8122 #define TK_NOTNULL 77
8123 #define TK_NE 78
8124 #define TK_EQ 79
8125 #define TK_GT 80
8126 #define TK_LE 81
8127 #define TK_LT 82
8128 #define TK_GE 83
8129 #define TK_ESCAPE 84
8130 #define TK_BITAND 85
8131 #define TK_BITOR 86
8132 #define TK_LSHIFT 87
8133 #define TK_RSHIFT 88
8134 #define TK_PLUS 89
8135 #define TK_MINUS 90
8136 #define TK_STAR 91
8137 #define TK_SLASH 92
8138 #define TK_REM 93
8139 #define TK_CONCAT 94
8140 #define TK_COLLATE 95
8141 #define TK_BITNOT 96
8142 #define TK_STRING 97
8143 #define TK_JOIN_KW 98
8144 #define TK_CONSTRAINT 99
8145 #define TK_DEFAULT 100
8146 #define TK_NULL 101
8147 #define TK_PRIMARY 102
8148 #define TK_UNIQUE 103
8149 #define TK_CHECK 104
8150 #define TK_REFERENCES 105
8151 #define TK_AUTOINCR 106
8152 #define TK_ON 107
8153 #define TK_INSERT 108
8154 #define TK_DELETE 109
8155 #define TK_UPDATE 110
8156 #define TK_SET 111
8157 #define TK_DEFERRABLE 112
8158 #define TK_FOREIGN 113
8159 #define TK_DROP 114
8160 #define TK_UNION 115
8161 #define TK_ALL 116
8162 #define TK_EXCEPT 117
8163 #define TK_INTERSECT 118
8164 #define TK_SELECT 119
8165 #define TK_VALUES 120
8166 #define TK_DISTINCT 121
8167 #define TK_DOT 122
8168 #define TK_FROM 123
8169 #define TK_JOIN 124
8170 #define TK_USING 125
8171 #define TK_ORDER 126
8172 #define TK_GROUP 127
8173 #define TK_HAVING 128
8174 #define TK_LIMIT 129
8175 #define TK_WHERE 130
8176 #define TK_INTO 131
8177 #define TK_INTEGER 132
8178 #define TK_FLOAT 133
8179 #define TK_BLOB 134
8180 #define TK_VARIABLE 135
8181 #define TK_CASE 136
8182 #define TK_WHEN 137
8183 #define TK_THEN 138
8184 #define TK_ELSE 139
8185 #define TK_INDEX 140
8186 #define TK_ALTER 141
8187 #define TK_ADD 142
8188 #define TK_TO_TEXT 143
8189 #define TK_TO_BLOB 144
8190 #define TK_TO_NUMERIC 145
8191 #define TK_TO_INT 146
8192 #define TK_TO_REAL 147
8193 #define TK_ISNOT 148
8194 #define TK_END_OF_FILE 149
8195 #define TK_ILLEGAL 150
8196 #define TK_SPACE 151
8197 #define TK_UNCLOSED_STRING 152
8198 #define TK_FUNCTION 153
8199 #define TK_COLUMN 154
8200 #define TK_AGG_FUNCTION 155
8201 #define TK_AGG_COLUMN 156
8202 #define TK_UMINUS 157
8203 #define TK_UPLUS 158
8204 #define TK_REGISTER 159
8205
8206 /************** End of parse.h ***********************************************/
8207 /************** Continuing where we left off in sqliteInt.h ******************/
8208 #include <stdio.h>
8209 #include <stdlib.h>
@@ -8645,10 +8648,11 @@
8648 typedef struct UnpackedRecord UnpackedRecord;
8649 typedef struct VTable VTable;
8650 typedef struct VtabCtx VtabCtx;
8651 typedef struct Walker Walker;
8652 typedef struct WhereInfo WhereInfo;
8653 typedef struct With With;
8654
8655 /*
8656 ** Defer sourcing vdbe.h and btree.h until after the "u8" and
8657 ** "BusyHandler" typedefs. vdbe.h also requires a few of the opaque
8658 ** pointer types (i.e. FuncDef) defined above.
@@ -9124,109 +9128,110 @@
9128 #define OP_VerifyCookie 49
9129 #define OP_OpenRead 50 /* synopsis: root=P2 iDb=P3 */
9130 #define OP_OpenWrite 51 /* synopsis: root=P2 iDb=P3 */
9131 #define OP_OpenAutoindex 52 /* synopsis: nColumn=P2 */
9132 #define OP_OpenEphemeral 53 /* synopsis: nColumn=P2 */
9133 #define OP_SwapCursors 54
9134 #define OP_SorterOpen 55
9135 #define OP_OpenPseudo 56 /* synopsis: content in r[P2@P3] */
9136 #define OP_Close 57
9137 #define OP_SeekLt 58 /* synopsis: key=r[P3@P4] */
9138 #define OP_SeekLe 59 /* synopsis: key=r[P3@P4] */
9139 #define OP_SeekGe 60 /* synopsis: key=r[P3@P4] */
9140 #define OP_SeekGt 61 /* synopsis: key=r[P3@P4] */
9141 #define OP_Seek 62 /* synopsis: intkey=r[P2] */
9142 #define OP_NoConflict 63 /* synopsis: key=r[P3@P4] */
9143 #define OP_NotFound 64 /* synopsis: key=r[P3@P4] */
9144 #define OP_Found 65 /* synopsis: key=r[P3@P4] */
9145 #define OP_NotExists 66 /* synopsis: intkey=r[P3] */
9146 #define OP_Sequence 67 /* synopsis: r[P2]=rowid */
9147 #define OP_NewRowid 68 /* synopsis: r[P2]=rowid */
9148 #define OP_Insert 69 /* synopsis: intkey=r[P3] data=r[P2] */
9149 #define OP_InsertInt 70 /* synopsis: intkey=P3 data=r[P2] */
9150 #define OP_Or 71 /* same as TK_OR, synopsis: r[P3]=(r[P1] || r[P2]) */
9151 #define OP_And 72 /* same as TK_AND, synopsis: r[P3]=(r[P1] && r[P2]) */
9152 #define OP_Delete 73
9153 #define OP_ResetCount 74
9154 #define OP_SorterCompare 75 /* synopsis: if key(P1)!=rtrim(r[P3],P4) goto P2 */
9155 #define OP_IsNull 76 /* same as TK_ISNULL, synopsis: if r[P1]==NULL goto P2 */
9156 #define OP_NotNull 77 /* same as TK_NOTNULL, synopsis: if r[P1]!=NULL goto P2 */
9157 #define OP_Ne 78 /* same as TK_NE, synopsis: if r[P1]!=r[P3] goto P2 */
9158 #define OP_Eq 79 /* same as TK_EQ, synopsis: if r[P1]==r[P3] goto P2 */
9159 #define OP_Gt 80 /* same as TK_GT, synopsis: if r[P1]>r[P3] goto P2 */
9160 #define OP_Le 81 /* same as TK_LE, synopsis: if r[P1]<=r[P3] goto P2 */
9161 #define OP_Lt 82 /* same as TK_LT, synopsis: if r[P1]<r[P3] goto P2 */
9162 #define OP_Ge 83 /* same as TK_GE, synopsis: if r[P1]>=r[P3] goto P2 */
9163 #define OP_SorterData 84 /* synopsis: r[P2]=data */
9164 #define OP_BitAnd 85 /* same as TK_BITAND, synopsis: r[P3]=r[P1]&r[P2] */
9165 #define OP_BitOr 86 /* same as TK_BITOR, synopsis: r[P3]=r[P1]|r[P2] */
9166 #define OP_ShiftLeft 87 /* same as TK_LSHIFT, synopsis: r[P3]=r[P2]<<r[P1] */
9167 #define OP_ShiftRight 88 /* same as TK_RSHIFT, synopsis: r[P3]=r[P2]>>r[P1] */
9168 #define OP_Add 89 /* same as TK_PLUS, synopsis: r[P3]=r[P1]+r[P2] */
9169 #define OP_Subtract 90 /* same as TK_MINUS, synopsis: r[P3]=r[P2]-r[P1] */
9170 #define OP_Multiply 91 /* same as TK_STAR, synopsis: r[P3]=r[P1]*r[P2] */
9171 #define OP_Divide 92 /* same as TK_SLASH, synopsis: r[P3]=r[P2]/r[P1] */
9172 #define OP_Remainder 93 /* same as TK_REM, synopsis: r[P3]=r[P2]%r[P1] */
9173 #define OP_Concat 94 /* same as TK_CONCAT, synopsis: r[P3]=r[P2]+r[P1] */
9174 #define OP_RowKey 95 /* synopsis: r[P2]=key */
9175 #define OP_BitNot 96 /* same as TK_BITNOT, synopsis: r[P1]= ~r[P1] */
9176 #define OP_String8 97 /* same as TK_STRING, synopsis: r[P2]='P4' */
9177 #define OP_RowData 98 /* synopsis: r[P2]=data */
9178 #define OP_Rowid 99 /* synopsis: r[P2]=rowid */
9179 #define OP_NullRow 100
9180 #define OP_Last 101
9181 #define OP_SorterSort 102
9182 #define OP_Sort 103
9183 #define OP_Rewind 104
9184 #define OP_SorterInsert 105
9185 #define OP_IdxInsert 106 /* synopsis: key=r[P2] */
9186 #define OP_IdxDelete 107 /* synopsis: key=r[P2@P3] */
9187 #define OP_IdxRowid 108 /* synopsis: r[P2]=rowid */
9188 #define OP_IdxLT 109 /* synopsis: key=r[P3@P4] */
9189 #define OP_IdxGE 110 /* synopsis: key=r[P3@P4] */
9190 #define OP_Destroy 111
9191 #define OP_Clear 112
9192 #define OP_CreateIndex 113 /* synopsis: r[P2]=root iDb=P1 */
9193 #define OP_CreateTable 114 /* synopsis: r[P2]=root iDb=P1 */
9194 #define OP_ParseSchema 115
9195 #define OP_LoadAnalysis 116
9196 #define OP_DropTable 117
9197 #define OP_DropIndex 118
9198 #define OP_DropTrigger 119
9199 #define OP_IntegrityCk 120
9200 #define OP_RowSetAdd 121 /* synopsis: rowset(P1)=r[P2] */
9201 #define OP_RowSetRead 122 /* synopsis: r[P3]=rowset(P1) */
9202 #define OP_RowSetTest 123 /* synopsis: if r[P3] in rowset(P1) goto P2 */
9203 #define OP_Program 124
9204 #define OP_Param 125
9205 #define OP_FkCounter 126 /* synopsis: fkctr[P1]+=P2 */
9206 #define OP_FkIfZero 127 /* synopsis: if fkctr[P1]==0 goto P2 */
9207 #define OP_MemMax 128 /* synopsis: r[P1]=max(r[P1],r[P2]) */
9208 #define OP_IfPos 129 /* synopsis: if r[P1]>0 goto P2 */
9209 #define OP_IfNeg 130 /* synopsis: if r[P1]<0 goto P2 */
9210 #define OP_IfZero 131 /* synopsis: r[P1]+=P3, if r[P1]==0 goto P2 */
9211 #define OP_AggFinal 132 /* synopsis: accum=r[P1] N=P2 */
9212 #define OP_Real 133 /* same as TK_FLOAT, synopsis: r[P2]=P4 */
9213 #define OP_IncrVacuum 134
9214 #define OP_Expire 135
9215 #define OP_TableLock 136 /* synopsis: iDb=P1 root=P2 write=P3 */
9216 #define OP_VBegin 137
9217 #define OP_VCreate 138
9218 #define OP_VDestroy 139
9219 #define OP_VOpen 140
9220 #define OP_VColumn 141 /* synopsis: r[P3]=vcolumn(P2) */
9221 #define OP_VNext 142
9222 #define OP_ToText 143 /* same as TK_TO_TEXT */
9223 #define OP_ToBlob 144 /* same as TK_TO_BLOB */
9224 #define OP_ToNumeric 145 /* same as TK_TO_NUMERIC */
9225 #define OP_ToInt 146 /* same as TK_TO_INT */
9226 #define OP_ToReal 147 /* same as TK_TO_REAL */
9227 #define OP_VRename 148
9228 #define OP_Pagecount 149
9229 #define OP_MaxPgcnt 150
9230 #define OP_Trace 151
9231 #define OP_Noop 152
9232 #define OP_Explain 153
9233
9234
9235 /* Properties such as "out2" or "jump" that are specified in
9236 ** comments following the "case" for each opcode in the vdbe.c
9237 ** are encoded into bitvectors as follows:
@@ -9244,23 +9249,23 @@
9249 /* 16 */ 0x01, 0x01, 0x04, 0x24, 0x04, 0x10, 0x00, 0x02,\
9250 /* 24 */ 0x02, 0x02, 0x02, 0x02, 0x02, 0x00, 0x00, 0x20,\
9251 /* 32 */ 0x00, 0x00, 0x04, 0x05, 0x04, 0x00, 0x00, 0x01,\
9252 /* 40 */ 0x01, 0x05, 0x05, 0x00, 0x00, 0x00, 0x02, 0x02,\
9253 /* 48 */ 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\
9254 /* 56 */ 0x00, 0x00, 0x11, 0x11, 0x11, 0x11, 0x08, 0x11,\
9255 /* 64 */ 0x11, 0x11, 0x11, 0x02, 0x02, 0x00, 0x00, 0x4c,\
9256 /* 72 */ 0x4c, 0x00, 0x00, 0x00, 0x05, 0x05, 0x15, 0x15,\
9257 /* 80 */ 0x15, 0x15, 0x15, 0x15, 0x00, 0x4c, 0x4c, 0x4c,\
9258 /* 88 */ 0x4c, 0x4c, 0x4c, 0x4c, 0x4c, 0x4c, 0x4c, 0x00,\
9259 /* 96 */ 0x24, 0x02, 0x00, 0x02, 0x00, 0x01, 0x01, 0x01,\
9260 /* 104 */ 0x01, 0x08, 0x08, 0x00, 0x02, 0x01, 0x01, 0x02,\
9261 /* 112 */ 0x00, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00,\
9262 /* 120 */ 0x00, 0x0c, 0x45, 0x15, 0x01, 0x02, 0x00, 0x01,\
9263 /* 128 */ 0x08, 0x05, 0x05, 0x05, 0x00, 0x02, 0x01, 0x00,\
9264 /* 136 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x04,\
9265 /* 144 */ 0x04, 0x04, 0x04, 0x04, 0x00, 0x02, 0x02, 0x00,\
9266 /* 152 */ 0x00, 0x00,}
9267
9268 /************** End of opcodes.h *********************************************/
9269 /************** Continuing where we left off in vdbe.h ***********************/
9270
9271 /*
@@ -9280,11 +9285,11 @@
9285 SQLITE_PRIVATE void sqlite3VdbeChangeP2(Vdbe*, u32 addr, int P2);
9286 SQLITE_PRIVATE void sqlite3VdbeChangeP3(Vdbe*, u32 addr, int P3);
9287 SQLITE_PRIVATE void sqlite3VdbeChangeP5(Vdbe*, u8 P5);
9288 SQLITE_PRIVATE void sqlite3VdbeJumpHere(Vdbe*, int addr);
9289 SQLITE_PRIVATE void sqlite3VdbeChangeToNoop(Vdbe*, int addr);
9290 SQLITE_PRIVATE int sqlite3VdbeDeletePriorOpcode(Vdbe*, u8 op);
9291 SQLITE_PRIVATE void sqlite3VdbeChangeP4(Vdbe*, int addr, const char *zP4, int N);
9292 SQLITE_PRIVATE void sqlite3VdbeSetP4KeyInfo(Parse*, Index*);
9293 SQLITE_PRIVATE void sqlite3VdbeUsesBtree(Vdbe*, int);
9294 SQLITE_PRIVATE VdbeOp *sqlite3VdbeGetOp(Vdbe*, int);
9295 SQLITE_PRIVATE int sqlite3VdbeMakeLabel(Vdbe*);
@@ -10746,18 +10751,19 @@
10751 Schema *pSchema; /* Schema that contains this table */
10752 Table *pNextZombie; /* Next on the Parse.pZombieTab list */
10753 };
10754
10755 /*
10756 ** Allowed values for Table.tabFlags.
10757 */
10758 #define TF_Readonly 0x01 /* Read-only system table */
10759 #define TF_Ephemeral 0x02 /* An ephemeral table */
10760 #define TF_HasPrimaryKey 0x04 /* Table has a primary key */
10761 #define TF_Autoincrement 0x08 /* Integer primary key is autoincrement */
10762 #define TF_Virtual 0x10 /* Is a virtual table */
10763 #define TF_WithoutRowid 0x20 /* No rowid used. PRIMARY KEY is the key */
10764 #define TF_Recursive 0x40 /* Recursive reference within CTE */
10765
10766
10767 /*
10768 ** Test to see whether or not a table is a virtual table. This is
10769 ** done as a macro so that it will be optimized out when virtual
@@ -11335,10 +11341,11 @@
11341 int regReturn; /* Register holding return address of addrFillSub */
11342 u8 jointype; /* Type of join between this able and the previous */
11343 unsigned notIndexed :1; /* True if there is a NOT INDEXED clause */
11344 unsigned isCorrelated :1; /* True if sub-query is correlated */
11345 unsigned viaCoroutine :1; /* Implemented as a co-routine */
11346 unsigned isRecursive :1; /* True for recursive reference in WITH */
11347 #ifndef SQLITE_OMIT_EXPLAIN
11348 u8 iSelectId; /* If pSelect!=0, the id of the sub-select in EQP */
11349 #endif
11350 int iCursor; /* The VDBE cursor number used to access this table */
11351 Expr *pOn; /* The ON clause of a join */
@@ -11461,10 +11468,11 @@
11468 Select *pPrior; /* Prior select in a compound select statement */
11469 Select *pNext; /* Next select to the left in a compound */
11470 Select *pRightmost; /* Right-most select in a compound select statement */
11471 Expr *pLimit; /* LIMIT expression. NULL means not used. */
11472 Expr *pOffset; /* OFFSET expression. NULL means not used. */
11473 With *pWith; /* WITH clause attached to this select. Or NULL. */
11474 };
11475
11476 /*
11477 ** Allowed values for Select.selFlags. The "SF" prefix stands for
11478 ** "Select Flag".
@@ -11478,10 +11486,11 @@
11486 #define SF_UseSorter 0x0040 /* Sort using a sorter */
11487 #define SF_Values 0x0080 /* Synthesized from VALUES clause */
11488 #define SF_Materialize 0x0100 /* Force materialization of views */
11489 #define SF_NestedFrom 0x0200 /* Part of a parenthesized FROM clause */
11490 #define SF_MaybeConvert 0x0400 /* Need convertCompoundSelectToSubquery() */
11491 #define SF_Recursive 0x0800 /* The recursive part of a recursive CTE */
11492
11493
11494 /*
11495 ** The results of a select can be distributed in several ways. The
11496 ** "SRT" prefix means "SELECT Result Type".
@@ -11498,10 +11507,11 @@
11507 #define SRT_Mem 6 /* Store result in a memory cell */
11508 #define SRT_Set 7 /* Store results as keys in an index */
11509 #define SRT_Table 8 /* Store result as data with an automatic rowid */
11510 #define SRT_EphemTab 9 /* Create transient tab and store like SRT_Table */
11511 #define SRT_Coroutine 10 /* Generate a single row of result */
11512 #define SRT_DistTable 11 /* Like SRT_TABLE, but unique results only */
11513
11514 /*
11515 ** An instance of this object describes where to put of the results of
11516 ** a SELECT statement.
11517 */
@@ -11611,10 +11621,11 @@
11621 int nSet; /* Number of sets used so far */
11622 int nOnce; /* Number of OP_Once instructions so far */
11623 int nOpAlloc; /* Number of slots allocated for Vdbe.aOp[] */
11624 int nLabel; /* Number of labels used */
11625 int *aLabel; /* Space to hold the labels */
11626 int iFixedOp; /* Never back out opcodes iFixedOp-1 or earlier */
11627 int ckBase; /* Base register of data during check constraints */
11628 int iPartIdxTab; /* Table corresponding to a partial index */
11629 int iCacheLevel; /* ColCache valid when aColCache[].iLevel<=iCacheLevel */
11630 int iCacheCnt; /* Counter used to generate aColCache[].lru values */
11631 struct yColCache {
@@ -11681,10 +11692,12 @@
11692 Token sArg; /* Complete text of a module argument */
11693 Table **apVtabLock; /* Pointer to virtual tables needing locking */
11694 #endif
11695 Table *pZombieTab; /* List of Table objects to delete after code gen */
11696 TriggerPrg *pTriggerPrg; /* Linked list of coded triggers */
11697 With *pWith; /* Current WITH clause, or NULL */
11698 u8 bFreeWith; /* True if pWith should be freed with parser */
11699 };
11700
11701 /*
11702 ** Return true if currently inside an sqlite3_declare_vtab() call.
11703 */
@@ -11800,11 +11813,11 @@
11813 u8 orconf; /* OE_Rollback etc. */
11814 Trigger *pTrig; /* The trigger that this step is a part of */
11815 Select *pSelect; /* SELECT statment or RHS of INSERT INTO .. SELECT ... */
11816 Token target; /* Target table for DELETE, UPDATE, INSERT */
11817 Expr *pWhere; /* The WHERE clause for DELETE or UPDATE steps */
11818 ExprList *pExprList; /* SET clause for UPDATE. */
11819 IdList *pIdList; /* Column names for INSERT */
11820 TriggerStep *pNext; /* Next in the link-list */
11821 TriggerStep *pLast; /* Last element in link-list. Valid for 1st elem only */
11822 };
11823
@@ -11922,13 +11935,13 @@
11935 ** Context pointer passed down through the tree-walk.
11936 */
11937 struct Walker {
11938 int (*xExprCallback)(Walker*, Expr*); /* Callback for expressions */
11939 int (*xSelectCallback)(Walker*,Select*); /* Callback for SELECTs */
11940 void (*xSelectCallback2)(Walker*,Select*);/* Second callback for SELECTs */
11941 Parse *pParse; /* Parser context. */
11942 int walkerDepth; /* Number of subqueries */
 
11943 union { /* Extra data for callback */
11944 NameContext *pNC; /* Naming context */
11945 int i; /* Integer value */
11946 SrcList *pSrcList; /* FROM clause */
11947 struct SrcCount *pSrcCount; /* Counting column references */
@@ -11947,10 +11960,25 @@
11960 ** callbacks.
11961 */
11962 #define WRC_Continue 0 /* Continue down into children */
11963 #define WRC_Prune 1 /* Omit children but continue walking siblings */
11964 #define WRC_Abort 2 /* Abandon the tree walk */
11965
11966 /*
11967 ** An instance of this structure represents a set of one or more CTEs
11968 ** (common table expressions) created by a single WITH clause.
11969 */
11970 struct With {
11971 int nCte; /* Number of CTEs in the WITH clause */
11972 With *pOuter; /* Containing WITH clause, or NULL */
11973 struct Cte { /* For each CTE in the WITH clause.... */
11974 char *zName; /* Name of this CTE */
11975 ExprList *pCols; /* List of explicit column names, or NULL */
11976 Select *pSelect; /* The definition of this CTE */
11977 const char *zErr; /* Error message for circular references */
11978 } a[1];
11979 };
11980
11981 /*
11982 ** Assuming zIn points to the first byte of a UTF-8 character,
11983 ** advance zIn to point to the first byte of the next UTF-8 character.
11984 */
@@ -12215,11 +12243,11 @@
12243 #else
12244 # define sqlite3AutoincrementBegin(X)
12245 # define sqlite3AutoincrementEnd(X)
12246 #endif
12247 SQLITE_PRIVATE int sqlite3CodeCoroutine(Parse*, Select*, SelectDest*);
12248 SQLITE_PRIVATE void sqlite3Insert(Parse*, SrcList*, Select*, IdList*, int);
12249 SQLITE_PRIVATE void *sqlite3ArrayAllocate(sqlite3*,void*,int,int*,int*);
12250 SQLITE_PRIVATE IdList *sqlite3IdListAppend(sqlite3*, IdList*, Token*);
12251 SQLITE_PRIVATE int sqlite3IdListIndex(IdList*,const char*);
12252 SQLITE_PRIVATE SrcList *sqlite3SrcListEnlarge(sqlite3*, SrcList*, int, int);
12253 SQLITE_PRIVATE SrcList *sqlite3SrcListAppend(sqlite3*, SrcList*, Token*, Token*);
@@ -12309,11 +12337,11 @@
12337 SQLITE_PRIVATE void sqlite3ExprCodeIsNullJump(Vdbe*, const Expr*, int, int);
12338 SQLITE_PRIVATE int sqlite3ExprNeedsNoAffinityChange(const Expr*, char);
12339 SQLITE_PRIVATE int sqlite3IsRowid(const char*);
12340 SQLITE_PRIVATE void sqlite3GenerateRowDelete(Parse*,Table*,Trigger*,int,int,int,i16,u8,u8,u8);
12341 SQLITE_PRIVATE void sqlite3GenerateRowIndexDelete(Parse*, Table*, int, int, int*);
12342 SQLITE_PRIVATE int sqlite3GenerateIndexKey(Parse*, Index*, int, int, int, int*,Index*,int);
12343 SQLITE_PRIVATE void sqlite3GenerateConstraintChecks(Parse*,Table*,int*,int,int,int,int,
12344 u8,u8,int,int*);
12345 SQLITE_PRIVATE void sqlite3CompleteInsertion(Parse*,Table*,int,int,int,int*,int,int,int);
12346 SQLITE_PRIVATE int sqlite3OpenTableAndIndices(Parse*, Table*, int, int, u8*, int*, int*);
12347 SQLITE_PRIVATE void sqlite3BeginWriteOperation(Parse*, int, int);
@@ -12353,11 +12381,11 @@
12381 SQLITE_PRIVATE void sqlite3CodeRowTriggerDirect(Parse *, Trigger *, Table *, int, int, int);
12382 void sqliteViewTriggers(Parse*, Table*, Expr*, int, ExprList*);
12383 SQLITE_PRIVATE void sqlite3DeleteTriggerStep(sqlite3*, TriggerStep*);
12384 SQLITE_PRIVATE TriggerStep *sqlite3TriggerSelectStep(sqlite3*,Select*);
12385 SQLITE_PRIVATE TriggerStep *sqlite3TriggerInsertStep(sqlite3*,Token*, IdList*,
12386 Select*,u8);
12387 SQLITE_PRIVATE TriggerStep *sqlite3TriggerUpdateStep(sqlite3*,Token*,ExprList*, Expr*, u8);
12388 SQLITE_PRIVATE TriggerStep *sqlite3TriggerDeleteStep(sqlite3*,Token*, Expr*);
12389 SQLITE_PRIVATE void sqlite3DeleteTrigger(sqlite3*, Trigger*);
12390 SQLITE_PRIVATE void sqlite3UnlinkAndDeleteTrigger(sqlite3*,int,const char*);
12391 SQLITE_PRIVATE u32 sqlite3TriggerColmask(Parse*,Trigger*,ExprList*,int,int,Table*,int);
@@ -12646,10 +12674,18 @@
12674 SQLITE_PRIVATE const char *sqlite3JournalModename(int);
12675 #ifndef SQLITE_OMIT_WAL
12676 SQLITE_PRIVATE int sqlite3Checkpoint(sqlite3*, int, int, int*, int*);
12677 SQLITE_PRIVATE int sqlite3WalDefaultHook(void*,sqlite3*,const char*,int);
12678 #endif
12679 #ifndef SQLITE_OMIT_CTE
12680 SQLITE_PRIVATE With *sqlite3WithAdd(Parse*,With*,Token*,ExprList*,Select*);
12681 SQLITE_PRIVATE void sqlite3WithDelete(sqlite3*,With*);
12682 SQLITE_PRIVATE void sqlite3WithPush(Parse*, With*, u8);
12683 #else
12684 #define sqlite3WithPush(x,y,z)
12685 #define sqlite3WithDelete(x,y)
12686 #endif
12687
12688 /* Declarations for functions in fkey.c. All of these are replaced by
12689 ** no-op macros if OMIT_FOREIGN_KEY is defined. In this case no foreign
12690 ** key functionality is available. If OMIT_TRIGGER is defined but
12691 ** OMIT_FOREIGN_KEY is not, only some of the functions are no-oped. In
@@ -23143,109 +23179,110 @@
23179 /* 49 */ "VerifyCookie" OpHelp(""),
23180 /* 50 */ "OpenRead" OpHelp("root=P2 iDb=P3"),
23181 /* 51 */ "OpenWrite" OpHelp("root=P2 iDb=P3"),
23182 /* 52 */ "OpenAutoindex" OpHelp("nColumn=P2"),
23183 /* 53 */ "OpenEphemeral" OpHelp("nColumn=P2"),
23184 /* 54 */ "SwapCursors" OpHelp(""),
23185 /* 55 */ "SorterOpen" OpHelp(""),
23186 /* 56 */ "OpenPseudo" OpHelp("content in r[P2@P3]"),
23187 /* 57 */ "Close" OpHelp(""),
23188 /* 58 */ "SeekLt" OpHelp("key=r[P3@P4]"),
23189 /* 59 */ "SeekLe" OpHelp("key=r[P3@P4]"),
23190 /* 60 */ "SeekGe" OpHelp("key=r[P3@P4]"),
23191 /* 61 */ "SeekGt" OpHelp("key=r[P3@P4]"),
23192 /* 62 */ "Seek" OpHelp("intkey=r[P2]"),
23193 /* 63 */ "NoConflict" OpHelp("key=r[P3@P4]"),
23194 /* 64 */ "NotFound" OpHelp("key=r[P3@P4]"),
23195 /* 65 */ "Found" OpHelp("key=r[P3@P4]"),
23196 /* 66 */ "NotExists" OpHelp("intkey=r[P3]"),
23197 /* 67 */ "Sequence" OpHelp("r[P2]=rowid"),
23198 /* 68 */ "NewRowid" OpHelp("r[P2]=rowid"),
23199 /* 69 */ "Insert" OpHelp("intkey=r[P3] data=r[P2]"),
23200 /* 70 */ "InsertInt" OpHelp("intkey=P3 data=r[P2]"),
23201 /* 71 */ "Or" OpHelp("r[P3]=(r[P1] || r[P2])"),
23202 /* 72 */ "And" OpHelp("r[P3]=(r[P1] && r[P2])"),
23203 /* 73 */ "Delete" OpHelp(""),
23204 /* 74 */ "ResetCount" OpHelp(""),
23205 /* 75 */ "SorterCompare" OpHelp("if key(P1)!=rtrim(r[P3],P4) goto P2"),
23206 /* 76 */ "IsNull" OpHelp("if r[P1]==NULL goto P2"),
23207 /* 77 */ "NotNull" OpHelp("if r[P1]!=NULL goto P2"),
23208 /* 78 */ "Ne" OpHelp("if r[P1]!=r[P3] goto P2"),
23209 /* 79 */ "Eq" OpHelp("if r[P1]==r[P3] goto P2"),
23210 /* 80 */ "Gt" OpHelp("if r[P1]>r[P3] goto P2"),
23211 /* 81 */ "Le" OpHelp("if r[P1]<=r[P3] goto P2"),
23212 /* 82 */ "Lt" OpHelp("if r[P1]<r[P3] goto P2"),
23213 /* 83 */ "Ge" OpHelp("if r[P1]>=r[P3] goto P2"),
23214 /* 84 */ "SorterData" OpHelp("r[P2]=data"),
23215 /* 85 */ "BitAnd" OpHelp("r[P3]=r[P1]&r[P2]"),
23216 /* 86 */ "BitOr" OpHelp("r[P3]=r[P1]|r[P2]"),
23217 /* 87 */ "ShiftLeft" OpHelp("r[P3]=r[P2]<<r[P1]"),
23218 /* 88 */ "ShiftRight" OpHelp("r[P3]=r[P2]>>r[P1]"),
23219 /* 89 */ "Add" OpHelp("r[P3]=r[P1]+r[P2]"),
23220 /* 90 */ "Subtract" OpHelp("r[P3]=r[P2]-r[P1]"),
23221 /* 91 */ "Multiply" OpHelp("r[P3]=r[P1]*r[P2]"),
23222 /* 92 */ "Divide" OpHelp("r[P3]=r[P2]/r[P1]"),
23223 /* 93 */ "Remainder" OpHelp("r[P3]=r[P2]%r[P1]"),
23224 /* 94 */ "Concat" OpHelp("r[P3]=r[P2]+r[P1]"),
23225 /* 95 */ "RowKey" OpHelp("r[P2]=key"),
23226 /* 96 */ "BitNot" OpHelp("r[P1]= ~r[P1]"),
23227 /* 97 */ "String8" OpHelp("r[P2]='P4'"),
23228 /* 98 */ "RowData" OpHelp("r[P2]=data"),
23229 /* 99 */ "Rowid" OpHelp("r[P2]=rowid"),
23230 /* 100 */ "NullRow" OpHelp(""),
23231 /* 101 */ "Last" OpHelp(""),
23232 /* 102 */ "SorterSort" OpHelp(""),
23233 /* 103 */ "Sort" OpHelp(""),
23234 /* 104 */ "Rewind" OpHelp(""),
23235 /* 105 */ "SorterInsert" OpHelp(""),
23236 /* 106 */ "IdxInsert" OpHelp("key=r[P2]"),
23237 /* 107 */ "IdxDelete" OpHelp("key=r[P2@P3]"),
23238 /* 108 */ "IdxRowid" OpHelp("r[P2]=rowid"),
23239 /* 109 */ "IdxLT" OpHelp("key=r[P3@P4]"),
23240 /* 110 */ "IdxGE" OpHelp("key=r[P3@P4]"),
23241 /* 111 */ "Destroy" OpHelp(""),
23242 /* 112 */ "Clear" OpHelp(""),
23243 /* 113 */ "CreateIndex" OpHelp("r[P2]=root iDb=P1"),
23244 /* 114 */ "CreateTable" OpHelp("r[P2]=root iDb=P1"),
23245 /* 115 */ "ParseSchema" OpHelp(""),
23246 /* 116 */ "LoadAnalysis" OpHelp(""),
23247 /* 117 */ "DropTable" OpHelp(""),
23248 /* 118 */ "DropIndex" OpHelp(""),
23249 /* 119 */ "DropTrigger" OpHelp(""),
23250 /* 120 */ "IntegrityCk" OpHelp(""),
23251 /* 121 */ "RowSetAdd" OpHelp("rowset(P1)=r[P2]"),
23252 /* 122 */ "RowSetRead" OpHelp("r[P3]=rowset(P1)"),
23253 /* 123 */ "RowSetTest" OpHelp("if r[P3] in rowset(P1) goto P2"),
23254 /* 124 */ "Program" OpHelp(""),
23255 /* 125 */ "Param" OpHelp(""),
23256 /* 126 */ "FkCounter" OpHelp("fkctr[P1]+=P2"),
23257 /* 127 */ "FkIfZero" OpHelp("if fkctr[P1]==0 goto P2"),
23258 /* 128 */ "MemMax" OpHelp("r[P1]=max(r[P1],r[P2])"),
23259 /* 129 */ "IfPos" OpHelp("if r[P1]>0 goto P2"),
23260 /* 130 */ "IfNeg" OpHelp("if r[P1]<0 goto P2"),
23261 /* 131 */ "IfZero" OpHelp("r[P1]+=P3, if r[P1]==0 goto P2"),
23262 /* 132 */ "AggFinal" OpHelp("accum=r[P1] N=P2"),
23263 /* 133 */ "Real" OpHelp("r[P2]=P4"),
23264 /* 134 */ "IncrVacuum" OpHelp(""),
23265 /* 135 */ "Expire" OpHelp(""),
23266 /* 136 */ "TableLock" OpHelp("iDb=P1 root=P2 write=P3"),
23267 /* 137 */ "VBegin" OpHelp(""),
23268 /* 138 */ "VCreate" OpHelp(""),
23269 /* 139 */ "VDestroy" OpHelp(""),
23270 /* 140 */ "VOpen" OpHelp(""),
23271 /* 141 */ "VColumn" OpHelp("r[P3]=vcolumn(P2)"),
23272 /* 142 */ "VNext" OpHelp(""),
23273 /* 143 */ "ToText" OpHelp(""),
23274 /* 144 */ "ToBlob" OpHelp(""),
23275 /* 145 */ "ToNumeric" OpHelp(""),
23276 /* 146 */ "ToInt" OpHelp(""),
23277 /* 147 */ "ToReal" OpHelp(""),
23278 /* 148 */ "VRename" OpHelp(""),
23279 /* 149 */ "Pagecount" OpHelp(""),
23280 /* 150 */ "MaxPgcnt" OpHelp(""),
23281 /* 151 */ "Trace" OpHelp(""),
23282 /* 152 */ "Noop" OpHelp(""),
23283 /* 153 */ "Explain" OpHelp(""),
23284 };
23285 return azName[i];
23286 }
23287 #endif
23288
@@ -28306,14 +28343,14 @@
28343 ** Or, if the third argument is NULL, then this function is being called
28344 ** to inform the VFS layer that, according to POSIX, any existing mapping
28345 ** may now be invalid and should be unmapped.
28346 */
28347 static int unixUnfetch(sqlite3_file *fd, i64 iOff, void *p){
28348 #if SQLITE_MAX_MMAP_SIZE>0
28349 unixFile *pFd = (unixFile *)fd; /* The underlying database file */
28350 UNUSED_PARAMETER(iOff);
28351
 
28352 /* If p==0 (unmap the entire file) then there must be no outstanding
28353 ** xFetch references. Or, if p!=0 (meaning it is an xFetch reference),
28354 ** then there must be at least one outstanding. */
28355 assert( (p==0)==(pFd->nFetchOut==0) );
28356
@@ -28325,10 +28362,14 @@
28362 }else{
28363 unixUnmapfile(pFd);
28364 }
28365
28366 assert( pFd->nFetchOut>=0 );
28367 #else
28368 UNUSED_PARAMETER(fd);
28369 UNUSED_PARAMETER(p);
28370 UNUSED_PARAMETER(iOff);
28371 #endif
28372 return SQLITE_OK;
28373 }
28374
28375 /*
@@ -34366,11 +34407,11 @@
34407 sqlite3_mutex_enter(sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MASTER));
34408 }
34409 static void winShmLeaveMutex(void){
34410 sqlite3_mutex_leave(sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MASTER));
34411 }
34412 #ifndef NDEBUG
34413 static int winShmMutexHeld(void) {
34414 return sqlite3_mutex_held(sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MASTER));
34415 }
34416 #endif
34417
@@ -57919,18 +57960,20 @@
57960 ){
57961 MemPage *pPage;
57962 int rc;
57963 unsigned char *pCell;
57964 int i;
57965 int hdr;
57966
57967 assert( sqlite3_mutex_held(pBt->mutex) );
57968 if( pgno>btreePagecount(pBt) ){
57969 return SQLITE_CORRUPT_BKPT;
57970 }
57971
57972 rc = getAndInitPage(pBt, pgno, &pPage, 0);
57973 if( rc ) return rc;
57974 hdr = pPage->hdrOffset;
57975 for(i=0; i<pPage->nCell; i++){
57976 pCell = findCell(pPage, i);
57977 if( !pPage->leaf ){
57978 rc = clearDatabasePage(pBt, get4byte(pCell), 1, pnChange);
57979 if( rc ) goto cleardatabasepage_out;
@@ -57937,20 +57980,20 @@
57980 }
57981 rc = clearCell(pPage, pCell);
57982 if( rc ) goto cleardatabasepage_out;
57983 }
57984 if( !pPage->leaf ){
57985 rc = clearDatabasePage(pBt, get4byte(&pPage->aData[hdr+8]), 1, pnChange);
57986 if( rc ) goto cleardatabasepage_out;
57987 }else if( pnChange ){
57988 assert( pPage->intKey );
57989 *pnChange += pPage->nCell;
57990 }
57991 if( freePageFlag ){
57992 freePage(pPage, &rc);
57993 }else if( (rc = sqlite3PagerWrite(pPage->pDbPage))==0 ){
57994 zeroPage(pPage, pPage->aData[hdr] | PTF_LEAF);
57995 }
57996
57997 cleardatabasepage_out:
57998 releasePage(pPage);
57999 return rc;
@@ -61463,10 +61506,11 @@
61506 assert( v->magic==VDBE_MAGIC_INIT );
61507 assert( j<p->nLabel );
61508 if( j>=0 && p->aLabel ){
61509 p->aLabel[j] = v->nOp;
61510 }
61511 p->iFixedOp = v->nOp - 1;
61512 }
61513
61514 /*
61515 ** Mark the VDBE as one that can only be run one time.
61516 */
@@ -61811,11 +61855,12 @@
61855 /*
61856 ** Change the P2 operand of instruction addr so that it points to
61857 ** the address of the next instruction to be coded.
61858 */
61859 SQLITE_PRIVATE void sqlite3VdbeJumpHere(Vdbe *p, int addr){
61860 sqlite3VdbeChangeP2(p, addr, p->nOp);
61861 p->pParse->iFixedOp = p->nOp - 1;
61862 }
61863
61864
61865 /*
61866 ** If the input FuncDef structure is ephemeral, then free it. If
@@ -61916,12 +61961,17 @@
61961 }
61962
61963 /*
61964 ** Remove the last opcode inserted
61965 */
61966 SQLITE_PRIVATE int sqlite3VdbeDeletePriorOpcode(Vdbe *p, u8 op){
61967 if( (p->nOp-1)>(p->pParse->iFixedOp) && p->aOp[p->nOp-1].opcode==op ){
61968 sqlite3VdbeChangeToNoop(p, p->nOp-1);
61969 return 1;
61970 }else{
61971 return 0;
61972 }
61973 }
61974
61975 /*
61976 ** Change the value of the P4 operand for a specific instruction.
61977 ** This routine is useful when a large program is loaded from a
@@ -69688,10 +69738,37 @@
69738 }
69739 pCx->isOrdered = (pOp->p5!=BTREE_UNORDERED);
69740 break;
69741 }
69742
69743 #ifndef SQLITE_OMIT_CTE
69744 /* Opcode: SwapCursors P1 P2 * * *
69745 **
69746 ** Parameters P1 and P2 are both cursors opened by the OpenEphemeral
69747 ** opcode. This opcode deletes the contents of epheremal table P1,
69748 ** then renames P2 to P1 and P1 to P2. In other words, following this
69749 ** opcode cursor P2 is open on an empty table and P1 is open on the
69750 ** table that was initially accessed by P2.
69751 */
69752 case OP_SwapCursors: {
69753 Mem tmp;
69754 VdbeCursor *pTmp;
69755
69756 tmp = p->aMem[p->nMem - pOp->p1];
69757 p->aMem[p->nMem - pOp->p1] = p->aMem[p->nMem - pOp->p2];
69758 p->aMem[p->nMem - pOp->p2] = tmp;
69759
69760 pTmp = p->apCsr[pOp->p1];
69761 p->apCsr[pOp->p1] = p->apCsr[pOp->p2];
69762 p->apCsr[pOp->p2] = pTmp;
69763
69764 assert( pTmp->isTable );
69765 rc = sqlite3BtreeClearTable(pTmp->pBt, MASTER_ROOT, 0);
69766 break;
69767 }
69768 #endif /* ifndef SQLITE_OMIT_CTE */
69769
69770 /* Opcode: SorterOpen P1 * * P4 *
69771 **
69772 ** This opcode works like OP_OpenEphemeral except that it opens
69773 ** a transient index that is specifically designed to sort large
69774 ** tables using an external merge-sort algorithm.
@@ -74781,42 +74858,43 @@
74858 }
74859
74860 /*
74861 ** Call sqlite3WalkExpr() for every expression in Select statement p.
74862 ** Invoke sqlite3WalkSelect() for subqueries in the FROM clause and
74863 ** on the compound select chain, p->pPrior.
74864 **
74865 ** If it is not NULL, the xSelectCallback() callback is invoked before
74866 ** the walk of the expressions and FROM clause. The xSelectCallback2()
74867 ** method, if it is not NULL, is invoked following the walk of the
74868 ** expressions and FROM clause.
74869 **
74870 ** Return WRC_Continue under normal conditions. Return WRC_Abort if
74871 ** there is an abort request.
74872 **
74873 ** If the Walker does not have an xSelectCallback() then this routine
74874 ** is a no-op returning WRC_Continue.
74875 */
74876 SQLITE_PRIVATE int sqlite3WalkSelect(Walker *pWalker, Select *p){
74877 int rc;
74878 if( p==0 || (pWalker->xSelectCallback==0 && pWalker->xSelectCallback2==0) ){
74879 return WRC_Continue;
74880 }
74881 rc = WRC_Continue;
74882 pWalker->walkerDepth++;
74883 while( p ){
74884 if( pWalker->xSelectCallback ){
74885 rc = pWalker->xSelectCallback(pWalker, p);
74886 if( rc ) break;
74887 }
74888 if( sqlite3WalkSelectExpr(pWalker, p)
74889 || sqlite3WalkSelectFrom(pWalker, p)
74890 ){
74891 pWalker->walkerDepth--;
74892 return WRC_Abort;
74893 }
74894 if( pWalker->xSelectCallback2 ){
74895 pWalker->xSelectCallback2(pWalker, p);
 
 
 
 
74896 }
74897 p = p->pPrior;
74898 }
74899 pWalker->walkerDepth--;
74900 return rc & WRC_Abort;
@@ -77170,10 +77248,37 @@
77248 }
77249 }
77250 return pNew;
77251 }
77252
77253 /*
77254 ** Create and return a deep copy of the object passed as the second
77255 ** argument. If an OOM condition is encountered, NULL is returned
77256 ** and the db->mallocFailed flag set.
77257 */
77258 #ifndef SQLITE_OMIT_CTE
77259 static With *withDup(sqlite3 *db, With *p){
77260 With *pRet = 0;
77261 if( p ){
77262 int nByte = sizeof(*p) + sizeof(p->a[0]) * (p->nCte-1);
77263 pRet = sqlite3DbMallocZero(db, nByte);
77264 if( pRet ){
77265 int i;
77266 pRet->nCte = p->nCte;
77267 for(i=0; i<p->nCte; i++){
77268 pRet->a[i].pSelect = sqlite3SelectDup(db, p->a[i].pSelect, 0);
77269 pRet->a[i].pCols = sqlite3ExprListDup(db, p->a[i].pCols, 0);
77270 pRet->a[i].zName = sqlite3DbStrDup(db, p->a[i].zName);
77271 }
77272 }
77273 }
77274 return pRet;
77275 }
77276 #else
77277 # define withDup(x,y) 0
77278 #endif
77279
77280 /*
77281 ** The following group of routines make deep copies of expressions,
77282 ** expression lists, ID lists, and select statements. The copies can
77283 ** be deleted (by being passed to their respective ...Delete() routines)
77284 ** without effecting the originals.
@@ -77250,10 +77355,11 @@
77355 pNewItem->iCursor = pOldItem->iCursor;
77356 pNewItem->addrFillSub = pOldItem->addrFillSub;
77357 pNewItem->regReturn = pOldItem->regReturn;
77358 pNewItem->isCorrelated = pOldItem->isCorrelated;
77359 pNewItem->viaCoroutine = pOldItem->viaCoroutine;
77360 pNewItem->isRecursive = pOldItem->isRecursive;
77361 pNewItem->zIndex = sqlite3DbStrDup(db, pOldItem->zIndex);
77362 pNewItem->notIndexed = pOldItem->notIndexed;
77363 pNewItem->pIndex = pOldItem->pIndex;
77364 pTab = pNewItem->pTab = pOldItem->pTab;
77365 if( pTab ){
@@ -77311,10 +77417,11 @@
77417 pNew->selFlags = p->selFlags & ~SF_UsesEphemeral;
77418 pNew->pRightmost = 0;
77419 pNew->addrOpenEphm[0] = -1;
77420 pNew->addrOpenEphm[1] = -1;
77421 pNew->addrOpenEphm[2] = -1;
77422 pNew->pWith = withDup(db, p->pWith);
77423 return pNew;
77424 }
77425 #else
77426 SQLITE_PRIVATE Select *sqlite3SelectDup(sqlite3 *db, Select *p, int flags){
77427 assert( p==0 );
@@ -77830,13 +77937,15 @@
77937 pTab = p->pSrc->a[0].pTab;
77938 pExpr = p->pEList->a[0].pExpr;
77939 iCol = (i16)pExpr->iColumn;
77940
77941 /* Code an OP_VerifyCookie and OP_TableLock for <table>. */
77942 if( ALWAYS(pTab->pSchema) ){
77943 iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
77944 sqlite3CodeVerifySchema(pParse, iDb);
77945 sqlite3TableLock(pParse, iDb, pTab->tnum, 0, pTab->zName);
77946 }
77947
77948 /* This function is only called from two places. In both cases the vdbe
77949 ** has already been allocated. So assume sqlite3GetVdbe() is always
77950 ** successful here.
77951 */
@@ -79663,11 +79772,11 @@
79772 sqlite3ExplainPush(pOut);
79773 for(i=0; i<pList->nExpr; i++){
79774 sqlite3ExplainPrintf(pOut, "item[%d] = ", i);
79775 sqlite3ExplainPush(pOut);
79776 sqlite3ExplainExpr(pOut, pList->a[i].pExpr);
79777 sqlite3ExplainPop(pOut);
79778 if( pList->a[i].zName ){
79779 sqlite3ExplainPrintf(pOut, " AS %s", pList->a[i].zName);
79780 }
79781 if( pList->a[i].bSpanIsTab ){
79782 sqlite3ExplainPrintf(pOut, " (%s)", pList->a[i].zSpan);
@@ -84091,10 +84200,11 @@
84200 */
84201 v = sqlite3GetVdbe(pParse);
84202 assert( !pParse->isMultiWrite
84203 || sqlite3VdbeAssertMayAbort(v, pParse->mayAbort));
84204 if( v ){
84205 while( sqlite3VdbeDeletePriorOpcode(v, OP_Close) ){}
84206 sqlite3VdbeAddOp0(v, OP_Halt);
84207
84208 /* The cookie mask contains one bit for each database file open.
84209 ** (Bit 0 is for main, bit 1 is for temp, and so forth.) Bits are
84210 ** set for each database that is used. Generate code to start a
@@ -85402,14 +85512,14 @@
85512 i = *pIdx;
85513
85514 for(j=0; zIdent[j]; j++){
85515 if( !sqlite3Isalnum(zIdent[j]) && zIdent[j]!='_' ) break;
85516 }
85517 needQuote = sqlite3Isdigit(zIdent[0])
85518 || sqlite3KeywordCode(zIdent, j)!=TK_ID
85519 || zIdent[j]!=0
85520 || j==0;
85521
85522 if( needQuote ) z[i++] = '"';
85523 for(j=0; zIdent[j]; j++){
85524 z[i++] = zIdent[j];
85525 if( zIdent[j]=='"' ) z[i++] = '"';
@@ -86628,11 +86738,11 @@
86738 ** records into the sorter. */
86739 sqlite3OpenTable(pParse, iTab, iDb, pTab, OP_OpenRead);
86740 addr1 = sqlite3VdbeAddOp2(v, OP_Rewind, iTab, 0);
86741 regRecord = sqlite3GetTempReg(pParse);
86742
86743 sqlite3GenerateIndexKey(pParse,pIndex,iTab,regRecord,0,&iPartIdxLabel,0,0);
86744 sqlite3VdbeAddOp2(v, OP_SorterInsert, iSorter, regRecord);
86745 sqlite3VdbeResolveLabel(v, iPartIdxLabel);
86746 sqlite3VdbeAddOp2(v, OP_Next, iTab, addr1+1);
86747 sqlite3VdbeJumpHere(v, addr1);
86748 if( memRootPage<0 ) sqlite3VdbeAddOp2(v, OP_Clear, tnum, iDb);
@@ -88149,10 +88259,80 @@
88259 }
88260 }
88261 return sqlite3KeyInfoRef(pIdx->pKeyInfo);
88262 }
88263
88264 #ifndef SQLITE_OMIT_CTE
88265 /*
88266 ** This routine is invoked once per CTE by the parser while parsing a
88267 ** WITH clause.
88268 */
88269 SQLITE_PRIVATE With *sqlite3WithAdd(
88270 Parse *pParse, /* Parsing context */
88271 With *pWith, /* Existing WITH clause, or NULL */
88272 Token *pName, /* Name of the common-table */
88273 ExprList *pArglist, /* Optional column name list for the table */
88274 Select *pQuery /* Query used to initialize the table */
88275 ){
88276 sqlite3 *db = pParse->db;
88277 With *pNew;
88278 char *zName;
88279
88280 /* Check that the CTE name is unique within this WITH clause. If
88281 ** not, store an error in the Parse structure. */
88282 zName = sqlite3NameFromToken(pParse->db, pName);
88283 if( zName && pWith ){
88284 int i;
88285 for(i=0; i<pWith->nCte; i++){
88286 if( sqlite3StrICmp(zName, pWith->a[i].zName)==0 ){
88287 sqlite3ErrorMsg(pParse, "duplicate WITH table name: %s", zName);
88288 }
88289 }
88290 }
88291
88292 if( pWith ){
88293 int nByte = sizeof(*pWith) + (sizeof(pWith->a[1]) * pWith->nCte);
88294 pNew = sqlite3DbRealloc(db, pWith, nByte);
88295 }else{
88296 pNew = sqlite3DbMallocZero(db, sizeof(*pWith));
88297 }
88298 assert( zName!=0 || pNew==0 );
88299 assert( db->mallocFailed==0 || pNew==0 );
88300
88301 if( pNew==0 ){
88302 sqlite3ExprListDelete(db, pArglist);
88303 sqlite3SelectDelete(db, pQuery);
88304 sqlite3DbFree(db, zName);
88305 pNew = pWith;
88306 }else{
88307 pNew->a[pNew->nCte].pSelect = pQuery;
88308 pNew->a[pNew->nCte].pCols = pArglist;
88309 pNew->a[pNew->nCte].zName = zName;
88310 pNew->a[pNew->nCte].zErr = 0;
88311 pNew->nCte++;
88312 }
88313
88314 return pNew;
88315 }
88316
88317 /*
88318 ** Free the contents of the With object passed as the second argument.
88319 */
88320 SQLITE_PRIVATE void sqlite3WithDelete(sqlite3 *db, With *pWith){
88321 if( pWith ){
88322 int i;
88323 for(i=0; i<pWith->nCte; i++){
88324 struct Cte *pCte = &pWith->a[i];
88325 sqlite3ExprListDelete(db, pCte->pCols);
88326 sqlite3SelectDelete(db, pCte->pSelect);
88327 sqlite3DbFree(db, pCte->zName);
88328 }
88329 sqlite3DbFree(db, pWith);
88330 }
88331 }
88332 #endif /* !defined(SQLITE_OMIT_CTE) */
88333
88334 /************** End of build.c ***********************************************/
88335 /************** Begin file callback.c ****************************************/
88336 /*
88337 ** 2005 May 23
88338 **
@@ -89347,13 +89527,14 @@
89527 int iDataCur, /* Cursor of table holding data. */
89528 int iIdxCur, /* First index cursor */
89529 int *aRegIdx /* Only delete if aRegIdx!=0 && aRegIdx[i]>0 */
89530 ){
89531 int i; /* Index loop counter */
89532 int r1 = -1; /* Register holding an index key */
89533 int iPartIdxLabel; /* Jump destination for skipping partial index entries */
89534 Index *pIdx; /* Current index */
89535 Index *pPrior = 0; /* Prior index */
89536 Vdbe *v; /* The prepared statement under construction */
89537 Index *pPk; /* PRIMARY KEY index, or NULL for rowid tables */
89538
89539 v = pParse->pVdbe;
89540 pPk = HasRowid(pTab) ? 0 : sqlite3PrimaryKeyIndex(pTab);
@@ -89360,14 +89541,16 @@
89541 for(i=0, pIdx=pTab->pIndex; pIdx; i++, pIdx=pIdx->pNext){
89542 assert( iIdxCur+i!=iDataCur || pPk==pIdx );
89543 if( aRegIdx!=0 && aRegIdx[i]==0 ) continue;
89544 if( pIdx==pPk ) continue;
89545 VdbeModuleComment((v, "GenRowIdxDel for %s", pIdx->zName));
89546 r1 = sqlite3GenerateIndexKey(pParse, pIdx, iDataCur, 0, 1,
89547 &iPartIdxLabel, pPrior, r1);
89548 sqlite3VdbeAddOp3(v, OP_IdxDelete, iIdxCur+i, r1,
89549 pIdx->uniqNotNull ? pIdx->nKeyCol : pIdx->nColumn);
89550 sqlite3VdbeResolveLabel(v, iPartIdxLabel);
89551 pPrior = pIdx;
89552 }
89553 }
89554
89555 /*
89556 ** Generate code that will assemble an index key and stores it in register
@@ -89385,18 +89568,31 @@
89568 ** to that label if pIdx is a partial index that should be skipped.
89569 ** A partial index should be skipped if its WHERE clause evaluates
89570 ** to false or null. If pIdx is not a partial index, *piPartIdxLabel
89571 ** will be set to zero which is an empty label that is ignored by
89572 ** sqlite3VdbeResolveLabel().
89573 **
89574 ** The pPrior and regPrior parameters are used to implement a cache to
89575 ** avoid unnecessary register loads. If pPrior is not NULL, then it is
89576 ** a pointer to a different index for which an index key has just been
89577 ** computed into register regPrior. If the current pIdx index is generating
89578 ** its key into the same sequence of registers and if pPrior and pIdx share
89579 ** a column in common, then the register corresponding to that column already
89580 ** holds the correct value and the loading of that register is skipped.
89581 ** This optimization is helpful when doing a DELETE or an INTEGRITY_CHECK
89582 ** on a table with multiple indices, and especially with the ROWID or
89583 ** PRIMARY KEY columns of the index.
89584 */
89585 SQLITE_PRIVATE int sqlite3GenerateIndexKey(
89586 Parse *pParse, /* Parsing context */
89587 Index *pIdx, /* The index for which to generate a key */
89588 int iDataCur, /* Cursor number from which to take column data */
89589 int regOut, /* Put the new key into this register if not 0 */
89590 int prefixOnly, /* Compute only a unique prefix of the key */
89591 int *piPartIdxLabel, /* OUT: Jump to this label to skip partial index */
89592 Index *pPrior, /* Previously generated index key */
89593 int regPrior /* Register holding previous generated key */
89594 ){
89595 Vdbe *v = pParse->pVdbe;
89596 int j;
89597 Table *pTab = pIdx->pTable;
89598 int regBase;
@@ -89412,22 +89608,22 @@
89608 *piPartIdxLabel = 0;
89609 }
89610 }
89611 nCol = (prefixOnly && pIdx->uniqNotNull) ? pIdx->nKeyCol : pIdx->nColumn;
89612 regBase = sqlite3GetTempRange(pParse, nCol);
89613 if( pPrior && (regBase!=regPrior || pPrior->pPartIdxWhere) ) pPrior = 0;
89614 for(j=0; j<nCol; j++){
89615 if( pPrior && pPrior->aiColumn[j]==pIdx->aiColumn[j] ) continue;
89616 sqlite3ExprCodeGetColumnOfTable(v, pTab, iDataCur, pIdx->aiColumn[j],
89617 regBase+j);
89618 /* If the column affinity is REAL but the number is an integer, then it
89619 ** might be stored in the table as an integer (using a compact
89620 ** representation) then converted to REAL by an OP_RealAffinity opcode.
89621 ** But we are getting ready to store this value back into an index, where
89622 ** it should be converted by to INTEGER again. So omit the OP_RealAffinity
89623 ** opcode if it is present */
89624 sqlite3VdbeDeletePriorOpcode(v, OP_RealAffinity);
 
 
89625 }
89626 if( regOut ){
89627 sqlite3VdbeAddOp3(v, OP_MakeRecord, regBase, nCol, regOut);
89628 }
89629 sqlite3ReleaseTempRange(pParse, regBase, nCol);
@@ -93086,11 +93282,10 @@
93282 ** D: cleanup
93283 */
93284 SQLITE_PRIVATE void sqlite3Insert(
93285 Parse *pParse, /* Parser context */
93286 SrcList *pTabList, /* Name of table into which we are inserting */
 
93287 Select *pSelect, /* A SELECT statement to use as the data source */
93288 IdList *pColumn, /* Column names corresponding to IDLIST. */
93289 int onError /* How to handle constraint errors */
93290 ){
93291 sqlite3 *db; /* The main database structure */
@@ -93114,10 +93309,11 @@
93309 SelectDest dest; /* Destination for SELECT on rhs of INSERT */
93310 int iDb; /* Index of database holding TABLE */
93311 Db *pDb; /* The database containing table being inserted into */
93312 int appendFlag = 0; /* True if the insert is likely to be an append */
93313 int withoutRowid; /* 0 for normal table. 1 for WITHOUT ROWID table */
93314 ExprList *pList = 0; /* List of VALUES() to be inserted */
93315
93316 /* Register allocations */
93317 int regFromSelect = 0;/* Base register for data coming from SELECT */
93318 int regAutoinc = 0; /* Register holding the AUTOINCREMENT counter */
93319 int regRowCount = 0; /* Memory cell used for the row counter */
@@ -93136,10 +93332,21 @@
93332 db = pParse->db;
93333 memset(&dest, 0, sizeof(dest));
93334 if( pParse->nErr || db->mallocFailed ){
93335 goto insert_cleanup;
93336 }
93337
93338 /* If the Select object is really just a simple VALUES() list with a
93339 ** single row values (the common case) then keep that one row of values
93340 ** and go ahead and discard the Select object
93341 */
93342 if( pSelect && (pSelect->selFlags & SF_Values)!=0 && pSelect->pPrior==0 ){
93343 pList = pSelect->pEList;
93344 pSelect->pEList = 0;
93345 sqlite3SelectDelete(db, pSelect);
93346 pSelect = 0;
93347 }
93348
93349 /* Locate the table into which we will be inserting new information.
93350 */
93351 assert( pTabList->nSrc==1 );
93352 zTab = pTabList->a[0].zName;
@@ -94392,10 +94599,16 @@
94599 int destHasUniqueIdx = 0; /* True if pDest has a UNIQUE index */
94600 int regData, regRowid; /* Registers holding data and rowid */
94601
94602 if( pSelect==0 ){
94603 return 0; /* Must be of the form INSERT INTO ... SELECT ... */
94604 }
94605 if( pParse->pWith || pSelect->pWith ){
94606 /* Do not attempt to process this query if there are an WITH clauses
94607 ** attached to it. Proceeding may generate a false "no such table: xxx"
94608 ** error if pSelect reads from a CTE named "xxx". */
94609 return 0;
94610 }
94611 if( sqlite3TriggerList(pParse, pDest) ){
94612 return 0; /* tab1 must not have triggers */
94613 }
94614 #ifndef SQLITE_OMIT_VIRTUALTABLE
@@ -97891,12 +98104,14 @@
98104 /* Make sure all the indices are constructed correctly.
98105 */
98106 for(x=sqliteHashFirst(pTbls); x && !isQuick; x=sqliteHashNext(x)){
98107 Table *pTab = sqliteHashData(x);
98108 Index *pIdx, *pPk;
98109 Index *pPrior = 0;
98110 int loopTop;
98111 int iDataCur, iIdxCur;
98112 int r1 = -1;
98113
98114 if( pTab->pIndex==0 ) continue;
98115 pPk = HasRowid(pTab) ? 0 : sqlite3PrimaryKeyIndex(pTab);
98116 addr = sqlite3VdbeAddOp1(v, OP_IfPos, 1); /* Stop if out of errors */
98117 sqlite3VdbeAddOp2(v, OP_Halt, 0, 0);
@@ -97911,13 +98126,14 @@
98126 pParse->nMem = MAX(pParse->nMem, 8+j);
98127 sqlite3VdbeAddOp2(v, OP_Rewind, iDataCur, 0);
98128 loopTop = sqlite3VdbeAddOp2(v, OP_AddImm, 7, 1);
98129 for(j=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, j++){
98130 int jmp2, jmp3, jmp4;
 
98131 if( pPk==pIdx ) continue;
98132 r1 = sqlite3GenerateIndexKey(pParse, pIdx, iDataCur, 0, 0, &jmp3,
98133 pPrior, r1);
98134 pPrior = pIdx;
98135 sqlite3VdbeAddOp2(v, OP_AddImm, 8+j, 1); /* increment entry count */
98136 jmp2 = sqlite3VdbeAddOp4Int(v, OP_Found, iIdxCur+j, 0, r1,
98137 pIdx->nColumn);
98138 sqlite3VdbeAddOp2(v, OP_AddImm, 1, -1); /* Decrement error limit */
98139 sqlite3VdbeAddOp4(v, OP_String8, 0, 3, 0, "row ", P4_STATIC);
@@ -99229,10 +99445,11 @@
99445 sqlite3ExprDelete(db, p->pHaving);
99446 sqlite3ExprListDelete(db, p->pOrderBy);
99447 sqlite3SelectDelete(db, p->pPrior);
99448 sqlite3ExprDelete(db, p->pLimit);
99449 sqlite3ExprDelete(db, p->pOffset);
99450 sqlite3WithDelete(db, p->pWith);
99451 }
99452
99453 /*
99454 ** Initialize a SelectDest structure.
99455 */
@@ -99890,16 +100107,30 @@
100107 }
100108 #endif
100109
100110 /* Store the result as data using a unique key.
100111 */
100112 case SRT_DistTable:
100113 case SRT_Table:
100114 case SRT_EphemTab: {
100115 int r1 = sqlite3GetTempReg(pParse);
100116 testcase( eDest==SRT_Table );
100117 testcase( eDest==SRT_EphemTab );
100118 sqlite3VdbeAddOp3(v, OP_MakeRecord, regResult, nColumn, r1);
100119 #ifndef SQLITE_OMIT_CTE
100120 if( eDest==SRT_DistTable ){
100121 /* If the destination is DistTable, then cursor (iParm+1) is open
100122 ** on an ephemeral index. If the current row is already present
100123 ** in the index, do not write it to the output. If not, add the
100124 ** current row to the index and proceed with writing it to the
100125 ** output table as well. */
100126 int addr = sqlite3VdbeCurrentAddr(v) + 4;
100127 sqlite3VdbeAddOp4Int(v, OP_Found, iParm+1, addr, r1, 0);
100128 sqlite3VdbeAddOp2(v, OP_IdxInsert, iParm+1, r1);
100129 assert( pOrderBy==0 );
100130 }
100131 #endif
100132 if( pOrderBy ){
100133 pushOntoSorter(pParse, pOrderBy, p, r1);
100134 }else{
100135 int r2 = sqlite3GetTempReg(pParse);
100136 sqlite3VdbeAddOp2(v, OP_NewRowid, iParm, r2);
@@ -100402,11 +100633,11 @@
100633 sNC.pSrcList = pS->pSrc;
100634 sNC.pNext = pNC;
100635 sNC.pParse = pNC->pParse;
100636 zType = columnType(&sNC, p,&zOrigDb,&zOrigTab,&zOrigCol, &estWidth);
100637 }
100638 }else if( pTab->pSchema ){
100639 /* A real table */
100640 assert( !pS );
100641 if( iCol<0 ) iCol = pTab->iPKey;
100642 assert( iCol==-1 || (iCol>=0 && iCol<pTab->nCol) );
100643 #ifdef SQLITE_ENABLE_COLUMN_METADATA
@@ -100563,12 +100794,13 @@
100794 sqlite3VdbeSetColName(v, i, COLNAME_NAME, zName, SQLITE_DYNAMIC);
100795 }else{
100796 sqlite3VdbeSetColName(v, i, COLNAME_NAME, zCol, SQLITE_TRANSIENT);
100797 }
100798 }else{
100799 const char *z = pEList->a[i].zSpan;
100800 z = z==0 ? sqlite3MPrintf(db, "column%d", i+1) : sqlite3DbStrDup(db, z);
100801 sqlite3VdbeSetColName(v, i, COLNAME_NAME, z, SQLITE_DYNAMIC);
100802 }
100803 }
100804 generateColumnTypes(pParse, pTabList, pEList);
100805 }
100806
@@ -100928,10 +101160,11 @@
101160
101161 /* Make sure there is no ORDER BY or LIMIT clause on prior SELECTs. Only
101162 ** the last (right-most) SELECT in the series may have an ORDER BY or LIMIT.
101163 */
101164 assert( p && p->pPrior ); /* Calling function guarantees this much */
101165 assert( (p->selFlags & SF_Recursive)==0 || p->op==TK_ALL || p->op==TK_UNION );
101166 db = pParse->db;
101167 pPrior = p->pPrior;
101168 assert( pPrior->pRightmost!=pPrior );
101169 assert( pPrior->pRightmost==p->pRightmost );
101170 dest = *pDest;
@@ -100972,16 +101205,96 @@
101205 " do not have the same number of result columns", selectOpName(p->op));
101206 }
101207 rc = 1;
101208 goto multi_select_end;
101209 }
101210
101211 #ifndef SQLITE_OMIT_CTE
101212 if( p->selFlags & SF_Recursive ){
101213 SrcList *pSrc = p->pSrc;
101214 int nCol = p->pEList->nExpr;
101215 int addrNext;
101216 int addrSwap;
101217 int iCont, iBreak;
101218 int tmp1; /* Intermediate table */
101219 int tmp2; /* Next intermediate table */
101220 int tmp3 = 0; /* To ensure unique results if UNION */
101221 int eDest = SRT_Table;
101222 SelectDest tmp2dest;
101223 int i;
101224
101225 /* Check that there is no ORDER BY or LIMIT clause. Neither of these
101226 ** are supported on recursive queries. */
101227 assert( p->pOffset==0 || p->pLimit );
101228 if( p->pOrderBy || p->pLimit ){
101229 sqlite3ErrorMsg(pParse, "%s in a recursive query",
101230 p->pOrderBy ? "ORDER BY" : "LIMIT"
101231 );
101232 goto multi_select_end;
101233 }
101234
101235 if( sqlite3AuthCheck(pParse, SQLITE_RECURSIVE, 0, 0, 0) ){
101236 goto multi_select_end;
101237 }
101238 iBreak = sqlite3VdbeMakeLabel(v);
101239 iCont = sqlite3VdbeMakeLabel(v);
101240
101241 for(i=0; ALWAYS(i<pSrc->nSrc); i++){
101242 if( pSrc->a[i].isRecursive ){
101243 tmp1 = pSrc->a[i].iCursor;
101244 break;
101245 }
101246 }
101247
101248 tmp2 = pParse->nTab++;
101249 if( p->op==TK_UNION ){
101250 eDest = SRT_DistTable;
101251 tmp3 = pParse->nTab++;
101252 }
101253 sqlite3SelectDestInit(&tmp2dest, eDest, tmp2);
101254
101255 sqlite3VdbeAddOp2(v, OP_OpenEphemeral, tmp1, nCol);
101256 sqlite3VdbeAddOp2(v, OP_OpenEphemeral, tmp2, nCol);
101257 if( tmp3 ){
101258 p->addrOpenEphm[0] = sqlite3VdbeAddOp2(v, OP_OpenEphemeral, tmp3, 0);
101259 p->selFlags |= SF_UsesEphemeral;
101260 }
101261
101262 /* Store the results of the initial SELECT in tmp2. */
101263 rc = sqlite3Select(pParse, pPrior, &tmp2dest);
101264 if( rc ) goto multi_select_end;
101265
101266 /* Clear tmp1. Then switch the contents of tmp1 and tmp2. Then return
101267 ** the contents of tmp1 to the caller. Or, if tmp1 is empty at this
101268 ** point, the recursive query has finished - jump to address iBreak. */
101269 addrSwap = sqlite3VdbeAddOp2(v, OP_SwapCursors, tmp1, tmp2);
101270 sqlite3VdbeAddOp2(v, OP_Rewind, tmp1, iBreak);
101271 addrNext = sqlite3VdbeCurrentAddr(v);
101272 selectInnerLoop(pParse, p, p->pEList, tmp1, p->pEList->nExpr,
101273 0, 0, &dest, iCont, iBreak);
101274 sqlite3VdbeResolveLabel(v, iCont);
101275 sqlite3VdbeAddOp2(v, OP_Next, tmp1, addrNext);
101276
101277 /* Execute the recursive SELECT. Store the results in tmp2. While this
101278 ** SELECT is running, the contents of tmp1 are read by recursive
101279 ** references to the current CTE. */
101280 p->pPrior = 0;
101281 rc = sqlite3Select(pParse, p, &tmp2dest);
101282 assert( p->pPrior==0 );
101283 p->pPrior = pPrior;
101284 if( rc ) goto multi_select_end;
101285
101286 sqlite3VdbeAddOp2(v, OP_Goto, 0, addrSwap);
101287 sqlite3VdbeResolveLabel(v, iBreak);
101288 }else
101289 #endif
101290
101291 /* Compound SELECTs that have an ORDER BY clause are handled separately.
101292 */
101293 if( p->pOrderBy ){
101294 return multiSelectOrderBy(pParse, p, pDest);
101295 }else
101296
101297 /* Generate code for the left and right SELECT statements.
101298 */
101299 switch( p->op ){
101300 case TK_ALL: {
@@ -102040,10 +102353,18 @@
102353 ** appear as unmodified result columns in the outer query. But we
102354 ** have other optimizations in mind to deal with that case.
102355 **
102356 ** (21) The subquery does not use LIMIT or the outer query is not
102357 ** DISTINCT. (See ticket [752e1646fc]).
102358 **
102359 ** (22) The subquery is not a recursive CTE.
102360 **
102361 ** (23) The parent is not a recursive CTE, or the sub-query is not a
102362 ** compound query. This restriction is because transforming the
102363 ** parent to a compound query confuses the code that handles
102364 ** recursive queries in multiSelect().
102365 **
102366 **
102367 ** In this routine, the "p" parameter is a pointer to the outer query.
102368 ** The subquery is p->pSrc->a[iFrom]. isAgg is true if the outer query
102369 ** uses aggregates and subqueryIsAgg is true if the subquery uses aggregates.
102370 **
@@ -102112,10 +102433,12 @@
102433 if( isAgg && pSub->pOrderBy ) return 0; /* Restriction (16) */
102434 if( pSub->pLimit && p->pWhere ) return 0; /* Restriction (19) */
102435 if( pSub->pLimit && (p->selFlags & SF_Distinct)!=0 ){
102436 return 0; /* Restriction (21) */
102437 }
102438 if( pSub->selFlags & SF_Recursive ) return 0; /* Restriction (22) */
102439 if( (p->selFlags & SF_Recursive) && pSub->pPrior ) return 0; /* (23) */
102440
102441 /* OBSOLETE COMMENT 1:
102442 ** Restriction 3: If the subquery is a join, make sure the subquery is
102443 ** not used as the right operand of an outer join. Examples of why this
102444 ** is not allowed:
@@ -102593,10 +102916,200 @@
102916 pNew->pLimit = 0;
102917 pNew->pOffset = 0;
102918 return WRC_Continue;
102919 }
102920
102921 #ifndef SQLITE_OMIT_CTE
102922 /*
102923 ** Argument pWith (which may be NULL) points to a linked list of nested
102924 ** WITH contexts, from inner to outermost. If the table identified by
102925 ** FROM clause element pItem is really a common-table-expression (CTE)
102926 ** then return a pointer to the CTE definition for that table. Otherwise
102927 ** return NULL.
102928 **
102929 ** If a non-NULL value is returned, set *ppContext to point to the With
102930 ** object that the returned CTE belongs to.
102931 */
102932 static struct Cte *searchWith(
102933 With *pWith, /* Current outermost WITH clause */
102934 struct SrcList_item *pItem, /* FROM clause element to resolve */
102935 With **ppContext /* OUT: WITH clause return value belongs to */
102936 ){
102937 const char *zName;
102938 if( pItem->zDatabase==0 && (zName = pItem->zName)!=0 ){
102939 With *p;
102940 for(p=pWith; p; p=p->pOuter){
102941 int i;
102942 for(i=0; i<p->nCte; i++){
102943 if( sqlite3StrICmp(zName, p->a[i].zName)==0 ){
102944 *ppContext = p;
102945 return &p->a[i];
102946 }
102947 }
102948 }
102949 }
102950 return 0;
102951 }
102952
102953 /* The code generator maintains a stack of active WITH clauses
102954 ** with the inner-most WITH clause being at the top of the stack.
102955 **
102956 ** This routine pushes the WITH clause passed as the second argument
102957 ** onto the top of the stack. If argument bFree is true, then this
102958 ** WITH clause will never be popped from the stack. In this case it
102959 ** should be freed along with the Parse object. In other cases, when
102960 ** bFree==0, the With object will be freed along with the SELECT
102961 ** statement with which it is associated.
102962 */
102963 SQLITE_PRIVATE void sqlite3WithPush(Parse *pParse, With *pWith, u8 bFree){
102964 assert( bFree==0 || pParse->pWith==0 );
102965 if( pWith ){
102966 pWith->pOuter = pParse->pWith;
102967 pParse->pWith = pWith;
102968 pParse->bFreeWith = bFree;
102969 }
102970 }
102971
102972 /*
102973 ** This function checks if argument pFrom refers to a CTE declared by
102974 ** a WITH clause on the stack currently maintained by the parser. And,
102975 ** if currently processing a CTE expression, if it is a recursive
102976 ** reference to the current CTE.
102977 **
102978 ** If pFrom falls into either of the two categories above, pFrom->pTab
102979 ** and other fields are populated accordingly. The caller should check
102980 ** (pFrom->pTab!=0) to determine whether or not a successful match
102981 ** was found.
102982 **
102983 ** Whether or not a match is found, SQLITE_OK is returned if no error
102984 ** occurs. If an error does occur, an error message is stored in the
102985 ** parser and some error code other than SQLITE_OK returned.
102986 */
102987 static int withExpand(
102988 Walker *pWalker,
102989 struct SrcList_item *pFrom
102990 ){
102991 Parse *pParse = pWalker->pParse;
102992 sqlite3 *db = pParse->db;
102993 struct Cte *pCte; /* Matched CTE (or NULL if no match) */
102994 With *pWith; /* WITH clause that pCte belongs to */
102995
102996 assert( pFrom->pTab==0 );
102997
102998 pCte = searchWith(pParse->pWith, pFrom, &pWith);
102999 if( pCte ){
103000 Table *pTab;
103001 ExprList *pEList;
103002 Select *pSel;
103003 Select *pLeft; /* Left-most SELECT statement */
103004 int bMayRecursive; /* True if compound joined by UNION [ALL] */
103005 With *pSavedWith; /* Initial value of pParse->pWith */
103006
103007 /* If pCte->zErr is non-NULL at this point, then this is an illegal
103008 ** recursive reference to CTE pCte. Leave an error in pParse and return
103009 ** early. If pCte->zErr is NULL, then this is not a recursive reference.
103010 ** In this case, proceed. */
103011 if( pCte->zErr ){
103012 sqlite3ErrorMsg(pParse, pCte->zErr, pCte->zName);
103013 return SQLITE_ERROR;
103014 }
103015
103016 pFrom->pTab = pTab = sqlite3DbMallocZero(db, sizeof(Table));
103017 if( pTab==0 ) return WRC_Abort;
103018 pTab->nRef = 1;
103019 pTab->zName = sqlite3DbStrDup(db, pCte->zName);
103020 pTab->iPKey = -1;
103021 pTab->nRowEst = 1048576;
103022 pTab->tabFlags |= TF_Ephemeral;
103023 pFrom->pSelect = sqlite3SelectDup(db, pCte->pSelect, 0);
103024 if( db->mallocFailed ) return SQLITE_NOMEM;
103025 assert( pFrom->pSelect );
103026
103027 /* Check if this is a recursive CTE. */
103028 pSel = pFrom->pSelect;
103029 bMayRecursive = ( pSel->op==TK_ALL || pSel->op==TK_UNION );
103030 if( bMayRecursive ){
103031 int i;
103032 SrcList *pSrc = pFrom->pSelect->pSrc;
103033 for(i=0; i<pSrc->nSrc; i++){
103034 struct SrcList_item *pItem = &pSrc->a[i];
103035 if( pItem->zDatabase==0
103036 && pItem->zName!=0
103037 && 0==sqlite3StrICmp(pItem->zName, pCte->zName)
103038 ){
103039 pItem->pTab = pTab;
103040 pItem->isRecursive = 1;
103041 pTab->nRef++;
103042 pSel->selFlags |= SF_Recursive;
103043 }
103044 }
103045 }
103046
103047 /* Only one recursive reference is permitted. */
103048 if( pTab->nRef>2 ){
103049 sqlite3ErrorMsg(
103050 pParse, "multiple references to recursive table: %s", pCte->zName
103051 );
103052 return SQLITE_ERROR;
103053 }
103054 assert( pTab->nRef==1 || ((pSel->selFlags&SF_Recursive) && pTab->nRef==2 ));
103055
103056 pCte->zErr = "circular reference: %s";
103057 pSavedWith = pParse->pWith;
103058 pParse->pWith = pWith;
103059 sqlite3WalkSelect(pWalker, bMayRecursive ? pSel->pPrior : pSel);
103060
103061 for(pLeft=pSel; pLeft->pPrior; pLeft=pLeft->pPrior);
103062 pEList = pLeft->pEList;
103063 if( pCte->pCols ){
103064 if( pEList->nExpr!=pCte->pCols->nExpr ){
103065 sqlite3ErrorMsg(pParse, "table %s has %d values for %d columns",
103066 pCte->zName, pEList->nExpr, pCte->pCols->nExpr
103067 );
103068 pParse->pWith = pSavedWith;
103069 return SQLITE_ERROR;
103070 }
103071 pEList = pCte->pCols;
103072 }
103073
103074 selectColumnsFromExprList(pParse, pEList, &pTab->nCol, &pTab->aCol);
103075 if( bMayRecursive ){
103076 if( pSel->selFlags & SF_Recursive ){
103077 pCte->zErr = "multiple recursive references: %s";
103078 }else{
103079 pCte->zErr = "recursive reference in a subquery: %s";
103080 }
103081 sqlite3WalkSelect(pWalker, pSel);
103082 }
103083 pCte->zErr = 0;
103084 pParse->pWith = pSavedWith;
103085 }
103086
103087 return SQLITE_OK;
103088 }
103089 #endif
103090
103091 #ifndef SQLITE_OMIT_CTE
103092 /*
103093 ** If the SELECT passed as the second argument has an associated WITH
103094 ** clause, pop it from the stack stored as part of the Parse object.
103095 **
103096 ** This function is used as the xSelectCallback2() callback by
103097 ** sqlite3SelectExpand() when walking a SELECT tree to resolve table
103098 ** names and other FROM clause elements.
103099 */
103100 static void selectPopWith(Walker *pWalker, Select *p){
103101 Parse *pParse = pWalker->pParse;
103102 if( p->pWith ){
103103 assert( pParse->pWith==p->pWith );
103104 pParse->pWith = p->pWith->pOuter;
103105 }
103106 }
103107 #else
103108 #define selectPopWith 0
103109 #endif
103110
103111 /*
103112 ** This routine is a Walker callback for "expanding" a SELECT statement.
103113 ** "Expanding" means to do the following:
103114 **
103115 ** (1) Make sure VDBE cursor numbers have been assigned to every
@@ -102636,10 +103149,11 @@
103149 if( NEVER(p->pSrc==0) || (selFlags & SF_Expanded)!=0 ){
103150 return WRC_Prune;
103151 }
103152 pTabList = p->pSrc;
103153 pEList = p->pEList;
103154 sqlite3WithPush(pParse, p->pWith, 0);
103155
103156 /* Make sure cursor numbers have been assigned to all entries in
103157 ** the FROM clause of the SELECT statement.
103158 */
103159 sqlite3SrcListAssignCursors(pParse, pTabList);
@@ -102648,16 +103162,25 @@
103162 ** an entry of the FROM clause is a subquery instead of a table or view,
103163 ** then create a transient table structure to describe the subquery.
103164 */
103165 for(i=0, pFrom=pTabList->a; i<pTabList->nSrc; i++, pFrom++){
103166 Table *pTab;
103167 assert( pFrom->isRecursive==0 || pFrom->pTab );
103168 if( pFrom->isRecursive ) continue;
103169 if( pFrom->pTab!=0 ){
103170 /* This statement has already been prepared. There is no need
103171 ** to go further. */
103172 assert( i==0 );
103173 #ifndef SQLITE_OMIT_CTE
103174 selectPopWith(pWalker, p);
103175 #endif
103176 return WRC_Prune;
103177 }
103178 #ifndef SQLITE_OMIT_CTE
103179 if( withExpand(pWalker, pFrom) ) return WRC_Abort;
103180 if( pFrom->pTab ) {} else
103181 #endif
103182 if( pFrom->zName==0 ){
103183 #ifndef SQLITE_OMIT_SUBQUERY
103184 Select *pSel = pFrom->pSelect;
103185 /* A sub-query in the FROM clause of a SELECT */
103186 assert( pSel!=0 );
@@ -102916,10 +103439,11 @@
103439 if( pParse->hasCompound ){
103440 w.xSelectCallback = convertCompoundSelectToSubquery;
103441 sqlite3WalkSelect(&w, pSelect);
103442 }
103443 w.xSelectCallback = selectExpander;
103444 w.xSelectCallback2 = selectPopWith;
103445 sqlite3WalkSelect(&w, pSelect);
103446 }
103447
103448
103449 #ifndef SQLITE_OMIT_SUBQUERY
@@ -102934,11 +103458,11 @@
103458 ** The Table structure that represents the result set was constructed
103459 ** by selectExpander() but the type and collation information was omitted
103460 ** at that point because identifiers had not yet been resolved. This
103461 ** routine is called after identifier resolution.
103462 */
103463 static void selectAddSubqueryTypeInfo(Walker *pWalker, Select *p){
103464 Parse *pParse;
103465 int i;
103466 SrcList *pTabList;
103467 struct SrcList_item *pFrom;
103468
@@ -102950,17 +103474,17 @@
103474 for(i=0, pFrom=pTabList->a; i<pTabList->nSrc; i++, pFrom++){
103475 Table *pTab = pFrom->pTab;
103476 if( ALWAYS(pTab!=0) && (pTab->tabFlags & TF_Ephemeral)!=0 ){
103477 /* A sub-query in the FROM clause of a SELECT */
103478 Select *pSel = pFrom->pSelect;
103479 if( pSel ){
103480 while( pSel->pPrior ) pSel = pSel->pPrior;
103481 selectAddColumnTypeAndCollation(pParse, pTab, pSel);
103482 }
103483 }
103484 }
103485 }
 
103486 }
103487 #endif
103488
103489
103490 /*
@@ -102972,14 +103496,13 @@
103496 */
103497 static void sqlite3SelectAddTypeInfo(Parse *pParse, Select *pSelect){
103498 #ifndef SQLITE_OMIT_SUBQUERY
103499 Walker w;
103500 memset(&w, 0, sizeof(w));
103501 w.xSelectCallback2 = selectAddSubqueryTypeInfo;
103502 w.xExprCallback = exprWalkNoop;
103503 w.pParse = pParse;
 
103504 sqlite3WalkSelect(&w, pSelect);
103505 #endif
103506 }
103507
103508
@@ -104723,29 +105246,25 @@
105246 */
105247 SQLITE_PRIVATE TriggerStep *sqlite3TriggerInsertStep(
105248 sqlite3 *db, /* The database connection */
105249 Token *pTableName, /* Name of the table into which we insert */
105250 IdList *pColumn, /* List of columns in pTableName to insert into */
 
105251 Select *pSelect, /* A SELECT statement that supplies values */
105252 u8 orconf /* The conflict algorithm (OE_Abort, OE_Replace, etc.) */
105253 ){
105254 TriggerStep *pTriggerStep;
105255
105256 assert(pSelect != 0 || db->mallocFailed);
 
105257
105258 pTriggerStep = triggerStepAllocate(db, TK_INSERT, pTableName);
105259 if( pTriggerStep ){
105260 pTriggerStep->pSelect = sqlite3SelectDup(db, pSelect, EXPRDUP_REDUCE);
105261 pTriggerStep->pIdList = pColumn;
 
105262 pTriggerStep->orconf = orconf;
105263 }else{
105264 sqlite3IdListDelete(db, pColumn);
105265 }
 
105266 sqlite3SelectDelete(db, pSelect);
105267
105268 return pTriggerStep;
105269 }
105270
@@ -105079,11 +105598,10 @@
105598 break;
105599 }
105600 case TK_INSERT: {
105601 sqlite3Insert(pParse,
105602 targetSrcList(pParse, pStep),
 
105603 sqlite3SelectDup(db, pStep->pSelect, 0),
105604 sqlite3IdListDup(db, pStep->pIdList),
105605 pParse->eOrconf
105606 );
105607 break;
@@ -108830,11 +109348,11 @@
109348 ** be the name of an indexed column with TEXT affinity. */
109349 return 0;
109350 }
109351 assert( pLeft->iColumn!=(-1) ); /* Because IPK never has AFF_TEXT */
109352
109353 pRight = sqlite3ExprSkipCollate(pList->a[0].pExpr);
109354 op = pRight->op;
109355 if( op==TK_VARIABLE ){
109356 Vdbe *pReprepare = pParse->pReprepare;
109357 int iCol = pRight->iColumn;
109358 pVal = sqlite3VdbeGetBoundValue(pReprepare, iCol, SQLITE_AFF_NONE);
@@ -109873,11 +110391,11 @@
110391 VdbeComment((v, "for %s", pTable->zName));
110392
110393 /* Fill the automatic index with content */
110394 addrTop = sqlite3VdbeAddOp1(v, OP_Rewind, pLevel->iTabCur);
110395 regRecord = sqlite3GetTempReg(pParse);
110396 sqlite3GenerateIndexKey(pParse, pIdx, pLevel->iTabCur, regRecord, 0, 0, 0, 0);
110397 sqlite3VdbeAddOp2(v, OP_IdxInsert, pLevel->iIdxCur, regRecord);
110398 sqlite3VdbeChangeP5(v, OPFLAG_USESEEKRESULT);
110399 sqlite3VdbeAddOp2(v, OP_Next, pLevel->iTabCur, addrTop+1);
110400 sqlite3VdbeChangeP5(v, SQLITE_STMTSTATUS_AUTOINDEX);
110401 sqlite3VdbeJumpHere(v, addrTop);
@@ -112359,10 +112877,11 @@
112877 && pSrc->pIndex==0
112878 && !pSrc->viaCoroutine
112879 && !pSrc->notIndexed
112880 && HasRowid(pTab)
112881 && !pSrc->isCorrelated
112882 && !pSrc->isRecursive
112883 ){
112884 /* Generate auto-index WhereLoops */
112885 WhereTerm *pTerm;
112886 WhereTerm *pWCEnd = pWC->a + pWC->nTerm;
112887 for(pTerm=pWC->a; rc==SQLITE_OK && pTerm<pWCEnd; pTerm++){
@@ -114129,18 +114648,10 @@
114648 /*
114649 ** An instance of this structure holds the ATTACH key and the key type.
114650 */
114651 struct AttachKey { int type; Token key; };
114652
 
 
 
 
 
 
 
 
114653
114654 /* This is a utility routine used to set the ExprSpan.zStart and
114655 ** ExprSpan.zEnd values of pOut so that the span covers the complete
114656 ** range of text beginning with pStart and going to the end of pEnd.
114657 */
@@ -114260,42 +114771,42 @@
114771 ** YYNRULE the number of rules in the grammar
114772 ** YYERRORSYMBOL is the code number of the error symbol. If not
114773 ** defined, then do no error processing.
114774 */
114775 #define YYCODETYPE unsigned char
114776 #define YYNOCODE 254
114777 #define YYACTIONTYPE unsigned short int
114778 #define YYWILDCARD 70
114779 #define sqlite3ParserTOKENTYPE Token
114780 typedef union {
114781 int yyinit;
114782 sqlite3ParserTOKENTYPE yy0;
114783 Select* yy3;
114784 ExprList* yy14;
114785 With* yy59;
114786 SrcList* yy65;
114787 struct LikeOp yy96;
114788 Expr* yy132;
114789 u8 yy186;
114790 int yy328;
114791 ExprSpan yy346;
114792 struct TrigEvent yy378;
114793 u16 yy381;
114794 IdList* yy408;
114795 struct {int value; int mask;} yy429;
114796 TriggerStep* yy473;
114797 struct LimitVal yy476;
114798 } YYMINORTYPE;
114799 #ifndef YYSTACKDEPTH
114800 #define YYSTACKDEPTH 100
114801 #endif
114802 #define sqlite3ParserARG_SDECL Parse *pParse;
114803 #define sqlite3ParserARG_PDECL ,Parse *pParse
114804 #define sqlite3ParserARG_FETCH Parse *pParse = yypParser->pParse
114805 #define sqlite3ParserARG_STORE yypParser->pParse = pParse
114806 #define YYNSTATE 642
114807 #define YYNRULE 327
114808 #define YYFALLBACK 1
114809 #define YY_NO_ACTION (YYNSTATE+YYNRULE+2)
114810 #define YY_ACCEPT_ACTION (YYNSTATE+YYNRULE+1)
114811 #define YY_ERROR_ACTION (YYNSTATE+YYNRULE)
114812
@@ -114361,484 +114872,467 @@
114872 ** shifting terminals.
114873 ** yy_reduce_ofst[] For each state, the offset into yy_action for
114874 ** shifting non-terminals after a reduce.
114875 ** yy_default[] Default action for each state.
114876 */
114877 #define YY_ACTTAB_COUNT (1497)
114878 static const YYACTIONTYPE yy_action[] = {
114879 /* 0 */ 306, 212, 432, 955, 639, 191, 955, 295, 559, 88,
114880 /* 10 */ 88, 88, 88, 81, 86, 86, 86, 86, 85, 85,
114881 /* 20 */ 84, 84, 84, 83, 330, 185, 184, 183, 635, 635,
114882 /* 30 */ 292, 606, 606, 88, 88, 88, 88, 683, 86, 86,
114883 /* 40 */ 86, 86, 85, 85, 84, 84, 84, 83, 330, 16,
114884 /* 50 */ 436, 597, 89, 90, 80, 600, 599, 601, 601, 87,
114885 /* 60 */ 87, 88, 88, 88, 88, 684, 86, 86, 86, 86,
114886 /* 70 */ 85, 85, 84, 84, 84, 83, 330, 306, 559, 84,
114887 /* 80 */ 84, 84, 83, 330, 65, 86, 86, 86, 86, 85,
114888 /* 90 */ 85, 84, 84, 84, 83, 330, 635, 635, 634, 633,
114889 /* 100 */ 182, 682, 550, 379, 376, 375, 17, 322, 606, 606,
114890 /* 110 */ 371, 198, 479, 91, 374, 82, 79, 165, 85, 85,
114891 /* 120 */ 84, 84, 84, 83, 330, 598, 635, 635, 107, 89,
114892 /* 130 */ 90, 80, 600, 599, 601, 601, 87, 87, 88, 88,
114893 /* 140 */ 88, 88, 186, 86, 86, 86, 86, 85, 85, 84,
114894 /* 150 */ 84, 84, 83, 330, 306, 594, 594, 142, 328, 327,
114895 /* 160 */ 484, 249, 344, 238, 635, 635, 634, 633, 585, 448,
114896 /* 170 */ 526, 525, 229, 388, 1, 394, 450, 584, 449, 635,
114897 /* 180 */ 635, 635, 635, 319, 395, 606, 606, 199, 157, 273,
114898 /* 190 */ 382, 268, 381, 187, 635, 635, 634, 633, 311, 555,
114899 /* 200 */ 266, 593, 593, 266, 347, 588, 89, 90, 80, 600,
114900 /* 210 */ 599, 601, 601, 87, 87, 88, 88, 88, 88, 478,
114901 /* 220 */ 86, 86, 86, 86, 85, 85, 84, 84, 84, 83,
114902 /* 230 */ 330, 306, 272, 536, 634, 633, 146, 610, 197, 310,
114903 /* 240 */ 575, 182, 482, 271, 379, 376, 375, 506, 21, 634,
114904 /* 250 */ 633, 634, 633, 635, 635, 374, 611, 574, 548, 440,
114905 /* 260 */ 111, 563, 606, 606, 634, 633, 324, 479, 608, 608,
114906 /* 270 */ 608, 300, 435, 573, 119, 407, 210, 162, 562, 883,
114907 /* 280 */ 592, 592, 306, 89, 90, 80, 600, 599, 601, 601,
114908 /* 290 */ 87, 87, 88, 88, 88, 88, 506, 86, 86, 86,
114909 /* 300 */ 86, 85, 85, 84, 84, 84, 83, 330, 620, 111,
114910 /* 310 */ 635, 635, 361, 606, 606, 358, 249, 349, 248, 433,
114911 /* 320 */ 243, 479, 586, 634, 633, 195, 611, 93, 119, 221,
114912 /* 330 */ 575, 497, 534, 534, 89, 90, 80, 600, 599, 601,
114913 /* 340 */ 601, 87, 87, 88, 88, 88, 88, 574, 86, 86,
114914 /* 350 */ 86, 86, 85, 85, 84, 84, 84, 83, 330, 306,
114915 /* 360 */ 77, 429, 638, 573, 589, 530, 240, 230, 242, 105,
114916 /* 370 */ 249, 349, 248, 515, 588, 208, 460, 529, 564, 173,
114917 /* 380 */ 634, 633, 970, 144, 430, 2, 424, 228, 380, 557,
114918 /* 390 */ 606, 606, 190, 153, 159, 158, 514, 51, 632, 631,
114919 /* 400 */ 630, 71, 536, 432, 954, 196, 610, 954, 614, 45,
114920 /* 410 */ 18, 89, 90, 80, 600, 599, 601, 601, 87, 87,
114921 /* 420 */ 88, 88, 88, 88, 261, 86, 86, 86, 86, 85,
114922 /* 430 */ 85, 84, 84, 84, 83, 330, 306, 608, 608, 608,
114923 /* 440 */ 542, 424, 402, 385, 241, 506, 451, 320, 211, 543,
114924 /* 450 */ 164, 436, 386, 293, 451, 587, 108, 496, 111, 334,
114925 /* 460 */ 391, 591, 424, 614, 27, 452, 453, 606, 606, 72,
114926 /* 470 */ 257, 70, 259, 452, 339, 342, 564, 582, 68, 415,
114927 /* 480 */ 469, 328, 327, 62, 614, 45, 110, 393, 89, 90,
114928 /* 490 */ 80, 600, 599, 601, 601, 87, 87, 88, 88, 88,
114929 /* 500 */ 88, 152, 86, 86, 86, 86, 85, 85, 84, 84,
114930 /* 510 */ 84, 83, 330, 306, 110, 499, 520, 538, 402, 389,
114931 /* 520 */ 424, 110, 566, 500, 593, 593, 454, 82, 79, 165,
114932 /* 530 */ 424, 591, 384, 564, 340, 615, 188, 162, 424, 350,
114933 /* 540 */ 616, 424, 614, 44, 606, 606, 445, 582, 300, 434,
114934 /* 550 */ 151, 19, 614, 9, 568, 580, 348, 615, 469, 567,
114935 /* 560 */ 614, 26, 616, 614, 45, 89, 90, 80, 600, 599,
114936 /* 570 */ 601, 601, 87, 87, 88, 88, 88, 88, 411, 86,
114937 /* 580 */ 86, 86, 86, 85, 85, 84, 84, 84, 83, 330,
114938 /* 590 */ 306, 579, 110, 578, 521, 282, 433, 398, 400, 255,
114939 /* 600 */ 486, 82, 79, 165, 487, 164, 82, 79, 165, 488,
114940 /* 610 */ 488, 364, 387, 424, 544, 544, 509, 350, 362, 155,
114941 /* 620 */ 191, 606, 606, 559, 642, 640, 333, 82, 79, 165,
114942 /* 630 */ 305, 564, 507, 312, 357, 614, 45, 329, 596, 595,
114943 /* 640 */ 194, 337, 89, 90, 80, 600, 599, 601, 601, 87,
114944 /* 650 */ 87, 88, 88, 88, 88, 424, 86, 86, 86, 86,
114945 /* 660 */ 85, 85, 84, 84, 84, 83, 330, 306, 20, 323,
114946 /* 670 */ 150, 263, 211, 543, 421, 596, 595, 614, 22, 424,
114947 /* 680 */ 193, 424, 284, 424, 391, 424, 509, 424, 577, 424,
114948 /* 690 */ 186, 335, 424, 559, 424, 313, 120, 546, 606, 606,
114949 /* 700 */ 67, 614, 47, 614, 50, 614, 48, 614, 100, 614,
114950 /* 710 */ 99, 614, 101, 576, 614, 102, 614, 109, 326, 89,
114951 /* 720 */ 90, 80, 600, 599, 601, 601, 87, 87, 88, 88,
114952 /* 730 */ 88, 88, 424, 86, 86, 86, 86, 85, 85, 84,
114953 /* 740 */ 84, 84, 83, 330, 306, 424, 311, 424, 585, 54,
114954 /* 750 */ 424, 516, 517, 590, 614, 112, 424, 584, 424, 572,
114955 /* 760 */ 424, 195, 424, 571, 424, 67, 424, 614, 94, 614,
114956 /* 770 */ 98, 424, 614, 97, 264, 606, 606, 195, 614, 46,
114957 /* 780 */ 614, 96, 614, 30, 614, 49, 614, 115, 614, 114,
114958 /* 790 */ 418, 229, 388, 614, 113, 306, 89, 90, 80, 600,
114959 /* 800 */ 599, 601, 601, 87, 87, 88, 88, 88, 88, 424,
114960 /* 810 */ 86, 86, 86, 86, 85, 85, 84, 84, 84, 83,
114961 /* 820 */ 330, 119, 424, 590, 110, 372, 606, 606, 195, 53,
114962 /* 830 */ 250, 614, 29, 195, 472, 438, 729, 190, 302, 498,
114963 /* 840 */ 14, 523, 641, 2, 614, 43, 306, 89, 90, 80,
114964 /* 850 */ 600, 599, 601, 601, 87, 87, 88, 88, 88, 88,
114965 /* 860 */ 424, 86, 86, 86, 86, 85, 85, 84, 84, 84,
114966 /* 870 */ 83, 330, 424, 613, 964, 964, 354, 606, 606, 420,
114967 /* 880 */ 312, 64, 614, 42, 391, 355, 283, 437, 301, 255,
114968 /* 890 */ 414, 410, 495, 492, 614, 28, 471, 306, 89, 90,
114969 /* 900 */ 80, 600, 599, 601, 601, 87, 87, 88, 88, 88,
114970 /* 910 */ 88, 424, 86, 86, 86, 86, 85, 85, 84, 84,
114971 /* 920 */ 84, 83, 330, 424, 110, 110, 110, 110, 606, 606,
114972 /* 930 */ 110, 254, 13, 614, 41, 532, 531, 283, 481, 531,
114973 /* 940 */ 457, 284, 119, 561, 356, 614, 40, 284, 306, 89,
114974 /* 950 */ 78, 80, 600, 599, 601, 601, 87, 87, 88, 88,
114975 /* 960 */ 88, 88, 424, 86, 86, 86, 86, 85, 85, 84,
114976 /* 970 */ 84, 84, 83, 330, 110, 424, 341, 220, 555, 606,
114977 /* 980 */ 606, 351, 555, 318, 614, 95, 413, 255, 83, 330,
114978 /* 990 */ 284, 284, 255, 640, 333, 356, 255, 614, 39, 306,
114979 /* 1000 */ 356, 90, 80, 600, 599, 601, 601, 87, 87, 88,
114980 /* 1010 */ 88, 88, 88, 424, 86, 86, 86, 86, 85, 85,
114981 /* 1020 */ 84, 84, 84, 83, 330, 424, 317, 316, 141, 465,
114982 /* 1030 */ 606, 606, 219, 619, 463, 614, 10, 417, 462, 255,
114983 /* 1040 */ 189, 510, 553, 351, 207, 363, 161, 614, 38, 315,
114984 /* 1050 */ 218, 255, 255, 80, 600, 599, 601, 601, 87, 87,
114985 /* 1060 */ 88, 88, 88, 88, 424, 86, 86, 86, 86, 85,
114986 /* 1070 */ 85, 84, 84, 84, 83, 330, 76, 419, 255, 3,
114987 /* 1080 */ 878, 461, 424, 247, 331, 331, 614, 37, 217, 76,
114988 /* 1090 */ 419, 390, 3, 216, 215, 422, 4, 331, 331, 424,
114989 /* 1100 */ 547, 12, 424, 545, 614, 36, 424, 541, 422, 424,
114990 /* 1110 */ 540, 424, 214, 424, 408, 424, 539, 403, 605, 605,
114991 /* 1120 */ 237, 614, 25, 119, 614, 24, 588, 408, 614, 45,
114992 /* 1130 */ 118, 614, 35, 614, 34, 614, 33, 614, 23, 588,
114993 /* 1140 */ 60, 223, 603, 602, 513, 378, 73, 74, 140, 139,
114994 /* 1150 */ 424, 110, 265, 75, 426, 425, 59, 424, 610, 73,
114995 /* 1160 */ 74, 549, 402, 404, 424, 373, 75, 426, 425, 604,
114996 /* 1170 */ 138, 610, 614, 11, 392, 76, 419, 181, 3, 614,
114997 /* 1180 */ 32, 271, 369, 331, 331, 493, 614, 31, 149, 608,
114998 /* 1190 */ 608, 608, 607, 15, 422, 365, 614, 8, 137, 489,
114999 /* 1200 */ 136, 190, 608, 608, 608, 607, 15, 485, 176, 135,
115000 /* 1210 */ 7, 252, 477, 408, 174, 133, 175, 474, 57, 56,
115001 /* 1220 */ 132, 130, 119, 76, 419, 588, 3, 468, 245, 464,
115002 /* 1230 */ 171, 331, 331, 125, 123, 456, 447, 122, 446, 104,
115003 /* 1240 */ 336, 231, 422, 166, 154, 73, 74, 332, 116, 431,
115004 /* 1250 */ 121, 309, 75, 426, 425, 222, 106, 610, 308, 637,
115005 /* 1260 */ 204, 408, 629, 627, 628, 6, 200, 428, 427, 290,
115006 /* 1270 */ 203, 622, 201, 588, 62, 63, 289, 66, 419, 399,
115007 /* 1280 */ 3, 401, 288, 92, 143, 331, 331, 287, 608, 608,
115008 /* 1290 */ 608, 607, 15, 73, 74, 227, 422, 325, 69, 416,
115009 /* 1300 */ 75, 426, 425, 612, 412, 610, 192, 61, 569, 209,
115010 /* 1310 */ 396, 226, 278, 225, 383, 408, 527, 558, 276, 533,
115011 /* 1320 */ 552, 528, 321, 523, 370, 508, 180, 588, 494, 179,
115012 /* 1330 */ 366, 117, 253, 269, 522, 503, 608, 608, 608, 607,
115013 /* 1340 */ 15, 551, 502, 58, 274, 524, 178, 73, 74, 304,
115014 /* 1350 */ 501, 368, 303, 206, 75, 426, 425, 491, 360, 610,
115015 /* 1360 */ 213, 177, 483, 131, 345, 298, 297, 296, 202, 294,
115016 /* 1370 */ 480, 490, 466, 134, 172, 129, 444, 346, 470, 128,
115017 /* 1380 */ 314, 459, 103, 127, 126, 148, 124, 167, 443, 235,
115018 /* 1390 */ 608, 608, 608, 607, 15, 442, 439, 623, 234, 299,
115019 /* 1400 */ 145, 583, 291, 377, 581, 160, 119, 156, 270, 636,
115020 /* 1410 */ 971, 169, 279, 626, 520, 625, 473, 624, 170, 621,
115021 /* 1420 */ 618, 119, 168, 55, 409, 423, 537, 609, 286, 285,
115022 /* 1430 */ 405, 570, 560, 556, 5, 52, 458, 554, 147, 267,
115023 /* 1440 */ 519, 504, 518, 406, 262, 239, 260, 512, 343, 511,
115024 /* 1450 */ 258, 353, 565, 256, 224, 251, 359, 277, 275, 476,
115025 /* 1460 */ 475, 246, 352, 244, 467, 455, 236, 233, 232, 307,
115026 /* 1470 */ 441, 281, 205, 163, 397, 280, 535, 505, 330, 617,
115027 /* 1480 */ 971, 971, 971, 971, 367, 971, 971, 971, 971, 971,
115028 /* 1490 */ 971, 971, 971, 971, 971, 971, 338,
 
 
 
 
 
 
 
 
 
115029 };
115030 static const YYCODETYPE yy_lookahead[] = {
115031 /* 0 */ 19, 22, 22, 23, 1, 24, 26, 15, 27, 80,
115032 /* 10 */ 81, 82, 83, 84, 85, 86, 87, 88, 89, 90,
115033 /* 20 */ 91, 92, 93, 94, 95, 108, 109, 110, 27, 28,
115034 /* 30 */ 23, 50, 51, 80, 81, 82, 83, 122, 85, 86,
115035 /* 40 */ 87, 88, 89, 90, 91, 92, 93, 94, 95, 22,
115036 /* 50 */ 70, 23, 71, 72, 73, 74, 75, 76, 77, 78,
115037 /* 60 */ 79, 80, 81, 82, 83, 122, 85, 86, 87, 88,
115038 /* 70 */ 89, 90, 91, 92, 93, 94, 95, 19, 97, 91,
115039 /* 80 */ 92, 93, 94, 95, 26, 85, 86, 87, 88, 89,
115040 /* 90 */ 90, 91, 92, 93, 94, 95, 27, 28, 97, 98,
115041 /* 100 */ 99, 122, 211, 102, 103, 104, 79, 19, 50, 51,
115042 /* 110 */ 19, 122, 59, 55, 113, 224, 225, 226, 89, 90,
115043 /* 120 */ 91, 92, 93, 94, 95, 23, 27, 28, 26, 71,
115044 /* 130 */ 72, 73, 74, 75, 76, 77, 78, 79, 80, 81,
115045 /* 140 */ 82, 83, 51, 85, 86, 87, 88, 89, 90, 91,
115046 /* 150 */ 92, 93, 94, 95, 19, 132, 133, 58, 89, 90,
115047 /* 160 */ 21, 108, 109, 110, 27, 28, 97, 98, 33, 100,
115048 /* 170 */ 7, 8, 119, 120, 22, 19, 107, 42, 109, 27,
115049 /* 180 */ 28, 27, 28, 95, 28, 50, 51, 99, 100, 101,
115050 /* 190 */ 102, 103, 104, 105, 27, 28, 97, 98, 107, 152,
115051 /* 200 */ 112, 132, 133, 112, 65, 69, 71, 72, 73, 74,
115052 /* 210 */ 75, 76, 77, 78, 79, 80, 81, 82, 83, 11,
115053 /* 220 */ 85, 86, 87, 88, 89, 90, 91, 92, 93, 94,
115054 /* 230 */ 95, 19, 101, 97, 97, 98, 24, 101, 122, 157,
115055 /* 240 */ 12, 99, 103, 112, 102, 103, 104, 152, 22, 97,
115056 /* 250 */ 98, 97, 98, 27, 28, 113, 27, 29, 91, 164,
115057 /* 260 */ 165, 124, 50, 51, 97, 98, 219, 59, 132, 133,
115058 /* 270 */ 134, 22, 23, 45, 66, 47, 212, 213, 124, 140,
115059 /* 280 */ 132, 133, 19, 71, 72, 73, 74, 75, 76, 77,
115060 /* 290 */ 78, 79, 80, 81, 82, 83, 152, 85, 86, 87,
115061 /* 300 */ 88, 89, 90, 91, 92, 93, 94, 95, 164, 165,
115062 /* 310 */ 27, 28, 230, 50, 51, 233, 108, 109, 110, 70,
115063 /* 320 */ 16, 59, 23, 97, 98, 26, 97, 22, 66, 185,
115064 /* 330 */ 12, 187, 27, 28, 71, 72, 73, 74, 75, 76,
115065 /* 340 */ 77, 78, 79, 80, 81, 82, 83, 29, 85, 86,
115066 /* 350 */ 87, 88, 89, 90, 91, 92, 93, 94, 95, 19,
115067 /* 360 */ 22, 148, 149, 45, 23, 47, 62, 154, 64, 156,
115068 /* 370 */ 108, 109, 110, 37, 69, 23, 163, 59, 26, 26,
115069 /* 380 */ 97, 98, 144, 145, 146, 147, 152, 200, 52, 23,
115070 /* 390 */ 50, 51, 26, 22, 89, 90, 60, 210, 7, 8,
115071 /* 400 */ 9, 138, 97, 22, 23, 26, 101, 26, 174, 175,
115072 /* 410 */ 197, 71, 72, 73, 74, 75, 76, 77, 78, 79,
115073 /* 420 */ 80, 81, 82, 83, 16, 85, 86, 87, 88, 89,
115074 /* 430 */ 90, 91, 92, 93, 94, 95, 19, 132, 133, 134,
115075 /* 440 */ 23, 152, 208, 209, 140, 152, 152, 111, 195, 196,
115076 /* 450 */ 98, 70, 163, 160, 152, 23, 22, 164, 165, 246,
115077 /* 460 */ 207, 27, 152, 174, 175, 171, 172, 50, 51, 137,
115078 /* 470 */ 62, 139, 64, 171, 172, 222, 124, 27, 138, 24,
115079 /* 480 */ 163, 89, 90, 130, 174, 175, 197, 163, 71, 72,
115080 /* 490 */ 73, 74, 75, 76, 77, 78, 79, 80, 81, 82,
115081 /* 500 */ 83, 22, 85, 86, 87, 88, 89, 90, 91, 92,
115082 /* 510 */ 93, 94, 95, 19, 197, 181, 182, 23, 208, 209,
115083 /* 520 */ 152, 197, 26, 189, 132, 133, 232, 224, 225, 226,
115084 /* 530 */ 152, 97, 91, 26, 232, 116, 212, 213, 152, 222,
115085 /* 540 */ 121, 152, 174, 175, 50, 51, 243, 97, 22, 23,
115086 /* 550 */ 22, 234, 174, 175, 177, 23, 239, 116, 163, 177,
115087 /* 560 */ 174, 175, 121, 174, 175, 71, 72, 73, 74, 75,
115088 /* 570 */ 76, 77, 78, 79, 80, 81, 82, 83, 24, 85,
115089 /* 580 */ 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
115090 /* 590 */ 19, 23, 197, 11, 23, 227, 70, 208, 220, 152,
115091 /* 600 */ 31, 224, 225, 226, 35, 98, 224, 225, 226, 108,
115092 /* 610 */ 109, 110, 115, 152, 117, 118, 27, 222, 49, 123,
115093 /* 620 */ 24, 50, 51, 27, 0, 1, 2, 224, 225, 226,
115094 /* 630 */ 166, 124, 168, 169, 239, 174, 175, 170, 171, 172,
115095 /* 640 */ 22, 194, 71, 72, 73, 74, 75, 76, 77, 78,
115096 /* 650 */ 79, 80, 81, 82, 83, 152, 85, 86, 87, 88,
115097 /* 660 */ 89, 90, 91, 92, 93, 94, 95, 19, 22, 208,
115098 /* 670 */ 24, 23, 195, 196, 170, 171, 172, 174, 175, 152,
115099 /* 680 */ 26, 152, 152, 152, 207, 152, 97, 152, 23, 152,
115100 /* 690 */ 51, 244, 152, 97, 152, 247, 248, 23, 50, 51,
115101 /* 700 */ 26, 174, 175, 174, 175, 174, 175, 174, 175, 174,
115102 /* 710 */ 175, 174, 175, 23, 174, 175, 174, 175, 188, 71,
115103 /* 720 */ 72, 73, 74, 75, 76, 77, 78, 79, 80, 81,
115104 /* 730 */ 82, 83, 152, 85, 86, 87, 88, 89, 90, 91,
115105 /* 740 */ 92, 93, 94, 95, 19, 152, 107, 152, 33, 24,
115106 /* 750 */ 152, 100, 101, 27, 174, 175, 152, 42, 152, 23,
115107 /* 760 */ 152, 26, 152, 23, 152, 26, 152, 174, 175, 174,
115108 /* 770 */ 175, 152, 174, 175, 23, 50, 51, 26, 174, 175,
115109 /* 780 */ 174, 175, 174, 175, 174, 175, 174, 175, 174, 175,
115110 /* 790 */ 163, 119, 120, 174, 175, 19, 71, 72, 73, 74,
115111 /* 800 */ 75, 76, 77, 78, 79, 80, 81, 82, 83, 152,
115112 /* 810 */ 85, 86, 87, 88, 89, 90, 91, 92, 93, 94,
115113 /* 820 */ 95, 66, 152, 97, 197, 23, 50, 51, 26, 53,
115114 /* 830 */ 23, 174, 175, 26, 23, 23, 23, 26, 26, 26,
115115 /* 840 */ 36, 106, 146, 147, 174, 175, 19, 71, 72, 73,
115116 /* 850 */ 74, 75, 76, 77, 78, 79, 80, 81, 82, 83,
115117 /* 860 */ 152, 85, 86, 87, 88, 89, 90, 91, 92, 93,
115118 /* 870 */ 94, 95, 152, 196, 119, 120, 19, 50, 51, 168,
115119 /* 880 */ 169, 26, 174, 175, 207, 28, 152, 249, 250, 152,
115120 /* 890 */ 163, 163, 163, 163, 174, 175, 163, 19, 71, 72,
115121 /* 900 */ 73, 74, 75, 76, 77, 78, 79, 80, 81, 82,
115122 /* 910 */ 83, 152, 85, 86, 87, 88, 89, 90, 91, 92,
115123 /* 920 */ 93, 94, 95, 152, 197, 197, 197, 197, 50, 51,
115124 /* 930 */ 197, 194, 36, 174, 175, 191, 192, 152, 191, 192,
115125 /* 940 */ 163, 152, 66, 124, 152, 174, 175, 152, 19, 71,
115126 /* 950 */ 72, 73, 74, 75, 76, 77, 78, 79, 80, 81,
115127 /* 960 */ 82, 83, 152, 85, 86, 87, 88, 89, 90, 91,
115128 /* 970 */ 92, 93, 94, 95, 197, 152, 100, 188, 152, 50,
115129 /* 980 */ 51, 152, 152, 188, 174, 175, 252, 152, 94, 95,
115130 /* 990 */ 152, 152, 152, 1, 2, 152, 152, 174, 175, 19,
115131 /* 1000 */ 152, 72, 73, 74, 75, 76, 77, 78, 79, 80,
115132 /* 1010 */ 81, 82, 83, 152, 85, 86, 87, 88, 89, 90,
115133 /* 1020 */ 91, 92, 93, 94, 95, 152, 188, 188, 22, 194,
115134 /* 1030 */ 50, 51, 240, 173, 194, 174, 175, 252, 194, 152,
115135 /* 1040 */ 36, 181, 28, 152, 23, 219, 122, 174, 175, 219,
115136 /* 1050 */ 221, 152, 152, 73, 74, 75, 76, 77, 78, 79,
115137 /* 1060 */ 80, 81, 82, 83, 152, 85, 86, 87, 88, 89,
115138 /* 1070 */ 90, 91, 92, 93, 94, 95, 19, 20, 152, 22,
115139 /* 1080 */ 23, 194, 152, 240, 27, 28, 174, 175, 240, 19,
115140 /* 1090 */ 20, 26, 22, 194, 194, 38, 22, 27, 28, 152,
115141 /* 1100 */ 23, 22, 152, 116, 174, 175, 152, 23, 38, 152,
115142 /* 1110 */ 23, 152, 221, 152, 57, 152, 23, 163, 50, 51,
115143 /* 1120 */ 194, 174, 175, 66, 174, 175, 69, 57, 174, 175,
115144 /* 1130 */ 40, 174, 175, 174, 175, 174, 175, 174, 175, 69,
115145 /* 1140 */ 22, 53, 74, 75, 30, 53, 89, 90, 22, 22,
115146 /* 1150 */ 152, 197, 23, 96, 97, 98, 22, 152, 101, 89,
115147 /* 1160 */ 90, 91, 208, 209, 152, 53, 96, 97, 98, 101,
115148 /* 1170 */ 22, 101, 174, 175, 152, 19, 20, 105, 22, 174,
115149 /* 1180 */ 175, 112, 19, 27, 28, 20, 174, 175, 24, 132,
115150 /* 1190 */ 133, 134, 135, 136, 38, 44, 174, 175, 107, 61,
115151 /* 1200 */ 54, 26, 132, 133, 134, 135, 136, 54, 107, 22,
115152 /* 1210 */ 5, 140, 1, 57, 36, 111, 122, 28, 79, 79,
115153 /* 1220 */ 131, 123, 66, 19, 20, 69, 22, 1, 16, 20,
115154 /* 1230 */ 125, 27, 28, 123, 111, 120, 23, 131, 23, 16,
115155 /* 1240 */ 68, 142, 38, 15, 22, 89, 90, 3, 167, 4,
115156 /* 1250 */ 248, 251, 96, 97, 98, 180, 180, 101, 251, 151,
115157 /* 1260 */ 6, 57, 151, 13, 151, 26, 25, 151, 161, 202,
115158 /* 1270 */ 153, 162, 153, 69, 130, 128, 203, 19, 20, 127,
115159 /* 1280 */ 22, 126, 204, 129, 22, 27, 28, 205, 132, 133,
115160 /* 1290 */ 134, 135, 136, 89, 90, 231, 38, 95, 137, 179,
115161 /* 1300 */ 96, 97, 98, 206, 179, 101, 122, 107, 159, 159,
115162 /* 1310 */ 125, 231, 216, 228, 107, 57, 184, 217, 216, 176,
115163 /* 1320 */ 217, 176, 48, 106, 18, 184, 158, 69, 159, 158,
115164 /* 1330 */ 46, 71, 237, 176, 176, 176, 132, 133, 134, 135,
115165 /* 1340 */ 136, 217, 176, 137, 216, 178, 158, 89, 90, 179,
115166 /* 1350 */ 176, 159, 179, 159, 96, 97, 98, 159, 159, 101,
115167 /* 1360 */ 5, 158, 202, 22, 18, 10, 11, 12, 13, 14,
115168 /* 1370 */ 190, 238, 17, 190, 158, 193, 41, 159, 202, 193,
115169 /* 1380 */ 159, 202, 245, 193, 193, 223, 190, 32, 159, 34,
115170 /* 1390 */ 132, 133, 134, 135, 136, 159, 39, 155, 43, 150,
115171 /* 1400 */ 223, 177, 201, 178, 177, 186, 66, 199, 177, 152,
115172 /* 1410 */ 253, 56, 215, 152, 182, 152, 202, 152, 63, 152,
115173 /* 1420 */ 152, 66, 67, 242, 229, 152, 174, 152, 152, 152,
115174 /* 1430 */ 152, 152, 152, 152, 199, 242, 202, 152, 198, 152,
115175 /* 1440 */ 152, 152, 183, 192, 152, 215, 152, 183, 215, 183,
115176 /* 1450 */ 152, 241, 214, 152, 211, 152, 152, 211, 211, 152,
115177 /* 1460 */ 152, 241, 152, 152, 152, 152, 152, 152, 152, 114,
115178 /* 1470 */ 152, 152, 235, 152, 152, 152, 174, 187, 95, 174,
115179 /* 1480 */ 253, 253, 253, 253, 236, 253, 253, 253, 253, 253,
115180 /* 1490 */ 253, 253, 253, 253, 253, 253, 141,
115181 };
115182 #define YY_SHIFT_USE_DFLT (-86)
115183 #define YY_SHIFT_COUNT (429)
115184 #define YY_SHIFT_MIN (-85)
115185 #define YY_SHIFT_MAX (1383)
 
 
 
 
 
 
 
 
 
115186 static const short yy_shift_ofst[] = {
115187 /* 0 */ 992, 1057, 1355, 1156, 1204, 1204, 1, 262, -19, 135,
115188 /* 10 */ 135, 776, 1204, 1204, 1204, 1204, 69, 69, 53, 208,
115189 /* 20 */ 283, 755, 58, 725, 648, 571, 494, 417, 340, 263,
115190 /* 30 */ 212, 827, 827, 827, 827, 827, 827, 827, 827, 827,
115191 /* 40 */ 827, 827, 827, 827, 827, 827, 878, 827, 929, 980,
115192 /* 50 */ 980, 1070, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204,
115193 /* 60 */ 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204,
115194 /* 70 */ 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204,
115195 /* 80 */ 1258, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204,
115196 /* 90 */ 1204, 1204, 1204, 1204, -71, -47, -47, -47, -47, -47,
115197 /* 100 */ 0, 29, -12, 283, 283, 139, 91, 392, 392, 894,
115198 /* 110 */ 672, 726, 1383, -86, -86, -86, 88, 318, 318, 99,
115199 /* 120 */ 381, -20, 283, 283, 283, 283, 283, 283, 283, 283,
115200 /* 130 */ 283, 283, 283, 283, 283, 283, 283, 283, 283, 283,
115201 /* 140 */ 283, 283, 283, 283, 624, 876, 726, 672, 1340, 1340,
115202 /* 150 */ 1340, 1340, 1340, 1340, -86, -86, -86, 305, 136, 136,
115203 /* 160 */ 142, 167, 226, 154, 137, 152, 283, 283, 283, 283,
115204 /* 170 */ 283, 283, 283, 283, 283, 283, 283, 283, 283, 283,
115205 /* 180 */ 283, 283, 283, 336, 336, 336, 283, 283, 352, 283,
115206 /* 190 */ 283, 283, 283, 283, 228, 283, 283, 283, 283, 283,
115207 /* 200 */ 283, 283, 283, 283, 283, 501, 569, 596, 596, 596,
115208 /* 210 */ 507, 497, 441, 391, 353, 156, 156, 857, 353, 857,
115209 /* 220 */ 735, 813, 639, 715, 156, 332, 715, 715, 496, 419,
115210 /* 230 */ 646, 1357, 1184, 1184, 1335, 1335, 1184, 1341, 1260, 1144,
115211 /* 240 */ 1346, 1346, 1346, 1346, 1184, 1306, 1144, 1341, 1260, 1260,
115212 /* 250 */ 1144, 1184, 1306, 1206, 1284, 1184, 1184, 1306, 1184, 1306,
115213 /* 260 */ 1184, 1306, 1262, 1207, 1207, 1207, 1274, 1262, 1207, 1217,
115214 /* 270 */ 1207, 1274, 1207, 1207, 1185, 1200, 1185, 1200, 1185, 1200,
115215 /* 280 */ 1184, 1184, 1161, 1262, 1202, 1202, 1262, 1154, 1155, 1147,
115216 /* 290 */ 1152, 1144, 1241, 1239, 1250, 1250, 1254, 1254, 1254, 1254,
115217 /* 300 */ -86, -86, -86, -86, -86, -86, 1068, 304, 526, 249,
115218 /* 310 */ 408, -83, 434, 812, 27, 811, 807, 802, 751, 589,
115219 /* 320 */ 651, 163, 131, 674, 366, 450, 299, 148, 23, 102,
115220 /* 330 */ 229, -21, 1245, 1244, 1222, 1099, 1228, 1172, 1223, 1215,
115221 /* 340 */ 1213, 1115, 1106, 1123, 1110, 1209, 1105, 1212, 1226, 1098,
115222 /* 350 */ 1089, 1140, 1139, 1104, 1189, 1178, 1094, 1211, 1205, 1187,
115223 /* 360 */ 1101, 1071, 1153, 1175, 1146, 1138, 1151, 1091, 1164, 1165,
115224 /* 370 */ 1163, 1069, 1072, 1148, 1112, 1134, 1127, 1129, 1126, 1092,
115225 /* 380 */ 1114, 1118, 1088, 1090, 1093, 1087, 1084, 987, 1079, 1077,
115226 /* 390 */ 1074, 1065, 924, 1021, 1014, 1004, 1006, 819, 739, 896,
115227 /* 400 */ 855, 804, 739, 740, 736, 690, 654, 665, 618, 582,
115228 /* 410 */ 568, 528, 554, 379, 532, 479, 455, 379, 432, 371,
115229 /* 420 */ 341, 28, 338, 116, -11, -57, -85, 7, -8, 3,
115230 };
115231 #define YY_REDUCE_USE_DFLT (-110)
115232 #define YY_REDUCE_COUNT (305)
115233 #define YY_REDUCE_MIN (-109)
115234 #define YY_REDUCE_MAX (1323)
115235 static const short yy_reduce_ofst[] = {
115236 /* 0 */ 238, 954, 213, 289, 310, 234, 144, 317, -109, 382,
115237 /* 10 */ 377, 303, 461, 389, 378, 368, 302, 294, 253, 395,
115238 /* 20 */ 293, 324, 403, 403, 403, 403, 403, 403, 403, 403,
115239 /* 30 */ 403, 403, 403, 403, 403, 403, 403, 403, 403, 403,
115240 /* 40 */ 403, 403, 403, 403, 403, 403, 403, 403, 403, 403,
115241 /* 50 */ 403, 1022, 1012, 1005, 998, 963, 961, 959, 957, 950,
115242 /* 60 */ 947, 930, 912, 873, 861, 823, 810, 771, 759, 720,
115243 /* 70 */ 708, 670, 657, 619, 614, 612, 610, 608, 606, 604,
115244 /* 80 */ 598, 595, 593, 580, 542, 540, 537, 535, 533, 531,
115245 /* 90 */ 529, 527, 503, 386, 403, 403, 403, 403, 403, 403,
115246 /* 100 */ 403, 403, 403, 95, 447, 82, 334, 504, 467, 403,
115247 /* 110 */ 477, 464, 403, 403, 403, 403, 860, 747, 744, 785,
115248 /* 120 */ 638, 638, 926, 891, 900, 899, 887, 844, 840, 835,
115249 /* 130 */ 848, 830, 843, 829, 792, 839, 826, 737, 838, 795,
115250 /* 140 */ 789, 47, 734, 530, 696, 777, 711, 677, 733, 730,
115251 /* 150 */ 729, 728, 727, 627, 448, 64, 187, 1305, 1302, 1252,
115252 /* 160 */ 1290, 1273, 1323, 1322, 1321, 1319, 1318, 1316, 1315, 1314,
115253 /* 170 */ 1313, 1312, 1311, 1310, 1308, 1307, 1304, 1303, 1301, 1298,
115254 /* 180 */ 1294, 1292, 1289, 1266, 1264, 1259, 1288, 1287, 1238, 1285,
115255 /* 190 */ 1281, 1280, 1279, 1278, 1251, 1277, 1276, 1275, 1273, 1268,
115256 /* 200 */ 1267, 1265, 1263, 1261, 1257, 1248, 1237, 1247, 1246, 1243,
115257 /* 210 */ 1238, 1240, 1235, 1249, 1234, 1233, 1230, 1220, 1214, 1210,
115258 /* 220 */ 1225, 1219, 1232, 1231, 1197, 1195, 1227, 1224, 1201, 1208,
115259 /* 230 */ 1242, 1137, 1236, 1229, 1193, 1181, 1221, 1177, 1196, 1179,
115260 /* 240 */ 1191, 1190, 1186, 1182, 1218, 1216, 1176, 1162, 1183, 1180,
115261 /* 250 */ 1160, 1199, 1203, 1133, 1095, 1198, 1194, 1188, 1192, 1171,
115262 /* 260 */ 1169, 1168, 1173, 1174, 1166, 1159, 1141, 1170, 1158, 1167,
115263 /* 270 */ 1157, 1132, 1145, 1143, 1124, 1128, 1103, 1102, 1100, 1096,
115264 /* 280 */ 1150, 1149, 1085, 1125, 1080, 1064, 1120, 1097, 1082, 1078,
115265 /* 290 */ 1073, 1067, 1109, 1107, 1119, 1117, 1116, 1113, 1111, 1108,
115266 /* 300 */ 1007, 1000, 1002, 1076, 1075, 1081,
 
115267 };
115268 static const YYACTIONTYPE yy_default[] = {
115269 /* 0 */ 647, 964, 964, 964, 878, 878, 969, 964, 774, 802,
115270 /* 10 */ 802, 938, 969, 969, 969, 876, 969, 969, 969, 964,
115271 /* 20 */ 969, 778, 808, 969, 969, 969, 969, 969, 969, 969,
115272 /* 30 */ 969, 937, 939, 816, 815, 918, 789, 813, 806, 810,
115273 /* 40 */ 879, 872, 873, 871, 875, 880, 969, 809, 841, 856,
115274 /* 50 */ 840, 969, 969, 969, 969, 969, 969, 969, 969, 969,
115275 /* 60 */ 969, 969, 969, 969, 969, 969, 969, 969, 969, 969,
115276 /* 70 */ 969, 969, 969, 969, 969, 969, 969, 969, 969, 969,
115277 /* 80 */ 969, 969, 969, 969, 969, 969, 969, 969, 969, 969,
115278 /* 90 */ 969, 969, 969, 969, 850, 855, 862, 854, 851, 843,
115279 /* 100 */ 842, 844, 845, 969, 969, 673, 739, 969, 969, 846,
115280 /* 110 */ 969, 685, 847, 859, 858, 857, 680, 969, 969, 969,
115281 /* 120 */ 969, 969, 969, 969, 969, 969, 969, 969, 969, 969,
115282 /* 130 */ 969, 969, 969, 969, 969, 969, 969, 969, 969, 969,
115283 /* 140 */ 969, 969, 969, 969, 647, 964, 969, 969, 964, 964,
115284 /* 150 */ 964, 964, 964, 964, 956, 778, 768, 969, 969, 969,
115285 /* 160 */ 969, 969, 969, 969, 969, 969, 969, 944, 942, 969,
115286 /* 170 */ 891, 969, 969, 969, 969, 969, 969, 969, 969, 969,
115287 /* 180 */ 969, 969, 969, 969, 969, 969, 969, 969, 969, 969,
115288 /* 190 */ 969, 969, 969, 969, 969, 969, 969, 969, 969, 969,
115289 /* 200 */ 969, 969, 969, 969, 653, 969, 911, 774, 774, 774,
115290 /* 210 */ 776, 754, 766, 655, 812, 791, 791, 923, 812, 923,
115291 /* 220 */ 710, 733, 707, 802, 791, 874, 802, 802, 775, 766,
115292 /* 230 */ 969, 949, 782, 782, 941, 941, 782, 821, 743, 812,
115293 /* 240 */ 750, 750, 750, 750, 782, 670, 812, 821, 743, 743,
115294 /* 250 */ 812, 782, 670, 917, 915, 782, 782, 670, 782, 670,
115295 /* 260 */ 782, 670, 884, 741, 741, 741, 725, 884, 741, 710,
115296 /* 270 */ 741, 725, 741, 741, 795, 790, 795, 790, 795, 790,
115297 /* 280 */ 782, 782, 969, 884, 888, 888, 884, 807, 796, 805,
115298 /* 290 */ 803, 812, 676, 728, 663, 663, 652, 652, 652, 652,
115299 /* 300 */ 961, 961, 956, 712, 712, 695, 969, 969, 969, 969,
115300 /* 310 */ 969, 969, 687, 969, 893, 969, 969, 969, 969, 969,
115301 /* 320 */ 969, 969, 969, 969, 969, 969, 969, 969, 969, 969,
115302 /* 330 */ 969, 828, 969, 648, 951, 969, 969, 948, 969, 969,
115303 /* 340 */ 969, 969, 969, 969, 969, 969, 969, 969, 969, 969,
115304 /* 350 */ 969, 969, 969, 969, 969, 969, 921, 969, 969, 969,
115305 /* 360 */ 969, 969, 969, 914, 913, 969, 969, 969, 969, 969,
115306 /* 370 */ 969, 969, 969, 969, 969, 969, 969, 969, 969, 969,
115307 /* 380 */ 969, 969, 969, 969, 969, 969, 969, 757, 969, 969,
115308 /* 390 */ 969, 761, 969, 969, 969, 969, 969, 969, 804, 969,
115309 /* 400 */ 797, 969, 877, 969, 969, 969, 969, 969, 969, 969,
115310 /* 410 */ 969, 969, 969, 966, 969, 969, 969, 965, 969, 969,
115311 /* 420 */ 969, 969, 969, 830, 969, 829, 833, 969, 661, 969,
115312 /* 430 */ 644, 649, 960, 963, 962, 959, 958, 957, 952, 950,
115313 /* 440 */ 947, 946, 945, 943, 940, 936, 897, 895, 902, 901,
115314 /* 450 */ 900, 899, 898, 896, 894, 892, 818, 817, 814, 811,
115315 /* 460 */ 753, 935, 890, 752, 749, 748, 669, 953, 920, 929,
115316 /* 470 */ 928, 927, 822, 926, 925, 924, 922, 919, 906, 820,
115317 /* 480 */ 819, 744, 882, 881, 672, 910, 909, 908, 912, 916,
115318 /* 490 */ 907, 784, 751, 671, 668, 675, 679, 731, 732, 740,
115319 /* 500 */ 738, 737, 736, 735, 734, 730, 681, 686, 724, 709,
115320 /* 510 */ 708, 717, 716, 722, 721, 720, 719, 718, 715, 714,
115321 /* 520 */ 713, 706, 705, 711, 704, 727, 726, 723, 703, 747,
115322 /* 530 */ 746, 745, 742, 702, 701, 700, 833, 699, 698, 838,
115323 /* 540 */ 837, 866, 826, 755, 759, 758, 762, 763, 771, 770,
115324 /* 550 */ 769, 780, 781, 793, 792, 824, 823, 794, 779, 773,
115325 /* 560 */ 772, 788, 787, 786, 785, 777, 767, 799, 798, 868,
115326 /* 570 */ 783, 867, 865, 934, 933, 932, 931, 930, 870, 967,
115327 /* 580 */ 968, 887, 889, 886, 801, 800, 885, 869, 839, 836,
115328 /* 590 */ 690, 691, 905, 904, 903, 693, 692, 689, 688, 863,
115329 /* 600 */ 860, 852, 864, 861, 853, 849, 848, 834, 832, 831,
115330 /* 610 */ 827, 835, 760, 756, 825, 765, 764, 697, 696, 694,
115331 /* 620 */ 678, 677, 674, 667, 665, 664, 666, 662, 660, 659,
115332 /* 630 */ 658, 657, 656, 684, 683, 682, 654, 651, 650, 646,
115333 /* 640 */ 645, 643,
115334 };
115335
115336 /* The next table maps tokens into fallback tokens. If a construct
115337 ** like the following:
115338 **
@@ -114907,17 +115401,19 @@
115401 27, /* KEY => ID */
115402 27, /* OF => ID */
115403 27, /* OFFSET => ID */
115404 27, /* PRAGMA => ID */
115405 27, /* RAISE => ID */
115406 27, /* RECURSIVE => ID */
115407 27, /* REPLACE => ID */
115408 27, /* RESTRICT => ID */
115409 27, /* ROW => ID */
115410 27, /* TRIGGER => ID */
115411 27, /* VACUUM => ID */
115412 27, /* VIEW => ID */
115413 27, /* VIRTUAL => ID */
115414 27, /* WITH => ID */
115415 27, /* REINDEX => ID */
115416 27, /* RENAME => ID */
115417 27, /* CTIME_KW => ID */
115418 };
115419 #endif /* YYFALLBACK */
@@ -115009,59 +115505,60 @@
115505 "BY", "CASCADE", "CAST", "COLUMNKW",
115506 "CONFLICT", "DATABASE", "DESC", "DETACH",
115507 "EACH", "FAIL", "FOR", "IGNORE",
115508 "INITIALLY", "INSTEAD", "LIKE_KW", "MATCH",
115509 "NO", "KEY", "OF", "OFFSET",
115510 "PRAGMA", "RAISE", "RECURSIVE", "REPLACE",
115511 "RESTRICT", "ROW", "TRIGGER", "VACUUM",
115512 "VIEW", "VIRTUAL", "WITH", "REINDEX",
115513 "RENAME", "CTIME_KW", "ANY", "OR",
115514 "AND", "IS", "BETWEEN", "IN",
115515 "ISNULL", "NOTNULL", "NE", "EQ",
115516 "GT", "LE", "LT", "GE",
115517 "ESCAPE", "BITAND", "BITOR", "LSHIFT",
115518 "RSHIFT", "PLUS", "MINUS", "STAR",
115519 "SLASH", "REM", "CONCAT", "COLLATE",
115520 "BITNOT", "STRING", "JOIN_KW", "CONSTRAINT",
115521 "DEFAULT", "NULL", "PRIMARY", "UNIQUE",
115522 "CHECK", "REFERENCES", "AUTOINCR", "ON",
115523 "INSERT", "DELETE", "UPDATE", "SET",
115524 "DEFERRABLE", "FOREIGN", "DROP", "UNION",
115525 "ALL", "EXCEPT", "INTERSECT", "SELECT",
115526 "VALUES", "DISTINCT", "DOT", "FROM",
115527 "JOIN", "USING", "ORDER", "GROUP",
115528 "HAVING", "LIMIT", "WHERE", "INTO",
115529 "INTEGER", "FLOAT", "BLOB", "VARIABLE",
115530 "CASE", "WHEN", "THEN", "ELSE",
115531 "INDEX", "ALTER", "ADD", "error",
115532 "input", "cmdlist", "ecmd", "explain",
115533 "cmdx", "cmd", "transtype", "trans_opt",
115534 "nm", "savepoint_opt", "create_table", "create_table_args",
115535 "createkw", "temp", "ifnotexists", "dbnm",
115536 "columnlist", "conslist_opt", "table_options", "select",
115537 "column", "columnid", "type", "carglist",
115538 "typetoken", "typename", "signed", "plus_num",
115539 "minus_num", "ccons", "term", "expr",
115540 "onconf", "sortorder", "autoinc", "idxlist_opt",
115541 "refargs", "defer_subclause", "refarg", "refact",
115542 "init_deferred_pred_opt", "conslist", "tconscomma", "tcons",
115543 "idxlist", "defer_subclause_opt", "orconf", "resolvetype",
115544 "raisetype", "ifexists", "fullname", "selectnowith",
115545 "oneselect", "with", "multiselect_op", "distinct",
115546 "selcollist", "from", "where_opt", "groupby_opt",
115547 "having_opt", "orderby_opt", "limit_opt", "values",
115548 "nexprlist", "exprlist", "sclp", "as",
115549 "seltablist", "stl_prefix", "joinop", "indexed_opt",
115550 "on_opt", "using_opt", "joinop2", "idlist",
115551 "sortlist", "setlist", "insert_cmd", "inscollist_opt",
115552 "likeop", "between_op", "in_op", "case_operand",
115553 "case_exprlist", "case_else", "uniqueflag", "collate",
115554 "nmnum", "trigger_decl", "trigger_cmd_list", "trigger_time",
 
115555 "trigger_event", "foreach_clause", "when_clause", "trigger_cmd",
115556 "trnm", "tridxby", "database_kw_opt", "key_opt",
115557 "add_column_fullname", "kwcolumn_opt", "create_vtab", "vtabarglist",
115558 "vtabarg", "vtabargtoken", "lp", "anylist",
115559 "wqlist",
115560 };
115561 #endif /* NDEBUG */
115562
115563 #ifndef NDEBUG
115564 /* For tracing reduce actions, the names of all rules are required.
@@ -115105,299 +115602,297 @@
115602 /* 35 */ "table_options ::= WITHOUT nm",
115603 /* 36 */ "columnlist ::= columnlist COMMA column",
115604 /* 37 */ "columnlist ::= column",
115605 /* 38 */ "column ::= columnid type carglist",
115606 /* 39 */ "columnid ::= nm",
115607 /* 40 */ "nm ::= ID|INDEXED",
115608 /* 41 */ "nm ::= STRING",
115609 /* 42 */ "nm ::= JOIN_KW",
115610 /* 43 */ "type ::=",
115611 /* 44 */ "type ::= typetoken",
115612 /* 45 */ "typetoken ::= typename",
115613 /* 46 */ "typetoken ::= typename LP signed RP",
115614 /* 47 */ "typetoken ::= typename LP signed COMMA signed RP",
115615 /* 48 */ "typename ::= ID|STRING",
115616 /* 49 */ "typename ::= typename ID|STRING",
115617 /* 50 */ "signed ::= plus_num",
115618 /* 51 */ "signed ::= minus_num",
115619 /* 52 */ "carglist ::= carglist ccons",
115620 /* 53 */ "carglist ::=",
115621 /* 54 */ "ccons ::= CONSTRAINT nm",
115622 /* 55 */ "ccons ::= DEFAULT term",
115623 /* 56 */ "ccons ::= DEFAULT LP expr RP",
115624 /* 57 */ "ccons ::= DEFAULT PLUS term",
115625 /* 58 */ "ccons ::= DEFAULT MINUS term",
115626 /* 59 */ "ccons ::= DEFAULT ID|INDEXED",
115627 /* 60 */ "ccons ::= NULL onconf",
115628 /* 61 */ "ccons ::= NOT NULL onconf",
115629 /* 62 */ "ccons ::= PRIMARY KEY sortorder onconf autoinc",
115630 /* 63 */ "ccons ::= UNIQUE onconf",
115631 /* 64 */ "ccons ::= CHECK LP expr RP",
115632 /* 65 */ "ccons ::= REFERENCES nm idxlist_opt refargs",
115633 /* 66 */ "ccons ::= defer_subclause",
115634 /* 67 */ "ccons ::= COLLATE ID|STRING",
115635 /* 68 */ "autoinc ::=",
115636 /* 69 */ "autoinc ::= AUTOINCR",
115637 /* 70 */ "refargs ::=",
115638 /* 71 */ "refargs ::= refargs refarg",
115639 /* 72 */ "refarg ::= MATCH nm",
115640 /* 73 */ "refarg ::= ON INSERT refact",
115641 /* 74 */ "refarg ::= ON DELETE refact",
115642 /* 75 */ "refarg ::= ON UPDATE refact",
115643 /* 76 */ "refact ::= SET NULL",
115644 /* 77 */ "refact ::= SET DEFAULT",
115645 /* 78 */ "refact ::= CASCADE",
115646 /* 79 */ "refact ::= RESTRICT",
115647 /* 80 */ "refact ::= NO ACTION",
115648 /* 81 */ "defer_subclause ::= NOT DEFERRABLE init_deferred_pred_opt",
115649 /* 82 */ "defer_subclause ::= DEFERRABLE init_deferred_pred_opt",
115650 /* 83 */ "init_deferred_pred_opt ::=",
115651 /* 84 */ "init_deferred_pred_opt ::= INITIALLY DEFERRED",
115652 /* 85 */ "init_deferred_pred_opt ::= INITIALLY IMMEDIATE",
115653 /* 86 */ "conslist_opt ::=",
115654 /* 87 */ "conslist_opt ::= COMMA conslist",
115655 /* 88 */ "conslist ::= conslist tconscomma tcons",
115656 /* 89 */ "conslist ::= tcons",
115657 /* 90 */ "tconscomma ::= COMMA",
115658 /* 91 */ "tconscomma ::=",
115659 /* 92 */ "tcons ::= CONSTRAINT nm",
115660 /* 93 */ "tcons ::= PRIMARY KEY LP idxlist autoinc RP onconf",
115661 /* 94 */ "tcons ::= UNIQUE LP idxlist RP onconf",
115662 /* 95 */ "tcons ::= CHECK LP expr RP onconf",
115663 /* 96 */ "tcons ::= FOREIGN KEY LP idxlist RP REFERENCES nm idxlist_opt refargs defer_subclause_opt",
115664 /* 97 */ "defer_subclause_opt ::=",
115665 /* 98 */ "defer_subclause_opt ::= defer_subclause",
115666 /* 99 */ "onconf ::=",
115667 /* 100 */ "onconf ::= ON CONFLICT resolvetype",
115668 /* 101 */ "orconf ::=",
115669 /* 102 */ "orconf ::= OR resolvetype",
115670 /* 103 */ "resolvetype ::= raisetype",
115671 /* 104 */ "resolvetype ::= IGNORE",
115672 /* 105 */ "resolvetype ::= REPLACE",
115673 /* 106 */ "cmd ::= DROP TABLE ifexists fullname",
115674 /* 107 */ "ifexists ::= IF EXISTS",
115675 /* 108 */ "ifexists ::=",
115676 /* 109 */ "cmd ::= createkw temp VIEW ifnotexists nm dbnm AS select",
115677 /* 110 */ "cmd ::= DROP VIEW ifexists fullname",
115678 /* 111 */ "cmd ::= select",
115679 /* 112 */ "select ::= with selectnowith",
115680 /* 113 */ "selectnowith ::= oneselect",
115681 /* 114 */ "selectnowith ::= selectnowith multiselect_op oneselect",
115682 /* 115 */ "multiselect_op ::= UNION",
115683 /* 116 */ "multiselect_op ::= UNION ALL",
115684 /* 117 */ "multiselect_op ::= EXCEPT|INTERSECT",
115685 /* 118 */ "oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt orderby_opt limit_opt",
115686 /* 119 */ "oneselect ::= values",
115687 /* 120 */ "values ::= VALUES LP nexprlist RP",
115688 /* 121 */ "values ::= values COMMA LP exprlist RP",
115689 /* 122 */ "distinct ::= DISTINCT",
115690 /* 123 */ "distinct ::= ALL",
115691 /* 124 */ "distinct ::=",
115692 /* 125 */ "sclp ::= selcollist COMMA",
115693 /* 126 */ "sclp ::=",
115694 /* 127 */ "selcollist ::= sclp expr as",
115695 /* 128 */ "selcollist ::= sclp STAR",
115696 /* 129 */ "selcollist ::= sclp nm DOT STAR",
115697 /* 130 */ "as ::= AS nm",
115698 /* 131 */ "as ::= ID|STRING",
115699 /* 132 */ "as ::=",
115700 /* 133 */ "from ::=",
115701 /* 134 */ "from ::= FROM seltablist",
115702 /* 135 */ "stl_prefix ::= seltablist joinop",
115703 /* 136 */ "stl_prefix ::=",
115704 /* 137 */ "seltablist ::= stl_prefix nm dbnm as indexed_opt on_opt using_opt",
115705 /* 138 */ "seltablist ::= stl_prefix LP select RP as on_opt using_opt",
115706 /* 139 */ "seltablist ::= stl_prefix LP seltablist RP as on_opt using_opt",
115707 /* 140 */ "dbnm ::=",
115708 /* 141 */ "dbnm ::= DOT nm",
115709 /* 142 */ "fullname ::= nm dbnm",
115710 /* 143 */ "joinop ::= COMMA|JOIN",
115711 /* 144 */ "joinop ::= JOIN_KW JOIN",
115712 /* 145 */ "joinop ::= JOIN_KW nm JOIN",
115713 /* 146 */ "joinop ::= JOIN_KW nm nm JOIN",
115714 /* 147 */ "on_opt ::= ON expr",
115715 /* 148 */ "on_opt ::=",
115716 /* 149 */ "indexed_opt ::=",
115717 /* 150 */ "indexed_opt ::= INDEXED BY nm",
115718 /* 151 */ "indexed_opt ::= NOT INDEXED",
115719 /* 152 */ "using_opt ::= USING LP idlist RP",
115720 /* 153 */ "using_opt ::=",
115721 /* 154 */ "orderby_opt ::=",
115722 /* 155 */ "orderby_opt ::= ORDER BY sortlist",
115723 /* 156 */ "sortlist ::= sortlist COMMA expr sortorder",
115724 /* 157 */ "sortlist ::= expr sortorder",
115725 /* 158 */ "sortorder ::= ASC",
115726 /* 159 */ "sortorder ::= DESC",
115727 /* 160 */ "sortorder ::=",
115728 /* 161 */ "groupby_opt ::=",
115729 /* 162 */ "groupby_opt ::= GROUP BY nexprlist",
115730 /* 163 */ "having_opt ::=",
115731 /* 164 */ "having_opt ::= HAVING expr",
115732 /* 165 */ "limit_opt ::=",
115733 /* 166 */ "limit_opt ::= LIMIT expr",
115734 /* 167 */ "limit_opt ::= LIMIT expr OFFSET expr",
115735 /* 168 */ "limit_opt ::= LIMIT expr COMMA expr",
115736 /* 169 */ "cmd ::= with DELETE FROM fullname indexed_opt where_opt",
115737 /* 170 */ "where_opt ::=",
115738 /* 171 */ "where_opt ::= WHERE expr",
115739 /* 172 */ "cmd ::= with UPDATE orconf fullname indexed_opt SET setlist where_opt",
115740 /* 173 */ "setlist ::= setlist COMMA nm EQ expr",
115741 /* 174 */ "setlist ::= nm EQ expr",
115742 /* 175 */ "cmd ::= with insert_cmd INTO fullname inscollist_opt select",
115743 /* 176 */ "cmd ::= with insert_cmd INTO fullname inscollist_opt DEFAULT VALUES",
115744 /* 177 */ "insert_cmd ::= INSERT orconf",
115745 /* 178 */ "insert_cmd ::= REPLACE",
115746 /* 179 */ "inscollist_opt ::=",
115747 /* 180 */ "inscollist_opt ::= LP idlist RP",
115748 /* 181 */ "idlist ::= idlist COMMA nm",
115749 /* 182 */ "idlist ::= nm",
115750 /* 183 */ "expr ::= term",
115751 /* 184 */ "expr ::= LP expr RP",
115752 /* 185 */ "term ::= NULL",
115753 /* 186 */ "expr ::= ID|INDEXED",
115754 /* 187 */ "expr ::= JOIN_KW",
115755 /* 188 */ "expr ::= nm DOT nm",
115756 /* 189 */ "expr ::= nm DOT nm DOT nm",
115757 /* 190 */ "term ::= INTEGER|FLOAT|BLOB",
115758 /* 191 */ "term ::= STRING",
115759 /* 192 */ "expr ::= VARIABLE",
115760 /* 193 */ "expr ::= expr COLLATE ID|STRING",
115761 /* 194 */ "expr ::= CAST LP expr AS typetoken RP",
115762 /* 195 */ "expr ::= ID|INDEXED LP distinct exprlist RP",
115763 /* 196 */ "expr ::= ID|INDEXED LP STAR RP",
115764 /* 197 */ "term ::= CTIME_KW",
115765 /* 198 */ "expr ::= expr AND expr",
115766 /* 199 */ "expr ::= expr OR expr",
115767 /* 200 */ "expr ::= expr LT|GT|GE|LE expr",
115768 /* 201 */ "expr ::= expr EQ|NE expr",
115769 /* 202 */ "expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr",
115770 /* 203 */ "expr ::= expr PLUS|MINUS expr",
115771 /* 204 */ "expr ::= expr STAR|SLASH|REM expr",
115772 /* 205 */ "expr ::= expr CONCAT expr",
115773 /* 206 */ "likeop ::= LIKE_KW|MATCH",
115774 /* 207 */ "likeop ::= NOT LIKE_KW|MATCH",
115775 /* 208 */ "expr ::= expr likeop expr",
115776 /* 209 */ "expr ::= expr likeop expr ESCAPE expr",
115777 /* 210 */ "expr ::= expr ISNULL|NOTNULL",
115778 /* 211 */ "expr ::= expr NOT NULL",
115779 /* 212 */ "expr ::= expr IS expr",
115780 /* 213 */ "expr ::= expr IS NOT expr",
115781 /* 214 */ "expr ::= NOT expr",
115782 /* 215 */ "expr ::= BITNOT expr",
115783 /* 216 */ "expr ::= MINUS expr",
115784 /* 217 */ "expr ::= PLUS expr",
115785 /* 218 */ "between_op ::= BETWEEN",
115786 /* 219 */ "between_op ::= NOT BETWEEN",
115787 /* 220 */ "expr ::= expr between_op expr AND expr",
115788 /* 221 */ "in_op ::= IN",
115789 /* 222 */ "in_op ::= NOT IN",
115790 /* 223 */ "expr ::= expr in_op LP exprlist RP",
115791 /* 224 */ "expr ::= LP select RP",
115792 /* 225 */ "expr ::= expr in_op LP select RP",
115793 /* 226 */ "expr ::= expr in_op nm dbnm",
115794 /* 227 */ "expr ::= EXISTS LP select RP",
115795 /* 228 */ "expr ::= CASE case_operand case_exprlist case_else END",
115796 /* 229 */ "case_exprlist ::= case_exprlist WHEN expr THEN expr",
115797 /* 230 */ "case_exprlist ::= WHEN expr THEN expr",
115798 /* 231 */ "case_else ::= ELSE expr",
115799 /* 232 */ "case_else ::=",
115800 /* 233 */ "case_operand ::= expr",
115801 /* 234 */ "case_operand ::=",
115802 /* 235 */ "exprlist ::= nexprlist",
115803 /* 236 */ "exprlist ::=",
115804 /* 237 */ "nexprlist ::= nexprlist COMMA expr",
115805 /* 238 */ "nexprlist ::= expr",
115806 /* 239 */ "cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP idxlist RP where_opt",
115807 /* 240 */ "uniqueflag ::= UNIQUE",
115808 /* 241 */ "uniqueflag ::=",
115809 /* 242 */ "idxlist_opt ::=",
115810 /* 243 */ "idxlist_opt ::= LP idxlist RP",
115811 /* 244 */ "idxlist ::= idxlist COMMA nm collate sortorder",
115812 /* 245 */ "idxlist ::= nm collate sortorder",
115813 /* 246 */ "collate ::=",
115814 /* 247 */ "collate ::= COLLATE ID|STRING",
115815 /* 248 */ "cmd ::= DROP INDEX ifexists fullname",
115816 /* 249 */ "cmd ::= VACUUM",
115817 /* 250 */ "cmd ::= VACUUM nm",
115818 /* 251 */ "cmd ::= PRAGMA nm dbnm",
115819 /* 252 */ "cmd ::= PRAGMA nm dbnm EQ nmnum",
115820 /* 253 */ "cmd ::= PRAGMA nm dbnm LP nmnum RP",
115821 /* 254 */ "cmd ::= PRAGMA nm dbnm EQ minus_num",
115822 /* 255 */ "cmd ::= PRAGMA nm dbnm LP minus_num RP",
115823 /* 256 */ "nmnum ::= plus_num",
115824 /* 257 */ "nmnum ::= nm",
115825 /* 258 */ "nmnum ::= ON",
115826 /* 259 */ "nmnum ::= DELETE",
115827 /* 260 */ "nmnum ::= DEFAULT",
115828 /* 261 */ "plus_num ::= PLUS INTEGER|FLOAT",
115829 /* 262 */ "plus_num ::= INTEGER|FLOAT",
115830 /* 263 */ "minus_num ::= MINUS INTEGER|FLOAT",
115831 /* 264 */ "cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END",
115832 /* 265 */ "trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause",
115833 /* 266 */ "trigger_time ::= BEFORE",
115834 /* 267 */ "trigger_time ::= AFTER",
115835 /* 268 */ "trigger_time ::= INSTEAD OF",
115836 /* 269 */ "trigger_time ::=",
115837 /* 270 */ "trigger_event ::= DELETE|INSERT",
115838 /* 271 */ "trigger_event ::= UPDATE",
115839 /* 272 */ "trigger_event ::= UPDATE OF idlist",
115840 /* 273 */ "foreach_clause ::=",
115841 /* 274 */ "foreach_clause ::= FOR EACH ROW",
115842 /* 275 */ "when_clause ::=",
115843 /* 276 */ "when_clause ::= WHEN expr",
115844 /* 277 */ "trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI",
115845 /* 278 */ "trigger_cmd_list ::= trigger_cmd SEMI",
115846 /* 279 */ "trnm ::= nm",
115847 /* 280 */ "trnm ::= nm DOT nm",
115848 /* 281 */ "tridxby ::=",
115849 /* 282 */ "tridxby ::= INDEXED BY nm",
115850 /* 283 */ "tridxby ::= NOT INDEXED",
115851 /* 284 */ "trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist where_opt",
115852 /* 285 */ "trigger_cmd ::= insert_cmd INTO trnm inscollist_opt select",
115853 /* 286 */ "trigger_cmd ::= DELETE FROM trnm tridxby where_opt",
115854 /* 287 */ "trigger_cmd ::= select",
115855 /* 288 */ "expr ::= RAISE LP IGNORE RP",
115856 /* 289 */ "expr ::= RAISE LP raisetype COMMA nm RP",
115857 /* 290 */ "raisetype ::= ROLLBACK",
115858 /* 291 */ "raisetype ::= ABORT",
115859 /* 292 */ "raisetype ::= FAIL",
115860 /* 293 */ "cmd ::= DROP TRIGGER ifexists fullname",
115861 /* 294 */ "cmd ::= ATTACH database_kw_opt expr AS expr key_opt",
115862 /* 295 */ "cmd ::= DETACH database_kw_opt expr",
115863 /* 296 */ "key_opt ::=",
115864 /* 297 */ "key_opt ::= KEY expr",
115865 /* 298 */ "database_kw_opt ::= DATABASE",
115866 /* 299 */ "database_kw_opt ::=",
115867 /* 300 */ "cmd ::= REINDEX",
115868 /* 301 */ "cmd ::= REINDEX nm dbnm",
115869 /* 302 */ "cmd ::= ANALYZE",
115870 /* 303 */ "cmd ::= ANALYZE nm dbnm",
115871 /* 304 */ "cmd ::= ALTER TABLE fullname RENAME TO nm",
115872 /* 305 */ "cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt column",
115873 /* 306 */ "add_column_fullname ::= fullname",
115874 /* 307 */ "kwcolumn_opt ::=",
115875 /* 308 */ "kwcolumn_opt ::= COLUMNKW",
115876 /* 309 */ "cmd ::= create_vtab",
115877 /* 310 */ "cmd ::= create_vtab LP vtabarglist RP",
115878 /* 311 */ "create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm",
115879 /* 312 */ "vtabarglist ::= vtabarg",
115880 /* 313 */ "vtabarglist ::= vtabarglist COMMA vtabarg",
115881 /* 314 */ "vtabarg ::=",
115882 /* 315 */ "vtabarg ::= vtabarg vtabargtoken",
115883 /* 316 */ "vtabargtoken ::= ANY",
115884 /* 317 */ "vtabargtoken ::= lp anylist RP",
115885 /* 318 */ "lp ::= LP",
115886 /* 319 */ "anylist ::=",
115887 /* 320 */ "anylist ::= anylist LP anylist RP",
115888 /* 321 */ "anylist ::= anylist ANY",
115889 /* 322 */ "with ::=",
115890 /* 323 */ "with ::= WITH wqlist",
115891 /* 324 */ "with ::= WITH RECURSIVE wqlist",
115892 /* 325 */ "wqlist ::= nm idxlist_opt AS LP select RP",
115893 /* 326 */ "wqlist ::= wqlist COMMA nm idxlist_opt AS LP select RP",
 
 
115894 };
115895 #endif /* NDEBUG */
115896
115897
115898 #if YYSTACKDEPTH<=0
@@ -115472,80 +115967,80 @@
115967 **
115968 ** Note: during a reduce, the only symbols destroyed are those
115969 ** which appear on the RHS of the rule, but which are not used
115970 ** inside the C code.
115971 */
115972 case 163: /* select */
115973 case 195: /* selectnowith */
115974 case 196: /* oneselect */
115975 case 207: /* values */
115976 {
115977 sqlite3SelectDelete(pParse->db, (yypminor->yy3));
115978 }
115979 break;
115980 case 174: /* term */
115981 case 175: /* expr */
115982 {
115983 sqlite3ExprDelete(pParse->db, (yypminor->yy346).pExpr);
115984 }
115985 break;
115986 case 179: /* idxlist_opt */
115987 case 188: /* idxlist */
115988 case 200: /* selcollist */
115989 case 203: /* groupby_opt */
115990 case 205: /* orderby_opt */
115991 case 208: /* nexprlist */
115992 case 209: /* exprlist */
115993 case 210: /* sclp */
115994 case 220: /* sortlist */
115995 case 221: /* setlist */
115996 case 228: /* case_exprlist */
115997 {
115998 sqlite3ExprListDelete(pParse->db, (yypminor->yy14));
115999 }
116000 break;
116001 case 194: /* fullname */
116002 case 201: /* from */
116003 case 212: /* seltablist */
116004 case 213: /* stl_prefix */
116005 {
116006 sqlite3SrcListDelete(pParse->db, (yypminor->yy65));
116007 }
116008 break;
116009 case 197: /* with */
116010 case 252: /* wqlist */
116011 {
116012 sqlite3WithDelete(pParse->db, (yypminor->yy59));
116013 }
116014 break;
116015 case 202: /* where_opt */
116016 case 204: /* having_opt */
116017 case 216: /* on_opt */
116018 case 227: /* case_operand */
116019 case 229: /* case_else */
116020 case 238: /* when_clause */
116021 case 243: /* key_opt */
116022 {
116023 sqlite3ExprDelete(pParse->db, (yypminor->yy132));
116024 }
116025 break;
116026 case 217: /* using_opt */
116027 case 219: /* idlist */
116028 case 223: /* inscollist_opt */
116029 {
116030 sqlite3IdListDelete(pParse->db, (yypminor->yy408));
 
 
 
 
 
 
 
 
116031 }
116032 break;
116033 case 234: /* trigger_cmd_list */
116034 case 239: /* trigger_cmd */
116035 {
116036 sqlite3DeleteTriggerStep(pParse->db, (yypminor->yy473));
116037 }
116038 break;
116039 case 236: /* trigger_event */
116040 {
116041 sqlite3IdListDelete(pParse->db, (yypminor->yy378).b);
116042 }
116043 break;
116044 default: break; /* If no destructor action specified: do nothing */
116045 }
116046 }
@@ -115786,281 +116281,275 @@
116281 */
116282 static const struct {
116283 YYCODETYPE lhs; /* Symbol on the left-hand side of the rule */
116284 unsigned char nrhs; /* Number of right-hand side symbols in the rule */
116285 } yyRuleInfo[] = {
116286 { 144, 1 },
116287 { 145, 2 },
116288 { 145, 1 },
116289 { 146, 1 },
116290 { 146, 3 },
116291 { 147, 0 },
116292 { 147, 1 },
116293 { 147, 3 },
116294 { 148, 1 },
116295 { 149, 3 },
116296 { 151, 0 },
116297 { 151, 1 },
116298 { 151, 2 },
116299 { 150, 0 },
116300 { 150, 1 },
116301 { 150, 1 },
116302 { 150, 1 },
116303 { 149, 2 },
116304 { 149, 2 },
116305 { 149, 2 },
116306 { 153, 1 },
116307 { 153, 0 },
116308 { 149, 2 },
116309 { 149, 3 },
116310 { 149, 5 },
116311 { 149, 2 },
116312 { 154, 6 },
116313 { 156, 1 },
116314 { 158, 0 },
116315 { 158, 3 },
116316 { 157, 1 },
116317 { 157, 0 },
116318 { 155, 5 },
116319 { 155, 2 },
116320 { 162, 0 },
116321 { 162, 2 },
116322 { 160, 3 },
116323 { 160, 1 },
116324 { 164, 3 },
116325 { 165, 1 },
116326 { 152, 1 },
116327 { 152, 1 },
116328 { 152, 1 },
116329 { 166, 0 },
116330 { 166, 1 },
116331 { 168, 1 },
116332 { 168, 4 },
116333 { 168, 6 },
116334 { 169, 1 },
116335 { 169, 2 },
116336 { 170, 1 },
116337 { 170, 1 },
116338 { 167, 2 },
116339 { 167, 0 },
116340 { 173, 2 },
116341 { 173, 2 },
116342 { 173, 4 },
116343 { 173, 3 },
116344 { 173, 3 },
116345 { 173, 2 },
116346 { 173, 2 },
116347 { 173, 3 },
116348 { 173, 5 },
116349 { 173, 2 },
116350 { 173, 4 },
116351 { 173, 4 },
116352 { 173, 1 },
116353 { 173, 2 },
116354 { 178, 0 },
116355 { 178, 1 },
116356 { 180, 0 },
116357 { 180, 2 },
116358 { 182, 2 },
116359 { 182, 3 },
116360 { 182, 3 },
116361 { 182, 3 },
116362 { 183, 2 },
116363 { 183, 2 },
116364 { 183, 1 },
116365 { 183, 1 },
116366 { 183, 2 },
116367 { 181, 3 },
116368 { 181, 2 },
116369 { 184, 0 },
116370 { 184, 2 },
116371 { 184, 2 },
116372 { 161, 0 },
116373 { 161, 2 },
116374 { 185, 3 },
116375 { 185, 1 },
116376 { 186, 1 },
116377 { 186, 0 },
116378 { 187, 2 },
116379 { 187, 7 },
116380 { 187, 5 },
116381 { 187, 5 },
116382 { 187, 10 },
116383 { 189, 0 },
116384 { 189, 1 },
116385 { 176, 0 },
116386 { 176, 3 },
116387 { 190, 0 },
116388 { 190, 2 },
116389 { 191, 1 },
116390 { 191, 1 },
116391 { 191, 1 },
116392 { 149, 4 },
116393 { 193, 2 },
116394 { 193, 0 },
116395 { 149, 8 },
116396 { 149, 4 },
116397 { 149, 1 },
116398 { 163, 2 },
116399 { 195, 1 },
116400 { 195, 3 },
116401 { 198, 1 },
116402 { 198, 2 },
116403 { 198, 1 },
116404 { 196, 9 },
116405 { 196, 1 },
116406 { 207, 4 },
116407 { 207, 5 },
116408 { 199, 1 },
116409 { 199, 1 },
116410 { 199, 0 },
116411 { 210, 2 },
116412 { 210, 0 },
116413 { 200, 3 },
116414 { 200, 2 },
116415 { 200, 4 },
116416 { 211, 2 },
116417 { 211, 1 },
116418 { 211, 0 },
116419 { 201, 0 },
116420 { 201, 2 },
116421 { 213, 2 },
116422 { 213, 0 },
116423 { 212, 7 },
116424 { 212, 7 },
116425 { 212, 7 },
116426 { 159, 0 },
116427 { 159, 2 },
116428 { 194, 2 },
116429 { 214, 1 },
116430 { 214, 2 },
116431 { 214, 3 },
116432 { 214, 4 },
116433 { 216, 2 },
116434 { 216, 0 },
116435 { 215, 0 },
116436 { 215, 3 },
116437 { 215, 2 },
116438 { 217, 4 },
116439 { 217, 0 },
116440 { 205, 0 },
116441 { 205, 3 },
116442 { 220, 4 },
116443 { 220, 2 },
116444 { 177, 1 },
116445 { 177, 1 },
116446 { 177, 0 },
116447 { 203, 0 },
116448 { 203, 3 },
116449 { 204, 0 },
116450 { 204, 2 },
116451 { 206, 0 },
116452 { 206, 2 },
116453 { 206, 4 },
116454 { 206, 4 },
116455 { 149, 6 },
116456 { 202, 0 },
116457 { 202, 2 },
116458 { 149, 8 },
116459 { 221, 5 },
116460 { 221, 3 },
116461 { 149, 6 },
116462 { 149, 7 },
116463 { 222, 2 },
116464 { 222, 1 },
116465 { 223, 0 },
116466 { 223, 3 },
116467 { 219, 3 },
116468 { 219, 1 },
116469 { 175, 1 },
116470 { 175, 3 },
116471 { 174, 1 },
116472 { 175, 1 },
116473 { 175, 1 },
116474 { 175, 3 },
116475 { 175, 5 },
116476 { 174, 1 },
116477 { 174, 1 },
116478 { 175, 1 },
116479 { 175, 3 },
116480 { 175, 6 },
116481 { 175, 5 },
116482 { 175, 4 },
116483 { 174, 1 },
116484 { 175, 3 },
116485 { 175, 3 },
116486 { 175, 3 },
116487 { 175, 3 },
116488 { 175, 3 },
116489 { 175, 3 },
116490 { 175, 3 },
116491 { 175, 3 },
116492 { 224, 1 },
116493 { 224, 2 },
116494 { 175, 3 },
116495 { 175, 5 },
116496 { 175, 2 },
116497 { 175, 3 },
116498 { 175, 3 },
116499 { 175, 4 },
116500 { 175, 2 },
116501 { 175, 2 },
116502 { 175, 2 },
116503 { 175, 2 },
116504 { 225, 1 },
116505 { 225, 2 },
116506 { 175, 5 },
116507 { 226, 1 },
116508 { 226, 2 },
116509 { 175, 5 },
116510 { 175, 3 },
116511 { 175, 5 },
116512 { 175, 4 },
116513 { 175, 4 },
116514 { 175, 5 },
116515 { 228, 5 },
116516 { 228, 4 },
116517 { 229, 2 },
116518 { 229, 0 },
116519 { 227, 1 },
116520 { 227, 0 },
116521 { 209, 1 },
116522 { 209, 0 },
116523 { 208, 3 },
116524 { 208, 1 },
116525 { 149, 12 },
116526 { 230, 1 },
116527 { 230, 0 },
116528 { 179, 0 },
116529 { 179, 3 },
116530 { 188, 5 },
116531 { 188, 3 },
116532 { 231, 0 },
116533 { 231, 2 },
116534 { 149, 4 },
116535 { 149, 1 },
116536 { 149, 2 },
116537 { 149, 3 },
116538 { 149, 5 },
116539 { 149, 6 },
116540 { 149, 5 },
116541 { 149, 6 },
116542 { 232, 1 },
116543 { 232, 1 },
116544 { 232, 1 },
116545 { 232, 1 },
116546 { 232, 1 },
116547 { 171, 2 },
116548 { 171, 1 },
116549 { 172, 2 },
116550 { 149, 5 },
 
 
 
 
 
 
116551 { 233, 11 },
116552 { 235, 1 },
116553 { 235, 1 },
116554 { 235, 2 },
116555 { 235, 0 },
@@ -116079,35 +116568,34 @@
116568 { 241, 3 },
116569 { 241, 2 },
116570 { 239, 7 },
116571 { 239, 5 },
116572 { 239, 5 },
 
116573 { 239, 1 },
116574 { 175, 4 },
116575 { 175, 6 },
116576 { 192, 1 },
116577 { 192, 1 },
116578 { 192, 1 },
116579 { 149, 4 },
116580 { 149, 6 },
116581 { 149, 3 },
116582 { 243, 0 },
116583 { 243, 2 },
116584 { 242, 1 },
116585 { 242, 0 },
116586 { 149, 1 },
116587 { 149, 3 },
116588 { 149, 1 },
116589 { 149, 3 },
116590 { 149, 6 },
116591 { 149, 6 },
116592 { 244, 1 },
116593 { 245, 0 },
116594 { 245, 1 },
116595 { 149, 1 },
116596 { 149, 4 },
116597 { 246, 8 },
116598 { 247, 1 },
116599 { 247, 3 },
116600 { 248, 0 },
116601 { 248, 2 },
@@ -116115,10 +116603,15 @@
116603 { 249, 3 },
116604 { 250, 1 },
116605 { 251, 0 },
116606 { 251, 4 },
116607 { 251, 2 },
116608 { 197, 0 },
116609 { 197, 2 },
116610 { 197, 3 },
116611 { 252, 6 },
116612 { 252, 8 },
116613 };
116614
116615 static void yy_accept(yyParser*); /* Forward Declaration */
116616
116617 /*
@@ -116182,21 +116675,21 @@
116675 break;
116676 case 8: /* cmdx ::= cmd */
116677 { sqlite3FinishCoding(pParse); }
116678 break;
116679 case 9: /* cmd ::= BEGIN transtype trans_opt */
116680 {sqlite3BeginTransaction(pParse, yymsp[-1].minor.yy328);}
116681 break;
116682 case 13: /* transtype ::= */
116683 {yygotominor.yy328 = TK_DEFERRED;}
116684 break;
116685 case 14: /* transtype ::= DEFERRED */
116686 case 15: /* transtype ::= IMMEDIATE */ yytestcase(yyruleno==15);
116687 case 16: /* transtype ::= EXCLUSIVE */ yytestcase(yyruleno==16);
116688 case 115: /* multiselect_op ::= UNION */ yytestcase(yyruleno==115);
116689 case 117: /* multiselect_op ::= EXCEPT|INTERSECT */ yytestcase(yyruleno==117);
116690 {yygotominor.yy328 = yymsp[0].major;}
116691 break;
116692 case 17: /* cmd ::= COMMIT trans_opt */
116693 case 18: /* cmd ::= END trans_opt */ yytestcase(yyruleno==18);
116694 {sqlite3CommitTransaction(pParse);}
116695 break;
@@ -116218,11 +116711,11 @@
116711 sqlite3Savepoint(pParse, SAVEPOINT_ROLLBACK, &yymsp[0].minor.yy0);
116712 }
116713 break;
116714 case 26: /* create_table ::= createkw temp TABLE ifnotexists nm dbnm */
116715 {
116716 sqlite3StartTable(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,yymsp[-4].minor.yy328,0,0,yymsp[-2].minor.yy328);
116717 }
116718 break;
116719 case 27: /* createkw ::= CREATE */
116720 {
116721 pParse->db->lookaside.bEnabled = 0;
@@ -116229,49 +116722,49 @@
116722 yygotominor.yy0 = yymsp[0].minor.yy0;
116723 }
116724 break;
116725 case 28: /* ifnotexists ::= */
116726 case 31: /* temp ::= */ yytestcase(yyruleno==31);
116727 case 68: /* autoinc ::= */ yytestcase(yyruleno==68);
116728 case 81: /* defer_subclause ::= NOT DEFERRABLE init_deferred_pred_opt */ yytestcase(yyruleno==81);
116729 case 83: /* init_deferred_pred_opt ::= */ yytestcase(yyruleno==83);
116730 case 85: /* init_deferred_pred_opt ::= INITIALLY IMMEDIATE */ yytestcase(yyruleno==85);
116731 case 97: /* defer_subclause_opt ::= */ yytestcase(yyruleno==97);
116732 case 108: /* ifexists ::= */ yytestcase(yyruleno==108);
116733 case 218: /* between_op ::= BETWEEN */ yytestcase(yyruleno==218);
116734 case 221: /* in_op ::= IN */ yytestcase(yyruleno==221);
116735 {yygotominor.yy328 = 0;}
116736 break;
116737 case 29: /* ifnotexists ::= IF NOT EXISTS */
116738 case 30: /* temp ::= TEMP */ yytestcase(yyruleno==30);
116739 case 69: /* autoinc ::= AUTOINCR */ yytestcase(yyruleno==69);
116740 case 84: /* init_deferred_pred_opt ::= INITIALLY DEFERRED */ yytestcase(yyruleno==84);
116741 case 107: /* ifexists ::= IF EXISTS */ yytestcase(yyruleno==107);
116742 case 219: /* between_op ::= NOT BETWEEN */ yytestcase(yyruleno==219);
116743 case 222: /* in_op ::= NOT IN */ yytestcase(yyruleno==222);
116744 {yygotominor.yy328 = 1;}
116745 break;
116746 case 32: /* create_table_args ::= LP columnlist conslist_opt RP table_options */
116747 {
116748 sqlite3EndTable(pParse,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0,yymsp[0].minor.yy186,0);
116749 }
116750 break;
116751 case 33: /* create_table_args ::= AS select */
116752 {
116753 sqlite3EndTable(pParse,0,0,0,yymsp[0].minor.yy3);
116754 sqlite3SelectDelete(pParse->db, yymsp[0].minor.yy3);
116755 }
116756 break;
116757 case 34: /* table_options ::= */
116758 {yygotominor.yy186 = 0;}
116759 break;
116760 case 35: /* table_options ::= WITHOUT nm */
116761 {
116762 if( yymsp[0].minor.yy0.n==5 && sqlite3_strnicmp(yymsp[0].minor.yy0.z,"rowid",5)==0 ){
116763 yygotominor.yy186 = TF_WithoutRowid;
116764 }else{
116765 yygotominor.yy186 = 0;
116766 sqlite3ErrorMsg(pParse, "unknown table option: %.*s", yymsp[0].minor.yy0.n, yymsp[0].minor.yy0.z);
116767 }
116768 }
116769 break;
116770 case 38: /* column ::= columnid type carglist */
@@ -116285,1004 +116778,1016 @@
116778 sqlite3AddColumn(pParse,&yymsp[0].minor.yy0);
116779 yygotominor.yy0 = yymsp[0].minor.yy0;
116780 pParse->constraintName.n = 0;
116781 }
116782 break;
116783 case 40: /* nm ::= ID|INDEXED */
116784 case 41: /* nm ::= STRING */ yytestcase(yyruleno==41);
116785 case 42: /* nm ::= JOIN_KW */ yytestcase(yyruleno==42);
116786 case 45: /* typetoken ::= typename */ yytestcase(yyruleno==45);
116787 case 48: /* typename ::= ID|STRING */ yytestcase(yyruleno==48);
116788 case 130: /* as ::= AS nm */ yytestcase(yyruleno==130);
116789 case 131: /* as ::= ID|STRING */ yytestcase(yyruleno==131);
116790 case 141: /* dbnm ::= DOT nm */ yytestcase(yyruleno==141);
116791 case 150: /* indexed_opt ::= INDEXED BY nm */ yytestcase(yyruleno==150);
116792 case 247: /* collate ::= COLLATE ID|STRING */ yytestcase(yyruleno==247);
116793 case 256: /* nmnum ::= plus_num */ yytestcase(yyruleno==256);
116794 case 257: /* nmnum ::= nm */ yytestcase(yyruleno==257);
116795 case 258: /* nmnum ::= ON */ yytestcase(yyruleno==258);
116796 case 259: /* nmnum ::= DELETE */ yytestcase(yyruleno==259);
116797 case 260: /* nmnum ::= DEFAULT */ yytestcase(yyruleno==260);
116798 case 261: /* plus_num ::= PLUS INTEGER|FLOAT */ yytestcase(yyruleno==261);
116799 case 262: /* plus_num ::= INTEGER|FLOAT */ yytestcase(yyruleno==262);
116800 case 263: /* minus_num ::= MINUS INTEGER|FLOAT */ yytestcase(yyruleno==263);
116801 case 279: /* trnm ::= nm */ yytestcase(yyruleno==279);
 
 
 
 
116802 {yygotominor.yy0 = yymsp[0].minor.yy0;}
116803 break;
116804 case 44: /* type ::= typetoken */
116805 {sqlite3AddColumnType(pParse,&yymsp[0].minor.yy0);}
116806 break;
116807 case 46: /* typetoken ::= typename LP signed RP */
116808 {
116809 yygotominor.yy0.z = yymsp[-3].minor.yy0.z;
116810 yygotominor.yy0.n = (int)(&yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n] - yymsp[-3].minor.yy0.z);
116811 }
116812 break;
116813 case 47: /* typetoken ::= typename LP signed COMMA signed RP */
116814 {
116815 yygotominor.yy0.z = yymsp[-5].minor.yy0.z;
116816 yygotominor.yy0.n = (int)(&yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n] - yymsp[-5].minor.yy0.z);
116817 }
116818 break;
116819 case 49: /* typename ::= typename ID|STRING */
116820 {yygotominor.yy0.z=yymsp[-1].minor.yy0.z; yygotominor.yy0.n=yymsp[0].minor.yy0.n+(int)(yymsp[0].minor.yy0.z-yymsp[-1].minor.yy0.z);}
116821 break;
116822 case 54: /* ccons ::= CONSTRAINT nm */
116823 case 92: /* tcons ::= CONSTRAINT nm */ yytestcase(yyruleno==92);
116824 {pParse->constraintName = yymsp[0].minor.yy0;}
116825 break;
116826 case 55: /* ccons ::= DEFAULT term */
116827 case 57: /* ccons ::= DEFAULT PLUS term */ yytestcase(yyruleno==57);
116828 {sqlite3AddDefaultValue(pParse,&yymsp[0].minor.yy346);}
116829 break;
116830 case 56: /* ccons ::= DEFAULT LP expr RP */
116831 {sqlite3AddDefaultValue(pParse,&yymsp[-1].minor.yy346);}
116832 break;
116833 case 58: /* ccons ::= DEFAULT MINUS term */
116834 {
116835 ExprSpan v;
116836 v.pExpr = sqlite3PExpr(pParse, TK_UMINUS, yymsp[0].minor.yy346.pExpr, 0, 0);
116837 v.zStart = yymsp[-1].minor.yy0.z;
116838 v.zEnd = yymsp[0].minor.yy346.zEnd;
116839 sqlite3AddDefaultValue(pParse,&v);
116840 }
116841 break;
116842 case 59: /* ccons ::= DEFAULT ID|INDEXED */
116843 {
116844 ExprSpan v;
116845 spanExpr(&v, pParse, TK_STRING, &yymsp[0].minor.yy0);
116846 sqlite3AddDefaultValue(pParse,&v);
116847 }
116848 break;
116849 case 61: /* ccons ::= NOT NULL onconf */
116850 {sqlite3AddNotNull(pParse, yymsp[0].minor.yy328);}
116851 break;
116852 case 62: /* ccons ::= PRIMARY KEY sortorder onconf autoinc */
116853 {sqlite3AddPrimaryKey(pParse,0,yymsp[-1].minor.yy328,yymsp[0].minor.yy328,yymsp[-2].minor.yy328);}
116854 break;
116855 case 63: /* ccons ::= UNIQUE onconf */
116856 {sqlite3CreateIndex(pParse,0,0,0,0,yymsp[0].minor.yy328,0,0,0,0);}
116857 break;
116858 case 64: /* ccons ::= CHECK LP expr RP */
116859 {sqlite3AddCheckConstraint(pParse,yymsp[-1].minor.yy346.pExpr);}
116860 break;
116861 case 65: /* ccons ::= REFERENCES nm idxlist_opt refargs */
116862 {sqlite3CreateForeignKey(pParse,0,&yymsp[-2].minor.yy0,yymsp[-1].minor.yy14,yymsp[0].minor.yy328);}
116863 break;
116864 case 66: /* ccons ::= defer_subclause */
116865 {sqlite3DeferForeignKey(pParse,yymsp[0].minor.yy328);}
116866 break;
116867 case 67: /* ccons ::= COLLATE ID|STRING */
116868 {sqlite3AddCollateType(pParse, &yymsp[0].minor.yy0);}
116869 break;
116870 case 70: /* refargs ::= */
116871 { yygotominor.yy328 = OE_None*0x0101; /* EV: R-19803-45884 */}
116872 break;
116873 case 71: /* refargs ::= refargs refarg */
116874 { yygotominor.yy328 = (yymsp[-1].minor.yy328 & ~yymsp[0].minor.yy429.mask) | yymsp[0].minor.yy429.value; }
116875 break;
116876 case 72: /* refarg ::= MATCH nm */
116877 case 73: /* refarg ::= ON INSERT refact */ yytestcase(yyruleno==73);
116878 { yygotominor.yy429.value = 0; yygotominor.yy429.mask = 0x000000; }
116879 break;
116880 case 74: /* refarg ::= ON DELETE refact */
116881 { yygotominor.yy429.value = yymsp[0].minor.yy328; yygotominor.yy429.mask = 0x0000ff; }
116882 break;
116883 case 75: /* refarg ::= ON UPDATE refact */
116884 { yygotominor.yy429.value = yymsp[0].minor.yy328<<8; yygotominor.yy429.mask = 0x00ff00; }
116885 break;
116886 case 76: /* refact ::= SET NULL */
116887 { yygotominor.yy328 = OE_SetNull; /* EV: R-33326-45252 */}
116888 break;
116889 case 77: /* refact ::= SET DEFAULT */
116890 { yygotominor.yy328 = OE_SetDflt; /* EV: R-33326-45252 */}
116891 break;
116892 case 78: /* refact ::= CASCADE */
116893 { yygotominor.yy328 = OE_Cascade; /* EV: R-33326-45252 */}
116894 break;
116895 case 79: /* refact ::= RESTRICT */
116896 { yygotominor.yy328 = OE_Restrict; /* EV: R-33326-45252 */}
116897 break;
116898 case 80: /* refact ::= NO ACTION */
116899 { yygotominor.yy328 = OE_None; /* EV: R-33326-45252 */}
116900 break;
116901 case 82: /* defer_subclause ::= DEFERRABLE init_deferred_pred_opt */
116902 case 98: /* defer_subclause_opt ::= defer_subclause */ yytestcase(yyruleno==98);
116903 case 100: /* onconf ::= ON CONFLICT resolvetype */ yytestcase(yyruleno==100);
116904 case 103: /* resolvetype ::= raisetype */ yytestcase(yyruleno==103);
116905 {yygotominor.yy328 = yymsp[0].minor.yy328;}
116906 break;
116907 case 86: /* conslist_opt ::= */
116908 {yygotominor.yy0.n = 0; yygotominor.yy0.z = 0;}
116909 break;
116910 case 87: /* conslist_opt ::= COMMA conslist */
116911 {yygotominor.yy0 = yymsp[-1].minor.yy0;}
116912 break;
116913 case 90: /* tconscomma ::= COMMA */
116914 {pParse->constraintName.n = 0;}
116915 break;
116916 case 93: /* tcons ::= PRIMARY KEY LP idxlist autoinc RP onconf */
116917 {sqlite3AddPrimaryKey(pParse,yymsp[-3].minor.yy14,yymsp[0].minor.yy328,yymsp[-2].minor.yy328,0);}
116918 break;
116919 case 94: /* tcons ::= UNIQUE LP idxlist RP onconf */
116920 {sqlite3CreateIndex(pParse,0,0,0,yymsp[-2].minor.yy14,yymsp[0].minor.yy328,0,0,0,0);}
116921 break;
116922 case 95: /* tcons ::= CHECK LP expr RP onconf */
116923 {sqlite3AddCheckConstraint(pParse,yymsp[-2].minor.yy346.pExpr);}
116924 break;
116925 case 96: /* tcons ::= FOREIGN KEY LP idxlist RP REFERENCES nm idxlist_opt refargs defer_subclause_opt */
116926 {
116927 sqlite3CreateForeignKey(pParse, yymsp[-6].minor.yy14, &yymsp[-3].minor.yy0, yymsp[-2].minor.yy14, yymsp[-1].minor.yy328);
116928 sqlite3DeferForeignKey(pParse, yymsp[0].minor.yy328);
116929 }
116930 break;
116931 case 99: /* onconf ::= */
116932 {yygotominor.yy328 = OE_Default;}
116933 break;
116934 case 101: /* orconf ::= */
116935 {yygotominor.yy186 = OE_Default;}
116936 break;
116937 case 102: /* orconf ::= OR resolvetype */
116938 {yygotominor.yy186 = (u8)yymsp[0].minor.yy328;}
116939 break;
116940 case 104: /* resolvetype ::= IGNORE */
116941 {yygotominor.yy328 = OE_Ignore;}
116942 break;
116943 case 105: /* resolvetype ::= REPLACE */
116944 {yygotominor.yy328 = OE_Replace;}
116945 break;
116946 case 106: /* cmd ::= DROP TABLE ifexists fullname */
116947 {
116948 sqlite3DropTable(pParse, yymsp[0].minor.yy65, 0, yymsp[-1].minor.yy328);
116949 }
116950 break;
116951 case 109: /* cmd ::= createkw temp VIEW ifnotexists nm dbnm AS select */
116952 {
116953 sqlite3CreateView(pParse, &yymsp[-7].minor.yy0, &yymsp[-3].minor.yy0, &yymsp[-2].minor.yy0, yymsp[0].minor.yy3, yymsp[-6].minor.yy328, yymsp[-4].minor.yy328);
116954 }
116955 break;
116956 case 110: /* cmd ::= DROP VIEW ifexists fullname */
116957 {
116958 sqlite3DropTable(pParse, yymsp[0].minor.yy65, 1, yymsp[-1].minor.yy328);
116959 }
116960 break;
116961 case 111: /* cmd ::= select */
116962 {
116963 SelectDest dest = {SRT_Output, 0, 0, 0, 0};
116964 sqlite3Select(pParse, yymsp[0].minor.yy3, &dest);
116965 sqlite3ExplainBegin(pParse->pVdbe);
116966 sqlite3ExplainSelect(pParse->pVdbe, yymsp[0].minor.yy3);
116967 sqlite3ExplainFinish(pParse->pVdbe);
116968 sqlite3SelectDelete(pParse->db, yymsp[0].minor.yy3);
116969 }
116970 break;
116971 case 112: /* select ::= with selectnowith */
116972 {
116973 if( yymsp[0].minor.yy3 ){
116974 yymsp[0].minor.yy3->pWith = yymsp[-1].minor.yy59;
116975 }else{
116976 sqlite3WithDelete(pParse->db, yymsp[-1].minor.yy59);
116977 }
116978 yygotominor.yy3 = yymsp[0].minor.yy3;
116979 }
116980 break;
116981 case 113: /* selectnowith ::= oneselect */
116982 case 119: /* oneselect ::= values */ yytestcase(yyruleno==119);
116983 {yygotominor.yy3 = yymsp[0].minor.yy3;}
116984 break;
116985 case 114: /* selectnowith ::= selectnowith multiselect_op oneselect */
116986 {
116987 if( yymsp[0].minor.yy3 ){
116988 yymsp[0].minor.yy3->op = (u8)yymsp[-1].minor.yy328;
116989 yymsp[0].minor.yy3->pPrior = yymsp[-2].minor.yy3;
116990 if( yymsp[-1].minor.yy328!=TK_ALL ) pParse->hasCompound = 1;
116991 }else{
116992 sqlite3SelectDelete(pParse->db, yymsp[-2].minor.yy3);
116993 }
116994 yygotominor.yy3 = yymsp[0].minor.yy3;
116995 }
116996 break;
116997 case 116: /* multiselect_op ::= UNION ALL */
116998 {yygotominor.yy328 = TK_ALL;}
116999 break;
117000 case 118: /* oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt orderby_opt limit_opt */
117001 {
117002 yygotominor.yy3 = sqlite3SelectNew(pParse,yymsp[-6].minor.yy14,yymsp[-5].minor.yy65,yymsp[-4].minor.yy132,yymsp[-3].minor.yy14,yymsp[-2].minor.yy132,yymsp[-1].minor.yy14,yymsp[-7].minor.yy381,yymsp[0].minor.yy476.pLimit,yymsp[0].minor.yy476.pOffset);
117003 }
117004 break;
117005 case 120: /* values ::= VALUES LP nexprlist RP */
117006 {
117007 yygotominor.yy3 = sqlite3SelectNew(pParse,yymsp[-1].minor.yy14,0,0,0,0,0,SF_Values,0,0);
117008 }
117009 break;
117010 case 121: /* values ::= values COMMA LP exprlist RP */
117011 {
117012 Select *pRight = sqlite3SelectNew(pParse,yymsp[-1].minor.yy14,0,0,0,0,0,SF_Values,0,0);
117013 if( pRight ){
117014 pRight->op = TK_ALL;
117015 pRight->pPrior = yymsp[-4].minor.yy3;
117016 yygotominor.yy3 = pRight;
117017 }else{
117018 yygotominor.yy3 = yymsp[-4].minor.yy3;
117019 }
117020 }
117021 break;
117022 case 122: /* distinct ::= DISTINCT */
117023 {yygotominor.yy381 = SF_Distinct;}
117024 break;
117025 case 123: /* distinct ::= ALL */
117026 case 124: /* distinct ::= */ yytestcase(yyruleno==124);
117027 {yygotominor.yy381 = 0;}
117028 break;
117029 case 125: /* sclp ::= selcollist COMMA */
117030 case 243: /* idxlist_opt ::= LP idxlist RP */ yytestcase(yyruleno==243);
117031 {yygotominor.yy14 = yymsp[-1].minor.yy14;}
117032 break;
117033 case 126: /* sclp ::= */
117034 case 154: /* orderby_opt ::= */ yytestcase(yyruleno==154);
117035 case 161: /* groupby_opt ::= */ yytestcase(yyruleno==161);
117036 case 236: /* exprlist ::= */ yytestcase(yyruleno==236);
117037 case 242: /* idxlist_opt ::= */ yytestcase(yyruleno==242);
117038 {yygotominor.yy14 = 0;}
117039 break;
117040 case 127: /* selcollist ::= sclp expr as */
117041 {
117042 yygotominor.yy14 = sqlite3ExprListAppend(pParse, yymsp[-2].minor.yy14, yymsp[-1].minor.yy346.pExpr);
117043 if( yymsp[0].minor.yy0.n>0 ) sqlite3ExprListSetName(pParse, yygotominor.yy14, &yymsp[0].minor.yy0, 1);
117044 sqlite3ExprListSetSpan(pParse,yygotominor.yy14,&yymsp[-1].minor.yy346);
117045 }
117046 break;
117047 case 128: /* selcollist ::= sclp STAR */
117048 {
117049 Expr *p = sqlite3Expr(pParse->db, TK_ALL, 0);
117050 yygotominor.yy14 = sqlite3ExprListAppend(pParse, yymsp[-1].minor.yy14, p);
117051 }
117052 break;
117053 case 129: /* selcollist ::= sclp nm DOT STAR */
117054 {
117055 Expr *pRight = sqlite3PExpr(pParse, TK_ALL, 0, 0, &yymsp[0].minor.yy0);
117056 Expr *pLeft = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-2].minor.yy0);
117057 Expr *pDot = sqlite3PExpr(pParse, TK_DOT, pLeft, pRight, 0);
117058 yygotominor.yy14 = sqlite3ExprListAppend(pParse,yymsp[-3].minor.yy14, pDot);
117059 }
117060 break;
117061 case 132: /* as ::= */
117062 {yygotominor.yy0.n = 0;}
117063 break;
117064 case 133: /* from ::= */
117065 {yygotominor.yy65 = sqlite3DbMallocZero(pParse->db, sizeof(*yygotominor.yy65));}
117066 break;
117067 case 134: /* from ::= FROM seltablist */
117068 {
117069 yygotominor.yy65 = yymsp[0].minor.yy65;
117070 sqlite3SrcListShiftJoinType(yygotominor.yy65);
117071 }
117072 break;
117073 case 135: /* stl_prefix ::= seltablist joinop */
117074 {
117075 yygotominor.yy65 = yymsp[-1].minor.yy65;
117076 if( ALWAYS(yygotominor.yy65 && yygotominor.yy65->nSrc>0) ) yygotominor.yy65->a[yygotominor.yy65->nSrc-1].jointype = (u8)yymsp[0].minor.yy328;
117077 }
117078 break;
117079 case 136: /* stl_prefix ::= */
117080 {yygotominor.yy65 = 0;}
117081 break;
117082 case 137: /* seltablist ::= stl_prefix nm dbnm as indexed_opt on_opt using_opt */
117083 {
117084 yygotominor.yy65 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy65,&yymsp[-5].minor.yy0,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,0,yymsp[-1].minor.yy132,yymsp[0].minor.yy408);
117085 sqlite3SrcListIndexedBy(pParse, yygotominor.yy65, &yymsp[-2].minor.yy0);
117086 }
117087 break;
117088 case 138: /* seltablist ::= stl_prefix LP select RP as on_opt using_opt */
117089 {
117090 yygotominor.yy65 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy65,0,0,&yymsp[-2].minor.yy0,yymsp[-4].minor.yy3,yymsp[-1].minor.yy132,yymsp[0].minor.yy408);
117091 }
117092 break;
117093 case 139: /* seltablist ::= stl_prefix LP seltablist RP as on_opt using_opt */
117094 {
117095 if( yymsp[-6].minor.yy65==0 && yymsp[-2].minor.yy0.n==0 && yymsp[-1].minor.yy132==0 && yymsp[0].minor.yy408==0 ){
117096 yygotominor.yy65 = yymsp[-4].minor.yy65;
117097 }else if( yymsp[-4].minor.yy65->nSrc==1 ){
117098 yygotominor.yy65 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy65,0,0,&yymsp[-2].minor.yy0,0,yymsp[-1].minor.yy132,yymsp[0].minor.yy408);
117099 if( yygotominor.yy65 ){
117100 struct SrcList_item *pNew = &yygotominor.yy65->a[yygotominor.yy65->nSrc-1];
117101 struct SrcList_item *pOld = yymsp[-4].minor.yy65->a;
117102 pNew->zName = pOld->zName;
117103 pNew->zDatabase = pOld->zDatabase;
117104 pNew->pSelect = pOld->pSelect;
117105 pOld->zName = pOld->zDatabase = 0;
117106 pOld->pSelect = 0;
117107 }
117108 sqlite3SrcListDelete(pParse->db, yymsp[-4].minor.yy65);
117109 }else{
117110 Select *pSubquery;
117111 sqlite3SrcListShiftJoinType(yymsp[-4].minor.yy65);
117112 pSubquery = sqlite3SelectNew(pParse,0,yymsp[-4].minor.yy65,0,0,0,0,SF_NestedFrom,0,0);
117113 yygotominor.yy65 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy65,0,0,&yymsp[-2].minor.yy0,pSubquery,yymsp[-1].minor.yy132,yymsp[0].minor.yy408);
117114 }
117115 }
117116 break;
117117 case 140: /* dbnm ::= */
117118 case 149: /* indexed_opt ::= */ yytestcase(yyruleno==149);
117119 {yygotominor.yy0.z=0; yygotominor.yy0.n=0;}
117120 break;
117121 case 142: /* fullname ::= nm dbnm */
117122 {yygotominor.yy65 = sqlite3SrcListAppend(pParse->db,0,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0);}
117123 break;
117124 case 143: /* joinop ::= COMMA|JOIN */
117125 { yygotominor.yy328 = JT_INNER; }
117126 break;
117127 case 144: /* joinop ::= JOIN_KW JOIN */
117128 { yygotominor.yy328 = sqlite3JoinType(pParse,&yymsp[-1].minor.yy0,0,0); }
117129 break;
117130 case 145: /* joinop ::= JOIN_KW nm JOIN */
117131 { yygotominor.yy328 = sqlite3JoinType(pParse,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0,0); }
117132 break;
117133 case 146: /* joinop ::= JOIN_KW nm nm JOIN */
117134 { yygotominor.yy328 = sqlite3JoinType(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0); }
117135 break;
117136 case 147: /* on_opt ::= ON expr */
117137 case 164: /* having_opt ::= HAVING expr */ yytestcase(yyruleno==164);
117138 case 171: /* where_opt ::= WHERE expr */ yytestcase(yyruleno==171);
117139 case 231: /* case_else ::= ELSE expr */ yytestcase(yyruleno==231);
117140 case 233: /* case_operand ::= expr */ yytestcase(yyruleno==233);
117141 {yygotominor.yy132 = yymsp[0].minor.yy346.pExpr;}
117142 break;
117143 case 148: /* on_opt ::= */
117144 case 163: /* having_opt ::= */ yytestcase(yyruleno==163);
117145 case 170: /* where_opt ::= */ yytestcase(yyruleno==170);
117146 case 232: /* case_else ::= */ yytestcase(yyruleno==232);
117147 case 234: /* case_operand ::= */ yytestcase(yyruleno==234);
117148 {yygotominor.yy132 = 0;}
117149 break;
117150 case 151: /* indexed_opt ::= NOT INDEXED */
117151 {yygotominor.yy0.z=0; yygotominor.yy0.n=1;}
117152 break;
117153 case 152: /* using_opt ::= USING LP idlist RP */
117154 case 180: /* inscollist_opt ::= LP idlist RP */ yytestcase(yyruleno==180);
117155 {yygotominor.yy408 = yymsp[-1].minor.yy408;}
117156 break;
117157 case 153: /* using_opt ::= */
117158 case 179: /* inscollist_opt ::= */ yytestcase(yyruleno==179);
117159 {yygotominor.yy408 = 0;}
117160 break;
117161 case 155: /* orderby_opt ::= ORDER BY sortlist */
117162 case 162: /* groupby_opt ::= GROUP BY nexprlist */ yytestcase(yyruleno==162);
117163 case 235: /* exprlist ::= nexprlist */ yytestcase(yyruleno==235);
117164 {yygotominor.yy14 = yymsp[0].minor.yy14;}
117165 break;
117166 case 156: /* sortlist ::= sortlist COMMA expr sortorder */
117167 {
117168 yygotominor.yy14 = sqlite3ExprListAppend(pParse,yymsp[-3].minor.yy14,yymsp[-1].minor.yy346.pExpr);
117169 if( yygotominor.yy14 ) yygotominor.yy14->a[yygotominor.yy14->nExpr-1].sortOrder = (u8)yymsp[0].minor.yy328;
117170 }
117171 break;
117172 case 157: /* sortlist ::= expr sortorder */
117173 {
117174 yygotominor.yy14 = sqlite3ExprListAppend(pParse,0,yymsp[-1].minor.yy346.pExpr);
117175 if( yygotominor.yy14 && ALWAYS(yygotominor.yy14->a) ) yygotominor.yy14->a[0].sortOrder = (u8)yymsp[0].minor.yy328;
117176 }
117177 break;
117178 case 158: /* sortorder ::= ASC */
117179 case 160: /* sortorder ::= */ yytestcase(yyruleno==160);
117180 {yygotominor.yy328 = SQLITE_SO_ASC;}
117181 break;
117182 case 159: /* sortorder ::= DESC */
117183 {yygotominor.yy328 = SQLITE_SO_DESC;}
117184 break;
117185 case 165: /* limit_opt ::= */
117186 {yygotominor.yy476.pLimit = 0; yygotominor.yy476.pOffset = 0;}
117187 break;
117188 case 166: /* limit_opt ::= LIMIT expr */
117189 {yygotominor.yy476.pLimit = yymsp[0].minor.yy346.pExpr; yygotominor.yy476.pOffset = 0;}
117190 break;
117191 case 167: /* limit_opt ::= LIMIT expr OFFSET expr */
117192 {yygotominor.yy476.pLimit = yymsp[-2].minor.yy346.pExpr; yygotominor.yy476.pOffset = yymsp[0].minor.yy346.pExpr;}
117193 break;
117194 case 168: /* limit_opt ::= LIMIT expr COMMA expr */
117195 {yygotominor.yy476.pOffset = yymsp[-2].minor.yy346.pExpr; yygotominor.yy476.pLimit = yymsp[0].minor.yy346.pExpr;}
117196 break;
117197 case 169: /* cmd ::= with DELETE FROM fullname indexed_opt where_opt */
117198 {
117199 sqlite3WithPush(pParse, yymsp[-5].minor.yy59, 1);
117200 sqlite3SrcListIndexedBy(pParse, yymsp[-2].minor.yy65, &yymsp[-1].minor.yy0);
117201 sqlite3DeleteFrom(pParse,yymsp[-2].minor.yy65,yymsp[0].minor.yy132);
117202 }
117203 break;
117204 case 172: /* cmd ::= with UPDATE orconf fullname indexed_opt SET setlist where_opt */
117205 {
117206 sqlite3WithPush(pParse, yymsp[-7].minor.yy59, 1);
117207 sqlite3SrcListIndexedBy(pParse, yymsp[-4].minor.yy65, &yymsp[-3].minor.yy0);
117208 sqlite3ExprListCheckLength(pParse,yymsp[-1].minor.yy14,"set list");
117209 sqlite3Update(pParse,yymsp[-4].minor.yy65,yymsp[-1].minor.yy14,yymsp[0].minor.yy132,yymsp[-5].minor.yy186);
117210 }
117211 break;
117212 case 173: /* setlist ::= setlist COMMA nm EQ expr */
117213 {
117214 yygotominor.yy14 = sqlite3ExprListAppend(pParse, yymsp[-4].minor.yy14, yymsp[0].minor.yy346.pExpr);
117215 sqlite3ExprListSetName(pParse, yygotominor.yy14, &yymsp[-2].minor.yy0, 1);
117216 }
117217 break;
117218 case 174: /* setlist ::= nm EQ expr */
117219 {
117220 yygotominor.yy14 = sqlite3ExprListAppend(pParse, 0, yymsp[0].minor.yy346.pExpr);
117221 sqlite3ExprListSetName(pParse, yygotominor.yy14, &yymsp[-2].minor.yy0, 1);
117222 }
117223 break;
117224 case 175: /* cmd ::= with insert_cmd INTO fullname inscollist_opt select */
117225 {
117226 sqlite3WithPush(pParse, yymsp[-5].minor.yy59, 1);
117227 sqlite3Insert(pParse, yymsp[-2].minor.yy65, yymsp[0].minor.yy3, yymsp[-1].minor.yy408, yymsp[-4].minor.yy186);
117228 }
117229 break;
117230 case 176: /* cmd ::= with insert_cmd INTO fullname inscollist_opt DEFAULT VALUES */
117231 {
117232 sqlite3WithPush(pParse, yymsp[-6].minor.yy59, 1);
117233 sqlite3Insert(pParse, yymsp[-3].minor.yy65, 0, yymsp[-2].minor.yy408, yymsp[-5].minor.yy186);
117234 }
117235 break;
117236 case 177: /* insert_cmd ::= INSERT orconf */
117237 {yygotominor.yy186 = yymsp[0].minor.yy186;}
117238 break;
117239 case 178: /* insert_cmd ::= REPLACE */
117240 {yygotominor.yy186 = OE_Replace;}
117241 break;
117242 case 181: /* idlist ::= idlist COMMA nm */
117243 {yygotominor.yy408 = sqlite3IdListAppend(pParse->db,yymsp[-2].minor.yy408,&yymsp[0].minor.yy0);}
117244 break;
117245 case 182: /* idlist ::= nm */
117246 {yygotominor.yy408 = sqlite3IdListAppend(pParse->db,0,&yymsp[0].minor.yy0);}
117247 break;
117248 case 183: /* expr ::= term */
117249 {yygotominor.yy346 = yymsp[0].minor.yy346;}
117250 break;
117251 case 184: /* expr ::= LP expr RP */
117252 {yygotominor.yy346.pExpr = yymsp[-1].minor.yy346.pExpr; spanSet(&yygotominor.yy346,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0);}
117253 break;
117254 case 185: /* term ::= NULL */
117255 case 190: /* term ::= INTEGER|FLOAT|BLOB */ yytestcase(yyruleno==190);
117256 case 191: /* term ::= STRING */ yytestcase(yyruleno==191);
117257 {spanExpr(&yygotominor.yy346, pParse, yymsp[0].major, &yymsp[0].minor.yy0);}
117258 break;
117259 case 186: /* expr ::= ID|INDEXED */
117260 case 187: /* expr ::= JOIN_KW */ yytestcase(yyruleno==187);
117261 {spanExpr(&yygotominor.yy346, pParse, TK_ID, &yymsp[0].minor.yy0);}
117262 break;
117263 case 188: /* expr ::= nm DOT nm */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
117264 {
117265 Expr *temp1 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-2].minor.yy0);
117266 Expr *temp2 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[0].minor.yy0);
117267 yygotominor.yy346.pExpr = sqlite3PExpr(pParse, TK_DOT, temp1, temp2, 0);
117268 spanSet(&yygotominor.yy346,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0);
117269 }
117270 break;
117271 case 189: /* expr ::= nm DOT nm DOT nm */
117272 {
117273 Expr *temp1 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-4].minor.yy0);
117274 Expr *temp2 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-2].minor.yy0);
117275 Expr *temp3 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[0].minor.yy0);
117276 Expr *temp4 = sqlite3PExpr(pParse, TK_DOT, temp2, temp3, 0);
117277 yygotominor.yy346.pExpr = sqlite3PExpr(pParse, TK_DOT, temp1, temp4, 0);
117278 spanSet(&yygotominor.yy346,&yymsp[-4].minor.yy0,&yymsp[0].minor.yy0);
117279 }
117280 break;
117281 case 192: /* expr ::= VARIABLE */
117282 {
117283 if( yymsp[0].minor.yy0.n>=2 && yymsp[0].minor.yy0.z[0]=='#' && sqlite3Isdigit(yymsp[0].minor.yy0.z[1]) ){
117284 /* When doing a nested parse, one can include terms in an expression
117285 ** that look like this: #1 #2 ... These terms refer to registers
117286 ** in the virtual machine. #N is the N-th register. */
117287 if( pParse->nested==0 ){
117288 sqlite3ErrorMsg(pParse, "near \"%T\": syntax error", &yymsp[0].minor.yy0);
117289 yygotominor.yy346.pExpr = 0;
117290 }else{
117291 yygotominor.yy346.pExpr = sqlite3PExpr(pParse, TK_REGISTER, 0, 0, &yymsp[0].minor.yy0);
117292 if( yygotominor.yy346.pExpr ) sqlite3GetInt32(&yymsp[0].minor.yy0.z[1], &yygotominor.yy346.pExpr->iTable);
117293 }
117294 }else{
117295 spanExpr(&yygotominor.yy346, pParse, TK_VARIABLE, &yymsp[0].minor.yy0);
117296 sqlite3ExprAssignVarNumber(pParse, yygotominor.yy346.pExpr);
117297 }
117298 spanSet(&yygotominor.yy346, &yymsp[0].minor.yy0, &yymsp[0].minor.yy0);
117299 }
117300 break;
117301 case 193: /* expr ::= expr COLLATE ID|STRING */
117302 {
117303 yygotominor.yy346.pExpr = sqlite3ExprAddCollateToken(pParse, yymsp[-2].minor.yy346.pExpr, &yymsp[0].minor.yy0);
117304 yygotominor.yy346.zStart = yymsp[-2].minor.yy346.zStart;
117305 yygotominor.yy346.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
117306 }
117307 break;
117308 case 194: /* expr ::= CAST LP expr AS typetoken RP */
117309 {
117310 yygotominor.yy346.pExpr = sqlite3PExpr(pParse, TK_CAST, yymsp[-3].minor.yy346.pExpr, 0, &yymsp[-1].minor.yy0);
117311 spanSet(&yygotominor.yy346,&yymsp[-5].minor.yy0,&yymsp[0].minor.yy0);
117312 }
117313 break;
117314 case 195: /* expr ::= ID|INDEXED LP distinct exprlist RP */
117315 {
117316 if( yymsp[-1].minor.yy14 && yymsp[-1].minor.yy14->nExpr>pParse->db->aLimit[SQLITE_LIMIT_FUNCTION_ARG] ){
117317 sqlite3ErrorMsg(pParse, "too many arguments on function %T", &yymsp[-4].minor.yy0);
117318 }
117319 yygotominor.yy346.pExpr = sqlite3ExprFunction(pParse, yymsp[-1].minor.yy14, &yymsp[-4].minor.yy0);
117320 spanSet(&yygotominor.yy346,&yymsp[-4].minor.yy0,&yymsp[0].minor.yy0);
117321 if( yymsp[-2].minor.yy381 && yygotominor.yy346.pExpr ){
117322 yygotominor.yy346.pExpr->flags |= EP_Distinct;
117323 }
117324 }
117325 break;
117326 case 196: /* expr ::= ID|INDEXED LP STAR RP */
117327 {
117328 yygotominor.yy346.pExpr = sqlite3ExprFunction(pParse, 0, &yymsp[-3].minor.yy0);
117329 spanSet(&yygotominor.yy346,&yymsp[-3].minor.yy0,&yymsp[0].minor.yy0);
117330 }
117331 break;
117332 case 197: /* term ::= CTIME_KW */
117333 {
117334 yygotominor.yy346.pExpr = sqlite3ExprFunction(pParse, 0, &yymsp[0].minor.yy0);
117335 spanSet(&yygotominor.yy346, &yymsp[0].minor.yy0, &yymsp[0].minor.yy0);
117336 }
117337 break;
117338 case 198: /* expr ::= expr AND expr */
117339 case 199: /* expr ::= expr OR expr */ yytestcase(yyruleno==199);
117340 case 200: /* expr ::= expr LT|GT|GE|LE expr */ yytestcase(yyruleno==200);
117341 case 201: /* expr ::= expr EQ|NE expr */ yytestcase(yyruleno==201);
117342 case 202: /* expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr */ yytestcase(yyruleno==202);
117343 case 203: /* expr ::= expr PLUS|MINUS expr */ yytestcase(yyruleno==203);
117344 case 204: /* expr ::= expr STAR|SLASH|REM expr */ yytestcase(yyruleno==204);
117345 case 205: /* expr ::= expr CONCAT expr */ yytestcase(yyruleno==205);
117346 {spanBinaryExpr(&yygotominor.yy346,pParse,yymsp[-1].major,&yymsp[-2].minor.yy346,&yymsp[0].minor.yy346);}
117347 break;
117348 case 206: /* likeop ::= LIKE_KW|MATCH */
117349 {yygotominor.yy96.eOperator = yymsp[0].minor.yy0; yygotominor.yy96.bNot = 0;}
117350 break;
117351 case 207: /* likeop ::= NOT LIKE_KW|MATCH */
117352 {yygotominor.yy96.eOperator = yymsp[0].minor.yy0; yygotominor.yy96.bNot = 1;}
117353 break;
117354 case 208: /* expr ::= expr likeop expr */
117355 {
117356 ExprList *pList;
117357 pList = sqlite3ExprListAppend(pParse,0, yymsp[0].minor.yy346.pExpr);
117358 pList = sqlite3ExprListAppend(pParse,pList, yymsp[-2].minor.yy346.pExpr);
117359 yygotominor.yy346.pExpr = sqlite3ExprFunction(pParse, pList, &yymsp[-1].minor.yy96.eOperator);
117360 if( yymsp[-1].minor.yy96.bNot ) yygotominor.yy346.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy346.pExpr, 0, 0);
117361 yygotominor.yy346.zStart = yymsp[-2].minor.yy346.zStart;
117362 yygotominor.yy346.zEnd = yymsp[0].minor.yy346.zEnd;
117363 if( yygotominor.yy346.pExpr ) yygotominor.yy346.pExpr->flags |= EP_InfixFunc;
117364 }
117365 break;
117366 case 209: /* expr ::= expr likeop expr ESCAPE expr */
117367 {
117368 ExprList *pList;
117369 pList = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy346.pExpr);
117370 pList = sqlite3ExprListAppend(pParse,pList, yymsp[-4].minor.yy346.pExpr);
117371 pList = sqlite3ExprListAppend(pParse,pList, yymsp[0].minor.yy346.pExpr);
117372 yygotominor.yy346.pExpr = sqlite3ExprFunction(pParse, pList, &yymsp[-3].minor.yy96.eOperator);
117373 if( yymsp[-3].minor.yy96.bNot ) yygotominor.yy346.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy346.pExpr, 0, 0);
117374 yygotominor.yy346.zStart = yymsp[-4].minor.yy346.zStart;
117375 yygotominor.yy346.zEnd = yymsp[0].minor.yy346.zEnd;
117376 if( yygotominor.yy346.pExpr ) yygotominor.yy346.pExpr->flags |= EP_InfixFunc;
117377 }
117378 break;
117379 case 210: /* expr ::= expr ISNULL|NOTNULL */
117380 {spanUnaryPostfix(&yygotominor.yy346,pParse,yymsp[0].major,&yymsp[-1].minor.yy346,&yymsp[0].minor.yy0);}
117381 break;
117382 case 211: /* expr ::= expr NOT NULL */
117383 {spanUnaryPostfix(&yygotominor.yy346,pParse,TK_NOTNULL,&yymsp[-2].minor.yy346,&yymsp[0].minor.yy0);}
117384 break;
117385 case 212: /* expr ::= expr IS expr */
117386 {
117387 spanBinaryExpr(&yygotominor.yy346,pParse,TK_IS,&yymsp[-2].minor.yy346,&yymsp[0].minor.yy346);
117388 binaryToUnaryIfNull(pParse, yymsp[0].minor.yy346.pExpr, yygotominor.yy346.pExpr, TK_ISNULL);
117389 }
117390 break;
117391 case 213: /* expr ::= expr IS NOT expr */
117392 {
117393 spanBinaryExpr(&yygotominor.yy346,pParse,TK_ISNOT,&yymsp[-3].minor.yy346,&yymsp[0].minor.yy346);
117394 binaryToUnaryIfNull(pParse, yymsp[0].minor.yy346.pExpr, yygotominor.yy346.pExpr, TK_NOTNULL);
117395 }
117396 break;
117397 case 214: /* expr ::= NOT expr */
117398 case 215: /* expr ::= BITNOT expr */ yytestcase(yyruleno==215);
117399 {spanUnaryPrefix(&yygotominor.yy346,pParse,yymsp[-1].major,&yymsp[0].minor.yy346,&yymsp[-1].minor.yy0);}
117400 break;
117401 case 216: /* expr ::= MINUS expr */
117402 {spanUnaryPrefix(&yygotominor.yy346,pParse,TK_UMINUS,&yymsp[0].minor.yy346,&yymsp[-1].minor.yy0);}
117403 break;
117404 case 217: /* expr ::= PLUS expr */
117405 {spanUnaryPrefix(&yygotominor.yy346,pParse,TK_UPLUS,&yymsp[0].minor.yy346,&yymsp[-1].minor.yy0);}
117406 break;
117407 case 220: /* expr ::= expr between_op expr AND expr */
117408 {
117409 ExprList *pList = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy346.pExpr);
117410 pList = sqlite3ExprListAppend(pParse,pList, yymsp[0].minor.yy346.pExpr);
117411 yygotominor.yy346.pExpr = sqlite3PExpr(pParse, TK_BETWEEN, yymsp[-4].minor.yy346.pExpr, 0, 0);
117412 if( yygotominor.yy346.pExpr ){
117413 yygotominor.yy346.pExpr->x.pList = pList;
 
 
 
 
117414 }else{
117415 sqlite3ExprListDelete(pParse->db, pList);
117416 }
117417 if( yymsp[-3].minor.yy328 ) yygotominor.yy346.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy346.pExpr, 0, 0);
117418 yygotominor.yy346.zStart = yymsp[-4].minor.yy346.zStart;
117419 yygotominor.yy346.zEnd = yymsp[0].minor.yy346.zEnd;
117420 }
117421 break;
117422 case 223: /* expr ::= expr in_op LP exprlist RP */
117423 {
117424 if( yymsp[-1].minor.yy14==0 ){
117425 /* Expressions of the form
117426 **
117427 ** expr1 IN ()
117428 ** expr1 NOT IN ()
117429 **
117430 ** simplify to constants 0 (false) and 1 (true), respectively,
117431 ** regardless of the value of expr1.
117432 */
117433 yygotominor.yy346.pExpr = sqlite3PExpr(pParse, TK_INTEGER, 0, 0, &sqlite3IntTokens[yymsp[-3].minor.yy328]);
117434 sqlite3ExprDelete(pParse->db, yymsp[-4].minor.yy346.pExpr);
117435 }else{
117436 yygotominor.yy346.pExpr = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy346.pExpr, 0, 0);
117437 if( yygotominor.yy346.pExpr ){
117438 yygotominor.yy346.pExpr->x.pList = yymsp[-1].minor.yy14;
117439 sqlite3ExprSetHeight(pParse, yygotominor.yy346.pExpr);
117440 }else{
117441 sqlite3ExprListDelete(pParse->db, yymsp[-1].minor.yy14);
117442 }
117443 if( yymsp[-3].minor.yy328 ) yygotominor.yy346.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy346.pExpr, 0, 0);
117444 }
117445 yygotominor.yy346.zStart = yymsp[-4].minor.yy346.zStart;
117446 yygotominor.yy346.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
117447 }
117448 break;
117449 case 224: /* expr ::= LP select RP */
117450 {
117451 yygotominor.yy346.pExpr = sqlite3PExpr(pParse, TK_SELECT, 0, 0, 0);
117452 if( yygotominor.yy346.pExpr ){
117453 yygotominor.yy346.pExpr->x.pSelect = yymsp[-1].minor.yy3;
117454 ExprSetProperty(yygotominor.yy346.pExpr, EP_xIsSelect);
117455 sqlite3ExprSetHeight(pParse, yygotominor.yy346.pExpr);
117456 }else{
117457 sqlite3SelectDelete(pParse->db, yymsp[-1].minor.yy3);
117458 }
117459 yygotominor.yy346.zStart = yymsp[-2].minor.yy0.z;
117460 yygotominor.yy346.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
117461 }
117462 break;
117463 case 225: /* expr ::= expr in_op LP select RP */
117464 {
117465 yygotominor.yy346.pExpr = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy346.pExpr, 0, 0);
117466 if( yygotominor.yy346.pExpr ){
117467 yygotominor.yy346.pExpr->x.pSelect = yymsp[-1].minor.yy3;
117468 ExprSetProperty(yygotominor.yy346.pExpr, EP_xIsSelect);
117469 sqlite3ExprSetHeight(pParse, yygotominor.yy346.pExpr);
117470 }else{
117471 sqlite3SelectDelete(pParse->db, yymsp[-1].minor.yy3);
117472 }
117473 if( yymsp[-3].minor.yy328 ) yygotominor.yy346.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy346.pExpr, 0, 0);
117474 yygotominor.yy346.zStart = yymsp[-4].minor.yy346.zStart;
117475 yygotominor.yy346.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
117476 }
117477 break;
117478 case 226: /* expr ::= expr in_op nm dbnm */
117479 {
117480 SrcList *pSrc = sqlite3SrcListAppend(pParse->db, 0,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0);
117481 yygotominor.yy346.pExpr = sqlite3PExpr(pParse, TK_IN, yymsp[-3].minor.yy346.pExpr, 0, 0);
117482 if( yygotominor.yy346.pExpr ){
117483 yygotominor.yy346.pExpr->x.pSelect = sqlite3SelectNew(pParse, 0,pSrc,0,0,0,0,0,0,0);
117484 ExprSetProperty(yygotominor.yy346.pExpr, EP_xIsSelect);
117485 sqlite3ExprSetHeight(pParse, yygotominor.yy346.pExpr);
117486 }else{
117487 sqlite3SrcListDelete(pParse->db, pSrc);
117488 }
117489 if( yymsp[-2].minor.yy328 ) yygotominor.yy346.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy346.pExpr, 0, 0);
117490 yygotominor.yy346.zStart = yymsp[-3].minor.yy346.zStart;
117491 yygotominor.yy346.zEnd = yymsp[0].minor.yy0.z ? &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n] : &yymsp[-1].minor.yy0.z[yymsp[-1].minor.yy0.n];
117492 }
117493 break;
117494 case 227: /* expr ::= EXISTS LP select RP */
117495 {
117496 Expr *p = yygotominor.yy346.pExpr = sqlite3PExpr(pParse, TK_EXISTS, 0, 0, 0);
117497 if( p ){
117498 p->x.pSelect = yymsp[-1].minor.yy3;
117499 ExprSetProperty(p, EP_xIsSelect);
117500 sqlite3ExprSetHeight(pParse, p);
117501 }else{
117502 sqlite3SelectDelete(pParse->db, yymsp[-1].minor.yy3);
117503 }
117504 yygotominor.yy346.zStart = yymsp[-3].minor.yy0.z;
117505 yygotominor.yy346.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
117506 }
117507 break;
117508 case 228: /* expr ::= CASE case_operand case_exprlist case_else END */
117509 {
117510 yygotominor.yy346.pExpr = sqlite3PExpr(pParse, TK_CASE, yymsp[-3].minor.yy132, 0, 0);
117511 if( yygotominor.yy346.pExpr ){
117512 yygotominor.yy346.pExpr->x.pList = yymsp[-1].minor.yy132 ? sqlite3ExprListAppend(pParse,yymsp[-2].minor.yy14,yymsp[-1].minor.yy132) : yymsp[-2].minor.yy14;
117513 sqlite3ExprSetHeight(pParse, yygotominor.yy346.pExpr);
117514 }else{
117515 sqlite3ExprListDelete(pParse->db, yymsp[-2].minor.yy14);
117516 sqlite3ExprDelete(pParse->db, yymsp[-1].minor.yy132);
117517 }
117518 yygotominor.yy346.zStart = yymsp[-4].minor.yy0.z;
117519 yygotominor.yy346.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
117520 }
117521 break;
117522 case 229: /* case_exprlist ::= case_exprlist WHEN expr THEN expr */
117523 {
117524 yygotominor.yy14 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy14, yymsp[-2].minor.yy346.pExpr);
117525 yygotominor.yy14 = sqlite3ExprListAppend(pParse,yygotominor.yy14, yymsp[0].minor.yy346.pExpr);
117526 }
117527 break;
117528 case 230: /* case_exprlist ::= WHEN expr THEN expr */
117529 {
117530 yygotominor.yy14 = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy346.pExpr);
117531 yygotominor.yy14 = sqlite3ExprListAppend(pParse,yygotominor.yy14, yymsp[0].minor.yy346.pExpr);
117532 }
117533 break;
117534 case 237: /* nexprlist ::= nexprlist COMMA expr */
117535 {yygotominor.yy14 = sqlite3ExprListAppend(pParse,yymsp[-2].minor.yy14,yymsp[0].minor.yy346.pExpr);}
117536 break;
117537 case 238: /* nexprlist ::= expr */
117538 {yygotominor.yy14 = sqlite3ExprListAppend(pParse,0,yymsp[0].minor.yy346.pExpr);}
117539 break;
117540 case 239: /* cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP idxlist RP where_opt */
117541 {
117542 sqlite3CreateIndex(pParse, &yymsp[-7].minor.yy0, &yymsp[-6].minor.yy0,
117543 sqlite3SrcListAppend(pParse->db,0,&yymsp[-4].minor.yy0,0), yymsp[-2].minor.yy14, yymsp[-10].minor.yy328,
117544 &yymsp[-11].minor.yy0, yymsp[0].minor.yy132, SQLITE_SO_ASC, yymsp[-8].minor.yy328);
117545 }
117546 break;
117547 case 240: /* uniqueflag ::= UNIQUE */
117548 case 291: /* raisetype ::= ABORT */ yytestcase(yyruleno==291);
117549 {yygotominor.yy328 = OE_Abort;}
117550 break;
117551 case 241: /* uniqueflag ::= */
117552 {yygotominor.yy328 = OE_None;}
117553 break;
117554 case 244: /* idxlist ::= idxlist COMMA nm collate sortorder */
117555 {
117556 Expr *p = sqlite3ExprAddCollateToken(pParse, 0, &yymsp[-1].minor.yy0);
117557 yygotominor.yy14 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy14, p);
117558 sqlite3ExprListSetName(pParse,yygotominor.yy14,&yymsp[-2].minor.yy0,1);
117559 sqlite3ExprListCheckLength(pParse, yygotominor.yy14, "index");
117560 if( yygotominor.yy14 ) yygotominor.yy14->a[yygotominor.yy14->nExpr-1].sortOrder = (u8)yymsp[0].minor.yy328;
117561 }
117562 break;
117563 case 245: /* idxlist ::= nm collate sortorder */
117564 {
117565 Expr *p = sqlite3ExprAddCollateToken(pParse, 0, &yymsp[-1].minor.yy0);
117566 yygotominor.yy14 = sqlite3ExprListAppend(pParse,0, p);
117567 sqlite3ExprListSetName(pParse, yygotominor.yy14, &yymsp[-2].minor.yy0, 1);
117568 sqlite3ExprListCheckLength(pParse, yygotominor.yy14, "index");
117569 if( yygotominor.yy14 ) yygotominor.yy14->a[yygotominor.yy14->nExpr-1].sortOrder = (u8)yymsp[0].minor.yy328;
117570 }
117571 break;
117572 case 246: /* collate ::= */
117573 {yygotominor.yy0.z = 0; yygotominor.yy0.n = 0;}
117574 break;
117575 case 248: /* cmd ::= DROP INDEX ifexists fullname */
117576 {sqlite3DropIndex(pParse, yymsp[0].minor.yy65, yymsp[-1].minor.yy328);}
117577 break;
117578 case 249: /* cmd ::= VACUUM */
117579 case 250: /* cmd ::= VACUUM nm */ yytestcase(yyruleno==250);
117580 {sqlite3Vacuum(pParse);}
117581 break;
117582 case 251: /* cmd ::= PRAGMA nm dbnm */
117583 {sqlite3Pragma(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,0,0);}
117584 break;
117585 case 252: /* cmd ::= PRAGMA nm dbnm EQ nmnum */
117586 {sqlite3Pragma(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0,0);}
117587 break;
117588 case 253: /* cmd ::= PRAGMA nm dbnm LP nmnum RP */
117589 {sqlite3Pragma(pParse,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,&yymsp[-1].minor.yy0,0);}
117590 break;
117591 case 254: /* cmd ::= PRAGMA nm dbnm EQ minus_num */
117592 {sqlite3Pragma(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0,1);}
117593 break;
117594 case 255: /* cmd ::= PRAGMA nm dbnm LP minus_num RP */
117595 {sqlite3Pragma(pParse,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,&yymsp[-1].minor.yy0,1);}
117596 break;
117597 case 264: /* cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END */
117598 {
117599 Token all;
117600 all.z = yymsp[-3].minor.yy0.z;
117601 all.n = (int)(yymsp[0].minor.yy0.z - yymsp[-3].minor.yy0.z) + yymsp[0].minor.yy0.n;
117602 sqlite3FinishTrigger(pParse, yymsp[-1].minor.yy473, &all);
117603 }
117604 break;
117605 case 265: /* trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause */
117606 {
117607 sqlite3BeginTrigger(pParse, &yymsp[-7].minor.yy0, &yymsp[-6].minor.yy0, yymsp[-5].minor.yy328, yymsp[-4].minor.yy378.a, yymsp[-4].minor.yy378.b, yymsp[-2].minor.yy65, yymsp[0].minor.yy132, yymsp[-10].minor.yy328, yymsp[-8].minor.yy328);
117608 yygotominor.yy0 = (yymsp[-6].minor.yy0.n==0?yymsp[-7].minor.yy0:yymsp[-6].minor.yy0);
117609 }
117610 break;
117611 case 266: /* trigger_time ::= BEFORE */
117612 case 269: /* trigger_time ::= */ yytestcase(yyruleno==269);
117613 { yygotominor.yy328 = TK_BEFORE; }
117614 break;
117615 case 267: /* trigger_time ::= AFTER */
117616 { yygotominor.yy328 = TK_AFTER; }
117617 break;
117618 case 268: /* trigger_time ::= INSTEAD OF */
117619 { yygotominor.yy328 = TK_INSTEAD;}
117620 break;
117621 case 270: /* trigger_event ::= DELETE|INSERT */
117622 case 271: /* trigger_event ::= UPDATE */ yytestcase(yyruleno==271);
117623 {yygotominor.yy378.a = yymsp[0].major; yygotominor.yy378.b = 0;}
117624 break;
117625 case 272: /* trigger_event ::= UPDATE OF idlist */
117626 {yygotominor.yy378.a = TK_UPDATE; yygotominor.yy378.b = yymsp[0].minor.yy408;}
117627 break;
117628 case 275: /* when_clause ::= */
117629 case 296: /* key_opt ::= */ yytestcase(yyruleno==296);
117630 { yygotominor.yy132 = 0; }
117631 break;
117632 case 276: /* when_clause ::= WHEN expr */
117633 case 297: /* key_opt ::= KEY expr */ yytestcase(yyruleno==297);
117634 { yygotominor.yy132 = yymsp[0].minor.yy346.pExpr; }
117635 break;
117636 case 277: /* trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI */
117637 {
117638 assert( yymsp[-2].minor.yy473!=0 );
117639 yymsp[-2].minor.yy473->pLast->pNext = yymsp[-1].minor.yy473;
117640 yymsp[-2].minor.yy473->pLast = yymsp[-1].minor.yy473;
117641 yygotominor.yy473 = yymsp[-2].minor.yy473;
117642 }
117643 break;
117644 case 278: /* trigger_cmd_list ::= trigger_cmd SEMI */
117645 {
117646 assert( yymsp[-1].minor.yy473!=0 );
117647 yymsp[-1].minor.yy473->pLast = yymsp[-1].minor.yy473;
117648 yygotominor.yy473 = yymsp[-1].minor.yy473;
117649 }
117650 break;
117651 case 280: /* trnm ::= nm DOT nm */
117652 {
117653 yygotominor.yy0 = yymsp[0].minor.yy0;
117654 sqlite3ErrorMsg(pParse,
117655 "qualified table names are not allowed on INSERT, UPDATE, and DELETE "
117656 "statements within triggers");
117657 }
117658 break;
117659 case 282: /* tridxby ::= INDEXED BY nm */
117660 {
117661 sqlite3ErrorMsg(pParse,
117662 "the INDEXED BY clause is not allowed on UPDATE or DELETE statements "
117663 "within triggers");
117664 }
117665 break;
117666 case 283: /* tridxby ::= NOT INDEXED */
117667 {
117668 sqlite3ErrorMsg(pParse,
117669 "the NOT INDEXED clause is not allowed on UPDATE or DELETE statements "
117670 "within triggers");
117671 }
117672 break;
117673 case 284: /* trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist where_opt */
117674 { yygotominor.yy473 = sqlite3TriggerUpdateStep(pParse->db, &yymsp[-4].minor.yy0, yymsp[-1].minor.yy14, yymsp[0].minor.yy132, yymsp[-5].minor.yy186); }
117675 break;
117676 case 285: /* trigger_cmd ::= insert_cmd INTO trnm inscollist_opt select */
117677 {yygotominor.yy473 = sqlite3TriggerInsertStep(pParse->db, &yymsp[-2].minor.yy0, yymsp[-1].minor.yy408, yymsp[0].minor.yy3, yymsp[-4].minor.yy186);}
117678 break;
117679 case 286: /* trigger_cmd ::= DELETE FROM trnm tridxby where_opt */
117680 {yygotominor.yy473 = sqlite3TriggerDeleteStep(pParse->db, &yymsp[-2].minor.yy0, yymsp[0].minor.yy132);}
117681 break;
117682 case 287: /* trigger_cmd ::= select */
117683 {yygotominor.yy473 = sqlite3TriggerSelectStep(pParse->db, yymsp[0].minor.yy3); }
117684 break;
117685 case 288: /* expr ::= RAISE LP IGNORE RP */
117686 {
117687 yygotominor.yy346.pExpr = sqlite3PExpr(pParse, TK_RAISE, 0, 0, 0);
117688 if( yygotominor.yy346.pExpr ){
117689 yygotominor.yy346.pExpr->affinity = OE_Ignore;
117690 }
117691 yygotominor.yy346.zStart = yymsp[-3].minor.yy0.z;
117692 yygotominor.yy346.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
117693 }
117694 break;
117695 case 289: /* expr ::= RAISE LP raisetype COMMA nm RP */
117696 {
117697 yygotominor.yy346.pExpr = sqlite3PExpr(pParse, TK_RAISE, 0, 0, &yymsp[-1].minor.yy0);
117698 if( yygotominor.yy346.pExpr ) {
117699 yygotominor.yy346.pExpr->affinity = (char)yymsp[-3].minor.yy328;
117700 }
117701 yygotominor.yy346.zStart = yymsp[-5].minor.yy0.z;
117702 yygotominor.yy346.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
117703 }
117704 break;
117705 case 290: /* raisetype ::= ROLLBACK */
117706 {yygotominor.yy328 = OE_Rollback;}
117707 break;
117708 case 292: /* raisetype ::= FAIL */
117709 {yygotominor.yy328 = OE_Fail;}
117710 break;
117711 case 293: /* cmd ::= DROP TRIGGER ifexists fullname */
117712 {
117713 sqlite3DropTrigger(pParse,yymsp[0].minor.yy65,yymsp[-1].minor.yy328);
117714 }
117715 break;
117716 case 294: /* cmd ::= ATTACH database_kw_opt expr AS expr key_opt */
117717 {
117718 sqlite3Attach(pParse, yymsp[-3].minor.yy346.pExpr, yymsp[-1].minor.yy346.pExpr, yymsp[0].minor.yy132);
117719 }
117720 break;
117721 case 295: /* cmd ::= DETACH database_kw_opt expr */
117722 {
117723 sqlite3Detach(pParse, yymsp[0].minor.yy346.pExpr);
117724 }
117725 break;
117726 case 300: /* cmd ::= REINDEX */
 
 
 
117727 {sqlite3Reindex(pParse, 0, 0);}
117728 break;
117729 case 301: /* cmd ::= REINDEX nm dbnm */
117730 {sqlite3Reindex(pParse, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0);}
117731 break;
117732 case 302: /* cmd ::= ANALYZE */
117733 {sqlite3Analyze(pParse, 0, 0);}
117734 break;
117735 case 303: /* cmd ::= ANALYZE nm dbnm */
117736 {sqlite3Analyze(pParse, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0);}
117737 break;
117738 case 304: /* cmd ::= ALTER TABLE fullname RENAME TO nm */
117739 {
117740 sqlite3AlterRenameTable(pParse,yymsp[-3].minor.yy65,&yymsp[0].minor.yy0);
117741 }
117742 break;
117743 case 305: /* cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt column */
117744 {
117745 sqlite3AlterFinishAddColumn(pParse, &yymsp[0].minor.yy0);
117746 }
117747 break;
117748 case 306: /* add_column_fullname ::= fullname */
117749 {
117750 pParse->db->lookaside.bEnabled = 0;
117751 sqlite3AlterBeginAddColumn(pParse, yymsp[0].minor.yy65);
117752 }
117753 break;
117754 case 309: /* cmd ::= create_vtab */
117755 {sqlite3VtabFinishParse(pParse,0);}
117756 break;
117757 case 310: /* cmd ::= create_vtab LP vtabarglist RP */
117758 {sqlite3VtabFinishParse(pParse,&yymsp[0].minor.yy0);}
117759 break;
117760 case 311: /* create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm */
117761 {
117762 sqlite3VtabBeginParse(pParse, &yymsp[-3].minor.yy0, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-4].minor.yy328);
117763 }
117764 break;
117765 case 314: /* vtabarg ::= */
117766 {sqlite3VtabArgInit(pParse);}
117767 break;
117768 case 316: /* vtabargtoken ::= ANY */
117769 case 317: /* vtabargtoken ::= lp anylist RP */ yytestcase(yyruleno==317);
117770 case 318: /* lp ::= LP */ yytestcase(yyruleno==318);
117771 {sqlite3VtabArgExtend(pParse,&yymsp[0].minor.yy0);}
117772 break;
117773 case 322: /* with ::= */
117774 {yygotominor.yy59 = 0;}
117775 break;
117776 case 323: /* with ::= WITH wqlist */
117777 case 324: /* with ::= WITH RECURSIVE wqlist */ yytestcase(yyruleno==324);
117778 { yygotominor.yy59 = yymsp[0].minor.yy59; }
117779 break;
117780 case 325: /* wqlist ::= nm idxlist_opt AS LP select RP */
117781 {
117782 yygotominor.yy59 = sqlite3WithAdd(pParse, 0, &yymsp[-5].minor.yy0, yymsp[-4].minor.yy14, yymsp[-1].minor.yy3);
117783 }
117784 break;
117785 case 326: /* wqlist ::= wqlist COMMA nm idxlist_opt AS LP select RP */
117786 {
117787 yygotominor.yy59 = sqlite3WithAdd(pParse, yymsp[-7].minor.yy59, &yymsp[-5].minor.yy0, yymsp[-4].minor.yy14, yymsp[-1].minor.yy3);
117788 }
117789 break;
117790 default:
117791 /* (0) input ::= cmdlist */ yytestcase(yyruleno==0);
117792 /* (1) cmdlist ::= cmdlist ecmd */ yytestcase(yyruleno==1);
117793 /* (2) cmdlist ::= ecmd */ yytestcase(yyruleno==2);
@@ -117294,32 +117799,32 @@
117799 /* (20) savepoint_opt ::= SAVEPOINT */ yytestcase(yyruleno==20);
117800 /* (21) savepoint_opt ::= */ yytestcase(yyruleno==21);
117801 /* (25) cmd ::= create_table create_table_args */ yytestcase(yyruleno==25);
117802 /* (36) columnlist ::= columnlist COMMA column */ yytestcase(yyruleno==36);
117803 /* (37) columnlist ::= column */ yytestcase(yyruleno==37);
117804 /* (43) type ::= */ yytestcase(yyruleno==43);
117805 /* (50) signed ::= plus_num */ yytestcase(yyruleno==50);
117806 /* (51) signed ::= minus_num */ yytestcase(yyruleno==51);
117807 /* (52) carglist ::= carglist ccons */ yytestcase(yyruleno==52);
117808 /* (53) carglist ::= */ yytestcase(yyruleno==53);
117809 /* (60) ccons ::= NULL onconf */ yytestcase(yyruleno==60);
117810 /* (88) conslist ::= conslist tconscomma tcons */ yytestcase(yyruleno==88);
117811 /* (89) conslist ::= tcons */ yytestcase(yyruleno==89);
117812 /* (91) tconscomma ::= */ yytestcase(yyruleno==91);
117813 /* (273) foreach_clause ::= */ yytestcase(yyruleno==273);
117814 /* (274) foreach_clause ::= FOR EACH ROW */ yytestcase(yyruleno==274);
117815 /* (281) tridxby ::= */ yytestcase(yyruleno==281);
117816 /* (298) database_kw_opt ::= DATABASE */ yytestcase(yyruleno==298);
117817 /* (299) database_kw_opt ::= */ yytestcase(yyruleno==299);
117818 /* (307) kwcolumn_opt ::= */ yytestcase(yyruleno==307);
117819 /* (308) kwcolumn_opt ::= COLUMNKW */ yytestcase(yyruleno==308);
117820 /* (312) vtabarglist ::= vtabarg */ yytestcase(yyruleno==312);
117821 /* (313) vtabarglist ::= vtabarglist COMMA vtabarg */ yytestcase(yyruleno==313);
117822 /* (315) vtabarg ::= vtabarg vtabargtoken */ yytestcase(yyruleno==315);
117823 /* (319) anylist ::= */ yytestcase(yyruleno==319);
117824 /* (320) anylist ::= anylist LP anylist RP */ yytestcase(yyruleno==320);
117825 /* (321) anylist ::= anylist ANY */ yytestcase(yyruleno==321);
117826 break;
117827 };
117828 assert( yyruleno>=0 && yyruleno<sizeof(yyRuleInfo)/sizeof(yyRuleInfo[0]) );
117829 yygoto = yyRuleInfo[yyruleno].lhs;
117830 yysize = yyRuleInfo[yyruleno].nrhs;
@@ -117654,24 +118159,24 @@
118159 ** might be implemented more directly using a hand-written hash table.
118160 ** But by using this automatically generated code, the size of the code
118161 ** is substantially reduced. This is important for embedded applications
118162 ** on platforms with limited memory.
118163 */
118164 /* Hash score: 182 */
118165 static int keywordCode(const char *z, int n){
118166 /* zText[] encodes 834 bytes of keywords in 554 bytes */
118167 /* REINDEXEDESCAPEACHECKEYBEFOREIGNOREGEXPLAINSTEADDATABASELECT */
118168 /* ABLEFTHENDEFERRABLELSEXCEPTRANSACTIONATURALTERAISEXCLUSIVE */
118169 /* XISTSAVEPOINTERSECTRIGGEREFERENCESCONSTRAINTOFFSETEMPORARY */
118170 /* UNIQUERYWITHOUTERELEASEATTACHAVINGROUPDATEBEGINNERECURSIVE */
118171 /* BETWEENOTNULLIKECASCADELETECASECOLLATECREATECURRENT_DATEDETACH */
118172 /* IMMEDIATEJOINSERTMATCHPLANALYZEPRAGMABORTVALUESVIRTUALIMITWHEN */
118173 /* WHERENAMEAFTEREPLACEANDEFAULTAUTOINCREMENTCASTCOLUMNCOMMIT */
118174 /* CONFLICTCROSSCURRENT_TIMESTAMPRIMARYDEFERREDISTINCTDROPFAIL */
118175 /* FROMFULLGLOBYIFISNULLORDERESTRICTRIGHTROLLBACKROWUNIONUSING */
118176 /* VACUUMVIEWINITIALLY */
118177 static const char zText[553] = {
118178 'R','E','I','N','D','E','X','E','D','E','S','C','A','P','E','A','C','H',
118179 'E','C','K','E','Y','B','E','F','O','R','E','I','G','N','O','R','E','G',
118180 'E','X','P','L','A','I','N','S','T','E','A','D','D','A','T','A','B','A',
118181 'S','E','L','E','C','T','A','B','L','E','F','T','H','E','N','D','E','F',
118182 'E','R','R','A','B','L','E','L','S','E','X','C','E','P','T','R','A','N',
@@ -117680,104 +118185,104 @@
118185 'P','O','I','N','T','E','R','S','E','C','T','R','I','G','G','E','R','E',
118186 'F','E','R','E','N','C','E','S','C','O','N','S','T','R','A','I','N','T',
118187 'O','F','F','S','E','T','E','M','P','O','R','A','R','Y','U','N','I','Q',
118188 'U','E','R','Y','W','I','T','H','O','U','T','E','R','E','L','E','A','S',
118189 'E','A','T','T','A','C','H','A','V','I','N','G','R','O','U','P','D','A',
118190 'T','E','B','E','G','I','N','N','E','R','E','C','U','R','S','I','V','E',
118191 'B','E','T','W','E','E','N','O','T','N','U','L','L','I','K','E','C','A',
118192 'S','C','A','D','E','L','E','T','E','C','A','S','E','C','O','L','L','A',
118193 'T','E','C','R','E','A','T','E','C','U','R','R','E','N','T','_','D','A',
118194 'T','E','D','E','T','A','C','H','I','M','M','E','D','I','A','T','E','J',
118195 'O','I','N','S','E','R','T','M','A','T','C','H','P','L','A','N','A','L',
118196 'Y','Z','E','P','R','A','G','M','A','B','O','R','T','V','A','L','U','E',
118197 'S','V','I','R','T','U','A','L','I','M','I','T','W','H','E','N','W','H',
118198 'E','R','E','N','A','M','E','A','F','T','E','R','E','P','L','A','C','E',
118199 'A','N','D','E','F','A','U','L','T','A','U','T','O','I','N','C','R','E',
118200 'M','E','N','T','C','A','S','T','C','O','L','U','M','N','C','O','M','M',
118201 'I','T','C','O','N','F','L','I','C','T','C','R','O','S','S','C','U','R',
118202 'R','E','N','T','_','T','I','M','E','S','T','A','M','P','R','I','M','A',
118203 'R','Y','D','E','F','E','R','R','E','D','I','S','T','I','N','C','T','D',
118204 'R','O','P','F','A','I','L','F','R','O','M','F','U','L','L','G','L','O',
118205 'B','Y','I','F','I','S','N','U','L','L','O','R','D','E','R','E','S','T',
118206 'R','I','C','T','R','I','G','H','T','R','O','L','L','B','A','C','K','R',
118207 'O','W','U','N','I','O','N','U','S','I','N','G','V','A','C','U','U','M',
118208 'V','I','E','W','I','N','I','T','I','A','L','L','Y',
118209 };
118210 static const unsigned char aHash[127] = {
118211 76, 105, 117, 74, 0, 45, 0, 0, 82, 0, 77, 0, 0,
118212 42, 12, 78, 15, 0, 116, 85, 54, 112, 0, 19, 0, 0,
118213 121, 0, 119, 115, 0, 22, 93, 0, 9, 0, 0, 70, 71,
118214 0, 69, 6, 0, 48, 90, 102, 0, 118, 101, 0, 0, 44,
118215 0, 103, 24, 0, 17, 0, 122, 53, 23, 0, 5, 110, 25,
118216 96, 0, 0, 124, 106, 60, 123, 57, 28, 55, 0, 91, 0,
118217 100, 26, 0, 99, 0, 0, 0, 95, 92, 97, 88, 109, 14,
118218 39, 108, 0, 81, 0, 18, 89, 111, 32, 0, 120, 80, 113,
118219 62, 46, 84, 0, 0, 94, 40, 59, 114, 0, 36, 0, 0,
118220 29, 0, 86, 63, 64, 0, 20, 61, 0, 56,
118221 };
118222 static const unsigned char aNext[124] = {
118223 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0,
118224 0, 2, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0,
118225 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
118226 0, 0, 0, 0, 33, 0, 21, 0, 0, 0, 0, 0, 50,
118227 0, 43, 3, 47, 0, 0, 0, 0, 30, 0, 58, 0, 38,
118228 0, 0, 0, 1, 66, 0, 0, 67, 0, 41, 0, 0, 0,
118229 0, 0, 0, 49, 65, 0, 0, 0, 0, 31, 52, 16, 34,
118230 10, 0, 0, 0, 0, 0, 0, 0, 11, 72, 79, 0, 8,
118231 0, 104, 98, 0, 107, 0, 87, 0, 75, 51, 0, 27, 37,
118232 73, 83, 0, 35, 68, 0, 0,
118233 };
118234 static const unsigned char aLen[124] = {
118235 7, 7, 5, 4, 6, 4, 5, 3, 6, 7, 3, 6, 6,
118236 7, 7, 3, 8, 2, 6, 5, 4, 4, 3, 10, 4, 6,
118237 11, 6, 2, 7, 5, 5, 9, 6, 9, 9, 7, 10, 10,
118238 4, 6, 2, 3, 9, 4, 2, 6, 5, 7, 4, 5, 7,
118239 6, 6, 5, 6, 5, 5, 9, 7, 7, 3, 2, 4, 4,
118240 7, 3, 6, 4, 7, 6, 12, 6, 9, 4, 6, 5, 4,
118241 7, 6, 5, 6, 7, 5, 4, 5, 6, 5, 7, 3, 7,
118242 13, 2, 2, 4, 6, 6, 8, 5, 17, 12, 7, 8, 8,
118243 2, 4, 4, 4, 4, 4, 2, 2, 6, 5, 8, 5, 8,
118244 3, 5, 5, 6, 4, 9, 3,
118245 };
118246 static const unsigned short int aOffset[124] = {
118247 0, 2, 2, 8, 9, 14, 16, 20, 23, 25, 25, 29, 33,
118248 36, 41, 46, 48, 53, 54, 59, 62, 65, 67, 69, 78, 81,
118249 86, 91, 95, 96, 101, 105, 109, 117, 122, 128, 136, 142, 152,
118250 159, 162, 162, 165, 167, 167, 171, 176, 179, 184, 184, 188, 192,
118251 199, 204, 209, 212, 218, 221, 225, 234, 240, 240, 240, 243, 246,
118252 250, 251, 255, 261, 265, 272, 278, 290, 296, 305, 307, 313, 318,
118253 320, 327, 332, 337, 343, 349, 354, 358, 361, 367, 371, 378, 380,
118254 387, 389, 391, 400, 404, 410, 416, 424, 429, 429, 445, 452, 459,
118255 460, 467, 471, 475, 479, 483, 486, 488, 490, 496, 500, 508, 513,
118256 521, 524, 529, 534, 540, 544, 549,
118257 };
118258 static const unsigned char aCode[124] = {
118259 TK_REINDEX, TK_INDEXED, TK_INDEX, TK_DESC, TK_ESCAPE,
118260 TK_EACH, TK_CHECK, TK_KEY, TK_BEFORE, TK_FOREIGN,
118261 TK_FOR, TK_IGNORE, TK_LIKE_KW, TK_EXPLAIN, TK_INSTEAD,
118262 TK_ADD, TK_DATABASE, TK_AS, TK_SELECT, TK_TABLE,
118263 TK_JOIN_KW, TK_THEN, TK_END, TK_DEFERRABLE, TK_ELSE,
118264 TK_EXCEPT, TK_TRANSACTION,TK_ACTION, TK_ON, TK_JOIN_KW,
118265 TK_ALTER, TK_RAISE, TK_EXCLUSIVE, TK_EXISTS, TK_SAVEPOINT,
118266 TK_INTERSECT, TK_TRIGGER, TK_REFERENCES, TK_CONSTRAINT, TK_INTO,
118267 TK_OFFSET, TK_OF, TK_SET, TK_TEMP, TK_TEMP,
118268 TK_OR, TK_UNIQUE, TK_QUERY, TK_WITHOUT, TK_WITH,
118269 TK_JOIN_KW, TK_RELEASE, TK_ATTACH, TK_HAVING, TK_GROUP,
118270 TK_UPDATE, TK_BEGIN, TK_JOIN_KW, TK_RECURSIVE, TK_BETWEEN,
118271 TK_NOTNULL, TK_NOT, TK_NO, TK_NULL, TK_LIKE_KW,
118272 TK_CASCADE, TK_ASC, TK_DELETE, TK_CASE, TK_COLLATE,
118273 TK_CREATE, TK_CTIME_KW, TK_DETACH, TK_IMMEDIATE, TK_JOIN,
118274 TK_INSERT, TK_MATCH, TK_PLAN, TK_ANALYZE, TK_PRAGMA,
118275 TK_ABORT, TK_VALUES, TK_VIRTUAL, TK_LIMIT, TK_WHEN,
118276 TK_WHERE, TK_RENAME, TK_AFTER, TK_REPLACE, TK_AND,
118277 TK_DEFAULT, TK_AUTOINCR, TK_TO, TK_IN, TK_CAST,
118278 TK_COLUMNKW, TK_COMMIT, TK_CONFLICT, TK_JOIN_KW, TK_CTIME_KW,
118279 TK_CTIME_KW, TK_PRIMARY, TK_DEFERRED, TK_DISTINCT, TK_IS,
118280 TK_DROP, TK_FAIL, TK_FROM, TK_JOIN_KW, TK_LIKE_KW,
118281 TK_BY, TK_IF, TK_ISNULL, TK_ORDER, TK_RESTRICT,
118282 TK_JOIN_KW, TK_ROLLBACK, TK_ROW, TK_UNION, TK_USING,
118283 TK_VACUUM, TK_VIEW, TK_INITIALLY, TK_ALL,
118284 };
118285 int h, i;
118286 if( n<2 ) return TK_ID;
118287 h = ((charMap(z[0])*4) ^
118288 (charMap(z[n-1])*3) ^
@@ -117831,92 +118336,94 @@
118336 testcase( i==44 ); /* TEMP */
118337 testcase( i==45 ); /* OR */
118338 testcase( i==46 ); /* UNIQUE */
118339 testcase( i==47 ); /* QUERY */
118340 testcase( i==48 ); /* WITHOUT */
118341 testcase( i==49 ); /* WITH */
118342 testcase( i==50 ); /* OUTER */
118343 testcase( i==51 ); /* RELEASE */
118344 testcase( i==52 ); /* ATTACH */
118345 testcase( i==53 ); /* HAVING */
118346 testcase( i==54 ); /* GROUP */
118347 testcase( i==55 ); /* UPDATE */
118348 testcase( i==56 ); /* BEGIN */
118349 testcase( i==57 ); /* INNER */
118350 testcase( i==58 ); /* RECURSIVE */
118351 testcase( i==59 ); /* BETWEEN */
118352 testcase( i==60 ); /* NOTNULL */
118353 testcase( i==61 ); /* NOT */
118354 testcase( i==62 ); /* NO */
118355 testcase( i==63 ); /* NULL */
118356 testcase( i==64 ); /* LIKE */
118357 testcase( i==65 ); /* CASCADE */
118358 testcase( i==66 ); /* ASC */
118359 testcase( i==67 ); /* DELETE */
118360 testcase( i==68 ); /* CASE */
118361 testcase( i==69 ); /* COLLATE */
118362 testcase( i==70 ); /* CREATE */
118363 testcase( i==71 ); /* CURRENT_DATE */
118364 testcase( i==72 ); /* DETACH */
118365 testcase( i==73 ); /* IMMEDIATE */
118366 testcase( i==74 ); /* JOIN */
118367 testcase( i==75 ); /* INSERT */
118368 testcase( i==76 ); /* MATCH */
118369 testcase( i==77 ); /* PLAN */
118370 testcase( i==78 ); /* ANALYZE */
118371 testcase( i==79 ); /* PRAGMA */
118372 testcase( i==80 ); /* ABORT */
118373 testcase( i==81 ); /* VALUES */
118374 testcase( i==82 ); /* VIRTUAL */
118375 testcase( i==83 ); /* LIMIT */
118376 testcase( i==84 ); /* WHEN */
118377 testcase( i==85 ); /* WHERE */
118378 testcase( i==86 ); /* RENAME */
118379 testcase( i==87 ); /* AFTER */
118380 testcase( i==88 ); /* REPLACE */
118381 testcase( i==89 ); /* AND */
118382 testcase( i==90 ); /* DEFAULT */
118383 testcase( i==91 ); /* AUTOINCREMENT */
118384 testcase( i==92 ); /* TO */
118385 testcase( i==93 ); /* IN */
118386 testcase( i==94 ); /* CAST */
118387 testcase( i==95 ); /* COLUMN */
118388 testcase( i==96 ); /* COMMIT */
118389 testcase( i==97 ); /* CONFLICT */
118390 testcase( i==98 ); /* CROSS */
118391 testcase( i==99 ); /* CURRENT_TIMESTAMP */
118392 testcase( i==100 ); /* CURRENT_TIME */
118393 testcase( i==101 ); /* PRIMARY */
118394 testcase( i==102 ); /* DEFERRED */
118395 testcase( i==103 ); /* DISTINCT */
118396 testcase( i==104 ); /* IS */
118397 testcase( i==105 ); /* DROP */
118398 testcase( i==106 ); /* FAIL */
118399 testcase( i==107 ); /* FROM */
118400 testcase( i==108 ); /* FULL */
118401 testcase( i==109 ); /* GLOB */
118402 testcase( i==110 ); /* BY */
118403 testcase( i==111 ); /* IF */
118404 testcase( i==112 ); /* ISNULL */
118405 testcase( i==113 ); /* ORDER */
118406 testcase( i==114 ); /* RESTRICT */
118407 testcase( i==115 ); /* RIGHT */
118408 testcase( i==116 ); /* ROLLBACK */
118409 testcase( i==117 ); /* ROW */
118410 testcase( i==118 ); /* UNION */
118411 testcase( i==119 ); /* USING */
118412 testcase( i==120 ); /* VACUUM */
118413 testcase( i==121 ); /* VIEW */
118414 testcase( i==122 ); /* INITIALLY */
118415 testcase( i==123 ); /* ALL */
118416 return aCode[i];
118417 }
118418 }
118419 return TK_ID;
118420 }
118421 SQLITE_PRIVATE int sqlite3KeywordCode(const unsigned char *z, int n){
118422 return keywordCode((char*)z, n);
118423 }
118424 #define SQLITE_N_KEYWORD 124
118425
118426 /************** End of keywordhash.h *****************************************/
118427 /************** Continuing where we left off in tokenize.c *******************/
118428
118429
@@ -118156,28 +118663,19 @@
118663 case '?': {
118664 *tokenType = TK_VARIABLE;
118665 for(i=1; sqlite3Isdigit(z[i]); i++){}
118666 return i;
118667 }
 
 
 
 
 
 
 
 
 
 
 
118668 #ifndef SQLITE_OMIT_TCL_VARIABLE
118669 case '$':
118670 #endif
118671 case '@': /* For compatibility with MS SQL Server */
118672 case '#':
118673 case ':': {
118674 int n = 0;
118675 testcase( z[0]=='$' ); testcase( z[0]=='@' );
118676 testcase( z[0]==':' ); testcase( z[0]=='#' );
118677 *tokenType = TK_VARIABLE;
118678 for(i=1; (c=z[i])!=0; i++){
118679 if( IdChar(c) ){
118680 n++;
118681 #ifndef SQLITE_OMIT_TCL_VARIABLE
@@ -118356,10 +118854,11 @@
118854 ** will take responsibility for freeing the Table structure.
118855 */
118856 sqlite3DeleteTable(db, pParse->pNewTable);
118857 }
118858
118859 if( pParse->bFreeWith ) sqlite3WithDelete(db, pParse->pWith);
118860 sqlite3DeleteTrigger(db, pParse->pNewTrigger);
118861 for(i=pParse->nzVar-1; i>=0; i--) sqlite3DbFree(db, pParse->azVar[i]);
118862 sqlite3DbFree(db, pParse->azVar);
118863 while( pParse->pAinc ){
118864 AutoincInfo *p = pParse->pAinc;
@@ -124841,11 +125340,11 @@
125340 /*
125341 ** Set the pIdxInfo->estimatedRows variable to nRow. Unless this
125342 ** extension is currently being used by a version of SQLite too old to
125343 ** support estimatedRows. In that case this function is a no-op.
125344 */
125345 static void fts3SetEstimatedRows(sqlite3_index_info *pIdxInfo, i64 nRow){
125346 #if SQLITE_VERSION_NUMBER>=3008002
125347 if( sqlite3_libversion_number()>=3008002 ){
125348 pIdxInfo->estimatedRows = nRow;
125349 }
125350 #endif
@@ -124885,11 +125384,11 @@
125384 ** of the overall query plan the user will see an "unable to use
125385 ** function MATCH in the requested context" error. To discourage
125386 ** this, return a very high cost here. */
125387 pInfo->idxNum = FTS3_FULLSCAN_SEARCH;
125388 pInfo->estimatedCost = 1e50;
125389 fts3SetEstimatedRows(pInfo, ((sqlite3_int64)1) << 50);
125390 return SQLITE_OK;
125391 }
125392 continue;
125393 }
125394
125395
+2 -1
--- src/sqlite3.h
+++ src/sqlite3.h
@@ -107,11 +107,11 @@
107107
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
108108
** [sqlite_version()] and [sqlite_source_id()].
109109
*/
110110
#define SQLITE_VERSION "3.8.3"
111111
#define SQLITE_VERSION_NUMBER 3008003
112
-#define SQLITE_SOURCE_ID "2014-01-04 15:17:04 4e725f53131d3584319c710c8710a068989543c6"
112
+#define SQLITE_SOURCE_ID "2014-01-18 15:22:53 2ad4583c0cc7988f0dfe78fd0a2eb0fdb92d835a"
113113
114114
/*
115115
** CAPI3REF: Run-Time Library Version Numbers
116116
** KEYWORDS: sqlite3_version, sqlite3_sourceid
117117
**
@@ -2564,10 +2564,11 @@
25642564
#define SQLITE_CREATE_VTABLE 29 /* Table Name Module Name */
25652565
#define SQLITE_DROP_VTABLE 30 /* Table Name Module Name */
25662566
#define SQLITE_FUNCTION 31 /* NULL Function Name */
25672567
#define SQLITE_SAVEPOINT 32 /* Operation Savepoint Name */
25682568
#define SQLITE_COPY 0 /* No longer used */
2569
+#define SQLITE_RECURSIVE 33 /* NULL NULL */
25692570
25702571
/*
25712572
** CAPI3REF: Tracing And Profiling Functions
25722573
**
25732574
** These routines register callback functions that can be used for
25742575
--- src/sqlite3.h
+++ src/sqlite3.h
@@ -107,11 +107,11 @@
107 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
108 ** [sqlite_version()] and [sqlite_source_id()].
109 */
110 #define SQLITE_VERSION "3.8.3"
111 #define SQLITE_VERSION_NUMBER 3008003
112 #define SQLITE_SOURCE_ID "2014-01-04 15:17:04 4e725f53131d3584319c710c8710a068989543c6"
113
114 /*
115 ** CAPI3REF: Run-Time Library Version Numbers
116 ** KEYWORDS: sqlite3_version, sqlite3_sourceid
117 **
@@ -2564,10 +2564,11 @@
2564 #define SQLITE_CREATE_VTABLE 29 /* Table Name Module Name */
2565 #define SQLITE_DROP_VTABLE 30 /* Table Name Module Name */
2566 #define SQLITE_FUNCTION 31 /* NULL Function Name */
2567 #define SQLITE_SAVEPOINT 32 /* Operation Savepoint Name */
2568 #define SQLITE_COPY 0 /* No longer used */
 
2569
2570 /*
2571 ** CAPI3REF: Tracing And Profiling Functions
2572 **
2573 ** These routines register callback functions that can be used for
2574
--- src/sqlite3.h
+++ src/sqlite3.h
@@ -107,11 +107,11 @@
107 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
108 ** [sqlite_version()] and [sqlite_source_id()].
109 */
110 #define SQLITE_VERSION "3.8.3"
111 #define SQLITE_VERSION_NUMBER 3008003
112 #define SQLITE_SOURCE_ID "2014-01-18 15:22:53 2ad4583c0cc7988f0dfe78fd0a2eb0fdb92d835a"
113
114 /*
115 ** CAPI3REF: Run-Time Library Version Numbers
116 ** KEYWORDS: sqlite3_version, sqlite3_sourceid
117 **
@@ -2564,10 +2564,11 @@
2564 #define SQLITE_CREATE_VTABLE 29 /* Table Name Module Name */
2565 #define SQLITE_DROP_VTABLE 30 /* Table Name Module Name */
2566 #define SQLITE_FUNCTION 31 /* NULL Function Name */
2567 #define SQLITE_SAVEPOINT 32 /* Operation Savepoint Name */
2568 #define SQLITE_COPY 0 /* No longer used */
2569 #define SQLITE_RECURSIVE 33 /* NULL NULL */
2570
2571 /*
2572 ** CAPI3REF: Tracing And Profiling Functions
2573 **
2574 ** These routines register callback functions that can be used for
2575

Keyboard Shortcuts

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