Fossil SCM

Update the built-in SQLite to the latest 3.46.0 pre-release for beta-testing.

drh 2024-03-09 18:52 trunk
Commit 3b99d2ca2634dd52264ea7d53181a3987d8bab9e94c5d32c03647efc76545d49
3 files changed +1189 -6 +2477 -2004 +3 -3
+1189 -6
--- extsrc/shell.c
+++ extsrc/shell.c
@@ -13806,11 +13806,11 @@
1380613806
/* Copy the entire schema of database [db] into [dbm]. */
1380713807
if( rc==SQLITE_OK ){
1380813808
sqlite3_stmt *pSql = 0;
1380913809
rc = idxPrintfPrepareStmt(pNew->db, &pSql, pzErrmsg,
1381013810
"SELECT sql FROM sqlite_schema WHERE name NOT LIKE 'sqlite_%%'"
13811
- " AND sql NOT LIKE 'CREATE VIRTUAL %%'"
13811
+ " AND sql NOT LIKE 'CREATE VIRTUAL %%' ORDER BY rowid"
1381213812
);
1381313813
while( rc==SQLITE_OK && SQLITE_ROW==sqlite3_step(pSql) ){
1381413814
const char *zSql = (const char*)sqlite3_column_text(pSql, 0);
1381513815
if( zSql ) rc = sqlite3_exec(pNew->dbm, zSql, 0, 0, pzErrmsg);
1381613816
}
@@ -14007,10 +14007,1128 @@
1400714007
}
1400814008
1400914009
#endif /* ifndef SQLITE_OMIT_VIRTUALTABLE */
1401014010
1401114011
/************************* End ../ext/expert/sqlite3expert.c ********************/
14012
+
14013
+/************************* Begin ../ext/intck/sqlite3intck.h ******************/
14014
+/*
14015
+** 2024-02-08
14016
+**
14017
+** The author disclaims copyright to this source code. In place of
14018
+** a legal notice, here is a blessing:
14019
+**
14020
+** May you do good and not evil.
14021
+** May you find forgiveness for yourself and forgive others.
14022
+** May you share freely, never taking more than you give.
14023
+**
14024
+*************************************************************************
14025
+*/
14026
+
14027
+/*
14028
+** Incremental Integrity-Check Extension
14029
+** -------------------------------------
14030
+**
14031
+** This module contains code to check whether or not an SQLite database
14032
+** is well-formed or corrupt. This is the same task as performed by SQLite's
14033
+** built-in "PRAGMA integrity_check" command. This module differs from
14034
+** "PRAGMA integrity_check" in that:
14035
+**
14036
+** + It is less thorough - this module does not detect certain types
14037
+** of corruption that are detected by the PRAGMA command. However,
14038
+** it does detect all kinds of corruption that are likely to cause
14039
+** errors in SQLite applications.
14040
+**
14041
+** + It is slower. Sometimes up to three times slower.
14042
+**
14043
+** + It allows integrity-check operations to be split into multiple
14044
+** transactions, so that the database does not need to be read-locked
14045
+** for the duration of the integrity-check.
14046
+**
14047
+** One way to use the API to run integrity-check on the "main" database
14048
+** of handle db is:
14049
+**
14050
+** int rc = SQLITE_OK;
14051
+** sqlite3_intck *p = 0;
14052
+**
14053
+** sqlite3_intck_open(db, "main", &p);
14054
+** while( SQLITE_OK==sqlite3_intck_step(p) ){
14055
+** const char *zMsg = sqlite3_intck_message(p);
14056
+** if( zMsg ) printf("corruption: %s\n", zMsg);
14057
+** }
14058
+** rc = sqlite3_intck_error(p, &zErr);
14059
+** if( rc!=SQLITE_OK ){
14060
+** printf("error occured (rc=%d), (errmsg=%s)\n", rc, zErr);
14061
+** }
14062
+** sqlite3_intck_close(p);
14063
+**
14064
+** Usually, the sqlite3_intck object opens a read transaction within the
14065
+** first call to sqlite3_intck_step() and holds it open until the
14066
+** integrity-check is complete. However, if sqlite3_intck_unlock() is
14067
+** called, the read transaction is ended and a new read transaction opened
14068
+** by the subsequent call to sqlite3_intck_step().
14069
+*/
14070
+
14071
+#ifndef _SQLITE_INTCK_H
14072
+#define _SQLITE_INTCK_H
14073
+
14074
+/* #include "sqlite3.h" */
14075
+
14076
+#ifdef __cplusplus
14077
+extern "C" {
14078
+#endif
14079
+
14080
+/*
14081
+** An ongoing incremental integrity-check operation is represented by an
14082
+** opaque pointer of the following type.
14083
+*/
14084
+typedef struct sqlite3_intck sqlite3_intck;
14085
+
14086
+/*
14087
+** Open a new incremental integrity-check object. If successful, populate
14088
+** output variable (*ppOut) with the new object handle and return SQLITE_OK.
14089
+** Or, if an error occurs, set (*ppOut) to NULL and return an SQLite error
14090
+** code (e.g. SQLITE_NOMEM).
14091
+**
14092
+** The integrity-check will be conducted on database zDb (which must be "main",
14093
+** "temp", or the name of an attached database) of database handle db. Once
14094
+** this function has been called successfully, the caller should not use
14095
+** database handle db until the integrity-check object has been destroyed
14096
+** using sqlite3_intck_close().
14097
+*/
14098
+int sqlite3_intck_open(
14099
+ sqlite3 *db, /* Database handle */
14100
+ const char *zDb, /* Database name ("main", "temp" etc.) */
14101
+ sqlite3_intck **ppOut /* OUT: New sqlite3_intck handle */
14102
+);
14103
+
14104
+/*
14105
+** Close and release all resources associated with a handle opened by an
14106
+** earlier call to sqlite3_intck_open(). The results of using an
14107
+** integrity-check handle after it has been passed to this function are
14108
+** undefined.
14109
+*/
14110
+void sqlite3_intck_close(sqlite3_intck *pCk);
14111
+
14112
+/*
14113
+** Do the next step of the integrity-check operation specified by the handle
14114
+** passed as the only argument. This function returns SQLITE_DONE if the
14115
+** integrity-check operation is finished, or an SQLite error code if
14116
+** an error occurs, or SQLITE_OK if no error occurs but the integrity-check
14117
+** is not finished. It is not considered an error if database corruption
14118
+** is encountered.
14119
+**
14120
+** Following a successful call to sqlite3_intck_step() (one that returns
14121
+** SQLITE_OK), sqlite3_intck_message() returns a non-NULL value if
14122
+** corruption was detected in the db.
14123
+**
14124
+** If an error occurs and a value other than SQLITE_OK or SQLITE_DONE is
14125
+** returned, then the integrity-check handle is placed in an error state.
14126
+** In this state all subsequent calls to sqlite3_intck_step() or
14127
+** sqlite3_intck_unlock() will immediately return the same error. The
14128
+** sqlite3_intck_error() method may be used to obtain an English language
14129
+** error message in this case.
14130
+*/
14131
+int sqlite3_intck_step(sqlite3_intck *pCk);
14132
+
14133
+/*
14134
+** If the previous call to sqlite3_intck_step() encountered corruption
14135
+** within the database, then this function returns a pointer to a buffer
14136
+** containing a nul-terminated string describing the corruption in
14137
+** English. If the previous call to sqlite3_intck_step() did not encounter
14138
+** corruption, or if there was no previous call, this function returns
14139
+** NULL.
14140
+*/
14141
+const char *sqlite3_intck_message(sqlite3_intck *pCk);
14142
+
14143
+/*
14144
+** Close any read-transaction opened by an earlier call to
14145
+** sqlite3_intck_step(). Any subsequent call to sqlite3_intck_step() will
14146
+** open a new transaction. Return SQLITE_OK if successful, or an SQLite error
14147
+** code otherwise.
14148
+**
14149
+** If an error occurs, then the integrity-check handle is placed in an error
14150
+** state. In this state all subsequent calls to sqlite3_intck_step() or
14151
+** sqlite3_intck_unlock() will immediately return the same error. The
14152
+** sqlite3_intck_error() method may be used to obtain an English language
14153
+** error message in this case.
14154
+*/
14155
+int sqlite3_intck_unlock(sqlite3_intck *pCk);
14156
+
14157
+/*
14158
+** If an error has occurred in an earlier call to sqlite3_intck_step()
14159
+** or sqlite3_intck_unlock(), then this method returns the associated
14160
+** SQLite error code. Additionally, if pzErr is not NULL, then (*pzErr)
14161
+** may be set to point to a nul-terminated string containing an English
14162
+** language error message. Or, if no error message is available, to
14163
+** NULL.
14164
+**
14165
+** If no error has occurred within sqlite3_intck_step() or
14166
+** sqlite_intck_unlock() calls on the handle passed as the first argument,
14167
+** then SQLITE_OK is returned and (*pzErr) set to NULL.
14168
+*/
14169
+int sqlite3_intck_error(sqlite3_intck *pCk, const char **pzErr);
14170
+
14171
+/*
14172
+** This API is used for testing only. It returns the full-text of an SQL
14173
+** statement used to test object zObj, which may be a table or index.
14174
+** The returned buffer is valid until the next call to either this function
14175
+** or sqlite3_intck_close() on the same sqlite3_intck handle.
14176
+*/
14177
+const char *sqlite3_intck_test_sql(sqlite3_intck *pCk, const char *zObj);
14178
+
14179
+
14180
+#ifdef __cplusplus
14181
+} /* end of the 'extern "C"' block */
14182
+#endif
14183
+
14184
+#endif /* ifndef _SQLITE_INTCK_H */
14185
+
14186
+/************************* End ../ext/intck/sqlite3intck.h ********************/
14187
+/************************* Begin ../ext/intck/sqlite3intck.c ******************/
14188
+/*
14189
+** 2024-02-08
14190
+**
14191
+** The author disclaims copyright to this source code. In place of
14192
+** a legal notice, here is a blessing:
14193
+**
14194
+** May you do good and not evil.
14195
+** May you find forgiveness for yourself and forgive others.
14196
+** May you share freely, never taking more than you give.
14197
+**
14198
+*************************************************************************
14199
+*/
14200
+
14201
+/* #include "sqlite3intck.h" */
14202
+#include <string.h>
14203
+#include <assert.h>
14204
+
14205
+#include <stdio.h>
14206
+#include <stdlib.h>
14207
+
14208
+/*
14209
+** nKeyVal:
14210
+** The number of values that make up the 'key' for the current pCheck
14211
+** statement.
14212
+**
14213
+** rc:
14214
+** Error code returned by most recent sqlite3_intck_step() or
14215
+** sqlite3_intck_unlock() call. This is set to SQLITE_DONE when
14216
+** the integrity-check operation is finished.
14217
+**
14218
+** zErr:
14219
+** If the object has entered the error state, this is the error message.
14220
+** Is freed using sqlite3_free() when the object is deleted.
14221
+**
14222
+** zTestSql:
14223
+** The value returned by the most recent call to sqlite3_intck_testsql().
14224
+** Each call to testsql() frees the previous zTestSql value (using
14225
+** sqlite3_free()) and replaces it with the new value it will return.
14226
+*/
14227
+struct sqlite3_intck {
14228
+ sqlite3 *db;
14229
+ const char *zDb; /* Copy of zDb parameter to _open() */
14230
+ char *zObj; /* Current object. Or NULL. */
14231
+
14232
+ sqlite3_stmt *pCheck; /* Current check statement */
14233
+ char *zKey;
14234
+ int nKeyVal;
14235
+
14236
+ char *zMessage;
14237
+ int bCorruptSchema;
14238
+
14239
+ int rc; /* Error code */
14240
+ char *zErr; /* Error message */
14241
+ char *zTestSql; /* Returned by sqlite3_intck_test_sql() */
14242
+};
14243
+
14244
+
14245
+/*
14246
+** Some error has occurred while using database p->db. Save the error message
14247
+** and error code currently held by the database handle in p->rc and p->zErr.
14248
+*/
14249
+static void intckSaveErrmsg(sqlite3_intck *p){
14250
+ p->rc = sqlite3_errcode(p->db);
14251
+ sqlite3_free(p->zErr);
14252
+ p->zErr = sqlite3_mprintf("%s", sqlite3_errmsg(p->db));
14253
+}
14254
+
14255
+/*
14256
+** If the handle passed as the first argument is already in the error state,
14257
+** then this function is a no-op (returns NULL immediately). Otherwise, if an
14258
+** error occurs within this function, it leaves an error in said handle.
14259
+**
14260
+** Otherwise, this function attempts to prepare SQL statement zSql and
14261
+** return the resulting statement handle to the user.
14262
+*/
14263
+static sqlite3_stmt *intckPrepare(sqlite3_intck *p, const char *zSql){
14264
+ sqlite3_stmt *pRet = 0;
14265
+ if( p->rc==SQLITE_OK ){
14266
+ p->rc = sqlite3_prepare_v2(p->db, zSql, -1, &pRet, 0);
14267
+ if( p->rc!=SQLITE_OK ){
14268
+ intckSaveErrmsg(p);
14269
+ assert( pRet==0 );
14270
+ }
14271
+ }
14272
+ return pRet;
14273
+}
14274
+
14275
+/*
14276
+** If the handle passed as the first argument is already in the error state,
14277
+** then this function is a no-op (returns NULL immediately). Otherwise, if an
14278
+** error occurs within this function, it leaves an error in said handle.
14279
+**
14280
+** Otherwise, this function treats argument zFmt as a printf() style format
14281
+** string. It formats it according to the trailing arguments and then
14282
+** attempts to prepare the results and return the resulting prepared
14283
+** statement.
14284
+*/
14285
+static sqlite3_stmt *intckPrepareFmt(sqlite3_intck *p, const char *zFmt, ...){
14286
+ sqlite3_stmt *pRet = 0;
14287
+ va_list ap;
14288
+ char *zSql = 0;
14289
+ va_start(ap, zFmt);
14290
+ zSql = sqlite3_vmprintf(zFmt, ap);
14291
+ if( p->rc==SQLITE_OK && zSql==0 ){
14292
+ p->rc = SQLITE_NOMEM;
14293
+ }
14294
+ pRet = intckPrepare(p, zSql);
14295
+ sqlite3_free(zSql);
14296
+ va_end(ap);
14297
+ return pRet;
14298
+}
14299
+
14300
+/*
14301
+** Finalize SQL statement pStmt. If an error occurs and the handle passed
14302
+** as the first argument does not already contain an error, store the
14303
+** error in the handle.
14304
+*/
14305
+static void intckFinalize(sqlite3_intck *p, sqlite3_stmt *pStmt){
14306
+ int rc = sqlite3_finalize(pStmt);
14307
+ if( p->rc==SQLITE_OK && rc!=SQLITE_OK ){
14308
+ intckSaveErrmsg(p);
14309
+ }
14310
+}
14311
+
14312
+/*
14313
+** If there is already an error in handle p, return it. Otherwise, call
14314
+** sqlite3_step() on the statement handle and return that value.
14315
+*/
14316
+static int intckStep(sqlite3_intck *p, sqlite3_stmt *pStmt){
14317
+ if( p->rc ) return p->rc;
14318
+ return sqlite3_step(pStmt);
14319
+}
14320
+
14321
+/*
14322
+** Execute SQL statement zSql. There is no way to obtain any results
14323
+** returned by the statement. This function uses the sqlite3_intck error
14324
+** code convention.
14325
+*/
14326
+static void intckExec(sqlite3_intck *p, const char *zSql){
14327
+ sqlite3_stmt *pStmt = 0;
14328
+ pStmt = intckPrepare(p, zSql);
14329
+ intckStep(p, pStmt);
14330
+ intckFinalize(p, pStmt);
14331
+}
14332
+
14333
+/*
14334
+** A wrapper around sqlite3_mprintf() that uses the sqlite3_intck error
14335
+** code convention.
14336
+*/
14337
+static char *intckMprintf(sqlite3_intck *p, const char *zFmt, ...){
14338
+ va_list ap;
14339
+ char *zRet = 0;
14340
+ va_start(ap, zFmt);
14341
+ zRet = sqlite3_vmprintf(zFmt, ap);
14342
+ if( p->rc==SQLITE_OK ){
14343
+ if( zRet==0 ){
14344
+ p->rc = SQLITE_NOMEM;
14345
+ }
14346
+ }else{
14347
+ sqlite3_free(zRet);
14348
+ zRet = 0;
14349
+ }
14350
+ return zRet;
14351
+}
14352
+
14353
+/*
14354
+** This is used by sqlite3_intck_unlock() to save the vector key value
14355
+** required to restart the current pCheck query as a nul-terminated string
14356
+** in p->zKey.
14357
+*/
14358
+static void intckSaveKey(sqlite3_intck *p){
14359
+ int ii;
14360
+ char *zSql = 0;
14361
+ sqlite3_stmt *pStmt = 0;
14362
+ sqlite3_stmt *pXinfo = 0;
14363
+ const char *zDir = 0;
14364
+
14365
+ assert( p->pCheck );
14366
+ assert( p->zKey==0 );
14367
+
14368
+ pXinfo = intckPrepareFmt(p,
14369
+ "SELECT group_concat(desc, '') FROM %Q.sqlite_schema s, "
14370
+ "pragma_index_xinfo(%Q, %Q) "
14371
+ "WHERE s.type='index' AND s.name=%Q",
14372
+ p->zDb, p->zObj, p->zDb, p->zObj
14373
+ );
14374
+ if( p->rc==SQLITE_OK && SQLITE_ROW==sqlite3_step(pXinfo) ){
14375
+ zDir = (const char*)sqlite3_column_text(pXinfo, 0);
14376
+ }
14377
+
14378
+ if( zDir==0 ){
14379
+ /* Object is a table, not an index. This is the easy case,as there are
14380
+ ** no DESC columns or NULL values in a primary key. */
14381
+ const char *zSep = "SELECT '(' || ";
14382
+ for(ii=0; ii<p->nKeyVal; ii++){
14383
+ zSql = intckMprintf(p, "%z%squote(?)", zSql, zSep);
14384
+ zSep = " || ', ' || ";
14385
+ }
14386
+ zSql = intckMprintf(p, "%z || ')'", zSql);
14387
+ }else{
14388
+
14389
+ /* Object is an index. */
14390
+ assert( p->nKeyVal>1 );
14391
+ for(ii=p->nKeyVal; ii>0; ii--){
14392
+ int bLastIsDesc = zDir[ii-1]=='1';
14393
+ int bLastIsNull = sqlite3_column_type(p->pCheck, ii)==SQLITE_NULL;
14394
+ const char *zLast = sqlite3_column_name(p->pCheck, ii);
14395
+ char *zLhs = 0;
14396
+ char *zRhs = 0;
14397
+ char *zWhere = 0;
14398
+
14399
+ if( bLastIsNull ){
14400
+ if( bLastIsDesc ) continue;
14401
+ zWhere = intckMprintf(p, "'%s IS NOT NULL'", zLast);
14402
+ }else{
14403
+ const char *zOp = bLastIsDesc ? "<" : ">";
14404
+ zWhere = intckMprintf(p, "'%s %s ' || quote(?%d)", zLast, zOp, ii);
14405
+ }
14406
+
14407
+ if( ii>1 ){
14408
+ const char *zLhsSep = "";
14409
+ const char *zRhsSep = "";
14410
+ int jj;
14411
+ for(jj=0; jj<ii-1; jj++){
14412
+ const char *zAlias = (const char*)sqlite3_column_name(p->pCheck,jj+1);
14413
+ zLhs = intckMprintf(p, "%z%s%s", zLhs, zLhsSep, zAlias);
14414
+ zRhs = intckMprintf(p, "%z%squote(?%d)", zRhs, zRhsSep, jj+1);
14415
+ zLhsSep = ",";
14416
+ zRhsSep = " || ',' || ";
14417
+ }
14418
+
14419
+ zWhere = intckMprintf(p,
14420
+ "'(%z) IS (' || %z || ') AND ' || %z",
14421
+ zLhs, zRhs, zWhere);
14422
+ }
14423
+ zWhere = intckMprintf(p, "'WHERE ' || %z", zWhere);
14424
+
14425
+ zSql = intckMprintf(p, "%z%s(quote( %z ) )",
14426
+ zSql,
14427
+ (zSql==0 ? "VALUES" : ",\n "),
14428
+ zWhere
14429
+ );
14430
+ }
14431
+ zSql = intckMprintf(p,
14432
+ "WITH wc(q) AS (\n%z\n)"
14433
+ "SELECT 'VALUES' || group_concat('(' || q || ')', ',\n ') FROM wc"
14434
+ , zSql
14435
+ );
14436
+ }
14437
+
14438
+ pStmt = intckPrepare(p, zSql);
14439
+ if( p->rc==SQLITE_OK ){
14440
+ for(ii=0; ii<p->nKeyVal; ii++){
14441
+ sqlite3_bind_value(pStmt, ii+1, sqlite3_column_value(p->pCheck, ii+1));
14442
+ }
14443
+ if( SQLITE_ROW==sqlite3_step(pStmt) ){
14444
+ p->zKey = intckMprintf(p,"%s",(const char*)sqlite3_column_text(pStmt, 0));
14445
+ }
14446
+ intckFinalize(p, pStmt);
14447
+ }
14448
+
14449
+ sqlite3_free(zSql);
14450
+ intckFinalize(p, pXinfo);
14451
+}
14452
+
14453
+/*
14454
+** Find the next database object (table or index) to check. If successful,
14455
+** set sqlite3_intck.zObj to point to a nul-terminated buffer containing
14456
+** the object's name before returning.
14457
+*/
14458
+static void intckFindObject(sqlite3_intck *p){
14459
+ sqlite3_stmt *pStmt = 0;
14460
+ char *zPrev = p->zObj;
14461
+ p->zObj = 0;
14462
+
14463
+ assert( p->rc==SQLITE_OK );
14464
+ assert( p->pCheck==0 );
14465
+
14466
+ pStmt = intckPrepareFmt(p,
14467
+ "WITH tables(table_name) AS ("
14468
+ " SELECT name"
14469
+ " FROM %Q.sqlite_schema WHERE (type='table' OR type='index') AND rootpage"
14470
+ " UNION ALL "
14471
+ " SELECT 'sqlite_schema'"
14472
+ ")"
14473
+ "SELECT table_name FROM tables "
14474
+ "WHERE ?1 IS NULL OR table_name%s?1 "
14475
+ "ORDER BY 1"
14476
+ , p->zDb, (p->zKey ? ">=" : ">")
14477
+ );
14478
+
14479
+ if( p->rc==SQLITE_OK ){
14480
+ sqlite3_bind_text(pStmt, 1, zPrev, -1, SQLITE_TRANSIENT);
14481
+ if( sqlite3_step(pStmt)==SQLITE_ROW ){
14482
+ p->zObj = intckMprintf(p,"%s",(const char*)sqlite3_column_text(pStmt, 0));
14483
+ }
14484
+ }
14485
+ intckFinalize(p, pStmt);
14486
+
14487
+ /* If this is a new object, ensure the previous key value is cleared. */
14488
+ if( sqlite3_stricmp(p->zObj, zPrev) ){
14489
+ sqlite3_free(p->zKey);
14490
+ p->zKey = 0;
14491
+ }
14492
+
14493
+ sqlite3_free(zPrev);
14494
+}
14495
+
14496
+/*
14497
+** Return the size in bytes of the first token in nul-terminated buffer z.
14498
+** For the purposes of this call, a token is either:
14499
+**
14500
+** * a quoted SQL string,
14501
+* * a contiguous series of ascii alphabet characters, or
14502
+* * any other single byte.
14503
+*/
14504
+static int intckGetToken(const char *z){
14505
+ char c = z[0];
14506
+ int iRet = 1;
14507
+ if( c=='\'' || c=='"' || c=='`' ){
14508
+ while( 1 ){
14509
+ if( z[iRet]==c ){
14510
+ iRet++;
14511
+ if( z[iRet]!=c ) break;
14512
+ }
14513
+ iRet++;
14514
+ }
14515
+ }
14516
+ else if( c=='[' ){
14517
+ while( z[iRet++]!=']' && z[iRet] );
14518
+ }
14519
+ else if( (c>='A' && c<='Z') || (c>='a' && c<='z') ){
14520
+ while( (z[iRet]>='A' && z[iRet]<='Z') || (z[iRet]>='a' && z[iRet]<='z') ){
14521
+ iRet++;
14522
+ }
14523
+ }
14524
+
14525
+ return iRet;
14526
+}
14527
+
14528
+/*
14529
+** Return true if argument c is an ascii whitespace character.
14530
+*/
14531
+static int intckIsSpace(char c){
14532
+ return (c==' ' || c=='\t' || c=='\n' || c=='\r');
14533
+}
14534
+
14535
+/*
14536
+** Argument z points to the text of a CREATE INDEX statement. This function
14537
+** identifies the part of the text that contains either the index WHERE
14538
+** clause (if iCol<0) or the iCol'th column of the index.
14539
+**
14540
+** If (iCol<0), the identified fragment does not include the "WHERE" keyword,
14541
+** only the expression that follows it. If (iCol>=0) then the identified
14542
+** fragment does not include any trailing sort-order keywords - "ASC" or
14543
+** "DESC".
14544
+**
14545
+** If the CREATE INDEX statement does not contain the requested field or
14546
+** clause, NULL is returned and (*pnByte) is set to 0. Otherwise, a pointer to
14547
+** the identified fragment is returned and output parameter (*pnByte) set
14548
+** to its size in bytes.
14549
+*/
14550
+static const char *intckParseCreateIndex(const char *z, int iCol, int *pnByte){
14551
+ int iOff = 0;
14552
+ int iThisCol = 0;
14553
+ int iStart = 0;
14554
+ int nOpen = 0;
14555
+
14556
+ const char *zRet = 0;
14557
+ int nRet = 0;
14558
+
14559
+ int iEndOfCol = 0;
14560
+
14561
+ /* Skip forward until the first "(" token */
14562
+ while( z[iOff]!='(' ){
14563
+ iOff += intckGetToken(&z[iOff]);
14564
+ if( z[iOff]=='\0' ) return 0;
14565
+ }
14566
+ assert( z[iOff]=='(' );
14567
+
14568
+ nOpen = 1;
14569
+ iOff++;
14570
+ iStart = iOff;
14571
+ while( z[iOff] ){
14572
+ const char *zToken = &z[iOff];
14573
+ int nToken = 0;
14574
+
14575
+ /* Check if this is the end of the current column - either a "," or ")"
14576
+ ** when nOpen==1. */
14577
+ if( nOpen==1 ){
14578
+ if( z[iOff]==',' || z[iOff]==')' ){
14579
+ if( iCol==iThisCol ){
14580
+ int iEnd = iEndOfCol ? iEndOfCol : iOff;
14581
+ nRet = (iEnd - iStart);
14582
+ zRet = &z[iStart];
14583
+ break;
14584
+ }
14585
+ iStart = iOff+1;
14586
+ while( intckIsSpace(z[iStart]) ) iStart++;
14587
+ iThisCol++;
14588
+ }
14589
+ if( z[iOff]==')' ) break;
14590
+ }
14591
+ if( z[iOff]=='(' ) nOpen++;
14592
+ if( z[iOff]==')' ) nOpen--;
14593
+ nToken = intckGetToken(zToken);
14594
+
14595
+ if( (nToken==3 && 0==sqlite3_strnicmp(zToken, "ASC", nToken))
14596
+ || (nToken==4 && 0==sqlite3_strnicmp(zToken, "DESC", nToken))
14597
+ ){
14598
+ iEndOfCol = iOff;
14599
+ }else if( 0==intckIsSpace(zToken[0]) ){
14600
+ iEndOfCol = 0;
14601
+ }
14602
+
14603
+ iOff += nToken;
14604
+ }
14605
+
14606
+ /* iStart is now the byte offset of 1 byte passed the final ')' in the
14607
+ ** CREATE INDEX statement. Try to find a WHERE clause to return. */
14608
+ while( zRet==0 && z[iOff] ){
14609
+ int n = intckGetToken(&z[iOff]);
14610
+ if( n==5 && 0==sqlite3_strnicmp(&z[iOff], "where", 5) ){
14611
+ zRet = &z[iOff+5];
14612
+ nRet = (int)strlen(zRet);
14613
+ }
14614
+ iOff += n;
14615
+ }
14616
+
14617
+ /* Trim any whitespace from the start and end of the returned string. */
14618
+ if( zRet ){
14619
+ while( intckIsSpace(zRet[0]) ){
14620
+ nRet--;
14621
+ zRet++;
14622
+ }
14623
+ while( nRet>0 && intckIsSpace(zRet[nRet-1]) ) nRet--;
14624
+ }
14625
+
14626
+ *pnByte = nRet;
14627
+ return zRet;
14628
+}
14629
+
14630
+/*
14631
+** User-defined SQL function wrapper for intckParseCreateIndex():
14632
+**
14633
+** SELECT parse_create_index(<sql>, <icol>);
14634
+*/
14635
+static void intckParseCreateIndexFunc(
14636
+ sqlite3_context *pCtx,
14637
+ int nVal,
14638
+ sqlite3_value **apVal
14639
+){
14640
+ const char *zSql = (const char*)sqlite3_value_text(apVal[0]);
14641
+ int idx = sqlite3_value_int(apVal[1]);
14642
+ const char *zRes = 0;
14643
+ int nRes = 0;
14644
+
14645
+ assert( nVal==2 );
14646
+ if( zSql ){
14647
+ zRes = intckParseCreateIndex(zSql, idx, &nRes);
14648
+ }
14649
+ sqlite3_result_text(pCtx, zRes, nRes, SQLITE_TRANSIENT);
14650
+}
14651
+
14652
+/*
14653
+** Return true if sqlite3_intck.db has automatic indexes enabled, false
14654
+** otherwise.
14655
+*/
14656
+static int intckGetAutoIndex(sqlite3_intck *p){
14657
+ int bRet = 0;
14658
+ sqlite3_stmt *pStmt = 0;
14659
+ pStmt = intckPrepare(p, "PRAGMA automatic_index");
14660
+ if( SQLITE_ROW==intckStep(p, pStmt) ){
14661
+ bRet = sqlite3_column_int(pStmt, 0);
14662
+ }
14663
+ intckFinalize(p, pStmt);
14664
+ return bRet;
14665
+}
14666
+
14667
+/*
14668
+** Return true if zObj is an index, or false otherwise.
14669
+*/
14670
+static int intckIsIndex(sqlite3_intck *p, const char *zObj){
14671
+ int bRet = 0;
14672
+ sqlite3_stmt *pStmt = 0;
14673
+ pStmt = intckPrepareFmt(p,
14674
+ "SELECT 1 FROM %Q.sqlite_schema WHERE name=%Q AND type='index'",
14675
+ p->zDb, zObj
14676
+ );
14677
+ if( p->rc==SQLITE_OK && SQLITE_ROW==sqlite3_step(pStmt) ){
14678
+ bRet = 1;
14679
+ }
14680
+ intckFinalize(p, pStmt);
14681
+ return bRet;
14682
+}
14683
+
14684
+/*
14685
+** Return a pointer to a nul-terminated buffer containing the SQL statement
14686
+** used to check database object zObj (a table or index) for corruption.
14687
+** If parameter zPrev is not NULL, then it must be a string containing the
14688
+** vector key required to restart the check where it left off last time.
14689
+** If pnKeyVal is not NULL, then (*pnKeyVal) is set to the number of
14690
+** columns in the vector key value for the specified object.
14691
+**
14692
+** This function uses the sqlite3_intck error code convention.
14693
+*/
14694
+static char *intckCheckObjectSql(
14695
+ sqlite3_intck *p, /* Integrity check object */
14696
+ const char *zObj, /* Object (table or index) to scan */
14697
+ const char *zPrev, /* Restart key vector, if any */
14698
+ int *pnKeyVal /* OUT: Number of key-values for this scan */
14699
+){
14700
+ char *zRet = 0;
14701
+ sqlite3_stmt *pStmt = 0;
14702
+ int bAutoIndex = 0;
14703
+ int bIsIndex = 0;
14704
+
14705
+ const char *zCommon =
14706
+ /* Relation without_rowid also contains just one row. Column "b" is
14707
+ ** set to true if the table being examined is a WITHOUT ROWID table,
14708
+ ** or false otherwise. */
14709
+ ", without_rowid(b) AS ("
14710
+ " SELECT EXISTS ("
14711
+ " SELECT 1 FROM tabname, pragma_index_list(tab, db) AS l"
14712
+ " WHERE origin='pk' "
14713
+ " AND NOT EXISTS (SELECT 1 FROM sqlite_schema WHERE name=l.name)"
14714
+ " )"
14715
+ ")"
14716
+ ""
14717
+ /* Table idx_cols contains 1 row for each column in each index on the
14718
+ ** table being checked. Columns are:
14719
+ **
14720
+ ** idx_name: Name of the index.
14721
+ ** idx_ispk: True if this index is the PK of a WITHOUT ROWID table.
14722
+ ** col_name: Name of indexed column, or NULL for index on expression.
14723
+ ** col_expr: Indexed expression, including COLLATE clause.
14724
+ ** col_alias: Alias used for column in 'intck_wrapper' table.
14725
+ */
14726
+ ", idx_cols(idx_name, idx_ispk, col_name, col_expr, col_alias) AS ("
14727
+ " SELECT l.name, (l.origin=='pk' AND w.b), i.name, COALESCE(("
14728
+ " SELECT parse_create_index(sql, i.seqno) FROM "
14729
+ " sqlite_schema WHERE name = l.name"
14730
+ " ), format('\"%w\"', i.name) || ' COLLATE ' || quote(i.coll)),"
14731
+ " 'c' || row_number() OVER ()"
14732
+ " FROM "
14733
+ " tabname t,"
14734
+ " without_rowid w,"
14735
+ " pragma_index_list(t.tab, t.db) l,"
14736
+ " pragma_index_xinfo(l.name) i"
14737
+ " WHERE i.key"
14738
+ " UNION ALL"
14739
+ " SELECT '', 1, '_rowid_', '_rowid_', 'r1' FROM without_rowid WHERE b=0"
14740
+ ")"
14741
+ ""
14742
+ ""
14743
+ /*
14744
+ ** For a PK declared as "PRIMARY KEY(a, b) ... WITHOUT ROWID", where
14745
+ ** the intck_wrapper aliases of "a" and "b" are "c1" and "c2":
14746
+ **
14747
+ ** o_pk: "o.c1, o.c2"
14748
+ ** i_pk: "i.'a', i.'b'"
14749
+ ** ...
14750
+ ** n_pk: 2
14751
+ */
14752
+ ", tabpk(db, tab, idx, o_pk, i_pk, q_pk, eq_pk, ps_pk, pk_pk, n_pk) AS ("
14753
+ " WITH pkfields(f, a) AS ("
14754
+ " SELECT i.col_name, i.col_alias FROM idx_cols i WHERE i.idx_ispk"
14755
+ " )"
14756
+ " SELECT t.db, t.tab, t.idx, "
14757
+ " group_concat(a, ', '), "
14758
+ " group_concat('i.'||quote(f), ', '), "
14759
+ " group_concat('quote(o.'||a||')', ' || '','' || '), "
14760
+ " format('(%s)==(%s)',"
14761
+ " group_concat('o.'||a, ', '), "
14762
+ " group_concat(format('\"%w\"', f), ', ')"
14763
+ " ),"
14764
+ " group_concat('%s', ','),"
14765
+ " group_concat('quote('||a||')', ', '), "
14766
+ " count(*)"
14767
+ " FROM tabname t, pkfields"
14768
+ ")"
14769
+ ""
14770
+ ", idx(name, match_expr, partial, partial_alias, idx_ps, idx_idx) AS ("
14771
+ " SELECT idx_name,"
14772
+ " format('(%s,%s) IS (%s,%s)', "
14773
+ " group_concat(i.col_expr, ', '), i_pk,"
14774
+ " group_concat('o.'||i.col_alias, ', '), o_pk"
14775
+ " ), "
14776
+ " parse_create_index("
14777
+ " (SELECT sql FROM sqlite_schema WHERE name=idx_name), -1"
14778
+ " ),"
14779
+ " 'cond' || row_number() OVER ()"
14780
+ " , group_concat('%s', ',')"
14781
+ " , group_concat('quote('||i.col_alias||')', ', ')"
14782
+ " FROM tabpk t, "
14783
+ " without_rowid w,"
14784
+ " idx_cols i"
14785
+ " WHERE i.idx_ispk==0 "
14786
+ " GROUP BY idx_name"
14787
+ ")"
14788
+ ""
14789
+ ", wrapper_with(s) AS ("
14790
+ " SELECT 'intck_wrapper AS (\n SELECT\n ' || ("
14791
+ " WITH f(a, b) AS ("
14792
+ " SELECT col_expr, col_alias FROM idx_cols"
14793
+ " UNION ALL "
14794
+ " SELECT partial, partial_alias FROM idx WHERE partial IS NOT NULL"
14795
+ " )"
14796
+ " SELECT group_concat(format('%s AS %s', a, b), ',\n ') FROM f"
14797
+ " )"
14798
+ " || format('\n FROM %Q.%Q ', t.db, t.tab)"
14799
+ /* If the object being checked is a table, append "NOT INDEXED".
14800
+ ** Otherwise, append "INDEXED BY <index>", and then, if the index
14801
+ ** is a partial index " WHERE <condition>". */
14802
+ " || CASE WHEN t.idx IS NULL THEN "
14803
+ " 'NOT INDEXED'"
14804
+ " ELSE"
14805
+ " format('INDEXED BY %Q%s', t.idx, ' WHERE '||i.partial)"
14806
+ " END"
14807
+ " || '\n)'"
14808
+ " FROM tabname t LEFT JOIN idx i ON (i.name=t.idx)"
14809
+ ")"
14810
+ ""
14811
+ ;
14812
+
14813
+ bAutoIndex = intckGetAutoIndex(p);
14814
+ if( bAutoIndex ) intckExec(p, "PRAGMA automatic_index = 0");
14815
+
14816
+ bIsIndex = intckIsIndex(p, zObj);
14817
+ if( bIsIndex ){
14818
+ pStmt = intckPrepareFmt(p,
14819
+ /* Table idxname contains a single row. The first column, "db", contains
14820
+ ** the name of the db containing the table (e.g. "main") and the second,
14821
+ ** "tab", the name of the table itself. */
14822
+ "WITH tabname(db, tab, idx) AS ("
14823
+ " SELECT %Q, (SELECT tbl_name FROM %Q.sqlite_schema WHERE name=%Q), %Q "
14824
+ ")"
14825
+ ""
14826
+ ", whereclause(w_c) AS (%s)"
14827
+ ""
14828
+ "%s" /* zCommon */
14829
+ ""
14830
+ ", case_statement(c) AS ("
14831
+ " SELECT "
14832
+ " 'CASE WHEN (' || group_concat(col_alias, ', ') || ', 1) IS (\n' "
14833
+ " || ' SELECT ' || group_concat(col_expr, ', ') || ', 1 FROM '"
14834
+ " || format('%%Q.%%Q NOT INDEXED WHERE %%s\n', t.db, t.tab, p.eq_pk)"
14835
+ " || ' )\n THEN NULL\n '"
14836
+ " || 'ELSE format(''surplus entry ('"
14837
+ " || group_concat('%%s', ',') || ',' || p.ps_pk"
14838
+ " || ') in index ' || t.idx || ''', ' "
14839
+ " || group_concat('quote('||i.col_alias||')', ', ') || ', ' || p.pk_pk"
14840
+ " || ')'"
14841
+ " || '\n END AS error_message'"
14842
+ " FROM tabname t, tabpk p, idx_cols i WHERE i.idx_name=t.idx"
14843
+ ")"
14844
+ ""
14845
+ ", thiskey(k, n) AS ("
14846
+ " SELECT group_concat(i.col_alias, ', ') || ', ' || p.o_pk, "
14847
+ " count(*) + p.n_pk "
14848
+ " FROM tabpk p, idx_cols i WHERE i.idx_name=p.idx"
14849
+ ")"
14850
+ ""
14851
+ ", main_select(m, n) AS ("
14852
+ " SELECT format("
14853
+ " 'WITH %%s\n' ||"
14854
+ " ', idx_checker AS (\n' ||"
14855
+ " ' SELECT %%s,\n' ||"
14856
+ " ' %%s\n' || "
14857
+ " ' FROM intck_wrapper AS o\n' ||"
14858
+ " ')\n',"
14859
+ " ww.s, c, t.k"
14860
+ " ), t.n"
14861
+ " FROM case_statement, wrapper_with ww, thiskey t"
14862
+ ")"
14863
+
14864
+ "SELECT m || "
14865
+ " group_concat('SELECT * FROM idx_checker ' || w_c, ' UNION ALL '), n"
14866
+ " FROM "
14867
+ "main_select, whereclause "
14868
+ , p->zDb, p->zDb, zObj, zObj
14869
+ , zPrev ? zPrev : "VALUES('')", zCommon
14870
+ );
14871
+ }else{
14872
+ pStmt = intckPrepareFmt(p,
14873
+ /* Table tabname contains a single row. The first column, "db", contains
14874
+ ** the name of the db containing the table (e.g. "main") and the second,
14875
+ ** "tab", the name of the table itself. */
14876
+ "WITH tabname(db, tab, idx, prev) AS (SELECT %Q, %Q, NULL, %Q)"
14877
+ ""
14878
+ "%s" /* zCommon */
14879
+
14880
+ /* expr(e) contains one row for each index on table zObj. Value e
14881
+ ** is set to an expression that evaluates to NULL if the required
14882
+ ** entry is present in the index, or an error message otherwise. */
14883
+ ", expr(e, p) AS ("
14884
+ " SELECT format('CASE WHEN EXISTS \n"
14885
+ " (SELECT 1 FROM %%Q.%%Q AS i INDEXED BY %%Q WHERE %%s%%s)\n"
14886
+ " THEN NULL\n"
14887
+ " ELSE format(''entry (%%s,%%s) missing from index %%s'', %%s, %%s)\n"
14888
+ " END\n'"
14889
+ " , t.db, t.tab, i.name, i.match_expr, ' AND (' || partial || ')',"
14890
+ " i.idx_ps, t.ps_pk, i.name, i.idx_idx, t.pk_pk),"
14891
+ " CASE WHEN partial IS NULL THEN NULL ELSE i.partial_alias END"
14892
+ " FROM tabpk t, idx i"
14893
+ ")"
14894
+
14895
+ ", numbered(ii, cond, e) AS ("
14896
+ " SELECT 0, 'n.ii=0', 'NULL'"
14897
+ " UNION ALL "
14898
+ " SELECT row_number() OVER (),"
14899
+ " '(n.ii='||row_number() OVER ()||COALESCE(' AND '||p||')', ')'), e"
14900
+ " FROM expr"
14901
+ ")"
14902
+
14903
+ ", counter_with(w) AS ("
14904
+ " SELECT 'WITH intck_counter(ii) AS (\n ' || "
14905
+ " group_concat('SELECT '||ii, ' UNION ALL\n ') "
14906
+ " || '\n)' FROM numbered"
14907
+ ")"
14908
+ ""
14909
+ ", case_statement(c) AS ("
14910
+ " SELECT 'CASE ' || "
14911
+ " group_concat(format('\n WHEN %%s THEN (%%s)', cond, e), '') ||"
14912
+ " '\nEND AS error_message'"
14913
+ " FROM numbered"
14914
+ ")"
14915
+ ""
14916
+
14917
+ /* This table contains a single row consisting of a single value -
14918
+ ** the text of an SQL expression that may be used by the main SQL
14919
+ ** statement to output an SQL literal that can be used to resume
14920
+ ** the scan if it is suspended. e.g. for a rowid table, an expression
14921
+ ** like:
14922
+ **
14923
+ ** format('(%d,%d)', _rowid_, n.ii)
14924
+ */
14925
+ ", thiskey(k, n) AS ("
14926
+ " SELECT o_pk || ', ii', n_pk+1 FROM tabpk"
14927
+ ")"
14928
+ ""
14929
+ ", whereclause(w_c) AS ("
14930
+ " SELECT CASE WHEN prev!='' THEN "
14931
+ " '\nWHERE (' || o_pk ||', n.ii) > ' || prev"
14932
+ " ELSE ''"
14933
+ " END"
14934
+ " FROM tabpk, tabname"
14935
+ ")"
14936
+ ""
14937
+ ", main_select(m, n) AS ("
14938
+ " SELECT format("
14939
+ " '%%s, %%s\nSELECT %%s,\n%%s\nFROM intck_wrapper AS o"
14940
+ ", intck_counter AS n%%s\nORDER BY %%s', "
14941
+ " w, ww.s, c, thiskey.k, whereclause.w_c, t.o_pk"
14942
+ " ), thiskey.n"
14943
+ " FROM case_statement, tabpk t, counter_with, "
14944
+ " wrapper_with ww, thiskey, whereclause"
14945
+ ")"
14946
+
14947
+ "SELECT m, n FROM main_select",
14948
+ p->zDb, zObj, zPrev, zCommon
14949
+ );
14950
+ }
14951
+
14952
+ while( p->rc==SQLITE_OK && SQLITE_ROW==sqlite3_step(pStmt) ){
14953
+ zRet = intckMprintf(p, "%s", (const char*)sqlite3_column_text(pStmt, 0));
14954
+ if( pnKeyVal ){
14955
+ *pnKeyVal = sqlite3_column_int(pStmt, 1);
14956
+ }
14957
+ }
14958
+ intckFinalize(p, pStmt);
14959
+
14960
+ if( bAutoIndex ) intckExec(p, "PRAGMA automatic_index = 1");
14961
+ return zRet;
14962
+}
14963
+
14964
+/*
14965
+** Open a new integrity-check object.
14966
+*/
14967
+int sqlite3_intck_open(
14968
+ sqlite3 *db, /* Database handle to operate on */
14969
+ const char *zDbArg, /* "main", "temp" etc. */
14970
+ sqlite3_intck **ppOut /* OUT: New integrity-check handle */
14971
+){
14972
+ sqlite3_intck *pNew = 0;
14973
+ int rc = SQLITE_OK;
14974
+ const char *zDb = zDbArg ? zDbArg : "main";
14975
+ int nDb = (int)strlen(zDb);
14976
+
14977
+ pNew = (sqlite3_intck*)sqlite3_malloc(sizeof(*pNew) + nDb + 1);
14978
+ if( pNew==0 ){
14979
+ rc = SQLITE_NOMEM;
14980
+ }else{
14981
+ memset(pNew, 0, sizeof(*pNew));
14982
+ pNew->db = db;
14983
+ pNew->zDb = (const char*)&pNew[1];
14984
+ memcpy(&pNew[1], zDb, nDb+1);
14985
+ rc = sqlite3_create_function(db, "parse_create_index",
14986
+ 2, SQLITE_UTF8, 0, intckParseCreateIndexFunc, 0, 0
14987
+ );
14988
+ if( rc!=SQLITE_OK ){
14989
+ sqlite3_intck_close(pNew);
14990
+ pNew = 0;
14991
+ }
14992
+ }
14993
+
14994
+ *ppOut = pNew;
14995
+ return rc;
14996
+}
14997
+
14998
+/*
14999
+** Free the integrity-check object.
15000
+*/
15001
+void sqlite3_intck_close(sqlite3_intck *p){
15002
+ if( p ){
15003
+ sqlite3_finalize(p->pCheck);
15004
+ sqlite3_create_function(
15005
+ p->db, "parse_create_index", 1, SQLITE_UTF8, 0, 0, 0, 0
15006
+ );
15007
+ sqlite3_free(p->zObj);
15008
+ sqlite3_free(p->zKey);
15009
+ sqlite3_free(p->zTestSql);
15010
+ sqlite3_free(p->zErr);
15011
+ sqlite3_free(p->zMessage);
15012
+ sqlite3_free(p);
15013
+ }
15014
+}
15015
+
15016
+/*
15017
+** Step the integrity-check object.
15018
+*/
15019
+int sqlite3_intck_step(sqlite3_intck *p){
15020
+ if( p->rc==SQLITE_OK ){
15021
+
15022
+ if( p->zMessage ){
15023
+ sqlite3_free(p->zMessage);
15024
+ p->zMessage = 0;
15025
+ }
15026
+
15027
+ if( p->bCorruptSchema ){
15028
+ p->rc = SQLITE_DONE;
15029
+ }else
15030
+ if( p->pCheck==0 ){
15031
+ intckFindObject(p);
15032
+ if( p->rc==SQLITE_OK ){
15033
+ if( p->zObj ){
15034
+ char *zSql = 0;
15035
+ zSql = intckCheckObjectSql(p, p->zObj, p->zKey, &p->nKeyVal);
15036
+ p->pCheck = intckPrepare(p, zSql);
15037
+ sqlite3_free(zSql);
15038
+ sqlite3_free(p->zKey);
15039
+ p->zKey = 0;
15040
+ }else{
15041
+ p->rc = SQLITE_DONE;
15042
+ }
15043
+ }else if( p->rc==SQLITE_CORRUPT ){
15044
+ p->rc = SQLITE_OK;
15045
+ p->zMessage = intckMprintf(p, "%s",
15046
+ "corruption found while reading database schema"
15047
+ );
15048
+ p->bCorruptSchema = 1;
15049
+ }
15050
+ }
15051
+
15052
+ if( p->pCheck ){
15053
+ assert( p->rc==SQLITE_OK );
15054
+ if( sqlite3_step(p->pCheck)==SQLITE_ROW ){
15055
+ /* Normal case, do nothing. */
15056
+ }else{
15057
+ intckFinalize(p, p->pCheck);
15058
+ p->pCheck = 0;
15059
+ p->nKeyVal = 0;
15060
+ if( p->rc==SQLITE_CORRUPT ){
15061
+ p->rc = SQLITE_OK;
15062
+ p->zMessage = intckMprintf(p,
15063
+ "corruption found while scanning database object %s", p->zObj
15064
+ );
15065
+ }
15066
+ }
15067
+ }
15068
+ }
15069
+
15070
+ return p->rc;
15071
+}
15072
+
15073
+/*
15074
+** Return a message describing the corruption encountered by the most recent
15075
+** call to sqlite3_intck_step(), or NULL if no corruption was encountered.
15076
+*/
15077
+const char *sqlite3_intck_message(sqlite3_intck *p){
15078
+ assert( p->pCheck==0 || p->zMessage==0 );
15079
+ if( p->zMessage ){
15080
+ return p->zMessage;
15081
+ }
15082
+ if( p->pCheck ){
15083
+ return (const char*)sqlite3_column_text(p->pCheck, 0);
15084
+ }
15085
+ return 0;
15086
+}
15087
+
15088
+/*
15089
+** Return the error code and message.
15090
+*/
15091
+int sqlite3_intck_error(sqlite3_intck *p, const char **pzErr){
15092
+ if( pzErr ) *pzErr = p->zErr;
15093
+ return (p->rc==SQLITE_DONE ? SQLITE_OK : p->rc);
15094
+}
15095
+
15096
+/*
15097
+** Close any read transaction the integrity-check object is holding open
15098
+** on the database.
15099
+*/
15100
+int sqlite3_intck_unlock(sqlite3_intck *p){
15101
+ if( p->rc==SQLITE_OK && p->pCheck ){
15102
+ assert( p->zKey==0 && p->nKeyVal>0 );
15103
+ intckSaveKey(p);
15104
+ intckFinalize(p, p->pCheck);
15105
+ p->pCheck = 0;
15106
+ }
15107
+ return p->rc;
15108
+}
15109
+
15110
+/*
15111
+** Return the SQL statement used to check object zObj. Or, if zObj is
15112
+** NULL, the current SQL statement.
15113
+*/
15114
+const char *sqlite3_intck_test_sql(sqlite3_intck *p, const char *zObj){
15115
+ sqlite3_free(p->zTestSql);
15116
+ if( zObj ){
15117
+ p->zTestSql = intckCheckObjectSql(p, zObj, 0, 0);
15118
+ }else{
15119
+ if( p->zObj ){
15120
+ p->zTestSql = intckCheckObjectSql(p, p->zObj, p->zKey, 0);
15121
+ }else{
15122
+ sqlite3_free(p->zTestSql);
15123
+ p->zTestSql = 0;
15124
+ }
15125
+ }
15126
+ return p->zTestSql;
15127
+}
15128
+
15129
+/************************* End ../ext/intck/sqlite3intck.c ********************/
1401215130
1401315131
#if !defined(SQLITE_OMIT_VIRTUALTABLE) && defined(SQLITE_ENABLE_DBPAGE_VTAB)
1401415132
#define SQLITE_SHELL_HAVE_RECOVER 1
1401515133
#else
1401615134
#define SQLITE_SHELL_HAVE_RECOVER 0
@@ -20641,10 +21759,11 @@
2064121759
const char *zShowNull = p->nullValue;
2064221760
2064321761
rc = sqlite3_step(pStmt);
2064421762
if( rc!=SQLITE_ROW ) return;
2064521763
nColumn = sqlite3_column_count(pStmt);
21764
+ if( nColumn==0 ) goto columnar_end;
2064621765
nAlloc = nColumn*4;
2064721766
if( nAlloc<=0 ) nAlloc = 1;
2064821767
azData = sqlite3_malloc64( nAlloc*sizeof(char*) );
2064921768
shell_check_oom(azData);
2065021769
azNextLine = sqlite3_malloc64( nColumn*sizeof(char*) );
@@ -20726,11 +21845,10 @@
2072621845
n = strlenChar(z);
2072721846
j = i%nColumn;
2072821847
if( n>p->actualWidth[j] ) p->actualWidth[j] = n;
2072921848
}
2073021849
if( seenInterrupt ) goto columnar_end;
20731
- if( nColumn==0 ) goto columnar_end;
2073221850
switch( p->cMode ){
2073321851
case MODE_Column: {
2073421852
colSep = " ";
2073521853
rowSep = "\n";
2073621854
if( p->showHeader ){
@@ -21609,10 +22727,11 @@
2160922727
",imposter INDEX TABLE Create imposter table TABLE on index INDEX",
2161022728
#endif
2161122729
".indexes ?TABLE? Show names of indexes",
2161222730
" If TABLE is specified, only show indexes for",
2161322731
" tables matching TABLE using the LIKE operator.",
22732
+ ".intck ?STEPS_PER_UNLOCK? Run an incremental integrity check on the db",
2161422733
#ifdef SQLITE_ENABLE_IOTRACE
2161522734
",iotrace FILE Enable I/O diagnostic logging to FILE",
2161622735
#endif
2161722736
".limit ?LIMIT? ?VAL? Display or change the value of an SQLITE_LIMIT",
2161822737
".lint OPTIONS Report potential schema issues.",
@@ -24518,10 +25637,44 @@
2451825637
rc = sqlite3_recover_finish(p);
2451925638
return rc;
2452025639
}
2452125640
#endif /* SQLITE_SHELL_HAVE_RECOVER */
2452225641
25642
+/*
25643
+** Implementation of ".intck STEPS_PER_UNLOCK" command.
25644
+*/
25645
+static int intckDatabaseCmd(ShellState *pState, i64 nStepPerUnlock){
25646
+ sqlite3_intck *p = 0;
25647
+ int rc = SQLITE_OK;
25648
+
25649
+ rc = sqlite3_intck_open(pState->db, "main", &p);
25650
+ if( rc==SQLITE_OK ){
25651
+ i64 nStep = 0;
25652
+ i64 nError = 0;
25653
+ const char *zErr = 0;
25654
+ while( SQLITE_OK==sqlite3_intck_step(p) ){
25655
+ const char *zMsg = sqlite3_intck_message(p);
25656
+ if( zMsg ){
25657
+ oputf("%s\n", zMsg);
25658
+ nError++;
25659
+ }
25660
+ nStep++;
25661
+ if( nStepPerUnlock && (nStep % nStepPerUnlock)==0 ){
25662
+ sqlite3_intck_unlock(p);
25663
+ }
25664
+ }
25665
+ rc = sqlite3_intck_error(p, &zErr);
25666
+ if( zErr ){
25667
+ eputf("%s\n", zErr);
25668
+ }
25669
+ sqlite3_intck_close(p);
25670
+
25671
+ oputf("%lld steps, %lld errors\n", nStep, nError);
25672
+ }
25673
+
25674
+ return rc;
25675
+}
2452325676
2452425677
/*
2452525678
* zAutoColumn(zCol, &db, ?) => Maybe init db, add column zCol to it.
2452625679
* zAutoColumn(0, &db, ?) => (db!=0) Form columns spec for CREATE TABLE,
2452725680
* close db and set it to 0, and return the columns spec, to later
@@ -26007,10 +27160,25 @@
2600727160
rc = 1;
2600827161
}
2600927162
sqlite3_free(zSql);
2601027163
}else
2601127164
#endif /* !defined(SQLITE_OMIT_TEST_CONTROL) */
27165
+
27166
+ if( c=='i' && cli_strncmp(azArg[0], "intck", n)==0 ){
27167
+ i64 iArg = 0;
27168
+ if( nArg==2 ){
27169
+ iArg = integerValue(azArg[1]);
27170
+ if( iArg==0 ) iArg = -1;
27171
+ }
27172
+ if( (nArg!=1 && nArg!=2) || iArg<0 ){
27173
+ eputf("%s","Usage: .intck STEPS_PER_UNLOCK\n");
27174
+ rc = 1;
27175
+ goto meta_command_exit;
27176
+ }
27177
+ open_db(p, 0);
27178
+ rc = intckDatabaseCmd(p, iArg);
27179
+ }else
2601227180
2601327181
#ifdef SQLITE_ENABLE_IOTRACE
2601427182
if( c=='i' && cli_strncmp(azArg[0], "iotrace", n)==0 ){
2601527183
SQLITE_API extern void (SQLITE_CDECL *sqlite3IoTrace)(const char*, ...);
2601627184
if( iotrace && iotrace!=stdout ) fclose(iotrace);
@@ -29587,10 +30755,15 @@
2958730755
}
2958830756
}
2958930757
#ifndef SQLITE_SHELL_FIDDLE
2959030758
/* In WASM mode we have to leave the db state in place so that
2959130759
** client code can "push" SQL into it after this call returns. */
30760
+#ifndef SQLITE_OMIT_VIRTUALTABLE
30761
+ if( data.expert.pExpert ){
30762
+ expertFinish(&data, 1, 0);
30763
+ }
30764
+#endif
2959230765
free(azCmd);
2959330766
set_table_name(&data, 0);
2959430767
if( data.db ){
2959530768
session_close_all(&data, -1);
2959630769
close_db(data.db);
@@ -29653,11 +30826,11 @@
2965330826
return pVfs;
2965430827
}
2965530828
2965630829
/* Only for emcc experimentation purposes. */
2965730830
sqlite3 * fiddle_db_arg(sqlite3 *arg){
29658
- printf("fiddle_db_arg(%p)\n", (const void*)arg);
30831
+ oputf("fiddle_db_arg(%p)\n", (const void*)arg);
2965930832
return arg;
2966030833
}
2966130834
2966230835
/*
2966330836
** Intended to be called via a SharedWorker() while a separate
@@ -29679,16 +30852,26 @@
2967930852
: NULL;
2968030853
}
2968130854
2968230855
/*
2968330856
** Completely wipes out the contents of the currently-opened database
29684
-** but leaves its storage intact for reuse.
30857
+** but leaves its storage intact for reuse. If any transactions are
30858
+** active, they are forcibly rolled back.
2968530859
*/
2968630860
void fiddle_reset_db(void){
2968730861
if( globalDb ){
29688
- int rc = sqlite3_db_config(globalDb, SQLITE_DBCONFIG_RESET_DATABASE, 1, 0);
29689
- if( 0==rc ) rc = sqlite3_exec(globalDb, "VACUUM", 0, 0, 0);
30862
+ int rc;
30863
+ while( sqlite3_txn_state(globalDb,0)>0 ){
30864
+ /*
30865
+ ** Resolve problem reported in
30866
+ ** https://sqlite.org/forum/forumpost/0b41a25d65
30867
+ */
30868
+ oputz("Rolling back in-progress transaction.\n");
30869
+ sqlite3_exec(globalDb,"ROLLBACK", 0, 0, 0);
30870
+ }
30871
+ rc = sqlite3_db_config(globalDb, SQLITE_DBCONFIG_RESET_DATABASE, 1, 0);
30872
+ if( 0==rc ) sqlite3_exec(globalDb, "VACUUM", 0, 0, 0);
2969030873
sqlite3_db_config(globalDb, SQLITE_DBCONFIG_RESET_DATABASE, 0, 0);
2969130874
}
2969230875
}
2969330876
2969430877
/*
2969530878
--- extsrc/shell.c
+++ extsrc/shell.c
@@ -13806,11 +13806,11 @@
13806 /* Copy the entire schema of database [db] into [dbm]. */
13807 if( rc==SQLITE_OK ){
13808 sqlite3_stmt *pSql = 0;
13809 rc = idxPrintfPrepareStmt(pNew->db, &pSql, pzErrmsg,
13810 "SELECT sql FROM sqlite_schema WHERE name NOT LIKE 'sqlite_%%'"
13811 " AND sql NOT LIKE 'CREATE VIRTUAL %%'"
13812 );
13813 while( rc==SQLITE_OK && SQLITE_ROW==sqlite3_step(pSql) ){
13814 const char *zSql = (const char*)sqlite3_column_text(pSql, 0);
13815 if( zSql ) rc = sqlite3_exec(pNew->dbm, zSql, 0, 0, pzErrmsg);
13816 }
@@ -14007,10 +14007,1128 @@
14007 }
14008
14009 #endif /* ifndef SQLITE_OMIT_VIRTUALTABLE */
14010
14011 /************************* End ../ext/expert/sqlite3expert.c ********************/
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14012
14013 #if !defined(SQLITE_OMIT_VIRTUALTABLE) && defined(SQLITE_ENABLE_DBPAGE_VTAB)
14014 #define SQLITE_SHELL_HAVE_RECOVER 1
14015 #else
14016 #define SQLITE_SHELL_HAVE_RECOVER 0
@@ -20641,10 +21759,11 @@
20641 const char *zShowNull = p->nullValue;
20642
20643 rc = sqlite3_step(pStmt);
20644 if( rc!=SQLITE_ROW ) return;
20645 nColumn = sqlite3_column_count(pStmt);
 
20646 nAlloc = nColumn*4;
20647 if( nAlloc<=0 ) nAlloc = 1;
20648 azData = sqlite3_malloc64( nAlloc*sizeof(char*) );
20649 shell_check_oom(azData);
20650 azNextLine = sqlite3_malloc64( nColumn*sizeof(char*) );
@@ -20726,11 +21845,10 @@
20726 n = strlenChar(z);
20727 j = i%nColumn;
20728 if( n>p->actualWidth[j] ) p->actualWidth[j] = n;
20729 }
20730 if( seenInterrupt ) goto columnar_end;
20731 if( nColumn==0 ) goto columnar_end;
20732 switch( p->cMode ){
20733 case MODE_Column: {
20734 colSep = " ";
20735 rowSep = "\n";
20736 if( p->showHeader ){
@@ -21609,10 +22727,11 @@
21609 ",imposter INDEX TABLE Create imposter table TABLE on index INDEX",
21610 #endif
21611 ".indexes ?TABLE? Show names of indexes",
21612 " If TABLE is specified, only show indexes for",
21613 " tables matching TABLE using the LIKE operator.",
 
21614 #ifdef SQLITE_ENABLE_IOTRACE
21615 ",iotrace FILE Enable I/O diagnostic logging to FILE",
21616 #endif
21617 ".limit ?LIMIT? ?VAL? Display or change the value of an SQLITE_LIMIT",
21618 ".lint OPTIONS Report potential schema issues.",
@@ -24518,10 +25637,44 @@
24518 rc = sqlite3_recover_finish(p);
24519 return rc;
24520 }
24521 #endif /* SQLITE_SHELL_HAVE_RECOVER */
24522
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24523
24524 /*
24525 * zAutoColumn(zCol, &db, ?) => Maybe init db, add column zCol to it.
24526 * zAutoColumn(0, &db, ?) => (db!=0) Form columns spec for CREATE TABLE,
24527 * close db and set it to 0, and return the columns spec, to later
@@ -26007,10 +27160,25 @@
26007 rc = 1;
26008 }
26009 sqlite3_free(zSql);
26010 }else
26011 #endif /* !defined(SQLITE_OMIT_TEST_CONTROL) */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
26012
26013 #ifdef SQLITE_ENABLE_IOTRACE
26014 if( c=='i' && cli_strncmp(azArg[0], "iotrace", n)==0 ){
26015 SQLITE_API extern void (SQLITE_CDECL *sqlite3IoTrace)(const char*, ...);
26016 if( iotrace && iotrace!=stdout ) fclose(iotrace);
@@ -29587,10 +30755,15 @@
29587 }
29588 }
29589 #ifndef SQLITE_SHELL_FIDDLE
29590 /* In WASM mode we have to leave the db state in place so that
29591 ** client code can "push" SQL into it after this call returns. */
 
 
 
 
 
29592 free(azCmd);
29593 set_table_name(&data, 0);
29594 if( data.db ){
29595 session_close_all(&data, -1);
29596 close_db(data.db);
@@ -29653,11 +30826,11 @@
29653 return pVfs;
29654 }
29655
29656 /* Only for emcc experimentation purposes. */
29657 sqlite3 * fiddle_db_arg(sqlite3 *arg){
29658 printf("fiddle_db_arg(%p)\n", (const void*)arg);
29659 return arg;
29660 }
29661
29662 /*
29663 ** Intended to be called via a SharedWorker() while a separate
@@ -29679,16 +30852,26 @@
29679 : NULL;
29680 }
29681
29682 /*
29683 ** Completely wipes out the contents of the currently-opened database
29684 ** but leaves its storage intact for reuse.
 
29685 */
29686 void fiddle_reset_db(void){
29687 if( globalDb ){
29688 int rc = sqlite3_db_config(globalDb, SQLITE_DBCONFIG_RESET_DATABASE, 1, 0);
29689 if( 0==rc ) rc = sqlite3_exec(globalDb, "VACUUM", 0, 0, 0);
 
 
 
 
 
 
 
 
 
29690 sqlite3_db_config(globalDb, SQLITE_DBCONFIG_RESET_DATABASE, 0, 0);
29691 }
29692 }
29693
29694 /*
29695
--- extsrc/shell.c
+++ extsrc/shell.c
@@ -13806,11 +13806,11 @@
13806 /* Copy the entire schema of database [db] into [dbm]. */
13807 if( rc==SQLITE_OK ){
13808 sqlite3_stmt *pSql = 0;
13809 rc = idxPrintfPrepareStmt(pNew->db, &pSql, pzErrmsg,
13810 "SELECT sql FROM sqlite_schema WHERE name NOT LIKE 'sqlite_%%'"
13811 " AND sql NOT LIKE 'CREATE VIRTUAL %%' ORDER BY rowid"
13812 );
13813 while( rc==SQLITE_OK && SQLITE_ROW==sqlite3_step(pSql) ){
13814 const char *zSql = (const char*)sqlite3_column_text(pSql, 0);
13815 if( zSql ) rc = sqlite3_exec(pNew->dbm, zSql, 0, 0, pzErrmsg);
13816 }
@@ -14007,10 +14007,1128 @@
14007 }
14008
14009 #endif /* ifndef SQLITE_OMIT_VIRTUALTABLE */
14010
14011 /************************* End ../ext/expert/sqlite3expert.c ********************/
14012
14013 /************************* Begin ../ext/intck/sqlite3intck.h ******************/
14014 /*
14015 ** 2024-02-08
14016 **
14017 ** The author disclaims copyright to this source code. In place of
14018 ** a legal notice, here is a blessing:
14019 **
14020 ** May you do good and not evil.
14021 ** May you find forgiveness for yourself and forgive others.
14022 ** May you share freely, never taking more than you give.
14023 **
14024 *************************************************************************
14025 */
14026
14027 /*
14028 ** Incremental Integrity-Check Extension
14029 ** -------------------------------------
14030 **
14031 ** This module contains code to check whether or not an SQLite database
14032 ** is well-formed or corrupt. This is the same task as performed by SQLite's
14033 ** built-in "PRAGMA integrity_check" command. This module differs from
14034 ** "PRAGMA integrity_check" in that:
14035 **
14036 ** + It is less thorough - this module does not detect certain types
14037 ** of corruption that are detected by the PRAGMA command. However,
14038 ** it does detect all kinds of corruption that are likely to cause
14039 ** errors in SQLite applications.
14040 **
14041 ** + It is slower. Sometimes up to three times slower.
14042 **
14043 ** + It allows integrity-check operations to be split into multiple
14044 ** transactions, so that the database does not need to be read-locked
14045 ** for the duration of the integrity-check.
14046 **
14047 ** One way to use the API to run integrity-check on the "main" database
14048 ** of handle db is:
14049 **
14050 ** int rc = SQLITE_OK;
14051 ** sqlite3_intck *p = 0;
14052 **
14053 ** sqlite3_intck_open(db, "main", &p);
14054 ** while( SQLITE_OK==sqlite3_intck_step(p) ){
14055 ** const char *zMsg = sqlite3_intck_message(p);
14056 ** if( zMsg ) printf("corruption: %s\n", zMsg);
14057 ** }
14058 ** rc = sqlite3_intck_error(p, &zErr);
14059 ** if( rc!=SQLITE_OK ){
14060 ** printf("error occured (rc=%d), (errmsg=%s)\n", rc, zErr);
14061 ** }
14062 ** sqlite3_intck_close(p);
14063 **
14064 ** Usually, the sqlite3_intck object opens a read transaction within the
14065 ** first call to sqlite3_intck_step() and holds it open until the
14066 ** integrity-check is complete. However, if sqlite3_intck_unlock() is
14067 ** called, the read transaction is ended and a new read transaction opened
14068 ** by the subsequent call to sqlite3_intck_step().
14069 */
14070
14071 #ifndef _SQLITE_INTCK_H
14072 #define _SQLITE_INTCK_H
14073
14074 /* #include "sqlite3.h" */
14075
14076 #ifdef __cplusplus
14077 extern "C" {
14078 #endif
14079
14080 /*
14081 ** An ongoing incremental integrity-check operation is represented by an
14082 ** opaque pointer of the following type.
14083 */
14084 typedef struct sqlite3_intck sqlite3_intck;
14085
14086 /*
14087 ** Open a new incremental integrity-check object. If successful, populate
14088 ** output variable (*ppOut) with the new object handle and return SQLITE_OK.
14089 ** Or, if an error occurs, set (*ppOut) to NULL and return an SQLite error
14090 ** code (e.g. SQLITE_NOMEM).
14091 **
14092 ** The integrity-check will be conducted on database zDb (which must be "main",
14093 ** "temp", or the name of an attached database) of database handle db. Once
14094 ** this function has been called successfully, the caller should not use
14095 ** database handle db until the integrity-check object has been destroyed
14096 ** using sqlite3_intck_close().
14097 */
14098 int sqlite3_intck_open(
14099 sqlite3 *db, /* Database handle */
14100 const char *zDb, /* Database name ("main", "temp" etc.) */
14101 sqlite3_intck **ppOut /* OUT: New sqlite3_intck handle */
14102 );
14103
14104 /*
14105 ** Close and release all resources associated with a handle opened by an
14106 ** earlier call to sqlite3_intck_open(). The results of using an
14107 ** integrity-check handle after it has been passed to this function are
14108 ** undefined.
14109 */
14110 void sqlite3_intck_close(sqlite3_intck *pCk);
14111
14112 /*
14113 ** Do the next step of the integrity-check operation specified by the handle
14114 ** passed as the only argument. This function returns SQLITE_DONE if the
14115 ** integrity-check operation is finished, or an SQLite error code if
14116 ** an error occurs, or SQLITE_OK if no error occurs but the integrity-check
14117 ** is not finished. It is not considered an error if database corruption
14118 ** is encountered.
14119 **
14120 ** Following a successful call to sqlite3_intck_step() (one that returns
14121 ** SQLITE_OK), sqlite3_intck_message() returns a non-NULL value if
14122 ** corruption was detected in the db.
14123 **
14124 ** If an error occurs and a value other than SQLITE_OK or SQLITE_DONE is
14125 ** returned, then the integrity-check handle is placed in an error state.
14126 ** In this state all subsequent calls to sqlite3_intck_step() or
14127 ** sqlite3_intck_unlock() will immediately return the same error. The
14128 ** sqlite3_intck_error() method may be used to obtain an English language
14129 ** error message in this case.
14130 */
14131 int sqlite3_intck_step(sqlite3_intck *pCk);
14132
14133 /*
14134 ** If the previous call to sqlite3_intck_step() encountered corruption
14135 ** within the database, then this function returns a pointer to a buffer
14136 ** containing a nul-terminated string describing the corruption in
14137 ** English. If the previous call to sqlite3_intck_step() did not encounter
14138 ** corruption, or if there was no previous call, this function returns
14139 ** NULL.
14140 */
14141 const char *sqlite3_intck_message(sqlite3_intck *pCk);
14142
14143 /*
14144 ** Close any read-transaction opened by an earlier call to
14145 ** sqlite3_intck_step(). Any subsequent call to sqlite3_intck_step() will
14146 ** open a new transaction. Return SQLITE_OK if successful, or an SQLite error
14147 ** code otherwise.
14148 **
14149 ** If an error occurs, then the integrity-check handle is placed in an error
14150 ** state. In this state all subsequent calls to sqlite3_intck_step() or
14151 ** sqlite3_intck_unlock() will immediately return the same error. The
14152 ** sqlite3_intck_error() method may be used to obtain an English language
14153 ** error message in this case.
14154 */
14155 int sqlite3_intck_unlock(sqlite3_intck *pCk);
14156
14157 /*
14158 ** If an error has occurred in an earlier call to sqlite3_intck_step()
14159 ** or sqlite3_intck_unlock(), then this method returns the associated
14160 ** SQLite error code. Additionally, if pzErr is not NULL, then (*pzErr)
14161 ** may be set to point to a nul-terminated string containing an English
14162 ** language error message. Or, if no error message is available, to
14163 ** NULL.
14164 **
14165 ** If no error has occurred within sqlite3_intck_step() or
14166 ** sqlite_intck_unlock() calls on the handle passed as the first argument,
14167 ** then SQLITE_OK is returned and (*pzErr) set to NULL.
14168 */
14169 int sqlite3_intck_error(sqlite3_intck *pCk, const char **pzErr);
14170
14171 /*
14172 ** This API is used for testing only. It returns the full-text of an SQL
14173 ** statement used to test object zObj, which may be a table or index.
14174 ** The returned buffer is valid until the next call to either this function
14175 ** or sqlite3_intck_close() on the same sqlite3_intck handle.
14176 */
14177 const char *sqlite3_intck_test_sql(sqlite3_intck *pCk, const char *zObj);
14178
14179
14180 #ifdef __cplusplus
14181 } /* end of the 'extern "C"' block */
14182 #endif
14183
14184 #endif /* ifndef _SQLITE_INTCK_H */
14185
14186 /************************* End ../ext/intck/sqlite3intck.h ********************/
14187 /************************* Begin ../ext/intck/sqlite3intck.c ******************/
14188 /*
14189 ** 2024-02-08
14190 **
14191 ** The author disclaims copyright to this source code. In place of
14192 ** a legal notice, here is a blessing:
14193 **
14194 ** May you do good and not evil.
14195 ** May you find forgiveness for yourself and forgive others.
14196 ** May you share freely, never taking more than you give.
14197 **
14198 *************************************************************************
14199 */
14200
14201 /* #include "sqlite3intck.h" */
14202 #include <string.h>
14203 #include <assert.h>
14204
14205 #include <stdio.h>
14206 #include <stdlib.h>
14207
14208 /*
14209 ** nKeyVal:
14210 ** The number of values that make up the 'key' for the current pCheck
14211 ** statement.
14212 **
14213 ** rc:
14214 ** Error code returned by most recent sqlite3_intck_step() or
14215 ** sqlite3_intck_unlock() call. This is set to SQLITE_DONE when
14216 ** the integrity-check operation is finished.
14217 **
14218 ** zErr:
14219 ** If the object has entered the error state, this is the error message.
14220 ** Is freed using sqlite3_free() when the object is deleted.
14221 **
14222 ** zTestSql:
14223 ** The value returned by the most recent call to sqlite3_intck_testsql().
14224 ** Each call to testsql() frees the previous zTestSql value (using
14225 ** sqlite3_free()) and replaces it with the new value it will return.
14226 */
14227 struct sqlite3_intck {
14228 sqlite3 *db;
14229 const char *zDb; /* Copy of zDb parameter to _open() */
14230 char *zObj; /* Current object. Or NULL. */
14231
14232 sqlite3_stmt *pCheck; /* Current check statement */
14233 char *zKey;
14234 int nKeyVal;
14235
14236 char *zMessage;
14237 int bCorruptSchema;
14238
14239 int rc; /* Error code */
14240 char *zErr; /* Error message */
14241 char *zTestSql; /* Returned by sqlite3_intck_test_sql() */
14242 };
14243
14244
14245 /*
14246 ** Some error has occurred while using database p->db. Save the error message
14247 ** and error code currently held by the database handle in p->rc and p->zErr.
14248 */
14249 static void intckSaveErrmsg(sqlite3_intck *p){
14250 p->rc = sqlite3_errcode(p->db);
14251 sqlite3_free(p->zErr);
14252 p->zErr = sqlite3_mprintf("%s", sqlite3_errmsg(p->db));
14253 }
14254
14255 /*
14256 ** If the handle passed as the first argument is already in the error state,
14257 ** then this function is a no-op (returns NULL immediately). Otherwise, if an
14258 ** error occurs within this function, it leaves an error in said handle.
14259 **
14260 ** Otherwise, this function attempts to prepare SQL statement zSql and
14261 ** return the resulting statement handle to the user.
14262 */
14263 static sqlite3_stmt *intckPrepare(sqlite3_intck *p, const char *zSql){
14264 sqlite3_stmt *pRet = 0;
14265 if( p->rc==SQLITE_OK ){
14266 p->rc = sqlite3_prepare_v2(p->db, zSql, -1, &pRet, 0);
14267 if( p->rc!=SQLITE_OK ){
14268 intckSaveErrmsg(p);
14269 assert( pRet==0 );
14270 }
14271 }
14272 return pRet;
14273 }
14274
14275 /*
14276 ** If the handle passed as the first argument is already in the error state,
14277 ** then this function is a no-op (returns NULL immediately). Otherwise, if an
14278 ** error occurs within this function, it leaves an error in said handle.
14279 **
14280 ** Otherwise, this function treats argument zFmt as a printf() style format
14281 ** string. It formats it according to the trailing arguments and then
14282 ** attempts to prepare the results and return the resulting prepared
14283 ** statement.
14284 */
14285 static sqlite3_stmt *intckPrepareFmt(sqlite3_intck *p, const char *zFmt, ...){
14286 sqlite3_stmt *pRet = 0;
14287 va_list ap;
14288 char *zSql = 0;
14289 va_start(ap, zFmt);
14290 zSql = sqlite3_vmprintf(zFmt, ap);
14291 if( p->rc==SQLITE_OK && zSql==0 ){
14292 p->rc = SQLITE_NOMEM;
14293 }
14294 pRet = intckPrepare(p, zSql);
14295 sqlite3_free(zSql);
14296 va_end(ap);
14297 return pRet;
14298 }
14299
14300 /*
14301 ** Finalize SQL statement pStmt. If an error occurs and the handle passed
14302 ** as the first argument does not already contain an error, store the
14303 ** error in the handle.
14304 */
14305 static void intckFinalize(sqlite3_intck *p, sqlite3_stmt *pStmt){
14306 int rc = sqlite3_finalize(pStmt);
14307 if( p->rc==SQLITE_OK && rc!=SQLITE_OK ){
14308 intckSaveErrmsg(p);
14309 }
14310 }
14311
14312 /*
14313 ** If there is already an error in handle p, return it. Otherwise, call
14314 ** sqlite3_step() on the statement handle and return that value.
14315 */
14316 static int intckStep(sqlite3_intck *p, sqlite3_stmt *pStmt){
14317 if( p->rc ) return p->rc;
14318 return sqlite3_step(pStmt);
14319 }
14320
14321 /*
14322 ** Execute SQL statement zSql. There is no way to obtain any results
14323 ** returned by the statement. This function uses the sqlite3_intck error
14324 ** code convention.
14325 */
14326 static void intckExec(sqlite3_intck *p, const char *zSql){
14327 sqlite3_stmt *pStmt = 0;
14328 pStmt = intckPrepare(p, zSql);
14329 intckStep(p, pStmt);
14330 intckFinalize(p, pStmt);
14331 }
14332
14333 /*
14334 ** A wrapper around sqlite3_mprintf() that uses the sqlite3_intck error
14335 ** code convention.
14336 */
14337 static char *intckMprintf(sqlite3_intck *p, const char *zFmt, ...){
14338 va_list ap;
14339 char *zRet = 0;
14340 va_start(ap, zFmt);
14341 zRet = sqlite3_vmprintf(zFmt, ap);
14342 if( p->rc==SQLITE_OK ){
14343 if( zRet==0 ){
14344 p->rc = SQLITE_NOMEM;
14345 }
14346 }else{
14347 sqlite3_free(zRet);
14348 zRet = 0;
14349 }
14350 return zRet;
14351 }
14352
14353 /*
14354 ** This is used by sqlite3_intck_unlock() to save the vector key value
14355 ** required to restart the current pCheck query as a nul-terminated string
14356 ** in p->zKey.
14357 */
14358 static void intckSaveKey(sqlite3_intck *p){
14359 int ii;
14360 char *zSql = 0;
14361 sqlite3_stmt *pStmt = 0;
14362 sqlite3_stmt *pXinfo = 0;
14363 const char *zDir = 0;
14364
14365 assert( p->pCheck );
14366 assert( p->zKey==0 );
14367
14368 pXinfo = intckPrepareFmt(p,
14369 "SELECT group_concat(desc, '') FROM %Q.sqlite_schema s, "
14370 "pragma_index_xinfo(%Q, %Q) "
14371 "WHERE s.type='index' AND s.name=%Q",
14372 p->zDb, p->zObj, p->zDb, p->zObj
14373 );
14374 if( p->rc==SQLITE_OK && SQLITE_ROW==sqlite3_step(pXinfo) ){
14375 zDir = (const char*)sqlite3_column_text(pXinfo, 0);
14376 }
14377
14378 if( zDir==0 ){
14379 /* Object is a table, not an index. This is the easy case,as there are
14380 ** no DESC columns or NULL values in a primary key. */
14381 const char *zSep = "SELECT '(' || ";
14382 for(ii=0; ii<p->nKeyVal; ii++){
14383 zSql = intckMprintf(p, "%z%squote(?)", zSql, zSep);
14384 zSep = " || ', ' || ";
14385 }
14386 zSql = intckMprintf(p, "%z || ')'", zSql);
14387 }else{
14388
14389 /* Object is an index. */
14390 assert( p->nKeyVal>1 );
14391 for(ii=p->nKeyVal; ii>0; ii--){
14392 int bLastIsDesc = zDir[ii-1]=='1';
14393 int bLastIsNull = sqlite3_column_type(p->pCheck, ii)==SQLITE_NULL;
14394 const char *zLast = sqlite3_column_name(p->pCheck, ii);
14395 char *zLhs = 0;
14396 char *zRhs = 0;
14397 char *zWhere = 0;
14398
14399 if( bLastIsNull ){
14400 if( bLastIsDesc ) continue;
14401 zWhere = intckMprintf(p, "'%s IS NOT NULL'", zLast);
14402 }else{
14403 const char *zOp = bLastIsDesc ? "<" : ">";
14404 zWhere = intckMprintf(p, "'%s %s ' || quote(?%d)", zLast, zOp, ii);
14405 }
14406
14407 if( ii>1 ){
14408 const char *zLhsSep = "";
14409 const char *zRhsSep = "";
14410 int jj;
14411 for(jj=0; jj<ii-1; jj++){
14412 const char *zAlias = (const char*)sqlite3_column_name(p->pCheck,jj+1);
14413 zLhs = intckMprintf(p, "%z%s%s", zLhs, zLhsSep, zAlias);
14414 zRhs = intckMprintf(p, "%z%squote(?%d)", zRhs, zRhsSep, jj+1);
14415 zLhsSep = ",";
14416 zRhsSep = " || ',' || ";
14417 }
14418
14419 zWhere = intckMprintf(p,
14420 "'(%z) IS (' || %z || ') AND ' || %z",
14421 zLhs, zRhs, zWhere);
14422 }
14423 zWhere = intckMprintf(p, "'WHERE ' || %z", zWhere);
14424
14425 zSql = intckMprintf(p, "%z%s(quote( %z ) )",
14426 zSql,
14427 (zSql==0 ? "VALUES" : ",\n "),
14428 zWhere
14429 );
14430 }
14431 zSql = intckMprintf(p,
14432 "WITH wc(q) AS (\n%z\n)"
14433 "SELECT 'VALUES' || group_concat('(' || q || ')', ',\n ') FROM wc"
14434 , zSql
14435 );
14436 }
14437
14438 pStmt = intckPrepare(p, zSql);
14439 if( p->rc==SQLITE_OK ){
14440 for(ii=0; ii<p->nKeyVal; ii++){
14441 sqlite3_bind_value(pStmt, ii+1, sqlite3_column_value(p->pCheck, ii+1));
14442 }
14443 if( SQLITE_ROW==sqlite3_step(pStmt) ){
14444 p->zKey = intckMprintf(p,"%s",(const char*)sqlite3_column_text(pStmt, 0));
14445 }
14446 intckFinalize(p, pStmt);
14447 }
14448
14449 sqlite3_free(zSql);
14450 intckFinalize(p, pXinfo);
14451 }
14452
14453 /*
14454 ** Find the next database object (table or index) to check. If successful,
14455 ** set sqlite3_intck.zObj to point to a nul-terminated buffer containing
14456 ** the object's name before returning.
14457 */
14458 static void intckFindObject(sqlite3_intck *p){
14459 sqlite3_stmt *pStmt = 0;
14460 char *zPrev = p->zObj;
14461 p->zObj = 0;
14462
14463 assert( p->rc==SQLITE_OK );
14464 assert( p->pCheck==0 );
14465
14466 pStmt = intckPrepareFmt(p,
14467 "WITH tables(table_name) AS ("
14468 " SELECT name"
14469 " FROM %Q.sqlite_schema WHERE (type='table' OR type='index') AND rootpage"
14470 " UNION ALL "
14471 " SELECT 'sqlite_schema'"
14472 ")"
14473 "SELECT table_name FROM tables "
14474 "WHERE ?1 IS NULL OR table_name%s?1 "
14475 "ORDER BY 1"
14476 , p->zDb, (p->zKey ? ">=" : ">")
14477 );
14478
14479 if( p->rc==SQLITE_OK ){
14480 sqlite3_bind_text(pStmt, 1, zPrev, -1, SQLITE_TRANSIENT);
14481 if( sqlite3_step(pStmt)==SQLITE_ROW ){
14482 p->zObj = intckMprintf(p,"%s",(const char*)sqlite3_column_text(pStmt, 0));
14483 }
14484 }
14485 intckFinalize(p, pStmt);
14486
14487 /* If this is a new object, ensure the previous key value is cleared. */
14488 if( sqlite3_stricmp(p->zObj, zPrev) ){
14489 sqlite3_free(p->zKey);
14490 p->zKey = 0;
14491 }
14492
14493 sqlite3_free(zPrev);
14494 }
14495
14496 /*
14497 ** Return the size in bytes of the first token in nul-terminated buffer z.
14498 ** For the purposes of this call, a token is either:
14499 **
14500 ** * a quoted SQL string,
14501 * * a contiguous series of ascii alphabet characters, or
14502 * * any other single byte.
14503 */
14504 static int intckGetToken(const char *z){
14505 char c = z[0];
14506 int iRet = 1;
14507 if( c=='\'' || c=='"' || c=='`' ){
14508 while( 1 ){
14509 if( z[iRet]==c ){
14510 iRet++;
14511 if( z[iRet]!=c ) break;
14512 }
14513 iRet++;
14514 }
14515 }
14516 else if( c=='[' ){
14517 while( z[iRet++]!=']' && z[iRet] );
14518 }
14519 else if( (c>='A' && c<='Z') || (c>='a' && c<='z') ){
14520 while( (z[iRet]>='A' && z[iRet]<='Z') || (z[iRet]>='a' && z[iRet]<='z') ){
14521 iRet++;
14522 }
14523 }
14524
14525 return iRet;
14526 }
14527
14528 /*
14529 ** Return true if argument c is an ascii whitespace character.
14530 */
14531 static int intckIsSpace(char c){
14532 return (c==' ' || c=='\t' || c=='\n' || c=='\r');
14533 }
14534
14535 /*
14536 ** Argument z points to the text of a CREATE INDEX statement. This function
14537 ** identifies the part of the text that contains either the index WHERE
14538 ** clause (if iCol<0) or the iCol'th column of the index.
14539 **
14540 ** If (iCol<0), the identified fragment does not include the "WHERE" keyword,
14541 ** only the expression that follows it. If (iCol>=0) then the identified
14542 ** fragment does not include any trailing sort-order keywords - "ASC" or
14543 ** "DESC".
14544 **
14545 ** If the CREATE INDEX statement does not contain the requested field or
14546 ** clause, NULL is returned and (*pnByte) is set to 0. Otherwise, a pointer to
14547 ** the identified fragment is returned and output parameter (*pnByte) set
14548 ** to its size in bytes.
14549 */
14550 static const char *intckParseCreateIndex(const char *z, int iCol, int *pnByte){
14551 int iOff = 0;
14552 int iThisCol = 0;
14553 int iStart = 0;
14554 int nOpen = 0;
14555
14556 const char *zRet = 0;
14557 int nRet = 0;
14558
14559 int iEndOfCol = 0;
14560
14561 /* Skip forward until the first "(" token */
14562 while( z[iOff]!='(' ){
14563 iOff += intckGetToken(&z[iOff]);
14564 if( z[iOff]=='\0' ) return 0;
14565 }
14566 assert( z[iOff]=='(' );
14567
14568 nOpen = 1;
14569 iOff++;
14570 iStart = iOff;
14571 while( z[iOff] ){
14572 const char *zToken = &z[iOff];
14573 int nToken = 0;
14574
14575 /* Check if this is the end of the current column - either a "," or ")"
14576 ** when nOpen==1. */
14577 if( nOpen==1 ){
14578 if( z[iOff]==',' || z[iOff]==')' ){
14579 if( iCol==iThisCol ){
14580 int iEnd = iEndOfCol ? iEndOfCol : iOff;
14581 nRet = (iEnd - iStart);
14582 zRet = &z[iStart];
14583 break;
14584 }
14585 iStart = iOff+1;
14586 while( intckIsSpace(z[iStart]) ) iStart++;
14587 iThisCol++;
14588 }
14589 if( z[iOff]==')' ) break;
14590 }
14591 if( z[iOff]=='(' ) nOpen++;
14592 if( z[iOff]==')' ) nOpen--;
14593 nToken = intckGetToken(zToken);
14594
14595 if( (nToken==3 && 0==sqlite3_strnicmp(zToken, "ASC", nToken))
14596 || (nToken==4 && 0==sqlite3_strnicmp(zToken, "DESC", nToken))
14597 ){
14598 iEndOfCol = iOff;
14599 }else if( 0==intckIsSpace(zToken[0]) ){
14600 iEndOfCol = 0;
14601 }
14602
14603 iOff += nToken;
14604 }
14605
14606 /* iStart is now the byte offset of 1 byte passed the final ')' in the
14607 ** CREATE INDEX statement. Try to find a WHERE clause to return. */
14608 while( zRet==0 && z[iOff] ){
14609 int n = intckGetToken(&z[iOff]);
14610 if( n==5 && 0==sqlite3_strnicmp(&z[iOff], "where", 5) ){
14611 zRet = &z[iOff+5];
14612 nRet = (int)strlen(zRet);
14613 }
14614 iOff += n;
14615 }
14616
14617 /* Trim any whitespace from the start and end of the returned string. */
14618 if( zRet ){
14619 while( intckIsSpace(zRet[0]) ){
14620 nRet--;
14621 zRet++;
14622 }
14623 while( nRet>0 && intckIsSpace(zRet[nRet-1]) ) nRet--;
14624 }
14625
14626 *pnByte = nRet;
14627 return zRet;
14628 }
14629
14630 /*
14631 ** User-defined SQL function wrapper for intckParseCreateIndex():
14632 **
14633 ** SELECT parse_create_index(<sql>, <icol>);
14634 */
14635 static void intckParseCreateIndexFunc(
14636 sqlite3_context *pCtx,
14637 int nVal,
14638 sqlite3_value **apVal
14639 ){
14640 const char *zSql = (const char*)sqlite3_value_text(apVal[0]);
14641 int idx = sqlite3_value_int(apVal[1]);
14642 const char *zRes = 0;
14643 int nRes = 0;
14644
14645 assert( nVal==2 );
14646 if( zSql ){
14647 zRes = intckParseCreateIndex(zSql, idx, &nRes);
14648 }
14649 sqlite3_result_text(pCtx, zRes, nRes, SQLITE_TRANSIENT);
14650 }
14651
14652 /*
14653 ** Return true if sqlite3_intck.db has automatic indexes enabled, false
14654 ** otherwise.
14655 */
14656 static int intckGetAutoIndex(sqlite3_intck *p){
14657 int bRet = 0;
14658 sqlite3_stmt *pStmt = 0;
14659 pStmt = intckPrepare(p, "PRAGMA automatic_index");
14660 if( SQLITE_ROW==intckStep(p, pStmt) ){
14661 bRet = sqlite3_column_int(pStmt, 0);
14662 }
14663 intckFinalize(p, pStmt);
14664 return bRet;
14665 }
14666
14667 /*
14668 ** Return true if zObj is an index, or false otherwise.
14669 */
14670 static int intckIsIndex(sqlite3_intck *p, const char *zObj){
14671 int bRet = 0;
14672 sqlite3_stmt *pStmt = 0;
14673 pStmt = intckPrepareFmt(p,
14674 "SELECT 1 FROM %Q.sqlite_schema WHERE name=%Q AND type='index'",
14675 p->zDb, zObj
14676 );
14677 if( p->rc==SQLITE_OK && SQLITE_ROW==sqlite3_step(pStmt) ){
14678 bRet = 1;
14679 }
14680 intckFinalize(p, pStmt);
14681 return bRet;
14682 }
14683
14684 /*
14685 ** Return a pointer to a nul-terminated buffer containing the SQL statement
14686 ** used to check database object zObj (a table or index) for corruption.
14687 ** If parameter zPrev is not NULL, then it must be a string containing the
14688 ** vector key required to restart the check where it left off last time.
14689 ** If pnKeyVal is not NULL, then (*pnKeyVal) is set to the number of
14690 ** columns in the vector key value for the specified object.
14691 **
14692 ** This function uses the sqlite3_intck error code convention.
14693 */
14694 static char *intckCheckObjectSql(
14695 sqlite3_intck *p, /* Integrity check object */
14696 const char *zObj, /* Object (table or index) to scan */
14697 const char *zPrev, /* Restart key vector, if any */
14698 int *pnKeyVal /* OUT: Number of key-values for this scan */
14699 ){
14700 char *zRet = 0;
14701 sqlite3_stmt *pStmt = 0;
14702 int bAutoIndex = 0;
14703 int bIsIndex = 0;
14704
14705 const char *zCommon =
14706 /* Relation without_rowid also contains just one row. Column "b" is
14707 ** set to true if the table being examined is a WITHOUT ROWID table,
14708 ** or false otherwise. */
14709 ", without_rowid(b) AS ("
14710 " SELECT EXISTS ("
14711 " SELECT 1 FROM tabname, pragma_index_list(tab, db) AS l"
14712 " WHERE origin='pk' "
14713 " AND NOT EXISTS (SELECT 1 FROM sqlite_schema WHERE name=l.name)"
14714 " )"
14715 ")"
14716 ""
14717 /* Table idx_cols contains 1 row for each column in each index on the
14718 ** table being checked. Columns are:
14719 **
14720 ** idx_name: Name of the index.
14721 ** idx_ispk: True if this index is the PK of a WITHOUT ROWID table.
14722 ** col_name: Name of indexed column, or NULL for index on expression.
14723 ** col_expr: Indexed expression, including COLLATE clause.
14724 ** col_alias: Alias used for column in 'intck_wrapper' table.
14725 */
14726 ", idx_cols(idx_name, idx_ispk, col_name, col_expr, col_alias) AS ("
14727 " SELECT l.name, (l.origin=='pk' AND w.b), i.name, COALESCE(("
14728 " SELECT parse_create_index(sql, i.seqno) FROM "
14729 " sqlite_schema WHERE name = l.name"
14730 " ), format('\"%w\"', i.name) || ' COLLATE ' || quote(i.coll)),"
14731 " 'c' || row_number() OVER ()"
14732 " FROM "
14733 " tabname t,"
14734 " without_rowid w,"
14735 " pragma_index_list(t.tab, t.db) l,"
14736 " pragma_index_xinfo(l.name) i"
14737 " WHERE i.key"
14738 " UNION ALL"
14739 " SELECT '', 1, '_rowid_', '_rowid_', 'r1' FROM without_rowid WHERE b=0"
14740 ")"
14741 ""
14742 ""
14743 /*
14744 ** For a PK declared as "PRIMARY KEY(a, b) ... WITHOUT ROWID", where
14745 ** the intck_wrapper aliases of "a" and "b" are "c1" and "c2":
14746 **
14747 ** o_pk: "o.c1, o.c2"
14748 ** i_pk: "i.'a', i.'b'"
14749 ** ...
14750 ** n_pk: 2
14751 */
14752 ", tabpk(db, tab, idx, o_pk, i_pk, q_pk, eq_pk, ps_pk, pk_pk, n_pk) AS ("
14753 " WITH pkfields(f, a) AS ("
14754 " SELECT i.col_name, i.col_alias FROM idx_cols i WHERE i.idx_ispk"
14755 " )"
14756 " SELECT t.db, t.tab, t.idx, "
14757 " group_concat(a, ', '), "
14758 " group_concat('i.'||quote(f), ', '), "
14759 " group_concat('quote(o.'||a||')', ' || '','' || '), "
14760 " format('(%s)==(%s)',"
14761 " group_concat('o.'||a, ', '), "
14762 " group_concat(format('\"%w\"', f), ', ')"
14763 " ),"
14764 " group_concat('%s', ','),"
14765 " group_concat('quote('||a||')', ', '), "
14766 " count(*)"
14767 " FROM tabname t, pkfields"
14768 ")"
14769 ""
14770 ", idx(name, match_expr, partial, partial_alias, idx_ps, idx_idx) AS ("
14771 " SELECT idx_name,"
14772 " format('(%s,%s) IS (%s,%s)', "
14773 " group_concat(i.col_expr, ', '), i_pk,"
14774 " group_concat('o.'||i.col_alias, ', '), o_pk"
14775 " ), "
14776 " parse_create_index("
14777 " (SELECT sql FROM sqlite_schema WHERE name=idx_name), -1"
14778 " ),"
14779 " 'cond' || row_number() OVER ()"
14780 " , group_concat('%s', ',')"
14781 " , group_concat('quote('||i.col_alias||')', ', ')"
14782 " FROM tabpk t, "
14783 " without_rowid w,"
14784 " idx_cols i"
14785 " WHERE i.idx_ispk==0 "
14786 " GROUP BY idx_name"
14787 ")"
14788 ""
14789 ", wrapper_with(s) AS ("
14790 " SELECT 'intck_wrapper AS (\n SELECT\n ' || ("
14791 " WITH f(a, b) AS ("
14792 " SELECT col_expr, col_alias FROM idx_cols"
14793 " UNION ALL "
14794 " SELECT partial, partial_alias FROM idx WHERE partial IS NOT NULL"
14795 " )"
14796 " SELECT group_concat(format('%s AS %s', a, b), ',\n ') FROM f"
14797 " )"
14798 " || format('\n FROM %Q.%Q ', t.db, t.tab)"
14799 /* If the object being checked is a table, append "NOT INDEXED".
14800 ** Otherwise, append "INDEXED BY <index>", and then, if the index
14801 ** is a partial index " WHERE <condition>". */
14802 " || CASE WHEN t.idx IS NULL THEN "
14803 " 'NOT INDEXED'"
14804 " ELSE"
14805 " format('INDEXED BY %Q%s', t.idx, ' WHERE '||i.partial)"
14806 " END"
14807 " || '\n)'"
14808 " FROM tabname t LEFT JOIN idx i ON (i.name=t.idx)"
14809 ")"
14810 ""
14811 ;
14812
14813 bAutoIndex = intckGetAutoIndex(p);
14814 if( bAutoIndex ) intckExec(p, "PRAGMA automatic_index = 0");
14815
14816 bIsIndex = intckIsIndex(p, zObj);
14817 if( bIsIndex ){
14818 pStmt = intckPrepareFmt(p,
14819 /* Table idxname contains a single row. The first column, "db", contains
14820 ** the name of the db containing the table (e.g. "main") and the second,
14821 ** "tab", the name of the table itself. */
14822 "WITH tabname(db, tab, idx) AS ("
14823 " SELECT %Q, (SELECT tbl_name FROM %Q.sqlite_schema WHERE name=%Q), %Q "
14824 ")"
14825 ""
14826 ", whereclause(w_c) AS (%s)"
14827 ""
14828 "%s" /* zCommon */
14829 ""
14830 ", case_statement(c) AS ("
14831 " SELECT "
14832 " 'CASE WHEN (' || group_concat(col_alias, ', ') || ', 1) IS (\n' "
14833 " || ' SELECT ' || group_concat(col_expr, ', ') || ', 1 FROM '"
14834 " || format('%%Q.%%Q NOT INDEXED WHERE %%s\n', t.db, t.tab, p.eq_pk)"
14835 " || ' )\n THEN NULL\n '"
14836 " || 'ELSE format(''surplus entry ('"
14837 " || group_concat('%%s', ',') || ',' || p.ps_pk"
14838 " || ') in index ' || t.idx || ''', ' "
14839 " || group_concat('quote('||i.col_alias||')', ', ') || ', ' || p.pk_pk"
14840 " || ')'"
14841 " || '\n END AS error_message'"
14842 " FROM tabname t, tabpk p, idx_cols i WHERE i.idx_name=t.idx"
14843 ")"
14844 ""
14845 ", thiskey(k, n) AS ("
14846 " SELECT group_concat(i.col_alias, ', ') || ', ' || p.o_pk, "
14847 " count(*) + p.n_pk "
14848 " FROM tabpk p, idx_cols i WHERE i.idx_name=p.idx"
14849 ")"
14850 ""
14851 ", main_select(m, n) AS ("
14852 " SELECT format("
14853 " 'WITH %%s\n' ||"
14854 " ', idx_checker AS (\n' ||"
14855 " ' SELECT %%s,\n' ||"
14856 " ' %%s\n' || "
14857 " ' FROM intck_wrapper AS o\n' ||"
14858 " ')\n',"
14859 " ww.s, c, t.k"
14860 " ), t.n"
14861 " FROM case_statement, wrapper_with ww, thiskey t"
14862 ")"
14863
14864 "SELECT m || "
14865 " group_concat('SELECT * FROM idx_checker ' || w_c, ' UNION ALL '), n"
14866 " FROM "
14867 "main_select, whereclause "
14868 , p->zDb, p->zDb, zObj, zObj
14869 , zPrev ? zPrev : "VALUES('')", zCommon
14870 );
14871 }else{
14872 pStmt = intckPrepareFmt(p,
14873 /* Table tabname contains a single row. The first column, "db", contains
14874 ** the name of the db containing the table (e.g. "main") and the second,
14875 ** "tab", the name of the table itself. */
14876 "WITH tabname(db, tab, idx, prev) AS (SELECT %Q, %Q, NULL, %Q)"
14877 ""
14878 "%s" /* zCommon */
14879
14880 /* expr(e) contains one row for each index on table zObj. Value e
14881 ** is set to an expression that evaluates to NULL if the required
14882 ** entry is present in the index, or an error message otherwise. */
14883 ", expr(e, p) AS ("
14884 " SELECT format('CASE WHEN EXISTS \n"
14885 " (SELECT 1 FROM %%Q.%%Q AS i INDEXED BY %%Q WHERE %%s%%s)\n"
14886 " THEN NULL\n"
14887 " ELSE format(''entry (%%s,%%s) missing from index %%s'', %%s, %%s)\n"
14888 " END\n'"
14889 " , t.db, t.tab, i.name, i.match_expr, ' AND (' || partial || ')',"
14890 " i.idx_ps, t.ps_pk, i.name, i.idx_idx, t.pk_pk),"
14891 " CASE WHEN partial IS NULL THEN NULL ELSE i.partial_alias END"
14892 " FROM tabpk t, idx i"
14893 ")"
14894
14895 ", numbered(ii, cond, e) AS ("
14896 " SELECT 0, 'n.ii=0', 'NULL'"
14897 " UNION ALL "
14898 " SELECT row_number() OVER (),"
14899 " '(n.ii='||row_number() OVER ()||COALESCE(' AND '||p||')', ')'), e"
14900 " FROM expr"
14901 ")"
14902
14903 ", counter_with(w) AS ("
14904 " SELECT 'WITH intck_counter(ii) AS (\n ' || "
14905 " group_concat('SELECT '||ii, ' UNION ALL\n ') "
14906 " || '\n)' FROM numbered"
14907 ")"
14908 ""
14909 ", case_statement(c) AS ("
14910 " SELECT 'CASE ' || "
14911 " group_concat(format('\n WHEN %%s THEN (%%s)', cond, e), '') ||"
14912 " '\nEND AS error_message'"
14913 " FROM numbered"
14914 ")"
14915 ""
14916
14917 /* This table contains a single row consisting of a single value -
14918 ** the text of an SQL expression that may be used by the main SQL
14919 ** statement to output an SQL literal that can be used to resume
14920 ** the scan if it is suspended. e.g. for a rowid table, an expression
14921 ** like:
14922 **
14923 ** format('(%d,%d)', _rowid_, n.ii)
14924 */
14925 ", thiskey(k, n) AS ("
14926 " SELECT o_pk || ', ii', n_pk+1 FROM tabpk"
14927 ")"
14928 ""
14929 ", whereclause(w_c) AS ("
14930 " SELECT CASE WHEN prev!='' THEN "
14931 " '\nWHERE (' || o_pk ||', n.ii) > ' || prev"
14932 " ELSE ''"
14933 " END"
14934 " FROM tabpk, tabname"
14935 ")"
14936 ""
14937 ", main_select(m, n) AS ("
14938 " SELECT format("
14939 " '%%s, %%s\nSELECT %%s,\n%%s\nFROM intck_wrapper AS o"
14940 ", intck_counter AS n%%s\nORDER BY %%s', "
14941 " w, ww.s, c, thiskey.k, whereclause.w_c, t.o_pk"
14942 " ), thiskey.n"
14943 " FROM case_statement, tabpk t, counter_with, "
14944 " wrapper_with ww, thiskey, whereclause"
14945 ")"
14946
14947 "SELECT m, n FROM main_select",
14948 p->zDb, zObj, zPrev, zCommon
14949 );
14950 }
14951
14952 while( p->rc==SQLITE_OK && SQLITE_ROW==sqlite3_step(pStmt) ){
14953 zRet = intckMprintf(p, "%s", (const char*)sqlite3_column_text(pStmt, 0));
14954 if( pnKeyVal ){
14955 *pnKeyVal = sqlite3_column_int(pStmt, 1);
14956 }
14957 }
14958 intckFinalize(p, pStmt);
14959
14960 if( bAutoIndex ) intckExec(p, "PRAGMA automatic_index = 1");
14961 return zRet;
14962 }
14963
14964 /*
14965 ** Open a new integrity-check object.
14966 */
14967 int sqlite3_intck_open(
14968 sqlite3 *db, /* Database handle to operate on */
14969 const char *zDbArg, /* "main", "temp" etc. */
14970 sqlite3_intck **ppOut /* OUT: New integrity-check handle */
14971 ){
14972 sqlite3_intck *pNew = 0;
14973 int rc = SQLITE_OK;
14974 const char *zDb = zDbArg ? zDbArg : "main";
14975 int nDb = (int)strlen(zDb);
14976
14977 pNew = (sqlite3_intck*)sqlite3_malloc(sizeof(*pNew) + nDb + 1);
14978 if( pNew==0 ){
14979 rc = SQLITE_NOMEM;
14980 }else{
14981 memset(pNew, 0, sizeof(*pNew));
14982 pNew->db = db;
14983 pNew->zDb = (const char*)&pNew[1];
14984 memcpy(&pNew[1], zDb, nDb+1);
14985 rc = sqlite3_create_function(db, "parse_create_index",
14986 2, SQLITE_UTF8, 0, intckParseCreateIndexFunc, 0, 0
14987 );
14988 if( rc!=SQLITE_OK ){
14989 sqlite3_intck_close(pNew);
14990 pNew = 0;
14991 }
14992 }
14993
14994 *ppOut = pNew;
14995 return rc;
14996 }
14997
14998 /*
14999 ** Free the integrity-check object.
15000 */
15001 void sqlite3_intck_close(sqlite3_intck *p){
15002 if( p ){
15003 sqlite3_finalize(p->pCheck);
15004 sqlite3_create_function(
15005 p->db, "parse_create_index", 1, SQLITE_UTF8, 0, 0, 0, 0
15006 );
15007 sqlite3_free(p->zObj);
15008 sqlite3_free(p->zKey);
15009 sqlite3_free(p->zTestSql);
15010 sqlite3_free(p->zErr);
15011 sqlite3_free(p->zMessage);
15012 sqlite3_free(p);
15013 }
15014 }
15015
15016 /*
15017 ** Step the integrity-check object.
15018 */
15019 int sqlite3_intck_step(sqlite3_intck *p){
15020 if( p->rc==SQLITE_OK ){
15021
15022 if( p->zMessage ){
15023 sqlite3_free(p->zMessage);
15024 p->zMessage = 0;
15025 }
15026
15027 if( p->bCorruptSchema ){
15028 p->rc = SQLITE_DONE;
15029 }else
15030 if( p->pCheck==0 ){
15031 intckFindObject(p);
15032 if( p->rc==SQLITE_OK ){
15033 if( p->zObj ){
15034 char *zSql = 0;
15035 zSql = intckCheckObjectSql(p, p->zObj, p->zKey, &p->nKeyVal);
15036 p->pCheck = intckPrepare(p, zSql);
15037 sqlite3_free(zSql);
15038 sqlite3_free(p->zKey);
15039 p->zKey = 0;
15040 }else{
15041 p->rc = SQLITE_DONE;
15042 }
15043 }else if( p->rc==SQLITE_CORRUPT ){
15044 p->rc = SQLITE_OK;
15045 p->zMessage = intckMprintf(p, "%s",
15046 "corruption found while reading database schema"
15047 );
15048 p->bCorruptSchema = 1;
15049 }
15050 }
15051
15052 if( p->pCheck ){
15053 assert( p->rc==SQLITE_OK );
15054 if( sqlite3_step(p->pCheck)==SQLITE_ROW ){
15055 /* Normal case, do nothing. */
15056 }else{
15057 intckFinalize(p, p->pCheck);
15058 p->pCheck = 0;
15059 p->nKeyVal = 0;
15060 if( p->rc==SQLITE_CORRUPT ){
15061 p->rc = SQLITE_OK;
15062 p->zMessage = intckMprintf(p,
15063 "corruption found while scanning database object %s", p->zObj
15064 );
15065 }
15066 }
15067 }
15068 }
15069
15070 return p->rc;
15071 }
15072
15073 /*
15074 ** Return a message describing the corruption encountered by the most recent
15075 ** call to sqlite3_intck_step(), or NULL if no corruption was encountered.
15076 */
15077 const char *sqlite3_intck_message(sqlite3_intck *p){
15078 assert( p->pCheck==0 || p->zMessage==0 );
15079 if( p->zMessage ){
15080 return p->zMessage;
15081 }
15082 if( p->pCheck ){
15083 return (const char*)sqlite3_column_text(p->pCheck, 0);
15084 }
15085 return 0;
15086 }
15087
15088 /*
15089 ** Return the error code and message.
15090 */
15091 int sqlite3_intck_error(sqlite3_intck *p, const char **pzErr){
15092 if( pzErr ) *pzErr = p->zErr;
15093 return (p->rc==SQLITE_DONE ? SQLITE_OK : p->rc);
15094 }
15095
15096 /*
15097 ** Close any read transaction the integrity-check object is holding open
15098 ** on the database.
15099 */
15100 int sqlite3_intck_unlock(sqlite3_intck *p){
15101 if( p->rc==SQLITE_OK && p->pCheck ){
15102 assert( p->zKey==0 && p->nKeyVal>0 );
15103 intckSaveKey(p);
15104 intckFinalize(p, p->pCheck);
15105 p->pCheck = 0;
15106 }
15107 return p->rc;
15108 }
15109
15110 /*
15111 ** Return the SQL statement used to check object zObj. Or, if zObj is
15112 ** NULL, the current SQL statement.
15113 */
15114 const char *sqlite3_intck_test_sql(sqlite3_intck *p, const char *zObj){
15115 sqlite3_free(p->zTestSql);
15116 if( zObj ){
15117 p->zTestSql = intckCheckObjectSql(p, zObj, 0, 0);
15118 }else{
15119 if( p->zObj ){
15120 p->zTestSql = intckCheckObjectSql(p, p->zObj, p->zKey, 0);
15121 }else{
15122 sqlite3_free(p->zTestSql);
15123 p->zTestSql = 0;
15124 }
15125 }
15126 return p->zTestSql;
15127 }
15128
15129 /************************* End ../ext/intck/sqlite3intck.c ********************/
15130
15131 #if !defined(SQLITE_OMIT_VIRTUALTABLE) && defined(SQLITE_ENABLE_DBPAGE_VTAB)
15132 #define SQLITE_SHELL_HAVE_RECOVER 1
15133 #else
15134 #define SQLITE_SHELL_HAVE_RECOVER 0
@@ -20641,10 +21759,11 @@
21759 const char *zShowNull = p->nullValue;
21760
21761 rc = sqlite3_step(pStmt);
21762 if( rc!=SQLITE_ROW ) return;
21763 nColumn = sqlite3_column_count(pStmt);
21764 if( nColumn==0 ) goto columnar_end;
21765 nAlloc = nColumn*4;
21766 if( nAlloc<=0 ) nAlloc = 1;
21767 azData = sqlite3_malloc64( nAlloc*sizeof(char*) );
21768 shell_check_oom(azData);
21769 azNextLine = sqlite3_malloc64( nColumn*sizeof(char*) );
@@ -20726,11 +21845,10 @@
21845 n = strlenChar(z);
21846 j = i%nColumn;
21847 if( n>p->actualWidth[j] ) p->actualWidth[j] = n;
21848 }
21849 if( seenInterrupt ) goto columnar_end;
 
21850 switch( p->cMode ){
21851 case MODE_Column: {
21852 colSep = " ";
21853 rowSep = "\n";
21854 if( p->showHeader ){
@@ -21609,10 +22727,11 @@
22727 ",imposter INDEX TABLE Create imposter table TABLE on index INDEX",
22728 #endif
22729 ".indexes ?TABLE? Show names of indexes",
22730 " If TABLE is specified, only show indexes for",
22731 " tables matching TABLE using the LIKE operator.",
22732 ".intck ?STEPS_PER_UNLOCK? Run an incremental integrity check on the db",
22733 #ifdef SQLITE_ENABLE_IOTRACE
22734 ",iotrace FILE Enable I/O diagnostic logging to FILE",
22735 #endif
22736 ".limit ?LIMIT? ?VAL? Display or change the value of an SQLITE_LIMIT",
22737 ".lint OPTIONS Report potential schema issues.",
@@ -24518,10 +25637,44 @@
25637 rc = sqlite3_recover_finish(p);
25638 return rc;
25639 }
25640 #endif /* SQLITE_SHELL_HAVE_RECOVER */
25641
25642 /*
25643 ** Implementation of ".intck STEPS_PER_UNLOCK" command.
25644 */
25645 static int intckDatabaseCmd(ShellState *pState, i64 nStepPerUnlock){
25646 sqlite3_intck *p = 0;
25647 int rc = SQLITE_OK;
25648
25649 rc = sqlite3_intck_open(pState->db, "main", &p);
25650 if( rc==SQLITE_OK ){
25651 i64 nStep = 0;
25652 i64 nError = 0;
25653 const char *zErr = 0;
25654 while( SQLITE_OK==sqlite3_intck_step(p) ){
25655 const char *zMsg = sqlite3_intck_message(p);
25656 if( zMsg ){
25657 oputf("%s\n", zMsg);
25658 nError++;
25659 }
25660 nStep++;
25661 if( nStepPerUnlock && (nStep % nStepPerUnlock)==0 ){
25662 sqlite3_intck_unlock(p);
25663 }
25664 }
25665 rc = sqlite3_intck_error(p, &zErr);
25666 if( zErr ){
25667 eputf("%s\n", zErr);
25668 }
25669 sqlite3_intck_close(p);
25670
25671 oputf("%lld steps, %lld errors\n", nStep, nError);
25672 }
25673
25674 return rc;
25675 }
25676
25677 /*
25678 * zAutoColumn(zCol, &db, ?) => Maybe init db, add column zCol to it.
25679 * zAutoColumn(0, &db, ?) => (db!=0) Form columns spec for CREATE TABLE,
25680 * close db and set it to 0, and return the columns spec, to later
@@ -26007,10 +27160,25 @@
27160 rc = 1;
27161 }
27162 sqlite3_free(zSql);
27163 }else
27164 #endif /* !defined(SQLITE_OMIT_TEST_CONTROL) */
27165
27166 if( c=='i' && cli_strncmp(azArg[0], "intck", n)==0 ){
27167 i64 iArg = 0;
27168 if( nArg==2 ){
27169 iArg = integerValue(azArg[1]);
27170 if( iArg==0 ) iArg = -1;
27171 }
27172 if( (nArg!=1 && nArg!=2) || iArg<0 ){
27173 eputf("%s","Usage: .intck STEPS_PER_UNLOCK\n");
27174 rc = 1;
27175 goto meta_command_exit;
27176 }
27177 open_db(p, 0);
27178 rc = intckDatabaseCmd(p, iArg);
27179 }else
27180
27181 #ifdef SQLITE_ENABLE_IOTRACE
27182 if( c=='i' && cli_strncmp(azArg[0], "iotrace", n)==0 ){
27183 SQLITE_API extern void (SQLITE_CDECL *sqlite3IoTrace)(const char*, ...);
27184 if( iotrace && iotrace!=stdout ) fclose(iotrace);
@@ -29587,10 +30755,15 @@
30755 }
30756 }
30757 #ifndef SQLITE_SHELL_FIDDLE
30758 /* In WASM mode we have to leave the db state in place so that
30759 ** client code can "push" SQL into it after this call returns. */
30760 #ifndef SQLITE_OMIT_VIRTUALTABLE
30761 if( data.expert.pExpert ){
30762 expertFinish(&data, 1, 0);
30763 }
30764 #endif
30765 free(azCmd);
30766 set_table_name(&data, 0);
30767 if( data.db ){
30768 session_close_all(&data, -1);
30769 close_db(data.db);
@@ -29653,11 +30826,11 @@
30826 return pVfs;
30827 }
30828
30829 /* Only for emcc experimentation purposes. */
30830 sqlite3 * fiddle_db_arg(sqlite3 *arg){
30831 oputf("fiddle_db_arg(%p)\n", (const void*)arg);
30832 return arg;
30833 }
30834
30835 /*
30836 ** Intended to be called via a SharedWorker() while a separate
@@ -29679,16 +30852,26 @@
30852 : NULL;
30853 }
30854
30855 /*
30856 ** Completely wipes out the contents of the currently-opened database
30857 ** but leaves its storage intact for reuse. If any transactions are
30858 ** active, they are forcibly rolled back.
30859 */
30860 void fiddle_reset_db(void){
30861 if( globalDb ){
30862 int rc;
30863 while( sqlite3_txn_state(globalDb,0)>0 ){
30864 /*
30865 ** Resolve problem reported in
30866 ** https://sqlite.org/forum/forumpost/0b41a25d65
30867 */
30868 oputz("Rolling back in-progress transaction.\n");
30869 sqlite3_exec(globalDb,"ROLLBACK", 0, 0, 0);
30870 }
30871 rc = sqlite3_db_config(globalDb, SQLITE_DBCONFIG_RESET_DATABASE, 1, 0);
30872 if( 0==rc ) sqlite3_exec(globalDb, "VACUUM", 0, 0, 0);
30873 sqlite3_db_config(globalDb, SQLITE_DBCONFIG_RESET_DATABASE, 0, 0);
30874 }
30875 }
30876
30877 /*
30878
+2477 -2004
--- extsrc/sqlite3.c
+++ extsrc/sqlite3.c
@@ -16,11 +16,11 @@
1616
** if you want a wrapper to interface SQLite with your choice of programming
1717
** language. The code for the "sqlite3" command-line shell is also in a
1818
** separate file. This file contains only code for the core SQLite library.
1919
**
2020
** The content in this amalgamation comes from Fossil check-in
21
-** ce5df19dc4aff3fde03ef62261a5e095a16a.
21
+** 7ead022edaf7a0cd6a8976a1261246084975.
2222
*/
2323
#define SQLITE_CORE 1
2424
#define SQLITE_AMALGAMATION 1
2525
#ifndef SQLITE_PRIVATE
2626
# define SQLITE_PRIVATE static
@@ -459,11 +459,11 @@
459459
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
460460
** [sqlite_version()] and [sqlite_source_id()].
461461
*/
462462
#define SQLITE_VERSION "3.46.0"
463463
#define SQLITE_VERSION_NUMBER 3046000
464
-#define SQLITE_SOURCE_ID "2024-02-22 00:50:54 ce5df19dc4aff3fde03ef62261a5e095a16a8f4e46e2924becea4fed56ce49e3"
464
+#define SQLITE_SOURCE_ID "2024-03-09 18:41:40 7ead022edaf7a0cd6a8976a1261246084975c9a5be5c893f6c751bb5f963ac0f"
465465
466466
/*
467467
** CAPI3REF: Run-Time Library Version Numbers
468468
** KEYWORDS: sqlite3_version sqlite3_sourceid
469469
**
@@ -1075,15 +1075,15 @@
10751075
** <li> [SQLITE_LOCK_PENDING], or
10761076
** <li> [SQLITE_LOCK_EXCLUSIVE].
10771077
** </ul>
10781078
** xLock() upgrades the database file lock. In other words, xLock() moves the
10791079
** database file lock in the direction NONE toward EXCLUSIVE. The argument to
1080
-** xLock() is always on of SHARED, RESERVED, PENDING, or EXCLUSIVE, never
1080
+** xLock() is always one of SHARED, RESERVED, PENDING, or EXCLUSIVE, never
10811081
** SQLITE_LOCK_NONE. If the database file lock is already at or above the
10821082
** requested lock, then the call to xLock() is a no-op.
10831083
** xUnlock() downgrades the database file lock to either SHARED or NONE.
1084
-* If the lock is already at or below the requested lock state, then the call
1084
+** If the lock is already at or below the requested lock state, then the call
10851085
** to xUnlock() is a no-op.
10861086
** The xCheckReservedLock() method checks whether any database connection,
10871087
** either in this process or in some other process, is holding a RESERVED,
10881088
** PENDING, or EXCLUSIVE lock on the file. It returns true
10891089
** if such a lock exists and false otherwise.
@@ -14295,10 +14295,12 @@
1429514295
*/
1429614296
#if defined(SQLITE_OMIT_VIRTUALTABLE) && !defined(SQLITE_OMIT_ALTERTABLE)
1429714297
# define SQLITE_OMIT_ALTERTABLE
1429814298
#endif
1429914299
14300
+#define SQLITE_DIGIT_SEPARATOR '_'
14301
+
1430014302
/*
1430114303
** Return true (non-zero) if the input is an integer that is too large
1430214304
** to fit in 32-bits. This macro is used inside of various testcase()
1430314305
** macros to verify that we have tested SQLite for large-file support.
1430414306
*/
@@ -14597,12 +14599,13 @@
1459714599
#define TK_SELECT_COLUMN 178
1459814600
#define TK_IF_NULL_ROW 179
1459914601
#define TK_ASTERISK 180
1460014602
#define TK_SPAN 181
1460114603
#define TK_ERROR 182
14602
-#define TK_SPACE 183
14603
-#define TK_ILLEGAL 184
14604
+#define TK_QNUMBER 183
14605
+#define TK_SPACE 184
14606
+#define TK_ILLEGAL 185
1460414607
1460514608
/************** End of parse.h ***********************************************/
1460614609
/************** Continuing where we left off in sqliteInt.h ******************/
1460714610
#include <stdio.h>
1460814611
#include <stdlib.h>
@@ -15097,10 +15100,11 @@
1509715100
** 0x00004000 Push-down optimization
1509815101
** 0x00008000 After all FROM-clause analysis
1509915102
** 0x00010000 Beginning of DELETE/INSERT/UPDATE processing
1510015103
** 0x00020000 Transform DISTINCT into GROUP BY
1510115104
** 0x00040000 SELECT tree dump after all code has been generated
15105
+** 0x00080000 NOT NULL strength reduction
1510215106
*/
1510315107
1510415108
/*
1510515109
** Macros for "wheretrace"
1510615110
*/
@@ -16276,10 +16280,11 @@
1627616280
1627716281
SQLITE_PRIVATE int sqlite3BtreeIntegrityCheck(
1627816282
sqlite3 *db, /* Database connection that is running the check */
1627916283
Btree *p, /* The btree to be checked */
1628016284
Pgno *aRoot, /* An array of root pages numbers for individual trees */
16285
+ sqlite3_value *aCnt, /* OUT: entry counts for each btree in aRoot[] */
1628116286
int nRoot, /* Number of entries in aRoot[] */
1628216287
int mxErr, /* Stop reporting errors after this many */
1628316288
int *pnErr, /* OUT: Write number of errors seen to this variable */
1628416289
char **pzOut /* OUT: Write the error message string here */
1628516290
);
@@ -16546,39 +16551,39 @@
1654616551
#define OP_Checkpoint 3
1654716552
#define OP_JournalMode 4
1654816553
#define OP_Vacuum 5
1654916554
#define OP_VFilter 6 /* jump, synopsis: iplan=r[P3] zplan='P4' */
1655016555
#define OP_VUpdate 7 /* synopsis: data=r[P3@P2] */
16551
-#define OP_Init 8 /* jump, synopsis: Start at P2 */
16556
+#define OP_Init 8 /* jump0, synopsis: Start at P2 */
1655216557
#define OP_Goto 9 /* jump */
1655316558
#define OP_Gosub 10 /* jump */
16554
-#define OP_InitCoroutine 11 /* jump */
16555
-#define OP_Yield 12 /* jump */
16556
-#define OP_MustBeInt 13 /* jump */
16559
+#define OP_InitCoroutine 11 /* jump0 */
16560
+#define OP_Yield 12 /* jump0 */
16561
+#define OP_MustBeInt 13 /* jump0 */
1655716562
#define OP_Jump 14 /* jump */
1655816563
#define OP_Once 15 /* jump */
1655916564
#define OP_If 16 /* jump */
1656016565
#define OP_IfNot 17 /* jump */
1656116566
#define OP_IsType 18 /* jump, synopsis: if typeof(P1.P3) in P5 goto P2 */
1656216567
#define OP_Not 19 /* same as TK_NOT, synopsis: r[P2]= !r[P1] */
1656316568
#define OP_IfNullRow 20 /* jump, synopsis: if P1.nullRow then r[P3]=NULL, goto P2 */
16564
-#define OP_SeekLT 21 /* jump, synopsis: key=r[P3@P4] */
16565
-#define OP_SeekLE 22 /* jump, synopsis: key=r[P3@P4] */
16566
-#define OP_SeekGE 23 /* jump, synopsis: key=r[P3@P4] */
16567
-#define OP_SeekGT 24 /* jump, synopsis: key=r[P3@P4] */
16569
+#define OP_SeekLT 21 /* jump0, synopsis: key=r[P3@P4] */
16570
+#define OP_SeekLE 22 /* jump0, synopsis: key=r[P3@P4] */
16571
+#define OP_SeekGE 23 /* jump0, synopsis: key=r[P3@P4] */
16572
+#define OP_SeekGT 24 /* jump0, synopsis: key=r[P3@P4] */
1656816573
#define OP_IfNotOpen 25 /* jump, synopsis: if( !csr[P1] ) goto P2 */
1656916574
#define OP_IfNoHope 26 /* jump, synopsis: key=r[P3@P4] */
1657016575
#define OP_NoConflict 27 /* jump, synopsis: key=r[P3@P4] */
1657116576
#define OP_NotFound 28 /* jump, synopsis: key=r[P3@P4] */
1657216577
#define OP_Found 29 /* jump, synopsis: key=r[P3@P4] */
16573
-#define OP_SeekRowid 30 /* jump, synopsis: intkey=r[P3] */
16578
+#define OP_SeekRowid 30 /* jump0, synopsis: intkey=r[P3] */
1657416579
#define OP_NotExists 31 /* jump, synopsis: intkey=r[P3] */
16575
-#define OP_Last 32 /* jump */
16580
+#define OP_Last 32 /* jump0 */
1657616581
#define OP_IfSizeBetween 33 /* jump */
1657716582
#define OP_SorterSort 34 /* jump */
1657816583
#define OP_Sort 35 /* jump */
16579
-#define OP_Rewind 36 /* jump */
16584
+#define OP_Rewind 36 /* jump0 */
1658016585
#define OP_SorterNext 37 /* jump */
1658116586
#define OP_Prev 38 /* jump */
1658216587
#define OP_Next 39 /* jump */
1658316588
#define OP_IdxLE 40 /* jump, synopsis: key=r[P3@P4] */
1658416589
#define OP_IdxGT 41 /* jump, synopsis: key=r[P3@P4] */
@@ -16586,11 +16591,11 @@
1658616591
#define OP_Or 43 /* same as TK_OR, synopsis: r[P3]=(r[P1] || r[P2]) */
1658716592
#define OP_And 44 /* same as TK_AND, synopsis: r[P3]=(r[P1] && r[P2]) */
1658816593
#define OP_IdxGE 45 /* jump, synopsis: key=r[P3@P4] */
1658916594
#define OP_RowSetRead 46 /* jump, synopsis: r[P3]=rowset(P1) */
1659016595
#define OP_RowSetTest 47 /* jump, synopsis: if r[P3] in rowset(P1) goto P2 */
16591
-#define OP_Program 48 /* jump */
16596
+#define OP_Program 48 /* jump0 */
1659216597
#define OP_FkIfZero 49 /* jump, synopsis: if fkctr[P1]==0 goto P2 */
1659316598
#define OP_IsNull 50 /* jump, same as TK_ISNULL, synopsis: if r[P1]==NULL goto P2 */
1659416599
#define OP_NotNull 51 /* jump, same as TK_NOTNULL, synopsis: if r[P1]!=NULL goto P2 */
1659516600
#define OP_Ne 52 /* jump, same as TK_NE, synopsis: IF r[P3]!=r[P1] */
1659616601
#define OP_Eq 53 /* jump, same as TK_EQ, synopsis: IF r[P3]==r[P1] */
@@ -16616,11 +16621,11 @@
1661616621
#define OP_String 73 /* synopsis: r[P2]='P4' (len=P1) */
1661716622
#define OP_BeginSubrtn 74 /* synopsis: r[P2]=NULL */
1661816623
#define OP_Null 75 /* synopsis: r[P2..P3]=NULL */
1661916624
#define OP_SoftNull 76 /* synopsis: r[P1]=NULL */
1662016625
#define OP_Blob 77 /* synopsis: r[P2]=P4 (len=P1) */
16621
-#define OP_Variable 78 /* synopsis: r[P2]=parameter(P1,P4) */
16626
+#define OP_Variable 78 /* synopsis: r[P2]=parameter(P1) */
1662216627
#define OP_Move 79 /* synopsis: r[P2@P3]=r[P1@P3] */
1662316628
#define OP_Copy 80 /* synopsis: r[P2@P3+1]=r[P1@P3+1] */
1662416629
#define OP_SCopy 81 /* synopsis: r[P2]=r[P1] */
1662516630
#define OP_IntCopy 82 /* synopsis: r[P2]=r[P1] */
1662616631
#define OP_FkCheck 83
@@ -16740,18 +16745,19 @@
1674016745
#define OPFLG_IN2 0x04 /* in2: P2 is an input */
1674116746
#define OPFLG_IN3 0x08 /* in3: P3 is an input */
1674216747
#define OPFLG_OUT2 0x10 /* out2: P2 is an output */
1674316748
#define OPFLG_OUT3 0x20 /* out3: P3 is an output */
1674416749
#define OPFLG_NCYCLE 0x40 /* ncycle:Cycles count against P1 */
16750
+#define OPFLG_JUMP0 0x80 /* jump0: P2 might be zero */
1674516751
#define OPFLG_INITIALIZER {\
1674616752
/* 0 */ 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x41, 0x00,\
16747
-/* 8 */ 0x01, 0x01, 0x01, 0x01, 0x03, 0x03, 0x01, 0x01,\
16748
-/* 16 */ 0x03, 0x03, 0x01, 0x12, 0x01, 0x49, 0x49, 0x49,\
16749
-/* 24 */ 0x49, 0x01, 0x49, 0x49, 0x49, 0x49, 0x49, 0x49,\
16750
-/* 32 */ 0x41, 0x01, 0x41, 0x41, 0x41, 0x01, 0x41, 0x41,\
16753
+/* 8 */ 0x81, 0x01, 0x01, 0x81, 0x83, 0x83, 0x01, 0x01,\
16754
+/* 16 */ 0x03, 0x03, 0x01, 0x12, 0x01, 0xc9, 0xc9, 0xc9,\
16755
+/* 24 */ 0xc9, 0x01, 0x49, 0x49, 0x49, 0x49, 0xc9, 0x49,\
16756
+/* 32 */ 0xc1, 0x01, 0x41, 0x41, 0xc1, 0x01, 0x41, 0x41,\
1675116757
/* 40 */ 0x41, 0x41, 0x41, 0x26, 0x26, 0x41, 0x23, 0x0b,\
16752
-/* 48 */ 0x01, 0x01, 0x03, 0x03, 0x0b, 0x0b, 0x0b, 0x0b,\
16758
+/* 48 */ 0x81, 0x01, 0x03, 0x03, 0x0b, 0x0b, 0x0b, 0x0b,\
1675316759
/* 56 */ 0x0b, 0x0b, 0x01, 0x03, 0x03, 0x03, 0x01, 0x41,\
1675416760
/* 64 */ 0x01, 0x00, 0x00, 0x02, 0x02, 0x08, 0x00, 0x10,\
1675516761
/* 72 */ 0x10, 0x10, 0x00, 0x10, 0x00, 0x10, 0x10, 0x00,\
1675616762
/* 80 */ 0x00, 0x10, 0x10, 0x00, 0x00, 0x00, 0x02, 0x02,\
1675716763
/* 88 */ 0x02, 0x00, 0x00, 0x12, 0x1e, 0x20, 0x40, 0x00,\
@@ -16906,10 +16912,12 @@
1690616912
typedef int (*RecordCompare)(int,const void*,UnpackedRecord*);
1690716913
SQLITE_PRIVATE RecordCompare sqlite3VdbeFindCompare(UnpackedRecord*);
1690816914
1690916915
SQLITE_PRIVATE void sqlite3VdbeLinkSubProgram(Vdbe *, SubProgram *);
1691016916
SQLITE_PRIVATE int sqlite3VdbeHasSubProgram(Vdbe*);
16917
+
16918
+SQLITE_PRIVATE void sqlite3MemSetArrayInt64(sqlite3_value *aMem, int iIdx, i64 val);
1691116919
1691216920
SQLITE_PRIVATE int sqlite3NotPureFunc(sqlite3_context*);
1691316921
#ifdef SQLITE_ENABLE_BYTECODE_VTAB
1691416922
SQLITE_PRIVATE int sqlite3VdbeBytecodeVtabInit(sqlite3*);
1691516923
#endif
@@ -19349,10 +19357,11 @@
1934919357
#define NC_HasWin 0x008000 /* One or more window functions seen */
1935019358
#define NC_IsDDL 0x010000 /* Resolving names in a CREATE statement */
1935119359
#define NC_InAggFunc 0x020000 /* True if analyzing arguments to an agg func */
1935219360
#define NC_FromDDL 0x040000 /* SQL text comes from sqlite_schema */
1935319361
#define NC_NoSelect 0x080000 /* Do not descend into sub-selects */
19362
+#define NC_Where 0x100000 /* Processing WHERE clause of a SELECT */
1935419363
#define NC_OrderAgg 0x8000000 /* Has an aggregate other than count/min/max */
1935519364
1935619365
/*
1935719366
** An instance of the following object describes a single ON CONFLICT
1935819367
** clause in an upsert.
@@ -19372,10 +19381,11 @@
1937219381
Expr *pUpsertTargetWhere; /* WHERE clause for partial index targets */
1937319382
ExprList *pUpsertSet; /* The SET clause from an ON CONFLICT UPDATE */
1937419383
Expr *pUpsertWhere; /* WHERE clause for the ON CONFLICT UPDATE */
1937519384
Upsert *pNextUpsert; /* Next ON CONFLICT clause in the list */
1937619385
u8 isDoUpdate; /* True for DO UPDATE. False for DO NOTHING */
19386
+ u8 isDup; /* True if 2nd or later with same pUpsertIdx */
1937719387
/* Above this point is the parse tree for the ON CONFLICT clauses.
1937819388
** The next group of fields stores intermediate data. */
1937919389
void *pToFree; /* Free memory when deleting the Upsert object */
1938019390
/* All fields above are owned by the Upsert object and must be freed
1938119391
** when the Upsert is destroyed. The fields below are used to transfer
@@ -20693,10 +20703,11 @@
2069320703
SQLITE_PRIVATE void sqlite3ErrorMsg(Parse*, const char*, ...);
2069420704
SQLITE_PRIVATE int sqlite3ErrorToParser(sqlite3*,int);
2069520705
SQLITE_PRIVATE void sqlite3Dequote(char*);
2069620706
SQLITE_PRIVATE void sqlite3DequoteExpr(Expr*);
2069720707
SQLITE_PRIVATE void sqlite3DequoteToken(Token*);
20708
+SQLITE_PRIVATE void sqlite3DequoteNumber(Parse*, Expr*);
2069820709
SQLITE_PRIVATE void sqlite3TokenInit(Token*,char*);
2069920710
SQLITE_PRIVATE int sqlite3KeywordCode(const unsigned char*, int);
2070020711
SQLITE_PRIVATE int sqlite3RunParser(Parse*, const char*);
2070120712
SQLITE_PRIVATE void sqlite3FinishCoding(Parse*);
2070220713
SQLITE_PRIVATE int sqlite3GetTempReg(Parse*);
@@ -21447,11 +21458,11 @@
2144721458
#endif
2144821459
#ifndef SQLITE_OMIT_UPSERT
2144921460
SQLITE_PRIVATE Upsert *sqlite3UpsertNew(sqlite3*,ExprList*,Expr*,ExprList*,Expr*,Upsert*);
2145021461
SQLITE_PRIVATE void sqlite3UpsertDelete(sqlite3*,Upsert*);
2145121462
SQLITE_PRIVATE Upsert *sqlite3UpsertDup(sqlite3*,Upsert*);
21452
-SQLITE_PRIVATE int sqlite3UpsertAnalyzeTarget(Parse*,SrcList*,Upsert*);
21463
+SQLITE_PRIVATE int sqlite3UpsertAnalyzeTarget(Parse*,SrcList*,Upsert*,Upsert*);
2145321464
SQLITE_PRIVATE void sqlite3UpsertDoUpdate(Parse*,Upsert*,Table*,Index*,int);
2145421465
SQLITE_PRIVATE Upsert *sqlite3UpsertOfIndex(Upsert*,Index*);
2145521466
SQLITE_PRIVATE int sqlite3UpsertNextIsIPK(Upsert*);
2145621467
#else
2145721468
#define sqlite3UpsertNew(u,v,w,x,y,z) ((Upsert*)0)
@@ -24177,17 +24188,18 @@
2417724188
int Y, M, D; /* Year, month, and day */
2417824189
int h, m; /* Hour and minutes */
2417924190
int tz; /* Timezone offset in minutes */
2418024191
double s; /* Seconds */
2418124192
char validJD; /* True (1) if iJD is valid */
24182
- char rawS; /* Raw numeric value stored in s */
2418324193
char validYMD; /* True (1) if Y,M,D are valid */
2418424194
char validHMS; /* True (1) if h,m,s are valid */
24185
- char validTZ; /* True (1) if tz is valid */
24186
- char tzSet; /* Timezone was set explicitly */
24187
- char isError; /* An overflow has occurred */
24188
- char useSubsec; /* Display subsecond precision */
24195
+ char nFloor; /* Days to implement "floor" */
24196
+ unsigned rawS : 1; /* Raw numeric value stored in s */
24197
+ unsigned isError : 1; /* An overflow has occurred */
24198
+ unsigned useSubsec : 1; /* Display subsecond precision */
24199
+ unsigned isUtc : 1; /* Time is known to be UTC */
24200
+ unsigned isLocal : 1; /* Time is known to be localtime */
2418924201
};
2419024202
2419124203
2419224204
/*
2419324205
** Convert zDate into one or more integers according to the conversion
@@ -24281,10 +24293,12 @@
2428124293
sgn = -1;
2428224294
}else if( c=='+' ){
2428324295
sgn = +1;
2428424296
}else if( c=='Z' || c=='z' ){
2428524297
zDate++;
24298
+ p->isLocal = 0;
24299
+ p->isUtc = 1;
2428624300
goto zulu_time;
2428724301
}else{
2428824302
return c!=0;
2428924303
}
2429024304
zDate++;
@@ -24293,11 +24307,10 @@
2429324307
}
2429424308
zDate += 5;
2429524309
p->tz = sgn*(nMn + nHr*60);
2429624310
zulu_time:
2429724311
while( sqlite3Isspace(*zDate) ){ zDate++; }
24298
- p->tzSet = 1;
2429924312
return *zDate!=0;
2430024313
}
2430124314
2430224315
/*
2430324316
** Parse times of the form HH:MM or HH:MM:SS or HH:MM:SS.FFFF.
@@ -24337,11 +24350,10 @@
2433724350
p->validHMS = 1;
2433824351
p->h = h;
2433924352
p->m = m;
2434024353
p->s = s + ms;
2434124354
if( parseTimezone(zDate, p) ) return 1;
24342
- p->validTZ = (p->tz!=0)?1:0;
2434324355
return 0;
2434424356
}
2434524357
2434624358
/*
2434724359
** Put the DateTime object into its error state.
@@ -24384,18 +24396,43 @@
2438424396
X2 = 306001*(M+1)/10000;
2438524397
p->iJD = (sqlite3_int64)((X1 + X2 + D + B - 1524.5 ) * 86400000);
2438624398
p->validJD = 1;
2438724399
if( p->validHMS ){
2438824400
p->iJD += p->h*3600000 + p->m*60000 + (sqlite3_int64)(p->s*1000 + 0.5);
24389
- if( p->validTZ ){
24401
+ if( p->tz ){
2439024402
p->iJD -= p->tz*60000;
2439124403
p->validYMD = 0;
2439224404
p->validHMS = 0;
24393
- p->validTZ = 0;
24405
+ p->tz = 0;
24406
+ p->isUtc = 1;
24407
+ p->isLocal = 0;
2439424408
}
2439524409
}
2439624410
}
24411
+
24412
+/*
24413
+** Given the YYYY-MM-DD information current in p, determine if there
24414
+** is day-of-month overflow and set nFloor to the number of days that
24415
+** would need to be subtracted from the date in order to bring the
24416
+** date back to the end of the month.
24417
+*/
24418
+static void computeFloor(DateTime *p){
24419
+ assert( p->validYMD || p->isError );
24420
+ assert( p->D>=0 && p->D<=31 );
24421
+ assert( p->M>=0 && p->M<=12 );
24422
+ if( p->D<=28 ){
24423
+ p->nFloor = 0;
24424
+ }else if( (1<<p->M) & 0x15aa ){
24425
+ p->nFloor = 0;
24426
+ }else if( p->M!=2 ){
24427
+ p->nFloor = (p->D==31);
24428
+ }else if( p->Y%4!=0 || (p->Y%100==0 && p->Y%400!=0) ){
24429
+ p->nFloor = p->D - 28;
24430
+ }else{
24431
+ p->nFloor = p->D - 29;
24432
+ }
24433
+}
2439724434
2439824435
/*
2439924436
** Parse dates of the form
2440024437
**
2440124438
** YYYY-MM-DD HH:MM:SS.FFF
@@ -24431,25 +24468,32 @@
2443124468
p->validJD = 0;
2443224469
p->validYMD = 1;
2443324470
p->Y = neg ? -Y : Y;
2443424471
p->M = M;
2443524472
p->D = D;
24436
- if( p->validTZ ){
24473
+ computeFloor(p);
24474
+ if( p->tz ){
2443724475
computeJD(p);
2443824476
}
2443924477
return 0;
2444024478
}
2444124479
24480
+
24481
+static void clearYMD_HMS_TZ(DateTime *p); /* Forward declaration */
24482
+
2444224483
/*
2444324484
** Set the time to the current time reported by the VFS.
2444424485
**
2444524486
** Return the number of errors.
2444624487
*/
2444724488
static int setDateTimeToCurrent(sqlite3_context *context, DateTime *p){
2444824489
p->iJD = sqlite3StmtCurrentTime(context);
2444924490
if( p->iJD>0 ){
2445024491
p->validJD = 1;
24492
+ p->isUtc = 1;
24493
+ p->isLocal = 0;
24494
+ clearYMD_HMS_TZ(p);
2445124495
return 0;
2445224496
}else{
2445324497
return 1;
2445424498
}
2445524499
}
@@ -24584,11 +24628,11 @@
2458424628
** Clear the YMD and HMS and the TZ
2458524629
*/
2458624630
static void clearYMD_HMS_TZ(DateTime *p){
2458724631
p->validYMD = 0;
2458824632
p->validHMS = 0;
24589
- p->validTZ = 0;
24633
+ p->tz = 0;
2459024634
}
2459124635
2459224636
#ifndef SQLITE_OMIT_LOCALTIME
2459324637
/*
2459424638
** On recent Windows platforms, the localtime_s() function is available
@@ -24716,11 +24760,11 @@
2471624760
p->s = sLocal.tm_sec + (p->iJD%1000)*0.001;
2471724761
p->validYMD = 1;
2471824762
p->validHMS = 1;
2471924763
p->validJD = 0;
2472024764
p->rawS = 0;
24721
- p->validTZ = 0;
24765
+ p->tz = 0;
2472224766
p->isError = 0;
2472324767
return SQLITE_OK;
2472424768
}
2472524769
#endif /* SQLITE_OMIT_LOCALTIME */
2472624770
@@ -24736,16 +24780,16 @@
2473624780
u8 nName; /* Length of the name */
2473724781
char zName[7]; /* Name of the transformation */
2473824782
float rLimit; /* Maximum NNN value for this transform */
2473924783
float rXform; /* Constant used for this transform */
2474024784
} aXformType[] = {
24741
- { 6, "second", 4.6427e+14, 1.0 },
24742
- { 6, "minute", 7.7379e+12, 60.0 },
24743
- { 4, "hour", 1.2897e+11, 3600.0 },
24744
- { 3, "day", 5373485.0, 86400.0 },
24745
- { 5, "month", 176546.0, 2592000.0 },
24746
- { 4, "year", 14713.0, 31536000.0 },
24785
+ /* 0 */ { 6, "second", 4.6427e+14, 1.0 },
24786
+ /* 1 */ { 6, "minute", 7.7379e+12, 60.0 },
24787
+ /* 2 */ { 4, "hour", 1.2897e+11, 3600.0 },
24788
+ /* 3 */ { 3, "day", 5373485.0, 86400.0 },
24789
+ /* 4 */ { 5, "month", 176546.0, 30.0*86400.0 },
24790
+ /* 5 */ { 4, "year", 14713.0, 365.0*86400.0 },
2474724791
};
2474824792
2474924793
/*
2475024794
** If the DateTime p is raw number, try to figure out if it is
2475124795
** a julian day number of a unix timestamp. Set the p value
@@ -24773,18 +24817,24 @@
2477324817
** NNN hours
2477424818
** NNN minutes
2477524819
** NNN.NNNN seconds
2477624820
** NNN months
2477724821
** NNN years
24822
+** +/-YYYY-MM-DD HH:MM:SS.SSS
24823
+** ceiling
24824
+** floor
2477824825
** start of month
2477924826
** start of year
2478024827
** start of week
2478124828
** start of day
2478224829
** weekday N
2478324830
** unixepoch
24831
+** auto
2478424832
** localtime
2478524833
** utc
24834
+** subsec
24835
+** subsecond
2478624836
**
2478724837
** Return 0 on success and 1 if there is any kind of error. If the error
2478824838
** is in a system call (i.e. localtime()), then an error message is written
2478924839
** to context pCtx. If the error is an unrecognized modifier, no error is
2479024840
** written to pCtx.
@@ -24810,10 +24860,41 @@
2481024860
if( idx>1 ) return 1; /* IMP: R-33611-57934 */
2481124861
autoAdjustDate(p);
2481224862
rc = 0;
2481324863
}
2481424864
break;
24865
+ }
24866
+ case 'c': {
24867
+ /*
24868
+ ** ceiling
24869
+ **
24870
+ ** Resolve day-of-month overflow by rolling forward into the next
24871
+ ** month. As this is the default action, this modifier is really
24872
+ ** a no-op that is only included for symmetry. See "floor".
24873
+ */
24874
+ if( sqlite3_stricmp(z, "ceiling")==0 ){
24875
+ computeJD(p);
24876
+ clearYMD_HMS_TZ(p);
24877
+ rc = 0;
24878
+ p->nFloor = 0;
24879
+ }
24880
+ break;
24881
+ }
24882
+ case 'f': {
24883
+ /*
24884
+ ** floor
24885
+ **
24886
+ ** Resolve day-of-month overflow by rolling back to the end of the
24887
+ ** previous month.
24888
+ */
24889
+ if( sqlite3_stricmp(z, "floor")==0 ){
24890
+ computeJD(p);
24891
+ p->iJD -= p->nFloor*86400000;
24892
+ clearYMD_HMS_TZ(p);
24893
+ rc = 0;
24894
+ }
24895
+ break;
2481524896
}
2481624897
case 'j': {
2481724898
/*
2481824899
** julianday
2481924900
**
@@ -24837,11 +24918,13 @@
2483724918
**
2483824919
** Assuming the current time value is UTC (a.k.a. GMT), shift it to
2483924920
** show local time.
2484024921
*/
2484124922
if( sqlite3_stricmp(z, "localtime")==0 && sqlite3NotPureFunc(pCtx) ){
24842
- rc = toLocaltime(p, pCtx);
24923
+ rc = p->isLocal ? SQLITE_OK : toLocaltime(p, pCtx);
24924
+ p->isUtc = 0;
24925
+ p->isLocal = 1;
2484324926
}
2484424927
break;
2484524928
}
2484624929
#endif
2484724930
case 'u': {
@@ -24862,11 +24945,11 @@
2486224945
rc = 0;
2486324946
}
2486424947
}
2486524948
#ifndef SQLITE_OMIT_LOCALTIME
2486624949
else if( sqlite3_stricmp(z, "utc")==0 && sqlite3NotPureFunc(pCtx) ){
24867
- if( p->tzSet==0 ){
24950
+ if( p->isUtc==0 ){
2486824951
i64 iOrigJD; /* Original localtime */
2486924952
i64 iGuess; /* Guess at the corresponding utc time */
2487024953
int cnt = 0; /* Safety to prevent infinite loop */
2487124954
i64 iErr; /* Guess is off by this much */
2487224955
@@ -24885,11 +24968,12 @@
2488524968
iErr = new.iJD - iOrigJD;
2488624969
}while( iErr && cnt++<3 );
2488724970
memset(p, 0, sizeof(*p));
2488824971
p->iJD = iGuess;
2488924972
p->validJD = 1;
24890
- p->tzSet = 1;
24973
+ p->isUtc = 1;
24974
+ p->isLocal = 0;
2489124975
}
2489224976
rc = SQLITE_OK;
2489324977
}
2489424978
#endif
2489524979
break;
@@ -24905,11 +24989,11 @@
2490524989
if( sqlite3_strnicmp(z, "weekday ", 8)==0
2490624990
&& sqlite3AtoF(&z[8], &r, sqlite3Strlen30(&z[8]), SQLITE_UTF8)>0
2490724991
&& r>=0.0 && r<7.0 && (n=(int)r)==r ){
2490824992
sqlite3_int64 Z;
2490924993
computeYMD_HMS(p);
24910
- p->validTZ = 0;
24994
+ p->tz = 0;
2491124995
p->validJD = 0;
2491224996
computeJD(p);
2491324997
Z = ((p->iJD + 129600000)/86400000) % 7;
2491424998
if( Z>n ) Z -= 7;
2491524999
p->iJD += (n - Z)*86400000;
@@ -24945,11 +25029,11 @@
2494525029
computeYMD(p);
2494625030
p->validHMS = 1;
2494725031
p->h = p->m = 0;
2494825032
p->s = 0.0;
2494925033
p->rawS = 0;
24950
- p->validTZ = 0;
25034
+ p->tz = 0;
2495125035
p->validJD = 0;
2495225036
if( sqlite3_stricmp(z,"month")==0 ){
2495325037
p->D = 1;
2495425038
rc = 0;
2495525039
}else if( sqlite3_stricmp(z,"year")==0 ){
@@ -25016,10 +25100,11 @@
2501625100
p->M += M;
2501725101
}
2501825102
x = p->M>0 ? (p->M-1)/12 : (p->M-12)/12;
2501925103
p->Y += x;
2502025104
p->M -= x*12;
25105
+ computeFloor(p);
2502125106
computeJD(p);
2502225107
p->validHMS = 0;
2502325108
p->validYMD = 0;
2502425109
p->iJD += (i64)D*86400000;
2502525110
if( z[11]==0 ){
@@ -25062,37 +25147,41 @@
2506225147
/* If control reaches this point, it means the transformation is
2506325148
** one of the forms like "+NNN days". */
2506425149
z += n;
2506525150
while( sqlite3Isspace(*z) ) z++;
2506625151
n = sqlite3Strlen30(z);
25067
- if( n>10 || n<3 ) break;
25152
+ if( n<3 || n>10 ) break;
2506825153
if( sqlite3UpperToLower[(u8)z[n-1]]=='s' ) n--;
2506925154
computeJD(p);
2507025155
assert( rc==1 );
2507125156
rRounder = r<0 ? -0.5 : +0.5;
25157
+ p->nFloor = 0;
2507225158
for(i=0; i<ArraySize(aXformType); i++){
2507325159
if( aXformType[i].nName==n
2507425160
&& sqlite3_strnicmp(aXformType[i].zName, z, n)==0
2507525161
&& r>-aXformType[i].rLimit && r<aXformType[i].rLimit
2507625162
){
2507725163
switch( i ){
2507825164
case 4: { /* Special processing to add months */
25079
- assert( strcmp(aXformType[i].zName,"month")==0 );
25165
+ assert( strcmp(aXformType[4].zName,"month")==0 );
2508025166
computeYMD_HMS(p);
2508125167
p->M += (int)r;
2508225168
x = p->M>0 ? (p->M-1)/12 : (p->M-12)/12;
2508325169
p->Y += x;
2508425170
p->M -= x*12;
25171
+ computeFloor(p);
2508525172
p->validJD = 0;
2508625173
r -= (int)r;
2508725174
break;
2508825175
}
2508925176
case 5: { /* Special processing to add years */
2509025177
int y = (int)r;
25091
- assert( strcmp(aXformType[i].zName,"year")==0 );
25178
+ assert( strcmp(aXformType[5].zName,"year")==0 );
2509225179
computeYMD_HMS(p);
25180
+ assert( p->M>=0 && p->M<=12 );
2509325181
p->Y += y;
25182
+ computeFloor(p);
2509425183
p->validJD = 0;
2509525184
r -= (int)r;
2509625185
break;
2509725186
}
2509825187
}
@@ -25713,13 +25802,11 @@
2571325802
computeJD(&d2);
2571425803
}
2571525804
d1.iJD = d2.iJD - d1.iJD;
2571625805
d1.iJD += (u64)1486995408 * (u64)100000;
2571725806
}
25718
- d1.validYMD = 0;
25719
- d1.validHMS = 0;
25720
- d1.validTZ = 0;
25807
+ clearYMD_HMS_TZ(&d1);
2572125808
computeYMD_HMS(&d1);
2572225809
sqlite3StrAccumInit(&sRes, 0, 0, 0, 100);
2572325810
sqlite3_str_appendf(&sRes, "%c%04d-%02d-%02d %02d:%02d:%06.3f",
2572425811
sign, Y, M, d1.D-1, d1.h, d1.m, d1.s);
2572525812
sqlite3ResultStrAccum(context, &sRes);
@@ -25783,10 +25870,40 @@
2578325870
strftime(zBuf, 20, zFormat, &sNow);
2578425871
sqlite3_result_text(context, zBuf, -1, SQLITE_TRANSIENT);
2578525872
}
2578625873
}
2578725874
#endif
25875
+
25876
+#if !defined(SQLITE_OMIT_DATETIME_FUNCS) && defined(SQLITE_DEBUG)
25877
+/*
25878
+** datedebug(...)
25879
+**
25880
+** This routine returns JSON that describes the internal DateTime object.
25881
+** Used for debugging and testing only. Subject to change.
25882
+*/
25883
+static void datedebugFunc(
25884
+ sqlite3_context *context,
25885
+ int argc,
25886
+ sqlite3_value **argv
25887
+){
25888
+ DateTime x;
25889
+ if( isDate(context, argc, argv, &x)==0 ){
25890
+ char *zJson;
25891
+ zJson = sqlite3_mprintf(
25892
+ "{iJD:%lld,Y:%d,M:%d,D:%d,h:%d,m:%d,tz:%d,"
25893
+ "s:%.3f,validJD:%d,validYMS:%d,validHMS:%d,"
25894
+ "nFloor:%d,rawS:%d,isError:%d,useSubsec:%d,"
25895
+ "isUtc:%d,isLocal:%d}",
25896
+ x.iJD, x.Y, x.M, x.D, x.h, x.m, x.tz,
25897
+ x.s, x.validJD, x.validYMD, x.validHMS,
25898
+ x.nFloor, x.rawS, x.isError, x.useSubsec,
25899
+ x.isUtc, x.isLocal);
25900
+ sqlite3_result_text(context, zJson, -1, sqlite3_free);
25901
+ }
25902
+}
25903
+#endif /* !SQLITE_OMIT_DATETIME_FUNCS && SQLITE_DEBUG */
25904
+
2578825905
2578925906
/*
2579025907
** This function registered all of the above C functions as SQL
2579125908
** functions. This should be the only routine in this file with
2579225909
** external linkage.
@@ -25799,10 +25916,13 @@
2579925916
PURE_DATE(date, -1, 0, 0, dateFunc ),
2580025917
PURE_DATE(time, -1, 0, 0, timeFunc ),
2580125918
PURE_DATE(datetime, -1, 0, 0, datetimeFunc ),
2580225919
PURE_DATE(strftime, -1, 0, 0, strftimeFunc ),
2580325920
PURE_DATE(timediff, 2, 0, 0, timediffFunc ),
25921
+#ifdef SQLITE_DEBUG
25922
+ PURE_DATE(datedebug, -1, 0, 0, datedebugFunc ),
25923
+#endif
2580425924
DFUNCTION(current_time, 0, 0, 0, ctimeFunc ),
2580525925
DFUNCTION(current_timestamp, 0, 0, 0, ctimestampFunc),
2580625926
DFUNCTION(current_date, 0, 0, 0, cdateFunc ),
2580725927
#else
2580825928
STR_FUNCTION(current_time, 0, "%H:%M:%S", 0, currentTimeFunc),
@@ -34989,10 +35109,48 @@
3498935109
assert( !ExprHasProperty(p, EP_IntValue) );
3499035110
assert( sqlite3Isquote(p->u.zToken[0]) );
3499135111
p->flags |= p->u.zToken[0]=='"' ? EP_Quoted|EP_DblQuoted : EP_Quoted;
3499235112
sqlite3Dequote(p->u.zToken);
3499335113
}
35114
+
35115
+/*
35116
+** Expression p is a QNUMBER (quoted number). Dequote the value in p->u.zToken
35117
+** and set the type to INTEGER or FLOAT. "Quoted" integers or floats are those
35118
+** that contain '_' characters that must be removed before further processing.
35119
+*/
35120
+SQLITE_PRIVATE void sqlite3DequoteNumber(Parse *pParse, Expr *p){
35121
+ assert( p!=0 || pParse->db->mallocFailed );
35122
+ if( p ){
35123
+ const char *pIn = p->u.zToken;
35124
+ char *pOut = p->u.zToken;
35125
+ int bHex = (pIn[0]=='0' && (pIn[1]=='x' || pIn[1]=='X'));
35126
+ int iValue;
35127
+ assert( p->op==TK_QNUMBER );
35128
+ p->op = TK_INTEGER;
35129
+ do {
35130
+ if( *pIn!=SQLITE_DIGIT_SEPARATOR ){
35131
+ *pOut++ = *pIn;
35132
+ if( *pIn=='e' || *pIn=='E' || *pIn=='.' ) p->op = TK_FLOAT;
35133
+ }else{
35134
+ if( (bHex==0 && (!sqlite3Isdigit(pIn[-1]) || !sqlite3Isdigit(pIn[1])))
35135
+ || (bHex==1 && (!sqlite3Isxdigit(pIn[-1]) || !sqlite3Isxdigit(pIn[1])))
35136
+ ){
35137
+ sqlite3ErrorMsg(pParse, "unrecognized token: \"%s\"", p->u.zToken);
35138
+ }
35139
+ }
35140
+ }while( *pIn++ );
35141
+ if( bHex ) p->op = TK_INTEGER;
35142
+
35143
+ /* tag-20240227-a: If after dequoting, the number is an integer that
35144
+ ** fits in 32 bits, then it must be converted into EP_IntValue. Other
35145
+ ** parts of the code expect this. See also tag-20240227-b. */
35146
+ if( p->op==TK_INTEGER && sqlite3GetInt32(p->u.zToken, &iValue) ){
35147
+ p->u.iValue = iValue;
35148
+ p->flags |= EP_IntValue;
35149
+ }
35150
+ }
35151
+}
3499435152
3499535153
/*
3499635154
** If the input token p is quoted, try to adjust the token to remove
3499735155
** the quotes. This is not always possible:
3499835156
**
@@ -35306,10 +35464,13 @@
3530635464
}else{
3530735465
double rr[2];
3530835466
u64 s2;
3530935467
rr[0] = (double)s;
3531035468
s2 = (u64)rr[0];
35469
+#if defined(_MSC_VER) && _MSC_VER<1700
35470
+ if( s2==0x8000000000000000LL ){ s2 = 2*(u64)(0.5*rr[0]); }
35471
+#endif
3531135472
rr[1] = s>=s2 ? (double)(s - s2) : -(double)(s2 - s);
3531235473
if( e>0 ){
3531335474
while( e>=100 ){
3531435475
e -= 100;
3531535476
dekkerMul2(rr, 1.0e+100, -1.5902891109759918046e+83);
@@ -36971,11 +37132,11 @@
3697137132
/* 73 */ "String" OpHelp("r[P2]='P4' (len=P1)"),
3697237133
/* 74 */ "BeginSubrtn" OpHelp("r[P2]=NULL"),
3697337134
/* 75 */ "Null" OpHelp("r[P2..P3]=NULL"),
3697437135
/* 76 */ "SoftNull" OpHelp("r[P1]=NULL"),
3697537136
/* 77 */ "Blob" OpHelp("r[P2]=P4 (len=P1)"),
36976
- /* 78 */ "Variable" OpHelp("r[P2]=parameter(P1,P4)"),
37137
+ /* 78 */ "Variable" OpHelp("r[P2]=parameter(P1)"),
3697737138
/* 79 */ "Move" OpHelp("r[P2@P3]=r[P1@P3]"),
3697837139
/* 80 */ "Copy" OpHelp("r[P2@P3+1]=r[P1@P3+1]"),
3697937140
/* 81 */ "SCopy" OpHelp("r[P2]=r[P1]"),
3698037141
/* 82 */ "IntCopy" OpHelp("r[P2]=r[P1]"),
3698137142
/* 83 */ "FkCheck" OpHelp(""),
@@ -69928,10 +70089,11 @@
6992870089
Pgno v1; /* Value for second %u substitution in zPfx (current pg) */
6992970090
int v2; /* Value for third %d substitution in zPfx */
6993070091
StrAccum errMsg; /* Accumulate the error message text here */
6993170092
u32 *heap; /* Min-heap used for analyzing cell coverage */
6993270093
sqlite3 *db; /* Database connection running the check */
70094
+ i64 nRow; /* Number of rows visited in current tree */
6993370095
};
6993470096
6993570097
/*
6993670098
** Routines to read or write a two- and four-byte big-endian integer values.
6993770099
*/
@@ -77258,11 +77420,14 @@
7725877420
/* This is the common case where everything fits on the btree page
7725977421
** and no overflow pages are required. */
7726077422
n = nHeader + nPayload;
7726177423
testcase( n==3 );
7726277424
testcase( n==4 );
77263
- if( n<4 ) n = 4;
77425
+ if( n<4 ){
77426
+ n = 4;
77427
+ pPayload[nPayload] = 0;
77428
+ }
7726477429
*pnSize = n;
7726577430
assert( nSrc<=nPayload );
7726677431
testcase( nSrc<nPayload );
7726777432
memcpy(pPayload, pSrc, nSrc);
7726877433
memset(pPayload+nSrc, 0, nPayload-nSrc);
@@ -79704,11 +79869,14 @@
7970479869
assert( newCell!=0 );
7970579870
assert( BTREE_PREFORMAT==OPFLAG_PREFORMAT );
7970679871
if( flags & BTREE_PREFORMAT ){
7970779872
rc = SQLITE_OK;
7970879873
szNew = p->pBt->nPreformatSize;
79709
- if( szNew<4 ) szNew = 4;
79874
+ if( szNew<4 ){
79875
+ szNew = 4;
79876
+ newCell[3] = 0;
79877
+ }
7971079878
if( ISAUTOVACUUM(p->pBt) && szNew>pPage->maxLocal ){
7971179879
CellInfo info;
7971279880
pPage->xParseCell(pPage, newCell, &info);
7971379881
if( info.nPayload!=info.nLocal ){
7971479882
Pgno ovfl = get4byte(&newCell[szNew-4]);
@@ -81045,10 +81213,13 @@
8104581213
8104681214
/* EVIDENCE-OF: R-37002-32774 The two-byte integer at offset 3 gives the
8104781215
** number of cells on the page. */
8104881216
nCell = get2byte(&data[hdr+3]);
8104981217
assert( pPage->nCell==nCell );
81218
+ if( pPage->leaf || pPage->intKey==0 ){
81219
+ pCheck->nRow += nCell;
81220
+ }
8105081221
8105181222
/* EVIDENCE-OF: R-23882-45353 The cell pointer array of a b-tree page
8105281223
** immediately follows the b-tree page header. */
8105381224
cellStart = hdr + 12 - 4*pPage->leaf;
8105481225
assert( pPage->aCellIdx==&data[cellStart] );
@@ -81156,10 +81327,11 @@
8115681327
pc = get2byteAligned(&data[cellStart+i*2]);
8115781328
size = pPage->xCellSize(pPage, &data[pc]);
8115881329
btreeHeapInsert(heap, (pc<<16)|(pc+size-1));
8115981330
}
8116081331
}
81332
+ assert( heap!=0 );
8116181333
/* Add the freeblocks to the min-heap
8116281334
**
8116381335
** EVIDENCE-OF: R-20690-50594 The second field of the b-tree page header
8116481336
** is the offset of the first freeblock, or zero if there are no
8116581337
** freeblocks on the page.
@@ -81255,10 +81427,11 @@
8125581427
*/
8125681428
SQLITE_PRIVATE int sqlite3BtreeIntegrityCheck(
8125781429
sqlite3 *db, /* Database connection that is running the check */
8125881430
Btree *p, /* The btree to be checked */
8125981431
Pgno *aRoot, /* An array of root pages numbers for individual trees */
81432
+ Mem *aCnt, /* Memory cells to write counts for each tree to */
8126081433
int nRoot, /* Number of entries in aRoot[] */
8126181434
int mxErr, /* Stop reporting errors after this many */
8126281435
int *pnErr, /* OUT: Write number of errors seen to this variable */
8126381436
char **pzOut /* OUT: Write the error message string here */
8126481437
){
@@ -81268,11 +81441,13 @@
8126881441
u64 savedDbFlags = pBt->db->flags;
8126981442
char zErr[100];
8127081443
int bPartial = 0; /* True if not checking all btrees */
8127181444
int bCkFreelist = 1; /* True to scan the freelist */
8127281445
VVA_ONLY( int nRef );
81446
+
8127381447
assert( nRoot>0 );
81448
+ assert( aCnt!=0 );
8127481449
8127581450
/* aRoot[0]==0 means this is a partial check */
8127681451
if( aRoot[0]==0 ){
8127781452
assert( nRoot>1 );
8127881453
bPartial = 1;
@@ -81341,19 +81516,22 @@
8134181516
}
8134281517
#endif
8134381518
testcase( pBt->db->flags & SQLITE_CellSizeCk );
8134481519
pBt->db->flags &= ~(u64)SQLITE_CellSizeCk;
8134581520
for(i=0; (int)i<nRoot && sCheck.mxErr; i++){
81346
- i64 notUsed;
81347
- if( aRoot[i]==0 ) continue;
81521
+ sCheck.nRow = 0;
81522
+ if( aRoot[i] ){
81523
+ i64 notUsed;
8134881524
#ifndef SQLITE_OMIT_AUTOVACUUM
81349
- if( pBt->autoVacuum && aRoot[i]>1 && !bPartial ){
81350
- checkPtrmap(&sCheck, aRoot[i], PTRMAP_ROOTPAGE, 0);
81525
+ if( pBt->autoVacuum && aRoot[i]>1 && !bPartial ){
81526
+ checkPtrmap(&sCheck, aRoot[i], PTRMAP_ROOTPAGE, 0);
81527
+ }
81528
+#endif
81529
+ sCheck.v0 = aRoot[i];
81530
+ checkTreePage(&sCheck, aRoot[i], &notUsed, LARGEST_INT64);
8135181531
}
81352
-#endif
81353
- sCheck.v0 = aRoot[i];
81354
- checkTreePage(&sCheck, aRoot[i], &notUsed, LARGEST_INT64);
81532
+ sqlite3MemSetArrayInt64(aCnt, i, sCheck.nRow);
8135581533
}
8135681534
pBt->db->flags = savedDbFlags;
8135781535
8135881536
/* Make sure every page in the file is referenced
8135981537
*/
@@ -83403,10 +83581,17 @@
8340383581
}else{
8340483582
pMem->u.i = val;
8340583583
pMem->flags = MEM_Int;
8340683584
}
8340783585
}
83586
+
83587
+/*
83588
+** Set the iIdx'th entry of array aMem[] to contain integer value val.
83589
+*/
83590
+SQLITE_PRIVATE void sqlite3MemSetArrayInt64(sqlite3_value *aMem, int iIdx, i64 val){
83591
+ sqlite3VdbeMemSetInt64(&aMem[iIdx], val);
83592
+}
8340883593
8340983594
/* A no-op destructor */
8341083595
SQLITE_PRIVATE void sqlite3NoopDestructor(void *p){ UNUSED_PARAMETER(p); }
8341183596
8341283597
/*
@@ -85448,10 +85633,19 @@
8544885633
assert( (sqlite3OpcodeProperty[pOp->opcode] & OPFLG_JUMP)!=0 );
8544985634
assert( ADDR(pOp->p2)<-pParse->nLabel );
8545085635
assert( aLabel!=0 ); /* True because of tag-20230419-1 */
8545185636
pOp->p2 = aLabel[ADDR(pOp->p2)];
8545285637
}
85638
+
85639
+ /* OPFLG_JUMP opcodes never have P2==0, though OPFLG_JUMP0 opcodes
85640
+ ** might */
85641
+ assert( pOp->p2>0
85642
+ || (sqlite3OpcodeProperty[pOp->opcode] & OPFLG_JUMP0)!=0 );
85643
+
85644
+ /* Jumps never go off the end of the bytecode array */
85645
+ assert( pOp->p2<p->nOp
85646
+ || (sqlite3OpcodeProperty[pOp->opcode] & OPFLG_JUMP)==0 );
8545385647
break;
8545485648
}
8545585649
}
8545685650
/* The mkopcodeh.tcl script has so arranged things that the only
8545785651
** non-jump opcodes less than SQLITE_MX_JUMP_CODE are guaranteed to
@@ -88568,10 +88762,27 @@
8856888762
assert( sizeof(x)==8 && sizeof(pMem->u.r)==8 );
8856988763
swapMixedEndianFloat(x);
8857088764
memcpy(&pMem->u.r, &x, sizeof(x));
8857188765
pMem->flags = IsNaN(x) ? MEM_Null : MEM_Real;
8857288766
}
88767
+}
88768
+static int serialGet7(
88769
+ const unsigned char *buf, /* Buffer to deserialize from */
88770
+ Mem *pMem /* Memory cell to write value into */
88771
+){
88772
+ u64 x = FOUR_BYTE_UINT(buf);
88773
+ u32 y = FOUR_BYTE_UINT(buf+4);
88774
+ x = (x<<32) + y;
88775
+ assert( sizeof(x)==8 && sizeof(pMem->u.r)==8 );
88776
+ swapMixedEndianFloat(x);
88777
+ memcpy(&pMem->u.r, &x, sizeof(x));
88778
+ if( IsNaN(x) ){
88779
+ pMem->flags = MEM_Null;
88780
+ return 1;
88781
+ }
88782
+ pMem->flags = MEM_Real;
88783
+ return 0;
8857388784
}
8857488785
SQLITE_PRIVATE void sqlite3VdbeSerialGet(
8857588786
const unsigned char *buf, /* Buffer to deserialize from */
8857688787
u32 serial_type, /* Serial type to deserialize */
8857788788
Mem *pMem /* Memory cell to write value into */
@@ -89008,21 +89219,19 @@
8900889219
testcase( x>r );
8900989220
testcase( x==r );
8901089221
return (x<r) ? -1 : (x>r);
8901189222
}else{
8901289223
i64 y;
89013
- double s;
8901489224
if( r<-9223372036854775808.0 ) return +1;
8901589225
if( r>=9223372036854775808.0 ) return -1;
8901689226
y = (i64)r;
8901789227
if( i<y ) return -1;
8901889228
if( i>y ) return +1;
89019
- s = (double)i;
89020
- testcase( doubleLt(s,r) );
89021
- testcase( doubleLt(r,s) );
89022
- testcase( doubleEq(r,s) );
89023
- return (s<r) ? -1 : (s>r);
89229
+ testcase( doubleLt(((double)i),r) );
89230
+ testcase( doubleLt(r,((double)i)) );
89231
+ testcase( doubleEq(r,((double)i)) );
89232
+ return (((double)i)<r) ? -1 : (((double)i)>r);
8902489233
}
8902589234
}
8902689235
8902789236
/*
8902889237
** Compare the values contained by the two memory cells, returning
@@ -89248,11 +89457,11 @@
8924889457
if( serial_type>=10 ){
8924989458
rc = serial_type==10 ? -1 : +1;
8925089459
}else if( serial_type==0 ){
8925189460
rc = -1;
8925289461
}else if( serial_type==7 ){
89253
- sqlite3VdbeSerialGet(&aKey1[d1], serial_type, &mem1);
89462
+ serialGet7(&aKey1[d1], &mem1);
8925489463
rc = -sqlite3IntFloatCompare(pRhs->u.i, mem1.u.r);
8925589464
}else{
8925689465
i64 lhs = vdbeRecordDecodeInt(serial_type, &aKey1[d1]);
8925789466
i64 rhs = pRhs->u.i;
8925889467
if( lhs<rhs ){
@@ -89273,18 +89482,22 @@
8927389482
** them to numeric values are. */
8927489483
rc = serial_type==10 ? -1 : +1;
8927589484
}else if( serial_type==0 ){
8927689485
rc = -1;
8927789486
}else{
89278
- sqlite3VdbeSerialGet(&aKey1[d1], serial_type, &mem1);
8927989487
if( serial_type==7 ){
89280
- if( mem1.u.r<pRhs->u.r ){
89488
+ if( serialGet7(&aKey1[d1], &mem1) ){
89489
+ rc = -1; /* mem1 is a NaN */
89490
+ }else if( mem1.u.r<pRhs->u.r ){
8928189491
rc = -1;
8928289492
}else if( mem1.u.r>pRhs->u.r ){
8928389493
rc = +1;
89494
+ }else{
89495
+ assert( rc==0 );
8928489496
}
8928589497
}else{
89498
+ sqlite3VdbeSerialGet(&aKey1[d1], serial_type, &mem1);
8928689499
rc = sqlite3IntFloatCompare(mem1.u.i, pRhs->u.r);
8928789500
}
8928889501
}
8928989502
}
8929089503
@@ -89350,11 +89563,18 @@
8935089563
}
8935189564
8935289565
/* RHS is null */
8935389566
else{
8935489567
serial_type = aKey1[idx1];
89355
- rc = (serial_type!=0 && serial_type!=10);
89568
+ if( serial_type==0
89569
+ || serial_type==10
89570
+ || (serial_type==7 && serialGet7(&aKey1[d1], &mem1)!=0)
89571
+ ){
89572
+ assert( rc==0 );
89573
+ }else{
89574
+ rc = 1;
89575
+ }
8935689576
}
8935789577
8935889578
if( rc!=0 ){
8935989579
int sortFlags = pPKey2->pKeyInfo->aSortFlags[i];
8936089580
if( sortFlags ){
@@ -93876,11 +94096,11 @@
9387694096
** this opcode. So jump over the coroutine implementation to
9387794097
** address P2.
9387894098
**
9387994099
** See also: EndCoroutine
9388094100
*/
93881
-case OP_InitCoroutine: { /* jump */
94101
+case OP_InitCoroutine: { /* jump0 */
9388294102
assert( pOp->p1>0 && pOp->p1<=(p->nMem+1 - p->nCursor) );
9388394103
assert( pOp->p2>=0 && pOp->p2<p->nOp );
9388494104
assert( pOp->p3>=0 && pOp->p3<p->nOp );
9388594105
pOut = &aMem[pOp->p1];
9388694106
assert( !VdbeMemDynamic(pOut) );
@@ -93929,11 +94149,11 @@
9392994149
** EndCoroutine, then jump to P2 rather than continuing with the
9393094150
** next instruction.
9393194151
**
9393294152
** See also: InitCoroutine
9393394153
*/
93934
-case OP_Yield: { /* in1, jump */
94154
+case OP_Yield: { /* in1, jump0 */
9393594155
int pcDest;
9393694156
pIn1 = &aMem[pOp->p1];
9393794157
assert( VdbeMemDynamic(pIn1)==0 );
9393894158
pIn1->flags = MEM_Int;
9393994159
pcDest = (int)pIn1->u.i;
@@ -94259,23 +94479,19 @@
9425994479
pOut->enc = encoding;
9426094480
UPDATE_MAX_BLOBSIZE(pOut);
9426194481
break;
9426294482
}
9426394483
94264
-/* Opcode: Variable P1 P2 * P4 *
94265
-** Synopsis: r[P2]=parameter(P1,P4)
94484
+/* Opcode: Variable P1 P2 * * *
94485
+** Synopsis: r[P2]=parameter(P1)
9426694486
**
9426794487
** Transfer the values of bound parameter P1 into register P2
94268
-**
94269
-** If the parameter is named, then its name appears in P4.
94270
-** The P4 value is used by sqlite3_bind_parameter_name().
9427194488
*/
9427294489
case OP_Variable: { /* out2 */
9427394490
Mem *pVar; /* Value being transferred */
9427494491
9427594492
assert( pOp->p1>0 && pOp->p1<=p->nVar );
94276
- assert( pOp->p4.z==0 || pOp->p4.z==sqlite3VListNumToName(p->pVList,pOp->p1) );
9427794493
pVar = &p->aVar[pOp->p1 - 1];
9427894494
if( sqlite3VdbeMemTooBig(pVar) ){
9427994495
goto too_big;
9428094496
}
9428194497
pOut = &aMem[pOp->p2];
@@ -94792,11 +95008,11 @@
9479295008
** Force the value in register P1 to be an integer. If the value
9479395009
** in P1 is not an integer and cannot be converted into an integer
9479495010
** without data loss, then jump immediately to P2, or if P2==0
9479595011
** raise an SQLITE_MISMATCH exception.
9479695012
*/
94797
-case OP_MustBeInt: { /* jump, in1 */
95013
+case OP_MustBeInt: { /* jump0, in1 */
9479895014
pIn1 = &aMem[pOp->p1];
9479995015
if( (pIn1->flags & MEM_Int)==0 ){
9480095016
applyAffinity(pIn1, SQLITE_AFF_NUMERIC, encoding);
9480195017
if( (pIn1->flags & MEM_Int)==0 ){
9480295018
VdbeBranchTaken(1, 2);
@@ -97476,14 +97692,14 @@
9747697692
** OPFLAG_SEEKEQ flags is a hint to the btree layer to say that this
9747797693
** is an equality search.
9747897694
**
9747997695
** See also: Found, NotFound, SeekGt, SeekGe, SeekLt
9748097696
*/
97481
-case OP_SeekLT: /* jump, in3, group, ncycle */
97482
-case OP_SeekLE: /* jump, in3, group, ncycle */
97483
-case OP_SeekGE: /* jump, in3, group, ncycle */
97484
-case OP_SeekGT: { /* jump, in3, group, ncycle */
97697
+case OP_SeekLT: /* jump0, in3, group, ncycle */
97698
+case OP_SeekLE: /* jump0, in3, group, ncycle */
97699
+case OP_SeekGE: /* jump0, in3, group, ncycle */
97700
+case OP_SeekGT: { /* jump0, in3, group, ncycle */
9748597701
int res; /* Comparison result */
9748697702
int oc; /* Opcode */
9748797703
VdbeCursor *pC; /* The cursor to seek */
9748897704
UnpackedRecord r; /* The key to seek for */
9748997705
int nField; /* Number of columns or fields in the key */
@@ -98146,11 +98362,11 @@
9814698362
** in either direction. In other words, the Next and Prev opcodes will
9814798363
** not work following this opcode.
9814898364
**
9814998365
** See also: Found, NotFound, NoConflict, SeekRowid
9815098366
*/
98151
-case OP_SeekRowid: { /* jump, in3, ncycle */
98367
+case OP_SeekRowid: { /* jump0, in3, ncycle */
9815298368
VdbeCursor *pC;
9815398369
BtCursor *pCrsr;
9815498370
int res;
9815598371
u64 iKey;
9815698372
@@ -98905,11 +99121,11 @@
9890599121
** This opcode leaves the cursor configured to move in reverse order,
9890699122
** from the end toward the beginning. In other words, the cursor is
9890799123
** configured to use Prev, not Next.
9890899124
*/
9890999125
case OP_SeekEnd: /* ncycle */
98910
-case OP_Last: { /* jump, ncycle */
99126
+case OP_Last: { /* jump0, ncycle */
9891199127
VdbeCursor *pC;
9891299128
BtCursor *pCrsr;
9891399129
int res;
9891499130
9891599131
assert( pOp->p1>=0 && pOp->p1<p->nCursor );
@@ -99022,11 +99238,11 @@
9902299238
**
9902399239
** This opcode leaves the cursor configured to move in forward order,
9902499240
** from the beginning toward the end. In other words, the cursor is
9902599241
** configured to use Next, not Prev.
9902699242
*/
99027
-case OP_Rewind: { /* jump, ncycle */
99243
+case OP_Rewind: { /* jump0, ncycle */
9902899244
VdbeCursor *pC;
9902999245
BtCursor *pCrsr;
9903099246
int res;
9903199247
9903299248
assert( pOp->p1>=0 && pOp->p1<p->nCursor );
@@ -99865,17 +100081,17 @@
99865100081
99866100082
#ifndef SQLITE_OMIT_INTEGRITY_CHECK
99867100083
/* Opcode: IntegrityCk P1 P2 P3 P4 P5
99868100084
**
99869100085
** Do an analysis of the currently open database. Store in
99870
-** register P1 the text of an error message describing any problems.
99871
-** If no problems are found, store a NULL in register P1.
100086
+** register (P1+1) the text of an error message describing any problems.
100087
+** If no problems are found, store a NULL in register (P1+1).
99872100088
**
99873
-** The register P3 contains one less than the maximum number of allowed errors.
99874
-** At most reg(P3) errors will be reported.
99875
-** In other words, the analysis stops as soon as reg(P3) errors are
99876
-** seen. Reg(P3) is updated with the number of errors remaining.
100089
+** The register (P1) contains one less than the maximum number of allowed
100090
+** errors. At most reg(P1) errors will be reported.
100091
+** In other words, the analysis stops as soon as reg(P1) errors are
100092
+** seen. Reg(P1) is updated with the number of errors remaining.
99877100093
**
99878100094
** The root page numbers of all tables in the database are integers
99879100095
** stored in P4_INTARRAY argument.
99880100096
**
99881100097
** If P5 is not zero, the check is done on the auxiliary database
@@ -99889,23 +100105,25 @@
99889100105
int nErr; /* Number of errors reported */
99890100106
char *z; /* Text of the error report */
99891100107
Mem *pnErr; /* Register keeping track of errors remaining */
99892100108
99893100109
assert( p->bIsReader );
100110
+ assert( pOp->p4type==P4_INTARRAY );
99894100111
nRoot = pOp->p2;
99895100112
aRoot = pOp->p4.ai;
99896100113
assert( nRoot>0 );
100114
+ assert( aRoot!=0 );
99897100115
assert( aRoot[0]==(Pgno)nRoot );
99898
- assert( pOp->p3>0 && pOp->p3<=(p->nMem+1 - p->nCursor) );
99899
- pnErr = &aMem[pOp->p3];
100116
+ assert( pOp->p1>0 && (pOp->p1+1)<=(p->nMem+1 - p->nCursor) );
100117
+ pnErr = &aMem[pOp->p1];
99900100118
assert( (pnErr->flags & MEM_Int)!=0 );
99901100119
assert( (pnErr->flags & (MEM_Str|MEM_Blob))==0 );
99902
- pIn1 = &aMem[pOp->p1];
100120
+ pIn1 = &aMem[pOp->p1+1];
99903100121
assert( pOp->p5<db->nDb );
99904100122
assert( DbMaskTest(p->btreeMask, pOp->p5) );
99905
- rc = sqlite3BtreeIntegrityCheck(db, db->aDb[pOp->p5].pBt, &aRoot[1], nRoot,
99906
- (int)pnErr->u.i+1, &nErr, &z);
100123
+ rc = sqlite3BtreeIntegrityCheck(db, db->aDb[pOp->p5].pBt, &aRoot[1],
100124
+ &aMem[pOp->p3], nRoot, (int)pnErr->u.i+1, &nErr, &z);
99907100125
sqlite3VdbeMemSetNull(pIn1);
99908100126
if( nErr==0 ){
99909100127
assert( z==0 );
99910100128
}else if( rc ){
99911100129
sqlite3_free(z);
@@ -100028,19 +100246,21 @@
100028100246
** Execute the trigger program passed as P4 (type P4_SUBPROGRAM).
100029100247
**
100030100248
** P1 contains the address of the memory cell that contains the first memory
100031100249
** cell in an array of values used as arguments to the sub-program. P2
100032100250
** contains the address to jump to if the sub-program throws an IGNORE
100033
-** exception using the RAISE() function. Register P3 contains the address
100251
+** exception using the RAISE() function. P2 might be zero, if there is
100252
+** no possibility that an IGNORE exception will be raised.
100253
+** Register P3 contains the address
100034100254
** of a memory cell in this (the parent) VM that is used to allocate the
100035100255
** memory required by the sub-vdbe at runtime.
100036100256
**
100037100257
** P4 is a pointer to the VM containing the trigger program.
100038100258
**
100039100259
** If P5 is non-zero, then recursive program invocation is enabled.
100040100260
*/
100041
-case OP_Program: { /* jump */
100261
+case OP_Program: { /* jump0 */
100042100262
int nMem; /* Number of memory registers for sub-program */
100043100263
int nByte; /* Bytes of runtime space required for sub-program */
100044100264
Mem *pRt; /* Register to allocate runtime space */
100045100265
Mem *pMem; /* Used to iterate through memory cells */
100046100266
Mem *pEnd; /* Last memory cell in new array */
@@ -101585,11 +101805,11 @@
101585101805
**
101586101806
** If P3 is not zero, then it is an address to jump to if an SQLITE_CORRUPT
101587101807
** error is encountered.
101588101808
*/
101589101809
case OP_Trace:
101590
-case OP_Init: { /* jump */
101810
+case OP_Init: { /* jump0 */
101591101811
int i;
101592101812
#ifndef SQLITE_OMIT_TRACE
101593101813
char *zTrace;
101594101814
#endif
101595101815
@@ -107325,10 +107545,23 @@
107325107545
** If this optimization occurs, also restore the NameContext ref-counts
107326107546
** to the state they where in before the "column" LHS expression was
107327107547
** resolved. This prevents "column" from being counted as having been
107328107548
** referenced, which might prevent a SELECT from being erroneously
107329107549
** marked as correlated.
107550
+ **
107551
+ ** 2024-03-28: Beware of aggregates. A bare column of aggregated table
107552
+ ** can still evaluate to NULL even though it is marked as NOT NULL.
107553
+ ** Example:
107554
+ **
107555
+ ** CREATE TABLE t1(a INT NOT NULL);
107556
+ ** SELECT a, a IS NULL, a IS NOT NULL, count(*) FROM t1;
107557
+ **
107558
+ ** The "a IS NULL" and "a IS NOT NULL" expressions cannot be optimized
107559
+ ** here because at the time this case is hit, we do not yet know whether
107560
+ ** or not t1 is being aggregated. We have to assume the worst and omit
107561
+ ** the optimization. The only time it is safe to apply this optimization
107562
+ ** is within the WHERE clause.
107330107563
*/
107331107564
case TK_NOTNULL:
107332107565
case TK_ISNULL: {
107333107566
int anRef[8];
107334107567
NameContext *p;
@@ -107335,23 +107568,40 @@
107335107568
int i;
107336107569
for(i=0, p=pNC; p && i<ArraySize(anRef); p=p->pNext, i++){
107337107570
anRef[i] = p->nRef;
107338107571
}
107339107572
sqlite3WalkExpr(pWalker, pExpr->pLeft);
107340
- if( 0==sqlite3ExprCanBeNull(pExpr->pLeft) && !IN_RENAME_OBJECT ){
107341
- testcase( ExprHasProperty(pExpr, EP_OuterON) );
107342
- assert( !ExprHasProperty(pExpr, EP_IntValue) );
107343
- pExpr->u.iValue = (pExpr->op==TK_NOTNULL);
107344
- pExpr->flags |= EP_IntValue;
107345
- pExpr->op = TK_INTEGER;
107346
-
107347
- for(i=0, p=pNC; p && i<ArraySize(anRef); p=p->pNext, i++){
107348
- p->nRef = anRef[i];
107349
- }
107350
- sqlite3ExprDelete(pParse->db, pExpr->pLeft);
107351
- pExpr->pLeft = 0;
107352
- }
107573
+ if( IN_RENAME_OBJECT ) return WRC_Prune;
107574
+ if( sqlite3ExprCanBeNull(pExpr->pLeft) ){
107575
+ /* The expression can be NULL. So the optimization does not apply */
107576
+ return WRC_Prune;
107577
+ }
107578
+
107579
+ for(i=0, p=pNC; p; p=p->pNext, i++){
107580
+ if( (p->ncFlags & NC_Where)==0 ){
107581
+ return WRC_Prune; /* Not in a WHERE clause. Unsafe to optimize. */
107582
+ }
107583
+ }
107584
+ testcase( ExprHasProperty(pExpr, EP_OuterON) );
107585
+ assert( !ExprHasProperty(pExpr, EP_IntValue) );
107586
+#if TREETRACE_ENABLED
107587
+ if( sqlite3TreeTrace & 0x80000 ){
107588
+ sqlite3DebugPrintf(
107589
+ "NOT NULL strength reduction converts the following to %d:\n",
107590
+ pExpr->op==TK_NOTNULL
107591
+ );
107592
+ sqlite3ShowExpr(pExpr);
107593
+ }
107594
+#endif /* TREETRACE_ENABLED */
107595
+ pExpr->u.iValue = (pExpr->op==TK_NOTNULL);
107596
+ pExpr->flags |= EP_IntValue;
107597
+ pExpr->op = TK_INTEGER;
107598
+ for(i=0, p=pNC; p && i<ArraySize(anRef); p=p->pNext, i++){
107599
+ p->nRef = anRef[i];
107600
+ }
107601
+ sqlite3ExprDelete(pParse->db, pExpr->pLeft);
107602
+ pExpr->pLeft = 0;
107353107603
return WRC_Prune;
107354107604
}
107355107605
107356107606
/* A column name: ID
107357107607
** Or table name and column name: ID.ID
@@ -108245,11 +108495,13 @@
108245108495
sqlite3ErrorMsg(pParse, "HAVING clause on a non-aggregate query");
108246108496
return WRC_Abort;
108247108497
}
108248108498
if( sqlite3ResolveExprNames(&sNC, p->pHaving) ) return WRC_Abort;
108249108499
}
108500
+ sNC.ncFlags |= NC_Where;
108250108501
if( sqlite3ResolveExprNames(&sNC, p->pWhere) ) return WRC_Abort;
108502
+ sNC.ncFlags &= ~NC_Where;
108251108503
108252108504
/* Resolve names in table-valued-function arguments */
108253108505
for(i=0; i<p->pSrc->nSrc; i++){
108254108506
SrcItem *pItem = &p->pSrc->a[i];
108255108507
if( pItem->fg.isTabFunc
@@ -109480,15 +109732,16 @@
109480109732
** If dequote is false, no dequoting is performed. The deQuote
109481109733
** parameter is ignored if pToken is NULL or if the token does not
109482109734
** appear to be quoted. If the quotes were of the form "..." (double-quotes)
109483109735
** then the EP_DblQuoted flag is set on the expression node.
109484109736
**
109485
-** Special case: If op==TK_INTEGER and pToken points to a string that
109486
-** can be translated into a 32-bit integer, then the token is not
109487
-** stored in u.zToken. Instead, the integer values is written
109488
-** into u.iValue and the EP_IntValue flag is set. No extra storage
109737
+** Special case (tag-20240227-a): If op==TK_INTEGER and pToken points to
109738
+** a string that can be translated into a 32-bit integer, then the token is
109739
+** not stored in u.zToken. Instead, the integer values is written
109740
+** into u.iValue and the EP_IntValue flag is set. No extra storage
109489109741
** is allocated to hold the integer text and the dequote flag is ignored.
109742
+** See also tag-20240227-b.
109490109743
*/
109491109744
SQLITE_PRIVATE Expr *sqlite3ExprAlloc(
109492109745
sqlite3 *db, /* Handle for sqlite3DbMallocRawNN() */
109493109746
int op, /* Expression opcode */
109494109747
const Token *pToken, /* Token argument. Might be NULL */
@@ -109500,11 +109753,11 @@
109500109753
109501109754
assert( db!=0 );
109502109755
if( pToken ){
109503109756
if( op!=TK_INTEGER || pToken->z==0
109504109757
|| sqlite3GetInt32(pToken->z, &iValue)==0 ){
109505
- nExtra = pToken->n+1;
109758
+ nExtra = pToken->n+1; /* tag-20240227-a */
109506109759
assert( iValue>=0 );
109507109760
}
109508109761
}
109509109762
pNew = sqlite3DbMallocRawNN(db, sizeof(Expr)+nExtra);
109510109763
if( pNew ){
@@ -113182,16 +113435,10 @@
113182113435
case TK_VARIABLE: {
113183113436
assert( !ExprHasProperty(pExpr, EP_IntValue) );
113184113437
assert( pExpr->u.zToken!=0 );
113185113438
assert( pExpr->u.zToken[0]!=0 );
113186113439
sqlite3VdbeAddOp2(v, OP_Variable, pExpr->iColumn, target);
113187
- if( pExpr->u.zToken[1]!=0 ){
113188
- const char *z = sqlite3VListNumToName(pParse->pVList, pExpr->iColumn);
113189
- assert( pExpr->u.zToken[0]=='?' || (z && !strcmp(pExpr->u.zToken, z)) );
113190
- pParse->pVList[0] = 0; /* Indicate VList may no longer be enlarged */
113191
- sqlite3VdbeAppendP4(v, (char*)z, P4_STATIC);
113192
- }
113193113440
return target;
113194113441
}
113195113442
case TK_REGISTER: {
113196113443
return pExpr->iTable;
113197113444
}
@@ -119190,10 +119437,11 @@
119190119437
119191119438
/* No STAT4 data is generated if the number of rows is zero */
119192119439
if( addrGotoEnd==0 ){
119193119440
sqlite3VdbeAddOp2(v, OP_Cast, regStat1, SQLITE_AFF_INTEGER);
119194119441
addrGotoEnd = sqlite3VdbeAddOp1(v, OP_IfNot, regStat1);
119442
+ VdbeCoverage(v);
119195119443
}
119196119444
119197119445
if( doOnce ){
119198119446
int mxCol = nCol;
119199119447
Index *pX;
@@ -129185,17 +129433,17 @@
129185129433
switch( sqlite3_value_type(pValue) ){
129186129434
case SQLITE_FLOAT: {
129187129435
double r1, r2;
129188129436
const char *zVal;
129189129437
r1 = sqlite3_value_double(pValue);
129190
- sqlite3_str_appendf(pStr, "%!.15g", r1);
129438
+ sqlite3_str_appendf(pStr, "%!0.15g", r1);
129191129439
zVal = sqlite3_str_value(pStr);
129192129440
if( zVal ){
129193129441
sqlite3AtoF(zVal, &r2, pStr->nChar, SQLITE_UTF8);
129194129442
if( r1!=r2 ){
129195129443
sqlite3_str_reset(pStr);
129196
- sqlite3_str_appendf(pStr, "%!.20e", r1);
129444
+ sqlite3_str_appendf(pStr, "%!0.20e", r1);
129197129445
}
129198129446
}
129199129447
break;
129200129448
}
129201129449
case SQLITE_INTEGER: {
@@ -133413,11 +133661,11 @@
133413133661
pNx->pUpsertSrc = pTabList;
133414133662
pNx->regData = regData;
133415133663
pNx->iDataCur = iDataCur;
133416133664
pNx->iIdxCur = iIdxCur;
133417133665
if( pNx->pUpsertTarget ){
133418
- if( sqlite3UpsertAnalyzeTarget(pParse, pTabList, pNx) ){
133666
+ if( sqlite3UpsertAnalyzeTarget(pParse, pTabList, pNx, pUpsert) ){
133419133667
goto insert_cleanup;
133420133668
}
133421133669
}
133422133670
pNx = pNx->pNextUpsert;
133423133671
}while( pNx!=0 );
@@ -139670,11 +139918,10 @@
139670139918
for(i=0; i<db->nDb; i++){
139671139919
HashElem *x; /* For looping over tables in the schema */
139672139920
Hash *pTbls; /* Set of all tables in the schema */
139673139921
int *aRoot; /* Array of root page numbers of all btrees */
139674139922
int cnt = 0; /* Number of entries in aRoot[] */
139675
- int mxIdx = 0; /* Maximum number of indexes for any table */
139676139923
139677139924
if( OMIT_TEMPDB && i==1 ) continue;
139678139925
if( iDb>=0 && i!=iDb ) continue;
139679139926
139680139927
sqlite3CodeVerifySchema(pParse, i);
@@ -139692,11 +139939,10 @@
139692139939
Index *pIdx; /* An index on pTab */
139693139940
int nIdx; /* Number of indexes on pTab */
139694139941
if( pObjTab && pObjTab!=pTab ) continue;
139695139942
if( HasRowid(pTab) ) cnt++;
139696139943
for(nIdx=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, nIdx++){ cnt++; }
139697
- if( nIdx>mxIdx ) mxIdx = nIdx;
139698139944
}
139699139945
if( cnt==0 ) continue;
139700139946
if( pObjTab ) cnt++;
139701139947
aRoot = sqlite3DbMallocRawNN(db, sizeof(int)*(cnt+1));
139702139948
if( aRoot==0 ) break;
@@ -139712,23 +139958,53 @@
139712139958
}
139713139959
}
139714139960
aRoot[0] = cnt;
139715139961
139716139962
/* Make sure sufficient number of registers have been allocated */
139717
- sqlite3TouchRegister(pParse, 8+mxIdx);
139963
+ sqlite3TouchRegister(pParse, 8+cnt);
139718139964
sqlite3ClearTempRegCache(pParse);
139719139965
139720139966
/* Do the b-tree integrity checks */
139721
- sqlite3VdbeAddOp4(v, OP_IntegrityCk, 2, cnt, 1, (char*)aRoot,P4_INTARRAY);
139967
+ sqlite3VdbeAddOp4(v, OP_IntegrityCk, 1, cnt, 8, (char*)aRoot,P4_INTARRAY);
139722139968
sqlite3VdbeChangeP5(v, (u8)i);
139723139969
addr = sqlite3VdbeAddOp1(v, OP_IsNull, 2); VdbeCoverage(v);
139724139970
sqlite3VdbeAddOp4(v, OP_String8, 0, 3, 0,
139725139971
sqlite3MPrintf(db, "*** in database %s ***\n", db->aDb[i].zDbSName),
139726139972
P4_DYNAMIC);
139727139973
sqlite3VdbeAddOp3(v, OP_Concat, 2, 3, 3);
139728139974
integrityCheckResultRow(v);
139729139975
sqlite3VdbeJumpHere(v, addr);
139976
+
139977
+ /* Check that the indexes all have the right number of rows */
139978
+ cnt = pObjTab ? 1 : 0;
139979
+ sqlite3VdbeLoadString(v, 2, "wrong # of entries in index ");
139980
+ for(x=sqliteHashFirst(pTbls); x; x=sqliteHashNext(x)){
139981
+ int iTab = 0;
139982
+ Table *pTab = sqliteHashData(x);
139983
+ Index *pIdx;
139984
+ if( pObjTab && pObjTab!=pTab ) continue;
139985
+ if( HasRowid(pTab) ){
139986
+ iTab = cnt++;
139987
+ }else{
139988
+ iTab = cnt;
139989
+ for(pIdx=pTab->pIndex; ALWAYS(pIdx); pIdx=pIdx->pNext){
139990
+ if( IsPrimaryKeyIndex(pIdx) ) break;
139991
+ iTab++;
139992
+ }
139993
+ }
139994
+ for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){
139995
+ if( pIdx->pPartIdxWhere==0 ){
139996
+ addr = sqlite3VdbeAddOp3(v, OP_Eq, 8+cnt, 0, 8+iTab);
139997
+ VdbeCoverageNeverNull(v);
139998
+ sqlite3VdbeLoadString(v, 4, pIdx->zName);
139999
+ sqlite3VdbeAddOp3(v, OP_Concat, 4, 2, 3);
140000
+ integrityCheckResultRow(v);
140001
+ sqlite3VdbeJumpHere(v, addr);
140002
+ }
140003
+ cnt++;
140004
+ }
140005
+ }
139730140006
139731140007
/* Make sure all the indices are constructed correctly.
139732140008
*/
139733140009
for(x=sqliteHashFirst(pTbls); x; x=sqliteHashNext(x)){
139734140010
Table *pTab = sqliteHashData(x);
@@ -140049,25 +140325,13 @@
140049140325
sqlite3ResolvePartIdxLabel(pParse, jmp3);
140050140326
}
140051140327
}
140052140328
sqlite3VdbeAddOp2(v, OP_Next, iDataCur, loopTop); VdbeCoverage(v);
140053140329
sqlite3VdbeJumpHere(v, loopTop-1);
140054
- if( !isQuick ){
140055
- sqlite3VdbeLoadString(v, 2, "wrong # of entries in index ");
140056
- for(j=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, j++){
140057
- if( pPk==pIdx ) continue;
140058
- sqlite3VdbeAddOp2(v, OP_Count, iIdxCur+j, 3);
140059
- addr = sqlite3VdbeAddOp3(v, OP_Eq, 8+j, 0, 3); VdbeCoverage(v);
140060
- sqlite3VdbeChangeP5(v, SQLITE_NOTNULL);
140061
- sqlite3VdbeLoadString(v, 4, pIdx->zName);
140062
- sqlite3VdbeAddOp3(v, OP_Concat, 4, 2, 3);
140063
- integrityCheckResultRow(v);
140064
- sqlite3VdbeJumpHere(v, addr);
140065
- }
140066
- if( pPk ){
140067
- sqlite3ReleaseTempRange(pParse, r2, pPk->nKeyCol);
140068
- }
140330
+ if( pPk ){
140331
+ assert( !isQuick );
140332
+ sqlite3ReleaseTempRange(pParse, r2, pPk->nKeyCol);
140069140333
}
140070140334
}
140071140335
140072140336
#ifndef SQLITE_OMIT_VIRTUALTABLE
140073140337
/* Second pass to invoke the xIntegrity method on all virtual
@@ -153828,11 +154092,12 @@
153828154092
** is wrong.
153829154093
*/
153830154094
SQLITE_PRIVATE int sqlite3UpsertAnalyzeTarget(
153831154095
Parse *pParse, /* The parsing context */
153832154096
SrcList *pTabList, /* Table into which we are inserting */
153833
- Upsert *pUpsert /* The ON CONFLICT clauses */
154097
+ Upsert *pUpsert, /* The ON CONFLICT clauses */
154098
+ Upsert *pAll /* Complete list of all ON CONFLICT clauses */
153834154099
){
153835154100
Table *pTab; /* That table into which we are inserting */
153836154101
int rc; /* Result code */
153837154102
int iCursor; /* Cursor used by pTab */
153838154103
Index *pIdx; /* One of the indexes of pTab */
@@ -153931,10 +154196,18 @@
153931154196
/* Column ii of the index did not match any term of the conflict target.
153932154197
** Continue the search with the next index. */
153933154198
continue;
153934154199
}
153935154200
pUpsert->pUpsertIdx = pIdx;
154201
+ if( sqlite3UpsertOfIndex(pAll,pIdx)!=pUpsert ){
154202
+ /* Really this should be an error. The isDup ON CONFLICT clause will
154203
+ ** never fire. But this problem was not discovered until three years
154204
+ ** after multi-CONFLICT upsert was added, and so we silently ignore
154205
+ ** the problem to prevent breaking applications that might actually
154206
+ ** have redundant ON CONFLICT clauses. */
154207
+ pUpsert->isDup = 1;
154208
+ }
153936154209
break;
153937154210
}
153938154211
if( pUpsert->pUpsertIdx==0 ){
153939154212
char zWhich[16];
153940154213
if( nClause==0 && pUpsert->pNextUpsert==0 ){
@@ -153957,13 +154230,17 @@
153957154230
*/
153958154231
SQLITE_PRIVATE int sqlite3UpsertNextIsIPK(Upsert *pUpsert){
153959154232
Upsert *pNext;
153960154233
if( NEVER(pUpsert==0) ) return 0;
153961154234
pNext = pUpsert->pNextUpsert;
153962
- if( pNext==0 ) return 1;
153963
- if( pNext->pUpsertTarget==0 ) return 1;
153964
- if( pNext->pUpsertIdx==0 ) return 1;
154235
+ while( 1 /*exit-by-return*/ ){
154236
+ if( pNext==0 ) return 1;
154237
+ if( pNext->pUpsertTarget==0 ) return 1;
154238
+ if( pNext->pUpsertIdx==0 ) return 1;
154239
+ if( !pNext->isDup ) return 0;
154240
+ pNext = pNext->pNextUpsert;
154241
+ }
153965154242
return 0;
153966154243
}
153967154244
153968154245
/*
153969154246
** Given the list of ON CONFLICT clauses described by pUpsert, and
@@ -160255,11 +160532,11 @@
160255160532
if( pIdx->aColExpr==0 ) continue;
160256160533
for(i=0; i<pIdx->nKeyCol; i++){
160257160534
if( pIdx->aiColumn[i]!=XN_EXPR ) continue;
160258160535
assert( pIdx->bHasExpr );
160259160536
if( sqlite3ExprCompareSkip(pExpr,pIdx->aColExpr->a[i].pExpr,iCur)==0
160260
- && pExpr->op!=TK_STRING
160537
+ && !sqlite3ExprIsConstant(pIdx->aColExpr->a[i].pExpr)
160261160538
){
160262160539
aiCurCol[0] = iCur;
160263160540
aiCurCol[1] = XN_EXPR;
160264160541
return 1;
160265160542
}
@@ -164114,11 +164391,13 @@
164114164391
assert( pNew->u.btree.nBtm==0 );
164115164392
opMask = WO_EQ|WO_IN|WO_GT|WO_GE|WO_LT|WO_LE|WO_ISNULL|WO_IS;
164116164393
}
164117164394
if( pProbe->bUnordered || pProbe->bLowQual ){
164118164395
if( pProbe->bUnordered ) opMask &= ~(WO_GT|WO_GE|WO_LT|WO_LE);
164119
- if( pProbe->bLowQual ) opMask &= ~(WO_EQ|WO_IN|WO_IS);
164396
+ if( pProbe->bLowQual && pSrc->fg.isIndexedBy==0 ){
164397
+ opMask &= ~(WO_EQ|WO_IN|WO_IS);
164398
+ }
164120164399
}
164121164400
164122164401
assert( pNew->u.btree.nEq<pProbe->nColumn );
164123164402
assert( pNew->u.btree.nEq<pProbe->nKeyCol
164124164403
|| pProbe->idxType!=SQLITE_IDXTYPE_PRIMARYKEY );
@@ -171696,12 +171975,13 @@
171696171975
#define TK_SELECT_COLUMN 178
171697171976
#define TK_IF_NULL_ROW 179
171698171977
#define TK_ASTERISK 180
171699171978
#define TK_SPAN 181
171700171979
#define TK_ERROR 182
171701
-#define TK_SPACE 183
171702
-#define TK_ILLEGAL 184
171980
+#define TK_QNUMBER 183
171981
+#define TK_SPACE 184
171982
+#define TK_ILLEGAL 185
171703171983
#endif
171704171984
/**************** End token definitions ***************************************/
171705171985
171706171986
/* The next sections is a series of control #defines.
171707171987
** various aspects of the generated parser.
@@ -171762,35 +172042,35 @@
171762172042
#ifndef INTERFACE
171763172043
# define INTERFACE 1
171764172044
#endif
171765172045
/************* Begin control #defines *****************************************/
171766172046
#define YYCODETYPE unsigned short int
171767
-#define YYNOCODE 319
172047
+#define YYNOCODE 320
171768172048
#define YYACTIONTYPE unsigned short int
171769172049
#define YYWILDCARD 101
171770172050
#define sqlite3ParserTOKENTYPE Token
171771172051
typedef union {
171772172052
int yyinit;
171773172053
sqlite3ParserTOKENTYPE yy0;
171774
- TriggerStep* yy33;
171775
- Window* yy41;
171776
- Select* yy47;
171777
- SrcList* yy131;
171778
- struct TrigEvent yy180;
171779
- struct {int value; int mask;} yy231;
171780
- IdList* yy254;
171781
- u32 yy285;
171782
- ExprList* yy322;
171783
- Cte* yy385;
171784
- int yy394;
171785
- Upsert* yy444;
171786
- u8 yy516;
171787
- With* yy521;
171788
- const char* yy522;
171789
- Expr* yy528;
171790
- OnOrUsing yy561;
171791
- struct FrameBound yy595;
172054
+ Expr* yy2;
172055
+ Window* yy3;
172056
+ Cte* yy79;
172057
+ int yy92;
172058
+ With* yy131;
172059
+ struct TrigEvent yy210;
172060
+ Upsert* yy258;
172061
+ Select* yy299;
172062
+ OnOrUsing yy305;
172063
+ struct FrameBound yy337;
172064
+ TriggerStep* yy347;
172065
+ struct {int value; int mask;} yy367;
172066
+ SrcList* yy387;
172067
+ IdList* yy400;
172068
+ ExprList* yy402;
172069
+ u8 yy498;
172070
+ u32 yy527;
172071
+ const char* yy616;
171792172072
} YYMINORTYPE;
171793172073
#ifndef YYSTACKDEPTH
171794172074
#define YYSTACKDEPTH 100
171795172075
#endif
171796172076
#define sqlite3ParserARG_SDECL
@@ -171806,23 +172086,23 @@
171806172086
#define sqlite3ParserCTX_PARAM ,pParse
171807172087
#define sqlite3ParserCTX_FETCH Parse *pParse=yypParser->pParse;
171808172088
#define sqlite3ParserCTX_STORE yypParser->pParse=pParse;
171809172089
#define YYFALLBACK 1
171810172090
#define YYNSTATE 579
171811
-#define YYNRULE 405
171812
-#define YYNRULE_WITH_ACTION 340
171813
-#define YYNTOKEN 185
172091
+#define YYNRULE 406
172092
+#define YYNRULE_WITH_ACTION 341
172093
+#define YYNTOKEN 186
171814172094
#define YY_MAX_SHIFT 578
171815
-#define YY_MIN_SHIFTREDUCE 838
171816
-#define YY_MAX_SHIFTREDUCE 1242
171817
-#define YY_ERROR_ACTION 1243
171818
-#define YY_ACCEPT_ACTION 1244
171819
-#define YY_NO_ACTION 1245
171820
-#define YY_MIN_REDUCE 1246
171821
-#define YY_MAX_REDUCE 1650
171822
-#define YY_MIN_DSTRCTR 204
171823
-#define YY_MAX_DSTRCTR 316
172095
+#define YY_MIN_SHIFTREDUCE 839
172096
+#define YY_MAX_SHIFTREDUCE 1244
172097
+#define YY_ERROR_ACTION 1245
172098
+#define YY_ACCEPT_ACTION 1246
172099
+#define YY_NO_ACTION 1247
172100
+#define YY_MIN_REDUCE 1248
172101
+#define YY_MAX_REDUCE 1653
172102
+#define YY_MIN_DSTRCTR 205
172103
+#define YY_MAX_DSTRCTR 317
171824172104
/************* End control #defines *******************************************/
171825172105
#define YY_NLOOKAHEAD ((int)(sizeof(yy_lookahead)/sizeof(yy_lookahead[0])))
171826172106
171827172107
/* Define the yytestcase() macro to be a no-op if is not already defined
171828172108
** otherwise.
@@ -171901,623 +172181,626 @@
171901172181
** yy_reduce_ofst[] For each state, the offset into yy_action for
171902172182
** shifting non-terminals after a reduce.
171903172183
** yy_default[] Default action for each state.
171904172184
**
171905172185
*********** Begin parsing tables **********************************************/
171906
-#define YY_ACTTAB_COUNT (2100)
172186
+#define YY_ACTTAB_COUNT (2114)
171907172187
static const YYACTIONTYPE yy_action[] = {
171908172188
/* 0 */ 572, 210, 572, 119, 116, 231, 572, 119, 116, 231,
171909
- /* 10 */ 572, 1317, 379, 1296, 410, 566, 566, 566, 572, 411,
171910
- /* 20 */ 380, 1317, 1279, 42, 42, 42, 42, 210, 1529, 72,
171911
- /* 30 */ 72, 974, 421, 42, 42, 495, 305, 281, 305, 975,
171912
- /* 40 */ 399, 72, 72, 126, 127, 81, 1217, 1217, 1054, 1057,
171913
- /* 50 */ 1044, 1044, 124, 124, 125, 125, 125, 125, 480, 411,
171914
- /* 60 */ 1244, 1, 1, 578, 2, 1248, 554, 119, 116, 231,
171915
- /* 70 */ 319, 484, 147, 484, 528, 119, 116, 231, 533, 1330,
171916
- /* 80 */ 419, 527, 143, 126, 127, 81, 1217, 1217, 1054, 1057,
171917
- /* 90 */ 1044, 1044, 124, 124, 125, 125, 125, 125, 119, 116,
172189
+ /* 10 */ 572, 1319, 379, 1298, 410, 566, 566, 566, 572, 411,
172190
+ /* 20 */ 380, 1319, 1281, 42, 42, 42, 42, 210, 1531, 72,
172191
+ /* 30 */ 72, 975, 421, 42, 42, 495, 305, 281, 305, 976,
172192
+ /* 40 */ 399, 72, 72, 126, 127, 81, 1219, 1219, 1055, 1058,
172193
+ /* 50 */ 1045, 1045, 124, 124, 125, 125, 125, 125, 480, 411,
172194
+ /* 60 */ 1246, 1, 1, 578, 2, 1250, 554, 119, 116, 231,
172195
+ /* 70 */ 319, 484, 147, 484, 528, 119, 116, 231, 533, 1332,
172196
+ /* 80 */ 419, 527, 143, 126, 127, 81, 1219, 1219, 1055, 1058,
172197
+ /* 90 */ 1045, 1045, 124, 124, 125, 125, 125, 125, 119, 116,
171918172198
/* 100 */ 231, 329, 123, 123, 123, 123, 122, 122, 121, 121,
171919172199
/* 110 */ 121, 120, 117, 448, 286, 286, 286, 286, 446, 446,
171920
- /* 120 */ 446, 1568, 378, 1570, 1193, 377, 1164, 569, 1164, 569,
171921
- /* 130 */ 411, 1568, 541, 261, 228, 448, 102, 146, 453, 318,
172200
+ /* 120 */ 446, 1570, 378, 1572, 1195, 377, 1165, 569, 1165, 569,
172201
+ /* 130 */ 411, 1570, 541, 261, 228, 448, 102, 146, 453, 318,
171922172202
/* 140 */ 563, 242, 123, 123, 123, 123, 122, 122, 121, 121,
171923
- /* 150 */ 121, 120, 117, 448, 126, 127, 81, 1217, 1217, 1054,
171924
- /* 160 */ 1057, 1044, 1044, 124, 124, 125, 125, 125, 125, 143,
171925
- /* 170 */ 296, 1193, 341, 452, 121, 121, 121, 120, 117, 448,
171926
- /* 180 */ 128, 1193, 1194, 1193, 149, 445, 444, 572, 120, 117,
172203
+ /* 150 */ 121, 120, 117, 448, 126, 127, 81, 1219, 1219, 1055,
172204
+ /* 160 */ 1058, 1045, 1045, 124, 124, 125, 125, 125, 125, 143,
172205
+ /* 170 */ 296, 1195, 341, 452, 121, 121, 121, 120, 117, 448,
172206
+ /* 180 */ 128, 1195, 1196, 1195, 149, 445, 444, 572, 120, 117,
171927172207
/* 190 */ 448, 125, 125, 125, 125, 118, 123, 123, 123, 123,
171928
- /* 200 */ 122, 122, 121, 121, 121, 120, 117, 448, 458, 114,
171929
- /* 210 */ 13, 13, 550, 123, 123, 123, 123, 122, 122, 121,
171930
- /* 220 */ 121, 121, 120, 117, 448, 424, 318, 563, 1193, 1194,
171931
- /* 230 */ 1193, 150, 1225, 411, 1225, 125, 125, 125, 125, 123,
172208
+ /* 200 */ 122, 122, 121, 121, 121, 120, 117, 448, 458, 1284,
172209
+ /* 210 */ 13, 13, 130, 123, 123, 123, 123, 122, 122, 121,
172210
+ /* 220 */ 121, 121, 120, 117, 448, 424, 318, 563, 1195, 1196,
172211
+ /* 230 */ 1195, 162, 1227, 411, 1227, 125, 125, 125, 125, 123,
171932172212
/* 240 */ 123, 123, 123, 122, 122, 121, 121, 121, 120, 117,
171933
- /* 250 */ 448, 469, 344, 1041, 1041, 1055, 1058, 126, 127, 81,
171934
- /* 260 */ 1217, 1217, 1054, 1057, 1044, 1044, 124, 124, 125, 125,
171935
- /* 270 */ 125, 125, 1282, 526, 224, 1193, 572, 411, 226, 519,
172213
+ /* 250 */ 448, 469, 344, 1042, 1042, 1056, 1059, 126, 127, 81,
172214
+ /* 260 */ 1219, 1219, 1055, 1058, 1045, 1045, 124, 124, 125, 125,
172215
+ /* 270 */ 125, 125, 1102, 1102, 492, 1195, 572, 411, 226, 519,
171936172216
/* 280 */ 177, 83, 84, 123, 123, 123, 123, 122, 122, 121,
171937
- /* 290 */ 121, 121, 120, 117, 448, 1010, 16, 16, 1193, 134,
171938
- /* 300 */ 134, 126, 127, 81, 1217, 1217, 1054, 1057, 1044, 1044,
172217
+ /* 290 */ 121, 121, 120, 117, 448, 1011, 408, 407, 1195, 72,
172218
+ /* 300 */ 72, 126, 127, 81, 1219, 1219, 1055, 1058, 1045, 1045,
171939172219
/* 310 */ 124, 124, 125, 125, 125, 125, 123, 123, 123, 123,
171940
- /* 320 */ 122, 122, 121, 121, 121, 120, 117, 448, 1045, 550,
171941
- /* 330 */ 1193, 375, 1193, 1194, 1193, 254, 1438, 401, 508, 505,
171942
- /* 340 */ 504, 112, 564, 570, 4, 929, 929, 435, 503, 342,
171943
- /* 350 */ 464, 330, 362, 396, 1238, 1193, 1194, 1193, 567, 572,
172220
+ /* 320 */ 122, 122, 121, 121, 121, 120, 117, 448, 1046, 1615,
172221
+ /* 330 */ 1195, 905, 1195, 1196, 1195, 254, 314, 401, 508, 505,
172222
+ /* 340 */ 504, 112, 564, 570, 4, 930, 930, 435, 503, 342,
172223
+ /* 350 */ 464, 330, 362, 517, 327, 1195, 1196, 1195, 567, 572,
171944172224
/* 360 */ 123, 123, 123, 123, 122, 122, 121, 121, 121, 120,
171945
- /* 370 */ 117, 448, 286, 286, 371, 1581, 1607, 445, 444, 155,
171946
- /* 380 */ 411, 449, 72, 72, 1289, 569, 1222, 1193, 1194, 1193,
171947
- /* 390 */ 86, 1224, 273, 561, 547, 520, 520, 572, 99, 1223,
171948
- /* 400 */ 6, 1281, 476, 143, 126, 127, 81, 1217, 1217, 1054,
171949
- /* 410 */ 1057, 1044, 1044, 124, 124, 125, 125, 125, 125, 554,
171950
- /* 420 */ 13, 13, 1031, 511, 1225, 1193, 1225, 553, 110, 110,
171951
- /* 430 */ 224, 572, 1239, 177, 572, 429, 111, 199, 449, 573,
171952
- /* 440 */ 449, 432, 1555, 1019, 327, 555, 1193, 272, 289, 370,
172225
+ /* 370 */ 117, 448, 286, 286, 844, 845, 846, 445, 444, 1198,
172226
+ /* 380 */ 411, 449, 72, 72, 12, 569, 1224, 1195, 1196, 1195,
172227
+ /* 390 */ 86, 1226, 273, 561, 1440, 520, 520, 572, 375, 1225,
172228
+ /* 400 */ 6, 1283, 476, 143, 126, 127, 81, 1219, 1219, 1055,
172229
+ /* 410 */ 1058, 1045, 1045, 124, 124, 125, 125, 125, 125, 554,
172230
+ /* 420 */ 13, 13, 1032, 511, 1227, 1195, 1227, 553, 110, 110,
172231
+ /* 430 */ 224, 572, 371, 1583, 572, 429, 111, 1198, 449, 573,
172232
+ /* 440 */ 449, 432, 375, 1020, 1495, 555, 155, 272, 289, 370,
171953172233
/* 450 */ 514, 365, 513, 259, 72, 72, 547, 72, 72, 361,
171954
- /* 460 */ 318, 563, 1613, 123, 123, 123, 123, 122, 122, 121,
171955
- /* 470 */ 121, 121, 120, 117, 448, 1019, 1019, 1021, 1022, 28,
171956
- /* 480 */ 286, 286, 1193, 1194, 1193, 1159, 572, 1612, 411, 904,
171957
- /* 490 */ 192, 554, 358, 569, 554, 940, 537, 521, 1159, 437,
171958
- /* 500 */ 415, 1159, 556, 1193, 1194, 1193, 572, 548, 548, 52,
171959
- /* 510 */ 52, 216, 126, 127, 81, 1217, 1217, 1054, 1057, 1044,
171960
- /* 520 */ 1044, 124, 124, 125, 125, 125, 125, 1193, 478, 136,
171961
- /* 530 */ 136, 411, 286, 286, 1493, 509, 122, 122, 121, 121,
171962
- /* 540 */ 121, 120, 117, 448, 1010, 569, 522, 219, 545, 545,
171963
- /* 550 */ 318, 563, 143, 6, 536, 126, 127, 81, 1217, 1217,
171964
- /* 560 */ 1054, 1057, 1044, 1044, 124, 124, 125, 125, 125, 125,
171965
- /* 570 */ 1557, 123, 123, 123, 123, 122, 122, 121, 121, 121,
171966
- /* 580 */ 120, 117, 448, 489, 1193, 1194, 1193, 486, 283, 1270,
171967
- /* 590 */ 960, 254, 1193, 375, 508, 505, 504, 1193, 342, 574,
171968
- /* 600 */ 1193, 574, 411, 294, 503, 960, 879, 193, 484, 318,
171969
- /* 610 */ 563, 386, 292, 382, 123, 123, 123, 123, 122, 122,
171970
- /* 620 */ 121, 121, 121, 120, 117, 448, 126, 127, 81, 1217,
171971
- /* 630 */ 1217, 1054, 1057, 1044, 1044, 124, 124, 125, 125, 125,
171972
- /* 640 */ 125, 411, 396, 1139, 1193, 872, 101, 286, 286, 1193,
171973
- /* 650 */ 1194, 1193, 375, 1096, 1193, 1194, 1193, 1193, 1194, 1193,
171974
- /* 660 */ 569, 459, 33, 375, 235, 126, 127, 81, 1217, 1217,
171975
- /* 670 */ 1054, 1057, 1044, 1044, 124, 124, 125, 125, 125, 125,
171976
- /* 680 */ 1437, 962, 572, 230, 961, 123, 123, 123, 123, 122,
171977
- /* 690 */ 122, 121, 121, 121, 120, 117, 448, 1159, 230, 1193,
171978
- /* 700 */ 158, 1193, 1194, 1193, 1556, 13, 13, 303, 960, 1233,
171979
- /* 710 */ 1159, 154, 411, 1159, 375, 1584, 1177, 5, 371, 1581,
171980
- /* 720 */ 431, 1239, 3, 960, 123, 123, 123, 123, 122, 122,
171981
- /* 730 */ 121, 121, 121, 120, 117, 448, 126, 127, 81, 1217,
171982
- /* 740 */ 1217, 1054, 1057, 1044, 1044, 124, 124, 125, 125, 125,
171983
- /* 750 */ 125, 411, 210, 571, 1193, 1032, 1193, 1194, 1193, 1193,
171984
- /* 760 */ 390, 855, 156, 1555, 376, 404, 1101, 1101, 492, 572,
171985
- /* 770 */ 469, 344, 1322, 1322, 1555, 126, 127, 81, 1217, 1217,
171986
- /* 780 */ 1054, 1057, 1044, 1044, 124, 124, 125, 125, 125, 125,
171987
- /* 790 */ 130, 572, 13, 13, 532, 123, 123, 123, 123, 122,
171988
- /* 800 */ 122, 121, 121, 121, 120, 117, 448, 304, 572, 457,
171989
- /* 810 */ 229, 1193, 1194, 1193, 13, 13, 1193, 1194, 1193, 1300,
171990
- /* 820 */ 467, 1270, 411, 1320, 1320, 1555, 1015, 457, 456, 436,
171991
- /* 830 */ 301, 72, 72, 1268, 123, 123, 123, 123, 122, 122,
171992
- /* 840 */ 121, 121, 121, 120, 117, 448, 126, 127, 81, 1217,
171993
- /* 850 */ 1217, 1054, 1057, 1044, 1044, 124, 124, 125, 125, 125,
171994
- /* 860 */ 125, 411, 384, 1076, 1159, 286, 286, 421, 314, 280,
171995
- /* 870 */ 280, 287, 287, 461, 408, 407, 1539, 1159, 569, 572,
171996
- /* 880 */ 1159, 1196, 569, 409, 569, 126, 127, 81, 1217, 1217,
171997
- /* 890 */ 1054, 1057, 1044, 1044, 124, 124, 125, 125, 125, 125,
171998
- /* 900 */ 457, 1485, 13, 13, 1541, 123, 123, 123, 123, 122,
171999
- /* 910 */ 122, 121, 121, 121, 120, 117, 448, 202, 572, 462,
172000
- /* 920 */ 1587, 578, 2, 1248, 843, 844, 845, 1563, 319, 409,
172001
- /* 930 */ 147, 6, 411, 257, 256, 255, 208, 1330, 9, 1196,
172002
- /* 940 */ 264, 72, 72, 1436, 123, 123, 123, 123, 122, 122,
172003
- /* 950 */ 121, 121, 121, 120, 117, 448, 126, 127, 81, 1217,
172004
- /* 960 */ 1217, 1054, 1057, 1044, 1044, 124, 124, 125, 125, 125,
172005
- /* 970 */ 125, 572, 286, 286, 572, 1213, 411, 577, 315, 1248,
172006
- /* 980 */ 421, 371, 1581, 356, 319, 569, 147, 495, 529, 1644,
172007
- /* 990 */ 397, 935, 495, 1330, 71, 71, 934, 72, 72, 242,
172008
- /* 1000 */ 1328, 105, 81, 1217, 1217, 1054, 1057, 1044, 1044, 124,
172234
+ /* 460 */ 318, 563, 485, 123, 123, 123, 123, 122, 122, 121,
172235
+ /* 470 */ 121, 121, 120, 117, 448, 1020, 1020, 1022, 1023, 28,
172236
+ /* 480 */ 286, 286, 1195, 1196, 1195, 1160, 1616, 210, 411, 1610,
172237
+ /* 490 */ 158, 554, 358, 569, 554, 390, 537, 1291, 1160, 437,
172238
+ /* 500 */ 404, 1160, 556, 1565, 572, 1179, 572, 6, 9, 1557,
172239
+ /* 510 */ 264, 216, 126, 127, 81, 1219, 1219, 1055, 1058, 1045,
172240
+ /* 520 */ 1045, 124, 124, 125, 125, 125, 125, 13, 13, 13,
172241
+ /* 530 */ 13, 411, 577, 254, 1250, 509, 508, 505, 504, 319,
172242
+ /* 540 */ 224, 147, 431, 1011, 304, 1215, 503, 219, 1332, 1324,
172243
+ /* 550 */ 1324, 143, 375, 1557, 536, 126, 127, 81, 1219, 1219,
172244
+ /* 560 */ 1055, 1058, 1045, 1045, 124, 124, 125, 125, 125, 125,
172245
+ /* 570 */ 1559, 123, 123, 123, 123, 122, 122, 121, 121, 121,
172246
+ /* 580 */ 120, 117, 448, 286, 286, 122, 122, 121, 121, 121,
172247
+ /* 590 */ 120, 117, 448, 1586, 1195, 177, 569, 342, 1195, 386,
172248
+ /* 600 */ 154, 382, 411, 1215, 571, 547, 880, 192, 318, 563,
172249
+ /* 610 */ 242, 193, 1322, 1322, 123, 123, 123, 123, 122, 122,
172250
+ /* 620 */ 121, 121, 121, 120, 117, 448, 126, 127, 81, 1219,
172251
+ /* 630 */ 1219, 1055, 1058, 1045, 1045, 124, 124, 125, 125, 125,
172252
+ /* 640 */ 125, 411, 452, 941, 1195, 873, 1272, 376, 1195, 1272,
172253
+ /* 650 */ 856, 1195, 1196, 1195, 421, 1195, 1196, 1195, 1270, 574,
172254
+ /* 660 */ 572, 574, 33, 1557, 99, 126, 127, 81, 1219, 1219,
172255
+ /* 670 */ 1055, 1058, 1045, 1045, 124, 124, 125, 125, 125, 125,
172256
+ /* 680 */ 1355, 415, 963, 13, 13, 123, 123, 123, 123, 122,
172257
+ /* 690 */ 122, 121, 121, 121, 120, 117, 448, 526, 436, 1195,
172258
+ /* 700 */ 421, 1195, 1196, 1195, 1195, 1195, 1196, 1195, 1195, 467,
172259
+ /* 710 */ 545, 545, 411, 375, 373, 6, 1178, 5, 548, 548,
172260
+ /* 720 */ 16, 16, 3, 208, 123, 123, 123, 123, 122, 122,
172261
+ /* 730 */ 121, 121, 121, 120, 117, 448, 126, 127, 81, 1219,
172262
+ /* 740 */ 1219, 1055, 1058, 1045, 1045, 124, 124, 125, 125, 125,
172263
+ /* 750 */ 125, 411, 1077, 430, 1195, 1033, 1195, 1196, 1195, 1195,
172264
+ /* 760 */ 532, 1195, 1196, 1195, 489, 1195, 1196, 1195, 486, 209,
172265
+ /* 770 */ 572, 375, 229, 1647, 397, 126, 127, 81, 1219, 1219,
172266
+ /* 780 */ 1055, 1058, 1045, 1045, 124, 124, 125, 125, 125, 125,
172267
+ /* 790 */ 1487, 572, 962, 13, 13, 123, 123, 123, 123, 122,
172268
+ /* 800 */ 122, 121, 121, 121, 120, 117, 448, 1424, 202, 572,
172269
+ /* 810 */ 384, 1195, 1196, 1195, 13, 13, 1195, 1196, 1195, 156,
172270
+ /* 820 */ 199, 459, 411, 283, 1558, 961, 1016, 1541, 292, 203,
172271
+ /* 830 */ 301, 896, 72, 72, 123, 123, 123, 123, 122, 122,
172272
+ /* 840 */ 121, 121, 121, 120, 117, 448, 126, 127, 81, 1219,
172273
+ /* 850 */ 1219, 1055, 1058, 1045, 1045, 124, 124, 125, 125, 125,
172274
+ /* 860 */ 125, 411, 512, 286, 286, 286, 286, 280, 280, 315,
172275
+ /* 870 */ 897, 287, 287, 461, 101, 98, 569, 426, 569, 572,
172276
+ /* 880 */ 569, 288, 1557, 409, 569, 126, 127, 81, 1219, 1219,
172277
+ /* 890 */ 1055, 1058, 1045, 1045, 124, 124, 125, 125, 125, 125,
172278
+ /* 900 */ 572, 12, 13, 13, 531, 123, 123, 123, 123, 122,
172279
+ /* 910 */ 122, 121, 121, 121, 120, 117, 448, 549, 230, 1590,
172280
+ /* 920 */ 578, 2, 1250, 71, 71, 1160, 433, 319, 356, 147,
172281
+ /* 930 */ 495, 1563, 411, 318, 563, 6, 1332, 1543, 1160, 1357,
172282
+ /* 940 */ 313, 1160, 1330, 961, 123, 123, 123, 123, 122, 122,
172283
+ /* 950 */ 121, 121, 121, 120, 117, 448, 126, 127, 81, 1219,
172284
+ /* 960 */ 1219, 1055, 1058, 1045, 1045, 124, 124, 125, 125, 125,
172285
+ /* 970 */ 125, 286, 286, 572, 205, 1530, 411, 286, 286, 468,
172286
+ /* 980 */ 257, 256, 255, 1097, 569, 385, 495, 876, 529, 351,
172287
+ /* 990 */ 569, 354, 1141, 1645, 1302, 1645, 72, 72, 242, 1268,
172288
+ /* 1000 */ 1604, 105, 81, 1219, 1219, 1055, 1058, 1045, 1045, 124,
172009172289
/* 1010 */ 124, 125, 125, 125, 125, 123, 123, 123, 123, 122,
172010
- /* 1020 */ 122, 121, 121, 121, 120, 117, 448, 1117, 286, 286,
172011
- /* 1030 */ 1422, 452, 1528, 1213, 443, 286, 286, 1492, 1355, 313,
172012
- /* 1040 */ 478, 569, 1118, 454, 351, 495, 354, 1266, 569, 209,
172013
- /* 1050 */ 572, 418, 179, 572, 1031, 242, 385, 1119, 523, 123,
172290
+ /* 1020 */ 122, 121, 121, 121, 120, 117, 448, 572, 1032, 572,
172291
+ /* 1030 */ 452, 1494, 572, 443, 286, 286, 1141, 1646, 1424, 1646,
172292
+ /* 1040 */ 521, 495, 523, 1118, 876, 1021, 334, 569, 495, 1020,
172293
+ /* 1050 */ 72, 72, 52, 52, 101, 134, 134, 1439, 1119, 123,
172014172294
/* 1060 */ 123, 123, 123, 122, 122, 121, 121, 121, 120, 117,
172015
- /* 1070 */ 448, 1020, 108, 72, 72, 1019, 13, 13, 915, 572,
172016
- /* 1080 */ 1498, 572, 286, 286, 98, 530, 1537, 452, 916, 1334,
172017
- /* 1090 */ 1329, 203, 411, 286, 286, 569, 152, 211, 1498, 1500,
172018
- /* 1100 */ 426, 569, 56, 56, 57, 57, 569, 1019, 1019, 1021,
172019
- /* 1110 */ 447, 572, 411, 531, 12, 297, 126, 127, 81, 1217,
172020
- /* 1120 */ 1217, 1054, 1057, 1044, 1044, 124, 124, 125, 125, 125,
172021
- /* 1130 */ 125, 572, 411, 867, 15, 15, 126, 127, 81, 1217,
172022
- /* 1140 */ 1217, 1054, 1057, 1044, 1044, 124, 124, 125, 125, 125,
172023
- /* 1150 */ 125, 373, 529, 264, 44, 44, 126, 115, 81, 1217,
172024
- /* 1160 */ 1217, 1054, 1057, 1044, 1044, 124, 124, 125, 125, 125,
172025
- /* 1170 */ 125, 1498, 478, 1271, 417, 123, 123, 123, 123, 122,
172026
- /* 1180 */ 122, 121, 121, 121, 120, 117, 448, 205, 1213, 495,
172027
- /* 1190 */ 430, 867, 468, 322, 495, 123, 123, 123, 123, 122,
172028
- /* 1200 */ 122, 121, 121, 121, 120, 117, 448, 572, 557, 1140,
172029
- /* 1210 */ 1642, 1422, 1642, 543, 572, 123, 123, 123, 123, 122,
172030
- /* 1220 */ 122, 121, 121, 121, 120, 117, 448, 572, 1422, 572,
172031
- /* 1230 */ 13, 13, 542, 323, 1325, 411, 334, 58, 58, 349,
172032
- /* 1240 */ 1422, 1170, 326, 286, 286, 549, 1213, 300, 895, 530,
172033
- /* 1250 */ 45, 45, 59, 59, 1140, 1643, 569, 1643, 565, 417,
172034
- /* 1260 */ 127, 81, 1217, 1217, 1054, 1057, 1044, 1044, 124, 124,
172035
- /* 1270 */ 125, 125, 125, 125, 1367, 373, 500, 290, 1193, 512,
172036
- /* 1280 */ 1366, 427, 394, 394, 393, 275, 391, 896, 1138, 852,
172037
- /* 1290 */ 478, 258, 1422, 1170, 463, 1159, 12, 331, 428, 333,
172038
- /* 1300 */ 1117, 460, 236, 258, 325, 460, 544, 1544, 1159, 1098,
172039
- /* 1310 */ 491, 1159, 324, 1098, 440, 1118, 335, 516, 123, 123,
172295
+ /* 1070 */ 448, 1139, 108, 1120, 936, 286, 286, 286, 286, 935,
172296
+ /* 1080 */ 457, 1020, 1020, 1022, 98, 530, 1331, 447, 569, 522,
172297
+ /* 1090 */ 569, 484, 411, 1327, 916, 371, 1583, 211, 457, 456,
172298
+ /* 1100 */ 469, 344, 460, 109, 917, 107, 460, 331, 427, 333,
172299
+ /* 1110 */ 572, 1179, 411, 531, 1438, 1139, 126, 127, 81, 1219,
172300
+ /* 1120 */ 1219, 1055, 1058, 1045, 1045, 124, 124, 125, 125, 125,
172301
+ /* 1130 */ 125, 1564, 411, 136, 136, 6, 126, 127, 81, 1219,
172302
+ /* 1140 */ 1219, 1055, 1058, 1045, 1045, 124, 124, 125, 125, 125,
172303
+ /* 1150 */ 125, 152, 371, 1583, 1500, 887, 126, 115, 81, 1219,
172304
+ /* 1160 */ 1219, 1055, 1058, 1045, 1045, 124, 124, 125, 125, 125,
172305
+ /* 1170 */ 125, 457, 1500, 1502, 478, 123, 123, 123, 123, 122,
172306
+ /* 1180 */ 122, 121, 121, 121, 120, 117, 448, 500, 868, 1214,
172307
+ /* 1190 */ 303, 332, 454, 557, 1160, 123, 123, 123, 123, 122,
172308
+ /* 1200 */ 122, 121, 121, 121, 120, 117, 448, 1160, 1562, 572,
172309
+ /* 1210 */ 1160, 543, 6, 572, 258, 123, 123, 123, 123, 122,
172310
+ /* 1220 */ 122, 121, 121, 121, 120, 117, 448, 1032, 286, 286,
172311
+ /* 1230 */ 542, 572, 56, 56, 1561, 411, 57, 57, 6, 1171,
172312
+ /* 1240 */ 474, 569, 478, 295, 1021, 1500, 868, 295, 1020, 294,
172313
+ /* 1250 */ 495, 264, 1099, 572, 15, 15, 1099, 1195, 396, 1240,
172314
+ /* 1260 */ 127, 81, 1219, 1219, 1055, 1058, 1045, 1045, 124, 124,
172315
+ /* 1270 */ 125, 125, 125, 125, 1160, 218, 44, 44, 572, 1118,
172316
+ /* 1280 */ 1020, 1020, 1022, 416, 572, 544, 1215, 1160, 490, 572,
172317
+ /* 1290 */ 1160, 1171, 1424, 373, 1119, 349, 478, 1539, 529, 361,
172318
+ /* 1300 */ 322, 58, 58, 235, 516, 478, 219, 45, 45, 1120,
172319
+ /* 1310 */ 1179, 572, 59, 59, 1195, 1196, 1195, 297, 123, 123,
172040172320
/* 1320 */ 123, 123, 122, 122, 121, 121, 121, 120, 117, 448,
172041
- /* 1330 */ 1119, 318, 563, 1138, 572, 1193, 1194, 1193, 112, 564,
172042
- /* 1340 */ 201, 4, 238, 433, 935, 490, 285, 228, 1517, 934,
172043
- /* 1350 */ 170, 560, 572, 142, 1516, 567, 572, 60, 60, 572,
172044
- /* 1360 */ 416, 572, 441, 572, 535, 302, 875, 8, 487, 572,
172045
- /* 1370 */ 237, 572, 416, 572, 485, 61, 61, 572, 449, 62,
172046
- /* 1380 */ 62, 332, 63, 63, 46, 46, 47, 47, 361, 572,
172047
- /* 1390 */ 561, 572, 48, 48, 50, 50, 51, 51, 572, 295,
172048
- /* 1400 */ 64, 64, 482, 295, 539, 412, 471, 1031, 572, 538,
172049
- /* 1410 */ 318, 563, 65, 65, 66, 66, 409, 475, 572, 1031,
172050
- /* 1420 */ 572, 14, 14, 875, 1020, 110, 110, 409, 1019, 572,
172051
- /* 1430 */ 474, 67, 67, 111, 455, 449, 573, 449, 98, 317,
172052
- /* 1440 */ 1019, 132, 132, 133, 133, 572, 1561, 572, 974, 409,
172053
- /* 1450 */ 6, 1562, 68, 68, 1560, 6, 975, 572, 6, 1559,
172054
- /* 1460 */ 1019, 1019, 1021, 6, 346, 218, 101, 531, 53, 53,
172055
- /* 1470 */ 69, 69, 1019, 1019, 1021, 1022, 28, 1586, 1181, 451,
172056
- /* 1480 */ 70, 70, 290, 87, 215, 31, 1363, 394, 394, 393,
172057
- /* 1490 */ 275, 391, 350, 109, 852, 107, 572, 112, 564, 483,
172058
- /* 1500 */ 4, 1212, 572, 239, 153, 572, 39, 236, 1299, 325,
172059
- /* 1510 */ 112, 564, 1298, 4, 567, 572, 32, 324, 572, 54,
172060
- /* 1520 */ 54, 572, 1135, 353, 398, 165, 165, 567, 166, 166,
172061
- /* 1530 */ 572, 291, 355, 572, 17, 357, 572, 449, 77, 77,
172062
- /* 1540 */ 1313, 55, 55, 1297, 73, 73, 572, 238, 470, 561,
172063
- /* 1550 */ 449, 472, 364, 135, 135, 170, 74, 74, 142, 163,
172064
- /* 1560 */ 163, 374, 561, 539, 572, 321, 572, 886, 540, 137,
172065
- /* 1570 */ 137, 339, 1353, 422, 298, 237, 539, 572, 1031, 572,
172066
- /* 1580 */ 340, 538, 101, 369, 110, 110, 162, 131, 131, 164,
172067
- /* 1590 */ 164, 1031, 111, 368, 449, 573, 449, 110, 110, 1019,
172068
- /* 1600 */ 157, 157, 141, 141, 572, 111, 572, 449, 573, 449,
172069
- /* 1610 */ 412, 288, 1019, 572, 882, 318, 563, 572, 219, 572,
172070
- /* 1620 */ 241, 1012, 477, 263, 263, 894, 893, 140, 140, 138,
172071
- /* 1630 */ 138, 1019, 1019, 1021, 1022, 28, 139, 139, 525, 455,
172072
- /* 1640 */ 76, 76, 78, 78, 1019, 1019, 1021, 1022, 28, 1181,
172073
- /* 1650 */ 451, 572, 1083, 290, 112, 564, 1575, 4, 394, 394,
172074
- /* 1660 */ 393, 275, 391, 572, 1023, 852, 572, 479, 345, 263,
172075
- /* 1670 */ 101, 567, 882, 1376, 75, 75, 1421, 501, 236, 260,
172076
- /* 1680 */ 325, 112, 564, 359, 4, 101, 43, 43, 324, 49,
172077
- /* 1690 */ 49, 901, 902, 161, 449, 101, 977, 978, 567, 1079,
172078
- /* 1700 */ 1349, 260, 965, 932, 263, 114, 561, 1095, 517, 1095,
172079
- /* 1710 */ 1083, 1094, 865, 1094, 151, 933, 1144, 114, 238, 1361,
172080
- /* 1720 */ 558, 449, 1023, 559, 1426, 1278, 170, 1269, 1257, 142,
172081
- /* 1730 */ 1601, 1256, 1258, 561, 1594, 1031, 496, 278, 213, 1346,
172082
- /* 1740 */ 310, 110, 110, 939, 311, 312, 237, 11, 234, 111,
172083
- /* 1750 */ 221, 449, 573, 449, 293, 395, 1019, 1408, 337, 1403,
172084
- /* 1760 */ 1396, 338, 1031, 299, 343, 1413, 1412, 481, 110, 110,
172085
- /* 1770 */ 506, 402, 225, 1296, 206, 367, 111, 1358, 449, 573,
172086
- /* 1780 */ 449, 412, 1359, 1019, 1489, 1488, 318, 563, 1019, 1019,
172087
- /* 1790 */ 1021, 1022, 28, 562, 207, 220, 80, 564, 389, 4,
172088
- /* 1800 */ 1597, 1357, 552, 1356, 1233, 181, 267, 232, 1536, 1534,
172089
- /* 1810 */ 455, 1230, 420, 567, 82, 1019, 1019, 1021, 1022, 28,
172090
- /* 1820 */ 86, 217, 85, 1494, 190, 175, 183, 465, 185, 466,
172091
- /* 1830 */ 36, 1409, 186, 187, 188, 499, 449, 244, 37, 99,
172092
- /* 1840 */ 400, 1415, 1414, 488, 1417, 194, 473, 403, 561, 1483,
172093
- /* 1850 */ 248, 92, 1505, 494, 198, 279, 112, 564, 250, 4,
172094
- /* 1860 */ 348, 497, 405, 352, 1259, 251, 252, 515, 1316, 434,
172095
- /* 1870 */ 1315, 1314, 94, 567, 1307, 886, 1306, 1031, 226, 406,
172096
- /* 1880 */ 1611, 1610, 438, 110, 110, 1580, 1286, 524, 439, 308,
172097
- /* 1890 */ 266, 111, 1285, 449, 573, 449, 449, 309, 1019, 366,
172098
- /* 1900 */ 1284, 1609, 265, 1566, 1565, 442, 372, 1381, 561, 129,
172099
- /* 1910 */ 550, 1380, 10, 1470, 383, 106, 316, 551, 100, 35,
172100
- /* 1920 */ 534, 575, 212, 1339, 381, 387, 1187, 1338, 274, 276,
172101
- /* 1930 */ 1019, 1019, 1021, 1022, 28, 277, 413, 1031, 576, 1254,
172102
- /* 1940 */ 388, 1521, 1249, 110, 110, 167, 1522, 168, 148, 1520,
172103
- /* 1950 */ 1519, 111, 306, 449, 573, 449, 222, 223, 1019, 839,
172104
- /* 1960 */ 169, 79, 450, 214, 414, 233, 320, 145, 1093, 1091,
172105
- /* 1970 */ 328, 182, 171, 1212, 918, 184, 240, 336, 243, 1107,
172106
- /* 1980 */ 189, 172, 173, 423, 425, 88, 180, 191, 89, 90,
172107
- /* 1990 */ 1019, 1019, 1021, 1022, 28, 91, 174, 1110, 245, 1106,
172108
- /* 2000 */ 246, 159, 18, 247, 347, 1099, 263, 195, 1227, 493,
172109
- /* 2010 */ 249, 196, 38, 854, 498, 368, 253, 360, 897, 197,
172110
- /* 2020 */ 502, 93, 19, 20, 507, 884, 363, 510, 95, 307,
172111
- /* 2030 */ 160, 96, 518, 97, 1175, 1060, 1146, 40, 21, 227,
172112
- /* 2040 */ 176, 1145, 282, 284, 969, 200, 963, 114, 262, 1165,
172113
- /* 2050 */ 22, 23, 24, 1161, 1169, 25, 1163, 1150, 34, 26,
172114
- /* 2060 */ 1168, 546, 27, 204, 101, 103, 104, 1074, 7, 1061,
172115
- /* 2070 */ 1059, 1063, 1116, 1064, 1115, 268, 269, 29, 41, 270,
172116
- /* 2080 */ 1024, 866, 113, 30, 568, 392, 1183, 144, 178, 1182,
172117
- /* 2090 */ 271, 928, 1245, 1245, 1245, 1245, 1245, 1245, 1245, 1602,
172321
+ /* 1330 */ 560, 936, 440, 572, 60, 60, 935, 1241, 112, 564,
172322
+ /* 1340 */ 572, 4, 572, 535, 1215, 572, 1424, 1424, 1235, 572,
172323
+ /* 1350 */ 961, 396, 1140, 572, 31, 567, 61, 61, 112, 564,
172324
+ /* 1360 */ 572, 4, 428, 62, 62, 63, 63, 8, 46, 46,
172325
+ /* 1370 */ 572, 300, 47, 47, 17, 567, 48, 48, 449, 572,
172326
+ /* 1380 */ 302, 975, 572, 50, 50, 32, 1273, 417, 572, 976,
172327
+ /* 1390 */ 561, 572, 258, 51, 51, 530, 883, 572, 449, 572,
172328
+ /* 1400 */ 565, 417, 64, 64, 539, 65, 65, 323, 572, 538,
172329
+ /* 1410 */ 561, 66, 66, 422, 14, 14, 491, 441, 572, 1032,
172330
+ /* 1420 */ 67, 67, 132, 132, 539, 110, 110, 326, 550, 540,
172331
+ /* 1430 */ 1241, 133, 133, 111, 462, 449, 573, 449, 482, 1032,
172332
+ /* 1440 */ 1020, 68, 68, 230, 409, 110, 110, 150, 114, 112,
172333
+ /* 1450 */ 564, 1336, 4, 111, 883, 449, 573, 449, 572, 239,
172334
+ /* 1460 */ 1020, 416, 572, 569, 572, 1369, 567, 572, 961, 318,
172335
+ /* 1470 */ 563, 525, 1020, 1020, 1022, 1023, 28, 1301, 418, 179,
172336
+ /* 1480 */ 1368, 53, 53, 285, 228, 69, 69, 70, 70, 449,
172337
+ /* 1490 */ 54, 54, 1020, 1020, 1022, 1023, 28, 87, 215, 290,
172338
+ /* 1500 */ 471, 561, 1179, 475, 394, 394, 393, 275, 391, 572,
172339
+ /* 1510 */ 409, 853, 153, 409, 39, 539, 572, 317, 470, 1136,
172340
+ /* 1520 */ 538, 398, 1179, 291, 236, 1300, 325, 409, 463, 572,
172341
+ /* 1530 */ 1032, 201, 165, 165, 324, 483, 110, 110, 572, 166,
172342
+ /* 1540 */ 166, 339, 112, 564, 111, 4, 449, 573, 449, 1145,
172343
+ /* 1550 */ 572, 1020, 77, 77, 572, 1546, 572, 321, 472, 567,
172344
+ /* 1560 */ 335, 55, 55, 340, 238, 101, 1519, 1013, 550, 263,
172345
+ /* 1570 */ 895, 894, 170, 73, 73, 142, 241, 135, 135, 74,
172346
+ /* 1580 */ 74, 298, 449, 1020, 1020, 1022, 1023, 28, 1589, 1183,
172347
+ /* 1590 */ 451, 1518, 237, 290, 561, 161, 1084, 101, 394, 394,
172348
+ /* 1600 */ 393, 275, 391, 487, 477, 853, 263, 479, 345, 263,
172349
+ /* 1610 */ 101, 346, 501, 1179, 260, 902, 903, 559, 236, 572,
172350
+ /* 1620 */ 325, 112, 564, 1032, 4, 369, 572, 412, 324, 110,
172351
+ /* 1630 */ 110, 940, 318, 563, 1024, 368, 572, 111, 567, 449,
172352
+ /* 1640 */ 573, 449, 163, 163, 1020, 1365, 359, 572, 101, 137,
172353
+ /* 1650 */ 137, 572, 350, 1080, 1084, 260, 455, 353, 238, 131,
172354
+ /* 1660 */ 131, 449, 966, 933, 263, 114, 170, 572, 355, 142,
172355
+ /* 1670 */ 164, 164, 1299, 561, 157, 157, 1020, 1020, 1022, 1023,
172356
+ /* 1680 */ 28, 572, 978, 979, 1577, 866, 237, 151, 496, 572,
172357
+ /* 1690 */ 141, 141, 1024, 80, 564, 1096, 4, 1096, 1095, 357,
172358
+ /* 1700 */ 1095, 572, 1032, 1315, 140, 140, 1179, 364, 110, 110,
172359
+ /* 1710 */ 567, 572, 138, 138, 374, 572, 111, 1348, 449, 573,
172360
+ /* 1720 */ 449, 412, 1378, 1020, 139, 139, 318, 563, 572, 934,
172361
+ /* 1730 */ 1423, 114, 1351, 449, 76, 76, 278, 572, 78, 78,
172362
+ /* 1740 */ 572, 1363, 552, 558, 1428, 561, 1280, 1271, 1259, 1258,
172363
+ /* 1750 */ 455, 75, 75, 1260, 1597, 1020, 1020, 1022, 1023, 28,
172364
+ /* 1760 */ 43, 43, 213, 49, 49, 395, 310, 311, 312, 11,
172365
+ /* 1770 */ 234, 221, 1410, 293, 1032, 337, 1405, 338, 1415, 299,
172366
+ /* 1780 */ 110, 110, 1398, 481, 506, 1179, 367, 1414, 111, 1491,
172367
+ /* 1790 */ 449, 573, 449, 1183, 451, 1020, 402, 290, 225, 1490,
172368
+ /* 1800 */ 1298, 1360, 394, 394, 393, 275, 391, 343, 1361, 853,
172369
+ /* 1810 */ 562, 1359, 206, 389, 551, 207, 1600, 1358, 1235, 267,
172370
+ /* 1820 */ 220, 1538, 236, 1536, 325, 1232, 82, 1020, 1020, 1022,
172371
+ /* 1830 */ 1023, 28, 324, 181, 420, 86, 217, 232, 190, 175,
172372
+ /* 1840 */ 183, 465, 185, 466, 1411, 186, 244, 112, 564, 36,
172373
+ /* 1850 */ 4, 187, 188, 85, 1496, 499, 99, 1179, 400, 1417,
172374
+ /* 1860 */ 1416, 37, 238, 473, 567, 403, 1419, 194, 1485, 488,
172375
+ /* 1870 */ 170, 248, 92, 142, 1507, 494, 279, 250, 198, 497,
172376
+ /* 1880 */ 352, 348, 251, 405, 1261, 252, 515, 449, 1318, 1317,
172377
+ /* 1890 */ 237, 1316, 1309, 434, 94, 887, 226, 438, 1614, 561,
172378
+ /* 1900 */ 1288, 1613, 406, 524, 439, 1582, 265, 366, 1287, 1286,
172379
+ /* 1910 */ 1612, 308, 309, 266, 372, 442, 1568, 1308, 1567, 1383,
172380
+ /* 1920 */ 1382, 129, 550, 10, 383, 412, 1472, 316, 1032, 100,
172381
+ /* 1930 */ 318, 563, 106, 35, 110, 110, 534, 575, 1189, 274,
172382
+ /* 1940 */ 276, 388, 111, 381, 449, 573, 449, 1341, 1340, 1020,
172383
+ /* 1950 */ 212, 387, 277, 576, 455, 1256, 1251, 167, 148, 413,
172384
+ /* 1960 */ 414, 180, 1523, 168, 1524, 1522, 1521, 840, 222, 306,
172385
+ /* 1970 */ 450, 223, 169, 79, 214, 320, 233, 1094, 145, 1092,
172386
+ /* 1980 */ 328, 1020, 1020, 1022, 1023, 28, 182, 171, 184, 1214,
172387
+ /* 1990 */ 240, 919, 243, 336, 1108, 189, 172, 173, 423, 174,
172388
+ /* 2000 */ 191, 88, 425, 89, 90, 1111, 91, 245, 1107, 246,
172389
+ /* 2010 */ 159, 1179, 18, 247, 263, 347, 1229, 1100, 249, 493,
172390
+ /* 2020 */ 196, 38, 855, 195, 368, 498, 197, 253, 510, 885,
172391
+ /* 2030 */ 93, 19, 176, 360, 20, 502, 507, 363, 95, 898,
172392
+ /* 2040 */ 160, 307, 518, 96, 1176, 1061, 1147, 40, 21, 97,
172393
+ /* 2050 */ 227, 282, 284, 262, 1146, 970, 200, 964, 114, 1166,
172394
+ /* 2060 */ 22, 23, 1164, 1162, 24, 25, 1170, 1151, 34, 26,
172395
+ /* 2070 */ 204, 546, 1169, 101, 27, 103, 7, 104, 1075, 1062,
172396
+ /* 2080 */ 1060, 1064, 1117, 1065, 1116, 268, 269, 29, 41, 1185,
172397
+ /* 2090 */ 1025, 867, 113, 30, 568, 929, 392, 144, 178, 270,
172398
+ /* 2100 */ 271, 1184, 1247, 1247, 1247, 1247, 1247, 1247, 1247, 1247,
172399
+ /* 2110 */ 1247, 1247, 1247, 1605,
172118172400
};
172119172401
static const YYCODETYPE yy_lookahead[] = {
172120
- /* 0 */ 193, 193, 193, 274, 275, 276, 193, 274, 275, 276,
172121
- /* 10 */ 193, 223, 219, 225, 206, 210, 211, 212, 193, 19,
172122
- /* 20 */ 219, 233, 216, 216, 217, 216, 217, 193, 295, 216,
172123
- /* 30 */ 217, 31, 193, 216, 217, 193, 228, 213, 230, 39,
172124
- /* 40 */ 206, 216, 217, 43, 44, 45, 46, 47, 48, 49,
172125
- /* 50 */ 50, 51, 52, 53, 54, 55, 56, 57, 193, 19,
172126
- /* 60 */ 185, 186, 187, 188, 189, 190, 253, 274, 275, 276,
172127
- /* 70 */ 195, 193, 197, 193, 261, 274, 275, 276, 253, 204,
172128
- /* 80 */ 238, 204, 81, 43, 44, 45, 46, 47, 48, 49,
172129
- /* 90 */ 50, 51, 52, 53, 54, 55, 56, 57, 274, 275,
172130
- /* 100 */ 276, 262, 102, 103, 104, 105, 106, 107, 108, 109,
172131
- /* 110 */ 110, 111, 112, 113, 239, 240, 239, 240, 210, 211,
172132
- /* 120 */ 212, 314, 315, 314, 59, 316, 86, 252, 88, 252,
172133
- /* 130 */ 19, 314, 315, 256, 257, 113, 25, 72, 296, 138,
172134
- /* 140 */ 139, 266, 102, 103, 104, 105, 106, 107, 108, 109,
172402
+ /* 0 */ 194, 194, 194, 275, 276, 277, 194, 275, 276, 277,
172403
+ /* 10 */ 194, 224, 220, 226, 207, 211, 212, 213, 194, 19,
172404
+ /* 20 */ 220, 234, 217, 217, 218, 217, 218, 194, 296, 217,
172405
+ /* 30 */ 218, 31, 194, 217, 218, 194, 229, 214, 231, 39,
172406
+ /* 40 */ 207, 217, 218, 43, 44, 45, 46, 47, 48, 49,
172407
+ /* 50 */ 50, 51, 52, 53, 54, 55, 56, 57, 194, 19,
172408
+ /* 60 */ 186, 187, 188, 189, 190, 191, 254, 275, 276, 277,
172409
+ /* 70 */ 196, 194, 198, 194, 262, 275, 276, 277, 254, 205,
172410
+ /* 80 */ 239, 205, 81, 43, 44, 45, 46, 47, 48, 49,
172411
+ /* 90 */ 50, 51, 52, 53, 54, 55, 56, 57, 275, 276,
172412
+ /* 100 */ 277, 263, 102, 103, 104, 105, 106, 107, 108, 109,
172413
+ /* 110 */ 110, 111, 112, 113, 240, 241, 240, 241, 211, 212,
172414
+ /* 120 */ 213, 315, 316, 315, 59, 317, 86, 253, 88, 253,
172415
+ /* 130 */ 19, 315, 316, 257, 258, 113, 25, 72, 297, 138,
172416
+ /* 140 */ 139, 267, 102, 103, 104, 105, 106, 107, 108, 109,
172135172417
/* 150 */ 110, 111, 112, 113, 43, 44, 45, 46, 47, 48,
172136172418
/* 160 */ 49, 50, 51, 52, 53, 54, 55, 56, 57, 81,
172137
- /* 170 */ 292, 59, 292, 298, 108, 109, 110, 111, 112, 113,
172138
- /* 180 */ 69, 116, 117, 118, 72, 106, 107, 193, 111, 112,
172419
+ /* 170 */ 293, 59, 293, 299, 108, 109, 110, 111, 112, 113,
172420
+ /* 180 */ 69, 116, 117, 118, 72, 106, 107, 194, 111, 112,
172139172421
/* 190 */ 113, 54, 55, 56, 57, 58, 102, 103, 104, 105,
172140
- /* 200 */ 106, 107, 108, 109, 110, 111, 112, 113, 120, 25,
172141
- /* 210 */ 216, 217, 145, 102, 103, 104, 105, 106, 107, 108,
172142
- /* 220 */ 109, 110, 111, 112, 113, 231, 138, 139, 116, 117,
172143
- /* 230 */ 118, 164, 153, 19, 155, 54, 55, 56, 57, 102,
172422
+ /* 200 */ 106, 107, 108, 109, 110, 111, 112, 113, 120, 217,
172423
+ /* 210 */ 217, 218, 22, 102, 103, 104, 105, 106, 107, 108,
172424
+ /* 220 */ 109, 110, 111, 112, 113, 232, 138, 139, 116, 117,
172425
+ /* 230 */ 118, 23, 153, 19, 155, 54, 55, 56, 57, 102,
172144172426
/* 240 */ 103, 104, 105, 106, 107, 108, 109, 110, 111, 112,
172145172427
/* 250 */ 113, 128, 129, 46, 47, 48, 49, 43, 44, 45,
172146172428
/* 260 */ 46, 47, 48, 49, 50, 51, 52, 53, 54, 55,
172147
- /* 270 */ 56, 57, 216, 193, 25, 59, 193, 19, 165, 166,
172148
- /* 280 */ 193, 67, 24, 102, 103, 104, 105, 106, 107, 108,
172149
- /* 290 */ 109, 110, 111, 112, 113, 73, 216, 217, 59, 216,
172150
- /* 300 */ 217, 43, 44, 45, 46, 47, 48, 49, 50, 51,
172429
+ /* 270 */ 56, 57, 127, 128, 129, 59, 194, 19, 165, 166,
172430
+ /* 280 */ 194, 67, 24, 102, 103, 104, 105, 106, 107, 108,
172431
+ /* 290 */ 109, 110, 111, 112, 113, 73, 106, 107, 59, 217,
172432
+ /* 300 */ 218, 43, 44, 45, 46, 47, 48, 49, 50, 51,
172151172433
/* 310 */ 52, 53, 54, 55, 56, 57, 102, 103, 104, 105,
172152
- /* 320 */ 106, 107, 108, 109, 110, 111, 112, 113, 121, 145,
172153
- /* 330 */ 59, 193, 116, 117, 118, 119, 273, 204, 122, 123,
172434
+ /* 320 */ 106, 107, 108, 109, 110, 111, 112, 113, 121, 23,
172435
+ /* 330 */ 59, 25, 116, 117, 118, 119, 254, 205, 122, 123,
172154172436
/* 340 */ 124, 19, 20, 134, 22, 136, 137, 19, 132, 127,
172155
- /* 350 */ 128, 129, 24, 22, 23, 116, 117, 118, 36, 193,
172437
+ /* 350 */ 128, 129, 24, 145, 194, 116, 117, 118, 36, 194,
172156172438
/* 360 */ 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
172157
- /* 370 */ 112, 113, 239, 240, 311, 312, 215, 106, 107, 241,
172158
- /* 380 */ 19, 59, 216, 217, 223, 252, 115, 116, 117, 118,
172159
- /* 390 */ 151, 120, 26, 71, 193, 308, 309, 193, 149, 128,
172160
- /* 400 */ 313, 216, 269, 81, 43, 44, 45, 46, 47, 48,
172161
- /* 410 */ 49, 50, 51, 52, 53, 54, 55, 56, 57, 253,
172162
- /* 420 */ 216, 217, 100, 95, 153, 59, 155, 261, 106, 107,
172163
- /* 430 */ 25, 193, 101, 193, 193, 231, 114, 25, 116, 117,
172164
- /* 440 */ 118, 113, 304, 121, 193, 204, 59, 119, 120, 121,
172165
- /* 450 */ 122, 123, 124, 125, 216, 217, 193, 216, 217, 131,
172166
- /* 460 */ 138, 139, 230, 102, 103, 104, 105, 106, 107, 108,
172439
+ /* 370 */ 112, 113, 240, 241, 7, 8, 9, 106, 107, 59,
172440
+ /* 380 */ 19, 59, 217, 218, 214, 253, 115, 116, 117, 118,
172441
+ /* 390 */ 151, 120, 26, 71, 274, 309, 310, 194, 194, 128,
172442
+ /* 400 */ 314, 217, 270, 81, 43, 44, 45, 46, 47, 48,
172443
+ /* 410 */ 49, 50, 51, 52, 53, 54, 55, 56, 57, 254,
172444
+ /* 420 */ 217, 218, 100, 95, 153, 59, 155, 262, 106, 107,
172445
+ /* 430 */ 25, 194, 312, 313, 194, 232, 114, 117, 116, 117,
172446
+ /* 440 */ 118, 113, 194, 121, 284, 205, 242, 119, 120, 121,
172447
+ /* 450 */ 122, 123, 124, 125, 217, 218, 194, 217, 218, 131,
172448
+ /* 460 */ 138, 139, 292, 102, 103, 104, 105, 106, 107, 108,
172167172449
/* 470 */ 109, 110, 111, 112, 113, 153, 154, 155, 156, 157,
172168
- /* 480 */ 239, 240, 116, 117, 118, 76, 193, 23, 19, 25,
172169
- /* 490 */ 22, 253, 23, 252, 253, 108, 87, 204, 89, 261,
172170
- /* 500 */ 198, 92, 261, 116, 117, 118, 193, 306, 307, 216,
172171
- /* 510 */ 217, 150, 43, 44, 45, 46, 47, 48, 49, 50,
172172
- /* 520 */ 51, 52, 53, 54, 55, 56, 57, 59, 193, 216,
172173
- /* 530 */ 217, 19, 239, 240, 283, 23, 106, 107, 108, 109,
172174
- /* 540 */ 110, 111, 112, 113, 73, 252, 253, 142, 308, 309,
172175
- /* 550 */ 138, 139, 81, 313, 145, 43, 44, 45, 46, 47,
172450
+ /* 480 */ 240, 241, 116, 117, 118, 76, 231, 194, 19, 216,
172451
+ /* 490 */ 242, 254, 23, 253, 254, 202, 87, 224, 89, 262,
172452
+ /* 500 */ 207, 92, 262, 310, 194, 183, 194, 314, 22, 305,
172453
+ /* 510 */ 24, 150, 43, 44, 45, 46, 47, 48, 49, 50,
172454
+ /* 520 */ 51, 52, 53, 54, 55, 56, 57, 217, 218, 217,
172455
+ /* 530 */ 218, 19, 189, 119, 191, 23, 122, 123, 124, 196,
172456
+ /* 540 */ 25, 198, 232, 73, 232, 59, 132, 142, 205, 236,
172457
+ /* 550 */ 237, 81, 194, 305, 145, 43, 44, 45, 46, 47,
172176172458
/* 560 */ 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
172177
- /* 570 */ 307, 102, 103, 104, 105, 106, 107, 108, 109, 110,
172178
- /* 580 */ 111, 112, 113, 281, 116, 117, 118, 285, 23, 193,
172179
- /* 590 */ 25, 119, 59, 193, 122, 123, 124, 59, 127, 203,
172180
- /* 600 */ 59, 205, 19, 268, 132, 25, 23, 22, 193, 138,
172181
- /* 610 */ 139, 249, 204, 251, 102, 103, 104, 105, 106, 107,
172459
+ /* 570 */ 308, 102, 103, 104, 105, 106, 107, 108, 109, 110,
172460
+ /* 580 */ 111, 112, 113, 240, 241, 106, 107, 108, 109, 110,
172461
+ /* 590 */ 111, 112, 113, 194, 59, 194, 253, 127, 59, 250,
172462
+ /* 600 */ 242, 252, 19, 117, 194, 194, 23, 22, 138, 139,
172463
+ /* 610 */ 267, 22, 236, 237, 102, 103, 104, 105, 106, 107,
172182172464
/* 620 */ 108, 109, 110, 111, 112, 113, 43, 44, 45, 46,
172183172465
/* 630 */ 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
172184
- /* 640 */ 57, 19, 22, 23, 59, 23, 25, 239, 240, 116,
172185
- /* 650 */ 117, 118, 193, 11, 116, 117, 118, 116, 117, 118,
172186
- /* 660 */ 252, 269, 22, 193, 15, 43, 44, 45, 46, 47,
172466
+ /* 640 */ 57, 19, 299, 108, 59, 23, 194, 194, 59, 194,
172467
+ /* 650 */ 21, 116, 117, 118, 194, 116, 117, 118, 206, 204,
172468
+ /* 660 */ 194, 206, 22, 305, 149, 43, 44, 45, 46, 47,
172187172469
/* 670 */ 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
172188
- /* 680 */ 273, 143, 193, 118, 143, 102, 103, 104, 105, 106,
172189
- /* 690 */ 107, 108, 109, 110, 111, 112, 113, 76, 118, 59,
172190
- /* 700 */ 241, 116, 117, 118, 304, 216, 217, 292, 143, 60,
172191
- /* 710 */ 89, 241, 19, 92, 193, 193, 23, 22, 311, 312,
172192
- /* 720 */ 231, 101, 22, 143, 102, 103, 104, 105, 106, 107,
172470
+ /* 680 */ 259, 199, 143, 217, 218, 102, 103, 104, 105, 106,
172471
+ /* 690 */ 107, 108, 109, 110, 111, 112, 113, 194, 232, 59,
172472
+ /* 700 */ 194, 116, 117, 118, 59, 116, 117, 118, 59, 80,
172473
+ /* 710 */ 309, 310, 19, 194, 194, 314, 23, 22, 307, 308,
172474
+ /* 720 */ 217, 218, 22, 263, 102, 103, 104, 105, 106, 107,
172193172475
/* 730 */ 108, 109, 110, 111, 112, 113, 43, 44, 45, 46,
172194172476
/* 740 */ 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
172195
- /* 750 */ 57, 19, 193, 193, 59, 23, 116, 117, 118, 59,
172196
- /* 760 */ 201, 21, 241, 304, 193, 206, 127, 128, 129, 193,
172197
- /* 770 */ 128, 129, 235, 236, 304, 43, 44, 45, 46, 47,
172477
+ /* 750 */ 57, 19, 123, 233, 59, 23, 116, 117, 118, 59,
172478
+ /* 760 */ 194, 116, 117, 118, 282, 116, 117, 118, 286, 263,
172479
+ /* 770 */ 194, 194, 194, 302, 303, 43, 44, 45, 46, 47,
172198172480
/* 780 */ 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
172199
- /* 790 */ 22, 193, 216, 217, 193, 102, 103, 104, 105, 106,
172200
- /* 800 */ 107, 108, 109, 110, 111, 112, 113, 231, 193, 193,
172201
- /* 810 */ 193, 116, 117, 118, 216, 217, 116, 117, 118, 226,
172202
- /* 820 */ 80, 193, 19, 235, 236, 304, 23, 211, 212, 231,
172203
- /* 830 */ 204, 216, 217, 205, 102, 103, 104, 105, 106, 107,
172481
+ /* 790 */ 161, 194, 143, 217, 218, 102, 103, 104, 105, 106,
172482
+ /* 800 */ 107, 108, 109, 110, 111, 112, 113, 194, 232, 194,
172483
+ /* 810 */ 194, 116, 117, 118, 217, 218, 116, 117, 118, 242,
172484
+ /* 820 */ 25, 270, 19, 23, 305, 25, 23, 194, 205, 232,
172485
+ /* 830 */ 205, 35, 217, 218, 102, 103, 104, 105, 106, 107,
172204172486
/* 840 */ 108, 109, 110, 111, 112, 113, 43, 44, 45, 46,
172205172487
/* 850 */ 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
172206
- /* 860 */ 57, 19, 193, 123, 76, 239, 240, 193, 253, 239,
172207
- /* 870 */ 240, 239, 240, 244, 106, 107, 193, 89, 252, 193,
172208
- /* 880 */ 92, 59, 252, 254, 252, 43, 44, 45, 46, 47,
172488
+ /* 860 */ 57, 19, 66, 240, 241, 240, 241, 240, 241, 254,
172489
+ /* 870 */ 74, 240, 241, 245, 25, 115, 253, 264, 253, 194,
172490
+ /* 880 */ 253, 22, 305, 255, 253, 43, 44, 45, 46, 47,
172209172491
/* 890 */ 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
172210
- /* 900 */ 284, 161, 216, 217, 193, 102, 103, 104, 105, 106,
172211
- /* 910 */ 107, 108, 109, 110, 111, 112, 113, 231, 193, 244,
172212
- /* 920 */ 187, 188, 189, 190, 7, 8, 9, 309, 195, 254,
172213
- /* 930 */ 197, 313, 19, 127, 128, 129, 262, 204, 22, 117,
172214
- /* 940 */ 24, 216, 217, 273, 102, 103, 104, 105, 106, 107,
172492
+ /* 900 */ 194, 214, 217, 218, 144, 102, 103, 104, 105, 106,
172493
+ /* 910 */ 107, 108, 109, 110, 111, 112, 113, 232, 118, 188,
172494
+ /* 920 */ 189, 190, 191, 217, 218, 76, 130, 196, 16, 198,
172495
+ /* 930 */ 194, 310, 19, 138, 139, 314, 205, 194, 89, 260,
172496
+ /* 940 */ 261, 92, 205, 143, 102, 103, 104, 105, 106, 107,
172215172497
/* 950 */ 108, 109, 110, 111, 112, 113, 43, 44, 45, 46,
172216172498
/* 960 */ 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
172217
- /* 970 */ 57, 193, 239, 240, 193, 59, 19, 188, 253, 190,
172218
- /* 980 */ 193, 311, 312, 16, 195, 252, 197, 193, 19, 301,
172219
- /* 990 */ 302, 135, 193, 204, 216, 217, 140, 216, 217, 266,
172220
- /* 1000 */ 204, 159, 45, 46, 47, 48, 49, 50, 51, 52,
172499
+ /* 970 */ 57, 240, 241, 194, 287, 239, 19, 240, 241, 292,
172500
+ /* 980 */ 127, 128, 129, 11, 253, 279, 194, 59, 19, 77,
172501
+ /* 990 */ 253, 79, 22, 23, 227, 25, 217, 218, 267, 205,
172502
+ /* 1000 */ 141, 159, 45, 46, 47, 48, 49, 50, 51, 52,
172221172503
/* 1010 */ 53, 54, 55, 56, 57, 102, 103, 104, 105, 106,
172222
- /* 1020 */ 107, 108, 109, 110, 111, 112, 113, 12, 239, 240,
172223
- /* 1030 */ 193, 298, 238, 117, 253, 239, 240, 238, 259, 260,
172224
- /* 1040 */ 193, 252, 27, 193, 77, 193, 79, 204, 252, 262,
172225
- /* 1050 */ 193, 299, 300, 193, 100, 266, 278, 42, 204, 102,
172504
+ /* 1020 */ 107, 108, 109, 110, 111, 112, 113, 194, 100, 194,
172505
+ /* 1030 */ 299, 239, 194, 254, 240, 241, 22, 23, 194, 25,
172506
+ /* 1040 */ 205, 194, 205, 12, 116, 117, 16, 253, 194, 121,
172507
+ /* 1050 */ 217, 218, 217, 218, 25, 217, 218, 274, 27, 102,
172226172508
/* 1060 */ 103, 104, 105, 106, 107, 108, 109, 110, 111, 112,
172227
- /* 1070 */ 113, 117, 159, 216, 217, 121, 216, 217, 63, 193,
172228
- /* 1080 */ 193, 193, 239, 240, 115, 116, 193, 298, 73, 240,
172229
- /* 1090 */ 238, 231, 19, 239, 240, 252, 22, 24, 211, 212,
172230
- /* 1100 */ 263, 252, 216, 217, 216, 217, 252, 153, 154, 155,
172231
- /* 1110 */ 253, 193, 19, 144, 213, 268, 43, 44, 45, 46,
172509
+ /* 1070 */ 113, 101, 159, 42, 135, 240, 241, 240, 241, 140,
172510
+ /* 1080 */ 194, 153, 154, 155, 115, 116, 239, 254, 253, 254,
172511
+ /* 1090 */ 253, 194, 19, 239, 63, 312, 313, 24, 212, 213,
172512
+ /* 1100 */ 128, 129, 261, 158, 73, 160, 265, 77, 264, 79,
172513
+ /* 1110 */ 194, 183, 19, 144, 274, 101, 43, 44, 45, 46,
172232172514
/* 1120 */ 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
172233
- /* 1130 */ 57, 193, 19, 59, 216, 217, 43, 44, 45, 46,
172515
+ /* 1130 */ 57, 310, 19, 217, 218, 314, 43, 44, 45, 46,
172234172516
/* 1140 */ 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
172235
- /* 1150 */ 57, 193, 19, 24, 216, 217, 43, 44, 45, 46,
172517
+ /* 1150 */ 57, 22, 312, 313, 194, 126, 43, 44, 45, 46,
172236172518
/* 1160 */ 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
172237
- /* 1170 */ 57, 284, 193, 208, 209, 102, 103, 104, 105, 106,
172238
- /* 1180 */ 107, 108, 109, 110, 111, 112, 113, 286, 59, 193,
172239
- /* 1190 */ 232, 117, 291, 193, 193, 102, 103, 104, 105, 106,
172240
- /* 1200 */ 107, 108, 109, 110, 111, 112, 113, 193, 204, 22,
172241
- /* 1210 */ 23, 193, 25, 66, 193, 102, 103, 104, 105, 106,
172242
- /* 1220 */ 107, 108, 109, 110, 111, 112, 113, 193, 193, 193,
172243
- /* 1230 */ 216, 217, 85, 193, 238, 19, 16, 216, 217, 238,
172244
- /* 1240 */ 193, 94, 193, 239, 240, 231, 117, 268, 35, 116,
172245
- /* 1250 */ 216, 217, 216, 217, 22, 23, 252, 25, 208, 209,
172519
+ /* 1170 */ 57, 285, 212, 213, 194, 102, 103, 104, 105, 106,
172520
+ /* 1180 */ 107, 108, 109, 110, 111, 112, 113, 19, 59, 25,
172521
+ /* 1190 */ 293, 161, 194, 205, 76, 102, 103, 104, 105, 106,
172522
+ /* 1200 */ 107, 108, 109, 110, 111, 112, 113, 89, 310, 194,
172523
+ /* 1210 */ 92, 66, 314, 194, 46, 102, 103, 104, 105, 106,
172524
+ /* 1220 */ 107, 108, 109, 110, 111, 112, 113, 100, 240, 241,
172525
+ /* 1230 */ 85, 194, 217, 218, 310, 19, 217, 218, 314, 94,
172526
+ /* 1240 */ 115, 253, 194, 261, 117, 285, 117, 265, 121, 269,
172527
+ /* 1250 */ 194, 24, 29, 194, 217, 218, 33, 59, 22, 23,
172246172528
/* 1260 */ 44, 45, 46, 47, 48, 49, 50, 51, 52, 53,
172247
- /* 1270 */ 54, 55, 56, 57, 193, 193, 19, 5, 59, 66,
172248
- /* 1280 */ 193, 263, 10, 11, 12, 13, 14, 74, 101, 17,
172249
- /* 1290 */ 193, 46, 193, 146, 193, 76, 213, 77, 263, 79,
172250
- /* 1300 */ 12, 260, 30, 46, 32, 264, 87, 193, 89, 29,
172251
- /* 1310 */ 263, 92, 40, 33, 232, 27, 193, 108, 102, 103,
172529
+ /* 1270 */ 54, 55, 56, 57, 76, 150, 217, 218, 194, 12,
172530
+ /* 1280 */ 153, 154, 155, 115, 194, 87, 59, 89, 65, 194,
172531
+ /* 1290 */ 92, 146, 194, 194, 27, 239, 194, 194, 19, 131,
172532
+ /* 1300 */ 194, 217, 218, 15, 108, 194, 142, 217, 218, 42,
172533
+ /* 1310 */ 183, 194, 217, 218, 116, 117, 118, 269, 102, 103,
172252172534
/* 1320 */ 104, 105, 106, 107, 108, 109, 110, 111, 112, 113,
172253
- /* 1330 */ 42, 138, 139, 101, 193, 116, 117, 118, 19, 20,
172254
- /* 1340 */ 255, 22, 70, 130, 135, 65, 256, 257, 193, 140,
172255
- /* 1350 */ 78, 63, 193, 81, 193, 36, 193, 216, 217, 193,
172256
- /* 1360 */ 115, 193, 263, 193, 145, 268, 59, 48, 193, 193,
172257
- /* 1370 */ 98, 193, 115, 193, 291, 216, 217, 193, 59, 216,
172258
- /* 1380 */ 217, 161, 216, 217, 216, 217, 216, 217, 131, 193,
172259
- /* 1390 */ 71, 193, 216, 217, 216, 217, 216, 217, 193, 260,
172260
- /* 1400 */ 216, 217, 19, 264, 85, 133, 244, 100, 193, 90,
172261
- /* 1410 */ 138, 139, 216, 217, 216, 217, 254, 244, 193, 100,
172262
- /* 1420 */ 193, 216, 217, 116, 117, 106, 107, 254, 121, 193,
172263
- /* 1430 */ 115, 216, 217, 114, 162, 116, 117, 118, 115, 244,
172264
- /* 1440 */ 121, 216, 217, 216, 217, 193, 309, 193, 31, 254,
172265
- /* 1450 */ 313, 309, 216, 217, 309, 313, 39, 193, 313, 309,
172266
- /* 1460 */ 153, 154, 155, 313, 193, 150, 25, 144, 216, 217,
172267
- /* 1470 */ 216, 217, 153, 154, 155, 156, 157, 0, 1, 2,
172268
- /* 1480 */ 216, 217, 5, 149, 150, 22, 193, 10, 11, 12,
172269
- /* 1490 */ 13, 14, 193, 158, 17, 160, 193, 19, 20, 116,
172270
- /* 1500 */ 22, 25, 193, 24, 22, 193, 24, 30, 226, 32,
172271
- /* 1510 */ 19, 20, 226, 22, 36, 193, 53, 40, 193, 216,
172272
- /* 1520 */ 217, 193, 23, 193, 25, 216, 217, 36, 216, 217,
172273
- /* 1530 */ 193, 99, 193, 193, 22, 193, 193, 59, 216, 217,
172274
- /* 1540 */ 193, 216, 217, 193, 216, 217, 193, 70, 129, 71,
172275
- /* 1550 */ 59, 129, 193, 216, 217, 78, 216, 217, 81, 216,
172276
- /* 1560 */ 217, 193, 71, 85, 193, 133, 193, 126, 90, 216,
172277
- /* 1570 */ 217, 152, 258, 61, 152, 98, 85, 193, 100, 193,
172278
- /* 1580 */ 23, 90, 25, 121, 106, 107, 23, 216, 217, 216,
172279
- /* 1590 */ 217, 100, 114, 131, 116, 117, 118, 106, 107, 121,
172280
- /* 1600 */ 216, 217, 216, 217, 193, 114, 193, 116, 117, 118,
172281
- /* 1610 */ 133, 22, 121, 193, 59, 138, 139, 193, 142, 193,
172282
- /* 1620 */ 141, 23, 23, 25, 25, 120, 121, 216, 217, 216,
172283
- /* 1630 */ 217, 153, 154, 155, 156, 157, 216, 217, 19, 162,
172284
- /* 1640 */ 216, 217, 216, 217, 153, 154, 155, 156, 157, 1,
172285
- /* 1650 */ 2, 193, 59, 5, 19, 20, 318, 22, 10, 11,
172286
- /* 1660 */ 12, 13, 14, 193, 59, 17, 193, 23, 23, 25,
172287
- /* 1670 */ 25, 36, 117, 193, 216, 217, 193, 23, 30, 25,
172288
- /* 1680 */ 32, 19, 20, 23, 22, 25, 216, 217, 40, 216,
172289
- /* 1690 */ 217, 7, 8, 23, 59, 25, 83, 84, 36, 23,
172290
- /* 1700 */ 193, 25, 23, 23, 25, 25, 71, 153, 145, 155,
172291
- /* 1710 */ 117, 153, 23, 155, 25, 23, 97, 25, 70, 193,
172292
- /* 1720 */ 193, 59, 117, 236, 193, 193, 78, 193, 193, 81,
172293
- /* 1730 */ 141, 193, 193, 71, 193, 100, 288, 287, 242, 255,
172294
- /* 1740 */ 255, 106, 107, 108, 255, 255, 98, 243, 297, 114,
172295
- /* 1750 */ 214, 116, 117, 118, 245, 191, 121, 271, 293, 267,
172296
- /* 1760 */ 267, 246, 100, 246, 245, 271, 271, 293, 106, 107,
172297
- /* 1770 */ 220, 271, 229, 225, 249, 219, 114, 259, 116, 117,
172298
- /* 1780 */ 118, 133, 259, 121, 219, 219, 138, 139, 153, 154,
172299
- /* 1790 */ 155, 156, 157, 280, 249, 243, 19, 20, 245, 22,
172300
- /* 1800 */ 196, 259, 140, 259, 60, 297, 141, 297, 200, 200,
172301
- /* 1810 */ 162, 38, 200, 36, 294, 153, 154, 155, 156, 157,
172302
- /* 1820 */ 151, 150, 294, 283, 22, 43, 234, 18, 237, 200,
172303
- /* 1830 */ 270, 272, 237, 237, 237, 18, 59, 199, 270, 149,
172304
- /* 1840 */ 246, 272, 272, 200, 234, 234, 246, 246, 71, 246,
172305
- /* 1850 */ 199, 158, 290, 62, 22, 200, 19, 20, 199, 22,
172306
- /* 1860 */ 289, 221, 221, 200, 200, 199, 199, 115, 218, 64,
172307
- /* 1870 */ 218, 218, 22, 36, 227, 126, 227, 100, 165, 221,
172308
- /* 1880 */ 224, 224, 24, 106, 107, 312, 218, 305, 113, 282,
172309
- /* 1890 */ 91, 114, 220, 116, 117, 118, 59, 282, 121, 218,
172310
- /* 1900 */ 218, 218, 200, 317, 317, 82, 221, 265, 71, 148,
172311
- /* 1910 */ 145, 265, 22, 277, 200, 158, 279, 140, 147, 25,
172312
- /* 1920 */ 146, 202, 248, 250, 249, 247, 13, 250, 194, 194,
172313
- /* 1930 */ 153, 154, 155, 156, 157, 6, 303, 100, 192, 192,
172314
- /* 1940 */ 246, 213, 192, 106, 107, 207, 213, 207, 222, 213,
172315
- /* 1950 */ 213, 114, 222, 116, 117, 118, 214, 214, 121, 4,
172316
- /* 1960 */ 207, 213, 3, 22, 303, 15, 163, 16, 23, 23,
172317
- /* 1970 */ 139, 151, 130, 25, 20, 142, 24, 16, 144, 1,
172318
- /* 1980 */ 142, 130, 130, 61, 37, 53, 300, 151, 53, 53,
172319
- /* 1990 */ 153, 154, 155, 156, 157, 53, 130, 116, 34, 1,
172320
- /* 2000 */ 141, 5, 22, 115, 161, 68, 25, 68, 75, 41,
172321
- /* 2010 */ 141, 115, 24, 20, 19, 131, 125, 23, 28, 22,
172322
- /* 2020 */ 67, 22, 22, 22, 67, 59, 24, 96, 22, 67,
172323
- /* 2030 */ 23, 149, 22, 25, 23, 23, 23, 22, 34, 141,
172324
- /* 2040 */ 37, 97, 23, 23, 116, 22, 143, 25, 34, 75,
172325
- /* 2050 */ 34, 34, 34, 88, 75, 34, 86, 23, 22, 34,
172326
- /* 2060 */ 93, 24, 34, 25, 25, 142, 142, 23, 44, 23,
172327
- /* 2070 */ 23, 23, 23, 11, 23, 25, 22, 22, 22, 141,
172328
- /* 2080 */ 23, 23, 22, 22, 25, 15, 1, 23, 25, 1,
172329
- /* 2090 */ 141, 135, 319, 319, 319, 319, 319, 319, 319, 141,
172330
- /* 2100 */ 319, 319, 319, 319, 319, 319, 319, 319, 319, 319,
172331
- /* 2110 */ 319, 319, 319, 319, 319, 319, 319, 319, 319, 319,
172332
- /* 2120 */ 319, 319, 319, 319, 319, 319, 319, 319, 319, 319,
172333
- /* 2130 */ 319, 319, 319, 319, 319, 319, 319, 319, 319, 319,
172334
- /* 2140 */ 319, 319, 319, 319, 319, 319, 319, 319, 319, 319,
172335
- /* 2150 */ 319, 319, 319, 319, 319, 319, 319, 319, 319, 319,
172336
- /* 2160 */ 319, 319, 319, 319, 319, 319, 319, 319, 319, 319,
172337
- /* 2170 */ 319, 319, 319, 319, 319, 319, 319, 319, 319, 319,
172338
- /* 2180 */ 319, 319, 319, 319, 319, 319, 319, 319, 319, 319,
172339
- /* 2190 */ 319, 319, 319, 319, 319, 319, 319, 319, 319, 319,
172340
- /* 2200 */ 319, 319, 319, 319, 319, 319, 319, 319, 319, 319,
172341
- /* 2210 */ 319, 319, 319, 319, 319, 319, 319, 319, 319, 319,
172342
- /* 2220 */ 319, 319, 319, 319, 319, 319, 319, 319, 319, 319,
172343
- /* 2230 */ 319, 319, 319, 319, 319, 319, 319, 319, 319, 319,
172344
- /* 2240 */ 319, 319, 319, 319, 319, 319, 319, 319, 319, 319,
172345
- /* 2250 */ 319, 319, 319, 319, 319, 319, 319, 319, 319, 319,
172346
- /* 2260 */ 319, 319, 319, 319, 319, 319, 319, 319, 319, 319,
172347
- /* 2270 */ 319, 319, 319, 319, 319, 319, 319, 319, 319, 319,
172348
- /* 2280 */ 319, 319, 319, 319, 319,
172535
+ /* 1330 */ 63, 135, 233, 194, 217, 218, 140, 101, 19, 20,
172536
+ /* 1340 */ 194, 22, 194, 145, 117, 194, 194, 194, 60, 194,
172537
+ /* 1350 */ 25, 22, 23, 194, 22, 36, 217, 218, 19, 20,
172538
+ /* 1360 */ 194, 22, 264, 217, 218, 217, 218, 48, 217, 218,
172539
+ /* 1370 */ 194, 269, 217, 218, 22, 36, 217, 218, 59, 194,
172540
+ /* 1380 */ 269, 31, 194, 217, 218, 53, 209, 210, 194, 39,
172541
+ /* 1390 */ 71, 194, 46, 217, 218, 116, 59, 194, 59, 194,
172542
+ /* 1400 */ 209, 210, 217, 218, 85, 217, 218, 194, 194, 90,
172543
+ /* 1410 */ 71, 217, 218, 61, 217, 218, 264, 264, 194, 100,
172544
+ /* 1420 */ 217, 218, 217, 218, 85, 106, 107, 194, 145, 90,
172545
+ /* 1430 */ 101, 217, 218, 114, 245, 116, 117, 118, 19, 100,
172546
+ /* 1440 */ 121, 217, 218, 118, 255, 106, 107, 164, 25, 19,
172547
+ /* 1450 */ 20, 241, 22, 114, 117, 116, 117, 118, 194, 24,
172548
+ /* 1460 */ 121, 115, 194, 253, 194, 194, 36, 194, 143, 138,
172549
+ /* 1470 */ 139, 19, 153, 154, 155, 156, 157, 227, 300, 301,
172550
+ /* 1480 */ 194, 217, 218, 257, 258, 217, 218, 217, 218, 59,
172551
+ /* 1490 */ 217, 218, 153, 154, 155, 156, 157, 149, 150, 5,
172552
+ /* 1500 */ 245, 71, 183, 245, 10, 11, 12, 13, 14, 194,
172553
+ /* 1510 */ 255, 17, 22, 255, 24, 85, 194, 245, 129, 23,
172554
+ /* 1520 */ 90, 25, 183, 99, 30, 227, 32, 255, 194, 194,
172555
+ /* 1530 */ 100, 256, 217, 218, 40, 116, 106, 107, 194, 217,
172556
+ /* 1540 */ 218, 152, 19, 20, 114, 22, 116, 117, 118, 97,
172557
+ /* 1550 */ 194, 121, 217, 218, 194, 194, 194, 133, 129, 36,
172558
+ /* 1560 */ 194, 217, 218, 23, 70, 25, 194, 23, 145, 25,
172559
+ /* 1570 */ 120, 121, 78, 217, 218, 81, 141, 217, 218, 217,
172560
+ /* 1580 */ 218, 152, 59, 153, 154, 155, 156, 157, 0, 1,
172561
+ /* 1590 */ 2, 194, 98, 5, 71, 23, 59, 25, 10, 11,
172562
+ /* 1600 */ 12, 13, 14, 194, 23, 17, 25, 23, 23, 25,
172563
+ /* 1610 */ 25, 194, 23, 183, 25, 7, 8, 237, 30, 194,
172564
+ /* 1620 */ 32, 19, 20, 100, 22, 121, 194, 133, 40, 106,
172565
+ /* 1630 */ 107, 108, 138, 139, 59, 131, 194, 114, 36, 116,
172566
+ /* 1640 */ 117, 118, 217, 218, 121, 194, 23, 194, 25, 217,
172567
+ /* 1650 */ 218, 194, 194, 23, 117, 25, 162, 194, 70, 217,
172568
+ /* 1660 */ 218, 59, 23, 23, 25, 25, 78, 194, 194, 81,
172569
+ /* 1670 */ 217, 218, 194, 71, 217, 218, 153, 154, 155, 156,
172570
+ /* 1680 */ 157, 194, 83, 84, 319, 23, 98, 25, 289, 194,
172571
+ /* 1690 */ 217, 218, 117, 19, 20, 153, 22, 155, 153, 194,
172572
+ /* 1700 */ 155, 194, 100, 194, 217, 218, 183, 194, 106, 107,
172573
+ /* 1710 */ 36, 194, 217, 218, 194, 194, 114, 256, 116, 117,
172574
+ /* 1720 */ 118, 133, 194, 121, 217, 218, 138, 139, 194, 23,
172575
+ /* 1730 */ 194, 25, 194, 59, 217, 218, 288, 194, 217, 218,
172576
+ /* 1740 */ 194, 194, 140, 194, 194, 71, 194, 194, 194, 194,
172577
+ /* 1750 */ 162, 217, 218, 194, 194, 153, 154, 155, 156, 157,
172578
+ /* 1760 */ 217, 218, 243, 217, 218, 192, 256, 256, 256, 244,
172579
+ /* 1770 */ 298, 215, 272, 246, 100, 294, 268, 247, 272, 247,
172580
+ /* 1780 */ 106, 107, 268, 294, 221, 183, 220, 272, 114, 220,
172581
+ /* 1790 */ 116, 117, 118, 1, 2, 121, 272, 5, 230, 220,
172582
+ /* 1800 */ 226, 260, 10, 11, 12, 13, 14, 246, 260, 17,
172583
+ /* 1810 */ 281, 260, 250, 246, 140, 250, 197, 260, 60, 141,
172584
+ /* 1820 */ 244, 201, 30, 201, 32, 38, 295, 153, 154, 155,
172585
+ /* 1830 */ 156, 157, 40, 298, 201, 151, 150, 298, 22, 43,
172586
+ /* 1840 */ 235, 18, 238, 201, 273, 238, 200, 19, 20, 271,
172587
+ /* 1850 */ 22, 238, 238, 295, 284, 18, 149, 183, 247, 273,
172588
+ /* 1860 */ 273, 271, 70, 247, 36, 247, 235, 235, 247, 201,
172589
+ /* 1870 */ 78, 200, 158, 81, 291, 62, 201, 200, 22, 222,
172590
+ /* 1880 */ 201, 290, 200, 222, 201, 200, 115, 59, 219, 219,
172591
+ /* 1890 */ 98, 219, 228, 64, 22, 126, 165, 24, 225, 71,
172592
+ /* 1900 */ 219, 225, 222, 306, 113, 313, 201, 219, 221, 219,
172593
+ /* 1910 */ 219, 283, 283, 91, 222, 82, 318, 228, 318, 266,
172594
+ /* 1920 */ 266, 148, 145, 22, 201, 133, 278, 280, 100, 147,
172595
+ /* 1930 */ 138, 139, 158, 25, 106, 107, 146, 203, 13, 195,
172596
+ /* 1940 */ 195, 247, 114, 250, 116, 117, 118, 251, 251, 121,
172597
+ /* 1950 */ 249, 248, 6, 193, 162, 193, 193, 208, 223, 304,
172598
+ /* 1960 */ 304, 301, 214, 208, 214, 214, 214, 4, 215, 223,
172599
+ /* 1970 */ 3, 215, 208, 214, 22, 163, 15, 23, 16, 23,
172600
+ /* 1980 */ 139, 153, 154, 155, 156, 157, 151, 130, 142, 25,
172601
+ /* 1990 */ 24, 20, 144, 16, 1, 142, 130, 130, 61, 130,
172602
+ /* 2000 */ 151, 53, 37, 53, 53, 116, 53, 34, 1, 141,
172603
+ /* 2010 */ 5, 183, 22, 115, 25, 161, 75, 68, 141, 41,
172604
+ /* 2020 */ 115, 24, 20, 68, 131, 19, 22, 125, 96, 59,
172605
+ /* 2030 */ 22, 22, 37, 23, 22, 67, 67, 24, 22, 28,
172606
+ /* 2040 */ 23, 67, 22, 149, 23, 23, 23, 22, 34, 25,
172607
+ /* 2050 */ 141, 23, 23, 34, 97, 116, 22, 143, 25, 75,
172608
+ /* 2060 */ 34, 34, 86, 88, 34, 34, 75, 23, 22, 34,
172609
+ /* 2070 */ 25, 24, 93, 25, 34, 142, 44, 142, 23, 23,
172610
+ /* 2080 */ 23, 23, 23, 11, 23, 25, 22, 22, 22, 1,
172611
+ /* 2090 */ 23, 23, 22, 22, 25, 135, 15, 23, 25, 141,
172612
+ /* 2100 */ 141, 1, 320, 320, 320, 320, 320, 320, 320, 320,
172613
+ /* 2110 */ 320, 320, 320, 141, 320, 320, 320, 320, 320, 320,
172614
+ /* 2120 */ 320, 320, 320, 320, 320, 320, 320, 320, 320, 320,
172615
+ /* 2130 */ 320, 320, 320, 320, 320, 320, 320, 320, 320, 320,
172616
+ /* 2140 */ 320, 320, 320, 320, 320, 320, 320, 320, 320, 320,
172617
+ /* 2150 */ 320, 320, 320, 320, 320, 320, 320, 320, 320, 320,
172618
+ /* 2160 */ 320, 320, 320, 320, 320, 320, 320, 320, 320, 320,
172619
+ /* 2170 */ 320, 320, 320, 320, 320, 320, 320, 320, 320, 320,
172620
+ /* 2180 */ 320, 320, 320, 320, 320, 320, 320, 320, 320, 320,
172621
+ /* 2190 */ 320, 320, 320, 320, 320, 320, 320, 320, 320, 320,
172622
+ /* 2200 */ 320, 320, 320, 320, 320, 320, 320, 320, 320, 320,
172623
+ /* 2210 */ 320, 320, 320, 320, 320, 320, 320, 320, 320, 320,
172624
+ /* 2220 */ 320, 320, 320, 320, 320, 320, 320, 320, 320, 320,
172625
+ /* 2230 */ 320, 320, 320, 320, 320, 320, 320, 320, 320, 320,
172626
+ /* 2240 */ 320, 320, 320, 320, 320, 320, 320, 320, 320, 320,
172627
+ /* 2250 */ 320, 320, 320, 320, 320, 320, 320, 320, 320, 320,
172628
+ /* 2260 */ 320, 320, 320, 320, 320, 320, 320, 320, 320, 320,
172629
+ /* 2270 */ 320, 320, 320, 320, 320, 320, 320, 320, 320, 320,
172630
+ /* 2280 */ 320, 320, 320, 320, 320, 320, 320, 320, 320, 320,
172631
+ /* 2290 */ 320, 320, 320, 320, 320, 320, 320, 320, 320, 320,
172349172632
};
172350172633
#define YY_SHIFT_COUNT (578)
172351172634
#define YY_SHIFT_MIN (0)
172352
-#define YY_SHIFT_MAX (2088)
172635
+#define YY_SHIFT_MAX (2100)
172353172636
static const unsigned short int yy_shift_ofst[] = {
172354
- /* 0 */ 1648, 1477, 1272, 322, 322, 1, 1319, 1478, 1491, 1837,
172355
- /* 10 */ 1837, 1837, 471, 0, 0, 214, 1093, 1837, 1837, 1837,
172356
- /* 20 */ 1837, 1837, 1837, 1837, 1837, 1837, 1837, 1837, 1837, 1837,
172357
- /* 30 */ 1837, 271, 271, 1219, 1219, 216, 88, 1, 1, 1,
172637
+ /* 0 */ 1792, 1588, 1494, 322, 322, 1, 1319, 1339, 1430, 1828,
172638
+ /* 10 */ 1828, 1828, 470, 0, 0, 214, 1093, 1828, 1828, 1828,
172639
+ /* 20 */ 1828, 1828, 1828, 1828, 1828, 1828, 1828, 1828, 1828, 1828,
172640
+ /* 30 */ 1828, 271, 271, 1198, 1198, 216, 88, 1, 1, 1,
172358172641
/* 40 */ 1, 1, 40, 111, 258, 361, 469, 512, 583, 622,
172359172642
/* 50 */ 693, 732, 803, 842, 913, 1073, 1093, 1093, 1093, 1093,
172360172643
/* 60 */ 1093, 1093, 1093, 1093, 1093, 1093, 1093, 1093, 1093, 1093,
172361
- /* 70 */ 1093, 1093, 1093, 1093, 1113, 1093, 1216, 957, 957, 1635,
172362
- /* 80 */ 1662, 1777, 1837, 1837, 1837, 1837, 1837, 1837, 1837, 1837,
172363
- /* 90 */ 1837, 1837, 1837, 1837, 1837, 1837, 1837, 1837, 1837, 1837,
172364
- /* 100 */ 1837, 1837, 1837, 1837, 1837, 1837, 1837, 1837, 1837, 1837,
172365
- /* 110 */ 1837, 1837, 1837, 1837, 1837, 1837, 1837, 1837, 1837, 1837,
172366
- /* 120 */ 1837, 1837, 1837, 1837, 1837, 1837, 1837, 1837, 1837, 1837,
172367
- /* 130 */ 1837, 137, 181, 181, 181, 181, 181, 181, 181, 94,
172368
- /* 140 */ 430, 66, 65, 112, 366, 533, 533, 740, 1257, 533,
172369
- /* 150 */ 533, 79, 79, 533, 412, 412, 412, 77, 412, 123,
172370
- /* 160 */ 113, 113, 113, 22, 22, 2100, 2100, 328, 328, 328,
172371
- /* 170 */ 239, 468, 468, 468, 468, 1015, 1015, 409, 366, 1187,
172372
- /* 180 */ 1232, 533, 533, 533, 533, 533, 533, 533, 533, 533,
172373
- /* 190 */ 533, 533, 533, 533, 533, 533, 533, 533, 533, 533,
172374
- /* 200 */ 533, 969, 621, 621, 533, 642, 788, 788, 1133, 1133,
172375
- /* 210 */ 822, 822, 67, 1193, 2100, 2100, 2100, 2100, 2100, 2100,
172376
- /* 220 */ 2100, 1307, 954, 954, 585, 472, 640, 387, 695, 538,
172377
- /* 230 */ 541, 700, 533, 533, 533, 533, 533, 533, 533, 533,
172378
- /* 240 */ 533, 533, 222, 533, 533, 533, 533, 533, 533, 533,
172379
- /* 250 */ 533, 533, 533, 533, 533, 1213, 1213, 1213, 533, 533,
172380
- /* 260 */ 533, 565, 533, 533, 533, 916, 1147, 533, 533, 1288,
172381
- /* 270 */ 533, 533, 533, 533, 533, 533, 533, 533, 639, 1280,
172382
- /* 280 */ 209, 1129, 1129, 1129, 1129, 580, 209, 209, 1209, 768,
172383
- /* 290 */ 917, 649, 1315, 1334, 405, 1334, 1383, 249, 1315, 1315,
172384
- /* 300 */ 249, 1315, 405, 1383, 1441, 464, 1245, 1417, 1417, 1417,
172385
- /* 310 */ 1323, 1323, 1323, 1323, 184, 184, 1335, 1476, 856, 1482,
172386
- /* 320 */ 1744, 1744, 1665, 1665, 1773, 1773, 1665, 1669, 1671, 1802,
172387
- /* 330 */ 1782, 1809, 1809, 1809, 1809, 1665, 1817, 1690, 1671, 1671,
172388
- /* 340 */ 1690, 1802, 1782, 1690, 1782, 1690, 1665, 1817, 1693, 1791,
172389
- /* 350 */ 1665, 1817, 1832, 1665, 1817, 1665, 1817, 1832, 1752, 1752,
172390
- /* 360 */ 1752, 1805, 1850, 1850, 1832, 1752, 1749, 1752, 1805, 1752,
172391
- /* 370 */ 1752, 1713, 1858, 1775, 1775, 1832, 1665, 1799, 1799, 1823,
172392
- /* 380 */ 1823, 1761, 1765, 1890, 1665, 1757, 1761, 1771, 1774, 1690,
172393
- /* 390 */ 1894, 1913, 1913, 1929, 1929, 1929, 2100, 2100, 2100, 2100,
172394
- /* 400 */ 2100, 2100, 2100, 2100, 2100, 2100, 2100, 2100, 2100, 2100,
172395
- /* 410 */ 2100, 207, 1220, 331, 620, 967, 806, 1074, 1499, 1432,
172396
- /* 420 */ 1463, 1479, 1419, 1422, 1557, 1512, 1598, 1599, 1644, 1645,
172397
- /* 430 */ 1654, 1660, 1555, 1505, 1684, 1462, 1670, 1563, 1619, 1593,
172398
- /* 440 */ 1676, 1679, 1613, 1680, 1554, 1558, 1689, 1692, 1605, 1589,
172399
- /* 450 */ 1955, 1959, 1941, 1803, 1950, 1951, 1945, 1946, 1831, 1820,
172400
- /* 460 */ 1842, 1948, 1948, 1952, 1833, 1954, 1834, 1961, 1978, 1838,
172401
- /* 470 */ 1851, 1948, 1852, 1922, 1947, 1948, 1836, 1932, 1935, 1936,
172402
- /* 480 */ 1942, 1866, 1881, 1964, 1859, 1998, 1996, 1980, 1888, 1843,
172403
- /* 490 */ 1937, 1981, 1939, 1933, 1968, 1869, 1896, 1988, 1993, 1995,
172404
- /* 500 */ 1884, 1891, 1997, 1953, 1999, 2000, 1994, 2001, 1957, 1966,
172405
- /* 510 */ 2002, 1931, 1990, 2006, 1962, 2003, 2007, 2004, 1882, 2010,
172406
- /* 520 */ 2011, 2012, 2008, 2013, 2015, 1944, 1898, 2019, 2020, 1928,
172407
- /* 530 */ 2014, 2023, 1903, 2022, 2016, 2017, 2018, 2021, 1965, 1974,
172408
- /* 540 */ 1970, 2024, 1979, 1967, 2025, 2034, 2036, 2037, 2038, 2039,
172409
- /* 550 */ 2028, 1923, 1924, 2044, 2022, 2046, 2047, 2048, 2049, 2050,
172410
- /* 560 */ 2051, 2054, 2062, 2055, 2056, 2057, 2058, 2060, 2061, 2059,
172411
- /* 570 */ 1956, 1938, 1949, 1958, 2063, 2064, 2070, 2085, 2088,
172644
+ /* 70 */ 1093, 1093, 1093, 1093, 1113, 1093, 1216, 957, 957, 1523,
172645
+ /* 80 */ 1602, 1674, 1828, 1828, 1828, 1828, 1828, 1828, 1828, 1828,
172646
+ /* 90 */ 1828, 1828, 1828, 1828, 1828, 1828, 1828, 1828, 1828, 1828,
172647
+ /* 100 */ 1828, 1828, 1828, 1828, 1828, 1828, 1828, 1828, 1828, 1828,
172648
+ /* 110 */ 1828, 1828, 1828, 1828, 1828, 1828, 1828, 1828, 1828, 1828,
172649
+ /* 120 */ 1828, 1828, 1828, 1828, 1828, 1828, 1828, 1828, 1828, 1828,
172650
+ /* 130 */ 1828, 137, 181, 181, 181, 181, 181, 181, 181, 94,
172651
+ /* 140 */ 479, 66, 65, 112, 366, 645, 645, 629, 1168, 645,
172652
+ /* 150 */ 645, 79, 79, 645, 795, 795, 795, 77, 795, 123,
172653
+ /* 160 */ 113, 113, 113, 22, 22, 2114, 2114, 328, 328, 328,
172654
+ /* 170 */ 239, 585, 585, 585, 585, 1031, 1031, 409, 366, 970,
172655
+ /* 180 */ 1014, 645, 645, 645, 645, 645, 645, 645, 645, 645,
172656
+ /* 190 */ 645, 645, 645, 645, 645, 645, 645, 645, 645, 645,
172657
+ /* 200 */ 645, 969, 849, 849, 645, 972, 1118, 1118, 1279, 1279,
172658
+ /* 210 */ 320, 320, 1283, 1331, 2114, 2114, 2114, 2114, 2114, 2114,
172659
+ /* 220 */ 2114, 928, 1127, 1127, 589, 414, 640, 535, 695, 539,
172660
+ /* 230 */ 649, 700, 645, 645, 645, 645, 645, 645, 645, 645,
172661
+ /* 240 */ 645, 645, 222, 645, 645, 645, 645, 645, 645, 645,
172662
+ /* 250 */ 645, 645, 645, 645, 645, 796, 796, 796, 645, 645,
172663
+ /* 260 */ 645, 800, 645, 645, 645, 486, 1145, 645, 645, 1267,
172664
+ /* 270 */ 645, 645, 645, 645, 645, 645, 645, 645, 145, 1223,
172665
+ /* 280 */ 209, 1227, 1227, 1227, 1227, 1325, 209, 209, 1196, 190,
172666
+ /* 290 */ 367, 1288, 1125, 1348, 405, 1348, 1419, 515, 1125, 1125,
172667
+ /* 300 */ 515, 1125, 405, 1419, 1029, 306, 1346, 1350, 1350, 1350,
172668
+ /* 310 */ 760, 760, 760, 760, 1423, 1423, 945, 1164, 939, 1490,
172669
+ /* 320 */ 1758, 1758, 1678, 1678, 1787, 1787, 1678, 1684, 1686, 1816,
172670
+ /* 330 */ 1796, 1823, 1823, 1823, 1823, 1678, 1837, 1707, 1686, 1686,
172671
+ /* 340 */ 1707, 1816, 1796, 1707, 1796, 1707, 1678, 1837, 1714, 1813,
172672
+ /* 350 */ 1678, 1837, 1856, 1678, 1837, 1678, 1837, 1856, 1771, 1771,
172673
+ /* 360 */ 1771, 1829, 1872, 1872, 1856, 1771, 1769, 1771, 1829, 1771,
172674
+ /* 370 */ 1771, 1731, 1873, 1791, 1791, 1856, 1678, 1822, 1822, 1833,
172675
+ /* 380 */ 1833, 1773, 1777, 1901, 1678, 1774, 1773, 1782, 1790, 1707,
172676
+ /* 390 */ 1908, 1925, 1925, 1946, 1946, 1946, 2114, 2114, 2114, 2114,
172677
+ /* 400 */ 2114, 2114, 2114, 2114, 2114, 2114, 2114, 2114, 2114, 2114,
172678
+ /* 410 */ 2114, 207, 1030, 1236, 1329, 912, 853, 1129, 1496, 1424,
172679
+ /* 420 */ 1332, 1435, 1389, 1429, 1540, 1352, 1544, 1581, 1584, 1585,
172680
+ /* 430 */ 1589, 1623, 1337, 1450, 1608, 1504, 1572, 208, 1452, 1537,
172681
+ /* 440 */ 1630, 1639, 1599, 1640, 1542, 1545, 1662, 1706, 1575, 859,
172682
+ /* 450 */ 1963, 1967, 1952, 1812, 1961, 1962, 1954, 1956, 1841, 1835,
172683
+ /* 460 */ 1857, 1964, 1964, 1966, 1846, 1971, 1848, 1977, 1993, 1853,
172684
+ /* 470 */ 1866, 1964, 1867, 1937, 1965, 1964, 1849, 1948, 1950, 1951,
172685
+ /* 480 */ 1953, 1869, 1889, 1973, 1868, 2007, 2005, 1990, 1898, 1854,
172686
+ /* 490 */ 1949, 1989, 1955, 1941, 1978, 1877, 1905, 1997, 2002, 2006,
172687
+ /* 500 */ 1893, 1902, 2004, 1968, 2008, 2009, 2010, 2012, 1969, 1970,
172688
+ /* 510 */ 2013, 1932, 2011, 2016, 1974, 1995, 2017, 2014, 1894, 2020,
172689
+ /* 520 */ 2021, 2022, 2024, 2023, 2025, 1957, 1909, 2028, 2029, 1939,
172690
+ /* 530 */ 2019, 2034, 1914, 2033, 2026, 2027, 2030, 2031, 1975, 1984,
172691
+ /* 540 */ 1976, 2032, 1991, 1979, 2035, 2044, 2046, 2047, 2045, 2048,
172692
+ /* 550 */ 2040, 1933, 1935, 2055, 2033, 2056, 2057, 2058, 2059, 2060,
172693
+ /* 560 */ 2061, 2064, 2072, 2065, 2066, 2067, 2068, 2070, 2071, 2069,
172694
+ /* 570 */ 1960, 1958, 1959, 1972, 2073, 2074, 2081, 2088, 2100,
172412172695
};
172413172696
#define YY_REDUCE_COUNT (410)
172414
-#define YY_REDUCE_MIN (-271)
172415
-#define YY_REDUCE_MAX (1753)
172697
+#define YY_REDUCE_MIN (-272)
172698
+#define YY_REDUCE_MAX (1764)
172416172699
static const short yy_reduce_ofst[] = {
172417
- /* 0 */ -125, 733, 789, 241, 293, -123, -193, -191, -183, -187,
172418
- /* 10 */ 166, 238, 133, -207, -199, -267, -176, -6, 204, 489,
172419
- /* 20 */ 576, 598, -175, 686, 860, 615, 725, 1014, 778, 781,
172420
- /* 30 */ 857, 616, 887, 87, 240, -192, 408, 626, 796, 843,
172421
- /* 40 */ 854, 1004, -271, -271, -271, -271, -271, -271, -271, -271,
172422
- /* 50 */ -271, -271, -271, -271, -271, -271, -271, -271, -271, -271,
172423
- /* 60 */ -271, -271, -271, -271, -271, -271, -271, -271, -271, -271,
172424
- /* 70 */ -271, -271, -271, -271, -271, -271, -271, -271, -271, 80,
172425
- /* 80 */ 83, 313, 886, 888, 918, 938, 1021, 1034, 1036, 1141,
172426
- /* 90 */ 1159, 1163, 1166, 1168, 1170, 1176, 1178, 1180, 1184, 1196,
172427
- /* 100 */ 1198, 1205, 1215, 1225, 1227, 1236, 1252, 1254, 1264, 1303,
172428
- /* 110 */ 1309, 1312, 1322, 1325, 1328, 1337, 1340, 1343, 1353, 1371,
172429
- /* 120 */ 1373, 1384, 1386, 1411, 1413, 1420, 1424, 1426, 1458, 1470,
172430
- /* 130 */ 1473, -271, -271, -271, -271, -271, -271, -271, -271, -271,
172431
- /* 140 */ -271, -271, 138, 459, 396, -158, 470, 302, -212, 521,
172432
- /* 150 */ 201, -195, -92, 559, 630, 632, 630, -271, 632, 901,
172433
- /* 160 */ 63, 407, 670, -271, -271, -271, -271, 161, 161, 161,
172434
- /* 170 */ 251, 335, 847, 979, 1097, 537, 588, 618, 628, 688,
172435
- /* 180 */ 688, -166, -161, 674, 787, 794, 799, 852, 996, -122,
172436
- /* 190 */ 837, -120, 1018, 1035, 415, 1047, 1001, 958, 1082, 400,
172437
- /* 200 */ 1099, 779, 1137, 1142, 263, 1083, 1145, 1150, 1041, 1139,
172438
- /* 210 */ 965, 1050, 362, 849, 752, 629, 675, 1162, 1173, 1090,
172439
- /* 220 */ 1195, -194, 56, 185, -135, 232, 522, 560, 571, 601,
172440
- /* 230 */ 617, 669, 683, 711, 850, 893, 1000, 1040, 1049, 1081,
172441
- /* 240 */ 1087, 1101, 392, 1114, 1123, 1155, 1161, 1175, 1271, 1293,
172442
- /* 250 */ 1299, 1330, 1339, 1342, 1347, 593, 1282, 1286, 1350, 1359,
172443
- /* 260 */ 1368, 1314, 1480, 1483, 1507, 1085, 1338, 1526, 1527, 1487,
172444
- /* 270 */ 1531, 560, 1532, 1534, 1535, 1538, 1539, 1541, 1448, 1450,
172445
- /* 280 */ 1496, 1484, 1485, 1489, 1490, 1314, 1496, 1496, 1504, 1536,
172446
- /* 290 */ 1564, 1451, 1486, 1492, 1509, 1493, 1465, 1515, 1494, 1495,
172447
- /* 300 */ 1517, 1500, 1519, 1474, 1550, 1543, 1548, 1556, 1565, 1566,
172448
- /* 310 */ 1518, 1523, 1542, 1544, 1525, 1545, 1513, 1553, 1552, 1604,
172449
- /* 320 */ 1508, 1510, 1608, 1609, 1520, 1528, 1612, 1540, 1559, 1560,
172450
- /* 330 */ 1592, 1591, 1595, 1596, 1597, 1629, 1638, 1594, 1569, 1570,
172451
- /* 340 */ 1600, 1568, 1610, 1601, 1611, 1603, 1643, 1651, 1562, 1571,
172452
- /* 350 */ 1655, 1659, 1640, 1663, 1666, 1664, 1667, 1641, 1650, 1652,
172453
- /* 360 */ 1653, 1647, 1656, 1657, 1658, 1668, 1672, 1681, 1649, 1682,
172454
- /* 370 */ 1683, 1573, 1582, 1607, 1615, 1685, 1702, 1586, 1587, 1642,
172455
- /* 380 */ 1646, 1673, 1675, 1636, 1714, 1637, 1677, 1674, 1678, 1694,
172456
- /* 390 */ 1719, 1734, 1735, 1746, 1747, 1750, 1633, 1661, 1686, 1738,
172457
- /* 400 */ 1728, 1733, 1736, 1737, 1740, 1726, 1730, 1742, 1743, 1748,
172458
- /* 410 */ 1753,
172700
+ /* 0 */ -126, 731, 343, 240, 835, -124, -194, -192, -184, -188,
172701
+ /* 10 */ 165, 237, 132, -208, -200, -268, -177, -7, 203, 310,
172702
+ /* 20 */ 312, 466, -176, 576, 597, 82, 615, 685, 706, 779,
172703
+ /* 30 */ 833, 886, 960, 86, 401, -193, 623, 625, 737, 794,
172704
+ /* 40 */ 837, 988, -272, -272, -272, -272, -272, -272, -272, -272,
172705
+ /* 50 */ -272, -272, -272, -272, -272, -272, -272, -272, -272, -272,
172706
+ /* 60 */ -272, -272, -272, -272, -272, -272, -272, -272, -272, -272,
172707
+ /* 70 */ -272, -272, -272, -272, -272, -272, -272, -272, -272, 503,
172708
+ /* 80 */ 838, 916, 1015, 1019, 1037, 1059, 1084, 1090, 1095, 1117,
172709
+ /* 90 */ 1139, 1146, 1148, 1151, 1155, 1159, 1166, 1176, 1185, 1188,
172710
+ /* 100 */ 1194, 1197, 1203, 1205, 1214, 1224, 1264, 1268, 1270, 1273,
172711
+ /* 110 */ 1315, 1322, 1335, 1344, 1356, 1360, 1362, 1425, 1432, 1442,
172712
+ /* 120 */ 1453, 1457, 1473, 1487, 1495, 1507, 1517, 1521, 1534, 1543,
172713
+ /* 130 */ 1546, -272, -272, -272, -272, -272, -272, -272, -272, -272,
172714
+ /* 140 */ -272, -272, 204, 248, 455, -159, 358, 482, -213, 577,
172715
+ /* 150 */ 411, -196, -93, 293, 627, 631, 627, -272, 631, 687,
172716
+ /* 160 */ 120, 783, 840, -272, -272, -272, -272, 273, 273, 273,
172717
+ /* 170 */ 160, 980, 1048, 1102, 1111, 313, 376, 193, 452, 471,
172718
+ /* 180 */ 471, -167, -162, 460, 506, 736, 792, 847, 854, -123,
172719
+ /* 190 */ 613, -121, 844, 1098, 897, 1152, 1056, 520, 1099, 519,
172720
+ /* 200 */ 1153, 679, 621, 821, 262, 170, 898, 924, 841, 982,
172721
+ /* 210 */ 1177, 1191, 349, 1210, 1178, 628, 1189, 1255, 1258, 1226,
172722
+ /* 220 */ 1272, -195, -8, 184, -136, 255, 399, 410, 453, 566,
172723
+ /* 230 */ 578, 616, 633, 743, 998, 1103, 1106, 1213, 1233, 1271,
172724
+ /* 240 */ 1286, 1334, 551, 1361, 1366, 1372, 1397, 1409, 1417, 1451,
172725
+ /* 250 */ 1458, 1463, 1474, 1505, 1509, 767, 1250, 1298, 1478, 1513,
172726
+ /* 260 */ 1520, 421, 1528, 1536, 1538, 1275, 1365, 1547, 1549, 1380,
172727
+ /* 270 */ 1550, 410, 1552, 1553, 1554, 1555, 1559, 1560, 1399, 1448,
172728
+ /* 280 */ 1519, 1461, 1510, 1511, 1512, 421, 1519, 1519, 1525, 1556,
172729
+ /* 290 */ 1573, 1472, 1500, 1508, 1527, 1514, 1481, 1530, 1506, 1515,
172730
+ /* 300 */ 1532, 1524, 1561, 1489, 1563, 1568, 1574, 1566, 1569, 1579,
172731
+ /* 310 */ 1541, 1548, 1551, 1557, 1562, 1565, 1529, 1567, 1576, 1619,
172732
+ /* 320 */ 1535, 1539, 1620, 1622, 1531, 1558, 1633, 1570, 1571, 1578,
172733
+ /* 330 */ 1605, 1604, 1607, 1613, 1614, 1642, 1646, 1611, 1586, 1587,
172734
+ /* 340 */ 1616, 1590, 1631, 1618, 1632, 1621, 1668, 1671, 1583, 1591,
172735
+ /* 350 */ 1675, 1677, 1657, 1679, 1682, 1683, 1685, 1661, 1669, 1670,
172736
+ /* 360 */ 1672, 1664, 1673, 1676, 1680, 1681, 1687, 1688, 1689, 1690,
172737
+ /* 370 */ 1691, 1592, 1597, 1628, 1629, 1692, 1705, 1598, 1600, 1653,
172738
+ /* 380 */ 1654, 1696, 1693, 1648, 1723, 1647, 1697, 1701, 1703, 1694,
172739
+ /* 390 */ 1734, 1744, 1745, 1760, 1762, 1763, 1655, 1656, 1660, 1749,
172740
+ /* 400 */ 1748, 1750, 1751, 1752, 1755, 1735, 1746, 1753, 1756, 1759,
172741
+ /* 410 */ 1764,
172459172742
};
172460172743
static const YYACTIONTYPE yy_default[] = {
172461
- /* 0 */ 1648, 1648, 1648, 1478, 1243, 1354, 1243, 1243, 1243, 1478,
172462
- /* 10 */ 1478, 1478, 1243, 1384, 1384, 1531, 1276, 1243, 1243, 1243,
172463
- /* 20 */ 1243, 1243, 1243, 1243, 1243, 1243, 1243, 1243, 1477, 1243,
172464
- /* 30 */ 1243, 1243, 1243, 1564, 1564, 1243, 1243, 1243, 1243, 1243,
172465
- /* 40 */ 1243, 1243, 1243, 1393, 1243, 1400, 1243, 1243, 1243, 1243,
172466
- /* 50 */ 1243, 1479, 1480, 1243, 1243, 1243, 1530, 1532, 1495, 1407,
172467
- /* 60 */ 1406, 1405, 1404, 1513, 1372, 1398, 1391, 1395, 1474, 1475,
172468
- /* 70 */ 1473, 1626, 1480, 1479, 1243, 1394, 1442, 1458, 1441, 1243,
172469
- /* 80 */ 1243, 1243, 1243, 1243, 1243, 1243, 1243, 1243, 1243, 1243,
172470
- /* 90 */ 1243, 1243, 1243, 1243, 1243, 1243, 1243, 1243, 1243, 1243,
172471
- /* 100 */ 1243, 1243, 1243, 1243, 1243, 1243, 1243, 1243, 1243, 1243,
172472
- /* 110 */ 1243, 1243, 1243, 1243, 1243, 1243, 1243, 1243, 1243, 1243,
172473
- /* 120 */ 1243, 1243, 1243, 1243, 1243, 1243, 1243, 1243, 1243, 1243,
172474
- /* 130 */ 1243, 1450, 1457, 1456, 1455, 1464, 1454, 1451, 1444, 1443,
172475
- /* 140 */ 1445, 1446, 1243, 1243, 1267, 1243, 1243, 1264, 1318, 1243,
172476
- /* 150 */ 1243, 1243, 1243, 1243, 1550, 1549, 1243, 1447, 1243, 1276,
172477
- /* 160 */ 1435, 1434, 1433, 1461, 1448, 1460, 1459, 1538, 1600, 1599,
172478
- /* 170 */ 1496, 1243, 1243, 1243, 1243, 1243, 1243, 1564, 1243, 1243,
172479
- /* 180 */ 1243, 1243, 1243, 1243, 1243, 1243, 1243, 1243, 1243, 1243,
172480
- /* 190 */ 1243, 1243, 1243, 1243, 1243, 1243, 1243, 1243, 1243, 1243,
172481
- /* 200 */ 1243, 1374, 1564, 1564, 1243, 1276, 1564, 1564, 1375, 1375,
172482
- /* 210 */ 1272, 1272, 1378, 1243, 1545, 1345, 1345, 1345, 1345, 1354,
172483
- /* 220 */ 1345, 1243, 1243, 1243, 1243, 1243, 1243, 1243, 1243, 1243,
172484
- /* 230 */ 1243, 1243, 1243, 1243, 1243, 1243, 1535, 1533, 1243, 1243,
172485
- /* 240 */ 1243, 1243, 1243, 1243, 1243, 1243, 1243, 1243, 1243, 1243,
172486
- /* 250 */ 1243, 1243, 1243, 1243, 1243, 1243, 1243, 1243, 1243, 1243,
172487
- /* 260 */ 1243, 1243, 1243, 1243, 1243, 1350, 1243, 1243, 1243, 1243,
172488
- /* 270 */ 1243, 1243, 1243, 1243, 1243, 1243, 1243, 1593, 1243, 1508,
172489
- /* 280 */ 1332, 1350, 1350, 1350, 1350, 1352, 1333, 1331, 1344, 1277,
172490
- /* 290 */ 1250, 1640, 1410, 1399, 1351, 1399, 1637, 1397, 1410, 1410,
172491
- /* 300 */ 1397, 1410, 1351, 1637, 1293, 1615, 1288, 1384, 1384, 1384,
172492
- /* 310 */ 1374, 1374, 1374, 1374, 1378, 1378, 1476, 1351, 1344, 1243,
172493
- /* 320 */ 1640, 1640, 1360, 1360, 1639, 1639, 1360, 1496, 1623, 1419,
172494
- /* 330 */ 1321, 1327, 1327, 1327, 1327, 1360, 1261, 1397, 1623, 1623,
172495
- /* 340 */ 1397, 1419, 1321, 1397, 1321, 1397, 1360, 1261, 1512, 1634,
172496
- /* 350 */ 1360, 1261, 1486, 1360, 1261, 1360, 1261, 1486, 1319, 1319,
172497
- /* 360 */ 1319, 1308, 1243, 1243, 1486, 1319, 1293, 1319, 1308, 1319,
172498
- /* 370 */ 1319, 1582, 1243, 1490, 1490, 1486, 1360, 1574, 1574, 1387,
172499
- /* 380 */ 1387, 1392, 1378, 1481, 1360, 1243, 1392, 1390, 1388, 1397,
172500
- /* 390 */ 1311, 1596, 1596, 1592, 1592, 1592, 1645, 1645, 1545, 1608,
172501
- /* 400 */ 1276, 1276, 1276, 1276, 1608, 1295, 1295, 1277, 1277, 1276,
172502
- /* 410 */ 1608, 1243, 1243, 1243, 1243, 1243, 1243, 1603, 1243, 1540,
172503
- /* 420 */ 1497, 1364, 1243, 1243, 1243, 1243, 1243, 1243, 1243, 1243,
172504
- /* 430 */ 1243, 1243, 1243, 1243, 1243, 1243, 1243, 1243, 1551, 1243,
172505
- /* 440 */ 1243, 1243, 1243, 1243, 1243, 1243, 1243, 1243, 1243, 1424,
172506
- /* 450 */ 1243, 1246, 1542, 1243, 1243, 1243, 1243, 1243, 1243, 1243,
172507
- /* 460 */ 1243, 1401, 1402, 1365, 1243, 1243, 1243, 1243, 1243, 1243,
172508
- /* 470 */ 1243, 1416, 1243, 1243, 1243, 1411, 1243, 1243, 1243, 1243,
172509
- /* 480 */ 1243, 1243, 1243, 1243, 1636, 1243, 1243, 1243, 1243, 1243,
172510
- /* 490 */ 1243, 1511, 1510, 1243, 1243, 1362, 1243, 1243, 1243, 1243,
172511
- /* 500 */ 1243, 1243, 1243, 1243, 1243, 1243, 1243, 1243, 1243, 1291,
172512
- /* 510 */ 1243, 1243, 1243, 1243, 1243, 1243, 1243, 1243, 1243, 1243,
172513
- /* 520 */ 1243, 1243, 1243, 1243, 1243, 1243, 1243, 1243, 1243, 1243,
172514
- /* 530 */ 1243, 1243, 1243, 1389, 1243, 1243, 1243, 1243, 1243, 1243,
172515
- /* 540 */ 1243, 1243, 1243, 1243, 1243, 1243, 1243, 1243, 1579, 1379,
172516
- /* 550 */ 1243, 1243, 1243, 1243, 1627, 1243, 1243, 1243, 1243, 1243,
172517
- /* 560 */ 1243, 1243, 1243, 1243, 1243, 1243, 1243, 1243, 1243, 1619,
172518
- /* 570 */ 1335, 1425, 1243, 1428, 1265, 1243, 1255, 1243, 1243,
172744
+ /* 0 */ 1651, 1651, 1651, 1480, 1245, 1356, 1245, 1245, 1245, 1480,
172745
+ /* 10 */ 1480, 1480, 1245, 1386, 1386, 1533, 1278, 1245, 1245, 1245,
172746
+ /* 20 */ 1245, 1245, 1245, 1245, 1245, 1245, 1245, 1245, 1479, 1245,
172747
+ /* 30 */ 1245, 1245, 1245, 1566, 1566, 1245, 1245, 1245, 1245, 1245,
172748
+ /* 40 */ 1245, 1245, 1245, 1395, 1245, 1402, 1245, 1245, 1245, 1245,
172749
+ /* 50 */ 1245, 1481, 1482, 1245, 1245, 1245, 1532, 1534, 1497, 1409,
172750
+ /* 60 */ 1408, 1407, 1406, 1515, 1374, 1400, 1393, 1397, 1476, 1477,
172751
+ /* 70 */ 1475, 1629, 1482, 1481, 1245, 1396, 1444, 1460, 1443, 1245,
172752
+ /* 80 */ 1245, 1245, 1245, 1245, 1245, 1245, 1245, 1245, 1245, 1245,
172753
+ /* 90 */ 1245, 1245, 1245, 1245, 1245, 1245, 1245, 1245, 1245, 1245,
172754
+ /* 100 */ 1245, 1245, 1245, 1245, 1245, 1245, 1245, 1245, 1245, 1245,
172755
+ /* 110 */ 1245, 1245, 1245, 1245, 1245, 1245, 1245, 1245, 1245, 1245,
172756
+ /* 120 */ 1245, 1245, 1245, 1245, 1245, 1245, 1245, 1245, 1245, 1245,
172757
+ /* 130 */ 1245, 1452, 1459, 1458, 1457, 1466, 1456, 1453, 1446, 1445,
172758
+ /* 140 */ 1447, 1448, 1245, 1245, 1269, 1245, 1245, 1266, 1320, 1245,
172759
+ /* 150 */ 1245, 1245, 1245, 1245, 1552, 1551, 1245, 1449, 1245, 1278,
172760
+ /* 160 */ 1437, 1436, 1435, 1463, 1450, 1462, 1461, 1540, 1603, 1602,
172761
+ /* 170 */ 1498, 1245, 1245, 1245, 1245, 1245, 1245, 1566, 1245, 1245,
172762
+ /* 180 */ 1245, 1245, 1245, 1245, 1245, 1245, 1245, 1245, 1245, 1245,
172763
+ /* 190 */ 1245, 1245, 1245, 1245, 1245, 1245, 1245, 1245, 1245, 1245,
172764
+ /* 200 */ 1245, 1376, 1566, 1566, 1245, 1278, 1566, 1566, 1377, 1377,
172765
+ /* 210 */ 1274, 1274, 1380, 1245, 1547, 1347, 1347, 1347, 1347, 1356,
172766
+ /* 220 */ 1347, 1245, 1245, 1245, 1245, 1245, 1245, 1245, 1245, 1245,
172767
+ /* 230 */ 1245, 1245, 1245, 1245, 1245, 1245, 1537, 1535, 1245, 1245,
172768
+ /* 240 */ 1245, 1245, 1245, 1245, 1245, 1245, 1245, 1245, 1245, 1245,
172769
+ /* 250 */ 1245, 1245, 1245, 1245, 1245, 1245, 1245, 1245, 1245, 1245,
172770
+ /* 260 */ 1245, 1245, 1245, 1245, 1245, 1352, 1245, 1245, 1245, 1245,
172771
+ /* 270 */ 1245, 1245, 1245, 1245, 1245, 1245, 1245, 1596, 1245, 1510,
172772
+ /* 280 */ 1334, 1352, 1352, 1352, 1352, 1354, 1335, 1333, 1346, 1279,
172773
+ /* 290 */ 1252, 1643, 1412, 1401, 1353, 1401, 1640, 1399, 1412, 1412,
172774
+ /* 300 */ 1399, 1412, 1353, 1640, 1295, 1618, 1290, 1386, 1386, 1386,
172775
+ /* 310 */ 1376, 1376, 1376, 1376, 1380, 1380, 1478, 1353, 1346, 1245,
172776
+ /* 320 */ 1643, 1643, 1362, 1362, 1642, 1642, 1362, 1498, 1626, 1421,
172777
+ /* 330 */ 1323, 1329, 1329, 1329, 1329, 1362, 1263, 1399, 1626, 1626,
172778
+ /* 340 */ 1399, 1421, 1323, 1399, 1323, 1399, 1362, 1263, 1514, 1637,
172779
+ /* 350 */ 1362, 1263, 1488, 1362, 1263, 1362, 1263, 1488, 1321, 1321,
172780
+ /* 360 */ 1321, 1310, 1245, 1245, 1488, 1321, 1295, 1321, 1310, 1321,
172781
+ /* 370 */ 1321, 1584, 1245, 1492, 1492, 1488, 1362, 1576, 1576, 1389,
172782
+ /* 380 */ 1389, 1394, 1380, 1483, 1362, 1245, 1394, 1392, 1390, 1399,
172783
+ /* 390 */ 1313, 1599, 1599, 1595, 1595, 1595, 1648, 1648, 1547, 1611,
172784
+ /* 400 */ 1278, 1278, 1278, 1278, 1611, 1297, 1297, 1279, 1279, 1278,
172785
+ /* 410 */ 1611, 1245, 1245, 1245, 1245, 1245, 1245, 1606, 1245, 1542,
172786
+ /* 420 */ 1499, 1366, 1245, 1245, 1245, 1245, 1245, 1245, 1245, 1245,
172787
+ /* 430 */ 1245, 1245, 1245, 1245, 1245, 1245, 1245, 1245, 1553, 1245,
172788
+ /* 440 */ 1245, 1245, 1245, 1245, 1245, 1245, 1245, 1245, 1245, 1426,
172789
+ /* 450 */ 1245, 1248, 1544, 1245, 1245, 1245, 1245, 1245, 1245, 1245,
172790
+ /* 460 */ 1245, 1403, 1404, 1367, 1245, 1245, 1245, 1245, 1245, 1245,
172791
+ /* 470 */ 1245, 1418, 1245, 1245, 1245, 1413, 1245, 1245, 1245, 1245,
172792
+ /* 480 */ 1245, 1245, 1245, 1245, 1639, 1245, 1245, 1245, 1245, 1245,
172793
+ /* 490 */ 1245, 1513, 1512, 1245, 1245, 1364, 1245, 1245, 1245, 1245,
172794
+ /* 500 */ 1245, 1245, 1245, 1245, 1245, 1245, 1245, 1245, 1245, 1293,
172795
+ /* 510 */ 1245, 1245, 1245, 1245, 1245, 1245, 1245, 1245, 1245, 1245,
172796
+ /* 520 */ 1245, 1245, 1245, 1245, 1245, 1245, 1245, 1245, 1245, 1245,
172797
+ /* 530 */ 1245, 1245, 1245, 1391, 1245, 1245, 1245, 1245, 1245, 1245,
172798
+ /* 540 */ 1245, 1245, 1245, 1245, 1245, 1245, 1245, 1245, 1581, 1381,
172799
+ /* 550 */ 1245, 1245, 1245, 1245, 1630, 1245, 1245, 1245, 1245, 1245,
172800
+ /* 560 */ 1245, 1245, 1245, 1245, 1245, 1245, 1245, 1245, 1245, 1622,
172801
+ /* 570 */ 1337, 1427, 1245, 1430, 1267, 1245, 1257, 1245, 1245,
172519172802
};
172520172803
/********** End of lemon-generated parsing tables *****************************/
172521172804
172522172805
/* The next table maps tokens (terminal symbols) into fallback tokens.
172523172806
** If a construct like the following:
@@ -172716,10 +172999,11 @@
172716172999
0, /* SELECT_COLUMN => nothing */
172717173000
0, /* IF_NULL_ROW => nothing */
172718173001
0, /* ASTERISK => nothing */
172719173002
0, /* SPAN => nothing */
172720173003
0, /* ERROR => nothing */
173004
+ 0, /* QNUMBER => nothing */
172721173005
0, /* SPACE => nothing */
172722173006
0, /* ILLEGAL => nothing */
172723173007
};
172724173008
#endif /* YYFALLBACK */
172725173009
@@ -172984,146 +173268,147 @@
172984173268
/* 178 */ "SELECT_COLUMN",
172985173269
/* 179 */ "IF_NULL_ROW",
172986173270
/* 180 */ "ASTERISK",
172987173271
/* 181 */ "SPAN",
172988173272
/* 182 */ "ERROR",
172989
- /* 183 */ "SPACE",
172990
- /* 184 */ "ILLEGAL",
172991
- /* 185 */ "input",
172992
- /* 186 */ "cmdlist",
172993
- /* 187 */ "ecmd",
172994
- /* 188 */ "cmdx",
172995
- /* 189 */ "explain",
172996
- /* 190 */ "cmd",
172997
- /* 191 */ "transtype",
172998
- /* 192 */ "trans_opt",
172999
- /* 193 */ "nm",
173000
- /* 194 */ "savepoint_opt",
173001
- /* 195 */ "create_table",
173002
- /* 196 */ "create_table_args",
173003
- /* 197 */ "createkw",
173004
- /* 198 */ "temp",
173005
- /* 199 */ "ifnotexists",
173006
- /* 200 */ "dbnm",
173007
- /* 201 */ "columnlist",
173008
- /* 202 */ "conslist_opt",
173009
- /* 203 */ "table_option_set",
173010
- /* 204 */ "select",
173011
- /* 205 */ "table_option",
173012
- /* 206 */ "columnname",
173013
- /* 207 */ "carglist",
173014
- /* 208 */ "typetoken",
173015
- /* 209 */ "typename",
173016
- /* 210 */ "signed",
173017
- /* 211 */ "plus_num",
173018
- /* 212 */ "minus_num",
173019
- /* 213 */ "scanpt",
173020
- /* 214 */ "scantok",
173021
- /* 215 */ "ccons",
173022
- /* 216 */ "term",
173023
- /* 217 */ "expr",
173024
- /* 218 */ "onconf",
173025
- /* 219 */ "sortorder",
173026
- /* 220 */ "autoinc",
173027
- /* 221 */ "eidlist_opt",
173028
- /* 222 */ "refargs",
173029
- /* 223 */ "defer_subclause",
173030
- /* 224 */ "generated",
173031
- /* 225 */ "refarg",
173032
- /* 226 */ "refact",
173033
- /* 227 */ "init_deferred_pred_opt",
173034
- /* 228 */ "conslist",
173035
- /* 229 */ "tconscomma",
173036
- /* 230 */ "tcons",
173037
- /* 231 */ "sortlist",
173038
- /* 232 */ "eidlist",
173039
- /* 233 */ "defer_subclause_opt",
173040
- /* 234 */ "orconf",
173041
- /* 235 */ "resolvetype",
173042
- /* 236 */ "raisetype",
173043
- /* 237 */ "ifexists",
173044
- /* 238 */ "fullname",
173045
- /* 239 */ "selectnowith",
173046
- /* 240 */ "oneselect",
173047
- /* 241 */ "wqlist",
173048
- /* 242 */ "multiselect_op",
173049
- /* 243 */ "distinct",
173050
- /* 244 */ "selcollist",
173051
- /* 245 */ "from",
173052
- /* 246 */ "where_opt",
173053
- /* 247 */ "groupby_opt",
173054
- /* 248 */ "having_opt",
173055
- /* 249 */ "orderby_opt",
173056
- /* 250 */ "limit_opt",
173057
- /* 251 */ "window_clause",
173058
- /* 252 */ "values",
173059
- /* 253 */ "nexprlist",
173060
- /* 254 */ "sclp",
173061
- /* 255 */ "as",
173062
- /* 256 */ "seltablist",
173063
- /* 257 */ "stl_prefix",
173064
- /* 258 */ "joinop",
173065
- /* 259 */ "on_using",
173066
- /* 260 */ "indexed_by",
173067
- /* 261 */ "exprlist",
173068
- /* 262 */ "xfullname",
173069
- /* 263 */ "idlist",
173070
- /* 264 */ "indexed_opt",
173071
- /* 265 */ "nulls",
173072
- /* 266 */ "with",
173073
- /* 267 */ "where_opt_ret",
173074
- /* 268 */ "setlist",
173075
- /* 269 */ "insert_cmd",
173076
- /* 270 */ "idlist_opt",
173077
- /* 271 */ "upsert",
173078
- /* 272 */ "returning",
173079
- /* 273 */ "filter_over",
173080
- /* 274 */ "likeop",
173081
- /* 275 */ "between_op",
173082
- /* 276 */ "in_op",
173083
- /* 277 */ "paren_exprlist",
173084
- /* 278 */ "case_operand",
173085
- /* 279 */ "case_exprlist",
173086
- /* 280 */ "case_else",
173087
- /* 281 */ "uniqueflag",
173088
- /* 282 */ "collate",
173089
- /* 283 */ "vinto",
173090
- /* 284 */ "nmnum",
173091
- /* 285 */ "trigger_decl",
173092
- /* 286 */ "trigger_cmd_list",
173093
- /* 287 */ "trigger_time",
173094
- /* 288 */ "trigger_event",
173095
- /* 289 */ "foreach_clause",
173096
- /* 290 */ "when_clause",
173097
- /* 291 */ "trigger_cmd",
173098
- /* 292 */ "trnm",
173099
- /* 293 */ "tridxby",
173100
- /* 294 */ "database_kw_opt",
173101
- /* 295 */ "key_opt",
173102
- /* 296 */ "add_column_fullname",
173103
- /* 297 */ "kwcolumn_opt",
173104
- /* 298 */ "create_vtab",
173105
- /* 299 */ "vtabarglist",
173106
- /* 300 */ "vtabarg",
173107
- /* 301 */ "vtabargtoken",
173108
- /* 302 */ "lp",
173109
- /* 303 */ "anylist",
173110
- /* 304 */ "wqitem",
173111
- /* 305 */ "wqas",
173112
- /* 306 */ "windowdefn_list",
173113
- /* 307 */ "windowdefn",
173114
- /* 308 */ "window",
173115
- /* 309 */ "frame_opt",
173116
- /* 310 */ "part_opt",
173117
- /* 311 */ "filter_clause",
173118
- /* 312 */ "over_clause",
173119
- /* 313 */ "range_or_rows",
173120
- /* 314 */ "frame_bound",
173121
- /* 315 */ "frame_bound_s",
173122
- /* 316 */ "frame_bound_e",
173123
- /* 317 */ "frame_exclude_opt",
173124
- /* 318 */ "frame_exclude",
173273
+ /* 183 */ "QNUMBER",
173274
+ /* 184 */ "SPACE",
173275
+ /* 185 */ "ILLEGAL",
173276
+ /* 186 */ "input",
173277
+ /* 187 */ "cmdlist",
173278
+ /* 188 */ "ecmd",
173279
+ /* 189 */ "cmdx",
173280
+ /* 190 */ "explain",
173281
+ /* 191 */ "cmd",
173282
+ /* 192 */ "transtype",
173283
+ /* 193 */ "trans_opt",
173284
+ /* 194 */ "nm",
173285
+ /* 195 */ "savepoint_opt",
173286
+ /* 196 */ "create_table",
173287
+ /* 197 */ "create_table_args",
173288
+ /* 198 */ "createkw",
173289
+ /* 199 */ "temp",
173290
+ /* 200 */ "ifnotexists",
173291
+ /* 201 */ "dbnm",
173292
+ /* 202 */ "columnlist",
173293
+ /* 203 */ "conslist_opt",
173294
+ /* 204 */ "table_option_set",
173295
+ /* 205 */ "select",
173296
+ /* 206 */ "table_option",
173297
+ /* 207 */ "columnname",
173298
+ /* 208 */ "carglist",
173299
+ /* 209 */ "typetoken",
173300
+ /* 210 */ "typename",
173301
+ /* 211 */ "signed",
173302
+ /* 212 */ "plus_num",
173303
+ /* 213 */ "minus_num",
173304
+ /* 214 */ "scanpt",
173305
+ /* 215 */ "scantok",
173306
+ /* 216 */ "ccons",
173307
+ /* 217 */ "term",
173308
+ /* 218 */ "expr",
173309
+ /* 219 */ "onconf",
173310
+ /* 220 */ "sortorder",
173311
+ /* 221 */ "autoinc",
173312
+ /* 222 */ "eidlist_opt",
173313
+ /* 223 */ "refargs",
173314
+ /* 224 */ "defer_subclause",
173315
+ /* 225 */ "generated",
173316
+ /* 226 */ "refarg",
173317
+ /* 227 */ "refact",
173318
+ /* 228 */ "init_deferred_pred_opt",
173319
+ /* 229 */ "conslist",
173320
+ /* 230 */ "tconscomma",
173321
+ /* 231 */ "tcons",
173322
+ /* 232 */ "sortlist",
173323
+ /* 233 */ "eidlist",
173324
+ /* 234 */ "defer_subclause_opt",
173325
+ /* 235 */ "orconf",
173326
+ /* 236 */ "resolvetype",
173327
+ /* 237 */ "raisetype",
173328
+ /* 238 */ "ifexists",
173329
+ /* 239 */ "fullname",
173330
+ /* 240 */ "selectnowith",
173331
+ /* 241 */ "oneselect",
173332
+ /* 242 */ "wqlist",
173333
+ /* 243 */ "multiselect_op",
173334
+ /* 244 */ "distinct",
173335
+ /* 245 */ "selcollist",
173336
+ /* 246 */ "from",
173337
+ /* 247 */ "where_opt",
173338
+ /* 248 */ "groupby_opt",
173339
+ /* 249 */ "having_opt",
173340
+ /* 250 */ "orderby_opt",
173341
+ /* 251 */ "limit_opt",
173342
+ /* 252 */ "window_clause",
173343
+ /* 253 */ "values",
173344
+ /* 254 */ "nexprlist",
173345
+ /* 255 */ "sclp",
173346
+ /* 256 */ "as",
173347
+ /* 257 */ "seltablist",
173348
+ /* 258 */ "stl_prefix",
173349
+ /* 259 */ "joinop",
173350
+ /* 260 */ "on_using",
173351
+ /* 261 */ "indexed_by",
173352
+ /* 262 */ "exprlist",
173353
+ /* 263 */ "xfullname",
173354
+ /* 264 */ "idlist",
173355
+ /* 265 */ "indexed_opt",
173356
+ /* 266 */ "nulls",
173357
+ /* 267 */ "with",
173358
+ /* 268 */ "where_opt_ret",
173359
+ /* 269 */ "setlist",
173360
+ /* 270 */ "insert_cmd",
173361
+ /* 271 */ "idlist_opt",
173362
+ /* 272 */ "upsert",
173363
+ /* 273 */ "returning",
173364
+ /* 274 */ "filter_over",
173365
+ /* 275 */ "likeop",
173366
+ /* 276 */ "between_op",
173367
+ /* 277 */ "in_op",
173368
+ /* 278 */ "paren_exprlist",
173369
+ /* 279 */ "case_operand",
173370
+ /* 280 */ "case_exprlist",
173371
+ /* 281 */ "case_else",
173372
+ /* 282 */ "uniqueflag",
173373
+ /* 283 */ "collate",
173374
+ /* 284 */ "vinto",
173375
+ /* 285 */ "nmnum",
173376
+ /* 286 */ "trigger_decl",
173377
+ /* 287 */ "trigger_cmd_list",
173378
+ /* 288 */ "trigger_time",
173379
+ /* 289 */ "trigger_event",
173380
+ /* 290 */ "foreach_clause",
173381
+ /* 291 */ "when_clause",
173382
+ /* 292 */ "trigger_cmd",
173383
+ /* 293 */ "trnm",
173384
+ /* 294 */ "tridxby",
173385
+ /* 295 */ "database_kw_opt",
173386
+ /* 296 */ "key_opt",
173387
+ /* 297 */ "add_column_fullname",
173388
+ /* 298 */ "kwcolumn_opt",
173389
+ /* 299 */ "create_vtab",
173390
+ /* 300 */ "vtabarglist",
173391
+ /* 301 */ "vtabarg",
173392
+ /* 302 */ "vtabargtoken",
173393
+ /* 303 */ "lp",
173394
+ /* 304 */ "anylist",
173395
+ /* 305 */ "wqitem",
173396
+ /* 306 */ "wqas",
173397
+ /* 307 */ "windowdefn_list",
173398
+ /* 308 */ "windowdefn",
173399
+ /* 309 */ "window",
173400
+ /* 310 */ "frame_opt",
173401
+ /* 311 */ "part_opt",
173402
+ /* 312 */ "filter_clause",
173403
+ /* 313 */ "over_clause",
173404
+ /* 314 */ "range_or_rows",
173405
+ /* 315 */ "frame_bound",
173406
+ /* 316 */ "frame_bound_s",
173407
+ /* 317 */ "frame_bound_e",
173408
+ /* 318 */ "frame_exclude_opt",
173409
+ /* 319 */ "frame_exclude",
173125173410
};
173126173411
#endif /* defined(YYCOVERAGE) || !defined(NDEBUG) */
173127173412
173128173413
#ifndef NDEBUG
173129173414
/* For tracing reduce actions, the names of all rules are required.
@@ -173467,75 +173752,76 @@
173467173752
/* 335 */ "filter_over ::= over_clause",
173468173753
/* 336 */ "filter_over ::= filter_clause",
173469173754
/* 337 */ "over_clause ::= OVER LP window RP",
173470173755
/* 338 */ "over_clause ::= OVER nm",
173471173756
/* 339 */ "filter_clause ::= FILTER LP WHERE expr RP",
173472
- /* 340 */ "input ::= cmdlist",
173473
- /* 341 */ "cmdlist ::= cmdlist ecmd",
173474
- /* 342 */ "cmdlist ::= ecmd",
173475
- /* 343 */ "ecmd ::= SEMI",
173476
- /* 344 */ "ecmd ::= cmdx SEMI",
173477
- /* 345 */ "ecmd ::= explain cmdx SEMI",
173478
- /* 346 */ "trans_opt ::=",
173479
- /* 347 */ "trans_opt ::= TRANSACTION",
173480
- /* 348 */ "trans_opt ::= TRANSACTION nm",
173481
- /* 349 */ "savepoint_opt ::= SAVEPOINT",
173482
- /* 350 */ "savepoint_opt ::=",
173483
- /* 351 */ "cmd ::= create_table create_table_args",
173484
- /* 352 */ "table_option_set ::= table_option",
173485
- /* 353 */ "columnlist ::= columnlist COMMA columnname carglist",
173486
- /* 354 */ "columnlist ::= columnname carglist",
173487
- /* 355 */ "nm ::= ID|INDEXED|JOIN_KW",
173488
- /* 356 */ "nm ::= STRING",
173489
- /* 357 */ "typetoken ::= typename",
173490
- /* 358 */ "typename ::= ID|STRING",
173491
- /* 359 */ "signed ::= plus_num",
173492
- /* 360 */ "signed ::= minus_num",
173493
- /* 361 */ "carglist ::= carglist ccons",
173494
- /* 362 */ "carglist ::=",
173495
- /* 363 */ "ccons ::= NULL onconf",
173496
- /* 364 */ "ccons ::= GENERATED ALWAYS AS generated",
173497
- /* 365 */ "ccons ::= AS generated",
173498
- /* 366 */ "conslist_opt ::= COMMA conslist",
173499
- /* 367 */ "conslist ::= conslist tconscomma tcons",
173500
- /* 368 */ "conslist ::= tcons",
173501
- /* 369 */ "tconscomma ::=",
173502
- /* 370 */ "defer_subclause_opt ::= defer_subclause",
173503
- /* 371 */ "resolvetype ::= raisetype",
173504
- /* 372 */ "selectnowith ::= oneselect",
173505
- /* 373 */ "oneselect ::= values",
173506
- /* 374 */ "sclp ::= selcollist COMMA",
173507
- /* 375 */ "as ::= ID|STRING",
173508
- /* 376 */ "indexed_opt ::= indexed_by",
173509
- /* 377 */ "returning ::=",
173510
- /* 378 */ "expr ::= term",
173511
- /* 379 */ "likeop ::= LIKE_KW|MATCH",
173512
- /* 380 */ "case_operand ::= expr",
173513
- /* 381 */ "exprlist ::= nexprlist",
173514
- /* 382 */ "nmnum ::= plus_num",
173515
- /* 383 */ "nmnum ::= nm",
173516
- /* 384 */ "nmnum ::= ON",
173517
- /* 385 */ "nmnum ::= DELETE",
173518
- /* 386 */ "nmnum ::= DEFAULT",
173519
- /* 387 */ "plus_num ::= INTEGER|FLOAT",
173520
- /* 388 */ "foreach_clause ::=",
173521
- /* 389 */ "foreach_clause ::= FOR EACH ROW",
173522
- /* 390 */ "trnm ::= nm",
173523
- /* 391 */ "tridxby ::=",
173524
- /* 392 */ "database_kw_opt ::= DATABASE",
173525
- /* 393 */ "database_kw_opt ::=",
173526
- /* 394 */ "kwcolumn_opt ::=",
173527
- /* 395 */ "kwcolumn_opt ::= COLUMNKW",
173528
- /* 396 */ "vtabarglist ::= vtabarg",
173529
- /* 397 */ "vtabarglist ::= vtabarglist COMMA vtabarg",
173530
- /* 398 */ "vtabarg ::= vtabarg vtabargtoken",
173531
- /* 399 */ "anylist ::=",
173532
- /* 400 */ "anylist ::= anylist LP anylist RP",
173533
- /* 401 */ "anylist ::= anylist ANY",
173534
- /* 402 */ "with ::=",
173535
- /* 403 */ "windowdefn_list ::= windowdefn",
173536
- /* 404 */ "window ::= frame_opt",
173757
+ /* 340 */ "term ::= QNUMBER",
173758
+ /* 341 */ "input ::= cmdlist",
173759
+ /* 342 */ "cmdlist ::= cmdlist ecmd",
173760
+ /* 343 */ "cmdlist ::= ecmd",
173761
+ /* 344 */ "ecmd ::= SEMI",
173762
+ /* 345 */ "ecmd ::= cmdx SEMI",
173763
+ /* 346 */ "ecmd ::= explain cmdx SEMI",
173764
+ /* 347 */ "trans_opt ::=",
173765
+ /* 348 */ "trans_opt ::= TRANSACTION",
173766
+ /* 349 */ "trans_opt ::= TRANSACTION nm",
173767
+ /* 350 */ "savepoint_opt ::= SAVEPOINT",
173768
+ /* 351 */ "savepoint_opt ::=",
173769
+ /* 352 */ "cmd ::= create_table create_table_args",
173770
+ /* 353 */ "table_option_set ::= table_option",
173771
+ /* 354 */ "columnlist ::= columnlist COMMA columnname carglist",
173772
+ /* 355 */ "columnlist ::= columnname carglist",
173773
+ /* 356 */ "nm ::= ID|INDEXED|JOIN_KW",
173774
+ /* 357 */ "nm ::= STRING",
173775
+ /* 358 */ "typetoken ::= typename",
173776
+ /* 359 */ "typename ::= ID|STRING",
173777
+ /* 360 */ "signed ::= plus_num",
173778
+ /* 361 */ "signed ::= minus_num",
173779
+ /* 362 */ "carglist ::= carglist ccons",
173780
+ /* 363 */ "carglist ::=",
173781
+ /* 364 */ "ccons ::= NULL onconf",
173782
+ /* 365 */ "ccons ::= GENERATED ALWAYS AS generated",
173783
+ /* 366 */ "ccons ::= AS generated",
173784
+ /* 367 */ "conslist_opt ::= COMMA conslist",
173785
+ /* 368 */ "conslist ::= conslist tconscomma tcons",
173786
+ /* 369 */ "conslist ::= tcons",
173787
+ /* 370 */ "tconscomma ::=",
173788
+ /* 371 */ "defer_subclause_opt ::= defer_subclause",
173789
+ /* 372 */ "resolvetype ::= raisetype",
173790
+ /* 373 */ "selectnowith ::= oneselect",
173791
+ /* 374 */ "oneselect ::= values",
173792
+ /* 375 */ "sclp ::= selcollist COMMA",
173793
+ /* 376 */ "as ::= ID|STRING",
173794
+ /* 377 */ "indexed_opt ::= indexed_by",
173795
+ /* 378 */ "returning ::=",
173796
+ /* 379 */ "expr ::= term",
173797
+ /* 380 */ "likeop ::= LIKE_KW|MATCH",
173798
+ /* 381 */ "case_operand ::= expr",
173799
+ /* 382 */ "exprlist ::= nexprlist",
173800
+ /* 383 */ "nmnum ::= plus_num",
173801
+ /* 384 */ "nmnum ::= nm",
173802
+ /* 385 */ "nmnum ::= ON",
173803
+ /* 386 */ "nmnum ::= DELETE",
173804
+ /* 387 */ "nmnum ::= DEFAULT",
173805
+ /* 388 */ "plus_num ::= INTEGER|FLOAT",
173806
+ /* 389 */ "foreach_clause ::=",
173807
+ /* 390 */ "foreach_clause ::= FOR EACH ROW",
173808
+ /* 391 */ "trnm ::= nm",
173809
+ /* 392 */ "tridxby ::=",
173810
+ /* 393 */ "database_kw_opt ::= DATABASE",
173811
+ /* 394 */ "database_kw_opt ::=",
173812
+ /* 395 */ "kwcolumn_opt ::=",
173813
+ /* 396 */ "kwcolumn_opt ::= COLUMNKW",
173814
+ /* 397 */ "vtabarglist ::= vtabarg",
173815
+ /* 398 */ "vtabarglist ::= vtabarglist COMMA vtabarg",
173816
+ /* 399 */ "vtabarg ::= vtabarg vtabargtoken",
173817
+ /* 400 */ "anylist ::=",
173818
+ /* 401 */ "anylist ::= anylist LP anylist RP",
173819
+ /* 402 */ "anylist ::= anylist ANY",
173820
+ /* 403 */ "with ::=",
173821
+ /* 404 */ "windowdefn_list ::= windowdefn",
173822
+ /* 405 */ "window ::= frame_opt",
173537173823
};
173538173824
#endif /* NDEBUG */
173539173825
173540173826
173541173827
#if YYGROWABLESTACK
@@ -173655,101 +173941,101 @@
173655173941
** Note: during a reduce, the only symbols destroyed are those
173656173942
** which appear on the RHS of the rule, but which are *not* used
173657173943
** inside the C code.
173658173944
*/
173659173945
/********* Begin destructor definitions ***************************************/
173660
- case 204: /* select */
173661
- case 239: /* selectnowith */
173662
- case 240: /* oneselect */
173663
- case 252: /* values */
173664
-{
173665
-sqlite3SelectDelete(pParse->db, (yypminor->yy47));
173666
-}
173667
- break;
173668
- case 216: /* term */
173669
- case 217: /* expr */
173670
- case 246: /* where_opt */
173671
- case 248: /* having_opt */
173672
- case 267: /* where_opt_ret */
173673
- case 278: /* case_operand */
173674
- case 280: /* case_else */
173675
- case 283: /* vinto */
173676
- case 290: /* when_clause */
173677
- case 295: /* key_opt */
173678
- case 311: /* filter_clause */
173679
-{
173680
-sqlite3ExprDelete(pParse->db, (yypminor->yy528));
173681
-}
173682
- break;
173683
- case 221: /* eidlist_opt */
173684
- case 231: /* sortlist */
173685
- case 232: /* eidlist */
173686
- case 244: /* selcollist */
173687
- case 247: /* groupby_opt */
173688
- case 249: /* orderby_opt */
173689
- case 253: /* nexprlist */
173690
- case 254: /* sclp */
173691
- case 261: /* exprlist */
173692
- case 268: /* setlist */
173693
- case 277: /* paren_exprlist */
173694
- case 279: /* case_exprlist */
173695
- case 310: /* part_opt */
173696
-{
173697
-sqlite3ExprListDelete(pParse->db, (yypminor->yy322));
173698
-}
173699
- break;
173700
- case 238: /* fullname */
173701
- case 245: /* from */
173702
- case 256: /* seltablist */
173703
- case 257: /* stl_prefix */
173704
- case 262: /* xfullname */
173705
-{
173706
-sqlite3SrcListDelete(pParse->db, (yypminor->yy131));
173707
-}
173708
- break;
173709
- case 241: /* wqlist */
173710
-{
173711
-sqlite3WithDelete(pParse->db, (yypminor->yy521));
173712
-}
173713
- break;
173714
- case 251: /* window_clause */
173715
- case 306: /* windowdefn_list */
173716
-{
173717
-sqlite3WindowListDelete(pParse->db, (yypminor->yy41));
173718
-}
173719
- break;
173720
- case 263: /* idlist */
173721
- case 270: /* idlist_opt */
173722
-{
173723
-sqlite3IdListDelete(pParse->db, (yypminor->yy254));
173724
-}
173725
- break;
173726
- case 273: /* filter_over */
173727
- case 307: /* windowdefn */
173728
- case 308: /* window */
173729
- case 309: /* frame_opt */
173730
- case 312: /* over_clause */
173731
-{
173732
-sqlite3WindowDelete(pParse->db, (yypminor->yy41));
173733
-}
173734
- break;
173735
- case 286: /* trigger_cmd_list */
173736
- case 291: /* trigger_cmd */
173737
-{
173738
-sqlite3DeleteTriggerStep(pParse->db, (yypminor->yy33));
173739
-}
173740
- break;
173741
- case 288: /* trigger_event */
173742
-{
173743
-sqlite3IdListDelete(pParse->db, (yypminor->yy180).b);
173744
-}
173745
- break;
173746
- case 314: /* frame_bound */
173747
- case 315: /* frame_bound_s */
173748
- case 316: /* frame_bound_e */
173749
-{
173750
-sqlite3ExprDelete(pParse->db, (yypminor->yy595).pExpr);
173946
+ case 205: /* select */
173947
+ case 240: /* selectnowith */
173948
+ case 241: /* oneselect */
173949
+ case 253: /* values */
173950
+{
173951
+sqlite3SelectDelete(pParse->db, (yypminor->yy299));
173952
+}
173953
+ break;
173954
+ case 217: /* term */
173955
+ case 218: /* expr */
173956
+ case 247: /* where_opt */
173957
+ case 249: /* having_opt */
173958
+ case 268: /* where_opt_ret */
173959
+ case 279: /* case_operand */
173960
+ case 281: /* case_else */
173961
+ case 284: /* vinto */
173962
+ case 291: /* when_clause */
173963
+ case 296: /* key_opt */
173964
+ case 312: /* filter_clause */
173965
+{
173966
+sqlite3ExprDelete(pParse->db, (yypminor->yy2));
173967
+}
173968
+ break;
173969
+ case 222: /* eidlist_opt */
173970
+ case 232: /* sortlist */
173971
+ case 233: /* eidlist */
173972
+ case 245: /* selcollist */
173973
+ case 248: /* groupby_opt */
173974
+ case 250: /* orderby_opt */
173975
+ case 254: /* nexprlist */
173976
+ case 255: /* sclp */
173977
+ case 262: /* exprlist */
173978
+ case 269: /* setlist */
173979
+ case 278: /* paren_exprlist */
173980
+ case 280: /* case_exprlist */
173981
+ case 311: /* part_opt */
173982
+{
173983
+sqlite3ExprListDelete(pParse->db, (yypminor->yy402));
173984
+}
173985
+ break;
173986
+ case 239: /* fullname */
173987
+ case 246: /* from */
173988
+ case 257: /* seltablist */
173989
+ case 258: /* stl_prefix */
173990
+ case 263: /* xfullname */
173991
+{
173992
+sqlite3SrcListDelete(pParse->db, (yypminor->yy387));
173993
+}
173994
+ break;
173995
+ case 242: /* wqlist */
173996
+{
173997
+sqlite3WithDelete(pParse->db, (yypminor->yy131));
173998
+}
173999
+ break;
174000
+ case 252: /* window_clause */
174001
+ case 307: /* windowdefn_list */
174002
+{
174003
+sqlite3WindowListDelete(pParse->db, (yypminor->yy3));
174004
+}
174005
+ break;
174006
+ case 264: /* idlist */
174007
+ case 271: /* idlist_opt */
174008
+{
174009
+sqlite3IdListDelete(pParse->db, (yypminor->yy400));
174010
+}
174011
+ break;
174012
+ case 274: /* filter_over */
174013
+ case 308: /* windowdefn */
174014
+ case 309: /* window */
174015
+ case 310: /* frame_opt */
174016
+ case 313: /* over_clause */
174017
+{
174018
+sqlite3WindowDelete(pParse->db, (yypminor->yy3));
174019
+}
174020
+ break;
174021
+ case 287: /* trigger_cmd_list */
174022
+ case 292: /* trigger_cmd */
174023
+{
174024
+sqlite3DeleteTriggerStep(pParse->db, (yypminor->yy347));
174025
+}
174026
+ break;
174027
+ case 289: /* trigger_event */
174028
+{
174029
+sqlite3IdListDelete(pParse->db, (yypminor->yy210).b);
174030
+}
174031
+ break;
174032
+ case 315: /* frame_bound */
174033
+ case 316: /* frame_bound_s */
174034
+ case 317: /* frame_bound_e */
174035
+{
174036
+sqlite3ExprDelete(pParse->db, (yypminor->yy337).pExpr);
173751174037
}
173752174038
break;
173753174039
/********* End destructor definitions *****************************************/
173754174040
default: break; /* If no destructor action specified: do nothing */
173755174041
}
@@ -174047,415 +174333,416 @@
174047174333
}
174048174334
174049174335
/* For rule J, yyRuleInfoLhs[J] contains the symbol on the left-hand side
174050174336
** of that rule */
174051174337
static const YYCODETYPE yyRuleInfoLhs[] = {
174052
- 189, /* (0) explain ::= EXPLAIN */
174053
- 189, /* (1) explain ::= EXPLAIN QUERY PLAN */
174054
- 188, /* (2) cmdx ::= cmd */
174055
- 190, /* (3) cmd ::= BEGIN transtype trans_opt */
174056
- 191, /* (4) transtype ::= */
174057
- 191, /* (5) transtype ::= DEFERRED */
174058
- 191, /* (6) transtype ::= IMMEDIATE */
174059
- 191, /* (7) transtype ::= EXCLUSIVE */
174060
- 190, /* (8) cmd ::= COMMIT|END trans_opt */
174061
- 190, /* (9) cmd ::= ROLLBACK trans_opt */
174062
- 190, /* (10) cmd ::= SAVEPOINT nm */
174063
- 190, /* (11) cmd ::= RELEASE savepoint_opt nm */
174064
- 190, /* (12) cmd ::= ROLLBACK trans_opt TO savepoint_opt nm */
174065
- 195, /* (13) create_table ::= createkw temp TABLE ifnotexists nm dbnm */
174066
- 197, /* (14) createkw ::= CREATE */
174067
- 199, /* (15) ifnotexists ::= */
174068
- 199, /* (16) ifnotexists ::= IF NOT EXISTS */
174069
- 198, /* (17) temp ::= TEMP */
174070
- 198, /* (18) temp ::= */
174071
- 196, /* (19) create_table_args ::= LP columnlist conslist_opt RP table_option_set */
174072
- 196, /* (20) create_table_args ::= AS select */
174073
- 203, /* (21) table_option_set ::= */
174074
- 203, /* (22) table_option_set ::= table_option_set COMMA table_option */
174075
- 205, /* (23) table_option ::= WITHOUT nm */
174076
- 205, /* (24) table_option ::= nm */
174077
- 206, /* (25) columnname ::= nm typetoken */
174078
- 208, /* (26) typetoken ::= */
174079
- 208, /* (27) typetoken ::= typename LP signed RP */
174080
- 208, /* (28) typetoken ::= typename LP signed COMMA signed RP */
174081
- 209, /* (29) typename ::= typename ID|STRING */
174082
- 213, /* (30) scanpt ::= */
174083
- 214, /* (31) scantok ::= */
174084
- 215, /* (32) ccons ::= CONSTRAINT nm */
174085
- 215, /* (33) ccons ::= DEFAULT scantok term */
174086
- 215, /* (34) ccons ::= DEFAULT LP expr RP */
174087
- 215, /* (35) ccons ::= DEFAULT PLUS scantok term */
174088
- 215, /* (36) ccons ::= DEFAULT MINUS scantok term */
174089
- 215, /* (37) ccons ::= DEFAULT scantok ID|INDEXED */
174090
- 215, /* (38) ccons ::= NOT NULL onconf */
174091
- 215, /* (39) ccons ::= PRIMARY KEY sortorder onconf autoinc */
174092
- 215, /* (40) ccons ::= UNIQUE onconf */
174093
- 215, /* (41) ccons ::= CHECK LP expr RP */
174094
- 215, /* (42) ccons ::= REFERENCES nm eidlist_opt refargs */
174095
- 215, /* (43) ccons ::= defer_subclause */
174096
- 215, /* (44) ccons ::= COLLATE ID|STRING */
174097
- 224, /* (45) generated ::= LP expr RP */
174098
- 224, /* (46) generated ::= LP expr RP ID */
174099
- 220, /* (47) autoinc ::= */
174100
- 220, /* (48) autoinc ::= AUTOINCR */
174101
- 222, /* (49) refargs ::= */
174102
- 222, /* (50) refargs ::= refargs refarg */
174103
- 225, /* (51) refarg ::= MATCH nm */
174104
- 225, /* (52) refarg ::= ON INSERT refact */
174105
- 225, /* (53) refarg ::= ON DELETE refact */
174106
- 225, /* (54) refarg ::= ON UPDATE refact */
174107
- 226, /* (55) refact ::= SET NULL */
174108
- 226, /* (56) refact ::= SET DEFAULT */
174109
- 226, /* (57) refact ::= CASCADE */
174110
- 226, /* (58) refact ::= RESTRICT */
174111
- 226, /* (59) refact ::= NO ACTION */
174112
- 223, /* (60) defer_subclause ::= NOT DEFERRABLE init_deferred_pred_opt */
174113
- 223, /* (61) defer_subclause ::= DEFERRABLE init_deferred_pred_opt */
174114
- 227, /* (62) init_deferred_pred_opt ::= */
174115
- 227, /* (63) init_deferred_pred_opt ::= INITIALLY DEFERRED */
174116
- 227, /* (64) init_deferred_pred_opt ::= INITIALLY IMMEDIATE */
174117
- 202, /* (65) conslist_opt ::= */
174118
- 229, /* (66) tconscomma ::= COMMA */
174119
- 230, /* (67) tcons ::= CONSTRAINT nm */
174120
- 230, /* (68) tcons ::= PRIMARY KEY LP sortlist autoinc RP onconf */
174121
- 230, /* (69) tcons ::= UNIQUE LP sortlist RP onconf */
174122
- 230, /* (70) tcons ::= CHECK LP expr RP onconf */
174123
- 230, /* (71) tcons ::= FOREIGN KEY LP eidlist RP REFERENCES nm eidlist_opt refargs defer_subclause_opt */
174124
- 233, /* (72) defer_subclause_opt ::= */
174125
- 218, /* (73) onconf ::= */
174126
- 218, /* (74) onconf ::= ON CONFLICT resolvetype */
174127
- 234, /* (75) orconf ::= */
174128
- 234, /* (76) orconf ::= OR resolvetype */
174129
- 235, /* (77) resolvetype ::= IGNORE */
174130
- 235, /* (78) resolvetype ::= REPLACE */
174131
- 190, /* (79) cmd ::= DROP TABLE ifexists fullname */
174132
- 237, /* (80) ifexists ::= IF EXISTS */
174133
- 237, /* (81) ifexists ::= */
174134
- 190, /* (82) cmd ::= createkw temp VIEW ifnotexists nm dbnm eidlist_opt AS select */
174135
- 190, /* (83) cmd ::= DROP VIEW ifexists fullname */
174136
- 190, /* (84) cmd ::= select */
174137
- 204, /* (85) select ::= WITH wqlist selectnowith */
174138
- 204, /* (86) select ::= WITH RECURSIVE wqlist selectnowith */
174139
- 204, /* (87) select ::= selectnowith */
174140
- 239, /* (88) selectnowith ::= selectnowith multiselect_op oneselect */
174141
- 242, /* (89) multiselect_op ::= UNION */
174142
- 242, /* (90) multiselect_op ::= UNION ALL */
174143
- 242, /* (91) multiselect_op ::= EXCEPT|INTERSECT */
174144
- 240, /* (92) oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt orderby_opt limit_opt */
174145
- 240, /* (93) oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt window_clause orderby_opt limit_opt */
174146
- 252, /* (94) values ::= VALUES LP nexprlist RP */
174147
- 252, /* (95) values ::= values COMMA LP nexprlist RP */
174148
- 243, /* (96) distinct ::= DISTINCT */
174149
- 243, /* (97) distinct ::= ALL */
174150
- 243, /* (98) distinct ::= */
174151
- 254, /* (99) sclp ::= */
174152
- 244, /* (100) selcollist ::= sclp scanpt expr scanpt as */
174153
- 244, /* (101) selcollist ::= sclp scanpt STAR */
174154
- 244, /* (102) selcollist ::= sclp scanpt nm DOT STAR */
174155
- 255, /* (103) as ::= AS nm */
174156
- 255, /* (104) as ::= */
174157
- 245, /* (105) from ::= */
174158
- 245, /* (106) from ::= FROM seltablist */
174159
- 257, /* (107) stl_prefix ::= seltablist joinop */
174160
- 257, /* (108) stl_prefix ::= */
174161
- 256, /* (109) seltablist ::= stl_prefix nm dbnm as on_using */
174162
- 256, /* (110) seltablist ::= stl_prefix nm dbnm as indexed_by on_using */
174163
- 256, /* (111) seltablist ::= stl_prefix nm dbnm LP exprlist RP as on_using */
174164
- 256, /* (112) seltablist ::= stl_prefix LP select RP as on_using */
174165
- 256, /* (113) seltablist ::= stl_prefix LP seltablist RP as on_using */
174166
- 200, /* (114) dbnm ::= */
174167
- 200, /* (115) dbnm ::= DOT nm */
174168
- 238, /* (116) fullname ::= nm */
174169
- 238, /* (117) fullname ::= nm DOT nm */
174170
- 262, /* (118) xfullname ::= nm */
174171
- 262, /* (119) xfullname ::= nm DOT nm */
174172
- 262, /* (120) xfullname ::= nm DOT nm AS nm */
174173
- 262, /* (121) xfullname ::= nm AS nm */
174174
- 258, /* (122) joinop ::= COMMA|JOIN */
174175
- 258, /* (123) joinop ::= JOIN_KW JOIN */
174176
- 258, /* (124) joinop ::= JOIN_KW nm JOIN */
174177
- 258, /* (125) joinop ::= JOIN_KW nm nm JOIN */
174178
- 259, /* (126) on_using ::= ON expr */
174179
- 259, /* (127) on_using ::= USING LP idlist RP */
174180
- 259, /* (128) on_using ::= */
174181
- 264, /* (129) indexed_opt ::= */
174182
- 260, /* (130) indexed_by ::= INDEXED BY nm */
174183
- 260, /* (131) indexed_by ::= NOT INDEXED */
174184
- 249, /* (132) orderby_opt ::= */
174185
- 249, /* (133) orderby_opt ::= ORDER BY sortlist */
174186
- 231, /* (134) sortlist ::= sortlist COMMA expr sortorder nulls */
174187
- 231, /* (135) sortlist ::= expr sortorder nulls */
174188
- 219, /* (136) sortorder ::= ASC */
174189
- 219, /* (137) sortorder ::= DESC */
174190
- 219, /* (138) sortorder ::= */
174191
- 265, /* (139) nulls ::= NULLS FIRST */
174192
- 265, /* (140) nulls ::= NULLS LAST */
174193
- 265, /* (141) nulls ::= */
174194
- 247, /* (142) groupby_opt ::= */
174195
- 247, /* (143) groupby_opt ::= GROUP BY nexprlist */
174196
- 248, /* (144) having_opt ::= */
174197
- 248, /* (145) having_opt ::= HAVING expr */
174198
- 250, /* (146) limit_opt ::= */
174199
- 250, /* (147) limit_opt ::= LIMIT expr */
174200
- 250, /* (148) limit_opt ::= LIMIT expr OFFSET expr */
174201
- 250, /* (149) limit_opt ::= LIMIT expr COMMA expr */
174202
- 190, /* (150) cmd ::= with DELETE FROM xfullname indexed_opt where_opt_ret */
174203
- 246, /* (151) where_opt ::= */
174204
- 246, /* (152) where_opt ::= WHERE expr */
174205
- 267, /* (153) where_opt_ret ::= */
174206
- 267, /* (154) where_opt_ret ::= WHERE expr */
174207
- 267, /* (155) where_opt_ret ::= RETURNING selcollist */
174208
- 267, /* (156) where_opt_ret ::= WHERE expr RETURNING selcollist */
174209
- 190, /* (157) cmd ::= with UPDATE orconf xfullname indexed_opt SET setlist from where_opt_ret */
174210
- 268, /* (158) setlist ::= setlist COMMA nm EQ expr */
174211
- 268, /* (159) setlist ::= setlist COMMA LP idlist RP EQ expr */
174212
- 268, /* (160) setlist ::= nm EQ expr */
174213
- 268, /* (161) setlist ::= LP idlist RP EQ expr */
174214
- 190, /* (162) cmd ::= with insert_cmd INTO xfullname idlist_opt select upsert */
174215
- 190, /* (163) cmd ::= with insert_cmd INTO xfullname idlist_opt DEFAULT VALUES returning */
174216
- 271, /* (164) upsert ::= */
174217
- 271, /* (165) upsert ::= RETURNING selcollist */
174218
- 271, /* (166) upsert ::= ON CONFLICT LP sortlist RP where_opt DO UPDATE SET setlist where_opt upsert */
174219
- 271, /* (167) upsert ::= ON CONFLICT LP sortlist RP where_opt DO NOTHING upsert */
174220
- 271, /* (168) upsert ::= ON CONFLICT DO NOTHING returning */
174221
- 271, /* (169) upsert ::= ON CONFLICT DO UPDATE SET setlist where_opt returning */
174222
- 272, /* (170) returning ::= RETURNING selcollist */
174223
- 269, /* (171) insert_cmd ::= INSERT orconf */
174224
- 269, /* (172) insert_cmd ::= REPLACE */
174225
- 270, /* (173) idlist_opt ::= */
174226
- 270, /* (174) idlist_opt ::= LP idlist RP */
174227
- 263, /* (175) idlist ::= idlist COMMA nm */
174228
- 263, /* (176) idlist ::= nm */
174229
- 217, /* (177) expr ::= LP expr RP */
174230
- 217, /* (178) expr ::= ID|INDEXED|JOIN_KW */
174231
- 217, /* (179) expr ::= nm DOT nm */
174232
- 217, /* (180) expr ::= nm DOT nm DOT nm */
174233
- 216, /* (181) term ::= NULL|FLOAT|BLOB */
174234
- 216, /* (182) term ::= STRING */
174235
- 216, /* (183) term ::= INTEGER */
174236
- 217, /* (184) expr ::= VARIABLE */
174237
- 217, /* (185) expr ::= expr COLLATE ID|STRING */
174238
- 217, /* (186) expr ::= CAST LP expr AS typetoken RP */
174239
- 217, /* (187) expr ::= ID|INDEXED|JOIN_KW LP distinct exprlist RP */
174240
- 217, /* (188) expr ::= ID|INDEXED|JOIN_KW LP distinct exprlist ORDER BY sortlist RP */
174241
- 217, /* (189) expr ::= ID|INDEXED|JOIN_KW LP STAR RP */
174242
- 217, /* (190) expr ::= ID|INDEXED|JOIN_KW LP distinct exprlist RP filter_over */
174243
- 217, /* (191) expr ::= ID|INDEXED|JOIN_KW LP distinct exprlist ORDER BY sortlist RP filter_over */
174244
- 217, /* (192) expr ::= ID|INDEXED|JOIN_KW LP STAR RP filter_over */
174245
- 216, /* (193) term ::= CTIME_KW */
174246
- 217, /* (194) expr ::= LP nexprlist COMMA expr RP */
174247
- 217, /* (195) expr ::= expr AND expr */
174248
- 217, /* (196) expr ::= expr OR expr */
174249
- 217, /* (197) expr ::= expr LT|GT|GE|LE expr */
174250
- 217, /* (198) expr ::= expr EQ|NE expr */
174251
- 217, /* (199) expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr */
174252
- 217, /* (200) expr ::= expr PLUS|MINUS expr */
174253
- 217, /* (201) expr ::= expr STAR|SLASH|REM expr */
174254
- 217, /* (202) expr ::= expr CONCAT expr */
174255
- 274, /* (203) likeop ::= NOT LIKE_KW|MATCH */
174256
- 217, /* (204) expr ::= expr likeop expr */
174257
- 217, /* (205) expr ::= expr likeop expr ESCAPE expr */
174258
- 217, /* (206) expr ::= expr ISNULL|NOTNULL */
174259
- 217, /* (207) expr ::= expr NOT NULL */
174260
- 217, /* (208) expr ::= expr IS expr */
174261
- 217, /* (209) expr ::= expr IS NOT expr */
174262
- 217, /* (210) expr ::= expr IS NOT DISTINCT FROM expr */
174263
- 217, /* (211) expr ::= expr IS DISTINCT FROM expr */
174264
- 217, /* (212) expr ::= NOT expr */
174265
- 217, /* (213) expr ::= BITNOT expr */
174266
- 217, /* (214) expr ::= PLUS|MINUS expr */
174267
- 217, /* (215) expr ::= expr PTR expr */
174268
- 275, /* (216) between_op ::= BETWEEN */
174269
- 275, /* (217) between_op ::= NOT BETWEEN */
174270
- 217, /* (218) expr ::= expr between_op expr AND expr */
174271
- 276, /* (219) in_op ::= IN */
174272
- 276, /* (220) in_op ::= NOT IN */
174273
- 217, /* (221) expr ::= expr in_op LP exprlist RP */
174274
- 217, /* (222) expr ::= LP select RP */
174275
- 217, /* (223) expr ::= expr in_op LP select RP */
174276
- 217, /* (224) expr ::= expr in_op nm dbnm paren_exprlist */
174277
- 217, /* (225) expr ::= EXISTS LP select RP */
174278
- 217, /* (226) expr ::= CASE case_operand case_exprlist case_else END */
174279
- 279, /* (227) case_exprlist ::= case_exprlist WHEN expr THEN expr */
174280
- 279, /* (228) case_exprlist ::= WHEN expr THEN expr */
174281
- 280, /* (229) case_else ::= ELSE expr */
174282
- 280, /* (230) case_else ::= */
174283
- 278, /* (231) case_operand ::= */
174284
- 261, /* (232) exprlist ::= */
174285
- 253, /* (233) nexprlist ::= nexprlist COMMA expr */
174286
- 253, /* (234) nexprlist ::= expr */
174287
- 277, /* (235) paren_exprlist ::= */
174288
- 277, /* (236) paren_exprlist ::= LP exprlist RP */
174289
- 190, /* (237) cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP sortlist RP where_opt */
174290
- 281, /* (238) uniqueflag ::= UNIQUE */
174291
- 281, /* (239) uniqueflag ::= */
174292
- 221, /* (240) eidlist_opt ::= */
174293
- 221, /* (241) eidlist_opt ::= LP eidlist RP */
174294
- 232, /* (242) eidlist ::= eidlist COMMA nm collate sortorder */
174295
- 232, /* (243) eidlist ::= nm collate sortorder */
174296
- 282, /* (244) collate ::= */
174297
- 282, /* (245) collate ::= COLLATE ID|STRING */
174298
- 190, /* (246) cmd ::= DROP INDEX ifexists fullname */
174299
- 190, /* (247) cmd ::= VACUUM vinto */
174300
- 190, /* (248) cmd ::= VACUUM nm vinto */
174301
- 283, /* (249) vinto ::= INTO expr */
174302
- 283, /* (250) vinto ::= */
174303
- 190, /* (251) cmd ::= PRAGMA nm dbnm */
174304
- 190, /* (252) cmd ::= PRAGMA nm dbnm EQ nmnum */
174305
- 190, /* (253) cmd ::= PRAGMA nm dbnm LP nmnum RP */
174306
- 190, /* (254) cmd ::= PRAGMA nm dbnm EQ minus_num */
174307
- 190, /* (255) cmd ::= PRAGMA nm dbnm LP minus_num RP */
174308
- 211, /* (256) plus_num ::= PLUS INTEGER|FLOAT */
174309
- 212, /* (257) minus_num ::= MINUS INTEGER|FLOAT */
174310
- 190, /* (258) cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END */
174311
- 285, /* (259) trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause */
174312
- 287, /* (260) trigger_time ::= BEFORE|AFTER */
174313
- 287, /* (261) trigger_time ::= INSTEAD OF */
174314
- 287, /* (262) trigger_time ::= */
174315
- 288, /* (263) trigger_event ::= DELETE|INSERT */
174316
- 288, /* (264) trigger_event ::= UPDATE */
174317
- 288, /* (265) trigger_event ::= UPDATE OF idlist */
174318
- 290, /* (266) when_clause ::= */
174319
- 290, /* (267) when_clause ::= WHEN expr */
174320
- 286, /* (268) trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI */
174321
- 286, /* (269) trigger_cmd_list ::= trigger_cmd SEMI */
174322
- 292, /* (270) trnm ::= nm DOT nm */
174323
- 293, /* (271) tridxby ::= INDEXED BY nm */
174324
- 293, /* (272) tridxby ::= NOT INDEXED */
174325
- 291, /* (273) trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist from where_opt scanpt */
174326
- 291, /* (274) trigger_cmd ::= scanpt insert_cmd INTO trnm idlist_opt select upsert scanpt */
174327
- 291, /* (275) trigger_cmd ::= DELETE FROM trnm tridxby where_opt scanpt */
174328
- 291, /* (276) trigger_cmd ::= scanpt select scanpt */
174329
- 217, /* (277) expr ::= RAISE LP IGNORE RP */
174330
- 217, /* (278) expr ::= RAISE LP raisetype COMMA nm RP */
174331
- 236, /* (279) raisetype ::= ROLLBACK */
174332
- 236, /* (280) raisetype ::= ABORT */
174333
- 236, /* (281) raisetype ::= FAIL */
174334
- 190, /* (282) cmd ::= DROP TRIGGER ifexists fullname */
174335
- 190, /* (283) cmd ::= ATTACH database_kw_opt expr AS expr key_opt */
174336
- 190, /* (284) cmd ::= DETACH database_kw_opt expr */
174337
- 295, /* (285) key_opt ::= */
174338
- 295, /* (286) key_opt ::= KEY expr */
174339
- 190, /* (287) cmd ::= REINDEX */
174340
- 190, /* (288) cmd ::= REINDEX nm dbnm */
174341
- 190, /* (289) cmd ::= ANALYZE */
174342
- 190, /* (290) cmd ::= ANALYZE nm dbnm */
174343
- 190, /* (291) cmd ::= ALTER TABLE fullname RENAME TO nm */
174344
- 190, /* (292) cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt columnname carglist */
174345
- 190, /* (293) cmd ::= ALTER TABLE fullname DROP kwcolumn_opt nm */
174346
- 296, /* (294) add_column_fullname ::= fullname */
174347
- 190, /* (295) cmd ::= ALTER TABLE fullname RENAME kwcolumn_opt nm TO nm */
174348
- 190, /* (296) cmd ::= create_vtab */
174349
- 190, /* (297) cmd ::= create_vtab LP vtabarglist RP */
174350
- 298, /* (298) create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm */
174351
- 300, /* (299) vtabarg ::= */
174352
- 301, /* (300) vtabargtoken ::= ANY */
174353
- 301, /* (301) vtabargtoken ::= lp anylist RP */
174354
- 302, /* (302) lp ::= LP */
174355
- 266, /* (303) with ::= WITH wqlist */
174356
- 266, /* (304) with ::= WITH RECURSIVE wqlist */
174357
- 305, /* (305) wqas ::= AS */
174358
- 305, /* (306) wqas ::= AS MATERIALIZED */
174359
- 305, /* (307) wqas ::= AS NOT MATERIALIZED */
174360
- 304, /* (308) wqitem ::= nm eidlist_opt wqas LP select RP */
174361
- 241, /* (309) wqlist ::= wqitem */
174362
- 241, /* (310) wqlist ::= wqlist COMMA wqitem */
174363
- 306, /* (311) windowdefn_list ::= windowdefn_list COMMA windowdefn */
174364
- 307, /* (312) windowdefn ::= nm AS LP window RP */
174365
- 308, /* (313) window ::= PARTITION BY nexprlist orderby_opt frame_opt */
174366
- 308, /* (314) window ::= nm PARTITION BY nexprlist orderby_opt frame_opt */
174367
- 308, /* (315) window ::= ORDER BY sortlist frame_opt */
174368
- 308, /* (316) window ::= nm ORDER BY sortlist frame_opt */
174369
- 308, /* (317) window ::= nm frame_opt */
174370
- 309, /* (318) frame_opt ::= */
174371
- 309, /* (319) frame_opt ::= range_or_rows frame_bound_s frame_exclude_opt */
174372
- 309, /* (320) frame_opt ::= range_or_rows BETWEEN frame_bound_s AND frame_bound_e frame_exclude_opt */
174373
- 313, /* (321) range_or_rows ::= RANGE|ROWS|GROUPS */
174374
- 315, /* (322) frame_bound_s ::= frame_bound */
174375
- 315, /* (323) frame_bound_s ::= UNBOUNDED PRECEDING */
174376
- 316, /* (324) frame_bound_e ::= frame_bound */
174377
- 316, /* (325) frame_bound_e ::= UNBOUNDED FOLLOWING */
174378
- 314, /* (326) frame_bound ::= expr PRECEDING|FOLLOWING */
174379
- 314, /* (327) frame_bound ::= CURRENT ROW */
174380
- 317, /* (328) frame_exclude_opt ::= */
174381
- 317, /* (329) frame_exclude_opt ::= EXCLUDE frame_exclude */
174382
- 318, /* (330) frame_exclude ::= NO OTHERS */
174383
- 318, /* (331) frame_exclude ::= CURRENT ROW */
174384
- 318, /* (332) frame_exclude ::= GROUP|TIES */
174385
- 251, /* (333) window_clause ::= WINDOW windowdefn_list */
174386
- 273, /* (334) filter_over ::= filter_clause over_clause */
174387
- 273, /* (335) filter_over ::= over_clause */
174388
- 273, /* (336) filter_over ::= filter_clause */
174389
- 312, /* (337) over_clause ::= OVER LP window RP */
174390
- 312, /* (338) over_clause ::= OVER nm */
174391
- 311, /* (339) filter_clause ::= FILTER LP WHERE expr RP */
174392
- 185, /* (340) input ::= cmdlist */
174393
- 186, /* (341) cmdlist ::= cmdlist ecmd */
174394
- 186, /* (342) cmdlist ::= ecmd */
174395
- 187, /* (343) ecmd ::= SEMI */
174396
- 187, /* (344) ecmd ::= cmdx SEMI */
174397
- 187, /* (345) ecmd ::= explain cmdx SEMI */
174398
- 192, /* (346) trans_opt ::= */
174399
- 192, /* (347) trans_opt ::= TRANSACTION */
174400
- 192, /* (348) trans_opt ::= TRANSACTION nm */
174401
- 194, /* (349) savepoint_opt ::= SAVEPOINT */
174402
- 194, /* (350) savepoint_opt ::= */
174403
- 190, /* (351) cmd ::= create_table create_table_args */
174404
- 203, /* (352) table_option_set ::= table_option */
174405
- 201, /* (353) columnlist ::= columnlist COMMA columnname carglist */
174406
- 201, /* (354) columnlist ::= columnname carglist */
174407
- 193, /* (355) nm ::= ID|INDEXED|JOIN_KW */
174408
- 193, /* (356) nm ::= STRING */
174409
- 208, /* (357) typetoken ::= typename */
174410
- 209, /* (358) typename ::= ID|STRING */
174411
- 210, /* (359) signed ::= plus_num */
174412
- 210, /* (360) signed ::= minus_num */
174413
- 207, /* (361) carglist ::= carglist ccons */
174414
- 207, /* (362) carglist ::= */
174415
- 215, /* (363) ccons ::= NULL onconf */
174416
- 215, /* (364) ccons ::= GENERATED ALWAYS AS generated */
174417
- 215, /* (365) ccons ::= AS generated */
174418
- 202, /* (366) conslist_opt ::= COMMA conslist */
174419
- 228, /* (367) conslist ::= conslist tconscomma tcons */
174420
- 228, /* (368) conslist ::= tcons */
174421
- 229, /* (369) tconscomma ::= */
174422
- 233, /* (370) defer_subclause_opt ::= defer_subclause */
174423
- 235, /* (371) resolvetype ::= raisetype */
174424
- 239, /* (372) selectnowith ::= oneselect */
174425
- 240, /* (373) oneselect ::= values */
174426
- 254, /* (374) sclp ::= selcollist COMMA */
174427
- 255, /* (375) as ::= ID|STRING */
174428
- 264, /* (376) indexed_opt ::= indexed_by */
174429
- 272, /* (377) returning ::= */
174430
- 217, /* (378) expr ::= term */
174431
- 274, /* (379) likeop ::= LIKE_KW|MATCH */
174432
- 278, /* (380) case_operand ::= expr */
174433
- 261, /* (381) exprlist ::= nexprlist */
174434
- 284, /* (382) nmnum ::= plus_num */
174435
- 284, /* (383) nmnum ::= nm */
174436
- 284, /* (384) nmnum ::= ON */
174437
- 284, /* (385) nmnum ::= DELETE */
174438
- 284, /* (386) nmnum ::= DEFAULT */
174439
- 211, /* (387) plus_num ::= INTEGER|FLOAT */
174440
- 289, /* (388) foreach_clause ::= */
174441
- 289, /* (389) foreach_clause ::= FOR EACH ROW */
174442
- 292, /* (390) trnm ::= nm */
174443
- 293, /* (391) tridxby ::= */
174444
- 294, /* (392) database_kw_opt ::= DATABASE */
174445
- 294, /* (393) database_kw_opt ::= */
174446
- 297, /* (394) kwcolumn_opt ::= */
174447
- 297, /* (395) kwcolumn_opt ::= COLUMNKW */
174448
- 299, /* (396) vtabarglist ::= vtabarg */
174449
- 299, /* (397) vtabarglist ::= vtabarglist COMMA vtabarg */
174450
- 300, /* (398) vtabarg ::= vtabarg vtabargtoken */
174451
- 303, /* (399) anylist ::= */
174452
- 303, /* (400) anylist ::= anylist LP anylist RP */
174453
- 303, /* (401) anylist ::= anylist ANY */
174454
- 266, /* (402) with ::= */
174455
- 306, /* (403) windowdefn_list ::= windowdefn */
174456
- 308, /* (404) window ::= frame_opt */
174338
+ 190, /* (0) explain ::= EXPLAIN */
174339
+ 190, /* (1) explain ::= EXPLAIN QUERY PLAN */
174340
+ 189, /* (2) cmdx ::= cmd */
174341
+ 191, /* (3) cmd ::= BEGIN transtype trans_opt */
174342
+ 192, /* (4) transtype ::= */
174343
+ 192, /* (5) transtype ::= DEFERRED */
174344
+ 192, /* (6) transtype ::= IMMEDIATE */
174345
+ 192, /* (7) transtype ::= EXCLUSIVE */
174346
+ 191, /* (8) cmd ::= COMMIT|END trans_opt */
174347
+ 191, /* (9) cmd ::= ROLLBACK trans_opt */
174348
+ 191, /* (10) cmd ::= SAVEPOINT nm */
174349
+ 191, /* (11) cmd ::= RELEASE savepoint_opt nm */
174350
+ 191, /* (12) cmd ::= ROLLBACK trans_opt TO savepoint_opt nm */
174351
+ 196, /* (13) create_table ::= createkw temp TABLE ifnotexists nm dbnm */
174352
+ 198, /* (14) createkw ::= CREATE */
174353
+ 200, /* (15) ifnotexists ::= */
174354
+ 200, /* (16) ifnotexists ::= IF NOT EXISTS */
174355
+ 199, /* (17) temp ::= TEMP */
174356
+ 199, /* (18) temp ::= */
174357
+ 197, /* (19) create_table_args ::= LP columnlist conslist_opt RP table_option_set */
174358
+ 197, /* (20) create_table_args ::= AS select */
174359
+ 204, /* (21) table_option_set ::= */
174360
+ 204, /* (22) table_option_set ::= table_option_set COMMA table_option */
174361
+ 206, /* (23) table_option ::= WITHOUT nm */
174362
+ 206, /* (24) table_option ::= nm */
174363
+ 207, /* (25) columnname ::= nm typetoken */
174364
+ 209, /* (26) typetoken ::= */
174365
+ 209, /* (27) typetoken ::= typename LP signed RP */
174366
+ 209, /* (28) typetoken ::= typename LP signed COMMA signed RP */
174367
+ 210, /* (29) typename ::= typename ID|STRING */
174368
+ 214, /* (30) scanpt ::= */
174369
+ 215, /* (31) scantok ::= */
174370
+ 216, /* (32) ccons ::= CONSTRAINT nm */
174371
+ 216, /* (33) ccons ::= DEFAULT scantok term */
174372
+ 216, /* (34) ccons ::= DEFAULT LP expr RP */
174373
+ 216, /* (35) ccons ::= DEFAULT PLUS scantok term */
174374
+ 216, /* (36) ccons ::= DEFAULT MINUS scantok term */
174375
+ 216, /* (37) ccons ::= DEFAULT scantok ID|INDEXED */
174376
+ 216, /* (38) ccons ::= NOT NULL onconf */
174377
+ 216, /* (39) ccons ::= PRIMARY KEY sortorder onconf autoinc */
174378
+ 216, /* (40) ccons ::= UNIQUE onconf */
174379
+ 216, /* (41) ccons ::= CHECK LP expr RP */
174380
+ 216, /* (42) ccons ::= REFERENCES nm eidlist_opt refargs */
174381
+ 216, /* (43) ccons ::= defer_subclause */
174382
+ 216, /* (44) ccons ::= COLLATE ID|STRING */
174383
+ 225, /* (45) generated ::= LP expr RP */
174384
+ 225, /* (46) generated ::= LP expr RP ID */
174385
+ 221, /* (47) autoinc ::= */
174386
+ 221, /* (48) autoinc ::= AUTOINCR */
174387
+ 223, /* (49) refargs ::= */
174388
+ 223, /* (50) refargs ::= refargs refarg */
174389
+ 226, /* (51) refarg ::= MATCH nm */
174390
+ 226, /* (52) refarg ::= ON INSERT refact */
174391
+ 226, /* (53) refarg ::= ON DELETE refact */
174392
+ 226, /* (54) refarg ::= ON UPDATE refact */
174393
+ 227, /* (55) refact ::= SET NULL */
174394
+ 227, /* (56) refact ::= SET DEFAULT */
174395
+ 227, /* (57) refact ::= CASCADE */
174396
+ 227, /* (58) refact ::= RESTRICT */
174397
+ 227, /* (59) refact ::= NO ACTION */
174398
+ 224, /* (60) defer_subclause ::= NOT DEFERRABLE init_deferred_pred_opt */
174399
+ 224, /* (61) defer_subclause ::= DEFERRABLE init_deferred_pred_opt */
174400
+ 228, /* (62) init_deferred_pred_opt ::= */
174401
+ 228, /* (63) init_deferred_pred_opt ::= INITIALLY DEFERRED */
174402
+ 228, /* (64) init_deferred_pred_opt ::= INITIALLY IMMEDIATE */
174403
+ 203, /* (65) conslist_opt ::= */
174404
+ 230, /* (66) tconscomma ::= COMMA */
174405
+ 231, /* (67) tcons ::= CONSTRAINT nm */
174406
+ 231, /* (68) tcons ::= PRIMARY KEY LP sortlist autoinc RP onconf */
174407
+ 231, /* (69) tcons ::= UNIQUE LP sortlist RP onconf */
174408
+ 231, /* (70) tcons ::= CHECK LP expr RP onconf */
174409
+ 231, /* (71) tcons ::= FOREIGN KEY LP eidlist RP REFERENCES nm eidlist_opt refargs defer_subclause_opt */
174410
+ 234, /* (72) defer_subclause_opt ::= */
174411
+ 219, /* (73) onconf ::= */
174412
+ 219, /* (74) onconf ::= ON CONFLICT resolvetype */
174413
+ 235, /* (75) orconf ::= */
174414
+ 235, /* (76) orconf ::= OR resolvetype */
174415
+ 236, /* (77) resolvetype ::= IGNORE */
174416
+ 236, /* (78) resolvetype ::= REPLACE */
174417
+ 191, /* (79) cmd ::= DROP TABLE ifexists fullname */
174418
+ 238, /* (80) ifexists ::= IF EXISTS */
174419
+ 238, /* (81) ifexists ::= */
174420
+ 191, /* (82) cmd ::= createkw temp VIEW ifnotexists nm dbnm eidlist_opt AS select */
174421
+ 191, /* (83) cmd ::= DROP VIEW ifexists fullname */
174422
+ 191, /* (84) cmd ::= select */
174423
+ 205, /* (85) select ::= WITH wqlist selectnowith */
174424
+ 205, /* (86) select ::= WITH RECURSIVE wqlist selectnowith */
174425
+ 205, /* (87) select ::= selectnowith */
174426
+ 240, /* (88) selectnowith ::= selectnowith multiselect_op oneselect */
174427
+ 243, /* (89) multiselect_op ::= UNION */
174428
+ 243, /* (90) multiselect_op ::= UNION ALL */
174429
+ 243, /* (91) multiselect_op ::= EXCEPT|INTERSECT */
174430
+ 241, /* (92) oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt orderby_opt limit_opt */
174431
+ 241, /* (93) oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt window_clause orderby_opt limit_opt */
174432
+ 253, /* (94) values ::= VALUES LP nexprlist RP */
174433
+ 253, /* (95) values ::= values COMMA LP nexprlist RP */
174434
+ 244, /* (96) distinct ::= DISTINCT */
174435
+ 244, /* (97) distinct ::= ALL */
174436
+ 244, /* (98) distinct ::= */
174437
+ 255, /* (99) sclp ::= */
174438
+ 245, /* (100) selcollist ::= sclp scanpt expr scanpt as */
174439
+ 245, /* (101) selcollist ::= sclp scanpt STAR */
174440
+ 245, /* (102) selcollist ::= sclp scanpt nm DOT STAR */
174441
+ 256, /* (103) as ::= AS nm */
174442
+ 256, /* (104) as ::= */
174443
+ 246, /* (105) from ::= */
174444
+ 246, /* (106) from ::= FROM seltablist */
174445
+ 258, /* (107) stl_prefix ::= seltablist joinop */
174446
+ 258, /* (108) stl_prefix ::= */
174447
+ 257, /* (109) seltablist ::= stl_prefix nm dbnm as on_using */
174448
+ 257, /* (110) seltablist ::= stl_prefix nm dbnm as indexed_by on_using */
174449
+ 257, /* (111) seltablist ::= stl_prefix nm dbnm LP exprlist RP as on_using */
174450
+ 257, /* (112) seltablist ::= stl_prefix LP select RP as on_using */
174451
+ 257, /* (113) seltablist ::= stl_prefix LP seltablist RP as on_using */
174452
+ 201, /* (114) dbnm ::= */
174453
+ 201, /* (115) dbnm ::= DOT nm */
174454
+ 239, /* (116) fullname ::= nm */
174455
+ 239, /* (117) fullname ::= nm DOT nm */
174456
+ 263, /* (118) xfullname ::= nm */
174457
+ 263, /* (119) xfullname ::= nm DOT nm */
174458
+ 263, /* (120) xfullname ::= nm DOT nm AS nm */
174459
+ 263, /* (121) xfullname ::= nm AS nm */
174460
+ 259, /* (122) joinop ::= COMMA|JOIN */
174461
+ 259, /* (123) joinop ::= JOIN_KW JOIN */
174462
+ 259, /* (124) joinop ::= JOIN_KW nm JOIN */
174463
+ 259, /* (125) joinop ::= JOIN_KW nm nm JOIN */
174464
+ 260, /* (126) on_using ::= ON expr */
174465
+ 260, /* (127) on_using ::= USING LP idlist RP */
174466
+ 260, /* (128) on_using ::= */
174467
+ 265, /* (129) indexed_opt ::= */
174468
+ 261, /* (130) indexed_by ::= INDEXED BY nm */
174469
+ 261, /* (131) indexed_by ::= NOT INDEXED */
174470
+ 250, /* (132) orderby_opt ::= */
174471
+ 250, /* (133) orderby_opt ::= ORDER BY sortlist */
174472
+ 232, /* (134) sortlist ::= sortlist COMMA expr sortorder nulls */
174473
+ 232, /* (135) sortlist ::= expr sortorder nulls */
174474
+ 220, /* (136) sortorder ::= ASC */
174475
+ 220, /* (137) sortorder ::= DESC */
174476
+ 220, /* (138) sortorder ::= */
174477
+ 266, /* (139) nulls ::= NULLS FIRST */
174478
+ 266, /* (140) nulls ::= NULLS LAST */
174479
+ 266, /* (141) nulls ::= */
174480
+ 248, /* (142) groupby_opt ::= */
174481
+ 248, /* (143) groupby_opt ::= GROUP BY nexprlist */
174482
+ 249, /* (144) having_opt ::= */
174483
+ 249, /* (145) having_opt ::= HAVING expr */
174484
+ 251, /* (146) limit_opt ::= */
174485
+ 251, /* (147) limit_opt ::= LIMIT expr */
174486
+ 251, /* (148) limit_opt ::= LIMIT expr OFFSET expr */
174487
+ 251, /* (149) limit_opt ::= LIMIT expr COMMA expr */
174488
+ 191, /* (150) cmd ::= with DELETE FROM xfullname indexed_opt where_opt_ret */
174489
+ 247, /* (151) where_opt ::= */
174490
+ 247, /* (152) where_opt ::= WHERE expr */
174491
+ 268, /* (153) where_opt_ret ::= */
174492
+ 268, /* (154) where_opt_ret ::= WHERE expr */
174493
+ 268, /* (155) where_opt_ret ::= RETURNING selcollist */
174494
+ 268, /* (156) where_opt_ret ::= WHERE expr RETURNING selcollist */
174495
+ 191, /* (157) cmd ::= with UPDATE orconf xfullname indexed_opt SET setlist from where_opt_ret */
174496
+ 269, /* (158) setlist ::= setlist COMMA nm EQ expr */
174497
+ 269, /* (159) setlist ::= setlist COMMA LP idlist RP EQ expr */
174498
+ 269, /* (160) setlist ::= nm EQ expr */
174499
+ 269, /* (161) setlist ::= LP idlist RP EQ expr */
174500
+ 191, /* (162) cmd ::= with insert_cmd INTO xfullname idlist_opt select upsert */
174501
+ 191, /* (163) cmd ::= with insert_cmd INTO xfullname idlist_opt DEFAULT VALUES returning */
174502
+ 272, /* (164) upsert ::= */
174503
+ 272, /* (165) upsert ::= RETURNING selcollist */
174504
+ 272, /* (166) upsert ::= ON CONFLICT LP sortlist RP where_opt DO UPDATE SET setlist where_opt upsert */
174505
+ 272, /* (167) upsert ::= ON CONFLICT LP sortlist RP where_opt DO NOTHING upsert */
174506
+ 272, /* (168) upsert ::= ON CONFLICT DO NOTHING returning */
174507
+ 272, /* (169) upsert ::= ON CONFLICT DO UPDATE SET setlist where_opt returning */
174508
+ 273, /* (170) returning ::= RETURNING selcollist */
174509
+ 270, /* (171) insert_cmd ::= INSERT orconf */
174510
+ 270, /* (172) insert_cmd ::= REPLACE */
174511
+ 271, /* (173) idlist_opt ::= */
174512
+ 271, /* (174) idlist_opt ::= LP idlist RP */
174513
+ 264, /* (175) idlist ::= idlist COMMA nm */
174514
+ 264, /* (176) idlist ::= nm */
174515
+ 218, /* (177) expr ::= LP expr RP */
174516
+ 218, /* (178) expr ::= ID|INDEXED|JOIN_KW */
174517
+ 218, /* (179) expr ::= nm DOT nm */
174518
+ 218, /* (180) expr ::= nm DOT nm DOT nm */
174519
+ 217, /* (181) term ::= NULL|FLOAT|BLOB */
174520
+ 217, /* (182) term ::= STRING */
174521
+ 217, /* (183) term ::= INTEGER */
174522
+ 218, /* (184) expr ::= VARIABLE */
174523
+ 218, /* (185) expr ::= expr COLLATE ID|STRING */
174524
+ 218, /* (186) expr ::= CAST LP expr AS typetoken RP */
174525
+ 218, /* (187) expr ::= ID|INDEXED|JOIN_KW LP distinct exprlist RP */
174526
+ 218, /* (188) expr ::= ID|INDEXED|JOIN_KW LP distinct exprlist ORDER BY sortlist RP */
174527
+ 218, /* (189) expr ::= ID|INDEXED|JOIN_KW LP STAR RP */
174528
+ 218, /* (190) expr ::= ID|INDEXED|JOIN_KW LP distinct exprlist RP filter_over */
174529
+ 218, /* (191) expr ::= ID|INDEXED|JOIN_KW LP distinct exprlist ORDER BY sortlist RP filter_over */
174530
+ 218, /* (192) expr ::= ID|INDEXED|JOIN_KW LP STAR RP filter_over */
174531
+ 217, /* (193) term ::= CTIME_KW */
174532
+ 218, /* (194) expr ::= LP nexprlist COMMA expr RP */
174533
+ 218, /* (195) expr ::= expr AND expr */
174534
+ 218, /* (196) expr ::= expr OR expr */
174535
+ 218, /* (197) expr ::= expr LT|GT|GE|LE expr */
174536
+ 218, /* (198) expr ::= expr EQ|NE expr */
174537
+ 218, /* (199) expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr */
174538
+ 218, /* (200) expr ::= expr PLUS|MINUS expr */
174539
+ 218, /* (201) expr ::= expr STAR|SLASH|REM expr */
174540
+ 218, /* (202) expr ::= expr CONCAT expr */
174541
+ 275, /* (203) likeop ::= NOT LIKE_KW|MATCH */
174542
+ 218, /* (204) expr ::= expr likeop expr */
174543
+ 218, /* (205) expr ::= expr likeop expr ESCAPE expr */
174544
+ 218, /* (206) expr ::= expr ISNULL|NOTNULL */
174545
+ 218, /* (207) expr ::= expr NOT NULL */
174546
+ 218, /* (208) expr ::= expr IS expr */
174547
+ 218, /* (209) expr ::= expr IS NOT expr */
174548
+ 218, /* (210) expr ::= expr IS NOT DISTINCT FROM expr */
174549
+ 218, /* (211) expr ::= expr IS DISTINCT FROM expr */
174550
+ 218, /* (212) expr ::= NOT expr */
174551
+ 218, /* (213) expr ::= BITNOT expr */
174552
+ 218, /* (214) expr ::= PLUS|MINUS expr */
174553
+ 218, /* (215) expr ::= expr PTR expr */
174554
+ 276, /* (216) between_op ::= BETWEEN */
174555
+ 276, /* (217) between_op ::= NOT BETWEEN */
174556
+ 218, /* (218) expr ::= expr between_op expr AND expr */
174557
+ 277, /* (219) in_op ::= IN */
174558
+ 277, /* (220) in_op ::= NOT IN */
174559
+ 218, /* (221) expr ::= expr in_op LP exprlist RP */
174560
+ 218, /* (222) expr ::= LP select RP */
174561
+ 218, /* (223) expr ::= expr in_op LP select RP */
174562
+ 218, /* (224) expr ::= expr in_op nm dbnm paren_exprlist */
174563
+ 218, /* (225) expr ::= EXISTS LP select RP */
174564
+ 218, /* (226) expr ::= CASE case_operand case_exprlist case_else END */
174565
+ 280, /* (227) case_exprlist ::= case_exprlist WHEN expr THEN expr */
174566
+ 280, /* (228) case_exprlist ::= WHEN expr THEN expr */
174567
+ 281, /* (229) case_else ::= ELSE expr */
174568
+ 281, /* (230) case_else ::= */
174569
+ 279, /* (231) case_operand ::= */
174570
+ 262, /* (232) exprlist ::= */
174571
+ 254, /* (233) nexprlist ::= nexprlist COMMA expr */
174572
+ 254, /* (234) nexprlist ::= expr */
174573
+ 278, /* (235) paren_exprlist ::= */
174574
+ 278, /* (236) paren_exprlist ::= LP exprlist RP */
174575
+ 191, /* (237) cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP sortlist RP where_opt */
174576
+ 282, /* (238) uniqueflag ::= UNIQUE */
174577
+ 282, /* (239) uniqueflag ::= */
174578
+ 222, /* (240) eidlist_opt ::= */
174579
+ 222, /* (241) eidlist_opt ::= LP eidlist RP */
174580
+ 233, /* (242) eidlist ::= eidlist COMMA nm collate sortorder */
174581
+ 233, /* (243) eidlist ::= nm collate sortorder */
174582
+ 283, /* (244) collate ::= */
174583
+ 283, /* (245) collate ::= COLLATE ID|STRING */
174584
+ 191, /* (246) cmd ::= DROP INDEX ifexists fullname */
174585
+ 191, /* (247) cmd ::= VACUUM vinto */
174586
+ 191, /* (248) cmd ::= VACUUM nm vinto */
174587
+ 284, /* (249) vinto ::= INTO expr */
174588
+ 284, /* (250) vinto ::= */
174589
+ 191, /* (251) cmd ::= PRAGMA nm dbnm */
174590
+ 191, /* (252) cmd ::= PRAGMA nm dbnm EQ nmnum */
174591
+ 191, /* (253) cmd ::= PRAGMA nm dbnm LP nmnum RP */
174592
+ 191, /* (254) cmd ::= PRAGMA nm dbnm EQ minus_num */
174593
+ 191, /* (255) cmd ::= PRAGMA nm dbnm LP minus_num RP */
174594
+ 212, /* (256) plus_num ::= PLUS INTEGER|FLOAT */
174595
+ 213, /* (257) minus_num ::= MINUS INTEGER|FLOAT */
174596
+ 191, /* (258) cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END */
174597
+ 286, /* (259) trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause */
174598
+ 288, /* (260) trigger_time ::= BEFORE|AFTER */
174599
+ 288, /* (261) trigger_time ::= INSTEAD OF */
174600
+ 288, /* (262) trigger_time ::= */
174601
+ 289, /* (263) trigger_event ::= DELETE|INSERT */
174602
+ 289, /* (264) trigger_event ::= UPDATE */
174603
+ 289, /* (265) trigger_event ::= UPDATE OF idlist */
174604
+ 291, /* (266) when_clause ::= */
174605
+ 291, /* (267) when_clause ::= WHEN expr */
174606
+ 287, /* (268) trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI */
174607
+ 287, /* (269) trigger_cmd_list ::= trigger_cmd SEMI */
174608
+ 293, /* (270) trnm ::= nm DOT nm */
174609
+ 294, /* (271) tridxby ::= INDEXED BY nm */
174610
+ 294, /* (272) tridxby ::= NOT INDEXED */
174611
+ 292, /* (273) trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist from where_opt scanpt */
174612
+ 292, /* (274) trigger_cmd ::= scanpt insert_cmd INTO trnm idlist_opt select upsert scanpt */
174613
+ 292, /* (275) trigger_cmd ::= DELETE FROM trnm tridxby where_opt scanpt */
174614
+ 292, /* (276) trigger_cmd ::= scanpt select scanpt */
174615
+ 218, /* (277) expr ::= RAISE LP IGNORE RP */
174616
+ 218, /* (278) expr ::= RAISE LP raisetype COMMA nm RP */
174617
+ 237, /* (279) raisetype ::= ROLLBACK */
174618
+ 237, /* (280) raisetype ::= ABORT */
174619
+ 237, /* (281) raisetype ::= FAIL */
174620
+ 191, /* (282) cmd ::= DROP TRIGGER ifexists fullname */
174621
+ 191, /* (283) cmd ::= ATTACH database_kw_opt expr AS expr key_opt */
174622
+ 191, /* (284) cmd ::= DETACH database_kw_opt expr */
174623
+ 296, /* (285) key_opt ::= */
174624
+ 296, /* (286) key_opt ::= KEY expr */
174625
+ 191, /* (287) cmd ::= REINDEX */
174626
+ 191, /* (288) cmd ::= REINDEX nm dbnm */
174627
+ 191, /* (289) cmd ::= ANALYZE */
174628
+ 191, /* (290) cmd ::= ANALYZE nm dbnm */
174629
+ 191, /* (291) cmd ::= ALTER TABLE fullname RENAME TO nm */
174630
+ 191, /* (292) cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt columnname carglist */
174631
+ 191, /* (293) cmd ::= ALTER TABLE fullname DROP kwcolumn_opt nm */
174632
+ 297, /* (294) add_column_fullname ::= fullname */
174633
+ 191, /* (295) cmd ::= ALTER TABLE fullname RENAME kwcolumn_opt nm TO nm */
174634
+ 191, /* (296) cmd ::= create_vtab */
174635
+ 191, /* (297) cmd ::= create_vtab LP vtabarglist RP */
174636
+ 299, /* (298) create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm */
174637
+ 301, /* (299) vtabarg ::= */
174638
+ 302, /* (300) vtabargtoken ::= ANY */
174639
+ 302, /* (301) vtabargtoken ::= lp anylist RP */
174640
+ 303, /* (302) lp ::= LP */
174641
+ 267, /* (303) with ::= WITH wqlist */
174642
+ 267, /* (304) with ::= WITH RECURSIVE wqlist */
174643
+ 306, /* (305) wqas ::= AS */
174644
+ 306, /* (306) wqas ::= AS MATERIALIZED */
174645
+ 306, /* (307) wqas ::= AS NOT MATERIALIZED */
174646
+ 305, /* (308) wqitem ::= nm eidlist_opt wqas LP select RP */
174647
+ 242, /* (309) wqlist ::= wqitem */
174648
+ 242, /* (310) wqlist ::= wqlist COMMA wqitem */
174649
+ 307, /* (311) windowdefn_list ::= windowdefn_list COMMA windowdefn */
174650
+ 308, /* (312) windowdefn ::= nm AS LP window RP */
174651
+ 309, /* (313) window ::= PARTITION BY nexprlist orderby_opt frame_opt */
174652
+ 309, /* (314) window ::= nm PARTITION BY nexprlist orderby_opt frame_opt */
174653
+ 309, /* (315) window ::= ORDER BY sortlist frame_opt */
174654
+ 309, /* (316) window ::= nm ORDER BY sortlist frame_opt */
174655
+ 309, /* (317) window ::= nm frame_opt */
174656
+ 310, /* (318) frame_opt ::= */
174657
+ 310, /* (319) frame_opt ::= range_or_rows frame_bound_s frame_exclude_opt */
174658
+ 310, /* (320) frame_opt ::= range_or_rows BETWEEN frame_bound_s AND frame_bound_e frame_exclude_opt */
174659
+ 314, /* (321) range_or_rows ::= RANGE|ROWS|GROUPS */
174660
+ 316, /* (322) frame_bound_s ::= frame_bound */
174661
+ 316, /* (323) frame_bound_s ::= UNBOUNDED PRECEDING */
174662
+ 317, /* (324) frame_bound_e ::= frame_bound */
174663
+ 317, /* (325) frame_bound_e ::= UNBOUNDED FOLLOWING */
174664
+ 315, /* (326) frame_bound ::= expr PRECEDING|FOLLOWING */
174665
+ 315, /* (327) frame_bound ::= CURRENT ROW */
174666
+ 318, /* (328) frame_exclude_opt ::= */
174667
+ 318, /* (329) frame_exclude_opt ::= EXCLUDE frame_exclude */
174668
+ 319, /* (330) frame_exclude ::= NO OTHERS */
174669
+ 319, /* (331) frame_exclude ::= CURRENT ROW */
174670
+ 319, /* (332) frame_exclude ::= GROUP|TIES */
174671
+ 252, /* (333) window_clause ::= WINDOW windowdefn_list */
174672
+ 274, /* (334) filter_over ::= filter_clause over_clause */
174673
+ 274, /* (335) filter_over ::= over_clause */
174674
+ 274, /* (336) filter_over ::= filter_clause */
174675
+ 313, /* (337) over_clause ::= OVER LP window RP */
174676
+ 313, /* (338) over_clause ::= OVER nm */
174677
+ 312, /* (339) filter_clause ::= FILTER LP WHERE expr RP */
174678
+ 217, /* (340) term ::= QNUMBER */
174679
+ 186, /* (341) input ::= cmdlist */
174680
+ 187, /* (342) cmdlist ::= cmdlist ecmd */
174681
+ 187, /* (343) cmdlist ::= ecmd */
174682
+ 188, /* (344) ecmd ::= SEMI */
174683
+ 188, /* (345) ecmd ::= cmdx SEMI */
174684
+ 188, /* (346) ecmd ::= explain cmdx SEMI */
174685
+ 193, /* (347) trans_opt ::= */
174686
+ 193, /* (348) trans_opt ::= TRANSACTION */
174687
+ 193, /* (349) trans_opt ::= TRANSACTION nm */
174688
+ 195, /* (350) savepoint_opt ::= SAVEPOINT */
174689
+ 195, /* (351) savepoint_opt ::= */
174690
+ 191, /* (352) cmd ::= create_table create_table_args */
174691
+ 204, /* (353) table_option_set ::= table_option */
174692
+ 202, /* (354) columnlist ::= columnlist COMMA columnname carglist */
174693
+ 202, /* (355) columnlist ::= columnname carglist */
174694
+ 194, /* (356) nm ::= ID|INDEXED|JOIN_KW */
174695
+ 194, /* (357) nm ::= STRING */
174696
+ 209, /* (358) typetoken ::= typename */
174697
+ 210, /* (359) typename ::= ID|STRING */
174698
+ 211, /* (360) signed ::= plus_num */
174699
+ 211, /* (361) signed ::= minus_num */
174700
+ 208, /* (362) carglist ::= carglist ccons */
174701
+ 208, /* (363) carglist ::= */
174702
+ 216, /* (364) ccons ::= NULL onconf */
174703
+ 216, /* (365) ccons ::= GENERATED ALWAYS AS generated */
174704
+ 216, /* (366) ccons ::= AS generated */
174705
+ 203, /* (367) conslist_opt ::= COMMA conslist */
174706
+ 229, /* (368) conslist ::= conslist tconscomma tcons */
174707
+ 229, /* (369) conslist ::= tcons */
174708
+ 230, /* (370) tconscomma ::= */
174709
+ 234, /* (371) defer_subclause_opt ::= defer_subclause */
174710
+ 236, /* (372) resolvetype ::= raisetype */
174711
+ 240, /* (373) selectnowith ::= oneselect */
174712
+ 241, /* (374) oneselect ::= values */
174713
+ 255, /* (375) sclp ::= selcollist COMMA */
174714
+ 256, /* (376) as ::= ID|STRING */
174715
+ 265, /* (377) indexed_opt ::= indexed_by */
174716
+ 273, /* (378) returning ::= */
174717
+ 218, /* (379) expr ::= term */
174718
+ 275, /* (380) likeop ::= LIKE_KW|MATCH */
174719
+ 279, /* (381) case_operand ::= expr */
174720
+ 262, /* (382) exprlist ::= nexprlist */
174721
+ 285, /* (383) nmnum ::= plus_num */
174722
+ 285, /* (384) nmnum ::= nm */
174723
+ 285, /* (385) nmnum ::= ON */
174724
+ 285, /* (386) nmnum ::= DELETE */
174725
+ 285, /* (387) nmnum ::= DEFAULT */
174726
+ 212, /* (388) plus_num ::= INTEGER|FLOAT */
174727
+ 290, /* (389) foreach_clause ::= */
174728
+ 290, /* (390) foreach_clause ::= FOR EACH ROW */
174729
+ 293, /* (391) trnm ::= nm */
174730
+ 294, /* (392) tridxby ::= */
174731
+ 295, /* (393) database_kw_opt ::= DATABASE */
174732
+ 295, /* (394) database_kw_opt ::= */
174733
+ 298, /* (395) kwcolumn_opt ::= */
174734
+ 298, /* (396) kwcolumn_opt ::= COLUMNKW */
174735
+ 300, /* (397) vtabarglist ::= vtabarg */
174736
+ 300, /* (398) vtabarglist ::= vtabarglist COMMA vtabarg */
174737
+ 301, /* (399) vtabarg ::= vtabarg vtabargtoken */
174738
+ 304, /* (400) anylist ::= */
174739
+ 304, /* (401) anylist ::= anylist LP anylist RP */
174740
+ 304, /* (402) anylist ::= anylist ANY */
174741
+ 267, /* (403) with ::= */
174742
+ 307, /* (404) windowdefn_list ::= windowdefn */
174743
+ 309, /* (405) window ::= frame_opt */
174457174744
};
174458174745
174459174746
/* For rule J, yyRuleInfoNRhs[J] contains the negative of the number
174460174747
** of symbols on the right-hand side of that rule. */
174461174748
static const signed char yyRuleInfoNRhs[] = {
@@ -174797,75 +175084,76 @@
174797175084
-1, /* (335) filter_over ::= over_clause */
174798175085
-1, /* (336) filter_over ::= filter_clause */
174799175086
-4, /* (337) over_clause ::= OVER LP window RP */
174800175087
-2, /* (338) over_clause ::= OVER nm */
174801175088
-5, /* (339) filter_clause ::= FILTER LP WHERE expr RP */
174802
- -1, /* (340) input ::= cmdlist */
174803
- -2, /* (341) cmdlist ::= cmdlist ecmd */
174804
- -1, /* (342) cmdlist ::= ecmd */
174805
- -1, /* (343) ecmd ::= SEMI */
174806
- -2, /* (344) ecmd ::= cmdx SEMI */
174807
- -3, /* (345) ecmd ::= explain cmdx SEMI */
174808
- 0, /* (346) trans_opt ::= */
174809
- -1, /* (347) trans_opt ::= TRANSACTION */
174810
- -2, /* (348) trans_opt ::= TRANSACTION nm */
174811
- -1, /* (349) savepoint_opt ::= SAVEPOINT */
174812
- 0, /* (350) savepoint_opt ::= */
174813
- -2, /* (351) cmd ::= create_table create_table_args */
174814
- -1, /* (352) table_option_set ::= table_option */
174815
- -4, /* (353) columnlist ::= columnlist COMMA columnname carglist */
174816
- -2, /* (354) columnlist ::= columnname carglist */
174817
- -1, /* (355) nm ::= ID|INDEXED|JOIN_KW */
174818
- -1, /* (356) nm ::= STRING */
174819
- -1, /* (357) typetoken ::= typename */
174820
- -1, /* (358) typename ::= ID|STRING */
174821
- -1, /* (359) signed ::= plus_num */
174822
- -1, /* (360) signed ::= minus_num */
174823
- -2, /* (361) carglist ::= carglist ccons */
174824
- 0, /* (362) carglist ::= */
174825
- -2, /* (363) ccons ::= NULL onconf */
174826
- -4, /* (364) ccons ::= GENERATED ALWAYS AS generated */
174827
- -2, /* (365) ccons ::= AS generated */
174828
- -2, /* (366) conslist_opt ::= COMMA conslist */
174829
- -3, /* (367) conslist ::= conslist tconscomma tcons */
174830
- -1, /* (368) conslist ::= tcons */
174831
- 0, /* (369) tconscomma ::= */
174832
- -1, /* (370) defer_subclause_opt ::= defer_subclause */
174833
- -1, /* (371) resolvetype ::= raisetype */
174834
- -1, /* (372) selectnowith ::= oneselect */
174835
- -1, /* (373) oneselect ::= values */
174836
- -2, /* (374) sclp ::= selcollist COMMA */
174837
- -1, /* (375) as ::= ID|STRING */
174838
- -1, /* (376) indexed_opt ::= indexed_by */
174839
- 0, /* (377) returning ::= */
174840
- -1, /* (378) expr ::= term */
174841
- -1, /* (379) likeop ::= LIKE_KW|MATCH */
174842
- -1, /* (380) case_operand ::= expr */
174843
- -1, /* (381) exprlist ::= nexprlist */
174844
- -1, /* (382) nmnum ::= plus_num */
174845
- -1, /* (383) nmnum ::= nm */
174846
- -1, /* (384) nmnum ::= ON */
174847
- -1, /* (385) nmnum ::= DELETE */
174848
- -1, /* (386) nmnum ::= DEFAULT */
174849
- -1, /* (387) plus_num ::= INTEGER|FLOAT */
174850
- 0, /* (388) foreach_clause ::= */
174851
- -3, /* (389) foreach_clause ::= FOR EACH ROW */
174852
- -1, /* (390) trnm ::= nm */
174853
- 0, /* (391) tridxby ::= */
174854
- -1, /* (392) database_kw_opt ::= DATABASE */
174855
- 0, /* (393) database_kw_opt ::= */
174856
- 0, /* (394) kwcolumn_opt ::= */
174857
- -1, /* (395) kwcolumn_opt ::= COLUMNKW */
174858
- -1, /* (396) vtabarglist ::= vtabarg */
174859
- -3, /* (397) vtabarglist ::= vtabarglist COMMA vtabarg */
174860
- -2, /* (398) vtabarg ::= vtabarg vtabargtoken */
174861
- 0, /* (399) anylist ::= */
174862
- -4, /* (400) anylist ::= anylist LP anylist RP */
174863
- -2, /* (401) anylist ::= anylist ANY */
174864
- 0, /* (402) with ::= */
174865
- -1, /* (403) windowdefn_list ::= windowdefn */
174866
- -1, /* (404) window ::= frame_opt */
175089
+ -1, /* (340) term ::= QNUMBER */
175090
+ -1, /* (341) input ::= cmdlist */
175091
+ -2, /* (342) cmdlist ::= cmdlist ecmd */
175092
+ -1, /* (343) cmdlist ::= ecmd */
175093
+ -1, /* (344) ecmd ::= SEMI */
175094
+ -2, /* (345) ecmd ::= cmdx SEMI */
175095
+ -3, /* (346) ecmd ::= explain cmdx SEMI */
175096
+ 0, /* (347) trans_opt ::= */
175097
+ -1, /* (348) trans_opt ::= TRANSACTION */
175098
+ -2, /* (349) trans_opt ::= TRANSACTION nm */
175099
+ -1, /* (350) savepoint_opt ::= SAVEPOINT */
175100
+ 0, /* (351) savepoint_opt ::= */
175101
+ -2, /* (352) cmd ::= create_table create_table_args */
175102
+ -1, /* (353) table_option_set ::= table_option */
175103
+ -4, /* (354) columnlist ::= columnlist COMMA columnname carglist */
175104
+ -2, /* (355) columnlist ::= columnname carglist */
175105
+ -1, /* (356) nm ::= ID|INDEXED|JOIN_KW */
175106
+ -1, /* (357) nm ::= STRING */
175107
+ -1, /* (358) typetoken ::= typename */
175108
+ -1, /* (359) typename ::= ID|STRING */
175109
+ -1, /* (360) signed ::= plus_num */
175110
+ -1, /* (361) signed ::= minus_num */
175111
+ -2, /* (362) carglist ::= carglist ccons */
175112
+ 0, /* (363) carglist ::= */
175113
+ -2, /* (364) ccons ::= NULL onconf */
175114
+ -4, /* (365) ccons ::= GENERATED ALWAYS AS generated */
175115
+ -2, /* (366) ccons ::= AS generated */
175116
+ -2, /* (367) conslist_opt ::= COMMA conslist */
175117
+ -3, /* (368) conslist ::= conslist tconscomma tcons */
175118
+ -1, /* (369) conslist ::= tcons */
175119
+ 0, /* (370) tconscomma ::= */
175120
+ -1, /* (371) defer_subclause_opt ::= defer_subclause */
175121
+ -1, /* (372) resolvetype ::= raisetype */
175122
+ -1, /* (373) selectnowith ::= oneselect */
175123
+ -1, /* (374) oneselect ::= values */
175124
+ -2, /* (375) sclp ::= selcollist COMMA */
175125
+ -1, /* (376) as ::= ID|STRING */
175126
+ -1, /* (377) indexed_opt ::= indexed_by */
175127
+ 0, /* (378) returning ::= */
175128
+ -1, /* (379) expr ::= term */
175129
+ -1, /* (380) likeop ::= LIKE_KW|MATCH */
175130
+ -1, /* (381) case_operand ::= expr */
175131
+ -1, /* (382) exprlist ::= nexprlist */
175132
+ -1, /* (383) nmnum ::= plus_num */
175133
+ -1, /* (384) nmnum ::= nm */
175134
+ -1, /* (385) nmnum ::= ON */
175135
+ -1, /* (386) nmnum ::= DELETE */
175136
+ -1, /* (387) nmnum ::= DEFAULT */
175137
+ -1, /* (388) plus_num ::= INTEGER|FLOAT */
175138
+ 0, /* (389) foreach_clause ::= */
175139
+ -3, /* (390) foreach_clause ::= FOR EACH ROW */
175140
+ -1, /* (391) trnm ::= nm */
175141
+ 0, /* (392) tridxby ::= */
175142
+ -1, /* (393) database_kw_opt ::= DATABASE */
175143
+ 0, /* (394) database_kw_opt ::= */
175144
+ 0, /* (395) kwcolumn_opt ::= */
175145
+ -1, /* (396) kwcolumn_opt ::= COLUMNKW */
175146
+ -1, /* (397) vtabarglist ::= vtabarg */
175147
+ -3, /* (398) vtabarglist ::= vtabarglist COMMA vtabarg */
175148
+ -2, /* (399) vtabarg ::= vtabarg vtabargtoken */
175149
+ 0, /* (400) anylist ::= */
175150
+ -4, /* (401) anylist ::= anylist LP anylist RP */
175151
+ -2, /* (402) anylist ::= anylist ANY */
175152
+ 0, /* (403) with ::= */
175153
+ -1, /* (404) windowdefn_list ::= windowdefn */
175154
+ -1, /* (405) window ::= frame_opt */
174867175155
};
174868175156
174869175157
static void yy_accept(yyParser*); /* Forward Declaration */
174870175158
174871175159
/*
@@ -174913,20 +175201,20 @@
174913175201
break;
174914175202
case 2: /* cmdx ::= cmd */
174915175203
{ sqlite3FinishCoding(pParse); }
174916175204
break;
174917175205
case 3: /* cmd ::= BEGIN transtype trans_opt */
174918
-{sqlite3BeginTransaction(pParse, yymsp[-1].minor.yy394);}
175206
+{sqlite3BeginTransaction(pParse, yymsp[-1].minor.yy92);}
174919175207
break;
174920175208
case 4: /* transtype ::= */
174921
-{yymsp[1].minor.yy394 = TK_DEFERRED;}
175209
+{yymsp[1].minor.yy92 = TK_DEFERRED;}
174922175210
break;
174923175211
case 5: /* transtype ::= DEFERRED */
174924175212
case 6: /* transtype ::= IMMEDIATE */ yytestcase(yyruleno==6);
174925175213
case 7: /* transtype ::= EXCLUSIVE */ yytestcase(yyruleno==7);
174926175214
case 321: /* range_or_rows ::= RANGE|ROWS|GROUPS */ yytestcase(yyruleno==321);
174927
-{yymsp[0].minor.yy394 = yymsp[0].major; /*A-overwrites-X*/}
175215
+{yymsp[0].minor.yy92 = yymsp[0].major; /*A-overwrites-X*/}
174928175216
break;
174929175217
case 8: /* cmd ::= COMMIT|END trans_opt */
174930175218
case 9: /* cmd ::= ROLLBACK trans_opt */ yytestcase(yyruleno==9);
174931175219
{sqlite3EndTransaction(pParse,yymsp[-1].major);}
174932175220
break;
@@ -174945,11 +175233,11 @@
174945175233
sqlite3Savepoint(pParse, SAVEPOINT_ROLLBACK, &yymsp[0].minor.yy0);
174946175234
}
174947175235
break;
174948175236
case 13: /* create_table ::= createkw temp TABLE ifnotexists nm dbnm */
174949175237
{
174950
- sqlite3StartTable(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,yymsp[-4].minor.yy394,0,0,yymsp[-2].minor.yy394);
175238
+ sqlite3StartTable(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,yymsp[-4].minor.yy92,0,0,yymsp[-2].minor.yy92);
174951175239
}
174952175240
break;
174953175241
case 14: /* createkw ::= CREATE */
174954175242
{disableLookaside(pParse);}
174955175243
break;
@@ -174959,56 +175247,56 @@
174959175247
case 62: /* init_deferred_pred_opt ::= */ yytestcase(yyruleno==62);
174960175248
case 72: /* defer_subclause_opt ::= */ yytestcase(yyruleno==72);
174961175249
case 81: /* ifexists ::= */ yytestcase(yyruleno==81);
174962175250
case 98: /* distinct ::= */ yytestcase(yyruleno==98);
174963175251
case 244: /* collate ::= */ yytestcase(yyruleno==244);
174964
-{yymsp[1].minor.yy394 = 0;}
175252
+{yymsp[1].minor.yy92 = 0;}
174965175253
break;
174966175254
case 16: /* ifnotexists ::= IF NOT EXISTS */
174967
-{yymsp[-2].minor.yy394 = 1;}
175255
+{yymsp[-2].minor.yy92 = 1;}
174968175256
break;
174969175257
case 17: /* temp ::= TEMP */
174970
-{yymsp[0].minor.yy394 = pParse->db->init.busy==0;}
175258
+{yymsp[0].minor.yy92 = pParse->db->init.busy==0;}
174971175259
break;
174972175260
case 19: /* create_table_args ::= LP columnlist conslist_opt RP table_option_set */
174973175261
{
174974
- sqlite3EndTable(pParse,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0,yymsp[0].minor.yy285,0);
175262
+ sqlite3EndTable(pParse,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0,yymsp[0].minor.yy527,0);
174975175263
}
174976175264
break;
174977175265
case 20: /* create_table_args ::= AS select */
174978175266
{
174979
- sqlite3EndTable(pParse,0,0,0,yymsp[0].minor.yy47);
174980
- sqlite3SelectDelete(pParse->db, yymsp[0].minor.yy47);
175267
+ sqlite3EndTable(pParse,0,0,0,yymsp[0].minor.yy299);
175268
+ sqlite3SelectDelete(pParse->db, yymsp[0].minor.yy299);
174981175269
}
174982175270
break;
174983175271
case 21: /* table_option_set ::= */
174984
-{yymsp[1].minor.yy285 = 0;}
175272
+{yymsp[1].minor.yy527 = 0;}
174985175273
break;
174986175274
case 22: /* table_option_set ::= table_option_set COMMA table_option */
174987
-{yylhsminor.yy285 = yymsp[-2].minor.yy285|yymsp[0].minor.yy285;}
174988
- yymsp[-2].minor.yy285 = yylhsminor.yy285;
175275
+{yylhsminor.yy527 = yymsp[-2].minor.yy527|yymsp[0].minor.yy527;}
175276
+ yymsp[-2].minor.yy527 = yylhsminor.yy527;
174989175277
break;
174990175278
case 23: /* table_option ::= WITHOUT nm */
174991175279
{
174992175280
if( yymsp[0].minor.yy0.n==5 && sqlite3_strnicmp(yymsp[0].minor.yy0.z,"rowid",5)==0 ){
174993
- yymsp[-1].minor.yy285 = TF_WithoutRowid | TF_NoVisibleRowid;
175281
+ yymsp[-1].minor.yy527 = TF_WithoutRowid | TF_NoVisibleRowid;
174994175282
}else{
174995
- yymsp[-1].minor.yy285 = 0;
175283
+ yymsp[-1].minor.yy527 = 0;
174996175284
sqlite3ErrorMsg(pParse, "unknown table option: %.*s", yymsp[0].minor.yy0.n, yymsp[0].minor.yy0.z);
174997175285
}
174998175286
}
174999175287
break;
175000175288
case 24: /* table_option ::= nm */
175001175289
{
175002175290
if( yymsp[0].minor.yy0.n==6 && sqlite3_strnicmp(yymsp[0].minor.yy0.z,"strict",6)==0 ){
175003
- yylhsminor.yy285 = TF_Strict;
175291
+ yylhsminor.yy527 = TF_Strict;
175004175292
}else{
175005
- yylhsminor.yy285 = 0;
175293
+ yylhsminor.yy527 = 0;
175006175294
sqlite3ErrorMsg(pParse, "unknown table option: %.*s", yymsp[0].minor.yy0.n, yymsp[0].minor.yy0.z);
175007175295
}
175008175296
}
175009
- yymsp[0].minor.yy285 = yylhsminor.yy285;
175297
+ yymsp[0].minor.yy527 = yylhsminor.yy527;
175010175298
break;
175011175299
case 25: /* columnname ::= nm typetoken */
175012175300
{sqlite3AddColumn(pParse,yymsp[-1].minor.yy0,yymsp[0].minor.yy0);}
175013175301
break;
175014175302
case 26: /* typetoken ::= */
@@ -175030,11 +175318,11 @@
175030175318
{yymsp[-1].minor.yy0.n=yymsp[0].minor.yy0.n+(int)(yymsp[0].minor.yy0.z-yymsp[-1].minor.yy0.z);}
175031175319
break;
175032175320
case 30: /* scanpt ::= */
175033175321
{
175034175322
assert( yyLookahead!=YYNOCODE );
175035
- yymsp[1].minor.yy522 = yyLookaheadToken.z;
175323
+ yymsp[1].minor.yy616 = yyLookaheadToken.z;
175036175324
}
175037175325
break;
175038175326
case 31: /* scantok ::= */
175039175327
{
175040175328
assert( yyLookahead!=YYNOCODE );
@@ -175044,21 +175332,21 @@
175044175332
case 32: /* ccons ::= CONSTRAINT nm */
175045175333
case 67: /* tcons ::= CONSTRAINT nm */ yytestcase(yyruleno==67);
175046175334
{pParse->constraintName = yymsp[0].minor.yy0;}
175047175335
break;
175048175336
case 33: /* ccons ::= DEFAULT scantok term */
175049
-{sqlite3AddDefaultValue(pParse,yymsp[0].minor.yy528,yymsp[-1].minor.yy0.z,&yymsp[-1].minor.yy0.z[yymsp[-1].minor.yy0.n]);}
175337
+{sqlite3AddDefaultValue(pParse,yymsp[0].minor.yy2,yymsp[-1].minor.yy0.z,&yymsp[-1].minor.yy0.z[yymsp[-1].minor.yy0.n]);}
175050175338
break;
175051175339
case 34: /* ccons ::= DEFAULT LP expr RP */
175052
-{sqlite3AddDefaultValue(pParse,yymsp[-1].minor.yy528,yymsp[-2].minor.yy0.z+1,yymsp[0].minor.yy0.z);}
175340
+{sqlite3AddDefaultValue(pParse,yymsp[-1].minor.yy2,yymsp[-2].minor.yy0.z+1,yymsp[0].minor.yy0.z);}
175053175341
break;
175054175342
case 35: /* ccons ::= DEFAULT PLUS scantok term */
175055
-{sqlite3AddDefaultValue(pParse,yymsp[0].minor.yy528,yymsp[-2].minor.yy0.z,&yymsp[-1].minor.yy0.z[yymsp[-1].minor.yy0.n]);}
175343
+{sqlite3AddDefaultValue(pParse,yymsp[0].minor.yy2,yymsp[-2].minor.yy0.z,&yymsp[-1].minor.yy0.z[yymsp[-1].minor.yy0.n]);}
175056175344
break;
175057175345
case 36: /* ccons ::= DEFAULT MINUS scantok term */
175058175346
{
175059
- Expr *p = sqlite3PExpr(pParse, TK_UMINUS, yymsp[0].minor.yy528, 0);
175347
+ Expr *p = sqlite3PExpr(pParse, TK_UMINUS, yymsp[0].minor.yy2, 0);
175060175348
sqlite3AddDefaultValue(pParse,p,yymsp[-2].minor.yy0.z,&yymsp[-1].minor.yy0.z[yymsp[-1].minor.yy0.n]);
175061175349
}
175062175350
break;
175063175351
case 37: /* ccons ::= DEFAULT scantok ID|INDEXED */
175064175352
{
@@ -175069,261 +175357,261 @@
175069175357
}
175070175358
sqlite3AddDefaultValue(pParse,p,yymsp[0].minor.yy0.z,yymsp[0].minor.yy0.z+yymsp[0].minor.yy0.n);
175071175359
}
175072175360
break;
175073175361
case 38: /* ccons ::= NOT NULL onconf */
175074
-{sqlite3AddNotNull(pParse, yymsp[0].minor.yy394);}
175362
+{sqlite3AddNotNull(pParse, yymsp[0].minor.yy92);}
175075175363
break;
175076175364
case 39: /* ccons ::= PRIMARY KEY sortorder onconf autoinc */
175077
-{sqlite3AddPrimaryKey(pParse,0,yymsp[-1].minor.yy394,yymsp[0].minor.yy394,yymsp[-2].minor.yy394);}
175365
+{sqlite3AddPrimaryKey(pParse,0,yymsp[-1].minor.yy92,yymsp[0].minor.yy92,yymsp[-2].minor.yy92);}
175078175366
break;
175079175367
case 40: /* ccons ::= UNIQUE onconf */
175080
-{sqlite3CreateIndex(pParse,0,0,0,0,yymsp[0].minor.yy394,0,0,0,0,
175368
+{sqlite3CreateIndex(pParse,0,0,0,0,yymsp[0].minor.yy92,0,0,0,0,
175081175369
SQLITE_IDXTYPE_UNIQUE);}
175082175370
break;
175083175371
case 41: /* ccons ::= CHECK LP expr RP */
175084
-{sqlite3AddCheckConstraint(pParse,yymsp[-1].minor.yy528,yymsp[-2].minor.yy0.z,yymsp[0].minor.yy0.z);}
175372
+{sqlite3AddCheckConstraint(pParse,yymsp[-1].minor.yy2,yymsp[-2].minor.yy0.z,yymsp[0].minor.yy0.z);}
175085175373
break;
175086175374
case 42: /* ccons ::= REFERENCES nm eidlist_opt refargs */
175087
-{sqlite3CreateForeignKey(pParse,0,&yymsp[-2].minor.yy0,yymsp[-1].minor.yy322,yymsp[0].minor.yy394);}
175375
+{sqlite3CreateForeignKey(pParse,0,&yymsp[-2].minor.yy0,yymsp[-1].minor.yy402,yymsp[0].minor.yy92);}
175088175376
break;
175089175377
case 43: /* ccons ::= defer_subclause */
175090
-{sqlite3DeferForeignKey(pParse,yymsp[0].minor.yy394);}
175378
+{sqlite3DeferForeignKey(pParse,yymsp[0].minor.yy92);}
175091175379
break;
175092175380
case 44: /* ccons ::= COLLATE ID|STRING */
175093175381
{sqlite3AddCollateType(pParse, &yymsp[0].minor.yy0);}
175094175382
break;
175095175383
case 45: /* generated ::= LP expr RP */
175096
-{sqlite3AddGenerated(pParse,yymsp[-1].minor.yy528,0);}
175384
+{sqlite3AddGenerated(pParse,yymsp[-1].minor.yy2,0);}
175097175385
break;
175098175386
case 46: /* generated ::= LP expr RP ID */
175099
-{sqlite3AddGenerated(pParse,yymsp[-2].minor.yy528,&yymsp[0].minor.yy0);}
175387
+{sqlite3AddGenerated(pParse,yymsp[-2].minor.yy2,&yymsp[0].minor.yy0);}
175100175388
break;
175101175389
case 48: /* autoinc ::= AUTOINCR */
175102
-{yymsp[0].minor.yy394 = 1;}
175390
+{yymsp[0].minor.yy92 = 1;}
175103175391
break;
175104175392
case 49: /* refargs ::= */
175105
-{ yymsp[1].minor.yy394 = OE_None*0x0101; /* EV: R-19803-45884 */}
175393
+{ yymsp[1].minor.yy92 = OE_None*0x0101; /* EV: R-19803-45884 */}
175106175394
break;
175107175395
case 50: /* refargs ::= refargs refarg */
175108
-{ yymsp[-1].minor.yy394 = (yymsp[-1].minor.yy394 & ~yymsp[0].minor.yy231.mask) | yymsp[0].minor.yy231.value; }
175396
+{ yymsp[-1].minor.yy92 = (yymsp[-1].minor.yy92 & ~yymsp[0].minor.yy367.mask) | yymsp[0].minor.yy367.value; }
175109175397
break;
175110175398
case 51: /* refarg ::= MATCH nm */
175111
-{ yymsp[-1].minor.yy231.value = 0; yymsp[-1].minor.yy231.mask = 0x000000; }
175399
+{ yymsp[-1].minor.yy367.value = 0; yymsp[-1].minor.yy367.mask = 0x000000; }
175112175400
break;
175113175401
case 52: /* refarg ::= ON INSERT refact */
175114
-{ yymsp[-2].minor.yy231.value = 0; yymsp[-2].minor.yy231.mask = 0x000000; }
175402
+{ yymsp[-2].minor.yy367.value = 0; yymsp[-2].minor.yy367.mask = 0x000000; }
175115175403
break;
175116175404
case 53: /* refarg ::= ON DELETE refact */
175117
-{ yymsp[-2].minor.yy231.value = yymsp[0].minor.yy394; yymsp[-2].minor.yy231.mask = 0x0000ff; }
175405
+{ yymsp[-2].minor.yy367.value = yymsp[0].minor.yy92; yymsp[-2].minor.yy367.mask = 0x0000ff; }
175118175406
break;
175119175407
case 54: /* refarg ::= ON UPDATE refact */
175120
-{ yymsp[-2].minor.yy231.value = yymsp[0].minor.yy394<<8; yymsp[-2].minor.yy231.mask = 0x00ff00; }
175408
+{ yymsp[-2].minor.yy367.value = yymsp[0].minor.yy92<<8; yymsp[-2].minor.yy367.mask = 0x00ff00; }
175121175409
break;
175122175410
case 55: /* refact ::= SET NULL */
175123
-{ yymsp[-1].minor.yy394 = OE_SetNull; /* EV: R-33326-45252 */}
175411
+{ yymsp[-1].minor.yy92 = OE_SetNull; /* EV: R-33326-45252 */}
175124175412
break;
175125175413
case 56: /* refact ::= SET DEFAULT */
175126
-{ yymsp[-1].minor.yy394 = OE_SetDflt; /* EV: R-33326-45252 */}
175414
+{ yymsp[-1].minor.yy92 = OE_SetDflt; /* EV: R-33326-45252 */}
175127175415
break;
175128175416
case 57: /* refact ::= CASCADE */
175129
-{ yymsp[0].minor.yy394 = OE_Cascade; /* EV: R-33326-45252 */}
175417
+{ yymsp[0].minor.yy92 = OE_Cascade; /* EV: R-33326-45252 */}
175130175418
break;
175131175419
case 58: /* refact ::= RESTRICT */
175132
-{ yymsp[0].minor.yy394 = OE_Restrict; /* EV: R-33326-45252 */}
175420
+{ yymsp[0].minor.yy92 = OE_Restrict; /* EV: R-33326-45252 */}
175133175421
break;
175134175422
case 59: /* refact ::= NO ACTION */
175135
-{ yymsp[-1].minor.yy394 = OE_None; /* EV: R-33326-45252 */}
175423
+{ yymsp[-1].minor.yy92 = OE_None; /* EV: R-33326-45252 */}
175136175424
break;
175137175425
case 60: /* defer_subclause ::= NOT DEFERRABLE init_deferred_pred_opt */
175138
-{yymsp[-2].minor.yy394 = 0;}
175426
+{yymsp[-2].minor.yy92 = 0;}
175139175427
break;
175140175428
case 61: /* defer_subclause ::= DEFERRABLE init_deferred_pred_opt */
175141175429
case 76: /* orconf ::= OR resolvetype */ yytestcase(yyruleno==76);
175142175430
case 171: /* insert_cmd ::= INSERT orconf */ yytestcase(yyruleno==171);
175143
-{yymsp[-1].minor.yy394 = yymsp[0].minor.yy394;}
175431
+{yymsp[-1].minor.yy92 = yymsp[0].minor.yy92;}
175144175432
break;
175145175433
case 63: /* init_deferred_pred_opt ::= INITIALLY DEFERRED */
175146175434
case 80: /* ifexists ::= IF EXISTS */ yytestcase(yyruleno==80);
175147175435
case 217: /* between_op ::= NOT BETWEEN */ yytestcase(yyruleno==217);
175148175436
case 220: /* in_op ::= NOT IN */ yytestcase(yyruleno==220);
175149175437
case 245: /* collate ::= COLLATE ID|STRING */ yytestcase(yyruleno==245);
175150
-{yymsp[-1].minor.yy394 = 1;}
175438
+{yymsp[-1].minor.yy92 = 1;}
175151175439
break;
175152175440
case 64: /* init_deferred_pred_opt ::= INITIALLY IMMEDIATE */
175153
-{yymsp[-1].minor.yy394 = 0;}
175441
+{yymsp[-1].minor.yy92 = 0;}
175154175442
break;
175155175443
case 66: /* tconscomma ::= COMMA */
175156175444
{pParse->constraintName.n = 0;}
175157175445
break;
175158175446
case 68: /* tcons ::= PRIMARY KEY LP sortlist autoinc RP onconf */
175159
-{sqlite3AddPrimaryKey(pParse,yymsp[-3].minor.yy322,yymsp[0].minor.yy394,yymsp[-2].minor.yy394,0);}
175447
+{sqlite3AddPrimaryKey(pParse,yymsp[-3].minor.yy402,yymsp[0].minor.yy92,yymsp[-2].minor.yy92,0);}
175160175448
break;
175161175449
case 69: /* tcons ::= UNIQUE LP sortlist RP onconf */
175162
-{sqlite3CreateIndex(pParse,0,0,0,yymsp[-2].minor.yy322,yymsp[0].minor.yy394,0,0,0,0,
175450
+{sqlite3CreateIndex(pParse,0,0,0,yymsp[-2].minor.yy402,yymsp[0].minor.yy92,0,0,0,0,
175163175451
SQLITE_IDXTYPE_UNIQUE);}
175164175452
break;
175165175453
case 70: /* tcons ::= CHECK LP expr RP onconf */
175166
-{sqlite3AddCheckConstraint(pParse,yymsp[-2].minor.yy528,yymsp[-3].minor.yy0.z,yymsp[-1].minor.yy0.z);}
175454
+{sqlite3AddCheckConstraint(pParse,yymsp[-2].minor.yy2,yymsp[-3].minor.yy0.z,yymsp[-1].minor.yy0.z);}
175167175455
break;
175168175456
case 71: /* tcons ::= FOREIGN KEY LP eidlist RP REFERENCES nm eidlist_opt refargs defer_subclause_opt */
175169175457
{
175170
- sqlite3CreateForeignKey(pParse, yymsp[-6].minor.yy322, &yymsp[-3].minor.yy0, yymsp[-2].minor.yy322, yymsp[-1].minor.yy394);
175171
- sqlite3DeferForeignKey(pParse, yymsp[0].minor.yy394);
175458
+ sqlite3CreateForeignKey(pParse, yymsp[-6].minor.yy402, &yymsp[-3].minor.yy0, yymsp[-2].minor.yy402, yymsp[-1].minor.yy92);
175459
+ sqlite3DeferForeignKey(pParse, yymsp[0].minor.yy92);
175172175460
}
175173175461
break;
175174175462
case 73: /* onconf ::= */
175175175463
case 75: /* orconf ::= */ yytestcase(yyruleno==75);
175176
-{yymsp[1].minor.yy394 = OE_Default;}
175464
+{yymsp[1].minor.yy92 = OE_Default;}
175177175465
break;
175178175466
case 74: /* onconf ::= ON CONFLICT resolvetype */
175179
-{yymsp[-2].minor.yy394 = yymsp[0].minor.yy394;}
175467
+{yymsp[-2].minor.yy92 = yymsp[0].minor.yy92;}
175180175468
break;
175181175469
case 77: /* resolvetype ::= IGNORE */
175182
-{yymsp[0].minor.yy394 = OE_Ignore;}
175470
+{yymsp[0].minor.yy92 = OE_Ignore;}
175183175471
break;
175184175472
case 78: /* resolvetype ::= REPLACE */
175185175473
case 172: /* insert_cmd ::= REPLACE */ yytestcase(yyruleno==172);
175186
-{yymsp[0].minor.yy394 = OE_Replace;}
175474
+{yymsp[0].minor.yy92 = OE_Replace;}
175187175475
break;
175188175476
case 79: /* cmd ::= DROP TABLE ifexists fullname */
175189175477
{
175190
- sqlite3DropTable(pParse, yymsp[0].minor.yy131, 0, yymsp[-1].minor.yy394);
175478
+ sqlite3DropTable(pParse, yymsp[0].minor.yy387, 0, yymsp[-1].minor.yy92);
175191175479
}
175192175480
break;
175193175481
case 82: /* cmd ::= createkw temp VIEW ifnotexists nm dbnm eidlist_opt AS select */
175194175482
{
175195
- sqlite3CreateView(pParse, &yymsp[-8].minor.yy0, &yymsp[-4].minor.yy0, &yymsp[-3].minor.yy0, yymsp[-2].minor.yy322, yymsp[0].minor.yy47, yymsp[-7].minor.yy394, yymsp[-5].minor.yy394);
175483
+ sqlite3CreateView(pParse, &yymsp[-8].minor.yy0, &yymsp[-4].minor.yy0, &yymsp[-3].minor.yy0, yymsp[-2].minor.yy402, yymsp[0].minor.yy299, yymsp[-7].minor.yy92, yymsp[-5].minor.yy92);
175196175484
}
175197175485
break;
175198175486
case 83: /* cmd ::= DROP VIEW ifexists fullname */
175199175487
{
175200
- sqlite3DropTable(pParse, yymsp[0].minor.yy131, 1, yymsp[-1].minor.yy394);
175488
+ sqlite3DropTable(pParse, yymsp[0].minor.yy387, 1, yymsp[-1].minor.yy92);
175201175489
}
175202175490
break;
175203175491
case 84: /* cmd ::= select */
175204175492
{
175205175493
SelectDest dest = {SRT_Output, 0, 0, 0, 0, 0, 0};
175206
- sqlite3Select(pParse, yymsp[0].minor.yy47, &dest);
175207
- sqlite3SelectDelete(pParse->db, yymsp[0].minor.yy47);
175494
+ sqlite3Select(pParse, yymsp[0].minor.yy299, &dest);
175495
+ sqlite3SelectDelete(pParse->db, yymsp[0].minor.yy299);
175208175496
}
175209175497
break;
175210175498
case 85: /* select ::= WITH wqlist selectnowith */
175211
-{yymsp[-2].minor.yy47 = attachWithToSelect(pParse,yymsp[0].minor.yy47,yymsp[-1].minor.yy521);}
175499
+{yymsp[-2].minor.yy299 = attachWithToSelect(pParse,yymsp[0].minor.yy299,yymsp[-1].minor.yy131);}
175212175500
break;
175213175501
case 86: /* select ::= WITH RECURSIVE wqlist selectnowith */
175214
-{yymsp[-3].minor.yy47 = attachWithToSelect(pParse,yymsp[0].minor.yy47,yymsp[-1].minor.yy521);}
175502
+{yymsp[-3].minor.yy299 = attachWithToSelect(pParse,yymsp[0].minor.yy299,yymsp[-1].minor.yy131);}
175215175503
break;
175216175504
case 87: /* select ::= selectnowith */
175217175505
{
175218
- Select *p = yymsp[0].minor.yy47;
175506
+ Select *p = yymsp[0].minor.yy299;
175219175507
if( p ){
175220175508
parserDoubleLinkSelect(pParse, p);
175221175509
}
175222175510
}
175223175511
break;
175224175512
case 88: /* selectnowith ::= selectnowith multiselect_op oneselect */
175225175513
{
175226
- Select *pRhs = yymsp[0].minor.yy47;
175227
- Select *pLhs = yymsp[-2].minor.yy47;
175514
+ Select *pRhs = yymsp[0].minor.yy299;
175515
+ Select *pLhs = yymsp[-2].minor.yy299;
175228175516
if( pRhs && pRhs->pPrior ){
175229175517
SrcList *pFrom;
175230175518
Token x;
175231175519
x.n = 0;
175232175520
parserDoubleLinkSelect(pParse, pRhs);
175233175521
pFrom = sqlite3SrcListAppendFromTerm(pParse,0,0,0,&x,pRhs,0);
175234175522
pRhs = sqlite3SelectNew(pParse,0,pFrom,0,0,0,0,0,0);
175235175523
}
175236175524
if( pRhs ){
175237
- pRhs->op = (u8)yymsp[-1].minor.yy394;
175525
+ pRhs->op = (u8)yymsp[-1].minor.yy92;
175238175526
pRhs->pPrior = pLhs;
175239175527
if( ALWAYS(pLhs) ) pLhs->selFlags &= ~SF_MultiValue;
175240175528
pRhs->selFlags &= ~SF_MultiValue;
175241
- if( yymsp[-1].minor.yy394!=TK_ALL ) pParse->hasCompound = 1;
175529
+ if( yymsp[-1].minor.yy92!=TK_ALL ) pParse->hasCompound = 1;
175242175530
}else{
175243175531
sqlite3SelectDelete(pParse->db, pLhs);
175244175532
}
175245
- yymsp[-2].minor.yy47 = pRhs;
175533
+ yymsp[-2].minor.yy299 = pRhs;
175246175534
}
175247175535
break;
175248175536
case 89: /* multiselect_op ::= UNION */
175249175537
case 91: /* multiselect_op ::= EXCEPT|INTERSECT */ yytestcase(yyruleno==91);
175250
-{yymsp[0].minor.yy394 = yymsp[0].major; /*A-overwrites-OP*/}
175538
+{yymsp[0].minor.yy92 = yymsp[0].major; /*A-overwrites-OP*/}
175251175539
break;
175252175540
case 90: /* multiselect_op ::= UNION ALL */
175253
-{yymsp[-1].minor.yy394 = TK_ALL;}
175541
+{yymsp[-1].minor.yy92 = TK_ALL;}
175254175542
break;
175255175543
case 92: /* oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt orderby_opt limit_opt */
175256175544
{
175257
- yymsp[-8].minor.yy47 = sqlite3SelectNew(pParse,yymsp[-6].minor.yy322,yymsp[-5].minor.yy131,yymsp[-4].minor.yy528,yymsp[-3].minor.yy322,yymsp[-2].minor.yy528,yymsp[-1].minor.yy322,yymsp[-7].minor.yy394,yymsp[0].minor.yy528);
175545
+ yymsp[-8].minor.yy299 = sqlite3SelectNew(pParse,yymsp[-6].minor.yy402,yymsp[-5].minor.yy387,yymsp[-4].minor.yy2,yymsp[-3].minor.yy402,yymsp[-2].minor.yy2,yymsp[-1].minor.yy402,yymsp[-7].minor.yy92,yymsp[0].minor.yy2);
175258175546
}
175259175547
break;
175260175548
case 93: /* oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt window_clause orderby_opt limit_opt */
175261175549
{
175262
- yymsp[-9].minor.yy47 = sqlite3SelectNew(pParse,yymsp[-7].minor.yy322,yymsp[-6].minor.yy131,yymsp[-5].minor.yy528,yymsp[-4].minor.yy322,yymsp[-3].minor.yy528,yymsp[-1].minor.yy322,yymsp[-8].minor.yy394,yymsp[0].minor.yy528);
175263
- if( yymsp[-9].minor.yy47 ){
175264
- yymsp[-9].minor.yy47->pWinDefn = yymsp[-2].minor.yy41;
175550
+ yymsp[-9].minor.yy299 = sqlite3SelectNew(pParse,yymsp[-7].minor.yy402,yymsp[-6].minor.yy387,yymsp[-5].minor.yy2,yymsp[-4].minor.yy402,yymsp[-3].minor.yy2,yymsp[-1].minor.yy402,yymsp[-8].minor.yy92,yymsp[0].minor.yy2);
175551
+ if( yymsp[-9].minor.yy299 ){
175552
+ yymsp[-9].minor.yy299->pWinDefn = yymsp[-2].minor.yy3;
175265175553
}else{
175266
- sqlite3WindowListDelete(pParse->db, yymsp[-2].minor.yy41);
175554
+ sqlite3WindowListDelete(pParse->db, yymsp[-2].minor.yy3);
175267175555
}
175268175556
}
175269175557
break;
175270175558
case 94: /* values ::= VALUES LP nexprlist RP */
175271175559
{
175272
- yymsp[-3].minor.yy47 = sqlite3SelectNew(pParse,yymsp[-1].minor.yy322,0,0,0,0,0,SF_Values,0);
175560
+ yymsp[-3].minor.yy299 = sqlite3SelectNew(pParse,yymsp[-1].minor.yy402,0,0,0,0,0,SF_Values,0);
175273175561
}
175274175562
break;
175275175563
case 95: /* values ::= values COMMA LP nexprlist RP */
175276175564
{
175277
- Select *pRight, *pLeft = yymsp[-4].minor.yy47;
175278
- pRight = sqlite3SelectNew(pParse,yymsp[-1].minor.yy322,0,0,0,0,0,SF_Values|SF_MultiValue,0);
175565
+ Select *pRight, *pLeft = yymsp[-4].minor.yy299;
175566
+ pRight = sqlite3SelectNew(pParse,yymsp[-1].minor.yy402,0,0,0,0,0,SF_Values|SF_MultiValue,0);
175279175567
if( ALWAYS(pLeft) ) pLeft->selFlags &= ~SF_MultiValue;
175280175568
if( pRight ){
175281175569
pRight->op = TK_ALL;
175282175570
pRight->pPrior = pLeft;
175283
- yymsp[-4].minor.yy47 = pRight;
175571
+ yymsp[-4].minor.yy299 = pRight;
175284175572
}else{
175285
- yymsp[-4].minor.yy47 = pLeft;
175573
+ yymsp[-4].minor.yy299 = pLeft;
175286175574
}
175287175575
}
175288175576
break;
175289175577
case 96: /* distinct ::= DISTINCT */
175290
-{yymsp[0].minor.yy394 = SF_Distinct;}
175578
+{yymsp[0].minor.yy92 = SF_Distinct;}
175291175579
break;
175292175580
case 97: /* distinct ::= ALL */
175293
-{yymsp[0].minor.yy394 = SF_All;}
175581
+{yymsp[0].minor.yy92 = SF_All;}
175294175582
break;
175295175583
case 99: /* sclp ::= */
175296175584
case 132: /* orderby_opt ::= */ yytestcase(yyruleno==132);
175297175585
case 142: /* groupby_opt ::= */ yytestcase(yyruleno==142);
175298175586
case 232: /* exprlist ::= */ yytestcase(yyruleno==232);
175299175587
case 235: /* paren_exprlist ::= */ yytestcase(yyruleno==235);
175300175588
case 240: /* eidlist_opt ::= */ yytestcase(yyruleno==240);
175301
-{yymsp[1].minor.yy322 = 0;}
175589
+{yymsp[1].minor.yy402 = 0;}
175302175590
break;
175303175591
case 100: /* selcollist ::= sclp scanpt expr scanpt as */
175304175592
{
175305
- yymsp[-4].minor.yy322 = sqlite3ExprListAppend(pParse, yymsp[-4].minor.yy322, yymsp[-2].minor.yy528);
175306
- if( yymsp[0].minor.yy0.n>0 ) sqlite3ExprListSetName(pParse, yymsp[-4].minor.yy322, &yymsp[0].minor.yy0, 1);
175307
- sqlite3ExprListSetSpan(pParse,yymsp[-4].minor.yy322,yymsp[-3].minor.yy522,yymsp[-1].minor.yy522);
175593
+ yymsp[-4].minor.yy402 = sqlite3ExprListAppend(pParse, yymsp[-4].minor.yy402, yymsp[-2].minor.yy2);
175594
+ if( yymsp[0].minor.yy0.n>0 ) sqlite3ExprListSetName(pParse, yymsp[-4].minor.yy402, &yymsp[0].minor.yy0, 1);
175595
+ sqlite3ExprListSetSpan(pParse,yymsp[-4].minor.yy402,yymsp[-3].minor.yy616,yymsp[-1].minor.yy616);
175308175596
}
175309175597
break;
175310175598
case 101: /* selcollist ::= sclp scanpt STAR */
175311175599
{
175312175600
Expr *p = sqlite3Expr(pParse->db, TK_ASTERISK, 0);
175313175601
sqlite3ExprSetErrorOffset(p, (int)(yymsp[0].minor.yy0.z - pParse->zTail));
175314
- yymsp[-2].minor.yy322 = sqlite3ExprListAppend(pParse, yymsp[-2].minor.yy322, p);
175602
+ yymsp[-2].minor.yy402 = sqlite3ExprListAppend(pParse, yymsp[-2].minor.yy402, p);
175315175603
}
175316175604
break;
175317175605
case 102: /* selcollist ::= sclp scanpt nm DOT STAR */
175318175606
{
175319175607
Expr *pRight, *pLeft, *pDot;
175320175608
pRight = sqlite3PExpr(pParse, TK_ASTERISK, 0, 0);
175321175609
sqlite3ExprSetErrorOffset(pRight, (int)(yymsp[0].minor.yy0.z - pParse->zTail));
175322175610
pLeft = tokenExpr(pParse, TK_ID, yymsp[-2].minor.yy0);
175323175611
pDot = sqlite3PExpr(pParse, TK_DOT, pLeft, pRight);
175324
- yymsp[-4].minor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy322, pDot);
175612
+ yymsp[-4].minor.yy402 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy402, pDot);
175325175613
}
175326175614
break;
175327175615
case 103: /* as ::= AS nm */
175328175616
case 115: /* dbnm ::= DOT nm */ yytestcase(yyruleno==115);
175329175617
case 256: /* plus_num ::= PLUS INTEGER|FLOAT */ yytestcase(yyruleno==256);
@@ -175330,54 +175618,54 @@
175330175618
case 257: /* minus_num ::= MINUS INTEGER|FLOAT */ yytestcase(yyruleno==257);
175331175619
{yymsp[-1].minor.yy0 = yymsp[0].minor.yy0;}
175332175620
break;
175333175621
case 105: /* from ::= */
175334175622
case 108: /* stl_prefix ::= */ yytestcase(yyruleno==108);
175335
-{yymsp[1].minor.yy131 = 0;}
175623
+{yymsp[1].minor.yy387 = 0;}
175336175624
break;
175337175625
case 106: /* from ::= FROM seltablist */
175338175626
{
175339
- yymsp[-1].minor.yy131 = yymsp[0].minor.yy131;
175340
- sqlite3SrcListShiftJoinType(pParse,yymsp[-1].minor.yy131);
175627
+ yymsp[-1].minor.yy387 = yymsp[0].minor.yy387;
175628
+ sqlite3SrcListShiftJoinType(pParse,yymsp[-1].minor.yy387);
175341175629
}
175342175630
break;
175343175631
case 107: /* stl_prefix ::= seltablist joinop */
175344175632
{
175345
- if( ALWAYS(yymsp[-1].minor.yy131 && yymsp[-1].minor.yy131->nSrc>0) ) yymsp[-1].minor.yy131->a[yymsp[-1].minor.yy131->nSrc-1].fg.jointype = (u8)yymsp[0].minor.yy394;
175633
+ if( ALWAYS(yymsp[-1].minor.yy387 && yymsp[-1].minor.yy387->nSrc>0) ) yymsp[-1].minor.yy387->a[yymsp[-1].minor.yy387->nSrc-1].fg.jointype = (u8)yymsp[0].minor.yy92;
175346175634
}
175347175635
break;
175348175636
case 109: /* seltablist ::= stl_prefix nm dbnm as on_using */
175349175637
{
175350
- yymsp[-4].minor.yy131 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-4].minor.yy131,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0,0,&yymsp[0].minor.yy561);
175638
+ yymsp[-4].minor.yy387 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-4].minor.yy387,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0,0,&yymsp[0].minor.yy305);
175351175639
}
175352175640
break;
175353175641
case 110: /* seltablist ::= stl_prefix nm dbnm as indexed_by on_using */
175354175642
{
175355
- yymsp[-5].minor.yy131 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-5].minor.yy131,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,0,&yymsp[0].minor.yy561);
175356
- sqlite3SrcListIndexedBy(pParse, yymsp[-5].minor.yy131, &yymsp[-1].minor.yy0);
175643
+ yymsp[-5].minor.yy387 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-5].minor.yy387,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,0,&yymsp[0].minor.yy305);
175644
+ sqlite3SrcListIndexedBy(pParse, yymsp[-5].minor.yy387, &yymsp[-1].minor.yy0);
175357175645
}
175358175646
break;
175359175647
case 111: /* seltablist ::= stl_prefix nm dbnm LP exprlist RP as on_using */
175360175648
{
175361
- yymsp[-7].minor.yy131 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-7].minor.yy131,&yymsp[-6].minor.yy0,&yymsp[-5].minor.yy0,&yymsp[-1].minor.yy0,0,&yymsp[0].minor.yy561);
175362
- sqlite3SrcListFuncArgs(pParse, yymsp[-7].minor.yy131, yymsp[-3].minor.yy322);
175649
+ yymsp[-7].minor.yy387 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-7].minor.yy387,&yymsp[-6].minor.yy0,&yymsp[-5].minor.yy0,&yymsp[-1].minor.yy0,0,&yymsp[0].minor.yy305);
175650
+ sqlite3SrcListFuncArgs(pParse, yymsp[-7].minor.yy387, yymsp[-3].minor.yy402);
175363175651
}
175364175652
break;
175365175653
case 112: /* seltablist ::= stl_prefix LP select RP as on_using */
175366175654
{
175367
- yymsp[-5].minor.yy131 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-5].minor.yy131,0,0,&yymsp[-1].minor.yy0,yymsp[-3].minor.yy47,&yymsp[0].minor.yy561);
175655
+ yymsp[-5].minor.yy387 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-5].minor.yy387,0,0,&yymsp[-1].minor.yy0,yymsp[-3].minor.yy299,&yymsp[0].minor.yy305);
175368175656
}
175369175657
break;
175370175658
case 113: /* seltablist ::= stl_prefix LP seltablist RP as on_using */
175371175659
{
175372
- if( yymsp[-5].minor.yy131==0 && yymsp[-1].minor.yy0.n==0 && yymsp[0].minor.yy561.pOn==0 && yymsp[0].minor.yy561.pUsing==0 ){
175373
- yymsp[-5].minor.yy131 = yymsp[-3].minor.yy131;
175374
- }else if( ALWAYS(yymsp[-3].minor.yy131!=0) && yymsp[-3].minor.yy131->nSrc==1 ){
175375
- yymsp[-5].minor.yy131 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-5].minor.yy131,0,0,&yymsp[-1].minor.yy0,0,&yymsp[0].minor.yy561);
175376
- if( yymsp[-5].minor.yy131 ){
175377
- SrcItem *pNew = &yymsp[-5].minor.yy131->a[yymsp[-5].minor.yy131->nSrc-1];
175378
- SrcItem *pOld = yymsp[-3].minor.yy131->a;
175660
+ if( yymsp[-5].minor.yy387==0 && yymsp[-1].minor.yy0.n==0 && yymsp[0].minor.yy305.pOn==0 && yymsp[0].minor.yy305.pUsing==0 ){
175661
+ yymsp[-5].minor.yy387 = yymsp[-3].minor.yy387;
175662
+ }else if( ALWAYS(yymsp[-3].minor.yy387!=0) && yymsp[-3].minor.yy387->nSrc==1 ){
175663
+ yymsp[-5].minor.yy387 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-5].minor.yy387,0,0,&yymsp[-1].minor.yy0,0,&yymsp[0].minor.yy305);
175664
+ if( yymsp[-5].minor.yy387 ){
175665
+ SrcItem *pNew = &yymsp[-5].minor.yy387->a[yymsp[-5].minor.yy387->nSrc-1];
175666
+ SrcItem *pOld = yymsp[-3].minor.yy387->a;
175379175667
pNew->zName = pOld->zName;
175380175668
pNew->zDatabase = pOld->zDatabase;
175381175669
pNew->pSelect = pOld->pSelect;
175382175670
if( pNew->pSelect && (pNew->pSelect->selFlags & SF_NestedFrom)!=0 ){
175383175671
pNew->fg.isNestedFrom = 1;
@@ -175389,249 +175677,249 @@
175389175677
pNew->fg.isTabFunc = 1;
175390175678
}
175391175679
pOld->zName = pOld->zDatabase = 0;
175392175680
pOld->pSelect = 0;
175393175681
}
175394
- sqlite3SrcListDelete(pParse->db, yymsp[-3].minor.yy131);
175682
+ sqlite3SrcListDelete(pParse->db, yymsp[-3].minor.yy387);
175395175683
}else{
175396175684
Select *pSubquery;
175397
- sqlite3SrcListShiftJoinType(pParse,yymsp[-3].minor.yy131);
175398
- pSubquery = sqlite3SelectNew(pParse,0,yymsp[-3].minor.yy131,0,0,0,0,SF_NestedFrom,0);
175399
- yymsp[-5].minor.yy131 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-5].minor.yy131,0,0,&yymsp[-1].minor.yy0,pSubquery,&yymsp[0].minor.yy561);
175685
+ sqlite3SrcListShiftJoinType(pParse,yymsp[-3].minor.yy387);
175686
+ pSubquery = sqlite3SelectNew(pParse,0,yymsp[-3].minor.yy387,0,0,0,0,SF_NestedFrom,0);
175687
+ yymsp[-5].minor.yy387 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-5].minor.yy387,0,0,&yymsp[-1].minor.yy0,pSubquery,&yymsp[0].minor.yy305);
175400175688
}
175401175689
}
175402175690
break;
175403175691
case 114: /* dbnm ::= */
175404175692
case 129: /* indexed_opt ::= */ yytestcase(yyruleno==129);
175405175693
{yymsp[1].minor.yy0.z=0; yymsp[1].minor.yy0.n=0;}
175406175694
break;
175407175695
case 116: /* fullname ::= nm */
175408175696
{
175409
- yylhsminor.yy131 = sqlite3SrcListAppend(pParse,0,&yymsp[0].minor.yy0,0);
175410
- if( IN_RENAME_OBJECT && yylhsminor.yy131 ) sqlite3RenameTokenMap(pParse, yylhsminor.yy131->a[0].zName, &yymsp[0].minor.yy0);
175697
+ yylhsminor.yy387 = sqlite3SrcListAppend(pParse,0,&yymsp[0].minor.yy0,0);
175698
+ if( IN_RENAME_OBJECT && yylhsminor.yy387 ) sqlite3RenameTokenMap(pParse, yylhsminor.yy387->a[0].zName, &yymsp[0].minor.yy0);
175411175699
}
175412
- yymsp[0].minor.yy131 = yylhsminor.yy131;
175700
+ yymsp[0].minor.yy387 = yylhsminor.yy387;
175413175701
break;
175414175702
case 117: /* fullname ::= nm DOT nm */
175415175703
{
175416
- yylhsminor.yy131 = sqlite3SrcListAppend(pParse,0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0);
175417
- if( IN_RENAME_OBJECT && yylhsminor.yy131 ) sqlite3RenameTokenMap(pParse, yylhsminor.yy131->a[0].zName, &yymsp[0].minor.yy0);
175704
+ yylhsminor.yy387 = sqlite3SrcListAppend(pParse,0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0);
175705
+ if( IN_RENAME_OBJECT && yylhsminor.yy387 ) sqlite3RenameTokenMap(pParse, yylhsminor.yy387->a[0].zName, &yymsp[0].minor.yy0);
175418175706
}
175419
- yymsp[-2].minor.yy131 = yylhsminor.yy131;
175707
+ yymsp[-2].minor.yy387 = yylhsminor.yy387;
175420175708
break;
175421175709
case 118: /* xfullname ::= nm */
175422
-{yymsp[0].minor.yy131 = sqlite3SrcListAppend(pParse,0,&yymsp[0].minor.yy0,0); /*A-overwrites-X*/}
175710
+{yymsp[0].minor.yy387 = sqlite3SrcListAppend(pParse,0,&yymsp[0].minor.yy0,0); /*A-overwrites-X*/}
175423175711
break;
175424175712
case 119: /* xfullname ::= nm DOT nm */
175425
-{yymsp[-2].minor.yy131 = sqlite3SrcListAppend(pParse,0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0); /*A-overwrites-X*/}
175713
+{yymsp[-2].minor.yy387 = sqlite3SrcListAppend(pParse,0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0); /*A-overwrites-X*/}
175426175714
break;
175427175715
case 120: /* xfullname ::= nm DOT nm AS nm */
175428175716
{
175429
- yymsp[-4].minor.yy131 = sqlite3SrcListAppend(pParse,0,&yymsp[-4].minor.yy0,&yymsp[-2].minor.yy0); /*A-overwrites-X*/
175430
- if( yymsp[-4].minor.yy131 ) yymsp[-4].minor.yy131->a[0].zAlias = sqlite3NameFromToken(pParse->db, &yymsp[0].minor.yy0);
175717
+ yymsp[-4].minor.yy387 = sqlite3SrcListAppend(pParse,0,&yymsp[-4].minor.yy0,&yymsp[-2].minor.yy0); /*A-overwrites-X*/
175718
+ if( yymsp[-4].minor.yy387 ) yymsp[-4].minor.yy387->a[0].zAlias = sqlite3NameFromToken(pParse->db, &yymsp[0].minor.yy0);
175431175719
}
175432175720
break;
175433175721
case 121: /* xfullname ::= nm AS nm */
175434175722
{
175435
- yymsp[-2].minor.yy131 = sqlite3SrcListAppend(pParse,0,&yymsp[-2].minor.yy0,0); /*A-overwrites-X*/
175436
- if( yymsp[-2].minor.yy131 ) yymsp[-2].minor.yy131->a[0].zAlias = sqlite3NameFromToken(pParse->db, &yymsp[0].minor.yy0);
175723
+ yymsp[-2].minor.yy387 = sqlite3SrcListAppend(pParse,0,&yymsp[-2].minor.yy0,0); /*A-overwrites-X*/
175724
+ if( yymsp[-2].minor.yy387 ) yymsp[-2].minor.yy387->a[0].zAlias = sqlite3NameFromToken(pParse->db, &yymsp[0].minor.yy0);
175437175725
}
175438175726
break;
175439175727
case 122: /* joinop ::= COMMA|JOIN */
175440
-{ yymsp[0].minor.yy394 = JT_INNER; }
175728
+{ yymsp[0].minor.yy92 = JT_INNER; }
175441175729
break;
175442175730
case 123: /* joinop ::= JOIN_KW JOIN */
175443
-{yymsp[-1].minor.yy394 = sqlite3JoinType(pParse,&yymsp[-1].minor.yy0,0,0); /*X-overwrites-A*/}
175731
+{yymsp[-1].minor.yy92 = sqlite3JoinType(pParse,&yymsp[-1].minor.yy0,0,0); /*X-overwrites-A*/}
175444175732
break;
175445175733
case 124: /* joinop ::= JOIN_KW nm JOIN */
175446
-{yymsp[-2].minor.yy394 = sqlite3JoinType(pParse,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0,0); /*X-overwrites-A*/}
175734
+{yymsp[-2].minor.yy92 = sqlite3JoinType(pParse,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0,0); /*X-overwrites-A*/}
175447175735
break;
175448175736
case 125: /* joinop ::= JOIN_KW nm nm JOIN */
175449
-{yymsp[-3].minor.yy394 = sqlite3JoinType(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0);/*X-overwrites-A*/}
175737
+{yymsp[-3].minor.yy92 = sqlite3JoinType(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0);/*X-overwrites-A*/}
175450175738
break;
175451175739
case 126: /* on_using ::= ON expr */
175452
-{yymsp[-1].minor.yy561.pOn = yymsp[0].minor.yy528; yymsp[-1].minor.yy561.pUsing = 0;}
175740
+{yymsp[-1].minor.yy305.pOn = yymsp[0].minor.yy2; yymsp[-1].minor.yy305.pUsing = 0;}
175453175741
break;
175454175742
case 127: /* on_using ::= USING LP idlist RP */
175455
-{yymsp[-3].minor.yy561.pOn = 0; yymsp[-3].minor.yy561.pUsing = yymsp[-1].minor.yy254;}
175743
+{yymsp[-3].minor.yy305.pOn = 0; yymsp[-3].minor.yy305.pUsing = yymsp[-1].minor.yy400;}
175456175744
break;
175457175745
case 128: /* on_using ::= */
175458
-{yymsp[1].minor.yy561.pOn = 0; yymsp[1].minor.yy561.pUsing = 0;}
175746
+{yymsp[1].minor.yy305.pOn = 0; yymsp[1].minor.yy305.pUsing = 0;}
175459175747
break;
175460175748
case 130: /* indexed_by ::= INDEXED BY nm */
175461175749
{yymsp[-2].minor.yy0 = yymsp[0].minor.yy0;}
175462175750
break;
175463175751
case 131: /* indexed_by ::= NOT INDEXED */
175464175752
{yymsp[-1].minor.yy0.z=0; yymsp[-1].minor.yy0.n=1;}
175465175753
break;
175466175754
case 133: /* orderby_opt ::= ORDER BY sortlist */
175467175755
case 143: /* groupby_opt ::= GROUP BY nexprlist */ yytestcase(yyruleno==143);
175468
-{yymsp[-2].minor.yy322 = yymsp[0].minor.yy322;}
175756
+{yymsp[-2].minor.yy402 = yymsp[0].minor.yy402;}
175469175757
break;
175470175758
case 134: /* sortlist ::= sortlist COMMA expr sortorder nulls */
175471175759
{
175472
- yymsp[-4].minor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy322,yymsp[-2].minor.yy528);
175473
- sqlite3ExprListSetSortOrder(yymsp[-4].minor.yy322,yymsp[-1].minor.yy394,yymsp[0].minor.yy394);
175760
+ yymsp[-4].minor.yy402 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy402,yymsp[-2].minor.yy2);
175761
+ sqlite3ExprListSetSortOrder(yymsp[-4].minor.yy402,yymsp[-1].minor.yy92,yymsp[0].minor.yy92);
175474175762
}
175475175763
break;
175476175764
case 135: /* sortlist ::= expr sortorder nulls */
175477175765
{
175478
- yymsp[-2].minor.yy322 = sqlite3ExprListAppend(pParse,0,yymsp[-2].minor.yy528); /*A-overwrites-Y*/
175479
- sqlite3ExprListSetSortOrder(yymsp[-2].minor.yy322,yymsp[-1].minor.yy394,yymsp[0].minor.yy394);
175766
+ yymsp[-2].minor.yy402 = sqlite3ExprListAppend(pParse,0,yymsp[-2].minor.yy2); /*A-overwrites-Y*/
175767
+ sqlite3ExprListSetSortOrder(yymsp[-2].minor.yy402,yymsp[-1].minor.yy92,yymsp[0].minor.yy92);
175480175768
}
175481175769
break;
175482175770
case 136: /* sortorder ::= ASC */
175483
-{yymsp[0].minor.yy394 = SQLITE_SO_ASC;}
175771
+{yymsp[0].minor.yy92 = SQLITE_SO_ASC;}
175484175772
break;
175485175773
case 137: /* sortorder ::= DESC */
175486
-{yymsp[0].minor.yy394 = SQLITE_SO_DESC;}
175774
+{yymsp[0].minor.yy92 = SQLITE_SO_DESC;}
175487175775
break;
175488175776
case 138: /* sortorder ::= */
175489175777
case 141: /* nulls ::= */ yytestcase(yyruleno==141);
175490
-{yymsp[1].minor.yy394 = SQLITE_SO_UNDEFINED;}
175778
+{yymsp[1].minor.yy92 = SQLITE_SO_UNDEFINED;}
175491175779
break;
175492175780
case 139: /* nulls ::= NULLS FIRST */
175493
-{yymsp[-1].minor.yy394 = SQLITE_SO_ASC;}
175781
+{yymsp[-1].minor.yy92 = SQLITE_SO_ASC;}
175494175782
break;
175495175783
case 140: /* nulls ::= NULLS LAST */
175496
-{yymsp[-1].minor.yy394 = SQLITE_SO_DESC;}
175784
+{yymsp[-1].minor.yy92 = SQLITE_SO_DESC;}
175497175785
break;
175498175786
case 144: /* having_opt ::= */
175499175787
case 146: /* limit_opt ::= */ yytestcase(yyruleno==146);
175500175788
case 151: /* where_opt ::= */ yytestcase(yyruleno==151);
175501175789
case 153: /* where_opt_ret ::= */ yytestcase(yyruleno==153);
175502175790
case 230: /* case_else ::= */ yytestcase(yyruleno==230);
175503175791
case 231: /* case_operand ::= */ yytestcase(yyruleno==231);
175504175792
case 250: /* vinto ::= */ yytestcase(yyruleno==250);
175505
-{yymsp[1].minor.yy528 = 0;}
175793
+{yymsp[1].minor.yy2 = 0;}
175506175794
break;
175507175795
case 145: /* having_opt ::= HAVING expr */
175508175796
case 152: /* where_opt ::= WHERE expr */ yytestcase(yyruleno==152);
175509175797
case 154: /* where_opt_ret ::= WHERE expr */ yytestcase(yyruleno==154);
175510175798
case 229: /* case_else ::= ELSE expr */ yytestcase(yyruleno==229);
175511175799
case 249: /* vinto ::= INTO expr */ yytestcase(yyruleno==249);
175512
-{yymsp[-1].minor.yy528 = yymsp[0].minor.yy528;}
175800
+{yymsp[-1].minor.yy2 = yymsp[0].minor.yy2;}
175513175801
break;
175514175802
case 147: /* limit_opt ::= LIMIT expr */
175515
-{yymsp[-1].minor.yy528 = sqlite3PExpr(pParse,TK_LIMIT,yymsp[0].minor.yy528,0);}
175803
+{yymsp[-1].minor.yy2 = sqlite3PExpr(pParse,TK_LIMIT,yymsp[0].minor.yy2,0);}
175516175804
break;
175517175805
case 148: /* limit_opt ::= LIMIT expr OFFSET expr */
175518
-{yymsp[-3].minor.yy528 = sqlite3PExpr(pParse,TK_LIMIT,yymsp[-2].minor.yy528,yymsp[0].minor.yy528);}
175806
+{yymsp[-3].minor.yy2 = sqlite3PExpr(pParse,TK_LIMIT,yymsp[-2].minor.yy2,yymsp[0].minor.yy2);}
175519175807
break;
175520175808
case 149: /* limit_opt ::= LIMIT expr COMMA expr */
175521
-{yymsp[-3].minor.yy528 = sqlite3PExpr(pParse,TK_LIMIT,yymsp[0].minor.yy528,yymsp[-2].minor.yy528);}
175809
+{yymsp[-3].minor.yy2 = sqlite3PExpr(pParse,TK_LIMIT,yymsp[0].minor.yy2,yymsp[-2].minor.yy2);}
175522175810
break;
175523175811
case 150: /* cmd ::= with DELETE FROM xfullname indexed_opt where_opt_ret */
175524175812
{
175525
- sqlite3SrcListIndexedBy(pParse, yymsp[-2].minor.yy131, &yymsp[-1].minor.yy0);
175526
- sqlite3DeleteFrom(pParse,yymsp[-2].minor.yy131,yymsp[0].minor.yy528,0,0);
175813
+ sqlite3SrcListIndexedBy(pParse, yymsp[-2].minor.yy387, &yymsp[-1].minor.yy0);
175814
+ sqlite3DeleteFrom(pParse,yymsp[-2].minor.yy387,yymsp[0].minor.yy2,0,0);
175527175815
}
175528175816
break;
175529175817
case 155: /* where_opt_ret ::= RETURNING selcollist */
175530
-{sqlite3AddReturning(pParse,yymsp[0].minor.yy322); yymsp[-1].minor.yy528 = 0;}
175818
+{sqlite3AddReturning(pParse,yymsp[0].minor.yy402); yymsp[-1].minor.yy2 = 0;}
175531175819
break;
175532175820
case 156: /* where_opt_ret ::= WHERE expr RETURNING selcollist */
175533
-{sqlite3AddReturning(pParse,yymsp[0].minor.yy322); yymsp[-3].minor.yy528 = yymsp[-2].minor.yy528;}
175821
+{sqlite3AddReturning(pParse,yymsp[0].minor.yy402); yymsp[-3].minor.yy2 = yymsp[-2].minor.yy2;}
175534175822
break;
175535175823
case 157: /* cmd ::= with UPDATE orconf xfullname indexed_opt SET setlist from where_opt_ret */
175536175824
{
175537
- sqlite3SrcListIndexedBy(pParse, yymsp[-5].minor.yy131, &yymsp[-4].minor.yy0);
175538
- sqlite3ExprListCheckLength(pParse,yymsp[-2].minor.yy322,"set list");
175539
- if( yymsp[-1].minor.yy131 ){
175540
- SrcList *pFromClause = yymsp[-1].minor.yy131;
175825
+ sqlite3SrcListIndexedBy(pParse, yymsp[-5].minor.yy387, &yymsp[-4].minor.yy0);
175826
+ sqlite3ExprListCheckLength(pParse,yymsp[-2].minor.yy402,"set list");
175827
+ if( yymsp[-1].minor.yy387 ){
175828
+ SrcList *pFromClause = yymsp[-1].minor.yy387;
175541175829
if( pFromClause->nSrc>1 ){
175542175830
Select *pSubquery;
175543175831
Token as;
175544175832
pSubquery = sqlite3SelectNew(pParse,0,pFromClause,0,0,0,0,SF_NestedFrom,0);
175545175833
as.n = 0;
175546175834
as.z = 0;
175547175835
pFromClause = sqlite3SrcListAppendFromTerm(pParse,0,0,0,&as,pSubquery,0);
175548175836
}
175549
- yymsp[-5].minor.yy131 = sqlite3SrcListAppendList(pParse, yymsp[-5].minor.yy131, pFromClause);
175837
+ yymsp[-5].minor.yy387 = sqlite3SrcListAppendList(pParse, yymsp[-5].minor.yy387, pFromClause);
175550175838
}
175551
- sqlite3Update(pParse,yymsp[-5].minor.yy131,yymsp[-2].minor.yy322,yymsp[0].minor.yy528,yymsp[-6].minor.yy394,0,0,0);
175839
+ sqlite3Update(pParse,yymsp[-5].minor.yy387,yymsp[-2].minor.yy402,yymsp[0].minor.yy2,yymsp[-6].minor.yy92,0,0,0);
175552175840
}
175553175841
break;
175554175842
case 158: /* setlist ::= setlist COMMA nm EQ expr */
175555175843
{
175556
- yymsp[-4].minor.yy322 = sqlite3ExprListAppend(pParse, yymsp[-4].minor.yy322, yymsp[0].minor.yy528);
175557
- sqlite3ExprListSetName(pParse, yymsp[-4].minor.yy322, &yymsp[-2].minor.yy0, 1);
175844
+ yymsp[-4].minor.yy402 = sqlite3ExprListAppend(pParse, yymsp[-4].minor.yy402, yymsp[0].minor.yy2);
175845
+ sqlite3ExprListSetName(pParse, yymsp[-4].minor.yy402, &yymsp[-2].minor.yy0, 1);
175558175846
}
175559175847
break;
175560175848
case 159: /* setlist ::= setlist COMMA LP idlist RP EQ expr */
175561175849
{
175562
- yymsp[-6].minor.yy322 = sqlite3ExprListAppendVector(pParse, yymsp[-6].minor.yy322, yymsp[-3].minor.yy254, yymsp[0].minor.yy528);
175850
+ yymsp[-6].minor.yy402 = sqlite3ExprListAppendVector(pParse, yymsp[-6].minor.yy402, yymsp[-3].minor.yy400, yymsp[0].minor.yy2);
175563175851
}
175564175852
break;
175565175853
case 160: /* setlist ::= nm EQ expr */
175566175854
{
175567
- yylhsminor.yy322 = sqlite3ExprListAppend(pParse, 0, yymsp[0].minor.yy528);
175568
- sqlite3ExprListSetName(pParse, yylhsminor.yy322, &yymsp[-2].minor.yy0, 1);
175855
+ yylhsminor.yy402 = sqlite3ExprListAppend(pParse, 0, yymsp[0].minor.yy2);
175856
+ sqlite3ExprListSetName(pParse, yylhsminor.yy402, &yymsp[-2].minor.yy0, 1);
175569175857
}
175570
- yymsp[-2].minor.yy322 = yylhsminor.yy322;
175858
+ yymsp[-2].minor.yy402 = yylhsminor.yy402;
175571175859
break;
175572175860
case 161: /* setlist ::= LP idlist RP EQ expr */
175573175861
{
175574
- yymsp[-4].minor.yy322 = sqlite3ExprListAppendVector(pParse, 0, yymsp[-3].minor.yy254, yymsp[0].minor.yy528);
175862
+ yymsp[-4].minor.yy402 = sqlite3ExprListAppendVector(pParse, 0, yymsp[-3].minor.yy400, yymsp[0].minor.yy2);
175575175863
}
175576175864
break;
175577175865
case 162: /* cmd ::= with insert_cmd INTO xfullname idlist_opt select upsert */
175578175866
{
175579
- sqlite3Insert(pParse, yymsp[-3].minor.yy131, yymsp[-1].minor.yy47, yymsp[-2].minor.yy254, yymsp[-5].minor.yy394, yymsp[0].minor.yy444);
175867
+ sqlite3Insert(pParse, yymsp[-3].minor.yy387, yymsp[-1].minor.yy299, yymsp[-2].minor.yy400, yymsp[-5].minor.yy92, yymsp[0].minor.yy258);
175580175868
}
175581175869
break;
175582175870
case 163: /* cmd ::= with insert_cmd INTO xfullname idlist_opt DEFAULT VALUES returning */
175583175871
{
175584
- sqlite3Insert(pParse, yymsp[-4].minor.yy131, 0, yymsp[-3].minor.yy254, yymsp[-6].minor.yy394, 0);
175872
+ sqlite3Insert(pParse, yymsp[-4].minor.yy387, 0, yymsp[-3].minor.yy400, yymsp[-6].minor.yy92, 0);
175585175873
}
175586175874
break;
175587175875
case 164: /* upsert ::= */
175588
-{ yymsp[1].minor.yy444 = 0; }
175876
+{ yymsp[1].minor.yy258 = 0; }
175589175877
break;
175590175878
case 165: /* upsert ::= RETURNING selcollist */
175591
-{ yymsp[-1].minor.yy444 = 0; sqlite3AddReturning(pParse,yymsp[0].minor.yy322); }
175879
+{ yymsp[-1].minor.yy258 = 0; sqlite3AddReturning(pParse,yymsp[0].minor.yy402); }
175592175880
break;
175593175881
case 166: /* upsert ::= ON CONFLICT LP sortlist RP where_opt DO UPDATE SET setlist where_opt upsert */
175594
-{ yymsp[-11].minor.yy444 = sqlite3UpsertNew(pParse->db,yymsp[-8].minor.yy322,yymsp[-6].minor.yy528,yymsp[-2].minor.yy322,yymsp[-1].minor.yy528,yymsp[0].minor.yy444);}
175882
+{ yymsp[-11].minor.yy258 = sqlite3UpsertNew(pParse->db,yymsp[-8].minor.yy402,yymsp[-6].minor.yy2,yymsp[-2].minor.yy402,yymsp[-1].minor.yy2,yymsp[0].minor.yy258);}
175595175883
break;
175596175884
case 167: /* upsert ::= ON CONFLICT LP sortlist RP where_opt DO NOTHING upsert */
175597
-{ yymsp[-8].minor.yy444 = sqlite3UpsertNew(pParse->db,yymsp[-5].minor.yy322,yymsp[-3].minor.yy528,0,0,yymsp[0].minor.yy444); }
175885
+{ yymsp[-8].minor.yy258 = sqlite3UpsertNew(pParse->db,yymsp[-5].minor.yy402,yymsp[-3].minor.yy2,0,0,yymsp[0].minor.yy258); }
175598175886
break;
175599175887
case 168: /* upsert ::= ON CONFLICT DO NOTHING returning */
175600
-{ yymsp[-4].minor.yy444 = sqlite3UpsertNew(pParse->db,0,0,0,0,0); }
175888
+{ yymsp[-4].minor.yy258 = sqlite3UpsertNew(pParse->db,0,0,0,0,0); }
175601175889
break;
175602175890
case 169: /* upsert ::= ON CONFLICT DO UPDATE SET setlist where_opt returning */
175603
-{ yymsp[-7].minor.yy444 = sqlite3UpsertNew(pParse->db,0,0,yymsp[-2].minor.yy322,yymsp[-1].minor.yy528,0);}
175891
+{ yymsp[-7].minor.yy258 = sqlite3UpsertNew(pParse->db,0,0,yymsp[-2].minor.yy402,yymsp[-1].minor.yy2,0);}
175604175892
break;
175605175893
case 170: /* returning ::= RETURNING selcollist */
175606
-{sqlite3AddReturning(pParse,yymsp[0].minor.yy322);}
175894
+{sqlite3AddReturning(pParse,yymsp[0].minor.yy402);}
175607175895
break;
175608175896
case 173: /* idlist_opt ::= */
175609
-{yymsp[1].minor.yy254 = 0;}
175897
+{yymsp[1].minor.yy400 = 0;}
175610175898
break;
175611175899
case 174: /* idlist_opt ::= LP idlist RP */
175612
-{yymsp[-2].minor.yy254 = yymsp[-1].minor.yy254;}
175900
+{yymsp[-2].minor.yy400 = yymsp[-1].minor.yy400;}
175613175901
break;
175614175902
case 175: /* idlist ::= idlist COMMA nm */
175615
-{yymsp[-2].minor.yy254 = sqlite3IdListAppend(pParse,yymsp[-2].minor.yy254,&yymsp[0].minor.yy0);}
175903
+{yymsp[-2].minor.yy400 = sqlite3IdListAppend(pParse,yymsp[-2].minor.yy400,&yymsp[0].minor.yy0);}
175616175904
break;
175617175905
case 176: /* idlist ::= nm */
175618
-{yymsp[0].minor.yy254 = sqlite3IdListAppend(pParse,0,&yymsp[0].minor.yy0); /*A-overwrites-Y*/}
175906
+{yymsp[0].minor.yy400 = sqlite3IdListAppend(pParse,0,&yymsp[0].minor.yy0); /*A-overwrites-Y*/}
175619175907
break;
175620175908
case 177: /* expr ::= LP expr RP */
175621
-{yymsp[-2].minor.yy528 = yymsp[-1].minor.yy528;}
175909
+{yymsp[-2].minor.yy2 = yymsp[-1].minor.yy2;}
175622175910
break;
175623175911
case 178: /* expr ::= ID|INDEXED|JOIN_KW */
175624
-{yymsp[0].minor.yy528=tokenExpr(pParse,TK_ID,yymsp[0].minor.yy0); /*A-overwrites-X*/}
175912
+{yymsp[0].minor.yy2=tokenExpr(pParse,TK_ID,yymsp[0].minor.yy0); /*A-overwrites-X*/}
175625175913
break;
175626175914
case 179: /* expr ::= nm DOT nm */
175627175915
{
175628175916
Expr *temp1 = tokenExpr(pParse,TK_ID,yymsp[-2].minor.yy0);
175629175917
Expr *temp2 = tokenExpr(pParse,TK_ID,yymsp[0].minor.yy0);
175630
- yylhsminor.yy528 = sqlite3PExpr(pParse, TK_DOT, temp1, temp2);
175918
+ yylhsminor.yy2 = sqlite3PExpr(pParse, TK_DOT, temp1, temp2);
175631175919
}
175632
- yymsp[-2].minor.yy528 = yylhsminor.yy528;
175920
+ yymsp[-2].minor.yy2 = yylhsminor.yy2;
175633175921
break;
175634175922
case 180: /* expr ::= nm DOT nm DOT nm */
175635175923
{
175636175924
Expr *temp1 = tokenExpr(pParse,TK_ID,yymsp[-4].minor.yy0);
175637175925
Expr *temp2 = tokenExpr(pParse,TK_ID,yymsp[-2].minor.yy0);
@@ -175638,369 +175926,369 @@
175638175926
Expr *temp3 = tokenExpr(pParse,TK_ID,yymsp[0].minor.yy0);
175639175927
Expr *temp4 = sqlite3PExpr(pParse, TK_DOT, temp2, temp3);
175640175928
if( IN_RENAME_OBJECT ){
175641175929
sqlite3RenameTokenRemap(pParse, 0, temp1);
175642175930
}
175643
- yylhsminor.yy528 = sqlite3PExpr(pParse, TK_DOT, temp1, temp4);
175931
+ yylhsminor.yy2 = sqlite3PExpr(pParse, TK_DOT, temp1, temp4);
175644175932
}
175645
- yymsp[-4].minor.yy528 = yylhsminor.yy528;
175933
+ yymsp[-4].minor.yy2 = yylhsminor.yy2;
175646175934
break;
175647175935
case 181: /* term ::= NULL|FLOAT|BLOB */
175648175936
case 182: /* term ::= STRING */ yytestcase(yyruleno==182);
175649
-{yymsp[0].minor.yy528=tokenExpr(pParse,yymsp[0].major,yymsp[0].minor.yy0); /*A-overwrites-X*/}
175937
+{yymsp[0].minor.yy2=tokenExpr(pParse,yymsp[0].major,yymsp[0].minor.yy0); /*A-overwrites-X*/}
175650175938
break;
175651175939
case 183: /* term ::= INTEGER */
175652175940
{
175653
- yylhsminor.yy528 = sqlite3ExprAlloc(pParse->db, TK_INTEGER, &yymsp[0].minor.yy0, 1);
175654
- if( yylhsminor.yy528 ) yylhsminor.yy528->w.iOfst = (int)(yymsp[0].minor.yy0.z - pParse->zTail);
175941
+ yylhsminor.yy2 = sqlite3ExprAlloc(pParse->db, TK_INTEGER, &yymsp[0].minor.yy0, 1);
175942
+ if( yylhsminor.yy2 ) yylhsminor.yy2->w.iOfst = (int)(yymsp[0].minor.yy0.z - pParse->zTail);
175655175943
}
175656
- yymsp[0].minor.yy528 = yylhsminor.yy528;
175944
+ yymsp[0].minor.yy2 = yylhsminor.yy2;
175657175945
break;
175658175946
case 184: /* expr ::= VARIABLE */
175659175947
{
175660175948
if( !(yymsp[0].minor.yy0.z[0]=='#' && sqlite3Isdigit(yymsp[0].minor.yy0.z[1])) ){
175661175949
u32 n = yymsp[0].minor.yy0.n;
175662
- yymsp[0].minor.yy528 = tokenExpr(pParse, TK_VARIABLE, yymsp[0].minor.yy0);
175663
- sqlite3ExprAssignVarNumber(pParse, yymsp[0].minor.yy528, n);
175950
+ yymsp[0].minor.yy2 = tokenExpr(pParse, TK_VARIABLE, yymsp[0].minor.yy0);
175951
+ sqlite3ExprAssignVarNumber(pParse, yymsp[0].minor.yy2, n);
175664175952
}else{
175665175953
/* When doing a nested parse, one can include terms in an expression
175666175954
** that look like this: #1 #2 ... These terms refer to registers
175667175955
** in the virtual machine. #N is the N-th register. */
175668175956
Token t = yymsp[0].minor.yy0; /*A-overwrites-X*/
175669175957
assert( t.n>=2 );
175670175958
if( pParse->nested==0 ){
175671175959
sqlite3ErrorMsg(pParse, "near \"%T\": syntax error", &t);
175672
- yymsp[0].minor.yy528 = 0;
175960
+ yymsp[0].minor.yy2 = 0;
175673175961
}else{
175674
- yymsp[0].minor.yy528 = sqlite3PExpr(pParse, TK_REGISTER, 0, 0);
175675
- if( yymsp[0].minor.yy528 ) sqlite3GetInt32(&t.z[1], &yymsp[0].minor.yy528->iTable);
175962
+ yymsp[0].minor.yy2 = sqlite3PExpr(pParse, TK_REGISTER, 0, 0);
175963
+ if( yymsp[0].minor.yy2 ) sqlite3GetInt32(&t.z[1], &yymsp[0].minor.yy2->iTable);
175676175964
}
175677175965
}
175678175966
}
175679175967
break;
175680175968
case 185: /* expr ::= expr COLLATE ID|STRING */
175681175969
{
175682
- yymsp[-2].minor.yy528 = sqlite3ExprAddCollateToken(pParse, yymsp[-2].minor.yy528, &yymsp[0].minor.yy0, 1);
175970
+ yymsp[-2].minor.yy2 = sqlite3ExprAddCollateToken(pParse, yymsp[-2].minor.yy2, &yymsp[0].minor.yy0, 1);
175683175971
}
175684175972
break;
175685175973
case 186: /* expr ::= CAST LP expr AS typetoken RP */
175686175974
{
175687
- yymsp[-5].minor.yy528 = sqlite3ExprAlloc(pParse->db, TK_CAST, &yymsp[-1].minor.yy0, 1);
175688
- sqlite3ExprAttachSubtrees(pParse->db, yymsp[-5].minor.yy528, yymsp[-3].minor.yy528, 0);
175975
+ yymsp[-5].minor.yy2 = sqlite3ExprAlloc(pParse->db, TK_CAST, &yymsp[-1].minor.yy0, 1);
175976
+ sqlite3ExprAttachSubtrees(pParse->db, yymsp[-5].minor.yy2, yymsp[-3].minor.yy2, 0);
175689175977
}
175690175978
break;
175691175979
case 187: /* expr ::= ID|INDEXED|JOIN_KW LP distinct exprlist RP */
175692175980
{
175693
- yylhsminor.yy528 = sqlite3ExprFunction(pParse, yymsp[-1].minor.yy322, &yymsp[-4].minor.yy0, yymsp[-2].minor.yy394);
175981
+ yylhsminor.yy2 = sqlite3ExprFunction(pParse, yymsp[-1].minor.yy402, &yymsp[-4].minor.yy0, yymsp[-2].minor.yy92);
175694175982
}
175695
- yymsp[-4].minor.yy528 = yylhsminor.yy528;
175983
+ yymsp[-4].minor.yy2 = yylhsminor.yy2;
175696175984
break;
175697175985
case 188: /* expr ::= ID|INDEXED|JOIN_KW LP distinct exprlist ORDER BY sortlist RP */
175698175986
{
175699
- yylhsminor.yy528 = sqlite3ExprFunction(pParse, yymsp[-4].minor.yy322, &yymsp[-7].minor.yy0, yymsp[-5].minor.yy394);
175700
- sqlite3ExprAddFunctionOrderBy(pParse, yylhsminor.yy528, yymsp[-1].minor.yy322);
175987
+ yylhsminor.yy2 = sqlite3ExprFunction(pParse, yymsp[-4].minor.yy402, &yymsp[-7].minor.yy0, yymsp[-5].minor.yy92);
175988
+ sqlite3ExprAddFunctionOrderBy(pParse, yylhsminor.yy2, yymsp[-1].minor.yy402);
175701175989
}
175702
- yymsp[-7].minor.yy528 = yylhsminor.yy528;
175990
+ yymsp[-7].minor.yy2 = yylhsminor.yy2;
175703175991
break;
175704175992
case 189: /* expr ::= ID|INDEXED|JOIN_KW LP STAR RP */
175705175993
{
175706
- yylhsminor.yy528 = sqlite3ExprFunction(pParse, 0, &yymsp[-3].minor.yy0, 0);
175994
+ yylhsminor.yy2 = sqlite3ExprFunction(pParse, 0, &yymsp[-3].minor.yy0, 0);
175707175995
}
175708
- yymsp[-3].minor.yy528 = yylhsminor.yy528;
175996
+ yymsp[-3].minor.yy2 = yylhsminor.yy2;
175709175997
break;
175710175998
case 190: /* expr ::= ID|INDEXED|JOIN_KW LP distinct exprlist RP filter_over */
175711175999
{
175712
- yylhsminor.yy528 = sqlite3ExprFunction(pParse, yymsp[-2].minor.yy322, &yymsp[-5].minor.yy0, yymsp[-3].minor.yy394);
175713
- sqlite3WindowAttach(pParse, yylhsminor.yy528, yymsp[0].minor.yy41);
176000
+ yylhsminor.yy2 = sqlite3ExprFunction(pParse, yymsp[-2].minor.yy402, &yymsp[-5].minor.yy0, yymsp[-3].minor.yy92);
176001
+ sqlite3WindowAttach(pParse, yylhsminor.yy2, yymsp[0].minor.yy3);
175714176002
}
175715
- yymsp[-5].minor.yy528 = yylhsminor.yy528;
176003
+ yymsp[-5].minor.yy2 = yylhsminor.yy2;
175716176004
break;
175717176005
case 191: /* expr ::= ID|INDEXED|JOIN_KW LP distinct exprlist ORDER BY sortlist RP filter_over */
175718176006
{
175719
- yylhsminor.yy528 = sqlite3ExprFunction(pParse, yymsp[-5].minor.yy322, &yymsp[-8].minor.yy0, yymsp[-6].minor.yy394);
175720
- sqlite3WindowAttach(pParse, yylhsminor.yy528, yymsp[0].minor.yy41);
175721
- sqlite3ExprAddFunctionOrderBy(pParse, yylhsminor.yy528, yymsp[-2].minor.yy322);
176007
+ yylhsminor.yy2 = sqlite3ExprFunction(pParse, yymsp[-5].minor.yy402, &yymsp[-8].minor.yy0, yymsp[-6].minor.yy92);
176008
+ sqlite3WindowAttach(pParse, yylhsminor.yy2, yymsp[0].minor.yy3);
176009
+ sqlite3ExprAddFunctionOrderBy(pParse, yylhsminor.yy2, yymsp[-2].minor.yy402);
175722176010
}
175723
- yymsp[-8].minor.yy528 = yylhsminor.yy528;
176011
+ yymsp[-8].minor.yy2 = yylhsminor.yy2;
175724176012
break;
175725176013
case 192: /* expr ::= ID|INDEXED|JOIN_KW LP STAR RP filter_over */
175726176014
{
175727
- yylhsminor.yy528 = sqlite3ExprFunction(pParse, 0, &yymsp[-4].minor.yy0, 0);
175728
- sqlite3WindowAttach(pParse, yylhsminor.yy528, yymsp[0].minor.yy41);
176015
+ yylhsminor.yy2 = sqlite3ExprFunction(pParse, 0, &yymsp[-4].minor.yy0, 0);
176016
+ sqlite3WindowAttach(pParse, yylhsminor.yy2, yymsp[0].minor.yy3);
175729176017
}
175730
- yymsp[-4].minor.yy528 = yylhsminor.yy528;
176018
+ yymsp[-4].minor.yy2 = yylhsminor.yy2;
175731176019
break;
175732176020
case 193: /* term ::= CTIME_KW */
175733176021
{
175734
- yylhsminor.yy528 = sqlite3ExprFunction(pParse, 0, &yymsp[0].minor.yy0, 0);
176022
+ yylhsminor.yy2 = sqlite3ExprFunction(pParse, 0, &yymsp[0].minor.yy0, 0);
175735176023
}
175736
- yymsp[0].minor.yy528 = yylhsminor.yy528;
176024
+ yymsp[0].minor.yy2 = yylhsminor.yy2;
175737176025
break;
175738176026
case 194: /* expr ::= LP nexprlist COMMA expr RP */
175739176027
{
175740
- ExprList *pList = sqlite3ExprListAppend(pParse, yymsp[-3].minor.yy322, yymsp[-1].minor.yy528);
175741
- yymsp[-4].minor.yy528 = sqlite3PExpr(pParse, TK_VECTOR, 0, 0);
175742
- if( yymsp[-4].minor.yy528 ){
175743
- yymsp[-4].minor.yy528->x.pList = pList;
176028
+ ExprList *pList = sqlite3ExprListAppend(pParse, yymsp[-3].minor.yy402, yymsp[-1].minor.yy2);
176029
+ yymsp[-4].minor.yy2 = sqlite3PExpr(pParse, TK_VECTOR, 0, 0);
176030
+ if( yymsp[-4].minor.yy2 ){
176031
+ yymsp[-4].minor.yy2->x.pList = pList;
175744176032
if( ALWAYS(pList->nExpr) ){
175745
- yymsp[-4].minor.yy528->flags |= pList->a[0].pExpr->flags & EP_Propagate;
176033
+ yymsp[-4].minor.yy2->flags |= pList->a[0].pExpr->flags & EP_Propagate;
175746176034
}
175747176035
}else{
175748176036
sqlite3ExprListDelete(pParse->db, pList);
175749176037
}
175750176038
}
175751176039
break;
175752176040
case 195: /* expr ::= expr AND expr */
175753
-{yymsp[-2].minor.yy528=sqlite3ExprAnd(pParse,yymsp[-2].minor.yy528,yymsp[0].minor.yy528);}
176041
+{yymsp[-2].minor.yy2=sqlite3ExprAnd(pParse,yymsp[-2].minor.yy2,yymsp[0].minor.yy2);}
175754176042
break;
175755176043
case 196: /* expr ::= expr OR expr */
175756176044
case 197: /* expr ::= expr LT|GT|GE|LE expr */ yytestcase(yyruleno==197);
175757176045
case 198: /* expr ::= expr EQ|NE expr */ yytestcase(yyruleno==198);
175758176046
case 199: /* expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr */ yytestcase(yyruleno==199);
175759176047
case 200: /* expr ::= expr PLUS|MINUS expr */ yytestcase(yyruleno==200);
175760176048
case 201: /* expr ::= expr STAR|SLASH|REM expr */ yytestcase(yyruleno==201);
175761176049
case 202: /* expr ::= expr CONCAT expr */ yytestcase(yyruleno==202);
175762
-{yymsp[-2].minor.yy528=sqlite3PExpr(pParse,yymsp[-1].major,yymsp[-2].minor.yy528,yymsp[0].minor.yy528);}
176050
+{yymsp[-2].minor.yy2=sqlite3PExpr(pParse,yymsp[-1].major,yymsp[-2].minor.yy2,yymsp[0].minor.yy2);}
175763176051
break;
175764176052
case 203: /* likeop ::= NOT LIKE_KW|MATCH */
175765176053
{yymsp[-1].minor.yy0=yymsp[0].minor.yy0; yymsp[-1].minor.yy0.n|=0x80000000; /*yymsp[-1].minor.yy0-overwrite-yymsp[0].minor.yy0*/}
175766176054
break;
175767176055
case 204: /* expr ::= expr likeop expr */
175768176056
{
175769176057
ExprList *pList;
175770176058
int bNot = yymsp[-1].minor.yy0.n & 0x80000000;
175771176059
yymsp[-1].minor.yy0.n &= 0x7fffffff;
175772
- pList = sqlite3ExprListAppend(pParse,0, yymsp[0].minor.yy528);
175773
- pList = sqlite3ExprListAppend(pParse,pList, yymsp[-2].minor.yy528);
175774
- yymsp[-2].minor.yy528 = sqlite3ExprFunction(pParse, pList, &yymsp[-1].minor.yy0, 0);
175775
- if( bNot ) yymsp[-2].minor.yy528 = sqlite3PExpr(pParse, TK_NOT, yymsp[-2].minor.yy528, 0);
175776
- if( yymsp[-2].minor.yy528 ) yymsp[-2].minor.yy528->flags |= EP_InfixFunc;
176060
+ pList = sqlite3ExprListAppend(pParse,0, yymsp[0].minor.yy2);
176061
+ pList = sqlite3ExprListAppend(pParse,pList, yymsp[-2].minor.yy2);
176062
+ yymsp[-2].minor.yy2 = sqlite3ExprFunction(pParse, pList, &yymsp[-1].minor.yy0, 0);
176063
+ if( bNot ) yymsp[-2].minor.yy2 = sqlite3PExpr(pParse, TK_NOT, yymsp[-2].minor.yy2, 0);
176064
+ if( yymsp[-2].minor.yy2 ) yymsp[-2].minor.yy2->flags |= EP_InfixFunc;
175777176065
}
175778176066
break;
175779176067
case 205: /* expr ::= expr likeop expr ESCAPE expr */
175780176068
{
175781176069
ExprList *pList;
175782176070
int bNot = yymsp[-3].minor.yy0.n & 0x80000000;
175783176071
yymsp[-3].minor.yy0.n &= 0x7fffffff;
175784
- pList = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy528);
175785
- pList = sqlite3ExprListAppend(pParse,pList, yymsp[-4].minor.yy528);
175786
- pList = sqlite3ExprListAppend(pParse,pList, yymsp[0].minor.yy528);
175787
- yymsp[-4].minor.yy528 = sqlite3ExprFunction(pParse, pList, &yymsp[-3].minor.yy0, 0);
175788
- if( bNot ) yymsp[-4].minor.yy528 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy528, 0);
175789
- if( yymsp[-4].minor.yy528 ) yymsp[-4].minor.yy528->flags |= EP_InfixFunc;
176072
+ pList = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy2);
176073
+ pList = sqlite3ExprListAppend(pParse,pList, yymsp[-4].minor.yy2);
176074
+ pList = sqlite3ExprListAppend(pParse,pList, yymsp[0].minor.yy2);
176075
+ yymsp[-4].minor.yy2 = sqlite3ExprFunction(pParse, pList, &yymsp[-3].minor.yy0, 0);
176076
+ if( bNot ) yymsp[-4].minor.yy2 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy2, 0);
176077
+ if( yymsp[-4].minor.yy2 ) yymsp[-4].minor.yy2->flags |= EP_InfixFunc;
175790176078
}
175791176079
break;
175792176080
case 206: /* expr ::= expr ISNULL|NOTNULL */
175793
-{yymsp[-1].minor.yy528 = sqlite3PExpr(pParse,yymsp[0].major,yymsp[-1].minor.yy528,0);}
176081
+{yymsp[-1].minor.yy2 = sqlite3PExpr(pParse,yymsp[0].major,yymsp[-1].minor.yy2,0);}
175794176082
break;
175795176083
case 207: /* expr ::= expr NOT NULL */
175796
-{yymsp[-2].minor.yy528 = sqlite3PExpr(pParse,TK_NOTNULL,yymsp[-2].minor.yy528,0);}
176084
+{yymsp[-2].minor.yy2 = sqlite3PExpr(pParse,TK_NOTNULL,yymsp[-2].minor.yy2,0);}
175797176085
break;
175798176086
case 208: /* expr ::= expr IS expr */
175799176087
{
175800
- yymsp[-2].minor.yy528 = sqlite3PExpr(pParse,TK_IS,yymsp[-2].minor.yy528,yymsp[0].minor.yy528);
175801
- binaryToUnaryIfNull(pParse, yymsp[0].minor.yy528, yymsp[-2].minor.yy528, TK_ISNULL);
176088
+ yymsp[-2].minor.yy2 = sqlite3PExpr(pParse,TK_IS,yymsp[-2].minor.yy2,yymsp[0].minor.yy2);
176089
+ binaryToUnaryIfNull(pParse, yymsp[0].minor.yy2, yymsp[-2].minor.yy2, TK_ISNULL);
175802176090
}
175803176091
break;
175804176092
case 209: /* expr ::= expr IS NOT expr */
175805176093
{
175806
- yymsp[-3].minor.yy528 = sqlite3PExpr(pParse,TK_ISNOT,yymsp[-3].minor.yy528,yymsp[0].minor.yy528);
175807
- binaryToUnaryIfNull(pParse, yymsp[0].minor.yy528, yymsp[-3].minor.yy528, TK_NOTNULL);
176094
+ yymsp[-3].minor.yy2 = sqlite3PExpr(pParse,TK_ISNOT,yymsp[-3].minor.yy2,yymsp[0].minor.yy2);
176095
+ binaryToUnaryIfNull(pParse, yymsp[0].minor.yy2, yymsp[-3].minor.yy2, TK_NOTNULL);
175808176096
}
175809176097
break;
175810176098
case 210: /* expr ::= expr IS NOT DISTINCT FROM expr */
175811176099
{
175812
- yymsp[-5].minor.yy528 = sqlite3PExpr(pParse,TK_IS,yymsp[-5].minor.yy528,yymsp[0].minor.yy528);
175813
- binaryToUnaryIfNull(pParse, yymsp[0].minor.yy528, yymsp[-5].minor.yy528, TK_ISNULL);
176100
+ yymsp[-5].minor.yy2 = sqlite3PExpr(pParse,TK_IS,yymsp[-5].minor.yy2,yymsp[0].minor.yy2);
176101
+ binaryToUnaryIfNull(pParse, yymsp[0].minor.yy2, yymsp[-5].minor.yy2, TK_ISNULL);
175814176102
}
175815176103
break;
175816176104
case 211: /* expr ::= expr IS DISTINCT FROM expr */
175817176105
{
175818
- yymsp[-4].minor.yy528 = sqlite3PExpr(pParse,TK_ISNOT,yymsp[-4].minor.yy528,yymsp[0].minor.yy528);
175819
- binaryToUnaryIfNull(pParse, yymsp[0].minor.yy528, yymsp[-4].minor.yy528, TK_NOTNULL);
176106
+ yymsp[-4].minor.yy2 = sqlite3PExpr(pParse,TK_ISNOT,yymsp[-4].minor.yy2,yymsp[0].minor.yy2);
176107
+ binaryToUnaryIfNull(pParse, yymsp[0].minor.yy2, yymsp[-4].minor.yy2, TK_NOTNULL);
175820176108
}
175821176109
break;
175822176110
case 212: /* expr ::= NOT expr */
175823176111
case 213: /* expr ::= BITNOT expr */ yytestcase(yyruleno==213);
175824
-{yymsp[-1].minor.yy528 = sqlite3PExpr(pParse, yymsp[-1].major, yymsp[0].minor.yy528, 0);/*A-overwrites-B*/}
176112
+{yymsp[-1].minor.yy2 = sqlite3PExpr(pParse, yymsp[-1].major, yymsp[0].minor.yy2, 0);/*A-overwrites-B*/}
175825176113
break;
175826176114
case 214: /* expr ::= PLUS|MINUS expr */
175827176115
{
175828
- yymsp[-1].minor.yy528 = sqlite3PExpr(pParse, yymsp[-1].major==TK_PLUS ? TK_UPLUS : TK_UMINUS, yymsp[0].minor.yy528, 0);
176116
+ yymsp[-1].minor.yy2 = sqlite3PExpr(pParse, yymsp[-1].major==TK_PLUS ? TK_UPLUS : TK_UMINUS, yymsp[0].minor.yy2, 0);
175829176117
/*A-overwrites-B*/
175830176118
}
175831176119
break;
175832176120
case 215: /* expr ::= expr PTR expr */
175833176121
{
175834
- ExprList *pList = sqlite3ExprListAppend(pParse, 0, yymsp[-2].minor.yy528);
175835
- pList = sqlite3ExprListAppend(pParse, pList, yymsp[0].minor.yy528);
175836
- yylhsminor.yy528 = sqlite3ExprFunction(pParse, pList, &yymsp[-1].minor.yy0, 0);
176122
+ ExprList *pList = sqlite3ExprListAppend(pParse, 0, yymsp[-2].minor.yy2);
176123
+ pList = sqlite3ExprListAppend(pParse, pList, yymsp[0].minor.yy2);
176124
+ yylhsminor.yy2 = sqlite3ExprFunction(pParse, pList, &yymsp[-1].minor.yy0, 0);
175837176125
}
175838
- yymsp[-2].minor.yy528 = yylhsminor.yy528;
176126
+ yymsp[-2].minor.yy2 = yylhsminor.yy2;
175839176127
break;
175840176128
case 216: /* between_op ::= BETWEEN */
175841176129
case 219: /* in_op ::= IN */ yytestcase(yyruleno==219);
175842
-{yymsp[0].minor.yy394 = 0;}
176130
+{yymsp[0].minor.yy92 = 0;}
175843176131
break;
175844176132
case 218: /* expr ::= expr between_op expr AND expr */
175845176133
{
175846
- ExprList *pList = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy528);
175847
- pList = sqlite3ExprListAppend(pParse,pList, yymsp[0].minor.yy528);
175848
- yymsp[-4].minor.yy528 = sqlite3PExpr(pParse, TK_BETWEEN, yymsp[-4].minor.yy528, 0);
175849
- if( yymsp[-4].minor.yy528 ){
175850
- yymsp[-4].minor.yy528->x.pList = pList;
176134
+ ExprList *pList = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy2);
176135
+ pList = sqlite3ExprListAppend(pParse,pList, yymsp[0].minor.yy2);
176136
+ yymsp[-4].minor.yy2 = sqlite3PExpr(pParse, TK_BETWEEN, yymsp[-4].minor.yy2, 0);
176137
+ if( yymsp[-4].minor.yy2 ){
176138
+ yymsp[-4].minor.yy2->x.pList = pList;
175851176139
}else{
175852176140
sqlite3ExprListDelete(pParse->db, pList);
175853176141
}
175854
- if( yymsp[-3].minor.yy394 ) yymsp[-4].minor.yy528 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy528, 0);
176142
+ if( yymsp[-3].minor.yy92 ) yymsp[-4].minor.yy2 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy2, 0);
175855176143
}
175856176144
break;
175857176145
case 221: /* expr ::= expr in_op LP exprlist RP */
175858176146
{
175859
- if( yymsp[-1].minor.yy322==0 ){
176147
+ if( yymsp[-1].minor.yy402==0 ){
175860176148
/* Expressions of the form
175861176149
**
175862176150
** expr1 IN ()
175863176151
** expr1 NOT IN ()
175864176152
**
175865176153
** simplify to constants 0 (false) and 1 (true), respectively,
175866176154
** regardless of the value of expr1.
175867176155
*/
175868
- sqlite3ExprUnmapAndDelete(pParse, yymsp[-4].minor.yy528);
175869
- yymsp[-4].minor.yy528 = sqlite3Expr(pParse->db, TK_STRING, yymsp[-3].minor.yy394 ? "true" : "false");
175870
- if( yymsp[-4].minor.yy528 ) sqlite3ExprIdToTrueFalse(yymsp[-4].minor.yy528);
176156
+ sqlite3ExprUnmapAndDelete(pParse, yymsp[-4].minor.yy2);
176157
+ yymsp[-4].minor.yy2 = sqlite3Expr(pParse->db, TK_STRING, yymsp[-3].minor.yy92 ? "true" : "false");
176158
+ if( yymsp[-4].minor.yy2 ) sqlite3ExprIdToTrueFalse(yymsp[-4].minor.yy2);
175871176159
}else{
175872
- Expr *pRHS = yymsp[-1].minor.yy322->a[0].pExpr;
175873
- if( yymsp[-1].minor.yy322->nExpr==1 && sqlite3ExprIsConstant(pRHS) && yymsp[-4].minor.yy528->op!=TK_VECTOR ){
175874
- yymsp[-1].minor.yy322->a[0].pExpr = 0;
175875
- sqlite3ExprListDelete(pParse->db, yymsp[-1].minor.yy322);
176160
+ Expr *pRHS = yymsp[-1].minor.yy402->a[0].pExpr;
176161
+ if( yymsp[-1].minor.yy402->nExpr==1 && sqlite3ExprIsConstant(pRHS) && yymsp[-4].minor.yy2->op!=TK_VECTOR ){
176162
+ yymsp[-1].minor.yy402->a[0].pExpr = 0;
176163
+ sqlite3ExprListDelete(pParse->db, yymsp[-1].minor.yy402);
175876176164
pRHS = sqlite3PExpr(pParse, TK_UPLUS, pRHS, 0);
175877
- yymsp[-4].minor.yy528 = sqlite3PExpr(pParse, TK_EQ, yymsp[-4].minor.yy528, pRHS);
175878
- }else if( yymsp[-1].minor.yy322->nExpr==1 && pRHS->op==TK_SELECT ){
175879
- yymsp[-4].minor.yy528 = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy528, 0);
175880
- sqlite3PExprAddSelect(pParse, yymsp[-4].minor.yy528, pRHS->x.pSelect);
176165
+ yymsp[-4].minor.yy2 = sqlite3PExpr(pParse, TK_EQ, yymsp[-4].minor.yy2, pRHS);
176166
+ }else if( yymsp[-1].minor.yy402->nExpr==1 && pRHS->op==TK_SELECT ){
176167
+ yymsp[-4].minor.yy2 = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy2, 0);
176168
+ sqlite3PExprAddSelect(pParse, yymsp[-4].minor.yy2, pRHS->x.pSelect);
175881176169
pRHS->x.pSelect = 0;
175882
- sqlite3ExprListDelete(pParse->db, yymsp[-1].minor.yy322);
176170
+ sqlite3ExprListDelete(pParse->db, yymsp[-1].minor.yy402);
175883176171
}else{
175884
- yymsp[-4].minor.yy528 = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy528, 0);
175885
- if( yymsp[-4].minor.yy528==0 ){
175886
- sqlite3ExprListDelete(pParse->db, yymsp[-1].minor.yy322);
175887
- }else if( yymsp[-4].minor.yy528->pLeft->op==TK_VECTOR ){
175888
- int nExpr = yymsp[-4].minor.yy528->pLeft->x.pList->nExpr;
175889
- Select *pSelectRHS = sqlite3ExprListToValues(pParse, nExpr, yymsp[-1].minor.yy322);
176172
+ yymsp[-4].minor.yy2 = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy2, 0);
176173
+ if( yymsp[-4].minor.yy2==0 ){
176174
+ sqlite3ExprListDelete(pParse->db, yymsp[-1].minor.yy402);
176175
+ }else if( yymsp[-4].minor.yy2->pLeft->op==TK_VECTOR ){
176176
+ int nExpr = yymsp[-4].minor.yy2->pLeft->x.pList->nExpr;
176177
+ Select *pSelectRHS = sqlite3ExprListToValues(pParse, nExpr, yymsp[-1].minor.yy402);
175890176178
if( pSelectRHS ){
175891176179
parserDoubleLinkSelect(pParse, pSelectRHS);
175892
- sqlite3PExprAddSelect(pParse, yymsp[-4].minor.yy528, pSelectRHS);
176180
+ sqlite3PExprAddSelect(pParse, yymsp[-4].minor.yy2, pSelectRHS);
175893176181
}
175894176182
}else{
175895
- yymsp[-4].minor.yy528->x.pList = yymsp[-1].minor.yy322;
175896
- sqlite3ExprSetHeightAndFlags(pParse, yymsp[-4].minor.yy528);
176183
+ yymsp[-4].minor.yy2->x.pList = yymsp[-1].minor.yy402;
176184
+ sqlite3ExprSetHeightAndFlags(pParse, yymsp[-4].minor.yy2);
175897176185
}
175898176186
}
175899
- if( yymsp[-3].minor.yy394 ) yymsp[-4].minor.yy528 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy528, 0);
176187
+ if( yymsp[-3].minor.yy92 ) yymsp[-4].minor.yy2 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy2, 0);
175900176188
}
175901176189
}
175902176190
break;
175903176191
case 222: /* expr ::= LP select RP */
175904176192
{
175905
- yymsp[-2].minor.yy528 = sqlite3PExpr(pParse, TK_SELECT, 0, 0);
175906
- sqlite3PExprAddSelect(pParse, yymsp[-2].minor.yy528, yymsp[-1].minor.yy47);
176193
+ yymsp[-2].minor.yy2 = sqlite3PExpr(pParse, TK_SELECT, 0, 0);
176194
+ sqlite3PExprAddSelect(pParse, yymsp[-2].minor.yy2, yymsp[-1].minor.yy299);
175907176195
}
175908176196
break;
175909176197
case 223: /* expr ::= expr in_op LP select RP */
175910176198
{
175911
- yymsp[-4].minor.yy528 = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy528, 0);
175912
- sqlite3PExprAddSelect(pParse, yymsp[-4].minor.yy528, yymsp[-1].minor.yy47);
175913
- if( yymsp[-3].minor.yy394 ) yymsp[-4].minor.yy528 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy528, 0);
176199
+ yymsp[-4].minor.yy2 = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy2, 0);
176200
+ sqlite3PExprAddSelect(pParse, yymsp[-4].minor.yy2, yymsp[-1].minor.yy299);
176201
+ if( yymsp[-3].minor.yy92 ) yymsp[-4].minor.yy2 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy2, 0);
175914176202
}
175915176203
break;
175916176204
case 224: /* expr ::= expr in_op nm dbnm paren_exprlist */
175917176205
{
175918176206
SrcList *pSrc = sqlite3SrcListAppend(pParse, 0,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0);
175919176207
Select *pSelect = sqlite3SelectNew(pParse, 0,pSrc,0,0,0,0,0,0);
175920
- if( yymsp[0].minor.yy322 ) sqlite3SrcListFuncArgs(pParse, pSelect ? pSrc : 0, yymsp[0].minor.yy322);
175921
- yymsp[-4].minor.yy528 = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy528, 0);
175922
- sqlite3PExprAddSelect(pParse, yymsp[-4].minor.yy528, pSelect);
175923
- if( yymsp[-3].minor.yy394 ) yymsp[-4].minor.yy528 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy528, 0);
176208
+ if( yymsp[0].minor.yy402 ) sqlite3SrcListFuncArgs(pParse, pSelect ? pSrc : 0, yymsp[0].minor.yy402);
176209
+ yymsp[-4].minor.yy2 = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy2, 0);
176210
+ sqlite3PExprAddSelect(pParse, yymsp[-4].minor.yy2, pSelect);
176211
+ if( yymsp[-3].minor.yy92 ) yymsp[-4].minor.yy2 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy2, 0);
175924176212
}
175925176213
break;
175926176214
case 225: /* expr ::= EXISTS LP select RP */
175927176215
{
175928176216
Expr *p;
175929
- p = yymsp[-3].minor.yy528 = sqlite3PExpr(pParse, TK_EXISTS, 0, 0);
175930
- sqlite3PExprAddSelect(pParse, p, yymsp[-1].minor.yy47);
176217
+ p = yymsp[-3].minor.yy2 = sqlite3PExpr(pParse, TK_EXISTS, 0, 0);
176218
+ sqlite3PExprAddSelect(pParse, p, yymsp[-1].minor.yy299);
175931176219
}
175932176220
break;
175933176221
case 226: /* expr ::= CASE case_operand case_exprlist case_else END */
175934176222
{
175935
- yymsp[-4].minor.yy528 = sqlite3PExpr(pParse, TK_CASE, yymsp[-3].minor.yy528, 0);
175936
- if( yymsp[-4].minor.yy528 ){
175937
- yymsp[-4].minor.yy528->x.pList = yymsp[-1].minor.yy528 ? sqlite3ExprListAppend(pParse,yymsp[-2].minor.yy322,yymsp[-1].minor.yy528) : yymsp[-2].minor.yy322;
175938
- sqlite3ExprSetHeightAndFlags(pParse, yymsp[-4].minor.yy528);
176223
+ yymsp[-4].minor.yy2 = sqlite3PExpr(pParse, TK_CASE, yymsp[-3].minor.yy2, 0);
176224
+ if( yymsp[-4].minor.yy2 ){
176225
+ yymsp[-4].minor.yy2->x.pList = yymsp[-1].minor.yy2 ? sqlite3ExprListAppend(pParse,yymsp[-2].minor.yy402,yymsp[-1].minor.yy2) : yymsp[-2].minor.yy402;
176226
+ sqlite3ExprSetHeightAndFlags(pParse, yymsp[-4].minor.yy2);
175939176227
}else{
175940
- sqlite3ExprListDelete(pParse->db, yymsp[-2].minor.yy322);
175941
- sqlite3ExprDelete(pParse->db, yymsp[-1].minor.yy528);
176228
+ sqlite3ExprListDelete(pParse->db, yymsp[-2].minor.yy402);
176229
+ sqlite3ExprDelete(pParse->db, yymsp[-1].minor.yy2);
175942176230
}
175943176231
}
175944176232
break;
175945176233
case 227: /* case_exprlist ::= case_exprlist WHEN expr THEN expr */
175946176234
{
175947
- yymsp[-4].minor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy322, yymsp[-2].minor.yy528);
175948
- yymsp[-4].minor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy322, yymsp[0].minor.yy528);
176235
+ yymsp[-4].minor.yy402 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy402, yymsp[-2].minor.yy2);
176236
+ yymsp[-4].minor.yy402 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy402, yymsp[0].minor.yy2);
175949176237
}
175950176238
break;
175951176239
case 228: /* case_exprlist ::= WHEN expr THEN expr */
175952176240
{
175953
- yymsp[-3].minor.yy322 = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy528);
175954
- yymsp[-3].minor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-3].minor.yy322, yymsp[0].minor.yy528);
176241
+ yymsp[-3].minor.yy402 = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy2);
176242
+ yymsp[-3].minor.yy402 = sqlite3ExprListAppend(pParse,yymsp[-3].minor.yy402, yymsp[0].minor.yy2);
175955176243
}
175956176244
break;
175957176245
case 233: /* nexprlist ::= nexprlist COMMA expr */
175958
-{yymsp[-2].minor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-2].minor.yy322,yymsp[0].minor.yy528);}
176246
+{yymsp[-2].minor.yy402 = sqlite3ExprListAppend(pParse,yymsp[-2].minor.yy402,yymsp[0].minor.yy2);}
175959176247
break;
175960176248
case 234: /* nexprlist ::= expr */
175961
-{yymsp[0].minor.yy322 = sqlite3ExprListAppend(pParse,0,yymsp[0].minor.yy528); /*A-overwrites-Y*/}
176249
+{yymsp[0].minor.yy402 = sqlite3ExprListAppend(pParse,0,yymsp[0].minor.yy2); /*A-overwrites-Y*/}
175962176250
break;
175963176251
case 236: /* paren_exprlist ::= LP exprlist RP */
175964176252
case 241: /* eidlist_opt ::= LP eidlist RP */ yytestcase(yyruleno==241);
175965
-{yymsp[-2].minor.yy322 = yymsp[-1].minor.yy322;}
176253
+{yymsp[-2].minor.yy402 = yymsp[-1].minor.yy402;}
175966176254
break;
175967176255
case 237: /* cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP sortlist RP where_opt */
175968176256
{
175969176257
sqlite3CreateIndex(pParse, &yymsp[-7].minor.yy0, &yymsp[-6].minor.yy0,
175970
- sqlite3SrcListAppend(pParse,0,&yymsp[-4].minor.yy0,0), yymsp[-2].minor.yy322, yymsp[-10].minor.yy394,
175971
- &yymsp[-11].minor.yy0, yymsp[0].minor.yy528, SQLITE_SO_ASC, yymsp[-8].minor.yy394, SQLITE_IDXTYPE_APPDEF);
176258
+ sqlite3SrcListAppend(pParse,0,&yymsp[-4].minor.yy0,0), yymsp[-2].minor.yy402, yymsp[-10].minor.yy92,
176259
+ &yymsp[-11].minor.yy0, yymsp[0].minor.yy2, SQLITE_SO_ASC, yymsp[-8].minor.yy92, SQLITE_IDXTYPE_APPDEF);
175972176260
if( IN_RENAME_OBJECT && pParse->pNewIndex ){
175973176261
sqlite3RenameTokenMap(pParse, pParse->pNewIndex->zName, &yymsp[-4].minor.yy0);
175974176262
}
175975176263
}
175976176264
break;
175977176265
case 238: /* uniqueflag ::= UNIQUE */
175978176266
case 280: /* raisetype ::= ABORT */ yytestcase(yyruleno==280);
175979
-{yymsp[0].minor.yy394 = OE_Abort;}
176267
+{yymsp[0].minor.yy92 = OE_Abort;}
175980176268
break;
175981176269
case 239: /* uniqueflag ::= */
175982
-{yymsp[1].minor.yy394 = OE_None;}
176270
+{yymsp[1].minor.yy92 = OE_None;}
175983176271
break;
175984176272
case 242: /* eidlist ::= eidlist COMMA nm collate sortorder */
175985176273
{
175986
- yymsp[-4].minor.yy322 = parserAddExprIdListTerm(pParse, yymsp[-4].minor.yy322, &yymsp[-2].minor.yy0, yymsp[-1].minor.yy394, yymsp[0].minor.yy394);
176274
+ yymsp[-4].minor.yy402 = parserAddExprIdListTerm(pParse, yymsp[-4].minor.yy402, &yymsp[-2].minor.yy0, yymsp[-1].minor.yy92, yymsp[0].minor.yy92);
175987176275
}
175988176276
break;
175989176277
case 243: /* eidlist ::= nm collate sortorder */
175990176278
{
175991
- yymsp[-2].minor.yy322 = parserAddExprIdListTerm(pParse, 0, &yymsp[-2].minor.yy0, yymsp[-1].minor.yy394, yymsp[0].minor.yy394); /*A-overwrites-Y*/
176279
+ yymsp[-2].minor.yy402 = parserAddExprIdListTerm(pParse, 0, &yymsp[-2].minor.yy0, yymsp[-1].minor.yy92, yymsp[0].minor.yy92); /*A-overwrites-Y*/
175992176280
}
175993176281
break;
175994176282
case 246: /* cmd ::= DROP INDEX ifexists fullname */
175995
-{sqlite3DropIndex(pParse, yymsp[0].minor.yy131, yymsp[-1].minor.yy394);}
176283
+{sqlite3DropIndex(pParse, yymsp[0].minor.yy387, yymsp[-1].minor.yy92);}
175996176284
break;
175997176285
case 247: /* cmd ::= VACUUM vinto */
175998
-{sqlite3Vacuum(pParse,0,yymsp[0].minor.yy528);}
176286
+{sqlite3Vacuum(pParse,0,yymsp[0].minor.yy2);}
175999176287
break;
176000176288
case 248: /* cmd ::= VACUUM nm vinto */
176001
-{sqlite3Vacuum(pParse,&yymsp[-1].minor.yy0,yymsp[0].minor.yy528);}
176289
+{sqlite3Vacuum(pParse,&yymsp[-1].minor.yy0,yymsp[0].minor.yy2);}
176002176290
break;
176003176291
case 251: /* cmd ::= PRAGMA nm dbnm */
176004176292
{sqlite3Pragma(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,0,0);}
176005176293
break;
176006176294
case 252: /* cmd ::= PRAGMA nm dbnm EQ nmnum */
@@ -176018,54 +176306,54 @@
176018176306
case 258: /* cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END */
176019176307
{
176020176308
Token all;
176021176309
all.z = yymsp[-3].minor.yy0.z;
176022176310
all.n = (int)(yymsp[0].minor.yy0.z - yymsp[-3].minor.yy0.z) + yymsp[0].minor.yy0.n;
176023
- sqlite3FinishTrigger(pParse, yymsp[-1].minor.yy33, &all);
176311
+ sqlite3FinishTrigger(pParse, yymsp[-1].minor.yy347, &all);
176024176312
}
176025176313
break;
176026176314
case 259: /* trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause */
176027176315
{
176028
- sqlite3BeginTrigger(pParse, &yymsp[-7].minor.yy0, &yymsp[-6].minor.yy0, yymsp[-5].minor.yy394, yymsp[-4].minor.yy180.a, yymsp[-4].minor.yy180.b, yymsp[-2].minor.yy131, yymsp[0].minor.yy528, yymsp[-10].minor.yy394, yymsp[-8].minor.yy394);
176316
+ sqlite3BeginTrigger(pParse, &yymsp[-7].minor.yy0, &yymsp[-6].minor.yy0, yymsp[-5].minor.yy92, yymsp[-4].minor.yy210.a, yymsp[-4].minor.yy210.b, yymsp[-2].minor.yy387, yymsp[0].minor.yy2, yymsp[-10].minor.yy92, yymsp[-8].minor.yy92);
176029176317
yymsp[-10].minor.yy0 = (yymsp[-6].minor.yy0.n==0?yymsp[-7].minor.yy0:yymsp[-6].minor.yy0); /*A-overwrites-T*/
176030176318
}
176031176319
break;
176032176320
case 260: /* trigger_time ::= BEFORE|AFTER */
176033
-{ yymsp[0].minor.yy394 = yymsp[0].major; /*A-overwrites-X*/ }
176321
+{ yymsp[0].minor.yy92 = yymsp[0].major; /*A-overwrites-X*/ }
176034176322
break;
176035176323
case 261: /* trigger_time ::= INSTEAD OF */
176036
-{ yymsp[-1].minor.yy394 = TK_INSTEAD;}
176324
+{ yymsp[-1].minor.yy92 = TK_INSTEAD;}
176037176325
break;
176038176326
case 262: /* trigger_time ::= */
176039
-{ yymsp[1].minor.yy394 = TK_BEFORE; }
176327
+{ yymsp[1].minor.yy92 = TK_BEFORE; }
176040176328
break;
176041176329
case 263: /* trigger_event ::= DELETE|INSERT */
176042176330
case 264: /* trigger_event ::= UPDATE */ yytestcase(yyruleno==264);
176043
-{yymsp[0].minor.yy180.a = yymsp[0].major; /*A-overwrites-X*/ yymsp[0].minor.yy180.b = 0;}
176331
+{yymsp[0].minor.yy210.a = yymsp[0].major; /*A-overwrites-X*/ yymsp[0].minor.yy210.b = 0;}
176044176332
break;
176045176333
case 265: /* trigger_event ::= UPDATE OF idlist */
176046
-{yymsp[-2].minor.yy180.a = TK_UPDATE; yymsp[-2].minor.yy180.b = yymsp[0].minor.yy254;}
176334
+{yymsp[-2].minor.yy210.a = TK_UPDATE; yymsp[-2].minor.yy210.b = yymsp[0].minor.yy400;}
176047176335
break;
176048176336
case 266: /* when_clause ::= */
176049176337
case 285: /* key_opt ::= */ yytestcase(yyruleno==285);
176050
-{ yymsp[1].minor.yy528 = 0; }
176338
+{ yymsp[1].minor.yy2 = 0; }
176051176339
break;
176052176340
case 267: /* when_clause ::= WHEN expr */
176053176341
case 286: /* key_opt ::= KEY expr */ yytestcase(yyruleno==286);
176054
-{ yymsp[-1].minor.yy528 = yymsp[0].minor.yy528; }
176342
+{ yymsp[-1].minor.yy2 = yymsp[0].minor.yy2; }
176055176343
break;
176056176344
case 268: /* trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI */
176057176345
{
176058
- assert( yymsp[-2].minor.yy33!=0 );
176059
- yymsp[-2].minor.yy33->pLast->pNext = yymsp[-1].minor.yy33;
176060
- yymsp[-2].minor.yy33->pLast = yymsp[-1].minor.yy33;
176346
+ assert( yymsp[-2].minor.yy347!=0 );
176347
+ yymsp[-2].minor.yy347->pLast->pNext = yymsp[-1].minor.yy347;
176348
+ yymsp[-2].minor.yy347->pLast = yymsp[-1].minor.yy347;
176061176349
}
176062176350
break;
176063176351
case 269: /* trigger_cmd_list ::= trigger_cmd SEMI */
176064176352
{
176065
- assert( yymsp[-1].minor.yy33!=0 );
176066
- yymsp[-1].minor.yy33->pLast = yymsp[-1].minor.yy33;
176353
+ assert( yymsp[-1].minor.yy347!=0 );
176354
+ yymsp[-1].minor.yy347->pLast = yymsp[-1].minor.yy347;
176067176355
}
176068176356
break;
176069176357
case 270: /* trnm ::= nm DOT nm */
176070176358
{
176071176359
yymsp[-2].minor.yy0 = yymsp[0].minor.yy0;
@@ -176087,62 +176375,62 @@
176087176375
"the NOT INDEXED clause is not allowed on UPDATE or DELETE statements "
176088176376
"within triggers");
176089176377
}
176090176378
break;
176091176379
case 273: /* trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist from where_opt scanpt */
176092
-{yylhsminor.yy33 = sqlite3TriggerUpdateStep(pParse, &yymsp[-6].minor.yy0, yymsp[-2].minor.yy131, yymsp[-3].minor.yy322, yymsp[-1].minor.yy528, yymsp[-7].minor.yy394, yymsp[-8].minor.yy0.z, yymsp[0].minor.yy522);}
176093
- yymsp[-8].minor.yy33 = yylhsminor.yy33;
176380
+{yylhsminor.yy347 = sqlite3TriggerUpdateStep(pParse, &yymsp[-6].minor.yy0, yymsp[-2].minor.yy387, yymsp[-3].minor.yy402, yymsp[-1].minor.yy2, yymsp[-7].minor.yy92, yymsp[-8].minor.yy0.z, yymsp[0].minor.yy616);}
176381
+ yymsp[-8].minor.yy347 = yylhsminor.yy347;
176094176382
break;
176095176383
case 274: /* trigger_cmd ::= scanpt insert_cmd INTO trnm idlist_opt select upsert scanpt */
176096176384
{
176097
- yylhsminor.yy33 = sqlite3TriggerInsertStep(pParse,&yymsp[-4].minor.yy0,yymsp[-3].minor.yy254,yymsp[-2].minor.yy47,yymsp[-6].minor.yy394,yymsp[-1].minor.yy444,yymsp[-7].minor.yy522,yymsp[0].minor.yy522);/*yylhsminor.yy33-overwrites-yymsp[-6].minor.yy394*/
176385
+ yylhsminor.yy347 = sqlite3TriggerInsertStep(pParse,&yymsp[-4].minor.yy0,yymsp[-3].minor.yy400,yymsp[-2].minor.yy299,yymsp[-6].minor.yy92,yymsp[-1].minor.yy258,yymsp[-7].minor.yy616,yymsp[0].minor.yy616);/*yylhsminor.yy347-overwrites-yymsp[-6].minor.yy92*/
176098176386
}
176099
- yymsp[-7].minor.yy33 = yylhsminor.yy33;
176387
+ yymsp[-7].minor.yy347 = yylhsminor.yy347;
176100176388
break;
176101176389
case 275: /* trigger_cmd ::= DELETE FROM trnm tridxby where_opt scanpt */
176102
-{yylhsminor.yy33 = sqlite3TriggerDeleteStep(pParse, &yymsp[-3].minor.yy0, yymsp[-1].minor.yy528, yymsp[-5].minor.yy0.z, yymsp[0].minor.yy522);}
176103
- yymsp[-5].minor.yy33 = yylhsminor.yy33;
176390
+{yylhsminor.yy347 = sqlite3TriggerDeleteStep(pParse, &yymsp[-3].minor.yy0, yymsp[-1].minor.yy2, yymsp[-5].minor.yy0.z, yymsp[0].minor.yy616);}
176391
+ yymsp[-5].minor.yy347 = yylhsminor.yy347;
176104176392
break;
176105176393
case 276: /* trigger_cmd ::= scanpt select scanpt */
176106
-{yylhsminor.yy33 = sqlite3TriggerSelectStep(pParse->db, yymsp[-1].minor.yy47, yymsp[-2].minor.yy522, yymsp[0].minor.yy522); /*yylhsminor.yy33-overwrites-yymsp[-1].minor.yy47*/}
176107
- yymsp[-2].minor.yy33 = yylhsminor.yy33;
176394
+{yylhsminor.yy347 = sqlite3TriggerSelectStep(pParse->db, yymsp[-1].minor.yy299, yymsp[-2].minor.yy616, yymsp[0].minor.yy616); /*yylhsminor.yy347-overwrites-yymsp[-1].minor.yy299*/}
176395
+ yymsp[-2].minor.yy347 = yylhsminor.yy347;
176108176396
break;
176109176397
case 277: /* expr ::= RAISE LP IGNORE RP */
176110176398
{
176111
- yymsp[-3].minor.yy528 = sqlite3PExpr(pParse, TK_RAISE, 0, 0);
176112
- if( yymsp[-3].minor.yy528 ){
176113
- yymsp[-3].minor.yy528->affExpr = OE_Ignore;
176399
+ yymsp[-3].minor.yy2 = sqlite3PExpr(pParse, TK_RAISE, 0, 0);
176400
+ if( yymsp[-3].minor.yy2 ){
176401
+ yymsp[-3].minor.yy2->affExpr = OE_Ignore;
176114176402
}
176115176403
}
176116176404
break;
176117176405
case 278: /* expr ::= RAISE LP raisetype COMMA nm RP */
176118176406
{
176119
- yymsp[-5].minor.yy528 = sqlite3ExprAlloc(pParse->db, TK_RAISE, &yymsp[-1].minor.yy0, 1);
176120
- if( yymsp[-5].minor.yy528 ) {
176121
- yymsp[-5].minor.yy528->affExpr = (char)yymsp[-3].minor.yy394;
176407
+ yymsp[-5].minor.yy2 = sqlite3ExprAlloc(pParse->db, TK_RAISE, &yymsp[-1].minor.yy0, 1);
176408
+ if( yymsp[-5].minor.yy2 ) {
176409
+ yymsp[-5].minor.yy2->affExpr = (char)yymsp[-3].minor.yy92;
176122176410
}
176123176411
}
176124176412
break;
176125176413
case 279: /* raisetype ::= ROLLBACK */
176126
-{yymsp[0].minor.yy394 = OE_Rollback;}
176414
+{yymsp[0].minor.yy92 = OE_Rollback;}
176127176415
break;
176128176416
case 281: /* raisetype ::= FAIL */
176129
-{yymsp[0].minor.yy394 = OE_Fail;}
176417
+{yymsp[0].minor.yy92 = OE_Fail;}
176130176418
break;
176131176419
case 282: /* cmd ::= DROP TRIGGER ifexists fullname */
176132176420
{
176133
- sqlite3DropTrigger(pParse,yymsp[0].minor.yy131,yymsp[-1].minor.yy394);
176421
+ sqlite3DropTrigger(pParse,yymsp[0].minor.yy387,yymsp[-1].minor.yy92);
176134176422
}
176135176423
break;
176136176424
case 283: /* cmd ::= ATTACH database_kw_opt expr AS expr key_opt */
176137176425
{
176138
- sqlite3Attach(pParse, yymsp[-3].minor.yy528, yymsp[-1].minor.yy528, yymsp[0].minor.yy528);
176426
+ sqlite3Attach(pParse, yymsp[-3].minor.yy2, yymsp[-1].minor.yy2, yymsp[0].minor.yy2);
176139176427
}
176140176428
break;
176141176429
case 284: /* cmd ::= DETACH database_kw_opt expr */
176142176430
{
176143
- sqlite3Detach(pParse, yymsp[0].minor.yy528);
176431
+ sqlite3Detach(pParse, yymsp[0].minor.yy2);
176144176432
}
176145176433
break;
176146176434
case 287: /* cmd ::= REINDEX */
176147176435
{sqlite3Reindex(pParse, 0, 0);}
176148176436
break;
@@ -176155,11 +176443,11 @@
176155176443
case 290: /* cmd ::= ANALYZE nm dbnm */
176156176444
{sqlite3Analyze(pParse, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0);}
176157176445
break;
176158176446
case 291: /* cmd ::= ALTER TABLE fullname RENAME TO nm */
176159176447
{
176160
- sqlite3AlterRenameTable(pParse,yymsp[-3].minor.yy131,&yymsp[0].minor.yy0);
176448
+ sqlite3AlterRenameTable(pParse,yymsp[-3].minor.yy387,&yymsp[0].minor.yy0);
176161176449
}
176162176450
break;
176163176451
case 292: /* cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt columnname carglist */
176164176452
{
176165176453
yymsp[-1].minor.yy0.n = (int)(pParse->sLastToken.z-yymsp[-1].minor.yy0.z) + pParse->sLastToken.n;
@@ -176166,22 +176454,22 @@
176166176454
sqlite3AlterFinishAddColumn(pParse, &yymsp[-1].minor.yy0);
176167176455
}
176168176456
break;
176169176457
case 293: /* cmd ::= ALTER TABLE fullname DROP kwcolumn_opt nm */
176170176458
{
176171
- sqlite3AlterDropColumn(pParse, yymsp[-3].minor.yy131, &yymsp[0].minor.yy0);
176459
+ sqlite3AlterDropColumn(pParse, yymsp[-3].minor.yy387, &yymsp[0].minor.yy0);
176172176460
}
176173176461
break;
176174176462
case 294: /* add_column_fullname ::= fullname */
176175176463
{
176176176464
disableLookaside(pParse);
176177
- sqlite3AlterBeginAddColumn(pParse, yymsp[0].minor.yy131);
176465
+ sqlite3AlterBeginAddColumn(pParse, yymsp[0].minor.yy387);
176178176466
}
176179176467
break;
176180176468
case 295: /* cmd ::= ALTER TABLE fullname RENAME kwcolumn_opt nm TO nm */
176181176469
{
176182
- sqlite3AlterRenameColumn(pParse, yymsp[-5].minor.yy131, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0);
176470
+ sqlite3AlterRenameColumn(pParse, yymsp[-5].minor.yy387, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0);
176183176471
}
176184176472
break;
176185176473
case 296: /* cmd ::= create_vtab */
176186176474
{sqlite3VtabFinishParse(pParse,0);}
176187176475
break;
@@ -176188,11 +176476,11 @@
176188176476
case 297: /* cmd ::= create_vtab LP vtabarglist RP */
176189176477
{sqlite3VtabFinishParse(pParse,&yymsp[0].minor.yy0);}
176190176478
break;
176191176479
case 298: /* create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm */
176192176480
{
176193
- sqlite3VtabBeginParse(pParse, &yymsp[-3].minor.yy0, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-4].minor.yy394);
176481
+ sqlite3VtabBeginParse(pParse, &yymsp[-3].minor.yy0, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-4].minor.yy92);
176194176482
}
176195176483
break;
176196176484
case 299: /* vtabarg ::= */
176197176485
{sqlite3VtabArgInit(pParse);}
176198176486
break;
@@ -176201,242 +176489,249 @@
176201176489
case 302: /* lp ::= LP */ yytestcase(yyruleno==302);
176202176490
{sqlite3VtabArgExtend(pParse,&yymsp[0].minor.yy0);}
176203176491
break;
176204176492
case 303: /* with ::= WITH wqlist */
176205176493
case 304: /* with ::= WITH RECURSIVE wqlist */ yytestcase(yyruleno==304);
176206
-{ sqlite3WithPush(pParse, yymsp[0].minor.yy521, 1); }
176494
+{ sqlite3WithPush(pParse, yymsp[0].minor.yy131, 1); }
176207176495
break;
176208176496
case 305: /* wqas ::= AS */
176209
-{yymsp[0].minor.yy516 = M10d_Any;}
176497
+{yymsp[0].minor.yy498 = M10d_Any;}
176210176498
break;
176211176499
case 306: /* wqas ::= AS MATERIALIZED */
176212
-{yymsp[-1].minor.yy516 = M10d_Yes;}
176500
+{yymsp[-1].minor.yy498 = M10d_Yes;}
176213176501
break;
176214176502
case 307: /* wqas ::= AS NOT MATERIALIZED */
176215
-{yymsp[-2].minor.yy516 = M10d_No;}
176503
+{yymsp[-2].minor.yy498 = M10d_No;}
176216176504
break;
176217176505
case 308: /* wqitem ::= nm eidlist_opt wqas LP select RP */
176218176506
{
176219
- yymsp[-5].minor.yy385 = sqlite3CteNew(pParse, &yymsp[-5].minor.yy0, yymsp[-4].minor.yy322, yymsp[-1].minor.yy47, yymsp[-3].minor.yy516); /*A-overwrites-X*/
176507
+ yymsp[-5].minor.yy79 = sqlite3CteNew(pParse, &yymsp[-5].minor.yy0, yymsp[-4].minor.yy402, yymsp[-1].minor.yy299, yymsp[-3].minor.yy498); /*A-overwrites-X*/
176220176508
}
176221176509
break;
176222176510
case 309: /* wqlist ::= wqitem */
176223176511
{
176224
- yymsp[0].minor.yy521 = sqlite3WithAdd(pParse, 0, yymsp[0].minor.yy385); /*A-overwrites-X*/
176512
+ yymsp[0].minor.yy131 = sqlite3WithAdd(pParse, 0, yymsp[0].minor.yy79); /*A-overwrites-X*/
176225176513
}
176226176514
break;
176227176515
case 310: /* wqlist ::= wqlist COMMA wqitem */
176228176516
{
176229
- yymsp[-2].minor.yy521 = sqlite3WithAdd(pParse, yymsp[-2].minor.yy521, yymsp[0].minor.yy385);
176517
+ yymsp[-2].minor.yy131 = sqlite3WithAdd(pParse, yymsp[-2].minor.yy131, yymsp[0].minor.yy79);
176230176518
}
176231176519
break;
176232176520
case 311: /* windowdefn_list ::= windowdefn_list COMMA windowdefn */
176233176521
{
176234
- assert( yymsp[0].minor.yy41!=0 );
176235
- sqlite3WindowChain(pParse, yymsp[0].minor.yy41, yymsp[-2].minor.yy41);
176236
- yymsp[0].minor.yy41->pNextWin = yymsp[-2].minor.yy41;
176237
- yylhsminor.yy41 = yymsp[0].minor.yy41;
176522
+ assert( yymsp[0].minor.yy3!=0 );
176523
+ sqlite3WindowChain(pParse, yymsp[0].minor.yy3, yymsp[-2].minor.yy3);
176524
+ yymsp[0].minor.yy3->pNextWin = yymsp[-2].minor.yy3;
176525
+ yylhsminor.yy3 = yymsp[0].minor.yy3;
176238176526
}
176239
- yymsp[-2].minor.yy41 = yylhsminor.yy41;
176527
+ yymsp[-2].minor.yy3 = yylhsminor.yy3;
176240176528
break;
176241176529
case 312: /* windowdefn ::= nm AS LP window RP */
176242176530
{
176243
- if( ALWAYS(yymsp[-1].minor.yy41) ){
176244
- yymsp[-1].minor.yy41->zName = sqlite3DbStrNDup(pParse->db, yymsp[-4].minor.yy0.z, yymsp[-4].minor.yy0.n);
176531
+ if( ALWAYS(yymsp[-1].minor.yy3) ){
176532
+ yymsp[-1].minor.yy3->zName = sqlite3DbStrNDup(pParse->db, yymsp[-4].minor.yy0.z, yymsp[-4].minor.yy0.n);
176245176533
}
176246
- yylhsminor.yy41 = yymsp[-1].minor.yy41;
176534
+ yylhsminor.yy3 = yymsp[-1].minor.yy3;
176247176535
}
176248
- yymsp[-4].minor.yy41 = yylhsminor.yy41;
176536
+ yymsp[-4].minor.yy3 = yylhsminor.yy3;
176249176537
break;
176250176538
case 313: /* window ::= PARTITION BY nexprlist orderby_opt frame_opt */
176251176539
{
176252
- yymsp[-4].minor.yy41 = sqlite3WindowAssemble(pParse, yymsp[0].minor.yy41, yymsp[-2].minor.yy322, yymsp[-1].minor.yy322, 0);
176540
+ yymsp[-4].minor.yy3 = sqlite3WindowAssemble(pParse, yymsp[0].minor.yy3, yymsp[-2].minor.yy402, yymsp[-1].minor.yy402, 0);
176253176541
}
176254176542
break;
176255176543
case 314: /* window ::= nm PARTITION BY nexprlist orderby_opt frame_opt */
176256176544
{
176257
- yylhsminor.yy41 = sqlite3WindowAssemble(pParse, yymsp[0].minor.yy41, yymsp[-2].minor.yy322, yymsp[-1].minor.yy322, &yymsp[-5].minor.yy0);
176545
+ yylhsminor.yy3 = sqlite3WindowAssemble(pParse, yymsp[0].minor.yy3, yymsp[-2].minor.yy402, yymsp[-1].minor.yy402, &yymsp[-5].minor.yy0);
176258176546
}
176259
- yymsp[-5].minor.yy41 = yylhsminor.yy41;
176547
+ yymsp[-5].minor.yy3 = yylhsminor.yy3;
176260176548
break;
176261176549
case 315: /* window ::= ORDER BY sortlist frame_opt */
176262176550
{
176263
- yymsp[-3].minor.yy41 = sqlite3WindowAssemble(pParse, yymsp[0].minor.yy41, 0, yymsp[-1].minor.yy322, 0);
176551
+ yymsp[-3].minor.yy3 = sqlite3WindowAssemble(pParse, yymsp[0].minor.yy3, 0, yymsp[-1].minor.yy402, 0);
176264176552
}
176265176553
break;
176266176554
case 316: /* window ::= nm ORDER BY sortlist frame_opt */
176267176555
{
176268
- yylhsminor.yy41 = sqlite3WindowAssemble(pParse, yymsp[0].minor.yy41, 0, yymsp[-1].minor.yy322, &yymsp[-4].minor.yy0);
176556
+ yylhsminor.yy3 = sqlite3WindowAssemble(pParse, yymsp[0].minor.yy3, 0, yymsp[-1].minor.yy402, &yymsp[-4].minor.yy0);
176269176557
}
176270
- yymsp[-4].minor.yy41 = yylhsminor.yy41;
176558
+ yymsp[-4].minor.yy3 = yylhsminor.yy3;
176271176559
break;
176272176560
case 317: /* window ::= nm frame_opt */
176273176561
{
176274
- yylhsminor.yy41 = sqlite3WindowAssemble(pParse, yymsp[0].minor.yy41, 0, 0, &yymsp[-1].minor.yy0);
176562
+ yylhsminor.yy3 = sqlite3WindowAssemble(pParse, yymsp[0].minor.yy3, 0, 0, &yymsp[-1].minor.yy0);
176275176563
}
176276
- yymsp[-1].minor.yy41 = yylhsminor.yy41;
176564
+ yymsp[-1].minor.yy3 = yylhsminor.yy3;
176277176565
break;
176278176566
case 318: /* frame_opt ::= */
176279176567
{
176280
- yymsp[1].minor.yy41 = sqlite3WindowAlloc(pParse, 0, TK_UNBOUNDED, 0, TK_CURRENT, 0, 0);
176568
+ yymsp[1].minor.yy3 = sqlite3WindowAlloc(pParse, 0, TK_UNBOUNDED, 0, TK_CURRENT, 0, 0);
176281176569
}
176282176570
break;
176283176571
case 319: /* frame_opt ::= range_or_rows frame_bound_s frame_exclude_opt */
176284176572
{
176285
- yylhsminor.yy41 = sqlite3WindowAlloc(pParse, yymsp[-2].minor.yy394, yymsp[-1].minor.yy595.eType, yymsp[-1].minor.yy595.pExpr, TK_CURRENT, 0, yymsp[0].minor.yy516);
176573
+ yylhsminor.yy3 = sqlite3WindowAlloc(pParse, yymsp[-2].minor.yy92, yymsp[-1].minor.yy337.eType, yymsp[-1].minor.yy337.pExpr, TK_CURRENT, 0, yymsp[0].minor.yy498);
176286176574
}
176287
- yymsp[-2].minor.yy41 = yylhsminor.yy41;
176575
+ yymsp[-2].minor.yy3 = yylhsminor.yy3;
176288176576
break;
176289176577
case 320: /* frame_opt ::= range_or_rows BETWEEN frame_bound_s AND frame_bound_e frame_exclude_opt */
176290176578
{
176291
- yylhsminor.yy41 = sqlite3WindowAlloc(pParse, yymsp[-5].minor.yy394, yymsp[-3].minor.yy595.eType, yymsp[-3].minor.yy595.pExpr, yymsp[-1].minor.yy595.eType, yymsp[-1].minor.yy595.pExpr, yymsp[0].minor.yy516);
176579
+ yylhsminor.yy3 = sqlite3WindowAlloc(pParse, yymsp[-5].minor.yy92, yymsp[-3].minor.yy337.eType, yymsp[-3].minor.yy337.pExpr, yymsp[-1].minor.yy337.eType, yymsp[-1].minor.yy337.pExpr, yymsp[0].minor.yy498);
176292176580
}
176293
- yymsp[-5].minor.yy41 = yylhsminor.yy41;
176581
+ yymsp[-5].minor.yy3 = yylhsminor.yy3;
176294176582
break;
176295176583
case 322: /* frame_bound_s ::= frame_bound */
176296176584
case 324: /* frame_bound_e ::= frame_bound */ yytestcase(yyruleno==324);
176297
-{yylhsminor.yy595 = yymsp[0].minor.yy595;}
176298
- yymsp[0].minor.yy595 = yylhsminor.yy595;
176585
+{yylhsminor.yy337 = yymsp[0].minor.yy337;}
176586
+ yymsp[0].minor.yy337 = yylhsminor.yy337;
176299176587
break;
176300176588
case 323: /* frame_bound_s ::= UNBOUNDED PRECEDING */
176301176589
case 325: /* frame_bound_e ::= UNBOUNDED FOLLOWING */ yytestcase(yyruleno==325);
176302176590
case 327: /* frame_bound ::= CURRENT ROW */ yytestcase(yyruleno==327);
176303
-{yylhsminor.yy595.eType = yymsp[-1].major; yylhsminor.yy595.pExpr = 0;}
176304
- yymsp[-1].minor.yy595 = yylhsminor.yy595;
176591
+{yylhsminor.yy337.eType = yymsp[-1].major; yylhsminor.yy337.pExpr = 0;}
176592
+ yymsp[-1].minor.yy337 = yylhsminor.yy337;
176305176593
break;
176306176594
case 326: /* frame_bound ::= expr PRECEDING|FOLLOWING */
176307
-{yylhsminor.yy595.eType = yymsp[0].major; yylhsminor.yy595.pExpr = yymsp[-1].minor.yy528;}
176308
- yymsp[-1].minor.yy595 = yylhsminor.yy595;
176595
+{yylhsminor.yy337.eType = yymsp[0].major; yylhsminor.yy337.pExpr = yymsp[-1].minor.yy2;}
176596
+ yymsp[-1].minor.yy337 = yylhsminor.yy337;
176309176597
break;
176310176598
case 328: /* frame_exclude_opt ::= */
176311
-{yymsp[1].minor.yy516 = 0;}
176599
+{yymsp[1].minor.yy498 = 0;}
176312176600
break;
176313176601
case 329: /* frame_exclude_opt ::= EXCLUDE frame_exclude */
176314
-{yymsp[-1].minor.yy516 = yymsp[0].minor.yy516;}
176602
+{yymsp[-1].minor.yy498 = yymsp[0].minor.yy498;}
176315176603
break;
176316176604
case 330: /* frame_exclude ::= NO OTHERS */
176317176605
case 331: /* frame_exclude ::= CURRENT ROW */ yytestcase(yyruleno==331);
176318
-{yymsp[-1].minor.yy516 = yymsp[-1].major; /*A-overwrites-X*/}
176606
+{yymsp[-1].minor.yy498 = yymsp[-1].major; /*A-overwrites-X*/}
176319176607
break;
176320176608
case 332: /* frame_exclude ::= GROUP|TIES */
176321
-{yymsp[0].minor.yy516 = yymsp[0].major; /*A-overwrites-X*/}
176609
+{yymsp[0].minor.yy498 = yymsp[0].major; /*A-overwrites-X*/}
176322176610
break;
176323176611
case 333: /* window_clause ::= WINDOW windowdefn_list */
176324
-{ yymsp[-1].minor.yy41 = yymsp[0].minor.yy41; }
176612
+{ yymsp[-1].minor.yy3 = yymsp[0].minor.yy3; }
176325176613
break;
176326176614
case 334: /* filter_over ::= filter_clause over_clause */
176327176615
{
176328
- if( yymsp[0].minor.yy41 ){
176329
- yymsp[0].minor.yy41->pFilter = yymsp[-1].minor.yy528;
176616
+ if( yymsp[0].minor.yy3 ){
176617
+ yymsp[0].minor.yy3->pFilter = yymsp[-1].minor.yy2;
176330176618
}else{
176331
- sqlite3ExprDelete(pParse->db, yymsp[-1].minor.yy528);
176619
+ sqlite3ExprDelete(pParse->db, yymsp[-1].minor.yy2);
176332176620
}
176333
- yylhsminor.yy41 = yymsp[0].minor.yy41;
176621
+ yylhsminor.yy3 = yymsp[0].minor.yy3;
176334176622
}
176335
- yymsp[-1].minor.yy41 = yylhsminor.yy41;
176623
+ yymsp[-1].minor.yy3 = yylhsminor.yy3;
176336176624
break;
176337176625
case 335: /* filter_over ::= over_clause */
176338176626
{
176339
- yylhsminor.yy41 = yymsp[0].minor.yy41;
176627
+ yylhsminor.yy3 = yymsp[0].minor.yy3;
176340176628
}
176341
- yymsp[0].minor.yy41 = yylhsminor.yy41;
176629
+ yymsp[0].minor.yy3 = yylhsminor.yy3;
176342176630
break;
176343176631
case 336: /* filter_over ::= filter_clause */
176344176632
{
176345
- yylhsminor.yy41 = (Window*)sqlite3DbMallocZero(pParse->db, sizeof(Window));
176346
- if( yylhsminor.yy41 ){
176347
- yylhsminor.yy41->eFrmType = TK_FILTER;
176348
- yylhsminor.yy41->pFilter = yymsp[0].minor.yy528;
176633
+ yylhsminor.yy3 = (Window*)sqlite3DbMallocZero(pParse->db, sizeof(Window));
176634
+ if( yylhsminor.yy3 ){
176635
+ yylhsminor.yy3->eFrmType = TK_FILTER;
176636
+ yylhsminor.yy3->pFilter = yymsp[0].minor.yy2;
176349176637
}else{
176350
- sqlite3ExprDelete(pParse->db, yymsp[0].minor.yy528);
176638
+ sqlite3ExprDelete(pParse->db, yymsp[0].minor.yy2);
176351176639
}
176352176640
}
176353
- yymsp[0].minor.yy41 = yylhsminor.yy41;
176641
+ yymsp[0].minor.yy3 = yylhsminor.yy3;
176354176642
break;
176355176643
case 337: /* over_clause ::= OVER LP window RP */
176356176644
{
176357
- yymsp[-3].minor.yy41 = yymsp[-1].minor.yy41;
176358
- assert( yymsp[-3].minor.yy41!=0 );
176645
+ yymsp[-3].minor.yy3 = yymsp[-1].minor.yy3;
176646
+ assert( yymsp[-3].minor.yy3!=0 );
176359176647
}
176360176648
break;
176361176649
case 338: /* over_clause ::= OVER nm */
176362176650
{
176363
- yymsp[-1].minor.yy41 = (Window*)sqlite3DbMallocZero(pParse->db, sizeof(Window));
176364
- if( yymsp[-1].minor.yy41 ){
176365
- yymsp[-1].minor.yy41->zName = sqlite3DbStrNDup(pParse->db, yymsp[0].minor.yy0.z, yymsp[0].minor.yy0.n);
176651
+ yymsp[-1].minor.yy3 = (Window*)sqlite3DbMallocZero(pParse->db, sizeof(Window));
176652
+ if( yymsp[-1].minor.yy3 ){
176653
+ yymsp[-1].minor.yy3->zName = sqlite3DbStrNDup(pParse->db, yymsp[0].minor.yy0.z, yymsp[0].minor.yy0.n);
176366176654
}
176367176655
}
176368176656
break;
176369176657
case 339: /* filter_clause ::= FILTER LP WHERE expr RP */
176370
-{ yymsp[-4].minor.yy528 = yymsp[-1].minor.yy528; }
176658
+{ yymsp[-4].minor.yy2 = yymsp[-1].minor.yy2; }
176659
+ break;
176660
+ case 340: /* term ::= QNUMBER */
176661
+{
176662
+ yylhsminor.yy2=tokenExpr(pParse,yymsp[0].major,yymsp[0].minor.yy0);
176663
+ sqlite3DequoteNumber(pParse, yylhsminor.yy2);
176664
+}
176665
+ yymsp[0].minor.yy2 = yylhsminor.yy2;
176371176666
break;
176372176667
default:
176373
- /* (340) input ::= cmdlist */ yytestcase(yyruleno==340);
176374
- /* (341) cmdlist ::= cmdlist ecmd */ yytestcase(yyruleno==341);
176375
- /* (342) cmdlist ::= ecmd (OPTIMIZED OUT) */ assert(yyruleno!=342);
176376
- /* (343) ecmd ::= SEMI */ yytestcase(yyruleno==343);
176377
- /* (344) ecmd ::= cmdx SEMI */ yytestcase(yyruleno==344);
176378
- /* (345) ecmd ::= explain cmdx SEMI (NEVER REDUCES) */ assert(yyruleno!=345);
176379
- /* (346) trans_opt ::= */ yytestcase(yyruleno==346);
176380
- /* (347) trans_opt ::= TRANSACTION */ yytestcase(yyruleno==347);
176381
- /* (348) trans_opt ::= TRANSACTION nm */ yytestcase(yyruleno==348);
176382
- /* (349) savepoint_opt ::= SAVEPOINT */ yytestcase(yyruleno==349);
176383
- /* (350) savepoint_opt ::= */ yytestcase(yyruleno==350);
176384
- /* (351) cmd ::= create_table create_table_args */ yytestcase(yyruleno==351);
176385
- /* (352) table_option_set ::= table_option (OPTIMIZED OUT) */ assert(yyruleno!=352);
176386
- /* (353) columnlist ::= columnlist COMMA columnname carglist */ yytestcase(yyruleno==353);
176387
- /* (354) columnlist ::= columnname carglist */ yytestcase(yyruleno==354);
176388
- /* (355) nm ::= ID|INDEXED|JOIN_KW */ yytestcase(yyruleno==355);
176389
- /* (356) nm ::= STRING */ yytestcase(yyruleno==356);
176390
- /* (357) typetoken ::= typename */ yytestcase(yyruleno==357);
176391
- /* (358) typename ::= ID|STRING */ yytestcase(yyruleno==358);
176392
- /* (359) signed ::= plus_num (OPTIMIZED OUT) */ assert(yyruleno!=359);
176393
- /* (360) signed ::= minus_num (OPTIMIZED OUT) */ assert(yyruleno!=360);
176394
- /* (361) carglist ::= carglist ccons */ yytestcase(yyruleno==361);
176395
- /* (362) carglist ::= */ yytestcase(yyruleno==362);
176396
- /* (363) ccons ::= NULL onconf */ yytestcase(yyruleno==363);
176397
- /* (364) ccons ::= GENERATED ALWAYS AS generated */ yytestcase(yyruleno==364);
176398
- /* (365) ccons ::= AS generated */ yytestcase(yyruleno==365);
176399
- /* (366) conslist_opt ::= COMMA conslist */ yytestcase(yyruleno==366);
176400
- /* (367) conslist ::= conslist tconscomma tcons */ yytestcase(yyruleno==367);
176401
- /* (368) conslist ::= tcons (OPTIMIZED OUT) */ assert(yyruleno!=368);
176402
- /* (369) tconscomma ::= */ yytestcase(yyruleno==369);
176403
- /* (370) defer_subclause_opt ::= defer_subclause (OPTIMIZED OUT) */ assert(yyruleno!=370);
176404
- /* (371) resolvetype ::= raisetype (OPTIMIZED OUT) */ assert(yyruleno!=371);
176405
- /* (372) selectnowith ::= oneselect (OPTIMIZED OUT) */ assert(yyruleno!=372);
176406
- /* (373) oneselect ::= values */ yytestcase(yyruleno==373);
176407
- /* (374) sclp ::= selcollist COMMA */ yytestcase(yyruleno==374);
176408
- /* (375) as ::= ID|STRING */ yytestcase(yyruleno==375);
176409
- /* (376) indexed_opt ::= indexed_by (OPTIMIZED OUT) */ assert(yyruleno!=376);
176410
- /* (377) returning ::= */ yytestcase(yyruleno==377);
176411
- /* (378) expr ::= term (OPTIMIZED OUT) */ assert(yyruleno!=378);
176412
- /* (379) likeop ::= LIKE_KW|MATCH */ yytestcase(yyruleno==379);
176413
- /* (380) case_operand ::= expr */ yytestcase(yyruleno==380);
176414
- /* (381) exprlist ::= nexprlist */ yytestcase(yyruleno==381);
176415
- /* (382) nmnum ::= plus_num (OPTIMIZED OUT) */ assert(yyruleno!=382);
176416
- /* (383) nmnum ::= nm (OPTIMIZED OUT) */ assert(yyruleno!=383);
176417
- /* (384) nmnum ::= ON */ yytestcase(yyruleno==384);
176418
- /* (385) nmnum ::= DELETE */ yytestcase(yyruleno==385);
176419
- /* (386) nmnum ::= DEFAULT */ yytestcase(yyruleno==386);
176420
- /* (387) plus_num ::= INTEGER|FLOAT */ yytestcase(yyruleno==387);
176421
- /* (388) foreach_clause ::= */ yytestcase(yyruleno==388);
176422
- /* (389) foreach_clause ::= FOR EACH ROW */ yytestcase(yyruleno==389);
176423
- /* (390) trnm ::= nm */ yytestcase(yyruleno==390);
176424
- /* (391) tridxby ::= */ yytestcase(yyruleno==391);
176425
- /* (392) database_kw_opt ::= DATABASE */ yytestcase(yyruleno==392);
176426
- /* (393) database_kw_opt ::= */ yytestcase(yyruleno==393);
176427
- /* (394) kwcolumn_opt ::= */ yytestcase(yyruleno==394);
176428
- /* (395) kwcolumn_opt ::= COLUMNKW */ yytestcase(yyruleno==395);
176429
- /* (396) vtabarglist ::= vtabarg */ yytestcase(yyruleno==396);
176430
- /* (397) vtabarglist ::= vtabarglist COMMA vtabarg */ yytestcase(yyruleno==397);
176431
- /* (398) vtabarg ::= vtabarg vtabargtoken */ yytestcase(yyruleno==398);
176432
- /* (399) anylist ::= */ yytestcase(yyruleno==399);
176433
- /* (400) anylist ::= anylist LP anylist RP */ yytestcase(yyruleno==400);
176434
- /* (401) anylist ::= anylist ANY */ yytestcase(yyruleno==401);
176435
- /* (402) with ::= */ yytestcase(yyruleno==402);
176436
- /* (403) windowdefn_list ::= windowdefn (OPTIMIZED OUT) */ assert(yyruleno!=403);
176437
- /* (404) window ::= frame_opt (OPTIMIZED OUT) */ assert(yyruleno!=404);
176668
+ /* (341) input ::= cmdlist */ yytestcase(yyruleno==341);
176669
+ /* (342) cmdlist ::= cmdlist ecmd */ yytestcase(yyruleno==342);
176670
+ /* (343) cmdlist ::= ecmd (OPTIMIZED OUT) */ assert(yyruleno!=343);
176671
+ /* (344) ecmd ::= SEMI */ yytestcase(yyruleno==344);
176672
+ /* (345) ecmd ::= cmdx SEMI */ yytestcase(yyruleno==345);
176673
+ /* (346) ecmd ::= explain cmdx SEMI (NEVER REDUCES) */ assert(yyruleno!=346);
176674
+ /* (347) trans_opt ::= */ yytestcase(yyruleno==347);
176675
+ /* (348) trans_opt ::= TRANSACTION */ yytestcase(yyruleno==348);
176676
+ /* (349) trans_opt ::= TRANSACTION nm */ yytestcase(yyruleno==349);
176677
+ /* (350) savepoint_opt ::= SAVEPOINT */ yytestcase(yyruleno==350);
176678
+ /* (351) savepoint_opt ::= */ yytestcase(yyruleno==351);
176679
+ /* (352) cmd ::= create_table create_table_args */ yytestcase(yyruleno==352);
176680
+ /* (353) table_option_set ::= table_option (OPTIMIZED OUT) */ assert(yyruleno!=353);
176681
+ /* (354) columnlist ::= columnlist COMMA columnname carglist */ yytestcase(yyruleno==354);
176682
+ /* (355) columnlist ::= columnname carglist */ yytestcase(yyruleno==355);
176683
+ /* (356) nm ::= ID|INDEXED|JOIN_KW */ yytestcase(yyruleno==356);
176684
+ /* (357) nm ::= STRING */ yytestcase(yyruleno==357);
176685
+ /* (358) typetoken ::= typename */ yytestcase(yyruleno==358);
176686
+ /* (359) typename ::= ID|STRING */ yytestcase(yyruleno==359);
176687
+ /* (360) signed ::= plus_num (OPTIMIZED OUT) */ assert(yyruleno!=360);
176688
+ /* (361) signed ::= minus_num (OPTIMIZED OUT) */ assert(yyruleno!=361);
176689
+ /* (362) carglist ::= carglist ccons */ yytestcase(yyruleno==362);
176690
+ /* (363) carglist ::= */ yytestcase(yyruleno==363);
176691
+ /* (364) ccons ::= NULL onconf */ yytestcase(yyruleno==364);
176692
+ /* (365) ccons ::= GENERATED ALWAYS AS generated */ yytestcase(yyruleno==365);
176693
+ /* (366) ccons ::= AS generated */ yytestcase(yyruleno==366);
176694
+ /* (367) conslist_opt ::= COMMA conslist */ yytestcase(yyruleno==367);
176695
+ /* (368) conslist ::= conslist tconscomma tcons */ yytestcase(yyruleno==368);
176696
+ /* (369) conslist ::= tcons (OPTIMIZED OUT) */ assert(yyruleno!=369);
176697
+ /* (370) tconscomma ::= */ yytestcase(yyruleno==370);
176698
+ /* (371) defer_subclause_opt ::= defer_subclause (OPTIMIZED OUT) */ assert(yyruleno!=371);
176699
+ /* (372) resolvetype ::= raisetype (OPTIMIZED OUT) */ assert(yyruleno!=372);
176700
+ /* (373) selectnowith ::= oneselect (OPTIMIZED OUT) */ assert(yyruleno!=373);
176701
+ /* (374) oneselect ::= values */ yytestcase(yyruleno==374);
176702
+ /* (375) sclp ::= selcollist COMMA */ yytestcase(yyruleno==375);
176703
+ /* (376) as ::= ID|STRING */ yytestcase(yyruleno==376);
176704
+ /* (377) indexed_opt ::= indexed_by (OPTIMIZED OUT) */ assert(yyruleno!=377);
176705
+ /* (378) returning ::= */ yytestcase(yyruleno==378);
176706
+ /* (379) expr ::= term (OPTIMIZED OUT) */ assert(yyruleno!=379);
176707
+ /* (380) likeop ::= LIKE_KW|MATCH */ yytestcase(yyruleno==380);
176708
+ /* (381) case_operand ::= expr */ yytestcase(yyruleno==381);
176709
+ /* (382) exprlist ::= nexprlist */ yytestcase(yyruleno==382);
176710
+ /* (383) nmnum ::= plus_num (OPTIMIZED OUT) */ assert(yyruleno!=383);
176711
+ /* (384) nmnum ::= nm (OPTIMIZED OUT) */ assert(yyruleno!=384);
176712
+ /* (385) nmnum ::= ON */ yytestcase(yyruleno==385);
176713
+ /* (386) nmnum ::= DELETE */ yytestcase(yyruleno==386);
176714
+ /* (387) nmnum ::= DEFAULT */ yytestcase(yyruleno==387);
176715
+ /* (388) plus_num ::= INTEGER|FLOAT */ yytestcase(yyruleno==388);
176716
+ /* (389) foreach_clause ::= */ yytestcase(yyruleno==389);
176717
+ /* (390) foreach_clause ::= FOR EACH ROW */ yytestcase(yyruleno==390);
176718
+ /* (391) trnm ::= nm */ yytestcase(yyruleno==391);
176719
+ /* (392) tridxby ::= */ yytestcase(yyruleno==392);
176720
+ /* (393) database_kw_opt ::= DATABASE */ yytestcase(yyruleno==393);
176721
+ /* (394) database_kw_opt ::= */ yytestcase(yyruleno==394);
176722
+ /* (395) kwcolumn_opt ::= */ yytestcase(yyruleno==395);
176723
+ /* (396) kwcolumn_opt ::= COLUMNKW */ yytestcase(yyruleno==396);
176724
+ /* (397) vtabarglist ::= vtabarg */ yytestcase(yyruleno==397);
176725
+ /* (398) vtabarglist ::= vtabarglist COMMA vtabarg */ yytestcase(yyruleno==398);
176726
+ /* (399) vtabarg ::= vtabarg vtabargtoken */ yytestcase(yyruleno==399);
176727
+ /* (400) anylist ::= */ yytestcase(yyruleno==400);
176728
+ /* (401) anylist ::= anylist LP anylist RP */ yytestcase(yyruleno==401);
176729
+ /* (402) anylist ::= anylist ANY */ yytestcase(yyruleno==402);
176730
+ /* (403) with ::= */ yytestcase(yyruleno==403);
176731
+ /* (404) windowdefn_list ::= windowdefn (OPTIMIZED OUT) */ assert(yyruleno!=404);
176732
+ /* (405) window ::= frame_opt (OPTIMIZED OUT) */ assert(yyruleno!=405);
176438176733
break;
176439176734
/********** End reduce actions ************************************************/
176440176735
};
176441176736
assert( yyruleno<sizeof(yyRuleInfoLhs)/sizeof(yyRuleInfoLhs[0]) );
176442176737
yygoto = yyRuleInfoLhs[yyruleno];
@@ -177695,31 +177990,62 @@
177695177990
testcase( z[0]=='6' ); testcase( z[0]=='7' ); testcase( z[0]=='8' );
177696177991
testcase( z[0]=='9' ); testcase( z[0]=='.' );
177697177992
*tokenType = TK_INTEGER;
177698177993
#ifndef SQLITE_OMIT_HEX_INTEGER
177699177994
if( z[0]=='0' && (z[1]=='x' || z[1]=='X') && sqlite3Isxdigit(z[2]) ){
177700
- for(i=3; sqlite3Isxdigit(z[i]); i++){}
177701
- return i;
177702
- }
177995
+ for(i=3; 1; i++){
177996
+ if( sqlite3Isxdigit(z[i])==0 ){
177997
+ if( z[i]==SQLITE_DIGIT_SEPARATOR ){
177998
+ *tokenType = TK_QNUMBER;
177999
+ }else{
178000
+ break;
178001
+ }
178002
+ }
178003
+ }
178004
+ }else
177703178005
#endif
177704
- for(i=0; sqlite3Isdigit(z[i]); i++){}
178006
+ {
178007
+ for(i=0; 1; i++){
178008
+ if( sqlite3Isdigit(z[i])==0 ){
178009
+ if( z[i]==SQLITE_DIGIT_SEPARATOR ){
178010
+ *tokenType = TK_QNUMBER;
178011
+ }else{
178012
+ break;
178013
+ }
178014
+ }
178015
+ }
177705178016
#ifndef SQLITE_OMIT_FLOATING_POINT
177706
- if( z[i]=='.' ){
177707
- i++;
177708
- while( sqlite3Isdigit(z[i]) ){ i++; }
177709
- *tokenType = TK_FLOAT;
177710
- }
177711
- if( (z[i]=='e' || z[i]=='E') &&
177712
- ( sqlite3Isdigit(z[i+1])
177713
- || ((z[i+1]=='+' || z[i+1]=='-') && sqlite3Isdigit(z[i+2]))
177714
- )
177715
- ){
177716
- i += 2;
177717
- while( sqlite3Isdigit(z[i]) ){ i++; }
177718
- *tokenType = TK_FLOAT;
177719
- }
177720
-#endif
178017
+ if( z[i]=='.' ){
178018
+ if( *tokenType==TK_INTEGER ) *tokenType = TK_FLOAT;
178019
+ for(i++; 1; i++){
178020
+ if( sqlite3Isdigit(z[i])==0 ){
178021
+ if( z[i]==SQLITE_DIGIT_SEPARATOR ){
178022
+ *tokenType = TK_QNUMBER;
178023
+ }else{
178024
+ break;
178025
+ }
178026
+ }
178027
+ }
178028
+ }
178029
+ if( (z[i]=='e' || z[i]=='E') &&
178030
+ ( sqlite3Isdigit(z[i+1])
178031
+ || ((z[i+1]=='+' || z[i+1]=='-') && sqlite3Isdigit(z[i+2]))
178032
+ )
178033
+ ){
178034
+ if( *tokenType==TK_INTEGER ) *tokenType = TK_FLOAT;
178035
+ for(i+=2; 1; i++){
178036
+ if( sqlite3Isdigit(z[i])==0 ){
178037
+ if( z[i]==SQLITE_DIGIT_SEPARATOR ){
178038
+ *tokenType = TK_QNUMBER;
178039
+ }else{
178040
+ break;
178041
+ }
178042
+ }
178043
+ }
178044
+ }
178045
+#endif
178046
+ }
177721178047
while( IdChar(z[i]) ){
177722178048
*tokenType = TK_ILLEGAL;
177723178049
i++;
177724178050
}
177725178051
return i;
@@ -177880,14 +178206,17 @@
177880178206
}
177881178207
#ifndef SQLITE_OMIT_WINDOWFUNC
177882178208
if( tokenType>=TK_WINDOW ){
177883178209
assert( tokenType==TK_SPACE || tokenType==TK_OVER || tokenType==TK_FILTER
177884178210
|| tokenType==TK_ILLEGAL || tokenType==TK_WINDOW
178211
+ || tokenType==TK_QNUMBER
177885178212
);
177886178213
#else
177887178214
if( tokenType>=TK_SPACE ){
177888
- assert( tokenType==TK_SPACE || tokenType==TK_ILLEGAL );
178215
+ assert( tokenType==TK_SPACE || tokenType==TK_ILLEGAL
178216
+ || tokenType==TK_QNUMBER
178217
+ );
177889178218
#endif /* SQLITE_OMIT_WINDOWFUNC */
177890178219
if( AtomicLoad(&db->u1.isInterrupted) ){
177891178220
pParse->rc = SQLITE_INTERRUPT;
177892178221
pParse->nErr++;
177893178222
break;
@@ -177916,11 +178245,11 @@
177916178245
tokenType = analyzeOverKeyword((const u8*)&zSql[4], lastTokenParsed);
177917178246
}else if( tokenType==TK_FILTER ){
177918178247
assert( n==6 );
177919178248
tokenType = analyzeFilterKeyword((const u8*)&zSql[6], lastTokenParsed);
177920178249
#endif /* SQLITE_OMIT_WINDOWFUNC */
177921
- }else{
178250
+ }else if( tokenType!=TK_QNUMBER ){
177922178251
Token x;
177923178252
x.z = zSql;
177924178253
x.n = n;
177925178254
sqlite3ErrorMsg(pParse, "unrecognized token: \"%T\"", &x);
177926178255
break;
@@ -204150,11 +204479,10 @@
204150204479
memcpy(p->zBuf+p->nUsed, zIn, N);
204151204480
p->nUsed += N;
204152204481
}
204153204482
}
204154204483
204155
-
204156204484
/* Append formatted text (not to exceed N bytes) to the JsonString.
204157204485
*/
204158204486
static void jsonPrintf(int N, JsonString *p, const char *zFormat, ...){
204159204487
va_list ap;
204160204488
if( (p->nUsed + N >= p->nAlloc) && jsonStringGrow(p, N) ) return;
@@ -205210,11 +205538,11 @@
205210205538
return j+1;
205211205539
}
205212205540
case '[': {
205213205541
/* Parse array */
205214205542
iThis = pParse->nBlob;
205215
- assert( i<=pParse->nJson );
205543
+ assert( i<=(u32)pParse->nJson );
205216205544
jsonBlobAppendNode(pParse, JSONB_ARRAY, pParse->nJson - i, 0);
205217205545
iStart = pParse->nBlob;
205218205546
if( pParse->oom ) return -1;
205219205547
if( ++pParse->iDepth > JSON_MAX_DEPTH ){
205220205548
pParse->iErr = i;
@@ -205922,10 +206250,116 @@
205922206250
break;
205923206251
}
205924206252
}
205925206253
return i+n+sz;
205926206254
}
206255
+
206256
+/* Context for recursion of json_pretty()
206257
+*/
206258
+typedef struct JsonPretty JsonPretty;
206259
+struct JsonPretty {
206260
+ JsonParse *pParse; /* The BLOB being rendered */
206261
+ JsonString *pOut; /* Generate pretty output into this string */
206262
+ const char *zIndent; /* Use this text for indentation */
206263
+ u32 szIndent; /* Bytes in zIndent[] */
206264
+ u32 nIndent; /* Current level of indentation */
206265
+};
206266
+
206267
+/* Append indentation to the pretty JSON under construction */
206268
+static void jsonPrettyIndent(JsonPretty *pPretty){
206269
+ u32 jj;
206270
+ for(jj=0; jj<pPretty->nIndent; jj++){
206271
+ jsonAppendRaw(pPretty->pOut, pPretty->zIndent, pPretty->szIndent);
206272
+ }
206273
+}
206274
+
206275
+/*
206276
+** Translate the binary JSONB representation of JSON beginning at
206277
+** pParse->aBlob[i] into a JSON text string. Append the JSON
206278
+** text onto the end of pOut. Return the index in pParse->aBlob[]
206279
+** of the first byte past the end of the element that is translated.
206280
+**
206281
+** This is a variant of jsonTranslateBlobToText() that "pretty-prints"
206282
+** the output. Extra whitespace is inserted to make the JSON easier
206283
+** for humans to read.
206284
+**
206285
+** If an error is detected in the BLOB input, the pOut->eErr flag
206286
+** might get set to JSTRING_MALFORMED. But not all BLOB input errors
206287
+** are detected. So a malformed JSONB input might either result
206288
+** in an error, or in incorrect JSON.
206289
+**
206290
+** The pOut->eErr JSTRING_OOM flag is set on a OOM.
206291
+*/
206292
+static u32 jsonTranslateBlobToPrettyText(
206293
+ JsonPretty *pPretty, /* Pretty-printing context */
206294
+ u32 i /* Start rendering at this index */
206295
+){
206296
+ u32 sz, n, j, iEnd;
206297
+ const JsonParse *pParse = pPretty->pParse;
206298
+ JsonString *pOut = pPretty->pOut;
206299
+ n = jsonbPayloadSize(pParse, i, &sz);
206300
+ if( n==0 ){
206301
+ pOut->eErr |= JSTRING_MALFORMED;
206302
+ return pParse->nBlob+1;
206303
+ }
206304
+ switch( pParse->aBlob[i] & 0x0f ){
206305
+ case JSONB_ARRAY: {
206306
+ j = i+n;
206307
+ iEnd = j+sz;
206308
+ jsonAppendChar(pOut, '[');
206309
+ if( j<iEnd ){
206310
+ jsonAppendChar(pOut, '\n');
206311
+ pPretty->nIndent++;
206312
+ while( pOut->eErr==0 ){
206313
+ jsonPrettyIndent(pPretty);
206314
+ j = jsonTranslateBlobToPrettyText(pPretty, j);
206315
+ if( j>=iEnd ) break;
206316
+ jsonAppendRawNZ(pOut, ",\n", 2);
206317
+ }
206318
+ jsonAppendChar(pOut, '\n');
206319
+ pPretty->nIndent--;
206320
+ jsonPrettyIndent(pPretty);
206321
+ }
206322
+ jsonAppendChar(pOut, ']');
206323
+ i = iEnd;
206324
+ break;
206325
+ }
206326
+ case JSONB_OBJECT: {
206327
+ j = i+n;
206328
+ iEnd = j+sz;
206329
+ jsonAppendChar(pOut, '{');
206330
+ if( j<iEnd ){
206331
+ jsonAppendChar(pOut, '\n');
206332
+ pPretty->nIndent++;
206333
+ while( pOut->eErr==0 ){
206334
+ jsonPrettyIndent(pPretty);
206335
+ j = jsonTranslateBlobToText(pParse, j, pOut);
206336
+ if( j>iEnd ){
206337
+ pOut->eErr |= JSTRING_MALFORMED;
206338
+ break;
206339
+ }
206340
+ jsonAppendRawNZ(pOut, ": ", 2);
206341
+ j = jsonTranslateBlobToPrettyText(pPretty, j);
206342
+ if( j>=iEnd ) break;
206343
+ jsonAppendRawNZ(pOut, ",\n", 2);
206344
+ }
206345
+ jsonAppendChar(pOut, '\n');
206346
+ pPretty->nIndent--;
206347
+ jsonPrettyIndent(pPretty);
206348
+ }
206349
+ jsonAppendChar(pOut, '}');
206350
+ i = iEnd;
206351
+ break;
206352
+ }
206353
+ default: {
206354
+ i = jsonTranslateBlobToText(pParse, i, pOut);
206355
+ break;
206356
+ }
206357
+ }
206358
+ return i;
206359
+}
206360
+
205927206361
205928206362
/* Return true if the input pJson
205929206363
**
205930206364
** For performance reasons, this routine does not do a detailed check of the
205931206365
** input BLOB to ensure that it is well-formed. Hence, false positives are
@@ -207841,10 +208275,44 @@
207841208275
}
207842208276
sqlite3_result_text(ctx, jsonbType[p->aBlob[i]&0x0f], -1, SQLITE_STATIC);
207843208277
json_type_done:
207844208278
jsonParseFree(p);
207845208279
}
208280
+
208281
+/*
208282
+** json_pretty(JSON)
208283
+** json_pretty(JSON, INDENT)
208284
+**
208285
+** Return text that is a pretty-printed rendering of the input JSON.
208286
+** If the argument is not valid JSON, return NULL.
208287
+**
208288
+** The INDENT argument is text that is used for indentation. If omitted,
208289
+** it defaults to four spaces (the same as PostgreSQL).
208290
+*/
208291
+static void jsonPrettyFunc(
208292
+ sqlite3_context *ctx,
208293
+ int argc,
208294
+ sqlite3_value **argv
208295
+){
208296
+ JsonString s; /* The output string */
208297
+ JsonPretty x; /* Pretty printing context */
208298
+
208299
+ memset(&x, 0, sizeof(x));
208300
+ x.pParse = jsonParseFuncArg(ctx, argv[0], 0);
208301
+ if( x.pParse==0 ) return;
208302
+ x.pOut = &s;
208303
+ jsonStringInit(&s, ctx);
208304
+ if( argc==1 || (x.zIndent = (const char*)sqlite3_value_text(argv[1]))==0 ){
208305
+ x.zIndent = " ";
208306
+ x.szIndent = 4;
208307
+ }else{
208308
+ x.szIndent = (u32)strlen(x.zIndent);
208309
+ }
208310
+ jsonTranslateBlobToPrettyText(&x, 0);
208311
+ jsonReturnString(&s, 0, 0);
208312
+ jsonParseFree(x.pParse);
208313
+}
207846208314
207847208315
/*
207848208316
** json_valid(JSON)
207849208317
** json_valid(JSON, FLAGS)
207850208318
**
@@ -208580,13 +209048,13 @@
208580209048
break;
208581209049
}
208582209050
case JEACH_JSON: {
208583209051
if( p->sParse.zJson==0 ){
208584209052
sqlite3_result_blob(ctx, p->sParse.aBlob, p->sParse.nBlob,
208585
- SQLITE_STATIC);
209053
+ SQLITE_TRANSIENT);
208586209054
}else{
208587
- sqlite3_result_text(ctx, p->sParse.zJson, -1, SQLITE_STATIC);
209055
+ sqlite3_result_text(ctx, p->sParse.zJson, -1, SQLITE_TRANSIENT);
208588209056
}
208589209057
break;
208590209058
}
208591209059
}
208592209060
return SQLITE_OK;
@@ -208856,10 +209324,12 @@
208856209324
JFUNCTION(jsonb_insert, -1,1,0, 1,1,0, jsonSetFunc),
208857209325
JFUNCTION(json_object, -1,0,1, 1,0,0, jsonObjectFunc),
208858209326
JFUNCTION(jsonb_object, -1,0,1, 1,1,0, jsonObjectFunc),
208859209327
JFUNCTION(json_patch, 2,1,1, 0,0,0, jsonPatchFunc),
208860209328
JFUNCTION(jsonb_patch, 2,1,0, 0,1,0, jsonPatchFunc),
209329
+ JFUNCTION(json_pretty, 1,1,0, 0,0,0, jsonPrettyFunc),
209330
+ JFUNCTION(json_pretty, 2,1,0, 0,0,0, jsonPrettyFunc),
208861209331
JFUNCTION(json_quote, 1,0,1, 1,0,0, jsonQuoteFunc),
208862209332
JFUNCTION(json_remove, -1,1,1, 0,0,0, jsonRemoveFunc),
208863209333
JFUNCTION(jsonb_remove, -1,1,0, 0,1,0, jsonRemoveFunc),
208864209334
JFUNCTION(json_replace, -1,1,1, 1,0,0, jsonReplaceFunc),
208865209335
JFUNCTION(jsonb_replace, -1,1,0, 1,1,0, jsonReplaceFunc),
@@ -210755,10 +211225,12 @@
210755211225
}
210756211226
pCons->pInfo = pInfo;
210757211227
return SQLITE_OK;
210758211228
}
210759211229
211230
+SQLITE_PRIVATE int sqlite3IntFloatCompare(i64,double);
211231
+
210760211232
/*
210761211233
** Rtree virtual table module xFilter method.
210762211234
*/
210763211235
static int rtreeFilter(
210764211236
sqlite3_vtab_cursor *pVtabCursor,
@@ -210784,11 +211256,12 @@
210784211256
RtreeSearchPoint *p; /* Search point for the leaf */
210785211257
i64 iRowid = sqlite3_value_int64(argv[0]);
210786211258
i64 iNode = 0;
210787211259
int eType = sqlite3_value_numeric_type(argv[0]);
210788211260
if( eType==SQLITE_INTEGER
210789
- || (eType==SQLITE_FLOAT && sqlite3_value_double(argv[0])==iRowid)
211261
+ || (eType==SQLITE_FLOAT
211262
+ && 0==sqlite3IntFloatCompare(iRowid,sqlite3_value_double(argv[0])))
210790211263
){
210791211264
rc = findLeafNode(pRtree, iRowid, &pLeaf, &iNode);
210792211265
}else{
210793211266
rc = SQLITE_OK;
210794211267
pLeaf = 0;
@@ -251030,11 +251503,11 @@
251030251503
int nArg, /* Number of args */
251031251504
sqlite3_value **apUnused /* Function arguments */
251032251505
){
251033251506
assert( nArg==0 );
251034251507
UNUSED_PARAM2(nArg, apUnused);
251035
- sqlite3_result_text(pCtx, "fts5: 2024-02-20 12:14:07 6c5a0c85454e3c658e51fab611c169c034447174022eebc52fd8619b528a4765", -1, SQLITE_TRANSIENT);
251508
+ sqlite3_result_text(pCtx, "fts5: 2024-03-09 18:41:40 7ead022edaf7a0cd6a8976a1261246084975c9a5be5c893f6c751bb5f963ac0f", -1, SQLITE_TRANSIENT);
251036251509
}
251037251510
251038251511
/*
251039251512
** Return true if zName is the extension on one of the shadow tables used
251040251513
** by this module.
251041251514
--- extsrc/sqlite3.c
+++ extsrc/sqlite3.c
@@ -16,11 +16,11 @@
16 ** if you want a wrapper to interface SQLite with your choice of programming
17 ** language. The code for the "sqlite3" command-line shell is also in a
18 ** separate file. This file contains only code for the core SQLite library.
19 **
20 ** The content in this amalgamation comes from Fossil check-in
21 ** ce5df19dc4aff3fde03ef62261a5e095a16a.
22 */
23 #define SQLITE_CORE 1
24 #define SQLITE_AMALGAMATION 1
25 #ifndef SQLITE_PRIVATE
26 # define SQLITE_PRIVATE static
@@ -459,11 +459,11 @@
459 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
460 ** [sqlite_version()] and [sqlite_source_id()].
461 */
462 #define SQLITE_VERSION "3.46.0"
463 #define SQLITE_VERSION_NUMBER 3046000
464 #define SQLITE_SOURCE_ID "2024-02-22 00:50:54 ce5df19dc4aff3fde03ef62261a5e095a16a8f4e46e2924becea4fed56ce49e3"
465
466 /*
467 ** CAPI3REF: Run-Time Library Version Numbers
468 ** KEYWORDS: sqlite3_version sqlite3_sourceid
469 **
@@ -1075,15 +1075,15 @@
1075 ** <li> [SQLITE_LOCK_PENDING], or
1076 ** <li> [SQLITE_LOCK_EXCLUSIVE].
1077 ** </ul>
1078 ** xLock() upgrades the database file lock. In other words, xLock() moves the
1079 ** database file lock in the direction NONE toward EXCLUSIVE. The argument to
1080 ** xLock() is always on of SHARED, RESERVED, PENDING, or EXCLUSIVE, never
1081 ** SQLITE_LOCK_NONE. If the database file lock is already at or above the
1082 ** requested lock, then the call to xLock() is a no-op.
1083 ** xUnlock() downgrades the database file lock to either SHARED or NONE.
1084 * If the lock is already at or below the requested lock state, then the call
1085 ** to xUnlock() is a no-op.
1086 ** The xCheckReservedLock() method checks whether any database connection,
1087 ** either in this process or in some other process, is holding a RESERVED,
1088 ** PENDING, or EXCLUSIVE lock on the file. It returns true
1089 ** if such a lock exists and false otherwise.
@@ -14295,10 +14295,12 @@
14295 */
14296 #if defined(SQLITE_OMIT_VIRTUALTABLE) && !defined(SQLITE_OMIT_ALTERTABLE)
14297 # define SQLITE_OMIT_ALTERTABLE
14298 #endif
14299
 
 
14300 /*
14301 ** Return true (non-zero) if the input is an integer that is too large
14302 ** to fit in 32-bits. This macro is used inside of various testcase()
14303 ** macros to verify that we have tested SQLite for large-file support.
14304 */
@@ -14597,12 +14599,13 @@
14597 #define TK_SELECT_COLUMN 178
14598 #define TK_IF_NULL_ROW 179
14599 #define TK_ASTERISK 180
14600 #define TK_SPAN 181
14601 #define TK_ERROR 182
14602 #define TK_SPACE 183
14603 #define TK_ILLEGAL 184
 
14604
14605 /************** End of parse.h ***********************************************/
14606 /************** Continuing where we left off in sqliteInt.h ******************/
14607 #include <stdio.h>
14608 #include <stdlib.h>
@@ -15097,10 +15100,11 @@
15097 ** 0x00004000 Push-down optimization
15098 ** 0x00008000 After all FROM-clause analysis
15099 ** 0x00010000 Beginning of DELETE/INSERT/UPDATE processing
15100 ** 0x00020000 Transform DISTINCT into GROUP BY
15101 ** 0x00040000 SELECT tree dump after all code has been generated
 
15102 */
15103
15104 /*
15105 ** Macros for "wheretrace"
15106 */
@@ -16276,10 +16280,11 @@
16276
16277 SQLITE_PRIVATE int sqlite3BtreeIntegrityCheck(
16278 sqlite3 *db, /* Database connection that is running the check */
16279 Btree *p, /* The btree to be checked */
16280 Pgno *aRoot, /* An array of root pages numbers for individual trees */
 
16281 int nRoot, /* Number of entries in aRoot[] */
16282 int mxErr, /* Stop reporting errors after this many */
16283 int *pnErr, /* OUT: Write number of errors seen to this variable */
16284 char **pzOut /* OUT: Write the error message string here */
16285 );
@@ -16546,39 +16551,39 @@
16546 #define OP_Checkpoint 3
16547 #define OP_JournalMode 4
16548 #define OP_Vacuum 5
16549 #define OP_VFilter 6 /* jump, synopsis: iplan=r[P3] zplan='P4' */
16550 #define OP_VUpdate 7 /* synopsis: data=r[P3@P2] */
16551 #define OP_Init 8 /* jump, synopsis: Start at P2 */
16552 #define OP_Goto 9 /* jump */
16553 #define OP_Gosub 10 /* jump */
16554 #define OP_InitCoroutine 11 /* jump */
16555 #define OP_Yield 12 /* jump */
16556 #define OP_MustBeInt 13 /* jump */
16557 #define OP_Jump 14 /* jump */
16558 #define OP_Once 15 /* jump */
16559 #define OP_If 16 /* jump */
16560 #define OP_IfNot 17 /* jump */
16561 #define OP_IsType 18 /* jump, synopsis: if typeof(P1.P3) in P5 goto P2 */
16562 #define OP_Not 19 /* same as TK_NOT, synopsis: r[P2]= !r[P1] */
16563 #define OP_IfNullRow 20 /* jump, synopsis: if P1.nullRow then r[P3]=NULL, goto P2 */
16564 #define OP_SeekLT 21 /* jump, synopsis: key=r[P3@P4] */
16565 #define OP_SeekLE 22 /* jump, synopsis: key=r[P3@P4] */
16566 #define OP_SeekGE 23 /* jump, synopsis: key=r[P3@P4] */
16567 #define OP_SeekGT 24 /* jump, synopsis: key=r[P3@P4] */
16568 #define OP_IfNotOpen 25 /* jump, synopsis: if( !csr[P1] ) goto P2 */
16569 #define OP_IfNoHope 26 /* jump, synopsis: key=r[P3@P4] */
16570 #define OP_NoConflict 27 /* jump, synopsis: key=r[P3@P4] */
16571 #define OP_NotFound 28 /* jump, synopsis: key=r[P3@P4] */
16572 #define OP_Found 29 /* jump, synopsis: key=r[P3@P4] */
16573 #define OP_SeekRowid 30 /* jump, synopsis: intkey=r[P3] */
16574 #define OP_NotExists 31 /* jump, synopsis: intkey=r[P3] */
16575 #define OP_Last 32 /* jump */
16576 #define OP_IfSizeBetween 33 /* jump */
16577 #define OP_SorterSort 34 /* jump */
16578 #define OP_Sort 35 /* jump */
16579 #define OP_Rewind 36 /* jump */
16580 #define OP_SorterNext 37 /* jump */
16581 #define OP_Prev 38 /* jump */
16582 #define OP_Next 39 /* jump */
16583 #define OP_IdxLE 40 /* jump, synopsis: key=r[P3@P4] */
16584 #define OP_IdxGT 41 /* jump, synopsis: key=r[P3@P4] */
@@ -16586,11 +16591,11 @@
16586 #define OP_Or 43 /* same as TK_OR, synopsis: r[P3]=(r[P1] || r[P2]) */
16587 #define OP_And 44 /* same as TK_AND, synopsis: r[P3]=(r[P1] && r[P2]) */
16588 #define OP_IdxGE 45 /* jump, synopsis: key=r[P3@P4] */
16589 #define OP_RowSetRead 46 /* jump, synopsis: r[P3]=rowset(P1) */
16590 #define OP_RowSetTest 47 /* jump, synopsis: if r[P3] in rowset(P1) goto P2 */
16591 #define OP_Program 48 /* jump */
16592 #define OP_FkIfZero 49 /* jump, synopsis: if fkctr[P1]==0 goto P2 */
16593 #define OP_IsNull 50 /* jump, same as TK_ISNULL, synopsis: if r[P1]==NULL goto P2 */
16594 #define OP_NotNull 51 /* jump, same as TK_NOTNULL, synopsis: if r[P1]!=NULL goto P2 */
16595 #define OP_Ne 52 /* jump, same as TK_NE, synopsis: IF r[P3]!=r[P1] */
16596 #define OP_Eq 53 /* jump, same as TK_EQ, synopsis: IF r[P3]==r[P1] */
@@ -16616,11 +16621,11 @@
16616 #define OP_String 73 /* synopsis: r[P2]='P4' (len=P1) */
16617 #define OP_BeginSubrtn 74 /* synopsis: r[P2]=NULL */
16618 #define OP_Null 75 /* synopsis: r[P2..P3]=NULL */
16619 #define OP_SoftNull 76 /* synopsis: r[P1]=NULL */
16620 #define OP_Blob 77 /* synopsis: r[P2]=P4 (len=P1) */
16621 #define OP_Variable 78 /* synopsis: r[P2]=parameter(P1,P4) */
16622 #define OP_Move 79 /* synopsis: r[P2@P3]=r[P1@P3] */
16623 #define OP_Copy 80 /* synopsis: r[P2@P3+1]=r[P1@P3+1] */
16624 #define OP_SCopy 81 /* synopsis: r[P2]=r[P1] */
16625 #define OP_IntCopy 82 /* synopsis: r[P2]=r[P1] */
16626 #define OP_FkCheck 83
@@ -16740,18 +16745,19 @@
16740 #define OPFLG_IN2 0x04 /* in2: P2 is an input */
16741 #define OPFLG_IN3 0x08 /* in3: P3 is an input */
16742 #define OPFLG_OUT2 0x10 /* out2: P2 is an output */
16743 #define OPFLG_OUT3 0x20 /* out3: P3 is an output */
16744 #define OPFLG_NCYCLE 0x40 /* ncycle:Cycles count against P1 */
 
16745 #define OPFLG_INITIALIZER {\
16746 /* 0 */ 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x41, 0x00,\
16747 /* 8 */ 0x01, 0x01, 0x01, 0x01, 0x03, 0x03, 0x01, 0x01,\
16748 /* 16 */ 0x03, 0x03, 0x01, 0x12, 0x01, 0x49, 0x49, 0x49,\
16749 /* 24 */ 0x49, 0x01, 0x49, 0x49, 0x49, 0x49, 0x49, 0x49,\
16750 /* 32 */ 0x41, 0x01, 0x41, 0x41, 0x41, 0x01, 0x41, 0x41,\
16751 /* 40 */ 0x41, 0x41, 0x41, 0x26, 0x26, 0x41, 0x23, 0x0b,\
16752 /* 48 */ 0x01, 0x01, 0x03, 0x03, 0x0b, 0x0b, 0x0b, 0x0b,\
16753 /* 56 */ 0x0b, 0x0b, 0x01, 0x03, 0x03, 0x03, 0x01, 0x41,\
16754 /* 64 */ 0x01, 0x00, 0x00, 0x02, 0x02, 0x08, 0x00, 0x10,\
16755 /* 72 */ 0x10, 0x10, 0x00, 0x10, 0x00, 0x10, 0x10, 0x00,\
16756 /* 80 */ 0x00, 0x10, 0x10, 0x00, 0x00, 0x00, 0x02, 0x02,\
16757 /* 88 */ 0x02, 0x00, 0x00, 0x12, 0x1e, 0x20, 0x40, 0x00,\
@@ -16906,10 +16912,12 @@
16906 typedef int (*RecordCompare)(int,const void*,UnpackedRecord*);
16907 SQLITE_PRIVATE RecordCompare sqlite3VdbeFindCompare(UnpackedRecord*);
16908
16909 SQLITE_PRIVATE void sqlite3VdbeLinkSubProgram(Vdbe *, SubProgram *);
16910 SQLITE_PRIVATE int sqlite3VdbeHasSubProgram(Vdbe*);
 
 
16911
16912 SQLITE_PRIVATE int sqlite3NotPureFunc(sqlite3_context*);
16913 #ifdef SQLITE_ENABLE_BYTECODE_VTAB
16914 SQLITE_PRIVATE int sqlite3VdbeBytecodeVtabInit(sqlite3*);
16915 #endif
@@ -19349,10 +19357,11 @@
19349 #define NC_HasWin 0x008000 /* One or more window functions seen */
19350 #define NC_IsDDL 0x010000 /* Resolving names in a CREATE statement */
19351 #define NC_InAggFunc 0x020000 /* True if analyzing arguments to an agg func */
19352 #define NC_FromDDL 0x040000 /* SQL text comes from sqlite_schema */
19353 #define NC_NoSelect 0x080000 /* Do not descend into sub-selects */
 
19354 #define NC_OrderAgg 0x8000000 /* Has an aggregate other than count/min/max */
19355
19356 /*
19357 ** An instance of the following object describes a single ON CONFLICT
19358 ** clause in an upsert.
@@ -19372,10 +19381,11 @@
19372 Expr *pUpsertTargetWhere; /* WHERE clause for partial index targets */
19373 ExprList *pUpsertSet; /* The SET clause from an ON CONFLICT UPDATE */
19374 Expr *pUpsertWhere; /* WHERE clause for the ON CONFLICT UPDATE */
19375 Upsert *pNextUpsert; /* Next ON CONFLICT clause in the list */
19376 u8 isDoUpdate; /* True for DO UPDATE. False for DO NOTHING */
 
19377 /* Above this point is the parse tree for the ON CONFLICT clauses.
19378 ** The next group of fields stores intermediate data. */
19379 void *pToFree; /* Free memory when deleting the Upsert object */
19380 /* All fields above are owned by the Upsert object and must be freed
19381 ** when the Upsert is destroyed. The fields below are used to transfer
@@ -20693,10 +20703,11 @@
20693 SQLITE_PRIVATE void sqlite3ErrorMsg(Parse*, const char*, ...);
20694 SQLITE_PRIVATE int sqlite3ErrorToParser(sqlite3*,int);
20695 SQLITE_PRIVATE void sqlite3Dequote(char*);
20696 SQLITE_PRIVATE void sqlite3DequoteExpr(Expr*);
20697 SQLITE_PRIVATE void sqlite3DequoteToken(Token*);
 
20698 SQLITE_PRIVATE void sqlite3TokenInit(Token*,char*);
20699 SQLITE_PRIVATE int sqlite3KeywordCode(const unsigned char*, int);
20700 SQLITE_PRIVATE int sqlite3RunParser(Parse*, const char*);
20701 SQLITE_PRIVATE void sqlite3FinishCoding(Parse*);
20702 SQLITE_PRIVATE int sqlite3GetTempReg(Parse*);
@@ -21447,11 +21458,11 @@
21447 #endif
21448 #ifndef SQLITE_OMIT_UPSERT
21449 SQLITE_PRIVATE Upsert *sqlite3UpsertNew(sqlite3*,ExprList*,Expr*,ExprList*,Expr*,Upsert*);
21450 SQLITE_PRIVATE void sqlite3UpsertDelete(sqlite3*,Upsert*);
21451 SQLITE_PRIVATE Upsert *sqlite3UpsertDup(sqlite3*,Upsert*);
21452 SQLITE_PRIVATE int sqlite3UpsertAnalyzeTarget(Parse*,SrcList*,Upsert*);
21453 SQLITE_PRIVATE void sqlite3UpsertDoUpdate(Parse*,Upsert*,Table*,Index*,int);
21454 SQLITE_PRIVATE Upsert *sqlite3UpsertOfIndex(Upsert*,Index*);
21455 SQLITE_PRIVATE int sqlite3UpsertNextIsIPK(Upsert*);
21456 #else
21457 #define sqlite3UpsertNew(u,v,w,x,y,z) ((Upsert*)0)
@@ -24177,17 +24188,18 @@
24177 int Y, M, D; /* Year, month, and day */
24178 int h, m; /* Hour and minutes */
24179 int tz; /* Timezone offset in minutes */
24180 double s; /* Seconds */
24181 char validJD; /* True (1) if iJD is valid */
24182 char rawS; /* Raw numeric value stored in s */
24183 char validYMD; /* True (1) if Y,M,D are valid */
24184 char validHMS; /* True (1) if h,m,s are valid */
24185 char validTZ; /* True (1) if tz is valid */
24186 char tzSet; /* Timezone was set explicitly */
24187 char isError; /* An overflow has occurred */
24188 char useSubsec; /* Display subsecond precision */
 
 
24189 };
24190
24191
24192 /*
24193 ** Convert zDate into one or more integers according to the conversion
@@ -24281,10 +24293,12 @@
24281 sgn = -1;
24282 }else if( c=='+' ){
24283 sgn = +1;
24284 }else if( c=='Z' || c=='z' ){
24285 zDate++;
 
 
24286 goto zulu_time;
24287 }else{
24288 return c!=0;
24289 }
24290 zDate++;
@@ -24293,11 +24307,10 @@
24293 }
24294 zDate += 5;
24295 p->tz = sgn*(nMn + nHr*60);
24296 zulu_time:
24297 while( sqlite3Isspace(*zDate) ){ zDate++; }
24298 p->tzSet = 1;
24299 return *zDate!=0;
24300 }
24301
24302 /*
24303 ** Parse times of the form HH:MM or HH:MM:SS or HH:MM:SS.FFFF.
@@ -24337,11 +24350,10 @@
24337 p->validHMS = 1;
24338 p->h = h;
24339 p->m = m;
24340 p->s = s + ms;
24341 if( parseTimezone(zDate, p) ) return 1;
24342 p->validTZ = (p->tz!=0)?1:0;
24343 return 0;
24344 }
24345
24346 /*
24347 ** Put the DateTime object into its error state.
@@ -24384,18 +24396,43 @@
24384 X2 = 306001*(M+1)/10000;
24385 p->iJD = (sqlite3_int64)((X1 + X2 + D + B - 1524.5 ) * 86400000);
24386 p->validJD = 1;
24387 if( p->validHMS ){
24388 p->iJD += p->h*3600000 + p->m*60000 + (sqlite3_int64)(p->s*1000 + 0.5);
24389 if( p->validTZ ){
24390 p->iJD -= p->tz*60000;
24391 p->validYMD = 0;
24392 p->validHMS = 0;
24393 p->validTZ = 0;
 
 
24394 }
24395 }
24396 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24397
24398 /*
24399 ** Parse dates of the form
24400 **
24401 ** YYYY-MM-DD HH:MM:SS.FFF
@@ -24431,25 +24468,32 @@
24431 p->validJD = 0;
24432 p->validYMD = 1;
24433 p->Y = neg ? -Y : Y;
24434 p->M = M;
24435 p->D = D;
24436 if( p->validTZ ){
 
24437 computeJD(p);
24438 }
24439 return 0;
24440 }
24441
 
 
 
24442 /*
24443 ** Set the time to the current time reported by the VFS.
24444 **
24445 ** Return the number of errors.
24446 */
24447 static int setDateTimeToCurrent(sqlite3_context *context, DateTime *p){
24448 p->iJD = sqlite3StmtCurrentTime(context);
24449 if( p->iJD>0 ){
24450 p->validJD = 1;
 
 
 
24451 return 0;
24452 }else{
24453 return 1;
24454 }
24455 }
@@ -24584,11 +24628,11 @@
24584 ** Clear the YMD and HMS and the TZ
24585 */
24586 static void clearYMD_HMS_TZ(DateTime *p){
24587 p->validYMD = 0;
24588 p->validHMS = 0;
24589 p->validTZ = 0;
24590 }
24591
24592 #ifndef SQLITE_OMIT_LOCALTIME
24593 /*
24594 ** On recent Windows platforms, the localtime_s() function is available
@@ -24716,11 +24760,11 @@
24716 p->s = sLocal.tm_sec + (p->iJD%1000)*0.001;
24717 p->validYMD = 1;
24718 p->validHMS = 1;
24719 p->validJD = 0;
24720 p->rawS = 0;
24721 p->validTZ = 0;
24722 p->isError = 0;
24723 return SQLITE_OK;
24724 }
24725 #endif /* SQLITE_OMIT_LOCALTIME */
24726
@@ -24736,16 +24780,16 @@
24736 u8 nName; /* Length of the name */
24737 char zName[7]; /* Name of the transformation */
24738 float rLimit; /* Maximum NNN value for this transform */
24739 float rXform; /* Constant used for this transform */
24740 } aXformType[] = {
24741 { 6, "second", 4.6427e+14, 1.0 },
24742 { 6, "minute", 7.7379e+12, 60.0 },
24743 { 4, "hour", 1.2897e+11, 3600.0 },
24744 { 3, "day", 5373485.0, 86400.0 },
24745 { 5, "month", 176546.0, 2592000.0 },
24746 { 4, "year", 14713.0, 31536000.0 },
24747 };
24748
24749 /*
24750 ** If the DateTime p is raw number, try to figure out if it is
24751 ** a julian day number of a unix timestamp. Set the p value
@@ -24773,18 +24817,24 @@
24773 ** NNN hours
24774 ** NNN minutes
24775 ** NNN.NNNN seconds
24776 ** NNN months
24777 ** NNN years
 
 
 
24778 ** start of month
24779 ** start of year
24780 ** start of week
24781 ** start of day
24782 ** weekday N
24783 ** unixepoch
 
24784 ** localtime
24785 ** utc
 
 
24786 **
24787 ** Return 0 on success and 1 if there is any kind of error. If the error
24788 ** is in a system call (i.e. localtime()), then an error message is written
24789 ** to context pCtx. If the error is an unrecognized modifier, no error is
24790 ** written to pCtx.
@@ -24810,10 +24860,41 @@
24810 if( idx>1 ) return 1; /* IMP: R-33611-57934 */
24811 autoAdjustDate(p);
24812 rc = 0;
24813 }
24814 break;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24815 }
24816 case 'j': {
24817 /*
24818 ** julianday
24819 **
@@ -24837,11 +24918,13 @@
24837 **
24838 ** Assuming the current time value is UTC (a.k.a. GMT), shift it to
24839 ** show local time.
24840 */
24841 if( sqlite3_stricmp(z, "localtime")==0 && sqlite3NotPureFunc(pCtx) ){
24842 rc = toLocaltime(p, pCtx);
 
 
24843 }
24844 break;
24845 }
24846 #endif
24847 case 'u': {
@@ -24862,11 +24945,11 @@
24862 rc = 0;
24863 }
24864 }
24865 #ifndef SQLITE_OMIT_LOCALTIME
24866 else if( sqlite3_stricmp(z, "utc")==0 && sqlite3NotPureFunc(pCtx) ){
24867 if( p->tzSet==0 ){
24868 i64 iOrigJD; /* Original localtime */
24869 i64 iGuess; /* Guess at the corresponding utc time */
24870 int cnt = 0; /* Safety to prevent infinite loop */
24871 i64 iErr; /* Guess is off by this much */
24872
@@ -24885,11 +24968,12 @@
24885 iErr = new.iJD - iOrigJD;
24886 }while( iErr && cnt++<3 );
24887 memset(p, 0, sizeof(*p));
24888 p->iJD = iGuess;
24889 p->validJD = 1;
24890 p->tzSet = 1;
 
24891 }
24892 rc = SQLITE_OK;
24893 }
24894 #endif
24895 break;
@@ -24905,11 +24989,11 @@
24905 if( sqlite3_strnicmp(z, "weekday ", 8)==0
24906 && sqlite3AtoF(&z[8], &r, sqlite3Strlen30(&z[8]), SQLITE_UTF8)>0
24907 && r>=0.0 && r<7.0 && (n=(int)r)==r ){
24908 sqlite3_int64 Z;
24909 computeYMD_HMS(p);
24910 p->validTZ = 0;
24911 p->validJD = 0;
24912 computeJD(p);
24913 Z = ((p->iJD + 129600000)/86400000) % 7;
24914 if( Z>n ) Z -= 7;
24915 p->iJD += (n - Z)*86400000;
@@ -24945,11 +25029,11 @@
24945 computeYMD(p);
24946 p->validHMS = 1;
24947 p->h = p->m = 0;
24948 p->s = 0.0;
24949 p->rawS = 0;
24950 p->validTZ = 0;
24951 p->validJD = 0;
24952 if( sqlite3_stricmp(z,"month")==0 ){
24953 p->D = 1;
24954 rc = 0;
24955 }else if( sqlite3_stricmp(z,"year")==0 ){
@@ -25016,10 +25100,11 @@
25016 p->M += M;
25017 }
25018 x = p->M>0 ? (p->M-1)/12 : (p->M-12)/12;
25019 p->Y += x;
25020 p->M -= x*12;
 
25021 computeJD(p);
25022 p->validHMS = 0;
25023 p->validYMD = 0;
25024 p->iJD += (i64)D*86400000;
25025 if( z[11]==0 ){
@@ -25062,37 +25147,41 @@
25062 /* If control reaches this point, it means the transformation is
25063 ** one of the forms like "+NNN days". */
25064 z += n;
25065 while( sqlite3Isspace(*z) ) z++;
25066 n = sqlite3Strlen30(z);
25067 if( n>10 || n<3 ) break;
25068 if( sqlite3UpperToLower[(u8)z[n-1]]=='s' ) n--;
25069 computeJD(p);
25070 assert( rc==1 );
25071 rRounder = r<0 ? -0.5 : +0.5;
 
25072 for(i=0; i<ArraySize(aXformType); i++){
25073 if( aXformType[i].nName==n
25074 && sqlite3_strnicmp(aXformType[i].zName, z, n)==0
25075 && r>-aXformType[i].rLimit && r<aXformType[i].rLimit
25076 ){
25077 switch( i ){
25078 case 4: { /* Special processing to add months */
25079 assert( strcmp(aXformType[i].zName,"month")==0 );
25080 computeYMD_HMS(p);
25081 p->M += (int)r;
25082 x = p->M>0 ? (p->M-1)/12 : (p->M-12)/12;
25083 p->Y += x;
25084 p->M -= x*12;
 
25085 p->validJD = 0;
25086 r -= (int)r;
25087 break;
25088 }
25089 case 5: { /* Special processing to add years */
25090 int y = (int)r;
25091 assert( strcmp(aXformType[i].zName,"year")==0 );
25092 computeYMD_HMS(p);
 
25093 p->Y += y;
 
25094 p->validJD = 0;
25095 r -= (int)r;
25096 break;
25097 }
25098 }
@@ -25713,13 +25802,11 @@
25713 computeJD(&d2);
25714 }
25715 d1.iJD = d2.iJD - d1.iJD;
25716 d1.iJD += (u64)1486995408 * (u64)100000;
25717 }
25718 d1.validYMD = 0;
25719 d1.validHMS = 0;
25720 d1.validTZ = 0;
25721 computeYMD_HMS(&d1);
25722 sqlite3StrAccumInit(&sRes, 0, 0, 0, 100);
25723 sqlite3_str_appendf(&sRes, "%c%04d-%02d-%02d %02d:%02d:%06.3f",
25724 sign, Y, M, d1.D-1, d1.h, d1.m, d1.s);
25725 sqlite3ResultStrAccum(context, &sRes);
@@ -25783,10 +25870,40 @@
25783 strftime(zBuf, 20, zFormat, &sNow);
25784 sqlite3_result_text(context, zBuf, -1, SQLITE_TRANSIENT);
25785 }
25786 }
25787 #endif
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
25788
25789 /*
25790 ** This function registered all of the above C functions as SQL
25791 ** functions. This should be the only routine in this file with
25792 ** external linkage.
@@ -25799,10 +25916,13 @@
25799 PURE_DATE(date, -1, 0, 0, dateFunc ),
25800 PURE_DATE(time, -1, 0, 0, timeFunc ),
25801 PURE_DATE(datetime, -1, 0, 0, datetimeFunc ),
25802 PURE_DATE(strftime, -1, 0, 0, strftimeFunc ),
25803 PURE_DATE(timediff, 2, 0, 0, timediffFunc ),
 
 
 
25804 DFUNCTION(current_time, 0, 0, 0, ctimeFunc ),
25805 DFUNCTION(current_timestamp, 0, 0, 0, ctimestampFunc),
25806 DFUNCTION(current_date, 0, 0, 0, cdateFunc ),
25807 #else
25808 STR_FUNCTION(current_time, 0, "%H:%M:%S", 0, currentTimeFunc),
@@ -34989,10 +35109,48 @@
34989 assert( !ExprHasProperty(p, EP_IntValue) );
34990 assert( sqlite3Isquote(p->u.zToken[0]) );
34991 p->flags |= p->u.zToken[0]=='"' ? EP_Quoted|EP_DblQuoted : EP_Quoted;
34992 sqlite3Dequote(p->u.zToken);
34993 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
34994
34995 /*
34996 ** If the input token p is quoted, try to adjust the token to remove
34997 ** the quotes. This is not always possible:
34998 **
@@ -35306,10 +35464,13 @@
35306 }else{
35307 double rr[2];
35308 u64 s2;
35309 rr[0] = (double)s;
35310 s2 = (u64)rr[0];
 
 
 
35311 rr[1] = s>=s2 ? (double)(s - s2) : -(double)(s2 - s);
35312 if( e>0 ){
35313 while( e>=100 ){
35314 e -= 100;
35315 dekkerMul2(rr, 1.0e+100, -1.5902891109759918046e+83);
@@ -36971,11 +37132,11 @@
36971 /* 73 */ "String" OpHelp("r[P2]='P4' (len=P1)"),
36972 /* 74 */ "BeginSubrtn" OpHelp("r[P2]=NULL"),
36973 /* 75 */ "Null" OpHelp("r[P2..P3]=NULL"),
36974 /* 76 */ "SoftNull" OpHelp("r[P1]=NULL"),
36975 /* 77 */ "Blob" OpHelp("r[P2]=P4 (len=P1)"),
36976 /* 78 */ "Variable" OpHelp("r[P2]=parameter(P1,P4)"),
36977 /* 79 */ "Move" OpHelp("r[P2@P3]=r[P1@P3]"),
36978 /* 80 */ "Copy" OpHelp("r[P2@P3+1]=r[P1@P3+1]"),
36979 /* 81 */ "SCopy" OpHelp("r[P2]=r[P1]"),
36980 /* 82 */ "IntCopy" OpHelp("r[P2]=r[P1]"),
36981 /* 83 */ "FkCheck" OpHelp(""),
@@ -69928,10 +70089,11 @@
69928 Pgno v1; /* Value for second %u substitution in zPfx (current pg) */
69929 int v2; /* Value for third %d substitution in zPfx */
69930 StrAccum errMsg; /* Accumulate the error message text here */
69931 u32 *heap; /* Min-heap used for analyzing cell coverage */
69932 sqlite3 *db; /* Database connection running the check */
 
69933 };
69934
69935 /*
69936 ** Routines to read or write a two- and four-byte big-endian integer values.
69937 */
@@ -77258,11 +77420,14 @@
77258 /* This is the common case where everything fits on the btree page
77259 ** and no overflow pages are required. */
77260 n = nHeader + nPayload;
77261 testcase( n==3 );
77262 testcase( n==4 );
77263 if( n<4 ) n = 4;
 
 
 
77264 *pnSize = n;
77265 assert( nSrc<=nPayload );
77266 testcase( nSrc<nPayload );
77267 memcpy(pPayload, pSrc, nSrc);
77268 memset(pPayload+nSrc, 0, nPayload-nSrc);
@@ -79704,11 +79869,14 @@
79704 assert( newCell!=0 );
79705 assert( BTREE_PREFORMAT==OPFLAG_PREFORMAT );
79706 if( flags & BTREE_PREFORMAT ){
79707 rc = SQLITE_OK;
79708 szNew = p->pBt->nPreformatSize;
79709 if( szNew<4 ) szNew = 4;
 
 
 
79710 if( ISAUTOVACUUM(p->pBt) && szNew>pPage->maxLocal ){
79711 CellInfo info;
79712 pPage->xParseCell(pPage, newCell, &info);
79713 if( info.nPayload!=info.nLocal ){
79714 Pgno ovfl = get4byte(&newCell[szNew-4]);
@@ -81045,10 +81213,13 @@
81045
81046 /* EVIDENCE-OF: R-37002-32774 The two-byte integer at offset 3 gives the
81047 ** number of cells on the page. */
81048 nCell = get2byte(&data[hdr+3]);
81049 assert( pPage->nCell==nCell );
 
 
 
81050
81051 /* EVIDENCE-OF: R-23882-45353 The cell pointer array of a b-tree page
81052 ** immediately follows the b-tree page header. */
81053 cellStart = hdr + 12 - 4*pPage->leaf;
81054 assert( pPage->aCellIdx==&data[cellStart] );
@@ -81156,10 +81327,11 @@
81156 pc = get2byteAligned(&data[cellStart+i*2]);
81157 size = pPage->xCellSize(pPage, &data[pc]);
81158 btreeHeapInsert(heap, (pc<<16)|(pc+size-1));
81159 }
81160 }
 
81161 /* Add the freeblocks to the min-heap
81162 **
81163 ** EVIDENCE-OF: R-20690-50594 The second field of the b-tree page header
81164 ** is the offset of the first freeblock, or zero if there are no
81165 ** freeblocks on the page.
@@ -81255,10 +81427,11 @@
81255 */
81256 SQLITE_PRIVATE int sqlite3BtreeIntegrityCheck(
81257 sqlite3 *db, /* Database connection that is running the check */
81258 Btree *p, /* The btree to be checked */
81259 Pgno *aRoot, /* An array of root pages numbers for individual trees */
 
81260 int nRoot, /* Number of entries in aRoot[] */
81261 int mxErr, /* Stop reporting errors after this many */
81262 int *pnErr, /* OUT: Write number of errors seen to this variable */
81263 char **pzOut /* OUT: Write the error message string here */
81264 ){
@@ -81268,11 +81441,13 @@
81268 u64 savedDbFlags = pBt->db->flags;
81269 char zErr[100];
81270 int bPartial = 0; /* True if not checking all btrees */
81271 int bCkFreelist = 1; /* True to scan the freelist */
81272 VVA_ONLY( int nRef );
 
81273 assert( nRoot>0 );
 
81274
81275 /* aRoot[0]==0 means this is a partial check */
81276 if( aRoot[0]==0 ){
81277 assert( nRoot>1 );
81278 bPartial = 1;
@@ -81341,19 +81516,22 @@
81341 }
81342 #endif
81343 testcase( pBt->db->flags & SQLITE_CellSizeCk );
81344 pBt->db->flags &= ~(u64)SQLITE_CellSizeCk;
81345 for(i=0; (int)i<nRoot && sCheck.mxErr; i++){
81346 i64 notUsed;
81347 if( aRoot[i]==0 ) continue;
 
81348 #ifndef SQLITE_OMIT_AUTOVACUUM
81349 if( pBt->autoVacuum && aRoot[i]>1 && !bPartial ){
81350 checkPtrmap(&sCheck, aRoot[i], PTRMAP_ROOTPAGE, 0);
 
 
 
 
81351 }
81352 #endif
81353 sCheck.v0 = aRoot[i];
81354 checkTreePage(&sCheck, aRoot[i], &notUsed, LARGEST_INT64);
81355 }
81356 pBt->db->flags = savedDbFlags;
81357
81358 /* Make sure every page in the file is referenced
81359 */
@@ -83403,10 +83581,17 @@
83403 }else{
83404 pMem->u.i = val;
83405 pMem->flags = MEM_Int;
83406 }
83407 }
 
 
 
 
 
 
 
83408
83409 /* A no-op destructor */
83410 SQLITE_PRIVATE void sqlite3NoopDestructor(void *p){ UNUSED_PARAMETER(p); }
83411
83412 /*
@@ -85448,10 +85633,19 @@
85448 assert( (sqlite3OpcodeProperty[pOp->opcode] & OPFLG_JUMP)!=0 );
85449 assert( ADDR(pOp->p2)<-pParse->nLabel );
85450 assert( aLabel!=0 ); /* True because of tag-20230419-1 */
85451 pOp->p2 = aLabel[ADDR(pOp->p2)];
85452 }
 
 
 
 
 
 
 
 
 
85453 break;
85454 }
85455 }
85456 /* The mkopcodeh.tcl script has so arranged things that the only
85457 ** non-jump opcodes less than SQLITE_MX_JUMP_CODE are guaranteed to
@@ -88568,10 +88762,27 @@
88568 assert( sizeof(x)==8 && sizeof(pMem->u.r)==8 );
88569 swapMixedEndianFloat(x);
88570 memcpy(&pMem->u.r, &x, sizeof(x));
88571 pMem->flags = IsNaN(x) ? MEM_Null : MEM_Real;
88572 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
88573 }
88574 SQLITE_PRIVATE void sqlite3VdbeSerialGet(
88575 const unsigned char *buf, /* Buffer to deserialize from */
88576 u32 serial_type, /* Serial type to deserialize */
88577 Mem *pMem /* Memory cell to write value into */
@@ -89008,21 +89219,19 @@
89008 testcase( x>r );
89009 testcase( x==r );
89010 return (x<r) ? -1 : (x>r);
89011 }else{
89012 i64 y;
89013 double s;
89014 if( r<-9223372036854775808.0 ) return +1;
89015 if( r>=9223372036854775808.0 ) return -1;
89016 y = (i64)r;
89017 if( i<y ) return -1;
89018 if( i>y ) return +1;
89019 s = (double)i;
89020 testcase( doubleLt(s,r) );
89021 testcase( doubleLt(r,s) );
89022 testcase( doubleEq(r,s) );
89023 return (s<r) ? -1 : (s>r);
89024 }
89025 }
89026
89027 /*
89028 ** Compare the values contained by the two memory cells, returning
@@ -89248,11 +89457,11 @@
89248 if( serial_type>=10 ){
89249 rc = serial_type==10 ? -1 : +1;
89250 }else if( serial_type==0 ){
89251 rc = -1;
89252 }else if( serial_type==7 ){
89253 sqlite3VdbeSerialGet(&aKey1[d1], serial_type, &mem1);
89254 rc = -sqlite3IntFloatCompare(pRhs->u.i, mem1.u.r);
89255 }else{
89256 i64 lhs = vdbeRecordDecodeInt(serial_type, &aKey1[d1]);
89257 i64 rhs = pRhs->u.i;
89258 if( lhs<rhs ){
@@ -89273,18 +89482,22 @@
89273 ** them to numeric values are. */
89274 rc = serial_type==10 ? -1 : +1;
89275 }else if( serial_type==0 ){
89276 rc = -1;
89277 }else{
89278 sqlite3VdbeSerialGet(&aKey1[d1], serial_type, &mem1);
89279 if( serial_type==7 ){
89280 if( mem1.u.r<pRhs->u.r ){
 
 
89281 rc = -1;
89282 }else if( mem1.u.r>pRhs->u.r ){
89283 rc = +1;
 
 
89284 }
89285 }else{
 
89286 rc = sqlite3IntFloatCompare(mem1.u.i, pRhs->u.r);
89287 }
89288 }
89289 }
89290
@@ -89350,11 +89563,18 @@
89350 }
89351
89352 /* RHS is null */
89353 else{
89354 serial_type = aKey1[idx1];
89355 rc = (serial_type!=0 && serial_type!=10);
 
 
 
 
 
 
 
89356 }
89357
89358 if( rc!=0 ){
89359 int sortFlags = pPKey2->pKeyInfo->aSortFlags[i];
89360 if( sortFlags ){
@@ -93876,11 +94096,11 @@
93876 ** this opcode. So jump over the coroutine implementation to
93877 ** address P2.
93878 **
93879 ** See also: EndCoroutine
93880 */
93881 case OP_InitCoroutine: { /* jump */
93882 assert( pOp->p1>0 && pOp->p1<=(p->nMem+1 - p->nCursor) );
93883 assert( pOp->p2>=0 && pOp->p2<p->nOp );
93884 assert( pOp->p3>=0 && pOp->p3<p->nOp );
93885 pOut = &aMem[pOp->p1];
93886 assert( !VdbeMemDynamic(pOut) );
@@ -93929,11 +94149,11 @@
93929 ** EndCoroutine, then jump to P2 rather than continuing with the
93930 ** next instruction.
93931 **
93932 ** See also: InitCoroutine
93933 */
93934 case OP_Yield: { /* in1, jump */
93935 int pcDest;
93936 pIn1 = &aMem[pOp->p1];
93937 assert( VdbeMemDynamic(pIn1)==0 );
93938 pIn1->flags = MEM_Int;
93939 pcDest = (int)pIn1->u.i;
@@ -94259,23 +94479,19 @@
94259 pOut->enc = encoding;
94260 UPDATE_MAX_BLOBSIZE(pOut);
94261 break;
94262 }
94263
94264 /* Opcode: Variable P1 P2 * P4 *
94265 ** Synopsis: r[P2]=parameter(P1,P4)
94266 **
94267 ** Transfer the values of bound parameter P1 into register P2
94268 **
94269 ** If the parameter is named, then its name appears in P4.
94270 ** The P4 value is used by sqlite3_bind_parameter_name().
94271 */
94272 case OP_Variable: { /* out2 */
94273 Mem *pVar; /* Value being transferred */
94274
94275 assert( pOp->p1>0 && pOp->p1<=p->nVar );
94276 assert( pOp->p4.z==0 || pOp->p4.z==sqlite3VListNumToName(p->pVList,pOp->p1) );
94277 pVar = &p->aVar[pOp->p1 - 1];
94278 if( sqlite3VdbeMemTooBig(pVar) ){
94279 goto too_big;
94280 }
94281 pOut = &aMem[pOp->p2];
@@ -94792,11 +95008,11 @@
94792 ** Force the value in register P1 to be an integer. If the value
94793 ** in P1 is not an integer and cannot be converted into an integer
94794 ** without data loss, then jump immediately to P2, or if P2==0
94795 ** raise an SQLITE_MISMATCH exception.
94796 */
94797 case OP_MustBeInt: { /* jump, in1 */
94798 pIn1 = &aMem[pOp->p1];
94799 if( (pIn1->flags & MEM_Int)==0 ){
94800 applyAffinity(pIn1, SQLITE_AFF_NUMERIC, encoding);
94801 if( (pIn1->flags & MEM_Int)==0 ){
94802 VdbeBranchTaken(1, 2);
@@ -97476,14 +97692,14 @@
97476 ** OPFLAG_SEEKEQ flags is a hint to the btree layer to say that this
97477 ** is an equality search.
97478 **
97479 ** See also: Found, NotFound, SeekGt, SeekGe, SeekLt
97480 */
97481 case OP_SeekLT: /* jump, in3, group, ncycle */
97482 case OP_SeekLE: /* jump, in3, group, ncycle */
97483 case OP_SeekGE: /* jump, in3, group, ncycle */
97484 case OP_SeekGT: { /* jump, in3, group, ncycle */
97485 int res; /* Comparison result */
97486 int oc; /* Opcode */
97487 VdbeCursor *pC; /* The cursor to seek */
97488 UnpackedRecord r; /* The key to seek for */
97489 int nField; /* Number of columns or fields in the key */
@@ -98146,11 +98362,11 @@
98146 ** in either direction. In other words, the Next and Prev opcodes will
98147 ** not work following this opcode.
98148 **
98149 ** See also: Found, NotFound, NoConflict, SeekRowid
98150 */
98151 case OP_SeekRowid: { /* jump, in3, ncycle */
98152 VdbeCursor *pC;
98153 BtCursor *pCrsr;
98154 int res;
98155 u64 iKey;
98156
@@ -98905,11 +99121,11 @@
98905 ** This opcode leaves the cursor configured to move in reverse order,
98906 ** from the end toward the beginning. In other words, the cursor is
98907 ** configured to use Prev, not Next.
98908 */
98909 case OP_SeekEnd: /* ncycle */
98910 case OP_Last: { /* jump, ncycle */
98911 VdbeCursor *pC;
98912 BtCursor *pCrsr;
98913 int res;
98914
98915 assert( pOp->p1>=0 && pOp->p1<p->nCursor );
@@ -99022,11 +99238,11 @@
99022 **
99023 ** This opcode leaves the cursor configured to move in forward order,
99024 ** from the beginning toward the end. In other words, the cursor is
99025 ** configured to use Next, not Prev.
99026 */
99027 case OP_Rewind: { /* jump, ncycle */
99028 VdbeCursor *pC;
99029 BtCursor *pCrsr;
99030 int res;
99031
99032 assert( pOp->p1>=0 && pOp->p1<p->nCursor );
@@ -99865,17 +100081,17 @@
99865
99866 #ifndef SQLITE_OMIT_INTEGRITY_CHECK
99867 /* Opcode: IntegrityCk P1 P2 P3 P4 P5
99868 **
99869 ** Do an analysis of the currently open database. Store in
99870 ** register P1 the text of an error message describing any problems.
99871 ** If no problems are found, store a NULL in register P1.
99872 **
99873 ** The register P3 contains one less than the maximum number of allowed errors.
99874 ** At most reg(P3) errors will be reported.
99875 ** In other words, the analysis stops as soon as reg(P3) errors are
99876 ** seen. Reg(P3) is updated with the number of errors remaining.
99877 **
99878 ** The root page numbers of all tables in the database are integers
99879 ** stored in P4_INTARRAY argument.
99880 **
99881 ** If P5 is not zero, the check is done on the auxiliary database
@@ -99889,23 +100105,25 @@
99889 int nErr; /* Number of errors reported */
99890 char *z; /* Text of the error report */
99891 Mem *pnErr; /* Register keeping track of errors remaining */
99892
99893 assert( p->bIsReader );
 
99894 nRoot = pOp->p2;
99895 aRoot = pOp->p4.ai;
99896 assert( nRoot>0 );
 
99897 assert( aRoot[0]==(Pgno)nRoot );
99898 assert( pOp->p3>0 && pOp->p3<=(p->nMem+1 - p->nCursor) );
99899 pnErr = &aMem[pOp->p3];
99900 assert( (pnErr->flags & MEM_Int)!=0 );
99901 assert( (pnErr->flags & (MEM_Str|MEM_Blob))==0 );
99902 pIn1 = &aMem[pOp->p1];
99903 assert( pOp->p5<db->nDb );
99904 assert( DbMaskTest(p->btreeMask, pOp->p5) );
99905 rc = sqlite3BtreeIntegrityCheck(db, db->aDb[pOp->p5].pBt, &aRoot[1], nRoot,
99906 (int)pnErr->u.i+1, &nErr, &z);
99907 sqlite3VdbeMemSetNull(pIn1);
99908 if( nErr==0 ){
99909 assert( z==0 );
99910 }else if( rc ){
99911 sqlite3_free(z);
@@ -100028,19 +100246,21 @@
100028 ** Execute the trigger program passed as P4 (type P4_SUBPROGRAM).
100029 **
100030 ** P1 contains the address of the memory cell that contains the first memory
100031 ** cell in an array of values used as arguments to the sub-program. P2
100032 ** contains the address to jump to if the sub-program throws an IGNORE
100033 ** exception using the RAISE() function. Register P3 contains the address
 
 
100034 ** of a memory cell in this (the parent) VM that is used to allocate the
100035 ** memory required by the sub-vdbe at runtime.
100036 **
100037 ** P4 is a pointer to the VM containing the trigger program.
100038 **
100039 ** If P5 is non-zero, then recursive program invocation is enabled.
100040 */
100041 case OP_Program: { /* jump */
100042 int nMem; /* Number of memory registers for sub-program */
100043 int nByte; /* Bytes of runtime space required for sub-program */
100044 Mem *pRt; /* Register to allocate runtime space */
100045 Mem *pMem; /* Used to iterate through memory cells */
100046 Mem *pEnd; /* Last memory cell in new array */
@@ -101585,11 +101805,11 @@
101585 **
101586 ** If P3 is not zero, then it is an address to jump to if an SQLITE_CORRUPT
101587 ** error is encountered.
101588 */
101589 case OP_Trace:
101590 case OP_Init: { /* jump */
101591 int i;
101592 #ifndef SQLITE_OMIT_TRACE
101593 char *zTrace;
101594 #endif
101595
@@ -107325,10 +107545,23 @@
107325 ** If this optimization occurs, also restore the NameContext ref-counts
107326 ** to the state they where in before the "column" LHS expression was
107327 ** resolved. This prevents "column" from being counted as having been
107328 ** referenced, which might prevent a SELECT from being erroneously
107329 ** marked as correlated.
 
 
 
 
 
 
 
 
 
 
 
 
 
107330 */
107331 case TK_NOTNULL:
107332 case TK_ISNULL: {
107333 int anRef[8];
107334 NameContext *p;
@@ -107335,23 +107568,40 @@
107335 int i;
107336 for(i=0, p=pNC; p && i<ArraySize(anRef); p=p->pNext, i++){
107337 anRef[i] = p->nRef;
107338 }
107339 sqlite3WalkExpr(pWalker, pExpr->pLeft);
107340 if( 0==sqlite3ExprCanBeNull(pExpr->pLeft) && !IN_RENAME_OBJECT ){
107341 testcase( ExprHasProperty(pExpr, EP_OuterON) );
107342 assert( !ExprHasProperty(pExpr, EP_IntValue) );
107343 pExpr->u.iValue = (pExpr->op==TK_NOTNULL);
107344 pExpr->flags |= EP_IntValue;
107345 pExpr->op = TK_INTEGER;
107346
107347 for(i=0, p=pNC; p && i<ArraySize(anRef); p=p->pNext, i++){
107348 p->nRef = anRef[i];
107349 }
107350 sqlite3ExprDelete(pParse->db, pExpr->pLeft);
107351 pExpr->pLeft = 0;
107352 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
107353 return WRC_Prune;
107354 }
107355
107356 /* A column name: ID
107357 ** Or table name and column name: ID.ID
@@ -108245,11 +108495,13 @@
108245 sqlite3ErrorMsg(pParse, "HAVING clause on a non-aggregate query");
108246 return WRC_Abort;
108247 }
108248 if( sqlite3ResolveExprNames(&sNC, p->pHaving) ) return WRC_Abort;
108249 }
 
108250 if( sqlite3ResolveExprNames(&sNC, p->pWhere) ) return WRC_Abort;
 
108251
108252 /* Resolve names in table-valued-function arguments */
108253 for(i=0; i<p->pSrc->nSrc; i++){
108254 SrcItem *pItem = &p->pSrc->a[i];
108255 if( pItem->fg.isTabFunc
@@ -109480,15 +109732,16 @@
109480 ** If dequote is false, no dequoting is performed. The deQuote
109481 ** parameter is ignored if pToken is NULL or if the token does not
109482 ** appear to be quoted. If the quotes were of the form "..." (double-quotes)
109483 ** then the EP_DblQuoted flag is set on the expression node.
109484 **
109485 ** Special case: If op==TK_INTEGER and pToken points to a string that
109486 ** can be translated into a 32-bit integer, then the token is not
109487 ** stored in u.zToken. Instead, the integer values is written
109488 ** into u.iValue and the EP_IntValue flag is set. No extra storage
109489 ** is allocated to hold the integer text and the dequote flag is ignored.
 
109490 */
109491 SQLITE_PRIVATE Expr *sqlite3ExprAlloc(
109492 sqlite3 *db, /* Handle for sqlite3DbMallocRawNN() */
109493 int op, /* Expression opcode */
109494 const Token *pToken, /* Token argument. Might be NULL */
@@ -109500,11 +109753,11 @@
109500
109501 assert( db!=0 );
109502 if( pToken ){
109503 if( op!=TK_INTEGER || pToken->z==0
109504 || sqlite3GetInt32(pToken->z, &iValue)==0 ){
109505 nExtra = pToken->n+1;
109506 assert( iValue>=0 );
109507 }
109508 }
109509 pNew = sqlite3DbMallocRawNN(db, sizeof(Expr)+nExtra);
109510 if( pNew ){
@@ -113182,16 +113435,10 @@
113182 case TK_VARIABLE: {
113183 assert( !ExprHasProperty(pExpr, EP_IntValue) );
113184 assert( pExpr->u.zToken!=0 );
113185 assert( pExpr->u.zToken[0]!=0 );
113186 sqlite3VdbeAddOp2(v, OP_Variable, pExpr->iColumn, target);
113187 if( pExpr->u.zToken[1]!=0 ){
113188 const char *z = sqlite3VListNumToName(pParse->pVList, pExpr->iColumn);
113189 assert( pExpr->u.zToken[0]=='?' || (z && !strcmp(pExpr->u.zToken, z)) );
113190 pParse->pVList[0] = 0; /* Indicate VList may no longer be enlarged */
113191 sqlite3VdbeAppendP4(v, (char*)z, P4_STATIC);
113192 }
113193 return target;
113194 }
113195 case TK_REGISTER: {
113196 return pExpr->iTable;
113197 }
@@ -119190,10 +119437,11 @@
119190
119191 /* No STAT4 data is generated if the number of rows is zero */
119192 if( addrGotoEnd==0 ){
119193 sqlite3VdbeAddOp2(v, OP_Cast, regStat1, SQLITE_AFF_INTEGER);
119194 addrGotoEnd = sqlite3VdbeAddOp1(v, OP_IfNot, regStat1);
 
119195 }
119196
119197 if( doOnce ){
119198 int mxCol = nCol;
119199 Index *pX;
@@ -129185,17 +129433,17 @@
129185 switch( sqlite3_value_type(pValue) ){
129186 case SQLITE_FLOAT: {
129187 double r1, r2;
129188 const char *zVal;
129189 r1 = sqlite3_value_double(pValue);
129190 sqlite3_str_appendf(pStr, "%!.15g", r1);
129191 zVal = sqlite3_str_value(pStr);
129192 if( zVal ){
129193 sqlite3AtoF(zVal, &r2, pStr->nChar, SQLITE_UTF8);
129194 if( r1!=r2 ){
129195 sqlite3_str_reset(pStr);
129196 sqlite3_str_appendf(pStr, "%!.20e", r1);
129197 }
129198 }
129199 break;
129200 }
129201 case SQLITE_INTEGER: {
@@ -133413,11 +133661,11 @@
133413 pNx->pUpsertSrc = pTabList;
133414 pNx->regData = regData;
133415 pNx->iDataCur = iDataCur;
133416 pNx->iIdxCur = iIdxCur;
133417 if( pNx->pUpsertTarget ){
133418 if( sqlite3UpsertAnalyzeTarget(pParse, pTabList, pNx) ){
133419 goto insert_cleanup;
133420 }
133421 }
133422 pNx = pNx->pNextUpsert;
133423 }while( pNx!=0 );
@@ -139670,11 +139918,10 @@
139670 for(i=0; i<db->nDb; i++){
139671 HashElem *x; /* For looping over tables in the schema */
139672 Hash *pTbls; /* Set of all tables in the schema */
139673 int *aRoot; /* Array of root page numbers of all btrees */
139674 int cnt = 0; /* Number of entries in aRoot[] */
139675 int mxIdx = 0; /* Maximum number of indexes for any table */
139676
139677 if( OMIT_TEMPDB && i==1 ) continue;
139678 if( iDb>=0 && i!=iDb ) continue;
139679
139680 sqlite3CodeVerifySchema(pParse, i);
@@ -139692,11 +139939,10 @@
139692 Index *pIdx; /* An index on pTab */
139693 int nIdx; /* Number of indexes on pTab */
139694 if( pObjTab && pObjTab!=pTab ) continue;
139695 if( HasRowid(pTab) ) cnt++;
139696 for(nIdx=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, nIdx++){ cnt++; }
139697 if( nIdx>mxIdx ) mxIdx = nIdx;
139698 }
139699 if( cnt==0 ) continue;
139700 if( pObjTab ) cnt++;
139701 aRoot = sqlite3DbMallocRawNN(db, sizeof(int)*(cnt+1));
139702 if( aRoot==0 ) break;
@@ -139712,23 +139958,53 @@
139712 }
139713 }
139714 aRoot[0] = cnt;
139715
139716 /* Make sure sufficient number of registers have been allocated */
139717 sqlite3TouchRegister(pParse, 8+mxIdx);
139718 sqlite3ClearTempRegCache(pParse);
139719
139720 /* Do the b-tree integrity checks */
139721 sqlite3VdbeAddOp4(v, OP_IntegrityCk, 2, cnt, 1, (char*)aRoot,P4_INTARRAY);
139722 sqlite3VdbeChangeP5(v, (u8)i);
139723 addr = sqlite3VdbeAddOp1(v, OP_IsNull, 2); VdbeCoverage(v);
139724 sqlite3VdbeAddOp4(v, OP_String8, 0, 3, 0,
139725 sqlite3MPrintf(db, "*** in database %s ***\n", db->aDb[i].zDbSName),
139726 P4_DYNAMIC);
139727 sqlite3VdbeAddOp3(v, OP_Concat, 2, 3, 3);
139728 integrityCheckResultRow(v);
139729 sqlite3VdbeJumpHere(v, addr);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
139730
139731 /* Make sure all the indices are constructed correctly.
139732 */
139733 for(x=sqliteHashFirst(pTbls); x; x=sqliteHashNext(x)){
139734 Table *pTab = sqliteHashData(x);
@@ -140049,25 +140325,13 @@
140049 sqlite3ResolvePartIdxLabel(pParse, jmp3);
140050 }
140051 }
140052 sqlite3VdbeAddOp2(v, OP_Next, iDataCur, loopTop); VdbeCoverage(v);
140053 sqlite3VdbeJumpHere(v, loopTop-1);
140054 if( !isQuick ){
140055 sqlite3VdbeLoadString(v, 2, "wrong # of entries in index ");
140056 for(j=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, j++){
140057 if( pPk==pIdx ) continue;
140058 sqlite3VdbeAddOp2(v, OP_Count, iIdxCur+j, 3);
140059 addr = sqlite3VdbeAddOp3(v, OP_Eq, 8+j, 0, 3); VdbeCoverage(v);
140060 sqlite3VdbeChangeP5(v, SQLITE_NOTNULL);
140061 sqlite3VdbeLoadString(v, 4, pIdx->zName);
140062 sqlite3VdbeAddOp3(v, OP_Concat, 4, 2, 3);
140063 integrityCheckResultRow(v);
140064 sqlite3VdbeJumpHere(v, addr);
140065 }
140066 if( pPk ){
140067 sqlite3ReleaseTempRange(pParse, r2, pPk->nKeyCol);
140068 }
140069 }
140070 }
140071
140072 #ifndef SQLITE_OMIT_VIRTUALTABLE
140073 /* Second pass to invoke the xIntegrity method on all virtual
@@ -153828,11 +154092,12 @@
153828 ** is wrong.
153829 */
153830 SQLITE_PRIVATE int sqlite3UpsertAnalyzeTarget(
153831 Parse *pParse, /* The parsing context */
153832 SrcList *pTabList, /* Table into which we are inserting */
153833 Upsert *pUpsert /* The ON CONFLICT clauses */
 
153834 ){
153835 Table *pTab; /* That table into which we are inserting */
153836 int rc; /* Result code */
153837 int iCursor; /* Cursor used by pTab */
153838 Index *pIdx; /* One of the indexes of pTab */
@@ -153931,10 +154196,18 @@
153931 /* Column ii of the index did not match any term of the conflict target.
153932 ** Continue the search with the next index. */
153933 continue;
153934 }
153935 pUpsert->pUpsertIdx = pIdx;
 
 
 
 
 
 
 
 
153936 break;
153937 }
153938 if( pUpsert->pUpsertIdx==0 ){
153939 char zWhich[16];
153940 if( nClause==0 && pUpsert->pNextUpsert==0 ){
@@ -153957,13 +154230,17 @@
153957 */
153958 SQLITE_PRIVATE int sqlite3UpsertNextIsIPK(Upsert *pUpsert){
153959 Upsert *pNext;
153960 if( NEVER(pUpsert==0) ) return 0;
153961 pNext = pUpsert->pNextUpsert;
153962 if( pNext==0 ) return 1;
153963 if( pNext->pUpsertTarget==0 ) return 1;
153964 if( pNext->pUpsertIdx==0 ) return 1;
 
 
 
 
153965 return 0;
153966 }
153967
153968 /*
153969 ** Given the list of ON CONFLICT clauses described by pUpsert, and
@@ -160255,11 +160532,11 @@
160255 if( pIdx->aColExpr==0 ) continue;
160256 for(i=0; i<pIdx->nKeyCol; i++){
160257 if( pIdx->aiColumn[i]!=XN_EXPR ) continue;
160258 assert( pIdx->bHasExpr );
160259 if( sqlite3ExprCompareSkip(pExpr,pIdx->aColExpr->a[i].pExpr,iCur)==0
160260 && pExpr->op!=TK_STRING
160261 ){
160262 aiCurCol[0] = iCur;
160263 aiCurCol[1] = XN_EXPR;
160264 return 1;
160265 }
@@ -164114,11 +164391,13 @@
164114 assert( pNew->u.btree.nBtm==0 );
164115 opMask = WO_EQ|WO_IN|WO_GT|WO_GE|WO_LT|WO_LE|WO_ISNULL|WO_IS;
164116 }
164117 if( pProbe->bUnordered || pProbe->bLowQual ){
164118 if( pProbe->bUnordered ) opMask &= ~(WO_GT|WO_GE|WO_LT|WO_LE);
164119 if( pProbe->bLowQual ) opMask &= ~(WO_EQ|WO_IN|WO_IS);
 
 
164120 }
164121
164122 assert( pNew->u.btree.nEq<pProbe->nColumn );
164123 assert( pNew->u.btree.nEq<pProbe->nKeyCol
164124 || pProbe->idxType!=SQLITE_IDXTYPE_PRIMARYKEY );
@@ -171696,12 +171975,13 @@
171696 #define TK_SELECT_COLUMN 178
171697 #define TK_IF_NULL_ROW 179
171698 #define TK_ASTERISK 180
171699 #define TK_SPAN 181
171700 #define TK_ERROR 182
171701 #define TK_SPACE 183
171702 #define TK_ILLEGAL 184
 
171703 #endif
171704 /**************** End token definitions ***************************************/
171705
171706 /* The next sections is a series of control #defines.
171707 ** various aspects of the generated parser.
@@ -171762,35 +172042,35 @@
171762 #ifndef INTERFACE
171763 # define INTERFACE 1
171764 #endif
171765 /************* Begin control #defines *****************************************/
171766 #define YYCODETYPE unsigned short int
171767 #define YYNOCODE 319
171768 #define YYACTIONTYPE unsigned short int
171769 #define YYWILDCARD 101
171770 #define sqlite3ParserTOKENTYPE Token
171771 typedef union {
171772 int yyinit;
171773 sqlite3ParserTOKENTYPE yy0;
171774 TriggerStep* yy33;
171775 Window* yy41;
171776 Select* yy47;
171777 SrcList* yy131;
171778 struct TrigEvent yy180;
171779 struct {int value; int mask;} yy231;
171780 IdList* yy254;
171781 u32 yy285;
171782 ExprList* yy322;
171783 Cte* yy385;
171784 int yy394;
171785 Upsert* yy444;
171786 u8 yy516;
171787 With* yy521;
171788 const char* yy522;
171789 Expr* yy528;
171790 OnOrUsing yy561;
171791 struct FrameBound yy595;
171792 } YYMINORTYPE;
171793 #ifndef YYSTACKDEPTH
171794 #define YYSTACKDEPTH 100
171795 #endif
171796 #define sqlite3ParserARG_SDECL
@@ -171806,23 +172086,23 @@
171806 #define sqlite3ParserCTX_PARAM ,pParse
171807 #define sqlite3ParserCTX_FETCH Parse *pParse=yypParser->pParse;
171808 #define sqlite3ParserCTX_STORE yypParser->pParse=pParse;
171809 #define YYFALLBACK 1
171810 #define YYNSTATE 579
171811 #define YYNRULE 405
171812 #define YYNRULE_WITH_ACTION 340
171813 #define YYNTOKEN 185
171814 #define YY_MAX_SHIFT 578
171815 #define YY_MIN_SHIFTREDUCE 838
171816 #define YY_MAX_SHIFTREDUCE 1242
171817 #define YY_ERROR_ACTION 1243
171818 #define YY_ACCEPT_ACTION 1244
171819 #define YY_NO_ACTION 1245
171820 #define YY_MIN_REDUCE 1246
171821 #define YY_MAX_REDUCE 1650
171822 #define YY_MIN_DSTRCTR 204
171823 #define YY_MAX_DSTRCTR 316
171824 /************* End control #defines *******************************************/
171825 #define YY_NLOOKAHEAD ((int)(sizeof(yy_lookahead)/sizeof(yy_lookahead[0])))
171826
171827 /* Define the yytestcase() macro to be a no-op if is not already defined
171828 ** otherwise.
@@ -171901,623 +172181,626 @@
171901 ** yy_reduce_ofst[] For each state, the offset into yy_action for
171902 ** shifting non-terminals after a reduce.
171903 ** yy_default[] Default action for each state.
171904 **
171905 *********** Begin parsing tables **********************************************/
171906 #define YY_ACTTAB_COUNT (2100)
171907 static const YYACTIONTYPE yy_action[] = {
171908 /* 0 */ 572, 210, 572, 119, 116, 231, 572, 119, 116, 231,
171909 /* 10 */ 572, 1317, 379, 1296, 410, 566, 566, 566, 572, 411,
171910 /* 20 */ 380, 1317, 1279, 42, 42, 42, 42, 210, 1529, 72,
171911 /* 30 */ 72, 974, 421, 42, 42, 495, 305, 281, 305, 975,
171912 /* 40 */ 399, 72, 72, 126, 127, 81, 1217, 1217, 1054, 1057,
171913 /* 50 */ 1044, 1044, 124, 124, 125, 125, 125, 125, 480, 411,
171914 /* 60 */ 1244, 1, 1, 578, 2, 1248, 554, 119, 116, 231,
171915 /* 70 */ 319, 484, 147, 484, 528, 119, 116, 231, 533, 1330,
171916 /* 80 */ 419, 527, 143, 126, 127, 81, 1217, 1217, 1054, 1057,
171917 /* 90 */ 1044, 1044, 124, 124, 125, 125, 125, 125, 119, 116,
171918 /* 100 */ 231, 329, 123, 123, 123, 123, 122, 122, 121, 121,
171919 /* 110 */ 121, 120, 117, 448, 286, 286, 286, 286, 446, 446,
171920 /* 120 */ 446, 1568, 378, 1570, 1193, 377, 1164, 569, 1164, 569,
171921 /* 130 */ 411, 1568, 541, 261, 228, 448, 102, 146, 453, 318,
171922 /* 140 */ 563, 242, 123, 123, 123, 123, 122, 122, 121, 121,
171923 /* 150 */ 121, 120, 117, 448, 126, 127, 81, 1217, 1217, 1054,
171924 /* 160 */ 1057, 1044, 1044, 124, 124, 125, 125, 125, 125, 143,
171925 /* 170 */ 296, 1193, 341, 452, 121, 121, 121, 120, 117, 448,
171926 /* 180 */ 128, 1193, 1194, 1193, 149, 445, 444, 572, 120, 117,
171927 /* 190 */ 448, 125, 125, 125, 125, 118, 123, 123, 123, 123,
171928 /* 200 */ 122, 122, 121, 121, 121, 120, 117, 448, 458, 114,
171929 /* 210 */ 13, 13, 550, 123, 123, 123, 123, 122, 122, 121,
171930 /* 220 */ 121, 121, 120, 117, 448, 424, 318, 563, 1193, 1194,
171931 /* 230 */ 1193, 150, 1225, 411, 1225, 125, 125, 125, 125, 123,
171932 /* 240 */ 123, 123, 123, 122, 122, 121, 121, 121, 120, 117,
171933 /* 250 */ 448, 469, 344, 1041, 1041, 1055, 1058, 126, 127, 81,
171934 /* 260 */ 1217, 1217, 1054, 1057, 1044, 1044, 124, 124, 125, 125,
171935 /* 270 */ 125, 125, 1282, 526, 224, 1193, 572, 411, 226, 519,
171936 /* 280 */ 177, 83, 84, 123, 123, 123, 123, 122, 122, 121,
171937 /* 290 */ 121, 121, 120, 117, 448, 1010, 16, 16, 1193, 134,
171938 /* 300 */ 134, 126, 127, 81, 1217, 1217, 1054, 1057, 1044, 1044,
171939 /* 310 */ 124, 124, 125, 125, 125, 125, 123, 123, 123, 123,
171940 /* 320 */ 122, 122, 121, 121, 121, 120, 117, 448, 1045, 550,
171941 /* 330 */ 1193, 375, 1193, 1194, 1193, 254, 1438, 401, 508, 505,
171942 /* 340 */ 504, 112, 564, 570, 4, 929, 929, 435, 503, 342,
171943 /* 350 */ 464, 330, 362, 396, 1238, 1193, 1194, 1193, 567, 572,
171944 /* 360 */ 123, 123, 123, 123, 122, 122, 121, 121, 121, 120,
171945 /* 370 */ 117, 448, 286, 286, 371, 1581, 1607, 445, 444, 155,
171946 /* 380 */ 411, 449, 72, 72, 1289, 569, 1222, 1193, 1194, 1193,
171947 /* 390 */ 86, 1224, 273, 561, 547, 520, 520, 572, 99, 1223,
171948 /* 400 */ 6, 1281, 476, 143, 126, 127, 81, 1217, 1217, 1054,
171949 /* 410 */ 1057, 1044, 1044, 124, 124, 125, 125, 125, 125, 554,
171950 /* 420 */ 13, 13, 1031, 511, 1225, 1193, 1225, 553, 110, 110,
171951 /* 430 */ 224, 572, 1239, 177, 572, 429, 111, 199, 449, 573,
171952 /* 440 */ 449, 432, 1555, 1019, 327, 555, 1193, 272, 289, 370,
171953 /* 450 */ 514, 365, 513, 259, 72, 72, 547, 72, 72, 361,
171954 /* 460 */ 318, 563, 1613, 123, 123, 123, 123, 122, 122, 121,
171955 /* 470 */ 121, 121, 120, 117, 448, 1019, 1019, 1021, 1022, 28,
171956 /* 480 */ 286, 286, 1193, 1194, 1193, 1159, 572, 1612, 411, 904,
171957 /* 490 */ 192, 554, 358, 569, 554, 940, 537, 521, 1159, 437,
171958 /* 500 */ 415, 1159, 556, 1193, 1194, 1193, 572, 548, 548, 52,
171959 /* 510 */ 52, 216, 126, 127, 81, 1217, 1217, 1054, 1057, 1044,
171960 /* 520 */ 1044, 124, 124, 125, 125, 125, 125, 1193, 478, 136,
171961 /* 530 */ 136, 411, 286, 286, 1493, 509, 122, 122, 121, 121,
171962 /* 540 */ 121, 120, 117, 448, 1010, 569, 522, 219, 545, 545,
171963 /* 550 */ 318, 563, 143, 6, 536, 126, 127, 81, 1217, 1217,
171964 /* 560 */ 1054, 1057, 1044, 1044, 124, 124, 125, 125, 125, 125,
171965 /* 570 */ 1557, 123, 123, 123, 123, 122, 122, 121, 121, 121,
171966 /* 580 */ 120, 117, 448, 489, 1193, 1194, 1193, 486, 283, 1270,
171967 /* 590 */ 960, 254, 1193, 375, 508, 505, 504, 1193, 342, 574,
171968 /* 600 */ 1193, 574, 411, 294, 503, 960, 879, 193, 484, 318,
171969 /* 610 */ 563, 386, 292, 382, 123, 123, 123, 123, 122, 122,
171970 /* 620 */ 121, 121, 121, 120, 117, 448, 126, 127, 81, 1217,
171971 /* 630 */ 1217, 1054, 1057, 1044, 1044, 124, 124, 125, 125, 125,
171972 /* 640 */ 125, 411, 396, 1139, 1193, 872, 101, 286, 286, 1193,
171973 /* 650 */ 1194, 1193, 375, 1096, 1193, 1194, 1193, 1193, 1194, 1193,
171974 /* 660 */ 569, 459, 33, 375, 235, 126, 127, 81, 1217, 1217,
171975 /* 670 */ 1054, 1057, 1044, 1044, 124, 124, 125, 125, 125, 125,
171976 /* 680 */ 1437, 962, 572, 230, 961, 123, 123, 123, 123, 122,
171977 /* 690 */ 122, 121, 121, 121, 120, 117, 448, 1159, 230, 1193,
171978 /* 700 */ 158, 1193, 1194, 1193, 1556, 13, 13, 303, 960, 1233,
171979 /* 710 */ 1159, 154, 411, 1159, 375, 1584, 1177, 5, 371, 1581,
171980 /* 720 */ 431, 1239, 3, 960, 123, 123, 123, 123, 122, 122,
171981 /* 730 */ 121, 121, 121, 120, 117, 448, 126, 127, 81, 1217,
171982 /* 740 */ 1217, 1054, 1057, 1044, 1044, 124, 124, 125, 125, 125,
171983 /* 750 */ 125, 411, 210, 571, 1193, 1032, 1193, 1194, 1193, 1193,
171984 /* 760 */ 390, 855, 156, 1555, 376, 404, 1101, 1101, 492, 572,
171985 /* 770 */ 469, 344, 1322, 1322, 1555, 126, 127, 81, 1217, 1217,
171986 /* 780 */ 1054, 1057, 1044, 1044, 124, 124, 125, 125, 125, 125,
171987 /* 790 */ 130, 572, 13, 13, 532, 123, 123, 123, 123, 122,
171988 /* 800 */ 122, 121, 121, 121, 120, 117, 448, 304, 572, 457,
171989 /* 810 */ 229, 1193, 1194, 1193, 13, 13, 1193, 1194, 1193, 1300,
171990 /* 820 */ 467, 1270, 411, 1320, 1320, 1555, 1015, 457, 456, 436,
171991 /* 830 */ 301, 72, 72, 1268, 123, 123, 123, 123, 122, 122,
171992 /* 840 */ 121, 121, 121, 120, 117, 448, 126, 127, 81, 1217,
171993 /* 850 */ 1217, 1054, 1057, 1044, 1044, 124, 124, 125, 125, 125,
171994 /* 860 */ 125, 411, 384, 1076, 1159, 286, 286, 421, 314, 280,
171995 /* 870 */ 280, 287, 287, 461, 408, 407, 1539, 1159, 569, 572,
171996 /* 880 */ 1159, 1196, 569, 409, 569, 126, 127, 81, 1217, 1217,
171997 /* 890 */ 1054, 1057, 1044, 1044, 124, 124, 125, 125, 125, 125,
171998 /* 900 */ 457, 1485, 13, 13, 1541, 123, 123, 123, 123, 122,
171999 /* 910 */ 122, 121, 121, 121, 120, 117, 448, 202, 572, 462,
172000 /* 920 */ 1587, 578, 2, 1248, 843, 844, 845, 1563, 319, 409,
172001 /* 930 */ 147, 6, 411, 257, 256, 255, 208, 1330, 9, 1196,
172002 /* 940 */ 264, 72, 72, 1436, 123, 123, 123, 123, 122, 122,
172003 /* 950 */ 121, 121, 121, 120, 117, 448, 126, 127, 81, 1217,
172004 /* 960 */ 1217, 1054, 1057, 1044, 1044, 124, 124, 125, 125, 125,
172005 /* 970 */ 125, 572, 286, 286, 572, 1213, 411, 577, 315, 1248,
172006 /* 980 */ 421, 371, 1581, 356, 319, 569, 147, 495, 529, 1644,
172007 /* 990 */ 397, 935, 495, 1330, 71, 71, 934, 72, 72, 242,
172008 /* 1000 */ 1328, 105, 81, 1217, 1217, 1054, 1057, 1044, 1044, 124,
172009 /* 1010 */ 124, 125, 125, 125, 125, 123, 123, 123, 123, 122,
172010 /* 1020 */ 122, 121, 121, 121, 120, 117, 448, 1117, 286, 286,
172011 /* 1030 */ 1422, 452, 1528, 1213, 443, 286, 286, 1492, 1355, 313,
172012 /* 1040 */ 478, 569, 1118, 454, 351, 495, 354, 1266, 569, 209,
172013 /* 1050 */ 572, 418, 179, 572, 1031, 242, 385, 1119, 523, 123,
172014 /* 1060 */ 123, 123, 123, 122, 122, 121, 121, 121, 120, 117,
172015 /* 1070 */ 448, 1020, 108, 72, 72, 1019, 13, 13, 915, 572,
172016 /* 1080 */ 1498, 572, 286, 286, 98, 530, 1537, 452, 916, 1334,
172017 /* 1090 */ 1329, 203, 411, 286, 286, 569, 152, 211, 1498, 1500,
172018 /* 1100 */ 426, 569, 56, 56, 57, 57, 569, 1019, 1019, 1021,
172019 /* 1110 */ 447, 572, 411, 531, 12, 297, 126, 127, 81, 1217,
172020 /* 1120 */ 1217, 1054, 1057, 1044, 1044, 124, 124, 125, 125, 125,
172021 /* 1130 */ 125, 572, 411, 867, 15, 15, 126, 127, 81, 1217,
172022 /* 1140 */ 1217, 1054, 1057, 1044, 1044, 124, 124, 125, 125, 125,
172023 /* 1150 */ 125, 373, 529, 264, 44, 44, 126, 115, 81, 1217,
172024 /* 1160 */ 1217, 1054, 1057, 1044, 1044, 124, 124, 125, 125, 125,
172025 /* 1170 */ 125, 1498, 478, 1271, 417, 123, 123, 123, 123, 122,
172026 /* 1180 */ 122, 121, 121, 121, 120, 117, 448, 205, 1213, 495,
172027 /* 1190 */ 430, 867, 468, 322, 495, 123, 123, 123, 123, 122,
172028 /* 1200 */ 122, 121, 121, 121, 120, 117, 448, 572, 557, 1140,
172029 /* 1210 */ 1642, 1422, 1642, 543, 572, 123, 123, 123, 123, 122,
172030 /* 1220 */ 122, 121, 121, 121, 120, 117, 448, 572, 1422, 572,
172031 /* 1230 */ 13, 13, 542, 323, 1325, 411, 334, 58, 58, 349,
172032 /* 1240 */ 1422, 1170, 326, 286, 286, 549, 1213, 300, 895, 530,
172033 /* 1250 */ 45, 45, 59, 59, 1140, 1643, 569, 1643, 565, 417,
172034 /* 1260 */ 127, 81, 1217, 1217, 1054, 1057, 1044, 1044, 124, 124,
172035 /* 1270 */ 125, 125, 125, 125, 1367, 373, 500, 290, 1193, 512,
172036 /* 1280 */ 1366, 427, 394, 394, 393, 275, 391, 896, 1138, 852,
172037 /* 1290 */ 478, 258, 1422, 1170, 463, 1159, 12, 331, 428, 333,
172038 /* 1300 */ 1117, 460, 236, 258, 325, 460, 544, 1544, 1159, 1098,
172039 /* 1310 */ 491, 1159, 324, 1098, 440, 1118, 335, 516, 123, 123,
172040 /* 1320 */ 123, 123, 122, 122, 121, 121, 121, 120, 117, 448,
172041 /* 1330 */ 1119, 318, 563, 1138, 572, 1193, 1194, 1193, 112, 564,
172042 /* 1340 */ 201, 4, 238, 433, 935, 490, 285, 228, 1517, 934,
172043 /* 1350 */ 170, 560, 572, 142, 1516, 567, 572, 60, 60, 572,
172044 /* 1360 */ 416, 572, 441, 572, 535, 302, 875, 8, 487, 572,
172045 /* 1370 */ 237, 572, 416, 572, 485, 61, 61, 572, 449, 62,
172046 /* 1380 */ 62, 332, 63, 63, 46, 46, 47, 47, 361, 572,
172047 /* 1390 */ 561, 572, 48, 48, 50, 50, 51, 51, 572, 295,
172048 /* 1400 */ 64, 64, 482, 295, 539, 412, 471, 1031, 572, 538,
172049 /* 1410 */ 318, 563, 65, 65, 66, 66, 409, 475, 572, 1031,
172050 /* 1420 */ 572, 14, 14, 875, 1020, 110, 110, 409, 1019, 572,
172051 /* 1430 */ 474, 67, 67, 111, 455, 449, 573, 449, 98, 317,
172052 /* 1440 */ 1019, 132, 132, 133, 133, 572, 1561, 572, 974, 409,
172053 /* 1450 */ 6, 1562, 68, 68, 1560, 6, 975, 572, 6, 1559,
172054 /* 1460 */ 1019, 1019, 1021, 6, 346, 218, 101, 531, 53, 53,
172055 /* 1470 */ 69, 69, 1019, 1019, 1021, 1022, 28, 1586, 1181, 451,
172056 /* 1480 */ 70, 70, 290, 87, 215, 31, 1363, 394, 394, 393,
172057 /* 1490 */ 275, 391, 350, 109, 852, 107, 572, 112, 564, 483,
172058 /* 1500 */ 4, 1212, 572, 239, 153, 572, 39, 236, 1299, 325,
172059 /* 1510 */ 112, 564, 1298, 4, 567, 572, 32, 324, 572, 54,
172060 /* 1520 */ 54, 572, 1135, 353, 398, 165, 165, 567, 166, 166,
172061 /* 1530 */ 572, 291, 355, 572, 17, 357, 572, 449, 77, 77,
172062 /* 1540 */ 1313, 55, 55, 1297, 73, 73, 572, 238, 470, 561,
172063 /* 1550 */ 449, 472, 364, 135, 135, 170, 74, 74, 142, 163,
172064 /* 1560 */ 163, 374, 561, 539, 572, 321, 572, 886, 540, 137,
172065 /* 1570 */ 137, 339, 1353, 422, 298, 237, 539, 572, 1031, 572,
172066 /* 1580 */ 340, 538, 101, 369, 110, 110, 162, 131, 131, 164,
172067 /* 1590 */ 164, 1031, 111, 368, 449, 573, 449, 110, 110, 1019,
172068 /* 1600 */ 157, 157, 141, 141, 572, 111, 572, 449, 573, 449,
172069 /* 1610 */ 412, 288, 1019, 572, 882, 318, 563, 572, 219, 572,
172070 /* 1620 */ 241, 1012, 477, 263, 263, 894, 893, 140, 140, 138,
172071 /* 1630 */ 138, 1019, 1019, 1021, 1022, 28, 139, 139, 525, 455,
172072 /* 1640 */ 76, 76, 78, 78, 1019, 1019, 1021, 1022, 28, 1181,
172073 /* 1650 */ 451, 572, 1083, 290, 112, 564, 1575, 4, 394, 394,
172074 /* 1660 */ 393, 275, 391, 572, 1023, 852, 572, 479, 345, 263,
172075 /* 1670 */ 101, 567, 882, 1376, 75, 75, 1421, 501, 236, 260,
172076 /* 1680 */ 325, 112, 564, 359, 4, 101, 43, 43, 324, 49,
172077 /* 1690 */ 49, 901, 902, 161, 449, 101, 977, 978, 567, 1079,
172078 /* 1700 */ 1349, 260, 965, 932, 263, 114, 561, 1095, 517, 1095,
172079 /* 1710 */ 1083, 1094, 865, 1094, 151, 933, 1144, 114, 238, 1361,
172080 /* 1720 */ 558, 449, 1023, 559, 1426, 1278, 170, 1269, 1257, 142,
172081 /* 1730 */ 1601, 1256, 1258, 561, 1594, 1031, 496, 278, 213, 1346,
172082 /* 1740 */ 310, 110, 110, 939, 311, 312, 237, 11, 234, 111,
172083 /* 1750 */ 221, 449, 573, 449, 293, 395, 1019, 1408, 337, 1403,
172084 /* 1760 */ 1396, 338, 1031, 299, 343, 1413, 1412, 481, 110, 110,
172085 /* 1770 */ 506, 402, 225, 1296, 206, 367, 111, 1358, 449, 573,
172086 /* 1780 */ 449, 412, 1359, 1019, 1489, 1488, 318, 563, 1019, 1019,
172087 /* 1790 */ 1021, 1022, 28, 562, 207, 220, 80, 564, 389, 4,
172088 /* 1800 */ 1597, 1357, 552, 1356, 1233, 181, 267, 232, 1536, 1534,
172089 /* 1810 */ 455, 1230, 420, 567, 82, 1019, 1019, 1021, 1022, 28,
172090 /* 1820 */ 86, 217, 85, 1494, 190, 175, 183, 465, 185, 466,
172091 /* 1830 */ 36, 1409, 186, 187, 188, 499, 449, 244, 37, 99,
172092 /* 1840 */ 400, 1415, 1414, 488, 1417, 194, 473, 403, 561, 1483,
172093 /* 1850 */ 248, 92, 1505, 494, 198, 279, 112, 564, 250, 4,
172094 /* 1860 */ 348, 497, 405, 352, 1259, 251, 252, 515, 1316, 434,
172095 /* 1870 */ 1315, 1314, 94, 567, 1307, 886, 1306, 1031, 226, 406,
172096 /* 1880 */ 1611, 1610, 438, 110, 110, 1580, 1286, 524, 439, 308,
172097 /* 1890 */ 266, 111, 1285, 449, 573, 449, 449, 309, 1019, 366,
172098 /* 1900 */ 1284, 1609, 265, 1566, 1565, 442, 372, 1381, 561, 129,
172099 /* 1910 */ 550, 1380, 10, 1470, 383, 106, 316, 551, 100, 35,
172100 /* 1920 */ 534, 575, 212, 1339, 381, 387, 1187, 1338, 274, 276,
172101 /* 1930 */ 1019, 1019, 1021, 1022, 28, 277, 413, 1031, 576, 1254,
172102 /* 1940 */ 388, 1521, 1249, 110, 110, 167, 1522, 168, 148, 1520,
172103 /* 1950 */ 1519, 111, 306, 449, 573, 449, 222, 223, 1019, 839,
172104 /* 1960 */ 169, 79, 450, 214, 414, 233, 320, 145, 1093, 1091,
172105 /* 1970 */ 328, 182, 171, 1212, 918, 184, 240, 336, 243, 1107,
172106 /* 1980 */ 189, 172, 173, 423, 425, 88, 180, 191, 89, 90,
172107 /* 1990 */ 1019, 1019, 1021, 1022, 28, 91, 174, 1110, 245, 1106,
172108 /* 2000 */ 246, 159, 18, 247, 347, 1099, 263, 195, 1227, 493,
172109 /* 2010 */ 249, 196, 38, 854, 498, 368, 253, 360, 897, 197,
172110 /* 2020 */ 502, 93, 19, 20, 507, 884, 363, 510, 95, 307,
172111 /* 2030 */ 160, 96, 518, 97, 1175, 1060, 1146, 40, 21, 227,
172112 /* 2040 */ 176, 1145, 282, 284, 969, 200, 963, 114, 262, 1165,
172113 /* 2050 */ 22, 23, 24, 1161, 1169, 25, 1163, 1150, 34, 26,
172114 /* 2060 */ 1168, 546, 27, 204, 101, 103, 104, 1074, 7, 1061,
172115 /* 2070 */ 1059, 1063, 1116, 1064, 1115, 268, 269, 29, 41, 270,
172116 /* 2080 */ 1024, 866, 113, 30, 568, 392, 1183, 144, 178, 1182,
172117 /* 2090 */ 271, 928, 1245, 1245, 1245, 1245, 1245, 1245, 1245, 1602,
 
 
172118 };
172119 static const YYCODETYPE yy_lookahead[] = {
172120 /* 0 */ 193, 193, 193, 274, 275, 276, 193, 274, 275, 276,
172121 /* 10 */ 193, 223, 219, 225, 206, 210, 211, 212, 193, 19,
172122 /* 20 */ 219, 233, 216, 216, 217, 216, 217, 193, 295, 216,
172123 /* 30 */ 217, 31, 193, 216, 217, 193, 228, 213, 230, 39,
172124 /* 40 */ 206, 216, 217, 43, 44, 45, 46, 47, 48, 49,
172125 /* 50 */ 50, 51, 52, 53, 54, 55, 56, 57, 193, 19,
172126 /* 60 */ 185, 186, 187, 188, 189, 190, 253, 274, 275, 276,
172127 /* 70 */ 195, 193, 197, 193, 261, 274, 275, 276, 253, 204,
172128 /* 80 */ 238, 204, 81, 43, 44, 45, 46, 47, 48, 49,
172129 /* 90 */ 50, 51, 52, 53, 54, 55, 56, 57, 274, 275,
172130 /* 100 */ 276, 262, 102, 103, 104, 105, 106, 107, 108, 109,
172131 /* 110 */ 110, 111, 112, 113, 239, 240, 239, 240, 210, 211,
172132 /* 120 */ 212, 314, 315, 314, 59, 316, 86, 252, 88, 252,
172133 /* 130 */ 19, 314, 315, 256, 257, 113, 25, 72, 296, 138,
172134 /* 140 */ 139, 266, 102, 103, 104, 105, 106, 107, 108, 109,
172135 /* 150 */ 110, 111, 112, 113, 43, 44, 45, 46, 47, 48,
172136 /* 160 */ 49, 50, 51, 52, 53, 54, 55, 56, 57, 81,
172137 /* 170 */ 292, 59, 292, 298, 108, 109, 110, 111, 112, 113,
172138 /* 180 */ 69, 116, 117, 118, 72, 106, 107, 193, 111, 112,
172139 /* 190 */ 113, 54, 55, 56, 57, 58, 102, 103, 104, 105,
172140 /* 200 */ 106, 107, 108, 109, 110, 111, 112, 113, 120, 25,
172141 /* 210 */ 216, 217, 145, 102, 103, 104, 105, 106, 107, 108,
172142 /* 220 */ 109, 110, 111, 112, 113, 231, 138, 139, 116, 117,
172143 /* 230 */ 118, 164, 153, 19, 155, 54, 55, 56, 57, 102,
172144 /* 240 */ 103, 104, 105, 106, 107, 108, 109, 110, 111, 112,
172145 /* 250 */ 113, 128, 129, 46, 47, 48, 49, 43, 44, 45,
172146 /* 260 */ 46, 47, 48, 49, 50, 51, 52, 53, 54, 55,
172147 /* 270 */ 56, 57, 216, 193, 25, 59, 193, 19, 165, 166,
172148 /* 280 */ 193, 67, 24, 102, 103, 104, 105, 106, 107, 108,
172149 /* 290 */ 109, 110, 111, 112, 113, 73, 216, 217, 59, 216,
172150 /* 300 */ 217, 43, 44, 45, 46, 47, 48, 49, 50, 51,
172151 /* 310 */ 52, 53, 54, 55, 56, 57, 102, 103, 104, 105,
172152 /* 320 */ 106, 107, 108, 109, 110, 111, 112, 113, 121, 145,
172153 /* 330 */ 59, 193, 116, 117, 118, 119, 273, 204, 122, 123,
172154 /* 340 */ 124, 19, 20, 134, 22, 136, 137, 19, 132, 127,
172155 /* 350 */ 128, 129, 24, 22, 23, 116, 117, 118, 36, 193,
172156 /* 360 */ 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
172157 /* 370 */ 112, 113, 239, 240, 311, 312, 215, 106, 107, 241,
172158 /* 380 */ 19, 59, 216, 217, 223, 252, 115, 116, 117, 118,
172159 /* 390 */ 151, 120, 26, 71, 193, 308, 309, 193, 149, 128,
172160 /* 400 */ 313, 216, 269, 81, 43, 44, 45, 46, 47, 48,
172161 /* 410 */ 49, 50, 51, 52, 53, 54, 55, 56, 57, 253,
172162 /* 420 */ 216, 217, 100, 95, 153, 59, 155, 261, 106, 107,
172163 /* 430 */ 25, 193, 101, 193, 193, 231, 114, 25, 116, 117,
172164 /* 440 */ 118, 113, 304, 121, 193, 204, 59, 119, 120, 121,
172165 /* 450 */ 122, 123, 124, 125, 216, 217, 193, 216, 217, 131,
172166 /* 460 */ 138, 139, 230, 102, 103, 104, 105, 106, 107, 108,
172167 /* 470 */ 109, 110, 111, 112, 113, 153, 154, 155, 156, 157,
172168 /* 480 */ 239, 240, 116, 117, 118, 76, 193, 23, 19, 25,
172169 /* 490 */ 22, 253, 23, 252, 253, 108, 87, 204, 89, 261,
172170 /* 500 */ 198, 92, 261, 116, 117, 118, 193, 306, 307, 216,
172171 /* 510 */ 217, 150, 43, 44, 45, 46, 47, 48, 49, 50,
172172 /* 520 */ 51, 52, 53, 54, 55, 56, 57, 59, 193, 216,
172173 /* 530 */ 217, 19, 239, 240, 283, 23, 106, 107, 108, 109,
172174 /* 540 */ 110, 111, 112, 113, 73, 252, 253, 142, 308, 309,
172175 /* 550 */ 138, 139, 81, 313, 145, 43, 44, 45, 46, 47,
172176 /* 560 */ 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
172177 /* 570 */ 307, 102, 103, 104, 105, 106, 107, 108, 109, 110,
172178 /* 580 */ 111, 112, 113, 281, 116, 117, 118, 285, 23, 193,
172179 /* 590 */ 25, 119, 59, 193, 122, 123, 124, 59, 127, 203,
172180 /* 600 */ 59, 205, 19, 268, 132, 25, 23, 22, 193, 138,
172181 /* 610 */ 139, 249, 204, 251, 102, 103, 104, 105, 106, 107,
172182 /* 620 */ 108, 109, 110, 111, 112, 113, 43, 44, 45, 46,
172183 /* 630 */ 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
172184 /* 640 */ 57, 19, 22, 23, 59, 23, 25, 239, 240, 116,
172185 /* 650 */ 117, 118, 193, 11, 116, 117, 118, 116, 117, 118,
172186 /* 660 */ 252, 269, 22, 193, 15, 43, 44, 45, 46, 47,
172187 /* 670 */ 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
172188 /* 680 */ 273, 143, 193, 118, 143, 102, 103, 104, 105, 106,
172189 /* 690 */ 107, 108, 109, 110, 111, 112, 113, 76, 118, 59,
172190 /* 700 */ 241, 116, 117, 118, 304, 216, 217, 292, 143, 60,
172191 /* 710 */ 89, 241, 19, 92, 193, 193, 23, 22, 311, 312,
172192 /* 720 */ 231, 101, 22, 143, 102, 103, 104, 105, 106, 107,
172193 /* 730 */ 108, 109, 110, 111, 112, 113, 43, 44, 45, 46,
172194 /* 740 */ 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
172195 /* 750 */ 57, 19, 193, 193, 59, 23, 116, 117, 118, 59,
172196 /* 760 */ 201, 21, 241, 304, 193, 206, 127, 128, 129, 193,
172197 /* 770 */ 128, 129, 235, 236, 304, 43, 44, 45, 46, 47,
172198 /* 780 */ 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
172199 /* 790 */ 22, 193, 216, 217, 193, 102, 103, 104, 105, 106,
172200 /* 800 */ 107, 108, 109, 110, 111, 112, 113, 231, 193, 193,
172201 /* 810 */ 193, 116, 117, 118, 216, 217, 116, 117, 118, 226,
172202 /* 820 */ 80, 193, 19, 235, 236, 304, 23, 211, 212, 231,
172203 /* 830 */ 204, 216, 217, 205, 102, 103, 104, 105, 106, 107,
172204 /* 840 */ 108, 109, 110, 111, 112, 113, 43, 44, 45, 46,
172205 /* 850 */ 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
172206 /* 860 */ 57, 19, 193, 123, 76, 239, 240, 193, 253, 239,
172207 /* 870 */ 240, 239, 240, 244, 106, 107, 193, 89, 252, 193,
172208 /* 880 */ 92, 59, 252, 254, 252, 43, 44, 45, 46, 47,
172209 /* 890 */ 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
172210 /* 900 */ 284, 161, 216, 217, 193, 102, 103, 104, 105, 106,
172211 /* 910 */ 107, 108, 109, 110, 111, 112, 113, 231, 193, 244,
172212 /* 920 */ 187, 188, 189, 190, 7, 8, 9, 309, 195, 254,
172213 /* 930 */ 197, 313, 19, 127, 128, 129, 262, 204, 22, 117,
172214 /* 940 */ 24, 216, 217, 273, 102, 103, 104, 105, 106, 107,
172215 /* 950 */ 108, 109, 110, 111, 112, 113, 43, 44, 45, 46,
172216 /* 960 */ 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
172217 /* 970 */ 57, 193, 239, 240, 193, 59, 19, 188, 253, 190,
172218 /* 980 */ 193, 311, 312, 16, 195, 252, 197, 193, 19, 301,
172219 /* 990 */ 302, 135, 193, 204, 216, 217, 140, 216, 217, 266,
172220 /* 1000 */ 204, 159, 45, 46, 47, 48, 49, 50, 51, 52,
172221 /* 1010 */ 53, 54, 55, 56, 57, 102, 103, 104, 105, 106,
172222 /* 1020 */ 107, 108, 109, 110, 111, 112, 113, 12, 239, 240,
172223 /* 1030 */ 193, 298, 238, 117, 253, 239, 240, 238, 259, 260,
172224 /* 1040 */ 193, 252, 27, 193, 77, 193, 79, 204, 252, 262,
172225 /* 1050 */ 193, 299, 300, 193, 100, 266, 278, 42, 204, 102,
172226 /* 1060 */ 103, 104, 105, 106, 107, 108, 109, 110, 111, 112,
172227 /* 1070 */ 113, 117, 159, 216, 217, 121, 216, 217, 63, 193,
172228 /* 1080 */ 193, 193, 239, 240, 115, 116, 193, 298, 73, 240,
172229 /* 1090 */ 238, 231, 19, 239, 240, 252, 22, 24, 211, 212,
172230 /* 1100 */ 263, 252, 216, 217, 216, 217, 252, 153, 154, 155,
172231 /* 1110 */ 253, 193, 19, 144, 213, 268, 43, 44, 45, 46,
172232 /* 1120 */ 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
172233 /* 1130 */ 57, 193, 19, 59, 216, 217, 43, 44, 45, 46,
172234 /* 1140 */ 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
172235 /* 1150 */ 57, 193, 19, 24, 216, 217, 43, 44, 45, 46,
172236 /* 1160 */ 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
172237 /* 1170 */ 57, 284, 193, 208, 209, 102, 103, 104, 105, 106,
172238 /* 1180 */ 107, 108, 109, 110, 111, 112, 113, 286, 59, 193,
172239 /* 1190 */ 232, 117, 291, 193, 193, 102, 103, 104, 105, 106,
172240 /* 1200 */ 107, 108, 109, 110, 111, 112, 113, 193, 204, 22,
172241 /* 1210 */ 23, 193, 25, 66, 193, 102, 103, 104, 105, 106,
172242 /* 1220 */ 107, 108, 109, 110, 111, 112, 113, 193, 193, 193,
172243 /* 1230 */ 216, 217, 85, 193, 238, 19, 16, 216, 217, 238,
172244 /* 1240 */ 193, 94, 193, 239, 240, 231, 117, 268, 35, 116,
172245 /* 1250 */ 216, 217, 216, 217, 22, 23, 252, 25, 208, 209,
172246 /* 1260 */ 44, 45, 46, 47, 48, 49, 50, 51, 52, 53,
172247 /* 1270 */ 54, 55, 56, 57, 193, 193, 19, 5, 59, 66,
172248 /* 1280 */ 193, 263, 10, 11, 12, 13, 14, 74, 101, 17,
172249 /* 1290 */ 193, 46, 193, 146, 193, 76, 213, 77, 263, 79,
172250 /* 1300 */ 12, 260, 30, 46, 32, 264, 87, 193, 89, 29,
172251 /* 1310 */ 263, 92, 40, 33, 232, 27, 193, 108, 102, 103,
172252 /* 1320 */ 104, 105, 106, 107, 108, 109, 110, 111, 112, 113,
172253 /* 1330 */ 42, 138, 139, 101, 193, 116, 117, 118, 19, 20,
172254 /* 1340 */ 255, 22, 70, 130, 135, 65, 256, 257, 193, 140,
172255 /* 1350 */ 78, 63, 193, 81, 193, 36, 193, 216, 217, 193,
172256 /* 1360 */ 115, 193, 263, 193, 145, 268, 59, 48, 193, 193,
172257 /* 1370 */ 98, 193, 115, 193, 291, 216, 217, 193, 59, 216,
172258 /* 1380 */ 217, 161, 216, 217, 216, 217, 216, 217, 131, 193,
172259 /* 1390 */ 71, 193, 216, 217, 216, 217, 216, 217, 193, 260,
172260 /* 1400 */ 216, 217, 19, 264, 85, 133, 244, 100, 193, 90,
172261 /* 1410 */ 138, 139, 216, 217, 216, 217, 254, 244, 193, 100,
172262 /* 1420 */ 193, 216, 217, 116, 117, 106, 107, 254, 121, 193,
172263 /* 1430 */ 115, 216, 217, 114, 162, 116, 117, 118, 115, 244,
172264 /* 1440 */ 121, 216, 217, 216, 217, 193, 309, 193, 31, 254,
172265 /* 1450 */ 313, 309, 216, 217, 309, 313, 39, 193, 313, 309,
172266 /* 1460 */ 153, 154, 155, 313, 193, 150, 25, 144, 216, 217,
172267 /* 1470 */ 216, 217, 153, 154, 155, 156, 157, 0, 1, 2,
172268 /* 1480 */ 216, 217, 5, 149, 150, 22, 193, 10, 11, 12,
172269 /* 1490 */ 13, 14, 193, 158, 17, 160, 193, 19, 20, 116,
172270 /* 1500 */ 22, 25, 193, 24, 22, 193, 24, 30, 226, 32,
172271 /* 1510 */ 19, 20, 226, 22, 36, 193, 53, 40, 193, 216,
172272 /* 1520 */ 217, 193, 23, 193, 25, 216, 217, 36, 216, 217,
172273 /* 1530 */ 193, 99, 193, 193, 22, 193, 193, 59, 216, 217,
172274 /* 1540 */ 193, 216, 217, 193, 216, 217, 193, 70, 129, 71,
172275 /* 1550 */ 59, 129, 193, 216, 217, 78, 216, 217, 81, 216,
172276 /* 1560 */ 217, 193, 71, 85, 193, 133, 193, 126, 90, 216,
172277 /* 1570 */ 217, 152, 258, 61, 152, 98, 85, 193, 100, 193,
172278 /* 1580 */ 23, 90, 25, 121, 106, 107, 23, 216, 217, 216,
172279 /* 1590 */ 217, 100, 114, 131, 116, 117, 118, 106, 107, 121,
172280 /* 1600 */ 216, 217, 216, 217, 193, 114, 193, 116, 117, 118,
172281 /* 1610 */ 133, 22, 121, 193, 59, 138, 139, 193, 142, 193,
172282 /* 1620 */ 141, 23, 23, 25, 25, 120, 121, 216, 217, 216,
172283 /* 1630 */ 217, 153, 154, 155, 156, 157, 216, 217, 19, 162,
172284 /* 1640 */ 216, 217, 216, 217, 153, 154, 155, 156, 157, 1,
172285 /* 1650 */ 2, 193, 59, 5, 19, 20, 318, 22, 10, 11,
172286 /* 1660 */ 12, 13, 14, 193, 59, 17, 193, 23, 23, 25,
172287 /* 1670 */ 25, 36, 117, 193, 216, 217, 193, 23, 30, 25,
172288 /* 1680 */ 32, 19, 20, 23, 22, 25, 216, 217, 40, 216,
172289 /* 1690 */ 217, 7, 8, 23, 59, 25, 83, 84, 36, 23,
172290 /* 1700 */ 193, 25, 23, 23, 25, 25, 71, 153, 145, 155,
172291 /* 1710 */ 117, 153, 23, 155, 25, 23, 97, 25, 70, 193,
172292 /* 1720 */ 193, 59, 117, 236, 193, 193, 78, 193, 193, 81,
172293 /* 1730 */ 141, 193, 193, 71, 193, 100, 288, 287, 242, 255,
172294 /* 1740 */ 255, 106, 107, 108, 255, 255, 98, 243, 297, 114,
172295 /* 1750 */ 214, 116, 117, 118, 245, 191, 121, 271, 293, 267,
172296 /* 1760 */ 267, 246, 100, 246, 245, 271, 271, 293, 106, 107,
172297 /* 1770 */ 220, 271, 229, 225, 249, 219, 114, 259, 116, 117,
172298 /* 1780 */ 118, 133, 259, 121, 219, 219, 138, 139, 153, 154,
172299 /* 1790 */ 155, 156, 157, 280, 249, 243, 19, 20, 245, 22,
172300 /* 1800 */ 196, 259, 140, 259, 60, 297, 141, 297, 200, 200,
172301 /* 1810 */ 162, 38, 200, 36, 294, 153, 154, 155, 156, 157,
172302 /* 1820 */ 151, 150, 294, 283, 22, 43, 234, 18, 237, 200,
172303 /* 1830 */ 270, 272, 237, 237, 237, 18, 59, 199, 270, 149,
172304 /* 1840 */ 246, 272, 272, 200, 234, 234, 246, 246, 71, 246,
172305 /* 1850 */ 199, 158, 290, 62, 22, 200, 19, 20, 199, 22,
172306 /* 1860 */ 289, 221, 221, 200, 200, 199, 199, 115, 218, 64,
172307 /* 1870 */ 218, 218, 22, 36, 227, 126, 227, 100, 165, 221,
172308 /* 1880 */ 224, 224, 24, 106, 107, 312, 218, 305, 113, 282,
172309 /* 1890 */ 91, 114, 220, 116, 117, 118, 59, 282, 121, 218,
172310 /* 1900 */ 218, 218, 200, 317, 317, 82, 221, 265, 71, 148,
172311 /* 1910 */ 145, 265, 22, 277, 200, 158, 279, 140, 147, 25,
172312 /* 1920 */ 146, 202, 248, 250, 249, 247, 13, 250, 194, 194,
172313 /* 1930 */ 153, 154, 155, 156, 157, 6, 303, 100, 192, 192,
172314 /* 1940 */ 246, 213, 192, 106, 107, 207, 213, 207, 222, 213,
172315 /* 1950 */ 213, 114, 222, 116, 117, 118, 214, 214, 121, 4,
172316 /* 1960 */ 207, 213, 3, 22, 303, 15, 163, 16, 23, 23,
172317 /* 1970 */ 139, 151, 130, 25, 20, 142, 24, 16, 144, 1,
172318 /* 1980 */ 142, 130, 130, 61, 37, 53, 300, 151, 53, 53,
172319 /* 1990 */ 153, 154, 155, 156, 157, 53, 130, 116, 34, 1,
172320 /* 2000 */ 141, 5, 22, 115, 161, 68, 25, 68, 75, 41,
172321 /* 2010 */ 141, 115, 24, 20, 19, 131, 125, 23, 28, 22,
172322 /* 2020 */ 67, 22, 22, 22, 67, 59, 24, 96, 22, 67,
172323 /* 2030 */ 23, 149, 22, 25, 23, 23, 23, 22, 34, 141,
172324 /* 2040 */ 37, 97, 23, 23, 116, 22, 143, 25, 34, 75,
172325 /* 2050 */ 34, 34, 34, 88, 75, 34, 86, 23, 22, 34,
172326 /* 2060 */ 93, 24, 34, 25, 25, 142, 142, 23, 44, 23,
172327 /* 2070 */ 23, 23, 23, 11, 23, 25, 22, 22, 22, 141,
172328 /* 2080 */ 23, 23, 22, 22, 25, 15, 1, 23, 25, 1,
172329 /* 2090 */ 141, 135, 319, 319, 319, 319, 319, 319, 319, 141,
172330 /* 2100 */ 319, 319, 319, 319, 319, 319, 319, 319, 319, 319,
172331 /* 2110 */ 319, 319, 319, 319, 319, 319, 319, 319, 319, 319,
172332 /* 2120 */ 319, 319, 319, 319, 319, 319, 319, 319, 319, 319,
172333 /* 2130 */ 319, 319, 319, 319, 319, 319, 319, 319, 319, 319,
172334 /* 2140 */ 319, 319, 319, 319, 319, 319, 319, 319, 319, 319,
172335 /* 2150 */ 319, 319, 319, 319, 319, 319, 319, 319, 319, 319,
172336 /* 2160 */ 319, 319, 319, 319, 319, 319, 319, 319, 319, 319,
172337 /* 2170 */ 319, 319, 319, 319, 319, 319, 319, 319, 319, 319,
172338 /* 2180 */ 319, 319, 319, 319, 319, 319, 319, 319, 319, 319,
172339 /* 2190 */ 319, 319, 319, 319, 319, 319, 319, 319, 319, 319,
172340 /* 2200 */ 319, 319, 319, 319, 319, 319, 319, 319, 319, 319,
172341 /* 2210 */ 319, 319, 319, 319, 319, 319, 319, 319, 319, 319,
172342 /* 2220 */ 319, 319, 319, 319, 319, 319, 319, 319, 319, 319,
172343 /* 2230 */ 319, 319, 319, 319, 319, 319, 319, 319, 319, 319,
172344 /* 2240 */ 319, 319, 319, 319, 319, 319, 319, 319, 319, 319,
172345 /* 2250 */ 319, 319, 319, 319, 319, 319, 319, 319, 319, 319,
172346 /* 2260 */ 319, 319, 319, 319, 319, 319, 319, 319, 319, 319,
172347 /* 2270 */ 319, 319, 319, 319, 319, 319, 319, 319, 319, 319,
172348 /* 2280 */ 319, 319, 319, 319, 319,
 
172349 };
172350 #define YY_SHIFT_COUNT (578)
172351 #define YY_SHIFT_MIN (0)
172352 #define YY_SHIFT_MAX (2088)
172353 static const unsigned short int yy_shift_ofst[] = {
172354 /* 0 */ 1648, 1477, 1272, 322, 322, 1, 1319, 1478, 1491, 1837,
172355 /* 10 */ 1837, 1837, 471, 0, 0, 214, 1093, 1837, 1837, 1837,
172356 /* 20 */ 1837, 1837, 1837, 1837, 1837, 1837, 1837, 1837, 1837, 1837,
172357 /* 30 */ 1837, 271, 271, 1219, 1219, 216, 88, 1, 1, 1,
172358 /* 40 */ 1, 1, 40, 111, 258, 361, 469, 512, 583, 622,
172359 /* 50 */ 693, 732, 803, 842, 913, 1073, 1093, 1093, 1093, 1093,
172360 /* 60 */ 1093, 1093, 1093, 1093, 1093, 1093, 1093, 1093, 1093, 1093,
172361 /* 70 */ 1093, 1093, 1093, 1093, 1113, 1093, 1216, 957, 957, 1635,
172362 /* 80 */ 1662, 1777, 1837, 1837, 1837, 1837, 1837, 1837, 1837, 1837,
172363 /* 90 */ 1837, 1837, 1837, 1837, 1837, 1837, 1837, 1837, 1837, 1837,
172364 /* 100 */ 1837, 1837, 1837, 1837, 1837, 1837, 1837, 1837, 1837, 1837,
172365 /* 110 */ 1837, 1837, 1837, 1837, 1837, 1837, 1837, 1837, 1837, 1837,
172366 /* 120 */ 1837, 1837, 1837, 1837, 1837, 1837, 1837, 1837, 1837, 1837,
172367 /* 130 */ 1837, 137, 181, 181, 181, 181, 181, 181, 181, 94,
172368 /* 140 */ 430, 66, 65, 112, 366, 533, 533, 740, 1257, 533,
172369 /* 150 */ 533, 79, 79, 533, 412, 412, 412, 77, 412, 123,
172370 /* 160 */ 113, 113, 113, 22, 22, 2100, 2100, 328, 328, 328,
172371 /* 170 */ 239, 468, 468, 468, 468, 1015, 1015, 409, 366, 1187,
172372 /* 180 */ 1232, 533, 533, 533, 533, 533, 533, 533, 533, 533,
172373 /* 190 */ 533, 533, 533, 533, 533, 533, 533, 533, 533, 533,
172374 /* 200 */ 533, 969, 621, 621, 533, 642, 788, 788, 1133, 1133,
172375 /* 210 */ 822, 822, 67, 1193, 2100, 2100, 2100, 2100, 2100, 2100,
172376 /* 220 */ 2100, 1307, 954, 954, 585, 472, 640, 387, 695, 538,
172377 /* 230 */ 541, 700, 533, 533, 533, 533, 533, 533, 533, 533,
172378 /* 240 */ 533, 533, 222, 533, 533, 533, 533, 533, 533, 533,
172379 /* 250 */ 533, 533, 533, 533, 533, 1213, 1213, 1213, 533, 533,
172380 /* 260 */ 533, 565, 533, 533, 533, 916, 1147, 533, 533, 1288,
172381 /* 270 */ 533, 533, 533, 533, 533, 533, 533, 533, 639, 1280,
172382 /* 280 */ 209, 1129, 1129, 1129, 1129, 580, 209, 209, 1209, 768,
172383 /* 290 */ 917, 649, 1315, 1334, 405, 1334, 1383, 249, 1315, 1315,
172384 /* 300 */ 249, 1315, 405, 1383, 1441, 464, 1245, 1417, 1417, 1417,
172385 /* 310 */ 1323, 1323, 1323, 1323, 184, 184, 1335, 1476, 856, 1482,
172386 /* 320 */ 1744, 1744, 1665, 1665, 1773, 1773, 1665, 1669, 1671, 1802,
172387 /* 330 */ 1782, 1809, 1809, 1809, 1809, 1665, 1817, 1690, 1671, 1671,
172388 /* 340 */ 1690, 1802, 1782, 1690, 1782, 1690, 1665, 1817, 1693, 1791,
172389 /* 350 */ 1665, 1817, 1832, 1665, 1817, 1665, 1817, 1832, 1752, 1752,
172390 /* 360 */ 1752, 1805, 1850, 1850, 1832, 1752, 1749, 1752, 1805, 1752,
172391 /* 370 */ 1752, 1713, 1858, 1775, 1775, 1832, 1665, 1799, 1799, 1823,
172392 /* 380 */ 1823, 1761, 1765, 1890, 1665, 1757, 1761, 1771, 1774, 1690,
172393 /* 390 */ 1894, 1913, 1913, 1929, 1929, 1929, 2100, 2100, 2100, 2100,
172394 /* 400 */ 2100, 2100, 2100, 2100, 2100, 2100, 2100, 2100, 2100, 2100,
172395 /* 410 */ 2100, 207, 1220, 331, 620, 967, 806, 1074, 1499, 1432,
172396 /* 420 */ 1463, 1479, 1419, 1422, 1557, 1512, 1598, 1599, 1644, 1645,
172397 /* 430 */ 1654, 1660, 1555, 1505, 1684, 1462, 1670, 1563, 1619, 1593,
172398 /* 440 */ 1676, 1679, 1613, 1680, 1554, 1558, 1689, 1692, 1605, 1589,
172399 /* 450 */ 1955, 1959, 1941, 1803, 1950, 1951, 1945, 1946, 1831, 1820,
172400 /* 460 */ 1842, 1948, 1948, 1952, 1833, 1954, 1834, 1961, 1978, 1838,
172401 /* 470 */ 1851, 1948, 1852, 1922, 1947, 1948, 1836, 1932, 1935, 1936,
172402 /* 480 */ 1942, 1866, 1881, 1964, 1859, 1998, 1996, 1980, 1888, 1843,
172403 /* 490 */ 1937, 1981, 1939, 1933, 1968, 1869, 1896, 1988, 1993, 1995,
172404 /* 500 */ 1884, 1891, 1997, 1953, 1999, 2000, 1994, 2001, 1957, 1966,
172405 /* 510 */ 2002, 1931, 1990, 2006, 1962, 2003, 2007, 2004, 1882, 2010,
172406 /* 520 */ 2011, 2012, 2008, 2013, 2015, 1944, 1898, 2019, 2020, 1928,
172407 /* 530 */ 2014, 2023, 1903, 2022, 2016, 2017, 2018, 2021, 1965, 1974,
172408 /* 540 */ 1970, 2024, 1979, 1967, 2025, 2034, 2036, 2037, 2038, 2039,
172409 /* 550 */ 2028, 1923, 1924, 2044, 2022, 2046, 2047, 2048, 2049, 2050,
172410 /* 560 */ 2051, 2054, 2062, 2055, 2056, 2057, 2058, 2060, 2061, 2059,
172411 /* 570 */ 1956, 1938, 1949, 1958, 2063, 2064, 2070, 2085, 2088,
172412 };
172413 #define YY_REDUCE_COUNT (410)
172414 #define YY_REDUCE_MIN (-271)
172415 #define YY_REDUCE_MAX (1753)
172416 static const short yy_reduce_ofst[] = {
172417 /* 0 */ -125, 733, 789, 241, 293, -123, -193, -191, -183, -187,
172418 /* 10 */ 166, 238, 133, -207, -199, -267, -176, -6, 204, 489,
172419 /* 20 */ 576, 598, -175, 686, 860, 615, 725, 1014, 778, 781,
172420 /* 30 */ 857, 616, 887, 87, 240, -192, 408, 626, 796, 843,
172421 /* 40 */ 854, 1004, -271, -271, -271, -271, -271, -271, -271, -271,
172422 /* 50 */ -271, -271, -271, -271, -271, -271, -271, -271, -271, -271,
172423 /* 60 */ -271, -271, -271, -271, -271, -271, -271, -271, -271, -271,
172424 /* 70 */ -271, -271, -271, -271, -271, -271, -271, -271, -271, 80,
172425 /* 80 */ 83, 313, 886, 888, 918, 938, 1021, 1034, 1036, 1141,
172426 /* 90 */ 1159, 1163, 1166, 1168, 1170, 1176, 1178, 1180, 1184, 1196,
172427 /* 100 */ 1198, 1205, 1215, 1225, 1227, 1236, 1252, 1254, 1264, 1303,
172428 /* 110 */ 1309, 1312, 1322, 1325, 1328, 1337, 1340, 1343, 1353, 1371,
172429 /* 120 */ 1373, 1384, 1386, 1411, 1413, 1420, 1424, 1426, 1458, 1470,
172430 /* 130 */ 1473, -271, -271, -271, -271, -271, -271, -271, -271, -271,
172431 /* 140 */ -271, -271, 138, 459, 396, -158, 470, 302, -212, 521,
172432 /* 150 */ 201, -195, -92, 559, 630, 632, 630, -271, 632, 901,
172433 /* 160 */ 63, 407, 670, -271, -271, -271, -271, 161, 161, 161,
172434 /* 170 */ 251, 335, 847, 979, 1097, 537, 588, 618, 628, 688,
172435 /* 180 */ 688, -166, -161, 674, 787, 794, 799, 852, 996, -122,
172436 /* 190 */ 837, -120, 1018, 1035, 415, 1047, 1001, 958, 1082, 400,
172437 /* 200 */ 1099, 779, 1137, 1142, 263, 1083, 1145, 1150, 1041, 1139,
172438 /* 210 */ 965, 1050, 362, 849, 752, 629, 675, 1162, 1173, 1090,
172439 /* 220 */ 1195, -194, 56, 185, -135, 232, 522, 560, 571, 601,
172440 /* 230 */ 617, 669, 683, 711, 850, 893, 1000, 1040, 1049, 1081,
172441 /* 240 */ 1087, 1101, 392, 1114, 1123, 1155, 1161, 1175, 1271, 1293,
172442 /* 250 */ 1299, 1330, 1339, 1342, 1347, 593, 1282, 1286, 1350, 1359,
172443 /* 260 */ 1368, 1314, 1480, 1483, 1507, 1085, 1338, 1526, 1527, 1487,
172444 /* 270 */ 1531, 560, 1532, 1534, 1535, 1538, 1539, 1541, 1448, 1450,
172445 /* 280 */ 1496, 1484, 1485, 1489, 1490, 1314, 1496, 1496, 1504, 1536,
172446 /* 290 */ 1564, 1451, 1486, 1492, 1509, 1493, 1465, 1515, 1494, 1495,
172447 /* 300 */ 1517, 1500, 1519, 1474, 1550, 1543, 1548, 1556, 1565, 1566,
172448 /* 310 */ 1518, 1523, 1542, 1544, 1525, 1545, 1513, 1553, 1552, 1604,
172449 /* 320 */ 1508, 1510, 1608, 1609, 1520, 1528, 1612, 1540, 1559, 1560,
172450 /* 330 */ 1592, 1591, 1595, 1596, 1597, 1629, 1638, 1594, 1569, 1570,
172451 /* 340 */ 1600, 1568, 1610, 1601, 1611, 1603, 1643, 1651, 1562, 1571,
172452 /* 350 */ 1655, 1659, 1640, 1663, 1666, 1664, 1667, 1641, 1650, 1652,
172453 /* 360 */ 1653, 1647, 1656, 1657, 1658, 1668, 1672, 1681, 1649, 1682,
172454 /* 370 */ 1683, 1573, 1582, 1607, 1615, 1685, 1702, 1586, 1587, 1642,
172455 /* 380 */ 1646, 1673, 1675, 1636, 1714, 1637, 1677, 1674, 1678, 1694,
172456 /* 390 */ 1719, 1734, 1735, 1746, 1747, 1750, 1633, 1661, 1686, 1738,
172457 /* 400 */ 1728, 1733, 1736, 1737, 1740, 1726, 1730, 1742, 1743, 1748,
172458 /* 410 */ 1753,
172459 };
172460 static const YYACTIONTYPE yy_default[] = {
172461 /* 0 */ 1648, 1648, 1648, 1478, 1243, 1354, 1243, 1243, 1243, 1478,
172462 /* 10 */ 1478, 1478, 1243, 1384, 1384, 1531, 1276, 1243, 1243, 1243,
172463 /* 20 */ 1243, 1243, 1243, 1243, 1243, 1243, 1243, 1243, 1477, 1243,
172464 /* 30 */ 1243, 1243, 1243, 1564, 1564, 1243, 1243, 1243, 1243, 1243,
172465 /* 40 */ 1243, 1243, 1243, 1393, 1243, 1400, 1243, 1243, 1243, 1243,
172466 /* 50 */ 1243, 1479, 1480, 1243, 1243, 1243, 1530, 1532, 1495, 1407,
172467 /* 60 */ 1406, 1405, 1404, 1513, 1372, 1398, 1391, 1395, 1474, 1475,
172468 /* 70 */ 1473, 1626, 1480, 1479, 1243, 1394, 1442, 1458, 1441, 1243,
172469 /* 80 */ 1243, 1243, 1243, 1243, 1243, 1243, 1243, 1243, 1243, 1243,
172470 /* 90 */ 1243, 1243, 1243, 1243, 1243, 1243, 1243, 1243, 1243, 1243,
172471 /* 100 */ 1243, 1243, 1243, 1243, 1243, 1243, 1243, 1243, 1243, 1243,
172472 /* 110 */ 1243, 1243, 1243, 1243, 1243, 1243, 1243, 1243, 1243, 1243,
172473 /* 120 */ 1243, 1243, 1243, 1243, 1243, 1243, 1243, 1243, 1243, 1243,
172474 /* 130 */ 1243, 1450, 1457, 1456, 1455, 1464, 1454, 1451, 1444, 1443,
172475 /* 140 */ 1445, 1446, 1243, 1243, 1267, 1243, 1243, 1264, 1318, 1243,
172476 /* 150 */ 1243, 1243, 1243, 1243, 1550, 1549, 1243, 1447, 1243, 1276,
172477 /* 160 */ 1435, 1434, 1433, 1461, 1448, 1460, 1459, 1538, 1600, 1599,
172478 /* 170 */ 1496, 1243, 1243, 1243, 1243, 1243, 1243, 1564, 1243, 1243,
172479 /* 180 */ 1243, 1243, 1243, 1243, 1243, 1243, 1243, 1243, 1243, 1243,
172480 /* 190 */ 1243, 1243, 1243, 1243, 1243, 1243, 1243, 1243, 1243, 1243,
172481 /* 200 */ 1243, 1374, 1564, 1564, 1243, 1276, 1564, 1564, 1375, 1375,
172482 /* 210 */ 1272, 1272, 1378, 1243, 1545, 1345, 1345, 1345, 1345, 1354,
172483 /* 220 */ 1345, 1243, 1243, 1243, 1243, 1243, 1243, 1243, 1243, 1243,
172484 /* 230 */ 1243, 1243, 1243, 1243, 1243, 1243, 1535, 1533, 1243, 1243,
172485 /* 240 */ 1243, 1243, 1243, 1243, 1243, 1243, 1243, 1243, 1243, 1243,
172486 /* 250 */ 1243, 1243, 1243, 1243, 1243, 1243, 1243, 1243, 1243, 1243,
172487 /* 260 */ 1243, 1243, 1243, 1243, 1243, 1350, 1243, 1243, 1243, 1243,
172488 /* 270 */ 1243, 1243, 1243, 1243, 1243, 1243, 1243, 1593, 1243, 1508,
172489 /* 280 */ 1332, 1350, 1350, 1350, 1350, 1352, 1333, 1331, 1344, 1277,
172490 /* 290 */ 1250, 1640, 1410, 1399, 1351, 1399, 1637, 1397, 1410, 1410,
172491 /* 300 */ 1397, 1410, 1351, 1637, 1293, 1615, 1288, 1384, 1384, 1384,
172492 /* 310 */ 1374, 1374, 1374, 1374, 1378, 1378, 1476, 1351, 1344, 1243,
172493 /* 320 */ 1640, 1640, 1360, 1360, 1639, 1639, 1360, 1496, 1623, 1419,
172494 /* 330 */ 1321, 1327, 1327, 1327, 1327, 1360, 1261, 1397, 1623, 1623,
172495 /* 340 */ 1397, 1419, 1321, 1397, 1321, 1397, 1360, 1261, 1512, 1634,
172496 /* 350 */ 1360, 1261, 1486, 1360, 1261, 1360, 1261, 1486, 1319, 1319,
172497 /* 360 */ 1319, 1308, 1243, 1243, 1486, 1319, 1293, 1319, 1308, 1319,
172498 /* 370 */ 1319, 1582, 1243, 1490, 1490, 1486, 1360, 1574, 1574, 1387,
172499 /* 380 */ 1387, 1392, 1378, 1481, 1360, 1243, 1392, 1390, 1388, 1397,
172500 /* 390 */ 1311, 1596, 1596, 1592, 1592, 1592, 1645, 1645, 1545, 1608,
172501 /* 400 */ 1276, 1276, 1276, 1276, 1608, 1295, 1295, 1277, 1277, 1276,
172502 /* 410 */ 1608, 1243, 1243, 1243, 1243, 1243, 1243, 1603, 1243, 1540,
172503 /* 420 */ 1497, 1364, 1243, 1243, 1243, 1243, 1243, 1243, 1243, 1243,
172504 /* 430 */ 1243, 1243, 1243, 1243, 1243, 1243, 1243, 1243, 1551, 1243,
172505 /* 440 */ 1243, 1243, 1243, 1243, 1243, 1243, 1243, 1243, 1243, 1424,
172506 /* 450 */ 1243, 1246, 1542, 1243, 1243, 1243, 1243, 1243, 1243, 1243,
172507 /* 460 */ 1243, 1401, 1402, 1365, 1243, 1243, 1243, 1243, 1243, 1243,
172508 /* 470 */ 1243, 1416, 1243, 1243, 1243, 1411, 1243, 1243, 1243, 1243,
172509 /* 480 */ 1243, 1243, 1243, 1243, 1636, 1243, 1243, 1243, 1243, 1243,
172510 /* 490 */ 1243, 1511, 1510, 1243, 1243, 1362, 1243, 1243, 1243, 1243,
172511 /* 500 */ 1243, 1243, 1243, 1243, 1243, 1243, 1243, 1243, 1243, 1291,
172512 /* 510 */ 1243, 1243, 1243, 1243, 1243, 1243, 1243, 1243, 1243, 1243,
172513 /* 520 */ 1243, 1243, 1243, 1243, 1243, 1243, 1243, 1243, 1243, 1243,
172514 /* 530 */ 1243, 1243, 1243, 1389, 1243, 1243, 1243, 1243, 1243, 1243,
172515 /* 540 */ 1243, 1243, 1243, 1243, 1243, 1243, 1243, 1243, 1579, 1379,
172516 /* 550 */ 1243, 1243, 1243, 1243, 1627, 1243, 1243, 1243, 1243, 1243,
172517 /* 560 */ 1243, 1243, 1243, 1243, 1243, 1243, 1243, 1243, 1243, 1619,
172518 /* 570 */ 1335, 1425, 1243, 1428, 1265, 1243, 1255, 1243, 1243,
172519 };
172520 /********** End of lemon-generated parsing tables *****************************/
172521
172522 /* The next table maps tokens (terminal symbols) into fallback tokens.
172523 ** If a construct like the following:
@@ -172716,10 +172999,11 @@
172716 0, /* SELECT_COLUMN => nothing */
172717 0, /* IF_NULL_ROW => nothing */
172718 0, /* ASTERISK => nothing */
172719 0, /* SPAN => nothing */
172720 0, /* ERROR => nothing */
 
172721 0, /* SPACE => nothing */
172722 0, /* ILLEGAL => nothing */
172723 };
172724 #endif /* YYFALLBACK */
172725
@@ -172984,146 +173268,147 @@
172984 /* 178 */ "SELECT_COLUMN",
172985 /* 179 */ "IF_NULL_ROW",
172986 /* 180 */ "ASTERISK",
172987 /* 181 */ "SPAN",
172988 /* 182 */ "ERROR",
172989 /* 183 */ "SPACE",
172990 /* 184 */ "ILLEGAL",
172991 /* 185 */ "input",
172992 /* 186 */ "cmdlist",
172993 /* 187 */ "ecmd",
172994 /* 188 */ "cmdx",
172995 /* 189 */ "explain",
172996 /* 190 */ "cmd",
172997 /* 191 */ "transtype",
172998 /* 192 */ "trans_opt",
172999 /* 193 */ "nm",
173000 /* 194 */ "savepoint_opt",
173001 /* 195 */ "create_table",
173002 /* 196 */ "create_table_args",
173003 /* 197 */ "createkw",
173004 /* 198 */ "temp",
173005 /* 199 */ "ifnotexists",
173006 /* 200 */ "dbnm",
173007 /* 201 */ "columnlist",
173008 /* 202 */ "conslist_opt",
173009 /* 203 */ "table_option_set",
173010 /* 204 */ "select",
173011 /* 205 */ "table_option",
173012 /* 206 */ "columnname",
173013 /* 207 */ "carglist",
173014 /* 208 */ "typetoken",
173015 /* 209 */ "typename",
173016 /* 210 */ "signed",
173017 /* 211 */ "plus_num",
173018 /* 212 */ "minus_num",
173019 /* 213 */ "scanpt",
173020 /* 214 */ "scantok",
173021 /* 215 */ "ccons",
173022 /* 216 */ "term",
173023 /* 217 */ "expr",
173024 /* 218 */ "onconf",
173025 /* 219 */ "sortorder",
173026 /* 220 */ "autoinc",
173027 /* 221 */ "eidlist_opt",
173028 /* 222 */ "refargs",
173029 /* 223 */ "defer_subclause",
173030 /* 224 */ "generated",
173031 /* 225 */ "refarg",
173032 /* 226 */ "refact",
173033 /* 227 */ "init_deferred_pred_opt",
173034 /* 228 */ "conslist",
173035 /* 229 */ "tconscomma",
173036 /* 230 */ "tcons",
173037 /* 231 */ "sortlist",
173038 /* 232 */ "eidlist",
173039 /* 233 */ "defer_subclause_opt",
173040 /* 234 */ "orconf",
173041 /* 235 */ "resolvetype",
173042 /* 236 */ "raisetype",
173043 /* 237 */ "ifexists",
173044 /* 238 */ "fullname",
173045 /* 239 */ "selectnowith",
173046 /* 240 */ "oneselect",
173047 /* 241 */ "wqlist",
173048 /* 242 */ "multiselect_op",
173049 /* 243 */ "distinct",
173050 /* 244 */ "selcollist",
173051 /* 245 */ "from",
173052 /* 246 */ "where_opt",
173053 /* 247 */ "groupby_opt",
173054 /* 248 */ "having_opt",
173055 /* 249 */ "orderby_opt",
173056 /* 250 */ "limit_opt",
173057 /* 251 */ "window_clause",
173058 /* 252 */ "values",
173059 /* 253 */ "nexprlist",
173060 /* 254 */ "sclp",
173061 /* 255 */ "as",
173062 /* 256 */ "seltablist",
173063 /* 257 */ "stl_prefix",
173064 /* 258 */ "joinop",
173065 /* 259 */ "on_using",
173066 /* 260 */ "indexed_by",
173067 /* 261 */ "exprlist",
173068 /* 262 */ "xfullname",
173069 /* 263 */ "idlist",
173070 /* 264 */ "indexed_opt",
173071 /* 265 */ "nulls",
173072 /* 266 */ "with",
173073 /* 267 */ "where_opt_ret",
173074 /* 268 */ "setlist",
173075 /* 269 */ "insert_cmd",
173076 /* 270 */ "idlist_opt",
173077 /* 271 */ "upsert",
173078 /* 272 */ "returning",
173079 /* 273 */ "filter_over",
173080 /* 274 */ "likeop",
173081 /* 275 */ "between_op",
173082 /* 276 */ "in_op",
173083 /* 277 */ "paren_exprlist",
173084 /* 278 */ "case_operand",
173085 /* 279 */ "case_exprlist",
173086 /* 280 */ "case_else",
173087 /* 281 */ "uniqueflag",
173088 /* 282 */ "collate",
173089 /* 283 */ "vinto",
173090 /* 284 */ "nmnum",
173091 /* 285 */ "trigger_decl",
173092 /* 286 */ "trigger_cmd_list",
173093 /* 287 */ "trigger_time",
173094 /* 288 */ "trigger_event",
173095 /* 289 */ "foreach_clause",
173096 /* 290 */ "when_clause",
173097 /* 291 */ "trigger_cmd",
173098 /* 292 */ "trnm",
173099 /* 293 */ "tridxby",
173100 /* 294 */ "database_kw_opt",
173101 /* 295 */ "key_opt",
173102 /* 296 */ "add_column_fullname",
173103 /* 297 */ "kwcolumn_opt",
173104 /* 298 */ "create_vtab",
173105 /* 299 */ "vtabarglist",
173106 /* 300 */ "vtabarg",
173107 /* 301 */ "vtabargtoken",
173108 /* 302 */ "lp",
173109 /* 303 */ "anylist",
173110 /* 304 */ "wqitem",
173111 /* 305 */ "wqas",
173112 /* 306 */ "windowdefn_list",
173113 /* 307 */ "windowdefn",
173114 /* 308 */ "window",
173115 /* 309 */ "frame_opt",
173116 /* 310 */ "part_opt",
173117 /* 311 */ "filter_clause",
173118 /* 312 */ "over_clause",
173119 /* 313 */ "range_or_rows",
173120 /* 314 */ "frame_bound",
173121 /* 315 */ "frame_bound_s",
173122 /* 316 */ "frame_bound_e",
173123 /* 317 */ "frame_exclude_opt",
173124 /* 318 */ "frame_exclude",
 
173125 };
173126 #endif /* defined(YYCOVERAGE) || !defined(NDEBUG) */
173127
173128 #ifndef NDEBUG
173129 /* For tracing reduce actions, the names of all rules are required.
@@ -173467,75 +173752,76 @@
173467 /* 335 */ "filter_over ::= over_clause",
173468 /* 336 */ "filter_over ::= filter_clause",
173469 /* 337 */ "over_clause ::= OVER LP window RP",
173470 /* 338 */ "over_clause ::= OVER nm",
173471 /* 339 */ "filter_clause ::= FILTER LP WHERE expr RP",
173472 /* 340 */ "input ::= cmdlist",
173473 /* 341 */ "cmdlist ::= cmdlist ecmd",
173474 /* 342 */ "cmdlist ::= ecmd",
173475 /* 343 */ "ecmd ::= SEMI",
173476 /* 344 */ "ecmd ::= cmdx SEMI",
173477 /* 345 */ "ecmd ::= explain cmdx SEMI",
173478 /* 346 */ "trans_opt ::=",
173479 /* 347 */ "trans_opt ::= TRANSACTION",
173480 /* 348 */ "trans_opt ::= TRANSACTION nm",
173481 /* 349 */ "savepoint_opt ::= SAVEPOINT",
173482 /* 350 */ "savepoint_opt ::=",
173483 /* 351 */ "cmd ::= create_table create_table_args",
173484 /* 352 */ "table_option_set ::= table_option",
173485 /* 353 */ "columnlist ::= columnlist COMMA columnname carglist",
173486 /* 354 */ "columnlist ::= columnname carglist",
173487 /* 355 */ "nm ::= ID|INDEXED|JOIN_KW",
173488 /* 356 */ "nm ::= STRING",
173489 /* 357 */ "typetoken ::= typename",
173490 /* 358 */ "typename ::= ID|STRING",
173491 /* 359 */ "signed ::= plus_num",
173492 /* 360 */ "signed ::= minus_num",
173493 /* 361 */ "carglist ::= carglist ccons",
173494 /* 362 */ "carglist ::=",
173495 /* 363 */ "ccons ::= NULL onconf",
173496 /* 364 */ "ccons ::= GENERATED ALWAYS AS generated",
173497 /* 365 */ "ccons ::= AS generated",
173498 /* 366 */ "conslist_opt ::= COMMA conslist",
173499 /* 367 */ "conslist ::= conslist tconscomma tcons",
173500 /* 368 */ "conslist ::= tcons",
173501 /* 369 */ "tconscomma ::=",
173502 /* 370 */ "defer_subclause_opt ::= defer_subclause",
173503 /* 371 */ "resolvetype ::= raisetype",
173504 /* 372 */ "selectnowith ::= oneselect",
173505 /* 373 */ "oneselect ::= values",
173506 /* 374 */ "sclp ::= selcollist COMMA",
173507 /* 375 */ "as ::= ID|STRING",
173508 /* 376 */ "indexed_opt ::= indexed_by",
173509 /* 377 */ "returning ::=",
173510 /* 378 */ "expr ::= term",
173511 /* 379 */ "likeop ::= LIKE_KW|MATCH",
173512 /* 380 */ "case_operand ::= expr",
173513 /* 381 */ "exprlist ::= nexprlist",
173514 /* 382 */ "nmnum ::= plus_num",
173515 /* 383 */ "nmnum ::= nm",
173516 /* 384 */ "nmnum ::= ON",
173517 /* 385 */ "nmnum ::= DELETE",
173518 /* 386 */ "nmnum ::= DEFAULT",
173519 /* 387 */ "plus_num ::= INTEGER|FLOAT",
173520 /* 388 */ "foreach_clause ::=",
173521 /* 389 */ "foreach_clause ::= FOR EACH ROW",
173522 /* 390 */ "trnm ::= nm",
173523 /* 391 */ "tridxby ::=",
173524 /* 392 */ "database_kw_opt ::= DATABASE",
173525 /* 393 */ "database_kw_opt ::=",
173526 /* 394 */ "kwcolumn_opt ::=",
173527 /* 395 */ "kwcolumn_opt ::= COLUMNKW",
173528 /* 396 */ "vtabarglist ::= vtabarg",
173529 /* 397 */ "vtabarglist ::= vtabarglist COMMA vtabarg",
173530 /* 398 */ "vtabarg ::= vtabarg vtabargtoken",
173531 /* 399 */ "anylist ::=",
173532 /* 400 */ "anylist ::= anylist LP anylist RP",
173533 /* 401 */ "anylist ::= anylist ANY",
173534 /* 402 */ "with ::=",
173535 /* 403 */ "windowdefn_list ::= windowdefn",
173536 /* 404 */ "window ::= frame_opt",
 
173537 };
173538 #endif /* NDEBUG */
173539
173540
173541 #if YYGROWABLESTACK
@@ -173655,101 +173941,101 @@
173655 ** Note: during a reduce, the only symbols destroyed are those
173656 ** which appear on the RHS of the rule, but which are *not* used
173657 ** inside the C code.
173658 */
173659 /********* Begin destructor definitions ***************************************/
173660 case 204: /* select */
173661 case 239: /* selectnowith */
173662 case 240: /* oneselect */
173663 case 252: /* values */
173664 {
173665 sqlite3SelectDelete(pParse->db, (yypminor->yy47));
173666 }
173667 break;
173668 case 216: /* term */
173669 case 217: /* expr */
173670 case 246: /* where_opt */
173671 case 248: /* having_opt */
173672 case 267: /* where_opt_ret */
173673 case 278: /* case_operand */
173674 case 280: /* case_else */
173675 case 283: /* vinto */
173676 case 290: /* when_clause */
173677 case 295: /* key_opt */
173678 case 311: /* filter_clause */
173679 {
173680 sqlite3ExprDelete(pParse->db, (yypminor->yy528));
173681 }
173682 break;
173683 case 221: /* eidlist_opt */
173684 case 231: /* sortlist */
173685 case 232: /* eidlist */
173686 case 244: /* selcollist */
173687 case 247: /* groupby_opt */
173688 case 249: /* orderby_opt */
173689 case 253: /* nexprlist */
173690 case 254: /* sclp */
173691 case 261: /* exprlist */
173692 case 268: /* setlist */
173693 case 277: /* paren_exprlist */
173694 case 279: /* case_exprlist */
173695 case 310: /* part_opt */
173696 {
173697 sqlite3ExprListDelete(pParse->db, (yypminor->yy322));
173698 }
173699 break;
173700 case 238: /* fullname */
173701 case 245: /* from */
173702 case 256: /* seltablist */
173703 case 257: /* stl_prefix */
173704 case 262: /* xfullname */
173705 {
173706 sqlite3SrcListDelete(pParse->db, (yypminor->yy131));
173707 }
173708 break;
173709 case 241: /* wqlist */
173710 {
173711 sqlite3WithDelete(pParse->db, (yypminor->yy521));
173712 }
173713 break;
173714 case 251: /* window_clause */
173715 case 306: /* windowdefn_list */
173716 {
173717 sqlite3WindowListDelete(pParse->db, (yypminor->yy41));
173718 }
173719 break;
173720 case 263: /* idlist */
173721 case 270: /* idlist_opt */
173722 {
173723 sqlite3IdListDelete(pParse->db, (yypminor->yy254));
173724 }
173725 break;
173726 case 273: /* filter_over */
173727 case 307: /* windowdefn */
173728 case 308: /* window */
173729 case 309: /* frame_opt */
173730 case 312: /* over_clause */
173731 {
173732 sqlite3WindowDelete(pParse->db, (yypminor->yy41));
173733 }
173734 break;
173735 case 286: /* trigger_cmd_list */
173736 case 291: /* trigger_cmd */
173737 {
173738 sqlite3DeleteTriggerStep(pParse->db, (yypminor->yy33));
173739 }
173740 break;
173741 case 288: /* trigger_event */
173742 {
173743 sqlite3IdListDelete(pParse->db, (yypminor->yy180).b);
173744 }
173745 break;
173746 case 314: /* frame_bound */
173747 case 315: /* frame_bound_s */
173748 case 316: /* frame_bound_e */
173749 {
173750 sqlite3ExprDelete(pParse->db, (yypminor->yy595).pExpr);
173751 }
173752 break;
173753 /********* End destructor definitions *****************************************/
173754 default: break; /* If no destructor action specified: do nothing */
173755 }
@@ -174047,415 +174333,416 @@
174047 }
174048
174049 /* For rule J, yyRuleInfoLhs[J] contains the symbol on the left-hand side
174050 ** of that rule */
174051 static const YYCODETYPE yyRuleInfoLhs[] = {
174052 189, /* (0) explain ::= EXPLAIN */
174053 189, /* (1) explain ::= EXPLAIN QUERY PLAN */
174054 188, /* (2) cmdx ::= cmd */
174055 190, /* (3) cmd ::= BEGIN transtype trans_opt */
174056 191, /* (4) transtype ::= */
174057 191, /* (5) transtype ::= DEFERRED */
174058 191, /* (6) transtype ::= IMMEDIATE */
174059 191, /* (7) transtype ::= EXCLUSIVE */
174060 190, /* (8) cmd ::= COMMIT|END trans_opt */
174061 190, /* (9) cmd ::= ROLLBACK trans_opt */
174062 190, /* (10) cmd ::= SAVEPOINT nm */
174063 190, /* (11) cmd ::= RELEASE savepoint_opt nm */
174064 190, /* (12) cmd ::= ROLLBACK trans_opt TO savepoint_opt nm */
174065 195, /* (13) create_table ::= createkw temp TABLE ifnotexists nm dbnm */
174066 197, /* (14) createkw ::= CREATE */
174067 199, /* (15) ifnotexists ::= */
174068 199, /* (16) ifnotexists ::= IF NOT EXISTS */
174069 198, /* (17) temp ::= TEMP */
174070 198, /* (18) temp ::= */
174071 196, /* (19) create_table_args ::= LP columnlist conslist_opt RP table_option_set */
174072 196, /* (20) create_table_args ::= AS select */
174073 203, /* (21) table_option_set ::= */
174074 203, /* (22) table_option_set ::= table_option_set COMMA table_option */
174075 205, /* (23) table_option ::= WITHOUT nm */
174076 205, /* (24) table_option ::= nm */
174077 206, /* (25) columnname ::= nm typetoken */
174078 208, /* (26) typetoken ::= */
174079 208, /* (27) typetoken ::= typename LP signed RP */
174080 208, /* (28) typetoken ::= typename LP signed COMMA signed RP */
174081 209, /* (29) typename ::= typename ID|STRING */
174082 213, /* (30) scanpt ::= */
174083 214, /* (31) scantok ::= */
174084 215, /* (32) ccons ::= CONSTRAINT nm */
174085 215, /* (33) ccons ::= DEFAULT scantok term */
174086 215, /* (34) ccons ::= DEFAULT LP expr RP */
174087 215, /* (35) ccons ::= DEFAULT PLUS scantok term */
174088 215, /* (36) ccons ::= DEFAULT MINUS scantok term */
174089 215, /* (37) ccons ::= DEFAULT scantok ID|INDEXED */
174090 215, /* (38) ccons ::= NOT NULL onconf */
174091 215, /* (39) ccons ::= PRIMARY KEY sortorder onconf autoinc */
174092 215, /* (40) ccons ::= UNIQUE onconf */
174093 215, /* (41) ccons ::= CHECK LP expr RP */
174094 215, /* (42) ccons ::= REFERENCES nm eidlist_opt refargs */
174095 215, /* (43) ccons ::= defer_subclause */
174096 215, /* (44) ccons ::= COLLATE ID|STRING */
174097 224, /* (45) generated ::= LP expr RP */
174098 224, /* (46) generated ::= LP expr RP ID */
174099 220, /* (47) autoinc ::= */
174100 220, /* (48) autoinc ::= AUTOINCR */
174101 222, /* (49) refargs ::= */
174102 222, /* (50) refargs ::= refargs refarg */
174103 225, /* (51) refarg ::= MATCH nm */
174104 225, /* (52) refarg ::= ON INSERT refact */
174105 225, /* (53) refarg ::= ON DELETE refact */
174106 225, /* (54) refarg ::= ON UPDATE refact */
174107 226, /* (55) refact ::= SET NULL */
174108 226, /* (56) refact ::= SET DEFAULT */
174109 226, /* (57) refact ::= CASCADE */
174110 226, /* (58) refact ::= RESTRICT */
174111 226, /* (59) refact ::= NO ACTION */
174112 223, /* (60) defer_subclause ::= NOT DEFERRABLE init_deferred_pred_opt */
174113 223, /* (61) defer_subclause ::= DEFERRABLE init_deferred_pred_opt */
174114 227, /* (62) init_deferred_pred_opt ::= */
174115 227, /* (63) init_deferred_pred_opt ::= INITIALLY DEFERRED */
174116 227, /* (64) init_deferred_pred_opt ::= INITIALLY IMMEDIATE */
174117 202, /* (65) conslist_opt ::= */
174118 229, /* (66) tconscomma ::= COMMA */
174119 230, /* (67) tcons ::= CONSTRAINT nm */
174120 230, /* (68) tcons ::= PRIMARY KEY LP sortlist autoinc RP onconf */
174121 230, /* (69) tcons ::= UNIQUE LP sortlist RP onconf */
174122 230, /* (70) tcons ::= CHECK LP expr RP onconf */
174123 230, /* (71) tcons ::= FOREIGN KEY LP eidlist RP REFERENCES nm eidlist_opt refargs defer_subclause_opt */
174124 233, /* (72) defer_subclause_opt ::= */
174125 218, /* (73) onconf ::= */
174126 218, /* (74) onconf ::= ON CONFLICT resolvetype */
174127 234, /* (75) orconf ::= */
174128 234, /* (76) orconf ::= OR resolvetype */
174129 235, /* (77) resolvetype ::= IGNORE */
174130 235, /* (78) resolvetype ::= REPLACE */
174131 190, /* (79) cmd ::= DROP TABLE ifexists fullname */
174132 237, /* (80) ifexists ::= IF EXISTS */
174133 237, /* (81) ifexists ::= */
174134 190, /* (82) cmd ::= createkw temp VIEW ifnotexists nm dbnm eidlist_opt AS select */
174135 190, /* (83) cmd ::= DROP VIEW ifexists fullname */
174136 190, /* (84) cmd ::= select */
174137 204, /* (85) select ::= WITH wqlist selectnowith */
174138 204, /* (86) select ::= WITH RECURSIVE wqlist selectnowith */
174139 204, /* (87) select ::= selectnowith */
174140 239, /* (88) selectnowith ::= selectnowith multiselect_op oneselect */
174141 242, /* (89) multiselect_op ::= UNION */
174142 242, /* (90) multiselect_op ::= UNION ALL */
174143 242, /* (91) multiselect_op ::= EXCEPT|INTERSECT */
174144 240, /* (92) oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt orderby_opt limit_opt */
174145 240, /* (93) oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt window_clause orderby_opt limit_opt */
174146 252, /* (94) values ::= VALUES LP nexprlist RP */
174147 252, /* (95) values ::= values COMMA LP nexprlist RP */
174148 243, /* (96) distinct ::= DISTINCT */
174149 243, /* (97) distinct ::= ALL */
174150 243, /* (98) distinct ::= */
174151 254, /* (99) sclp ::= */
174152 244, /* (100) selcollist ::= sclp scanpt expr scanpt as */
174153 244, /* (101) selcollist ::= sclp scanpt STAR */
174154 244, /* (102) selcollist ::= sclp scanpt nm DOT STAR */
174155 255, /* (103) as ::= AS nm */
174156 255, /* (104) as ::= */
174157 245, /* (105) from ::= */
174158 245, /* (106) from ::= FROM seltablist */
174159 257, /* (107) stl_prefix ::= seltablist joinop */
174160 257, /* (108) stl_prefix ::= */
174161 256, /* (109) seltablist ::= stl_prefix nm dbnm as on_using */
174162 256, /* (110) seltablist ::= stl_prefix nm dbnm as indexed_by on_using */
174163 256, /* (111) seltablist ::= stl_prefix nm dbnm LP exprlist RP as on_using */
174164 256, /* (112) seltablist ::= stl_prefix LP select RP as on_using */
174165 256, /* (113) seltablist ::= stl_prefix LP seltablist RP as on_using */
174166 200, /* (114) dbnm ::= */
174167 200, /* (115) dbnm ::= DOT nm */
174168 238, /* (116) fullname ::= nm */
174169 238, /* (117) fullname ::= nm DOT nm */
174170 262, /* (118) xfullname ::= nm */
174171 262, /* (119) xfullname ::= nm DOT nm */
174172 262, /* (120) xfullname ::= nm DOT nm AS nm */
174173 262, /* (121) xfullname ::= nm AS nm */
174174 258, /* (122) joinop ::= COMMA|JOIN */
174175 258, /* (123) joinop ::= JOIN_KW JOIN */
174176 258, /* (124) joinop ::= JOIN_KW nm JOIN */
174177 258, /* (125) joinop ::= JOIN_KW nm nm JOIN */
174178 259, /* (126) on_using ::= ON expr */
174179 259, /* (127) on_using ::= USING LP idlist RP */
174180 259, /* (128) on_using ::= */
174181 264, /* (129) indexed_opt ::= */
174182 260, /* (130) indexed_by ::= INDEXED BY nm */
174183 260, /* (131) indexed_by ::= NOT INDEXED */
174184 249, /* (132) orderby_opt ::= */
174185 249, /* (133) orderby_opt ::= ORDER BY sortlist */
174186 231, /* (134) sortlist ::= sortlist COMMA expr sortorder nulls */
174187 231, /* (135) sortlist ::= expr sortorder nulls */
174188 219, /* (136) sortorder ::= ASC */
174189 219, /* (137) sortorder ::= DESC */
174190 219, /* (138) sortorder ::= */
174191 265, /* (139) nulls ::= NULLS FIRST */
174192 265, /* (140) nulls ::= NULLS LAST */
174193 265, /* (141) nulls ::= */
174194 247, /* (142) groupby_opt ::= */
174195 247, /* (143) groupby_opt ::= GROUP BY nexprlist */
174196 248, /* (144) having_opt ::= */
174197 248, /* (145) having_opt ::= HAVING expr */
174198 250, /* (146) limit_opt ::= */
174199 250, /* (147) limit_opt ::= LIMIT expr */
174200 250, /* (148) limit_opt ::= LIMIT expr OFFSET expr */
174201 250, /* (149) limit_opt ::= LIMIT expr COMMA expr */
174202 190, /* (150) cmd ::= with DELETE FROM xfullname indexed_opt where_opt_ret */
174203 246, /* (151) where_opt ::= */
174204 246, /* (152) where_opt ::= WHERE expr */
174205 267, /* (153) where_opt_ret ::= */
174206 267, /* (154) where_opt_ret ::= WHERE expr */
174207 267, /* (155) where_opt_ret ::= RETURNING selcollist */
174208 267, /* (156) where_opt_ret ::= WHERE expr RETURNING selcollist */
174209 190, /* (157) cmd ::= with UPDATE orconf xfullname indexed_opt SET setlist from where_opt_ret */
174210 268, /* (158) setlist ::= setlist COMMA nm EQ expr */
174211 268, /* (159) setlist ::= setlist COMMA LP idlist RP EQ expr */
174212 268, /* (160) setlist ::= nm EQ expr */
174213 268, /* (161) setlist ::= LP idlist RP EQ expr */
174214 190, /* (162) cmd ::= with insert_cmd INTO xfullname idlist_opt select upsert */
174215 190, /* (163) cmd ::= with insert_cmd INTO xfullname idlist_opt DEFAULT VALUES returning */
174216 271, /* (164) upsert ::= */
174217 271, /* (165) upsert ::= RETURNING selcollist */
174218 271, /* (166) upsert ::= ON CONFLICT LP sortlist RP where_opt DO UPDATE SET setlist where_opt upsert */
174219 271, /* (167) upsert ::= ON CONFLICT LP sortlist RP where_opt DO NOTHING upsert */
174220 271, /* (168) upsert ::= ON CONFLICT DO NOTHING returning */
174221 271, /* (169) upsert ::= ON CONFLICT DO UPDATE SET setlist where_opt returning */
174222 272, /* (170) returning ::= RETURNING selcollist */
174223 269, /* (171) insert_cmd ::= INSERT orconf */
174224 269, /* (172) insert_cmd ::= REPLACE */
174225 270, /* (173) idlist_opt ::= */
174226 270, /* (174) idlist_opt ::= LP idlist RP */
174227 263, /* (175) idlist ::= idlist COMMA nm */
174228 263, /* (176) idlist ::= nm */
174229 217, /* (177) expr ::= LP expr RP */
174230 217, /* (178) expr ::= ID|INDEXED|JOIN_KW */
174231 217, /* (179) expr ::= nm DOT nm */
174232 217, /* (180) expr ::= nm DOT nm DOT nm */
174233 216, /* (181) term ::= NULL|FLOAT|BLOB */
174234 216, /* (182) term ::= STRING */
174235 216, /* (183) term ::= INTEGER */
174236 217, /* (184) expr ::= VARIABLE */
174237 217, /* (185) expr ::= expr COLLATE ID|STRING */
174238 217, /* (186) expr ::= CAST LP expr AS typetoken RP */
174239 217, /* (187) expr ::= ID|INDEXED|JOIN_KW LP distinct exprlist RP */
174240 217, /* (188) expr ::= ID|INDEXED|JOIN_KW LP distinct exprlist ORDER BY sortlist RP */
174241 217, /* (189) expr ::= ID|INDEXED|JOIN_KW LP STAR RP */
174242 217, /* (190) expr ::= ID|INDEXED|JOIN_KW LP distinct exprlist RP filter_over */
174243 217, /* (191) expr ::= ID|INDEXED|JOIN_KW LP distinct exprlist ORDER BY sortlist RP filter_over */
174244 217, /* (192) expr ::= ID|INDEXED|JOIN_KW LP STAR RP filter_over */
174245 216, /* (193) term ::= CTIME_KW */
174246 217, /* (194) expr ::= LP nexprlist COMMA expr RP */
174247 217, /* (195) expr ::= expr AND expr */
174248 217, /* (196) expr ::= expr OR expr */
174249 217, /* (197) expr ::= expr LT|GT|GE|LE expr */
174250 217, /* (198) expr ::= expr EQ|NE expr */
174251 217, /* (199) expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr */
174252 217, /* (200) expr ::= expr PLUS|MINUS expr */
174253 217, /* (201) expr ::= expr STAR|SLASH|REM expr */
174254 217, /* (202) expr ::= expr CONCAT expr */
174255 274, /* (203) likeop ::= NOT LIKE_KW|MATCH */
174256 217, /* (204) expr ::= expr likeop expr */
174257 217, /* (205) expr ::= expr likeop expr ESCAPE expr */
174258 217, /* (206) expr ::= expr ISNULL|NOTNULL */
174259 217, /* (207) expr ::= expr NOT NULL */
174260 217, /* (208) expr ::= expr IS expr */
174261 217, /* (209) expr ::= expr IS NOT expr */
174262 217, /* (210) expr ::= expr IS NOT DISTINCT FROM expr */
174263 217, /* (211) expr ::= expr IS DISTINCT FROM expr */
174264 217, /* (212) expr ::= NOT expr */
174265 217, /* (213) expr ::= BITNOT expr */
174266 217, /* (214) expr ::= PLUS|MINUS expr */
174267 217, /* (215) expr ::= expr PTR expr */
174268 275, /* (216) between_op ::= BETWEEN */
174269 275, /* (217) between_op ::= NOT BETWEEN */
174270 217, /* (218) expr ::= expr between_op expr AND expr */
174271 276, /* (219) in_op ::= IN */
174272 276, /* (220) in_op ::= NOT IN */
174273 217, /* (221) expr ::= expr in_op LP exprlist RP */
174274 217, /* (222) expr ::= LP select RP */
174275 217, /* (223) expr ::= expr in_op LP select RP */
174276 217, /* (224) expr ::= expr in_op nm dbnm paren_exprlist */
174277 217, /* (225) expr ::= EXISTS LP select RP */
174278 217, /* (226) expr ::= CASE case_operand case_exprlist case_else END */
174279 279, /* (227) case_exprlist ::= case_exprlist WHEN expr THEN expr */
174280 279, /* (228) case_exprlist ::= WHEN expr THEN expr */
174281 280, /* (229) case_else ::= ELSE expr */
174282 280, /* (230) case_else ::= */
174283 278, /* (231) case_operand ::= */
174284 261, /* (232) exprlist ::= */
174285 253, /* (233) nexprlist ::= nexprlist COMMA expr */
174286 253, /* (234) nexprlist ::= expr */
174287 277, /* (235) paren_exprlist ::= */
174288 277, /* (236) paren_exprlist ::= LP exprlist RP */
174289 190, /* (237) cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP sortlist RP where_opt */
174290 281, /* (238) uniqueflag ::= UNIQUE */
174291 281, /* (239) uniqueflag ::= */
174292 221, /* (240) eidlist_opt ::= */
174293 221, /* (241) eidlist_opt ::= LP eidlist RP */
174294 232, /* (242) eidlist ::= eidlist COMMA nm collate sortorder */
174295 232, /* (243) eidlist ::= nm collate sortorder */
174296 282, /* (244) collate ::= */
174297 282, /* (245) collate ::= COLLATE ID|STRING */
174298 190, /* (246) cmd ::= DROP INDEX ifexists fullname */
174299 190, /* (247) cmd ::= VACUUM vinto */
174300 190, /* (248) cmd ::= VACUUM nm vinto */
174301 283, /* (249) vinto ::= INTO expr */
174302 283, /* (250) vinto ::= */
174303 190, /* (251) cmd ::= PRAGMA nm dbnm */
174304 190, /* (252) cmd ::= PRAGMA nm dbnm EQ nmnum */
174305 190, /* (253) cmd ::= PRAGMA nm dbnm LP nmnum RP */
174306 190, /* (254) cmd ::= PRAGMA nm dbnm EQ minus_num */
174307 190, /* (255) cmd ::= PRAGMA nm dbnm LP minus_num RP */
174308 211, /* (256) plus_num ::= PLUS INTEGER|FLOAT */
174309 212, /* (257) minus_num ::= MINUS INTEGER|FLOAT */
174310 190, /* (258) cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END */
174311 285, /* (259) trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause */
174312 287, /* (260) trigger_time ::= BEFORE|AFTER */
174313 287, /* (261) trigger_time ::= INSTEAD OF */
174314 287, /* (262) trigger_time ::= */
174315 288, /* (263) trigger_event ::= DELETE|INSERT */
174316 288, /* (264) trigger_event ::= UPDATE */
174317 288, /* (265) trigger_event ::= UPDATE OF idlist */
174318 290, /* (266) when_clause ::= */
174319 290, /* (267) when_clause ::= WHEN expr */
174320 286, /* (268) trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI */
174321 286, /* (269) trigger_cmd_list ::= trigger_cmd SEMI */
174322 292, /* (270) trnm ::= nm DOT nm */
174323 293, /* (271) tridxby ::= INDEXED BY nm */
174324 293, /* (272) tridxby ::= NOT INDEXED */
174325 291, /* (273) trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist from where_opt scanpt */
174326 291, /* (274) trigger_cmd ::= scanpt insert_cmd INTO trnm idlist_opt select upsert scanpt */
174327 291, /* (275) trigger_cmd ::= DELETE FROM trnm tridxby where_opt scanpt */
174328 291, /* (276) trigger_cmd ::= scanpt select scanpt */
174329 217, /* (277) expr ::= RAISE LP IGNORE RP */
174330 217, /* (278) expr ::= RAISE LP raisetype COMMA nm RP */
174331 236, /* (279) raisetype ::= ROLLBACK */
174332 236, /* (280) raisetype ::= ABORT */
174333 236, /* (281) raisetype ::= FAIL */
174334 190, /* (282) cmd ::= DROP TRIGGER ifexists fullname */
174335 190, /* (283) cmd ::= ATTACH database_kw_opt expr AS expr key_opt */
174336 190, /* (284) cmd ::= DETACH database_kw_opt expr */
174337 295, /* (285) key_opt ::= */
174338 295, /* (286) key_opt ::= KEY expr */
174339 190, /* (287) cmd ::= REINDEX */
174340 190, /* (288) cmd ::= REINDEX nm dbnm */
174341 190, /* (289) cmd ::= ANALYZE */
174342 190, /* (290) cmd ::= ANALYZE nm dbnm */
174343 190, /* (291) cmd ::= ALTER TABLE fullname RENAME TO nm */
174344 190, /* (292) cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt columnname carglist */
174345 190, /* (293) cmd ::= ALTER TABLE fullname DROP kwcolumn_opt nm */
174346 296, /* (294) add_column_fullname ::= fullname */
174347 190, /* (295) cmd ::= ALTER TABLE fullname RENAME kwcolumn_opt nm TO nm */
174348 190, /* (296) cmd ::= create_vtab */
174349 190, /* (297) cmd ::= create_vtab LP vtabarglist RP */
174350 298, /* (298) create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm */
174351 300, /* (299) vtabarg ::= */
174352 301, /* (300) vtabargtoken ::= ANY */
174353 301, /* (301) vtabargtoken ::= lp anylist RP */
174354 302, /* (302) lp ::= LP */
174355 266, /* (303) with ::= WITH wqlist */
174356 266, /* (304) with ::= WITH RECURSIVE wqlist */
174357 305, /* (305) wqas ::= AS */
174358 305, /* (306) wqas ::= AS MATERIALIZED */
174359 305, /* (307) wqas ::= AS NOT MATERIALIZED */
174360 304, /* (308) wqitem ::= nm eidlist_opt wqas LP select RP */
174361 241, /* (309) wqlist ::= wqitem */
174362 241, /* (310) wqlist ::= wqlist COMMA wqitem */
174363 306, /* (311) windowdefn_list ::= windowdefn_list COMMA windowdefn */
174364 307, /* (312) windowdefn ::= nm AS LP window RP */
174365 308, /* (313) window ::= PARTITION BY nexprlist orderby_opt frame_opt */
174366 308, /* (314) window ::= nm PARTITION BY nexprlist orderby_opt frame_opt */
174367 308, /* (315) window ::= ORDER BY sortlist frame_opt */
174368 308, /* (316) window ::= nm ORDER BY sortlist frame_opt */
174369 308, /* (317) window ::= nm frame_opt */
174370 309, /* (318) frame_opt ::= */
174371 309, /* (319) frame_opt ::= range_or_rows frame_bound_s frame_exclude_opt */
174372 309, /* (320) frame_opt ::= range_or_rows BETWEEN frame_bound_s AND frame_bound_e frame_exclude_opt */
174373 313, /* (321) range_or_rows ::= RANGE|ROWS|GROUPS */
174374 315, /* (322) frame_bound_s ::= frame_bound */
174375 315, /* (323) frame_bound_s ::= UNBOUNDED PRECEDING */
174376 316, /* (324) frame_bound_e ::= frame_bound */
174377 316, /* (325) frame_bound_e ::= UNBOUNDED FOLLOWING */
174378 314, /* (326) frame_bound ::= expr PRECEDING|FOLLOWING */
174379 314, /* (327) frame_bound ::= CURRENT ROW */
174380 317, /* (328) frame_exclude_opt ::= */
174381 317, /* (329) frame_exclude_opt ::= EXCLUDE frame_exclude */
174382 318, /* (330) frame_exclude ::= NO OTHERS */
174383 318, /* (331) frame_exclude ::= CURRENT ROW */
174384 318, /* (332) frame_exclude ::= GROUP|TIES */
174385 251, /* (333) window_clause ::= WINDOW windowdefn_list */
174386 273, /* (334) filter_over ::= filter_clause over_clause */
174387 273, /* (335) filter_over ::= over_clause */
174388 273, /* (336) filter_over ::= filter_clause */
174389 312, /* (337) over_clause ::= OVER LP window RP */
174390 312, /* (338) over_clause ::= OVER nm */
174391 311, /* (339) filter_clause ::= FILTER LP WHERE expr RP */
174392 185, /* (340) input ::= cmdlist */
174393 186, /* (341) cmdlist ::= cmdlist ecmd */
174394 186, /* (342) cmdlist ::= ecmd */
174395 187, /* (343) ecmd ::= SEMI */
174396 187, /* (344) ecmd ::= cmdx SEMI */
174397 187, /* (345) ecmd ::= explain cmdx SEMI */
174398 192, /* (346) trans_opt ::= */
174399 192, /* (347) trans_opt ::= TRANSACTION */
174400 192, /* (348) trans_opt ::= TRANSACTION nm */
174401 194, /* (349) savepoint_opt ::= SAVEPOINT */
174402 194, /* (350) savepoint_opt ::= */
174403 190, /* (351) cmd ::= create_table create_table_args */
174404 203, /* (352) table_option_set ::= table_option */
174405 201, /* (353) columnlist ::= columnlist COMMA columnname carglist */
174406 201, /* (354) columnlist ::= columnname carglist */
174407 193, /* (355) nm ::= ID|INDEXED|JOIN_KW */
174408 193, /* (356) nm ::= STRING */
174409 208, /* (357) typetoken ::= typename */
174410 209, /* (358) typename ::= ID|STRING */
174411 210, /* (359) signed ::= plus_num */
174412 210, /* (360) signed ::= minus_num */
174413 207, /* (361) carglist ::= carglist ccons */
174414 207, /* (362) carglist ::= */
174415 215, /* (363) ccons ::= NULL onconf */
174416 215, /* (364) ccons ::= GENERATED ALWAYS AS generated */
174417 215, /* (365) ccons ::= AS generated */
174418 202, /* (366) conslist_opt ::= COMMA conslist */
174419 228, /* (367) conslist ::= conslist tconscomma tcons */
174420 228, /* (368) conslist ::= tcons */
174421 229, /* (369) tconscomma ::= */
174422 233, /* (370) defer_subclause_opt ::= defer_subclause */
174423 235, /* (371) resolvetype ::= raisetype */
174424 239, /* (372) selectnowith ::= oneselect */
174425 240, /* (373) oneselect ::= values */
174426 254, /* (374) sclp ::= selcollist COMMA */
174427 255, /* (375) as ::= ID|STRING */
174428 264, /* (376) indexed_opt ::= indexed_by */
174429 272, /* (377) returning ::= */
174430 217, /* (378) expr ::= term */
174431 274, /* (379) likeop ::= LIKE_KW|MATCH */
174432 278, /* (380) case_operand ::= expr */
174433 261, /* (381) exprlist ::= nexprlist */
174434 284, /* (382) nmnum ::= plus_num */
174435 284, /* (383) nmnum ::= nm */
174436 284, /* (384) nmnum ::= ON */
174437 284, /* (385) nmnum ::= DELETE */
174438 284, /* (386) nmnum ::= DEFAULT */
174439 211, /* (387) plus_num ::= INTEGER|FLOAT */
174440 289, /* (388) foreach_clause ::= */
174441 289, /* (389) foreach_clause ::= FOR EACH ROW */
174442 292, /* (390) trnm ::= nm */
174443 293, /* (391) tridxby ::= */
174444 294, /* (392) database_kw_opt ::= DATABASE */
174445 294, /* (393) database_kw_opt ::= */
174446 297, /* (394) kwcolumn_opt ::= */
174447 297, /* (395) kwcolumn_opt ::= COLUMNKW */
174448 299, /* (396) vtabarglist ::= vtabarg */
174449 299, /* (397) vtabarglist ::= vtabarglist COMMA vtabarg */
174450 300, /* (398) vtabarg ::= vtabarg vtabargtoken */
174451 303, /* (399) anylist ::= */
174452 303, /* (400) anylist ::= anylist LP anylist RP */
174453 303, /* (401) anylist ::= anylist ANY */
174454 266, /* (402) with ::= */
174455 306, /* (403) windowdefn_list ::= windowdefn */
174456 308, /* (404) window ::= frame_opt */
 
174457 };
174458
174459 /* For rule J, yyRuleInfoNRhs[J] contains the negative of the number
174460 ** of symbols on the right-hand side of that rule. */
174461 static const signed char yyRuleInfoNRhs[] = {
@@ -174797,75 +175084,76 @@
174797 -1, /* (335) filter_over ::= over_clause */
174798 -1, /* (336) filter_over ::= filter_clause */
174799 -4, /* (337) over_clause ::= OVER LP window RP */
174800 -2, /* (338) over_clause ::= OVER nm */
174801 -5, /* (339) filter_clause ::= FILTER LP WHERE expr RP */
174802 -1, /* (340) input ::= cmdlist */
174803 -2, /* (341) cmdlist ::= cmdlist ecmd */
174804 -1, /* (342) cmdlist ::= ecmd */
174805 -1, /* (343) ecmd ::= SEMI */
174806 -2, /* (344) ecmd ::= cmdx SEMI */
174807 -3, /* (345) ecmd ::= explain cmdx SEMI */
174808 0, /* (346) trans_opt ::= */
174809 -1, /* (347) trans_opt ::= TRANSACTION */
174810 -2, /* (348) trans_opt ::= TRANSACTION nm */
174811 -1, /* (349) savepoint_opt ::= SAVEPOINT */
174812 0, /* (350) savepoint_opt ::= */
174813 -2, /* (351) cmd ::= create_table create_table_args */
174814 -1, /* (352) table_option_set ::= table_option */
174815 -4, /* (353) columnlist ::= columnlist COMMA columnname carglist */
174816 -2, /* (354) columnlist ::= columnname carglist */
174817 -1, /* (355) nm ::= ID|INDEXED|JOIN_KW */
174818 -1, /* (356) nm ::= STRING */
174819 -1, /* (357) typetoken ::= typename */
174820 -1, /* (358) typename ::= ID|STRING */
174821 -1, /* (359) signed ::= plus_num */
174822 -1, /* (360) signed ::= minus_num */
174823 -2, /* (361) carglist ::= carglist ccons */
174824 0, /* (362) carglist ::= */
174825 -2, /* (363) ccons ::= NULL onconf */
174826 -4, /* (364) ccons ::= GENERATED ALWAYS AS generated */
174827 -2, /* (365) ccons ::= AS generated */
174828 -2, /* (366) conslist_opt ::= COMMA conslist */
174829 -3, /* (367) conslist ::= conslist tconscomma tcons */
174830 -1, /* (368) conslist ::= tcons */
174831 0, /* (369) tconscomma ::= */
174832 -1, /* (370) defer_subclause_opt ::= defer_subclause */
174833 -1, /* (371) resolvetype ::= raisetype */
174834 -1, /* (372) selectnowith ::= oneselect */
174835 -1, /* (373) oneselect ::= values */
174836 -2, /* (374) sclp ::= selcollist COMMA */
174837 -1, /* (375) as ::= ID|STRING */
174838 -1, /* (376) indexed_opt ::= indexed_by */
174839 0, /* (377) returning ::= */
174840 -1, /* (378) expr ::= term */
174841 -1, /* (379) likeop ::= LIKE_KW|MATCH */
174842 -1, /* (380) case_operand ::= expr */
174843 -1, /* (381) exprlist ::= nexprlist */
174844 -1, /* (382) nmnum ::= plus_num */
174845 -1, /* (383) nmnum ::= nm */
174846 -1, /* (384) nmnum ::= ON */
174847 -1, /* (385) nmnum ::= DELETE */
174848 -1, /* (386) nmnum ::= DEFAULT */
174849 -1, /* (387) plus_num ::= INTEGER|FLOAT */
174850 0, /* (388) foreach_clause ::= */
174851 -3, /* (389) foreach_clause ::= FOR EACH ROW */
174852 -1, /* (390) trnm ::= nm */
174853 0, /* (391) tridxby ::= */
174854 -1, /* (392) database_kw_opt ::= DATABASE */
174855 0, /* (393) database_kw_opt ::= */
174856 0, /* (394) kwcolumn_opt ::= */
174857 -1, /* (395) kwcolumn_opt ::= COLUMNKW */
174858 -1, /* (396) vtabarglist ::= vtabarg */
174859 -3, /* (397) vtabarglist ::= vtabarglist COMMA vtabarg */
174860 -2, /* (398) vtabarg ::= vtabarg vtabargtoken */
174861 0, /* (399) anylist ::= */
174862 -4, /* (400) anylist ::= anylist LP anylist RP */
174863 -2, /* (401) anylist ::= anylist ANY */
174864 0, /* (402) with ::= */
174865 -1, /* (403) windowdefn_list ::= windowdefn */
174866 -1, /* (404) window ::= frame_opt */
 
174867 };
174868
174869 static void yy_accept(yyParser*); /* Forward Declaration */
174870
174871 /*
@@ -174913,20 +175201,20 @@
174913 break;
174914 case 2: /* cmdx ::= cmd */
174915 { sqlite3FinishCoding(pParse); }
174916 break;
174917 case 3: /* cmd ::= BEGIN transtype trans_opt */
174918 {sqlite3BeginTransaction(pParse, yymsp[-1].minor.yy394);}
174919 break;
174920 case 4: /* transtype ::= */
174921 {yymsp[1].minor.yy394 = TK_DEFERRED;}
174922 break;
174923 case 5: /* transtype ::= DEFERRED */
174924 case 6: /* transtype ::= IMMEDIATE */ yytestcase(yyruleno==6);
174925 case 7: /* transtype ::= EXCLUSIVE */ yytestcase(yyruleno==7);
174926 case 321: /* range_or_rows ::= RANGE|ROWS|GROUPS */ yytestcase(yyruleno==321);
174927 {yymsp[0].minor.yy394 = yymsp[0].major; /*A-overwrites-X*/}
174928 break;
174929 case 8: /* cmd ::= COMMIT|END trans_opt */
174930 case 9: /* cmd ::= ROLLBACK trans_opt */ yytestcase(yyruleno==9);
174931 {sqlite3EndTransaction(pParse,yymsp[-1].major);}
174932 break;
@@ -174945,11 +175233,11 @@
174945 sqlite3Savepoint(pParse, SAVEPOINT_ROLLBACK, &yymsp[0].minor.yy0);
174946 }
174947 break;
174948 case 13: /* create_table ::= createkw temp TABLE ifnotexists nm dbnm */
174949 {
174950 sqlite3StartTable(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,yymsp[-4].minor.yy394,0,0,yymsp[-2].minor.yy394);
174951 }
174952 break;
174953 case 14: /* createkw ::= CREATE */
174954 {disableLookaside(pParse);}
174955 break;
@@ -174959,56 +175247,56 @@
174959 case 62: /* init_deferred_pred_opt ::= */ yytestcase(yyruleno==62);
174960 case 72: /* defer_subclause_opt ::= */ yytestcase(yyruleno==72);
174961 case 81: /* ifexists ::= */ yytestcase(yyruleno==81);
174962 case 98: /* distinct ::= */ yytestcase(yyruleno==98);
174963 case 244: /* collate ::= */ yytestcase(yyruleno==244);
174964 {yymsp[1].minor.yy394 = 0;}
174965 break;
174966 case 16: /* ifnotexists ::= IF NOT EXISTS */
174967 {yymsp[-2].minor.yy394 = 1;}
174968 break;
174969 case 17: /* temp ::= TEMP */
174970 {yymsp[0].minor.yy394 = pParse->db->init.busy==0;}
174971 break;
174972 case 19: /* create_table_args ::= LP columnlist conslist_opt RP table_option_set */
174973 {
174974 sqlite3EndTable(pParse,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0,yymsp[0].minor.yy285,0);
174975 }
174976 break;
174977 case 20: /* create_table_args ::= AS select */
174978 {
174979 sqlite3EndTable(pParse,0,0,0,yymsp[0].minor.yy47);
174980 sqlite3SelectDelete(pParse->db, yymsp[0].minor.yy47);
174981 }
174982 break;
174983 case 21: /* table_option_set ::= */
174984 {yymsp[1].minor.yy285 = 0;}
174985 break;
174986 case 22: /* table_option_set ::= table_option_set COMMA table_option */
174987 {yylhsminor.yy285 = yymsp[-2].minor.yy285|yymsp[0].minor.yy285;}
174988 yymsp[-2].minor.yy285 = yylhsminor.yy285;
174989 break;
174990 case 23: /* table_option ::= WITHOUT nm */
174991 {
174992 if( yymsp[0].minor.yy0.n==5 && sqlite3_strnicmp(yymsp[0].minor.yy0.z,"rowid",5)==0 ){
174993 yymsp[-1].minor.yy285 = TF_WithoutRowid | TF_NoVisibleRowid;
174994 }else{
174995 yymsp[-1].minor.yy285 = 0;
174996 sqlite3ErrorMsg(pParse, "unknown table option: %.*s", yymsp[0].minor.yy0.n, yymsp[0].minor.yy0.z);
174997 }
174998 }
174999 break;
175000 case 24: /* table_option ::= nm */
175001 {
175002 if( yymsp[0].minor.yy0.n==6 && sqlite3_strnicmp(yymsp[0].minor.yy0.z,"strict",6)==0 ){
175003 yylhsminor.yy285 = TF_Strict;
175004 }else{
175005 yylhsminor.yy285 = 0;
175006 sqlite3ErrorMsg(pParse, "unknown table option: %.*s", yymsp[0].minor.yy0.n, yymsp[0].minor.yy0.z);
175007 }
175008 }
175009 yymsp[0].minor.yy285 = yylhsminor.yy285;
175010 break;
175011 case 25: /* columnname ::= nm typetoken */
175012 {sqlite3AddColumn(pParse,yymsp[-1].minor.yy0,yymsp[0].minor.yy0);}
175013 break;
175014 case 26: /* typetoken ::= */
@@ -175030,11 +175318,11 @@
175030 {yymsp[-1].minor.yy0.n=yymsp[0].minor.yy0.n+(int)(yymsp[0].minor.yy0.z-yymsp[-1].minor.yy0.z);}
175031 break;
175032 case 30: /* scanpt ::= */
175033 {
175034 assert( yyLookahead!=YYNOCODE );
175035 yymsp[1].minor.yy522 = yyLookaheadToken.z;
175036 }
175037 break;
175038 case 31: /* scantok ::= */
175039 {
175040 assert( yyLookahead!=YYNOCODE );
@@ -175044,21 +175332,21 @@
175044 case 32: /* ccons ::= CONSTRAINT nm */
175045 case 67: /* tcons ::= CONSTRAINT nm */ yytestcase(yyruleno==67);
175046 {pParse->constraintName = yymsp[0].minor.yy0;}
175047 break;
175048 case 33: /* ccons ::= DEFAULT scantok term */
175049 {sqlite3AddDefaultValue(pParse,yymsp[0].minor.yy528,yymsp[-1].minor.yy0.z,&yymsp[-1].minor.yy0.z[yymsp[-1].minor.yy0.n]);}
175050 break;
175051 case 34: /* ccons ::= DEFAULT LP expr RP */
175052 {sqlite3AddDefaultValue(pParse,yymsp[-1].minor.yy528,yymsp[-2].minor.yy0.z+1,yymsp[0].minor.yy0.z);}
175053 break;
175054 case 35: /* ccons ::= DEFAULT PLUS scantok term */
175055 {sqlite3AddDefaultValue(pParse,yymsp[0].minor.yy528,yymsp[-2].minor.yy0.z,&yymsp[-1].minor.yy0.z[yymsp[-1].minor.yy0.n]);}
175056 break;
175057 case 36: /* ccons ::= DEFAULT MINUS scantok term */
175058 {
175059 Expr *p = sqlite3PExpr(pParse, TK_UMINUS, yymsp[0].minor.yy528, 0);
175060 sqlite3AddDefaultValue(pParse,p,yymsp[-2].minor.yy0.z,&yymsp[-1].minor.yy0.z[yymsp[-1].minor.yy0.n]);
175061 }
175062 break;
175063 case 37: /* ccons ::= DEFAULT scantok ID|INDEXED */
175064 {
@@ -175069,261 +175357,261 @@
175069 }
175070 sqlite3AddDefaultValue(pParse,p,yymsp[0].minor.yy0.z,yymsp[0].minor.yy0.z+yymsp[0].minor.yy0.n);
175071 }
175072 break;
175073 case 38: /* ccons ::= NOT NULL onconf */
175074 {sqlite3AddNotNull(pParse, yymsp[0].minor.yy394);}
175075 break;
175076 case 39: /* ccons ::= PRIMARY KEY sortorder onconf autoinc */
175077 {sqlite3AddPrimaryKey(pParse,0,yymsp[-1].minor.yy394,yymsp[0].minor.yy394,yymsp[-2].minor.yy394);}
175078 break;
175079 case 40: /* ccons ::= UNIQUE onconf */
175080 {sqlite3CreateIndex(pParse,0,0,0,0,yymsp[0].minor.yy394,0,0,0,0,
175081 SQLITE_IDXTYPE_UNIQUE);}
175082 break;
175083 case 41: /* ccons ::= CHECK LP expr RP */
175084 {sqlite3AddCheckConstraint(pParse,yymsp[-1].minor.yy528,yymsp[-2].minor.yy0.z,yymsp[0].minor.yy0.z);}
175085 break;
175086 case 42: /* ccons ::= REFERENCES nm eidlist_opt refargs */
175087 {sqlite3CreateForeignKey(pParse,0,&yymsp[-2].minor.yy0,yymsp[-1].minor.yy322,yymsp[0].minor.yy394);}
175088 break;
175089 case 43: /* ccons ::= defer_subclause */
175090 {sqlite3DeferForeignKey(pParse,yymsp[0].minor.yy394);}
175091 break;
175092 case 44: /* ccons ::= COLLATE ID|STRING */
175093 {sqlite3AddCollateType(pParse, &yymsp[0].minor.yy0);}
175094 break;
175095 case 45: /* generated ::= LP expr RP */
175096 {sqlite3AddGenerated(pParse,yymsp[-1].minor.yy528,0);}
175097 break;
175098 case 46: /* generated ::= LP expr RP ID */
175099 {sqlite3AddGenerated(pParse,yymsp[-2].minor.yy528,&yymsp[0].minor.yy0);}
175100 break;
175101 case 48: /* autoinc ::= AUTOINCR */
175102 {yymsp[0].minor.yy394 = 1;}
175103 break;
175104 case 49: /* refargs ::= */
175105 { yymsp[1].minor.yy394 = OE_None*0x0101; /* EV: R-19803-45884 */}
175106 break;
175107 case 50: /* refargs ::= refargs refarg */
175108 { yymsp[-1].minor.yy394 = (yymsp[-1].minor.yy394 & ~yymsp[0].minor.yy231.mask) | yymsp[0].minor.yy231.value; }
175109 break;
175110 case 51: /* refarg ::= MATCH nm */
175111 { yymsp[-1].minor.yy231.value = 0; yymsp[-1].minor.yy231.mask = 0x000000; }
175112 break;
175113 case 52: /* refarg ::= ON INSERT refact */
175114 { yymsp[-2].minor.yy231.value = 0; yymsp[-2].minor.yy231.mask = 0x000000; }
175115 break;
175116 case 53: /* refarg ::= ON DELETE refact */
175117 { yymsp[-2].minor.yy231.value = yymsp[0].minor.yy394; yymsp[-2].minor.yy231.mask = 0x0000ff; }
175118 break;
175119 case 54: /* refarg ::= ON UPDATE refact */
175120 { yymsp[-2].minor.yy231.value = yymsp[0].minor.yy394<<8; yymsp[-2].minor.yy231.mask = 0x00ff00; }
175121 break;
175122 case 55: /* refact ::= SET NULL */
175123 { yymsp[-1].minor.yy394 = OE_SetNull; /* EV: R-33326-45252 */}
175124 break;
175125 case 56: /* refact ::= SET DEFAULT */
175126 { yymsp[-1].minor.yy394 = OE_SetDflt; /* EV: R-33326-45252 */}
175127 break;
175128 case 57: /* refact ::= CASCADE */
175129 { yymsp[0].minor.yy394 = OE_Cascade; /* EV: R-33326-45252 */}
175130 break;
175131 case 58: /* refact ::= RESTRICT */
175132 { yymsp[0].minor.yy394 = OE_Restrict; /* EV: R-33326-45252 */}
175133 break;
175134 case 59: /* refact ::= NO ACTION */
175135 { yymsp[-1].minor.yy394 = OE_None; /* EV: R-33326-45252 */}
175136 break;
175137 case 60: /* defer_subclause ::= NOT DEFERRABLE init_deferred_pred_opt */
175138 {yymsp[-2].minor.yy394 = 0;}
175139 break;
175140 case 61: /* defer_subclause ::= DEFERRABLE init_deferred_pred_opt */
175141 case 76: /* orconf ::= OR resolvetype */ yytestcase(yyruleno==76);
175142 case 171: /* insert_cmd ::= INSERT orconf */ yytestcase(yyruleno==171);
175143 {yymsp[-1].minor.yy394 = yymsp[0].minor.yy394;}
175144 break;
175145 case 63: /* init_deferred_pred_opt ::= INITIALLY DEFERRED */
175146 case 80: /* ifexists ::= IF EXISTS */ yytestcase(yyruleno==80);
175147 case 217: /* between_op ::= NOT BETWEEN */ yytestcase(yyruleno==217);
175148 case 220: /* in_op ::= NOT IN */ yytestcase(yyruleno==220);
175149 case 245: /* collate ::= COLLATE ID|STRING */ yytestcase(yyruleno==245);
175150 {yymsp[-1].minor.yy394 = 1;}
175151 break;
175152 case 64: /* init_deferred_pred_opt ::= INITIALLY IMMEDIATE */
175153 {yymsp[-1].minor.yy394 = 0;}
175154 break;
175155 case 66: /* tconscomma ::= COMMA */
175156 {pParse->constraintName.n = 0;}
175157 break;
175158 case 68: /* tcons ::= PRIMARY KEY LP sortlist autoinc RP onconf */
175159 {sqlite3AddPrimaryKey(pParse,yymsp[-3].minor.yy322,yymsp[0].minor.yy394,yymsp[-2].minor.yy394,0);}
175160 break;
175161 case 69: /* tcons ::= UNIQUE LP sortlist RP onconf */
175162 {sqlite3CreateIndex(pParse,0,0,0,yymsp[-2].minor.yy322,yymsp[0].minor.yy394,0,0,0,0,
175163 SQLITE_IDXTYPE_UNIQUE);}
175164 break;
175165 case 70: /* tcons ::= CHECK LP expr RP onconf */
175166 {sqlite3AddCheckConstraint(pParse,yymsp[-2].minor.yy528,yymsp[-3].minor.yy0.z,yymsp[-1].minor.yy0.z);}
175167 break;
175168 case 71: /* tcons ::= FOREIGN KEY LP eidlist RP REFERENCES nm eidlist_opt refargs defer_subclause_opt */
175169 {
175170 sqlite3CreateForeignKey(pParse, yymsp[-6].minor.yy322, &yymsp[-3].minor.yy0, yymsp[-2].minor.yy322, yymsp[-1].minor.yy394);
175171 sqlite3DeferForeignKey(pParse, yymsp[0].minor.yy394);
175172 }
175173 break;
175174 case 73: /* onconf ::= */
175175 case 75: /* orconf ::= */ yytestcase(yyruleno==75);
175176 {yymsp[1].minor.yy394 = OE_Default;}
175177 break;
175178 case 74: /* onconf ::= ON CONFLICT resolvetype */
175179 {yymsp[-2].minor.yy394 = yymsp[0].minor.yy394;}
175180 break;
175181 case 77: /* resolvetype ::= IGNORE */
175182 {yymsp[0].minor.yy394 = OE_Ignore;}
175183 break;
175184 case 78: /* resolvetype ::= REPLACE */
175185 case 172: /* insert_cmd ::= REPLACE */ yytestcase(yyruleno==172);
175186 {yymsp[0].minor.yy394 = OE_Replace;}
175187 break;
175188 case 79: /* cmd ::= DROP TABLE ifexists fullname */
175189 {
175190 sqlite3DropTable(pParse, yymsp[0].minor.yy131, 0, yymsp[-1].minor.yy394);
175191 }
175192 break;
175193 case 82: /* cmd ::= createkw temp VIEW ifnotexists nm dbnm eidlist_opt AS select */
175194 {
175195 sqlite3CreateView(pParse, &yymsp[-8].minor.yy0, &yymsp[-4].minor.yy0, &yymsp[-3].minor.yy0, yymsp[-2].minor.yy322, yymsp[0].minor.yy47, yymsp[-7].minor.yy394, yymsp[-5].minor.yy394);
175196 }
175197 break;
175198 case 83: /* cmd ::= DROP VIEW ifexists fullname */
175199 {
175200 sqlite3DropTable(pParse, yymsp[0].minor.yy131, 1, yymsp[-1].minor.yy394);
175201 }
175202 break;
175203 case 84: /* cmd ::= select */
175204 {
175205 SelectDest dest = {SRT_Output, 0, 0, 0, 0, 0, 0};
175206 sqlite3Select(pParse, yymsp[0].minor.yy47, &dest);
175207 sqlite3SelectDelete(pParse->db, yymsp[0].minor.yy47);
175208 }
175209 break;
175210 case 85: /* select ::= WITH wqlist selectnowith */
175211 {yymsp[-2].minor.yy47 = attachWithToSelect(pParse,yymsp[0].minor.yy47,yymsp[-1].minor.yy521);}
175212 break;
175213 case 86: /* select ::= WITH RECURSIVE wqlist selectnowith */
175214 {yymsp[-3].minor.yy47 = attachWithToSelect(pParse,yymsp[0].minor.yy47,yymsp[-1].minor.yy521);}
175215 break;
175216 case 87: /* select ::= selectnowith */
175217 {
175218 Select *p = yymsp[0].minor.yy47;
175219 if( p ){
175220 parserDoubleLinkSelect(pParse, p);
175221 }
175222 }
175223 break;
175224 case 88: /* selectnowith ::= selectnowith multiselect_op oneselect */
175225 {
175226 Select *pRhs = yymsp[0].minor.yy47;
175227 Select *pLhs = yymsp[-2].minor.yy47;
175228 if( pRhs && pRhs->pPrior ){
175229 SrcList *pFrom;
175230 Token x;
175231 x.n = 0;
175232 parserDoubleLinkSelect(pParse, pRhs);
175233 pFrom = sqlite3SrcListAppendFromTerm(pParse,0,0,0,&x,pRhs,0);
175234 pRhs = sqlite3SelectNew(pParse,0,pFrom,0,0,0,0,0,0);
175235 }
175236 if( pRhs ){
175237 pRhs->op = (u8)yymsp[-1].minor.yy394;
175238 pRhs->pPrior = pLhs;
175239 if( ALWAYS(pLhs) ) pLhs->selFlags &= ~SF_MultiValue;
175240 pRhs->selFlags &= ~SF_MultiValue;
175241 if( yymsp[-1].minor.yy394!=TK_ALL ) pParse->hasCompound = 1;
175242 }else{
175243 sqlite3SelectDelete(pParse->db, pLhs);
175244 }
175245 yymsp[-2].minor.yy47 = pRhs;
175246 }
175247 break;
175248 case 89: /* multiselect_op ::= UNION */
175249 case 91: /* multiselect_op ::= EXCEPT|INTERSECT */ yytestcase(yyruleno==91);
175250 {yymsp[0].minor.yy394 = yymsp[0].major; /*A-overwrites-OP*/}
175251 break;
175252 case 90: /* multiselect_op ::= UNION ALL */
175253 {yymsp[-1].minor.yy394 = TK_ALL;}
175254 break;
175255 case 92: /* oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt orderby_opt limit_opt */
175256 {
175257 yymsp[-8].minor.yy47 = sqlite3SelectNew(pParse,yymsp[-6].minor.yy322,yymsp[-5].minor.yy131,yymsp[-4].minor.yy528,yymsp[-3].minor.yy322,yymsp[-2].minor.yy528,yymsp[-1].minor.yy322,yymsp[-7].minor.yy394,yymsp[0].minor.yy528);
175258 }
175259 break;
175260 case 93: /* oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt window_clause orderby_opt limit_opt */
175261 {
175262 yymsp[-9].minor.yy47 = sqlite3SelectNew(pParse,yymsp[-7].minor.yy322,yymsp[-6].minor.yy131,yymsp[-5].minor.yy528,yymsp[-4].minor.yy322,yymsp[-3].minor.yy528,yymsp[-1].minor.yy322,yymsp[-8].minor.yy394,yymsp[0].minor.yy528);
175263 if( yymsp[-9].minor.yy47 ){
175264 yymsp[-9].minor.yy47->pWinDefn = yymsp[-2].minor.yy41;
175265 }else{
175266 sqlite3WindowListDelete(pParse->db, yymsp[-2].minor.yy41);
175267 }
175268 }
175269 break;
175270 case 94: /* values ::= VALUES LP nexprlist RP */
175271 {
175272 yymsp[-3].minor.yy47 = sqlite3SelectNew(pParse,yymsp[-1].minor.yy322,0,0,0,0,0,SF_Values,0);
175273 }
175274 break;
175275 case 95: /* values ::= values COMMA LP nexprlist RP */
175276 {
175277 Select *pRight, *pLeft = yymsp[-4].minor.yy47;
175278 pRight = sqlite3SelectNew(pParse,yymsp[-1].minor.yy322,0,0,0,0,0,SF_Values|SF_MultiValue,0);
175279 if( ALWAYS(pLeft) ) pLeft->selFlags &= ~SF_MultiValue;
175280 if( pRight ){
175281 pRight->op = TK_ALL;
175282 pRight->pPrior = pLeft;
175283 yymsp[-4].minor.yy47 = pRight;
175284 }else{
175285 yymsp[-4].minor.yy47 = pLeft;
175286 }
175287 }
175288 break;
175289 case 96: /* distinct ::= DISTINCT */
175290 {yymsp[0].minor.yy394 = SF_Distinct;}
175291 break;
175292 case 97: /* distinct ::= ALL */
175293 {yymsp[0].minor.yy394 = SF_All;}
175294 break;
175295 case 99: /* sclp ::= */
175296 case 132: /* orderby_opt ::= */ yytestcase(yyruleno==132);
175297 case 142: /* groupby_opt ::= */ yytestcase(yyruleno==142);
175298 case 232: /* exprlist ::= */ yytestcase(yyruleno==232);
175299 case 235: /* paren_exprlist ::= */ yytestcase(yyruleno==235);
175300 case 240: /* eidlist_opt ::= */ yytestcase(yyruleno==240);
175301 {yymsp[1].minor.yy322 = 0;}
175302 break;
175303 case 100: /* selcollist ::= sclp scanpt expr scanpt as */
175304 {
175305 yymsp[-4].minor.yy322 = sqlite3ExprListAppend(pParse, yymsp[-4].minor.yy322, yymsp[-2].minor.yy528);
175306 if( yymsp[0].minor.yy0.n>0 ) sqlite3ExprListSetName(pParse, yymsp[-4].minor.yy322, &yymsp[0].minor.yy0, 1);
175307 sqlite3ExprListSetSpan(pParse,yymsp[-4].minor.yy322,yymsp[-3].minor.yy522,yymsp[-1].minor.yy522);
175308 }
175309 break;
175310 case 101: /* selcollist ::= sclp scanpt STAR */
175311 {
175312 Expr *p = sqlite3Expr(pParse->db, TK_ASTERISK, 0);
175313 sqlite3ExprSetErrorOffset(p, (int)(yymsp[0].minor.yy0.z - pParse->zTail));
175314 yymsp[-2].minor.yy322 = sqlite3ExprListAppend(pParse, yymsp[-2].minor.yy322, p);
175315 }
175316 break;
175317 case 102: /* selcollist ::= sclp scanpt nm DOT STAR */
175318 {
175319 Expr *pRight, *pLeft, *pDot;
175320 pRight = sqlite3PExpr(pParse, TK_ASTERISK, 0, 0);
175321 sqlite3ExprSetErrorOffset(pRight, (int)(yymsp[0].minor.yy0.z - pParse->zTail));
175322 pLeft = tokenExpr(pParse, TK_ID, yymsp[-2].minor.yy0);
175323 pDot = sqlite3PExpr(pParse, TK_DOT, pLeft, pRight);
175324 yymsp[-4].minor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy322, pDot);
175325 }
175326 break;
175327 case 103: /* as ::= AS nm */
175328 case 115: /* dbnm ::= DOT nm */ yytestcase(yyruleno==115);
175329 case 256: /* plus_num ::= PLUS INTEGER|FLOAT */ yytestcase(yyruleno==256);
@@ -175330,54 +175618,54 @@
175330 case 257: /* minus_num ::= MINUS INTEGER|FLOAT */ yytestcase(yyruleno==257);
175331 {yymsp[-1].minor.yy0 = yymsp[0].minor.yy0;}
175332 break;
175333 case 105: /* from ::= */
175334 case 108: /* stl_prefix ::= */ yytestcase(yyruleno==108);
175335 {yymsp[1].minor.yy131 = 0;}
175336 break;
175337 case 106: /* from ::= FROM seltablist */
175338 {
175339 yymsp[-1].minor.yy131 = yymsp[0].minor.yy131;
175340 sqlite3SrcListShiftJoinType(pParse,yymsp[-1].minor.yy131);
175341 }
175342 break;
175343 case 107: /* stl_prefix ::= seltablist joinop */
175344 {
175345 if( ALWAYS(yymsp[-1].minor.yy131 && yymsp[-1].minor.yy131->nSrc>0) ) yymsp[-1].minor.yy131->a[yymsp[-1].minor.yy131->nSrc-1].fg.jointype = (u8)yymsp[0].minor.yy394;
175346 }
175347 break;
175348 case 109: /* seltablist ::= stl_prefix nm dbnm as on_using */
175349 {
175350 yymsp[-4].minor.yy131 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-4].minor.yy131,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0,0,&yymsp[0].minor.yy561);
175351 }
175352 break;
175353 case 110: /* seltablist ::= stl_prefix nm dbnm as indexed_by on_using */
175354 {
175355 yymsp[-5].minor.yy131 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-5].minor.yy131,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,0,&yymsp[0].minor.yy561);
175356 sqlite3SrcListIndexedBy(pParse, yymsp[-5].minor.yy131, &yymsp[-1].minor.yy0);
175357 }
175358 break;
175359 case 111: /* seltablist ::= stl_prefix nm dbnm LP exprlist RP as on_using */
175360 {
175361 yymsp[-7].minor.yy131 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-7].minor.yy131,&yymsp[-6].minor.yy0,&yymsp[-5].minor.yy0,&yymsp[-1].minor.yy0,0,&yymsp[0].minor.yy561);
175362 sqlite3SrcListFuncArgs(pParse, yymsp[-7].minor.yy131, yymsp[-3].minor.yy322);
175363 }
175364 break;
175365 case 112: /* seltablist ::= stl_prefix LP select RP as on_using */
175366 {
175367 yymsp[-5].minor.yy131 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-5].minor.yy131,0,0,&yymsp[-1].minor.yy0,yymsp[-3].minor.yy47,&yymsp[0].minor.yy561);
175368 }
175369 break;
175370 case 113: /* seltablist ::= stl_prefix LP seltablist RP as on_using */
175371 {
175372 if( yymsp[-5].minor.yy131==0 && yymsp[-1].minor.yy0.n==0 && yymsp[0].minor.yy561.pOn==0 && yymsp[0].minor.yy561.pUsing==0 ){
175373 yymsp[-5].minor.yy131 = yymsp[-3].minor.yy131;
175374 }else if( ALWAYS(yymsp[-3].minor.yy131!=0) && yymsp[-3].minor.yy131->nSrc==1 ){
175375 yymsp[-5].minor.yy131 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-5].minor.yy131,0,0,&yymsp[-1].minor.yy0,0,&yymsp[0].minor.yy561);
175376 if( yymsp[-5].minor.yy131 ){
175377 SrcItem *pNew = &yymsp[-5].minor.yy131->a[yymsp[-5].minor.yy131->nSrc-1];
175378 SrcItem *pOld = yymsp[-3].minor.yy131->a;
175379 pNew->zName = pOld->zName;
175380 pNew->zDatabase = pOld->zDatabase;
175381 pNew->pSelect = pOld->pSelect;
175382 if( pNew->pSelect && (pNew->pSelect->selFlags & SF_NestedFrom)!=0 ){
175383 pNew->fg.isNestedFrom = 1;
@@ -175389,249 +175677,249 @@
175389 pNew->fg.isTabFunc = 1;
175390 }
175391 pOld->zName = pOld->zDatabase = 0;
175392 pOld->pSelect = 0;
175393 }
175394 sqlite3SrcListDelete(pParse->db, yymsp[-3].minor.yy131);
175395 }else{
175396 Select *pSubquery;
175397 sqlite3SrcListShiftJoinType(pParse,yymsp[-3].minor.yy131);
175398 pSubquery = sqlite3SelectNew(pParse,0,yymsp[-3].minor.yy131,0,0,0,0,SF_NestedFrom,0);
175399 yymsp[-5].minor.yy131 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-5].minor.yy131,0,0,&yymsp[-1].minor.yy0,pSubquery,&yymsp[0].minor.yy561);
175400 }
175401 }
175402 break;
175403 case 114: /* dbnm ::= */
175404 case 129: /* indexed_opt ::= */ yytestcase(yyruleno==129);
175405 {yymsp[1].minor.yy0.z=0; yymsp[1].minor.yy0.n=0;}
175406 break;
175407 case 116: /* fullname ::= nm */
175408 {
175409 yylhsminor.yy131 = sqlite3SrcListAppend(pParse,0,&yymsp[0].minor.yy0,0);
175410 if( IN_RENAME_OBJECT && yylhsminor.yy131 ) sqlite3RenameTokenMap(pParse, yylhsminor.yy131->a[0].zName, &yymsp[0].minor.yy0);
175411 }
175412 yymsp[0].minor.yy131 = yylhsminor.yy131;
175413 break;
175414 case 117: /* fullname ::= nm DOT nm */
175415 {
175416 yylhsminor.yy131 = sqlite3SrcListAppend(pParse,0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0);
175417 if( IN_RENAME_OBJECT && yylhsminor.yy131 ) sqlite3RenameTokenMap(pParse, yylhsminor.yy131->a[0].zName, &yymsp[0].minor.yy0);
175418 }
175419 yymsp[-2].minor.yy131 = yylhsminor.yy131;
175420 break;
175421 case 118: /* xfullname ::= nm */
175422 {yymsp[0].minor.yy131 = sqlite3SrcListAppend(pParse,0,&yymsp[0].minor.yy0,0); /*A-overwrites-X*/}
175423 break;
175424 case 119: /* xfullname ::= nm DOT nm */
175425 {yymsp[-2].minor.yy131 = sqlite3SrcListAppend(pParse,0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0); /*A-overwrites-X*/}
175426 break;
175427 case 120: /* xfullname ::= nm DOT nm AS nm */
175428 {
175429 yymsp[-4].minor.yy131 = sqlite3SrcListAppend(pParse,0,&yymsp[-4].minor.yy0,&yymsp[-2].minor.yy0); /*A-overwrites-X*/
175430 if( yymsp[-4].minor.yy131 ) yymsp[-4].minor.yy131->a[0].zAlias = sqlite3NameFromToken(pParse->db, &yymsp[0].minor.yy0);
175431 }
175432 break;
175433 case 121: /* xfullname ::= nm AS nm */
175434 {
175435 yymsp[-2].minor.yy131 = sqlite3SrcListAppend(pParse,0,&yymsp[-2].minor.yy0,0); /*A-overwrites-X*/
175436 if( yymsp[-2].minor.yy131 ) yymsp[-2].minor.yy131->a[0].zAlias = sqlite3NameFromToken(pParse->db, &yymsp[0].minor.yy0);
175437 }
175438 break;
175439 case 122: /* joinop ::= COMMA|JOIN */
175440 { yymsp[0].minor.yy394 = JT_INNER; }
175441 break;
175442 case 123: /* joinop ::= JOIN_KW JOIN */
175443 {yymsp[-1].minor.yy394 = sqlite3JoinType(pParse,&yymsp[-1].minor.yy0,0,0); /*X-overwrites-A*/}
175444 break;
175445 case 124: /* joinop ::= JOIN_KW nm JOIN */
175446 {yymsp[-2].minor.yy394 = sqlite3JoinType(pParse,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0,0); /*X-overwrites-A*/}
175447 break;
175448 case 125: /* joinop ::= JOIN_KW nm nm JOIN */
175449 {yymsp[-3].minor.yy394 = sqlite3JoinType(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0);/*X-overwrites-A*/}
175450 break;
175451 case 126: /* on_using ::= ON expr */
175452 {yymsp[-1].minor.yy561.pOn = yymsp[0].minor.yy528; yymsp[-1].minor.yy561.pUsing = 0;}
175453 break;
175454 case 127: /* on_using ::= USING LP idlist RP */
175455 {yymsp[-3].minor.yy561.pOn = 0; yymsp[-3].minor.yy561.pUsing = yymsp[-1].minor.yy254;}
175456 break;
175457 case 128: /* on_using ::= */
175458 {yymsp[1].minor.yy561.pOn = 0; yymsp[1].minor.yy561.pUsing = 0;}
175459 break;
175460 case 130: /* indexed_by ::= INDEXED BY nm */
175461 {yymsp[-2].minor.yy0 = yymsp[0].minor.yy0;}
175462 break;
175463 case 131: /* indexed_by ::= NOT INDEXED */
175464 {yymsp[-1].minor.yy0.z=0; yymsp[-1].minor.yy0.n=1;}
175465 break;
175466 case 133: /* orderby_opt ::= ORDER BY sortlist */
175467 case 143: /* groupby_opt ::= GROUP BY nexprlist */ yytestcase(yyruleno==143);
175468 {yymsp[-2].minor.yy322 = yymsp[0].minor.yy322;}
175469 break;
175470 case 134: /* sortlist ::= sortlist COMMA expr sortorder nulls */
175471 {
175472 yymsp[-4].minor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy322,yymsp[-2].minor.yy528);
175473 sqlite3ExprListSetSortOrder(yymsp[-4].minor.yy322,yymsp[-1].minor.yy394,yymsp[0].minor.yy394);
175474 }
175475 break;
175476 case 135: /* sortlist ::= expr sortorder nulls */
175477 {
175478 yymsp[-2].minor.yy322 = sqlite3ExprListAppend(pParse,0,yymsp[-2].minor.yy528); /*A-overwrites-Y*/
175479 sqlite3ExprListSetSortOrder(yymsp[-2].minor.yy322,yymsp[-1].minor.yy394,yymsp[0].minor.yy394);
175480 }
175481 break;
175482 case 136: /* sortorder ::= ASC */
175483 {yymsp[0].minor.yy394 = SQLITE_SO_ASC;}
175484 break;
175485 case 137: /* sortorder ::= DESC */
175486 {yymsp[0].minor.yy394 = SQLITE_SO_DESC;}
175487 break;
175488 case 138: /* sortorder ::= */
175489 case 141: /* nulls ::= */ yytestcase(yyruleno==141);
175490 {yymsp[1].minor.yy394 = SQLITE_SO_UNDEFINED;}
175491 break;
175492 case 139: /* nulls ::= NULLS FIRST */
175493 {yymsp[-1].minor.yy394 = SQLITE_SO_ASC;}
175494 break;
175495 case 140: /* nulls ::= NULLS LAST */
175496 {yymsp[-1].minor.yy394 = SQLITE_SO_DESC;}
175497 break;
175498 case 144: /* having_opt ::= */
175499 case 146: /* limit_opt ::= */ yytestcase(yyruleno==146);
175500 case 151: /* where_opt ::= */ yytestcase(yyruleno==151);
175501 case 153: /* where_opt_ret ::= */ yytestcase(yyruleno==153);
175502 case 230: /* case_else ::= */ yytestcase(yyruleno==230);
175503 case 231: /* case_operand ::= */ yytestcase(yyruleno==231);
175504 case 250: /* vinto ::= */ yytestcase(yyruleno==250);
175505 {yymsp[1].minor.yy528 = 0;}
175506 break;
175507 case 145: /* having_opt ::= HAVING expr */
175508 case 152: /* where_opt ::= WHERE expr */ yytestcase(yyruleno==152);
175509 case 154: /* where_opt_ret ::= WHERE expr */ yytestcase(yyruleno==154);
175510 case 229: /* case_else ::= ELSE expr */ yytestcase(yyruleno==229);
175511 case 249: /* vinto ::= INTO expr */ yytestcase(yyruleno==249);
175512 {yymsp[-1].minor.yy528 = yymsp[0].minor.yy528;}
175513 break;
175514 case 147: /* limit_opt ::= LIMIT expr */
175515 {yymsp[-1].minor.yy528 = sqlite3PExpr(pParse,TK_LIMIT,yymsp[0].minor.yy528,0);}
175516 break;
175517 case 148: /* limit_opt ::= LIMIT expr OFFSET expr */
175518 {yymsp[-3].minor.yy528 = sqlite3PExpr(pParse,TK_LIMIT,yymsp[-2].minor.yy528,yymsp[0].minor.yy528);}
175519 break;
175520 case 149: /* limit_opt ::= LIMIT expr COMMA expr */
175521 {yymsp[-3].minor.yy528 = sqlite3PExpr(pParse,TK_LIMIT,yymsp[0].minor.yy528,yymsp[-2].minor.yy528);}
175522 break;
175523 case 150: /* cmd ::= with DELETE FROM xfullname indexed_opt where_opt_ret */
175524 {
175525 sqlite3SrcListIndexedBy(pParse, yymsp[-2].minor.yy131, &yymsp[-1].minor.yy0);
175526 sqlite3DeleteFrom(pParse,yymsp[-2].minor.yy131,yymsp[0].minor.yy528,0,0);
175527 }
175528 break;
175529 case 155: /* where_opt_ret ::= RETURNING selcollist */
175530 {sqlite3AddReturning(pParse,yymsp[0].minor.yy322); yymsp[-1].minor.yy528 = 0;}
175531 break;
175532 case 156: /* where_opt_ret ::= WHERE expr RETURNING selcollist */
175533 {sqlite3AddReturning(pParse,yymsp[0].minor.yy322); yymsp[-3].minor.yy528 = yymsp[-2].minor.yy528;}
175534 break;
175535 case 157: /* cmd ::= with UPDATE orconf xfullname indexed_opt SET setlist from where_opt_ret */
175536 {
175537 sqlite3SrcListIndexedBy(pParse, yymsp[-5].minor.yy131, &yymsp[-4].minor.yy0);
175538 sqlite3ExprListCheckLength(pParse,yymsp[-2].minor.yy322,"set list");
175539 if( yymsp[-1].minor.yy131 ){
175540 SrcList *pFromClause = yymsp[-1].minor.yy131;
175541 if( pFromClause->nSrc>1 ){
175542 Select *pSubquery;
175543 Token as;
175544 pSubquery = sqlite3SelectNew(pParse,0,pFromClause,0,0,0,0,SF_NestedFrom,0);
175545 as.n = 0;
175546 as.z = 0;
175547 pFromClause = sqlite3SrcListAppendFromTerm(pParse,0,0,0,&as,pSubquery,0);
175548 }
175549 yymsp[-5].minor.yy131 = sqlite3SrcListAppendList(pParse, yymsp[-5].minor.yy131, pFromClause);
175550 }
175551 sqlite3Update(pParse,yymsp[-5].minor.yy131,yymsp[-2].minor.yy322,yymsp[0].minor.yy528,yymsp[-6].minor.yy394,0,0,0);
175552 }
175553 break;
175554 case 158: /* setlist ::= setlist COMMA nm EQ expr */
175555 {
175556 yymsp[-4].minor.yy322 = sqlite3ExprListAppend(pParse, yymsp[-4].minor.yy322, yymsp[0].minor.yy528);
175557 sqlite3ExprListSetName(pParse, yymsp[-4].minor.yy322, &yymsp[-2].minor.yy0, 1);
175558 }
175559 break;
175560 case 159: /* setlist ::= setlist COMMA LP idlist RP EQ expr */
175561 {
175562 yymsp[-6].minor.yy322 = sqlite3ExprListAppendVector(pParse, yymsp[-6].minor.yy322, yymsp[-3].minor.yy254, yymsp[0].minor.yy528);
175563 }
175564 break;
175565 case 160: /* setlist ::= nm EQ expr */
175566 {
175567 yylhsminor.yy322 = sqlite3ExprListAppend(pParse, 0, yymsp[0].minor.yy528);
175568 sqlite3ExprListSetName(pParse, yylhsminor.yy322, &yymsp[-2].minor.yy0, 1);
175569 }
175570 yymsp[-2].minor.yy322 = yylhsminor.yy322;
175571 break;
175572 case 161: /* setlist ::= LP idlist RP EQ expr */
175573 {
175574 yymsp[-4].minor.yy322 = sqlite3ExprListAppendVector(pParse, 0, yymsp[-3].minor.yy254, yymsp[0].minor.yy528);
175575 }
175576 break;
175577 case 162: /* cmd ::= with insert_cmd INTO xfullname idlist_opt select upsert */
175578 {
175579 sqlite3Insert(pParse, yymsp[-3].minor.yy131, yymsp[-1].minor.yy47, yymsp[-2].minor.yy254, yymsp[-5].minor.yy394, yymsp[0].minor.yy444);
175580 }
175581 break;
175582 case 163: /* cmd ::= with insert_cmd INTO xfullname idlist_opt DEFAULT VALUES returning */
175583 {
175584 sqlite3Insert(pParse, yymsp[-4].minor.yy131, 0, yymsp[-3].minor.yy254, yymsp[-6].minor.yy394, 0);
175585 }
175586 break;
175587 case 164: /* upsert ::= */
175588 { yymsp[1].minor.yy444 = 0; }
175589 break;
175590 case 165: /* upsert ::= RETURNING selcollist */
175591 { yymsp[-1].minor.yy444 = 0; sqlite3AddReturning(pParse,yymsp[0].minor.yy322); }
175592 break;
175593 case 166: /* upsert ::= ON CONFLICT LP sortlist RP where_opt DO UPDATE SET setlist where_opt upsert */
175594 { yymsp[-11].minor.yy444 = sqlite3UpsertNew(pParse->db,yymsp[-8].minor.yy322,yymsp[-6].minor.yy528,yymsp[-2].minor.yy322,yymsp[-1].minor.yy528,yymsp[0].minor.yy444);}
175595 break;
175596 case 167: /* upsert ::= ON CONFLICT LP sortlist RP where_opt DO NOTHING upsert */
175597 { yymsp[-8].minor.yy444 = sqlite3UpsertNew(pParse->db,yymsp[-5].minor.yy322,yymsp[-3].minor.yy528,0,0,yymsp[0].minor.yy444); }
175598 break;
175599 case 168: /* upsert ::= ON CONFLICT DO NOTHING returning */
175600 { yymsp[-4].minor.yy444 = sqlite3UpsertNew(pParse->db,0,0,0,0,0); }
175601 break;
175602 case 169: /* upsert ::= ON CONFLICT DO UPDATE SET setlist where_opt returning */
175603 { yymsp[-7].minor.yy444 = sqlite3UpsertNew(pParse->db,0,0,yymsp[-2].minor.yy322,yymsp[-1].minor.yy528,0);}
175604 break;
175605 case 170: /* returning ::= RETURNING selcollist */
175606 {sqlite3AddReturning(pParse,yymsp[0].minor.yy322);}
175607 break;
175608 case 173: /* idlist_opt ::= */
175609 {yymsp[1].minor.yy254 = 0;}
175610 break;
175611 case 174: /* idlist_opt ::= LP idlist RP */
175612 {yymsp[-2].minor.yy254 = yymsp[-1].minor.yy254;}
175613 break;
175614 case 175: /* idlist ::= idlist COMMA nm */
175615 {yymsp[-2].minor.yy254 = sqlite3IdListAppend(pParse,yymsp[-2].minor.yy254,&yymsp[0].minor.yy0);}
175616 break;
175617 case 176: /* idlist ::= nm */
175618 {yymsp[0].minor.yy254 = sqlite3IdListAppend(pParse,0,&yymsp[0].minor.yy0); /*A-overwrites-Y*/}
175619 break;
175620 case 177: /* expr ::= LP expr RP */
175621 {yymsp[-2].minor.yy528 = yymsp[-1].minor.yy528;}
175622 break;
175623 case 178: /* expr ::= ID|INDEXED|JOIN_KW */
175624 {yymsp[0].minor.yy528=tokenExpr(pParse,TK_ID,yymsp[0].minor.yy0); /*A-overwrites-X*/}
175625 break;
175626 case 179: /* expr ::= nm DOT nm */
175627 {
175628 Expr *temp1 = tokenExpr(pParse,TK_ID,yymsp[-2].minor.yy0);
175629 Expr *temp2 = tokenExpr(pParse,TK_ID,yymsp[0].minor.yy0);
175630 yylhsminor.yy528 = sqlite3PExpr(pParse, TK_DOT, temp1, temp2);
175631 }
175632 yymsp[-2].minor.yy528 = yylhsminor.yy528;
175633 break;
175634 case 180: /* expr ::= nm DOT nm DOT nm */
175635 {
175636 Expr *temp1 = tokenExpr(pParse,TK_ID,yymsp[-4].minor.yy0);
175637 Expr *temp2 = tokenExpr(pParse,TK_ID,yymsp[-2].minor.yy0);
@@ -175638,369 +175926,369 @@
175638 Expr *temp3 = tokenExpr(pParse,TK_ID,yymsp[0].minor.yy0);
175639 Expr *temp4 = sqlite3PExpr(pParse, TK_DOT, temp2, temp3);
175640 if( IN_RENAME_OBJECT ){
175641 sqlite3RenameTokenRemap(pParse, 0, temp1);
175642 }
175643 yylhsminor.yy528 = sqlite3PExpr(pParse, TK_DOT, temp1, temp4);
175644 }
175645 yymsp[-4].minor.yy528 = yylhsminor.yy528;
175646 break;
175647 case 181: /* term ::= NULL|FLOAT|BLOB */
175648 case 182: /* term ::= STRING */ yytestcase(yyruleno==182);
175649 {yymsp[0].minor.yy528=tokenExpr(pParse,yymsp[0].major,yymsp[0].minor.yy0); /*A-overwrites-X*/}
175650 break;
175651 case 183: /* term ::= INTEGER */
175652 {
175653 yylhsminor.yy528 = sqlite3ExprAlloc(pParse->db, TK_INTEGER, &yymsp[0].minor.yy0, 1);
175654 if( yylhsminor.yy528 ) yylhsminor.yy528->w.iOfst = (int)(yymsp[0].minor.yy0.z - pParse->zTail);
175655 }
175656 yymsp[0].minor.yy528 = yylhsminor.yy528;
175657 break;
175658 case 184: /* expr ::= VARIABLE */
175659 {
175660 if( !(yymsp[0].minor.yy0.z[0]=='#' && sqlite3Isdigit(yymsp[0].minor.yy0.z[1])) ){
175661 u32 n = yymsp[0].minor.yy0.n;
175662 yymsp[0].minor.yy528 = tokenExpr(pParse, TK_VARIABLE, yymsp[0].minor.yy0);
175663 sqlite3ExprAssignVarNumber(pParse, yymsp[0].minor.yy528, n);
175664 }else{
175665 /* When doing a nested parse, one can include terms in an expression
175666 ** that look like this: #1 #2 ... These terms refer to registers
175667 ** in the virtual machine. #N is the N-th register. */
175668 Token t = yymsp[0].minor.yy0; /*A-overwrites-X*/
175669 assert( t.n>=2 );
175670 if( pParse->nested==0 ){
175671 sqlite3ErrorMsg(pParse, "near \"%T\": syntax error", &t);
175672 yymsp[0].minor.yy528 = 0;
175673 }else{
175674 yymsp[0].minor.yy528 = sqlite3PExpr(pParse, TK_REGISTER, 0, 0);
175675 if( yymsp[0].minor.yy528 ) sqlite3GetInt32(&t.z[1], &yymsp[0].minor.yy528->iTable);
175676 }
175677 }
175678 }
175679 break;
175680 case 185: /* expr ::= expr COLLATE ID|STRING */
175681 {
175682 yymsp[-2].minor.yy528 = sqlite3ExprAddCollateToken(pParse, yymsp[-2].minor.yy528, &yymsp[0].minor.yy0, 1);
175683 }
175684 break;
175685 case 186: /* expr ::= CAST LP expr AS typetoken RP */
175686 {
175687 yymsp[-5].minor.yy528 = sqlite3ExprAlloc(pParse->db, TK_CAST, &yymsp[-1].minor.yy0, 1);
175688 sqlite3ExprAttachSubtrees(pParse->db, yymsp[-5].minor.yy528, yymsp[-3].minor.yy528, 0);
175689 }
175690 break;
175691 case 187: /* expr ::= ID|INDEXED|JOIN_KW LP distinct exprlist RP */
175692 {
175693 yylhsminor.yy528 = sqlite3ExprFunction(pParse, yymsp[-1].minor.yy322, &yymsp[-4].minor.yy0, yymsp[-2].minor.yy394);
175694 }
175695 yymsp[-4].minor.yy528 = yylhsminor.yy528;
175696 break;
175697 case 188: /* expr ::= ID|INDEXED|JOIN_KW LP distinct exprlist ORDER BY sortlist RP */
175698 {
175699 yylhsminor.yy528 = sqlite3ExprFunction(pParse, yymsp[-4].minor.yy322, &yymsp[-7].minor.yy0, yymsp[-5].minor.yy394);
175700 sqlite3ExprAddFunctionOrderBy(pParse, yylhsminor.yy528, yymsp[-1].minor.yy322);
175701 }
175702 yymsp[-7].minor.yy528 = yylhsminor.yy528;
175703 break;
175704 case 189: /* expr ::= ID|INDEXED|JOIN_KW LP STAR RP */
175705 {
175706 yylhsminor.yy528 = sqlite3ExprFunction(pParse, 0, &yymsp[-3].minor.yy0, 0);
175707 }
175708 yymsp[-3].minor.yy528 = yylhsminor.yy528;
175709 break;
175710 case 190: /* expr ::= ID|INDEXED|JOIN_KW LP distinct exprlist RP filter_over */
175711 {
175712 yylhsminor.yy528 = sqlite3ExprFunction(pParse, yymsp[-2].minor.yy322, &yymsp[-5].minor.yy0, yymsp[-3].minor.yy394);
175713 sqlite3WindowAttach(pParse, yylhsminor.yy528, yymsp[0].minor.yy41);
175714 }
175715 yymsp[-5].minor.yy528 = yylhsminor.yy528;
175716 break;
175717 case 191: /* expr ::= ID|INDEXED|JOIN_KW LP distinct exprlist ORDER BY sortlist RP filter_over */
175718 {
175719 yylhsminor.yy528 = sqlite3ExprFunction(pParse, yymsp[-5].minor.yy322, &yymsp[-8].minor.yy0, yymsp[-6].minor.yy394);
175720 sqlite3WindowAttach(pParse, yylhsminor.yy528, yymsp[0].minor.yy41);
175721 sqlite3ExprAddFunctionOrderBy(pParse, yylhsminor.yy528, yymsp[-2].minor.yy322);
175722 }
175723 yymsp[-8].minor.yy528 = yylhsminor.yy528;
175724 break;
175725 case 192: /* expr ::= ID|INDEXED|JOIN_KW LP STAR RP filter_over */
175726 {
175727 yylhsminor.yy528 = sqlite3ExprFunction(pParse, 0, &yymsp[-4].minor.yy0, 0);
175728 sqlite3WindowAttach(pParse, yylhsminor.yy528, yymsp[0].minor.yy41);
175729 }
175730 yymsp[-4].minor.yy528 = yylhsminor.yy528;
175731 break;
175732 case 193: /* term ::= CTIME_KW */
175733 {
175734 yylhsminor.yy528 = sqlite3ExprFunction(pParse, 0, &yymsp[0].minor.yy0, 0);
175735 }
175736 yymsp[0].minor.yy528 = yylhsminor.yy528;
175737 break;
175738 case 194: /* expr ::= LP nexprlist COMMA expr RP */
175739 {
175740 ExprList *pList = sqlite3ExprListAppend(pParse, yymsp[-3].minor.yy322, yymsp[-1].minor.yy528);
175741 yymsp[-4].minor.yy528 = sqlite3PExpr(pParse, TK_VECTOR, 0, 0);
175742 if( yymsp[-4].minor.yy528 ){
175743 yymsp[-4].minor.yy528->x.pList = pList;
175744 if( ALWAYS(pList->nExpr) ){
175745 yymsp[-4].minor.yy528->flags |= pList->a[0].pExpr->flags & EP_Propagate;
175746 }
175747 }else{
175748 sqlite3ExprListDelete(pParse->db, pList);
175749 }
175750 }
175751 break;
175752 case 195: /* expr ::= expr AND expr */
175753 {yymsp[-2].minor.yy528=sqlite3ExprAnd(pParse,yymsp[-2].minor.yy528,yymsp[0].minor.yy528);}
175754 break;
175755 case 196: /* expr ::= expr OR expr */
175756 case 197: /* expr ::= expr LT|GT|GE|LE expr */ yytestcase(yyruleno==197);
175757 case 198: /* expr ::= expr EQ|NE expr */ yytestcase(yyruleno==198);
175758 case 199: /* expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr */ yytestcase(yyruleno==199);
175759 case 200: /* expr ::= expr PLUS|MINUS expr */ yytestcase(yyruleno==200);
175760 case 201: /* expr ::= expr STAR|SLASH|REM expr */ yytestcase(yyruleno==201);
175761 case 202: /* expr ::= expr CONCAT expr */ yytestcase(yyruleno==202);
175762 {yymsp[-2].minor.yy528=sqlite3PExpr(pParse,yymsp[-1].major,yymsp[-2].minor.yy528,yymsp[0].minor.yy528);}
175763 break;
175764 case 203: /* likeop ::= NOT LIKE_KW|MATCH */
175765 {yymsp[-1].minor.yy0=yymsp[0].minor.yy0; yymsp[-1].minor.yy0.n|=0x80000000; /*yymsp[-1].minor.yy0-overwrite-yymsp[0].minor.yy0*/}
175766 break;
175767 case 204: /* expr ::= expr likeop expr */
175768 {
175769 ExprList *pList;
175770 int bNot = yymsp[-1].minor.yy0.n & 0x80000000;
175771 yymsp[-1].minor.yy0.n &= 0x7fffffff;
175772 pList = sqlite3ExprListAppend(pParse,0, yymsp[0].minor.yy528);
175773 pList = sqlite3ExprListAppend(pParse,pList, yymsp[-2].minor.yy528);
175774 yymsp[-2].minor.yy528 = sqlite3ExprFunction(pParse, pList, &yymsp[-1].minor.yy0, 0);
175775 if( bNot ) yymsp[-2].minor.yy528 = sqlite3PExpr(pParse, TK_NOT, yymsp[-2].minor.yy528, 0);
175776 if( yymsp[-2].minor.yy528 ) yymsp[-2].minor.yy528->flags |= EP_InfixFunc;
175777 }
175778 break;
175779 case 205: /* expr ::= expr likeop expr ESCAPE expr */
175780 {
175781 ExprList *pList;
175782 int bNot = yymsp[-3].minor.yy0.n & 0x80000000;
175783 yymsp[-3].minor.yy0.n &= 0x7fffffff;
175784 pList = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy528);
175785 pList = sqlite3ExprListAppend(pParse,pList, yymsp[-4].minor.yy528);
175786 pList = sqlite3ExprListAppend(pParse,pList, yymsp[0].minor.yy528);
175787 yymsp[-4].minor.yy528 = sqlite3ExprFunction(pParse, pList, &yymsp[-3].minor.yy0, 0);
175788 if( bNot ) yymsp[-4].minor.yy528 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy528, 0);
175789 if( yymsp[-4].minor.yy528 ) yymsp[-4].minor.yy528->flags |= EP_InfixFunc;
175790 }
175791 break;
175792 case 206: /* expr ::= expr ISNULL|NOTNULL */
175793 {yymsp[-1].minor.yy528 = sqlite3PExpr(pParse,yymsp[0].major,yymsp[-1].minor.yy528,0);}
175794 break;
175795 case 207: /* expr ::= expr NOT NULL */
175796 {yymsp[-2].minor.yy528 = sqlite3PExpr(pParse,TK_NOTNULL,yymsp[-2].minor.yy528,0);}
175797 break;
175798 case 208: /* expr ::= expr IS expr */
175799 {
175800 yymsp[-2].minor.yy528 = sqlite3PExpr(pParse,TK_IS,yymsp[-2].minor.yy528,yymsp[0].minor.yy528);
175801 binaryToUnaryIfNull(pParse, yymsp[0].minor.yy528, yymsp[-2].minor.yy528, TK_ISNULL);
175802 }
175803 break;
175804 case 209: /* expr ::= expr IS NOT expr */
175805 {
175806 yymsp[-3].minor.yy528 = sqlite3PExpr(pParse,TK_ISNOT,yymsp[-3].minor.yy528,yymsp[0].minor.yy528);
175807 binaryToUnaryIfNull(pParse, yymsp[0].minor.yy528, yymsp[-3].minor.yy528, TK_NOTNULL);
175808 }
175809 break;
175810 case 210: /* expr ::= expr IS NOT DISTINCT FROM expr */
175811 {
175812 yymsp[-5].minor.yy528 = sqlite3PExpr(pParse,TK_IS,yymsp[-5].minor.yy528,yymsp[0].minor.yy528);
175813 binaryToUnaryIfNull(pParse, yymsp[0].minor.yy528, yymsp[-5].minor.yy528, TK_ISNULL);
175814 }
175815 break;
175816 case 211: /* expr ::= expr IS DISTINCT FROM expr */
175817 {
175818 yymsp[-4].minor.yy528 = sqlite3PExpr(pParse,TK_ISNOT,yymsp[-4].minor.yy528,yymsp[0].minor.yy528);
175819 binaryToUnaryIfNull(pParse, yymsp[0].minor.yy528, yymsp[-4].minor.yy528, TK_NOTNULL);
175820 }
175821 break;
175822 case 212: /* expr ::= NOT expr */
175823 case 213: /* expr ::= BITNOT expr */ yytestcase(yyruleno==213);
175824 {yymsp[-1].minor.yy528 = sqlite3PExpr(pParse, yymsp[-1].major, yymsp[0].minor.yy528, 0);/*A-overwrites-B*/}
175825 break;
175826 case 214: /* expr ::= PLUS|MINUS expr */
175827 {
175828 yymsp[-1].minor.yy528 = sqlite3PExpr(pParse, yymsp[-1].major==TK_PLUS ? TK_UPLUS : TK_UMINUS, yymsp[0].minor.yy528, 0);
175829 /*A-overwrites-B*/
175830 }
175831 break;
175832 case 215: /* expr ::= expr PTR expr */
175833 {
175834 ExprList *pList = sqlite3ExprListAppend(pParse, 0, yymsp[-2].minor.yy528);
175835 pList = sqlite3ExprListAppend(pParse, pList, yymsp[0].minor.yy528);
175836 yylhsminor.yy528 = sqlite3ExprFunction(pParse, pList, &yymsp[-1].minor.yy0, 0);
175837 }
175838 yymsp[-2].minor.yy528 = yylhsminor.yy528;
175839 break;
175840 case 216: /* between_op ::= BETWEEN */
175841 case 219: /* in_op ::= IN */ yytestcase(yyruleno==219);
175842 {yymsp[0].minor.yy394 = 0;}
175843 break;
175844 case 218: /* expr ::= expr between_op expr AND expr */
175845 {
175846 ExprList *pList = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy528);
175847 pList = sqlite3ExprListAppend(pParse,pList, yymsp[0].minor.yy528);
175848 yymsp[-4].minor.yy528 = sqlite3PExpr(pParse, TK_BETWEEN, yymsp[-4].minor.yy528, 0);
175849 if( yymsp[-4].minor.yy528 ){
175850 yymsp[-4].minor.yy528->x.pList = pList;
175851 }else{
175852 sqlite3ExprListDelete(pParse->db, pList);
175853 }
175854 if( yymsp[-3].minor.yy394 ) yymsp[-4].minor.yy528 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy528, 0);
175855 }
175856 break;
175857 case 221: /* expr ::= expr in_op LP exprlist RP */
175858 {
175859 if( yymsp[-1].minor.yy322==0 ){
175860 /* Expressions of the form
175861 **
175862 ** expr1 IN ()
175863 ** expr1 NOT IN ()
175864 **
175865 ** simplify to constants 0 (false) and 1 (true), respectively,
175866 ** regardless of the value of expr1.
175867 */
175868 sqlite3ExprUnmapAndDelete(pParse, yymsp[-4].minor.yy528);
175869 yymsp[-4].minor.yy528 = sqlite3Expr(pParse->db, TK_STRING, yymsp[-3].minor.yy394 ? "true" : "false");
175870 if( yymsp[-4].minor.yy528 ) sqlite3ExprIdToTrueFalse(yymsp[-4].minor.yy528);
175871 }else{
175872 Expr *pRHS = yymsp[-1].minor.yy322->a[0].pExpr;
175873 if( yymsp[-1].minor.yy322->nExpr==1 && sqlite3ExprIsConstant(pRHS) && yymsp[-4].minor.yy528->op!=TK_VECTOR ){
175874 yymsp[-1].minor.yy322->a[0].pExpr = 0;
175875 sqlite3ExprListDelete(pParse->db, yymsp[-1].minor.yy322);
175876 pRHS = sqlite3PExpr(pParse, TK_UPLUS, pRHS, 0);
175877 yymsp[-4].minor.yy528 = sqlite3PExpr(pParse, TK_EQ, yymsp[-4].minor.yy528, pRHS);
175878 }else if( yymsp[-1].minor.yy322->nExpr==1 && pRHS->op==TK_SELECT ){
175879 yymsp[-4].minor.yy528 = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy528, 0);
175880 sqlite3PExprAddSelect(pParse, yymsp[-4].minor.yy528, pRHS->x.pSelect);
175881 pRHS->x.pSelect = 0;
175882 sqlite3ExprListDelete(pParse->db, yymsp[-1].minor.yy322);
175883 }else{
175884 yymsp[-4].minor.yy528 = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy528, 0);
175885 if( yymsp[-4].minor.yy528==0 ){
175886 sqlite3ExprListDelete(pParse->db, yymsp[-1].minor.yy322);
175887 }else if( yymsp[-4].minor.yy528->pLeft->op==TK_VECTOR ){
175888 int nExpr = yymsp[-4].minor.yy528->pLeft->x.pList->nExpr;
175889 Select *pSelectRHS = sqlite3ExprListToValues(pParse, nExpr, yymsp[-1].minor.yy322);
175890 if( pSelectRHS ){
175891 parserDoubleLinkSelect(pParse, pSelectRHS);
175892 sqlite3PExprAddSelect(pParse, yymsp[-4].minor.yy528, pSelectRHS);
175893 }
175894 }else{
175895 yymsp[-4].minor.yy528->x.pList = yymsp[-1].minor.yy322;
175896 sqlite3ExprSetHeightAndFlags(pParse, yymsp[-4].minor.yy528);
175897 }
175898 }
175899 if( yymsp[-3].minor.yy394 ) yymsp[-4].minor.yy528 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy528, 0);
175900 }
175901 }
175902 break;
175903 case 222: /* expr ::= LP select RP */
175904 {
175905 yymsp[-2].minor.yy528 = sqlite3PExpr(pParse, TK_SELECT, 0, 0);
175906 sqlite3PExprAddSelect(pParse, yymsp[-2].minor.yy528, yymsp[-1].minor.yy47);
175907 }
175908 break;
175909 case 223: /* expr ::= expr in_op LP select RP */
175910 {
175911 yymsp[-4].minor.yy528 = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy528, 0);
175912 sqlite3PExprAddSelect(pParse, yymsp[-4].minor.yy528, yymsp[-1].minor.yy47);
175913 if( yymsp[-3].minor.yy394 ) yymsp[-4].minor.yy528 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy528, 0);
175914 }
175915 break;
175916 case 224: /* expr ::= expr in_op nm dbnm paren_exprlist */
175917 {
175918 SrcList *pSrc = sqlite3SrcListAppend(pParse, 0,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0);
175919 Select *pSelect = sqlite3SelectNew(pParse, 0,pSrc,0,0,0,0,0,0);
175920 if( yymsp[0].minor.yy322 ) sqlite3SrcListFuncArgs(pParse, pSelect ? pSrc : 0, yymsp[0].minor.yy322);
175921 yymsp[-4].minor.yy528 = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy528, 0);
175922 sqlite3PExprAddSelect(pParse, yymsp[-4].minor.yy528, pSelect);
175923 if( yymsp[-3].minor.yy394 ) yymsp[-4].minor.yy528 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy528, 0);
175924 }
175925 break;
175926 case 225: /* expr ::= EXISTS LP select RP */
175927 {
175928 Expr *p;
175929 p = yymsp[-3].minor.yy528 = sqlite3PExpr(pParse, TK_EXISTS, 0, 0);
175930 sqlite3PExprAddSelect(pParse, p, yymsp[-1].minor.yy47);
175931 }
175932 break;
175933 case 226: /* expr ::= CASE case_operand case_exprlist case_else END */
175934 {
175935 yymsp[-4].minor.yy528 = sqlite3PExpr(pParse, TK_CASE, yymsp[-3].minor.yy528, 0);
175936 if( yymsp[-4].minor.yy528 ){
175937 yymsp[-4].minor.yy528->x.pList = yymsp[-1].minor.yy528 ? sqlite3ExprListAppend(pParse,yymsp[-2].minor.yy322,yymsp[-1].minor.yy528) : yymsp[-2].minor.yy322;
175938 sqlite3ExprSetHeightAndFlags(pParse, yymsp[-4].minor.yy528);
175939 }else{
175940 sqlite3ExprListDelete(pParse->db, yymsp[-2].minor.yy322);
175941 sqlite3ExprDelete(pParse->db, yymsp[-1].minor.yy528);
175942 }
175943 }
175944 break;
175945 case 227: /* case_exprlist ::= case_exprlist WHEN expr THEN expr */
175946 {
175947 yymsp[-4].minor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy322, yymsp[-2].minor.yy528);
175948 yymsp[-4].minor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy322, yymsp[0].minor.yy528);
175949 }
175950 break;
175951 case 228: /* case_exprlist ::= WHEN expr THEN expr */
175952 {
175953 yymsp[-3].minor.yy322 = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy528);
175954 yymsp[-3].minor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-3].minor.yy322, yymsp[0].minor.yy528);
175955 }
175956 break;
175957 case 233: /* nexprlist ::= nexprlist COMMA expr */
175958 {yymsp[-2].minor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-2].minor.yy322,yymsp[0].minor.yy528);}
175959 break;
175960 case 234: /* nexprlist ::= expr */
175961 {yymsp[0].minor.yy322 = sqlite3ExprListAppend(pParse,0,yymsp[0].minor.yy528); /*A-overwrites-Y*/}
175962 break;
175963 case 236: /* paren_exprlist ::= LP exprlist RP */
175964 case 241: /* eidlist_opt ::= LP eidlist RP */ yytestcase(yyruleno==241);
175965 {yymsp[-2].minor.yy322 = yymsp[-1].minor.yy322;}
175966 break;
175967 case 237: /* cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP sortlist RP where_opt */
175968 {
175969 sqlite3CreateIndex(pParse, &yymsp[-7].minor.yy0, &yymsp[-6].minor.yy0,
175970 sqlite3SrcListAppend(pParse,0,&yymsp[-4].minor.yy0,0), yymsp[-2].minor.yy322, yymsp[-10].minor.yy394,
175971 &yymsp[-11].minor.yy0, yymsp[0].minor.yy528, SQLITE_SO_ASC, yymsp[-8].minor.yy394, SQLITE_IDXTYPE_APPDEF);
175972 if( IN_RENAME_OBJECT && pParse->pNewIndex ){
175973 sqlite3RenameTokenMap(pParse, pParse->pNewIndex->zName, &yymsp[-4].minor.yy0);
175974 }
175975 }
175976 break;
175977 case 238: /* uniqueflag ::= UNIQUE */
175978 case 280: /* raisetype ::= ABORT */ yytestcase(yyruleno==280);
175979 {yymsp[0].minor.yy394 = OE_Abort;}
175980 break;
175981 case 239: /* uniqueflag ::= */
175982 {yymsp[1].minor.yy394 = OE_None;}
175983 break;
175984 case 242: /* eidlist ::= eidlist COMMA nm collate sortorder */
175985 {
175986 yymsp[-4].minor.yy322 = parserAddExprIdListTerm(pParse, yymsp[-4].minor.yy322, &yymsp[-2].minor.yy0, yymsp[-1].minor.yy394, yymsp[0].minor.yy394);
175987 }
175988 break;
175989 case 243: /* eidlist ::= nm collate sortorder */
175990 {
175991 yymsp[-2].minor.yy322 = parserAddExprIdListTerm(pParse, 0, &yymsp[-2].minor.yy0, yymsp[-1].minor.yy394, yymsp[0].minor.yy394); /*A-overwrites-Y*/
175992 }
175993 break;
175994 case 246: /* cmd ::= DROP INDEX ifexists fullname */
175995 {sqlite3DropIndex(pParse, yymsp[0].minor.yy131, yymsp[-1].minor.yy394);}
175996 break;
175997 case 247: /* cmd ::= VACUUM vinto */
175998 {sqlite3Vacuum(pParse,0,yymsp[0].minor.yy528);}
175999 break;
176000 case 248: /* cmd ::= VACUUM nm vinto */
176001 {sqlite3Vacuum(pParse,&yymsp[-1].minor.yy0,yymsp[0].minor.yy528);}
176002 break;
176003 case 251: /* cmd ::= PRAGMA nm dbnm */
176004 {sqlite3Pragma(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,0,0);}
176005 break;
176006 case 252: /* cmd ::= PRAGMA nm dbnm EQ nmnum */
@@ -176018,54 +176306,54 @@
176018 case 258: /* cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END */
176019 {
176020 Token all;
176021 all.z = yymsp[-3].minor.yy0.z;
176022 all.n = (int)(yymsp[0].minor.yy0.z - yymsp[-3].minor.yy0.z) + yymsp[0].minor.yy0.n;
176023 sqlite3FinishTrigger(pParse, yymsp[-1].minor.yy33, &all);
176024 }
176025 break;
176026 case 259: /* trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause */
176027 {
176028 sqlite3BeginTrigger(pParse, &yymsp[-7].minor.yy0, &yymsp[-6].minor.yy0, yymsp[-5].minor.yy394, yymsp[-4].minor.yy180.a, yymsp[-4].minor.yy180.b, yymsp[-2].minor.yy131, yymsp[0].minor.yy528, yymsp[-10].minor.yy394, yymsp[-8].minor.yy394);
176029 yymsp[-10].minor.yy0 = (yymsp[-6].minor.yy0.n==0?yymsp[-7].minor.yy0:yymsp[-6].minor.yy0); /*A-overwrites-T*/
176030 }
176031 break;
176032 case 260: /* trigger_time ::= BEFORE|AFTER */
176033 { yymsp[0].minor.yy394 = yymsp[0].major; /*A-overwrites-X*/ }
176034 break;
176035 case 261: /* trigger_time ::= INSTEAD OF */
176036 { yymsp[-1].minor.yy394 = TK_INSTEAD;}
176037 break;
176038 case 262: /* trigger_time ::= */
176039 { yymsp[1].minor.yy394 = TK_BEFORE; }
176040 break;
176041 case 263: /* trigger_event ::= DELETE|INSERT */
176042 case 264: /* trigger_event ::= UPDATE */ yytestcase(yyruleno==264);
176043 {yymsp[0].minor.yy180.a = yymsp[0].major; /*A-overwrites-X*/ yymsp[0].minor.yy180.b = 0;}
176044 break;
176045 case 265: /* trigger_event ::= UPDATE OF idlist */
176046 {yymsp[-2].minor.yy180.a = TK_UPDATE; yymsp[-2].minor.yy180.b = yymsp[0].minor.yy254;}
176047 break;
176048 case 266: /* when_clause ::= */
176049 case 285: /* key_opt ::= */ yytestcase(yyruleno==285);
176050 { yymsp[1].minor.yy528 = 0; }
176051 break;
176052 case 267: /* when_clause ::= WHEN expr */
176053 case 286: /* key_opt ::= KEY expr */ yytestcase(yyruleno==286);
176054 { yymsp[-1].minor.yy528 = yymsp[0].minor.yy528; }
176055 break;
176056 case 268: /* trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI */
176057 {
176058 assert( yymsp[-2].minor.yy33!=0 );
176059 yymsp[-2].minor.yy33->pLast->pNext = yymsp[-1].minor.yy33;
176060 yymsp[-2].minor.yy33->pLast = yymsp[-1].minor.yy33;
176061 }
176062 break;
176063 case 269: /* trigger_cmd_list ::= trigger_cmd SEMI */
176064 {
176065 assert( yymsp[-1].minor.yy33!=0 );
176066 yymsp[-1].minor.yy33->pLast = yymsp[-1].minor.yy33;
176067 }
176068 break;
176069 case 270: /* trnm ::= nm DOT nm */
176070 {
176071 yymsp[-2].minor.yy0 = yymsp[0].minor.yy0;
@@ -176087,62 +176375,62 @@
176087 "the NOT INDEXED clause is not allowed on UPDATE or DELETE statements "
176088 "within triggers");
176089 }
176090 break;
176091 case 273: /* trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist from where_opt scanpt */
176092 {yylhsminor.yy33 = sqlite3TriggerUpdateStep(pParse, &yymsp[-6].minor.yy0, yymsp[-2].minor.yy131, yymsp[-3].minor.yy322, yymsp[-1].minor.yy528, yymsp[-7].minor.yy394, yymsp[-8].minor.yy0.z, yymsp[0].minor.yy522);}
176093 yymsp[-8].minor.yy33 = yylhsminor.yy33;
176094 break;
176095 case 274: /* trigger_cmd ::= scanpt insert_cmd INTO trnm idlist_opt select upsert scanpt */
176096 {
176097 yylhsminor.yy33 = sqlite3TriggerInsertStep(pParse,&yymsp[-4].minor.yy0,yymsp[-3].minor.yy254,yymsp[-2].minor.yy47,yymsp[-6].minor.yy394,yymsp[-1].minor.yy444,yymsp[-7].minor.yy522,yymsp[0].minor.yy522);/*yylhsminor.yy33-overwrites-yymsp[-6].minor.yy394*/
176098 }
176099 yymsp[-7].minor.yy33 = yylhsminor.yy33;
176100 break;
176101 case 275: /* trigger_cmd ::= DELETE FROM trnm tridxby where_opt scanpt */
176102 {yylhsminor.yy33 = sqlite3TriggerDeleteStep(pParse, &yymsp[-3].minor.yy0, yymsp[-1].minor.yy528, yymsp[-5].minor.yy0.z, yymsp[0].minor.yy522);}
176103 yymsp[-5].minor.yy33 = yylhsminor.yy33;
176104 break;
176105 case 276: /* trigger_cmd ::= scanpt select scanpt */
176106 {yylhsminor.yy33 = sqlite3TriggerSelectStep(pParse->db, yymsp[-1].minor.yy47, yymsp[-2].minor.yy522, yymsp[0].minor.yy522); /*yylhsminor.yy33-overwrites-yymsp[-1].minor.yy47*/}
176107 yymsp[-2].minor.yy33 = yylhsminor.yy33;
176108 break;
176109 case 277: /* expr ::= RAISE LP IGNORE RP */
176110 {
176111 yymsp[-3].minor.yy528 = sqlite3PExpr(pParse, TK_RAISE, 0, 0);
176112 if( yymsp[-3].minor.yy528 ){
176113 yymsp[-3].minor.yy528->affExpr = OE_Ignore;
176114 }
176115 }
176116 break;
176117 case 278: /* expr ::= RAISE LP raisetype COMMA nm RP */
176118 {
176119 yymsp[-5].minor.yy528 = sqlite3ExprAlloc(pParse->db, TK_RAISE, &yymsp[-1].minor.yy0, 1);
176120 if( yymsp[-5].minor.yy528 ) {
176121 yymsp[-5].minor.yy528->affExpr = (char)yymsp[-3].minor.yy394;
176122 }
176123 }
176124 break;
176125 case 279: /* raisetype ::= ROLLBACK */
176126 {yymsp[0].minor.yy394 = OE_Rollback;}
176127 break;
176128 case 281: /* raisetype ::= FAIL */
176129 {yymsp[0].minor.yy394 = OE_Fail;}
176130 break;
176131 case 282: /* cmd ::= DROP TRIGGER ifexists fullname */
176132 {
176133 sqlite3DropTrigger(pParse,yymsp[0].minor.yy131,yymsp[-1].minor.yy394);
176134 }
176135 break;
176136 case 283: /* cmd ::= ATTACH database_kw_opt expr AS expr key_opt */
176137 {
176138 sqlite3Attach(pParse, yymsp[-3].minor.yy528, yymsp[-1].minor.yy528, yymsp[0].minor.yy528);
176139 }
176140 break;
176141 case 284: /* cmd ::= DETACH database_kw_opt expr */
176142 {
176143 sqlite3Detach(pParse, yymsp[0].minor.yy528);
176144 }
176145 break;
176146 case 287: /* cmd ::= REINDEX */
176147 {sqlite3Reindex(pParse, 0, 0);}
176148 break;
@@ -176155,11 +176443,11 @@
176155 case 290: /* cmd ::= ANALYZE nm dbnm */
176156 {sqlite3Analyze(pParse, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0);}
176157 break;
176158 case 291: /* cmd ::= ALTER TABLE fullname RENAME TO nm */
176159 {
176160 sqlite3AlterRenameTable(pParse,yymsp[-3].minor.yy131,&yymsp[0].minor.yy0);
176161 }
176162 break;
176163 case 292: /* cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt columnname carglist */
176164 {
176165 yymsp[-1].minor.yy0.n = (int)(pParse->sLastToken.z-yymsp[-1].minor.yy0.z) + pParse->sLastToken.n;
@@ -176166,22 +176454,22 @@
176166 sqlite3AlterFinishAddColumn(pParse, &yymsp[-1].minor.yy0);
176167 }
176168 break;
176169 case 293: /* cmd ::= ALTER TABLE fullname DROP kwcolumn_opt nm */
176170 {
176171 sqlite3AlterDropColumn(pParse, yymsp[-3].minor.yy131, &yymsp[0].minor.yy0);
176172 }
176173 break;
176174 case 294: /* add_column_fullname ::= fullname */
176175 {
176176 disableLookaside(pParse);
176177 sqlite3AlterBeginAddColumn(pParse, yymsp[0].minor.yy131);
176178 }
176179 break;
176180 case 295: /* cmd ::= ALTER TABLE fullname RENAME kwcolumn_opt nm TO nm */
176181 {
176182 sqlite3AlterRenameColumn(pParse, yymsp[-5].minor.yy131, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0);
176183 }
176184 break;
176185 case 296: /* cmd ::= create_vtab */
176186 {sqlite3VtabFinishParse(pParse,0);}
176187 break;
@@ -176188,11 +176476,11 @@
176188 case 297: /* cmd ::= create_vtab LP vtabarglist RP */
176189 {sqlite3VtabFinishParse(pParse,&yymsp[0].minor.yy0);}
176190 break;
176191 case 298: /* create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm */
176192 {
176193 sqlite3VtabBeginParse(pParse, &yymsp[-3].minor.yy0, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-4].minor.yy394);
176194 }
176195 break;
176196 case 299: /* vtabarg ::= */
176197 {sqlite3VtabArgInit(pParse);}
176198 break;
@@ -176201,242 +176489,249 @@
176201 case 302: /* lp ::= LP */ yytestcase(yyruleno==302);
176202 {sqlite3VtabArgExtend(pParse,&yymsp[0].minor.yy0);}
176203 break;
176204 case 303: /* with ::= WITH wqlist */
176205 case 304: /* with ::= WITH RECURSIVE wqlist */ yytestcase(yyruleno==304);
176206 { sqlite3WithPush(pParse, yymsp[0].minor.yy521, 1); }
176207 break;
176208 case 305: /* wqas ::= AS */
176209 {yymsp[0].minor.yy516 = M10d_Any;}
176210 break;
176211 case 306: /* wqas ::= AS MATERIALIZED */
176212 {yymsp[-1].minor.yy516 = M10d_Yes;}
176213 break;
176214 case 307: /* wqas ::= AS NOT MATERIALIZED */
176215 {yymsp[-2].minor.yy516 = M10d_No;}
176216 break;
176217 case 308: /* wqitem ::= nm eidlist_opt wqas LP select RP */
176218 {
176219 yymsp[-5].minor.yy385 = sqlite3CteNew(pParse, &yymsp[-5].minor.yy0, yymsp[-4].minor.yy322, yymsp[-1].minor.yy47, yymsp[-3].minor.yy516); /*A-overwrites-X*/
176220 }
176221 break;
176222 case 309: /* wqlist ::= wqitem */
176223 {
176224 yymsp[0].minor.yy521 = sqlite3WithAdd(pParse, 0, yymsp[0].minor.yy385); /*A-overwrites-X*/
176225 }
176226 break;
176227 case 310: /* wqlist ::= wqlist COMMA wqitem */
176228 {
176229 yymsp[-2].minor.yy521 = sqlite3WithAdd(pParse, yymsp[-2].minor.yy521, yymsp[0].minor.yy385);
176230 }
176231 break;
176232 case 311: /* windowdefn_list ::= windowdefn_list COMMA windowdefn */
176233 {
176234 assert( yymsp[0].minor.yy41!=0 );
176235 sqlite3WindowChain(pParse, yymsp[0].minor.yy41, yymsp[-2].minor.yy41);
176236 yymsp[0].minor.yy41->pNextWin = yymsp[-2].minor.yy41;
176237 yylhsminor.yy41 = yymsp[0].minor.yy41;
176238 }
176239 yymsp[-2].minor.yy41 = yylhsminor.yy41;
176240 break;
176241 case 312: /* windowdefn ::= nm AS LP window RP */
176242 {
176243 if( ALWAYS(yymsp[-1].minor.yy41) ){
176244 yymsp[-1].minor.yy41->zName = sqlite3DbStrNDup(pParse->db, yymsp[-4].minor.yy0.z, yymsp[-4].minor.yy0.n);
176245 }
176246 yylhsminor.yy41 = yymsp[-1].minor.yy41;
176247 }
176248 yymsp[-4].minor.yy41 = yylhsminor.yy41;
176249 break;
176250 case 313: /* window ::= PARTITION BY nexprlist orderby_opt frame_opt */
176251 {
176252 yymsp[-4].minor.yy41 = sqlite3WindowAssemble(pParse, yymsp[0].minor.yy41, yymsp[-2].minor.yy322, yymsp[-1].minor.yy322, 0);
176253 }
176254 break;
176255 case 314: /* window ::= nm PARTITION BY nexprlist orderby_opt frame_opt */
176256 {
176257 yylhsminor.yy41 = sqlite3WindowAssemble(pParse, yymsp[0].minor.yy41, yymsp[-2].minor.yy322, yymsp[-1].minor.yy322, &yymsp[-5].minor.yy0);
176258 }
176259 yymsp[-5].minor.yy41 = yylhsminor.yy41;
176260 break;
176261 case 315: /* window ::= ORDER BY sortlist frame_opt */
176262 {
176263 yymsp[-3].minor.yy41 = sqlite3WindowAssemble(pParse, yymsp[0].minor.yy41, 0, yymsp[-1].minor.yy322, 0);
176264 }
176265 break;
176266 case 316: /* window ::= nm ORDER BY sortlist frame_opt */
176267 {
176268 yylhsminor.yy41 = sqlite3WindowAssemble(pParse, yymsp[0].minor.yy41, 0, yymsp[-1].minor.yy322, &yymsp[-4].minor.yy0);
176269 }
176270 yymsp[-4].minor.yy41 = yylhsminor.yy41;
176271 break;
176272 case 317: /* window ::= nm frame_opt */
176273 {
176274 yylhsminor.yy41 = sqlite3WindowAssemble(pParse, yymsp[0].minor.yy41, 0, 0, &yymsp[-1].minor.yy0);
176275 }
176276 yymsp[-1].minor.yy41 = yylhsminor.yy41;
176277 break;
176278 case 318: /* frame_opt ::= */
176279 {
176280 yymsp[1].minor.yy41 = sqlite3WindowAlloc(pParse, 0, TK_UNBOUNDED, 0, TK_CURRENT, 0, 0);
176281 }
176282 break;
176283 case 319: /* frame_opt ::= range_or_rows frame_bound_s frame_exclude_opt */
176284 {
176285 yylhsminor.yy41 = sqlite3WindowAlloc(pParse, yymsp[-2].minor.yy394, yymsp[-1].minor.yy595.eType, yymsp[-1].minor.yy595.pExpr, TK_CURRENT, 0, yymsp[0].minor.yy516);
176286 }
176287 yymsp[-2].minor.yy41 = yylhsminor.yy41;
176288 break;
176289 case 320: /* frame_opt ::= range_or_rows BETWEEN frame_bound_s AND frame_bound_e frame_exclude_opt */
176290 {
176291 yylhsminor.yy41 = sqlite3WindowAlloc(pParse, yymsp[-5].minor.yy394, yymsp[-3].minor.yy595.eType, yymsp[-3].minor.yy595.pExpr, yymsp[-1].minor.yy595.eType, yymsp[-1].minor.yy595.pExpr, yymsp[0].minor.yy516);
176292 }
176293 yymsp[-5].minor.yy41 = yylhsminor.yy41;
176294 break;
176295 case 322: /* frame_bound_s ::= frame_bound */
176296 case 324: /* frame_bound_e ::= frame_bound */ yytestcase(yyruleno==324);
176297 {yylhsminor.yy595 = yymsp[0].minor.yy595;}
176298 yymsp[0].minor.yy595 = yylhsminor.yy595;
176299 break;
176300 case 323: /* frame_bound_s ::= UNBOUNDED PRECEDING */
176301 case 325: /* frame_bound_e ::= UNBOUNDED FOLLOWING */ yytestcase(yyruleno==325);
176302 case 327: /* frame_bound ::= CURRENT ROW */ yytestcase(yyruleno==327);
176303 {yylhsminor.yy595.eType = yymsp[-1].major; yylhsminor.yy595.pExpr = 0;}
176304 yymsp[-1].minor.yy595 = yylhsminor.yy595;
176305 break;
176306 case 326: /* frame_bound ::= expr PRECEDING|FOLLOWING */
176307 {yylhsminor.yy595.eType = yymsp[0].major; yylhsminor.yy595.pExpr = yymsp[-1].minor.yy528;}
176308 yymsp[-1].minor.yy595 = yylhsminor.yy595;
176309 break;
176310 case 328: /* frame_exclude_opt ::= */
176311 {yymsp[1].minor.yy516 = 0;}
176312 break;
176313 case 329: /* frame_exclude_opt ::= EXCLUDE frame_exclude */
176314 {yymsp[-1].minor.yy516 = yymsp[0].minor.yy516;}
176315 break;
176316 case 330: /* frame_exclude ::= NO OTHERS */
176317 case 331: /* frame_exclude ::= CURRENT ROW */ yytestcase(yyruleno==331);
176318 {yymsp[-1].minor.yy516 = yymsp[-1].major; /*A-overwrites-X*/}
176319 break;
176320 case 332: /* frame_exclude ::= GROUP|TIES */
176321 {yymsp[0].minor.yy516 = yymsp[0].major; /*A-overwrites-X*/}
176322 break;
176323 case 333: /* window_clause ::= WINDOW windowdefn_list */
176324 { yymsp[-1].minor.yy41 = yymsp[0].minor.yy41; }
176325 break;
176326 case 334: /* filter_over ::= filter_clause over_clause */
176327 {
176328 if( yymsp[0].minor.yy41 ){
176329 yymsp[0].minor.yy41->pFilter = yymsp[-1].minor.yy528;
176330 }else{
176331 sqlite3ExprDelete(pParse->db, yymsp[-1].minor.yy528);
176332 }
176333 yylhsminor.yy41 = yymsp[0].minor.yy41;
176334 }
176335 yymsp[-1].minor.yy41 = yylhsminor.yy41;
176336 break;
176337 case 335: /* filter_over ::= over_clause */
176338 {
176339 yylhsminor.yy41 = yymsp[0].minor.yy41;
176340 }
176341 yymsp[0].minor.yy41 = yylhsminor.yy41;
176342 break;
176343 case 336: /* filter_over ::= filter_clause */
176344 {
176345 yylhsminor.yy41 = (Window*)sqlite3DbMallocZero(pParse->db, sizeof(Window));
176346 if( yylhsminor.yy41 ){
176347 yylhsminor.yy41->eFrmType = TK_FILTER;
176348 yylhsminor.yy41->pFilter = yymsp[0].minor.yy528;
176349 }else{
176350 sqlite3ExprDelete(pParse->db, yymsp[0].minor.yy528);
176351 }
176352 }
176353 yymsp[0].minor.yy41 = yylhsminor.yy41;
176354 break;
176355 case 337: /* over_clause ::= OVER LP window RP */
176356 {
176357 yymsp[-3].minor.yy41 = yymsp[-1].minor.yy41;
176358 assert( yymsp[-3].minor.yy41!=0 );
176359 }
176360 break;
176361 case 338: /* over_clause ::= OVER nm */
176362 {
176363 yymsp[-1].minor.yy41 = (Window*)sqlite3DbMallocZero(pParse->db, sizeof(Window));
176364 if( yymsp[-1].minor.yy41 ){
176365 yymsp[-1].minor.yy41->zName = sqlite3DbStrNDup(pParse->db, yymsp[0].minor.yy0.z, yymsp[0].minor.yy0.n);
176366 }
176367 }
176368 break;
176369 case 339: /* filter_clause ::= FILTER LP WHERE expr RP */
176370 { yymsp[-4].minor.yy528 = yymsp[-1].minor.yy528; }
 
 
 
 
 
 
 
176371 break;
176372 default:
176373 /* (340) input ::= cmdlist */ yytestcase(yyruleno==340);
176374 /* (341) cmdlist ::= cmdlist ecmd */ yytestcase(yyruleno==341);
176375 /* (342) cmdlist ::= ecmd (OPTIMIZED OUT) */ assert(yyruleno!=342);
176376 /* (343) ecmd ::= SEMI */ yytestcase(yyruleno==343);
176377 /* (344) ecmd ::= cmdx SEMI */ yytestcase(yyruleno==344);
176378 /* (345) ecmd ::= explain cmdx SEMI (NEVER REDUCES) */ assert(yyruleno!=345);
176379 /* (346) trans_opt ::= */ yytestcase(yyruleno==346);
176380 /* (347) trans_opt ::= TRANSACTION */ yytestcase(yyruleno==347);
176381 /* (348) trans_opt ::= TRANSACTION nm */ yytestcase(yyruleno==348);
176382 /* (349) savepoint_opt ::= SAVEPOINT */ yytestcase(yyruleno==349);
176383 /* (350) savepoint_opt ::= */ yytestcase(yyruleno==350);
176384 /* (351) cmd ::= create_table create_table_args */ yytestcase(yyruleno==351);
176385 /* (352) table_option_set ::= table_option (OPTIMIZED OUT) */ assert(yyruleno!=352);
176386 /* (353) columnlist ::= columnlist COMMA columnname carglist */ yytestcase(yyruleno==353);
176387 /* (354) columnlist ::= columnname carglist */ yytestcase(yyruleno==354);
176388 /* (355) nm ::= ID|INDEXED|JOIN_KW */ yytestcase(yyruleno==355);
176389 /* (356) nm ::= STRING */ yytestcase(yyruleno==356);
176390 /* (357) typetoken ::= typename */ yytestcase(yyruleno==357);
176391 /* (358) typename ::= ID|STRING */ yytestcase(yyruleno==358);
176392 /* (359) signed ::= plus_num (OPTIMIZED OUT) */ assert(yyruleno!=359);
176393 /* (360) signed ::= minus_num (OPTIMIZED OUT) */ assert(yyruleno!=360);
176394 /* (361) carglist ::= carglist ccons */ yytestcase(yyruleno==361);
176395 /* (362) carglist ::= */ yytestcase(yyruleno==362);
176396 /* (363) ccons ::= NULL onconf */ yytestcase(yyruleno==363);
176397 /* (364) ccons ::= GENERATED ALWAYS AS generated */ yytestcase(yyruleno==364);
176398 /* (365) ccons ::= AS generated */ yytestcase(yyruleno==365);
176399 /* (366) conslist_opt ::= COMMA conslist */ yytestcase(yyruleno==366);
176400 /* (367) conslist ::= conslist tconscomma tcons */ yytestcase(yyruleno==367);
176401 /* (368) conslist ::= tcons (OPTIMIZED OUT) */ assert(yyruleno!=368);
176402 /* (369) tconscomma ::= */ yytestcase(yyruleno==369);
176403 /* (370) defer_subclause_opt ::= defer_subclause (OPTIMIZED OUT) */ assert(yyruleno!=370);
176404 /* (371) resolvetype ::= raisetype (OPTIMIZED OUT) */ assert(yyruleno!=371);
176405 /* (372) selectnowith ::= oneselect (OPTIMIZED OUT) */ assert(yyruleno!=372);
176406 /* (373) oneselect ::= values */ yytestcase(yyruleno==373);
176407 /* (374) sclp ::= selcollist COMMA */ yytestcase(yyruleno==374);
176408 /* (375) as ::= ID|STRING */ yytestcase(yyruleno==375);
176409 /* (376) indexed_opt ::= indexed_by (OPTIMIZED OUT) */ assert(yyruleno!=376);
176410 /* (377) returning ::= */ yytestcase(yyruleno==377);
176411 /* (378) expr ::= term (OPTIMIZED OUT) */ assert(yyruleno!=378);
176412 /* (379) likeop ::= LIKE_KW|MATCH */ yytestcase(yyruleno==379);
176413 /* (380) case_operand ::= expr */ yytestcase(yyruleno==380);
176414 /* (381) exprlist ::= nexprlist */ yytestcase(yyruleno==381);
176415 /* (382) nmnum ::= plus_num (OPTIMIZED OUT) */ assert(yyruleno!=382);
176416 /* (383) nmnum ::= nm (OPTIMIZED OUT) */ assert(yyruleno!=383);
176417 /* (384) nmnum ::= ON */ yytestcase(yyruleno==384);
176418 /* (385) nmnum ::= DELETE */ yytestcase(yyruleno==385);
176419 /* (386) nmnum ::= DEFAULT */ yytestcase(yyruleno==386);
176420 /* (387) plus_num ::= INTEGER|FLOAT */ yytestcase(yyruleno==387);
176421 /* (388) foreach_clause ::= */ yytestcase(yyruleno==388);
176422 /* (389) foreach_clause ::= FOR EACH ROW */ yytestcase(yyruleno==389);
176423 /* (390) trnm ::= nm */ yytestcase(yyruleno==390);
176424 /* (391) tridxby ::= */ yytestcase(yyruleno==391);
176425 /* (392) database_kw_opt ::= DATABASE */ yytestcase(yyruleno==392);
176426 /* (393) database_kw_opt ::= */ yytestcase(yyruleno==393);
176427 /* (394) kwcolumn_opt ::= */ yytestcase(yyruleno==394);
176428 /* (395) kwcolumn_opt ::= COLUMNKW */ yytestcase(yyruleno==395);
176429 /* (396) vtabarglist ::= vtabarg */ yytestcase(yyruleno==396);
176430 /* (397) vtabarglist ::= vtabarglist COMMA vtabarg */ yytestcase(yyruleno==397);
176431 /* (398) vtabarg ::= vtabarg vtabargtoken */ yytestcase(yyruleno==398);
176432 /* (399) anylist ::= */ yytestcase(yyruleno==399);
176433 /* (400) anylist ::= anylist LP anylist RP */ yytestcase(yyruleno==400);
176434 /* (401) anylist ::= anylist ANY */ yytestcase(yyruleno==401);
176435 /* (402) with ::= */ yytestcase(yyruleno==402);
176436 /* (403) windowdefn_list ::= windowdefn (OPTIMIZED OUT) */ assert(yyruleno!=403);
176437 /* (404) window ::= frame_opt (OPTIMIZED OUT) */ assert(yyruleno!=404);
176438 break;
176439 /********** End reduce actions ************************************************/
176440 };
176441 assert( yyruleno<sizeof(yyRuleInfoLhs)/sizeof(yyRuleInfoLhs[0]) );
176442 yygoto = yyRuleInfoLhs[yyruleno];
@@ -177695,31 +177990,62 @@
177695 testcase( z[0]=='6' ); testcase( z[0]=='7' ); testcase( z[0]=='8' );
177696 testcase( z[0]=='9' ); testcase( z[0]=='.' );
177697 *tokenType = TK_INTEGER;
177698 #ifndef SQLITE_OMIT_HEX_INTEGER
177699 if( z[0]=='0' && (z[1]=='x' || z[1]=='X') && sqlite3Isxdigit(z[2]) ){
177700 for(i=3; sqlite3Isxdigit(z[i]); i++){}
177701 return i;
177702 }
 
 
 
 
 
 
 
177703 #endif
177704 for(i=0; sqlite3Isdigit(z[i]); i++){}
 
 
 
 
 
 
 
 
 
177705 #ifndef SQLITE_OMIT_FLOATING_POINT
177706 if( z[i]=='.' ){
177707 i++;
177708 while( sqlite3Isdigit(z[i]) ){ i++; }
177709 *tokenType = TK_FLOAT;
177710 }
177711 if( (z[i]=='e' || z[i]=='E') &&
177712 ( sqlite3Isdigit(z[i+1])
177713 || ((z[i+1]=='+' || z[i+1]=='-') && sqlite3Isdigit(z[i+2]))
177714 )
177715 ){
177716 i += 2;
177717 while( sqlite3Isdigit(z[i]) ){ i++; }
177718 *tokenType = TK_FLOAT;
177719 }
177720 #endif
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
177721 while( IdChar(z[i]) ){
177722 *tokenType = TK_ILLEGAL;
177723 i++;
177724 }
177725 return i;
@@ -177880,14 +178206,17 @@
177880 }
177881 #ifndef SQLITE_OMIT_WINDOWFUNC
177882 if( tokenType>=TK_WINDOW ){
177883 assert( tokenType==TK_SPACE || tokenType==TK_OVER || tokenType==TK_FILTER
177884 || tokenType==TK_ILLEGAL || tokenType==TK_WINDOW
 
177885 );
177886 #else
177887 if( tokenType>=TK_SPACE ){
177888 assert( tokenType==TK_SPACE || tokenType==TK_ILLEGAL );
 
 
177889 #endif /* SQLITE_OMIT_WINDOWFUNC */
177890 if( AtomicLoad(&db->u1.isInterrupted) ){
177891 pParse->rc = SQLITE_INTERRUPT;
177892 pParse->nErr++;
177893 break;
@@ -177916,11 +178245,11 @@
177916 tokenType = analyzeOverKeyword((const u8*)&zSql[4], lastTokenParsed);
177917 }else if( tokenType==TK_FILTER ){
177918 assert( n==6 );
177919 tokenType = analyzeFilterKeyword((const u8*)&zSql[6], lastTokenParsed);
177920 #endif /* SQLITE_OMIT_WINDOWFUNC */
177921 }else{
177922 Token x;
177923 x.z = zSql;
177924 x.n = n;
177925 sqlite3ErrorMsg(pParse, "unrecognized token: \"%T\"", &x);
177926 break;
@@ -204150,11 +204479,10 @@
204150 memcpy(p->zBuf+p->nUsed, zIn, N);
204151 p->nUsed += N;
204152 }
204153 }
204154
204155
204156 /* Append formatted text (not to exceed N bytes) to the JsonString.
204157 */
204158 static void jsonPrintf(int N, JsonString *p, const char *zFormat, ...){
204159 va_list ap;
204160 if( (p->nUsed + N >= p->nAlloc) && jsonStringGrow(p, N) ) return;
@@ -205210,11 +205538,11 @@
205210 return j+1;
205211 }
205212 case '[': {
205213 /* Parse array */
205214 iThis = pParse->nBlob;
205215 assert( i<=pParse->nJson );
205216 jsonBlobAppendNode(pParse, JSONB_ARRAY, pParse->nJson - i, 0);
205217 iStart = pParse->nBlob;
205218 if( pParse->oom ) return -1;
205219 if( ++pParse->iDepth > JSON_MAX_DEPTH ){
205220 pParse->iErr = i;
@@ -205922,10 +206250,116 @@
205922 break;
205923 }
205924 }
205925 return i+n+sz;
205926 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
205927
205928 /* Return true if the input pJson
205929 **
205930 ** For performance reasons, this routine does not do a detailed check of the
205931 ** input BLOB to ensure that it is well-formed. Hence, false positives are
@@ -207841,10 +208275,44 @@
207841 }
207842 sqlite3_result_text(ctx, jsonbType[p->aBlob[i]&0x0f], -1, SQLITE_STATIC);
207843 json_type_done:
207844 jsonParseFree(p);
207845 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
207846
207847 /*
207848 ** json_valid(JSON)
207849 ** json_valid(JSON, FLAGS)
207850 **
@@ -208580,13 +209048,13 @@
208580 break;
208581 }
208582 case JEACH_JSON: {
208583 if( p->sParse.zJson==0 ){
208584 sqlite3_result_blob(ctx, p->sParse.aBlob, p->sParse.nBlob,
208585 SQLITE_STATIC);
208586 }else{
208587 sqlite3_result_text(ctx, p->sParse.zJson, -1, SQLITE_STATIC);
208588 }
208589 break;
208590 }
208591 }
208592 return SQLITE_OK;
@@ -208856,10 +209324,12 @@
208856 JFUNCTION(jsonb_insert, -1,1,0, 1,1,0, jsonSetFunc),
208857 JFUNCTION(json_object, -1,0,1, 1,0,0, jsonObjectFunc),
208858 JFUNCTION(jsonb_object, -1,0,1, 1,1,0, jsonObjectFunc),
208859 JFUNCTION(json_patch, 2,1,1, 0,0,0, jsonPatchFunc),
208860 JFUNCTION(jsonb_patch, 2,1,0, 0,1,0, jsonPatchFunc),
 
 
208861 JFUNCTION(json_quote, 1,0,1, 1,0,0, jsonQuoteFunc),
208862 JFUNCTION(json_remove, -1,1,1, 0,0,0, jsonRemoveFunc),
208863 JFUNCTION(jsonb_remove, -1,1,0, 0,1,0, jsonRemoveFunc),
208864 JFUNCTION(json_replace, -1,1,1, 1,0,0, jsonReplaceFunc),
208865 JFUNCTION(jsonb_replace, -1,1,0, 1,1,0, jsonReplaceFunc),
@@ -210755,10 +211225,12 @@
210755 }
210756 pCons->pInfo = pInfo;
210757 return SQLITE_OK;
210758 }
210759
 
 
210760 /*
210761 ** Rtree virtual table module xFilter method.
210762 */
210763 static int rtreeFilter(
210764 sqlite3_vtab_cursor *pVtabCursor,
@@ -210784,11 +211256,12 @@
210784 RtreeSearchPoint *p; /* Search point for the leaf */
210785 i64 iRowid = sqlite3_value_int64(argv[0]);
210786 i64 iNode = 0;
210787 int eType = sqlite3_value_numeric_type(argv[0]);
210788 if( eType==SQLITE_INTEGER
210789 || (eType==SQLITE_FLOAT && sqlite3_value_double(argv[0])==iRowid)
 
210790 ){
210791 rc = findLeafNode(pRtree, iRowid, &pLeaf, &iNode);
210792 }else{
210793 rc = SQLITE_OK;
210794 pLeaf = 0;
@@ -251030,11 +251503,11 @@
251030 int nArg, /* Number of args */
251031 sqlite3_value **apUnused /* Function arguments */
251032 ){
251033 assert( nArg==0 );
251034 UNUSED_PARAM2(nArg, apUnused);
251035 sqlite3_result_text(pCtx, "fts5: 2024-02-20 12:14:07 6c5a0c85454e3c658e51fab611c169c034447174022eebc52fd8619b528a4765", -1, SQLITE_TRANSIENT);
251036 }
251037
251038 /*
251039 ** Return true if zName is the extension on one of the shadow tables used
251040 ** by this module.
251041
--- extsrc/sqlite3.c
+++ extsrc/sqlite3.c
@@ -16,11 +16,11 @@
16 ** if you want a wrapper to interface SQLite with your choice of programming
17 ** language. The code for the "sqlite3" command-line shell is also in a
18 ** separate file. This file contains only code for the core SQLite library.
19 **
20 ** The content in this amalgamation comes from Fossil check-in
21 ** 7ead022edaf7a0cd6a8976a1261246084975.
22 */
23 #define SQLITE_CORE 1
24 #define SQLITE_AMALGAMATION 1
25 #ifndef SQLITE_PRIVATE
26 # define SQLITE_PRIVATE static
@@ -459,11 +459,11 @@
459 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
460 ** [sqlite_version()] and [sqlite_source_id()].
461 */
462 #define SQLITE_VERSION "3.46.0"
463 #define SQLITE_VERSION_NUMBER 3046000
464 #define SQLITE_SOURCE_ID "2024-03-09 18:41:40 7ead022edaf7a0cd6a8976a1261246084975c9a5be5c893f6c751bb5f963ac0f"
465
466 /*
467 ** CAPI3REF: Run-Time Library Version Numbers
468 ** KEYWORDS: sqlite3_version sqlite3_sourceid
469 **
@@ -1075,15 +1075,15 @@
1075 ** <li> [SQLITE_LOCK_PENDING], or
1076 ** <li> [SQLITE_LOCK_EXCLUSIVE].
1077 ** </ul>
1078 ** xLock() upgrades the database file lock. In other words, xLock() moves the
1079 ** database file lock in the direction NONE toward EXCLUSIVE. The argument to
1080 ** xLock() is always one of SHARED, RESERVED, PENDING, or EXCLUSIVE, never
1081 ** SQLITE_LOCK_NONE. If the database file lock is already at or above the
1082 ** requested lock, then the call to xLock() is a no-op.
1083 ** xUnlock() downgrades the database file lock to either SHARED or NONE.
1084 ** If the lock is already at or below the requested lock state, then the call
1085 ** to xUnlock() is a no-op.
1086 ** The xCheckReservedLock() method checks whether any database connection,
1087 ** either in this process or in some other process, is holding a RESERVED,
1088 ** PENDING, or EXCLUSIVE lock on the file. It returns true
1089 ** if such a lock exists and false otherwise.
@@ -14295,10 +14295,12 @@
14295 */
14296 #if defined(SQLITE_OMIT_VIRTUALTABLE) && !defined(SQLITE_OMIT_ALTERTABLE)
14297 # define SQLITE_OMIT_ALTERTABLE
14298 #endif
14299
14300 #define SQLITE_DIGIT_SEPARATOR '_'
14301
14302 /*
14303 ** Return true (non-zero) if the input is an integer that is too large
14304 ** to fit in 32-bits. This macro is used inside of various testcase()
14305 ** macros to verify that we have tested SQLite for large-file support.
14306 */
@@ -14597,12 +14599,13 @@
14599 #define TK_SELECT_COLUMN 178
14600 #define TK_IF_NULL_ROW 179
14601 #define TK_ASTERISK 180
14602 #define TK_SPAN 181
14603 #define TK_ERROR 182
14604 #define TK_QNUMBER 183
14605 #define TK_SPACE 184
14606 #define TK_ILLEGAL 185
14607
14608 /************** End of parse.h ***********************************************/
14609 /************** Continuing where we left off in sqliteInt.h ******************/
14610 #include <stdio.h>
14611 #include <stdlib.h>
@@ -15097,10 +15100,11 @@
15100 ** 0x00004000 Push-down optimization
15101 ** 0x00008000 After all FROM-clause analysis
15102 ** 0x00010000 Beginning of DELETE/INSERT/UPDATE processing
15103 ** 0x00020000 Transform DISTINCT into GROUP BY
15104 ** 0x00040000 SELECT tree dump after all code has been generated
15105 ** 0x00080000 NOT NULL strength reduction
15106 */
15107
15108 /*
15109 ** Macros for "wheretrace"
15110 */
@@ -16276,10 +16280,11 @@
16280
16281 SQLITE_PRIVATE int sqlite3BtreeIntegrityCheck(
16282 sqlite3 *db, /* Database connection that is running the check */
16283 Btree *p, /* The btree to be checked */
16284 Pgno *aRoot, /* An array of root pages numbers for individual trees */
16285 sqlite3_value *aCnt, /* OUT: entry counts for each btree in aRoot[] */
16286 int nRoot, /* Number of entries in aRoot[] */
16287 int mxErr, /* Stop reporting errors after this many */
16288 int *pnErr, /* OUT: Write number of errors seen to this variable */
16289 char **pzOut /* OUT: Write the error message string here */
16290 );
@@ -16546,39 +16551,39 @@
16551 #define OP_Checkpoint 3
16552 #define OP_JournalMode 4
16553 #define OP_Vacuum 5
16554 #define OP_VFilter 6 /* jump, synopsis: iplan=r[P3] zplan='P4' */
16555 #define OP_VUpdate 7 /* synopsis: data=r[P3@P2] */
16556 #define OP_Init 8 /* jump0, synopsis: Start at P2 */
16557 #define OP_Goto 9 /* jump */
16558 #define OP_Gosub 10 /* jump */
16559 #define OP_InitCoroutine 11 /* jump0 */
16560 #define OP_Yield 12 /* jump0 */
16561 #define OP_MustBeInt 13 /* jump0 */
16562 #define OP_Jump 14 /* jump */
16563 #define OP_Once 15 /* jump */
16564 #define OP_If 16 /* jump */
16565 #define OP_IfNot 17 /* jump */
16566 #define OP_IsType 18 /* jump, synopsis: if typeof(P1.P3) in P5 goto P2 */
16567 #define OP_Not 19 /* same as TK_NOT, synopsis: r[P2]= !r[P1] */
16568 #define OP_IfNullRow 20 /* jump, synopsis: if P1.nullRow then r[P3]=NULL, goto P2 */
16569 #define OP_SeekLT 21 /* jump0, synopsis: key=r[P3@P4] */
16570 #define OP_SeekLE 22 /* jump0, synopsis: key=r[P3@P4] */
16571 #define OP_SeekGE 23 /* jump0, synopsis: key=r[P3@P4] */
16572 #define OP_SeekGT 24 /* jump0, synopsis: key=r[P3@P4] */
16573 #define OP_IfNotOpen 25 /* jump, synopsis: if( !csr[P1] ) goto P2 */
16574 #define OP_IfNoHope 26 /* jump, synopsis: key=r[P3@P4] */
16575 #define OP_NoConflict 27 /* jump, synopsis: key=r[P3@P4] */
16576 #define OP_NotFound 28 /* jump, synopsis: key=r[P3@P4] */
16577 #define OP_Found 29 /* jump, synopsis: key=r[P3@P4] */
16578 #define OP_SeekRowid 30 /* jump0, synopsis: intkey=r[P3] */
16579 #define OP_NotExists 31 /* jump, synopsis: intkey=r[P3] */
16580 #define OP_Last 32 /* jump0 */
16581 #define OP_IfSizeBetween 33 /* jump */
16582 #define OP_SorterSort 34 /* jump */
16583 #define OP_Sort 35 /* jump */
16584 #define OP_Rewind 36 /* jump0 */
16585 #define OP_SorterNext 37 /* jump */
16586 #define OP_Prev 38 /* jump */
16587 #define OP_Next 39 /* jump */
16588 #define OP_IdxLE 40 /* jump, synopsis: key=r[P3@P4] */
16589 #define OP_IdxGT 41 /* jump, synopsis: key=r[P3@P4] */
@@ -16586,11 +16591,11 @@
16591 #define OP_Or 43 /* same as TK_OR, synopsis: r[P3]=(r[P1] || r[P2]) */
16592 #define OP_And 44 /* same as TK_AND, synopsis: r[P3]=(r[P1] && r[P2]) */
16593 #define OP_IdxGE 45 /* jump, synopsis: key=r[P3@P4] */
16594 #define OP_RowSetRead 46 /* jump, synopsis: r[P3]=rowset(P1) */
16595 #define OP_RowSetTest 47 /* jump, synopsis: if r[P3] in rowset(P1) goto P2 */
16596 #define OP_Program 48 /* jump0 */
16597 #define OP_FkIfZero 49 /* jump, synopsis: if fkctr[P1]==0 goto P2 */
16598 #define OP_IsNull 50 /* jump, same as TK_ISNULL, synopsis: if r[P1]==NULL goto P2 */
16599 #define OP_NotNull 51 /* jump, same as TK_NOTNULL, synopsis: if r[P1]!=NULL goto P2 */
16600 #define OP_Ne 52 /* jump, same as TK_NE, synopsis: IF r[P3]!=r[P1] */
16601 #define OP_Eq 53 /* jump, same as TK_EQ, synopsis: IF r[P3]==r[P1] */
@@ -16616,11 +16621,11 @@
16621 #define OP_String 73 /* synopsis: r[P2]='P4' (len=P1) */
16622 #define OP_BeginSubrtn 74 /* synopsis: r[P2]=NULL */
16623 #define OP_Null 75 /* synopsis: r[P2..P3]=NULL */
16624 #define OP_SoftNull 76 /* synopsis: r[P1]=NULL */
16625 #define OP_Blob 77 /* synopsis: r[P2]=P4 (len=P1) */
16626 #define OP_Variable 78 /* synopsis: r[P2]=parameter(P1) */
16627 #define OP_Move 79 /* synopsis: r[P2@P3]=r[P1@P3] */
16628 #define OP_Copy 80 /* synopsis: r[P2@P3+1]=r[P1@P3+1] */
16629 #define OP_SCopy 81 /* synopsis: r[P2]=r[P1] */
16630 #define OP_IntCopy 82 /* synopsis: r[P2]=r[P1] */
16631 #define OP_FkCheck 83
@@ -16740,18 +16745,19 @@
16745 #define OPFLG_IN2 0x04 /* in2: P2 is an input */
16746 #define OPFLG_IN3 0x08 /* in3: P3 is an input */
16747 #define OPFLG_OUT2 0x10 /* out2: P2 is an output */
16748 #define OPFLG_OUT3 0x20 /* out3: P3 is an output */
16749 #define OPFLG_NCYCLE 0x40 /* ncycle:Cycles count against P1 */
16750 #define OPFLG_JUMP0 0x80 /* jump0: P2 might be zero */
16751 #define OPFLG_INITIALIZER {\
16752 /* 0 */ 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x41, 0x00,\
16753 /* 8 */ 0x81, 0x01, 0x01, 0x81, 0x83, 0x83, 0x01, 0x01,\
16754 /* 16 */ 0x03, 0x03, 0x01, 0x12, 0x01, 0xc9, 0xc9, 0xc9,\
16755 /* 24 */ 0xc9, 0x01, 0x49, 0x49, 0x49, 0x49, 0xc9, 0x49,\
16756 /* 32 */ 0xc1, 0x01, 0x41, 0x41, 0xc1, 0x01, 0x41, 0x41,\
16757 /* 40 */ 0x41, 0x41, 0x41, 0x26, 0x26, 0x41, 0x23, 0x0b,\
16758 /* 48 */ 0x81, 0x01, 0x03, 0x03, 0x0b, 0x0b, 0x0b, 0x0b,\
16759 /* 56 */ 0x0b, 0x0b, 0x01, 0x03, 0x03, 0x03, 0x01, 0x41,\
16760 /* 64 */ 0x01, 0x00, 0x00, 0x02, 0x02, 0x08, 0x00, 0x10,\
16761 /* 72 */ 0x10, 0x10, 0x00, 0x10, 0x00, 0x10, 0x10, 0x00,\
16762 /* 80 */ 0x00, 0x10, 0x10, 0x00, 0x00, 0x00, 0x02, 0x02,\
16763 /* 88 */ 0x02, 0x00, 0x00, 0x12, 0x1e, 0x20, 0x40, 0x00,\
@@ -16906,10 +16912,12 @@
16912 typedef int (*RecordCompare)(int,const void*,UnpackedRecord*);
16913 SQLITE_PRIVATE RecordCompare sqlite3VdbeFindCompare(UnpackedRecord*);
16914
16915 SQLITE_PRIVATE void sqlite3VdbeLinkSubProgram(Vdbe *, SubProgram *);
16916 SQLITE_PRIVATE int sqlite3VdbeHasSubProgram(Vdbe*);
16917
16918 SQLITE_PRIVATE void sqlite3MemSetArrayInt64(sqlite3_value *aMem, int iIdx, i64 val);
16919
16920 SQLITE_PRIVATE int sqlite3NotPureFunc(sqlite3_context*);
16921 #ifdef SQLITE_ENABLE_BYTECODE_VTAB
16922 SQLITE_PRIVATE int sqlite3VdbeBytecodeVtabInit(sqlite3*);
16923 #endif
@@ -19349,10 +19357,11 @@
19357 #define NC_HasWin 0x008000 /* One or more window functions seen */
19358 #define NC_IsDDL 0x010000 /* Resolving names in a CREATE statement */
19359 #define NC_InAggFunc 0x020000 /* True if analyzing arguments to an agg func */
19360 #define NC_FromDDL 0x040000 /* SQL text comes from sqlite_schema */
19361 #define NC_NoSelect 0x080000 /* Do not descend into sub-selects */
19362 #define NC_Where 0x100000 /* Processing WHERE clause of a SELECT */
19363 #define NC_OrderAgg 0x8000000 /* Has an aggregate other than count/min/max */
19364
19365 /*
19366 ** An instance of the following object describes a single ON CONFLICT
19367 ** clause in an upsert.
@@ -19372,10 +19381,11 @@
19381 Expr *pUpsertTargetWhere; /* WHERE clause for partial index targets */
19382 ExprList *pUpsertSet; /* The SET clause from an ON CONFLICT UPDATE */
19383 Expr *pUpsertWhere; /* WHERE clause for the ON CONFLICT UPDATE */
19384 Upsert *pNextUpsert; /* Next ON CONFLICT clause in the list */
19385 u8 isDoUpdate; /* True for DO UPDATE. False for DO NOTHING */
19386 u8 isDup; /* True if 2nd or later with same pUpsertIdx */
19387 /* Above this point is the parse tree for the ON CONFLICT clauses.
19388 ** The next group of fields stores intermediate data. */
19389 void *pToFree; /* Free memory when deleting the Upsert object */
19390 /* All fields above are owned by the Upsert object and must be freed
19391 ** when the Upsert is destroyed. The fields below are used to transfer
@@ -20693,10 +20703,11 @@
20703 SQLITE_PRIVATE void sqlite3ErrorMsg(Parse*, const char*, ...);
20704 SQLITE_PRIVATE int sqlite3ErrorToParser(sqlite3*,int);
20705 SQLITE_PRIVATE void sqlite3Dequote(char*);
20706 SQLITE_PRIVATE void sqlite3DequoteExpr(Expr*);
20707 SQLITE_PRIVATE void sqlite3DequoteToken(Token*);
20708 SQLITE_PRIVATE void sqlite3DequoteNumber(Parse*, Expr*);
20709 SQLITE_PRIVATE void sqlite3TokenInit(Token*,char*);
20710 SQLITE_PRIVATE int sqlite3KeywordCode(const unsigned char*, int);
20711 SQLITE_PRIVATE int sqlite3RunParser(Parse*, const char*);
20712 SQLITE_PRIVATE void sqlite3FinishCoding(Parse*);
20713 SQLITE_PRIVATE int sqlite3GetTempReg(Parse*);
@@ -21447,11 +21458,11 @@
21458 #endif
21459 #ifndef SQLITE_OMIT_UPSERT
21460 SQLITE_PRIVATE Upsert *sqlite3UpsertNew(sqlite3*,ExprList*,Expr*,ExprList*,Expr*,Upsert*);
21461 SQLITE_PRIVATE void sqlite3UpsertDelete(sqlite3*,Upsert*);
21462 SQLITE_PRIVATE Upsert *sqlite3UpsertDup(sqlite3*,Upsert*);
21463 SQLITE_PRIVATE int sqlite3UpsertAnalyzeTarget(Parse*,SrcList*,Upsert*,Upsert*);
21464 SQLITE_PRIVATE void sqlite3UpsertDoUpdate(Parse*,Upsert*,Table*,Index*,int);
21465 SQLITE_PRIVATE Upsert *sqlite3UpsertOfIndex(Upsert*,Index*);
21466 SQLITE_PRIVATE int sqlite3UpsertNextIsIPK(Upsert*);
21467 #else
21468 #define sqlite3UpsertNew(u,v,w,x,y,z) ((Upsert*)0)
@@ -24177,17 +24188,18 @@
24188 int Y, M, D; /* Year, month, and day */
24189 int h, m; /* Hour and minutes */
24190 int tz; /* Timezone offset in minutes */
24191 double s; /* Seconds */
24192 char validJD; /* True (1) if iJD is valid */
 
24193 char validYMD; /* True (1) if Y,M,D are valid */
24194 char validHMS; /* True (1) if h,m,s are valid */
24195 char nFloor; /* Days to implement "floor" */
24196 unsigned rawS : 1; /* Raw numeric value stored in s */
24197 unsigned isError : 1; /* An overflow has occurred */
24198 unsigned useSubsec : 1; /* Display subsecond precision */
24199 unsigned isUtc : 1; /* Time is known to be UTC */
24200 unsigned isLocal : 1; /* Time is known to be localtime */
24201 };
24202
24203
24204 /*
24205 ** Convert zDate into one or more integers according to the conversion
@@ -24281,10 +24293,12 @@
24293 sgn = -1;
24294 }else if( c=='+' ){
24295 sgn = +1;
24296 }else if( c=='Z' || c=='z' ){
24297 zDate++;
24298 p->isLocal = 0;
24299 p->isUtc = 1;
24300 goto zulu_time;
24301 }else{
24302 return c!=0;
24303 }
24304 zDate++;
@@ -24293,11 +24307,10 @@
24307 }
24308 zDate += 5;
24309 p->tz = sgn*(nMn + nHr*60);
24310 zulu_time:
24311 while( sqlite3Isspace(*zDate) ){ zDate++; }
 
24312 return *zDate!=0;
24313 }
24314
24315 /*
24316 ** Parse times of the form HH:MM or HH:MM:SS or HH:MM:SS.FFFF.
@@ -24337,11 +24350,10 @@
24350 p->validHMS = 1;
24351 p->h = h;
24352 p->m = m;
24353 p->s = s + ms;
24354 if( parseTimezone(zDate, p) ) return 1;
 
24355 return 0;
24356 }
24357
24358 /*
24359 ** Put the DateTime object into its error state.
@@ -24384,18 +24396,43 @@
24396 X2 = 306001*(M+1)/10000;
24397 p->iJD = (sqlite3_int64)((X1 + X2 + D + B - 1524.5 ) * 86400000);
24398 p->validJD = 1;
24399 if( p->validHMS ){
24400 p->iJD += p->h*3600000 + p->m*60000 + (sqlite3_int64)(p->s*1000 + 0.5);
24401 if( p->tz ){
24402 p->iJD -= p->tz*60000;
24403 p->validYMD = 0;
24404 p->validHMS = 0;
24405 p->tz = 0;
24406 p->isUtc = 1;
24407 p->isLocal = 0;
24408 }
24409 }
24410 }
24411
24412 /*
24413 ** Given the YYYY-MM-DD information current in p, determine if there
24414 ** is day-of-month overflow and set nFloor to the number of days that
24415 ** would need to be subtracted from the date in order to bring the
24416 ** date back to the end of the month.
24417 */
24418 static void computeFloor(DateTime *p){
24419 assert( p->validYMD || p->isError );
24420 assert( p->D>=0 && p->D<=31 );
24421 assert( p->M>=0 && p->M<=12 );
24422 if( p->D<=28 ){
24423 p->nFloor = 0;
24424 }else if( (1<<p->M) & 0x15aa ){
24425 p->nFloor = 0;
24426 }else if( p->M!=2 ){
24427 p->nFloor = (p->D==31);
24428 }else if( p->Y%4!=0 || (p->Y%100==0 && p->Y%400!=0) ){
24429 p->nFloor = p->D - 28;
24430 }else{
24431 p->nFloor = p->D - 29;
24432 }
24433 }
24434
24435 /*
24436 ** Parse dates of the form
24437 **
24438 ** YYYY-MM-DD HH:MM:SS.FFF
@@ -24431,25 +24468,32 @@
24468 p->validJD = 0;
24469 p->validYMD = 1;
24470 p->Y = neg ? -Y : Y;
24471 p->M = M;
24472 p->D = D;
24473 computeFloor(p);
24474 if( p->tz ){
24475 computeJD(p);
24476 }
24477 return 0;
24478 }
24479
24480
24481 static void clearYMD_HMS_TZ(DateTime *p); /* Forward declaration */
24482
24483 /*
24484 ** Set the time to the current time reported by the VFS.
24485 **
24486 ** Return the number of errors.
24487 */
24488 static int setDateTimeToCurrent(sqlite3_context *context, DateTime *p){
24489 p->iJD = sqlite3StmtCurrentTime(context);
24490 if( p->iJD>0 ){
24491 p->validJD = 1;
24492 p->isUtc = 1;
24493 p->isLocal = 0;
24494 clearYMD_HMS_TZ(p);
24495 return 0;
24496 }else{
24497 return 1;
24498 }
24499 }
@@ -24584,11 +24628,11 @@
24628 ** Clear the YMD and HMS and the TZ
24629 */
24630 static void clearYMD_HMS_TZ(DateTime *p){
24631 p->validYMD = 0;
24632 p->validHMS = 0;
24633 p->tz = 0;
24634 }
24635
24636 #ifndef SQLITE_OMIT_LOCALTIME
24637 /*
24638 ** On recent Windows platforms, the localtime_s() function is available
@@ -24716,11 +24760,11 @@
24760 p->s = sLocal.tm_sec + (p->iJD%1000)*0.001;
24761 p->validYMD = 1;
24762 p->validHMS = 1;
24763 p->validJD = 0;
24764 p->rawS = 0;
24765 p->tz = 0;
24766 p->isError = 0;
24767 return SQLITE_OK;
24768 }
24769 #endif /* SQLITE_OMIT_LOCALTIME */
24770
@@ -24736,16 +24780,16 @@
24780 u8 nName; /* Length of the name */
24781 char zName[7]; /* Name of the transformation */
24782 float rLimit; /* Maximum NNN value for this transform */
24783 float rXform; /* Constant used for this transform */
24784 } aXformType[] = {
24785 /* 0 */ { 6, "second", 4.6427e+14, 1.0 },
24786 /* 1 */ { 6, "minute", 7.7379e+12, 60.0 },
24787 /* 2 */ { 4, "hour", 1.2897e+11, 3600.0 },
24788 /* 3 */ { 3, "day", 5373485.0, 86400.0 },
24789 /* 4 */ { 5, "month", 176546.0, 30.0*86400.0 },
24790 /* 5 */ { 4, "year", 14713.0, 365.0*86400.0 },
24791 };
24792
24793 /*
24794 ** If the DateTime p is raw number, try to figure out if it is
24795 ** a julian day number of a unix timestamp. Set the p value
@@ -24773,18 +24817,24 @@
24817 ** NNN hours
24818 ** NNN minutes
24819 ** NNN.NNNN seconds
24820 ** NNN months
24821 ** NNN years
24822 ** +/-YYYY-MM-DD HH:MM:SS.SSS
24823 ** ceiling
24824 ** floor
24825 ** start of month
24826 ** start of year
24827 ** start of week
24828 ** start of day
24829 ** weekday N
24830 ** unixepoch
24831 ** auto
24832 ** localtime
24833 ** utc
24834 ** subsec
24835 ** subsecond
24836 **
24837 ** Return 0 on success and 1 if there is any kind of error. If the error
24838 ** is in a system call (i.e. localtime()), then an error message is written
24839 ** to context pCtx. If the error is an unrecognized modifier, no error is
24840 ** written to pCtx.
@@ -24810,10 +24860,41 @@
24860 if( idx>1 ) return 1; /* IMP: R-33611-57934 */
24861 autoAdjustDate(p);
24862 rc = 0;
24863 }
24864 break;
24865 }
24866 case 'c': {
24867 /*
24868 ** ceiling
24869 **
24870 ** Resolve day-of-month overflow by rolling forward into the next
24871 ** month. As this is the default action, this modifier is really
24872 ** a no-op that is only included for symmetry. See "floor".
24873 */
24874 if( sqlite3_stricmp(z, "ceiling")==0 ){
24875 computeJD(p);
24876 clearYMD_HMS_TZ(p);
24877 rc = 0;
24878 p->nFloor = 0;
24879 }
24880 break;
24881 }
24882 case 'f': {
24883 /*
24884 ** floor
24885 **
24886 ** Resolve day-of-month overflow by rolling back to the end of the
24887 ** previous month.
24888 */
24889 if( sqlite3_stricmp(z, "floor")==0 ){
24890 computeJD(p);
24891 p->iJD -= p->nFloor*86400000;
24892 clearYMD_HMS_TZ(p);
24893 rc = 0;
24894 }
24895 break;
24896 }
24897 case 'j': {
24898 /*
24899 ** julianday
24900 **
@@ -24837,11 +24918,13 @@
24918 **
24919 ** Assuming the current time value is UTC (a.k.a. GMT), shift it to
24920 ** show local time.
24921 */
24922 if( sqlite3_stricmp(z, "localtime")==0 && sqlite3NotPureFunc(pCtx) ){
24923 rc = p->isLocal ? SQLITE_OK : toLocaltime(p, pCtx);
24924 p->isUtc = 0;
24925 p->isLocal = 1;
24926 }
24927 break;
24928 }
24929 #endif
24930 case 'u': {
@@ -24862,11 +24945,11 @@
24945 rc = 0;
24946 }
24947 }
24948 #ifndef SQLITE_OMIT_LOCALTIME
24949 else if( sqlite3_stricmp(z, "utc")==0 && sqlite3NotPureFunc(pCtx) ){
24950 if( p->isUtc==0 ){
24951 i64 iOrigJD; /* Original localtime */
24952 i64 iGuess; /* Guess at the corresponding utc time */
24953 int cnt = 0; /* Safety to prevent infinite loop */
24954 i64 iErr; /* Guess is off by this much */
24955
@@ -24885,11 +24968,12 @@
24968 iErr = new.iJD - iOrigJD;
24969 }while( iErr && cnt++<3 );
24970 memset(p, 0, sizeof(*p));
24971 p->iJD = iGuess;
24972 p->validJD = 1;
24973 p->isUtc = 1;
24974 p->isLocal = 0;
24975 }
24976 rc = SQLITE_OK;
24977 }
24978 #endif
24979 break;
@@ -24905,11 +24989,11 @@
24989 if( sqlite3_strnicmp(z, "weekday ", 8)==0
24990 && sqlite3AtoF(&z[8], &r, sqlite3Strlen30(&z[8]), SQLITE_UTF8)>0
24991 && r>=0.0 && r<7.0 && (n=(int)r)==r ){
24992 sqlite3_int64 Z;
24993 computeYMD_HMS(p);
24994 p->tz = 0;
24995 p->validJD = 0;
24996 computeJD(p);
24997 Z = ((p->iJD + 129600000)/86400000) % 7;
24998 if( Z>n ) Z -= 7;
24999 p->iJD += (n - Z)*86400000;
@@ -24945,11 +25029,11 @@
25029 computeYMD(p);
25030 p->validHMS = 1;
25031 p->h = p->m = 0;
25032 p->s = 0.0;
25033 p->rawS = 0;
25034 p->tz = 0;
25035 p->validJD = 0;
25036 if( sqlite3_stricmp(z,"month")==0 ){
25037 p->D = 1;
25038 rc = 0;
25039 }else if( sqlite3_stricmp(z,"year")==0 ){
@@ -25016,10 +25100,11 @@
25100 p->M += M;
25101 }
25102 x = p->M>0 ? (p->M-1)/12 : (p->M-12)/12;
25103 p->Y += x;
25104 p->M -= x*12;
25105 computeFloor(p);
25106 computeJD(p);
25107 p->validHMS = 0;
25108 p->validYMD = 0;
25109 p->iJD += (i64)D*86400000;
25110 if( z[11]==0 ){
@@ -25062,37 +25147,41 @@
25147 /* If control reaches this point, it means the transformation is
25148 ** one of the forms like "+NNN days". */
25149 z += n;
25150 while( sqlite3Isspace(*z) ) z++;
25151 n = sqlite3Strlen30(z);
25152 if( n<3 || n>10 ) break;
25153 if( sqlite3UpperToLower[(u8)z[n-1]]=='s' ) n--;
25154 computeJD(p);
25155 assert( rc==1 );
25156 rRounder = r<0 ? -0.5 : +0.5;
25157 p->nFloor = 0;
25158 for(i=0; i<ArraySize(aXformType); i++){
25159 if( aXformType[i].nName==n
25160 && sqlite3_strnicmp(aXformType[i].zName, z, n)==0
25161 && r>-aXformType[i].rLimit && r<aXformType[i].rLimit
25162 ){
25163 switch( i ){
25164 case 4: { /* Special processing to add months */
25165 assert( strcmp(aXformType[4].zName,"month")==0 );
25166 computeYMD_HMS(p);
25167 p->M += (int)r;
25168 x = p->M>0 ? (p->M-1)/12 : (p->M-12)/12;
25169 p->Y += x;
25170 p->M -= x*12;
25171 computeFloor(p);
25172 p->validJD = 0;
25173 r -= (int)r;
25174 break;
25175 }
25176 case 5: { /* Special processing to add years */
25177 int y = (int)r;
25178 assert( strcmp(aXformType[5].zName,"year")==0 );
25179 computeYMD_HMS(p);
25180 assert( p->M>=0 && p->M<=12 );
25181 p->Y += y;
25182 computeFloor(p);
25183 p->validJD = 0;
25184 r -= (int)r;
25185 break;
25186 }
25187 }
@@ -25713,13 +25802,11 @@
25802 computeJD(&d2);
25803 }
25804 d1.iJD = d2.iJD - d1.iJD;
25805 d1.iJD += (u64)1486995408 * (u64)100000;
25806 }
25807 clearYMD_HMS_TZ(&d1);
 
 
25808 computeYMD_HMS(&d1);
25809 sqlite3StrAccumInit(&sRes, 0, 0, 0, 100);
25810 sqlite3_str_appendf(&sRes, "%c%04d-%02d-%02d %02d:%02d:%06.3f",
25811 sign, Y, M, d1.D-1, d1.h, d1.m, d1.s);
25812 sqlite3ResultStrAccum(context, &sRes);
@@ -25783,10 +25870,40 @@
25870 strftime(zBuf, 20, zFormat, &sNow);
25871 sqlite3_result_text(context, zBuf, -1, SQLITE_TRANSIENT);
25872 }
25873 }
25874 #endif
25875
25876 #if !defined(SQLITE_OMIT_DATETIME_FUNCS) && defined(SQLITE_DEBUG)
25877 /*
25878 ** datedebug(...)
25879 **
25880 ** This routine returns JSON that describes the internal DateTime object.
25881 ** Used for debugging and testing only. Subject to change.
25882 */
25883 static void datedebugFunc(
25884 sqlite3_context *context,
25885 int argc,
25886 sqlite3_value **argv
25887 ){
25888 DateTime x;
25889 if( isDate(context, argc, argv, &x)==0 ){
25890 char *zJson;
25891 zJson = sqlite3_mprintf(
25892 "{iJD:%lld,Y:%d,M:%d,D:%d,h:%d,m:%d,tz:%d,"
25893 "s:%.3f,validJD:%d,validYMS:%d,validHMS:%d,"
25894 "nFloor:%d,rawS:%d,isError:%d,useSubsec:%d,"
25895 "isUtc:%d,isLocal:%d}",
25896 x.iJD, x.Y, x.M, x.D, x.h, x.m, x.tz,
25897 x.s, x.validJD, x.validYMD, x.validHMS,
25898 x.nFloor, x.rawS, x.isError, x.useSubsec,
25899 x.isUtc, x.isLocal);
25900 sqlite3_result_text(context, zJson, -1, sqlite3_free);
25901 }
25902 }
25903 #endif /* !SQLITE_OMIT_DATETIME_FUNCS && SQLITE_DEBUG */
25904
25905
25906 /*
25907 ** This function registered all of the above C functions as SQL
25908 ** functions. This should be the only routine in this file with
25909 ** external linkage.
@@ -25799,10 +25916,13 @@
25916 PURE_DATE(date, -1, 0, 0, dateFunc ),
25917 PURE_DATE(time, -1, 0, 0, timeFunc ),
25918 PURE_DATE(datetime, -1, 0, 0, datetimeFunc ),
25919 PURE_DATE(strftime, -1, 0, 0, strftimeFunc ),
25920 PURE_DATE(timediff, 2, 0, 0, timediffFunc ),
25921 #ifdef SQLITE_DEBUG
25922 PURE_DATE(datedebug, -1, 0, 0, datedebugFunc ),
25923 #endif
25924 DFUNCTION(current_time, 0, 0, 0, ctimeFunc ),
25925 DFUNCTION(current_timestamp, 0, 0, 0, ctimestampFunc),
25926 DFUNCTION(current_date, 0, 0, 0, cdateFunc ),
25927 #else
25928 STR_FUNCTION(current_time, 0, "%H:%M:%S", 0, currentTimeFunc),
@@ -34989,10 +35109,48 @@
35109 assert( !ExprHasProperty(p, EP_IntValue) );
35110 assert( sqlite3Isquote(p->u.zToken[0]) );
35111 p->flags |= p->u.zToken[0]=='"' ? EP_Quoted|EP_DblQuoted : EP_Quoted;
35112 sqlite3Dequote(p->u.zToken);
35113 }
35114
35115 /*
35116 ** Expression p is a QNUMBER (quoted number). Dequote the value in p->u.zToken
35117 ** and set the type to INTEGER or FLOAT. "Quoted" integers or floats are those
35118 ** that contain '_' characters that must be removed before further processing.
35119 */
35120 SQLITE_PRIVATE void sqlite3DequoteNumber(Parse *pParse, Expr *p){
35121 assert( p!=0 || pParse->db->mallocFailed );
35122 if( p ){
35123 const char *pIn = p->u.zToken;
35124 char *pOut = p->u.zToken;
35125 int bHex = (pIn[0]=='0' && (pIn[1]=='x' || pIn[1]=='X'));
35126 int iValue;
35127 assert( p->op==TK_QNUMBER );
35128 p->op = TK_INTEGER;
35129 do {
35130 if( *pIn!=SQLITE_DIGIT_SEPARATOR ){
35131 *pOut++ = *pIn;
35132 if( *pIn=='e' || *pIn=='E' || *pIn=='.' ) p->op = TK_FLOAT;
35133 }else{
35134 if( (bHex==0 && (!sqlite3Isdigit(pIn[-1]) || !sqlite3Isdigit(pIn[1])))
35135 || (bHex==1 && (!sqlite3Isxdigit(pIn[-1]) || !sqlite3Isxdigit(pIn[1])))
35136 ){
35137 sqlite3ErrorMsg(pParse, "unrecognized token: \"%s\"", p->u.zToken);
35138 }
35139 }
35140 }while( *pIn++ );
35141 if( bHex ) p->op = TK_INTEGER;
35142
35143 /* tag-20240227-a: If after dequoting, the number is an integer that
35144 ** fits in 32 bits, then it must be converted into EP_IntValue. Other
35145 ** parts of the code expect this. See also tag-20240227-b. */
35146 if( p->op==TK_INTEGER && sqlite3GetInt32(p->u.zToken, &iValue) ){
35147 p->u.iValue = iValue;
35148 p->flags |= EP_IntValue;
35149 }
35150 }
35151 }
35152
35153 /*
35154 ** If the input token p is quoted, try to adjust the token to remove
35155 ** the quotes. This is not always possible:
35156 **
@@ -35306,10 +35464,13 @@
35464 }else{
35465 double rr[2];
35466 u64 s2;
35467 rr[0] = (double)s;
35468 s2 = (u64)rr[0];
35469 #if defined(_MSC_VER) && _MSC_VER<1700
35470 if( s2==0x8000000000000000LL ){ s2 = 2*(u64)(0.5*rr[0]); }
35471 #endif
35472 rr[1] = s>=s2 ? (double)(s - s2) : -(double)(s2 - s);
35473 if( e>0 ){
35474 while( e>=100 ){
35475 e -= 100;
35476 dekkerMul2(rr, 1.0e+100, -1.5902891109759918046e+83);
@@ -36971,11 +37132,11 @@
37132 /* 73 */ "String" OpHelp("r[P2]='P4' (len=P1)"),
37133 /* 74 */ "BeginSubrtn" OpHelp("r[P2]=NULL"),
37134 /* 75 */ "Null" OpHelp("r[P2..P3]=NULL"),
37135 /* 76 */ "SoftNull" OpHelp("r[P1]=NULL"),
37136 /* 77 */ "Blob" OpHelp("r[P2]=P4 (len=P1)"),
37137 /* 78 */ "Variable" OpHelp("r[P2]=parameter(P1)"),
37138 /* 79 */ "Move" OpHelp("r[P2@P3]=r[P1@P3]"),
37139 /* 80 */ "Copy" OpHelp("r[P2@P3+1]=r[P1@P3+1]"),
37140 /* 81 */ "SCopy" OpHelp("r[P2]=r[P1]"),
37141 /* 82 */ "IntCopy" OpHelp("r[P2]=r[P1]"),
37142 /* 83 */ "FkCheck" OpHelp(""),
@@ -69928,10 +70089,11 @@
70089 Pgno v1; /* Value for second %u substitution in zPfx (current pg) */
70090 int v2; /* Value for third %d substitution in zPfx */
70091 StrAccum errMsg; /* Accumulate the error message text here */
70092 u32 *heap; /* Min-heap used for analyzing cell coverage */
70093 sqlite3 *db; /* Database connection running the check */
70094 i64 nRow; /* Number of rows visited in current tree */
70095 };
70096
70097 /*
70098 ** Routines to read or write a two- and four-byte big-endian integer values.
70099 */
@@ -77258,11 +77420,14 @@
77420 /* This is the common case where everything fits on the btree page
77421 ** and no overflow pages are required. */
77422 n = nHeader + nPayload;
77423 testcase( n==3 );
77424 testcase( n==4 );
77425 if( n<4 ){
77426 n = 4;
77427 pPayload[nPayload] = 0;
77428 }
77429 *pnSize = n;
77430 assert( nSrc<=nPayload );
77431 testcase( nSrc<nPayload );
77432 memcpy(pPayload, pSrc, nSrc);
77433 memset(pPayload+nSrc, 0, nPayload-nSrc);
@@ -79704,11 +79869,14 @@
79869 assert( newCell!=0 );
79870 assert( BTREE_PREFORMAT==OPFLAG_PREFORMAT );
79871 if( flags & BTREE_PREFORMAT ){
79872 rc = SQLITE_OK;
79873 szNew = p->pBt->nPreformatSize;
79874 if( szNew<4 ){
79875 szNew = 4;
79876 newCell[3] = 0;
79877 }
79878 if( ISAUTOVACUUM(p->pBt) && szNew>pPage->maxLocal ){
79879 CellInfo info;
79880 pPage->xParseCell(pPage, newCell, &info);
79881 if( info.nPayload!=info.nLocal ){
79882 Pgno ovfl = get4byte(&newCell[szNew-4]);
@@ -81045,10 +81213,13 @@
81213
81214 /* EVIDENCE-OF: R-37002-32774 The two-byte integer at offset 3 gives the
81215 ** number of cells on the page. */
81216 nCell = get2byte(&data[hdr+3]);
81217 assert( pPage->nCell==nCell );
81218 if( pPage->leaf || pPage->intKey==0 ){
81219 pCheck->nRow += nCell;
81220 }
81221
81222 /* EVIDENCE-OF: R-23882-45353 The cell pointer array of a b-tree page
81223 ** immediately follows the b-tree page header. */
81224 cellStart = hdr + 12 - 4*pPage->leaf;
81225 assert( pPage->aCellIdx==&data[cellStart] );
@@ -81156,10 +81327,11 @@
81327 pc = get2byteAligned(&data[cellStart+i*2]);
81328 size = pPage->xCellSize(pPage, &data[pc]);
81329 btreeHeapInsert(heap, (pc<<16)|(pc+size-1));
81330 }
81331 }
81332 assert( heap!=0 );
81333 /* Add the freeblocks to the min-heap
81334 **
81335 ** EVIDENCE-OF: R-20690-50594 The second field of the b-tree page header
81336 ** is the offset of the first freeblock, or zero if there are no
81337 ** freeblocks on the page.
@@ -81255,10 +81427,11 @@
81427 */
81428 SQLITE_PRIVATE int sqlite3BtreeIntegrityCheck(
81429 sqlite3 *db, /* Database connection that is running the check */
81430 Btree *p, /* The btree to be checked */
81431 Pgno *aRoot, /* An array of root pages numbers for individual trees */
81432 Mem *aCnt, /* Memory cells to write counts for each tree to */
81433 int nRoot, /* Number of entries in aRoot[] */
81434 int mxErr, /* Stop reporting errors after this many */
81435 int *pnErr, /* OUT: Write number of errors seen to this variable */
81436 char **pzOut /* OUT: Write the error message string here */
81437 ){
@@ -81268,11 +81441,13 @@
81441 u64 savedDbFlags = pBt->db->flags;
81442 char zErr[100];
81443 int bPartial = 0; /* True if not checking all btrees */
81444 int bCkFreelist = 1; /* True to scan the freelist */
81445 VVA_ONLY( int nRef );
81446
81447 assert( nRoot>0 );
81448 assert( aCnt!=0 );
81449
81450 /* aRoot[0]==0 means this is a partial check */
81451 if( aRoot[0]==0 ){
81452 assert( nRoot>1 );
81453 bPartial = 1;
@@ -81341,19 +81516,22 @@
81516 }
81517 #endif
81518 testcase( pBt->db->flags & SQLITE_CellSizeCk );
81519 pBt->db->flags &= ~(u64)SQLITE_CellSizeCk;
81520 for(i=0; (int)i<nRoot && sCheck.mxErr; i++){
81521 sCheck.nRow = 0;
81522 if( aRoot[i] ){
81523 i64 notUsed;
81524 #ifndef SQLITE_OMIT_AUTOVACUUM
81525 if( pBt->autoVacuum && aRoot[i]>1 && !bPartial ){
81526 checkPtrmap(&sCheck, aRoot[i], PTRMAP_ROOTPAGE, 0);
81527 }
81528 #endif
81529 sCheck.v0 = aRoot[i];
81530 checkTreePage(&sCheck, aRoot[i], &notUsed, LARGEST_INT64);
81531 }
81532 sqlite3MemSetArrayInt64(aCnt, i, sCheck.nRow);
 
 
81533 }
81534 pBt->db->flags = savedDbFlags;
81535
81536 /* Make sure every page in the file is referenced
81537 */
@@ -83403,10 +83581,17 @@
83581 }else{
83582 pMem->u.i = val;
83583 pMem->flags = MEM_Int;
83584 }
83585 }
83586
83587 /*
83588 ** Set the iIdx'th entry of array aMem[] to contain integer value val.
83589 */
83590 SQLITE_PRIVATE void sqlite3MemSetArrayInt64(sqlite3_value *aMem, int iIdx, i64 val){
83591 sqlite3VdbeMemSetInt64(&aMem[iIdx], val);
83592 }
83593
83594 /* A no-op destructor */
83595 SQLITE_PRIVATE void sqlite3NoopDestructor(void *p){ UNUSED_PARAMETER(p); }
83596
83597 /*
@@ -85448,10 +85633,19 @@
85633 assert( (sqlite3OpcodeProperty[pOp->opcode] & OPFLG_JUMP)!=0 );
85634 assert( ADDR(pOp->p2)<-pParse->nLabel );
85635 assert( aLabel!=0 ); /* True because of tag-20230419-1 */
85636 pOp->p2 = aLabel[ADDR(pOp->p2)];
85637 }
85638
85639 /* OPFLG_JUMP opcodes never have P2==0, though OPFLG_JUMP0 opcodes
85640 ** might */
85641 assert( pOp->p2>0
85642 || (sqlite3OpcodeProperty[pOp->opcode] & OPFLG_JUMP0)!=0 );
85643
85644 /* Jumps never go off the end of the bytecode array */
85645 assert( pOp->p2<p->nOp
85646 || (sqlite3OpcodeProperty[pOp->opcode] & OPFLG_JUMP)==0 );
85647 break;
85648 }
85649 }
85650 /* The mkopcodeh.tcl script has so arranged things that the only
85651 ** non-jump opcodes less than SQLITE_MX_JUMP_CODE are guaranteed to
@@ -88568,10 +88762,27 @@
88762 assert( sizeof(x)==8 && sizeof(pMem->u.r)==8 );
88763 swapMixedEndianFloat(x);
88764 memcpy(&pMem->u.r, &x, sizeof(x));
88765 pMem->flags = IsNaN(x) ? MEM_Null : MEM_Real;
88766 }
88767 }
88768 static int serialGet7(
88769 const unsigned char *buf, /* Buffer to deserialize from */
88770 Mem *pMem /* Memory cell to write value into */
88771 ){
88772 u64 x = FOUR_BYTE_UINT(buf);
88773 u32 y = FOUR_BYTE_UINT(buf+4);
88774 x = (x<<32) + y;
88775 assert( sizeof(x)==8 && sizeof(pMem->u.r)==8 );
88776 swapMixedEndianFloat(x);
88777 memcpy(&pMem->u.r, &x, sizeof(x));
88778 if( IsNaN(x) ){
88779 pMem->flags = MEM_Null;
88780 return 1;
88781 }
88782 pMem->flags = MEM_Real;
88783 return 0;
88784 }
88785 SQLITE_PRIVATE void sqlite3VdbeSerialGet(
88786 const unsigned char *buf, /* Buffer to deserialize from */
88787 u32 serial_type, /* Serial type to deserialize */
88788 Mem *pMem /* Memory cell to write value into */
@@ -89008,21 +89219,19 @@
89219 testcase( x>r );
89220 testcase( x==r );
89221 return (x<r) ? -1 : (x>r);
89222 }else{
89223 i64 y;
 
89224 if( r<-9223372036854775808.0 ) return +1;
89225 if( r>=9223372036854775808.0 ) return -1;
89226 y = (i64)r;
89227 if( i<y ) return -1;
89228 if( i>y ) return +1;
89229 testcase( doubleLt(((double)i),r) );
89230 testcase( doubleLt(r,((double)i)) );
89231 testcase( doubleEq(r,((double)i)) );
89232 return (((double)i)<r) ? -1 : (((double)i)>r);
 
89233 }
89234 }
89235
89236 /*
89237 ** Compare the values contained by the two memory cells, returning
@@ -89248,11 +89457,11 @@
89457 if( serial_type>=10 ){
89458 rc = serial_type==10 ? -1 : +1;
89459 }else if( serial_type==0 ){
89460 rc = -1;
89461 }else if( serial_type==7 ){
89462 serialGet7(&aKey1[d1], &mem1);
89463 rc = -sqlite3IntFloatCompare(pRhs->u.i, mem1.u.r);
89464 }else{
89465 i64 lhs = vdbeRecordDecodeInt(serial_type, &aKey1[d1]);
89466 i64 rhs = pRhs->u.i;
89467 if( lhs<rhs ){
@@ -89273,18 +89482,22 @@
89482 ** them to numeric values are. */
89483 rc = serial_type==10 ? -1 : +1;
89484 }else if( serial_type==0 ){
89485 rc = -1;
89486 }else{
 
89487 if( serial_type==7 ){
89488 if( serialGet7(&aKey1[d1], &mem1) ){
89489 rc = -1; /* mem1 is a NaN */
89490 }else if( mem1.u.r<pRhs->u.r ){
89491 rc = -1;
89492 }else if( mem1.u.r>pRhs->u.r ){
89493 rc = +1;
89494 }else{
89495 assert( rc==0 );
89496 }
89497 }else{
89498 sqlite3VdbeSerialGet(&aKey1[d1], serial_type, &mem1);
89499 rc = sqlite3IntFloatCompare(mem1.u.i, pRhs->u.r);
89500 }
89501 }
89502 }
89503
@@ -89350,11 +89563,18 @@
89563 }
89564
89565 /* RHS is null */
89566 else{
89567 serial_type = aKey1[idx1];
89568 if( serial_type==0
89569 || serial_type==10
89570 || (serial_type==7 && serialGet7(&aKey1[d1], &mem1)!=0)
89571 ){
89572 assert( rc==0 );
89573 }else{
89574 rc = 1;
89575 }
89576 }
89577
89578 if( rc!=0 ){
89579 int sortFlags = pPKey2->pKeyInfo->aSortFlags[i];
89580 if( sortFlags ){
@@ -93876,11 +94096,11 @@
94096 ** this opcode. So jump over the coroutine implementation to
94097 ** address P2.
94098 **
94099 ** See also: EndCoroutine
94100 */
94101 case OP_InitCoroutine: { /* jump0 */
94102 assert( pOp->p1>0 && pOp->p1<=(p->nMem+1 - p->nCursor) );
94103 assert( pOp->p2>=0 && pOp->p2<p->nOp );
94104 assert( pOp->p3>=0 && pOp->p3<p->nOp );
94105 pOut = &aMem[pOp->p1];
94106 assert( !VdbeMemDynamic(pOut) );
@@ -93929,11 +94149,11 @@
94149 ** EndCoroutine, then jump to P2 rather than continuing with the
94150 ** next instruction.
94151 **
94152 ** See also: InitCoroutine
94153 */
94154 case OP_Yield: { /* in1, jump0 */
94155 int pcDest;
94156 pIn1 = &aMem[pOp->p1];
94157 assert( VdbeMemDynamic(pIn1)==0 );
94158 pIn1->flags = MEM_Int;
94159 pcDest = (int)pIn1->u.i;
@@ -94259,23 +94479,19 @@
94479 pOut->enc = encoding;
94480 UPDATE_MAX_BLOBSIZE(pOut);
94481 break;
94482 }
94483
94484 /* Opcode: Variable P1 P2 * * *
94485 ** Synopsis: r[P2]=parameter(P1)
94486 **
94487 ** Transfer the values of bound parameter P1 into register P2
 
 
 
94488 */
94489 case OP_Variable: { /* out2 */
94490 Mem *pVar; /* Value being transferred */
94491
94492 assert( pOp->p1>0 && pOp->p1<=p->nVar );
 
94493 pVar = &p->aVar[pOp->p1 - 1];
94494 if( sqlite3VdbeMemTooBig(pVar) ){
94495 goto too_big;
94496 }
94497 pOut = &aMem[pOp->p2];
@@ -94792,11 +95008,11 @@
95008 ** Force the value in register P1 to be an integer. If the value
95009 ** in P1 is not an integer and cannot be converted into an integer
95010 ** without data loss, then jump immediately to P2, or if P2==0
95011 ** raise an SQLITE_MISMATCH exception.
95012 */
95013 case OP_MustBeInt: { /* jump0, in1 */
95014 pIn1 = &aMem[pOp->p1];
95015 if( (pIn1->flags & MEM_Int)==0 ){
95016 applyAffinity(pIn1, SQLITE_AFF_NUMERIC, encoding);
95017 if( (pIn1->flags & MEM_Int)==0 ){
95018 VdbeBranchTaken(1, 2);
@@ -97476,14 +97692,14 @@
97692 ** OPFLAG_SEEKEQ flags is a hint to the btree layer to say that this
97693 ** is an equality search.
97694 **
97695 ** See also: Found, NotFound, SeekGt, SeekGe, SeekLt
97696 */
97697 case OP_SeekLT: /* jump0, in3, group, ncycle */
97698 case OP_SeekLE: /* jump0, in3, group, ncycle */
97699 case OP_SeekGE: /* jump0, in3, group, ncycle */
97700 case OP_SeekGT: { /* jump0, in3, group, ncycle */
97701 int res; /* Comparison result */
97702 int oc; /* Opcode */
97703 VdbeCursor *pC; /* The cursor to seek */
97704 UnpackedRecord r; /* The key to seek for */
97705 int nField; /* Number of columns or fields in the key */
@@ -98146,11 +98362,11 @@
98362 ** in either direction. In other words, the Next and Prev opcodes will
98363 ** not work following this opcode.
98364 **
98365 ** See also: Found, NotFound, NoConflict, SeekRowid
98366 */
98367 case OP_SeekRowid: { /* jump0, in3, ncycle */
98368 VdbeCursor *pC;
98369 BtCursor *pCrsr;
98370 int res;
98371 u64 iKey;
98372
@@ -98905,11 +99121,11 @@
99121 ** This opcode leaves the cursor configured to move in reverse order,
99122 ** from the end toward the beginning. In other words, the cursor is
99123 ** configured to use Prev, not Next.
99124 */
99125 case OP_SeekEnd: /* ncycle */
99126 case OP_Last: { /* jump0, ncycle */
99127 VdbeCursor *pC;
99128 BtCursor *pCrsr;
99129 int res;
99130
99131 assert( pOp->p1>=0 && pOp->p1<p->nCursor );
@@ -99022,11 +99238,11 @@
99238 **
99239 ** This opcode leaves the cursor configured to move in forward order,
99240 ** from the beginning toward the end. In other words, the cursor is
99241 ** configured to use Next, not Prev.
99242 */
99243 case OP_Rewind: { /* jump0, ncycle */
99244 VdbeCursor *pC;
99245 BtCursor *pCrsr;
99246 int res;
99247
99248 assert( pOp->p1>=0 && pOp->p1<p->nCursor );
@@ -99865,17 +100081,17 @@
100081
100082 #ifndef SQLITE_OMIT_INTEGRITY_CHECK
100083 /* Opcode: IntegrityCk P1 P2 P3 P4 P5
100084 **
100085 ** Do an analysis of the currently open database. Store in
100086 ** register (P1+1) the text of an error message describing any problems.
100087 ** If no problems are found, store a NULL in register (P1+1).
100088 **
100089 ** The register (P1) contains one less than the maximum number of allowed
100090 ** errors. At most reg(P1) errors will be reported.
100091 ** In other words, the analysis stops as soon as reg(P1) errors are
100092 ** seen. Reg(P1) is updated with the number of errors remaining.
100093 **
100094 ** The root page numbers of all tables in the database are integers
100095 ** stored in P4_INTARRAY argument.
100096 **
100097 ** If P5 is not zero, the check is done on the auxiliary database
@@ -99889,23 +100105,25 @@
100105 int nErr; /* Number of errors reported */
100106 char *z; /* Text of the error report */
100107 Mem *pnErr; /* Register keeping track of errors remaining */
100108
100109 assert( p->bIsReader );
100110 assert( pOp->p4type==P4_INTARRAY );
100111 nRoot = pOp->p2;
100112 aRoot = pOp->p4.ai;
100113 assert( nRoot>0 );
100114 assert( aRoot!=0 );
100115 assert( aRoot[0]==(Pgno)nRoot );
100116 assert( pOp->p1>0 && (pOp->p1+1)<=(p->nMem+1 - p->nCursor) );
100117 pnErr = &aMem[pOp->p1];
100118 assert( (pnErr->flags & MEM_Int)!=0 );
100119 assert( (pnErr->flags & (MEM_Str|MEM_Blob))==0 );
100120 pIn1 = &aMem[pOp->p1+1];
100121 assert( pOp->p5<db->nDb );
100122 assert( DbMaskTest(p->btreeMask, pOp->p5) );
100123 rc = sqlite3BtreeIntegrityCheck(db, db->aDb[pOp->p5].pBt, &aRoot[1],
100124 &aMem[pOp->p3], nRoot, (int)pnErr->u.i+1, &nErr, &z);
100125 sqlite3VdbeMemSetNull(pIn1);
100126 if( nErr==0 ){
100127 assert( z==0 );
100128 }else if( rc ){
100129 sqlite3_free(z);
@@ -100028,19 +100246,21 @@
100246 ** Execute the trigger program passed as P4 (type P4_SUBPROGRAM).
100247 **
100248 ** P1 contains the address of the memory cell that contains the first memory
100249 ** cell in an array of values used as arguments to the sub-program. P2
100250 ** contains the address to jump to if the sub-program throws an IGNORE
100251 ** exception using the RAISE() function. P2 might be zero, if there is
100252 ** no possibility that an IGNORE exception will be raised.
100253 ** Register P3 contains the address
100254 ** of a memory cell in this (the parent) VM that is used to allocate the
100255 ** memory required by the sub-vdbe at runtime.
100256 **
100257 ** P4 is a pointer to the VM containing the trigger program.
100258 **
100259 ** If P5 is non-zero, then recursive program invocation is enabled.
100260 */
100261 case OP_Program: { /* jump0 */
100262 int nMem; /* Number of memory registers for sub-program */
100263 int nByte; /* Bytes of runtime space required for sub-program */
100264 Mem *pRt; /* Register to allocate runtime space */
100265 Mem *pMem; /* Used to iterate through memory cells */
100266 Mem *pEnd; /* Last memory cell in new array */
@@ -101585,11 +101805,11 @@
101805 **
101806 ** If P3 is not zero, then it is an address to jump to if an SQLITE_CORRUPT
101807 ** error is encountered.
101808 */
101809 case OP_Trace:
101810 case OP_Init: { /* jump0 */
101811 int i;
101812 #ifndef SQLITE_OMIT_TRACE
101813 char *zTrace;
101814 #endif
101815
@@ -107325,10 +107545,23 @@
107545 ** If this optimization occurs, also restore the NameContext ref-counts
107546 ** to the state they where in before the "column" LHS expression was
107547 ** resolved. This prevents "column" from being counted as having been
107548 ** referenced, which might prevent a SELECT from being erroneously
107549 ** marked as correlated.
107550 **
107551 ** 2024-03-28: Beware of aggregates. A bare column of aggregated table
107552 ** can still evaluate to NULL even though it is marked as NOT NULL.
107553 ** Example:
107554 **
107555 ** CREATE TABLE t1(a INT NOT NULL);
107556 ** SELECT a, a IS NULL, a IS NOT NULL, count(*) FROM t1;
107557 **
107558 ** The "a IS NULL" and "a IS NOT NULL" expressions cannot be optimized
107559 ** here because at the time this case is hit, we do not yet know whether
107560 ** or not t1 is being aggregated. We have to assume the worst and omit
107561 ** the optimization. The only time it is safe to apply this optimization
107562 ** is within the WHERE clause.
107563 */
107564 case TK_NOTNULL:
107565 case TK_ISNULL: {
107566 int anRef[8];
107567 NameContext *p;
@@ -107335,23 +107568,40 @@
107568 int i;
107569 for(i=0, p=pNC; p && i<ArraySize(anRef); p=p->pNext, i++){
107570 anRef[i] = p->nRef;
107571 }
107572 sqlite3WalkExpr(pWalker, pExpr->pLeft);
107573 if( IN_RENAME_OBJECT ) return WRC_Prune;
107574 if( sqlite3ExprCanBeNull(pExpr->pLeft) ){
107575 /* The expression can be NULL. So the optimization does not apply */
107576 return WRC_Prune;
107577 }
107578
107579 for(i=0, p=pNC; p; p=p->pNext, i++){
107580 if( (p->ncFlags & NC_Where)==0 ){
107581 return WRC_Prune; /* Not in a WHERE clause. Unsafe to optimize. */
107582 }
107583 }
107584 testcase( ExprHasProperty(pExpr, EP_OuterON) );
107585 assert( !ExprHasProperty(pExpr, EP_IntValue) );
107586 #if TREETRACE_ENABLED
107587 if( sqlite3TreeTrace & 0x80000 ){
107588 sqlite3DebugPrintf(
107589 "NOT NULL strength reduction converts the following to %d:\n",
107590 pExpr->op==TK_NOTNULL
107591 );
107592 sqlite3ShowExpr(pExpr);
107593 }
107594 #endif /* TREETRACE_ENABLED */
107595 pExpr->u.iValue = (pExpr->op==TK_NOTNULL);
107596 pExpr->flags |= EP_IntValue;
107597 pExpr->op = TK_INTEGER;
107598 for(i=0, p=pNC; p && i<ArraySize(anRef); p=p->pNext, i++){
107599 p->nRef = anRef[i];
107600 }
107601 sqlite3ExprDelete(pParse->db, pExpr->pLeft);
107602 pExpr->pLeft = 0;
107603 return WRC_Prune;
107604 }
107605
107606 /* A column name: ID
107607 ** Or table name and column name: ID.ID
@@ -108245,11 +108495,13 @@
108495 sqlite3ErrorMsg(pParse, "HAVING clause on a non-aggregate query");
108496 return WRC_Abort;
108497 }
108498 if( sqlite3ResolveExprNames(&sNC, p->pHaving) ) return WRC_Abort;
108499 }
108500 sNC.ncFlags |= NC_Where;
108501 if( sqlite3ResolveExprNames(&sNC, p->pWhere) ) return WRC_Abort;
108502 sNC.ncFlags &= ~NC_Where;
108503
108504 /* Resolve names in table-valued-function arguments */
108505 for(i=0; i<p->pSrc->nSrc; i++){
108506 SrcItem *pItem = &p->pSrc->a[i];
108507 if( pItem->fg.isTabFunc
@@ -109480,15 +109732,16 @@
109732 ** If dequote is false, no dequoting is performed. The deQuote
109733 ** parameter is ignored if pToken is NULL or if the token does not
109734 ** appear to be quoted. If the quotes were of the form "..." (double-quotes)
109735 ** then the EP_DblQuoted flag is set on the expression node.
109736 **
109737 ** Special case (tag-20240227-a): If op==TK_INTEGER and pToken points to
109738 ** a string that can be translated into a 32-bit integer, then the token is
109739 ** not stored in u.zToken. Instead, the integer values is written
109740 ** into u.iValue and the EP_IntValue flag is set. No extra storage
109741 ** is allocated to hold the integer text and the dequote flag is ignored.
109742 ** See also tag-20240227-b.
109743 */
109744 SQLITE_PRIVATE Expr *sqlite3ExprAlloc(
109745 sqlite3 *db, /* Handle for sqlite3DbMallocRawNN() */
109746 int op, /* Expression opcode */
109747 const Token *pToken, /* Token argument. Might be NULL */
@@ -109500,11 +109753,11 @@
109753
109754 assert( db!=0 );
109755 if( pToken ){
109756 if( op!=TK_INTEGER || pToken->z==0
109757 || sqlite3GetInt32(pToken->z, &iValue)==0 ){
109758 nExtra = pToken->n+1; /* tag-20240227-a */
109759 assert( iValue>=0 );
109760 }
109761 }
109762 pNew = sqlite3DbMallocRawNN(db, sizeof(Expr)+nExtra);
109763 if( pNew ){
@@ -113182,16 +113435,10 @@
113435 case TK_VARIABLE: {
113436 assert( !ExprHasProperty(pExpr, EP_IntValue) );
113437 assert( pExpr->u.zToken!=0 );
113438 assert( pExpr->u.zToken[0]!=0 );
113439 sqlite3VdbeAddOp2(v, OP_Variable, pExpr->iColumn, target);
 
 
 
 
 
 
113440 return target;
113441 }
113442 case TK_REGISTER: {
113443 return pExpr->iTable;
113444 }
@@ -119190,10 +119437,11 @@
119437
119438 /* No STAT4 data is generated if the number of rows is zero */
119439 if( addrGotoEnd==0 ){
119440 sqlite3VdbeAddOp2(v, OP_Cast, regStat1, SQLITE_AFF_INTEGER);
119441 addrGotoEnd = sqlite3VdbeAddOp1(v, OP_IfNot, regStat1);
119442 VdbeCoverage(v);
119443 }
119444
119445 if( doOnce ){
119446 int mxCol = nCol;
119447 Index *pX;
@@ -129185,17 +129433,17 @@
129433 switch( sqlite3_value_type(pValue) ){
129434 case SQLITE_FLOAT: {
129435 double r1, r2;
129436 const char *zVal;
129437 r1 = sqlite3_value_double(pValue);
129438 sqlite3_str_appendf(pStr, "%!0.15g", r1);
129439 zVal = sqlite3_str_value(pStr);
129440 if( zVal ){
129441 sqlite3AtoF(zVal, &r2, pStr->nChar, SQLITE_UTF8);
129442 if( r1!=r2 ){
129443 sqlite3_str_reset(pStr);
129444 sqlite3_str_appendf(pStr, "%!0.20e", r1);
129445 }
129446 }
129447 break;
129448 }
129449 case SQLITE_INTEGER: {
@@ -133413,11 +133661,11 @@
133661 pNx->pUpsertSrc = pTabList;
133662 pNx->regData = regData;
133663 pNx->iDataCur = iDataCur;
133664 pNx->iIdxCur = iIdxCur;
133665 if( pNx->pUpsertTarget ){
133666 if( sqlite3UpsertAnalyzeTarget(pParse, pTabList, pNx, pUpsert) ){
133667 goto insert_cleanup;
133668 }
133669 }
133670 pNx = pNx->pNextUpsert;
133671 }while( pNx!=0 );
@@ -139670,11 +139918,10 @@
139918 for(i=0; i<db->nDb; i++){
139919 HashElem *x; /* For looping over tables in the schema */
139920 Hash *pTbls; /* Set of all tables in the schema */
139921 int *aRoot; /* Array of root page numbers of all btrees */
139922 int cnt = 0; /* Number of entries in aRoot[] */
 
139923
139924 if( OMIT_TEMPDB && i==1 ) continue;
139925 if( iDb>=0 && i!=iDb ) continue;
139926
139927 sqlite3CodeVerifySchema(pParse, i);
@@ -139692,11 +139939,10 @@
139939 Index *pIdx; /* An index on pTab */
139940 int nIdx; /* Number of indexes on pTab */
139941 if( pObjTab && pObjTab!=pTab ) continue;
139942 if( HasRowid(pTab) ) cnt++;
139943 for(nIdx=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, nIdx++){ cnt++; }
 
139944 }
139945 if( cnt==0 ) continue;
139946 if( pObjTab ) cnt++;
139947 aRoot = sqlite3DbMallocRawNN(db, sizeof(int)*(cnt+1));
139948 if( aRoot==0 ) break;
@@ -139712,23 +139958,53 @@
139958 }
139959 }
139960 aRoot[0] = cnt;
139961
139962 /* Make sure sufficient number of registers have been allocated */
139963 sqlite3TouchRegister(pParse, 8+cnt);
139964 sqlite3ClearTempRegCache(pParse);
139965
139966 /* Do the b-tree integrity checks */
139967 sqlite3VdbeAddOp4(v, OP_IntegrityCk, 1, cnt, 8, (char*)aRoot,P4_INTARRAY);
139968 sqlite3VdbeChangeP5(v, (u8)i);
139969 addr = sqlite3VdbeAddOp1(v, OP_IsNull, 2); VdbeCoverage(v);
139970 sqlite3VdbeAddOp4(v, OP_String8, 0, 3, 0,
139971 sqlite3MPrintf(db, "*** in database %s ***\n", db->aDb[i].zDbSName),
139972 P4_DYNAMIC);
139973 sqlite3VdbeAddOp3(v, OP_Concat, 2, 3, 3);
139974 integrityCheckResultRow(v);
139975 sqlite3VdbeJumpHere(v, addr);
139976
139977 /* Check that the indexes all have the right number of rows */
139978 cnt = pObjTab ? 1 : 0;
139979 sqlite3VdbeLoadString(v, 2, "wrong # of entries in index ");
139980 for(x=sqliteHashFirst(pTbls); x; x=sqliteHashNext(x)){
139981 int iTab = 0;
139982 Table *pTab = sqliteHashData(x);
139983 Index *pIdx;
139984 if( pObjTab && pObjTab!=pTab ) continue;
139985 if( HasRowid(pTab) ){
139986 iTab = cnt++;
139987 }else{
139988 iTab = cnt;
139989 for(pIdx=pTab->pIndex; ALWAYS(pIdx); pIdx=pIdx->pNext){
139990 if( IsPrimaryKeyIndex(pIdx) ) break;
139991 iTab++;
139992 }
139993 }
139994 for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){
139995 if( pIdx->pPartIdxWhere==0 ){
139996 addr = sqlite3VdbeAddOp3(v, OP_Eq, 8+cnt, 0, 8+iTab);
139997 VdbeCoverageNeverNull(v);
139998 sqlite3VdbeLoadString(v, 4, pIdx->zName);
139999 sqlite3VdbeAddOp3(v, OP_Concat, 4, 2, 3);
140000 integrityCheckResultRow(v);
140001 sqlite3VdbeJumpHere(v, addr);
140002 }
140003 cnt++;
140004 }
140005 }
140006
140007 /* Make sure all the indices are constructed correctly.
140008 */
140009 for(x=sqliteHashFirst(pTbls); x; x=sqliteHashNext(x)){
140010 Table *pTab = sqliteHashData(x);
@@ -140049,25 +140325,13 @@
140325 sqlite3ResolvePartIdxLabel(pParse, jmp3);
140326 }
140327 }
140328 sqlite3VdbeAddOp2(v, OP_Next, iDataCur, loopTop); VdbeCoverage(v);
140329 sqlite3VdbeJumpHere(v, loopTop-1);
140330 if( pPk ){
140331 assert( !isQuick );
140332 sqlite3ReleaseTempRange(pParse, r2, pPk->nKeyCol);
 
 
 
 
 
 
 
 
 
 
 
 
140333 }
140334 }
140335
140336 #ifndef SQLITE_OMIT_VIRTUALTABLE
140337 /* Second pass to invoke the xIntegrity method on all virtual
@@ -153828,11 +154092,12 @@
154092 ** is wrong.
154093 */
154094 SQLITE_PRIVATE int sqlite3UpsertAnalyzeTarget(
154095 Parse *pParse, /* The parsing context */
154096 SrcList *pTabList, /* Table into which we are inserting */
154097 Upsert *pUpsert, /* The ON CONFLICT clauses */
154098 Upsert *pAll /* Complete list of all ON CONFLICT clauses */
154099 ){
154100 Table *pTab; /* That table into which we are inserting */
154101 int rc; /* Result code */
154102 int iCursor; /* Cursor used by pTab */
154103 Index *pIdx; /* One of the indexes of pTab */
@@ -153931,10 +154196,18 @@
154196 /* Column ii of the index did not match any term of the conflict target.
154197 ** Continue the search with the next index. */
154198 continue;
154199 }
154200 pUpsert->pUpsertIdx = pIdx;
154201 if( sqlite3UpsertOfIndex(pAll,pIdx)!=pUpsert ){
154202 /* Really this should be an error. The isDup ON CONFLICT clause will
154203 ** never fire. But this problem was not discovered until three years
154204 ** after multi-CONFLICT upsert was added, and so we silently ignore
154205 ** the problem to prevent breaking applications that might actually
154206 ** have redundant ON CONFLICT clauses. */
154207 pUpsert->isDup = 1;
154208 }
154209 break;
154210 }
154211 if( pUpsert->pUpsertIdx==0 ){
154212 char zWhich[16];
154213 if( nClause==0 && pUpsert->pNextUpsert==0 ){
@@ -153957,13 +154230,17 @@
154230 */
154231 SQLITE_PRIVATE int sqlite3UpsertNextIsIPK(Upsert *pUpsert){
154232 Upsert *pNext;
154233 if( NEVER(pUpsert==0) ) return 0;
154234 pNext = pUpsert->pNextUpsert;
154235 while( 1 /*exit-by-return*/ ){
154236 if( pNext==0 ) return 1;
154237 if( pNext->pUpsertTarget==0 ) return 1;
154238 if( pNext->pUpsertIdx==0 ) return 1;
154239 if( !pNext->isDup ) return 0;
154240 pNext = pNext->pNextUpsert;
154241 }
154242 return 0;
154243 }
154244
154245 /*
154246 ** Given the list of ON CONFLICT clauses described by pUpsert, and
@@ -160255,11 +160532,11 @@
160532 if( pIdx->aColExpr==0 ) continue;
160533 for(i=0; i<pIdx->nKeyCol; i++){
160534 if( pIdx->aiColumn[i]!=XN_EXPR ) continue;
160535 assert( pIdx->bHasExpr );
160536 if( sqlite3ExprCompareSkip(pExpr,pIdx->aColExpr->a[i].pExpr,iCur)==0
160537 && !sqlite3ExprIsConstant(pIdx->aColExpr->a[i].pExpr)
160538 ){
160539 aiCurCol[0] = iCur;
160540 aiCurCol[1] = XN_EXPR;
160541 return 1;
160542 }
@@ -164114,11 +164391,13 @@
164391 assert( pNew->u.btree.nBtm==0 );
164392 opMask = WO_EQ|WO_IN|WO_GT|WO_GE|WO_LT|WO_LE|WO_ISNULL|WO_IS;
164393 }
164394 if( pProbe->bUnordered || pProbe->bLowQual ){
164395 if( pProbe->bUnordered ) opMask &= ~(WO_GT|WO_GE|WO_LT|WO_LE);
164396 if( pProbe->bLowQual && pSrc->fg.isIndexedBy==0 ){
164397 opMask &= ~(WO_EQ|WO_IN|WO_IS);
164398 }
164399 }
164400
164401 assert( pNew->u.btree.nEq<pProbe->nColumn );
164402 assert( pNew->u.btree.nEq<pProbe->nKeyCol
164403 || pProbe->idxType!=SQLITE_IDXTYPE_PRIMARYKEY );
@@ -171696,12 +171975,13 @@
171975 #define TK_SELECT_COLUMN 178
171976 #define TK_IF_NULL_ROW 179
171977 #define TK_ASTERISK 180
171978 #define TK_SPAN 181
171979 #define TK_ERROR 182
171980 #define TK_QNUMBER 183
171981 #define TK_SPACE 184
171982 #define TK_ILLEGAL 185
171983 #endif
171984 /**************** End token definitions ***************************************/
171985
171986 /* The next sections is a series of control #defines.
171987 ** various aspects of the generated parser.
@@ -171762,35 +172042,35 @@
172042 #ifndef INTERFACE
172043 # define INTERFACE 1
172044 #endif
172045 /************* Begin control #defines *****************************************/
172046 #define YYCODETYPE unsigned short int
172047 #define YYNOCODE 320
172048 #define YYACTIONTYPE unsigned short int
172049 #define YYWILDCARD 101
172050 #define sqlite3ParserTOKENTYPE Token
172051 typedef union {
172052 int yyinit;
172053 sqlite3ParserTOKENTYPE yy0;
172054 Expr* yy2;
172055 Window* yy3;
172056 Cte* yy79;
172057 int yy92;
172058 With* yy131;
172059 struct TrigEvent yy210;
172060 Upsert* yy258;
172061 Select* yy299;
172062 OnOrUsing yy305;
172063 struct FrameBound yy337;
172064 TriggerStep* yy347;
172065 struct {int value; int mask;} yy367;
172066 SrcList* yy387;
172067 IdList* yy400;
172068 ExprList* yy402;
172069 u8 yy498;
172070 u32 yy527;
172071 const char* yy616;
172072 } YYMINORTYPE;
172073 #ifndef YYSTACKDEPTH
172074 #define YYSTACKDEPTH 100
172075 #endif
172076 #define sqlite3ParserARG_SDECL
@@ -171806,23 +172086,23 @@
172086 #define sqlite3ParserCTX_PARAM ,pParse
172087 #define sqlite3ParserCTX_FETCH Parse *pParse=yypParser->pParse;
172088 #define sqlite3ParserCTX_STORE yypParser->pParse=pParse;
172089 #define YYFALLBACK 1
172090 #define YYNSTATE 579
172091 #define YYNRULE 406
172092 #define YYNRULE_WITH_ACTION 341
172093 #define YYNTOKEN 186
172094 #define YY_MAX_SHIFT 578
172095 #define YY_MIN_SHIFTREDUCE 839
172096 #define YY_MAX_SHIFTREDUCE 1244
172097 #define YY_ERROR_ACTION 1245
172098 #define YY_ACCEPT_ACTION 1246
172099 #define YY_NO_ACTION 1247
172100 #define YY_MIN_REDUCE 1248
172101 #define YY_MAX_REDUCE 1653
172102 #define YY_MIN_DSTRCTR 205
172103 #define YY_MAX_DSTRCTR 317
172104 /************* End control #defines *******************************************/
172105 #define YY_NLOOKAHEAD ((int)(sizeof(yy_lookahead)/sizeof(yy_lookahead[0])))
172106
172107 /* Define the yytestcase() macro to be a no-op if is not already defined
172108 ** otherwise.
@@ -171901,623 +172181,626 @@
172181 ** yy_reduce_ofst[] For each state, the offset into yy_action for
172182 ** shifting non-terminals after a reduce.
172183 ** yy_default[] Default action for each state.
172184 **
172185 *********** Begin parsing tables **********************************************/
172186 #define YY_ACTTAB_COUNT (2114)
172187 static const YYACTIONTYPE yy_action[] = {
172188 /* 0 */ 572, 210, 572, 119, 116, 231, 572, 119, 116, 231,
172189 /* 10 */ 572, 1319, 379, 1298, 410, 566, 566, 566, 572, 411,
172190 /* 20 */ 380, 1319, 1281, 42, 42, 42, 42, 210, 1531, 72,
172191 /* 30 */ 72, 975, 421, 42, 42, 495, 305, 281, 305, 976,
172192 /* 40 */ 399, 72, 72, 126, 127, 81, 1219, 1219, 1055, 1058,
172193 /* 50 */ 1045, 1045, 124, 124, 125, 125, 125, 125, 480, 411,
172194 /* 60 */ 1246, 1, 1, 578, 2, 1250, 554, 119, 116, 231,
172195 /* 70 */ 319, 484, 147, 484, 528, 119, 116, 231, 533, 1332,
172196 /* 80 */ 419, 527, 143, 126, 127, 81, 1219, 1219, 1055, 1058,
172197 /* 90 */ 1045, 1045, 124, 124, 125, 125, 125, 125, 119, 116,
172198 /* 100 */ 231, 329, 123, 123, 123, 123, 122, 122, 121, 121,
172199 /* 110 */ 121, 120, 117, 448, 286, 286, 286, 286, 446, 446,
172200 /* 120 */ 446, 1570, 378, 1572, 1195, 377, 1165, 569, 1165, 569,
172201 /* 130 */ 411, 1570, 541, 261, 228, 448, 102, 146, 453, 318,
172202 /* 140 */ 563, 242, 123, 123, 123, 123, 122, 122, 121, 121,
172203 /* 150 */ 121, 120, 117, 448, 126, 127, 81, 1219, 1219, 1055,
172204 /* 160 */ 1058, 1045, 1045, 124, 124, 125, 125, 125, 125, 143,
172205 /* 170 */ 296, 1195, 341, 452, 121, 121, 121, 120, 117, 448,
172206 /* 180 */ 128, 1195, 1196, 1195, 149, 445, 444, 572, 120, 117,
172207 /* 190 */ 448, 125, 125, 125, 125, 118, 123, 123, 123, 123,
172208 /* 200 */ 122, 122, 121, 121, 121, 120, 117, 448, 458, 1284,
172209 /* 210 */ 13, 13, 130, 123, 123, 123, 123, 122, 122, 121,
172210 /* 220 */ 121, 121, 120, 117, 448, 424, 318, 563, 1195, 1196,
172211 /* 230 */ 1195, 162, 1227, 411, 1227, 125, 125, 125, 125, 123,
172212 /* 240 */ 123, 123, 123, 122, 122, 121, 121, 121, 120, 117,
172213 /* 250 */ 448, 469, 344, 1042, 1042, 1056, 1059, 126, 127, 81,
172214 /* 260 */ 1219, 1219, 1055, 1058, 1045, 1045, 124, 124, 125, 125,
172215 /* 270 */ 125, 125, 1102, 1102, 492, 1195, 572, 411, 226, 519,
172216 /* 280 */ 177, 83, 84, 123, 123, 123, 123, 122, 122, 121,
172217 /* 290 */ 121, 121, 120, 117, 448, 1011, 408, 407, 1195, 72,
172218 /* 300 */ 72, 126, 127, 81, 1219, 1219, 1055, 1058, 1045, 1045,
172219 /* 310 */ 124, 124, 125, 125, 125, 125, 123, 123, 123, 123,
172220 /* 320 */ 122, 122, 121, 121, 121, 120, 117, 448, 1046, 1615,
172221 /* 330 */ 1195, 905, 1195, 1196, 1195, 254, 314, 401, 508, 505,
172222 /* 340 */ 504, 112, 564, 570, 4, 930, 930, 435, 503, 342,
172223 /* 350 */ 464, 330, 362, 517, 327, 1195, 1196, 1195, 567, 572,
172224 /* 360 */ 123, 123, 123, 123, 122, 122, 121, 121, 121, 120,
172225 /* 370 */ 117, 448, 286, 286, 844, 845, 846, 445, 444, 1198,
172226 /* 380 */ 411, 449, 72, 72, 12, 569, 1224, 1195, 1196, 1195,
172227 /* 390 */ 86, 1226, 273, 561, 1440, 520, 520, 572, 375, 1225,
172228 /* 400 */ 6, 1283, 476, 143, 126, 127, 81, 1219, 1219, 1055,
172229 /* 410 */ 1058, 1045, 1045, 124, 124, 125, 125, 125, 125, 554,
172230 /* 420 */ 13, 13, 1032, 511, 1227, 1195, 1227, 553, 110, 110,
172231 /* 430 */ 224, 572, 371, 1583, 572, 429, 111, 1198, 449, 573,
172232 /* 440 */ 449, 432, 375, 1020, 1495, 555, 155, 272, 289, 370,
172233 /* 450 */ 514, 365, 513, 259, 72, 72, 547, 72, 72, 361,
172234 /* 460 */ 318, 563, 485, 123, 123, 123, 123, 122, 122, 121,
172235 /* 470 */ 121, 121, 120, 117, 448, 1020, 1020, 1022, 1023, 28,
172236 /* 480 */ 286, 286, 1195, 1196, 1195, 1160, 1616, 210, 411, 1610,
172237 /* 490 */ 158, 554, 358, 569, 554, 390, 537, 1291, 1160, 437,
172238 /* 500 */ 404, 1160, 556, 1565, 572, 1179, 572, 6, 9, 1557,
172239 /* 510 */ 264, 216, 126, 127, 81, 1219, 1219, 1055, 1058, 1045,
172240 /* 520 */ 1045, 124, 124, 125, 125, 125, 125, 13, 13, 13,
172241 /* 530 */ 13, 411, 577, 254, 1250, 509, 508, 505, 504, 319,
172242 /* 540 */ 224, 147, 431, 1011, 304, 1215, 503, 219, 1332, 1324,
172243 /* 550 */ 1324, 143, 375, 1557, 536, 126, 127, 81, 1219, 1219,
172244 /* 560 */ 1055, 1058, 1045, 1045, 124, 124, 125, 125, 125, 125,
172245 /* 570 */ 1559, 123, 123, 123, 123, 122, 122, 121, 121, 121,
172246 /* 580 */ 120, 117, 448, 286, 286, 122, 122, 121, 121, 121,
172247 /* 590 */ 120, 117, 448, 1586, 1195, 177, 569, 342, 1195, 386,
172248 /* 600 */ 154, 382, 411, 1215, 571, 547, 880, 192, 318, 563,
172249 /* 610 */ 242, 193, 1322, 1322, 123, 123, 123, 123, 122, 122,
172250 /* 620 */ 121, 121, 121, 120, 117, 448, 126, 127, 81, 1219,
172251 /* 630 */ 1219, 1055, 1058, 1045, 1045, 124, 124, 125, 125, 125,
172252 /* 640 */ 125, 411, 452, 941, 1195, 873, 1272, 376, 1195, 1272,
172253 /* 650 */ 856, 1195, 1196, 1195, 421, 1195, 1196, 1195, 1270, 574,
172254 /* 660 */ 572, 574, 33, 1557, 99, 126, 127, 81, 1219, 1219,
172255 /* 670 */ 1055, 1058, 1045, 1045, 124, 124, 125, 125, 125, 125,
172256 /* 680 */ 1355, 415, 963, 13, 13, 123, 123, 123, 123, 122,
172257 /* 690 */ 122, 121, 121, 121, 120, 117, 448, 526, 436, 1195,
172258 /* 700 */ 421, 1195, 1196, 1195, 1195, 1195, 1196, 1195, 1195, 467,
172259 /* 710 */ 545, 545, 411, 375, 373, 6, 1178, 5, 548, 548,
172260 /* 720 */ 16, 16, 3, 208, 123, 123, 123, 123, 122, 122,
172261 /* 730 */ 121, 121, 121, 120, 117, 448, 126, 127, 81, 1219,
172262 /* 740 */ 1219, 1055, 1058, 1045, 1045, 124, 124, 125, 125, 125,
172263 /* 750 */ 125, 411, 1077, 430, 1195, 1033, 1195, 1196, 1195, 1195,
172264 /* 760 */ 532, 1195, 1196, 1195, 489, 1195, 1196, 1195, 486, 209,
172265 /* 770 */ 572, 375, 229, 1647, 397, 126, 127, 81, 1219, 1219,
172266 /* 780 */ 1055, 1058, 1045, 1045, 124, 124, 125, 125, 125, 125,
172267 /* 790 */ 1487, 572, 962, 13, 13, 123, 123, 123, 123, 122,
172268 /* 800 */ 122, 121, 121, 121, 120, 117, 448, 1424, 202, 572,
172269 /* 810 */ 384, 1195, 1196, 1195, 13, 13, 1195, 1196, 1195, 156,
172270 /* 820 */ 199, 459, 411, 283, 1558, 961, 1016, 1541, 292, 203,
172271 /* 830 */ 301, 896, 72, 72, 123, 123, 123, 123, 122, 122,
172272 /* 840 */ 121, 121, 121, 120, 117, 448, 126, 127, 81, 1219,
172273 /* 850 */ 1219, 1055, 1058, 1045, 1045, 124, 124, 125, 125, 125,
172274 /* 860 */ 125, 411, 512, 286, 286, 286, 286, 280, 280, 315,
172275 /* 870 */ 897, 287, 287, 461, 101, 98, 569, 426, 569, 572,
172276 /* 880 */ 569, 288, 1557, 409, 569, 126, 127, 81, 1219, 1219,
172277 /* 890 */ 1055, 1058, 1045, 1045, 124, 124, 125, 125, 125, 125,
172278 /* 900 */ 572, 12, 13, 13, 531, 123, 123, 123, 123, 122,
172279 /* 910 */ 122, 121, 121, 121, 120, 117, 448, 549, 230, 1590,
172280 /* 920 */ 578, 2, 1250, 71, 71, 1160, 433, 319, 356, 147,
172281 /* 930 */ 495, 1563, 411, 318, 563, 6, 1332, 1543, 1160, 1357,
172282 /* 940 */ 313, 1160, 1330, 961, 123, 123, 123, 123, 122, 122,
172283 /* 950 */ 121, 121, 121, 120, 117, 448, 126, 127, 81, 1219,
172284 /* 960 */ 1219, 1055, 1058, 1045, 1045, 124, 124, 125, 125, 125,
172285 /* 970 */ 125, 286, 286, 572, 205, 1530, 411, 286, 286, 468,
172286 /* 980 */ 257, 256, 255, 1097, 569, 385, 495, 876, 529, 351,
172287 /* 990 */ 569, 354, 1141, 1645, 1302, 1645, 72, 72, 242, 1268,
172288 /* 1000 */ 1604, 105, 81, 1219, 1219, 1055, 1058, 1045, 1045, 124,
172289 /* 1010 */ 124, 125, 125, 125, 125, 123, 123, 123, 123, 122,
172290 /* 1020 */ 122, 121, 121, 121, 120, 117, 448, 572, 1032, 572,
172291 /* 1030 */ 452, 1494, 572, 443, 286, 286, 1141, 1646, 1424, 1646,
172292 /* 1040 */ 521, 495, 523, 1118, 876, 1021, 334, 569, 495, 1020,
172293 /* 1050 */ 72, 72, 52, 52, 101, 134, 134, 1439, 1119, 123,
172294 /* 1060 */ 123, 123, 123, 122, 122, 121, 121, 121, 120, 117,
172295 /* 1070 */ 448, 1139, 108, 1120, 936, 286, 286, 286, 286, 935,
172296 /* 1080 */ 457, 1020, 1020, 1022, 98, 530, 1331, 447, 569, 522,
172297 /* 1090 */ 569, 484, 411, 1327, 916, 371, 1583, 211, 457, 456,
172298 /* 1100 */ 469, 344, 460, 109, 917, 107, 460, 331, 427, 333,
172299 /* 1110 */ 572, 1179, 411, 531, 1438, 1139, 126, 127, 81, 1219,
172300 /* 1120 */ 1219, 1055, 1058, 1045, 1045, 124, 124, 125, 125, 125,
172301 /* 1130 */ 125, 1564, 411, 136, 136, 6, 126, 127, 81, 1219,
172302 /* 1140 */ 1219, 1055, 1058, 1045, 1045, 124, 124, 125, 125, 125,
172303 /* 1150 */ 125, 152, 371, 1583, 1500, 887, 126, 115, 81, 1219,
172304 /* 1160 */ 1219, 1055, 1058, 1045, 1045, 124, 124, 125, 125, 125,
172305 /* 1170 */ 125, 457, 1500, 1502, 478, 123, 123, 123, 123, 122,
172306 /* 1180 */ 122, 121, 121, 121, 120, 117, 448, 500, 868, 1214,
172307 /* 1190 */ 303, 332, 454, 557, 1160, 123, 123, 123, 123, 122,
172308 /* 1200 */ 122, 121, 121, 121, 120, 117, 448, 1160, 1562, 572,
172309 /* 1210 */ 1160, 543, 6, 572, 258, 123, 123, 123, 123, 122,
172310 /* 1220 */ 122, 121, 121, 121, 120, 117, 448, 1032, 286, 286,
172311 /* 1230 */ 542, 572, 56, 56, 1561, 411, 57, 57, 6, 1171,
172312 /* 1240 */ 474, 569, 478, 295, 1021, 1500, 868, 295, 1020, 294,
172313 /* 1250 */ 495, 264, 1099, 572, 15, 15, 1099, 1195, 396, 1240,
172314 /* 1260 */ 127, 81, 1219, 1219, 1055, 1058, 1045, 1045, 124, 124,
172315 /* 1270 */ 125, 125, 125, 125, 1160, 218, 44, 44, 572, 1118,
172316 /* 1280 */ 1020, 1020, 1022, 416, 572, 544, 1215, 1160, 490, 572,
172317 /* 1290 */ 1160, 1171, 1424, 373, 1119, 349, 478, 1539, 529, 361,
172318 /* 1300 */ 322, 58, 58, 235, 516, 478, 219, 45, 45, 1120,
172319 /* 1310 */ 1179, 572, 59, 59, 1195, 1196, 1195, 297, 123, 123,
172320 /* 1320 */ 123, 123, 122, 122, 121, 121, 121, 120, 117, 448,
172321 /* 1330 */ 560, 936, 440, 572, 60, 60, 935, 1241, 112, 564,
172322 /* 1340 */ 572, 4, 572, 535, 1215, 572, 1424, 1424, 1235, 572,
172323 /* 1350 */ 961, 396, 1140, 572, 31, 567, 61, 61, 112, 564,
172324 /* 1360 */ 572, 4, 428, 62, 62, 63, 63, 8, 46, 46,
172325 /* 1370 */ 572, 300, 47, 47, 17, 567, 48, 48, 449, 572,
172326 /* 1380 */ 302, 975, 572, 50, 50, 32, 1273, 417, 572, 976,
172327 /* 1390 */ 561, 572, 258, 51, 51, 530, 883, 572, 449, 572,
172328 /* 1400 */ 565, 417, 64, 64, 539, 65, 65, 323, 572, 538,
172329 /* 1410 */ 561, 66, 66, 422, 14, 14, 491, 441, 572, 1032,
172330 /* 1420 */ 67, 67, 132, 132, 539, 110, 110, 326, 550, 540,
172331 /* 1430 */ 1241, 133, 133, 111, 462, 449, 573, 449, 482, 1032,
172332 /* 1440 */ 1020, 68, 68, 230, 409, 110, 110, 150, 114, 112,
172333 /* 1450 */ 564, 1336, 4, 111, 883, 449, 573, 449, 572, 239,
172334 /* 1460 */ 1020, 416, 572, 569, 572, 1369, 567, 572, 961, 318,
172335 /* 1470 */ 563, 525, 1020, 1020, 1022, 1023, 28, 1301, 418, 179,
172336 /* 1480 */ 1368, 53, 53, 285, 228, 69, 69, 70, 70, 449,
172337 /* 1490 */ 54, 54, 1020, 1020, 1022, 1023, 28, 87, 215, 290,
172338 /* 1500 */ 471, 561, 1179, 475, 394, 394, 393, 275, 391, 572,
172339 /* 1510 */ 409, 853, 153, 409, 39, 539, 572, 317, 470, 1136,
172340 /* 1520 */ 538, 398, 1179, 291, 236, 1300, 325, 409, 463, 572,
172341 /* 1530 */ 1032, 201, 165, 165, 324, 483, 110, 110, 572, 166,
172342 /* 1540 */ 166, 339, 112, 564, 111, 4, 449, 573, 449, 1145,
172343 /* 1550 */ 572, 1020, 77, 77, 572, 1546, 572, 321, 472, 567,
172344 /* 1560 */ 335, 55, 55, 340, 238, 101, 1519, 1013, 550, 263,
172345 /* 1570 */ 895, 894, 170, 73, 73, 142, 241, 135, 135, 74,
172346 /* 1580 */ 74, 298, 449, 1020, 1020, 1022, 1023, 28, 1589, 1183,
172347 /* 1590 */ 451, 1518, 237, 290, 561, 161, 1084, 101, 394, 394,
172348 /* 1600 */ 393, 275, 391, 487, 477, 853, 263, 479, 345, 263,
172349 /* 1610 */ 101, 346, 501, 1179, 260, 902, 903, 559, 236, 572,
172350 /* 1620 */ 325, 112, 564, 1032, 4, 369, 572, 412, 324, 110,
172351 /* 1630 */ 110, 940, 318, 563, 1024, 368, 572, 111, 567, 449,
172352 /* 1640 */ 573, 449, 163, 163, 1020, 1365, 359, 572, 101, 137,
172353 /* 1650 */ 137, 572, 350, 1080, 1084, 260, 455, 353, 238, 131,
172354 /* 1660 */ 131, 449, 966, 933, 263, 114, 170, 572, 355, 142,
172355 /* 1670 */ 164, 164, 1299, 561, 157, 157, 1020, 1020, 1022, 1023,
172356 /* 1680 */ 28, 572, 978, 979, 1577, 866, 237, 151, 496, 572,
172357 /* 1690 */ 141, 141, 1024, 80, 564, 1096, 4, 1096, 1095, 357,
172358 /* 1700 */ 1095, 572, 1032, 1315, 140, 140, 1179, 364, 110, 110,
172359 /* 1710 */ 567, 572, 138, 138, 374, 572, 111, 1348, 449, 573,
172360 /* 1720 */ 449, 412, 1378, 1020, 139, 139, 318, 563, 572, 934,
172361 /* 1730 */ 1423, 114, 1351, 449, 76, 76, 278, 572, 78, 78,
172362 /* 1740 */ 572, 1363, 552, 558, 1428, 561, 1280, 1271, 1259, 1258,
172363 /* 1750 */ 455, 75, 75, 1260, 1597, 1020, 1020, 1022, 1023, 28,
172364 /* 1760 */ 43, 43, 213, 49, 49, 395, 310, 311, 312, 11,
172365 /* 1770 */ 234, 221, 1410, 293, 1032, 337, 1405, 338, 1415, 299,
172366 /* 1780 */ 110, 110, 1398, 481, 506, 1179, 367, 1414, 111, 1491,
172367 /* 1790 */ 449, 573, 449, 1183, 451, 1020, 402, 290, 225, 1490,
172368 /* 1800 */ 1298, 1360, 394, 394, 393, 275, 391, 343, 1361, 853,
172369 /* 1810 */ 562, 1359, 206, 389, 551, 207, 1600, 1358, 1235, 267,
172370 /* 1820 */ 220, 1538, 236, 1536, 325, 1232, 82, 1020, 1020, 1022,
172371 /* 1830 */ 1023, 28, 324, 181, 420, 86, 217, 232, 190, 175,
172372 /* 1840 */ 183, 465, 185, 466, 1411, 186, 244, 112, 564, 36,
172373 /* 1850 */ 4, 187, 188, 85, 1496, 499, 99, 1179, 400, 1417,
172374 /* 1860 */ 1416, 37, 238, 473, 567, 403, 1419, 194, 1485, 488,
172375 /* 1870 */ 170, 248, 92, 142, 1507, 494, 279, 250, 198, 497,
172376 /* 1880 */ 352, 348, 251, 405, 1261, 252, 515, 449, 1318, 1317,
172377 /* 1890 */ 237, 1316, 1309, 434, 94, 887, 226, 438, 1614, 561,
172378 /* 1900 */ 1288, 1613, 406, 524, 439, 1582, 265, 366, 1287, 1286,
172379 /* 1910 */ 1612, 308, 309, 266, 372, 442, 1568, 1308, 1567, 1383,
172380 /* 1920 */ 1382, 129, 550, 10, 383, 412, 1472, 316, 1032, 100,
172381 /* 1930 */ 318, 563, 106, 35, 110, 110, 534, 575, 1189, 274,
172382 /* 1940 */ 276, 388, 111, 381, 449, 573, 449, 1341, 1340, 1020,
172383 /* 1950 */ 212, 387, 277, 576, 455, 1256, 1251, 167, 148, 413,
172384 /* 1960 */ 414, 180, 1523, 168, 1524, 1522, 1521, 840, 222, 306,
172385 /* 1970 */ 450, 223, 169, 79, 214, 320, 233, 1094, 145, 1092,
172386 /* 1980 */ 328, 1020, 1020, 1022, 1023, 28, 182, 171, 184, 1214,
172387 /* 1990 */ 240, 919, 243, 336, 1108, 189, 172, 173, 423, 174,
172388 /* 2000 */ 191, 88, 425, 89, 90, 1111, 91, 245, 1107, 246,
172389 /* 2010 */ 159, 1179, 18, 247, 263, 347, 1229, 1100, 249, 493,
172390 /* 2020 */ 196, 38, 855, 195, 368, 498, 197, 253, 510, 885,
172391 /* 2030 */ 93, 19, 176, 360, 20, 502, 507, 363, 95, 898,
172392 /* 2040 */ 160, 307, 518, 96, 1176, 1061, 1147, 40, 21, 97,
172393 /* 2050 */ 227, 282, 284, 262, 1146, 970, 200, 964, 114, 1166,
172394 /* 2060 */ 22, 23, 1164, 1162, 24, 25, 1170, 1151, 34, 26,
172395 /* 2070 */ 204, 546, 1169, 101, 27, 103, 7, 104, 1075, 1062,
172396 /* 2080 */ 1060, 1064, 1117, 1065, 1116, 268, 269, 29, 41, 1185,
172397 /* 2090 */ 1025, 867, 113, 30, 568, 929, 392, 144, 178, 270,
172398 /* 2100 */ 271, 1184, 1247, 1247, 1247, 1247, 1247, 1247, 1247, 1247,
172399 /* 2110 */ 1247, 1247, 1247, 1605,
172400 };
172401 static const YYCODETYPE yy_lookahead[] = {
172402 /* 0 */ 194, 194, 194, 275, 276, 277, 194, 275, 276, 277,
172403 /* 10 */ 194, 224, 220, 226, 207, 211, 212, 213, 194, 19,
172404 /* 20 */ 220, 234, 217, 217, 218, 217, 218, 194, 296, 217,
172405 /* 30 */ 218, 31, 194, 217, 218, 194, 229, 214, 231, 39,
172406 /* 40 */ 207, 217, 218, 43, 44, 45, 46, 47, 48, 49,
172407 /* 50 */ 50, 51, 52, 53, 54, 55, 56, 57, 194, 19,
172408 /* 60 */ 186, 187, 188, 189, 190, 191, 254, 275, 276, 277,
172409 /* 70 */ 196, 194, 198, 194, 262, 275, 276, 277, 254, 205,
172410 /* 80 */ 239, 205, 81, 43, 44, 45, 46, 47, 48, 49,
172411 /* 90 */ 50, 51, 52, 53, 54, 55, 56, 57, 275, 276,
172412 /* 100 */ 277, 263, 102, 103, 104, 105, 106, 107, 108, 109,
172413 /* 110 */ 110, 111, 112, 113, 240, 241, 240, 241, 211, 212,
172414 /* 120 */ 213, 315, 316, 315, 59, 317, 86, 253, 88, 253,
172415 /* 130 */ 19, 315, 316, 257, 258, 113, 25, 72, 297, 138,
172416 /* 140 */ 139, 267, 102, 103, 104, 105, 106, 107, 108, 109,
172417 /* 150 */ 110, 111, 112, 113, 43, 44, 45, 46, 47, 48,
172418 /* 160 */ 49, 50, 51, 52, 53, 54, 55, 56, 57, 81,
172419 /* 170 */ 293, 59, 293, 299, 108, 109, 110, 111, 112, 113,
172420 /* 180 */ 69, 116, 117, 118, 72, 106, 107, 194, 111, 112,
172421 /* 190 */ 113, 54, 55, 56, 57, 58, 102, 103, 104, 105,
172422 /* 200 */ 106, 107, 108, 109, 110, 111, 112, 113, 120, 217,
172423 /* 210 */ 217, 218, 22, 102, 103, 104, 105, 106, 107, 108,
172424 /* 220 */ 109, 110, 111, 112, 113, 232, 138, 139, 116, 117,
172425 /* 230 */ 118, 23, 153, 19, 155, 54, 55, 56, 57, 102,
172426 /* 240 */ 103, 104, 105, 106, 107, 108, 109, 110, 111, 112,
172427 /* 250 */ 113, 128, 129, 46, 47, 48, 49, 43, 44, 45,
172428 /* 260 */ 46, 47, 48, 49, 50, 51, 52, 53, 54, 55,
172429 /* 270 */ 56, 57, 127, 128, 129, 59, 194, 19, 165, 166,
172430 /* 280 */ 194, 67, 24, 102, 103, 104, 105, 106, 107, 108,
172431 /* 290 */ 109, 110, 111, 112, 113, 73, 106, 107, 59, 217,
172432 /* 300 */ 218, 43, 44, 45, 46, 47, 48, 49, 50, 51,
172433 /* 310 */ 52, 53, 54, 55, 56, 57, 102, 103, 104, 105,
172434 /* 320 */ 106, 107, 108, 109, 110, 111, 112, 113, 121, 23,
172435 /* 330 */ 59, 25, 116, 117, 118, 119, 254, 205, 122, 123,
172436 /* 340 */ 124, 19, 20, 134, 22, 136, 137, 19, 132, 127,
172437 /* 350 */ 128, 129, 24, 145, 194, 116, 117, 118, 36, 194,
172438 /* 360 */ 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
172439 /* 370 */ 112, 113, 240, 241, 7, 8, 9, 106, 107, 59,
172440 /* 380 */ 19, 59, 217, 218, 214, 253, 115, 116, 117, 118,
172441 /* 390 */ 151, 120, 26, 71, 274, 309, 310, 194, 194, 128,
172442 /* 400 */ 314, 217, 270, 81, 43, 44, 45, 46, 47, 48,
172443 /* 410 */ 49, 50, 51, 52, 53, 54, 55, 56, 57, 254,
172444 /* 420 */ 217, 218, 100, 95, 153, 59, 155, 262, 106, 107,
172445 /* 430 */ 25, 194, 312, 313, 194, 232, 114, 117, 116, 117,
172446 /* 440 */ 118, 113, 194, 121, 284, 205, 242, 119, 120, 121,
172447 /* 450 */ 122, 123, 124, 125, 217, 218, 194, 217, 218, 131,
172448 /* 460 */ 138, 139, 292, 102, 103, 104, 105, 106, 107, 108,
172449 /* 470 */ 109, 110, 111, 112, 113, 153, 154, 155, 156, 157,
172450 /* 480 */ 240, 241, 116, 117, 118, 76, 231, 194, 19, 216,
172451 /* 490 */ 242, 254, 23, 253, 254, 202, 87, 224, 89, 262,
172452 /* 500 */ 207, 92, 262, 310, 194, 183, 194, 314, 22, 305,
172453 /* 510 */ 24, 150, 43, 44, 45, 46, 47, 48, 49, 50,
172454 /* 520 */ 51, 52, 53, 54, 55, 56, 57, 217, 218, 217,
172455 /* 530 */ 218, 19, 189, 119, 191, 23, 122, 123, 124, 196,
172456 /* 540 */ 25, 198, 232, 73, 232, 59, 132, 142, 205, 236,
172457 /* 550 */ 237, 81, 194, 305, 145, 43, 44, 45, 46, 47,
172458 /* 560 */ 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
172459 /* 570 */ 308, 102, 103, 104, 105, 106, 107, 108, 109, 110,
172460 /* 580 */ 111, 112, 113, 240, 241, 106, 107, 108, 109, 110,
172461 /* 590 */ 111, 112, 113, 194, 59, 194, 253, 127, 59, 250,
172462 /* 600 */ 242, 252, 19, 117, 194, 194, 23, 22, 138, 139,
172463 /* 610 */ 267, 22, 236, 237, 102, 103, 104, 105, 106, 107,
172464 /* 620 */ 108, 109, 110, 111, 112, 113, 43, 44, 45, 46,
172465 /* 630 */ 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
172466 /* 640 */ 57, 19, 299, 108, 59, 23, 194, 194, 59, 194,
172467 /* 650 */ 21, 116, 117, 118, 194, 116, 117, 118, 206, 204,
172468 /* 660 */ 194, 206, 22, 305, 149, 43, 44, 45, 46, 47,
172469 /* 670 */ 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
172470 /* 680 */ 259, 199, 143, 217, 218, 102, 103, 104, 105, 106,
172471 /* 690 */ 107, 108, 109, 110, 111, 112, 113, 194, 232, 59,
172472 /* 700 */ 194, 116, 117, 118, 59, 116, 117, 118, 59, 80,
172473 /* 710 */ 309, 310, 19, 194, 194, 314, 23, 22, 307, 308,
172474 /* 720 */ 217, 218, 22, 263, 102, 103, 104, 105, 106, 107,
172475 /* 730 */ 108, 109, 110, 111, 112, 113, 43, 44, 45, 46,
172476 /* 740 */ 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
172477 /* 750 */ 57, 19, 123, 233, 59, 23, 116, 117, 118, 59,
172478 /* 760 */ 194, 116, 117, 118, 282, 116, 117, 118, 286, 263,
172479 /* 770 */ 194, 194, 194, 302, 303, 43, 44, 45, 46, 47,
172480 /* 780 */ 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
172481 /* 790 */ 161, 194, 143, 217, 218, 102, 103, 104, 105, 106,
172482 /* 800 */ 107, 108, 109, 110, 111, 112, 113, 194, 232, 194,
172483 /* 810 */ 194, 116, 117, 118, 217, 218, 116, 117, 118, 242,
172484 /* 820 */ 25, 270, 19, 23, 305, 25, 23, 194, 205, 232,
172485 /* 830 */ 205, 35, 217, 218, 102, 103, 104, 105, 106, 107,
172486 /* 840 */ 108, 109, 110, 111, 112, 113, 43, 44, 45, 46,
172487 /* 850 */ 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
172488 /* 860 */ 57, 19, 66, 240, 241, 240, 241, 240, 241, 254,
172489 /* 870 */ 74, 240, 241, 245, 25, 115, 253, 264, 253, 194,
172490 /* 880 */ 253, 22, 305, 255, 253, 43, 44, 45, 46, 47,
172491 /* 890 */ 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
172492 /* 900 */ 194, 214, 217, 218, 144, 102, 103, 104, 105, 106,
172493 /* 910 */ 107, 108, 109, 110, 111, 112, 113, 232, 118, 188,
172494 /* 920 */ 189, 190, 191, 217, 218, 76, 130, 196, 16, 198,
172495 /* 930 */ 194, 310, 19, 138, 139, 314, 205, 194, 89, 260,
172496 /* 940 */ 261, 92, 205, 143, 102, 103, 104, 105, 106, 107,
172497 /* 950 */ 108, 109, 110, 111, 112, 113, 43, 44, 45, 46,
172498 /* 960 */ 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
172499 /* 970 */ 57, 240, 241, 194, 287, 239, 19, 240, 241, 292,
172500 /* 980 */ 127, 128, 129, 11, 253, 279, 194, 59, 19, 77,
172501 /* 990 */ 253, 79, 22, 23, 227, 25, 217, 218, 267, 205,
172502 /* 1000 */ 141, 159, 45, 46, 47, 48, 49, 50, 51, 52,
172503 /* 1010 */ 53, 54, 55, 56, 57, 102, 103, 104, 105, 106,
172504 /* 1020 */ 107, 108, 109, 110, 111, 112, 113, 194, 100, 194,
172505 /* 1030 */ 299, 239, 194, 254, 240, 241, 22, 23, 194, 25,
172506 /* 1040 */ 205, 194, 205, 12, 116, 117, 16, 253, 194, 121,
172507 /* 1050 */ 217, 218, 217, 218, 25, 217, 218, 274, 27, 102,
172508 /* 1060 */ 103, 104, 105, 106, 107, 108, 109, 110, 111, 112,
172509 /* 1070 */ 113, 101, 159, 42, 135, 240, 241, 240, 241, 140,
172510 /* 1080 */ 194, 153, 154, 155, 115, 116, 239, 254, 253, 254,
172511 /* 1090 */ 253, 194, 19, 239, 63, 312, 313, 24, 212, 213,
172512 /* 1100 */ 128, 129, 261, 158, 73, 160, 265, 77, 264, 79,
172513 /* 1110 */ 194, 183, 19, 144, 274, 101, 43, 44, 45, 46,
172514 /* 1120 */ 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
172515 /* 1130 */ 57, 310, 19, 217, 218, 314, 43, 44, 45, 46,
172516 /* 1140 */ 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
172517 /* 1150 */ 57, 22, 312, 313, 194, 126, 43, 44, 45, 46,
172518 /* 1160 */ 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
172519 /* 1170 */ 57, 285, 212, 213, 194, 102, 103, 104, 105, 106,
172520 /* 1180 */ 107, 108, 109, 110, 111, 112, 113, 19, 59, 25,
172521 /* 1190 */ 293, 161, 194, 205, 76, 102, 103, 104, 105, 106,
172522 /* 1200 */ 107, 108, 109, 110, 111, 112, 113, 89, 310, 194,
172523 /* 1210 */ 92, 66, 314, 194, 46, 102, 103, 104, 105, 106,
172524 /* 1220 */ 107, 108, 109, 110, 111, 112, 113, 100, 240, 241,
172525 /* 1230 */ 85, 194, 217, 218, 310, 19, 217, 218, 314, 94,
172526 /* 1240 */ 115, 253, 194, 261, 117, 285, 117, 265, 121, 269,
172527 /* 1250 */ 194, 24, 29, 194, 217, 218, 33, 59, 22, 23,
172528 /* 1260 */ 44, 45, 46, 47, 48, 49, 50, 51, 52, 53,
172529 /* 1270 */ 54, 55, 56, 57, 76, 150, 217, 218, 194, 12,
172530 /* 1280 */ 153, 154, 155, 115, 194, 87, 59, 89, 65, 194,
172531 /* 1290 */ 92, 146, 194, 194, 27, 239, 194, 194, 19, 131,
172532 /* 1300 */ 194, 217, 218, 15, 108, 194, 142, 217, 218, 42,
172533 /* 1310 */ 183, 194, 217, 218, 116, 117, 118, 269, 102, 103,
172534 /* 1320 */ 104, 105, 106, 107, 108, 109, 110, 111, 112, 113,
172535 /* 1330 */ 63, 135, 233, 194, 217, 218, 140, 101, 19, 20,
172536 /* 1340 */ 194, 22, 194, 145, 117, 194, 194, 194, 60, 194,
172537 /* 1350 */ 25, 22, 23, 194, 22, 36, 217, 218, 19, 20,
172538 /* 1360 */ 194, 22, 264, 217, 218, 217, 218, 48, 217, 218,
172539 /* 1370 */ 194, 269, 217, 218, 22, 36, 217, 218, 59, 194,
172540 /* 1380 */ 269, 31, 194, 217, 218, 53, 209, 210, 194, 39,
172541 /* 1390 */ 71, 194, 46, 217, 218, 116, 59, 194, 59, 194,
172542 /* 1400 */ 209, 210, 217, 218, 85, 217, 218, 194, 194, 90,
172543 /* 1410 */ 71, 217, 218, 61, 217, 218, 264, 264, 194, 100,
172544 /* 1420 */ 217, 218, 217, 218, 85, 106, 107, 194, 145, 90,
172545 /* 1430 */ 101, 217, 218, 114, 245, 116, 117, 118, 19, 100,
172546 /* 1440 */ 121, 217, 218, 118, 255, 106, 107, 164, 25, 19,
172547 /* 1450 */ 20, 241, 22, 114, 117, 116, 117, 118, 194, 24,
172548 /* 1460 */ 121, 115, 194, 253, 194, 194, 36, 194, 143, 138,
172549 /* 1470 */ 139, 19, 153, 154, 155, 156, 157, 227, 300, 301,
172550 /* 1480 */ 194, 217, 218, 257, 258, 217, 218, 217, 218, 59,
172551 /* 1490 */ 217, 218, 153, 154, 155, 156, 157, 149, 150, 5,
172552 /* 1500 */ 245, 71, 183, 245, 10, 11, 12, 13, 14, 194,
172553 /* 1510 */ 255, 17, 22, 255, 24, 85, 194, 245, 129, 23,
172554 /* 1520 */ 90, 25, 183, 99, 30, 227, 32, 255, 194, 194,
172555 /* 1530 */ 100, 256, 217, 218, 40, 116, 106, 107, 194, 217,
172556 /* 1540 */ 218, 152, 19, 20, 114, 22, 116, 117, 118, 97,
172557 /* 1550 */ 194, 121, 217, 218, 194, 194, 194, 133, 129, 36,
172558 /* 1560 */ 194, 217, 218, 23, 70, 25, 194, 23, 145, 25,
172559 /* 1570 */ 120, 121, 78, 217, 218, 81, 141, 217, 218, 217,
172560 /* 1580 */ 218, 152, 59, 153, 154, 155, 156, 157, 0, 1,
172561 /* 1590 */ 2, 194, 98, 5, 71, 23, 59, 25, 10, 11,
172562 /* 1600 */ 12, 13, 14, 194, 23, 17, 25, 23, 23, 25,
172563 /* 1610 */ 25, 194, 23, 183, 25, 7, 8, 237, 30, 194,
172564 /* 1620 */ 32, 19, 20, 100, 22, 121, 194, 133, 40, 106,
172565 /* 1630 */ 107, 108, 138, 139, 59, 131, 194, 114, 36, 116,
172566 /* 1640 */ 117, 118, 217, 218, 121, 194, 23, 194, 25, 217,
172567 /* 1650 */ 218, 194, 194, 23, 117, 25, 162, 194, 70, 217,
172568 /* 1660 */ 218, 59, 23, 23, 25, 25, 78, 194, 194, 81,
172569 /* 1670 */ 217, 218, 194, 71, 217, 218, 153, 154, 155, 156,
172570 /* 1680 */ 157, 194, 83, 84, 319, 23, 98, 25, 289, 194,
172571 /* 1690 */ 217, 218, 117, 19, 20, 153, 22, 155, 153, 194,
172572 /* 1700 */ 155, 194, 100, 194, 217, 218, 183, 194, 106, 107,
172573 /* 1710 */ 36, 194, 217, 218, 194, 194, 114, 256, 116, 117,
172574 /* 1720 */ 118, 133, 194, 121, 217, 218, 138, 139, 194, 23,
172575 /* 1730 */ 194, 25, 194, 59, 217, 218, 288, 194, 217, 218,
172576 /* 1740 */ 194, 194, 140, 194, 194, 71, 194, 194, 194, 194,
172577 /* 1750 */ 162, 217, 218, 194, 194, 153, 154, 155, 156, 157,
172578 /* 1760 */ 217, 218, 243, 217, 218, 192, 256, 256, 256, 244,
172579 /* 1770 */ 298, 215, 272, 246, 100, 294, 268, 247, 272, 247,
172580 /* 1780 */ 106, 107, 268, 294, 221, 183, 220, 272, 114, 220,
172581 /* 1790 */ 116, 117, 118, 1, 2, 121, 272, 5, 230, 220,
172582 /* 1800 */ 226, 260, 10, 11, 12, 13, 14, 246, 260, 17,
172583 /* 1810 */ 281, 260, 250, 246, 140, 250, 197, 260, 60, 141,
172584 /* 1820 */ 244, 201, 30, 201, 32, 38, 295, 153, 154, 155,
172585 /* 1830 */ 156, 157, 40, 298, 201, 151, 150, 298, 22, 43,
172586 /* 1840 */ 235, 18, 238, 201, 273, 238, 200, 19, 20, 271,
172587 /* 1850 */ 22, 238, 238, 295, 284, 18, 149, 183, 247, 273,
172588 /* 1860 */ 273, 271, 70, 247, 36, 247, 235, 235, 247, 201,
172589 /* 1870 */ 78, 200, 158, 81, 291, 62, 201, 200, 22, 222,
172590 /* 1880 */ 201, 290, 200, 222, 201, 200, 115, 59, 219, 219,
172591 /* 1890 */ 98, 219, 228, 64, 22, 126, 165, 24, 225, 71,
172592 /* 1900 */ 219, 225, 222, 306, 113, 313, 201, 219, 221, 219,
172593 /* 1910 */ 219, 283, 283, 91, 222, 82, 318, 228, 318, 266,
172594 /* 1920 */ 266, 148, 145, 22, 201, 133, 278, 280, 100, 147,
172595 /* 1930 */ 138, 139, 158, 25, 106, 107, 146, 203, 13, 195,
172596 /* 1940 */ 195, 247, 114, 250, 116, 117, 118, 251, 251, 121,
172597 /* 1950 */ 249, 248, 6, 193, 162, 193, 193, 208, 223, 304,
172598 /* 1960 */ 304, 301, 214, 208, 214, 214, 214, 4, 215, 223,
172599 /* 1970 */ 3, 215, 208, 214, 22, 163, 15, 23, 16, 23,
172600 /* 1980 */ 139, 153, 154, 155, 156, 157, 151, 130, 142, 25,
172601 /* 1990 */ 24, 20, 144, 16, 1, 142, 130, 130, 61, 130,
172602 /* 2000 */ 151, 53, 37, 53, 53, 116, 53, 34, 1, 141,
172603 /* 2010 */ 5, 183, 22, 115, 25, 161, 75, 68, 141, 41,
172604 /* 2020 */ 115, 24, 20, 68, 131, 19, 22, 125, 96, 59,
172605 /* 2030 */ 22, 22, 37, 23, 22, 67, 67, 24, 22, 28,
172606 /* 2040 */ 23, 67, 22, 149, 23, 23, 23, 22, 34, 25,
172607 /* 2050 */ 141, 23, 23, 34, 97, 116, 22, 143, 25, 75,
172608 /* 2060 */ 34, 34, 86, 88, 34, 34, 75, 23, 22, 34,
172609 /* 2070 */ 25, 24, 93, 25, 34, 142, 44, 142, 23, 23,
172610 /* 2080 */ 23, 23, 23, 11, 23, 25, 22, 22, 22, 1,
172611 /* 2090 */ 23, 23, 22, 22, 25, 135, 15, 23, 25, 141,
172612 /* 2100 */ 141, 1, 320, 320, 320, 320, 320, 320, 320, 320,
172613 /* 2110 */ 320, 320, 320, 141, 320, 320, 320, 320, 320, 320,
172614 /* 2120 */ 320, 320, 320, 320, 320, 320, 320, 320, 320, 320,
172615 /* 2130 */ 320, 320, 320, 320, 320, 320, 320, 320, 320, 320,
172616 /* 2140 */ 320, 320, 320, 320, 320, 320, 320, 320, 320, 320,
172617 /* 2150 */ 320, 320, 320, 320, 320, 320, 320, 320, 320, 320,
172618 /* 2160 */ 320, 320, 320, 320, 320, 320, 320, 320, 320, 320,
172619 /* 2170 */ 320, 320, 320, 320, 320, 320, 320, 320, 320, 320,
172620 /* 2180 */ 320, 320, 320, 320, 320, 320, 320, 320, 320, 320,
172621 /* 2190 */ 320, 320, 320, 320, 320, 320, 320, 320, 320, 320,
172622 /* 2200 */ 320, 320, 320, 320, 320, 320, 320, 320, 320, 320,
172623 /* 2210 */ 320, 320, 320, 320, 320, 320, 320, 320, 320, 320,
172624 /* 2220 */ 320, 320, 320, 320, 320, 320, 320, 320, 320, 320,
172625 /* 2230 */ 320, 320, 320, 320, 320, 320, 320, 320, 320, 320,
172626 /* 2240 */ 320, 320, 320, 320, 320, 320, 320, 320, 320, 320,
172627 /* 2250 */ 320, 320, 320, 320, 320, 320, 320, 320, 320, 320,
172628 /* 2260 */ 320, 320, 320, 320, 320, 320, 320, 320, 320, 320,
172629 /* 2270 */ 320, 320, 320, 320, 320, 320, 320, 320, 320, 320,
172630 /* 2280 */ 320, 320, 320, 320, 320, 320, 320, 320, 320, 320,
172631 /* 2290 */ 320, 320, 320, 320, 320, 320, 320, 320, 320, 320,
172632 };
172633 #define YY_SHIFT_COUNT (578)
172634 #define YY_SHIFT_MIN (0)
172635 #define YY_SHIFT_MAX (2100)
172636 static const unsigned short int yy_shift_ofst[] = {
172637 /* 0 */ 1792, 1588, 1494, 322, 322, 1, 1319, 1339, 1430, 1828,
172638 /* 10 */ 1828, 1828, 470, 0, 0, 214, 1093, 1828, 1828, 1828,
172639 /* 20 */ 1828, 1828, 1828, 1828, 1828, 1828, 1828, 1828, 1828, 1828,
172640 /* 30 */ 1828, 271, 271, 1198, 1198, 216, 88, 1, 1, 1,
172641 /* 40 */ 1, 1, 40, 111, 258, 361, 469, 512, 583, 622,
172642 /* 50 */ 693, 732, 803, 842, 913, 1073, 1093, 1093, 1093, 1093,
172643 /* 60 */ 1093, 1093, 1093, 1093, 1093, 1093, 1093, 1093, 1093, 1093,
172644 /* 70 */ 1093, 1093, 1093, 1093, 1113, 1093, 1216, 957, 957, 1523,
172645 /* 80 */ 1602, 1674, 1828, 1828, 1828, 1828, 1828, 1828, 1828, 1828,
172646 /* 90 */ 1828, 1828, 1828, 1828, 1828, 1828, 1828, 1828, 1828, 1828,
172647 /* 100 */ 1828, 1828, 1828, 1828, 1828, 1828, 1828, 1828, 1828, 1828,
172648 /* 110 */ 1828, 1828, 1828, 1828, 1828, 1828, 1828, 1828, 1828, 1828,
172649 /* 120 */ 1828, 1828, 1828, 1828, 1828, 1828, 1828, 1828, 1828, 1828,
172650 /* 130 */ 1828, 137, 181, 181, 181, 181, 181, 181, 181, 94,
172651 /* 140 */ 479, 66, 65, 112, 366, 645, 645, 629, 1168, 645,
172652 /* 150 */ 645, 79, 79, 645, 795, 795, 795, 77, 795, 123,
172653 /* 160 */ 113, 113, 113, 22, 22, 2114, 2114, 328, 328, 328,
172654 /* 170 */ 239, 585, 585, 585, 585, 1031, 1031, 409, 366, 970,
172655 /* 180 */ 1014, 645, 645, 645, 645, 645, 645, 645, 645, 645,
172656 /* 190 */ 645, 645, 645, 645, 645, 645, 645, 645, 645, 645,
172657 /* 200 */ 645, 969, 849, 849, 645, 972, 1118, 1118, 1279, 1279,
172658 /* 210 */ 320, 320, 1283, 1331, 2114, 2114, 2114, 2114, 2114, 2114,
172659 /* 220 */ 2114, 928, 1127, 1127, 589, 414, 640, 535, 695, 539,
172660 /* 230 */ 649, 700, 645, 645, 645, 645, 645, 645, 645, 645,
172661 /* 240 */ 645, 645, 222, 645, 645, 645, 645, 645, 645, 645,
172662 /* 250 */ 645, 645, 645, 645, 645, 796, 796, 796, 645, 645,
172663 /* 260 */ 645, 800, 645, 645, 645, 486, 1145, 645, 645, 1267,
172664 /* 270 */ 645, 645, 645, 645, 645, 645, 645, 645, 145, 1223,
172665 /* 280 */ 209, 1227, 1227, 1227, 1227, 1325, 209, 209, 1196, 190,
172666 /* 290 */ 367, 1288, 1125, 1348, 405, 1348, 1419, 515, 1125, 1125,
172667 /* 300 */ 515, 1125, 405, 1419, 1029, 306, 1346, 1350, 1350, 1350,
172668 /* 310 */ 760, 760, 760, 760, 1423, 1423, 945, 1164, 939, 1490,
172669 /* 320 */ 1758, 1758, 1678, 1678, 1787, 1787, 1678, 1684, 1686, 1816,
172670 /* 330 */ 1796, 1823, 1823, 1823, 1823, 1678, 1837, 1707, 1686, 1686,
172671 /* 340 */ 1707, 1816, 1796, 1707, 1796, 1707, 1678, 1837, 1714, 1813,
172672 /* 350 */ 1678, 1837, 1856, 1678, 1837, 1678, 1837, 1856, 1771, 1771,
172673 /* 360 */ 1771, 1829, 1872, 1872, 1856, 1771, 1769, 1771, 1829, 1771,
172674 /* 370 */ 1771, 1731, 1873, 1791, 1791, 1856, 1678, 1822, 1822, 1833,
172675 /* 380 */ 1833, 1773, 1777, 1901, 1678, 1774, 1773, 1782, 1790, 1707,
172676 /* 390 */ 1908, 1925, 1925, 1946, 1946, 1946, 2114, 2114, 2114, 2114,
172677 /* 400 */ 2114, 2114, 2114, 2114, 2114, 2114, 2114, 2114, 2114, 2114,
172678 /* 410 */ 2114, 207, 1030, 1236, 1329, 912, 853, 1129, 1496, 1424,
172679 /* 420 */ 1332, 1435, 1389, 1429, 1540, 1352, 1544, 1581, 1584, 1585,
172680 /* 430 */ 1589, 1623, 1337, 1450, 1608, 1504, 1572, 208, 1452, 1537,
172681 /* 440 */ 1630, 1639, 1599, 1640, 1542, 1545, 1662, 1706, 1575, 859,
172682 /* 450 */ 1963, 1967, 1952, 1812, 1961, 1962, 1954, 1956, 1841, 1835,
172683 /* 460 */ 1857, 1964, 1964, 1966, 1846, 1971, 1848, 1977, 1993, 1853,
172684 /* 470 */ 1866, 1964, 1867, 1937, 1965, 1964, 1849, 1948, 1950, 1951,
172685 /* 480 */ 1953, 1869, 1889, 1973, 1868, 2007, 2005, 1990, 1898, 1854,
172686 /* 490 */ 1949, 1989, 1955, 1941, 1978, 1877, 1905, 1997, 2002, 2006,
172687 /* 500 */ 1893, 1902, 2004, 1968, 2008, 2009, 2010, 2012, 1969, 1970,
172688 /* 510 */ 2013, 1932, 2011, 2016, 1974, 1995, 2017, 2014, 1894, 2020,
172689 /* 520 */ 2021, 2022, 2024, 2023, 2025, 1957, 1909, 2028, 2029, 1939,
172690 /* 530 */ 2019, 2034, 1914, 2033, 2026, 2027, 2030, 2031, 1975, 1984,
172691 /* 540 */ 1976, 2032, 1991, 1979, 2035, 2044, 2046, 2047, 2045, 2048,
172692 /* 550 */ 2040, 1933, 1935, 2055, 2033, 2056, 2057, 2058, 2059, 2060,
172693 /* 560 */ 2061, 2064, 2072, 2065, 2066, 2067, 2068, 2070, 2071, 2069,
172694 /* 570 */ 1960, 1958, 1959, 1972, 2073, 2074, 2081, 2088, 2100,
172695 };
172696 #define YY_REDUCE_COUNT (410)
172697 #define YY_REDUCE_MIN (-272)
172698 #define YY_REDUCE_MAX (1764)
172699 static const short yy_reduce_ofst[] = {
172700 /* 0 */ -126, 731, 343, 240, 835, -124, -194, -192, -184, -188,
172701 /* 10 */ 165, 237, 132, -208, -200, -268, -177, -7, 203, 310,
172702 /* 20 */ 312, 466, -176, 576, 597, 82, 615, 685, 706, 779,
172703 /* 30 */ 833, 886, 960, 86, 401, -193, 623, 625, 737, 794,
172704 /* 40 */ 837, 988, -272, -272, -272, -272, -272, -272, -272, -272,
172705 /* 50 */ -272, -272, -272, -272, -272, -272, -272, -272, -272, -272,
172706 /* 60 */ -272, -272, -272, -272, -272, -272, -272, -272, -272, -272,
172707 /* 70 */ -272, -272, -272, -272, -272, -272, -272, -272, -272, 503,
172708 /* 80 */ 838, 916, 1015, 1019, 1037, 1059, 1084, 1090, 1095, 1117,
172709 /* 90 */ 1139, 1146, 1148, 1151, 1155, 1159, 1166, 1176, 1185, 1188,
172710 /* 100 */ 1194, 1197, 1203, 1205, 1214, 1224, 1264, 1268, 1270, 1273,
172711 /* 110 */ 1315, 1322, 1335, 1344, 1356, 1360, 1362, 1425, 1432, 1442,
172712 /* 120 */ 1453, 1457, 1473, 1487, 1495, 1507, 1517, 1521, 1534, 1543,
172713 /* 130 */ 1546, -272, -272, -272, -272, -272, -272, -272, -272, -272,
172714 /* 140 */ -272, -272, 204, 248, 455, -159, 358, 482, -213, 577,
172715 /* 150 */ 411, -196, -93, 293, 627, 631, 627, -272, 631, 687,
172716 /* 160 */ 120, 783, 840, -272, -272, -272, -272, 273, 273, 273,
172717 /* 170 */ 160, 980, 1048, 1102, 1111, 313, 376, 193, 452, 471,
172718 /* 180 */ 471, -167, -162, 460, 506, 736, 792, 847, 854, -123,
172719 /* 190 */ 613, -121, 844, 1098, 897, 1152, 1056, 520, 1099, 519,
172720 /* 200 */ 1153, 679, 621, 821, 262, 170, 898, 924, 841, 982,
172721 /* 210 */ 1177, 1191, 349, 1210, 1178, 628, 1189, 1255, 1258, 1226,
172722 /* 220 */ 1272, -195, -8, 184, -136, 255, 399, 410, 453, 566,
172723 /* 230 */ 578, 616, 633, 743, 998, 1103, 1106, 1213, 1233, 1271,
172724 /* 240 */ 1286, 1334, 551, 1361, 1366, 1372, 1397, 1409, 1417, 1451,
172725 /* 250 */ 1458, 1463, 1474, 1505, 1509, 767, 1250, 1298, 1478, 1513,
172726 /* 260 */ 1520, 421, 1528, 1536, 1538, 1275, 1365, 1547, 1549, 1380,
172727 /* 270 */ 1550, 410, 1552, 1553, 1554, 1555, 1559, 1560, 1399, 1448,
172728 /* 280 */ 1519, 1461, 1510, 1511, 1512, 421, 1519, 1519, 1525, 1556,
172729 /* 290 */ 1573, 1472, 1500, 1508, 1527, 1514, 1481, 1530, 1506, 1515,
172730 /* 300 */ 1532, 1524, 1561, 1489, 1563, 1568, 1574, 1566, 1569, 1579,
172731 /* 310 */ 1541, 1548, 1551, 1557, 1562, 1565, 1529, 1567, 1576, 1619,
172732 /* 320 */ 1535, 1539, 1620, 1622, 1531, 1558, 1633, 1570, 1571, 1578,
172733 /* 330 */ 1605, 1604, 1607, 1613, 1614, 1642, 1646, 1611, 1586, 1587,
172734 /* 340 */ 1616, 1590, 1631, 1618, 1632, 1621, 1668, 1671, 1583, 1591,
172735 /* 350 */ 1675, 1677, 1657, 1679, 1682, 1683, 1685, 1661, 1669, 1670,
172736 /* 360 */ 1672, 1664, 1673, 1676, 1680, 1681, 1687, 1688, 1689, 1690,
172737 /* 370 */ 1691, 1592, 1597, 1628, 1629, 1692, 1705, 1598, 1600, 1653,
172738 /* 380 */ 1654, 1696, 1693, 1648, 1723, 1647, 1697, 1701, 1703, 1694,
172739 /* 390 */ 1734, 1744, 1745, 1760, 1762, 1763, 1655, 1656, 1660, 1749,
172740 /* 400 */ 1748, 1750, 1751, 1752, 1755, 1735, 1746, 1753, 1756, 1759,
172741 /* 410 */ 1764,
172742 };
172743 static const YYACTIONTYPE yy_default[] = {
172744 /* 0 */ 1651, 1651, 1651, 1480, 1245, 1356, 1245, 1245, 1245, 1480,
172745 /* 10 */ 1480, 1480, 1245, 1386, 1386, 1533, 1278, 1245, 1245, 1245,
172746 /* 20 */ 1245, 1245, 1245, 1245, 1245, 1245, 1245, 1245, 1479, 1245,
172747 /* 30 */ 1245, 1245, 1245, 1566, 1566, 1245, 1245, 1245, 1245, 1245,
172748 /* 40 */ 1245, 1245, 1245, 1395, 1245, 1402, 1245, 1245, 1245, 1245,
172749 /* 50 */ 1245, 1481, 1482, 1245, 1245, 1245, 1532, 1534, 1497, 1409,
172750 /* 60 */ 1408, 1407, 1406, 1515, 1374, 1400, 1393, 1397, 1476, 1477,
172751 /* 70 */ 1475, 1629, 1482, 1481, 1245, 1396, 1444, 1460, 1443, 1245,
172752 /* 80 */ 1245, 1245, 1245, 1245, 1245, 1245, 1245, 1245, 1245, 1245,
172753 /* 90 */ 1245, 1245, 1245, 1245, 1245, 1245, 1245, 1245, 1245, 1245,
172754 /* 100 */ 1245, 1245, 1245, 1245, 1245, 1245, 1245, 1245, 1245, 1245,
172755 /* 110 */ 1245, 1245, 1245, 1245, 1245, 1245, 1245, 1245, 1245, 1245,
172756 /* 120 */ 1245, 1245, 1245, 1245, 1245, 1245, 1245, 1245, 1245, 1245,
172757 /* 130 */ 1245, 1452, 1459, 1458, 1457, 1466, 1456, 1453, 1446, 1445,
172758 /* 140 */ 1447, 1448, 1245, 1245, 1269, 1245, 1245, 1266, 1320, 1245,
172759 /* 150 */ 1245, 1245, 1245, 1245, 1552, 1551, 1245, 1449, 1245, 1278,
172760 /* 160 */ 1437, 1436, 1435, 1463, 1450, 1462, 1461, 1540, 1603, 1602,
172761 /* 170 */ 1498, 1245, 1245, 1245, 1245, 1245, 1245, 1566, 1245, 1245,
172762 /* 180 */ 1245, 1245, 1245, 1245, 1245, 1245, 1245, 1245, 1245, 1245,
172763 /* 190 */ 1245, 1245, 1245, 1245, 1245, 1245, 1245, 1245, 1245, 1245,
172764 /* 200 */ 1245, 1376, 1566, 1566, 1245, 1278, 1566, 1566, 1377, 1377,
172765 /* 210 */ 1274, 1274, 1380, 1245, 1547, 1347, 1347, 1347, 1347, 1356,
172766 /* 220 */ 1347, 1245, 1245, 1245, 1245, 1245, 1245, 1245, 1245, 1245,
172767 /* 230 */ 1245, 1245, 1245, 1245, 1245, 1245, 1537, 1535, 1245, 1245,
172768 /* 240 */ 1245, 1245, 1245, 1245, 1245, 1245, 1245, 1245, 1245, 1245,
172769 /* 250 */ 1245, 1245, 1245, 1245, 1245, 1245, 1245, 1245, 1245, 1245,
172770 /* 260 */ 1245, 1245, 1245, 1245, 1245, 1352, 1245, 1245, 1245, 1245,
172771 /* 270 */ 1245, 1245, 1245, 1245, 1245, 1245, 1245, 1596, 1245, 1510,
172772 /* 280 */ 1334, 1352, 1352, 1352, 1352, 1354, 1335, 1333, 1346, 1279,
172773 /* 290 */ 1252, 1643, 1412, 1401, 1353, 1401, 1640, 1399, 1412, 1412,
172774 /* 300 */ 1399, 1412, 1353, 1640, 1295, 1618, 1290, 1386, 1386, 1386,
172775 /* 310 */ 1376, 1376, 1376, 1376, 1380, 1380, 1478, 1353, 1346, 1245,
172776 /* 320 */ 1643, 1643, 1362, 1362, 1642, 1642, 1362, 1498, 1626, 1421,
172777 /* 330 */ 1323, 1329, 1329, 1329, 1329, 1362, 1263, 1399, 1626, 1626,
172778 /* 340 */ 1399, 1421, 1323, 1399, 1323, 1399, 1362, 1263, 1514, 1637,
172779 /* 350 */ 1362, 1263, 1488, 1362, 1263, 1362, 1263, 1488, 1321, 1321,
172780 /* 360 */ 1321, 1310, 1245, 1245, 1488, 1321, 1295, 1321, 1310, 1321,
172781 /* 370 */ 1321, 1584, 1245, 1492, 1492, 1488, 1362, 1576, 1576, 1389,
172782 /* 380 */ 1389, 1394, 1380, 1483, 1362, 1245, 1394, 1392, 1390, 1399,
172783 /* 390 */ 1313, 1599, 1599, 1595, 1595, 1595, 1648, 1648, 1547, 1611,
172784 /* 400 */ 1278, 1278, 1278, 1278, 1611, 1297, 1297, 1279, 1279, 1278,
172785 /* 410 */ 1611, 1245, 1245, 1245, 1245, 1245, 1245, 1606, 1245, 1542,
172786 /* 420 */ 1499, 1366, 1245, 1245, 1245, 1245, 1245, 1245, 1245, 1245,
172787 /* 430 */ 1245, 1245, 1245, 1245, 1245, 1245, 1245, 1245, 1553, 1245,
172788 /* 440 */ 1245, 1245, 1245, 1245, 1245, 1245, 1245, 1245, 1245, 1426,
172789 /* 450 */ 1245, 1248, 1544, 1245, 1245, 1245, 1245, 1245, 1245, 1245,
172790 /* 460 */ 1245, 1403, 1404, 1367, 1245, 1245, 1245, 1245, 1245, 1245,
172791 /* 470 */ 1245, 1418, 1245, 1245, 1245, 1413, 1245, 1245, 1245, 1245,
172792 /* 480 */ 1245, 1245, 1245, 1245, 1639, 1245, 1245, 1245, 1245, 1245,
172793 /* 490 */ 1245, 1513, 1512, 1245, 1245, 1364, 1245, 1245, 1245, 1245,
172794 /* 500 */ 1245, 1245, 1245, 1245, 1245, 1245, 1245, 1245, 1245, 1293,
172795 /* 510 */ 1245, 1245, 1245, 1245, 1245, 1245, 1245, 1245, 1245, 1245,
172796 /* 520 */ 1245, 1245, 1245, 1245, 1245, 1245, 1245, 1245, 1245, 1245,
172797 /* 530 */ 1245, 1245, 1245, 1391, 1245, 1245, 1245, 1245, 1245, 1245,
172798 /* 540 */ 1245, 1245, 1245, 1245, 1245, 1245, 1245, 1245, 1581, 1381,
172799 /* 550 */ 1245, 1245, 1245, 1245, 1630, 1245, 1245, 1245, 1245, 1245,
172800 /* 560 */ 1245, 1245, 1245, 1245, 1245, 1245, 1245, 1245, 1245, 1622,
172801 /* 570 */ 1337, 1427, 1245, 1430, 1267, 1245, 1257, 1245, 1245,
172802 };
172803 /********** End of lemon-generated parsing tables *****************************/
172804
172805 /* The next table maps tokens (terminal symbols) into fallback tokens.
172806 ** If a construct like the following:
@@ -172716,10 +172999,11 @@
172999 0, /* SELECT_COLUMN => nothing */
173000 0, /* IF_NULL_ROW => nothing */
173001 0, /* ASTERISK => nothing */
173002 0, /* SPAN => nothing */
173003 0, /* ERROR => nothing */
173004 0, /* QNUMBER => nothing */
173005 0, /* SPACE => nothing */
173006 0, /* ILLEGAL => nothing */
173007 };
173008 #endif /* YYFALLBACK */
173009
@@ -172984,146 +173268,147 @@
173268 /* 178 */ "SELECT_COLUMN",
173269 /* 179 */ "IF_NULL_ROW",
173270 /* 180 */ "ASTERISK",
173271 /* 181 */ "SPAN",
173272 /* 182 */ "ERROR",
173273 /* 183 */ "QNUMBER",
173274 /* 184 */ "SPACE",
173275 /* 185 */ "ILLEGAL",
173276 /* 186 */ "input",
173277 /* 187 */ "cmdlist",
173278 /* 188 */ "ecmd",
173279 /* 189 */ "cmdx",
173280 /* 190 */ "explain",
173281 /* 191 */ "cmd",
173282 /* 192 */ "transtype",
173283 /* 193 */ "trans_opt",
173284 /* 194 */ "nm",
173285 /* 195 */ "savepoint_opt",
173286 /* 196 */ "create_table",
173287 /* 197 */ "create_table_args",
173288 /* 198 */ "createkw",
173289 /* 199 */ "temp",
173290 /* 200 */ "ifnotexists",
173291 /* 201 */ "dbnm",
173292 /* 202 */ "columnlist",
173293 /* 203 */ "conslist_opt",
173294 /* 204 */ "table_option_set",
173295 /* 205 */ "select",
173296 /* 206 */ "table_option",
173297 /* 207 */ "columnname",
173298 /* 208 */ "carglist",
173299 /* 209 */ "typetoken",
173300 /* 210 */ "typename",
173301 /* 211 */ "signed",
173302 /* 212 */ "plus_num",
173303 /* 213 */ "minus_num",
173304 /* 214 */ "scanpt",
173305 /* 215 */ "scantok",
173306 /* 216 */ "ccons",
173307 /* 217 */ "term",
173308 /* 218 */ "expr",
173309 /* 219 */ "onconf",
173310 /* 220 */ "sortorder",
173311 /* 221 */ "autoinc",
173312 /* 222 */ "eidlist_opt",
173313 /* 223 */ "refargs",
173314 /* 224 */ "defer_subclause",
173315 /* 225 */ "generated",
173316 /* 226 */ "refarg",
173317 /* 227 */ "refact",
173318 /* 228 */ "init_deferred_pred_opt",
173319 /* 229 */ "conslist",
173320 /* 230 */ "tconscomma",
173321 /* 231 */ "tcons",
173322 /* 232 */ "sortlist",
173323 /* 233 */ "eidlist",
173324 /* 234 */ "defer_subclause_opt",
173325 /* 235 */ "orconf",
173326 /* 236 */ "resolvetype",
173327 /* 237 */ "raisetype",
173328 /* 238 */ "ifexists",
173329 /* 239 */ "fullname",
173330 /* 240 */ "selectnowith",
173331 /* 241 */ "oneselect",
173332 /* 242 */ "wqlist",
173333 /* 243 */ "multiselect_op",
173334 /* 244 */ "distinct",
173335 /* 245 */ "selcollist",
173336 /* 246 */ "from",
173337 /* 247 */ "where_opt",
173338 /* 248 */ "groupby_opt",
173339 /* 249 */ "having_opt",
173340 /* 250 */ "orderby_opt",
173341 /* 251 */ "limit_opt",
173342 /* 252 */ "window_clause",
173343 /* 253 */ "values",
173344 /* 254 */ "nexprlist",
173345 /* 255 */ "sclp",
173346 /* 256 */ "as",
173347 /* 257 */ "seltablist",
173348 /* 258 */ "stl_prefix",
173349 /* 259 */ "joinop",
173350 /* 260 */ "on_using",
173351 /* 261 */ "indexed_by",
173352 /* 262 */ "exprlist",
173353 /* 263 */ "xfullname",
173354 /* 264 */ "idlist",
173355 /* 265 */ "indexed_opt",
173356 /* 266 */ "nulls",
173357 /* 267 */ "with",
173358 /* 268 */ "where_opt_ret",
173359 /* 269 */ "setlist",
173360 /* 270 */ "insert_cmd",
173361 /* 271 */ "idlist_opt",
173362 /* 272 */ "upsert",
173363 /* 273 */ "returning",
173364 /* 274 */ "filter_over",
173365 /* 275 */ "likeop",
173366 /* 276 */ "between_op",
173367 /* 277 */ "in_op",
173368 /* 278 */ "paren_exprlist",
173369 /* 279 */ "case_operand",
173370 /* 280 */ "case_exprlist",
173371 /* 281 */ "case_else",
173372 /* 282 */ "uniqueflag",
173373 /* 283 */ "collate",
173374 /* 284 */ "vinto",
173375 /* 285 */ "nmnum",
173376 /* 286 */ "trigger_decl",
173377 /* 287 */ "trigger_cmd_list",
173378 /* 288 */ "trigger_time",
173379 /* 289 */ "trigger_event",
173380 /* 290 */ "foreach_clause",
173381 /* 291 */ "when_clause",
173382 /* 292 */ "trigger_cmd",
173383 /* 293 */ "trnm",
173384 /* 294 */ "tridxby",
173385 /* 295 */ "database_kw_opt",
173386 /* 296 */ "key_opt",
173387 /* 297 */ "add_column_fullname",
173388 /* 298 */ "kwcolumn_opt",
173389 /* 299 */ "create_vtab",
173390 /* 300 */ "vtabarglist",
173391 /* 301 */ "vtabarg",
173392 /* 302 */ "vtabargtoken",
173393 /* 303 */ "lp",
173394 /* 304 */ "anylist",
173395 /* 305 */ "wqitem",
173396 /* 306 */ "wqas",
173397 /* 307 */ "windowdefn_list",
173398 /* 308 */ "windowdefn",
173399 /* 309 */ "window",
173400 /* 310 */ "frame_opt",
173401 /* 311 */ "part_opt",
173402 /* 312 */ "filter_clause",
173403 /* 313 */ "over_clause",
173404 /* 314 */ "range_or_rows",
173405 /* 315 */ "frame_bound",
173406 /* 316 */ "frame_bound_s",
173407 /* 317 */ "frame_bound_e",
173408 /* 318 */ "frame_exclude_opt",
173409 /* 319 */ "frame_exclude",
173410 };
173411 #endif /* defined(YYCOVERAGE) || !defined(NDEBUG) */
173412
173413 #ifndef NDEBUG
173414 /* For tracing reduce actions, the names of all rules are required.
@@ -173467,75 +173752,76 @@
173752 /* 335 */ "filter_over ::= over_clause",
173753 /* 336 */ "filter_over ::= filter_clause",
173754 /* 337 */ "over_clause ::= OVER LP window RP",
173755 /* 338 */ "over_clause ::= OVER nm",
173756 /* 339 */ "filter_clause ::= FILTER LP WHERE expr RP",
173757 /* 340 */ "term ::= QNUMBER",
173758 /* 341 */ "input ::= cmdlist",
173759 /* 342 */ "cmdlist ::= cmdlist ecmd",
173760 /* 343 */ "cmdlist ::= ecmd",
173761 /* 344 */ "ecmd ::= SEMI",
173762 /* 345 */ "ecmd ::= cmdx SEMI",
173763 /* 346 */ "ecmd ::= explain cmdx SEMI",
173764 /* 347 */ "trans_opt ::=",
173765 /* 348 */ "trans_opt ::= TRANSACTION",
173766 /* 349 */ "trans_opt ::= TRANSACTION nm",
173767 /* 350 */ "savepoint_opt ::= SAVEPOINT",
173768 /* 351 */ "savepoint_opt ::=",
173769 /* 352 */ "cmd ::= create_table create_table_args",
173770 /* 353 */ "table_option_set ::= table_option",
173771 /* 354 */ "columnlist ::= columnlist COMMA columnname carglist",
173772 /* 355 */ "columnlist ::= columnname carglist",
173773 /* 356 */ "nm ::= ID|INDEXED|JOIN_KW",
173774 /* 357 */ "nm ::= STRING",
173775 /* 358 */ "typetoken ::= typename",
173776 /* 359 */ "typename ::= ID|STRING",
173777 /* 360 */ "signed ::= plus_num",
173778 /* 361 */ "signed ::= minus_num",
173779 /* 362 */ "carglist ::= carglist ccons",
173780 /* 363 */ "carglist ::=",
173781 /* 364 */ "ccons ::= NULL onconf",
173782 /* 365 */ "ccons ::= GENERATED ALWAYS AS generated",
173783 /* 366 */ "ccons ::= AS generated",
173784 /* 367 */ "conslist_opt ::= COMMA conslist",
173785 /* 368 */ "conslist ::= conslist tconscomma tcons",
173786 /* 369 */ "conslist ::= tcons",
173787 /* 370 */ "tconscomma ::=",
173788 /* 371 */ "defer_subclause_opt ::= defer_subclause",
173789 /* 372 */ "resolvetype ::= raisetype",
173790 /* 373 */ "selectnowith ::= oneselect",
173791 /* 374 */ "oneselect ::= values",
173792 /* 375 */ "sclp ::= selcollist COMMA",
173793 /* 376 */ "as ::= ID|STRING",
173794 /* 377 */ "indexed_opt ::= indexed_by",
173795 /* 378 */ "returning ::=",
173796 /* 379 */ "expr ::= term",
173797 /* 380 */ "likeop ::= LIKE_KW|MATCH",
173798 /* 381 */ "case_operand ::= expr",
173799 /* 382 */ "exprlist ::= nexprlist",
173800 /* 383 */ "nmnum ::= plus_num",
173801 /* 384 */ "nmnum ::= nm",
173802 /* 385 */ "nmnum ::= ON",
173803 /* 386 */ "nmnum ::= DELETE",
173804 /* 387 */ "nmnum ::= DEFAULT",
173805 /* 388 */ "plus_num ::= INTEGER|FLOAT",
173806 /* 389 */ "foreach_clause ::=",
173807 /* 390 */ "foreach_clause ::= FOR EACH ROW",
173808 /* 391 */ "trnm ::= nm",
173809 /* 392 */ "tridxby ::=",
173810 /* 393 */ "database_kw_opt ::= DATABASE",
173811 /* 394 */ "database_kw_opt ::=",
173812 /* 395 */ "kwcolumn_opt ::=",
173813 /* 396 */ "kwcolumn_opt ::= COLUMNKW",
173814 /* 397 */ "vtabarglist ::= vtabarg",
173815 /* 398 */ "vtabarglist ::= vtabarglist COMMA vtabarg",
173816 /* 399 */ "vtabarg ::= vtabarg vtabargtoken",
173817 /* 400 */ "anylist ::=",
173818 /* 401 */ "anylist ::= anylist LP anylist RP",
173819 /* 402 */ "anylist ::= anylist ANY",
173820 /* 403 */ "with ::=",
173821 /* 404 */ "windowdefn_list ::= windowdefn",
173822 /* 405 */ "window ::= frame_opt",
173823 };
173824 #endif /* NDEBUG */
173825
173826
173827 #if YYGROWABLESTACK
@@ -173655,101 +173941,101 @@
173941 ** Note: during a reduce, the only symbols destroyed are those
173942 ** which appear on the RHS of the rule, but which are *not* used
173943 ** inside the C code.
173944 */
173945 /********* Begin destructor definitions ***************************************/
173946 case 205: /* select */
173947 case 240: /* selectnowith */
173948 case 241: /* oneselect */
173949 case 253: /* values */
173950 {
173951 sqlite3SelectDelete(pParse->db, (yypminor->yy299));
173952 }
173953 break;
173954 case 217: /* term */
173955 case 218: /* expr */
173956 case 247: /* where_opt */
173957 case 249: /* having_opt */
173958 case 268: /* where_opt_ret */
173959 case 279: /* case_operand */
173960 case 281: /* case_else */
173961 case 284: /* vinto */
173962 case 291: /* when_clause */
173963 case 296: /* key_opt */
173964 case 312: /* filter_clause */
173965 {
173966 sqlite3ExprDelete(pParse->db, (yypminor->yy2));
173967 }
173968 break;
173969 case 222: /* eidlist_opt */
173970 case 232: /* sortlist */
173971 case 233: /* eidlist */
173972 case 245: /* selcollist */
173973 case 248: /* groupby_opt */
173974 case 250: /* orderby_opt */
173975 case 254: /* nexprlist */
173976 case 255: /* sclp */
173977 case 262: /* exprlist */
173978 case 269: /* setlist */
173979 case 278: /* paren_exprlist */
173980 case 280: /* case_exprlist */
173981 case 311: /* part_opt */
173982 {
173983 sqlite3ExprListDelete(pParse->db, (yypminor->yy402));
173984 }
173985 break;
173986 case 239: /* fullname */
173987 case 246: /* from */
173988 case 257: /* seltablist */
173989 case 258: /* stl_prefix */
173990 case 263: /* xfullname */
173991 {
173992 sqlite3SrcListDelete(pParse->db, (yypminor->yy387));
173993 }
173994 break;
173995 case 242: /* wqlist */
173996 {
173997 sqlite3WithDelete(pParse->db, (yypminor->yy131));
173998 }
173999 break;
174000 case 252: /* window_clause */
174001 case 307: /* windowdefn_list */
174002 {
174003 sqlite3WindowListDelete(pParse->db, (yypminor->yy3));
174004 }
174005 break;
174006 case 264: /* idlist */
174007 case 271: /* idlist_opt */
174008 {
174009 sqlite3IdListDelete(pParse->db, (yypminor->yy400));
174010 }
174011 break;
174012 case 274: /* filter_over */
174013 case 308: /* windowdefn */
174014 case 309: /* window */
174015 case 310: /* frame_opt */
174016 case 313: /* over_clause */
174017 {
174018 sqlite3WindowDelete(pParse->db, (yypminor->yy3));
174019 }
174020 break;
174021 case 287: /* trigger_cmd_list */
174022 case 292: /* trigger_cmd */
174023 {
174024 sqlite3DeleteTriggerStep(pParse->db, (yypminor->yy347));
174025 }
174026 break;
174027 case 289: /* trigger_event */
174028 {
174029 sqlite3IdListDelete(pParse->db, (yypminor->yy210).b);
174030 }
174031 break;
174032 case 315: /* frame_bound */
174033 case 316: /* frame_bound_s */
174034 case 317: /* frame_bound_e */
174035 {
174036 sqlite3ExprDelete(pParse->db, (yypminor->yy337).pExpr);
174037 }
174038 break;
174039 /********* End destructor definitions *****************************************/
174040 default: break; /* If no destructor action specified: do nothing */
174041 }
@@ -174047,415 +174333,416 @@
174333 }
174334
174335 /* For rule J, yyRuleInfoLhs[J] contains the symbol on the left-hand side
174336 ** of that rule */
174337 static const YYCODETYPE yyRuleInfoLhs[] = {
174338 190, /* (0) explain ::= EXPLAIN */
174339 190, /* (1) explain ::= EXPLAIN QUERY PLAN */
174340 189, /* (2) cmdx ::= cmd */
174341 191, /* (3) cmd ::= BEGIN transtype trans_opt */
174342 192, /* (4) transtype ::= */
174343 192, /* (5) transtype ::= DEFERRED */
174344 192, /* (6) transtype ::= IMMEDIATE */
174345 192, /* (7) transtype ::= EXCLUSIVE */
174346 191, /* (8) cmd ::= COMMIT|END trans_opt */
174347 191, /* (9) cmd ::= ROLLBACK trans_opt */
174348 191, /* (10) cmd ::= SAVEPOINT nm */
174349 191, /* (11) cmd ::= RELEASE savepoint_opt nm */
174350 191, /* (12) cmd ::= ROLLBACK trans_opt TO savepoint_opt nm */
174351 196, /* (13) create_table ::= createkw temp TABLE ifnotexists nm dbnm */
174352 198, /* (14) createkw ::= CREATE */
174353 200, /* (15) ifnotexists ::= */
174354 200, /* (16) ifnotexists ::= IF NOT EXISTS */
174355 199, /* (17) temp ::= TEMP */
174356 199, /* (18) temp ::= */
174357 197, /* (19) create_table_args ::= LP columnlist conslist_opt RP table_option_set */
174358 197, /* (20) create_table_args ::= AS select */
174359 204, /* (21) table_option_set ::= */
174360 204, /* (22) table_option_set ::= table_option_set COMMA table_option */
174361 206, /* (23) table_option ::= WITHOUT nm */
174362 206, /* (24) table_option ::= nm */
174363 207, /* (25) columnname ::= nm typetoken */
174364 209, /* (26) typetoken ::= */
174365 209, /* (27) typetoken ::= typename LP signed RP */
174366 209, /* (28) typetoken ::= typename LP signed COMMA signed RP */
174367 210, /* (29) typename ::= typename ID|STRING */
174368 214, /* (30) scanpt ::= */
174369 215, /* (31) scantok ::= */
174370 216, /* (32) ccons ::= CONSTRAINT nm */
174371 216, /* (33) ccons ::= DEFAULT scantok term */
174372 216, /* (34) ccons ::= DEFAULT LP expr RP */
174373 216, /* (35) ccons ::= DEFAULT PLUS scantok term */
174374 216, /* (36) ccons ::= DEFAULT MINUS scantok term */
174375 216, /* (37) ccons ::= DEFAULT scantok ID|INDEXED */
174376 216, /* (38) ccons ::= NOT NULL onconf */
174377 216, /* (39) ccons ::= PRIMARY KEY sortorder onconf autoinc */
174378 216, /* (40) ccons ::= UNIQUE onconf */
174379 216, /* (41) ccons ::= CHECK LP expr RP */
174380 216, /* (42) ccons ::= REFERENCES nm eidlist_opt refargs */
174381 216, /* (43) ccons ::= defer_subclause */
174382 216, /* (44) ccons ::= COLLATE ID|STRING */
174383 225, /* (45) generated ::= LP expr RP */
174384 225, /* (46) generated ::= LP expr RP ID */
174385 221, /* (47) autoinc ::= */
174386 221, /* (48) autoinc ::= AUTOINCR */
174387 223, /* (49) refargs ::= */
174388 223, /* (50) refargs ::= refargs refarg */
174389 226, /* (51) refarg ::= MATCH nm */
174390 226, /* (52) refarg ::= ON INSERT refact */
174391 226, /* (53) refarg ::= ON DELETE refact */
174392 226, /* (54) refarg ::= ON UPDATE refact */
174393 227, /* (55) refact ::= SET NULL */
174394 227, /* (56) refact ::= SET DEFAULT */
174395 227, /* (57) refact ::= CASCADE */
174396 227, /* (58) refact ::= RESTRICT */
174397 227, /* (59) refact ::= NO ACTION */
174398 224, /* (60) defer_subclause ::= NOT DEFERRABLE init_deferred_pred_opt */
174399 224, /* (61) defer_subclause ::= DEFERRABLE init_deferred_pred_opt */
174400 228, /* (62) init_deferred_pred_opt ::= */
174401 228, /* (63) init_deferred_pred_opt ::= INITIALLY DEFERRED */
174402 228, /* (64) init_deferred_pred_opt ::= INITIALLY IMMEDIATE */
174403 203, /* (65) conslist_opt ::= */
174404 230, /* (66) tconscomma ::= COMMA */
174405 231, /* (67) tcons ::= CONSTRAINT nm */
174406 231, /* (68) tcons ::= PRIMARY KEY LP sortlist autoinc RP onconf */
174407 231, /* (69) tcons ::= UNIQUE LP sortlist RP onconf */
174408 231, /* (70) tcons ::= CHECK LP expr RP onconf */
174409 231, /* (71) tcons ::= FOREIGN KEY LP eidlist RP REFERENCES nm eidlist_opt refargs defer_subclause_opt */
174410 234, /* (72) defer_subclause_opt ::= */
174411 219, /* (73) onconf ::= */
174412 219, /* (74) onconf ::= ON CONFLICT resolvetype */
174413 235, /* (75) orconf ::= */
174414 235, /* (76) orconf ::= OR resolvetype */
174415 236, /* (77) resolvetype ::= IGNORE */
174416 236, /* (78) resolvetype ::= REPLACE */
174417 191, /* (79) cmd ::= DROP TABLE ifexists fullname */
174418 238, /* (80) ifexists ::= IF EXISTS */
174419 238, /* (81) ifexists ::= */
174420 191, /* (82) cmd ::= createkw temp VIEW ifnotexists nm dbnm eidlist_opt AS select */
174421 191, /* (83) cmd ::= DROP VIEW ifexists fullname */
174422 191, /* (84) cmd ::= select */
174423 205, /* (85) select ::= WITH wqlist selectnowith */
174424 205, /* (86) select ::= WITH RECURSIVE wqlist selectnowith */
174425 205, /* (87) select ::= selectnowith */
174426 240, /* (88) selectnowith ::= selectnowith multiselect_op oneselect */
174427 243, /* (89) multiselect_op ::= UNION */
174428 243, /* (90) multiselect_op ::= UNION ALL */
174429 243, /* (91) multiselect_op ::= EXCEPT|INTERSECT */
174430 241, /* (92) oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt orderby_opt limit_opt */
174431 241, /* (93) oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt window_clause orderby_opt limit_opt */
174432 253, /* (94) values ::= VALUES LP nexprlist RP */
174433 253, /* (95) values ::= values COMMA LP nexprlist RP */
174434 244, /* (96) distinct ::= DISTINCT */
174435 244, /* (97) distinct ::= ALL */
174436 244, /* (98) distinct ::= */
174437 255, /* (99) sclp ::= */
174438 245, /* (100) selcollist ::= sclp scanpt expr scanpt as */
174439 245, /* (101) selcollist ::= sclp scanpt STAR */
174440 245, /* (102) selcollist ::= sclp scanpt nm DOT STAR */
174441 256, /* (103) as ::= AS nm */
174442 256, /* (104) as ::= */
174443 246, /* (105) from ::= */
174444 246, /* (106) from ::= FROM seltablist */
174445 258, /* (107) stl_prefix ::= seltablist joinop */
174446 258, /* (108) stl_prefix ::= */
174447 257, /* (109) seltablist ::= stl_prefix nm dbnm as on_using */
174448 257, /* (110) seltablist ::= stl_prefix nm dbnm as indexed_by on_using */
174449 257, /* (111) seltablist ::= stl_prefix nm dbnm LP exprlist RP as on_using */
174450 257, /* (112) seltablist ::= stl_prefix LP select RP as on_using */
174451 257, /* (113) seltablist ::= stl_prefix LP seltablist RP as on_using */
174452 201, /* (114) dbnm ::= */
174453 201, /* (115) dbnm ::= DOT nm */
174454 239, /* (116) fullname ::= nm */
174455 239, /* (117) fullname ::= nm DOT nm */
174456 263, /* (118) xfullname ::= nm */
174457 263, /* (119) xfullname ::= nm DOT nm */
174458 263, /* (120) xfullname ::= nm DOT nm AS nm */
174459 263, /* (121) xfullname ::= nm AS nm */
174460 259, /* (122) joinop ::= COMMA|JOIN */
174461 259, /* (123) joinop ::= JOIN_KW JOIN */
174462 259, /* (124) joinop ::= JOIN_KW nm JOIN */
174463 259, /* (125) joinop ::= JOIN_KW nm nm JOIN */
174464 260, /* (126) on_using ::= ON expr */
174465 260, /* (127) on_using ::= USING LP idlist RP */
174466 260, /* (128) on_using ::= */
174467 265, /* (129) indexed_opt ::= */
174468 261, /* (130) indexed_by ::= INDEXED BY nm */
174469 261, /* (131) indexed_by ::= NOT INDEXED */
174470 250, /* (132) orderby_opt ::= */
174471 250, /* (133) orderby_opt ::= ORDER BY sortlist */
174472 232, /* (134) sortlist ::= sortlist COMMA expr sortorder nulls */
174473 232, /* (135) sortlist ::= expr sortorder nulls */
174474 220, /* (136) sortorder ::= ASC */
174475 220, /* (137) sortorder ::= DESC */
174476 220, /* (138) sortorder ::= */
174477 266, /* (139) nulls ::= NULLS FIRST */
174478 266, /* (140) nulls ::= NULLS LAST */
174479 266, /* (141) nulls ::= */
174480 248, /* (142) groupby_opt ::= */
174481 248, /* (143) groupby_opt ::= GROUP BY nexprlist */
174482 249, /* (144) having_opt ::= */
174483 249, /* (145) having_opt ::= HAVING expr */
174484 251, /* (146) limit_opt ::= */
174485 251, /* (147) limit_opt ::= LIMIT expr */
174486 251, /* (148) limit_opt ::= LIMIT expr OFFSET expr */
174487 251, /* (149) limit_opt ::= LIMIT expr COMMA expr */
174488 191, /* (150) cmd ::= with DELETE FROM xfullname indexed_opt where_opt_ret */
174489 247, /* (151) where_opt ::= */
174490 247, /* (152) where_opt ::= WHERE expr */
174491 268, /* (153) where_opt_ret ::= */
174492 268, /* (154) where_opt_ret ::= WHERE expr */
174493 268, /* (155) where_opt_ret ::= RETURNING selcollist */
174494 268, /* (156) where_opt_ret ::= WHERE expr RETURNING selcollist */
174495 191, /* (157) cmd ::= with UPDATE orconf xfullname indexed_opt SET setlist from where_opt_ret */
174496 269, /* (158) setlist ::= setlist COMMA nm EQ expr */
174497 269, /* (159) setlist ::= setlist COMMA LP idlist RP EQ expr */
174498 269, /* (160) setlist ::= nm EQ expr */
174499 269, /* (161) setlist ::= LP idlist RP EQ expr */
174500 191, /* (162) cmd ::= with insert_cmd INTO xfullname idlist_opt select upsert */
174501 191, /* (163) cmd ::= with insert_cmd INTO xfullname idlist_opt DEFAULT VALUES returning */
174502 272, /* (164) upsert ::= */
174503 272, /* (165) upsert ::= RETURNING selcollist */
174504 272, /* (166) upsert ::= ON CONFLICT LP sortlist RP where_opt DO UPDATE SET setlist where_opt upsert */
174505 272, /* (167) upsert ::= ON CONFLICT LP sortlist RP where_opt DO NOTHING upsert */
174506 272, /* (168) upsert ::= ON CONFLICT DO NOTHING returning */
174507 272, /* (169) upsert ::= ON CONFLICT DO UPDATE SET setlist where_opt returning */
174508 273, /* (170) returning ::= RETURNING selcollist */
174509 270, /* (171) insert_cmd ::= INSERT orconf */
174510 270, /* (172) insert_cmd ::= REPLACE */
174511 271, /* (173) idlist_opt ::= */
174512 271, /* (174) idlist_opt ::= LP idlist RP */
174513 264, /* (175) idlist ::= idlist COMMA nm */
174514 264, /* (176) idlist ::= nm */
174515 218, /* (177) expr ::= LP expr RP */
174516 218, /* (178) expr ::= ID|INDEXED|JOIN_KW */
174517 218, /* (179) expr ::= nm DOT nm */
174518 218, /* (180) expr ::= nm DOT nm DOT nm */
174519 217, /* (181) term ::= NULL|FLOAT|BLOB */
174520 217, /* (182) term ::= STRING */
174521 217, /* (183) term ::= INTEGER */
174522 218, /* (184) expr ::= VARIABLE */
174523 218, /* (185) expr ::= expr COLLATE ID|STRING */
174524 218, /* (186) expr ::= CAST LP expr AS typetoken RP */
174525 218, /* (187) expr ::= ID|INDEXED|JOIN_KW LP distinct exprlist RP */
174526 218, /* (188) expr ::= ID|INDEXED|JOIN_KW LP distinct exprlist ORDER BY sortlist RP */
174527 218, /* (189) expr ::= ID|INDEXED|JOIN_KW LP STAR RP */
174528 218, /* (190) expr ::= ID|INDEXED|JOIN_KW LP distinct exprlist RP filter_over */
174529 218, /* (191) expr ::= ID|INDEXED|JOIN_KW LP distinct exprlist ORDER BY sortlist RP filter_over */
174530 218, /* (192) expr ::= ID|INDEXED|JOIN_KW LP STAR RP filter_over */
174531 217, /* (193) term ::= CTIME_KW */
174532 218, /* (194) expr ::= LP nexprlist COMMA expr RP */
174533 218, /* (195) expr ::= expr AND expr */
174534 218, /* (196) expr ::= expr OR expr */
174535 218, /* (197) expr ::= expr LT|GT|GE|LE expr */
174536 218, /* (198) expr ::= expr EQ|NE expr */
174537 218, /* (199) expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr */
174538 218, /* (200) expr ::= expr PLUS|MINUS expr */
174539 218, /* (201) expr ::= expr STAR|SLASH|REM expr */
174540 218, /* (202) expr ::= expr CONCAT expr */
174541 275, /* (203) likeop ::= NOT LIKE_KW|MATCH */
174542 218, /* (204) expr ::= expr likeop expr */
174543 218, /* (205) expr ::= expr likeop expr ESCAPE expr */
174544 218, /* (206) expr ::= expr ISNULL|NOTNULL */
174545 218, /* (207) expr ::= expr NOT NULL */
174546 218, /* (208) expr ::= expr IS expr */
174547 218, /* (209) expr ::= expr IS NOT expr */
174548 218, /* (210) expr ::= expr IS NOT DISTINCT FROM expr */
174549 218, /* (211) expr ::= expr IS DISTINCT FROM expr */
174550 218, /* (212) expr ::= NOT expr */
174551 218, /* (213) expr ::= BITNOT expr */
174552 218, /* (214) expr ::= PLUS|MINUS expr */
174553 218, /* (215) expr ::= expr PTR expr */
174554 276, /* (216) between_op ::= BETWEEN */
174555 276, /* (217) between_op ::= NOT BETWEEN */
174556 218, /* (218) expr ::= expr between_op expr AND expr */
174557 277, /* (219) in_op ::= IN */
174558 277, /* (220) in_op ::= NOT IN */
174559 218, /* (221) expr ::= expr in_op LP exprlist RP */
174560 218, /* (222) expr ::= LP select RP */
174561 218, /* (223) expr ::= expr in_op LP select RP */
174562 218, /* (224) expr ::= expr in_op nm dbnm paren_exprlist */
174563 218, /* (225) expr ::= EXISTS LP select RP */
174564 218, /* (226) expr ::= CASE case_operand case_exprlist case_else END */
174565 280, /* (227) case_exprlist ::= case_exprlist WHEN expr THEN expr */
174566 280, /* (228) case_exprlist ::= WHEN expr THEN expr */
174567 281, /* (229) case_else ::= ELSE expr */
174568 281, /* (230) case_else ::= */
174569 279, /* (231) case_operand ::= */
174570 262, /* (232) exprlist ::= */
174571 254, /* (233) nexprlist ::= nexprlist COMMA expr */
174572 254, /* (234) nexprlist ::= expr */
174573 278, /* (235) paren_exprlist ::= */
174574 278, /* (236) paren_exprlist ::= LP exprlist RP */
174575 191, /* (237) cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP sortlist RP where_opt */
174576 282, /* (238) uniqueflag ::= UNIQUE */
174577 282, /* (239) uniqueflag ::= */
174578 222, /* (240) eidlist_opt ::= */
174579 222, /* (241) eidlist_opt ::= LP eidlist RP */
174580 233, /* (242) eidlist ::= eidlist COMMA nm collate sortorder */
174581 233, /* (243) eidlist ::= nm collate sortorder */
174582 283, /* (244) collate ::= */
174583 283, /* (245) collate ::= COLLATE ID|STRING */
174584 191, /* (246) cmd ::= DROP INDEX ifexists fullname */
174585 191, /* (247) cmd ::= VACUUM vinto */
174586 191, /* (248) cmd ::= VACUUM nm vinto */
174587 284, /* (249) vinto ::= INTO expr */
174588 284, /* (250) vinto ::= */
174589 191, /* (251) cmd ::= PRAGMA nm dbnm */
174590 191, /* (252) cmd ::= PRAGMA nm dbnm EQ nmnum */
174591 191, /* (253) cmd ::= PRAGMA nm dbnm LP nmnum RP */
174592 191, /* (254) cmd ::= PRAGMA nm dbnm EQ minus_num */
174593 191, /* (255) cmd ::= PRAGMA nm dbnm LP minus_num RP */
174594 212, /* (256) plus_num ::= PLUS INTEGER|FLOAT */
174595 213, /* (257) minus_num ::= MINUS INTEGER|FLOAT */
174596 191, /* (258) cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END */
174597 286, /* (259) trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause */
174598 288, /* (260) trigger_time ::= BEFORE|AFTER */
174599 288, /* (261) trigger_time ::= INSTEAD OF */
174600 288, /* (262) trigger_time ::= */
174601 289, /* (263) trigger_event ::= DELETE|INSERT */
174602 289, /* (264) trigger_event ::= UPDATE */
174603 289, /* (265) trigger_event ::= UPDATE OF idlist */
174604 291, /* (266) when_clause ::= */
174605 291, /* (267) when_clause ::= WHEN expr */
174606 287, /* (268) trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI */
174607 287, /* (269) trigger_cmd_list ::= trigger_cmd SEMI */
174608 293, /* (270) trnm ::= nm DOT nm */
174609 294, /* (271) tridxby ::= INDEXED BY nm */
174610 294, /* (272) tridxby ::= NOT INDEXED */
174611 292, /* (273) trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist from where_opt scanpt */
174612 292, /* (274) trigger_cmd ::= scanpt insert_cmd INTO trnm idlist_opt select upsert scanpt */
174613 292, /* (275) trigger_cmd ::= DELETE FROM trnm tridxby where_opt scanpt */
174614 292, /* (276) trigger_cmd ::= scanpt select scanpt */
174615 218, /* (277) expr ::= RAISE LP IGNORE RP */
174616 218, /* (278) expr ::= RAISE LP raisetype COMMA nm RP */
174617 237, /* (279) raisetype ::= ROLLBACK */
174618 237, /* (280) raisetype ::= ABORT */
174619 237, /* (281) raisetype ::= FAIL */
174620 191, /* (282) cmd ::= DROP TRIGGER ifexists fullname */
174621 191, /* (283) cmd ::= ATTACH database_kw_opt expr AS expr key_opt */
174622 191, /* (284) cmd ::= DETACH database_kw_opt expr */
174623 296, /* (285) key_opt ::= */
174624 296, /* (286) key_opt ::= KEY expr */
174625 191, /* (287) cmd ::= REINDEX */
174626 191, /* (288) cmd ::= REINDEX nm dbnm */
174627 191, /* (289) cmd ::= ANALYZE */
174628 191, /* (290) cmd ::= ANALYZE nm dbnm */
174629 191, /* (291) cmd ::= ALTER TABLE fullname RENAME TO nm */
174630 191, /* (292) cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt columnname carglist */
174631 191, /* (293) cmd ::= ALTER TABLE fullname DROP kwcolumn_opt nm */
174632 297, /* (294) add_column_fullname ::= fullname */
174633 191, /* (295) cmd ::= ALTER TABLE fullname RENAME kwcolumn_opt nm TO nm */
174634 191, /* (296) cmd ::= create_vtab */
174635 191, /* (297) cmd ::= create_vtab LP vtabarglist RP */
174636 299, /* (298) create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm */
174637 301, /* (299) vtabarg ::= */
174638 302, /* (300) vtabargtoken ::= ANY */
174639 302, /* (301) vtabargtoken ::= lp anylist RP */
174640 303, /* (302) lp ::= LP */
174641 267, /* (303) with ::= WITH wqlist */
174642 267, /* (304) with ::= WITH RECURSIVE wqlist */
174643 306, /* (305) wqas ::= AS */
174644 306, /* (306) wqas ::= AS MATERIALIZED */
174645 306, /* (307) wqas ::= AS NOT MATERIALIZED */
174646 305, /* (308) wqitem ::= nm eidlist_opt wqas LP select RP */
174647 242, /* (309) wqlist ::= wqitem */
174648 242, /* (310) wqlist ::= wqlist COMMA wqitem */
174649 307, /* (311) windowdefn_list ::= windowdefn_list COMMA windowdefn */
174650 308, /* (312) windowdefn ::= nm AS LP window RP */
174651 309, /* (313) window ::= PARTITION BY nexprlist orderby_opt frame_opt */
174652 309, /* (314) window ::= nm PARTITION BY nexprlist orderby_opt frame_opt */
174653 309, /* (315) window ::= ORDER BY sortlist frame_opt */
174654 309, /* (316) window ::= nm ORDER BY sortlist frame_opt */
174655 309, /* (317) window ::= nm frame_opt */
174656 310, /* (318) frame_opt ::= */
174657 310, /* (319) frame_opt ::= range_or_rows frame_bound_s frame_exclude_opt */
174658 310, /* (320) frame_opt ::= range_or_rows BETWEEN frame_bound_s AND frame_bound_e frame_exclude_opt */
174659 314, /* (321) range_or_rows ::= RANGE|ROWS|GROUPS */
174660 316, /* (322) frame_bound_s ::= frame_bound */
174661 316, /* (323) frame_bound_s ::= UNBOUNDED PRECEDING */
174662 317, /* (324) frame_bound_e ::= frame_bound */
174663 317, /* (325) frame_bound_e ::= UNBOUNDED FOLLOWING */
174664 315, /* (326) frame_bound ::= expr PRECEDING|FOLLOWING */
174665 315, /* (327) frame_bound ::= CURRENT ROW */
174666 318, /* (328) frame_exclude_opt ::= */
174667 318, /* (329) frame_exclude_opt ::= EXCLUDE frame_exclude */
174668 319, /* (330) frame_exclude ::= NO OTHERS */
174669 319, /* (331) frame_exclude ::= CURRENT ROW */
174670 319, /* (332) frame_exclude ::= GROUP|TIES */
174671 252, /* (333) window_clause ::= WINDOW windowdefn_list */
174672 274, /* (334) filter_over ::= filter_clause over_clause */
174673 274, /* (335) filter_over ::= over_clause */
174674 274, /* (336) filter_over ::= filter_clause */
174675 313, /* (337) over_clause ::= OVER LP window RP */
174676 313, /* (338) over_clause ::= OVER nm */
174677 312, /* (339) filter_clause ::= FILTER LP WHERE expr RP */
174678 217, /* (340) term ::= QNUMBER */
174679 186, /* (341) input ::= cmdlist */
174680 187, /* (342) cmdlist ::= cmdlist ecmd */
174681 187, /* (343) cmdlist ::= ecmd */
174682 188, /* (344) ecmd ::= SEMI */
174683 188, /* (345) ecmd ::= cmdx SEMI */
174684 188, /* (346) ecmd ::= explain cmdx SEMI */
174685 193, /* (347) trans_opt ::= */
174686 193, /* (348) trans_opt ::= TRANSACTION */
174687 193, /* (349) trans_opt ::= TRANSACTION nm */
174688 195, /* (350) savepoint_opt ::= SAVEPOINT */
174689 195, /* (351) savepoint_opt ::= */
174690 191, /* (352) cmd ::= create_table create_table_args */
174691 204, /* (353) table_option_set ::= table_option */
174692 202, /* (354) columnlist ::= columnlist COMMA columnname carglist */
174693 202, /* (355) columnlist ::= columnname carglist */
174694 194, /* (356) nm ::= ID|INDEXED|JOIN_KW */
174695 194, /* (357) nm ::= STRING */
174696 209, /* (358) typetoken ::= typename */
174697 210, /* (359) typename ::= ID|STRING */
174698 211, /* (360) signed ::= plus_num */
174699 211, /* (361) signed ::= minus_num */
174700 208, /* (362) carglist ::= carglist ccons */
174701 208, /* (363) carglist ::= */
174702 216, /* (364) ccons ::= NULL onconf */
174703 216, /* (365) ccons ::= GENERATED ALWAYS AS generated */
174704 216, /* (366) ccons ::= AS generated */
174705 203, /* (367) conslist_opt ::= COMMA conslist */
174706 229, /* (368) conslist ::= conslist tconscomma tcons */
174707 229, /* (369) conslist ::= tcons */
174708 230, /* (370) tconscomma ::= */
174709 234, /* (371) defer_subclause_opt ::= defer_subclause */
174710 236, /* (372) resolvetype ::= raisetype */
174711 240, /* (373) selectnowith ::= oneselect */
174712 241, /* (374) oneselect ::= values */
174713 255, /* (375) sclp ::= selcollist COMMA */
174714 256, /* (376) as ::= ID|STRING */
174715 265, /* (377) indexed_opt ::= indexed_by */
174716 273, /* (378) returning ::= */
174717 218, /* (379) expr ::= term */
174718 275, /* (380) likeop ::= LIKE_KW|MATCH */
174719 279, /* (381) case_operand ::= expr */
174720 262, /* (382) exprlist ::= nexprlist */
174721 285, /* (383) nmnum ::= plus_num */
174722 285, /* (384) nmnum ::= nm */
174723 285, /* (385) nmnum ::= ON */
174724 285, /* (386) nmnum ::= DELETE */
174725 285, /* (387) nmnum ::= DEFAULT */
174726 212, /* (388) plus_num ::= INTEGER|FLOAT */
174727 290, /* (389) foreach_clause ::= */
174728 290, /* (390) foreach_clause ::= FOR EACH ROW */
174729 293, /* (391) trnm ::= nm */
174730 294, /* (392) tridxby ::= */
174731 295, /* (393) database_kw_opt ::= DATABASE */
174732 295, /* (394) database_kw_opt ::= */
174733 298, /* (395) kwcolumn_opt ::= */
174734 298, /* (396) kwcolumn_opt ::= COLUMNKW */
174735 300, /* (397) vtabarglist ::= vtabarg */
174736 300, /* (398) vtabarglist ::= vtabarglist COMMA vtabarg */
174737 301, /* (399) vtabarg ::= vtabarg vtabargtoken */
174738 304, /* (400) anylist ::= */
174739 304, /* (401) anylist ::= anylist LP anylist RP */
174740 304, /* (402) anylist ::= anylist ANY */
174741 267, /* (403) with ::= */
174742 307, /* (404) windowdefn_list ::= windowdefn */
174743 309, /* (405) window ::= frame_opt */
174744 };
174745
174746 /* For rule J, yyRuleInfoNRhs[J] contains the negative of the number
174747 ** of symbols on the right-hand side of that rule. */
174748 static const signed char yyRuleInfoNRhs[] = {
@@ -174797,75 +175084,76 @@
175084 -1, /* (335) filter_over ::= over_clause */
175085 -1, /* (336) filter_over ::= filter_clause */
175086 -4, /* (337) over_clause ::= OVER LP window RP */
175087 -2, /* (338) over_clause ::= OVER nm */
175088 -5, /* (339) filter_clause ::= FILTER LP WHERE expr RP */
175089 -1, /* (340) term ::= QNUMBER */
175090 -1, /* (341) input ::= cmdlist */
175091 -2, /* (342) cmdlist ::= cmdlist ecmd */
175092 -1, /* (343) cmdlist ::= ecmd */
175093 -1, /* (344) ecmd ::= SEMI */
175094 -2, /* (345) ecmd ::= cmdx SEMI */
175095 -3, /* (346) ecmd ::= explain cmdx SEMI */
175096 0, /* (347) trans_opt ::= */
175097 -1, /* (348) trans_opt ::= TRANSACTION */
175098 -2, /* (349) trans_opt ::= TRANSACTION nm */
175099 -1, /* (350) savepoint_opt ::= SAVEPOINT */
175100 0, /* (351) savepoint_opt ::= */
175101 -2, /* (352) cmd ::= create_table create_table_args */
175102 -1, /* (353) table_option_set ::= table_option */
175103 -4, /* (354) columnlist ::= columnlist COMMA columnname carglist */
175104 -2, /* (355) columnlist ::= columnname carglist */
175105 -1, /* (356) nm ::= ID|INDEXED|JOIN_KW */
175106 -1, /* (357) nm ::= STRING */
175107 -1, /* (358) typetoken ::= typename */
175108 -1, /* (359) typename ::= ID|STRING */
175109 -1, /* (360) signed ::= plus_num */
175110 -1, /* (361) signed ::= minus_num */
175111 -2, /* (362) carglist ::= carglist ccons */
175112 0, /* (363) carglist ::= */
175113 -2, /* (364) ccons ::= NULL onconf */
175114 -4, /* (365) ccons ::= GENERATED ALWAYS AS generated */
175115 -2, /* (366) ccons ::= AS generated */
175116 -2, /* (367) conslist_opt ::= COMMA conslist */
175117 -3, /* (368) conslist ::= conslist tconscomma tcons */
175118 -1, /* (369) conslist ::= tcons */
175119 0, /* (370) tconscomma ::= */
175120 -1, /* (371) defer_subclause_opt ::= defer_subclause */
175121 -1, /* (372) resolvetype ::= raisetype */
175122 -1, /* (373) selectnowith ::= oneselect */
175123 -1, /* (374) oneselect ::= values */
175124 -2, /* (375) sclp ::= selcollist COMMA */
175125 -1, /* (376) as ::= ID|STRING */
175126 -1, /* (377) indexed_opt ::= indexed_by */
175127 0, /* (378) returning ::= */
175128 -1, /* (379) expr ::= term */
175129 -1, /* (380) likeop ::= LIKE_KW|MATCH */
175130 -1, /* (381) case_operand ::= expr */
175131 -1, /* (382) exprlist ::= nexprlist */
175132 -1, /* (383) nmnum ::= plus_num */
175133 -1, /* (384) nmnum ::= nm */
175134 -1, /* (385) nmnum ::= ON */
175135 -1, /* (386) nmnum ::= DELETE */
175136 -1, /* (387) nmnum ::= DEFAULT */
175137 -1, /* (388) plus_num ::= INTEGER|FLOAT */
175138 0, /* (389) foreach_clause ::= */
175139 -3, /* (390) foreach_clause ::= FOR EACH ROW */
175140 -1, /* (391) trnm ::= nm */
175141 0, /* (392) tridxby ::= */
175142 -1, /* (393) database_kw_opt ::= DATABASE */
175143 0, /* (394) database_kw_opt ::= */
175144 0, /* (395) kwcolumn_opt ::= */
175145 -1, /* (396) kwcolumn_opt ::= COLUMNKW */
175146 -1, /* (397) vtabarglist ::= vtabarg */
175147 -3, /* (398) vtabarglist ::= vtabarglist COMMA vtabarg */
175148 -2, /* (399) vtabarg ::= vtabarg vtabargtoken */
175149 0, /* (400) anylist ::= */
175150 -4, /* (401) anylist ::= anylist LP anylist RP */
175151 -2, /* (402) anylist ::= anylist ANY */
175152 0, /* (403) with ::= */
175153 -1, /* (404) windowdefn_list ::= windowdefn */
175154 -1, /* (405) window ::= frame_opt */
175155 };
175156
175157 static void yy_accept(yyParser*); /* Forward Declaration */
175158
175159 /*
@@ -174913,20 +175201,20 @@
175201 break;
175202 case 2: /* cmdx ::= cmd */
175203 { sqlite3FinishCoding(pParse); }
175204 break;
175205 case 3: /* cmd ::= BEGIN transtype trans_opt */
175206 {sqlite3BeginTransaction(pParse, yymsp[-1].minor.yy92);}
175207 break;
175208 case 4: /* transtype ::= */
175209 {yymsp[1].minor.yy92 = TK_DEFERRED;}
175210 break;
175211 case 5: /* transtype ::= DEFERRED */
175212 case 6: /* transtype ::= IMMEDIATE */ yytestcase(yyruleno==6);
175213 case 7: /* transtype ::= EXCLUSIVE */ yytestcase(yyruleno==7);
175214 case 321: /* range_or_rows ::= RANGE|ROWS|GROUPS */ yytestcase(yyruleno==321);
175215 {yymsp[0].minor.yy92 = yymsp[0].major; /*A-overwrites-X*/}
175216 break;
175217 case 8: /* cmd ::= COMMIT|END trans_opt */
175218 case 9: /* cmd ::= ROLLBACK trans_opt */ yytestcase(yyruleno==9);
175219 {sqlite3EndTransaction(pParse,yymsp[-1].major);}
175220 break;
@@ -174945,11 +175233,11 @@
175233 sqlite3Savepoint(pParse, SAVEPOINT_ROLLBACK, &yymsp[0].minor.yy0);
175234 }
175235 break;
175236 case 13: /* create_table ::= createkw temp TABLE ifnotexists nm dbnm */
175237 {
175238 sqlite3StartTable(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,yymsp[-4].minor.yy92,0,0,yymsp[-2].minor.yy92);
175239 }
175240 break;
175241 case 14: /* createkw ::= CREATE */
175242 {disableLookaside(pParse);}
175243 break;
@@ -174959,56 +175247,56 @@
175247 case 62: /* init_deferred_pred_opt ::= */ yytestcase(yyruleno==62);
175248 case 72: /* defer_subclause_opt ::= */ yytestcase(yyruleno==72);
175249 case 81: /* ifexists ::= */ yytestcase(yyruleno==81);
175250 case 98: /* distinct ::= */ yytestcase(yyruleno==98);
175251 case 244: /* collate ::= */ yytestcase(yyruleno==244);
175252 {yymsp[1].minor.yy92 = 0;}
175253 break;
175254 case 16: /* ifnotexists ::= IF NOT EXISTS */
175255 {yymsp[-2].minor.yy92 = 1;}
175256 break;
175257 case 17: /* temp ::= TEMP */
175258 {yymsp[0].minor.yy92 = pParse->db->init.busy==0;}
175259 break;
175260 case 19: /* create_table_args ::= LP columnlist conslist_opt RP table_option_set */
175261 {
175262 sqlite3EndTable(pParse,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0,yymsp[0].minor.yy527,0);
175263 }
175264 break;
175265 case 20: /* create_table_args ::= AS select */
175266 {
175267 sqlite3EndTable(pParse,0,0,0,yymsp[0].minor.yy299);
175268 sqlite3SelectDelete(pParse->db, yymsp[0].minor.yy299);
175269 }
175270 break;
175271 case 21: /* table_option_set ::= */
175272 {yymsp[1].minor.yy527 = 0;}
175273 break;
175274 case 22: /* table_option_set ::= table_option_set COMMA table_option */
175275 {yylhsminor.yy527 = yymsp[-2].minor.yy527|yymsp[0].minor.yy527;}
175276 yymsp[-2].minor.yy527 = yylhsminor.yy527;
175277 break;
175278 case 23: /* table_option ::= WITHOUT nm */
175279 {
175280 if( yymsp[0].minor.yy0.n==5 && sqlite3_strnicmp(yymsp[0].minor.yy0.z,"rowid",5)==0 ){
175281 yymsp[-1].minor.yy527 = TF_WithoutRowid | TF_NoVisibleRowid;
175282 }else{
175283 yymsp[-1].minor.yy527 = 0;
175284 sqlite3ErrorMsg(pParse, "unknown table option: %.*s", yymsp[0].minor.yy0.n, yymsp[0].minor.yy0.z);
175285 }
175286 }
175287 break;
175288 case 24: /* table_option ::= nm */
175289 {
175290 if( yymsp[0].minor.yy0.n==6 && sqlite3_strnicmp(yymsp[0].minor.yy0.z,"strict",6)==0 ){
175291 yylhsminor.yy527 = TF_Strict;
175292 }else{
175293 yylhsminor.yy527 = 0;
175294 sqlite3ErrorMsg(pParse, "unknown table option: %.*s", yymsp[0].minor.yy0.n, yymsp[0].minor.yy0.z);
175295 }
175296 }
175297 yymsp[0].minor.yy527 = yylhsminor.yy527;
175298 break;
175299 case 25: /* columnname ::= nm typetoken */
175300 {sqlite3AddColumn(pParse,yymsp[-1].minor.yy0,yymsp[0].minor.yy0);}
175301 break;
175302 case 26: /* typetoken ::= */
@@ -175030,11 +175318,11 @@
175318 {yymsp[-1].minor.yy0.n=yymsp[0].minor.yy0.n+(int)(yymsp[0].minor.yy0.z-yymsp[-1].minor.yy0.z);}
175319 break;
175320 case 30: /* scanpt ::= */
175321 {
175322 assert( yyLookahead!=YYNOCODE );
175323 yymsp[1].minor.yy616 = yyLookaheadToken.z;
175324 }
175325 break;
175326 case 31: /* scantok ::= */
175327 {
175328 assert( yyLookahead!=YYNOCODE );
@@ -175044,21 +175332,21 @@
175332 case 32: /* ccons ::= CONSTRAINT nm */
175333 case 67: /* tcons ::= CONSTRAINT nm */ yytestcase(yyruleno==67);
175334 {pParse->constraintName = yymsp[0].minor.yy0;}
175335 break;
175336 case 33: /* ccons ::= DEFAULT scantok term */
175337 {sqlite3AddDefaultValue(pParse,yymsp[0].minor.yy2,yymsp[-1].minor.yy0.z,&yymsp[-1].minor.yy0.z[yymsp[-1].minor.yy0.n]);}
175338 break;
175339 case 34: /* ccons ::= DEFAULT LP expr RP */
175340 {sqlite3AddDefaultValue(pParse,yymsp[-1].minor.yy2,yymsp[-2].minor.yy0.z+1,yymsp[0].minor.yy0.z);}
175341 break;
175342 case 35: /* ccons ::= DEFAULT PLUS scantok term */
175343 {sqlite3AddDefaultValue(pParse,yymsp[0].minor.yy2,yymsp[-2].minor.yy0.z,&yymsp[-1].minor.yy0.z[yymsp[-1].minor.yy0.n]);}
175344 break;
175345 case 36: /* ccons ::= DEFAULT MINUS scantok term */
175346 {
175347 Expr *p = sqlite3PExpr(pParse, TK_UMINUS, yymsp[0].minor.yy2, 0);
175348 sqlite3AddDefaultValue(pParse,p,yymsp[-2].minor.yy0.z,&yymsp[-1].minor.yy0.z[yymsp[-1].minor.yy0.n]);
175349 }
175350 break;
175351 case 37: /* ccons ::= DEFAULT scantok ID|INDEXED */
175352 {
@@ -175069,261 +175357,261 @@
175357 }
175358 sqlite3AddDefaultValue(pParse,p,yymsp[0].minor.yy0.z,yymsp[0].minor.yy0.z+yymsp[0].minor.yy0.n);
175359 }
175360 break;
175361 case 38: /* ccons ::= NOT NULL onconf */
175362 {sqlite3AddNotNull(pParse, yymsp[0].minor.yy92);}
175363 break;
175364 case 39: /* ccons ::= PRIMARY KEY sortorder onconf autoinc */
175365 {sqlite3AddPrimaryKey(pParse,0,yymsp[-1].minor.yy92,yymsp[0].minor.yy92,yymsp[-2].minor.yy92);}
175366 break;
175367 case 40: /* ccons ::= UNIQUE onconf */
175368 {sqlite3CreateIndex(pParse,0,0,0,0,yymsp[0].minor.yy92,0,0,0,0,
175369 SQLITE_IDXTYPE_UNIQUE);}
175370 break;
175371 case 41: /* ccons ::= CHECK LP expr RP */
175372 {sqlite3AddCheckConstraint(pParse,yymsp[-1].minor.yy2,yymsp[-2].minor.yy0.z,yymsp[0].minor.yy0.z);}
175373 break;
175374 case 42: /* ccons ::= REFERENCES nm eidlist_opt refargs */
175375 {sqlite3CreateForeignKey(pParse,0,&yymsp[-2].minor.yy0,yymsp[-1].minor.yy402,yymsp[0].minor.yy92);}
175376 break;
175377 case 43: /* ccons ::= defer_subclause */
175378 {sqlite3DeferForeignKey(pParse,yymsp[0].minor.yy92);}
175379 break;
175380 case 44: /* ccons ::= COLLATE ID|STRING */
175381 {sqlite3AddCollateType(pParse, &yymsp[0].minor.yy0);}
175382 break;
175383 case 45: /* generated ::= LP expr RP */
175384 {sqlite3AddGenerated(pParse,yymsp[-1].minor.yy2,0);}
175385 break;
175386 case 46: /* generated ::= LP expr RP ID */
175387 {sqlite3AddGenerated(pParse,yymsp[-2].minor.yy2,&yymsp[0].minor.yy0);}
175388 break;
175389 case 48: /* autoinc ::= AUTOINCR */
175390 {yymsp[0].minor.yy92 = 1;}
175391 break;
175392 case 49: /* refargs ::= */
175393 { yymsp[1].minor.yy92 = OE_None*0x0101; /* EV: R-19803-45884 */}
175394 break;
175395 case 50: /* refargs ::= refargs refarg */
175396 { yymsp[-1].minor.yy92 = (yymsp[-1].minor.yy92 & ~yymsp[0].minor.yy367.mask) | yymsp[0].minor.yy367.value; }
175397 break;
175398 case 51: /* refarg ::= MATCH nm */
175399 { yymsp[-1].minor.yy367.value = 0; yymsp[-1].minor.yy367.mask = 0x000000; }
175400 break;
175401 case 52: /* refarg ::= ON INSERT refact */
175402 { yymsp[-2].minor.yy367.value = 0; yymsp[-2].minor.yy367.mask = 0x000000; }
175403 break;
175404 case 53: /* refarg ::= ON DELETE refact */
175405 { yymsp[-2].minor.yy367.value = yymsp[0].minor.yy92; yymsp[-2].minor.yy367.mask = 0x0000ff; }
175406 break;
175407 case 54: /* refarg ::= ON UPDATE refact */
175408 { yymsp[-2].minor.yy367.value = yymsp[0].minor.yy92<<8; yymsp[-2].minor.yy367.mask = 0x00ff00; }
175409 break;
175410 case 55: /* refact ::= SET NULL */
175411 { yymsp[-1].minor.yy92 = OE_SetNull; /* EV: R-33326-45252 */}
175412 break;
175413 case 56: /* refact ::= SET DEFAULT */
175414 { yymsp[-1].minor.yy92 = OE_SetDflt; /* EV: R-33326-45252 */}
175415 break;
175416 case 57: /* refact ::= CASCADE */
175417 { yymsp[0].minor.yy92 = OE_Cascade; /* EV: R-33326-45252 */}
175418 break;
175419 case 58: /* refact ::= RESTRICT */
175420 { yymsp[0].minor.yy92 = OE_Restrict; /* EV: R-33326-45252 */}
175421 break;
175422 case 59: /* refact ::= NO ACTION */
175423 { yymsp[-1].minor.yy92 = OE_None; /* EV: R-33326-45252 */}
175424 break;
175425 case 60: /* defer_subclause ::= NOT DEFERRABLE init_deferred_pred_opt */
175426 {yymsp[-2].minor.yy92 = 0;}
175427 break;
175428 case 61: /* defer_subclause ::= DEFERRABLE init_deferred_pred_opt */
175429 case 76: /* orconf ::= OR resolvetype */ yytestcase(yyruleno==76);
175430 case 171: /* insert_cmd ::= INSERT orconf */ yytestcase(yyruleno==171);
175431 {yymsp[-1].minor.yy92 = yymsp[0].minor.yy92;}
175432 break;
175433 case 63: /* init_deferred_pred_opt ::= INITIALLY DEFERRED */
175434 case 80: /* ifexists ::= IF EXISTS */ yytestcase(yyruleno==80);
175435 case 217: /* between_op ::= NOT BETWEEN */ yytestcase(yyruleno==217);
175436 case 220: /* in_op ::= NOT IN */ yytestcase(yyruleno==220);
175437 case 245: /* collate ::= COLLATE ID|STRING */ yytestcase(yyruleno==245);
175438 {yymsp[-1].minor.yy92 = 1;}
175439 break;
175440 case 64: /* init_deferred_pred_opt ::= INITIALLY IMMEDIATE */
175441 {yymsp[-1].minor.yy92 = 0;}
175442 break;
175443 case 66: /* tconscomma ::= COMMA */
175444 {pParse->constraintName.n = 0;}
175445 break;
175446 case 68: /* tcons ::= PRIMARY KEY LP sortlist autoinc RP onconf */
175447 {sqlite3AddPrimaryKey(pParse,yymsp[-3].minor.yy402,yymsp[0].minor.yy92,yymsp[-2].minor.yy92,0);}
175448 break;
175449 case 69: /* tcons ::= UNIQUE LP sortlist RP onconf */
175450 {sqlite3CreateIndex(pParse,0,0,0,yymsp[-2].minor.yy402,yymsp[0].minor.yy92,0,0,0,0,
175451 SQLITE_IDXTYPE_UNIQUE);}
175452 break;
175453 case 70: /* tcons ::= CHECK LP expr RP onconf */
175454 {sqlite3AddCheckConstraint(pParse,yymsp[-2].minor.yy2,yymsp[-3].minor.yy0.z,yymsp[-1].minor.yy0.z);}
175455 break;
175456 case 71: /* tcons ::= FOREIGN KEY LP eidlist RP REFERENCES nm eidlist_opt refargs defer_subclause_opt */
175457 {
175458 sqlite3CreateForeignKey(pParse, yymsp[-6].minor.yy402, &yymsp[-3].minor.yy0, yymsp[-2].minor.yy402, yymsp[-1].minor.yy92);
175459 sqlite3DeferForeignKey(pParse, yymsp[0].minor.yy92);
175460 }
175461 break;
175462 case 73: /* onconf ::= */
175463 case 75: /* orconf ::= */ yytestcase(yyruleno==75);
175464 {yymsp[1].minor.yy92 = OE_Default;}
175465 break;
175466 case 74: /* onconf ::= ON CONFLICT resolvetype */
175467 {yymsp[-2].minor.yy92 = yymsp[0].minor.yy92;}
175468 break;
175469 case 77: /* resolvetype ::= IGNORE */
175470 {yymsp[0].minor.yy92 = OE_Ignore;}
175471 break;
175472 case 78: /* resolvetype ::= REPLACE */
175473 case 172: /* insert_cmd ::= REPLACE */ yytestcase(yyruleno==172);
175474 {yymsp[0].minor.yy92 = OE_Replace;}
175475 break;
175476 case 79: /* cmd ::= DROP TABLE ifexists fullname */
175477 {
175478 sqlite3DropTable(pParse, yymsp[0].minor.yy387, 0, yymsp[-1].minor.yy92);
175479 }
175480 break;
175481 case 82: /* cmd ::= createkw temp VIEW ifnotexists nm dbnm eidlist_opt AS select */
175482 {
175483 sqlite3CreateView(pParse, &yymsp[-8].minor.yy0, &yymsp[-4].minor.yy0, &yymsp[-3].minor.yy0, yymsp[-2].minor.yy402, yymsp[0].minor.yy299, yymsp[-7].minor.yy92, yymsp[-5].minor.yy92);
175484 }
175485 break;
175486 case 83: /* cmd ::= DROP VIEW ifexists fullname */
175487 {
175488 sqlite3DropTable(pParse, yymsp[0].minor.yy387, 1, yymsp[-1].minor.yy92);
175489 }
175490 break;
175491 case 84: /* cmd ::= select */
175492 {
175493 SelectDest dest = {SRT_Output, 0, 0, 0, 0, 0, 0};
175494 sqlite3Select(pParse, yymsp[0].minor.yy299, &dest);
175495 sqlite3SelectDelete(pParse->db, yymsp[0].minor.yy299);
175496 }
175497 break;
175498 case 85: /* select ::= WITH wqlist selectnowith */
175499 {yymsp[-2].minor.yy299 = attachWithToSelect(pParse,yymsp[0].minor.yy299,yymsp[-1].minor.yy131);}
175500 break;
175501 case 86: /* select ::= WITH RECURSIVE wqlist selectnowith */
175502 {yymsp[-3].minor.yy299 = attachWithToSelect(pParse,yymsp[0].minor.yy299,yymsp[-1].minor.yy131);}
175503 break;
175504 case 87: /* select ::= selectnowith */
175505 {
175506 Select *p = yymsp[0].minor.yy299;
175507 if( p ){
175508 parserDoubleLinkSelect(pParse, p);
175509 }
175510 }
175511 break;
175512 case 88: /* selectnowith ::= selectnowith multiselect_op oneselect */
175513 {
175514 Select *pRhs = yymsp[0].minor.yy299;
175515 Select *pLhs = yymsp[-2].minor.yy299;
175516 if( pRhs && pRhs->pPrior ){
175517 SrcList *pFrom;
175518 Token x;
175519 x.n = 0;
175520 parserDoubleLinkSelect(pParse, pRhs);
175521 pFrom = sqlite3SrcListAppendFromTerm(pParse,0,0,0,&x,pRhs,0);
175522 pRhs = sqlite3SelectNew(pParse,0,pFrom,0,0,0,0,0,0);
175523 }
175524 if( pRhs ){
175525 pRhs->op = (u8)yymsp[-1].minor.yy92;
175526 pRhs->pPrior = pLhs;
175527 if( ALWAYS(pLhs) ) pLhs->selFlags &= ~SF_MultiValue;
175528 pRhs->selFlags &= ~SF_MultiValue;
175529 if( yymsp[-1].minor.yy92!=TK_ALL ) pParse->hasCompound = 1;
175530 }else{
175531 sqlite3SelectDelete(pParse->db, pLhs);
175532 }
175533 yymsp[-2].minor.yy299 = pRhs;
175534 }
175535 break;
175536 case 89: /* multiselect_op ::= UNION */
175537 case 91: /* multiselect_op ::= EXCEPT|INTERSECT */ yytestcase(yyruleno==91);
175538 {yymsp[0].minor.yy92 = yymsp[0].major; /*A-overwrites-OP*/}
175539 break;
175540 case 90: /* multiselect_op ::= UNION ALL */
175541 {yymsp[-1].minor.yy92 = TK_ALL;}
175542 break;
175543 case 92: /* oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt orderby_opt limit_opt */
175544 {
175545 yymsp[-8].minor.yy299 = sqlite3SelectNew(pParse,yymsp[-6].minor.yy402,yymsp[-5].minor.yy387,yymsp[-4].minor.yy2,yymsp[-3].minor.yy402,yymsp[-2].minor.yy2,yymsp[-1].minor.yy402,yymsp[-7].minor.yy92,yymsp[0].minor.yy2);
175546 }
175547 break;
175548 case 93: /* oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt window_clause orderby_opt limit_opt */
175549 {
175550 yymsp[-9].minor.yy299 = sqlite3SelectNew(pParse,yymsp[-7].minor.yy402,yymsp[-6].minor.yy387,yymsp[-5].minor.yy2,yymsp[-4].minor.yy402,yymsp[-3].minor.yy2,yymsp[-1].minor.yy402,yymsp[-8].minor.yy92,yymsp[0].minor.yy2);
175551 if( yymsp[-9].minor.yy299 ){
175552 yymsp[-9].minor.yy299->pWinDefn = yymsp[-2].minor.yy3;
175553 }else{
175554 sqlite3WindowListDelete(pParse->db, yymsp[-2].minor.yy3);
175555 }
175556 }
175557 break;
175558 case 94: /* values ::= VALUES LP nexprlist RP */
175559 {
175560 yymsp[-3].minor.yy299 = sqlite3SelectNew(pParse,yymsp[-1].minor.yy402,0,0,0,0,0,SF_Values,0);
175561 }
175562 break;
175563 case 95: /* values ::= values COMMA LP nexprlist RP */
175564 {
175565 Select *pRight, *pLeft = yymsp[-4].minor.yy299;
175566 pRight = sqlite3SelectNew(pParse,yymsp[-1].minor.yy402,0,0,0,0,0,SF_Values|SF_MultiValue,0);
175567 if( ALWAYS(pLeft) ) pLeft->selFlags &= ~SF_MultiValue;
175568 if( pRight ){
175569 pRight->op = TK_ALL;
175570 pRight->pPrior = pLeft;
175571 yymsp[-4].minor.yy299 = pRight;
175572 }else{
175573 yymsp[-4].minor.yy299 = pLeft;
175574 }
175575 }
175576 break;
175577 case 96: /* distinct ::= DISTINCT */
175578 {yymsp[0].minor.yy92 = SF_Distinct;}
175579 break;
175580 case 97: /* distinct ::= ALL */
175581 {yymsp[0].minor.yy92 = SF_All;}
175582 break;
175583 case 99: /* sclp ::= */
175584 case 132: /* orderby_opt ::= */ yytestcase(yyruleno==132);
175585 case 142: /* groupby_opt ::= */ yytestcase(yyruleno==142);
175586 case 232: /* exprlist ::= */ yytestcase(yyruleno==232);
175587 case 235: /* paren_exprlist ::= */ yytestcase(yyruleno==235);
175588 case 240: /* eidlist_opt ::= */ yytestcase(yyruleno==240);
175589 {yymsp[1].minor.yy402 = 0;}
175590 break;
175591 case 100: /* selcollist ::= sclp scanpt expr scanpt as */
175592 {
175593 yymsp[-4].minor.yy402 = sqlite3ExprListAppend(pParse, yymsp[-4].minor.yy402, yymsp[-2].minor.yy2);
175594 if( yymsp[0].minor.yy0.n>0 ) sqlite3ExprListSetName(pParse, yymsp[-4].minor.yy402, &yymsp[0].minor.yy0, 1);
175595 sqlite3ExprListSetSpan(pParse,yymsp[-4].minor.yy402,yymsp[-3].minor.yy616,yymsp[-1].minor.yy616);
175596 }
175597 break;
175598 case 101: /* selcollist ::= sclp scanpt STAR */
175599 {
175600 Expr *p = sqlite3Expr(pParse->db, TK_ASTERISK, 0);
175601 sqlite3ExprSetErrorOffset(p, (int)(yymsp[0].minor.yy0.z - pParse->zTail));
175602 yymsp[-2].minor.yy402 = sqlite3ExprListAppend(pParse, yymsp[-2].minor.yy402, p);
175603 }
175604 break;
175605 case 102: /* selcollist ::= sclp scanpt nm DOT STAR */
175606 {
175607 Expr *pRight, *pLeft, *pDot;
175608 pRight = sqlite3PExpr(pParse, TK_ASTERISK, 0, 0);
175609 sqlite3ExprSetErrorOffset(pRight, (int)(yymsp[0].minor.yy0.z - pParse->zTail));
175610 pLeft = tokenExpr(pParse, TK_ID, yymsp[-2].minor.yy0);
175611 pDot = sqlite3PExpr(pParse, TK_DOT, pLeft, pRight);
175612 yymsp[-4].minor.yy402 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy402, pDot);
175613 }
175614 break;
175615 case 103: /* as ::= AS nm */
175616 case 115: /* dbnm ::= DOT nm */ yytestcase(yyruleno==115);
175617 case 256: /* plus_num ::= PLUS INTEGER|FLOAT */ yytestcase(yyruleno==256);
@@ -175330,54 +175618,54 @@
175618 case 257: /* minus_num ::= MINUS INTEGER|FLOAT */ yytestcase(yyruleno==257);
175619 {yymsp[-1].minor.yy0 = yymsp[0].minor.yy0;}
175620 break;
175621 case 105: /* from ::= */
175622 case 108: /* stl_prefix ::= */ yytestcase(yyruleno==108);
175623 {yymsp[1].minor.yy387 = 0;}
175624 break;
175625 case 106: /* from ::= FROM seltablist */
175626 {
175627 yymsp[-1].minor.yy387 = yymsp[0].minor.yy387;
175628 sqlite3SrcListShiftJoinType(pParse,yymsp[-1].minor.yy387);
175629 }
175630 break;
175631 case 107: /* stl_prefix ::= seltablist joinop */
175632 {
175633 if( ALWAYS(yymsp[-1].minor.yy387 && yymsp[-1].minor.yy387->nSrc>0) ) yymsp[-1].minor.yy387->a[yymsp[-1].minor.yy387->nSrc-1].fg.jointype = (u8)yymsp[0].minor.yy92;
175634 }
175635 break;
175636 case 109: /* seltablist ::= stl_prefix nm dbnm as on_using */
175637 {
175638 yymsp[-4].minor.yy387 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-4].minor.yy387,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0,0,&yymsp[0].minor.yy305);
175639 }
175640 break;
175641 case 110: /* seltablist ::= stl_prefix nm dbnm as indexed_by on_using */
175642 {
175643 yymsp[-5].minor.yy387 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-5].minor.yy387,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,0,&yymsp[0].minor.yy305);
175644 sqlite3SrcListIndexedBy(pParse, yymsp[-5].minor.yy387, &yymsp[-1].minor.yy0);
175645 }
175646 break;
175647 case 111: /* seltablist ::= stl_prefix nm dbnm LP exprlist RP as on_using */
175648 {
175649 yymsp[-7].minor.yy387 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-7].minor.yy387,&yymsp[-6].minor.yy0,&yymsp[-5].minor.yy0,&yymsp[-1].minor.yy0,0,&yymsp[0].minor.yy305);
175650 sqlite3SrcListFuncArgs(pParse, yymsp[-7].minor.yy387, yymsp[-3].minor.yy402);
175651 }
175652 break;
175653 case 112: /* seltablist ::= stl_prefix LP select RP as on_using */
175654 {
175655 yymsp[-5].minor.yy387 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-5].minor.yy387,0,0,&yymsp[-1].minor.yy0,yymsp[-3].minor.yy299,&yymsp[0].minor.yy305);
175656 }
175657 break;
175658 case 113: /* seltablist ::= stl_prefix LP seltablist RP as on_using */
175659 {
175660 if( yymsp[-5].minor.yy387==0 && yymsp[-1].minor.yy0.n==0 && yymsp[0].minor.yy305.pOn==0 && yymsp[0].minor.yy305.pUsing==0 ){
175661 yymsp[-5].minor.yy387 = yymsp[-3].minor.yy387;
175662 }else if( ALWAYS(yymsp[-3].minor.yy387!=0) && yymsp[-3].minor.yy387->nSrc==1 ){
175663 yymsp[-5].minor.yy387 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-5].minor.yy387,0,0,&yymsp[-1].minor.yy0,0,&yymsp[0].minor.yy305);
175664 if( yymsp[-5].minor.yy387 ){
175665 SrcItem *pNew = &yymsp[-5].minor.yy387->a[yymsp[-5].minor.yy387->nSrc-1];
175666 SrcItem *pOld = yymsp[-3].minor.yy387->a;
175667 pNew->zName = pOld->zName;
175668 pNew->zDatabase = pOld->zDatabase;
175669 pNew->pSelect = pOld->pSelect;
175670 if( pNew->pSelect && (pNew->pSelect->selFlags & SF_NestedFrom)!=0 ){
175671 pNew->fg.isNestedFrom = 1;
@@ -175389,249 +175677,249 @@
175677 pNew->fg.isTabFunc = 1;
175678 }
175679 pOld->zName = pOld->zDatabase = 0;
175680 pOld->pSelect = 0;
175681 }
175682 sqlite3SrcListDelete(pParse->db, yymsp[-3].minor.yy387);
175683 }else{
175684 Select *pSubquery;
175685 sqlite3SrcListShiftJoinType(pParse,yymsp[-3].minor.yy387);
175686 pSubquery = sqlite3SelectNew(pParse,0,yymsp[-3].minor.yy387,0,0,0,0,SF_NestedFrom,0);
175687 yymsp[-5].minor.yy387 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-5].minor.yy387,0,0,&yymsp[-1].minor.yy0,pSubquery,&yymsp[0].minor.yy305);
175688 }
175689 }
175690 break;
175691 case 114: /* dbnm ::= */
175692 case 129: /* indexed_opt ::= */ yytestcase(yyruleno==129);
175693 {yymsp[1].minor.yy0.z=0; yymsp[1].minor.yy0.n=0;}
175694 break;
175695 case 116: /* fullname ::= nm */
175696 {
175697 yylhsminor.yy387 = sqlite3SrcListAppend(pParse,0,&yymsp[0].minor.yy0,0);
175698 if( IN_RENAME_OBJECT && yylhsminor.yy387 ) sqlite3RenameTokenMap(pParse, yylhsminor.yy387->a[0].zName, &yymsp[0].minor.yy0);
175699 }
175700 yymsp[0].minor.yy387 = yylhsminor.yy387;
175701 break;
175702 case 117: /* fullname ::= nm DOT nm */
175703 {
175704 yylhsminor.yy387 = sqlite3SrcListAppend(pParse,0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0);
175705 if( IN_RENAME_OBJECT && yylhsminor.yy387 ) sqlite3RenameTokenMap(pParse, yylhsminor.yy387->a[0].zName, &yymsp[0].minor.yy0);
175706 }
175707 yymsp[-2].minor.yy387 = yylhsminor.yy387;
175708 break;
175709 case 118: /* xfullname ::= nm */
175710 {yymsp[0].minor.yy387 = sqlite3SrcListAppend(pParse,0,&yymsp[0].minor.yy0,0); /*A-overwrites-X*/}
175711 break;
175712 case 119: /* xfullname ::= nm DOT nm */
175713 {yymsp[-2].minor.yy387 = sqlite3SrcListAppend(pParse,0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0); /*A-overwrites-X*/}
175714 break;
175715 case 120: /* xfullname ::= nm DOT nm AS nm */
175716 {
175717 yymsp[-4].minor.yy387 = sqlite3SrcListAppend(pParse,0,&yymsp[-4].minor.yy0,&yymsp[-2].minor.yy0); /*A-overwrites-X*/
175718 if( yymsp[-4].minor.yy387 ) yymsp[-4].minor.yy387->a[0].zAlias = sqlite3NameFromToken(pParse->db, &yymsp[0].minor.yy0);
175719 }
175720 break;
175721 case 121: /* xfullname ::= nm AS nm */
175722 {
175723 yymsp[-2].minor.yy387 = sqlite3SrcListAppend(pParse,0,&yymsp[-2].minor.yy0,0); /*A-overwrites-X*/
175724 if( yymsp[-2].minor.yy387 ) yymsp[-2].minor.yy387->a[0].zAlias = sqlite3NameFromToken(pParse->db, &yymsp[0].minor.yy0);
175725 }
175726 break;
175727 case 122: /* joinop ::= COMMA|JOIN */
175728 { yymsp[0].minor.yy92 = JT_INNER; }
175729 break;
175730 case 123: /* joinop ::= JOIN_KW JOIN */
175731 {yymsp[-1].minor.yy92 = sqlite3JoinType(pParse,&yymsp[-1].minor.yy0,0,0); /*X-overwrites-A*/}
175732 break;
175733 case 124: /* joinop ::= JOIN_KW nm JOIN */
175734 {yymsp[-2].minor.yy92 = sqlite3JoinType(pParse,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0,0); /*X-overwrites-A*/}
175735 break;
175736 case 125: /* joinop ::= JOIN_KW nm nm JOIN */
175737 {yymsp[-3].minor.yy92 = sqlite3JoinType(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0);/*X-overwrites-A*/}
175738 break;
175739 case 126: /* on_using ::= ON expr */
175740 {yymsp[-1].minor.yy305.pOn = yymsp[0].minor.yy2; yymsp[-1].minor.yy305.pUsing = 0;}
175741 break;
175742 case 127: /* on_using ::= USING LP idlist RP */
175743 {yymsp[-3].minor.yy305.pOn = 0; yymsp[-3].minor.yy305.pUsing = yymsp[-1].minor.yy400;}
175744 break;
175745 case 128: /* on_using ::= */
175746 {yymsp[1].minor.yy305.pOn = 0; yymsp[1].minor.yy305.pUsing = 0;}
175747 break;
175748 case 130: /* indexed_by ::= INDEXED BY nm */
175749 {yymsp[-2].minor.yy0 = yymsp[0].minor.yy0;}
175750 break;
175751 case 131: /* indexed_by ::= NOT INDEXED */
175752 {yymsp[-1].minor.yy0.z=0; yymsp[-1].minor.yy0.n=1;}
175753 break;
175754 case 133: /* orderby_opt ::= ORDER BY sortlist */
175755 case 143: /* groupby_opt ::= GROUP BY nexprlist */ yytestcase(yyruleno==143);
175756 {yymsp[-2].minor.yy402 = yymsp[0].minor.yy402;}
175757 break;
175758 case 134: /* sortlist ::= sortlist COMMA expr sortorder nulls */
175759 {
175760 yymsp[-4].minor.yy402 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy402,yymsp[-2].minor.yy2);
175761 sqlite3ExprListSetSortOrder(yymsp[-4].minor.yy402,yymsp[-1].minor.yy92,yymsp[0].minor.yy92);
175762 }
175763 break;
175764 case 135: /* sortlist ::= expr sortorder nulls */
175765 {
175766 yymsp[-2].minor.yy402 = sqlite3ExprListAppend(pParse,0,yymsp[-2].minor.yy2); /*A-overwrites-Y*/
175767 sqlite3ExprListSetSortOrder(yymsp[-2].minor.yy402,yymsp[-1].minor.yy92,yymsp[0].minor.yy92);
175768 }
175769 break;
175770 case 136: /* sortorder ::= ASC */
175771 {yymsp[0].minor.yy92 = SQLITE_SO_ASC;}
175772 break;
175773 case 137: /* sortorder ::= DESC */
175774 {yymsp[0].minor.yy92 = SQLITE_SO_DESC;}
175775 break;
175776 case 138: /* sortorder ::= */
175777 case 141: /* nulls ::= */ yytestcase(yyruleno==141);
175778 {yymsp[1].minor.yy92 = SQLITE_SO_UNDEFINED;}
175779 break;
175780 case 139: /* nulls ::= NULLS FIRST */
175781 {yymsp[-1].minor.yy92 = SQLITE_SO_ASC;}
175782 break;
175783 case 140: /* nulls ::= NULLS LAST */
175784 {yymsp[-1].minor.yy92 = SQLITE_SO_DESC;}
175785 break;
175786 case 144: /* having_opt ::= */
175787 case 146: /* limit_opt ::= */ yytestcase(yyruleno==146);
175788 case 151: /* where_opt ::= */ yytestcase(yyruleno==151);
175789 case 153: /* where_opt_ret ::= */ yytestcase(yyruleno==153);
175790 case 230: /* case_else ::= */ yytestcase(yyruleno==230);
175791 case 231: /* case_operand ::= */ yytestcase(yyruleno==231);
175792 case 250: /* vinto ::= */ yytestcase(yyruleno==250);
175793 {yymsp[1].minor.yy2 = 0;}
175794 break;
175795 case 145: /* having_opt ::= HAVING expr */
175796 case 152: /* where_opt ::= WHERE expr */ yytestcase(yyruleno==152);
175797 case 154: /* where_opt_ret ::= WHERE expr */ yytestcase(yyruleno==154);
175798 case 229: /* case_else ::= ELSE expr */ yytestcase(yyruleno==229);
175799 case 249: /* vinto ::= INTO expr */ yytestcase(yyruleno==249);
175800 {yymsp[-1].minor.yy2 = yymsp[0].minor.yy2;}
175801 break;
175802 case 147: /* limit_opt ::= LIMIT expr */
175803 {yymsp[-1].minor.yy2 = sqlite3PExpr(pParse,TK_LIMIT,yymsp[0].minor.yy2,0);}
175804 break;
175805 case 148: /* limit_opt ::= LIMIT expr OFFSET expr */
175806 {yymsp[-3].minor.yy2 = sqlite3PExpr(pParse,TK_LIMIT,yymsp[-2].minor.yy2,yymsp[0].minor.yy2);}
175807 break;
175808 case 149: /* limit_opt ::= LIMIT expr COMMA expr */
175809 {yymsp[-3].minor.yy2 = sqlite3PExpr(pParse,TK_LIMIT,yymsp[0].minor.yy2,yymsp[-2].minor.yy2);}
175810 break;
175811 case 150: /* cmd ::= with DELETE FROM xfullname indexed_opt where_opt_ret */
175812 {
175813 sqlite3SrcListIndexedBy(pParse, yymsp[-2].minor.yy387, &yymsp[-1].minor.yy0);
175814 sqlite3DeleteFrom(pParse,yymsp[-2].minor.yy387,yymsp[0].minor.yy2,0,0);
175815 }
175816 break;
175817 case 155: /* where_opt_ret ::= RETURNING selcollist */
175818 {sqlite3AddReturning(pParse,yymsp[0].minor.yy402); yymsp[-1].minor.yy2 = 0;}
175819 break;
175820 case 156: /* where_opt_ret ::= WHERE expr RETURNING selcollist */
175821 {sqlite3AddReturning(pParse,yymsp[0].minor.yy402); yymsp[-3].minor.yy2 = yymsp[-2].minor.yy2;}
175822 break;
175823 case 157: /* cmd ::= with UPDATE orconf xfullname indexed_opt SET setlist from where_opt_ret */
175824 {
175825 sqlite3SrcListIndexedBy(pParse, yymsp[-5].minor.yy387, &yymsp[-4].minor.yy0);
175826 sqlite3ExprListCheckLength(pParse,yymsp[-2].minor.yy402,"set list");
175827 if( yymsp[-1].minor.yy387 ){
175828 SrcList *pFromClause = yymsp[-1].minor.yy387;
175829 if( pFromClause->nSrc>1 ){
175830 Select *pSubquery;
175831 Token as;
175832 pSubquery = sqlite3SelectNew(pParse,0,pFromClause,0,0,0,0,SF_NestedFrom,0);
175833 as.n = 0;
175834 as.z = 0;
175835 pFromClause = sqlite3SrcListAppendFromTerm(pParse,0,0,0,&as,pSubquery,0);
175836 }
175837 yymsp[-5].minor.yy387 = sqlite3SrcListAppendList(pParse, yymsp[-5].minor.yy387, pFromClause);
175838 }
175839 sqlite3Update(pParse,yymsp[-5].minor.yy387,yymsp[-2].minor.yy402,yymsp[0].minor.yy2,yymsp[-6].minor.yy92,0,0,0);
175840 }
175841 break;
175842 case 158: /* setlist ::= setlist COMMA nm EQ expr */
175843 {
175844 yymsp[-4].minor.yy402 = sqlite3ExprListAppend(pParse, yymsp[-4].minor.yy402, yymsp[0].minor.yy2);
175845 sqlite3ExprListSetName(pParse, yymsp[-4].minor.yy402, &yymsp[-2].minor.yy0, 1);
175846 }
175847 break;
175848 case 159: /* setlist ::= setlist COMMA LP idlist RP EQ expr */
175849 {
175850 yymsp[-6].minor.yy402 = sqlite3ExprListAppendVector(pParse, yymsp[-6].minor.yy402, yymsp[-3].minor.yy400, yymsp[0].minor.yy2);
175851 }
175852 break;
175853 case 160: /* setlist ::= nm EQ expr */
175854 {
175855 yylhsminor.yy402 = sqlite3ExprListAppend(pParse, 0, yymsp[0].minor.yy2);
175856 sqlite3ExprListSetName(pParse, yylhsminor.yy402, &yymsp[-2].minor.yy0, 1);
175857 }
175858 yymsp[-2].minor.yy402 = yylhsminor.yy402;
175859 break;
175860 case 161: /* setlist ::= LP idlist RP EQ expr */
175861 {
175862 yymsp[-4].minor.yy402 = sqlite3ExprListAppendVector(pParse, 0, yymsp[-3].minor.yy400, yymsp[0].minor.yy2);
175863 }
175864 break;
175865 case 162: /* cmd ::= with insert_cmd INTO xfullname idlist_opt select upsert */
175866 {
175867 sqlite3Insert(pParse, yymsp[-3].minor.yy387, yymsp[-1].minor.yy299, yymsp[-2].minor.yy400, yymsp[-5].minor.yy92, yymsp[0].minor.yy258);
175868 }
175869 break;
175870 case 163: /* cmd ::= with insert_cmd INTO xfullname idlist_opt DEFAULT VALUES returning */
175871 {
175872 sqlite3Insert(pParse, yymsp[-4].minor.yy387, 0, yymsp[-3].minor.yy400, yymsp[-6].minor.yy92, 0);
175873 }
175874 break;
175875 case 164: /* upsert ::= */
175876 { yymsp[1].minor.yy258 = 0; }
175877 break;
175878 case 165: /* upsert ::= RETURNING selcollist */
175879 { yymsp[-1].minor.yy258 = 0; sqlite3AddReturning(pParse,yymsp[0].minor.yy402); }
175880 break;
175881 case 166: /* upsert ::= ON CONFLICT LP sortlist RP where_opt DO UPDATE SET setlist where_opt upsert */
175882 { yymsp[-11].minor.yy258 = sqlite3UpsertNew(pParse->db,yymsp[-8].minor.yy402,yymsp[-6].minor.yy2,yymsp[-2].minor.yy402,yymsp[-1].minor.yy2,yymsp[0].minor.yy258);}
175883 break;
175884 case 167: /* upsert ::= ON CONFLICT LP sortlist RP where_opt DO NOTHING upsert */
175885 { yymsp[-8].minor.yy258 = sqlite3UpsertNew(pParse->db,yymsp[-5].minor.yy402,yymsp[-3].minor.yy2,0,0,yymsp[0].minor.yy258); }
175886 break;
175887 case 168: /* upsert ::= ON CONFLICT DO NOTHING returning */
175888 { yymsp[-4].minor.yy258 = sqlite3UpsertNew(pParse->db,0,0,0,0,0); }
175889 break;
175890 case 169: /* upsert ::= ON CONFLICT DO UPDATE SET setlist where_opt returning */
175891 { yymsp[-7].minor.yy258 = sqlite3UpsertNew(pParse->db,0,0,yymsp[-2].minor.yy402,yymsp[-1].minor.yy2,0);}
175892 break;
175893 case 170: /* returning ::= RETURNING selcollist */
175894 {sqlite3AddReturning(pParse,yymsp[0].minor.yy402);}
175895 break;
175896 case 173: /* idlist_opt ::= */
175897 {yymsp[1].minor.yy400 = 0;}
175898 break;
175899 case 174: /* idlist_opt ::= LP idlist RP */
175900 {yymsp[-2].minor.yy400 = yymsp[-1].minor.yy400;}
175901 break;
175902 case 175: /* idlist ::= idlist COMMA nm */
175903 {yymsp[-2].minor.yy400 = sqlite3IdListAppend(pParse,yymsp[-2].minor.yy400,&yymsp[0].minor.yy0);}
175904 break;
175905 case 176: /* idlist ::= nm */
175906 {yymsp[0].minor.yy400 = sqlite3IdListAppend(pParse,0,&yymsp[0].minor.yy0); /*A-overwrites-Y*/}
175907 break;
175908 case 177: /* expr ::= LP expr RP */
175909 {yymsp[-2].minor.yy2 = yymsp[-1].minor.yy2;}
175910 break;
175911 case 178: /* expr ::= ID|INDEXED|JOIN_KW */
175912 {yymsp[0].minor.yy2=tokenExpr(pParse,TK_ID,yymsp[0].minor.yy0); /*A-overwrites-X*/}
175913 break;
175914 case 179: /* expr ::= nm DOT nm */
175915 {
175916 Expr *temp1 = tokenExpr(pParse,TK_ID,yymsp[-2].minor.yy0);
175917 Expr *temp2 = tokenExpr(pParse,TK_ID,yymsp[0].minor.yy0);
175918 yylhsminor.yy2 = sqlite3PExpr(pParse, TK_DOT, temp1, temp2);
175919 }
175920 yymsp[-2].minor.yy2 = yylhsminor.yy2;
175921 break;
175922 case 180: /* expr ::= nm DOT nm DOT nm */
175923 {
175924 Expr *temp1 = tokenExpr(pParse,TK_ID,yymsp[-4].minor.yy0);
175925 Expr *temp2 = tokenExpr(pParse,TK_ID,yymsp[-2].minor.yy0);
@@ -175638,369 +175926,369 @@
175926 Expr *temp3 = tokenExpr(pParse,TK_ID,yymsp[0].minor.yy0);
175927 Expr *temp4 = sqlite3PExpr(pParse, TK_DOT, temp2, temp3);
175928 if( IN_RENAME_OBJECT ){
175929 sqlite3RenameTokenRemap(pParse, 0, temp1);
175930 }
175931 yylhsminor.yy2 = sqlite3PExpr(pParse, TK_DOT, temp1, temp4);
175932 }
175933 yymsp[-4].minor.yy2 = yylhsminor.yy2;
175934 break;
175935 case 181: /* term ::= NULL|FLOAT|BLOB */
175936 case 182: /* term ::= STRING */ yytestcase(yyruleno==182);
175937 {yymsp[0].minor.yy2=tokenExpr(pParse,yymsp[0].major,yymsp[0].minor.yy0); /*A-overwrites-X*/}
175938 break;
175939 case 183: /* term ::= INTEGER */
175940 {
175941 yylhsminor.yy2 = sqlite3ExprAlloc(pParse->db, TK_INTEGER, &yymsp[0].minor.yy0, 1);
175942 if( yylhsminor.yy2 ) yylhsminor.yy2->w.iOfst = (int)(yymsp[0].minor.yy0.z - pParse->zTail);
175943 }
175944 yymsp[0].minor.yy2 = yylhsminor.yy2;
175945 break;
175946 case 184: /* expr ::= VARIABLE */
175947 {
175948 if( !(yymsp[0].minor.yy0.z[0]=='#' && sqlite3Isdigit(yymsp[0].minor.yy0.z[1])) ){
175949 u32 n = yymsp[0].minor.yy0.n;
175950 yymsp[0].minor.yy2 = tokenExpr(pParse, TK_VARIABLE, yymsp[0].minor.yy0);
175951 sqlite3ExprAssignVarNumber(pParse, yymsp[0].minor.yy2, n);
175952 }else{
175953 /* When doing a nested parse, one can include terms in an expression
175954 ** that look like this: #1 #2 ... These terms refer to registers
175955 ** in the virtual machine. #N is the N-th register. */
175956 Token t = yymsp[0].minor.yy0; /*A-overwrites-X*/
175957 assert( t.n>=2 );
175958 if( pParse->nested==0 ){
175959 sqlite3ErrorMsg(pParse, "near \"%T\": syntax error", &t);
175960 yymsp[0].minor.yy2 = 0;
175961 }else{
175962 yymsp[0].minor.yy2 = sqlite3PExpr(pParse, TK_REGISTER, 0, 0);
175963 if( yymsp[0].minor.yy2 ) sqlite3GetInt32(&t.z[1], &yymsp[0].minor.yy2->iTable);
175964 }
175965 }
175966 }
175967 break;
175968 case 185: /* expr ::= expr COLLATE ID|STRING */
175969 {
175970 yymsp[-2].minor.yy2 = sqlite3ExprAddCollateToken(pParse, yymsp[-2].minor.yy2, &yymsp[0].minor.yy0, 1);
175971 }
175972 break;
175973 case 186: /* expr ::= CAST LP expr AS typetoken RP */
175974 {
175975 yymsp[-5].minor.yy2 = sqlite3ExprAlloc(pParse->db, TK_CAST, &yymsp[-1].minor.yy0, 1);
175976 sqlite3ExprAttachSubtrees(pParse->db, yymsp[-5].minor.yy2, yymsp[-3].minor.yy2, 0);
175977 }
175978 break;
175979 case 187: /* expr ::= ID|INDEXED|JOIN_KW LP distinct exprlist RP */
175980 {
175981 yylhsminor.yy2 = sqlite3ExprFunction(pParse, yymsp[-1].minor.yy402, &yymsp[-4].minor.yy0, yymsp[-2].minor.yy92);
175982 }
175983 yymsp[-4].minor.yy2 = yylhsminor.yy2;
175984 break;
175985 case 188: /* expr ::= ID|INDEXED|JOIN_KW LP distinct exprlist ORDER BY sortlist RP */
175986 {
175987 yylhsminor.yy2 = sqlite3ExprFunction(pParse, yymsp[-4].minor.yy402, &yymsp[-7].minor.yy0, yymsp[-5].minor.yy92);
175988 sqlite3ExprAddFunctionOrderBy(pParse, yylhsminor.yy2, yymsp[-1].minor.yy402);
175989 }
175990 yymsp[-7].minor.yy2 = yylhsminor.yy2;
175991 break;
175992 case 189: /* expr ::= ID|INDEXED|JOIN_KW LP STAR RP */
175993 {
175994 yylhsminor.yy2 = sqlite3ExprFunction(pParse, 0, &yymsp[-3].minor.yy0, 0);
175995 }
175996 yymsp[-3].minor.yy2 = yylhsminor.yy2;
175997 break;
175998 case 190: /* expr ::= ID|INDEXED|JOIN_KW LP distinct exprlist RP filter_over */
175999 {
176000 yylhsminor.yy2 = sqlite3ExprFunction(pParse, yymsp[-2].minor.yy402, &yymsp[-5].minor.yy0, yymsp[-3].minor.yy92);
176001 sqlite3WindowAttach(pParse, yylhsminor.yy2, yymsp[0].minor.yy3);
176002 }
176003 yymsp[-5].minor.yy2 = yylhsminor.yy2;
176004 break;
176005 case 191: /* expr ::= ID|INDEXED|JOIN_KW LP distinct exprlist ORDER BY sortlist RP filter_over */
176006 {
176007 yylhsminor.yy2 = sqlite3ExprFunction(pParse, yymsp[-5].minor.yy402, &yymsp[-8].minor.yy0, yymsp[-6].minor.yy92);
176008 sqlite3WindowAttach(pParse, yylhsminor.yy2, yymsp[0].minor.yy3);
176009 sqlite3ExprAddFunctionOrderBy(pParse, yylhsminor.yy2, yymsp[-2].minor.yy402);
176010 }
176011 yymsp[-8].minor.yy2 = yylhsminor.yy2;
176012 break;
176013 case 192: /* expr ::= ID|INDEXED|JOIN_KW LP STAR RP filter_over */
176014 {
176015 yylhsminor.yy2 = sqlite3ExprFunction(pParse, 0, &yymsp[-4].minor.yy0, 0);
176016 sqlite3WindowAttach(pParse, yylhsminor.yy2, yymsp[0].minor.yy3);
176017 }
176018 yymsp[-4].minor.yy2 = yylhsminor.yy2;
176019 break;
176020 case 193: /* term ::= CTIME_KW */
176021 {
176022 yylhsminor.yy2 = sqlite3ExprFunction(pParse, 0, &yymsp[0].minor.yy0, 0);
176023 }
176024 yymsp[0].minor.yy2 = yylhsminor.yy2;
176025 break;
176026 case 194: /* expr ::= LP nexprlist COMMA expr RP */
176027 {
176028 ExprList *pList = sqlite3ExprListAppend(pParse, yymsp[-3].minor.yy402, yymsp[-1].minor.yy2);
176029 yymsp[-4].minor.yy2 = sqlite3PExpr(pParse, TK_VECTOR, 0, 0);
176030 if( yymsp[-4].minor.yy2 ){
176031 yymsp[-4].minor.yy2->x.pList = pList;
176032 if( ALWAYS(pList->nExpr) ){
176033 yymsp[-4].minor.yy2->flags |= pList->a[0].pExpr->flags & EP_Propagate;
176034 }
176035 }else{
176036 sqlite3ExprListDelete(pParse->db, pList);
176037 }
176038 }
176039 break;
176040 case 195: /* expr ::= expr AND expr */
176041 {yymsp[-2].minor.yy2=sqlite3ExprAnd(pParse,yymsp[-2].minor.yy2,yymsp[0].minor.yy2);}
176042 break;
176043 case 196: /* expr ::= expr OR expr */
176044 case 197: /* expr ::= expr LT|GT|GE|LE expr */ yytestcase(yyruleno==197);
176045 case 198: /* expr ::= expr EQ|NE expr */ yytestcase(yyruleno==198);
176046 case 199: /* expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr */ yytestcase(yyruleno==199);
176047 case 200: /* expr ::= expr PLUS|MINUS expr */ yytestcase(yyruleno==200);
176048 case 201: /* expr ::= expr STAR|SLASH|REM expr */ yytestcase(yyruleno==201);
176049 case 202: /* expr ::= expr CONCAT expr */ yytestcase(yyruleno==202);
176050 {yymsp[-2].minor.yy2=sqlite3PExpr(pParse,yymsp[-1].major,yymsp[-2].minor.yy2,yymsp[0].minor.yy2);}
176051 break;
176052 case 203: /* likeop ::= NOT LIKE_KW|MATCH */
176053 {yymsp[-1].minor.yy0=yymsp[0].minor.yy0; yymsp[-1].minor.yy0.n|=0x80000000; /*yymsp[-1].minor.yy0-overwrite-yymsp[0].minor.yy0*/}
176054 break;
176055 case 204: /* expr ::= expr likeop expr */
176056 {
176057 ExprList *pList;
176058 int bNot = yymsp[-1].minor.yy0.n & 0x80000000;
176059 yymsp[-1].minor.yy0.n &= 0x7fffffff;
176060 pList = sqlite3ExprListAppend(pParse,0, yymsp[0].minor.yy2);
176061 pList = sqlite3ExprListAppend(pParse,pList, yymsp[-2].minor.yy2);
176062 yymsp[-2].minor.yy2 = sqlite3ExprFunction(pParse, pList, &yymsp[-1].minor.yy0, 0);
176063 if( bNot ) yymsp[-2].minor.yy2 = sqlite3PExpr(pParse, TK_NOT, yymsp[-2].minor.yy2, 0);
176064 if( yymsp[-2].minor.yy2 ) yymsp[-2].minor.yy2->flags |= EP_InfixFunc;
176065 }
176066 break;
176067 case 205: /* expr ::= expr likeop expr ESCAPE expr */
176068 {
176069 ExprList *pList;
176070 int bNot = yymsp[-3].minor.yy0.n & 0x80000000;
176071 yymsp[-3].minor.yy0.n &= 0x7fffffff;
176072 pList = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy2);
176073 pList = sqlite3ExprListAppend(pParse,pList, yymsp[-4].minor.yy2);
176074 pList = sqlite3ExprListAppend(pParse,pList, yymsp[0].minor.yy2);
176075 yymsp[-4].minor.yy2 = sqlite3ExprFunction(pParse, pList, &yymsp[-3].minor.yy0, 0);
176076 if( bNot ) yymsp[-4].minor.yy2 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy2, 0);
176077 if( yymsp[-4].minor.yy2 ) yymsp[-4].minor.yy2->flags |= EP_InfixFunc;
176078 }
176079 break;
176080 case 206: /* expr ::= expr ISNULL|NOTNULL */
176081 {yymsp[-1].minor.yy2 = sqlite3PExpr(pParse,yymsp[0].major,yymsp[-1].minor.yy2,0);}
176082 break;
176083 case 207: /* expr ::= expr NOT NULL */
176084 {yymsp[-2].minor.yy2 = sqlite3PExpr(pParse,TK_NOTNULL,yymsp[-2].minor.yy2,0);}
176085 break;
176086 case 208: /* expr ::= expr IS expr */
176087 {
176088 yymsp[-2].minor.yy2 = sqlite3PExpr(pParse,TK_IS,yymsp[-2].minor.yy2,yymsp[0].minor.yy2);
176089 binaryToUnaryIfNull(pParse, yymsp[0].minor.yy2, yymsp[-2].minor.yy2, TK_ISNULL);
176090 }
176091 break;
176092 case 209: /* expr ::= expr IS NOT expr */
176093 {
176094 yymsp[-3].minor.yy2 = sqlite3PExpr(pParse,TK_ISNOT,yymsp[-3].minor.yy2,yymsp[0].minor.yy2);
176095 binaryToUnaryIfNull(pParse, yymsp[0].minor.yy2, yymsp[-3].minor.yy2, TK_NOTNULL);
176096 }
176097 break;
176098 case 210: /* expr ::= expr IS NOT DISTINCT FROM expr */
176099 {
176100 yymsp[-5].minor.yy2 = sqlite3PExpr(pParse,TK_IS,yymsp[-5].minor.yy2,yymsp[0].minor.yy2);
176101 binaryToUnaryIfNull(pParse, yymsp[0].minor.yy2, yymsp[-5].minor.yy2, TK_ISNULL);
176102 }
176103 break;
176104 case 211: /* expr ::= expr IS DISTINCT FROM expr */
176105 {
176106 yymsp[-4].minor.yy2 = sqlite3PExpr(pParse,TK_ISNOT,yymsp[-4].minor.yy2,yymsp[0].minor.yy2);
176107 binaryToUnaryIfNull(pParse, yymsp[0].minor.yy2, yymsp[-4].minor.yy2, TK_NOTNULL);
176108 }
176109 break;
176110 case 212: /* expr ::= NOT expr */
176111 case 213: /* expr ::= BITNOT expr */ yytestcase(yyruleno==213);
176112 {yymsp[-1].minor.yy2 = sqlite3PExpr(pParse, yymsp[-1].major, yymsp[0].minor.yy2, 0);/*A-overwrites-B*/}
176113 break;
176114 case 214: /* expr ::= PLUS|MINUS expr */
176115 {
176116 yymsp[-1].minor.yy2 = sqlite3PExpr(pParse, yymsp[-1].major==TK_PLUS ? TK_UPLUS : TK_UMINUS, yymsp[0].minor.yy2, 0);
176117 /*A-overwrites-B*/
176118 }
176119 break;
176120 case 215: /* expr ::= expr PTR expr */
176121 {
176122 ExprList *pList = sqlite3ExprListAppend(pParse, 0, yymsp[-2].minor.yy2);
176123 pList = sqlite3ExprListAppend(pParse, pList, yymsp[0].minor.yy2);
176124 yylhsminor.yy2 = sqlite3ExprFunction(pParse, pList, &yymsp[-1].minor.yy0, 0);
176125 }
176126 yymsp[-2].minor.yy2 = yylhsminor.yy2;
176127 break;
176128 case 216: /* between_op ::= BETWEEN */
176129 case 219: /* in_op ::= IN */ yytestcase(yyruleno==219);
176130 {yymsp[0].minor.yy92 = 0;}
176131 break;
176132 case 218: /* expr ::= expr between_op expr AND expr */
176133 {
176134 ExprList *pList = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy2);
176135 pList = sqlite3ExprListAppend(pParse,pList, yymsp[0].minor.yy2);
176136 yymsp[-4].minor.yy2 = sqlite3PExpr(pParse, TK_BETWEEN, yymsp[-4].minor.yy2, 0);
176137 if( yymsp[-4].minor.yy2 ){
176138 yymsp[-4].minor.yy2->x.pList = pList;
176139 }else{
176140 sqlite3ExprListDelete(pParse->db, pList);
176141 }
176142 if( yymsp[-3].minor.yy92 ) yymsp[-4].minor.yy2 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy2, 0);
176143 }
176144 break;
176145 case 221: /* expr ::= expr in_op LP exprlist RP */
176146 {
176147 if( yymsp[-1].minor.yy402==0 ){
176148 /* Expressions of the form
176149 **
176150 ** expr1 IN ()
176151 ** expr1 NOT IN ()
176152 **
176153 ** simplify to constants 0 (false) and 1 (true), respectively,
176154 ** regardless of the value of expr1.
176155 */
176156 sqlite3ExprUnmapAndDelete(pParse, yymsp[-4].minor.yy2);
176157 yymsp[-4].minor.yy2 = sqlite3Expr(pParse->db, TK_STRING, yymsp[-3].minor.yy92 ? "true" : "false");
176158 if( yymsp[-4].minor.yy2 ) sqlite3ExprIdToTrueFalse(yymsp[-4].minor.yy2);
176159 }else{
176160 Expr *pRHS = yymsp[-1].minor.yy402->a[0].pExpr;
176161 if( yymsp[-1].minor.yy402->nExpr==1 && sqlite3ExprIsConstant(pRHS) && yymsp[-4].minor.yy2->op!=TK_VECTOR ){
176162 yymsp[-1].minor.yy402->a[0].pExpr = 0;
176163 sqlite3ExprListDelete(pParse->db, yymsp[-1].minor.yy402);
176164 pRHS = sqlite3PExpr(pParse, TK_UPLUS, pRHS, 0);
176165 yymsp[-4].minor.yy2 = sqlite3PExpr(pParse, TK_EQ, yymsp[-4].minor.yy2, pRHS);
176166 }else if( yymsp[-1].minor.yy402->nExpr==1 && pRHS->op==TK_SELECT ){
176167 yymsp[-4].minor.yy2 = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy2, 0);
176168 sqlite3PExprAddSelect(pParse, yymsp[-4].minor.yy2, pRHS->x.pSelect);
176169 pRHS->x.pSelect = 0;
176170 sqlite3ExprListDelete(pParse->db, yymsp[-1].minor.yy402);
176171 }else{
176172 yymsp[-4].minor.yy2 = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy2, 0);
176173 if( yymsp[-4].minor.yy2==0 ){
176174 sqlite3ExprListDelete(pParse->db, yymsp[-1].minor.yy402);
176175 }else if( yymsp[-4].minor.yy2->pLeft->op==TK_VECTOR ){
176176 int nExpr = yymsp[-4].minor.yy2->pLeft->x.pList->nExpr;
176177 Select *pSelectRHS = sqlite3ExprListToValues(pParse, nExpr, yymsp[-1].minor.yy402);
176178 if( pSelectRHS ){
176179 parserDoubleLinkSelect(pParse, pSelectRHS);
176180 sqlite3PExprAddSelect(pParse, yymsp[-4].minor.yy2, pSelectRHS);
176181 }
176182 }else{
176183 yymsp[-4].minor.yy2->x.pList = yymsp[-1].minor.yy402;
176184 sqlite3ExprSetHeightAndFlags(pParse, yymsp[-4].minor.yy2);
176185 }
176186 }
176187 if( yymsp[-3].minor.yy92 ) yymsp[-4].minor.yy2 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy2, 0);
176188 }
176189 }
176190 break;
176191 case 222: /* expr ::= LP select RP */
176192 {
176193 yymsp[-2].minor.yy2 = sqlite3PExpr(pParse, TK_SELECT, 0, 0);
176194 sqlite3PExprAddSelect(pParse, yymsp[-2].minor.yy2, yymsp[-1].minor.yy299);
176195 }
176196 break;
176197 case 223: /* expr ::= expr in_op LP select RP */
176198 {
176199 yymsp[-4].minor.yy2 = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy2, 0);
176200 sqlite3PExprAddSelect(pParse, yymsp[-4].minor.yy2, yymsp[-1].minor.yy299);
176201 if( yymsp[-3].minor.yy92 ) yymsp[-4].minor.yy2 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy2, 0);
176202 }
176203 break;
176204 case 224: /* expr ::= expr in_op nm dbnm paren_exprlist */
176205 {
176206 SrcList *pSrc = sqlite3SrcListAppend(pParse, 0,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0);
176207 Select *pSelect = sqlite3SelectNew(pParse, 0,pSrc,0,0,0,0,0,0);
176208 if( yymsp[0].minor.yy402 ) sqlite3SrcListFuncArgs(pParse, pSelect ? pSrc : 0, yymsp[0].minor.yy402);
176209 yymsp[-4].minor.yy2 = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy2, 0);
176210 sqlite3PExprAddSelect(pParse, yymsp[-4].minor.yy2, pSelect);
176211 if( yymsp[-3].minor.yy92 ) yymsp[-4].minor.yy2 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy2, 0);
176212 }
176213 break;
176214 case 225: /* expr ::= EXISTS LP select RP */
176215 {
176216 Expr *p;
176217 p = yymsp[-3].minor.yy2 = sqlite3PExpr(pParse, TK_EXISTS, 0, 0);
176218 sqlite3PExprAddSelect(pParse, p, yymsp[-1].minor.yy299);
176219 }
176220 break;
176221 case 226: /* expr ::= CASE case_operand case_exprlist case_else END */
176222 {
176223 yymsp[-4].minor.yy2 = sqlite3PExpr(pParse, TK_CASE, yymsp[-3].minor.yy2, 0);
176224 if( yymsp[-4].minor.yy2 ){
176225 yymsp[-4].minor.yy2->x.pList = yymsp[-1].minor.yy2 ? sqlite3ExprListAppend(pParse,yymsp[-2].minor.yy402,yymsp[-1].minor.yy2) : yymsp[-2].minor.yy402;
176226 sqlite3ExprSetHeightAndFlags(pParse, yymsp[-4].minor.yy2);
176227 }else{
176228 sqlite3ExprListDelete(pParse->db, yymsp[-2].minor.yy402);
176229 sqlite3ExprDelete(pParse->db, yymsp[-1].minor.yy2);
176230 }
176231 }
176232 break;
176233 case 227: /* case_exprlist ::= case_exprlist WHEN expr THEN expr */
176234 {
176235 yymsp[-4].minor.yy402 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy402, yymsp[-2].minor.yy2);
176236 yymsp[-4].minor.yy402 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy402, yymsp[0].minor.yy2);
176237 }
176238 break;
176239 case 228: /* case_exprlist ::= WHEN expr THEN expr */
176240 {
176241 yymsp[-3].minor.yy402 = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy2);
176242 yymsp[-3].minor.yy402 = sqlite3ExprListAppend(pParse,yymsp[-3].minor.yy402, yymsp[0].minor.yy2);
176243 }
176244 break;
176245 case 233: /* nexprlist ::= nexprlist COMMA expr */
176246 {yymsp[-2].minor.yy402 = sqlite3ExprListAppend(pParse,yymsp[-2].minor.yy402,yymsp[0].minor.yy2);}
176247 break;
176248 case 234: /* nexprlist ::= expr */
176249 {yymsp[0].minor.yy402 = sqlite3ExprListAppend(pParse,0,yymsp[0].minor.yy2); /*A-overwrites-Y*/}
176250 break;
176251 case 236: /* paren_exprlist ::= LP exprlist RP */
176252 case 241: /* eidlist_opt ::= LP eidlist RP */ yytestcase(yyruleno==241);
176253 {yymsp[-2].minor.yy402 = yymsp[-1].minor.yy402;}
176254 break;
176255 case 237: /* cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP sortlist RP where_opt */
176256 {
176257 sqlite3CreateIndex(pParse, &yymsp[-7].minor.yy0, &yymsp[-6].minor.yy0,
176258 sqlite3SrcListAppend(pParse,0,&yymsp[-4].minor.yy0,0), yymsp[-2].minor.yy402, yymsp[-10].minor.yy92,
176259 &yymsp[-11].minor.yy0, yymsp[0].minor.yy2, SQLITE_SO_ASC, yymsp[-8].minor.yy92, SQLITE_IDXTYPE_APPDEF);
176260 if( IN_RENAME_OBJECT && pParse->pNewIndex ){
176261 sqlite3RenameTokenMap(pParse, pParse->pNewIndex->zName, &yymsp[-4].minor.yy0);
176262 }
176263 }
176264 break;
176265 case 238: /* uniqueflag ::= UNIQUE */
176266 case 280: /* raisetype ::= ABORT */ yytestcase(yyruleno==280);
176267 {yymsp[0].minor.yy92 = OE_Abort;}
176268 break;
176269 case 239: /* uniqueflag ::= */
176270 {yymsp[1].minor.yy92 = OE_None;}
176271 break;
176272 case 242: /* eidlist ::= eidlist COMMA nm collate sortorder */
176273 {
176274 yymsp[-4].minor.yy402 = parserAddExprIdListTerm(pParse, yymsp[-4].minor.yy402, &yymsp[-2].minor.yy0, yymsp[-1].minor.yy92, yymsp[0].minor.yy92);
176275 }
176276 break;
176277 case 243: /* eidlist ::= nm collate sortorder */
176278 {
176279 yymsp[-2].minor.yy402 = parserAddExprIdListTerm(pParse, 0, &yymsp[-2].minor.yy0, yymsp[-1].minor.yy92, yymsp[0].minor.yy92); /*A-overwrites-Y*/
176280 }
176281 break;
176282 case 246: /* cmd ::= DROP INDEX ifexists fullname */
176283 {sqlite3DropIndex(pParse, yymsp[0].minor.yy387, yymsp[-1].minor.yy92);}
176284 break;
176285 case 247: /* cmd ::= VACUUM vinto */
176286 {sqlite3Vacuum(pParse,0,yymsp[0].minor.yy2);}
176287 break;
176288 case 248: /* cmd ::= VACUUM nm vinto */
176289 {sqlite3Vacuum(pParse,&yymsp[-1].minor.yy0,yymsp[0].minor.yy2);}
176290 break;
176291 case 251: /* cmd ::= PRAGMA nm dbnm */
176292 {sqlite3Pragma(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,0,0);}
176293 break;
176294 case 252: /* cmd ::= PRAGMA nm dbnm EQ nmnum */
@@ -176018,54 +176306,54 @@
176306 case 258: /* cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END */
176307 {
176308 Token all;
176309 all.z = yymsp[-3].minor.yy0.z;
176310 all.n = (int)(yymsp[0].minor.yy0.z - yymsp[-3].minor.yy0.z) + yymsp[0].minor.yy0.n;
176311 sqlite3FinishTrigger(pParse, yymsp[-1].minor.yy347, &all);
176312 }
176313 break;
176314 case 259: /* trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause */
176315 {
176316 sqlite3BeginTrigger(pParse, &yymsp[-7].minor.yy0, &yymsp[-6].minor.yy0, yymsp[-5].minor.yy92, yymsp[-4].minor.yy210.a, yymsp[-4].minor.yy210.b, yymsp[-2].minor.yy387, yymsp[0].minor.yy2, yymsp[-10].minor.yy92, yymsp[-8].minor.yy92);
176317 yymsp[-10].minor.yy0 = (yymsp[-6].minor.yy0.n==0?yymsp[-7].minor.yy0:yymsp[-6].minor.yy0); /*A-overwrites-T*/
176318 }
176319 break;
176320 case 260: /* trigger_time ::= BEFORE|AFTER */
176321 { yymsp[0].minor.yy92 = yymsp[0].major; /*A-overwrites-X*/ }
176322 break;
176323 case 261: /* trigger_time ::= INSTEAD OF */
176324 { yymsp[-1].minor.yy92 = TK_INSTEAD;}
176325 break;
176326 case 262: /* trigger_time ::= */
176327 { yymsp[1].minor.yy92 = TK_BEFORE; }
176328 break;
176329 case 263: /* trigger_event ::= DELETE|INSERT */
176330 case 264: /* trigger_event ::= UPDATE */ yytestcase(yyruleno==264);
176331 {yymsp[0].minor.yy210.a = yymsp[0].major; /*A-overwrites-X*/ yymsp[0].minor.yy210.b = 0;}
176332 break;
176333 case 265: /* trigger_event ::= UPDATE OF idlist */
176334 {yymsp[-2].minor.yy210.a = TK_UPDATE; yymsp[-2].minor.yy210.b = yymsp[0].minor.yy400;}
176335 break;
176336 case 266: /* when_clause ::= */
176337 case 285: /* key_opt ::= */ yytestcase(yyruleno==285);
176338 { yymsp[1].minor.yy2 = 0; }
176339 break;
176340 case 267: /* when_clause ::= WHEN expr */
176341 case 286: /* key_opt ::= KEY expr */ yytestcase(yyruleno==286);
176342 { yymsp[-1].minor.yy2 = yymsp[0].minor.yy2; }
176343 break;
176344 case 268: /* trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI */
176345 {
176346 assert( yymsp[-2].minor.yy347!=0 );
176347 yymsp[-2].minor.yy347->pLast->pNext = yymsp[-1].minor.yy347;
176348 yymsp[-2].minor.yy347->pLast = yymsp[-1].minor.yy347;
176349 }
176350 break;
176351 case 269: /* trigger_cmd_list ::= trigger_cmd SEMI */
176352 {
176353 assert( yymsp[-1].minor.yy347!=0 );
176354 yymsp[-1].minor.yy347->pLast = yymsp[-1].minor.yy347;
176355 }
176356 break;
176357 case 270: /* trnm ::= nm DOT nm */
176358 {
176359 yymsp[-2].minor.yy0 = yymsp[0].minor.yy0;
@@ -176087,62 +176375,62 @@
176375 "the NOT INDEXED clause is not allowed on UPDATE or DELETE statements "
176376 "within triggers");
176377 }
176378 break;
176379 case 273: /* trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist from where_opt scanpt */
176380 {yylhsminor.yy347 = sqlite3TriggerUpdateStep(pParse, &yymsp[-6].minor.yy0, yymsp[-2].minor.yy387, yymsp[-3].minor.yy402, yymsp[-1].minor.yy2, yymsp[-7].minor.yy92, yymsp[-8].minor.yy0.z, yymsp[0].minor.yy616);}
176381 yymsp[-8].minor.yy347 = yylhsminor.yy347;
176382 break;
176383 case 274: /* trigger_cmd ::= scanpt insert_cmd INTO trnm idlist_opt select upsert scanpt */
176384 {
176385 yylhsminor.yy347 = sqlite3TriggerInsertStep(pParse,&yymsp[-4].minor.yy0,yymsp[-3].minor.yy400,yymsp[-2].minor.yy299,yymsp[-6].minor.yy92,yymsp[-1].minor.yy258,yymsp[-7].minor.yy616,yymsp[0].minor.yy616);/*yylhsminor.yy347-overwrites-yymsp[-6].minor.yy92*/
176386 }
176387 yymsp[-7].minor.yy347 = yylhsminor.yy347;
176388 break;
176389 case 275: /* trigger_cmd ::= DELETE FROM trnm tridxby where_opt scanpt */
176390 {yylhsminor.yy347 = sqlite3TriggerDeleteStep(pParse, &yymsp[-3].minor.yy0, yymsp[-1].minor.yy2, yymsp[-5].minor.yy0.z, yymsp[0].minor.yy616);}
176391 yymsp[-5].minor.yy347 = yylhsminor.yy347;
176392 break;
176393 case 276: /* trigger_cmd ::= scanpt select scanpt */
176394 {yylhsminor.yy347 = sqlite3TriggerSelectStep(pParse->db, yymsp[-1].minor.yy299, yymsp[-2].minor.yy616, yymsp[0].minor.yy616); /*yylhsminor.yy347-overwrites-yymsp[-1].minor.yy299*/}
176395 yymsp[-2].minor.yy347 = yylhsminor.yy347;
176396 break;
176397 case 277: /* expr ::= RAISE LP IGNORE RP */
176398 {
176399 yymsp[-3].minor.yy2 = sqlite3PExpr(pParse, TK_RAISE, 0, 0);
176400 if( yymsp[-3].minor.yy2 ){
176401 yymsp[-3].minor.yy2->affExpr = OE_Ignore;
176402 }
176403 }
176404 break;
176405 case 278: /* expr ::= RAISE LP raisetype COMMA nm RP */
176406 {
176407 yymsp[-5].minor.yy2 = sqlite3ExprAlloc(pParse->db, TK_RAISE, &yymsp[-1].minor.yy0, 1);
176408 if( yymsp[-5].minor.yy2 ) {
176409 yymsp[-5].minor.yy2->affExpr = (char)yymsp[-3].minor.yy92;
176410 }
176411 }
176412 break;
176413 case 279: /* raisetype ::= ROLLBACK */
176414 {yymsp[0].minor.yy92 = OE_Rollback;}
176415 break;
176416 case 281: /* raisetype ::= FAIL */
176417 {yymsp[0].minor.yy92 = OE_Fail;}
176418 break;
176419 case 282: /* cmd ::= DROP TRIGGER ifexists fullname */
176420 {
176421 sqlite3DropTrigger(pParse,yymsp[0].minor.yy387,yymsp[-1].minor.yy92);
176422 }
176423 break;
176424 case 283: /* cmd ::= ATTACH database_kw_opt expr AS expr key_opt */
176425 {
176426 sqlite3Attach(pParse, yymsp[-3].minor.yy2, yymsp[-1].minor.yy2, yymsp[0].minor.yy2);
176427 }
176428 break;
176429 case 284: /* cmd ::= DETACH database_kw_opt expr */
176430 {
176431 sqlite3Detach(pParse, yymsp[0].minor.yy2);
176432 }
176433 break;
176434 case 287: /* cmd ::= REINDEX */
176435 {sqlite3Reindex(pParse, 0, 0);}
176436 break;
@@ -176155,11 +176443,11 @@
176443 case 290: /* cmd ::= ANALYZE nm dbnm */
176444 {sqlite3Analyze(pParse, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0);}
176445 break;
176446 case 291: /* cmd ::= ALTER TABLE fullname RENAME TO nm */
176447 {
176448 sqlite3AlterRenameTable(pParse,yymsp[-3].minor.yy387,&yymsp[0].minor.yy0);
176449 }
176450 break;
176451 case 292: /* cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt columnname carglist */
176452 {
176453 yymsp[-1].minor.yy0.n = (int)(pParse->sLastToken.z-yymsp[-1].minor.yy0.z) + pParse->sLastToken.n;
@@ -176166,22 +176454,22 @@
176454 sqlite3AlterFinishAddColumn(pParse, &yymsp[-1].minor.yy0);
176455 }
176456 break;
176457 case 293: /* cmd ::= ALTER TABLE fullname DROP kwcolumn_opt nm */
176458 {
176459 sqlite3AlterDropColumn(pParse, yymsp[-3].minor.yy387, &yymsp[0].minor.yy0);
176460 }
176461 break;
176462 case 294: /* add_column_fullname ::= fullname */
176463 {
176464 disableLookaside(pParse);
176465 sqlite3AlterBeginAddColumn(pParse, yymsp[0].minor.yy387);
176466 }
176467 break;
176468 case 295: /* cmd ::= ALTER TABLE fullname RENAME kwcolumn_opt nm TO nm */
176469 {
176470 sqlite3AlterRenameColumn(pParse, yymsp[-5].minor.yy387, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0);
176471 }
176472 break;
176473 case 296: /* cmd ::= create_vtab */
176474 {sqlite3VtabFinishParse(pParse,0);}
176475 break;
@@ -176188,11 +176476,11 @@
176476 case 297: /* cmd ::= create_vtab LP vtabarglist RP */
176477 {sqlite3VtabFinishParse(pParse,&yymsp[0].minor.yy0);}
176478 break;
176479 case 298: /* create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm */
176480 {
176481 sqlite3VtabBeginParse(pParse, &yymsp[-3].minor.yy0, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-4].minor.yy92);
176482 }
176483 break;
176484 case 299: /* vtabarg ::= */
176485 {sqlite3VtabArgInit(pParse);}
176486 break;
@@ -176201,242 +176489,249 @@
176489 case 302: /* lp ::= LP */ yytestcase(yyruleno==302);
176490 {sqlite3VtabArgExtend(pParse,&yymsp[0].minor.yy0);}
176491 break;
176492 case 303: /* with ::= WITH wqlist */
176493 case 304: /* with ::= WITH RECURSIVE wqlist */ yytestcase(yyruleno==304);
176494 { sqlite3WithPush(pParse, yymsp[0].minor.yy131, 1); }
176495 break;
176496 case 305: /* wqas ::= AS */
176497 {yymsp[0].minor.yy498 = M10d_Any;}
176498 break;
176499 case 306: /* wqas ::= AS MATERIALIZED */
176500 {yymsp[-1].minor.yy498 = M10d_Yes;}
176501 break;
176502 case 307: /* wqas ::= AS NOT MATERIALIZED */
176503 {yymsp[-2].minor.yy498 = M10d_No;}
176504 break;
176505 case 308: /* wqitem ::= nm eidlist_opt wqas LP select RP */
176506 {
176507 yymsp[-5].minor.yy79 = sqlite3CteNew(pParse, &yymsp[-5].minor.yy0, yymsp[-4].minor.yy402, yymsp[-1].minor.yy299, yymsp[-3].minor.yy498); /*A-overwrites-X*/
176508 }
176509 break;
176510 case 309: /* wqlist ::= wqitem */
176511 {
176512 yymsp[0].minor.yy131 = sqlite3WithAdd(pParse, 0, yymsp[0].minor.yy79); /*A-overwrites-X*/
176513 }
176514 break;
176515 case 310: /* wqlist ::= wqlist COMMA wqitem */
176516 {
176517 yymsp[-2].minor.yy131 = sqlite3WithAdd(pParse, yymsp[-2].minor.yy131, yymsp[0].minor.yy79);
176518 }
176519 break;
176520 case 311: /* windowdefn_list ::= windowdefn_list COMMA windowdefn */
176521 {
176522 assert( yymsp[0].minor.yy3!=0 );
176523 sqlite3WindowChain(pParse, yymsp[0].minor.yy3, yymsp[-2].minor.yy3);
176524 yymsp[0].minor.yy3->pNextWin = yymsp[-2].minor.yy3;
176525 yylhsminor.yy3 = yymsp[0].minor.yy3;
176526 }
176527 yymsp[-2].minor.yy3 = yylhsminor.yy3;
176528 break;
176529 case 312: /* windowdefn ::= nm AS LP window RP */
176530 {
176531 if( ALWAYS(yymsp[-1].minor.yy3) ){
176532 yymsp[-1].minor.yy3->zName = sqlite3DbStrNDup(pParse->db, yymsp[-4].minor.yy0.z, yymsp[-4].minor.yy0.n);
176533 }
176534 yylhsminor.yy3 = yymsp[-1].minor.yy3;
176535 }
176536 yymsp[-4].minor.yy3 = yylhsminor.yy3;
176537 break;
176538 case 313: /* window ::= PARTITION BY nexprlist orderby_opt frame_opt */
176539 {
176540 yymsp[-4].minor.yy3 = sqlite3WindowAssemble(pParse, yymsp[0].minor.yy3, yymsp[-2].minor.yy402, yymsp[-1].minor.yy402, 0);
176541 }
176542 break;
176543 case 314: /* window ::= nm PARTITION BY nexprlist orderby_opt frame_opt */
176544 {
176545 yylhsminor.yy3 = sqlite3WindowAssemble(pParse, yymsp[0].minor.yy3, yymsp[-2].minor.yy402, yymsp[-1].minor.yy402, &yymsp[-5].minor.yy0);
176546 }
176547 yymsp[-5].minor.yy3 = yylhsminor.yy3;
176548 break;
176549 case 315: /* window ::= ORDER BY sortlist frame_opt */
176550 {
176551 yymsp[-3].minor.yy3 = sqlite3WindowAssemble(pParse, yymsp[0].minor.yy3, 0, yymsp[-1].minor.yy402, 0);
176552 }
176553 break;
176554 case 316: /* window ::= nm ORDER BY sortlist frame_opt */
176555 {
176556 yylhsminor.yy3 = sqlite3WindowAssemble(pParse, yymsp[0].minor.yy3, 0, yymsp[-1].minor.yy402, &yymsp[-4].minor.yy0);
176557 }
176558 yymsp[-4].minor.yy3 = yylhsminor.yy3;
176559 break;
176560 case 317: /* window ::= nm frame_opt */
176561 {
176562 yylhsminor.yy3 = sqlite3WindowAssemble(pParse, yymsp[0].minor.yy3, 0, 0, &yymsp[-1].minor.yy0);
176563 }
176564 yymsp[-1].minor.yy3 = yylhsminor.yy3;
176565 break;
176566 case 318: /* frame_opt ::= */
176567 {
176568 yymsp[1].minor.yy3 = sqlite3WindowAlloc(pParse, 0, TK_UNBOUNDED, 0, TK_CURRENT, 0, 0);
176569 }
176570 break;
176571 case 319: /* frame_opt ::= range_or_rows frame_bound_s frame_exclude_opt */
176572 {
176573 yylhsminor.yy3 = sqlite3WindowAlloc(pParse, yymsp[-2].minor.yy92, yymsp[-1].minor.yy337.eType, yymsp[-1].minor.yy337.pExpr, TK_CURRENT, 0, yymsp[0].minor.yy498);
176574 }
176575 yymsp[-2].minor.yy3 = yylhsminor.yy3;
176576 break;
176577 case 320: /* frame_opt ::= range_or_rows BETWEEN frame_bound_s AND frame_bound_e frame_exclude_opt */
176578 {
176579 yylhsminor.yy3 = sqlite3WindowAlloc(pParse, yymsp[-5].minor.yy92, yymsp[-3].minor.yy337.eType, yymsp[-3].minor.yy337.pExpr, yymsp[-1].minor.yy337.eType, yymsp[-1].minor.yy337.pExpr, yymsp[0].minor.yy498);
176580 }
176581 yymsp[-5].minor.yy3 = yylhsminor.yy3;
176582 break;
176583 case 322: /* frame_bound_s ::= frame_bound */
176584 case 324: /* frame_bound_e ::= frame_bound */ yytestcase(yyruleno==324);
176585 {yylhsminor.yy337 = yymsp[0].minor.yy337;}
176586 yymsp[0].minor.yy337 = yylhsminor.yy337;
176587 break;
176588 case 323: /* frame_bound_s ::= UNBOUNDED PRECEDING */
176589 case 325: /* frame_bound_e ::= UNBOUNDED FOLLOWING */ yytestcase(yyruleno==325);
176590 case 327: /* frame_bound ::= CURRENT ROW */ yytestcase(yyruleno==327);
176591 {yylhsminor.yy337.eType = yymsp[-1].major; yylhsminor.yy337.pExpr = 0;}
176592 yymsp[-1].minor.yy337 = yylhsminor.yy337;
176593 break;
176594 case 326: /* frame_bound ::= expr PRECEDING|FOLLOWING */
176595 {yylhsminor.yy337.eType = yymsp[0].major; yylhsminor.yy337.pExpr = yymsp[-1].minor.yy2;}
176596 yymsp[-1].minor.yy337 = yylhsminor.yy337;
176597 break;
176598 case 328: /* frame_exclude_opt ::= */
176599 {yymsp[1].minor.yy498 = 0;}
176600 break;
176601 case 329: /* frame_exclude_opt ::= EXCLUDE frame_exclude */
176602 {yymsp[-1].minor.yy498 = yymsp[0].minor.yy498;}
176603 break;
176604 case 330: /* frame_exclude ::= NO OTHERS */
176605 case 331: /* frame_exclude ::= CURRENT ROW */ yytestcase(yyruleno==331);
176606 {yymsp[-1].minor.yy498 = yymsp[-1].major; /*A-overwrites-X*/}
176607 break;
176608 case 332: /* frame_exclude ::= GROUP|TIES */
176609 {yymsp[0].minor.yy498 = yymsp[0].major; /*A-overwrites-X*/}
176610 break;
176611 case 333: /* window_clause ::= WINDOW windowdefn_list */
176612 { yymsp[-1].minor.yy3 = yymsp[0].minor.yy3; }
176613 break;
176614 case 334: /* filter_over ::= filter_clause over_clause */
176615 {
176616 if( yymsp[0].minor.yy3 ){
176617 yymsp[0].minor.yy3->pFilter = yymsp[-1].minor.yy2;
176618 }else{
176619 sqlite3ExprDelete(pParse->db, yymsp[-1].minor.yy2);
176620 }
176621 yylhsminor.yy3 = yymsp[0].minor.yy3;
176622 }
176623 yymsp[-1].minor.yy3 = yylhsminor.yy3;
176624 break;
176625 case 335: /* filter_over ::= over_clause */
176626 {
176627 yylhsminor.yy3 = yymsp[0].minor.yy3;
176628 }
176629 yymsp[0].minor.yy3 = yylhsminor.yy3;
176630 break;
176631 case 336: /* filter_over ::= filter_clause */
176632 {
176633 yylhsminor.yy3 = (Window*)sqlite3DbMallocZero(pParse->db, sizeof(Window));
176634 if( yylhsminor.yy3 ){
176635 yylhsminor.yy3->eFrmType = TK_FILTER;
176636 yylhsminor.yy3->pFilter = yymsp[0].minor.yy2;
176637 }else{
176638 sqlite3ExprDelete(pParse->db, yymsp[0].minor.yy2);
176639 }
176640 }
176641 yymsp[0].minor.yy3 = yylhsminor.yy3;
176642 break;
176643 case 337: /* over_clause ::= OVER LP window RP */
176644 {
176645 yymsp[-3].minor.yy3 = yymsp[-1].minor.yy3;
176646 assert( yymsp[-3].minor.yy3!=0 );
176647 }
176648 break;
176649 case 338: /* over_clause ::= OVER nm */
176650 {
176651 yymsp[-1].minor.yy3 = (Window*)sqlite3DbMallocZero(pParse->db, sizeof(Window));
176652 if( yymsp[-1].minor.yy3 ){
176653 yymsp[-1].minor.yy3->zName = sqlite3DbStrNDup(pParse->db, yymsp[0].minor.yy0.z, yymsp[0].minor.yy0.n);
176654 }
176655 }
176656 break;
176657 case 339: /* filter_clause ::= FILTER LP WHERE expr RP */
176658 { yymsp[-4].minor.yy2 = yymsp[-1].minor.yy2; }
176659 break;
176660 case 340: /* term ::= QNUMBER */
176661 {
176662 yylhsminor.yy2=tokenExpr(pParse,yymsp[0].major,yymsp[0].minor.yy0);
176663 sqlite3DequoteNumber(pParse, yylhsminor.yy2);
176664 }
176665 yymsp[0].minor.yy2 = yylhsminor.yy2;
176666 break;
176667 default:
176668 /* (341) input ::= cmdlist */ yytestcase(yyruleno==341);
176669 /* (342) cmdlist ::= cmdlist ecmd */ yytestcase(yyruleno==342);
176670 /* (343) cmdlist ::= ecmd (OPTIMIZED OUT) */ assert(yyruleno!=343);
176671 /* (344) ecmd ::= SEMI */ yytestcase(yyruleno==344);
176672 /* (345) ecmd ::= cmdx SEMI */ yytestcase(yyruleno==345);
176673 /* (346) ecmd ::= explain cmdx SEMI (NEVER REDUCES) */ assert(yyruleno!=346);
176674 /* (347) trans_opt ::= */ yytestcase(yyruleno==347);
176675 /* (348) trans_opt ::= TRANSACTION */ yytestcase(yyruleno==348);
176676 /* (349) trans_opt ::= TRANSACTION nm */ yytestcase(yyruleno==349);
176677 /* (350) savepoint_opt ::= SAVEPOINT */ yytestcase(yyruleno==350);
176678 /* (351) savepoint_opt ::= */ yytestcase(yyruleno==351);
176679 /* (352) cmd ::= create_table create_table_args */ yytestcase(yyruleno==352);
176680 /* (353) table_option_set ::= table_option (OPTIMIZED OUT) */ assert(yyruleno!=353);
176681 /* (354) columnlist ::= columnlist COMMA columnname carglist */ yytestcase(yyruleno==354);
176682 /* (355) columnlist ::= columnname carglist */ yytestcase(yyruleno==355);
176683 /* (356) nm ::= ID|INDEXED|JOIN_KW */ yytestcase(yyruleno==356);
176684 /* (357) nm ::= STRING */ yytestcase(yyruleno==357);
176685 /* (358) typetoken ::= typename */ yytestcase(yyruleno==358);
176686 /* (359) typename ::= ID|STRING */ yytestcase(yyruleno==359);
176687 /* (360) signed ::= plus_num (OPTIMIZED OUT) */ assert(yyruleno!=360);
176688 /* (361) signed ::= minus_num (OPTIMIZED OUT) */ assert(yyruleno!=361);
176689 /* (362) carglist ::= carglist ccons */ yytestcase(yyruleno==362);
176690 /* (363) carglist ::= */ yytestcase(yyruleno==363);
176691 /* (364) ccons ::= NULL onconf */ yytestcase(yyruleno==364);
176692 /* (365) ccons ::= GENERATED ALWAYS AS generated */ yytestcase(yyruleno==365);
176693 /* (366) ccons ::= AS generated */ yytestcase(yyruleno==366);
176694 /* (367) conslist_opt ::= COMMA conslist */ yytestcase(yyruleno==367);
176695 /* (368) conslist ::= conslist tconscomma tcons */ yytestcase(yyruleno==368);
176696 /* (369) conslist ::= tcons (OPTIMIZED OUT) */ assert(yyruleno!=369);
176697 /* (370) tconscomma ::= */ yytestcase(yyruleno==370);
176698 /* (371) defer_subclause_opt ::= defer_subclause (OPTIMIZED OUT) */ assert(yyruleno!=371);
176699 /* (372) resolvetype ::= raisetype (OPTIMIZED OUT) */ assert(yyruleno!=372);
176700 /* (373) selectnowith ::= oneselect (OPTIMIZED OUT) */ assert(yyruleno!=373);
176701 /* (374) oneselect ::= values */ yytestcase(yyruleno==374);
176702 /* (375) sclp ::= selcollist COMMA */ yytestcase(yyruleno==375);
176703 /* (376) as ::= ID|STRING */ yytestcase(yyruleno==376);
176704 /* (377) indexed_opt ::= indexed_by (OPTIMIZED OUT) */ assert(yyruleno!=377);
176705 /* (378) returning ::= */ yytestcase(yyruleno==378);
176706 /* (379) expr ::= term (OPTIMIZED OUT) */ assert(yyruleno!=379);
176707 /* (380) likeop ::= LIKE_KW|MATCH */ yytestcase(yyruleno==380);
176708 /* (381) case_operand ::= expr */ yytestcase(yyruleno==381);
176709 /* (382) exprlist ::= nexprlist */ yytestcase(yyruleno==382);
176710 /* (383) nmnum ::= plus_num (OPTIMIZED OUT) */ assert(yyruleno!=383);
176711 /* (384) nmnum ::= nm (OPTIMIZED OUT) */ assert(yyruleno!=384);
176712 /* (385) nmnum ::= ON */ yytestcase(yyruleno==385);
176713 /* (386) nmnum ::= DELETE */ yytestcase(yyruleno==386);
176714 /* (387) nmnum ::= DEFAULT */ yytestcase(yyruleno==387);
176715 /* (388) plus_num ::= INTEGER|FLOAT */ yytestcase(yyruleno==388);
176716 /* (389) foreach_clause ::= */ yytestcase(yyruleno==389);
176717 /* (390) foreach_clause ::= FOR EACH ROW */ yytestcase(yyruleno==390);
176718 /* (391) trnm ::= nm */ yytestcase(yyruleno==391);
176719 /* (392) tridxby ::= */ yytestcase(yyruleno==392);
176720 /* (393) database_kw_opt ::= DATABASE */ yytestcase(yyruleno==393);
176721 /* (394) database_kw_opt ::= */ yytestcase(yyruleno==394);
176722 /* (395) kwcolumn_opt ::= */ yytestcase(yyruleno==395);
176723 /* (396) kwcolumn_opt ::= COLUMNKW */ yytestcase(yyruleno==396);
176724 /* (397) vtabarglist ::= vtabarg */ yytestcase(yyruleno==397);
176725 /* (398) vtabarglist ::= vtabarglist COMMA vtabarg */ yytestcase(yyruleno==398);
176726 /* (399) vtabarg ::= vtabarg vtabargtoken */ yytestcase(yyruleno==399);
176727 /* (400) anylist ::= */ yytestcase(yyruleno==400);
176728 /* (401) anylist ::= anylist LP anylist RP */ yytestcase(yyruleno==401);
176729 /* (402) anylist ::= anylist ANY */ yytestcase(yyruleno==402);
176730 /* (403) with ::= */ yytestcase(yyruleno==403);
176731 /* (404) windowdefn_list ::= windowdefn (OPTIMIZED OUT) */ assert(yyruleno!=404);
176732 /* (405) window ::= frame_opt (OPTIMIZED OUT) */ assert(yyruleno!=405);
176733 break;
176734 /********** End reduce actions ************************************************/
176735 };
176736 assert( yyruleno<sizeof(yyRuleInfoLhs)/sizeof(yyRuleInfoLhs[0]) );
176737 yygoto = yyRuleInfoLhs[yyruleno];
@@ -177695,31 +177990,62 @@
177990 testcase( z[0]=='6' ); testcase( z[0]=='7' ); testcase( z[0]=='8' );
177991 testcase( z[0]=='9' ); testcase( z[0]=='.' );
177992 *tokenType = TK_INTEGER;
177993 #ifndef SQLITE_OMIT_HEX_INTEGER
177994 if( z[0]=='0' && (z[1]=='x' || z[1]=='X') && sqlite3Isxdigit(z[2]) ){
177995 for(i=3; 1; i++){
177996 if( sqlite3Isxdigit(z[i])==0 ){
177997 if( z[i]==SQLITE_DIGIT_SEPARATOR ){
177998 *tokenType = TK_QNUMBER;
177999 }else{
178000 break;
178001 }
178002 }
178003 }
178004 }else
178005 #endif
178006 {
178007 for(i=0; 1; i++){
178008 if( sqlite3Isdigit(z[i])==0 ){
178009 if( z[i]==SQLITE_DIGIT_SEPARATOR ){
178010 *tokenType = TK_QNUMBER;
178011 }else{
178012 break;
178013 }
178014 }
178015 }
178016 #ifndef SQLITE_OMIT_FLOATING_POINT
178017 if( z[i]=='.' ){
178018 if( *tokenType==TK_INTEGER ) *tokenType = TK_FLOAT;
178019 for(i++; 1; i++){
178020 if( sqlite3Isdigit(z[i])==0 ){
178021 if( z[i]==SQLITE_DIGIT_SEPARATOR ){
178022 *tokenType = TK_QNUMBER;
178023 }else{
178024 break;
178025 }
178026 }
178027 }
178028 }
178029 if( (z[i]=='e' || z[i]=='E') &&
178030 ( sqlite3Isdigit(z[i+1])
178031 || ((z[i+1]=='+' || z[i+1]=='-') && sqlite3Isdigit(z[i+2]))
178032 )
178033 ){
178034 if( *tokenType==TK_INTEGER ) *tokenType = TK_FLOAT;
178035 for(i+=2; 1; i++){
178036 if( sqlite3Isdigit(z[i])==0 ){
178037 if( z[i]==SQLITE_DIGIT_SEPARATOR ){
178038 *tokenType = TK_QNUMBER;
178039 }else{
178040 break;
178041 }
178042 }
178043 }
178044 }
178045 #endif
178046 }
178047 while( IdChar(z[i]) ){
178048 *tokenType = TK_ILLEGAL;
178049 i++;
178050 }
178051 return i;
@@ -177880,14 +178206,17 @@
178206 }
178207 #ifndef SQLITE_OMIT_WINDOWFUNC
178208 if( tokenType>=TK_WINDOW ){
178209 assert( tokenType==TK_SPACE || tokenType==TK_OVER || tokenType==TK_FILTER
178210 || tokenType==TK_ILLEGAL || tokenType==TK_WINDOW
178211 || tokenType==TK_QNUMBER
178212 );
178213 #else
178214 if( tokenType>=TK_SPACE ){
178215 assert( tokenType==TK_SPACE || tokenType==TK_ILLEGAL
178216 || tokenType==TK_QNUMBER
178217 );
178218 #endif /* SQLITE_OMIT_WINDOWFUNC */
178219 if( AtomicLoad(&db->u1.isInterrupted) ){
178220 pParse->rc = SQLITE_INTERRUPT;
178221 pParse->nErr++;
178222 break;
@@ -177916,11 +178245,11 @@
178245 tokenType = analyzeOverKeyword((const u8*)&zSql[4], lastTokenParsed);
178246 }else if( tokenType==TK_FILTER ){
178247 assert( n==6 );
178248 tokenType = analyzeFilterKeyword((const u8*)&zSql[6], lastTokenParsed);
178249 #endif /* SQLITE_OMIT_WINDOWFUNC */
178250 }else if( tokenType!=TK_QNUMBER ){
178251 Token x;
178252 x.z = zSql;
178253 x.n = n;
178254 sqlite3ErrorMsg(pParse, "unrecognized token: \"%T\"", &x);
178255 break;
@@ -204150,11 +204479,10 @@
204479 memcpy(p->zBuf+p->nUsed, zIn, N);
204480 p->nUsed += N;
204481 }
204482 }
204483
 
204484 /* Append formatted text (not to exceed N bytes) to the JsonString.
204485 */
204486 static void jsonPrintf(int N, JsonString *p, const char *zFormat, ...){
204487 va_list ap;
204488 if( (p->nUsed + N >= p->nAlloc) && jsonStringGrow(p, N) ) return;
@@ -205210,11 +205538,11 @@
205538 return j+1;
205539 }
205540 case '[': {
205541 /* Parse array */
205542 iThis = pParse->nBlob;
205543 assert( i<=(u32)pParse->nJson );
205544 jsonBlobAppendNode(pParse, JSONB_ARRAY, pParse->nJson - i, 0);
205545 iStart = pParse->nBlob;
205546 if( pParse->oom ) return -1;
205547 if( ++pParse->iDepth > JSON_MAX_DEPTH ){
205548 pParse->iErr = i;
@@ -205922,10 +206250,116 @@
206250 break;
206251 }
206252 }
206253 return i+n+sz;
206254 }
206255
206256 /* Context for recursion of json_pretty()
206257 */
206258 typedef struct JsonPretty JsonPretty;
206259 struct JsonPretty {
206260 JsonParse *pParse; /* The BLOB being rendered */
206261 JsonString *pOut; /* Generate pretty output into this string */
206262 const char *zIndent; /* Use this text for indentation */
206263 u32 szIndent; /* Bytes in zIndent[] */
206264 u32 nIndent; /* Current level of indentation */
206265 };
206266
206267 /* Append indentation to the pretty JSON under construction */
206268 static void jsonPrettyIndent(JsonPretty *pPretty){
206269 u32 jj;
206270 for(jj=0; jj<pPretty->nIndent; jj++){
206271 jsonAppendRaw(pPretty->pOut, pPretty->zIndent, pPretty->szIndent);
206272 }
206273 }
206274
206275 /*
206276 ** Translate the binary JSONB representation of JSON beginning at
206277 ** pParse->aBlob[i] into a JSON text string. Append the JSON
206278 ** text onto the end of pOut. Return the index in pParse->aBlob[]
206279 ** of the first byte past the end of the element that is translated.
206280 **
206281 ** This is a variant of jsonTranslateBlobToText() that "pretty-prints"
206282 ** the output. Extra whitespace is inserted to make the JSON easier
206283 ** for humans to read.
206284 **
206285 ** If an error is detected in the BLOB input, the pOut->eErr flag
206286 ** might get set to JSTRING_MALFORMED. But not all BLOB input errors
206287 ** are detected. So a malformed JSONB input might either result
206288 ** in an error, or in incorrect JSON.
206289 **
206290 ** The pOut->eErr JSTRING_OOM flag is set on a OOM.
206291 */
206292 static u32 jsonTranslateBlobToPrettyText(
206293 JsonPretty *pPretty, /* Pretty-printing context */
206294 u32 i /* Start rendering at this index */
206295 ){
206296 u32 sz, n, j, iEnd;
206297 const JsonParse *pParse = pPretty->pParse;
206298 JsonString *pOut = pPretty->pOut;
206299 n = jsonbPayloadSize(pParse, i, &sz);
206300 if( n==0 ){
206301 pOut->eErr |= JSTRING_MALFORMED;
206302 return pParse->nBlob+1;
206303 }
206304 switch( pParse->aBlob[i] & 0x0f ){
206305 case JSONB_ARRAY: {
206306 j = i+n;
206307 iEnd = j+sz;
206308 jsonAppendChar(pOut, '[');
206309 if( j<iEnd ){
206310 jsonAppendChar(pOut, '\n');
206311 pPretty->nIndent++;
206312 while( pOut->eErr==0 ){
206313 jsonPrettyIndent(pPretty);
206314 j = jsonTranslateBlobToPrettyText(pPretty, j);
206315 if( j>=iEnd ) break;
206316 jsonAppendRawNZ(pOut, ",\n", 2);
206317 }
206318 jsonAppendChar(pOut, '\n');
206319 pPretty->nIndent--;
206320 jsonPrettyIndent(pPretty);
206321 }
206322 jsonAppendChar(pOut, ']');
206323 i = iEnd;
206324 break;
206325 }
206326 case JSONB_OBJECT: {
206327 j = i+n;
206328 iEnd = j+sz;
206329 jsonAppendChar(pOut, '{');
206330 if( j<iEnd ){
206331 jsonAppendChar(pOut, '\n');
206332 pPretty->nIndent++;
206333 while( pOut->eErr==0 ){
206334 jsonPrettyIndent(pPretty);
206335 j = jsonTranslateBlobToText(pParse, j, pOut);
206336 if( j>iEnd ){
206337 pOut->eErr |= JSTRING_MALFORMED;
206338 break;
206339 }
206340 jsonAppendRawNZ(pOut, ": ", 2);
206341 j = jsonTranslateBlobToPrettyText(pPretty, j);
206342 if( j>=iEnd ) break;
206343 jsonAppendRawNZ(pOut, ",\n", 2);
206344 }
206345 jsonAppendChar(pOut, '\n');
206346 pPretty->nIndent--;
206347 jsonPrettyIndent(pPretty);
206348 }
206349 jsonAppendChar(pOut, '}');
206350 i = iEnd;
206351 break;
206352 }
206353 default: {
206354 i = jsonTranslateBlobToText(pParse, i, pOut);
206355 break;
206356 }
206357 }
206358 return i;
206359 }
206360
206361
206362 /* Return true if the input pJson
206363 **
206364 ** For performance reasons, this routine does not do a detailed check of the
206365 ** input BLOB to ensure that it is well-formed. Hence, false positives are
@@ -207841,10 +208275,44 @@
208275 }
208276 sqlite3_result_text(ctx, jsonbType[p->aBlob[i]&0x0f], -1, SQLITE_STATIC);
208277 json_type_done:
208278 jsonParseFree(p);
208279 }
208280
208281 /*
208282 ** json_pretty(JSON)
208283 ** json_pretty(JSON, INDENT)
208284 **
208285 ** Return text that is a pretty-printed rendering of the input JSON.
208286 ** If the argument is not valid JSON, return NULL.
208287 **
208288 ** The INDENT argument is text that is used for indentation. If omitted,
208289 ** it defaults to four spaces (the same as PostgreSQL).
208290 */
208291 static void jsonPrettyFunc(
208292 sqlite3_context *ctx,
208293 int argc,
208294 sqlite3_value **argv
208295 ){
208296 JsonString s; /* The output string */
208297 JsonPretty x; /* Pretty printing context */
208298
208299 memset(&x, 0, sizeof(x));
208300 x.pParse = jsonParseFuncArg(ctx, argv[0], 0);
208301 if( x.pParse==0 ) return;
208302 x.pOut = &s;
208303 jsonStringInit(&s, ctx);
208304 if( argc==1 || (x.zIndent = (const char*)sqlite3_value_text(argv[1]))==0 ){
208305 x.zIndent = " ";
208306 x.szIndent = 4;
208307 }else{
208308 x.szIndent = (u32)strlen(x.zIndent);
208309 }
208310 jsonTranslateBlobToPrettyText(&x, 0);
208311 jsonReturnString(&s, 0, 0);
208312 jsonParseFree(x.pParse);
208313 }
208314
208315 /*
208316 ** json_valid(JSON)
208317 ** json_valid(JSON, FLAGS)
208318 **
@@ -208580,13 +209048,13 @@
209048 break;
209049 }
209050 case JEACH_JSON: {
209051 if( p->sParse.zJson==0 ){
209052 sqlite3_result_blob(ctx, p->sParse.aBlob, p->sParse.nBlob,
209053 SQLITE_TRANSIENT);
209054 }else{
209055 sqlite3_result_text(ctx, p->sParse.zJson, -1, SQLITE_TRANSIENT);
209056 }
209057 break;
209058 }
209059 }
209060 return SQLITE_OK;
@@ -208856,10 +209324,12 @@
209324 JFUNCTION(jsonb_insert, -1,1,0, 1,1,0, jsonSetFunc),
209325 JFUNCTION(json_object, -1,0,1, 1,0,0, jsonObjectFunc),
209326 JFUNCTION(jsonb_object, -1,0,1, 1,1,0, jsonObjectFunc),
209327 JFUNCTION(json_patch, 2,1,1, 0,0,0, jsonPatchFunc),
209328 JFUNCTION(jsonb_patch, 2,1,0, 0,1,0, jsonPatchFunc),
209329 JFUNCTION(json_pretty, 1,1,0, 0,0,0, jsonPrettyFunc),
209330 JFUNCTION(json_pretty, 2,1,0, 0,0,0, jsonPrettyFunc),
209331 JFUNCTION(json_quote, 1,0,1, 1,0,0, jsonQuoteFunc),
209332 JFUNCTION(json_remove, -1,1,1, 0,0,0, jsonRemoveFunc),
209333 JFUNCTION(jsonb_remove, -1,1,0, 0,1,0, jsonRemoveFunc),
209334 JFUNCTION(json_replace, -1,1,1, 1,0,0, jsonReplaceFunc),
209335 JFUNCTION(jsonb_replace, -1,1,0, 1,1,0, jsonReplaceFunc),
@@ -210755,10 +211225,12 @@
211225 }
211226 pCons->pInfo = pInfo;
211227 return SQLITE_OK;
211228 }
211229
211230 SQLITE_PRIVATE int sqlite3IntFloatCompare(i64,double);
211231
211232 /*
211233 ** Rtree virtual table module xFilter method.
211234 */
211235 static int rtreeFilter(
211236 sqlite3_vtab_cursor *pVtabCursor,
@@ -210784,11 +211256,12 @@
211256 RtreeSearchPoint *p; /* Search point for the leaf */
211257 i64 iRowid = sqlite3_value_int64(argv[0]);
211258 i64 iNode = 0;
211259 int eType = sqlite3_value_numeric_type(argv[0]);
211260 if( eType==SQLITE_INTEGER
211261 || (eType==SQLITE_FLOAT
211262 && 0==sqlite3IntFloatCompare(iRowid,sqlite3_value_double(argv[0])))
211263 ){
211264 rc = findLeafNode(pRtree, iRowid, &pLeaf, &iNode);
211265 }else{
211266 rc = SQLITE_OK;
211267 pLeaf = 0;
@@ -251030,11 +251503,11 @@
251503 int nArg, /* Number of args */
251504 sqlite3_value **apUnused /* Function arguments */
251505 ){
251506 assert( nArg==0 );
251507 UNUSED_PARAM2(nArg, apUnused);
251508 sqlite3_result_text(pCtx, "fts5: 2024-03-09 18:41:40 7ead022edaf7a0cd6a8976a1261246084975c9a5be5c893f6c751bb5f963ac0f", -1, SQLITE_TRANSIENT);
251509 }
251510
251511 /*
251512 ** Return true if zName is the extension on one of the shadow tables used
251513 ** by this module.
251514
--- extsrc/sqlite3.h
+++ extsrc/sqlite3.h
@@ -146,11 +146,11 @@
146146
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
147147
** [sqlite_version()] and [sqlite_source_id()].
148148
*/
149149
#define SQLITE_VERSION "3.46.0"
150150
#define SQLITE_VERSION_NUMBER 3046000
151
-#define SQLITE_SOURCE_ID "2024-02-22 00:50:54 ce5df19dc4aff3fde03ef62261a5e095a16a8f4e46e2924becea4fed56ce49e3"
151
+#define SQLITE_SOURCE_ID "2024-03-09 18:41:40 7ead022edaf7a0cd6a8976a1261246084975c9a5be5c893f6c751bb5f963ac0f"
152152
153153
/*
154154
** CAPI3REF: Run-Time Library Version Numbers
155155
** KEYWORDS: sqlite3_version sqlite3_sourceid
156156
**
@@ -762,15 +762,15 @@
762762
** <li> [SQLITE_LOCK_PENDING], or
763763
** <li> [SQLITE_LOCK_EXCLUSIVE].
764764
** </ul>
765765
** xLock() upgrades the database file lock. In other words, xLock() moves the
766766
** database file lock in the direction NONE toward EXCLUSIVE. The argument to
767
-** xLock() is always on of SHARED, RESERVED, PENDING, or EXCLUSIVE, never
767
+** xLock() is always one of SHARED, RESERVED, PENDING, or EXCLUSIVE, never
768768
** SQLITE_LOCK_NONE. If the database file lock is already at or above the
769769
** requested lock, then the call to xLock() is a no-op.
770770
** xUnlock() downgrades the database file lock to either SHARED or NONE.
771
-* If the lock is already at or below the requested lock state, then the call
771
+** If the lock is already at or below the requested lock state, then the call
772772
** to xUnlock() is a no-op.
773773
** The xCheckReservedLock() method checks whether any database connection,
774774
** either in this process or in some other process, is holding a RESERVED,
775775
** PENDING, or EXCLUSIVE lock on the file. It returns true
776776
** if such a lock exists and false otherwise.
777777
--- extsrc/sqlite3.h
+++ extsrc/sqlite3.h
@@ -146,11 +146,11 @@
146 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
147 ** [sqlite_version()] and [sqlite_source_id()].
148 */
149 #define SQLITE_VERSION "3.46.0"
150 #define SQLITE_VERSION_NUMBER 3046000
151 #define SQLITE_SOURCE_ID "2024-02-22 00:50:54 ce5df19dc4aff3fde03ef62261a5e095a16a8f4e46e2924becea4fed56ce49e3"
152
153 /*
154 ** CAPI3REF: Run-Time Library Version Numbers
155 ** KEYWORDS: sqlite3_version sqlite3_sourceid
156 **
@@ -762,15 +762,15 @@
762 ** <li> [SQLITE_LOCK_PENDING], or
763 ** <li> [SQLITE_LOCK_EXCLUSIVE].
764 ** </ul>
765 ** xLock() upgrades the database file lock. In other words, xLock() moves the
766 ** database file lock in the direction NONE toward EXCLUSIVE. The argument to
767 ** xLock() is always on of SHARED, RESERVED, PENDING, or EXCLUSIVE, never
768 ** SQLITE_LOCK_NONE. If the database file lock is already at or above the
769 ** requested lock, then the call to xLock() is a no-op.
770 ** xUnlock() downgrades the database file lock to either SHARED or NONE.
771 * If the lock is already at or below the requested lock state, then the call
772 ** to xUnlock() is a no-op.
773 ** The xCheckReservedLock() method checks whether any database connection,
774 ** either in this process or in some other process, is holding a RESERVED,
775 ** PENDING, or EXCLUSIVE lock on the file. It returns true
776 ** if such a lock exists and false otherwise.
777
--- extsrc/sqlite3.h
+++ extsrc/sqlite3.h
@@ -146,11 +146,11 @@
146 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
147 ** [sqlite_version()] and [sqlite_source_id()].
148 */
149 #define SQLITE_VERSION "3.46.0"
150 #define SQLITE_VERSION_NUMBER 3046000
151 #define SQLITE_SOURCE_ID "2024-03-09 18:41:40 7ead022edaf7a0cd6a8976a1261246084975c9a5be5c893f6c751bb5f963ac0f"
152
153 /*
154 ** CAPI3REF: Run-Time Library Version Numbers
155 ** KEYWORDS: sqlite3_version sqlite3_sourceid
156 **
@@ -762,15 +762,15 @@
762 ** <li> [SQLITE_LOCK_PENDING], or
763 ** <li> [SQLITE_LOCK_EXCLUSIVE].
764 ** </ul>
765 ** xLock() upgrades the database file lock. In other words, xLock() moves the
766 ** database file lock in the direction NONE toward EXCLUSIVE. The argument to
767 ** xLock() is always one of SHARED, RESERVED, PENDING, or EXCLUSIVE, never
768 ** SQLITE_LOCK_NONE. If the database file lock is already at or above the
769 ** requested lock, then the call to xLock() is a no-op.
770 ** xUnlock() downgrades the database file lock to either SHARED or NONE.
771 ** If the lock is already at or below the requested lock state, then the call
772 ** to xUnlock() is a no-op.
773 ** The xCheckReservedLock() method checks whether any database connection,
774 ** either in this process or in some other process, is holding a RESERVED,
775 ** PENDING, or EXCLUSIVE lock on the file. It returns true
776 ** if such a lock exists and false otherwise.
777

Keyboard Shortcuts

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