Fossil

Check-in [27ef534d48]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Update the built-in SQLite to the 3.8.3 beta that includes support for common table expressions and recursive queries.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 27ef534d48706f02042b8000ab534d618dc40cf5
User & Date: drh 2014-01-18 17:01:33.618
Context
2014-01-20
13:08
Allow fossil to be used together with SQLite 3.8.2 amalgamation. Add UTF16-be file for test-purposes. Disable (3-way) merge2 tests which use UTF16 files: 3-way merges with UTF16 files is not (yet) implemented. check-in: 7e9633a9b3 user: jan.nijtmans tags: trunk
2014-01-18
17:01
Update the built-in SQLite to the 3.8.3 beta that includes support for common table expressions and recursive queries. check-in: 27ef534d48 user: drh tags: trunk
2014-01-17
15:22
No need to do a 'ci'-check when permitHooks is false anyway. check-in: bed113ca3f user: jan.nijtmans tags: trunk
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/report.c.
195
196
197
198
199
200
201





202
203
204
205
206
207
208
        *(char**)pError = mprintf("access to table \"%s\" is restricted",zArg1);
        rc = SQLITE_DENY;
      }else if( !g.perm.RdAddr && strncmp(zArg2, "private_", 8)==0 ){
        rc = SQLITE_IGNORE;
      }
      break;
    }





    default: {
      *(char**)pError = mprintf("only SELECT statements are allowed");
      rc = SQLITE_DENY;
      break;
    }
  }
  return rc;







>
>
>
>
>







195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
        *(char**)pError = mprintf("access to table \"%s\" is restricted",zArg1);
        rc = SQLITE_DENY;
      }else if( !g.perm.RdAddr && strncmp(zArg2, "private_", 8)==0 ){
        rc = SQLITE_IGNORE;
      }
      break;
    }
    case SQLITE_RECURSIVE: {
      *(char**)pError = mprintf("recursive queries are not allowed");
      rc = SQLITE_DENY;
      break;
    }       
    default: {
      *(char**)pError = mprintf("only SELECT statements are allowed");
      rc = SQLITE_DENY;
      break;
    }
  }
  return rc;
Changes to src/shell.c.
593
594
595
596
597
598
599

600
601
602
603
604
605
606

/*
** Output the given string with characters that are special to
** HTML escaped.
*/
static void output_html_string(FILE *out, const char *z){
  int i;

  while( *z ){
    for(i=0;   z[i] 
            && z[i]!='<' 
            && z[i]!='&' 
            && z[i]!='>' 
            && z[i]!='\"' 
            && z[i]!='\'';







>







593
594
595
596
597
598
599
600
601
602
603
604
605
606
607

/*
** Output the given string with characters that are special to
** HTML escaped.
*/
static void output_html_string(FILE *out, const char *z){
  int i;
  if( z==0 ) z = "";
  while( *z ){
    for(i=0;   z[i] 
            && z[i]!='<' 
            && z[i]!='&' 
            && z[i]!='>' 
            && z[i]!='\"' 
            && z[i]!='\'';
Changes to src/sqlite3.c.
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
**
** See also: [sqlite3_libversion()],
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
** [sqlite_version()] and [sqlite_source_id()].
*/
#define SQLITE_VERSION        "3.8.3"
#define SQLITE_VERSION_NUMBER 3008003
#define SQLITE_SOURCE_ID      "2014-01-04 15:17:04 4e725f53131d3584319c710c8710a068989543c6"

/*
** CAPI3REF: Run-Time Library Version Numbers
** KEYWORDS: sqlite3_version, sqlite3_sourceid
**
** These interfaces provide the same information as the [SQLITE_VERSION],
** [SQLITE_VERSION_NUMBER], and [SQLITE_SOURCE_ID] C preprocessor macros







|







133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
**
** See also: [sqlite3_libversion()],
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
** [sqlite_version()] and [sqlite_source_id()].
*/
#define SQLITE_VERSION        "3.8.3"
#define SQLITE_VERSION_NUMBER 3008003
#define SQLITE_SOURCE_ID      "2014-01-18 15:22:53 2ad4583c0cc7988f0dfe78fd0a2eb0fdb92d835a"

/*
** CAPI3REF: Run-Time Library Version Numbers
** KEYWORDS: sqlite3_version, sqlite3_sourceid
**
** These interfaces provide the same information as the [SQLITE_VERSION],
** [SQLITE_VERSION_NUMBER], and [SQLITE_SOURCE_ID] C preprocessor macros
2590
2591
2592
2593
2594
2595
2596

2597
2598
2599
2600
2601
2602
2603
#define SQLITE_REINDEX              27   /* Index Name      NULL            */
#define SQLITE_ANALYZE              28   /* Table Name      NULL            */
#define SQLITE_CREATE_VTABLE        29   /* Table Name      Module Name     */
#define SQLITE_DROP_VTABLE          30   /* Table Name      Module Name     */
#define SQLITE_FUNCTION             31   /* NULL            Function Name   */
#define SQLITE_SAVEPOINT            32   /* Operation       Savepoint Name  */
#define SQLITE_COPY                  0   /* No longer used */


/*
** CAPI3REF: Tracing And Profiling Functions
**
** These routines register callback functions that can be used for
** tracing and profiling the execution of SQL statements.
**







>







2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
#define SQLITE_REINDEX              27   /* Index Name      NULL            */
#define SQLITE_ANALYZE              28   /* Table Name      NULL            */
#define SQLITE_CREATE_VTABLE        29   /* Table Name      Module Name     */
#define SQLITE_DROP_VTABLE          30   /* Table Name      Module Name     */
#define SQLITE_FUNCTION             31   /* NULL            Function Name   */
#define SQLITE_SAVEPOINT            32   /* Operation       Savepoint Name  */
#define SQLITE_COPY                  0   /* No longer used */
#define SQLITE_RECURSIVE            33   /* NULL            NULL            */

/*
** CAPI3REF: Tracing And Profiling Functions
**
** These routines register callback functions that can be used for
** tracing and profiling the execution of SQL statements.
**
8038
8039
8040
8041
8042
8043
8044
8045
8046
8047
8048
8049
8050
8051
8052
8053
8054
8055
8056
8057
8058
8059
8060
8061
8062
8063
8064
8065
8066
8067
8068
8069
8070
8071
8072
8073
8074
8075
8076
8077
8078
8079
8080
8081
8082
8083
8084
8085
8086
8087
8088
8089
8090
8091
8092
8093
8094
8095
8096
8097
8098
8099
8100
8101

8102
8103
8104
8105
8106
8107
8108

8109
8110
8111
8112
8113
8114
8115
8116
8117
8118
8119
8120
8121
8122
8123
8124
8125
8126
8127
8128
8129
8130
8131
8132
8133
8134
8135
8136
8137
8138
8139
8140
8141
8142
8143
8144
8145
8146
8147
8148
8149
8150
8151
8152
8153
8154
8155
8156
8157
8158
8159
8160
8161
8162
8163
8164
8165
8166
8167
8168
8169
8170
8171
8172
8173











8174
8175
8176
8177
8178
8179
8180
8181
8182
8183
8184
8185
8186
8187
8188
8189
8190
8191
8192
8193
8194
8195
8196
8197
8198
8199
8200
8201

8202
8203
8204
8205
8206
8207
8208

#endif /* _SQLITE_HASH_H_ */

/************** End of hash.h ************************************************/
/************** Continuing where we left off in sqliteInt.h ******************/
/************** Include parse.h in the middle of sqliteInt.h *****************/
/************** Begin file parse.h *******************************************/
#define TK_SEMI                            1
#define TK_EXPLAIN                         2
#define TK_QUERY                           3
#define TK_PLAN                            4
#define TK_BEGIN                           5
#define TK_TRANSACTION                     6
#define TK_DEFERRED                        7
#define TK_IMMEDIATE                       8
#define TK_EXCLUSIVE                       9
#define TK_COMMIT                         10
#define TK_END                            11
#define TK_ROLLBACK                       12
#define TK_SAVEPOINT                      13
#define TK_RELEASE                        14
#define TK_TO                             15
#define TK_TABLE                          16
#define TK_CREATE                         17
#define TK_IF                             18
#define TK_NOT                            19
#define TK_EXISTS                         20
#define TK_TEMP                           21
#define TK_LP                             22
#define TK_RP                             23
#define TK_AS                             24
#define TK_WITHOUT                        25
#define TK_COMMA                          26
#define TK_ID                             27
#define TK_INDEXED                        28
#define TK_ABORT                          29
#define TK_ACTION                         30
#define TK_AFTER                          31
#define TK_ANALYZE                        32
#define TK_ASC                            33
#define TK_ATTACH                         34
#define TK_BEFORE                         35
#define TK_BY                             36
#define TK_CASCADE                        37
#define TK_CAST                           38
#define TK_COLUMNKW                       39
#define TK_CONFLICT                       40
#define TK_DATABASE                       41
#define TK_DESC                           42
#define TK_DETACH                         43
#define TK_EACH                           44
#define TK_FAIL                           45
#define TK_FOR                            46
#define TK_IGNORE                         47
#define TK_INITIALLY                      48
#define TK_INSTEAD                        49
#define TK_LIKE_KW                        50
#define TK_MATCH                          51
#define TK_NO                             52
#define TK_KEY                            53
#define TK_OF                             54
#define TK_OFFSET                         55
#define TK_PRAGMA                         56
#define TK_RAISE                          57

#define TK_REPLACE                        58
#define TK_RESTRICT                       59
#define TK_ROW                            60
#define TK_TRIGGER                        61
#define TK_VACUUM                         62
#define TK_VIEW                           63
#define TK_VIRTUAL                        64

#define TK_REINDEX                        65
#define TK_RENAME                         66
#define TK_CTIME_KW                       67
#define TK_ANY                            68
#define TK_OR                             69
#define TK_AND                            70
#define TK_IS                             71
#define TK_BETWEEN                        72
#define TK_IN                             73
#define TK_ISNULL                         74
#define TK_NOTNULL                        75
#define TK_NE                             76
#define TK_EQ                             77
#define TK_GT                             78
#define TK_LE                             79
#define TK_LT                             80
#define TK_GE                             81
#define TK_ESCAPE                         82
#define TK_BITAND                         83
#define TK_BITOR                          84
#define TK_LSHIFT                         85
#define TK_RSHIFT                         86
#define TK_PLUS                           87
#define TK_MINUS                          88
#define TK_STAR                           89
#define TK_SLASH                          90
#define TK_REM                            91
#define TK_CONCAT                         92
#define TK_COLLATE                        93
#define TK_BITNOT                         94
#define TK_STRING                         95
#define TK_JOIN_KW                        96
#define TK_CONSTRAINT                     97
#define TK_DEFAULT                        98
#define TK_NULL                           99
#define TK_PRIMARY                        100
#define TK_UNIQUE                         101
#define TK_CHECK                          102
#define TK_REFERENCES                     103
#define TK_AUTOINCR                       104
#define TK_ON                             105
#define TK_INSERT                         106
#define TK_DELETE                         107
#define TK_UPDATE                         108
#define TK_SET                            109
#define TK_DEFERRABLE                     110
#define TK_FOREIGN                        111
#define TK_DROP                           112
#define TK_UNION                          113
#define TK_ALL                            114
#define TK_EXCEPT                         115
#define TK_INTERSECT                      116
#define TK_SELECT                         117
#define TK_DISTINCT                       118
#define TK_DOT                            119
#define TK_FROM                           120
#define TK_JOIN                           121
#define TK_USING                          122
#define TK_ORDER                          123
#define TK_GROUP                          124
#define TK_HAVING                         125
#define TK_LIMIT                          126
#define TK_WHERE                          127
#define TK_INTO                           128
#define TK_VALUES                         129











#define TK_INTEGER                        130
#define TK_FLOAT                          131
#define TK_BLOB                           132
#define TK_REGISTER                       133
#define TK_VARIABLE                       134
#define TK_CASE                           135
#define TK_WHEN                           136
#define TK_THEN                           137
#define TK_ELSE                           138
#define TK_INDEX                          139
#define TK_ALTER                          140
#define TK_ADD                            141
#define TK_TO_TEXT                        142
#define TK_TO_BLOB                        143
#define TK_TO_NUMERIC                     144
#define TK_TO_INT                         145
#define TK_TO_REAL                        146
#define TK_ISNOT                          147
#define TK_END_OF_FILE                    148
#define TK_ILLEGAL                        149
#define TK_SPACE                          150
#define TK_UNCLOSED_STRING                151
#define TK_FUNCTION                       152
#define TK_COLUMN                         153
#define TK_AGG_FUNCTION                   154
#define TK_AGG_COLUMN                     155
#define TK_UMINUS                         156
#define TK_UPLUS                          157


/************** End of parse.h ***********************************************/
/************** Continuing where we left off in sqliteInt.h ******************/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>







|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<
<
<
<
<
<
<
<
<
<
<
|
>
>
>
>
>
>
>
>
>
>
>
|
|
|
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
>







8039
8040
8041
8042
8043
8044
8045
8046
8047
8048
8049
8050
8051
8052
8053
8054
8055
8056
8057
8058
8059
8060
8061
8062
8063
8064
8065
8066
8067
8068
8069
8070
8071
8072
8073
8074
8075
8076
8077
8078
8079
8080
8081
8082
8083
8084
8085
8086
8087
8088
8089
8090
8091
8092
8093
8094
8095
8096
8097
8098
8099
8100
8101
8102
8103
8104
8105
8106
8107
8108
8109
8110
8111
8112
8113
8114
8115
8116
8117
8118
8119
8120
8121
8122
8123
8124
8125
8126
8127
8128
8129
8130
8131
8132
8133
8134
8135
8136
8137
8138
8139
8140
8141
8142
8143
8144
8145
8146
8147
8148
8149
8150
8151
8152
8153
8154
8155
8156
8157
8158
8159
8160
8161
8162
8163
8164











8165
8166
8167
8168
8169
8170
8171
8172
8173
8174
8175
8176
8177
8178
8179

8180
8181
8182
8183
8184
8185
8186
8187
8188
8189
8190
8191
8192
8193
8194
8195
8196
8197
8198
8199
8200
8201
8202
8203
8204
8205
8206
8207
8208
8209
8210
8211

#endif /* _SQLITE_HASH_H_ */

/************** End of hash.h ************************************************/
/************** Continuing where we left off in sqliteInt.h ******************/
/************** Include parse.h in the middle of sqliteInt.h *****************/
/************** Begin file parse.h *******************************************/
#define TK_SEMI                             1
#define TK_EXPLAIN                          2
#define TK_QUERY                            3
#define TK_PLAN                             4
#define TK_BEGIN                            5
#define TK_TRANSACTION                      6
#define TK_DEFERRED                         7
#define TK_IMMEDIATE                        8
#define TK_EXCLUSIVE                        9
#define TK_COMMIT                          10
#define TK_END                             11
#define TK_ROLLBACK                        12
#define TK_SAVEPOINT                       13
#define TK_RELEASE                         14
#define TK_TO                              15
#define TK_TABLE                           16
#define TK_CREATE                          17
#define TK_IF                              18
#define TK_NOT                             19
#define TK_EXISTS                          20
#define TK_TEMP                            21
#define TK_LP                              22
#define TK_RP                              23
#define TK_AS                              24
#define TK_WITHOUT                         25
#define TK_COMMA                           26
#define TK_ID                              27
#define TK_INDEXED                         28
#define TK_ABORT                           29
#define TK_ACTION                          30
#define TK_AFTER                           31
#define TK_ANALYZE                         32
#define TK_ASC                             33
#define TK_ATTACH                          34
#define TK_BEFORE                          35
#define TK_BY                              36
#define TK_CASCADE                         37
#define TK_CAST                            38
#define TK_COLUMNKW                        39
#define TK_CONFLICT                        40
#define TK_DATABASE                        41
#define TK_DESC                            42
#define TK_DETACH                          43
#define TK_EACH                            44
#define TK_FAIL                            45
#define TK_FOR                             46
#define TK_IGNORE                          47
#define TK_INITIALLY                       48
#define TK_INSTEAD                         49
#define TK_LIKE_KW                         50
#define TK_MATCH                           51
#define TK_NO                              52
#define TK_KEY                             53
#define TK_OF                              54
#define TK_OFFSET                          55
#define TK_PRAGMA                          56
#define TK_RAISE                           57
#define TK_RECURSIVE                       58
#define TK_REPLACE                         59
#define TK_RESTRICT                        60
#define TK_ROW                             61
#define TK_TRIGGER                         62
#define TK_VACUUM                          63
#define TK_VIEW                            64
#define TK_VIRTUAL                         65
#define TK_WITH                            66
#define TK_REINDEX                         67
#define TK_RENAME                          68
#define TK_CTIME_KW                        69
#define TK_ANY                             70
#define TK_OR                              71
#define TK_AND                             72
#define TK_IS                              73
#define TK_BETWEEN                         74
#define TK_IN                              75
#define TK_ISNULL                          76
#define TK_NOTNULL                         77
#define TK_NE                              78
#define TK_EQ                              79
#define TK_GT                              80
#define TK_LE                              81
#define TK_LT                              82
#define TK_GE                              83
#define TK_ESCAPE                          84
#define TK_BITAND                          85
#define TK_BITOR                           86
#define TK_LSHIFT                          87
#define TK_RSHIFT                          88
#define TK_PLUS                            89
#define TK_MINUS                           90
#define TK_STAR                            91
#define TK_SLASH                           92
#define TK_REM                             93
#define TK_CONCAT                          94
#define TK_COLLATE                         95
#define TK_BITNOT                          96
#define TK_STRING                          97
#define TK_JOIN_KW                         98
#define TK_CONSTRAINT                      99
#define TK_DEFAULT                        100
#define TK_NULL                           101
#define TK_PRIMARY                        102
#define TK_UNIQUE                         103
#define TK_CHECK                          104
#define TK_REFERENCES                     105
#define TK_AUTOINCR                       106
#define TK_ON                             107
#define TK_INSERT                         108
#define TK_DELETE                         109
#define TK_UPDATE                         110
#define TK_SET                            111
#define TK_DEFERRABLE                     112
#define TK_FOREIGN                        113
#define TK_DROP                           114
#define TK_UNION                          115
#define TK_ALL                            116
#define TK_EXCEPT                         117
#define TK_INTERSECT                      118
#define TK_SELECT                         119











#define TK_VALUES                         120
#define TK_DISTINCT                       121
#define TK_DOT                            122
#define TK_FROM                           123
#define TK_JOIN                           124
#define TK_USING                          125
#define TK_ORDER                          126
#define TK_GROUP                          127
#define TK_HAVING                         128
#define TK_LIMIT                          129
#define TK_WHERE                          130
#define TK_INTO                           131
#define TK_INTEGER                        132
#define TK_FLOAT                          133
#define TK_BLOB                           134

#define TK_VARIABLE                       135
#define TK_CASE                           136
#define TK_WHEN                           137
#define TK_THEN                           138
#define TK_ELSE                           139
#define TK_INDEX                          140
#define TK_ALTER                          141
#define TK_ADD                            142
#define TK_TO_TEXT                        143
#define TK_TO_BLOB                        144
#define TK_TO_NUMERIC                     145
#define TK_TO_INT                         146
#define TK_TO_REAL                        147
#define TK_ISNOT                          148
#define TK_END_OF_FILE                    149
#define TK_ILLEGAL                        150
#define TK_SPACE                          151
#define TK_UNCLOSED_STRING                152
#define TK_FUNCTION                       153
#define TK_COLUMN                         154
#define TK_AGG_FUNCTION                   155
#define TK_AGG_COLUMN                     156
#define TK_UMINUS                         157
#define TK_UPLUS                          158
#define TK_REGISTER                       159

/************** End of parse.h ***********************************************/
/************** Continuing where we left off in sqliteInt.h ******************/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
8643
8644
8645
8646
8647
8648
8649

8650
8651
8652
8653
8654
8655
8656
typedef struct TriggerPrg TriggerPrg;
typedef struct TriggerStep TriggerStep;
typedef struct UnpackedRecord UnpackedRecord;
typedef struct VTable VTable;
typedef struct VtabCtx VtabCtx;
typedef struct Walker Walker;
typedef struct WhereInfo WhereInfo;


/*
** Defer sourcing vdbe.h and btree.h until after the "u8" and 
** "BusyHandler" typedefs. vdbe.h also requires a few of the opaque
** pointer types (i.e. FuncDef) defined above.
*/
/************** Include btree.h in the middle of sqliteInt.h *****************/







>







8646
8647
8648
8649
8650
8651
8652
8653
8654
8655
8656
8657
8658
8659
8660
typedef struct TriggerPrg TriggerPrg;
typedef struct TriggerStep TriggerStep;
typedef struct UnpackedRecord UnpackedRecord;
typedef struct VTable VTable;
typedef struct VtabCtx VtabCtx;
typedef struct Walker Walker;
typedef struct WhereInfo WhereInfo;
typedef struct With With;

/*
** Defer sourcing vdbe.h and btree.h until after the "u8" and 
** "BusyHandler" typedefs. vdbe.h also requires a few of the opaque
** pointer types (i.e. FuncDef) defined above.
*/
/************** Include btree.h in the middle of sqliteInt.h *****************/
9122
9123
9124
9125
9126
9127
9128

9129
9130
9131
9132
9133
9134
9135
9136
9137
9138
9139
9140
9141
9142
9143

9144
9145
9146
9147
9148

9149
9150
9151
9152
9153
9154
9155
9156
9157
9158
9159
9160
9161
9162
9163
9164
9165
9166
9167
9168
9169
9170
9171
9172
9173
9174
9175
9176
9177
9178
9179
9180
9181
9182
9183
9184
9185
9186
9187
9188
9189
9190
9191
9192
9193
9194
9195
9196
9197
9198
9199
9200
9201
9202
9203
9204
9205
9206
9207

9208
9209
9210
9211
9212
9213
9214
9215
9216
9217
9218
9219
9220
9221
9222
9223
9224
9225
9226
9227
9228
9229
9230
9231
9232
9233
9234
#define OP_ReadCookie     47
#define OP_SetCookie      48
#define OP_VerifyCookie   49
#define OP_OpenRead       50 /* synopsis: root=P2 iDb=P3                   */
#define OP_OpenWrite      51 /* synopsis: root=P2 iDb=P3                   */
#define OP_OpenAutoindex  52 /* synopsis: nColumn=P2                       */
#define OP_OpenEphemeral  53 /* synopsis: nColumn=P2                       */

#define OP_SorterOpen     54
#define OP_OpenPseudo     55 /* synopsis: content in r[P2@P3]              */
#define OP_Close          56
#define OP_SeekLt         57 /* synopsis: key=r[P3@P4]                     */
#define OP_SeekLe         58 /* synopsis: key=r[P3@P4]                     */
#define OP_SeekGe         59 /* synopsis: key=r[P3@P4]                     */
#define OP_SeekGt         60 /* synopsis: key=r[P3@P4]                     */
#define OP_Seek           61 /* synopsis: intkey=r[P2]                     */
#define OP_NoConflict     62 /* synopsis: key=r[P3@P4]                     */
#define OP_NotFound       63 /* synopsis: key=r[P3@P4]                     */
#define OP_Found          64 /* synopsis: key=r[P3@P4]                     */
#define OP_NotExists      65 /* synopsis: intkey=r[P3]                     */
#define OP_Sequence       66 /* synopsis: r[P2]=rowid                      */
#define OP_NewRowid       67 /* synopsis: r[P2]=rowid                      */
#define OP_Insert         68 /* synopsis: intkey=r[P3] data=r[P2]          */

#define OP_Or             69 /* same as TK_OR, synopsis: r[P3]=(r[P1] || r[P2]) */
#define OP_And            70 /* same as TK_AND, synopsis: r[P3]=(r[P1] && r[P2]) */
#define OP_InsertInt      71 /* synopsis: intkey=P3 data=r[P2]             */
#define OP_Delete         72
#define OP_ResetCount     73

#define OP_IsNull         74 /* same as TK_ISNULL, synopsis: if r[P1]==NULL goto P2 */
#define OP_NotNull        75 /* same as TK_NOTNULL, synopsis: if r[P1]!=NULL goto P2 */
#define OP_Ne             76 /* same as TK_NE, synopsis: if r[P1]!=r[P3] goto P2 */
#define OP_Eq             77 /* same as TK_EQ, synopsis: if r[P1]==r[P3] goto P2 */
#define OP_Gt             78 /* same as TK_GT, synopsis: if r[P1]>r[P3] goto P2 */
#define OP_Le             79 /* same as TK_LE, synopsis: if r[P1]<=r[P3] goto P2 */
#define OP_Lt             80 /* same as TK_LT, synopsis: if r[P1]<r[P3] goto P2 */
#define OP_Ge             81 /* same as TK_GE, synopsis: if r[P1]>=r[P3] goto P2 */
#define OP_SorterCompare  82 /* synopsis: if key(P1)!=rtrim(r[P3],P4) goto P2 */
#define OP_BitAnd         83 /* same as TK_BITAND, synopsis: r[P3]=r[P1]&r[P2] */
#define OP_BitOr          84 /* same as TK_BITOR, synopsis: r[P3]=r[P1]|r[P2] */
#define OP_ShiftLeft      85 /* same as TK_LSHIFT, synopsis: r[P3]=r[P2]<<r[P1] */
#define OP_ShiftRight     86 /* same as TK_RSHIFT, synopsis: r[P3]=r[P2]>>r[P1] */
#define OP_Add            87 /* same as TK_PLUS, synopsis: r[P3]=r[P1]+r[P2] */
#define OP_Subtract       88 /* same as TK_MINUS, synopsis: r[P3]=r[P2]-r[P1] */
#define OP_Multiply       89 /* same as TK_STAR, synopsis: r[P3]=r[P1]*r[P2] */
#define OP_Divide         90 /* same as TK_SLASH, synopsis: r[P3]=r[P2]/r[P1] */
#define OP_Remainder      91 /* same as TK_REM, synopsis: r[P3]=r[P2]%r[P1] */
#define OP_Concat         92 /* same as TK_CONCAT, synopsis: r[P3]=r[P2]+r[P1] */
#define OP_SorterData     93 /* synopsis: r[P2]=data                       */
#define OP_BitNot         94 /* same as TK_BITNOT, synopsis: r[P1]= ~r[P1] */
#define OP_String8        95 /* same as TK_STRING, synopsis: r[P2]='P4'    */
#define OP_RowKey         96 /* synopsis: r[P2]=key                        */
#define OP_RowData        97 /* synopsis: r[P2]=data                       */
#define OP_Rowid          98 /* synopsis: r[P2]=rowid                      */
#define OP_NullRow        99
#define OP_Last          100
#define OP_SorterSort    101
#define OP_Sort          102
#define OP_Rewind        103
#define OP_SorterInsert  104
#define OP_IdxInsert     105 /* synopsis: key=r[P2]                        */
#define OP_IdxDelete     106 /* synopsis: key=r[P2@P3]                     */
#define OP_IdxRowid      107 /* synopsis: r[P2]=rowid                      */
#define OP_IdxLT         108 /* synopsis: key=r[P3@P4]                     */
#define OP_IdxGE         109 /* synopsis: key=r[P3@P4]                     */
#define OP_Destroy       110
#define OP_Clear         111
#define OP_CreateIndex   112 /* synopsis: r[P2]=root iDb=P1                */
#define OP_CreateTable   113 /* synopsis: r[P2]=root iDb=P1                */
#define OP_ParseSchema   114
#define OP_LoadAnalysis  115
#define OP_DropTable     116
#define OP_DropIndex     117
#define OP_DropTrigger   118
#define OP_IntegrityCk   119
#define OP_RowSetAdd     120 /* synopsis: rowset(P1)=r[P2]                 */
#define OP_RowSetRead    121 /* synopsis: r[P3]=rowset(P1)                 */
#define OP_RowSetTest    122 /* synopsis: if r[P3] in rowset(P1) goto P2   */
#define OP_Program       123
#define OP_Param         124
#define OP_FkCounter     125 /* synopsis: fkctr[P1]+=P2                    */
#define OP_FkIfZero      126 /* synopsis: if fkctr[P1]==0 goto P2          */
#define OP_MemMax        127 /* synopsis: r[P1]=max(r[P1],r[P2])           */
#define OP_IfPos         128 /* synopsis: if r[P1]>0 goto P2               */
#define OP_IfNeg         129 /* synopsis: if r[P1]<0 goto P2               */
#define OP_IfZero        130 /* synopsis: r[P1]+=P3, if r[P1]==0 goto P2   */
#define OP_Real          131 /* same as TK_FLOAT, synopsis: r[P2]=P4       */
#define OP_AggFinal      132 /* synopsis: accum=r[P1] N=P2                 */

#define OP_IncrVacuum    133
#define OP_Expire        134
#define OP_TableLock     135 /* synopsis: iDb=P1 root=P2 write=P3          */
#define OP_VBegin        136
#define OP_VCreate       137
#define OP_VDestroy      138
#define OP_VOpen         139
#define OP_VColumn       140 /* synopsis: r[P3]=vcolumn(P2)                */
#define OP_VNext         141
#define OP_ToText        142 /* same as TK_TO_TEXT                         */
#define OP_ToBlob        143 /* same as TK_TO_BLOB                         */
#define OP_ToNumeric     144 /* same as TK_TO_NUMERIC                      */
#define OP_ToInt         145 /* same as TK_TO_INT                          */
#define OP_ToReal        146 /* same as TK_TO_REAL                         */
#define OP_VRename       147
#define OP_Pagecount     148
#define OP_MaxPgcnt      149
#define OP_Trace         150
#define OP_Noop          151
#define OP_Explain       152


/* Properties such as "out2" or "jump" that are specified in
** comments following the "case" for each opcode in the vdbe.c
** are encoded into bitvectors as follows:
*/
#define OPFLG_JUMP            0x0001  /* jump:  P2 holds jmp target */







>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
>
|
|
<
|
|
>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<

>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|







9126
9127
9128
9129
9130
9131
9132
9133
9134
9135
9136
9137
9138
9139
9140
9141
9142
9143
9144
9145
9146
9147
9148
9149
9150
9151

9152
9153
9154
9155
9156
9157
9158
9159
9160
9161
9162
9163
9164
9165
9166
9167
9168
9169
9170
9171
9172
9173
9174
9175
9176

9177
9178
9179
9180
9181
9182
9183
9184
9185
9186
9187
9188
9189
9190
9191
9192
9193
9194
9195
9196
9197
9198
9199
9200
9201
9202
9203
9204
9205
9206
9207
9208
9209
9210

9211
9212
9213
9214
9215
9216
9217
9218
9219
9220
9221
9222
9223
9224
9225
9226
9227
9228
9229
9230
9231
9232
9233
9234
9235
9236
9237
9238
9239
#define OP_ReadCookie     47
#define OP_SetCookie      48
#define OP_VerifyCookie   49
#define OP_OpenRead       50 /* synopsis: root=P2 iDb=P3                   */
#define OP_OpenWrite      51 /* synopsis: root=P2 iDb=P3                   */
#define OP_OpenAutoindex  52 /* synopsis: nColumn=P2                       */
#define OP_OpenEphemeral  53 /* synopsis: nColumn=P2                       */
#define OP_SwapCursors    54
#define OP_SorterOpen     55
#define OP_OpenPseudo     56 /* synopsis: content in r[P2@P3]              */
#define OP_Close          57
#define OP_SeekLt         58 /* synopsis: key=r[P3@P4]                     */
#define OP_SeekLe         59 /* synopsis: key=r[P3@P4]                     */
#define OP_SeekGe         60 /* synopsis: key=r[P3@P4]                     */
#define OP_SeekGt         61 /* synopsis: key=r[P3@P4]                     */
#define OP_Seek           62 /* synopsis: intkey=r[P2]                     */
#define OP_NoConflict     63 /* synopsis: key=r[P3@P4]                     */
#define OP_NotFound       64 /* synopsis: key=r[P3@P4]                     */
#define OP_Found          65 /* synopsis: key=r[P3@P4]                     */
#define OP_NotExists      66 /* synopsis: intkey=r[P3]                     */
#define OP_Sequence       67 /* synopsis: r[P2]=rowid                      */
#define OP_NewRowid       68 /* synopsis: r[P2]=rowid                      */
#define OP_Insert         69 /* synopsis: intkey=r[P3] data=r[P2]          */
#define OP_InsertInt      70 /* synopsis: intkey=P3 data=r[P2]             */
#define OP_Or             71 /* same as TK_OR, synopsis: r[P3]=(r[P1] || r[P2]) */
#define OP_And            72 /* same as TK_AND, synopsis: r[P3]=(r[P1] && r[P2]) */

#define OP_Delete         73
#define OP_ResetCount     74
#define OP_SorterCompare  75 /* synopsis: if key(P1)!=rtrim(r[P3],P4) goto P2 */
#define OP_IsNull         76 /* same as TK_ISNULL, synopsis: if r[P1]==NULL goto P2 */
#define OP_NotNull        77 /* same as TK_NOTNULL, synopsis: if r[P1]!=NULL goto P2 */
#define OP_Ne             78 /* same as TK_NE, synopsis: if r[P1]!=r[P3] goto P2 */
#define OP_Eq             79 /* same as TK_EQ, synopsis: if r[P1]==r[P3] goto P2 */
#define OP_Gt             80 /* same as TK_GT, synopsis: if r[P1]>r[P3] goto P2 */
#define OP_Le             81 /* same as TK_LE, synopsis: if r[P1]<=r[P3] goto P2 */
#define OP_Lt             82 /* same as TK_LT, synopsis: if r[P1]<r[P3] goto P2 */
#define OP_Ge             83 /* same as TK_GE, synopsis: if r[P1]>=r[P3] goto P2 */
#define OP_SorterData     84 /* synopsis: r[P2]=data                       */
#define OP_BitAnd         85 /* same as TK_BITAND, synopsis: r[P3]=r[P1]&r[P2] */
#define OP_BitOr          86 /* same as TK_BITOR, synopsis: r[P3]=r[P1]|r[P2] */
#define OP_ShiftLeft      87 /* same as TK_LSHIFT, synopsis: r[P3]=r[P2]<<r[P1] */
#define OP_ShiftRight     88 /* same as TK_RSHIFT, synopsis: r[P3]=r[P2]>>r[P1] */
#define OP_Add            89 /* same as TK_PLUS, synopsis: r[P3]=r[P1]+r[P2] */
#define OP_Subtract       90 /* same as TK_MINUS, synopsis: r[P3]=r[P2]-r[P1] */
#define OP_Multiply       91 /* same as TK_STAR, synopsis: r[P3]=r[P1]*r[P2] */
#define OP_Divide         92 /* same as TK_SLASH, synopsis: r[P3]=r[P2]/r[P1] */
#define OP_Remainder      93 /* same as TK_REM, synopsis: r[P3]=r[P2]%r[P1] */
#define OP_Concat         94 /* same as TK_CONCAT, synopsis: r[P3]=r[P2]+r[P1] */
#define OP_RowKey         95 /* synopsis: r[P2]=key                        */
#define OP_BitNot         96 /* same as TK_BITNOT, synopsis: r[P1]= ~r[P1] */
#define OP_String8        97 /* same as TK_STRING, synopsis: r[P2]='P4'    */

#define OP_RowData        98 /* synopsis: r[P2]=data                       */
#define OP_Rowid          99 /* synopsis: r[P2]=rowid                      */
#define OP_NullRow       100
#define OP_Last          101
#define OP_SorterSort    102
#define OP_Sort          103
#define OP_Rewind        104
#define OP_SorterInsert  105
#define OP_IdxInsert     106 /* synopsis: key=r[P2]                        */
#define OP_IdxDelete     107 /* synopsis: key=r[P2@P3]                     */
#define OP_IdxRowid      108 /* synopsis: r[P2]=rowid                      */
#define OP_IdxLT         109 /* synopsis: key=r[P3@P4]                     */
#define OP_IdxGE         110 /* synopsis: key=r[P3@P4]                     */
#define OP_Destroy       111
#define OP_Clear         112
#define OP_CreateIndex   113 /* synopsis: r[P2]=root iDb=P1                */
#define OP_CreateTable   114 /* synopsis: r[P2]=root iDb=P1                */
#define OP_ParseSchema   115
#define OP_LoadAnalysis  116
#define OP_DropTable     117
#define OP_DropIndex     118
#define OP_DropTrigger   119
#define OP_IntegrityCk   120
#define OP_RowSetAdd     121 /* synopsis: rowset(P1)=r[P2]                 */
#define OP_RowSetRead    122 /* synopsis: r[P3]=rowset(P1)                 */
#define OP_RowSetTest    123 /* synopsis: if r[P3] in rowset(P1) goto P2   */
#define OP_Program       124
#define OP_Param         125
#define OP_FkCounter     126 /* synopsis: fkctr[P1]+=P2                    */
#define OP_FkIfZero      127 /* synopsis: if fkctr[P1]==0 goto P2          */
#define OP_MemMax        128 /* synopsis: r[P1]=max(r[P1],r[P2])           */
#define OP_IfPos         129 /* synopsis: if r[P1]>0 goto P2               */
#define OP_IfNeg         130 /* synopsis: if r[P1]<0 goto P2               */
#define OP_IfZero        131 /* synopsis: r[P1]+=P3, if r[P1]==0 goto P2   */

#define OP_AggFinal      132 /* synopsis: accum=r[P1] N=P2                 */
#define OP_Real          133 /* same as TK_FLOAT, synopsis: r[P2]=P4       */
#define OP_IncrVacuum    134
#define OP_Expire        135
#define OP_TableLock     136 /* synopsis: iDb=P1 root=P2 write=P3          */
#define OP_VBegin        137
#define OP_VCreate       138
#define OP_VDestroy      139
#define OP_VOpen         140
#define OP_VColumn       141 /* synopsis: r[P3]=vcolumn(P2)                */
#define OP_VNext         142
#define OP_ToText        143 /* same as TK_TO_TEXT                         */
#define OP_ToBlob        144 /* same as TK_TO_BLOB                         */
#define OP_ToNumeric     145 /* same as TK_TO_NUMERIC                      */
#define OP_ToInt         146 /* same as TK_TO_INT                          */
#define OP_ToReal        147 /* same as TK_TO_REAL                         */
#define OP_VRename       148
#define OP_Pagecount     149
#define OP_MaxPgcnt      150
#define OP_Trace         151
#define OP_Noop          152
#define OP_Explain       153


/* Properties such as "out2" or "jump" that are specified in
** comments following the "case" for each opcode in the vdbe.c
** are encoded into bitvectors as follows:
*/
#define OPFLG_JUMP            0x0001  /* jump:  P2 holds jmp target */
9242
9243
9244
9245
9246
9247
9248
9249
9250
9251
9252
9253
9254
9255
9256
9257
9258
9259
9260
9261
9262
9263
9264
9265
9266
9267
9268
/*   0 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01,\
/*   8 */ 0x01, 0x01, 0x00, 0x00, 0x02, 0x00, 0x01, 0x00,\
/*  16 */ 0x01, 0x01, 0x04, 0x24, 0x04, 0x10, 0x00, 0x02,\
/*  24 */ 0x02, 0x02, 0x02, 0x02, 0x02, 0x00, 0x00, 0x20,\
/*  32 */ 0x00, 0x00, 0x04, 0x05, 0x04, 0x00, 0x00, 0x01,\
/*  40 */ 0x01, 0x05, 0x05, 0x00, 0x00, 0x00, 0x02, 0x02,\
/*  48 */ 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\
/*  56 */ 0x00, 0x11, 0x11, 0x11, 0x11, 0x08, 0x11, 0x11,\
/*  64 */ 0x11, 0x11, 0x02, 0x02, 0x00, 0x4c, 0x4c, 0x00,\
/*  72 */ 0x00, 0x00, 0x05, 0x05, 0x15, 0x15, 0x15, 0x15,\
/*  80 */ 0x15, 0x15, 0x00, 0x4c, 0x4c, 0x4c, 0x4c, 0x4c,\
/*  88 */ 0x4c, 0x4c, 0x4c, 0x4c, 0x4c, 0x00, 0x24, 0x02,\
/*  96 */ 0x00, 0x00, 0x02, 0x00, 0x01, 0x01, 0x01, 0x01,\
/* 104 */ 0x08, 0x08, 0x00, 0x02, 0x01, 0x01, 0x02, 0x00,\
/* 112 */ 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\
/* 120 */ 0x0c, 0x45, 0x15, 0x01, 0x02, 0x00, 0x01, 0x08,\
/* 128 */ 0x05, 0x05, 0x05, 0x02, 0x00, 0x01, 0x00, 0x00,\
/* 136 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x04, 0x04,\
/* 144 */ 0x04, 0x04, 0x04, 0x00, 0x02, 0x02, 0x00, 0x00,\
/* 152 */ 0x00,}

/************** End of opcodes.h *********************************************/
/************** Continuing where we left off in vdbe.h ***********************/

/*
** Prototypes for the VDBE interface.  See comments on the implementation
** for a description of what each of these routines does.







|
|
|
|
|
|
|
|
|
|
|
|
|







9247
9248
9249
9250
9251
9252
9253
9254
9255
9256
9257
9258
9259
9260
9261
9262
9263
9264
9265
9266
9267
9268
9269
9270
9271
9272
9273
/*   0 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01,\
/*   8 */ 0x01, 0x01, 0x00, 0x00, 0x02, 0x00, 0x01, 0x00,\
/*  16 */ 0x01, 0x01, 0x04, 0x24, 0x04, 0x10, 0x00, 0x02,\
/*  24 */ 0x02, 0x02, 0x02, 0x02, 0x02, 0x00, 0x00, 0x20,\
/*  32 */ 0x00, 0x00, 0x04, 0x05, 0x04, 0x00, 0x00, 0x01,\
/*  40 */ 0x01, 0x05, 0x05, 0x00, 0x00, 0x00, 0x02, 0x02,\
/*  48 */ 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\
/*  56 */ 0x00, 0x00, 0x11, 0x11, 0x11, 0x11, 0x08, 0x11,\
/*  64 */ 0x11, 0x11, 0x11, 0x02, 0x02, 0x00, 0x00, 0x4c,\
/*  72 */ 0x4c, 0x00, 0x00, 0x00, 0x05, 0x05, 0x15, 0x15,\
/*  80 */ 0x15, 0x15, 0x15, 0x15, 0x00, 0x4c, 0x4c, 0x4c,\
/*  88 */ 0x4c, 0x4c, 0x4c, 0x4c, 0x4c, 0x4c, 0x4c, 0x00,\
/*  96 */ 0x24, 0x02, 0x00, 0x02, 0x00, 0x01, 0x01, 0x01,\
/* 104 */ 0x01, 0x08, 0x08, 0x00, 0x02, 0x01, 0x01, 0x02,\
/* 112 */ 0x00, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00,\
/* 120 */ 0x00, 0x0c, 0x45, 0x15, 0x01, 0x02, 0x00, 0x01,\
/* 128 */ 0x08, 0x05, 0x05, 0x05, 0x00, 0x02, 0x01, 0x00,\
/* 136 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x04,\
/* 144 */ 0x04, 0x04, 0x04, 0x04, 0x00, 0x02, 0x02, 0x00,\
/* 152 */ 0x00, 0x00,}

/************** End of opcodes.h *********************************************/
/************** Continuing where we left off in vdbe.h ***********************/

/*
** Prototypes for the VDBE interface.  See comments on the implementation
** for a description of what each of these routines does.
9278
9279
9280
9281
9282
9283
9284
9285
9286
9287
9288
9289
9290
9291
9292
SQLITE_PRIVATE void sqlite3VdbeAddParseSchemaOp(Vdbe*,int,char*);
SQLITE_PRIVATE void sqlite3VdbeChangeP1(Vdbe*, u32 addr, int P1);
SQLITE_PRIVATE void sqlite3VdbeChangeP2(Vdbe*, u32 addr, int P2);
SQLITE_PRIVATE void sqlite3VdbeChangeP3(Vdbe*, u32 addr, int P3);
SQLITE_PRIVATE void sqlite3VdbeChangeP5(Vdbe*, u8 P5);
SQLITE_PRIVATE void sqlite3VdbeJumpHere(Vdbe*, int addr);
SQLITE_PRIVATE void sqlite3VdbeChangeToNoop(Vdbe*, int addr);
SQLITE_PRIVATE void sqlite3VdbeDeleteLastOpcode(Vdbe*);
SQLITE_PRIVATE void sqlite3VdbeChangeP4(Vdbe*, int addr, const char *zP4, int N);
SQLITE_PRIVATE void sqlite3VdbeSetP4KeyInfo(Parse*, Index*);
SQLITE_PRIVATE void sqlite3VdbeUsesBtree(Vdbe*, int);
SQLITE_PRIVATE VdbeOp *sqlite3VdbeGetOp(Vdbe*, int);
SQLITE_PRIVATE int sqlite3VdbeMakeLabel(Vdbe*);
SQLITE_PRIVATE void sqlite3VdbeRunOnlyOnce(Vdbe*);
SQLITE_PRIVATE void sqlite3VdbeDelete(Vdbe*);







|







9283
9284
9285
9286
9287
9288
9289
9290
9291
9292
9293
9294
9295
9296
9297
SQLITE_PRIVATE void sqlite3VdbeAddParseSchemaOp(Vdbe*,int,char*);
SQLITE_PRIVATE void sqlite3VdbeChangeP1(Vdbe*, u32 addr, int P1);
SQLITE_PRIVATE void sqlite3VdbeChangeP2(Vdbe*, u32 addr, int P2);
SQLITE_PRIVATE void sqlite3VdbeChangeP3(Vdbe*, u32 addr, int P3);
SQLITE_PRIVATE void sqlite3VdbeChangeP5(Vdbe*, u8 P5);
SQLITE_PRIVATE void sqlite3VdbeJumpHere(Vdbe*, int addr);
SQLITE_PRIVATE void sqlite3VdbeChangeToNoop(Vdbe*, int addr);
SQLITE_PRIVATE int sqlite3VdbeDeletePriorOpcode(Vdbe*, u8 op);
SQLITE_PRIVATE void sqlite3VdbeChangeP4(Vdbe*, int addr, const char *zP4, int N);
SQLITE_PRIVATE void sqlite3VdbeSetP4KeyInfo(Parse*, Index*);
SQLITE_PRIVATE void sqlite3VdbeUsesBtree(Vdbe*, int);
SQLITE_PRIVATE VdbeOp *sqlite3VdbeGetOp(Vdbe*, int);
SQLITE_PRIVATE int sqlite3VdbeMakeLabel(Vdbe*);
SQLITE_PRIVATE void sqlite3VdbeRunOnlyOnce(Vdbe*);
SQLITE_PRIVATE void sqlite3VdbeDelete(Vdbe*);
10744
10745
10746
10747
10748
10749
10750
10751
10752
10753
10754
10755
10756
10757
10758

10759
10760
10761
10762
10763
10764
10765
#endif
  Trigger *pTrigger;   /* List of triggers stored in pSchema */
  Schema *pSchema;     /* Schema that contains this table */
  Table *pNextZombie;  /* Next on the Parse.pZombieTab list */
};

/*
** Allowed values for Tabe.tabFlags.
*/
#define TF_Readonly        0x01    /* Read-only system table */
#define TF_Ephemeral       0x02    /* An ephemeral table */
#define TF_HasPrimaryKey   0x04    /* Table has a primary key */
#define TF_Autoincrement   0x08    /* Integer primary key is autoincrement */
#define TF_Virtual         0x10    /* Is a virtual table */
#define TF_WithoutRowid    0x20    /* No rowid used. PRIMARY KEY is the key */



/*
** Test to see whether or not a table is a virtual table.  This is
** done as a macro so that it will be optimized out when virtual
** table support is omitted from the build.
*/







|







>







10749
10750
10751
10752
10753
10754
10755
10756
10757
10758
10759
10760
10761
10762
10763
10764
10765
10766
10767
10768
10769
10770
10771
#endif
  Trigger *pTrigger;   /* List of triggers stored in pSchema */
  Schema *pSchema;     /* Schema that contains this table */
  Table *pNextZombie;  /* Next on the Parse.pZombieTab list */
};

/*
** Allowed values for Table.tabFlags.
*/
#define TF_Readonly        0x01    /* Read-only system table */
#define TF_Ephemeral       0x02    /* An ephemeral table */
#define TF_HasPrimaryKey   0x04    /* Table has a primary key */
#define TF_Autoincrement   0x08    /* Integer primary key is autoincrement */
#define TF_Virtual         0x10    /* Is a virtual table */
#define TF_WithoutRowid    0x20    /* No rowid used. PRIMARY KEY is the key */
#define TF_Recursive       0x40    /* Recursive reference within CTE */


/*
** Test to see whether or not a table is a virtual table.  This is
** done as a macro so that it will be optimized out when virtual
** table support is omitted from the build.
*/
11333
11334
11335
11336
11337
11338
11339

11340
11341
11342
11343
11344
11345
11346
    Select *pSelect;  /* A SELECT statement used in place of a table name */
    int addrFillSub;  /* Address of subroutine to manifest a subquery */
    int regReturn;    /* Register holding return address of addrFillSub */
    u8 jointype;      /* Type of join between this able and the previous */
    unsigned notIndexed :1;    /* True if there is a NOT INDEXED clause */
    unsigned isCorrelated :1;  /* True if sub-query is correlated */
    unsigned viaCoroutine :1;  /* Implemented as a co-routine */

#ifndef SQLITE_OMIT_EXPLAIN
    u8 iSelectId;     /* If pSelect!=0, the id of the sub-select in EQP */
#endif
    int iCursor;      /* The VDBE cursor number used to access this table */
    Expr *pOn;        /* The ON clause of a join */
    IdList *pUsing;   /* The USING clause of a join */
    Bitmask colUsed;  /* Bit N (1<<N) set if column N of pTab is used */







>







11339
11340
11341
11342
11343
11344
11345
11346
11347
11348
11349
11350
11351
11352
11353
    Select *pSelect;  /* A SELECT statement used in place of a table name */
    int addrFillSub;  /* Address of subroutine to manifest a subquery */
    int regReturn;    /* Register holding return address of addrFillSub */
    u8 jointype;      /* Type of join between this able and the previous */
    unsigned notIndexed :1;    /* True if there is a NOT INDEXED clause */
    unsigned isCorrelated :1;  /* True if sub-query is correlated */
    unsigned viaCoroutine :1;  /* Implemented as a co-routine */
    unsigned isRecursive :1;   /* True for recursive reference in WITH */
#ifndef SQLITE_OMIT_EXPLAIN
    u8 iSelectId;     /* If pSelect!=0, the id of the sub-select in EQP */
#endif
    int iCursor;      /* The VDBE cursor number used to access this table */
    Expr *pOn;        /* The ON clause of a join */
    IdList *pUsing;   /* The USING clause of a join */
    Bitmask colUsed;  /* Bit N (1<<N) set if column N of pTab is used */
11459
11460
11461
11462
11463
11464
11465

11466
11467
11468
11469
11470
11471
11472
11473
11474
11475
11476
11477
11478
11479
11480
11481
11482

11483
11484
11485
11486
11487
11488
11489
11490
11491
11492
11493
11494
11495
11496
11497
11498
11499
11500
11501
11502

11503
11504
11505
11506
11507
11508
11509
  Expr *pHaving;         /* The HAVING clause */
  ExprList *pOrderBy;    /* The ORDER BY clause */
  Select *pPrior;        /* Prior select in a compound select statement */
  Select *pNext;         /* Next select to the left in a compound */
  Select *pRightmost;    /* Right-most select in a compound select statement */
  Expr *pLimit;          /* LIMIT expression. NULL means not used. */
  Expr *pOffset;         /* OFFSET expression. NULL means not used. */

};

/*
** Allowed values for Select.selFlags.  The "SF" prefix stands for
** "Select Flag".
*/
#define SF_Distinct        0x0001  /* Output should be DISTINCT */
#define SF_Resolved        0x0002  /* Identifiers have been resolved */
#define SF_Aggregate       0x0004  /* Contains aggregate functions */
#define SF_UsesEphemeral   0x0008  /* Uses the OpenEphemeral opcode */
#define SF_Expanded        0x0010  /* sqlite3SelectExpand() called on this */
#define SF_HasTypeInfo     0x0020  /* FROM subqueries have Table metadata */
#define SF_UseSorter       0x0040  /* Sort using a sorter */
#define SF_Values          0x0080  /* Synthesized from VALUES clause */
#define SF_Materialize     0x0100  /* Force materialization of views */
#define SF_NestedFrom      0x0200  /* Part of a parenthesized FROM clause */
#define SF_MaybeConvert    0x0400  /* Need convertCompoundSelectToSubquery() */



/*
** The results of a select can be distributed in several ways.  The
** "SRT" prefix means "SELECT Result Type".
*/
#define SRT_Union        1  /* Store result as keys in an index */
#define SRT_Except       2  /* Remove result from a UNION index */
#define SRT_Exists       3  /* Store 1 if the result is not empty */
#define SRT_Discard      4  /* Do not save the results anywhere */

/* The ORDER BY clause is ignored for all of the above */
#define IgnorableOrderby(X) ((X->eDest)<=SRT_Discard)

#define SRT_Output       5  /* Output each row of result */
#define SRT_Mem          6  /* Store result in a memory cell */
#define SRT_Set          7  /* Store results as keys in an index */
#define SRT_Table        8  /* Store result as data with an automatic rowid */
#define SRT_EphemTab     9  /* Create transient tab and store like SRT_Table */
#define SRT_Coroutine   10  /* Generate a single row of result */


/*
** An instance of this object describes where to put of the results of
** a SELECT statement.
*/
struct SelectDest {
  u8 eDest;         /* How to dispose of the results.  On of SRT_* above. */







>

















>




















>







11466
11467
11468
11469
11470
11471
11472
11473
11474
11475
11476
11477
11478
11479
11480
11481
11482
11483
11484
11485
11486
11487
11488
11489
11490
11491
11492
11493
11494
11495
11496
11497
11498
11499
11500
11501
11502
11503
11504
11505
11506
11507
11508
11509
11510
11511
11512
11513
11514
11515
11516
11517
11518
11519
  Expr *pHaving;         /* The HAVING clause */
  ExprList *pOrderBy;    /* The ORDER BY clause */
  Select *pPrior;        /* Prior select in a compound select statement */
  Select *pNext;         /* Next select to the left in a compound */
  Select *pRightmost;    /* Right-most select in a compound select statement */
  Expr *pLimit;          /* LIMIT expression. NULL means not used. */
  Expr *pOffset;         /* OFFSET expression. NULL means not used. */
  With *pWith;           /* WITH clause attached to this select. Or NULL. */
};

/*
** Allowed values for Select.selFlags.  The "SF" prefix stands for
** "Select Flag".
*/
#define SF_Distinct        0x0001  /* Output should be DISTINCT */
#define SF_Resolved        0x0002  /* Identifiers have been resolved */
#define SF_Aggregate       0x0004  /* Contains aggregate functions */
#define SF_UsesEphemeral   0x0008  /* Uses the OpenEphemeral opcode */
#define SF_Expanded        0x0010  /* sqlite3SelectExpand() called on this */
#define SF_HasTypeInfo     0x0020  /* FROM subqueries have Table metadata */
#define SF_UseSorter       0x0040  /* Sort using a sorter */
#define SF_Values          0x0080  /* Synthesized from VALUES clause */
#define SF_Materialize     0x0100  /* Force materialization of views */
#define SF_NestedFrom      0x0200  /* Part of a parenthesized FROM clause */
#define SF_MaybeConvert    0x0400  /* Need convertCompoundSelectToSubquery() */
#define SF_Recursive       0x0800  /* The recursive part of a recursive CTE */


/*
** The results of a select can be distributed in several ways.  The
** "SRT" prefix means "SELECT Result Type".
*/
#define SRT_Union        1  /* Store result as keys in an index */
#define SRT_Except       2  /* Remove result from a UNION index */
#define SRT_Exists       3  /* Store 1 if the result is not empty */
#define SRT_Discard      4  /* Do not save the results anywhere */

/* The ORDER BY clause is ignored for all of the above */
#define IgnorableOrderby(X) ((X->eDest)<=SRT_Discard)

#define SRT_Output       5  /* Output each row of result */
#define SRT_Mem          6  /* Store result in a memory cell */
#define SRT_Set          7  /* Store results as keys in an index */
#define SRT_Table        8  /* Store result as data with an automatic rowid */
#define SRT_EphemTab     9  /* Create transient tab and store like SRT_Table */
#define SRT_Coroutine   10  /* Generate a single row of result */
#define SRT_DistTable   11  /* Like SRT_TABLE, but unique results only */

/*
** An instance of this object describes where to put of the results of
** a SELECT statement.
*/
struct SelectDest {
  u8 eDest;         /* How to dispose of the results.  On of SRT_* above. */
11609
11610
11611
11612
11613
11614
11615

11616
11617
11618
11619
11620
11621
11622
  int nTab;            /* Number of previously allocated VDBE cursors */
  int nMem;            /* Number of memory cells used so far */
  int nSet;            /* Number of sets used so far */
  int nOnce;           /* Number of OP_Once instructions so far */
  int nOpAlloc;        /* Number of slots allocated for Vdbe.aOp[] */
  int nLabel;          /* Number of labels used */
  int *aLabel;         /* Space to hold the labels */

  int ckBase;          /* Base register of data during check constraints */
  int iPartIdxTab;     /* Table corresponding to a partial index */
  int iCacheLevel;     /* ColCache valid when aColCache[].iLevel<=iCacheLevel */
  int iCacheCnt;       /* Counter used to generate aColCache[].lru values */
  struct yColCache {
    int iTable;           /* Table cursor number */
    int iColumn;          /* Table column number */







>







11619
11620
11621
11622
11623
11624
11625
11626
11627
11628
11629
11630
11631
11632
11633
  int nTab;            /* Number of previously allocated VDBE cursors */
  int nMem;            /* Number of memory cells used so far */
  int nSet;            /* Number of sets used so far */
  int nOnce;           /* Number of OP_Once instructions so far */
  int nOpAlloc;        /* Number of slots allocated for Vdbe.aOp[] */
  int nLabel;          /* Number of labels used */
  int *aLabel;         /* Space to hold the labels */
  int iFixedOp;        /* Never back out opcodes iFixedOp-1 or earlier */
  int ckBase;          /* Base register of data during check constraints */
  int iPartIdxTab;     /* Table corresponding to a partial index */
  int iCacheLevel;     /* ColCache valid when aColCache[].iLevel<=iCacheLevel */
  int iCacheCnt;       /* Counter used to generate aColCache[].lru values */
  struct yColCache {
    int iTable;           /* Table cursor number */
    int iColumn;          /* Table column number */
11679
11680
11681
11682
11683
11684
11685


11686
11687
11688
11689
11690
11691
11692
  Token sLastToken;         /* The last token parsed */
#ifndef SQLITE_OMIT_VIRTUALTABLE
  Token sArg;               /* Complete text of a module argument */
  Table **apVtabLock;       /* Pointer to virtual tables needing locking */
#endif
  Table *pZombieTab;        /* List of Table objects to delete after code gen */
  TriggerPrg *pTriggerPrg;  /* Linked list of coded triggers */


};

/*
** Return true if currently inside an sqlite3_declare_vtab() call.
*/
#ifdef SQLITE_OMIT_VIRTUALTABLE
  #define IN_DECLARE_VTAB 0







>
>







11690
11691
11692
11693
11694
11695
11696
11697
11698
11699
11700
11701
11702
11703
11704
11705
  Token sLastToken;         /* The last token parsed */
#ifndef SQLITE_OMIT_VIRTUALTABLE
  Token sArg;               /* Complete text of a module argument */
  Table **apVtabLock;       /* Pointer to virtual tables needing locking */
#endif
  Table *pZombieTab;        /* List of Table objects to delete after code gen */
  TriggerPrg *pTriggerPrg;  /* Linked list of coded triggers */
  With *pWith;              /* Current WITH clause, or NULL */
  u8 bFreeWith;             /* True if pWith should be freed with parser */
};

/*
** Return true if currently inside an sqlite3_declare_vtab() call.
*/
#ifdef SQLITE_OMIT_VIRTUALTABLE
  #define IN_DECLARE_VTAB 0
11798
11799
11800
11801
11802
11803
11804
11805
11806
11807
11808
11809
11810
11811
11812
struct TriggerStep {
  u8 op;               /* One of TK_DELETE, TK_UPDATE, TK_INSERT, TK_SELECT */
  u8 orconf;           /* OE_Rollback etc. */
  Trigger *pTrig;      /* The trigger that this step is a part of */
  Select *pSelect;     /* SELECT statment or RHS of INSERT INTO .. SELECT ... */
  Token target;        /* Target table for DELETE, UPDATE, INSERT */
  Expr *pWhere;        /* The WHERE clause for DELETE or UPDATE steps */
  ExprList *pExprList; /* SET clause for UPDATE.  VALUES clause for INSERT */
  IdList *pIdList;     /* Column names for INSERT */
  TriggerStep *pNext;  /* Next in the link-list */
  TriggerStep *pLast;  /* Last element in link-list. Valid for 1st elem only */
};

/*
** The following structure contains information used by the sqliteFix...







|







11811
11812
11813
11814
11815
11816
11817
11818
11819
11820
11821
11822
11823
11824
11825
struct TriggerStep {
  u8 op;               /* One of TK_DELETE, TK_UPDATE, TK_INSERT, TK_SELECT */
  u8 orconf;           /* OE_Rollback etc. */
  Trigger *pTrig;      /* The trigger that this step is a part of */
  Select *pSelect;     /* SELECT statment or RHS of INSERT INTO .. SELECT ... */
  Token target;        /* Target table for DELETE, UPDATE, INSERT */
  Expr *pWhere;        /* The WHERE clause for DELETE or UPDATE steps */
  ExprList *pExprList; /* SET clause for UPDATE. */
  IdList *pIdList;     /* Column names for INSERT */
  TriggerStep *pNext;  /* Next in the link-list */
  TriggerStep *pLast;  /* Last element in link-list. Valid for 1st elem only */
};

/*
** The following structure contains information used by the sqliteFix...
11920
11921
11922
11923
11924
11925
11926

11927
11928
11929
11930
11931
11932
11933
11934
11935
11936

/*
** Context pointer passed down through the tree-walk.
*/
struct Walker {
  int (*xExprCallback)(Walker*, Expr*);     /* Callback for expressions */
  int (*xSelectCallback)(Walker*,Select*);  /* Callback for SELECTs */

  Parse *pParse;                            /* Parser context.  */
  int walkerDepth;                          /* Number of subqueries */
  u8 bSelectDepthFirst;                     /* Do subqueries first */
  union {                                   /* Extra data for callback */
    NameContext *pNC;                          /* Naming context */
    int i;                                     /* Integer value */
    SrcList *pSrcList;                         /* FROM clause */
    struct SrcCount *pSrcCount;                /* Counting column references */
  } u;
};







>


<







11933
11934
11935
11936
11937
11938
11939
11940
11941
11942

11943
11944
11945
11946
11947
11948
11949

/*
** Context pointer passed down through the tree-walk.
*/
struct Walker {
  int (*xExprCallback)(Walker*, Expr*);     /* Callback for expressions */
  int (*xSelectCallback)(Walker*,Select*);  /* Callback for SELECTs */
  void (*xSelectCallback2)(Walker*,Select*);/* Second callback for SELECTs */
  Parse *pParse;                            /* Parser context.  */
  int walkerDepth;                          /* Number of subqueries */

  union {                                   /* Extra data for callback */
    NameContext *pNC;                          /* Naming context */
    int i;                                     /* Integer value */
    SrcList *pSrcList;                         /* FROM clause */
    struct SrcCount *pSrcCount;                /* Counting column references */
  } u;
};
11945
11946
11947
11948
11949
11950
11951















11952
11953
11954
11955
11956
11957
11958
/*
** Return code from the parse-tree walking primitives and their
** callbacks.
*/
#define WRC_Continue    0   /* Continue down into children */
#define WRC_Prune       1   /* Omit children but continue walking siblings */
#define WRC_Abort       2   /* Abandon the tree walk */
















/*
** Assuming zIn points to the first byte of a UTF-8 character,
** advance zIn to point to the first byte of the next UTF-8 character.
*/
#define SQLITE_SKIP_UTF8(zIn) {                        \
  if( (*(zIn++))>=0xc0 ){                              \







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







11958
11959
11960
11961
11962
11963
11964
11965
11966
11967
11968
11969
11970
11971
11972
11973
11974
11975
11976
11977
11978
11979
11980
11981
11982
11983
11984
11985
11986
/*
** Return code from the parse-tree walking primitives and their
** callbacks.
*/
#define WRC_Continue    0   /* Continue down into children */
#define WRC_Prune       1   /* Omit children but continue walking siblings */
#define WRC_Abort       2   /* Abandon the tree walk */

/*
** An instance of this structure represents a set of one or more CTEs
** (common table expressions) created by a single WITH clause.
*/
struct With {
  int nCte;                       /* Number of CTEs in the WITH clause */
  With *pOuter;                   /* Containing WITH clause, or NULL */
  struct Cte {                    /* For each CTE in the WITH clause.... */
    char *zName;                    /* Name of this CTE */
    ExprList *pCols;                /* List of explicit column names, or NULL */
    Select *pSelect;                /* The definition of this CTE */
    const char *zErr;               /* Error message for circular references */
  } a[1];
};

/*
** Assuming zIn points to the first byte of a UTF-8 character,
** advance zIn to point to the first byte of the next UTF-8 character.
*/
#define SQLITE_SKIP_UTF8(zIn) {                        \
  if( (*(zIn++))>=0xc0 ){                              \
12213
12214
12215
12216
12217
12218
12219
12220
12221
12222
12223
12224
12225
12226
12227
SQLITE_PRIVATE   void sqlite3AutoincrementBegin(Parse *pParse);
SQLITE_PRIVATE   void sqlite3AutoincrementEnd(Parse *pParse);
#else
# define sqlite3AutoincrementBegin(X)
# define sqlite3AutoincrementEnd(X)
#endif
SQLITE_PRIVATE int sqlite3CodeCoroutine(Parse*, Select*, SelectDest*);
SQLITE_PRIVATE void sqlite3Insert(Parse*, SrcList*, ExprList*, Select*, IdList*, int);
SQLITE_PRIVATE void *sqlite3ArrayAllocate(sqlite3*,void*,int,int*,int*);
SQLITE_PRIVATE IdList *sqlite3IdListAppend(sqlite3*, IdList*, Token*);
SQLITE_PRIVATE int sqlite3IdListIndex(IdList*,const char*);
SQLITE_PRIVATE SrcList *sqlite3SrcListEnlarge(sqlite3*, SrcList*, int, int);
SQLITE_PRIVATE SrcList *sqlite3SrcListAppend(sqlite3*, SrcList*, Token*, Token*);
SQLITE_PRIVATE SrcList *sqlite3SrcListAppendFromTerm(Parse*, SrcList*, Token*, Token*,
                                      Token*, Select*, Expr*, IdList*);







|







12241
12242
12243
12244
12245
12246
12247
12248
12249
12250
12251
12252
12253
12254
12255
SQLITE_PRIVATE   void sqlite3AutoincrementBegin(Parse *pParse);
SQLITE_PRIVATE   void sqlite3AutoincrementEnd(Parse *pParse);
#else
# define sqlite3AutoincrementBegin(X)
# define sqlite3AutoincrementEnd(X)
#endif
SQLITE_PRIVATE int sqlite3CodeCoroutine(Parse*, Select*, SelectDest*);
SQLITE_PRIVATE void sqlite3Insert(Parse*, SrcList*, Select*, IdList*, int);
SQLITE_PRIVATE void *sqlite3ArrayAllocate(sqlite3*,void*,int,int*,int*);
SQLITE_PRIVATE IdList *sqlite3IdListAppend(sqlite3*, IdList*, Token*);
SQLITE_PRIVATE int sqlite3IdListIndex(IdList*,const char*);
SQLITE_PRIVATE SrcList *sqlite3SrcListEnlarge(sqlite3*, SrcList*, int, int);
SQLITE_PRIVATE SrcList *sqlite3SrcListAppend(sqlite3*, SrcList*, Token*, Token*);
SQLITE_PRIVATE SrcList *sqlite3SrcListAppendFromTerm(Parse*, SrcList*, Token*, Token*,
                                      Token*, Select*, Expr*, IdList*);
12307
12308
12309
12310
12311
12312
12313
12314
12315
12316
12317
12318
12319
12320
12321
SQLITE_PRIVATE int sqlite3ExprIsInteger(Expr*, int*);
SQLITE_PRIVATE int sqlite3ExprCanBeNull(const Expr*);
SQLITE_PRIVATE void sqlite3ExprCodeIsNullJump(Vdbe*, const Expr*, int, int);
SQLITE_PRIVATE int sqlite3ExprNeedsNoAffinityChange(const Expr*, char);
SQLITE_PRIVATE int sqlite3IsRowid(const char*);
SQLITE_PRIVATE void sqlite3GenerateRowDelete(Parse*,Table*,Trigger*,int,int,int,i16,u8,u8,u8);
SQLITE_PRIVATE void sqlite3GenerateRowIndexDelete(Parse*, Table*, int, int, int*);
SQLITE_PRIVATE int sqlite3GenerateIndexKey(Parse*, Index*, int, int, int, int*);
SQLITE_PRIVATE void sqlite3GenerateConstraintChecks(Parse*,Table*,int*,int,int,int,int,
                                     u8,u8,int,int*);
SQLITE_PRIVATE void sqlite3CompleteInsertion(Parse*,Table*,int,int,int,int*,int,int,int);
SQLITE_PRIVATE int sqlite3OpenTableAndIndices(Parse*, Table*, int, int, u8*, int*, int*);
SQLITE_PRIVATE void sqlite3BeginWriteOperation(Parse*, int, int);
SQLITE_PRIVATE void sqlite3MultiWrite(Parse*);
SQLITE_PRIVATE void sqlite3MayAbort(Parse*);







|







12335
12336
12337
12338
12339
12340
12341
12342
12343
12344
12345
12346
12347
12348
12349
SQLITE_PRIVATE int sqlite3ExprIsInteger(Expr*, int*);
SQLITE_PRIVATE int sqlite3ExprCanBeNull(const Expr*);
SQLITE_PRIVATE void sqlite3ExprCodeIsNullJump(Vdbe*, const Expr*, int, int);
SQLITE_PRIVATE int sqlite3ExprNeedsNoAffinityChange(const Expr*, char);
SQLITE_PRIVATE int sqlite3IsRowid(const char*);
SQLITE_PRIVATE void sqlite3GenerateRowDelete(Parse*,Table*,Trigger*,int,int,int,i16,u8,u8,u8);
SQLITE_PRIVATE void sqlite3GenerateRowIndexDelete(Parse*, Table*, int, int, int*);
SQLITE_PRIVATE int sqlite3GenerateIndexKey(Parse*, Index*, int, int, int, int*,Index*,int);
SQLITE_PRIVATE void sqlite3GenerateConstraintChecks(Parse*,Table*,int*,int,int,int,int,
                                     u8,u8,int,int*);
SQLITE_PRIVATE void sqlite3CompleteInsertion(Parse*,Table*,int,int,int,int*,int,int,int);
SQLITE_PRIVATE int sqlite3OpenTableAndIndices(Parse*, Table*, int, int, u8*, int*, int*);
SQLITE_PRIVATE void sqlite3BeginWriteOperation(Parse*, int, int);
SQLITE_PRIVATE void sqlite3MultiWrite(Parse*);
SQLITE_PRIVATE void sqlite3MayAbort(Parse*);
12351
12352
12353
12354
12355
12356
12357
12358
12359
12360
12361
12362
12363
12364
12365
SQLITE_PRIVATE   void sqlite3CodeRowTrigger(Parse*, Trigger *, int, ExprList*, int, Table *,
                            int, int, int);
SQLITE_PRIVATE   void sqlite3CodeRowTriggerDirect(Parse *, Trigger *, Table *, int, int, int);
  void sqliteViewTriggers(Parse*, Table*, Expr*, int, ExprList*);
SQLITE_PRIVATE   void sqlite3DeleteTriggerStep(sqlite3*, TriggerStep*);
SQLITE_PRIVATE   TriggerStep *sqlite3TriggerSelectStep(sqlite3*,Select*);
SQLITE_PRIVATE   TriggerStep *sqlite3TriggerInsertStep(sqlite3*,Token*, IdList*,
                                        ExprList*,Select*,u8);
SQLITE_PRIVATE   TriggerStep *sqlite3TriggerUpdateStep(sqlite3*,Token*,ExprList*, Expr*, u8);
SQLITE_PRIVATE   TriggerStep *sqlite3TriggerDeleteStep(sqlite3*,Token*, Expr*);
SQLITE_PRIVATE   void sqlite3DeleteTrigger(sqlite3*, Trigger*);
SQLITE_PRIVATE   void sqlite3UnlinkAndDeleteTrigger(sqlite3*,int,const char*);
SQLITE_PRIVATE   u32 sqlite3TriggerColmask(Parse*,Trigger*,ExprList*,int,int,Table*,int);
# define sqlite3ParseToplevel(p) ((p)->pToplevel ? (p)->pToplevel : (p))
#else







|







12379
12380
12381
12382
12383
12384
12385
12386
12387
12388
12389
12390
12391
12392
12393
SQLITE_PRIVATE   void sqlite3CodeRowTrigger(Parse*, Trigger *, int, ExprList*, int, Table *,
                            int, int, int);
SQLITE_PRIVATE   void sqlite3CodeRowTriggerDirect(Parse *, Trigger *, Table *, int, int, int);
  void sqliteViewTriggers(Parse*, Table*, Expr*, int, ExprList*);
SQLITE_PRIVATE   void sqlite3DeleteTriggerStep(sqlite3*, TriggerStep*);
SQLITE_PRIVATE   TriggerStep *sqlite3TriggerSelectStep(sqlite3*,Select*);
SQLITE_PRIVATE   TriggerStep *sqlite3TriggerInsertStep(sqlite3*,Token*, IdList*,
                                        Select*,u8);
SQLITE_PRIVATE   TriggerStep *sqlite3TriggerUpdateStep(sqlite3*,Token*,ExprList*, Expr*, u8);
SQLITE_PRIVATE   TriggerStep *sqlite3TriggerDeleteStep(sqlite3*,Token*, Expr*);
SQLITE_PRIVATE   void sqlite3DeleteTrigger(sqlite3*, Trigger*);
SQLITE_PRIVATE   void sqlite3UnlinkAndDeleteTrigger(sqlite3*,int,const char*);
SQLITE_PRIVATE   u32 sqlite3TriggerColmask(Parse*,Trigger*,ExprList*,int,int,Table*,int);
# define sqlite3ParseToplevel(p) ((p)->pToplevel ? (p)->pToplevel : (p))
#else
12644
12645
12646
12647
12648
12649
12650








12651
12652
12653
12654
12655
12656
12657
SQLITE_PRIVATE CollSeq *sqlite3BinaryCompareCollSeq(Parse *, Expr *, Expr *);
SQLITE_PRIVATE int sqlite3TempInMemory(const sqlite3*);
SQLITE_PRIVATE const char *sqlite3JournalModename(int);
#ifndef SQLITE_OMIT_WAL
SQLITE_PRIVATE   int sqlite3Checkpoint(sqlite3*, int, int, int*, int*);
SQLITE_PRIVATE   int sqlite3WalDefaultHook(void*,sqlite3*,const char*,int);
#endif









/* Declarations for functions in fkey.c. All of these are replaced by
** no-op macros if OMIT_FOREIGN_KEY is defined. In this case no foreign
** key functionality is available. If OMIT_TRIGGER is defined but
** OMIT_FOREIGN_KEY is not, only some of the functions are no-oped. In
** this case foreign keys are parsed, but no other functionality is 
** provided (enforcement of FK constraints requires the triggers sub-system).







>
>
>
>
>
>
>
>







12672
12673
12674
12675
12676
12677
12678
12679
12680
12681
12682
12683
12684
12685
12686
12687
12688
12689
12690
12691
12692
12693
SQLITE_PRIVATE CollSeq *sqlite3BinaryCompareCollSeq(Parse *, Expr *, Expr *);
SQLITE_PRIVATE int sqlite3TempInMemory(const sqlite3*);
SQLITE_PRIVATE const char *sqlite3JournalModename(int);
#ifndef SQLITE_OMIT_WAL
SQLITE_PRIVATE   int sqlite3Checkpoint(sqlite3*, int, int, int*, int*);
SQLITE_PRIVATE   int sqlite3WalDefaultHook(void*,sqlite3*,const char*,int);
#endif
#ifndef SQLITE_OMIT_CTE
SQLITE_PRIVATE   With *sqlite3WithAdd(Parse*,With*,Token*,ExprList*,Select*);
SQLITE_PRIVATE   void sqlite3WithDelete(sqlite3*,With*);
SQLITE_PRIVATE   void sqlite3WithPush(Parse*, With*, u8);
#else
#define sqlite3WithPush(x,y,z)
#define sqlite3WithDelete(x,y)
#endif

/* Declarations for functions in fkey.c. All of these are replaced by
** no-op macros if OMIT_FOREIGN_KEY is defined. In this case no foreign
** key functionality is available. If OMIT_TRIGGER is defined but
** OMIT_FOREIGN_KEY is not, only some of the functions are no-oped. In
** this case foreign keys are parsed, but no other functionality is 
** provided (enforcement of FK constraints requires the triggers sub-system).
23141
23142
23143
23144
23145
23146
23147

23148
23149
23150
23151
23152
23153
23154
23155
23156
23157
23158
23159
23160
23161
23162

23163
23164
23165
23166
23167

23168
23169
23170
23171
23172
23173
23174
23175
23176
23177
23178
23179
23180
23181
23182
23183
23184
23185
23186
23187
23188
23189
23190
23191
23192
23193
23194
23195
23196
23197
23198
23199
23200
23201
23202
23203
23204
23205
23206
23207
23208
23209
23210
23211
23212
23213
23214
23215
23216
23217
23218
23219
23220
23221
23222
23223
23224
23225
23226

23227
23228
23229
23230
23231
23232
23233
23234
23235
23236
23237
23238
23239
23240
23241
23242
23243
23244
23245
23246
23247
23248
23249
23250
23251
23252
23253
     /*  47 */ "ReadCookie"       OpHelp(""),
     /*  48 */ "SetCookie"        OpHelp(""),
     /*  49 */ "VerifyCookie"     OpHelp(""),
     /*  50 */ "OpenRead"         OpHelp("root=P2 iDb=P3"),
     /*  51 */ "OpenWrite"        OpHelp("root=P2 iDb=P3"),
     /*  52 */ "OpenAutoindex"    OpHelp("nColumn=P2"),
     /*  53 */ "OpenEphemeral"    OpHelp("nColumn=P2"),

     /*  54 */ "SorterOpen"       OpHelp(""),
     /*  55 */ "OpenPseudo"       OpHelp("content in r[P2@P3]"),
     /*  56 */ "Close"            OpHelp(""),
     /*  57 */ "SeekLt"           OpHelp("key=r[P3@P4]"),
     /*  58 */ "SeekLe"           OpHelp("key=r[P3@P4]"),
     /*  59 */ "SeekGe"           OpHelp("key=r[P3@P4]"),
     /*  60 */ "SeekGt"           OpHelp("key=r[P3@P4]"),
     /*  61 */ "Seek"             OpHelp("intkey=r[P2]"),
     /*  62 */ "NoConflict"       OpHelp("key=r[P3@P4]"),
     /*  63 */ "NotFound"         OpHelp("key=r[P3@P4]"),
     /*  64 */ "Found"            OpHelp("key=r[P3@P4]"),
     /*  65 */ "NotExists"        OpHelp("intkey=r[P3]"),
     /*  66 */ "Sequence"         OpHelp("r[P2]=rowid"),
     /*  67 */ "NewRowid"         OpHelp("r[P2]=rowid"),
     /*  68 */ "Insert"           OpHelp("intkey=r[P3] data=r[P2]"),

     /*  69 */ "Or"               OpHelp("r[P3]=(r[P1] || r[P2])"),
     /*  70 */ "And"              OpHelp("r[P3]=(r[P1] && r[P2])"),
     /*  71 */ "InsertInt"        OpHelp("intkey=P3 data=r[P2]"),
     /*  72 */ "Delete"           OpHelp(""),
     /*  73 */ "ResetCount"       OpHelp(""),

     /*  74 */ "IsNull"           OpHelp("if r[P1]==NULL goto P2"),
     /*  75 */ "NotNull"          OpHelp("if r[P1]!=NULL goto P2"),
     /*  76 */ "Ne"               OpHelp("if r[P1]!=r[P3] goto P2"),
     /*  77 */ "Eq"               OpHelp("if r[P1]==r[P3] goto P2"),
     /*  78 */ "Gt"               OpHelp("if r[P1]>r[P3] goto P2"),
     /*  79 */ "Le"               OpHelp("if r[P1]<=r[P3] goto P2"),
     /*  80 */ "Lt"               OpHelp("if r[P1]<r[P3] goto P2"),
     /*  81 */ "Ge"               OpHelp("if r[P1]>=r[P3] goto P2"),
     /*  82 */ "SorterCompare"    OpHelp("if key(P1)!=rtrim(r[P3],P4) goto P2"),
     /*  83 */ "BitAnd"           OpHelp("r[P3]=r[P1]&r[P2]"),
     /*  84 */ "BitOr"            OpHelp("r[P3]=r[P1]|r[P2]"),
     /*  85 */ "ShiftLeft"        OpHelp("r[P3]=r[P2]<<r[P1]"),
     /*  86 */ "ShiftRight"       OpHelp("r[P3]=r[P2]>>r[P1]"),
     /*  87 */ "Add"              OpHelp("r[P3]=r[P1]+r[P2]"),
     /*  88 */ "Subtract"         OpHelp("r[P3]=r[P2]-r[P1]"),
     /*  89 */ "Multiply"         OpHelp("r[P3]=r[P1]*r[P2]"),
     /*  90 */ "Divide"           OpHelp("r[P3]=r[P2]/r[P1]"),
     /*  91 */ "Remainder"        OpHelp("r[P3]=r[P2]%r[P1]"),
     /*  92 */ "Concat"           OpHelp("r[P3]=r[P2]+r[P1]"),
     /*  93 */ "SorterData"       OpHelp("r[P2]=data"),
     /*  94 */ "BitNot"           OpHelp("r[P1]= ~r[P1]"),
     /*  95 */ "String8"          OpHelp("r[P2]='P4'"),
     /*  96 */ "RowKey"           OpHelp("r[P2]=key"),
     /*  97 */ "RowData"          OpHelp("r[P2]=data"),
     /*  98 */ "Rowid"            OpHelp("r[P2]=rowid"),
     /*  99 */ "NullRow"          OpHelp(""),
     /* 100 */ "Last"             OpHelp(""),
     /* 101 */ "SorterSort"       OpHelp(""),
     /* 102 */ "Sort"             OpHelp(""),
     /* 103 */ "Rewind"           OpHelp(""),
     /* 104 */ "SorterInsert"     OpHelp(""),
     /* 105 */ "IdxInsert"        OpHelp("key=r[P2]"),
     /* 106 */ "IdxDelete"        OpHelp("key=r[P2@P3]"),
     /* 107 */ "IdxRowid"         OpHelp("r[P2]=rowid"),
     /* 108 */ "IdxLT"            OpHelp("key=r[P3@P4]"),
     /* 109 */ "IdxGE"            OpHelp("key=r[P3@P4]"),
     /* 110 */ "Destroy"          OpHelp(""),
     /* 111 */ "Clear"            OpHelp(""),
     /* 112 */ "CreateIndex"      OpHelp("r[P2]=root iDb=P1"),
     /* 113 */ "CreateTable"      OpHelp("r[P2]=root iDb=P1"),
     /* 114 */ "ParseSchema"      OpHelp(""),
     /* 115 */ "LoadAnalysis"     OpHelp(""),
     /* 116 */ "DropTable"        OpHelp(""),
     /* 117 */ "DropIndex"        OpHelp(""),
     /* 118 */ "DropTrigger"      OpHelp(""),
     /* 119 */ "IntegrityCk"      OpHelp(""),
     /* 120 */ "RowSetAdd"        OpHelp("rowset(P1)=r[P2]"),
     /* 121 */ "RowSetRead"       OpHelp("r[P3]=rowset(P1)"),
     /* 122 */ "RowSetTest"       OpHelp("if r[P3] in rowset(P1) goto P2"),
     /* 123 */ "Program"          OpHelp(""),
     /* 124 */ "Param"            OpHelp(""),
     /* 125 */ "FkCounter"        OpHelp("fkctr[P1]+=P2"),
     /* 126 */ "FkIfZero"         OpHelp("if fkctr[P1]==0 goto P2"),
     /* 127 */ "MemMax"           OpHelp("r[P1]=max(r[P1],r[P2])"),
     /* 128 */ "IfPos"            OpHelp("if r[P1]>0 goto P2"),
     /* 129 */ "IfNeg"            OpHelp("if r[P1]<0 goto P2"),
     /* 130 */ "IfZero"           OpHelp("r[P1]+=P3, if r[P1]==0 goto P2"),
     /* 131 */ "Real"             OpHelp("r[P2]=P4"),
     /* 132 */ "AggFinal"         OpHelp("accum=r[P1] N=P2"),

     /* 133 */ "IncrVacuum"       OpHelp(""),
     /* 134 */ "Expire"           OpHelp(""),
     /* 135 */ "TableLock"        OpHelp("iDb=P1 root=P2 write=P3"),
     /* 136 */ "VBegin"           OpHelp(""),
     /* 137 */ "VCreate"          OpHelp(""),
     /* 138 */ "VDestroy"         OpHelp(""),
     /* 139 */ "VOpen"            OpHelp(""),
     /* 140 */ "VColumn"          OpHelp("r[P3]=vcolumn(P2)"),
     /* 141 */ "VNext"            OpHelp(""),
     /* 142 */ "ToText"           OpHelp(""),
     /* 143 */ "ToBlob"           OpHelp(""),
     /* 144 */ "ToNumeric"        OpHelp(""),
     /* 145 */ "ToInt"            OpHelp(""),
     /* 146 */ "ToReal"           OpHelp(""),
     /* 147 */ "VRename"          OpHelp(""),
     /* 148 */ "Pagecount"        OpHelp(""),
     /* 149 */ "MaxPgcnt"         OpHelp(""),
     /* 150 */ "Trace"            OpHelp(""),
     /* 151 */ "Noop"             OpHelp(""),
     /* 152 */ "Explain"          OpHelp(""),
  };
  return azName[i];
}
#endif

/************** End of opcodes.c *********************************************/
/************** Begin file os_unix.c *****************************************/







>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
>
|
|
<
|
|
>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<

>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|







23177
23178
23179
23180
23181
23182
23183
23184
23185
23186
23187
23188
23189
23190
23191
23192
23193
23194
23195
23196
23197
23198
23199
23200
23201
23202

23203
23204
23205
23206
23207
23208
23209
23210
23211
23212
23213
23214
23215
23216
23217
23218
23219
23220
23221
23222
23223
23224
23225
23226
23227

23228
23229
23230
23231
23232
23233
23234
23235
23236
23237
23238
23239
23240
23241
23242
23243
23244
23245
23246
23247
23248
23249
23250
23251
23252
23253
23254
23255
23256
23257
23258
23259
23260
23261

23262
23263
23264
23265
23266
23267
23268
23269
23270
23271
23272
23273
23274
23275
23276
23277
23278
23279
23280
23281
23282
23283
23284
23285
23286
23287
23288
23289
23290
     /*  47 */ "ReadCookie"       OpHelp(""),
     /*  48 */ "SetCookie"        OpHelp(""),
     /*  49 */ "VerifyCookie"     OpHelp(""),
     /*  50 */ "OpenRead"         OpHelp("root=P2 iDb=P3"),
     /*  51 */ "OpenWrite"        OpHelp("root=P2 iDb=P3"),
     /*  52 */ "OpenAutoindex"    OpHelp("nColumn=P2"),
     /*  53 */ "OpenEphemeral"    OpHelp("nColumn=P2"),
     /*  54 */ "SwapCursors"      OpHelp(""),
     /*  55 */ "SorterOpen"       OpHelp(""),
     /*  56 */ "OpenPseudo"       OpHelp("content in r[P2@P3]"),
     /*  57 */ "Close"            OpHelp(""),
     /*  58 */ "SeekLt"           OpHelp("key=r[P3@P4]"),
     /*  59 */ "SeekLe"           OpHelp("key=r[P3@P4]"),
     /*  60 */ "SeekGe"           OpHelp("key=r[P3@P4]"),
     /*  61 */ "SeekGt"           OpHelp("key=r[P3@P4]"),
     /*  62 */ "Seek"             OpHelp("intkey=r[P2]"),
     /*  63 */ "NoConflict"       OpHelp("key=r[P3@P4]"),
     /*  64 */ "NotFound"         OpHelp("key=r[P3@P4]"),
     /*  65 */ "Found"            OpHelp("key=r[P3@P4]"),
     /*  66 */ "NotExists"        OpHelp("intkey=r[P3]"),
     /*  67 */ "Sequence"         OpHelp("r[P2]=rowid"),
     /*  68 */ "NewRowid"         OpHelp("r[P2]=rowid"),
     /*  69 */ "Insert"           OpHelp("intkey=r[P3] data=r[P2]"),
     /*  70 */ "InsertInt"        OpHelp("intkey=P3 data=r[P2]"),
     /*  71 */ "Or"               OpHelp("r[P3]=(r[P1] || r[P2])"),
     /*  72 */ "And"              OpHelp("r[P3]=(r[P1] && r[P2])"),

     /*  73 */ "Delete"           OpHelp(""),
     /*  74 */ "ResetCount"       OpHelp(""),
     /*  75 */ "SorterCompare"    OpHelp("if key(P1)!=rtrim(r[P3],P4) goto P2"),
     /*  76 */ "IsNull"           OpHelp("if r[P1]==NULL goto P2"),
     /*  77 */ "NotNull"          OpHelp("if r[P1]!=NULL goto P2"),
     /*  78 */ "Ne"               OpHelp("if r[P1]!=r[P3] goto P2"),
     /*  79 */ "Eq"               OpHelp("if r[P1]==r[P3] goto P2"),
     /*  80 */ "Gt"               OpHelp("if r[P1]>r[P3] goto P2"),
     /*  81 */ "Le"               OpHelp("if r[P1]<=r[P3] goto P2"),
     /*  82 */ "Lt"               OpHelp("if r[P1]<r[P3] goto P2"),
     /*  83 */ "Ge"               OpHelp("if r[P1]>=r[P3] goto P2"),
     /*  84 */ "SorterData"       OpHelp("r[P2]=data"),
     /*  85 */ "BitAnd"           OpHelp("r[P3]=r[P1]&r[P2]"),
     /*  86 */ "BitOr"            OpHelp("r[P3]=r[P1]|r[P2]"),
     /*  87 */ "ShiftLeft"        OpHelp("r[P3]=r[P2]<<r[P1]"),
     /*  88 */ "ShiftRight"       OpHelp("r[P3]=r[P2]>>r[P1]"),
     /*  89 */ "Add"              OpHelp("r[P3]=r[P1]+r[P2]"),
     /*  90 */ "Subtract"         OpHelp("r[P3]=r[P2]-r[P1]"),
     /*  91 */ "Multiply"         OpHelp("r[P3]=r[P1]*r[P2]"),
     /*  92 */ "Divide"           OpHelp("r[P3]=r[P2]/r[P1]"),
     /*  93 */ "Remainder"        OpHelp("r[P3]=r[P2]%r[P1]"),
     /*  94 */ "Concat"           OpHelp("r[P3]=r[P2]+r[P1]"),
     /*  95 */ "RowKey"           OpHelp("r[P2]=key"),
     /*  96 */ "BitNot"           OpHelp("r[P1]= ~r[P1]"),
     /*  97 */ "String8"          OpHelp("r[P2]='P4'"),

     /*  98 */ "RowData"          OpHelp("r[P2]=data"),
     /*  99 */ "Rowid"            OpHelp("r[P2]=rowid"),
     /* 100 */ "NullRow"          OpHelp(""),
     /* 101 */ "Last"             OpHelp(""),
     /* 102 */ "SorterSort"       OpHelp(""),
     /* 103 */ "Sort"             OpHelp(""),
     /* 104 */ "Rewind"           OpHelp(""),
     /* 105 */ "SorterInsert"     OpHelp(""),
     /* 106 */ "IdxInsert"        OpHelp("key=r[P2]"),
     /* 107 */ "IdxDelete"        OpHelp("key=r[P2@P3]"),
     /* 108 */ "IdxRowid"         OpHelp("r[P2]=rowid"),
     /* 109 */ "IdxLT"            OpHelp("key=r[P3@P4]"),
     /* 110 */ "IdxGE"            OpHelp("key=r[P3@P4]"),
     /* 111 */ "Destroy"          OpHelp(""),
     /* 112 */ "Clear"            OpHelp(""),
     /* 113 */ "CreateIndex"      OpHelp("r[P2]=root iDb=P1"),
     /* 114 */ "CreateTable"      OpHelp("r[P2]=root iDb=P1"),
     /* 115 */ "ParseSchema"      OpHelp(""),
     /* 116 */ "LoadAnalysis"     OpHelp(""),
     /* 117 */ "DropTable"        OpHelp(""),
     /* 118 */ "DropIndex"        OpHelp(""),
     /* 119 */ "DropTrigger"      OpHelp(""),
     /* 120 */ "IntegrityCk"      OpHelp(""),
     /* 121 */ "RowSetAdd"        OpHelp("rowset(P1)=r[P2]"),
     /* 122 */ "RowSetRead"       OpHelp("r[P3]=rowset(P1)"),
     /* 123 */ "RowSetTest"       OpHelp("if r[P3] in rowset(P1) goto P2"),
     /* 124 */ "Program"          OpHelp(""),
     /* 125 */ "Param"            OpHelp(""),
     /* 126 */ "FkCounter"        OpHelp("fkctr[P1]+=P2"),
     /* 127 */ "FkIfZero"         OpHelp("if fkctr[P1]==0 goto P2"),
     /* 128 */ "MemMax"           OpHelp("r[P1]=max(r[P1],r[P2])"),
     /* 129 */ "IfPos"            OpHelp("if r[P1]>0 goto P2"),
     /* 130 */ "IfNeg"            OpHelp("if r[P1]<0 goto P2"),
     /* 131 */ "IfZero"           OpHelp("r[P1]+=P3, if r[P1]==0 goto P2"),

     /* 132 */ "AggFinal"         OpHelp("accum=r[P1] N=P2"),
     /* 133 */ "Real"             OpHelp("r[P2]=P4"),
     /* 134 */ "IncrVacuum"       OpHelp(""),
     /* 135 */ "Expire"           OpHelp(""),
     /* 136 */ "TableLock"        OpHelp("iDb=P1 root=P2 write=P3"),
     /* 137 */ "VBegin"           OpHelp(""),
     /* 138 */ "VCreate"          OpHelp(""),
     /* 139 */ "VDestroy"         OpHelp(""),
     /* 140 */ "VOpen"            OpHelp(""),
     /* 141 */ "VColumn"          OpHelp("r[P3]=vcolumn(P2)"),
     /* 142 */ "VNext"            OpHelp(""),
     /* 143 */ "ToText"           OpHelp(""),
     /* 144 */ "ToBlob"           OpHelp(""),
     /* 145 */ "ToNumeric"        OpHelp(""),
     /* 146 */ "ToInt"            OpHelp(""),
     /* 147 */ "ToReal"           OpHelp(""),
     /* 148 */ "VRename"          OpHelp(""),
     /* 149 */ "Pagecount"        OpHelp(""),
     /* 150 */ "MaxPgcnt"         OpHelp(""),
     /* 151 */ "Trace"            OpHelp(""),
     /* 152 */ "Noop"             OpHelp(""),
     /* 153 */ "Explain"          OpHelp(""),
  };
  return azName[i];
}
#endif

/************** End of opcodes.c *********************************************/
/************** Begin file os_unix.c *****************************************/
28304
28305
28306
28307
28308
28309
28310

28311
28312
28313
28314
28315
28316
28317
28318
28319
28320
28321
28322
28323
28324
28325
28326
28327
28328
28329




28330
28331
28332
28333
28334
28335
28336
** argument that was passed to the unixFetch() invocation. 
**
** Or, if the third argument is NULL, then this function is being called 
** to inform the VFS layer that, according to POSIX, any existing mapping 
** may now be invalid and should be unmapped.
*/
static int unixUnfetch(sqlite3_file *fd, i64 iOff, void *p){

  unixFile *pFd = (unixFile *)fd;   /* The underlying database file */
  UNUSED_PARAMETER(iOff);

#if SQLITE_MAX_MMAP_SIZE>0
  /* If p==0 (unmap the entire file) then there must be no outstanding 
  ** xFetch references. Or, if p!=0 (meaning it is an xFetch reference),
  ** then there must be at least one outstanding.  */
  assert( (p==0)==(pFd->nFetchOut==0) );

  /* If p!=0, it must match the iOff value. */
  assert( p==0 || p==&((u8 *)pFd->pMapRegion)[iOff] );

  if( p ){
    pFd->nFetchOut--;
  }else{
    unixUnmapfile(pFd);
  }

  assert( pFd->nFetchOut>=0 );




#endif
  return SQLITE_OK;
}

/*
** Here ends the implementation of all sqlite3_file methods.
**







>



<















>
>
>
>







28341
28342
28343
28344
28345
28346
28347
28348
28349
28350
28351

28352
28353
28354
28355
28356
28357
28358
28359
28360
28361
28362
28363
28364
28365
28366
28367
28368
28369
28370
28371
28372
28373
28374
28375
28376
28377
** argument that was passed to the unixFetch() invocation. 
**
** Or, if the third argument is NULL, then this function is being called 
** to inform the VFS layer that, according to POSIX, any existing mapping 
** may now be invalid and should be unmapped.
*/
static int unixUnfetch(sqlite3_file *fd, i64 iOff, void *p){
#if SQLITE_MAX_MMAP_SIZE>0
  unixFile *pFd = (unixFile *)fd;   /* The underlying database file */
  UNUSED_PARAMETER(iOff);


  /* If p==0 (unmap the entire file) then there must be no outstanding 
  ** xFetch references. Or, if p!=0 (meaning it is an xFetch reference),
  ** then there must be at least one outstanding.  */
  assert( (p==0)==(pFd->nFetchOut==0) );

  /* If p!=0, it must match the iOff value. */
  assert( p==0 || p==&((u8 *)pFd->pMapRegion)[iOff] );

  if( p ){
    pFd->nFetchOut--;
  }else{
    unixUnmapfile(pFd);
  }

  assert( pFd->nFetchOut>=0 );
#else
  UNUSED_PARAMETER(fd);
  UNUSED_PARAMETER(p);
  UNUSED_PARAMETER(iOff);
#endif
  return SQLITE_OK;
}

/*
** Here ends the implementation of all sqlite3_file methods.
**
34364
34365
34366
34367
34368
34369
34370
34371
34372
34373
34374
34375
34376
34377
34378
*/
static void winShmEnterMutex(void){
  sqlite3_mutex_enter(sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MASTER));
}
static void winShmLeaveMutex(void){
  sqlite3_mutex_leave(sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MASTER));
}
#ifdef SQLITE_DEBUG
static int winShmMutexHeld(void) {
  return sqlite3_mutex_held(sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MASTER));
}
#endif

/*
** Object used to represent a single file opened and mmapped to provide







|







34405
34406
34407
34408
34409
34410
34411
34412
34413
34414
34415
34416
34417
34418
34419
*/
static void winShmEnterMutex(void){
  sqlite3_mutex_enter(sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MASTER));
}
static void winShmLeaveMutex(void){
  sqlite3_mutex_leave(sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MASTER));
}
#ifndef NDEBUG
static int winShmMutexHeld(void) {
  return sqlite3_mutex_held(sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MASTER));
}
#endif

/*
** Object used to represent a single file opened and mmapped to provide
57917
57918
57919
57920
57921
57922
57923

57924
57925
57926
57927
57928
57929
57930
57931

57932
57933
57934
57935
57936
57937
57938
57939
57940
57941
57942
57943
57944
57945
57946
57947
57948
57949
57950
57951
57952
57953
57954
57955
57956
57957
57958
  int freePageFlag,        /* Deallocate page if true */
  int *pnChange            /* Add number of Cells freed to this counter */
){
  MemPage *pPage;
  int rc;
  unsigned char *pCell;
  int i;


  assert( sqlite3_mutex_held(pBt->mutex) );
  if( pgno>btreePagecount(pBt) ){
    return SQLITE_CORRUPT_BKPT;
  }

  rc = getAndInitPage(pBt, pgno, &pPage, 0);
  if( rc ) return rc;

  for(i=0; i<pPage->nCell; i++){
    pCell = findCell(pPage, i);
    if( !pPage->leaf ){
      rc = clearDatabasePage(pBt, get4byte(pCell), 1, pnChange);
      if( rc ) goto cleardatabasepage_out;
    }
    rc = clearCell(pPage, pCell);
    if( rc ) goto cleardatabasepage_out;
  }
  if( !pPage->leaf ){
    rc = clearDatabasePage(pBt, get4byte(&pPage->aData[8]), 1, pnChange);
    if( rc ) goto cleardatabasepage_out;
  }else if( pnChange ){
    assert( pPage->intKey );
    *pnChange += pPage->nCell;
  }
  if( freePageFlag ){
    freePage(pPage, &rc);
  }else if( (rc = sqlite3PagerWrite(pPage->pDbPage))==0 ){
    zeroPage(pPage, pPage->aData[0] | PTF_LEAF);
  }

cleardatabasepage_out:
  releasePage(pPage);
  return rc;
}








>








>










|








|







57958
57959
57960
57961
57962
57963
57964
57965
57966
57967
57968
57969
57970
57971
57972
57973
57974
57975
57976
57977
57978
57979
57980
57981
57982
57983
57984
57985
57986
57987
57988
57989
57990
57991
57992
57993
57994
57995
57996
57997
57998
57999
58000
58001
  int freePageFlag,        /* Deallocate page if true */
  int *pnChange            /* Add number of Cells freed to this counter */
){
  MemPage *pPage;
  int rc;
  unsigned char *pCell;
  int i;
  int hdr;

  assert( sqlite3_mutex_held(pBt->mutex) );
  if( pgno>btreePagecount(pBt) ){
    return SQLITE_CORRUPT_BKPT;
  }

  rc = getAndInitPage(pBt, pgno, &pPage, 0);
  if( rc ) return rc;
  hdr = pPage->hdrOffset;
  for(i=0; i<pPage->nCell; i++){
    pCell = findCell(pPage, i);
    if( !pPage->leaf ){
      rc = clearDatabasePage(pBt, get4byte(pCell), 1, pnChange);
      if( rc ) goto cleardatabasepage_out;
    }
    rc = clearCell(pPage, pCell);
    if( rc ) goto cleardatabasepage_out;
  }
  if( !pPage->leaf ){
    rc = clearDatabasePage(pBt, get4byte(&pPage->aData[hdr+8]), 1, pnChange);
    if( rc ) goto cleardatabasepage_out;
  }else if( pnChange ){
    assert( pPage->intKey );
    *pnChange += pPage->nCell;
  }
  if( freePageFlag ){
    freePage(pPage, &rc);
  }else if( (rc = sqlite3PagerWrite(pPage->pDbPage))==0 ){
    zeroPage(pPage, pPage->aData[hdr] | PTF_LEAF);
  }

cleardatabasepage_out:
  releasePage(pPage);
  return rc;
}

61461
61462
61463
61464
61465
61466
61467

61468
61469
61470
61471
61472
61473
61474
  Parse *p = v->pParse;
  int j = -1-x;
  assert( v->magic==VDBE_MAGIC_INIT );
  assert( j<p->nLabel );
  if( j>=0 && p->aLabel ){
    p->aLabel[j] = v->nOp;
  }

}

/*
** Mark the VDBE as one that can only be run one time.
*/
SQLITE_PRIVATE void sqlite3VdbeRunOnlyOnce(Vdbe *p){
  p->runOnlyOnce = 1;







>







61504
61505
61506
61507
61508
61509
61510
61511
61512
61513
61514
61515
61516
61517
61518
  Parse *p = v->pParse;
  int j = -1-x;
  assert( v->magic==VDBE_MAGIC_INIT );
  assert( j<p->nLabel );
  if( j>=0 && p->aLabel ){
    p->aLabel[j] = v->nOp;
  }
  p->iFixedOp = v->nOp - 1;
}

/*
** Mark the VDBE as one that can only be run one time.
*/
SQLITE_PRIVATE void sqlite3VdbeRunOnlyOnce(Vdbe *p){
  p->runOnlyOnce = 1;
61809
61810
61811
61812
61813
61814
61815
61816

61817
61818
61819
61820
61821
61822
61823
}

/*
** Change the P2 operand of instruction addr so that it points to
** the address of the next instruction to be coded.
*/
SQLITE_PRIVATE void sqlite3VdbeJumpHere(Vdbe *p, int addr){
  if( ALWAYS(addr>=0) ) sqlite3VdbeChangeP2(p, addr, p->nOp);

}


/*
** If the input FuncDef structure is ephemeral, then free it.  If
** the FuncDef is not ephermal, then do nothing.
*/







|
>







61853
61854
61855
61856
61857
61858
61859
61860
61861
61862
61863
61864
61865
61866
61867
61868
}

/*
** Change the P2 operand of instruction addr so that it points to
** the address of the next instruction to be coded.
*/
SQLITE_PRIVATE void sqlite3VdbeJumpHere(Vdbe *p, int addr){
  sqlite3VdbeChangeP2(p, addr, p->nOp);
  p->pParse->iFixedOp = p->nOp - 1;
}


/*
** If the input FuncDef structure is ephemeral, then free it.  If
** the FuncDef is not ephermal, then do nothing.
*/
61914
61915
61916
61917
61918
61919
61920
61921

61922




61923
61924
61925
61926
61927
61928
61929
    if( addr==p->nOp-1 ) p->nOp--;
  }
}

/*
** Remove the last opcode inserted
*/
SQLITE_PRIVATE void sqlite3VdbeDeleteLastOpcode(Vdbe *p){

  p->nOp--;




}

/*
** Change the value of the P4 operand for a specific instruction.
** This routine is useful when a large program is loaded from a
** static array using sqlite3VdbeAddOpList but we want to make a
** few minor changes to the program.







|
>
|
>
>
>
>







61959
61960
61961
61962
61963
61964
61965
61966
61967
61968
61969
61970
61971
61972
61973
61974
61975
61976
61977
61978
61979
    if( addr==p->nOp-1 ) p->nOp--;
  }
}

/*
** Remove the last opcode inserted
*/
SQLITE_PRIVATE int sqlite3VdbeDeletePriorOpcode(Vdbe *p, u8 op){
  if( (p->nOp-1)>(p->pParse->iFixedOp) && p->aOp[p->nOp-1].opcode==op ){
    sqlite3VdbeChangeToNoop(p, p->nOp-1);
    return 1;
  }else{
    return 0;
  }
}

/*
** Change the value of the P4 operand for a specific instruction.
** This routine is useful when a large program is loaded from a
** static array using sqlite3VdbeAddOpList but we want to make a
** few minor changes to the program.
69686
69687
69688
69689
69690
69691
69692



























69693
69694
69695
69696
69697
69698
69699
      pCx->isTable = 1;
    }
  }
  pCx->isOrdered = (pOp->p5!=BTREE_UNORDERED);
  break;
}




























/* Opcode: SorterOpen P1 * * P4 *
**
** This opcode works like OP_OpenEphemeral except that it opens
** a transient index that is specifically designed to sort large
** tables using an external merge-sort algorithm.
*/
case OP_SorterOpen: {







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







69736
69737
69738
69739
69740
69741
69742
69743
69744
69745
69746
69747
69748
69749
69750
69751
69752
69753
69754
69755
69756
69757
69758
69759
69760
69761
69762
69763
69764
69765
69766
69767
69768
69769
69770
69771
69772
69773
69774
69775
69776
      pCx->isTable = 1;
    }
  }
  pCx->isOrdered = (pOp->p5!=BTREE_UNORDERED);
  break;
}

#ifndef SQLITE_OMIT_CTE
/* Opcode: SwapCursors P1 P2 * * *
**
** Parameters P1 and P2 are both cursors opened by the OpenEphemeral
** opcode. This opcode deletes the contents of epheremal table P1,
** then renames P2 to P1 and P1 to P2. In other words, following this
** opcode cursor P2 is open on an empty table and P1 is open on the
** table that was initially accessed by P2.
*/
case OP_SwapCursors: {
  Mem tmp;
  VdbeCursor *pTmp;

  tmp = p->aMem[p->nMem - pOp->p1];
  p->aMem[p->nMem - pOp->p1] = p->aMem[p->nMem - pOp->p2];
  p->aMem[p->nMem - pOp->p2] = tmp;

  pTmp = p->apCsr[pOp->p1];
  p->apCsr[pOp->p1] = p->apCsr[pOp->p2];
  p->apCsr[pOp->p2] = pTmp;

  assert( pTmp->isTable );
  rc = sqlite3BtreeClearTable(pTmp->pBt, MASTER_ROOT, 0);
  break;
}
#endif /* ifndef SQLITE_OMIT_CTE */

/* Opcode: SorterOpen P1 * * P4 *
**
** This opcode works like OP_OpenEphemeral except that it opens
** a transient index that is specifically designed to sort large
** tables using an external merge-sort algorithm.
*/
case OP_SorterOpen: {
74779
74780
74781
74782
74783
74784
74785
74786




74787
74788
74789
74790
74791
74792
74793
74794
74795
74796
74797

74798

74799
74800
74801
74802
74803
74804
74805
74806
74807
74808
74809
74810
74811
74812
74813
74814
74815
74816
74817
74818
74819
74820
74821
74822
74823
74824
  }
  return WRC_Continue;
} 

/*
** Call sqlite3WalkExpr() for every expression in Select statement p.
** Invoke sqlite3WalkSelect() for subqueries in the FROM clause and
** on the compound select chain, p->pPrior.  Invoke the xSelectCallback()




** either before or after the walk of expressions and FROM clause, depending
** on whether pWalker->bSelectDepthFirst is false or true, respectively.
**
** Return WRC_Continue under normal conditions.  Return WRC_Abort if
** there is an abort request.
**
** If the Walker does not have an xSelectCallback() then this routine
** is a no-op returning WRC_Continue.
*/
SQLITE_PRIVATE int sqlite3WalkSelect(Walker *pWalker, Select *p){
  int rc;

  if( p==0 || pWalker->xSelectCallback==0 ) return WRC_Continue;

  rc = WRC_Continue;
  pWalker->walkerDepth++;
  while( p ){
    if( !pWalker->bSelectDepthFirst ){
       rc = pWalker->xSelectCallback(pWalker, p);
       if( rc ) break;
    }
    if( sqlite3WalkSelectExpr(pWalker, p)
     || sqlite3WalkSelectFrom(pWalker, p)
    ){
      pWalker->walkerDepth--;
      return WRC_Abort;
    }
    if( pWalker->bSelectDepthFirst ){
      rc = pWalker->xSelectCallback(pWalker, p);
      /* Depth-first search is currently only used for
      ** selectAddSubqueryTypeInfo() and that routine always returns
      ** WRC_Continue (0).  So the following branch is never taken. */
      if( NEVER(rc) ) break;
    }
    p = p->pPrior;
  }
  pWalker->walkerDepth--;
  return rc & WRC_Abort;
}








|
>
>
>
>
|
<









>
|
>



|









|
|
<
<
<
<







74856
74857
74858
74859
74860
74861
74862
74863
74864
74865
74866
74867
74868

74869
74870
74871
74872
74873
74874
74875
74876
74877
74878
74879
74880
74881
74882
74883
74884
74885
74886
74887
74888
74889
74890
74891
74892
74893
74894
74895




74896
74897
74898
74899
74900
74901
74902
  }
  return WRC_Continue;
} 

/*
** Call sqlite3WalkExpr() for every expression in Select statement p.
** Invoke sqlite3WalkSelect() for subqueries in the FROM clause and
** on the compound select chain, p->pPrior. 
**
** If it is not NULL, the xSelectCallback() callback is invoked before
** the walk of the expressions and FROM clause. The xSelectCallback2()
** method, if it is not NULL, is invoked following the walk of the 
** expressions and FROM clause.

**
** Return WRC_Continue under normal conditions.  Return WRC_Abort if
** there is an abort request.
**
** If the Walker does not have an xSelectCallback() then this routine
** is a no-op returning WRC_Continue.
*/
SQLITE_PRIVATE int sqlite3WalkSelect(Walker *pWalker, Select *p){
  int rc;
  if( p==0 || (pWalker->xSelectCallback==0 && pWalker->xSelectCallback2==0) ){
    return WRC_Continue;
  }
  rc = WRC_Continue;
  pWalker->walkerDepth++;
  while( p ){
    if( pWalker->xSelectCallback ){
       rc = pWalker->xSelectCallback(pWalker, p);
       if( rc ) break;
    }
    if( sqlite3WalkSelectExpr(pWalker, p)
     || sqlite3WalkSelectFrom(pWalker, p)
    ){
      pWalker->walkerDepth--;
      return WRC_Abort;
    }
    if( pWalker->xSelectCallback2 ){
      pWalker->xSelectCallback2(pWalker, p);




    }
    p = p->pPrior;
  }
  pWalker->walkerDepth--;
  return rc & WRC_Abort;
}

77168
77169
77170
77171
77172
77173
77174



























77175
77176
77177
77178
77179
77180
77181
      }

    }
  }
  return pNew;
}




























/*
** The following group of routines make deep copies of expressions,
** expression lists, ID lists, and select statements.  The copies can
** be deleted (by being passed to their respective ...Delete() routines)
** without effecting the originals.
**
** The expression list, ID, and source lists return by sqlite3ExprListDup(),







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







77246
77247
77248
77249
77250
77251
77252
77253
77254
77255
77256
77257
77258
77259
77260
77261
77262
77263
77264
77265
77266
77267
77268
77269
77270
77271
77272
77273
77274
77275
77276
77277
77278
77279
77280
77281
77282
77283
77284
77285
77286
      }

    }
  }
  return pNew;
}

/*
** Create and return a deep copy of the object passed as the second 
** argument. If an OOM condition is encountered, NULL is returned
** and the db->mallocFailed flag set.
*/
#ifndef SQLITE_OMIT_CTE
static With *withDup(sqlite3 *db, With *p){
  With *pRet = 0;
  if( p ){
    int nByte = sizeof(*p) + sizeof(p->a[0]) * (p->nCte-1);
    pRet = sqlite3DbMallocZero(db, nByte);
    if( pRet ){
      int i;
      pRet->nCte = p->nCte;
      for(i=0; i<p->nCte; i++){
        pRet->a[i].pSelect = sqlite3SelectDup(db, p->a[i].pSelect, 0);
        pRet->a[i].pCols = sqlite3ExprListDup(db, p->a[i].pCols, 0);
        pRet->a[i].zName = sqlite3DbStrDup(db, p->a[i].zName);
      }
    }
  }
  return pRet;
}
#else
# define withDup(x,y) 0
#endif

/*
** The following group of routines make deep copies of expressions,
** expression lists, ID lists, and select statements.  The copies can
** be deleted (by being passed to their respective ...Delete() routines)
** without effecting the originals.
**
** The expression list, ID, and source lists return by sqlite3ExprListDup(),
77248
77249
77250
77251
77252
77253
77254

77255
77256
77257
77258
77259
77260
77261
    pNewItem->zAlias = sqlite3DbStrDup(db, pOldItem->zAlias);
    pNewItem->jointype = pOldItem->jointype;
    pNewItem->iCursor = pOldItem->iCursor;
    pNewItem->addrFillSub = pOldItem->addrFillSub;
    pNewItem->regReturn = pOldItem->regReturn;
    pNewItem->isCorrelated = pOldItem->isCorrelated;
    pNewItem->viaCoroutine = pOldItem->viaCoroutine;

    pNewItem->zIndex = sqlite3DbStrDup(db, pOldItem->zIndex);
    pNewItem->notIndexed = pOldItem->notIndexed;
    pNewItem->pIndex = pOldItem->pIndex;
    pTab = pNewItem->pTab = pOldItem->pTab;
    if( pTab ){
      pTab->nRef++;
    }







>







77353
77354
77355
77356
77357
77358
77359
77360
77361
77362
77363
77364
77365
77366
77367
    pNewItem->zAlias = sqlite3DbStrDup(db, pOldItem->zAlias);
    pNewItem->jointype = pOldItem->jointype;
    pNewItem->iCursor = pOldItem->iCursor;
    pNewItem->addrFillSub = pOldItem->addrFillSub;
    pNewItem->regReturn = pOldItem->regReturn;
    pNewItem->isCorrelated = pOldItem->isCorrelated;
    pNewItem->viaCoroutine = pOldItem->viaCoroutine;
    pNewItem->isRecursive = pOldItem->isRecursive;
    pNewItem->zIndex = sqlite3DbStrDup(db, pOldItem->zIndex);
    pNewItem->notIndexed = pOldItem->notIndexed;
    pNewItem->pIndex = pOldItem->pIndex;
    pTab = pNewItem->pTab = pOldItem->pTab;
    if( pTab ){
      pTab->nRef++;
    }
77309
77310
77311
77312
77313
77314
77315

77316
77317
77318
77319
77320
77321
77322
  pNew->iLimit = 0;
  pNew->iOffset = 0;
  pNew->selFlags = p->selFlags & ~SF_UsesEphemeral;
  pNew->pRightmost = 0;
  pNew->addrOpenEphm[0] = -1;
  pNew->addrOpenEphm[1] = -1;
  pNew->addrOpenEphm[2] = -1;

  return pNew;
}
#else
SQLITE_PRIVATE Select *sqlite3SelectDup(sqlite3 *db, Select *p, int flags){
  assert( p==0 );
  return 0;
}







>







77415
77416
77417
77418
77419
77420
77421
77422
77423
77424
77425
77426
77427
77428
77429
  pNew->iLimit = 0;
  pNew->iOffset = 0;
  pNew->selFlags = p->selFlags & ~SF_UsesEphemeral;
  pNew->pRightmost = 0;
  pNew->addrOpenEphm[0] = -1;
  pNew->addrOpenEphm[1] = -1;
  pNew->addrOpenEphm[2] = -1;
  pNew->pWith = withDup(db, p->pWith);
  return pNew;
}
#else
SQLITE_PRIVATE Select *sqlite3SelectDup(sqlite3 *db, Select *p, int flags){
  assert( p==0 );
  return 0;
}
77828
77829
77830
77831
77832
77833
77834

77835
77836
77837

77838
77839
77840
77841
77842
77843
77844
    assert( p->pEList->a[0].pExpr!=0 ); /* Because of isCandidateForInOpt(p) */
    assert( p->pSrc!=0 );               /* Because of isCandidateForInOpt(p) */
    pTab = p->pSrc->a[0].pTab;
    pExpr = p->pEList->a[0].pExpr;
    iCol = (i16)pExpr->iColumn;
   
    /* Code an OP_VerifyCookie and OP_TableLock for <table>. */

    iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
    sqlite3CodeVerifySchema(pParse, iDb);
    sqlite3TableLock(pParse, iDb, pTab->tnum, 0, pTab->zName);


    /* This function is only called from two places. In both cases the vdbe
    ** has already been allocated. So assume sqlite3GetVdbe() is always
    ** successful here.
    */
    assert(v);
    if( iCol<0 ){







>
|
|
|
>







77935
77936
77937
77938
77939
77940
77941
77942
77943
77944
77945
77946
77947
77948
77949
77950
77951
77952
77953
    assert( p->pEList->a[0].pExpr!=0 ); /* Because of isCandidateForInOpt(p) */
    assert( p->pSrc!=0 );               /* Because of isCandidateForInOpt(p) */
    pTab = p->pSrc->a[0].pTab;
    pExpr = p->pEList->a[0].pExpr;
    iCol = (i16)pExpr->iColumn;
   
    /* Code an OP_VerifyCookie and OP_TableLock for <table>. */
    if( ALWAYS(pTab->pSchema) ){
      iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
      sqlite3CodeVerifySchema(pParse, iDb);
      sqlite3TableLock(pParse, iDb, pTab->tnum, 0, pTab->zName);
    }

    /* This function is only called from two places. In both cases the vdbe
    ** has already been allocated. So assume sqlite3GetVdbe() is always
    ** successful here.
    */
    assert(v);
    if( iCol<0 ){
79661
79662
79663
79664
79665
79666
79667
79668
79669
79670
79671
79672
79673
79674
79675
    sqlite3ExplainExpr(pOut, pList->a[0].pExpr);
  }else{
    sqlite3ExplainPush(pOut);
    for(i=0; i<pList->nExpr; i++){
      sqlite3ExplainPrintf(pOut, "item[%d] = ", i);
      sqlite3ExplainPush(pOut);
      sqlite3ExplainExpr(pOut, pList->a[i].pExpr);
      sqlite3ExplainPop(pOut, 1);
      if( pList->a[i].zName ){
        sqlite3ExplainPrintf(pOut, " AS %s", pList->a[i].zName);
      }
      if( pList->a[i].bSpanIsTab ){
        sqlite3ExplainPrintf(pOut, " (%s)", pList->a[i].zSpan);
      }
      if( i<pList->nExpr-1 ){







|







79770
79771
79772
79773
79774
79775
79776
79777
79778
79779
79780
79781
79782
79783
79784
    sqlite3ExplainExpr(pOut, pList->a[0].pExpr);
  }else{
    sqlite3ExplainPush(pOut);
    for(i=0; i<pList->nExpr; i++){
      sqlite3ExplainPrintf(pOut, "item[%d] = ", i);
      sqlite3ExplainPush(pOut);
      sqlite3ExplainExpr(pOut, pList->a[i].pExpr);
      sqlite3ExplainPop(pOut);
      if( pList->a[i].zName ){
        sqlite3ExplainPrintf(pOut, " AS %s", pList->a[i].zName);
      }
      if( pList->a[i].bSpanIsTab ){
        sqlite3ExplainPrintf(pOut, " (%s)", pList->a[i].zSpan);
      }
      if( i<pList->nExpr-1 ){
84089
84090
84091
84092
84093
84094
84095

84096
84097
84098
84099
84100
84101
84102
  /* Begin by generating some termination code at the end of the
  ** vdbe program
  */
  v = sqlite3GetVdbe(pParse);
  assert( !pParse->isMultiWrite 
       || sqlite3VdbeAssertMayAbort(v, pParse->mayAbort));
  if( v ){

    sqlite3VdbeAddOp0(v, OP_Halt);

    /* The cookie mask contains one bit for each database file open.
    ** (Bit 0 is for main, bit 1 is for temp, and so forth.)  Bits are
    ** set for each database that is used.  Generate code to start a
    ** transaction on each used database and to verify the schema cookie
    ** on each used database.







>







84198
84199
84200
84201
84202
84203
84204
84205
84206
84207
84208
84209
84210
84211
84212
  /* Begin by generating some termination code at the end of the
  ** vdbe program
  */
  v = sqlite3GetVdbe(pParse);
  assert( !pParse->isMultiWrite 
       || sqlite3VdbeAssertMayAbort(v, pParse->mayAbort));
  if( v ){
    while( sqlite3VdbeDeletePriorOpcode(v, OP_Close) ){}
    sqlite3VdbeAddOp0(v, OP_Halt);

    /* The cookie mask contains one bit for each database file open.
    ** (Bit 0 is for main, bit 1 is for temp, and so forth.)  Bits are
    ** set for each database that is used.  Generate code to start a
    ** transaction on each used database and to verify the schema cookie
    ** on each used database.
85400
85401
85402
85403
85404
85405
85406
85407
85408
85409
85410

85411
85412
85413
85414
85415
85416
85417
  unsigned char *zIdent = (unsigned char*)zSignedIdent;
  int i, j, needQuote;
  i = *pIdx;

  for(j=0; zIdent[j]; j++){
    if( !sqlite3Isalnum(zIdent[j]) && zIdent[j]!='_' ) break;
  }
  needQuote = sqlite3Isdigit(zIdent[0]) || sqlite3KeywordCode(zIdent, j)!=TK_ID;
  if( !needQuote ){
    needQuote = zIdent[j];
  }


  if( needQuote ) z[i++] = '"';
  for(j=0; zIdent[j]; j++){
    z[i++] = zIdent[j];
    if( zIdent[j]=='"' ) z[i++] = '"';
  }
  if( needQuote ) z[i++] = '"';







|
|
|
<
>







85510
85511
85512
85513
85514
85515
85516
85517
85518
85519

85520
85521
85522
85523
85524
85525
85526
85527
  unsigned char *zIdent = (unsigned char*)zSignedIdent;
  int i, j, needQuote;
  i = *pIdx;

  for(j=0; zIdent[j]; j++){
    if( !sqlite3Isalnum(zIdent[j]) && zIdent[j]!='_' ) break;
  }
  needQuote = sqlite3Isdigit(zIdent[0])
            || sqlite3KeywordCode(zIdent, j)!=TK_ID
            || zIdent[j]!=0

            || j==0;

  if( needQuote ) z[i++] = '"';
  for(j=0; zIdent[j]; j++){
    z[i++] = zIdent[j];
    if( zIdent[j]=='"' ) z[i++] = '"';
  }
  if( needQuote ) z[i++] = '"';
86626
86627
86628
86629
86630
86631
86632
86633
86634
86635
86636
86637
86638
86639
86640

  /* Open the table. Loop through all rows of the table, inserting index
  ** records into the sorter. */
  sqlite3OpenTable(pParse, iTab, iDb, pTab, OP_OpenRead);
  addr1 = sqlite3VdbeAddOp2(v, OP_Rewind, iTab, 0);
  regRecord = sqlite3GetTempReg(pParse);

  sqlite3GenerateIndexKey(pParse, pIndex, iTab, regRecord, 0, &iPartIdxLabel);
  sqlite3VdbeAddOp2(v, OP_SorterInsert, iSorter, regRecord);
  sqlite3VdbeResolveLabel(v, iPartIdxLabel);
  sqlite3VdbeAddOp2(v, OP_Next, iTab, addr1+1);
  sqlite3VdbeJumpHere(v, addr1);
  if( memRootPage<0 ) sqlite3VdbeAddOp2(v, OP_Clear, tnum, iDb);
  sqlite3VdbeAddOp4(v, OP_OpenWrite, iIdx, tnum, iDb, 
                    (char *)pKey, P4_KEYINFO);







|







86736
86737
86738
86739
86740
86741
86742
86743
86744
86745
86746
86747
86748
86749
86750

  /* Open the table. Loop through all rows of the table, inserting index
  ** records into the sorter. */
  sqlite3OpenTable(pParse, iTab, iDb, pTab, OP_OpenRead);
  addr1 = sqlite3VdbeAddOp2(v, OP_Rewind, iTab, 0);
  regRecord = sqlite3GetTempReg(pParse);

  sqlite3GenerateIndexKey(pParse,pIndex,iTab,regRecord,0,&iPartIdxLabel,0,0);
  sqlite3VdbeAddOp2(v, OP_SorterInsert, iSorter, regRecord);
  sqlite3VdbeResolveLabel(v, iPartIdxLabel);
  sqlite3VdbeAddOp2(v, OP_Next, iTab, addr1+1);
  sqlite3VdbeJumpHere(v, addr1);
  if( memRootPage<0 ) sqlite3VdbeAddOp2(v, OP_Clear, tnum, iDb);
  sqlite3VdbeAddOp4(v, OP_OpenWrite, iIdx, tnum, iDb, 
                    (char *)pKey, P4_KEYINFO);
88147
88148
88149
88150
88151
88152
88153






































































88154
88155
88156
88157
88158
88159
88160
        pIdx->pKeyInfo = pKey;
      }
    }
  }
  return sqlite3KeyInfoRef(pIdx->pKeyInfo);
}







































































/************** End of build.c ***********************************************/
/************** Begin file callback.c ****************************************/
/*
** 2005 May 23 
**
** The author disclaims copyright to this source code.  In place of
** a legal notice, here is a blessing:







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







88257
88258
88259
88260
88261
88262
88263
88264
88265
88266
88267
88268
88269
88270
88271
88272
88273
88274
88275
88276
88277
88278
88279
88280
88281
88282
88283
88284
88285
88286
88287
88288
88289
88290
88291
88292
88293
88294
88295
88296
88297
88298
88299
88300
88301
88302
88303
88304
88305
88306
88307
88308
88309
88310
88311
88312
88313
88314
88315
88316
88317
88318
88319
88320
88321
88322
88323
88324
88325
88326
88327
88328
88329
88330
88331
88332
88333
88334
88335
88336
88337
88338
88339
88340
        pIdx->pKeyInfo = pKey;
      }
    }
  }
  return sqlite3KeyInfoRef(pIdx->pKeyInfo);
}

#ifndef SQLITE_OMIT_CTE
/* 
** This routine is invoked once per CTE by the parser while parsing a 
** WITH clause. 
*/
SQLITE_PRIVATE With *sqlite3WithAdd(
  Parse *pParse,          /* Parsing context */
  With *pWith,            /* Existing WITH clause, or NULL */
  Token *pName,           /* Name of the common-table */
  ExprList *pArglist,     /* Optional column name list for the table */
  Select *pQuery          /* Query used to initialize the table */
){
  sqlite3 *db = pParse->db;
  With *pNew;
  char *zName;

  /* Check that the CTE name is unique within this WITH clause. If
  ** not, store an error in the Parse structure. */
  zName = sqlite3NameFromToken(pParse->db, pName);
  if( zName && pWith ){
    int i;
    for(i=0; i<pWith->nCte; i++){
      if( sqlite3StrICmp(zName, pWith->a[i].zName)==0 ){
        sqlite3ErrorMsg(pParse, "duplicate WITH table name: %s", zName);
      }
    }
  }

  if( pWith ){
    int nByte = sizeof(*pWith) + (sizeof(pWith->a[1]) * pWith->nCte);
    pNew = sqlite3DbRealloc(db, pWith, nByte);
  }else{
    pNew = sqlite3DbMallocZero(db, sizeof(*pWith));
  }
  assert( zName!=0 || pNew==0 );
  assert( db->mallocFailed==0 || pNew==0 );

  if( pNew==0 ){
    sqlite3ExprListDelete(db, pArglist);
    sqlite3SelectDelete(db, pQuery);
    sqlite3DbFree(db, zName);
    pNew = pWith;
  }else{
    pNew->a[pNew->nCte].pSelect = pQuery;
    pNew->a[pNew->nCte].pCols = pArglist;
    pNew->a[pNew->nCte].zName = zName;
    pNew->a[pNew->nCte].zErr = 0;
    pNew->nCte++;
  }

  return pNew;
}

/*
** Free the contents of the With object passed as the second argument.
*/
SQLITE_PRIVATE void sqlite3WithDelete(sqlite3 *db, With *pWith){
  if( pWith ){
    int i;
    for(i=0; i<pWith->nCte; i++){
      struct Cte *pCte = &pWith->a[i];
      sqlite3ExprListDelete(db, pCte->pCols);
      sqlite3SelectDelete(db, pCte->pSelect);
      sqlite3DbFree(db, pCte->zName);
    }
    sqlite3DbFree(db, pWith);
  }
}
#endif /* !defined(SQLITE_OMIT_CTE) */

/************** End of build.c ***********************************************/
/************** Begin file callback.c ****************************************/
/*
** 2005 May 23 
**
** The author disclaims copyright to this source code.  In place of
** a legal notice, here is a blessing:
89345
89346
89347
89348
89349
89350
89351
89352
89353
89354

89355
89356
89357
89358
89359
89360
89361
89362
89363
89364
89365

89366
89367
89368

89369
89370
89371
89372
89373
89374
89375
  Parse *pParse,     /* Parsing and code generating context */
  Table *pTab,       /* Table containing the row to be deleted */
  int iDataCur,      /* Cursor of table holding data. */
  int iIdxCur,       /* First index cursor */
  int *aRegIdx       /* Only delete if aRegIdx!=0 && aRegIdx[i]>0 */
){
  int i;             /* Index loop counter */
  int r1;            /* Register holding an index key */
  int iPartIdxLabel; /* Jump destination for skipping partial index entries */
  Index *pIdx;       /* Current index */

  Vdbe *v;           /* The prepared statement under construction */
  Index *pPk;        /* PRIMARY KEY index, or NULL for rowid tables */

  v = pParse->pVdbe;
  pPk = HasRowid(pTab) ? 0 : sqlite3PrimaryKeyIndex(pTab);
  for(i=0, pIdx=pTab->pIndex; pIdx; i++, pIdx=pIdx->pNext){
    assert( iIdxCur+i!=iDataCur || pPk==pIdx );
    if( aRegIdx!=0 && aRegIdx[i]==0 ) continue;
    if( pIdx==pPk ) continue;
    VdbeModuleComment((v, "GenRowIdxDel for %s", pIdx->zName));
    r1 = sqlite3GenerateIndexKey(pParse, pIdx, iDataCur, 0, 1, &iPartIdxLabel);

    sqlite3VdbeAddOp3(v, OP_IdxDelete, iIdxCur+i, r1,
                      pIdx->uniqNotNull ? pIdx->nKeyCol : pIdx->nColumn);
    sqlite3VdbeResolveLabel(v, iPartIdxLabel);

  }
}

/*
** Generate code that will assemble an index key and stores it in register
** regOut.  The key with be for index pIdx which is an index on pTab.
** iCur is the index of a cursor open on the pTab table and pointing to







|


>










|
>



>







89525
89526
89527
89528
89529
89530
89531
89532
89533
89534
89535
89536
89537
89538
89539
89540
89541
89542
89543
89544
89545
89546
89547
89548
89549
89550
89551
89552
89553
89554
89555
89556
89557
89558
  Parse *pParse,     /* Parsing and code generating context */
  Table *pTab,       /* Table containing the row to be deleted */
  int iDataCur,      /* Cursor of table holding data. */
  int iIdxCur,       /* First index cursor */
  int *aRegIdx       /* Only delete if aRegIdx!=0 && aRegIdx[i]>0 */
){
  int i;             /* Index loop counter */
  int r1 = -1;       /* Register holding an index key */
  int iPartIdxLabel; /* Jump destination for skipping partial index entries */
  Index *pIdx;       /* Current index */
  Index *pPrior = 0; /* Prior index */
  Vdbe *v;           /* The prepared statement under construction */
  Index *pPk;        /* PRIMARY KEY index, or NULL for rowid tables */

  v = pParse->pVdbe;
  pPk = HasRowid(pTab) ? 0 : sqlite3PrimaryKeyIndex(pTab);
  for(i=0, pIdx=pTab->pIndex; pIdx; i++, pIdx=pIdx->pNext){
    assert( iIdxCur+i!=iDataCur || pPk==pIdx );
    if( aRegIdx!=0 && aRegIdx[i]==0 ) continue;
    if( pIdx==pPk ) continue;
    VdbeModuleComment((v, "GenRowIdxDel for %s", pIdx->zName));
    r1 = sqlite3GenerateIndexKey(pParse, pIdx, iDataCur, 0, 1,
                                 &iPartIdxLabel, pPrior, r1);
    sqlite3VdbeAddOp3(v, OP_IdxDelete, iIdxCur+i, r1,
                      pIdx->uniqNotNull ? pIdx->nKeyCol : pIdx->nColumn);
    sqlite3VdbeResolveLabel(v, iPartIdxLabel);
    pPrior = pIdx;
  }
}

/*
** Generate code that will assemble an index key and stores it in register
** regOut.  The key with be for index pIdx which is an index on pTab.
** iCur is the index of a cursor open on the pTab table and pointing to
89383
89384
89385
89386
89387
89388
89389











89390
89391
89392
89393
89394
89395
89396
89397


89398
89399
89400
89401
89402
89403
89404
89405
89406
89407
89408
89409
89410
89411
89412
89413
89414
89415
89416

89417

89418
89419
89420
89421
89422
89423
89424
89425
89426
89427
89428
89429
89430
89431
89432
89433
89434
89435
**
** If *piPartIdxLabel is not NULL, fill it in with a label and jump
** to that label if pIdx is a partial index that should be skipped.
** A partial index should be skipped if its WHERE clause evaluates
** to false or null.  If pIdx is not a partial index, *piPartIdxLabel
** will be set to zero which is an empty label that is ignored by
** sqlite3VdbeResolveLabel().











*/
SQLITE_PRIVATE int sqlite3GenerateIndexKey(
  Parse *pParse,       /* Parsing context */
  Index *pIdx,         /* The index for which to generate a key */
  int iDataCur,        /* Cursor number from which to take column data */
  int regOut,          /* Put the new key into this register if not 0 */
  int prefixOnly,      /* Compute only a unique prefix of the key */
  int *piPartIdxLabel  /* OUT: Jump to this label to skip partial index */


){
  Vdbe *v = pParse->pVdbe;
  int j;
  Table *pTab = pIdx->pTable;
  int regBase;
  int nCol;

  if( piPartIdxLabel ){
    if( pIdx->pPartIdxWhere ){
      *piPartIdxLabel = sqlite3VdbeMakeLabel(v);
      pParse->iPartIdxTab = iDataCur;
      sqlite3ExprIfFalse(pParse, pIdx->pPartIdxWhere, *piPartIdxLabel, 
                         SQLITE_JUMPIFNULL);
    }else{
      *piPartIdxLabel = 0;
    }
  }
  nCol = (prefixOnly && pIdx->uniqNotNull) ? pIdx->nKeyCol : pIdx->nColumn;
  regBase = sqlite3GetTempRange(pParse, nCol);

  for(j=0; j<nCol; j++){

    sqlite3ExprCodeGetColumnOfTable(v, pTab, iDataCur, pIdx->aiColumn[j],
                                    regBase+j);
    /* If the column affinity is REAL but the number is an integer, then it
    ** might be stored in the table as an integer (using a compact
    ** representation) then converted to REAL by an OP_RealAffinity opcode.
    ** But we are getting ready to store this value back into an index, where
    ** it should be converted by to INTEGER again.  So omit the OP_RealAffinity
    ** opcode if it is present */
    if( sqlite3VdbeGetOp(v, -1)->opcode==OP_RealAffinity ){
      sqlite3VdbeDeleteLastOpcode(v);
    }
  }
  if( regOut ){
    sqlite3VdbeAddOp3(v, OP_MakeRecord, regBase, nCol, regOut);
  }
  sqlite3ReleaseTempRange(pParse, regBase, nCol);
  return regBase;
}







>
>
>
>
>
>
>
>
>
>
>







|
>
>



















>

>








<
|
<







89566
89567
89568
89569
89570
89571
89572
89573
89574
89575
89576
89577
89578
89579
89580
89581
89582
89583
89584
89585
89586
89587
89588
89589
89590
89591
89592
89593
89594
89595
89596
89597
89598
89599
89600
89601
89602
89603
89604
89605
89606
89607
89608
89609
89610
89611
89612
89613
89614
89615
89616
89617
89618
89619
89620
89621
89622
89623

89624

89625
89626
89627
89628
89629
89630
89631
**
** If *piPartIdxLabel is not NULL, fill it in with a label and jump
** to that label if pIdx is a partial index that should be skipped.
** A partial index should be skipped if its WHERE clause evaluates
** to false or null.  If pIdx is not a partial index, *piPartIdxLabel
** will be set to zero which is an empty label that is ignored by
** sqlite3VdbeResolveLabel().
**
** The pPrior and regPrior parameters are used to implement a cache to
** avoid unnecessary register loads.  If pPrior is not NULL, then it is
** a pointer to a different index for which an index key has just been
** computed into register regPrior.  If the current pIdx index is generating
** its key into the same sequence of registers and if pPrior and pIdx share
** a column in common, then the register corresponding to that column already
** holds the correct value and the loading of that register is skipped.
** This optimization is helpful when doing a DELETE or an INTEGRITY_CHECK 
** on a table with multiple indices, and especially with the ROWID or
** PRIMARY KEY columns of the index.
*/
SQLITE_PRIVATE int sqlite3GenerateIndexKey(
  Parse *pParse,       /* Parsing context */
  Index *pIdx,         /* The index for which to generate a key */
  int iDataCur,        /* Cursor number from which to take column data */
  int regOut,          /* Put the new key into this register if not 0 */
  int prefixOnly,      /* Compute only a unique prefix of the key */
  int *piPartIdxLabel, /* OUT: Jump to this label to skip partial index */
  Index *pPrior,       /* Previously generated index key */
  int regPrior         /* Register holding previous generated key */
){
  Vdbe *v = pParse->pVdbe;
  int j;
  Table *pTab = pIdx->pTable;
  int regBase;
  int nCol;

  if( piPartIdxLabel ){
    if( pIdx->pPartIdxWhere ){
      *piPartIdxLabel = sqlite3VdbeMakeLabel(v);
      pParse->iPartIdxTab = iDataCur;
      sqlite3ExprIfFalse(pParse, pIdx->pPartIdxWhere, *piPartIdxLabel, 
                         SQLITE_JUMPIFNULL);
    }else{
      *piPartIdxLabel = 0;
    }
  }
  nCol = (prefixOnly && pIdx->uniqNotNull) ? pIdx->nKeyCol : pIdx->nColumn;
  regBase = sqlite3GetTempRange(pParse, nCol);
  if( pPrior && (regBase!=regPrior || pPrior->pPartIdxWhere) ) pPrior = 0;
  for(j=0; j<nCol; j++){
    if( pPrior && pPrior->aiColumn[j]==pIdx->aiColumn[j] ) continue;
    sqlite3ExprCodeGetColumnOfTable(v, pTab, iDataCur, pIdx->aiColumn[j],
                                    regBase+j);
    /* If the column affinity is REAL but the number is an integer, then it
    ** might be stored in the table as an integer (using a compact
    ** representation) then converted to REAL by an OP_RealAffinity opcode.
    ** But we are getting ready to store this value back into an index, where
    ** it should be converted by to INTEGER again.  So omit the OP_RealAffinity
    ** opcode if it is present */

    sqlite3VdbeDeletePriorOpcode(v, OP_RealAffinity);

  }
  if( regOut ){
    sqlite3VdbeAddOp3(v, OP_MakeRecord, regBase, nCol, regOut);
  }
  sqlite3ReleaseTempRange(pParse, regBase, nCol);
  return regBase;
}
93084
93085
93086
93087
93088
93089
93090
93091
93092
93093
93094
93095
93096
93097
93098
**           transfer values form intermediate table into <table>
**         end loop
**      D: cleanup
*/
SQLITE_PRIVATE void sqlite3Insert(
  Parse *pParse,        /* Parser context */
  SrcList *pTabList,    /* Name of table into which we are inserting */
  ExprList *pList,      /* List of values to be inserted */
  Select *pSelect,      /* A SELECT statement to use as the data source */
  IdList *pColumn,      /* Column names corresponding to IDLIST. */
  int onError           /* How to handle constraint errors */
){
  sqlite3 *db;          /* The main database structure */
  Table *pTab;          /* The table to insert into.  aka TABLE */
  char *zTab;           /* Name of the table into which we are inserting */







<







93280
93281
93282
93283
93284
93285
93286

93287
93288
93289
93290
93291
93292
93293
**           transfer values form intermediate table into <table>
**         end loop
**      D: cleanup
*/
SQLITE_PRIVATE void sqlite3Insert(
  Parse *pParse,        /* Parser context */
  SrcList *pTabList,    /* Name of table into which we are inserting */

  Select *pSelect,      /* A SELECT statement to use as the data source */
  IdList *pColumn,      /* Column names corresponding to IDLIST. */
  int onError           /* How to handle constraint errors */
){
  sqlite3 *db;          /* The main database structure */
  Table *pTab;          /* The table to insert into.  aka TABLE */
  char *zTab;           /* Name of the table into which we are inserting */
93112
93113
93114
93115
93116
93117
93118

93119
93120
93121
93122
93123
93124
93125
  int addrCont = 0;     /* Top of insert loop. Label "C" in templates 3 and 4 */
  int addrSelect = 0;   /* Address of coroutine that implements the SELECT */
  SelectDest dest;      /* Destination for SELECT on rhs of INSERT */
  int iDb;              /* Index of database holding TABLE */
  Db *pDb;              /* The database containing table being inserted into */
  int appendFlag = 0;   /* True if the insert is likely to be an append */
  int withoutRowid;     /* 0 for normal table.  1 for WITHOUT ROWID table */


  /* Register allocations */
  int regFromSelect = 0;/* Base register for data coming from SELECT */
  int regAutoinc = 0;   /* Register holding the AUTOINCREMENT counter */
  int regRowCount = 0;  /* Memory cell used for the row counter */
  int regIns;           /* Block of regs holding rowid+data being inserted */
  int regRowid;         /* registers holding insert rowid */







>







93307
93308
93309
93310
93311
93312
93313
93314
93315
93316
93317
93318
93319
93320
93321
  int addrCont = 0;     /* Top of insert loop. Label "C" in templates 3 and 4 */
  int addrSelect = 0;   /* Address of coroutine that implements the SELECT */
  SelectDest dest;      /* Destination for SELECT on rhs of INSERT */
  int iDb;              /* Index of database holding TABLE */
  Db *pDb;              /* The database containing table being inserted into */
  int appendFlag = 0;   /* True if the insert is likely to be an append */
  int withoutRowid;     /* 0 for normal table.  1 for WITHOUT ROWID table */
  ExprList *pList = 0;  /* List of VALUES() to be inserted  */

  /* Register allocations */
  int regFromSelect = 0;/* Base register for data coming from SELECT */
  int regAutoinc = 0;   /* Register holding the AUTOINCREMENT counter */
  int regRowCount = 0;  /* Memory cell used for the row counter */
  int regIns;           /* Block of regs holding rowid+data being inserted */
  int regRowid;         /* registers holding insert rowid */
93134
93135
93136
93137
93138
93139
93140











93141
93142
93143
93144
93145
93146
93147
#endif

  db = pParse->db;
  memset(&dest, 0, sizeof(dest));
  if( pParse->nErr || db->mallocFailed ){
    goto insert_cleanup;
  }












  /* Locate the table into which we will be inserting new information.
  */
  assert( pTabList->nSrc==1 );
  zTab = pTabList->a[0].zName;
  if( NEVER(zTab==0) ) goto insert_cleanup;
  pTab = sqlite3SrcListLookup(pParse, pTabList);







>
>
>
>
>
>
>
>
>
>
>







93330
93331
93332
93333
93334
93335
93336
93337
93338
93339
93340
93341
93342
93343
93344
93345
93346
93347
93348
93349
93350
93351
93352
93353
93354
#endif

  db = pParse->db;
  memset(&dest, 0, sizeof(dest));
  if( pParse->nErr || db->mallocFailed ){
    goto insert_cleanup;
  }

  /* If the Select object is really just a simple VALUES() list with a
  ** single row values (the common case) then keep that one row of values
  ** and go ahead and discard the Select object
  */
  if( pSelect && (pSelect->selFlags & SF_Values)!=0 && pSelect->pPrior==0 ){
    pList = pSelect->pEList;
    pSelect->pEList = 0;
    sqlite3SelectDelete(db, pSelect);
    pSelect = 0;
  }

  /* Locate the table into which we will be inserting new information.
  */
  assert( pTabList->nSrc==1 );
  zTab = pTabList->a[0].zName;
  if( NEVER(zTab==0) ) goto insert_cleanup;
  pTab = sqlite3SrcListLookup(pParse, pTabList);
94390
94391
94392
94393
94394
94395
94396






94397
94398
94399
94400
94401
94402
94403
  Vdbe *v;                         /* The VDBE we are building */
  int regAutoinc;                  /* Memory register used by AUTOINC */
  int destHasUniqueIdx = 0;        /* True if pDest has a UNIQUE index */
  int regData, regRowid;           /* Registers holding data and rowid */

  if( pSelect==0 ){
    return 0;   /* Must be of the form  INSERT INTO ... SELECT ... */






  }
  if( sqlite3TriggerList(pParse, pDest) ){
    return 0;   /* tab1 must not have triggers */
  }
#ifndef SQLITE_OMIT_VIRTUALTABLE
  if( pDest->tabFlags & TF_Virtual ){
    return 0;   /* tab1 must not be a virtual table */







>
>
>
>
>
>







94597
94598
94599
94600
94601
94602
94603
94604
94605
94606
94607
94608
94609
94610
94611
94612
94613
94614
94615
94616
  Vdbe *v;                         /* The VDBE we are building */
  int regAutoinc;                  /* Memory register used by AUTOINC */
  int destHasUniqueIdx = 0;        /* True if pDest has a UNIQUE index */
  int regData, regRowid;           /* Registers holding data and rowid */

  if( pSelect==0 ){
    return 0;   /* Must be of the form  INSERT INTO ... SELECT ... */
  }
  if( pParse->pWith || pSelect->pWith ){
    /* Do not attempt to process this query if there are an WITH clauses
    ** attached to it. Proceeding may generate a false "no such table: xxx"
    ** error if pSelect reads from a CTE named "xxx".  */
    return 0;
  }
  if( sqlite3TriggerList(pParse, pDest) ){
    return 0;   /* tab1 must not have triggers */
  }
#ifndef SQLITE_OMIT_VIRTUALTABLE
  if( pDest->tabFlags & TF_Virtual ){
    return 0;   /* tab1 must not be a virtual table */
97889
97890
97891
97892
97893
97894
97895

97896
97897

97898
97899
97900
97901
97902
97903
97904
97905
97906
97907
97908
97909
97910
97911
97912
97913
97914
97915
97916
97917
97918


97919
97920
97921
97922
97923
97924
97925
      sqlite3VdbeJumpHere(v, addr);

      /* Make sure all the indices are constructed correctly.
      */
      for(x=sqliteHashFirst(pTbls); x && !isQuick; x=sqliteHashNext(x)){
        Table *pTab = sqliteHashData(x);
        Index *pIdx, *pPk;

        int loopTop;
        int iDataCur, iIdxCur;


        if( pTab->pIndex==0 ) continue;
        pPk = HasRowid(pTab) ? 0 : sqlite3PrimaryKeyIndex(pTab);
        addr = sqlite3VdbeAddOp1(v, OP_IfPos, 1);  /* Stop if out of errors */
        sqlite3VdbeAddOp2(v, OP_Halt, 0, 0);
        sqlite3VdbeJumpHere(v, addr);
        sqlite3ExprCacheClear(pParse);
        sqlite3OpenTableAndIndices(pParse, pTab, OP_OpenRead,
                                   1, 0, &iDataCur, &iIdxCur);
        sqlite3VdbeAddOp2(v, OP_Integer, 0, 7);
        for(j=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, j++){
          sqlite3VdbeAddOp2(v, OP_Integer, 0, 8+j); /* index entries counter */
        }
        pParse->nMem = MAX(pParse->nMem, 8+j);
        sqlite3VdbeAddOp2(v, OP_Rewind, iDataCur, 0);
        loopTop = sqlite3VdbeAddOp2(v, OP_AddImm, 7, 1);
        for(j=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, j++){
          int jmp2, jmp3, jmp4;
          int r1;
          if( pPk==pIdx ) continue;
          r1 = sqlite3GenerateIndexKey(pParse, pIdx, iDataCur, 0, 0, &jmp3);


          sqlite3VdbeAddOp2(v, OP_AddImm, 8+j, 1);  /* increment entry count */
          jmp2 = sqlite3VdbeAddOp4Int(v, OP_Found, iIdxCur+j, 0, r1,
                                      pIdx->nColumn);
          sqlite3VdbeAddOp2(v, OP_AddImm, 1, -1); /* Decrement error limit */
          sqlite3VdbeAddOp4(v, OP_String8, 0, 3, 0, "row ", P4_STATIC);
          sqlite3VdbeAddOp3(v, OP_Concat, 7, 3, 3);
          sqlite3VdbeAddOp4(v, OP_String8, 0, 4, 0, " missing from index ",







>


>


















<

|
>
>







98102
98103
98104
98105
98106
98107
98108
98109
98110
98111
98112
98113
98114
98115
98116
98117
98118
98119
98120
98121
98122
98123
98124
98125
98126
98127
98128
98129
98130

98131
98132
98133
98134
98135
98136
98137
98138
98139
98140
98141
      sqlite3VdbeJumpHere(v, addr);

      /* Make sure all the indices are constructed correctly.
      */
      for(x=sqliteHashFirst(pTbls); x && !isQuick; x=sqliteHashNext(x)){
        Table *pTab = sqliteHashData(x);
        Index *pIdx, *pPk;
        Index *pPrior = 0;
        int loopTop;
        int iDataCur, iIdxCur;
        int r1 = -1;

        if( pTab->pIndex==0 ) continue;
        pPk = HasRowid(pTab) ? 0 : sqlite3PrimaryKeyIndex(pTab);
        addr = sqlite3VdbeAddOp1(v, OP_IfPos, 1);  /* Stop if out of errors */
        sqlite3VdbeAddOp2(v, OP_Halt, 0, 0);
        sqlite3VdbeJumpHere(v, addr);
        sqlite3ExprCacheClear(pParse);
        sqlite3OpenTableAndIndices(pParse, pTab, OP_OpenRead,
                                   1, 0, &iDataCur, &iIdxCur);
        sqlite3VdbeAddOp2(v, OP_Integer, 0, 7);
        for(j=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, j++){
          sqlite3VdbeAddOp2(v, OP_Integer, 0, 8+j); /* index entries counter */
        }
        pParse->nMem = MAX(pParse->nMem, 8+j);
        sqlite3VdbeAddOp2(v, OP_Rewind, iDataCur, 0);
        loopTop = sqlite3VdbeAddOp2(v, OP_AddImm, 7, 1);
        for(j=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, j++){
          int jmp2, jmp3, jmp4;

          if( pPk==pIdx ) continue;
          r1 = sqlite3GenerateIndexKey(pParse, pIdx, iDataCur, 0, 0, &jmp3,
                                       pPrior, r1);
          pPrior = pIdx;
          sqlite3VdbeAddOp2(v, OP_AddImm, 8+j, 1);  /* increment entry count */
          jmp2 = sqlite3VdbeAddOp4Int(v, OP_Found, iIdxCur+j, 0, r1,
                                      pIdx->nColumn);
          sqlite3VdbeAddOp2(v, OP_AddImm, 1, -1); /* Decrement error limit */
          sqlite3VdbeAddOp4(v, OP_String8, 0, 3, 0, "row ", P4_STATIC);
          sqlite3VdbeAddOp3(v, OP_Concat, 7, 3, 3);
          sqlite3VdbeAddOp4(v, OP_String8, 0, 4, 0, " missing from index ",
99227
99228
99229
99230
99231
99232
99233

99234
99235
99236
99237
99238
99239
99240
  sqlite3ExprDelete(db, p->pWhere);
  sqlite3ExprListDelete(db, p->pGroupBy);
  sqlite3ExprDelete(db, p->pHaving);
  sqlite3ExprListDelete(db, p->pOrderBy);
  sqlite3SelectDelete(db, p->pPrior);
  sqlite3ExprDelete(db, p->pLimit);
  sqlite3ExprDelete(db, p->pOffset);

}

/*
** Initialize a SelectDest structure.
*/
SQLITE_PRIVATE void sqlite3SelectDestInit(SelectDest *pDest, int eDest, int iParm){
  pDest->eDest = (u8)eDest;







>







99443
99444
99445
99446
99447
99448
99449
99450
99451
99452
99453
99454
99455
99456
99457
  sqlite3ExprDelete(db, p->pWhere);
  sqlite3ExprListDelete(db, p->pGroupBy);
  sqlite3ExprDelete(db, p->pHaving);
  sqlite3ExprListDelete(db, p->pOrderBy);
  sqlite3SelectDelete(db, p->pPrior);
  sqlite3ExprDelete(db, p->pLimit);
  sqlite3ExprDelete(db, p->pOffset);
  sqlite3WithDelete(db, p->pWith);
}

/*
** Initialize a SelectDest structure.
*/
SQLITE_PRIVATE void sqlite3SelectDestInit(SelectDest *pDest, int eDest, int iParm){
  pDest->eDest = (u8)eDest;
99888
99889
99890
99891
99892
99893
99894

99895
99896
99897
99898
99899
99900













99901
99902
99903
99904
99905
99906
99907
      sqlite3VdbeAddOp3(v, OP_IdxDelete, iParm, regResult, nColumn);
      break;
    }
#endif

    /* Store the result as data using a unique key.
    */

    case SRT_Table:
    case SRT_EphemTab: {
      int r1 = sqlite3GetTempReg(pParse);
      testcase( eDest==SRT_Table );
      testcase( eDest==SRT_EphemTab );
      sqlite3VdbeAddOp3(v, OP_MakeRecord, regResult, nColumn, r1);













      if( pOrderBy ){
        pushOntoSorter(pParse, pOrderBy, p, r1);
      }else{
        int r2 = sqlite3GetTempReg(pParse);
        sqlite3VdbeAddOp2(v, OP_NewRowid, iParm, r2);
        sqlite3VdbeAddOp3(v, OP_Insert, iParm, r1, r2);
        sqlite3VdbeChangeP5(v, OPFLAG_APPEND);







>






>
>
>
>
>
>
>
>
>
>
>
>
>







100105
100106
100107
100108
100109
100110
100111
100112
100113
100114
100115
100116
100117
100118
100119
100120
100121
100122
100123
100124
100125
100126
100127
100128
100129
100130
100131
100132
100133
100134
100135
100136
100137
100138
      sqlite3VdbeAddOp3(v, OP_IdxDelete, iParm, regResult, nColumn);
      break;
    }
#endif

    /* Store the result as data using a unique key.
    */
    case SRT_DistTable:
    case SRT_Table:
    case SRT_EphemTab: {
      int r1 = sqlite3GetTempReg(pParse);
      testcase( eDest==SRT_Table );
      testcase( eDest==SRT_EphemTab );
      sqlite3VdbeAddOp3(v, OP_MakeRecord, regResult, nColumn, r1);
#ifndef SQLITE_OMIT_CTE
      if( eDest==SRT_DistTable ){
        /* If the destination is DistTable, then cursor (iParm+1) is open
        ** on an ephemeral index. If the current row is already present
        ** in the index, do not write it to the output. If not, add the
        ** current row to the index and proceed with writing it to the
        ** output table as well.  */
        int addr = sqlite3VdbeCurrentAddr(v) + 4;
        sqlite3VdbeAddOp4Int(v, OP_Found, iParm+1, addr, r1, 0);
        sqlite3VdbeAddOp2(v, OP_IdxInsert, iParm+1, r1);
        assert( pOrderBy==0 );
      }
#endif
      if( pOrderBy ){
        pushOntoSorter(pParse, pOrderBy, p, r1);
      }else{
        int r2 = sqlite3GetTempReg(pParse);
        sqlite3VdbeAddOp2(v, OP_NewRowid, iParm, r2);
        sqlite3VdbeAddOp3(v, OP_Insert, iParm, r1, r2);
        sqlite3VdbeChangeP5(v, OPFLAG_APPEND);
100400
100401
100402
100403
100404
100405
100406
100407
100408
100409
100410
100411
100412
100413
100414
          NameContext sNC;
          Expr *p = pS->pEList->a[iCol].pExpr;
          sNC.pSrcList = pS->pSrc;
          sNC.pNext = pNC;
          sNC.pParse = pNC->pParse;
          zType = columnType(&sNC, p,&zOrigDb,&zOrigTab,&zOrigCol, &estWidth); 
        }
      }else if( ALWAYS(pTab->pSchema) ){
        /* A real table */
        assert( !pS );
        if( iCol<0 ) iCol = pTab->iPKey;
        assert( iCol==-1 || (iCol>=0 && iCol<pTab->nCol) );
#ifdef SQLITE_ENABLE_COLUMN_METADATA
        if( iCol<0 ){
          zType = "INTEGER";







|







100631
100632
100633
100634
100635
100636
100637
100638
100639
100640
100641
100642
100643
100644
100645
          NameContext sNC;
          Expr *p = pS->pEList->a[iCol].pExpr;
          sNC.pSrcList = pS->pSrc;
          sNC.pNext = pNC;
          sNC.pParse = pNC->pParse;
          zType = columnType(&sNC, p,&zOrigDb,&zOrigTab,&zOrigCol, &estWidth); 
        }
      }else if( pTab->pSchema ){
        /* A real table */
        assert( !pS );
        if( iCol<0 ) iCol = pTab->iPKey;
        assert( iCol==-1 || (iCol>=0 && iCol<pTab->nCol) );
#ifdef SQLITE_ENABLE_COLUMN_METADATA
        if( iCol<0 ){
          zType = "INTEGER";
100561
100562
100563
100564
100565
100566
100567


100568
100569
100570
100571
100572
100573
100574
100575
100576
        char *zName = 0;
        zName = sqlite3MPrintf(db, "%s.%s", pTab->zName, zCol);
        sqlite3VdbeSetColName(v, i, COLNAME_NAME, zName, SQLITE_DYNAMIC);
      }else{
        sqlite3VdbeSetColName(v, i, COLNAME_NAME, zCol, SQLITE_TRANSIENT);
      }
    }else{


      sqlite3VdbeSetColName(v, i, COLNAME_NAME, 
          sqlite3DbStrDup(db, pEList->a[i].zSpan), SQLITE_DYNAMIC);
    }
  }
  generateColumnTypes(pParse, pTabList, pEList);
}

/*
** Given a an expression list (which is really the list of expressions







>
>
|
<







100792
100793
100794
100795
100796
100797
100798
100799
100800
100801

100802
100803
100804
100805
100806
100807
100808
        char *zName = 0;
        zName = sqlite3MPrintf(db, "%s.%s", pTab->zName, zCol);
        sqlite3VdbeSetColName(v, i, COLNAME_NAME, zName, SQLITE_DYNAMIC);
      }else{
        sqlite3VdbeSetColName(v, i, COLNAME_NAME, zCol, SQLITE_TRANSIENT);
      }
    }else{
      const char *z = pEList->a[i].zSpan;
      z = z==0 ? sqlite3MPrintf(db, "column%d", i+1) : sqlite3DbStrDup(db, z);
      sqlite3VdbeSetColName(v, i, COLNAME_NAME, z, SQLITE_DYNAMIC);

    }
  }
  generateColumnTypes(pParse, pTabList, pEList);
}

/*
** Given a an expression list (which is really the list of expressions
100926
100927
100928
100929
100930
100931
100932

100933
100934
100935
100936
100937
100938
100939
  int iSub2;            /* EQP id of right-hand query */
#endif

  /* Make sure there is no ORDER BY or LIMIT clause on prior SELECTs.  Only
  ** the last (right-most) SELECT in the series may have an ORDER BY or LIMIT.
  */
  assert( p && p->pPrior );  /* Calling function guarantees this much */

  db = pParse->db;
  pPrior = p->pPrior;
  assert( pPrior->pRightmost!=pPrior );
  assert( pPrior->pRightmost==p->pRightmost );
  dest = *pDest;
  if( pPrior->pOrderBy ){
    sqlite3ErrorMsg(pParse,"ORDER BY clause should come after %s not before",







>







101158
101159
101160
101161
101162
101163
101164
101165
101166
101167
101168
101169
101170
101171
101172
  int iSub2;            /* EQP id of right-hand query */
#endif

  /* Make sure there is no ORDER BY or LIMIT clause on prior SELECTs.  Only
  ** the last (right-most) SELECT in the series may have an ORDER BY or LIMIT.
  */
  assert( p && p->pPrior );  /* Calling function guarantees this much */
  assert( (p->selFlags & SF_Recursive)==0 || p->op==TK_ALL || p->op==TK_UNION );
  db = pParse->db;
  pPrior = p->pPrior;
  assert( pPrior->pRightmost!=pPrior );
  assert( pPrior->pRightmost==p->pRightmost );
  dest = *pDest;
  if( pPrior->pOrderBy ){
    sqlite3ErrorMsg(pParse,"ORDER BY clause should come after %s not before",
100970
100971
100972
100973
100974
100975
100976
100977
















































































100978
100979
100980
100981
100982
100983
100984
100985
100986
100987
100988
100989
    }else{
      sqlite3ErrorMsg(pParse, "SELECTs to the left and right of %s"
        " do not have the same number of result columns", selectOpName(p->op));
    }
    rc = 1;
    goto multi_select_end;
  }

















































































  /* Compound SELECTs that have an ORDER BY clause are handled separately.
  */
  if( p->pOrderBy ){
    return multiSelectOrderBy(pParse, p, pDest);
  }

  /* Generate code for the left and right SELECT statements.
  */
  switch( p->op ){
    case TK_ALL: {
      int addr = 0;
      int nLimit;








>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>




|







101203
101204
101205
101206
101207
101208
101209
101210
101211
101212
101213
101214
101215
101216
101217
101218
101219
101220
101221
101222
101223
101224
101225
101226
101227
101228
101229
101230
101231
101232
101233
101234
101235
101236
101237
101238
101239
101240
101241
101242
101243
101244
101245
101246
101247
101248
101249
101250
101251
101252
101253
101254
101255
101256
101257
101258
101259
101260
101261
101262
101263
101264
101265
101266
101267
101268
101269
101270
101271
101272
101273
101274
101275
101276
101277
101278
101279
101280
101281
101282
101283
101284
101285
101286
101287
101288
101289
101290
101291
101292
101293
101294
101295
101296
101297
101298
101299
101300
101301
101302
    }else{
      sqlite3ErrorMsg(pParse, "SELECTs to the left and right of %s"
        " do not have the same number of result columns", selectOpName(p->op));
    }
    rc = 1;
    goto multi_select_end;
  }

#ifndef SQLITE_OMIT_CTE
  if( p->selFlags & SF_Recursive ){
    SrcList *pSrc = p->pSrc;
    int nCol = p->pEList->nExpr;
    int addrNext;
    int addrSwap;
    int iCont, iBreak;
    int tmp1;                     /* Intermediate table */
    int tmp2;                     /* Next intermediate table */
    int tmp3 = 0;                 /* To ensure unique results if UNION */
    int eDest = SRT_Table;
    SelectDest tmp2dest;
    int i;

    /* Check that there is no ORDER BY or LIMIT clause. Neither of these 
    ** are supported on recursive queries.  */
    assert( p->pOffset==0 || p->pLimit );
    if( p->pOrderBy || p->pLimit ){
      sqlite3ErrorMsg(pParse, "%s in a recursive query",
          p->pOrderBy ? "ORDER BY" : "LIMIT"
      );
      goto multi_select_end;
    }

    if( sqlite3AuthCheck(pParse, SQLITE_RECURSIVE, 0, 0, 0) ){
      goto multi_select_end;
    }
    iBreak = sqlite3VdbeMakeLabel(v);
    iCont = sqlite3VdbeMakeLabel(v);

    for(i=0; ALWAYS(i<pSrc->nSrc); i++){
      if( pSrc->a[i].isRecursive ){
        tmp1 = pSrc->a[i].iCursor;
        break;
      }
    }

    tmp2 = pParse->nTab++;
    if( p->op==TK_UNION ){
      eDest = SRT_DistTable;
      tmp3 = pParse->nTab++;
    }
    sqlite3SelectDestInit(&tmp2dest, eDest, tmp2);

    sqlite3VdbeAddOp2(v, OP_OpenEphemeral, tmp1, nCol);
    sqlite3VdbeAddOp2(v, OP_OpenEphemeral, tmp2, nCol);
    if( tmp3 ){
      p->addrOpenEphm[0] = sqlite3VdbeAddOp2(v, OP_OpenEphemeral, tmp3, 0);
      p->selFlags |= SF_UsesEphemeral;
    }

    /* Store the results of the initial SELECT in tmp2. */
    rc = sqlite3Select(pParse, pPrior, &tmp2dest);
    if( rc ) goto multi_select_end;

    /* Clear tmp1. Then switch the contents of tmp1 and tmp2. Then return 
    ** the contents of tmp1 to the caller. Or, if tmp1 is empty at this
    ** point, the recursive query has finished - jump to address iBreak.  */
    addrSwap = sqlite3VdbeAddOp2(v, OP_SwapCursors, tmp1, tmp2);
    sqlite3VdbeAddOp2(v, OP_Rewind, tmp1, iBreak);
    addrNext = sqlite3VdbeCurrentAddr(v);
    selectInnerLoop(pParse, p, p->pEList, tmp1, p->pEList->nExpr,
        0, 0, &dest, iCont, iBreak);
    sqlite3VdbeResolveLabel(v, iCont);
    sqlite3VdbeAddOp2(v, OP_Next, tmp1, addrNext);

    /* Execute the recursive SELECT. Store the results in tmp2. While this
    ** SELECT is running, the contents of tmp1 are read by recursive 
    ** references to the current CTE.  */
    p->pPrior = 0;
    rc = sqlite3Select(pParse, p, &tmp2dest);
    assert( p->pPrior==0 );
    p->pPrior = pPrior;
    if( rc ) goto multi_select_end;

    sqlite3VdbeAddOp2(v, OP_Goto, 0, addrSwap);
    sqlite3VdbeResolveLabel(v, iBreak);
  }else
#endif

  /* Compound SELECTs that have an ORDER BY clause are handled separately.
  */
  if( p->pOrderBy ){
    return multiSelectOrderBy(pParse, p, pDest);
  }else

  /* Generate code for the left and right SELECT statements.
  */
  switch( p->op ){
    case TK_ALL: {
      int addr = 0;
      int nLimit;
102038
102039
102040
102041
102042
102043
102044








102045
102046
102047
102048
102049
102050
102051
**        an ORDER BY clause.  Ticket #3773.  We could relax this constraint
**        somewhat by saying that the terms of the ORDER BY clause must
**        appear as unmodified result columns in the outer query.  But we
**        have other optimizations in mind to deal with that case.
**
**  (21)  The subquery does not use LIMIT or the outer query is not
**        DISTINCT.  (See ticket [752e1646fc]).








**
** In this routine, the "p" parameter is a pointer to the outer query.
** The subquery is p->pSrc->a[iFrom].  isAgg is true if the outer query
** uses aggregates and subqueryIsAgg is true if the subquery uses aggregates.
**
** If flattening is not attempted, this routine is a no-op and returns 0.
** If flattening is attempted this routine returns 1.







>
>
>
>
>
>
>
>







102351
102352
102353
102354
102355
102356
102357
102358
102359
102360
102361
102362
102363
102364
102365
102366
102367
102368
102369
102370
102371
102372
**        an ORDER BY clause.  Ticket #3773.  We could relax this constraint
**        somewhat by saying that the terms of the ORDER BY clause must
**        appear as unmodified result columns in the outer query.  But we
**        have other optimizations in mind to deal with that case.
**
**  (21)  The subquery does not use LIMIT or the outer query is not
**        DISTINCT.  (See ticket [752e1646fc]).
**
**  (22)  The subquery is not a recursive CTE.
**
**  (23)  The parent is not a recursive CTE, or the sub-query is not a
**        compound query. This restriction is because transforming the
**        parent to a compound query confuses the code that handles
**        recursive queries in multiSelect().
**
**
** In this routine, the "p" parameter is a pointer to the outer query.
** The subquery is p->pSrc->a[iFrom].  isAgg is true if the outer query
** uses aggregates and subqueryIsAgg is true if the subquery uses aggregates.
**
** If flattening is not attempted, this routine is a no-op and returns 0.
** If flattening is attempted this routine returns 1.
102110
102111
102112
102113
102114
102115
102116


102117
102118
102119
102120
102121
102122
102123
     return 0;                                           /* Restriction (11) */
  }
  if( isAgg && pSub->pOrderBy ) return 0;                /* Restriction (16) */
  if( pSub->pLimit && p->pWhere ) return 0;              /* Restriction (19) */
  if( pSub->pLimit && (p->selFlags & SF_Distinct)!=0 ){
     return 0;         /* Restriction (21) */
  }



  /* OBSOLETE COMMENT 1:
  ** Restriction 3:  If the subquery is a join, make sure the subquery is 
  ** not used as the right operand of an outer join.  Examples of why this
  ** is not allowed:
  **
  **         t1 LEFT OUTER JOIN (t2 JOIN t3)







>
>







102431
102432
102433
102434
102435
102436
102437
102438
102439
102440
102441
102442
102443
102444
102445
102446
     return 0;                                           /* Restriction (11) */
  }
  if( isAgg && pSub->pOrderBy ) return 0;                /* Restriction (16) */
  if( pSub->pLimit && p->pWhere ) return 0;              /* Restriction (19) */
  if( pSub->pLimit && (p->selFlags & SF_Distinct)!=0 ){
     return 0;         /* Restriction (21) */
  }
  if( pSub->selFlags & SF_Recursive ) return 0;          /* Restriction (22)  */
  if( (p->selFlags & SF_Recursive) && pSub->pPrior ) return 0;       /* (23)  */

  /* OBSOLETE COMMENT 1:
  ** Restriction 3:  If the subquery is a join, make sure the subquery is 
  ** not used as the right operand of an outer join.  Examples of why this
  ** is not allowed:
  **
  **         t1 LEFT OUTER JOIN (t2 JOIN t3)
102591
102592
102593
102594
102595
102596
102597






























































































































































































102598
102599
102600
102601
102602
102603
102604
  pNew->pOrderBy = 0;
  p->pPrior = 0;
  pNew->pLimit = 0;
  pNew->pOffset = 0;
  return WRC_Continue;
}































































































































































































/*
** This routine is a Walker callback for "expanding" a SELECT statement.
** "Expanding" means to do the following:
**
**    (1)  Make sure VDBE cursor numbers have been assigned to every
**         element of the FROM clause.
**







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







102914
102915
102916
102917
102918
102919
102920
102921
102922
102923
102924
102925
102926
102927
102928
102929
102930
102931
102932
102933
102934
102935
102936
102937
102938
102939
102940
102941
102942
102943
102944
102945
102946
102947
102948
102949
102950
102951
102952
102953
102954
102955
102956
102957
102958
102959
102960
102961
102962
102963
102964
102965
102966
102967
102968
102969
102970
102971
102972
102973
102974
102975
102976
102977
102978
102979
102980
102981
102982
102983
102984
102985
102986
102987
102988
102989
102990
102991
102992
102993
102994
102995
102996
102997
102998
102999
103000
103001
103002
103003
103004
103005
103006
103007
103008
103009
103010
103011
103012
103013
103014
103015
103016
103017
103018
103019
103020
103021
103022
103023
103024
103025
103026
103027
103028
103029
103030
103031
103032
103033
103034
103035
103036
103037
103038
103039
103040
103041
103042
103043
103044
103045
103046
103047
103048
103049
103050
103051
103052
103053
103054
103055
103056
103057
103058
103059
103060
103061
103062
103063
103064
103065
103066
103067
103068
103069
103070
103071
103072
103073
103074
103075
103076
103077
103078
103079
103080
103081
103082
103083
103084
103085
103086
103087
103088
103089
103090
103091
103092
103093
103094
103095
103096
103097
103098
103099
103100
103101
103102
103103
103104
103105
103106
103107
103108
103109
103110
103111
103112
103113
103114
103115
103116
103117
  pNew->pOrderBy = 0;
  p->pPrior = 0;
  pNew->pLimit = 0;
  pNew->pOffset = 0;
  return WRC_Continue;
}

#ifndef SQLITE_OMIT_CTE
/*
** Argument pWith (which may be NULL) points to a linked list of nested 
** WITH contexts, from inner to outermost. If the table identified by 
** FROM clause element pItem is really a common-table-expression (CTE) 
** then return a pointer to the CTE definition for that table. Otherwise
** return NULL.
**
** If a non-NULL value is returned, set *ppContext to point to the With
** object that the returned CTE belongs to.
*/
static struct Cte *searchWith(
  With *pWith,                    /* Current outermost WITH clause */
  struct SrcList_item *pItem,     /* FROM clause element to resolve */
  With **ppContext                /* OUT: WITH clause return value belongs to */
){
  const char *zName;
  if( pItem->zDatabase==0 && (zName = pItem->zName)!=0 ){
    With *p;
    for(p=pWith; p; p=p->pOuter){
      int i;
      for(i=0; i<p->nCte; i++){
        if( sqlite3StrICmp(zName, p->a[i].zName)==0 ){
          *ppContext = p;
          return &p->a[i];
        }
      }
    }
  }
  return 0;
}

/* The code generator maintains a stack of active WITH clauses
** with the inner-most WITH clause being at the top of the stack.
**
** This routine pushes the WITH clause passed as the second argument
** onto the top of the stack. If argument bFree is true, then this
** WITH clause will never be popped from the stack. In this case it
** should be freed along with the Parse object. In other cases, when
** bFree==0, the With object will be freed along with the SELECT 
** statement with which it is associated.
*/
SQLITE_PRIVATE void sqlite3WithPush(Parse *pParse, With *pWith, u8 bFree){
  assert( bFree==0 || pParse->pWith==0 );
  if( pWith ){
    pWith->pOuter = pParse->pWith;
    pParse->pWith = pWith;
    pParse->bFreeWith = bFree;
  }
}

/*
** This function checks if argument pFrom refers to a CTE declared by 
** a WITH clause on the stack currently maintained by the parser. And,
** if currently processing a CTE expression, if it is a recursive
** reference to the current CTE.
**
** If pFrom falls into either of the two categories above, pFrom->pTab
** and other fields are populated accordingly. The caller should check
** (pFrom->pTab!=0) to determine whether or not a successful match
** was found.
**
** Whether or not a match is found, SQLITE_OK is returned if no error
** occurs. If an error does occur, an error message is stored in the
** parser and some error code other than SQLITE_OK returned.
*/
static int withExpand(
  Walker *pWalker, 
  struct SrcList_item *pFrom
){
  Parse *pParse = pWalker->pParse;
  sqlite3 *db = pParse->db;
  struct Cte *pCte;               /* Matched CTE (or NULL if no match) */
  With *pWith;                    /* WITH clause that pCte belongs to */

  assert( pFrom->pTab==0 );

  pCte = searchWith(pParse->pWith, pFrom, &pWith);
  if( pCte ){
    Table *pTab;
    ExprList *pEList;
    Select *pSel;
    Select *pLeft;                /* Left-most SELECT statement */
    int bMayRecursive;            /* True if compound joined by UNION [ALL] */
    With *pSavedWith;             /* Initial value of pParse->pWith */

    /* If pCte->zErr is non-NULL at this point, then this is an illegal
    ** recursive reference to CTE pCte. Leave an error in pParse and return
    ** early. If pCte->zErr is NULL, then this is not a recursive reference.
    ** In this case, proceed.  */
    if( pCte->zErr ){
      sqlite3ErrorMsg(pParse, pCte->zErr, pCte->zName);
      return SQLITE_ERROR;
    }

    pFrom->pTab = pTab = sqlite3DbMallocZero(db, sizeof(Table));
    if( pTab==0 ) return WRC_Abort;
    pTab->nRef = 1;
    pTab->zName = sqlite3DbStrDup(db, pCte->zName);
    pTab->iPKey = -1;
    pTab->nRowEst = 1048576;
    pTab->tabFlags |= TF_Ephemeral;
    pFrom->pSelect = sqlite3SelectDup(db, pCte->pSelect, 0);
    if( db->mallocFailed ) return SQLITE_NOMEM;
    assert( pFrom->pSelect );

    /* Check if this is a recursive CTE. */
    pSel = pFrom->pSelect;
    bMayRecursive = ( pSel->op==TK_ALL || pSel->op==TK_UNION );
    if( bMayRecursive ){
      int i;
      SrcList *pSrc = pFrom->pSelect->pSrc;
      for(i=0; i<pSrc->nSrc; i++){
        struct SrcList_item *pItem = &pSrc->a[i];
        if( pItem->zDatabase==0 
         && pItem->zName!=0 
         && 0==sqlite3StrICmp(pItem->zName, pCte->zName)
          ){
          pItem->pTab = pTab;
          pItem->isRecursive = 1;
          pTab->nRef++;
          pSel->selFlags |= SF_Recursive;
        }
      }
    }

    /* Only one recursive reference is permitted. */ 
    if( pTab->nRef>2 ){
      sqlite3ErrorMsg(
          pParse, "multiple references to recursive table: %s", pCte->zName
      );
      return SQLITE_ERROR;
    }
    assert( pTab->nRef==1 || ((pSel->selFlags&SF_Recursive) && pTab->nRef==2 ));

    pCte->zErr = "circular reference: %s";
    pSavedWith = pParse->pWith;
    pParse->pWith = pWith;
    sqlite3WalkSelect(pWalker, bMayRecursive ? pSel->pPrior : pSel);

    for(pLeft=pSel; pLeft->pPrior; pLeft=pLeft->pPrior);
    pEList = pLeft->pEList;
    if( pCte->pCols ){
      if( pEList->nExpr!=pCte->pCols->nExpr ){
        sqlite3ErrorMsg(pParse, "table %s has %d values for %d columns",
            pCte->zName, pEList->nExpr, pCte->pCols->nExpr
        );
        pParse->pWith = pSavedWith;
        return SQLITE_ERROR;
      }
      pEList = pCte->pCols;
    }

    selectColumnsFromExprList(pParse, pEList, &pTab->nCol, &pTab->aCol);
    if( bMayRecursive ){
      if( pSel->selFlags & SF_Recursive ){
        pCte->zErr = "multiple recursive references: %s";
      }else{
        pCte->zErr = "recursive reference in a subquery: %s";
      }
      sqlite3WalkSelect(pWalker, pSel);
    }
    pCte->zErr = 0;
    pParse->pWith = pSavedWith;
  }

  return SQLITE_OK;
}
#endif

#ifndef SQLITE_OMIT_CTE
/*
** If the SELECT passed as the second argument has an associated WITH 
** clause, pop it from the stack stored as part of the Parse object.
**
** This function is used as the xSelectCallback2() callback by
** sqlite3SelectExpand() when walking a SELECT tree to resolve table
** names and other FROM clause elements. 
*/
static void selectPopWith(Walker *pWalker, Select *p){
  Parse *pParse = pWalker->pParse;
  if( p->pWith ){
    assert( pParse->pWith==p->pWith );
    pParse->pWith = p->pWith->pOuter;
  }
}
#else
#define selectPopWith 0
#endif

/*
** This routine is a Walker callback for "expanding" a SELECT statement.
** "Expanding" means to do the following:
**
**    (1)  Make sure VDBE cursor numbers have been assigned to every
**         element of the FROM clause.
**
102634
102635
102636
102637
102638
102639
102640

102641
102642
102643
102644
102645
102646
102647
102648
102649
102650
102651
102652


102653
102654
102655
102656



102657
102658




102659
102660
102661
102662
102663
102664
102665
    return WRC_Abort;
  }
  if( NEVER(p->pSrc==0) || (selFlags & SF_Expanded)!=0 ){
    return WRC_Prune;
  }
  pTabList = p->pSrc;
  pEList = p->pEList;


  /* Make sure cursor numbers have been assigned to all entries in
  ** the FROM clause of the SELECT statement.
  */
  sqlite3SrcListAssignCursors(pParse, pTabList);

  /* Look up every table named in the FROM clause of the select.  If
  ** an entry of the FROM clause is a subquery instead of a table or view,
  ** then create a transient table structure to describe the subquery.
  */
  for(i=0, pFrom=pTabList->a; i<pTabList->nSrc; i++, pFrom++){
    Table *pTab;


    if( pFrom->pTab!=0 ){
      /* This statement has already been prepared.  There is no need
      ** to go further. */
      assert( i==0 );



      return WRC_Prune;
    }




    if( pFrom->zName==0 ){
#ifndef SQLITE_OMIT_SUBQUERY
      Select *pSel = pFrom->pSelect;
      /* A sub-query in the FROM clause of a SELECT */
      assert( pSel!=0 );
      assert( pFrom->pTab==0 );
      sqlite3WalkSelect(pWalker, pSel);







>












>
>




>
>
>


>
>
>
>







103147
103148
103149
103150
103151
103152
103153
103154
103155
103156
103157
103158
103159
103160
103161
103162
103163
103164
103165
103166
103167
103168
103169
103170
103171
103172
103173
103174
103175
103176
103177
103178
103179
103180
103181
103182
103183
103184
103185
103186
103187
103188
    return WRC_Abort;
  }
  if( NEVER(p->pSrc==0) || (selFlags & SF_Expanded)!=0 ){
    return WRC_Prune;
  }
  pTabList = p->pSrc;
  pEList = p->pEList;
  sqlite3WithPush(pParse, p->pWith, 0);

  /* Make sure cursor numbers have been assigned to all entries in
  ** the FROM clause of the SELECT statement.
  */
  sqlite3SrcListAssignCursors(pParse, pTabList);

  /* Look up every table named in the FROM clause of the select.  If
  ** an entry of the FROM clause is a subquery instead of a table or view,
  ** then create a transient table structure to describe the subquery.
  */
  for(i=0, pFrom=pTabList->a; i<pTabList->nSrc; i++, pFrom++){
    Table *pTab;
    assert( pFrom->isRecursive==0 || pFrom->pTab );
    if( pFrom->isRecursive ) continue;
    if( pFrom->pTab!=0 ){
      /* This statement has already been prepared.  There is no need
      ** to go further. */
      assert( i==0 );
#ifndef SQLITE_OMIT_CTE
      selectPopWith(pWalker, p);
#endif
      return WRC_Prune;
    }
#ifndef SQLITE_OMIT_CTE
    if( withExpand(pWalker, pFrom) ) return WRC_Abort;
    if( pFrom->pTab ) {} else
#endif
    if( pFrom->zName==0 ){
#ifndef SQLITE_OMIT_SUBQUERY
      Select *pSel = pFrom->pSelect;
      /* A sub-query in the FROM clause of a SELECT */
      assert( pSel!=0 );
      assert( pFrom->pTab==0 );
      sqlite3WalkSelect(pWalker, pSel);
102914
102915
102916
102917
102918
102919
102920

102921
102922
102923
102924
102925
102926
102927
102928
102929
102930
102931
102932
102933
102934
102935
102936
102937
102938
102939
102940
102941
102942
102943
102944
102945
102946
102947
102948
102949
102950
102951
102952
102953
102954
102955
102956
102957

102958
102959
102960
102961
102962
102963
102964
102965
102966
102967
102968
102969
102970
102971
102972
102973
102974
102975
102976
102977
102978
102979
102980
102981
102982
102983
102984
102985
102986
102987
  w.xExprCallback = exprWalkNoop;
  w.pParse = pParse;
  if( pParse->hasCompound ){
    w.xSelectCallback = convertCompoundSelectToSubquery;
    sqlite3WalkSelect(&w, pSelect);
  }
  w.xSelectCallback = selectExpander;

  sqlite3WalkSelect(&w, pSelect);
}


#ifndef SQLITE_OMIT_SUBQUERY
/*
** This is a Walker.xSelectCallback callback for the sqlite3SelectTypeInfo()
** interface.
**
** For each FROM-clause subquery, add Column.zType and Column.zColl
** information to the Table structure that represents the result set
** of that subquery.
**
** The Table structure that represents the result set was constructed
** by selectExpander() but the type and collation information was omitted
** at that point because identifiers had not yet been resolved.  This
** routine is called after identifier resolution.
*/
static int selectAddSubqueryTypeInfo(Walker *pWalker, Select *p){
  Parse *pParse;
  int i;
  SrcList *pTabList;
  struct SrcList_item *pFrom;

  assert( p->selFlags & SF_Resolved );
  if( (p->selFlags & SF_HasTypeInfo)==0 ){
    p->selFlags |= SF_HasTypeInfo;
    pParse = pWalker->pParse;
    pTabList = p->pSrc;
    for(i=0, pFrom=pTabList->a; i<pTabList->nSrc; i++, pFrom++){
      Table *pTab = pFrom->pTab;
      if( ALWAYS(pTab!=0) && (pTab->tabFlags & TF_Ephemeral)!=0 ){
        /* A sub-query in the FROM clause of a SELECT */
        Select *pSel = pFrom->pSelect;
        assert( pSel );
        while( pSel->pPrior ) pSel = pSel->pPrior;
        selectAddColumnTypeAndCollation(pParse, pTab, pSel);

      }
    }
  }
  return WRC_Continue;
}
#endif


/*
** This routine adds datatype and collating sequence information to
** the Table structures of all FROM-clause subqueries in a
** SELECT statement.
**
** Use this routine after name resolution.
*/
static void sqlite3SelectAddTypeInfo(Parse *pParse, Select *pSelect){
#ifndef SQLITE_OMIT_SUBQUERY
  Walker w;
  memset(&w, 0, sizeof(w));
  w.xSelectCallback = selectAddSubqueryTypeInfo;
  w.xExprCallback = exprWalkNoop;
  w.pParse = pParse;
  w.bSelectDepthFirst = 1;
  sqlite3WalkSelect(&w, pSelect);
#endif
}


/*
** This routine sets up a SELECT statement for processing.  The







>


















|















|
|
|
>



<















|


<







103437
103438
103439
103440
103441
103442
103443
103444
103445
103446
103447
103448
103449
103450
103451
103452
103453
103454
103455
103456
103457
103458
103459
103460
103461
103462
103463
103464
103465
103466
103467
103468
103469
103470
103471
103472
103473
103474
103475
103476
103477
103478
103479
103480
103481
103482
103483
103484
103485

103486
103487
103488
103489
103490
103491
103492
103493
103494
103495
103496
103497
103498
103499
103500
103501
103502
103503

103504
103505
103506
103507
103508
103509
103510
  w.xExprCallback = exprWalkNoop;
  w.pParse = pParse;
  if( pParse->hasCompound ){
    w.xSelectCallback = convertCompoundSelectToSubquery;
    sqlite3WalkSelect(&w, pSelect);
  }
  w.xSelectCallback = selectExpander;
  w.xSelectCallback2 = selectPopWith;
  sqlite3WalkSelect(&w, pSelect);
}


#ifndef SQLITE_OMIT_SUBQUERY
/*
** This is a Walker.xSelectCallback callback for the sqlite3SelectTypeInfo()
** interface.
**
** For each FROM-clause subquery, add Column.zType and Column.zColl
** information to the Table structure that represents the result set
** of that subquery.
**
** The Table structure that represents the result set was constructed
** by selectExpander() but the type and collation information was omitted
** at that point because identifiers had not yet been resolved.  This
** routine is called after identifier resolution.
*/
static void selectAddSubqueryTypeInfo(Walker *pWalker, Select *p){
  Parse *pParse;
  int i;
  SrcList *pTabList;
  struct SrcList_item *pFrom;

  assert( p->selFlags & SF_Resolved );
  if( (p->selFlags & SF_HasTypeInfo)==0 ){
    p->selFlags |= SF_HasTypeInfo;
    pParse = pWalker->pParse;
    pTabList = p->pSrc;
    for(i=0, pFrom=pTabList->a; i<pTabList->nSrc; i++, pFrom++){
      Table *pTab = pFrom->pTab;
      if( ALWAYS(pTab!=0) && (pTab->tabFlags & TF_Ephemeral)!=0 ){
        /* A sub-query in the FROM clause of a SELECT */
        Select *pSel = pFrom->pSelect;
        if( pSel ){
          while( pSel->pPrior ) pSel = pSel->pPrior;
          selectAddColumnTypeAndCollation(pParse, pTab, pSel);
        }
      }
    }
  }

}
#endif


/*
** This routine adds datatype and collating sequence information to
** the Table structures of all FROM-clause subqueries in a
** SELECT statement.
**
** Use this routine after name resolution.
*/
static void sqlite3SelectAddTypeInfo(Parse *pParse, Select *pSelect){
#ifndef SQLITE_OMIT_SUBQUERY
  Walker w;
  memset(&w, 0, sizeof(w));
  w.xSelectCallback2 = selectAddSubqueryTypeInfo;
  w.xExprCallback = exprWalkNoop;
  w.pParse = pParse;

  sqlite3WalkSelect(&w, pSelect);
#endif
}


/*
** This routine sets up a SELECT statement for processing.  The
104721
104722
104723
104724
104725
104726
104727
104728
104729
104730
104731
104732
104733
104734
104735
104736
104737
104738
104739
104740
104741
104742
104743
104744
104745
104746
104747
104748
104749
104750
104751
104752
104753
** The parser calls this routine when it sees an INSERT inside the
** body of a trigger.
*/
SQLITE_PRIVATE TriggerStep *sqlite3TriggerInsertStep(
  sqlite3 *db,        /* The database connection */
  Token *pTableName,  /* Name of the table into which we insert */
  IdList *pColumn,    /* List of columns in pTableName to insert into */
  ExprList *pEList,   /* The VALUE clause: a list of values to be inserted */
  Select *pSelect,    /* A SELECT statement that supplies values */
  u8 orconf           /* The conflict algorithm (OE_Abort, OE_Replace, etc.) */
){
  TriggerStep *pTriggerStep;

  assert(pEList == 0 || pSelect == 0);
  assert(pEList != 0 || pSelect != 0 || db->mallocFailed);

  pTriggerStep = triggerStepAllocate(db, TK_INSERT, pTableName);
  if( pTriggerStep ){
    pTriggerStep->pSelect = sqlite3SelectDup(db, pSelect, EXPRDUP_REDUCE);
    pTriggerStep->pIdList = pColumn;
    pTriggerStep->pExprList = sqlite3ExprListDup(db, pEList, EXPRDUP_REDUCE);
    pTriggerStep->orconf = orconf;
  }else{
    sqlite3IdListDelete(db, pColumn);
  }
  sqlite3ExprListDelete(db, pEList);
  sqlite3SelectDelete(db, pSelect);

  return pTriggerStep;
}

/*
** Construct a trigger step that implements an UPDATE statement and return







<





<
|





<




<







105244
105245
105246
105247
105248
105249
105250

105251
105252
105253
105254
105255

105256
105257
105258
105259
105260
105261

105262
105263
105264
105265

105266
105267
105268
105269
105270
105271
105272
** The parser calls this routine when it sees an INSERT inside the
** body of a trigger.
*/
SQLITE_PRIVATE TriggerStep *sqlite3TriggerInsertStep(
  sqlite3 *db,        /* The database connection */
  Token *pTableName,  /* Name of the table into which we insert */
  IdList *pColumn,    /* List of columns in pTableName to insert into */

  Select *pSelect,    /* A SELECT statement that supplies values */
  u8 orconf           /* The conflict algorithm (OE_Abort, OE_Replace, etc.) */
){
  TriggerStep *pTriggerStep;


  assert(pSelect != 0 || db->mallocFailed);

  pTriggerStep = triggerStepAllocate(db, TK_INSERT, pTableName);
  if( pTriggerStep ){
    pTriggerStep->pSelect = sqlite3SelectDup(db, pSelect, EXPRDUP_REDUCE);
    pTriggerStep->pIdList = pColumn;

    pTriggerStep->orconf = orconf;
  }else{
    sqlite3IdListDelete(db, pColumn);
  }

  sqlite3SelectDelete(db, pSelect);

  return pTriggerStep;
}

/*
** Construct a trigger step that implements an UPDATE statement and return
105077
105078
105079
105080
105081
105082
105083
105084
105085
105086
105087
105088
105089
105090
105091
          pParse->eOrconf
        );
        break;
      }
      case TK_INSERT: {
        sqlite3Insert(pParse, 
          targetSrcList(pParse, pStep),
          sqlite3ExprListDup(db, pStep->pExprList, 0), 
          sqlite3SelectDup(db, pStep->pSelect, 0), 
          sqlite3IdListDup(db, pStep->pIdList), 
          pParse->eOrconf
        );
        break;
      }
      case TK_DELETE: {







<







105596
105597
105598
105599
105600
105601
105602

105603
105604
105605
105606
105607
105608
105609
          pParse->eOrconf
        );
        break;
      }
      case TK_INSERT: {
        sqlite3Insert(pParse, 
          targetSrcList(pParse, pStep),

          sqlite3SelectDup(db, pStep->pSelect, 0), 
          sqlite3IdListDup(db, pStep->pIdList), 
          pParse->eOrconf
        );
        break;
      }
      case TK_DELETE: {
108828
108829
108830
108831
108832
108833
108834
108835
108836
108837
108838
108839
108840
108841
108842
  ){
    /* IMP: R-02065-49465 The left-hand side of the LIKE or GLOB operator must
    ** be the name of an indexed column with TEXT affinity. */
    return 0;
  }
  assert( pLeft->iColumn!=(-1) ); /* Because IPK never has AFF_TEXT */

  pRight = pList->a[0].pExpr;
  op = pRight->op;
  if( op==TK_VARIABLE ){
    Vdbe *pReprepare = pParse->pReprepare;
    int iCol = pRight->iColumn;
    pVal = sqlite3VdbeGetBoundValue(pReprepare, iCol, SQLITE_AFF_NONE);
    if( pVal && sqlite3_value_type(pVal)==SQLITE_TEXT ){
      z = (char *)sqlite3_value_text(pVal);







|







109346
109347
109348
109349
109350
109351
109352
109353
109354
109355
109356
109357
109358
109359
109360
  ){
    /* IMP: R-02065-49465 The left-hand side of the LIKE or GLOB operator must
    ** be the name of an indexed column with TEXT affinity. */
    return 0;
  }
  assert( pLeft->iColumn!=(-1) ); /* Because IPK never has AFF_TEXT */

  pRight = sqlite3ExprSkipCollate(pList->a[0].pExpr);
  op = pRight->op;
  if( op==TK_VARIABLE ){
    Vdbe *pReprepare = pParse->pReprepare;
    int iCol = pRight->iColumn;
    pVal = sqlite3VdbeGetBoundValue(pReprepare, iCol, SQLITE_AFF_NONE);
    if( pVal && sqlite3_value_type(pVal)==SQLITE_TEXT ){
      z = (char *)sqlite3_value_text(pVal);
109871
109872
109873
109874
109875
109876
109877
109878
109879
109880
109881
109882
109883
109884
109885
  sqlite3VdbeAddOp2(v, OP_OpenAutoindex, pLevel->iIdxCur, nKeyCol+1);
  sqlite3VdbeSetP4KeyInfo(pParse, pIdx);
  VdbeComment((v, "for %s", pTable->zName));

  /* Fill the automatic index with content */
  addrTop = sqlite3VdbeAddOp1(v, OP_Rewind, pLevel->iTabCur);
  regRecord = sqlite3GetTempReg(pParse);
  sqlite3GenerateIndexKey(pParse, pIdx, pLevel->iTabCur, regRecord, 0, 0);
  sqlite3VdbeAddOp2(v, OP_IdxInsert, pLevel->iIdxCur, regRecord);
  sqlite3VdbeChangeP5(v, OPFLAG_USESEEKRESULT);
  sqlite3VdbeAddOp2(v, OP_Next, pLevel->iTabCur, addrTop+1);
  sqlite3VdbeChangeP5(v, SQLITE_STMTSTATUS_AUTOINDEX);
  sqlite3VdbeJumpHere(v, addrTop);
  sqlite3ReleaseTempReg(pParse, regRecord);
  







|







110389
110390
110391
110392
110393
110394
110395
110396
110397
110398
110399
110400
110401
110402
110403
  sqlite3VdbeAddOp2(v, OP_OpenAutoindex, pLevel->iIdxCur, nKeyCol+1);
  sqlite3VdbeSetP4KeyInfo(pParse, pIdx);
  VdbeComment((v, "for %s", pTable->zName));

  /* Fill the automatic index with content */
  addrTop = sqlite3VdbeAddOp1(v, OP_Rewind, pLevel->iTabCur);
  regRecord = sqlite3GetTempReg(pParse);
  sqlite3GenerateIndexKey(pParse, pIdx, pLevel->iTabCur, regRecord, 0, 0, 0, 0);
  sqlite3VdbeAddOp2(v, OP_IdxInsert, pLevel->iIdxCur, regRecord);
  sqlite3VdbeChangeP5(v, OPFLAG_USESEEKRESULT);
  sqlite3VdbeAddOp2(v, OP_Next, pLevel->iTabCur, addrTop+1);
  sqlite3VdbeChangeP5(v, SQLITE_STMTSTATUS_AUTOINDEX);
  sqlite3VdbeJumpHere(v, addrTop);
  sqlite3ReleaseTempReg(pParse, regRecord);
  
112357
112358
112359
112360
112361
112362
112363

112364
112365
112366
112367
112368
112369
112370
  if( !pBuilder->pOrSet
   && (pWInfo->pParse->db->flags & SQLITE_AutoIndex)!=0
   && pSrc->pIndex==0
   && !pSrc->viaCoroutine
   && !pSrc->notIndexed
   && HasRowid(pTab)
   && !pSrc->isCorrelated

  ){
    /* Generate auto-index WhereLoops */
    WhereTerm *pTerm;
    WhereTerm *pWCEnd = pWC->a + pWC->nTerm;
    for(pTerm=pWC->a; rc==SQLITE_OK && pTerm<pWCEnd; pTerm++){
      if( pTerm->prereqRight & pNew->maskSelf ) continue;
      if( termCanDriveIndex(pTerm, pSrc, 0) ){







>







112875
112876
112877
112878
112879
112880
112881
112882
112883
112884
112885
112886
112887
112888
112889
  if( !pBuilder->pOrSet
   && (pWInfo->pParse->db->flags & SQLITE_AutoIndex)!=0
   && pSrc->pIndex==0
   && !pSrc->viaCoroutine
   && !pSrc->notIndexed
   && HasRowid(pTab)
   && !pSrc->isCorrelated
   && !pSrc->isRecursive
  ){
    /* Generate auto-index WhereLoops */
    WhereTerm *pTerm;
    WhereTerm *pWCEnd = pWC->a + pWC->nTerm;
    for(pTerm=pWC->a; rc==SQLITE_OK && pTerm<pWCEnd; pTerm++){
      if( pTerm->prereqRight & pNew->maskSelf ) continue;
      if( termCanDriveIndex(pTerm, pSrc, 0) ){
114127
114128
114129
114130
114131
114132
114133
114134
114135
114136
114137
114138
114139
114140
114141
114142
114143
114144
114145
114146
114147
114148
struct TrigEvent { int a; IdList * b; };

/*
** An instance of this structure holds the ATTACH key and the key type.
*/
struct AttachKey { int type;  Token key; };

/*
** One or more VALUES claues
*/
struct ValueList {
  ExprList *pList;
  Select *pSelect;
};


  /* This is a utility routine used to set the ExprSpan.zStart and
  ** ExprSpan.zEnd values of pOut so that the span covers the complete
  ** range of text beginning with pStart and going to the end of pEnd.
  */
  static void spanSet(ExprSpan *pOut, Token *pStart, Token *pEnd){
    pOut->zStart = pStart->z;







<
<
<
<
<
<
<
<







114646
114647
114648
114649
114650
114651
114652








114653
114654
114655
114656
114657
114658
114659
struct TrigEvent { int a; IdList * b; };

/*
** An instance of this structure holds the ATTACH key and the key type.
*/
struct AttachKey { int type;  Token key; };










  /* This is a utility routine used to set the ExprSpan.zStart and
  ** ExprSpan.zEnd values of pOut so that the span covers the complete
  ** range of text beginning with pStart and going to the end of pEnd.
  */
  static void spanSet(ExprSpan *pOut, Token *pStart, Token *pEnd){
    pOut->zStart = pStart->z;
114258
114259
114260
114261
114262
114263
114264
114265
114266
114267
114268
114269
114270
114271
114272
114273
114274
114275
114276
114277
114278
114279
114280
114281
114282

114283

114284

114285

114286

114287
114288
114289
114290
114291
114292
114293
114294
114295
114296
114297
114298
114299
114300
114301
114302
114303
**    sqlite3ParserARG_FETCH     Code to extract %extra_argument from yypParser
**    YYNSTATE           the combined number of states.
**    YYNRULE            the number of rules in the grammar
**    YYERRORSYMBOL      is the code number of the error symbol.  If not
**                       defined, then do no error processing.
*/
#define YYCODETYPE unsigned char
#define YYNOCODE 253
#define YYACTIONTYPE unsigned short int
#define YYWILDCARD 68
#define sqlite3ParserTOKENTYPE Token
typedef union {
  int yyinit;
  sqlite3ParserTOKENTYPE yy0;
  int yy4;
  struct TrigEvent yy90;
  ExprSpan yy118;
  u16 yy177;
  TriggerStep* yy203;
  u8 yy210;
  struct {int value; int mask;} yy215;
  SrcList* yy259;
  struct ValueList yy260;
  struct LimitVal yy292;
  Expr* yy314;

  ExprList* yy322;

  struct LikeOp yy342;

  IdList* yy384;

  Select* yy387;

} YYMINORTYPE;
#ifndef YYSTACKDEPTH
#define YYSTACKDEPTH 100
#endif
#define sqlite3ParserARG_SDECL Parse *pParse;
#define sqlite3ParserARG_PDECL ,Parse *pParse
#define sqlite3ParserARG_FETCH Parse *pParse = yypParser->pParse
#define sqlite3ParserARG_STORE yypParser->pParse = pParse
#define YYNSTATE 631
#define YYNRULE 329
#define YYFALLBACK 1
#define YY_NO_ACTION      (YYNSTATE+YYNRULE+2)
#define YY_ACCEPT_ACTION  (YYNSTATE+YYNRULE+1)
#define YY_ERROR_ACTION   (YYNSTATE+YYNRULE)

/* The yyzerominor constant is used to initialize instances of
** YYMINORTYPE objects to zero. */







|

|




|
<
<
|
<
|
<
|
<
|
|
>
|
>
|
>
|
>
|
>








|
|







114769
114770
114771
114772
114773
114774
114775
114776
114777
114778
114779
114780
114781
114782
114783


114784

114785

114786

114787
114788
114789
114790
114791
114792
114793
114794
114795
114796
114797
114798
114799
114800
114801
114802
114803
114804
114805
114806
114807
114808
114809
114810
114811
114812
114813
114814
**    sqlite3ParserARG_FETCH     Code to extract %extra_argument from yypParser
**    YYNSTATE           the combined number of states.
**    YYNRULE            the number of rules in the grammar
**    YYERRORSYMBOL      is the code number of the error symbol.  If not
**                       defined, then do no error processing.
*/
#define YYCODETYPE unsigned char
#define YYNOCODE 254
#define YYACTIONTYPE unsigned short int
#define YYWILDCARD 70
#define sqlite3ParserTOKENTYPE Token
typedef union {
  int yyinit;
  sqlite3ParserTOKENTYPE yy0;
  Select* yy3;


  ExprList* yy14;

  With* yy59;

  SrcList* yy65;

  struct LikeOp yy96;
  Expr* yy132;
  u8 yy186;
  int yy328;
  ExprSpan yy346;
  struct TrigEvent yy378;
  u16 yy381;
  IdList* yy408;
  struct {int value; int mask;} yy429;
  TriggerStep* yy473;
  struct LimitVal yy476;
} YYMINORTYPE;
#ifndef YYSTACKDEPTH
#define YYSTACKDEPTH 100
#endif
#define sqlite3ParserARG_SDECL Parse *pParse;
#define sqlite3ParserARG_PDECL ,Parse *pParse
#define sqlite3ParserARG_FETCH Parse *pParse = yypParser->pParse
#define sqlite3ParserARG_STORE yypParser->pParse = pParse
#define YYNSTATE 642
#define YYNRULE 327
#define YYFALLBACK 1
#define YY_NO_ACTION      (YYNSTATE+YYNRULE+2)
#define YY_ACCEPT_ACTION  (YYNSTATE+YYNRULE+1)
#define YY_ERROR_ACTION   (YYNSTATE+YYNRULE)

/* The yyzerominor constant is used to initialize instances of
** YYMINORTYPE objects to zero. */
114359
114360
114361
114362
114363
114364
114365
114366
114367
114368
114369
114370
114371
114372
114373
114374
114375
114376
114377
114378
114379
114380
114381
114382
114383
114384
114385
114386
114387
114388
114389
114390
114391
114392
114393
114394
114395
114396
114397
114398
114399
114400
114401
114402
114403
114404
114405
114406
114407
114408
114409
114410
114411
114412
114413
114414
114415
114416
114417
114418
114419
114420
114421
114422
114423
114424
114425
114426
114427
114428
114429
114430
114431
114432
114433
114434
114435
114436
114437
114438
114439
114440
114441
114442
114443
114444
114445
114446
114447
114448
114449
114450
114451
114452
114453
114454
114455
114456
114457
114458
114459
114460
114461
114462
114463
114464
114465
114466
114467
114468
114469
114470
114471
114472
114473
114474
114475
114476
114477
114478
114479
114480
114481
114482
114483
114484
114485
114486





114487
114488
114489
114490
114491
114492
114493
114494
114495
114496
114497
114498
114499
114500
114501
114502
114503
114504
114505
114506







114507
114508
114509
114510
114511
114512
114513
114514
114515
114516
114517
114518
114519
114520
114521
114522
114523
114524
114525
114526
114527
114528
114529
114530
114531
114532
114533
114534
114535
114536
114537
114538
114539
114540
114541
114542
114543
114544
114545
114546
114547
114548
114549
114550
114551
114552
114553
114554
114555

114556
114557
114558
114559
114560
114561
114562
114563
114564
114565
114566
114567
114568
114569
114570
114571
114572
114573
114574
114575
114576
114577
114578
114579

114580
114581
114582
114583
114584
114585
114586
114587
114588

114589
114590
114591
114592
114593
114594
114595
114596

114597
114598
114599
114600
114601
114602
114603

114604
114605
114606
114607
114608
114609
114610
114611

114612
114613
114614
114615
114616
114617
114618



114619
114620
114621
114622
114623
114624
114625
114626
114627
114628
114629
114630
114631
114632
114633



114634
114635
114636
114637
114638
114639
114640
114641
114642
114643
114644
114645
114646
114647
114648
114649
114650
114651





114652
114653
114654
114655
114656
114657
114658
114659
114660
114661
114662
114663
114664
114665
114666
114667
114668
114669
114670
114671
114672




114673
114674
114675
114676
114677
114678
114679
114680
114681
114682
114683
114684
114685
114686
114687
114688
114689
114690
114691
114692
114693
114694
114695
114696
114697
114698
114699
114700
114701
114702
114703
114704
114705
114706
114707
114708
114709
114710
114711
114712
114713
114714
114715
114716
114717
114718
114719
114720
114721
114722
114723
114724
114725
114726
114727
114728
114729
114730
114731
114732
114733
114734
114735

114736
114737
114738
114739
114740
114741
114742
114743
114744
114745
114746
114747
114748
114749
114750
114751
114752
114753
114754
114755
114756
114757
114758
114759
114760
114761
114762
114763
114764
114765
114766
114767
114768
114769
114770
114771
114772
114773
114774
114775
114776
114777
114778
114779
114780
114781
114782
114783
114784
114785
114786
114787
114788
114789
114790
114791
114792
114793
114794
114795
114796
114797
114798
114799
114800
114801
114802
114803
114804
114805
114806
114807
114808
114809
114810
114811
114812
114813
114814
114815
114816
114817
114818
114819
114820
114821
114822
114823
114824
114825
114826
114827
114828
114829
114830
114831
114832
114833
114834
114835
114836
114837
114838
114839

114840
114841
114842
114843
114844
114845
114846
**                     yy_action.  Used to detect hash collisions.
**  yy_shift_ofst[]    For each state, the offset into yy_action for
**                     shifting terminals.
**  yy_reduce_ofst[]   For each state, the offset into yy_action for
**                     shifting non-terminals after a reduce.
**  yy_default[]       Default action for each state.
*/
#define YY_ACTTAB_COUNT (1582)
static const YYACTIONTYPE yy_action[] = {
 /*     0 */   312,  961,  185,  420,    2,  171,  516,  515,  597,   56,
 /*    10 */    56,   56,   56,   49,   54,   54,   54,   54,   53,   53,
 /*    20 */    52,   52,   52,   51,  234,  197,  196,  195,  624,  623,
 /*    30 */   301,  590,  584,   56,   56,   56,   56,  156,   54,   54,
 /*    40 */    54,   54,   53,   53,   52,   52,   52,   51,  234,  628,
 /*    50 */    57,   58,   48,  582,  581,  583,  583,   55,   55,   56,
 /*    60 */    56,   56,   56,  466,   54,   54,   54,   54,   53,   53,
 /*    70 */    52,   52,   52,   51,  234,  312,  597,   52,   52,   52,
 /*    80 */    51,  234,   33,   54,   54,   54,   54,   53,   53,   52,
 /*    90 */    52,   52,   51,  234,  624,  623,  621,  620,  165,  624,
 /*   100 */   623,  383,  380,  379,  214,  328,  590,  584,  624,  623,
 /*   110 */   467,   59,  378,  619,  618,  617,   53,   53,   52,   52,
 /*   120 */    52,   51,  234,  506,  507,   57,   58,   48,  582,  581,
 /*   130 */   583,  583,   55,   55,   56,   56,   56,   56,   30,   54,
 /*   140 */    54,   54,   54,   53,   53,   52,   52,   52,   51,  234,
 /*   150 */   312,   50,   47,  146,  233,  232,  207,  474,  256,  349,
 /*   160 */   255,  475,  621,  620,  554,  438,  298,  621,  620,  236,
 /*   170 */   674,  435,  440,  553,  439,  366,  621,  620,  540,  224,
 /*   180 */   551,  590,  584,  176,  138,  282,  386,  277,  385,  168,
 /*   190 */   600,  422,  951,  548,  622,  951,  273,  572,  572,  566,
 /*   200 */    57,   58,   48,  582,  581,  583,  583,   55,   55,   56,
 /*   210 */    56,   56,   56,  354,   54,   54,   54,   54,   53,   53,
 /*   220 */    52,   52,   52,   51,  234,  312,  561,  526,   62,  675,
 /*   230 */   132,  595,  410,  348,  579,  579,  492,  426,  577,  419,
 /*   240 */   627,   65,  329,  560,  441,  237,  676,  123,  607,   67,
 /*   250 */   542,  532,  622,  170,  205,  500,  590,  584,  166,  559,
 /*   260 */   622,  403,  593,  593,  593,  442,  443,  271,  422,  950,
 /*   270 */   166,  223,  950,  483,  190,   57,   58,   48,  582,  581,
 /*   280 */   583,  583,   55,   55,   56,   56,   56,   56,  600,   54,
 /*   290 */    54,   54,   54,   53,   53,   52,   52,   52,   51,  234,
 /*   300 */   312,  441,  412,  376,  175,  165,  166,  391,  383,  380,
 /*   310 */   379,  342,  412,  203,  426,   66,  392,  622,  415,  378,
 /*   320 */   597,  166,  442,  338,  444,  571,  601,   74,  415,  624,
 /*   330 */   623,  590,  584,  624,  623,  174,  601,   92,  333,  171,
 /*   340 */     1,  410,  597,  579,  579,  624,  623,  600,  306,  425,
 /*   350 */    57,   58,   48,  582,  581,  583,  583,   55,   55,   56,
 /*   360 */    56,   56,   56,  580,   54,   54,   54,   54,   53,   53,
 /*   370 */    52,   52,   52,   51,  234,  312,  472,  262,  399,   68,
 /*   380 */   412,  339,  571,  389,  624,  623,  578,  602,  597,  589,
 /*   390 */   588,  603,  412,  622,  423,  533,  415,  621,  620,  513,
 /*   400 */   257,  621,  620,  166,  601,   91,  590,  584,  415,   45,
 /*   410 */   597,  586,  585,  621,  620,  250,  601,   92,   39,  347,
 /*   420 */   576,  336,  597,  547,  567,   57,   58,   48,  582,  581,
 /*   430 */   583,  583,   55,   55,   56,   56,   56,   56,  587,   54,
 /*   440 */    54,   54,   54,   53,   53,   52,   52,   52,   51,  234,
 /*   450 */   312,  561,  621,  620,  531,  291,  470,  188,  399,  375,
 /*   460 */   247,  492,  249,  350,  412,  476,  476,  368,  560,  299,
 /*   470 */   334,  412,  281,  482,   67,  565,  410,  622,  579,  579,
 /*   480 */   415,  590,  584,  280,  559,  467,  520,  415,  601,   92,
 /*   490 */   597,  167,  544,   36,  877,  601,   16,  519,  564,    6,
 /*   500 */    57,   58,   48,  582,  581,  583,  583,   55,   55,   56,
 /*   510 */    56,   56,   56,  200,   54,   54,   54,   54,   53,   53,
 /*   520 */    52,   52,   52,   51,  234,  312,  183,  412,  236,  528,
 /*   530 */   395,  535,  358,  256,  349,  255,  397,  412,  248,  182,
 /*   540 */   353,  359,  549,  415,  236,  317,  563,   50,   47,  146,
 /*   550 */   273,  601,   73,  415,    7,  311,  590,  584,  568,  493,
 /*   560 */   213,  601,   92,  233,  232,  410,  173,  579,  579,  330,
 /*   570 */   575,  574,  631,  629,  332,   57,   58,   48,  582,  581,
 /*   580 */   583,  583,   55,   55,   56,   56,   56,   56,  199,   54,
 /*   590 */    54,   54,   54,   53,   53,   52,   52,   52,   51,  234,
 /*   600 */   312,  492,  340,  320,  511,  505,  572,  572,  460,  562,
 /*   610 */   549,  170,  145,  430,   67,  558,  410,  622,  579,  579,
 /*   620 */   384,  236,  600,  412,  408,  575,  574,  504,  572,  572,
 /*   630 */   571,  590,  584,  353,  198,  143,  268,  549,  316,  415,
 /*   640 */   306,  424,  207,   50,   47,  146,  167,  601,   69,  546,
 /*   650 */    57,   58,   48,  582,  581,  583,  583,   55,   55,   56,
 /*   660 */    56,   56,   56,  555,   54,   54,   54,   54,   53,   53,
 /*   670 */    52,   52,   52,   51,  234,  312,  600,  326,  412,  270,
 /*   680 */   145,  264,  274,  266,  459,  571,  423,   35,  412,  568,
 /*   690 */   407,  213,  428,  388,  415,  308,  212,  143,  622,  354,
 /*   700 */   317,   12,  601,   94,  415,  549,  590,  584,   50,   47,
 /*   710 */   146,  365,  601,   97,  552,  362,  318,  147,  602,  361,
 /*   720 */   325,   15,  603,  187,  206,   57,   58,   48,  582,  581,
 /*   730 */   583,  583,   55,   55,   56,   56,   56,   56,  412,   54,
 /*   740 */    54,   54,   54,   53,   53,   52,   52,   52,   51,  234,
 /*   750 */   312,  412,   35,  412,  415,   22,  630,    2,  600,   50,
 /*   760 */    47,  146,  601,   95,  412,  485,  510,  415,  412,  415,
 /*   770 */   412,   11,  235,  486,  412,  601,  104,  601,  103,   19,
 /*   780 */   415,  590,  584,  352,  415,   40,  415,   38,  601,  105,
 /*   790 */   415,   32,  601,  106,  601,  133,  544,  169,  601,  134,
 /*   800 */    57,   58,   48,  582,  581,  583,  583,   55,   55,   56,
 /*   810 */    56,   56,   56,  412,   54,   54,   54,   54,   53,   53,
 /*   820 */    52,   52,   52,   51,  234,  312,  412,  274,  412,  415,
 /*   830 */   412,  274,  274,  274,  201,  230,  721,  601,   98,  484,
 /*   840 */   427,  307,  415,  622,  415,  540,  415,  622,  622,  622,
 /*   850 */   601,  102,  601,  101,  601,   93,  590,  584,  262,   21,
 /*   860 */   129,  622,  522,  521,  554,  222,  469,  521,  600,  324,
 /*   870 */   323,  322,  211,  553,  622,   57,   58,   48,  582,  581,
 /*   880 */   583,  583,   55,   55,   56,   56,   56,   56,  412,   54,
 /*   890 */    54,   54,   54,   53,   53,   52,   52,   52,   51,  234,
 /*   900 */   312,  412,  261,  412,  415,  412,  600,  210,  625,  367,
 /*   910 */    51,  234,  601,  100,  538,  606,  142,  415,  355,  415,
 /*   920 */   412,  415,  412,  496,  622,  601,   77,  601,   96,  601,
 /*   930 */   137,  590,  584,  530,  622,  529,  415,  141,  415,   28,
 /*   940 */   524,  600,  229,  544,  601,  136,  601,  135,  604,  204,
 /*   950 */    57,   58,   48,  582,  581,  583,  583,   55,   55,   56,
 /*   960 */    56,   56,   56,  412,   54,   54,   54,   54,   53,   53,
 /*   970 */    52,   52,   52,   51,  234,  312,  412,  360,  412,  415,
 /*   980 */   412,  360,  286,  600,  503,  220,  127,  601,   76,  629,
 /*   990 */   332,  382,  415,  622,  415,  540,  415,  622,  412,  613,
 /*  1000 */   601,   90,  601,   89,  601,   75,  590,  584,  341,  272,
 /*  1010 */   377,  622,  126,   27,  415,  622,  164,  544,  125,  280,
 /*  1020 */   373,  122,  601,   88,  480,   57,   46,   48,  582,  581,
 /*  1030 */   583,  583,   55,   55,   56,   56,   56,   56,  412,   54,
 /*  1040 */    54,   54,   54,   53,   53,   52,   52,   52,   51,  234,
 /*  1050 */   312,  412,  360,  412,  415,  412,  284,  186,  369,  321,
 /*  1060 */   477,  170,  601,   87,  121,  473,  221,  415,  622,  415,
 /*  1070 */   254,  415,  412,  355,  412,  601,   99,  601,   86,  601,
 /*  1080 */    17,  590,  584,  259,  612,  120,  159,  158,  415,  622,
 /*  1090 */   415,   14,  465,  157,  462,   25,  601,   85,  601,   84,
 /*  1100 */   622,   58,   48,  582,  581,  583,  583,   55,   55,   56,
 /*  1110 */    56,   56,   56,  412,   54,   54,   54,   54,   53,   53,
 /*  1120 */    52,   52,   52,   51,  234,  312,  412,  262,  412,  415,
 /*  1130 */   412,  262,  118,  611,  117,   24,   10,  601,   83,  351,
 /*  1140 */   216,  219,  415,  622,  415,  608,  415,  622,  412,  622,
 /*  1150 */   601,   72,  601,   71,  601,   82,  590,  584,  262,    4,
 /*  1160 */   605,  622,  458,  115,  415,  456,  252,  154,  452,  110,
 /*  1170 */   108,  453,  601,   81,  622,  451,  622,   48,  582,  581,
 /*  1180 */   583,  583,   55,   55,   56,   56,   56,   56,  412,   54,





 /*  1190 */    54,   54,   54,   53,   53,   52,   52,   52,   51,  234,
 /*  1200 */    44,  406,  450,    3,  415,  412,  262,  107,  416,  623,
 /*  1210 */   446,  437,  601,   80,  436,  335,  238,  189,  411,  409,
 /*  1220 */   594,  415,  622,   44,  406,  401,    3,  412,  557,  601,
 /*  1230 */    70,  416,  623,  412,  622,  149,  622,  421,  404,   64,
 /*  1240 */   412,  622,  409,  415,  622,  331,  139,  148,  566,  415,
 /*  1250 */   449,  601,   18,  228,  124,  626,  415,  601,   79,  315,
 /*  1260 */   181,  404,  412,  545,  601,   78,  262,  541,   41,   42,
 /*  1270 */   534,  566,  390,  202,  262,   43,  414,  413,  415,  622,
 /*  1280 */   595,  314,  622,  622,  180,  539,  601,   92,  415,  276,
 /*  1290 */   622,   41,   42,  509,  616,  615,  601,    9,   43,  414,
 /*  1300 */   413,  622,  418,  595,  262,  622,  275,  600,  614,  622,
 /*  1310 */   218,  593,  593,  593,  592,  591,   13,  178,  217,  417,
 /*  1320 */   622,  236,  622,   44,  406,  490,    3,  269,  399,  267,
 /*  1330 */   609,  416,  623,  400,  593,  593,  593,  592,  591,   13,
 /*  1340 */   265,  622,  409,  622,  263,  622,   34,  406,  244,    3,
 /*  1350 */   258,  363,  464,  463,  416,  623,  622,  356,  251,    8,
 /*  1360 */   622,  404,  177,  599,  455,  409,  622,  622,  622,  622,
 /*  1370 */   445,  566,  243,  622,  622,  236,  295,  240,   31,  239,
 /*  1380 */   622,  431,   30,  396,  404,  290,  622,  294,  622,  293,







 /*  1390 */   144,   41,   42,  622,  566,  622,  394,  622,   43,  414,
 /*  1400 */   413,  622,  289,  595,  398,   60,  622,  292,   37,  231,
 /*  1410 */   598,  172,  622,   29,   41,   42,  393,  523,  622,  556,
 /*  1420 */   184,   43,  414,  413,  287,  387,  595,  543,  285,  518,
 /*  1430 */   537,  536,  517,  327,  593,  593,  593,  592,  591,   13,
 /*  1440 */   215,  283,  278,  514,  513,  304,  303,  302,  179,  300,
 /*  1450 */   512,  310,  454,  128,  227,  226,  309,  593,  593,  593,
 /*  1460 */   592,  591,   13,  494,  489,  225,  488,  150,  487,  242,
 /*  1470 */   163,   61,  374,  481,  162,  161,  624,  623,  241,  372,
 /*  1480 */   209,  479,  370,  260,   26,  160,  478,  364,  468,  471,
 /*  1490 */   140,  152,  119,  467,  131,  116,  155,  153,  345,  457,
 /*  1500 */   151,  346,  130,  114,  113,  112,  111,  448,  319,   23,
 /*  1510 */   109,  434,   20,  433,  432,  429,  566,  610,  573,  596,
 /*  1520 */    63,  405,  191,  279,  510,  296,  498,  288,  570,  495,
 /*  1530 */   499,  497,  461,  194,    5,  305,  193,  192,  381,  569,
 /*  1540 */   357,  256,  344,  245,  526,  246,  253,  313,  595,  343,
 /*  1550 */   447,  297,  236,  402,  550,  491,  508,  502,  501,  527,
 /*  1560 */   234,  208,  525,  962,  962,  962,  371,  962,  962,  962,
 /*  1570 */   962,  962,  962,  962,  962,  337,  962,  962,  962,  593,
 /*  1580 */   593,  593,
};
static const YYCODETYPE yy_lookahead[] = {
 /*     0 */    19,  143,  144,  145,  146,   24,    7,    8,   27,   78,
 /*    10 */    79,   80,   81,   82,   83,   84,   85,   86,   87,   88,
 /*    20 */    89,   90,   91,   92,   93,  106,  107,  108,   27,   28,
 /*    30 */    15,   50,   51,   78,   79,   80,   81,   26,   83,   84,
 /*    40 */    85,   86,   87,   88,   89,   90,   91,   92,   93,    1,
 /*    50 */    69,   70,   71,   72,   73,   74,   75,   76,   77,   78,
 /*    60 */    79,   80,   81,   11,   83,   84,   85,   86,   87,   88,
 /*    70 */    89,   90,   91,   92,   93,   19,   95,   89,   90,   91,
 /*    80 */    92,   93,   26,   83,   84,   85,   86,   87,   88,   89,
 /*    90 */    90,   91,   92,   93,   27,   28,   95,   96,   97,   27,
 /*   100 */    28,  100,  101,  102,   22,   19,   50,   51,   27,   28,
 /*   110 */    58,   55,  111,    7,    8,    9,   87,   88,   89,   90,
 /*   120 */    91,   92,   93,   98,   99,   69,   70,   71,   72,   73,
 /*   130 */    74,   75,   76,   77,   78,   79,   80,   81,  127,   83,
 /*   140 */    84,   85,   86,   87,   88,   89,   90,   91,   92,   93,
 /*   150 */    19,  223,  224,  225,   87,   88,  162,   31,  106,  107,
 /*   160 */   108,   35,   95,   96,   33,   98,   23,   95,   96,  117,
 /*   170 */   119,  243,  105,   42,  107,   49,   95,   96,  151,   93,
 /*   180 */    26,   50,   51,   97,   98,   99,  100,  101,  102,  103,
 /*   190 */   196,   22,   23,  121,  167,   26,  110,  130,  131,   67,
 /*   200 */    69,   70,   71,   72,   73,   74,   75,   76,   77,   78,
 /*   210 */    79,   80,   81,  219,   83,   84,   85,   86,   87,   88,
 /*   220 */    89,   90,   91,   92,   93,   19,   12,   95,  234,  119,
 /*   230 */    24,   99,  113,  239,  115,  116,  151,   68,   23,  147,
 /*   240 */   148,   26,  215,   29,  151,  153,  119,  155,  163,  164,
 /*   250 */    23,   23,  167,   26,  162,   23,   50,   51,   26,   45,
 /*   260 */   167,   47,  130,  131,  132,  172,  173,   23,   22,   23,

 /*   270 */    26,  186,   26,  188,  120,   69,   70,   71,   72,   73,
 /*   280 */    74,   75,   76,   77,   78,   79,   80,   81,  196,   83,
 /*   290 */    84,   85,   86,   87,   88,   89,   90,   91,   92,   93,
 /*   300 */    19,  151,  151,   23,  119,   97,   26,   19,  100,  101,
 /*   310 */   102,  219,  151,  162,   68,   22,   28,  167,  167,  111,
 /*   320 */    27,   26,  172,  173,  231,  232,  175,  176,  167,   27,
 /*   330 */    28,   50,   51,   27,   28,  119,  175,  176,  246,   24,
 /*   340 */    22,  113,   27,  115,  116,   27,   28,  196,   22,   23,
 /*   350 */    69,   70,   71,   72,   73,   74,   75,   76,   77,   78,
 /*   360 */    79,   80,   81,  114,   83,   84,   85,   86,   87,   88,
 /*   370 */    89,   90,   91,   92,   93,   19,   21,  151,  217,   22,
 /*   380 */   151,  231,  232,  222,   27,   28,   23,  114,   95,   50,
 /*   390 */    51,  118,  151,  167,   68,   89,  167,   95,   96,  104,
 /*   400 */    23,   95,   96,   26,  175,  176,   50,   51,  167,   22,
 /*   410 */    95,   72,   73,   95,   96,   16,  175,  176,  137,   64,
 /*   420 */    23,  195,   27,  121,   23,   69,   70,   71,   72,   73,
 /*   430 */    74,   75,   76,   77,   78,   79,   80,   81,   99,   83,
 /*   440 */    84,   85,   86,   87,   88,   89,   90,   91,   92,   93,
 /*   450 */    19,   12,   95,   96,   23,  226,  101,   22,  217,   19,
 /*   460 */    61,  151,   63,  222,  151,  106,  107,  108,   29,  159,
 /*   470 */   244,  151,   99,  163,  164,   23,  113,  167,  115,  116,
 /*   480 */   167,   50,   51,  110,   45,   58,   47,  167,  175,  176,
 /*   490 */    95,   51,  168,  137,  139,  175,  176,   58,   11,   22,
 /*   500 */    69,   70,   71,   72,   73,   74,   75,   76,   77,   78,

 /*   510 */    79,   80,   81,   22,   83,   84,   85,   86,   87,   88,
 /*   520 */    89,   90,   91,   92,   93,   19,   23,  151,  117,   23,
 /*   530 */   217,  207,   19,  106,  107,  108,  216,  151,  139,   23,
 /*   540 */   129,   28,   26,  167,  117,  105,   23,  223,  224,  225,
 /*   550 */   110,  175,  176,  167,   77,  165,   50,   51,  168,  169,
 /*   560 */   170,  175,  176,   87,   88,  113,   26,  115,  116,  171,
 /*   570 */   172,  173,    0,    1,    2,   69,   70,   71,   72,   73,
 /*   580 */    74,   75,   76,   77,   78,   79,   80,   81,  162,   83,
 /*   590 */    84,   85,   86,   87,   88,   89,   90,   91,   92,   93,

 /*   600 */    19,  151,   98,  217,   23,   37,  130,  131,   23,   23,
 /*   610 */    26,   26,   96,  163,  164,   23,  113,  167,  115,  116,
 /*   620 */    52,  117,  196,  151,  171,  172,  173,   59,  130,  131,
 /*   630 */   232,   50,   51,  129,  208,  209,   16,  121,  156,  167,
 /*   640 */    22,   23,  162,  223,  224,  225,   51,  175,  176,  121,
 /*   650 */    69,   70,   71,   72,   73,   74,   75,   76,   77,   78,
 /*   660 */    79,   80,   81,  178,   83,   84,   85,   86,   87,   88,
 /*   670 */    89,   90,   91,   92,   93,   19,  196,  109,  151,   23,

 /*   680 */    96,   61,  151,   63,   23,  232,   68,   26,  151,  168,
 /*   690 */   169,  170,   23,   89,  167,   26,  208,  209,  167,  219,
 /*   700 */   105,   36,  175,  176,  167,  121,   50,   51,  223,  224,
 /*   710 */   225,  229,  175,  176,  178,  233,  247,  248,  114,  239,
 /*   720 */   189,   22,  118,   24,  162,   69,   70,   71,   72,   73,
 /*   730 */    74,   75,   76,   77,   78,   79,   80,   81,  151,   83,
 /*   740 */    84,   85,   86,   87,   88,   89,   90,   91,   92,   93,

 /*   750 */    19,  151,   26,  151,  167,   24,  145,  146,  196,  223,
 /*   760 */   224,  225,  175,  176,  151,  182,  183,  167,  151,  167,
 /*   770 */   151,   36,  199,  190,  151,  175,  176,  175,  176,  206,
 /*   780 */   167,   50,   51,  221,  167,  136,  167,  138,  175,  176,
 /*   790 */   167,   26,  175,  176,  175,  176,  168,   36,  175,  176,
 /*   800 */    69,   70,   71,   72,   73,   74,   75,   76,   77,   78,
 /*   810 */    79,   80,   81,  151,   83,   84,   85,   86,   87,   88,
 /*   820 */    89,   90,   91,   92,   93,   19,  151,  151,  151,  167,

 /*   830 */   151,  151,  151,  151,  162,  207,   23,  175,  176,   26,
 /*   840 */   249,  250,  167,  167,  167,  151,  167,  167,  167,  167,
 /*   850 */   175,  176,  175,  176,  175,  176,   50,   51,  151,   53,
 /*   860 */    22,  167,  192,  193,   33,  189,  192,  193,  196,  189,
 /*   870 */   189,  189,  162,   42,  167,   69,   70,   71,   72,   73,
 /*   880 */    74,   75,   76,   77,   78,   79,   80,   81,  151,   83,
 /*   890 */    84,   85,   86,   87,   88,   89,   90,   91,   92,   93,



 /*   900 */    19,  151,  195,  151,  167,  151,  196,  162,  151,  215,
 /*   910 */    92,   93,  175,  176,   28,  174,  119,  167,  151,  167,
 /*   920 */   151,  167,  151,  182,  167,  175,  176,  175,  176,  175,
 /*   930 */   176,   50,   51,   23,  167,   23,  167,   40,  167,   22,
 /*   940 */   167,  196,   53,  168,  175,  176,  175,  176,  175,  162,
 /*   950 */    69,   70,   71,   72,   73,   74,   75,   76,   77,   78,
 /*   960 */    79,   80,   81,  151,   83,   84,   85,   86,   87,   88,
 /*   970 */    89,   90,   91,   92,   93,   19,  151,  151,  151,  167,
 /*   980 */   151,  151,  207,  196,   30,  218,   22,  175,  176,    1,
 /*   990 */     2,   53,  167,  167,  167,  151,  167,  167,  151,  151,
 /*  1000 */   175,  176,  175,  176,  175,  176,   50,   51,  221,   23,
 /*  1010 */    53,  167,   22,   22,  167,  167,  103,  168,   22,  110,
 /*  1020 */    19,  105,  175,  176,   20,   69,   70,   71,   72,   73,
 /*  1030 */    74,   75,   76,   77,   78,   79,   80,   81,  151,   83,
 /*  1040 */    84,   85,   86,   87,   88,   89,   90,   91,   92,   93,



 /*  1050 */    19,  151,  151,  151,  167,  151,  207,   24,   44,  215,
 /*  1060 */    60,   26,  175,  176,   54,   54,  240,  167,  167,  167,
 /*  1070 */   240,  167,  151,  151,  151,  175,  176,  175,  176,  175,
 /*  1080 */   176,   50,   51,  139,  151,   22,  105,  119,  167,  167,
 /*  1090 */   167,    5,    1,   36,   28,   77,  175,  176,  175,  176,
 /*  1100 */   167,   70,   71,   72,   73,   74,   75,   76,   77,   78,
 /*  1110 */    79,   80,   81,  151,   83,   84,   85,   86,   87,   88,
 /*  1120 */    89,   90,   91,   92,   93,   19,  151,  151,  151,  167,
 /*  1130 */   151,  151,  109,  151,  128,   77,   22,  175,  176,   26,
 /*  1140 */   218,  240,  167,  167,  167,  151,  167,  167,  151,  167,
 /*  1150 */   175,  176,  175,  176,  175,  176,   50,   51,  151,   22,
 /*  1160 */   151,  167,   23,  120,  167,    1,   16,  122,   20,  120,
 /*  1170 */   109,  195,  175,  176,  167,  195,  167,   71,   72,   73,
 /*  1180 */    74,   75,   76,   77,   78,   79,   80,   81,  151,   83,
 /*  1190 */    84,   85,   86,   87,   88,   89,   90,   91,   92,   93,
 /*  1200 */    19,   20,  195,   22,  167,  151,  151,  128,   27,   28,
 /*  1210 */   129,   23,  175,  176,   23,   66,  141,   22,  151,   38,
 /*  1220 */   151,  167,  167,   19,   20,  151,   22,  151,  151,  175,





 /*  1230 */   176,   27,   28,  151,  167,   15,  167,    4,   57,   16,
 /*  1240 */   151,  167,   38,  167,  167,    3,  166,  248,   67,  167,
 /*  1250 */   195,  175,  176,  181,  181,  150,  167,  175,  176,  251,
 /*  1260 */     6,   57,  151,  151,  175,  176,  151,  151,   87,   88,
 /*  1270 */    89,   67,  151,  162,  151,   94,   95,   96,  167,  167,
 /*  1280 */    99,  251,  167,  167,  152,  151,  175,  176,  167,  151,
 /*  1290 */   167,   87,   88,  151,  150,  150,  175,  176,   94,   95,
 /*  1300 */    96,  167,  150,   99,  151,  167,  151,  196,   13,  167,
 /*  1310 */   195,  130,  131,  132,  133,  134,  135,  152,  195,  160,
 /*  1320 */   167,  117,  167,   19,   20,  151,   22,  151,  217,  151,
 /*  1330 */   161,   27,   28,  222,  130,  131,  132,  133,  134,  135,
 /*  1340 */   151,  167,   38,  167,  151,  167,   19,   20,  195,   22,
 /*  1350 */   151,  151,  151,  151,   27,   28,  167,  151,  151,   26,
 /*  1360 */   167,   57,   25,  196,  151,   38,  167,  167,  167,  167,
 /*  1370 */   151,   67,  151,  167,  167,  117,  201,  151,  125,  151,
 /*  1380 */   167,  151,  127,  124,   57,  151,  167,  202,  167,  203,
 /*  1390 */   151,   87,   88,  167,   67,  167,  151,  167,   94,   95,
 /*  1400 */    96,  167,  151,   99,  123,  126,  167,  204,  136,  227,
 /*  1410 */   205,  119,  167,  105,   87,   88,  122,  177,  167,  158,
 /*  1420 */   158,   94,   95,   96,  212,  105,   99,  213,  212,  177,
 /*  1430 */   213,  213,  185,   48,  130,  131,  132,  133,  134,  135,




 /*  1440 */     5,  212,  177,  179,  104,   10,   11,   12,   13,   14,
 /*  1450 */   177,  180,   17,   22,  230,   93,  180,  130,  131,  132,
 /*  1460 */   133,  134,  135,  185,  177,  230,  177,   32,  177,   34,
 /*  1470 */   157,   22,   18,  158,  157,  157,   27,   28,   43,  158,
 /*  1480 */   158,  158,   46,  237,  136,  157,  238,  158,  191,  201,
 /*  1490 */    69,   56,  191,   58,  220,   22,  157,   62,   18,  201,
 /*  1500 */    65,  158,  220,  194,  194,  194,  194,  201,  158,  242,
 /*  1510 */   191,   41,  242,  158,  158,   39,   67,  154,  232,  168,
 /*  1520 */   245,  228,  198,  178,  183,  200,  168,  211,  232,  168,
 /*  1530 */   178,  178,  201,  187,  198,  149,   87,   88,  179,  168,
 /*  1540 */   241,  106,  107,  108,   95,  211,  241,  112,   99,  211,
 /*  1550 */   201,  197,  117,  193,  210,  188,  184,  184,  184,  175,
 /*  1560 */    93,  235,  175,  252,  252,  252,  236,  252,  252,  252,
 /*  1570 */   252,  252,  252,  252,  252,  140,  252,  252,  252,  130,
 /*  1580 */   131,  132,
};
#define YY_SHIFT_USE_DFLT (-82)
#define YY_SHIFT_COUNT (419)
#define YY_SHIFT_MIN   (-81)
#define YY_SHIFT_MAX   (1480)
static const short yy_shift_ofst[] = {
 /*     0 */   988, 1204, 1435, 1204, 1304, 1304,   67,   67,    1,  -19,
 /*    10 */  1304, 1304, 1304, 1304,  427,   81,  131,  131,  806, 1181,
 /*    20 */  1304, 1304, 1304, 1304, 1304, 1304, 1304, 1304, 1304, 1304,
 /*    30 */  1304, 1304, 1304, 1304, 1304, 1304, 1304, 1304, 1304, 1304,
 /*    40 */  1304, 1304, 1304, 1304, 1304, 1304, 1304, 1304, 1327, 1304,
 /*    50 */  1304, 1304, 1304, 1304, 1304, 1304, 1304, 1304, 1304, 1304,
 /*    60 */  1304, 1304,   52,   81,   81,  476,  476,  395, 1258,   56,
 /*    70 */   731,  656,  581,  506,  431,  356,  281,  206,  881,  881,
 /*    80 */   881,  881,  881,  881,  881,  881,  881,  881,  881,  881,
 /*    90 */   881,  881,  881,  956,  881, 1031, 1106, 1106,  -69,  -45,
 /*   100 */   -45,  -45,  -45,  -45,    0,   29,  -12,   81,   81,   81,
 /*   110 */    81,   81,   81,   81,   81,   81,   81,   81,   81,   81,
 /*   120 */    81,   81,   81,  355,  440,   81,   81,   81,   81,   81,
 /*   130 */   504,  411,  395,  818, 1467,  -82,  -82,  -82, 1449,   86,
 /*   140 */   439,  439,  306,  357,  302,   72,  318,  246,  169,   81,
 /*   150 */    81,   81,   81,   81,   81,   81,   81,   81,   81,   81,
 /*   160 */    81,   81,   81,   81,   81,   81,   81,   81,   81,   81,
 /*   170 */    81,   81,   81,   81,   81,   81,   81,   81,   81,   81,
 /*   180 */    81,   81,  315,  315,  315,  572, 1258, 1258, 1258,  -82,
 /*   190 */   -82,  -82,  132,  132,  208,  568,  568,  568,  516,  503,
 /*   200 */   214,  452,  363,  228,  119,  119,  119,  119,  359,  126,
 /*   210 */   119,  119,  584,  293,  604,  106,   11,  288,  288,  513,
 /*   220 */    11,  513,  295,  813,  395,  831,  395,  831,  595,  831,
 /*   230 */   288,  649,  498,  498,  395,  154,  273,  699, 1476, 1292,
 /*   240 */  1292, 1470, 1470, 1292, 1473, 1421, 1255, 1480, 1480, 1480,
 /*   250 */  1480, 1292, 1454, 1255, 1473, 1421, 1421, 1255, 1292, 1454,
 /*   260 */  1348, 1436, 1292, 1292, 1454, 1292, 1454, 1292, 1454, 1431,
 /*   270 */  1320, 1320, 1320, 1385, 1362, 1362, 1431, 1320, 1340, 1320,
 /*   280 */  1385, 1320, 1320, 1294, 1308, 1294, 1308, 1294, 1308, 1292,
 /*   290 */  1292, 1272, 1279, 1281, 1253, 1259, 1255, 1258, 1337, 1333,
 /*   300 */  1295, 1295, 1254, 1254, 1254, 1254,  -82,  -82,  -82,  -82,
 /*   310 */   -82,  -82,  339,  399,  618,  326,  620,  -81,  669,  477,
 /*   320 */   661,  585,  377,  280,  244,  232,   25,   -1,  373,  227,
 /*   330 */   215, 1233, 1242, 1195, 1075, 1220, 1149, 1223, 1191, 1188,
 /*   340 */  1081, 1113, 1079, 1061, 1049, 1148, 1045, 1150, 1164, 1043,
 /*   350 */  1139, 1137, 1113, 1114, 1006, 1058, 1018, 1023, 1066, 1057,
 /*   360 */   968, 1091, 1086, 1063,  981,  944, 1011, 1035, 1010, 1000,
 /*   370 */  1014,  916, 1033, 1004, 1001,  909,  913,  996,  957,  991,
 /*   380 */   990,  986,  964,  938,  954,  917,  889,  897,  912,  910,
 /*   390 */   797,  886,  761,  838,  528,  726,  735,  765,  665,  726,
 /*   400 */   592,  586,  540,  523,  491,  487,  435,  401,  397,  387,
 /*   410 */   249,  216,  185,  127,  110,   51,   82,  143,   15,   48,

};
#define YY_REDUCE_USE_DFLT (-143)
#define YY_REDUCE_COUNT (311)
#define YY_REDUCE_MIN   (-142)
#define YY_REDUCE_MAX   (1387)
static const short yy_reduce_ofst[] = {
 /*     0 */  -142, 1111,   92,  151,  241,  161,  150,   93,   85,  324,
 /*    10 */   386,  313,  320,  229,   -6,  310,  536,  485,  -72, 1121,
 /*    20 */  1089, 1082, 1076, 1054, 1037,  997,  979,  977,  975,  962,
 /*    30 */   923,  921,  904,  902,  900,  887,  847,  829,  827,  825,
 /*    40 */   812,  771,  769,  754,  752,  750,  737,  679,  677,  675,
 /*    50 */   662,  623,  619,  617,  613,  602,  600,  587,  537,  527,
 /*    60 */   472,  376,  480,  450,  226,  453,  398,  390,  426,  420,
 /*    70 */   420,  420,  420,  420,  420,  420,  420,  420,  420,  420,
 /*    80 */   420,  420,  420,  420,  420,  420,  420,  420,  420,  420,
 /*    90 */   420,  420,  420,  420,  420,  420,  420,  420,  420,  420,
 /*   100 */   420,  420,  420,  420,  420,  420,  420, 1153,  922, 1123,
 /*   110 */  1115, 1055, 1007,  980,  976,  901,  844,  830,  767,  826,
 /*   120 */   682,  694,  707,  482,  583,  681,  680,  676,  531,   27,
 /*   130 */   787,  562,  521,  420,  420,  420,  420,  420,  773,  741,
 /*   140 */   674,  670, 1067, 1251, 1245, 1239, 1234,  591,  591, 1230,
 /*   150 */  1228, 1226, 1221, 1219, 1213, 1207, 1206, 1202, 1201, 1200,
 /*   160 */  1199, 1193, 1189, 1178, 1176, 1174, 1155, 1142, 1138, 1134,
 /*   170 */  1116, 1112, 1077, 1074, 1069, 1067, 1009,  994,  982,  933,
 /*   180 */   848,  757,  849,  775,  628,  611,  745,  710,  672,  469,
 /*   190 */   488,  573, 1387, 1384, 1367, 1374, 1373, 1372, 1344, 1354,
 /*   200 */  1360, 1354, 1354, 1354, 1354, 1354, 1354, 1354, 1330, 1326,
 /*   210 */  1354, 1354, 1344, 1371, 1336, 1386, 1349, 1338, 1334, 1305,
 /*   220 */  1331, 1299, 1359, 1346, 1361, 1353, 1358, 1352, 1341, 1345,
 /*   230 */  1316, 1293, 1296, 1286, 1351, 1325, 1324, 1363, 1275, 1356,
 /*   240 */  1355, 1270, 1267, 1350, 1282, 1319, 1306, 1312, 1311, 1310,
 /*   250 */  1309, 1343, 1339, 1298, 1274, 1301, 1297, 1288, 1329, 1328,
 /*   260 */  1248, 1246, 1323, 1322, 1318, 1321, 1317, 1315, 1313, 1276,
 /*   270 */  1291, 1289, 1287, 1278, 1235, 1224, 1271, 1273, 1264, 1265,
 /*   280 */  1247, 1252, 1240, 1218, 1229, 1217, 1216, 1214, 1212, 1262,
 /*   290 */  1261, 1182, 1205, 1203, 1186, 1185, 1175, 1167, 1169, 1159,
 /*   300 */  1165, 1132, 1152, 1145, 1144, 1105, 1030, 1008,  999, 1073,
 /*   310 */  1072, 1080,
};
static const YYACTIONTYPE yy_default[] = {
 /*     0 */   636,  872,  960,  960,  872,  872,  960,  960,  960,  762,
 /*    10 */   960,  960,  960,  870,  960,  960,  790,  790,  934,  960,
 /*    20 */   960,  960,  960,  960,  960,  960,  960,  960,  960,  960,
 /*    30 */   960,  960,  960,  960,  960,  960,  960,  960,  960,  960,
 /*    40 */   960,  960,  960,  960,  960,  960,  960,  960,  960,  960,
 /*    50 */   960,  960,  960,  960,  960,  960,  960,  960,  960,  960,
 /*    60 */   960,  960,  960,  960,  960,  960,  960,  677,  766,  796,
 /*    70 */   960,  960,  960,  960,  960,  960,  960,  960,  933,  935,
 /*    80 */   804,  803,  913,  777,  801,  794,  798,  873,  866,  867,
 /*    90 */   865,  869,  874,  960,  797,  833,  850,  832,  844,  849,
 /*   100 */   856,  848,  845,  835,  834,  836,  837,  960,  960,  960,
 /*   110 */   960,  960,  960,  960,  960,  960,  960,  960,  960,  960,
 /*   120 */   960,  960,  960,  662,  731,  960,  960,  960,  960,  960,
 /*   130 */   960,  960,  960,  838,  839,  853,  852,  851,  960,  669,
 /*   140 */   960,  960,  960,  960,  960,  960,  960,  960,  960,  960,
 /*   150 */   940,  938,  960,  885,  960,  960,  960,  960,  960,  960,
 /*   160 */   960,  960,  960,  960,  960,  960,  960,  960,  960,  960,
 /*   170 */   960,  960,  960,  960,  960,  960,  960,  960,  960,  960,
 /*   180 */   960,  642,  762,  762,  762,  636,  960,  960,  960,  952,
 /*   190 */   766,  756,  960,  960,  960,  960,  960,  960,  960,  960,
 /*   200 */   960,  960,  960,  960,  806,  745,  923,  925,  960,  906,
 /*   210 */   743,  664,  764,  679,  754,  644,  800,  779,  779,  918,
 /*   220 */   800,  918,  702,  725,  960,  790,  960,  790,  699,  790,
 /*   230 */   779,  868,  960,  960,  960,  763,  754,  960,  945,  770,
 /*   240 */   770,  937,  937,  770,  812,  735,  800,  742,  742,  742,
 /*   250 */   742,  770,  659,  800,  812,  735,  735,  800,  770,  659,
 /*   260 */   912,  910,  770,  770,  659,  770,  659,  770,  659,  878,
 /*   270 */   733,  733,  733,  717,  882,  882,  878,  733,  702,  733,
 /*   280 */   717,  733,  733,  783,  778,  783,  778,  783,  778,  770,
 /*   290 */   770,  960,  795,  784,  793,  791,  800,  960,  665,  720,
 /*   300 */   652,  652,  641,  641,  641,  641,  957,  957,  952,  704,
 /*   310 */   704,  687,  960,  960,  960,  960,  960,  960,  960,  887,
 /*   320 */   960,  960,  960,  960,  960,  960,  960,  960,  960,  960,
 /*   330 */   960,  960,  637,  947,  960,  960,  944,  960,  960,  960,
 /*   340 */   960,  805,  960,  960,  960,  960,  960,  960,  960,  960,
 /*   350 */   960,  960,  922,  960,  960,  960,  960,  960,  960,  960,
 /*   360 */   916,  960,  960,  960,  960,  960,  960,  909,  908,  960,
 /*   370 */   960,  960,  960,  960,  960,  960,  960,  960,  960,  960,
 /*   380 */   960,  960,  960,  960,  960,  960,  960,  960,  960,  960,
 /*   390 */   960,  960,  960,  960,  960,  792,  960,  785,  960,  871,
 /*   400 */   960,  960,  960,  960,  960,  960,  960,  960,  960,  960,
 /*   410 */   748,  821,  960,  820,  824,  819,  671,  960,  650,  960,
 /*   420 */   633,  638,  956,  959,  958,  955,  954,  953,  948,  946,
 /*   430 */   943,  942,  941,  939,  936,  932,  891,  889,  896,  895,
 /*   440 */   894,  893,  892,  890,  888,  886,  807,  802,  799,  931,
 /*   450 */   884,  744,  741,  740,  658,  949,  915,  924,  811,  810,
 /*   460 */   813,  921,  920,  919,  917,  914,  901,  809,  808,  736,
 /*   470 */   876,  875,  661,  905,  904,  903,  907,  911,  902,  772,
 /*   480 */   660,  657,  668,  723,  724,  732,  730,  729,  728,  727,
 /*   490 */   726,  722,  670,  678,  716,  701,  700,  881,  883,  880,
 /*   500 */   879,  709,  708,  714,  713,  712,  711,  710,  707,  706,
 /*   510 */   705,  698,  697,  703,  696,  719,  718,  715,  695,  739,
 /*   520 */   738,  737,  734,  694,  693,  692,  824,  691,  690,  830,
 /*   530 */   829,  817,  860,  759,  758,  757,  769,  768,  781,  780,
 /*   540 */   815,  814,  782,  767,  761,  760,  776,  775,  774,  773,
 /*   550 */   765,  755,  787,  789,  788,  786,  862,  771,  859,  930,
 /*   560 */   929,  928,  927,  926,  864,  863,  831,  828,  682,  683,
 /*   570 */   899,  898,  900,  897,  685,  684,  681,  680,  861,  750,
 /*   580 */   749,  857,  854,  846,  842,  858,  855,  847,  843,  841,
 /*   590 */   840,  826,  825,  823,  822,  818,  827,  673,  751,  747,
 /*   600 */   746,  816,  753,  752,  689,  688,  686,  667,  666,  663,
 /*   610 */   656,  654,  653,  655,  651,  649,  648,  647,  646,  645,
 /*   620 */   676,  675,  674,  672,  671,  643,  640,  639,  635,  634,
 /*   630 */   632,

};

/* The next table maps tokens into fallback tokens.  If a construct
** like the following:
** 
**      %fallback ID X Y Z.
**







|

|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<
<
<
<
<
>
>
>
>
>
|
|
|
|
|
|
|
|
|
|
|
|
|
<
<
<
<
<
<
<
>
>
>
>
>
>
>
|
|
|
|
|
|
|
|
|
|
|
<
<
<
<
<
<
<
<
<


|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
>
|
|
|
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<
|
>
|
|
|
|
|
|
<
|
|
>
|
|
|
|
<
|
|
|
>
|
|
|
|
<
|
|
>
|
|
|
|
|
|
<
|
>
|
|
<
<
<
|
|
>
>
>
|
|
|
|
|
|
|
|
|
|
<
<
<
|
|
>
>
>
|
|
|
|
|
|
|
|
|
|
|
|
|
<
<
<
<
<
>
>
>
>
>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<
<
<
<
|
>
>
>
>
|
|
|
|
|
|
<
<
<
<
<
<
<
<
<

|
|
|
|

|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
>

|
|
|
|

|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<


|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
>







114870
114871
114872
114873
114874
114875
114876
114877
114878
114879
114880
114881
114882
114883
114884
114885
114886
114887
114888
114889
114890
114891
114892
114893
114894
114895
114896
114897
114898
114899
114900
114901
114902
114903
114904
114905
114906
114907
114908
114909
114910
114911
114912
114913
114914
114915
114916
114917
114918
114919
114920
114921
114922
114923
114924
114925
114926
114927
114928
114929
114930
114931
114932
114933
114934
114935
114936
114937
114938
114939
114940
114941
114942
114943
114944
114945
114946
114947
114948
114949
114950
114951
114952
114953
114954
114955
114956
114957
114958
114959
114960
114961
114962
114963
114964
114965
114966
114967
114968
114969
114970
114971
114972
114973
114974
114975
114976
114977
114978
114979
114980
114981
114982
114983
114984
114985
114986
114987
114988
114989
114990
114991
114992





114993
114994
114995
114996
114997
114998
114999
115000
115001
115002
115003
115004
115005
115006
115007
115008
115009
115010







115011
115012
115013
115014
115015
115016
115017
115018
115019
115020
115021
115022
115023
115024
115025
115026
115027
115028









115029
115030
115031
115032
115033
115034
115035
115036
115037
115038
115039
115040
115041
115042
115043
115044
115045
115046
115047
115048
115049
115050
115051
115052
115053
115054
115055
115056
115057
115058
115059
115060
115061

115062
115063
115064
115065
115066
115067
115068
115069
115070
115071
115072
115073
115074
115075
115076
115077
115078
115079

115080
115081
115082
115083
115084
115085
115086
115087

115088
115089
115090
115091
115092
115093
115094

115095
115096
115097
115098
115099
115100
115101
115102

115103
115104
115105
115106
115107
115108
115109
115110
115111

115112
115113
115114
115115



115116
115117
115118
115119
115120
115121
115122
115123
115124
115125
115126
115127
115128
115129
115130



115131
115132
115133
115134
115135
115136
115137
115138
115139
115140
115141
115142
115143
115144
115145
115146
115147
115148





115149
115150
115151
115152
115153
115154
115155
115156
115157
115158
115159
115160
115161
115162
115163
115164
115165
115166
115167
115168
115169




115170
115171
115172
115173
115174
115175
115176
115177
115178
115179
115180









115181
115182
115183
115184
115185
115186
115187
115188
115189
115190
115191
115192
115193
115194
115195
115196
115197
115198
115199
115200
115201
115202
115203
115204
115205
115206
115207
115208
115209
115210
115211
115212
115213
115214
115215
115216
115217
115218
115219
115220
115221
115222
115223
115224
115225
115226
115227
115228
115229
115230
115231
115232
115233
115234
115235
115236
115237
115238
115239
115240
115241
115242
115243
115244
115245
115246
115247
115248
115249
115250
115251
115252
115253
115254
115255
115256
115257
115258
115259
115260
115261
115262
115263
115264
115265
115266

115267
115268
115269
115270
115271
115272
115273
115274
115275
115276
115277
115278
115279
115280
115281
115282
115283
115284
115285
115286
115287
115288
115289
115290
115291
115292
115293
115294
115295
115296
115297
115298
115299
115300
115301
115302
115303
115304
115305
115306
115307
115308
115309
115310
115311
115312
115313
115314
115315
115316
115317
115318
115319
115320
115321
115322
115323
115324
115325
115326
115327
115328
115329
115330
115331
115332
115333
115334
115335
115336
115337
115338
115339
115340
**                     yy_action.  Used to detect hash collisions.
**  yy_shift_ofst[]    For each state, the offset into yy_action for
**                     shifting terminals.
**  yy_reduce_ofst[]   For each state, the offset into yy_action for
**                     shifting non-terminals after a reduce.
**  yy_default[]       Default action for each state.
*/
#define YY_ACTTAB_COUNT (1497)
static const YYACTIONTYPE yy_action[] = {
 /*     0 */   306,  212,  432,  955,  639,  191,  955,  295,  559,   88,
 /*    10 */    88,   88,   88,   81,   86,   86,   86,   86,   85,   85,
 /*    20 */    84,   84,   84,   83,  330,  185,  184,  183,  635,  635,
 /*    30 */   292,  606,  606,   88,   88,   88,   88,  683,   86,   86,
 /*    40 */    86,   86,   85,   85,   84,   84,   84,   83,  330,   16,
 /*    50 */   436,  597,   89,   90,   80,  600,  599,  601,  601,   87,
 /*    60 */    87,   88,   88,   88,   88,  684,   86,   86,   86,   86,
 /*    70 */    85,   85,   84,   84,   84,   83,  330,  306,  559,   84,
 /*    80 */    84,   84,   83,  330,   65,   86,   86,   86,   86,   85,
 /*    90 */    85,   84,   84,   84,   83,  330,  635,  635,  634,  633,
 /*   100 */   182,  682,  550,  379,  376,  375,   17,  322,  606,  606,
 /*   110 */   371,  198,  479,   91,  374,   82,   79,  165,   85,   85,
 /*   120 */    84,   84,   84,   83,  330,  598,  635,  635,  107,   89,
 /*   130 */    90,   80,  600,  599,  601,  601,   87,   87,   88,   88,
 /*   140 */    88,   88,  186,   86,   86,   86,   86,   85,   85,   84,
 /*   150 */    84,   84,   83,  330,  306,  594,  594,  142,  328,  327,
 /*   160 */   484,  249,  344,  238,  635,  635,  634,  633,  585,  448,
 /*   170 */   526,  525,  229,  388,    1,  394,  450,  584,  449,  635,
 /*   180 */   635,  635,  635,  319,  395,  606,  606,  199,  157,  273,
 /*   190 */   382,  268,  381,  187,  635,  635,  634,  633,  311,  555,
 /*   200 */   266,  593,  593,  266,  347,  588,   89,   90,   80,  600,
 /*   210 */   599,  601,  601,   87,   87,   88,   88,   88,   88,  478,
 /*   220 */    86,   86,   86,   86,   85,   85,   84,   84,   84,   83,
 /*   230 */   330,  306,  272,  536,  634,  633,  146,  610,  197,  310,
 /*   240 */   575,  182,  482,  271,  379,  376,  375,  506,   21,  634,
 /*   250 */   633,  634,  633,  635,  635,  374,  611,  574,  548,  440,
 /*   260 */   111,  563,  606,  606,  634,  633,  324,  479,  608,  608,
 /*   270 */   608,  300,  435,  573,  119,  407,  210,  162,  562,  883,
 /*   280 */   592,  592,  306,   89,   90,   80,  600,  599,  601,  601,
 /*   290 */    87,   87,   88,   88,   88,   88,  506,   86,   86,   86,
 /*   300 */    86,   85,   85,   84,   84,   84,   83,  330,  620,  111,
 /*   310 */   635,  635,  361,  606,  606,  358,  249,  349,  248,  433,
 /*   320 */   243,  479,  586,  634,  633,  195,  611,   93,  119,  221,
 /*   330 */   575,  497,  534,  534,   89,   90,   80,  600,  599,  601,
 /*   340 */   601,   87,   87,   88,   88,   88,   88,  574,   86,   86,
 /*   350 */    86,   86,   85,   85,   84,   84,   84,   83,  330,  306,
 /*   360 */    77,  429,  638,  573,  589,  530,  240,  230,  242,  105,
 /*   370 */   249,  349,  248,  515,  588,  208,  460,  529,  564,  173,
 /*   380 */   634,  633,  970,  144,  430,    2,  424,  228,  380,  557,
 /*   390 */   606,  606,  190,  153,  159,  158,  514,   51,  632,  631,
 /*   400 */   630,   71,  536,  432,  954,  196,  610,  954,  614,   45,
 /*   410 */    18,   89,   90,   80,  600,  599,  601,  601,   87,   87,
 /*   420 */    88,   88,   88,   88,  261,   86,   86,   86,   86,   85,
 /*   430 */    85,   84,   84,   84,   83,  330,  306,  608,  608,  608,
 /*   440 */   542,  424,  402,  385,  241,  506,  451,  320,  211,  543,
 /*   450 */   164,  436,  386,  293,  451,  587,  108,  496,  111,  334,
 /*   460 */   391,  591,  424,  614,   27,  452,  453,  606,  606,   72,
 /*   470 */   257,   70,  259,  452,  339,  342,  564,  582,   68,  415,
 /*   480 */   469,  328,  327,   62,  614,   45,  110,  393,   89,   90,
 /*   490 */    80,  600,  599,  601,  601,   87,   87,   88,   88,   88,
 /*   500 */    88,  152,   86,   86,   86,   86,   85,   85,   84,   84,
 /*   510 */    84,   83,  330,  306,  110,  499,  520,  538,  402,  389,
 /*   520 */   424,  110,  566,  500,  593,  593,  454,   82,   79,  165,
 /*   530 */   424,  591,  384,  564,  340,  615,  188,  162,  424,  350,
 /*   540 */   616,  424,  614,   44,  606,  606,  445,  582,  300,  434,
 /*   550 */   151,   19,  614,    9,  568,  580,  348,  615,  469,  567,
 /*   560 */   614,   26,  616,  614,   45,   89,   90,   80,  600,  599,
 /*   570 */   601,  601,   87,   87,   88,   88,   88,   88,  411,   86,
 /*   580 */    86,   86,   86,   85,   85,   84,   84,   84,   83,  330,
 /*   590 */   306,  579,  110,  578,  521,  282,  433,  398,  400,  255,
 /*   600 */   486,   82,   79,  165,  487,  164,   82,   79,  165,  488,
 /*   610 */   488,  364,  387,  424,  544,  544,  509,  350,  362,  155,
 /*   620 */   191,  606,  606,  559,  642,  640,  333,   82,   79,  165,
 /*   630 */   305,  564,  507,  312,  357,  614,   45,  329,  596,  595,
 /*   640 */   194,  337,   89,   90,   80,  600,  599,  601,  601,   87,
 /*   650 */    87,   88,   88,   88,   88,  424,   86,   86,   86,   86,
 /*   660 */    85,   85,   84,   84,   84,   83,  330,  306,   20,  323,
 /*   670 */   150,  263,  211,  543,  421,  596,  595,  614,   22,  424,
 /*   680 */   193,  424,  284,  424,  391,  424,  509,  424,  577,  424,
 /*   690 */   186,  335,  424,  559,  424,  313,  120,  546,  606,  606,
 /*   700 */    67,  614,   47,  614,   50,  614,   48,  614,  100,  614,
 /*   710 */    99,  614,  101,  576,  614,  102,  614,  109,  326,   89,
 /*   720 */    90,   80,  600,  599,  601,  601,   87,   87,   88,   88,
 /*   730 */    88,   88,  424,   86,   86,   86,   86,   85,   85,   84,
 /*   740 */    84,   84,   83,  330,  306,  424,  311,  424,  585,   54,
 /*   750 */   424,  516,  517,  590,  614,  112,  424,  584,  424,  572,
 /*   760 */   424,  195,  424,  571,  424,   67,  424,  614,   94,  614,
 /*   770 */    98,  424,  614,   97,  264,  606,  606,  195,  614,   46,
 /*   780 */   614,   96,  614,   30,  614,   49,  614,  115,  614,  114,
 /*   790 */   418,  229,  388,  614,  113,  306,   89,   90,   80,  600,
 /*   800 */   599,  601,  601,   87,   87,   88,   88,   88,   88,  424,
 /*   810 */    86,   86,   86,   86,   85,   85,   84,   84,   84,   83,
 /*   820 */   330,  119,  424,  590,  110,  372,  606,  606,  195,   53,
 /*   830 */   250,  614,   29,  195,  472,  438,  729,  190,  302,  498,
 /*   840 */    14,  523,  641,    2,  614,   43,  306,   89,   90,   80,
 /*   850 */   600,  599,  601,  601,   87,   87,   88,   88,   88,   88,
 /*   860 */   424,   86,   86,   86,   86,   85,   85,   84,   84,   84,
 /*   870 */    83,  330,  424,  613,  964,  964,  354,  606,  606,  420,
 /*   880 */   312,   64,  614,   42,  391,  355,  283,  437,  301,  255,
 /*   890 */   414,  410,  495,  492,  614,   28,  471,  306,   89,   90,
 /*   900 */    80,  600,  599,  601,  601,   87,   87,   88,   88,   88,
 /*   910 */    88,  424,   86,   86,   86,   86,   85,   85,   84,   84,
 /*   920 */    84,   83,  330,  424,  110,  110,  110,  110,  606,  606,
 /*   930 */   110,  254,   13,  614,   41,  532,  531,  283,  481,  531,
 /*   940 */   457,  284,  119,  561,  356,  614,   40,  284,  306,   89,
 /*   950 */    78,   80,  600,  599,  601,  601,   87,   87,   88,   88,
 /*   960 */    88,   88,  424,   86,   86,   86,   86,   85,   85,   84,
 /*   970 */    84,   84,   83,  330,  110,  424,  341,  220,  555,  606,
 /*   980 */   606,  351,  555,  318,  614,   95,  413,  255,   83,  330,
 /*   990 */   284,  284,  255,  640,  333,  356,  255,  614,   39,  306,
 /*  1000 */   356,   90,   80,  600,  599,  601,  601,   87,   87,   88,
 /*  1010 */    88,   88,   88,  424,   86,   86,   86,   86,   85,   85,
 /*  1020 */    84,   84,   84,   83,  330,  424,  317,  316,  141,  465,
 /*  1030 */   606,  606,  219,  619,  463,  614,   10,  417,  462,  255,
 /*  1040 */   189,  510,  553,  351,  207,  363,  161,  614,   38,  315,
 /*  1050 */   218,  255,  255,   80,  600,  599,  601,  601,   87,   87,
 /*  1060 */    88,   88,   88,   88,  424,   86,   86,   86,   86,   85,
 /*  1070 */    85,   84,   84,   84,   83,  330,   76,  419,  255,    3,
 /*  1080 */   878,  461,  424,  247,  331,  331,  614,   37,  217,   76,
 /*  1090 */   419,  390,    3,  216,  215,  422,    4,  331,  331,  424,
 /*  1100 */   547,   12,  424,  545,  614,   36,  424,  541,  422,  424,
 /*  1110 */   540,  424,  214,  424,  408,  424,  539,  403,  605,  605,
 /*  1120 */   237,  614,   25,  119,  614,   24,  588,  408,  614,   45,
 /*  1130 */   118,  614,   35,  614,   34,  614,   33,  614,   23,  588,





 /*  1140 */    60,  223,  603,  602,  513,  378,   73,   74,  140,  139,
 /*  1150 */   424,  110,  265,   75,  426,  425,   59,  424,  610,   73,
 /*  1160 */    74,  549,  402,  404,  424,  373,   75,  426,  425,  604,
 /*  1170 */   138,  610,  614,   11,  392,   76,  419,  181,    3,  614,
 /*  1180 */    32,  271,  369,  331,  331,  493,  614,   31,  149,  608,
 /*  1190 */   608,  608,  607,   15,  422,  365,  614,    8,  137,  489,
 /*  1200 */   136,  190,  608,  608,  608,  607,   15,  485,  176,  135,
 /*  1210 */     7,  252,  477,  408,  174,  133,  175,  474,   57,   56,
 /*  1220 */   132,  130,  119,   76,  419,  588,    3,  468,  245,  464,
 /*  1230 */   171,  331,  331,  125,  123,  456,  447,  122,  446,  104,
 /*  1240 */   336,  231,  422,  166,  154,   73,   74,  332,  116,  431,
 /*  1250 */   121,  309,   75,  426,  425,  222,  106,  610,  308,  637,
 /*  1260 */   204,  408,  629,  627,  628,    6,  200,  428,  427,  290,
 /*  1270 */   203,  622,  201,  588,   62,   63,  289,   66,  419,  399,
 /*  1280 */     3,  401,  288,   92,  143,  331,  331,  287,  608,  608,
 /*  1290 */   608,  607,   15,   73,   74,  227,  422,  325,   69,  416,
 /*  1300 */    75,  426,  425,  612,  412,  610,  192,   61,  569,  209,
 /*  1310 */   396,  226,  278,  225,  383,  408,  527,  558,  276,  533,







 /*  1320 */   552,  528,  321,  523,  370,  508,  180,  588,  494,  179,
 /*  1330 */   366,  117,  253,  269,  522,  503,  608,  608,  608,  607,
 /*  1340 */    15,  551,  502,   58,  274,  524,  178,   73,   74,  304,
 /*  1350 */   501,  368,  303,  206,   75,  426,  425,  491,  360,  610,
 /*  1360 */   213,  177,  483,  131,  345,  298,  297,  296,  202,  294,
 /*  1370 */   480,  490,  466,  134,  172,  129,  444,  346,  470,  128,
 /*  1380 */   314,  459,  103,  127,  126,  148,  124,  167,  443,  235,
 /*  1390 */   608,  608,  608,  607,   15,  442,  439,  623,  234,  299,
 /*  1400 */   145,  583,  291,  377,  581,  160,  119,  156,  270,  636,
 /*  1410 */   971,  169,  279,  626,  520,  625,  473,  624,  170,  621,
 /*  1420 */   618,  119,  168,   55,  409,  423,  537,  609,  286,  285,
 /*  1430 */   405,  570,  560,  556,    5,   52,  458,  554,  147,  267,
 /*  1440 */   519,  504,  518,  406,  262,  239,  260,  512,  343,  511,
 /*  1450 */   258,  353,  565,  256,  224,  251,  359,  277,  275,  476,
 /*  1460 */   475,  246,  352,  244,  467,  455,  236,  233,  232,  307,
 /*  1470 */   441,  281,  205,  163,  397,  280,  535,  505,  330,  617,
 /*  1480 */   971,  971,  971,  971,  367,  971,  971,  971,  971,  971,
 /*  1490 */   971,  971,  971,  971,  971,  971,  338,









};
static const YYCODETYPE yy_lookahead[] = {
 /*     0 */    19,   22,   22,   23,    1,   24,   26,   15,   27,   80,
 /*    10 */    81,   82,   83,   84,   85,   86,   87,   88,   89,   90,
 /*    20 */    91,   92,   93,   94,   95,  108,  109,  110,   27,   28,
 /*    30 */    23,   50,   51,   80,   81,   82,   83,  122,   85,   86,
 /*    40 */    87,   88,   89,   90,   91,   92,   93,   94,   95,   22,
 /*    50 */    70,   23,   71,   72,   73,   74,   75,   76,   77,   78,
 /*    60 */    79,   80,   81,   82,   83,  122,   85,   86,   87,   88,
 /*    70 */    89,   90,   91,   92,   93,   94,   95,   19,   97,   91,
 /*    80 */    92,   93,   94,   95,   26,   85,   86,   87,   88,   89,
 /*    90 */    90,   91,   92,   93,   94,   95,   27,   28,   97,   98,
 /*   100 */    99,  122,  211,  102,  103,  104,   79,   19,   50,   51,
 /*   110 */    19,  122,   59,   55,  113,  224,  225,  226,   89,   90,
 /*   120 */    91,   92,   93,   94,   95,   23,   27,   28,   26,   71,
 /*   130 */    72,   73,   74,   75,   76,   77,   78,   79,   80,   81,
 /*   140 */    82,   83,   51,   85,   86,   87,   88,   89,   90,   91,
 /*   150 */    92,   93,   94,   95,   19,  132,  133,   58,   89,   90,
 /*   160 */    21,  108,  109,  110,   27,   28,   97,   98,   33,  100,
 /*   170 */     7,    8,  119,  120,   22,   19,  107,   42,  109,   27,
 /*   180 */    28,   27,   28,   95,   28,   50,   51,   99,  100,  101,
 /*   190 */   102,  103,  104,  105,   27,   28,   97,   98,  107,  152,
 /*   200 */   112,  132,  133,  112,   65,   69,   71,   72,   73,   74,
 /*   210 */    75,   76,   77,   78,   79,   80,   81,   82,   83,   11,
 /*   220 */    85,   86,   87,   88,   89,   90,   91,   92,   93,   94,
 /*   230 */    95,   19,  101,   97,   97,   98,   24,  101,  122,  157,
 /*   240 */    12,   99,  103,  112,  102,  103,  104,  152,   22,   97,
 /*   250 */    98,   97,   98,   27,   28,  113,   27,   29,   91,  164,
 /*   260 */   165,  124,   50,   51,   97,   98,  219,   59,  132,  133,
 /*   270 */   134,   22,   23,   45,   66,   47,  212,  213,  124,  140,
 /*   280 */   132,  133,   19,   71,   72,   73,   74,   75,   76,   77,
 /*   290 */    78,   79,   80,   81,   82,   83,  152,   85,   86,   87,
 /*   300 */    88,   89,   90,   91,   92,   93,   94,   95,  164,  165,

 /*   310 */    27,   28,  230,   50,   51,  233,  108,  109,  110,   70,
 /*   320 */    16,   59,   23,   97,   98,   26,   97,   22,   66,  185,
 /*   330 */    12,  187,   27,   28,   71,   72,   73,   74,   75,   76,
 /*   340 */    77,   78,   79,   80,   81,   82,   83,   29,   85,   86,
 /*   350 */    87,   88,   89,   90,   91,   92,   93,   94,   95,   19,
 /*   360 */    22,  148,  149,   45,   23,   47,   62,  154,   64,  156,
 /*   370 */   108,  109,  110,   37,   69,   23,  163,   59,   26,   26,
 /*   380 */    97,   98,  144,  145,  146,  147,  152,  200,   52,   23,
 /*   390 */    50,   51,   26,   22,   89,   90,   60,  210,    7,    8,
 /*   400 */     9,  138,   97,   22,   23,   26,  101,   26,  174,  175,
 /*   410 */   197,   71,   72,   73,   74,   75,   76,   77,   78,   79,
 /*   420 */    80,   81,   82,   83,   16,   85,   86,   87,   88,   89,
 /*   430 */    90,   91,   92,   93,   94,   95,   19,  132,  133,  134,
 /*   440 */    23,  152,  208,  209,  140,  152,  152,  111,  195,  196,
 /*   450 */    98,   70,  163,  160,  152,   23,   22,  164,  165,  246,
 /*   460 */   207,   27,  152,  174,  175,  171,  172,   50,   51,  137,
 /*   470 */    62,  139,   64,  171,  172,  222,  124,   27,  138,   24,
 /*   480 */   163,   89,   90,  130,  174,  175,  197,  163,   71,   72,

 /*   490 */    73,   74,   75,   76,   77,   78,   79,   80,   81,   82,
 /*   500 */    83,   22,   85,   86,   87,   88,   89,   90,   91,   92,
 /*   510 */    93,   94,   95,   19,  197,  181,  182,   23,  208,  209,
 /*   520 */   152,  197,   26,  189,  132,  133,  232,  224,  225,  226,
 /*   530 */   152,   97,   91,   26,  232,  116,  212,  213,  152,  222,
 /*   540 */   121,  152,  174,  175,   50,   51,  243,   97,   22,   23,
 /*   550 */    22,  234,  174,  175,  177,   23,  239,  116,  163,  177,
 /*   560 */   174,  175,  121,  174,  175,   71,   72,   73,   74,   75,

 /*   570 */    76,   77,   78,   79,   80,   81,   82,   83,   24,   85,
 /*   580 */    86,   87,   88,   89,   90,   91,   92,   93,   94,   95,
 /*   590 */    19,   23,  197,   11,   23,  227,   70,  208,  220,  152,
 /*   600 */    31,  224,  225,  226,   35,   98,  224,  225,  226,  108,
 /*   610 */   109,  110,  115,  152,  117,  118,   27,  222,   49,  123,
 /*   620 */    24,   50,   51,   27,    0,    1,    2,  224,  225,  226,
 /*   630 */   166,  124,  168,  169,  239,  174,  175,  170,  171,  172,

 /*   640 */    22,  194,   71,   72,   73,   74,   75,   76,   77,   78,
 /*   650 */    79,   80,   81,   82,   83,  152,   85,   86,   87,   88,
 /*   660 */    89,   90,   91,   92,   93,   94,   95,   19,   22,  208,
 /*   670 */    24,   23,  195,  196,  170,  171,  172,  174,  175,  152,
 /*   680 */    26,  152,  152,  152,  207,  152,   97,  152,   23,  152,
 /*   690 */    51,  244,  152,   97,  152,  247,  248,   23,   50,   51,
 /*   700 */    26,  174,  175,  174,  175,  174,  175,  174,  175,  174,
 /*   710 */   175,  174,  175,   23,  174,  175,  174,  175,  188,   71,

 /*   720 */    72,   73,   74,   75,   76,   77,   78,   79,   80,   81,
 /*   730 */    82,   83,  152,   85,   86,   87,   88,   89,   90,   91,
 /*   740 */    92,   93,   94,   95,   19,  152,  107,  152,   33,   24,
 /*   750 */   152,  100,  101,   27,  174,  175,  152,   42,  152,   23,
 /*   760 */   152,   26,  152,   23,  152,   26,  152,  174,  175,  174,
 /*   770 */   175,  152,  174,  175,   23,   50,   51,   26,  174,  175,
 /*   780 */   174,  175,  174,  175,  174,  175,  174,  175,  174,  175,
 /*   790 */   163,  119,  120,  174,  175,   19,   71,   72,   73,   74,
 /*   800 */    75,   76,   77,   78,   79,   80,   81,   82,   83,  152,

 /*   810 */    85,   86,   87,   88,   89,   90,   91,   92,   93,   94,
 /*   820 */    95,   66,  152,   97,  197,   23,   50,   51,   26,   53,
 /*   830 */    23,  174,  175,   26,   23,   23,   23,   26,   26,   26,
 /*   840 */    36,  106,  146,  147,  174,  175,   19,   71,   72,   73,



 /*   850 */    74,   75,   76,   77,   78,   79,   80,   81,   82,   83,
 /*   860 */   152,   85,   86,   87,   88,   89,   90,   91,   92,   93,
 /*   870 */    94,   95,  152,  196,  119,  120,   19,   50,   51,  168,
 /*   880 */   169,   26,  174,  175,  207,   28,  152,  249,  250,  152,
 /*   890 */   163,  163,  163,  163,  174,  175,  163,   19,   71,   72,
 /*   900 */    73,   74,   75,   76,   77,   78,   79,   80,   81,   82,
 /*   910 */    83,  152,   85,   86,   87,   88,   89,   90,   91,   92,
 /*   920 */    93,   94,   95,  152,  197,  197,  197,  197,   50,   51,
 /*   930 */   197,  194,   36,  174,  175,  191,  192,  152,  191,  192,
 /*   940 */   163,  152,   66,  124,  152,  174,  175,  152,   19,   71,
 /*   950 */    72,   73,   74,   75,   76,   77,   78,   79,   80,   81,
 /*   960 */    82,   83,  152,   85,   86,   87,   88,   89,   90,   91,
 /*   970 */    92,   93,   94,   95,  197,  152,  100,  188,  152,   50,
 /*   980 */    51,  152,  152,  188,  174,  175,  252,  152,   94,   95,
 /*   990 */   152,  152,  152,    1,    2,  152,  152,  174,  175,   19,



 /*  1000 */   152,   72,   73,   74,   75,   76,   77,   78,   79,   80,
 /*  1010 */    81,   82,   83,  152,   85,   86,   87,   88,   89,   90,
 /*  1020 */    91,   92,   93,   94,   95,  152,  188,  188,   22,  194,
 /*  1030 */    50,   51,  240,  173,  194,  174,  175,  252,  194,  152,
 /*  1040 */    36,  181,   28,  152,   23,  219,  122,  174,  175,  219,
 /*  1050 */   221,  152,  152,   73,   74,   75,   76,   77,   78,   79,
 /*  1060 */    80,   81,   82,   83,  152,   85,   86,   87,   88,   89,
 /*  1070 */    90,   91,   92,   93,   94,   95,   19,   20,  152,   22,
 /*  1080 */    23,  194,  152,  240,   27,   28,  174,  175,  240,   19,
 /*  1090 */    20,   26,   22,  194,  194,   38,   22,   27,   28,  152,
 /*  1100 */    23,   22,  152,  116,  174,  175,  152,   23,   38,  152,
 /*  1110 */    23,  152,  221,  152,   57,  152,   23,  163,   50,   51,
 /*  1120 */   194,  174,  175,   66,  174,  175,   69,   57,  174,  175,
 /*  1130 */    40,  174,  175,  174,  175,  174,  175,  174,  175,   69,
 /*  1140 */    22,   53,   74,   75,   30,   53,   89,   90,   22,   22,
 /*  1150 */   152,  197,   23,   96,   97,   98,   22,  152,  101,   89,
 /*  1160 */    90,   91,  208,  209,  152,   53,   96,   97,   98,  101,
 /*  1170 */    22,  101,  174,  175,  152,   19,   20,  105,   22,  174,





 /*  1180 */   175,  112,   19,   27,   28,   20,  174,  175,   24,  132,
 /*  1190 */   133,  134,  135,  136,   38,   44,  174,  175,  107,   61,
 /*  1200 */    54,   26,  132,  133,  134,  135,  136,   54,  107,   22,
 /*  1210 */     5,  140,    1,   57,   36,  111,  122,   28,   79,   79,
 /*  1220 */   131,  123,   66,   19,   20,   69,   22,    1,   16,   20,
 /*  1230 */   125,   27,   28,  123,  111,  120,   23,  131,   23,   16,
 /*  1240 */    68,  142,   38,   15,   22,   89,   90,    3,  167,    4,
 /*  1250 */   248,  251,   96,   97,   98,  180,  180,  101,  251,  151,
 /*  1260 */     6,   57,  151,   13,  151,   26,   25,  151,  161,  202,
 /*  1270 */   153,  162,  153,   69,  130,  128,  203,   19,   20,  127,
 /*  1280 */    22,  126,  204,  129,   22,   27,   28,  205,  132,  133,
 /*  1290 */   134,  135,  136,   89,   90,  231,   38,   95,  137,  179,
 /*  1300 */    96,   97,   98,  206,  179,  101,  122,  107,  159,  159,
 /*  1310 */   125,  231,  216,  228,  107,   57,  184,  217,  216,  176,
 /*  1320 */   217,  176,   48,  106,   18,  184,  158,   69,  159,  158,
 /*  1330 */    46,   71,  237,  176,  176,  176,  132,  133,  134,  135,
 /*  1340 */   136,  217,  176,  137,  216,  178,  158,   89,   90,  179,
 /*  1350 */   176,  159,  179,  159,   96,   97,   98,  159,  159,  101,
 /*  1360 */     5,  158,  202,   22,   18,   10,   11,   12,   13,   14,
 /*  1370 */   190,  238,   17,  190,  158,  193,   41,  159,  202,  193,
 /*  1380 */   159,  202,  245,  193,  193,  223,  190,   32,  159,   34,




 /*  1390 */   132,  133,  134,  135,  136,  159,   39,  155,   43,  150,
 /*  1400 */   223,  177,  201,  178,  177,  186,   66,  199,  177,  152,
 /*  1410 */   253,   56,  215,  152,  182,  152,  202,  152,   63,  152,
 /*  1420 */   152,   66,   67,  242,  229,  152,  174,  152,  152,  152,
 /*  1430 */   152,  152,  152,  152,  199,  242,  202,  152,  198,  152,
 /*  1440 */   152,  152,  183,  192,  152,  215,  152,  183,  215,  183,
 /*  1450 */   152,  241,  214,  152,  211,  152,  152,  211,  211,  152,
 /*  1460 */   152,  241,  152,  152,  152,  152,  152,  152,  152,  114,
 /*  1470 */   152,  152,  235,  152,  152,  152,  174,  187,   95,  174,
 /*  1480 */   253,  253,  253,  253,  236,  253,  253,  253,  253,  253,
 /*  1490 */   253,  253,  253,  253,  253,  253,  141,









};
#define YY_SHIFT_USE_DFLT (-86)
#define YY_SHIFT_COUNT (429)
#define YY_SHIFT_MIN   (-85)
#define YY_SHIFT_MAX   (1383)
static const short yy_shift_ofst[] = {
 /*     0 */   992, 1057, 1355, 1156, 1204, 1204,    1,  262,  -19,  135,
 /*    10 */   135,  776, 1204, 1204, 1204, 1204,   69,   69,   53,  208,
 /*    20 */   283,  755,   58,  725,  648,  571,  494,  417,  340,  263,
 /*    30 */   212,  827,  827,  827,  827,  827,  827,  827,  827,  827,
 /*    40 */   827,  827,  827,  827,  827,  827,  878,  827,  929,  980,
 /*    50 */   980, 1070, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204,
 /*    60 */  1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204,
 /*    70 */  1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204,
 /*    80 */  1258, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204,
 /*    90 */  1204, 1204, 1204, 1204,  -71,  -47,  -47,  -47,  -47,  -47,
 /*   100 */     0,   29,  -12,  283,  283,  139,   91,  392,  392,  894,
 /*   110 */   672,  726, 1383,  -86,  -86,  -86,   88,  318,  318,   99,
 /*   120 */   381,  -20,  283,  283,  283,  283,  283,  283,  283,  283,
 /*   130 */   283,  283,  283,  283,  283,  283,  283,  283,  283,  283,
 /*   140 */   283,  283,  283,  283,  624,  876,  726,  672, 1340, 1340,
 /*   150 */  1340, 1340, 1340, 1340,  -86,  -86,  -86,  305,  136,  136,
 /*   160 */   142,  167,  226,  154,  137,  152,  283,  283,  283,  283,
 /*   170 */   283,  283,  283,  283,  283,  283,  283,  283,  283,  283,
 /*   180 */   283,  283,  283,  336,  336,  336,  283,  283,  352,  283,
 /*   190 */   283,  283,  283,  283,  228,  283,  283,  283,  283,  283,
 /*   200 */   283,  283,  283,  283,  283,  501,  569,  596,  596,  596,
 /*   210 */   507,  497,  441,  391,  353,  156,  156,  857,  353,  857,
 /*   220 */   735,  813,  639,  715,  156,  332,  715,  715,  496,  419,
 /*   230 */   646, 1357, 1184, 1184, 1335, 1335, 1184, 1341, 1260, 1144,
 /*   240 */  1346, 1346, 1346, 1346, 1184, 1306, 1144, 1341, 1260, 1260,
 /*   250 */  1144, 1184, 1306, 1206, 1284, 1184, 1184, 1306, 1184, 1306,
 /*   260 */  1184, 1306, 1262, 1207, 1207, 1207, 1274, 1262, 1207, 1217,
 /*   270 */  1207, 1274, 1207, 1207, 1185, 1200, 1185, 1200, 1185, 1200,
 /*   280 */  1184, 1184, 1161, 1262, 1202, 1202, 1262, 1154, 1155, 1147,
 /*   290 */  1152, 1144, 1241, 1239, 1250, 1250, 1254, 1254, 1254, 1254,
 /*   300 */   -86,  -86,  -86,  -86,  -86,  -86, 1068,  304,  526,  249,
 /*   310 */   408,  -83,  434,  812,   27,  811,  807,  802,  751,  589,
 /*   320 */   651,  163,  131,  674,  366,  450,  299,  148,   23,  102,
 /*   330 */   229,  -21, 1245, 1244, 1222, 1099, 1228, 1172, 1223, 1215,
 /*   340 */  1213, 1115, 1106, 1123, 1110, 1209, 1105, 1212, 1226, 1098,
 /*   350 */  1089, 1140, 1139, 1104, 1189, 1178, 1094, 1211, 1205, 1187,
 /*   360 */  1101, 1071, 1153, 1175, 1146, 1138, 1151, 1091, 1164, 1165,
 /*   370 */  1163, 1069, 1072, 1148, 1112, 1134, 1127, 1129, 1126, 1092,
 /*   380 */  1114, 1118, 1088, 1090, 1093, 1087, 1084,  987, 1079, 1077,
 /*   390 */  1074, 1065,  924, 1021, 1014, 1004, 1006,  819,  739,  896,
 /*   400 */   855,  804,  739,  740,  736,  690,  654,  665,  618,  582,
 /*   410 */   568,  528,  554,  379,  532,  479,  455,  379,  432,  371,
 /*   420 */   341,   28,  338,  116,  -11,  -57,  -85,    7,   -8,    3,
};
#define YY_REDUCE_USE_DFLT (-110)
#define YY_REDUCE_COUNT (305)
#define YY_REDUCE_MIN   (-109)
#define YY_REDUCE_MAX   (1323)
static const short yy_reduce_ofst[] = {
 /*     0 */   238,  954,  213,  289,  310,  234,  144,  317, -109,  382,
 /*    10 */   377,  303,  461,  389,  378,  368,  302,  294,  253,  395,
 /*    20 */   293,  324,  403,  403,  403,  403,  403,  403,  403,  403,
 /*    30 */   403,  403,  403,  403,  403,  403,  403,  403,  403,  403,
 /*    40 */   403,  403,  403,  403,  403,  403,  403,  403,  403,  403,
 /*    50 */   403, 1022, 1012, 1005,  998,  963,  961,  959,  957,  950,
 /*    60 */   947,  930,  912,  873,  861,  823,  810,  771,  759,  720,
 /*    70 */   708,  670,  657,  619,  614,  612,  610,  608,  606,  604,
 /*    80 */   598,  595,  593,  580,  542,  540,  537,  535,  533,  531,
 /*    90 */   529,  527,  503,  386,  403,  403,  403,  403,  403,  403,
 /*   100 */   403,  403,  403,   95,  447,   82,  334,  504,  467,  403,
 /*   110 */   477,  464,  403,  403,  403,  403,  860,  747,  744,  785,
 /*   120 */   638,  638,  926,  891,  900,  899,  887,  844,  840,  835,
 /*   130 */   848,  830,  843,  829,  792,  839,  826,  737,  838,  795,
 /*   140 */   789,   47,  734,  530,  696,  777,  711,  677,  733,  730,
 /*   150 */   729,  728,  727,  627,  448,   64,  187, 1305, 1302, 1252,
 /*   160 */  1290, 1273, 1323, 1322, 1321, 1319, 1318, 1316, 1315, 1314,
 /*   170 */  1313, 1312, 1311, 1310, 1308, 1307, 1304, 1303, 1301, 1298,
 /*   180 */  1294, 1292, 1289, 1266, 1264, 1259, 1288, 1287, 1238, 1285,
 /*   190 */  1281, 1280, 1279, 1278, 1251, 1277, 1276, 1275, 1273, 1268,
 /*   200 */  1267, 1265, 1263, 1261, 1257, 1248, 1237, 1247, 1246, 1243,
 /*   210 */  1238, 1240, 1235, 1249, 1234, 1233, 1230, 1220, 1214, 1210,
 /*   220 */  1225, 1219, 1232, 1231, 1197, 1195, 1227, 1224, 1201, 1208,
 /*   230 */  1242, 1137, 1236, 1229, 1193, 1181, 1221, 1177, 1196, 1179,
 /*   240 */  1191, 1190, 1186, 1182, 1218, 1216, 1176, 1162, 1183, 1180,
 /*   250 */  1160, 1199, 1203, 1133, 1095, 1198, 1194, 1188, 1192, 1171,
 /*   260 */  1169, 1168, 1173, 1174, 1166, 1159, 1141, 1170, 1158, 1167,
 /*   270 */  1157, 1132, 1145, 1143, 1124, 1128, 1103, 1102, 1100, 1096,
 /*   280 */  1150, 1149, 1085, 1125, 1080, 1064, 1120, 1097, 1082, 1078,
 /*   290 */  1073, 1067, 1109, 1107, 1119, 1117, 1116, 1113, 1111, 1108,
 /*   300 */  1007, 1000, 1002, 1076, 1075, 1081,

};
static const YYACTIONTYPE yy_default[] = {
 /*     0 */   647,  964,  964,  964,  878,  878,  969,  964,  774,  802,
 /*    10 */   802,  938,  969,  969,  969,  876,  969,  969,  969,  964,
 /*    20 */   969,  778,  808,  969,  969,  969,  969,  969,  969,  969,
 /*    30 */   969,  937,  939,  816,  815,  918,  789,  813,  806,  810,
 /*    40 */   879,  872,  873,  871,  875,  880,  969,  809,  841,  856,
 /*    50 */   840,  969,  969,  969,  969,  969,  969,  969,  969,  969,
 /*    60 */   969,  969,  969,  969,  969,  969,  969,  969,  969,  969,
 /*    70 */   969,  969,  969,  969,  969,  969,  969,  969,  969,  969,
 /*    80 */   969,  969,  969,  969,  969,  969,  969,  969,  969,  969,
 /*    90 */   969,  969,  969,  969,  850,  855,  862,  854,  851,  843,
 /*   100 */   842,  844,  845,  969,  969,  673,  739,  969,  969,  846,
 /*   110 */   969,  685,  847,  859,  858,  857,  680,  969,  969,  969,
 /*   120 */   969,  969,  969,  969,  969,  969,  969,  969,  969,  969,
 /*   130 */   969,  969,  969,  969,  969,  969,  969,  969,  969,  969,
 /*   140 */   969,  969,  969,  969,  647,  964,  969,  969,  964,  964,
 /*   150 */   964,  964,  964,  964,  956,  778,  768,  969,  969,  969,
 /*   160 */   969,  969,  969,  969,  969,  969,  969,  944,  942,  969,
 /*   170 */   891,  969,  969,  969,  969,  969,  969,  969,  969,  969,
 /*   180 */   969,  969,  969,  969,  969,  969,  969,  969,  969,  969,
 /*   190 */   969,  969,  969,  969,  969,  969,  969,  969,  969,  969,
 /*   200 */   969,  969,  969,  969,  653,  969,  911,  774,  774,  774,
 /*   210 */   776,  754,  766,  655,  812,  791,  791,  923,  812,  923,
 /*   220 */   710,  733,  707,  802,  791,  874,  802,  802,  775,  766,
 /*   230 */   969,  949,  782,  782,  941,  941,  782,  821,  743,  812,
 /*   240 */   750,  750,  750,  750,  782,  670,  812,  821,  743,  743,
 /*   250 */   812,  782,  670,  917,  915,  782,  782,  670,  782,  670,
 /*   260 */   782,  670,  884,  741,  741,  741,  725,  884,  741,  710,
 /*   270 */   741,  725,  741,  741,  795,  790,  795,  790,  795,  790,
 /*   280 */   782,  782,  969,  884,  888,  888,  884,  807,  796,  805,
 /*   290 */   803,  812,  676,  728,  663,  663,  652,  652,  652,  652,
 /*   300 */   961,  961,  956,  712,  712,  695,  969,  969,  969,  969,
 /*   310 */   969,  969,  687,  969,  893,  969,  969,  969,  969,  969,
 /*   320 */   969,  969,  969,  969,  969,  969,  969,  969,  969,  969,
 /*   330 */   969,  828,  969,  648,  951,  969,  969,  948,  969,  969,
 /*   340 */   969,  969,  969,  969,  969,  969,  969,  969,  969,  969,
 /*   350 */   969,  969,  969,  969,  969,  969,  921,  969,  969,  969,
 /*   360 */   969,  969,  969,  914,  913,  969,  969,  969,  969,  969,
 /*   370 */   969,  969,  969,  969,  969,  969,  969,  969,  969,  969,
 /*   380 */   969,  969,  969,  969,  969,  969,  969,  757,  969,  969,
 /*   390 */   969,  761,  969,  969,  969,  969,  969,  969,  804,  969,
 /*   400 */   797,  969,  877,  969,  969,  969,  969,  969,  969,  969,
 /*   410 */   969,  969,  969,  966,  969,  969,  969,  965,  969,  969,
 /*   420 */   969,  969,  969,  830,  969,  829,  833,  969,  661,  969,
 /*   430 */   644,  649,  960,  963,  962,  959,  958,  957,  952,  950,
 /*   440 */   947,  946,  945,  943,  940,  936,  897,  895,  902,  901,
 /*   450 */   900,  899,  898,  896,  894,  892,  818,  817,  814,  811,
 /*   460 */   753,  935,  890,  752,  749,  748,  669,  953,  920,  929,
 /*   470 */   928,  927,  822,  926,  925,  924,  922,  919,  906,  820,
 /*   480 */   819,  744,  882,  881,  672,  910,  909,  908,  912,  916,
 /*   490 */   907,  784,  751,  671,  668,  675,  679,  731,  732,  740,
 /*   500 */   738,  737,  736,  735,  734,  730,  681,  686,  724,  709,
 /*   510 */   708,  717,  716,  722,  721,  720,  719,  718,  715,  714,
 /*   520 */   713,  706,  705,  711,  704,  727,  726,  723,  703,  747,
 /*   530 */   746,  745,  742,  702,  701,  700,  833,  699,  698,  838,
 /*   540 */   837,  866,  826,  755,  759,  758,  762,  763,  771,  770,
 /*   550 */   769,  780,  781,  793,  792,  824,  823,  794,  779,  773,
 /*   560 */   772,  788,  787,  786,  785,  777,  767,  799,  798,  868,
 /*   570 */   783,  867,  865,  934,  933,  932,  931,  930,  870,  967,
 /*   580 */   968,  887,  889,  886,  801,  800,  885,  869,  839,  836,
 /*   590 */   690,  691,  905,  904,  903,  693,  692,  689,  688,  863,
 /*   600 */   860,  852,  864,  861,  853,  849,  848,  834,  832,  831,
 /*   610 */   827,  835,  760,  756,  825,  765,  764,  697,  696,  694,
 /*   620 */   678,  677,  674,  667,  665,  664,  666,  662,  660,  659,
 /*   630 */   658,  657,  656,  684,  683,  682,  654,  651,  650,  646,
 /*   640 */   645,  643,
};

/* The next table maps tokens into fallback tokens.  If a construct
** like the following:
** 
**      %fallback ID X Y Z.
**
114905
114906
114907
114908
114909
114910
114911

114912
114913
114914
114915
114916
114917
114918

114919
114920
114921
114922
114923
114924
114925
   27,  /*      MATCH => ID */
   27,  /*         NO => ID */
   27,  /*        KEY => ID */
   27,  /*         OF => ID */
   27,  /*     OFFSET => ID */
   27,  /*     PRAGMA => ID */
   27,  /*      RAISE => ID */

   27,  /*    REPLACE => ID */
   27,  /*   RESTRICT => ID */
   27,  /*        ROW => ID */
   27,  /*    TRIGGER => ID */
   27,  /*     VACUUM => ID */
   27,  /*       VIEW => ID */
   27,  /*    VIRTUAL => ID */

   27,  /*    REINDEX => ID */
   27,  /*     RENAME => ID */
   27,  /*   CTIME_KW => ID */
};
#endif /* YYFALLBACK */

/* The following structure represents a single element of the







>







>







115399
115400
115401
115402
115403
115404
115405
115406
115407
115408
115409
115410
115411
115412
115413
115414
115415
115416
115417
115418
115419
115420
115421
   27,  /*      MATCH => ID */
   27,  /*         NO => ID */
   27,  /*        KEY => ID */
   27,  /*         OF => ID */
   27,  /*     OFFSET => ID */
   27,  /*     PRAGMA => ID */
   27,  /*      RAISE => ID */
   27,  /*  RECURSIVE => ID */
   27,  /*    REPLACE => ID */
   27,  /*   RESTRICT => ID */
   27,  /*        ROW => ID */
   27,  /*    TRIGGER => ID */
   27,  /*     VACUUM => ID */
   27,  /*       VIEW => ID */
   27,  /*    VIRTUAL => ID */
   27,  /*       WITH => ID */
   27,  /*    REINDEX => ID */
   27,  /*     RENAME => ID */
   27,  /*   CTIME_KW => ID */
};
#endif /* YYFALLBACK */

/* The following structure represents a single element of the
115007
115008
115009
115010
115011
115012
115013
115014
115015

115016
115017
115018
115019
115020
115021
115022
115023
115024
115025
115026
115027
115028
115029
115030
115031
115032
115033
115034
115035
115036
115037
115038
115039
115040
115041
115042
115043
115044
115045
115046
115047
115048
115049
115050
115051

115052
115053
115054
115055
115056
115057
115058
115059
115060
115061
115062

115063
115064
115065
115066
115067
115068
115069
  "INDEXED",       "ABORT",         "ACTION",        "AFTER",       
  "ANALYZE",       "ASC",           "ATTACH",        "BEFORE",      
  "BY",            "CASCADE",       "CAST",          "COLUMNKW",    
  "CONFLICT",      "DATABASE",      "DESC",          "DETACH",      
  "EACH",          "FAIL",          "FOR",           "IGNORE",      
  "INITIALLY",     "INSTEAD",       "LIKE_KW",       "MATCH",       
  "NO",            "KEY",           "OF",            "OFFSET",      
  "PRAGMA",        "RAISE",         "REPLACE",       "RESTRICT",    
  "ROW",           "TRIGGER",       "VACUUM",        "VIEW",        

  "VIRTUAL",       "REINDEX",       "RENAME",        "CTIME_KW",    
  "ANY",           "OR",            "AND",           "IS",          
  "BETWEEN",       "IN",            "ISNULL",        "NOTNULL",     
  "NE",            "EQ",            "GT",            "LE",          
  "LT",            "GE",            "ESCAPE",        "BITAND",      
  "BITOR",         "LSHIFT",        "RSHIFT",        "PLUS",        
  "MINUS",         "STAR",          "SLASH",         "REM",         
  "CONCAT",        "COLLATE",       "BITNOT",        "STRING",      
  "JOIN_KW",       "CONSTRAINT",    "DEFAULT",       "NULL",        
  "PRIMARY",       "UNIQUE",        "CHECK",         "REFERENCES",  
  "AUTOINCR",      "ON",            "INSERT",        "DELETE",      
  "UPDATE",        "SET",           "DEFERRABLE",    "FOREIGN",     
  "DROP",          "UNION",         "ALL",           "EXCEPT",      
  "INTERSECT",     "SELECT",        "DISTINCT",      "DOT",         
  "FROM",          "JOIN",          "USING",         "ORDER",       
  "GROUP",         "HAVING",        "LIMIT",         "WHERE",       
  "INTO",          "VALUES",        "INTEGER",       "FLOAT",       
  "BLOB",          "REGISTER",      "VARIABLE",      "CASE",        
  "WHEN",          "THEN",          "ELSE",          "INDEX",       
  "ALTER",         "ADD",           "error",         "input",       
  "cmdlist",       "ecmd",          "explain",       "cmdx",        
  "cmd",           "transtype",     "trans_opt",     "nm",          
  "savepoint_opt",  "create_table",  "create_table_args",  "createkw",    
  "temp",          "ifnotexists",   "dbnm",          "columnlist",  
  "conslist_opt",  "table_options",  "select",        "column",      
  "columnid",      "type",          "carglist",      "id",          
  "ids",           "typetoken",     "typename",      "signed",      
  "plus_num",      "minus_num",     "ccons",         "term",        
  "expr",          "onconf",        "sortorder",     "autoinc",     
  "idxlist_opt",   "refargs",       "defer_subclause",  "refarg",      
  "refact",        "init_deferred_pred_opt",  "conslist",      "tconscomma",  
  "tcons",         "idxlist",       "defer_subclause_opt",  "orconf",      
  "resolvetype",   "raisetype",     "ifexists",      "fullname",    
  "oneselect",     "multiselect_op",  "distinct",      "selcollist",  
  "from",          "where_opt",     "groupby_opt",   "having_opt",  
  "orderby_opt",   "limit_opt",     "sclp",          "as",          

  "seltablist",    "stl_prefix",    "joinop",        "indexed_opt", 
  "on_opt",        "using_opt",     "joinop2",       "idlist",      
  "sortlist",      "nexprlist",     "setlist",       "insert_cmd",  
  "inscollist_opt",  "valuelist",     "exprlist",      "likeop",      
  "between_op",    "in_op",         "case_operand",  "case_exprlist",
  "case_else",     "uniqueflag",    "collate",       "nmnum",       
  "number",        "trigger_decl",  "trigger_cmd_list",  "trigger_time",
  "trigger_event",  "foreach_clause",  "when_clause",   "trigger_cmd", 
  "trnm",          "tridxby",       "database_kw_opt",  "key_opt",     
  "add_column_fullname",  "kwcolumn_opt",  "create_vtab",   "vtabarglist", 
  "vtabarg",       "vtabargtoken",  "lp",            "anylist",     

};
#endif /* NDEBUG */

#ifndef NDEBUG
/* For tracing reduce actions, the names of all rules are required.
*/
static const char *const yyRuleName[] = {







|
|
>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
>


|
<
|
|
|




>







115503
115504
115505
115506
115507
115508
115509
115510
115511
115512
115513
115514
115515
115516
115517
115518
115519
115520
115521
115522
115523
115524
115525
115526
115527
115528
115529

115530
115531
115532
115533
115534
115535
115536
115537
115538
115539
115540
115541
115542
115543
115544
115545
115546
115547
115548
115549
115550
115551

115552
115553
115554
115555
115556
115557
115558
115559
115560
115561
115562
115563
115564
115565
115566
  "INDEXED",       "ABORT",         "ACTION",        "AFTER",       
  "ANALYZE",       "ASC",           "ATTACH",        "BEFORE",      
  "BY",            "CASCADE",       "CAST",          "COLUMNKW",    
  "CONFLICT",      "DATABASE",      "DESC",          "DETACH",      
  "EACH",          "FAIL",          "FOR",           "IGNORE",      
  "INITIALLY",     "INSTEAD",       "LIKE_KW",       "MATCH",       
  "NO",            "KEY",           "OF",            "OFFSET",      
  "PRAGMA",        "RAISE",         "RECURSIVE",     "REPLACE",     
  "RESTRICT",      "ROW",           "TRIGGER",       "VACUUM",      
  "VIEW",          "VIRTUAL",       "WITH",          "REINDEX",     
  "RENAME",        "CTIME_KW",      "ANY",           "OR",          
  "AND",           "IS",            "BETWEEN",       "IN",          
  "ISNULL",        "NOTNULL",       "NE",            "EQ",          
  "GT",            "LE",            "LT",            "GE",          
  "ESCAPE",        "BITAND",        "BITOR",         "LSHIFT",      
  "RSHIFT",        "PLUS",          "MINUS",         "STAR",        
  "SLASH",         "REM",           "CONCAT",        "COLLATE",     
  "BITNOT",        "STRING",        "JOIN_KW",       "CONSTRAINT",  
  "DEFAULT",       "NULL",          "PRIMARY",       "UNIQUE",      
  "CHECK",         "REFERENCES",    "AUTOINCR",      "ON",          
  "INSERT",        "DELETE",        "UPDATE",        "SET",         
  "DEFERRABLE",    "FOREIGN",       "DROP",          "UNION",       
  "ALL",           "EXCEPT",        "INTERSECT",     "SELECT",      
  "VALUES",        "DISTINCT",      "DOT",           "FROM",        
  "JOIN",          "USING",         "ORDER",         "GROUP",       
  "HAVING",        "LIMIT",         "WHERE",         "INTO",        
  "INTEGER",       "FLOAT",         "BLOB",          "VARIABLE",    

  "CASE",          "WHEN",          "THEN",          "ELSE",        
  "INDEX",         "ALTER",         "ADD",           "error",       
  "input",         "cmdlist",       "ecmd",          "explain",     
  "cmdx",          "cmd",           "transtype",     "trans_opt",   
  "nm",            "savepoint_opt",  "create_table",  "create_table_args",
  "createkw",      "temp",          "ifnotexists",   "dbnm",        
  "columnlist",    "conslist_opt",  "table_options",  "select",      
  "column",        "columnid",      "type",          "carglist",    
  "typetoken",     "typename",      "signed",        "plus_num",    
  "minus_num",     "ccons",         "term",          "expr",        
  "onconf",        "sortorder",     "autoinc",       "idxlist_opt", 
  "refargs",       "defer_subclause",  "refarg",        "refact",      
  "init_deferred_pred_opt",  "conslist",      "tconscomma",    "tcons",       
  "idxlist",       "defer_subclause_opt",  "orconf",        "resolvetype", 
  "raisetype",     "ifexists",      "fullname",      "selectnowith",
  "oneselect",     "with",          "multiselect_op",  "distinct",    
  "selcollist",    "from",          "where_opt",     "groupby_opt", 
  "having_opt",    "orderby_opt",   "limit_opt",     "values",      
  "nexprlist",     "exprlist",      "sclp",          "as",          
  "seltablist",    "stl_prefix",    "joinop",        "indexed_opt", 
  "on_opt",        "using_opt",     "joinop2",       "idlist",      
  "sortlist",      "setlist",       "insert_cmd",    "inscollist_opt",

  "likeop",        "between_op",    "in_op",         "case_operand",
  "case_exprlist",  "case_else",     "uniqueflag",    "collate",     
  "nmnum",         "trigger_decl",  "trigger_cmd_list",  "trigger_time",
  "trigger_event",  "foreach_clause",  "when_clause",   "trigger_cmd", 
  "trnm",          "tridxby",       "database_kw_opt",  "key_opt",     
  "add_column_fullname",  "kwcolumn_opt",  "create_vtab",   "vtabarglist", 
  "vtabarg",       "vtabargtoken",  "lp",            "anylist",     
  "wqlist",      
};
#endif /* NDEBUG */

#ifndef NDEBUG
/* For tracing reduce actions, the names of all rules are required.
*/
static const char *const yyRuleName[] = {
115103
115104
115105
115106
115107
115108
115109
115110
115111
115112
115113
115114
115115
115116
115117
115118
115119
115120
115121
115122
115123
115124
115125
115126
115127
115128
115129
115130
115131
115132
115133
115134
115135
115136
115137
115138
115139
115140
115141
115142
115143
115144



115145
115146
115147
115148
115149
115150
115151
115152
115153
115154
115155
115156
115157
115158
115159
115160
115161
115162
115163
115164
115165
115166
115167
115168
115169
115170
115171
115172
115173
115174
115175
115176
115177
115178
115179
115180
115181
115182
115183
115184

115185
115186
115187
115188
115189
115190


115191
115192
115193
115194
115195
115196
115197
115198
115199
115200
115201
115202
115203

115204
115205
115206
115207
115208
115209
115210
115211
115212
115213
115214
115215
115216
115217
115218
115219
115220

115221
115222
115223
115224
115225
115226
115227
115228
115229
115230
115231
115232
115233
115234
115235
115236
115237

115238
115239
115240
115241
115242
115243
115244
115245
115246
115247
115248
115249
115250
115251
115252
115253
115254
115255
115256
115257
115258
115259
115260
115261
115262
115263
115264
115265
115266
115267
115268
115269
115270
115271
115272
115273
115274
115275
115276
115277
115278
115279
115280



115281
115282
115283
115284
115285
115286
115287
115288
115289
115290
115291
115292
115293
115294
115295
115296
115297
115298
115299
115300
115301
115302
115303
115304
115305
115306
115307
115308
115309
115310
115311
115312
115313
115314
115315
115316
115317
115318
115319
115320
115321
115322
115323





115324
115325
115326
115327
115328
115329
115330
115331
115332
115333
115334
115335
115336
115337
115338
115339
115340
115341
115342
115343
115344
115345
115346
115347
115348
115349
115350
115351
115352
115353
115354
115355
115356
115357
115358
115359
115360
115361
115362
115363
115364
115365
115366
115367
115368
115369
115370
115371
115372
115373
115374
115375
115376
115377
115378
115379
115380
115381
115382
115383
115384
115385
115386
115387
115388
115389
115390
115391
115392
115393
115394
115395
115396
115397
115398





115399
115400
115401
115402
115403
115404
115405
 /*  33 */ "create_table_args ::= AS select",
 /*  34 */ "table_options ::=",
 /*  35 */ "table_options ::= WITHOUT nm",
 /*  36 */ "columnlist ::= columnlist COMMA column",
 /*  37 */ "columnlist ::= column",
 /*  38 */ "column ::= columnid type carglist",
 /*  39 */ "columnid ::= nm",
 /*  40 */ "id ::= ID",
 /*  41 */ "id ::= INDEXED",
 /*  42 */ "ids ::= ID|STRING",
 /*  43 */ "nm ::= id",
 /*  44 */ "nm ::= STRING",
 /*  45 */ "nm ::= JOIN_KW",
 /*  46 */ "type ::=",
 /*  47 */ "type ::= typetoken",
 /*  48 */ "typetoken ::= typename",
 /*  49 */ "typetoken ::= typename LP signed RP",
 /*  50 */ "typetoken ::= typename LP signed COMMA signed RP",
 /*  51 */ "typename ::= ids",
 /*  52 */ "typename ::= typename ids",
 /*  53 */ "signed ::= plus_num",
 /*  54 */ "signed ::= minus_num",
 /*  55 */ "carglist ::= carglist ccons",
 /*  56 */ "carglist ::=",
 /*  57 */ "ccons ::= CONSTRAINT nm",
 /*  58 */ "ccons ::= DEFAULT term",
 /*  59 */ "ccons ::= DEFAULT LP expr RP",
 /*  60 */ "ccons ::= DEFAULT PLUS term",
 /*  61 */ "ccons ::= DEFAULT MINUS term",
 /*  62 */ "ccons ::= DEFAULT id",
 /*  63 */ "ccons ::= NULL onconf",
 /*  64 */ "ccons ::= NOT NULL onconf",
 /*  65 */ "ccons ::= PRIMARY KEY sortorder onconf autoinc",
 /*  66 */ "ccons ::= UNIQUE onconf",
 /*  67 */ "ccons ::= CHECK LP expr RP",
 /*  68 */ "ccons ::= REFERENCES nm idxlist_opt refargs",
 /*  69 */ "ccons ::= defer_subclause",
 /*  70 */ "ccons ::= COLLATE ids",
 /*  71 */ "autoinc ::=",
 /*  72 */ "autoinc ::= AUTOINCR",
 /*  73 */ "refargs ::=",
 /*  74 */ "refargs ::= refargs refarg",



 /*  75 */ "refarg ::= MATCH nm",
 /*  76 */ "refarg ::= ON INSERT refact",
 /*  77 */ "refarg ::= ON DELETE refact",
 /*  78 */ "refarg ::= ON UPDATE refact",
 /*  79 */ "refact ::= SET NULL",
 /*  80 */ "refact ::= SET DEFAULT",
 /*  81 */ "refact ::= CASCADE",
 /*  82 */ "refact ::= RESTRICT",
 /*  83 */ "refact ::= NO ACTION",
 /*  84 */ "defer_subclause ::= NOT DEFERRABLE init_deferred_pred_opt",
 /*  85 */ "defer_subclause ::= DEFERRABLE init_deferred_pred_opt",
 /*  86 */ "init_deferred_pred_opt ::=",
 /*  87 */ "init_deferred_pred_opt ::= INITIALLY DEFERRED",
 /*  88 */ "init_deferred_pred_opt ::= INITIALLY IMMEDIATE",
 /*  89 */ "conslist_opt ::=",
 /*  90 */ "conslist_opt ::= COMMA conslist",
 /*  91 */ "conslist ::= conslist tconscomma tcons",
 /*  92 */ "conslist ::= tcons",
 /*  93 */ "tconscomma ::= COMMA",
 /*  94 */ "tconscomma ::=",
 /*  95 */ "tcons ::= CONSTRAINT nm",
 /*  96 */ "tcons ::= PRIMARY KEY LP idxlist autoinc RP onconf",
 /*  97 */ "tcons ::= UNIQUE LP idxlist RP onconf",
 /*  98 */ "tcons ::= CHECK LP expr RP onconf",
 /*  99 */ "tcons ::= FOREIGN KEY LP idxlist RP REFERENCES nm idxlist_opt refargs defer_subclause_opt",
 /* 100 */ "defer_subclause_opt ::=",
 /* 101 */ "defer_subclause_opt ::= defer_subclause",
 /* 102 */ "onconf ::=",
 /* 103 */ "onconf ::= ON CONFLICT resolvetype",
 /* 104 */ "orconf ::=",
 /* 105 */ "orconf ::= OR resolvetype",
 /* 106 */ "resolvetype ::= raisetype",
 /* 107 */ "resolvetype ::= IGNORE",
 /* 108 */ "resolvetype ::= REPLACE",
 /* 109 */ "cmd ::= DROP TABLE ifexists fullname",
 /* 110 */ "ifexists ::= IF EXISTS",
 /* 111 */ "ifexists ::=",
 /* 112 */ "cmd ::= createkw temp VIEW ifnotexists nm dbnm AS select",
 /* 113 */ "cmd ::= DROP VIEW ifexists fullname",
 /* 114 */ "cmd ::= select",

 /* 115 */ "select ::= oneselect",
 /* 116 */ "select ::= select multiselect_op oneselect",
 /* 117 */ "multiselect_op ::= UNION",
 /* 118 */ "multiselect_op ::= UNION ALL",
 /* 119 */ "multiselect_op ::= EXCEPT|INTERSECT",
 /* 120 */ "oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt orderby_opt limit_opt",


 /* 121 */ "distinct ::= DISTINCT",
 /* 122 */ "distinct ::= ALL",
 /* 123 */ "distinct ::=",
 /* 124 */ "sclp ::= selcollist COMMA",
 /* 125 */ "sclp ::=",
 /* 126 */ "selcollist ::= sclp expr as",
 /* 127 */ "selcollist ::= sclp STAR",
 /* 128 */ "selcollist ::= sclp nm DOT STAR",
 /* 129 */ "as ::= AS nm",
 /* 130 */ "as ::= ids",
 /* 131 */ "as ::=",
 /* 132 */ "from ::=",
 /* 133 */ "from ::= FROM seltablist",

 /* 134 */ "stl_prefix ::= seltablist joinop",
 /* 135 */ "stl_prefix ::=",
 /* 136 */ "seltablist ::= stl_prefix nm dbnm as indexed_opt on_opt using_opt",
 /* 137 */ "seltablist ::= stl_prefix LP select RP as on_opt using_opt",
 /* 138 */ "seltablist ::= stl_prefix LP seltablist RP as on_opt using_opt",
 /* 139 */ "dbnm ::=",
 /* 140 */ "dbnm ::= DOT nm",
 /* 141 */ "fullname ::= nm dbnm",
 /* 142 */ "joinop ::= COMMA|JOIN",
 /* 143 */ "joinop ::= JOIN_KW JOIN",
 /* 144 */ "joinop ::= JOIN_KW nm JOIN",
 /* 145 */ "joinop ::= JOIN_KW nm nm JOIN",
 /* 146 */ "on_opt ::= ON expr",
 /* 147 */ "on_opt ::=",
 /* 148 */ "indexed_opt ::=",
 /* 149 */ "indexed_opt ::= INDEXED BY nm",
 /* 150 */ "indexed_opt ::= NOT INDEXED",

 /* 151 */ "using_opt ::= USING LP idlist RP",
 /* 152 */ "using_opt ::=",
 /* 153 */ "orderby_opt ::=",
 /* 154 */ "orderby_opt ::= ORDER BY sortlist",
 /* 155 */ "sortlist ::= sortlist COMMA expr sortorder",
 /* 156 */ "sortlist ::= expr sortorder",
 /* 157 */ "sortorder ::= ASC",
 /* 158 */ "sortorder ::= DESC",
 /* 159 */ "sortorder ::=",
 /* 160 */ "groupby_opt ::=",
 /* 161 */ "groupby_opt ::= GROUP BY nexprlist",
 /* 162 */ "having_opt ::=",
 /* 163 */ "having_opt ::= HAVING expr",
 /* 164 */ "limit_opt ::=",
 /* 165 */ "limit_opt ::= LIMIT expr",
 /* 166 */ "limit_opt ::= LIMIT expr OFFSET expr",
 /* 167 */ "limit_opt ::= LIMIT expr COMMA expr",

 /* 168 */ "cmd ::= DELETE FROM fullname indexed_opt where_opt",
 /* 169 */ "where_opt ::=",
 /* 170 */ "where_opt ::= WHERE expr",
 /* 171 */ "cmd ::= UPDATE orconf fullname indexed_opt SET setlist where_opt",
 /* 172 */ "setlist ::= setlist COMMA nm EQ expr",
 /* 173 */ "setlist ::= nm EQ expr",
 /* 174 */ "cmd ::= insert_cmd INTO fullname inscollist_opt valuelist",
 /* 175 */ "cmd ::= insert_cmd INTO fullname inscollist_opt select",
 /* 176 */ "cmd ::= insert_cmd INTO fullname inscollist_opt DEFAULT VALUES",
 /* 177 */ "insert_cmd ::= INSERT orconf",
 /* 178 */ "insert_cmd ::= REPLACE",
 /* 179 */ "valuelist ::= VALUES LP nexprlist RP",
 /* 180 */ "valuelist ::= valuelist COMMA LP exprlist RP",
 /* 181 */ "inscollist_opt ::=",
 /* 182 */ "inscollist_opt ::= LP idlist RP",
 /* 183 */ "idlist ::= idlist COMMA nm",
 /* 184 */ "idlist ::= nm",
 /* 185 */ "expr ::= term",
 /* 186 */ "expr ::= LP expr RP",
 /* 187 */ "term ::= NULL",
 /* 188 */ "expr ::= id",
 /* 189 */ "expr ::= JOIN_KW",
 /* 190 */ "expr ::= nm DOT nm",
 /* 191 */ "expr ::= nm DOT nm DOT nm",
 /* 192 */ "term ::= INTEGER|FLOAT|BLOB",
 /* 193 */ "term ::= STRING",
 /* 194 */ "expr ::= REGISTER",
 /* 195 */ "expr ::= VARIABLE",
 /* 196 */ "expr ::= expr COLLATE ids",
 /* 197 */ "expr ::= CAST LP expr AS typetoken RP",
 /* 198 */ "expr ::= ID LP distinct exprlist RP",
 /* 199 */ "expr ::= ID LP STAR RP",
 /* 200 */ "term ::= CTIME_KW",
 /* 201 */ "expr ::= expr AND expr",
 /* 202 */ "expr ::= expr OR expr",
 /* 203 */ "expr ::= expr LT|GT|GE|LE expr",
 /* 204 */ "expr ::= expr EQ|NE expr",
 /* 205 */ "expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr",
 /* 206 */ "expr ::= expr PLUS|MINUS expr",
 /* 207 */ "expr ::= expr STAR|SLASH|REM expr",
 /* 208 */ "expr ::= expr CONCAT expr",
 /* 209 */ "likeop ::= LIKE_KW",
 /* 210 */ "likeop ::= NOT LIKE_KW",



 /* 211 */ "likeop ::= MATCH",
 /* 212 */ "likeop ::= NOT MATCH",
 /* 213 */ "expr ::= expr likeop expr",
 /* 214 */ "expr ::= expr likeop expr ESCAPE expr",
 /* 215 */ "expr ::= expr ISNULL|NOTNULL",
 /* 216 */ "expr ::= expr NOT NULL",
 /* 217 */ "expr ::= expr IS expr",
 /* 218 */ "expr ::= expr IS NOT expr",
 /* 219 */ "expr ::= NOT expr",
 /* 220 */ "expr ::= BITNOT expr",
 /* 221 */ "expr ::= MINUS expr",
 /* 222 */ "expr ::= PLUS expr",
 /* 223 */ "between_op ::= BETWEEN",
 /* 224 */ "between_op ::= NOT BETWEEN",
 /* 225 */ "expr ::= expr between_op expr AND expr",
 /* 226 */ "in_op ::= IN",
 /* 227 */ "in_op ::= NOT IN",
 /* 228 */ "expr ::= expr in_op LP exprlist RP",
 /* 229 */ "expr ::= LP select RP",
 /* 230 */ "expr ::= expr in_op LP select RP",
 /* 231 */ "expr ::= expr in_op nm dbnm",
 /* 232 */ "expr ::= EXISTS LP select RP",
 /* 233 */ "expr ::= CASE case_operand case_exprlist case_else END",
 /* 234 */ "case_exprlist ::= case_exprlist WHEN expr THEN expr",
 /* 235 */ "case_exprlist ::= WHEN expr THEN expr",
 /* 236 */ "case_else ::= ELSE expr",
 /* 237 */ "case_else ::=",
 /* 238 */ "case_operand ::= expr",
 /* 239 */ "case_operand ::=",
 /* 240 */ "exprlist ::= nexprlist",
 /* 241 */ "exprlist ::=",
 /* 242 */ "nexprlist ::= nexprlist COMMA expr",
 /* 243 */ "nexprlist ::= expr",
 /* 244 */ "cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP idxlist RP where_opt",
 /* 245 */ "uniqueflag ::= UNIQUE",
 /* 246 */ "uniqueflag ::=",
 /* 247 */ "idxlist_opt ::=",
 /* 248 */ "idxlist_opt ::= LP idxlist RP",
 /* 249 */ "idxlist ::= idxlist COMMA nm collate sortorder",
 /* 250 */ "idxlist ::= nm collate sortorder",
 /* 251 */ "collate ::=",
 /* 252 */ "collate ::= COLLATE ids",
 /* 253 */ "cmd ::= DROP INDEX ifexists fullname",





 /* 254 */ "cmd ::= VACUUM",
 /* 255 */ "cmd ::= VACUUM nm",
 /* 256 */ "cmd ::= PRAGMA nm dbnm",
 /* 257 */ "cmd ::= PRAGMA nm dbnm EQ nmnum",
 /* 258 */ "cmd ::= PRAGMA nm dbnm LP nmnum RP",
 /* 259 */ "cmd ::= PRAGMA nm dbnm EQ minus_num",
 /* 260 */ "cmd ::= PRAGMA nm dbnm LP minus_num RP",
 /* 261 */ "nmnum ::= plus_num",
 /* 262 */ "nmnum ::= nm",
 /* 263 */ "nmnum ::= ON",
 /* 264 */ "nmnum ::= DELETE",
 /* 265 */ "nmnum ::= DEFAULT",
 /* 266 */ "plus_num ::= PLUS number",
 /* 267 */ "plus_num ::= number",
 /* 268 */ "minus_num ::= MINUS number",
 /* 269 */ "number ::= INTEGER|FLOAT",
 /* 270 */ "cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END",
 /* 271 */ "trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause",
 /* 272 */ "trigger_time ::= BEFORE",
 /* 273 */ "trigger_time ::= AFTER",
 /* 274 */ "trigger_time ::= INSTEAD OF",
 /* 275 */ "trigger_time ::=",
 /* 276 */ "trigger_event ::= DELETE|INSERT",
 /* 277 */ "trigger_event ::= UPDATE",
 /* 278 */ "trigger_event ::= UPDATE OF idlist",
 /* 279 */ "foreach_clause ::=",
 /* 280 */ "foreach_clause ::= FOR EACH ROW",
 /* 281 */ "when_clause ::=",
 /* 282 */ "when_clause ::= WHEN expr",
 /* 283 */ "trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI",
 /* 284 */ "trigger_cmd_list ::= trigger_cmd SEMI",
 /* 285 */ "trnm ::= nm",
 /* 286 */ "trnm ::= nm DOT nm",
 /* 287 */ "tridxby ::=",
 /* 288 */ "tridxby ::= INDEXED BY nm",
 /* 289 */ "tridxby ::= NOT INDEXED",
 /* 290 */ "trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist where_opt",
 /* 291 */ "trigger_cmd ::= insert_cmd INTO trnm inscollist_opt valuelist",
 /* 292 */ "trigger_cmd ::= insert_cmd INTO trnm inscollist_opt select",
 /* 293 */ "trigger_cmd ::= DELETE FROM trnm tridxby where_opt",
 /* 294 */ "trigger_cmd ::= select",
 /* 295 */ "expr ::= RAISE LP IGNORE RP",
 /* 296 */ "expr ::= RAISE LP raisetype COMMA nm RP",
 /* 297 */ "raisetype ::= ROLLBACK",
 /* 298 */ "raisetype ::= ABORT",
 /* 299 */ "raisetype ::= FAIL",
 /* 300 */ "cmd ::= DROP TRIGGER ifexists fullname",
 /* 301 */ "cmd ::= ATTACH database_kw_opt expr AS expr key_opt",
 /* 302 */ "cmd ::= DETACH database_kw_opt expr",
 /* 303 */ "key_opt ::=",
 /* 304 */ "key_opt ::= KEY expr",
 /* 305 */ "database_kw_opt ::= DATABASE",
 /* 306 */ "database_kw_opt ::=",
 /* 307 */ "cmd ::= REINDEX",
 /* 308 */ "cmd ::= REINDEX nm dbnm",
 /* 309 */ "cmd ::= ANALYZE",
 /* 310 */ "cmd ::= ANALYZE nm dbnm",
 /* 311 */ "cmd ::= ALTER TABLE fullname RENAME TO nm",
 /* 312 */ "cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt column",
 /* 313 */ "add_column_fullname ::= fullname",
 /* 314 */ "kwcolumn_opt ::=",
 /* 315 */ "kwcolumn_opt ::= COLUMNKW",
 /* 316 */ "cmd ::= create_vtab",
 /* 317 */ "cmd ::= create_vtab LP vtabarglist RP",
 /* 318 */ "create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm",
 /* 319 */ "vtabarglist ::= vtabarg",
 /* 320 */ "vtabarglist ::= vtabarglist COMMA vtabarg",
 /* 321 */ "vtabarg ::=",
 /* 322 */ "vtabarg ::= vtabarg vtabargtoken",
 /* 323 */ "vtabargtoken ::= ANY",
 /* 324 */ "vtabargtoken ::= lp anylist RP",
 /* 325 */ "lp ::= LP",
 /* 326 */ "anylist ::=",
 /* 327 */ "anylist ::= anylist LP anylist RP",
 /* 328 */ "anylist ::= anylist ANY",





};
#endif /* NDEBUG */


#if YYSTACKDEPTH<=0
/*
** Try to increase the size of the parser stack.







|
<
<
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
>
>
>
|
<
<
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
>
>
|
|
|
|
|
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
<
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
<
|
|
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
<
|
|


<
<
|
|
|
|
|
|
|
|
|
|
|
|
|
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
>
>
>
|
|
|
|
|
|
|
<
<
<
<
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
>
>
>
>
>
<
<
<
<
<
|
|
|
|
|
|
|
|
|
|
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
>
>
>
>
>







115600
115601
115602
115603
115604
115605
115606
115607



115608
115609
115610
115611
115612
115613
115614
115615
115616
115617
115618
115619
115620
115621
115622
115623
115624
115625
115626
115627
115628
115629
115630
115631
115632
115633
115634
115635
115636
115637
115638
115639
115640
115641
115642



115643
115644
115645
115646
115647
115648
115649
115650
115651
115652
115653
115654
115655
115656
115657
115658
115659
115660
115661
115662
115663
115664
115665
115666
115667
115668
115669
115670
115671
115672
115673
115674
115675
115676
115677
115678
115679
115680
115681
115682
115683
115684
115685
115686
115687
115688
115689
115690
115691
115692
115693
115694
115695
115696
115697
115698
115699
115700
115701
115702
115703
115704
115705
115706
115707
115708
115709

115710
115711
115712
115713
115714
115715
115716
115717
115718
115719
115720
115721
115722
115723
115724

115725
115726
115727
115728
115729
115730
115731
115732
115733
115734
115735
115736
115737
115738
115739
115740
115741

115742
115743
115744
115745


115746
115747
115748
115749
115750
115751
115752
115753
115754
115755
115756
115757
115758

115759
115760
115761
115762
115763
115764
115765
115766
115767
115768
115769
115770
115771
115772
115773
115774
115775
115776
115777
115778
115779
115780
115781
115782
115783
115784





115785
115786
115787
115788
115789
115790
115791
115792
115793
115794
115795
115796
115797
115798
115799
115800
115801
115802
115803
115804
115805
115806
115807
115808
115809
115810
115811
115812
115813
115814
115815
115816
115817
115818
115819
115820





115821
115822
115823
115824
115825
115826
115827
115828
115829
115830

115831
115832
115833
115834
115835
115836
115837
115838
115839
115840
115841
115842
115843
115844
115845
115846
115847
115848
115849
115850
115851

115852
115853
115854
115855
115856
115857
115858
115859
115860
115861
115862
115863
115864
115865
115866
115867
115868
115869
115870
115871
115872
115873
115874
115875
115876
115877
115878
115879
115880
115881
115882
115883
115884
115885
115886
115887
115888
115889
115890
115891
115892
115893
115894
115895
115896
115897
115898
115899
115900
 /*  33 */ "create_table_args ::= AS select",
 /*  34 */ "table_options ::=",
 /*  35 */ "table_options ::= WITHOUT nm",
 /*  36 */ "columnlist ::= columnlist COMMA column",
 /*  37 */ "columnlist ::= column",
 /*  38 */ "column ::= columnid type carglist",
 /*  39 */ "columnid ::= nm",
 /*  40 */ "nm ::= ID|INDEXED",



 /*  41 */ "nm ::= STRING",
 /*  42 */ "nm ::= JOIN_KW",
 /*  43 */ "type ::=",
 /*  44 */ "type ::= typetoken",
 /*  45 */ "typetoken ::= typename",
 /*  46 */ "typetoken ::= typename LP signed RP",
 /*  47 */ "typetoken ::= typename LP signed COMMA signed RP",
 /*  48 */ "typename ::= ID|STRING",
 /*  49 */ "typename ::= typename ID|STRING",
 /*  50 */ "signed ::= plus_num",
 /*  51 */ "signed ::= minus_num",
 /*  52 */ "carglist ::= carglist ccons",
 /*  53 */ "carglist ::=",
 /*  54 */ "ccons ::= CONSTRAINT nm",
 /*  55 */ "ccons ::= DEFAULT term",
 /*  56 */ "ccons ::= DEFAULT LP expr RP",
 /*  57 */ "ccons ::= DEFAULT PLUS term",
 /*  58 */ "ccons ::= DEFAULT MINUS term",
 /*  59 */ "ccons ::= DEFAULT ID|INDEXED",
 /*  60 */ "ccons ::= NULL onconf",
 /*  61 */ "ccons ::= NOT NULL onconf",
 /*  62 */ "ccons ::= PRIMARY KEY sortorder onconf autoinc",
 /*  63 */ "ccons ::= UNIQUE onconf",
 /*  64 */ "ccons ::= CHECK LP expr RP",
 /*  65 */ "ccons ::= REFERENCES nm idxlist_opt refargs",
 /*  66 */ "ccons ::= defer_subclause",
 /*  67 */ "ccons ::= COLLATE ID|STRING",
 /*  68 */ "autoinc ::=",
 /*  69 */ "autoinc ::= AUTOINCR",
 /*  70 */ "refargs ::=",
 /*  71 */ "refargs ::= refargs refarg",
 /*  72 */ "refarg ::= MATCH nm",
 /*  73 */ "refarg ::= ON INSERT refact",
 /*  74 */ "refarg ::= ON DELETE refact",
 /*  75 */ "refarg ::= ON UPDATE refact",



 /*  76 */ "refact ::= SET NULL",
 /*  77 */ "refact ::= SET DEFAULT",
 /*  78 */ "refact ::= CASCADE",
 /*  79 */ "refact ::= RESTRICT",
 /*  80 */ "refact ::= NO ACTION",
 /*  81 */ "defer_subclause ::= NOT DEFERRABLE init_deferred_pred_opt",
 /*  82 */ "defer_subclause ::= DEFERRABLE init_deferred_pred_opt",
 /*  83 */ "init_deferred_pred_opt ::=",
 /*  84 */ "init_deferred_pred_opt ::= INITIALLY DEFERRED",
 /*  85 */ "init_deferred_pred_opt ::= INITIALLY IMMEDIATE",
 /*  86 */ "conslist_opt ::=",
 /*  87 */ "conslist_opt ::= COMMA conslist",
 /*  88 */ "conslist ::= conslist tconscomma tcons",
 /*  89 */ "conslist ::= tcons",
 /*  90 */ "tconscomma ::= COMMA",
 /*  91 */ "tconscomma ::=",
 /*  92 */ "tcons ::= CONSTRAINT nm",
 /*  93 */ "tcons ::= PRIMARY KEY LP idxlist autoinc RP onconf",
 /*  94 */ "tcons ::= UNIQUE LP idxlist RP onconf",
 /*  95 */ "tcons ::= CHECK LP expr RP onconf",
 /*  96 */ "tcons ::= FOREIGN KEY LP idxlist RP REFERENCES nm idxlist_opt refargs defer_subclause_opt",
 /*  97 */ "defer_subclause_opt ::=",
 /*  98 */ "defer_subclause_opt ::= defer_subclause",
 /*  99 */ "onconf ::=",
 /* 100 */ "onconf ::= ON CONFLICT resolvetype",
 /* 101 */ "orconf ::=",
 /* 102 */ "orconf ::= OR resolvetype",
 /* 103 */ "resolvetype ::= raisetype",
 /* 104 */ "resolvetype ::= IGNORE",
 /* 105 */ "resolvetype ::= REPLACE",
 /* 106 */ "cmd ::= DROP TABLE ifexists fullname",
 /* 107 */ "ifexists ::= IF EXISTS",
 /* 108 */ "ifexists ::=",
 /* 109 */ "cmd ::= createkw temp VIEW ifnotexists nm dbnm AS select",
 /* 110 */ "cmd ::= DROP VIEW ifexists fullname",
 /* 111 */ "cmd ::= select",
 /* 112 */ "select ::= with selectnowith",
 /* 113 */ "selectnowith ::= oneselect",
 /* 114 */ "selectnowith ::= selectnowith multiselect_op oneselect",
 /* 115 */ "multiselect_op ::= UNION",
 /* 116 */ "multiselect_op ::= UNION ALL",
 /* 117 */ "multiselect_op ::= EXCEPT|INTERSECT",
 /* 118 */ "oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt orderby_opt limit_opt",
 /* 119 */ "oneselect ::= values",
 /* 120 */ "values ::= VALUES LP nexprlist RP",
 /* 121 */ "values ::= values COMMA LP exprlist RP",
 /* 122 */ "distinct ::= DISTINCT",
 /* 123 */ "distinct ::= ALL",
 /* 124 */ "distinct ::=",
 /* 125 */ "sclp ::= selcollist COMMA",
 /* 126 */ "sclp ::=",
 /* 127 */ "selcollist ::= sclp expr as",
 /* 128 */ "selcollist ::= sclp STAR",
 /* 129 */ "selcollist ::= sclp nm DOT STAR",
 /* 130 */ "as ::= AS nm",
 /* 131 */ "as ::= ID|STRING",
 /* 132 */ "as ::=",
 /* 133 */ "from ::=",
 /* 134 */ "from ::= FROM seltablist",
 /* 135 */ "stl_prefix ::= seltablist joinop",
 /* 136 */ "stl_prefix ::=",
 /* 137 */ "seltablist ::= stl_prefix nm dbnm as indexed_opt on_opt using_opt",
 /* 138 */ "seltablist ::= stl_prefix LP select RP as on_opt using_opt",
 /* 139 */ "seltablist ::= stl_prefix LP seltablist RP as on_opt using_opt",
 /* 140 */ "dbnm ::=",
 /* 141 */ "dbnm ::= DOT nm",
 /* 142 */ "fullname ::= nm dbnm",

 /* 143 */ "joinop ::= COMMA|JOIN",
 /* 144 */ "joinop ::= JOIN_KW JOIN",
 /* 145 */ "joinop ::= JOIN_KW nm JOIN",
 /* 146 */ "joinop ::= JOIN_KW nm nm JOIN",
 /* 147 */ "on_opt ::= ON expr",
 /* 148 */ "on_opt ::=",
 /* 149 */ "indexed_opt ::=",
 /* 150 */ "indexed_opt ::= INDEXED BY nm",
 /* 151 */ "indexed_opt ::= NOT INDEXED",
 /* 152 */ "using_opt ::= USING LP idlist RP",
 /* 153 */ "using_opt ::=",
 /* 154 */ "orderby_opt ::=",
 /* 155 */ "orderby_opt ::= ORDER BY sortlist",
 /* 156 */ "sortlist ::= sortlist COMMA expr sortorder",
 /* 157 */ "sortlist ::= expr sortorder",

 /* 158 */ "sortorder ::= ASC",
 /* 159 */ "sortorder ::= DESC",
 /* 160 */ "sortorder ::=",
 /* 161 */ "groupby_opt ::=",
 /* 162 */ "groupby_opt ::= GROUP BY nexprlist",
 /* 163 */ "having_opt ::=",
 /* 164 */ "having_opt ::= HAVING expr",
 /* 165 */ "limit_opt ::=",
 /* 166 */ "limit_opt ::= LIMIT expr",
 /* 167 */ "limit_opt ::= LIMIT expr OFFSET expr",
 /* 168 */ "limit_opt ::= LIMIT expr COMMA expr",
 /* 169 */ "cmd ::= with DELETE FROM fullname indexed_opt where_opt",
 /* 170 */ "where_opt ::=",
 /* 171 */ "where_opt ::= WHERE expr",
 /* 172 */ "cmd ::= with UPDATE orconf fullname indexed_opt SET setlist where_opt",
 /* 173 */ "setlist ::= setlist COMMA nm EQ expr",
 /* 174 */ "setlist ::= nm EQ expr",

 /* 175 */ "cmd ::= with insert_cmd INTO fullname inscollist_opt select",
 /* 176 */ "cmd ::= with insert_cmd INTO fullname inscollist_opt DEFAULT VALUES",
 /* 177 */ "insert_cmd ::= INSERT orconf",
 /* 178 */ "insert_cmd ::= REPLACE",


 /* 179 */ "inscollist_opt ::=",
 /* 180 */ "inscollist_opt ::= LP idlist RP",
 /* 181 */ "idlist ::= idlist COMMA nm",
 /* 182 */ "idlist ::= nm",
 /* 183 */ "expr ::= term",
 /* 184 */ "expr ::= LP expr RP",
 /* 185 */ "term ::= NULL",
 /* 186 */ "expr ::= ID|INDEXED",
 /* 187 */ "expr ::= JOIN_KW",
 /* 188 */ "expr ::= nm DOT nm",
 /* 189 */ "expr ::= nm DOT nm DOT nm",
 /* 190 */ "term ::= INTEGER|FLOAT|BLOB",
 /* 191 */ "term ::= STRING",

 /* 192 */ "expr ::= VARIABLE",
 /* 193 */ "expr ::= expr COLLATE ID|STRING",
 /* 194 */ "expr ::= CAST LP expr AS typetoken RP",
 /* 195 */ "expr ::= ID|INDEXED LP distinct exprlist RP",
 /* 196 */ "expr ::= ID|INDEXED LP STAR RP",
 /* 197 */ "term ::= CTIME_KW",
 /* 198 */ "expr ::= expr AND expr",
 /* 199 */ "expr ::= expr OR expr",
 /* 200 */ "expr ::= expr LT|GT|GE|LE expr",
 /* 201 */ "expr ::= expr EQ|NE expr",
 /* 202 */ "expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr",
 /* 203 */ "expr ::= expr PLUS|MINUS expr",
 /* 204 */ "expr ::= expr STAR|SLASH|REM expr",
 /* 205 */ "expr ::= expr CONCAT expr",
 /* 206 */ "likeop ::= LIKE_KW|MATCH",
 /* 207 */ "likeop ::= NOT LIKE_KW|MATCH",
 /* 208 */ "expr ::= expr likeop expr",
 /* 209 */ "expr ::= expr likeop expr ESCAPE expr",
 /* 210 */ "expr ::= expr ISNULL|NOTNULL",
 /* 211 */ "expr ::= expr NOT NULL",
 /* 212 */ "expr ::= expr IS expr",
 /* 213 */ "expr ::= expr IS NOT expr",
 /* 214 */ "expr ::= NOT expr",
 /* 215 */ "expr ::= BITNOT expr",
 /* 216 */ "expr ::= MINUS expr",
 /* 217 */ "expr ::= PLUS expr",





 /* 218 */ "between_op ::= BETWEEN",
 /* 219 */ "between_op ::= NOT BETWEEN",
 /* 220 */ "expr ::= expr between_op expr AND expr",
 /* 221 */ "in_op ::= IN",
 /* 222 */ "in_op ::= NOT IN",
 /* 223 */ "expr ::= expr in_op LP exprlist RP",
 /* 224 */ "expr ::= LP select RP",
 /* 225 */ "expr ::= expr in_op LP select RP",
 /* 226 */ "expr ::= expr in_op nm dbnm",
 /* 227 */ "expr ::= EXISTS LP select RP",
 /* 228 */ "expr ::= CASE case_operand case_exprlist case_else END",
 /* 229 */ "case_exprlist ::= case_exprlist WHEN expr THEN expr",
 /* 230 */ "case_exprlist ::= WHEN expr THEN expr",
 /* 231 */ "case_else ::= ELSE expr",
 /* 232 */ "case_else ::=",
 /* 233 */ "case_operand ::= expr",
 /* 234 */ "case_operand ::=",
 /* 235 */ "exprlist ::= nexprlist",
 /* 236 */ "exprlist ::=",
 /* 237 */ "nexprlist ::= nexprlist COMMA expr",
 /* 238 */ "nexprlist ::= expr",
 /* 239 */ "cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP idxlist RP where_opt",
 /* 240 */ "uniqueflag ::= UNIQUE",
 /* 241 */ "uniqueflag ::=",
 /* 242 */ "idxlist_opt ::=",
 /* 243 */ "idxlist_opt ::= LP idxlist RP",
 /* 244 */ "idxlist ::= idxlist COMMA nm collate sortorder",
 /* 245 */ "idxlist ::= nm collate sortorder",
 /* 246 */ "collate ::=",
 /* 247 */ "collate ::= COLLATE ID|STRING",
 /* 248 */ "cmd ::= DROP INDEX ifexists fullname",
 /* 249 */ "cmd ::= VACUUM",
 /* 250 */ "cmd ::= VACUUM nm",
 /* 251 */ "cmd ::= PRAGMA nm dbnm",
 /* 252 */ "cmd ::= PRAGMA nm dbnm EQ nmnum",
 /* 253 */ "cmd ::= PRAGMA nm dbnm LP nmnum RP",





 /* 254 */ "cmd ::= PRAGMA nm dbnm EQ minus_num",
 /* 255 */ "cmd ::= PRAGMA nm dbnm LP minus_num RP",
 /* 256 */ "nmnum ::= plus_num",
 /* 257 */ "nmnum ::= nm",
 /* 258 */ "nmnum ::= ON",
 /* 259 */ "nmnum ::= DELETE",
 /* 260 */ "nmnum ::= DEFAULT",
 /* 261 */ "plus_num ::= PLUS INTEGER|FLOAT",
 /* 262 */ "plus_num ::= INTEGER|FLOAT",
 /* 263 */ "minus_num ::= MINUS INTEGER|FLOAT",

 /* 264 */ "cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END",
 /* 265 */ "trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause",
 /* 266 */ "trigger_time ::= BEFORE",
 /* 267 */ "trigger_time ::= AFTER",
 /* 268 */ "trigger_time ::= INSTEAD OF",
 /* 269 */ "trigger_time ::=",
 /* 270 */ "trigger_event ::= DELETE|INSERT",
 /* 271 */ "trigger_event ::= UPDATE",
 /* 272 */ "trigger_event ::= UPDATE OF idlist",
 /* 273 */ "foreach_clause ::=",
 /* 274 */ "foreach_clause ::= FOR EACH ROW",
 /* 275 */ "when_clause ::=",
 /* 276 */ "when_clause ::= WHEN expr",
 /* 277 */ "trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI",
 /* 278 */ "trigger_cmd_list ::= trigger_cmd SEMI",
 /* 279 */ "trnm ::= nm",
 /* 280 */ "trnm ::= nm DOT nm",
 /* 281 */ "tridxby ::=",
 /* 282 */ "tridxby ::= INDEXED BY nm",
 /* 283 */ "tridxby ::= NOT INDEXED",
 /* 284 */ "trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist where_opt",

 /* 285 */ "trigger_cmd ::= insert_cmd INTO trnm inscollist_opt select",
 /* 286 */ "trigger_cmd ::= DELETE FROM trnm tridxby where_opt",
 /* 287 */ "trigger_cmd ::= select",
 /* 288 */ "expr ::= RAISE LP IGNORE RP",
 /* 289 */ "expr ::= RAISE LP raisetype COMMA nm RP",
 /* 290 */ "raisetype ::= ROLLBACK",
 /* 291 */ "raisetype ::= ABORT",
 /* 292 */ "raisetype ::= FAIL",
 /* 293 */ "cmd ::= DROP TRIGGER ifexists fullname",
 /* 294 */ "cmd ::= ATTACH database_kw_opt expr AS expr key_opt",
 /* 295 */ "cmd ::= DETACH database_kw_opt expr",
 /* 296 */ "key_opt ::=",
 /* 297 */ "key_opt ::= KEY expr",
 /* 298 */ "database_kw_opt ::= DATABASE",
 /* 299 */ "database_kw_opt ::=",
 /* 300 */ "cmd ::= REINDEX",
 /* 301 */ "cmd ::= REINDEX nm dbnm",
 /* 302 */ "cmd ::= ANALYZE",
 /* 303 */ "cmd ::= ANALYZE nm dbnm",
 /* 304 */ "cmd ::= ALTER TABLE fullname RENAME TO nm",
 /* 305 */ "cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt column",
 /* 306 */ "add_column_fullname ::= fullname",
 /* 307 */ "kwcolumn_opt ::=",
 /* 308 */ "kwcolumn_opt ::= COLUMNKW",
 /* 309 */ "cmd ::= create_vtab",
 /* 310 */ "cmd ::= create_vtab LP vtabarglist RP",
 /* 311 */ "create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm",
 /* 312 */ "vtabarglist ::= vtabarg",
 /* 313 */ "vtabarglist ::= vtabarglist COMMA vtabarg",
 /* 314 */ "vtabarg ::=",
 /* 315 */ "vtabarg ::= vtabarg vtabargtoken",
 /* 316 */ "vtabargtoken ::= ANY",
 /* 317 */ "vtabargtoken ::= lp anylist RP",
 /* 318 */ "lp ::= LP",
 /* 319 */ "anylist ::=",
 /* 320 */ "anylist ::= anylist LP anylist RP",
 /* 321 */ "anylist ::= anylist ANY",
 /* 322 */ "with ::=",
 /* 323 */ "with ::= WITH wqlist",
 /* 324 */ "with ::= WITH RECURSIVE wqlist",
 /* 325 */ "wqlist ::= nm idxlist_opt AS LP select RP",
 /* 326 */ "wqlist ::= wqlist COMMA nm idxlist_opt AS LP select RP",
};
#endif /* NDEBUG */


#if YYSTACKDEPTH<=0
/*
** Try to increase the size of the parser stack.
115470
115471
115472
115473
115474
115475
115476
115477

115478

115479
115480
115481
115482
115483
115484
115485
115486
115487
115488
115489
115490
115491
115492
115493


115494
115495
115496
115497
115498
115499
115500
115501
115502
115503
115504
115505
115506
115507
115508
115509
115510
115511






115512
115513
115514
115515
115516
115517
115518
115519
115520
115521
115522
115523
115524
115525
115526
115527
115528
115529
115530
115531
115532
115533
115534
115535
115536
115537
115538
115539
115540
115541
115542
115543
115544
115545
115546
115547
115548
115549
115550
115551
115552
115553
    ** reduce or during error processing or when a parser is 
    ** being destroyed before it is finished parsing.
    **
    ** Note: during a reduce, the only symbols destroyed are those
    ** which appear on the RHS of the rule, but which are not used
    ** inside the C code.
    */
    case 162: /* select */

    case 196: /* oneselect */

{
sqlite3SelectDelete(pParse->db, (yypminor->yy387));
}
      break;
    case 175: /* term */
    case 176: /* expr */
{
sqlite3ExprDelete(pParse->db, (yypminor->yy118).pExpr);
}
      break;
    case 180: /* idxlist_opt */
    case 189: /* idxlist */
    case 199: /* selcollist */
    case 202: /* groupby_opt */
    case 204: /* orderby_opt */


    case 206: /* sclp */
    case 216: /* sortlist */
    case 217: /* nexprlist */
    case 218: /* setlist */
    case 222: /* exprlist */
    case 227: /* case_exprlist */
{
sqlite3ExprListDelete(pParse->db, (yypminor->yy322));
}
      break;
    case 195: /* fullname */
    case 200: /* from */
    case 208: /* seltablist */
    case 209: /* stl_prefix */
{
sqlite3SrcListDelete(pParse->db, (yypminor->yy259));
}
      break;






    case 201: /* where_opt */
    case 203: /* having_opt */
    case 212: /* on_opt */
    case 226: /* case_operand */
    case 228: /* case_else */
    case 238: /* when_clause */
    case 243: /* key_opt */
{
sqlite3ExprDelete(pParse->db, (yypminor->yy314));
}
      break;
    case 213: /* using_opt */
    case 215: /* idlist */
    case 220: /* inscollist_opt */
{
sqlite3IdListDelete(pParse->db, (yypminor->yy384));
}
      break;
    case 221: /* valuelist */
{

  sqlite3ExprListDelete(pParse->db, (yypminor->yy260).pList);
  sqlite3SelectDelete(pParse->db, (yypminor->yy260).pSelect);

}
      break;
    case 234: /* trigger_cmd_list */
    case 239: /* trigger_cmd */
{
sqlite3DeleteTriggerStep(pParse->db, (yypminor->yy203));
}
      break;
    case 236: /* trigger_event */
{
sqlite3IdListDelete(pParse->db, (yypminor->yy90).b);
}
      break;
    default:  break;   /* If no destructor action specified: do nothing */
  }
}

/*







|
>

>

|


|
|

|


|
|
|
|
|
>
>
|
|
<
|
<
|

|


|
|
|
|

|


>
>
>
>
>
>
|
|
|
|
|



|


|
|
|

|
<
<
<
<
<
<
<
<





|




|







115965
115966
115967
115968
115969
115970
115971
115972
115973
115974
115975
115976
115977
115978
115979
115980
115981
115982
115983
115984
115985
115986
115987
115988
115989
115990
115991
115992
115993
115994

115995

115996
115997
115998
115999
116000
116001
116002
116003
116004
116005
116006
116007
116008
116009
116010
116011
116012
116013
116014
116015
116016
116017
116018
116019
116020
116021
116022
116023
116024
116025
116026
116027
116028
116029
116030








116031
116032
116033
116034
116035
116036
116037
116038
116039
116040
116041
116042
116043
116044
116045
116046
116047
116048
    ** reduce or during error processing or when a parser is 
    ** being destroyed before it is finished parsing.
    **
    ** Note: during a reduce, the only symbols destroyed are those
    ** which appear on the RHS of the rule, but which are not used
    ** inside the C code.
    */
    case 163: /* select */
    case 195: /* selectnowith */
    case 196: /* oneselect */
    case 207: /* values */
{
sqlite3SelectDelete(pParse->db, (yypminor->yy3));
}
      break;
    case 174: /* term */
    case 175: /* expr */
{
sqlite3ExprDelete(pParse->db, (yypminor->yy346).pExpr);
}
      break;
    case 179: /* idxlist_opt */
    case 188: /* idxlist */
    case 200: /* selcollist */
    case 203: /* groupby_opt */
    case 205: /* orderby_opt */
    case 208: /* nexprlist */
    case 209: /* exprlist */
    case 210: /* sclp */
    case 220: /* sortlist */

    case 221: /* setlist */

    case 228: /* case_exprlist */
{
sqlite3ExprListDelete(pParse->db, (yypminor->yy14));
}
      break;
    case 194: /* fullname */
    case 201: /* from */
    case 212: /* seltablist */
    case 213: /* stl_prefix */
{
sqlite3SrcListDelete(pParse->db, (yypminor->yy65));
}
      break;
    case 197: /* with */
    case 252: /* wqlist */
{
sqlite3WithDelete(pParse->db, (yypminor->yy59));
}
      break;
    case 202: /* where_opt */
    case 204: /* having_opt */
    case 216: /* on_opt */
    case 227: /* case_operand */
    case 229: /* case_else */
    case 238: /* when_clause */
    case 243: /* key_opt */
{
sqlite3ExprDelete(pParse->db, (yypminor->yy132));
}
      break;
    case 217: /* using_opt */
    case 219: /* idlist */
    case 223: /* inscollist_opt */
{
sqlite3IdListDelete(pParse->db, (yypminor->yy408));








}
      break;
    case 234: /* trigger_cmd_list */
    case 239: /* trigger_cmd */
{
sqlite3DeleteTriggerStep(pParse->db, (yypminor->yy473));
}
      break;
    case 236: /* trigger_event */
{
sqlite3IdListDelete(pParse->db, (yypminor->yy378).b);
}
      break;
    default:  break;   /* If no destructor action specified: do nothing */
  }
}

/*
115784
115785
115786
115787
115788
115789
115790
115791
115792
115793
115794
115795
115796
115797
115798

115799

115800




115801
115802
115803
115804
115805
115806
115807
115808
115809
115810
115811
115812
115813
115814
115815
115816
115817
115818
115819
115820
115821
115822
115823
115824

115825




115826


115827
115828
115829
115830
115831
115832



115833
115834
115835
115836
115837
115838
115839
115840
115841
115842
115843
115844
115845
115846
115847
115848
115849
115850
115851
115852
115853
115854
115855
115856
115857

115858
115859
115860
115861
115862
115863
115864
115865




115866
115867
115868
115869
115870

115871
115872
115873
115874
115875
115876
115877
115878
115879
115880
115881
115882
115883
115884
115885
115886
115887
115888
115889
115890
115891

115892
115893
115894
115895
115896
115897
115898
115899
115900
115901
115902
115903
115904
115905

115906
115907
115908
115909
115910
115911
115912
115913
115914
115915
115916
115917
115918
115919
115920
115921
115922
115923
115924

115925

115926




115927
115928
115929
115930
115931
115932
115933
115934
115935
115936
115937
115938
115939
115940
115941
115942
115943
115944
115945
115946
115947
115948
115949
115950
115951
115952
115953
115954
115955
115956
115957
115958
115959
115960
115961
115962
115963
115964
115965
115966
115967
115968
115969
115970
115971




115972
115973
115974
115975
115976
115977
115978
115979
115980
115981
115982
115983
115984
115985
115986
115987
115988
115989
115990
115991
115992
115993
115994
115995
115996
115997
115998
115999
116000
116001
116002
116003
116004
116005
116006
116007
116008
116009
116010
116011
116012
116013
116014
116015
116016
116017
116018
116019
116020
116021
116022
116023
116024
116025
116026
116027
116028


116029
116030
116031
116032
116033
116034
116035
116036
116037
116038
116039
116040
116041
116042
116043
116044
116045
116046
116047
116048
116049
116050
116051
116052
116053
116054
116055
116056
116057
116058
116059
116060
116061
116062
116063
116064
116065
116066
116067
116068
/* The following table contains information about every rule that
** is used during the reduce.
*/
static const struct {
  YYCODETYPE lhs;         /* Symbol on the left-hand side of the rule */
  unsigned char nrhs;     /* Number of right-hand side symbols in the rule */
} yyRuleInfo[] = {
  { 143, 1 },
  { 144, 2 },
  { 144, 1 },
  { 145, 1 },
  { 145, 3 },
  { 146, 0 },
  { 146, 1 },
  { 146, 3 },

  { 147, 1 },

  { 148, 3 },




  { 150, 0 },
  { 150, 1 },
  { 150, 2 },
  { 149, 0 },
  { 149, 1 },
  { 149, 1 },
  { 149, 1 },
  { 148, 2 },
  { 148, 2 },
  { 148, 2 },
  { 152, 1 },
  { 152, 0 },
  { 148, 2 },
  { 148, 3 },
  { 148, 5 },
  { 148, 2 },
  { 153, 6 },
  { 155, 1 },
  { 157, 0 },
  { 157, 3 },
  { 156, 1 },
  { 156, 0 },
  { 154, 5 },
  { 154, 2 },

  { 161, 0 },




  { 161, 2 },


  { 159, 3 },
  { 159, 1 },
  { 163, 3 },
  { 164, 1 },
  { 167, 1 },
  { 167, 1 },



  { 168, 1 },
  { 151, 1 },
  { 151, 1 },
  { 151, 1 },
  { 165, 0 },
  { 165, 1 },
  { 169, 1 },
  { 169, 4 },
  { 169, 6 },
  { 170, 1 },
  { 170, 2 },
  { 171, 1 },
  { 171, 1 },
  { 166, 2 },
  { 166, 0 },
  { 174, 2 },
  { 174, 2 },
  { 174, 4 },
  { 174, 3 },
  { 174, 3 },
  { 174, 2 },
  { 174, 2 },
  { 174, 3 },
  { 174, 5 },
  { 174, 2 },

  { 174, 4 },
  { 174, 4 },
  { 174, 1 },
  { 174, 2 },
  { 179, 0 },
  { 179, 1 },
  { 181, 0 },
  { 181, 2 },




  { 183, 2 },
  { 183, 3 },
  { 183, 3 },
  { 183, 3 },
  { 184, 2 },

  { 184, 2 },
  { 184, 1 },
  { 184, 1 },
  { 184, 2 },
  { 182, 3 },
  { 182, 2 },
  { 185, 0 },
  { 185, 2 },
  { 185, 2 },
  { 160, 0 },
  { 160, 2 },
  { 186, 3 },
  { 186, 1 },
  { 187, 1 },
  { 187, 0 },
  { 188, 2 },
  { 188, 7 },
  { 188, 5 },
  { 188, 5 },
  { 188, 10 },
  { 190, 0 },

  { 190, 1 },
  { 177, 0 },
  { 177, 3 },
  { 191, 0 },
  { 191, 2 },
  { 192, 1 },
  { 192, 1 },
  { 192, 1 },
  { 148, 4 },
  { 194, 2 },
  { 194, 0 },
  { 148, 8 },
  { 148, 4 },
  { 148, 1 },

  { 162, 1 },
  { 162, 3 },
  { 197, 1 },
  { 197, 2 },
  { 197, 1 },
  { 196, 9 },
  { 198, 1 },
  { 198, 1 },
  { 198, 0 },
  { 206, 2 },
  { 206, 0 },
  { 199, 3 },
  { 199, 2 },
  { 199, 4 },
  { 207, 2 },
  { 207, 1 },
  { 207, 0 },
  { 200, 0 },
  { 200, 2 },

  { 209, 2 },

  { 209, 0 },




  { 208, 7 },
  { 208, 7 },
  { 208, 7 },
  { 158, 0 },
  { 158, 2 },
  { 195, 2 },
  { 210, 1 },
  { 210, 2 },
  { 210, 3 },
  { 210, 4 },
  { 212, 2 },
  { 212, 0 },
  { 211, 0 },
  { 211, 3 },
  { 211, 2 },
  { 213, 4 },
  { 213, 0 },
  { 204, 0 },
  { 204, 3 },
  { 216, 4 },
  { 216, 2 },
  { 178, 1 },
  { 178, 1 },
  { 178, 0 },
  { 202, 0 },
  { 202, 3 },
  { 203, 0 },
  { 203, 2 },
  { 205, 0 },
  { 205, 2 },
  { 205, 4 },
  { 205, 4 },
  { 148, 5 },
  { 201, 0 },
  { 201, 2 },
  { 148, 7 },
  { 218, 5 },
  { 218, 3 },
  { 148, 5 },
  { 148, 5 },
  { 148, 6 },
  { 219, 2 },
  { 219, 1 },
  { 221, 4 },
  { 221, 5 },




  { 220, 0 },
  { 220, 3 },
  { 215, 3 },
  { 215, 1 },
  { 176, 1 },
  { 176, 3 },
  { 175, 1 },
  { 176, 1 },
  { 176, 1 },
  { 176, 3 },
  { 176, 5 },
  { 175, 1 },
  { 175, 1 },
  { 176, 1 },
  { 176, 1 },
  { 176, 3 },
  { 176, 6 },
  { 176, 5 },
  { 176, 4 },
  { 175, 1 },
  { 176, 3 },
  { 176, 3 },
  { 176, 3 },
  { 176, 3 },
  { 176, 3 },
  { 176, 3 },
  { 176, 3 },
  { 176, 3 },
  { 223, 1 },
  { 223, 2 },
  { 223, 1 },
  { 223, 2 },
  { 176, 3 },
  { 176, 5 },
  { 176, 2 },
  { 176, 3 },
  { 176, 3 },
  { 176, 4 },
  { 176, 2 },
  { 176, 2 },
  { 176, 2 },
  { 176, 2 },
  { 224, 1 },
  { 224, 2 },
  { 176, 5 },
  { 225, 1 },
  { 225, 2 },
  { 176, 5 },
  { 176, 3 },
  { 176, 5 },
  { 176, 4 },
  { 176, 4 },
  { 176, 5 },
  { 227, 5 },
  { 227, 4 },
  { 228, 2 },
  { 228, 0 },


  { 226, 1 },
  { 226, 0 },
  { 222, 1 },
  { 222, 0 },
  { 217, 3 },
  { 217, 1 },
  { 148, 12 },
  { 229, 1 },
  { 229, 0 },
  { 180, 0 },
  { 180, 3 },
  { 189, 5 },
  { 189, 3 },
  { 230, 0 },
  { 230, 2 },
  { 148, 4 },
  { 148, 1 },
  { 148, 2 },
  { 148, 3 },
  { 148, 5 },
  { 148, 6 },
  { 148, 5 },
  { 148, 6 },
  { 231, 1 },
  { 231, 1 },
  { 231, 1 },
  { 231, 1 },
  { 231, 1 },
  { 172, 2 },
  { 172, 1 },
  { 173, 2 },
  { 232, 1 },
  { 148, 5 },
  { 233, 11 },
  { 235, 1 },
  { 235, 1 },
  { 235, 2 },
  { 235, 0 },
  { 236, 1 },
  { 236, 1 },







<
<

|
|
<


>

>
|
>
>
>
>


|
|
|
|
|
<
<
<
|
|
|
|
|
|
<
<
<
<
<
<
<
|
>
|
>
>
>
>
|
>
>
|
|
|
|
|
|
>
>
>

<
<
<
|
|

|
<

|
<
<
|
|
|
|
|
|
|
|
|
|
|
|
>
|
<
|
|
|
|
|
|
>
>
>
>

|
|
|
|
>
|
|
|

|
|
|
|
<
<
<
|
|
|
|
|
|
|
|
|
|
>
|
|
<
|
|
|
<
<
|
|
|
|
|
|
>
|
|
|
|
|

|
<
<
|
|
|
|
|
|
<
|
|

>
|
>
|
>
>
>
>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<
<

|
|
|
<
<
<
|
|
<
|
|
|
|
<
|
|
|
|
>
>
>
>
|
|
|
|
|
|
|
|
|
|
<
|
|
|
|
|
|
|
<
|
|
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<
<
|
|
>
>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<
|







116279
116280
116281
116282
116283
116284
116285


116286
116287
116288

116289
116290
116291
116292
116293
116294
116295
116296
116297
116298
116299
116300
116301
116302
116303
116304
116305



116306
116307
116308
116309
116310
116311







116312
116313
116314
116315
116316
116317
116318
116319
116320
116321
116322
116323
116324
116325
116326
116327
116328
116329
116330
116331



116332
116333
116334
116335

116336
116337


116338
116339
116340
116341
116342
116343
116344
116345
116346
116347
116348
116349
116350
116351

116352
116353
116354
116355
116356
116357
116358
116359
116360
116361
116362
116363
116364
116365
116366
116367
116368
116369
116370
116371
116372
116373
116374
116375



116376
116377
116378
116379
116380
116381
116382
116383
116384
116385
116386
116387
116388

116389
116390
116391


116392
116393
116394
116395
116396
116397
116398
116399
116400
116401
116402
116403
116404
116405


116406
116407
116408
116409
116410
116411

116412
116413
116414
116415
116416
116417
116418
116419
116420
116421
116422
116423
116424
116425
116426
116427
116428
116429
116430
116431
116432
116433
116434
116435
116436
116437
116438
116439
116440
116441
116442
116443
116444
116445
116446


116447
116448
116449
116450



116451
116452

116453
116454
116455
116456

116457
116458
116459
116460
116461
116462
116463
116464
116465
116466
116467
116468
116469
116470
116471
116472
116473
116474

116475
116476
116477
116478
116479
116480
116481

116482
116483

116484
116485
116486
116487
116488
116489
116490
116491
116492
116493
116494
116495
116496
116497
116498
116499
116500
116501
116502
116503
116504
116505
116506
116507
116508
116509
116510
116511
116512
116513
116514


116515
116516
116517
116518
116519
116520
116521
116522
116523
116524
116525
116526
116527
116528
116529
116530
116531
116532
116533
116534
116535
116536
116537
116538
116539
116540
116541
116542
116543
116544
116545
116546
116547
116548
116549

116550
116551
116552
116553
116554
116555
116556
116557
/* The following table contains information about every rule that
** is used during the reduce.
*/
static const struct {
  YYCODETYPE lhs;         /* Symbol on the left-hand side of the rule */
  unsigned char nrhs;     /* Number of right-hand side symbols in the rule */
} yyRuleInfo[] = {


  { 144, 1 },
  { 145, 2 },
  { 145, 1 },

  { 146, 1 },
  { 146, 3 },
  { 147, 0 },
  { 147, 1 },
  { 147, 3 },
  { 148, 1 },
  { 149, 3 },
  { 151, 0 },
  { 151, 1 },
  { 151, 2 },
  { 150, 0 },
  { 150, 1 },
  { 150, 1 },
  { 150, 1 },
  { 149, 2 },
  { 149, 2 },
  { 149, 2 },



  { 153, 1 },
  { 153, 0 },
  { 149, 2 },
  { 149, 3 },
  { 149, 5 },
  { 149, 2 },







  { 154, 6 },
  { 156, 1 },
  { 158, 0 },
  { 158, 3 },
  { 157, 1 },
  { 157, 0 },
  { 155, 5 },
  { 155, 2 },
  { 162, 0 },
  { 162, 2 },
  { 160, 3 },
  { 160, 1 },
  { 164, 3 },
  { 165, 1 },
  { 152, 1 },
  { 152, 1 },
  { 152, 1 },
  { 166, 0 },
  { 166, 1 },
  { 168, 1 },



  { 168, 4 },
  { 168, 6 },
  { 169, 1 },
  { 169, 2 },

  { 170, 1 },
  { 170, 1 },


  { 167, 2 },
  { 167, 0 },
  { 173, 2 },
  { 173, 2 },
  { 173, 4 },
  { 173, 3 },
  { 173, 3 },
  { 173, 2 },
  { 173, 2 },
  { 173, 3 },
  { 173, 5 },
  { 173, 2 },
  { 173, 4 },
  { 173, 4 },

  { 173, 1 },
  { 173, 2 },
  { 178, 0 },
  { 178, 1 },
  { 180, 0 },
  { 180, 2 },
  { 182, 2 },
  { 182, 3 },
  { 182, 3 },
  { 182, 3 },
  { 183, 2 },
  { 183, 2 },
  { 183, 1 },
  { 183, 1 },
  { 183, 2 },
  { 181, 3 },
  { 181, 2 },
  { 184, 0 },
  { 184, 2 },
  { 184, 2 },
  { 161, 0 },
  { 161, 2 },
  { 185, 3 },
  { 185, 1 },



  { 186, 1 },
  { 186, 0 },
  { 187, 2 },
  { 187, 7 },
  { 187, 5 },
  { 187, 5 },
  { 187, 10 },
  { 189, 0 },
  { 189, 1 },
  { 176, 0 },
  { 176, 3 },
  { 190, 0 },
  { 190, 2 },

  { 191, 1 },
  { 191, 1 },
  { 191, 1 },


  { 149, 4 },
  { 193, 2 },
  { 193, 0 },
  { 149, 8 },
  { 149, 4 },
  { 149, 1 },
  { 163, 2 },
  { 195, 1 },
  { 195, 3 },
  { 198, 1 },
  { 198, 2 },
  { 198, 1 },
  { 196, 9 },
  { 196, 1 },


  { 207, 4 },
  { 207, 5 },
  { 199, 1 },
  { 199, 1 },
  { 199, 0 },
  { 210, 2 },

  { 210, 0 },
  { 200, 3 },
  { 200, 2 },
  { 200, 4 },
  { 211, 2 },
  { 211, 1 },
  { 211, 0 },
  { 201, 0 },
  { 201, 2 },
  { 213, 2 },
  { 213, 0 },
  { 212, 7 },
  { 212, 7 },
  { 212, 7 },
  { 159, 0 },
  { 159, 2 },
  { 194, 2 },
  { 214, 1 },
  { 214, 2 },
  { 214, 3 },
  { 214, 4 },
  { 216, 2 },
  { 216, 0 },
  { 215, 0 },
  { 215, 3 },
  { 215, 2 },
  { 217, 4 },
  { 217, 0 },
  { 205, 0 },
  { 205, 3 },
  { 220, 4 },
  { 220, 2 },
  { 177, 1 },
  { 177, 1 },
  { 177, 0 },


  { 203, 0 },
  { 203, 3 },
  { 204, 0 },
  { 204, 2 },



  { 206, 0 },
  { 206, 2 },

  { 206, 4 },
  { 206, 4 },
  { 149, 6 },
  { 202, 0 },

  { 202, 2 },
  { 149, 8 },
  { 221, 5 },
  { 221, 3 },
  { 149, 6 },
  { 149, 7 },
  { 222, 2 },
  { 222, 1 },
  { 223, 0 },
  { 223, 3 },
  { 219, 3 },
  { 219, 1 },
  { 175, 1 },
  { 175, 3 },
  { 174, 1 },
  { 175, 1 },
  { 175, 1 },
  { 175, 3 },

  { 175, 5 },
  { 174, 1 },
  { 174, 1 },
  { 175, 1 },
  { 175, 3 },
  { 175, 6 },
  { 175, 5 },

  { 175, 4 },
  { 174, 1 },

  { 175, 3 },
  { 175, 3 },
  { 175, 3 },
  { 175, 3 },
  { 175, 3 },
  { 175, 3 },
  { 175, 3 },
  { 175, 3 },
  { 224, 1 },
  { 224, 2 },
  { 175, 3 },
  { 175, 5 },
  { 175, 2 },
  { 175, 3 },
  { 175, 3 },
  { 175, 4 },
  { 175, 2 },
  { 175, 2 },
  { 175, 2 },
  { 175, 2 },
  { 225, 1 },
  { 225, 2 },
  { 175, 5 },
  { 226, 1 },
  { 226, 2 },
  { 175, 5 },
  { 175, 3 },
  { 175, 5 },
  { 175, 4 },
  { 175, 4 },
  { 175, 5 },


  { 228, 5 },
  { 228, 4 },
  { 229, 2 },
  { 229, 0 },
  { 227, 1 },
  { 227, 0 },
  { 209, 1 },
  { 209, 0 },
  { 208, 3 },
  { 208, 1 },
  { 149, 12 },
  { 230, 1 },
  { 230, 0 },
  { 179, 0 },
  { 179, 3 },
  { 188, 5 },
  { 188, 3 },
  { 231, 0 },
  { 231, 2 },
  { 149, 4 },
  { 149, 1 },
  { 149, 2 },
  { 149, 3 },
  { 149, 5 },
  { 149, 6 },
  { 149, 5 },
  { 149, 6 },
  { 232, 1 },
  { 232, 1 },
  { 232, 1 },
  { 232, 1 },
  { 232, 1 },
  { 171, 2 },
  { 171, 1 },
  { 172, 2 },

  { 149, 5 },
  { 233, 11 },
  { 235, 1 },
  { 235, 1 },
  { 235, 2 },
  { 235, 0 },
  { 236, 1 },
  { 236, 1 },
116077
116078
116079
116080
116081
116082
116083
116084
116085
116086
116087
116088
116089
116090
116091
116092
116093
116094
116095
116096
116097
116098
116099
116100
116101
116102
116103
116104
116105
116106
116107
116108
116109
116110
116111
116112
116113
116114
116115
116116
116117
116118
116119





116120
116121
116122
116123
116124
116125
116126
  { 240, 3 },
  { 241, 0 },
  { 241, 3 },
  { 241, 2 },
  { 239, 7 },
  { 239, 5 },
  { 239, 5 },
  { 239, 5 },
  { 239, 1 },
  { 176, 4 },
  { 176, 6 },
  { 193, 1 },
  { 193, 1 },
  { 193, 1 },
  { 148, 4 },
  { 148, 6 },
  { 148, 3 },
  { 243, 0 },
  { 243, 2 },
  { 242, 1 },
  { 242, 0 },
  { 148, 1 },
  { 148, 3 },
  { 148, 1 },
  { 148, 3 },
  { 148, 6 },
  { 148, 6 },
  { 244, 1 },
  { 245, 0 },
  { 245, 1 },
  { 148, 1 },
  { 148, 4 },
  { 246, 8 },
  { 247, 1 },
  { 247, 3 },
  { 248, 0 },
  { 248, 2 },
  { 249, 1 },
  { 249, 3 },
  { 250, 1 },
  { 251, 0 },
  { 251, 4 },
  { 251, 2 },





};

static void yy_accept(yyParser*);  /* Forward Declaration */

/*
** Perform a reduce action and the shift that must immediately
** follow the reduce.







<

|
|
|
|
|
|
|
|




|
|
|
|
|
|



|
|











>
>
>
>
>







116566
116567
116568
116569
116570
116571
116572

116573
116574
116575
116576
116577
116578
116579
116580
116581
116582
116583
116584
116585
116586
116587
116588
116589
116590
116591
116592
116593
116594
116595
116596
116597
116598
116599
116600
116601
116602
116603
116604
116605
116606
116607
116608
116609
116610
116611
116612
116613
116614
116615
116616
116617
116618
116619
  { 240, 3 },
  { 241, 0 },
  { 241, 3 },
  { 241, 2 },
  { 239, 7 },
  { 239, 5 },
  { 239, 5 },

  { 239, 1 },
  { 175, 4 },
  { 175, 6 },
  { 192, 1 },
  { 192, 1 },
  { 192, 1 },
  { 149, 4 },
  { 149, 6 },
  { 149, 3 },
  { 243, 0 },
  { 243, 2 },
  { 242, 1 },
  { 242, 0 },
  { 149, 1 },
  { 149, 3 },
  { 149, 1 },
  { 149, 3 },
  { 149, 6 },
  { 149, 6 },
  { 244, 1 },
  { 245, 0 },
  { 245, 1 },
  { 149, 1 },
  { 149, 4 },
  { 246, 8 },
  { 247, 1 },
  { 247, 3 },
  { 248, 0 },
  { 248, 2 },
  { 249, 1 },
  { 249, 3 },
  { 250, 1 },
  { 251, 0 },
  { 251, 4 },
  { 251, 2 },
  { 197, 0 },
  { 197, 2 },
  { 197, 3 },
  { 252, 6 },
  { 252, 8 },
};

static void yy_accept(yyParser*);  /* Forward Declaration */

/*
** Perform a reduce action and the shift that must immediately
** follow the reduce.
116180
116181
116182
116183
116184
116185
116186
116187
116188
116189
116190
116191
116192
116193
116194
116195
116196
116197
116198
116199
116200
116201
116202
116203
116204
      case 7: /* explain ::= EXPLAIN QUERY PLAN */
{ sqlite3BeginParse(pParse, 2); }
        break;
      case 8: /* cmdx ::= cmd */
{ sqlite3FinishCoding(pParse); }
        break;
      case 9: /* cmd ::= BEGIN transtype trans_opt */
{sqlite3BeginTransaction(pParse, yymsp[-1].minor.yy4);}
        break;
      case 13: /* transtype ::= */
{yygotominor.yy4 = TK_DEFERRED;}
        break;
      case 14: /* transtype ::= DEFERRED */
      case 15: /* transtype ::= IMMEDIATE */ yytestcase(yyruleno==15);
      case 16: /* transtype ::= EXCLUSIVE */ yytestcase(yyruleno==16);
      case 117: /* multiselect_op ::= UNION */ yytestcase(yyruleno==117);
      case 119: /* multiselect_op ::= EXCEPT|INTERSECT */ yytestcase(yyruleno==119);
{yygotominor.yy4 = yymsp[0].major;}
        break;
      case 17: /* cmd ::= COMMIT trans_opt */
      case 18: /* cmd ::= END trans_opt */ yytestcase(yyruleno==18);
{sqlite3CommitTransaction(pParse);}
        break;
      case 19: /* cmd ::= ROLLBACK trans_opt */
{sqlite3RollbackTransaction(pParse);}







|


|




|
|
|







116673
116674
116675
116676
116677
116678
116679
116680
116681
116682
116683
116684
116685
116686
116687
116688
116689
116690
116691
116692
116693
116694
116695
116696
116697
      case 7: /* explain ::= EXPLAIN QUERY PLAN */
{ sqlite3BeginParse(pParse, 2); }
        break;
      case 8: /* cmdx ::= cmd */
{ sqlite3FinishCoding(pParse); }
        break;
      case 9: /* cmd ::= BEGIN transtype trans_opt */
{sqlite3BeginTransaction(pParse, yymsp[-1].minor.yy328);}
        break;
      case 13: /* transtype ::= */
{yygotominor.yy328 = TK_DEFERRED;}
        break;
      case 14: /* transtype ::= DEFERRED */
      case 15: /* transtype ::= IMMEDIATE */ yytestcase(yyruleno==15);
      case 16: /* transtype ::= EXCLUSIVE */ yytestcase(yyruleno==16);
      case 115: /* multiselect_op ::= UNION */ yytestcase(yyruleno==115);
      case 117: /* multiselect_op ::= EXCEPT|INTERSECT */ yytestcase(yyruleno==117);
{yygotominor.yy328 = yymsp[0].major;}
        break;
      case 17: /* cmd ::= COMMIT trans_opt */
      case 18: /* cmd ::= END trans_opt */ yytestcase(yyruleno==18);
{sqlite3CommitTransaction(pParse);}
        break;
      case 19: /* cmd ::= ROLLBACK trans_opt */
{sqlite3RollbackTransaction(pParse);}
116216
116217
116218
116219
116220
116221
116222
116223
116224
116225
116226
116227
116228
116229
116230
116231
116232
116233
116234
116235
116236
116237
116238
116239
116240
116241
116242
116243
116244
116245
116246
116247
116248
116249
116250
116251
116252
116253
116254
116255
116256
116257
116258
116259
116260
116261
116262
116263
116264
116265
116266
116267
116268
116269
116270
116271
116272
116273
116274
116275
116276
116277
116278
116279
116280
116281
116282
116283
116284
116285
116286
116287
116288
116289
116290
116291
116292
116293
116294
116295
116296
116297
116298
116299
116300
116301
116302
116303
116304
116305
116306
116307
116308
116309
116310
116311
116312
116313
116314
116315
116316
116317
116318
116319
116320
116321
116322
116323
116324
116325
116326
116327
116328
116329
116330
116331
116332
116333
116334
116335
116336
116337
116338
116339
116340
116341
116342
116343
116344
116345
116346
116347
116348
116349
116350
116351
116352
116353
116354
116355
116356
116357
116358
116359
116360
116361
116362
116363
116364
116365
116366
116367
116368
116369
116370
116371
116372
116373
116374
116375
116376
116377
116378
116379
116380
116381
116382
116383
116384
116385
116386
116387
116388
116389
116390
116391
116392
116393
116394
116395
116396
116397
116398
116399
116400
116401
116402
116403
116404
116405
116406
116407
116408
116409
116410
116411
116412
116413
116414
116415
116416
116417
116418
116419
116420
116421
116422
116423
116424
116425
116426
116427
116428
116429
116430
116431
116432
116433
116434
116435
116436
116437
116438
116439
116440
116441
116442
116443
116444
116445
116446
116447
116448
116449
116450
116451
116452
116453
116454
116455
116456
116457
116458
116459
116460
116461
116462
116463
116464
116465
116466
116467
116468
116469
116470
116471
116472
116473
116474
116475
116476
116477
116478
116479
116480
116481
116482

116483






116484




116485
116486
116487
116488
116489
116490
116491
116492
116493
116494
116495
116496
116497
116498
116499
116500
116501





116502
116503
116504












116505
116506
116507
116508
116509
116510
116511
116512
116513
116514
116515
116516
116517
116518
116519
116520
116521
116522
116523
116524
116525
116526
116527
116528
116529
116530
116531
116532
116533
116534
116535
116536
116537
116538
116539
116540
116541
116542
116543
116544
116545
116546
116547
116548
116549
116550
116551
116552
116553
116554
116555
116556
116557
116558
116559
116560
116561
116562
116563
116564
116565
116566
116567
116568
116569
116570
116571
116572
116573
116574
116575
116576
116577
116578
116579
116580
116581
116582
116583
116584
116585
116586
116587
116588
116589
116590
116591
116592
116593
116594
116595
116596
116597
116598
116599
116600
116601
116602
116603
116604
116605
116606
116607
116608
116609
116610
116611
116612
116613
116614
116615
116616
116617
116618
116619
116620
116621
116622
116623
116624
116625
116626
116627
116628
116629
116630
116631
116632
116633
116634
116635
116636
116637
116638
116639
116640
116641
116642
116643
116644
116645
116646
116647
116648
116649
116650
116651
116652
116653
116654
116655
116656
116657
116658
116659
116660
116661
116662
116663
116664
116665
116666
116667
116668
116669
116670
116671
116672
116673
116674
116675
116676
116677
116678
116679
116680
116681

116682
116683
116684
116685
116686
116687

116688
116689
116690
116691
116692
116693
116694
116695
116696
116697
116698
116699
116700
116701
116702
116703
116704
116705

116706
116707
116708
116709

116710
116711


116712

116713
116714
116715
116716
116717
116718
116719
116720
116721
116722
116723
116724
116725
116726
116727
116728
116729
116730
116731
116732
116733
116734
116735
116736
116737
116738
116739
116740
116741
116742
116743
116744
116745
116746
116747
116748
116749
116750
116751
116752
116753
116754
116755
116756
116757
116758
116759
116760
116761
116762
116763
116764
116765
116766
116767
116768
116769
116770
116771
116772
116773
116774
116775
116776
116777
116778
116779
116780
116781
116782
116783
116784
116785
116786
116787

116788
116789
116790
116791
116792
116793
116794
116795
116796
116797
116798
116799
116800
116801
116802
116803
116804

116805
116806
116807
116808
116809
116810
116811
116812
116813
116814
116815
116816
116817
116818
116819
116820
116821
116822
116823
116824
116825
116826
116827
116828
116829
116830
116831
116832
116833
116834
116835
116836
116837
116838
116839
116840
116841
116842
116843
116844
116845
116846
116847
116848
116849
116850
116851
116852
116853
116854
116855
116856
116857
116858
116859
116860
116861
116862
116863
116864
116865
116866
116867
116868
116869
116870
116871
116872
116873
116874
116875
116876
116877
116878
116879
116880
116881
116882
116883
116884
116885
116886
116887
116888
116889
116890
116891
116892
116893
116894
116895
116896
116897
116898
116899
116900
116901
116902
116903
116904
116905
116906
116907
116908
116909
116910
116911
116912
116913
116914
116915
116916
116917
116918
116919
116920
116921
116922
116923
116924
116925
116926
116927
116928
116929
116930
116931
116932
116933
116934
116935
116936
116937
116938
116939
116940
116941
116942
116943
116944
116945
116946
116947
116948
116949
116950
116951
116952
116953
116954
116955
116956
116957
116958
116959
116960
116961
116962
116963
116964
116965
116966
116967
116968
116969
116970
116971
116972
116973
116974
116975
116976
116977
116978
116979
116980
116981
116982
116983
116984
116985
116986
116987
116988
116989
116990
116991
116992
116993
116994
116995
116996
116997
116998
116999
117000
117001
117002
117003
117004
117005
117006
117007
117008
117009
117010
117011
117012
117013
117014
117015
117016
117017
117018
117019
117020
117021
117022
117023
117024
117025
117026
117027
117028
117029
117030
117031
117032
117033
117034
117035
117036
117037
117038
117039
117040
117041
117042
117043
117044
117045
117046
117047
117048
117049
117050
117051
117052
117053
117054
117055
117056
117057
117058
117059
117060
117061
117062
117063
117064
117065
117066
117067
117068
117069
117070
117071
117072
117073
117074
117075
117076
117077
117078
117079
117080
117081
117082
117083
117084
117085
117086
117087
117088
117089
117090
117091
117092
117093
117094
117095
117096
117097
117098
117099
117100
117101
117102
117103
117104
117105
117106
117107
117108
117109
117110
117111
117112
117113
117114
117115
117116
117117
117118
117119
117120
117121
117122
117123
117124
117125
117126
117127
117128
117129
117130
117131
117132
117133
117134
117135
117136
117137
117138
117139
117140
117141
117142
117143
117144
117145
117146
117147
117148
117149
117150
117151
117152
117153
117154
117155
117156
117157
117158
117159
117160
117161
117162
117163
117164
117165
117166
117167
117168
117169
117170
117171
117172
117173
117174
117175
117176
117177
117178
117179
117180
117181
117182
117183
117184
117185
117186
117187
117188
117189
117190
117191
117192
117193
117194
117195
117196
117197
117198
117199
117200
117201
117202
117203
117204
117205
117206
117207
117208
117209
117210
117211
117212
117213
117214
117215
117216
117217
117218
117219
117220
117221
117222
117223
117224
117225
117226
117227
117228
117229
117230
117231
117232
117233
117234
117235
117236
117237
117238
117239
117240
117241
117242
117243
117244
117245
117246
117247
117248
117249
117250
117251
117252
117253
117254
117255
117256
117257
117258
117259
117260
117261
117262
117263
117264
117265
117266
117267
117268
117269
117270
117271
117272
117273
117274
117275
117276
117277
117278
117279
117280
117281
117282
117283

















117284
117285
117286
117287
117288
117289
117290
117291
117292
117293
117294
117295
117296
117297
117298
117299
117300
117301
117302
117303
117304
117305
117306
117307
117308
117309
117310
117311
117312
117313
117314
117315
117316
117317
117318
117319
117320
117321
117322
117323
117324
117325
117326
117327
      case 24: /* cmd ::= ROLLBACK trans_opt TO savepoint_opt nm */
{
  sqlite3Savepoint(pParse, SAVEPOINT_ROLLBACK, &yymsp[0].minor.yy0);
}
        break;
      case 26: /* create_table ::= createkw temp TABLE ifnotexists nm dbnm */
{
   sqlite3StartTable(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,yymsp[-4].minor.yy4,0,0,yymsp[-2].minor.yy4);
}
        break;
      case 27: /* createkw ::= CREATE */
{
  pParse->db->lookaside.bEnabled = 0;
  yygotominor.yy0 = yymsp[0].minor.yy0;
}
        break;
      case 28: /* ifnotexists ::= */
      case 31: /* temp ::= */ yytestcase(yyruleno==31);
      case 71: /* autoinc ::= */ yytestcase(yyruleno==71);
      case 84: /* defer_subclause ::= NOT DEFERRABLE init_deferred_pred_opt */ yytestcase(yyruleno==84);
      case 86: /* init_deferred_pred_opt ::= */ yytestcase(yyruleno==86);
      case 88: /* init_deferred_pred_opt ::= INITIALLY IMMEDIATE */ yytestcase(yyruleno==88);
      case 100: /* defer_subclause_opt ::= */ yytestcase(yyruleno==100);
      case 111: /* ifexists ::= */ yytestcase(yyruleno==111);
      case 223: /* between_op ::= BETWEEN */ yytestcase(yyruleno==223);
      case 226: /* in_op ::= IN */ yytestcase(yyruleno==226);
{yygotominor.yy4 = 0;}
        break;
      case 29: /* ifnotexists ::= IF NOT EXISTS */
      case 30: /* temp ::= TEMP */ yytestcase(yyruleno==30);
      case 72: /* autoinc ::= AUTOINCR */ yytestcase(yyruleno==72);
      case 87: /* init_deferred_pred_opt ::= INITIALLY DEFERRED */ yytestcase(yyruleno==87);
      case 110: /* ifexists ::= IF EXISTS */ yytestcase(yyruleno==110);
      case 224: /* between_op ::= NOT BETWEEN */ yytestcase(yyruleno==224);
      case 227: /* in_op ::= NOT IN */ yytestcase(yyruleno==227);
{yygotominor.yy4 = 1;}
        break;
      case 32: /* create_table_args ::= LP columnlist conslist_opt RP table_options */
{
  sqlite3EndTable(pParse,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0,yymsp[0].minor.yy210,0);
}
        break;
      case 33: /* create_table_args ::= AS select */
{
  sqlite3EndTable(pParse,0,0,0,yymsp[0].minor.yy387);
  sqlite3SelectDelete(pParse->db, yymsp[0].minor.yy387);
}
        break;
      case 34: /* table_options ::= */
{yygotominor.yy210 = 0;}
        break;
      case 35: /* table_options ::= WITHOUT nm */
{
  if( yymsp[0].minor.yy0.n==5 && sqlite3_strnicmp(yymsp[0].minor.yy0.z,"rowid",5)==0 ){
    yygotominor.yy210 = TF_WithoutRowid;
  }else{
    yygotominor.yy210 = 0;
    sqlite3ErrorMsg(pParse, "unknown table option: %.*s", yymsp[0].minor.yy0.n, yymsp[0].minor.yy0.z);
  }
}
        break;
      case 38: /* column ::= columnid type carglist */
{
  yygotominor.yy0.z = yymsp[-2].minor.yy0.z;
  yygotominor.yy0.n = (int)(pParse->sLastToken.z-yymsp[-2].minor.yy0.z) + pParse->sLastToken.n;
}
        break;
      case 39: /* columnid ::= nm */
{
  sqlite3AddColumn(pParse,&yymsp[0].minor.yy0);
  yygotominor.yy0 = yymsp[0].minor.yy0;
  pParse->constraintName.n = 0;
}
        break;
      case 40: /* id ::= ID */
      case 41: /* id ::= INDEXED */ yytestcase(yyruleno==41);
      case 42: /* ids ::= ID|STRING */ yytestcase(yyruleno==42);
      case 43: /* nm ::= id */ yytestcase(yyruleno==43);
      case 44: /* nm ::= STRING */ yytestcase(yyruleno==44);
      case 45: /* nm ::= JOIN_KW */ yytestcase(yyruleno==45);
      case 48: /* typetoken ::= typename */ yytestcase(yyruleno==48);
      case 51: /* typename ::= ids */ yytestcase(yyruleno==51);
      case 129: /* as ::= AS nm */ yytestcase(yyruleno==129);
      case 130: /* as ::= ids */ yytestcase(yyruleno==130);
      case 140: /* dbnm ::= DOT nm */ yytestcase(yyruleno==140);
      case 149: /* indexed_opt ::= INDEXED BY nm */ yytestcase(yyruleno==149);
      case 252: /* collate ::= COLLATE ids */ yytestcase(yyruleno==252);
      case 261: /* nmnum ::= plus_num */ yytestcase(yyruleno==261);
      case 262: /* nmnum ::= nm */ yytestcase(yyruleno==262);
      case 263: /* nmnum ::= ON */ yytestcase(yyruleno==263);
      case 264: /* nmnum ::= DELETE */ yytestcase(yyruleno==264);
      case 265: /* nmnum ::= DEFAULT */ yytestcase(yyruleno==265);
      case 266: /* plus_num ::= PLUS number */ yytestcase(yyruleno==266);
      case 267: /* plus_num ::= number */ yytestcase(yyruleno==267);
      case 268: /* minus_num ::= MINUS number */ yytestcase(yyruleno==268);
      case 269: /* number ::= INTEGER|FLOAT */ yytestcase(yyruleno==269);
      case 285: /* trnm ::= nm */ yytestcase(yyruleno==285);
{yygotominor.yy0 = yymsp[0].minor.yy0;}
        break;
      case 47: /* type ::= typetoken */
{sqlite3AddColumnType(pParse,&yymsp[0].minor.yy0);}
        break;
      case 49: /* typetoken ::= typename LP signed RP */
{
  yygotominor.yy0.z = yymsp[-3].minor.yy0.z;
  yygotominor.yy0.n = (int)(&yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n] - yymsp[-3].minor.yy0.z);
}
        break;
      case 50: /* typetoken ::= typename LP signed COMMA signed RP */
{
  yygotominor.yy0.z = yymsp[-5].minor.yy0.z;
  yygotominor.yy0.n = (int)(&yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n] - yymsp[-5].minor.yy0.z);
}
        break;
      case 52: /* typename ::= typename ids */
{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);}
        break;
      case 57: /* ccons ::= CONSTRAINT nm */
      case 95: /* tcons ::= CONSTRAINT nm */ yytestcase(yyruleno==95);
{pParse->constraintName = yymsp[0].minor.yy0;}
        break;
      case 58: /* ccons ::= DEFAULT term */
      case 60: /* ccons ::= DEFAULT PLUS term */ yytestcase(yyruleno==60);
{sqlite3AddDefaultValue(pParse,&yymsp[0].minor.yy118);}
        break;
      case 59: /* ccons ::= DEFAULT LP expr RP */
{sqlite3AddDefaultValue(pParse,&yymsp[-1].minor.yy118);}
        break;
      case 61: /* ccons ::= DEFAULT MINUS term */
{
  ExprSpan v;
  v.pExpr = sqlite3PExpr(pParse, TK_UMINUS, yymsp[0].minor.yy118.pExpr, 0, 0);
  v.zStart = yymsp[-1].minor.yy0.z;
  v.zEnd = yymsp[0].minor.yy118.zEnd;
  sqlite3AddDefaultValue(pParse,&v);
}
        break;
      case 62: /* ccons ::= DEFAULT id */
{
  ExprSpan v;
  spanExpr(&v, pParse, TK_STRING, &yymsp[0].minor.yy0);
  sqlite3AddDefaultValue(pParse,&v);
}
        break;
      case 64: /* ccons ::= NOT NULL onconf */
{sqlite3AddNotNull(pParse, yymsp[0].minor.yy4);}
        break;
      case 65: /* ccons ::= PRIMARY KEY sortorder onconf autoinc */
{sqlite3AddPrimaryKey(pParse,0,yymsp[-1].minor.yy4,yymsp[0].minor.yy4,yymsp[-2].minor.yy4);}
        break;
      case 66: /* ccons ::= UNIQUE onconf */
{sqlite3CreateIndex(pParse,0,0,0,0,yymsp[0].minor.yy4,0,0,0,0);}
        break;
      case 67: /* ccons ::= CHECK LP expr RP */
{sqlite3AddCheckConstraint(pParse,yymsp[-1].minor.yy118.pExpr);}
        break;
      case 68: /* ccons ::= REFERENCES nm idxlist_opt refargs */
{sqlite3CreateForeignKey(pParse,0,&yymsp[-2].minor.yy0,yymsp[-1].minor.yy322,yymsp[0].minor.yy4);}
        break;
      case 69: /* ccons ::= defer_subclause */
{sqlite3DeferForeignKey(pParse,yymsp[0].minor.yy4);}
        break;
      case 70: /* ccons ::= COLLATE ids */
{sqlite3AddCollateType(pParse, &yymsp[0].minor.yy0);}
        break;
      case 73: /* refargs ::= */
{ yygotominor.yy4 = OE_None*0x0101; /* EV: R-19803-45884 */}
        break;
      case 74: /* refargs ::= refargs refarg */
{ yygotominor.yy4 = (yymsp[-1].minor.yy4 & ~yymsp[0].minor.yy215.mask) | yymsp[0].minor.yy215.value; }
        break;
      case 75: /* refarg ::= MATCH nm */
      case 76: /* refarg ::= ON INSERT refact */ yytestcase(yyruleno==76);
{ yygotominor.yy215.value = 0;     yygotominor.yy215.mask = 0x000000; }
        break;
      case 77: /* refarg ::= ON DELETE refact */
{ yygotominor.yy215.value = yymsp[0].minor.yy4;     yygotominor.yy215.mask = 0x0000ff; }
        break;
      case 78: /* refarg ::= ON UPDATE refact */
{ yygotominor.yy215.value = yymsp[0].minor.yy4<<8;  yygotominor.yy215.mask = 0x00ff00; }
        break;
      case 79: /* refact ::= SET NULL */
{ yygotominor.yy4 = OE_SetNull;  /* EV: R-33326-45252 */}
        break;
      case 80: /* refact ::= SET DEFAULT */
{ yygotominor.yy4 = OE_SetDflt;  /* EV: R-33326-45252 */}
        break;
      case 81: /* refact ::= CASCADE */
{ yygotominor.yy4 = OE_Cascade;  /* EV: R-33326-45252 */}
        break;
      case 82: /* refact ::= RESTRICT */
{ yygotominor.yy4 = OE_Restrict; /* EV: R-33326-45252 */}
        break;
      case 83: /* refact ::= NO ACTION */
{ yygotominor.yy4 = OE_None;     /* EV: R-33326-45252 */}
        break;
      case 85: /* defer_subclause ::= DEFERRABLE init_deferred_pred_opt */
      case 101: /* defer_subclause_opt ::= defer_subclause */ yytestcase(yyruleno==101);
      case 103: /* onconf ::= ON CONFLICT resolvetype */ yytestcase(yyruleno==103);
      case 106: /* resolvetype ::= raisetype */ yytestcase(yyruleno==106);
{yygotominor.yy4 = yymsp[0].minor.yy4;}
        break;
      case 89: /* conslist_opt ::= */
{yygotominor.yy0.n = 0; yygotominor.yy0.z = 0;}
        break;
      case 90: /* conslist_opt ::= COMMA conslist */
{yygotominor.yy0 = yymsp[-1].minor.yy0;}
        break;
      case 93: /* tconscomma ::= COMMA */
{pParse->constraintName.n = 0;}
        break;
      case 96: /* tcons ::= PRIMARY KEY LP idxlist autoinc RP onconf */
{sqlite3AddPrimaryKey(pParse,yymsp[-3].minor.yy322,yymsp[0].minor.yy4,yymsp[-2].minor.yy4,0);}
        break;
      case 97: /* tcons ::= UNIQUE LP idxlist RP onconf */
{sqlite3CreateIndex(pParse,0,0,0,yymsp[-2].minor.yy322,yymsp[0].minor.yy4,0,0,0,0);}
        break;
      case 98: /* tcons ::= CHECK LP expr RP onconf */
{sqlite3AddCheckConstraint(pParse,yymsp[-2].minor.yy118.pExpr);}
        break;
      case 99: /* tcons ::= FOREIGN KEY LP idxlist RP REFERENCES nm idxlist_opt refargs defer_subclause_opt */
{
    sqlite3CreateForeignKey(pParse, yymsp[-6].minor.yy322, &yymsp[-3].minor.yy0, yymsp[-2].minor.yy322, yymsp[-1].minor.yy4);
    sqlite3DeferForeignKey(pParse, yymsp[0].minor.yy4);
}
        break;
      case 102: /* onconf ::= */
{yygotominor.yy4 = OE_Default;}
        break;
      case 104: /* orconf ::= */
{yygotominor.yy210 = OE_Default;}
        break;
      case 105: /* orconf ::= OR resolvetype */
{yygotominor.yy210 = (u8)yymsp[0].minor.yy4;}
        break;
      case 107: /* resolvetype ::= IGNORE */
{yygotominor.yy4 = OE_Ignore;}
        break;
      case 108: /* resolvetype ::= REPLACE */
{yygotominor.yy4 = OE_Replace;}
        break;
      case 109: /* cmd ::= DROP TABLE ifexists fullname */
{
  sqlite3DropTable(pParse, yymsp[0].minor.yy259, 0, yymsp[-1].minor.yy4);
}
        break;
      case 112: /* cmd ::= createkw temp VIEW ifnotexists nm dbnm AS select */
{
  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);
}
        break;
      case 113: /* cmd ::= DROP VIEW ifexists fullname */
{
  sqlite3DropTable(pParse, yymsp[0].minor.yy259, 1, yymsp[-1].minor.yy4);
}
        break;
      case 114: /* cmd ::= select */
{
  SelectDest dest = {SRT_Output, 0, 0, 0, 0};
  sqlite3Select(pParse, yymsp[0].minor.yy387, &dest);
  sqlite3ExplainBegin(pParse->pVdbe);
  sqlite3ExplainSelect(pParse->pVdbe, yymsp[0].minor.yy387);
  sqlite3ExplainFinish(pParse->pVdbe);
  sqlite3SelectDelete(pParse->db, yymsp[0].minor.yy387);
}
        break;
      case 115: /* select ::= oneselect */

{yygotominor.yy387 = yymsp[0].minor.yy387;}






        break;




      case 116: /* select ::= select multiselect_op oneselect */
{
  if( yymsp[0].minor.yy387 ){
    yymsp[0].minor.yy387->op = (u8)yymsp[-1].minor.yy4;
    yymsp[0].minor.yy387->pPrior = yymsp[-2].minor.yy387;
    if( yymsp[-1].minor.yy4!=TK_ALL ) pParse->hasCompound = 1;
  }else{
    sqlite3SelectDelete(pParse->db, yymsp[-2].minor.yy387);
  }
  yygotominor.yy387 = yymsp[0].minor.yy387;
}
        break;
      case 118: /* multiselect_op ::= UNION ALL */
{yygotominor.yy4 = TK_ALL;}
        break;
      case 120: /* oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt orderby_opt limit_opt */
{





  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);
}
        break;












      case 121: /* distinct ::= DISTINCT */
{yygotominor.yy177 = SF_Distinct;}
        break;
      case 122: /* distinct ::= ALL */
      case 123: /* distinct ::= */ yytestcase(yyruleno==123);
{yygotominor.yy177 = 0;}
        break;
      case 124: /* sclp ::= selcollist COMMA */
      case 248: /* idxlist_opt ::= LP idxlist RP */ yytestcase(yyruleno==248);
{yygotominor.yy322 = yymsp[-1].minor.yy322;}
        break;
      case 125: /* sclp ::= */
      case 153: /* orderby_opt ::= */ yytestcase(yyruleno==153);
      case 160: /* groupby_opt ::= */ yytestcase(yyruleno==160);
      case 241: /* exprlist ::= */ yytestcase(yyruleno==241);
      case 247: /* idxlist_opt ::= */ yytestcase(yyruleno==247);
{yygotominor.yy322 = 0;}
        break;
      case 126: /* selcollist ::= sclp expr as */
{
   yygotominor.yy322 = sqlite3ExprListAppend(pParse, yymsp[-2].minor.yy322, yymsp[-1].minor.yy118.pExpr);
   if( yymsp[0].minor.yy0.n>0 ) sqlite3ExprListSetName(pParse, yygotominor.yy322, &yymsp[0].minor.yy0, 1);
   sqlite3ExprListSetSpan(pParse,yygotominor.yy322,&yymsp[-1].minor.yy118);
}
        break;
      case 127: /* selcollist ::= sclp STAR */
{
  Expr *p = sqlite3Expr(pParse->db, TK_ALL, 0);
  yygotominor.yy322 = sqlite3ExprListAppend(pParse, yymsp[-1].minor.yy322, p);
}
        break;
      case 128: /* selcollist ::= sclp nm DOT STAR */
{
  Expr *pRight = sqlite3PExpr(pParse, TK_ALL, 0, 0, &yymsp[0].minor.yy0);
  Expr *pLeft = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-2].minor.yy0);
  Expr *pDot = sqlite3PExpr(pParse, TK_DOT, pLeft, pRight, 0);
  yygotominor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-3].minor.yy322, pDot);
}
        break;
      case 131: /* as ::= */
{yygotominor.yy0.n = 0;}
        break;
      case 132: /* from ::= */
{yygotominor.yy259 = sqlite3DbMallocZero(pParse->db, sizeof(*yygotominor.yy259));}
        break;
      case 133: /* from ::= FROM seltablist */
{
  yygotominor.yy259 = yymsp[0].minor.yy259;
  sqlite3SrcListShiftJoinType(yygotominor.yy259);
}
        break;
      case 134: /* stl_prefix ::= seltablist joinop */
{
   yygotominor.yy259 = yymsp[-1].minor.yy259;
   if( ALWAYS(yygotominor.yy259 && yygotominor.yy259->nSrc>0) ) yygotominor.yy259->a[yygotominor.yy259->nSrc-1].jointype = (u8)yymsp[0].minor.yy4;
}
        break;
      case 135: /* stl_prefix ::= */
{yygotominor.yy259 = 0;}
        break;
      case 136: /* seltablist ::= stl_prefix nm dbnm as indexed_opt on_opt using_opt */
{
  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);
  sqlite3SrcListIndexedBy(pParse, yygotominor.yy259, &yymsp[-2].minor.yy0);
}
        break;
      case 137: /* seltablist ::= stl_prefix LP select RP as on_opt using_opt */
{
    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);
  }
        break;
      case 138: /* seltablist ::= stl_prefix LP seltablist RP as on_opt using_opt */
{
    if( yymsp[-6].minor.yy259==0 && yymsp[-2].minor.yy0.n==0 && yymsp[-1].minor.yy314==0 && yymsp[0].minor.yy384==0 ){
      yygotominor.yy259 = yymsp[-4].minor.yy259;
    }else if( yymsp[-4].minor.yy259->nSrc==1 ){
      yygotominor.yy259 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy259,0,0,&yymsp[-2].minor.yy0,0,yymsp[-1].minor.yy314,yymsp[0].minor.yy384);
      if( yygotominor.yy259 ){
        struct SrcList_item *pNew = &yygotominor.yy259->a[yygotominor.yy259->nSrc-1];
        struct SrcList_item *pOld = yymsp[-4].minor.yy259->a;
        pNew->zName = pOld->zName;
        pNew->zDatabase = pOld->zDatabase;
        pNew->pSelect = pOld->pSelect;
        pOld->zName = pOld->zDatabase = 0;
        pOld->pSelect = 0;
      }
      sqlite3SrcListDelete(pParse->db, yymsp[-4].minor.yy259);
    }else{
      Select *pSubquery;
      sqlite3SrcListShiftJoinType(yymsp[-4].minor.yy259);
      pSubquery = sqlite3SelectNew(pParse,0,yymsp[-4].minor.yy259,0,0,0,0,SF_NestedFrom,0,0);
      yygotominor.yy259 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy259,0,0,&yymsp[-2].minor.yy0,pSubquery,yymsp[-1].minor.yy314,yymsp[0].minor.yy384);
    }
  }
        break;
      case 139: /* dbnm ::= */
      case 148: /* indexed_opt ::= */ yytestcase(yyruleno==148);
{yygotominor.yy0.z=0; yygotominor.yy0.n=0;}
        break;
      case 141: /* fullname ::= nm dbnm */
{yygotominor.yy259 = sqlite3SrcListAppend(pParse->db,0,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0);}
        break;
      case 142: /* joinop ::= COMMA|JOIN */
{ yygotominor.yy4 = JT_INNER; }
        break;
      case 143: /* joinop ::= JOIN_KW JOIN */
{ yygotominor.yy4 = sqlite3JoinType(pParse,&yymsp[-1].minor.yy0,0,0); }
        break;
      case 144: /* joinop ::= JOIN_KW nm JOIN */
{ yygotominor.yy4 = sqlite3JoinType(pParse,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0,0); }
        break;
      case 145: /* joinop ::= JOIN_KW nm nm JOIN */
{ yygotominor.yy4 = sqlite3JoinType(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0); }
        break;
      case 146: /* on_opt ::= ON expr */
      case 163: /* having_opt ::= HAVING expr */ yytestcase(yyruleno==163);
      case 170: /* where_opt ::= WHERE expr */ yytestcase(yyruleno==170);
      case 236: /* case_else ::= ELSE expr */ yytestcase(yyruleno==236);
      case 238: /* case_operand ::= expr */ yytestcase(yyruleno==238);
{yygotominor.yy314 = yymsp[0].minor.yy118.pExpr;}
        break;
      case 147: /* on_opt ::= */
      case 162: /* having_opt ::= */ yytestcase(yyruleno==162);
      case 169: /* where_opt ::= */ yytestcase(yyruleno==169);
      case 237: /* case_else ::= */ yytestcase(yyruleno==237);
      case 239: /* case_operand ::= */ yytestcase(yyruleno==239);
{yygotominor.yy314 = 0;}
        break;
      case 150: /* indexed_opt ::= NOT INDEXED */
{yygotominor.yy0.z=0; yygotominor.yy0.n=1;}
        break;
      case 151: /* using_opt ::= USING LP idlist RP */
      case 182: /* inscollist_opt ::= LP idlist RP */ yytestcase(yyruleno==182);
{yygotominor.yy384 = yymsp[-1].minor.yy384;}
        break;
      case 152: /* using_opt ::= */
      case 181: /* inscollist_opt ::= */ yytestcase(yyruleno==181);
{yygotominor.yy384 = 0;}
        break;
      case 154: /* orderby_opt ::= ORDER BY sortlist */
      case 161: /* groupby_opt ::= GROUP BY nexprlist */ yytestcase(yyruleno==161);
      case 240: /* exprlist ::= nexprlist */ yytestcase(yyruleno==240);
{yygotominor.yy322 = yymsp[0].minor.yy322;}
        break;
      case 155: /* sortlist ::= sortlist COMMA expr sortorder */
{
  yygotominor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-3].minor.yy322,yymsp[-1].minor.yy118.pExpr);
  if( yygotominor.yy322 ) yygotominor.yy322->a[yygotominor.yy322->nExpr-1].sortOrder = (u8)yymsp[0].minor.yy4;
}
        break;
      case 156: /* sortlist ::= expr sortorder */
{
  yygotominor.yy322 = sqlite3ExprListAppend(pParse,0,yymsp[-1].minor.yy118.pExpr);
  if( yygotominor.yy322 && ALWAYS(yygotominor.yy322->a) ) yygotominor.yy322->a[0].sortOrder = (u8)yymsp[0].minor.yy4;
}
        break;
      case 157: /* sortorder ::= ASC */
      case 159: /* sortorder ::= */ yytestcase(yyruleno==159);
{yygotominor.yy4 = SQLITE_SO_ASC;}
        break;
      case 158: /* sortorder ::= DESC */
{yygotominor.yy4 = SQLITE_SO_DESC;}
        break;
      case 164: /* limit_opt ::= */
{yygotominor.yy292.pLimit = 0; yygotominor.yy292.pOffset = 0;}
        break;
      case 165: /* limit_opt ::= LIMIT expr */
{yygotominor.yy292.pLimit = yymsp[0].minor.yy118.pExpr; yygotominor.yy292.pOffset = 0;}
        break;
      case 166: /* limit_opt ::= LIMIT expr OFFSET expr */
{yygotominor.yy292.pLimit = yymsp[-2].minor.yy118.pExpr; yygotominor.yy292.pOffset = yymsp[0].minor.yy118.pExpr;}
        break;
      case 167: /* limit_opt ::= LIMIT expr COMMA expr */
{yygotominor.yy292.pOffset = yymsp[-2].minor.yy118.pExpr; yygotominor.yy292.pLimit = yymsp[0].minor.yy118.pExpr;}
        break;
      case 168: /* cmd ::= DELETE FROM fullname indexed_opt where_opt */
{

  sqlite3SrcListIndexedBy(pParse, yymsp[-2].minor.yy259, &yymsp[-1].minor.yy0);
  sqlite3DeleteFrom(pParse,yymsp[-2].minor.yy259,yymsp[0].minor.yy314);
}
        break;
      case 171: /* cmd ::= UPDATE orconf fullname indexed_opt SET setlist where_opt */
{

  sqlite3SrcListIndexedBy(pParse, yymsp[-4].minor.yy259, &yymsp[-3].minor.yy0);
  sqlite3ExprListCheckLength(pParse,yymsp[-1].minor.yy322,"set list"); 
  sqlite3Update(pParse,yymsp[-4].minor.yy259,yymsp[-1].minor.yy322,yymsp[0].minor.yy314,yymsp[-5].minor.yy210);
}
        break;
      case 172: /* setlist ::= setlist COMMA nm EQ expr */
{
  yygotominor.yy322 = sqlite3ExprListAppend(pParse, yymsp[-4].minor.yy322, yymsp[0].minor.yy118.pExpr);
  sqlite3ExprListSetName(pParse, yygotominor.yy322, &yymsp[-2].minor.yy0, 1);
}
        break;
      case 173: /* setlist ::= nm EQ expr */
{
  yygotominor.yy322 = sqlite3ExprListAppend(pParse, 0, yymsp[0].minor.yy118.pExpr);
  sqlite3ExprListSetName(pParse, yygotominor.yy322, &yymsp[-2].minor.yy0, 1);
}
        break;
      case 174: /* cmd ::= insert_cmd INTO fullname inscollist_opt valuelist */

{sqlite3Insert(pParse, yymsp[-2].minor.yy259, yymsp[0].minor.yy260.pList, yymsp[0].minor.yy260.pSelect, yymsp[-1].minor.yy384, yymsp[-4].minor.yy210);}
        break;
      case 175: /* cmd ::= insert_cmd INTO fullname inscollist_opt select */
{sqlite3Insert(pParse, yymsp[-2].minor.yy259, 0, yymsp[0].minor.yy387, yymsp[-1].minor.yy384, yymsp[-4].minor.yy210);}

        break;
      case 176: /* cmd ::= insert_cmd INTO fullname inscollist_opt DEFAULT VALUES */


{sqlite3Insert(pParse, yymsp[-3].minor.yy259, 0, 0, yymsp[-2].minor.yy384, yymsp[-5].minor.yy210);}

        break;
      case 177: /* insert_cmd ::= INSERT orconf */
{yygotominor.yy210 = yymsp[0].minor.yy210;}
        break;
      case 178: /* insert_cmd ::= REPLACE */
{yygotominor.yy210 = OE_Replace;}
        break;
      case 179: /* valuelist ::= VALUES LP nexprlist RP */
{
  yygotominor.yy260.pList = yymsp[-1].minor.yy322;
  yygotominor.yy260.pSelect = 0;
}
        break;
      case 180: /* valuelist ::= valuelist COMMA LP exprlist RP */
{
  Select *pRight = sqlite3SelectNew(pParse, yymsp[-1].minor.yy322, 0, 0, 0, 0, 0, 0, 0, 0);
  if( yymsp[-4].minor.yy260.pList ){
    yymsp[-4].minor.yy260.pSelect = sqlite3SelectNew(pParse, yymsp[-4].minor.yy260.pList, 0, 0, 0, 0, 0, 0, 0, 0);
    yymsp[-4].minor.yy260.pList = 0;
  }
  yygotominor.yy260.pList = 0;
  if( yymsp[-4].minor.yy260.pSelect==0 || pRight==0 ){
    sqlite3SelectDelete(pParse->db, pRight);
    sqlite3SelectDelete(pParse->db, yymsp[-4].minor.yy260.pSelect);
    yygotominor.yy260.pSelect = 0;
  }else{
    pRight->op = TK_ALL;
    pRight->pPrior = yymsp[-4].minor.yy260.pSelect;
    pRight->selFlags |= SF_Values;
    pRight->pPrior->selFlags |= SF_Values;
    yygotominor.yy260.pSelect = pRight;
  }
}
        break;
      case 183: /* idlist ::= idlist COMMA nm */
{yygotominor.yy384 = sqlite3IdListAppend(pParse->db,yymsp[-2].minor.yy384,&yymsp[0].minor.yy0);}
        break;
      case 184: /* idlist ::= nm */
{yygotominor.yy384 = sqlite3IdListAppend(pParse->db,0,&yymsp[0].minor.yy0);}
        break;
      case 185: /* expr ::= term */
{yygotominor.yy118 = yymsp[0].minor.yy118;}
        break;
      case 186: /* expr ::= LP expr RP */
{yygotominor.yy118.pExpr = yymsp[-1].minor.yy118.pExpr; spanSet(&yygotominor.yy118,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0);}
        break;
      case 187: /* term ::= NULL */
      case 192: /* term ::= INTEGER|FLOAT|BLOB */ yytestcase(yyruleno==192);
      case 193: /* term ::= STRING */ yytestcase(yyruleno==193);
{spanExpr(&yygotominor.yy118, pParse, yymsp[0].major, &yymsp[0].minor.yy0);}
        break;
      case 188: /* expr ::= id */
      case 189: /* expr ::= JOIN_KW */ yytestcase(yyruleno==189);
{spanExpr(&yygotominor.yy118, pParse, TK_ID, &yymsp[0].minor.yy0);}
        break;
      case 190: /* expr ::= nm DOT nm */
{
  Expr *temp1 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-2].minor.yy0);
  Expr *temp2 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[0].minor.yy0);
  yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_DOT, temp1, temp2, 0);
  spanSet(&yygotominor.yy118,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0);
}
        break;
      case 191: /* expr ::= nm DOT nm DOT nm */
{
  Expr *temp1 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-4].minor.yy0);
  Expr *temp2 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-2].minor.yy0);
  Expr *temp3 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[0].minor.yy0);
  Expr *temp4 = sqlite3PExpr(pParse, TK_DOT, temp2, temp3, 0);
  yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_DOT, temp1, temp4, 0);
  spanSet(&yygotominor.yy118,&yymsp[-4].minor.yy0,&yymsp[0].minor.yy0);
}
        break;
      case 194: /* expr ::= REGISTER */
{

  /* When doing a nested parse, one can include terms in an expression
  ** that look like this:   #1 #2 ...  These terms refer to registers
  ** in the virtual machine.  #N is the N-th register. */
  if( pParse->nested==0 ){
    sqlite3ErrorMsg(pParse, "near \"%T\": syntax error", &yymsp[0].minor.yy0);
    yygotominor.yy118.pExpr = 0;
  }else{
    yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_REGISTER, 0, 0, &yymsp[0].minor.yy0);
    if( yygotominor.yy118.pExpr ) sqlite3GetInt32(&yymsp[0].minor.yy0.z[1], &yygotominor.yy118.pExpr->iTable);
  }
  spanSet(&yygotominor.yy118, &yymsp[0].minor.yy0, &yymsp[0].minor.yy0);
}
        break;
      case 195: /* expr ::= VARIABLE */
{
  spanExpr(&yygotominor.yy118, pParse, TK_VARIABLE, &yymsp[0].minor.yy0);
  sqlite3ExprAssignVarNumber(pParse, yygotominor.yy118.pExpr);

  spanSet(&yygotominor.yy118, &yymsp[0].minor.yy0, &yymsp[0].minor.yy0);
}
        break;
      case 196: /* expr ::= expr COLLATE ids */
{
  yygotominor.yy118.pExpr = sqlite3ExprAddCollateToken(pParse, yymsp[-2].minor.yy118.pExpr, &yymsp[0].minor.yy0);
  yygotominor.yy118.zStart = yymsp[-2].minor.yy118.zStart;
  yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
}
        break;
      case 197: /* expr ::= CAST LP expr AS typetoken RP */
{
  yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_CAST, yymsp[-3].minor.yy118.pExpr, 0, &yymsp[-1].minor.yy0);
  spanSet(&yygotominor.yy118,&yymsp[-5].minor.yy0,&yymsp[0].minor.yy0);
}
        break;
      case 198: /* expr ::= ID LP distinct exprlist RP */
{
  if( yymsp[-1].minor.yy322 && yymsp[-1].minor.yy322->nExpr>pParse->db->aLimit[SQLITE_LIMIT_FUNCTION_ARG] ){
    sqlite3ErrorMsg(pParse, "too many arguments on function %T", &yymsp[-4].minor.yy0);
  }
  yygotominor.yy118.pExpr = sqlite3ExprFunction(pParse, yymsp[-1].minor.yy322, &yymsp[-4].minor.yy0);
  spanSet(&yygotominor.yy118,&yymsp[-4].minor.yy0,&yymsp[0].minor.yy0);
  if( yymsp[-2].minor.yy177 && yygotominor.yy118.pExpr ){
    yygotominor.yy118.pExpr->flags |= EP_Distinct;
  }
}
        break;
      case 199: /* expr ::= ID LP STAR RP */
{
  yygotominor.yy118.pExpr = sqlite3ExprFunction(pParse, 0, &yymsp[-3].minor.yy0);
  spanSet(&yygotominor.yy118,&yymsp[-3].minor.yy0,&yymsp[0].minor.yy0);
}
        break;
      case 200: /* term ::= CTIME_KW */
{
  yygotominor.yy118.pExpr = sqlite3ExprFunction(pParse, 0, &yymsp[0].minor.yy0);
  spanSet(&yygotominor.yy118, &yymsp[0].minor.yy0, &yymsp[0].minor.yy0);
}
        break;
      case 201: /* expr ::= expr AND expr */
      case 202: /* expr ::= expr OR expr */ yytestcase(yyruleno==202);
      case 203: /* expr ::= expr LT|GT|GE|LE expr */ yytestcase(yyruleno==203);
      case 204: /* expr ::= expr EQ|NE expr */ yytestcase(yyruleno==204);
      case 205: /* expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr */ yytestcase(yyruleno==205);
      case 206: /* expr ::= expr PLUS|MINUS expr */ yytestcase(yyruleno==206);
      case 207: /* expr ::= expr STAR|SLASH|REM expr */ yytestcase(yyruleno==207);
      case 208: /* expr ::= expr CONCAT expr */ yytestcase(yyruleno==208);
{spanBinaryExpr(&yygotominor.yy118,pParse,yymsp[-1].major,&yymsp[-2].minor.yy118,&yymsp[0].minor.yy118);}
        break;
      case 209: /* likeop ::= LIKE_KW */
      case 211: /* likeop ::= MATCH */ yytestcase(yyruleno==211);
{yygotominor.yy342.eOperator = yymsp[0].minor.yy0; yygotominor.yy342.bNot = 0;}
        break;
      case 210: /* likeop ::= NOT LIKE_KW */
      case 212: /* likeop ::= NOT MATCH */ yytestcase(yyruleno==212);
{yygotominor.yy342.eOperator = yymsp[0].minor.yy0; yygotominor.yy342.bNot = 1;}
        break;
      case 213: /* expr ::= expr likeop expr */
{
  ExprList *pList;
  pList = sqlite3ExprListAppend(pParse,0, yymsp[0].minor.yy118.pExpr);
  pList = sqlite3ExprListAppend(pParse,pList, yymsp[-2].minor.yy118.pExpr);
  yygotominor.yy118.pExpr = sqlite3ExprFunction(pParse, pList, &yymsp[-1].minor.yy342.eOperator);
  if( yymsp[-1].minor.yy342.bNot ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0);
  yygotominor.yy118.zStart = yymsp[-2].minor.yy118.zStart;
  yygotominor.yy118.zEnd = yymsp[0].minor.yy118.zEnd;
  if( yygotominor.yy118.pExpr ) yygotominor.yy118.pExpr->flags |= EP_InfixFunc;
}
        break;
      case 214: /* expr ::= expr likeop expr ESCAPE expr */
{
  ExprList *pList;
  pList = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy118.pExpr);
  pList = sqlite3ExprListAppend(pParse,pList, yymsp[-4].minor.yy118.pExpr);
  pList = sqlite3ExprListAppend(pParse,pList, yymsp[0].minor.yy118.pExpr);
  yygotominor.yy118.pExpr = sqlite3ExprFunction(pParse, pList, &yymsp[-3].minor.yy342.eOperator);
  if( yymsp[-3].minor.yy342.bNot ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0);
  yygotominor.yy118.zStart = yymsp[-4].minor.yy118.zStart;
  yygotominor.yy118.zEnd = yymsp[0].minor.yy118.zEnd;
  if( yygotominor.yy118.pExpr ) yygotominor.yy118.pExpr->flags |= EP_InfixFunc;
}
        break;
      case 215: /* expr ::= expr ISNULL|NOTNULL */
{spanUnaryPostfix(&yygotominor.yy118,pParse,yymsp[0].major,&yymsp[-1].minor.yy118,&yymsp[0].minor.yy0);}
        break;
      case 216: /* expr ::= expr NOT NULL */
{spanUnaryPostfix(&yygotominor.yy118,pParse,TK_NOTNULL,&yymsp[-2].minor.yy118,&yymsp[0].minor.yy0);}
        break;
      case 217: /* expr ::= expr IS expr */
{
  spanBinaryExpr(&yygotominor.yy118,pParse,TK_IS,&yymsp[-2].minor.yy118,&yymsp[0].minor.yy118);
  binaryToUnaryIfNull(pParse, yymsp[0].minor.yy118.pExpr, yygotominor.yy118.pExpr, TK_ISNULL);
}
        break;
      case 218: /* expr ::= expr IS NOT expr */
{
  spanBinaryExpr(&yygotominor.yy118,pParse,TK_ISNOT,&yymsp[-3].minor.yy118,&yymsp[0].minor.yy118);
  binaryToUnaryIfNull(pParse, yymsp[0].minor.yy118.pExpr, yygotominor.yy118.pExpr, TK_NOTNULL);
}
        break;
      case 219: /* expr ::= NOT expr */
      case 220: /* expr ::= BITNOT expr */ yytestcase(yyruleno==220);
{spanUnaryPrefix(&yygotominor.yy118,pParse,yymsp[-1].major,&yymsp[0].minor.yy118,&yymsp[-1].minor.yy0);}
        break;
      case 221: /* expr ::= MINUS expr */
{spanUnaryPrefix(&yygotominor.yy118,pParse,TK_UMINUS,&yymsp[0].minor.yy118,&yymsp[-1].minor.yy0);}
        break;
      case 222: /* expr ::= PLUS expr */
{spanUnaryPrefix(&yygotominor.yy118,pParse,TK_UPLUS,&yymsp[0].minor.yy118,&yymsp[-1].minor.yy0);}
        break;
      case 225: /* expr ::= expr between_op expr AND expr */
{
  ExprList *pList = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy118.pExpr);
  pList = sqlite3ExprListAppend(pParse,pList, yymsp[0].minor.yy118.pExpr);
  yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_BETWEEN, yymsp[-4].minor.yy118.pExpr, 0, 0);
  if( yygotominor.yy118.pExpr ){
    yygotominor.yy118.pExpr->x.pList = pList;
  }else{
    sqlite3ExprListDelete(pParse->db, pList);
  } 
  if( yymsp[-3].minor.yy4 ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0);
  yygotominor.yy118.zStart = yymsp[-4].minor.yy118.zStart;
  yygotominor.yy118.zEnd = yymsp[0].minor.yy118.zEnd;
}
        break;
      case 228: /* expr ::= expr in_op LP exprlist RP */
{
    if( yymsp[-1].minor.yy322==0 ){
      /* Expressions of the form
      **
      **      expr1 IN ()
      **      expr1 NOT IN ()
      **
      ** simplify to constants 0 (false) and 1 (true), respectively,
      ** regardless of the value of expr1.
      */
      yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_INTEGER, 0, 0, &sqlite3IntTokens[yymsp[-3].minor.yy4]);
      sqlite3ExprDelete(pParse->db, yymsp[-4].minor.yy118.pExpr);
    }else{
      yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy118.pExpr, 0, 0);
      if( yygotominor.yy118.pExpr ){
        yygotominor.yy118.pExpr->x.pList = yymsp[-1].minor.yy322;
        sqlite3ExprSetHeight(pParse, yygotominor.yy118.pExpr);
      }else{
        sqlite3ExprListDelete(pParse->db, yymsp[-1].minor.yy322);
      }
      if( yymsp[-3].minor.yy4 ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0);
    }
    yygotominor.yy118.zStart = yymsp[-4].minor.yy118.zStart;
    yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
  }
        break;
      case 229: /* expr ::= LP select RP */
{
    yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_SELECT, 0, 0, 0);
    if( yygotominor.yy118.pExpr ){
      yygotominor.yy118.pExpr->x.pSelect = yymsp[-1].minor.yy387;
      ExprSetProperty(yygotominor.yy118.pExpr, EP_xIsSelect);
      sqlite3ExprSetHeight(pParse, yygotominor.yy118.pExpr);
    }else{
      sqlite3SelectDelete(pParse->db, yymsp[-1].minor.yy387);
    }
    yygotominor.yy118.zStart = yymsp[-2].minor.yy0.z;
    yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
  }
        break;
      case 230: /* expr ::= expr in_op LP select RP */
{
    yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy118.pExpr, 0, 0);
    if( yygotominor.yy118.pExpr ){
      yygotominor.yy118.pExpr->x.pSelect = yymsp[-1].minor.yy387;
      ExprSetProperty(yygotominor.yy118.pExpr, EP_xIsSelect);
      sqlite3ExprSetHeight(pParse, yygotominor.yy118.pExpr);
    }else{
      sqlite3SelectDelete(pParse->db, yymsp[-1].minor.yy387);
    }
    if( yymsp[-3].minor.yy4 ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0);
    yygotominor.yy118.zStart = yymsp[-4].minor.yy118.zStart;
    yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
  }
        break;
      case 231: /* expr ::= expr in_op nm dbnm */
{
    SrcList *pSrc = sqlite3SrcListAppend(pParse->db, 0,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0);
    yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_IN, yymsp[-3].minor.yy118.pExpr, 0, 0);
    if( yygotominor.yy118.pExpr ){
      yygotominor.yy118.pExpr->x.pSelect = sqlite3SelectNew(pParse, 0,pSrc,0,0,0,0,0,0,0);
      ExprSetProperty(yygotominor.yy118.pExpr, EP_xIsSelect);
      sqlite3ExprSetHeight(pParse, yygotominor.yy118.pExpr);
    }else{
      sqlite3SrcListDelete(pParse->db, pSrc);
    }
    if( yymsp[-2].minor.yy4 ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0);
    yygotominor.yy118.zStart = yymsp[-3].minor.yy118.zStart;
    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];
  }
        break;
      case 232: /* expr ::= EXISTS LP select RP */
{
    Expr *p = yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_EXISTS, 0, 0, 0);
    if( p ){
      p->x.pSelect = yymsp[-1].minor.yy387;
      ExprSetProperty(p, EP_xIsSelect);
      sqlite3ExprSetHeight(pParse, p);
    }else{
      sqlite3SelectDelete(pParse->db, yymsp[-1].minor.yy387);
    }
    yygotominor.yy118.zStart = yymsp[-3].minor.yy0.z;
    yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
  }
        break;
      case 233: /* expr ::= CASE case_operand case_exprlist case_else END */
{
  yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_CASE, yymsp[-3].minor.yy314, 0, 0);
  if( yygotominor.yy118.pExpr ){
    yygotominor.yy118.pExpr->x.pList = yymsp[-1].minor.yy314 ? sqlite3ExprListAppend(pParse,yymsp[-2].minor.yy322,yymsp[-1].minor.yy314) : yymsp[-2].minor.yy322;
    sqlite3ExprSetHeight(pParse, yygotominor.yy118.pExpr);
  }else{
    sqlite3ExprListDelete(pParse->db, yymsp[-2].minor.yy322);
    sqlite3ExprDelete(pParse->db, yymsp[-1].minor.yy314);
  }
  yygotominor.yy118.zStart = yymsp[-4].minor.yy0.z;
  yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
}
        break;
      case 234: /* case_exprlist ::= case_exprlist WHEN expr THEN expr */
{
  yygotominor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy322, yymsp[-2].minor.yy118.pExpr);
  yygotominor.yy322 = sqlite3ExprListAppend(pParse,yygotominor.yy322, yymsp[0].minor.yy118.pExpr);
}
        break;
      case 235: /* case_exprlist ::= WHEN expr THEN expr */
{
  yygotominor.yy322 = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy118.pExpr);
  yygotominor.yy322 = sqlite3ExprListAppend(pParse,yygotominor.yy322, yymsp[0].minor.yy118.pExpr);
}
        break;
      case 242: /* nexprlist ::= nexprlist COMMA expr */
{yygotominor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-2].minor.yy322,yymsp[0].minor.yy118.pExpr);}
        break;
      case 243: /* nexprlist ::= expr */
{yygotominor.yy322 = sqlite3ExprListAppend(pParse,0,yymsp[0].minor.yy118.pExpr);}
        break;
      case 244: /* cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP idxlist RP where_opt */
{
  sqlite3CreateIndex(pParse, &yymsp[-7].minor.yy0, &yymsp[-6].minor.yy0, 
                     sqlite3SrcListAppend(pParse->db,0,&yymsp[-4].minor.yy0,0), yymsp[-2].minor.yy322, yymsp[-10].minor.yy4,
                      &yymsp[-11].minor.yy0, yymsp[0].minor.yy314, SQLITE_SO_ASC, yymsp[-8].minor.yy4);
}
        break;
      case 245: /* uniqueflag ::= UNIQUE */
      case 298: /* raisetype ::= ABORT */ yytestcase(yyruleno==298);
{yygotominor.yy4 = OE_Abort;}
        break;
      case 246: /* uniqueflag ::= */
{yygotominor.yy4 = OE_None;}
        break;
      case 249: /* idxlist ::= idxlist COMMA nm collate sortorder */
{
  Expr *p = sqlite3ExprAddCollateToken(pParse, 0, &yymsp[-1].minor.yy0);
  yygotominor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy322, p);
  sqlite3ExprListSetName(pParse,yygotominor.yy322,&yymsp[-2].minor.yy0,1);
  sqlite3ExprListCheckLength(pParse, yygotominor.yy322, "index");
  if( yygotominor.yy322 ) yygotominor.yy322->a[yygotominor.yy322->nExpr-1].sortOrder = (u8)yymsp[0].minor.yy4;
}
        break;
      case 250: /* idxlist ::= nm collate sortorder */
{
  Expr *p = sqlite3ExprAddCollateToken(pParse, 0, &yymsp[-1].minor.yy0);
  yygotominor.yy322 = sqlite3ExprListAppend(pParse,0, p);
  sqlite3ExprListSetName(pParse, yygotominor.yy322, &yymsp[-2].minor.yy0, 1);
  sqlite3ExprListCheckLength(pParse, yygotominor.yy322, "index");
  if( yygotominor.yy322 ) yygotominor.yy322->a[yygotominor.yy322->nExpr-1].sortOrder = (u8)yymsp[0].minor.yy4;
}
        break;
      case 251: /* collate ::= */
{yygotominor.yy0.z = 0; yygotominor.yy0.n = 0;}
        break;
      case 253: /* cmd ::= DROP INDEX ifexists fullname */
{sqlite3DropIndex(pParse, yymsp[0].minor.yy259, yymsp[-1].minor.yy4);}
        break;
      case 254: /* cmd ::= VACUUM */
      case 255: /* cmd ::= VACUUM nm */ yytestcase(yyruleno==255);
{sqlite3Vacuum(pParse);}
        break;
      case 256: /* cmd ::= PRAGMA nm dbnm */
{sqlite3Pragma(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,0,0);}
        break;
      case 257: /* cmd ::= PRAGMA nm dbnm EQ nmnum */
{sqlite3Pragma(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0,0);}
        break;
      case 258: /* cmd ::= PRAGMA nm dbnm LP nmnum RP */
{sqlite3Pragma(pParse,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,&yymsp[-1].minor.yy0,0);}
        break;
      case 259: /* cmd ::= PRAGMA nm dbnm EQ minus_num */
{sqlite3Pragma(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0,1);}
        break;
      case 260: /* cmd ::= PRAGMA nm dbnm LP minus_num RP */
{sqlite3Pragma(pParse,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,&yymsp[-1].minor.yy0,1);}
        break;
      case 270: /* cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END */
{
  Token all;
  all.z = yymsp[-3].minor.yy0.z;
  all.n = (int)(yymsp[0].minor.yy0.z - yymsp[-3].minor.yy0.z) + yymsp[0].minor.yy0.n;
  sqlite3FinishTrigger(pParse, yymsp[-1].minor.yy203, &all);
}
        break;
      case 271: /* trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause */
{
  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);
  yygotominor.yy0 = (yymsp[-6].minor.yy0.n==0?yymsp[-7].minor.yy0:yymsp[-6].minor.yy0);
}
        break;
      case 272: /* trigger_time ::= BEFORE */
      case 275: /* trigger_time ::= */ yytestcase(yyruleno==275);
{ yygotominor.yy4 = TK_BEFORE; }
        break;
      case 273: /* trigger_time ::= AFTER */
{ yygotominor.yy4 = TK_AFTER;  }
        break;
      case 274: /* trigger_time ::= INSTEAD OF */
{ yygotominor.yy4 = TK_INSTEAD;}
        break;
      case 276: /* trigger_event ::= DELETE|INSERT */
      case 277: /* trigger_event ::= UPDATE */ yytestcase(yyruleno==277);
{yygotominor.yy90.a = yymsp[0].major; yygotominor.yy90.b = 0;}
        break;
      case 278: /* trigger_event ::= UPDATE OF idlist */
{yygotominor.yy90.a = TK_UPDATE; yygotominor.yy90.b = yymsp[0].minor.yy384;}
        break;
      case 281: /* when_clause ::= */
      case 303: /* key_opt ::= */ yytestcase(yyruleno==303);
{ yygotominor.yy314 = 0; }
        break;
      case 282: /* when_clause ::= WHEN expr */
      case 304: /* key_opt ::= KEY expr */ yytestcase(yyruleno==304);
{ yygotominor.yy314 = yymsp[0].minor.yy118.pExpr; }
        break;
      case 283: /* trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI */
{
  assert( yymsp[-2].minor.yy203!=0 );
  yymsp[-2].minor.yy203->pLast->pNext = yymsp[-1].minor.yy203;
  yymsp[-2].minor.yy203->pLast = yymsp[-1].minor.yy203;
  yygotominor.yy203 = yymsp[-2].minor.yy203;
}
        break;
      case 284: /* trigger_cmd_list ::= trigger_cmd SEMI */
{ 
  assert( yymsp[-1].minor.yy203!=0 );
  yymsp[-1].minor.yy203->pLast = yymsp[-1].minor.yy203;
  yygotominor.yy203 = yymsp[-1].minor.yy203;
}
        break;
      case 286: /* trnm ::= nm DOT nm */
{
  yygotominor.yy0 = yymsp[0].minor.yy0;
  sqlite3ErrorMsg(pParse, 
        "qualified table names are not allowed on INSERT, UPDATE, and DELETE "
        "statements within triggers");
}
        break;
      case 288: /* tridxby ::= INDEXED BY nm */
{
  sqlite3ErrorMsg(pParse,
        "the INDEXED BY clause is not allowed on UPDATE or DELETE statements "
        "within triggers");
}
        break;
      case 289: /* tridxby ::= NOT INDEXED */
{
  sqlite3ErrorMsg(pParse,
        "the NOT INDEXED clause is not allowed on UPDATE or DELETE statements "
        "within triggers");
}
        break;
      case 290: /* trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist where_opt */
{ yygotominor.yy203 = sqlite3TriggerUpdateStep(pParse->db, &yymsp[-4].minor.yy0, yymsp[-1].minor.yy322, yymsp[0].minor.yy314, yymsp[-5].minor.yy210); }
        break;
      case 291: /* trigger_cmd ::= insert_cmd INTO trnm inscollist_opt valuelist */
{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);}
        break;
      case 292: /* trigger_cmd ::= insert_cmd INTO trnm inscollist_opt select */
{yygotominor.yy203 = sqlite3TriggerInsertStep(pParse->db, &yymsp[-2].minor.yy0, yymsp[-1].minor.yy384, 0, yymsp[0].minor.yy387, yymsp[-4].minor.yy210);}
        break;
      case 293: /* trigger_cmd ::= DELETE FROM trnm tridxby where_opt */
{yygotominor.yy203 = sqlite3TriggerDeleteStep(pParse->db, &yymsp[-2].minor.yy0, yymsp[0].minor.yy314);}
        break;
      case 294: /* trigger_cmd ::= select */
{yygotominor.yy203 = sqlite3TriggerSelectStep(pParse->db, yymsp[0].minor.yy387); }
        break;
      case 295: /* expr ::= RAISE LP IGNORE RP */
{
  yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_RAISE, 0, 0, 0); 
  if( yygotominor.yy118.pExpr ){
    yygotominor.yy118.pExpr->affinity = OE_Ignore;
  }
  yygotominor.yy118.zStart = yymsp[-3].minor.yy0.z;
  yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
}
        break;
      case 296: /* expr ::= RAISE LP raisetype COMMA nm RP */
{
  yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_RAISE, 0, 0, &yymsp[-1].minor.yy0); 
  if( yygotominor.yy118.pExpr ) {
    yygotominor.yy118.pExpr->affinity = (char)yymsp[-3].minor.yy4;
  }
  yygotominor.yy118.zStart = yymsp[-5].minor.yy0.z;
  yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
}
        break;
      case 297: /* raisetype ::= ROLLBACK */
{yygotominor.yy4 = OE_Rollback;}
        break;
      case 299: /* raisetype ::= FAIL */
{yygotominor.yy4 = OE_Fail;}
        break;
      case 300: /* cmd ::= DROP TRIGGER ifexists fullname */
{
  sqlite3DropTrigger(pParse,yymsp[0].minor.yy259,yymsp[-1].minor.yy4);
}
        break;
      case 301: /* cmd ::= ATTACH database_kw_opt expr AS expr key_opt */
{
  sqlite3Attach(pParse, yymsp[-3].minor.yy118.pExpr, yymsp[-1].minor.yy118.pExpr, yymsp[0].minor.yy314);
}
        break;
      case 302: /* cmd ::= DETACH database_kw_opt expr */
{
  sqlite3Detach(pParse, yymsp[0].minor.yy118.pExpr);
}
        break;
      case 307: /* cmd ::= REINDEX */
{sqlite3Reindex(pParse, 0, 0);}
        break;
      case 308: /* cmd ::= REINDEX nm dbnm */
{sqlite3Reindex(pParse, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0);}
        break;
      case 309: /* cmd ::= ANALYZE */
{sqlite3Analyze(pParse, 0, 0);}
        break;
      case 310: /* cmd ::= ANALYZE nm dbnm */
{sqlite3Analyze(pParse, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0);}
        break;
      case 311: /* cmd ::= ALTER TABLE fullname RENAME TO nm */
{
  sqlite3AlterRenameTable(pParse,yymsp[-3].minor.yy259,&yymsp[0].minor.yy0);
}
        break;
      case 312: /* cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt column */
{
  sqlite3AlterFinishAddColumn(pParse, &yymsp[0].minor.yy0);
}
        break;
      case 313: /* add_column_fullname ::= fullname */
{
  pParse->db->lookaside.bEnabled = 0;
  sqlite3AlterBeginAddColumn(pParse, yymsp[0].minor.yy259);
}
        break;
      case 316: /* cmd ::= create_vtab */
{sqlite3VtabFinishParse(pParse,0);}
        break;
      case 317: /* cmd ::= create_vtab LP vtabarglist RP */
{sqlite3VtabFinishParse(pParse,&yymsp[0].minor.yy0);}
        break;
      case 318: /* create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm */
{
    sqlite3VtabBeginParse(pParse, &yymsp[-3].minor.yy0, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-4].minor.yy4);
}
        break;
      case 321: /* vtabarg ::= */
{sqlite3VtabArgInit(pParse);}
        break;
      case 323: /* vtabargtoken ::= ANY */
      case 324: /* vtabargtoken ::= lp anylist RP */ yytestcase(yyruleno==324);
      case 325: /* lp ::= LP */ yytestcase(yyruleno==325);
{sqlite3VtabArgExtend(pParse,&yymsp[0].minor.yy0);}

















        break;
      default:
      /* (0) input ::= cmdlist */ yytestcase(yyruleno==0);
      /* (1) cmdlist ::= cmdlist ecmd */ yytestcase(yyruleno==1);
      /* (2) cmdlist ::= ecmd */ yytestcase(yyruleno==2);
      /* (3) ecmd ::= SEMI */ yytestcase(yyruleno==3);
      /* (4) ecmd ::= explain cmdx SEMI */ yytestcase(yyruleno==4);
      /* (10) trans_opt ::= */ yytestcase(yyruleno==10);
      /* (11) trans_opt ::= TRANSACTION */ yytestcase(yyruleno==11);
      /* (12) trans_opt ::= TRANSACTION nm */ yytestcase(yyruleno==12);
      /* (20) savepoint_opt ::= SAVEPOINT */ yytestcase(yyruleno==20);
      /* (21) savepoint_opt ::= */ yytestcase(yyruleno==21);
      /* (25) cmd ::= create_table create_table_args */ yytestcase(yyruleno==25);
      /* (36) columnlist ::= columnlist COMMA column */ yytestcase(yyruleno==36);
      /* (37) columnlist ::= column */ yytestcase(yyruleno==37);
      /* (46) type ::= */ yytestcase(yyruleno==46);
      /* (53) signed ::= plus_num */ yytestcase(yyruleno==53);
      /* (54) signed ::= minus_num */ yytestcase(yyruleno==54);
      /* (55) carglist ::= carglist ccons */ yytestcase(yyruleno==55);
      /* (56) carglist ::= */ yytestcase(yyruleno==56);
      /* (63) ccons ::= NULL onconf */ yytestcase(yyruleno==63);
      /* (91) conslist ::= conslist tconscomma tcons */ yytestcase(yyruleno==91);
      /* (92) conslist ::= tcons */ yytestcase(yyruleno==92);
      /* (94) tconscomma ::= */ yytestcase(yyruleno==94);
      /* (279) foreach_clause ::= */ yytestcase(yyruleno==279);
      /* (280) foreach_clause ::= FOR EACH ROW */ yytestcase(yyruleno==280);
      /* (287) tridxby ::= */ yytestcase(yyruleno==287);
      /* (305) database_kw_opt ::= DATABASE */ yytestcase(yyruleno==305);
      /* (306) database_kw_opt ::= */ yytestcase(yyruleno==306);
      /* (314) kwcolumn_opt ::= */ yytestcase(yyruleno==314);
      /* (315) kwcolumn_opt ::= COLUMNKW */ yytestcase(yyruleno==315);
      /* (319) vtabarglist ::= vtabarg */ yytestcase(yyruleno==319);
      /* (320) vtabarglist ::= vtabarglist COMMA vtabarg */ yytestcase(yyruleno==320);
      /* (322) vtabarg ::= vtabarg vtabargtoken */ yytestcase(yyruleno==322);
      /* (326) anylist ::= */ yytestcase(yyruleno==326);
      /* (327) anylist ::= anylist LP anylist RP */ yytestcase(yyruleno==327);
      /* (328) anylist ::= anylist ANY */ yytestcase(yyruleno==328);
        break;
  };
  assert( yyruleno>=0 && yyruleno<sizeof(yyRuleInfo)/sizeof(yyRuleInfo[0]) );
  yygoto = yyRuleInfo[yyruleno].lhs;
  yysize = yyRuleInfo[yyruleno].nrhs;
  yypParser->yyidx -= yysize;
  yyact = yy_find_reduce_action(yymsp[-yysize].stateno,(YYCODETYPE)yygoto);







|










|
|
|
|
|
|
|
|
|



|
|
|
|
|
|



|




|
|



|




|

|

















|
<
<
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<
|
|


|


|





|





|


|
|


|
|
|

|
|

|


|

|



|






|
|

|
|

|
|

|
|

|
|

|
|

|


|
|

|
|

|
|
|

|
|

|
|

|
|

|
|

|
|

|
|

|
|

|
|
|
|
|

|


|


|


|
|

|
|

|
|

|

|
|


|
|

|
|

|
|

|
|

|
|

|

|


|

|


|

|


|


|

|

|


|
>
|
>
>
>
>
>
>

>
>
>
>
|

|
|
|
|

|

|


|
|

|

>
>
>
>
>
|


>
>
>
>
>
>
>
>
>
>
>
>
|
|

|
|
|

|
|
|

|
|
|
|
|
|

|

|
|
|


|


|


|




|


|


|
|

|

|
|


|

|
|


|
|

|

|
|


|

|


|

|
|
|
|
|
|
|






|


|
|
|



|
|


|
|

|
|

|
|

|
|

|
|

|
|
|
|
|
|

|
|
|
|
|
|

|


|
|
|

|
|
|

|
|
|
|

|

|
|


|

|
|


|
|
|

|
|

|
|

|
|

|
|

|
|

|

>
|
|


|

>
|
|
|


|

|
|


|

|
|


|
>
|
<
<
|
>

|
>
>
|
>


|


<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
|
<
<
<
<
<
<
<
<
<
<
<
<

|
|

|
|

|
|

|
|

|
|
|
|

|
|
|

|



|
|


|





|
|


|

>
|
|
|
|
|
|
|
|
|
|
<
|
<
<
<
|
|
>
|


|

|
|
|


|

|
|


|

|


|
|
|
|



|

|
|


|

|
|


|
|
|
|
|
|
|
|
|

|
<
|

|
<
|

|


|
|
|
|
|
|
|


|


|
|
|
|
|
|
|
|


|
|

|
|

|

|
|


|

|
|


|
|
|

|
|

|
|

|

|
|
|
|
|



|
|
|


|

|








|
|

|
|
|
|

|

|

|
|


|

|
|
|
|
|

|

|
|


|

|
|
|
|
|

|

|
|
|


|


|
|
|
|
|



|
|
|


|

|

|



|

|
|


|

|
|
|
|

|
|

|
|


|

|
|


|

|
|


|
|

|
|

|


|
|


|
|
|

|
|

|


|
|
|
|


|


|
|
|
|


|


|
|

|
|


|


|


|


|


|


|




|


|

|



|
|
|

|
|

|
|

|
|
|

|
|

|
|
|

|
|
|

|

|
|
|
|


|

|
|
|


|







|






|






|
|

<
<
<
|
|

|
|

|
|

|

|
|
|

|
|


|

|
|
|

|
|


|
|

|
|

|

|


|

|


|

|


|


|


|


|


|

|


|




|


|


|


|


|

|


|


|
|
|

>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>















|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|







116709
116710
116711
116712
116713
116714
116715
116716
116717
116718
116719
116720
116721
116722
116723
116724
116725
116726
116727
116728
116729
116730
116731
116732
116733
116734
116735
116736
116737
116738
116739
116740
116741
116742
116743
116744
116745
116746
116747
116748
116749
116750
116751
116752
116753
116754
116755
116756
116757
116758
116759
116760
116761
116762
116763
116764
116765
116766
116767
116768
116769
116770
116771
116772
116773
116774
116775
116776
116777
116778
116779
116780
116781
116782
116783



116784
116785
116786
116787
116788
116789
116790
116791
116792
116793
116794
116795
116796
116797
116798
116799

116800
116801
116802
116803
116804
116805
116806
116807
116808
116809
116810
116811
116812
116813
116814
116815
116816
116817
116818
116819
116820
116821
116822
116823
116824
116825
116826
116827
116828
116829
116830
116831
116832
116833
116834
116835
116836
116837
116838
116839
116840
116841
116842
116843
116844
116845
116846
116847
116848
116849
116850
116851
116852
116853
116854
116855
116856
116857
116858
116859
116860
116861
116862
116863
116864
116865
116866
116867
116868
116869
116870
116871
116872
116873
116874
116875
116876
116877
116878
116879
116880
116881
116882
116883
116884
116885
116886
116887
116888
116889
116890
116891
116892
116893
116894
116895
116896
116897
116898
116899
116900
116901
116902
116903
116904
116905
116906
116907
116908
116909
116910
116911
116912
116913
116914
116915
116916
116917
116918
116919
116920
116921
116922
116923
116924
116925
116926
116927
116928
116929
116930
116931
116932
116933
116934
116935
116936
116937
116938
116939
116940
116941
116942
116943
116944
116945
116946
116947
116948
116949
116950
116951
116952
116953
116954
116955
116956
116957
116958
116959
116960
116961
116962
116963
116964
116965
116966
116967
116968
116969
116970
116971
116972
116973
116974
116975
116976
116977
116978
116979
116980
116981
116982
116983
116984
116985
116986
116987
116988
116989
116990
116991
116992
116993
116994
116995
116996
116997
116998
116999
117000
117001
117002
117003
117004
117005
117006
117007
117008
117009
117010
117011
117012
117013
117014
117015
117016
117017
117018
117019
117020
117021
117022
117023
117024
117025
117026
117027
117028
117029
117030
117031
117032
117033
117034
117035
117036
117037
117038
117039
117040
117041
117042
117043
117044
117045
117046
117047
117048
117049
117050
117051
117052
117053
117054
117055
117056
117057
117058
117059
117060
117061
117062
117063
117064
117065
117066
117067
117068
117069
117070
117071
117072
117073
117074
117075
117076
117077
117078
117079
117080
117081
117082
117083
117084
117085
117086
117087
117088
117089
117090
117091
117092
117093
117094
117095
117096
117097
117098
117099
117100
117101
117102
117103
117104
117105
117106
117107
117108
117109
117110
117111
117112
117113
117114
117115
117116
117117
117118
117119
117120
117121
117122
117123
117124
117125
117126
117127
117128
117129
117130
117131
117132
117133
117134
117135
117136
117137
117138
117139
117140
117141
117142
117143
117144
117145
117146
117147
117148
117149
117150
117151
117152
117153
117154
117155
117156
117157
117158
117159
117160
117161
117162
117163
117164
117165
117166
117167
117168
117169
117170
117171
117172
117173
117174
117175
117176
117177
117178
117179
117180
117181
117182
117183
117184
117185
117186
117187
117188
117189
117190
117191
117192
117193
117194
117195
117196
117197
117198
117199
117200
117201
117202
117203
117204
117205
117206
117207
117208
117209
117210
117211
117212
117213
117214
117215
117216
117217
117218
117219
117220
117221
117222
117223
117224
117225
117226


117227
117228
117229
117230
117231
117232
117233
117234
117235
117236
117237
117238
117239















117240












117241
117242
117243
117244
117245
117246
117247
117248
117249
117250
117251
117252
117253
117254
117255
117256
117257
117258
117259
117260
117261
117262
117263
117264
117265
117266
117267
117268
117269
117270
117271
117272
117273
117274
117275
117276
117277
117278
117279
117280
117281
117282
117283
117284
117285
117286
117287
117288
117289
117290
117291
117292
117293

117294



117295
117296
117297
117298
117299
117300
117301
117302
117303
117304
117305
117306
117307
117308
117309
117310
117311
117312
117313
117314
117315
117316
117317
117318
117319
117320
117321
117322
117323
117324
117325
117326
117327
117328
117329
117330
117331
117332
117333
117334
117335
117336
117337
117338
117339
117340
117341
117342
117343
117344
117345
117346
117347
117348

117349
117350
117351

117352
117353
117354
117355
117356
117357
117358
117359
117360
117361
117362
117363
117364
117365
117366
117367
117368
117369
117370
117371
117372
117373
117374
117375
117376
117377
117378
117379
117380
117381
117382
117383
117384
117385
117386
117387
117388
117389
117390
117391
117392
117393
117394
117395
117396
117397
117398
117399
117400
117401
117402
117403
117404
117405
117406
117407
117408
117409
117410
117411
117412
117413
117414
117415
117416
117417
117418
117419
117420
117421
117422
117423
117424
117425
117426
117427
117428
117429
117430
117431
117432
117433
117434
117435
117436
117437
117438
117439
117440
117441
117442
117443
117444
117445
117446
117447
117448
117449
117450
117451
117452
117453
117454
117455
117456
117457
117458
117459
117460
117461
117462
117463
117464
117465
117466
117467
117468
117469
117470
117471
117472
117473
117474
117475
117476
117477
117478
117479
117480
117481
117482
117483
117484
117485
117486
117487
117488
117489
117490
117491
117492
117493
117494
117495
117496
117497
117498
117499
117500
117501
117502
117503
117504
117505
117506
117507
117508
117509
117510
117511
117512
117513
117514
117515
117516
117517
117518
117519
117520
117521
117522
117523
117524
117525
117526
117527
117528
117529
117530
117531
117532
117533
117534
117535
117536
117537
117538
117539
117540
117541
117542
117543
117544
117545
117546
117547
117548
117549
117550
117551
117552
117553
117554
117555
117556
117557
117558
117559
117560
117561
117562
117563
117564
117565
117566
117567
117568
117569
117570
117571
117572
117573
117574
117575
117576
117577
117578
117579
117580
117581
117582
117583
117584
117585
117586
117587
117588
117589
117590
117591
117592
117593
117594
117595
117596
117597
117598
117599
117600
117601
117602
117603
117604
117605
117606
117607
117608
117609
117610
117611
117612
117613
117614
117615
117616
117617
117618
117619
117620
117621
117622
117623
117624
117625
117626
117627
117628
117629
117630
117631
117632
117633
117634
117635
117636
117637
117638
117639
117640
117641
117642
117643
117644
117645
117646
117647
117648
117649
117650
117651
117652
117653
117654
117655
117656
117657
117658
117659
117660
117661
117662
117663
117664
117665
117666
117667
117668
117669
117670
117671
117672
117673
117674
117675



117676
117677
117678
117679
117680
117681
117682
117683
117684
117685
117686
117687
117688
117689
117690
117691
117692
117693
117694
117695
117696
117697
117698
117699
117700
117701
117702
117703
117704
117705
117706
117707
117708
117709
117710
117711
117712
117713
117714
117715
117716
117717
117718
117719
117720
117721
117722
117723
117724
117725
117726
117727
117728
117729
117730
117731
117732
117733
117734
117735
117736
117737
117738
117739
117740
117741
117742
117743
117744
117745
117746
117747
117748
117749
117750
117751
117752
117753
117754
117755
117756
117757
117758
117759
117760
117761
117762
117763
117764
117765
117766
117767
117768
117769
117770
117771
117772
117773
117774
117775
117776
117777
117778
117779
117780
117781
117782
117783
117784
117785
117786
117787
117788
117789
117790
117791
117792
117793
117794
117795
117796
117797
117798
117799
117800
117801
117802
117803
117804
117805
117806
117807
117808
117809
117810
117811
117812
117813
117814
117815
117816
117817
117818
117819
117820
117821
117822
117823
117824
117825
117826
117827
117828
117829
117830
117831
117832
      case 24: /* cmd ::= ROLLBACK trans_opt TO savepoint_opt nm */
{
  sqlite3Savepoint(pParse, SAVEPOINT_ROLLBACK, &yymsp[0].minor.yy0);
}
        break;
      case 26: /* create_table ::= createkw temp TABLE ifnotexists nm dbnm */
{
   sqlite3StartTable(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,yymsp[-4].minor.yy328,0,0,yymsp[-2].minor.yy328);
}
        break;
      case 27: /* createkw ::= CREATE */
{
  pParse->db->lookaside.bEnabled = 0;
  yygotominor.yy0 = yymsp[0].minor.yy0;
}
        break;
      case 28: /* ifnotexists ::= */
      case 31: /* temp ::= */ yytestcase(yyruleno==31);
      case 68: /* autoinc ::= */ yytestcase(yyruleno==68);
      case 81: /* defer_subclause ::= NOT DEFERRABLE init_deferred_pred_opt */ yytestcase(yyruleno==81);
      case 83: /* init_deferred_pred_opt ::= */ yytestcase(yyruleno==83);
      case 85: /* init_deferred_pred_opt ::= INITIALLY IMMEDIATE */ yytestcase(yyruleno==85);
      case 97: /* defer_subclause_opt ::= */ yytestcase(yyruleno==97);
      case 108: /* ifexists ::= */ yytestcase(yyruleno==108);
      case 218: /* between_op ::= BETWEEN */ yytestcase(yyruleno==218);
      case 221: /* in_op ::= IN */ yytestcase(yyruleno==221);
{yygotominor.yy328 = 0;}
        break;
      case 29: /* ifnotexists ::= IF NOT EXISTS */
      case 30: /* temp ::= TEMP */ yytestcase(yyruleno==30);
      case 69: /* autoinc ::= AUTOINCR */ yytestcase(yyruleno==69);
      case 84: /* init_deferred_pred_opt ::= INITIALLY DEFERRED */ yytestcase(yyruleno==84);
      case 107: /* ifexists ::= IF EXISTS */ yytestcase(yyruleno==107);
      case 219: /* between_op ::= NOT BETWEEN */ yytestcase(yyruleno==219);
      case 222: /* in_op ::= NOT IN */ yytestcase(yyruleno==222);
{yygotominor.yy328 = 1;}
        break;
      case 32: /* create_table_args ::= LP columnlist conslist_opt RP table_options */
{
  sqlite3EndTable(pParse,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0,yymsp[0].minor.yy186,0);
}
        break;
      case 33: /* create_table_args ::= AS select */
{
  sqlite3EndTable(pParse,0,0,0,yymsp[0].minor.yy3);
  sqlite3SelectDelete(pParse->db, yymsp[0].minor.yy3);
}
        break;
      case 34: /* table_options ::= */
{yygotominor.yy186 = 0;}
        break;
      case 35: /* table_options ::= WITHOUT nm */
{
  if( yymsp[0].minor.yy0.n==5 && sqlite3_strnicmp(yymsp[0].minor.yy0.z,"rowid",5)==0 ){
    yygotominor.yy186 = TF_WithoutRowid;
  }else{
    yygotominor.yy186 = 0;
    sqlite3ErrorMsg(pParse, "unknown table option: %.*s", yymsp[0].minor.yy0.n, yymsp[0].minor.yy0.z);
  }
}
        break;
      case 38: /* column ::= columnid type carglist */
{
  yygotominor.yy0.z = yymsp[-2].minor.yy0.z;
  yygotominor.yy0.n = (int)(pParse->sLastToken.z-yymsp[-2].minor.yy0.z) + pParse->sLastToken.n;
}
        break;
      case 39: /* columnid ::= nm */
{
  sqlite3AddColumn(pParse,&yymsp[0].minor.yy0);
  yygotominor.yy0 = yymsp[0].minor.yy0;
  pParse->constraintName.n = 0;
}
        break;
      case 40: /* nm ::= ID|INDEXED */



      case 41: /* nm ::= STRING */ yytestcase(yyruleno==41);
      case 42: /* nm ::= JOIN_KW */ yytestcase(yyruleno==42);
      case 45: /* typetoken ::= typename */ yytestcase(yyruleno==45);
      case 48: /* typename ::= ID|STRING */ yytestcase(yyruleno==48);
      case 130: /* as ::= AS nm */ yytestcase(yyruleno==130);
      case 131: /* as ::= ID|STRING */ yytestcase(yyruleno==131);
      case 141: /* dbnm ::= DOT nm */ yytestcase(yyruleno==141);
      case 150: /* indexed_opt ::= INDEXED BY nm */ yytestcase(yyruleno==150);
      case 247: /* collate ::= COLLATE ID|STRING */ yytestcase(yyruleno==247);
      case 256: /* nmnum ::= plus_num */ yytestcase(yyruleno==256);
      case 257: /* nmnum ::= nm */ yytestcase(yyruleno==257);
      case 258: /* nmnum ::= ON */ yytestcase(yyruleno==258);
      case 259: /* nmnum ::= DELETE */ yytestcase(yyruleno==259);
      case 260: /* nmnum ::= DEFAULT */ yytestcase(yyruleno==260);
      case 261: /* plus_num ::= PLUS INTEGER|FLOAT */ yytestcase(yyruleno==261);
      case 262: /* plus_num ::= INTEGER|FLOAT */ yytestcase(yyruleno==262);

      case 263: /* minus_num ::= MINUS INTEGER|FLOAT */ yytestcase(yyruleno==263);
      case 279: /* trnm ::= nm */ yytestcase(yyruleno==279);
{yygotominor.yy0 = yymsp[0].minor.yy0;}
        break;
      case 44: /* type ::= typetoken */
{sqlite3AddColumnType(pParse,&yymsp[0].minor.yy0);}
        break;
      case 46: /* typetoken ::= typename LP signed RP */
{
  yygotominor.yy0.z = yymsp[-3].minor.yy0.z;
  yygotominor.yy0.n = (int)(&yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n] - yymsp[-3].minor.yy0.z);
}
        break;
      case 47: /* typetoken ::= typename LP signed COMMA signed RP */
{
  yygotominor.yy0.z = yymsp[-5].minor.yy0.z;
  yygotominor.yy0.n = (int)(&yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n] - yymsp[-5].minor.yy0.z);
}
        break;
      case 49: /* typename ::= typename ID|STRING */
{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);}
        break;
      case 54: /* ccons ::= CONSTRAINT nm */
      case 92: /* tcons ::= CONSTRAINT nm */ yytestcase(yyruleno==92);
{pParse->constraintName = yymsp[0].minor.yy0;}
        break;
      case 55: /* ccons ::= DEFAULT term */
      case 57: /* ccons ::= DEFAULT PLUS term */ yytestcase(yyruleno==57);
{sqlite3AddDefaultValue(pParse,&yymsp[0].minor.yy346);}
        break;
      case 56: /* ccons ::= DEFAULT LP expr RP */
{sqlite3AddDefaultValue(pParse,&yymsp[-1].minor.yy346);}
        break;
      case 58: /* ccons ::= DEFAULT MINUS term */
{
  ExprSpan v;
  v.pExpr = sqlite3PExpr(pParse, TK_UMINUS, yymsp[0].minor.yy346.pExpr, 0, 0);
  v.zStart = yymsp[-1].minor.yy0.z;
  v.zEnd = yymsp[0].minor.yy346.zEnd;
  sqlite3AddDefaultValue(pParse,&v);
}
        break;
      case 59: /* ccons ::= DEFAULT ID|INDEXED */
{
  ExprSpan v;
  spanExpr(&v, pParse, TK_STRING, &yymsp[0].minor.yy0);
  sqlite3AddDefaultValue(pParse,&v);
}
        break;
      case 61: /* ccons ::= NOT NULL onconf */
{sqlite3AddNotNull(pParse, yymsp[0].minor.yy328);}
        break;
      case 62: /* ccons ::= PRIMARY KEY sortorder onconf autoinc */
{sqlite3AddPrimaryKey(pParse,0,yymsp[-1].minor.yy328,yymsp[0].minor.yy328,yymsp[-2].minor.yy328);}
        break;
      case 63: /* ccons ::= UNIQUE onconf */
{sqlite3CreateIndex(pParse,0,0,0,0,yymsp[0].minor.yy328,0,0,0,0);}
        break;
      case 64: /* ccons ::= CHECK LP expr RP */
{sqlite3AddCheckConstraint(pParse,yymsp[-1].minor.yy346.pExpr);}
        break;
      case 65: /* ccons ::= REFERENCES nm idxlist_opt refargs */
{sqlite3CreateForeignKey(pParse,0,&yymsp[-2].minor.yy0,yymsp[-1].minor.yy14,yymsp[0].minor.yy328);}
        break;
      case 66: /* ccons ::= defer_subclause */
{sqlite3DeferForeignKey(pParse,yymsp[0].minor.yy328);}
        break;
      case 67: /* ccons ::= COLLATE ID|STRING */
{sqlite3AddCollateType(pParse, &yymsp[0].minor.yy0);}
        break;
      case 70: /* refargs ::= */
{ yygotominor.yy328 = OE_None*0x0101; /* EV: R-19803-45884 */}
        break;
      case 71: /* refargs ::= refargs refarg */
{ yygotominor.yy328 = (yymsp[-1].minor.yy328 & ~yymsp[0].minor.yy429.mask) | yymsp[0].minor.yy429.value; }
        break;
      case 72: /* refarg ::= MATCH nm */
      case 73: /* refarg ::= ON INSERT refact */ yytestcase(yyruleno==73);
{ yygotominor.yy429.value = 0;     yygotominor.yy429.mask = 0x000000; }
        break;
      case 74: /* refarg ::= ON DELETE refact */
{ yygotominor.yy429.value = yymsp[0].minor.yy328;     yygotominor.yy429.mask = 0x0000ff; }
        break;
      case 75: /* refarg ::= ON UPDATE refact */
{ yygotominor.yy429.value = yymsp[0].minor.yy328<<8;  yygotominor.yy429.mask = 0x00ff00; }
        break;
      case 76: /* refact ::= SET NULL */
{ yygotominor.yy328 = OE_SetNull;  /* EV: R-33326-45252 */}
        break;
      case 77: /* refact ::= SET DEFAULT */
{ yygotominor.yy328 = OE_SetDflt;  /* EV: R-33326-45252 */}
        break;
      case 78: /* refact ::= CASCADE */
{ yygotominor.yy328 = OE_Cascade;  /* EV: R-33326-45252 */}
        break;
      case 79: /* refact ::= RESTRICT */
{ yygotominor.yy328 = OE_Restrict; /* EV: R-33326-45252 */}
        break;
      case 80: /* refact ::= NO ACTION */
{ yygotominor.yy328 = OE_None;     /* EV: R-33326-45252 */}
        break;
      case 82: /* defer_subclause ::= DEFERRABLE init_deferred_pred_opt */
      case 98: /* defer_subclause_opt ::= defer_subclause */ yytestcase(yyruleno==98);
      case 100: /* onconf ::= ON CONFLICT resolvetype */ yytestcase(yyruleno==100);
      case 103: /* resolvetype ::= raisetype */ yytestcase(yyruleno==103);
{yygotominor.yy328 = yymsp[0].minor.yy328;}
        break;
      case 86: /* conslist_opt ::= */
{yygotominor.yy0.n = 0; yygotominor.yy0.z = 0;}
        break;
      case 87: /* conslist_opt ::= COMMA conslist */
{yygotominor.yy0 = yymsp[-1].minor.yy0;}
        break;
      case 90: /* tconscomma ::= COMMA */
{pParse->constraintName.n = 0;}
        break;
      case 93: /* tcons ::= PRIMARY KEY LP idxlist autoinc RP onconf */
{sqlite3AddPrimaryKey(pParse,yymsp[-3].minor.yy14,yymsp[0].minor.yy328,yymsp[-2].minor.yy328,0);}
        break;
      case 94: /* tcons ::= UNIQUE LP idxlist RP onconf */
{sqlite3CreateIndex(pParse,0,0,0,yymsp[-2].minor.yy14,yymsp[0].minor.yy328,0,0,0,0);}
        break;
      case 95: /* tcons ::= CHECK LP expr RP onconf */
{sqlite3AddCheckConstraint(pParse,yymsp[-2].minor.yy346.pExpr);}
        break;
      case 96: /* tcons ::= FOREIGN KEY LP idxlist RP REFERENCES nm idxlist_opt refargs defer_subclause_opt */
{
    sqlite3CreateForeignKey(pParse, yymsp[-6].minor.yy14, &yymsp[-3].minor.yy0, yymsp[-2].minor.yy14, yymsp[-1].minor.yy328);
    sqlite3DeferForeignKey(pParse, yymsp[0].minor.yy328);
}
        break;
      case 99: /* onconf ::= */
{yygotominor.yy328 = OE_Default;}
        break;
      case 101: /* orconf ::= */
{yygotominor.yy186 = OE_Default;}
        break;
      case 102: /* orconf ::= OR resolvetype */
{yygotominor.yy186 = (u8)yymsp[0].minor.yy328;}
        break;
      case 104: /* resolvetype ::= IGNORE */
{yygotominor.yy328 = OE_Ignore;}
        break;
      case 105: /* resolvetype ::= REPLACE */
{yygotominor.yy328 = OE_Replace;}
        break;
      case 106: /* cmd ::= DROP TABLE ifexists fullname */
{
  sqlite3DropTable(pParse, yymsp[0].minor.yy65, 0, yymsp[-1].minor.yy328);
}
        break;
      case 109: /* cmd ::= createkw temp VIEW ifnotexists nm dbnm AS select */
{
  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);
}
        break;
      case 110: /* cmd ::= DROP VIEW ifexists fullname */
{
  sqlite3DropTable(pParse, yymsp[0].minor.yy65, 1, yymsp[-1].minor.yy328);
}
        break;
      case 111: /* cmd ::= select */
{
  SelectDest dest = {SRT_Output, 0, 0, 0, 0};
  sqlite3Select(pParse, yymsp[0].minor.yy3, &dest);
  sqlite3ExplainBegin(pParse->pVdbe);
  sqlite3ExplainSelect(pParse->pVdbe, yymsp[0].minor.yy3);
  sqlite3ExplainFinish(pParse->pVdbe);
  sqlite3SelectDelete(pParse->db, yymsp[0].minor.yy3);
}
        break;
      case 112: /* select ::= with selectnowith */
{ 
  if( yymsp[0].minor.yy3 ){
    yymsp[0].minor.yy3->pWith = yymsp[-1].minor.yy59; 
  }else{
    sqlite3WithDelete(pParse->db, yymsp[-1].minor.yy59);
  }
  yygotominor.yy3 = yymsp[0].minor.yy3; 
}
        break;
      case 113: /* selectnowith ::= oneselect */
      case 119: /* oneselect ::= values */ yytestcase(yyruleno==119);
{yygotominor.yy3 = yymsp[0].minor.yy3;}
        break;
      case 114: /* selectnowith ::= selectnowith multiselect_op oneselect */
{
  if( yymsp[0].minor.yy3 ){
    yymsp[0].minor.yy3->op = (u8)yymsp[-1].minor.yy328;
    yymsp[0].minor.yy3->pPrior = yymsp[-2].minor.yy3;
    if( yymsp[-1].minor.yy328!=TK_ALL ) pParse->hasCompound = 1;
  }else{
    sqlite3SelectDelete(pParse->db, yymsp[-2].minor.yy3);
  }
  yygotominor.yy3 = yymsp[0].minor.yy3;
}
        break;
      case 116: /* multiselect_op ::= UNION ALL */
{yygotominor.yy328 = TK_ALL;}
        break;
      case 118: /* oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt orderby_opt limit_opt */
{
  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);
}
        break;
      case 120: /* values ::= VALUES LP nexprlist RP */
{
  yygotominor.yy3 = sqlite3SelectNew(pParse,yymsp[-1].minor.yy14,0,0,0,0,0,SF_Values,0,0);
}
        break;
      case 121: /* values ::= values COMMA LP exprlist RP */
{
  Select *pRight = sqlite3SelectNew(pParse,yymsp[-1].minor.yy14,0,0,0,0,0,SF_Values,0,0);
  if( pRight ){
    pRight->op = TK_ALL;
    pRight->pPrior = yymsp[-4].minor.yy3;
    yygotominor.yy3 = pRight;
  }else{
    yygotominor.yy3 = yymsp[-4].minor.yy3;
  }
}
        break;
      case 122: /* distinct ::= DISTINCT */
{yygotominor.yy381 = SF_Distinct;}
        break;
      case 123: /* distinct ::= ALL */
      case 124: /* distinct ::= */ yytestcase(yyruleno==124);
{yygotominor.yy381 = 0;}
        break;
      case 125: /* sclp ::= selcollist COMMA */
      case 243: /* idxlist_opt ::= LP idxlist RP */ yytestcase(yyruleno==243);
{yygotominor.yy14 = yymsp[-1].minor.yy14;}
        break;
      case 126: /* sclp ::= */
      case 154: /* orderby_opt ::= */ yytestcase(yyruleno==154);
      case 161: /* groupby_opt ::= */ yytestcase(yyruleno==161);
      case 236: /* exprlist ::= */ yytestcase(yyruleno==236);
      case 242: /* idxlist_opt ::= */ yytestcase(yyruleno==242);
{yygotominor.yy14 = 0;}
        break;
      case 127: /* selcollist ::= sclp expr as */
{
   yygotominor.yy14 = sqlite3ExprListAppend(pParse, yymsp[-2].minor.yy14, yymsp[-1].minor.yy346.pExpr);
   if( yymsp[0].minor.yy0.n>0 ) sqlite3ExprListSetName(pParse, yygotominor.yy14, &yymsp[0].minor.yy0, 1);
   sqlite3ExprListSetSpan(pParse,yygotominor.yy14,&yymsp[-1].minor.yy346);
}
        break;
      case 128: /* selcollist ::= sclp STAR */
{
  Expr *p = sqlite3Expr(pParse->db, TK_ALL, 0);
  yygotominor.yy14 = sqlite3ExprListAppend(pParse, yymsp[-1].minor.yy14, p);
}
        break;
      case 129: /* selcollist ::= sclp nm DOT STAR */
{
  Expr *pRight = sqlite3PExpr(pParse, TK_ALL, 0, 0, &yymsp[0].minor.yy0);
  Expr *pLeft = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-2].minor.yy0);
  Expr *pDot = sqlite3PExpr(pParse, TK_DOT, pLeft, pRight, 0);
  yygotominor.yy14 = sqlite3ExprListAppend(pParse,yymsp[-3].minor.yy14, pDot);
}
        break;
      case 132: /* as ::= */
{yygotominor.yy0.n = 0;}
        break;
      case 133: /* from ::= */
{yygotominor.yy65 = sqlite3DbMallocZero(pParse->db, sizeof(*yygotominor.yy65));}
        break;
      case 134: /* from ::= FROM seltablist */
{
  yygotominor.yy65 = yymsp[0].minor.yy65;
  sqlite3SrcListShiftJoinType(yygotominor.yy65);
}
        break;
      case 135: /* stl_prefix ::= seltablist joinop */
{
   yygotominor.yy65 = yymsp[-1].minor.yy65;
   if( ALWAYS(yygotominor.yy65 && yygotominor.yy65->nSrc>0) ) yygotominor.yy65->a[yygotominor.yy65->nSrc-1].jointype = (u8)yymsp[0].minor.yy328;
}
        break;
      case 136: /* stl_prefix ::= */
{yygotominor.yy65 = 0;}
        break;
      case 137: /* seltablist ::= stl_prefix nm dbnm as indexed_opt on_opt using_opt */
{
  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);
  sqlite3SrcListIndexedBy(pParse, yygotominor.yy65, &yymsp[-2].minor.yy0);
}
        break;
      case 138: /* seltablist ::= stl_prefix LP select RP as on_opt using_opt */
{
    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);
  }
        break;
      case 139: /* seltablist ::= stl_prefix LP seltablist RP as on_opt using_opt */
{
    if( yymsp[-6].minor.yy65==0 && yymsp[-2].minor.yy0.n==0 && yymsp[-1].minor.yy132==0 && yymsp[0].minor.yy408==0 ){
      yygotominor.yy65 = yymsp[-4].minor.yy65;
    }else if( yymsp[-4].minor.yy65->nSrc==1 ){
      yygotominor.yy65 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy65,0,0,&yymsp[-2].minor.yy0,0,yymsp[-1].minor.yy132,yymsp[0].minor.yy408);
      if( yygotominor.yy65 ){
        struct SrcList_item *pNew = &yygotominor.yy65->a[yygotominor.yy65->nSrc-1];
        struct SrcList_item *pOld = yymsp[-4].minor.yy65->a;
        pNew->zName = pOld->zName;
        pNew->zDatabase = pOld->zDatabase;
        pNew->pSelect = pOld->pSelect;
        pOld->zName = pOld->zDatabase = 0;
        pOld->pSelect = 0;
      }
      sqlite3SrcListDelete(pParse->db, yymsp[-4].minor.yy65);
    }else{
      Select *pSubquery;
      sqlite3SrcListShiftJoinType(yymsp[-4].minor.yy65);
      pSubquery = sqlite3SelectNew(pParse,0,yymsp[-4].minor.yy65,0,0,0,0,SF_NestedFrom,0,0);
      yygotominor.yy65 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy65,0,0,&yymsp[-2].minor.yy0,pSubquery,yymsp[-1].minor.yy132,yymsp[0].minor.yy408);
    }
  }
        break;
      case 140: /* dbnm ::= */
      case 149: /* indexed_opt ::= */ yytestcase(yyruleno==149);
{yygotominor.yy0.z=0; yygotominor.yy0.n=0;}
        break;
      case 142: /* fullname ::= nm dbnm */
{yygotominor.yy65 = sqlite3SrcListAppend(pParse->db,0,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0);}
        break;
      case 143: /* joinop ::= COMMA|JOIN */
{ yygotominor.yy328 = JT_INNER; }
        break;
      case 144: /* joinop ::= JOIN_KW JOIN */
{ yygotominor.yy328 = sqlite3JoinType(pParse,&yymsp[-1].minor.yy0,0,0); }
        break;
      case 145: /* joinop ::= JOIN_KW nm JOIN */
{ yygotominor.yy328 = sqlite3JoinType(pParse,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0,0); }
        break;
      case 146: /* joinop ::= JOIN_KW nm nm JOIN */
{ yygotominor.yy328 = sqlite3JoinType(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0); }
        break;
      case 147: /* on_opt ::= ON expr */
      case 164: /* having_opt ::= HAVING expr */ yytestcase(yyruleno==164);
      case 171: /* where_opt ::= WHERE expr */ yytestcase(yyruleno==171);
      case 231: /* case_else ::= ELSE expr */ yytestcase(yyruleno==231);
      case 233: /* case_operand ::= expr */ yytestcase(yyruleno==233);
{yygotominor.yy132 = yymsp[0].minor.yy346.pExpr;}
        break;
      case 148: /* on_opt ::= */
      case 163: /* having_opt ::= */ yytestcase(yyruleno==163);
      case 170: /* where_opt ::= */ yytestcase(yyruleno==170);
      case 232: /* case_else ::= */ yytestcase(yyruleno==232);
      case 234: /* case_operand ::= */ yytestcase(yyruleno==234);
{yygotominor.yy132 = 0;}
        break;
      case 151: /* indexed_opt ::= NOT INDEXED */
{yygotominor.yy0.z=0; yygotominor.yy0.n=1;}
        break;
      case 152: /* using_opt ::= USING LP idlist RP */
      case 180: /* inscollist_opt ::= LP idlist RP */ yytestcase(yyruleno==180);
{yygotominor.yy408 = yymsp[-1].minor.yy408;}
        break;
      case 153: /* using_opt ::= */
      case 179: /* inscollist_opt ::= */ yytestcase(yyruleno==179);
{yygotominor.yy408 = 0;}
        break;
      case 155: /* orderby_opt ::= ORDER BY sortlist */
      case 162: /* groupby_opt ::= GROUP BY nexprlist */ yytestcase(yyruleno==162);
      case 235: /* exprlist ::= nexprlist */ yytestcase(yyruleno==235);
{yygotominor.yy14 = yymsp[0].minor.yy14;}
        break;
      case 156: /* sortlist ::= sortlist COMMA expr sortorder */
{
  yygotominor.yy14 = sqlite3ExprListAppend(pParse,yymsp[-3].minor.yy14,yymsp[-1].minor.yy346.pExpr);
  if( yygotominor.yy14 ) yygotominor.yy14->a[yygotominor.yy14->nExpr-1].sortOrder = (u8)yymsp[0].minor.yy328;
}
        break;
      case 157: /* sortlist ::= expr sortorder */
{
  yygotominor.yy14 = sqlite3ExprListAppend(pParse,0,yymsp[-1].minor.yy346.pExpr);
  if( yygotominor.yy14 && ALWAYS(yygotominor.yy14->a) ) yygotominor.yy14->a[0].sortOrder = (u8)yymsp[0].minor.yy328;
}
        break;
      case 158: /* sortorder ::= ASC */
      case 160: /* sortorder ::= */ yytestcase(yyruleno==160);
{yygotominor.yy328 = SQLITE_SO_ASC;}
        break;
      case 159: /* sortorder ::= DESC */
{yygotominor.yy328 = SQLITE_SO_DESC;}
        break;
      case 165: /* limit_opt ::= */
{yygotominor.yy476.pLimit = 0; yygotominor.yy476.pOffset = 0;}
        break;
      case 166: /* limit_opt ::= LIMIT expr */
{yygotominor.yy476.pLimit = yymsp[0].minor.yy346.pExpr; yygotominor.yy476.pOffset = 0;}
        break;
      case 167: /* limit_opt ::= LIMIT expr OFFSET expr */
{yygotominor.yy476.pLimit = yymsp[-2].minor.yy346.pExpr; yygotominor.yy476.pOffset = yymsp[0].minor.yy346.pExpr;}
        break;
      case 168: /* limit_opt ::= LIMIT expr COMMA expr */
{yygotominor.yy476.pOffset = yymsp[-2].minor.yy346.pExpr; yygotominor.yy476.pLimit = yymsp[0].minor.yy346.pExpr;}
        break;
      case 169: /* cmd ::= with DELETE FROM fullname indexed_opt where_opt */
{
  sqlite3WithPush(pParse, yymsp[-5].minor.yy59, 1);
  sqlite3SrcListIndexedBy(pParse, yymsp[-2].minor.yy65, &yymsp[-1].minor.yy0);
  sqlite3DeleteFrom(pParse,yymsp[-2].minor.yy65,yymsp[0].minor.yy132);
}
        break;
      case 172: /* cmd ::= with UPDATE orconf fullname indexed_opt SET setlist where_opt */
{
  sqlite3WithPush(pParse, yymsp[-7].minor.yy59, 1);
  sqlite3SrcListIndexedBy(pParse, yymsp[-4].minor.yy65, &yymsp[-3].minor.yy0);
  sqlite3ExprListCheckLength(pParse,yymsp[-1].minor.yy14,"set list"); 
  sqlite3Update(pParse,yymsp[-4].minor.yy65,yymsp[-1].minor.yy14,yymsp[0].minor.yy132,yymsp[-5].minor.yy186);
}
        break;
      case 173: /* setlist ::= setlist COMMA nm EQ expr */
{
  yygotominor.yy14 = sqlite3ExprListAppend(pParse, yymsp[-4].minor.yy14, yymsp[0].minor.yy346.pExpr);
  sqlite3ExprListSetName(pParse, yygotominor.yy14, &yymsp[-2].minor.yy0, 1);
}
        break;
      case 174: /* setlist ::= nm EQ expr */
{
  yygotominor.yy14 = sqlite3ExprListAppend(pParse, 0, yymsp[0].minor.yy346.pExpr);
  sqlite3ExprListSetName(pParse, yygotominor.yy14, &yymsp[-2].minor.yy0, 1);
}
        break;
      case 175: /* cmd ::= with insert_cmd INTO fullname inscollist_opt select */
{
  sqlite3WithPush(pParse, yymsp[-5].minor.yy59, 1);


  sqlite3Insert(pParse, yymsp[-2].minor.yy65, yymsp[0].minor.yy3, yymsp[-1].minor.yy408, yymsp[-4].minor.yy186);
}
        break;
      case 176: /* cmd ::= with insert_cmd INTO fullname inscollist_opt DEFAULT VALUES */
{
  sqlite3WithPush(pParse, yymsp[-6].minor.yy59, 1);
  sqlite3Insert(pParse, yymsp[-3].minor.yy65, 0, yymsp[-2].minor.yy408, yymsp[-5].minor.yy186);
}
        break;
      case 177: /* insert_cmd ::= INSERT orconf */
{yygotominor.yy186 = yymsp[0].minor.yy186;}
        break;
      case 178: /* insert_cmd ::= REPLACE */















{yygotominor.yy186 = OE_Replace;}












        break;
      case 181: /* idlist ::= idlist COMMA nm */
{yygotominor.yy408 = sqlite3IdListAppend(pParse->db,yymsp[-2].minor.yy408,&yymsp[0].minor.yy0);}
        break;
      case 182: /* idlist ::= nm */
{yygotominor.yy408 = sqlite3IdListAppend(pParse->db,0,&yymsp[0].minor.yy0);}
        break;
      case 183: /* expr ::= term */
{yygotominor.yy346 = yymsp[0].minor.yy346;}
        break;
      case 184: /* expr ::= LP expr RP */
{yygotominor.yy346.pExpr = yymsp[-1].minor.yy346.pExpr; spanSet(&yygotominor.yy346,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0);}
        break;
      case 185: /* term ::= NULL */
      case 190: /* term ::= INTEGER|FLOAT|BLOB */ yytestcase(yyruleno==190);
      case 191: /* term ::= STRING */ yytestcase(yyruleno==191);
{spanExpr(&yygotominor.yy346, pParse, yymsp[0].major, &yymsp[0].minor.yy0);}
        break;
      case 186: /* expr ::= ID|INDEXED */
      case 187: /* expr ::= JOIN_KW */ yytestcase(yyruleno==187);
{spanExpr(&yygotominor.yy346, pParse, TK_ID, &yymsp[0].minor.yy0);}
        break;
      case 188: /* expr ::= nm DOT nm */
{
  Expr *temp1 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-2].minor.yy0);
  Expr *temp2 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[0].minor.yy0);
  yygotominor.yy346.pExpr = sqlite3PExpr(pParse, TK_DOT, temp1, temp2, 0);
  spanSet(&yygotominor.yy346,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0);
}
        break;
      case 189: /* expr ::= nm DOT nm DOT nm */
{
  Expr *temp1 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-4].minor.yy0);
  Expr *temp2 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-2].minor.yy0);
  Expr *temp3 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[0].minor.yy0);
  Expr *temp4 = sqlite3PExpr(pParse, TK_DOT, temp2, temp3, 0);
  yygotominor.yy346.pExpr = sqlite3PExpr(pParse, TK_DOT, temp1, temp4, 0);
  spanSet(&yygotominor.yy346,&yymsp[-4].minor.yy0,&yymsp[0].minor.yy0);
}
        break;
      case 192: /* expr ::= VARIABLE */
{
  if( yymsp[0].minor.yy0.n>=2 && yymsp[0].minor.yy0.z[0]=='#' && sqlite3Isdigit(yymsp[0].minor.yy0.z[1]) ){
    /* When doing a nested parse, one can include terms in an expression
    ** that look like this:   #1 #2 ...  These terms refer to registers
    ** in the virtual machine.  #N is the N-th register. */
    if( pParse->nested==0 ){
      sqlite3ErrorMsg(pParse, "near \"%T\": syntax error", &yymsp[0].minor.yy0);
      yygotominor.yy346.pExpr = 0;
    }else{
      yygotominor.yy346.pExpr = sqlite3PExpr(pParse, TK_REGISTER, 0, 0, &yymsp[0].minor.yy0);
      if( yygotominor.yy346.pExpr ) sqlite3GetInt32(&yymsp[0].minor.yy0.z[1], &yygotominor.yy346.pExpr->iTable);
    }

  }else{



    spanExpr(&yygotominor.yy346, pParse, TK_VARIABLE, &yymsp[0].minor.yy0);
    sqlite3ExprAssignVarNumber(pParse, yygotominor.yy346.pExpr);
  }
  spanSet(&yygotominor.yy346, &yymsp[0].minor.yy0, &yymsp[0].minor.yy0);
}
        break;
      case 193: /* expr ::= expr COLLATE ID|STRING */
{
  yygotominor.yy346.pExpr = sqlite3ExprAddCollateToken(pParse, yymsp[-2].minor.yy346.pExpr, &yymsp[0].minor.yy0);
  yygotominor.yy346.zStart = yymsp[-2].minor.yy346.zStart;
  yygotominor.yy346.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
}
        break;
      case 194: /* expr ::= CAST LP expr AS typetoken RP */
{
  yygotominor.yy346.pExpr = sqlite3PExpr(pParse, TK_CAST, yymsp[-3].minor.yy346.pExpr, 0, &yymsp[-1].minor.yy0);
  spanSet(&yygotominor.yy346,&yymsp[-5].minor.yy0,&yymsp[0].minor.yy0);
}
        break;
      case 195: /* expr ::= ID|INDEXED LP distinct exprlist RP */
{
  if( yymsp[-1].minor.yy14 && yymsp[-1].minor.yy14->nExpr>pParse->db->aLimit[SQLITE_LIMIT_FUNCTION_ARG] ){
    sqlite3ErrorMsg(pParse, "too many arguments on function %T", &yymsp[-4].minor.yy0);
  }
  yygotominor.yy346.pExpr = sqlite3ExprFunction(pParse, yymsp[-1].minor.yy14, &yymsp[-4].minor.yy0);
  spanSet(&yygotominor.yy346,&yymsp[-4].minor.yy0,&yymsp[0].minor.yy0);
  if( yymsp[-2].minor.yy381 && yygotominor.yy346.pExpr ){
    yygotominor.yy346.pExpr->flags |= EP_Distinct;
  }
}
        break;
      case 196: /* expr ::= ID|INDEXED LP STAR RP */
{
  yygotominor.yy346.pExpr = sqlite3ExprFunction(pParse, 0, &yymsp[-3].minor.yy0);
  spanSet(&yygotominor.yy346,&yymsp[-3].minor.yy0,&yymsp[0].minor.yy0);
}
        break;
      case 197: /* term ::= CTIME_KW */
{
  yygotominor.yy346.pExpr = sqlite3ExprFunction(pParse, 0, &yymsp[0].minor.yy0);
  spanSet(&yygotominor.yy346, &yymsp[0].minor.yy0, &yymsp[0].minor.yy0);
}
        break;
      case 198: /* expr ::= expr AND expr */
      case 199: /* expr ::= expr OR expr */ yytestcase(yyruleno==199);
      case 200: /* expr ::= expr LT|GT|GE|LE expr */ yytestcase(yyruleno==200);
      case 201: /* expr ::= expr EQ|NE expr */ yytestcase(yyruleno==201);
      case 202: /* expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr */ yytestcase(yyruleno==202);
      case 203: /* expr ::= expr PLUS|MINUS expr */ yytestcase(yyruleno==203);
      case 204: /* expr ::= expr STAR|SLASH|REM expr */ yytestcase(yyruleno==204);
      case 205: /* expr ::= expr CONCAT expr */ yytestcase(yyruleno==205);
{spanBinaryExpr(&yygotominor.yy346,pParse,yymsp[-1].major,&yymsp[-2].minor.yy346,&yymsp[0].minor.yy346);}
        break;
      case 206: /* likeop ::= LIKE_KW|MATCH */

{yygotominor.yy96.eOperator = yymsp[0].minor.yy0; yygotominor.yy96.bNot = 0;}
        break;
      case 207: /* likeop ::= NOT LIKE_KW|MATCH */

{yygotominor.yy96.eOperator = yymsp[0].minor.yy0; yygotominor.yy96.bNot = 1;}
        break;
      case 208: /* expr ::= expr likeop expr */
{
  ExprList *pList;
  pList = sqlite3ExprListAppend(pParse,0, yymsp[0].minor.yy346.pExpr);
  pList = sqlite3ExprListAppend(pParse,pList, yymsp[-2].minor.yy346.pExpr);
  yygotominor.yy346.pExpr = sqlite3ExprFunction(pParse, pList, &yymsp[-1].minor.yy96.eOperator);
  if( yymsp[-1].minor.yy96.bNot ) yygotominor.yy346.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy346.pExpr, 0, 0);
  yygotominor.yy346.zStart = yymsp[-2].minor.yy346.zStart;
  yygotominor.yy346.zEnd = yymsp[0].minor.yy346.zEnd;
  if( yygotominor.yy346.pExpr ) yygotominor.yy346.pExpr->flags |= EP_InfixFunc;
}
        break;
      case 209: /* expr ::= expr likeop expr ESCAPE expr */
{
  ExprList *pList;
  pList = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy346.pExpr);
  pList = sqlite3ExprListAppend(pParse,pList, yymsp[-4].minor.yy346.pExpr);
  pList = sqlite3ExprListAppend(pParse,pList, yymsp[0].minor.yy346.pExpr);
  yygotominor.yy346.pExpr = sqlite3ExprFunction(pParse, pList, &yymsp[-3].minor.yy96.eOperator);
  if( yymsp[-3].minor.yy96.bNot ) yygotominor.yy346.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy346.pExpr, 0, 0);
  yygotominor.yy346.zStart = yymsp[-4].minor.yy346.zStart;
  yygotominor.yy346.zEnd = yymsp[0].minor.yy346.zEnd;
  if( yygotominor.yy346.pExpr ) yygotominor.yy346.pExpr->flags |= EP_InfixFunc;
}
        break;
      case 210: /* expr ::= expr ISNULL|NOTNULL */
{spanUnaryPostfix(&yygotominor.yy346,pParse,yymsp[0].major,&yymsp[-1].minor.yy346,&yymsp[0].minor.yy0);}
        break;
      case 211: /* expr ::= expr NOT NULL */
{spanUnaryPostfix(&yygotominor.yy346,pParse,TK_NOTNULL,&yymsp[-2].minor.yy346,&yymsp[0].minor.yy0);}
        break;
      case 212: /* expr ::= expr IS expr */
{
  spanBinaryExpr(&yygotominor.yy346,pParse,TK_IS,&yymsp[-2].minor.yy346,&yymsp[0].minor.yy346);
  binaryToUnaryIfNull(pParse, yymsp[0].minor.yy346.pExpr, yygotominor.yy346.pExpr, TK_ISNULL);
}
        break;
      case 213: /* expr ::= expr IS NOT expr */
{
  spanBinaryExpr(&yygotominor.yy346,pParse,TK_ISNOT,&yymsp[-3].minor.yy346,&yymsp[0].minor.yy346);
  binaryToUnaryIfNull(pParse, yymsp[0].minor.yy346.pExpr, yygotominor.yy346.pExpr, TK_NOTNULL);
}
        break;
      case 214: /* expr ::= NOT expr */
      case 215: /* expr ::= BITNOT expr */ yytestcase(yyruleno==215);
{spanUnaryPrefix(&yygotominor.yy346,pParse,yymsp[-1].major,&yymsp[0].minor.yy346,&yymsp[-1].minor.yy0);}
        break;
      case 216: /* expr ::= MINUS expr */
{spanUnaryPrefix(&yygotominor.yy346,pParse,TK_UMINUS,&yymsp[0].minor.yy346,&yymsp[-1].minor.yy0);}
        break;
      case 217: /* expr ::= PLUS expr */
{spanUnaryPrefix(&yygotominor.yy346,pParse,TK_UPLUS,&yymsp[0].minor.yy346,&yymsp[-1].minor.yy0);}
        break;
      case 220: /* expr ::= expr between_op expr AND expr */
{
  ExprList *pList = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy346.pExpr);
  pList = sqlite3ExprListAppend(pParse,pList, yymsp[0].minor.yy346.pExpr);
  yygotominor.yy346.pExpr = sqlite3PExpr(pParse, TK_BETWEEN, yymsp[-4].minor.yy346.pExpr, 0, 0);
  if( yygotominor.yy346.pExpr ){
    yygotominor.yy346.pExpr->x.pList = pList;
  }else{
    sqlite3ExprListDelete(pParse->db, pList);
  } 
  if( yymsp[-3].minor.yy328 ) yygotominor.yy346.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy346.pExpr, 0, 0);
  yygotominor.yy346.zStart = yymsp[-4].minor.yy346.zStart;
  yygotominor.yy346.zEnd = yymsp[0].minor.yy346.zEnd;
}
        break;
      case 223: /* expr ::= expr in_op LP exprlist RP */
{
    if( yymsp[-1].minor.yy14==0 ){
      /* Expressions of the form
      **
      **      expr1 IN ()
      **      expr1 NOT IN ()
      **
      ** simplify to constants 0 (false) and 1 (true), respectively,
      ** regardless of the value of expr1.
      */
      yygotominor.yy346.pExpr = sqlite3PExpr(pParse, TK_INTEGER, 0, 0, &sqlite3IntTokens[yymsp[-3].minor.yy328]);
      sqlite3ExprDelete(pParse->db, yymsp[-4].minor.yy346.pExpr);
    }else{
      yygotominor.yy346.pExpr = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy346.pExpr, 0, 0);
      if( yygotominor.yy346.pExpr ){
        yygotominor.yy346.pExpr->x.pList = yymsp[-1].minor.yy14;
        sqlite3ExprSetHeight(pParse, yygotominor.yy346.pExpr);
      }else{
        sqlite3ExprListDelete(pParse->db, yymsp[-1].minor.yy14);
      }
      if( yymsp[-3].minor.yy328 ) yygotominor.yy346.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy346.pExpr, 0, 0);
    }
    yygotominor.yy346.zStart = yymsp[-4].minor.yy346.zStart;
    yygotominor.yy346.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
  }
        break;
      case 224: /* expr ::= LP select RP */
{
    yygotominor.yy346.pExpr = sqlite3PExpr(pParse, TK_SELECT, 0, 0, 0);
    if( yygotominor.yy346.pExpr ){
      yygotominor.yy346.pExpr->x.pSelect = yymsp[-1].minor.yy3;
      ExprSetProperty(yygotominor.yy346.pExpr, EP_xIsSelect);
      sqlite3ExprSetHeight(pParse, yygotominor.yy346.pExpr);
    }else{
      sqlite3SelectDelete(pParse->db, yymsp[-1].minor.yy3);
    }
    yygotominor.yy346.zStart = yymsp[-2].minor.yy0.z;
    yygotominor.yy346.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
  }
        break;
      case 225: /* expr ::= expr in_op LP select RP */
{
    yygotominor.yy346.pExpr = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy346.pExpr, 0, 0);
    if( yygotominor.yy346.pExpr ){
      yygotominor.yy346.pExpr->x.pSelect = yymsp[-1].minor.yy3;
      ExprSetProperty(yygotominor.yy346.pExpr, EP_xIsSelect);
      sqlite3ExprSetHeight(pParse, yygotominor.yy346.pExpr);
    }else{
      sqlite3SelectDelete(pParse->db, yymsp[-1].minor.yy3);
    }
    if( yymsp[-3].minor.yy328 ) yygotominor.yy346.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy346.pExpr, 0, 0);
    yygotominor.yy346.zStart = yymsp[-4].minor.yy346.zStart;
    yygotominor.yy346.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
  }
        break;
      case 226: /* expr ::= expr in_op nm dbnm */
{
    SrcList *pSrc = sqlite3SrcListAppend(pParse->db, 0,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0);
    yygotominor.yy346.pExpr = sqlite3PExpr(pParse, TK_IN, yymsp[-3].minor.yy346.pExpr, 0, 0);
    if( yygotominor.yy346.pExpr ){
      yygotominor.yy346.pExpr->x.pSelect = sqlite3SelectNew(pParse, 0,pSrc,0,0,0,0,0,0,0);
      ExprSetProperty(yygotominor.yy346.pExpr, EP_xIsSelect);
      sqlite3ExprSetHeight(pParse, yygotominor.yy346.pExpr);
    }else{
      sqlite3SrcListDelete(pParse->db, pSrc);
    }
    if( yymsp[-2].minor.yy328 ) yygotominor.yy346.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy346.pExpr, 0, 0);
    yygotominor.yy346.zStart = yymsp[-3].minor.yy346.zStart;
    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];
  }
        break;
      case 227: /* expr ::= EXISTS LP select RP */
{
    Expr *p = yygotominor.yy346.pExpr = sqlite3PExpr(pParse, TK_EXISTS, 0, 0, 0);
    if( p ){
      p->x.pSelect = yymsp[-1].minor.yy3;
      ExprSetProperty(p, EP_xIsSelect);
      sqlite3ExprSetHeight(pParse, p);
    }else{
      sqlite3SelectDelete(pParse->db, yymsp[-1].minor.yy3);
    }
    yygotominor.yy346.zStart = yymsp[-3].minor.yy0.z;
    yygotominor.yy346.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
  }
        break;
      case 228: /* expr ::= CASE case_operand case_exprlist case_else END */
{
  yygotominor.yy346.pExpr = sqlite3PExpr(pParse, TK_CASE, yymsp[-3].minor.yy132, 0, 0);
  if( yygotominor.yy346.pExpr ){
    yygotominor.yy346.pExpr->x.pList = yymsp[-1].minor.yy132 ? sqlite3ExprListAppend(pParse,yymsp[-2].minor.yy14,yymsp[-1].minor.yy132) : yymsp[-2].minor.yy14;
    sqlite3ExprSetHeight(pParse, yygotominor.yy346.pExpr);
  }else{
    sqlite3ExprListDelete(pParse->db, yymsp[-2].minor.yy14);
    sqlite3ExprDelete(pParse->db, yymsp[-1].minor.yy132);
  }
  yygotominor.yy346.zStart = yymsp[-4].minor.yy0.z;
  yygotominor.yy346.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
}
        break;
      case 229: /* case_exprlist ::= case_exprlist WHEN expr THEN expr */
{
  yygotominor.yy14 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy14, yymsp[-2].minor.yy346.pExpr);
  yygotominor.yy14 = sqlite3ExprListAppend(pParse,yygotominor.yy14, yymsp[0].minor.yy346.pExpr);
}
        break;
      case 230: /* case_exprlist ::= WHEN expr THEN expr */
{
  yygotominor.yy14 = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy346.pExpr);
  yygotominor.yy14 = sqlite3ExprListAppend(pParse,yygotominor.yy14, yymsp[0].minor.yy346.pExpr);
}
        break;
      case 237: /* nexprlist ::= nexprlist COMMA expr */
{yygotominor.yy14 = sqlite3ExprListAppend(pParse,yymsp[-2].minor.yy14,yymsp[0].minor.yy346.pExpr);}
        break;
      case 238: /* nexprlist ::= expr */
{yygotominor.yy14 = sqlite3ExprListAppend(pParse,0,yymsp[0].minor.yy346.pExpr);}
        break;
      case 239: /* cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP idxlist RP where_opt */
{
  sqlite3CreateIndex(pParse, &yymsp[-7].minor.yy0, &yymsp[-6].minor.yy0, 
                     sqlite3SrcListAppend(pParse->db,0,&yymsp[-4].minor.yy0,0), yymsp[-2].minor.yy14, yymsp[-10].minor.yy328,
                      &yymsp[-11].minor.yy0, yymsp[0].minor.yy132, SQLITE_SO_ASC, yymsp[-8].minor.yy328);
}
        break;
      case 240: /* uniqueflag ::= UNIQUE */
      case 291: /* raisetype ::= ABORT */ yytestcase(yyruleno==291);
{yygotominor.yy328 = OE_Abort;}
        break;
      case 241: /* uniqueflag ::= */
{yygotominor.yy328 = OE_None;}
        break;
      case 244: /* idxlist ::= idxlist COMMA nm collate sortorder */
{
  Expr *p = sqlite3ExprAddCollateToken(pParse, 0, &yymsp[-1].minor.yy0);
  yygotominor.yy14 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy14, p);
  sqlite3ExprListSetName(pParse,yygotominor.yy14,&yymsp[-2].minor.yy0,1);
  sqlite3ExprListCheckLength(pParse, yygotominor.yy14, "index");
  if( yygotominor.yy14 ) yygotominor.yy14->a[yygotominor.yy14->nExpr-1].sortOrder = (u8)yymsp[0].minor.yy328;
}
        break;
      case 245: /* idxlist ::= nm collate sortorder */
{
  Expr *p = sqlite3ExprAddCollateToken(pParse, 0, &yymsp[-1].minor.yy0);
  yygotominor.yy14 = sqlite3ExprListAppend(pParse,0, p);
  sqlite3ExprListSetName(pParse, yygotominor.yy14, &yymsp[-2].minor.yy0, 1);
  sqlite3ExprListCheckLength(pParse, yygotominor.yy14, "index");
  if( yygotominor.yy14 ) yygotominor.yy14->a[yygotominor.yy14->nExpr-1].sortOrder = (u8)yymsp[0].minor.yy328;
}
        break;
      case 246: /* collate ::= */
{yygotominor.yy0.z = 0; yygotominor.yy0.n = 0;}
        break;
      case 248: /* cmd ::= DROP INDEX ifexists fullname */
{sqlite3DropIndex(pParse, yymsp[0].minor.yy65, yymsp[-1].minor.yy328);}
        break;
      case 249: /* cmd ::= VACUUM */
      case 250: /* cmd ::= VACUUM nm */ yytestcase(yyruleno==250);
{sqlite3Vacuum(pParse);}
        break;
      case 251: /* cmd ::= PRAGMA nm dbnm */
{sqlite3Pragma(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,0,0);}
        break;
      case 252: /* cmd ::= PRAGMA nm dbnm EQ nmnum */
{sqlite3Pragma(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0,0);}
        break;
      case 253: /* cmd ::= PRAGMA nm dbnm LP nmnum RP */
{sqlite3Pragma(pParse,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,&yymsp[-1].minor.yy0,0);}
        break;
      case 254: /* cmd ::= PRAGMA nm dbnm EQ minus_num */
{sqlite3Pragma(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0,1);}
        break;
      case 255: /* cmd ::= PRAGMA nm dbnm LP minus_num RP */
{sqlite3Pragma(pParse,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,&yymsp[-1].minor.yy0,1);}
        break;
      case 264: /* cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END */
{
  Token all;
  all.z = yymsp[-3].minor.yy0.z;
  all.n = (int)(yymsp[0].minor.yy0.z - yymsp[-3].minor.yy0.z) + yymsp[0].minor.yy0.n;
  sqlite3FinishTrigger(pParse, yymsp[-1].minor.yy473, &all);
}
        break;
      case 265: /* trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause */
{
  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);
  yygotominor.yy0 = (yymsp[-6].minor.yy0.n==0?yymsp[-7].minor.yy0:yymsp[-6].minor.yy0);
}
        break;
      case 266: /* trigger_time ::= BEFORE */
      case 269: /* trigger_time ::= */ yytestcase(yyruleno==269);
{ yygotominor.yy328 = TK_BEFORE; }
        break;
      case 267: /* trigger_time ::= AFTER */
{ yygotominor.yy328 = TK_AFTER;  }
        break;
      case 268: /* trigger_time ::= INSTEAD OF */
{ yygotominor.yy328 = TK_INSTEAD;}
        break;
      case 270: /* trigger_event ::= DELETE|INSERT */
      case 271: /* trigger_event ::= UPDATE */ yytestcase(yyruleno==271);
{yygotominor.yy378.a = yymsp[0].major; yygotominor.yy378.b = 0;}
        break;
      case 272: /* trigger_event ::= UPDATE OF idlist */
{yygotominor.yy378.a = TK_UPDATE; yygotominor.yy378.b = yymsp[0].minor.yy408;}
        break;
      case 275: /* when_clause ::= */
      case 296: /* key_opt ::= */ yytestcase(yyruleno==296);
{ yygotominor.yy132 = 0; }
        break;
      case 276: /* when_clause ::= WHEN expr */
      case 297: /* key_opt ::= KEY expr */ yytestcase(yyruleno==297);
{ yygotominor.yy132 = yymsp[0].minor.yy346.pExpr; }
        break;
      case 277: /* trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI */
{
  assert( yymsp[-2].minor.yy473!=0 );
  yymsp[-2].minor.yy473->pLast->pNext = yymsp[-1].minor.yy473;
  yymsp[-2].minor.yy473->pLast = yymsp[-1].minor.yy473;
  yygotominor.yy473 = yymsp[-2].minor.yy473;
}
        break;
      case 278: /* trigger_cmd_list ::= trigger_cmd SEMI */
{ 
  assert( yymsp[-1].minor.yy473!=0 );
  yymsp[-1].minor.yy473->pLast = yymsp[-1].minor.yy473;
  yygotominor.yy473 = yymsp[-1].minor.yy473;
}
        break;
      case 280: /* trnm ::= nm DOT nm */
{
  yygotominor.yy0 = yymsp[0].minor.yy0;
  sqlite3ErrorMsg(pParse, 
        "qualified table names are not allowed on INSERT, UPDATE, and DELETE "
        "statements within triggers");
}
        break;
      case 282: /* tridxby ::= INDEXED BY nm */
{
  sqlite3ErrorMsg(pParse,
        "the INDEXED BY clause is not allowed on UPDATE or DELETE statements "
        "within triggers");
}
        break;
      case 283: /* tridxby ::= NOT INDEXED */
{
  sqlite3ErrorMsg(pParse,
        "the NOT INDEXED clause is not allowed on UPDATE or DELETE statements "
        "within triggers");
}
        break;
      case 284: /* trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist where_opt */
{ yygotominor.yy473 = sqlite3TriggerUpdateStep(pParse->db, &yymsp[-4].minor.yy0, yymsp[-1].minor.yy14, yymsp[0].minor.yy132, yymsp[-5].minor.yy186); }
        break;



      case 285: /* trigger_cmd ::= insert_cmd INTO trnm inscollist_opt select */
{yygotominor.yy473 = sqlite3TriggerInsertStep(pParse->db, &yymsp[-2].minor.yy0, yymsp[-1].minor.yy408, yymsp[0].minor.yy3, yymsp[-4].minor.yy186);}
        break;
      case 286: /* trigger_cmd ::= DELETE FROM trnm tridxby where_opt */
{yygotominor.yy473 = sqlite3TriggerDeleteStep(pParse->db, &yymsp[-2].minor.yy0, yymsp[0].minor.yy132);}
        break;
      case 287: /* trigger_cmd ::= select */
{yygotominor.yy473 = sqlite3TriggerSelectStep(pParse->db, yymsp[0].minor.yy3); }
        break;
      case 288: /* expr ::= RAISE LP IGNORE RP */
{
  yygotominor.yy346.pExpr = sqlite3PExpr(pParse, TK_RAISE, 0, 0, 0); 
  if( yygotominor.yy346.pExpr ){
    yygotominor.yy346.pExpr->affinity = OE_Ignore;
  }
  yygotominor.yy346.zStart = yymsp[-3].minor.yy0.z;
  yygotominor.yy346.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
}
        break;
      case 289: /* expr ::= RAISE LP raisetype COMMA nm RP */
{
  yygotominor.yy346.pExpr = sqlite3PExpr(pParse, TK_RAISE, 0, 0, &yymsp[-1].minor.yy0); 
  if( yygotominor.yy346.pExpr ) {
    yygotominor.yy346.pExpr->affinity = (char)yymsp[-3].minor.yy328;
  }
  yygotominor.yy346.zStart = yymsp[-5].minor.yy0.z;
  yygotominor.yy346.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
}
        break;
      case 290: /* raisetype ::= ROLLBACK */
{yygotominor.yy328 = OE_Rollback;}
        break;
      case 292: /* raisetype ::= FAIL */
{yygotominor.yy328 = OE_Fail;}
        break;
      case 293: /* cmd ::= DROP TRIGGER ifexists fullname */
{
  sqlite3DropTrigger(pParse,yymsp[0].minor.yy65,yymsp[-1].minor.yy328);
}
        break;
      case 294: /* cmd ::= ATTACH database_kw_opt expr AS expr key_opt */
{
  sqlite3Attach(pParse, yymsp[-3].minor.yy346.pExpr, yymsp[-1].minor.yy346.pExpr, yymsp[0].minor.yy132);
}
        break;
      case 295: /* cmd ::= DETACH database_kw_opt expr */
{
  sqlite3Detach(pParse, yymsp[0].minor.yy346.pExpr);
}
        break;
      case 300: /* cmd ::= REINDEX */
{sqlite3Reindex(pParse, 0, 0);}
        break;
      case 301: /* cmd ::= REINDEX nm dbnm */
{sqlite3Reindex(pParse, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0);}
        break;
      case 302: /* cmd ::= ANALYZE */
{sqlite3Analyze(pParse, 0, 0);}
        break;
      case 303: /* cmd ::= ANALYZE nm dbnm */
{sqlite3Analyze(pParse, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0);}
        break;
      case 304: /* cmd ::= ALTER TABLE fullname RENAME TO nm */
{
  sqlite3AlterRenameTable(pParse,yymsp[-3].minor.yy65,&yymsp[0].minor.yy0);
}
        break;
      case 305: /* cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt column */
{
  sqlite3AlterFinishAddColumn(pParse, &yymsp[0].minor.yy0);
}
        break;
      case 306: /* add_column_fullname ::= fullname */
{
  pParse->db->lookaside.bEnabled = 0;
  sqlite3AlterBeginAddColumn(pParse, yymsp[0].minor.yy65);
}
        break;
      case 309: /* cmd ::= create_vtab */
{sqlite3VtabFinishParse(pParse,0);}
        break;
      case 310: /* cmd ::= create_vtab LP vtabarglist RP */
{sqlite3VtabFinishParse(pParse,&yymsp[0].minor.yy0);}
        break;
      case 311: /* create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm */
{
    sqlite3VtabBeginParse(pParse, &yymsp[-3].minor.yy0, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-4].minor.yy328);
}
        break;
      case 314: /* vtabarg ::= */
{sqlite3VtabArgInit(pParse);}
        break;
      case 316: /* vtabargtoken ::= ANY */
      case 317: /* vtabargtoken ::= lp anylist RP */ yytestcase(yyruleno==317);
      case 318: /* lp ::= LP */ yytestcase(yyruleno==318);
{sqlite3VtabArgExtend(pParse,&yymsp[0].minor.yy0);}
        break;
      case 322: /* with ::= */
{yygotominor.yy59 = 0;}
        break;
      case 323: /* with ::= WITH wqlist */
      case 324: /* with ::= WITH RECURSIVE wqlist */ yytestcase(yyruleno==324);
{ yygotominor.yy59 = yymsp[0].minor.yy59; }
        break;
      case 325: /* wqlist ::= nm idxlist_opt AS LP select RP */
{
  yygotominor.yy59 = sqlite3WithAdd(pParse, 0, &yymsp[-5].minor.yy0, yymsp[-4].minor.yy14, yymsp[-1].minor.yy3);
}
        break;
      case 326: /* wqlist ::= wqlist COMMA nm idxlist_opt AS LP select RP */
{
  yygotominor.yy59 = sqlite3WithAdd(pParse, yymsp[-7].minor.yy59, &yymsp[-5].minor.yy0, yymsp[-4].minor.yy14, yymsp[-1].minor.yy3);
}
        break;
      default:
      /* (0) input ::= cmdlist */ yytestcase(yyruleno==0);
      /* (1) cmdlist ::= cmdlist ecmd */ yytestcase(yyruleno==1);
      /* (2) cmdlist ::= ecmd */ yytestcase(yyruleno==2);
      /* (3) ecmd ::= SEMI */ yytestcase(yyruleno==3);
      /* (4) ecmd ::= explain cmdx SEMI */ yytestcase(yyruleno==4);
      /* (10) trans_opt ::= */ yytestcase(yyruleno==10);
      /* (11) trans_opt ::= TRANSACTION */ yytestcase(yyruleno==11);
      /* (12) trans_opt ::= TRANSACTION nm */ yytestcase(yyruleno==12);
      /* (20) savepoint_opt ::= SAVEPOINT */ yytestcase(yyruleno==20);
      /* (21) savepoint_opt ::= */ yytestcase(yyruleno==21);
      /* (25) cmd ::= create_table create_table_args */ yytestcase(yyruleno==25);
      /* (36) columnlist ::= columnlist COMMA column */ yytestcase(yyruleno==36);
      /* (37) columnlist ::= column */ yytestcase(yyruleno==37);
      /* (43) type ::= */ yytestcase(yyruleno==43);
      /* (50) signed ::= plus_num */ yytestcase(yyruleno==50);
      /* (51) signed ::= minus_num */ yytestcase(yyruleno==51);
      /* (52) carglist ::= carglist ccons */ yytestcase(yyruleno==52);
      /* (53) carglist ::= */ yytestcase(yyruleno==53);
      /* (60) ccons ::= NULL onconf */ yytestcase(yyruleno==60);
      /* (88) conslist ::= conslist tconscomma tcons */ yytestcase(yyruleno==88);
      /* (89) conslist ::= tcons */ yytestcase(yyruleno==89);
      /* (91) tconscomma ::= */ yytestcase(yyruleno==91);
      /* (273) foreach_clause ::= */ yytestcase(yyruleno==273);
      /* (274) foreach_clause ::= FOR EACH ROW */ yytestcase(yyruleno==274);
      /* (281) tridxby ::= */ yytestcase(yyruleno==281);
      /* (298) database_kw_opt ::= DATABASE */ yytestcase(yyruleno==298);
      /* (299) database_kw_opt ::= */ yytestcase(yyruleno==299);
      /* (307) kwcolumn_opt ::= */ yytestcase(yyruleno==307);
      /* (308) kwcolumn_opt ::= COLUMNKW */ yytestcase(yyruleno==308);
      /* (312) vtabarglist ::= vtabarg */ yytestcase(yyruleno==312);
      /* (313) vtabarglist ::= vtabarglist COMMA vtabarg */ yytestcase(yyruleno==313);
      /* (315) vtabarg ::= vtabarg vtabargtoken */ yytestcase(yyruleno==315);
      /* (319) anylist ::= */ yytestcase(yyruleno==319);
      /* (320) anylist ::= anylist LP anylist RP */ yytestcase(yyruleno==320);
      /* (321) anylist ::= anylist ANY */ yytestcase(yyruleno==321);
        break;
  };
  assert( yyruleno>=0 && yyruleno<sizeof(yyRuleInfo)/sizeof(yyRuleInfo[0]) );
  yygoto = yyRuleInfo[yyruleno].lhs;
  yysize = yyRuleInfo[yyruleno].nrhs;
  yypParser->yyidx -= yysize;
  yyact = yy_find_reduce_action(yymsp[-yysize].stateno,(YYCODETYPE)yygoto);
117652
117653
117654
117655
117656
117657
117658
117659
117660
117661
117662
117663
117664
117665
117666
117667
117668
117669
117670
117671
117672
117673
117674
117675
117676
117677
117678
117679
117680
117681
117682
117683
117684
117685
117686
117687
117688
117689
117690
117691
117692
117693
117694
117695
117696
117697
117698
117699
117700
117701
117702
117703
117704
117705
117706
117707
117708
117709
117710
117711
117712
117713
117714
117715
117716
117717
117718
117719
117720
117721
117722
117723
117724
117725
117726
117727
117728
117729
117730
117731
117732
117733
117734
117735
117736
117737
117738
117739
117740
117741
117742
117743
117744
117745
117746
117747
117748
117749
117750
117751
117752
117753
117754
117755
117756
117757
117758
117759
117760
117761
117762
117763
117764
117765
117766
117767
117768
117769
117770
117771
117772
117773
117774
117775
117776
117777
117778
117779
117780
117781
117782
117783
117784
117785
** The code in this file implements a function that determines whether
** or not a given identifier is really an SQL keyword.  The same thing
** might be implemented more directly using a hand-written hash table.
** But by using this automatically generated code, the size of the code
** is substantially reduced.  This is important for embedded applications
** on platforms with limited memory.
*/
/* Hash score: 177 */
static int keywordCode(const char *z, int n){
  /* zText[] encodes 819 bytes of keywords in 545 bytes */
  /*   REINDEXEDESCAPEACHECKEYBEFOREIGNOREGEXPLAINSTEADDATABASELECT       */
  /*   ABLEFTHENDEFERRABLELSEXCEPTRANSACTIONATURALTERAISEXCLUSIVE         */
  /*   XISTSAVEPOINTERSECTRIGGEREFERENCESCONSTRAINTOFFSETEMPORARY         */
  /*   UNIQUERYWITHOUTERELEASEATTACHAVINGROUPDATEBEGINNERENAMEBETWEEN     */
  /*   OTNULLIKECASCADELETECASECOLLATECREATECURRENT_DATEDETACH            */
  /*   IMMEDIATEJOINSERTMATCHPLANALYZEPRAGMABORTVALUESVIRTUALIMITWHEN     */
  /*   WHEREPLACEAFTERESTRICTANDEFAULTAUTOINCREMENTCASTCOLUMNCOMMIT       */
  /*   CONFLICTCROSSCURRENT_TIMESTAMPRIMARYDEFERREDISTINCTDROPFAIL        */
  /*   FROMFULLGLOBYIFISNULLORDERIGHTROLLBACKROWUNIONUSINGVACUUMVIEW      */
  /*   INITIALLY                                                          */
  static const char zText[544] = {
    'R','E','I','N','D','E','X','E','D','E','S','C','A','P','E','A','C','H',
    'E','C','K','E','Y','B','E','F','O','R','E','I','G','N','O','R','E','G',
    'E','X','P','L','A','I','N','S','T','E','A','D','D','A','T','A','B','A',
    'S','E','L','E','C','T','A','B','L','E','F','T','H','E','N','D','E','F',
    'E','R','R','A','B','L','E','L','S','E','X','C','E','P','T','R','A','N',
    'S','A','C','T','I','O','N','A','T','U','R','A','L','T','E','R','A','I',
    'S','E','X','C','L','U','S','I','V','E','X','I','S','T','S','A','V','E',
    'P','O','I','N','T','E','R','S','E','C','T','R','I','G','G','E','R','E',
    'F','E','R','E','N','C','E','S','C','O','N','S','T','R','A','I','N','T',
    'O','F','F','S','E','T','E','M','P','O','R','A','R','Y','U','N','I','Q',
    'U','E','R','Y','W','I','T','H','O','U','T','E','R','E','L','E','A','S',
    'E','A','T','T','A','C','H','A','V','I','N','G','R','O','U','P','D','A',
    'T','E','B','E','G','I','N','N','E','R','E','N','A','M','E','B','E','T',
    'W','E','E','N','O','T','N','U','L','L','I','K','E','C','A','S','C','A',
    'D','E','L','E','T','E','C','A','S','E','C','O','L','L','A','T','E','C',
    'R','E','A','T','E','C','U','R','R','E','N','T','_','D','A','T','E','D',
    'E','T','A','C','H','I','M','M','E','D','I','A','T','E','J','O','I','N',
    'S','E','R','T','M','A','T','C','H','P','L','A','N','A','L','Y','Z','E',
    'P','R','A','G','M','A','B','O','R','T','V','A','L','U','E','S','V','I',
    'R','T','U','A','L','I','M','I','T','W','H','E','N','W','H','E','R','E',
    'P','L','A','C','E','A','F','T','E','R','E','S','T','R','I','C','T','A',
    'N','D','E','F','A','U','L','T','A','U','T','O','I','N','C','R','E','M',
    'E','N','T','C','A','S','T','C','O','L','U','M','N','C','O','M','M','I',
    'T','C','O','N','F','L','I','C','T','C','R','O','S','S','C','U','R','R',
    'E','N','T','_','T','I','M','E','S','T','A','M','P','R','I','M','A','R',
    'Y','D','E','F','E','R','R','E','D','I','S','T','I','N','C','T','D','R',
    'O','P','F','A','I','L','F','R','O','M','F','U','L','L','G','L','O','B',
    'Y','I','F','I','S','N','U','L','L','O','R','D','E','R','I','G','H','T',
    'R','O','L','L','B','A','C','K','R','O','W','U','N','I','O','N','U','S',
    'I','N','G','V','A','C','U','U','M','V','I','E','W','I','N','I','T','I',
    'A','L','L','Y',
  };
  static const unsigned char aHash[127] = {
      75, 104, 115,  73,   0,  45,   0,   0,  81,   0,  76,   0,   0,
      42,  12,  77,  15,   0, 114,  84,  53, 111,   0,  19,   0,   0,
     119,   0, 117,  88,   0,  22,  92,   0,   9,   0,   0,  69,  70,
       0,  68,   6,   0,  48,  89, 101,   0, 116, 100,   0,   0,  44,
       0, 102,  24,   0,  17,   0, 120,  52,  23,   0,   5, 109,  25,
      95,   0,   0, 122, 105,  59, 121,  56,  28,  54,   0,  90,   0,
      99,  26,   0,  98,   0,   0,   0,  94,  91,  96,  87, 108,  14,
      39, 107,   0,  80,   0,  18,  86, 110,  32,   0, 118,  79, 112,
      61,  46,  83,   0,   0,  93,  40,   0, 113,   0,  36,   0,   0,
      29,   0,  85,  62,  63,   0,  20,  60,   0,  55,
  };
  static const unsigned char aNext[122] = {
       0,   0,   0,   0,   4,   0,   0,   0,   0,   0,   0,   0,   0,
       0,   2,   0,   0,   0,   0,   0,   0,  13,   0,   0,   0,   0,
       0,   7,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
       0,   0,   0,   0,  33,   0,  21,   0,   0,   0,   0,   0,   0,
      43,   3,  47,   0,   0,   0,   0,  30,   0,  57,   0,  38,   0,
       0,   0,   1,  65,   0,   0,  66,   0,  41,   0,   0,   0,   0,
       0,   0,  49,  64,   0,   0,   0,  51,  31,   0,  16,  34,  10,
       0,   0,   0,   0,   0,   0,   0,  11,  71,  78,   0,   8,   0,
     103,  97,   0, 106,   0,  58,   0,  74,  50,  27,  37,  72,  82,
       0,  35,  67,   0,   0,
  };
  static const unsigned char aLen[122] = {
       7,   7,   5,   4,   6,   4,   5,   3,   6,   7,   3,   6,   6,
       7,   7,   3,   8,   2,   6,   5,   4,   4,   3,  10,   4,   6,
      11,   6,   2,   7,   5,   5,   9,   6,   9,   9,   7,  10,  10,
       4,   6,   2,   3,   9,   4,   2,   6,   5,   7,   5,   7,   6,
       6,   5,   6,   5,   5,   6,   7,   7,   3,   2,   4,   4,   7,
       3,   6,   4,   7,   6,  12,   6,   9,   4,   6,   5,   4,   7,
       6,   5,   6,   7,   5,   4,   5,   7,   5,   8,   3,   7,  13,
       2,   2,   4,   6,   6,   8,   5,  17,  12,   7,   8,   8,   2,
       4,   4,   4,   4,   4,   2,   2,   6,   5,   5,   8,   3,   5,
       5,   6,   4,   9,   3,
  };
  static const unsigned short int aOffset[122] = {
       0,   2,   2,   8,   9,  14,  16,  20,  23,  25,  25,  29,  33,
      36,  41,  46,  48,  53,  54,  59,  62,  65,  67,  69,  78,  81,
      86,  91,  95,  96, 101, 105, 109, 117, 122, 128, 136, 142, 152,
     159, 162, 162, 165, 167, 167, 171, 176, 179, 184, 188, 192, 199,
     204, 209, 212, 218, 221, 225, 231, 237, 237, 237, 240, 243, 247,
     248, 252, 258, 262, 269, 275, 287, 293, 302, 304, 310, 315, 317,
     324, 329, 334, 340, 346, 351, 355, 358, 365, 369, 377, 379, 386,
     388, 390, 399, 403, 409, 415, 423, 428, 428, 444, 451, 458, 459,
     466, 470, 474, 478, 482, 485, 487, 489, 495, 499, 504, 512, 515,
     520, 525, 531, 535, 540,
  };
  static const unsigned char aCode[122] = {
    TK_REINDEX,    TK_INDEXED,    TK_INDEX,      TK_DESC,       TK_ESCAPE,     
    TK_EACH,       TK_CHECK,      TK_KEY,        TK_BEFORE,     TK_FOREIGN,    
    TK_FOR,        TK_IGNORE,     TK_LIKE_KW,    TK_EXPLAIN,    TK_INSTEAD,    
    TK_ADD,        TK_DATABASE,   TK_AS,         TK_SELECT,     TK_TABLE,      
    TK_JOIN_KW,    TK_THEN,       TK_END,        TK_DEFERRABLE, TK_ELSE,       
    TK_EXCEPT,     TK_TRANSACTION,TK_ACTION,     TK_ON,         TK_JOIN_KW,    
    TK_ALTER,      TK_RAISE,      TK_EXCLUSIVE,  TK_EXISTS,     TK_SAVEPOINT,  
    TK_INTERSECT,  TK_TRIGGER,    TK_REFERENCES, TK_CONSTRAINT, TK_INTO,       
    TK_OFFSET,     TK_OF,         TK_SET,        TK_TEMP,       TK_TEMP,       
    TK_OR,         TK_UNIQUE,     TK_QUERY,      TK_WITHOUT,    TK_JOIN_KW,    
    TK_RELEASE,    TK_ATTACH,     TK_HAVING,     TK_GROUP,      TK_UPDATE,     
    TK_BEGIN,      TK_JOIN_KW,    TK_RENAME,     TK_BETWEEN,    TK_NOTNULL,    
    TK_NOT,        TK_NO,         TK_NULL,       TK_LIKE_KW,    TK_CASCADE,    
    TK_ASC,        TK_DELETE,     TK_CASE,       TK_COLLATE,    TK_CREATE,     
    TK_CTIME_KW,   TK_DETACH,     TK_IMMEDIATE,  TK_JOIN,       TK_INSERT,     
    TK_MATCH,      TK_PLAN,       TK_ANALYZE,    TK_PRAGMA,     TK_ABORT,      
    TK_VALUES,     TK_VIRTUAL,    TK_LIMIT,      TK_WHEN,       TK_WHERE,      
    TK_REPLACE,    TK_AFTER,      TK_RESTRICT,   TK_AND,        TK_DEFAULT,    
    TK_AUTOINCR,   TK_TO,         TK_IN,         TK_CAST,       TK_COLUMNKW,   
    TK_COMMIT,     TK_CONFLICT,   TK_JOIN_KW,    TK_CTIME_KW,   TK_CTIME_KW,   
    TK_PRIMARY,    TK_DEFERRED,   TK_DISTINCT,   TK_IS,         TK_DROP,       
    TK_FAIL,       TK_FROM,       TK_JOIN_KW,    TK_LIKE_KW,    TK_BY,         
    TK_IF,         TK_ISNULL,     TK_ORDER,      TK_JOIN_KW,    TK_ROLLBACK,   
    TK_ROW,        TK_UNION,      TK_USING,      TK_VACUUM,     TK_VIEW,       
    TK_INITIALLY,  TK_ALL,        
  };
  int h, i;
  if( n<2 ) return TK_ID;
  h = ((charMap(z[0])*4) ^
      (charMap(z[n-1])*3) ^
      n) % 127;
  for(i=((int)aHash[h])-1; i>=0; i=((int)aNext[i])-1){







|

|



|
|

|

|
|
|












|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|


|
|
|
|
|
|
|
|
|
|

|



|
|
|
|
|
|
|

|



|
|
|
|
|
|
|

|



|
|
|
|
|
|
|

|









|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|







118157
118158
118159
118160
118161
118162
118163
118164
118165
118166
118167
118168
118169
118170
118171
118172
118173
118174
118175
118176
118177
118178
118179
118180
118181
118182
118183
118184
118185
118186
118187
118188
118189
118190
118191
118192
118193
118194
118195
118196
118197
118198
118199
118200
118201
118202
118203
118204
118205
118206
118207
118208
118209
118210
118211
118212
118213
118214
118215
118216
118217
118218
118219
118220
118221
118222
118223
118224
118225
118226
118227
118228
118229
118230
118231
118232
118233
118234
118235
118236
118237
118238
118239
118240
118241
118242
118243
118244
118245
118246
118247
118248
118249
118250
118251
118252
118253
118254
118255
118256
118257
118258
118259
118260
118261
118262
118263
118264
118265
118266
118267
118268
118269
118270
118271
118272
118273
118274
118275
118276
118277
118278
118279
118280
118281
118282
118283
118284
118285
118286
118287
118288
118289
118290
** The code in this file implements a function that determines whether
** or not a given identifier is really an SQL keyword.  The same thing
** might be implemented more directly using a hand-written hash table.
** But by using this automatically generated code, the size of the code
** is substantially reduced.  This is important for embedded applications
** on platforms with limited memory.
*/
/* Hash score: 182 */
static int keywordCode(const char *z, int n){
  /* zText[] encodes 834 bytes of keywords in 554 bytes */
  /*   REINDEXEDESCAPEACHECKEYBEFOREIGNOREGEXPLAINSTEADDATABASELECT       */
  /*   ABLEFTHENDEFERRABLELSEXCEPTRANSACTIONATURALTERAISEXCLUSIVE         */
  /*   XISTSAVEPOINTERSECTRIGGEREFERENCESCONSTRAINTOFFSETEMPORARY         */
  /*   UNIQUERYWITHOUTERELEASEATTACHAVINGROUPDATEBEGINNERECURSIVE         */
  /*   BETWEENOTNULLIKECASCADELETECASECOLLATECREATECURRENT_DATEDETACH     */
  /*   IMMEDIATEJOINSERTMATCHPLANALYZEPRAGMABORTVALUESVIRTUALIMITWHEN     */
  /*   WHERENAMEAFTEREPLACEANDEFAULTAUTOINCREMENTCASTCOLUMNCOMMIT         */
  /*   CONFLICTCROSSCURRENT_TIMESTAMPRIMARYDEFERREDISTINCTDROPFAIL        */
  /*   FROMFULLGLOBYIFISNULLORDERESTRICTRIGHTROLLBACKROWUNIONUSING        */
  /*   VACUUMVIEWINITIALLY                                                */
  static const char zText[553] = {
    'R','E','I','N','D','E','X','E','D','E','S','C','A','P','E','A','C','H',
    'E','C','K','E','Y','B','E','F','O','R','E','I','G','N','O','R','E','G',
    'E','X','P','L','A','I','N','S','T','E','A','D','D','A','T','A','B','A',
    'S','E','L','E','C','T','A','B','L','E','F','T','H','E','N','D','E','F',
    'E','R','R','A','B','L','E','L','S','E','X','C','E','P','T','R','A','N',
    'S','A','C','T','I','O','N','A','T','U','R','A','L','T','E','R','A','I',
    'S','E','X','C','L','U','S','I','V','E','X','I','S','T','S','A','V','E',
    'P','O','I','N','T','E','R','S','E','C','T','R','I','G','G','E','R','E',
    'F','E','R','E','N','C','E','S','C','O','N','S','T','R','A','I','N','T',
    'O','F','F','S','E','T','E','M','P','O','R','A','R','Y','U','N','I','Q',
    'U','E','R','Y','W','I','T','H','O','U','T','E','R','E','L','E','A','S',
    'E','A','T','T','A','C','H','A','V','I','N','G','R','O','U','P','D','A',
    'T','E','B','E','G','I','N','N','E','R','E','C','U','R','S','I','V','E',
    'B','E','T','W','E','E','N','O','T','N','U','L','L','I','K','E','C','A',
    'S','C','A','D','E','L','E','T','E','C','A','S','E','C','O','L','L','A',
    'T','E','C','R','E','A','T','E','C','U','R','R','E','N','T','_','D','A',
    'T','E','D','E','T','A','C','H','I','M','M','E','D','I','A','T','E','J',
    'O','I','N','S','E','R','T','M','A','T','C','H','P','L','A','N','A','L',
    'Y','Z','E','P','R','A','G','M','A','B','O','R','T','V','A','L','U','E',
    'S','V','I','R','T','U','A','L','I','M','I','T','W','H','E','N','W','H',
    'E','R','E','N','A','M','E','A','F','T','E','R','E','P','L','A','C','E',
    'A','N','D','E','F','A','U','L','T','A','U','T','O','I','N','C','R','E',
    'M','E','N','T','C','A','S','T','C','O','L','U','M','N','C','O','M','M',
    'I','T','C','O','N','F','L','I','C','T','C','R','O','S','S','C','U','R',
    'R','E','N','T','_','T','I','M','E','S','T','A','M','P','R','I','M','A',
    'R','Y','D','E','F','E','R','R','E','D','I','S','T','I','N','C','T','D',
    'R','O','P','F','A','I','L','F','R','O','M','F','U','L','L','G','L','O',
    'B','Y','I','F','I','S','N','U','L','L','O','R','D','E','R','E','S','T',
    'R','I','C','T','R','I','G','H','T','R','O','L','L','B','A','C','K','R',
    'O','W','U','N','I','O','N','U','S','I','N','G','V','A','C','U','U','M',
    'V','I','E','W','I','N','I','T','I','A','L','L','Y',
  };
  static const unsigned char aHash[127] = {
      76, 105, 117,  74,   0,  45,   0,   0,  82,   0,  77,   0,   0,
      42,  12,  78,  15,   0, 116,  85,  54, 112,   0,  19,   0,   0,
     121,   0, 119, 115,   0,  22,  93,   0,   9,   0,   0,  70,  71,
       0,  69,   6,   0,  48,  90, 102,   0, 118, 101,   0,   0,  44,
       0, 103,  24,   0,  17,   0, 122,  53,  23,   0,   5, 110,  25,
      96,   0,   0, 124, 106,  60, 123,  57,  28,  55,   0,  91,   0,
     100,  26,   0,  99,   0,   0,   0,  95,  92,  97,  88, 109,  14,
      39, 108,   0,  81,   0,  18,  89, 111,  32,   0, 120,  80, 113,
      62,  46,  84,   0,   0,  94,  40,  59, 114,   0,  36,   0,   0,
      29,   0,  86,  63,  64,   0,  20,  61,   0,  56,
  };
  static const unsigned char aNext[124] = {
       0,   0,   0,   0,   4,   0,   0,   0,   0,   0,   0,   0,   0,
       0,   2,   0,   0,   0,   0,   0,   0,  13,   0,   0,   0,   0,
       0,   7,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
       0,   0,   0,   0,  33,   0,  21,   0,   0,   0,   0,   0,  50,
       0,  43,   3,  47,   0,   0,   0,   0,  30,   0,  58,   0,  38,
       0,   0,   0,   1,  66,   0,   0,  67,   0,  41,   0,   0,   0,
       0,   0,   0,  49,  65,   0,   0,   0,   0,  31,  52,  16,  34,
      10,   0,   0,   0,   0,   0,   0,   0,  11,  72,  79,   0,   8,
       0, 104,  98,   0, 107,   0,  87,   0,  75,  51,   0,  27,  37,
      73,  83,   0,  35,  68,   0,   0,
  };
  static const unsigned char aLen[124] = {
       7,   7,   5,   4,   6,   4,   5,   3,   6,   7,   3,   6,   6,
       7,   7,   3,   8,   2,   6,   5,   4,   4,   3,  10,   4,   6,
      11,   6,   2,   7,   5,   5,   9,   6,   9,   9,   7,  10,  10,
       4,   6,   2,   3,   9,   4,   2,   6,   5,   7,   4,   5,   7,
       6,   6,   5,   6,   5,   5,   9,   7,   7,   3,   2,   4,   4,
       7,   3,   6,   4,   7,   6,  12,   6,   9,   4,   6,   5,   4,
       7,   6,   5,   6,   7,   5,   4,   5,   6,   5,   7,   3,   7,
      13,   2,   2,   4,   6,   6,   8,   5,  17,  12,   7,   8,   8,
       2,   4,   4,   4,   4,   4,   2,   2,   6,   5,   8,   5,   8,
       3,   5,   5,   6,   4,   9,   3,
  };
  static const unsigned short int aOffset[124] = {
       0,   2,   2,   8,   9,  14,  16,  20,  23,  25,  25,  29,  33,
      36,  41,  46,  48,  53,  54,  59,  62,  65,  67,  69,  78,  81,
      86,  91,  95,  96, 101, 105, 109, 117, 122, 128, 136, 142, 152,
     159, 162, 162, 165, 167, 167, 171, 176, 179, 184, 184, 188, 192,
     199, 204, 209, 212, 218, 221, 225, 234, 240, 240, 240, 243, 246,
     250, 251, 255, 261, 265, 272, 278, 290, 296, 305, 307, 313, 318,
     320, 327, 332, 337, 343, 349, 354, 358, 361, 367, 371, 378, 380,
     387, 389, 391, 400, 404, 410, 416, 424, 429, 429, 445, 452, 459,
     460, 467, 471, 475, 479, 483, 486, 488, 490, 496, 500, 508, 513,
     521, 524, 529, 534, 540, 544, 549,
  };
  static const unsigned char aCode[124] = {
    TK_REINDEX,    TK_INDEXED,    TK_INDEX,      TK_DESC,       TK_ESCAPE,     
    TK_EACH,       TK_CHECK,      TK_KEY,        TK_BEFORE,     TK_FOREIGN,    
    TK_FOR,        TK_IGNORE,     TK_LIKE_KW,    TK_EXPLAIN,    TK_INSTEAD,    
    TK_ADD,        TK_DATABASE,   TK_AS,         TK_SELECT,     TK_TABLE,      
    TK_JOIN_KW,    TK_THEN,       TK_END,        TK_DEFERRABLE, TK_ELSE,       
    TK_EXCEPT,     TK_TRANSACTION,TK_ACTION,     TK_ON,         TK_JOIN_KW,    
    TK_ALTER,      TK_RAISE,      TK_EXCLUSIVE,  TK_EXISTS,     TK_SAVEPOINT,  
    TK_INTERSECT,  TK_TRIGGER,    TK_REFERENCES, TK_CONSTRAINT, TK_INTO,       
    TK_OFFSET,     TK_OF,         TK_SET,        TK_TEMP,       TK_TEMP,       
    TK_OR,         TK_UNIQUE,     TK_QUERY,      TK_WITHOUT,    TK_WITH,       
    TK_JOIN_KW,    TK_RELEASE,    TK_ATTACH,     TK_HAVING,     TK_GROUP,      
    TK_UPDATE,     TK_BEGIN,      TK_JOIN_KW,    TK_RECURSIVE,  TK_BETWEEN,    
    TK_NOTNULL,    TK_NOT,        TK_NO,         TK_NULL,       TK_LIKE_KW,    
    TK_CASCADE,    TK_ASC,        TK_DELETE,     TK_CASE,       TK_COLLATE,    
    TK_CREATE,     TK_CTIME_KW,   TK_DETACH,     TK_IMMEDIATE,  TK_JOIN,       
    TK_INSERT,     TK_MATCH,      TK_PLAN,       TK_ANALYZE,    TK_PRAGMA,     
    TK_ABORT,      TK_VALUES,     TK_VIRTUAL,    TK_LIMIT,      TK_WHEN,       
    TK_WHERE,      TK_RENAME,     TK_AFTER,      TK_REPLACE,    TK_AND,        
    TK_DEFAULT,    TK_AUTOINCR,   TK_TO,         TK_IN,         TK_CAST,       
    TK_COLUMNKW,   TK_COMMIT,     TK_CONFLICT,   TK_JOIN_KW,    TK_CTIME_KW,   
    TK_CTIME_KW,   TK_PRIMARY,    TK_DEFERRED,   TK_DISTINCT,   TK_IS,         
    TK_DROP,       TK_FAIL,       TK_FROM,       TK_JOIN_KW,    TK_LIKE_KW,    
    TK_BY,         TK_IF,         TK_ISNULL,     TK_ORDER,      TK_RESTRICT,   
    TK_JOIN_KW,    TK_ROLLBACK,   TK_ROW,        TK_UNION,      TK_USING,      
    TK_VACUUM,     TK_VIEW,       TK_INITIALLY,  TK_ALL,        
  };
  int h, i;
  if( n<2 ) return TK_ID;
  h = ((charMap(z[0])*4) ^
      (charMap(z[n-1])*3) ^
      n) % 127;
  for(i=((int)aHash[h])-1; i>=0; i=((int)aNext[i])-1){
117829
117830
117831
117832
117833
117834
117835
117836
117837
117838
117839
117840
117841
117842
117843
117844
117845
117846
117847
117848
117849
117850
117851
117852
117853
117854
117855
117856
117857
117858
117859
117860
117861
117862
117863
117864
117865
117866
117867
117868
117869
117870
117871
117872
117873
117874
117875
117876
117877
117878
117879
117880
117881
117882
117883
117884
117885
117886
117887
117888
117889
117890
117891
117892
117893
117894
117895
117896
117897
117898
117899
117900
117901
117902
117903
117904
117905
117906
117907
117908


117909
117910
117911
117912
117913
117914
117915
117916
117917
117918
117919
117920
117921
117922
117923
117924
      testcase( i==42 ); /* SET */
      testcase( i==43 ); /* TEMPORARY */
      testcase( i==44 ); /* TEMP */
      testcase( i==45 ); /* OR */
      testcase( i==46 ); /* UNIQUE */
      testcase( i==47 ); /* QUERY */
      testcase( i==48 ); /* WITHOUT */
      testcase( i==49 ); /* OUTER */
      testcase( i==50 ); /* RELEASE */
      testcase( i==51 ); /* ATTACH */
      testcase( i==52 ); /* HAVING */
      testcase( i==53 ); /* GROUP */
      testcase( i==54 ); /* UPDATE */
      testcase( i==55 ); /* BEGIN */
      testcase( i==56 ); /* INNER */
      testcase( i==57 ); /* RENAME */
      testcase( i==58 ); /* BETWEEN */
      testcase( i==59 ); /* NOTNULL */
      testcase( i==60 ); /* NOT */
      testcase( i==61 ); /* NO */
      testcase( i==62 ); /* NULL */
      testcase( i==63 ); /* LIKE */
      testcase( i==64 ); /* CASCADE */
      testcase( i==65 ); /* ASC */
      testcase( i==66 ); /* DELETE */
      testcase( i==67 ); /* CASE */
      testcase( i==68 ); /* COLLATE */
      testcase( i==69 ); /* CREATE */
      testcase( i==70 ); /* CURRENT_DATE */
      testcase( i==71 ); /* DETACH */
      testcase( i==72 ); /* IMMEDIATE */
      testcase( i==73 ); /* JOIN */
      testcase( i==74 ); /* INSERT */
      testcase( i==75 ); /* MATCH */
      testcase( i==76 ); /* PLAN */
      testcase( i==77 ); /* ANALYZE */
      testcase( i==78 ); /* PRAGMA */
      testcase( i==79 ); /* ABORT */
      testcase( i==80 ); /* VALUES */
      testcase( i==81 ); /* VIRTUAL */
      testcase( i==82 ); /* LIMIT */
      testcase( i==83 ); /* WHEN */
      testcase( i==84 ); /* WHERE */
      testcase( i==85 ); /* REPLACE */
      testcase( i==86 ); /* AFTER */
      testcase( i==87 ); /* RESTRICT */
      testcase( i==88 ); /* AND */
      testcase( i==89 ); /* DEFAULT */
      testcase( i==90 ); /* AUTOINCREMENT */
      testcase( i==91 ); /* TO */
      testcase( i==92 ); /* IN */
      testcase( i==93 ); /* CAST */
      testcase( i==94 ); /* COLUMN */
      testcase( i==95 ); /* COMMIT */
      testcase( i==96 ); /* CONFLICT */
      testcase( i==97 ); /* CROSS */
      testcase( i==98 ); /* CURRENT_TIMESTAMP */
      testcase( i==99 ); /* CURRENT_TIME */
      testcase( i==100 ); /* PRIMARY */
      testcase( i==101 ); /* DEFERRED */
      testcase( i==102 ); /* DISTINCT */
      testcase( i==103 ); /* IS */
      testcase( i==104 ); /* DROP */
      testcase( i==105 ); /* FAIL */
      testcase( i==106 ); /* FROM */
      testcase( i==107 ); /* FULL */
      testcase( i==108 ); /* GLOB */
      testcase( i==109 ); /* BY */
      testcase( i==110 ); /* IF */
      testcase( i==111 ); /* ISNULL */
      testcase( i==112 ); /* ORDER */
      testcase( i==113 ); /* RIGHT */
      testcase( i==114 ); /* ROLLBACK */
      testcase( i==115 ); /* ROW */
      testcase( i==116 ); /* UNION */
      testcase( i==117 ); /* USING */
      testcase( i==118 ); /* VACUUM */
      testcase( i==119 ); /* VIEW */
      testcase( i==120 ); /* INITIALLY */
      testcase( i==121 ); /* ALL */


      return aCode[i];
    }
  }
  return TK_ID;
}
SQLITE_PRIVATE int sqlite3KeywordCode(const unsigned char *z, int n){
  return keywordCode((char*)z, n);
}
#define SQLITE_N_KEYWORD 122

/************** End of keywordhash.h *****************************************/
/************** Continuing where we left off in tokenize.c *******************/


/*
** If X is a character that can be used in an identifier then







|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
>
>








|







118334
118335
118336
118337
118338
118339
118340
118341
118342
118343
118344
118345
118346
118347
118348
118349
118350
118351
118352
118353
118354
118355
118356
118357
118358
118359
118360
118361
118362
118363
118364
118365
118366
118367
118368
118369
118370
118371
118372
118373
118374
118375
118376
118377
118378
118379
118380
118381
118382
118383
118384
118385
118386
118387
118388
118389
118390
118391
118392
118393
118394
118395
118396
118397
118398
118399
118400
118401
118402
118403
118404
118405
118406
118407
118408
118409
118410
118411
118412
118413
118414
118415
118416
118417
118418
118419
118420
118421
118422
118423
118424
118425
118426
118427
118428
118429
118430
118431
      testcase( i==42 ); /* SET */
      testcase( i==43 ); /* TEMPORARY */
      testcase( i==44 ); /* TEMP */
      testcase( i==45 ); /* OR */
      testcase( i==46 ); /* UNIQUE */
      testcase( i==47 ); /* QUERY */
      testcase( i==48 ); /* WITHOUT */
      testcase( i==49 ); /* WITH */
      testcase( i==50 ); /* OUTER */
      testcase( i==51 ); /* RELEASE */
      testcase( i==52 ); /* ATTACH */
      testcase( i==53 ); /* HAVING */
      testcase( i==54 ); /* GROUP */
      testcase( i==55 ); /* UPDATE */
      testcase( i==56 ); /* BEGIN */
      testcase( i==57 ); /* INNER */
      testcase( i==58 ); /* RECURSIVE */
      testcase( i==59 ); /* BETWEEN */
      testcase( i==60 ); /* NOTNULL */
      testcase( i==61 ); /* NOT */
      testcase( i==62 ); /* NO */
      testcase( i==63 ); /* NULL */
      testcase( i==64 ); /* LIKE */
      testcase( i==65 ); /* CASCADE */
      testcase( i==66 ); /* ASC */
      testcase( i==67 ); /* DELETE */
      testcase( i==68 ); /* CASE */
      testcase( i==69 ); /* COLLATE */
      testcase( i==70 ); /* CREATE */
      testcase( i==71 ); /* CURRENT_DATE */
      testcase( i==72 ); /* DETACH */
      testcase( i==73 ); /* IMMEDIATE */
      testcase( i==74 ); /* JOIN */
      testcase( i==75 ); /* INSERT */
      testcase( i==76 ); /* MATCH */
      testcase( i==77 ); /* PLAN */
      testcase( i==78 ); /* ANALYZE */
      testcase( i==79 ); /* PRAGMA */
      testcase( i==80 ); /* ABORT */
      testcase( i==81 ); /* VALUES */
      testcase( i==82 ); /* VIRTUAL */
      testcase( i==83 ); /* LIMIT */
      testcase( i==84 ); /* WHEN */
      testcase( i==85 ); /* WHERE */
      testcase( i==86 ); /* RENAME */
      testcase( i==87 ); /* AFTER */
      testcase( i==88 ); /* REPLACE */
      testcase( i==89 ); /* AND */
      testcase( i==90 ); /* DEFAULT */
      testcase( i==91 ); /* AUTOINCREMENT */
      testcase( i==92 ); /* TO */
      testcase( i==93 ); /* IN */
      testcase( i==94 ); /* CAST */
      testcase( i==95 ); /* COLUMN */
      testcase( i==96 ); /* COMMIT */
      testcase( i==97 ); /* CONFLICT */
      testcase( i==98 ); /* CROSS */
      testcase( i==99 ); /* CURRENT_TIMESTAMP */
      testcase( i==100 ); /* CURRENT_TIME */
      testcase( i==101 ); /* PRIMARY */
      testcase( i==102 ); /* DEFERRED */
      testcase( i==103 ); /* DISTINCT */
      testcase( i==104 ); /* IS */
      testcase( i==105 ); /* DROP */
      testcase( i==106 ); /* FAIL */
      testcase( i==107 ); /* FROM */
      testcase( i==108 ); /* FULL */
      testcase( i==109 ); /* GLOB */
      testcase( i==110 ); /* BY */
      testcase( i==111 ); /* IF */
      testcase( i==112 ); /* ISNULL */
      testcase( i==113 ); /* ORDER */
      testcase( i==114 ); /* RESTRICT */
      testcase( i==115 ); /* RIGHT */
      testcase( i==116 ); /* ROLLBACK */
      testcase( i==117 ); /* ROW */
      testcase( i==118 ); /* UNION */
      testcase( i==119 ); /* USING */
      testcase( i==120 ); /* VACUUM */
      testcase( i==121 ); /* VIEW */
      testcase( i==122 ); /* INITIALLY */
      testcase( i==123 ); /* ALL */
      return aCode[i];
    }
  }
  return TK_ID;
}
SQLITE_PRIVATE int sqlite3KeywordCode(const unsigned char *z, int n){
  return keywordCode((char*)z, n);
}
#define SQLITE_N_KEYWORD 124

/************** End of keywordhash.h *****************************************/
/************** Continuing where we left off in tokenize.c *******************/


/*
** If X is a character that can be used in an identifier then
118154
118155
118156
118157
118158
118159
118160
118161
118162
118163
118164
118165
118166
118167
118168
118169
118170
118171
118172
118173
118174
118175

118176
118177
118178

118179
118180
118181
118182
118183
118184
118185
      return i;
    }
    case '?': {
      *tokenType = TK_VARIABLE;
      for(i=1; sqlite3Isdigit(z[i]); i++){}
      return i;
    }
    case '#': {
      for(i=1; sqlite3Isdigit(z[i]); i++){}
      if( i>1 ){
        /* Parameters of the form #NNN (where NNN is a number) are used
        ** internally by sqlite3NestedParse.  */
        *tokenType = TK_REGISTER;
        return i;
      }
      /* Fall through into the next case if the '#' is not followed by
      ** a digit. Try to match #AAAA where AAAA is a parameter name. */
    }
#ifndef SQLITE_OMIT_TCL_VARIABLE
    case '$':
#endif
    case '@':  /* For compatibility with MS SQL Server */

    case ':': {
      int n = 0;
      testcase( z[0]=='$' );  testcase( z[0]=='@' );  testcase( z[0]==':' );

      *tokenType = TK_VARIABLE;
      for(i=1; (c=z[i])!=0; i++){
        if( IdChar(c) ){
          n++;
#ifndef SQLITE_OMIT_TCL_VARIABLE
        }else if( c=='(' && n>0 ){
          do{







<
<
<
<
<
<
<
<
<
<
<




>


|
>







118661
118662
118663
118664
118665
118666
118667











118668
118669
118670
118671
118672
118673
118674
118675
118676
118677
118678
118679
118680
118681
118682
118683
      return i;
    }
    case '?': {
      *tokenType = TK_VARIABLE;
      for(i=1; sqlite3Isdigit(z[i]); i++){}
      return i;
    }











#ifndef SQLITE_OMIT_TCL_VARIABLE
    case '$':
#endif
    case '@':  /* For compatibility with MS SQL Server */
    case '#':
    case ':': {
      int n = 0;
      testcase( z[0]=='$' );  testcase( z[0]=='@' );
      testcase( z[0]==':' );  testcase( z[0]=='#' );
      *tokenType = TK_VARIABLE;
      for(i=1; (c=z[i])!=0; i++){
        if( IdChar(c) ){
          n++;
#ifndef SQLITE_OMIT_TCL_VARIABLE
        }else if( c=='(' && n>0 ){
          do{
118354
118355
118356
118357
118358
118359
118360

118361
118362
118363
118364
118365
118366
118367
    /* If the pParse->declareVtab flag is set, do not delete any table 
    ** structure built up in pParse->pNewTable. The calling code (see vtab.c)
    ** will take responsibility for freeing the Table structure.
    */
    sqlite3DeleteTable(db, pParse->pNewTable);
  }


  sqlite3DeleteTrigger(db, pParse->pNewTrigger);
  for(i=pParse->nzVar-1; i>=0; i--) sqlite3DbFree(db, pParse->azVar[i]);
  sqlite3DbFree(db, pParse->azVar);
  while( pParse->pAinc ){
    AutoincInfo *p = pParse->pAinc;
    pParse->pAinc = p->pNext;
    sqlite3DbFree(db, p);







>







118852
118853
118854
118855
118856
118857
118858
118859
118860
118861
118862
118863
118864
118865
118866
    /* If the pParse->declareVtab flag is set, do not delete any table 
    ** structure built up in pParse->pNewTable. The calling code (see vtab.c)
    ** will take responsibility for freeing the Table structure.
    */
    sqlite3DeleteTable(db, pParse->pNewTable);
  }

  if( pParse->bFreeWith ) sqlite3WithDelete(db, pParse->pWith);
  sqlite3DeleteTrigger(db, pParse->pNewTrigger);
  for(i=pParse->nzVar-1; i>=0; i--) sqlite3DbFree(db, pParse->azVar[i]);
  sqlite3DbFree(db, pParse->azVar);
  while( pParse->pAinc ){
    AutoincInfo *p = pParse->pAinc;
    pParse->pAinc = p->pNext;
    sqlite3DbFree(db, p);
124839
124840
124841
124842
124843
124844
124845
124846
124847
124848
124849
124850
124851
124852
124853
}

/*
** Set the pIdxInfo->estimatedRows variable to nRow. Unless this
** extension is currently being used by a version of SQLite too old to
** support estimatedRows. In that case this function is a no-op.
*/
static void setEstimatedRows(sqlite3_index_info *pIdxInfo, i64 nRow){
#if SQLITE_VERSION_NUMBER>=3008002
  if( sqlite3_libversion_number()>=3008002 ){
    pIdxInfo->estimatedRows = nRow;
  }
#endif
}








|







125338
125339
125340
125341
125342
125343
125344
125345
125346
125347
125348
125349
125350
125351
125352
}

/*
** Set the pIdxInfo->estimatedRows variable to nRow. Unless this
** extension is currently being used by a version of SQLite too old to
** support estimatedRows. In that case this function is a no-op.
*/
static void fts3SetEstimatedRows(sqlite3_index_info *pIdxInfo, i64 nRow){
#if SQLITE_VERSION_NUMBER>=3008002
  if( sqlite3_libversion_number()>=3008002 ){
    pIdxInfo->estimatedRows = nRow;
  }
#endif
}

124883
124884
124885
124886
124887
124888
124889
124890
124891
124892
124893
124894
124895
124896
124897
        /* There exists an unusable MATCH constraint. This means that if
        ** the planner does elect to use the results of this call as part
        ** of the overall query plan the user will see an "unable to use
        ** function MATCH in the requested context" error. To discourage
        ** this, return a very high cost here.  */
        pInfo->idxNum = FTS3_FULLSCAN_SEARCH;
        pInfo->estimatedCost = 1e50;
        setEstimatedRows(pInfo, ((sqlite3_int64)1) << 50);
        return SQLITE_OK;
      }
      continue;
    }

    bDocid = (pCons->iColumn<0 || pCons->iColumn==p->nColumn+1);








|







125382
125383
125384
125385
125386
125387
125388
125389
125390
125391
125392
125393
125394
125395
125396
        /* There exists an unusable MATCH constraint. This means that if
        ** the planner does elect to use the results of this call as part
        ** of the overall query plan the user will see an "unable to use
        ** function MATCH in the requested context" error. To discourage
        ** this, return a very high cost here.  */
        pInfo->idxNum = FTS3_FULLSCAN_SEARCH;
        pInfo->estimatedCost = 1e50;
        fts3SetEstimatedRows(pInfo, ((sqlite3_int64)1) << 50);
        return SQLITE_OK;
      }
      continue;
    }

    bDocid = (pCons->iColumn<0 || pCons->iColumn==p->nColumn+1);

Changes to src/sqlite3.h.
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
**
** See also: [sqlite3_libversion()],
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
** [sqlite_version()] and [sqlite_source_id()].
*/
#define SQLITE_VERSION        "3.8.3"
#define SQLITE_VERSION_NUMBER 3008003
#define SQLITE_SOURCE_ID      "2014-01-04 15:17:04 4e725f53131d3584319c710c8710a068989543c6"

/*
** CAPI3REF: Run-Time Library Version Numbers
** KEYWORDS: sqlite3_version, sqlite3_sourceid
**
** These interfaces provide the same information as the [SQLITE_VERSION],
** [SQLITE_VERSION_NUMBER], and [SQLITE_SOURCE_ID] C preprocessor macros







|







105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
**
** See also: [sqlite3_libversion()],
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
** [sqlite_version()] and [sqlite_source_id()].
*/
#define SQLITE_VERSION        "3.8.3"
#define SQLITE_VERSION_NUMBER 3008003
#define SQLITE_SOURCE_ID      "2014-01-18 15:22:53 2ad4583c0cc7988f0dfe78fd0a2eb0fdb92d835a"

/*
** CAPI3REF: Run-Time Library Version Numbers
** KEYWORDS: sqlite3_version, sqlite3_sourceid
**
** These interfaces provide the same information as the [SQLITE_VERSION],
** [SQLITE_VERSION_NUMBER], and [SQLITE_SOURCE_ID] C preprocessor macros
2562
2563
2564
2565
2566
2567
2568

2569
2570
2571
2572
2573
2574
2575
#define SQLITE_REINDEX              27   /* Index Name      NULL            */
#define SQLITE_ANALYZE              28   /* Table Name      NULL            */
#define SQLITE_CREATE_VTABLE        29   /* Table Name      Module Name     */
#define SQLITE_DROP_VTABLE          30   /* Table Name      Module Name     */
#define SQLITE_FUNCTION             31   /* NULL            Function Name   */
#define SQLITE_SAVEPOINT            32   /* Operation       Savepoint Name  */
#define SQLITE_COPY                  0   /* No longer used */


/*
** CAPI3REF: Tracing And Profiling Functions
**
** These routines register callback functions that can be used for
** tracing and profiling the execution of SQL statements.
**







>







2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
#define SQLITE_REINDEX              27   /* Index Name      NULL            */
#define SQLITE_ANALYZE              28   /* Table Name      NULL            */
#define SQLITE_CREATE_VTABLE        29   /* Table Name      Module Name     */
#define SQLITE_DROP_VTABLE          30   /* Table Name      Module Name     */
#define SQLITE_FUNCTION             31   /* NULL            Function Name   */
#define SQLITE_SAVEPOINT            32   /* Operation       Savepoint Name  */
#define SQLITE_COPY                  0   /* No longer used */
#define SQLITE_RECURSIVE            33   /* NULL            NULL            */

/*
** CAPI3REF: Tracing And Profiling Functions
**
** These routines register callback functions that can be used for
** tracing and profiling the execution of SQL statements.
**