| | @@ -1,8 +1,8 @@ |
| 1 | 1 | /****************************************************************************** |
| 2 | 2 | ** This file is an amalgamation of many separate C source files from SQLite |
| 3 | | -** version 3.23.0. By combining all the individual C code files into this |
| 3 | +** version 3.23.1. By combining all the individual C code files into this |
| 4 | 4 | ** single large file, the entire code can be compiled as a single translation |
| 5 | 5 | ** unit. This allows many compilers to do optimizations that would not be |
| 6 | 6 | ** possible if the files were compiled separately. Performance improvements |
| 7 | 7 | ** of 5% or more are commonly seen when SQLite is compiled as a single |
| 8 | 8 | ** translation unit. |
| | @@ -1145,13 +1145,13 @@ |
| 1145 | 1145 | ** |
| 1146 | 1146 | ** See also: [sqlite3_libversion()], |
| 1147 | 1147 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 1148 | 1148 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 1149 | 1149 | */ |
| 1150 | | -#define SQLITE_VERSION "3.23.0" |
| 1151 | | -#define SQLITE_VERSION_NUMBER 3023000 |
| 1152 | | -#define SQLITE_SOURCE_ID "2018-03-22 17:13:44 eb4f452e354065d610ff57a6a9312ad119b6b0cc467f9dff105f0718bc27ef01" |
| 1150 | +#define SQLITE_VERSION "3.23.1" |
| 1151 | +#define SQLITE_VERSION_NUMBER 3023001 |
| 1152 | +#define SQLITE_SOURCE_ID "2018-04-10 17:39:29 4bb2294022060e61de7da5c227a69ccd846ba330e31626ebcd59a94efd148b3b" |
| 1153 | 1153 | |
| 1154 | 1154 | /* |
| 1155 | 1155 | ** CAPI3REF: Run-Time Library Version Numbers |
| 1156 | 1156 | ** KEYWORDS: sqlite3_version sqlite3_sourceid |
| 1157 | 1157 | ** |
| | @@ -2086,10 +2086,16 @@ |
| 2086 | 2086 | ** [SQLITE_FCNTL_BEGIN_ATOMIC_WRITE] to be rolled back. |
| 2087 | 2087 | ** ^This file control takes the file descriptor out of batch write mode |
| 2088 | 2088 | ** so that all subsequent write operations are independent. |
| 2089 | 2089 | ** ^SQLite will never invoke SQLITE_FCNTL_ROLLBACK_ATOMIC_WRITE without |
| 2090 | 2090 | ** a prior successful call to [SQLITE_FCNTL_BEGIN_ATOMIC_WRITE]. |
| 2091 | +** |
| 2092 | +** <li>[[SQLITE_FCNTL_LOCK_TIMEOUT]] |
| 2093 | +** The [SQLITE_FCNTL_LOCK_TIMEOUT] opcode causes attempts to obtain |
| 2094 | +** a file lock using the xLock or xShmLock methods of the VFS to wait |
| 2095 | +** for up to M milliseconds before failing, where M is the single |
| 2096 | +** unsigned integer parameter. |
| 2091 | 2097 | ** </ul> |
| 2092 | 2098 | */ |
| 2093 | 2099 | #define SQLITE_FCNTL_LOCKSTATE 1 |
| 2094 | 2100 | #define SQLITE_FCNTL_GET_LOCKPROXYFILE 2 |
| 2095 | 2101 | #define SQLITE_FCNTL_SET_LOCKPROXYFILE 3 |
| | @@ -2120,10 +2126,11 @@ |
| 2120 | 2126 | #define SQLITE_FCNTL_WIN32_GET_HANDLE 29 |
| 2121 | 2127 | #define SQLITE_FCNTL_PDB 30 |
| 2122 | 2128 | #define SQLITE_FCNTL_BEGIN_ATOMIC_WRITE 31 |
| 2123 | 2129 | #define SQLITE_FCNTL_COMMIT_ATOMIC_WRITE 32 |
| 2124 | 2130 | #define SQLITE_FCNTL_ROLLBACK_ATOMIC_WRITE 33 |
| 2131 | +#define SQLITE_FCNTL_LOCK_TIMEOUT 34 |
| 2125 | 2132 | |
| 2126 | 2133 | /* deprecated names */ |
| 2127 | 2134 | #define SQLITE_GET_LOCKPROXYFILE SQLITE_FCNTL_GET_LOCKPROXYFILE |
| 2128 | 2135 | #define SQLITE_SET_LOCKPROXYFILE SQLITE_FCNTL_SET_LOCKPROXYFILE |
| 2129 | 2136 | #define SQLITE_LAST_ERRNO SQLITE_FCNTL_LAST_ERRNO |
| | @@ -9833,11 +9840,11 @@ |
| 9833 | 9840 | |
| 9834 | 9841 | /* |
| 9835 | 9842 | ** CAPI3REF: Deserialize a database |
| 9836 | 9843 | ** |
| 9837 | 9844 | ** The sqlite3_deserialize(D,S,P,N,M,F) interface causes the |
| 9838 | | -** [database connection] D to disconnection from database S and then |
| 9845 | +** [database connection] D to disconnect from database S and then |
| 9839 | 9846 | ** reopen S as an in-memory database based on the serialization contained |
| 9840 | 9847 | ** in P. The serialized database P is N bytes in size. M is the size of |
| 9841 | 9848 | ** the buffer P, which might be larger than N. If M is larger than N, and |
| 9842 | 9849 | ** the SQLITE_DESERIALIZE_READONLY bit is not set in F, then SQLite is |
| 9843 | 9850 | ** permitted to add content to the in-memory database as long as the total |
| | @@ -10974,23 +10981,22 @@ |
| 10974 | 10981 | SQLITE_API void sqlite3changegroup_delete(sqlite3_changegroup*); |
| 10975 | 10982 | |
| 10976 | 10983 | /* |
| 10977 | 10984 | ** CAPI3REF: Apply A Changeset To A Database |
| 10978 | 10985 | ** |
| 10979 | | -** Apply a changeset to a database. This function attempts to update the |
| 10980 | | -** "main" database attached to handle db with the changes found in the |
| 10981 | | -** changeset passed via the second and third arguments. |
| 10986 | +** Apply a changeset or patchset to a database. These functions attempt to |
| 10987 | +** update the "main" database attached to handle db with the changes found in |
| 10988 | +** the changeset passed via the second and third arguments. |
| 10982 | 10989 | ** |
| 10983 | | -** The fourth argument (xFilter) passed to this function is the "filter |
| 10990 | +** The fourth argument (xFilter) passed to these functions is the "filter |
| 10984 | 10991 | ** callback". If it is not NULL, then for each table affected by at least one |
| 10985 | 10992 | ** change in the changeset, the filter callback is invoked with |
| 10986 | 10993 | ** the table name as the second argument, and a copy of the context pointer |
| 10987 | | -** passed as the sixth argument to this function as the first. If the "filter |
| 10988 | | -** callback" returns zero, then no attempt is made to apply any changes to |
| 10989 | | -** the table. Otherwise, if the return value is non-zero or the xFilter |
| 10990 | | -** argument to this function is NULL, all changes related to the table are |
| 10991 | | -** attempted. |
| 10994 | +** passed as the sixth argument as the first. If the "filter callback" |
| 10995 | +** returns zero, then no attempt is made to apply any changes to the table. |
| 10996 | +** Otherwise, if the return value is non-zero or the xFilter argument to |
| 10997 | +** is NULL, all changes related to the table are attempted. |
| 10992 | 10998 | ** |
| 10993 | 10999 | ** For each table that is not excluded by the filter callback, this function |
| 10994 | 11000 | ** tests that the target database contains a compatible table. A table is |
| 10995 | 11001 | ** considered compatible if all of the following are true: |
| 10996 | 11002 | ** |
| | @@ -11031,11 +11037,11 @@ |
| 11031 | 11037 | ** the documentation for the three |
| 11032 | 11038 | ** [SQLITE_CHANGESET_OMIT|available return values] for details. |
| 11033 | 11039 | ** |
| 11034 | 11040 | ** <dl> |
| 11035 | 11041 | ** <dt>DELETE Changes<dd> |
| 11036 | | -** For each DELETE change, this function checks if the target database |
| 11042 | +** For each DELETE change, the function checks if the target database |
| 11037 | 11043 | ** contains a row with the same primary key value (or values) as the |
| 11038 | 11044 | ** original row values stored in the changeset. If it does, and the values |
| 11039 | 11045 | ** stored in all non-primary key columns also match the values stored in |
| 11040 | 11046 | ** the changeset the row is deleted from the target database. |
| 11041 | 11047 | ** |
| | @@ -11076,11 +11082,11 @@ |
| 11076 | 11082 | ** This includes the case where the INSERT operation is re-attempted because |
| 11077 | 11083 | ** an earlier call to the conflict handler function returned |
| 11078 | 11084 | ** [SQLITE_CHANGESET_REPLACE]. |
| 11079 | 11085 | ** |
| 11080 | 11086 | ** <dt>UPDATE Changes<dd> |
| 11081 | | -** For each UPDATE change, this function checks if the target database |
| 11087 | +** For each UPDATE change, the function checks if the target database |
| 11082 | 11088 | ** contains a row with the same primary key value (or values) as the |
| 11083 | 11089 | ** original row values stored in the changeset. If it does, and the values |
| 11084 | 11090 | ** stored in all modified non-primary key columns also match the values |
| 11085 | 11091 | ** stored in the changeset the row is updated within the target database. |
| 11086 | 11092 | ** |
| | @@ -11107,15 +11113,32 @@ |
| 11107 | 11113 | ** It is safe to execute SQL statements, including those that write to the |
| 11108 | 11114 | ** table that the callback related to, from within the xConflict callback. |
| 11109 | 11115 | ** This can be used to further customize the applications conflict |
| 11110 | 11116 | ** resolution strategy. |
| 11111 | 11117 | ** |
| 11112 | | -** All changes made by this function are enclosed in a savepoint transaction. |
| 11118 | +** All changes made by these functions are enclosed in a savepoint transaction. |
| 11113 | 11119 | ** If any other error (aside from a constraint failure when attempting to |
| 11114 | 11120 | ** write to the target database) occurs, then the savepoint transaction is |
| 11115 | 11121 | ** rolled back, restoring the target database to its original state, and an |
| 11116 | 11122 | ** SQLite error code returned. |
| 11123 | +** |
| 11124 | +** If the output parameters (ppRebase) and (pnRebase) are non-NULL and |
| 11125 | +** the input is a changeset (not a patchset), then sqlite3changeset_apply_v2() |
| 11126 | +** may set (*ppRebase) to point to a "rebase" that may be used with the |
| 11127 | +** sqlite3_rebaser APIs buffer before returning. In this case (*pnRebase) |
| 11128 | +** is set to the size of the buffer in bytes. It is the responsibility of the |
| 11129 | +** caller to eventually free any such buffer using sqlite3_free(). The buffer |
| 11130 | +** is only allocated and populated if one or more conflicts were encountered |
| 11131 | +** while applying the patchset. See comments surrounding the sqlite3_rebaser |
| 11132 | +** APIs for further details. |
| 11133 | +** |
| 11134 | +** The behavior of sqlite3changeset_apply_v2() and its streaming equivalent |
| 11135 | +** may be modified by passing a combination of |
| 11136 | +** [SQLITE_CHANGESETAPPLY_NOSAVEPOINT | supported flags] as the 9th parameter. |
| 11137 | +** |
| 11138 | +** Note that the sqlite3changeset_apply_v2() API is still <b>experimental</b> |
| 11139 | +** and therefore subject to change. |
| 11117 | 11140 | */ |
| 11118 | 11141 | SQLITE_API int sqlite3changeset_apply( |
| 11119 | 11142 | sqlite3 *db, /* Apply change to "main" db of this handle */ |
| 11120 | 11143 | int nChangeset, /* Size of changeset in bytes */ |
| 11121 | 11144 | void *pChangeset, /* Changeset blob */ |
| | @@ -11128,10 +11151,45 @@ |
| 11128 | 11151 | int eConflict, /* DATA, MISSING, CONFLICT, CONSTRAINT */ |
| 11129 | 11152 | sqlite3_changeset_iter *p /* Handle describing change and conflict */ |
| 11130 | 11153 | ), |
| 11131 | 11154 | void *pCtx /* First argument passed to xConflict */ |
| 11132 | 11155 | ); |
| 11156 | +SQLITE_API int sqlite3changeset_apply_v2( |
| 11157 | + sqlite3 *db, /* Apply change to "main" db of this handle */ |
| 11158 | + int nChangeset, /* Size of changeset in bytes */ |
| 11159 | + void *pChangeset, /* Changeset blob */ |
| 11160 | + int(*xFilter)( |
| 11161 | + void *pCtx, /* Copy of sixth arg to _apply() */ |
| 11162 | + const char *zTab /* Table name */ |
| 11163 | + ), |
| 11164 | + int(*xConflict)( |
| 11165 | + void *pCtx, /* Copy of sixth arg to _apply() */ |
| 11166 | + int eConflict, /* DATA, MISSING, CONFLICT, CONSTRAINT */ |
| 11167 | + sqlite3_changeset_iter *p /* Handle describing change and conflict */ |
| 11168 | + ), |
| 11169 | + void *pCtx, /* First argument passed to xConflict */ |
| 11170 | + void **ppRebase, int *pnRebase, /* OUT: Rebase data */ |
| 11171 | + int flags /* Combination of SESSION_APPLY_* flags */ |
| 11172 | +); |
| 11173 | + |
| 11174 | +/* |
| 11175 | +** CAPI3REF: Flags for sqlite3changeset_apply_v2 |
| 11176 | +** |
| 11177 | +** The following flags may passed via the 9th parameter to |
| 11178 | +** [sqlite3changeset_apply_v2] and [sqlite3changeset_apply_v2_strm]: |
| 11179 | +** |
| 11180 | +** <dl> |
| 11181 | +** <dt>SQLITE_CHANGESETAPPLY_NOSAVEPOINT <dd> |
| 11182 | +** Usually, the sessions module encloses all operations performed by |
| 11183 | +** a single call to apply_v2() or apply_v2_strm() in a [SAVEPOINT]. The |
| 11184 | +** SAVEPOINT is committed if the changeset or patchset is successfully |
| 11185 | +** applied, or rolled back if an error occurs. Specifying this flag |
| 11186 | +** causes the sessions module to omit this savepoint. In this case, if the |
| 11187 | +** caller has an open transaction or savepoint when apply_v2() is called, |
| 11188 | +** it may revert the partially applied changeset by rolling it back. |
| 11189 | +*/ |
| 11190 | +#define SQLITE_CHANGESETAPPLY_NOSAVEPOINT 0x0001 |
| 11133 | 11191 | |
| 11134 | 11192 | /* |
| 11135 | 11193 | ** CAPI3REF: Constants Passed To The Conflict Handler |
| 11136 | 11194 | ** |
| 11137 | 11195 | ** Values that may be passed as the second argument to a conflict-handler. |
| | @@ -11225,19 +11283,175 @@ |
| 11225 | 11283 | */ |
| 11226 | 11284 | #define SQLITE_CHANGESET_OMIT 0 |
| 11227 | 11285 | #define SQLITE_CHANGESET_REPLACE 1 |
| 11228 | 11286 | #define SQLITE_CHANGESET_ABORT 2 |
| 11229 | 11287 | |
| 11288 | +/* |
| 11289 | +** CAPI3REF: Rebasing changesets |
| 11290 | +** EXPERIMENTAL |
| 11291 | +** |
| 11292 | +** Suppose there is a site hosting a database in state S0. And that |
| 11293 | +** modifications are made that move that database to state S1 and a |
| 11294 | +** changeset recorded (the "local" changeset). Then, a changeset based |
| 11295 | +** on S0 is received from another site (the "remote" changeset) and |
| 11296 | +** applied to the database. The database is then in state |
| 11297 | +** (S1+"remote"), where the exact state depends on any conflict |
| 11298 | +** resolution decisions (OMIT or REPLACE) made while applying "remote". |
| 11299 | +** Rebasing a changeset is to update it to take those conflict |
| 11300 | +** resolution decisions into account, so that the same conflicts |
| 11301 | +** do not have to be resolved elsewhere in the network. |
| 11302 | +** |
| 11303 | +** For example, if both the local and remote changesets contain an |
| 11304 | +** INSERT of the same key on "CREATE TABLE t1(a PRIMARY KEY, b)": |
| 11305 | +** |
| 11306 | +** local: INSERT INTO t1 VALUES(1, 'v1'); |
| 11307 | +** remote: INSERT INTO t1 VALUES(1, 'v2'); |
| 11308 | +** |
| 11309 | +** and the conflict resolution is REPLACE, then the INSERT change is |
| 11310 | +** removed from the local changeset (it was overridden). Or, if the |
| 11311 | +** conflict resolution was "OMIT", then the local changeset is modified |
| 11312 | +** to instead contain: |
| 11313 | +** |
| 11314 | +** UPDATE t1 SET b = 'v2' WHERE a=1; |
| 11315 | +** |
| 11316 | +** Changes within the local changeset are rebased as follows: |
| 11317 | +** |
| 11318 | +** <dl> |
| 11319 | +** <dt>Local INSERT<dd> |
| 11320 | +** This may only conflict with a remote INSERT. If the conflict |
| 11321 | +** resolution was OMIT, then add an UPDATE change to the rebased |
| 11322 | +** changeset. Or, if the conflict resolution was REPLACE, add |
| 11323 | +** nothing to the rebased changeset. |
| 11324 | +** |
| 11325 | +** <dt>Local DELETE<dd> |
| 11326 | +** This may conflict with a remote UPDATE or DELETE. In both cases the |
| 11327 | +** only possible resolution is OMIT. If the remote operation was a |
| 11328 | +** DELETE, then add no change to the rebased changeset. If the remote |
| 11329 | +** operation was an UPDATE, then the old.* fields of change are updated |
| 11330 | +** to reflect the new.* values in the UPDATE. |
| 11331 | +** |
| 11332 | +** <dt>Local UPDATE<dd> |
| 11333 | +** This may conflict with a remote UPDATE or DELETE. If it conflicts |
| 11334 | +** with a DELETE, and the conflict resolution was OMIT, then the update |
| 11335 | +** is changed into an INSERT. Any undefined values in the new.* record |
| 11336 | +** from the update change are filled in using the old.* values from |
| 11337 | +** the conflicting DELETE. Or, if the conflict resolution was REPLACE, |
| 11338 | +** the UPDATE change is simply omitted from the rebased changeset. |
| 11339 | +** |
| 11340 | +** If conflict is with a remote UPDATE and the resolution is OMIT, then |
| 11341 | +** the old.* values are rebased using the new.* values in the remote |
| 11342 | +** change. Or, if the resolution is REPLACE, then the change is copied |
| 11343 | +** into the rebased changeset with updates to columns also updated by |
| 11344 | +** the conflicting remote UPDATE removed. If this means no columns would |
| 11345 | +** be updated, the change is omitted. |
| 11346 | +** </dl> |
| 11347 | +** |
| 11348 | +** A local change may be rebased against multiple remote changes |
| 11349 | +** simultaneously. If a single key is modified by multiple remote |
| 11350 | +** changesets, they are combined as follows before the local changeset |
| 11351 | +** is rebased: |
| 11352 | +** |
| 11353 | +** <ul> |
| 11354 | +** <li> If there has been one or more REPLACE resolutions on a |
| 11355 | +** key, it is rebased according to a REPLACE. |
| 11356 | +** |
| 11357 | +** <li> If there have been no REPLACE resolutions on a key, then |
| 11358 | +** the local changeset is rebased according to the most recent |
| 11359 | +** of the OMIT resolutions. |
| 11360 | +** </ul> |
| 11361 | +** |
| 11362 | +** Note that conflict resolutions from multiple remote changesets are |
| 11363 | +** combined on a per-field basis, not per-row. This means that in the |
| 11364 | +** case of multiple remote UPDATE operations, some fields of a single |
| 11365 | +** local change may be rebased for REPLACE while others are rebased for |
| 11366 | +** OMIT. |
| 11367 | +** |
| 11368 | +** In order to rebase a local changeset, the remote changeset must first |
| 11369 | +** be applied to the local database using sqlite3changeset_apply_v2() and |
| 11370 | +** the buffer of rebase information captured. Then: |
| 11371 | +** |
| 11372 | +** <ol> |
| 11373 | +** <li> An sqlite3_rebaser object is created by calling |
| 11374 | +** sqlite3rebaser_create(). |
| 11375 | +** <li> The new object is configured with the rebase buffer obtained from |
| 11376 | +** sqlite3changeset_apply_v2() by calling sqlite3rebaser_configure(). |
| 11377 | +** If the local changeset is to be rebased against multiple remote |
| 11378 | +** changesets, then sqlite3rebaser_configure() should be called |
| 11379 | +** multiple times, in the same order that the multiple |
| 11380 | +** sqlite3changeset_apply_v2() calls were made. |
| 11381 | +** <li> Each local changeset is rebased by calling sqlite3rebaser_rebase(). |
| 11382 | +** <li> The sqlite3_rebaser object is deleted by calling |
| 11383 | +** sqlite3rebaser_delete(). |
| 11384 | +** </ol> |
| 11385 | +*/ |
| 11386 | +typedef struct sqlite3_rebaser sqlite3_rebaser; |
| 11387 | + |
| 11388 | +/* |
| 11389 | +** CAPI3REF: Create a changeset rebaser object. |
| 11390 | +** EXPERIMENTAL |
| 11391 | +** |
| 11392 | +** Allocate a new changeset rebaser object. If successful, set (*ppNew) to |
| 11393 | +** point to the new object and return SQLITE_OK. Otherwise, if an error |
| 11394 | +** occurs, return an SQLite error code (e.g. SQLITE_NOMEM) and set (*ppNew) |
| 11395 | +** to NULL. |
| 11396 | +*/ |
| 11397 | +SQLITE_API int sqlite3rebaser_create(sqlite3_rebaser **ppNew); |
| 11398 | + |
| 11399 | +/* |
| 11400 | +** CAPI3REF: Configure a changeset rebaser object. |
| 11401 | +** EXPERIMENTAL |
| 11402 | +** |
| 11403 | +** Configure the changeset rebaser object to rebase changesets according |
| 11404 | +** to the conflict resolutions described by buffer pRebase (size nRebase |
| 11405 | +** bytes), which must have been obtained from a previous call to |
| 11406 | +** sqlite3changeset_apply_v2(). |
| 11407 | +*/ |
| 11408 | +SQLITE_API int sqlite3rebaser_configure( |
| 11409 | + sqlite3_rebaser*, |
| 11410 | + int nRebase, const void *pRebase |
| 11411 | +); |
| 11412 | + |
| 11413 | +/* |
| 11414 | +** CAPI3REF: Rebase a changeset |
| 11415 | +** EXPERIMENTAL |
| 11416 | +** |
| 11417 | +** Argument pIn must point to a buffer containing a changeset nIn bytes |
| 11418 | +** in size. This function allocates and populates a buffer with a copy |
| 11419 | +** of the changeset rebased rebased according to the configuration of the |
| 11420 | +** rebaser object passed as the first argument. If successful, (*ppOut) |
| 11421 | +** is set to point to the new buffer containing the rebased changset and |
| 11422 | +** (*pnOut) to its size in bytes and SQLITE_OK returned. It is the |
| 11423 | +** responsibility of the caller to eventually free the new buffer using |
| 11424 | +** sqlite3_free(). Otherwise, if an error occurs, (*ppOut) and (*pnOut) |
| 11425 | +** are set to zero and an SQLite error code returned. |
| 11426 | +*/ |
| 11427 | +SQLITE_API int sqlite3rebaser_rebase( |
| 11428 | + sqlite3_rebaser*, |
| 11429 | + int nIn, const void *pIn, |
| 11430 | + int *pnOut, void **ppOut |
| 11431 | +); |
| 11432 | + |
| 11433 | +/* |
| 11434 | +** CAPI3REF: Delete a changeset rebaser object. |
| 11435 | +** EXPERIMENTAL |
| 11436 | +** |
| 11437 | +** Delete the changeset rebaser object and all associated resources. There |
| 11438 | +** should be one call to this function for each successful invocation |
| 11439 | +** of sqlite3rebaser_create(). |
| 11440 | +*/ |
| 11441 | +SQLITE_API void sqlite3rebaser_delete(sqlite3_rebaser *p); |
| 11442 | + |
| 11230 | 11443 | /* |
| 11231 | 11444 | ** CAPI3REF: Streaming Versions of API functions. |
| 11232 | 11445 | ** |
| 11233 | 11446 | ** The six streaming API xxx_strm() functions serve similar purposes to the |
| 11234 | 11447 | ** corresponding non-streaming API functions: |
| 11235 | 11448 | ** |
| 11236 | 11449 | ** <table border=1 style="margin-left:8ex;margin-right:8ex"> |
| 11237 | 11450 | ** <tr><th>Streaming function<th>Non-streaming equivalent</th> |
| 11238 | 11451 | ** <tr><td>sqlite3changeset_apply_strm<td>[sqlite3changeset_apply] |
| 11452 | +** <tr><td>sqlite3changeset_apply_strm_v2<td>[sqlite3changeset_apply_v2] |
| 11239 | 11453 | ** <tr><td>sqlite3changeset_concat_strm<td>[sqlite3changeset_concat] |
| 11240 | 11454 | ** <tr><td>sqlite3changeset_invert_strm<td>[sqlite3changeset_invert] |
| 11241 | 11455 | ** <tr><td>sqlite3changeset_start_strm<td>[sqlite3changeset_start] |
| 11242 | 11456 | ** <tr><td>sqlite3session_changeset_strm<td>[sqlite3session_changeset] |
| 11243 | 11457 | ** <tr><td>sqlite3session_patchset_strm<td>[sqlite3session_patchset] |
| | @@ -11328,10 +11542,27 @@ |
| 11328 | 11542 | void *pCtx, /* Copy of sixth arg to _apply() */ |
| 11329 | 11543 | int eConflict, /* DATA, MISSING, CONFLICT, CONSTRAINT */ |
| 11330 | 11544 | sqlite3_changeset_iter *p /* Handle describing change and conflict */ |
| 11331 | 11545 | ), |
| 11332 | 11546 | void *pCtx /* First argument passed to xConflict */ |
| 11547 | +); |
| 11548 | +SQLITE_API int sqlite3changeset_apply_v2_strm( |
| 11549 | + sqlite3 *db, /* Apply change to "main" db of this handle */ |
| 11550 | + int (*xInput)(void *pIn, void *pData, int *pnData), /* Input function */ |
| 11551 | + void *pIn, /* First arg for xInput */ |
| 11552 | + int(*xFilter)( |
| 11553 | + void *pCtx, /* Copy of sixth arg to _apply() */ |
| 11554 | + const char *zTab /* Table name */ |
| 11555 | + ), |
| 11556 | + int(*xConflict)( |
| 11557 | + void *pCtx, /* Copy of sixth arg to _apply() */ |
| 11558 | + int eConflict, /* DATA, MISSING, CONFLICT, CONSTRAINT */ |
| 11559 | + sqlite3_changeset_iter *p /* Handle describing change and conflict */ |
| 11560 | + ), |
| 11561 | + void *pCtx, /* First argument passed to xConflict */ |
| 11562 | + void **ppRebase, int *pnRebase, |
| 11563 | + int flags |
| 11333 | 11564 | ); |
| 11334 | 11565 | SQLITE_API int sqlite3changeset_concat_strm( |
| 11335 | 11566 | int (*xInputA)(void *pIn, void *pData, int *pnData), |
| 11336 | 11567 | void *pInA, |
| 11337 | 11568 | int (*xInputB)(void *pIn, void *pData, int *pnData), |
| | @@ -11365,10 +11596,17 @@ |
| 11365 | 11596 | void *pIn |
| 11366 | 11597 | ); |
| 11367 | 11598 | SQLITE_API int sqlite3changegroup_output_strm(sqlite3_changegroup*, |
| 11368 | 11599 | int (*xOutput)(void *pOut, const void *pData, int nData), |
| 11369 | 11600 | void *pOut |
| 11601 | +); |
| 11602 | +SQLITE_API int sqlite3rebaser_rebase_strm( |
| 11603 | + sqlite3_rebaser *pRebaser, |
| 11604 | + int (*xInput)(void *pIn, void *pData, int *pnData), |
| 11605 | + void *pIn, |
| 11606 | + int (*xOutput)(void *pOut, const void *pData, int nData), |
| 11607 | + void *pOut |
| 11370 | 11608 | ); |
| 11371 | 11609 | |
| 11372 | 11610 | |
| 11373 | 11611 | /* |
| 11374 | 11612 | ** Make sure we can call this stuff from C++. |
| | @@ -13245,13 +13483,14 @@ |
| 13245 | 13483 | ** handle is passed a pointer to sqlite.busyHandler. The busy-handler |
| 13246 | 13484 | ** callback is currently invoked only from within pager.c. |
| 13247 | 13485 | */ |
| 13248 | 13486 | typedef struct BusyHandler BusyHandler; |
| 13249 | 13487 | struct BusyHandler { |
| 13250 | | - int (*xFunc)(void *,int); /* The busy callback */ |
| 13251 | | - void *pArg; /* First arg to busy callback */ |
| 13252 | | - int nBusy; /* Incremented with each busy call */ |
| 13488 | + int (*xBusyHandler)(void *,int); /* The busy callback */ |
| 13489 | + void *pBusyArg; /* First arg to busy callback */ |
| 13490 | + int nBusy; /* Incremented with each busy call */ |
| 13491 | + u8 bExtraFileArg; /* Include sqlite3_file as callback arg */ |
| 13253 | 13492 | }; |
| 13254 | 13493 | |
| 13255 | 13494 | /* |
| 13256 | 13495 | ** Name of the master database table. The master database table |
| 13257 | 13496 | ** is a special table that holds the names and attributes of all |
| | @@ -14456,11 +14695,11 @@ |
| 14456 | 14695 | ); |
| 14457 | 14696 | SQLITE_PRIVATE int sqlite3PagerClose(Pager *pPager, sqlite3*); |
| 14458 | 14697 | SQLITE_PRIVATE int sqlite3PagerReadFileheader(Pager*, int, unsigned char*); |
| 14459 | 14698 | |
| 14460 | 14699 | /* Functions used to configure a Pager object. */ |
| 14461 | | -SQLITE_PRIVATE void sqlite3PagerSetBusyhandler(Pager*, int(*)(void *), void *); |
| 14700 | +SQLITE_PRIVATE void sqlite3PagerSetBusyHandler(Pager*, int(*)(void *), void *); |
| 14462 | 14701 | SQLITE_PRIVATE int sqlite3PagerSetPagesize(Pager*, u32*, int); |
| 14463 | 14702 | #ifdef SQLITE_HAS_CODEC |
| 14464 | 14703 | SQLITE_PRIVATE void sqlite3PagerAlignReserve(Pager*,Pager*); |
| 14465 | 14704 | #endif |
| 14466 | 14705 | SQLITE_PRIVATE int sqlite3PagerMaxPageCount(Pager*, int); |
| | @@ -14542,10 +14781,15 @@ |
| 14542 | 14781 | SQLITE_PRIVATE void *sqlite3PagerTempSpace(Pager*); |
| 14543 | 14782 | SQLITE_PRIVATE int sqlite3PagerIsMemdb(Pager*); |
| 14544 | 14783 | SQLITE_PRIVATE void sqlite3PagerCacheStat(Pager *, int, int, int *); |
| 14545 | 14784 | SQLITE_PRIVATE void sqlite3PagerClearCache(Pager*); |
| 14546 | 14785 | SQLITE_PRIVATE int sqlite3SectorSize(sqlite3_file *); |
| 14786 | +#ifdef SQLITE_ENABLE_SETLK_TIMEOUT |
| 14787 | +SQLITE_PRIVATE void sqlite3PagerResetLockTimeout(Pager *pPager); |
| 14788 | +#else |
| 14789 | +# define sqlite3PagerResetLockTimeout(X) |
| 14790 | +#endif |
| 14547 | 14791 | |
| 14548 | 14792 | /* Functions used to truncate the database file. */ |
| 14549 | 14793 | SQLITE_PRIVATE void sqlite3PagerTruncateImage(Pager*,Pgno); |
| 14550 | 14794 | |
| 14551 | 14795 | SQLITE_PRIVATE void sqlite3PagerRekey(DbPage*, Pgno, u16); |
| | @@ -18099,11 +18343,11 @@ |
| 18099 | 18343 | SQLITE_PRIVATE void sqlite3AlterFinishAddColumn(Parse *, Token *); |
| 18100 | 18344 | SQLITE_PRIVATE void sqlite3AlterBeginAddColumn(Parse *, SrcList *); |
| 18101 | 18345 | SQLITE_PRIVATE CollSeq *sqlite3GetCollSeq(Parse*, u8, CollSeq *, const char*); |
| 18102 | 18346 | SQLITE_PRIVATE char sqlite3AffinityType(const char*, u8*); |
| 18103 | 18347 | SQLITE_PRIVATE void sqlite3Analyze(Parse*, Token*, Token*); |
| 18104 | | -SQLITE_PRIVATE int sqlite3InvokeBusyHandler(BusyHandler*); |
| 18348 | +SQLITE_PRIVATE int sqlite3InvokeBusyHandler(BusyHandler*, sqlite3_file*); |
| 18105 | 18349 | SQLITE_PRIVATE int sqlite3FindDb(sqlite3*, Token*); |
| 18106 | 18350 | SQLITE_PRIVATE int sqlite3FindDbName(sqlite3 *, const char *); |
| 18107 | 18351 | SQLITE_PRIVATE int sqlite3AnalysisLoad(sqlite3*,int iDB); |
| 18108 | 18352 | SQLITE_PRIVATE void sqlite3DeleteIndexSamples(sqlite3*,Index*); |
| 18109 | 18353 | SQLITE_PRIVATE void sqlite3DefaultRowEst(Index*); |
| | @@ -21069,12 +21313,15 @@ |
| 21069 | 21313 | ** really care if the VFS receives and understands the information since it |
| 21070 | 21314 | ** is only a hint and can be safely ignored. The sqlite3OsFileControlHint() |
| 21071 | 21315 | ** routine has no return value since the return value would be meaningless. |
| 21072 | 21316 | */ |
| 21073 | 21317 | SQLITE_PRIVATE int sqlite3OsFileControl(sqlite3_file *id, int op, void *pArg){ |
| 21318 | + if( id->pMethods==0 ) return SQLITE_NOTFOUND; |
| 21074 | 21319 | #ifdef SQLITE_TEST |
| 21075 | | - if( op!=SQLITE_FCNTL_COMMIT_PHASETWO ){ |
| 21320 | + if( op!=SQLITE_FCNTL_COMMIT_PHASETWO |
| 21321 | + && op!=SQLITE_FCNTL_LOCK_TIMEOUT |
| 21322 | + ){ |
| 21076 | 21323 | /* Faults are not injected into COMMIT_PHASETWO because, assuming SQLite |
| 21077 | 21324 | ** is using a regular VFS, it is called after the corresponding |
| 21078 | 21325 | ** transaction has been committed. Injecting a fault at this point |
| 21079 | 21326 | ** confuses the test scripts - the COMMIT comand returns SQLITE_NOMEM |
| 21080 | 21327 | ** but the transaction is committed anyway. |
| | @@ -21087,11 +21334,11 @@ |
| 21087 | 21334 | } |
| 21088 | 21335 | #endif |
| 21089 | 21336 | return id->pMethods->xFileControl(id, op, pArg); |
| 21090 | 21337 | } |
| 21091 | 21338 | SQLITE_PRIVATE void sqlite3OsFileControlHint(sqlite3_file *id, int op, void *pArg){ |
| 21092 | | - (void)id->pMethods->xFileControl(id, op, pArg); |
| 21339 | + if( id->pMethods ) (void)id->pMethods->xFileControl(id, op, pArg); |
| 21093 | 21340 | } |
| 21094 | 21341 | |
| 21095 | 21342 | SQLITE_PRIVATE int sqlite3OsSectorSize(sqlite3_file *id){ |
| 21096 | 21343 | int (*xSectorSize)(sqlite3_file*) = id->pMethods->xSectorSize; |
| 21097 | 21344 | return (xSectorSize ? xSectorSize(id) : SQLITE_DEFAULT_SECTOR_SIZE); |
| | @@ -31026,10 +31273,13 @@ |
| 31026 | 31273 | int openFlags; /* The flags specified at open() */ |
| 31027 | 31274 | #endif |
| 31028 | 31275 | #if SQLITE_ENABLE_LOCKING_STYLE || defined(__APPLE__) |
| 31029 | 31276 | unsigned fsFlags; /* cached details from statfs() */ |
| 31030 | 31277 | #endif |
| 31278 | +#ifdef SQLITE_ENABLE_SETLK_TIMEOUT |
| 31279 | + unsigned iBusyTimeout; /* Wait this many millisec on locks */ |
| 31280 | +#endif |
| 31031 | 31281 | #if OS_VXWORKS |
| 31032 | 31282 | struct vxworksFileId *pId; /* Unique file ID */ |
| 31033 | 31283 | #endif |
| 31034 | 31284 | #ifdef SQLITE_DEBUG |
| 31035 | 31285 | /* The next group of variables are used to track whether or not the |
| | @@ -32459,10 +32709,47 @@ |
| 32459 | 32709 | OSTRACE(("TEST WR-LOCK %d %d %d (unix)\n", pFile->h, rc, reserved)); |
| 32460 | 32710 | |
| 32461 | 32711 | *pResOut = reserved; |
| 32462 | 32712 | return rc; |
| 32463 | 32713 | } |
| 32714 | + |
| 32715 | +/* |
| 32716 | +** Set a posix-advisory-lock. |
| 32717 | +** |
| 32718 | +** There are two versions of this routine. If compiled with |
| 32719 | +** SQLITE_ENABLE_SETLK_TIMEOUT then the routine has an extra parameter |
| 32720 | +** which is a pointer to a unixFile. If the unixFile->iBusyTimeout |
| 32721 | +** value is set, then it is the number of milliseconds to wait before |
| 32722 | +** failing the lock. The iBusyTimeout value is always reset back to |
| 32723 | +** zero on each call. |
| 32724 | +** |
| 32725 | +** If SQLITE_ENABLE_SETLK_TIMEOUT is not defined, then do a non-blocking |
| 32726 | +** attempt to set the lock. |
| 32727 | +*/ |
| 32728 | +#ifndef SQLITE_ENABLE_SETLK_TIMEOUT |
| 32729 | +# define osSetPosixAdvisoryLock(h,x,t) osFcntl(h,F_SETLK,x) |
| 32730 | +#else |
| 32731 | +static int osSetPosixAdvisoryLock( |
| 32732 | + int h, /* The file descriptor on which to take the lock */ |
| 32733 | + struct flock *pLock, /* The description of the lock */ |
| 32734 | + unixFile *pFile /* Structure holding timeout value */ |
| 32735 | +){ |
| 32736 | + int rc = osFcntl(h,F_SETLK,pLock); |
| 32737 | + while( rc<0 && pFile->iBusyTimeout>0 ){ |
| 32738 | + /* On systems that support some kind of blocking file lock with a timeout, |
| 32739 | + ** make appropriate changes here to invoke that blocking file lock. On |
| 32740 | + ** generic posix, however, there is no such API. So we simply try the |
| 32741 | + ** lock once every millisecond until either the timeout expires, or until |
| 32742 | + ** the lock is obtained. */ |
| 32743 | + usleep(1000); |
| 32744 | + rc = osFcntl(h,F_SETLK,pLock); |
| 32745 | + pFile->iBusyTimeout--; |
| 32746 | + } |
| 32747 | + return rc; |
| 32748 | +} |
| 32749 | +#endif /* SQLITE_ENABLE_SETLK_TIMEOUT */ |
| 32750 | + |
| 32464 | 32751 | |
| 32465 | 32752 | /* |
| 32466 | 32753 | ** Attempt to set a system-lock on the file pFile. The lock is |
| 32467 | 32754 | ** described by pLock. |
| 32468 | 32755 | ** |
| | @@ -32492,19 +32779,19 @@ |
| 32492 | 32779 | assert( pInode->nLock==0 ); |
| 32493 | 32780 | lock.l_whence = SEEK_SET; |
| 32494 | 32781 | lock.l_start = SHARED_FIRST; |
| 32495 | 32782 | lock.l_len = SHARED_SIZE; |
| 32496 | 32783 | lock.l_type = F_WRLCK; |
| 32497 | | - rc = osFcntl(pFile->h, F_SETLK, &lock); |
| 32784 | + rc = osSetPosixAdvisoryLock(pFile->h, &lock, pFile); |
| 32498 | 32785 | if( rc<0 ) return rc; |
| 32499 | 32786 | pInode->bProcessLock = 1; |
| 32500 | 32787 | pInode->nLock++; |
| 32501 | 32788 | }else{ |
| 32502 | 32789 | rc = 0; |
| 32503 | 32790 | } |
| 32504 | 32791 | }else{ |
| 32505 | | - rc = osFcntl(pFile->h, F_SETLK, pLock); |
| 32792 | + rc = osSetPosixAdvisoryLock(pFile->h, pLock, pFile); |
| 32506 | 32793 | } |
| 32507 | 32794 | return rc; |
| 32508 | 32795 | } |
| 32509 | 32796 | |
| 32510 | 32797 | /* |
| | @@ -34860,10 +35147,16 @@ |
| 34860 | 35147 | } |
| 34861 | 35148 | case SQLITE_FCNTL_HAS_MOVED: { |
| 34862 | 35149 | *(int*)pArg = fileHasMoved(pFile); |
| 34863 | 35150 | return SQLITE_OK; |
| 34864 | 35151 | } |
| 35152 | +#ifdef SQLITE_ENABLE_SETLK_TIMEOUT |
| 35153 | + case SQLITE_FCNTL_LOCK_TIMEOUT: { |
| 35154 | + pFile->iBusyTimeout = *(int*)pArg; |
| 35155 | + return SQLITE_OK; |
| 35156 | + } |
| 35157 | +#endif |
| 34865 | 35158 | #if SQLITE_MAX_MMAP_SIZE>0 |
| 34866 | 35159 | case SQLITE_FCNTL_MMAP_SIZE: { |
| 34867 | 35160 | i64 newLimit = *(i64*)pArg; |
| 34868 | 35161 | int rc = SQLITE_OK; |
| 34869 | 35162 | if( newLimit>sqlite3GlobalConfig.mxMmap ){ |
| | @@ -35179,11 +35472,11 @@ |
| 35179 | 35472 | /* Initialize the locking parameters */ |
| 35180 | 35473 | f.l_type = lockType; |
| 35181 | 35474 | f.l_whence = SEEK_SET; |
| 35182 | 35475 | f.l_start = ofst; |
| 35183 | 35476 | f.l_len = n; |
| 35184 | | - rc = osFcntl(pShmNode->h, F_SETLK, &f); |
| 35477 | + rc = osSetPosixAdvisoryLock(pShmNode->h, &f, pFile); |
| 35185 | 35478 | rc = (rc!=(-1)) ? SQLITE_OK : SQLITE_BUSY; |
| 35186 | 35479 | } |
| 35187 | 35480 | |
| 35188 | 35481 | /* Update the global lock state and do debug tracing */ |
| 35189 | 35482 | #ifdef SQLITE_DEBUG |
| | @@ -45039,11 +45332,11 @@ |
| 45039 | 45332 | ** May you find forgiveness for yourself and forgive others. |
| 45040 | 45333 | ** May you share freely, never taking more than you give. |
| 45041 | 45334 | ** |
| 45042 | 45335 | ****************************************************************************** |
| 45043 | 45336 | ** |
| 45044 | | -** This file implements in-memory VFS. A database is held as a contiguous |
| 45337 | +** This file implements an in-memory VFS. A database is held as a contiguous |
| 45045 | 45338 | ** block of memory. |
| 45046 | 45339 | ** |
| 45047 | 45340 | ** This file also implements interface sqlite3_serialize() and |
| 45048 | 45341 | ** sqlite3_deserialize(). |
| 45049 | 45342 | */ |
| | @@ -50953,11 +51246,11 @@ |
| 50953 | 51246 | ** required size. */ |
| 50954 | 51247 | assert( pPager->eLock==EXCLUSIVE_LOCK ); |
| 50955 | 51248 | rc = pager_truncate(pPager, pPager->dbSize); |
| 50956 | 51249 | } |
| 50957 | 51250 | |
| 50958 | | - if( rc==SQLITE_OK && bCommit && isOpen(pPager->fd) ){ |
| 51251 | + if( rc==SQLITE_OK && bCommit ){ |
| 50959 | 51252 | rc = sqlite3OsFileControl(pPager->fd, SQLITE_FCNTL_COMMIT_PHASETWO, 0); |
| 50960 | 51253 | if( rc==SQLITE_NOTFOUND ) rc = SQLITE_OK; |
| 50961 | 51254 | } |
| 50962 | 51255 | |
| 50963 | 51256 | if( !pPager->exclusiveMode |
| | @@ -51772,13 +52065,11 @@ |
| 51772 | 52065 | ** state prior to the start of the transaction, so invoke the |
| 51773 | 52066 | ** SQLITE_FCNTL_DB_UNCHANGED file-control method to disable the |
| 51774 | 52067 | ** assertion that the transaction counter was modified. |
| 51775 | 52068 | */ |
| 51776 | 52069 | #ifdef SQLITE_DEBUG |
| 51777 | | - if( pPager->fd->pMethods ){ |
| 51778 | | - sqlite3OsFileControlHint(pPager->fd,SQLITE_FCNTL_DB_UNCHANGED,0); |
| 51779 | | - } |
| 52070 | + sqlite3OsFileControlHint(pPager->fd,SQLITE_FCNTL_DB_UNCHANGED,0); |
| 51780 | 52071 | #endif |
| 51781 | 52072 | |
| 51782 | 52073 | /* If this playback is happening automatically as a result of an IO or |
| 51783 | 52074 | ** malloc error that occurred after the change-counter was updated but |
| 51784 | 52075 | ** before the transaction was committed, then the change-counter |
| | @@ -52527,24 +52818,22 @@ |
| 52527 | 52818 | ** |
| 52528 | 52819 | ** If the busy-handler callback returns non-zero, the lock is |
| 52529 | 52820 | ** retried. If it returns zero, then the SQLITE_BUSY error is |
| 52530 | 52821 | ** returned to the caller of the pager API function. |
| 52531 | 52822 | */ |
| 52532 | | -SQLITE_PRIVATE void sqlite3PagerSetBusyhandler( |
| 52823 | +SQLITE_PRIVATE void sqlite3PagerSetBusyHandler( |
| 52533 | 52824 | Pager *pPager, /* Pager object */ |
| 52534 | 52825 | int (*xBusyHandler)(void *), /* Pointer to busy-handler function */ |
| 52535 | 52826 | void *pBusyHandlerArg /* Argument to pass to xBusyHandler */ |
| 52536 | 52827 | ){ |
| 52828 | + void **ap; |
| 52537 | 52829 | pPager->xBusyHandler = xBusyHandler; |
| 52538 | 52830 | pPager->pBusyHandlerArg = pBusyHandlerArg; |
| 52539 | | - |
| 52540 | | - if( isOpen(pPager->fd) ){ |
| 52541 | | - void **ap = (void **)&pPager->xBusyHandler; |
| 52542 | | - assert( ((int(*)(void *))(ap[0]))==xBusyHandler ); |
| 52543 | | - assert( ap[1]==pBusyHandlerArg ); |
| 52544 | | - sqlite3OsFileControlHint(pPager->fd, SQLITE_FCNTL_BUSYHANDLER, (void *)ap); |
| 52545 | | - } |
| 52831 | + ap = (void **)&pPager->xBusyHandler; |
| 52832 | + assert( ((int(*)(void *))(ap[0]))==xBusyHandler ); |
| 52833 | + assert( ap[1]==pBusyHandlerArg ); |
| 52834 | + sqlite3OsFileControlHint(pPager->fd, SQLITE_FCNTL_BUSYHANDLER, (void *)ap); |
| 52546 | 52835 | } |
| 52547 | 52836 | |
| 52548 | 52837 | /* |
| 52549 | 52838 | ** Change the page size used by the Pager object. The new page size |
| 52550 | 52839 | ** is passed in *pPageSize. |
| | @@ -54516,10 +54805,11 @@ |
| 54516 | 54805 | Pager *pPager; |
| 54517 | 54806 | assert( pPg!=0 ); |
| 54518 | 54807 | assert( pPg->pgno==1 ); |
| 54519 | 54808 | assert( (pPg->flags & PGHDR_MMAP)==0 ); /* Page1 is never memory mapped */ |
| 54520 | 54809 | pPager = pPg->pPager; |
| 54810 | + sqlite3PagerResetLockTimeout(pPager); |
| 54521 | 54811 | sqlite3PcacheRelease(pPg); |
| 54522 | 54812 | pagerUnlockIfUnused(pPager); |
| 54523 | 54813 | } |
| 54524 | 54814 | |
| 54525 | 54815 | /* |
| | @@ -55111,16 +55401,13 @@ |
| 55111 | 55401 | ** If successful, or if called on a pager for which it is a no-op, this |
| 55112 | 55402 | ** function returns SQLITE_OK. Otherwise, an IO error code is returned. |
| 55113 | 55403 | */ |
| 55114 | 55404 | SQLITE_PRIVATE int sqlite3PagerSync(Pager *pPager, const char *zMaster){ |
| 55115 | 55405 | int rc = SQLITE_OK; |
| 55116 | | - |
| 55117 | | - if( isOpen(pPager->fd) ){ |
| 55118 | | - void *pArg = (void*)zMaster; |
| 55119 | | - rc = sqlite3OsFileControl(pPager->fd, SQLITE_FCNTL_SYNC, pArg); |
| 55120 | | - if( rc==SQLITE_NOTFOUND ) rc = SQLITE_OK; |
| 55121 | | - } |
| 55406 | + void *pArg = (void*)zMaster; |
| 55407 | + rc = sqlite3OsFileControl(pPager->fd, SQLITE_FCNTL_SYNC, pArg); |
| 55408 | + if( rc==SQLITE_NOTFOUND ) rc = SQLITE_OK; |
| 55122 | 55409 | if( rc==SQLITE_OK && !pPager->noSync ){ |
| 55123 | 55410 | assert( !MEMDB ); |
| 55124 | 55411 | rc = sqlite3OsSync(pPager->fd, pPager->syncFlags); |
| 55125 | 55412 | } |
| 55126 | 55413 | return rc; |
| | @@ -55793,10 +56080,20 @@ |
| 55793 | 56080 | */ |
| 55794 | 56081 | SQLITE_PRIVATE sqlite3_file *sqlite3PagerFile(Pager *pPager){ |
| 55795 | 56082 | return pPager->fd; |
| 55796 | 56083 | } |
| 55797 | 56084 | |
| 56085 | +#ifdef SQLITE_ENABLE_SETLK_TIMEOUT |
| 56086 | +/* |
| 56087 | +** Reset the lock timeout for pager. |
| 56088 | +*/ |
| 56089 | +SQLITE_PRIVATE void sqlite3PagerResetLockTimeout(Pager *pPager){ |
| 56090 | + int x = 0; |
| 56091 | + sqlite3OsFileControl(pPager->fd, SQLITE_FCNTL_LOCK_TIMEOUT, &x); |
| 56092 | +} |
| 56093 | +#endif |
| 56094 | + |
| 55798 | 56095 | /* |
| 55799 | 56096 | ** Return the file handle for the journal file (if it exists). |
| 55800 | 56097 | ** This will be either the rollback journal or the WAL file. |
| 55801 | 56098 | */ |
| 55802 | 56099 | SQLITE_PRIVATE sqlite3_file *sqlite3PagerJrnlFile(Pager *pPager){ |
| | @@ -56253,10 +56550,11 @@ |
| 56253 | 56550 | (eMode==SQLITE_CHECKPOINT_PASSIVE ? 0 : pPager->xBusyHandler), |
| 56254 | 56551 | pPager->pBusyHandlerArg, |
| 56255 | 56552 | pPager->walSyncFlags, pPager->pageSize, (u8 *)pPager->pTmpSpace, |
| 56256 | 56553 | pnLog, pnCkpt |
| 56257 | 56554 | ); |
| 56555 | + sqlite3PagerResetLockTimeout(pPager); |
| 56258 | 56556 | } |
| 56259 | 56557 | return rc; |
| 56260 | 56558 | } |
| 56261 | 56559 | |
| 56262 | 56560 | SQLITE_PRIVATE int sqlite3PagerWalCallback(Pager *pPager){ |
| | @@ -63529,11 +63827,12 @@ |
| 63529 | 63827 | */ |
| 63530 | 63828 | static int btreeInvokeBusyHandler(void *pArg){ |
| 63531 | 63829 | BtShared *pBt = (BtShared*)pArg; |
| 63532 | 63830 | assert( pBt->db ); |
| 63533 | 63831 | assert( sqlite3_mutex_held(pBt->db->mutex) ); |
| 63534 | | - return sqlite3InvokeBusyHandler(&pBt->db->busyHandler); |
| 63832 | + return sqlite3InvokeBusyHandler(&pBt->db->busyHandler, |
| 63833 | + sqlite3PagerFile(pBt->pPager)); |
| 63535 | 63834 | } |
| 63536 | 63835 | |
| 63537 | 63836 | /* |
| 63538 | 63837 | ** Open a database file. |
| 63539 | 63838 | ** |
| | @@ -63707,11 +64006,11 @@ |
| 63707 | 64006 | if( rc!=SQLITE_OK ){ |
| 63708 | 64007 | goto btree_open_out; |
| 63709 | 64008 | } |
| 63710 | 64009 | pBt->openFlags = (u8)flags; |
| 63711 | 64010 | pBt->db = db; |
| 63712 | | - sqlite3PagerSetBusyhandler(pBt->pPager, btreeInvokeBusyHandler, pBt); |
| 64011 | + sqlite3PagerSetBusyHandler(pBt->pPager, btreeInvokeBusyHandler, pBt); |
| 63713 | 64012 | p->pBt = pBt; |
| 63714 | 64013 | |
| 63715 | 64014 | pBt->pCursor = 0; |
| 63716 | 64015 | pBt->pPage1 = 0; |
| 63717 | 64016 | if( sqlite3PagerIsreadonly(pBt->pPager) ) pBt->btsFlags |= BTS_READ_ONLY; |
| | @@ -64670,10 +64969,11 @@ |
| 64670 | 64969 | if( rc!=SQLITE_OK ){ |
| 64671 | 64970 | unlockBtreeIfUnused(pBt); |
| 64672 | 64971 | } |
| 64673 | 64972 | }while( (rc&0xFF)==SQLITE_BUSY && pBt->inTransaction==TRANS_NONE && |
| 64674 | 64973 | btreeInvokeBusyHandler(pBt) ); |
| 64974 | + sqlite3PagerResetLockTimeout(pBt->pPager); |
| 64675 | 64975 | |
| 64676 | 64976 | if( rc==SQLITE_OK ){ |
| 64677 | 64977 | if( p->inTrans==TRANS_NONE ){ |
| 64678 | 64978 | pBt->nTransaction++; |
| 64679 | 64979 | #ifndef SQLITE_OMIT_SHARED_CACHE |
| | @@ -98715,25 +99015,65 @@ |
| 98715 | 99015 | ** This is the Expr node callback for sqlite3ExprImpliesNotNullRow(). |
| 98716 | 99016 | ** If the expression node requires that the table at pWalker->iCur |
| 98717 | 99017 | ** have a non-NULL column, then set pWalker->eCode to 1 and abort. |
| 98718 | 99018 | */ |
| 98719 | 99019 | static int impliesNotNullRow(Walker *pWalker, Expr *pExpr){ |
| 99020 | + /* This routine is only called for WHERE clause expressions and so it |
| 99021 | + ** cannot have any TK_AGG_COLUMN entries because those are only found |
| 99022 | + ** in HAVING clauses. We can get a TK_AGG_FUNCTION in a WHERE clause, |
| 99023 | + ** but that is an illegal construct and the query will be rejected at |
| 99024 | + ** a later stage of processing, so the TK_AGG_FUNCTION case does not |
| 99025 | + ** need to be considered here. */ |
| 99026 | + assert( pExpr->op!=TK_AGG_COLUMN ); |
| 99027 | + testcase( pExpr->op==TK_AGG_FUNCTION ); |
| 99028 | + |
| 98720 | 99029 | if( ExprHasProperty(pExpr, EP_FromJoin) ) return WRC_Prune; |
| 98721 | 99030 | switch( pExpr->op ){ |
| 99031 | + case TK_ISNOT: |
| 99032 | + case TK_NOT: |
| 98722 | 99033 | case TK_ISNULL: |
| 98723 | 99034 | case TK_IS: |
| 98724 | 99035 | case TK_OR: |
| 99036 | + case TK_CASE: |
| 99037 | + case TK_IN: |
| 98725 | 99038 | case TK_FUNCTION: |
| 98726 | | - case TK_AGG_FUNCTION: |
| 99039 | + testcase( pExpr->op==TK_ISNOT ); |
| 99040 | + testcase( pExpr->op==TK_NOT ); |
| 99041 | + testcase( pExpr->op==TK_ISNULL ); |
| 99042 | + testcase( pExpr->op==TK_IS ); |
| 99043 | + testcase( pExpr->op==TK_OR ); |
| 99044 | + testcase( pExpr->op==TK_CASE ); |
| 99045 | + testcase( pExpr->op==TK_IN ); |
| 99046 | + testcase( pExpr->op==TK_FUNCTION ); |
| 98727 | 99047 | return WRC_Prune; |
| 98728 | 99048 | case TK_COLUMN: |
| 98729 | | - case TK_AGG_COLUMN: |
| 98730 | 99049 | if( pWalker->u.iCur==pExpr->iTable ){ |
| 98731 | 99050 | pWalker->eCode = 1; |
| 98732 | 99051 | return WRC_Abort; |
| 98733 | 99052 | } |
| 98734 | 99053 | return WRC_Prune; |
| 99054 | + |
| 99055 | + /* Virtual tables are allowed to use constraints like x=NULL. So |
| 99056 | + ** a term of the form x=y does not prove that y is not null if x |
| 99057 | + ** is the column of a virtual table */ |
| 99058 | + case TK_EQ: |
| 99059 | + case TK_NE: |
| 99060 | + case TK_LT: |
| 99061 | + case TK_LE: |
| 99062 | + case TK_GT: |
| 99063 | + case TK_GE: |
| 99064 | + testcase( pExpr->op==TK_EQ ); |
| 99065 | + testcase( pExpr->op==TK_NE ); |
| 99066 | + testcase( pExpr->op==TK_LT ); |
| 99067 | + testcase( pExpr->op==TK_LE ); |
| 99068 | + testcase( pExpr->op==TK_GT ); |
| 99069 | + testcase( pExpr->op==TK_GE ); |
| 99070 | + if( (pExpr->pLeft->op==TK_COLUMN && IsVirtual(pExpr->pLeft->pTab)) |
| 99071 | + || (pExpr->pRight->op==TK_COLUMN && IsVirtual(pExpr->pRight->pTab)) |
| 99072 | + ){ |
| 99073 | + return WRC_Prune; |
| 99074 | + } |
| 98735 | 99075 | default: |
| 98736 | 99076 | return WRC_Continue; |
| 98737 | 99077 | } |
| 98738 | 99078 | } |
| 98739 | 99079 | |
| | @@ -98740,10 +99080,17 @@ |
| 98740 | 99080 | /* |
| 98741 | 99081 | ** Return true (non-zero) if expression p can only be true if at least |
| 98742 | 99082 | ** one column of table iTab is non-null. In other words, return true |
| 98743 | 99083 | ** if expression p will always be NULL or false if every column of iTab |
| 98744 | 99084 | ** is NULL. |
| 99085 | +** |
| 99086 | +** False negatives are acceptable. In other words, it is ok to return |
| 99087 | +** zero even if expression p will never be true of every column of iTab |
| 99088 | +** is NULL. A false negative is merely a missed optimization opportunity. |
| 99089 | +** |
| 99090 | +** False positives are not allowed, however. A false positive may result |
| 99091 | +** in an incorrect answer. |
| 98745 | 99092 | ** |
| 98746 | 99093 | ** Terms of p that are marked with EP_FromJoin (and hence that come from |
| 98747 | 99094 | ** the ON or USING clauses of LEFT JOINS) are excluded from the analysis. |
| 98748 | 99095 | ** |
| 98749 | 99096 | ** This routine is used to check if a LEFT JOIN can be converted into |
| | @@ -101005,11 +101352,11 @@ |
| 101005 | 101352 | } |
| 101006 | 101353 | if( pTab->tnum==0 ){ |
| 101007 | 101354 | /* Do not gather statistics on views or virtual tables */ |
| 101008 | 101355 | return; |
| 101009 | 101356 | } |
| 101010 | | - if( sqlite3_strlike("sqlite_%", pTab->zName, 0)==0 ){ |
| 101357 | + if( sqlite3_strlike("sqlite\\_%", pTab->zName, '\\')==0 ){ |
| 101011 | 101358 | /* Do not gather statistics on system tables */ |
| 101012 | 101359 | return; |
| 101013 | 101360 | } |
| 101014 | 101361 | assert( sqlite3BtreeHoldsAllMutexes(db) ); |
| 101015 | 101362 | iDb = sqlite3SchemaToIndex(db, pTab->pSchema); |
| | @@ -104066,11 +104413,11 @@ |
| 104066 | 104413 | if( !sqlite3ExprIsConstantOrFunction(pExpr, db->init.busy) ){ |
| 104067 | 104414 | sqlite3ErrorMsg(pParse, "default value of column [%s] is not constant", |
| 104068 | 104415 | pCol->zName); |
| 104069 | 104416 | }else{ |
| 104070 | 104417 | /* A copy of pExpr is used instead of the original, as pExpr contains |
| 104071 | | - ** tokens that point to volatile memory. |
| 104418 | + ** tokens that point to volatile memory. |
| 104072 | 104419 | */ |
| 104073 | 104420 | Expr x; |
| 104074 | 104421 | sqlite3ExprDelete(db, pCol->pDflt); |
| 104075 | 104422 | memset(&x, 0, sizeof(x)); |
| 104076 | 104423 | x.op = TK_SPAN; |
| | @@ -104310,11 +104657,11 @@ |
| 104310 | 104657 | SQLITE_PRIVATE void sqlite3ChangeCookie(Parse *pParse, int iDb){ |
| 104311 | 104658 | sqlite3 *db = pParse->db; |
| 104312 | 104659 | Vdbe *v = pParse->pVdbe; |
| 104313 | 104660 | assert( sqlite3SchemaMutexHeld(db, iDb, 0) ); |
| 104314 | 104661 | sqlite3VdbeAddOp3(v, OP_SetCookie, iDb, BTREE_SCHEMA_VERSION, |
| 104315 | | - db->aDb[iDb].pSchema->schema_cookie+1); |
| 104662 | + (int)(1+(unsigned)db->aDb[iDb].pSchema->schema_cookie)); |
| 104316 | 104663 | } |
| 104317 | 104664 | |
| 104318 | 104665 | /* |
| 104319 | 104666 | ** Measure the number of characters needed to output the given |
| 104320 | 104667 | ** identifier. The number returned includes any quotes used |
| | @@ -104988,11 +105335,11 @@ |
| 104988 | 105335 | Table *pSelTab; /* A fake table from which we get the result set */ |
| 104989 | 105336 | Select *pSel; /* Copy of the SELECT that implements the view */ |
| 104990 | 105337 | int nErr = 0; /* Number of errors encountered */ |
| 104991 | 105338 | int n; /* Temporarily holds the number of cursors assigned */ |
| 104992 | 105339 | sqlite3 *db = pParse->db; /* Database connection for malloc errors */ |
| 104993 | | -#ifndef SQLITE_OMIT_VIRTUALTABLE |
| 105340 | +#ifndef SQLITE_OMIT_VIRTUALTABLE |
| 104994 | 105341 | int rc; |
| 104995 | 105342 | #endif |
| 104996 | 105343 | #ifndef SQLITE_OMIT_AUTHORIZATION |
| 104997 | 105344 | sqlite3_xauth xAuth; /* Saved xAuth pointer */ |
| 104998 | 105345 | #endif |
| | @@ -123694,11 +124041,10 @@ |
| 123694 | 124041 | ExprList *pOrderBy = pSub->pOrderBy; |
| 123695 | 124042 | for(i=0; i<pOrderBy->nExpr; i++){ |
| 123696 | 124043 | pOrderBy->a[i].u.x.iOrderByCol = 0; |
| 123697 | 124044 | } |
| 123698 | 124045 | assert( pParent->pOrderBy==0 ); |
| 123699 | | - assert( pSub->pPrior==0 ); |
| 123700 | 124046 | pParent->pOrderBy = pOrderBy; |
| 123701 | 124047 | pSub->pOrderBy = 0; |
| 123702 | 124048 | } |
| 123703 | 124049 | pWhere = sqlite3ExprDup(db, pSub->pWhere, 0); |
| 123704 | 124050 | if( isLeftJoin>0 ){ |
| | @@ -123778,12 +124124,13 @@ |
| 123778 | 124124 | ** (2) The inner query is the recursive part of a common table expression. |
| 123779 | 124125 | ** |
| 123780 | 124126 | ** (3) The inner query has a LIMIT clause (since the changes to the WHERE |
| 123781 | 124127 | ** close would change the meaning of the LIMIT). |
| 123782 | 124128 | ** |
| 123783 | | -** (4) (** This restriction was removed on 2018-03-21. It used to read: |
| 123784 | | -** The inner query is the right operand of a LEFT JOIN. **) |
| 124129 | +** (4) The inner query is the right operand of a LEFT JOIN and the |
| 124130 | +** expression to be pushed down does not come from the ON clause |
| 124131 | +** on that LEFT JOIN. |
| 123785 | 124132 | ** |
| 123786 | 124133 | ** (5) The WHERE clause expression originates in the ON or USING clause |
| 123787 | 124134 | ** of a LEFT JOIN where iCursor is not the right-hand table of that |
| 123788 | 124135 | ** left join. An example: |
| 123789 | 124136 | ** |
| | @@ -123801,11 +124148,12 @@ |
| 123801 | 124148 | */ |
| 123802 | 124149 | static int pushDownWhereTerms( |
| 123803 | 124150 | Parse *pParse, /* Parse context (for malloc() and error reporting) */ |
| 123804 | 124151 | Select *pSubq, /* The subquery whose WHERE clause is to be augmented */ |
| 123805 | 124152 | Expr *pWhere, /* The WHERE clause of the outer query */ |
| 123806 | | - int iCursor /* Cursor number of the subquery */ |
| 124153 | + int iCursor, /* Cursor number of the subquery */ |
| 124154 | + int isLeftJoin /* True if pSubq is the right term of a LEFT JOIN */ |
| 123807 | 124155 | ){ |
| 123808 | 124156 | Expr *pNew; |
| 123809 | 124157 | int nChng = 0; |
| 123810 | 124158 | if( pWhere==0 ) return 0; |
| 123811 | 124159 | if( pSubq->selFlags & SF_Recursive ) return 0; /* restriction (2) */ |
| | @@ -123825,13 +124173,20 @@ |
| 123825 | 124173 | |
| 123826 | 124174 | if( pSubq->pLimit!=0 ){ |
| 123827 | 124175 | return 0; /* restriction (3) */ |
| 123828 | 124176 | } |
| 123829 | 124177 | while( pWhere->op==TK_AND ){ |
| 123830 | | - nChng += pushDownWhereTerms(pParse, pSubq, pWhere->pRight, iCursor); |
| 124178 | + nChng += pushDownWhereTerms(pParse, pSubq, pWhere->pRight, |
| 124179 | + iCursor, isLeftJoin); |
| 123831 | 124180 | pWhere = pWhere->pLeft; |
| 123832 | 124181 | } |
| 124182 | + if( isLeftJoin |
| 124183 | + && (ExprHasProperty(pWhere,EP_FromJoin)==0 |
| 124184 | + || pWhere->iRightJoinTable!=iCursor) |
| 124185 | + ){ |
| 124186 | + return 0; /* restriction (4) */ |
| 124187 | + } |
| 123833 | 124188 | if( ExprHasProperty(pWhere,EP_FromJoin) && pWhere->iRightJoinTable!=iCursor ){ |
| 123834 | 124189 | return 0; /* restriction (5) */ |
| 123835 | 124190 | } |
| 123836 | 124191 | if( sqlite3ExprIsTableConstant(pWhere, iCursor) ){ |
| 123837 | 124192 | nChng++; |
| | @@ -124291,13 +124646,11 @@ |
| 124291 | 124646 | if( (selFlags & SF_Expanded)!=0 ){ |
| 124292 | 124647 | return WRC_Prune; |
| 124293 | 124648 | } |
| 124294 | 124649 | pTabList = p->pSrc; |
| 124295 | 124650 | pEList = p->pEList; |
| 124296 | | - if( OK_IF_ALWAYS_TRUE(p->pWith) ){ |
| 124297 | | - sqlite3WithPush(pParse, p->pWith, 0); |
| 124298 | | - } |
| 124651 | + sqlite3WithPush(pParse, p->pWith, 0); |
| 124299 | 124652 | |
| 124300 | 124653 | /* Make sure cursor numbers have been assigned to all entries in |
| 124301 | 124654 | ** the FROM clause of the SELECT statement. |
| 124302 | 124655 | */ |
| 124303 | 124656 | sqlite3SrcListAssignCursors(pParse, pTabList); |
| | @@ -125295,11 +125648,12 @@ |
| 125295 | 125648 | |
| 125296 | 125649 | /* Make copies of constant WHERE-clause terms in the outer query down |
| 125297 | 125650 | ** inside the subquery. This can help the subquery to run more efficiently. |
| 125298 | 125651 | */ |
| 125299 | 125652 | if( OptimizationEnabled(db, SQLITE_PushDown) |
| 125300 | | - && pushDownWhereTerms(pParse, pSub, p->pWhere, pItem->iCursor) |
| 125653 | + && pushDownWhereTerms(pParse, pSub, p->pWhere, pItem->iCursor, |
| 125654 | + (pItem->fg.jointype & JT_OUTER)!=0) |
| 125301 | 125655 | ){ |
| 125302 | 125656 | #if SELECTTRACE_ENABLED |
| 125303 | 125657 | if( sqlite3SelectTrace & 0x100 ){ |
| 125304 | 125658 | SELECTTRACE(0x100,pParse,p,("After WHERE-clause push-down:\n")); |
| 125305 | 125659 | sqlite3TreeViewSelect(0, p, 0); |
| | @@ -127755,11 +128109,11 @@ |
| 127755 | 128109 | iPk = pParse->nMem+1; |
| 127756 | 128110 | pParse->nMem += nPk; |
| 127757 | 128111 | regKey = ++pParse->nMem; |
| 127758 | 128112 | iEph = pParse->nTab++; |
| 127759 | 128113 | |
| 127760 | | - sqlite3VdbeAddOp2(v, OP_Null, 0, iPk); |
| 128114 | + sqlite3VdbeAddOp3(v, OP_Null, 0, iPk, iPk+nPk-1); |
| 127761 | 128115 | addrOpen = sqlite3VdbeAddOp2(v, OP_OpenEphemeral, iEph, nPk); |
| 127762 | 128116 | sqlite3VdbeSetP4KeyInfo(pParse, pPk); |
| 127763 | 128117 | } |
| 127764 | 128118 | |
| 127765 | 128119 | /* Begin the database scan. |
| | @@ -129927,11 +130281,11 @@ |
| 129927 | 130281 | |
| 129928 | 130282 | /* |
| 129929 | 130283 | ** Trace output macros |
| 129930 | 130284 | */ |
| 129931 | 130285 | #if defined(SQLITE_TEST) || defined(SQLITE_DEBUG) |
| 129932 | | -/***/ int sqlite3WhereTrace; |
| 130286 | +/***/ extern int sqlite3WhereTrace; |
| 129933 | 130287 | #endif |
| 129934 | 130288 | #if defined(SQLITE_DEBUG) \ |
| 129935 | 130289 | && (defined(SQLITE_TEST) || defined(SQLITE_ENABLE_WHERETRACE)) |
| 129936 | 130290 | # define WHERETRACE(K,X) if(sqlite3WhereTrace&(K)) sqlite3DebugPrintf X |
| 129937 | 130291 | # define WHERETRACE_ENABLED 1 |
| | @@ -132576,22 +132930,23 @@ |
| 132576 | 132930 | if( iLoop<3 && (pTerm->wtFlags & TERM_VARSELECT) ){ |
| 132577 | 132931 | if( iNext==0 ) iNext = 3; |
| 132578 | 132932 | continue; |
| 132579 | 132933 | } |
| 132580 | 132934 | |
| 132581 | | - if( pTerm->wtFlags & TERM_LIKECOND ){ |
| 132935 | + if( (pTerm->wtFlags & TERM_LIKECOND)!=0 ){ |
| 132582 | 132936 | /* If the TERM_LIKECOND flag is set, that means that the range search |
| 132583 | 132937 | ** is sufficient to guarantee that the LIKE operator is true, so we |
| 132584 | 132938 | ** can skip the call to the like(A,B) function. But this only works |
| 132585 | 132939 | ** for strings. So do not skip the call to the function on the pass |
| 132586 | 132940 | ** that compares BLOBs. */ |
| 132587 | 132941 | #ifdef SQLITE_LIKE_DOESNT_MATCH_BLOBS |
| 132588 | 132942 | continue; |
| 132589 | 132943 | #else |
| 132590 | 132944 | u32 x = pLevel->iLikeRepCntr; |
| 132591 | | - assert( x>0 ); |
| 132592 | | - skipLikeAddr = sqlite3VdbeAddOp1(v, (x&1)?OP_IfNot:OP_If, (int)(x>>1)); |
| 132945 | + if( x>0 ){ |
| 132946 | + skipLikeAddr = sqlite3VdbeAddOp1(v, (x&1)?OP_IfNot:OP_If,(int)(x>>1)); |
| 132947 | + } |
| 132593 | 132948 | VdbeCoverage(v); |
| 132594 | 132949 | #endif |
| 132595 | 132950 | } |
| 132596 | 132951 | #ifdef WHERETRACE_ENABLED /* 0xffff */ |
| 132597 | 132952 | if( sqlite3WhereTrace ){ |
| | @@ -136579,12 +136934,12 @@ |
| 136579 | 136934 | LogEst rLogSize; /* Logarithm of table size */ |
| 136580 | 136935 | WhereTerm *pTop = 0, *pBtm = 0; /* Top and bottom range constraints */ |
| 136581 | 136936 | |
| 136582 | 136937 | pNew = pBuilder->pNew; |
| 136583 | 136938 | if( db->mallocFailed ) return SQLITE_NOMEM_BKPT; |
| 136584 | | - WHERETRACE(0x800, ("BEGIN addBtreeIdx(%s), nEq=%d\n", |
| 136585 | | - pProbe->zName, pNew->u.btree.nEq)); |
| 136939 | + WHERETRACE(0x800, ("BEGIN %s.addBtreeIdx(%s), nEq=%d\n", |
| 136940 | + pProbe->pTable->zName,pProbe->zName, pNew->u.btree.nEq)); |
| 136586 | 136941 | |
| 136587 | 136942 | assert( (pNew->wsFlags & WHERE_VIRTUALTABLE)==0 ); |
| 136588 | 136943 | assert( (pNew->wsFlags & WHERE_TOP_LIMIT)==0 ); |
| 136589 | 136944 | if( pNew->wsFlags & WHERE_BTM_LIMIT ){ |
| 136590 | 136945 | opMask = WO_LT|WO_LE; |
| | @@ -136866,12 +137221,12 @@ |
| 136866 | 137221 | pNew->u.btree.nEq = saved_nEq; |
| 136867 | 137222 | pNew->nSkip = saved_nSkip; |
| 136868 | 137223 | pNew->wsFlags = saved_wsFlags; |
| 136869 | 137224 | } |
| 136870 | 137225 | |
| 136871 | | - WHERETRACE(0x800, ("END addBtreeIdx(%s), nEq=%d, rc=%d\n", |
| 136872 | | - pProbe->zName, saved_nEq, rc)); |
| 137226 | + WHERETRACE(0x800, ("END %s.addBtreeIdx(%s), nEq=%d, rc=%d\n", |
| 137227 | + pProbe->pTable->zName, pProbe->zName, saved_nEq, rc)); |
| 136873 | 137228 | return rc; |
| 136874 | 137229 | } |
| 136875 | 137230 | |
| 136876 | 137231 | /* |
| 136877 | 137232 | ** Return True if it is possible that pIndex might be useful in |
| | @@ -137305,13 +137660,13 @@ |
| 137305 | 137660 | || j<0 |
| 137306 | 137661 | || j>=pWC->nTerm |
| 137307 | 137662 | || pNew->aLTerm[iTerm]!=0 |
| 137308 | 137663 | || pIdxCons->usable==0 |
| 137309 | 137664 | ){ |
| 137310 | | - rc = SQLITE_ERROR; |
| 137311 | 137665 | sqlite3ErrorMsg(pParse,"%s.xBestIndex malfunction",pSrc->pTab->zName); |
| 137312 | | - return rc; |
| 137666 | + testcase( pIdxInfo->needToFreeIdxStr ); |
| 137667 | + return SQLITE_ERROR; |
| 137313 | 137668 | } |
| 137314 | 137669 | testcase( iTerm==nConstraint-1 ); |
| 137315 | 137670 | testcase( j==0 ); |
| 137316 | 137671 | testcase( j==pWC->nTerm-1 ); |
| 137317 | 137672 | pTerm = &pWC->a[j]; |
| | @@ -137335,10 +137690,19 @@ |
| 137335 | 137690 | } |
| 137336 | 137691 | } |
| 137337 | 137692 | pNew->u.vtab.omitMask &= ~mNoOmit; |
| 137338 | 137693 | |
| 137339 | 137694 | pNew->nLTerm = mxTerm+1; |
| 137695 | + for(i=0; i<=mxTerm; i++){ |
| 137696 | + if( pNew->aLTerm[i]==0 ){ |
| 137697 | + /* The non-zero argvIdx values must be contiguous. Raise an |
| 137698 | + ** error if they are not */ |
| 137699 | + sqlite3ErrorMsg(pParse,"%s.xBestIndex malfunction",pSrc->pTab->zName); |
| 137700 | + testcase( pIdxInfo->needToFreeIdxStr ); |
| 137701 | + return SQLITE_ERROR; |
| 137702 | + } |
| 137703 | + } |
| 137340 | 137704 | assert( pNew->nLTerm<=pNew->nLSlot ); |
| 137341 | 137705 | pNew->u.vtab.idxNum = pIdxInfo->idxNum; |
| 137342 | 137706 | pNew->u.vtab.needFree = pIdxInfo->needToFreeIdxStr; |
| 137343 | 137707 | pIdxInfo->needToFreeIdxStr = 0; |
| 137344 | 137708 | pNew->u.vtab.idxStr = pIdxInfo->idxStr; |
| | @@ -137450,10 +137814,11 @@ |
| 137450 | 137814 | sqlite3DbFree(pParse->db, p); |
| 137451 | 137815 | return SQLITE_NOMEM_BKPT; |
| 137452 | 137816 | } |
| 137453 | 137817 | |
| 137454 | 137818 | /* First call xBestIndex() with all constraints usable. */ |
| 137819 | + WHERETRACE(0x800, ("BEGIN %s.addVirtual()\n", pSrc->pTab->zName)); |
| 137455 | 137820 | WHERETRACE(0x40, (" VirtualOne: all usable\n")); |
| 137456 | 137821 | rc = whereLoopAddVirtualOne(pBuilder, mPrereq, ALLBITS, 0, p, mNoOmit, &bIn); |
| 137457 | 137822 | |
| 137458 | 137823 | /* If the call to xBestIndex() with all terms enabled produced a plan |
| 137459 | 137824 | ** that does not require any source tables (IOW: a plan with mBest==0), |
| | @@ -137525,10 +137890,11 @@ |
| 137525 | 137890 | } |
| 137526 | 137891 | } |
| 137527 | 137892 | |
| 137528 | 137893 | if( p->needToFreeIdxStr ) sqlite3_free(p->idxStr); |
| 137529 | 137894 | sqlite3DbFreeNN(pParse->db, p); |
| 137895 | + WHERETRACE(0x800, ("END %s.addVirtual(), rc=%d\n", pSrc->pTab->zName, rc)); |
| 137530 | 137896 | return rc; |
| 137531 | 137897 | } |
| 137532 | 137898 | #endif /* SQLITE_OMIT_VIRTUALTABLE */ |
| 137533 | 137899 | |
| 137534 | 137900 | /* |
| | @@ -139665,21 +140031,21 @@ |
| 139665 | 140031 | #define sqlite3ParserARG_SDECL Parse *pParse; |
| 139666 | 140032 | #define sqlite3ParserARG_PDECL ,Parse *pParse |
| 139667 | 140033 | #define sqlite3ParserARG_FETCH Parse *pParse = yypParser->pParse |
| 139668 | 140034 | #define sqlite3ParserARG_STORE yypParser->pParse = pParse |
| 139669 | 140035 | #define YYFALLBACK 1 |
| 139670 | | -#define YYNSTATE 466 |
| 139671 | | -#define YYNRULE 330 |
| 140036 | +#define YYNSTATE 472 |
| 140037 | +#define YYNRULE 333 |
| 139672 | 140038 | #define YYNTOKEN 143 |
| 139673 | | -#define YY_MAX_SHIFT 465 |
| 139674 | | -#define YY_MIN_SHIFTREDUCE 675 |
| 139675 | | -#define YY_MAX_SHIFTREDUCE 1004 |
| 139676 | | -#define YY_ERROR_ACTION 1005 |
| 139677 | | -#define YY_ACCEPT_ACTION 1006 |
| 139678 | | -#define YY_NO_ACTION 1007 |
| 139679 | | -#define YY_MIN_REDUCE 1008 |
| 139680 | | -#define YY_MAX_REDUCE 1337 |
| 140039 | +#define YY_MAX_SHIFT 471 |
| 140040 | +#define YY_MIN_SHIFTREDUCE 681 |
| 140041 | +#define YY_MAX_SHIFTREDUCE 1013 |
| 140042 | +#define YY_ERROR_ACTION 1014 |
| 140043 | +#define YY_ACCEPT_ACTION 1015 |
| 140044 | +#define YY_NO_ACTION 1016 |
| 140045 | +#define YY_MIN_REDUCE 1017 |
| 140046 | +#define YY_MAX_REDUCE 1349 |
| 139681 | 140047 | /************* End control #defines *******************************************/ |
| 139682 | 140048 | |
| 139683 | 140049 | /* Define the yytestcase() macro to be a no-op if is not already defined |
| 139684 | 140050 | ** otherwise. |
| 139685 | 140051 | ** |
| | @@ -139741,326 +140107,328 @@ |
| 139741 | 140107 | ** yy_reduce_ofst[] For each state, the offset into yy_action for |
| 139742 | 140108 | ** shifting non-terminals after a reduce. |
| 139743 | 140109 | ** yy_default[] Default action for each state. |
| 139744 | 140110 | ** |
| 139745 | 140111 | *********** Begin parsing tables **********************************************/ |
| 139746 | | -#define YY_ACTTAB_COUNT (1541) |
| 140112 | +#define YY_ACTTAB_COUNT (1566) |
| 139747 | 140113 | static const YYACTIONTYPE yy_action[] = { |
| 139748 | | - /* 0 */ 1006, 156, 156, 2, 1302, 90, 87, 179, 90, 87, |
| 139749 | | - /* 10 */ 179, 460, 1048, 460, 465, 1010, 460, 333, 1130, 335, |
| 139750 | | - /* 20 */ 246, 330, 112, 303, 439, 1258, 304, 419, 1129, 1087, |
| 139751 | | - /* 30 */ 72, 798, 50, 50, 50, 50, 331, 30, 30, 799, |
| 139752 | | - /* 40 */ 951, 364, 371, 97, 98, 88, 983, 983, 859, 862, |
| 139753 | | - /* 50 */ 851, 851, 95, 95, 96, 96, 96, 96, 120, 371, |
| 139754 | | - /* 60 */ 370, 120, 348, 22, 90, 87, 179, 438, 423, 438, |
| 139755 | | - /* 70 */ 440, 335, 420, 385, 90, 87, 179, 116, 73, 163, |
| 139756 | | - /* 80 */ 848, 848, 860, 863, 94, 94, 94, 94, 93, 93, |
| 139757 | | - /* 90 */ 92, 92, 92, 91, 361, 97, 98, 88, 983, 983, |
| 139758 | | - /* 100 */ 859, 862, 851, 851, 95, 95, 96, 96, 96, 96, |
| 139759 | | - /* 110 */ 718, 365, 339, 93, 93, 92, 92, 92, 91, 361, |
| 139760 | | - /* 120 */ 99, 371, 453, 335, 94, 94, 94, 94, 93, 93, |
| 139761 | | - /* 130 */ 92, 92, 92, 91, 361, 852, 94, 94, 94, 94, |
| 139762 | | - /* 140 */ 93, 93, 92, 92, 92, 91, 361, 97, 98, 88, |
| 139763 | | - /* 150 */ 983, 983, 859, 862, 851, 851, 95, 95, 96, 96, |
| 139764 | | - /* 160 */ 96, 96, 92, 92, 92, 91, 361, 838, 132, 195, |
| 139765 | | - /* 170 */ 58, 244, 412, 409, 408, 335, 457, 457, 457, 304, |
| 139766 | | - /* 180 */ 59, 332, 831, 407, 394, 962, 830, 391, 94, 94, |
| 139767 | | - /* 190 */ 94, 94, 93, 93, 92, 92, 92, 91, 361, 97, |
| 139768 | | - /* 200 */ 98, 88, 983, 983, 859, 862, 851, 851, 95, 95, |
| 139769 | | - /* 210 */ 96, 96, 96, 96, 426, 357, 460, 830, 830, 832, |
| 139770 | | - /* 220 */ 91, 361, 962, 963, 964, 195, 459, 335, 412, 409, |
| 139771 | | - /* 230 */ 408, 280, 361, 820, 132, 11, 11, 50, 50, 407, |
| 139772 | | - /* 240 */ 94, 94, 94, 94, 93, 93, 92, 92, 92, 91, |
| 139773 | | - /* 250 */ 361, 97, 98, 88, 983, 983, 859, 862, 851, 851, |
| 139774 | | - /* 260 */ 95, 95, 96, 96, 96, 96, 460, 221, 460, 264, |
| 139775 | | - /* 270 */ 375, 254, 438, 428, 1276, 1276, 383, 1074, 1053, 335, |
| 139776 | | - /* 280 */ 245, 422, 299, 713, 271, 271, 1074, 50, 50, 50, |
| 139777 | | - /* 290 */ 50, 962, 94, 94, 94, 94, 93, 93, 92, 92, |
| 139778 | | - /* 300 */ 92, 91, 361, 97, 98, 88, 983, 983, 859, 862, |
| 139779 | | - /* 310 */ 851, 851, 95, 95, 96, 96, 96, 96, 90, 87, |
| 139780 | | - /* 320 */ 179, 1306, 438, 437, 438, 418, 368, 253, 962, 963, |
| 139781 | | - /* 330 */ 964, 335, 360, 360, 360, 706, 359, 358, 324, 962, |
| 139782 | | - /* 340 */ 1281, 951, 364, 230, 94, 94, 94, 94, 93, 93, |
| 139783 | | - /* 350 */ 92, 92, 92, 91, 361, 97, 98, 88, 983, 983, |
| 139784 | | - /* 360 */ 859, 862, 851, 851, 95, 95, 96, 96, 96, 96, |
| 139785 | | - /* 370 */ 769, 460, 120, 226, 226, 366, 962, 963, 964, 1089, |
| 139786 | | - /* 380 */ 990, 900, 990, 335, 1057, 425, 421, 839, 759, 759, |
| 139787 | | - /* 390 */ 425, 427, 50, 50, 432, 381, 94, 94, 94, 94, |
| 139788 | | - /* 400 */ 93, 93, 92, 92, 92, 91, 361, 97, 98, 88, |
| 139789 | | - /* 410 */ 983, 983, 859, 862, 851, 851, 95, 95, 96, 96, |
| 139790 | | - /* 420 */ 96, 96, 460, 259, 460, 120, 117, 354, 942, 1332, |
| 139791 | | - /* 430 */ 942, 1333, 1332, 278, 1333, 335, 680, 681, 682, 825, |
| 139792 | | - /* 440 */ 201, 176, 303, 50, 50, 49, 49, 404, 94, 94, |
| 139793 | | - /* 450 */ 94, 94, 93, 93, 92, 92, 92, 91, 361, 97, |
| 139794 | | - /* 460 */ 98, 88, 983, 983, 859, 862, 851, 851, 95, 95, |
| 139795 | | - /* 470 */ 96, 96, 96, 96, 199, 460, 380, 265, 433, 380, |
| 139796 | | - /* 480 */ 265, 383, 256, 158, 258, 319, 1003, 335, 155, 940, |
| 139797 | | - /* 490 */ 177, 940, 273, 379, 276, 322, 34, 34, 302, 962, |
| 139798 | | - /* 500 */ 94, 94, 94, 94, 93, 93, 92, 92, 92, 91, |
| 139799 | | - /* 510 */ 361, 97, 98, 88, 983, 983, 859, 862, 851, 851, |
| 139800 | | - /* 520 */ 95, 95, 96, 96, 96, 96, 905, 905, 397, 460, |
| 139801 | | - /* 530 */ 301, 158, 101, 319, 941, 340, 962, 963, 964, 313, |
| 139802 | | - /* 540 */ 283, 449, 335, 327, 146, 1266, 1004, 257, 234, 248, |
| 139803 | | - /* 550 */ 35, 35, 94, 94, 94, 94, 93, 93, 92, 92, |
| 139804 | | - /* 560 */ 92, 91, 361, 709, 785, 1227, 97, 98, 88, 983, |
| 139805 | | - /* 570 */ 983, 859, 862, 851, 851, 95, 95, 96, 96, 96, |
| 139806 | | - /* 580 */ 96, 962, 1227, 1229, 245, 422, 838, 198, 197, 196, |
| 139807 | | - /* 590 */ 1079, 1079, 1077, 1077, 1004, 1334, 320, 335, 172, 171, |
| 139808 | | - /* 600 */ 709, 831, 159, 271, 271, 830, 76, 94, 94, 94, |
| 139809 | | - /* 610 */ 94, 93, 93, 92, 92, 92, 91, 361, 962, 963, |
| 139810 | | - /* 620 */ 964, 97, 98, 88, 983, 983, 859, 862, 851, 851, |
| 139811 | | - /* 630 */ 95, 95, 96, 96, 96, 96, 830, 830, 832, 1157, |
| 139812 | | - /* 640 */ 1157, 199, 1157, 173, 1227, 231, 232, 1282, 2, 335, |
| 139813 | | - /* 650 */ 271, 764, 271, 820, 271, 271, 763, 389, 389, 389, |
| 139814 | | - /* 660 */ 132, 79, 94, 94, 94, 94, 93, 93, 92, 92, |
| 139815 | | - /* 670 */ 92, 91, 361, 97, 98, 88, 983, 983, 859, 862, |
| 139816 | | - /* 680 */ 851, 851, 95, 95, 96, 96, 96, 96, 460, 264, |
| 139817 | | - /* 690 */ 223, 460, 1257, 783, 1223, 1157, 1086, 1082, 80, 271, |
| 139818 | | - /* 700 */ 78, 335, 340, 1031, 341, 344, 345, 902, 346, 10, |
| 139819 | | - /* 710 */ 10, 902, 25, 25, 94, 94, 94, 94, 93, 93, |
| 139820 | | - /* 720 */ 92, 92, 92, 91, 361, 97, 86, 88, 983, 983, |
| 139821 | | - /* 730 */ 859, 862, 851, 851, 95, 95, 96, 96, 96, 96, |
| 139822 | | - /* 740 */ 1157, 270, 395, 117, 233, 263, 235, 70, 456, 341, |
| 139823 | | - /* 750 */ 225, 176, 335, 1305, 342, 133, 736, 966, 980, 249, |
| 139824 | | - /* 760 */ 1150, 396, 325, 1085, 1028, 178, 94, 94, 94, 94, |
| 139825 | | - /* 770 */ 93, 93, 92, 92, 92, 91, 361, 98, 88, 983, |
| 139826 | | - /* 780 */ 983, 859, 862, 851, 851, 95, 95, 96, 96, 96, |
| 139827 | | - /* 790 */ 96, 783, 783, 132, 120, 966, 120, 120, 120, 798, |
| 139828 | | - /* 800 */ 252, 937, 335, 353, 321, 429, 355, 799, 822, 692, |
| 139829 | | - /* 810 */ 390, 203, 446, 450, 372, 716, 454, 94, 94, 94, |
| 139830 | | - /* 820 */ 94, 93, 93, 92, 92, 92, 91, 361, 88, 983, |
| 139831 | | - /* 830 */ 983, 859, 862, 851, 851, 95, 95, 96, 96, 96, |
| 139832 | | - /* 840 */ 96, 84, 455, 1225, 3, 1209, 120, 120, 382, 387, |
| 139833 | | - /* 850 */ 120, 203, 1271, 716, 384, 168, 266, 203, 458, 72, |
| 139834 | | - /* 860 */ 260, 1246, 84, 455, 178, 3, 378, 94, 94, 94, |
| 139835 | | - /* 870 */ 94, 93, 93, 92, 92, 92, 91, 361, 350, 458, |
| 139836 | | - /* 880 */ 1245, 362, 430, 213, 228, 290, 415, 285, 414, 200, |
| 139837 | | - /* 890 */ 783, 882, 444, 726, 725, 405, 283, 921, 209, 921, |
| 139838 | | - /* 900 */ 281, 132, 362, 72, 838, 289, 147, 733, 734, 392, |
| 139839 | | - /* 910 */ 81, 82, 922, 444, 922, 267, 288, 83, 362, 462, |
| 139840 | | - /* 920 */ 461, 272, 132, 830, 23, 838, 388, 923, 1216, 923, |
| 139841 | | - /* 930 */ 1056, 81, 82, 84, 455, 899, 3, 899, 83, 362, |
| 139842 | | - /* 940 */ 462, 461, 761, 962, 830, 75, 1, 443, 275, 747, |
| 139843 | | - /* 950 */ 458, 5, 962, 204, 830, 830, 832, 833, 18, 748, |
| 139844 | | - /* 960 */ 229, 962, 277, 19, 153, 317, 317, 316, 216, 314, |
| 139845 | | - /* 970 */ 279, 460, 689, 362, 1055, 830, 830, 832, 833, 18, |
| 139846 | | - /* 980 */ 962, 963, 964, 962, 444, 181, 460, 251, 981, 962, |
| 139847 | | - /* 990 */ 963, 964, 8, 8, 20, 250, 838, 1070, 962, 963, |
| 139848 | | - /* 1000 */ 964, 417, 81, 82, 768, 204, 347, 36, 36, 83, |
| 139849 | | - /* 1010 */ 362, 462, 461, 1054, 284, 830, 84, 455, 1123, 3, |
| 139850 | | - /* 1020 */ 962, 963, 964, 460, 183, 962, 981, 764, 889, 1107, |
| 139851 | | - /* 1030 */ 460, 184, 763, 458, 132, 182, 74, 455, 460, 3, |
| 139852 | | - /* 1040 */ 981, 898, 834, 898, 8, 8, 830, 830, 832, 833, |
| 139853 | | - /* 1050 */ 18, 8, 8, 458, 219, 1156, 362, 1103, 349, 8, |
| 139854 | | - /* 1060 */ 8, 240, 962, 963, 964, 236, 889, 444, 792, 336, |
| 139855 | | - /* 1070 */ 158, 203, 885, 435, 700, 209, 362, 114, 981, 838, |
| 139856 | | - /* 1080 */ 834, 227, 334, 1114, 441, 81, 82, 444, 442, 305, |
| 139857 | | - /* 1090 */ 784, 306, 83, 362, 462, 461, 369, 1162, 830, 838, |
| 139858 | | - /* 1100 */ 460, 1037, 237, 1030, 237, 81, 82, 7, 96, 96, |
| 139859 | | - /* 1110 */ 96, 96, 83, 362, 462, 461, 1019, 1018, 830, 1020, |
| 139860 | | - /* 1120 */ 1289, 37, 37, 400, 96, 96, 96, 96, 89, 830, |
| 139861 | | - /* 1130 */ 830, 832, 833, 18, 1100, 318, 962, 292, 94, 94, |
| 139862 | | - /* 1140 */ 94, 94, 93, 93, 92, 92, 92, 91, 361, 830, |
| 139863 | | - /* 1150 */ 830, 832, 833, 18, 94, 94, 94, 94, 93, 93, |
| 139864 | | - /* 1160 */ 92, 92, 92, 91, 361, 359, 358, 226, 226, 727, |
| 139865 | | - /* 1170 */ 294, 296, 460, 962, 963, 964, 460, 989, 160, 425, |
| 139866 | | - /* 1180 */ 170, 1295, 262, 460, 987, 374, 988, 386, 1145, 255, |
| 139867 | | - /* 1190 */ 326, 460, 373, 38, 38, 410, 174, 39, 39, 413, |
| 139868 | | - /* 1200 */ 460, 287, 460, 1053, 40, 40, 298, 728, 1220, 990, |
| 139869 | | - /* 1210 */ 445, 990, 26, 26, 1219, 460, 311, 460, 169, 1292, |
| 139870 | | - /* 1220 */ 460, 27, 27, 29, 29, 998, 460, 206, 135, 995, |
| 139871 | | - /* 1230 */ 1265, 1263, 460, 57, 60, 460, 41, 41, 42, 42, |
| 139872 | | - /* 1240 */ 460, 43, 43, 460, 343, 351, 460, 9, 9, 460, |
| 139873 | | - /* 1250 */ 144, 460, 130, 44, 44, 460, 103, 103, 460, 137, |
| 139874 | | - /* 1260 */ 70, 45, 45, 460, 46, 46, 460, 31, 31, 1142, |
| 139875 | | - /* 1270 */ 47, 47, 48, 48, 460, 376, 32, 32, 460, 122, |
| 139876 | | - /* 1280 */ 122, 460, 157, 460, 123, 123, 139, 124, 124, 460, |
| 139877 | | - /* 1290 */ 186, 460, 377, 460, 115, 54, 54, 460, 403, 33, |
| 139878 | | - /* 1300 */ 33, 460, 104, 104, 51, 51, 460, 161, 460, 140, |
| 139879 | | - /* 1310 */ 105, 105, 106, 106, 102, 102, 460, 141, 121, 121, |
| 139880 | | - /* 1320 */ 460, 142, 119, 119, 190, 460, 1152, 110, 110, 109, |
| 139881 | | - /* 1330 */ 109, 702, 460, 148, 393, 65, 460, 107, 107, 460, |
| 139882 | | - /* 1340 */ 323, 108, 108, 399, 460, 1234, 53, 53, 1214, 269, |
| 139883 | | - /* 1350 */ 154, 416, 1115, 55, 55, 220, 401, 52, 52, 191, |
| 139884 | | - /* 1360 */ 24, 24, 274, 192, 193, 28, 28, 1021, 328, 702, |
| 139885 | | - /* 1370 */ 1073, 352, 1072, 718, 1071, 431, 1111, 1064, 329, 1045, |
| 139886 | | - /* 1380 */ 69, 205, 6, 291, 1044, 286, 1112, 1043, 1304, 1110, |
| 139887 | | - /* 1390 */ 293, 300, 295, 297, 1063, 1200, 1109, 77, 241, 448, |
| 139888 | | - /* 1400 */ 356, 452, 436, 100, 214, 71, 434, 1027, 1093, 21, |
| 139889 | | - /* 1410 */ 463, 242, 243, 957, 215, 217, 218, 464, 309, 307, |
| 139890 | | - /* 1420 */ 308, 310, 1016, 125, 1250, 1251, 1011, 1249, 126, 127, |
| 139891 | | - /* 1430 */ 1248, 113, 676, 337, 238, 338, 134, 363, 167, 1041, |
| 139892 | | - /* 1440 */ 1040, 56, 247, 367, 180, 897, 111, 895, 136, 1038, |
| 139893 | | - /* 1450 */ 818, 128, 138, 750, 261, 911, 185, 143, 145, 61, |
| 139894 | | - /* 1460 */ 62, 63, 64, 129, 914, 187, 188, 910, 118, 12, |
| 139895 | | - /* 1470 */ 189, 903, 268, 992, 203, 162, 398, 150, 149, 691, |
| 139896 | | - /* 1480 */ 402, 288, 194, 406, 151, 411, 66, 13, 729, 239, |
| 139897 | | - /* 1490 */ 282, 14, 67, 131, 837, 836, 865, 758, 15, 4, |
| 139898 | | - /* 1500 */ 68, 762, 175, 222, 224, 424, 152, 869, 791, 202, |
| 139899 | | - /* 1510 */ 786, 75, 72, 880, 866, 864, 16, 17, 920, 207, |
| 139900 | | - /* 1520 */ 919, 208, 447, 946, 164, 211, 947, 210, 165, 451, |
| 139901 | | - /* 1530 */ 868, 166, 315, 835, 701, 85, 212, 1297, 312, 952, |
| 139902 | | - /* 1540 */ 1296, |
| 140114 | + /* 0 */ 1169, 1015, 167, 167, 1, 168, 466, 1313, 466, 1083, |
| 140115 | + /* 10 */ 1062, 466, 97, 94, 183, 1057, 466, 329, 1083, 342, |
| 140116 | + /* 20 */ 97, 94, 183, 459, 459, 459, 436, 57, 57, 57, |
| 140117 | + /* 30 */ 57, 807, 57, 57, 367, 367, 367, 57, 57, 808, |
| 140118 | + /* 40 */ 1270, 1088, 1088, 104, 105, 95, 991, 991, 868, 871, |
| 140119 | + /* 50 */ 860, 860, 102, 102, 103, 103, 103, 103, 233, 233, |
| 140120 | + /* 60 */ 326, 1011, 449, 437, 449, 446, 351, 449, 461, 1142, |
| 140121 | + /* 70 */ 463, 342, 449, 426, 1316, 209, 180, 742, 80, 299, |
| 140122 | + /* 80 */ 857, 857, 869, 872, 101, 101, 101, 101, 100, 100, |
| 140123 | + /* 90 */ 99, 99, 99, 98, 368, 104, 105, 95, 991, 991, |
| 140124 | + /* 100 */ 868, 871, 860, 860, 102, 102, 103, 103, 103, 103, |
| 140125 | + /* 110 */ 99, 99, 99, 98, 368, 355, 97, 94, 183, 228, |
| 140126 | + /* 120 */ 106, 1012, 407, 342, 101, 101, 101, 101, 100, 100, |
| 140127 | + /* 130 */ 99, 99, 99, 98, 368, 861, 101, 101, 101, 101, |
| 140128 | + /* 140 */ 100, 100, 99, 99, 99, 98, 368, 104, 105, 95, |
| 140129 | + /* 150 */ 991, 991, 868, 871, 860, 860, 102, 102, 103, 103, |
| 140130 | + /* 160 */ 103, 103, 201, 368, 375, 420, 417, 416, 387, 273, |
| 140131 | + /* 170 */ 65, 97, 94, 183, 168, 342, 415, 951, 1343, 396, |
| 140132 | + /* 180 */ 66, 1343, 320, 959, 371, 970, 334, 340, 101, 101, |
| 140133 | + /* 190 */ 101, 101, 100, 100, 99, 99, 99, 98, 368, 104, |
| 140134 | + /* 200 */ 105, 95, 991, 991, 868, 871, 860, 860, 102, 102, |
| 140135 | + /* 210 */ 103, 103, 103, 103, 373, 100, 100, 99, 99, 99, |
| 140136 | + /* 220 */ 98, 368, 970, 971, 972, 201, 1100, 342, 420, 417, |
| 140137 | + /* 230 */ 416, 287, 366, 365, 337, 970, 1162, 463, 949, 415, |
| 140138 | + /* 240 */ 101, 101, 101, 101, 100, 100, 99, 99, 99, 98, |
| 140139 | + /* 250 */ 368, 104, 105, 95, 991, 991, 868, 871, 860, 860, |
| 140140 | + /* 260 */ 102, 102, 103, 103, 103, 103, 777, 241, 233, 233, |
| 140141 | + /* 270 */ 9, 847, 970, 971, 972, 390, 998, 1141, 998, 342, |
| 140142 | + /* 280 */ 463, 252, 829, 719, 98, 368, 840, 298, 338, 142, |
| 140143 | + /* 290 */ 839, 339, 101, 101, 101, 101, 100, 100, 99, 99, |
| 140144 | + /* 300 */ 99, 98, 368, 104, 105, 95, 991, 991, 868, 871, |
| 140145 | + /* 310 */ 860, 860, 102, 102, 103, 103, 103, 103, 272, 466, |
| 140146 | + /* 320 */ 392, 839, 839, 841, 97, 94, 183, 390, 1317, 253, |
| 140147 | + /* 330 */ 456, 342, 125, 166, 807, 712, 208, 407, 386, 970, |
| 140148 | + /* 340 */ 57, 57, 808, 238, 101, 101, 101, 101, 100, 100, |
| 140149 | + /* 350 */ 99, 99, 99, 98, 368, 104, 105, 95, 991, 991, |
| 140150 | + /* 360 */ 868, 871, 860, 860, 102, 102, 103, 103, 103, 103, |
| 140151 | + /* 370 */ 466, 108, 466, 267, 465, 442, 970, 971, 972, 261, |
| 140152 | + /* 380 */ 951, 1344, 909, 342, 1344, 142, 829, 848, 1292, 959, |
| 140153 | + /* 390 */ 371, 55, 55, 57, 57, 242, 101, 101, 101, 101, |
| 140154 | + /* 400 */ 100, 100, 99, 99, 99, 98, 368, 104, 105, 95, |
| 140155 | + /* 410 */ 991, 991, 868, 871, 860, 860, 102, 102, 103, 103, |
| 140156 | + /* 420 */ 103, 103, 272, 382, 262, 253, 456, 310, 364, 253, |
| 140157 | + /* 430 */ 456, 86, 264, 84, 266, 342, 441, 176, 175, 834, |
| 140158 | + /* 440 */ 464, 949, 767, 767, 332, 313, 1094, 396, 101, 101, |
| 140159 | + /* 450 */ 101, 101, 100, 100, 99, 99, 99, 98, 368, 104, |
| 140160 | + /* 460 */ 105, 95, 991, 991, 868, 871, 860, 860, 102, 102, |
| 140161 | + /* 470 */ 103, 103, 103, 103, 227, 227, 233, 233, 233, 233, |
| 140162 | + /* 480 */ 387, 273, 234, 234, 326, 950, 463, 342, 463, 298, |
| 140163 | + /* 490 */ 463, 914, 914, 404, 463, 1037, 123, 265, 27, 970, |
| 140164 | + /* 500 */ 101, 101, 101, 101, 100, 100, 99, 99, 99, 98, |
| 140165 | + /* 510 */ 368, 104, 105, 95, 991, 991, 868, 871, 860, 860, |
| 140166 | + /* 520 */ 102, 102, 103, 103, 103, 103, 435, 233, 233, 466, |
| 140167 | + /* 530 */ 285, 686, 687, 688, 127, 271, 970, 971, 972, 463, |
| 140168 | + /* 540 */ 1345, 327, 342, 407, 157, 1012, 988, 13, 13, 181, |
| 140169 | + /* 550 */ 41, 41, 101, 101, 101, 101, 100, 100, 99, 99, |
| 140170 | + /* 560 */ 99, 98, 368, 715, 794, 378, 104, 105, 95, 991, |
| 140171 | + /* 570 */ 991, 868, 871, 860, 860, 102, 102, 103, 103, 103, |
| 140172 | + /* 580 */ 103, 970, 378, 377, 346, 239, 847, 1086, 1086, 280, |
| 140173 | + /* 590 */ 1169, 283, 204, 203, 202, 177, 298, 342, 407, 298, |
| 140174 | + /* 600 */ 715, 840, 169, 299, 407, 839, 82, 101, 101, 101, |
| 140175 | + /* 610 */ 101, 100, 100, 99, 99, 99, 98, 368, 970, 971, |
| 140176 | + /* 620 */ 972, 104, 105, 95, 991, 991, 868, 871, 860, 860, |
| 140177 | + /* 630 */ 102, 102, 103, 103, 103, 103, 839, 839, 841, 362, |
| 140178 | + /* 640 */ 240, 124, 1169, 172, 126, 378, 1269, 1169, 1066, 342, |
| 140179 | + /* 650 */ 253, 456, 407, 407, 407, 396, 352, 401, 407, 429, |
| 140180 | + /* 660 */ 398, 85, 101, 101, 101, 101, 100, 100, 99, 99, |
| 140181 | + /* 670 */ 99, 98, 368, 104, 105, 95, 991, 991, 868, 871, |
| 140182 | + /* 680 */ 860, 860, 102, 102, 103, 103, 103, 103, 1169, 466, |
| 140183 | + /* 690 */ 230, 233, 233, 792, 1235, 1095, 1091, 1293, 1, 77, |
| 140184 | + /* 700 */ 278, 342, 205, 463, 974, 911, 1040, 348, 353, 911, |
| 140185 | + /* 710 */ 42, 42, 79, 403, 101, 101, 101, 101, 100, 100, |
| 140186 | + /* 720 */ 99, 99, 99, 98, 368, 104, 93, 95, 991, 991, |
| 140187 | + /* 730 */ 868, 871, 860, 860, 102, 102, 103, 103, 103, 103, |
| 140188 | + /* 740 */ 402, 9, 974, 243, 772, 458, 348, 232, 180, 771, |
| 140189 | + /* 750 */ 946, 312, 342, 328, 363, 349, 143, 831, 389, 1278, |
| 140190 | + /* 760 */ 211, 211, 21, 347, 432, 182, 101, 101, 101, 101, |
| 140191 | + /* 770 */ 100, 100, 99, 99, 99, 98, 368, 105, 95, 991, |
| 140192 | + /* 780 */ 991, 868, 871, 860, 860, 102, 102, 103, 103, 103, |
| 140193 | + /* 790 */ 103, 792, 724, 22, 732, 731, 233, 233, 1239, 256, |
| 140194 | + /* 800 */ 391, 274, 342, 211, 79, 360, 257, 413, 463, 397, |
| 140195 | + /* 810 */ 207, 288, 260, 450, 79, 1239, 1241, 101, 101, 101, |
| 140196 | + /* 820 */ 101, 100, 100, 99, 99, 99, 98, 368, 95, 991, |
| 140197 | + /* 830 */ 991, 868, 871, 860, 860, 102, 102, 103, 103, 103, |
| 140198 | + /* 840 */ 103, 91, 457, 296, 3, 233, 233, 5, 438, 212, |
| 140199 | + /* 850 */ 331, 394, 739, 740, 295, 898, 894, 463, 460, 207, |
| 140200 | + /* 860 */ 801, 1237, 722, 211, 698, 843, 1283, 101, 101, 101, |
| 140201 | + /* 870 */ 101, 100, 100, 99, 99, 99, 98, 368, 1239, 380, |
| 140202 | + /* 880 */ 357, 369, 233, 233, 989, 219, 236, 297, 423, 292, |
| 140203 | + /* 890 */ 422, 206, 454, 898, 463, 970, 91, 457, 290, 3, |
| 140204 | + /* 900 */ 722, 142, 268, 843, 847, 466, 1258, 149, 388, 425, |
| 140205 | + /* 910 */ 88, 89, 769, 460, 930, 87, 447, 90, 369, 468, |
| 140206 | + /* 920 */ 467, 385, 989, 839, 1257, 439, 57, 57, 395, 931, |
| 140207 | + /* 930 */ 1065, 158, 970, 971, 972, 772, 369, 471, 1019, 399, |
| 140208 | + /* 940 */ 771, 253, 456, 254, 932, 119, 891, 454, 233, 233, |
| 140209 | + /* 950 */ 4, 970, 1096, 275, 839, 839, 841, 842, 19, 847, |
| 140210 | + /* 960 */ 463, 449, 448, 163, 453, 88, 89, 776, 970, 1127, |
| 140211 | + /* 970 */ 279, 930, 90, 369, 468, 467, 91, 457, 839, 3, |
| 140212 | + /* 980 */ 235, 1064, 466, 1228, 233, 233, 931, 970, 970, 971, |
| 140213 | + /* 990 */ 972, 970, 908, 460, 908, 2, 463, 81, 457, 212, |
| 140214 | + /* 1000 */ 3, 932, 282, 10, 10, 970, 971, 972, 189, 839, |
| 140215 | + /* 1010 */ 839, 841, 842, 19, 460, 284, 369, 354, 907, 286, |
| 140216 | + /* 1020 */ 907, 753, 466, 1079, 970, 971, 972, 454, 970, 971, |
| 140217 | + /* 1030 */ 972, 754, 970, 1063, 989, 372, 792, 369, 1118, 847, |
| 140218 | + /* 1040 */ 291, 452, 466, 10, 10, 88, 89, 142, 454, 168, |
| 140219 | + /* 1050 */ 300, 412, 90, 369, 468, 467, 793, 356, 839, 706, |
| 140220 | + /* 1060 */ 847, 341, 121, 10, 10, 301, 88, 89, 379, 970, |
| 140221 | + /* 1070 */ 971, 972, 989, 90, 369, 468, 467, 244, 205, 839, |
| 140222 | + /* 1080 */ 1306, 245, 1135, 245, 250, 1168, 1114, 253, 456, 839, |
| 140223 | + /* 1090 */ 839, 841, 842, 19, 1125, 237, 122, 451, 1174, 733, |
| 140224 | + /* 1100 */ 324, 324, 323, 222, 321, 466, 1046, 695, 182, 225, |
| 140225 | + /* 1110 */ 839, 839, 841, 842, 19, 103, 103, 103, 103, 96, |
| 140226 | + /* 1120 */ 185, 466, 259, 1039, 1028, 170, 10, 10, 1027, 421, |
| 140227 | + /* 1130 */ 258, 1029, 1300, 708, 792, 466, 408, 734, 8, 347, |
| 140228 | + /* 1140 */ 444, 174, 12, 12, 290, 101, 101, 101, 101, 100, |
| 140229 | + /* 1150 */ 100, 99, 99, 99, 98, 368, 32, 32, 466, 187, |
| 140230 | + /* 1160 */ 466, 1111, 103, 103, 103, 103, 188, 466, 325, 138, |
| 140231 | + /* 1170 */ 186, 708, 303, 305, 307, 358, 970, 270, 393, 43, |
| 140232 | + /* 1180 */ 43, 44, 44, 1157, 333, 178, 418, 294, 45, 45, |
| 140233 | + /* 1190 */ 1232, 318, 101, 101, 101, 101, 100, 100, 99, 99, |
| 140234 | + /* 1200 */ 99, 98, 368, 381, 343, 366, 365, 466, 263, 253, |
| 140235 | + /* 1210 */ 456, 466, 1062, 970, 971, 972, 1231, 997, 309, 466, |
| 140236 | + /* 1220 */ 455, 466, 427, 466, 995, 173, 996, 1303, 46, 46, |
| 140237 | + /* 1230 */ 145, 376, 37, 37, 1006, 1277, 466, 214, 1275, 64, |
| 140238 | + /* 1240 */ 47, 47, 33, 33, 34, 34, 1003, 67, 466, 998, |
| 140239 | + /* 1250 */ 350, 998, 466, 155, 233, 233, 466, 36, 36, 24, |
| 140240 | + /* 1260 */ 140, 77, 1154, 466, 383, 466, 463, 428, 466, 48, |
| 140241 | + /* 1270 */ 48, 466, 147, 49, 49, 466, 150, 50, 50, 466, |
| 140242 | + /* 1280 */ 151, 152, 466, 384, 11, 11, 51, 51, 466, 110, |
| 140243 | + /* 1290 */ 110, 153, 52, 52, 411, 466, 38, 38, 466, 191, |
| 140244 | + /* 1300 */ 53, 53, 466, 54, 54, 466, 400, 466, 330, 39, |
| 140245 | + /* 1310 */ 39, 466, 1164, 466, 25, 466, 56, 56, 466, 131, |
| 140246 | + /* 1320 */ 131, 72, 466, 132, 132, 159, 133, 133, 61, 61, |
| 140247 | + /* 1330 */ 1226, 195, 40, 40, 111, 111, 58, 58, 406, 112, |
| 140248 | + /* 1340 */ 112, 466, 277, 113, 113, 466, 226, 466, 1246, 466, |
| 140249 | + /* 1350 */ 197, 466, 164, 466, 409, 466, 198, 466, 199, 466, |
| 140250 | + /* 1360 */ 335, 281, 109, 109, 466, 1030, 130, 130, 129, 129, |
| 140251 | + /* 1370 */ 117, 117, 116, 116, 114, 114, 115, 115, 60, 60, |
| 140252 | + /* 1380 */ 62, 62, 466, 359, 466, 59, 59, 424, 1082, 1081, |
| 140253 | + /* 1390 */ 1080, 724, 1073, 1054, 336, 293, 1053, 1052, 1315, 431, |
| 140254 | + /* 1400 */ 361, 76, 248, 31, 31, 35, 35, 1072, 249, 440, |
| 140255 | + /* 1410 */ 302, 434, 213, 1122, 6, 311, 1212, 107, 83, 251, |
| 140256 | + /* 1420 */ 78, 1123, 445, 220, 443, 1036, 304, 23, 1121, 469, |
| 140257 | + /* 1430 */ 965, 221, 223, 1104, 314, 224, 344, 317, 315, 316, |
| 140258 | + /* 1440 */ 470, 306, 1025, 1120, 308, 1262, 1020, 134, 120, 246, |
| 140259 | + /* 1450 */ 682, 370, 171, 255, 1263, 135, 184, 1261, 1260, 374, |
| 140260 | + /* 1460 */ 118, 906, 904, 827, 1050, 146, 136, 137, 148, 1049, |
| 140261 | + /* 1470 */ 63, 1047, 756, 190, 269, 920, 154, 156, 68, 69, |
| 140262 | + /* 1480 */ 70, 71, 139, 923, 192, 193, 144, 919, 345, 128, |
| 140263 | + /* 1490 */ 14, 194, 276, 211, 1000, 405, 196, 161, 912, 160, |
| 140264 | + /* 1500 */ 26, 697, 410, 295, 200, 289, 414, 162, 419, 73, |
| 140265 | + /* 1510 */ 15, 16, 141, 74, 28, 247, 846, 845, 735, 874, |
| 140266 | + /* 1520 */ 954, 75, 430, 955, 29, 433, 179, 229, 231, 800, |
| 140267 | + /* 1530 */ 165, 795, 87, 210, 889, 79, 875, 17, 873, 877, |
| 140268 | + /* 1540 */ 929, 18, 928, 216, 215, 878, 20, 30, 462, 844, |
| 140269 | + /* 1550 */ 707, 92, 766, 770, 7, 322, 217, 218, 319, 1308, |
| 140270 | + /* 1560 */ 960, 1016, 1016, 1016, 1016, 1307, |
| 139903 | 140271 | }; |
| 139904 | 140272 | static const YYCODETYPE yy_lookahead[] = { |
| 139905 | | - /* 0 */ 144, 145, 146, 147, 172, 222, 223, 224, 222, 223, |
| 139906 | | - /* 10 */ 224, 152, 180, 152, 148, 149, 152, 173, 176, 19, |
| 139907 | | - /* 20 */ 154, 173, 156, 152, 163, 242, 152, 163, 176, 163, |
| 139908 | | - /* 30 */ 26, 31, 173, 174, 173, 174, 173, 173, 174, 39, |
| 139909 | | - /* 40 */ 1, 2, 152, 43, 44, 45, 46, 47, 48, 49, |
| 139910 | | - /* 50 */ 50, 51, 52, 53, 54, 55, 56, 57, 197, 169, |
| 139911 | | - /* 60 */ 170, 197, 188, 197, 222, 223, 224, 208, 209, 208, |
| 139912 | | - /* 70 */ 209, 19, 208, 152, 222, 223, 224, 22, 26, 24, |
| 140273 | + /* 0 */ 152, 144, 145, 146, 147, 152, 152, 172, 152, 180, |
| 140274 | + /* 10 */ 181, 152, 223, 224, 225, 180, 152, 164, 189, 19, |
| 140275 | + /* 20 */ 223, 224, 225, 168, 169, 170, 163, 173, 174, 173, |
| 140276 | + /* 30 */ 174, 31, 173, 174, 168, 169, 170, 173, 174, 39, |
| 140277 | + /* 40 */ 243, 191, 192, 43, 44, 45, 46, 47, 48, 49, |
| 140278 | + /* 50 */ 50, 51, 52, 53, 54, 55, 56, 57, 195, 196, |
| 140279 | + /* 60 */ 22, 23, 208, 209, 208, 209, 218, 208, 209, 176, |
| 140280 | + /* 70 */ 207, 19, 208, 209, 23, 212, 213, 26, 26, 152, |
| 139913 | 140281 | /* 80 */ 46, 47, 48, 49, 84, 85, 86, 87, 88, 89, |
| 139914 | 140282 | /* 90 */ 90, 91, 92, 93, 94, 43, 44, 45, 46, 47, |
| 139915 | 140283 | /* 100 */ 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, |
| 139916 | | - /* 110 */ 106, 245, 157, 88, 89, 90, 91, 92, 93, 94, |
| 139917 | | - /* 120 */ 68, 231, 251, 19, 84, 85, 86, 87, 88, 89, |
| 140284 | + /* 110 */ 90, 91, 92, 93, 94, 188, 223, 224, 225, 171, |
| 140285 | + /* 120 */ 68, 83, 152, 19, 84, 85, 86, 87, 88, 89, |
| 139918 | 140286 | /* 130 */ 90, 91, 92, 93, 94, 101, 84, 85, 86, 87, |
| 139919 | 140287 | /* 140 */ 88, 89, 90, 91, 92, 93, 94, 43, 44, 45, |
| 139920 | 140288 | /* 150 */ 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, |
| 139921 | | - /* 160 */ 56, 57, 90, 91, 92, 93, 94, 82, 79, 99, |
| 139922 | | - /* 170 */ 66, 200, 102, 103, 104, 19, 168, 169, 170, 152, |
| 139923 | | - /* 180 */ 24, 210, 97, 113, 229, 59, 101, 232, 84, 85, |
| 140289 | + /* 160 */ 56, 57, 99, 94, 194, 102, 103, 104, 109, 110, |
| 140290 | + /* 170 */ 66, 223, 224, 225, 152, 19, 113, 22, 23, 152, |
| 140291 | + /* 180 */ 24, 26, 160, 1, 2, 59, 164, 173, 84, 85, |
| 139924 | 140292 | /* 190 */ 86, 87, 88, 89, 90, 91, 92, 93, 94, 43, |
| 139925 | 140293 | /* 200 */ 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, |
| 139926 | | - /* 210 */ 54, 55, 56, 57, 152, 188, 152, 132, 133, 134, |
| 139927 | | - /* 220 */ 93, 94, 96, 97, 98, 99, 152, 19, 102, 103, |
| 139928 | | - /* 230 */ 104, 23, 94, 72, 79, 173, 174, 173, 174, 113, |
| 140294 | + /* 210 */ 54, 55, 56, 57, 244, 88, 89, 90, 91, 92, |
| 140295 | + /* 220 */ 93, 94, 96, 97, 98, 99, 196, 19, 102, 103, |
| 140296 | + /* 230 */ 104, 23, 88, 89, 173, 59, 163, 207, 83, 113, |
| 139929 | 140297 | /* 240 */ 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, |
| 139930 | 140298 | /* 250 */ 94, 43, 44, 45, 46, 47, 48, 49, 50, 51, |
| 139931 | | - /* 260 */ 52, 53, 54, 55, 56, 57, 152, 171, 152, 108, |
| 139932 | | - /* 270 */ 109, 110, 208, 209, 119, 120, 152, 180, 181, 19, |
| 139933 | | - /* 280 */ 119, 120, 152, 23, 152, 152, 189, 173, 174, 173, |
| 139934 | | - /* 290 */ 174, 59, 84, 85, 86, 87, 88, 89, 90, 91, |
| 140299 | + /* 260 */ 52, 53, 54, 55, 56, 57, 90, 240, 195, 196, |
| 140300 | + /* 270 */ 171, 82, 96, 97, 98, 152, 132, 176, 134, 19, |
| 140301 | + /* 280 */ 207, 200, 72, 23, 93, 94, 97, 152, 173, 79, |
| 140302 | + /* 290 */ 101, 210, 84, 85, 86, 87, 88, 89, 90, 91, |
| 139935 | 140303 | /* 300 */ 92, 93, 94, 43, 44, 45, 46, 47, 48, 49, |
| 139936 | | - /* 310 */ 50, 51, 52, 53, 54, 55, 56, 57, 222, 223, |
| 139937 | | - /* 320 */ 224, 186, 208, 209, 208, 209, 194, 194, 96, 97, |
| 139938 | | - /* 330 */ 98, 19, 168, 169, 170, 23, 88, 89, 163, 59, |
| 139939 | | - /* 340 */ 0, 1, 2, 219, 84, 85, 86, 87, 88, 89, |
| 140304 | + /* 310 */ 50, 51, 52, 53, 54, 55, 56, 57, 108, 152, |
| 140305 | + /* 320 */ 152, 132, 133, 134, 223, 224, 225, 152, 186, 119, |
| 140306 | + /* 330 */ 120, 19, 197, 234, 31, 23, 26, 152, 239, 59, |
| 140307 | + /* 340 */ 173, 174, 39, 220, 84, 85, 86, 87, 88, 89, |
| 139940 | 140308 | /* 350 */ 90, 91, 92, 93, 94, 43, 44, 45, 46, 47, |
| 139941 | 140309 | /* 360 */ 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, |
| 139942 | | - /* 370 */ 90, 152, 197, 195, 196, 243, 96, 97, 98, 196, |
| 139943 | | - /* 380 */ 132, 11, 134, 19, 182, 207, 115, 23, 117, 118, |
| 139944 | | - /* 390 */ 207, 163, 173, 174, 152, 220, 84, 85, 86, 87, |
| 140310 | + /* 370 */ 152, 22, 152, 16, 152, 208, 96, 97, 98, 194, |
| 140311 | + /* 380 */ 22, 23, 11, 19, 26, 79, 72, 23, 0, 1, |
| 140312 | + /* 390 */ 2, 173, 174, 173, 174, 220, 84, 85, 86, 87, |
| 139945 | 140313 | /* 400 */ 88, 89, 90, 91, 92, 93, 94, 43, 44, 45, |
| 139946 | 140314 | /* 410 */ 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, |
| 139947 | | - /* 420 */ 56, 57, 152, 16, 152, 197, 171, 208, 22, 23, |
| 139948 | | - /* 430 */ 22, 23, 26, 16, 26, 19, 7, 8, 9, 23, |
| 139949 | | - /* 440 */ 212, 213, 152, 173, 174, 173, 174, 19, 84, 85, |
| 140315 | + /* 420 */ 56, 57, 108, 109, 110, 119, 120, 152, 208, 119, |
| 140316 | + /* 430 */ 120, 137, 75, 139, 77, 19, 152, 88, 89, 23, |
| 140317 | + /* 440 */ 115, 83, 117, 118, 163, 227, 163, 152, 84, 85, |
| 139950 | 140318 | /* 450 */ 86, 87, 88, 89, 90, 91, 92, 93, 94, 43, |
| 139951 | 140319 | /* 460 */ 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, |
| 139952 | | - /* 470 */ 54, 55, 56, 57, 46, 152, 109, 110, 208, 109, |
| 139953 | | - /* 480 */ 110, 152, 75, 152, 77, 22, 23, 19, 233, 83, |
| 139954 | | - /* 490 */ 152, 83, 75, 238, 77, 164, 173, 174, 226, 59, |
| 140320 | + /* 470 */ 54, 55, 56, 57, 195, 196, 195, 196, 195, 196, |
| 140321 | + /* 480 */ 109, 110, 195, 196, 22, 23, 207, 19, 207, 152, |
| 140322 | + /* 490 */ 207, 108, 109, 110, 207, 163, 22, 140, 24, 59, |
| 139955 | 140323 | /* 500 */ 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, |
| 139956 | 140324 | /* 510 */ 94, 43, 44, 45, 46, 47, 48, 49, 50, 51, |
| 139957 | | - /* 520 */ 52, 53, 54, 55, 56, 57, 108, 109, 110, 152, |
| 139958 | | - /* 530 */ 152, 152, 22, 22, 23, 107, 96, 97, 98, 160, |
| 139959 | | - /* 540 */ 112, 251, 19, 164, 22, 152, 83, 140, 219, 152, |
| 140325 | + /* 520 */ 52, 53, 54, 55, 56, 57, 152, 195, 196, 152, |
| 140326 | + /* 530 */ 16, 7, 8, 9, 197, 240, 96, 97, 98, 207, |
| 140327 | + /* 540 */ 249, 250, 19, 152, 22, 83, 26, 173, 174, 152, |
| 139960 | 140328 | /* 550 */ 173, 174, 84, 85, 86, 87, 88, 89, 90, 91, |
| 139961 | 140329 | /* 560 */ 92, 93, 94, 59, 124, 152, 43, 44, 45, 46, |
| 139962 | 140330 | /* 570 */ 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, |
| 139963 | | - /* 580 */ 57, 59, 169, 170, 119, 120, 82, 108, 109, 110, |
| 139964 | | - /* 590 */ 191, 192, 191, 192, 83, 248, 249, 19, 88, 89, |
| 140331 | + /* 580 */ 57, 59, 169, 170, 157, 194, 82, 191, 192, 75, |
| 140332 | + /* 590 */ 152, 77, 108, 109, 110, 26, 152, 19, 152, 152, |
| 139965 | 140333 | /* 600 */ 96, 97, 24, 152, 152, 101, 138, 84, 85, 86, |
| 139966 | 140334 | /* 610 */ 87, 88, 89, 90, 91, 92, 93, 94, 96, 97, |
| 139967 | 140335 | /* 620 */ 98, 43, 44, 45, 46, 47, 48, 49, 50, 51, |
| 139968 | | - /* 630 */ 52, 53, 54, 55, 56, 57, 132, 133, 134, 152, |
| 139969 | | - /* 640 */ 152, 46, 152, 26, 231, 194, 194, 146, 147, 19, |
| 139970 | | - /* 650 */ 152, 116, 152, 72, 152, 152, 121, 152, 152, 152, |
| 139971 | | - /* 660 */ 79, 138, 84, 85, 86, 87, 88, 89, 90, 91, |
| 140336 | + /* 630 */ 52, 53, 54, 55, 56, 57, 132, 133, 134, 188, |
| 140337 | + /* 640 */ 194, 197, 152, 123, 197, 232, 194, 152, 182, 19, |
| 140338 | + /* 650 */ 119, 120, 152, 152, 152, 152, 218, 230, 152, 163, |
| 140339 | + /* 660 */ 233, 138, 84, 85, 86, 87, 88, 89, 90, 91, |
| 139972 | 140340 | /* 670 */ 92, 93, 94, 43, 44, 45, 46, 47, 48, 49, |
| 139973 | | - /* 680 */ 50, 51, 52, 53, 54, 55, 56, 57, 152, 108, |
| 139974 | | - /* 690 */ 23, 152, 194, 26, 194, 152, 194, 194, 137, 152, |
| 139975 | | - /* 700 */ 139, 19, 107, 166, 167, 218, 218, 29, 218, 173, |
| 139976 | | - /* 710 */ 174, 33, 173, 174, 84, 85, 86, 87, 88, 89, |
| 140341 | + /* 680 */ 50, 51, 52, 53, 54, 55, 56, 57, 152, 152, |
| 140342 | + /* 690 */ 23, 195, 196, 26, 194, 194, 194, 146, 147, 130, |
| 140343 | + /* 700 */ 194, 19, 46, 207, 59, 29, 166, 167, 218, 33, |
| 140344 | + /* 710 */ 173, 174, 26, 218, 84, 85, 86, 87, 88, 89, |
| 139977 | 140345 | /* 720 */ 90, 91, 92, 93, 94, 43, 44, 45, 46, 47, |
| 139978 | 140346 | /* 730 */ 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, |
| 139979 | | - /* 740 */ 152, 194, 64, 171, 239, 239, 239, 130, 166, 167, |
| 139980 | | - /* 750 */ 212, 213, 19, 23, 246, 247, 26, 59, 26, 152, |
| 139981 | | - /* 760 */ 163, 218, 163, 163, 163, 98, 84, 85, 86, 87, |
| 140347 | + /* 740 */ 64, 171, 97, 240, 116, 166, 167, 212, 213, 121, |
| 140348 | + /* 750 */ 23, 152, 19, 26, 218, 247, 248, 23, 23, 152, |
| 140349 | + /* 760 */ 26, 26, 22, 107, 163, 98, 84, 85, 86, 87, |
| 139982 | 140350 | /* 770 */ 88, 89, 90, 91, 92, 93, 94, 44, 45, 46, |
| 139983 | 140351 | /* 780 */ 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, |
| 139984 | | - /* 790 */ 57, 124, 26, 79, 197, 97, 197, 197, 197, 31, |
| 139985 | | - /* 800 */ 152, 23, 19, 19, 26, 19, 218, 39, 23, 21, |
| 139986 | | - /* 810 */ 238, 26, 163, 163, 100, 59, 163, 84, 85, 86, |
| 140352 | + /* 790 */ 57, 124, 106, 53, 100, 101, 195, 196, 152, 152, |
| 140353 | + /* 800 */ 23, 23, 19, 26, 26, 19, 152, 23, 207, 239, |
| 140354 | + /* 810 */ 26, 23, 152, 163, 26, 169, 170, 84, 85, 86, |
| 139987 | 140355 | /* 820 */ 87, 88, 89, 90, 91, 92, 93, 94, 45, 46, |
| 139988 | 140356 | /* 830 */ 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, |
| 139989 | | - /* 840 */ 57, 19, 20, 152, 22, 23, 197, 197, 23, 19, |
| 139990 | | - /* 850 */ 197, 26, 152, 97, 23, 123, 23, 26, 36, 26, |
| 139991 | | - /* 860 */ 152, 152, 19, 20, 98, 22, 78, 84, 85, 86, |
| 139992 | | - /* 870 */ 87, 88, 89, 90, 91, 92, 93, 94, 94, 36, |
| 139993 | | - /* 880 */ 152, 59, 96, 99, 100, 101, 102, 103, 104, 105, |
| 139994 | | - /* 890 */ 124, 103, 70, 100, 101, 23, 112, 12, 26, 12, |
| 139995 | | - /* 900 */ 23, 79, 59, 26, 82, 101, 22, 7, 8, 152, |
| 139996 | | - /* 910 */ 88, 89, 27, 70, 27, 152, 112, 95, 96, 97, |
| 139997 | | - /* 920 */ 98, 152, 79, 101, 22, 82, 96, 42, 140, 42, |
| 139998 | | - /* 930 */ 182, 88, 89, 19, 20, 132, 22, 134, 95, 96, |
| 139999 | | - /* 940 */ 97, 98, 23, 59, 101, 26, 22, 62, 152, 62, |
| 140000 | | - /* 950 */ 36, 22, 59, 24, 132, 133, 134, 135, 136, 72, |
| 140001 | | - /* 960 */ 5, 59, 152, 22, 71, 10, 11, 12, 13, 14, |
| 140002 | | - /* 970 */ 152, 152, 17, 59, 182, 132, 133, 134, 135, 136, |
| 140003 | | - /* 980 */ 96, 97, 98, 59, 70, 30, 152, 32, 59, 96, |
| 140004 | | - /* 990 */ 97, 98, 173, 174, 53, 40, 82, 152, 96, 97, |
| 140005 | | - /* 1000 */ 98, 90, 88, 89, 90, 24, 187, 173, 174, 95, |
| 140006 | | - /* 1010 */ 96, 97, 98, 152, 152, 101, 19, 20, 152, 22, |
| 140007 | | - /* 1020 */ 96, 97, 98, 152, 69, 59, 97, 116, 59, 214, |
| 140008 | | - /* 1030 */ 152, 76, 121, 36, 79, 80, 19, 20, 152, 22, |
| 140009 | | - /* 1040 */ 59, 132, 59, 134, 173, 174, 132, 133, 134, 135, |
| 140010 | | - /* 1050 */ 136, 173, 174, 36, 234, 152, 59, 152, 187, 173, |
| 140011 | | - /* 1060 */ 174, 211, 96, 97, 98, 187, 97, 70, 23, 114, |
| 140012 | | - /* 1070 */ 152, 26, 23, 187, 23, 26, 59, 26, 97, 82, |
| 140013 | | - /* 1080 */ 97, 22, 164, 152, 152, 88, 89, 70, 192, 152, |
| 140014 | | - /* 1090 */ 124, 152, 95, 96, 97, 98, 141, 152, 101, 82, |
| 140015 | | - /* 1100 */ 152, 152, 184, 152, 186, 88, 89, 199, 54, 55, |
| 140016 | | - /* 1110 */ 56, 57, 95, 96, 97, 98, 152, 152, 101, 152, |
| 140017 | | - /* 1120 */ 152, 173, 174, 235, 54, 55, 56, 57, 58, 132, |
| 140018 | | - /* 1130 */ 133, 134, 135, 136, 211, 150, 59, 211, 84, 85, |
| 140019 | | - /* 1140 */ 86, 87, 88, 89, 90, 91, 92, 93, 94, 132, |
| 140020 | | - /* 1150 */ 133, 134, 135, 136, 84, 85, 86, 87, 88, 89, |
| 140021 | | - /* 1160 */ 90, 91, 92, 93, 94, 88, 89, 195, 196, 35, |
| 140022 | | - /* 1170 */ 211, 211, 152, 96, 97, 98, 152, 100, 198, 207, |
| 140023 | | - /* 1180 */ 171, 122, 240, 152, 107, 215, 109, 240, 202, 215, |
| 140024 | | - /* 1190 */ 202, 152, 220, 173, 174, 177, 185, 173, 174, 65, |
| 140025 | | - /* 1200 */ 152, 176, 152, 181, 173, 174, 215, 73, 176, 132, |
| 140026 | | - /* 1210 */ 228, 134, 173, 174, 176, 152, 201, 152, 199, 155, |
| 140027 | | - /* 1220 */ 152, 173, 174, 173, 174, 60, 152, 122, 244, 38, |
| 140028 | | - /* 1230 */ 159, 159, 152, 241, 241, 152, 173, 174, 173, 174, |
| 140029 | | - /* 1240 */ 152, 173, 174, 152, 159, 111, 152, 173, 174, 152, |
| 140030 | | - /* 1250 */ 22, 152, 43, 173, 174, 152, 173, 174, 152, 190, |
| 140031 | | - /* 1260 */ 130, 173, 174, 152, 173, 174, 152, 173, 174, 202, |
| 140032 | | - /* 1270 */ 173, 174, 173, 174, 152, 18, 173, 174, 152, 173, |
| 140033 | | - /* 1280 */ 174, 152, 221, 152, 173, 174, 193, 173, 174, 152, |
| 140034 | | - /* 1290 */ 158, 152, 159, 152, 22, 173, 174, 152, 18, 173, |
| 140035 | | - /* 1300 */ 174, 152, 173, 174, 173, 174, 152, 221, 152, 193, |
| 140036 | | - /* 1310 */ 173, 174, 173, 174, 173, 174, 152, 193, 173, 174, |
| 140037 | | - /* 1320 */ 152, 193, 173, 174, 158, 152, 190, 173, 174, 173, |
| 140038 | | - /* 1330 */ 174, 59, 152, 190, 159, 137, 152, 173, 174, 152, |
| 140039 | | - /* 1340 */ 202, 173, 174, 61, 152, 237, 173, 174, 202, 236, |
| 140040 | | - /* 1350 */ 22, 107, 159, 173, 174, 159, 178, 173, 174, 158, |
| 140041 | | - /* 1360 */ 173, 174, 159, 158, 158, 173, 174, 159, 178, 97, |
| 140042 | | - /* 1370 */ 175, 63, 175, 106, 175, 125, 217, 183, 178, 175, |
| 140043 | | - /* 1380 */ 107, 159, 22, 216, 177, 175, 217, 175, 175, 217, |
| 140044 | | - /* 1390 */ 216, 159, 216, 216, 183, 225, 217, 137, 227, 178, |
| 140045 | | - /* 1400 */ 94, 178, 126, 129, 25, 128, 127, 162, 206, 26, |
| 140046 | | - /* 1410 */ 161, 230, 230, 13, 153, 153, 6, 151, 203, 205, |
| 140047 | | - /* 1420 */ 204, 202, 151, 165, 171, 171, 151, 171, 165, 165, |
| 140048 | | - /* 1430 */ 171, 179, 4, 250, 179, 250, 247, 3, 22, 171, |
| 140049 | | - /* 1440 */ 171, 171, 142, 81, 15, 23, 16, 23, 131, 171, |
| 140050 | | - /* 1450 */ 120, 111, 123, 20, 16, 1, 125, 123, 131, 53, |
| 140051 | | - /* 1460 */ 53, 53, 53, 111, 96, 34, 122, 1, 5, 22, |
| 140052 | | - /* 1470 */ 107, 67, 140, 74, 26, 24, 41, 107, 67, 20, |
| 140053 | | - /* 1480 */ 19, 112, 105, 66, 22, 66, 22, 22, 28, 66, |
| 140054 | | - /* 1490 */ 23, 22, 22, 37, 23, 23, 23, 116, 22, 22, |
| 140055 | | - /* 1500 */ 26, 23, 122, 23, 23, 26, 22, 11, 96, 34, |
| 140056 | | - /* 1510 */ 124, 26, 26, 23, 23, 23, 34, 34, 23, 26, |
| 140057 | | - /* 1520 */ 23, 22, 24, 23, 22, 122, 23, 26, 22, 24, |
| 140058 | | - /* 1530 */ 23, 22, 15, 23, 23, 22, 122, 122, 23, 1, |
| 140059 | | - /* 1540 */ 122, 252, 252, 252, 252, 252, 252, 252, 252, 252, |
| 140060 | | - /* 1550 */ 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, |
| 140061 | | - /* 1560 */ 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, |
| 140357 | + /* 840 */ 57, 19, 20, 101, 22, 195, 196, 22, 19, 24, |
| 140358 | + /* 850 */ 163, 19, 7, 8, 112, 59, 23, 207, 36, 26, |
| 140359 | + /* 860 */ 23, 152, 59, 26, 21, 59, 152, 84, 85, 86, |
| 140360 | + /* 870 */ 87, 88, 89, 90, 91, 92, 93, 94, 232, 221, |
| 140361 | + /* 880 */ 94, 59, 195, 196, 59, 99, 100, 101, 102, 103, |
| 140362 | + /* 890 */ 104, 105, 70, 97, 207, 59, 19, 20, 112, 22, |
| 140363 | + /* 900 */ 97, 79, 152, 97, 82, 152, 152, 71, 221, 90, |
| 140364 | + /* 910 */ 88, 89, 23, 36, 12, 26, 163, 95, 96, 97, |
| 140365 | + /* 920 */ 98, 78, 97, 101, 152, 96, 173, 174, 96, 27, |
| 140366 | + /* 930 */ 182, 22, 96, 97, 98, 116, 59, 148, 149, 152, |
| 140367 | + /* 940 */ 121, 119, 120, 154, 42, 156, 103, 70, 195, 196, |
| 140368 | + /* 950 */ 22, 59, 163, 152, 132, 133, 134, 135, 136, 82, |
| 140369 | + /* 960 */ 207, 208, 209, 71, 62, 88, 89, 90, 59, 152, |
| 140370 | + /* 970 */ 152, 12, 95, 96, 97, 98, 19, 20, 101, 22, |
| 140371 | + /* 980 */ 22, 182, 152, 140, 195, 196, 27, 59, 96, 97, |
| 140372 | + /* 990 */ 98, 59, 132, 36, 134, 22, 207, 19, 20, 24, |
| 140373 | + /* 1000 */ 22, 42, 152, 173, 174, 96, 97, 98, 219, 132, |
| 140374 | + /* 1010 */ 133, 134, 135, 136, 36, 152, 59, 187, 132, 152, |
| 140375 | + /* 1020 */ 134, 62, 152, 152, 96, 97, 98, 70, 96, 97, |
| 140376 | + /* 1030 */ 98, 72, 59, 152, 59, 246, 26, 59, 214, 82, |
| 140377 | + /* 1040 */ 152, 192, 152, 173, 174, 88, 89, 79, 70, 152, |
| 140378 | + /* 1050 */ 152, 19, 95, 96, 97, 98, 124, 187, 101, 23, |
| 140379 | + /* 1060 */ 82, 164, 26, 173, 174, 152, 88, 89, 100, 96, |
| 140380 | + /* 1070 */ 97, 98, 97, 95, 96, 97, 98, 187, 46, 101, |
| 140381 | + /* 1080 */ 122, 184, 152, 186, 211, 152, 152, 119, 120, 132, |
| 140382 | + /* 1090 */ 133, 134, 135, 136, 152, 5, 22, 152, 152, 35, |
| 140383 | + /* 1100 */ 10, 11, 12, 13, 14, 152, 152, 17, 98, 235, |
| 140384 | + /* 1110 */ 132, 133, 134, 135, 136, 54, 55, 56, 57, 58, |
| 140385 | + /* 1120 */ 30, 152, 32, 152, 152, 198, 173, 174, 152, 65, |
| 140386 | + /* 1130 */ 40, 152, 152, 59, 124, 152, 236, 73, 199, 107, |
| 140387 | + /* 1140 */ 187, 171, 173, 174, 112, 84, 85, 86, 87, 88, |
| 140388 | + /* 1150 */ 89, 90, 91, 92, 93, 94, 173, 174, 152, 69, |
| 140389 | + /* 1160 */ 152, 211, 54, 55, 56, 57, 76, 152, 150, 79, |
| 140390 | + /* 1170 */ 80, 97, 211, 211, 211, 111, 59, 241, 241, 173, |
| 140391 | + /* 1180 */ 174, 173, 174, 202, 202, 185, 177, 176, 173, 174, |
| 140392 | + /* 1190 */ 176, 201, 84, 85, 86, 87, 88, 89, 90, 91, |
| 140393 | + /* 1200 */ 92, 93, 94, 215, 114, 88, 89, 152, 215, 119, |
| 140394 | + /* 1210 */ 120, 152, 181, 96, 97, 98, 176, 100, 215, 152, |
| 140395 | + /* 1220 */ 229, 152, 163, 152, 107, 199, 109, 155, 173, 174, |
| 140396 | + /* 1230 */ 245, 141, 173, 174, 60, 159, 152, 122, 159, 242, |
| 140397 | + /* 1240 */ 173, 174, 173, 174, 173, 174, 38, 242, 152, 132, |
| 140398 | + /* 1250 */ 159, 134, 152, 22, 195, 196, 152, 173, 174, 222, |
| 140399 | + /* 1260 */ 43, 130, 202, 152, 18, 152, 207, 208, 152, 173, |
| 140400 | + /* 1270 */ 174, 152, 190, 173, 174, 152, 193, 173, 174, 152, |
| 140401 | + /* 1280 */ 193, 193, 152, 159, 173, 174, 173, 174, 152, 173, |
| 140402 | + /* 1290 */ 174, 193, 173, 174, 18, 152, 173, 174, 152, 158, |
| 140403 | + /* 1300 */ 173, 174, 152, 173, 174, 152, 159, 152, 202, 173, |
| 140404 | + /* 1310 */ 174, 152, 190, 152, 222, 152, 173, 174, 152, 173, |
| 140405 | + /* 1320 */ 174, 137, 152, 173, 174, 190, 173, 174, 173, 174, |
| 140406 | + /* 1330 */ 202, 158, 173, 174, 173, 174, 173, 174, 61, 173, |
| 140407 | + /* 1340 */ 174, 152, 237, 173, 174, 152, 159, 152, 238, 152, |
| 140408 | + /* 1350 */ 158, 152, 22, 152, 178, 152, 158, 152, 158, 152, |
| 140409 | + /* 1360 */ 178, 159, 173, 174, 152, 159, 173, 174, 173, 174, |
| 140410 | + /* 1370 */ 173, 174, 173, 174, 173, 174, 173, 174, 173, 174, |
| 140411 | + /* 1380 */ 173, 174, 152, 63, 152, 173, 174, 107, 175, 175, |
| 140412 | + /* 1390 */ 175, 106, 183, 175, 178, 175, 177, 175, 175, 178, |
| 140413 | + /* 1400 */ 94, 107, 231, 173, 174, 173, 174, 183, 231, 125, |
| 140414 | + /* 1410 */ 216, 178, 159, 217, 22, 159, 226, 129, 137, 228, |
| 140415 | + /* 1420 */ 128, 217, 126, 25, 127, 162, 216, 26, 217, 161, |
| 140416 | + /* 1430 */ 13, 153, 153, 206, 205, 6, 251, 202, 204, 203, |
| 140417 | + /* 1440 */ 151, 216, 151, 217, 216, 171, 151, 165, 179, 179, |
| 140418 | + /* 1450 */ 4, 3, 22, 142, 171, 165, 15, 171, 171, 81, |
| 140419 | + /* 1460 */ 16, 23, 23, 120, 171, 131, 165, 111, 123, 171, |
| 140420 | + /* 1470 */ 171, 171, 20, 125, 16, 1, 123, 131, 53, 53, |
| 140421 | + /* 1480 */ 53, 53, 111, 96, 34, 122, 248, 1, 251, 5, |
| 140422 | + /* 1490 */ 22, 107, 140, 26, 74, 41, 122, 107, 67, 67, |
| 140423 | + /* 1500 */ 24, 20, 19, 112, 105, 23, 66, 22, 66, 22, |
| 140424 | + /* 1510 */ 22, 22, 37, 22, 22, 66, 23, 23, 28, 23, |
| 140425 | + /* 1520 */ 23, 26, 24, 23, 22, 24, 122, 23, 23, 96, |
| 140426 | + /* 1530 */ 22, 124, 26, 34, 23, 26, 23, 34, 23, 23, |
| 140427 | + /* 1540 */ 23, 34, 23, 22, 26, 11, 22, 22, 26, 23, |
| 140428 | + /* 1550 */ 23, 22, 116, 23, 22, 15, 122, 122, 23, 122, |
| 140429 | + /* 1560 */ 1, 252, 252, 252, 252, 122, 252, 252, 252, 252, |
| 140062 | 140430 | /* 1570 */ 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, |
| 140063 | 140431 | /* 1580 */ 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, |
| 140064 | 140432 | /* 1590 */ 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, |
| 140065 | 140433 | /* 1600 */ 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, |
| 140066 | 140434 | /* 1610 */ 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, |
| | @@ -140068,151 +140436,156 @@ |
| 140068 | 140436 | /* 1630 */ 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, |
| 140069 | 140437 | /* 1640 */ 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, |
| 140070 | 140438 | /* 1650 */ 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, |
| 140071 | 140439 | /* 1660 */ 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, |
| 140072 | 140440 | /* 1670 */ 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, |
| 140073 | | - /* 1680 */ 252, 252, 252, 252, |
| 140441 | + /* 1680 */ 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, |
| 140442 | + /* 1690 */ 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, |
| 140443 | + /* 1700 */ 252, 252, 252, 252, 252, 252, 252, 252, 252, |
| 140074 | 140444 | }; |
| 140075 | | -#define YY_SHIFT_COUNT (465) |
| 140445 | +#define YY_SHIFT_COUNT (471) |
| 140076 | 140446 | #define YY_SHIFT_MIN (0) |
| 140077 | | -#define YY_SHIFT_MAX (1538) |
| 140447 | +#define YY_SHIFT_MAX (1559) |
| 140078 | 140448 | static const unsigned short int yy_shift_ofst[] = { |
| 140079 | | - /* 0 */ 39, 822, 955, 843, 997, 997, 997, 997, 0, 0, |
| 140080 | | - /* 10 */ 104, 630, 997, 997, 997, 997, 997, 997, 997, 1077, |
| 140081 | | - /* 20 */ 1077, 126, 161, 155, 52, 156, 208, 260, 312, 364, |
| 140082 | | - /* 30 */ 416, 468, 523, 578, 630, 630, 630, 630, 630, 630, |
| 140083 | | - /* 40 */ 630, 630, 630, 630, 630, 630, 630, 630, 630, 630, |
| 140084 | | - /* 50 */ 630, 682, 630, 733, 783, 783, 914, 997, 997, 997, |
| 140085 | | - /* 60 */ 997, 997, 997, 997, 997, 997, 997, 997, 997, 997, |
| 140086 | | - /* 70 */ 997, 997, 997, 997, 997, 997, 997, 997, 997, 997, |
| 140087 | | - /* 80 */ 997, 997, 997, 997, 997, 997, 997, 997, 1017, 997, |
| 140088 | | - /* 90 */ 997, 997, 997, 997, 997, 997, 997, 997, 997, 997, |
| 140089 | | - /* 100 */ 997, 997, 1070, 1054, 1054, 1054, 1054, 1054, 40, 25, |
| 140090 | | - /* 110 */ 72, 232, 788, 428, 248, 248, 232, 581, 367, 127, |
| 140091 | | - /* 120 */ 465, 138, 1541, 1541, 1541, 784, 784, 784, 522, 522, |
| 140092 | | - /* 130 */ 887, 887, 893, 406, 408, 232, 232, 232, 232, 232, |
| 140093 | | - /* 140 */ 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, |
| 140094 | | - /* 150 */ 232, 232, 232, 232, 232, 370, 340, 714, 698, 698, |
| 140095 | | - /* 160 */ 465, 89, 89, 89, 89, 89, 89, 1541, 1541, 1541, |
| 140096 | | - /* 170 */ 504, 85, 85, 884, 70, 280, 902, 440, 966, 924, |
| 140097 | | - /* 180 */ 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, |
| 140098 | | - /* 190 */ 232, 232, 232, 232, 232, 232, 1134, 1134, 1134, 232, |
| 140099 | | - /* 200 */ 232, 667, 232, 232, 232, 929, 232, 232, 885, 232, |
| 140100 | | - /* 210 */ 232, 232, 232, 232, 232, 232, 232, 232, 232, 418, |
| 140101 | | - /* 220 */ 678, 981, 981, 981, 981, 766, 271, 911, 510, 429, |
| 140102 | | - /* 230 */ 617, 786, 786, 830, 617, 830, 4, 730, 595, 768, |
| 140103 | | - /* 240 */ 786, 561, 768, 768, 732, 535, 55, 1165, 1105, 1105, |
| 140104 | | - /* 250 */ 1191, 1191, 1105, 1228, 1209, 1130, 1257, 1257, 1257, 1257, |
| 140105 | | - /* 260 */ 1105, 1280, 1130, 1228, 1209, 1209, 1130, 1105, 1280, 1198, |
| 140106 | | - /* 270 */ 1282, 1105, 1105, 1280, 1328, 1105, 1280, 1105, 1280, 1328, |
| 140107 | | - /* 280 */ 1244, 1244, 1244, 1308, 1328, 1244, 1267, 1244, 1308, 1244, |
| 140108 | | - /* 290 */ 1244, 1250, 1273, 1250, 1273, 1250, 1273, 1250, 1273, 1105, |
| 140109 | | - /* 300 */ 1360, 1105, 1260, 1328, 1306, 1306, 1328, 1274, 1276, 1277, |
| 140110 | | - /* 310 */ 1279, 1130, 1379, 1383, 1400, 1400, 1410, 1410, 1410, 1541, |
| 140111 | | - /* 320 */ 1541, 1541, 1541, 1541, 1541, 1541, 1541, 1541, 1541, 1541, |
| 140112 | | - /* 330 */ 1541, 1541, 1541, 1541, 1541, 34, 407, 463, 511, 417, |
| 140113 | | - /* 340 */ 479, 1272, 778, 941, 785, 825, 831, 833, 872, 877, |
| 140114 | | - /* 350 */ 756, 793, 900, 804, 919, 1045, 969, 1049, 803, 909, |
| 140115 | | - /* 360 */ 1051, 983, 1059, 1428, 1434, 1416, 1300, 1429, 1362, 1430, |
| 140116 | | - /* 370 */ 1422, 1424, 1330, 1317, 1340, 1329, 1433, 1331, 1438, 1454, |
| 140117 | | - /* 380 */ 1334, 1327, 1406, 1407, 1408, 1409, 1352, 1368, 1431, 1344, |
| 140118 | | - /* 390 */ 1466, 1463, 1447, 1363, 1332, 1404, 1448, 1411, 1399, 1435, |
| 140119 | | - /* 400 */ 1370, 1451, 1459, 1461, 1369, 1377, 1462, 1417, 1464, 1465, |
| 140120 | | - /* 410 */ 1467, 1469, 1419, 1460, 1470, 1423, 1456, 1471, 1472, 1473, |
| 140121 | | - /* 420 */ 1474, 1381, 1476, 1478, 1477, 1479, 1380, 1480, 1481, 1412, |
| 140122 | | - /* 430 */ 1475, 1484, 1386, 1485, 1482, 1486, 1483, 1490, 1485, 1491, |
| 140123 | | - /* 440 */ 1492, 1495, 1493, 1497, 1499, 1496, 1500, 1502, 1498, 1501, |
| 140124 | | - /* 450 */ 1503, 1506, 1505, 1501, 1507, 1509, 1510, 1511, 1513, 1403, |
| 140125 | | - /* 460 */ 1414, 1415, 1418, 1515, 1517, 1538, |
| 140126 | | -}; |
| 140127 | | -#define YY_REDUCE_COUNT (334) |
| 140128 | | -#define YY_REDUCE_MIN (-217) |
| 140129 | | -#define YY_REDUCE_MAX (1278) |
| 140449 | + /* 0 */ 182, 1090, 822, 822, 306, 957, 957, 957, 957, 210, |
| 140450 | + /* 10 */ 0, 0, 104, 630, 957, 957, 957, 957, 957, 957, |
| 140451 | + /* 20 */ 957, 1117, 1117, 126, 968, 306, 306, 306, 306, 306, |
| 140452 | + /* 30 */ 306, 52, 156, 208, 260, 312, 364, 416, 468, 523, |
| 140453 | + /* 40 */ 578, 630, 630, 630, 630, 630, 630, 630, 630, 630, |
| 140454 | + /* 50 */ 630, 630, 630, 630, 630, 630, 630, 630, 682, 630, |
| 140455 | + /* 60 */ 733, 783, 783, 877, 957, 957, 957, 957, 957, 957, |
| 140456 | + /* 70 */ 957, 957, 957, 957, 957, 957, 957, 957, 957, 957, |
| 140457 | + /* 80 */ 957, 957, 957, 957, 957, 957, 957, 957, 957, 957, |
| 140458 | + /* 90 */ 957, 957, 957, 957, 957, 978, 957, 957, 957, 957, |
| 140459 | + /* 100 */ 957, 957, 957, 957, 957, 957, 957, 957, 957, 1061, |
| 140460 | + /* 110 */ 1108, 1108, 1108, 1108, 1108, 40, 127, 20, 280, 843, |
| 140461 | + /* 120 */ 1032, 144, 144, 280, 310, 310, 310, 310, 59, 191, |
| 140462 | + /* 130 */ 69, 1566, 1566, 1566, 786, 786, 786, 522, 836, 522, |
| 140463 | + /* 140 */ 959, 959, 892, 155, 358, 280, 280, 280, 280, 280, |
| 140464 | + /* 150 */ 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, |
| 140465 | + /* 160 */ 280, 280, 280, 280, 280, 280, 371, 388, 645, 645, |
| 140466 | + /* 170 */ 531, 1566, 1566, 1566, 504, 189, 189, 909, 63, 176, |
| 140467 | + /* 180 */ 928, 440, 932, 973, 280, 280, 280, 280, 280, 314, |
| 140468 | + /* 190 */ 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, |
| 140469 | + /* 200 */ 280, 280, 1064, 1064, 1064, 280, 280, 280, 280, 667, |
| 140470 | + /* 210 */ 280, 280, 280, 825, 280, 280, 902, 280, 280, 280, |
| 140471 | + /* 220 */ 280, 280, 280, 280, 280, 383, 676, 325, 975, 975, |
| 140472 | + /* 230 */ 975, 975, 1010, 325, 325, 819, 349, 524, 569, 829, |
| 140473 | + /* 240 */ 829, 832, 569, 832, 686, 51, 656, 303, 303, 303, |
| 140474 | + /* 250 */ 829, 294, 520, 628, 474, 1174, 1115, 1115, 1208, 1208, |
| 140475 | + /* 260 */ 1115, 1231, 1217, 1131, 1246, 1246, 1246, 1246, 1115, 1276, |
| 140476 | + /* 270 */ 1131, 1231, 1217, 1217, 1131, 1115, 1276, 1184, 1277, 1115, |
| 140477 | + /* 280 */ 1276, 1330, 1115, 1276, 1115, 1276, 1330, 1280, 1280, 1280, |
| 140478 | + /* 290 */ 1320, 1330, 1280, 1285, 1280, 1320, 1280, 1280, 1330, 1306, |
| 140479 | + /* 300 */ 1306, 1330, 1284, 1294, 1284, 1294, 1284, 1294, 1284, 1294, |
| 140480 | + /* 310 */ 1115, 1392, 1115, 1281, 1288, 1296, 1292, 1297, 1131, 1398, |
| 140481 | + /* 320 */ 1401, 1417, 1417, 1429, 1429, 1429, 1566, 1566, 1566, 1566, |
| 140482 | + /* 330 */ 1566, 1566, 1566, 1566, 1566, 1566, 1566, 1566, 1566, 1566, |
| 140483 | + /* 340 */ 1566, 1566, 34, 357, 38, 462, 514, 484, 1074, 727, |
| 140484 | + /* 350 */ 740, 734, 735, 777, 778, 784, 788, 803, 694, 845, |
| 140485 | + /* 360 */ 742, 796, 833, 837, 889, 860, 886, 1036, 806, 958, |
| 140486 | + /* 370 */ 1446, 1448, 1430, 1311, 1441, 1378, 1444, 1438, 1439, 1343, |
| 140487 | + /* 380 */ 1334, 1356, 1345, 1452, 1348, 1458, 1474, 1353, 1346, 1425, |
| 140488 | + /* 390 */ 1426, 1427, 1428, 1371, 1387, 1450, 1363, 1486, 1484, 1468, |
| 140489 | + /* 400 */ 1384, 1352, 1431, 1467, 1432, 1420, 1454, 1374, 1390, 1476, |
| 140490 | + /* 410 */ 1481, 1483, 1391, 1399, 1485, 1440, 1487, 1488, 1482, 1489, |
| 140491 | + /* 420 */ 1442, 1490, 1491, 1449, 1475, 1493, 1494, 1496, 1495, 1497, |
| 140492 | + /* 430 */ 1492, 1498, 1500, 1502, 1501, 1404, 1504, 1505, 1433, 1499, |
| 140493 | + /* 440 */ 1508, 1407, 1506, 1503, 1509, 1507, 1511, 1513, 1515, 1506, |
| 140494 | + /* 450 */ 1516, 1517, 1518, 1519, 1521, 1534, 1524, 1525, 1526, 1527, |
| 140495 | + /* 460 */ 1529, 1530, 1532, 1522, 1436, 1434, 1435, 1437, 1443, 1535, |
| 140496 | + /* 470 */ 1540, 1559, |
| 140497 | +}; |
| 140498 | +#define YY_REDUCE_COUNT (341) |
| 140499 | +#define YY_REDUCE_MIN (-211) |
| 140500 | +#define YY_REDUCE_MAX (1301) |
| 140130 | 140501 | static const short yy_reduce_ofst[] = { |
| 140131 | | - /* 0 */ -144, -139, -134, -136, -141, 64, 114, 116, -158, -148, |
| 140132 | | - /* 10 */ -217, 96, 819, 871, 878, 219, 270, 886, 272, -110, |
| 140133 | | - /* 20 */ 413, 918, 972, 228, -214, -214, -214, -214, -214, -214, |
| 140134 | | - /* 30 */ -214, -214, -214, -214, -214, -214, -214, -214, -214, -214, |
| 140135 | | - /* 40 */ -214, -214, -214, -214, -214, -214, -214, -214, -214, -214, |
| 140136 | | - /* 50 */ -214, -214, -214, -214, -214, -214, 62, 323, 377, 536, |
| 140137 | | - /* 60 */ 539, 834, 948, 1020, 1024, 1031, 1039, 1048, 1050, 1063, |
| 140138 | | - /* 70 */ 1065, 1068, 1074, 1080, 1083, 1088, 1091, 1094, 1097, 1099, |
| 140139 | | - /* 80 */ 1103, 1106, 1111, 1114, 1122, 1126, 1129, 1131, 1137, 1139, |
| 140140 | | - /* 90 */ 1141, 1145, 1149, 1154, 1156, 1164, 1168, 1173, 1180, 1184, |
| 140141 | | - /* 100 */ 1187, 1192, -214, -214, -214, -214, -214, -214, -214, -214, |
| 140142 | | - /* 110 */ -214, 132, -45, 97, 8, 164, 379, 175, 255, -214, |
| 140143 | | - /* 120 */ 178, -214, -214, -214, -214, -168, -168, -168, 124, 329, |
| 140144 | | - /* 130 */ 399, 401, -129, 347, 347, 331, 133, 451, 452, 498, |
| 140145 | | - /* 140 */ 500, 502, 503, 505, 487, 506, 488, 490, 507, 543, |
| 140146 | | - /* 150 */ 547, -126, 588, 290, 27, 572, 501, 597, 537, 582, |
| 140147 | | - /* 160 */ 183, 599, 600, 601, 649, 650, 653, 508, 538, -29, |
| 140148 | | - /* 170 */ -156, -152, -137, -79, 135, 74, 130, 242, 338, 378, |
| 140149 | | - /* 180 */ 393, 397, 607, 648, 691, 700, 708, 709, 728, 757, |
| 140150 | | - /* 190 */ 763, 769, 796, 810, 818, 845, 202, 748, 792, 861, |
| 140151 | | - /* 200 */ 862, 815, 866, 903, 905, 850, 931, 932, 896, 937, |
| 140152 | | - /* 210 */ 939, 945, 74, 949, 951, 964, 965, 967, 968, 888, |
| 140153 | | - /* 220 */ 820, 923, 926, 959, 960, 815, 980, 908, 1009, 985, |
| 140154 | | - /* 230 */ 986, 970, 974, 942, 988, 947, 1018, 1011, 1022, 1025, |
| 140155 | | - /* 240 */ 991, 982, 1032, 1038, 1015, 1019, 1064, 984, 1071, 1072, |
| 140156 | | - /* 250 */ 992, 993, 1085, 1061, 1069, 1067, 1093, 1116, 1124, 1128, |
| 140157 | | - /* 260 */ 1133, 1132, 1138, 1086, 1136, 1143, 1146, 1175, 1166, 1108, |
| 140158 | | - /* 270 */ 1113, 1193, 1196, 1201, 1178, 1203, 1205, 1208, 1206, 1190, |
| 140159 | | - /* 280 */ 1195, 1197, 1199, 1194, 1200, 1204, 1207, 1210, 1211, 1212, |
| 140160 | | - /* 290 */ 1213, 1159, 1167, 1169, 1174, 1172, 1176, 1179, 1177, 1222, |
| 140161 | | - /* 300 */ 1170, 1232, 1171, 1221, 1181, 1182, 1223, 1202, 1214, 1216, |
| 140162 | | - /* 310 */ 1215, 1219, 1245, 1249, 1261, 1262, 1266, 1271, 1275, 1183, |
| 140163 | | - /* 320 */ 1185, 1189, 1258, 1253, 1254, 1256, 1259, 1263, 1252, 1255, |
| 140164 | | - /* 330 */ 1268, 1269, 1270, 1278, 1264, |
| 140502 | + /* 0 */ -143, 789, 753, 1059, -137, -146, -144, -141, -136, 687, |
| 140503 | + /* 10 */ -107, 101, -203, -52, 830, 870, 890, 167, 953, 218, |
| 140504 | + /* 20 */ 220, 413, 646, 897, 73, 281, 283, 332, 496, 601, |
| 140505 | + /* 30 */ 650, -211, -211, -211, -211, -211, -211, -211, -211, -211, |
| 140506 | + /* 40 */ -211, -211, -211, -211, -211, -211, -211, -211, -211, -211, |
| 140507 | + /* 50 */ -211, -211, -211, -211, -211, -211, -211, -211, -211, -211, |
| 140508 | + /* 60 */ -211, -211, -211, 374, 377, 537, 969, 983, 1006, 1008, |
| 140509 | + /* 70 */ 1015, 1055, 1067, 1069, 1071, 1084, 1096, 1100, 1104, 1111, |
| 140510 | + /* 80 */ 1113, 1116, 1119, 1123, 1127, 1130, 1136, 1143, 1146, 1150, |
| 140511 | + /* 90 */ 1153, 1155, 1159, 1161, 1163, 1166, 1170, 1189, 1193, 1195, |
| 140512 | + /* 100 */ 1197, 1199, 1201, 1203, 1205, 1207, 1212, 1230, 1232, -211, |
| 140513 | + /* 110 */ -211, -211, -211, -211, -211, -211, -211, -211, -30, 427, |
| 140514 | + /* 120 */ -171, -145, -134, 22, 279, 287, 279, 287, 99, -211, |
| 140515 | + /* 130 */ -211, -211, -211, -211, -165, -165, -165, 123, 135, 175, |
| 140516 | + /* 140 */ -150, 396, 337, 291, 291, -147, 185, 391, 446, 444, |
| 140517 | + /* 150 */ 452, 500, 501, 502, 27, -152, 295, 438, 490, 503, |
| 140518 | + /* 160 */ 495, 506, -73, 447, 451, 536, 570, 551, 540, 579, |
| 140519 | + /* 170 */ 30, 508, 535, 81, 14, 61, 115, 168, 142, 222, |
| 140520 | + /* 180 */ 275, 284, 397, 599, 607, 647, 654, 660, 709, 658, |
| 140521 | + /* 190 */ 714, 750, 754, 772, 787, 801, 817, 818, 850, 863, |
| 140522 | + /* 200 */ 867, 871, 466, 748, 799, 881, 888, 898, 913, 824, |
| 140523 | + /* 210 */ 930, 933, 934, 873, 942, 945, 849, 946, 222, 954, |
| 140524 | + /* 220 */ 971, 972, 976, 979, 980, 900, 874, 927, 950, 961, |
| 140525 | + /* 230 */ 962, 963, 824, 927, 927, 939, 970, 1018, 981, 988, |
| 140526 | + /* 240 */ 993, 936, 982, 937, 1009, 1000, 1031, 1011, 1014, 1040, |
| 140527 | + /* 250 */ 1003, 991, 990, 1026, 1072, 985, 1076, 1079, 997, 1005, |
| 140528 | + /* 260 */ 1091, 1037, 1082, 1060, 1083, 1087, 1088, 1098, 1124, 1141, |
| 140529 | + /* 270 */ 1106, 1092, 1122, 1135, 1128, 1147, 1173, 1110, 1105, 1187, |
| 140530 | + /* 280 */ 1192, 1176, 1202, 1198, 1206, 1200, 1182, 1213, 1214, 1215, |
| 140531 | + /* 290 */ 1209, 1216, 1218, 1219, 1220, 1224, 1222, 1223, 1221, 1171, |
| 140532 | + /* 300 */ 1177, 1233, 1196, 1194, 1204, 1210, 1211, 1225, 1226, 1228, |
| 140533 | + /* 310 */ 1253, 1190, 1256, 1191, 1227, 1229, 1234, 1236, 1235, 1263, |
| 140534 | + /* 320 */ 1268, 1278, 1279, 1289, 1291, 1295, 1185, 1237, 1238, 1282, |
| 140535 | + /* 330 */ 1274, 1283, 1286, 1287, 1290, 1269, 1270, 1293, 1298, 1299, |
| 140536 | + /* 340 */ 1300, 1301, |
| 140165 | 140537 | }; |
| 140166 | 140538 | static const YYACTIONTYPE yy_default[] = { |
| 140167 | | - /* 0 */ 1286, 1276, 1276, 1276, 1209, 1209, 1209, 1209, 1133, 1133, |
| 140168 | | - /* 10 */ 1260, 1036, 1005, 1005, 1005, 1005, 1005, 1005, 1208, 1005, |
| 140169 | | - /* 20 */ 1005, 1005, 1005, 1108, 1139, 1005, 1005, 1005, 1005, 1210, |
| 140170 | | - /* 30 */ 1211, 1005, 1005, 1005, 1259, 1261, 1149, 1148, 1147, 1146, |
| 140171 | | - /* 40 */ 1242, 1120, 1144, 1137, 1141, 1210, 1204, 1205, 1203, 1207, |
| 140172 | | - /* 50 */ 1211, 1005, 1140, 1174, 1188, 1173, 1005, 1005, 1005, 1005, |
| 140173 | | - /* 60 */ 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005, |
| 140174 | | - /* 70 */ 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005, |
| 140175 | | - /* 80 */ 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005, |
| 140176 | | - /* 90 */ 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005, |
| 140177 | | - /* 100 */ 1005, 1005, 1182, 1187, 1194, 1186, 1183, 1176, 1175, 1177, |
| 140178 | | - /* 110 */ 1178, 1005, 1026, 1075, 1005, 1005, 1005, 1276, 1036, 1179, |
| 140179 | | - /* 120 */ 1005, 1180, 1191, 1190, 1189, 1267, 1294, 1293, 1005, 1005, |
| 140180 | | - /* 130 */ 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005, |
| 140181 | | - /* 140 */ 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005, |
| 140182 | | - /* 150 */ 1005, 1005, 1005, 1005, 1005, 1036, 1286, 1276, 1032, 1032, |
| 140183 | | - /* 160 */ 1005, 1276, 1276, 1276, 1276, 1276, 1276, 1272, 1108, 1099, |
| 140184 | | - /* 170 */ 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005, |
| 140185 | | - /* 180 */ 1005, 1264, 1262, 1005, 1224, 1005, 1005, 1005, 1005, 1005, |
| 140186 | | - /* 190 */ 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005, |
| 140187 | | - /* 200 */ 1005, 1005, 1005, 1005, 1005, 1104, 1005, 1005, 1005, 1005, |
| 140188 | | - /* 210 */ 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1288, 1005, |
| 140189 | | - /* 220 */ 1237, 1104, 1104, 1104, 1104, 1106, 1088, 1098, 1036, 1012, |
| 140190 | | - /* 230 */ 1143, 1122, 1122, 1327, 1143, 1327, 1050, 1308, 1047, 1133, |
| 140191 | | - /* 240 */ 1122, 1206, 1133, 1133, 1105, 1098, 1005, 1330, 1113, 1113, |
| 140192 | | - /* 250 */ 1329, 1329, 1113, 1154, 1078, 1143, 1084, 1084, 1084, 1084, |
| 140193 | | - /* 260 */ 1113, 1023, 1143, 1154, 1078, 1078, 1143, 1113, 1023, 1241, |
| 140194 | | - /* 270 */ 1324, 1113, 1113, 1023, 1217, 1113, 1023, 1113, 1023, 1217, |
| 140195 | | - /* 280 */ 1076, 1076, 1076, 1065, 1217, 1076, 1050, 1076, 1065, 1076, |
| 140196 | | - /* 290 */ 1076, 1126, 1121, 1126, 1121, 1126, 1121, 1126, 1121, 1113, |
| 140197 | | - /* 300 */ 1212, 1113, 1005, 1217, 1221, 1221, 1217, 1138, 1127, 1136, |
| 140198 | | - /* 310 */ 1134, 1143, 1029, 1068, 1291, 1291, 1287, 1287, 1287, 1335, |
| 140199 | | - /* 320 */ 1335, 1272, 1303, 1036, 1036, 1036, 1036, 1303, 1052, 1052, |
| 140200 | | - /* 330 */ 1036, 1036, 1036, 1036, 1303, 1005, 1005, 1005, 1005, 1005, |
| 140201 | | - /* 340 */ 1005, 1298, 1005, 1226, 1005, 1005, 1005, 1005, 1005, 1005, |
| 140202 | | - /* 350 */ 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005, |
| 140203 | | - /* 360 */ 1005, 1005, 1159, 1005, 1008, 1269, 1005, 1005, 1268, 1005, |
| 140204 | | - /* 370 */ 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005, |
| 140205 | | - /* 380 */ 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1326, |
| 140206 | | - /* 390 */ 1005, 1005, 1005, 1005, 1005, 1005, 1240, 1239, 1005, 1005, |
| 140207 | | - /* 400 */ 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005, |
| 140208 | | - /* 410 */ 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005, |
| 140209 | | - /* 420 */ 1005, 1090, 1005, 1005, 1005, 1312, 1005, 1005, 1005, 1005, |
| 140210 | | - /* 430 */ 1005, 1005, 1005, 1135, 1005, 1128, 1005, 1005, 1317, 1005, |
| 140211 | | - /* 440 */ 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1278, |
| 140212 | | - /* 450 */ 1005, 1005, 1005, 1277, 1005, 1005, 1005, 1005, 1005, 1161, |
| 140213 | | - /* 460 */ 1005, 1160, 1164, 1005, 1017, 1005, |
| 140539 | + /* 0 */ 1297, 1349, 1221, 1014, 1119, 1221, 1221, 1221, 1221, 1014, |
| 140540 | + /* 10 */ 1145, 1145, 1272, 1045, 1014, 1014, 1014, 1014, 1014, 1220, |
| 140541 | + /* 20 */ 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, |
| 140542 | + /* 30 */ 1014, 1151, 1014, 1014, 1014, 1014, 1222, 1223, 1014, 1014, |
| 140543 | + /* 40 */ 1014, 1271, 1273, 1161, 1160, 1159, 1158, 1254, 1132, 1156, |
| 140544 | + /* 50 */ 1149, 1153, 1216, 1217, 1215, 1219, 1222, 1223, 1014, 1152, |
| 140545 | + /* 60 */ 1186, 1200, 1185, 1014, 1014, 1014, 1014, 1014, 1014, 1014, |
| 140546 | + /* 70 */ 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, |
| 140547 | + /* 80 */ 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, |
| 140548 | + /* 90 */ 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, |
| 140549 | + /* 100 */ 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1194, |
| 140550 | + /* 110 */ 1199, 1206, 1198, 1195, 1188, 1187, 1189, 1190, 1014, 1035, |
| 140551 | + /* 120 */ 1084, 1014, 1014, 1014, 1289, 1288, 1014, 1014, 1045, 1191, |
| 140552 | + /* 130 */ 1192, 1203, 1202, 1201, 1279, 1305, 1304, 1014, 1014, 1014, |
| 140553 | + /* 140 */ 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, |
| 140554 | + /* 150 */ 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, |
| 140555 | + /* 160 */ 1014, 1014, 1014, 1014, 1014, 1014, 1045, 1297, 1041, 1041, |
| 140556 | + /* 170 */ 1014, 1284, 1119, 1110, 1014, 1014, 1014, 1014, 1014, 1014, |
| 140557 | + /* 180 */ 1014, 1014, 1014, 1014, 1014, 1276, 1274, 1014, 1236, 1014, |
| 140558 | + /* 190 */ 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, |
| 140559 | + /* 200 */ 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, |
| 140560 | + /* 210 */ 1014, 1014, 1014, 1115, 1014, 1014, 1014, 1014, 1014, 1014, |
| 140561 | + /* 220 */ 1014, 1014, 1014, 1014, 1299, 1014, 1249, 1098, 1115, 1115, |
| 140562 | + /* 230 */ 1115, 1115, 1117, 1099, 1097, 1109, 1045, 1021, 1155, 1134, |
| 140563 | + /* 240 */ 1134, 1338, 1155, 1338, 1059, 1319, 1056, 1145, 1145, 1145, |
| 140564 | + /* 250 */ 1134, 1218, 1116, 1109, 1014, 1341, 1124, 1124, 1340, 1340, |
| 140565 | + /* 260 */ 1124, 1166, 1087, 1155, 1093, 1093, 1093, 1093, 1124, 1032, |
| 140566 | + /* 270 */ 1155, 1166, 1087, 1087, 1155, 1124, 1032, 1253, 1335, 1124, |
| 140567 | + /* 280 */ 1032, 1229, 1124, 1032, 1124, 1032, 1229, 1085, 1085, 1085, |
| 140568 | + /* 290 */ 1074, 1229, 1085, 1059, 1085, 1074, 1085, 1085, 1229, 1233, |
| 140569 | + /* 300 */ 1233, 1229, 1138, 1133, 1138, 1133, 1138, 1133, 1138, 1133, |
| 140570 | + /* 310 */ 1124, 1224, 1124, 1014, 1150, 1139, 1148, 1146, 1155, 1038, |
| 140571 | + /* 320 */ 1077, 1302, 1302, 1298, 1298, 1298, 1346, 1346, 1284, 1314, |
| 140572 | + /* 330 */ 1045, 1045, 1045, 1045, 1314, 1061, 1061, 1045, 1045, 1045, |
| 140573 | + /* 340 */ 1045, 1314, 1014, 1014, 1014, 1014, 1014, 1014, 1309, 1014, |
| 140574 | + /* 350 */ 1238, 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, |
| 140575 | + /* 360 */ 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1171, |
| 140576 | + /* 370 */ 1014, 1017, 1281, 1014, 1014, 1280, 1014, 1014, 1014, 1014, |
| 140577 | + /* 380 */ 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, |
| 140578 | + /* 390 */ 1014, 1014, 1014, 1014, 1014, 1014, 1337, 1014, 1014, 1014, |
| 140579 | + /* 400 */ 1014, 1014, 1014, 1252, 1251, 1014, 1014, 1126, 1014, 1014, |
| 140580 | + /* 410 */ 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, |
| 140581 | + /* 420 */ 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, |
| 140582 | + /* 430 */ 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, |
| 140583 | + /* 440 */ 1014, 1014, 1147, 1014, 1140, 1014, 1014, 1014, 1014, 1328, |
| 140584 | + /* 450 */ 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, |
| 140585 | + /* 460 */ 1014, 1014, 1014, 1323, 1101, 1173, 1014, 1172, 1176, 1014, |
| 140586 | + /* 470 */ 1026, 1014, |
| 140214 | 140587 | }; |
| 140215 | 140588 | /********** End of lemon-generated parsing tables *****************************/ |
| 140216 | 140589 | |
| 140217 | 140590 | /* The next table maps tokens (terminal symbols) into fallback tokens. |
| 140218 | 140591 | ** If a construct like the following: |
| | @@ -140594,11 +140967,11 @@ |
| 140594 | 140967 | /* 192 */ "raisetype", |
| 140595 | 140968 | /* 193 */ "ifexists", |
| 140596 | 140969 | /* 194 */ "fullname", |
| 140597 | 140970 | /* 195 */ "selectnowith", |
| 140598 | 140971 | /* 196 */ "oneselect", |
| 140599 | | - /* 197 */ "with", |
| 140972 | + /* 197 */ "wqlist", |
| 140600 | 140973 | /* 198 */ "multiselect_op", |
| 140601 | 140974 | /* 199 */ "distinct", |
| 140602 | 140975 | /* 200 */ "selcollist", |
| 140603 | 140976 | /* 201 */ "from", |
| 140604 | 140977 | /* 202 */ "where_opt", |
| | @@ -140616,43 +140989,43 @@ |
| 140616 | 140989 | /* 214 */ "joinop", |
| 140617 | 140990 | /* 215 */ "indexed_opt", |
| 140618 | 140991 | /* 216 */ "on_opt", |
| 140619 | 140992 | /* 217 */ "using_opt", |
| 140620 | 140993 | /* 218 */ "idlist", |
| 140621 | | - /* 219 */ "setlist", |
| 140622 | | - /* 220 */ "insert_cmd", |
| 140623 | | - /* 221 */ "idlist_opt", |
| 140624 | | - /* 222 */ "likeop", |
| 140625 | | - /* 223 */ "between_op", |
| 140626 | | - /* 224 */ "in_op", |
| 140627 | | - /* 225 */ "paren_exprlist", |
| 140628 | | - /* 226 */ "case_operand", |
| 140629 | | - /* 227 */ "case_exprlist", |
| 140630 | | - /* 228 */ "case_else", |
| 140631 | | - /* 229 */ "uniqueflag", |
| 140632 | | - /* 230 */ "collate", |
| 140633 | | - /* 231 */ "nmnum", |
| 140634 | | - /* 232 */ "trigger_decl", |
| 140635 | | - /* 233 */ "trigger_cmd_list", |
| 140636 | | - /* 234 */ "trigger_time", |
| 140637 | | - /* 235 */ "trigger_event", |
| 140638 | | - /* 236 */ "foreach_clause", |
| 140639 | | - /* 237 */ "when_clause", |
| 140640 | | - /* 238 */ "trigger_cmd", |
| 140641 | | - /* 239 */ "trnm", |
| 140642 | | - /* 240 */ "tridxby", |
| 140643 | | - /* 241 */ "database_kw_opt", |
| 140644 | | - /* 242 */ "key_opt", |
| 140645 | | - /* 243 */ "add_column_fullname", |
| 140646 | | - /* 244 */ "kwcolumn_opt", |
| 140647 | | - /* 245 */ "create_vtab", |
| 140648 | | - /* 246 */ "vtabarglist", |
| 140649 | | - /* 247 */ "vtabarg", |
| 140650 | | - /* 248 */ "vtabargtoken", |
| 140651 | | - /* 249 */ "lp", |
| 140652 | | - /* 250 */ "anylist", |
| 140653 | | - /* 251 */ "wqlist", |
| 140994 | + /* 219 */ "with", |
| 140995 | + /* 220 */ "setlist", |
| 140996 | + /* 221 */ "insert_cmd", |
| 140997 | + /* 222 */ "idlist_opt", |
| 140998 | + /* 223 */ "likeop", |
| 140999 | + /* 224 */ "between_op", |
| 141000 | + /* 225 */ "in_op", |
| 141001 | + /* 226 */ "paren_exprlist", |
| 141002 | + /* 227 */ "case_operand", |
| 141003 | + /* 228 */ "case_exprlist", |
| 141004 | + /* 229 */ "case_else", |
| 141005 | + /* 230 */ "uniqueflag", |
| 141006 | + /* 231 */ "collate", |
| 141007 | + /* 232 */ "nmnum", |
| 141008 | + /* 233 */ "trigger_decl", |
| 141009 | + /* 234 */ "trigger_cmd_list", |
| 141010 | + /* 235 */ "trigger_time", |
| 141011 | + /* 236 */ "trigger_event", |
| 141012 | + /* 237 */ "foreach_clause", |
| 141013 | + /* 238 */ "when_clause", |
| 141014 | + /* 239 */ "trigger_cmd", |
| 141015 | + /* 240 */ "trnm", |
| 141016 | + /* 241 */ "tridxby", |
| 141017 | + /* 242 */ "database_kw_opt", |
| 141018 | + /* 243 */ "key_opt", |
| 141019 | + /* 244 */ "add_column_fullname", |
| 141020 | + /* 245 */ "kwcolumn_opt", |
| 141021 | + /* 246 */ "create_vtab", |
| 141022 | + /* 247 */ "vtabarglist", |
| 141023 | + /* 248 */ "vtabarg", |
| 141024 | + /* 249 */ "vtabargtoken", |
| 141025 | + /* 250 */ "lp", |
| 141026 | + /* 251 */ "anylist", |
| 140654 | 141027 | }; |
| 140655 | 141028 | #endif /* defined(YYCOVERAGE) || !defined(NDEBUG) */ |
| 140656 | 141029 | |
| 140657 | 141030 | #ifndef NDEBUG |
| 140658 | 141031 | /* For tracing reduce actions, the names of all rules are required. |
| | @@ -140736,260 +141109,263 @@ |
| 140736 | 141109 | /* 75 */ "ifexists ::= IF EXISTS", |
| 140737 | 141110 | /* 76 */ "ifexists ::=", |
| 140738 | 141111 | /* 77 */ "cmd ::= createkw temp VIEW ifnotexists nm dbnm eidlist_opt AS select", |
| 140739 | 141112 | /* 78 */ "cmd ::= DROP VIEW ifexists fullname", |
| 140740 | 141113 | /* 79 */ "cmd ::= select", |
| 140741 | | - /* 80 */ "select ::= with selectnowith", |
| 140742 | | - /* 81 */ "selectnowith ::= selectnowith multiselect_op oneselect", |
| 140743 | | - /* 82 */ "multiselect_op ::= UNION", |
| 140744 | | - /* 83 */ "multiselect_op ::= UNION ALL", |
| 140745 | | - /* 84 */ "multiselect_op ::= EXCEPT|INTERSECT", |
| 140746 | | - /* 85 */ "oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt orderby_opt limit_opt", |
| 140747 | | - /* 86 */ "values ::= VALUES LP nexprlist RP", |
| 140748 | | - /* 87 */ "values ::= values COMMA LP exprlist RP", |
| 140749 | | - /* 88 */ "distinct ::= DISTINCT", |
| 140750 | | - /* 89 */ "distinct ::= ALL", |
| 140751 | | - /* 90 */ "distinct ::=", |
| 140752 | | - /* 91 */ "sclp ::=", |
| 140753 | | - /* 92 */ "selcollist ::= sclp scanpt expr scanpt as", |
| 140754 | | - /* 93 */ "selcollist ::= sclp scanpt STAR", |
| 140755 | | - /* 94 */ "selcollist ::= sclp scanpt nm DOT STAR", |
| 140756 | | - /* 95 */ "as ::= AS nm", |
| 140757 | | - /* 96 */ "as ::=", |
| 140758 | | - /* 97 */ "from ::=", |
| 140759 | | - /* 98 */ "from ::= FROM seltablist", |
| 140760 | | - /* 99 */ "stl_prefix ::= seltablist joinop", |
| 140761 | | - /* 100 */ "stl_prefix ::=", |
| 140762 | | - /* 101 */ "seltablist ::= stl_prefix nm dbnm as indexed_opt on_opt using_opt", |
| 140763 | | - /* 102 */ "seltablist ::= stl_prefix nm dbnm LP exprlist RP as on_opt using_opt", |
| 140764 | | - /* 103 */ "seltablist ::= stl_prefix LP select RP as on_opt using_opt", |
| 140765 | | - /* 104 */ "seltablist ::= stl_prefix LP seltablist RP as on_opt using_opt", |
| 140766 | | - /* 105 */ "dbnm ::=", |
| 140767 | | - /* 106 */ "dbnm ::= DOT nm", |
| 140768 | | - /* 107 */ "fullname ::= nm dbnm", |
| 140769 | | - /* 108 */ "joinop ::= COMMA|JOIN", |
| 140770 | | - /* 109 */ "joinop ::= JOIN_KW JOIN", |
| 140771 | | - /* 110 */ "joinop ::= JOIN_KW nm JOIN", |
| 140772 | | - /* 111 */ "joinop ::= JOIN_KW nm nm JOIN", |
| 140773 | | - /* 112 */ "on_opt ::= ON expr", |
| 140774 | | - /* 113 */ "on_opt ::=", |
| 140775 | | - /* 114 */ "indexed_opt ::=", |
| 140776 | | - /* 115 */ "indexed_opt ::= INDEXED BY nm", |
| 140777 | | - /* 116 */ "indexed_opt ::= NOT INDEXED", |
| 140778 | | - /* 117 */ "using_opt ::= USING LP idlist RP", |
| 140779 | | - /* 118 */ "using_opt ::=", |
| 140780 | | - /* 119 */ "orderby_opt ::=", |
| 140781 | | - /* 120 */ "orderby_opt ::= ORDER BY sortlist", |
| 140782 | | - /* 121 */ "sortlist ::= sortlist COMMA expr sortorder", |
| 140783 | | - /* 122 */ "sortlist ::= expr sortorder", |
| 140784 | | - /* 123 */ "sortorder ::= ASC", |
| 140785 | | - /* 124 */ "sortorder ::= DESC", |
| 140786 | | - /* 125 */ "sortorder ::=", |
| 140787 | | - /* 126 */ "groupby_opt ::=", |
| 140788 | | - /* 127 */ "groupby_opt ::= GROUP BY nexprlist", |
| 140789 | | - /* 128 */ "having_opt ::=", |
| 140790 | | - /* 129 */ "having_opt ::= HAVING expr", |
| 140791 | | - /* 130 */ "limit_opt ::=", |
| 140792 | | - /* 131 */ "limit_opt ::= LIMIT expr", |
| 140793 | | - /* 132 */ "limit_opt ::= LIMIT expr OFFSET expr", |
| 140794 | | - /* 133 */ "limit_opt ::= LIMIT expr COMMA expr", |
| 140795 | | - /* 134 */ "cmd ::= with DELETE FROM fullname indexed_opt where_opt", |
| 140796 | | - /* 135 */ "where_opt ::=", |
| 140797 | | - /* 136 */ "where_opt ::= WHERE expr", |
| 140798 | | - /* 137 */ "cmd ::= with UPDATE orconf fullname indexed_opt SET setlist where_opt", |
| 140799 | | - /* 138 */ "setlist ::= setlist COMMA nm EQ expr", |
| 140800 | | - /* 139 */ "setlist ::= setlist COMMA LP idlist RP EQ expr", |
| 140801 | | - /* 140 */ "setlist ::= nm EQ expr", |
| 140802 | | - /* 141 */ "setlist ::= LP idlist RP EQ expr", |
| 140803 | | - /* 142 */ "cmd ::= with insert_cmd INTO fullname idlist_opt select", |
| 140804 | | - /* 143 */ "cmd ::= with insert_cmd INTO fullname idlist_opt DEFAULT VALUES", |
| 140805 | | - /* 144 */ "insert_cmd ::= INSERT orconf", |
| 140806 | | - /* 145 */ "insert_cmd ::= REPLACE", |
| 140807 | | - /* 146 */ "idlist_opt ::=", |
| 140808 | | - /* 147 */ "idlist_opt ::= LP idlist RP", |
| 140809 | | - /* 148 */ "idlist ::= idlist COMMA nm", |
| 140810 | | - /* 149 */ "idlist ::= nm", |
| 140811 | | - /* 150 */ "expr ::= LP expr RP", |
| 140812 | | - /* 151 */ "expr ::= ID|INDEXED", |
| 140813 | | - /* 152 */ "expr ::= JOIN_KW", |
| 140814 | | - /* 153 */ "expr ::= nm DOT nm", |
| 140815 | | - /* 154 */ "expr ::= nm DOT nm DOT nm", |
| 140816 | | - /* 155 */ "term ::= NULL|FLOAT|BLOB", |
| 140817 | | - /* 156 */ "term ::= STRING", |
| 140818 | | - /* 157 */ "term ::= INTEGER", |
| 140819 | | - /* 158 */ "expr ::= VARIABLE", |
| 140820 | | - /* 159 */ "expr ::= expr COLLATE ID|STRING", |
| 140821 | | - /* 160 */ "expr ::= CAST LP expr AS typetoken RP", |
| 140822 | | - /* 161 */ "expr ::= ID|INDEXED LP distinct exprlist RP", |
| 140823 | | - /* 162 */ "expr ::= ID|INDEXED LP STAR RP", |
| 140824 | | - /* 163 */ "term ::= CTIME_KW", |
| 140825 | | - /* 164 */ "expr ::= LP nexprlist COMMA expr RP", |
| 140826 | | - /* 165 */ "expr ::= expr AND expr", |
| 140827 | | - /* 166 */ "expr ::= expr OR expr", |
| 140828 | | - /* 167 */ "expr ::= expr LT|GT|GE|LE expr", |
| 140829 | | - /* 168 */ "expr ::= expr EQ|NE expr", |
| 140830 | | - /* 169 */ "expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr", |
| 140831 | | - /* 170 */ "expr ::= expr PLUS|MINUS expr", |
| 140832 | | - /* 171 */ "expr ::= expr STAR|SLASH|REM expr", |
| 140833 | | - /* 172 */ "expr ::= expr CONCAT expr", |
| 140834 | | - /* 173 */ "likeop ::= NOT LIKE_KW|MATCH", |
| 140835 | | - /* 174 */ "expr ::= expr likeop expr", |
| 140836 | | - /* 175 */ "expr ::= expr likeop expr ESCAPE expr", |
| 140837 | | - /* 176 */ "expr ::= expr ISNULL|NOTNULL", |
| 140838 | | - /* 177 */ "expr ::= expr NOT NULL", |
| 140839 | | - /* 178 */ "expr ::= expr IS expr", |
| 140840 | | - /* 179 */ "expr ::= expr IS NOT expr", |
| 140841 | | - /* 180 */ "expr ::= NOT expr", |
| 140842 | | - /* 181 */ "expr ::= BITNOT expr", |
| 140843 | | - /* 182 */ "expr ::= MINUS expr", |
| 140844 | | - /* 183 */ "expr ::= PLUS expr", |
| 140845 | | - /* 184 */ "between_op ::= BETWEEN", |
| 140846 | | - /* 185 */ "between_op ::= NOT BETWEEN", |
| 140847 | | - /* 186 */ "expr ::= expr between_op expr AND expr", |
| 140848 | | - /* 187 */ "in_op ::= IN", |
| 140849 | | - /* 188 */ "in_op ::= NOT IN", |
| 140850 | | - /* 189 */ "expr ::= expr in_op LP exprlist RP", |
| 140851 | | - /* 190 */ "expr ::= LP select RP", |
| 140852 | | - /* 191 */ "expr ::= expr in_op LP select RP", |
| 140853 | | - /* 192 */ "expr ::= expr in_op nm dbnm paren_exprlist", |
| 140854 | | - /* 193 */ "expr ::= EXISTS LP select RP", |
| 140855 | | - /* 194 */ "expr ::= CASE case_operand case_exprlist case_else END", |
| 140856 | | - /* 195 */ "case_exprlist ::= case_exprlist WHEN expr THEN expr", |
| 140857 | | - /* 196 */ "case_exprlist ::= WHEN expr THEN expr", |
| 140858 | | - /* 197 */ "case_else ::= ELSE expr", |
| 140859 | | - /* 198 */ "case_else ::=", |
| 140860 | | - /* 199 */ "case_operand ::= expr", |
| 140861 | | - /* 200 */ "case_operand ::=", |
| 140862 | | - /* 201 */ "exprlist ::=", |
| 140863 | | - /* 202 */ "nexprlist ::= nexprlist COMMA expr", |
| 140864 | | - /* 203 */ "nexprlist ::= expr", |
| 140865 | | - /* 204 */ "paren_exprlist ::=", |
| 140866 | | - /* 205 */ "paren_exprlist ::= LP exprlist RP", |
| 140867 | | - /* 206 */ "cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP sortlist RP where_opt", |
| 140868 | | - /* 207 */ "uniqueflag ::= UNIQUE", |
| 140869 | | - /* 208 */ "uniqueflag ::=", |
| 140870 | | - /* 209 */ "eidlist_opt ::=", |
| 140871 | | - /* 210 */ "eidlist_opt ::= LP eidlist RP", |
| 140872 | | - /* 211 */ "eidlist ::= eidlist COMMA nm collate sortorder", |
| 140873 | | - /* 212 */ "eidlist ::= nm collate sortorder", |
| 140874 | | - /* 213 */ "collate ::=", |
| 140875 | | - /* 214 */ "collate ::= COLLATE ID|STRING", |
| 140876 | | - /* 215 */ "cmd ::= DROP INDEX ifexists fullname", |
| 140877 | | - /* 216 */ "cmd ::= VACUUM", |
| 140878 | | - /* 217 */ "cmd ::= VACUUM nm", |
| 140879 | | - /* 218 */ "cmd ::= PRAGMA nm dbnm", |
| 140880 | | - /* 219 */ "cmd ::= PRAGMA nm dbnm EQ nmnum", |
| 140881 | | - /* 220 */ "cmd ::= PRAGMA nm dbnm LP nmnum RP", |
| 140882 | | - /* 221 */ "cmd ::= PRAGMA nm dbnm EQ minus_num", |
| 140883 | | - /* 222 */ "cmd ::= PRAGMA nm dbnm LP minus_num RP", |
| 140884 | | - /* 223 */ "plus_num ::= PLUS INTEGER|FLOAT", |
| 140885 | | - /* 224 */ "minus_num ::= MINUS INTEGER|FLOAT", |
| 140886 | | - /* 225 */ "cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END", |
| 140887 | | - /* 226 */ "trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause", |
| 140888 | | - /* 227 */ "trigger_time ::= BEFORE|AFTER", |
| 140889 | | - /* 228 */ "trigger_time ::= INSTEAD OF", |
| 140890 | | - /* 229 */ "trigger_time ::=", |
| 140891 | | - /* 230 */ "trigger_event ::= DELETE|INSERT", |
| 140892 | | - /* 231 */ "trigger_event ::= UPDATE", |
| 140893 | | - /* 232 */ "trigger_event ::= UPDATE OF idlist", |
| 140894 | | - /* 233 */ "when_clause ::=", |
| 140895 | | - /* 234 */ "when_clause ::= WHEN expr", |
| 140896 | | - /* 235 */ "trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI", |
| 140897 | | - /* 236 */ "trigger_cmd_list ::= trigger_cmd SEMI", |
| 140898 | | - /* 237 */ "trnm ::= nm DOT nm", |
| 140899 | | - /* 238 */ "tridxby ::= INDEXED BY nm", |
| 140900 | | - /* 239 */ "tridxby ::= NOT INDEXED", |
| 140901 | | - /* 240 */ "trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist where_opt scanpt", |
| 140902 | | - /* 241 */ "trigger_cmd ::= scanpt insert_cmd INTO trnm idlist_opt select scanpt", |
| 140903 | | - /* 242 */ "trigger_cmd ::= DELETE FROM trnm tridxby where_opt scanpt", |
| 140904 | | - /* 243 */ "trigger_cmd ::= scanpt select scanpt", |
| 140905 | | - /* 244 */ "expr ::= RAISE LP IGNORE RP", |
| 140906 | | - /* 245 */ "expr ::= RAISE LP raisetype COMMA nm RP", |
| 140907 | | - /* 246 */ "raisetype ::= ROLLBACK", |
| 140908 | | - /* 247 */ "raisetype ::= ABORT", |
| 140909 | | - /* 248 */ "raisetype ::= FAIL", |
| 140910 | | - /* 249 */ "cmd ::= DROP TRIGGER ifexists fullname", |
| 140911 | | - /* 250 */ "cmd ::= ATTACH database_kw_opt expr AS expr key_opt", |
| 140912 | | - /* 251 */ "cmd ::= DETACH database_kw_opt expr", |
| 140913 | | - /* 252 */ "key_opt ::=", |
| 140914 | | - /* 253 */ "key_opt ::= KEY expr", |
| 140915 | | - /* 254 */ "cmd ::= REINDEX", |
| 140916 | | - /* 255 */ "cmd ::= REINDEX nm dbnm", |
| 140917 | | - /* 256 */ "cmd ::= ANALYZE", |
| 140918 | | - /* 257 */ "cmd ::= ANALYZE nm dbnm", |
| 140919 | | - /* 258 */ "cmd ::= ALTER TABLE fullname RENAME TO nm", |
| 140920 | | - /* 259 */ "cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt columnname carglist", |
| 140921 | | - /* 260 */ "add_column_fullname ::= fullname", |
| 140922 | | - /* 261 */ "cmd ::= create_vtab", |
| 140923 | | - /* 262 */ "cmd ::= create_vtab LP vtabarglist RP", |
| 140924 | | - /* 263 */ "create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm", |
| 140925 | | - /* 264 */ "vtabarg ::=", |
| 140926 | | - /* 265 */ "vtabargtoken ::= ANY", |
| 140927 | | - /* 266 */ "vtabargtoken ::= lp anylist RP", |
| 140928 | | - /* 267 */ "lp ::= LP", |
| 140929 | | - /* 268 */ "with ::=", |
| 140930 | | - /* 269 */ "with ::= WITH wqlist", |
| 140931 | | - /* 270 */ "with ::= WITH RECURSIVE wqlist", |
| 140932 | | - /* 271 */ "wqlist ::= nm eidlist_opt AS LP select RP", |
| 140933 | | - /* 272 */ "wqlist ::= wqlist COMMA nm eidlist_opt AS LP select RP", |
| 140934 | | - /* 273 */ "input ::= cmdlist", |
| 140935 | | - /* 274 */ "cmdlist ::= cmdlist ecmd", |
| 140936 | | - /* 275 */ "cmdlist ::= ecmd", |
| 140937 | | - /* 276 */ "ecmd ::= SEMI", |
| 140938 | | - /* 277 */ "ecmd ::= explain cmdx SEMI", |
| 140939 | | - /* 278 */ "explain ::=", |
| 140940 | | - /* 279 */ "trans_opt ::=", |
| 140941 | | - /* 280 */ "trans_opt ::= TRANSACTION", |
| 140942 | | - /* 281 */ "trans_opt ::= TRANSACTION nm", |
| 140943 | | - /* 282 */ "savepoint_opt ::= SAVEPOINT", |
| 140944 | | - /* 283 */ "savepoint_opt ::=", |
| 140945 | | - /* 284 */ "cmd ::= create_table create_table_args", |
| 140946 | | - /* 285 */ "columnlist ::= columnlist COMMA columnname carglist", |
| 140947 | | - /* 286 */ "columnlist ::= columnname carglist", |
| 140948 | | - /* 287 */ "nm ::= ID|INDEXED", |
| 140949 | | - /* 288 */ "nm ::= STRING", |
| 140950 | | - /* 289 */ "nm ::= JOIN_KW", |
| 140951 | | - /* 290 */ "typetoken ::= typename", |
| 140952 | | - /* 291 */ "typename ::= ID|STRING", |
| 140953 | | - /* 292 */ "signed ::= plus_num", |
| 140954 | | - /* 293 */ "signed ::= minus_num", |
| 140955 | | - /* 294 */ "carglist ::= carglist ccons", |
| 140956 | | - /* 295 */ "carglist ::=", |
| 140957 | | - /* 296 */ "ccons ::= NULL onconf", |
| 140958 | | - /* 297 */ "conslist_opt ::= COMMA conslist", |
| 140959 | | - /* 298 */ "conslist ::= conslist tconscomma tcons", |
| 140960 | | - /* 299 */ "conslist ::= tcons", |
| 140961 | | - /* 300 */ "tconscomma ::=", |
| 140962 | | - /* 301 */ "defer_subclause_opt ::= defer_subclause", |
| 140963 | | - /* 302 */ "resolvetype ::= raisetype", |
| 140964 | | - /* 303 */ "selectnowith ::= oneselect", |
| 140965 | | - /* 304 */ "oneselect ::= values", |
| 140966 | | - /* 305 */ "sclp ::= selcollist COMMA", |
| 140967 | | - /* 306 */ "as ::= ID|STRING", |
| 140968 | | - /* 307 */ "expr ::= term", |
| 140969 | | - /* 308 */ "likeop ::= LIKE_KW|MATCH", |
| 140970 | | - /* 309 */ "exprlist ::= nexprlist", |
| 140971 | | - /* 310 */ "nmnum ::= plus_num", |
| 140972 | | - /* 311 */ "nmnum ::= nm", |
| 140973 | | - /* 312 */ "nmnum ::= ON", |
| 140974 | | - /* 313 */ "nmnum ::= DELETE", |
| 140975 | | - /* 314 */ "nmnum ::= DEFAULT", |
| 140976 | | - /* 315 */ "plus_num ::= INTEGER|FLOAT", |
| 140977 | | - /* 316 */ "foreach_clause ::=", |
| 140978 | | - /* 317 */ "foreach_clause ::= FOR EACH ROW", |
| 140979 | | - /* 318 */ "trnm ::= nm", |
| 140980 | | - /* 319 */ "tridxby ::=", |
| 140981 | | - /* 320 */ "database_kw_opt ::= DATABASE", |
| 140982 | | - /* 321 */ "database_kw_opt ::=", |
| 140983 | | - /* 322 */ "kwcolumn_opt ::=", |
| 140984 | | - /* 323 */ "kwcolumn_opt ::= COLUMNKW", |
| 140985 | | - /* 324 */ "vtabarglist ::= vtabarg", |
| 140986 | | - /* 325 */ "vtabarglist ::= vtabarglist COMMA vtabarg", |
| 140987 | | - /* 326 */ "vtabarg ::= vtabarg vtabargtoken", |
| 140988 | | - /* 327 */ "anylist ::=", |
| 140989 | | - /* 328 */ "anylist ::= anylist LP anylist RP", |
| 140990 | | - /* 329 */ "anylist ::= anylist ANY", |
| 141114 | + /* 80 */ "select ::= WITH wqlist selectnowith", |
| 141115 | + /* 81 */ "select ::= WITH RECURSIVE wqlist selectnowith", |
| 141116 | + /* 82 */ "select ::= selectnowith", |
| 141117 | + /* 83 */ "selectnowith ::= selectnowith multiselect_op oneselect", |
| 141118 | + /* 84 */ "multiselect_op ::= UNION", |
| 141119 | + /* 85 */ "multiselect_op ::= UNION ALL", |
| 141120 | + /* 86 */ "multiselect_op ::= EXCEPT|INTERSECT", |
| 141121 | + /* 87 */ "oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt orderby_opt limit_opt", |
| 141122 | + /* 88 */ "values ::= VALUES LP nexprlist RP", |
| 141123 | + /* 89 */ "values ::= values COMMA LP exprlist RP", |
| 141124 | + /* 90 */ "distinct ::= DISTINCT", |
| 141125 | + /* 91 */ "distinct ::= ALL", |
| 141126 | + /* 92 */ "distinct ::=", |
| 141127 | + /* 93 */ "sclp ::=", |
| 141128 | + /* 94 */ "selcollist ::= sclp scanpt expr scanpt as", |
| 141129 | + /* 95 */ "selcollist ::= sclp scanpt STAR", |
| 141130 | + /* 96 */ "selcollist ::= sclp scanpt nm DOT STAR", |
| 141131 | + /* 97 */ "as ::= AS nm", |
| 141132 | + /* 98 */ "as ::=", |
| 141133 | + /* 99 */ "from ::=", |
| 141134 | + /* 100 */ "from ::= FROM seltablist", |
| 141135 | + /* 101 */ "stl_prefix ::= seltablist joinop", |
| 141136 | + /* 102 */ "stl_prefix ::=", |
| 141137 | + /* 103 */ "seltablist ::= stl_prefix nm dbnm as indexed_opt on_opt using_opt", |
| 141138 | + /* 104 */ "seltablist ::= stl_prefix nm dbnm LP exprlist RP as on_opt using_opt", |
| 141139 | + /* 105 */ "seltablist ::= stl_prefix LP select RP as on_opt using_opt", |
| 141140 | + /* 106 */ "seltablist ::= stl_prefix LP seltablist RP as on_opt using_opt", |
| 141141 | + /* 107 */ "dbnm ::=", |
| 141142 | + /* 108 */ "dbnm ::= DOT nm", |
| 141143 | + /* 109 */ "fullname ::= nm", |
| 141144 | + /* 110 */ "fullname ::= nm DOT nm", |
| 141145 | + /* 111 */ "joinop ::= COMMA|JOIN", |
| 141146 | + /* 112 */ "joinop ::= JOIN_KW JOIN", |
| 141147 | + /* 113 */ "joinop ::= JOIN_KW nm JOIN", |
| 141148 | + /* 114 */ "joinop ::= JOIN_KW nm nm JOIN", |
| 141149 | + /* 115 */ "on_opt ::= ON expr", |
| 141150 | + /* 116 */ "on_opt ::=", |
| 141151 | + /* 117 */ "indexed_opt ::=", |
| 141152 | + /* 118 */ "indexed_opt ::= INDEXED BY nm", |
| 141153 | + /* 119 */ "indexed_opt ::= NOT INDEXED", |
| 141154 | + /* 120 */ "using_opt ::= USING LP idlist RP", |
| 141155 | + /* 121 */ "using_opt ::=", |
| 141156 | + /* 122 */ "orderby_opt ::=", |
| 141157 | + /* 123 */ "orderby_opt ::= ORDER BY sortlist", |
| 141158 | + /* 124 */ "sortlist ::= sortlist COMMA expr sortorder", |
| 141159 | + /* 125 */ "sortlist ::= expr sortorder", |
| 141160 | + /* 126 */ "sortorder ::= ASC", |
| 141161 | + /* 127 */ "sortorder ::= DESC", |
| 141162 | + /* 128 */ "sortorder ::=", |
| 141163 | + /* 129 */ "groupby_opt ::=", |
| 141164 | + /* 130 */ "groupby_opt ::= GROUP BY nexprlist", |
| 141165 | + /* 131 */ "having_opt ::=", |
| 141166 | + /* 132 */ "having_opt ::= HAVING expr", |
| 141167 | + /* 133 */ "limit_opt ::=", |
| 141168 | + /* 134 */ "limit_opt ::= LIMIT expr", |
| 141169 | + /* 135 */ "limit_opt ::= LIMIT expr OFFSET expr", |
| 141170 | + /* 136 */ "limit_opt ::= LIMIT expr COMMA expr", |
| 141171 | + /* 137 */ "cmd ::= with DELETE FROM fullname indexed_opt where_opt", |
| 141172 | + /* 138 */ "where_opt ::=", |
| 141173 | + /* 139 */ "where_opt ::= WHERE expr", |
| 141174 | + /* 140 */ "cmd ::= with UPDATE orconf fullname indexed_opt SET setlist where_opt", |
| 141175 | + /* 141 */ "setlist ::= setlist COMMA nm EQ expr", |
| 141176 | + /* 142 */ "setlist ::= setlist COMMA LP idlist RP EQ expr", |
| 141177 | + /* 143 */ "setlist ::= nm EQ expr", |
| 141178 | + /* 144 */ "setlist ::= LP idlist RP EQ expr", |
| 141179 | + /* 145 */ "cmd ::= with insert_cmd INTO fullname idlist_opt select", |
| 141180 | + /* 146 */ "cmd ::= with insert_cmd INTO fullname idlist_opt DEFAULT VALUES", |
| 141181 | + /* 147 */ "insert_cmd ::= INSERT orconf", |
| 141182 | + /* 148 */ "insert_cmd ::= REPLACE", |
| 141183 | + /* 149 */ "idlist_opt ::=", |
| 141184 | + /* 150 */ "idlist_opt ::= LP idlist RP", |
| 141185 | + /* 151 */ "idlist ::= idlist COMMA nm", |
| 141186 | + /* 152 */ "idlist ::= nm", |
| 141187 | + /* 153 */ "expr ::= LP expr RP", |
| 141188 | + /* 154 */ "expr ::= ID|INDEXED", |
| 141189 | + /* 155 */ "expr ::= JOIN_KW", |
| 141190 | + /* 156 */ "expr ::= nm DOT nm", |
| 141191 | + /* 157 */ "expr ::= nm DOT nm DOT nm", |
| 141192 | + /* 158 */ "term ::= NULL|FLOAT|BLOB", |
| 141193 | + /* 159 */ "term ::= STRING", |
| 141194 | + /* 160 */ "term ::= INTEGER", |
| 141195 | + /* 161 */ "expr ::= VARIABLE", |
| 141196 | + /* 162 */ "expr ::= expr COLLATE ID|STRING", |
| 141197 | + /* 163 */ "expr ::= CAST LP expr AS typetoken RP", |
| 141198 | + /* 164 */ "expr ::= ID|INDEXED LP distinct exprlist RP", |
| 141199 | + /* 165 */ "expr ::= ID|INDEXED LP STAR RP", |
| 141200 | + /* 166 */ "term ::= CTIME_KW", |
| 141201 | + /* 167 */ "expr ::= LP nexprlist COMMA expr RP", |
| 141202 | + /* 168 */ "expr ::= expr AND expr", |
| 141203 | + /* 169 */ "expr ::= expr OR expr", |
| 141204 | + /* 170 */ "expr ::= expr LT|GT|GE|LE expr", |
| 141205 | + /* 171 */ "expr ::= expr EQ|NE expr", |
| 141206 | + /* 172 */ "expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr", |
| 141207 | + /* 173 */ "expr ::= expr PLUS|MINUS expr", |
| 141208 | + /* 174 */ "expr ::= expr STAR|SLASH|REM expr", |
| 141209 | + /* 175 */ "expr ::= expr CONCAT expr", |
| 141210 | + /* 176 */ "likeop ::= NOT LIKE_KW|MATCH", |
| 141211 | + /* 177 */ "expr ::= expr likeop expr", |
| 141212 | + /* 178 */ "expr ::= expr likeop expr ESCAPE expr", |
| 141213 | + /* 179 */ "expr ::= expr ISNULL|NOTNULL", |
| 141214 | + /* 180 */ "expr ::= expr NOT NULL", |
| 141215 | + /* 181 */ "expr ::= expr IS expr", |
| 141216 | + /* 182 */ "expr ::= expr IS NOT expr", |
| 141217 | + /* 183 */ "expr ::= NOT expr", |
| 141218 | + /* 184 */ "expr ::= BITNOT expr", |
| 141219 | + /* 185 */ "expr ::= MINUS expr", |
| 141220 | + /* 186 */ "expr ::= PLUS expr", |
| 141221 | + /* 187 */ "between_op ::= BETWEEN", |
| 141222 | + /* 188 */ "between_op ::= NOT BETWEEN", |
| 141223 | + /* 189 */ "expr ::= expr between_op expr AND expr", |
| 141224 | + /* 190 */ "in_op ::= IN", |
| 141225 | + /* 191 */ "in_op ::= NOT IN", |
| 141226 | + /* 192 */ "expr ::= expr in_op LP exprlist RP", |
| 141227 | + /* 193 */ "expr ::= LP select RP", |
| 141228 | + /* 194 */ "expr ::= expr in_op LP select RP", |
| 141229 | + /* 195 */ "expr ::= expr in_op nm dbnm paren_exprlist", |
| 141230 | + /* 196 */ "expr ::= EXISTS LP select RP", |
| 141231 | + /* 197 */ "expr ::= CASE case_operand case_exprlist case_else END", |
| 141232 | + /* 198 */ "case_exprlist ::= case_exprlist WHEN expr THEN expr", |
| 141233 | + /* 199 */ "case_exprlist ::= WHEN expr THEN expr", |
| 141234 | + /* 200 */ "case_else ::= ELSE expr", |
| 141235 | + /* 201 */ "case_else ::=", |
| 141236 | + /* 202 */ "case_operand ::= expr", |
| 141237 | + /* 203 */ "case_operand ::=", |
| 141238 | + /* 204 */ "exprlist ::=", |
| 141239 | + /* 205 */ "nexprlist ::= nexprlist COMMA expr", |
| 141240 | + /* 206 */ "nexprlist ::= expr", |
| 141241 | + /* 207 */ "paren_exprlist ::=", |
| 141242 | + /* 208 */ "paren_exprlist ::= LP exprlist RP", |
| 141243 | + /* 209 */ "cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP sortlist RP where_opt", |
| 141244 | + /* 210 */ "uniqueflag ::= UNIQUE", |
| 141245 | + /* 211 */ "uniqueflag ::=", |
| 141246 | + /* 212 */ "eidlist_opt ::=", |
| 141247 | + /* 213 */ "eidlist_opt ::= LP eidlist RP", |
| 141248 | + /* 214 */ "eidlist ::= eidlist COMMA nm collate sortorder", |
| 141249 | + /* 215 */ "eidlist ::= nm collate sortorder", |
| 141250 | + /* 216 */ "collate ::=", |
| 141251 | + /* 217 */ "collate ::= COLLATE ID|STRING", |
| 141252 | + /* 218 */ "cmd ::= DROP INDEX ifexists fullname", |
| 141253 | + /* 219 */ "cmd ::= VACUUM", |
| 141254 | + /* 220 */ "cmd ::= VACUUM nm", |
| 141255 | + /* 221 */ "cmd ::= PRAGMA nm dbnm", |
| 141256 | + /* 222 */ "cmd ::= PRAGMA nm dbnm EQ nmnum", |
| 141257 | + /* 223 */ "cmd ::= PRAGMA nm dbnm LP nmnum RP", |
| 141258 | + /* 224 */ "cmd ::= PRAGMA nm dbnm EQ minus_num", |
| 141259 | + /* 225 */ "cmd ::= PRAGMA nm dbnm LP minus_num RP", |
| 141260 | + /* 226 */ "plus_num ::= PLUS INTEGER|FLOAT", |
| 141261 | + /* 227 */ "minus_num ::= MINUS INTEGER|FLOAT", |
| 141262 | + /* 228 */ "cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END", |
| 141263 | + /* 229 */ "trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause", |
| 141264 | + /* 230 */ "trigger_time ::= BEFORE|AFTER", |
| 141265 | + /* 231 */ "trigger_time ::= INSTEAD OF", |
| 141266 | + /* 232 */ "trigger_time ::=", |
| 141267 | + /* 233 */ "trigger_event ::= DELETE|INSERT", |
| 141268 | + /* 234 */ "trigger_event ::= UPDATE", |
| 141269 | + /* 235 */ "trigger_event ::= UPDATE OF idlist", |
| 141270 | + /* 236 */ "when_clause ::=", |
| 141271 | + /* 237 */ "when_clause ::= WHEN expr", |
| 141272 | + /* 238 */ "trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI", |
| 141273 | + /* 239 */ "trigger_cmd_list ::= trigger_cmd SEMI", |
| 141274 | + /* 240 */ "trnm ::= nm DOT nm", |
| 141275 | + /* 241 */ "tridxby ::= INDEXED BY nm", |
| 141276 | + /* 242 */ "tridxby ::= NOT INDEXED", |
| 141277 | + /* 243 */ "trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist where_opt scanpt", |
| 141278 | + /* 244 */ "trigger_cmd ::= scanpt insert_cmd INTO trnm idlist_opt select scanpt", |
| 141279 | + /* 245 */ "trigger_cmd ::= DELETE FROM trnm tridxby where_opt scanpt", |
| 141280 | + /* 246 */ "trigger_cmd ::= scanpt select scanpt", |
| 141281 | + /* 247 */ "expr ::= RAISE LP IGNORE RP", |
| 141282 | + /* 248 */ "expr ::= RAISE LP raisetype COMMA nm RP", |
| 141283 | + /* 249 */ "raisetype ::= ROLLBACK", |
| 141284 | + /* 250 */ "raisetype ::= ABORT", |
| 141285 | + /* 251 */ "raisetype ::= FAIL", |
| 141286 | + /* 252 */ "cmd ::= DROP TRIGGER ifexists fullname", |
| 141287 | + /* 253 */ "cmd ::= ATTACH database_kw_opt expr AS expr key_opt", |
| 141288 | + /* 254 */ "cmd ::= DETACH database_kw_opt expr", |
| 141289 | + /* 255 */ "key_opt ::=", |
| 141290 | + /* 256 */ "key_opt ::= KEY expr", |
| 141291 | + /* 257 */ "cmd ::= REINDEX", |
| 141292 | + /* 258 */ "cmd ::= REINDEX nm dbnm", |
| 141293 | + /* 259 */ "cmd ::= ANALYZE", |
| 141294 | + /* 260 */ "cmd ::= ANALYZE nm dbnm", |
| 141295 | + /* 261 */ "cmd ::= ALTER TABLE fullname RENAME TO nm", |
| 141296 | + /* 262 */ "cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt columnname carglist", |
| 141297 | + /* 263 */ "add_column_fullname ::= fullname", |
| 141298 | + /* 264 */ "cmd ::= create_vtab", |
| 141299 | + /* 265 */ "cmd ::= create_vtab LP vtabarglist RP", |
| 141300 | + /* 266 */ "create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm", |
| 141301 | + /* 267 */ "vtabarg ::=", |
| 141302 | + /* 268 */ "vtabargtoken ::= ANY", |
| 141303 | + /* 269 */ "vtabargtoken ::= lp anylist RP", |
| 141304 | + /* 270 */ "lp ::= LP", |
| 141305 | + /* 271 */ "with ::= WITH wqlist", |
| 141306 | + /* 272 */ "with ::= WITH RECURSIVE wqlist", |
| 141307 | + /* 273 */ "wqlist ::= nm eidlist_opt AS LP select RP", |
| 141308 | + /* 274 */ "wqlist ::= wqlist COMMA nm eidlist_opt AS LP select RP", |
| 141309 | + /* 275 */ "input ::= cmdlist", |
| 141310 | + /* 276 */ "cmdlist ::= cmdlist ecmd", |
| 141311 | + /* 277 */ "cmdlist ::= ecmd", |
| 141312 | + /* 278 */ "ecmd ::= SEMI", |
| 141313 | + /* 279 */ "ecmd ::= explain cmdx SEMI", |
| 141314 | + /* 280 */ "explain ::=", |
| 141315 | + /* 281 */ "trans_opt ::=", |
| 141316 | + /* 282 */ "trans_opt ::= TRANSACTION", |
| 141317 | + /* 283 */ "trans_opt ::= TRANSACTION nm", |
| 141318 | + /* 284 */ "savepoint_opt ::= SAVEPOINT", |
| 141319 | + /* 285 */ "savepoint_opt ::=", |
| 141320 | + /* 286 */ "cmd ::= create_table create_table_args", |
| 141321 | + /* 287 */ "columnlist ::= columnlist COMMA columnname carglist", |
| 141322 | + /* 288 */ "columnlist ::= columnname carglist", |
| 141323 | + /* 289 */ "nm ::= ID|INDEXED", |
| 141324 | + /* 290 */ "nm ::= STRING", |
| 141325 | + /* 291 */ "nm ::= JOIN_KW", |
| 141326 | + /* 292 */ "typetoken ::= typename", |
| 141327 | + /* 293 */ "typename ::= ID|STRING", |
| 141328 | + /* 294 */ "signed ::= plus_num", |
| 141329 | + /* 295 */ "signed ::= minus_num", |
| 141330 | + /* 296 */ "carglist ::= carglist ccons", |
| 141331 | + /* 297 */ "carglist ::=", |
| 141332 | + /* 298 */ "ccons ::= NULL onconf", |
| 141333 | + /* 299 */ "conslist_opt ::= COMMA conslist", |
| 141334 | + /* 300 */ "conslist ::= conslist tconscomma tcons", |
| 141335 | + /* 301 */ "conslist ::= tcons", |
| 141336 | + /* 302 */ "tconscomma ::=", |
| 141337 | + /* 303 */ "defer_subclause_opt ::= defer_subclause", |
| 141338 | + /* 304 */ "resolvetype ::= raisetype", |
| 141339 | + /* 305 */ "selectnowith ::= oneselect", |
| 141340 | + /* 306 */ "oneselect ::= values", |
| 141341 | + /* 307 */ "sclp ::= selcollist COMMA", |
| 141342 | + /* 308 */ "as ::= ID|STRING", |
| 141343 | + /* 309 */ "expr ::= term", |
| 141344 | + /* 310 */ "likeop ::= LIKE_KW|MATCH", |
| 141345 | + /* 311 */ "exprlist ::= nexprlist", |
| 141346 | + /* 312 */ "nmnum ::= plus_num", |
| 141347 | + /* 313 */ "nmnum ::= nm", |
| 141348 | + /* 314 */ "nmnum ::= ON", |
| 141349 | + /* 315 */ "nmnum ::= DELETE", |
| 141350 | + /* 316 */ "nmnum ::= DEFAULT", |
| 141351 | + /* 317 */ "plus_num ::= INTEGER|FLOAT", |
| 141352 | + /* 318 */ "foreach_clause ::=", |
| 141353 | + /* 319 */ "foreach_clause ::= FOR EACH ROW", |
| 141354 | + /* 320 */ "trnm ::= nm", |
| 141355 | + /* 321 */ "tridxby ::=", |
| 141356 | + /* 322 */ "database_kw_opt ::= DATABASE", |
| 141357 | + /* 323 */ "database_kw_opt ::=", |
| 141358 | + /* 324 */ "kwcolumn_opt ::=", |
| 141359 | + /* 325 */ "kwcolumn_opt ::= COLUMNKW", |
| 141360 | + /* 326 */ "vtabarglist ::= vtabarg", |
| 141361 | + /* 327 */ "vtabarglist ::= vtabarglist COMMA vtabarg", |
| 141362 | + /* 328 */ "vtabarg ::= vtabarg vtabargtoken", |
| 141363 | + /* 329 */ "anylist ::=", |
| 141364 | + /* 330 */ "anylist ::= anylist LP anylist RP", |
| 141365 | + /* 331 */ "anylist ::= anylist ANY", |
| 141366 | + /* 332 */ "with ::=", |
| 140991 | 141367 | }; |
| 140992 | 141368 | #endif /* NDEBUG */ |
| 140993 | 141369 | |
| 140994 | 141370 | |
| 140995 | 141371 | #if YYSTACKDEPTH<=0 |
| | @@ -141119,14 +141495,14 @@ |
| 141119 | 141495 | case 173: /* term */ |
| 141120 | 141496 | case 174: /* expr */ |
| 141121 | 141497 | case 202: /* where_opt */ |
| 141122 | 141498 | case 204: /* having_opt */ |
| 141123 | 141499 | case 216: /* on_opt */ |
| 141124 | | - case 226: /* case_operand */ |
| 141125 | | - case 228: /* case_else */ |
| 141126 | | - case 237: /* when_clause */ |
| 141127 | | - case 242: /* key_opt */ |
| 141500 | + case 227: /* case_operand */ |
| 141501 | + case 229: /* case_else */ |
| 141502 | + case 238: /* when_clause */ |
| 141503 | + case 243: /* key_opt */ |
| 141128 | 141504 | { |
| 141129 | 141505 | sqlite3ExprDelete(pParse->db, (yypminor->yy314)); |
| 141130 | 141506 | } |
| 141131 | 141507 | break; |
| 141132 | 141508 | case 178: /* eidlist_opt */ |
| | @@ -141136,13 +141512,13 @@ |
| 141136 | 141512 | case 203: /* groupby_opt */ |
| 141137 | 141513 | case 205: /* orderby_opt */ |
| 141138 | 141514 | case 208: /* nexprlist */ |
| 141139 | 141515 | case 209: /* exprlist */ |
| 141140 | 141516 | case 210: /* sclp */ |
| 141141 | | - case 219: /* setlist */ |
| 141142 | | - case 225: /* paren_exprlist */ |
| 141143 | | - case 227: /* case_exprlist */ |
| 141517 | + case 220: /* setlist */ |
| 141518 | + case 226: /* paren_exprlist */ |
| 141519 | + case 228: /* case_exprlist */ |
| 141144 | 141520 | { |
| 141145 | 141521 | sqlite3ExprListDelete(pParse->db, (yypminor->yy322)); |
| 141146 | 141522 | } |
| 141147 | 141523 | break; |
| 141148 | 141524 | case 194: /* fullname */ |
| | @@ -141151,30 +141527,29 @@ |
| 141151 | 141527 | case 213: /* stl_prefix */ |
| 141152 | 141528 | { |
| 141153 | 141529 | sqlite3SrcListDelete(pParse->db, (yypminor->yy259)); |
| 141154 | 141530 | } |
| 141155 | 141531 | break; |
| 141156 | | - case 197: /* with */ |
| 141157 | | - case 251: /* wqlist */ |
| 141532 | + case 197: /* wqlist */ |
| 141158 | 141533 | { |
| 141159 | 141534 | sqlite3WithDelete(pParse->db, (yypminor->yy451)); |
| 141160 | 141535 | } |
| 141161 | 141536 | break; |
| 141162 | 141537 | case 217: /* using_opt */ |
| 141163 | 141538 | case 218: /* idlist */ |
| 141164 | | - case 221: /* idlist_opt */ |
| 141539 | + case 222: /* idlist_opt */ |
| 141165 | 141540 | { |
| 141166 | 141541 | sqlite3IdListDelete(pParse->db, (yypminor->yy384)); |
| 141167 | 141542 | } |
| 141168 | 141543 | break; |
| 141169 | | - case 233: /* trigger_cmd_list */ |
| 141170 | | - case 238: /* trigger_cmd */ |
| 141544 | + case 234: /* trigger_cmd_list */ |
| 141545 | + case 239: /* trigger_cmd */ |
| 141171 | 141546 | { |
| 141172 | 141547 | sqlite3DeleteTriggerStep(pParse->db, (yypminor->yy203)); |
| 141173 | 141548 | } |
| 141174 | 141549 | break; |
| 141175 | | - case 235: /* trigger_event */ |
| 141550 | + case 236: /* trigger_event */ |
| 141176 | 141551 | { |
| 141177 | 141552 | sqlite3IdListDelete(pParse->db, (yypminor->yy90).b); |
| 141178 | 141553 | } |
| 141179 | 141554 | break; |
| 141180 | 141555 | /********* End destructor definitions *****************************************/ |
| | @@ -141549,260 +141924,263 @@ |
| 141549 | 141924 | { 193, -2 }, /* (75) ifexists ::= IF EXISTS */ |
| 141550 | 141925 | { 193, 0 }, /* (76) ifexists ::= */ |
| 141551 | 141926 | { 149, -9 }, /* (77) cmd ::= createkw temp VIEW ifnotexists nm dbnm eidlist_opt AS select */ |
| 141552 | 141927 | { 149, -4 }, /* (78) cmd ::= DROP VIEW ifexists fullname */ |
| 141553 | 141928 | { 149, -1 }, /* (79) cmd ::= select */ |
| 141554 | | - { 163, -2 }, /* (80) select ::= with selectnowith */ |
| 141555 | | - { 195, -3 }, /* (81) selectnowith ::= selectnowith multiselect_op oneselect */ |
| 141556 | | - { 198, -1 }, /* (82) multiselect_op ::= UNION */ |
| 141557 | | - { 198, -2 }, /* (83) multiselect_op ::= UNION ALL */ |
| 141558 | | - { 198, -1 }, /* (84) multiselect_op ::= EXCEPT|INTERSECT */ |
| 141559 | | - { 196, -9 }, /* (85) oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt orderby_opt limit_opt */ |
| 141560 | | - { 207, -4 }, /* (86) values ::= VALUES LP nexprlist RP */ |
| 141561 | | - { 207, -5 }, /* (87) values ::= values COMMA LP exprlist RP */ |
| 141562 | | - { 199, -1 }, /* (88) distinct ::= DISTINCT */ |
| 141563 | | - { 199, -1 }, /* (89) distinct ::= ALL */ |
| 141564 | | - { 199, 0 }, /* (90) distinct ::= */ |
| 141565 | | - { 210, 0 }, /* (91) sclp ::= */ |
| 141566 | | - { 200, -5 }, /* (92) selcollist ::= sclp scanpt expr scanpt as */ |
| 141567 | | - { 200, -3 }, /* (93) selcollist ::= sclp scanpt STAR */ |
| 141568 | | - { 200, -5 }, /* (94) selcollist ::= sclp scanpt nm DOT STAR */ |
| 141569 | | - { 211, -2 }, /* (95) as ::= AS nm */ |
| 141570 | | - { 211, 0 }, /* (96) as ::= */ |
| 141571 | | - { 201, 0 }, /* (97) from ::= */ |
| 141572 | | - { 201, -2 }, /* (98) from ::= FROM seltablist */ |
| 141573 | | - { 213, -2 }, /* (99) stl_prefix ::= seltablist joinop */ |
| 141574 | | - { 213, 0 }, /* (100) stl_prefix ::= */ |
| 141575 | | - { 212, -7 }, /* (101) seltablist ::= stl_prefix nm dbnm as indexed_opt on_opt using_opt */ |
| 141576 | | - { 212, -9 }, /* (102) seltablist ::= stl_prefix nm dbnm LP exprlist RP as on_opt using_opt */ |
| 141577 | | - { 212, -7 }, /* (103) seltablist ::= stl_prefix LP select RP as on_opt using_opt */ |
| 141578 | | - { 212, -7 }, /* (104) seltablist ::= stl_prefix LP seltablist RP as on_opt using_opt */ |
| 141579 | | - { 159, 0 }, /* (105) dbnm ::= */ |
| 141580 | | - { 159, -2 }, /* (106) dbnm ::= DOT nm */ |
| 141581 | | - { 194, -2 }, /* (107) fullname ::= nm dbnm */ |
| 141582 | | - { 214, -1 }, /* (108) joinop ::= COMMA|JOIN */ |
| 141583 | | - { 214, -2 }, /* (109) joinop ::= JOIN_KW JOIN */ |
| 141584 | | - { 214, -3 }, /* (110) joinop ::= JOIN_KW nm JOIN */ |
| 141585 | | - { 214, -4 }, /* (111) joinop ::= JOIN_KW nm nm JOIN */ |
| 141586 | | - { 216, -2 }, /* (112) on_opt ::= ON expr */ |
| 141587 | | - { 216, 0 }, /* (113) on_opt ::= */ |
| 141588 | | - { 215, 0 }, /* (114) indexed_opt ::= */ |
| 141589 | | - { 215, -3 }, /* (115) indexed_opt ::= INDEXED BY nm */ |
| 141590 | | - { 215, -2 }, /* (116) indexed_opt ::= NOT INDEXED */ |
| 141591 | | - { 217, -4 }, /* (117) using_opt ::= USING LP idlist RP */ |
| 141592 | | - { 217, 0 }, /* (118) using_opt ::= */ |
| 141593 | | - { 205, 0 }, /* (119) orderby_opt ::= */ |
| 141594 | | - { 205, -3 }, /* (120) orderby_opt ::= ORDER BY sortlist */ |
| 141595 | | - { 187, -4 }, /* (121) sortlist ::= sortlist COMMA expr sortorder */ |
| 141596 | | - { 187, -2 }, /* (122) sortlist ::= expr sortorder */ |
| 141597 | | - { 176, -1 }, /* (123) sortorder ::= ASC */ |
| 141598 | | - { 176, -1 }, /* (124) sortorder ::= DESC */ |
| 141599 | | - { 176, 0 }, /* (125) sortorder ::= */ |
| 141600 | | - { 203, 0 }, /* (126) groupby_opt ::= */ |
| 141601 | | - { 203, -3 }, /* (127) groupby_opt ::= GROUP BY nexprlist */ |
| 141602 | | - { 204, 0 }, /* (128) having_opt ::= */ |
| 141603 | | - { 204, -2 }, /* (129) having_opt ::= HAVING expr */ |
| 141604 | | - { 206, 0 }, /* (130) limit_opt ::= */ |
| 141605 | | - { 206, -2 }, /* (131) limit_opt ::= LIMIT expr */ |
| 141606 | | - { 206, -4 }, /* (132) limit_opt ::= LIMIT expr OFFSET expr */ |
| 141607 | | - { 206, -4 }, /* (133) limit_opt ::= LIMIT expr COMMA expr */ |
| 141608 | | - { 149, -6 }, /* (134) cmd ::= with DELETE FROM fullname indexed_opt where_opt */ |
| 141609 | | - { 202, 0 }, /* (135) where_opt ::= */ |
| 141610 | | - { 202, -2 }, /* (136) where_opt ::= WHERE expr */ |
| 141611 | | - { 149, -8 }, /* (137) cmd ::= with UPDATE orconf fullname indexed_opt SET setlist where_opt */ |
| 141612 | | - { 219, -5 }, /* (138) setlist ::= setlist COMMA nm EQ expr */ |
| 141613 | | - { 219, -7 }, /* (139) setlist ::= setlist COMMA LP idlist RP EQ expr */ |
| 141614 | | - { 219, -3 }, /* (140) setlist ::= nm EQ expr */ |
| 141615 | | - { 219, -5 }, /* (141) setlist ::= LP idlist RP EQ expr */ |
| 141616 | | - { 149, -6 }, /* (142) cmd ::= with insert_cmd INTO fullname idlist_opt select */ |
| 141617 | | - { 149, -7 }, /* (143) cmd ::= with insert_cmd INTO fullname idlist_opt DEFAULT VALUES */ |
| 141618 | | - { 220, -2 }, /* (144) insert_cmd ::= INSERT orconf */ |
| 141619 | | - { 220, -1 }, /* (145) insert_cmd ::= REPLACE */ |
| 141620 | | - { 221, 0 }, /* (146) idlist_opt ::= */ |
| 141621 | | - { 221, -3 }, /* (147) idlist_opt ::= LP idlist RP */ |
| 141622 | | - { 218, -3 }, /* (148) idlist ::= idlist COMMA nm */ |
| 141623 | | - { 218, -1 }, /* (149) idlist ::= nm */ |
| 141624 | | - { 174, -3 }, /* (150) expr ::= LP expr RP */ |
| 141625 | | - { 174, -1 }, /* (151) expr ::= ID|INDEXED */ |
| 141626 | | - { 174, -1 }, /* (152) expr ::= JOIN_KW */ |
| 141627 | | - { 174, -3 }, /* (153) expr ::= nm DOT nm */ |
| 141628 | | - { 174, -5 }, /* (154) expr ::= nm DOT nm DOT nm */ |
| 141629 | | - { 173, -1 }, /* (155) term ::= NULL|FLOAT|BLOB */ |
| 141630 | | - { 173, -1 }, /* (156) term ::= STRING */ |
| 141631 | | - { 173, -1 }, /* (157) term ::= INTEGER */ |
| 141632 | | - { 174, -1 }, /* (158) expr ::= VARIABLE */ |
| 141633 | | - { 174, -3 }, /* (159) expr ::= expr COLLATE ID|STRING */ |
| 141634 | | - { 174, -6 }, /* (160) expr ::= CAST LP expr AS typetoken RP */ |
| 141635 | | - { 174, -5 }, /* (161) expr ::= ID|INDEXED LP distinct exprlist RP */ |
| 141636 | | - { 174, -4 }, /* (162) expr ::= ID|INDEXED LP STAR RP */ |
| 141637 | | - { 173, -1 }, /* (163) term ::= CTIME_KW */ |
| 141638 | | - { 174, -5 }, /* (164) expr ::= LP nexprlist COMMA expr RP */ |
| 141639 | | - { 174, -3 }, /* (165) expr ::= expr AND expr */ |
| 141640 | | - { 174, -3 }, /* (166) expr ::= expr OR expr */ |
| 141641 | | - { 174, -3 }, /* (167) expr ::= expr LT|GT|GE|LE expr */ |
| 141642 | | - { 174, -3 }, /* (168) expr ::= expr EQ|NE expr */ |
| 141643 | | - { 174, -3 }, /* (169) expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr */ |
| 141644 | | - { 174, -3 }, /* (170) expr ::= expr PLUS|MINUS expr */ |
| 141645 | | - { 174, -3 }, /* (171) expr ::= expr STAR|SLASH|REM expr */ |
| 141646 | | - { 174, -3 }, /* (172) expr ::= expr CONCAT expr */ |
| 141647 | | - { 222, -2 }, /* (173) likeop ::= NOT LIKE_KW|MATCH */ |
| 141648 | | - { 174, -3 }, /* (174) expr ::= expr likeop expr */ |
| 141649 | | - { 174, -5 }, /* (175) expr ::= expr likeop expr ESCAPE expr */ |
| 141650 | | - { 174, -2 }, /* (176) expr ::= expr ISNULL|NOTNULL */ |
| 141651 | | - { 174, -3 }, /* (177) expr ::= expr NOT NULL */ |
| 141652 | | - { 174, -3 }, /* (178) expr ::= expr IS expr */ |
| 141653 | | - { 174, -4 }, /* (179) expr ::= expr IS NOT expr */ |
| 141654 | | - { 174, -2 }, /* (180) expr ::= NOT expr */ |
| 141655 | | - { 174, -2 }, /* (181) expr ::= BITNOT expr */ |
| 141656 | | - { 174, -2 }, /* (182) expr ::= MINUS expr */ |
| 141657 | | - { 174, -2 }, /* (183) expr ::= PLUS expr */ |
| 141658 | | - { 223, -1 }, /* (184) between_op ::= BETWEEN */ |
| 141659 | | - { 223, -2 }, /* (185) between_op ::= NOT BETWEEN */ |
| 141660 | | - { 174, -5 }, /* (186) expr ::= expr between_op expr AND expr */ |
| 141661 | | - { 224, -1 }, /* (187) in_op ::= IN */ |
| 141662 | | - { 224, -2 }, /* (188) in_op ::= NOT IN */ |
| 141663 | | - { 174, -5 }, /* (189) expr ::= expr in_op LP exprlist RP */ |
| 141664 | | - { 174, -3 }, /* (190) expr ::= LP select RP */ |
| 141665 | | - { 174, -5 }, /* (191) expr ::= expr in_op LP select RP */ |
| 141666 | | - { 174, -5 }, /* (192) expr ::= expr in_op nm dbnm paren_exprlist */ |
| 141667 | | - { 174, -4 }, /* (193) expr ::= EXISTS LP select RP */ |
| 141668 | | - { 174, -5 }, /* (194) expr ::= CASE case_operand case_exprlist case_else END */ |
| 141669 | | - { 227, -5 }, /* (195) case_exprlist ::= case_exprlist WHEN expr THEN expr */ |
| 141670 | | - { 227, -4 }, /* (196) case_exprlist ::= WHEN expr THEN expr */ |
| 141671 | | - { 228, -2 }, /* (197) case_else ::= ELSE expr */ |
| 141672 | | - { 228, 0 }, /* (198) case_else ::= */ |
| 141673 | | - { 226, -1 }, /* (199) case_operand ::= expr */ |
| 141674 | | - { 226, 0 }, /* (200) case_operand ::= */ |
| 141675 | | - { 209, 0 }, /* (201) exprlist ::= */ |
| 141676 | | - { 208, -3 }, /* (202) nexprlist ::= nexprlist COMMA expr */ |
| 141677 | | - { 208, -1 }, /* (203) nexprlist ::= expr */ |
| 141678 | | - { 225, 0 }, /* (204) paren_exprlist ::= */ |
| 141679 | | - { 225, -3 }, /* (205) paren_exprlist ::= LP exprlist RP */ |
| 141680 | | - { 149, -12 }, /* (206) cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP sortlist RP where_opt */ |
| 141681 | | - { 229, -1 }, /* (207) uniqueflag ::= UNIQUE */ |
| 141682 | | - { 229, 0 }, /* (208) uniqueflag ::= */ |
| 141683 | | - { 178, 0 }, /* (209) eidlist_opt ::= */ |
| 141684 | | - { 178, -3 }, /* (210) eidlist_opt ::= LP eidlist RP */ |
| 141685 | | - { 188, -5 }, /* (211) eidlist ::= eidlist COMMA nm collate sortorder */ |
| 141686 | | - { 188, -3 }, /* (212) eidlist ::= nm collate sortorder */ |
| 141687 | | - { 230, 0 }, /* (213) collate ::= */ |
| 141688 | | - { 230, -2 }, /* (214) collate ::= COLLATE ID|STRING */ |
| 141689 | | - { 149, -4 }, /* (215) cmd ::= DROP INDEX ifexists fullname */ |
| 141690 | | - { 149, -1 }, /* (216) cmd ::= VACUUM */ |
| 141691 | | - { 149, -2 }, /* (217) cmd ::= VACUUM nm */ |
| 141692 | | - { 149, -3 }, /* (218) cmd ::= PRAGMA nm dbnm */ |
| 141693 | | - { 149, -5 }, /* (219) cmd ::= PRAGMA nm dbnm EQ nmnum */ |
| 141694 | | - { 149, -6 }, /* (220) cmd ::= PRAGMA nm dbnm LP nmnum RP */ |
| 141695 | | - { 149, -5 }, /* (221) cmd ::= PRAGMA nm dbnm EQ minus_num */ |
| 141696 | | - { 149, -6 }, /* (222) cmd ::= PRAGMA nm dbnm LP minus_num RP */ |
| 141697 | | - { 169, -2 }, /* (223) plus_num ::= PLUS INTEGER|FLOAT */ |
| 141698 | | - { 170, -2 }, /* (224) minus_num ::= MINUS INTEGER|FLOAT */ |
| 141699 | | - { 149, -5 }, /* (225) cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END */ |
| 141700 | | - { 232, -11 }, /* (226) trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause */ |
| 141701 | | - { 234, -1 }, /* (227) trigger_time ::= BEFORE|AFTER */ |
| 141702 | | - { 234, -2 }, /* (228) trigger_time ::= INSTEAD OF */ |
| 141703 | | - { 234, 0 }, /* (229) trigger_time ::= */ |
| 141704 | | - { 235, -1 }, /* (230) trigger_event ::= DELETE|INSERT */ |
| 141705 | | - { 235, -1 }, /* (231) trigger_event ::= UPDATE */ |
| 141706 | | - { 235, -3 }, /* (232) trigger_event ::= UPDATE OF idlist */ |
| 141707 | | - { 237, 0 }, /* (233) when_clause ::= */ |
| 141708 | | - { 237, -2 }, /* (234) when_clause ::= WHEN expr */ |
| 141709 | | - { 233, -3 }, /* (235) trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI */ |
| 141710 | | - { 233, -2 }, /* (236) trigger_cmd_list ::= trigger_cmd SEMI */ |
| 141711 | | - { 239, -3 }, /* (237) trnm ::= nm DOT nm */ |
| 141712 | | - { 240, -3 }, /* (238) tridxby ::= INDEXED BY nm */ |
| 141713 | | - { 240, -2 }, /* (239) tridxby ::= NOT INDEXED */ |
| 141714 | | - { 238, -8 }, /* (240) trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist where_opt scanpt */ |
| 141715 | | - { 238, -7 }, /* (241) trigger_cmd ::= scanpt insert_cmd INTO trnm idlist_opt select scanpt */ |
| 141716 | | - { 238, -6 }, /* (242) trigger_cmd ::= DELETE FROM trnm tridxby where_opt scanpt */ |
| 141717 | | - { 238, -3 }, /* (243) trigger_cmd ::= scanpt select scanpt */ |
| 141718 | | - { 174, -4 }, /* (244) expr ::= RAISE LP IGNORE RP */ |
| 141719 | | - { 174, -6 }, /* (245) expr ::= RAISE LP raisetype COMMA nm RP */ |
| 141720 | | - { 192, -1 }, /* (246) raisetype ::= ROLLBACK */ |
| 141721 | | - { 192, -1 }, /* (247) raisetype ::= ABORT */ |
| 141722 | | - { 192, -1 }, /* (248) raisetype ::= FAIL */ |
| 141723 | | - { 149, -4 }, /* (249) cmd ::= DROP TRIGGER ifexists fullname */ |
| 141724 | | - { 149, -6 }, /* (250) cmd ::= ATTACH database_kw_opt expr AS expr key_opt */ |
| 141725 | | - { 149, -3 }, /* (251) cmd ::= DETACH database_kw_opt expr */ |
| 141726 | | - { 242, 0 }, /* (252) key_opt ::= */ |
| 141727 | | - { 242, -2 }, /* (253) key_opt ::= KEY expr */ |
| 141728 | | - { 149, -1 }, /* (254) cmd ::= REINDEX */ |
| 141729 | | - { 149, -3 }, /* (255) cmd ::= REINDEX nm dbnm */ |
| 141730 | | - { 149, -1 }, /* (256) cmd ::= ANALYZE */ |
| 141731 | | - { 149, -3 }, /* (257) cmd ::= ANALYZE nm dbnm */ |
| 141732 | | - { 149, -6 }, /* (258) cmd ::= ALTER TABLE fullname RENAME TO nm */ |
| 141733 | | - { 149, -7 }, /* (259) cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt columnname carglist */ |
| 141734 | | - { 243, -1 }, /* (260) add_column_fullname ::= fullname */ |
| 141735 | | - { 149, -1 }, /* (261) cmd ::= create_vtab */ |
| 141736 | | - { 149, -4 }, /* (262) cmd ::= create_vtab LP vtabarglist RP */ |
| 141737 | | - { 245, -8 }, /* (263) create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm */ |
| 141738 | | - { 247, 0 }, /* (264) vtabarg ::= */ |
| 141739 | | - { 248, -1 }, /* (265) vtabargtoken ::= ANY */ |
| 141740 | | - { 248, -3 }, /* (266) vtabargtoken ::= lp anylist RP */ |
| 141741 | | - { 249, -1 }, /* (267) lp ::= LP */ |
| 141742 | | - { 197, 0 }, /* (268) with ::= */ |
| 141743 | | - { 197, -2 }, /* (269) with ::= WITH wqlist */ |
| 141744 | | - { 197, -3 }, /* (270) with ::= WITH RECURSIVE wqlist */ |
| 141745 | | - { 251, -6 }, /* (271) wqlist ::= nm eidlist_opt AS LP select RP */ |
| 141746 | | - { 251, -8 }, /* (272) wqlist ::= wqlist COMMA nm eidlist_opt AS LP select RP */ |
| 141747 | | - { 144, -1 }, /* (273) input ::= cmdlist */ |
| 141748 | | - { 145, -2 }, /* (274) cmdlist ::= cmdlist ecmd */ |
| 141749 | | - { 145, -1 }, /* (275) cmdlist ::= ecmd */ |
| 141750 | | - { 146, -1 }, /* (276) ecmd ::= SEMI */ |
| 141751 | | - { 146, -3 }, /* (277) ecmd ::= explain cmdx SEMI */ |
| 141752 | | - { 147, 0 }, /* (278) explain ::= */ |
| 141753 | | - { 151, 0 }, /* (279) trans_opt ::= */ |
| 141754 | | - { 151, -1 }, /* (280) trans_opt ::= TRANSACTION */ |
| 141755 | | - { 151, -2 }, /* (281) trans_opt ::= TRANSACTION nm */ |
| 141756 | | - { 153, -1 }, /* (282) savepoint_opt ::= SAVEPOINT */ |
| 141757 | | - { 153, 0 }, /* (283) savepoint_opt ::= */ |
| 141758 | | - { 149, -2 }, /* (284) cmd ::= create_table create_table_args */ |
| 141759 | | - { 160, -4 }, /* (285) columnlist ::= columnlist COMMA columnname carglist */ |
| 141760 | | - { 160, -2 }, /* (286) columnlist ::= columnname carglist */ |
| 141761 | | - { 152, -1 }, /* (287) nm ::= ID|INDEXED */ |
| 141762 | | - { 152, -1 }, /* (288) nm ::= STRING */ |
| 141763 | | - { 152, -1 }, /* (289) nm ::= JOIN_KW */ |
| 141764 | | - { 166, -1 }, /* (290) typetoken ::= typename */ |
| 141765 | | - { 167, -1 }, /* (291) typename ::= ID|STRING */ |
| 141766 | | - { 168, -1 }, /* (292) signed ::= plus_num */ |
| 141767 | | - { 168, -1 }, /* (293) signed ::= minus_num */ |
| 141768 | | - { 165, -2 }, /* (294) carglist ::= carglist ccons */ |
| 141769 | | - { 165, 0 }, /* (295) carglist ::= */ |
| 141770 | | - { 172, -2 }, /* (296) ccons ::= NULL onconf */ |
| 141771 | | - { 161, -2 }, /* (297) conslist_opt ::= COMMA conslist */ |
| 141772 | | - { 184, -3 }, /* (298) conslist ::= conslist tconscomma tcons */ |
| 141773 | | - { 184, -1 }, /* (299) conslist ::= tcons */ |
| 141774 | | - { 185, 0 }, /* (300) tconscomma ::= */ |
| 141775 | | - { 189, -1 }, /* (301) defer_subclause_opt ::= defer_subclause */ |
| 141776 | | - { 191, -1 }, /* (302) resolvetype ::= raisetype */ |
| 141777 | | - { 195, -1 }, /* (303) selectnowith ::= oneselect */ |
| 141778 | | - { 196, -1 }, /* (304) oneselect ::= values */ |
| 141779 | | - { 210, -2 }, /* (305) sclp ::= selcollist COMMA */ |
| 141780 | | - { 211, -1 }, /* (306) as ::= ID|STRING */ |
| 141781 | | - { 174, -1 }, /* (307) expr ::= term */ |
| 141782 | | - { 222, -1 }, /* (308) likeop ::= LIKE_KW|MATCH */ |
| 141783 | | - { 209, -1 }, /* (309) exprlist ::= nexprlist */ |
| 141784 | | - { 231, -1 }, /* (310) nmnum ::= plus_num */ |
| 141785 | | - { 231, -1 }, /* (311) nmnum ::= nm */ |
| 141786 | | - { 231, -1 }, /* (312) nmnum ::= ON */ |
| 141787 | | - { 231, -1 }, /* (313) nmnum ::= DELETE */ |
| 141788 | | - { 231, -1 }, /* (314) nmnum ::= DEFAULT */ |
| 141789 | | - { 169, -1 }, /* (315) plus_num ::= INTEGER|FLOAT */ |
| 141790 | | - { 236, 0 }, /* (316) foreach_clause ::= */ |
| 141791 | | - { 236, -3 }, /* (317) foreach_clause ::= FOR EACH ROW */ |
| 141792 | | - { 239, -1 }, /* (318) trnm ::= nm */ |
| 141793 | | - { 240, 0 }, /* (319) tridxby ::= */ |
| 141794 | | - { 241, -1 }, /* (320) database_kw_opt ::= DATABASE */ |
| 141795 | | - { 241, 0 }, /* (321) database_kw_opt ::= */ |
| 141796 | | - { 244, 0 }, /* (322) kwcolumn_opt ::= */ |
| 141797 | | - { 244, -1 }, /* (323) kwcolumn_opt ::= COLUMNKW */ |
| 141798 | | - { 246, -1 }, /* (324) vtabarglist ::= vtabarg */ |
| 141799 | | - { 246, -3 }, /* (325) vtabarglist ::= vtabarglist COMMA vtabarg */ |
| 141800 | | - { 247, -2 }, /* (326) vtabarg ::= vtabarg vtabargtoken */ |
| 141801 | | - { 250, 0 }, /* (327) anylist ::= */ |
| 141802 | | - { 250, -4 }, /* (328) anylist ::= anylist LP anylist RP */ |
| 141803 | | - { 250, -2 }, /* (329) anylist ::= anylist ANY */ |
| 141929 | + { 163, -3 }, /* (80) select ::= WITH wqlist selectnowith */ |
| 141930 | + { 163, -4 }, /* (81) select ::= WITH RECURSIVE wqlist selectnowith */ |
| 141931 | + { 163, -1 }, /* (82) select ::= selectnowith */ |
| 141932 | + { 195, -3 }, /* (83) selectnowith ::= selectnowith multiselect_op oneselect */ |
| 141933 | + { 198, -1 }, /* (84) multiselect_op ::= UNION */ |
| 141934 | + { 198, -2 }, /* (85) multiselect_op ::= UNION ALL */ |
| 141935 | + { 198, -1 }, /* (86) multiselect_op ::= EXCEPT|INTERSECT */ |
| 141936 | + { 196, -9 }, /* (87) oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt orderby_opt limit_opt */ |
| 141937 | + { 207, -4 }, /* (88) values ::= VALUES LP nexprlist RP */ |
| 141938 | + { 207, -5 }, /* (89) values ::= values COMMA LP exprlist RP */ |
| 141939 | + { 199, -1 }, /* (90) distinct ::= DISTINCT */ |
| 141940 | + { 199, -1 }, /* (91) distinct ::= ALL */ |
| 141941 | + { 199, 0 }, /* (92) distinct ::= */ |
| 141942 | + { 210, 0 }, /* (93) sclp ::= */ |
| 141943 | + { 200, -5 }, /* (94) selcollist ::= sclp scanpt expr scanpt as */ |
| 141944 | + { 200, -3 }, /* (95) selcollist ::= sclp scanpt STAR */ |
| 141945 | + { 200, -5 }, /* (96) selcollist ::= sclp scanpt nm DOT STAR */ |
| 141946 | + { 211, -2 }, /* (97) as ::= AS nm */ |
| 141947 | + { 211, 0 }, /* (98) as ::= */ |
| 141948 | + { 201, 0 }, /* (99) from ::= */ |
| 141949 | + { 201, -2 }, /* (100) from ::= FROM seltablist */ |
| 141950 | + { 213, -2 }, /* (101) stl_prefix ::= seltablist joinop */ |
| 141951 | + { 213, 0 }, /* (102) stl_prefix ::= */ |
| 141952 | + { 212, -7 }, /* (103) seltablist ::= stl_prefix nm dbnm as indexed_opt on_opt using_opt */ |
| 141953 | + { 212, -9 }, /* (104) seltablist ::= stl_prefix nm dbnm LP exprlist RP as on_opt using_opt */ |
| 141954 | + { 212, -7 }, /* (105) seltablist ::= stl_prefix LP select RP as on_opt using_opt */ |
| 141955 | + { 212, -7 }, /* (106) seltablist ::= stl_prefix LP seltablist RP as on_opt using_opt */ |
| 141956 | + { 159, 0 }, /* (107) dbnm ::= */ |
| 141957 | + { 159, -2 }, /* (108) dbnm ::= DOT nm */ |
| 141958 | + { 194, -1 }, /* (109) fullname ::= nm */ |
| 141959 | + { 194, -3 }, /* (110) fullname ::= nm DOT nm */ |
| 141960 | + { 214, -1 }, /* (111) joinop ::= COMMA|JOIN */ |
| 141961 | + { 214, -2 }, /* (112) joinop ::= JOIN_KW JOIN */ |
| 141962 | + { 214, -3 }, /* (113) joinop ::= JOIN_KW nm JOIN */ |
| 141963 | + { 214, -4 }, /* (114) joinop ::= JOIN_KW nm nm JOIN */ |
| 141964 | + { 216, -2 }, /* (115) on_opt ::= ON expr */ |
| 141965 | + { 216, 0 }, /* (116) on_opt ::= */ |
| 141966 | + { 215, 0 }, /* (117) indexed_opt ::= */ |
| 141967 | + { 215, -3 }, /* (118) indexed_opt ::= INDEXED BY nm */ |
| 141968 | + { 215, -2 }, /* (119) indexed_opt ::= NOT INDEXED */ |
| 141969 | + { 217, -4 }, /* (120) using_opt ::= USING LP idlist RP */ |
| 141970 | + { 217, 0 }, /* (121) using_opt ::= */ |
| 141971 | + { 205, 0 }, /* (122) orderby_opt ::= */ |
| 141972 | + { 205, -3 }, /* (123) orderby_opt ::= ORDER BY sortlist */ |
| 141973 | + { 187, -4 }, /* (124) sortlist ::= sortlist COMMA expr sortorder */ |
| 141974 | + { 187, -2 }, /* (125) sortlist ::= expr sortorder */ |
| 141975 | + { 176, -1 }, /* (126) sortorder ::= ASC */ |
| 141976 | + { 176, -1 }, /* (127) sortorder ::= DESC */ |
| 141977 | + { 176, 0 }, /* (128) sortorder ::= */ |
| 141978 | + { 203, 0 }, /* (129) groupby_opt ::= */ |
| 141979 | + { 203, -3 }, /* (130) groupby_opt ::= GROUP BY nexprlist */ |
| 141980 | + { 204, 0 }, /* (131) having_opt ::= */ |
| 141981 | + { 204, -2 }, /* (132) having_opt ::= HAVING expr */ |
| 141982 | + { 206, 0 }, /* (133) limit_opt ::= */ |
| 141983 | + { 206, -2 }, /* (134) limit_opt ::= LIMIT expr */ |
| 141984 | + { 206, -4 }, /* (135) limit_opt ::= LIMIT expr OFFSET expr */ |
| 141985 | + { 206, -4 }, /* (136) limit_opt ::= LIMIT expr COMMA expr */ |
| 141986 | + { 149, -6 }, /* (137) cmd ::= with DELETE FROM fullname indexed_opt where_opt */ |
| 141987 | + { 202, 0 }, /* (138) where_opt ::= */ |
| 141988 | + { 202, -2 }, /* (139) where_opt ::= WHERE expr */ |
| 141989 | + { 149, -8 }, /* (140) cmd ::= with UPDATE orconf fullname indexed_opt SET setlist where_opt */ |
| 141990 | + { 220, -5 }, /* (141) setlist ::= setlist COMMA nm EQ expr */ |
| 141991 | + { 220, -7 }, /* (142) setlist ::= setlist COMMA LP idlist RP EQ expr */ |
| 141992 | + { 220, -3 }, /* (143) setlist ::= nm EQ expr */ |
| 141993 | + { 220, -5 }, /* (144) setlist ::= LP idlist RP EQ expr */ |
| 141994 | + { 149, -6 }, /* (145) cmd ::= with insert_cmd INTO fullname idlist_opt select */ |
| 141995 | + { 149, -7 }, /* (146) cmd ::= with insert_cmd INTO fullname idlist_opt DEFAULT VALUES */ |
| 141996 | + { 221, -2 }, /* (147) insert_cmd ::= INSERT orconf */ |
| 141997 | + { 221, -1 }, /* (148) insert_cmd ::= REPLACE */ |
| 141998 | + { 222, 0 }, /* (149) idlist_opt ::= */ |
| 141999 | + { 222, -3 }, /* (150) idlist_opt ::= LP idlist RP */ |
| 142000 | + { 218, -3 }, /* (151) idlist ::= idlist COMMA nm */ |
| 142001 | + { 218, -1 }, /* (152) idlist ::= nm */ |
| 142002 | + { 174, -3 }, /* (153) expr ::= LP expr RP */ |
| 142003 | + { 174, -1 }, /* (154) expr ::= ID|INDEXED */ |
| 142004 | + { 174, -1 }, /* (155) expr ::= JOIN_KW */ |
| 142005 | + { 174, -3 }, /* (156) expr ::= nm DOT nm */ |
| 142006 | + { 174, -5 }, /* (157) expr ::= nm DOT nm DOT nm */ |
| 142007 | + { 173, -1 }, /* (158) term ::= NULL|FLOAT|BLOB */ |
| 142008 | + { 173, -1 }, /* (159) term ::= STRING */ |
| 142009 | + { 173, -1 }, /* (160) term ::= INTEGER */ |
| 142010 | + { 174, -1 }, /* (161) expr ::= VARIABLE */ |
| 142011 | + { 174, -3 }, /* (162) expr ::= expr COLLATE ID|STRING */ |
| 142012 | + { 174, -6 }, /* (163) expr ::= CAST LP expr AS typetoken RP */ |
| 142013 | + { 174, -5 }, /* (164) expr ::= ID|INDEXED LP distinct exprlist RP */ |
| 142014 | + { 174, -4 }, /* (165) expr ::= ID|INDEXED LP STAR RP */ |
| 142015 | + { 173, -1 }, /* (166) term ::= CTIME_KW */ |
| 142016 | + { 174, -5 }, /* (167) expr ::= LP nexprlist COMMA expr RP */ |
| 142017 | + { 174, -3 }, /* (168) expr ::= expr AND expr */ |
| 142018 | + { 174, -3 }, /* (169) expr ::= expr OR expr */ |
| 142019 | + { 174, -3 }, /* (170) expr ::= expr LT|GT|GE|LE expr */ |
| 142020 | + { 174, -3 }, /* (171) expr ::= expr EQ|NE expr */ |
| 142021 | + { 174, -3 }, /* (172) expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr */ |
| 142022 | + { 174, -3 }, /* (173) expr ::= expr PLUS|MINUS expr */ |
| 142023 | + { 174, -3 }, /* (174) expr ::= expr STAR|SLASH|REM expr */ |
| 142024 | + { 174, -3 }, /* (175) expr ::= expr CONCAT expr */ |
| 142025 | + { 223, -2 }, /* (176) likeop ::= NOT LIKE_KW|MATCH */ |
| 142026 | + { 174, -3 }, /* (177) expr ::= expr likeop expr */ |
| 142027 | + { 174, -5 }, /* (178) expr ::= expr likeop expr ESCAPE expr */ |
| 142028 | + { 174, -2 }, /* (179) expr ::= expr ISNULL|NOTNULL */ |
| 142029 | + { 174, -3 }, /* (180) expr ::= expr NOT NULL */ |
| 142030 | + { 174, -3 }, /* (181) expr ::= expr IS expr */ |
| 142031 | + { 174, -4 }, /* (182) expr ::= expr IS NOT expr */ |
| 142032 | + { 174, -2 }, /* (183) expr ::= NOT expr */ |
| 142033 | + { 174, -2 }, /* (184) expr ::= BITNOT expr */ |
| 142034 | + { 174, -2 }, /* (185) expr ::= MINUS expr */ |
| 142035 | + { 174, -2 }, /* (186) expr ::= PLUS expr */ |
| 142036 | + { 224, -1 }, /* (187) between_op ::= BETWEEN */ |
| 142037 | + { 224, -2 }, /* (188) between_op ::= NOT BETWEEN */ |
| 142038 | + { 174, -5 }, /* (189) expr ::= expr between_op expr AND expr */ |
| 142039 | + { 225, -1 }, /* (190) in_op ::= IN */ |
| 142040 | + { 225, -2 }, /* (191) in_op ::= NOT IN */ |
| 142041 | + { 174, -5 }, /* (192) expr ::= expr in_op LP exprlist RP */ |
| 142042 | + { 174, -3 }, /* (193) expr ::= LP select RP */ |
| 142043 | + { 174, -5 }, /* (194) expr ::= expr in_op LP select RP */ |
| 142044 | + { 174, -5 }, /* (195) expr ::= expr in_op nm dbnm paren_exprlist */ |
| 142045 | + { 174, -4 }, /* (196) expr ::= EXISTS LP select RP */ |
| 142046 | + { 174, -5 }, /* (197) expr ::= CASE case_operand case_exprlist case_else END */ |
| 142047 | + { 228, -5 }, /* (198) case_exprlist ::= case_exprlist WHEN expr THEN expr */ |
| 142048 | + { 228, -4 }, /* (199) case_exprlist ::= WHEN expr THEN expr */ |
| 142049 | + { 229, -2 }, /* (200) case_else ::= ELSE expr */ |
| 142050 | + { 229, 0 }, /* (201) case_else ::= */ |
| 142051 | + { 227, -1 }, /* (202) case_operand ::= expr */ |
| 142052 | + { 227, 0 }, /* (203) case_operand ::= */ |
| 142053 | + { 209, 0 }, /* (204) exprlist ::= */ |
| 142054 | + { 208, -3 }, /* (205) nexprlist ::= nexprlist COMMA expr */ |
| 142055 | + { 208, -1 }, /* (206) nexprlist ::= expr */ |
| 142056 | + { 226, 0 }, /* (207) paren_exprlist ::= */ |
| 142057 | + { 226, -3 }, /* (208) paren_exprlist ::= LP exprlist RP */ |
| 142058 | + { 149, -12 }, /* (209) cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP sortlist RP where_opt */ |
| 142059 | + { 230, -1 }, /* (210) uniqueflag ::= UNIQUE */ |
| 142060 | + { 230, 0 }, /* (211) uniqueflag ::= */ |
| 142061 | + { 178, 0 }, /* (212) eidlist_opt ::= */ |
| 142062 | + { 178, -3 }, /* (213) eidlist_opt ::= LP eidlist RP */ |
| 142063 | + { 188, -5 }, /* (214) eidlist ::= eidlist COMMA nm collate sortorder */ |
| 142064 | + { 188, -3 }, /* (215) eidlist ::= nm collate sortorder */ |
| 142065 | + { 231, 0 }, /* (216) collate ::= */ |
| 142066 | + { 231, -2 }, /* (217) collate ::= COLLATE ID|STRING */ |
| 142067 | + { 149, -4 }, /* (218) cmd ::= DROP INDEX ifexists fullname */ |
| 142068 | + { 149, -1 }, /* (219) cmd ::= VACUUM */ |
| 142069 | + { 149, -2 }, /* (220) cmd ::= VACUUM nm */ |
| 142070 | + { 149, -3 }, /* (221) cmd ::= PRAGMA nm dbnm */ |
| 142071 | + { 149, -5 }, /* (222) cmd ::= PRAGMA nm dbnm EQ nmnum */ |
| 142072 | + { 149, -6 }, /* (223) cmd ::= PRAGMA nm dbnm LP nmnum RP */ |
| 142073 | + { 149, -5 }, /* (224) cmd ::= PRAGMA nm dbnm EQ minus_num */ |
| 142074 | + { 149, -6 }, /* (225) cmd ::= PRAGMA nm dbnm LP minus_num RP */ |
| 142075 | + { 169, -2 }, /* (226) plus_num ::= PLUS INTEGER|FLOAT */ |
| 142076 | + { 170, -2 }, /* (227) minus_num ::= MINUS INTEGER|FLOAT */ |
| 142077 | + { 149, -5 }, /* (228) cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END */ |
| 142078 | + { 233, -11 }, /* (229) trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause */ |
| 142079 | + { 235, -1 }, /* (230) trigger_time ::= BEFORE|AFTER */ |
| 142080 | + { 235, -2 }, /* (231) trigger_time ::= INSTEAD OF */ |
| 142081 | + { 235, 0 }, /* (232) trigger_time ::= */ |
| 142082 | + { 236, -1 }, /* (233) trigger_event ::= DELETE|INSERT */ |
| 142083 | + { 236, -1 }, /* (234) trigger_event ::= UPDATE */ |
| 142084 | + { 236, -3 }, /* (235) trigger_event ::= UPDATE OF idlist */ |
| 142085 | + { 238, 0 }, /* (236) when_clause ::= */ |
| 142086 | + { 238, -2 }, /* (237) when_clause ::= WHEN expr */ |
| 142087 | + { 234, -3 }, /* (238) trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI */ |
| 142088 | + { 234, -2 }, /* (239) trigger_cmd_list ::= trigger_cmd SEMI */ |
| 142089 | + { 240, -3 }, /* (240) trnm ::= nm DOT nm */ |
| 142090 | + { 241, -3 }, /* (241) tridxby ::= INDEXED BY nm */ |
| 142091 | + { 241, -2 }, /* (242) tridxby ::= NOT INDEXED */ |
| 142092 | + { 239, -8 }, /* (243) trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist where_opt scanpt */ |
| 142093 | + { 239, -7 }, /* (244) trigger_cmd ::= scanpt insert_cmd INTO trnm idlist_opt select scanpt */ |
| 142094 | + { 239, -6 }, /* (245) trigger_cmd ::= DELETE FROM trnm tridxby where_opt scanpt */ |
| 142095 | + { 239, -3 }, /* (246) trigger_cmd ::= scanpt select scanpt */ |
| 142096 | + { 174, -4 }, /* (247) expr ::= RAISE LP IGNORE RP */ |
| 142097 | + { 174, -6 }, /* (248) expr ::= RAISE LP raisetype COMMA nm RP */ |
| 142098 | + { 192, -1 }, /* (249) raisetype ::= ROLLBACK */ |
| 142099 | + { 192, -1 }, /* (250) raisetype ::= ABORT */ |
| 142100 | + { 192, -1 }, /* (251) raisetype ::= FAIL */ |
| 142101 | + { 149, -4 }, /* (252) cmd ::= DROP TRIGGER ifexists fullname */ |
| 142102 | + { 149, -6 }, /* (253) cmd ::= ATTACH database_kw_opt expr AS expr key_opt */ |
| 142103 | + { 149, -3 }, /* (254) cmd ::= DETACH database_kw_opt expr */ |
| 142104 | + { 243, 0 }, /* (255) key_opt ::= */ |
| 142105 | + { 243, -2 }, /* (256) key_opt ::= KEY expr */ |
| 142106 | + { 149, -1 }, /* (257) cmd ::= REINDEX */ |
| 142107 | + { 149, -3 }, /* (258) cmd ::= REINDEX nm dbnm */ |
| 142108 | + { 149, -1 }, /* (259) cmd ::= ANALYZE */ |
| 142109 | + { 149, -3 }, /* (260) cmd ::= ANALYZE nm dbnm */ |
| 142110 | + { 149, -6 }, /* (261) cmd ::= ALTER TABLE fullname RENAME TO nm */ |
| 142111 | + { 149, -7 }, /* (262) cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt columnname carglist */ |
| 142112 | + { 244, -1 }, /* (263) add_column_fullname ::= fullname */ |
| 142113 | + { 149, -1 }, /* (264) cmd ::= create_vtab */ |
| 142114 | + { 149, -4 }, /* (265) cmd ::= create_vtab LP vtabarglist RP */ |
| 142115 | + { 246, -8 }, /* (266) create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm */ |
| 142116 | + { 248, 0 }, /* (267) vtabarg ::= */ |
| 142117 | + { 249, -1 }, /* (268) vtabargtoken ::= ANY */ |
| 142118 | + { 249, -3 }, /* (269) vtabargtoken ::= lp anylist RP */ |
| 142119 | + { 250, -1 }, /* (270) lp ::= LP */ |
| 142120 | + { 219, -2 }, /* (271) with ::= WITH wqlist */ |
| 142121 | + { 219, -3 }, /* (272) with ::= WITH RECURSIVE wqlist */ |
| 142122 | + { 197, -6 }, /* (273) wqlist ::= nm eidlist_opt AS LP select RP */ |
| 142123 | + { 197, -8 }, /* (274) wqlist ::= wqlist COMMA nm eidlist_opt AS LP select RP */ |
| 142124 | + { 144, -1 }, /* (275) input ::= cmdlist */ |
| 142125 | + { 145, -2 }, /* (276) cmdlist ::= cmdlist ecmd */ |
| 142126 | + { 145, -1 }, /* (277) cmdlist ::= ecmd */ |
| 142127 | + { 146, -1 }, /* (278) ecmd ::= SEMI */ |
| 142128 | + { 146, -3 }, /* (279) ecmd ::= explain cmdx SEMI */ |
| 142129 | + { 147, 0 }, /* (280) explain ::= */ |
| 142130 | + { 151, 0 }, /* (281) trans_opt ::= */ |
| 142131 | + { 151, -1 }, /* (282) trans_opt ::= TRANSACTION */ |
| 142132 | + { 151, -2 }, /* (283) trans_opt ::= TRANSACTION nm */ |
| 142133 | + { 153, -1 }, /* (284) savepoint_opt ::= SAVEPOINT */ |
| 142134 | + { 153, 0 }, /* (285) savepoint_opt ::= */ |
| 142135 | + { 149, -2 }, /* (286) cmd ::= create_table create_table_args */ |
| 142136 | + { 160, -4 }, /* (287) columnlist ::= columnlist COMMA columnname carglist */ |
| 142137 | + { 160, -2 }, /* (288) columnlist ::= columnname carglist */ |
| 142138 | + { 152, -1 }, /* (289) nm ::= ID|INDEXED */ |
| 142139 | + { 152, -1 }, /* (290) nm ::= STRING */ |
| 142140 | + { 152, -1 }, /* (291) nm ::= JOIN_KW */ |
| 142141 | + { 166, -1 }, /* (292) typetoken ::= typename */ |
| 142142 | + { 167, -1 }, /* (293) typename ::= ID|STRING */ |
| 142143 | + { 168, -1 }, /* (294) signed ::= plus_num */ |
| 142144 | + { 168, -1 }, /* (295) signed ::= minus_num */ |
| 142145 | + { 165, -2 }, /* (296) carglist ::= carglist ccons */ |
| 142146 | + { 165, 0 }, /* (297) carglist ::= */ |
| 142147 | + { 172, -2 }, /* (298) ccons ::= NULL onconf */ |
| 142148 | + { 161, -2 }, /* (299) conslist_opt ::= COMMA conslist */ |
| 142149 | + { 184, -3 }, /* (300) conslist ::= conslist tconscomma tcons */ |
| 142150 | + { 184, -1 }, /* (301) conslist ::= tcons */ |
| 142151 | + { 185, 0 }, /* (302) tconscomma ::= */ |
| 142152 | + { 189, -1 }, /* (303) defer_subclause_opt ::= defer_subclause */ |
| 142153 | + { 191, -1 }, /* (304) resolvetype ::= raisetype */ |
| 142154 | + { 195, -1 }, /* (305) selectnowith ::= oneselect */ |
| 142155 | + { 196, -1 }, /* (306) oneselect ::= values */ |
| 142156 | + { 210, -2 }, /* (307) sclp ::= selcollist COMMA */ |
| 142157 | + { 211, -1 }, /* (308) as ::= ID|STRING */ |
| 142158 | + { 174, -1 }, /* (309) expr ::= term */ |
| 142159 | + { 223, -1 }, /* (310) likeop ::= LIKE_KW|MATCH */ |
| 142160 | + { 209, -1 }, /* (311) exprlist ::= nexprlist */ |
| 142161 | + { 232, -1 }, /* (312) nmnum ::= plus_num */ |
| 142162 | + { 232, -1 }, /* (313) nmnum ::= nm */ |
| 142163 | + { 232, -1 }, /* (314) nmnum ::= ON */ |
| 142164 | + { 232, -1 }, /* (315) nmnum ::= DELETE */ |
| 142165 | + { 232, -1 }, /* (316) nmnum ::= DEFAULT */ |
| 142166 | + { 169, -1 }, /* (317) plus_num ::= INTEGER|FLOAT */ |
| 142167 | + { 237, 0 }, /* (318) foreach_clause ::= */ |
| 142168 | + { 237, -3 }, /* (319) foreach_clause ::= FOR EACH ROW */ |
| 142169 | + { 240, -1 }, /* (320) trnm ::= nm */ |
| 142170 | + { 241, 0 }, /* (321) tridxby ::= */ |
| 142171 | + { 242, -1 }, /* (322) database_kw_opt ::= DATABASE */ |
| 142172 | + { 242, 0 }, /* (323) database_kw_opt ::= */ |
| 142173 | + { 245, 0 }, /* (324) kwcolumn_opt ::= */ |
| 142174 | + { 245, -1 }, /* (325) kwcolumn_opt ::= COLUMNKW */ |
| 142175 | + { 247, -1 }, /* (326) vtabarglist ::= vtabarg */ |
| 142176 | + { 247, -3 }, /* (327) vtabarglist ::= vtabarglist COMMA vtabarg */ |
| 142177 | + { 248, -2 }, /* (328) vtabarg ::= vtabarg vtabargtoken */ |
| 142178 | + { 251, 0 }, /* (329) anylist ::= */ |
| 142179 | + { 251, -4 }, /* (330) anylist ::= anylist LP anylist RP */ |
| 142180 | + { 251, -2 }, /* (331) anylist ::= anylist ANY */ |
| 142181 | + { 219, 0 }, /* (332) with ::= */ |
| 141804 | 142182 | }; |
| 141805 | 142183 | |
| 141806 | 142184 | static void yy_accept(yyParser*); /* Forward Declaration */ |
| 141807 | 142185 | |
| 141808 | 142186 | /* |
| | @@ -141932,12 +142310,12 @@ |
| 141932 | 142310 | case 21: /* table_options ::= */ yytestcase(yyruleno==21); |
| 141933 | 142311 | case 42: /* autoinc ::= */ yytestcase(yyruleno==42); |
| 141934 | 142312 | case 57: /* init_deferred_pred_opt ::= */ yytestcase(yyruleno==57); |
| 141935 | 142313 | case 67: /* defer_subclause_opt ::= */ yytestcase(yyruleno==67); |
| 141936 | 142314 | case 76: /* ifexists ::= */ yytestcase(yyruleno==76); |
| 141937 | | - case 90: /* distinct ::= */ yytestcase(yyruleno==90); |
| 141938 | | - case 213: /* collate ::= */ yytestcase(yyruleno==213); |
| 142315 | + case 92: /* distinct ::= */ yytestcase(yyruleno==92); |
| 142316 | + case 216: /* collate ::= */ yytestcase(yyruleno==216); |
| 141939 | 142317 | {yymsp[1].minor.yy4 = 0;} |
| 141940 | 142318 | break; |
| 141941 | 142319 | case 16: /* ifnotexists ::= IF NOT EXISTS */ |
| 141942 | 142320 | {yymsp[-2].minor.yy4 = 1;} |
| 141943 | 142321 | break; |
| | @@ -141969,11 +142347,11 @@ |
| 141969 | 142347 | case 23: /* columnname ::= nm typetoken */ |
| 141970 | 142348 | {sqlite3AddColumn(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0);} |
| 141971 | 142349 | break; |
| 141972 | 142350 | case 24: /* typetoken ::= */ |
| 141973 | 142351 | case 60: /* conslist_opt ::= */ yytestcase(yyruleno==60); |
| 141974 | | - case 96: /* as ::= */ yytestcase(yyruleno==96); |
| 142352 | + case 98: /* as ::= */ yytestcase(yyruleno==98); |
| 141975 | 142353 | {yymsp[1].minor.yy0.n = 0; yymsp[1].minor.yy0.z = 0;} |
| 141976 | 142354 | break; |
| 141977 | 142355 | case 25: /* typetoken ::= typename LP signed RP */ |
| 141978 | 142356 | { |
| 141979 | 142357 | yymsp[-3].minor.yy0.n = (int)(&yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n] - yymsp[-3].minor.yy0.z); |
| | @@ -142080,18 +142458,18 @@ |
| 142080 | 142458 | case 55: /* defer_subclause ::= NOT DEFERRABLE init_deferred_pred_opt */ |
| 142081 | 142459 | {yymsp[-2].minor.yy4 = 0;} |
| 142082 | 142460 | break; |
| 142083 | 142461 | case 56: /* defer_subclause ::= DEFERRABLE init_deferred_pred_opt */ |
| 142084 | 142462 | case 71: /* orconf ::= OR resolvetype */ yytestcase(yyruleno==71); |
| 142085 | | - case 144: /* insert_cmd ::= INSERT orconf */ yytestcase(yyruleno==144); |
| 142463 | + case 147: /* insert_cmd ::= INSERT orconf */ yytestcase(yyruleno==147); |
| 142086 | 142464 | {yymsp[-1].minor.yy4 = yymsp[0].minor.yy4;} |
| 142087 | 142465 | break; |
| 142088 | 142466 | case 58: /* init_deferred_pred_opt ::= INITIALLY DEFERRED */ |
| 142089 | 142467 | case 75: /* ifexists ::= IF EXISTS */ yytestcase(yyruleno==75); |
| 142090 | | - case 185: /* between_op ::= NOT BETWEEN */ yytestcase(yyruleno==185); |
| 142091 | | - case 188: /* in_op ::= NOT IN */ yytestcase(yyruleno==188); |
| 142092 | | - case 214: /* collate ::= COLLATE ID|STRING */ yytestcase(yyruleno==214); |
| 142468 | + case 188: /* between_op ::= NOT BETWEEN */ yytestcase(yyruleno==188); |
| 142469 | + case 191: /* in_op ::= NOT IN */ yytestcase(yyruleno==191); |
| 142470 | + case 217: /* collate ::= COLLATE ID|STRING */ yytestcase(yyruleno==217); |
| 142093 | 142471 | {yymsp[-1].minor.yy4 = 1;} |
| 142094 | 142472 | break; |
| 142095 | 142473 | case 59: /* init_deferred_pred_opt ::= INITIALLY IMMEDIATE */ |
| 142096 | 142474 | {yymsp[-1].minor.yy4 = 0;} |
| 142097 | 142475 | break; |
| | @@ -142123,11 +142501,11 @@ |
| 142123 | 142501 | break; |
| 142124 | 142502 | case 72: /* resolvetype ::= IGNORE */ |
| 142125 | 142503 | {yymsp[0].minor.yy4 = OE_Ignore;} |
| 142126 | 142504 | break; |
| 142127 | 142505 | case 73: /* resolvetype ::= REPLACE */ |
| 142128 | | - case 145: /* insert_cmd ::= REPLACE */ yytestcase(yyruleno==145); |
| 142506 | + case 148: /* insert_cmd ::= REPLACE */ yytestcase(yyruleno==148); |
| 142129 | 142507 | {yymsp[0].minor.yy4 = OE_Replace;} |
| 142130 | 142508 | break; |
| 142131 | 142509 | case 74: /* cmd ::= DROP TABLE ifexists fullname */ |
| 142132 | 142510 | { |
| 142133 | 142511 | sqlite3DropTable(pParse, yymsp[0].minor.yy259, 0, yymsp[-1].minor.yy4); |
| | @@ -142148,23 +142526,44 @@ |
| 142148 | 142526 | SelectDest dest = {SRT_Output, 0, 0, 0, 0, 0}; |
| 142149 | 142527 | sqlite3Select(pParse, yymsp[0].minor.yy387, &dest); |
| 142150 | 142528 | sqlite3SelectDelete(pParse->db, yymsp[0].minor.yy387); |
| 142151 | 142529 | } |
| 142152 | 142530 | break; |
| 142153 | | - case 80: /* select ::= with selectnowith */ |
| 142531 | + case 80: /* select ::= WITH wqlist selectnowith */ |
| 142532 | +{ |
| 142533 | + Select *p = yymsp[0].minor.yy387; |
| 142534 | + if( p ){ |
| 142535 | + p->pWith = yymsp[-1].minor.yy451; |
| 142536 | + parserDoubleLinkSelect(pParse, p); |
| 142537 | + }else{ |
| 142538 | + sqlite3WithDelete(pParse->db, yymsp[-1].minor.yy451); |
| 142539 | + } |
| 142540 | + yymsp[-2].minor.yy387 = p; |
| 142541 | +} |
| 142542 | + break; |
| 142543 | + case 81: /* select ::= WITH RECURSIVE wqlist selectnowith */ |
| 142154 | 142544 | { |
| 142155 | 142545 | Select *p = yymsp[0].minor.yy387; |
| 142156 | 142546 | if( p ){ |
| 142157 | 142547 | p->pWith = yymsp[-1].minor.yy451; |
| 142158 | 142548 | parserDoubleLinkSelect(pParse, p); |
| 142159 | 142549 | }else{ |
| 142160 | 142550 | sqlite3WithDelete(pParse->db, yymsp[-1].minor.yy451); |
| 142161 | 142551 | } |
| 142162 | | - yymsp[-1].minor.yy387 = p; /*A-overwrites-W*/ |
| 142552 | + yymsp[-3].minor.yy387 = p; |
| 142163 | 142553 | } |
| 142164 | 142554 | break; |
| 142165 | | - case 81: /* selectnowith ::= selectnowith multiselect_op oneselect */ |
| 142555 | + case 82: /* select ::= selectnowith */ |
| 142556 | +{ |
| 142557 | + Select *p = yymsp[0].minor.yy387; |
| 142558 | + if( p ){ |
| 142559 | + parserDoubleLinkSelect(pParse, p); |
| 142560 | + } |
| 142561 | + yymsp[0].minor.yy387 = p; /*A-overwrites-X*/ |
| 142562 | +} |
| 142563 | + break; |
| 142564 | + case 83: /* selectnowith ::= selectnowith multiselect_op oneselect */ |
| 142166 | 142565 | { |
| 142167 | 142566 | Select *pRhs = yymsp[0].minor.yy387; |
| 142168 | 142567 | Select *pLhs = yymsp[-2].minor.yy387; |
| 142169 | 142568 | if( pRhs && pRhs->pPrior ){ |
| 142170 | 142569 | SrcList *pFrom; |
| | @@ -142184,18 +142583,18 @@ |
| 142184 | 142583 | sqlite3SelectDelete(pParse->db, pLhs); |
| 142185 | 142584 | } |
| 142186 | 142585 | yymsp[-2].minor.yy387 = pRhs; |
| 142187 | 142586 | } |
| 142188 | 142587 | break; |
| 142189 | | - case 82: /* multiselect_op ::= UNION */ |
| 142190 | | - case 84: /* multiselect_op ::= EXCEPT|INTERSECT */ yytestcase(yyruleno==84); |
| 142588 | + case 84: /* multiselect_op ::= UNION */ |
| 142589 | + case 86: /* multiselect_op ::= EXCEPT|INTERSECT */ yytestcase(yyruleno==86); |
| 142191 | 142590 | {yymsp[0].minor.yy4 = yymsp[0].major; /*A-overwrites-OP*/} |
| 142192 | 142591 | break; |
| 142193 | | - case 83: /* multiselect_op ::= UNION ALL */ |
| 142592 | + case 85: /* multiselect_op ::= UNION ALL */ |
| 142194 | 142593 | {yymsp[-1].minor.yy4 = TK_ALL;} |
| 142195 | 142594 | break; |
| 142196 | | - case 85: /* oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt orderby_opt limit_opt */ |
| 142595 | + case 87: /* oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt orderby_opt limit_opt */ |
| 142197 | 142596 | { |
| 142198 | 142597 | #if SELECTTRACE_ENABLED |
| 142199 | 142598 | Token s = yymsp[-8].minor.yy0; /*A-overwrites-S*/ |
| 142200 | 142599 | #endif |
| 142201 | 142600 | yymsp[-8].minor.yy387 = sqlite3SelectNew(pParse,yymsp[-6].minor.yy322,yymsp[-5].minor.yy259,yymsp[-4].minor.yy314,yymsp[-3].minor.yy322,yymsp[-2].minor.yy314,yymsp[-1].minor.yy322,yymsp[-7].minor.yy4,yymsp[0].minor.yy314); |
| | @@ -142222,16 +142621,16 @@ |
| 142222 | 142621 | } |
| 142223 | 142622 | } |
| 142224 | 142623 | #endif /* SELECTRACE_ENABLED */ |
| 142225 | 142624 | } |
| 142226 | 142625 | break; |
| 142227 | | - case 86: /* values ::= VALUES LP nexprlist RP */ |
| 142626 | + case 88: /* values ::= VALUES LP nexprlist RP */ |
| 142228 | 142627 | { |
| 142229 | 142628 | yymsp[-3].minor.yy387 = sqlite3SelectNew(pParse,yymsp[-1].minor.yy322,0,0,0,0,0,SF_Values,0); |
| 142230 | 142629 | } |
| 142231 | 142630 | break; |
| 142232 | | - case 87: /* values ::= values COMMA LP exprlist RP */ |
| 142631 | + case 89: /* values ::= values COMMA LP exprlist RP */ |
| 142233 | 142632 | { |
| 142234 | 142633 | Select *pRight, *pLeft = yymsp[-4].minor.yy387; |
| 142235 | 142634 | pRight = sqlite3SelectNew(pParse,yymsp[-1].minor.yy322,0,0,0,0,0,SF_Values|SF_MultiValue,0); |
| 142236 | 142635 | if( ALWAYS(pLeft) ) pLeft->selFlags &= ~SF_MultiValue; |
| 142237 | 142636 | if( pRight ){ |
| | @@ -142241,86 +142640,86 @@ |
| 142241 | 142640 | }else{ |
| 142242 | 142641 | yymsp[-4].minor.yy387 = pLeft; |
| 142243 | 142642 | } |
| 142244 | 142643 | } |
| 142245 | 142644 | break; |
| 142246 | | - case 88: /* distinct ::= DISTINCT */ |
| 142645 | + case 90: /* distinct ::= DISTINCT */ |
| 142247 | 142646 | {yymsp[0].minor.yy4 = SF_Distinct;} |
| 142248 | 142647 | break; |
| 142249 | | - case 89: /* distinct ::= ALL */ |
| 142648 | + case 91: /* distinct ::= ALL */ |
| 142250 | 142649 | {yymsp[0].minor.yy4 = SF_All;} |
| 142251 | 142650 | break; |
| 142252 | | - case 91: /* sclp ::= */ |
| 142253 | | - case 119: /* orderby_opt ::= */ yytestcase(yyruleno==119); |
| 142254 | | - case 126: /* groupby_opt ::= */ yytestcase(yyruleno==126); |
| 142255 | | - case 201: /* exprlist ::= */ yytestcase(yyruleno==201); |
| 142256 | | - case 204: /* paren_exprlist ::= */ yytestcase(yyruleno==204); |
| 142257 | | - case 209: /* eidlist_opt ::= */ yytestcase(yyruleno==209); |
| 142651 | + case 93: /* sclp ::= */ |
| 142652 | + case 122: /* orderby_opt ::= */ yytestcase(yyruleno==122); |
| 142653 | + case 129: /* groupby_opt ::= */ yytestcase(yyruleno==129); |
| 142654 | + case 204: /* exprlist ::= */ yytestcase(yyruleno==204); |
| 142655 | + case 207: /* paren_exprlist ::= */ yytestcase(yyruleno==207); |
| 142656 | + case 212: /* eidlist_opt ::= */ yytestcase(yyruleno==212); |
| 142258 | 142657 | {yymsp[1].minor.yy322 = 0;} |
| 142259 | 142658 | break; |
| 142260 | | - case 92: /* selcollist ::= sclp scanpt expr scanpt as */ |
| 142659 | + case 94: /* selcollist ::= sclp scanpt expr scanpt as */ |
| 142261 | 142660 | { |
| 142262 | 142661 | yymsp[-4].minor.yy322 = sqlite3ExprListAppend(pParse, yymsp[-4].minor.yy322, yymsp[-2].minor.yy314); |
| 142263 | 142662 | if( yymsp[0].minor.yy0.n>0 ) sqlite3ExprListSetName(pParse, yymsp[-4].minor.yy322, &yymsp[0].minor.yy0, 1); |
| 142264 | 142663 | sqlite3ExprListSetSpan(pParse,yymsp[-4].minor.yy322,yymsp[-3].minor.yy336,yymsp[-1].minor.yy336); |
| 142265 | 142664 | } |
| 142266 | 142665 | break; |
| 142267 | | - case 93: /* selcollist ::= sclp scanpt STAR */ |
| 142666 | + case 95: /* selcollist ::= sclp scanpt STAR */ |
| 142268 | 142667 | { |
| 142269 | 142668 | Expr *p = sqlite3Expr(pParse->db, TK_ASTERISK, 0); |
| 142270 | 142669 | yymsp[-2].minor.yy322 = sqlite3ExprListAppend(pParse, yymsp[-2].minor.yy322, p); |
| 142271 | 142670 | } |
| 142272 | 142671 | break; |
| 142273 | | - case 94: /* selcollist ::= sclp scanpt nm DOT STAR */ |
| 142672 | + case 96: /* selcollist ::= sclp scanpt nm DOT STAR */ |
| 142274 | 142673 | { |
| 142275 | 142674 | Expr *pRight = sqlite3PExpr(pParse, TK_ASTERISK, 0, 0); |
| 142276 | 142675 | Expr *pLeft = sqlite3ExprAlloc(pParse->db, TK_ID, &yymsp[-2].minor.yy0, 1); |
| 142277 | 142676 | Expr *pDot = sqlite3PExpr(pParse, TK_DOT, pLeft, pRight); |
| 142278 | 142677 | yymsp[-4].minor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy322, pDot); |
| 142279 | 142678 | } |
| 142280 | 142679 | break; |
| 142281 | | - case 95: /* as ::= AS nm */ |
| 142282 | | - case 106: /* dbnm ::= DOT nm */ yytestcase(yyruleno==106); |
| 142283 | | - case 223: /* plus_num ::= PLUS INTEGER|FLOAT */ yytestcase(yyruleno==223); |
| 142284 | | - case 224: /* minus_num ::= MINUS INTEGER|FLOAT */ yytestcase(yyruleno==224); |
| 142680 | + case 97: /* as ::= AS nm */ |
| 142681 | + case 108: /* dbnm ::= DOT nm */ yytestcase(yyruleno==108); |
| 142682 | + case 226: /* plus_num ::= PLUS INTEGER|FLOAT */ yytestcase(yyruleno==226); |
| 142683 | + case 227: /* minus_num ::= MINUS INTEGER|FLOAT */ yytestcase(yyruleno==227); |
| 142285 | 142684 | {yymsp[-1].minor.yy0 = yymsp[0].minor.yy0;} |
| 142286 | 142685 | break; |
| 142287 | | - case 97: /* from ::= */ |
| 142686 | + case 99: /* from ::= */ |
| 142288 | 142687 | {yymsp[1].minor.yy259 = sqlite3DbMallocZero(pParse->db, sizeof(*yymsp[1].minor.yy259));} |
| 142289 | 142688 | break; |
| 142290 | | - case 98: /* from ::= FROM seltablist */ |
| 142689 | + case 100: /* from ::= FROM seltablist */ |
| 142291 | 142690 | { |
| 142292 | 142691 | yymsp[-1].minor.yy259 = yymsp[0].minor.yy259; |
| 142293 | 142692 | sqlite3SrcListShiftJoinType(yymsp[-1].minor.yy259); |
| 142294 | 142693 | } |
| 142295 | 142694 | break; |
| 142296 | | - case 99: /* stl_prefix ::= seltablist joinop */ |
| 142695 | + case 101: /* stl_prefix ::= seltablist joinop */ |
| 142297 | 142696 | { |
| 142298 | 142697 | if( ALWAYS(yymsp[-1].minor.yy259 && yymsp[-1].minor.yy259->nSrc>0) ) yymsp[-1].minor.yy259->a[yymsp[-1].minor.yy259->nSrc-1].fg.jointype = (u8)yymsp[0].minor.yy4; |
| 142299 | 142698 | } |
| 142300 | 142699 | break; |
| 142301 | | - case 100: /* stl_prefix ::= */ |
| 142700 | + case 102: /* stl_prefix ::= */ |
| 142302 | 142701 | {yymsp[1].minor.yy259 = 0;} |
| 142303 | 142702 | break; |
| 142304 | | - case 101: /* seltablist ::= stl_prefix nm dbnm as indexed_opt on_opt using_opt */ |
| 142703 | + case 103: /* seltablist ::= stl_prefix nm dbnm as indexed_opt on_opt using_opt */ |
| 142305 | 142704 | { |
| 142306 | 142705 | yymsp[-6].minor.yy259 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy259,&yymsp[-5].minor.yy0,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,0,yymsp[-1].minor.yy314,yymsp[0].minor.yy384); |
| 142307 | 142706 | sqlite3SrcListIndexedBy(pParse, yymsp[-6].minor.yy259, &yymsp[-2].minor.yy0); |
| 142308 | 142707 | } |
| 142309 | 142708 | break; |
| 142310 | | - case 102: /* seltablist ::= stl_prefix nm dbnm LP exprlist RP as on_opt using_opt */ |
| 142709 | + case 104: /* seltablist ::= stl_prefix nm dbnm LP exprlist RP as on_opt using_opt */ |
| 142311 | 142710 | { |
| 142312 | 142711 | yymsp[-8].minor.yy259 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-8].minor.yy259,&yymsp[-7].minor.yy0,&yymsp[-6].minor.yy0,&yymsp[-2].minor.yy0,0,yymsp[-1].minor.yy314,yymsp[0].minor.yy384); |
| 142313 | 142712 | sqlite3SrcListFuncArgs(pParse, yymsp[-8].minor.yy259, yymsp[-4].minor.yy322); |
| 142314 | 142713 | } |
| 142315 | 142714 | break; |
| 142316 | | - case 103: /* seltablist ::= stl_prefix LP select RP as on_opt using_opt */ |
| 142715 | + case 105: /* seltablist ::= stl_prefix LP select RP as on_opt using_opt */ |
| 142317 | 142716 | { |
| 142318 | 142717 | yymsp[-6].minor.yy259 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy259,0,0,&yymsp[-2].minor.yy0,yymsp[-4].minor.yy387,yymsp[-1].minor.yy314,yymsp[0].minor.yy384); |
| 142319 | 142718 | } |
| 142320 | 142719 | break; |
| 142321 | | - case 104: /* seltablist ::= stl_prefix LP seltablist RP as on_opt using_opt */ |
| 142720 | + case 106: /* seltablist ::= stl_prefix LP seltablist RP as on_opt using_opt */ |
| 142322 | 142721 | { |
| 142323 | 142722 | if( yymsp[-6].minor.yy259==0 && yymsp[-2].minor.yy0.n==0 && yymsp[-1].minor.yy314==0 && yymsp[0].minor.yy384==0 ){ |
| 142324 | 142723 | yymsp[-6].minor.yy259 = yymsp[-4].minor.yy259; |
| 142325 | 142724 | }else if( yymsp[-4].minor.yy259->nSrc==1 ){ |
| 142326 | 142725 | yymsp[-6].minor.yy259 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy259,0,0,&yymsp[-2].minor.yy0,0,yymsp[-1].minor.yy314,yymsp[0].minor.yy384); |
| | @@ -142340,185 +142739,184 @@ |
| 142340 | 142739 | pSubquery = sqlite3SelectNew(pParse,0,yymsp[-4].minor.yy259,0,0,0,0,SF_NestedFrom,0); |
| 142341 | 142740 | yymsp[-6].minor.yy259 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy259,0,0,&yymsp[-2].minor.yy0,pSubquery,yymsp[-1].minor.yy314,yymsp[0].minor.yy384); |
| 142342 | 142741 | } |
| 142343 | 142742 | } |
| 142344 | 142743 | break; |
| 142345 | | - case 105: /* dbnm ::= */ |
| 142346 | | - case 114: /* indexed_opt ::= */ yytestcase(yyruleno==114); |
| 142744 | + case 107: /* dbnm ::= */ |
| 142745 | + case 117: /* indexed_opt ::= */ yytestcase(yyruleno==117); |
| 142347 | 142746 | {yymsp[1].minor.yy0.z=0; yymsp[1].minor.yy0.n=0;} |
| 142348 | 142747 | break; |
| 142349 | | - case 107: /* fullname ::= nm dbnm */ |
| 142350 | | -{yymsp[-1].minor.yy259 = sqlite3SrcListAppend(pParse->db,0,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0); /*A-overwrites-X*/} |
| 142748 | + case 109: /* fullname ::= nm */ |
| 142749 | +{yymsp[0].minor.yy259 = sqlite3SrcListAppend(pParse->db,0,&yymsp[0].minor.yy0,0); /*A-overwrites-X*/} |
| 142351 | 142750 | break; |
| 142352 | | - case 108: /* joinop ::= COMMA|JOIN */ |
| 142751 | + case 110: /* fullname ::= nm DOT nm */ |
| 142752 | +{yymsp[-2].minor.yy259 = sqlite3SrcListAppend(pParse->db,0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0); /*A-overwrites-X*/} |
| 142753 | + break; |
| 142754 | + case 111: /* joinop ::= COMMA|JOIN */ |
| 142353 | 142755 | { yymsp[0].minor.yy4 = JT_INNER; } |
| 142354 | 142756 | break; |
| 142355 | | - case 109: /* joinop ::= JOIN_KW JOIN */ |
| 142757 | + case 112: /* joinop ::= JOIN_KW JOIN */ |
| 142356 | 142758 | {yymsp[-1].minor.yy4 = sqlite3JoinType(pParse,&yymsp[-1].minor.yy0,0,0); /*X-overwrites-A*/} |
| 142357 | 142759 | break; |
| 142358 | | - case 110: /* joinop ::= JOIN_KW nm JOIN */ |
| 142760 | + case 113: /* joinop ::= JOIN_KW nm JOIN */ |
| 142359 | 142761 | {yymsp[-2].minor.yy4 = sqlite3JoinType(pParse,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0,0); /*X-overwrites-A*/} |
| 142360 | 142762 | break; |
| 142361 | | - case 111: /* joinop ::= JOIN_KW nm nm JOIN */ |
| 142763 | + case 114: /* joinop ::= JOIN_KW nm nm JOIN */ |
| 142362 | 142764 | {yymsp[-3].minor.yy4 = sqlite3JoinType(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0);/*X-overwrites-A*/} |
| 142363 | 142765 | break; |
| 142364 | | - case 112: /* on_opt ::= ON expr */ |
| 142365 | | - case 129: /* having_opt ::= HAVING expr */ yytestcase(yyruleno==129); |
| 142366 | | - case 136: /* where_opt ::= WHERE expr */ yytestcase(yyruleno==136); |
| 142367 | | - case 197: /* case_else ::= ELSE expr */ yytestcase(yyruleno==197); |
| 142766 | + case 115: /* on_opt ::= ON expr */ |
| 142767 | + case 132: /* having_opt ::= HAVING expr */ yytestcase(yyruleno==132); |
| 142768 | + case 139: /* where_opt ::= WHERE expr */ yytestcase(yyruleno==139); |
| 142769 | + case 200: /* case_else ::= ELSE expr */ yytestcase(yyruleno==200); |
| 142368 | 142770 | {yymsp[-1].minor.yy314 = yymsp[0].minor.yy314;} |
| 142369 | 142771 | break; |
| 142370 | | - case 113: /* on_opt ::= */ |
| 142371 | | - case 128: /* having_opt ::= */ yytestcase(yyruleno==128); |
| 142372 | | - case 130: /* limit_opt ::= */ yytestcase(yyruleno==130); |
| 142373 | | - case 135: /* where_opt ::= */ yytestcase(yyruleno==135); |
| 142374 | | - case 198: /* case_else ::= */ yytestcase(yyruleno==198); |
| 142375 | | - case 200: /* case_operand ::= */ yytestcase(yyruleno==200); |
| 142772 | + case 116: /* on_opt ::= */ |
| 142773 | + case 131: /* having_opt ::= */ yytestcase(yyruleno==131); |
| 142774 | + case 133: /* limit_opt ::= */ yytestcase(yyruleno==133); |
| 142775 | + case 138: /* where_opt ::= */ yytestcase(yyruleno==138); |
| 142776 | + case 201: /* case_else ::= */ yytestcase(yyruleno==201); |
| 142777 | + case 203: /* case_operand ::= */ yytestcase(yyruleno==203); |
| 142376 | 142778 | {yymsp[1].minor.yy314 = 0;} |
| 142377 | 142779 | break; |
| 142378 | | - case 115: /* indexed_opt ::= INDEXED BY nm */ |
| 142780 | + case 118: /* indexed_opt ::= INDEXED BY nm */ |
| 142379 | 142781 | {yymsp[-2].minor.yy0 = yymsp[0].minor.yy0;} |
| 142380 | 142782 | break; |
| 142381 | | - case 116: /* indexed_opt ::= NOT INDEXED */ |
| 142783 | + case 119: /* indexed_opt ::= NOT INDEXED */ |
| 142382 | 142784 | {yymsp[-1].minor.yy0.z=0; yymsp[-1].minor.yy0.n=1;} |
| 142383 | 142785 | break; |
| 142384 | | - case 117: /* using_opt ::= USING LP idlist RP */ |
| 142786 | + case 120: /* using_opt ::= USING LP idlist RP */ |
| 142385 | 142787 | {yymsp[-3].minor.yy384 = yymsp[-1].minor.yy384;} |
| 142386 | 142788 | break; |
| 142387 | | - case 118: /* using_opt ::= */ |
| 142388 | | - case 146: /* idlist_opt ::= */ yytestcase(yyruleno==146); |
| 142789 | + case 121: /* using_opt ::= */ |
| 142790 | + case 149: /* idlist_opt ::= */ yytestcase(yyruleno==149); |
| 142389 | 142791 | {yymsp[1].minor.yy384 = 0;} |
| 142390 | 142792 | break; |
| 142391 | | - case 120: /* orderby_opt ::= ORDER BY sortlist */ |
| 142392 | | - case 127: /* groupby_opt ::= GROUP BY nexprlist */ yytestcase(yyruleno==127); |
| 142793 | + case 123: /* orderby_opt ::= ORDER BY sortlist */ |
| 142794 | + case 130: /* groupby_opt ::= GROUP BY nexprlist */ yytestcase(yyruleno==130); |
| 142393 | 142795 | {yymsp[-2].minor.yy322 = yymsp[0].minor.yy322;} |
| 142394 | 142796 | break; |
| 142395 | | - case 121: /* sortlist ::= sortlist COMMA expr sortorder */ |
| 142797 | + case 124: /* sortlist ::= sortlist COMMA expr sortorder */ |
| 142396 | 142798 | { |
| 142397 | 142799 | yymsp[-3].minor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-3].minor.yy322,yymsp[-1].minor.yy314); |
| 142398 | 142800 | sqlite3ExprListSetSortOrder(yymsp[-3].minor.yy322,yymsp[0].minor.yy4); |
| 142399 | 142801 | } |
| 142400 | 142802 | break; |
| 142401 | | - case 122: /* sortlist ::= expr sortorder */ |
| 142803 | + case 125: /* sortlist ::= expr sortorder */ |
| 142402 | 142804 | { |
| 142403 | 142805 | yymsp[-1].minor.yy322 = sqlite3ExprListAppend(pParse,0,yymsp[-1].minor.yy314); /*A-overwrites-Y*/ |
| 142404 | 142806 | sqlite3ExprListSetSortOrder(yymsp[-1].minor.yy322,yymsp[0].minor.yy4); |
| 142405 | 142807 | } |
| 142406 | 142808 | break; |
| 142407 | | - case 123: /* sortorder ::= ASC */ |
| 142809 | + case 126: /* sortorder ::= ASC */ |
| 142408 | 142810 | {yymsp[0].minor.yy4 = SQLITE_SO_ASC;} |
| 142409 | 142811 | break; |
| 142410 | | - case 124: /* sortorder ::= DESC */ |
| 142812 | + case 127: /* sortorder ::= DESC */ |
| 142411 | 142813 | {yymsp[0].minor.yy4 = SQLITE_SO_DESC;} |
| 142412 | 142814 | break; |
| 142413 | | - case 125: /* sortorder ::= */ |
| 142815 | + case 128: /* sortorder ::= */ |
| 142414 | 142816 | {yymsp[1].minor.yy4 = SQLITE_SO_UNDEFINED;} |
| 142415 | 142817 | break; |
| 142416 | | - case 131: /* limit_opt ::= LIMIT expr */ |
| 142818 | + case 134: /* limit_opt ::= LIMIT expr */ |
| 142417 | 142819 | {yymsp[-1].minor.yy314 = sqlite3PExpr(pParse,TK_LIMIT,yymsp[0].minor.yy314,0);} |
| 142418 | 142820 | break; |
| 142419 | | - case 132: /* limit_opt ::= LIMIT expr OFFSET expr */ |
| 142821 | + case 135: /* limit_opt ::= LIMIT expr OFFSET expr */ |
| 142420 | 142822 | {yymsp[-3].minor.yy314 = sqlite3PExpr(pParse,TK_LIMIT,yymsp[-2].minor.yy314,yymsp[0].minor.yy314);} |
| 142421 | 142823 | break; |
| 142422 | | - case 133: /* limit_opt ::= LIMIT expr COMMA expr */ |
| 142824 | + case 136: /* limit_opt ::= LIMIT expr COMMA expr */ |
| 142423 | 142825 | {yymsp[-3].minor.yy314 = sqlite3PExpr(pParse,TK_LIMIT,yymsp[0].minor.yy314,yymsp[-2].minor.yy314);} |
| 142424 | 142826 | break; |
| 142425 | | - case 134: /* cmd ::= with DELETE FROM fullname indexed_opt where_opt */ |
| 142827 | + case 137: /* cmd ::= with DELETE FROM fullname indexed_opt where_opt */ |
| 142426 | 142828 | { |
| 142427 | | - sqlite3WithPush(pParse, yymsp[-5].minor.yy451, 1); |
| 142428 | 142829 | sqlite3SrcListIndexedBy(pParse, yymsp[-2].minor.yy259, &yymsp[-1].minor.yy0); |
| 142429 | 142830 | sqlite3DeleteFrom(pParse,yymsp[-2].minor.yy259,yymsp[0].minor.yy314,0,0); |
| 142430 | 142831 | } |
| 142431 | 142832 | break; |
| 142432 | | - case 137: /* cmd ::= with UPDATE orconf fullname indexed_opt SET setlist where_opt */ |
| 142833 | + case 140: /* cmd ::= with UPDATE orconf fullname indexed_opt SET setlist where_opt */ |
| 142433 | 142834 | { |
| 142434 | | - sqlite3WithPush(pParse, yymsp[-7].minor.yy451, 1); |
| 142435 | 142835 | sqlite3SrcListIndexedBy(pParse, yymsp[-4].minor.yy259, &yymsp[-3].minor.yy0); |
| 142436 | 142836 | sqlite3ExprListCheckLength(pParse,yymsp[-1].minor.yy322,"set list"); |
| 142437 | 142837 | sqlite3Update(pParse,yymsp[-4].minor.yy259,yymsp[-1].minor.yy322,yymsp[0].minor.yy314,yymsp[-5].minor.yy4,0,0); |
| 142438 | 142838 | } |
| 142439 | 142839 | break; |
| 142440 | | - case 138: /* setlist ::= setlist COMMA nm EQ expr */ |
| 142840 | + case 141: /* setlist ::= setlist COMMA nm EQ expr */ |
| 142441 | 142841 | { |
| 142442 | 142842 | yymsp[-4].minor.yy322 = sqlite3ExprListAppend(pParse, yymsp[-4].minor.yy322, yymsp[0].minor.yy314); |
| 142443 | 142843 | sqlite3ExprListSetName(pParse, yymsp[-4].minor.yy322, &yymsp[-2].minor.yy0, 1); |
| 142444 | 142844 | } |
| 142445 | 142845 | break; |
| 142446 | | - case 139: /* setlist ::= setlist COMMA LP idlist RP EQ expr */ |
| 142846 | + case 142: /* setlist ::= setlist COMMA LP idlist RP EQ expr */ |
| 142447 | 142847 | { |
| 142448 | 142848 | yymsp[-6].minor.yy322 = sqlite3ExprListAppendVector(pParse, yymsp[-6].minor.yy322, yymsp[-3].minor.yy384, yymsp[0].minor.yy314); |
| 142449 | 142849 | } |
| 142450 | 142850 | break; |
| 142451 | | - case 140: /* setlist ::= nm EQ expr */ |
| 142851 | + case 143: /* setlist ::= nm EQ expr */ |
| 142452 | 142852 | { |
| 142453 | 142853 | yylhsminor.yy322 = sqlite3ExprListAppend(pParse, 0, yymsp[0].minor.yy314); |
| 142454 | 142854 | sqlite3ExprListSetName(pParse, yylhsminor.yy322, &yymsp[-2].minor.yy0, 1); |
| 142455 | 142855 | } |
| 142456 | 142856 | yymsp[-2].minor.yy322 = yylhsminor.yy322; |
| 142457 | 142857 | break; |
| 142458 | | - case 141: /* setlist ::= LP idlist RP EQ expr */ |
| 142858 | + case 144: /* setlist ::= LP idlist RP EQ expr */ |
| 142459 | 142859 | { |
| 142460 | 142860 | yymsp[-4].minor.yy322 = sqlite3ExprListAppendVector(pParse, 0, yymsp[-3].minor.yy384, yymsp[0].minor.yy314); |
| 142461 | 142861 | } |
| 142462 | 142862 | break; |
| 142463 | | - case 142: /* cmd ::= with insert_cmd INTO fullname idlist_opt select */ |
| 142863 | + case 145: /* cmd ::= with insert_cmd INTO fullname idlist_opt select */ |
| 142464 | 142864 | { |
| 142465 | | - sqlite3WithPush(pParse, yymsp[-5].minor.yy451, 1); |
| 142466 | 142865 | sqlite3Insert(pParse, yymsp[-2].minor.yy259, yymsp[0].minor.yy387, yymsp[-1].minor.yy384, yymsp[-4].minor.yy4); |
| 142467 | 142866 | } |
| 142468 | 142867 | break; |
| 142469 | | - case 143: /* cmd ::= with insert_cmd INTO fullname idlist_opt DEFAULT VALUES */ |
| 142868 | + case 146: /* cmd ::= with insert_cmd INTO fullname idlist_opt DEFAULT VALUES */ |
| 142470 | 142869 | { |
| 142471 | | - sqlite3WithPush(pParse, yymsp[-6].minor.yy451, 1); |
| 142472 | 142870 | sqlite3Insert(pParse, yymsp[-3].minor.yy259, 0, yymsp[-2].minor.yy384, yymsp[-5].minor.yy4); |
| 142473 | 142871 | } |
| 142474 | 142872 | break; |
| 142475 | | - case 147: /* idlist_opt ::= LP idlist RP */ |
| 142873 | + case 150: /* idlist_opt ::= LP idlist RP */ |
| 142476 | 142874 | {yymsp[-2].minor.yy384 = yymsp[-1].minor.yy384;} |
| 142477 | 142875 | break; |
| 142478 | | - case 148: /* idlist ::= idlist COMMA nm */ |
| 142876 | + case 151: /* idlist ::= idlist COMMA nm */ |
| 142479 | 142877 | {yymsp[-2].minor.yy384 = sqlite3IdListAppend(pParse->db,yymsp[-2].minor.yy384,&yymsp[0].minor.yy0);} |
| 142480 | 142878 | break; |
| 142481 | | - case 149: /* idlist ::= nm */ |
| 142879 | + case 152: /* idlist ::= nm */ |
| 142482 | 142880 | {yymsp[0].minor.yy384 = sqlite3IdListAppend(pParse->db,0,&yymsp[0].minor.yy0); /*A-overwrites-Y*/} |
| 142483 | 142881 | break; |
| 142484 | | - case 150: /* expr ::= LP expr RP */ |
| 142882 | + case 153: /* expr ::= LP expr RP */ |
| 142485 | 142883 | {yymsp[-2].minor.yy314 = yymsp[-1].minor.yy314;} |
| 142486 | 142884 | break; |
| 142487 | | - case 151: /* expr ::= ID|INDEXED */ |
| 142488 | | - case 152: /* expr ::= JOIN_KW */ yytestcase(yyruleno==152); |
| 142885 | + case 154: /* expr ::= ID|INDEXED */ |
| 142886 | + case 155: /* expr ::= JOIN_KW */ yytestcase(yyruleno==155); |
| 142489 | 142887 | {yymsp[0].minor.yy314=tokenExpr(pParse,TK_ID,yymsp[0].minor.yy0); /*A-overwrites-X*/} |
| 142490 | 142888 | break; |
| 142491 | | - case 153: /* expr ::= nm DOT nm */ |
| 142889 | + case 156: /* expr ::= nm DOT nm */ |
| 142492 | 142890 | { |
| 142493 | 142891 | Expr *temp1 = sqlite3ExprAlloc(pParse->db, TK_ID, &yymsp[-2].minor.yy0, 1); |
| 142494 | 142892 | Expr *temp2 = sqlite3ExprAlloc(pParse->db, TK_ID, &yymsp[0].minor.yy0, 1); |
| 142495 | 142893 | yylhsminor.yy314 = sqlite3PExpr(pParse, TK_DOT, temp1, temp2); |
| 142496 | 142894 | } |
| 142497 | 142895 | yymsp[-2].minor.yy314 = yylhsminor.yy314; |
| 142498 | 142896 | break; |
| 142499 | | - case 154: /* expr ::= nm DOT nm DOT nm */ |
| 142897 | + case 157: /* expr ::= nm DOT nm DOT nm */ |
| 142500 | 142898 | { |
| 142501 | 142899 | Expr *temp1 = sqlite3ExprAlloc(pParse->db, TK_ID, &yymsp[-4].minor.yy0, 1); |
| 142502 | 142900 | Expr *temp2 = sqlite3ExprAlloc(pParse->db, TK_ID, &yymsp[-2].minor.yy0, 1); |
| 142503 | 142901 | Expr *temp3 = sqlite3ExprAlloc(pParse->db, TK_ID, &yymsp[0].minor.yy0, 1); |
| 142504 | 142902 | Expr *temp4 = sqlite3PExpr(pParse, TK_DOT, temp2, temp3); |
| 142505 | 142903 | yylhsminor.yy314 = sqlite3PExpr(pParse, TK_DOT, temp1, temp4); |
| 142506 | 142904 | } |
| 142507 | 142905 | yymsp[-4].minor.yy314 = yylhsminor.yy314; |
| 142508 | 142906 | break; |
| 142509 | | - case 155: /* term ::= NULL|FLOAT|BLOB */ |
| 142510 | | - case 156: /* term ::= STRING */ yytestcase(yyruleno==156); |
| 142907 | + case 158: /* term ::= NULL|FLOAT|BLOB */ |
| 142908 | + case 159: /* term ::= STRING */ yytestcase(yyruleno==159); |
| 142511 | 142909 | {yymsp[0].minor.yy314=tokenExpr(pParse,yymsp[0].major,yymsp[0].minor.yy0); /*A-overwrites-X*/} |
| 142512 | 142910 | break; |
| 142513 | | - case 157: /* term ::= INTEGER */ |
| 142911 | + case 160: /* term ::= INTEGER */ |
| 142514 | 142912 | { |
| 142515 | 142913 | yylhsminor.yy314 = sqlite3ExprAlloc(pParse->db, TK_INTEGER, &yymsp[0].minor.yy0, 1); |
| 142516 | 142914 | } |
| 142517 | 142915 | yymsp[0].minor.yy314 = yylhsminor.yy314; |
| 142518 | 142916 | break; |
| 142519 | | - case 158: /* expr ::= VARIABLE */ |
| 142917 | + case 161: /* expr ::= VARIABLE */ |
| 142520 | 142918 | { |
| 142521 | 142919 | if( !(yymsp[0].minor.yy0.z[0]=='#' && sqlite3Isdigit(yymsp[0].minor.yy0.z[1])) ){ |
| 142522 | 142920 | u32 n = yymsp[0].minor.yy0.n; |
| 142523 | 142921 | yymsp[0].minor.yy314 = tokenExpr(pParse, TK_VARIABLE, yymsp[0].minor.yy0); |
| 142524 | 142922 | sqlite3ExprAssignVarNumber(pParse, yymsp[0].minor.yy314, n); |
| | @@ -142536,22 +142934,22 @@ |
| 142536 | 142934 | if( yymsp[0].minor.yy314 ) sqlite3GetInt32(&t.z[1], &yymsp[0].minor.yy314->iTable); |
| 142537 | 142935 | } |
| 142538 | 142936 | } |
| 142539 | 142937 | } |
| 142540 | 142938 | break; |
| 142541 | | - case 159: /* expr ::= expr COLLATE ID|STRING */ |
| 142939 | + case 162: /* expr ::= expr COLLATE ID|STRING */ |
| 142542 | 142940 | { |
| 142543 | 142941 | yymsp[-2].minor.yy314 = sqlite3ExprAddCollateToken(pParse, yymsp[-2].minor.yy314, &yymsp[0].minor.yy0, 1); |
| 142544 | 142942 | } |
| 142545 | 142943 | break; |
| 142546 | | - case 160: /* expr ::= CAST LP expr AS typetoken RP */ |
| 142944 | + case 163: /* expr ::= CAST LP expr AS typetoken RP */ |
| 142547 | 142945 | { |
| 142548 | 142946 | yymsp[-5].minor.yy314 = sqlite3ExprAlloc(pParse->db, TK_CAST, &yymsp[-1].minor.yy0, 1); |
| 142549 | 142947 | sqlite3ExprAttachSubtrees(pParse->db, yymsp[-5].minor.yy314, yymsp[-3].minor.yy314, 0); |
| 142550 | 142948 | } |
| 142551 | 142949 | break; |
| 142552 | | - case 161: /* expr ::= ID|INDEXED LP distinct exprlist RP */ |
| 142950 | + case 164: /* expr ::= ID|INDEXED LP distinct exprlist RP */ |
| 142553 | 142951 | { |
| 142554 | 142952 | if( yymsp[-1].minor.yy322 && yymsp[-1].minor.yy322->nExpr>pParse->db->aLimit[SQLITE_LIMIT_FUNCTION_ARG] ){ |
| 142555 | 142953 | sqlite3ErrorMsg(pParse, "too many arguments on function %T", &yymsp[-4].minor.yy0); |
| 142556 | 142954 | } |
| 142557 | 142955 | yylhsminor.yy314 = sqlite3ExprFunction(pParse, yymsp[-1].minor.yy322, &yymsp[-4].minor.yy0); |
| | @@ -142559,23 +142957,23 @@ |
| 142559 | 142957 | yylhsminor.yy314->flags |= EP_Distinct; |
| 142560 | 142958 | } |
| 142561 | 142959 | } |
| 142562 | 142960 | yymsp[-4].minor.yy314 = yylhsminor.yy314; |
| 142563 | 142961 | break; |
| 142564 | | - case 162: /* expr ::= ID|INDEXED LP STAR RP */ |
| 142962 | + case 165: /* expr ::= ID|INDEXED LP STAR RP */ |
| 142565 | 142963 | { |
| 142566 | 142964 | yylhsminor.yy314 = sqlite3ExprFunction(pParse, 0, &yymsp[-3].minor.yy0); |
| 142567 | 142965 | } |
| 142568 | 142966 | yymsp[-3].minor.yy314 = yylhsminor.yy314; |
| 142569 | 142967 | break; |
| 142570 | | - case 163: /* term ::= CTIME_KW */ |
| 142968 | + case 166: /* term ::= CTIME_KW */ |
| 142571 | 142969 | { |
| 142572 | 142970 | yylhsminor.yy314 = sqlite3ExprFunction(pParse, 0, &yymsp[0].minor.yy0); |
| 142573 | 142971 | } |
| 142574 | 142972 | yymsp[0].minor.yy314 = yylhsminor.yy314; |
| 142575 | 142973 | break; |
| 142576 | | - case 164: /* expr ::= LP nexprlist COMMA expr RP */ |
| 142974 | + case 167: /* expr ::= LP nexprlist COMMA expr RP */ |
| 142577 | 142975 | { |
| 142578 | 142976 | ExprList *pList = sqlite3ExprListAppend(pParse, yymsp[-3].minor.yy322, yymsp[-1].minor.yy314); |
| 142579 | 142977 | yymsp[-4].minor.yy314 = sqlite3PExpr(pParse, TK_VECTOR, 0, 0); |
| 142580 | 142978 | if( yymsp[-4].minor.yy314 ){ |
| 142581 | 142979 | yymsp[-4].minor.yy314->x.pList = pList; |
| | @@ -142582,24 +142980,24 @@ |
| 142582 | 142980 | }else{ |
| 142583 | 142981 | sqlite3ExprListDelete(pParse->db, pList); |
| 142584 | 142982 | } |
| 142585 | 142983 | } |
| 142586 | 142984 | break; |
| 142587 | | - case 165: /* expr ::= expr AND expr */ |
| 142588 | | - case 166: /* expr ::= expr OR expr */ yytestcase(yyruleno==166); |
| 142589 | | - case 167: /* expr ::= expr LT|GT|GE|LE expr */ yytestcase(yyruleno==167); |
| 142590 | | - case 168: /* expr ::= expr EQ|NE expr */ yytestcase(yyruleno==168); |
| 142591 | | - case 169: /* expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr */ yytestcase(yyruleno==169); |
| 142592 | | - case 170: /* expr ::= expr PLUS|MINUS expr */ yytestcase(yyruleno==170); |
| 142593 | | - case 171: /* expr ::= expr STAR|SLASH|REM expr */ yytestcase(yyruleno==171); |
| 142594 | | - case 172: /* expr ::= expr CONCAT expr */ yytestcase(yyruleno==172); |
| 142985 | + case 168: /* expr ::= expr AND expr */ |
| 142986 | + case 169: /* expr ::= expr OR expr */ yytestcase(yyruleno==169); |
| 142987 | + case 170: /* expr ::= expr LT|GT|GE|LE expr */ yytestcase(yyruleno==170); |
| 142988 | + case 171: /* expr ::= expr EQ|NE expr */ yytestcase(yyruleno==171); |
| 142989 | + case 172: /* expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr */ yytestcase(yyruleno==172); |
| 142990 | + case 173: /* expr ::= expr PLUS|MINUS expr */ yytestcase(yyruleno==173); |
| 142991 | + case 174: /* expr ::= expr STAR|SLASH|REM expr */ yytestcase(yyruleno==174); |
| 142992 | + case 175: /* expr ::= expr CONCAT expr */ yytestcase(yyruleno==175); |
| 142595 | 142993 | {yymsp[-2].minor.yy314=sqlite3PExpr(pParse,yymsp[-1].major,yymsp[-2].minor.yy314,yymsp[0].minor.yy314);} |
| 142596 | 142994 | break; |
| 142597 | | - case 173: /* likeop ::= NOT LIKE_KW|MATCH */ |
| 142995 | + case 176: /* likeop ::= NOT LIKE_KW|MATCH */ |
| 142598 | 142996 | {yymsp[-1].minor.yy0=yymsp[0].minor.yy0; yymsp[-1].minor.yy0.n|=0x80000000; /*yymsp[-1].minor.yy0-overwrite-yymsp[0].minor.yy0*/} |
| 142599 | 142997 | break; |
| 142600 | | - case 174: /* expr ::= expr likeop expr */ |
| 142998 | + case 177: /* expr ::= expr likeop expr */ |
| 142601 | 142999 | { |
| 142602 | 143000 | ExprList *pList; |
| 142603 | 143001 | int bNot = yymsp[-1].minor.yy0.n & 0x80000000; |
| 142604 | 143002 | yymsp[-1].minor.yy0.n &= 0x7fffffff; |
| 142605 | 143003 | pList = sqlite3ExprListAppend(pParse,0, yymsp[0].minor.yy314); |
| | @@ -142607,11 +143005,11 @@ |
| 142607 | 143005 | yymsp[-2].minor.yy314 = sqlite3ExprFunction(pParse, pList, &yymsp[-1].minor.yy0); |
| 142608 | 143006 | if( bNot ) yymsp[-2].minor.yy314 = sqlite3PExpr(pParse, TK_NOT, yymsp[-2].minor.yy314, 0); |
| 142609 | 143007 | if( yymsp[-2].minor.yy314 ) yymsp[-2].minor.yy314->flags |= EP_InfixFunc; |
| 142610 | 143008 | } |
| 142611 | 143009 | break; |
| 142612 | | - case 175: /* expr ::= expr likeop expr ESCAPE expr */ |
| 143010 | + case 178: /* expr ::= expr likeop expr ESCAPE expr */ |
| 142613 | 143011 | { |
| 142614 | 143012 | ExprList *pList; |
| 142615 | 143013 | int bNot = yymsp[-3].minor.yy0.n & 0x80000000; |
| 142616 | 143014 | yymsp[-3].minor.yy0.n &= 0x7fffffff; |
| 142617 | 143015 | pList = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy314); |
| | @@ -142620,43 +143018,43 @@ |
| 142620 | 143018 | yymsp[-4].minor.yy314 = sqlite3ExprFunction(pParse, pList, &yymsp[-3].minor.yy0); |
| 142621 | 143019 | if( bNot ) yymsp[-4].minor.yy314 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy314, 0); |
| 142622 | 143020 | if( yymsp[-4].minor.yy314 ) yymsp[-4].minor.yy314->flags |= EP_InfixFunc; |
| 142623 | 143021 | } |
| 142624 | 143022 | break; |
| 142625 | | - case 176: /* expr ::= expr ISNULL|NOTNULL */ |
| 143023 | + case 179: /* expr ::= expr ISNULL|NOTNULL */ |
| 142626 | 143024 | {yymsp[-1].minor.yy314 = sqlite3PExpr(pParse,yymsp[0].major,yymsp[-1].minor.yy314,0);} |
| 142627 | 143025 | break; |
| 142628 | | - case 177: /* expr ::= expr NOT NULL */ |
| 143026 | + case 180: /* expr ::= expr NOT NULL */ |
| 142629 | 143027 | {yymsp[-2].minor.yy314 = sqlite3PExpr(pParse,TK_NOTNULL,yymsp[-2].minor.yy314,0);} |
| 142630 | 143028 | break; |
| 142631 | | - case 178: /* expr ::= expr IS expr */ |
| 143029 | + case 181: /* expr ::= expr IS expr */ |
| 142632 | 143030 | { |
| 142633 | 143031 | yymsp[-2].minor.yy314 = sqlite3PExpr(pParse,TK_IS,yymsp[-2].minor.yy314,yymsp[0].minor.yy314); |
| 142634 | 143032 | binaryToUnaryIfNull(pParse, yymsp[0].minor.yy314, yymsp[-2].minor.yy314, TK_ISNULL); |
| 142635 | 143033 | } |
| 142636 | 143034 | break; |
| 142637 | | - case 179: /* expr ::= expr IS NOT expr */ |
| 143035 | + case 182: /* expr ::= expr IS NOT expr */ |
| 142638 | 143036 | { |
| 142639 | 143037 | yymsp[-3].minor.yy314 = sqlite3PExpr(pParse,TK_ISNOT,yymsp[-3].minor.yy314,yymsp[0].minor.yy314); |
| 142640 | 143038 | binaryToUnaryIfNull(pParse, yymsp[0].minor.yy314, yymsp[-3].minor.yy314, TK_NOTNULL); |
| 142641 | 143039 | } |
| 142642 | 143040 | break; |
| 142643 | | - case 180: /* expr ::= NOT expr */ |
| 142644 | | - case 181: /* expr ::= BITNOT expr */ yytestcase(yyruleno==181); |
| 143041 | + case 183: /* expr ::= NOT expr */ |
| 143042 | + case 184: /* expr ::= BITNOT expr */ yytestcase(yyruleno==184); |
| 142645 | 143043 | {yymsp[-1].minor.yy314 = sqlite3PExpr(pParse, yymsp[-1].major, yymsp[0].minor.yy314, 0);/*A-overwrites-B*/} |
| 142646 | 143044 | break; |
| 142647 | | - case 182: /* expr ::= MINUS expr */ |
| 143045 | + case 185: /* expr ::= MINUS expr */ |
| 142648 | 143046 | {yymsp[-1].minor.yy314 = sqlite3PExpr(pParse, TK_UMINUS, yymsp[0].minor.yy314, 0);} |
| 142649 | 143047 | break; |
| 142650 | | - case 183: /* expr ::= PLUS expr */ |
| 143048 | + case 186: /* expr ::= PLUS expr */ |
| 142651 | 143049 | {yymsp[-1].minor.yy314 = sqlite3PExpr(pParse, TK_UPLUS, yymsp[0].minor.yy314, 0);} |
| 142652 | 143050 | break; |
| 142653 | | - case 184: /* between_op ::= BETWEEN */ |
| 142654 | | - case 187: /* in_op ::= IN */ yytestcase(yyruleno==187); |
| 143051 | + case 187: /* between_op ::= BETWEEN */ |
| 143052 | + case 190: /* in_op ::= IN */ yytestcase(yyruleno==190); |
| 142655 | 143053 | {yymsp[0].minor.yy4 = 0;} |
| 142656 | 143054 | break; |
| 142657 | | - case 186: /* expr ::= expr between_op expr AND expr */ |
| 143055 | + case 189: /* expr ::= expr between_op expr AND expr */ |
| 142658 | 143056 | { |
| 142659 | 143057 | ExprList *pList = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy314); |
| 142660 | 143058 | pList = sqlite3ExprListAppend(pParse,pList, yymsp[0].minor.yy314); |
| 142661 | 143059 | yymsp[-4].minor.yy314 = sqlite3PExpr(pParse, TK_BETWEEN, yymsp[-4].minor.yy314, 0); |
| 142662 | 143060 | if( yymsp[-4].minor.yy314 ){ |
| | @@ -142665,11 +143063,11 @@ |
| 142665 | 143063 | sqlite3ExprListDelete(pParse->db, pList); |
| 142666 | 143064 | } |
| 142667 | 143065 | if( yymsp[-3].minor.yy4 ) yymsp[-4].minor.yy314 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy314, 0); |
| 142668 | 143066 | } |
| 142669 | 143067 | break; |
| 142670 | | - case 189: /* expr ::= expr in_op LP exprlist RP */ |
| 143068 | + case 192: /* expr ::= expr in_op LP exprlist RP */ |
| 142671 | 143069 | { |
| 142672 | 143070 | if( yymsp[-1].minor.yy322==0 ){ |
| 142673 | 143071 | /* Expressions of the form |
| 142674 | 143072 | ** |
| 142675 | 143073 | ** expr1 IN () |
| | @@ -142717,41 +143115,41 @@ |
| 142717 | 143115 | } |
| 142718 | 143116 | if( yymsp[-3].minor.yy4 ) yymsp[-4].minor.yy314 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy314, 0); |
| 142719 | 143117 | } |
| 142720 | 143118 | } |
| 142721 | 143119 | break; |
| 142722 | | - case 190: /* expr ::= LP select RP */ |
| 143120 | + case 193: /* expr ::= LP select RP */ |
| 142723 | 143121 | { |
| 142724 | 143122 | yymsp[-2].minor.yy314 = sqlite3PExpr(pParse, TK_SELECT, 0, 0); |
| 142725 | 143123 | sqlite3PExprAddSelect(pParse, yymsp[-2].minor.yy314, yymsp[-1].minor.yy387); |
| 142726 | 143124 | } |
| 142727 | 143125 | break; |
| 142728 | | - case 191: /* expr ::= expr in_op LP select RP */ |
| 143126 | + case 194: /* expr ::= expr in_op LP select RP */ |
| 142729 | 143127 | { |
| 142730 | 143128 | yymsp[-4].minor.yy314 = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy314, 0); |
| 142731 | 143129 | sqlite3PExprAddSelect(pParse, yymsp[-4].minor.yy314, yymsp[-1].minor.yy387); |
| 142732 | 143130 | if( yymsp[-3].minor.yy4 ) yymsp[-4].minor.yy314 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy314, 0); |
| 142733 | 143131 | } |
| 142734 | 143132 | break; |
| 142735 | | - case 192: /* expr ::= expr in_op nm dbnm paren_exprlist */ |
| 143133 | + case 195: /* expr ::= expr in_op nm dbnm paren_exprlist */ |
| 142736 | 143134 | { |
| 142737 | 143135 | SrcList *pSrc = sqlite3SrcListAppend(pParse->db, 0,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0); |
| 142738 | 143136 | Select *pSelect = sqlite3SelectNew(pParse, 0,pSrc,0,0,0,0,0,0); |
| 142739 | 143137 | if( yymsp[0].minor.yy322 ) sqlite3SrcListFuncArgs(pParse, pSelect ? pSrc : 0, yymsp[0].minor.yy322); |
| 142740 | 143138 | yymsp[-4].minor.yy314 = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy314, 0); |
| 142741 | 143139 | sqlite3PExprAddSelect(pParse, yymsp[-4].minor.yy314, pSelect); |
| 142742 | 143140 | if( yymsp[-3].minor.yy4 ) yymsp[-4].minor.yy314 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy314, 0); |
| 142743 | 143141 | } |
| 142744 | 143142 | break; |
| 142745 | | - case 193: /* expr ::= EXISTS LP select RP */ |
| 143143 | + case 196: /* expr ::= EXISTS LP select RP */ |
| 142746 | 143144 | { |
| 142747 | 143145 | Expr *p; |
| 142748 | 143146 | p = yymsp[-3].minor.yy314 = sqlite3PExpr(pParse, TK_EXISTS, 0, 0); |
| 142749 | 143147 | sqlite3PExprAddSelect(pParse, p, yymsp[-1].minor.yy387); |
| 142750 | 143148 | } |
| 142751 | 143149 | break; |
| 142752 | | - case 194: /* expr ::= CASE case_operand case_exprlist case_else END */ |
| 143150 | + case 197: /* expr ::= CASE case_operand case_exprlist case_else END */ |
| 142753 | 143151 | { |
| 142754 | 143152 | yymsp[-4].minor.yy314 = sqlite3PExpr(pParse, TK_CASE, yymsp[-3].minor.yy314, 0); |
| 142755 | 143153 | if( yymsp[-4].minor.yy314 ){ |
| 142756 | 143154 | yymsp[-4].minor.yy314->x.pList = yymsp[-1].minor.yy314 ? sqlite3ExprListAppend(pParse,yymsp[-2].minor.yy322,yymsp[-1].minor.yy314) : yymsp[-2].minor.yy322; |
| 142757 | 143155 | sqlite3ExprSetHeightAndFlags(pParse, yymsp[-4].minor.yy314); |
| | @@ -142759,334 +143157,330 @@ |
| 142759 | 143157 | sqlite3ExprListDelete(pParse->db, yymsp[-2].minor.yy322); |
| 142760 | 143158 | sqlite3ExprDelete(pParse->db, yymsp[-1].minor.yy314); |
| 142761 | 143159 | } |
| 142762 | 143160 | } |
| 142763 | 143161 | break; |
| 142764 | | - case 195: /* case_exprlist ::= case_exprlist WHEN expr THEN expr */ |
| 143162 | + case 198: /* case_exprlist ::= case_exprlist WHEN expr THEN expr */ |
| 142765 | 143163 | { |
| 142766 | 143164 | yymsp[-4].minor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy322, yymsp[-2].minor.yy314); |
| 142767 | 143165 | yymsp[-4].minor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy322, yymsp[0].minor.yy314); |
| 142768 | 143166 | } |
| 142769 | 143167 | break; |
| 142770 | | - case 196: /* case_exprlist ::= WHEN expr THEN expr */ |
| 143168 | + case 199: /* case_exprlist ::= WHEN expr THEN expr */ |
| 142771 | 143169 | { |
| 142772 | 143170 | yymsp[-3].minor.yy322 = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy314); |
| 142773 | 143171 | yymsp[-3].minor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-3].minor.yy322, yymsp[0].minor.yy314); |
| 142774 | 143172 | } |
| 142775 | 143173 | break; |
| 142776 | | - case 199: /* case_operand ::= expr */ |
| 143174 | + case 202: /* case_operand ::= expr */ |
| 142777 | 143175 | {yymsp[0].minor.yy314 = yymsp[0].minor.yy314; /*A-overwrites-X*/} |
| 142778 | 143176 | break; |
| 142779 | | - case 202: /* nexprlist ::= nexprlist COMMA expr */ |
| 143177 | + case 205: /* nexprlist ::= nexprlist COMMA expr */ |
| 142780 | 143178 | {yymsp[-2].minor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-2].minor.yy322,yymsp[0].minor.yy314);} |
| 142781 | 143179 | break; |
| 142782 | | - case 203: /* nexprlist ::= expr */ |
| 143180 | + case 206: /* nexprlist ::= expr */ |
| 142783 | 143181 | {yymsp[0].minor.yy322 = sqlite3ExprListAppend(pParse,0,yymsp[0].minor.yy314); /*A-overwrites-Y*/} |
| 142784 | 143182 | break; |
| 142785 | | - case 205: /* paren_exprlist ::= LP exprlist RP */ |
| 142786 | | - case 210: /* eidlist_opt ::= LP eidlist RP */ yytestcase(yyruleno==210); |
| 143183 | + case 208: /* paren_exprlist ::= LP exprlist RP */ |
| 143184 | + case 213: /* eidlist_opt ::= LP eidlist RP */ yytestcase(yyruleno==213); |
| 142787 | 143185 | {yymsp[-2].minor.yy322 = yymsp[-1].minor.yy322;} |
| 142788 | 143186 | break; |
| 142789 | | - case 206: /* cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP sortlist RP where_opt */ |
| 143187 | + case 209: /* cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP sortlist RP where_opt */ |
| 142790 | 143188 | { |
| 142791 | 143189 | sqlite3CreateIndex(pParse, &yymsp[-7].minor.yy0, &yymsp[-6].minor.yy0, |
| 142792 | 143190 | sqlite3SrcListAppend(pParse->db,0,&yymsp[-4].minor.yy0,0), yymsp[-2].minor.yy322, yymsp[-10].minor.yy4, |
| 142793 | 143191 | &yymsp[-11].minor.yy0, yymsp[0].minor.yy314, SQLITE_SO_ASC, yymsp[-8].minor.yy4, SQLITE_IDXTYPE_APPDEF); |
| 142794 | 143192 | } |
| 142795 | 143193 | break; |
| 142796 | | - case 207: /* uniqueflag ::= UNIQUE */ |
| 142797 | | - case 247: /* raisetype ::= ABORT */ yytestcase(yyruleno==247); |
| 143194 | + case 210: /* uniqueflag ::= UNIQUE */ |
| 143195 | + case 250: /* raisetype ::= ABORT */ yytestcase(yyruleno==250); |
| 142798 | 143196 | {yymsp[0].minor.yy4 = OE_Abort;} |
| 142799 | 143197 | break; |
| 142800 | | - case 208: /* uniqueflag ::= */ |
| 143198 | + case 211: /* uniqueflag ::= */ |
| 142801 | 143199 | {yymsp[1].minor.yy4 = OE_None;} |
| 142802 | 143200 | break; |
| 142803 | | - case 211: /* eidlist ::= eidlist COMMA nm collate sortorder */ |
| 143201 | + case 214: /* eidlist ::= eidlist COMMA nm collate sortorder */ |
| 142804 | 143202 | { |
| 142805 | 143203 | yymsp[-4].minor.yy322 = parserAddExprIdListTerm(pParse, yymsp[-4].minor.yy322, &yymsp[-2].minor.yy0, yymsp[-1].minor.yy4, yymsp[0].minor.yy4); |
| 142806 | 143204 | } |
| 142807 | 143205 | break; |
| 142808 | | - case 212: /* eidlist ::= nm collate sortorder */ |
| 143206 | + case 215: /* eidlist ::= nm collate sortorder */ |
| 142809 | 143207 | { |
| 142810 | 143208 | yymsp[-2].minor.yy322 = parserAddExprIdListTerm(pParse, 0, &yymsp[-2].minor.yy0, yymsp[-1].minor.yy4, yymsp[0].minor.yy4); /*A-overwrites-Y*/ |
| 142811 | 143209 | } |
| 142812 | 143210 | break; |
| 142813 | | - case 215: /* cmd ::= DROP INDEX ifexists fullname */ |
| 143211 | + case 218: /* cmd ::= DROP INDEX ifexists fullname */ |
| 142814 | 143212 | {sqlite3DropIndex(pParse, yymsp[0].minor.yy259, yymsp[-1].minor.yy4);} |
| 142815 | 143213 | break; |
| 142816 | | - case 216: /* cmd ::= VACUUM */ |
| 143214 | + case 219: /* cmd ::= VACUUM */ |
| 142817 | 143215 | {sqlite3Vacuum(pParse,0);} |
| 142818 | 143216 | break; |
| 142819 | | - case 217: /* cmd ::= VACUUM nm */ |
| 143217 | + case 220: /* cmd ::= VACUUM nm */ |
| 142820 | 143218 | {sqlite3Vacuum(pParse,&yymsp[0].minor.yy0);} |
| 142821 | 143219 | break; |
| 142822 | | - case 218: /* cmd ::= PRAGMA nm dbnm */ |
| 143220 | + case 221: /* cmd ::= PRAGMA nm dbnm */ |
| 142823 | 143221 | {sqlite3Pragma(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,0,0);} |
| 142824 | 143222 | break; |
| 142825 | | - case 219: /* cmd ::= PRAGMA nm dbnm EQ nmnum */ |
| 143223 | + case 222: /* cmd ::= PRAGMA nm dbnm EQ nmnum */ |
| 142826 | 143224 | {sqlite3Pragma(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0,0);} |
| 142827 | 143225 | break; |
| 142828 | | - case 220: /* cmd ::= PRAGMA nm dbnm LP nmnum RP */ |
| 143226 | + case 223: /* cmd ::= PRAGMA nm dbnm LP nmnum RP */ |
| 142829 | 143227 | {sqlite3Pragma(pParse,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,&yymsp[-1].minor.yy0,0);} |
| 142830 | 143228 | break; |
| 142831 | | - case 221: /* cmd ::= PRAGMA nm dbnm EQ minus_num */ |
| 143229 | + case 224: /* cmd ::= PRAGMA nm dbnm EQ minus_num */ |
| 142832 | 143230 | {sqlite3Pragma(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0,1);} |
| 142833 | 143231 | break; |
| 142834 | | - case 222: /* cmd ::= PRAGMA nm dbnm LP minus_num RP */ |
| 143232 | + case 225: /* cmd ::= PRAGMA nm dbnm LP minus_num RP */ |
| 142835 | 143233 | {sqlite3Pragma(pParse,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,&yymsp[-1].minor.yy0,1);} |
| 142836 | 143234 | break; |
| 142837 | | - case 225: /* cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END */ |
| 143235 | + case 228: /* cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END */ |
| 142838 | 143236 | { |
| 142839 | 143237 | Token all; |
| 142840 | 143238 | all.z = yymsp[-3].minor.yy0.z; |
| 142841 | 143239 | all.n = (int)(yymsp[0].minor.yy0.z - yymsp[-3].minor.yy0.z) + yymsp[0].minor.yy0.n; |
| 142842 | 143240 | sqlite3FinishTrigger(pParse, yymsp[-1].minor.yy203, &all); |
| 142843 | 143241 | } |
| 142844 | 143242 | break; |
| 142845 | | - case 226: /* trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause */ |
| 143243 | + case 229: /* trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause */ |
| 142846 | 143244 | { |
| 142847 | 143245 | sqlite3BeginTrigger(pParse, &yymsp[-7].minor.yy0, &yymsp[-6].minor.yy0, yymsp[-5].minor.yy4, yymsp[-4].minor.yy90.a, yymsp[-4].minor.yy90.b, yymsp[-2].minor.yy259, yymsp[0].minor.yy314, yymsp[-10].minor.yy4, yymsp[-8].minor.yy4); |
| 142848 | 143246 | yymsp[-10].minor.yy0 = (yymsp[-6].minor.yy0.n==0?yymsp[-7].minor.yy0:yymsp[-6].minor.yy0); /*A-overwrites-T*/ |
| 142849 | 143247 | } |
| 142850 | 143248 | break; |
| 142851 | | - case 227: /* trigger_time ::= BEFORE|AFTER */ |
| 143249 | + case 230: /* trigger_time ::= BEFORE|AFTER */ |
| 142852 | 143250 | { yymsp[0].minor.yy4 = yymsp[0].major; /*A-overwrites-X*/ } |
| 142853 | 143251 | break; |
| 142854 | | - case 228: /* trigger_time ::= INSTEAD OF */ |
| 143252 | + case 231: /* trigger_time ::= INSTEAD OF */ |
| 142855 | 143253 | { yymsp[-1].minor.yy4 = TK_INSTEAD;} |
| 142856 | 143254 | break; |
| 142857 | | - case 229: /* trigger_time ::= */ |
| 143255 | + case 232: /* trigger_time ::= */ |
| 142858 | 143256 | { yymsp[1].minor.yy4 = TK_BEFORE; } |
| 142859 | 143257 | break; |
| 142860 | | - case 230: /* trigger_event ::= DELETE|INSERT */ |
| 142861 | | - case 231: /* trigger_event ::= UPDATE */ yytestcase(yyruleno==231); |
| 143258 | + case 233: /* trigger_event ::= DELETE|INSERT */ |
| 143259 | + case 234: /* trigger_event ::= UPDATE */ yytestcase(yyruleno==234); |
| 142862 | 143260 | {yymsp[0].minor.yy90.a = yymsp[0].major; /*A-overwrites-X*/ yymsp[0].minor.yy90.b = 0;} |
| 142863 | 143261 | break; |
| 142864 | | - case 232: /* trigger_event ::= UPDATE OF idlist */ |
| 143262 | + case 235: /* trigger_event ::= UPDATE OF idlist */ |
| 142865 | 143263 | {yymsp[-2].minor.yy90.a = TK_UPDATE; yymsp[-2].minor.yy90.b = yymsp[0].minor.yy384;} |
| 142866 | 143264 | break; |
| 142867 | | - case 233: /* when_clause ::= */ |
| 142868 | | - case 252: /* key_opt ::= */ yytestcase(yyruleno==252); |
| 143265 | + case 236: /* when_clause ::= */ |
| 143266 | + case 255: /* key_opt ::= */ yytestcase(yyruleno==255); |
| 142869 | 143267 | { yymsp[1].minor.yy314 = 0; } |
| 142870 | 143268 | break; |
| 142871 | | - case 234: /* when_clause ::= WHEN expr */ |
| 142872 | | - case 253: /* key_opt ::= KEY expr */ yytestcase(yyruleno==253); |
| 143269 | + case 237: /* when_clause ::= WHEN expr */ |
| 143270 | + case 256: /* key_opt ::= KEY expr */ yytestcase(yyruleno==256); |
| 142873 | 143271 | { yymsp[-1].minor.yy314 = yymsp[0].minor.yy314; } |
| 142874 | 143272 | break; |
| 142875 | | - case 235: /* trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI */ |
| 143273 | + case 238: /* trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI */ |
| 142876 | 143274 | { |
| 142877 | 143275 | assert( yymsp[-2].minor.yy203!=0 ); |
| 142878 | 143276 | yymsp[-2].minor.yy203->pLast->pNext = yymsp[-1].minor.yy203; |
| 142879 | 143277 | yymsp[-2].minor.yy203->pLast = yymsp[-1].minor.yy203; |
| 142880 | 143278 | } |
| 142881 | 143279 | break; |
| 142882 | | - case 236: /* trigger_cmd_list ::= trigger_cmd SEMI */ |
| 143280 | + case 239: /* trigger_cmd_list ::= trigger_cmd SEMI */ |
| 142883 | 143281 | { |
| 142884 | 143282 | assert( yymsp[-1].minor.yy203!=0 ); |
| 142885 | 143283 | yymsp[-1].minor.yy203->pLast = yymsp[-1].minor.yy203; |
| 142886 | 143284 | } |
| 142887 | 143285 | break; |
| 142888 | | - case 237: /* trnm ::= nm DOT nm */ |
| 143286 | + case 240: /* trnm ::= nm DOT nm */ |
| 142889 | 143287 | { |
| 142890 | 143288 | yymsp[-2].minor.yy0 = yymsp[0].minor.yy0; |
| 142891 | 143289 | sqlite3ErrorMsg(pParse, |
| 142892 | 143290 | "qualified table names are not allowed on INSERT, UPDATE, and DELETE " |
| 142893 | 143291 | "statements within triggers"); |
| 142894 | 143292 | } |
| 142895 | 143293 | break; |
| 142896 | | - case 238: /* tridxby ::= INDEXED BY nm */ |
| 143294 | + case 241: /* tridxby ::= INDEXED BY nm */ |
| 142897 | 143295 | { |
| 142898 | 143296 | sqlite3ErrorMsg(pParse, |
| 142899 | 143297 | "the INDEXED BY clause is not allowed on UPDATE or DELETE statements " |
| 142900 | 143298 | "within triggers"); |
| 142901 | 143299 | } |
| 142902 | 143300 | break; |
| 142903 | | - case 239: /* tridxby ::= NOT INDEXED */ |
| 143301 | + case 242: /* tridxby ::= NOT INDEXED */ |
| 142904 | 143302 | { |
| 142905 | 143303 | sqlite3ErrorMsg(pParse, |
| 142906 | 143304 | "the NOT INDEXED clause is not allowed on UPDATE or DELETE statements " |
| 142907 | 143305 | "within triggers"); |
| 142908 | 143306 | } |
| 142909 | 143307 | break; |
| 142910 | | - case 240: /* trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist where_opt scanpt */ |
| 143308 | + case 243: /* trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist where_opt scanpt */ |
| 142911 | 143309 | {yylhsminor.yy203 = sqlite3TriggerUpdateStep(pParse->db, &yymsp[-5].minor.yy0, yymsp[-2].minor.yy322, yymsp[-1].minor.yy314, yymsp[-6].minor.yy4, yymsp[-7].minor.yy0.z, yymsp[0].minor.yy336);} |
| 142912 | 143310 | yymsp[-7].minor.yy203 = yylhsminor.yy203; |
| 142913 | 143311 | break; |
| 142914 | | - case 241: /* trigger_cmd ::= scanpt insert_cmd INTO trnm idlist_opt select scanpt */ |
| 143312 | + case 244: /* trigger_cmd ::= scanpt insert_cmd INTO trnm idlist_opt select scanpt */ |
| 142915 | 143313 | {yylhsminor.yy203 = sqlite3TriggerInsertStep(pParse->db,&yymsp[-3].minor.yy0,yymsp[-2].minor.yy384,yymsp[-1].minor.yy387,yymsp[-5].minor.yy4,yymsp[-6].minor.yy336,yymsp[0].minor.yy336);/*yylhsminor.yy203-overwrites-yymsp[-5].minor.yy4*/} |
| 142916 | 143314 | yymsp[-6].minor.yy203 = yylhsminor.yy203; |
| 142917 | 143315 | break; |
| 142918 | | - case 242: /* trigger_cmd ::= DELETE FROM trnm tridxby where_opt scanpt */ |
| 143316 | + case 245: /* trigger_cmd ::= DELETE FROM trnm tridxby where_opt scanpt */ |
| 142919 | 143317 | {yylhsminor.yy203 = sqlite3TriggerDeleteStep(pParse->db, &yymsp[-3].minor.yy0, yymsp[-1].minor.yy314, yymsp[-5].minor.yy0.z, yymsp[0].minor.yy336);} |
| 142920 | 143318 | yymsp[-5].minor.yy203 = yylhsminor.yy203; |
| 142921 | 143319 | break; |
| 142922 | | - case 243: /* trigger_cmd ::= scanpt select scanpt */ |
| 143320 | + case 246: /* trigger_cmd ::= scanpt select scanpt */ |
| 142923 | 143321 | {yylhsminor.yy203 = sqlite3TriggerSelectStep(pParse->db, yymsp[-1].minor.yy387, yymsp[-2].minor.yy336, yymsp[0].minor.yy336); /*yylhsminor.yy203-overwrites-yymsp[-1].minor.yy387*/} |
| 142924 | 143322 | yymsp[-2].minor.yy203 = yylhsminor.yy203; |
| 142925 | 143323 | break; |
| 142926 | | - case 244: /* expr ::= RAISE LP IGNORE RP */ |
| 143324 | + case 247: /* expr ::= RAISE LP IGNORE RP */ |
| 142927 | 143325 | { |
| 142928 | 143326 | yymsp[-3].minor.yy314 = sqlite3PExpr(pParse, TK_RAISE, 0, 0); |
| 142929 | 143327 | if( yymsp[-3].minor.yy314 ){ |
| 142930 | 143328 | yymsp[-3].minor.yy314->affinity = OE_Ignore; |
| 142931 | 143329 | } |
| 142932 | 143330 | } |
| 142933 | 143331 | break; |
| 142934 | | - case 245: /* expr ::= RAISE LP raisetype COMMA nm RP */ |
| 143332 | + case 248: /* expr ::= RAISE LP raisetype COMMA nm RP */ |
| 142935 | 143333 | { |
| 142936 | 143334 | yymsp[-5].minor.yy314 = sqlite3ExprAlloc(pParse->db, TK_RAISE, &yymsp[-1].minor.yy0, 1); |
| 142937 | 143335 | if( yymsp[-5].minor.yy314 ) { |
| 142938 | 143336 | yymsp[-5].minor.yy314->affinity = (char)yymsp[-3].minor.yy4; |
| 142939 | 143337 | } |
| 142940 | 143338 | } |
| 142941 | 143339 | break; |
| 142942 | | - case 246: /* raisetype ::= ROLLBACK */ |
| 143340 | + case 249: /* raisetype ::= ROLLBACK */ |
| 142943 | 143341 | {yymsp[0].minor.yy4 = OE_Rollback;} |
| 142944 | 143342 | break; |
| 142945 | | - case 248: /* raisetype ::= FAIL */ |
| 143343 | + case 251: /* raisetype ::= FAIL */ |
| 142946 | 143344 | {yymsp[0].minor.yy4 = OE_Fail;} |
| 142947 | 143345 | break; |
| 142948 | | - case 249: /* cmd ::= DROP TRIGGER ifexists fullname */ |
| 143346 | + case 252: /* cmd ::= DROP TRIGGER ifexists fullname */ |
| 142949 | 143347 | { |
| 142950 | 143348 | sqlite3DropTrigger(pParse,yymsp[0].minor.yy259,yymsp[-1].minor.yy4); |
| 142951 | 143349 | } |
| 142952 | 143350 | break; |
| 142953 | | - case 250: /* cmd ::= ATTACH database_kw_opt expr AS expr key_opt */ |
| 143351 | + case 253: /* cmd ::= ATTACH database_kw_opt expr AS expr key_opt */ |
| 142954 | 143352 | { |
| 142955 | 143353 | sqlite3Attach(pParse, yymsp[-3].minor.yy314, yymsp[-1].minor.yy314, yymsp[0].minor.yy314); |
| 142956 | 143354 | } |
| 142957 | 143355 | break; |
| 142958 | | - case 251: /* cmd ::= DETACH database_kw_opt expr */ |
| 143356 | + case 254: /* cmd ::= DETACH database_kw_opt expr */ |
| 142959 | 143357 | { |
| 142960 | 143358 | sqlite3Detach(pParse, yymsp[0].minor.yy314); |
| 142961 | 143359 | } |
| 142962 | 143360 | break; |
| 142963 | | - case 254: /* cmd ::= REINDEX */ |
| 143361 | + case 257: /* cmd ::= REINDEX */ |
| 142964 | 143362 | {sqlite3Reindex(pParse, 0, 0);} |
| 142965 | 143363 | break; |
| 142966 | | - case 255: /* cmd ::= REINDEX nm dbnm */ |
| 143364 | + case 258: /* cmd ::= REINDEX nm dbnm */ |
| 142967 | 143365 | {sqlite3Reindex(pParse, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0);} |
| 142968 | 143366 | break; |
| 142969 | | - case 256: /* cmd ::= ANALYZE */ |
| 143367 | + case 259: /* cmd ::= ANALYZE */ |
| 142970 | 143368 | {sqlite3Analyze(pParse, 0, 0);} |
| 142971 | 143369 | break; |
| 142972 | | - case 257: /* cmd ::= ANALYZE nm dbnm */ |
| 143370 | + case 260: /* cmd ::= ANALYZE nm dbnm */ |
| 142973 | 143371 | {sqlite3Analyze(pParse, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0);} |
| 142974 | 143372 | break; |
| 142975 | | - case 258: /* cmd ::= ALTER TABLE fullname RENAME TO nm */ |
| 143373 | + case 261: /* cmd ::= ALTER TABLE fullname RENAME TO nm */ |
| 142976 | 143374 | { |
| 142977 | 143375 | sqlite3AlterRenameTable(pParse,yymsp[-3].minor.yy259,&yymsp[0].minor.yy0); |
| 142978 | 143376 | } |
| 142979 | 143377 | break; |
| 142980 | | - case 259: /* cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt columnname carglist */ |
| 143378 | + case 262: /* cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt columnname carglist */ |
| 142981 | 143379 | { |
| 142982 | 143380 | yymsp[-1].minor.yy0.n = (int)(pParse->sLastToken.z-yymsp[-1].minor.yy0.z) + pParse->sLastToken.n; |
| 142983 | 143381 | sqlite3AlterFinishAddColumn(pParse, &yymsp[-1].minor.yy0); |
| 142984 | 143382 | } |
| 142985 | 143383 | break; |
| 142986 | | - case 260: /* add_column_fullname ::= fullname */ |
| 143384 | + case 263: /* add_column_fullname ::= fullname */ |
| 142987 | 143385 | { |
| 142988 | 143386 | disableLookaside(pParse); |
| 142989 | 143387 | sqlite3AlterBeginAddColumn(pParse, yymsp[0].minor.yy259); |
| 142990 | 143388 | } |
| 142991 | 143389 | break; |
| 142992 | | - case 261: /* cmd ::= create_vtab */ |
| 143390 | + case 264: /* cmd ::= create_vtab */ |
| 142993 | 143391 | {sqlite3VtabFinishParse(pParse,0);} |
| 142994 | 143392 | break; |
| 142995 | | - case 262: /* cmd ::= create_vtab LP vtabarglist RP */ |
| 143393 | + case 265: /* cmd ::= create_vtab LP vtabarglist RP */ |
| 142996 | 143394 | {sqlite3VtabFinishParse(pParse,&yymsp[0].minor.yy0);} |
| 142997 | 143395 | break; |
| 142998 | | - case 263: /* create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm */ |
| 143396 | + case 266: /* create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm */ |
| 142999 | 143397 | { |
| 143000 | 143398 | sqlite3VtabBeginParse(pParse, &yymsp[-3].minor.yy0, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-4].minor.yy4); |
| 143001 | 143399 | } |
| 143002 | 143400 | break; |
| 143003 | | - case 264: /* vtabarg ::= */ |
| 143401 | + case 267: /* vtabarg ::= */ |
| 143004 | 143402 | {sqlite3VtabArgInit(pParse);} |
| 143005 | 143403 | break; |
| 143006 | | - case 265: /* vtabargtoken ::= ANY */ |
| 143007 | | - case 266: /* vtabargtoken ::= lp anylist RP */ yytestcase(yyruleno==266); |
| 143008 | | - case 267: /* lp ::= LP */ yytestcase(yyruleno==267); |
| 143404 | + case 268: /* vtabargtoken ::= ANY */ |
| 143405 | + case 269: /* vtabargtoken ::= lp anylist RP */ yytestcase(yyruleno==269); |
| 143406 | + case 270: /* lp ::= LP */ yytestcase(yyruleno==270); |
| 143009 | 143407 | {sqlite3VtabArgExtend(pParse,&yymsp[0].minor.yy0);} |
| 143010 | 143408 | break; |
| 143011 | | - case 268: /* with ::= */ |
| 143012 | | -{yymsp[1].minor.yy451 = 0;} |
| 143013 | | - break; |
| 143014 | | - case 269: /* with ::= WITH wqlist */ |
| 143015 | | -{ yymsp[-1].minor.yy451 = yymsp[0].minor.yy451; } |
| 143016 | | - break; |
| 143017 | | - case 270: /* with ::= WITH RECURSIVE wqlist */ |
| 143018 | | -{ yymsp[-2].minor.yy451 = yymsp[0].minor.yy451; } |
| 143019 | | - break; |
| 143020 | | - case 271: /* wqlist ::= nm eidlist_opt AS LP select RP */ |
| 143409 | + case 271: /* with ::= WITH wqlist */ |
| 143410 | + case 272: /* with ::= WITH RECURSIVE wqlist */ yytestcase(yyruleno==272); |
| 143411 | +{ sqlite3WithPush(pParse, yymsp[0].minor.yy451, 1); } |
| 143412 | + break; |
| 143413 | + case 273: /* wqlist ::= nm eidlist_opt AS LP select RP */ |
| 143021 | 143414 | { |
| 143022 | 143415 | yymsp[-5].minor.yy451 = sqlite3WithAdd(pParse, 0, &yymsp[-5].minor.yy0, yymsp[-4].minor.yy322, yymsp[-1].minor.yy387); /*A-overwrites-X*/ |
| 143023 | 143416 | } |
| 143024 | 143417 | break; |
| 143025 | | - case 272: /* wqlist ::= wqlist COMMA nm eidlist_opt AS LP select RP */ |
| 143418 | + case 274: /* wqlist ::= wqlist COMMA nm eidlist_opt AS LP select RP */ |
| 143026 | 143419 | { |
| 143027 | 143420 | yymsp[-7].minor.yy451 = sqlite3WithAdd(pParse, yymsp[-7].minor.yy451, &yymsp[-5].minor.yy0, yymsp[-4].minor.yy322, yymsp[-1].minor.yy387); |
| 143028 | 143421 | } |
| 143029 | 143422 | break; |
| 143030 | 143423 | default: |
| 143031 | | - /* (273) input ::= cmdlist */ yytestcase(yyruleno==273); |
| 143032 | | - /* (274) cmdlist ::= cmdlist ecmd */ yytestcase(yyruleno==274); |
| 143033 | | - /* (275) cmdlist ::= ecmd (OPTIMIZED OUT) */ assert(yyruleno!=275); |
| 143034 | | - /* (276) ecmd ::= SEMI */ yytestcase(yyruleno==276); |
| 143035 | | - /* (277) ecmd ::= explain cmdx SEMI */ yytestcase(yyruleno==277); |
| 143036 | | - /* (278) explain ::= */ yytestcase(yyruleno==278); |
| 143037 | | - /* (279) trans_opt ::= */ yytestcase(yyruleno==279); |
| 143038 | | - /* (280) trans_opt ::= TRANSACTION */ yytestcase(yyruleno==280); |
| 143039 | | - /* (281) trans_opt ::= TRANSACTION nm */ yytestcase(yyruleno==281); |
| 143040 | | - /* (282) savepoint_opt ::= SAVEPOINT */ yytestcase(yyruleno==282); |
| 143041 | | - /* (283) savepoint_opt ::= */ yytestcase(yyruleno==283); |
| 143042 | | - /* (284) cmd ::= create_table create_table_args */ yytestcase(yyruleno==284); |
| 143043 | | - /* (285) columnlist ::= columnlist COMMA columnname carglist */ yytestcase(yyruleno==285); |
| 143044 | | - /* (286) columnlist ::= columnname carglist */ yytestcase(yyruleno==286); |
| 143045 | | - /* (287) nm ::= ID|INDEXED */ yytestcase(yyruleno==287); |
| 143046 | | - /* (288) nm ::= STRING */ yytestcase(yyruleno==288); |
| 143047 | | - /* (289) nm ::= JOIN_KW */ yytestcase(yyruleno==289); |
| 143048 | | - /* (290) typetoken ::= typename */ yytestcase(yyruleno==290); |
| 143049 | | - /* (291) typename ::= ID|STRING */ yytestcase(yyruleno==291); |
| 143050 | | - /* (292) signed ::= plus_num (OPTIMIZED OUT) */ assert(yyruleno!=292); |
| 143051 | | - /* (293) signed ::= minus_num (OPTIMIZED OUT) */ assert(yyruleno!=293); |
| 143052 | | - /* (294) carglist ::= carglist ccons */ yytestcase(yyruleno==294); |
| 143053 | | - /* (295) carglist ::= */ yytestcase(yyruleno==295); |
| 143054 | | - /* (296) ccons ::= NULL onconf */ yytestcase(yyruleno==296); |
| 143055 | | - /* (297) conslist_opt ::= COMMA conslist */ yytestcase(yyruleno==297); |
| 143056 | | - /* (298) conslist ::= conslist tconscomma tcons */ yytestcase(yyruleno==298); |
| 143057 | | - /* (299) conslist ::= tcons (OPTIMIZED OUT) */ assert(yyruleno!=299); |
| 143058 | | - /* (300) tconscomma ::= */ yytestcase(yyruleno==300); |
| 143059 | | - /* (301) defer_subclause_opt ::= defer_subclause (OPTIMIZED OUT) */ assert(yyruleno!=301); |
| 143060 | | - /* (302) resolvetype ::= raisetype (OPTIMIZED OUT) */ assert(yyruleno!=302); |
| 143061 | | - /* (303) selectnowith ::= oneselect (OPTIMIZED OUT) */ assert(yyruleno!=303); |
| 143062 | | - /* (304) oneselect ::= values */ yytestcase(yyruleno==304); |
| 143063 | | - /* (305) sclp ::= selcollist COMMA */ yytestcase(yyruleno==305); |
| 143064 | | - /* (306) as ::= ID|STRING */ yytestcase(yyruleno==306); |
| 143065 | | - /* (307) expr ::= term (OPTIMIZED OUT) */ assert(yyruleno!=307); |
| 143066 | | - /* (308) likeop ::= LIKE_KW|MATCH */ yytestcase(yyruleno==308); |
| 143067 | | - /* (309) exprlist ::= nexprlist */ yytestcase(yyruleno==309); |
| 143068 | | - /* (310) nmnum ::= plus_num (OPTIMIZED OUT) */ assert(yyruleno!=310); |
| 143069 | | - /* (311) nmnum ::= nm (OPTIMIZED OUT) */ assert(yyruleno!=311); |
| 143070 | | - /* (312) nmnum ::= ON */ yytestcase(yyruleno==312); |
| 143071 | | - /* (313) nmnum ::= DELETE */ yytestcase(yyruleno==313); |
| 143072 | | - /* (314) nmnum ::= DEFAULT */ yytestcase(yyruleno==314); |
| 143073 | | - /* (315) plus_num ::= INTEGER|FLOAT */ yytestcase(yyruleno==315); |
| 143074 | | - /* (316) foreach_clause ::= */ yytestcase(yyruleno==316); |
| 143075 | | - /* (317) foreach_clause ::= FOR EACH ROW */ yytestcase(yyruleno==317); |
| 143076 | | - /* (318) trnm ::= nm */ yytestcase(yyruleno==318); |
| 143077 | | - /* (319) tridxby ::= */ yytestcase(yyruleno==319); |
| 143078 | | - /* (320) database_kw_opt ::= DATABASE */ yytestcase(yyruleno==320); |
| 143079 | | - /* (321) database_kw_opt ::= */ yytestcase(yyruleno==321); |
| 143080 | | - /* (322) kwcolumn_opt ::= */ yytestcase(yyruleno==322); |
| 143081 | | - /* (323) kwcolumn_opt ::= COLUMNKW */ yytestcase(yyruleno==323); |
| 143082 | | - /* (324) vtabarglist ::= vtabarg */ yytestcase(yyruleno==324); |
| 143083 | | - /* (325) vtabarglist ::= vtabarglist COMMA vtabarg */ yytestcase(yyruleno==325); |
| 143084 | | - /* (326) vtabarg ::= vtabarg vtabargtoken */ yytestcase(yyruleno==326); |
| 143085 | | - /* (327) anylist ::= */ yytestcase(yyruleno==327); |
| 143086 | | - /* (328) anylist ::= anylist LP anylist RP */ yytestcase(yyruleno==328); |
| 143087 | | - /* (329) anylist ::= anylist ANY */ yytestcase(yyruleno==329); |
| 143424 | + /* (275) input ::= cmdlist */ yytestcase(yyruleno==275); |
| 143425 | + /* (276) cmdlist ::= cmdlist ecmd */ yytestcase(yyruleno==276); |
| 143426 | + /* (277) cmdlist ::= ecmd (OPTIMIZED OUT) */ assert(yyruleno!=277); |
| 143427 | + /* (278) ecmd ::= SEMI */ yytestcase(yyruleno==278); |
| 143428 | + /* (279) ecmd ::= explain cmdx SEMI */ yytestcase(yyruleno==279); |
| 143429 | + /* (280) explain ::= */ yytestcase(yyruleno==280); |
| 143430 | + /* (281) trans_opt ::= */ yytestcase(yyruleno==281); |
| 143431 | + /* (282) trans_opt ::= TRANSACTION */ yytestcase(yyruleno==282); |
| 143432 | + /* (283) trans_opt ::= TRANSACTION nm */ yytestcase(yyruleno==283); |
| 143433 | + /* (284) savepoint_opt ::= SAVEPOINT */ yytestcase(yyruleno==284); |
| 143434 | + /* (285) savepoint_opt ::= */ yytestcase(yyruleno==285); |
| 143435 | + /* (286) cmd ::= create_table create_table_args */ yytestcase(yyruleno==286); |
| 143436 | + /* (287) columnlist ::= columnlist COMMA columnname carglist */ yytestcase(yyruleno==287); |
| 143437 | + /* (288) columnlist ::= columnname carglist */ yytestcase(yyruleno==288); |
| 143438 | + /* (289) nm ::= ID|INDEXED */ yytestcase(yyruleno==289); |
| 143439 | + /* (290) nm ::= STRING */ yytestcase(yyruleno==290); |
| 143440 | + /* (291) nm ::= JOIN_KW */ yytestcase(yyruleno==291); |
| 143441 | + /* (292) typetoken ::= typename */ yytestcase(yyruleno==292); |
| 143442 | + /* (293) typename ::= ID|STRING */ yytestcase(yyruleno==293); |
| 143443 | + /* (294) signed ::= plus_num (OPTIMIZED OUT) */ assert(yyruleno!=294); |
| 143444 | + /* (295) signed ::= minus_num (OPTIMIZED OUT) */ assert(yyruleno!=295); |
| 143445 | + /* (296) carglist ::= carglist ccons */ yytestcase(yyruleno==296); |
| 143446 | + /* (297) carglist ::= */ yytestcase(yyruleno==297); |
| 143447 | + /* (298) ccons ::= NULL onconf */ yytestcase(yyruleno==298); |
| 143448 | + /* (299) conslist_opt ::= COMMA conslist */ yytestcase(yyruleno==299); |
| 143449 | + /* (300) conslist ::= conslist tconscomma tcons */ yytestcase(yyruleno==300); |
| 143450 | + /* (301) conslist ::= tcons (OPTIMIZED OUT) */ assert(yyruleno!=301); |
| 143451 | + /* (302) tconscomma ::= */ yytestcase(yyruleno==302); |
| 143452 | + /* (303) defer_subclause_opt ::= defer_subclause (OPTIMIZED OUT) */ assert(yyruleno!=303); |
| 143453 | + /* (304) resolvetype ::= raisetype (OPTIMIZED OUT) */ assert(yyruleno!=304); |
| 143454 | + /* (305) selectnowith ::= oneselect (OPTIMIZED OUT) */ assert(yyruleno!=305); |
| 143455 | + /* (306) oneselect ::= values */ yytestcase(yyruleno==306); |
| 143456 | + /* (307) sclp ::= selcollist COMMA */ yytestcase(yyruleno==307); |
| 143457 | + /* (308) as ::= ID|STRING */ yytestcase(yyruleno==308); |
| 143458 | + /* (309) expr ::= term (OPTIMIZED OUT) */ assert(yyruleno!=309); |
| 143459 | + /* (310) likeop ::= LIKE_KW|MATCH */ yytestcase(yyruleno==310); |
| 143460 | + /* (311) exprlist ::= nexprlist */ yytestcase(yyruleno==311); |
| 143461 | + /* (312) nmnum ::= plus_num (OPTIMIZED OUT) */ assert(yyruleno!=312); |
| 143462 | + /* (313) nmnum ::= nm (OPTIMIZED OUT) */ assert(yyruleno!=313); |
| 143463 | + /* (314) nmnum ::= ON */ yytestcase(yyruleno==314); |
| 143464 | + /* (315) nmnum ::= DELETE */ yytestcase(yyruleno==315); |
| 143465 | + /* (316) nmnum ::= DEFAULT */ yytestcase(yyruleno==316); |
| 143466 | + /* (317) plus_num ::= INTEGER|FLOAT */ yytestcase(yyruleno==317); |
| 143467 | + /* (318) foreach_clause ::= */ yytestcase(yyruleno==318); |
| 143468 | + /* (319) foreach_clause ::= FOR EACH ROW */ yytestcase(yyruleno==319); |
| 143469 | + /* (320) trnm ::= nm */ yytestcase(yyruleno==320); |
| 143470 | + /* (321) tridxby ::= */ yytestcase(yyruleno==321); |
| 143471 | + /* (322) database_kw_opt ::= DATABASE */ yytestcase(yyruleno==322); |
| 143472 | + /* (323) database_kw_opt ::= */ yytestcase(yyruleno==323); |
| 143473 | + /* (324) kwcolumn_opt ::= */ yytestcase(yyruleno==324); |
| 143474 | + /* (325) kwcolumn_opt ::= COLUMNKW */ yytestcase(yyruleno==325); |
| 143475 | + /* (326) vtabarglist ::= vtabarg */ yytestcase(yyruleno==326); |
| 143476 | + /* (327) vtabarglist ::= vtabarglist COMMA vtabarg */ yytestcase(yyruleno==327); |
| 143477 | + /* (328) vtabarg ::= vtabarg vtabargtoken */ yytestcase(yyruleno==328); |
| 143478 | + /* (329) anylist ::= */ yytestcase(yyruleno==329); |
| 143479 | + /* (330) anylist ::= anylist LP anylist RP */ yytestcase(yyruleno==330); |
| 143480 | + /* (331) anylist ::= anylist ANY */ yytestcase(yyruleno==331); |
| 143481 | + /* (332) with ::= */ yytestcase(yyruleno==332); |
| 143088 | 143482 | break; |
| 143089 | 143483 | /********** End reduce actions ************************************************/ |
| 143090 | 143484 | }; |
| 143091 | 143485 | assert( yyruleno<sizeof(yyRuleInfo)/sizeof(yyRuleInfo[0]) ); |
| 143092 | 143486 | yygoto = yyRuleInfo[yyruleno].lhs; |
| | @@ -146146,43 +146540,65 @@ |
| 146146 | 146540 | /* |
| 146147 | 146541 | ** This routine implements a busy callback that sleeps and tries |
| 146148 | 146542 | ** again until a timeout value is reached. The timeout value is |
| 146149 | 146543 | ** an integer number of milliseconds passed in as the first |
| 146150 | 146544 | ** argument. |
| 146545 | +** |
| 146546 | +** Return non-zero to retry the lock. Return zero to stop trying |
| 146547 | +** and cause SQLite to return SQLITE_BUSY. |
| 146151 | 146548 | */ |
| 146152 | 146549 | static int sqliteDefaultBusyCallback( |
| 146153 | | - void *ptr, /* Database connection */ |
| 146154 | | - int count /* Number of times table has been busy */ |
| 146550 | + void *ptr, /* Database connection */ |
| 146551 | + int count, /* Number of times table has been busy */ |
| 146552 | + sqlite3_file *pFile /* The file on which the lock occurred */ |
| 146155 | 146553 | ){ |
| 146156 | 146554 | #if SQLITE_OS_WIN || HAVE_USLEEP |
| 146555 | + /* This case is for systems that have support for sleeping for fractions of |
| 146556 | + ** a second. Examples: All windows systems, unix systems with usleep() */ |
| 146157 | 146557 | static const u8 delays[] = |
| 146158 | 146558 | { 1, 2, 5, 10, 15, 20, 25, 25, 25, 50, 50, 100 }; |
| 146159 | 146559 | static const u8 totals[] = |
| 146160 | 146560 | { 0, 1, 3, 8, 18, 33, 53, 78, 103, 128, 178, 228 }; |
| 146161 | 146561 | # define NDELAY ArraySize(delays) |
| 146162 | 146562 | sqlite3 *db = (sqlite3 *)ptr; |
| 146163 | | - int timeout = db->busyTimeout; |
| 146563 | + int tmout = db->busyTimeout; |
| 146164 | 146564 | int delay, prior; |
| 146165 | 146565 | |
| 146566 | +#ifdef SQLITE_ENABLE_SETLK_TIMEOUT |
| 146567 | + if( sqlite3OsFileControl(pFile,SQLITE_FCNTL_LOCK_TIMEOUT,&tmout)==SQLITE_OK ){ |
| 146568 | + if( count ){ |
| 146569 | + tmout = 0; |
| 146570 | + sqlite3OsFileControl(pFile, SQLITE_FCNTL_LOCK_TIMEOUT, &tmout); |
| 146571 | + return 0; |
| 146572 | + }else{ |
| 146573 | + return 1; |
| 146574 | + } |
| 146575 | + } |
| 146576 | +#else |
| 146577 | + UNUSED_PARAMETER(pFile); |
| 146578 | +#endif |
| 146166 | 146579 | assert( count>=0 ); |
| 146167 | 146580 | if( count < NDELAY ){ |
| 146168 | 146581 | delay = delays[count]; |
| 146169 | 146582 | prior = totals[count]; |
| 146170 | 146583 | }else{ |
| 146171 | 146584 | delay = delays[NDELAY-1]; |
| 146172 | 146585 | prior = totals[NDELAY-1] + delay*(count-(NDELAY-1)); |
| 146173 | 146586 | } |
| 146174 | | - if( prior + delay > timeout ){ |
| 146175 | | - delay = timeout - prior; |
| 146587 | + if( prior + delay > tmout ){ |
| 146588 | + delay = tmout - prior; |
| 146176 | 146589 | if( delay<=0 ) return 0; |
| 146177 | 146590 | } |
| 146178 | 146591 | sqlite3OsSleep(db->pVfs, delay*1000); |
| 146179 | 146592 | return 1; |
| 146180 | 146593 | #else |
| 146594 | + /* This case for unix systems that lack usleep() support. Sleeping |
| 146595 | + ** must be done in increments of whole seconds */ |
| 146181 | 146596 | sqlite3 *db = (sqlite3 *)ptr; |
| 146182 | | - int timeout = ((sqlite3 *)ptr)->busyTimeout; |
| 146183 | | - if( (count+1)*1000 > timeout ){ |
| 146597 | + int tmout = ((sqlite3 *)ptr)->busyTimeout; |
| 146598 | + UNUSED_PARAMETER(pFile); |
| 146599 | + if( (count+1)*1000 > tmout ){ |
| 146184 | 146600 | return 0; |
| 146185 | 146601 | } |
| 146186 | 146602 | sqlite3OsSleep(db->pVfs, 1000000); |
| 146187 | 146603 | return 1; |
| 146188 | 146604 | #endif |
| | @@ -146189,18 +146605,29 @@ |
| 146189 | 146605 | } |
| 146190 | 146606 | |
| 146191 | 146607 | /* |
| 146192 | 146608 | ** Invoke the given busy handler. |
| 146193 | 146609 | ** |
| 146194 | | -** This routine is called when an operation failed with a lock. |
| 146610 | +** This routine is called when an operation failed to acquire a |
| 146611 | +** lock on VFS file pFile. |
| 146612 | +** |
| 146195 | 146613 | ** If this routine returns non-zero, the lock is retried. If it |
| 146196 | 146614 | ** returns 0, the operation aborts with an SQLITE_BUSY error. |
| 146197 | 146615 | */ |
| 146198 | | -SQLITE_PRIVATE int sqlite3InvokeBusyHandler(BusyHandler *p){ |
| 146616 | +SQLITE_PRIVATE int sqlite3InvokeBusyHandler(BusyHandler *p, sqlite3_file *pFile){ |
| 146199 | 146617 | int rc; |
| 146200 | | - if( NEVER(p==0) || p->xFunc==0 || p->nBusy<0 ) return 0; |
| 146201 | | - rc = p->xFunc(p->pArg, p->nBusy); |
| 146618 | + if( p->xBusyHandler==0 || p->nBusy<0 ) return 0; |
| 146619 | + if( p->bExtraFileArg ){ |
| 146620 | + /* Add an extra parameter with the pFile pointer to the end of the |
| 146621 | + ** callback argument list */ |
| 146622 | + int (*xTra)(void*,int,sqlite3_file*); |
| 146623 | + xTra = (int(*)(void*,int,sqlite3_file*))p->xBusyHandler; |
| 146624 | + rc = xTra(p->pBusyArg, p->nBusy, pFile); |
| 146625 | + }else{ |
| 146626 | + /* Legacy style busy handler callback */ |
| 146627 | + rc = p->xBusyHandler(p->pBusyArg, p->nBusy); |
| 146628 | + } |
| 146202 | 146629 | if( rc==0 ){ |
| 146203 | 146630 | p->nBusy = -1; |
| 146204 | 146631 | }else{ |
| 146205 | 146632 | p->nBusy++; |
| 146206 | 146633 | } |
| | @@ -146218,13 +146645,14 @@ |
| 146218 | 146645 | ){ |
| 146219 | 146646 | #ifdef SQLITE_ENABLE_API_ARMOR |
| 146220 | 146647 | if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT; |
| 146221 | 146648 | #endif |
| 146222 | 146649 | sqlite3_mutex_enter(db->mutex); |
| 146223 | | - db->busyHandler.xFunc = xBusy; |
| 146224 | | - db->busyHandler.pArg = pArg; |
| 146650 | + db->busyHandler.xBusyHandler = xBusy; |
| 146651 | + db->busyHandler.pBusyArg = pArg; |
| 146225 | 146652 | db->busyHandler.nBusy = 0; |
| 146653 | + db->busyHandler.bExtraFileArg = 0; |
| 146226 | 146654 | db->busyTimeout = 0; |
| 146227 | 146655 | sqlite3_mutex_leave(db->mutex); |
| 146228 | 146656 | return SQLITE_OK; |
| 146229 | 146657 | } |
| 146230 | 146658 | |
| | @@ -146268,12 +146696,14 @@ |
| 146268 | 146696 | SQLITE_API int sqlite3_busy_timeout(sqlite3 *db, int ms){ |
| 146269 | 146697 | #ifdef SQLITE_ENABLE_API_ARMOR |
| 146270 | 146698 | if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT; |
| 146271 | 146699 | #endif |
| 146272 | 146700 | if( ms>0 ){ |
| 146273 | | - sqlite3_busy_handler(db, sqliteDefaultBusyCallback, (void*)db); |
| 146701 | + sqlite3_busy_handler(db, (int(*)(void*,int))sqliteDefaultBusyCallback, |
| 146702 | + (void*)db); |
| 146274 | 146703 | db->busyTimeout = ms; |
| 146704 | + db->busyHandler.bExtraFileArg = 1; |
| 146275 | 146705 | }else{ |
| 146276 | 146706 | sqlite3_busy_handler(db, 0, 0); |
| 146277 | 146707 | } |
| 146278 | 146708 | return SQLITE_OK; |
| 146279 | 146709 | } |
| | @@ -148262,14 +148692,12 @@ |
| 148262 | 148692 | *(sqlite3_vfs**)pArg = sqlite3PagerVfs(pPager); |
| 148263 | 148693 | rc = SQLITE_OK; |
| 148264 | 148694 | }else if( op==SQLITE_FCNTL_JOURNAL_POINTER ){ |
| 148265 | 148695 | *(sqlite3_file**)pArg = sqlite3PagerJrnlFile(pPager); |
| 148266 | 148696 | rc = SQLITE_OK; |
| 148267 | | - }else if( fd->pMethods ){ |
| 148697 | + }else{ |
| 148268 | 148698 | rc = sqlite3OsFileControl(fd, op, pArg); |
| 148269 | | - }else{ |
| 148270 | | - rc = SQLITE_NOTFOUND; |
| 148271 | 148699 | } |
| 148272 | 148700 | sqlite3BtreeLeave(pBtree); |
| 148273 | 148701 | } |
| 148274 | 148702 | sqlite3_mutex_leave(db->mutex); |
| 148275 | 148703 | return rc; |
| | @@ -179336,11 +179764,11 @@ |
| 179336 | 179764 | /* If connected to a ZIPVFS backend, override the page size and |
| 179337 | 179765 | ** offset with actual values obtained from ZIPVFS. |
| 179338 | 179766 | */ |
| 179339 | 179767 | fd = sqlite3PagerFile(pPager); |
| 179340 | 179768 | x[0] = pCsr->iPageno; |
| 179341 | | - if( fd->pMethods!=0 && sqlite3OsFileControl(fd, 230440, &x)==SQLITE_OK ){ |
| 179769 | + if( sqlite3OsFileControl(fd, 230440, &x)==SQLITE_OK ){ |
| 179342 | 179770 | pCsr->iOffset = x[0]; |
| 179343 | 179771 | pCsr->szPage = (int)x[1]; |
| 179344 | 179772 | } |
| 179345 | 179773 | } |
| 179346 | 179774 | |
| | @@ -180102,11 +180530,11 @@ |
| 180102 | 180530 | ** input data. Input data may be supplied either as a single large buffer |
| 180103 | 180531 | ** (e.g. sqlite3changeset_start()) or using a stream function (e.g. |
| 180104 | 180532 | ** sqlite3changeset_start_strm()). |
| 180105 | 180533 | */ |
| 180106 | 180534 | struct SessionInput { |
| 180107 | | - int bNoDiscard; /* If true, discard no data */ |
| 180535 | + int bNoDiscard; /* If true, do not discard in InputBuffer() */ |
| 180108 | 180536 | int iCurrent; /* Offset in aData[] of current change */ |
| 180109 | 180537 | int iNext; /* Offset in aData[] of next change */ |
| 180110 | 180538 | u8 *aData; /* Pointer to buffer containing changeset */ |
| 180111 | 180539 | int nData; /* Number of bytes in aData */ |
| 180112 | 180540 | |
| | @@ -180266,12 +180694,12 @@ |
| 180266 | 180694 | ** of a patchset change is associated with the correspondingly positioned |
| 180267 | 180695 | ** table column, counting from left to right within the CREATE TABLE |
| 180268 | 180696 | ** statement. |
| 180269 | 180697 | ** |
| 180270 | 180698 | ** For a DELETE change, all fields within the record except those associated |
| 180271 | | -** with PRIMARY KEY columns are set to "undefined". The PRIMARY KEY fields |
| 180272 | | -** contain the values identifying the row to delete. |
| 180699 | +** with PRIMARY KEY columns are omitted. The PRIMARY KEY fields contain the |
| 180700 | +** values identifying the row to delete. |
| 180273 | 180701 | ** |
| 180274 | 180702 | ** For an UPDATE change, all fields except those associated with PRIMARY KEY |
| 180275 | 180703 | ** columns and columns that are modified by the UPDATE are set to "undefined". |
| 180276 | 180704 | ** PRIMARY KEY fields contain the values identifying the table row to update, |
| 180277 | 180705 | ** and fields associated with modified columns contain the new column values. |
| | @@ -180550,11 +180978,11 @@ |
| 180550 | 180978 | ** the type byte). |
| 180551 | 180979 | */ |
| 180552 | 180980 | static int sessionSerialLen(u8 *a){ |
| 180553 | 180981 | int e = *a; |
| 180554 | 180982 | int n; |
| 180555 | | - if( e==0 ) return 1; |
| 180983 | + if( e==0 || e==0xFF ) return 1; |
| 180556 | 180984 | if( e==SQLITE_NULL ) return 1; |
| 180557 | 180985 | if( e==SQLITE_INTEGER || e==SQLITE_FLOAT ) return 9; |
| 180558 | 180986 | return sessionVarintGet(&a[1], &n) + 1 + n; |
| 180559 | 180987 | } |
| 180560 | 180988 | |
| | @@ -180630,11 +181058,11 @@ |
| 180630 | 181058 | for(iCol=0; iCol<pTab->nCol; iCol++){ |
| 180631 | 181059 | if( pTab->abPK[iCol] ){ |
| 180632 | 181060 | int n1 = sessionSerialLen(a1); |
| 180633 | 181061 | int n2 = sessionSerialLen(a2); |
| 180634 | 181062 | |
| 180635 | | - if( pTab->abPK[iCol] && (n1!=n2 || memcmp(a1, a2, n1)) ){ |
| 181063 | + if( n1!=n2 || memcmp(a1, a2, n1) ){ |
| 180636 | 181064 | return 0; |
| 180637 | 181065 | } |
| 180638 | 181066 | a1 += n1; |
| 180639 | 181067 | a2 += n2; |
| 180640 | 181068 | }else{ |
| | @@ -180873,11 +181301,11 @@ |
| 180873 | 181301 | if( eType==SQLITE_TEXT ){ |
| 180874 | 181302 | z = sqlite3_value_text(pVal); |
| 180875 | 181303 | }else{ |
| 180876 | 181304 | z = sqlite3_value_blob(pVal); |
| 180877 | 181305 | } |
| 180878 | | - if( memcmp(a, z, n) ) return 0; |
| 181306 | + if( n>0 && memcmp(a, z, n) ) return 0; |
| 180879 | 181307 | a += n; |
| 180880 | 181308 | } |
| 180881 | 181309 | } |
| 180882 | 181310 | } |
| 180883 | 181311 | |
| | @@ -182217,10 +182645,11 @@ |
| 182217 | 182645 | if( 0==sqlite3_stricmp("sqlite_stat1", zTab) ){ |
| 182218 | 182646 | zSql = sqlite3_mprintf( |
| 182219 | 182647 | "SELECT tbl, ?2, stat FROM %Q.sqlite_stat1 WHERE tbl IS ?1 AND " |
| 182220 | 182648 | "idx IS (CASE WHEN ?2=X'' THEN NULL ELSE ?2 END)", zDb |
| 182221 | 182649 | ); |
| 182650 | + if( zSql==0 ) rc = SQLITE_NOMEM; |
| 182222 | 182651 | }else{ |
| 182223 | 182652 | int i; |
| 182224 | 182653 | const char *zSep = ""; |
| 182225 | 182654 | SessionBuffer buf = {0, 0, 0}; |
| 182226 | 182655 | |
| | @@ -182626,11 +183055,11 @@ |
| 182626 | 183055 | /* |
| 182627 | 183056 | ** If the SessionInput object passed as the only argument is a streaming |
| 182628 | 183057 | ** object and the buffer is full, discard some data to free up space. |
| 182629 | 183058 | */ |
| 182630 | 183059 | static void sessionDiscardData(SessionInput *pIn){ |
| 182631 | | - if( pIn->bEof && pIn->xInput && pIn->iNext>=SESSIONS_STRM_CHUNK_SIZE ){ |
| 183060 | + if( pIn->xInput && pIn->iNext>=SESSIONS_STRM_CHUNK_SIZE ){ |
| 182632 | 183061 | int nMove = pIn->buf.nBuf - pIn->iNext; |
| 182633 | 183062 | assert( nMove>=0 ); |
| 182634 | 183063 | if( nMove>0 ){ |
| 182635 | 183064 | memmove(pIn->buf.aBuf, &pIn->buf.aBuf[pIn->iNext], nMove); |
| 182636 | 183065 | } |
| | @@ -182952,11 +183381,12 @@ |
| 182952 | 183381 | ** changes in the changeset. |
| 182953 | 183382 | */ |
| 182954 | 183383 | static int sessionChangesetNext( |
| 182955 | 183384 | sqlite3_changeset_iter *p, /* Changeset iterator */ |
| 182956 | 183385 | u8 **paRec, /* If non-NULL, store record pointer here */ |
| 182957 | | - int *pnRec /* If non-NULL, store size of record here */ |
| 183386 | + int *pnRec, /* If non-NULL, store size of record here */ |
| 183387 | + int *pbNew /* If non-NULL, true if new table */ |
| 182958 | 183388 | ){ |
| 182959 | 183389 | int i; |
| 182960 | 183390 | u8 op; |
| 182961 | 183391 | |
| 182962 | 183392 | assert( (paRec==0 && pnRec==0) || (paRec && pnRec) ); |
| | @@ -182987,10 +183417,11 @@ |
| 182987 | 183417 | sessionDiscardData(&p->in); |
| 182988 | 183418 | p->in.iCurrent = p->in.iNext; |
| 182989 | 183419 | |
| 182990 | 183420 | op = p->in.aData[p->in.iNext++]; |
| 182991 | 183421 | while( op=='T' || op=='P' ){ |
| 183422 | + if( pbNew ) *pbNew = 1; |
| 182992 | 183423 | p->bPatchset = (op=='P'); |
| 182993 | 183424 | if( sessionChangesetReadTblhdr(p) ) return p->rc; |
| 182994 | 183425 | if( (p->rc = sessionInputBuffer(&p->in, 2)) ) return p->rc; |
| 182995 | 183426 | p->in.iCurrent = p->in.iNext; |
| 182996 | 183427 | if( p->in.iNext>=p->in.nData ) return SQLITE_DONE; |
| | @@ -183065,11 +183496,11 @@ |
| 183065 | 183496 | ** |
| 183066 | 183497 | ** This function may not be called on iterators passed to a conflict handler |
| 183067 | 183498 | ** callback by changeset_apply(). |
| 183068 | 183499 | */ |
| 183069 | 183500 | SQLITE_API int sqlite3changeset_next(sqlite3_changeset_iter *p){ |
| 183070 | | - return sessionChangesetNext(p, 0, 0); |
| 183501 | + return sessionChangesetNext(p, 0, 0, 0); |
| 183071 | 183502 | } |
| 183072 | 183503 | |
| 183073 | 183504 | /* |
| 183074 | 183505 | ** The following function extracts information on the current change |
| 183075 | 183506 | ** from a changeset iterator. It may only be called after changeset_next() |
| | @@ -183444,10 +183875,12 @@ |
| 183444 | 183875 | const char **azCol; /* Array of column names */ |
| 183445 | 183876 | u8 *abPK; /* Boolean array - true if column is in PK */ |
| 183446 | 183877 | int bStat1; /* True if table is sqlite_stat1 */ |
| 183447 | 183878 | int bDeferConstraints; /* True to defer constraints */ |
| 183448 | 183879 | SessionBuffer constraints; /* Deferred constraints are stored here */ |
| 183880 | + SessionBuffer rebase; /* Rebase information (if any) here */ |
| 183881 | + int bRebaseStarted; /* If table header is already in rebase */ |
| 183449 | 183882 | }; |
| 183450 | 183883 | |
| 183451 | 183884 | /* |
| 183452 | 183885 | ** Formulate a statement to DELETE a row from database db. Assuming a table |
| 183453 | 183886 | ** structure like this: |
| | @@ -183710,11 +184143,10 @@ |
| 183710 | 184143 | "DELETE FROM main.sqlite_stat1 WHERE tbl=?1 AND idx IS " |
| 183711 | 184144 | "CASE WHEN length(?2)=0 AND typeof(?2)='blob' THEN NULL ELSE ?2 END " |
| 183712 | 184145 | "AND (?4 OR stat IS ?3)" |
| 183713 | 184146 | ); |
| 183714 | 184147 | } |
| 183715 | | - assert( rc==SQLITE_OK ); |
| 183716 | 184148 | return rc; |
| 183717 | 184149 | } |
| 183718 | 184150 | |
| 183719 | 184151 | /* |
| 183720 | 184152 | ** A wrapper around sqlite3_bind_value() that detects an extra problem. |
| | @@ -183824,10 +184256,58 @@ |
| 183824 | 184256 | if( rc!=SQLITE_ROW ) rc = sqlite3_reset(pSelect); |
| 183825 | 184257 | } |
| 183826 | 184258 | |
| 183827 | 184259 | return rc; |
| 183828 | 184260 | } |
| 184261 | + |
| 184262 | +/* |
| 184263 | +** This function is called from within sqlite3changset_apply_v2() when |
| 184264 | +** a conflict is encountered and resolved using conflict resolution |
| 184265 | +** mode eType (either SQLITE_CHANGESET_OMIT or SQLITE_CHANGESET_REPLACE).. |
| 184266 | +** It adds a conflict resolution record to the buffer in |
| 184267 | +** SessionApplyCtx.rebase, which will eventually be returned to the caller |
| 184268 | +** of apply_v2() as the "rebase" buffer. |
| 184269 | +** |
| 184270 | +** Return SQLITE_OK if successful, or an SQLite error code otherwise. |
| 184271 | +*/ |
| 184272 | +static int sessionRebaseAdd( |
| 184273 | + SessionApplyCtx *p, /* Apply context */ |
| 184274 | + int eType, /* Conflict resolution (OMIT or REPLACE) */ |
| 184275 | + sqlite3_changeset_iter *pIter /* Iterator pointing at current change */ |
| 184276 | +){ |
| 184277 | + int rc = SQLITE_OK; |
| 184278 | + int i; |
| 184279 | + int eOp = pIter->op; |
| 184280 | + if( p->bRebaseStarted==0 ){ |
| 184281 | + /* Append a table-header to the rebase buffer */ |
| 184282 | + const char *zTab = pIter->zTab; |
| 184283 | + sessionAppendByte(&p->rebase, 'T', &rc); |
| 184284 | + sessionAppendVarint(&p->rebase, p->nCol, &rc); |
| 184285 | + sessionAppendBlob(&p->rebase, p->abPK, p->nCol, &rc); |
| 184286 | + sessionAppendBlob(&p->rebase, (u8*)zTab, (int)strlen(zTab)+1, &rc); |
| 184287 | + p->bRebaseStarted = 1; |
| 184288 | + } |
| 184289 | + |
| 184290 | + assert( eType==SQLITE_CHANGESET_REPLACE||eType==SQLITE_CHANGESET_OMIT ); |
| 184291 | + assert( eOp==SQLITE_DELETE || eOp==SQLITE_INSERT || eOp==SQLITE_UPDATE ); |
| 184292 | + |
| 184293 | + sessionAppendByte(&p->rebase, |
| 184294 | + (eOp==SQLITE_DELETE ? SQLITE_DELETE : SQLITE_INSERT), &rc |
| 184295 | + ); |
| 184296 | + sessionAppendByte(&p->rebase, (eType==SQLITE_CHANGESET_REPLACE), &rc); |
| 184297 | + for(i=0; i<p->nCol; i++){ |
| 184298 | + sqlite3_value *pVal = 0; |
| 184299 | + if( eOp==SQLITE_DELETE || (eOp==SQLITE_UPDATE && p->abPK[i]) ){ |
| 184300 | + sqlite3changeset_old(pIter, i, &pVal); |
| 184301 | + }else{ |
| 184302 | + sqlite3changeset_new(pIter, i, &pVal); |
| 184303 | + } |
| 184304 | + sessionAppendValue(&p->rebase, pVal, &rc); |
| 184305 | + } |
| 184306 | + |
| 184307 | + return rc; |
| 184308 | +} |
| 183829 | 184309 | |
| 183830 | 184310 | /* |
| 183831 | 184311 | ** Invoke the conflict handler for the change that the changeset iterator |
| 183832 | 184312 | ** currently points to. |
| 183833 | 184313 | ** |
| | @@ -183900,11 +184380,11 @@ |
| 183900 | 184380 | /* Instead of invoking the conflict handler, append the change blob |
| 183901 | 184381 | ** to the SessionApplyCtx.constraints buffer. */ |
| 183902 | 184382 | u8 *aBlob = &pIter->in.aData[pIter->in.iCurrent]; |
| 183903 | 184383 | int nBlob = pIter->in.iNext - pIter->in.iCurrent; |
| 183904 | 184384 | sessionAppendBlob(&p->constraints, aBlob, nBlob, &rc); |
| 183905 | | - res = SQLITE_CHANGESET_OMIT; |
| 184385 | + return SQLITE_OK; |
| 183906 | 184386 | }else{ |
| 183907 | 184387 | /* No other row with the new.* primary key. */ |
| 183908 | 184388 | res = xConflict(pCtx, eType+1, pIter); |
| 183909 | 184389 | if( res==SQLITE_CHANGESET_REPLACE ) rc = SQLITE_MISUSE; |
| 183910 | 184390 | } |
| | @@ -183926,10 +184406,13 @@ |
| 183926 | 184406 | |
| 183927 | 184407 | default: |
| 183928 | 184408 | rc = SQLITE_MISUSE; |
| 183929 | 184409 | break; |
| 183930 | 184410 | } |
| 184411 | + if( rc==SQLITE_OK ){ |
| 184412 | + rc = sessionRebaseAdd(p, res, pIter); |
| 184413 | + } |
| 183931 | 184414 | } |
| 183932 | 184415 | |
| 183933 | 184416 | return rc; |
| 183934 | 184417 | } |
| 183935 | 184418 | |
| | @@ -184101,46 +184584,46 @@ |
| 184101 | 184584 | int bReplace = 0; |
| 184102 | 184585 | int bRetry = 0; |
| 184103 | 184586 | int rc; |
| 184104 | 184587 | |
| 184105 | 184588 | rc = sessionApplyOneOp(pIter, pApply, xConflict, pCtx, &bReplace, &bRetry); |
| 184106 | | - assert( rc==SQLITE_OK || (bRetry==0 && bReplace==0) ); |
| 184107 | | - |
| 184108 | | - /* If the bRetry flag is set, the change has not been applied due to an |
| 184109 | | - ** SQLITE_CHANGESET_DATA problem (i.e. this is an UPDATE or DELETE and |
| 184110 | | - ** a row with the correct PK is present in the db, but one or more other |
| 184111 | | - ** fields do not contain the expected values) and the conflict handler |
| 184112 | | - ** returned SQLITE_CHANGESET_REPLACE. In this case retry the operation, |
| 184113 | | - ** but pass NULL as the final argument so that sessionApplyOneOp() ignores |
| 184114 | | - ** the SQLITE_CHANGESET_DATA problem. */ |
| 184115 | | - if( bRetry ){ |
| 184116 | | - assert( pIter->op==SQLITE_UPDATE || pIter->op==SQLITE_DELETE ); |
| 184117 | | - rc = sessionApplyOneOp(pIter, pApply, xConflict, pCtx, 0, 0); |
| 184118 | | - } |
| 184119 | | - |
| 184120 | | - /* If the bReplace flag is set, the change is an INSERT that has not |
| 184121 | | - ** been performed because the database already contains a row with the |
| 184122 | | - ** specified primary key and the conflict handler returned |
| 184123 | | - ** SQLITE_CHANGESET_REPLACE. In this case remove the conflicting row |
| 184124 | | - ** before reattempting the INSERT. */ |
| 184125 | | - else if( bReplace ){ |
| 184126 | | - assert( pIter->op==SQLITE_INSERT ); |
| 184127 | | - rc = sqlite3_exec(db, "SAVEPOINT replace_op", 0, 0, 0); |
| 184128 | | - if( rc==SQLITE_OK ){ |
| 184129 | | - rc = sessionBindRow(pIter, |
| 184130 | | - sqlite3changeset_new, pApply->nCol, pApply->abPK, pApply->pDelete); |
| 184131 | | - sqlite3_bind_int(pApply->pDelete, pApply->nCol+1, 1); |
| 184132 | | - } |
| 184133 | | - if( rc==SQLITE_OK ){ |
| 184134 | | - sqlite3_step(pApply->pDelete); |
| 184135 | | - rc = sqlite3_reset(pApply->pDelete); |
| 184136 | | - } |
| 184137 | | - if( rc==SQLITE_OK ){ |
| 184138 | | - rc = sessionApplyOneOp(pIter, pApply, xConflict, pCtx, 0, 0); |
| 184139 | | - } |
| 184140 | | - if( rc==SQLITE_OK ){ |
| 184141 | | - rc = sqlite3_exec(db, "RELEASE replace_op", 0, 0, 0); |
| 184589 | + if( rc==SQLITE_OK ){ |
| 184590 | + /* If the bRetry flag is set, the change has not been applied due to an |
| 184591 | + ** SQLITE_CHANGESET_DATA problem (i.e. this is an UPDATE or DELETE and |
| 184592 | + ** a row with the correct PK is present in the db, but one or more other |
| 184593 | + ** fields do not contain the expected values) and the conflict handler |
| 184594 | + ** returned SQLITE_CHANGESET_REPLACE. In this case retry the operation, |
| 184595 | + ** but pass NULL as the final argument so that sessionApplyOneOp() ignores |
| 184596 | + ** the SQLITE_CHANGESET_DATA problem. */ |
| 184597 | + if( bRetry ){ |
| 184598 | + assert( pIter->op==SQLITE_UPDATE || pIter->op==SQLITE_DELETE ); |
| 184599 | + rc = sessionApplyOneOp(pIter, pApply, xConflict, pCtx, 0, 0); |
| 184600 | + } |
| 184601 | + |
| 184602 | + /* If the bReplace flag is set, the change is an INSERT that has not |
| 184603 | + ** been performed because the database already contains a row with the |
| 184604 | + ** specified primary key and the conflict handler returned |
| 184605 | + ** SQLITE_CHANGESET_REPLACE. In this case remove the conflicting row |
| 184606 | + ** before reattempting the INSERT. */ |
| 184607 | + else if( bReplace ){ |
| 184608 | + assert( pIter->op==SQLITE_INSERT ); |
| 184609 | + rc = sqlite3_exec(db, "SAVEPOINT replace_op", 0, 0, 0); |
| 184610 | + if( rc==SQLITE_OK ){ |
| 184611 | + rc = sessionBindRow(pIter, |
| 184612 | + sqlite3changeset_new, pApply->nCol, pApply->abPK, pApply->pDelete); |
| 184613 | + sqlite3_bind_int(pApply->pDelete, pApply->nCol+1, 1); |
| 184614 | + } |
| 184615 | + if( rc==SQLITE_OK ){ |
| 184616 | + sqlite3_step(pApply->pDelete); |
| 184617 | + rc = sqlite3_reset(pApply->pDelete); |
| 184618 | + } |
| 184619 | + if( rc==SQLITE_OK ){ |
| 184620 | + rc = sessionApplyOneOp(pIter, pApply, xConflict, pCtx, 0, 0); |
| 184621 | + } |
| 184622 | + if( rc==SQLITE_OK ){ |
| 184623 | + rc = sqlite3_exec(db, "RELEASE replace_op", 0, 0, 0); |
| 184624 | + } |
| 184142 | 184625 | } |
| 184143 | 184626 | } |
| 184144 | 184627 | |
| 184145 | 184628 | return rc; |
| 184146 | 184629 | } |
| | @@ -184212,14 +184695,16 @@ |
| 184212 | 184695 | int(*xConflict)( |
| 184213 | 184696 | void *pCtx, /* Copy of fifth arg to _apply() */ |
| 184214 | 184697 | int eConflict, /* DATA, MISSING, CONFLICT, CONSTRAINT */ |
| 184215 | 184698 | sqlite3_changeset_iter *p /* Handle describing change and conflict */ |
| 184216 | 184699 | ), |
| 184217 | | - void *pCtx /* First argument passed to xConflict */ |
| 184700 | + void *pCtx, /* First argument passed to xConflict */ |
| 184701 | + void **ppRebase, int *pnRebase, /* OUT: Rebase information */ |
| 184702 | + int flags /* SESSION_APPLY_XXX flags */ |
| 184218 | 184703 | ){ |
| 184219 | 184704 | int schemaMismatch = 0; |
| 184220 | | - int rc; /* Return code */ |
| 184705 | + int rc = SQLITE_OK; /* Return code */ |
| 184221 | 184706 | const char *zTab = 0; /* Name of current table */ |
| 184222 | 184707 | int nTab = 0; /* Result of sqlite3Strlen30(zTab) */ |
| 184223 | 184708 | SessionApplyCtx sApply; /* changeset_apply() context object */ |
| 184224 | 184709 | int bPatchset; |
| 184225 | 184710 | |
| | @@ -184226,11 +184711,13 @@ |
| 184226 | 184711 | assert( xConflict!=0 ); |
| 184227 | 184712 | |
| 184228 | 184713 | pIter->in.bNoDiscard = 1; |
| 184229 | 184714 | memset(&sApply, 0, sizeof(sApply)); |
| 184230 | 184715 | sqlite3_mutex_enter(sqlite3_db_mutex(db)); |
| 184231 | | - rc = sqlite3_exec(db, "SAVEPOINT changeset_apply", 0, 0, 0); |
| 184716 | + if( (flags & SQLITE_CHANGESETAPPLY_NOSAVEPOINT)==0 ){ |
| 184717 | + rc = sqlite3_exec(db, "SAVEPOINT changeset_apply", 0, 0, 0); |
| 184718 | + } |
| 184232 | 184719 | if( rc==SQLITE_OK ){ |
| 184233 | 184720 | rc = sqlite3_exec(db, "PRAGMA defer_foreign_keys = 1", 0, 0, 0); |
| 184234 | 184721 | } |
| 184235 | 184722 | while( rc==SQLITE_OK && SQLITE_ROW==sqlite3changeset_next(pIter) ){ |
| 184236 | 184723 | int nCol; |
| | @@ -184250,13 +184737,22 @@ |
| 184250 | 184737 | sqlite3_free((char*)sApply.azCol); /* cast works around VC++ bug */ |
| 184251 | 184738 | sqlite3_finalize(sApply.pDelete); |
| 184252 | 184739 | sqlite3_finalize(sApply.pUpdate); |
| 184253 | 184740 | sqlite3_finalize(sApply.pInsert); |
| 184254 | 184741 | sqlite3_finalize(sApply.pSelect); |
| 184255 | | - memset(&sApply, 0, sizeof(sApply)); |
| 184256 | 184742 | sApply.db = db; |
| 184743 | + sApply.pDelete = 0; |
| 184744 | + sApply.pUpdate = 0; |
| 184745 | + sApply.pInsert = 0; |
| 184746 | + sApply.pSelect = 0; |
| 184747 | + sApply.nCol = 0; |
| 184748 | + sApply.azCol = 0; |
| 184749 | + sApply.abPK = 0; |
| 184750 | + sApply.bStat1 = 0; |
| 184257 | 184751 | sApply.bDeferConstraints = 1; |
| 184752 | + sApply.bRebaseStarted = 0; |
| 184753 | + memset(&sApply.constraints, 0, sizeof(SessionBuffer)); |
| 184258 | 184754 | |
| 184259 | 184755 | /* If an xFilter() callback was specified, invoke it now. If the |
| 184260 | 184756 | ** xFilter callback returns zero, skip this table. If it returns |
| 184261 | 184757 | ** non-zero, proceed. */ |
| 184262 | 184758 | schemaMismatch = (xFilter && (0==xFilter(pCtx, zNew))); |
| | @@ -184355,26 +184851,65 @@ |
| 184355 | 184851 | } |
| 184356 | 184852 | } |
| 184357 | 184853 | } |
| 184358 | 184854 | sqlite3_exec(db, "PRAGMA defer_foreign_keys = 0", 0, 0, 0); |
| 184359 | 184855 | |
| 184360 | | - if( rc==SQLITE_OK ){ |
| 184361 | | - rc = sqlite3_exec(db, "RELEASE changeset_apply", 0, 0, 0); |
| 184362 | | - }else{ |
| 184363 | | - sqlite3_exec(db, "ROLLBACK TO changeset_apply", 0, 0, 0); |
| 184364 | | - sqlite3_exec(db, "RELEASE changeset_apply", 0, 0, 0); |
| 184856 | + if( (flags & SQLITE_CHANGESETAPPLY_NOSAVEPOINT)==0 ){ |
| 184857 | + if( rc==SQLITE_OK ){ |
| 184858 | + rc = sqlite3_exec(db, "RELEASE changeset_apply", 0, 0, 0); |
| 184859 | + }else{ |
| 184860 | + sqlite3_exec(db, "ROLLBACK TO changeset_apply", 0, 0, 0); |
| 184861 | + sqlite3_exec(db, "RELEASE changeset_apply", 0, 0, 0); |
| 184862 | + } |
| 184365 | 184863 | } |
| 184366 | 184864 | |
| 184865 | + if( rc==SQLITE_OK && bPatchset==0 && ppRebase && pnRebase ){ |
| 184866 | + *ppRebase = (void*)sApply.rebase.aBuf; |
| 184867 | + *pnRebase = sApply.rebase.nBuf; |
| 184868 | + sApply.rebase.aBuf = 0; |
| 184869 | + } |
| 184367 | 184870 | sqlite3_finalize(sApply.pInsert); |
| 184368 | 184871 | sqlite3_finalize(sApply.pDelete); |
| 184369 | 184872 | sqlite3_finalize(sApply.pUpdate); |
| 184370 | 184873 | sqlite3_finalize(sApply.pSelect); |
| 184371 | 184874 | sqlite3_free((char*)sApply.azCol); /* cast works around VC++ bug */ |
| 184372 | 184875 | sqlite3_free((char*)sApply.constraints.aBuf); |
| 184876 | + sqlite3_free((char*)sApply.rebase.aBuf); |
| 184373 | 184877 | sqlite3_mutex_leave(sqlite3_db_mutex(db)); |
| 184374 | 184878 | return rc; |
| 184375 | 184879 | } |
| 184880 | + |
| 184881 | +/* |
| 184882 | +** Apply the changeset passed via pChangeset/nChangeset to the main |
| 184883 | +** database attached to handle "db". |
| 184884 | +*/ |
| 184885 | +SQLITE_API int sqlite3changeset_apply_v2( |
| 184886 | + sqlite3 *db, /* Apply change to "main" db of this handle */ |
| 184887 | + int nChangeset, /* Size of changeset in bytes */ |
| 184888 | + void *pChangeset, /* Changeset blob */ |
| 184889 | + int(*xFilter)( |
| 184890 | + void *pCtx, /* Copy of sixth arg to _apply() */ |
| 184891 | + const char *zTab /* Table name */ |
| 184892 | + ), |
| 184893 | + int(*xConflict)( |
| 184894 | + void *pCtx, /* Copy of sixth arg to _apply() */ |
| 184895 | + int eConflict, /* DATA, MISSING, CONFLICT, CONSTRAINT */ |
| 184896 | + sqlite3_changeset_iter *p /* Handle describing change and conflict */ |
| 184897 | + ), |
| 184898 | + void *pCtx, /* First argument passed to xConflict */ |
| 184899 | + void **ppRebase, int *pnRebase, |
| 184900 | + int flags |
| 184901 | +){ |
| 184902 | + sqlite3_changeset_iter *pIter; /* Iterator to skip through changeset */ |
| 184903 | + int rc = sqlite3changeset_start(&pIter, nChangeset, pChangeset); |
| 184904 | + if( rc==SQLITE_OK ){ |
| 184905 | + rc = sessionChangesetApply( |
| 184906 | + db, pIter, xFilter, xConflict, pCtx, ppRebase, pnRebase, flags |
| 184907 | + ); |
| 184908 | + } |
| 184909 | + return rc; |
| 184910 | +} |
| 184376 | 184911 | |
| 184377 | 184912 | /* |
| 184378 | 184913 | ** Apply the changeset passed via pChangeset/nChangeset to the main database |
| 184379 | 184914 | ** attached to handle "db". Invoke the supplied conflict handler callback |
| 184380 | 184915 | ** to resolve any conflicts encountered while applying the change. |
| | @@ -184392,23 +184927,46 @@ |
| 184392 | 184927 | int eConflict, /* DATA, MISSING, CONFLICT, CONSTRAINT */ |
| 184393 | 184928 | sqlite3_changeset_iter *p /* Handle describing change and conflict */ |
| 184394 | 184929 | ), |
| 184395 | 184930 | void *pCtx /* First argument passed to xConflict */ |
| 184396 | 184931 | ){ |
| 184397 | | - sqlite3_changeset_iter *pIter; /* Iterator to skip through changeset */ |
| 184398 | | - int rc = sqlite3changeset_start(&pIter, nChangeset, pChangeset); |
| 184399 | | - if( rc==SQLITE_OK ){ |
| 184400 | | - rc = sessionChangesetApply(db, pIter, xFilter, xConflict, pCtx); |
| 184401 | | - } |
| 184402 | | - return rc; |
| 184932 | + return sqlite3changeset_apply_v2( |
| 184933 | + db, nChangeset, pChangeset, xFilter, xConflict, pCtx, 0, 0, 0 |
| 184934 | + ); |
| 184403 | 184935 | } |
| 184404 | 184936 | |
| 184405 | 184937 | /* |
| 184406 | 184938 | ** Apply the changeset passed via xInput/pIn to the main database |
| 184407 | 184939 | ** attached to handle "db". Invoke the supplied conflict handler callback |
| 184408 | 184940 | ** to resolve any conflicts encountered while applying the change. |
| 184409 | 184941 | */ |
| 184942 | +SQLITE_API int sqlite3changeset_apply_v2_strm( |
| 184943 | + sqlite3 *db, /* Apply change to "main" db of this handle */ |
| 184944 | + int (*xInput)(void *pIn, void *pData, int *pnData), /* Input function */ |
| 184945 | + void *pIn, /* First arg for xInput */ |
| 184946 | + int(*xFilter)( |
| 184947 | + void *pCtx, /* Copy of sixth arg to _apply() */ |
| 184948 | + const char *zTab /* Table name */ |
| 184949 | + ), |
| 184950 | + int(*xConflict)( |
| 184951 | + void *pCtx, /* Copy of sixth arg to _apply() */ |
| 184952 | + int eConflict, /* DATA, MISSING, CONFLICT, CONSTRAINT */ |
| 184953 | + sqlite3_changeset_iter *p /* Handle describing change and conflict */ |
| 184954 | + ), |
| 184955 | + void *pCtx, /* First argument passed to xConflict */ |
| 184956 | + void **ppRebase, int *pnRebase, |
| 184957 | + int flags |
| 184958 | +){ |
| 184959 | + sqlite3_changeset_iter *pIter; /* Iterator to skip through changeset */ |
| 184960 | + int rc = sqlite3changeset_start_strm(&pIter, xInput, pIn); |
| 184961 | + if( rc==SQLITE_OK ){ |
| 184962 | + rc = sessionChangesetApply( |
| 184963 | + db, pIter, xFilter, xConflict, pCtx, ppRebase, pnRebase, flags |
| 184964 | + ); |
| 184965 | + } |
| 184966 | + return rc; |
| 184967 | +} |
| 184410 | 184968 | SQLITE_API int sqlite3changeset_apply_strm( |
| 184411 | 184969 | sqlite3 *db, /* Apply change to "main" db of this handle */ |
| 184412 | 184970 | int (*xInput)(void *pIn, void *pData, int *pnData), /* Input function */ |
| 184413 | 184971 | void *pIn, /* First arg for xInput */ |
| 184414 | 184972 | int(*xFilter)( |
| | @@ -184420,16 +184978,13 @@ |
| 184420 | 184978 | int eConflict, /* DATA, MISSING, CONFLICT, CONSTRAINT */ |
| 184421 | 184979 | sqlite3_changeset_iter *p /* Handle describing change and conflict */ |
| 184422 | 184980 | ), |
| 184423 | 184981 | void *pCtx /* First argument passed to xConflict */ |
| 184424 | 184982 | ){ |
| 184425 | | - sqlite3_changeset_iter *pIter; /* Iterator to skip through changeset */ |
| 184426 | | - int rc = sqlite3changeset_start_strm(&pIter, xInput, pIn); |
| 184427 | | - if( rc==SQLITE_OK ){ |
| 184428 | | - rc = sessionChangesetApply(db, pIter, xFilter, xConflict, pCtx); |
| 184429 | | - } |
| 184430 | | - return rc; |
| 184983 | + return sqlite3changeset_apply_v2_strm( |
| 184984 | + db, xInput, pIn, xFilter, xConflict, pCtx, 0, 0, 0 |
| 184985 | + ); |
| 184431 | 184986 | } |
| 184432 | 184987 | |
| 184433 | 184988 | /* |
| 184434 | 184989 | ** sqlite3_changegroup handle. |
| 184435 | 184990 | */ |
| | @@ -184444,31 +184999,90 @@ |
| 184444 | 184999 | ** part of an sqlite3changeset_concat() operation. A new change object is |
| 184445 | 185000 | ** allocated and a pointer to it stored in *ppNew. |
| 184446 | 185001 | */ |
| 184447 | 185002 | static int sessionChangeMerge( |
| 184448 | 185003 | SessionTable *pTab, /* Table structure */ |
| 185004 | + int bRebase, /* True for a rebase hash-table */ |
| 184449 | 185005 | int bPatchset, /* True for patchsets */ |
| 184450 | 185006 | SessionChange *pExist, /* Existing change */ |
| 184451 | 185007 | int op2, /* Second change operation */ |
| 184452 | 185008 | int bIndirect, /* True if second change is indirect */ |
| 184453 | 185009 | u8 *aRec, /* Second change record */ |
| 184454 | 185010 | int nRec, /* Number of bytes in aRec */ |
| 184455 | 185011 | SessionChange **ppNew /* OUT: Merged change */ |
| 184456 | 185012 | ){ |
| 184457 | 185013 | SessionChange *pNew = 0; |
| 185014 | + int rc = SQLITE_OK; |
| 184458 | 185015 | |
| 184459 | 185016 | if( !pExist ){ |
| 184460 | 185017 | pNew = (SessionChange *)sqlite3_malloc(sizeof(SessionChange) + nRec); |
| 184461 | 185018 | if( !pNew ){ |
| 184462 | 185019 | return SQLITE_NOMEM; |
| 184463 | 185020 | } |
| 184464 | 185021 | memset(pNew, 0, sizeof(SessionChange)); |
| 184465 | 185022 | pNew->op = op2; |
| 184466 | 185023 | pNew->bIndirect = bIndirect; |
| 184467 | | - pNew->nRecord = nRec; |
| 184468 | 185024 | pNew->aRecord = (u8*)&pNew[1]; |
| 184469 | | - memcpy(pNew->aRecord, aRec, nRec); |
| 185025 | + if( bIndirect==0 || bRebase==0 ){ |
| 185026 | + pNew->nRecord = nRec; |
| 185027 | + memcpy(pNew->aRecord, aRec, nRec); |
| 185028 | + }else{ |
| 185029 | + int i; |
| 185030 | + u8 *pIn = aRec; |
| 185031 | + u8 *pOut = pNew->aRecord; |
| 185032 | + for(i=0; i<pTab->nCol; i++){ |
| 185033 | + int nIn = sessionSerialLen(pIn); |
| 185034 | + if( *pIn==0 ){ |
| 185035 | + *pOut++ = 0; |
| 185036 | + }else if( pTab->abPK[i]==0 ){ |
| 185037 | + *pOut++ = 0xFF; |
| 185038 | + }else{ |
| 185039 | + memcpy(pOut, pIn, nIn); |
| 185040 | + pOut += nIn; |
| 185041 | + } |
| 185042 | + pIn += nIn; |
| 185043 | + } |
| 185044 | + pNew->nRecord = pOut - pNew->aRecord; |
| 185045 | + } |
| 185046 | + }else if( bRebase ){ |
| 185047 | + if( pExist->op==SQLITE_DELETE && pExist->bIndirect ){ |
| 185048 | + *ppNew = pExist; |
| 185049 | + }else{ |
| 185050 | + int nByte = nRec + pExist->nRecord + sizeof(SessionChange); |
| 185051 | + pNew = (SessionChange*)sqlite3_malloc(nByte); |
| 185052 | + if( pNew==0 ){ |
| 185053 | + rc = SQLITE_NOMEM; |
| 185054 | + }else{ |
| 185055 | + int i; |
| 185056 | + u8 *a1 = pExist->aRecord; |
| 185057 | + u8 *a2 = aRec; |
| 185058 | + u8 *pOut; |
| 185059 | + |
| 185060 | + memset(pNew, 0, nByte); |
| 185061 | + pNew->bIndirect = bIndirect || pExist->bIndirect; |
| 185062 | + pNew->op = op2; |
| 185063 | + pOut = pNew->aRecord = (u8*)&pNew[1]; |
| 185064 | + |
| 185065 | + for(i=0; i<pTab->nCol; i++){ |
| 185066 | + int n1 = sessionSerialLen(a1); |
| 185067 | + int n2 = sessionSerialLen(a2); |
| 185068 | + if( *a1==0xFF || (pTab->abPK[i]==0 && bIndirect) ){ |
| 185069 | + *pOut++ = 0xFF; |
| 185070 | + }else if( *a2==0 ){ |
| 185071 | + memcpy(pOut, a1, n1); |
| 185072 | + pOut += n1; |
| 185073 | + }else{ |
| 185074 | + memcpy(pOut, a2, n2); |
| 185075 | + pOut += n2; |
| 185076 | + } |
| 185077 | + a1 += n1; |
| 185078 | + a2 += n2; |
| 185079 | + } |
| 185080 | + pNew->nRecord = pOut - pNew->aRecord; |
| 185081 | + } |
| 185082 | + sqlite3_free(pExist); |
| 185083 | + } |
| 184470 | 185084 | }else{ |
| 184471 | 185085 | int op1 = pExist->op; |
| 184472 | 185086 | |
| 184473 | 185087 | /* |
| 184474 | 185088 | ** op1=INSERT, op2=INSERT -> Unsupported. Discard op2. |
| | @@ -184558,28 +185172,28 @@ |
| 184558 | 185172 | sqlite3_free(pExist); |
| 184559 | 185173 | } |
| 184560 | 185174 | } |
| 184561 | 185175 | |
| 184562 | 185176 | *ppNew = pNew; |
| 184563 | | - return SQLITE_OK; |
| 185177 | + return rc; |
| 184564 | 185178 | } |
| 184565 | 185179 | |
| 184566 | 185180 | /* |
| 184567 | 185181 | ** Add all changes in the changeset traversed by the iterator passed as |
| 184568 | 185182 | ** the first argument to the changegroup hash tables. |
| 184569 | 185183 | */ |
| 184570 | 185184 | static int sessionChangesetToHash( |
| 184571 | 185185 | sqlite3_changeset_iter *pIter, /* Iterator to read from */ |
| 184572 | | - sqlite3_changegroup *pGrp /* Changegroup object to add changeset to */ |
| 185186 | + sqlite3_changegroup *pGrp, /* Changegroup object to add changeset to */ |
| 185187 | + int bRebase /* True if hash table is for rebasing */ |
| 184573 | 185188 | ){ |
| 184574 | 185189 | u8 *aRec; |
| 184575 | 185190 | int nRec; |
| 184576 | 185191 | int rc = SQLITE_OK; |
| 184577 | 185192 | SessionTable *pTab = 0; |
| 184578 | 185193 | |
| 184579 | | - |
| 184580 | | - while( SQLITE_ROW==sessionChangesetNext(pIter, &aRec, &nRec) ){ |
| 185194 | + while( SQLITE_ROW==sessionChangesetNext(pIter, &aRec, &nRec, 0) ){ |
| 184581 | 185195 | const char *zNew; |
| 184582 | 185196 | int nCol; |
| 184583 | 185197 | int op; |
| 184584 | 185198 | int iHash; |
| 184585 | 185199 | int bIndirect; |
| | @@ -184655,11 +185269,11 @@ |
| 184655 | 185269 | pTab->nEntry--; |
| 184656 | 185270 | break; |
| 184657 | 185271 | } |
| 184658 | 185272 | } |
| 184659 | 185273 | |
| 184660 | | - rc = sessionChangeMerge(pTab, |
| 185274 | + rc = sessionChangeMerge(pTab, bRebase, |
| 184661 | 185275 | pIter->bPatchset, pExist, op, bIndirect, aRec, nRec, &pChange |
| 184662 | 185276 | ); |
| 184663 | 185277 | if( rc ) break; |
| 184664 | 185278 | if( pChange ){ |
| 184665 | 185279 | pChange->pNext = pTab->apChange[iHash]; |
| | @@ -184763,11 +185377,11 @@ |
| 184763 | 185377 | sqlite3_changeset_iter *pIter; /* Iterator opened on pData/nData */ |
| 184764 | 185378 | int rc; /* Return code */ |
| 184765 | 185379 | |
| 184766 | 185380 | rc = sqlite3changeset_start(&pIter, nData, pData); |
| 184767 | 185381 | if( rc==SQLITE_OK ){ |
| 184768 | | - rc = sessionChangesetToHash(pIter, pGrp); |
| 185382 | + rc = sessionChangesetToHash(pIter, pGrp, 0); |
| 184769 | 185383 | } |
| 184770 | 185384 | sqlite3changeset_finalize(pIter); |
| 184771 | 185385 | return rc; |
| 184772 | 185386 | } |
| 184773 | 185387 | |
| | @@ -184794,11 +185408,11 @@ |
| 184794 | 185408 | sqlite3_changeset_iter *pIter; /* Iterator opened on pData/nData */ |
| 184795 | 185409 | int rc; /* Return code */ |
| 184796 | 185410 | |
| 184797 | 185411 | rc = sqlite3changeset_start_strm(&pIter, xInput, pIn); |
| 184798 | 185412 | if( rc==SQLITE_OK ){ |
| 184799 | | - rc = sessionChangesetToHash(pIter, pGrp); |
| 185413 | + rc = sessionChangesetToHash(pIter, pGrp, 0); |
| 184800 | 185414 | } |
| 184801 | 185415 | sqlite3changeset_finalize(pIter); |
| 184802 | 185416 | return rc; |
| 184803 | 185417 | } |
| 184804 | 185418 | |
| | @@ -184878,10 +185492,353 @@ |
| 184878 | 185492 | } |
| 184879 | 185493 | sqlite3changegroup_delete(pGrp); |
| 184880 | 185494 | |
| 184881 | 185495 | return rc; |
| 184882 | 185496 | } |
| 185497 | + |
| 185498 | +/* |
| 185499 | +** Changeset rebaser handle. |
| 185500 | +*/ |
| 185501 | +struct sqlite3_rebaser { |
| 185502 | + sqlite3_changegroup grp; /* Hash table */ |
| 185503 | +}; |
| 185504 | + |
| 185505 | +/* |
| 185506 | +** Buffers a1 and a2 must both contain a sessions module record nCol |
| 185507 | +** fields in size. This function appends an nCol sessions module |
| 185508 | +** record to buffer pBuf that is a copy of a1, except that for |
| 185509 | +** each field that is undefined in a1[], swap in the field from a2[]. |
| 185510 | +*/ |
| 185511 | +static void sessionAppendRecordMerge( |
| 185512 | + SessionBuffer *pBuf, /* Buffer to append to */ |
| 185513 | + int nCol, /* Number of columns in each record */ |
| 185514 | + u8 *a1, int n1, /* Record 1 */ |
| 185515 | + u8 *a2, int n2, /* Record 2 */ |
| 185516 | + int *pRc /* IN/OUT: error code */ |
| 185517 | +){ |
| 185518 | + sessionBufferGrow(pBuf, n1+n2, pRc); |
| 185519 | + if( *pRc==SQLITE_OK ){ |
| 185520 | + int i; |
| 185521 | + u8 *pOut = &pBuf->aBuf[pBuf->nBuf]; |
| 185522 | + for(i=0; i<nCol; i++){ |
| 185523 | + int nn1 = sessionSerialLen(a1); |
| 185524 | + int nn2 = sessionSerialLen(a2); |
| 185525 | + if( *a1==0 || *a1==0xFF ){ |
| 185526 | + memcpy(pOut, a2, nn2); |
| 185527 | + pOut += nn2; |
| 185528 | + }else{ |
| 185529 | + memcpy(pOut, a1, nn1); |
| 185530 | + pOut += nn1; |
| 185531 | + } |
| 185532 | + a1 += nn1; |
| 185533 | + a2 += nn2; |
| 185534 | + } |
| 185535 | + |
| 185536 | + pBuf->nBuf = pOut-pBuf->aBuf; |
| 185537 | + assert( pBuf->nBuf<=pBuf->nAlloc ); |
| 185538 | + } |
| 185539 | +} |
| 185540 | + |
| 185541 | +/* |
| 185542 | +** This function is called when rebasing a local UPDATE change against one |
| 185543 | +** or more remote UPDATE changes. The aRec/nRec buffer contains the current |
| 185544 | +** old.* and new.* records for the change. The rebase buffer (a single |
| 185545 | +** record) is in aChange/nChange. The rebased change is appended to buffer |
| 185546 | +** pBuf. |
| 185547 | +** |
| 185548 | +** Rebasing the UPDATE involves: |
| 185549 | +** |
| 185550 | +** * Removing any changes to fields for which the corresponding field |
| 185551 | +** in the rebase buffer is set to "replaced" (type 0xFF). If this |
| 185552 | +** means the UPDATE change updates no fields, nothing is appended |
| 185553 | +** to the output buffer. |
| 185554 | +** |
| 185555 | +** * For each field modified by the local change for which the |
| 185556 | +** corresponding field in the rebase buffer is not "undefined" (0x00) |
| 185557 | +** or "replaced" (0xFF), the old.* value is replaced by the value |
| 185558 | +** in the rebase buffer. |
| 185559 | +*/ |
| 185560 | +static void sessionAppendPartialUpdate( |
| 185561 | + SessionBuffer *pBuf, /* Append record here */ |
| 185562 | + sqlite3_changeset_iter *pIter, /* Iterator pointed at local change */ |
| 185563 | + u8 *aRec, int nRec, /* Local change */ |
| 185564 | + u8 *aChange, int nChange, /* Record to rebase against */ |
| 185565 | + int *pRc /* IN/OUT: Return Code */ |
| 185566 | +){ |
| 185567 | + sessionBufferGrow(pBuf, 2+nRec+nChange, pRc); |
| 185568 | + if( *pRc==SQLITE_OK ){ |
| 185569 | + int bData = 0; |
| 185570 | + u8 *pOut = &pBuf->aBuf[pBuf->nBuf]; |
| 185571 | + int i; |
| 185572 | + u8 *a1 = aRec; |
| 185573 | + u8 *a2 = aChange; |
| 185574 | + |
| 185575 | + *pOut++ = SQLITE_UPDATE; |
| 185576 | + *pOut++ = pIter->bIndirect; |
| 185577 | + for(i=0; i<pIter->nCol; i++){ |
| 185578 | + int n1 = sessionSerialLen(a1); |
| 185579 | + int n2 = sessionSerialLen(a2); |
| 185580 | + if( pIter->abPK[i] || a2[0]==0 ){ |
| 185581 | + if( !pIter->abPK[i] ) bData = 1; |
| 185582 | + memcpy(pOut, a1, n1); |
| 185583 | + pOut += n1; |
| 185584 | + }else if( a2[0]!=0xFF ){ |
| 185585 | + bData = 1; |
| 185586 | + memcpy(pOut, a2, n2); |
| 185587 | + pOut += n2; |
| 185588 | + }else{ |
| 185589 | + *pOut++ = '\0'; |
| 185590 | + } |
| 185591 | + a1 += n1; |
| 185592 | + a2 += n2; |
| 185593 | + } |
| 185594 | + if( bData ){ |
| 185595 | + a2 = aChange; |
| 185596 | + for(i=0; i<pIter->nCol; i++){ |
| 185597 | + int n1 = sessionSerialLen(a1); |
| 185598 | + int n2 = sessionSerialLen(a2); |
| 185599 | + if( pIter->abPK[i] || a2[0]!=0xFF ){ |
| 185600 | + memcpy(pOut, a1, n1); |
| 185601 | + pOut += n1; |
| 185602 | + }else{ |
| 185603 | + *pOut++ = '\0'; |
| 185604 | + } |
| 185605 | + a1 += n1; |
| 185606 | + a2 += n2; |
| 185607 | + } |
| 185608 | + pBuf->nBuf = (pOut - pBuf->aBuf); |
| 185609 | + } |
| 185610 | + } |
| 185611 | +} |
| 185612 | + |
| 185613 | +/* |
| 185614 | +** pIter is configured to iterate through a changeset. This function rebases |
| 185615 | +** that changeset according to the current configuration of the rebaser |
| 185616 | +** object passed as the first argument. If no error occurs and argument xOutput |
| 185617 | +** is not NULL, then the changeset is returned to the caller by invoking |
| 185618 | +** xOutput zero or more times and SQLITE_OK returned. Or, if xOutput is NULL, |
| 185619 | +** then (*ppOut) is set to point to a buffer containing the rebased changeset |
| 185620 | +** before this function returns. In this case (*pnOut) is set to the size of |
| 185621 | +** the buffer in bytes. It is the responsibility of the caller to eventually |
| 185622 | +** free the (*ppOut) buffer using sqlite3_free(). |
| 185623 | +** |
| 185624 | +** If an error occurs, an SQLite error code is returned. If ppOut and |
| 185625 | +** pnOut are not NULL, then the two output parameters are set to 0 before |
| 185626 | +** returning. |
| 185627 | +*/ |
| 185628 | +static int sessionRebase( |
| 185629 | + sqlite3_rebaser *p, /* Rebaser hash table */ |
| 185630 | + sqlite3_changeset_iter *pIter, /* Input data */ |
| 185631 | + int (*xOutput)(void *pOut, const void *pData, int nData), |
| 185632 | + void *pOut, /* Context for xOutput callback */ |
| 185633 | + int *pnOut, /* OUT: Number of bytes in output changeset */ |
| 185634 | + void **ppOut /* OUT: Inverse of pChangeset */ |
| 185635 | +){ |
| 185636 | + int rc = SQLITE_OK; |
| 185637 | + u8 *aRec = 0; |
| 185638 | + int nRec = 0; |
| 185639 | + int bNew = 0; |
| 185640 | + SessionTable *pTab = 0; |
| 185641 | + SessionBuffer sOut = {0,0,0}; |
| 185642 | + |
| 185643 | + while( SQLITE_ROW==sessionChangesetNext(pIter, &aRec, &nRec, &bNew) ){ |
| 185644 | + SessionChange *pChange = 0; |
| 185645 | + int bDone = 0; |
| 185646 | + |
| 185647 | + if( bNew ){ |
| 185648 | + const char *zTab = pIter->zTab; |
| 185649 | + for(pTab=p->grp.pList; pTab; pTab=pTab->pNext){ |
| 185650 | + if( 0==sqlite3_stricmp(pTab->zName, zTab) ) break; |
| 185651 | + } |
| 185652 | + bNew = 0; |
| 185653 | + |
| 185654 | + /* A patchset may not be rebased */ |
| 185655 | + if( pIter->bPatchset ){ |
| 185656 | + rc = SQLITE_ERROR; |
| 185657 | + } |
| 185658 | + |
| 185659 | + /* Append a table header to the output for this new table */ |
| 185660 | + sessionAppendByte(&sOut, pIter->bPatchset ? 'P' : 'T', &rc); |
| 185661 | + sessionAppendVarint(&sOut, pIter->nCol, &rc); |
| 185662 | + sessionAppendBlob(&sOut, pIter->abPK, pIter->nCol, &rc); |
| 185663 | + sessionAppendBlob(&sOut,(u8*)pIter->zTab,(int)strlen(pIter->zTab)+1,&rc); |
| 185664 | + } |
| 185665 | + |
| 185666 | + if( pTab && rc==SQLITE_OK ){ |
| 185667 | + int iHash = sessionChangeHash(pTab, 0, aRec, pTab->nChange); |
| 185668 | + |
| 185669 | + for(pChange=pTab->apChange[iHash]; pChange; pChange=pChange->pNext){ |
| 185670 | + if( sessionChangeEqual(pTab, 0, aRec, 0, pChange->aRecord) ){ |
| 185671 | + break; |
| 185672 | + } |
| 185673 | + } |
| 185674 | + } |
| 185675 | + |
| 185676 | + if( pChange ){ |
| 185677 | + assert( pChange->op==SQLITE_DELETE || pChange->op==SQLITE_INSERT ); |
| 185678 | + switch( pIter->op ){ |
| 185679 | + case SQLITE_INSERT: |
| 185680 | + if( pChange->op==SQLITE_INSERT ){ |
| 185681 | + bDone = 1; |
| 185682 | + if( pChange->bIndirect==0 ){ |
| 185683 | + sessionAppendByte(&sOut, SQLITE_UPDATE, &rc); |
| 185684 | + sessionAppendByte(&sOut, pIter->bIndirect, &rc); |
| 185685 | + sessionAppendBlob(&sOut, pChange->aRecord, pChange->nRecord, &rc); |
| 185686 | + sessionAppendBlob(&sOut, aRec, nRec, &rc); |
| 185687 | + } |
| 185688 | + } |
| 185689 | + break; |
| 185690 | + |
| 185691 | + case SQLITE_UPDATE: |
| 185692 | + bDone = 1; |
| 185693 | + if( pChange->op==SQLITE_DELETE ){ |
| 185694 | + if( pChange->bIndirect==0 ){ |
| 185695 | + u8 *pCsr = aRec; |
| 185696 | + sessionSkipRecord(&pCsr, pIter->nCol); |
| 185697 | + sessionAppendByte(&sOut, SQLITE_INSERT, &rc); |
| 185698 | + sessionAppendByte(&sOut, pIter->bIndirect, &rc); |
| 185699 | + sessionAppendRecordMerge(&sOut, pIter->nCol, |
| 185700 | + pCsr, nRec-(pCsr-aRec), |
| 185701 | + pChange->aRecord, pChange->nRecord, &rc |
| 185702 | + ); |
| 185703 | + } |
| 185704 | + }else{ |
| 185705 | + sessionAppendPartialUpdate(&sOut, pIter, |
| 185706 | + aRec, nRec, pChange->aRecord, pChange->nRecord, &rc |
| 185707 | + ); |
| 185708 | + } |
| 185709 | + break; |
| 185710 | + |
| 185711 | + default: |
| 185712 | + assert( pIter->op==SQLITE_DELETE ); |
| 185713 | + bDone = 1; |
| 185714 | + if( pChange->op==SQLITE_INSERT ){ |
| 185715 | + sessionAppendByte(&sOut, SQLITE_DELETE, &rc); |
| 185716 | + sessionAppendByte(&sOut, pIter->bIndirect, &rc); |
| 185717 | + sessionAppendRecordMerge(&sOut, pIter->nCol, |
| 185718 | + pChange->aRecord, pChange->nRecord, aRec, nRec, &rc |
| 185719 | + ); |
| 185720 | + } |
| 185721 | + break; |
| 185722 | + } |
| 185723 | + } |
| 185724 | + |
| 185725 | + if( bDone==0 ){ |
| 185726 | + sessionAppendByte(&sOut, pIter->op, &rc); |
| 185727 | + sessionAppendByte(&sOut, pIter->bIndirect, &rc); |
| 185728 | + sessionAppendBlob(&sOut, aRec, nRec, &rc); |
| 185729 | + } |
| 185730 | + if( rc==SQLITE_OK && xOutput && sOut.nBuf>SESSIONS_STRM_CHUNK_SIZE ){ |
| 185731 | + rc = xOutput(pOut, sOut.aBuf, sOut.nBuf); |
| 185732 | + sOut.nBuf = 0; |
| 185733 | + } |
| 185734 | + if( rc ) break; |
| 185735 | + } |
| 185736 | + |
| 185737 | + if( rc!=SQLITE_OK ){ |
| 185738 | + sqlite3_free(sOut.aBuf); |
| 185739 | + memset(&sOut, 0, sizeof(sOut)); |
| 185740 | + } |
| 185741 | + |
| 185742 | + if( rc==SQLITE_OK ){ |
| 185743 | + if( xOutput ){ |
| 185744 | + if( sOut.nBuf>0 ){ |
| 185745 | + rc = xOutput(pOut, sOut.aBuf, sOut.nBuf); |
| 185746 | + } |
| 185747 | + }else{ |
| 185748 | + *ppOut = (void*)sOut.aBuf; |
| 185749 | + *pnOut = sOut.nBuf; |
| 185750 | + sOut.aBuf = 0; |
| 185751 | + } |
| 185752 | + } |
| 185753 | + sqlite3_free(sOut.aBuf); |
| 185754 | + return rc; |
| 185755 | +} |
| 185756 | + |
| 185757 | +/* |
| 185758 | +** Create a new rebaser object. |
| 185759 | +*/ |
| 185760 | +SQLITE_API int sqlite3rebaser_create(sqlite3_rebaser **ppNew){ |
| 185761 | + int rc = SQLITE_OK; |
| 185762 | + sqlite3_rebaser *pNew; |
| 185763 | + |
| 185764 | + pNew = sqlite3_malloc(sizeof(sqlite3_rebaser)); |
| 185765 | + if( pNew==0 ){ |
| 185766 | + rc = SQLITE_NOMEM; |
| 185767 | + }else{ |
| 185768 | + memset(pNew, 0, sizeof(sqlite3_rebaser)); |
| 185769 | + } |
| 185770 | + *ppNew = pNew; |
| 185771 | + return rc; |
| 185772 | +} |
| 185773 | + |
| 185774 | +/* |
| 185775 | +** Call this one or more times to configure a rebaser. |
| 185776 | +*/ |
| 185777 | +SQLITE_API int sqlite3rebaser_configure( |
| 185778 | + sqlite3_rebaser *p, |
| 185779 | + int nRebase, const void *pRebase |
| 185780 | +){ |
| 185781 | + sqlite3_changeset_iter *pIter = 0; /* Iterator opened on pData/nData */ |
| 185782 | + int rc; /* Return code */ |
| 185783 | + rc = sqlite3changeset_start(&pIter, nRebase, (void*)pRebase); |
| 185784 | + if( rc==SQLITE_OK ){ |
| 185785 | + rc = sessionChangesetToHash(pIter, &p->grp, 1); |
| 185786 | + } |
| 185787 | + sqlite3changeset_finalize(pIter); |
| 185788 | + return rc; |
| 185789 | +} |
| 185790 | + |
| 185791 | +/* |
| 185792 | +** Rebase a changeset according to current rebaser configuration |
| 185793 | +*/ |
| 185794 | +SQLITE_API int sqlite3rebaser_rebase( |
| 185795 | + sqlite3_rebaser *p, |
| 185796 | + int nIn, const void *pIn, |
| 185797 | + int *pnOut, void **ppOut |
| 185798 | +){ |
| 185799 | + sqlite3_changeset_iter *pIter = 0; /* Iterator to skip through input */ |
| 185800 | + int rc = sqlite3changeset_start(&pIter, nIn, (void*)pIn); |
| 185801 | + |
| 185802 | + if( rc==SQLITE_OK ){ |
| 185803 | + rc = sessionRebase(p, pIter, 0, 0, pnOut, ppOut); |
| 185804 | + sqlite3changeset_finalize(pIter); |
| 185805 | + } |
| 185806 | + |
| 185807 | + return rc; |
| 185808 | +} |
| 185809 | + |
| 185810 | +/* |
| 185811 | +** Rebase a changeset according to current rebaser configuration |
| 185812 | +*/ |
| 185813 | +SQLITE_API int sqlite3rebaser_rebase_strm( |
| 185814 | + sqlite3_rebaser *p, |
| 185815 | + int (*xInput)(void *pIn, void *pData, int *pnData), |
| 185816 | + void *pIn, |
| 185817 | + int (*xOutput)(void *pOut, const void *pData, int nData), |
| 185818 | + void *pOut |
| 185819 | +){ |
| 185820 | + sqlite3_changeset_iter *pIter = 0; /* Iterator to skip through input */ |
| 185821 | + int rc = sqlite3changeset_start_strm(&pIter, xInput, pIn); |
| 185822 | + |
| 185823 | + if( rc==SQLITE_OK ){ |
| 185824 | + rc = sessionRebase(p, pIter, xOutput, pOut, 0, 0); |
| 185825 | + sqlite3changeset_finalize(pIter); |
| 185826 | + } |
| 185827 | + |
| 185828 | + return rc; |
| 185829 | +} |
| 185830 | + |
| 185831 | +/* |
| 185832 | +** Destroy a rebaser object |
| 185833 | +*/ |
| 185834 | +SQLITE_API void sqlite3rebaser_delete(sqlite3_rebaser *p){ |
| 185835 | + if( p ){ |
| 185836 | + sessionDeleteTable(p->grp.pList); |
| 185837 | + sqlite3_free(p); |
| 185838 | + } |
| 185839 | +} |
| 184883 | 185840 | |
| 184884 | 185841 | #endif /* SQLITE_ENABLE_SESSION && SQLITE_ENABLE_PREUPDATE_HOOK */ |
| 184885 | 185842 | |
| 184886 | 185843 | /************** End of sqlite3session.c **************************************/ |
| 184887 | 185844 | /************** Begin file json1.c *******************************************/ |
| | @@ -202602,10 +203559,16 @@ |
| 202602 | 203559 | |
| 202603 | 203560 | int aColMap[3]; |
| 202604 | 203561 | aColMap[0] = -1; |
| 202605 | 203562 | aColMap[1] = nCol; |
| 202606 | 203563 | aColMap[2] = nCol+1; |
| 203564 | + |
| 203565 | + assert( SQLITE_INDEX_CONSTRAINT_EQ<SQLITE_INDEX_CONSTRAINT_MATCH ); |
| 203566 | + assert( SQLITE_INDEX_CONSTRAINT_GT<SQLITE_INDEX_CONSTRAINT_MATCH ); |
| 203567 | + assert( SQLITE_INDEX_CONSTRAINT_LE<SQLITE_INDEX_CONSTRAINT_MATCH ); |
| 203568 | + assert( SQLITE_INDEX_CONSTRAINT_GE<SQLITE_INDEX_CONSTRAINT_MATCH ); |
| 203569 | + assert( SQLITE_INDEX_CONSTRAINT_LE<SQLITE_INDEX_CONSTRAINT_MATCH ); |
| 202607 | 203570 | |
| 202608 | 203571 | /* Set idxFlags flags for all WHERE clause terms that will be used. */ |
| 202609 | 203572 | for(i=0; i<pInfo->nConstraint; i++){ |
| 202610 | 203573 | struct sqlite3_index_constraint *p = &pInfo->aConstraint[i]; |
| 202611 | 203574 | int iCol = p->iColumn; |
| | @@ -202621,15 +203584,15 @@ |
| 202621 | 203584 | /* As there exists an unusable MATCH constraint this is an |
| 202622 | 203585 | ** unusable plan. Set a prohibitively high cost. */ |
| 202623 | 203586 | pInfo->estimatedCost = 1e50; |
| 202624 | 203587 | return SQLITE_OK; |
| 202625 | 203588 | } |
| 202626 | | - }else{ |
| 203589 | + }else if( p->op<=SQLITE_INDEX_CONSTRAINT_MATCH ){ |
| 202627 | 203590 | int j; |
| 202628 | 203591 | for(j=1; j<ArraySize(aConstraint); j++){ |
| 202629 | 203592 | struct Constraint *pC = &aConstraint[j]; |
| 202630 | | - if( iCol==aColMap[pC->iCol] && p->op & pC->op && p->usable ){ |
| 203593 | + if( iCol==aColMap[pC->iCol] && (p->op & pC->op) && p->usable ){ |
| 202631 | 203594 | pC->iConsIndex = i; |
| 202632 | 203595 | idxFlags |= pC->fts5op; |
| 202633 | 203596 | } |
| 202634 | 203597 | } |
| 202635 | 203598 | } |
| | @@ -204697,11 +205660,11 @@ |
| 204697 | 205660 | int nArg, /* Number of args */ |
| 204698 | 205661 | sqlite3_value **apUnused /* Function arguments */ |
| 204699 | 205662 | ){ |
| 204700 | 205663 | assert( nArg==0 ); |
| 204701 | 205664 | UNUSED_PARAM2(nArg, apUnused); |
| 204702 | | - sqlite3_result_text(pCtx, "fts5: 2018-03-22 17:13:44 eb4f452e354065d610ff57a6a9312ad119b6b0cc467f9dff105f0718bc27ef01", -1, SQLITE_TRANSIENT); |
| 205665 | + sqlite3_result_text(pCtx, "fts5: 2018-04-10 17:39:29 4bb2294022060e61de7da5c227a69ccd846ba330e31626ebcd59a94efd148b3b", -1, SQLITE_TRANSIENT); |
| 204703 | 205666 | } |
| 204704 | 205667 | |
| 204705 | 205668 | static int fts5Init(sqlite3 *db){ |
| 204706 | 205669 | static const sqlite3_module fts5Mod = { |
| 204707 | 205670 | /* iVersion */ 2, |
| | @@ -208967,12 +209930,12 @@ |
| 208967 | 209930 | } |
| 208968 | 209931 | #endif /* SQLITE_CORE */ |
| 208969 | 209932 | #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_STMTVTAB) */ |
| 208970 | 209933 | |
| 208971 | 209934 | /************** End of stmt.c ************************************************/ |
| 208972 | | -#if __LINE__!=208972 |
| 209935 | +#if __LINE__!=209935 |
| 208973 | 209936 | #undef SQLITE_SOURCE_ID |
| 208974 | | -#define SQLITE_SOURCE_ID "2018-03-22 17:13:44 eb4f452e354065d610ff57a6a9312ad119b6b0cc467f9dff105f0718bc27alt2" |
| 209937 | +#define SQLITE_SOURCE_ID "2018-04-10 17:39:29 4bb2294022060e61de7da5c227a69ccd846ba330e31626ebcd59a94efd14alt2" |
| 208975 | 209938 | #endif |
| 208976 | 209939 | /* Return the source-id for this library */ |
| 208977 | 209940 | SQLITE_API const char *sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; } |
| 208978 | 209941 | /************************** End of sqlite3.c ******************************/ |
| 208979 | 209942 | |