Fossil SCM

Update to the latest version of SQLite (3.6.20rc1) and fix some compiler warnings.

drh 2009-11-01 19:25 UTC trunk
Commit dffe11c29c10e82a8e293e2945b6eb6bd0decf9d
3 files changed +1201 -983 +27 -18 +2 -2
+1201 -983
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -1,8 +1,8 @@
11
/******************************************************************************
22
** This file is an amalgamation of many separate C source files from SQLite
3
-** version 3.6.19. By combining all the individual C code files into this
3
+** version 3.6.20. By combining all the individual C code files into this
44
** single large file, the entire code can be compiled as a one translation
55
** unit. This allows many compilers to do optimizations that would not be
66
** possible if the files were compiled separately. Performance improvements
77
** of 5% are more are commonly seen when SQLite is compiled as a single
88
** translation unit.
@@ -15,11 +15,11 @@
1515
** of the embedded sqlite3.h header file.) Additional code files may be needed
1616
** if you want a wrapper to interface SQLite with your choice of programming
1717
** language. The code for the "sqlite3" command-line shell is also in a
1818
** separate file. This file contains only code for the core SQLite library.
1919
**
20
-** This amalgamation was generated on 2009-10-14 11:34:12 UTC.
20
+** This amalgamation was generated on 2009-11-01 19:22:03 UTC.
2121
*/
2222
#define SQLITE_CORE 1
2323
#define SQLITE_AMALGAMATION 1
2424
#ifndef SQLITE_PRIVATE
2525
# define SQLITE_PRIVATE static
@@ -649,13 +649,13 @@
649649
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
650650
** [sqlite_version()] and [sqlite_source_id()].
651651
**
652652
** Requirements: [H10011] [H10014]
653653
*/
654
-#define SQLITE_VERSION "3.6.19"
655
-#define SQLITE_VERSION_NUMBER 3006019
656
-#define SQLITE_SOURCE_ID "2009-10-14 11:33:55 c1d499afc50d54b376945b4efb65c56c787a073d"
654
+#define SQLITE_VERSION "3.6.20"
655
+#define SQLITE_VERSION_NUMBER 3006020
656
+#define SQLITE_SOURCE_ID "2009-10-30 14:27:15 612952743da28e651512547fc0d3925f4c698eb4"
657657
658658
/*
659659
** CAPI3REF: Run-Time Library Version Numbers {H10020} <S60100>
660660
** KEYWORDS: sqlite3_version
661661
**
@@ -775,23 +775,13 @@
775775
/*
776776
** CAPI3REF: Closing A Database Connection {H12010} <S30100><S40200>
777777
**
778778
** This routine is the destructor for the [sqlite3] object.
779779
**
780
-** Applications should [sqlite3_finalize | finalize] all [prepared statements]
780
+** Applications must [sqlite3_finalize | finalize] all [prepared statements]
781781
** and [sqlite3_blob_close | close] all [BLOB handles] associated with
782782
** the [sqlite3] object prior to attempting to close the object.
783
-** The [sqlite3_next_stmt()] interface can be used to locate all
784
-** [prepared statements] associated with a [database connection] if desired.
785
-** Typical code might look like this:
786
-**
787
-** <blockquote><pre>
788
-** sqlite3_stmt *pStmt;
789
-** while( (pStmt = sqlite3_next_stmt(db, 0))!=0 ){
790
-** &nbsp; sqlite3_finalize(pStmt);
791
-** }
792
-** </pre></blockquote>
793783
**
794784
** If [sqlite3_close()] is invoked while a transaction is open,
795785
** the transaction is automatically rolled back.
796786
**
797787
** The C parameter to [sqlite3_close(C)] must be either a NULL
@@ -1365,10 +1355,13 @@
13651355
** CAPI3REF: Initialize The SQLite Library {H10130} <S20000><S30100>
13661356
**
13671357
** The sqlite3_initialize() routine initializes the
13681358
** SQLite library. The sqlite3_shutdown() routine
13691359
** deallocates any resources that were allocated by sqlite3_initialize().
1360
+** This routines are designed to aid in process initialization and
1361
+** shutdown on embedded systems. Workstation applications using
1362
+** SQLite normally do not need to invoke either of these routines.
13701363
**
13711364
** A call to sqlite3_initialize() is an "effective" call if it is
13721365
** the first time sqlite3_initialize() is invoked during the lifetime of
13731366
** the process, or if it is the first time sqlite3_initialize() is invoked
13741367
** following a call to sqlite3_shutdown(). Only an effective call
@@ -1376,15 +1369,21 @@
13761369
** are harmless no-ops.
13771370
**
13781371
** A call to sqlite3_shutdown() is an "effective" call if it is the first
13791372
** call to sqlite3_shutdown() since the last sqlite3_initialize(). Only
13801373
** an effective call to sqlite3_shutdown() does any deinitialization.
1381
-** All other calls to sqlite3_shutdown() are harmless no-ops.
1374
+** All other valid calls to sqlite3_shutdown() are harmless no-ops.
13821375
**
1383
-** Among other things, sqlite3_initialize() shall invoke
1376
+** The sqlite3_initialize() interface is threadsafe, but sqlite3_shutdown()
1377
+** is not. The sqlite3_shutdown() interface must only be called from a
1378
+** single thread. All open [database connections] must be closed and all
1379
+** other SQLite resources must be deallocated prior to invoking
1380
+** sqlite3_shutdown().
1381
+**
1382
+** Among other things, sqlite3_initialize() will invoke
13841383
** sqlite3_os_init(). Similarly, sqlite3_shutdown()
1385
-** shall invoke sqlite3_os_end().
1384
+** will invoke sqlite3_os_end().
13861385
**
13871386
** The sqlite3_initialize() routine returns [SQLITE_OK] on success.
13881387
** If for some reason, sqlite3_initialize() is unable to initialize
13891388
** the library (perhaps it is unable to allocate a needed resource such
13901389
** as a mutex) it returns an [error code] other than [SQLITE_OK].
@@ -2926,11 +2925,11 @@
29262925
** recommended for all new programs. The two older interfaces are retained
29272926
** for backwards compatibility, but their use is discouraged.
29282927
** In the "v2" interfaces, the prepared statement
29292928
** that is returned (the [sqlite3_stmt] object) contains a copy of the
29302929
** original SQL text. This causes the [sqlite3_step()] interface to
2931
-** behave a differently in two ways:
2930
+** behave a differently in three ways:
29322931
**
29332932
** <ol>
29342933
** <li>
29352934
** If the database schema changes, instead of returning [SQLITE_SCHEMA] as it
29362935
** always used to do, [sqlite3_step()] will automatically recompile the SQL
@@ -2948,10 +2947,18 @@
29482947
** [sqlite3_step()] would only return a generic [SQLITE_ERROR] result code
29492948
** and you would have to make a second call to [sqlite3_reset()] in order
29502949
** to find the underlying cause of the problem. With the "v2" prepare
29512950
** interfaces, the underlying reason for the error is returned immediately.
29522951
** </li>
2952
+**
2953
+** <li>
2954
+** ^If the value of a [parameter | host parameter] in the WHERE clause might
2955
+** change the query plan for a statement, then the statement may be
2956
+** automatically recompiled (as if there had been a schema change) on the first
2957
+** [sqlite3_step()] call following any change to the
2958
+** [sqlite3_bind_text | bindings] of the [parameter].
2959
+** </li>
29532960
** </ol>
29542961
**
29552962
** Requirements:
29562963
** [H13011] [H13012] [H13013] [H13014] [H13015] [H13016] [H13019] [H13021]
29572964
**
@@ -3480,10 +3487,12 @@
34803487
** result row of a query. In every case the first argument is a pointer
34813488
** to the [prepared statement] that is being evaluated (the [sqlite3_stmt*]
34823489
** that was returned from [sqlite3_prepare_v2()] or one of its variants)
34833490
** and the second argument is the index of the column for which information
34843491
** should be returned. The leftmost column of the result set has the index 0.
3492
+** The number of columns in the result can be determined using
3493
+** [sqlite3_column_count()].
34853494
**
34863495
** If the SQL statement does not currently point to a valid row, or if the
34873496
** column index is out of range, the result is undefined.
34883497
** These routines may only be called when the most recent call to
34893498
** [sqlite3_step()] has returned [SQLITE_ROW] and neither
@@ -7311,151 +7320,151 @@
73117320
*/
73127321
/************** Include opcodes.h in the middle of vdbe.h ********************/
73137322
/************** Begin file opcodes.h *****************************************/
73147323
/* Automatically generated. Do not edit */
73157324
/* See the mkopcodeh.awk script for details */
7316
-#define OP_VNext 1
7317
-#define OP_Affinity 2
7318
-#define OP_Column 3
7319
-#define OP_SetCookie 4
7320
-#define OP_Seek 5
7321
-#define OP_Real 130 /* same as TK_FLOAT */
7322
-#define OP_Sequence 6
7323
-#define OP_Savepoint 7
7324
-#define OP_Ge 80 /* same as TK_GE */
7325
-#define OP_RowKey 8
7326
-#define OP_SCopy 9
7327
-#define OP_Eq 76 /* same as TK_EQ */
7328
-#define OP_OpenWrite 10
7329
-#define OP_NotNull 74 /* same as TK_NOTNULL */
7330
-#define OP_If 11
7325
+#define OP_ReadCookie 1
7326
+#define OP_AutoCommit 2
7327
+#define OP_Found 3
7328
+#define OP_NullRow 4
7329
+#define OP_Lt 79 /* same as TK_LT */
7330
+#define OP_RowSetTest 5
7331
+#define OP_Variable 6
7332
+#define OP_RealAffinity 7
7333
+#define OP_Sort 8
7334
+#define OP_Affinity 9
7335
+#define OP_IfNot 10
7336
+#define OP_Gosub 11
7337
+#define OP_Add 86 /* same as TK_PLUS */
7338
+#define OP_NotFound 12
7339
+#define OP_ResultRow 13
7340
+#define OP_IsNull 73 /* same as TK_ISNULL */
7341
+#define OP_SeekLe 14
7342
+#define OP_Rowid 15
7343
+#define OP_CreateIndex 16
7344
+#define OP_Explain 17
7345
+#define OP_DropIndex 18
7346
+#define OP_Null 20
7347
+#define OP_Program 21
73317348
#define OP_ToInt 144 /* same as TK_TO_INT */
7332
-#define OP_String8 94 /* same as TK_STRING */
7333
-#define OP_CollSeq 12
7334
-#define OP_OpenRead 13
7335
-#define OP_Expire 14
7336
-#define OP_AutoCommit 15
7337
-#define OP_Gt 77 /* same as TK_GT */
7338
-#define OP_Pagecount 16
7339
-#define OP_IntegrityCk 17
7340
-#define OP_Sort 18
7341
-#define OP_Copy 20
7342
-#define OP_Trace 21
7343
-#define OP_Function 22
7344
-#define OP_IfNeg 23
7345
-#define OP_And 69 /* same as TK_AND */
7346
-#define OP_Subtract 87 /* same as TK_MINUS */
7347
-#define OP_Noop 24
7348
-#define OP_Program 25
7349
-#define OP_Return 26
7350
-#define OP_Remainder 90 /* same as TK_REM */
7351
-#define OP_NewRowid 27
7349
+#define OP_Int64 22
7350
+#define OP_LoadAnalysis 23
7351
+#define OP_IdxInsert 24
7352
+#define OP_VUpdate 25
7353
+#define OP_Next 26
7354
+#define OP_ToNumeric 143 /* same as TK_TO_NUMERIC*/
7355
+#define OP_Ge 80 /* same as TK_GE */
7356
+#define OP_BitNot 93 /* same as TK_BITNOT */
7357
+#define OP_SeekLt 27
7358
+#define OP_Rewind 28
73527359
#define OP_Multiply 88 /* same as TK_STAR */
7353
-#define OP_FkCounter 28
7354
-#define OP_Variable 29
7355
-#define OP_String 30
7356
-#define OP_RealAffinity 31
7357
-#define OP_VRename 32
7358
-#define OP_ParseSchema 33
7359
-#define OP_VOpen 34
7360
-#define OP_Close 35
7361
-#define OP_CreateIndex 36
7362
-#define OP_IsUnique 37
7363
-#define OP_NotFound 38
7364
-#define OP_Int64 39
7365
-#define OP_MustBeInt 40
7366
-#define OP_Halt 41
7367
-#define OP_Rowid 42
7368
-#define OP_IdxLT 43
7369
-#define OP_AddImm 44
7370
-#define OP_RowData 45
7371
-#define OP_MemMax 46
7372
-#define OP_Or 68 /* same as TK_OR */
7373
-#define OP_NotExists 47
7374
-#define OP_Gosub 48
7375
-#define OP_Divide 89 /* same as TK_SLASH */
7376
-#define OP_Integer 49
7377
-#define OP_ToNumeric 143 /* same as TK_TO_NUMERIC*/
7378
-#define OP_Prev 50
7379
-#define OP_RowSetRead 51
7380
-#define OP_Concat 91 /* same as TK_CONCAT */
7381
-#define OP_RowSetAdd 52
7360
+#define OP_ToReal 145 /* same as TK_TO_REAL */
7361
+#define OP_Gt 77 /* same as TK_GT */
7362
+#define OP_RowSetRead 29
7363
+#define OP_Last 30
7364
+#define OP_MustBeInt 31
7365
+#define OP_Ne 75 /* same as TK_NE */
7366
+#define OP_IncrVacuum 32
7367
+#define OP_String 33
7368
+#define OP_VFilter 34
7369
+#define OP_Count 35
7370
+#define OP_Close 36
7371
+#define OP_AggFinal 37
7372
+#define OP_RowData 38
7373
+#define OP_IdxRowid 39
7374
+#define OP_Param 40
7375
+#define OP_Pagecount 41
7376
+#define OP_BitOr 83 /* same as TK_BITOR */
7377
+#define OP_NotNull 74 /* same as TK_NOTNULL */
7378
+#define OP_SeekGe 42
7379
+#define OP_Not 19 /* same as TK_NOT */
7380
+#define OP_OpenPseudo 43
7381
+#define OP_Halt 44
7382
+#define OP_Compare 45
7383
+#define OP_NewRowid 46
7384
+#define OP_Real 130 /* same as TK_FLOAT */
7385
+#define OP_IdxLT 47
7386
+#define OP_SeekGt 48
7387
+#define OP_MemMax 49
7388
+#define OP_Function 50
7389
+#define OP_IntegrityCk 51
7390
+#define OP_Remainder 90 /* same as TK_REM */
7391
+#define OP_FkCounter 52
7392
+#define OP_SCopy 53
7393
+#define OP_ShiftLeft 84 /* same as TK_LSHIFT */
7394
+#define OP_IfNeg 54
73827395
#define OP_BitAnd 82 /* same as TK_BITAND */
7383
-#define OP_VColumn 53
7384
-#define OP_CreateTable 54
7385
-#define OP_Last 55
7386
-#define OP_SeekLe 56
7387
-#define OP_IsNull 73 /* same as TK_ISNULL */
7388
-#define OP_IncrVacuum 57
7389
-#define OP_IdxRowid 58
7390
-#define OP_ShiftRight 85 /* same as TK_RSHIFT */
7391
-#define OP_ResetCount 59
7392
-#define OP_Yield 60
7393
-#define OP_DropTrigger 61
7394
-#define OP_DropIndex 62
7395
-#define OP_Param 63
7396
-#define OP_IdxGE 64
7397
-#define OP_IdxDelete 65
7398
-#define OP_Vacuum 66
7399
-#define OP_IfNot 67
7400
-#define OP_DropTable 70
7401
-#define OP_SeekLt 71
7402
-#define OP_MakeRecord 72
7396
+#define OP_Or 68 /* same as TK_OR */
7397
+#define OP_NotExists 55
7398
+#define OP_VDestroy 56
7399
+#define OP_IdxDelete 57
7400
+#define OP_Vacuum 58
7401
+#define OP_Copy 59
7402
+#define OP_If 60
7403
+#define OP_Jump 61
7404
+#define OP_Destroy 62
7405
+#define OP_AggStep 63
7406
+#define OP_Clear 64
7407
+#define OP_Insert 65
7408
+#define OP_Permutation 66
7409
+#define OP_VBegin 67
7410
+#define OP_OpenEphemeral 70
7411
+#define OP_IdxGE 71
7412
+#define OP_Trace 72
7413
+#define OP_Divide 89 /* same as TK_SLASH */
7414
+#define OP_String8 94 /* same as TK_STRING */
7415
+#define OP_Concat 91 /* same as TK_CONCAT */
7416
+#define OP_MakeRecord 81
7417
+#define OP_Yield 92
7418
+#define OP_SetCookie 95
7419
+#define OP_Prev 96
7420
+#define OP_DropTrigger 97
7421
+#define OP_FkIfZero 98
7422
+#define OP_And 69 /* same as TK_AND */
7423
+#define OP_VColumn 99
7424
+#define OP_Return 100
7425
+#define OP_OpenWrite 101
7426
+#define OP_Integer 102
7427
+#define OP_Transaction 103
7428
+#define OP_IfPos 104
7429
+#define OP_RowSetAdd 105
7430
+#define OP_CollSeq 106
7431
+#define OP_Savepoint 107
7432
+#define OP_VRename 108
74037433
#define OP_ToBlob 142 /* same as TK_TO_BLOB */
7404
-#define OP_ResultRow 81
7405
-#define OP_Delete 92
7406
-#define OP_AggFinal 95
7407
-#define OP_Compare 96
7408
-#define OP_ShiftLeft 84 /* same as TK_LSHIFT */
7409
-#define OP_Goto 97
7410
-#define OP_TableLock 98
7411
-#define OP_Clear 99
7412
-#define OP_Le 78 /* same as TK_LE */
7413
-#define OP_VerifyCookie 100
7414
-#define OP_AggStep 101
7434
+#define OP_Sequence 109
7435
+#define OP_ShiftRight 85 /* same as TK_RSHIFT */
7436
+#define OP_HaltIfNull 110
7437
+#define OP_VCreate 111
7438
+#define OP_CreateTable 112
7439
+#define OP_AddImm 113
74157440
#define OP_ToText 141 /* same as TK_TO_TEXT */
7416
-#define OP_Not 19 /* same as TK_NOT */
7417
-#define OP_ToReal 145 /* same as TK_TO_REAL */
7418
-#define OP_Transaction 102
7419
-#define OP_VFilter 103
7420
-#define OP_Ne 75 /* same as TK_NE */
7421
-#define OP_VDestroy 104
7422
-#define OP_BitOr 83 /* same as TK_BITOR */
7423
-#define OP_Next 105
7424
-#define OP_Count 106
7425
-#define OP_IdxInsert 107
7426
-#define OP_Lt 79 /* same as TK_LT */
7427
-#define OP_FkIfZero 108
7428
-#define OP_SeekGe 109
7429
-#define OP_Insert 110
7430
-#define OP_Destroy 111
7431
-#define OP_ReadCookie 112
7432
-#define OP_RowSetTest 113
7433
-#define OP_LoadAnalysis 114
7434
-#define OP_Explain 115
7435
-#define OP_HaltIfNull 116
7436
-#define OP_OpenPseudo 117
7437
-#define OP_OpenEphemeral 118
7438
-#define OP_Null 119
7439
-#define OP_Move 120
7440
-#define OP_Blob 121
7441
-#define OP_Add 86 /* same as TK_PLUS */
7442
-#define OP_Rewind 122
7443
-#define OP_SeekGt 123
7444
-#define OP_VBegin 124
7445
-#define OP_VUpdate 125
7446
-#define OP_IfZero 126
7447
-#define OP_BitNot 93 /* same as TK_BITNOT */
7448
-#define OP_VCreate 127
7449
-#define OP_Found 128
7450
-#define OP_IfPos 129
7451
-#define OP_NullRow 131
7452
-#define OP_Jump 132
7453
-#define OP_Permutation 133
7441
+#define OP_DropTable 114
7442
+#define OP_IsUnique 115
7443
+#define OP_VOpen 116
7444
+#define OP_IfZero 117
7445
+#define OP_Noop 118
7446
+#define OP_InsertInt 119
7447
+#define OP_RowKey 120
7448
+#define OP_Expire 121
7449
+#define OP_Delete 122
7450
+#define OP_Subtract 87 /* same as TK_MINUS */
7451
+#define OP_Blob 123
7452
+#define OP_Move 124
7453
+#define OP_Goto 125
7454
+#define OP_ParseSchema 126
7455
+#define OP_Eq 76 /* same as TK_EQ */
7456
+#define OP_VNext 127
7457
+#define OP_Seek 128
7458
+#define OP_Le 78 /* same as TK_LE */
7459
+#define OP_TableLock 129
7460
+#define OP_VerifyCookie 131
7461
+#define OP_Column 132
7462
+#define OP_OpenRead 133
7463
+#define OP_ResetCount 134
74547464
74557465
/* The following opcode values are never used */
7456
-#define OP_NotUsed_134 134
74577466
#define OP_NotUsed_135 135
74587467
#define OP_NotUsed_136 136
74597468
#define OP_NotUsed_137 137
74607469
#define OP_NotUsed_138 138
74617470
#define OP_NotUsed_139 139
@@ -7471,27 +7480,27 @@
74717480
#define OPFLG_IN1 0x0004 /* in1: P1 is an input */
74727481
#define OPFLG_IN2 0x0008 /* in2: P2 is an input */
74737482
#define OPFLG_IN3 0x0010 /* in3: P3 is an input */
74747483
#define OPFLG_OUT3 0x0020 /* out3: P3 is an output */
74757484
#define OPFLG_INITIALIZER {\
7476
-/* 0 */ 0x00, 0x01, 0x00, 0x00, 0x10, 0x08, 0x02, 0x00,\
7477
-/* 8 */ 0x00, 0x04, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00,\
7478
-/* 16 */ 0x02, 0x00, 0x01, 0x04, 0x04, 0x00, 0x00, 0x05,\
7479
-/* 24 */ 0x00, 0x01, 0x04, 0x02, 0x00, 0x00, 0x02, 0x04,\
7480
-/* 32 */ 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, 0x11, 0x02,\
7481
-/* 40 */ 0x05, 0x00, 0x02, 0x11, 0x04, 0x00, 0x08, 0x11,\
7482
-/* 48 */ 0x01, 0x02, 0x01, 0x21, 0x08, 0x00, 0x02, 0x01,\
7483
-/* 56 */ 0x11, 0x01, 0x02, 0x00, 0x04, 0x00, 0x00, 0x02,\
7484
-/* 64 */ 0x11, 0x00, 0x00, 0x05, 0x2c, 0x2c, 0x00, 0x11,\
7485
+/* 0 */ 0x00, 0x02, 0x00, 0x11, 0x00, 0x15, 0x00, 0x04,\
7486
+/* 8 */ 0x01, 0x00, 0x05, 0x01, 0x11, 0x00, 0x11, 0x02,\
7487
+/* 16 */ 0x02, 0x00, 0x00, 0x04, 0x02, 0x01, 0x02, 0x00,\
7488
+/* 24 */ 0x08, 0x00, 0x01, 0x11, 0x01, 0x21, 0x01, 0x05,\
7489
+/* 32 */ 0x01, 0x02, 0x01, 0x02, 0x00, 0x00, 0x00, 0x02,\
7490
+/* 40 */ 0x02, 0x02, 0x11, 0x00, 0x00, 0x00, 0x02, 0x11,\
7491
+/* 48 */ 0x11, 0x08, 0x00, 0x00, 0x00, 0x04, 0x05, 0x11,\
7492
+/* 56 */ 0x00, 0x00, 0x00, 0x04, 0x05, 0x01, 0x02, 0x00,\
7493
+/* 64 */ 0x00, 0x00, 0x00, 0x00, 0x2c, 0x2c, 0x00, 0x11,\
74857494
/* 72 */ 0x00, 0x05, 0x05, 0x15, 0x15, 0x15, 0x15, 0x15,\
74867495
/* 80 */ 0x15, 0x00, 0x2c, 0x2c, 0x2c, 0x2c, 0x2c, 0x2c,\
7487
-/* 88 */ 0x2c, 0x2c, 0x2c, 0x2c, 0x00, 0x04, 0x02, 0x00,\
7488
-/* 96 */ 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,\
7489
-/* 104 */ 0x00, 0x01, 0x02, 0x08, 0x01, 0x11, 0x00, 0x02,\
7490
-/* 112 */ 0x02, 0x15, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02,\
7491
-/* 120 */ 0x00, 0x02, 0x01, 0x11, 0x00, 0x00, 0x05, 0x00,\
7492
-/* 128 */ 0x11, 0x05, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00,\
7496
+/* 88 */ 0x2c, 0x2c, 0x2c, 0x2c, 0x04, 0x04, 0x02, 0x10,\
7497
+/* 96 */ 0x01, 0x00, 0x01, 0x00, 0x04, 0x00, 0x02, 0x00,\
7498
+/* 104 */ 0x05, 0x08, 0x00, 0x00, 0x00, 0x02, 0x10, 0x00,\
7499
+/* 112 */ 0x02, 0x04, 0x00, 0x11, 0x00, 0x05, 0x00, 0x00,\
7500
+/* 120 */ 0x00, 0x00, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01,\
7501
+/* 128 */ 0x08, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00,\
74937502
/* 136 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x04, 0x04,\
74947503
/* 144 */ 0x04, 0x04,}
74957504
74967505
/************** End of opcodes.h *********************************************/
74977506
/************** Continuing where we left off in vdbe.h ***********************/
@@ -7534,14 +7543,13 @@
75347543
SQLITE_PRIVATE sqlite3 *sqlite3VdbeDb(Vdbe*);
75357544
SQLITE_PRIVATE void sqlite3VdbeSetSql(Vdbe*, const char *z, int n, int);
75367545
SQLITE_PRIVATE void sqlite3VdbeSwap(Vdbe*,Vdbe*);
75377546
SQLITE_PRIVATE VdbeOp *sqlite3VdbeTakeOpArray(Vdbe*, int*, int*);
75387547
SQLITE_PRIVATE void sqlite3VdbeProgramDelete(sqlite3 *, SubProgram *, int);
7548
+SQLITE_PRIVATE sqlite3_value *sqlite3VdbeGetValue(Vdbe*, int, u8);
7549
+SQLITE_PRIVATE void sqlite3VdbeSetVarmask(Vdbe*, int);
75397550
7540
-#ifdef SQLITE_ENABLE_MEMORY_MANAGEMENT
7541
-SQLITE_PRIVATE int sqlite3VdbeReleaseMemory(int);
7542
-#endif
75437551
SQLITE_PRIVATE UnpackedRecord *sqlite3VdbeRecordUnpack(KeyInfo*,int,const void*,char*,int);
75447552
SQLITE_PRIVATE void sqlite3VdbeDeleteUnpackedRecord(UnpackedRecord*);
75457553
SQLITE_PRIVATE int sqlite3VdbeRecordCompare(int,const void*,UnpackedRecord*);
75467554
75477555
@@ -9201,11 +9209,12 @@
92019209
*********************************************************************/
92029210
92039211
int iTable; /* TK_COLUMN: cursor number of table holding column
92049212
** TK_REGISTER: register number
92059213
** TK_TRIGGER: 1 -> new, 0 -> old */
9206
- i16 iColumn; /* TK_COLUMN: column index. -1 for rowid */
9214
+ i16 iColumn; /* TK_COLUMN: column index. -1 for rowid.
9215
+ ** TK_VARIABLE: variable number (always >= 1). */
92079216
i16 iAgg; /* Which entry in pAggInfo->aCol[] or ->aFunc[] */
92089217
i16 iRightJoinTable; /* If EP_FromJoin, the right table of the join */
92099218
u8 flags2; /* Second set of flags. EP2_... */
92109219
u8 op2; /* If a TK_REGISTER, the original value of Expr.op */
92119220
AggInfo *pAggInfo; /* Used by TK_AGG_COLUMN and TK_AGG_FUNCTION */
@@ -9743,10 +9752,11 @@
97439752
97449753
int nVar; /* Number of '?' variables seen in the SQL so far */
97459754
int nVarExpr; /* Number of used slots in apVarExpr[] */
97469755
int nVarExprAlloc; /* Number of allocated slots in apVarExpr[] */
97479756
Expr **apVarExpr; /* Pointers to :aaa and $aaaa wildcard expressions */
9757
+ Vdbe *pReprepare; /* VM being reprepared (sqlite3Reprepare()) */
97489758
int nAlias; /* Number of aliased result set columns */
97499759
int nAliasAlloc; /* Number of allocated slots for aAlias[] */
97509760
int *aAlias; /* Register used to hold aliased result */
97519761
u8 explain; /* True if the EXPLAIN flag is found on the query */
97529762
Token sNameToken; /* Token with unqualified schema object name */
@@ -10252,11 +10262,10 @@
1025210262
SQLITE_PRIVATE char *sqlite3NameFromToken(sqlite3*, Token*);
1025310263
SQLITE_PRIVATE int sqlite3ExprCompare(Expr*, Expr*);
1025410264
SQLITE_PRIVATE void sqlite3ExprAnalyzeAggregates(NameContext*, Expr*);
1025510265
SQLITE_PRIVATE void sqlite3ExprAnalyzeAggList(NameContext*,ExprList*);
1025610266
SQLITE_PRIVATE Vdbe *sqlite3GetVdbe(Parse*);
10257
-SQLITE_PRIVATE Expr *sqlite3CreateIdExpr(Parse *, const char*);
1025810267
SQLITE_PRIVATE void sqlite3PrngSaveState(void);
1025910268
SQLITE_PRIVATE void sqlite3PrngRestoreState(void);
1026010269
SQLITE_PRIVATE void sqlite3PrngResetState(void);
1026110270
SQLITE_PRIVATE void sqlite3RollbackAll(sqlite3*);
1026210271
SQLITE_PRIVATE void sqlite3CodeVerifySchema(Parse*, int);
@@ -10451,11 +10460,11 @@
1045110460
SQLITE_PRIVATE void sqlite3AlterFunctions(sqlite3*);
1045210461
SQLITE_PRIVATE void sqlite3AlterRenameTable(Parse*, SrcList*, Token*);
1045310462
SQLITE_PRIVATE int sqlite3GetToken(const unsigned char *, int *);
1045410463
SQLITE_PRIVATE void sqlite3NestedParse(Parse*, const char*, ...);
1045510464
SQLITE_PRIVATE void sqlite3ExpirePreparedStatements(sqlite3*);
10456
-SQLITE_PRIVATE void sqlite3CodeSubselect(Parse *, Expr *, int, int);
10465
+SQLITE_PRIVATE int sqlite3CodeSubselect(Parse *, Expr *, int, int);
1045710466
SQLITE_PRIVATE void sqlite3SelectPrep(Parse*, Select*, NameContext*);
1045810467
SQLITE_PRIVATE int sqlite3ResolveExprNames(NameContext*, Expr*);
1045910468
SQLITE_PRIVATE void sqlite3ResolveSelectNames(Parse*, Select*, NameContext*);
1046010469
SQLITE_PRIVATE int sqlite3ResolveOrderGroupBy(Parse*, Select*, ExprList*, const char*);
1046110470
SQLITE_PRIVATE void sqlite3ColumnDefault(Vdbe *, Table *, int, int);
@@ -10486,10 +10495,11 @@
1048610495
SQLITE_PRIVATE void sqlite3StrAccumInit(StrAccum*, char*, int, int);
1048710496
SQLITE_PRIVATE void sqlite3StrAccumAppend(StrAccum*,const char*,int);
1048810497
SQLITE_PRIVATE char *sqlite3StrAccumFinish(StrAccum*);
1048910498
SQLITE_PRIVATE void sqlite3StrAccumReset(StrAccum*);
1049010499
SQLITE_PRIVATE void sqlite3SelectDestInit(SelectDest*,int,int);
10500
+SQLITE_PRIVATE Expr *sqlite3CreateColumnExpr(sqlite3 *, SrcList *, int, int);
1049110501
1049210502
SQLITE_PRIVATE void sqlite3BackupRestart(sqlite3_backup *);
1049310503
SQLITE_PRIVATE void sqlite3BackupUpdate(sqlite3_backup *, Pgno, const u8 *);
1049410504
1049510505
/*
@@ -15704,13 +15714,10 @@
1570415714
** cache database pages that are not currently in use.
1570515715
*/
1570615716
SQLITE_API int sqlite3_release_memory(int n){
1570715717
#ifdef SQLITE_ENABLE_MEMORY_MANAGEMENT
1570815718
int nRet = 0;
15709
-#if 0
15710
- nRet += sqlite3VdbeReleaseMemory(n);
15711
-#endif
1571215719
nRet += sqlite3PcacheReleaseMemory(n-nRet);
1571315720
return nRet;
1571415721
#else
1571515722
UNUSED_PARAMETER(n);
1571615723
return SQLITE_OK;
@@ -17828,10 +17835,11 @@
1782817835
#ifdef SQLITE_DEBUG
1782917836
FILE *trace; /* Write an execution trace here, if not NULL */
1783017837
#endif
1783117838
VdbeFrame *pFrame; /* Parent frame */
1783217839
int nFrame; /* Number of frames in pFrame list */
17840
+ u32 expmask; /* Binding to these vars invalidates VM */
1783317841
};
1783417842
1783517843
/*
1783617844
** The following are allowed values for Vdbe.magic
1783717845
*/
@@ -17890,13 +17898,11 @@
1789017898
SQLITE_PRIVATE int sqlite3VdbeOpcodeHasProperty(int, int);
1789117899
SQLITE_PRIVATE int sqlite3VdbeMemGrow(Mem *pMem, int n, int preserve);
1789217900
SQLITE_PRIVATE int sqlite3VdbeCloseStatement(Vdbe *, int);
1789317901
SQLITE_PRIVATE void sqlite3VdbeFrameDelete(VdbeFrame*);
1789417902
SQLITE_PRIVATE int sqlite3VdbeFrameRestore(VdbeFrame *);
17895
-#ifdef SQLITE_ENABLE_MEMORY_MANAGEMENT
17896
-SQLITE_PRIVATE int sqlite3VdbeReleaseBuffers(Vdbe *p);
17897
-#endif
17903
+SQLITE_PRIVATE void sqlite3VdbeMemStoreType(Mem *pMem);
1789817904
1789917905
#ifndef SQLITE_OMIT_FOREIGN_KEY
1790017906
SQLITE_PRIVATE int sqlite3VdbeCheckFk(Vdbe *, int);
1790117907
#else
1790217908
# define sqlite3VdbeCheckFk(p,i) 0
@@ -17992,24 +17998,24 @@
1799217998
*zOut++ = (u8)(0x00DC + ((c>>8)&0x03)); \
1799317999
*zOut++ = (u8)(c&0x00FF); \
1799418000
} \
1799518001
}
1799618002
17997
-#define READ_UTF16LE(zIn, c){ \
18003
+#define READ_UTF16LE(zIn, TERM, c){ \
1799818004
c = (*zIn++); \
1799918005
c += ((*zIn++)<<8); \
18000
- if( c>=0xD800 && c<0xE000 ){ \
18006
+ if( c>=0xD800 && c<0xE000 && TERM ){ \
1800118007
int c2 = (*zIn++); \
1800218008
c2 += ((*zIn++)<<8); \
1800318009
c = (c2&0x03FF) + ((c&0x003F)<<10) + (((c&0x03C0)+0x0040)<<10); \
1800418010
} \
1800518011
}
1800618012
18007
-#define READ_UTF16BE(zIn, c){ \
18013
+#define READ_UTF16BE(zIn, TERM, c){ \
1800818014
c = ((*zIn++)<<8); \
1800918015
c += (*zIn++); \
18010
- if( c>=0xD800 && c<0xE000 ){ \
18016
+ if( c>=0xD800 && c<0xE000 && TERM ){ \
1801118017
int c2 = ((*zIn++)<<8); \
1801218018
c2 += (*zIn++); \
1801318019
c = (c2&0x03FF) + ((c&0x003F)<<10) + (((c&0x03C0)+0x0040)<<10); \
1801418020
} \
1801518021
}
@@ -18190,17 +18196,17 @@
1819018196
}else{
1819118197
assert( desiredEnc==SQLITE_UTF8 );
1819218198
if( pMem->enc==SQLITE_UTF16LE ){
1819318199
/* UTF-16 Little-endian -> UTF-8 */
1819418200
while( zIn<zTerm ){
18195
- READ_UTF16LE(zIn, c);
18201
+ READ_UTF16LE(zIn, zIn<zTerm, c);
1819618202
WRITE_UTF8(z, c);
1819718203
}
1819818204
}else{
1819918205
/* UTF-16 Big-endian -> UTF-8 */
1820018206
while( zIn<zTerm ){
18201
- READ_UTF16BE(zIn, c);
18207
+ READ_UTF16BE(zIn, zIn<zTerm, c);
1820218208
WRITE_UTF8(z, c);
1820318209
}
1820418210
}
1820518211
pMem->n = (int)(z - zOut);
1820618212
}
@@ -18366,35 +18372,27 @@
1836618372
return m.z;
1836718373
}
1836818374
#endif
1836918375
1837018376
/*
18371
-** pZ is a UTF-16 encoded unicode string at least nChar characters long.
18377
+** zIn is a UTF-16 encoded unicode string at least nChar characters long.
1837218378
** Return the number of bytes in the first nChar unicode characters
1837318379
** in pZ. nChar must be non-negative.
1837418380
*/
1837518381
SQLITE_PRIVATE int sqlite3Utf16ByteLen(const void *zIn, int nChar){
1837618382
int c;
1837718383
unsigned char const *z = zIn;
1837818384
int n = 0;
18385
+
1837918386
if( SQLITE_UTF16NATIVE==SQLITE_UTF16BE ){
18380
- /* Using an "if (SQLITE_UTF16NATIVE==SQLITE_UTF16BE)" construct here
18381
- ** and in other parts of this file means that at one branch will
18382
- ** not be covered by coverage testing on any single host. But coverage
18383
- ** will be complete if the tests are run on both a little-endian and
18384
- ** big-endian host. Because both the UTF16NATIVE and SQLITE_UTF16BE
18385
- ** macros are constant at compile time the compiler can determine
18386
- ** which branch will be followed. It is therefore assumed that no runtime
18387
- ** penalty is paid for this "if" statement.
18388
- */
1838918387
while( n<nChar ){
18390
- READ_UTF16BE(z, c);
18388
+ READ_UTF16BE(z, 1, c);
1839118389
n++;
1839218390
}
1839318391
}else{
1839418392
while( n<nChar ){
18395
- READ_UTF16LE(z, c);
18393
+ READ_UTF16LE(z, 1, c);
1839618394
n++;
1839718395
}
1839818396
}
1839918397
return (int)(z-(unsigned char const *)zIn);
1840018398
}
@@ -18432,11 +18430,11 @@
1843218430
WRITE_UTF16LE(z, i);
1843318431
n = (int)(z-zBuf);
1843418432
assert( n>0 && n<=4 );
1843518433
z[0] = 0;
1843618434
z = zBuf;
18437
- READ_UTF16LE(z, c);
18435
+ READ_UTF16LE(z, 1, c);
1843818436
assert( c==i );
1843918437
assert( (z-zBuf)==n );
1844018438
}
1844118439
for(i=0; i<0x00110000; i++){
1844218440
if( i>=0xD800 && i<0xE000 ) continue;
@@ -18444,11 +18442,11 @@
1844418442
WRITE_UTF16BE(z, i);
1844518443
n = (int)(z-zBuf);
1844618444
assert( n>0 && n<=4 );
1844718445
z[0] = 0;
1844818446
z = zBuf;
18449
- READ_UTF16BE(z, c);
18447
+ READ_UTF16BE(z, 1, c);
1845018448
assert( c==i );
1845118449
assert( (z-zBuf)==n );
1845218450
}
1845318451
}
1845418452
#endif /* SQLITE_TEST */
@@ -19834,91 +19832,91 @@
1983419832
/* Automatically generated. Do not edit */
1983519833
/* See the mkopcodec.awk script for details. */
1983619834
#if !defined(SQLITE_OMIT_EXPLAIN) || !defined(NDEBUG) || defined(VDBE_PROFILE) || defined(SQLITE_DEBUG)
1983719835
SQLITE_PRIVATE const char *sqlite3OpcodeName(int i){
1983819836
static const char *const azName[] = { "?",
19839
- /* 1 */ "VNext",
19840
- /* 2 */ "Affinity",
19841
- /* 3 */ "Column",
19842
- /* 4 */ "SetCookie",
19843
- /* 5 */ "Seek",
19844
- /* 6 */ "Sequence",
19845
- /* 7 */ "Savepoint",
19846
- /* 8 */ "RowKey",
19847
- /* 9 */ "SCopy",
19848
- /* 10 */ "OpenWrite",
19849
- /* 11 */ "If",
19850
- /* 12 */ "CollSeq",
19851
- /* 13 */ "OpenRead",
19852
- /* 14 */ "Expire",
19853
- /* 15 */ "AutoCommit",
19854
- /* 16 */ "Pagecount",
19855
- /* 17 */ "IntegrityCk",
19856
- /* 18 */ "Sort",
19837
+ /* 1 */ "ReadCookie",
19838
+ /* 2 */ "AutoCommit",
19839
+ /* 3 */ "Found",
19840
+ /* 4 */ "NullRow",
19841
+ /* 5 */ "RowSetTest",
19842
+ /* 6 */ "Variable",
19843
+ /* 7 */ "RealAffinity",
19844
+ /* 8 */ "Sort",
19845
+ /* 9 */ "Affinity",
19846
+ /* 10 */ "IfNot",
19847
+ /* 11 */ "Gosub",
19848
+ /* 12 */ "NotFound",
19849
+ /* 13 */ "ResultRow",
19850
+ /* 14 */ "SeekLe",
19851
+ /* 15 */ "Rowid",
19852
+ /* 16 */ "CreateIndex",
19853
+ /* 17 */ "Explain",
19854
+ /* 18 */ "DropIndex",
1985719855
/* 19 */ "Not",
19858
- /* 20 */ "Copy",
19859
- /* 21 */ "Trace",
19860
- /* 22 */ "Function",
19861
- /* 23 */ "IfNeg",
19862
- /* 24 */ "Noop",
19863
- /* 25 */ "Program",
19864
- /* 26 */ "Return",
19865
- /* 27 */ "NewRowid",
19866
- /* 28 */ "FkCounter",
19867
- /* 29 */ "Variable",
19868
- /* 30 */ "String",
19869
- /* 31 */ "RealAffinity",
19870
- /* 32 */ "VRename",
19871
- /* 33 */ "ParseSchema",
19872
- /* 34 */ "VOpen",
19873
- /* 35 */ "Close",
19874
- /* 36 */ "CreateIndex",
19875
- /* 37 */ "IsUnique",
19876
- /* 38 */ "NotFound",
19877
- /* 39 */ "Int64",
19878
- /* 40 */ "MustBeInt",
19879
- /* 41 */ "Halt",
19880
- /* 42 */ "Rowid",
19881
- /* 43 */ "IdxLT",
19882
- /* 44 */ "AddImm",
19883
- /* 45 */ "RowData",
19884
- /* 46 */ "MemMax",
19885
- /* 47 */ "NotExists",
19886
- /* 48 */ "Gosub",
19887
- /* 49 */ "Integer",
19888
- /* 50 */ "Prev",
19889
- /* 51 */ "RowSetRead",
19890
- /* 52 */ "RowSetAdd",
19891
- /* 53 */ "VColumn",
19892
- /* 54 */ "CreateTable",
19893
- /* 55 */ "Last",
19894
- /* 56 */ "SeekLe",
19895
- /* 57 */ "IncrVacuum",
19896
- /* 58 */ "IdxRowid",
19897
- /* 59 */ "ResetCount",
19898
- /* 60 */ "Yield",
19899
- /* 61 */ "DropTrigger",
19900
- /* 62 */ "DropIndex",
19901
- /* 63 */ "Param",
19902
- /* 64 */ "IdxGE",
19903
- /* 65 */ "IdxDelete",
19904
- /* 66 */ "Vacuum",
19905
- /* 67 */ "IfNot",
19856
+ /* 20 */ "Null",
19857
+ /* 21 */ "Program",
19858
+ /* 22 */ "Int64",
19859
+ /* 23 */ "LoadAnalysis",
19860
+ /* 24 */ "IdxInsert",
19861
+ /* 25 */ "VUpdate",
19862
+ /* 26 */ "Next",
19863
+ /* 27 */ "SeekLt",
19864
+ /* 28 */ "Rewind",
19865
+ /* 29 */ "RowSetRead",
19866
+ /* 30 */ "Last",
19867
+ /* 31 */ "MustBeInt",
19868
+ /* 32 */ "IncrVacuum",
19869
+ /* 33 */ "String",
19870
+ /* 34 */ "VFilter",
19871
+ /* 35 */ "Count",
19872
+ /* 36 */ "Close",
19873
+ /* 37 */ "AggFinal",
19874
+ /* 38 */ "RowData",
19875
+ /* 39 */ "IdxRowid",
19876
+ /* 40 */ "Param",
19877
+ /* 41 */ "Pagecount",
19878
+ /* 42 */ "SeekGe",
19879
+ /* 43 */ "OpenPseudo",
19880
+ /* 44 */ "Halt",
19881
+ /* 45 */ "Compare",
19882
+ /* 46 */ "NewRowid",
19883
+ /* 47 */ "IdxLT",
19884
+ /* 48 */ "SeekGt",
19885
+ /* 49 */ "MemMax",
19886
+ /* 50 */ "Function",
19887
+ /* 51 */ "IntegrityCk",
19888
+ /* 52 */ "FkCounter",
19889
+ /* 53 */ "SCopy",
19890
+ /* 54 */ "IfNeg",
19891
+ /* 55 */ "NotExists",
19892
+ /* 56 */ "VDestroy",
19893
+ /* 57 */ "IdxDelete",
19894
+ /* 58 */ "Vacuum",
19895
+ /* 59 */ "Copy",
19896
+ /* 60 */ "If",
19897
+ /* 61 */ "Jump",
19898
+ /* 62 */ "Destroy",
19899
+ /* 63 */ "AggStep",
19900
+ /* 64 */ "Clear",
19901
+ /* 65 */ "Insert",
19902
+ /* 66 */ "Permutation",
19903
+ /* 67 */ "VBegin",
1990619904
/* 68 */ "Or",
1990719905
/* 69 */ "And",
19908
- /* 70 */ "DropTable",
19909
- /* 71 */ "SeekLt",
19910
- /* 72 */ "MakeRecord",
19906
+ /* 70 */ "OpenEphemeral",
19907
+ /* 71 */ "IdxGE",
19908
+ /* 72 */ "Trace",
1991119909
/* 73 */ "IsNull",
1991219910
/* 74 */ "NotNull",
1991319911
/* 75 */ "Ne",
1991419912
/* 76 */ "Eq",
1991519913
/* 77 */ "Gt",
1991619914
/* 78 */ "Le",
1991719915
/* 79 */ "Lt",
1991819916
/* 80 */ "Ge",
19919
- /* 81 */ "ResultRow",
19917
+ /* 81 */ "MakeRecord",
1992019918
/* 82 */ "BitAnd",
1992119919
/* 83 */ "BitOr",
1992219920
/* 84 */ "ShiftLeft",
1992319921
/* 85 */ "ShiftRight",
1992419922
/* 86 */ "Add",
@@ -19925,53 +19923,53 @@
1992519923
/* 87 */ "Subtract",
1992619924
/* 88 */ "Multiply",
1992719925
/* 89 */ "Divide",
1992819926
/* 90 */ "Remainder",
1992919927
/* 91 */ "Concat",
19930
- /* 92 */ "Delete",
19928
+ /* 92 */ "Yield",
1993119929
/* 93 */ "BitNot",
1993219930
/* 94 */ "String8",
19933
- /* 95 */ "AggFinal",
19934
- /* 96 */ "Compare",
19935
- /* 97 */ "Goto",
19936
- /* 98 */ "TableLock",
19937
- /* 99 */ "Clear",
19938
- /* 100 */ "VerifyCookie",
19939
- /* 101 */ "AggStep",
19940
- /* 102 */ "Transaction",
19941
- /* 103 */ "VFilter",
19942
- /* 104 */ "VDestroy",
19943
- /* 105 */ "Next",
19944
- /* 106 */ "Count",
19945
- /* 107 */ "IdxInsert",
19946
- /* 108 */ "FkIfZero",
19947
- /* 109 */ "SeekGe",
19948
- /* 110 */ "Insert",
19949
- /* 111 */ "Destroy",
19950
- /* 112 */ "ReadCookie",
19951
- /* 113 */ "RowSetTest",
19952
- /* 114 */ "LoadAnalysis",
19953
- /* 115 */ "Explain",
19954
- /* 116 */ "HaltIfNull",
19955
- /* 117 */ "OpenPseudo",
19956
- /* 118 */ "OpenEphemeral",
19957
- /* 119 */ "Null",
19958
- /* 120 */ "Move",
19959
- /* 121 */ "Blob",
19960
- /* 122 */ "Rewind",
19961
- /* 123 */ "SeekGt",
19962
- /* 124 */ "VBegin",
19963
- /* 125 */ "VUpdate",
19964
- /* 126 */ "IfZero",
19965
- /* 127 */ "VCreate",
19966
- /* 128 */ "Found",
19967
- /* 129 */ "IfPos",
19931
+ /* 95 */ "SetCookie",
19932
+ /* 96 */ "Prev",
19933
+ /* 97 */ "DropTrigger",
19934
+ /* 98 */ "FkIfZero",
19935
+ /* 99 */ "VColumn",
19936
+ /* 100 */ "Return",
19937
+ /* 101 */ "OpenWrite",
19938
+ /* 102 */ "Integer",
19939
+ /* 103 */ "Transaction",
19940
+ /* 104 */ "IfPos",
19941
+ /* 105 */ "RowSetAdd",
19942
+ /* 106 */ "CollSeq",
19943
+ /* 107 */ "Savepoint",
19944
+ /* 108 */ "VRename",
19945
+ /* 109 */ "Sequence",
19946
+ /* 110 */ "HaltIfNull",
19947
+ /* 111 */ "VCreate",
19948
+ /* 112 */ "CreateTable",
19949
+ /* 113 */ "AddImm",
19950
+ /* 114 */ "DropTable",
19951
+ /* 115 */ "IsUnique",
19952
+ /* 116 */ "VOpen",
19953
+ /* 117 */ "IfZero",
19954
+ /* 118 */ "Noop",
19955
+ /* 119 */ "InsertInt",
19956
+ /* 120 */ "RowKey",
19957
+ /* 121 */ "Expire",
19958
+ /* 122 */ "Delete",
19959
+ /* 123 */ "Blob",
19960
+ /* 124 */ "Move",
19961
+ /* 125 */ "Goto",
19962
+ /* 126 */ "ParseSchema",
19963
+ /* 127 */ "VNext",
19964
+ /* 128 */ "Seek",
19965
+ /* 129 */ "TableLock",
1996819966
/* 130 */ "Real",
19969
- /* 131 */ "NullRow",
19970
- /* 132 */ "Jump",
19971
- /* 133 */ "Permutation",
19972
- /* 134 */ "NotUsed_134",
19967
+ /* 131 */ "VerifyCookie",
19968
+ /* 132 */ "Column",
19969
+ /* 133 */ "OpenRead",
19970
+ /* 134 */ "ResetCount",
1997319971
/* 135 */ "NotUsed_135",
1997419972
/* 136 */ "NotUsed_136",
1997519973
/* 137 */ "NotUsed_137",
1997619974
/* 138 */ "NotUsed_138",
1997719975
/* 139 */ "NotUsed_139",
@@ -24102,11 +24100,12 @@
2410224100
2410324101
/* If control gets to this point, then actually go ahead and make
2410424102
** operating system calls for the specified lock.
2410524103
*/
2410624104
if( locktype==SHARED_LOCK ){
24107
- int lk, lrc1, lrc2, lrc1Errno;
24105
+ int lk, lrc1, lrc2;
24106
+ int lrc1Errno = 0;
2410824107
2410924108
/* Now get the read-lock SHARED_LOCK */
2411024109
/* note that the quality of the randomness doesn't matter that much */
2411124110
lk = random();
2411224111
context->sharedByte = (lk & 0x7fffffff)%(SHARED_SIZE - 1);
@@ -27247,11 +27246,11 @@
2724727246
** Determine if we are dealing with WindowsCE - which has a much
2724827247
** reduced API.
2724927248
*/
2725027249
#if SQLITE_OS_WINCE
2725127250
# define AreFileApisANSI() 1
27252
-# define GetDiskFreeSpaceW() 0
27251
+# define FormatMessageW(a,b,c,d,e,f,g) 0
2725327252
#endif
2725427253
2725527254
/*
2725627255
** WinCE lacks native support for file locking so we have to fake it
2725727256
** with some code of our own.
@@ -28421,31 +28420,63 @@
2842128420
** The return value of getLastErrorMsg
2842228421
** is zero if the error message fits in the buffer, or non-zero
2842328422
** otherwise (if the message was truncated).
2842428423
*/
2842528424
static int getLastErrorMsg(int nBuf, char *zBuf){
28426
- DWORD error = GetLastError();
28427
-
28428
-#if SQLITE_OS_WINCE
28429
- sqlite3_snprintf(nBuf, zBuf, "OsError 0x%x (%u)", error, error);
28430
-#else
2843128425
/* FormatMessage returns 0 on failure. Otherwise it
2843228426
** returns the number of TCHARs written to the output
2843328427
** buffer, excluding the terminating null char.
2843428428
*/
28435
- if (!FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM,
28436
- NULL,
28437
- error,
28438
- 0,
28439
- zBuf,
28440
- nBuf-1,
28441
- 0))
28442
- {
28429
+ DWORD error = GetLastError();
28430
+ DWORD dwLen = 0;
28431
+ char *zOut;
28432
+
28433
+ if( isNT() ){
28434
+ WCHAR *zTempWide = NULL;
28435
+ dwLen = FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
28436
+ NULL,
28437
+ error,
28438
+ 0,
28439
+ (LPWSTR) &zTempWide,
28440
+ 0,
28441
+ 0);
28442
+ if( dwLen > 0 ){
28443
+ /* allocate a buffer and convert to UTF8 */
28444
+ zOut = unicodeToUtf8(zTempWide);
28445
+ /* free the system buffer allocated by FormatMessage */
28446
+ LocalFree(zTempWide);
28447
+ }
28448
+/* isNT() is 1 if SQLITE_OS_WINCE==1, so this else is never executed.
28449
+** Since the ASCII version of these Windows API do not exist for WINCE,
28450
+** it's important to not reference them for WINCE builds.
28451
+*/
28452
+#if SQLITE_OS_WINCE==0
28453
+ }else{
28454
+ char *zTemp = NULL;
28455
+ dwLen = FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
28456
+ NULL,
28457
+ error,
28458
+ 0,
28459
+ (LPSTR) &zTemp,
28460
+ 0,
28461
+ 0);
28462
+ if( dwLen > 0 ){
28463
+ /* allocate a buffer and convert to UTF8 */
28464
+ zOut = sqlite3_win32_mbcs_to_utf8(zTemp);
28465
+ /* free the system buffer allocated by FormatMessage */
28466
+ LocalFree(zTemp);
28467
+ }
28468
+#endif
28469
+ }
28470
+ if( 0 == dwLen ){
2844328471
sqlite3_snprintf(nBuf, zBuf, "OsError 0x%x (%u)", error, error);
28472
+ }else{
28473
+ /* copy a maximum of nBuf chars to output buffer */
28474
+ sqlite3_snprintf(nBuf, zBuf, "%s", zOut);
28475
+ /* free the UTF8 buffer */
28476
+ free(zOut);
2844428477
}
28445
-#endif
28446
-
2844728478
return 0;
2844828479
}
2844928480
2845028481
/*
2845128482
** Open a file.
@@ -28809,18 +28840,18 @@
2880928840
&bytesPerSector,
2881028841
&dwDummy,
2881128842
&dwDummy);
2881228843
}else{
2881328844
/* trim path to just drive reference */
28814
- CHAR *p = (CHAR *)zConverted;
28845
+ char *p = (char *)zConverted;
2881528846
for(;*p;p++){
2881628847
if( *p == '\\' ){
2881728848
*p = '\0';
2881828849
break;
2881928850
}
2882028851
}
28821
- dwRet = GetDiskFreeSpaceA((CHAR*)zConverted,
28852
+ dwRet = GetDiskFreeSpaceA((char*)zConverted,
2882228853
&dwDummy,
2882328854
&bytesPerSector,
2882428855
&dwDummy,
2882528856
&dwDummy);
2882628857
}
@@ -36675,13 +36706,13 @@
3667536706
**
3667636707
** FORMAT DETAILS
3667736708
**
3667836709
** The file is divided into pages. The first page is called page 1,
3667936710
** the second is page 2, and so forth. A page number of zero indicates
36680
-** "no such page". The page size can be anything between 512 and 65536.
36681
-** Each page can be either a btree page, a freelist page or an overflow
36682
-** page.
36711
+** "no such page". The page size can be any power of 2 between 512 and 32768.
36712
+** Each page can be either a btree page, a freelist page, an overflow
36713
+** page, or a pointer-map page.
3668336714
**
3668436715
** The first page is always a btree page. The first 100 bytes of the first
3668536716
** page contain a special header (the "file header") that describes the file.
3668636717
** The format of the file header is as follows:
3668736718
**
@@ -36955,12 +36986,12 @@
3695536986
** is opaque to the database connection. The database connection cannot
3695636987
** see the internals of this structure and only deals with pointers to
3695736988
** this structure.
3695836989
**
3695936990
** For some database files, the same underlying database cache might be
36960
-** shared between multiple connections. In that case, each contection
36961
-** has it own pointer to this object. But each instance of this object
36991
+** shared between multiple connections. In that case, each connection
36992
+** has it own instance of this object. But each instance of this object
3696236993
** points to the same BtShared object. The database cache and the
3696336994
** schema associated with the database file are all contained within
3696436995
** the BtShared object.
3696536996
**
3696636997
** All fields in this structure are accessed under sqlite3.mutex.
@@ -37097,11 +37128,11 @@
3709737128
** b-tree within a database file.
3709837129
**
3709937130
** The entry is identified by its MemPage and the index in
3710037131
** MemPage.aCell[] of the entry.
3710137132
**
37102
-** When a single database file can shared by two more database connections,
37133
+** A single database file can shared by two more database connections,
3710337134
** but cursors cannot be shared. Each cursor is associated with a
3710437135
** particular database connection identified BtCursor.pBtree.db.
3710537136
**
3710637137
** Fields in this structure are accessed under the BtShared.mutex
3710737138
** found at self->pBt->mutex.
@@ -37701,26 +37732,28 @@
3770137732
3770237733
#ifndef SQLITE_OMIT_SHARED_CACHE
3770337734
3770437735
#ifdef SQLITE_DEBUG
3770537736
/*
37706
-** This function is only used as part of an assert() statement. It checks
37707
-** that connection p holds the required locks to read or write to the
37708
-** b-tree with root page iRoot. If so, true is returned. Otherwise, false.
37709
-** For example, when writing to a table b-tree with root-page iRoot via
37737
+**** This function is only used as part of an assert() statement. ***
37738
+**
37739
+** Check to see if pBtree holds the required locks to read or write to the
37740
+** table with root page iRoot. Return 1 if it does and 0 if not.
37741
+**
37742
+** For example, when writing to a table with root-page iRoot via
3771037743
** Btree connection pBtree:
3771137744
**
3771237745
** assert( hasSharedCacheTableLock(pBtree, iRoot, 0, WRITE_LOCK) );
3771337746
**
37714
-** When writing to an index b-tree that resides in a sharable database, the
37747
+** When writing to an index that resides in a sharable database, the
3771537748
** caller should have first obtained a lock specifying the root page of
37716
-** the corresponding table b-tree. This makes things a bit more complicated,
37717
-** as this module treats each b-tree as a separate structure. To determine
37718
-** the table b-tree corresponding to the index b-tree being written, this
37749
+** the corresponding table. This makes things a bit more complicated,
37750
+** as this module treats each table as a separate structure. To determine
37751
+** the table corresponding to the index being written, this
3771937752
** function has to search through the database schema.
3772037753
**
37721
-** Instead of a lock on the b-tree rooted at page iRoot, the caller may
37754
+** Instead of a lock on the table/index rooted at page iRoot, the caller may
3772237755
** hold a write-lock on the schema table (root page 1). This is also
3772337756
** acceptable.
3772437757
*/
3772537758
static int hasSharedCacheTableLock(
3772637759
Btree *pBtree, /* Handle that must hold lock */
@@ -37730,23 +37763,28 @@
3773037763
){
3773137764
Schema *pSchema = (Schema *)pBtree->pBt->pSchema;
3773237765
Pgno iTab = 0;
3773337766
BtLock *pLock;
3773437767
37735
- /* If this b-tree database is not shareable, or if the client is reading
37768
+ /* If this database is not shareable, or if the client is reading
3773637769
** and has the read-uncommitted flag set, then no lock is required.
37737
- ** In these cases return true immediately. If the client is reading
37738
- ** or writing an index b-tree, but the schema is not loaded, then return
37739
- ** true also. In this case the lock is required, but it is too difficult
37740
- ** to check if the client actually holds it. This doesn't happen very
37741
- ** often. */
37770
+ ** Return true immediately.
37771
+ */
3774237772
if( (pBtree->sharable==0)
3774337773
|| (eLockType==READ_LOCK && (pBtree->db->flags & SQLITE_ReadUncommitted))
37744
- || (isIndex && (!pSchema || (pSchema->flags&DB_SchemaLoaded)==0 ))
3774537774
){
3774637775
return 1;
3774737776
}
37777
+
37778
+ /* If the client is reading or writing an index and the schema is
37779
+ ** not loaded, then it is too difficult to actually check to see if
37780
+ ** the correct locks are held. So do not bother - just return true.
37781
+ ** This case does not come up very often anyhow.
37782
+ */
37783
+ if( isIndex && (!pSchema || (pSchema->flags&DB_SchemaLoaded)==0) ){
37784
+ return 1;
37785
+ }
3774837786
3774937787
/* Figure out the root-page that the lock should be held on. For table
3775037788
** b-trees, this is just the root page of the b-tree being read or
3775137789
** written. For index b-trees, it is the root page of the associated
3775237790
** table. */
@@ -37775,18 +37813,28 @@
3777537813
}
3777637814
3777737815
/* Failed to find the required lock. */
3777837816
return 0;
3777937817
}
37780
-
37781
-/*
37782
-** This function is also used as part of assert() statements only. It
37783
-** returns true if there exist one or more cursors open on the table
37784
-** with root page iRoot that do not belong to either connection pBtree
37785
-** or some other connection that has the read-uncommitted flag set.
37786
-**
37787
-** For example, before writing to page iRoot:
37818
+#endif /* SQLITE_DEBUG */
37819
+
37820
+#ifdef SQLITE_DEBUG
37821
+/*
37822
+**** This function may be used as part of assert() statements only. ****
37823
+**
37824
+** Return true if it would be illegal for pBtree to write into the
37825
+** table or index rooted at iRoot because other shared connections are
37826
+** simultaneously reading that same table or index.
37827
+**
37828
+** It is illegal for pBtree to write if some other Btree object that
37829
+** shares the same BtShared object is currently reading or writing
37830
+** the iRoot table. Except, if the other Btree object has the
37831
+** read-uncommitted flag set, then it is OK for the other object to
37832
+** have a read cursor.
37833
+**
37834
+** For example, before writing to any part of the table or index
37835
+** rooted at page iRoot, one should call:
3778837836
**
3778937837
** assert( !hasReadConflicts(pBtree, iRoot) );
3779037838
*/
3779137839
static int hasReadConflicts(Btree *pBtree, Pgno iRoot){
3779237840
BtCursor *p;
@@ -37801,11 +37849,11 @@
3780137849
return 0;
3780237850
}
3780337851
#endif /* #ifdef SQLITE_DEBUG */
3780437852
3780537853
/*
37806
-** Query to see if btree handle p may obtain a lock of type eLock
37854
+** Query to see if Btree handle p may obtain a lock of type eLock
3780737855
** (READ_LOCK or WRITE_LOCK) on the table with root-page iTab. Return
3780837856
** SQLITE_OK if the lock may be obtained (by calling
3780937857
** setSharedCacheTableLock()), or SQLITE_LOCKED if not.
3781037858
*/
3781137859
static int querySharedCacheTableLock(Btree *p, Pgno iTab, u8 eLock){
@@ -37822,11 +37870,11 @@
3782237870
** must be an open write transaction on the file itself.
3782337871
*/
3782437872
assert( eLock==READ_LOCK || (p==pBt->pWriter && p->inTrans==TRANS_WRITE) );
3782537873
assert( eLock==READ_LOCK || pBt->inTransaction==TRANS_WRITE );
3782637874
37827
- /* This is a no-op if the shared-cache is not enabled */
37875
+ /* This routine is a no-op if the shared-cache is not enabled */
3782837876
if( !p->sharable ){
3782937877
return SQLITE_OK;
3783037878
}
3783137879
3783237880
/* If some other connection is holding an exclusive lock, the
@@ -37868,14 +37916,14 @@
3786837916
** by Btree handle p. Parameter eLock must be either READ_LOCK or
3786937917
** WRITE_LOCK.
3787037918
**
3787137919
** This function assumes the following:
3787237920
**
37873
-** (a) The specified b-tree connection handle is connected to a sharable
37874
-** b-tree database (one with the BtShared.sharable) flag set, and
37921
+** (a) The specified Btree object p is connected to a sharable
37922
+** database (one with the BtShared.sharable flag set), and
3787537923
**
37876
-** (b) No other b-tree connection handle holds a lock that conflicts
37924
+** (b) No other Btree objects hold a lock that conflicts
3787737925
** with the requested lock (i.e. querySharedCacheTableLock() has
3787837926
** already been called and returned SQLITE_OK).
3787937927
**
3788037928
** SQLITE_OK is returned if the lock is added successfully. SQLITE_NOMEM
3788137929
** is returned if a malloc attempt fails.
@@ -37936,13 +37984,13 @@
3793637984
#endif /* !SQLITE_OMIT_SHARED_CACHE */
3793737985
3793837986
#ifndef SQLITE_OMIT_SHARED_CACHE
3793937987
/*
3794037988
** Release all the table locks (locks obtained via calls to
37941
-** the setSharedCacheTableLock() procedure) held by Btree handle p.
37989
+** the setSharedCacheTableLock() procedure) held by Btree object p.
3794237990
**
37943
-** This function assumes that handle p has an open read or write
37991
+** This function assumes that Btree p has an open read or write
3794437992
** transaction. If it does not, then the BtShared.isPending variable
3794537993
** may be incorrectly cleared.
3794637994
*/
3794737995
static void clearAllSharedCacheTableLocks(Btree *p){
3794837996
BtShared *pBt = p->pBt;
@@ -37971,11 +38019,11 @@
3797138019
if( pBt->pWriter==p ){
3797238020
pBt->pWriter = 0;
3797338021
pBt->isExclusive = 0;
3797438022
pBt->isPending = 0;
3797538023
}else if( pBt->nTransaction==2 ){
37976
- /* This function is called when connection p is concluding its
38024
+ /* This function is called when Btree p is concluding its
3797738025
** transaction. If there currently exists a writer, and p is not
3797838026
** that writer, then the number of locks held by connections other
3797938027
** than the writer must be about to drop to zero. In this case
3798038028
** set the isPending flag to 0.
3798138029
**
@@ -37985,11 +38033,11 @@
3798538033
pBt->isPending = 0;
3798638034
}
3798738035
}
3798838036
3798938037
/*
37990
-** This function changes all write-locks held by connection p to read-locks.
38038
+** This function changes all write-locks held by Btree p into read-locks.
3799138039
*/
3799238040
static void downgradeAllSharedCacheTableLocks(Btree *p){
3799338041
BtShared *pBt = p->pBt;
3799438042
if( pBt->pWriter==p ){
3799538043
BtLock *pLock;
@@ -38006,13 +38054,15 @@
3800638054
#endif /* SQLITE_OMIT_SHARED_CACHE */
3800738055
3800838056
static void releasePage(MemPage *pPage); /* Forward reference */
3800938057
3801038058
/*
38011
-** Verify that the cursor holds a mutex on the BtShared
38059
+***** This routine is used inside of assert() only ****
38060
+**
38061
+** Verify that the cursor holds the mutex on its BtShared
3801238062
*/
38013
-#ifndef NDEBUG
38063
+#ifdef SQLITE_DEBUG
3801438064
static int cursorHoldsMutex(BtCursor *p){
3801538065
return sqlite3_mutex_held(p->pBt->mutex);
3801638066
}
3801738067
#endif
3801838068
@@ -38039,20 +38089,20 @@
3803938089
}
3804038090
}
3804138091
3804238092
/*
3804338093
** This function is called before modifying the contents of a table
38044
-** b-tree to invalidate any incrblob cursors that are open on the
38094
+** to invalidate any incrblob cursors that are open on the
3804538095
** row or one of the rows being modified.
3804638096
**
3804738097
** If argument isClearTable is true, then the entire contents of the
3804838098
** table is about to be deleted. In this case invalidate all incrblob
3804938099
** cursors open on any row within the table with root-page pgnoRoot.
3805038100
**
3805138101
** Otherwise, if argument isClearTable is false, then the row with
3805238102
** rowid iRow is being replaced or deleted. In this case invalidate
38053
-** only those incrblob cursors open on this specific row.
38103
+** only those incrblob cursors open on that specific row.
3805438104
*/
3805538105
static void invalidateIncrblobCursors(
3805638106
Btree *pBtree, /* The database file to check */
3805738107
i64 iRow, /* The rowid that might be changing */
3805838108
int isClearTable /* True if all rows are being deleted */
@@ -38066,14 +38116,15 @@
3806638116
}
3806738117
}
3806838118
}
3806938119
3807038120
#else
38121
+ /* Stub functions when INCRBLOB is omitted */
3807138122
#define invalidateOverflowCache(x)
3807238123
#define invalidateAllOverflowCache(x)
3807338124
#define invalidateIncrblobCursors(x,y,z)
38074
-#endif
38125
+#endif /* SQLITE_OMIT_INCRBLOB */
3807538126
3807638127
/*
3807738128
** Set bit pgno of the BtShared.pHasContent bitvec. This is called
3807838129
** when a page that previously contained data becomes a free-list leaf
3807938130
** page.
@@ -38102,11 +38153,11 @@
3810238153
** to restore the database to its original configuration.
3810338154
**
3810438155
** The solution is the BtShared.pHasContent bitvec. Whenever a page is
3810538156
** moved to become a free-list leaf page, the corresponding bit is
3810638157
** set in the bitvec. Whenever a leaf page is extracted from the free-list,
38107
-** optimization 2 above is ommitted if the corresponding bit is already
38158
+** optimization 2 above is omitted if the corresponding bit is already
3810838159
** set in BtShared.pHasContent. The contents of the bitvec are cleared
3810938160
** at the end of every transaction.
3811038161
*/
3811138162
static int btreeSetHasContent(BtShared *pBt, Pgno pgno){
3811238163
int rc = SQLITE_OK;
@@ -38198,12 +38249,12 @@
3819838249
invalidateOverflowCache(pCur);
3819938250
return rc;
3820038251
}
3820138252
3820238253
/*
38203
-** Save the positions of all cursors except pExcept open on the table
38204
-** with root-page iRoot. Usually, this is called just before cursor
38254
+** Save the positions of all cursors (except pExcept) that are open on
38255
+** the table with root-page iRoot. Usually, this is called just before cursor
3820538256
** pExcept is used to modify the table (BtreeDelete() or BtreeInsert()).
3820638257
*/
3820738258
static int saveAllCursors(BtShared *pBt, Pgno iRoot, BtCursor *pExcept){
3820838259
BtCursor *p;
3820938260
assert( sqlite3_mutex_held(pBt->mutex) );
@@ -38604,11 +38655,14 @@
3860438655
}
3860538656
3860638657
assert( nSize==debuginfo.nSize );
3860738658
return (u16)nSize;
3860838659
}
38609
-#ifndef NDEBUG
38660
+
38661
+#ifdef SQLITE_DEBUG
38662
+/* This variation on cellSizePtr() is used inside of assert() statements
38663
+** only. */
3861038664
static u16 cellSize(MemPage *pPage, int iCell){
3861138665
return cellSizePtr(pPage, findCell(pPage, iCell));
3861238666
}
3861338667
#endif
3861438668
@@ -40576,22 +40630,17 @@
4057640630
** This function is called from both BtreeCommitPhaseTwo() and BtreeRollback()
4057740631
** at the conclusion of a transaction.
4057840632
*/
4057940633
static void btreeEndTransaction(Btree *p){
4058040634
BtShared *pBt = p->pBt;
40581
- BtCursor *pCsr;
4058240635
assert( sqlite3BtreeHoldsMutex(p) );
4058340636
40584
- /* Search for a cursor held open by this b-tree connection. If one exists,
40585
- ** then the transaction will be downgraded to a read-only transaction
40586
- ** instead of actually concluded. A subsequent call to CommitPhaseTwo()
40587
- ** or Rollback() will finish the transaction and unlock the database. */
40588
- for(pCsr=pBt->pCursor; pCsr && pCsr->pBtree!=p; pCsr=pCsr->pNext);
40589
- assert( pCsr==0 || p->inTrans>TRANS_NONE );
40590
-
4059140637
btreeClearHasContent(pBt);
40592
- if( pCsr ){
40638
+ if( p->inTrans>TRANS_NONE && p->db->activeVdbeCnt>1 ){
40639
+ /* If there are other active statements that belong to this database
40640
+ ** handle, downgrade to a read-only transaction. The other statements
40641
+ ** may still be reading from the database. */
4059340642
downgradeAllSharedCacheTableLocks(p);
4059440643
p->inTrans = TRANS_READ;
4059540644
}else{
4059640645
/* If the handle had any kind of transaction open, decrement the
4059740646
** transaction count of the shared btree. If the transaction count
@@ -44047,11 +44096,11 @@
4404744096
int appendBias, /* True if this is likely an append */
4404844097
int seekResult /* Result of prior MovetoUnpacked() call */
4404944098
){
4405044099
int rc;
4405144100
int loc = seekResult; /* -1: before desired location +1: after */
44052
- int szNew;
44101
+ int szNew = 0;
4405344102
int idx;
4405444103
MemPage *pPage;
4405544104
Btree *p = pCur->pBtree;
4405644105
BtShared *pBt = p->pBt;
4405744106
unsigned char *oldCell;
@@ -47103,10 +47152,13 @@
4710347152
sqlite3VdbeMemSetStr(pVal, sqlite3HexToBlob(db, zVal, nVal), nVal/2,
4710447153
0, SQLITE_DYNAMIC);
4710547154
}
4710647155
#endif
4710747156
47157
+ if( pVal ){
47158
+ sqlite3VdbeMemStoreType(pVal);
47159
+ }
4710847160
*ppVal = pVal;
4710947161
return SQLITE_OK;
4711047162
4711147163
no_mem:
4711247164
db->mallocFailed = 1;
@@ -47207,17 +47259,18 @@
4720747259
4720847260
/*
4720947261
** Remember the SQL string for a prepared statement.
4721047262
*/
4721147263
SQLITE_PRIVATE void sqlite3VdbeSetSql(Vdbe *p, const char *z, int n, int isPrepareV2){
47264
+ assert( isPrepareV2==1 || isPrepareV2==0 );
4721247265
if( p==0 ) return;
4721347266
#ifdef SQLITE_OMIT_TRACE
4721447267
if( !isPrepareV2 ) return;
4721547268
#endif
4721647269
assert( p->zSql==0 );
4721747270
p->zSql = sqlite3DbStrNDup(p->db, z, n);
47218
- p->isPrepareV2 = isPrepareV2 ? 1 : 0;
47271
+ p->isPrepareV2 = isPrepareV2;
4721947272
}
4722047273
4722147274
/*
4722247275
** Return the SQL associated with a prepared statement
4722347276
*/
@@ -48167,31 +48220,10 @@
4816748220
}
4816848221
releaseMemArray(aMem, p->nChildMem);
4816948222
sqlite3DbFree(p->v->db, p);
4817048223
}
4817148224
48172
-
48173
-#ifdef SQLITE_ENABLE_MEMORY_MANAGEMENT
48174
-SQLITE_PRIVATE int sqlite3VdbeReleaseBuffers(Vdbe *p){
48175
- int ii;
48176
- int nFree = 0;
48177
- assert( sqlite3_mutex_held(p->db->mutex) );
48178
- for(ii=1; ii<=p->nMem; ii++){
48179
- Mem *pMem = &p->aMem[ii];
48180
- if( pMem->flags & MEM_RowSet ){
48181
- sqlite3RowSetClear(pMem->u.pRowSet);
48182
- }
48183
- if( pMem->z && pMem->flags&MEM_Dyn ){
48184
- assert( !pMem->xDel );
48185
- nFree += sqlite3DbMallocSize(pMem->db, pMem->z);
48186
- sqlite3VdbeMemRelease(pMem);
48187
- }
48188
- }
48189
- return nFree;
48190
-}
48191
-#endif
48192
-
4819348225
#ifndef SQLITE_OMIT_EXPLAIN
4819448226
/*
4819548227
** Give a listing of the program in the virtual machine.
4819648228
**
4819748229
** The interface is the same as sqlite3VdbeExec(). But instead of
@@ -50176,10 +50208,49 @@
5017650208
** Return the database associated with the Vdbe.
5017750209
*/
5017850210
SQLITE_PRIVATE sqlite3 *sqlite3VdbeDb(Vdbe *v){
5017950211
return v->db;
5018050212
}
50213
+
50214
+/*
50215
+** Return a pointer to an sqlite3_value structure containing the value bound
50216
+** parameter iVar of VM v. Except, if the value is an SQL NULL, return
50217
+** 0 instead. Unless it is NULL, apply affinity aff (one of the SQLITE_AFF_*
50218
+** constants) to the value before returning it.
50219
+**
50220
+** The returned value must be freed by the caller using sqlite3ValueFree().
50221
+*/
50222
+SQLITE_PRIVATE sqlite3_value *sqlite3VdbeGetValue(Vdbe *v, int iVar, u8 aff){
50223
+ assert( iVar>0 );
50224
+ if( v ){
50225
+ Mem *pMem = &v->aVar[iVar-1];
50226
+ if( 0==(pMem->flags & MEM_Null) ){
50227
+ sqlite3_value *pRet = sqlite3ValueNew(v->db);
50228
+ if( pRet ){
50229
+ sqlite3VdbeMemCopy((Mem *)pRet, pMem);
50230
+ sqlite3ValueApplyAffinity(pRet, aff, SQLITE_UTF8);
50231
+ sqlite3VdbeMemStoreType((Mem *)pRet);
50232
+ }
50233
+ return pRet;
50234
+ }
50235
+ }
50236
+ return 0;
50237
+}
50238
+
50239
+/*
50240
+** Configure SQL variable iVar so that binding a new value to it signals
50241
+** to sqlite3_reoptimize() that re-preparing the statement may result
50242
+** in a better query plan.
50243
+*/
50244
+SQLITE_PRIVATE void sqlite3VdbeSetVarmask(Vdbe *v, int iVar){
50245
+ assert( iVar>0 );
50246
+ if( iVar>32 ){
50247
+ v->expmask = 0xffffffff;
50248
+ }else{
50249
+ v->expmask |= ((u32)1 << (iVar-1));
50250
+ }
50251
+}
5018150252
5018250253
/************** End of vdbeaux.c *********************************************/
5018350254
/************** Begin file vdbeapi.c *****************************************/
5018450255
/*
5018550256
** 2004 May 26
@@ -50277,10 +50348,13 @@
5027750348
#endif
5027850349
sqlite3_mutex_enter(mutex);
5027950350
for(i=0; i<p->nVar; i++){
5028050351
sqlite3VdbeMemRelease(&p->aVar[i]);
5028150352
p->aVar[i].flags = MEM_Null;
50353
+ }
50354
+ if( p->isPrepareV2 && p->expmask ){
50355
+ p->expired = 1;
5028250356
}
5028350357
sqlite3_mutex_leave(mutex);
5028450358
return rc;
5028550359
}
5028650360
@@ -50483,11 +50557,11 @@
5048350557
if( db->mallocFailed ){
5048450558
return SQLITE_NOMEM;
5048550559
}
5048650560
5048750561
if( p->pc<=0 && p->expired ){
50488
- if( ALWAYS(p->rc==SQLITE_OK) ){
50562
+ if( ALWAYS(p->rc==SQLITE_OK || p->rc==SQLITE_SCHEMA) ){
5048950563
p->rc = SQLITE_SCHEMA;
5049050564
}
5049150565
rc = SQLITE_ERROR;
5049250566
goto end_of_step;
5049350567
}
@@ -51093,10 +51167,19 @@
5109351167
i--;
5109451168
pVar = &p->aVar[i];
5109551169
sqlite3VdbeMemRelease(pVar);
5109651170
pVar->flags = MEM_Null;
5109751171
sqlite3Error(p->db, SQLITE_OK, 0);
51172
+
51173
+ /* If the bit corresponding to this variable in Vdbe.expmask is set, then
51174
+ ** binding a new value to this variable invalidates the current query plan.
51175
+ */
51176
+ if( p->isPrepareV2 &&
51177
+ ((i<32 && p->expmask & ((u32)1 << i)) || p->expmask==0xffffffff)
51178
+ ){
51179
+ p->expired = 1;
51180
+ }
5109851181
return SQLITE_OK;
5109951182
}
5110051183
5110151184
/*
5110251185
** Bind a text or BLOB value.
@@ -51342,10 +51425,16 @@
5134251425
SQLITE_API int sqlite3_transfer_bindings(sqlite3_stmt *pFromStmt, sqlite3_stmt *pToStmt){
5134351426
Vdbe *pFrom = (Vdbe*)pFromStmt;
5134451427
Vdbe *pTo = (Vdbe*)pToStmt;
5134551428
if( pFrom->nVar!=pTo->nVar ){
5134651429
return SQLITE_ERROR;
51430
+ }
51431
+ if( pTo->isPrepareV2 && pTo->expmask ){
51432
+ pTo->expired = 1;
51433
+ }
51434
+ if( pFrom->isPrepareV2 && pFrom->expmask ){
51435
+ pFrom->expired = 1;
5134751436
}
5134851437
return sqlite3TransferBindings(pFromStmt, pToStmt);
5134951438
}
5135051439
#endif
5135151440
@@ -51538,16 +51627,14 @@
5153851627
#define ExpandBlob(P) (((P)->flags&MEM_Zero)?sqlite3VdbeMemExpandBlob(P):0)
5153951628
5154051629
/*
5154151630
** Argument pMem points at a register that will be passed to a
5154251631
** user-defined function or returned to the user as the result of a query.
51543
-** The second argument, 'db_enc' is the text encoding used by the vdbe for
51544
-** register variables. This routine sets the pMem->enc and pMem->type
51545
-** variables used by the sqlite3_value_*() routines.
51632
+** This routine sets the pMem->type variable used by the sqlite3_value_*()
51633
+** routines.
5154651634
*/
51547
-#define storeTypeInfo(A,B) _storeTypeInfo(A)
51548
-static void _storeTypeInfo(Mem *pMem){
51635
+SQLITE_PRIVATE void sqlite3VdbeMemStoreType(Mem *pMem){
5154951636
int flags = pMem->flags;
5155051637
if( flags & MEM_Null ){
5155151638
pMem->type = SQLITE_NULL;
5155251639
}
5155351640
else if( flags & MEM_Int ){
@@ -51714,11 +51801,11 @@
5171451801
** This is an EXPERIMENTAL api and is subject to change or removal.
5171551802
*/
5171651803
SQLITE_API int sqlite3_value_numeric_type(sqlite3_value *pVal){
5171751804
Mem *pMem = (Mem*)pVal;
5171851805
applyNumericAffinity(pMem);
51719
- storeTypeInfo(pMem, 0);
51806
+ sqlite3VdbeMemStoreType(pMem);
5172051807
return pMem->type;
5172151808
}
5172251809
5172351810
/*
5172451811
** Exported version of applyAffinity(). This one works on sqlite3_value*,
@@ -52263,11 +52350,11 @@
5226352350
int res; /* Result of an sqlite3BtreeLast() */
5226452351
int cnt; /* Counter to limit the number of searches */
5226552352
Mem *pMem; /* Register holding largest rowid for AUTOINCREMENT */
5226652353
VdbeFrame *pFrame; /* Root frame of VDBE */
5226752354
} be;
52268
- struct OP_Insert_stack_vars {
52355
+ struct OP_InsertInt_stack_vars {
5226952356
Mem *pData; /* MEM cell holding data for the record to be inserted */
5227052357
Mem *pKey; /* MEM cell holding key for the record */
5227152358
i64 iKey; /* The integer ROWID or key for the record to be inserted */
5227252359
VdbeCursor *pC; /* Cursor to table into which insert is written */
5227352360
int nZero; /* Number of zero-bytes to append */
@@ -52907,11 +52994,11 @@
5290752994
u.ab.p1 = pOp->p1 - 1;
5290852995
u.ab.p2 = pOp->p2;
5290952996
u.ab.n = pOp->p3;
5291052997
assert( u.ab.p1>=0 && u.ab.p1+u.ab.n<=p->nVar );
5291152998
assert( u.ab.p2>=1 && u.ab.p2+u.ab.n-1<=p->nMem );
52912
- assert( pOp->p4.z==0 || pOp->p3==1 );
52999
+ assert( pOp->p4.z==0 || pOp->p3==1 || pOp->p3==0 );
5291353000
5291453001
while( u.ab.n-- > 0 ){
5291553002
u.ab.pVar = &p->aVar[u.ab.p1++];
5291653003
if( sqlite3VdbeMemTooBig(u.ab.pVar) ){
5291753004
goto too_big;
@@ -53058,11 +53145,11 @@
5305853145
** as side effect.
5305953146
*/
5306053147
u.ad.pMem = p->pResultSet = &p->aMem[pOp->p1];
5306153148
for(u.ad.i=0; u.ad.i<pOp->p2; u.ad.i++){
5306253149
sqlite3VdbeMemNulTerminate(&u.ad.pMem[u.ad.i]);
53063
- storeTypeInfo(&u.ad.pMem[u.ad.i], encoding);
53150
+ sqlite3VdbeMemStoreType(&u.ad.pMem[u.ad.i]);
5306453151
REGISTER_TRACE(pOp->p1+u.ad.i, &u.ad.pMem[u.ad.i]);
5306553152
}
5306653153
if( db->mallocFailed ) goto no_mem;
5306753154
5306853155
/* Return SQLITE_ROW
@@ -53283,11 +53370,11 @@
5328353370
assert( u.ag.n==0 || (pOp->p2>0 && pOp->p2+u.ag.n<=p->nMem+1) );
5328453371
assert( pOp->p3<pOp->p2 || pOp->p3>=pOp->p2+u.ag.n );
5328553372
u.ag.pArg = &p->aMem[pOp->p2];
5328653373
for(u.ag.i=0; u.ag.i<u.ag.n; u.ag.i++, u.ag.pArg++){
5328753374
u.ag.apVal[u.ag.i] = u.ag.pArg;
53288
- storeTypeInfo(u.ag.pArg, encoding);
53375
+ sqlite3VdbeMemStoreType(u.ag.pArg);
5328953376
REGISTER_TRACE(pOp->p2, u.ag.pArg);
5329053377
}
5329153378
5329253379
assert( pOp->p4type==P4_FUNCDEF || pOp->p4type==P4_VDBEFUNC );
5329353380
if( pOp->p4type==P4_FUNCDEF ){
@@ -54779,10 +54866,11 @@
5477954866
}
5478054867
if( pOp->p1==1 ){
5478154868
/* Invalidate all prepared statements whenever the TEMP database
5478254869
** schema is changed. Ticket #1644 */
5478354870
sqlite3ExpirePreparedStatements(db);
54871
+ p->expired = 0;
5478454872
}
5478554873
break;
5478654874
}
5478754875
5478854876
/* Opcode: VerifyCookie P1 P2 *
@@ -54899,10 +54987,15 @@
5489954987
int wrFlag;
5490054988
Btree *pX;
5490154989
VdbeCursor *pCur;
5490254990
Db *pDb;
5490354991
#endif /* local variables moved into u.aw */
54992
+
54993
+ if( p->expired ){
54994
+ rc = SQLITE_ABORT;
54995
+ break;
54996
+ }
5490454997
5490554998
u.aw.nField = 0;
5490654999
u.aw.pKeyInfo = 0;
5490755000
u.aw.p2 = pOp->p2;
5490855001
u.aw.iDb = pOp->p3;
@@ -55698,11 +55791,17 @@
5569855791
** cause any problems.)
5569955792
**
5570055793
** This instruction only works on tables. The equivalent instruction
5570155794
** for indices is OP_IdxInsert.
5570255795
*/
55703
-case OP_Insert: {
55796
+/* Opcode: InsertInt P1 P2 P3 P4 P5
55797
+**
55798
+** This works exactly like OP_Insert except that the key is the
55799
+** integer value P3, not the value of the integer stored in register P3.
55800
+*/
55801
+case OP_Insert:
55802
+case OP_InsertInt: {
5570455803
#if 0 /* local variables moved into u.bf */
5570555804
Mem *pData; /* MEM cell holding data for the record to be inserted */
5570655805
Mem *pKey; /* MEM cell holding key for the record */
5570755806
i64 iKey; /* The integer ROWID or key for the record to be inserted */
5570855807
VdbeCursor *pC; /* Cursor to table into which insert is written */
@@ -55712,24 +55811,30 @@
5571255811
const char *zTbl; /* Table name - used by the opdate hook */
5571355812
int op; /* Opcode for update hook: SQLITE_UPDATE or SQLITE_INSERT */
5571455813
#endif /* local variables moved into u.bf */
5571555814
5571655815
u.bf.pData = &p->aMem[pOp->p2];
55717
- u.bf.pKey = &p->aMem[pOp->p3];
5571855816
assert( pOp->p1>=0 && pOp->p1<p->nCursor );
5571955817
u.bf.pC = p->apCsr[pOp->p1];
5572055818
assert( u.bf.pC!=0 );
5572155819
assert( u.bf.pC->pCursor!=0 );
5572255820
assert( u.bf.pC->pseudoTableReg==0 );
55723
- assert( u.bf.pKey->flags & MEM_Int );
5572455821
assert( u.bf.pC->isTable );
5572555822
REGISTER_TRACE(pOp->p2, u.bf.pData);
55726
- REGISTER_TRACE(pOp->p3, u.bf.pKey);
5572755823
55728
- u.bf.iKey = u.bf.pKey->u.i;
55824
+ if( pOp->opcode==OP_Insert ){
55825
+ u.bf.pKey = &p->aMem[pOp->p3];
55826
+ assert( u.bf.pKey->flags & MEM_Int );
55827
+ REGISTER_TRACE(pOp->p3, u.bf.pKey);
55828
+ u.bf.iKey = u.bf.pKey->u.i;
55829
+ }else{
55830
+ assert( pOp->opcode==OP_InsertInt );
55831
+ u.bf.iKey = pOp->p3;
55832
+ }
55833
+
5572955834
if( pOp->p5 & OPFLAG_NCHANGE ) p->nChange++;
55730
- if( pOp->p5 & OPFLAG_LASTROWID ) db->lastRowid = u.bf.pKey->u.i;
55835
+ if( pOp->p5 & OPFLAG_LASTROWID ) db->lastRowid = u.bf.iKey;
5573155836
if( u.bf.pData->flags & MEM_Null ){
5573255837
u.bf.pData->z = 0;
5573355838
u.bf.pData->n = 0;
5573455839
}else{
5573555840
assert( u.bf.pData->flags & (MEM_Blob|MEM_Str) );
@@ -57043,11 +57148,11 @@
5704357148
u.cc.pRec = &p->aMem[pOp->p2];
5704457149
u.cc.apVal = p->apArg;
5704557150
assert( u.cc.apVal || u.cc.n==0 );
5704657151
for(u.cc.i=0; u.cc.i<u.cc.n; u.cc.i++, u.cc.pRec++){
5704757152
u.cc.apVal[u.cc.i] = u.cc.pRec;
57048
- storeTypeInfo(u.cc.pRec, encoding);
57153
+ sqlite3VdbeMemStoreType(u.cc.pRec);
5704957154
}
5705057155
u.cc.ctx.pFunc = pOp->p4.pFunc;
5705157156
assert( pOp->p3>0 && pOp->p3<=p->nMem );
5705257157
u.cc.ctx.pMem = u.cc.pMem = &p->aMem[pOp->p3];
5705357158
u.cc.pMem->n++;
@@ -57341,11 +57446,11 @@
5734157446
{
5734257447
u.ch.res = 0;
5734357448
u.ch.apArg = p->apArg;
5734457449
for(u.ch.i = 0; u.ch.i<u.ch.nArg; u.ch.i++){
5734557450
u.ch.apArg[u.ch.i] = &u.ch.pArgc[u.ch.i+1];
57346
- storeTypeInfo(u.ch.apArg[u.ch.i], 0);
57451
+ sqlite3VdbeMemStoreType(u.ch.apArg[u.ch.i]);
5734757452
}
5734857453
5734957454
if( sqlite3SafetyOff(db) ) goto abort_due_to_misuse;
5735057455
p->inVtabMethod = 1;
5735157456
rc = u.ch.pModule->xFilter(u.ch.pVtabCursor, u.ch.iQuery, pOp->p4.z, u.ch.nArg, u.ch.apArg);
@@ -57553,11 +57658,11 @@
5755357658
assert( pOp->p4type==P4_VTAB );
5755457659
if( ALWAYS(u.cl.pModule->xUpdate) ){
5755557660
u.cl.apArg = p->apArg;
5755657661
u.cl.pX = &p->aMem[pOp->p3];
5755757662
for(u.cl.i=0; u.cl.i<u.cl.nArg; u.cl.i++){
57558
- storeTypeInfo(u.cl.pX, 0);
57663
+ sqlite3VdbeMemStoreType(u.cl.pX);
5755957664
u.cl.apArg[u.cl.i] = u.cl.pX;
5756057665
u.cl.pX++;
5756157666
}
5756257667
if( sqlite3SafetyOff(db) ) goto abort_due_to_misuse;
5756357668
rc = u.cl.pModule->xUpdate(u.cl.pVtab, u.cl.nArg, u.cl.apArg, &u.cl.rowid);
@@ -59174,10 +59279,31 @@
5917459279
return WRC_Prune;
5917559280
} else {
5917659281
return WRC_Abort;
5917759282
}
5917859283
}
59284
+
59285
+/*
59286
+** Allocate and return a pointer to an expression to load the column iCol
59287
+** from datasource iSrc datasource in SrcList pSrc.
59288
+*/
59289
+SQLITE_PRIVATE Expr *sqlite3CreateColumnExpr(sqlite3 *db, SrcList *pSrc, int iSrc, int iCol){
59290
+ Expr *p = sqlite3ExprAlloc(db, TK_COLUMN, 0, 0);
59291
+ if( p ){
59292
+ struct SrcList_item *pItem = &pSrc->a[iSrc];
59293
+ p->pTab = pItem->pTab;
59294
+ p->iTable = pItem->iCursor;
59295
+ if( p->pTab->iPKey==iCol ){
59296
+ p->iColumn = -1;
59297
+ }else{
59298
+ p->iColumn = iCol;
59299
+ pItem->colUsed |= ((Bitmask)1)<<(iCol>=BMS ? BMS-1 : iCol);
59300
+ }
59301
+ ExprSetProperty(p, EP_Resolved);
59302
+ }
59303
+ return p;
59304
+}
5917959305
5918059306
/*
5918159307
** This routine is callback for sqlite3WalkExpr().
5918259308
**
5918359309
** Resolve symbolic names into TK_COLUMN operators for the current
@@ -60522,16 +60648,16 @@
6052260648
assert( z!=0 );
6052360649
assert( z[0]!=0 );
6052460650
if( z[1]==0 ){
6052560651
/* Wildcard of the form "?". Assign the next variable number */
6052660652
assert( z[0]=='?' );
60527
- pExpr->iTable = ++pParse->nVar;
60653
+ pExpr->iColumn = ++pParse->nVar;
6052860654
}else if( z[0]=='?' ){
6052960655
/* Wildcard of the form "?nnn". Convert "nnn" to an integer and
6053060656
** use it as the variable number */
6053160657
int i;
60532
- pExpr->iTable = i = atoi((char*)&z[1]);
60658
+ pExpr->iColumn = i = atoi((char*)&z[1]);
6053360659
testcase( i==0 );
6053460660
testcase( i==1 );
6053560661
testcase( i==db->aLimit[SQLITE_LIMIT_VARIABLE_NUMBER]-1 );
6053660662
testcase( i==db->aLimit[SQLITE_LIMIT_VARIABLE_NUMBER] );
6053760663
if( i<1 || i>db->aLimit[SQLITE_LIMIT_VARIABLE_NUMBER] ){
@@ -60551,16 +60677,16 @@
6055160677
n = sqlite3Strlen30(z);
6055260678
for(i=0; i<pParse->nVarExpr; i++){
6055360679
Expr *pE = pParse->apVarExpr[i];
6055460680
assert( pE!=0 );
6055560681
if( memcmp(pE->u.zToken, z, n)==0 && pE->u.zToken[n]==0 ){
60556
- pExpr->iTable = pE->iTable;
60682
+ pExpr->iColumn = pE->iColumn;
6055760683
break;
6055860684
}
6055960685
}
6056060686
if( i>=pParse->nVarExpr ){
60561
- pExpr->iTable = ++pParse->nVar;
60687
+ pExpr->iColumn = ++pParse->nVar;
6056260688
if( pParse->nVarExpr>=pParse->nVarExprAlloc-1 ){
6056360689
pParse->nVarExprAlloc += pParse->nVarExprAlloc + 10;
6056460690
pParse->apVarExpr =
6056560691
sqlite3DbReallocOrFree(
6056660692
db,
@@ -61322,10 +61448,12 @@
6132261448
SQLITE_PRIVATE int sqlite3FindInIndex(Parse *pParse, Expr *pX, int *prNotFound){
6132361449
Select *p; /* SELECT to the right of IN operator */
6132461450
int eType = 0; /* Type of RHS table. IN_INDEX_* */
6132561451
int iTab = pParse->nTab++; /* Cursor of the RHS table */
6132661452
int mustBeUnique = (prNotFound==0); /* True if RHS must be unique */
61453
+
61454
+ assert( pX->op==TK_IN );
6132761455
6132861456
/* Check to see if an existing table or index can be used to
6132961457
** satisfy the query. This is preferable to generating a new
6133061458
** ephemeral table.
6133161459
*/
@@ -61400,11 +61528,11 @@
6140061528
}
6140161529
}
6140261530
}
6140361531
6140461532
if( eType==0 ){
61405
- /* Could not found an existing able or index to use as the RHS b-tree.
61533
+ /* Could not found an existing table or index to use as the RHS b-tree.
6140661534
** We will have to generate an ephemeral table to do the job.
6140761535
*/
6140861536
int rMayHaveNull = 0;
6140961537
eType = IN_INDEX_EPH;
6141061538
if( prNotFound ){
@@ -61447,21 +61575,25 @@
6144761575
** care of changing this register value to non-NULL if the RHS is NULL-free.
6144861576
**
6144961577
** If rMayHaveNull is zero, that means that the subquery is being used
6145061578
** for membership testing only. There is no need to initialize any
6145161579
** registers to indicate the presense or absence of NULLs on the RHS.
61580
+**
61581
+** For a SELECT or EXISTS operator, return the register that holds the
61582
+** result. For IN operators or if an error occurs, the return value is 0.
6145261583
*/
6145361584
#ifndef SQLITE_OMIT_SUBQUERY
61454
-SQLITE_PRIVATE void sqlite3CodeSubselect(
61585
+SQLITE_PRIVATE int sqlite3CodeSubselect(
6145561586
Parse *pParse, /* Parsing context */
6145661587
Expr *pExpr, /* The IN, SELECT, or EXISTS operator */
6145761588
int rMayHaveNull, /* Register that records whether NULLs exist in RHS */
6145861589
int isRowid /* If true, LHS of IN operator is a rowid */
6145961590
){
6146061591
int testAddr = 0; /* One-time test address */
61592
+ int rReg = 0; /* Register storing resulting */
6146161593
Vdbe *v = sqlite3GetVdbe(pParse);
61462
- if( NEVER(v==0) ) return;
61594
+ if( NEVER(v==0) ) return 0;
6146361595
sqlite3ExprCachePush(pParse);
6146461596
6146561597
/* This code must be run in its entirety every time it is encountered
6146661598
** if any of the following is true:
6146761599
**
@@ -61522,11 +61654,11 @@
6152261654
assert( !isRowid );
6152361655
sqlite3SelectDestInit(&dest, SRT_Set, pExpr->iTable);
6152461656
dest.affinity = (u8)affinity;
6152561657
assert( (pExpr->iTable&0x0000FFFF)==pExpr->iTable );
6152661658
if( sqlite3Select(pParse, pExpr->x.pSelect, &dest) ){
61527
- return;
61659
+ return 0;
6152861660
}
6152961661
pEList = pExpr->x.pSelect->pEList;
6153061662
if( ALWAYS(pEList!=0 && pEList->nExpr>0) ){
6153161663
keyInfo.aColl[0] = sqlite3BinaryCompareCollSeq(pParse, pExpr->pLeft,
6153261664
pEList->a[0].pExpr);
@@ -61553,10 +61685,11 @@
6155361685
r1 = sqlite3GetTempReg(pParse);
6155461686
r2 = sqlite3GetTempReg(pParse);
6155561687
sqlite3VdbeAddOp2(v, OP_Null, 0, r2);
6155661688
for(i=pList->nExpr, pItem=pList->a; i>0; i--, pItem++){
6155761689
Expr *pE2 = pItem->pExpr;
61690
+ int iValToIns;
6155861691
6155961692
/* If the expression is not constant then we will need to
6156061693
** disable the test that was generated above that makes sure
6156161694
** this code only executes once. Because for a non-constant
6156261695
** expression we need to rerun this code each time.
@@ -61565,18 +61698,23 @@
6156561698
sqlite3VdbeChangeToNoop(v, testAddr-1, 2);
6156661699
testAddr = 0;
6156761700
}
6156861701
6156961702
/* Evaluate the expression and insert it into the temp table */
61570
- r3 = sqlite3ExprCodeTarget(pParse, pE2, r1);
61571
- if( isRowid ){
61572
- sqlite3VdbeAddOp2(v, OP_MustBeInt, r3, sqlite3VdbeCurrentAddr(v)+2);
61573
- sqlite3VdbeAddOp3(v, OP_Insert, pExpr->iTable, r2, r3);
61703
+ if( isRowid && sqlite3ExprIsInteger(pE2, &iValToIns) ){
61704
+ sqlite3VdbeAddOp3(v, OP_InsertInt, pExpr->iTable, r2, iValToIns);
6157461705
}else{
61575
- sqlite3VdbeAddOp4(v, OP_MakeRecord, r3, 1, r2, &affinity, 1);
61576
- sqlite3ExprCacheAffinityChange(pParse, r3, 1);
61577
- sqlite3VdbeAddOp2(v, OP_IdxInsert, pExpr->iTable, r2);
61706
+ r3 = sqlite3ExprCodeTarget(pParse, pE2, r1);
61707
+ if( isRowid ){
61708
+ sqlite3VdbeAddOp2(v, OP_MustBeInt, r3,
61709
+ sqlite3VdbeCurrentAddr(v)+2);
61710
+ sqlite3VdbeAddOp3(v, OP_Insert, pExpr->iTable, r2, r3);
61711
+ }else{
61712
+ sqlite3VdbeAddOp4(v, OP_MakeRecord, r3, 1, r2, &affinity, 1);
61713
+ sqlite3ExprCacheAffinityChange(pParse, r3, 1);
61714
+ sqlite3VdbeAddOp2(v, OP_IdxInsert, pExpr->iTable, r2);
61715
+ }
6157861716
}
6157961717
}
6158061718
sqlite3ReleaseTempReg(pParse, r1);
6158161719
sqlite3ReleaseTempReg(pParse, r2);
6158261720
}
@@ -61616,13 +61754,13 @@
6161661754
VdbeComment((v, "Init EXISTS result"));
6161761755
}
6161861756
sqlite3ExprDelete(pParse->db, pSel->pLimit);
6161961757
pSel->pLimit = sqlite3PExpr(pParse, TK_INTEGER, 0, 0, &one);
6162061758
if( sqlite3Select(pParse, pSel, &dest) ){
61621
- return;
61759
+ return 0;
6162261760
}
61623
- pExpr->iColumn = (i16)dest.iParm;
61761
+ rReg = dest.iParm;
6162461762
ExprSetIrreducible(pExpr);
6162561763
break;
6162661764
}
6162761765
}
6162861766
@@ -61629,11 +61767,11 @@
6162961767
if( testAddr ){
6163061768
sqlite3VdbeJumpHere(v, testAddr-1);
6163161769
}
6163261770
sqlite3ExprCachePop(pParse, 1);
6163361771
61634
- return;
61772
+ return rReg;
6163561773
}
6163661774
#endif /* SQLITE_OMIT_SUBQUERY */
6163761775
6163861776
/*
6163961777
** Duplicate an 8-byte value
@@ -62115,11 +62253,11 @@
6211562253
assert( !ExprHasProperty(pExpr, EP_IntValue) );
6211662254
assert( pExpr->u.zToken!=0 );
6211762255
assert( pExpr->u.zToken[0]!=0 );
6211862256
if( pExpr->u.zToken[1]==0
6211962257
&& (pOp = sqlite3VdbeGetOp(v, -1))->opcode==OP_Variable
62120
- && pOp->p1+pOp->p3==pExpr->iTable
62258
+ && pOp->p1+pOp->p3==pExpr->iColumn
6212162259
&& pOp->p2+pOp->p3==target
6212262260
&& pOp->p4.z==0
6212362261
){
6212462262
/* If the previous instruction was a copy of the previous unnamed
6212562263
** parameter into the previous register, then simply increment the
@@ -62126,11 +62264,11 @@
6212662264
** repeat count on the prior instruction rather than making a new
6212762265
** instruction.
6212862266
*/
6212962267
pOp->p3++;
6213062268
}else{
62131
- sqlite3VdbeAddOp3(v, OP_Variable, pExpr->iTable, target, 1);
62269
+ sqlite3VdbeAddOp3(v, OP_Variable, pExpr->iColumn, target, 1);
6213262270
if( pExpr->u.zToken[1]!=0 ){
6213362271
sqlite3VdbeChangeP4(v, -1, pExpr->u.zToken, 0);
6213462272
}
6213562273
}
6213662274
break;
@@ -62386,12 +62524,11 @@
6238662524
#ifndef SQLITE_OMIT_SUBQUERY
6238762525
case TK_EXISTS:
6238862526
case TK_SELECT: {
6238962527
testcase( op==TK_EXISTS );
6239062528
testcase( op==TK_SELECT );
62391
- sqlite3CodeSubselect(pParse, pExpr, 0, 0);
62392
- inReg = pExpr->iColumn;
62529
+ inReg = sqlite3CodeSubselect(pParse, pExpr, 0, 0);
6239362530
break;
6239462531
}
6239562532
case TK_IN: {
6239662533
int rNotFound = 0;
6239762534
int rMayHaveNull = 0;
@@ -62752,10 +62889,11 @@
6275262889
if( ALWAYS(pExpr->op!=TK_REGISTER) ){
6275362890
int iMem;
6275462891
iMem = ++pParse->nMem;
6275562892
sqlite3VdbeAddOp2(v, OP_Copy, inReg, iMem);
6275662893
pExpr->iTable = iMem;
62894
+ pExpr->op2 = pExpr->op;
6275762895
pExpr->op = TK_REGISTER;
6275862896
}
6275962897
return inReg;
6276062898
}
6276162899
@@ -62825,10 +62963,11 @@
6282562963
** expression.
6282662964
*/
6282762965
static int evalConstExpr(Walker *pWalker, Expr *pExpr){
6282862966
Parse *pParse = pWalker->pParse;
6282962967
switch( pExpr->op ){
62968
+ case TK_IN:
6283062969
case TK_REGISTER: {
6283162970
return WRC_Prune;
6283262971
}
6283362972
case TK_FUNCTION:
6283462973
case TK_AGG_FUNCTION:
@@ -78185,10 +78324,11 @@
7818578324
static int sqlite3Prepare(
7818678325
sqlite3 *db, /* Database handle. */
7818778326
const char *zSql, /* UTF-8 encoded SQL statement. */
7818878327
int nBytes, /* Length of zSql in bytes. */
7818978328
int saveSqlFlag, /* True to copy SQL text into the sqlite3_stmt */
78329
+ Vdbe *pReprepare, /* VM being reprepared */
7819078330
sqlite3_stmt **ppStmt, /* OUT: A pointer to the prepared statement */
7819178331
const char **pzTail /* OUT: End of parsed string */
7819278332
){
7819378333
Parse *pParse; /* Parsing context */
7819478334
char *zErrMsg = 0; /* Error message */
@@ -78199,10 +78339,11 @@
7819978339
pParse = sqlite3StackAllocZero(db, sizeof(*pParse));
7820078340
if( pParse==0 ){
7820178341
rc = SQLITE_NOMEM;
7820278342
goto end_prepare;
7820378343
}
78344
+ pParse->pReprepare = pReprepare;
7820478345
7820578346
if( sqlite3SafetyOn(db) ){
7820678347
rc = SQLITE_MISUSE;
7820778348
goto end_prepare;
7820878349
}
@@ -78356,10 +78497,11 @@
7835678497
static int sqlite3LockAndPrepare(
7835778498
sqlite3 *db, /* Database handle. */
7835878499
const char *zSql, /* UTF-8 encoded SQL statement. */
7835978500
int nBytes, /* Length of zSql in bytes. */
7836078501
int saveSqlFlag, /* True to copy SQL text into the sqlite3_stmt */
78502
+ Vdbe *pOld, /* VM being reprepared */
7836178503
sqlite3_stmt **ppStmt, /* OUT: A pointer to the prepared statement */
7836278504
const char **pzTail /* OUT: End of parsed string */
7836378505
){
7836478506
int rc;
7836578507
assert( ppStmt!=0 );
@@ -78367,14 +78509,14 @@
7836778509
if( !sqlite3SafetyCheckOk(db) ){
7836878510
return SQLITE_MISUSE;
7836978511
}
7837078512
sqlite3_mutex_enter(db->mutex);
7837178513
sqlite3BtreeEnterAll(db);
78372
- rc = sqlite3Prepare(db, zSql, nBytes, saveSqlFlag, ppStmt, pzTail);
78514
+ rc = sqlite3Prepare(db, zSql, nBytes, saveSqlFlag, pOld, ppStmt, pzTail);
7837378515
if( rc==SQLITE_SCHEMA ){
7837478516
sqlite3_finalize(*ppStmt);
78375
- rc = sqlite3Prepare(db, zSql, nBytes, saveSqlFlag, ppStmt, pzTail);
78517
+ rc = sqlite3Prepare(db, zSql, nBytes, saveSqlFlag, pOld, ppStmt, pzTail);
7837678518
}
7837778519
sqlite3BtreeLeaveAll(db);
7837878520
sqlite3_mutex_leave(db->mutex);
7837978521
return rc;
7838078522
}
@@ -78396,11 +78538,11 @@
7839678538
assert( sqlite3_mutex_held(sqlite3VdbeDb(p)->mutex) );
7839778539
zSql = sqlite3_sql((sqlite3_stmt *)p);
7839878540
assert( zSql!=0 ); /* Reprepare only called for prepare_v2() statements */
7839978541
db = sqlite3VdbeDb(p);
7840078542
assert( sqlite3_mutex_held(db->mutex) );
78401
- rc = sqlite3LockAndPrepare(db, zSql, -1, 0, &pNew, 0);
78543
+ rc = sqlite3LockAndPrepare(db, zSql, -1, 0, p, &pNew, 0);
7840278544
if( rc ){
7840378545
if( rc==SQLITE_NOMEM ){
7840478546
db->mallocFailed = 1;
7840578547
}
7840678548
assert( pNew==0 );
@@ -78430,11 +78572,11 @@
7843078572
int nBytes, /* Length of zSql in bytes. */
7843178573
sqlite3_stmt **ppStmt, /* OUT: A pointer to the prepared statement */
7843278574
const char **pzTail /* OUT: End of parsed string */
7843378575
){
7843478576
int rc;
78435
- rc = sqlite3LockAndPrepare(db,zSql,nBytes,0,ppStmt,pzTail);
78577
+ rc = sqlite3LockAndPrepare(db,zSql,nBytes,0,0,ppStmt,pzTail);
7843678578
assert( rc==SQLITE_OK || ppStmt==0 || *ppStmt==0 ); /* VERIFY: F13021 */
7843778579
return rc;
7843878580
}
7843978581
SQLITE_API int sqlite3_prepare_v2(
7844078582
sqlite3 *db, /* Database handle. */
@@ -78442,11 +78584,11 @@
7844278584
int nBytes, /* Length of zSql in bytes. */
7844378585
sqlite3_stmt **ppStmt, /* OUT: A pointer to the prepared statement */
7844478586
const char **pzTail /* OUT: End of parsed string */
7844578587
){
7844678588
int rc;
78447
- rc = sqlite3LockAndPrepare(db,zSql,nBytes,1,ppStmt,pzTail);
78589
+ rc = sqlite3LockAndPrepare(db,zSql,nBytes,1,0,ppStmt,pzTail);
7844878590
assert( rc==SQLITE_OK || ppStmt==0 || *ppStmt==0 ); /* VERIFY: F13021 */
7844978591
return rc;
7845078592
}
7845178593
7845278594
@@ -78476,11 +78618,11 @@
7847678618
return SQLITE_MISUSE;
7847778619
}
7847878620
sqlite3_mutex_enter(db->mutex);
7847978621
zSql8 = sqlite3Utf16to8(db, zSql, nBytes);
7848078622
if( zSql8 ){
78481
- rc = sqlite3LockAndPrepare(db, zSql8, -1, saveSqlFlag, ppStmt, &zTail8);
78623
+ rc = sqlite3LockAndPrepare(db, zSql8, -1, saveSqlFlag, 0, ppStmt, &zTail8);
7848278624
}
7848378625
7848478626
if( zTail8 && pzTail ){
7848578627
/* If sqlite3_prepare returns a tail pointer, we calculate the
7848678628
** equivalent pointer into the UTF-16 string by counting the unicode
@@ -78724,55 +78866,49 @@
7872478866
}
7872578867
return -1;
7872678868
}
7872778869
7872878870
/*
78729
-** Create an expression node for an identifier with the name of zName
78730
-*/
78731
-SQLITE_PRIVATE Expr *sqlite3CreateIdExpr(Parse *pParse, const char *zName){
78732
- return sqlite3Expr(pParse->db, TK_ID, zName);
78733
-}
78734
-
78735
-/*
78736
-** Add a term to the WHERE expression in *ppExpr that requires the
78737
-** zCol column to be equal in the two tables pTab1 and pTab2.
78871
+** This function is used to add terms implied by JOIN syntax to the
78872
+** WHERE clause expression of a SELECT statement. The new term, which
78873
+** is ANDed with the existing WHERE clause, is of the form:
78874
+**
78875
+** (tab1.col1 = tab2.col2)
78876
+**
78877
+** where tab1 is the iSrc'th table in SrcList pSrc and tab2 is the
78878
+** (iSrc+1)'th. Column col1 is column iColLeft of tab1, and col2 is
78879
+** column iColRight of tab2.
7873878880
*/
7873978881
static void addWhereTerm(
78740
- Parse *pParse, /* Parsing context */
78741
- const char *zCol, /* Name of the column */
78742
- const Table *pTab1, /* First table */
78743
- const char *zAlias1, /* Alias for first table. May be NULL */
78744
- const Table *pTab2, /* Second table */
78745
- const char *zAlias2, /* Alias for second table. May be NULL */
78746
- int iRightJoinTable, /* VDBE cursor for the right table */
78747
- Expr **ppExpr, /* Add the equality term to this expression */
78748
- int isOuterJoin /* True if dealing with an OUTER join */
78882
+ Parse *pParse, /* Parsing context */
78883
+ SrcList *pSrc, /* List of tables in FROM clause */
78884
+ int iSrc, /* Index of first table to join in pSrc */
78885
+ int iColLeft, /* Index of column in first table */
78886
+ int iColRight, /* Index of column in second table */
78887
+ int isOuterJoin, /* True if this is an OUTER join */
78888
+ Expr **ppWhere /* IN/OUT: The WHERE clause to add to */
7874978889
){
78750
- Expr *pE1a, *pE1b, *pE1c;
78751
- Expr *pE2a, *pE2b, *pE2c;
78752
- Expr *pE;
78753
-
78754
- pE1a = sqlite3CreateIdExpr(pParse, zCol);
78755
- pE2a = sqlite3CreateIdExpr(pParse, zCol);
78756
- if( zAlias1==0 ){
78757
- zAlias1 = pTab1->zName;
78758
- }
78759
- pE1b = sqlite3CreateIdExpr(pParse, zAlias1);
78760
- if( zAlias2==0 ){
78761
- zAlias2 = pTab2->zName;
78762
- }
78763
- pE2b = sqlite3CreateIdExpr(pParse, zAlias2);
78764
- pE1c = sqlite3PExpr(pParse, TK_DOT, pE1b, pE1a, 0);
78765
- pE2c = sqlite3PExpr(pParse, TK_DOT, pE2b, pE2a, 0);
78766
- pE = sqlite3PExpr(pParse, TK_EQ, pE1c, pE2c, 0);
78767
- if( pE && isOuterJoin ){
78768
- ExprSetProperty(pE, EP_FromJoin);
78769
- assert( !ExprHasAnyProperty(pE, EP_TokenOnly|EP_Reduced) );
78770
- ExprSetIrreducible(pE);
78771
- pE->iRightJoinTable = (i16)iRightJoinTable;
78772
- }
78773
- *ppExpr = sqlite3ExprAnd(pParse->db,*ppExpr, pE);
78890
+ sqlite3 *db = pParse->db;
78891
+ Expr *pE1;
78892
+ Expr *pE2;
78893
+ Expr *pEq;
78894
+
78895
+ assert( pSrc->nSrc>(iSrc+1) );
78896
+ assert( pSrc->a[iSrc].pTab );
78897
+ assert( pSrc->a[iSrc+1].pTab );
78898
+
78899
+ pE1 = sqlite3CreateColumnExpr(db, pSrc, iSrc, iColLeft);
78900
+ pE2 = sqlite3CreateColumnExpr(db, pSrc, iSrc+1, iColRight);
78901
+
78902
+ pEq = sqlite3PExpr(pParse, TK_EQ, pE1, pE2, 0);
78903
+ if( pEq && isOuterJoin ){
78904
+ ExprSetProperty(pEq, EP_FromJoin);
78905
+ assert( !ExprHasAnyProperty(pEq, EP_TokenOnly|EP_Reduced) );
78906
+ ExprSetIrreducible(pEq);
78907
+ pEq->iRightJoinTable = (i16)pE2->iTable;
78908
+ }
78909
+ *ppWhere = sqlite3ExprAnd(db, *ppWhere, pEq);
7877478910
}
7877578911
7877678912
/*
7877778913
** Set the EP_FromJoin property on all terms of the given expression.
7877878914
** And set the Expr.iRightJoinTable to iTable for every term in the
@@ -78850,15 +78986,13 @@
7885078986
"an ON or USING clause", 0);
7885178987
return 1;
7885278988
}
7885378989
for(j=0; j<pLeftTab->nCol; j++){
7885478990
char *zName = pLeftTab->aCol[j].zName;
78855
- if( columnIndex(pRightTab, zName)>=0 ){
78856
- addWhereTerm(pParse, zName, pLeftTab, pLeft->zAlias,
78857
- pRightTab, pRight->zAlias,
78858
- pRight->iCursor, &p->pWhere, isOuter);
78859
-
78991
+ int iRightCol = columnIndex(pRightTab, zName);
78992
+ if( iRightCol>=0 ){
78993
+ addWhereTerm(pParse, pSrc, i, j, iRightCol, isOuter, &p->pWhere);
7886078994
}
7886178995
}
7886278996
}
7886378997
7886478998
/* Disallow both ON and USING clauses in the same join
@@ -78887,18 +79021,18 @@
7888779021
*/
7888879022
if( pRight->pUsing ){
7888979023
IdList *pList = pRight->pUsing;
7889079024
for(j=0; j<pList->nId; j++){
7889179025
char *zName = pList->a[j].zName;
78892
- if( columnIndex(pLeftTab, zName)<0 || columnIndex(pRightTab, zName)<0 ){
79026
+ int iLeftCol = columnIndex(pLeftTab, zName);
79027
+ int iRightCol = columnIndex(pRightTab, zName);
79028
+ if( iLeftCol<0 || iRightCol<0 ){
7889379029
sqlite3ErrorMsg(pParse, "cannot join using column %s - column "
7889479030
"not present in both tables", zName);
7889579031
return 1;
7889679032
}
78897
- addWhereTerm(pParse, zName, pLeftTab, pLeft->zAlias,
78898
- pRightTab, pRight->zAlias,
78899
- pRight->iCursor, &p->pWhere, isOuter);
79033
+ addWhereTerm(pParse, pSrc, i, iLeftCol, iRightCol, isOuter, &p->pWhere);
7890079034
}
7890179035
}
7890279036
}
7890379037
return 0;
7890479038
}
@@ -84635,22 +84769,21 @@
8463584769
SelectDest dest;
8463684770
8463784771
/* Construct the SELECT statement that will find the new values for
8463884772
** all updated rows.
8463984773
*/
84640
- pEList = sqlite3ExprListAppend(pParse, 0,
84641
- sqlite3CreateIdExpr(pParse, "_rowid_"));
84774
+ pEList = sqlite3ExprListAppend(pParse, 0, sqlite3Expr(db, TK_ID, "_rowid_"));
8464284775
if( pRowid ){
8464384776
pEList = sqlite3ExprListAppend(pParse, pEList,
8464484777
sqlite3ExprDup(db, pRowid, 0));
8464584778
}
8464684779
assert( pTab->iPKey<0 );
8464784780
for(i=0; i<pTab->nCol; i++){
8464884781
if( aXRef[i]>=0 ){
8464984782
pExpr = sqlite3ExprDup(db, pChanges->a[aXRef[i]].pExpr, 0);
8465084783
}else{
84651
- pExpr = sqlite3CreateIdExpr(pParse, pTab->aCol[i].zName);
84784
+ pExpr = sqlite3Expr(db, TK_ID, pTab->aCol[i].zName);
8465284785
}
8465384786
pEList = sqlite3ExprListAppend(pParse, pEList, pExpr);
8465484787
}
8465584788
pSelect = sqlite3SelectNew(pParse, pEList, pSrc, pWhere, 0, 0, 0, 0, 0, 0);
8465684789
@@ -84816,10 +84949,16 @@
8481684949
rc = execSql(db, zSql);
8481784950
if( rc!=SQLITE_OK ) goto end_of_vacuum;
8481884951
pDb = &db->aDb[db->nDb-1];
8481984952
assert( strcmp(db->aDb[db->nDb-1].zName,"vacuum_db")==0 );
8482084953
pTemp = db->aDb[db->nDb-1].pBt;
84954
+
84955
+ /* The call to execSql() to attach the temp database has left the file
84956
+ ** locked (as there was more than one active statement when the transaction
84957
+ ** to read the schema was concluded. Unlock it here so that this doesn't
84958
+ ** cause problems for the call to BtreeSetPageSize() below. */
84959
+ sqlite3BtreeCommit(pTemp);
8482184960
8482284961
nRes = sqlite3BtreeGetReserve(pMain);
8482384962
8482484963
/* A VACUUM cannot change the pagesize of an encrypted database. */
8482584964
#ifdef SQLITE_HAS_CODEC
@@ -84870,17 +85009,17 @@
8487085009
"SELECT 'CREATE UNIQUE INDEX vacuum_db.' || substr(sql,21) "
8487185010
" FROM sqlite_master WHERE sql LIKE 'CREATE UNIQUE INDEX %'");
8487285011
if( rc!=SQLITE_OK ) goto end_of_vacuum;
8487385012
8487485013
/* Loop through the tables in the main database. For each, do
84875
- ** an "INSERT INTO vacuum_db.xxx SELECT * FROM xxx;" to copy
85014
+ ** an "INSERT INTO vacuum_db.xxx SELECT * FROM main.xxx;" to copy
8487685015
** the contents to the temporary database.
8487785016
*/
8487885017
rc = execExecSql(db,
8487985018
"SELECT 'INSERT INTO vacuum_db.' || quote(name) "
84880
- "|| ' SELECT * FROM ' || quote(name) || ';'"
84881
- "FROM sqlite_master "
85019
+ "|| ' SELECT * FROM main.' || quote(name) || ';'"
85020
+ "FROM main.sqlite_master "
8488285021
"WHERE type = 'table' AND name!='sqlite_sequence' "
8488385022
" AND rootpage>0"
8488485023
8488585024
);
8488685025
if( rc!=SQLITE_OK ) goto end_of_vacuum;
@@ -84892,11 +85031,11 @@
8489285031
"FROM vacuum_db.sqlite_master WHERE name='sqlite_sequence' "
8489385032
);
8489485033
if( rc!=SQLITE_OK ) goto end_of_vacuum;
8489585034
rc = execExecSql(db,
8489685035
"SELECT 'INSERT INTO vacuum_db.' || quote(name) "
84897
- "|| ' SELECT * FROM ' || quote(name) || ';' "
85036
+ "|| ' SELECT * FROM main.' || quote(name) || ';' "
8489885037
"FROM vacuum_db.sqlite_master WHERE name=='sqlite_sequence';"
8489985038
);
8490085039
if( rc!=SQLITE_OK ) goto end_of_vacuum;
8490185040
8490285041
@@ -84906,11 +85045,11 @@
8490685045
** from the SQLITE_MASTER table.
8490785046
*/
8490885047
rc = execSql(db,
8490985048
"INSERT INTO vacuum_db.sqlite_master "
8491085049
" SELECT type, name, tbl_name, rootpage, sql"
84911
- " FROM sqlite_master"
85050
+ " FROM main.sqlite_master"
8491285051
" WHERE type='view' OR type='trigger'"
8491385052
" OR (type='table' AND rootpage=0)"
8491485053
);
8491585054
if( rc ) goto end_of_vacuum;
8491685055
@@ -86580,59 +86719,103 @@
8658086719
** literal that does not begin with a wildcard.
8658186720
*/
8658286721
static int isLikeOrGlob(
8658386722
Parse *pParse, /* Parsing and code generating context */
8658486723
Expr *pExpr, /* Test this expression */
86585
- int *pnPattern, /* Number of non-wildcard prefix characters */
86724
+ Expr **ppPrefix, /* Pointer to TK_STRING expression with pattern prefix */
8658686725
int *pisComplete, /* True if the only wildcard is % in the last character */
8658786726
int *pnoCase /* True if uppercase is equivalent to lowercase */
8658886727
){
86589
- const char *z; /* String on RHS of LIKE operator */
86728
+ const char *z = 0; /* String on RHS of LIKE operator */
8659086729
Expr *pRight, *pLeft; /* Right and left size of LIKE operator */
8659186730
ExprList *pList; /* List of operands to the LIKE operator */
8659286731
int c; /* One character in z[] */
8659386732
int cnt; /* Number of non-wildcard prefix characters */
8659486733
char wc[3]; /* Wildcard characters */
8659586734
CollSeq *pColl; /* Collating sequence for LHS */
8659686735
sqlite3 *db = pParse->db; /* Database connection */
86736
+ sqlite3_value *pVal = 0;
86737
+ int op; /* Opcode of pRight */
8659786738
8659886739
if( !sqlite3IsLikeFunction(db, pExpr, pnoCase, wc) ){
8659986740
return 0;
8660086741
}
8660186742
#ifdef SQLITE_EBCDIC
8660286743
if( *pnoCase ) return 0;
8660386744
#endif
8660486745
pList = pExpr->x.pList;
86605
- pRight = pList->a[0].pExpr;
86606
- if( pRight->op!=TK_STRING ){
86607
- return 0;
86608
- }
8660986746
pLeft = pList->a[1].pExpr;
86610
- if( pLeft->op!=TK_COLUMN ){
86747
+ if( pLeft->op!=TK_COLUMN || sqlite3ExprAffinity(pLeft)!=SQLITE_AFF_TEXT ){
86748
+ /* IMP: R-02065-49465 The left-hand side of the LIKE or GLOB operator must
86749
+ ** be the name of an indexed column with TEXT affinity. */
8661186750
return 0;
8661286751
}
86752
+ assert( pLeft->iColumn!=(-1) ); /* Because IPK never has AFF_TEXT */
8661386753
pColl = sqlite3ExprCollSeq(pParse, pLeft);
86614
- assert( pColl!=0 || pLeft->iColumn==-1 );
86615
- if( pColl==0 ) return 0;
86754
+ assert( pColl!=0 ); /* Every non-IPK column has a collating sequence */
8661686755
if( (pColl->type!=SQLITE_COLL_BINARY || *pnoCase) &&
8661786756
(pColl->type!=SQLITE_COLL_NOCASE || !*pnoCase) ){
86757
+ /* IMP: R-09003-32046 For the GLOB operator, the column must use the
86758
+ ** default BINARY collating sequence.
86759
+ ** IMP: R-41408-28306 For the LIKE operator, if case_sensitive_like mode
86760
+ ** is enabled then the column must use the default BINARY collating
86761
+ ** sequence, or if case_sensitive_like mode is disabled then the column
86762
+ ** must use the built-in NOCASE collating sequence.
86763
+ */
8661886764
return 0;
8661986765
}
86620
- if( sqlite3ExprAffinity(pLeft)!=SQLITE_AFF_TEXT ) return 0;
86621
- z = pRight->u.zToken;
86622
- if( ALWAYS(z) ){
86766
+
86767
+ pRight = pList->a[0].pExpr;
86768
+ op = pRight->op;
86769
+ if( op==TK_REGISTER ){
86770
+ op = pRight->op2;
86771
+ }
86772
+ if( op==TK_VARIABLE ){
86773
+ Vdbe *pReprepare = pParse->pReprepare;
86774
+ pVal = sqlite3VdbeGetValue(pReprepare, pRight->iColumn, SQLITE_AFF_NONE);
86775
+ if( pVal && sqlite3_value_type(pVal)==SQLITE_TEXT ){
86776
+ z = (char *)sqlite3_value_text(pVal);
86777
+ }
86778
+ sqlite3VdbeSetVarmask(pParse->pVdbe, pRight->iColumn);
86779
+ assert( pRight->op==TK_VARIABLE || pRight->op==TK_REGISTER );
86780
+ }else if( op==TK_STRING ){
86781
+ z = pRight->u.zToken;
86782
+ }
86783
+ if( z ){
8662386784
cnt = 0;
8662486785
while( (c=z[cnt])!=0 && c!=wc[0] && c!=wc[1] && c!=wc[2] ){
8662586786
cnt++;
8662686787
}
8662786788
if( cnt!=0 && c!=0 && 255!=(u8)z[cnt-1] ){
86789
+ Expr *pPrefix;
8662886790
*pisComplete = z[cnt]==wc[0] && z[cnt+1]==0;
86629
- *pnPattern = cnt;
86630
- return 1;
86791
+ pPrefix = sqlite3Expr(db, TK_STRING, z);
86792
+ if( pPrefix ) pPrefix->u.zToken[cnt] = 0;
86793
+ *ppPrefix = pPrefix;
86794
+ if( op==TK_VARIABLE ){
86795
+ Vdbe *v = pParse->pVdbe;
86796
+ sqlite3VdbeSetVarmask(v, pRight->iColumn);
86797
+ if( *pisComplete && pRight->u.zToken[1] ){
86798
+ /* If the rhs of the LIKE expression is a variable, and the current
86799
+ ** value of the variable means there is no need to invoke the LIKE
86800
+ ** function, then no OP_Variable will be added to the program.
86801
+ ** This causes problems for the sqlite3_bind_parameter_name()
86802
+ ** API. To workaround them, add a dummy OP_Variable here.
86803
+ */
86804
+ int r1 = sqlite3GetTempReg(pParse);
86805
+ sqlite3ExprCodeTarget(pParse, pRight, r1);
86806
+ sqlite3VdbeChangeP3(v, sqlite3VdbeCurrentAddr(v)-1, 0);
86807
+ sqlite3ReleaseTempReg(pParse, r1);
86808
+ }
86809
+ }
86810
+ }else{
86811
+ z = 0;
8663186812
}
8663286813
}
86633
- return 0;
86814
+
86815
+ sqlite3ValueFree(pVal);
86816
+ return (z!=0);
8663486817
}
8663586818
#endif /* SQLITE_OMIT_LIKE_OPTIMIZATION */
8663686819
8663786820
8663886821
#ifndef SQLITE_OMIT_VIRTUALTABLE
@@ -87009,14 +87192,14 @@
8700987192
WhereTerm *pTerm; /* The term to be analyzed */
8701087193
WhereMaskSet *pMaskSet; /* Set of table index masks */
8701187194
Expr *pExpr; /* The expression to be analyzed */
8701287195
Bitmask prereqLeft; /* Prerequesites of the pExpr->pLeft */
8701387196
Bitmask prereqAll; /* Prerequesites of pExpr */
87014
- Bitmask extraRight = 0;
87015
- int nPattern;
87016
- int isComplete;
87017
- int noCase;
87197
+ Bitmask extraRight = 0; /* */
87198
+ Expr *pStr1 = 0; /* RHS of LIKE/GLOB operator */
87199
+ int isComplete = 0; /* RHS of LIKE/GLOB ends with wildcard */
87200
+ int noCase = 0; /* LIKE/GLOB distinguishes case */
8701887201
int op; /* Top-level operator. pExpr->op */
8701987202
Parse *pParse = pWC->pParse; /* Parsing context */
8702087203
sqlite3 *db = pParse->db; /* Database connection */
8702187204
8702287205
if( db->mallocFailed ){
@@ -87147,25 +87330,25 @@
8714787330
** x>='abc' AND x<'abd' AND x LIKE 'abc%'
8714887331
**
8714987332
** The last character of the prefix "abc" is incremented to form the
8715087333
** termination condition "abd".
8715187334
*/
87152
- if( isLikeOrGlob(pParse, pExpr, &nPattern, &isComplete, &noCase)
87153
- && pWC->op==TK_AND ){
87154
- Expr *pLeft, *pRight;
87155
- Expr *pStr1, *pStr2;
87156
- Expr *pNewExpr1, *pNewExpr2;
87157
- int idxNew1, idxNew2;
87335
+ if( pWC->op==TK_AND
87336
+ && isLikeOrGlob(pParse, pExpr, &pStr1, &isComplete, &noCase)
87337
+ ){
87338
+ Expr *pLeft; /* LHS of LIKE/GLOB operator */
87339
+ Expr *pStr2; /* Copy of pStr1 - RHS of LIKE/GLOB operator */
87340
+ Expr *pNewExpr1;
87341
+ Expr *pNewExpr2;
87342
+ int idxNew1;
87343
+ int idxNew2;
8715887344
8715987345
pLeft = pExpr->x.pList->a[1].pExpr;
87160
- pRight = pExpr->x.pList->a[0].pExpr;
87161
- pStr1 = sqlite3Expr(db, TK_STRING, pRight->u.zToken);
87162
- if( pStr1 ) pStr1->u.zToken[nPattern] = 0;
8716387346
pStr2 = sqlite3ExprDup(db, pStr1, 0);
8716487347
if( !db->mallocFailed ){
8716587348
u8 c, *pC; /* Last character before the first wildcard */
87166
- pC = (u8*)&pStr2->u.zToken[nPattern-1];
87349
+ pC = (u8*)&pStr2->u.zToken[sqlite3Strlen30(pStr2->u.zToken)-1];
8716787350
c = *pC;
8716887351
if( noCase ){
8716987352
/* The point is to increment the last character before the first
8717087353
** wildcard. But if we increment '@', that will push it into the
8717187354
** alphabetic range where case conversions will mess up the
@@ -87939,10 +88122,46 @@
8793988122
}
8794088123
return SQLITE_OK;
8794188124
}
8794288125
#endif /* #ifdef SQLITE_ENABLE_STAT2 */
8794388126
88127
+/*
88128
+** If expression pExpr represents a literal value, set *pp to point to
88129
+** an sqlite3_value structure containing the same value, with affinity
88130
+** aff applied to it, before returning. It is the responsibility of the
88131
+** caller to eventually release this structure by passing it to
88132
+** sqlite3ValueFree().
88133
+**
88134
+** If the current parse is a recompile (sqlite3Reprepare()) and pExpr
88135
+** is an SQL variable that currently has a non-NULL value bound to it,
88136
+** create an sqlite3_value structure containing this value, again with
88137
+** affinity aff applied to it, instead.
88138
+**
88139
+** If neither of the above apply, set *pp to NULL.
88140
+**
88141
+** If an error occurs, return an error code. Otherwise, SQLITE_OK.
88142
+*/
88143
+#ifdef SQLITE_ENABLE_STAT2
88144
+static int valueFromExpr(
88145
+ Parse *pParse,
88146
+ Expr *pExpr,
88147
+ u8 aff,
88148
+ sqlite3_value **pp
88149
+){
88150
+ /* The evalConstExpr() function will have already converted any TK_VARIABLE
88151
+ ** expression involved in an comparison into a TK_REGISTER. */
88152
+ assert( pExpr->op!=TK_VARIABLE );
88153
+ if( pExpr->op==TK_REGISTER && pExpr->op2==TK_VARIABLE ){
88154
+ int iVar = pExpr->iColumn;
88155
+ sqlite3VdbeSetVarmask(pParse->pVdbe, iVar);
88156
+ *pp = sqlite3VdbeGetValue(pParse->pReprepare, iVar, aff);
88157
+ return SQLITE_OK;
88158
+ }
88159
+ return sqlite3ValueFromExpr(pParse->db, pExpr, SQLITE_UTF8, aff, pp);
88160
+}
88161
+#endif
88162
+
8794488163
/*
8794588164
** This function is used to estimate the number of rows that will be visited
8794688165
** by scanning an index for a range of values. The range may have an upper
8794788166
** bound, a lower bound, or both. The WHERE clause terms that set the upper
8794888167
** and lower bounds are represented by pLower and pUpper respectively. For
@@ -87991,27 +88210,26 @@
8799188210
int *piEst /* OUT: Return value */
8799288211
){
8799388212
int rc = SQLITE_OK;
8799488213
8799588214
#ifdef SQLITE_ENABLE_STAT2
87996
- sqlite3 *db = pParse->db;
87997
- sqlite3_value *pLowerVal = 0;
87998
- sqlite3_value *pUpperVal = 0;
8799988215
8800088216
if( nEq==0 && p->aSample ){
88217
+ sqlite3_value *pLowerVal = 0;
88218
+ sqlite3_value *pUpperVal = 0;
8800188219
int iEst;
8800288220
int iLower = 0;
8800388221
int iUpper = SQLITE_INDEX_SAMPLES;
88004
- u8 aff = p->pTable->aCol[0].affinity;
88222
+ u8 aff = p->pTable->aCol[p->aiColumn[0]].affinity;
8800588223
8800688224
if( pLower ){
8800788225
Expr *pExpr = pLower->pExpr->pRight;
88008
- rc = sqlite3ValueFromExpr(db, pExpr, SQLITE_UTF8, aff, &pLowerVal);
88226
+ rc = valueFromExpr(pParse, pExpr, aff, &pLowerVal);
8800988227
}
8801088228
if( rc==SQLITE_OK && pUpper ){
8801188229
Expr *pExpr = pUpper->pExpr->pRight;
88012
- rc = sqlite3ValueFromExpr(db, pExpr, SQLITE_UTF8, aff, &pUpperVal);
88230
+ rc = valueFromExpr(pParse, pExpr, aff, &pUpperVal);
8801388231
}
8801488232
8801588233
if( rc!=SQLITE_OK || (pLowerVal==0 && pUpperVal==0) ){
8801688234
sqlite3ValueFree(pLowerVal);
8801788235
sqlite3ValueFree(pUpperVal);
@@ -90177,469 +90395,469 @@
9017790395
** yy_reduce_ofst[] For each state, the offset into yy_action for
9017890396
** shifting non-terminals after a reduce.
9017990397
** yy_default[] Default action for each state.
9018090398
*/
9018190399
static const YYACTIONTYPE yy_action[] = {
90182
- /* 0 */ 312, 959, 182, 628, 2, 157, 219, 450, 24, 24,
90183
- /* 10 */ 24, 24, 221, 26, 26, 26, 26, 27, 27, 28,
90184
- /* 20 */ 28, 28, 29, 221, 424, 425, 30, 492, 33, 141,
90185
- /* 30 */ 457, 463, 31, 26, 26, 26, 26, 27, 27, 28,
90186
- /* 40 */ 28, 28, 29, 221, 28, 28, 28, 29, 221, 23,
90187
- /* 50 */ 22, 32, 465, 466, 464, 464, 25, 25, 24, 24,
90188
- /* 60 */ 24, 24, 293, 26, 26, 26, 26, 27, 27, 28,
90189
- /* 70 */ 28, 28, 29, 221, 312, 450, 319, 479, 344, 208,
90190
- /* 80 */ 47, 26, 26, 26, 26, 27, 27, 28, 28, 28,
90191
- /* 90 */ 29, 221, 427, 428, 163, 339, 543, 368, 371, 372,
90192
- /* 100 */ 521, 317, 472, 473, 457, 463, 296, 373, 294, 21,
90193
- /* 110 */ 336, 367, 419, 416, 424, 425, 523, 1, 544, 446,
90194
- /* 120 */ 80, 424, 425, 23, 22, 32, 465, 466, 464, 464,
90195
- /* 130 */ 25, 25, 24, 24, 24, 24, 564, 26, 26, 26,
90196
- /* 140 */ 26, 27, 27, 28, 28, 28, 29, 221, 312, 233,
90197
- /* 150 */ 319, 441, 554, 152, 139, 263, 365, 268, 366, 160,
90198
- /* 160 */ 551, 352, 332, 421, 222, 272, 362, 322, 218, 557,
90199
- /* 170 */ 116, 339, 248, 574, 477, 223, 216, 573, 457, 463,
90200
- /* 180 */ 450, 59, 427, 428, 295, 610, 336, 563, 538, 427,
90201
- /* 190 */ 428, 385, 608, 609, 562, 446, 87, 23, 22, 32,
90202
- /* 200 */ 465, 466, 464, 464, 25, 25, 24, 24, 24, 24,
90203
- /* 210 */ 447, 26, 26, 26, 26, 27, 27, 28, 28, 28,
90204
- /* 220 */ 29, 221, 312, 233, 477, 223, 576, 134, 139, 263,
90205
- /* 230 */ 365, 268, 366, 160, 406, 354, 226, 498, 481, 272,
90206
- /* 240 */ 339, 27, 27, 28, 28, 28, 29, 221, 450, 442,
90207
- /* 250 */ 199, 540, 457, 463, 349, 336, 163, 551, 66, 368,
90208
- /* 260 */ 371, 372, 450, 415, 446, 80, 522, 581, 401, 373,
90209
- /* 270 */ 452, 23, 22, 32, 465, 466, 464, 464, 25, 25,
90210
- /* 280 */ 24, 24, 24, 24, 447, 26, 26, 26, 26, 27,
90211
- /* 290 */ 27, 28, 28, 28, 29, 221, 312, 339, 556, 607,
90212
- /* 300 */ 197, 454, 454, 454, 546, 578, 352, 198, 607, 440,
90213
- /* 310 */ 65, 351, 336, 426, 426, 399, 289, 424, 425, 606,
90214
- /* 320 */ 605, 446, 73, 426, 214, 219, 457, 463, 606, 410,
90215
- /* 330 */ 450, 241, 306, 196, 565, 479, 555, 208, 288, 29,
90216
- /* 340 */ 221, 447, 4, 874, 504, 23, 22, 32, 465, 466,
90217
- /* 350 */ 464, 464, 25, 25, 24, 24, 24, 24, 447, 26,
90218
- /* 360 */ 26, 26, 26, 27, 27, 28, 28, 28, 29, 221,
90219
- /* 370 */ 312, 163, 582, 339, 368, 371, 372, 314, 424, 425,
90220
- /* 380 */ 604, 222, 397, 227, 373, 427, 428, 339, 336, 409,
90221
- /* 390 */ 222, 478, 339, 30, 396, 33, 141, 446, 81, 62,
90222
- /* 400 */ 457, 463, 336, 157, 400, 450, 504, 336, 438, 426,
90223
- /* 410 */ 500, 446, 87, 41, 380, 613, 446, 80, 581, 23,
90224
- /* 420 */ 22, 32, 465, 466, 464, 464, 25, 25, 24, 24,
90225
- /* 430 */ 24, 24, 213, 26, 26, 26, 26, 27, 27, 28,
90226
- /* 440 */ 28, 28, 29, 221, 312, 513, 427, 428, 517, 254,
90227
- /* 450 */ 524, 386, 225, 339, 486, 363, 389, 339, 356, 443,
90228
- /* 460 */ 494, 236, 30, 497, 33, 141, 399, 289, 336, 495,
90229
- /* 470 */ 487, 501, 336, 450, 457, 463, 219, 446, 95, 445,
90230
- /* 480 */ 68, 446, 95, 444, 424, 425, 488, 44, 348, 288,
90231
- /* 490 */ 504, 424, 425, 23, 22, 32, 465, 466, 464, 464,
90232
- /* 500 */ 25, 25, 24, 24, 24, 24, 391, 26, 26, 26,
90233
- /* 510 */ 26, 27, 27, 28, 28, 28, 29, 221, 312, 361,
90234
- /* 520 */ 556, 426, 520, 328, 191, 271, 339, 329, 247, 259,
90235
- /* 530 */ 339, 566, 65, 249, 336, 426, 424, 425, 445, 516,
90236
- /* 540 */ 426, 336, 444, 446, 9, 336, 556, 451, 457, 463,
90237
- /* 550 */ 446, 74, 427, 428, 446, 69, 192, 618, 65, 427,
90238
- /* 560 */ 428, 426, 323, 277, 16, 202, 189, 23, 22, 32,
90239
- /* 570 */ 465, 466, 464, 464, 25, 25, 24, 24, 24, 24,
90240
- /* 580 */ 255, 26, 26, 26, 26, 27, 27, 28, 28, 28,
90241
- /* 590 */ 29, 221, 312, 339, 486, 426, 537, 235, 515, 447,
90242
- /* 600 */ 339, 629, 419, 416, 427, 428, 217, 281, 336, 279,
90243
- /* 610 */ 487, 203, 144, 526, 527, 336, 391, 446, 78, 429,
90244
- /* 620 */ 430, 431, 457, 463, 446, 99, 488, 341, 528, 468,
90245
- /* 630 */ 468, 426, 343, 472, 473, 626, 949, 474, 949, 529,
90246
- /* 640 */ 447, 23, 22, 32, 465, 466, 464, 464, 25, 25,
90247
- /* 650 */ 24, 24, 24, 24, 339, 26, 26, 26, 26, 27,
90248
- /* 660 */ 27, 28, 28, 28, 29, 221, 312, 339, 162, 336,
90249
- /* 670 */ 275, 283, 476, 376, 339, 579, 527, 346, 446, 98,
90250
- /* 680 */ 622, 30, 336, 33, 141, 339, 426, 339, 508, 336,
90251
- /* 690 */ 469, 446, 105, 418, 2, 222, 457, 463, 446, 101,
90252
- /* 700 */ 336, 219, 336, 426, 161, 626, 948, 290, 948, 446,
90253
- /* 710 */ 108, 446, 109, 398, 284, 23, 22, 32, 465, 466,
90254
- /* 720 */ 464, 464, 25, 25, 24, 24, 24, 24, 339, 26,
90255
- /* 730 */ 26, 26, 26, 27, 27, 28, 28, 28, 29, 221,
90256
- /* 740 */ 312, 339, 271, 336, 339, 58, 535, 482, 143, 339,
90257
- /* 750 */ 622, 318, 446, 133, 408, 257, 336, 426, 321, 336,
90258
- /* 760 */ 357, 339, 272, 426, 336, 446, 135, 184, 446, 61,
90259
- /* 770 */ 457, 463, 219, 446, 106, 426, 336, 493, 341, 234,
90260
- /* 780 */ 468, 468, 621, 310, 407, 446, 102, 209, 144, 23,
90261
- /* 790 */ 22, 32, 465, 466, 464, 464, 25, 25, 24, 24,
90262
- /* 800 */ 24, 24, 339, 26, 26, 26, 26, 27, 27, 28,
90263
- /* 810 */ 28, 28, 29, 221, 312, 339, 271, 336, 339, 341,
90264
- /* 820 */ 538, 468, 468, 572, 383, 496, 446, 79, 499, 549,
90265
- /* 830 */ 336, 426, 508, 336, 508, 341, 339, 468, 468, 446,
90266
- /* 840 */ 103, 391, 446, 70, 457, 463, 572, 426, 40, 426,
90267
- /* 850 */ 42, 336, 220, 324, 504, 341, 426, 468, 468, 18,
90268
- /* 860 */ 446, 100, 266, 23, 22, 32, 465, 466, 464, 464,
90269
- /* 870 */ 25, 25, 24, 24, 24, 24, 339, 26, 26, 26,
90270
- /* 880 */ 26, 27, 27, 28, 28, 28, 29, 221, 312, 339,
90271
- /* 890 */ 283, 336, 339, 261, 548, 384, 339, 327, 142, 550,
90272
- /* 900 */ 446, 136, 475, 475, 336, 426, 185, 336, 499, 396,
90273
- /* 910 */ 339, 336, 370, 446, 137, 256, 446, 138, 457, 463,
90274
- /* 920 */ 446, 71, 499, 360, 426, 336, 161, 311, 623, 215,
90275
- /* 930 */ 426, 359, 237, 412, 446, 82, 200, 23, 34, 32,
90276
- /* 940 */ 465, 466, 464, 464, 25, 25, 24, 24, 24, 24,
90277
- /* 950 */ 339, 26, 26, 26, 26, 27, 27, 28, 28, 28,
90278
- /* 960 */ 29, 221, 312, 447, 271, 336, 339, 271, 340, 210,
90279
- /* 970 */ 447, 172, 625, 211, 446, 83, 240, 552, 142, 426,
90280
- /* 980 */ 321, 336, 426, 426, 339, 414, 331, 181, 458, 459,
90281
- /* 990 */ 446, 72, 457, 463, 470, 506, 67, 158, 394, 336,
90282
- /* 1000 */ 587, 325, 499, 447, 326, 311, 624, 447, 446, 84,
90283
- /* 1010 */ 461, 462, 22, 32, 465, 466, 464, 464, 25, 25,
90284
- /* 1020 */ 24, 24, 24, 24, 339, 26, 26, 26, 26, 27,
90285
- /* 1030 */ 27, 28, 28, 28, 29, 221, 312, 460, 339, 336,
90286
- /* 1040 */ 339, 283, 423, 393, 532, 533, 204, 205, 446, 85,
90287
- /* 1050 */ 625, 392, 547, 336, 162, 336, 426, 426, 339, 435,
90288
- /* 1060 */ 436, 339, 446, 104, 446, 86, 457, 463, 264, 291,
90289
- /* 1070 */ 274, 49, 162, 336, 426, 426, 336, 297, 265, 542,
90290
- /* 1080 */ 541, 405, 446, 88, 594, 446, 89, 32, 465, 466,
90291
- /* 1090 */ 464, 464, 25, 25, 24, 24, 24, 24, 600, 26,
90292
- /* 1100 */ 26, 26, 26, 27, 27, 28, 28, 28, 29, 221,
90293
- /* 1110 */ 36, 345, 339, 3, 214, 8, 422, 335, 425, 437,
90294
- /* 1120 */ 375, 148, 162, 36, 345, 339, 3, 336, 342, 432,
90295
- /* 1130 */ 335, 425, 149, 577, 426, 162, 446, 90, 151, 339,
90296
- /* 1140 */ 336, 342, 434, 339, 283, 433, 333, 347, 447, 446,
90297
- /* 1150 */ 75, 588, 6, 158, 336, 448, 140, 481, 336, 426,
90298
- /* 1160 */ 347, 453, 334, 446, 76, 49, 350, 446, 91, 7,
90299
- /* 1170 */ 481, 426, 397, 283, 355, 250, 426, 39, 38, 251,
90300
- /* 1180 */ 339, 426, 48, 353, 37, 337, 338, 596, 426, 452,
90301
- /* 1190 */ 39, 38, 514, 252, 390, 336, 20, 37, 337, 338,
90302
- /* 1200 */ 253, 43, 452, 206, 446, 92, 219, 449, 242, 243,
90303
- /* 1210 */ 244, 150, 246, 283, 491, 593, 597, 490, 224, 258,
90304
- /* 1220 */ 454, 454, 454, 455, 456, 10, 503, 183, 426, 178,
90305
- /* 1230 */ 156, 301, 426, 454, 454, 454, 455, 456, 10, 339,
90306
- /* 1240 */ 302, 426, 36, 345, 50, 3, 339, 505, 260, 335,
90307
- /* 1250 */ 425, 262, 339, 176, 336, 581, 598, 358, 364, 175,
90308
- /* 1260 */ 342, 336, 177, 446, 93, 46, 345, 336, 3, 339,
90309
- /* 1270 */ 446, 94, 335, 425, 525, 339, 446, 77, 320, 347,
90310
- /* 1280 */ 511, 339, 507, 342, 336, 589, 601, 56, 56, 481,
90311
- /* 1290 */ 336, 512, 283, 446, 17, 531, 336, 426, 530, 446,
90312
- /* 1300 */ 96, 534, 347, 404, 298, 446, 97, 426, 313, 39,
90313
- /* 1310 */ 38, 267, 481, 219, 535, 536, 37, 337, 338, 283,
90314
- /* 1320 */ 620, 452, 309, 283, 111, 19, 288, 509, 269, 424,
90315
- /* 1330 */ 425, 539, 39, 38, 426, 238, 270, 411, 426, 37,
90316
- /* 1340 */ 337, 338, 426, 426, 452, 558, 426, 307, 231, 276,
90317
- /* 1350 */ 278, 426, 454, 454, 454, 455, 456, 10, 553, 280,
90318
- /* 1360 */ 426, 559, 239, 230, 426, 426, 299, 282, 287, 481,
90319
- /* 1370 */ 560, 388, 584, 232, 426, 454, 454, 454, 455, 456,
90320
- /* 1380 */ 10, 561, 426, 426, 585, 395, 426, 426, 292, 194,
90321
- /* 1390 */ 195, 592, 603, 300, 303, 308, 377, 522, 381, 426,
90322
- /* 1400 */ 426, 452, 567, 426, 304, 617, 426, 426, 426, 426,
90323
- /* 1410 */ 379, 53, 147, 165, 166, 167, 580, 212, 569, 426,
90324
- /* 1420 */ 426, 285, 168, 570, 387, 120, 123, 187, 590, 402,
90325
- /* 1430 */ 403, 125, 454, 454, 454, 330, 599, 614, 186, 126,
90326
- /* 1440 */ 127, 128, 615, 616, 57, 60, 619, 107, 229, 64,
90327
- /* 1450 */ 115, 420, 245, 130, 439, 180, 315, 207, 670, 316,
90328
- /* 1460 */ 671, 467, 672, 153, 154, 35, 483, 471, 480, 188,
90329
- /* 1470 */ 201, 155, 484, 5, 485, 489, 12, 502, 45, 11,
90330
- /* 1480 */ 110, 145, 518, 519, 510, 228, 51, 112, 369, 273,
90331
- /* 1490 */ 113, 159, 545, 52, 374, 114, 164, 265, 378, 190,
90332
- /* 1500 */ 146, 568, 117, 158, 286, 382, 169, 119, 15, 583,
90333
- /* 1510 */ 170, 171, 121, 586, 122, 54, 55, 13, 124, 591,
90334
- /* 1520 */ 173, 174, 118, 575, 129, 595, 571, 131, 14, 132,
90335
- /* 1530 */ 611, 63, 612, 193, 602, 179, 305, 413, 417, 960,
90336
- /* 1540 */ 627,
90400
+ /* 0 */ 312, 53, 494, 56, 143, 177, 181, 561, 44, 44,
90401
+ /* 10 */ 44, 44, 224, 46, 46, 46, 46, 47, 47, 48,
90402
+ /* 20 */ 48, 48, 49, 226, 511, 345, 209, 513, 501, 226,
90403
+ /* 30 */ 550, 541, 54, 46, 46, 46, 46, 47, 47, 48,
90404
+ /* 40 */ 48, 48, 49, 226, 48, 48, 48, 49, 226, 43,
90405
+ /* 50 */ 41, 55, 539, 537, 540, 540, 45, 45, 44, 44,
90406
+ /* 60 */ 44, 44, 252, 46, 46, 46, 46, 47, 47, 48,
90407
+ /* 70 */ 48, 48, 49, 226, 312, 561, 321, 493, 429, 246,
90408
+ /* 80 */ 60, 46, 46, 46, 46, 47, 47, 48, 48, 48,
90409
+ /* 90 */ 49, 226, 613, 321, 493, 480, 477, 155, 426, 326,
90410
+ /* 100 */ 369, 372, 373, 581, 550, 541, 311, 555, 155, 40,
90411
+ /* 110 */ 374, 369, 372, 373, 47, 47, 48, 48, 48, 49,
90412
+ /* 120 */ 226, 374, 536, 43, 41, 55, 539, 537, 540, 540,
90413
+ /* 130 */ 45, 45, 44, 44, 44, 44, 301, 46, 46, 46,
90414
+ /* 140 */ 46, 47, 47, 48, 48, 48, 49, 226, 312, 222,
90415
+ /* 150 */ 210, 445, 431, 156, 139, 250, 366, 267, 367, 154,
90416
+ /* 160 */ 509, 350, 513, 501, 561, 248, 222, 484, 513, 501,
90417
+ /* 170 */ 340, 139, 250, 366, 267, 367, 154, 316, 550, 541,
90418
+ /* 180 */ 609, 281, 248, 197, 565, 337, 309, 471, 428, 511,
90419
+ /* 190 */ 582, 209, 556, 599, 566, 81, 493, 43, 41, 55,
90420
+ /* 200 */ 539, 537, 540, 540, 45, 45, 44, 44, 44, 44,
90421
+ /* 210 */ 471, 46, 46, 46, 46, 47, 47, 48, 48, 48,
90422
+ /* 220 */ 49, 226, 312, 553, 553, 553, 287, 133, 517, 231,
90423
+ /* 230 */ 480, 477, 561, 580, 355, 235, 480, 477, 483, 573,
90424
+ /* 240 */ 340, 513, 501, 183, 591, 66, 571, 572, 493, 238,
90425
+ /* 250 */ 205, 387, 550, 541, 155, 337, 390, 369, 372, 373,
90426
+ /* 260 */ 959, 186, 490, 2, 566, 94, 466, 374, 195, 614,
90427
+ /* 270 */ 198, 43, 41, 55, 539, 537, 540, 540, 45, 45,
90428
+ /* 280 */ 44, 44, 44, 44, 565, 46, 46, 46, 46, 47,
90429
+ /* 290 */ 47, 48, 48, 48, 49, 226, 312, 340, 570, 53,
90430
+ /* 300 */ 618, 56, 143, 449, 565, 340, 353, 201, 141, 480,
90431
+ /* 310 */ 477, 352, 337, 493, 400, 273, 200, 146, 569, 568,
90432
+ /* 320 */ 337, 566, 71, 570, 224, 292, 550, 541, 361, 566,
90433
+ /* 330 */ 94, 342, 483, 534, 534, 68, 360, 280, 493, 513,
90434
+ /* 340 */ 501, 565, 381, 569, 410, 43, 41, 55, 539, 537,
90435
+ /* 350 */ 540, 540, 45, 45, 44, 44, 44, 44, 462, 46,
90436
+ /* 360 */ 46, 46, 46, 47, 47, 48, 48, 48, 49, 226,
90437
+ /* 370 */ 312, 353, 468, 493, 246, 208, 363, 1, 340, 567,
90438
+ /* 380 */ 230, 513, 501, 149, 333, 546, 4, 612, 617, 493,
90439
+ /* 390 */ 240, 340, 112, 337, 611, 513, 501, 224, 212, 580,
90440
+ /* 400 */ 550, 541, 566, 95, 409, 230, 337, 480, 477, 399,
90441
+ /* 410 */ 482, 66, 471, 516, 493, 566, 94, 412, 466, 43,
90442
+ /* 420 */ 41, 55, 539, 537, 540, 540, 45, 45, 44, 44,
90443
+ /* 430 */ 44, 44, 565, 46, 46, 46, 46, 47, 47, 48,
90444
+ /* 440 */ 48, 48, 49, 226, 312, 502, 585, 580, 329, 480,
90445
+ /* 450 */ 477, 451, 513, 501, 592, 247, 332, 357, 615, 66,
90446
+ /* 460 */ 150, 500, 493, 480, 477, 151, 400, 273, 53, 414,
90447
+ /* 470 */ 56, 143, 215, 146, 550, 541, 224, 499, 617, 421,
90448
+ /* 480 */ 317, 528, 524, 42, 282, 415, 594, 34, 476, 280,
90449
+ /* 490 */ 420, 397, 203, 43, 41, 55, 539, 537, 540, 540,
90450
+ /* 500 */ 45, 45, 44, 44, 44, 44, 493, 46, 46, 46,
90451
+ /* 510 */ 46, 47, 47, 48, 48, 48, 49, 226, 312, 324,
90452
+ /* 520 */ 480, 477, 435, 447, 439, 384, 565, 340, 284, 340,
90453
+ /* 530 */ 241, 344, 528, 524, 53, 340, 56, 143, 620, 185,
90454
+ /* 540 */ 461, 483, 337, 230, 337, 478, 217, 439, 550, 541,
90455
+ /* 550 */ 337, 566, 95, 566, 89, 493, 596, 425, 227, 566,
90456
+ /* 560 */ 81, 52, 459, 448, 440, 402, 584, 43, 41, 55,
90457
+ /* 570 */ 539, 537, 540, 540, 45, 45, 44, 44, 44, 44,
90458
+ /* 580 */ 565, 46, 46, 46, 46, 47, 47, 48, 48, 48,
90459
+ /* 590 */ 49, 226, 312, 362, 230, 340, 259, 323, 491, 377,
90460
+ /* 600 */ 234, 257, 458, 385, 398, 278, 283, 488, 337, 340,
90461
+ /* 610 */ 337, 141, 340, 461, 340, 597, 493, 566, 9, 566,
90462
+ /* 620 */ 96, 62, 550, 541, 337, 593, 401, 337, 493, 337,
90463
+ /* 630 */ 151, 328, 157, 566, 85, 483, 566, 77, 566, 86,
90464
+ /* 640 */ 874, 43, 41, 55, 539, 537, 540, 540, 45, 45,
90465
+ /* 650 */ 44, 44, 44, 44, 340, 46, 46, 46, 46, 47,
90466
+ /* 660 */ 47, 48, 48, 48, 49, 226, 312, 340, 444, 337,
90467
+ /* 670 */ 364, 30, 443, 457, 502, 150, 327, 65, 566, 99,
90468
+ /* 680 */ 340, 561, 337, 408, 324, 340, 386, 340, 248, 589,
90469
+ /* 690 */ 500, 566, 137, 256, 574, 337, 550, 541, 579, 246,
90470
+ /* 700 */ 337, 224, 337, 258, 566, 136, 499, 371, 349, 566,
90471
+ /* 710 */ 138, 566, 101, 407, 493, 43, 41, 55, 539, 537,
90472
+ /* 720 */ 540, 540, 45, 45, 44, 44, 44, 44, 340, 46,
90473
+ /* 730 */ 46, 46, 46, 47, 47, 48, 48, 48, 49, 226,
90474
+ /* 740 */ 312, 340, 229, 337, 340, 342, 252, 534, 534, 561,
90475
+ /* 750 */ 522, 522, 566, 91, 574, 177, 337, 561, 579, 337,
90476
+ /* 760 */ 340, 493, 58, 340, 38, 566, 88, 441, 566, 17,
90477
+ /* 770 */ 550, 541, 508, 29, 306, 337, 452, 948, 337, 948,
90478
+ /* 780 */ 629, 575, 416, 318, 566, 92, 192, 566, 73, 43,
90479
+ /* 790 */ 41, 55, 539, 537, 540, 540, 45, 45, 44, 44,
90480
+ /* 800 */ 44, 44, 340, 46, 46, 46, 46, 47, 47, 48,
90481
+ /* 810 */ 48, 48, 49, 226, 312, 340, 246, 337, 340, 246,
90482
+ /* 820 */ 270, 526, 340, 469, 299, 561, 566, 70, 202, 204,
90483
+ /* 830 */ 337, 493, 507, 337, 493, 493, 340, 337, 493, 566,
90484
+ /* 840 */ 90, 532, 566, 82, 550, 541, 566, 72, 557, 452,
90485
+ /* 850 */ 949, 337, 949, 266, 598, 342, 150, 534, 534, 228,
90486
+ /* 860 */ 566, 79, 533, 43, 41, 55, 539, 537, 540, 540,
90487
+ /* 870 */ 45, 45, 44, 44, 44, 44, 340, 46, 46, 46,
90488
+ /* 880 */ 46, 47, 47, 48, 48, 48, 49, 226, 312, 340,
90489
+ /* 890 */ 246, 337, 340, 252, 526, 49, 226, 254, 549, 260,
90490
+ /* 900 */ 566, 83, 588, 586, 337, 493, 606, 337, 493, 485,
90491
+ /* 910 */ 340, 592, 392, 566, 69, 406, 566, 80, 550, 541,
90492
+ /* 920 */ 342, 368, 534, 534, 253, 337, 150, 493, 604, 342,
90493
+ /* 930 */ 223, 534, 534, 525, 566, 100, 285, 43, 57, 55,
90494
+ /* 940 */ 539, 537, 540, 540, 45, 45, 44, 44, 44, 44,
90495
+ /* 950 */ 340, 46, 46, 46, 46, 47, 47, 48, 48, 48,
90496
+ /* 960 */ 49, 226, 312, 392, 246, 337, 340, 252, 575, 416,
90497
+ /* 970 */ 351, 472, 276, 347, 566, 87, 279, 330, 493, 493,
90498
+ /* 980 */ 496, 337, 493, 461, 340, 493, 493, 493, 548, 547,
90499
+ /* 990 */ 566, 98, 550, 541, 498, 493, 172, 523, 493, 337,
90500
+ /* 1000 */ 311, 577, 191, 243, 319, 423, 422, 530, 566, 105,
90501
+ /* 1010 */ 544, 543, 41, 55, 539, 537, 540, 540, 45, 45,
90502
+ /* 1020 */ 44, 44, 44, 44, 340, 46, 46, 46, 46, 47,
90503
+ /* 1030 */ 47, 48, 48, 48, 49, 226, 312, 545, 340, 337,
90504
+ /* 1040 */ 340, 246, 392, 207, 252, 445, 320, 489, 566, 103,
90505
+ /* 1050 */ 627, 622, 519, 337, 232, 337, 493, 493, 340, 493,
90506
+ /* 1060 */ 479, 340, 566, 108, 566, 109, 550, 541, 6, 607,
90507
+ /* 1070 */ 608, 454, 2, 337, 492, 493, 337, 565, 517, 231,
90508
+ /* 1080 */ 471, 322, 566, 134, 289, 566, 135, 55, 539, 537,
90509
+ /* 1090 */ 540, 540, 45, 45, 44, 44, 44, 44, 487, 46,
90510
+ /* 1100 */ 46, 46, 46, 47, 47, 48, 48, 48, 49, 226,
90511
+ /* 1110 */ 23, 346, 340, 3, 397, 464, 422, 336, 501, 290,
90512
+ /* 1120 */ 147, 214, 7, 23, 346, 340, 3, 337, 343, 493,
90513
+ /* 1130 */ 336, 501, 463, 237, 172, 493, 566, 84, 475, 340,
90514
+ /* 1140 */ 337, 343, 211, 340, 246, 225, 244, 348, 394, 566,
90515
+ /* 1150 */ 75, 341, 18, 493, 337, 565, 393, 509, 337, 493,
90516
+ /* 1160 */ 348, 493, 395, 566, 97, 245, 493, 566, 61, 274,
90517
+ /* 1170 */ 509, 217, 16, 358, 189, 264, 565, 26, 25, 340,
90518
+ /* 1180 */ 493, 236, 518, 310, 24, 338, 339, 304, 493, 556,
90519
+ /* 1190 */ 26, 25, 450, 602, 337, 404, 120, 24, 338, 339,
90520
+ /* 1200 */ 419, 169, 556, 566, 106, 565, 224, 117, 495, 27,
90521
+ /* 1210 */ 346, 562, 3, 396, 187, 340, 336, 501, 179, 184,
90522
+ /* 1220 */ 553, 553, 553, 552, 551, 11, 493, 343, 493, 398,
90523
+ /* 1230 */ 337, 430, 8, 553, 553, 553, 552, 551, 11, 566,
90524
+ /* 1240 */ 104, 335, 340, 255, 340, 616, 348, 340, 251, 331,
90525
+ /* 1250 */ 340, 391, 558, 587, 50, 340, 509, 337, 493, 337,
90526
+ /* 1260 */ 493, 365, 337, 493, 590, 337, 566, 78, 566, 102,
90527
+ /* 1270 */ 337, 566, 76, 213, 566, 74, 26, 25, 610, 566,
90528
+ /* 1280 */ 93, 378, 424, 24, 338, 339, 263, 583, 556, 220,
90529
+ /* 1290 */ 140, 624, 294, 493, 300, 389, 23, 346, 376, 3,
90530
+ /* 1300 */ 150, 493, 493, 336, 501, 493, 493, 493, 221, 493,
90531
+ /* 1310 */ 493, 554, 268, 219, 343, 261, 515, 460, 418, 553,
90532
+ /* 1320 */ 553, 553, 552, 551, 11, 595, 493, 493, 152, 206,
90533
+ /* 1330 */ 493, 493, 493, 348, 272, 271, 269, 158, 302, 625,
90534
+ /* 1340 */ 531, 521, 67, 509, 506, 520, 50, 628, 380, 600,
90535
+ /* 1350 */ 173, 605, 123, 623, 493, 178, 37, 305, 308, 265,
90536
+ /* 1360 */ 493, 620, 621, 26, 25, 165, 262, 307, 619, 166,
90537
+ /* 1370 */ 24, 338, 339, 334, 436, 556, 427, 437, 33, 160,
90538
+ /* 1380 */ 145, 466, 513, 501, 20, 148, 275, 122, 174, 359,
90539
+ /* 1390 */ 442, 467, 486, 63, 36, 233, 42, 465, 512, 403,
90540
+ /* 1400 */ 542, 182, 119, 113, 128, 132, 553, 553, 553, 552,
90541
+ /* 1410 */ 551, 11, 39, 288, 538, 455, 291, 563, 388, 354,
90542
+ /* 1420 */ 293, 295, 509, 31, 453, 356, 296, 325, 159, 405,
90543
+ /* 1430 */ 286, 297, 564, 153, 313, 382, 35, 129, 303, 224,
90544
+ /* 1440 */ 218, 121, 194, 196, 433, 107, 559, 242, 601, 216,
90545
+ /* 1450 */ 428, 670, 280, 671, 556, 672, 162, 163, 32, 535,
90546
+ /* 1460 */ 59, 505, 529, 411, 510, 190, 199, 176, 167, 504,
90547
+ /* 1470 */ 503, 497, 5, 315, 314, 13, 19, 12, 474, 131,
90548
+ /* 1480 */ 456, 144, 434, 432, 168, 553, 553, 553, 239, 51,
90549
+ /* 1490 */ 603, 118, 111, 142, 249, 21, 124, 164, 379, 258,
90550
+ /* 1500 */ 626, 188, 126, 172, 298, 383, 161, 370, 375, 114,
90551
+ /* 1510 */ 15, 470, 481, 180, 125, 115, 127, 438, 446, 10,
90552
+ /* 1520 */ 514, 110, 171, 527, 170, 116, 130, 560, 64, 14,
90553
+ /* 1530 */ 175, 576, 578, 413, 277, 193, 417, 960, 473, 960,
90554
+ /* 1540 */ 28, 960, 22,
9033790555
};
9033890556
static const YYCODETYPE yy_lookahead[] = {
90339
- /* 0 */ 19, 142, 143, 144, 145, 24, 115, 26, 77, 78,
90340
- /* 10 */ 79, 80, 92, 82, 83, 84, 85, 86, 87, 88,
90341
- /* 20 */ 89, 90, 91, 92, 26, 27, 222, 223, 224, 225,
90557
+ /* 0 */ 19, 222, 223, 224, 225, 24, 35, 26, 77, 78,
90558
+ /* 10 */ 79, 80, 115, 82, 83, 84, 85, 86, 87, 88,
90559
+ /* 20 */ 89, 90, 91, 92, 166, 167, 168, 26, 27, 92,
9034290560
/* 30 */ 49, 50, 81, 82, 83, 84, 85, 86, 87, 88,
9034390561
/* 40 */ 89, 90, 91, 92, 88, 89, 90, 91, 92, 68,
9034490562
/* 50 */ 69, 70, 71, 72, 73, 74, 75, 76, 77, 78,
90345
- /* 60 */ 79, 80, 16, 82, 83, 84, 85, 86, 87, 88,
90346
- /* 70 */ 89, 90, 91, 92, 19, 94, 19, 166, 167, 168,
90563
+ /* 60 */ 79, 80, 150, 82, 83, 84, 85, 86, 87, 88,
90564
+ /* 70 */ 89, 90, 91, 92, 19, 94, 19, 165, 174, 150,
9034790565
/* 80 */ 25, 82, 83, 84, 85, 86, 87, 88, 89, 90,
90348
- /* 90 */ 91, 92, 94, 95, 96, 150, 36, 99, 100, 101,
90349
- /* 100 */ 174, 169, 170, 171, 49, 50, 60, 109, 62, 54,
90350
- /* 110 */ 165, 51, 1, 2, 26, 27, 174, 22, 58, 174,
90351
- /* 120 */ 175, 26, 27, 68, 69, 70, 71, 72, 73, 74,
90352
- /* 130 */ 75, 76, 77, 78, 79, 80, 186, 82, 83, 84,
90566
+ /* 90 */ 91, 92, 186, 19, 165, 94, 95, 96, 174, 187,
90567
+ /* 100 */ 99, 100, 101, 186, 49, 50, 22, 23, 96, 54,
90568
+ /* 110 */ 109, 99, 100, 101, 86, 87, 88, 89, 90, 91,
90569
+ /* 120 */ 92, 109, 193, 68, 69, 70, 71, 72, 73, 74,
90570
+ /* 130 */ 75, 76, 77, 78, 79, 80, 195, 82, 83, 84,
9035390571
/* 140 */ 85, 86, 87, 88, 89, 90, 91, 92, 19, 92,
90354
- /* 150 */ 19, 172, 173, 96, 97, 98, 99, 100, 101, 102,
90355
- /* 160 */ 181, 216, 146, 147, 232, 108, 221, 107, 152, 186,
90356
- /* 170 */ 154, 150, 195, 30, 86, 87, 160, 34, 49, 50,
90357
- /* 180 */ 26, 52, 94, 95, 138, 97, 165, 181, 182, 94,
90358
- /* 190 */ 95, 48, 104, 105, 188, 174, 175, 68, 69, 70,
90572
+ /* 150 */ 160, 67, 23, 96, 97, 98, 99, 100, 101, 102,
90573
+ /* 160 */ 66, 191, 26, 27, 26, 108, 92, 208, 26, 27,
90574
+ /* 170 */ 150, 97, 98, 99, 100, 101, 102, 155, 49, 50,
90575
+ /* 180 */ 183, 150, 108, 25, 194, 165, 163, 166, 94, 166,
90576
+ /* 190 */ 167, 168, 98, 183, 174, 175, 165, 68, 69, 70,
9035990577
/* 200 */ 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
90360
- /* 210 */ 194, 82, 83, 84, 85, 86, 87, 88, 89, 90,
90361
- /* 220 */ 91, 92, 19, 92, 86, 87, 21, 24, 97, 98,
90362
- /* 230 */ 99, 100, 101, 102, 218, 214, 215, 208, 66, 108,
90363
- /* 240 */ 150, 86, 87, 88, 89, 90, 91, 92, 94, 173,
90364
- /* 250 */ 160, 183, 49, 50, 191, 165, 96, 181, 22, 99,
90365
- /* 260 */ 100, 101, 26, 247, 174, 175, 94, 57, 63, 109,
90366
- /* 270 */ 98, 68, 69, 70, 71, 72, 73, 74, 75, 76,
90578
+ /* 210 */ 166, 82, 83, 84, 85, 86, 87, 88, 89, 90,
90579
+ /* 220 */ 91, 92, 19, 129, 130, 131, 205, 24, 86, 87,
90580
+ /* 230 */ 94, 95, 94, 150, 214, 215, 94, 95, 25, 97,
90581
+ /* 240 */ 150, 26, 27, 23, 161, 162, 104, 105, 165, 205,
90582
+ /* 250 */ 160, 229, 49, 50, 96, 165, 234, 99, 100, 101,
90583
+ /* 260 */ 142, 143, 144, 145, 174, 175, 57, 109, 185, 186,
90584
+ /* 270 */ 160, 68, 69, 70, 71, 72, 73, 74, 75, 76,
9036790585
/* 280 */ 77, 78, 79, 80, 194, 82, 83, 84, 85, 86,
90368
- /* 290 */ 87, 88, 89, 90, 91, 92, 19, 150, 150, 150,
90369
- /* 300 */ 25, 129, 130, 131, 183, 100, 216, 160, 150, 161,
90370
- /* 310 */ 162, 221, 165, 165, 165, 105, 106, 26, 27, 170,
90371
- /* 320 */ 171, 174, 175, 165, 160, 115, 49, 50, 170, 171,
90372
- /* 330 */ 94, 148, 163, 185, 186, 166, 167, 168, 128, 91,
90373
- /* 340 */ 92, 194, 196, 138, 166, 68, 69, 70, 71, 72,
90374
- /* 350 */ 73, 74, 75, 76, 77, 78, 79, 80, 194, 82,
90586
+ /* 290 */ 87, 88, 89, 90, 91, 92, 19, 150, 150, 222,
90587
+ /* 300 */ 23, 224, 225, 88, 194, 150, 216, 160, 95, 94,
90588
+ /* 310 */ 95, 221, 165, 165, 105, 106, 206, 207, 170, 171,
90589
+ /* 320 */ 165, 174, 175, 150, 115, 148, 49, 50, 19, 174,
90590
+ /* 330 */ 175, 111, 119, 113, 114, 22, 27, 128, 165, 26,
90591
+ /* 340 */ 27, 194, 237, 170, 171, 68, 69, 70, 71, 72,
90592
+ /* 350 */ 73, 74, 75, 76, 77, 78, 79, 80, 150, 82,
9037590593
/* 360 */ 83, 84, 85, 86, 87, 88, 89, 90, 91, 92,
90376
- /* 370 */ 19, 96, 11, 150, 99, 100, 101, 155, 26, 27,
90377
- /* 380 */ 231, 232, 218, 205, 109, 94, 95, 150, 165, 231,
90378
- /* 390 */ 232, 166, 150, 222, 150, 224, 225, 174, 175, 235,
90379
- /* 400 */ 49, 50, 165, 24, 240, 26, 166, 165, 153, 165,
90380
- /* 410 */ 119, 174, 175, 136, 237, 244, 174, 175, 57, 68,
90594
+ /* 370 */ 19, 216, 11, 165, 150, 236, 221, 22, 150, 231,
90595
+ /* 380 */ 232, 26, 27, 25, 146, 147, 196, 181, 182, 165,
90596
+ /* 390 */ 152, 150, 154, 165, 188, 26, 27, 115, 160, 150,
90597
+ /* 400 */ 49, 50, 174, 175, 231, 232, 165, 94, 95, 127,
90598
+ /* 410 */ 161, 162, 166, 166, 165, 174, 175, 193, 57, 68,
9038190599
/* 420 */ 69, 70, 71, 72, 73, 74, 75, 76, 77, 78,
90382
- /* 430 */ 79, 80, 236, 82, 83, 84, 85, 86, 87, 88,
90383
- /* 440 */ 89, 90, 91, 92, 19, 205, 94, 95, 23, 226,
90384
- /* 450 */ 165, 229, 215, 150, 12, 88, 234, 150, 216, 174,
90385
- /* 460 */ 32, 217, 222, 25, 224, 225, 105, 106, 165, 41,
90386
- /* 470 */ 28, 119, 165, 94, 49, 50, 115, 174, 175, 112,
90387
- /* 480 */ 22, 174, 175, 116, 26, 27, 44, 136, 46, 128,
90388
- /* 490 */ 166, 26, 27, 68, 69, 70, 71, 72, 73, 74,
90389
- /* 500 */ 75, 76, 77, 78, 79, 80, 150, 82, 83, 84,
90390
- /* 510 */ 85, 86, 87, 88, 89, 90, 91, 92, 19, 150,
90391
- /* 520 */ 150, 165, 23, 220, 196, 150, 150, 220, 158, 205,
90392
- /* 530 */ 150, 161, 162, 198, 165, 165, 26, 27, 112, 23,
90393
- /* 540 */ 165, 165, 116, 174, 175, 165, 150, 166, 49, 50,
90394
- /* 550 */ 174, 175, 94, 95, 174, 175, 118, 161, 162, 94,
90395
- /* 560 */ 95, 165, 187, 16, 22, 160, 24, 68, 69, 70,
90600
+ /* 430 */ 79, 80, 194, 82, 83, 84, 85, 86, 87, 88,
90601
+ /* 440 */ 89, 90, 91, 92, 19, 12, 173, 150, 220, 94,
90602
+ /* 450 */ 95, 205, 26, 27, 181, 158, 218, 216, 161, 162,
90603
+ /* 460 */ 25, 28, 165, 94, 95, 50, 105, 106, 222, 245,
90604
+ /* 470 */ 224, 225, 206, 207, 49, 50, 115, 44, 182, 46,
90605
+ /* 480 */ 169, 170, 171, 125, 16, 247, 166, 136, 119, 128,
90606
+ /* 490 */ 57, 150, 160, 68, 69, 70, 71, 72, 73, 74,
90607
+ /* 500 */ 75, 76, 77, 78, 79, 80, 165, 82, 83, 84,
90608
+ /* 510 */ 85, 86, 87, 88, 89, 90, 91, 92, 19, 104,
90609
+ /* 520 */ 94, 95, 23, 21, 105, 106, 194, 150, 60, 150,
90610
+ /* 530 */ 62, 169, 170, 171, 222, 150, 224, 225, 103, 23,
90611
+ /* 540 */ 150, 25, 165, 232, 165, 119, 160, 128, 49, 50,
90612
+ /* 550 */ 165, 174, 175, 174, 175, 165, 244, 165, 217, 174,
90613
+ /* 560 */ 175, 136, 7, 8, 9, 63, 174, 68, 69, 70,
9039690614
/* 570 */ 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
90397
- /* 580 */ 150, 82, 83, 84, 85, 86, 87, 88, 89, 90,
90398
- /* 590 */ 91, 92, 19, 150, 12, 165, 23, 241, 88, 194,
90399
- /* 600 */ 150, 0, 1, 2, 94, 95, 160, 60, 165, 62,
90400
- /* 610 */ 28, 206, 207, 190, 191, 165, 150, 174, 175, 7,
90401
- /* 620 */ 8, 9, 49, 50, 174, 175, 44, 111, 46, 113,
90402
- /* 630 */ 114, 165, 169, 170, 171, 22, 23, 233, 25, 57,
90403
- /* 640 */ 194, 68, 69, 70, 71, 72, 73, 74, 75, 76,
90615
+ /* 580 */ 194, 82, 83, 84, 85, 86, 87, 88, 89, 90,
90616
+ /* 590 */ 91, 92, 19, 150, 232, 150, 23, 220, 32, 19,
90617
+ /* 600 */ 215, 150, 100, 213, 218, 226, 138, 41, 165, 150,
90618
+ /* 610 */ 165, 95, 150, 150, 150, 177, 165, 174, 175, 174,
90619
+ /* 620 */ 175, 235, 49, 50, 165, 177, 240, 165, 165, 165,
90620
+ /* 630 */ 50, 248, 249, 174, 175, 119, 174, 175, 174, 175,
90621
+ /* 640 */ 138, 68, 69, 70, 71, 72, 73, 74, 75, 76,
9040490622
/* 650 */ 77, 78, 79, 80, 150, 82, 83, 84, 85, 86,
90405
- /* 660 */ 87, 88, 89, 90, 91, 92, 19, 150, 25, 165,
90406
- /* 670 */ 23, 150, 233, 19, 150, 190, 191, 228, 174, 175,
90407
- /* 680 */ 67, 222, 165, 224, 225, 150, 165, 150, 150, 165,
90408
- /* 690 */ 23, 174, 175, 144, 145, 232, 49, 50, 174, 175,
90409
- /* 700 */ 165, 115, 165, 165, 50, 22, 23, 241, 25, 174,
90410
- /* 710 */ 175, 174, 175, 127, 193, 68, 69, 70, 71, 72,
90623
+ /* 660 */ 87, 88, 89, 90, 91, 92, 19, 150, 30, 165,
90624
+ /* 670 */ 88, 24, 34, 23, 12, 25, 213, 22, 174, 175,
90625
+ /* 680 */ 150, 26, 165, 97, 104, 150, 48, 150, 108, 166,
90626
+ /* 690 */ 28, 174, 175, 98, 112, 165, 49, 50, 116, 150,
90627
+ /* 700 */ 165, 115, 165, 108, 174, 175, 44, 178, 46, 174,
90628
+ /* 710 */ 175, 174, 175, 127, 165, 68, 69, 70, 71, 72,
9041190629
/* 720 */ 73, 74, 75, 76, 77, 78, 79, 80, 150, 82,
9041290630
/* 730 */ 83, 84, 85, 86, 87, 88, 89, 90, 91, 92,
90413
- /* 740 */ 19, 150, 150, 165, 150, 24, 103, 23, 150, 150,
90414
- /* 750 */ 67, 213, 174, 175, 97, 209, 165, 165, 104, 165,
90415
- /* 760 */ 150, 150, 108, 165, 165, 174, 175, 23, 174, 175,
90416
- /* 770 */ 49, 50, 115, 174, 175, 165, 165, 177, 111, 187,
90417
- /* 780 */ 113, 114, 250, 251, 127, 174, 175, 206, 207, 68,
90631
+ /* 740 */ 19, 150, 193, 165, 150, 111, 150, 113, 114, 94,
90632
+ /* 750 */ 129, 130, 174, 175, 112, 24, 165, 26, 116, 165,
90633
+ /* 760 */ 150, 165, 135, 150, 137, 174, 175, 23, 174, 175,
90634
+ /* 770 */ 49, 50, 23, 52, 25, 165, 22, 23, 165, 25,
90635
+ /* 780 */ 0, 1, 2, 187, 174, 175, 196, 174, 175, 68,
9041890636
/* 790 */ 69, 70, 71, 72, 73, 74, 75, 76, 77, 78,
9041990637
/* 800 */ 79, 80, 150, 82, 83, 84, 85, 86, 87, 88,
90420
- /* 810 */ 89, 90, 91, 92, 19, 150, 150, 165, 150, 111,
90421
- /* 820 */ 182, 113, 114, 105, 106, 177, 174, 175, 25, 166,
90422
- /* 830 */ 165, 165, 150, 165, 150, 111, 150, 113, 114, 174,
90423
- /* 840 */ 175, 150, 174, 175, 49, 50, 128, 165, 135, 165,
90424
- /* 850 */ 137, 165, 197, 187, 166, 111, 165, 113, 114, 204,
90425
- /* 860 */ 174, 175, 177, 68, 69, 70, 71, 72, 73, 74,
90638
+ /* 810 */ 89, 90, 91, 92, 19, 150, 150, 165, 150, 150,
90639
+ /* 820 */ 150, 67, 150, 150, 198, 94, 174, 175, 105, 106,
90640
+ /* 830 */ 165, 165, 23, 165, 165, 165, 150, 165, 165, 174,
90641
+ /* 840 */ 175, 23, 174, 175, 49, 50, 174, 175, 166, 22,
90642
+ /* 850 */ 23, 165, 25, 16, 23, 111, 25, 113, 114, 193,
90643
+ /* 860 */ 174, 175, 193, 68, 69, 70, 71, 72, 73, 74,
9042690644
/* 870 */ 75, 76, 77, 78, 79, 80, 150, 82, 83, 84,
9042790645
/* 880 */ 85, 86, 87, 88, 89, 90, 91, 92, 19, 150,
90428
- /* 890 */ 150, 165, 150, 205, 177, 213, 150, 213, 95, 177,
90429
- /* 900 */ 174, 175, 129, 130, 165, 165, 23, 165, 25, 150,
90430
- /* 910 */ 150, 165, 178, 174, 175, 150, 174, 175, 49, 50,
90431
- /* 920 */ 174, 175, 119, 19, 165, 165, 50, 22, 23, 160,
90432
- /* 930 */ 165, 27, 241, 193, 174, 175, 160, 68, 69, 70,
90646
+ /* 890 */ 150, 165, 150, 150, 67, 91, 92, 60, 199, 62,
90647
+ /* 900 */ 174, 175, 172, 173, 165, 165, 36, 165, 165, 25,
90648
+ /* 910 */ 150, 181, 150, 174, 175, 209, 174, 175, 49, 50,
90649
+ /* 920 */ 111, 51, 113, 114, 23, 165, 25, 165, 58, 111,
90650
+ /* 930 */ 187, 113, 114, 193, 174, 175, 209, 68, 69, 70,
9043390651
/* 940 */ 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
9043490652
/* 950 */ 150, 82, 83, 84, 85, 86, 87, 88, 89, 90,
90435
- /* 960 */ 91, 92, 19, 194, 150, 165, 150, 150, 150, 160,
90436
- /* 970 */ 194, 25, 67, 160, 174, 175, 217, 166, 95, 165,
90437
- /* 980 */ 104, 165, 165, 165, 150, 245, 248, 249, 49, 50,
90438
- /* 990 */ 174, 175, 49, 50, 23, 23, 25, 25, 242, 165,
90439
- /* 1000 */ 199, 187, 119, 194, 187, 22, 23, 194, 174, 175,
90653
+ /* 960 */ 91, 92, 19, 150, 150, 165, 150, 150, 1, 2,
90654
+ /* 970 */ 150, 150, 150, 228, 174, 175, 242, 107, 165, 165,
90655
+ /* 980 */ 150, 165, 165, 150, 150, 165, 165, 165, 49, 50,
90656
+ /* 990 */ 174, 175, 49, 50, 23, 165, 25, 233, 165, 165,
90657
+ /* 1000 */ 22, 23, 118, 241, 187, 190, 191, 193, 174, 175,
9044090658
/* 1010 */ 71, 72, 69, 70, 71, 72, 73, 74, 75, 76,
9044190659
/* 1020 */ 77, 78, 79, 80, 150, 82, 83, 84, 85, 86,
9044290660
/* 1030 */ 87, 88, 89, 90, 91, 92, 19, 98, 150, 165,
90443
- /* 1040 */ 150, 150, 150, 19, 7, 8, 105, 106, 174, 175,
90444
- /* 1050 */ 67, 27, 23, 165, 25, 165, 165, 165, 150, 150,
90445
- /* 1060 */ 150, 150, 174, 175, 174, 175, 49, 50, 98, 242,
90446
- /* 1070 */ 23, 125, 25, 165, 165, 165, 165, 209, 108, 97,
90447
- /* 1080 */ 98, 209, 174, 175, 193, 174, 175, 70, 71, 72,
90448
- /* 1090 */ 73, 74, 75, 76, 77, 78, 79, 80, 199, 82,
90661
+ /* 1040 */ 150, 150, 150, 160, 150, 67, 213, 199, 174, 175,
90662
+ /* 1050 */ 7, 8, 233, 165, 241, 165, 165, 165, 150, 165,
90663
+ /* 1060 */ 150, 150, 174, 175, 174, 175, 49, 50, 22, 97,
90664
+ /* 1070 */ 98, 144, 145, 165, 177, 165, 165, 194, 86, 87,
90665
+ /* 1080 */ 166, 187, 174, 175, 193, 174, 175, 70, 71, 72,
90666
+ /* 1090 */ 73, 74, 75, 76, 77, 78, 79, 80, 177, 82,
9044990667
/* 1100 */ 83, 84, 85, 86, 87, 88, 89, 90, 91, 92,
90450
- /* 1110 */ 19, 20, 150, 22, 160, 22, 149, 26, 27, 150,
90451
- /* 1120 */ 23, 6, 25, 19, 20, 150, 22, 165, 37, 149,
90452
- /* 1130 */ 26, 27, 151, 23, 165, 25, 174, 175, 151, 150,
90453
- /* 1140 */ 165, 37, 13, 150, 150, 149, 149, 56, 194, 174,
90454
- /* 1150 */ 175, 23, 25, 25, 165, 194, 150, 66, 165, 165,
90455
- /* 1160 */ 56, 150, 159, 174, 175, 125, 150, 174, 175, 76,
90456
- /* 1170 */ 66, 165, 218, 150, 122, 199, 165, 86, 87, 200,
90457
- /* 1180 */ 150, 165, 123, 121, 93, 94, 95, 193, 165, 98,
90458
- /* 1190 */ 86, 87, 88, 201, 240, 165, 124, 93, 94, 95,
90459
- /* 1200 */ 202, 135, 98, 5, 174, 175, 115, 203, 10, 11,
90460
- /* 1210 */ 12, 13, 14, 150, 157, 17, 193, 150, 227, 210,
90461
- /* 1220 */ 129, 130, 131, 132, 133, 134, 150, 157, 165, 31,
90462
- /* 1230 */ 117, 33, 165, 129, 130, 131, 132, 133, 134, 150,
90463
- /* 1240 */ 42, 165, 19, 20, 104, 22, 150, 211, 210, 26,
90464
- /* 1250 */ 27, 210, 150, 55, 165, 57, 193, 120, 104, 61,
90465
- /* 1260 */ 37, 165, 64, 174, 175, 19, 20, 165, 22, 150,
90466
- /* 1270 */ 174, 175, 26, 27, 176, 150, 174, 175, 47, 56,
90467
- /* 1280 */ 211, 150, 150, 37, 165, 23, 23, 25, 25, 66,
90468
- /* 1290 */ 165, 211, 150, 174, 175, 184, 165, 165, 176, 174,
90469
- /* 1300 */ 175, 178, 56, 105, 106, 174, 175, 165, 110, 86,
90470
- /* 1310 */ 87, 176, 66, 115, 103, 176, 93, 94, 95, 150,
90471
- /* 1320 */ 23, 98, 25, 150, 22, 22, 128, 150, 150, 26,
90472
- /* 1330 */ 27, 150, 86, 87, 165, 193, 150, 139, 165, 93,
90473
- /* 1340 */ 94, 95, 165, 165, 98, 150, 165, 179, 92, 150,
90474
- /* 1350 */ 150, 165, 129, 130, 131, 132, 133, 134, 184, 150,
90475
- /* 1360 */ 165, 176, 193, 230, 165, 165, 193, 150, 150, 66,
90476
- /* 1370 */ 176, 150, 150, 230, 165, 129, 130, 131, 132, 133,
90477
- /* 1380 */ 134, 176, 165, 165, 150, 150, 165, 165, 150, 86,
90478
- /* 1390 */ 87, 150, 150, 150, 150, 179, 18, 94, 45, 165,
90479
- /* 1400 */ 165, 98, 157, 165, 150, 150, 165, 165, 165, 165,
90480
- /* 1410 */ 157, 135, 68, 156, 156, 156, 189, 157, 157, 165,
90481
- /* 1420 */ 165, 238, 156, 239, 157, 189, 22, 219, 199, 157,
90482
- /* 1430 */ 18, 192, 129, 130, 131, 157, 199, 40, 219, 192,
90483
- /* 1440 */ 192, 192, 157, 157, 243, 243, 38, 164, 180, 246,
90484
- /* 1450 */ 180, 1, 15, 189, 23, 249, 252, 22, 117, 252,
90485
- /* 1460 */ 117, 112, 117, 117, 117, 22, 11, 23, 23, 22,
90486
- /* 1470 */ 22, 25, 23, 35, 23, 23, 35, 119, 25, 25,
90487
- /* 1480 */ 22, 117, 23, 23, 27, 52, 22, 22, 52, 23,
90488
- /* 1490 */ 22, 35, 29, 22, 52, 22, 102, 108, 19, 24,
90489
- /* 1500 */ 39, 20, 104, 25, 138, 43, 104, 22, 5, 1,
90490
- /* 1510 */ 117, 35, 107, 27, 126, 76, 76, 22, 118, 1,
90491
- /* 1520 */ 16, 120, 53, 53, 118, 20, 59, 107, 22, 126,
90492
- /* 1530 */ 23, 16, 23, 22, 127, 15, 140, 65, 3, 253,
90493
- /* 1540 */ 4,
90668
+ /* 1110 */ 19, 20, 150, 22, 150, 190, 191, 26, 27, 205,
90669
+ /* 1120 */ 150, 160, 76, 19, 20, 150, 22, 165, 37, 165,
90670
+ /* 1130 */ 26, 27, 23, 241, 25, 165, 174, 175, 150, 150,
90671
+ /* 1140 */ 165, 37, 160, 150, 150, 197, 150, 56, 19, 174,
90672
+ /* 1150 */ 175, 150, 204, 165, 165, 194, 27, 66, 165, 165,
90673
+ /* 1160 */ 56, 165, 242, 174, 175, 150, 165, 174, 175, 209,
90674
+ /* 1170 */ 66, 160, 22, 150, 24, 177, 194, 86, 87, 150,
90675
+ /* 1180 */ 165, 217, 250, 251, 93, 94, 95, 193, 165, 98,
90676
+ /* 1190 */ 86, 87, 88, 153, 165, 18, 192, 93, 94, 95,
90677
+ /* 1200 */ 13, 151, 98, 174, 175, 194, 115, 22, 157, 19,
90678
+ /* 1210 */ 20, 150, 22, 150, 219, 150, 26, 27, 117, 157,
90679
+ /* 1220 */ 129, 130, 131, 132, 133, 134, 165, 37, 165, 218,
90680
+ /* 1230 */ 165, 157, 25, 129, 130, 131, 132, 133, 134, 174,
90681
+ /* 1240 */ 175, 159, 150, 150, 150, 150, 56, 150, 150, 47,
90682
+ /* 1250 */ 150, 240, 23, 184, 25, 150, 66, 165, 165, 165,
90683
+ /* 1260 */ 165, 104, 165, 165, 176, 165, 174, 175, 174, 175,
90684
+ /* 1270 */ 165, 174, 175, 157, 174, 175, 86, 87, 150, 174,
90685
+ /* 1280 */ 175, 18, 176, 93, 94, 95, 150, 150, 98, 92,
90686
+ /* 1290 */ 150, 150, 150, 165, 150, 150, 19, 20, 23, 22,
90687
+ /* 1300 */ 25, 165, 165, 26, 27, 165, 165, 165, 230, 165,
90688
+ /* 1310 */ 165, 150, 150, 230, 37, 150, 150, 150, 184, 129,
90689
+ /* 1320 */ 130, 131, 132, 133, 134, 176, 165, 165, 156, 5,
90690
+ /* 1330 */ 165, 165, 165, 56, 10, 11, 12, 13, 14, 150,
90691
+ /* 1340 */ 23, 17, 25, 66, 23, 150, 25, 176, 157, 176,
90692
+ /* 1350 */ 156, 40, 22, 157, 165, 31, 243, 33, 179, 176,
90693
+ /* 1360 */ 165, 103, 178, 86, 87, 156, 42, 179, 176, 6,
90694
+ /* 1370 */ 93, 94, 95, 149, 157, 98, 149, 149, 22, 55,
90695
+ /* 1380 */ 68, 57, 26, 27, 104, 61, 210, 189, 64, 120,
90696
+ /* 1390 */ 157, 211, 38, 246, 135, 227, 125, 189, 199, 157,
90697
+ /* 1400 */ 199, 219, 192, 192, 192, 189, 129, 130, 131, 132,
90698
+ /* 1410 */ 133, 134, 124, 210, 149, 211, 210, 203, 157, 121,
90699
+ /* 1420 */ 202, 201, 66, 123, 211, 122, 200, 157, 156, 105,
90700
+ /* 1430 */ 106, 199, 194, 151, 110, 45, 135, 180, 238, 115,
90701
+ /* 1440 */ 180, 126, 86, 87, 239, 164, 1, 15, 23, 22,
90702
+ /* 1450 */ 94, 117, 128, 117, 98, 117, 117, 117, 243, 112,
90703
+ /* 1460 */ 22, 11, 23, 139, 23, 22, 22, 25, 249, 23,
90704
+ /* 1470 */ 23, 23, 35, 252, 252, 35, 25, 25, 119, 22,
90705
+ /* 1480 */ 27, 117, 23, 23, 35, 129, 130, 131, 52, 22,
90706
+ /* 1490 */ 29, 22, 22, 39, 23, 22, 22, 102, 19, 108,
90707
+ /* 1500 */ 20, 24, 104, 25, 138, 43, 104, 52, 52, 22,
90708
+ /* 1510 */ 5, 1, 27, 117, 107, 126, 53, 59, 53, 22,
90709
+ /* 1520 */ 1, 118, 16, 20, 120, 107, 118, 127, 16, 22,
90710
+ /* 1530 */ 15, 23, 23, 65, 140, 22, 3, 253, 4, 253,
90711
+ /* 1540 */ 76, 253, 76,
9049490712
};
90495
-#define YY_SHIFT_USE_DFLT (-110)
90713
+#define YY_SHIFT_USE_DFLT (-104)
9049690714
#define YY_SHIFT_MAX 417
9049790715
static const short yy_shift_ofst[] = {
90498
- /* 0 */ 111, 1091, 1198, 1091, 1223, 1223, -2, 88, 88, -19,
90499
- /* 10 */ 1223, 1223, 1223, 1223, 1223, 210, 465, 129, 1104, 1223,
90500
- /* 20 */ 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223,
90501
- /* 30 */ 1223, 1223, 1246, 1223, 1223, 1223, 1223, 1223, 1223, 1223,
90502
- /* 40 */ 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223,
90503
- /* 50 */ 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223,
90504
- /* 60 */ 1223, -49, 361, 465, 465, 154, 138, 138, -109, 55,
90505
- /* 70 */ 203, 277, 351, 425, 499, 573, 647, 721, 795, 869,
90716
+ /* 0 */ 967, 1091, 1324, 1091, 1277, 1277, 142, 142, 1, -19,
90717
+ /* 10 */ 1277, 1277, 1277, 1277, 1277, 209, 136, 721, 1104, 1277,
90718
+ /* 20 */ 1277, 1277, 1277, 1277, 1277, 1277, 1277, 1277, 1277, 1277,
90719
+ /* 30 */ 1277, 1277, 1277, 1277, 1277, 1277, 1277, 1277, 1277, 1277,
90720
+ /* 40 */ 1277, 1277, 1277, 1277, 1277, 1277, 1277, 1277, 1277, 1277,
90721
+ /* 50 */ 1277, 1277, 1277, 1277, 1277, 1190, 1277, 1277, 1277, 1277,
90722
+ /* 60 */ 1277, -49, 361, 136, 136, 992, 138, 992, -103, 55,
90723
+ /* 70 */ 129, 499, 351, 647, 203, 277, 425, 573, 869, 795,
9050690724
/* 80 */ 795, 795, 795, 795, 795, 795, 795, 795, 795, 795,
9050790725
/* 90 */ 795, 795, 795, 795, 795, 795, 795, 795, 943, 1017,
90508
- /* 100 */ 1017, -69, -69, -69, -69, -1, -1, 57, 155, -44,
90509
- /* 110 */ 465, 465, 465, 465, 465, 654, 205, 465, 465, 465,
90510
- /* 120 */ 465, 465, 465, 465, 465, 465, 465, 465, 465, 465,
90511
- /* 130 */ 465, 465, 465, 248, 154, -80, -110, -110, -110, 1303,
90512
- /* 140 */ 131, 95, 291, 352, 458, 510, 582, 582, 465, 465,
90513
- /* 150 */ 465, 465, 465, 465, 465, 465, 465, 465, 465, 465,
90514
- /* 160 */ 465, 465, 465, 465, 465, 465, 465, 465, 465, 465,
90515
- /* 170 */ 465, 465, 465, 465, 465, 465, 465, 465, 465, 465,
90516
- /* 180 */ 613, 683, 601, 379, 379, 379, 657, 586, -109, -109,
90517
- /* 190 */ -109, -110, -110, -110, 172, 172, 275, 160, 516, 667,
90518
- /* 200 */ 724, 442, 744, 883, 60, 60, 612, 367, 236, 803,
90519
- /* 210 */ 708, 708, 143, 718, 708, 708, 708, 708, 542, 426,
90520
- /* 220 */ 438, 154, 773, 773, 713, 428, 428, 904, 428, 876,
90521
- /* 230 */ 428, 154, 428, 154, 643, 1024, 946, 1024, 904, 904,
90522
- /* 240 */ 946, 1115, 1115, 1115, 1115, 1129, 1129, 1127, -109, 1040,
90523
- /* 250 */ 1052, 1059, 1062, 1072, 1066, 1113, 1113, 1140, 1137, 1140,
90524
- /* 260 */ 1137, 1140, 1137, 1154, 1154, 1231, 1154, 1211, 1154, 1302,
90525
- /* 270 */ 1256, 1256, 1231, 1154, 1154, 1154, 1302, 1378, 1113, 1378,
90526
- /* 280 */ 1113, 1378, 1113, 1113, 1353, 1276, 1378, 1113, 1344, 1344,
90527
- /* 290 */ 1404, 1040, 1113, 1412, 1412, 1412, 1412, 1040, 1344, 1404,
90528
- /* 300 */ 1113, 1397, 1397, 1113, 1113, 1408, -110, -110, -110, -110,
90529
- /* 310 */ -110, -110, 939, 46, 547, 905, 983, 971, 972, 970,
90530
- /* 320 */ 1037, 941, 982, 1029, 1047, 1097, 1110, 1128, 1262, 1263,
90531
- /* 330 */ 1093, 1297, 1450, 1437, 1431, 1435, 1341, 1343, 1345, 1346,
90532
- /* 340 */ 1347, 1349, 1443, 1444, 1445, 1447, 1455, 1448, 1449, 1446,
90533
- /* 350 */ 1451, 1452, 1453, 1438, 1454, 1441, 1453, 1358, 1458, 1456,
90534
- /* 360 */ 1457, 1364, 1459, 1460, 1461, 1433, 1464, 1463, 1436, 1465,
90535
- /* 370 */ 1466, 1468, 1471, 1442, 1473, 1394, 1389, 1479, 1481, 1475,
90536
- /* 380 */ 1398, 1462, 1467, 1469, 1478, 1470, 1366, 1402, 1485, 1503,
90537
- /* 390 */ 1508, 1393, 1476, 1486, 1405, 1439, 1440, 1388, 1495, 1400,
90538
- /* 400 */ 1518, 1504, 1401, 1505, 1406, 1420, 1403, 1506, 1407, 1507,
90539
- /* 410 */ 1509, 1515, 1472, 1520, 1396, 1511, 1535, 1536,
90726
+ /* 100 */ 1017, -69, -69, -69, -69, -1, -1, 57, 28, -44,
90727
+ /* 110 */ 136, 136, 502, 136, 136, 136, 136, 136, 136, 136,
90728
+ /* 120 */ 136, 136, 136, 136, 136, 136, 136, 136, 136, 580,
90729
+ /* 130 */ 136, 136, 136, 138, 804, -63, -104, -104, -104, 1356,
90730
+ /* 140 */ 74, 426, 433, 355, 215, 433, 313, 369, 136, 136,
90731
+ /* 150 */ 136, 136, 136, 136, 136, 136, 136, 754, 136, 136,
90732
+ /* 160 */ 136, 136, 136, 136, 136, 136, 136, 827, 136, 136,
90733
+ /* 170 */ 136, 136, 136, 136, 136, 136, 136, 136, 136, 136,
90734
+ /* 180 */ 136, 136, 586, 731, 731, 731, 780, 282, -103, -103,
90735
+ /* 190 */ -103, -104, -104, -104, 94, 158, 94, 12, 220, 662,
90736
+ /* 200 */ 516, 744, 870, 809, 870, 818, 555, 634, 419, 655,
90737
+ /* 210 */ 634, 634, 634, 638, 634, 213, 582, 634, 415, 566,
90738
+ /* 220 */ 138, 566, 138, 435, 642, 884, 138, 358, 309, 309,
90739
+ /* 230 */ 621, 621, 1129, 627, 566, 566, 358, 1129, 309, 566,
90740
+ /* 240 */ 1150, 1177, 1187, 1185, 1101, 1101, 1101, 1207, 1202, 1157,
90741
+ /* 250 */ 1157, 1101, 1197, 1157, 1263, 1197, 1157, 1101, 1202, 1157,
90742
+ /* 260 */ 1263, 1101, 1311, 1330, 1157, 1258, 1263, 1157, 1330, 1363,
90743
+ /* 270 */ 1101, 1363, 1363, 1312, 1280, 1269, 1101, 1354, 1259, 1271,
90744
+ /* 280 */ 1312, 1101, 1177, 1177, 1177, 1271, 1312, 1280, 1269, 1185,
90745
+ /* 290 */ 1280, 1269, 1363, 1288, 1101, 1298, 1300, 1303, 1263, 1271,
90746
+ /* 300 */ 1101, -103, 1187, 1301, 1390, 1311, -104, -104, -104, -104,
90747
+ /* 310 */ -104, -104, 939, 468, 978, 84, 837, 1317, 650, 831,
90748
+ /* 320 */ 971, 595, 1275, 1321, 723, 1046, 901, 1109, 749, 1229,
90749
+ /* 330 */ 972, 1043, 1315, 1445, 1432, 1425, 1427, 1334, 1336, 1338,
90750
+ /* 340 */ 1339, 1340, 1347, 1438, 1439, 1441, 1443, 1450, 1444, 1446,
90751
+ /* 350 */ 1442, 1447, 1448, 1451, 1437, 1452, 1440, 1451, 1359, 1457,
90752
+ /* 360 */ 1449, 1453, 1364, 1459, 1460, 1454, 1436, 1467, 1461, 1455,
90753
+ /* 370 */ 1469, 1471, 1470, 1473, 1456, 1474, 1395, 1391, 1479, 1480,
90754
+ /* 380 */ 1477, 1398, 1462, 1458, 1463, 1478, 1465, 1366, 1402, 1487,
90755
+ /* 390 */ 1505, 1510, 1396, -29, 1485, 1407, 1464, 1466, 1389, 1497,
90756
+ /* 400 */ 1403, 1519, 1506, 1404, 1503, 1408, 1418, 1507, 1400, 1508,
90757
+ /* 410 */ 1509, 1512, 1468, 1515, 1394, 1513, 1533, 1534,
9054090758
};
90541
-#define YY_REDUCE_USE_DFLT (-197)
90759
+#define YY_REDUCE_USE_DFLT (-222)
9054290760
#define YY_REDUCE_MAX 311
9054390761
static const short yy_reduce_ofst[] = {
90544
- /* 0 */ -141, 90, 16, 147, -55, 21, 148, 149, 158, 240,
90545
- /* 10 */ 223, 237, 242, 303, 307, 164, 370, 171, 369, 376,
90546
- /* 20 */ 380, 443, 450, 504, 517, 524, 535, 537, 578, 591,
90547
- /* 30 */ 594, 599, 611, 652, 665, 668, 686, 726, 739, 742,
90548
- /* 40 */ 746, 760, 800, 816, 834, 874, 888, 890, 908, 911,
90549
- /* 50 */ 962, 975, 989, 993, 1030, 1089, 1096, 1102, 1119, 1125,
90550
- /* 60 */ 1131, -196, 954, 740, 396, 169, -68, 463, 405, 459,
90551
- /* 70 */ 459, 459, 459, 459, 459, 459, 459, 459, 459, 459,
90552
- /* 80 */ 459, 459, 459, 459, 459, 459, 459, 459, 459, 459,
90553
- /* 90 */ 459, 459, 459, 459, 459, 459, 459, 459, 459, 459,
90554
- /* 100 */ 459, 459, 459, 459, 459, 459, 459, -21, 459, 459,
90555
- /* 110 */ 538, 375, 592, 666, 814, 6, 222, 521, 682, 817,
90556
- /* 120 */ 356, 244, 466, 684, 691, 891, 994, 1023, 1063, 1142,
90557
- /* 130 */ 1169, 759, 1173, 459, -89, 459, 459, 459, 459, 285,
90558
- /* 140 */ 76, 430, 598, 610, 765, 818, 423, 485, 892, 909,
90559
- /* 150 */ 910, 969, 1006, 818, 1011, 1016, 1067, 1076, 1132, 1177,
90560
- /* 160 */ 1178, 1181, 1186, 1195, 1199, 1200, 1209, 1217, 1218, 1221,
90561
- /* 170 */ 1222, 1234, 1235, 1238, 1241, 1242, 1243, 1244, 1254, 1255,
90562
- /* 180 */ 532, 532, 549, 178, 324, 688, 446, 769, 776, 809,
90563
- /* 190 */ 813, 655, 581, 738, -74, -58, -50, -17, -23, -23,
90564
- /* 200 */ -23, 63, -23, 29, 68, 121, 183, 146, 225, 29,
90565
- /* 210 */ -23, -23, 196, 177, -23, -23, -23, -23, 255, 328,
90566
- /* 220 */ 335, 381, 404, 439, 449, 600, 648, 546, 685, 638,
90567
- /* 230 */ 717, 663, 722, 811, 734, 756, 801, 827, 868, 872,
90568
- /* 240 */ 899, 967, 980, 996, 997, 981, 987, 1003, 961, 976,
90569
- /* 250 */ 979, 992, 998, 1004, 991, 1057, 1070, 1009, 1036, 1038,
90570
- /* 260 */ 1069, 1041, 1080, 1098, 1122, 1111, 1135, 1123, 1139, 1168,
90571
- /* 270 */ 1133, 1143, 1174, 1185, 1194, 1205, 1216, 1257, 1245, 1258,
90572
- /* 280 */ 1253, 1259, 1260, 1261, 1183, 1184, 1266, 1267, 1227, 1236,
90573
- /* 290 */ 1208, 1229, 1272, 1239, 1247, 1248, 1249, 1237, 1264, 1219,
90574
- /* 300 */ 1278, 1201, 1202, 1285, 1286, 1203, 1283, 1268, 1270, 1206,
90575
- /* 310 */ 1204, 1207,
90762
+ /* 0 */ 118, 90, 238, 147, 155, 20, 173, 148, 83, 246,
90763
+ /* 10 */ 377, 379, 385, 241, 228, 386, 297, 312, 443, 445,
90764
+ /* 20 */ 459, 462, 464, 504, 517, 530, 535, 537, 578, 591,
90765
+ /* 30 */ 594, 610, 613, 652, 665, 668, 672, 686, 726, 739,
90766
+ /* 40 */ 742, 760, 800, 816, 834, 874, 888, 890, 908, 911,
90767
+ /* 50 */ 962, 975, 989, 993, 1029, 1065, 1092, 1094, 1097, 1100,
90768
+ /* 60 */ 1105, -221, 1011, 249, 224, 311, 23, 362, 110, 77,
90769
+ /* 70 */ 77, 77, 77, 77, 77, 77, 77, 77, 77, 77,
90770
+ /* 80 */ 77, 77, 77, 77, 77, 77, 77, 77, 77, 77,
90771
+ /* 90 */ 77, 77, 77, 77, 77, 77, 77, 77, 77, 77,
90772
+ /* 100 */ 77, 77, 77, 77, 77, 77, 77, 730, 77, 77,
90773
+ /* 110 */ 813, -88, 22, 669, 596, 762, 341, 833, 743, 740,
90774
+ /* 120 */ 814, 891, 892, 817, 894, 964, 994, 390, -71, 206,
90775
+ /* 130 */ 549, 463, 666, -142, 77, 77, 77, 77, 77, 392,
90776
+ /* 140 */ 273, 970, 815, 996, 1001, 925, 1015, 1023, 1061, 1063,
90777
+ /* 150 */ 1093, 1095, 1098, 1128, 1136, 1137, 1140, 932, 1141, 1142,
90778
+ /* 160 */ 1144, 1145, 1001, 1161, 1162, 1165, 1166, 932, 1167, 1189,
90779
+ /* 170 */ 1195, 31, 208, 451, 670, 673, 820, 821, 822, 830,
90780
+ /* 180 */ 988, 910, -10, 21, 44, 914, 927, 883, 961, 982,
90781
+ /* 190 */ 332, 266, 948, 383, -96, -94, -76, -83, -59, -30,
90782
+ /* 200 */ -41, -59, -3, -59, 10, -59, 177, -59, 105, 247,
90783
+ /* 210 */ -59, -59, -59, 139, -59, -41, 190, -59, 296, 438,
90784
+ /* 220 */ 320, 448, 523, 529, 590, 626, 682, 699, 706, 727,
90785
+ /* 230 */ 764, 819, 734, 745, 897, 921, 848, 920, 960, 998,
90786
+ /* 240 */ 1040, 1004, 1050, 995, 1051, 1062, 1074, 1082, 1069, 1088,
90787
+ /* 250 */ 1106, 1116, 1078, 1149, 1172, 1083, 1171, 1191, 1134, 1173,
90788
+ /* 260 */ 1194, 1196, 1113, 1179, 1183, 1184, 1209, 1192, 1188, 1224,
90789
+ /* 270 */ 1217, 1227, 1228, 1198, 1176, 1180, 1233, 1147, 1168, 1199,
90790
+ /* 280 */ 1208, 1242, 1210, 1211, 1212, 1201, 1216, 1203, 1204, 1182,
90791
+ /* 290 */ 1206, 1213, 1265, 1214, 1261, 1218, 1220, 1226, 1272, 1232,
90792
+ /* 300 */ 1270, 1238, 1282, 1205, 1200, 1215, 1219, 1257, 1260, 1281,
90793
+ /* 310 */ 1221, 1222,
9057690794
};
9057790795
static const YYACTIONTYPE yy_default[] = {
90578
- /* 0 */ 634, 869, 958, 958, 869, 958, 958, 898, 898, 757,
90579
- /* 10 */ 867, 958, 958, 958, 958, 958, 958, 932, 958, 958,
90796
+ /* 0 */ 634, 869, 958, 958, 869, 958, 898, 898, 958, 757,
90797
+ /* 10 */ 958, 867, 958, 958, 958, 958, 958, 932, 958, 958,
9058090798
/* 20 */ 958, 958, 958, 958, 958, 958, 958, 958, 958, 958,
9058190799
/* 30 */ 958, 958, 958, 958, 958, 958, 958, 958, 958, 958,
9058290800
/* 40 */ 958, 958, 958, 958, 958, 958, 958, 958, 958, 958,
9058390801
/* 50 */ 958, 958, 958, 958, 958, 958, 958, 958, 958, 958,
90584
- /* 60 */ 958, 841, 958, 958, 958, 673, 898, 898, 761, 792,
90585
- /* 70 */ 958, 958, 958, 958, 958, 958, 958, 958, 793, 958,
90586
- /* 80 */ 871, 866, 862, 864, 863, 870, 794, 783, 790, 797,
90587
- /* 90 */ 772, 911, 799, 800, 806, 807, 933, 931, 829, 828,
90588
- /* 100 */ 847, 831, 845, 853, 846, 830, 840, 665, 832, 833,
90589
- /* 110 */ 958, 958, 958, 958, 958, 726, 660, 958, 958, 958,
90590
- /* 120 */ 958, 958, 958, 958, 958, 958, 958, 958, 958, 958,
90591
- /* 130 */ 958, 958, 958, 834, 958, 835, 848, 849, 850, 958,
90592
- /* 140 */ 958, 958, 958, 958, 958, 958, 958, 958, 640, 958,
90802
+ /* 60 */ 958, 841, 958, 958, 958, 898, 673, 898, 761, 792,
90803
+ /* 70 */ 958, 958, 958, 958, 958, 958, 958, 958, 958, 931,
90804
+ /* 80 */ 793, 783, 911, 864, 806, 772, 800, 797, 933, 866,
90805
+ /* 90 */ 863, 799, 790, 794, 871, 807, 870, 862, 829, 847,
90806
+ /* 100 */ 828, 846, 853, 831, 845, 830, 840, 665, 832, 833,
90807
+ /* 110 */ 958, 958, 660, 958, 958, 958, 958, 958, 958, 958,
90808
+ /* 120 */ 958, 958, 958, 958, 958, 958, 958, 958, 958, 726,
90809
+ /* 130 */ 958, 958, 958, 958, 834, 835, 849, 848, 850, 958,
90810
+ /* 140 */ 958, 958, 958, 958, 958, 958, 958, 958, 882, 958,
9059390811
/* 150 */ 958, 958, 958, 958, 958, 958, 958, 958, 958, 958,
90594
- /* 160 */ 958, 958, 958, 958, 958, 958, 958, 958, 958, 958,
90595
- /* 170 */ 958, 958, 958, 958, 958, 882, 958, 936, 938, 958,
90596
- /* 180 */ 958, 958, 634, 757, 757, 757, 958, 958, 958, 958,
90597
- /* 190 */ 958, 751, 761, 950, 958, 958, 717, 958, 958, 958,
90598
- /* 200 */ 958, 958, 958, 958, 958, 958, 642, 749, 675, 759,
90599
- /* 210 */ 662, 738, 904, 958, 923, 921, 740, 802, 958, 749,
90600
- /* 220 */ 758, 958, 958, 958, 865, 786, 786, 774, 786, 696,
90601
- /* 230 */ 786, 958, 786, 958, 699, 916, 796, 916, 774, 774,
90602
- /* 240 */ 796, 639, 639, 639, 639, 650, 650, 716, 958, 796,
90603
- /* 250 */ 787, 789, 779, 791, 958, 765, 765, 773, 778, 773,
90604
- /* 260 */ 778, 773, 778, 728, 728, 713, 728, 699, 728, 875,
90605
- /* 270 */ 879, 879, 713, 728, 728, 728, 875, 657, 765, 657,
90606
- /* 280 */ 765, 657, 765, 765, 908, 910, 657, 765, 730, 730,
90607
- /* 290 */ 808, 796, 765, 737, 737, 737, 737, 796, 730, 808,
90608
- /* 300 */ 765, 935, 935, 765, 765, 943, 683, 701, 701, 950,
90812
+ /* 160 */ 958, 958, 958, 958, 958, 958, 640, 958, 958, 958,
90813
+ /* 170 */ 958, 958, 958, 958, 936, 958, 958, 958, 938, 958,
90814
+ /* 180 */ 958, 958, 958, 757, 757, 757, 634, 958, 958, 958,
90815
+ /* 190 */ 958, 761, 751, 950, 958, 717, 958, 958, 958, 958,
90816
+ /* 200 */ 958, 958, 958, 958, 958, 958, 642, 921, 958, 675,
90817
+ /* 210 */ 802, 662, 740, 904, 738, 759, 749, 923, 696, 786,
90818
+ /* 220 */ 958, 786, 958, 699, 749, 758, 958, 796, 774, 774,
90819
+ /* 230 */ 958, 958, 916, 865, 786, 786, 796, 916, 774, 786,
90820
+ /* 240 */ 958, 737, 650, 808, 765, 765, 765, 716, 713, 728,
90821
+ /* 250 */ 728, 765, 879, 728, 657, 879, 728, 765, 713, 728,
90822
+ /* 260 */ 657, 765, 935, 875, 728, 699, 657, 728, 875, 639,
90823
+ /* 270 */ 765, 639, 639, 730, 773, 778, 765, 943, 958, 796,
90824
+ /* 280 */ 730, 765, 737, 737, 737, 796, 730, 773, 778, 808,
90825
+ /* 290 */ 773, 778, 639, 791, 765, 779, 789, 787, 657, 796,
90826
+ /* 300 */ 765, 958, 650, 910, 908, 935, 950, 701, 701, 683,
9060990827
/* 310 */ 955, 955, 958, 958, 958, 958, 958, 958, 958, 958,
90610
- /* 320 */ 958, 958, 958, 958, 958, 958, 958, 958, 958, 958,
90611
- /* 330 */ 884, 958, 958, 648, 958, 667, 815, 820, 816, 958,
90612
- /* 340 */ 817, 743, 958, 958, 958, 958, 958, 958, 958, 958,
90613
- /* 350 */ 958, 958, 868, 958, 780, 958, 788, 958, 958, 958,
90828
+ /* 320 */ 958, 958, 958, 958, 958, 884, 958, 958, 958, 958,
90829
+ /* 330 */ 958, 958, 958, 958, 648, 958, 667, 815, 820, 816,
90830
+ /* 340 */ 958, 817, 743, 958, 958, 958, 958, 958, 958, 958,
90831
+ /* 350 */ 958, 958, 958, 868, 958, 780, 958, 788, 958, 958,
9061490832
/* 360 */ 958, 958, 958, 958, 958, 958, 958, 958, 958, 958,
9061590833
/* 370 */ 958, 958, 958, 958, 958, 958, 958, 958, 958, 958,
90616
- /* 380 */ 958, 958, 958, 906, 907, 958, 958, 958, 958, 958,
90617
- /* 390 */ 958, 914, 958, 958, 958, 958, 958, 958, 958, 958,
90834
+ /* 380 */ 958, 958, 958, 958, 906, 907, 958, 958, 958, 958,
90835
+ /* 390 */ 958, 958, 914, 958, 958, 958, 958, 958, 958, 958,
9061890836
/* 400 */ 958, 958, 958, 958, 958, 958, 958, 958, 958, 958,
90619
- /* 410 */ 958, 958, 942, 958, 958, 945, 635, 958, 630, 632,
90620
- /* 420 */ 633, 637, 638, 641, 667, 668, 670, 671, 672, 643,
90621
- /* 430 */ 644, 645, 646, 647, 649, 653, 651, 652, 654, 661,
90622
- /* 440 */ 663, 682, 684, 686, 747, 748, 812, 741, 742, 746,
90623
- /* 450 */ 669, 823, 814, 818, 819, 821, 822, 836, 837, 839,
90624
- /* 460 */ 844, 852, 855, 838, 843, 851, 854, 744, 745, 858,
90625
- /* 470 */ 676, 677, 680, 681, 894, 896, 895, 897, 679, 678,
90626
- /* 480 */ 824, 827, 860, 861, 924, 925, 926, 927, 928, 856,
90627
- /* 490 */ 766, 859, 842, 781, 784, 785, 782, 750, 760, 768,
90628
- /* 500 */ 769, 770, 771, 755, 756, 762, 777, 810, 811, 775,
90629
- /* 510 */ 776, 763, 764, 752, 753, 754, 857, 813, 825, 826,
90630
- /* 520 */ 687, 688, 820, 689, 690, 691, 729, 732, 733, 734,
90631
- /* 530 */ 692, 711, 714, 715, 693, 700, 694, 695, 702, 703,
90632
- /* 540 */ 704, 706, 707, 708, 709, 710, 705, 876, 877, 880,
90633
- /* 550 */ 878, 697, 698, 712, 685, 674, 666, 718, 721, 722,
90634
- /* 560 */ 723, 724, 725, 727, 719, 720, 664, 655, 658, 767,
90635
- /* 570 */ 900, 909, 905, 901, 902, 903, 659, 872, 873, 731,
90636
- /* 580 */ 804, 805, 899, 912, 915, 917, 918, 919, 809, 920,
90637
- /* 590 */ 922, 913, 947, 656, 735, 736, 739, 881, 929, 795,
90638
- /* 600 */ 798, 801, 803, 883, 885, 887, 889, 890, 891, 892,
90639
- /* 610 */ 893, 886, 888, 930, 934, 937, 939, 940, 941, 944,
90640
- /* 620 */ 946, 951, 952, 953, 956, 957, 954, 636, 631,
90837
+ /* 410 */ 958, 958, 942, 958, 958, 945, 635, 958, 711, 649,
90838
+ /* 420 */ 734, 733, 732, 729, 691, 690, 689, 647, 820, 688,
90839
+ /* 430 */ 767, 687, 826, 900, 825, 813, 937, 646, 909, 905,
90840
+ /* 440 */ 645, 857, 939, 901, 902, 957, 903, 659, 644, 754,
90841
+ /* 450 */ 753, 752, 954, 764, 630, 763, 776, 872, 873, 643,
90842
+ /* 460 */ 775, 811, 810, 777, 731, 804, 805, 762, 899, 940,
90843
+ /* 470 */ 912, 756, 755, 636, 771, 915, 770, 672, 769, 917,
90844
+ /* 480 */ 671, 918, 941, 768, 760, 750, 944, 782, 785, 919,
90845
+ /* 490 */ 631, 784, 781, 670, 842, 859, 766, 856, 809, 928,
90846
+ /* 500 */ 927, 668, 926, 925, 924, 861, 920, 860, 946, 827,
90847
+ /* 510 */ 824, 678, 922, 667, 913, 641, 679, 897, 951, 895,
90848
+ /* 520 */ 947, 656, 896, 894, 681, 735, 952, 736, 680, 677,
90849
+ /* 530 */ 739, 676, 858, 881, 745, 744, 929, 854, 638, 851,
90850
+ /* 540 */ 843, 838, 795, 855, 852, 844, 637, 839, 837, 798,
90851
+ /* 550 */ 836, 822, 821, 819, 818, 953, 814, 823, 801, 633,
90852
+ /* 560 */ 803, 669, 883, 746, 742, 741, 812, 885, 887, 889,
90853
+ /* 570 */ 890, 891, 892, 893, 748, 632, 886, 956, 888, 747,
90854
+ /* 580 */ 666, 718, 674, 721, 686, 684, 685, 712, 682, 698,
90855
+ /* 590 */ 722, 663, 697, 878, 880, 723, 930, 877, 876, 705,
90856
+ /* 600 */ 724, 661, 654, 710, 709, 934, 708, 707, 706, 704,
90857
+ /* 610 */ 652, 725, 727, 719, 720, 664, 703, 702, 695, 694,
90858
+ /* 620 */ 700, 693, 715, 655, 651, 653, 658, 714, 692,
9064190859
};
9064290860
#define YY_SZ_ACTTAB (int)(sizeof(yy_action)/sizeof(yy_action[0]))
9064390861
9064490862
/* The next table maps tokens into fallback tokens. If a construct
9064590863
** like the following:
@@ -92151,11 +92369,11 @@
9215192369
break;
9215292370
case 69: /* ccons ::= COLLATE ids */
9215392371
{sqlite3AddCollateType(pParse, &yymsp[0].minor.yy0);}
9215492372
break;
9215592373
case 72: /* refargs ::= */
92156
-{ yygotominor.yy328 = OE_None * 0x000101; }
92374
+{ yygotominor.yy328 = OE_None*0x0101; /* EV: R-19803-45884 */}
9215792375
break;
9215892376
case 73: /* refargs ::= refargs refarg */
9215992377
{ yygotominor.yy328 = (yymsp[-1].minor.yy328 & ~yymsp[0].minor.yy429.mask) | yymsp[0].minor.yy429.value; }
9216092378
break;
9216192379
case 74: /* refarg ::= MATCH nm */
@@ -92166,23 +92384,23 @@
9216692384
break;
9216792385
case 76: /* refarg ::= ON UPDATE refact */
9216892386
{ yygotominor.yy429.value = yymsp[0].minor.yy328<<8; yygotominor.yy429.mask = 0x00ff00; }
9216992387
break;
9217092388
case 77: /* refact ::= SET NULL */
92171
-{ yygotominor.yy328 = OE_SetNull; }
92389
+{ yygotominor.yy328 = OE_SetNull; /* EV: R-33326-45252 */}
9217292390
break;
9217392391
case 78: /* refact ::= SET DEFAULT */
92174
-{ yygotominor.yy328 = OE_SetDflt; }
92392
+{ yygotominor.yy328 = OE_SetDflt; /* EV: R-33326-45252 */}
9217592393
break;
9217692394
case 79: /* refact ::= CASCADE */
92177
-{ yygotominor.yy328 = OE_Cascade; }
92395
+{ yygotominor.yy328 = OE_Cascade; /* EV: R-33326-45252 */}
9217892396
break;
9217992397
case 80: /* refact ::= RESTRICT */
92180
-{ yygotominor.yy328 = OE_Restrict; }
92398
+{ yygotominor.yy328 = OE_Restrict; /* EV: R-33326-45252 */}
9218192399
break;
9218292400
case 81: /* refact ::= NO ACTION */
92183
-{ yygotominor.yy328 = OE_None; }
92401
+{ yygotominor.yy328 = OE_None; /* EV: R-33326-45252 */}
9218492402
break;
9218592403
case 83: /* defer_subclause ::= DEFERRABLE init_deferred_pred_opt */
9218692404
case 98: /* defer_subclause_opt ::= defer_subclause */ yytestcase(yyruleno==98);
9218792405
case 100: /* onconf ::= ON CONFLICT resolvetype */ yytestcase(yyruleno==100);
9218892406
case 103: /* resolvetype ::= raisetype */ yytestcase(yyruleno==103);
@@ -93431,19 +93649,19 @@
9343193649
0, 65, 6, 0, 48, 86, 98, 0, 115, 97, 0, 0, 45,
9343293650
0, 99, 24, 0, 17, 0, 119, 49, 23, 0, 5, 106, 25,
9343393651
92, 0, 0, 121, 102, 56, 120, 53, 28, 51, 0, 87, 0,
9343493652
96, 26, 0, 95, 0, 0, 0, 91, 88, 93, 84, 105, 14,
9343593653
39, 104, 0, 77, 0, 18, 85, 107, 32, 0, 117, 76, 109,
93436
- 59, 46, 80, 0, 0, 90, 40, 0, 112, 0, 36, 0, 0,
93437
- 29, 0, 82, 58, 60, 0, 20, 57, 0, 52,
93654
+ 57, 46, 80, 0, 0, 90, 40, 0, 112, 0, 36, 0, 0,
93655
+ 29, 0, 82, 59, 60, 0, 20, 58, 0, 52,
9343893656
};
9343993657
static const unsigned char aNext[121] = {
9344093658
0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0,
9344193659
0, 2, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0,
9344293660
0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
9344393661
0, 0, 0, 0, 0, 33, 21, 0, 0, 0, 43, 3, 47,
93444
- 0, 0, 0, 0, 30, 54, 0, 0, 38, 0, 0, 0, 1,
93662
+ 0, 0, 0, 0, 0, 30, 54, 0, 38, 0, 0, 0, 1,
9344593663
62, 0, 0, 63, 0, 41, 0, 0, 0, 0, 0, 0, 0,
9344693664
61, 0, 0, 0, 0, 31, 55, 16, 34, 10, 0, 0, 0,
9344793665
0, 0, 0, 0, 11, 68, 75, 0, 8, 0, 100, 94, 0,
9344893666
103, 0, 83, 0, 71, 0, 0, 110, 27, 37, 69, 79, 0,
9344993667
35, 64, 0, 0,
@@ -93451,11 +93669,11 @@
9345193669
static const unsigned char aLen[121] = {
9345293670
7, 7, 5, 4, 6, 4, 5, 3, 6, 7, 3, 6, 6,
9345393671
7, 7, 3, 8, 2, 6, 5, 4, 4, 3, 10, 4, 6,
9345493672
11, 6, 2, 7, 5, 5, 9, 6, 9, 9, 7, 10, 10,
9345593673
4, 6, 2, 3, 4, 9, 2, 6, 5, 6, 6, 5, 6,
93456
- 5, 5, 7, 7, 7, 2, 3, 4, 4, 7, 3, 6, 4,
93674
+ 5, 5, 7, 7, 3, 7, 2, 4, 4, 7, 3, 6, 4,
9345793675
7, 6, 12, 6, 9, 4, 6, 5, 4, 7, 6, 5, 6,
9345893676
7, 5, 4, 5, 6, 5, 7, 3, 7, 13, 2, 2, 4,
9345993677
6, 6, 8, 5, 17, 12, 7, 8, 8, 2, 4, 4, 4,
9346093678
4, 4, 2, 2, 6, 5, 8, 5, 5, 8, 3, 5, 5,
9346193679
6, 4, 9, 3,
@@ -93482,11 +93700,11 @@
9348293700
TK_ALTER, TK_RAISE, TK_EXCLUSIVE, TK_EXISTS, TK_SAVEPOINT,
9348393701
TK_INTERSECT, TK_TRIGGER, TK_REFERENCES, TK_CONSTRAINT, TK_INTO,
9348493702
TK_OFFSET, TK_OF, TK_SET, TK_TEMP, TK_TEMP,
9348593703
TK_OR, TK_UNIQUE, TK_QUERY, TK_ATTACH, TK_HAVING,
9348693704
TK_GROUP, TK_UPDATE, TK_BEGIN, TK_JOIN_KW, TK_RELEASE,
93487
- TK_BETWEEN, TK_NOTNULL, TK_NO, TK_NOT, TK_NULL,
93705
+ TK_BETWEEN, TK_NOT, TK_NOTNULL, TK_NO, TK_NULL,
9348893706
TK_LIKE_KW, TK_CASCADE, TK_ASC, TK_DELETE, TK_CASE,
9348993707
TK_COLLATE, TK_CREATE, TK_CTIME_KW, TK_DETACH, TK_IMMEDIATE,
9349093708
TK_JOIN, TK_INSERT, TK_MATCH, TK_PLAN, TK_ANALYZE,
9349193709
TK_PRAGMA, TK_ABORT, TK_VALUES, TK_VIRTUAL, TK_LIMIT,
9349293710
TK_WHEN, TK_WHERE, TK_RENAME, TK_AFTER, TK_REPLACE,
@@ -93560,13 +93778,13 @@
9356093778
testcase( i==51 ); /* UPDATE */
9356193779
testcase( i==52 ); /* BEGIN */
9356293780
testcase( i==53 ); /* INNER */
9356393781
testcase( i==54 ); /* RELEASE */
9356493782
testcase( i==55 ); /* BETWEEN */
93565
- testcase( i==56 ); /* NOTNULL */
93566
- testcase( i==57 ); /* NO */
93567
- testcase( i==58 ); /* NOT */
93783
+ testcase( i==56 ); /* NOT */
93784
+ testcase( i==57 ); /* NOTNULL */
93785
+ testcase( i==58 ); /* NO */
9356893786
testcase( i==59 ); /* NULL */
9356993787
testcase( i==60 ); /* LIKE */
9357093788
testcase( i==61 ); /* CASCADE */
9357193789
testcase( i==62 ); /* ASC */
9357293790
testcase( i==63 ); /* DELETE */
@@ -95956,12 +96174,12 @@
9595696174
# error SQLITE_MAX_ATTACHED must be between 0 and 30
9595796175
#endif
9595896176
#if SQLITE_MAX_LIKE_PATTERN_LENGTH<1
9595996177
# error SQLITE_MAX_LIKE_PATTERN_LENGTH must be at least 1
9596096178
#endif
95961
-#if SQLITE_MAX_VARIABLE_NUMBER<1
95962
-# error SQLITE_MAX_VARIABLE_NUMBER must be at least 1
96179
+#if SQLITE_MAX_VARIABLE_NUMBER<1 || SQLITE_MAX_VARIABLE_NUMBER>32767
96180
+# error SQLITE_MAX_VARIABLE_NUMBER must be between 1 and 32767
9596396181
#endif
9596496182
#if SQLITE_MAX_COLUMN>32767
9596596183
# error SQLITE_MAX_COLUMN must not exceed 32767
9596696184
#endif
9596796185
#if SQLITE_MAX_TRIGGER_DEPTH<1
9596896186
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -1,8 +1,8 @@
1 /******************************************************************************
2 ** This file is an amalgamation of many separate C source files from SQLite
3 ** version 3.6.19. By combining all the individual C code files into this
4 ** single large file, the entire code can be compiled as a one translation
5 ** unit. This allows many compilers to do optimizations that would not be
6 ** possible if the files were compiled separately. Performance improvements
7 ** of 5% are more are commonly seen when SQLite is compiled as a single
8 ** translation unit.
@@ -15,11 +15,11 @@
15 ** of the embedded sqlite3.h header file.) Additional code files may be needed
16 ** if you want a wrapper to interface SQLite with your choice of programming
17 ** language. The code for the "sqlite3" command-line shell is also in a
18 ** separate file. This file contains only code for the core SQLite library.
19 **
20 ** This amalgamation was generated on 2009-10-14 11:34:12 UTC.
21 */
22 #define SQLITE_CORE 1
23 #define SQLITE_AMALGAMATION 1
24 #ifndef SQLITE_PRIVATE
25 # define SQLITE_PRIVATE static
@@ -649,13 +649,13 @@
649 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
650 ** [sqlite_version()] and [sqlite_source_id()].
651 **
652 ** Requirements: [H10011] [H10014]
653 */
654 #define SQLITE_VERSION "3.6.19"
655 #define SQLITE_VERSION_NUMBER 3006019
656 #define SQLITE_SOURCE_ID "2009-10-14 11:33:55 c1d499afc50d54b376945b4efb65c56c787a073d"
657
658 /*
659 ** CAPI3REF: Run-Time Library Version Numbers {H10020} <S60100>
660 ** KEYWORDS: sqlite3_version
661 **
@@ -775,23 +775,13 @@
775 /*
776 ** CAPI3REF: Closing A Database Connection {H12010} <S30100><S40200>
777 **
778 ** This routine is the destructor for the [sqlite3] object.
779 **
780 ** Applications should [sqlite3_finalize | finalize] all [prepared statements]
781 ** and [sqlite3_blob_close | close] all [BLOB handles] associated with
782 ** the [sqlite3] object prior to attempting to close the object.
783 ** The [sqlite3_next_stmt()] interface can be used to locate all
784 ** [prepared statements] associated with a [database connection] if desired.
785 ** Typical code might look like this:
786 **
787 ** <blockquote><pre>
788 ** sqlite3_stmt *pStmt;
789 ** while( (pStmt = sqlite3_next_stmt(db, 0))!=0 ){
790 ** &nbsp; sqlite3_finalize(pStmt);
791 ** }
792 ** </pre></blockquote>
793 **
794 ** If [sqlite3_close()] is invoked while a transaction is open,
795 ** the transaction is automatically rolled back.
796 **
797 ** The C parameter to [sqlite3_close(C)] must be either a NULL
@@ -1365,10 +1355,13 @@
1365 ** CAPI3REF: Initialize The SQLite Library {H10130} <S20000><S30100>
1366 **
1367 ** The sqlite3_initialize() routine initializes the
1368 ** SQLite library. The sqlite3_shutdown() routine
1369 ** deallocates any resources that were allocated by sqlite3_initialize().
 
 
 
1370 **
1371 ** A call to sqlite3_initialize() is an "effective" call if it is
1372 ** the first time sqlite3_initialize() is invoked during the lifetime of
1373 ** the process, or if it is the first time sqlite3_initialize() is invoked
1374 ** following a call to sqlite3_shutdown(). Only an effective call
@@ -1376,15 +1369,21 @@
1376 ** are harmless no-ops.
1377 **
1378 ** A call to sqlite3_shutdown() is an "effective" call if it is the first
1379 ** call to sqlite3_shutdown() since the last sqlite3_initialize(). Only
1380 ** an effective call to sqlite3_shutdown() does any deinitialization.
1381 ** All other calls to sqlite3_shutdown() are harmless no-ops.
1382 **
1383 ** Among other things, sqlite3_initialize() shall invoke
 
 
 
 
 
 
1384 ** sqlite3_os_init(). Similarly, sqlite3_shutdown()
1385 ** shall invoke sqlite3_os_end().
1386 **
1387 ** The sqlite3_initialize() routine returns [SQLITE_OK] on success.
1388 ** If for some reason, sqlite3_initialize() is unable to initialize
1389 ** the library (perhaps it is unable to allocate a needed resource such
1390 ** as a mutex) it returns an [error code] other than [SQLITE_OK].
@@ -2926,11 +2925,11 @@
2926 ** recommended for all new programs. The two older interfaces are retained
2927 ** for backwards compatibility, but their use is discouraged.
2928 ** In the "v2" interfaces, the prepared statement
2929 ** that is returned (the [sqlite3_stmt] object) contains a copy of the
2930 ** original SQL text. This causes the [sqlite3_step()] interface to
2931 ** behave a differently in two ways:
2932 **
2933 ** <ol>
2934 ** <li>
2935 ** If the database schema changes, instead of returning [SQLITE_SCHEMA] as it
2936 ** always used to do, [sqlite3_step()] will automatically recompile the SQL
@@ -2948,10 +2947,18 @@
2948 ** [sqlite3_step()] would only return a generic [SQLITE_ERROR] result code
2949 ** and you would have to make a second call to [sqlite3_reset()] in order
2950 ** to find the underlying cause of the problem. With the "v2" prepare
2951 ** interfaces, the underlying reason for the error is returned immediately.
2952 ** </li>
 
 
 
 
 
 
 
 
2953 ** </ol>
2954 **
2955 ** Requirements:
2956 ** [H13011] [H13012] [H13013] [H13014] [H13015] [H13016] [H13019] [H13021]
2957 **
@@ -3480,10 +3487,12 @@
3480 ** result row of a query. In every case the first argument is a pointer
3481 ** to the [prepared statement] that is being evaluated (the [sqlite3_stmt*]
3482 ** that was returned from [sqlite3_prepare_v2()] or one of its variants)
3483 ** and the second argument is the index of the column for which information
3484 ** should be returned. The leftmost column of the result set has the index 0.
 
 
3485 **
3486 ** If the SQL statement does not currently point to a valid row, or if the
3487 ** column index is out of range, the result is undefined.
3488 ** These routines may only be called when the most recent call to
3489 ** [sqlite3_step()] has returned [SQLITE_ROW] and neither
@@ -7311,151 +7320,151 @@
7311 */
7312 /************** Include opcodes.h in the middle of vdbe.h ********************/
7313 /************** Begin file opcodes.h *****************************************/
7314 /* Automatically generated. Do not edit */
7315 /* See the mkopcodeh.awk script for details */
7316 #define OP_VNext 1
7317 #define OP_Affinity 2
7318 #define OP_Column 3
7319 #define OP_SetCookie 4
7320 #define OP_Seek 5
7321 #define OP_Real 130 /* same as TK_FLOAT */
7322 #define OP_Sequence 6
7323 #define OP_Savepoint 7
7324 #define OP_Ge 80 /* same as TK_GE */
7325 #define OP_RowKey 8
7326 #define OP_SCopy 9
7327 #define OP_Eq 76 /* same as TK_EQ */
7328 #define OP_OpenWrite 10
7329 #define OP_NotNull 74 /* same as TK_NOTNULL */
7330 #define OP_If 11
 
 
 
 
 
 
 
 
7331 #define OP_ToInt 144 /* same as TK_TO_INT */
7332 #define OP_String8 94 /* same as TK_STRING */
7333 #define OP_CollSeq 12
7334 #define OP_OpenRead 13
7335 #define OP_Expire 14
7336 #define OP_AutoCommit 15
7337 #define OP_Gt 77 /* same as TK_GT */
7338 #define OP_Pagecount 16
7339 #define OP_IntegrityCk 17
7340 #define OP_Sort 18
7341 #define OP_Copy 20
7342 #define OP_Trace 21
7343 #define OP_Function 22
7344 #define OP_IfNeg 23
7345 #define OP_And 69 /* same as TK_AND */
7346 #define OP_Subtract 87 /* same as TK_MINUS */
7347 #define OP_Noop 24
7348 #define OP_Program 25
7349 #define OP_Return 26
7350 #define OP_Remainder 90 /* same as TK_REM */
7351 #define OP_NewRowid 27
7352 #define OP_Multiply 88 /* same as TK_STAR */
7353 #define OP_FkCounter 28
7354 #define OP_Variable 29
7355 #define OP_String 30
7356 #define OP_RealAffinity 31
7357 #define OP_VRename 32
7358 #define OP_ParseSchema 33
7359 #define OP_VOpen 34
7360 #define OP_Close 35
7361 #define OP_CreateIndex 36
7362 #define OP_IsUnique 37
7363 #define OP_NotFound 38
7364 #define OP_Int64 39
7365 #define OP_MustBeInt 40
7366 #define OP_Halt 41
7367 #define OP_Rowid 42
7368 #define OP_IdxLT 43
7369 #define OP_AddImm 44
7370 #define OP_RowData 45
7371 #define OP_MemMax 46
7372 #define OP_Or 68 /* same as TK_OR */
7373 #define OP_NotExists 47
7374 #define OP_Gosub 48
7375 #define OP_Divide 89 /* same as TK_SLASH */
7376 #define OP_Integer 49
7377 #define OP_ToNumeric 143 /* same as TK_TO_NUMERIC*/
7378 #define OP_Prev 50
7379 #define OP_RowSetRead 51
7380 #define OP_Concat 91 /* same as TK_CONCAT */
7381 #define OP_RowSetAdd 52
 
 
 
 
 
 
7382 #define OP_BitAnd 82 /* same as TK_BITAND */
7383 #define OP_VColumn 53
7384 #define OP_CreateTable 54
7385 #define OP_Last 55
7386 #define OP_SeekLe 56
7387 #define OP_IsNull 73 /* same as TK_ISNULL */
7388 #define OP_IncrVacuum 57
7389 #define OP_IdxRowid 58
7390 #define OP_ShiftRight 85 /* same as TK_RSHIFT */
7391 #define OP_ResetCount 59
7392 #define OP_Yield 60
7393 #define OP_DropTrigger 61
7394 #define OP_DropIndex 62
7395 #define OP_Param 63
7396 #define OP_IdxGE 64
7397 #define OP_IdxDelete 65
7398 #define OP_Vacuum 66
7399 #define OP_IfNot 67
7400 #define OP_DropTable 70
7401 #define OP_SeekLt 71
7402 #define OP_MakeRecord 72
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7403 #define OP_ToBlob 142 /* same as TK_TO_BLOB */
7404 #define OP_ResultRow 81
7405 #define OP_Delete 92
7406 #define OP_AggFinal 95
7407 #define OP_Compare 96
7408 #define OP_ShiftLeft 84 /* same as TK_LSHIFT */
7409 #define OP_Goto 97
7410 #define OP_TableLock 98
7411 #define OP_Clear 99
7412 #define OP_Le 78 /* same as TK_LE */
7413 #define OP_VerifyCookie 100
7414 #define OP_AggStep 101
7415 #define OP_ToText 141 /* same as TK_TO_TEXT */
7416 #define OP_Not 19 /* same as TK_NOT */
7417 #define OP_ToReal 145 /* same as TK_TO_REAL */
7418 #define OP_Transaction 102
7419 #define OP_VFilter 103
7420 #define OP_Ne 75 /* same as TK_NE */
7421 #define OP_VDestroy 104
7422 #define OP_BitOr 83 /* same as TK_BITOR */
7423 #define OP_Next 105
7424 #define OP_Count 106
7425 #define OP_IdxInsert 107
7426 #define OP_Lt 79 /* same as TK_LT */
7427 #define OP_FkIfZero 108
7428 #define OP_SeekGe 109
7429 #define OP_Insert 110
7430 #define OP_Destroy 111
7431 #define OP_ReadCookie 112
7432 #define OP_RowSetTest 113
7433 #define OP_LoadAnalysis 114
7434 #define OP_Explain 115
7435 #define OP_HaltIfNull 116
7436 #define OP_OpenPseudo 117
7437 #define OP_OpenEphemeral 118
7438 #define OP_Null 119
7439 #define OP_Move 120
7440 #define OP_Blob 121
7441 #define OP_Add 86 /* same as TK_PLUS */
7442 #define OP_Rewind 122
7443 #define OP_SeekGt 123
7444 #define OP_VBegin 124
7445 #define OP_VUpdate 125
7446 #define OP_IfZero 126
7447 #define OP_BitNot 93 /* same as TK_BITNOT */
7448 #define OP_VCreate 127
7449 #define OP_Found 128
7450 #define OP_IfPos 129
7451 #define OP_NullRow 131
7452 #define OP_Jump 132
7453 #define OP_Permutation 133
7454
7455 /* The following opcode values are never used */
7456 #define OP_NotUsed_134 134
7457 #define OP_NotUsed_135 135
7458 #define OP_NotUsed_136 136
7459 #define OP_NotUsed_137 137
7460 #define OP_NotUsed_138 138
7461 #define OP_NotUsed_139 139
@@ -7471,27 +7480,27 @@
7471 #define OPFLG_IN1 0x0004 /* in1: P1 is an input */
7472 #define OPFLG_IN2 0x0008 /* in2: P2 is an input */
7473 #define OPFLG_IN3 0x0010 /* in3: P3 is an input */
7474 #define OPFLG_OUT3 0x0020 /* out3: P3 is an output */
7475 #define OPFLG_INITIALIZER {\
7476 /* 0 */ 0x00, 0x01, 0x00, 0x00, 0x10, 0x08, 0x02, 0x00,\
7477 /* 8 */ 0x00, 0x04, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00,\
7478 /* 16 */ 0x02, 0x00, 0x01, 0x04, 0x04, 0x00, 0x00, 0x05,\
7479 /* 24 */ 0x00, 0x01, 0x04, 0x02, 0x00, 0x00, 0x02, 0x04,\
7480 /* 32 */ 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, 0x11, 0x02,\
7481 /* 40 */ 0x05, 0x00, 0x02, 0x11, 0x04, 0x00, 0x08, 0x11,\
7482 /* 48 */ 0x01, 0x02, 0x01, 0x21, 0x08, 0x00, 0x02, 0x01,\
7483 /* 56 */ 0x11, 0x01, 0x02, 0x00, 0x04, 0x00, 0x00, 0x02,\
7484 /* 64 */ 0x11, 0x00, 0x00, 0x05, 0x2c, 0x2c, 0x00, 0x11,\
7485 /* 72 */ 0x00, 0x05, 0x05, 0x15, 0x15, 0x15, 0x15, 0x15,\
7486 /* 80 */ 0x15, 0x00, 0x2c, 0x2c, 0x2c, 0x2c, 0x2c, 0x2c,\
7487 /* 88 */ 0x2c, 0x2c, 0x2c, 0x2c, 0x00, 0x04, 0x02, 0x00,\
7488 /* 96 */ 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,\
7489 /* 104 */ 0x00, 0x01, 0x02, 0x08, 0x01, 0x11, 0x00, 0x02,\
7490 /* 112 */ 0x02, 0x15, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02,\
7491 /* 120 */ 0x00, 0x02, 0x01, 0x11, 0x00, 0x00, 0x05, 0x00,\
7492 /* 128 */ 0x11, 0x05, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00,\
7493 /* 136 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x04, 0x04,\
7494 /* 144 */ 0x04, 0x04,}
7495
7496 /************** End of opcodes.h *********************************************/
7497 /************** Continuing where we left off in vdbe.h ***********************/
@@ -7534,14 +7543,13 @@
7534 SQLITE_PRIVATE sqlite3 *sqlite3VdbeDb(Vdbe*);
7535 SQLITE_PRIVATE void sqlite3VdbeSetSql(Vdbe*, const char *z, int n, int);
7536 SQLITE_PRIVATE void sqlite3VdbeSwap(Vdbe*,Vdbe*);
7537 SQLITE_PRIVATE VdbeOp *sqlite3VdbeTakeOpArray(Vdbe*, int*, int*);
7538 SQLITE_PRIVATE void sqlite3VdbeProgramDelete(sqlite3 *, SubProgram *, int);
 
 
7539
7540 #ifdef SQLITE_ENABLE_MEMORY_MANAGEMENT
7541 SQLITE_PRIVATE int sqlite3VdbeReleaseMemory(int);
7542 #endif
7543 SQLITE_PRIVATE UnpackedRecord *sqlite3VdbeRecordUnpack(KeyInfo*,int,const void*,char*,int);
7544 SQLITE_PRIVATE void sqlite3VdbeDeleteUnpackedRecord(UnpackedRecord*);
7545 SQLITE_PRIVATE int sqlite3VdbeRecordCompare(int,const void*,UnpackedRecord*);
7546
7547
@@ -9201,11 +9209,12 @@
9201 *********************************************************************/
9202
9203 int iTable; /* TK_COLUMN: cursor number of table holding column
9204 ** TK_REGISTER: register number
9205 ** TK_TRIGGER: 1 -> new, 0 -> old */
9206 i16 iColumn; /* TK_COLUMN: column index. -1 for rowid */
 
9207 i16 iAgg; /* Which entry in pAggInfo->aCol[] or ->aFunc[] */
9208 i16 iRightJoinTable; /* If EP_FromJoin, the right table of the join */
9209 u8 flags2; /* Second set of flags. EP2_... */
9210 u8 op2; /* If a TK_REGISTER, the original value of Expr.op */
9211 AggInfo *pAggInfo; /* Used by TK_AGG_COLUMN and TK_AGG_FUNCTION */
@@ -9743,10 +9752,11 @@
9743
9744 int nVar; /* Number of '?' variables seen in the SQL so far */
9745 int nVarExpr; /* Number of used slots in apVarExpr[] */
9746 int nVarExprAlloc; /* Number of allocated slots in apVarExpr[] */
9747 Expr **apVarExpr; /* Pointers to :aaa and $aaaa wildcard expressions */
 
9748 int nAlias; /* Number of aliased result set columns */
9749 int nAliasAlloc; /* Number of allocated slots for aAlias[] */
9750 int *aAlias; /* Register used to hold aliased result */
9751 u8 explain; /* True if the EXPLAIN flag is found on the query */
9752 Token sNameToken; /* Token with unqualified schema object name */
@@ -10252,11 +10262,10 @@
10252 SQLITE_PRIVATE char *sqlite3NameFromToken(sqlite3*, Token*);
10253 SQLITE_PRIVATE int sqlite3ExprCompare(Expr*, Expr*);
10254 SQLITE_PRIVATE void sqlite3ExprAnalyzeAggregates(NameContext*, Expr*);
10255 SQLITE_PRIVATE void sqlite3ExprAnalyzeAggList(NameContext*,ExprList*);
10256 SQLITE_PRIVATE Vdbe *sqlite3GetVdbe(Parse*);
10257 SQLITE_PRIVATE Expr *sqlite3CreateIdExpr(Parse *, const char*);
10258 SQLITE_PRIVATE void sqlite3PrngSaveState(void);
10259 SQLITE_PRIVATE void sqlite3PrngRestoreState(void);
10260 SQLITE_PRIVATE void sqlite3PrngResetState(void);
10261 SQLITE_PRIVATE void sqlite3RollbackAll(sqlite3*);
10262 SQLITE_PRIVATE void sqlite3CodeVerifySchema(Parse*, int);
@@ -10451,11 +10460,11 @@
10451 SQLITE_PRIVATE void sqlite3AlterFunctions(sqlite3*);
10452 SQLITE_PRIVATE void sqlite3AlterRenameTable(Parse*, SrcList*, Token*);
10453 SQLITE_PRIVATE int sqlite3GetToken(const unsigned char *, int *);
10454 SQLITE_PRIVATE void sqlite3NestedParse(Parse*, const char*, ...);
10455 SQLITE_PRIVATE void sqlite3ExpirePreparedStatements(sqlite3*);
10456 SQLITE_PRIVATE void sqlite3CodeSubselect(Parse *, Expr *, int, int);
10457 SQLITE_PRIVATE void sqlite3SelectPrep(Parse*, Select*, NameContext*);
10458 SQLITE_PRIVATE int sqlite3ResolveExprNames(NameContext*, Expr*);
10459 SQLITE_PRIVATE void sqlite3ResolveSelectNames(Parse*, Select*, NameContext*);
10460 SQLITE_PRIVATE int sqlite3ResolveOrderGroupBy(Parse*, Select*, ExprList*, const char*);
10461 SQLITE_PRIVATE void sqlite3ColumnDefault(Vdbe *, Table *, int, int);
@@ -10486,10 +10495,11 @@
10486 SQLITE_PRIVATE void sqlite3StrAccumInit(StrAccum*, char*, int, int);
10487 SQLITE_PRIVATE void sqlite3StrAccumAppend(StrAccum*,const char*,int);
10488 SQLITE_PRIVATE char *sqlite3StrAccumFinish(StrAccum*);
10489 SQLITE_PRIVATE void sqlite3StrAccumReset(StrAccum*);
10490 SQLITE_PRIVATE void sqlite3SelectDestInit(SelectDest*,int,int);
 
10491
10492 SQLITE_PRIVATE void sqlite3BackupRestart(sqlite3_backup *);
10493 SQLITE_PRIVATE void sqlite3BackupUpdate(sqlite3_backup *, Pgno, const u8 *);
10494
10495 /*
@@ -15704,13 +15714,10 @@
15704 ** cache database pages that are not currently in use.
15705 */
15706 SQLITE_API int sqlite3_release_memory(int n){
15707 #ifdef SQLITE_ENABLE_MEMORY_MANAGEMENT
15708 int nRet = 0;
15709 #if 0
15710 nRet += sqlite3VdbeReleaseMemory(n);
15711 #endif
15712 nRet += sqlite3PcacheReleaseMemory(n-nRet);
15713 return nRet;
15714 #else
15715 UNUSED_PARAMETER(n);
15716 return SQLITE_OK;
@@ -17828,10 +17835,11 @@
17828 #ifdef SQLITE_DEBUG
17829 FILE *trace; /* Write an execution trace here, if not NULL */
17830 #endif
17831 VdbeFrame *pFrame; /* Parent frame */
17832 int nFrame; /* Number of frames in pFrame list */
 
17833 };
17834
17835 /*
17836 ** The following are allowed values for Vdbe.magic
17837 */
@@ -17890,13 +17898,11 @@
17890 SQLITE_PRIVATE int sqlite3VdbeOpcodeHasProperty(int, int);
17891 SQLITE_PRIVATE int sqlite3VdbeMemGrow(Mem *pMem, int n, int preserve);
17892 SQLITE_PRIVATE int sqlite3VdbeCloseStatement(Vdbe *, int);
17893 SQLITE_PRIVATE void sqlite3VdbeFrameDelete(VdbeFrame*);
17894 SQLITE_PRIVATE int sqlite3VdbeFrameRestore(VdbeFrame *);
17895 #ifdef SQLITE_ENABLE_MEMORY_MANAGEMENT
17896 SQLITE_PRIVATE int sqlite3VdbeReleaseBuffers(Vdbe *p);
17897 #endif
17898
17899 #ifndef SQLITE_OMIT_FOREIGN_KEY
17900 SQLITE_PRIVATE int sqlite3VdbeCheckFk(Vdbe *, int);
17901 #else
17902 # define sqlite3VdbeCheckFk(p,i) 0
@@ -17992,24 +17998,24 @@
17992 *zOut++ = (u8)(0x00DC + ((c>>8)&0x03)); \
17993 *zOut++ = (u8)(c&0x00FF); \
17994 } \
17995 }
17996
17997 #define READ_UTF16LE(zIn, c){ \
17998 c = (*zIn++); \
17999 c += ((*zIn++)<<8); \
18000 if( c>=0xD800 && c<0xE000 ){ \
18001 int c2 = (*zIn++); \
18002 c2 += ((*zIn++)<<8); \
18003 c = (c2&0x03FF) + ((c&0x003F)<<10) + (((c&0x03C0)+0x0040)<<10); \
18004 } \
18005 }
18006
18007 #define READ_UTF16BE(zIn, c){ \
18008 c = ((*zIn++)<<8); \
18009 c += (*zIn++); \
18010 if( c>=0xD800 && c<0xE000 ){ \
18011 int c2 = ((*zIn++)<<8); \
18012 c2 += (*zIn++); \
18013 c = (c2&0x03FF) + ((c&0x003F)<<10) + (((c&0x03C0)+0x0040)<<10); \
18014 } \
18015 }
@@ -18190,17 +18196,17 @@
18190 }else{
18191 assert( desiredEnc==SQLITE_UTF8 );
18192 if( pMem->enc==SQLITE_UTF16LE ){
18193 /* UTF-16 Little-endian -> UTF-8 */
18194 while( zIn<zTerm ){
18195 READ_UTF16LE(zIn, c);
18196 WRITE_UTF8(z, c);
18197 }
18198 }else{
18199 /* UTF-16 Big-endian -> UTF-8 */
18200 while( zIn<zTerm ){
18201 READ_UTF16BE(zIn, c);
18202 WRITE_UTF8(z, c);
18203 }
18204 }
18205 pMem->n = (int)(z - zOut);
18206 }
@@ -18366,35 +18372,27 @@
18366 return m.z;
18367 }
18368 #endif
18369
18370 /*
18371 ** pZ is a UTF-16 encoded unicode string at least nChar characters long.
18372 ** Return the number of bytes in the first nChar unicode characters
18373 ** in pZ. nChar must be non-negative.
18374 */
18375 SQLITE_PRIVATE int sqlite3Utf16ByteLen(const void *zIn, int nChar){
18376 int c;
18377 unsigned char const *z = zIn;
18378 int n = 0;
 
18379 if( SQLITE_UTF16NATIVE==SQLITE_UTF16BE ){
18380 /* Using an "if (SQLITE_UTF16NATIVE==SQLITE_UTF16BE)" construct here
18381 ** and in other parts of this file means that at one branch will
18382 ** not be covered by coverage testing on any single host. But coverage
18383 ** will be complete if the tests are run on both a little-endian and
18384 ** big-endian host. Because both the UTF16NATIVE and SQLITE_UTF16BE
18385 ** macros are constant at compile time the compiler can determine
18386 ** which branch will be followed. It is therefore assumed that no runtime
18387 ** penalty is paid for this "if" statement.
18388 */
18389 while( n<nChar ){
18390 READ_UTF16BE(z, c);
18391 n++;
18392 }
18393 }else{
18394 while( n<nChar ){
18395 READ_UTF16LE(z, c);
18396 n++;
18397 }
18398 }
18399 return (int)(z-(unsigned char const *)zIn);
18400 }
@@ -18432,11 +18430,11 @@
18432 WRITE_UTF16LE(z, i);
18433 n = (int)(z-zBuf);
18434 assert( n>0 && n<=4 );
18435 z[0] = 0;
18436 z = zBuf;
18437 READ_UTF16LE(z, c);
18438 assert( c==i );
18439 assert( (z-zBuf)==n );
18440 }
18441 for(i=0; i<0x00110000; i++){
18442 if( i>=0xD800 && i<0xE000 ) continue;
@@ -18444,11 +18442,11 @@
18444 WRITE_UTF16BE(z, i);
18445 n = (int)(z-zBuf);
18446 assert( n>0 && n<=4 );
18447 z[0] = 0;
18448 z = zBuf;
18449 READ_UTF16BE(z, c);
18450 assert( c==i );
18451 assert( (z-zBuf)==n );
18452 }
18453 }
18454 #endif /* SQLITE_TEST */
@@ -19834,91 +19832,91 @@
19834 /* Automatically generated. Do not edit */
19835 /* See the mkopcodec.awk script for details. */
19836 #if !defined(SQLITE_OMIT_EXPLAIN) || !defined(NDEBUG) || defined(VDBE_PROFILE) || defined(SQLITE_DEBUG)
19837 SQLITE_PRIVATE const char *sqlite3OpcodeName(int i){
19838 static const char *const azName[] = { "?",
19839 /* 1 */ "VNext",
19840 /* 2 */ "Affinity",
19841 /* 3 */ "Column",
19842 /* 4 */ "SetCookie",
19843 /* 5 */ "Seek",
19844 /* 6 */ "Sequence",
19845 /* 7 */ "Savepoint",
19846 /* 8 */ "RowKey",
19847 /* 9 */ "SCopy",
19848 /* 10 */ "OpenWrite",
19849 /* 11 */ "If",
19850 /* 12 */ "CollSeq",
19851 /* 13 */ "OpenRead",
19852 /* 14 */ "Expire",
19853 /* 15 */ "AutoCommit",
19854 /* 16 */ "Pagecount",
19855 /* 17 */ "IntegrityCk",
19856 /* 18 */ "Sort",
19857 /* 19 */ "Not",
19858 /* 20 */ "Copy",
19859 /* 21 */ "Trace",
19860 /* 22 */ "Function",
19861 /* 23 */ "IfNeg",
19862 /* 24 */ "Noop",
19863 /* 25 */ "Program",
19864 /* 26 */ "Return",
19865 /* 27 */ "NewRowid",
19866 /* 28 */ "FkCounter",
19867 /* 29 */ "Variable",
19868 /* 30 */ "String",
19869 /* 31 */ "RealAffinity",
19870 /* 32 */ "VRename",
19871 /* 33 */ "ParseSchema",
19872 /* 34 */ "VOpen",
19873 /* 35 */ "Close",
19874 /* 36 */ "CreateIndex",
19875 /* 37 */ "IsUnique",
19876 /* 38 */ "NotFound",
19877 /* 39 */ "Int64",
19878 /* 40 */ "MustBeInt",
19879 /* 41 */ "Halt",
19880 /* 42 */ "Rowid",
19881 /* 43 */ "IdxLT",
19882 /* 44 */ "AddImm",
19883 /* 45 */ "RowData",
19884 /* 46 */ "MemMax",
19885 /* 47 */ "NotExists",
19886 /* 48 */ "Gosub",
19887 /* 49 */ "Integer",
19888 /* 50 */ "Prev",
19889 /* 51 */ "RowSetRead",
19890 /* 52 */ "RowSetAdd",
19891 /* 53 */ "VColumn",
19892 /* 54 */ "CreateTable",
19893 /* 55 */ "Last",
19894 /* 56 */ "SeekLe",
19895 /* 57 */ "IncrVacuum",
19896 /* 58 */ "IdxRowid",
19897 /* 59 */ "ResetCount",
19898 /* 60 */ "Yield",
19899 /* 61 */ "DropTrigger",
19900 /* 62 */ "DropIndex",
19901 /* 63 */ "Param",
19902 /* 64 */ "IdxGE",
19903 /* 65 */ "IdxDelete",
19904 /* 66 */ "Vacuum",
19905 /* 67 */ "IfNot",
19906 /* 68 */ "Or",
19907 /* 69 */ "And",
19908 /* 70 */ "DropTable",
19909 /* 71 */ "SeekLt",
19910 /* 72 */ "MakeRecord",
19911 /* 73 */ "IsNull",
19912 /* 74 */ "NotNull",
19913 /* 75 */ "Ne",
19914 /* 76 */ "Eq",
19915 /* 77 */ "Gt",
19916 /* 78 */ "Le",
19917 /* 79 */ "Lt",
19918 /* 80 */ "Ge",
19919 /* 81 */ "ResultRow",
19920 /* 82 */ "BitAnd",
19921 /* 83 */ "BitOr",
19922 /* 84 */ "ShiftLeft",
19923 /* 85 */ "ShiftRight",
19924 /* 86 */ "Add",
@@ -19925,53 +19923,53 @@
19925 /* 87 */ "Subtract",
19926 /* 88 */ "Multiply",
19927 /* 89 */ "Divide",
19928 /* 90 */ "Remainder",
19929 /* 91 */ "Concat",
19930 /* 92 */ "Delete",
19931 /* 93 */ "BitNot",
19932 /* 94 */ "String8",
19933 /* 95 */ "AggFinal",
19934 /* 96 */ "Compare",
19935 /* 97 */ "Goto",
19936 /* 98 */ "TableLock",
19937 /* 99 */ "Clear",
19938 /* 100 */ "VerifyCookie",
19939 /* 101 */ "AggStep",
19940 /* 102 */ "Transaction",
19941 /* 103 */ "VFilter",
19942 /* 104 */ "VDestroy",
19943 /* 105 */ "Next",
19944 /* 106 */ "Count",
19945 /* 107 */ "IdxInsert",
19946 /* 108 */ "FkIfZero",
19947 /* 109 */ "SeekGe",
19948 /* 110 */ "Insert",
19949 /* 111 */ "Destroy",
19950 /* 112 */ "ReadCookie",
19951 /* 113 */ "RowSetTest",
19952 /* 114 */ "LoadAnalysis",
19953 /* 115 */ "Explain",
19954 /* 116 */ "HaltIfNull",
19955 /* 117 */ "OpenPseudo",
19956 /* 118 */ "OpenEphemeral",
19957 /* 119 */ "Null",
19958 /* 120 */ "Move",
19959 /* 121 */ "Blob",
19960 /* 122 */ "Rewind",
19961 /* 123 */ "SeekGt",
19962 /* 124 */ "VBegin",
19963 /* 125 */ "VUpdate",
19964 /* 126 */ "IfZero",
19965 /* 127 */ "VCreate",
19966 /* 128 */ "Found",
19967 /* 129 */ "IfPos",
19968 /* 130 */ "Real",
19969 /* 131 */ "NullRow",
19970 /* 132 */ "Jump",
19971 /* 133 */ "Permutation",
19972 /* 134 */ "NotUsed_134",
19973 /* 135 */ "NotUsed_135",
19974 /* 136 */ "NotUsed_136",
19975 /* 137 */ "NotUsed_137",
19976 /* 138 */ "NotUsed_138",
19977 /* 139 */ "NotUsed_139",
@@ -24102,11 +24100,12 @@
24102
24103 /* If control gets to this point, then actually go ahead and make
24104 ** operating system calls for the specified lock.
24105 */
24106 if( locktype==SHARED_LOCK ){
24107 int lk, lrc1, lrc2, lrc1Errno;
 
24108
24109 /* Now get the read-lock SHARED_LOCK */
24110 /* note that the quality of the randomness doesn't matter that much */
24111 lk = random();
24112 context->sharedByte = (lk & 0x7fffffff)%(SHARED_SIZE - 1);
@@ -27247,11 +27246,11 @@
27247 ** Determine if we are dealing with WindowsCE - which has a much
27248 ** reduced API.
27249 */
27250 #if SQLITE_OS_WINCE
27251 # define AreFileApisANSI() 1
27252 # define GetDiskFreeSpaceW() 0
27253 #endif
27254
27255 /*
27256 ** WinCE lacks native support for file locking so we have to fake it
27257 ** with some code of our own.
@@ -28421,31 +28420,63 @@
28421 ** The return value of getLastErrorMsg
28422 ** is zero if the error message fits in the buffer, or non-zero
28423 ** otherwise (if the message was truncated).
28424 */
28425 static int getLastErrorMsg(int nBuf, char *zBuf){
28426 DWORD error = GetLastError();
28427
28428 #if SQLITE_OS_WINCE
28429 sqlite3_snprintf(nBuf, zBuf, "OsError 0x%x (%u)", error, error);
28430 #else
28431 /* FormatMessage returns 0 on failure. Otherwise it
28432 ** returns the number of TCHARs written to the output
28433 ** buffer, excluding the terminating null char.
28434 */
28435 if (!FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM,
28436 NULL,
28437 error,
28438 0,
28439 zBuf,
28440 nBuf-1,
28441 0))
28442 {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
28443 sqlite3_snprintf(nBuf, zBuf, "OsError 0x%x (%u)", error, error);
 
 
 
 
 
28444 }
28445 #endif
28446
28447 return 0;
28448 }
28449
28450 /*
28451 ** Open a file.
@@ -28809,18 +28840,18 @@
28809 &bytesPerSector,
28810 &dwDummy,
28811 &dwDummy);
28812 }else{
28813 /* trim path to just drive reference */
28814 CHAR *p = (CHAR *)zConverted;
28815 for(;*p;p++){
28816 if( *p == '\\' ){
28817 *p = '\0';
28818 break;
28819 }
28820 }
28821 dwRet = GetDiskFreeSpaceA((CHAR*)zConverted,
28822 &dwDummy,
28823 &bytesPerSector,
28824 &dwDummy,
28825 &dwDummy);
28826 }
@@ -36675,13 +36706,13 @@
36675 **
36676 ** FORMAT DETAILS
36677 **
36678 ** The file is divided into pages. The first page is called page 1,
36679 ** the second is page 2, and so forth. A page number of zero indicates
36680 ** "no such page". The page size can be anything between 512 and 65536.
36681 ** Each page can be either a btree page, a freelist page or an overflow
36682 ** page.
36683 **
36684 ** The first page is always a btree page. The first 100 bytes of the first
36685 ** page contain a special header (the "file header") that describes the file.
36686 ** The format of the file header is as follows:
36687 **
@@ -36955,12 +36986,12 @@
36955 ** is opaque to the database connection. The database connection cannot
36956 ** see the internals of this structure and only deals with pointers to
36957 ** this structure.
36958 **
36959 ** For some database files, the same underlying database cache might be
36960 ** shared between multiple connections. In that case, each contection
36961 ** has it own pointer to this object. But each instance of this object
36962 ** points to the same BtShared object. The database cache and the
36963 ** schema associated with the database file are all contained within
36964 ** the BtShared object.
36965 **
36966 ** All fields in this structure are accessed under sqlite3.mutex.
@@ -37097,11 +37128,11 @@
37097 ** b-tree within a database file.
37098 **
37099 ** The entry is identified by its MemPage and the index in
37100 ** MemPage.aCell[] of the entry.
37101 **
37102 ** When a single database file can shared by two more database connections,
37103 ** but cursors cannot be shared. Each cursor is associated with a
37104 ** particular database connection identified BtCursor.pBtree.db.
37105 **
37106 ** Fields in this structure are accessed under the BtShared.mutex
37107 ** found at self->pBt->mutex.
@@ -37701,26 +37732,28 @@
37701
37702 #ifndef SQLITE_OMIT_SHARED_CACHE
37703
37704 #ifdef SQLITE_DEBUG
37705 /*
37706 ** This function is only used as part of an assert() statement. It checks
37707 ** that connection p holds the required locks to read or write to the
37708 ** b-tree with root page iRoot. If so, true is returned. Otherwise, false.
37709 ** For example, when writing to a table b-tree with root-page iRoot via
 
 
37710 ** Btree connection pBtree:
37711 **
37712 ** assert( hasSharedCacheTableLock(pBtree, iRoot, 0, WRITE_LOCK) );
37713 **
37714 ** When writing to an index b-tree that resides in a sharable database, the
37715 ** caller should have first obtained a lock specifying the root page of
37716 ** the corresponding table b-tree. This makes things a bit more complicated,
37717 ** as this module treats each b-tree as a separate structure. To determine
37718 ** the table b-tree corresponding to the index b-tree being written, this
37719 ** function has to search through the database schema.
37720 **
37721 ** Instead of a lock on the b-tree rooted at page iRoot, the caller may
37722 ** hold a write-lock on the schema table (root page 1). This is also
37723 ** acceptable.
37724 */
37725 static int hasSharedCacheTableLock(
37726 Btree *pBtree, /* Handle that must hold lock */
@@ -37730,23 +37763,28 @@
37730 ){
37731 Schema *pSchema = (Schema *)pBtree->pBt->pSchema;
37732 Pgno iTab = 0;
37733 BtLock *pLock;
37734
37735 /* If this b-tree database is not shareable, or if the client is reading
37736 ** and has the read-uncommitted flag set, then no lock is required.
37737 ** In these cases return true immediately. If the client is reading
37738 ** or writing an index b-tree, but the schema is not loaded, then return
37739 ** true also. In this case the lock is required, but it is too difficult
37740 ** to check if the client actually holds it. This doesn't happen very
37741 ** often. */
37742 if( (pBtree->sharable==0)
37743 || (eLockType==READ_LOCK && (pBtree->db->flags & SQLITE_ReadUncommitted))
37744 || (isIndex && (!pSchema || (pSchema->flags&DB_SchemaLoaded)==0 ))
37745 ){
37746 return 1;
37747 }
 
 
 
 
 
 
 
 
 
37748
37749 /* Figure out the root-page that the lock should be held on. For table
37750 ** b-trees, this is just the root page of the b-tree being read or
37751 ** written. For index b-trees, it is the root page of the associated
37752 ** table. */
@@ -37775,18 +37813,28 @@
37775 }
37776
37777 /* Failed to find the required lock. */
37778 return 0;
37779 }
37780
37781 /*
37782 ** This function is also used as part of assert() statements only. It
37783 ** returns true if there exist one or more cursors open on the table
37784 ** with root page iRoot that do not belong to either connection pBtree
37785 ** or some other connection that has the read-uncommitted flag set.
37786 **
37787 ** For example, before writing to page iRoot:
 
 
 
 
 
 
 
 
 
 
37788 **
37789 ** assert( !hasReadConflicts(pBtree, iRoot) );
37790 */
37791 static int hasReadConflicts(Btree *pBtree, Pgno iRoot){
37792 BtCursor *p;
@@ -37801,11 +37849,11 @@
37801 return 0;
37802 }
37803 #endif /* #ifdef SQLITE_DEBUG */
37804
37805 /*
37806 ** Query to see if btree handle p may obtain a lock of type eLock
37807 ** (READ_LOCK or WRITE_LOCK) on the table with root-page iTab. Return
37808 ** SQLITE_OK if the lock may be obtained (by calling
37809 ** setSharedCacheTableLock()), or SQLITE_LOCKED if not.
37810 */
37811 static int querySharedCacheTableLock(Btree *p, Pgno iTab, u8 eLock){
@@ -37822,11 +37870,11 @@
37822 ** must be an open write transaction on the file itself.
37823 */
37824 assert( eLock==READ_LOCK || (p==pBt->pWriter && p->inTrans==TRANS_WRITE) );
37825 assert( eLock==READ_LOCK || pBt->inTransaction==TRANS_WRITE );
37826
37827 /* This is a no-op if the shared-cache is not enabled */
37828 if( !p->sharable ){
37829 return SQLITE_OK;
37830 }
37831
37832 /* If some other connection is holding an exclusive lock, the
@@ -37868,14 +37916,14 @@
37868 ** by Btree handle p. Parameter eLock must be either READ_LOCK or
37869 ** WRITE_LOCK.
37870 **
37871 ** This function assumes the following:
37872 **
37873 ** (a) The specified b-tree connection handle is connected to a sharable
37874 ** b-tree database (one with the BtShared.sharable) flag set, and
37875 **
37876 ** (b) No other b-tree connection handle holds a lock that conflicts
37877 ** with the requested lock (i.e. querySharedCacheTableLock() has
37878 ** already been called and returned SQLITE_OK).
37879 **
37880 ** SQLITE_OK is returned if the lock is added successfully. SQLITE_NOMEM
37881 ** is returned if a malloc attempt fails.
@@ -37936,13 +37984,13 @@
37936 #endif /* !SQLITE_OMIT_SHARED_CACHE */
37937
37938 #ifndef SQLITE_OMIT_SHARED_CACHE
37939 /*
37940 ** Release all the table locks (locks obtained via calls to
37941 ** the setSharedCacheTableLock() procedure) held by Btree handle p.
37942 **
37943 ** This function assumes that handle p has an open read or write
37944 ** transaction. If it does not, then the BtShared.isPending variable
37945 ** may be incorrectly cleared.
37946 */
37947 static void clearAllSharedCacheTableLocks(Btree *p){
37948 BtShared *pBt = p->pBt;
@@ -37971,11 +38019,11 @@
37971 if( pBt->pWriter==p ){
37972 pBt->pWriter = 0;
37973 pBt->isExclusive = 0;
37974 pBt->isPending = 0;
37975 }else if( pBt->nTransaction==2 ){
37976 /* This function is called when connection p is concluding its
37977 ** transaction. If there currently exists a writer, and p is not
37978 ** that writer, then the number of locks held by connections other
37979 ** than the writer must be about to drop to zero. In this case
37980 ** set the isPending flag to 0.
37981 **
@@ -37985,11 +38033,11 @@
37985 pBt->isPending = 0;
37986 }
37987 }
37988
37989 /*
37990 ** This function changes all write-locks held by connection p to read-locks.
37991 */
37992 static void downgradeAllSharedCacheTableLocks(Btree *p){
37993 BtShared *pBt = p->pBt;
37994 if( pBt->pWriter==p ){
37995 BtLock *pLock;
@@ -38006,13 +38054,15 @@
38006 #endif /* SQLITE_OMIT_SHARED_CACHE */
38007
38008 static void releasePage(MemPage *pPage); /* Forward reference */
38009
38010 /*
38011 ** Verify that the cursor holds a mutex on the BtShared
 
 
38012 */
38013 #ifndef NDEBUG
38014 static int cursorHoldsMutex(BtCursor *p){
38015 return sqlite3_mutex_held(p->pBt->mutex);
38016 }
38017 #endif
38018
@@ -38039,20 +38089,20 @@
38039 }
38040 }
38041
38042 /*
38043 ** This function is called before modifying the contents of a table
38044 ** b-tree to invalidate any incrblob cursors that are open on the
38045 ** row or one of the rows being modified.
38046 **
38047 ** If argument isClearTable is true, then the entire contents of the
38048 ** table is about to be deleted. In this case invalidate all incrblob
38049 ** cursors open on any row within the table with root-page pgnoRoot.
38050 **
38051 ** Otherwise, if argument isClearTable is false, then the row with
38052 ** rowid iRow is being replaced or deleted. In this case invalidate
38053 ** only those incrblob cursors open on this specific row.
38054 */
38055 static void invalidateIncrblobCursors(
38056 Btree *pBtree, /* The database file to check */
38057 i64 iRow, /* The rowid that might be changing */
38058 int isClearTable /* True if all rows are being deleted */
@@ -38066,14 +38116,15 @@
38066 }
38067 }
38068 }
38069
38070 #else
 
38071 #define invalidateOverflowCache(x)
38072 #define invalidateAllOverflowCache(x)
38073 #define invalidateIncrblobCursors(x,y,z)
38074 #endif
38075
38076 /*
38077 ** Set bit pgno of the BtShared.pHasContent bitvec. This is called
38078 ** when a page that previously contained data becomes a free-list leaf
38079 ** page.
@@ -38102,11 +38153,11 @@
38102 ** to restore the database to its original configuration.
38103 **
38104 ** The solution is the BtShared.pHasContent bitvec. Whenever a page is
38105 ** moved to become a free-list leaf page, the corresponding bit is
38106 ** set in the bitvec. Whenever a leaf page is extracted from the free-list,
38107 ** optimization 2 above is ommitted if the corresponding bit is already
38108 ** set in BtShared.pHasContent. The contents of the bitvec are cleared
38109 ** at the end of every transaction.
38110 */
38111 static int btreeSetHasContent(BtShared *pBt, Pgno pgno){
38112 int rc = SQLITE_OK;
@@ -38198,12 +38249,12 @@
38198 invalidateOverflowCache(pCur);
38199 return rc;
38200 }
38201
38202 /*
38203 ** Save the positions of all cursors except pExcept open on the table
38204 ** with root-page iRoot. Usually, this is called just before cursor
38205 ** pExcept is used to modify the table (BtreeDelete() or BtreeInsert()).
38206 */
38207 static int saveAllCursors(BtShared *pBt, Pgno iRoot, BtCursor *pExcept){
38208 BtCursor *p;
38209 assert( sqlite3_mutex_held(pBt->mutex) );
@@ -38604,11 +38655,14 @@
38604 }
38605
38606 assert( nSize==debuginfo.nSize );
38607 return (u16)nSize;
38608 }
38609 #ifndef NDEBUG
 
 
 
38610 static u16 cellSize(MemPage *pPage, int iCell){
38611 return cellSizePtr(pPage, findCell(pPage, iCell));
38612 }
38613 #endif
38614
@@ -40576,22 +40630,17 @@
40576 ** This function is called from both BtreeCommitPhaseTwo() and BtreeRollback()
40577 ** at the conclusion of a transaction.
40578 */
40579 static void btreeEndTransaction(Btree *p){
40580 BtShared *pBt = p->pBt;
40581 BtCursor *pCsr;
40582 assert( sqlite3BtreeHoldsMutex(p) );
40583
40584 /* Search for a cursor held open by this b-tree connection. If one exists,
40585 ** then the transaction will be downgraded to a read-only transaction
40586 ** instead of actually concluded. A subsequent call to CommitPhaseTwo()
40587 ** or Rollback() will finish the transaction and unlock the database. */
40588 for(pCsr=pBt->pCursor; pCsr && pCsr->pBtree!=p; pCsr=pCsr->pNext);
40589 assert( pCsr==0 || p->inTrans>TRANS_NONE );
40590
40591 btreeClearHasContent(pBt);
40592 if( pCsr ){
 
 
 
40593 downgradeAllSharedCacheTableLocks(p);
40594 p->inTrans = TRANS_READ;
40595 }else{
40596 /* If the handle had any kind of transaction open, decrement the
40597 ** transaction count of the shared btree. If the transaction count
@@ -44047,11 +44096,11 @@
44047 int appendBias, /* True if this is likely an append */
44048 int seekResult /* Result of prior MovetoUnpacked() call */
44049 ){
44050 int rc;
44051 int loc = seekResult; /* -1: before desired location +1: after */
44052 int szNew;
44053 int idx;
44054 MemPage *pPage;
44055 Btree *p = pCur->pBtree;
44056 BtShared *pBt = p->pBt;
44057 unsigned char *oldCell;
@@ -47103,10 +47152,13 @@
47103 sqlite3VdbeMemSetStr(pVal, sqlite3HexToBlob(db, zVal, nVal), nVal/2,
47104 0, SQLITE_DYNAMIC);
47105 }
47106 #endif
47107
 
 
 
47108 *ppVal = pVal;
47109 return SQLITE_OK;
47110
47111 no_mem:
47112 db->mallocFailed = 1;
@@ -47207,17 +47259,18 @@
47207
47208 /*
47209 ** Remember the SQL string for a prepared statement.
47210 */
47211 SQLITE_PRIVATE void sqlite3VdbeSetSql(Vdbe *p, const char *z, int n, int isPrepareV2){
 
47212 if( p==0 ) return;
47213 #ifdef SQLITE_OMIT_TRACE
47214 if( !isPrepareV2 ) return;
47215 #endif
47216 assert( p->zSql==0 );
47217 p->zSql = sqlite3DbStrNDup(p->db, z, n);
47218 p->isPrepareV2 = isPrepareV2 ? 1 : 0;
47219 }
47220
47221 /*
47222 ** Return the SQL associated with a prepared statement
47223 */
@@ -48167,31 +48220,10 @@
48167 }
48168 releaseMemArray(aMem, p->nChildMem);
48169 sqlite3DbFree(p->v->db, p);
48170 }
48171
48172
48173 #ifdef SQLITE_ENABLE_MEMORY_MANAGEMENT
48174 SQLITE_PRIVATE int sqlite3VdbeReleaseBuffers(Vdbe *p){
48175 int ii;
48176 int nFree = 0;
48177 assert( sqlite3_mutex_held(p->db->mutex) );
48178 for(ii=1; ii<=p->nMem; ii++){
48179 Mem *pMem = &p->aMem[ii];
48180 if( pMem->flags & MEM_RowSet ){
48181 sqlite3RowSetClear(pMem->u.pRowSet);
48182 }
48183 if( pMem->z && pMem->flags&MEM_Dyn ){
48184 assert( !pMem->xDel );
48185 nFree += sqlite3DbMallocSize(pMem->db, pMem->z);
48186 sqlite3VdbeMemRelease(pMem);
48187 }
48188 }
48189 return nFree;
48190 }
48191 #endif
48192
48193 #ifndef SQLITE_OMIT_EXPLAIN
48194 /*
48195 ** Give a listing of the program in the virtual machine.
48196 **
48197 ** The interface is the same as sqlite3VdbeExec(). But instead of
@@ -50176,10 +50208,49 @@
50176 ** Return the database associated with the Vdbe.
50177 */
50178 SQLITE_PRIVATE sqlite3 *sqlite3VdbeDb(Vdbe *v){
50179 return v->db;
50180 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
50181
50182 /************** End of vdbeaux.c *********************************************/
50183 /************** Begin file vdbeapi.c *****************************************/
50184 /*
50185 ** 2004 May 26
@@ -50277,10 +50348,13 @@
50277 #endif
50278 sqlite3_mutex_enter(mutex);
50279 for(i=0; i<p->nVar; i++){
50280 sqlite3VdbeMemRelease(&p->aVar[i]);
50281 p->aVar[i].flags = MEM_Null;
 
 
 
50282 }
50283 sqlite3_mutex_leave(mutex);
50284 return rc;
50285 }
50286
@@ -50483,11 +50557,11 @@
50483 if( db->mallocFailed ){
50484 return SQLITE_NOMEM;
50485 }
50486
50487 if( p->pc<=0 && p->expired ){
50488 if( ALWAYS(p->rc==SQLITE_OK) ){
50489 p->rc = SQLITE_SCHEMA;
50490 }
50491 rc = SQLITE_ERROR;
50492 goto end_of_step;
50493 }
@@ -51093,10 +51167,19 @@
51093 i--;
51094 pVar = &p->aVar[i];
51095 sqlite3VdbeMemRelease(pVar);
51096 pVar->flags = MEM_Null;
51097 sqlite3Error(p->db, SQLITE_OK, 0);
 
 
 
 
 
 
 
 
 
51098 return SQLITE_OK;
51099 }
51100
51101 /*
51102 ** Bind a text or BLOB value.
@@ -51342,10 +51425,16 @@
51342 SQLITE_API int sqlite3_transfer_bindings(sqlite3_stmt *pFromStmt, sqlite3_stmt *pToStmt){
51343 Vdbe *pFrom = (Vdbe*)pFromStmt;
51344 Vdbe *pTo = (Vdbe*)pToStmt;
51345 if( pFrom->nVar!=pTo->nVar ){
51346 return SQLITE_ERROR;
 
 
 
 
 
 
51347 }
51348 return sqlite3TransferBindings(pFromStmt, pToStmt);
51349 }
51350 #endif
51351
@@ -51538,16 +51627,14 @@
51538 #define ExpandBlob(P) (((P)->flags&MEM_Zero)?sqlite3VdbeMemExpandBlob(P):0)
51539
51540 /*
51541 ** Argument pMem points at a register that will be passed to a
51542 ** user-defined function or returned to the user as the result of a query.
51543 ** The second argument, 'db_enc' is the text encoding used by the vdbe for
51544 ** register variables. This routine sets the pMem->enc and pMem->type
51545 ** variables used by the sqlite3_value_*() routines.
51546 */
51547 #define storeTypeInfo(A,B) _storeTypeInfo(A)
51548 static void _storeTypeInfo(Mem *pMem){
51549 int flags = pMem->flags;
51550 if( flags & MEM_Null ){
51551 pMem->type = SQLITE_NULL;
51552 }
51553 else if( flags & MEM_Int ){
@@ -51714,11 +51801,11 @@
51714 ** This is an EXPERIMENTAL api and is subject to change or removal.
51715 */
51716 SQLITE_API int sqlite3_value_numeric_type(sqlite3_value *pVal){
51717 Mem *pMem = (Mem*)pVal;
51718 applyNumericAffinity(pMem);
51719 storeTypeInfo(pMem, 0);
51720 return pMem->type;
51721 }
51722
51723 /*
51724 ** Exported version of applyAffinity(). This one works on sqlite3_value*,
@@ -52263,11 +52350,11 @@
52263 int res; /* Result of an sqlite3BtreeLast() */
52264 int cnt; /* Counter to limit the number of searches */
52265 Mem *pMem; /* Register holding largest rowid for AUTOINCREMENT */
52266 VdbeFrame *pFrame; /* Root frame of VDBE */
52267 } be;
52268 struct OP_Insert_stack_vars {
52269 Mem *pData; /* MEM cell holding data for the record to be inserted */
52270 Mem *pKey; /* MEM cell holding key for the record */
52271 i64 iKey; /* The integer ROWID or key for the record to be inserted */
52272 VdbeCursor *pC; /* Cursor to table into which insert is written */
52273 int nZero; /* Number of zero-bytes to append */
@@ -52907,11 +52994,11 @@
52907 u.ab.p1 = pOp->p1 - 1;
52908 u.ab.p2 = pOp->p2;
52909 u.ab.n = pOp->p3;
52910 assert( u.ab.p1>=0 && u.ab.p1+u.ab.n<=p->nVar );
52911 assert( u.ab.p2>=1 && u.ab.p2+u.ab.n-1<=p->nMem );
52912 assert( pOp->p4.z==0 || pOp->p3==1 );
52913
52914 while( u.ab.n-- > 0 ){
52915 u.ab.pVar = &p->aVar[u.ab.p1++];
52916 if( sqlite3VdbeMemTooBig(u.ab.pVar) ){
52917 goto too_big;
@@ -53058,11 +53145,11 @@
53058 ** as side effect.
53059 */
53060 u.ad.pMem = p->pResultSet = &p->aMem[pOp->p1];
53061 for(u.ad.i=0; u.ad.i<pOp->p2; u.ad.i++){
53062 sqlite3VdbeMemNulTerminate(&u.ad.pMem[u.ad.i]);
53063 storeTypeInfo(&u.ad.pMem[u.ad.i], encoding);
53064 REGISTER_TRACE(pOp->p1+u.ad.i, &u.ad.pMem[u.ad.i]);
53065 }
53066 if( db->mallocFailed ) goto no_mem;
53067
53068 /* Return SQLITE_ROW
@@ -53283,11 +53370,11 @@
53283 assert( u.ag.n==0 || (pOp->p2>0 && pOp->p2+u.ag.n<=p->nMem+1) );
53284 assert( pOp->p3<pOp->p2 || pOp->p3>=pOp->p2+u.ag.n );
53285 u.ag.pArg = &p->aMem[pOp->p2];
53286 for(u.ag.i=0; u.ag.i<u.ag.n; u.ag.i++, u.ag.pArg++){
53287 u.ag.apVal[u.ag.i] = u.ag.pArg;
53288 storeTypeInfo(u.ag.pArg, encoding);
53289 REGISTER_TRACE(pOp->p2, u.ag.pArg);
53290 }
53291
53292 assert( pOp->p4type==P4_FUNCDEF || pOp->p4type==P4_VDBEFUNC );
53293 if( pOp->p4type==P4_FUNCDEF ){
@@ -54779,10 +54866,11 @@
54779 }
54780 if( pOp->p1==1 ){
54781 /* Invalidate all prepared statements whenever the TEMP database
54782 ** schema is changed. Ticket #1644 */
54783 sqlite3ExpirePreparedStatements(db);
 
54784 }
54785 break;
54786 }
54787
54788 /* Opcode: VerifyCookie P1 P2 *
@@ -54899,10 +54987,15 @@
54899 int wrFlag;
54900 Btree *pX;
54901 VdbeCursor *pCur;
54902 Db *pDb;
54903 #endif /* local variables moved into u.aw */
 
 
 
 
 
54904
54905 u.aw.nField = 0;
54906 u.aw.pKeyInfo = 0;
54907 u.aw.p2 = pOp->p2;
54908 u.aw.iDb = pOp->p3;
@@ -55698,11 +55791,17 @@
55698 ** cause any problems.)
55699 **
55700 ** This instruction only works on tables. The equivalent instruction
55701 ** for indices is OP_IdxInsert.
55702 */
55703 case OP_Insert: {
 
 
 
 
 
 
55704 #if 0 /* local variables moved into u.bf */
55705 Mem *pData; /* MEM cell holding data for the record to be inserted */
55706 Mem *pKey; /* MEM cell holding key for the record */
55707 i64 iKey; /* The integer ROWID or key for the record to be inserted */
55708 VdbeCursor *pC; /* Cursor to table into which insert is written */
@@ -55712,24 +55811,30 @@
55712 const char *zTbl; /* Table name - used by the opdate hook */
55713 int op; /* Opcode for update hook: SQLITE_UPDATE or SQLITE_INSERT */
55714 #endif /* local variables moved into u.bf */
55715
55716 u.bf.pData = &p->aMem[pOp->p2];
55717 u.bf.pKey = &p->aMem[pOp->p3];
55718 assert( pOp->p1>=0 && pOp->p1<p->nCursor );
55719 u.bf.pC = p->apCsr[pOp->p1];
55720 assert( u.bf.pC!=0 );
55721 assert( u.bf.pC->pCursor!=0 );
55722 assert( u.bf.pC->pseudoTableReg==0 );
55723 assert( u.bf.pKey->flags & MEM_Int );
55724 assert( u.bf.pC->isTable );
55725 REGISTER_TRACE(pOp->p2, u.bf.pData);
55726 REGISTER_TRACE(pOp->p3, u.bf.pKey);
55727
55728 u.bf.iKey = u.bf.pKey->u.i;
 
 
 
 
 
 
 
 
 
55729 if( pOp->p5 & OPFLAG_NCHANGE ) p->nChange++;
55730 if( pOp->p5 & OPFLAG_LASTROWID ) db->lastRowid = u.bf.pKey->u.i;
55731 if( u.bf.pData->flags & MEM_Null ){
55732 u.bf.pData->z = 0;
55733 u.bf.pData->n = 0;
55734 }else{
55735 assert( u.bf.pData->flags & (MEM_Blob|MEM_Str) );
@@ -57043,11 +57148,11 @@
57043 u.cc.pRec = &p->aMem[pOp->p2];
57044 u.cc.apVal = p->apArg;
57045 assert( u.cc.apVal || u.cc.n==0 );
57046 for(u.cc.i=0; u.cc.i<u.cc.n; u.cc.i++, u.cc.pRec++){
57047 u.cc.apVal[u.cc.i] = u.cc.pRec;
57048 storeTypeInfo(u.cc.pRec, encoding);
57049 }
57050 u.cc.ctx.pFunc = pOp->p4.pFunc;
57051 assert( pOp->p3>0 && pOp->p3<=p->nMem );
57052 u.cc.ctx.pMem = u.cc.pMem = &p->aMem[pOp->p3];
57053 u.cc.pMem->n++;
@@ -57341,11 +57446,11 @@
57341 {
57342 u.ch.res = 0;
57343 u.ch.apArg = p->apArg;
57344 for(u.ch.i = 0; u.ch.i<u.ch.nArg; u.ch.i++){
57345 u.ch.apArg[u.ch.i] = &u.ch.pArgc[u.ch.i+1];
57346 storeTypeInfo(u.ch.apArg[u.ch.i], 0);
57347 }
57348
57349 if( sqlite3SafetyOff(db) ) goto abort_due_to_misuse;
57350 p->inVtabMethod = 1;
57351 rc = u.ch.pModule->xFilter(u.ch.pVtabCursor, u.ch.iQuery, pOp->p4.z, u.ch.nArg, u.ch.apArg);
@@ -57553,11 +57658,11 @@
57553 assert( pOp->p4type==P4_VTAB );
57554 if( ALWAYS(u.cl.pModule->xUpdate) ){
57555 u.cl.apArg = p->apArg;
57556 u.cl.pX = &p->aMem[pOp->p3];
57557 for(u.cl.i=0; u.cl.i<u.cl.nArg; u.cl.i++){
57558 storeTypeInfo(u.cl.pX, 0);
57559 u.cl.apArg[u.cl.i] = u.cl.pX;
57560 u.cl.pX++;
57561 }
57562 if( sqlite3SafetyOff(db) ) goto abort_due_to_misuse;
57563 rc = u.cl.pModule->xUpdate(u.cl.pVtab, u.cl.nArg, u.cl.apArg, &u.cl.rowid);
@@ -59174,10 +59279,31 @@
59174 return WRC_Prune;
59175 } else {
59176 return WRC_Abort;
59177 }
59178 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
59179
59180 /*
59181 ** This routine is callback for sqlite3WalkExpr().
59182 **
59183 ** Resolve symbolic names into TK_COLUMN operators for the current
@@ -60522,16 +60648,16 @@
60522 assert( z!=0 );
60523 assert( z[0]!=0 );
60524 if( z[1]==0 ){
60525 /* Wildcard of the form "?". Assign the next variable number */
60526 assert( z[0]=='?' );
60527 pExpr->iTable = ++pParse->nVar;
60528 }else if( z[0]=='?' ){
60529 /* Wildcard of the form "?nnn". Convert "nnn" to an integer and
60530 ** use it as the variable number */
60531 int i;
60532 pExpr->iTable = i = atoi((char*)&z[1]);
60533 testcase( i==0 );
60534 testcase( i==1 );
60535 testcase( i==db->aLimit[SQLITE_LIMIT_VARIABLE_NUMBER]-1 );
60536 testcase( i==db->aLimit[SQLITE_LIMIT_VARIABLE_NUMBER] );
60537 if( i<1 || i>db->aLimit[SQLITE_LIMIT_VARIABLE_NUMBER] ){
@@ -60551,16 +60677,16 @@
60551 n = sqlite3Strlen30(z);
60552 for(i=0; i<pParse->nVarExpr; i++){
60553 Expr *pE = pParse->apVarExpr[i];
60554 assert( pE!=0 );
60555 if( memcmp(pE->u.zToken, z, n)==0 && pE->u.zToken[n]==0 ){
60556 pExpr->iTable = pE->iTable;
60557 break;
60558 }
60559 }
60560 if( i>=pParse->nVarExpr ){
60561 pExpr->iTable = ++pParse->nVar;
60562 if( pParse->nVarExpr>=pParse->nVarExprAlloc-1 ){
60563 pParse->nVarExprAlloc += pParse->nVarExprAlloc + 10;
60564 pParse->apVarExpr =
60565 sqlite3DbReallocOrFree(
60566 db,
@@ -61322,10 +61448,12 @@
61322 SQLITE_PRIVATE int sqlite3FindInIndex(Parse *pParse, Expr *pX, int *prNotFound){
61323 Select *p; /* SELECT to the right of IN operator */
61324 int eType = 0; /* Type of RHS table. IN_INDEX_* */
61325 int iTab = pParse->nTab++; /* Cursor of the RHS table */
61326 int mustBeUnique = (prNotFound==0); /* True if RHS must be unique */
 
 
61327
61328 /* Check to see if an existing table or index can be used to
61329 ** satisfy the query. This is preferable to generating a new
61330 ** ephemeral table.
61331 */
@@ -61400,11 +61528,11 @@
61400 }
61401 }
61402 }
61403
61404 if( eType==0 ){
61405 /* Could not found an existing able or index to use as the RHS b-tree.
61406 ** We will have to generate an ephemeral table to do the job.
61407 */
61408 int rMayHaveNull = 0;
61409 eType = IN_INDEX_EPH;
61410 if( prNotFound ){
@@ -61447,21 +61575,25 @@
61447 ** care of changing this register value to non-NULL if the RHS is NULL-free.
61448 **
61449 ** If rMayHaveNull is zero, that means that the subquery is being used
61450 ** for membership testing only. There is no need to initialize any
61451 ** registers to indicate the presense or absence of NULLs on the RHS.
 
 
 
61452 */
61453 #ifndef SQLITE_OMIT_SUBQUERY
61454 SQLITE_PRIVATE void sqlite3CodeSubselect(
61455 Parse *pParse, /* Parsing context */
61456 Expr *pExpr, /* The IN, SELECT, or EXISTS operator */
61457 int rMayHaveNull, /* Register that records whether NULLs exist in RHS */
61458 int isRowid /* If true, LHS of IN operator is a rowid */
61459 ){
61460 int testAddr = 0; /* One-time test address */
 
61461 Vdbe *v = sqlite3GetVdbe(pParse);
61462 if( NEVER(v==0) ) return;
61463 sqlite3ExprCachePush(pParse);
61464
61465 /* This code must be run in its entirety every time it is encountered
61466 ** if any of the following is true:
61467 **
@@ -61522,11 +61654,11 @@
61522 assert( !isRowid );
61523 sqlite3SelectDestInit(&dest, SRT_Set, pExpr->iTable);
61524 dest.affinity = (u8)affinity;
61525 assert( (pExpr->iTable&0x0000FFFF)==pExpr->iTable );
61526 if( sqlite3Select(pParse, pExpr->x.pSelect, &dest) ){
61527 return;
61528 }
61529 pEList = pExpr->x.pSelect->pEList;
61530 if( ALWAYS(pEList!=0 && pEList->nExpr>0) ){
61531 keyInfo.aColl[0] = sqlite3BinaryCompareCollSeq(pParse, pExpr->pLeft,
61532 pEList->a[0].pExpr);
@@ -61553,10 +61685,11 @@
61553 r1 = sqlite3GetTempReg(pParse);
61554 r2 = sqlite3GetTempReg(pParse);
61555 sqlite3VdbeAddOp2(v, OP_Null, 0, r2);
61556 for(i=pList->nExpr, pItem=pList->a; i>0; i--, pItem++){
61557 Expr *pE2 = pItem->pExpr;
 
61558
61559 /* If the expression is not constant then we will need to
61560 ** disable the test that was generated above that makes sure
61561 ** this code only executes once. Because for a non-constant
61562 ** expression we need to rerun this code each time.
@@ -61565,18 +61698,23 @@
61565 sqlite3VdbeChangeToNoop(v, testAddr-1, 2);
61566 testAddr = 0;
61567 }
61568
61569 /* Evaluate the expression and insert it into the temp table */
61570 r3 = sqlite3ExprCodeTarget(pParse, pE2, r1);
61571 if( isRowid ){
61572 sqlite3VdbeAddOp2(v, OP_MustBeInt, r3, sqlite3VdbeCurrentAddr(v)+2);
61573 sqlite3VdbeAddOp3(v, OP_Insert, pExpr->iTable, r2, r3);
61574 }else{
61575 sqlite3VdbeAddOp4(v, OP_MakeRecord, r3, 1, r2, &affinity, 1);
61576 sqlite3ExprCacheAffinityChange(pParse, r3, 1);
61577 sqlite3VdbeAddOp2(v, OP_IdxInsert, pExpr->iTable, r2);
 
 
 
 
 
 
 
61578 }
61579 }
61580 sqlite3ReleaseTempReg(pParse, r1);
61581 sqlite3ReleaseTempReg(pParse, r2);
61582 }
@@ -61616,13 +61754,13 @@
61616 VdbeComment((v, "Init EXISTS result"));
61617 }
61618 sqlite3ExprDelete(pParse->db, pSel->pLimit);
61619 pSel->pLimit = sqlite3PExpr(pParse, TK_INTEGER, 0, 0, &one);
61620 if( sqlite3Select(pParse, pSel, &dest) ){
61621 return;
61622 }
61623 pExpr->iColumn = (i16)dest.iParm;
61624 ExprSetIrreducible(pExpr);
61625 break;
61626 }
61627 }
61628
@@ -61629,11 +61767,11 @@
61629 if( testAddr ){
61630 sqlite3VdbeJumpHere(v, testAddr-1);
61631 }
61632 sqlite3ExprCachePop(pParse, 1);
61633
61634 return;
61635 }
61636 #endif /* SQLITE_OMIT_SUBQUERY */
61637
61638 /*
61639 ** Duplicate an 8-byte value
@@ -62115,11 +62253,11 @@
62115 assert( !ExprHasProperty(pExpr, EP_IntValue) );
62116 assert( pExpr->u.zToken!=0 );
62117 assert( pExpr->u.zToken[0]!=0 );
62118 if( pExpr->u.zToken[1]==0
62119 && (pOp = sqlite3VdbeGetOp(v, -1))->opcode==OP_Variable
62120 && pOp->p1+pOp->p3==pExpr->iTable
62121 && pOp->p2+pOp->p3==target
62122 && pOp->p4.z==0
62123 ){
62124 /* If the previous instruction was a copy of the previous unnamed
62125 ** parameter into the previous register, then simply increment the
@@ -62126,11 +62264,11 @@
62126 ** repeat count on the prior instruction rather than making a new
62127 ** instruction.
62128 */
62129 pOp->p3++;
62130 }else{
62131 sqlite3VdbeAddOp3(v, OP_Variable, pExpr->iTable, target, 1);
62132 if( pExpr->u.zToken[1]!=0 ){
62133 sqlite3VdbeChangeP4(v, -1, pExpr->u.zToken, 0);
62134 }
62135 }
62136 break;
@@ -62386,12 +62524,11 @@
62386 #ifndef SQLITE_OMIT_SUBQUERY
62387 case TK_EXISTS:
62388 case TK_SELECT: {
62389 testcase( op==TK_EXISTS );
62390 testcase( op==TK_SELECT );
62391 sqlite3CodeSubselect(pParse, pExpr, 0, 0);
62392 inReg = pExpr->iColumn;
62393 break;
62394 }
62395 case TK_IN: {
62396 int rNotFound = 0;
62397 int rMayHaveNull = 0;
@@ -62752,10 +62889,11 @@
62752 if( ALWAYS(pExpr->op!=TK_REGISTER) ){
62753 int iMem;
62754 iMem = ++pParse->nMem;
62755 sqlite3VdbeAddOp2(v, OP_Copy, inReg, iMem);
62756 pExpr->iTable = iMem;
 
62757 pExpr->op = TK_REGISTER;
62758 }
62759 return inReg;
62760 }
62761
@@ -62825,10 +62963,11 @@
62825 ** expression.
62826 */
62827 static int evalConstExpr(Walker *pWalker, Expr *pExpr){
62828 Parse *pParse = pWalker->pParse;
62829 switch( pExpr->op ){
 
62830 case TK_REGISTER: {
62831 return WRC_Prune;
62832 }
62833 case TK_FUNCTION:
62834 case TK_AGG_FUNCTION:
@@ -78185,10 +78324,11 @@
78185 static int sqlite3Prepare(
78186 sqlite3 *db, /* Database handle. */
78187 const char *zSql, /* UTF-8 encoded SQL statement. */
78188 int nBytes, /* Length of zSql in bytes. */
78189 int saveSqlFlag, /* True to copy SQL text into the sqlite3_stmt */
 
78190 sqlite3_stmt **ppStmt, /* OUT: A pointer to the prepared statement */
78191 const char **pzTail /* OUT: End of parsed string */
78192 ){
78193 Parse *pParse; /* Parsing context */
78194 char *zErrMsg = 0; /* Error message */
@@ -78199,10 +78339,11 @@
78199 pParse = sqlite3StackAllocZero(db, sizeof(*pParse));
78200 if( pParse==0 ){
78201 rc = SQLITE_NOMEM;
78202 goto end_prepare;
78203 }
 
78204
78205 if( sqlite3SafetyOn(db) ){
78206 rc = SQLITE_MISUSE;
78207 goto end_prepare;
78208 }
@@ -78356,10 +78497,11 @@
78356 static int sqlite3LockAndPrepare(
78357 sqlite3 *db, /* Database handle. */
78358 const char *zSql, /* UTF-8 encoded SQL statement. */
78359 int nBytes, /* Length of zSql in bytes. */
78360 int saveSqlFlag, /* True to copy SQL text into the sqlite3_stmt */
 
78361 sqlite3_stmt **ppStmt, /* OUT: A pointer to the prepared statement */
78362 const char **pzTail /* OUT: End of parsed string */
78363 ){
78364 int rc;
78365 assert( ppStmt!=0 );
@@ -78367,14 +78509,14 @@
78367 if( !sqlite3SafetyCheckOk(db) ){
78368 return SQLITE_MISUSE;
78369 }
78370 sqlite3_mutex_enter(db->mutex);
78371 sqlite3BtreeEnterAll(db);
78372 rc = sqlite3Prepare(db, zSql, nBytes, saveSqlFlag, ppStmt, pzTail);
78373 if( rc==SQLITE_SCHEMA ){
78374 sqlite3_finalize(*ppStmt);
78375 rc = sqlite3Prepare(db, zSql, nBytes, saveSqlFlag, ppStmt, pzTail);
78376 }
78377 sqlite3BtreeLeaveAll(db);
78378 sqlite3_mutex_leave(db->mutex);
78379 return rc;
78380 }
@@ -78396,11 +78538,11 @@
78396 assert( sqlite3_mutex_held(sqlite3VdbeDb(p)->mutex) );
78397 zSql = sqlite3_sql((sqlite3_stmt *)p);
78398 assert( zSql!=0 ); /* Reprepare only called for prepare_v2() statements */
78399 db = sqlite3VdbeDb(p);
78400 assert( sqlite3_mutex_held(db->mutex) );
78401 rc = sqlite3LockAndPrepare(db, zSql, -1, 0, &pNew, 0);
78402 if( rc ){
78403 if( rc==SQLITE_NOMEM ){
78404 db->mallocFailed = 1;
78405 }
78406 assert( pNew==0 );
@@ -78430,11 +78572,11 @@
78430 int nBytes, /* Length of zSql in bytes. */
78431 sqlite3_stmt **ppStmt, /* OUT: A pointer to the prepared statement */
78432 const char **pzTail /* OUT: End of parsed string */
78433 ){
78434 int rc;
78435 rc = sqlite3LockAndPrepare(db,zSql,nBytes,0,ppStmt,pzTail);
78436 assert( rc==SQLITE_OK || ppStmt==0 || *ppStmt==0 ); /* VERIFY: F13021 */
78437 return rc;
78438 }
78439 SQLITE_API int sqlite3_prepare_v2(
78440 sqlite3 *db, /* Database handle. */
@@ -78442,11 +78584,11 @@
78442 int nBytes, /* Length of zSql in bytes. */
78443 sqlite3_stmt **ppStmt, /* OUT: A pointer to the prepared statement */
78444 const char **pzTail /* OUT: End of parsed string */
78445 ){
78446 int rc;
78447 rc = sqlite3LockAndPrepare(db,zSql,nBytes,1,ppStmt,pzTail);
78448 assert( rc==SQLITE_OK || ppStmt==0 || *ppStmt==0 ); /* VERIFY: F13021 */
78449 return rc;
78450 }
78451
78452
@@ -78476,11 +78618,11 @@
78476 return SQLITE_MISUSE;
78477 }
78478 sqlite3_mutex_enter(db->mutex);
78479 zSql8 = sqlite3Utf16to8(db, zSql, nBytes);
78480 if( zSql8 ){
78481 rc = sqlite3LockAndPrepare(db, zSql8, -1, saveSqlFlag, ppStmt, &zTail8);
78482 }
78483
78484 if( zTail8 && pzTail ){
78485 /* If sqlite3_prepare returns a tail pointer, we calculate the
78486 ** equivalent pointer into the UTF-16 string by counting the unicode
@@ -78724,55 +78866,49 @@
78724 }
78725 return -1;
78726 }
78727
78728 /*
78729 ** Create an expression node for an identifier with the name of zName
78730 */
78731 SQLITE_PRIVATE Expr *sqlite3CreateIdExpr(Parse *pParse, const char *zName){
78732 return sqlite3Expr(pParse->db, TK_ID, zName);
78733 }
78734
78735 /*
78736 ** Add a term to the WHERE expression in *ppExpr that requires the
78737 ** zCol column to be equal in the two tables pTab1 and pTab2.
78738 */
78739 static void addWhereTerm(
78740 Parse *pParse, /* Parsing context */
78741 const char *zCol, /* Name of the column */
78742 const Table *pTab1, /* First table */
78743 const char *zAlias1, /* Alias for first table. May be NULL */
78744 const Table *pTab2, /* Second table */
78745 const char *zAlias2, /* Alias for second table. May be NULL */
78746 int iRightJoinTable, /* VDBE cursor for the right table */
78747 Expr **ppExpr, /* Add the equality term to this expression */
78748 int isOuterJoin /* True if dealing with an OUTER join */
78749 ){
78750 Expr *pE1a, *pE1b, *pE1c;
78751 Expr *pE2a, *pE2b, *pE2c;
78752 Expr *pE;
78753
78754 pE1a = sqlite3CreateIdExpr(pParse, zCol);
78755 pE2a = sqlite3CreateIdExpr(pParse, zCol);
78756 if( zAlias1==0 ){
78757 zAlias1 = pTab1->zName;
78758 }
78759 pE1b = sqlite3CreateIdExpr(pParse, zAlias1);
78760 if( zAlias2==0 ){
78761 zAlias2 = pTab2->zName;
78762 }
78763 pE2b = sqlite3CreateIdExpr(pParse, zAlias2);
78764 pE1c = sqlite3PExpr(pParse, TK_DOT, pE1b, pE1a, 0);
78765 pE2c = sqlite3PExpr(pParse, TK_DOT, pE2b, pE2a, 0);
78766 pE = sqlite3PExpr(pParse, TK_EQ, pE1c, pE2c, 0);
78767 if( pE && isOuterJoin ){
78768 ExprSetProperty(pE, EP_FromJoin);
78769 assert( !ExprHasAnyProperty(pE, EP_TokenOnly|EP_Reduced) );
78770 ExprSetIrreducible(pE);
78771 pE->iRightJoinTable = (i16)iRightJoinTable;
78772 }
78773 *ppExpr = sqlite3ExprAnd(pParse->db,*ppExpr, pE);
78774 }
78775
78776 /*
78777 ** Set the EP_FromJoin property on all terms of the given expression.
78778 ** And set the Expr.iRightJoinTable to iTable for every term in the
@@ -78850,15 +78986,13 @@
78850 "an ON or USING clause", 0);
78851 return 1;
78852 }
78853 for(j=0; j<pLeftTab->nCol; j++){
78854 char *zName = pLeftTab->aCol[j].zName;
78855 if( columnIndex(pRightTab, zName)>=0 ){
78856 addWhereTerm(pParse, zName, pLeftTab, pLeft->zAlias,
78857 pRightTab, pRight->zAlias,
78858 pRight->iCursor, &p->pWhere, isOuter);
78859
78860 }
78861 }
78862 }
78863
78864 /* Disallow both ON and USING clauses in the same join
@@ -78887,18 +79021,18 @@
78887 */
78888 if( pRight->pUsing ){
78889 IdList *pList = pRight->pUsing;
78890 for(j=0; j<pList->nId; j++){
78891 char *zName = pList->a[j].zName;
78892 if( columnIndex(pLeftTab, zName)<0 || columnIndex(pRightTab, zName)<0 ){
 
 
78893 sqlite3ErrorMsg(pParse, "cannot join using column %s - column "
78894 "not present in both tables", zName);
78895 return 1;
78896 }
78897 addWhereTerm(pParse, zName, pLeftTab, pLeft->zAlias,
78898 pRightTab, pRight->zAlias,
78899 pRight->iCursor, &p->pWhere, isOuter);
78900 }
78901 }
78902 }
78903 return 0;
78904 }
@@ -84635,22 +84769,21 @@
84635 SelectDest dest;
84636
84637 /* Construct the SELECT statement that will find the new values for
84638 ** all updated rows.
84639 */
84640 pEList = sqlite3ExprListAppend(pParse, 0,
84641 sqlite3CreateIdExpr(pParse, "_rowid_"));
84642 if( pRowid ){
84643 pEList = sqlite3ExprListAppend(pParse, pEList,
84644 sqlite3ExprDup(db, pRowid, 0));
84645 }
84646 assert( pTab->iPKey<0 );
84647 for(i=0; i<pTab->nCol; i++){
84648 if( aXRef[i]>=0 ){
84649 pExpr = sqlite3ExprDup(db, pChanges->a[aXRef[i]].pExpr, 0);
84650 }else{
84651 pExpr = sqlite3CreateIdExpr(pParse, pTab->aCol[i].zName);
84652 }
84653 pEList = sqlite3ExprListAppend(pParse, pEList, pExpr);
84654 }
84655 pSelect = sqlite3SelectNew(pParse, pEList, pSrc, pWhere, 0, 0, 0, 0, 0, 0);
84656
@@ -84816,10 +84949,16 @@
84816 rc = execSql(db, zSql);
84817 if( rc!=SQLITE_OK ) goto end_of_vacuum;
84818 pDb = &db->aDb[db->nDb-1];
84819 assert( strcmp(db->aDb[db->nDb-1].zName,"vacuum_db")==0 );
84820 pTemp = db->aDb[db->nDb-1].pBt;
 
 
 
 
 
 
84821
84822 nRes = sqlite3BtreeGetReserve(pMain);
84823
84824 /* A VACUUM cannot change the pagesize of an encrypted database. */
84825 #ifdef SQLITE_HAS_CODEC
@@ -84870,17 +85009,17 @@
84870 "SELECT 'CREATE UNIQUE INDEX vacuum_db.' || substr(sql,21) "
84871 " FROM sqlite_master WHERE sql LIKE 'CREATE UNIQUE INDEX %'");
84872 if( rc!=SQLITE_OK ) goto end_of_vacuum;
84873
84874 /* Loop through the tables in the main database. For each, do
84875 ** an "INSERT INTO vacuum_db.xxx SELECT * FROM xxx;" to copy
84876 ** the contents to the temporary database.
84877 */
84878 rc = execExecSql(db,
84879 "SELECT 'INSERT INTO vacuum_db.' || quote(name) "
84880 "|| ' SELECT * FROM ' || quote(name) || ';'"
84881 "FROM sqlite_master "
84882 "WHERE type = 'table' AND name!='sqlite_sequence' "
84883 " AND rootpage>0"
84884
84885 );
84886 if( rc!=SQLITE_OK ) goto end_of_vacuum;
@@ -84892,11 +85031,11 @@
84892 "FROM vacuum_db.sqlite_master WHERE name='sqlite_sequence' "
84893 );
84894 if( rc!=SQLITE_OK ) goto end_of_vacuum;
84895 rc = execExecSql(db,
84896 "SELECT 'INSERT INTO vacuum_db.' || quote(name) "
84897 "|| ' SELECT * FROM ' || quote(name) || ';' "
84898 "FROM vacuum_db.sqlite_master WHERE name=='sqlite_sequence';"
84899 );
84900 if( rc!=SQLITE_OK ) goto end_of_vacuum;
84901
84902
@@ -84906,11 +85045,11 @@
84906 ** from the SQLITE_MASTER table.
84907 */
84908 rc = execSql(db,
84909 "INSERT INTO vacuum_db.sqlite_master "
84910 " SELECT type, name, tbl_name, rootpage, sql"
84911 " FROM sqlite_master"
84912 " WHERE type='view' OR type='trigger'"
84913 " OR (type='table' AND rootpage=0)"
84914 );
84915 if( rc ) goto end_of_vacuum;
84916
@@ -86580,59 +86719,103 @@
86580 ** literal that does not begin with a wildcard.
86581 */
86582 static int isLikeOrGlob(
86583 Parse *pParse, /* Parsing and code generating context */
86584 Expr *pExpr, /* Test this expression */
86585 int *pnPattern, /* Number of non-wildcard prefix characters */
86586 int *pisComplete, /* True if the only wildcard is % in the last character */
86587 int *pnoCase /* True if uppercase is equivalent to lowercase */
86588 ){
86589 const char *z; /* String on RHS of LIKE operator */
86590 Expr *pRight, *pLeft; /* Right and left size of LIKE operator */
86591 ExprList *pList; /* List of operands to the LIKE operator */
86592 int c; /* One character in z[] */
86593 int cnt; /* Number of non-wildcard prefix characters */
86594 char wc[3]; /* Wildcard characters */
86595 CollSeq *pColl; /* Collating sequence for LHS */
86596 sqlite3 *db = pParse->db; /* Database connection */
 
 
86597
86598 if( !sqlite3IsLikeFunction(db, pExpr, pnoCase, wc) ){
86599 return 0;
86600 }
86601 #ifdef SQLITE_EBCDIC
86602 if( *pnoCase ) return 0;
86603 #endif
86604 pList = pExpr->x.pList;
86605 pRight = pList->a[0].pExpr;
86606 if( pRight->op!=TK_STRING ){
86607 return 0;
86608 }
86609 pLeft = pList->a[1].pExpr;
86610 if( pLeft->op!=TK_COLUMN ){
 
 
86611 return 0;
86612 }
 
86613 pColl = sqlite3ExprCollSeq(pParse, pLeft);
86614 assert( pColl!=0 || pLeft->iColumn==-1 );
86615 if( pColl==0 ) return 0;
86616 if( (pColl->type!=SQLITE_COLL_BINARY || *pnoCase) &&
86617 (pColl->type!=SQLITE_COLL_NOCASE || !*pnoCase) ){
 
 
 
 
 
 
 
86618 return 0;
86619 }
86620 if( sqlite3ExprAffinity(pLeft)!=SQLITE_AFF_TEXT ) return 0;
86621 z = pRight->u.zToken;
86622 if( ALWAYS(z) ){
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
86623 cnt = 0;
86624 while( (c=z[cnt])!=0 && c!=wc[0] && c!=wc[1] && c!=wc[2] ){
86625 cnt++;
86626 }
86627 if( cnt!=0 && c!=0 && 255!=(u8)z[cnt-1] ){
 
86628 *pisComplete = z[cnt]==wc[0] && z[cnt+1]==0;
86629 *pnPattern = cnt;
86630 return 1;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
86631 }
86632 }
86633 return 0;
 
 
86634 }
86635 #endif /* SQLITE_OMIT_LIKE_OPTIMIZATION */
86636
86637
86638 #ifndef SQLITE_OMIT_VIRTUALTABLE
@@ -87009,14 +87192,14 @@
87009 WhereTerm *pTerm; /* The term to be analyzed */
87010 WhereMaskSet *pMaskSet; /* Set of table index masks */
87011 Expr *pExpr; /* The expression to be analyzed */
87012 Bitmask prereqLeft; /* Prerequesites of the pExpr->pLeft */
87013 Bitmask prereqAll; /* Prerequesites of pExpr */
87014 Bitmask extraRight = 0;
87015 int nPattern;
87016 int isComplete;
87017 int noCase;
87018 int op; /* Top-level operator. pExpr->op */
87019 Parse *pParse = pWC->pParse; /* Parsing context */
87020 sqlite3 *db = pParse->db; /* Database connection */
87021
87022 if( db->mallocFailed ){
@@ -87147,25 +87330,25 @@
87147 ** x>='abc' AND x<'abd' AND x LIKE 'abc%'
87148 **
87149 ** The last character of the prefix "abc" is incremented to form the
87150 ** termination condition "abd".
87151 */
87152 if( isLikeOrGlob(pParse, pExpr, &nPattern, &isComplete, &noCase)
87153 && pWC->op==TK_AND ){
87154 Expr *pLeft, *pRight;
87155 Expr *pStr1, *pStr2;
87156 Expr *pNewExpr1, *pNewExpr2;
87157 int idxNew1, idxNew2;
 
 
 
87158
87159 pLeft = pExpr->x.pList->a[1].pExpr;
87160 pRight = pExpr->x.pList->a[0].pExpr;
87161 pStr1 = sqlite3Expr(db, TK_STRING, pRight->u.zToken);
87162 if( pStr1 ) pStr1->u.zToken[nPattern] = 0;
87163 pStr2 = sqlite3ExprDup(db, pStr1, 0);
87164 if( !db->mallocFailed ){
87165 u8 c, *pC; /* Last character before the first wildcard */
87166 pC = (u8*)&pStr2->u.zToken[nPattern-1];
87167 c = *pC;
87168 if( noCase ){
87169 /* The point is to increment the last character before the first
87170 ** wildcard. But if we increment '@', that will push it into the
87171 ** alphabetic range where case conversions will mess up the
@@ -87939,10 +88122,46 @@
87939 }
87940 return SQLITE_OK;
87941 }
87942 #endif /* #ifdef SQLITE_ENABLE_STAT2 */
87943
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
87944 /*
87945 ** This function is used to estimate the number of rows that will be visited
87946 ** by scanning an index for a range of values. The range may have an upper
87947 ** bound, a lower bound, or both. The WHERE clause terms that set the upper
87948 ** and lower bounds are represented by pLower and pUpper respectively. For
@@ -87991,27 +88210,26 @@
87991 int *piEst /* OUT: Return value */
87992 ){
87993 int rc = SQLITE_OK;
87994
87995 #ifdef SQLITE_ENABLE_STAT2
87996 sqlite3 *db = pParse->db;
87997 sqlite3_value *pLowerVal = 0;
87998 sqlite3_value *pUpperVal = 0;
87999
88000 if( nEq==0 && p->aSample ){
 
 
88001 int iEst;
88002 int iLower = 0;
88003 int iUpper = SQLITE_INDEX_SAMPLES;
88004 u8 aff = p->pTable->aCol[0].affinity;
88005
88006 if( pLower ){
88007 Expr *pExpr = pLower->pExpr->pRight;
88008 rc = sqlite3ValueFromExpr(db, pExpr, SQLITE_UTF8, aff, &pLowerVal);
88009 }
88010 if( rc==SQLITE_OK && pUpper ){
88011 Expr *pExpr = pUpper->pExpr->pRight;
88012 rc = sqlite3ValueFromExpr(db, pExpr, SQLITE_UTF8, aff, &pUpperVal);
88013 }
88014
88015 if( rc!=SQLITE_OK || (pLowerVal==0 && pUpperVal==0) ){
88016 sqlite3ValueFree(pLowerVal);
88017 sqlite3ValueFree(pUpperVal);
@@ -90177,469 +90395,469 @@
90177 ** yy_reduce_ofst[] For each state, the offset into yy_action for
90178 ** shifting non-terminals after a reduce.
90179 ** yy_default[] Default action for each state.
90180 */
90181 static const YYACTIONTYPE yy_action[] = {
90182 /* 0 */ 312, 959, 182, 628, 2, 157, 219, 450, 24, 24,
90183 /* 10 */ 24, 24, 221, 26, 26, 26, 26, 27, 27, 28,
90184 /* 20 */ 28, 28, 29, 221, 424, 425, 30, 492, 33, 141,
90185 /* 30 */ 457, 463, 31, 26, 26, 26, 26, 27, 27, 28,
90186 /* 40 */ 28, 28, 29, 221, 28, 28, 28, 29, 221, 23,
90187 /* 50 */ 22, 32, 465, 466, 464, 464, 25, 25, 24, 24,
90188 /* 60 */ 24, 24, 293, 26, 26, 26, 26, 27, 27, 28,
90189 /* 70 */ 28, 28, 29, 221, 312, 450, 319, 479, 344, 208,
90190 /* 80 */ 47, 26, 26, 26, 26, 27, 27, 28, 28, 28,
90191 /* 90 */ 29, 221, 427, 428, 163, 339, 543, 368, 371, 372,
90192 /* 100 */ 521, 317, 472, 473, 457, 463, 296, 373, 294, 21,
90193 /* 110 */ 336, 367, 419, 416, 424, 425, 523, 1, 544, 446,
90194 /* 120 */ 80, 424, 425, 23, 22, 32, 465, 466, 464, 464,
90195 /* 130 */ 25, 25, 24, 24, 24, 24, 564, 26, 26, 26,
90196 /* 140 */ 26, 27, 27, 28, 28, 28, 29, 221, 312, 233,
90197 /* 150 */ 319, 441, 554, 152, 139, 263, 365, 268, 366, 160,
90198 /* 160 */ 551, 352, 332, 421, 222, 272, 362, 322, 218, 557,
90199 /* 170 */ 116, 339, 248, 574, 477, 223, 216, 573, 457, 463,
90200 /* 180 */ 450, 59, 427, 428, 295, 610, 336, 563, 538, 427,
90201 /* 190 */ 428, 385, 608, 609, 562, 446, 87, 23, 22, 32,
90202 /* 200 */ 465, 466, 464, 464, 25, 25, 24, 24, 24, 24,
90203 /* 210 */ 447, 26, 26, 26, 26, 27, 27, 28, 28, 28,
90204 /* 220 */ 29, 221, 312, 233, 477, 223, 576, 134, 139, 263,
90205 /* 230 */ 365, 268, 366, 160, 406, 354, 226, 498, 481, 272,
90206 /* 240 */ 339, 27, 27, 28, 28, 28, 29, 221, 450, 442,
90207 /* 250 */ 199, 540, 457, 463, 349, 336, 163, 551, 66, 368,
90208 /* 260 */ 371, 372, 450, 415, 446, 80, 522, 581, 401, 373,
90209 /* 270 */ 452, 23, 22, 32, 465, 466, 464, 464, 25, 25,
90210 /* 280 */ 24, 24, 24, 24, 447, 26, 26, 26, 26, 27,
90211 /* 290 */ 27, 28, 28, 28, 29, 221, 312, 339, 556, 607,
90212 /* 300 */ 197, 454, 454, 454, 546, 578, 352, 198, 607, 440,
90213 /* 310 */ 65, 351, 336, 426, 426, 399, 289, 424, 425, 606,
90214 /* 320 */ 605, 446, 73, 426, 214, 219, 457, 463, 606, 410,
90215 /* 330 */ 450, 241, 306, 196, 565, 479, 555, 208, 288, 29,
90216 /* 340 */ 221, 447, 4, 874, 504, 23, 22, 32, 465, 466,
90217 /* 350 */ 464, 464, 25, 25, 24, 24, 24, 24, 447, 26,
90218 /* 360 */ 26, 26, 26, 27, 27, 28, 28, 28, 29, 221,
90219 /* 370 */ 312, 163, 582, 339, 368, 371, 372, 314, 424, 425,
90220 /* 380 */ 604, 222, 397, 227, 373, 427, 428, 339, 336, 409,
90221 /* 390 */ 222, 478, 339, 30, 396, 33, 141, 446, 81, 62,
90222 /* 400 */ 457, 463, 336, 157, 400, 450, 504, 336, 438, 426,
90223 /* 410 */ 500, 446, 87, 41, 380, 613, 446, 80, 581, 23,
90224 /* 420 */ 22, 32, 465, 466, 464, 464, 25, 25, 24, 24,
90225 /* 430 */ 24, 24, 213, 26, 26, 26, 26, 27, 27, 28,
90226 /* 440 */ 28, 28, 29, 221, 312, 513, 427, 428, 517, 254,
90227 /* 450 */ 524, 386, 225, 339, 486, 363, 389, 339, 356, 443,
90228 /* 460 */ 494, 236, 30, 497, 33, 141, 399, 289, 336, 495,
90229 /* 470 */ 487, 501, 336, 450, 457, 463, 219, 446, 95, 445,
90230 /* 480 */ 68, 446, 95, 444, 424, 425, 488, 44, 348, 288,
90231 /* 490 */ 504, 424, 425, 23, 22, 32, 465, 466, 464, 464,
90232 /* 500 */ 25, 25, 24, 24, 24, 24, 391, 26, 26, 26,
90233 /* 510 */ 26, 27, 27, 28, 28, 28, 29, 221, 312, 361,
90234 /* 520 */ 556, 426, 520, 328, 191, 271, 339, 329, 247, 259,
90235 /* 530 */ 339, 566, 65, 249, 336, 426, 424, 425, 445, 516,
90236 /* 540 */ 426, 336, 444, 446, 9, 336, 556, 451, 457, 463,
90237 /* 550 */ 446, 74, 427, 428, 446, 69, 192, 618, 65, 427,
90238 /* 560 */ 428, 426, 323, 277, 16, 202, 189, 23, 22, 32,
90239 /* 570 */ 465, 466, 464, 464, 25, 25, 24, 24, 24, 24,
90240 /* 580 */ 255, 26, 26, 26, 26, 27, 27, 28, 28, 28,
90241 /* 590 */ 29, 221, 312, 339, 486, 426, 537, 235, 515, 447,
90242 /* 600 */ 339, 629, 419, 416, 427, 428, 217, 281, 336, 279,
90243 /* 610 */ 487, 203, 144, 526, 527, 336, 391, 446, 78, 429,
90244 /* 620 */ 430, 431, 457, 463, 446, 99, 488, 341, 528, 468,
90245 /* 630 */ 468, 426, 343, 472, 473, 626, 949, 474, 949, 529,
90246 /* 640 */ 447, 23, 22, 32, 465, 466, 464, 464, 25, 25,
90247 /* 650 */ 24, 24, 24, 24, 339, 26, 26, 26, 26, 27,
90248 /* 660 */ 27, 28, 28, 28, 29, 221, 312, 339, 162, 336,
90249 /* 670 */ 275, 283, 476, 376, 339, 579, 527, 346, 446, 98,
90250 /* 680 */ 622, 30, 336, 33, 141, 339, 426, 339, 508, 336,
90251 /* 690 */ 469, 446, 105, 418, 2, 222, 457, 463, 446, 101,
90252 /* 700 */ 336, 219, 336, 426, 161, 626, 948, 290, 948, 446,
90253 /* 710 */ 108, 446, 109, 398, 284, 23, 22, 32, 465, 466,
90254 /* 720 */ 464, 464, 25, 25, 24, 24, 24, 24, 339, 26,
90255 /* 730 */ 26, 26, 26, 27, 27, 28, 28, 28, 29, 221,
90256 /* 740 */ 312, 339, 271, 336, 339, 58, 535, 482, 143, 339,
90257 /* 750 */ 622, 318, 446, 133, 408, 257, 336, 426, 321, 336,
90258 /* 760 */ 357, 339, 272, 426, 336, 446, 135, 184, 446, 61,
90259 /* 770 */ 457, 463, 219, 446, 106, 426, 336, 493, 341, 234,
90260 /* 780 */ 468, 468, 621, 310, 407, 446, 102, 209, 144, 23,
90261 /* 790 */ 22, 32, 465, 466, 464, 464, 25, 25, 24, 24,
90262 /* 800 */ 24, 24, 339, 26, 26, 26, 26, 27, 27, 28,
90263 /* 810 */ 28, 28, 29, 221, 312, 339, 271, 336, 339, 341,
90264 /* 820 */ 538, 468, 468, 572, 383, 496, 446, 79, 499, 549,
90265 /* 830 */ 336, 426, 508, 336, 508, 341, 339, 468, 468, 446,
90266 /* 840 */ 103, 391, 446, 70, 457, 463, 572, 426, 40, 426,
90267 /* 850 */ 42, 336, 220, 324, 504, 341, 426, 468, 468, 18,
90268 /* 860 */ 446, 100, 266, 23, 22, 32, 465, 466, 464, 464,
90269 /* 870 */ 25, 25, 24, 24, 24, 24, 339, 26, 26, 26,
90270 /* 880 */ 26, 27, 27, 28, 28, 28, 29, 221, 312, 339,
90271 /* 890 */ 283, 336, 339, 261, 548, 384, 339, 327, 142, 550,
90272 /* 900 */ 446, 136, 475, 475, 336, 426, 185, 336, 499, 396,
90273 /* 910 */ 339, 336, 370, 446, 137, 256, 446, 138, 457, 463,
90274 /* 920 */ 446, 71, 499, 360, 426, 336, 161, 311, 623, 215,
90275 /* 930 */ 426, 359, 237, 412, 446, 82, 200, 23, 34, 32,
90276 /* 940 */ 465, 466, 464, 464, 25, 25, 24, 24, 24, 24,
90277 /* 950 */ 339, 26, 26, 26, 26, 27, 27, 28, 28, 28,
90278 /* 960 */ 29, 221, 312, 447, 271, 336, 339, 271, 340, 210,
90279 /* 970 */ 447, 172, 625, 211, 446, 83, 240, 552, 142, 426,
90280 /* 980 */ 321, 336, 426, 426, 339, 414, 331, 181, 458, 459,
90281 /* 990 */ 446, 72, 457, 463, 470, 506, 67, 158, 394, 336,
90282 /* 1000 */ 587, 325, 499, 447, 326, 311, 624, 447, 446, 84,
90283 /* 1010 */ 461, 462, 22, 32, 465, 466, 464, 464, 25, 25,
90284 /* 1020 */ 24, 24, 24, 24, 339, 26, 26, 26, 26, 27,
90285 /* 1030 */ 27, 28, 28, 28, 29, 221, 312, 460, 339, 336,
90286 /* 1040 */ 339, 283, 423, 393, 532, 533, 204, 205, 446, 85,
90287 /* 1050 */ 625, 392, 547, 336, 162, 336, 426, 426, 339, 435,
90288 /* 1060 */ 436, 339, 446, 104, 446, 86, 457, 463, 264, 291,
90289 /* 1070 */ 274, 49, 162, 336, 426, 426, 336, 297, 265, 542,
90290 /* 1080 */ 541, 405, 446, 88, 594, 446, 89, 32, 465, 466,
90291 /* 1090 */ 464, 464, 25, 25, 24, 24, 24, 24, 600, 26,
90292 /* 1100 */ 26, 26, 26, 27, 27, 28, 28, 28, 29, 221,
90293 /* 1110 */ 36, 345, 339, 3, 214, 8, 422, 335, 425, 437,
90294 /* 1120 */ 375, 148, 162, 36, 345, 339, 3, 336, 342, 432,
90295 /* 1130 */ 335, 425, 149, 577, 426, 162, 446, 90, 151, 339,
90296 /* 1140 */ 336, 342, 434, 339, 283, 433, 333, 347, 447, 446,
90297 /* 1150 */ 75, 588, 6, 158, 336, 448, 140, 481, 336, 426,
90298 /* 1160 */ 347, 453, 334, 446, 76, 49, 350, 446, 91, 7,
90299 /* 1170 */ 481, 426, 397, 283, 355, 250, 426, 39, 38, 251,
90300 /* 1180 */ 339, 426, 48, 353, 37, 337, 338, 596, 426, 452,
90301 /* 1190 */ 39, 38, 514, 252, 390, 336, 20, 37, 337, 338,
90302 /* 1200 */ 253, 43, 452, 206, 446, 92, 219, 449, 242, 243,
90303 /* 1210 */ 244, 150, 246, 283, 491, 593, 597, 490, 224, 258,
90304 /* 1220 */ 454, 454, 454, 455, 456, 10, 503, 183, 426, 178,
90305 /* 1230 */ 156, 301, 426, 454, 454, 454, 455, 456, 10, 339,
90306 /* 1240 */ 302, 426, 36, 345, 50, 3, 339, 505, 260, 335,
90307 /* 1250 */ 425, 262, 339, 176, 336, 581, 598, 358, 364, 175,
90308 /* 1260 */ 342, 336, 177, 446, 93, 46, 345, 336, 3, 339,
90309 /* 1270 */ 446, 94, 335, 425, 525, 339, 446, 77, 320, 347,
90310 /* 1280 */ 511, 339, 507, 342, 336, 589, 601, 56, 56, 481,
90311 /* 1290 */ 336, 512, 283, 446, 17, 531, 336, 426, 530, 446,
90312 /* 1300 */ 96, 534, 347, 404, 298, 446, 97, 426, 313, 39,
90313 /* 1310 */ 38, 267, 481, 219, 535, 536, 37, 337, 338, 283,
90314 /* 1320 */ 620, 452, 309, 283, 111, 19, 288, 509, 269, 424,
90315 /* 1330 */ 425, 539, 39, 38, 426, 238, 270, 411, 426, 37,
90316 /* 1340 */ 337, 338, 426, 426, 452, 558, 426, 307, 231, 276,
90317 /* 1350 */ 278, 426, 454, 454, 454, 455, 456, 10, 553, 280,
90318 /* 1360 */ 426, 559, 239, 230, 426, 426, 299, 282, 287, 481,
90319 /* 1370 */ 560, 388, 584, 232, 426, 454, 454, 454, 455, 456,
90320 /* 1380 */ 10, 561, 426, 426, 585, 395, 426, 426, 292, 194,
90321 /* 1390 */ 195, 592, 603, 300, 303, 308, 377, 522, 381, 426,
90322 /* 1400 */ 426, 452, 567, 426, 304, 617, 426, 426, 426, 426,
90323 /* 1410 */ 379, 53, 147, 165, 166, 167, 580, 212, 569, 426,
90324 /* 1420 */ 426, 285, 168, 570, 387, 120, 123, 187, 590, 402,
90325 /* 1430 */ 403, 125, 454, 454, 454, 330, 599, 614, 186, 126,
90326 /* 1440 */ 127, 128, 615, 616, 57, 60, 619, 107, 229, 64,
90327 /* 1450 */ 115, 420, 245, 130, 439, 180, 315, 207, 670, 316,
90328 /* 1460 */ 671, 467, 672, 153, 154, 35, 483, 471, 480, 188,
90329 /* 1470 */ 201, 155, 484, 5, 485, 489, 12, 502, 45, 11,
90330 /* 1480 */ 110, 145, 518, 519, 510, 228, 51, 112, 369, 273,
90331 /* 1490 */ 113, 159, 545, 52, 374, 114, 164, 265, 378, 190,
90332 /* 1500 */ 146, 568, 117, 158, 286, 382, 169, 119, 15, 583,
90333 /* 1510 */ 170, 171, 121, 586, 122, 54, 55, 13, 124, 591,
90334 /* 1520 */ 173, 174, 118, 575, 129, 595, 571, 131, 14, 132,
90335 /* 1530 */ 611, 63, 612, 193, 602, 179, 305, 413, 417, 960,
90336 /* 1540 */ 627,
90337 };
90338 static const YYCODETYPE yy_lookahead[] = {
90339 /* 0 */ 19, 142, 143, 144, 145, 24, 115, 26, 77, 78,
90340 /* 10 */ 79, 80, 92, 82, 83, 84, 85, 86, 87, 88,
90341 /* 20 */ 89, 90, 91, 92, 26, 27, 222, 223, 224, 225,
90342 /* 30 */ 49, 50, 81, 82, 83, 84, 85, 86, 87, 88,
90343 /* 40 */ 89, 90, 91, 92, 88, 89, 90, 91, 92, 68,
90344 /* 50 */ 69, 70, 71, 72, 73, 74, 75, 76, 77, 78,
90345 /* 60 */ 79, 80, 16, 82, 83, 84, 85, 86, 87, 88,
90346 /* 70 */ 89, 90, 91, 92, 19, 94, 19, 166, 167, 168,
90347 /* 80 */ 25, 82, 83, 84, 85, 86, 87, 88, 89, 90,
90348 /* 90 */ 91, 92, 94, 95, 96, 150, 36, 99, 100, 101,
90349 /* 100 */ 174, 169, 170, 171, 49, 50, 60, 109, 62, 54,
90350 /* 110 */ 165, 51, 1, 2, 26, 27, 174, 22, 58, 174,
90351 /* 120 */ 175, 26, 27, 68, 69, 70, 71, 72, 73, 74,
90352 /* 130 */ 75, 76, 77, 78, 79, 80, 186, 82, 83, 84,
90353 /* 140 */ 85, 86, 87, 88, 89, 90, 91, 92, 19, 92,
90354 /* 150 */ 19, 172, 173, 96, 97, 98, 99, 100, 101, 102,
90355 /* 160 */ 181, 216, 146, 147, 232, 108, 221, 107, 152, 186,
90356 /* 170 */ 154, 150, 195, 30, 86, 87, 160, 34, 49, 50,
90357 /* 180 */ 26, 52, 94, 95, 138, 97, 165, 181, 182, 94,
90358 /* 190 */ 95, 48, 104, 105, 188, 174, 175, 68, 69, 70,
90359 /* 200 */ 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
90360 /* 210 */ 194, 82, 83, 84, 85, 86, 87, 88, 89, 90,
90361 /* 220 */ 91, 92, 19, 92, 86, 87, 21, 24, 97, 98,
90362 /* 230 */ 99, 100, 101, 102, 218, 214, 215, 208, 66, 108,
90363 /* 240 */ 150, 86, 87, 88, 89, 90, 91, 92, 94, 173,
90364 /* 250 */ 160, 183, 49, 50, 191, 165, 96, 181, 22, 99,
90365 /* 260 */ 100, 101, 26, 247, 174, 175, 94, 57, 63, 109,
90366 /* 270 */ 98, 68, 69, 70, 71, 72, 73, 74, 75, 76,
90367 /* 280 */ 77, 78, 79, 80, 194, 82, 83, 84, 85, 86,
90368 /* 290 */ 87, 88, 89, 90, 91, 92, 19, 150, 150, 150,
90369 /* 300 */ 25, 129, 130, 131, 183, 100, 216, 160, 150, 161,
90370 /* 310 */ 162, 221, 165, 165, 165, 105, 106, 26, 27, 170,
90371 /* 320 */ 171, 174, 175, 165, 160, 115, 49, 50, 170, 171,
90372 /* 330 */ 94, 148, 163, 185, 186, 166, 167, 168, 128, 91,
90373 /* 340 */ 92, 194, 196, 138, 166, 68, 69, 70, 71, 72,
90374 /* 350 */ 73, 74, 75, 76, 77, 78, 79, 80, 194, 82,
90375 /* 360 */ 83, 84, 85, 86, 87, 88, 89, 90, 91, 92,
90376 /* 370 */ 19, 96, 11, 150, 99, 100, 101, 155, 26, 27,
90377 /* 380 */ 231, 232, 218, 205, 109, 94, 95, 150, 165, 231,
90378 /* 390 */ 232, 166, 150, 222, 150, 224, 225, 174, 175, 235,
90379 /* 400 */ 49, 50, 165, 24, 240, 26, 166, 165, 153, 165,
90380 /* 410 */ 119, 174, 175, 136, 237, 244, 174, 175, 57, 68,
90381 /* 420 */ 69, 70, 71, 72, 73, 74, 75, 76, 77, 78,
90382 /* 430 */ 79, 80, 236, 82, 83, 84, 85, 86, 87, 88,
90383 /* 440 */ 89, 90, 91, 92, 19, 205, 94, 95, 23, 226,
90384 /* 450 */ 165, 229, 215, 150, 12, 88, 234, 150, 216, 174,
90385 /* 460 */ 32, 217, 222, 25, 224, 225, 105, 106, 165, 41,
90386 /* 470 */ 28, 119, 165, 94, 49, 50, 115, 174, 175, 112,
90387 /* 480 */ 22, 174, 175, 116, 26, 27, 44, 136, 46, 128,
90388 /* 490 */ 166, 26, 27, 68, 69, 70, 71, 72, 73, 74,
90389 /* 500 */ 75, 76, 77, 78, 79, 80, 150, 82, 83, 84,
90390 /* 510 */ 85, 86, 87, 88, 89, 90, 91, 92, 19, 150,
90391 /* 520 */ 150, 165, 23, 220, 196, 150, 150, 220, 158, 205,
90392 /* 530 */ 150, 161, 162, 198, 165, 165, 26, 27, 112, 23,
90393 /* 540 */ 165, 165, 116, 174, 175, 165, 150, 166, 49, 50,
90394 /* 550 */ 174, 175, 94, 95, 174, 175, 118, 161, 162, 94,
90395 /* 560 */ 95, 165, 187, 16, 22, 160, 24, 68, 69, 70,
90396 /* 570 */ 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
90397 /* 580 */ 150, 82, 83, 84, 85, 86, 87, 88, 89, 90,
90398 /* 590 */ 91, 92, 19, 150, 12, 165, 23, 241, 88, 194,
90399 /* 600 */ 150, 0, 1, 2, 94, 95, 160, 60, 165, 62,
90400 /* 610 */ 28, 206, 207, 190, 191, 165, 150, 174, 175, 7,
90401 /* 620 */ 8, 9, 49, 50, 174, 175, 44, 111, 46, 113,
90402 /* 630 */ 114, 165, 169, 170, 171, 22, 23, 233, 25, 57,
90403 /* 640 */ 194, 68, 69, 70, 71, 72, 73, 74, 75, 76,
90404 /* 650 */ 77, 78, 79, 80, 150, 82, 83, 84, 85, 86,
90405 /* 660 */ 87, 88, 89, 90, 91, 92, 19, 150, 25, 165,
90406 /* 670 */ 23, 150, 233, 19, 150, 190, 191, 228, 174, 175,
90407 /* 680 */ 67, 222, 165, 224, 225, 150, 165, 150, 150, 165,
90408 /* 690 */ 23, 174, 175, 144, 145, 232, 49, 50, 174, 175,
90409 /* 700 */ 165, 115, 165, 165, 50, 22, 23, 241, 25, 174,
90410 /* 710 */ 175, 174, 175, 127, 193, 68, 69, 70, 71, 72,
90411 /* 720 */ 73, 74, 75, 76, 77, 78, 79, 80, 150, 82,
90412 /* 730 */ 83, 84, 85, 86, 87, 88, 89, 90, 91, 92,
90413 /* 740 */ 19, 150, 150, 165, 150, 24, 103, 23, 150, 150,
90414 /* 750 */ 67, 213, 174, 175, 97, 209, 165, 165, 104, 165,
90415 /* 760 */ 150, 150, 108, 165, 165, 174, 175, 23, 174, 175,
90416 /* 770 */ 49, 50, 115, 174, 175, 165, 165, 177, 111, 187,
90417 /* 780 */ 113, 114, 250, 251, 127, 174, 175, 206, 207, 68,
90418 /* 790 */ 69, 70, 71, 72, 73, 74, 75, 76, 77, 78,
90419 /* 800 */ 79, 80, 150, 82, 83, 84, 85, 86, 87, 88,
90420 /* 810 */ 89, 90, 91, 92, 19, 150, 150, 165, 150, 111,
90421 /* 820 */ 182, 113, 114, 105, 106, 177, 174, 175, 25, 166,
90422 /* 830 */ 165, 165, 150, 165, 150, 111, 150, 113, 114, 174,
90423 /* 840 */ 175, 150, 174, 175, 49, 50, 128, 165, 135, 165,
90424 /* 850 */ 137, 165, 197, 187, 166, 111, 165, 113, 114, 204,
90425 /* 860 */ 174, 175, 177, 68, 69, 70, 71, 72, 73, 74,
90426 /* 870 */ 75, 76, 77, 78, 79, 80, 150, 82, 83, 84,
90427 /* 880 */ 85, 86, 87, 88, 89, 90, 91, 92, 19, 150,
90428 /* 890 */ 150, 165, 150, 205, 177, 213, 150, 213, 95, 177,
90429 /* 900 */ 174, 175, 129, 130, 165, 165, 23, 165, 25, 150,
90430 /* 910 */ 150, 165, 178, 174, 175, 150, 174, 175, 49, 50,
90431 /* 920 */ 174, 175, 119, 19, 165, 165, 50, 22, 23, 160,
90432 /* 930 */ 165, 27, 241, 193, 174, 175, 160, 68, 69, 70,
90433 /* 940 */ 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
90434 /* 950 */ 150, 82, 83, 84, 85, 86, 87, 88, 89, 90,
90435 /* 960 */ 91, 92, 19, 194, 150, 165, 150, 150, 150, 160,
90436 /* 970 */ 194, 25, 67, 160, 174, 175, 217, 166, 95, 165,
90437 /* 980 */ 104, 165, 165, 165, 150, 245, 248, 249, 49, 50,
90438 /* 990 */ 174, 175, 49, 50, 23, 23, 25, 25, 242, 165,
90439 /* 1000 */ 199, 187, 119, 194, 187, 22, 23, 194, 174, 175,
90440 /* 1010 */ 71, 72, 69, 70, 71, 72, 73, 74, 75, 76,
90441 /* 1020 */ 77, 78, 79, 80, 150, 82, 83, 84, 85, 86,
90442 /* 1030 */ 87, 88, 89, 90, 91, 92, 19, 98, 150, 165,
90443 /* 1040 */ 150, 150, 150, 19, 7, 8, 105, 106, 174, 175,
90444 /* 1050 */ 67, 27, 23, 165, 25, 165, 165, 165, 150, 150,
90445 /* 1060 */ 150, 150, 174, 175, 174, 175, 49, 50, 98, 242,
90446 /* 1070 */ 23, 125, 25, 165, 165, 165, 165, 209, 108, 97,
90447 /* 1080 */ 98, 209, 174, 175, 193, 174, 175, 70, 71, 72,
90448 /* 1090 */ 73, 74, 75, 76, 77, 78, 79, 80, 199, 82,
90449 /* 1100 */ 83, 84, 85, 86, 87, 88, 89, 90, 91, 92,
90450 /* 1110 */ 19, 20, 150, 22, 160, 22, 149, 26, 27, 150,
90451 /* 1120 */ 23, 6, 25, 19, 20, 150, 22, 165, 37, 149,
90452 /* 1130 */ 26, 27, 151, 23, 165, 25, 174, 175, 151, 150,
90453 /* 1140 */ 165, 37, 13, 150, 150, 149, 149, 56, 194, 174,
90454 /* 1150 */ 175, 23, 25, 25, 165, 194, 150, 66, 165, 165,
90455 /* 1160 */ 56, 150, 159, 174, 175, 125, 150, 174, 175, 76,
90456 /* 1170 */ 66, 165, 218, 150, 122, 199, 165, 86, 87, 200,
90457 /* 1180 */ 150, 165, 123, 121, 93, 94, 95, 193, 165, 98,
90458 /* 1190 */ 86, 87, 88, 201, 240, 165, 124, 93, 94, 95,
90459 /* 1200 */ 202, 135, 98, 5, 174, 175, 115, 203, 10, 11,
90460 /* 1210 */ 12, 13, 14, 150, 157, 17, 193, 150, 227, 210,
90461 /* 1220 */ 129, 130, 131, 132, 133, 134, 150, 157, 165, 31,
90462 /* 1230 */ 117, 33, 165, 129, 130, 131, 132, 133, 134, 150,
90463 /* 1240 */ 42, 165, 19, 20, 104, 22, 150, 211, 210, 26,
90464 /* 1250 */ 27, 210, 150, 55, 165, 57, 193, 120, 104, 61,
90465 /* 1260 */ 37, 165, 64, 174, 175, 19, 20, 165, 22, 150,
90466 /* 1270 */ 174, 175, 26, 27, 176, 150, 174, 175, 47, 56,
90467 /* 1280 */ 211, 150, 150, 37, 165, 23, 23, 25, 25, 66,
90468 /* 1290 */ 165, 211, 150, 174, 175, 184, 165, 165, 176, 174,
90469 /* 1300 */ 175, 178, 56, 105, 106, 174, 175, 165, 110, 86,
90470 /* 1310 */ 87, 176, 66, 115, 103, 176, 93, 94, 95, 150,
90471 /* 1320 */ 23, 98, 25, 150, 22, 22, 128, 150, 150, 26,
90472 /* 1330 */ 27, 150, 86, 87, 165, 193, 150, 139, 165, 93,
90473 /* 1340 */ 94, 95, 165, 165, 98, 150, 165, 179, 92, 150,
90474 /* 1350 */ 150, 165, 129, 130, 131, 132, 133, 134, 184, 150,
90475 /* 1360 */ 165, 176, 193, 230, 165, 165, 193, 150, 150, 66,
90476 /* 1370 */ 176, 150, 150, 230, 165, 129, 130, 131, 132, 133,
90477 /* 1380 */ 134, 176, 165, 165, 150, 150, 165, 165, 150, 86,
90478 /* 1390 */ 87, 150, 150, 150, 150, 179, 18, 94, 45, 165,
90479 /* 1400 */ 165, 98, 157, 165, 150, 150, 165, 165, 165, 165,
90480 /* 1410 */ 157, 135, 68, 156, 156, 156, 189, 157, 157, 165,
90481 /* 1420 */ 165, 238, 156, 239, 157, 189, 22, 219, 199, 157,
90482 /* 1430 */ 18, 192, 129, 130, 131, 157, 199, 40, 219, 192,
90483 /* 1440 */ 192, 192, 157, 157, 243, 243, 38, 164, 180, 246,
90484 /* 1450 */ 180, 1, 15, 189, 23, 249, 252, 22, 117, 252,
90485 /* 1460 */ 117, 112, 117, 117, 117, 22, 11, 23, 23, 22,
90486 /* 1470 */ 22, 25, 23, 35, 23, 23, 35, 119, 25, 25,
90487 /* 1480 */ 22, 117, 23, 23, 27, 52, 22, 22, 52, 23,
90488 /* 1490 */ 22, 35, 29, 22, 52, 22, 102, 108, 19, 24,
90489 /* 1500 */ 39, 20, 104, 25, 138, 43, 104, 22, 5, 1,
90490 /* 1510 */ 117, 35, 107, 27, 126, 76, 76, 22, 118, 1,
90491 /* 1520 */ 16, 120, 53, 53, 118, 20, 59, 107, 22, 126,
90492 /* 1530 */ 23, 16, 23, 22, 127, 15, 140, 65, 3, 253,
90493 /* 1540 */ 4,
90494 };
90495 #define YY_SHIFT_USE_DFLT (-110)
90496 #define YY_SHIFT_MAX 417
90497 static const short yy_shift_ofst[] = {
90498 /* 0 */ 111, 1091, 1198, 1091, 1223, 1223, -2, 88, 88, -19,
90499 /* 10 */ 1223, 1223, 1223, 1223, 1223, 210, 465, 129, 1104, 1223,
90500 /* 20 */ 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223,
90501 /* 30 */ 1223, 1223, 1246, 1223, 1223, 1223, 1223, 1223, 1223, 1223,
90502 /* 40 */ 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223,
90503 /* 50 */ 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223,
90504 /* 60 */ 1223, -49, 361, 465, 465, 154, 138, 138, -109, 55,
90505 /* 70 */ 203, 277, 351, 425, 499, 573, 647, 721, 795, 869,
90506 /* 80 */ 795, 795, 795, 795, 795, 795, 795, 795, 795, 795,
90507 /* 90 */ 795, 795, 795, 795, 795, 795, 795, 795, 943, 1017,
90508 /* 100 */ 1017, -69, -69, -69, -69, -1, -1, 57, 155, -44,
90509 /* 110 */ 465, 465, 465, 465, 465, 654, 205, 465, 465, 465,
90510 /* 120 */ 465, 465, 465, 465, 465, 465, 465, 465, 465, 465,
90511 /* 130 */ 465, 465, 465, 248, 154, -80, -110, -110, -110, 1303,
90512 /* 140 */ 131, 95, 291, 352, 458, 510, 582, 582, 465, 465,
90513 /* 150 */ 465, 465, 465, 465, 465, 465, 465, 465, 465, 465,
90514 /* 160 */ 465, 465, 465, 465, 465, 465, 465, 465, 465, 465,
90515 /* 170 */ 465, 465, 465, 465, 465, 465, 465, 465, 465, 465,
90516 /* 180 */ 613, 683, 601, 379, 379, 379, 657, 586, -109, -109,
90517 /* 190 */ -109, -110, -110, -110, 172, 172, 275, 160, 516, 667,
90518 /* 200 */ 724, 442, 744, 883, 60, 60, 612, 367, 236, 803,
90519 /* 210 */ 708, 708, 143, 718, 708, 708, 708, 708, 542, 426,
90520 /* 220 */ 438, 154, 773, 773, 713, 428, 428, 904, 428, 876,
90521 /* 230 */ 428, 154, 428, 154, 643, 1024, 946, 1024, 904, 904,
90522 /* 240 */ 946, 1115, 1115, 1115, 1115, 1129, 1129, 1127, -109, 1040,
90523 /* 250 */ 1052, 1059, 1062, 1072, 1066, 1113, 1113, 1140, 1137, 1140,
90524 /* 260 */ 1137, 1140, 1137, 1154, 1154, 1231, 1154, 1211, 1154, 1302,
90525 /* 270 */ 1256, 1256, 1231, 1154, 1154, 1154, 1302, 1378, 1113, 1378,
90526 /* 280 */ 1113, 1378, 1113, 1113, 1353, 1276, 1378, 1113, 1344, 1344,
90527 /* 290 */ 1404, 1040, 1113, 1412, 1412, 1412, 1412, 1040, 1344, 1404,
90528 /* 300 */ 1113, 1397, 1397, 1113, 1113, 1408, -110, -110, -110, -110,
90529 /* 310 */ -110, -110, 939, 46, 547, 905, 983, 971, 972, 970,
90530 /* 320 */ 1037, 941, 982, 1029, 1047, 1097, 1110, 1128, 1262, 1263,
90531 /* 330 */ 1093, 1297, 1450, 1437, 1431, 1435, 1341, 1343, 1345, 1346,
90532 /* 340 */ 1347, 1349, 1443, 1444, 1445, 1447, 1455, 1448, 1449, 1446,
90533 /* 350 */ 1451, 1452, 1453, 1438, 1454, 1441, 1453, 1358, 1458, 1456,
90534 /* 360 */ 1457, 1364, 1459, 1460, 1461, 1433, 1464, 1463, 1436, 1465,
90535 /* 370 */ 1466, 1468, 1471, 1442, 1473, 1394, 1389, 1479, 1481, 1475,
90536 /* 380 */ 1398, 1462, 1467, 1469, 1478, 1470, 1366, 1402, 1485, 1503,
90537 /* 390 */ 1508, 1393, 1476, 1486, 1405, 1439, 1440, 1388, 1495, 1400,
90538 /* 400 */ 1518, 1504, 1401, 1505, 1406, 1420, 1403, 1506, 1407, 1507,
90539 /* 410 */ 1509, 1515, 1472, 1520, 1396, 1511, 1535, 1536,
90540 };
90541 #define YY_REDUCE_USE_DFLT (-197)
90542 #define YY_REDUCE_MAX 311
90543 static const short yy_reduce_ofst[] = {
90544 /* 0 */ -141, 90, 16, 147, -55, 21, 148, 149, 158, 240,
90545 /* 10 */ 223, 237, 242, 303, 307, 164, 370, 171, 369, 376,
90546 /* 20 */ 380, 443, 450, 504, 517, 524, 535, 537, 578, 591,
90547 /* 30 */ 594, 599, 611, 652, 665, 668, 686, 726, 739, 742,
90548 /* 40 */ 746, 760, 800, 816, 834, 874, 888, 890, 908, 911,
90549 /* 50 */ 962, 975, 989, 993, 1030, 1089, 1096, 1102, 1119, 1125,
90550 /* 60 */ 1131, -196, 954, 740, 396, 169, -68, 463, 405, 459,
90551 /* 70 */ 459, 459, 459, 459, 459, 459, 459, 459, 459, 459,
90552 /* 80 */ 459, 459, 459, 459, 459, 459, 459, 459, 459, 459,
90553 /* 90 */ 459, 459, 459, 459, 459, 459, 459, 459, 459, 459,
90554 /* 100 */ 459, 459, 459, 459, 459, 459, 459, -21, 459, 459,
90555 /* 110 */ 538, 375, 592, 666, 814, 6, 222, 521, 682, 817,
90556 /* 120 */ 356, 244, 466, 684, 691, 891, 994, 1023, 1063, 1142,
90557 /* 130 */ 1169, 759, 1173, 459, -89, 459, 459, 459, 459, 285,
90558 /* 140 */ 76, 430, 598, 610, 765, 818, 423, 485, 892, 909,
90559 /* 150 */ 910, 969, 1006, 818, 1011, 1016, 1067, 1076, 1132, 1177,
90560 /* 160 */ 1178, 1181, 1186, 1195, 1199, 1200, 1209, 1217, 1218, 1221,
90561 /* 170 */ 1222, 1234, 1235, 1238, 1241, 1242, 1243, 1244, 1254, 1255,
90562 /* 180 */ 532, 532, 549, 178, 324, 688, 446, 769, 776, 809,
90563 /* 190 */ 813, 655, 581, 738, -74, -58, -50, -17, -23, -23,
90564 /* 200 */ -23, 63, -23, 29, 68, 121, 183, 146, 225, 29,
90565 /* 210 */ -23, -23, 196, 177, -23, -23, -23, -23, 255, 328,
90566 /* 220 */ 335, 381, 404, 439, 449, 600, 648, 546, 685, 638,
90567 /* 230 */ 717, 663, 722, 811, 734, 756, 801, 827, 868, 872,
90568 /* 240 */ 899, 967, 980, 996, 997, 981, 987, 1003, 961, 976,
90569 /* 250 */ 979, 992, 998, 1004, 991, 1057, 1070, 1009, 1036, 1038,
90570 /* 260 */ 1069, 1041, 1080, 1098, 1122, 1111, 1135, 1123, 1139, 1168,
90571 /* 270 */ 1133, 1143, 1174, 1185, 1194, 1205, 1216, 1257, 1245, 1258,
90572 /* 280 */ 1253, 1259, 1260, 1261, 1183, 1184, 1266, 1267, 1227, 1236,
90573 /* 290 */ 1208, 1229, 1272, 1239, 1247, 1248, 1249, 1237, 1264, 1219,
90574 /* 300 */ 1278, 1201, 1202, 1285, 1286, 1203, 1283, 1268, 1270, 1206,
90575 /* 310 */ 1204, 1207,
90576 };
90577 static const YYACTIONTYPE yy_default[] = {
90578 /* 0 */ 634, 869, 958, 958, 869, 958, 958, 898, 898, 757,
90579 /* 10 */ 867, 958, 958, 958, 958, 958, 958, 932, 958, 958,
90580 /* 20 */ 958, 958, 958, 958, 958, 958, 958, 958, 958, 958,
90581 /* 30 */ 958, 958, 958, 958, 958, 958, 958, 958, 958, 958,
90582 /* 40 */ 958, 958, 958, 958, 958, 958, 958, 958, 958, 958,
90583 /* 50 */ 958, 958, 958, 958, 958, 958, 958, 958, 958, 958,
90584 /* 60 */ 958, 841, 958, 958, 958, 673, 898, 898, 761, 792,
90585 /* 70 */ 958, 958, 958, 958, 958, 958, 958, 958, 793, 958,
90586 /* 80 */ 871, 866, 862, 864, 863, 870, 794, 783, 790, 797,
90587 /* 90 */ 772, 911, 799, 800, 806, 807, 933, 931, 829, 828,
90588 /* 100 */ 847, 831, 845, 853, 846, 830, 840, 665, 832, 833,
90589 /* 110 */ 958, 958, 958, 958, 958, 726, 660, 958, 958, 958,
90590 /* 120 */ 958, 958, 958, 958, 958, 958, 958, 958, 958, 958,
90591 /* 130 */ 958, 958, 958, 834, 958, 835, 848, 849, 850, 958,
90592 /* 140 */ 958, 958, 958, 958, 958, 958, 958, 958, 640, 958,
90593 /* 150 */ 958, 958, 958, 958, 958, 958, 958, 958, 958, 958,
90594 /* 160 */ 958, 958, 958, 958, 958, 958, 958, 958, 958, 958,
90595 /* 170 */ 958, 958, 958, 958, 958, 882, 958, 936, 938, 958,
90596 /* 180 */ 958, 958, 634, 757, 757, 757, 958, 958, 958, 958,
90597 /* 190 */ 958, 751, 761, 950, 958, 958, 717, 958, 958, 958,
90598 /* 200 */ 958, 958, 958, 958, 958, 958, 642, 749, 675, 759,
90599 /* 210 */ 662, 738, 904, 958, 923, 921, 740, 802, 958, 749,
90600 /* 220 */ 758, 958, 958, 958, 865, 786, 786, 774, 786, 696,
90601 /* 230 */ 786, 958, 786, 958, 699, 916, 796, 916, 774, 774,
90602 /* 240 */ 796, 639, 639, 639, 639, 650, 650, 716, 958, 796,
90603 /* 250 */ 787, 789, 779, 791, 958, 765, 765, 773, 778, 773,
90604 /* 260 */ 778, 773, 778, 728, 728, 713, 728, 699, 728, 875,
90605 /* 270 */ 879, 879, 713, 728, 728, 728, 875, 657, 765, 657,
90606 /* 280 */ 765, 657, 765, 765, 908, 910, 657, 765, 730, 730,
90607 /* 290 */ 808, 796, 765, 737, 737, 737, 737, 796, 730, 808,
90608 /* 300 */ 765, 935, 935, 765, 765, 943, 683, 701, 701, 950,
90609 /* 310 */ 955, 955, 958, 958, 958, 958, 958, 958, 958, 958,
90610 /* 320 */ 958, 958, 958, 958, 958, 958, 958, 958, 958, 958,
90611 /* 330 */ 884, 958, 958, 648, 958, 667, 815, 820, 816, 958,
90612 /* 340 */ 817, 743, 958, 958, 958, 958, 958, 958, 958, 958,
90613 /* 350 */ 958, 958, 868, 958, 780, 958, 788, 958, 958, 958,
90614 /* 360 */ 958, 958, 958, 958, 958, 958, 958, 958, 958, 958,
90615 /* 370 */ 958, 958, 958, 958, 958, 958, 958, 958, 958, 958,
90616 /* 380 */ 958, 958, 958, 906, 907, 958, 958, 958, 958, 958,
90617 /* 390 */ 958, 914, 958, 958, 958, 958, 958, 958, 958, 958,
90618 /* 400 */ 958, 958, 958, 958, 958, 958, 958, 958, 958, 958,
90619 /* 410 */ 958, 958, 942, 958, 958, 945, 635, 958, 630, 632,
90620 /* 420 */ 633, 637, 638, 641, 667, 668, 670, 671, 672, 643,
90621 /* 430 */ 644, 645, 646, 647, 649, 653, 651, 652, 654, 661,
90622 /* 440 */ 663, 682, 684, 686, 747, 748, 812, 741, 742, 746,
90623 /* 450 */ 669, 823, 814, 818, 819, 821, 822, 836, 837, 839,
90624 /* 460 */ 844, 852, 855, 838, 843, 851, 854, 744, 745, 858,
90625 /* 470 */ 676, 677, 680, 681, 894, 896, 895, 897, 679, 678,
90626 /* 480 */ 824, 827, 860, 861, 924, 925, 926, 927, 928, 856,
90627 /* 490 */ 766, 859, 842, 781, 784, 785, 782, 750, 760, 768,
90628 /* 500 */ 769, 770, 771, 755, 756, 762, 777, 810, 811, 775,
90629 /* 510 */ 776, 763, 764, 752, 753, 754, 857, 813, 825, 826,
90630 /* 520 */ 687, 688, 820, 689, 690, 691, 729, 732, 733, 734,
90631 /* 530 */ 692, 711, 714, 715, 693, 700, 694, 695, 702, 703,
90632 /* 540 */ 704, 706, 707, 708, 709, 710, 705, 876, 877, 880,
90633 /* 550 */ 878, 697, 698, 712, 685, 674, 666, 718, 721, 722,
90634 /* 560 */ 723, 724, 725, 727, 719, 720, 664, 655, 658, 767,
90635 /* 570 */ 900, 909, 905, 901, 902, 903, 659, 872, 873, 731,
90636 /* 580 */ 804, 805, 899, 912, 915, 917, 918, 919, 809, 920,
90637 /* 590 */ 922, 913, 947, 656, 735, 736, 739, 881, 929, 795,
90638 /* 600 */ 798, 801, 803, 883, 885, 887, 889, 890, 891, 892,
90639 /* 610 */ 893, 886, 888, 930, 934, 937, 939, 940, 941, 944,
90640 /* 620 */ 946, 951, 952, 953, 956, 957, 954, 636, 631,
90641 };
90642 #define YY_SZ_ACTTAB (int)(sizeof(yy_action)/sizeof(yy_action[0]))
90643
90644 /* The next table maps tokens into fallback tokens. If a construct
90645 ** like the following:
@@ -92151,11 +92369,11 @@
92151 break;
92152 case 69: /* ccons ::= COLLATE ids */
92153 {sqlite3AddCollateType(pParse, &yymsp[0].minor.yy0);}
92154 break;
92155 case 72: /* refargs ::= */
92156 { yygotominor.yy328 = OE_None * 0x000101; }
92157 break;
92158 case 73: /* refargs ::= refargs refarg */
92159 { yygotominor.yy328 = (yymsp[-1].minor.yy328 & ~yymsp[0].minor.yy429.mask) | yymsp[0].minor.yy429.value; }
92160 break;
92161 case 74: /* refarg ::= MATCH nm */
@@ -92166,23 +92384,23 @@
92166 break;
92167 case 76: /* refarg ::= ON UPDATE refact */
92168 { yygotominor.yy429.value = yymsp[0].minor.yy328<<8; yygotominor.yy429.mask = 0x00ff00; }
92169 break;
92170 case 77: /* refact ::= SET NULL */
92171 { yygotominor.yy328 = OE_SetNull; }
92172 break;
92173 case 78: /* refact ::= SET DEFAULT */
92174 { yygotominor.yy328 = OE_SetDflt; }
92175 break;
92176 case 79: /* refact ::= CASCADE */
92177 { yygotominor.yy328 = OE_Cascade; }
92178 break;
92179 case 80: /* refact ::= RESTRICT */
92180 { yygotominor.yy328 = OE_Restrict; }
92181 break;
92182 case 81: /* refact ::= NO ACTION */
92183 { yygotominor.yy328 = OE_None; }
92184 break;
92185 case 83: /* defer_subclause ::= DEFERRABLE init_deferred_pred_opt */
92186 case 98: /* defer_subclause_opt ::= defer_subclause */ yytestcase(yyruleno==98);
92187 case 100: /* onconf ::= ON CONFLICT resolvetype */ yytestcase(yyruleno==100);
92188 case 103: /* resolvetype ::= raisetype */ yytestcase(yyruleno==103);
@@ -93431,19 +93649,19 @@
93431 0, 65, 6, 0, 48, 86, 98, 0, 115, 97, 0, 0, 45,
93432 0, 99, 24, 0, 17, 0, 119, 49, 23, 0, 5, 106, 25,
93433 92, 0, 0, 121, 102, 56, 120, 53, 28, 51, 0, 87, 0,
93434 96, 26, 0, 95, 0, 0, 0, 91, 88, 93, 84, 105, 14,
93435 39, 104, 0, 77, 0, 18, 85, 107, 32, 0, 117, 76, 109,
93436 59, 46, 80, 0, 0, 90, 40, 0, 112, 0, 36, 0, 0,
93437 29, 0, 82, 58, 60, 0, 20, 57, 0, 52,
93438 };
93439 static const unsigned char aNext[121] = {
93440 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0,
93441 0, 2, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0,
93442 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
93443 0, 0, 0, 0, 0, 33, 21, 0, 0, 0, 43, 3, 47,
93444 0, 0, 0, 0, 30, 54, 0, 0, 38, 0, 0, 0, 1,
93445 62, 0, 0, 63, 0, 41, 0, 0, 0, 0, 0, 0, 0,
93446 61, 0, 0, 0, 0, 31, 55, 16, 34, 10, 0, 0, 0,
93447 0, 0, 0, 0, 11, 68, 75, 0, 8, 0, 100, 94, 0,
93448 103, 0, 83, 0, 71, 0, 0, 110, 27, 37, 69, 79, 0,
93449 35, 64, 0, 0,
@@ -93451,11 +93669,11 @@
93451 static const unsigned char aLen[121] = {
93452 7, 7, 5, 4, 6, 4, 5, 3, 6, 7, 3, 6, 6,
93453 7, 7, 3, 8, 2, 6, 5, 4, 4, 3, 10, 4, 6,
93454 11, 6, 2, 7, 5, 5, 9, 6, 9, 9, 7, 10, 10,
93455 4, 6, 2, 3, 4, 9, 2, 6, 5, 6, 6, 5, 6,
93456 5, 5, 7, 7, 7, 2, 3, 4, 4, 7, 3, 6, 4,
93457 7, 6, 12, 6, 9, 4, 6, 5, 4, 7, 6, 5, 6,
93458 7, 5, 4, 5, 6, 5, 7, 3, 7, 13, 2, 2, 4,
93459 6, 6, 8, 5, 17, 12, 7, 8, 8, 2, 4, 4, 4,
93460 4, 4, 2, 2, 6, 5, 8, 5, 5, 8, 3, 5, 5,
93461 6, 4, 9, 3,
@@ -93482,11 +93700,11 @@
93482 TK_ALTER, TK_RAISE, TK_EXCLUSIVE, TK_EXISTS, TK_SAVEPOINT,
93483 TK_INTERSECT, TK_TRIGGER, TK_REFERENCES, TK_CONSTRAINT, TK_INTO,
93484 TK_OFFSET, TK_OF, TK_SET, TK_TEMP, TK_TEMP,
93485 TK_OR, TK_UNIQUE, TK_QUERY, TK_ATTACH, TK_HAVING,
93486 TK_GROUP, TK_UPDATE, TK_BEGIN, TK_JOIN_KW, TK_RELEASE,
93487 TK_BETWEEN, TK_NOTNULL, TK_NO, TK_NOT, TK_NULL,
93488 TK_LIKE_KW, TK_CASCADE, TK_ASC, TK_DELETE, TK_CASE,
93489 TK_COLLATE, TK_CREATE, TK_CTIME_KW, TK_DETACH, TK_IMMEDIATE,
93490 TK_JOIN, TK_INSERT, TK_MATCH, TK_PLAN, TK_ANALYZE,
93491 TK_PRAGMA, TK_ABORT, TK_VALUES, TK_VIRTUAL, TK_LIMIT,
93492 TK_WHEN, TK_WHERE, TK_RENAME, TK_AFTER, TK_REPLACE,
@@ -93560,13 +93778,13 @@
93560 testcase( i==51 ); /* UPDATE */
93561 testcase( i==52 ); /* BEGIN */
93562 testcase( i==53 ); /* INNER */
93563 testcase( i==54 ); /* RELEASE */
93564 testcase( i==55 ); /* BETWEEN */
93565 testcase( i==56 ); /* NOTNULL */
93566 testcase( i==57 ); /* NO */
93567 testcase( i==58 ); /* NOT */
93568 testcase( i==59 ); /* NULL */
93569 testcase( i==60 ); /* LIKE */
93570 testcase( i==61 ); /* CASCADE */
93571 testcase( i==62 ); /* ASC */
93572 testcase( i==63 ); /* DELETE */
@@ -95956,12 +96174,12 @@
95956 # error SQLITE_MAX_ATTACHED must be between 0 and 30
95957 #endif
95958 #if SQLITE_MAX_LIKE_PATTERN_LENGTH<1
95959 # error SQLITE_MAX_LIKE_PATTERN_LENGTH must be at least 1
95960 #endif
95961 #if SQLITE_MAX_VARIABLE_NUMBER<1
95962 # error SQLITE_MAX_VARIABLE_NUMBER must be at least 1
95963 #endif
95964 #if SQLITE_MAX_COLUMN>32767
95965 # error SQLITE_MAX_COLUMN must not exceed 32767
95966 #endif
95967 #if SQLITE_MAX_TRIGGER_DEPTH<1
95968
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -1,8 +1,8 @@
1 /******************************************************************************
2 ** This file is an amalgamation of many separate C source files from SQLite
3 ** version 3.6.20. By combining all the individual C code files into this
4 ** single large file, the entire code can be compiled as a one translation
5 ** unit. This allows many compilers to do optimizations that would not be
6 ** possible if the files were compiled separately. Performance improvements
7 ** of 5% are more are commonly seen when SQLite is compiled as a single
8 ** translation unit.
@@ -15,11 +15,11 @@
15 ** of the embedded sqlite3.h header file.) Additional code files may be needed
16 ** if you want a wrapper to interface SQLite with your choice of programming
17 ** language. The code for the "sqlite3" command-line shell is also in a
18 ** separate file. This file contains only code for the core SQLite library.
19 **
20 ** This amalgamation was generated on 2009-11-01 19:22:03 UTC.
21 */
22 #define SQLITE_CORE 1
23 #define SQLITE_AMALGAMATION 1
24 #ifndef SQLITE_PRIVATE
25 # define SQLITE_PRIVATE static
@@ -649,13 +649,13 @@
649 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
650 ** [sqlite_version()] and [sqlite_source_id()].
651 **
652 ** Requirements: [H10011] [H10014]
653 */
654 #define SQLITE_VERSION "3.6.20"
655 #define SQLITE_VERSION_NUMBER 3006020
656 #define SQLITE_SOURCE_ID "2009-10-30 14:27:15 612952743da28e651512547fc0d3925f4c698eb4"
657
658 /*
659 ** CAPI3REF: Run-Time Library Version Numbers {H10020} <S60100>
660 ** KEYWORDS: sqlite3_version
661 **
@@ -775,23 +775,13 @@
775 /*
776 ** CAPI3REF: Closing A Database Connection {H12010} <S30100><S40200>
777 **
778 ** This routine is the destructor for the [sqlite3] object.
779 **
780 ** Applications must [sqlite3_finalize | finalize] all [prepared statements]
781 ** and [sqlite3_blob_close | close] all [BLOB handles] associated with
782 ** the [sqlite3] object prior to attempting to close the object.
 
 
 
 
 
 
 
 
 
 
783 **
784 ** If [sqlite3_close()] is invoked while a transaction is open,
785 ** the transaction is automatically rolled back.
786 **
787 ** The C parameter to [sqlite3_close(C)] must be either a NULL
@@ -1365,10 +1355,13 @@
1355 ** CAPI3REF: Initialize The SQLite Library {H10130} <S20000><S30100>
1356 **
1357 ** The sqlite3_initialize() routine initializes the
1358 ** SQLite library. The sqlite3_shutdown() routine
1359 ** deallocates any resources that were allocated by sqlite3_initialize().
1360 ** This routines are designed to aid in process initialization and
1361 ** shutdown on embedded systems. Workstation applications using
1362 ** SQLite normally do not need to invoke either of these routines.
1363 **
1364 ** A call to sqlite3_initialize() is an "effective" call if it is
1365 ** the first time sqlite3_initialize() is invoked during the lifetime of
1366 ** the process, or if it is the first time sqlite3_initialize() is invoked
1367 ** following a call to sqlite3_shutdown(). Only an effective call
@@ -1376,15 +1369,21 @@
1369 ** are harmless no-ops.
1370 **
1371 ** A call to sqlite3_shutdown() is an "effective" call if it is the first
1372 ** call to sqlite3_shutdown() since the last sqlite3_initialize(). Only
1373 ** an effective call to sqlite3_shutdown() does any deinitialization.
1374 ** All other valid calls to sqlite3_shutdown() are harmless no-ops.
1375 **
1376 ** The sqlite3_initialize() interface is threadsafe, but sqlite3_shutdown()
1377 ** is not. The sqlite3_shutdown() interface must only be called from a
1378 ** single thread. All open [database connections] must be closed and all
1379 ** other SQLite resources must be deallocated prior to invoking
1380 ** sqlite3_shutdown().
1381 **
1382 ** Among other things, sqlite3_initialize() will invoke
1383 ** sqlite3_os_init(). Similarly, sqlite3_shutdown()
1384 ** will invoke sqlite3_os_end().
1385 **
1386 ** The sqlite3_initialize() routine returns [SQLITE_OK] on success.
1387 ** If for some reason, sqlite3_initialize() is unable to initialize
1388 ** the library (perhaps it is unable to allocate a needed resource such
1389 ** as a mutex) it returns an [error code] other than [SQLITE_OK].
@@ -2926,11 +2925,11 @@
2925 ** recommended for all new programs. The two older interfaces are retained
2926 ** for backwards compatibility, but their use is discouraged.
2927 ** In the "v2" interfaces, the prepared statement
2928 ** that is returned (the [sqlite3_stmt] object) contains a copy of the
2929 ** original SQL text. This causes the [sqlite3_step()] interface to
2930 ** behave a differently in three ways:
2931 **
2932 ** <ol>
2933 ** <li>
2934 ** If the database schema changes, instead of returning [SQLITE_SCHEMA] as it
2935 ** always used to do, [sqlite3_step()] will automatically recompile the SQL
@@ -2948,10 +2947,18 @@
2947 ** [sqlite3_step()] would only return a generic [SQLITE_ERROR] result code
2948 ** and you would have to make a second call to [sqlite3_reset()] in order
2949 ** to find the underlying cause of the problem. With the "v2" prepare
2950 ** interfaces, the underlying reason for the error is returned immediately.
2951 ** </li>
2952 **
2953 ** <li>
2954 ** ^If the value of a [parameter | host parameter] in the WHERE clause might
2955 ** change the query plan for a statement, then the statement may be
2956 ** automatically recompiled (as if there had been a schema change) on the first
2957 ** [sqlite3_step()] call following any change to the
2958 ** [sqlite3_bind_text | bindings] of the [parameter].
2959 ** </li>
2960 ** </ol>
2961 **
2962 ** Requirements:
2963 ** [H13011] [H13012] [H13013] [H13014] [H13015] [H13016] [H13019] [H13021]
2964 **
@@ -3480,10 +3487,12 @@
3487 ** result row of a query. In every case the first argument is a pointer
3488 ** to the [prepared statement] that is being evaluated (the [sqlite3_stmt*]
3489 ** that was returned from [sqlite3_prepare_v2()] or one of its variants)
3490 ** and the second argument is the index of the column for which information
3491 ** should be returned. The leftmost column of the result set has the index 0.
3492 ** The number of columns in the result can be determined using
3493 ** [sqlite3_column_count()].
3494 **
3495 ** If the SQL statement does not currently point to a valid row, or if the
3496 ** column index is out of range, the result is undefined.
3497 ** These routines may only be called when the most recent call to
3498 ** [sqlite3_step()] has returned [SQLITE_ROW] and neither
@@ -7311,151 +7320,151 @@
7320 */
7321 /************** Include opcodes.h in the middle of vdbe.h ********************/
7322 /************** Begin file opcodes.h *****************************************/
7323 /* Automatically generated. Do not edit */
7324 /* See the mkopcodeh.awk script for details */
7325 #define OP_ReadCookie 1
7326 #define OP_AutoCommit 2
7327 #define OP_Found 3
7328 #define OP_NullRow 4
7329 #define OP_Lt 79 /* same as TK_LT */
7330 #define OP_RowSetTest 5
7331 #define OP_Variable 6
7332 #define OP_RealAffinity 7
7333 #define OP_Sort 8
7334 #define OP_Affinity 9
7335 #define OP_IfNot 10
7336 #define OP_Gosub 11
7337 #define OP_Add 86 /* same as TK_PLUS */
7338 #define OP_NotFound 12
7339 #define OP_ResultRow 13
7340 #define OP_IsNull 73 /* same as TK_ISNULL */
7341 #define OP_SeekLe 14
7342 #define OP_Rowid 15
7343 #define OP_CreateIndex 16
7344 #define OP_Explain 17
7345 #define OP_DropIndex 18
7346 #define OP_Null 20
7347 #define OP_Program 21
7348 #define OP_ToInt 144 /* same as TK_TO_INT */
7349 #define OP_Int64 22
7350 #define OP_LoadAnalysis 23
7351 #define OP_IdxInsert 24
7352 #define OP_VUpdate 25
7353 #define OP_Next 26
7354 #define OP_ToNumeric 143 /* same as TK_TO_NUMERIC*/
7355 #define OP_Ge 80 /* same as TK_GE */
7356 #define OP_BitNot 93 /* same as TK_BITNOT */
7357 #define OP_SeekLt 27
7358 #define OP_Rewind 28
 
 
 
 
 
 
 
 
 
 
7359 #define OP_Multiply 88 /* same as TK_STAR */
7360 #define OP_ToReal 145 /* same as TK_TO_REAL */
7361 #define OP_Gt 77 /* same as TK_GT */
7362 #define OP_RowSetRead 29
7363 #define OP_Last 30
7364 #define OP_MustBeInt 31
7365 #define OP_Ne 75 /* same as TK_NE */
7366 #define OP_IncrVacuum 32
7367 #define OP_String 33
7368 #define OP_VFilter 34
7369 #define OP_Count 35
7370 #define OP_Close 36
7371 #define OP_AggFinal 37
7372 #define OP_RowData 38
7373 #define OP_IdxRowid 39
7374 #define OP_Param 40
7375 #define OP_Pagecount 41
7376 #define OP_BitOr 83 /* same as TK_BITOR */
7377 #define OP_NotNull 74 /* same as TK_NOTNULL */
7378 #define OP_SeekGe 42
7379 #define OP_Not 19 /* same as TK_NOT */
7380 #define OP_OpenPseudo 43
7381 #define OP_Halt 44
7382 #define OP_Compare 45
7383 #define OP_NewRowid 46
7384 #define OP_Real 130 /* same as TK_FLOAT */
7385 #define OP_IdxLT 47
7386 #define OP_SeekGt 48
7387 #define OP_MemMax 49
7388 #define OP_Function 50
7389 #define OP_IntegrityCk 51
7390 #define OP_Remainder 90 /* same as TK_REM */
7391 #define OP_FkCounter 52
7392 #define OP_SCopy 53
7393 #define OP_ShiftLeft 84 /* same as TK_LSHIFT */
7394 #define OP_IfNeg 54
7395 #define OP_BitAnd 82 /* same as TK_BITAND */
7396 #define OP_Or 68 /* same as TK_OR */
7397 #define OP_NotExists 55
7398 #define OP_VDestroy 56
7399 #define OP_IdxDelete 57
7400 #define OP_Vacuum 58
7401 #define OP_Copy 59
7402 #define OP_If 60
7403 #define OP_Jump 61
7404 #define OP_Destroy 62
7405 #define OP_AggStep 63
7406 #define OP_Clear 64
7407 #define OP_Insert 65
7408 #define OP_Permutation 66
7409 #define OP_VBegin 67
7410 #define OP_OpenEphemeral 70
7411 #define OP_IdxGE 71
7412 #define OP_Trace 72
7413 #define OP_Divide 89 /* same as TK_SLASH */
7414 #define OP_String8 94 /* same as TK_STRING */
7415 #define OP_Concat 91 /* same as TK_CONCAT */
7416 #define OP_MakeRecord 81
7417 #define OP_Yield 92
7418 #define OP_SetCookie 95
7419 #define OP_Prev 96
7420 #define OP_DropTrigger 97
7421 #define OP_FkIfZero 98
7422 #define OP_And 69 /* same as TK_AND */
7423 #define OP_VColumn 99
7424 #define OP_Return 100
7425 #define OP_OpenWrite 101
7426 #define OP_Integer 102
7427 #define OP_Transaction 103
7428 #define OP_IfPos 104
7429 #define OP_RowSetAdd 105
7430 #define OP_CollSeq 106
7431 #define OP_Savepoint 107
7432 #define OP_VRename 108
7433 #define OP_ToBlob 142 /* same as TK_TO_BLOB */
7434 #define OP_Sequence 109
7435 #define OP_ShiftRight 85 /* same as TK_RSHIFT */
7436 #define OP_HaltIfNull 110
7437 #define OP_VCreate 111
7438 #define OP_CreateTable 112
7439 #define OP_AddImm 113
 
 
 
 
 
7440 #define OP_ToText 141 /* same as TK_TO_TEXT */
7441 #define OP_DropTable 114
7442 #define OP_IsUnique 115
7443 #define OP_VOpen 116
7444 #define OP_IfZero 117
7445 #define OP_Noop 118
7446 #define OP_InsertInt 119
7447 #define OP_RowKey 120
7448 #define OP_Expire 121
7449 #define OP_Delete 122
7450 #define OP_Subtract 87 /* same as TK_MINUS */
7451 #define OP_Blob 123
7452 #define OP_Move 124
7453 #define OP_Goto 125
7454 #define OP_ParseSchema 126
7455 #define OP_Eq 76 /* same as TK_EQ */
7456 #define OP_VNext 127
7457 #define OP_Seek 128
7458 #define OP_Le 78 /* same as TK_LE */
7459 #define OP_TableLock 129
7460 #define OP_VerifyCookie 131
7461 #define OP_Column 132
7462 #define OP_OpenRead 133
7463 #define OP_ResetCount 134
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7464
7465 /* The following opcode values are never used */
 
7466 #define OP_NotUsed_135 135
7467 #define OP_NotUsed_136 136
7468 #define OP_NotUsed_137 137
7469 #define OP_NotUsed_138 138
7470 #define OP_NotUsed_139 139
@@ -7471,27 +7480,27 @@
7480 #define OPFLG_IN1 0x0004 /* in1: P1 is an input */
7481 #define OPFLG_IN2 0x0008 /* in2: P2 is an input */
7482 #define OPFLG_IN3 0x0010 /* in3: P3 is an input */
7483 #define OPFLG_OUT3 0x0020 /* out3: P3 is an output */
7484 #define OPFLG_INITIALIZER {\
7485 /* 0 */ 0x00, 0x02, 0x00, 0x11, 0x00, 0x15, 0x00, 0x04,\
7486 /* 8 */ 0x01, 0x00, 0x05, 0x01, 0x11, 0x00, 0x11, 0x02,\
7487 /* 16 */ 0x02, 0x00, 0x00, 0x04, 0x02, 0x01, 0x02, 0x00,\
7488 /* 24 */ 0x08, 0x00, 0x01, 0x11, 0x01, 0x21, 0x01, 0x05,\
7489 /* 32 */ 0x01, 0x02, 0x01, 0x02, 0x00, 0x00, 0x00, 0x02,\
7490 /* 40 */ 0x02, 0x02, 0x11, 0x00, 0x00, 0x00, 0x02, 0x11,\
7491 /* 48 */ 0x11, 0x08, 0x00, 0x00, 0x00, 0x04, 0x05, 0x11,\
7492 /* 56 */ 0x00, 0x00, 0x00, 0x04, 0x05, 0x01, 0x02, 0x00,\
7493 /* 64 */ 0x00, 0x00, 0x00, 0x00, 0x2c, 0x2c, 0x00, 0x11,\
7494 /* 72 */ 0x00, 0x05, 0x05, 0x15, 0x15, 0x15, 0x15, 0x15,\
7495 /* 80 */ 0x15, 0x00, 0x2c, 0x2c, 0x2c, 0x2c, 0x2c, 0x2c,\
7496 /* 88 */ 0x2c, 0x2c, 0x2c, 0x2c, 0x04, 0x04, 0x02, 0x10,\
7497 /* 96 */ 0x01, 0x00, 0x01, 0x00, 0x04, 0x00, 0x02, 0x00,\
7498 /* 104 */ 0x05, 0x08, 0x00, 0x00, 0x00, 0x02, 0x10, 0x00,\
7499 /* 112 */ 0x02, 0x04, 0x00, 0x11, 0x00, 0x05, 0x00, 0x00,\
7500 /* 120 */ 0x00, 0x00, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01,\
7501 /* 128 */ 0x08, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00,\
7502 /* 136 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x04, 0x04,\
7503 /* 144 */ 0x04, 0x04,}
7504
7505 /************** End of opcodes.h *********************************************/
7506 /************** Continuing where we left off in vdbe.h ***********************/
@@ -7534,14 +7543,13 @@
7543 SQLITE_PRIVATE sqlite3 *sqlite3VdbeDb(Vdbe*);
7544 SQLITE_PRIVATE void sqlite3VdbeSetSql(Vdbe*, const char *z, int n, int);
7545 SQLITE_PRIVATE void sqlite3VdbeSwap(Vdbe*,Vdbe*);
7546 SQLITE_PRIVATE VdbeOp *sqlite3VdbeTakeOpArray(Vdbe*, int*, int*);
7547 SQLITE_PRIVATE void sqlite3VdbeProgramDelete(sqlite3 *, SubProgram *, int);
7548 SQLITE_PRIVATE sqlite3_value *sqlite3VdbeGetValue(Vdbe*, int, u8);
7549 SQLITE_PRIVATE void sqlite3VdbeSetVarmask(Vdbe*, int);
7550
 
 
 
7551 SQLITE_PRIVATE UnpackedRecord *sqlite3VdbeRecordUnpack(KeyInfo*,int,const void*,char*,int);
7552 SQLITE_PRIVATE void sqlite3VdbeDeleteUnpackedRecord(UnpackedRecord*);
7553 SQLITE_PRIVATE int sqlite3VdbeRecordCompare(int,const void*,UnpackedRecord*);
7554
7555
@@ -9201,11 +9209,12 @@
9209 *********************************************************************/
9210
9211 int iTable; /* TK_COLUMN: cursor number of table holding column
9212 ** TK_REGISTER: register number
9213 ** TK_TRIGGER: 1 -> new, 0 -> old */
9214 i16 iColumn; /* TK_COLUMN: column index. -1 for rowid.
9215 ** TK_VARIABLE: variable number (always >= 1). */
9216 i16 iAgg; /* Which entry in pAggInfo->aCol[] or ->aFunc[] */
9217 i16 iRightJoinTable; /* If EP_FromJoin, the right table of the join */
9218 u8 flags2; /* Second set of flags. EP2_... */
9219 u8 op2; /* If a TK_REGISTER, the original value of Expr.op */
9220 AggInfo *pAggInfo; /* Used by TK_AGG_COLUMN and TK_AGG_FUNCTION */
@@ -9743,10 +9752,11 @@
9752
9753 int nVar; /* Number of '?' variables seen in the SQL so far */
9754 int nVarExpr; /* Number of used slots in apVarExpr[] */
9755 int nVarExprAlloc; /* Number of allocated slots in apVarExpr[] */
9756 Expr **apVarExpr; /* Pointers to :aaa and $aaaa wildcard expressions */
9757 Vdbe *pReprepare; /* VM being reprepared (sqlite3Reprepare()) */
9758 int nAlias; /* Number of aliased result set columns */
9759 int nAliasAlloc; /* Number of allocated slots for aAlias[] */
9760 int *aAlias; /* Register used to hold aliased result */
9761 u8 explain; /* True if the EXPLAIN flag is found on the query */
9762 Token sNameToken; /* Token with unqualified schema object name */
@@ -10252,11 +10262,10 @@
10262 SQLITE_PRIVATE char *sqlite3NameFromToken(sqlite3*, Token*);
10263 SQLITE_PRIVATE int sqlite3ExprCompare(Expr*, Expr*);
10264 SQLITE_PRIVATE void sqlite3ExprAnalyzeAggregates(NameContext*, Expr*);
10265 SQLITE_PRIVATE void sqlite3ExprAnalyzeAggList(NameContext*,ExprList*);
10266 SQLITE_PRIVATE Vdbe *sqlite3GetVdbe(Parse*);
 
10267 SQLITE_PRIVATE void sqlite3PrngSaveState(void);
10268 SQLITE_PRIVATE void sqlite3PrngRestoreState(void);
10269 SQLITE_PRIVATE void sqlite3PrngResetState(void);
10270 SQLITE_PRIVATE void sqlite3RollbackAll(sqlite3*);
10271 SQLITE_PRIVATE void sqlite3CodeVerifySchema(Parse*, int);
@@ -10451,11 +10460,11 @@
10460 SQLITE_PRIVATE void sqlite3AlterFunctions(sqlite3*);
10461 SQLITE_PRIVATE void sqlite3AlterRenameTable(Parse*, SrcList*, Token*);
10462 SQLITE_PRIVATE int sqlite3GetToken(const unsigned char *, int *);
10463 SQLITE_PRIVATE void sqlite3NestedParse(Parse*, const char*, ...);
10464 SQLITE_PRIVATE void sqlite3ExpirePreparedStatements(sqlite3*);
10465 SQLITE_PRIVATE int sqlite3CodeSubselect(Parse *, Expr *, int, int);
10466 SQLITE_PRIVATE void sqlite3SelectPrep(Parse*, Select*, NameContext*);
10467 SQLITE_PRIVATE int sqlite3ResolveExprNames(NameContext*, Expr*);
10468 SQLITE_PRIVATE void sqlite3ResolveSelectNames(Parse*, Select*, NameContext*);
10469 SQLITE_PRIVATE int sqlite3ResolveOrderGroupBy(Parse*, Select*, ExprList*, const char*);
10470 SQLITE_PRIVATE void sqlite3ColumnDefault(Vdbe *, Table *, int, int);
@@ -10486,10 +10495,11 @@
10495 SQLITE_PRIVATE void sqlite3StrAccumInit(StrAccum*, char*, int, int);
10496 SQLITE_PRIVATE void sqlite3StrAccumAppend(StrAccum*,const char*,int);
10497 SQLITE_PRIVATE char *sqlite3StrAccumFinish(StrAccum*);
10498 SQLITE_PRIVATE void sqlite3StrAccumReset(StrAccum*);
10499 SQLITE_PRIVATE void sqlite3SelectDestInit(SelectDest*,int,int);
10500 SQLITE_PRIVATE Expr *sqlite3CreateColumnExpr(sqlite3 *, SrcList *, int, int);
10501
10502 SQLITE_PRIVATE void sqlite3BackupRestart(sqlite3_backup *);
10503 SQLITE_PRIVATE void sqlite3BackupUpdate(sqlite3_backup *, Pgno, const u8 *);
10504
10505 /*
@@ -15704,13 +15714,10 @@
15714 ** cache database pages that are not currently in use.
15715 */
15716 SQLITE_API int sqlite3_release_memory(int n){
15717 #ifdef SQLITE_ENABLE_MEMORY_MANAGEMENT
15718 int nRet = 0;
 
 
 
15719 nRet += sqlite3PcacheReleaseMemory(n-nRet);
15720 return nRet;
15721 #else
15722 UNUSED_PARAMETER(n);
15723 return SQLITE_OK;
@@ -17828,10 +17835,11 @@
17835 #ifdef SQLITE_DEBUG
17836 FILE *trace; /* Write an execution trace here, if not NULL */
17837 #endif
17838 VdbeFrame *pFrame; /* Parent frame */
17839 int nFrame; /* Number of frames in pFrame list */
17840 u32 expmask; /* Binding to these vars invalidates VM */
17841 };
17842
17843 /*
17844 ** The following are allowed values for Vdbe.magic
17845 */
@@ -17890,13 +17898,11 @@
17898 SQLITE_PRIVATE int sqlite3VdbeOpcodeHasProperty(int, int);
17899 SQLITE_PRIVATE int sqlite3VdbeMemGrow(Mem *pMem, int n, int preserve);
17900 SQLITE_PRIVATE int sqlite3VdbeCloseStatement(Vdbe *, int);
17901 SQLITE_PRIVATE void sqlite3VdbeFrameDelete(VdbeFrame*);
17902 SQLITE_PRIVATE int sqlite3VdbeFrameRestore(VdbeFrame *);
17903 SQLITE_PRIVATE void sqlite3VdbeMemStoreType(Mem *pMem);
 
 
17904
17905 #ifndef SQLITE_OMIT_FOREIGN_KEY
17906 SQLITE_PRIVATE int sqlite3VdbeCheckFk(Vdbe *, int);
17907 #else
17908 # define sqlite3VdbeCheckFk(p,i) 0
@@ -17992,24 +17998,24 @@
17998 *zOut++ = (u8)(0x00DC + ((c>>8)&0x03)); \
17999 *zOut++ = (u8)(c&0x00FF); \
18000 } \
18001 }
18002
18003 #define READ_UTF16LE(zIn, TERM, c){ \
18004 c = (*zIn++); \
18005 c += ((*zIn++)<<8); \
18006 if( c>=0xD800 && c<0xE000 && TERM ){ \
18007 int c2 = (*zIn++); \
18008 c2 += ((*zIn++)<<8); \
18009 c = (c2&0x03FF) + ((c&0x003F)<<10) + (((c&0x03C0)+0x0040)<<10); \
18010 } \
18011 }
18012
18013 #define READ_UTF16BE(zIn, TERM, c){ \
18014 c = ((*zIn++)<<8); \
18015 c += (*zIn++); \
18016 if( c>=0xD800 && c<0xE000 && TERM ){ \
18017 int c2 = ((*zIn++)<<8); \
18018 c2 += (*zIn++); \
18019 c = (c2&0x03FF) + ((c&0x003F)<<10) + (((c&0x03C0)+0x0040)<<10); \
18020 } \
18021 }
@@ -18190,17 +18196,17 @@
18196 }else{
18197 assert( desiredEnc==SQLITE_UTF8 );
18198 if( pMem->enc==SQLITE_UTF16LE ){
18199 /* UTF-16 Little-endian -> UTF-8 */
18200 while( zIn<zTerm ){
18201 READ_UTF16LE(zIn, zIn<zTerm, c);
18202 WRITE_UTF8(z, c);
18203 }
18204 }else{
18205 /* UTF-16 Big-endian -> UTF-8 */
18206 while( zIn<zTerm ){
18207 READ_UTF16BE(zIn, zIn<zTerm, c);
18208 WRITE_UTF8(z, c);
18209 }
18210 }
18211 pMem->n = (int)(z - zOut);
18212 }
@@ -18366,35 +18372,27 @@
18372 return m.z;
18373 }
18374 #endif
18375
18376 /*
18377 ** zIn is a UTF-16 encoded unicode string at least nChar characters long.
18378 ** Return the number of bytes in the first nChar unicode characters
18379 ** in pZ. nChar must be non-negative.
18380 */
18381 SQLITE_PRIVATE int sqlite3Utf16ByteLen(const void *zIn, int nChar){
18382 int c;
18383 unsigned char const *z = zIn;
18384 int n = 0;
18385
18386 if( SQLITE_UTF16NATIVE==SQLITE_UTF16BE ){
 
 
 
 
 
 
 
 
 
18387 while( n<nChar ){
18388 READ_UTF16BE(z, 1, c);
18389 n++;
18390 }
18391 }else{
18392 while( n<nChar ){
18393 READ_UTF16LE(z, 1, c);
18394 n++;
18395 }
18396 }
18397 return (int)(z-(unsigned char const *)zIn);
18398 }
@@ -18432,11 +18430,11 @@
18430 WRITE_UTF16LE(z, i);
18431 n = (int)(z-zBuf);
18432 assert( n>0 && n<=4 );
18433 z[0] = 0;
18434 z = zBuf;
18435 READ_UTF16LE(z, 1, c);
18436 assert( c==i );
18437 assert( (z-zBuf)==n );
18438 }
18439 for(i=0; i<0x00110000; i++){
18440 if( i>=0xD800 && i<0xE000 ) continue;
@@ -18444,11 +18442,11 @@
18442 WRITE_UTF16BE(z, i);
18443 n = (int)(z-zBuf);
18444 assert( n>0 && n<=4 );
18445 z[0] = 0;
18446 z = zBuf;
18447 READ_UTF16BE(z, 1, c);
18448 assert( c==i );
18449 assert( (z-zBuf)==n );
18450 }
18451 }
18452 #endif /* SQLITE_TEST */
@@ -19834,91 +19832,91 @@
19832 /* Automatically generated. Do not edit */
19833 /* See the mkopcodec.awk script for details. */
19834 #if !defined(SQLITE_OMIT_EXPLAIN) || !defined(NDEBUG) || defined(VDBE_PROFILE) || defined(SQLITE_DEBUG)
19835 SQLITE_PRIVATE const char *sqlite3OpcodeName(int i){
19836 static const char *const azName[] = { "?",
19837 /* 1 */ "ReadCookie",
19838 /* 2 */ "AutoCommit",
19839 /* 3 */ "Found",
19840 /* 4 */ "NullRow",
19841 /* 5 */ "RowSetTest",
19842 /* 6 */ "Variable",
19843 /* 7 */ "RealAffinity",
19844 /* 8 */ "Sort",
19845 /* 9 */ "Affinity",
19846 /* 10 */ "IfNot",
19847 /* 11 */ "Gosub",
19848 /* 12 */ "NotFound",
19849 /* 13 */ "ResultRow",
19850 /* 14 */ "SeekLe",
19851 /* 15 */ "Rowid",
19852 /* 16 */ "CreateIndex",
19853 /* 17 */ "Explain",
19854 /* 18 */ "DropIndex",
19855 /* 19 */ "Not",
19856 /* 20 */ "Null",
19857 /* 21 */ "Program",
19858 /* 22 */ "Int64",
19859 /* 23 */ "LoadAnalysis",
19860 /* 24 */ "IdxInsert",
19861 /* 25 */ "VUpdate",
19862 /* 26 */ "Next",
19863 /* 27 */ "SeekLt",
19864 /* 28 */ "Rewind",
19865 /* 29 */ "RowSetRead",
19866 /* 30 */ "Last",
19867 /* 31 */ "MustBeInt",
19868 /* 32 */ "IncrVacuum",
19869 /* 33 */ "String",
19870 /* 34 */ "VFilter",
19871 /* 35 */ "Count",
19872 /* 36 */ "Close",
19873 /* 37 */ "AggFinal",
19874 /* 38 */ "RowData",
19875 /* 39 */ "IdxRowid",
19876 /* 40 */ "Param",
19877 /* 41 */ "Pagecount",
19878 /* 42 */ "SeekGe",
19879 /* 43 */ "OpenPseudo",
19880 /* 44 */ "Halt",
19881 /* 45 */ "Compare",
19882 /* 46 */ "NewRowid",
19883 /* 47 */ "IdxLT",
19884 /* 48 */ "SeekGt",
19885 /* 49 */ "MemMax",
19886 /* 50 */ "Function",
19887 /* 51 */ "IntegrityCk",
19888 /* 52 */ "FkCounter",
19889 /* 53 */ "SCopy",
19890 /* 54 */ "IfNeg",
19891 /* 55 */ "NotExists",
19892 /* 56 */ "VDestroy",
19893 /* 57 */ "IdxDelete",
19894 /* 58 */ "Vacuum",
19895 /* 59 */ "Copy",
19896 /* 60 */ "If",
19897 /* 61 */ "Jump",
19898 /* 62 */ "Destroy",
19899 /* 63 */ "AggStep",
19900 /* 64 */ "Clear",
19901 /* 65 */ "Insert",
19902 /* 66 */ "Permutation",
19903 /* 67 */ "VBegin",
19904 /* 68 */ "Or",
19905 /* 69 */ "And",
19906 /* 70 */ "OpenEphemeral",
19907 /* 71 */ "IdxGE",
19908 /* 72 */ "Trace",
19909 /* 73 */ "IsNull",
19910 /* 74 */ "NotNull",
19911 /* 75 */ "Ne",
19912 /* 76 */ "Eq",
19913 /* 77 */ "Gt",
19914 /* 78 */ "Le",
19915 /* 79 */ "Lt",
19916 /* 80 */ "Ge",
19917 /* 81 */ "MakeRecord",
19918 /* 82 */ "BitAnd",
19919 /* 83 */ "BitOr",
19920 /* 84 */ "ShiftLeft",
19921 /* 85 */ "ShiftRight",
19922 /* 86 */ "Add",
@@ -19925,53 +19923,53 @@
19923 /* 87 */ "Subtract",
19924 /* 88 */ "Multiply",
19925 /* 89 */ "Divide",
19926 /* 90 */ "Remainder",
19927 /* 91 */ "Concat",
19928 /* 92 */ "Yield",
19929 /* 93 */ "BitNot",
19930 /* 94 */ "String8",
19931 /* 95 */ "SetCookie",
19932 /* 96 */ "Prev",
19933 /* 97 */ "DropTrigger",
19934 /* 98 */ "FkIfZero",
19935 /* 99 */ "VColumn",
19936 /* 100 */ "Return",
19937 /* 101 */ "OpenWrite",
19938 /* 102 */ "Integer",
19939 /* 103 */ "Transaction",
19940 /* 104 */ "IfPos",
19941 /* 105 */ "RowSetAdd",
19942 /* 106 */ "CollSeq",
19943 /* 107 */ "Savepoint",
19944 /* 108 */ "VRename",
19945 /* 109 */ "Sequence",
19946 /* 110 */ "HaltIfNull",
19947 /* 111 */ "VCreate",
19948 /* 112 */ "CreateTable",
19949 /* 113 */ "AddImm",
19950 /* 114 */ "DropTable",
19951 /* 115 */ "IsUnique",
19952 /* 116 */ "VOpen",
19953 /* 117 */ "IfZero",
19954 /* 118 */ "Noop",
19955 /* 119 */ "InsertInt",
19956 /* 120 */ "RowKey",
19957 /* 121 */ "Expire",
19958 /* 122 */ "Delete",
19959 /* 123 */ "Blob",
19960 /* 124 */ "Move",
19961 /* 125 */ "Goto",
19962 /* 126 */ "ParseSchema",
19963 /* 127 */ "VNext",
19964 /* 128 */ "Seek",
19965 /* 129 */ "TableLock",
19966 /* 130 */ "Real",
19967 /* 131 */ "VerifyCookie",
19968 /* 132 */ "Column",
19969 /* 133 */ "OpenRead",
19970 /* 134 */ "ResetCount",
19971 /* 135 */ "NotUsed_135",
19972 /* 136 */ "NotUsed_136",
19973 /* 137 */ "NotUsed_137",
19974 /* 138 */ "NotUsed_138",
19975 /* 139 */ "NotUsed_139",
@@ -24102,11 +24100,12 @@
24100
24101 /* If control gets to this point, then actually go ahead and make
24102 ** operating system calls for the specified lock.
24103 */
24104 if( locktype==SHARED_LOCK ){
24105 int lk, lrc1, lrc2;
24106 int lrc1Errno = 0;
24107
24108 /* Now get the read-lock SHARED_LOCK */
24109 /* note that the quality of the randomness doesn't matter that much */
24110 lk = random();
24111 context->sharedByte = (lk & 0x7fffffff)%(SHARED_SIZE - 1);
@@ -27247,11 +27246,11 @@
27246 ** Determine if we are dealing with WindowsCE - which has a much
27247 ** reduced API.
27248 */
27249 #if SQLITE_OS_WINCE
27250 # define AreFileApisANSI() 1
27251 # define FormatMessageW(a,b,c,d,e,f,g) 0
27252 #endif
27253
27254 /*
27255 ** WinCE lacks native support for file locking so we have to fake it
27256 ** with some code of our own.
@@ -28421,31 +28420,63 @@
28420 ** The return value of getLastErrorMsg
28421 ** is zero if the error message fits in the buffer, or non-zero
28422 ** otherwise (if the message was truncated).
28423 */
28424 static int getLastErrorMsg(int nBuf, char *zBuf){
 
 
 
 
 
28425 /* FormatMessage returns 0 on failure. Otherwise it
28426 ** returns the number of TCHARs written to the output
28427 ** buffer, excluding the terminating null char.
28428 */
28429 DWORD error = GetLastError();
28430 DWORD dwLen = 0;
28431 char *zOut;
28432
28433 if( isNT() ){
28434 WCHAR *zTempWide = NULL;
28435 dwLen = FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
28436 NULL,
28437 error,
28438 0,
28439 (LPWSTR) &zTempWide,
28440 0,
28441 0);
28442 if( dwLen > 0 ){
28443 /* allocate a buffer and convert to UTF8 */
28444 zOut = unicodeToUtf8(zTempWide);
28445 /* free the system buffer allocated by FormatMessage */
28446 LocalFree(zTempWide);
28447 }
28448 /* isNT() is 1 if SQLITE_OS_WINCE==1, so this else is never executed.
28449 ** Since the ASCII version of these Windows API do not exist for WINCE,
28450 ** it's important to not reference them for WINCE builds.
28451 */
28452 #if SQLITE_OS_WINCE==0
28453 }else{
28454 char *zTemp = NULL;
28455 dwLen = FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
28456 NULL,
28457 error,
28458 0,
28459 (LPSTR) &zTemp,
28460 0,
28461 0);
28462 if( dwLen > 0 ){
28463 /* allocate a buffer and convert to UTF8 */
28464 zOut = sqlite3_win32_mbcs_to_utf8(zTemp);
28465 /* free the system buffer allocated by FormatMessage */
28466 LocalFree(zTemp);
28467 }
28468 #endif
28469 }
28470 if( 0 == dwLen ){
28471 sqlite3_snprintf(nBuf, zBuf, "OsError 0x%x (%u)", error, error);
28472 }else{
28473 /* copy a maximum of nBuf chars to output buffer */
28474 sqlite3_snprintf(nBuf, zBuf, "%s", zOut);
28475 /* free the UTF8 buffer */
28476 free(zOut);
28477 }
 
 
28478 return 0;
28479 }
28480
28481 /*
28482 ** Open a file.
@@ -28809,18 +28840,18 @@
28840 &bytesPerSector,
28841 &dwDummy,
28842 &dwDummy);
28843 }else{
28844 /* trim path to just drive reference */
28845 char *p = (char *)zConverted;
28846 for(;*p;p++){
28847 if( *p == '\\' ){
28848 *p = '\0';
28849 break;
28850 }
28851 }
28852 dwRet = GetDiskFreeSpaceA((char*)zConverted,
28853 &dwDummy,
28854 &bytesPerSector,
28855 &dwDummy,
28856 &dwDummy);
28857 }
@@ -36675,13 +36706,13 @@
36706 **
36707 ** FORMAT DETAILS
36708 **
36709 ** The file is divided into pages. The first page is called page 1,
36710 ** the second is page 2, and so forth. A page number of zero indicates
36711 ** "no such page". The page size can be any power of 2 between 512 and 32768.
36712 ** Each page can be either a btree page, a freelist page, an overflow
36713 ** page, or a pointer-map page.
36714 **
36715 ** The first page is always a btree page. The first 100 bytes of the first
36716 ** page contain a special header (the "file header") that describes the file.
36717 ** The format of the file header is as follows:
36718 **
@@ -36955,12 +36986,12 @@
36986 ** is opaque to the database connection. The database connection cannot
36987 ** see the internals of this structure and only deals with pointers to
36988 ** this structure.
36989 **
36990 ** For some database files, the same underlying database cache might be
36991 ** shared between multiple connections. In that case, each connection
36992 ** has it own instance of this object. But each instance of this object
36993 ** points to the same BtShared object. The database cache and the
36994 ** schema associated with the database file are all contained within
36995 ** the BtShared object.
36996 **
36997 ** All fields in this structure are accessed under sqlite3.mutex.
@@ -37097,11 +37128,11 @@
37128 ** b-tree within a database file.
37129 **
37130 ** The entry is identified by its MemPage and the index in
37131 ** MemPage.aCell[] of the entry.
37132 **
37133 ** A single database file can shared by two more database connections,
37134 ** but cursors cannot be shared. Each cursor is associated with a
37135 ** particular database connection identified BtCursor.pBtree.db.
37136 **
37137 ** Fields in this structure are accessed under the BtShared.mutex
37138 ** found at self->pBt->mutex.
@@ -37701,26 +37732,28 @@
37732
37733 #ifndef SQLITE_OMIT_SHARED_CACHE
37734
37735 #ifdef SQLITE_DEBUG
37736 /*
37737 **** This function is only used as part of an assert() statement. ***
37738 **
37739 ** Check to see if pBtree holds the required locks to read or write to the
37740 ** table with root page iRoot. Return 1 if it does and 0 if not.
37741 **
37742 ** For example, when writing to a table with root-page iRoot via
37743 ** Btree connection pBtree:
37744 **
37745 ** assert( hasSharedCacheTableLock(pBtree, iRoot, 0, WRITE_LOCK) );
37746 **
37747 ** When writing to an index that resides in a sharable database, the
37748 ** caller should have first obtained a lock specifying the root page of
37749 ** the corresponding table. This makes things a bit more complicated,
37750 ** as this module treats each table as a separate structure. To determine
37751 ** the table corresponding to the index being written, this
37752 ** function has to search through the database schema.
37753 **
37754 ** Instead of a lock on the table/index rooted at page iRoot, the caller may
37755 ** hold a write-lock on the schema table (root page 1). This is also
37756 ** acceptable.
37757 */
37758 static int hasSharedCacheTableLock(
37759 Btree *pBtree, /* Handle that must hold lock */
@@ -37730,23 +37763,28 @@
37763 ){
37764 Schema *pSchema = (Schema *)pBtree->pBt->pSchema;
37765 Pgno iTab = 0;
37766 BtLock *pLock;
37767
37768 /* If this database is not shareable, or if the client is reading
37769 ** and has the read-uncommitted flag set, then no lock is required.
37770 ** Return true immediately.
37771 */
 
 
 
37772 if( (pBtree->sharable==0)
37773 || (eLockType==READ_LOCK && (pBtree->db->flags & SQLITE_ReadUncommitted))
 
37774 ){
37775 return 1;
37776 }
37777
37778 /* If the client is reading or writing an index and the schema is
37779 ** not loaded, then it is too difficult to actually check to see if
37780 ** the correct locks are held. So do not bother - just return true.
37781 ** This case does not come up very often anyhow.
37782 */
37783 if( isIndex && (!pSchema || (pSchema->flags&DB_SchemaLoaded)==0) ){
37784 return 1;
37785 }
37786
37787 /* Figure out the root-page that the lock should be held on. For table
37788 ** b-trees, this is just the root page of the b-tree being read or
37789 ** written. For index b-trees, it is the root page of the associated
37790 ** table. */
@@ -37775,18 +37813,28 @@
37813 }
37814
37815 /* Failed to find the required lock. */
37816 return 0;
37817 }
37818 #endif /* SQLITE_DEBUG */
37819
37820 #ifdef SQLITE_DEBUG
37821 /*
37822 **** This function may be used as part of assert() statements only. ****
37823 **
37824 ** Return true if it would be illegal for pBtree to write into the
37825 ** table or index rooted at iRoot because other shared connections are
37826 ** simultaneously reading that same table or index.
37827 **
37828 ** It is illegal for pBtree to write if some other Btree object that
37829 ** shares the same BtShared object is currently reading or writing
37830 ** the iRoot table. Except, if the other Btree object has the
37831 ** read-uncommitted flag set, then it is OK for the other object to
37832 ** have a read cursor.
37833 **
37834 ** For example, before writing to any part of the table or index
37835 ** rooted at page iRoot, one should call:
37836 **
37837 ** assert( !hasReadConflicts(pBtree, iRoot) );
37838 */
37839 static int hasReadConflicts(Btree *pBtree, Pgno iRoot){
37840 BtCursor *p;
@@ -37801,11 +37849,11 @@
37849 return 0;
37850 }
37851 #endif /* #ifdef SQLITE_DEBUG */
37852
37853 /*
37854 ** Query to see if Btree handle p may obtain a lock of type eLock
37855 ** (READ_LOCK or WRITE_LOCK) on the table with root-page iTab. Return
37856 ** SQLITE_OK if the lock may be obtained (by calling
37857 ** setSharedCacheTableLock()), or SQLITE_LOCKED if not.
37858 */
37859 static int querySharedCacheTableLock(Btree *p, Pgno iTab, u8 eLock){
@@ -37822,11 +37870,11 @@
37870 ** must be an open write transaction on the file itself.
37871 */
37872 assert( eLock==READ_LOCK || (p==pBt->pWriter && p->inTrans==TRANS_WRITE) );
37873 assert( eLock==READ_LOCK || pBt->inTransaction==TRANS_WRITE );
37874
37875 /* This routine is a no-op if the shared-cache is not enabled */
37876 if( !p->sharable ){
37877 return SQLITE_OK;
37878 }
37879
37880 /* If some other connection is holding an exclusive lock, the
@@ -37868,14 +37916,14 @@
37916 ** by Btree handle p. Parameter eLock must be either READ_LOCK or
37917 ** WRITE_LOCK.
37918 **
37919 ** This function assumes the following:
37920 **
37921 ** (a) The specified Btree object p is connected to a sharable
37922 ** database (one with the BtShared.sharable flag set), and
37923 **
37924 ** (b) No other Btree objects hold a lock that conflicts
37925 ** with the requested lock (i.e. querySharedCacheTableLock() has
37926 ** already been called and returned SQLITE_OK).
37927 **
37928 ** SQLITE_OK is returned if the lock is added successfully. SQLITE_NOMEM
37929 ** is returned if a malloc attempt fails.
@@ -37936,13 +37984,13 @@
37984 #endif /* !SQLITE_OMIT_SHARED_CACHE */
37985
37986 #ifndef SQLITE_OMIT_SHARED_CACHE
37987 /*
37988 ** Release all the table locks (locks obtained via calls to
37989 ** the setSharedCacheTableLock() procedure) held by Btree object p.
37990 **
37991 ** This function assumes that Btree p has an open read or write
37992 ** transaction. If it does not, then the BtShared.isPending variable
37993 ** may be incorrectly cleared.
37994 */
37995 static void clearAllSharedCacheTableLocks(Btree *p){
37996 BtShared *pBt = p->pBt;
@@ -37971,11 +38019,11 @@
38019 if( pBt->pWriter==p ){
38020 pBt->pWriter = 0;
38021 pBt->isExclusive = 0;
38022 pBt->isPending = 0;
38023 }else if( pBt->nTransaction==2 ){
38024 /* This function is called when Btree p is concluding its
38025 ** transaction. If there currently exists a writer, and p is not
38026 ** that writer, then the number of locks held by connections other
38027 ** than the writer must be about to drop to zero. In this case
38028 ** set the isPending flag to 0.
38029 **
@@ -37985,11 +38033,11 @@
38033 pBt->isPending = 0;
38034 }
38035 }
38036
38037 /*
38038 ** This function changes all write-locks held by Btree p into read-locks.
38039 */
38040 static void downgradeAllSharedCacheTableLocks(Btree *p){
38041 BtShared *pBt = p->pBt;
38042 if( pBt->pWriter==p ){
38043 BtLock *pLock;
@@ -38006,13 +38054,15 @@
38054 #endif /* SQLITE_OMIT_SHARED_CACHE */
38055
38056 static void releasePage(MemPage *pPage); /* Forward reference */
38057
38058 /*
38059 ***** This routine is used inside of assert() only ****
38060 **
38061 ** Verify that the cursor holds the mutex on its BtShared
38062 */
38063 #ifdef SQLITE_DEBUG
38064 static int cursorHoldsMutex(BtCursor *p){
38065 return sqlite3_mutex_held(p->pBt->mutex);
38066 }
38067 #endif
38068
@@ -38039,20 +38089,20 @@
38089 }
38090 }
38091
38092 /*
38093 ** This function is called before modifying the contents of a table
38094 ** to invalidate any incrblob cursors that are open on the
38095 ** row or one of the rows being modified.
38096 **
38097 ** If argument isClearTable is true, then the entire contents of the
38098 ** table is about to be deleted. In this case invalidate all incrblob
38099 ** cursors open on any row within the table with root-page pgnoRoot.
38100 **
38101 ** Otherwise, if argument isClearTable is false, then the row with
38102 ** rowid iRow is being replaced or deleted. In this case invalidate
38103 ** only those incrblob cursors open on that specific row.
38104 */
38105 static void invalidateIncrblobCursors(
38106 Btree *pBtree, /* The database file to check */
38107 i64 iRow, /* The rowid that might be changing */
38108 int isClearTable /* True if all rows are being deleted */
@@ -38066,14 +38116,15 @@
38116 }
38117 }
38118 }
38119
38120 #else
38121 /* Stub functions when INCRBLOB is omitted */
38122 #define invalidateOverflowCache(x)
38123 #define invalidateAllOverflowCache(x)
38124 #define invalidateIncrblobCursors(x,y,z)
38125 #endif /* SQLITE_OMIT_INCRBLOB */
38126
38127 /*
38128 ** Set bit pgno of the BtShared.pHasContent bitvec. This is called
38129 ** when a page that previously contained data becomes a free-list leaf
38130 ** page.
@@ -38102,11 +38153,11 @@
38153 ** to restore the database to its original configuration.
38154 **
38155 ** The solution is the BtShared.pHasContent bitvec. Whenever a page is
38156 ** moved to become a free-list leaf page, the corresponding bit is
38157 ** set in the bitvec. Whenever a leaf page is extracted from the free-list,
38158 ** optimization 2 above is omitted if the corresponding bit is already
38159 ** set in BtShared.pHasContent. The contents of the bitvec are cleared
38160 ** at the end of every transaction.
38161 */
38162 static int btreeSetHasContent(BtShared *pBt, Pgno pgno){
38163 int rc = SQLITE_OK;
@@ -38198,12 +38249,12 @@
38249 invalidateOverflowCache(pCur);
38250 return rc;
38251 }
38252
38253 /*
38254 ** Save the positions of all cursors (except pExcept) that are open on
38255 ** the table with root-page iRoot. Usually, this is called just before cursor
38256 ** pExcept is used to modify the table (BtreeDelete() or BtreeInsert()).
38257 */
38258 static int saveAllCursors(BtShared *pBt, Pgno iRoot, BtCursor *pExcept){
38259 BtCursor *p;
38260 assert( sqlite3_mutex_held(pBt->mutex) );
@@ -38604,11 +38655,14 @@
38655 }
38656
38657 assert( nSize==debuginfo.nSize );
38658 return (u16)nSize;
38659 }
38660
38661 #ifdef SQLITE_DEBUG
38662 /* This variation on cellSizePtr() is used inside of assert() statements
38663 ** only. */
38664 static u16 cellSize(MemPage *pPage, int iCell){
38665 return cellSizePtr(pPage, findCell(pPage, iCell));
38666 }
38667 #endif
38668
@@ -40576,22 +40630,17 @@
40630 ** This function is called from both BtreeCommitPhaseTwo() and BtreeRollback()
40631 ** at the conclusion of a transaction.
40632 */
40633 static void btreeEndTransaction(Btree *p){
40634 BtShared *pBt = p->pBt;
 
40635 assert( sqlite3BtreeHoldsMutex(p) );
40636
 
 
 
 
 
 
 
40637 btreeClearHasContent(pBt);
40638 if( p->inTrans>TRANS_NONE && p->db->activeVdbeCnt>1 ){
40639 /* If there are other active statements that belong to this database
40640 ** handle, downgrade to a read-only transaction. The other statements
40641 ** may still be reading from the database. */
40642 downgradeAllSharedCacheTableLocks(p);
40643 p->inTrans = TRANS_READ;
40644 }else{
40645 /* If the handle had any kind of transaction open, decrement the
40646 ** transaction count of the shared btree. If the transaction count
@@ -44047,11 +44096,11 @@
44096 int appendBias, /* True if this is likely an append */
44097 int seekResult /* Result of prior MovetoUnpacked() call */
44098 ){
44099 int rc;
44100 int loc = seekResult; /* -1: before desired location +1: after */
44101 int szNew = 0;
44102 int idx;
44103 MemPage *pPage;
44104 Btree *p = pCur->pBtree;
44105 BtShared *pBt = p->pBt;
44106 unsigned char *oldCell;
@@ -47103,10 +47152,13 @@
47152 sqlite3VdbeMemSetStr(pVal, sqlite3HexToBlob(db, zVal, nVal), nVal/2,
47153 0, SQLITE_DYNAMIC);
47154 }
47155 #endif
47156
47157 if( pVal ){
47158 sqlite3VdbeMemStoreType(pVal);
47159 }
47160 *ppVal = pVal;
47161 return SQLITE_OK;
47162
47163 no_mem:
47164 db->mallocFailed = 1;
@@ -47207,17 +47259,18 @@
47259
47260 /*
47261 ** Remember the SQL string for a prepared statement.
47262 */
47263 SQLITE_PRIVATE void sqlite3VdbeSetSql(Vdbe *p, const char *z, int n, int isPrepareV2){
47264 assert( isPrepareV2==1 || isPrepareV2==0 );
47265 if( p==0 ) return;
47266 #ifdef SQLITE_OMIT_TRACE
47267 if( !isPrepareV2 ) return;
47268 #endif
47269 assert( p->zSql==0 );
47270 p->zSql = sqlite3DbStrNDup(p->db, z, n);
47271 p->isPrepareV2 = isPrepareV2;
47272 }
47273
47274 /*
47275 ** Return the SQL associated with a prepared statement
47276 */
@@ -48167,31 +48220,10 @@
48220 }
48221 releaseMemArray(aMem, p->nChildMem);
48222 sqlite3DbFree(p->v->db, p);
48223 }
48224
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
48225 #ifndef SQLITE_OMIT_EXPLAIN
48226 /*
48227 ** Give a listing of the program in the virtual machine.
48228 **
48229 ** The interface is the same as sqlite3VdbeExec(). But instead of
@@ -50176,10 +50208,49 @@
50208 ** Return the database associated with the Vdbe.
50209 */
50210 SQLITE_PRIVATE sqlite3 *sqlite3VdbeDb(Vdbe *v){
50211 return v->db;
50212 }
50213
50214 /*
50215 ** Return a pointer to an sqlite3_value structure containing the value bound
50216 ** parameter iVar of VM v. Except, if the value is an SQL NULL, return
50217 ** 0 instead. Unless it is NULL, apply affinity aff (one of the SQLITE_AFF_*
50218 ** constants) to the value before returning it.
50219 **
50220 ** The returned value must be freed by the caller using sqlite3ValueFree().
50221 */
50222 SQLITE_PRIVATE sqlite3_value *sqlite3VdbeGetValue(Vdbe *v, int iVar, u8 aff){
50223 assert( iVar>0 );
50224 if( v ){
50225 Mem *pMem = &v->aVar[iVar-1];
50226 if( 0==(pMem->flags & MEM_Null) ){
50227 sqlite3_value *pRet = sqlite3ValueNew(v->db);
50228 if( pRet ){
50229 sqlite3VdbeMemCopy((Mem *)pRet, pMem);
50230 sqlite3ValueApplyAffinity(pRet, aff, SQLITE_UTF8);
50231 sqlite3VdbeMemStoreType((Mem *)pRet);
50232 }
50233 return pRet;
50234 }
50235 }
50236 return 0;
50237 }
50238
50239 /*
50240 ** Configure SQL variable iVar so that binding a new value to it signals
50241 ** to sqlite3_reoptimize() that re-preparing the statement may result
50242 ** in a better query plan.
50243 */
50244 SQLITE_PRIVATE void sqlite3VdbeSetVarmask(Vdbe *v, int iVar){
50245 assert( iVar>0 );
50246 if( iVar>32 ){
50247 v->expmask = 0xffffffff;
50248 }else{
50249 v->expmask |= ((u32)1 << (iVar-1));
50250 }
50251 }
50252
50253 /************** End of vdbeaux.c *********************************************/
50254 /************** Begin file vdbeapi.c *****************************************/
50255 /*
50256 ** 2004 May 26
@@ -50277,10 +50348,13 @@
50348 #endif
50349 sqlite3_mutex_enter(mutex);
50350 for(i=0; i<p->nVar; i++){
50351 sqlite3VdbeMemRelease(&p->aVar[i]);
50352 p->aVar[i].flags = MEM_Null;
50353 }
50354 if( p->isPrepareV2 && p->expmask ){
50355 p->expired = 1;
50356 }
50357 sqlite3_mutex_leave(mutex);
50358 return rc;
50359 }
50360
@@ -50483,11 +50557,11 @@
50557 if( db->mallocFailed ){
50558 return SQLITE_NOMEM;
50559 }
50560
50561 if( p->pc<=0 && p->expired ){
50562 if( ALWAYS(p->rc==SQLITE_OK || p->rc==SQLITE_SCHEMA) ){
50563 p->rc = SQLITE_SCHEMA;
50564 }
50565 rc = SQLITE_ERROR;
50566 goto end_of_step;
50567 }
@@ -51093,10 +51167,19 @@
51167 i--;
51168 pVar = &p->aVar[i];
51169 sqlite3VdbeMemRelease(pVar);
51170 pVar->flags = MEM_Null;
51171 sqlite3Error(p->db, SQLITE_OK, 0);
51172
51173 /* If the bit corresponding to this variable in Vdbe.expmask is set, then
51174 ** binding a new value to this variable invalidates the current query plan.
51175 */
51176 if( p->isPrepareV2 &&
51177 ((i<32 && p->expmask & ((u32)1 << i)) || p->expmask==0xffffffff)
51178 ){
51179 p->expired = 1;
51180 }
51181 return SQLITE_OK;
51182 }
51183
51184 /*
51185 ** Bind a text or BLOB value.
@@ -51342,10 +51425,16 @@
51425 SQLITE_API int sqlite3_transfer_bindings(sqlite3_stmt *pFromStmt, sqlite3_stmt *pToStmt){
51426 Vdbe *pFrom = (Vdbe*)pFromStmt;
51427 Vdbe *pTo = (Vdbe*)pToStmt;
51428 if( pFrom->nVar!=pTo->nVar ){
51429 return SQLITE_ERROR;
51430 }
51431 if( pTo->isPrepareV2 && pTo->expmask ){
51432 pTo->expired = 1;
51433 }
51434 if( pFrom->isPrepareV2 && pFrom->expmask ){
51435 pFrom->expired = 1;
51436 }
51437 return sqlite3TransferBindings(pFromStmt, pToStmt);
51438 }
51439 #endif
51440
@@ -51538,16 +51627,14 @@
51627 #define ExpandBlob(P) (((P)->flags&MEM_Zero)?sqlite3VdbeMemExpandBlob(P):0)
51628
51629 /*
51630 ** Argument pMem points at a register that will be passed to a
51631 ** user-defined function or returned to the user as the result of a query.
51632 ** This routine sets the pMem->type variable used by the sqlite3_value_*()
51633 ** routines.
 
51634 */
51635 SQLITE_PRIVATE void sqlite3VdbeMemStoreType(Mem *pMem){
 
51636 int flags = pMem->flags;
51637 if( flags & MEM_Null ){
51638 pMem->type = SQLITE_NULL;
51639 }
51640 else if( flags & MEM_Int ){
@@ -51714,11 +51801,11 @@
51801 ** This is an EXPERIMENTAL api and is subject to change or removal.
51802 */
51803 SQLITE_API int sqlite3_value_numeric_type(sqlite3_value *pVal){
51804 Mem *pMem = (Mem*)pVal;
51805 applyNumericAffinity(pMem);
51806 sqlite3VdbeMemStoreType(pMem);
51807 return pMem->type;
51808 }
51809
51810 /*
51811 ** Exported version of applyAffinity(). This one works on sqlite3_value*,
@@ -52263,11 +52350,11 @@
52350 int res; /* Result of an sqlite3BtreeLast() */
52351 int cnt; /* Counter to limit the number of searches */
52352 Mem *pMem; /* Register holding largest rowid for AUTOINCREMENT */
52353 VdbeFrame *pFrame; /* Root frame of VDBE */
52354 } be;
52355 struct OP_InsertInt_stack_vars {
52356 Mem *pData; /* MEM cell holding data for the record to be inserted */
52357 Mem *pKey; /* MEM cell holding key for the record */
52358 i64 iKey; /* The integer ROWID or key for the record to be inserted */
52359 VdbeCursor *pC; /* Cursor to table into which insert is written */
52360 int nZero; /* Number of zero-bytes to append */
@@ -52907,11 +52994,11 @@
52994 u.ab.p1 = pOp->p1 - 1;
52995 u.ab.p2 = pOp->p2;
52996 u.ab.n = pOp->p3;
52997 assert( u.ab.p1>=0 && u.ab.p1+u.ab.n<=p->nVar );
52998 assert( u.ab.p2>=1 && u.ab.p2+u.ab.n-1<=p->nMem );
52999 assert( pOp->p4.z==0 || pOp->p3==1 || pOp->p3==0 );
53000
53001 while( u.ab.n-- > 0 ){
53002 u.ab.pVar = &p->aVar[u.ab.p1++];
53003 if( sqlite3VdbeMemTooBig(u.ab.pVar) ){
53004 goto too_big;
@@ -53058,11 +53145,11 @@
53145 ** as side effect.
53146 */
53147 u.ad.pMem = p->pResultSet = &p->aMem[pOp->p1];
53148 for(u.ad.i=0; u.ad.i<pOp->p2; u.ad.i++){
53149 sqlite3VdbeMemNulTerminate(&u.ad.pMem[u.ad.i]);
53150 sqlite3VdbeMemStoreType(&u.ad.pMem[u.ad.i]);
53151 REGISTER_TRACE(pOp->p1+u.ad.i, &u.ad.pMem[u.ad.i]);
53152 }
53153 if( db->mallocFailed ) goto no_mem;
53154
53155 /* Return SQLITE_ROW
@@ -53283,11 +53370,11 @@
53370 assert( u.ag.n==0 || (pOp->p2>0 && pOp->p2+u.ag.n<=p->nMem+1) );
53371 assert( pOp->p3<pOp->p2 || pOp->p3>=pOp->p2+u.ag.n );
53372 u.ag.pArg = &p->aMem[pOp->p2];
53373 for(u.ag.i=0; u.ag.i<u.ag.n; u.ag.i++, u.ag.pArg++){
53374 u.ag.apVal[u.ag.i] = u.ag.pArg;
53375 sqlite3VdbeMemStoreType(u.ag.pArg);
53376 REGISTER_TRACE(pOp->p2, u.ag.pArg);
53377 }
53378
53379 assert( pOp->p4type==P4_FUNCDEF || pOp->p4type==P4_VDBEFUNC );
53380 if( pOp->p4type==P4_FUNCDEF ){
@@ -54779,10 +54866,11 @@
54866 }
54867 if( pOp->p1==1 ){
54868 /* Invalidate all prepared statements whenever the TEMP database
54869 ** schema is changed. Ticket #1644 */
54870 sqlite3ExpirePreparedStatements(db);
54871 p->expired = 0;
54872 }
54873 break;
54874 }
54875
54876 /* Opcode: VerifyCookie P1 P2 *
@@ -54899,10 +54987,15 @@
54987 int wrFlag;
54988 Btree *pX;
54989 VdbeCursor *pCur;
54990 Db *pDb;
54991 #endif /* local variables moved into u.aw */
54992
54993 if( p->expired ){
54994 rc = SQLITE_ABORT;
54995 break;
54996 }
54997
54998 u.aw.nField = 0;
54999 u.aw.pKeyInfo = 0;
55000 u.aw.p2 = pOp->p2;
55001 u.aw.iDb = pOp->p3;
@@ -55698,11 +55791,17 @@
55791 ** cause any problems.)
55792 **
55793 ** This instruction only works on tables. The equivalent instruction
55794 ** for indices is OP_IdxInsert.
55795 */
55796 /* Opcode: InsertInt P1 P2 P3 P4 P5
55797 **
55798 ** This works exactly like OP_Insert except that the key is the
55799 ** integer value P3, not the value of the integer stored in register P3.
55800 */
55801 case OP_Insert:
55802 case OP_InsertInt: {
55803 #if 0 /* local variables moved into u.bf */
55804 Mem *pData; /* MEM cell holding data for the record to be inserted */
55805 Mem *pKey; /* MEM cell holding key for the record */
55806 i64 iKey; /* The integer ROWID or key for the record to be inserted */
55807 VdbeCursor *pC; /* Cursor to table into which insert is written */
@@ -55712,24 +55811,30 @@
55811 const char *zTbl; /* Table name - used by the opdate hook */
55812 int op; /* Opcode for update hook: SQLITE_UPDATE or SQLITE_INSERT */
55813 #endif /* local variables moved into u.bf */
55814
55815 u.bf.pData = &p->aMem[pOp->p2];
 
55816 assert( pOp->p1>=0 && pOp->p1<p->nCursor );
55817 u.bf.pC = p->apCsr[pOp->p1];
55818 assert( u.bf.pC!=0 );
55819 assert( u.bf.pC->pCursor!=0 );
55820 assert( u.bf.pC->pseudoTableReg==0 );
 
55821 assert( u.bf.pC->isTable );
55822 REGISTER_TRACE(pOp->p2, u.bf.pData);
 
55823
55824 if( pOp->opcode==OP_Insert ){
55825 u.bf.pKey = &p->aMem[pOp->p3];
55826 assert( u.bf.pKey->flags & MEM_Int );
55827 REGISTER_TRACE(pOp->p3, u.bf.pKey);
55828 u.bf.iKey = u.bf.pKey->u.i;
55829 }else{
55830 assert( pOp->opcode==OP_InsertInt );
55831 u.bf.iKey = pOp->p3;
55832 }
55833
55834 if( pOp->p5 & OPFLAG_NCHANGE ) p->nChange++;
55835 if( pOp->p5 & OPFLAG_LASTROWID ) db->lastRowid = u.bf.iKey;
55836 if( u.bf.pData->flags & MEM_Null ){
55837 u.bf.pData->z = 0;
55838 u.bf.pData->n = 0;
55839 }else{
55840 assert( u.bf.pData->flags & (MEM_Blob|MEM_Str) );
@@ -57043,11 +57148,11 @@
57148 u.cc.pRec = &p->aMem[pOp->p2];
57149 u.cc.apVal = p->apArg;
57150 assert( u.cc.apVal || u.cc.n==0 );
57151 for(u.cc.i=0; u.cc.i<u.cc.n; u.cc.i++, u.cc.pRec++){
57152 u.cc.apVal[u.cc.i] = u.cc.pRec;
57153 sqlite3VdbeMemStoreType(u.cc.pRec);
57154 }
57155 u.cc.ctx.pFunc = pOp->p4.pFunc;
57156 assert( pOp->p3>0 && pOp->p3<=p->nMem );
57157 u.cc.ctx.pMem = u.cc.pMem = &p->aMem[pOp->p3];
57158 u.cc.pMem->n++;
@@ -57341,11 +57446,11 @@
57446 {
57447 u.ch.res = 0;
57448 u.ch.apArg = p->apArg;
57449 for(u.ch.i = 0; u.ch.i<u.ch.nArg; u.ch.i++){
57450 u.ch.apArg[u.ch.i] = &u.ch.pArgc[u.ch.i+1];
57451 sqlite3VdbeMemStoreType(u.ch.apArg[u.ch.i]);
57452 }
57453
57454 if( sqlite3SafetyOff(db) ) goto abort_due_to_misuse;
57455 p->inVtabMethod = 1;
57456 rc = u.ch.pModule->xFilter(u.ch.pVtabCursor, u.ch.iQuery, pOp->p4.z, u.ch.nArg, u.ch.apArg);
@@ -57553,11 +57658,11 @@
57658 assert( pOp->p4type==P4_VTAB );
57659 if( ALWAYS(u.cl.pModule->xUpdate) ){
57660 u.cl.apArg = p->apArg;
57661 u.cl.pX = &p->aMem[pOp->p3];
57662 for(u.cl.i=0; u.cl.i<u.cl.nArg; u.cl.i++){
57663 sqlite3VdbeMemStoreType(u.cl.pX);
57664 u.cl.apArg[u.cl.i] = u.cl.pX;
57665 u.cl.pX++;
57666 }
57667 if( sqlite3SafetyOff(db) ) goto abort_due_to_misuse;
57668 rc = u.cl.pModule->xUpdate(u.cl.pVtab, u.cl.nArg, u.cl.apArg, &u.cl.rowid);
@@ -59174,10 +59279,31 @@
59279 return WRC_Prune;
59280 } else {
59281 return WRC_Abort;
59282 }
59283 }
59284
59285 /*
59286 ** Allocate and return a pointer to an expression to load the column iCol
59287 ** from datasource iSrc datasource in SrcList pSrc.
59288 */
59289 SQLITE_PRIVATE Expr *sqlite3CreateColumnExpr(sqlite3 *db, SrcList *pSrc, int iSrc, int iCol){
59290 Expr *p = sqlite3ExprAlloc(db, TK_COLUMN, 0, 0);
59291 if( p ){
59292 struct SrcList_item *pItem = &pSrc->a[iSrc];
59293 p->pTab = pItem->pTab;
59294 p->iTable = pItem->iCursor;
59295 if( p->pTab->iPKey==iCol ){
59296 p->iColumn = -1;
59297 }else{
59298 p->iColumn = iCol;
59299 pItem->colUsed |= ((Bitmask)1)<<(iCol>=BMS ? BMS-1 : iCol);
59300 }
59301 ExprSetProperty(p, EP_Resolved);
59302 }
59303 return p;
59304 }
59305
59306 /*
59307 ** This routine is callback for sqlite3WalkExpr().
59308 **
59309 ** Resolve symbolic names into TK_COLUMN operators for the current
@@ -60522,16 +60648,16 @@
60648 assert( z!=0 );
60649 assert( z[0]!=0 );
60650 if( z[1]==0 ){
60651 /* Wildcard of the form "?". Assign the next variable number */
60652 assert( z[0]=='?' );
60653 pExpr->iColumn = ++pParse->nVar;
60654 }else if( z[0]=='?' ){
60655 /* Wildcard of the form "?nnn". Convert "nnn" to an integer and
60656 ** use it as the variable number */
60657 int i;
60658 pExpr->iColumn = i = atoi((char*)&z[1]);
60659 testcase( i==0 );
60660 testcase( i==1 );
60661 testcase( i==db->aLimit[SQLITE_LIMIT_VARIABLE_NUMBER]-1 );
60662 testcase( i==db->aLimit[SQLITE_LIMIT_VARIABLE_NUMBER] );
60663 if( i<1 || i>db->aLimit[SQLITE_LIMIT_VARIABLE_NUMBER] ){
@@ -60551,16 +60677,16 @@
60677 n = sqlite3Strlen30(z);
60678 for(i=0; i<pParse->nVarExpr; i++){
60679 Expr *pE = pParse->apVarExpr[i];
60680 assert( pE!=0 );
60681 if( memcmp(pE->u.zToken, z, n)==0 && pE->u.zToken[n]==0 ){
60682 pExpr->iColumn = pE->iColumn;
60683 break;
60684 }
60685 }
60686 if( i>=pParse->nVarExpr ){
60687 pExpr->iColumn = ++pParse->nVar;
60688 if( pParse->nVarExpr>=pParse->nVarExprAlloc-1 ){
60689 pParse->nVarExprAlloc += pParse->nVarExprAlloc + 10;
60690 pParse->apVarExpr =
60691 sqlite3DbReallocOrFree(
60692 db,
@@ -61322,10 +61448,12 @@
61448 SQLITE_PRIVATE int sqlite3FindInIndex(Parse *pParse, Expr *pX, int *prNotFound){
61449 Select *p; /* SELECT to the right of IN operator */
61450 int eType = 0; /* Type of RHS table. IN_INDEX_* */
61451 int iTab = pParse->nTab++; /* Cursor of the RHS table */
61452 int mustBeUnique = (prNotFound==0); /* True if RHS must be unique */
61453
61454 assert( pX->op==TK_IN );
61455
61456 /* Check to see if an existing table or index can be used to
61457 ** satisfy the query. This is preferable to generating a new
61458 ** ephemeral table.
61459 */
@@ -61400,11 +61528,11 @@
61528 }
61529 }
61530 }
61531
61532 if( eType==0 ){
61533 /* Could not found an existing table or index to use as the RHS b-tree.
61534 ** We will have to generate an ephemeral table to do the job.
61535 */
61536 int rMayHaveNull = 0;
61537 eType = IN_INDEX_EPH;
61538 if( prNotFound ){
@@ -61447,21 +61575,25 @@
61575 ** care of changing this register value to non-NULL if the RHS is NULL-free.
61576 **
61577 ** If rMayHaveNull is zero, that means that the subquery is being used
61578 ** for membership testing only. There is no need to initialize any
61579 ** registers to indicate the presense or absence of NULLs on the RHS.
61580 **
61581 ** For a SELECT or EXISTS operator, return the register that holds the
61582 ** result. For IN operators or if an error occurs, the return value is 0.
61583 */
61584 #ifndef SQLITE_OMIT_SUBQUERY
61585 SQLITE_PRIVATE int sqlite3CodeSubselect(
61586 Parse *pParse, /* Parsing context */
61587 Expr *pExpr, /* The IN, SELECT, or EXISTS operator */
61588 int rMayHaveNull, /* Register that records whether NULLs exist in RHS */
61589 int isRowid /* If true, LHS of IN operator is a rowid */
61590 ){
61591 int testAddr = 0; /* One-time test address */
61592 int rReg = 0; /* Register storing resulting */
61593 Vdbe *v = sqlite3GetVdbe(pParse);
61594 if( NEVER(v==0) ) return 0;
61595 sqlite3ExprCachePush(pParse);
61596
61597 /* This code must be run in its entirety every time it is encountered
61598 ** if any of the following is true:
61599 **
@@ -61522,11 +61654,11 @@
61654 assert( !isRowid );
61655 sqlite3SelectDestInit(&dest, SRT_Set, pExpr->iTable);
61656 dest.affinity = (u8)affinity;
61657 assert( (pExpr->iTable&0x0000FFFF)==pExpr->iTable );
61658 if( sqlite3Select(pParse, pExpr->x.pSelect, &dest) ){
61659 return 0;
61660 }
61661 pEList = pExpr->x.pSelect->pEList;
61662 if( ALWAYS(pEList!=0 && pEList->nExpr>0) ){
61663 keyInfo.aColl[0] = sqlite3BinaryCompareCollSeq(pParse, pExpr->pLeft,
61664 pEList->a[0].pExpr);
@@ -61553,10 +61685,11 @@
61685 r1 = sqlite3GetTempReg(pParse);
61686 r2 = sqlite3GetTempReg(pParse);
61687 sqlite3VdbeAddOp2(v, OP_Null, 0, r2);
61688 for(i=pList->nExpr, pItem=pList->a; i>0; i--, pItem++){
61689 Expr *pE2 = pItem->pExpr;
61690 int iValToIns;
61691
61692 /* If the expression is not constant then we will need to
61693 ** disable the test that was generated above that makes sure
61694 ** this code only executes once. Because for a non-constant
61695 ** expression we need to rerun this code each time.
@@ -61565,18 +61698,23 @@
61698 sqlite3VdbeChangeToNoop(v, testAddr-1, 2);
61699 testAddr = 0;
61700 }
61701
61702 /* Evaluate the expression and insert it into the temp table */
61703 if( isRowid && sqlite3ExprIsInteger(pE2, &iValToIns) ){
61704 sqlite3VdbeAddOp3(v, OP_InsertInt, pExpr->iTable, r2, iValToIns);
 
 
61705 }else{
61706 r3 = sqlite3ExprCodeTarget(pParse, pE2, r1);
61707 if( isRowid ){
61708 sqlite3VdbeAddOp2(v, OP_MustBeInt, r3,
61709 sqlite3VdbeCurrentAddr(v)+2);
61710 sqlite3VdbeAddOp3(v, OP_Insert, pExpr->iTable, r2, r3);
61711 }else{
61712 sqlite3VdbeAddOp4(v, OP_MakeRecord, r3, 1, r2, &affinity, 1);
61713 sqlite3ExprCacheAffinityChange(pParse, r3, 1);
61714 sqlite3VdbeAddOp2(v, OP_IdxInsert, pExpr->iTable, r2);
61715 }
61716 }
61717 }
61718 sqlite3ReleaseTempReg(pParse, r1);
61719 sqlite3ReleaseTempReg(pParse, r2);
61720 }
@@ -61616,13 +61754,13 @@
61754 VdbeComment((v, "Init EXISTS result"));
61755 }
61756 sqlite3ExprDelete(pParse->db, pSel->pLimit);
61757 pSel->pLimit = sqlite3PExpr(pParse, TK_INTEGER, 0, 0, &one);
61758 if( sqlite3Select(pParse, pSel, &dest) ){
61759 return 0;
61760 }
61761 rReg = dest.iParm;
61762 ExprSetIrreducible(pExpr);
61763 break;
61764 }
61765 }
61766
@@ -61629,11 +61767,11 @@
61767 if( testAddr ){
61768 sqlite3VdbeJumpHere(v, testAddr-1);
61769 }
61770 sqlite3ExprCachePop(pParse, 1);
61771
61772 return rReg;
61773 }
61774 #endif /* SQLITE_OMIT_SUBQUERY */
61775
61776 /*
61777 ** Duplicate an 8-byte value
@@ -62115,11 +62253,11 @@
62253 assert( !ExprHasProperty(pExpr, EP_IntValue) );
62254 assert( pExpr->u.zToken!=0 );
62255 assert( pExpr->u.zToken[0]!=0 );
62256 if( pExpr->u.zToken[1]==0
62257 && (pOp = sqlite3VdbeGetOp(v, -1))->opcode==OP_Variable
62258 && pOp->p1+pOp->p3==pExpr->iColumn
62259 && pOp->p2+pOp->p3==target
62260 && pOp->p4.z==0
62261 ){
62262 /* If the previous instruction was a copy of the previous unnamed
62263 ** parameter into the previous register, then simply increment the
@@ -62126,11 +62264,11 @@
62264 ** repeat count on the prior instruction rather than making a new
62265 ** instruction.
62266 */
62267 pOp->p3++;
62268 }else{
62269 sqlite3VdbeAddOp3(v, OP_Variable, pExpr->iColumn, target, 1);
62270 if( pExpr->u.zToken[1]!=0 ){
62271 sqlite3VdbeChangeP4(v, -1, pExpr->u.zToken, 0);
62272 }
62273 }
62274 break;
@@ -62386,12 +62524,11 @@
62524 #ifndef SQLITE_OMIT_SUBQUERY
62525 case TK_EXISTS:
62526 case TK_SELECT: {
62527 testcase( op==TK_EXISTS );
62528 testcase( op==TK_SELECT );
62529 inReg = sqlite3CodeSubselect(pParse, pExpr, 0, 0);
 
62530 break;
62531 }
62532 case TK_IN: {
62533 int rNotFound = 0;
62534 int rMayHaveNull = 0;
@@ -62752,10 +62889,11 @@
62889 if( ALWAYS(pExpr->op!=TK_REGISTER) ){
62890 int iMem;
62891 iMem = ++pParse->nMem;
62892 sqlite3VdbeAddOp2(v, OP_Copy, inReg, iMem);
62893 pExpr->iTable = iMem;
62894 pExpr->op2 = pExpr->op;
62895 pExpr->op = TK_REGISTER;
62896 }
62897 return inReg;
62898 }
62899
@@ -62825,10 +62963,11 @@
62963 ** expression.
62964 */
62965 static int evalConstExpr(Walker *pWalker, Expr *pExpr){
62966 Parse *pParse = pWalker->pParse;
62967 switch( pExpr->op ){
62968 case TK_IN:
62969 case TK_REGISTER: {
62970 return WRC_Prune;
62971 }
62972 case TK_FUNCTION:
62973 case TK_AGG_FUNCTION:
@@ -78185,10 +78324,11 @@
78324 static int sqlite3Prepare(
78325 sqlite3 *db, /* Database handle. */
78326 const char *zSql, /* UTF-8 encoded SQL statement. */
78327 int nBytes, /* Length of zSql in bytes. */
78328 int saveSqlFlag, /* True to copy SQL text into the sqlite3_stmt */
78329 Vdbe *pReprepare, /* VM being reprepared */
78330 sqlite3_stmt **ppStmt, /* OUT: A pointer to the prepared statement */
78331 const char **pzTail /* OUT: End of parsed string */
78332 ){
78333 Parse *pParse; /* Parsing context */
78334 char *zErrMsg = 0; /* Error message */
@@ -78199,10 +78339,11 @@
78339 pParse = sqlite3StackAllocZero(db, sizeof(*pParse));
78340 if( pParse==0 ){
78341 rc = SQLITE_NOMEM;
78342 goto end_prepare;
78343 }
78344 pParse->pReprepare = pReprepare;
78345
78346 if( sqlite3SafetyOn(db) ){
78347 rc = SQLITE_MISUSE;
78348 goto end_prepare;
78349 }
@@ -78356,10 +78497,11 @@
78497 static int sqlite3LockAndPrepare(
78498 sqlite3 *db, /* Database handle. */
78499 const char *zSql, /* UTF-8 encoded SQL statement. */
78500 int nBytes, /* Length of zSql in bytes. */
78501 int saveSqlFlag, /* True to copy SQL text into the sqlite3_stmt */
78502 Vdbe *pOld, /* VM being reprepared */
78503 sqlite3_stmt **ppStmt, /* OUT: A pointer to the prepared statement */
78504 const char **pzTail /* OUT: End of parsed string */
78505 ){
78506 int rc;
78507 assert( ppStmt!=0 );
@@ -78367,14 +78509,14 @@
78509 if( !sqlite3SafetyCheckOk(db) ){
78510 return SQLITE_MISUSE;
78511 }
78512 sqlite3_mutex_enter(db->mutex);
78513 sqlite3BtreeEnterAll(db);
78514 rc = sqlite3Prepare(db, zSql, nBytes, saveSqlFlag, pOld, ppStmt, pzTail);
78515 if( rc==SQLITE_SCHEMA ){
78516 sqlite3_finalize(*ppStmt);
78517 rc = sqlite3Prepare(db, zSql, nBytes, saveSqlFlag, pOld, ppStmt, pzTail);
78518 }
78519 sqlite3BtreeLeaveAll(db);
78520 sqlite3_mutex_leave(db->mutex);
78521 return rc;
78522 }
@@ -78396,11 +78538,11 @@
78538 assert( sqlite3_mutex_held(sqlite3VdbeDb(p)->mutex) );
78539 zSql = sqlite3_sql((sqlite3_stmt *)p);
78540 assert( zSql!=0 ); /* Reprepare only called for prepare_v2() statements */
78541 db = sqlite3VdbeDb(p);
78542 assert( sqlite3_mutex_held(db->mutex) );
78543 rc = sqlite3LockAndPrepare(db, zSql, -1, 0, p, &pNew, 0);
78544 if( rc ){
78545 if( rc==SQLITE_NOMEM ){
78546 db->mallocFailed = 1;
78547 }
78548 assert( pNew==0 );
@@ -78430,11 +78572,11 @@
78572 int nBytes, /* Length of zSql in bytes. */
78573 sqlite3_stmt **ppStmt, /* OUT: A pointer to the prepared statement */
78574 const char **pzTail /* OUT: End of parsed string */
78575 ){
78576 int rc;
78577 rc = sqlite3LockAndPrepare(db,zSql,nBytes,0,0,ppStmt,pzTail);
78578 assert( rc==SQLITE_OK || ppStmt==0 || *ppStmt==0 ); /* VERIFY: F13021 */
78579 return rc;
78580 }
78581 SQLITE_API int sqlite3_prepare_v2(
78582 sqlite3 *db, /* Database handle. */
@@ -78442,11 +78584,11 @@
78584 int nBytes, /* Length of zSql in bytes. */
78585 sqlite3_stmt **ppStmt, /* OUT: A pointer to the prepared statement */
78586 const char **pzTail /* OUT: End of parsed string */
78587 ){
78588 int rc;
78589 rc = sqlite3LockAndPrepare(db,zSql,nBytes,1,0,ppStmt,pzTail);
78590 assert( rc==SQLITE_OK || ppStmt==0 || *ppStmt==0 ); /* VERIFY: F13021 */
78591 return rc;
78592 }
78593
78594
@@ -78476,11 +78618,11 @@
78618 return SQLITE_MISUSE;
78619 }
78620 sqlite3_mutex_enter(db->mutex);
78621 zSql8 = sqlite3Utf16to8(db, zSql, nBytes);
78622 if( zSql8 ){
78623 rc = sqlite3LockAndPrepare(db, zSql8, -1, saveSqlFlag, 0, ppStmt, &zTail8);
78624 }
78625
78626 if( zTail8 && pzTail ){
78627 /* If sqlite3_prepare returns a tail pointer, we calculate the
78628 ** equivalent pointer into the UTF-16 string by counting the unicode
@@ -78724,55 +78866,49 @@
78866 }
78867 return -1;
78868 }
78869
78870 /*
78871 ** This function is used to add terms implied by JOIN syntax to the
78872 ** WHERE clause expression of a SELECT statement. The new term, which
78873 ** is ANDed with the existing WHERE clause, is of the form:
78874 **
78875 ** (tab1.col1 = tab2.col2)
78876 **
78877 ** where tab1 is the iSrc'th table in SrcList pSrc and tab2 is the
78878 ** (iSrc+1)'th. Column col1 is column iColLeft of tab1, and col2 is
78879 ** column iColRight of tab2.
78880 */
78881 static void addWhereTerm(
78882 Parse *pParse, /* Parsing context */
78883 SrcList *pSrc, /* List of tables in FROM clause */
78884 int iSrc, /* Index of first table to join in pSrc */
78885 int iColLeft, /* Index of column in first table */
78886 int iColRight, /* Index of column in second table */
78887 int isOuterJoin, /* True if this is an OUTER join */
78888 Expr **ppWhere /* IN/OUT: The WHERE clause to add to */
 
 
78889 ){
78890 sqlite3 *db = pParse->db;
78891 Expr *pE1;
78892 Expr *pE2;
78893 Expr *pEq;
78894
78895 assert( pSrc->nSrc>(iSrc+1) );
78896 assert( pSrc->a[iSrc].pTab );
78897 assert( pSrc->a[iSrc+1].pTab );
78898
78899 pE1 = sqlite3CreateColumnExpr(db, pSrc, iSrc, iColLeft);
78900 pE2 = sqlite3CreateColumnExpr(db, pSrc, iSrc+1, iColRight);
78901
78902 pEq = sqlite3PExpr(pParse, TK_EQ, pE1, pE2, 0);
78903 if( pEq && isOuterJoin ){
78904 ExprSetProperty(pEq, EP_FromJoin);
78905 assert( !ExprHasAnyProperty(pEq, EP_TokenOnly|EP_Reduced) );
78906 ExprSetIrreducible(pEq);
78907 pEq->iRightJoinTable = (i16)pE2->iTable;
78908 }
78909 *ppWhere = sqlite3ExprAnd(db, *ppWhere, pEq);
 
 
 
 
78910 }
78911
78912 /*
78913 ** Set the EP_FromJoin property on all terms of the given expression.
78914 ** And set the Expr.iRightJoinTable to iTable for every term in the
@@ -78850,15 +78986,13 @@
78986 "an ON or USING clause", 0);
78987 return 1;
78988 }
78989 for(j=0; j<pLeftTab->nCol; j++){
78990 char *zName = pLeftTab->aCol[j].zName;
78991 int iRightCol = columnIndex(pRightTab, zName);
78992 if( iRightCol>=0 ){
78993 addWhereTerm(pParse, pSrc, i, j, iRightCol, isOuter, &p->pWhere);
 
 
78994 }
78995 }
78996 }
78997
78998 /* Disallow both ON and USING clauses in the same join
@@ -78887,18 +79021,18 @@
79021 */
79022 if( pRight->pUsing ){
79023 IdList *pList = pRight->pUsing;
79024 for(j=0; j<pList->nId; j++){
79025 char *zName = pList->a[j].zName;
79026 int iLeftCol = columnIndex(pLeftTab, zName);
79027 int iRightCol = columnIndex(pRightTab, zName);
79028 if( iLeftCol<0 || iRightCol<0 ){
79029 sqlite3ErrorMsg(pParse, "cannot join using column %s - column "
79030 "not present in both tables", zName);
79031 return 1;
79032 }
79033 addWhereTerm(pParse, pSrc, i, iLeftCol, iRightCol, isOuter, &p->pWhere);
 
 
79034 }
79035 }
79036 }
79037 return 0;
79038 }
@@ -84635,22 +84769,21 @@
84769 SelectDest dest;
84770
84771 /* Construct the SELECT statement that will find the new values for
84772 ** all updated rows.
84773 */
84774 pEList = sqlite3ExprListAppend(pParse, 0, sqlite3Expr(db, TK_ID, "_rowid_"));
 
84775 if( pRowid ){
84776 pEList = sqlite3ExprListAppend(pParse, pEList,
84777 sqlite3ExprDup(db, pRowid, 0));
84778 }
84779 assert( pTab->iPKey<0 );
84780 for(i=0; i<pTab->nCol; i++){
84781 if( aXRef[i]>=0 ){
84782 pExpr = sqlite3ExprDup(db, pChanges->a[aXRef[i]].pExpr, 0);
84783 }else{
84784 pExpr = sqlite3Expr(db, TK_ID, pTab->aCol[i].zName);
84785 }
84786 pEList = sqlite3ExprListAppend(pParse, pEList, pExpr);
84787 }
84788 pSelect = sqlite3SelectNew(pParse, pEList, pSrc, pWhere, 0, 0, 0, 0, 0, 0);
84789
@@ -84816,10 +84949,16 @@
84949 rc = execSql(db, zSql);
84950 if( rc!=SQLITE_OK ) goto end_of_vacuum;
84951 pDb = &db->aDb[db->nDb-1];
84952 assert( strcmp(db->aDb[db->nDb-1].zName,"vacuum_db")==0 );
84953 pTemp = db->aDb[db->nDb-1].pBt;
84954
84955 /* The call to execSql() to attach the temp database has left the file
84956 ** locked (as there was more than one active statement when the transaction
84957 ** to read the schema was concluded. Unlock it here so that this doesn't
84958 ** cause problems for the call to BtreeSetPageSize() below. */
84959 sqlite3BtreeCommit(pTemp);
84960
84961 nRes = sqlite3BtreeGetReserve(pMain);
84962
84963 /* A VACUUM cannot change the pagesize of an encrypted database. */
84964 #ifdef SQLITE_HAS_CODEC
@@ -84870,17 +85009,17 @@
85009 "SELECT 'CREATE UNIQUE INDEX vacuum_db.' || substr(sql,21) "
85010 " FROM sqlite_master WHERE sql LIKE 'CREATE UNIQUE INDEX %'");
85011 if( rc!=SQLITE_OK ) goto end_of_vacuum;
85012
85013 /* Loop through the tables in the main database. For each, do
85014 ** an "INSERT INTO vacuum_db.xxx SELECT * FROM main.xxx;" to copy
85015 ** the contents to the temporary database.
85016 */
85017 rc = execExecSql(db,
85018 "SELECT 'INSERT INTO vacuum_db.' || quote(name) "
85019 "|| ' SELECT * FROM main.' || quote(name) || ';'"
85020 "FROM main.sqlite_master "
85021 "WHERE type = 'table' AND name!='sqlite_sequence' "
85022 " AND rootpage>0"
85023
85024 );
85025 if( rc!=SQLITE_OK ) goto end_of_vacuum;
@@ -84892,11 +85031,11 @@
85031 "FROM vacuum_db.sqlite_master WHERE name='sqlite_sequence' "
85032 );
85033 if( rc!=SQLITE_OK ) goto end_of_vacuum;
85034 rc = execExecSql(db,
85035 "SELECT 'INSERT INTO vacuum_db.' || quote(name) "
85036 "|| ' SELECT * FROM main.' || quote(name) || ';' "
85037 "FROM vacuum_db.sqlite_master WHERE name=='sqlite_sequence';"
85038 );
85039 if( rc!=SQLITE_OK ) goto end_of_vacuum;
85040
85041
@@ -84906,11 +85045,11 @@
85045 ** from the SQLITE_MASTER table.
85046 */
85047 rc = execSql(db,
85048 "INSERT INTO vacuum_db.sqlite_master "
85049 " SELECT type, name, tbl_name, rootpage, sql"
85050 " FROM main.sqlite_master"
85051 " WHERE type='view' OR type='trigger'"
85052 " OR (type='table' AND rootpage=0)"
85053 );
85054 if( rc ) goto end_of_vacuum;
85055
@@ -86580,59 +86719,103 @@
86719 ** literal that does not begin with a wildcard.
86720 */
86721 static int isLikeOrGlob(
86722 Parse *pParse, /* Parsing and code generating context */
86723 Expr *pExpr, /* Test this expression */
86724 Expr **ppPrefix, /* Pointer to TK_STRING expression with pattern prefix */
86725 int *pisComplete, /* True if the only wildcard is % in the last character */
86726 int *pnoCase /* True if uppercase is equivalent to lowercase */
86727 ){
86728 const char *z = 0; /* String on RHS of LIKE operator */
86729 Expr *pRight, *pLeft; /* Right and left size of LIKE operator */
86730 ExprList *pList; /* List of operands to the LIKE operator */
86731 int c; /* One character in z[] */
86732 int cnt; /* Number of non-wildcard prefix characters */
86733 char wc[3]; /* Wildcard characters */
86734 CollSeq *pColl; /* Collating sequence for LHS */
86735 sqlite3 *db = pParse->db; /* Database connection */
86736 sqlite3_value *pVal = 0;
86737 int op; /* Opcode of pRight */
86738
86739 if( !sqlite3IsLikeFunction(db, pExpr, pnoCase, wc) ){
86740 return 0;
86741 }
86742 #ifdef SQLITE_EBCDIC
86743 if( *pnoCase ) return 0;
86744 #endif
86745 pList = pExpr->x.pList;
 
 
 
 
86746 pLeft = pList->a[1].pExpr;
86747 if( pLeft->op!=TK_COLUMN || sqlite3ExprAffinity(pLeft)!=SQLITE_AFF_TEXT ){
86748 /* IMP: R-02065-49465 The left-hand side of the LIKE or GLOB operator must
86749 ** be the name of an indexed column with TEXT affinity. */
86750 return 0;
86751 }
86752 assert( pLeft->iColumn!=(-1) ); /* Because IPK never has AFF_TEXT */
86753 pColl = sqlite3ExprCollSeq(pParse, pLeft);
86754 assert( pColl!=0 ); /* Every non-IPK column has a collating sequence */
 
86755 if( (pColl->type!=SQLITE_COLL_BINARY || *pnoCase) &&
86756 (pColl->type!=SQLITE_COLL_NOCASE || !*pnoCase) ){
86757 /* IMP: R-09003-32046 For the GLOB operator, the column must use the
86758 ** default BINARY collating sequence.
86759 ** IMP: R-41408-28306 For the LIKE operator, if case_sensitive_like mode
86760 ** is enabled then the column must use the default BINARY collating
86761 ** sequence, or if case_sensitive_like mode is disabled then the column
86762 ** must use the built-in NOCASE collating sequence.
86763 */
86764 return 0;
86765 }
86766
86767 pRight = pList->a[0].pExpr;
86768 op = pRight->op;
86769 if( op==TK_REGISTER ){
86770 op = pRight->op2;
86771 }
86772 if( op==TK_VARIABLE ){
86773 Vdbe *pReprepare = pParse->pReprepare;
86774 pVal = sqlite3VdbeGetValue(pReprepare, pRight->iColumn, SQLITE_AFF_NONE);
86775 if( pVal && sqlite3_value_type(pVal)==SQLITE_TEXT ){
86776 z = (char *)sqlite3_value_text(pVal);
86777 }
86778 sqlite3VdbeSetVarmask(pParse->pVdbe, pRight->iColumn);
86779 assert( pRight->op==TK_VARIABLE || pRight->op==TK_REGISTER );
86780 }else if( op==TK_STRING ){
86781 z = pRight->u.zToken;
86782 }
86783 if( z ){
86784 cnt = 0;
86785 while( (c=z[cnt])!=0 && c!=wc[0] && c!=wc[1] && c!=wc[2] ){
86786 cnt++;
86787 }
86788 if( cnt!=0 && c!=0 && 255!=(u8)z[cnt-1] ){
86789 Expr *pPrefix;
86790 *pisComplete = z[cnt]==wc[0] && z[cnt+1]==0;
86791 pPrefix = sqlite3Expr(db, TK_STRING, z);
86792 if( pPrefix ) pPrefix->u.zToken[cnt] = 0;
86793 *ppPrefix = pPrefix;
86794 if( op==TK_VARIABLE ){
86795 Vdbe *v = pParse->pVdbe;
86796 sqlite3VdbeSetVarmask(v, pRight->iColumn);
86797 if( *pisComplete && pRight->u.zToken[1] ){
86798 /* If the rhs of the LIKE expression is a variable, and the current
86799 ** value of the variable means there is no need to invoke the LIKE
86800 ** function, then no OP_Variable will be added to the program.
86801 ** This causes problems for the sqlite3_bind_parameter_name()
86802 ** API. To workaround them, add a dummy OP_Variable here.
86803 */
86804 int r1 = sqlite3GetTempReg(pParse);
86805 sqlite3ExprCodeTarget(pParse, pRight, r1);
86806 sqlite3VdbeChangeP3(v, sqlite3VdbeCurrentAddr(v)-1, 0);
86807 sqlite3ReleaseTempReg(pParse, r1);
86808 }
86809 }
86810 }else{
86811 z = 0;
86812 }
86813 }
86814
86815 sqlite3ValueFree(pVal);
86816 return (z!=0);
86817 }
86818 #endif /* SQLITE_OMIT_LIKE_OPTIMIZATION */
86819
86820
86821 #ifndef SQLITE_OMIT_VIRTUALTABLE
@@ -87009,14 +87192,14 @@
87192 WhereTerm *pTerm; /* The term to be analyzed */
87193 WhereMaskSet *pMaskSet; /* Set of table index masks */
87194 Expr *pExpr; /* The expression to be analyzed */
87195 Bitmask prereqLeft; /* Prerequesites of the pExpr->pLeft */
87196 Bitmask prereqAll; /* Prerequesites of pExpr */
87197 Bitmask extraRight = 0; /* */
87198 Expr *pStr1 = 0; /* RHS of LIKE/GLOB operator */
87199 int isComplete = 0; /* RHS of LIKE/GLOB ends with wildcard */
87200 int noCase = 0; /* LIKE/GLOB distinguishes case */
87201 int op; /* Top-level operator. pExpr->op */
87202 Parse *pParse = pWC->pParse; /* Parsing context */
87203 sqlite3 *db = pParse->db; /* Database connection */
87204
87205 if( db->mallocFailed ){
@@ -87147,25 +87330,25 @@
87330 ** x>='abc' AND x<'abd' AND x LIKE 'abc%'
87331 **
87332 ** The last character of the prefix "abc" is incremented to form the
87333 ** termination condition "abd".
87334 */
87335 if( pWC->op==TK_AND
87336 && isLikeOrGlob(pParse, pExpr, &pStr1, &isComplete, &noCase)
87337 ){
87338 Expr *pLeft; /* LHS of LIKE/GLOB operator */
87339 Expr *pStr2; /* Copy of pStr1 - RHS of LIKE/GLOB operator */
87340 Expr *pNewExpr1;
87341 Expr *pNewExpr2;
87342 int idxNew1;
87343 int idxNew2;
87344
87345 pLeft = pExpr->x.pList->a[1].pExpr;
 
 
 
87346 pStr2 = sqlite3ExprDup(db, pStr1, 0);
87347 if( !db->mallocFailed ){
87348 u8 c, *pC; /* Last character before the first wildcard */
87349 pC = (u8*)&pStr2->u.zToken[sqlite3Strlen30(pStr2->u.zToken)-1];
87350 c = *pC;
87351 if( noCase ){
87352 /* The point is to increment the last character before the first
87353 ** wildcard. But if we increment '@', that will push it into the
87354 ** alphabetic range where case conversions will mess up the
@@ -87939,10 +88122,46 @@
88122 }
88123 return SQLITE_OK;
88124 }
88125 #endif /* #ifdef SQLITE_ENABLE_STAT2 */
88126
88127 /*
88128 ** If expression pExpr represents a literal value, set *pp to point to
88129 ** an sqlite3_value structure containing the same value, with affinity
88130 ** aff applied to it, before returning. It is the responsibility of the
88131 ** caller to eventually release this structure by passing it to
88132 ** sqlite3ValueFree().
88133 **
88134 ** If the current parse is a recompile (sqlite3Reprepare()) and pExpr
88135 ** is an SQL variable that currently has a non-NULL value bound to it,
88136 ** create an sqlite3_value structure containing this value, again with
88137 ** affinity aff applied to it, instead.
88138 **
88139 ** If neither of the above apply, set *pp to NULL.
88140 **
88141 ** If an error occurs, return an error code. Otherwise, SQLITE_OK.
88142 */
88143 #ifdef SQLITE_ENABLE_STAT2
88144 static int valueFromExpr(
88145 Parse *pParse,
88146 Expr *pExpr,
88147 u8 aff,
88148 sqlite3_value **pp
88149 ){
88150 /* The evalConstExpr() function will have already converted any TK_VARIABLE
88151 ** expression involved in an comparison into a TK_REGISTER. */
88152 assert( pExpr->op!=TK_VARIABLE );
88153 if( pExpr->op==TK_REGISTER && pExpr->op2==TK_VARIABLE ){
88154 int iVar = pExpr->iColumn;
88155 sqlite3VdbeSetVarmask(pParse->pVdbe, iVar);
88156 *pp = sqlite3VdbeGetValue(pParse->pReprepare, iVar, aff);
88157 return SQLITE_OK;
88158 }
88159 return sqlite3ValueFromExpr(pParse->db, pExpr, SQLITE_UTF8, aff, pp);
88160 }
88161 #endif
88162
88163 /*
88164 ** This function is used to estimate the number of rows that will be visited
88165 ** by scanning an index for a range of values. The range may have an upper
88166 ** bound, a lower bound, or both. The WHERE clause terms that set the upper
88167 ** and lower bounds are represented by pLower and pUpper respectively. For
@@ -87991,27 +88210,26 @@
88210 int *piEst /* OUT: Return value */
88211 ){
88212 int rc = SQLITE_OK;
88213
88214 #ifdef SQLITE_ENABLE_STAT2
 
 
 
88215
88216 if( nEq==0 && p->aSample ){
88217 sqlite3_value *pLowerVal = 0;
88218 sqlite3_value *pUpperVal = 0;
88219 int iEst;
88220 int iLower = 0;
88221 int iUpper = SQLITE_INDEX_SAMPLES;
88222 u8 aff = p->pTable->aCol[p->aiColumn[0]].affinity;
88223
88224 if( pLower ){
88225 Expr *pExpr = pLower->pExpr->pRight;
88226 rc = valueFromExpr(pParse, pExpr, aff, &pLowerVal);
88227 }
88228 if( rc==SQLITE_OK && pUpper ){
88229 Expr *pExpr = pUpper->pExpr->pRight;
88230 rc = valueFromExpr(pParse, pExpr, aff, &pUpperVal);
88231 }
88232
88233 if( rc!=SQLITE_OK || (pLowerVal==0 && pUpperVal==0) ){
88234 sqlite3ValueFree(pLowerVal);
88235 sqlite3ValueFree(pUpperVal);
@@ -90177,469 +90395,469 @@
90395 ** yy_reduce_ofst[] For each state, the offset into yy_action for
90396 ** shifting non-terminals after a reduce.
90397 ** yy_default[] Default action for each state.
90398 */
90399 static const YYACTIONTYPE yy_action[] = {
90400 /* 0 */ 312, 53, 494, 56, 143, 177, 181, 561, 44, 44,
90401 /* 10 */ 44, 44, 224, 46, 46, 46, 46, 47, 47, 48,
90402 /* 20 */ 48, 48, 49, 226, 511, 345, 209, 513, 501, 226,
90403 /* 30 */ 550, 541, 54, 46, 46, 46, 46, 47, 47, 48,
90404 /* 40 */ 48, 48, 49, 226, 48, 48, 48, 49, 226, 43,
90405 /* 50 */ 41, 55, 539, 537, 540, 540, 45, 45, 44, 44,
90406 /* 60 */ 44, 44, 252, 46, 46, 46, 46, 47, 47, 48,
90407 /* 70 */ 48, 48, 49, 226, 312, 561, 321, 493, 429, 246,
90408 /* 80 */ 60, 46, 46, 46, 46, 47, 47, 48, 48, 48,
90409 /* 90 */ 49, 226, 613, 321, 493, 480, 477, 155, 426, 326,
90410 /* 100 */ 369, 372, 373, 581, 550, 541, 311, 555, 155, 40,
90411 /* 110 */ 374, 369, 372, 373, 47, 47, 48, 48, 48, 49,
90412 /* 120 */ 226, 374, 536, 43, 41, 55, 539, 537, 540, 540,
90413 /* 130 */ 45, 45, 44, 44, 44, 44, 301, 46, 46, 46,
90414 /* 140 */ 46, 47, 47, 48, 48, 48, 49, 226, 312, 222,
90415 /* 150 */ 210, 445, 431, 156, 139, 250, 366, 267, 367, 154,
90416 /* 160 */ 509, 350, 513, 501, 561, 248, 222, 484, 513, 501,
90417 /* 170 */ 340, 139, 250, 366, 267, 367, 154, 316, 550, 541,
90418 /* 180 */ 609, 281, 248, 197, 565, 337, 309, 471, 428, 511,
90419 /* 190 */ 582, 209, 556, 599, 566, 81, 493, 43, 41, 55,
90420 /* 200 */ 539, 537, 540, 540, 45, 45, 44, 44, 44, 44,
90421 /* 210 */ 471, 46, 46, 46, 46, 47, 47, 48, 48, 48,
90422 /* 220 */ 49, 226, 312, 553, 553, 553, 287, 133, 517, 231,
90423 /* 230 */ 480, 477, 561, 580, 355, 235, 480, 477, 483, 573,
90424 /* 240 */ 340, 513, 501, 183, 591, 66, 571, 572, 493, 238,
90425 /* 250 */ 205, 387, 550, 541, 155, 337, 390, 369, 372, 373,
90426 /* 260 */ 959, 186, 490, 2, 566, 94, 466, 374, 195, 614,
90427 /* 270 */ 198, 43, 41, 55, 539, 537, 540, 540, 45, 45,
90428 /* 280 */ 44, 44, 44, 44, 565, 46, 46, 46, 46, 47,
90429 /* 290 */ 47, 48, 48, 48, 49, 226, 312, 340, 570, 53,
90430 /* 300 */ 618, 56, 143, 449, 565, 340, 353, 201, 141, 480,
90431 /* 310 */ 477, 352, 337, 493, 400, 273, 200, 146, 569, 568,
90432 /* 320 */ 337, 566, 71, 570, 224, 292, 550, 541, 361, 566,
90433 /* 330 */ 94, 342, 483, 534, 534, 68, 360, 280, 493, 513,
90434 /* 340 */ 501, 565, 381, 569, 410, 43, 41, 55, 539, 537,
90435 /* 350 */ 540, 540, 45, 45, 44, 44, 44, 44, 462, 46,
90436 /* 360 */ 46, 46, 46, 47, 47, 48, 48, 48, 49, 226,
90437 /* 370 */ 312, 353, 468, 493, 246, 208, 363, 1, 340, 567,
90438 /* 380 */ 230, 513, 501, 149, 333, 546, 4, 612, 617, 493,
90439 /* 390 */ 240, 340, 112, 337, 611, 513, 501, 224, 212, 580,
90440 /* 400 */ 550, 541, 566, 95, 409, 230, 337, 480, 477, 399,
90441 /* 410 */ 482, 66, 471, 516, 493, 566, 94, 412, 466, 43,
90442 /* 420 */ 41, 55, 539, 537, 540, 540, 45, 45, 44, 44,
90443 /* 430 */ 44, 44, 565, 46, 46, 46, 46, 47, 47, 48,
90444 /* 440 */ 48, 48, 49, 226, 312, 502, 585, 580, 329, 480,
90445 /* 450 */ 477, 451, 513, 501, 592, 247, 332, 357, 615, 66,
90446 /* 460 */ 150, 500, 493, 480, 477, 151, 400, 273, 53, 414,
90447 /* 470 */ 56, 143, 215, 146, 550, 541, 224, 499, 617, 421,
90448 /* 480 */ 317, 528, 524, 42, 282, 415, 594, 34, 476, 280,
90449 /* 490 */ 420, 397, 203, 43, 41, 55, 539, 537, 540, 540,
90450 /* 500 */ 45, 45, 44, 44, 44, 44, 493, 46, 46, 46,
90451 /* 510 */ 46, 47, 47, 48, 48, 48, 49, 226, 312, 324,
90452 /* 520 */ 480, 477, 435, 447, 439, 384, 565, 340, 284, 340,
90453 /* 530 */ 241, 344, 528, 524, 53, 340, 56, 143, 620, 185,
90454 /* 540 */ 461, 483, 337, 230, 337, 478, 217, 439, 550, 541,
90455 /* 550 */ 337, 566, 95, 566, 89, 493, 596, 425, 227, 566,
90456 /* 560 */ 81, 52, 459, 448, 440, 402, 584, 43, 41, 55,
90457 /* 570 */ 539, 537, 540, 540, 45, 45, 44, 44, 44, 44,
90458 /* 580 */ 565, 46, 46, 46, 46, 47, 47, 48, 48, 48,
90459 /* 590 */ 49, 226, 312, 362, 230, 340, 259, 323, 491, 377,
90460 /* 600 */ 234, 257, 458, 385, 398, 278, 283, 488, 337, 340,
90461 /* 610 */ 337, 141, 340, 461, 340, 597, 493, 566, 9, 566,
90462 /* 620 */ 96, 62, 550, 541, 337, 593, 401, 337, 493, 337,
90463 /* 630 */ 151, 328, 157, 566, 85, 483, 566, 77, 566, 86,
90464 /* 640 */ 874, 43, 41, 55, 539, 537, 540, 540, 45, 45,
90465 /* 650 */ 44, 44, 44, 44, 340, 46, 46, 46, 46, 47,
90466 /* 660 */ 47, 48, 48, 48, 49, 226, 312, 340, 444, 337,
90467 /* 670 */ 364, 30, 443, 457, 502, 150, 327, 65, 566, 99,
90468 /* 680 */ 340, 561, 337, 408, 324, 340, 386, 340, 248, 589,
90469 /* 690 */ 500, 566, 137, 256, 574, 337, 550, 541, 579, 246,
90470 /* 700 */ 337, 224, 337, 258, 566, 136, 499, 371, 349, 566,
90471 /* 710 */ 138, 566, 101, 407, 493, 43, 41, 55, 539, 537,
90472 /* 720 */ 540, 540, 45, 45, 44, 44, 44, 44, 340, 46,
90473 /* 730 */ 46, 46, 46, 47, 47, 48, 48, 48, 49, 226,
90474 /* 740 */ 312, 340, 229, 337, 340, 342, 252, 534, 534, 561,
90475 /* 750 */ 522, 522, 566, 91, 574, 177, 337, 561, 579, 337,
90476 /* 760 */ 340, 493, 58, 340, 38, 566, 88, 441, 566, 17,
90477 /* 770 */ 550, 541, 508, 29, 306, 337, 452, 948, 337, 948,
90478 /* 780 */ 629, 575, 416, 318, 566, 92, 192, 566, 73, 43,
90479 /* 790 */ 41, 55, 539, 537, 540, 540, 45, 45, 44, 44,
90480 /* 800 */ 44, 44, 340, 46, 46, 46, 46, 47, 47, 48,
90481 /* 810 */ 48, 48, 49, 226, 312, 340, 246, 337, 340, 246,
90482 /* 820 */ 270, 526, 340, 469, 299, 561, 566, 70, 202, 204,
90483 /* 830 */ 337, 493, 507, 337, 493, 493, 340, 337, 493, 566,
90484 /* 840 */ 90, 532, 566, 82, 550, 541, 566, 72, 557, 452,
90485 /* 850 */ 949, 337, 949, 266, 598, 342, 150, 534, 534, 228,
90486 /* 860 */ 566, 79, 533, 43, 41, 55, 539, 537, 540, 540,
90487 /* 870 */ 45, 45, 44, 44, 44, 44, 340, 46, 46, 46,
90488 /* 880 */ 46, 47, 47, 48, 48, 48, 49, 226, 312, 340,
90489 /* 890 */ 246, 337, 340, 252, 526, 49, 226, 254, 549, 260,
90490 /* 900 */ 566, 83, 588, 586, 337, 493, 606, 337, 493, 485,
90491 /* 910 */ 340, 592, 392, 566, 69, 406, 566, 80, 550, 541,
90492 /* 920 */ 342, 368, 534, 534, 253, 337, 150, 493, 604, 342,
90493 /* 930 */ 223, 534, 534, 525, 566, 100, 285, 43, 57, 55,
90494 /* 940 */ 539, 537, 540, 540, 45, 45, 44, 44, 44, 44,
90495 /* 950 */ 340, 46, 46, 46, 46, 47, 47, 48, 48, 48,
90496 /* 960 */ 49, 226, 312, 392, 246, 337, 340, 252, 575, 416,
90497 /* 970 */ 351, 472, 276, 347, 566, 87, 279, 330, 493, 493,
90498 /* 980 */ 496, 337, 493, 461, 340, 493, 493, 493, 548, 547,
90499 /* 990 */ 566, 98, 550, 541, 498, 493, 172, 523, 493, 337,
90500 /* 1000 */ 311, 577, 191, 243, 319, 423, 422, 530, 566, 105,
90501 /* 1010 */ 544, 543, 41, 55, 539, 537, 540, 540, 45, 45,
90502 /* 1020 */ 44, 44, 44, 44, 340, 46, 46, 46, 46, 47,
90503 /* 1030 */ 47, 48, 48, 48, 49, 226, 312, 545, 340, 337,
90504 /* 1040 */ 340, 246, 392, 207, 252, 445, 320, 489, 566, 103,
90505 /* 1050 */ 627, 622, 519, 337, 232, 337, 493, 493, 340, 493,
90506 /* 1060 */ 479, 340, 566, 108, 566, 109, 550, 541, 6, 607,
90507 /* 1070 */ 608, 454, 2, 337, 492, 493, 337, 565, 517, 231,
90508 /* 1080 */ 471, 322, 566, 134, 289, 566, 135, 55, 539, 537,
90509 /* 1090 */ 540, 540, 45, 45, 44, 44, 44, 44, 487, 46,
90510 /* 1100 */ 46, 46, 46, 47, 47, 48, 48, 48, 49, 226,
90511 /* 1110 */ 23, 346, 340, 3, 397, 464, 422, 336, 501, 290,
90512 /* 1120 */ 147, 214, 7, 23, 346, 340, 3, 337, 343, 493,
90513 /* 1130 */ 336, 501, 463, 237, 172, 493, 566, 84, 475, 340,
90514 /* 1140 */ 337, 343, 211, 340, 246, 225, 244, 348, 394, 566,
90515 /* 1150 */ 75, 341, 18, 493, 337, 565, 393, 509, 337, 493,
90516 /* 1160 */ 348, 493, 395, 566, 97, 245, 493, 566, 61, 274,
90517 /* 1170 */ 509, 217, 16, 358, 189, 264, 565, 26, 25, 340,
90518 /* 1180 */ 493, 236, 518, 310, 24, 338, 339, 304, 493, 556,
90519 /* 1190 */ 26, 25, 450, 602, 337, 404, 120, 24, 338, 339,
90520 /* 1200 */ 419, 169, 556, 566, 106, 565, 224, 117, 495, 27,
90521 /* 1210 */ 346, 562, 3, 396, 187, 340, 336, 501, 179, 184,
90522 /* 1220 */ 553, 553, 553, 552, 551, 11, 493, 343, 493, 398,
90523 /* 1230 */ 337, 430, 8, 553, 553, 553, 552, 551, 11, 566,
90524 /* 1240 */ 104, 335, 340, 255, 340, 616, 348, 340, 251, 331,
90525 /* 1250 */ 340, 391, 558, 587, 50, 340, 509, 337, 493, 337,
90526 /* 1260 */ 493, 365, 337, 493, 590, 337, 566, 78, 566, 102,
90527 /* 1270 */ 337, 566, 76, 213, 566, 74, 26, 25, 610, 566,
90528 /* 1280 */ 93, 378, 424, 24, 338, 339, 263, 583, 556, 220,
90529 /* 1290 */ 140, 624, 294, 493, 300, 389, 23, 346, 376, 3,
90530 /* 1300 */ 150, 493, 493, 336, 501, 493, 493, 493, 221, 493,
90531 /* 1310 */ 493, 554, 268, 219, 343, 261, 515, 460, 418, 553,
90532 /* 1320 */ 553, 553, 552, 551, 11, 595, 493, 493, 152, 206,
90533 /* 1330 */ 493, 493, 493, 348, 272, 271, 269, 158, 302, 625,
90534 /* 1340 */ 531, 521, 67, 509, 506, 520, 50, 628, 380, 600,
90535 /* 1350 */ 173, 605, 123, 623, 493, 178, 37, 305, 308, 265,
90536 /* 1360 */ 493, 620, 621, 26, 25, 165, 262, 307, 619, 166,
90537 /* 1370 */ 24, 338, 339, 334, 436, 556, 427, 437, 33, 160,
90538 /* 1380 */ 145, 466, 513, 501, 20, 148, 275, 122, 174, 359,
90539 /* 1390 */ 442, 467, 486, 63, 36, 233, 42, 465, 512, 403,
90540 /* 1400 */ 542, 182, 119, 113, 128, 132, 553, 553, 553, 552,
90541 /* 1410 */ 551, 11, 39, 288, 538, 455, 291, 563, 388, 354,
90542 /* 1420 */ 293, 295, 509, 31, 453, 356, 296, 325, 159, 405,
90543 /* 1430 */ 286, 297, 564, 153, 313, 382, 35, 129, 303, 224,
90544 /* 1440 */ 218, 121, 194, 196, 433, 107, 559, 242, 601, 216,
90545 /* 1450 */ 428, 670, 280, 671, 556, 672, 162, 163, 32, 535,
90546 /* 1460 */ 59, 505, 529, 411, 510, 190, 199, 176, 167, 504,
90547 /* 1470 */ 503, 497, 5, 315, 314, 13, 19, 12, 474, 131,
90548 /* 1480 */ 456, 144, 434, 432, 168, 553, 553, 553, 239, 51,
90549 /* 1490 */ 603, 118, 111, 142, 249, 21, 124, 164, 379, 258,
90550 /* 1500 */ 626, 188, 126, 172, 298, 383, 161, 370, 375, 114,
90551 /* 1510 */ 15, 470, 481, 180, 125, 115, 127, 438, 446, 10,
90552 /* 1520 */ 514, 110, 171, 527, 170, 116, 130, 560, 64, 14,
90553 /* 1530 */ 175, 576, 578, 413, 277, 193, 417, 960, 473, 960,
90554 /* 1540 */ 28, 960, 22,
90555 };
90556 static const YYCODETYPE yy_lookahead[] = {
90557 /* 0 */ 19, 222, 223, 224, 225, 24, 35, 26, 77, 78,
90558 /* 10 */ 79, 80, 115, 82, 83, 84, 85, 86, 87, 88,
90559 /* 20 */ 89, 90, 91, 92, 166, 167, 168, 26, 27, 92,
90560 /* 30 */ 49, 50, 81, 82, 83, 84, 85, 86, 87, 88,
90561 /* 40 */ 89, 90, 91, 92, 88, 89, 90, 91, 92, 68,
90562 /* 50 */ 69, 70, 71, 72, 73, 74, 75, 76, 77, 78,
90563 /* 60 */ 79, 80, 150, 82, 83, 84, 85, 86, 87, 88,
90564 /* 70 */ 89, 90, 91, 92, 19, 94, 19, 165, 174, 150,
90565 /* 80 */ 25, 82, 83, 84, 85, 86, 87, 88, 89, 90,
90566 /* 90 */ 91, 92, 186, 19, 165, 94, 95, 96, 174, 187,
90567 /* 100 */ 99, 100, 101, 186, 49, 50, 22, 23, 96, 54,
90568 /* 110 */ 109, 99, 100, 101, 86, 87, 88, 89, 90, 91,
90569 /* 120 */ 92, 109, 193, 68, 69, 70, 71, 72, 73, 74,
90570 /* 130 */ 75, 76, 77, 78, 79, 80, 195, 82, 83, 84,
90571 /* 140 */ 85, 86, 87, 88, 89, 90, 91, 92, 19, 92,
90572 /* 150 */ 160, 67, 23, 96, 97, 98, 99, 100, 101, 102,
90573 /* 160 */ 66, 191, 26, 27, 26, 108, 92, 208, 26, 27,
90574 /* 170 */ 150, 97, 98, 99, 100, 101, 102, 155, 49, 50,
90575 /* 180 */ 183, 150, 108, 25, 194, 165, 163, 166, 94, 166,
90576 /* 190 */ 167, 168, 98, 183, 174, 175, 165, 68, 69, 70,
90577 /* 200 */ 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
90578 /* 210 */ 166, 82, 83, 84, 85, 86, 87, 88, 89, 90,
90579 /* 220 */ 91, 92, 19, 129, 130, 131, 205, 24, 86, 87,
90580 /* 230 */ 94, 95, 94, 150, 214, 215, 94, 95, 25, 97,
90581 /* 240 */ 150, 26, 27, 23, 161, 162, 104, 105, 165, 205,
90582 /* 250 */ 160, 229, 49, 50, 96, 165, 234, 99, 100, 101,
90583 /* 260 */ 142, 143, 144, 145, 174, 175, 57, 109, 185, 186,
90584 /* 270 */ 160, 68, 69, 70, 71, 72, 73, 74, 75, 76,
90585 /* 280 */ 77, 78, 79, 80, 194, 82, 83, 84, 85, 86,
90586 /* 290 */ 87, 88, 89, 90, 91, 92, 19, 150, 150, 222,
90587 /* 300 */ 23, 224, 225, 88, 194, 150, 216, 160, 95, 94,
90588 /* 310 */ 95, 221, 165, 165, 105, 106, 206, 207, 170, 171,
90589 /* 320 */ 165, 174, 175, 150, 115, 148, 49, 50, 19, 174,
90590 /* 330 */ 175, 111, 119, 113, 114, 22, 27, 128, 165, 26,
90591 /* 340 */ 27, 194, 237, 170, 171, 68, 69, 70, 71, 72,
90592 /* 350 */ 73, 74, 75, 76, 77, 78, 79, 80, 150, 82,
90593 /* 360 */ 83, 84, 85, 86, 87, 88, 89, 90, 91, 92,
90594 /* 370 */ 19, 216, 11, 165, 150, 236, 221, 22, 150, 231,
90595 /* 380 */ 232, 26, 27, 25, 146, 147, 196, 181, 182, 165,
90596 /* 390 */ 152, 150, 154, 165, 188, 26, 27, 115, 160, 150,
90597 /* 400 */ 49, 50, 174, 175, 231, 232, 165, 94, 95, 127,
90598 /* 410 */ 161, 162, 166, 166, 165, 174, 175, 193, 57, 68,
90599 /* 420 */ 69, 70, 71, 72, 73, 74, 75, 76, 77, 78,
90600 /* 430 */ 79, 80, 194, 82, 83, 84, 85, 86, 87, 88,
90601 /* 440 */ 89, 90, 91, 92, 19, 12, 173, 150, 220, 94,
90602 /* 450 */ 95, 205, 26, 27, 181, 158, 218, 216, 161, 162,
90603 /* 460 */ 25, 28, 165, 94, 95, 50, 105, 106, 222, 245,
90604 /* 470 */ 224, 225, 206, 207, 49, 50, 115, 44, 182, 46,
90605 /* 480 */ 169, 170, 171, 125, 16, 247, 166, 136, 119, 128,
90606 /* 490 */ 57, 150, 160, 68, 69, 70, 71, 72, 73, 74,
90607 /* 500 */ 75, 76, 77, 78, 79, 80, 165, 82, 83, 84,
90608 /* 510 */ 85, 86, 87, 88, 89, 90, 91, 92, 19, 104,
90609 /* 520 */ 94, 95, 23, 21, 105, 106, 194, 150, 60, 150,
90610 /* 530 */ 62, 169, 170, 171, 222, 150, 224, 225, 103, 23,
90611 /* 540 */ 150, 25, 165, 232, 165, 119, 160, 128, 49, 50,
90612 /* 550 */ 165, 174, 175, 174, 175, 165, 244, 165, 217, 174,
90613 /* 560 */ 175, 136, 7, 8, 9, 63, 174, 68, 69, 70,
90614 /* 570 */ 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
90615 /* 580 */ 194, 82, 83, 84, 85, 86, 87, 88, 89, 90,
90616 /* 590 */ 91, 92, 19, 150, 232, 150, 23, 220, 32, 19,
90617 /* 600 */ 215, 150, 100, 213, 218, 226, 138, 41, 165, 150,
90618 /* 610 */ 165, 95, 150, 150, 150, 177, 165, 174, 175, 174,
90619 /* 620 */ 175, 235, 49, 50, 165, 177, 240, 165, 165, 165,
90620 /* 630 */ 50, 248, 249, 174, 175, 119, 174, 175, 174, 175,
90621 /* 640 */ 138, 68, 69, 70, 71, 72, 73, 74, 75, 76,
90622 /* 650 */ 77, 78, 79, 80, 150, 82, 83, 84, 85, 86,
90623 /* 660 */ 87, 88, 89, 90, 91, 92, 19, 150, 30, 165,
90624 /* 670 */ 88, 24, 34, 23, 12, 25, 213, 22, 174, 175,
90625 /* 680 */ 150, 26, 165, 97, 104, 150, 48, 150, 108, 166,
90626 /* 690 */ 28, 174, 175, 98, 112, 165, 49, 50, 116, 150,
90627 /* 700 */ 165, 115, 165, 108, 174, 175, 44, 178, 46, 174,
90628 /* 710 */ 175, 174, 175, 127, 165, 68, 69, 70, 71, 72,
90629 /* 720 */ 73, 74, 75, 76, 77, 78, 79, 80, 150, 82,
90630 /* 730 */ 83, 84, 85, 86, 87, 88, 89, 90, 91, 92,
90631 /* 740 */ 19, 150, 193, 165, 150, 111, 150, 113, 114, 94,
90632 /* 750 */ 129, 130, 174, 175, 112, 24, 165, 26, 116, 165,
90633 /* 760 */ 150, 165, 135, 150, 137, 174, 175, 23, 174, 175,
90634 /* 770 */ 49, 50, 23, 52, 25, 165, 22, 23, 165, 25,
90635 /* 780 */ 0, 1, 2, 187, 174, 175, 196, 174, 175, 68,
90636 /* 790 */ 69, 70, 71, 72, 73, 74, 75, 76, 77, 78,
90637 /* 800 */ 79, 80, 150, 82, 83, 84, 85, 86, 87, 88,
90638 /* 810 */ 89, 90, 91, 92, 19, 150, 150, 165, 150, 150,
90639 /* 820 */ 150, 67, 150, 150, 198, 94, 174, 175, 105, 106,
90640 /* 830 */ 165, 165, 23, 165, 165, 165, 150, 165, 165, 174,
90641 /* 840 */ 175, 23, 174, 175, 49, 50, 174, 175, 166, 22,
90642 /* 850 */ 23, 165, 25, 16, 23, 111, 25, 113, 114, 193,
90643 /* 860 */ 174, 175, 193, 68, 69, 70, 71, 72, 73, 74,
90644 /* 870 */ 75, 76, 77, 78, 79, 80, 150, 82, 83, 84,
90645 /* 880 */ 85, 86, 87, 88, 89, 90, 91, 92, 19, 150,
90646 /* 890 */ 150, 165, 150, 150, 67, 91, 92, 60, 199, 62,
90647 /* 900 */ 174, 175, 172, 173, 165, 165, 36, 165, 165, 25,
90648 /* 910 */ 150, 181, 150, 174, 175, 209, 174, 175, 49, 50,
90649 /* 920 */ 111, 51, 113, 114, 23, 165, 25, 165, 58, 111,
90650 /* 930 */ 187, 113, 114, 193, 174, 175, 209, 68, 69, 70,
90651 /* 940 */ 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
90652 /* 950 */ 150, 82, 83, 84, 85, 86, 87, 88, 89, 90,
90653 /* 960 */ 91, 92, 19, 150, 150, 165, 150, 150, 1, 2,
90654 /* 970 */ 150, 150, 150, 228, 174, 175, 242, 107, 165, 165,
90655 /* 980 */ 150, 165, 165, 150, 150, 165, 165, 165, 49, 50,
90656 /* 990 */ 174, 175, 49, 50, 23, 165, 25, 233, 165, 165,
90657 /* 1000 */ 22, 23, 118, 241, 187, 190, 191, 193, 174, 175,
90658 /* 1010 */ 71, 72, 69, 70, 71, 72, 73, 74, 75, 76,
90659 /* 1020 */ 77, 78, 79, 80, 150, 82, 83, 84, 85, 86,
90660 /* 1030 */ 87, 88, 89, 90, 91, 92, 19, 98, 150, 165,
90661 /* 1040 */ 150, 150, 150, 160, 150, 67, 213, 199, 174, 175,
90662 /* 1050 */ 7, 8, 233, 165, 241, 165, 165, 165, 150, 165,
90663 /* 1060 */ 150, 150, 174, 175, 174, 175, 49, 50, 22, 97,
90664 /* 1070 */ 98, 144, 145, 165, 177, 165, 165, 194, 86, 87,
90665 /* 1080 */ 166, 187, 174, 175, 193, 174, 175, 70, 71, 72,
90666 /* 1090 */ 73, 74, 75, 76, 77, 78, 79, 80, 177, 82,
90667 /* 1100 */ 83, 84, 85, 86, 87, 88, 89, 90, 91, 92,
90668 /* 1110 */ 19, 20, 150, 22, 150, 190, 191, 26, 27, 205,
90669 /* 1120 */ 150, 160, 76, 19, 20, 150, 22, 165, 37, 165,
90670 /* 1130 */ 26, 27, 23, 241, 25, 165, 174, 175, 150, 150,
90671 /* 1140 */ 165, 37, 160, 150, 150, 197, 150, 56, 19, 174,
90672 /* 1150 */ 175, 150, 204, 165, 165, 194, 27, 66, 165, 165,
90673 /* 1160 */ 56, 165, 242, 174, 175, 150, 165, 174, 175, 209,
90674 /* 1170 */ 66, 160, 22, 150, 24, 177, 194, 86, 87, 150,
90675 /* 1180 */ 165, 217, 250, 251, 93, 94, 95, 193, 165, 98,
90676 /* 1190 */ 86, 87, 88, 153, 165, 18, 192, 93, 94, 95,
90677 /* 1200 */ 13, 151, 98, 174, 175, 194, 115, 22, 157, 19,
90678 /* 1210 */ 20, 150, 22, 150, 219, 150, 26, 27, 117, 157,
90679 /* 1220 */ 129, 130, 131, 132, 133, 134, 165, 37, 165, 218,
90680 /* 1230 */ 165, 157, 25, 129, 130, 131, 132, 133, 134, 174,
90681 /* 1240 */ 175, 159, 150, 150, 150, 150, 56, 150, 150, 47,
90682 /* 1250 */ 150, 240, 23, 184, 25, 150, 66, 165, 165, 165,
90683 /* 1260 */ 165, 104, 165, 165, 176, 165, 174, 175, 174, 175,
90684 /* 1270 */ 165, 174, 175, 157, 174, 175, 86, 87, 150, 174,
90685 /* 1280 */ 175, 18, 176, 93, 94, 95, 150, 150, 98, 92,
90686 /* 1290 */ 150, 150, 150, 165, 150, 150, 19, 20, 23, 22,
90687 /* 1300 */ 25, 165, 165, 26, 27, 165, 165, 165, 230, 165,
90688 /* 1310 */ 165, 150, 150, 230, 37, 150, 150, 150, 184, 129,
90689 /* 1320 */ 130, 131, 132, 133, 134, 176, 165, 165, 156, 5,
90690 /* 1330 */ 165, 165, 165, 56, 10, 11, 12, 13, 14, 150,
90691 /* 1340 */ 23, 17, 25, 66, 23, 150, 25, 176, 157, 176,
90692 /* 1350 */ 156, 40, 22, 157, 165, 31, 243, 33, 179, 176,
90693 /* 1360 */ 165, 103, 178, 86, 87, 156, 42, 179, 176, 6,
90694 /* 1370 */ 93, 94, 95, 149, 157, 98, 149, 149, 22, 55,
90695 /* 1380 */ 68, 57, 26, 27, 104, 61, 210, 189, 64, 120,
90696 /* 1390 */ 157, 211, 38, 246, 135, 227, 125, 189, 199, 157,
90697 /* 1400 */ 199, 219, 192, 192, 192, 189, 129, 130, 131, 132,
90698 /* 1410 */ 133, 134, 124, 210, 149, 211, 210, 203, 157, 121,
90699 /* 1420 */ 202, 201, 66, 123, 211, 122, 200, 157, 156, 105,
90700 /* 1430 */ 106, 199, 194, 151, 110, 45, 135, 180, 238, 115,
90701 /* 1440 */ 180, 126, 86, 87, 239, 164, 1, 15, 23, 22,
90702 /* 1450 */ 94, 117, 128, 117, 98, 117, 117, 117, 243, 112,
90703 /* 1460 */ 22, 11, 23, 139, 23, 22, 22, 25, 249, 23,
90704 /* 1470 */ 23, 23, 35, 252, 252, 35, 25, 25, 119, 22,
90705 /* 1480 */ 27, 117, 23, 23, 35, 129, 130, 131, 52, 22,
90706 /* 1490 */ 29, 22, 22, 39, 23, 22, 22, 102, 19, 108,
90707 /* 1500 */ 20, 24, 104, 25, 138, 43, 104, 52, 52, 22,
90708 /* 1510 */ 5, 1, 27, 117, 107, 126, 53, 59, 53, 22,
90709 /* 1520 */ 1, 118, 16, 20, 120, 107, 118, 127, 16, 22,
90710 /* 1530 */ 15, 23, 23, 65, 140, 22, 3, 253, 4, 253,
90711 /* 1540 */ 76, 253, 76,
90712 };
90713 #define YY_SHIFT_USE_DFLT (-104)
90714 #define YY_SHIFT_MAX 417
90715 static const short yy_shift_ofst[] = {
90716 /* 0 */ 967, 1091, 1324, 1091, 1277, 1277, 142, 142, 1, -19,
90717 /* 10 */ 1277, 1277, 1277, 1277, 1277, 209, 136, 721, 1104, 1277,
90718 /* 20 */ 1277, 1277, 1277, 1277, 1277, 1277, 1277, 1277, 1277, 1277,
90719 /* 30 */ 1277, 1277, 1277, 1277, 1277, 1277, 1277, 1277, 1277, 1277,
90720 /* 40 */ 1277, 1277, 1277, 1277, 1277, 1277, 1277, 1277, 1277, 1277,
90721 /* 50 */ 1277, 1277, 1277, 1277, 1277, 1190, 1277, 1277, 1277, 1277,
90722 /* 60 */ 1277, -49, 361, 136, 136, 992, 138, 992, -103, 55,
90723 /* 70 */ 129, 499, 351, 647, 203, 277, 425, 573, 869, 795,
90724 /* 80 */ 795, 795, 795, 795, 795, 795, 795, 795, 795, 795,
90725 /* 90 */ 795, 795, 795, 795, 795, 795, 795, 795, 943, 1017,
90726 /* 100 */ 1017, -69, -69, -69, -69, -1, -1, 57, 28, -44,
90727 /* 110 */ 136, 136, 502, 136, 136, 136, 136, 136, 136, 136,
90728 /* 120 */ 136, 136, 136, 136, 136, 136, 136, 136, 136, 580,
90729 /* 130 */ 136, 136, 136, 138, 804, -63, -104, -104, -104, 1356,
90730 /* 140 */ 74, 426, 433, 355, 215, 433, 313, 369, 136, 136,
90731 /* 150 */ 136, 136, 136, 136, 136, 136, 136, 754, 136, 136,
90732 /* 160 */ 136, 136, 136, 136, 136, 136, 136, 827, 136, 136,
90733 /* 170 */ 136, 136, 136, 136, 136, 136, 136, 136, 136, 136,
90734 /* 180 */ 136, 136, 586, 731, 731, 731, 780, 282, -103, -103,
90735 /* 190 */ -103, -104, -104, -104, 94, 158, 94, 12, 220, 662,
90736 /* 200 */ 516, 744, 870, 809, 870, 818, 555, 634, 419, 655,
90737 /* 210 */ 634, 634, 634, 638, 634, 213, 582, 634, 415, 566,
90738 /* 220 */ 138, 566, 138, 435, 642, 884, 138, 358, 309, 309,
90739 /* 230 */ 621, 621, 1129, 627, 566, 566, 358, 1129, 309, 566,
90740 /* 240 */ 1150, 1177, 1187, 1185, 1101, 1101, 1101, 1207, 1202, 1157,
90741 /* 250 */ 1157, 1101, 1197, 1157, 1263, 1197, 1157, 1101, 1202, 1157,
90742 /* 260 */ 1263, 1101, 1311, 1330, 1157, 1258, 1263, 1157, 1330, 1363,
90743 /* 270 */ 1101, 1363, 1363, 1312, 1280, 1269, 1101, 1354, 1259, 1271,
90744 /* 280 */ 1312, 1101, 1177, 1177, 1177, 1271, 1312, 1280, 1269, 1185,
90745 /* 290 */ 1280, 1269, 1363, 1288, 1101, 1298, 1300, 1303, 1263, 1271,
90746 /* 300 */ 1101, -103, 1187, 1301, 1390, 1311, -104, -104, -104, -104,
90747 /* 310 */ -104, -104, 939, 468, 978, 84, 837, 1317, 650, 831,
90748 /* 320 */ 971, 595, 1275, 1321, 723, 1046, 901, 1109, 749, 1229,
90749 /* 330 */ 972, 1043, 1315, 1445, 1432, 1425, 1427, 1334, 1336, 1338,
90750 /* 340 */ 1339, 1340, 1347, 1438, 1439, 1441, 1443, 1450, 1444, 1446,
90751 /* 350 */ 1442, 1447, 1448, 1451, 1437, 1452, 1440, 1451, 1359, 1457,
90752 /* 360 */ 1449, 1453, 1364, 1459, 1460, 1454, 1436, 1467, 1461, 1455,
90753 /* 370 */ 1469, 1471, 1470, 1473, 1456, 1474, 1395, 1391, 1479, 1480,
90754 /* 380 */ 1477, 1398, 1462, 1458, 1463, 1478, 1465, 1366, 1402, 1487,
90755 /* 390 */ 1505, 1510, 1396, -29, 1485, 1407, 1464, 1466, 1389, 1497,
90756 /* 400 */ 1403, 1519, 1506, 1404, 1503, 1408, 1418, 1507, 1400, 1508,
90757 /* 410 */ 1509, 1512, 1468, 1515, 1394, 1513, 1533, 1534,
90758 };
90759 #define YY_REDUCE_USE_DFLT (-222)
90760 #define YY_REDUCE_MAX 311
90761 static const short yy_reduce_ofst[] = {
90762 /* 0 */ 118, 90, 238, 147, 155, 20, 173, 148, 83, 246,
90763 /* 10 */ 377, 379, 385, 241, 228, 386, 297, 312, 443, 445,
90764 /* 20 */ 459, 462, 464, 504, 517, 530, 535, 537, 578, 591,
90765 /* 30 */ 594, 610, 613, 652, 665, 668, 672, 686, 726, 739,
90766 /* 40 */ 742, 760, 800, 816, 834, 874, 888, 890, 908, 911,
90767 /* 50 */ 962, 975, 989, 993, 1029, 1065, 1092, 1094, 1097, 1100,
90768 /* 60 */ 1105, -221, 1011, 249, 224, 311, 23, 362, 110, 77,
90769 /* 70 */ 77, 77, 77, 77, 77, 77, 77, 77, 77, 77,
90770 /* 80 */ 77, 77, 77, 77, 77, 77, 77, 77, 77, 77,
90771 /* 90 */ 77, 77, 77, 77, 77, 77, 77, 77, 77, 77,
90772 /* 100 */ 77, 77, 77, 77, 77, 77, 77, 730, 77, 77,
90773 /* 110 */ 813, -88, 22, 669, 596, 762, 341, 833, 743, 740,
90774 /* 120 */ 814, 891, 892, 817, 894, 964, 994, 390, -71, 206,
90775 /* 130 */ 549, 463, 666, -142, 77, 77, 77, 77, 77, 392,
90776 /* 140 */ 273, 970, 815, 996, 1001, 925, 1015, 1023, 1061, 1063,
90777 /* 150 */ 1093, 1095, 1098, 1128, 1136, 1137, 1140, 932, 1141, 1142,
90778 /* 160 */ 1144, 1145, 1001, 1161, 1162, 1165, 1166, 932, 1167, 1189,
90779 /* 170 */ 1195, 31, 208, 451, 670, 673, 820, 821, 822, 830,
90780 /* 180 */ 988, 910, -10, 21, 44, 914, 927, 883, 961, 982,
90781 /* 190 */ 332, 266, 948, 383, -96, -94, -76, -83, -59, -30,
90782 /* 200 */ -41, -59, -3, -59, 10, -59, 177, -59, 105, 247,
90783 /* 210 */ -59, -59, -59, 139, -59, -41, 190, -59, 296, 438,
90784 /* 220 */ 320, 448, 523, 529, 590, 626, 682, 699, 706, 727,
90785 /* 230 */ 764, 819, 734, 745, 897, 921, 848, 920, 960, 998,
90786 /* 240 */ 1040, 1004, 1050, 995, 1051, 1062, 1074, 1082, 1069, 1088,
90787 /* 250 */ 1106, 1116, 1078, 1149, 1172, 1083, 1171, 1191, 1134, 1173,
90788 /* 260 */ 1194, 1196, 1113, 1179, 1183, 1184, 1209, 1192, 1188, 1224,
90789 /* 270 */ 1217, 1227, 1228, 1198, 1176, 1180, 1233, 1147, 1168, 1199,
90790 /* 280 */ 1208, 1242, 1210, 1211, 1212, 1201, 1216, 1203, 1204, 1182,
90791 /* 290 */ 1206, 1213, 1265, 1214, 1261, 1218, 1220, 1226, 1272, 1232,
90792 /* 300 */ 1270, 1238, 1282, 1205, 1200, 1215, 1219, 1257, 1260, 1281,
90793 /* 310 */ 1221, 1222,
90794 };
90795 static const YYACTIONTYPE yy_default[] = {
90796 /* 0 */ 634, 869, 958, 958, 869, 958, 898, 898, 958, 757,
90797 /* 10 */ 958, 867, 958, 958, 958, 958, 958, 932, 958, 958,
90798 /* 20 */ 958, 958, 958, 958, 958, 958, 958, 958, 958, 958,
90799 /* 30 */ 958, 958, 958, 958, 958, 958, 958, 958, 958, 958,
90800 /* 40 */ 958, 958, 958, 958, 958, 958, 958, 958, 958, 958,
90801 /* 50 */ 958, 958, 958, 958, 958, 958, 958, 958, 958, 958,
90802 /* 60 */ 958, 841, 958, 958, 958, 898, 673, 898, 761, 792,
90803 /* 70 */ 958, 958, 958, 958, 958, 958, 958, 958, 958, 931,
90804 /* 80 */ 793, 783, 911, 864, 806, 772, 800, 797, 933, 866,
90805 /* 90 */ 863, 799, 790, 794, 871, 807, 870, 862, 829, 847,
90806 /* 100 */ 828, 846, 853, 831, 845, 830, 840, 665, 832, 833,
90807 /* 110 */ 958, 958, 660, 958, 958, 958, 958, 958, 958, 958,
90808 /* 120 */ 958, 958, 958, 958, 958, 958, 958, 958, 958, 726,
90809 /* 130 */ 958, 958, 958, 958, 834, 835, 849, 848, 850, 958,
90810 /* 140 */ 958, 958, 958, 958, 958, 958, 958, 958, 882, 958,
90811 /* 150 */ 958, 958, 958, 958, 958, 958, 958, 958, 958, 958,
90812 /* 160 */ 958, 958, 958, 958, 958, 958, 640, 958, 958, 958,
90813 /* 170 */ 958, 958, 958, 958, 936, 958, 958, 958, 938, 958,
90814 /* 180 */ 958, 958, 958, 757, 757, 757, 634, 958, 958, 958,
90815 /* 190 */ 958, 761, 751, 950, 958, 717, 958, 958, 958, 958,
90816 /* 200 */ 958, 958, 958, 958, 958, 958, 642, 921, 958, 675,
90817 /* 210 */ 802, 662, 740, 904, 738, 759, 749, 923, 696, 786,
90818 /* 220 */ 958, 786, 958, 699, 749, 758, 958, 796, 774, 774,
90819 /* 230 */ 958, 958, 916, 865, 786, 786, 796, 916, 774, 786,
90820 /* 240 */ 958, 737, 650, 808, 765, 765, 765, 716, 713, 728,
90821 /* 250 */ 728, 765, 879, 728, 657, 879, 728, 765, 713, 728,
90822 /* 260 */ 657, 765, 935, 875, 728, 699, 657, 728, 875, 639,
90823 /* 270 */ 765, 639, 639, 730, 773, 778, 765, 943, 958, 796,
90824 /* 280 */ 730, 765, 737, 737, 737, 796, 730, 773, 778, 808,
90825 /* 290 */ 773, 778, 639, 791, 765, 779, 789, 787, 657, 796,
90826 /* 300 */ 765, 958, 650, 910, 908, 935, 950, 701, 701, 683,
90827 /* 310 */ 955, 955, 958, 958, 958, 958, 958, 958, 958, 958,
90828 /* 320 */ 958, 958, 958, 958, 958, 884, 958, 958, 958, 958,
90829 /* 330 */ 958, 958, 958, 958, 648, 958, 667, 815, 820, 816,
90830 /* 340 */ 958, 817, 743, 958, 958, 958, 958, 958, 958, 958,
90831 /* 350 */ 958, 958, 958, 868, 958, 780, 958, 788, 958, 958,
90832 /* 360 */ 958, 958, 958, 958, 958, 958, 958, 958, 958, 958,
90833 /* 370 */ 958, 958, 958, 958, 958, 958, 958, 958, 958, 958,
90834 /* 380 */ 958, 958, 958, 958, 906, 907, 958, 958, 958, 958,
90835 /* 390 */ 958, 958, 914, 958, 958, 958, 958, 958, 958, 958,
90836 /* 400 */ 958, 958, 958, 958, 958, 958, 958, 958, 958, 958,
90837 /* 410 */ 958, 958, 942, 958, 958, 945, 635, 958, 711, 649,
90838 /* 420 */ 734, 733, 732, 729, 691, 690, 689, 647, 820, 688,
90839 /* 430 */ 767, 687, 826, 900, 825, 813, 937, 646, 909, 905,
90840 /* 440 */ 645, 857, 939, 901, 902, 957, 903, 659, 644, 754,
90841 /* 450 */ 753, 752, 954, 764, 630, 763, 776, 872, 873, 643,
90842 /* 460 */ 775, 811, 810, 777, 731, 804, 805, 762, 899, 940,
90843 /* 470 */ 912, 756, 755, 636, 771, 915, 770, 672, 769, 917,
90844 /* 480 */ 671, 918, 941, 768, 760, 750, 944, 782, 785, 919,
90845 /* 490 */ 631, 784, 781, 670, 842, 859, 766, 856, 809, 928,
90846 /* 500 */ 927, 668, 926, 925, 924, 861, 920, 860, 946, 827,
90847 /* 510 */ 824, 678, 922, 667, 913, 641, 679, 897, 951, 895,
90848 /* 520 */ 947, 656, 896, 894, 681, 735, 952, 736, 680, 677,
90849 /* 530 */ 739, 676, 858, 881, 745, 744, 929, 854, 638, 851,
90850 /* 540 */ 843, 838, 795, 855, 852, 844, 637, 839, 837, 798,
90851 /* 550 */ 836, 822, 821, 819, 818, 953, 814, 823, 801, 633,
90852 /* 560 */ 803, 669, 883, 746, 742, 741, 812, 885, 887, 889,
90853 /* 570 */ 890, 891, 892, 893, 748, 632, 886, 956, 888, 747,
90854 /* 580 */ 666, 718, 674, 721, 686, 684, 685, 712, 682, 698,
90855 /* 590 */ 722, 663, 697, 878, 880, 723, 930, 877, 876, 705,
90856 /* 600 */ 724, 661, 654, 710, 709, 934, 708, 707, 706, 704,
90857 /* 610 */ 652, 725, 727, 719, 720, 664, 703, 702, 695, 694,
90858 /* 620 */ 700, 693, 715, 655, 651, 653, 658, 714, 692,
90859 };
90860 #define YY_SZ_ACTTAB (int)(sizeof(yy_action)/sizeof(yy_action[0]))
90861
90862 /* The next table maps tokens into fallback tokens. If a construct
90863 ** like the following:
@@ -92151,11 +92369,11 @@
92369 break;
92370 case 69: /* ccons ::= COLLATE ids */
92371 {sqlite3AddCollateType(pParse, &yymsp[0].minor.yy0);}
92372 break;
92373 case 72: /* refargs ::= */
92374 { yygotominor.yy328 = OE_None*0x0101; /* EV: R-19803-45884 */}
92375 break;
92376 case 73: /* refargs ::= refargs refarg */
92377 { yygotominor.yy328 = (yymsp[-1].minor.yy328 & ~yymsp[0].minor.yy429.mask) | yymsp[0].minor.yy429.value; }
92378 break;
92379 case 74: /* refarg ::= MATCH nm */
@@ -92166,23 +92384,23 @@
92384 break;
92385 case 76: /* refarg ::= ON UPDATE refact */
92386 { yygotominor.yy429.value = yymsp[0].minor.yy328<<8; yygotominor.yy429.mask = 0x00ff00; }
92387 break;
92388 case 77: /* refact ::= SET NULL */
92389 { yygotominor.yy328 = OE_SetNull; /* EV: R-33326-45252 */}
92390 break;
92391 case 78: /* refact ::= SET DEFAULT */
92392 { yygotominor.yy328 = OE_SetDflt; /* EV: R-33326-45252 */}
92393 break;
92394 case 79: /* refact ::= CASCADE */
92395 { yygotominor.yy328 = OE_Cascade; /* EV: R-33326-45252 */}
92396 break;
92397 case 80: /* refact ::= RESTRICT */
92398 { yygotominor.yy328 = OE_Restrict; /* EV: R-33326-45252 */}
92399 break;
92400 case 81: /* refact ::= NO ACTION */
92401 { yygotominor.yy328 = OE_None; /* EV: R-33326-45252 */}
92402 break;
92403 case 83: /* defer_subclause ::= DEFERRABLE init_deferred_pred_opt */
92404 case 98: /* defer_subclause_opt ::= defer_subclause */ yytestcase(yyruleno==98);
92405 case 100: /* onconf ::= ON CONFLICT resolvetype */ yytestcase(yyruleno==100);
92406 case 103: /* resolvetype ::= raisetype */ yytestcase(yyruleno==103);
@@ -93431,19 +93649,19 @@
93649 0, 65, 6, 0, 48, 86, 98, 0, 115, 97, 0, 0, 45,
93650 0, 99, 24, 0, 17, 0, 119, 49, 23, 0, 5, 106, 25,
93651 92, 0, 0, 121, 102, 56, 120, 53, 28, 51, 0, 87, 0,
93652 96, 26, 0, 95, 0, 0, 0, 91, 88, 93, 84, 105, 14,
93653 39, 104, 0, 77, 0, 18, 85, 107, 32, 0, 117, 76, 109,
93654 57, 46, 80, 0, 0, 90, 40, 0, 112, 0, 36, 0, 0,
93655 29, 0, 82, 59, 60, 0, 20, 58, 0, 52,
93656 };
93657 static const unsigned char aNext[121] = {
93658 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0,
93659 0, 2, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0,
93660 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
93661 0, 0, 0, 0, 0, 33, 21, 0, 0, 0, 43, 3, 47,
93662 0, 0, 0, 0, 0, 30, 54, 0, 38, 0, 0, 0, 1,
93663 62, 0, 0, 63, 0, 41, 0, 0, 0, 0, 0, 0, 0,
93664 61, 0, 0, 0, 0, 31, 55, 16, 34, 10, 0, 0, 0,
93665 0, 0, 0, 0, 11, 68, 75, 0, 8, 0, 100, 94, 0,
93666 103, 0, 83, 0, 71, 0, 0, 110, 27, 37, 69, 79, 0,
93667 35, 64, 0, 0,
@@ -93451,11 +93669,11 @@
93669 static const unsigned char aLen[121] = {
93670 7, 7, 5, 4, 6, 4, 5, 3, 6, 7, 3, 6, 6,
93671 7, 7, 3, 8, 2, 6, 5, 4, 4, 3, 10, 4, 6,
93672 11, 6, 2, 7, 5, 5, 9, 6, 9, 9, 7, 10, 10,
93673 4, 6, 2, 3, 4, 9, 2, 6, 5, 6, 6, 5, 6,
93674 5, 5, 7, 7, 3, 7, 2, 4, 4, 7, 3, 6, 4,
93675 7, 6, 12, 6, 9, 4, 6, 5, 4, 7, 6, 5, 6,
93676 7, 5, 4, 5, 6, 5, 7, 3, 7, 13, 2, 2, 4,
93677 6, 6, 8, 5, 17, 12, 7, 8, 8, 2, 4, 4, 4,
93678 4, 4, 2, 2, 6, 5, 8, 5, 5, 8, 3, 5, 5,
93679 6, 4, 9, 3,
@@ -93482,11 +93700,11 @@
93700 TK_ALTER, TK_RAISE, TK_EXCLUSIVE, TK_EXISTS, TK_SAVEPOINT,
93701 TK_INTERSECT, TK_TRIGGER, TK_REFERENCES, TK_CONSTRAINT, TK_INTO,
93702 TK_OFFSET, TK_OF, TK_SET, TK_TEMP, TK_TEMP,
93703 TK_OR, TK_UNIQUE, TK_QUERY, TK_ATTACH, TK_HAVING,
93704 TK_GROUP, TK_UPDATE, TK_BEGIN, TK_JOIN_KW, TK_RELEASE,
93705 TK_BETWEEN, TK_NOT, TK_NOTNULL, TK_NO, TK_NULL,
93706 TK_LIKE_KW, TK_CASCADE, TK_ASC, TK_DELETE, TK_CASE,
93707 TK_COLLATE, TK_CREATE, TK_CTIME_KW, TK_DETACH, TK_IMMEDIATE,
93708 TK_JOIN, TK_INSERT, TK_MATCH, TK_PLAN, TK_ANALYZE,
93709 TK_PRAGMA, TK_ABORT, TK_VALUES, TK_VIRTUAL, TK_LIMIT,
93710 TK_WHEN, TK_WHERE, TK_RENAME, TK_AFTER, TK_REPLACE,
@@ -93560,13 +93778,13 @@
93778 testcase( i==51 ); /* UPDATE */
93779 testcase( i==52 ); /* BEGIN */
93780 testcase( i==53 ); /* INNER */
93781 testcase( i==54 ); /* RELEASE */
93782 testcase( i==55 ); /* BETWEEN */
93783 testcase( i==56 ); /* NOT */
93784 testcase( i==57 ); /* NOTNULL */
93785 testcase( i==58 ); /* NO */
93786 testcase( i==59 ); /* NULL */
93787 testcase( i==60 ); /* LIKE */
93788 testcase( i==61 ); /* CASCADE */
93789 testcase( i==62 ); /* ASC */
93790 testcase( i==63 ); /* DELETE */
@@ -95956,12 +96174,12 @@
96174 # error SQLITE_MAX_ATTACHED must be between 0 and 30
96175 #endif
96176 #if SQLITE_MAX_LIKE_PATTERN_LENGTH<1
96177 # error SQLITE_MAX_LIKE_PATTERN_LENGTH must be at least 1
96178 #endif
96179 #if SQLITE_MAX_VARIABLE_NUMBER<1 || SQLITE_MAX_VARIABLE_NUMBER>32767
96180 # error SQLITE_MAX_VARIABLE_NUMBER must be between 1 and 32767
96181 #endif
96182 #if SQLITE_MAX_COLUMN>32767
96183 # error SQLITE_MAX_COLUMN must not exceed 32767
96184 #endif
96185 #if SQLITE_MAX_TRIGGER_DEPTH<1
96186
+27 -18
--- src/sqlite3.h
+++ src/sqlite3.h
@@ -117,13 +117,13 @@
117117
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
118118
** [sqlite_version()] and [sqlite_source_id()].
119119
**
120120
** Requirements: [H10011] [H10014]
121121
*/
122
-#define SQLITE_VERSION "3.6.19"
123
-#define SQLITE_VERSION_NUMBER 3006019
124
-#define SQLITE_SOURCE_ID "2009-10-14 11:33:55 c1d499afc50d54b376945b4efb65c56c787a073d"
122
+#define SQLITE_VERSION "3.6.20"
123
+#define SQLITE_VERSION_NUMBER 3006020
124
+#define SQLITE_SOURCE_ID "2009-10-30 14:27:15 612952743da28e651512547fc0d3925f4c698eb4"
125125
126126
/*
127127
** CAPI3REF: Run-Time Library Version Numbers {H10020} <S60100>
128128
** KEYWORDS: sqlite3_version
129129
**
@@ -243,23 +243,13 @@
243243
/*
244244
** CAPI3REF: Closing A Database Connection {H12010} <S30100><S40200>
245245
**
246246
** This routine is the destructor for the [sqlite3] object.
247247
**
248
-** Applications should [sqlite3_finalize | finalize] all [prepared statements]
248
+** Applications must [sqlite3_finalize | finalize] all [prepared statements]
249249
** and [sqlite3_blob_close | close] all [BLOB handles] associated with
250250
** the [sqlite3] object prior to attempting to close the object.
251
-** The [sqlite3_next_stmt()] interface can be used to locate all
252
-** [prepared statements] associated with a [database connection] if desired.
253
-** Typical code might look like this:
254
-**
255
-** <blockquote><pre>
256
-** sqlite3_stmt *pStmt;
257
-** while( (pStmt = sqlite3_next_stmt(db, 0))!=0 ){
258
-** &nbsp; sqlite3_finalize(pStmt);
259
-** }
260
-** </pre></blockquote>
261251
**
262252
** If [sqlite3_close()] is invoked while a transaction is open,
263253
** the transaction is automatically rolled back.
264254
**
265255
** The C parameter to [sqlite3_close(C)] must be either a NULL
@@ -833,10 +823,13 @@
833823
** CAPI3REF: Initialize The SQLite Library {H10130} <S20000><S30100>
834824
**
835825
** The sqlite3_initialize() routine initializes the
836826
** SQLite library. The sqlite3_shutdown() routine
837827
** deallocates any resources that were allocated by sqlite3_initialize().
828
+** This routines are designed to aid in process initialization and
829
+** shutdown on embedded systems. Workstation applications using
830
+** SQLite normally do not need to invoke either of these routines.
838831
**
839832
** A call to sqlite3_initialize() is an "effective" call if it is
840833
** the first time sqlite3_initialize() is invoked during the lifetime of
841834
** the process, or if it is the first time sqlite3_initialize() is invoked
842835
** following a call to sqlite3_shutdown(). Only an effective call
@@ -844,15 +837,21 @@
844837
** are harmless no-ops.
845838
**
846839
** A call to sqlite3_shutdown() is an "effective" call if it is the first
847840
** call to sqlite3_shutdown() since the last sqlite3_initialize(). Only
848841
** an effective call to sqlite3_shutdown() does any deinitialization.
849
-** All other calls to sqlite3_shutdown() are harmless no-ops.
842
+** All other valid calls to sqlite3_shutdown() are harmless no-ops.
850843
**
851
-** Among other things, sqlite3_initialize() shall invoke
844
+** The sqlite3_initialize() interface is threadsafe, but sqlite3_shutdown()
845
+** is not. The sqlite3_shutdown() interface must only be called from a
846
+** single thread. All open [database connections] must be closed and all
847
+** other SQLite resources must be deallocated prior to invoking
848
+** sqlite3_shutdown().
849
+**
850
+** Among other things, sqlite3_initialize() will invoke
852851
** sqlite3_os_init(). Similarly, sqlite3_shutdown()
853
-** shall invoke sqlite3_os_end().
852
+** will invoke sqlite3_os_end().
854853
**
855854
** The sqlite3_initialize() routine returns [SQLITE_OK] on success.
856855
** If for some reason, sqlite3_initialize() is unable to initialize
857856
** the library (perhaps it is unable to allocate a needed resource such
858857
** as a mutex) it returns an [error code] other than [SQLITE_OK].
@@ -2394,11 +2393,11 @@
23942393
** recommended for all new programs. The two older interfaces are retained
23952394
** for backwards compatibility, but their use is discouraged.
23962395
** In the "v2" interfaces, the prepared statement
23972396
** that is returned (the [sqlite3_stmt] object) contains a copy of the
23982397
** original SQL text. This causes the [sqlite3_step()] interface to
2399
-** behave a differently in two ways:
2398
+** behave a differently in three ways:
24002399
**
24012400
** <ol>
24022401
** <li>
24032402
** If the database schema changes, instead of returning [SQLITE_SCHEMA] as it
24042403
** always used to do, [sqlite3_step()] will automatically recompile the SQL
@@ -2416,10 +2415,18 @@
24162415
** [sqlite3_step()] would only return a generic [SQLITE_ERROR] result code
24172416
** and you would have to make a second call to [sqlite3_reset()] in order
24182417
** to find the underlying cause of the problem. With the "v2" prepare
24192418
** interfaces, the underlying reason for the error is returned immediately.
24202419
** </li>
2420
+**
2421
+** <li>
2422
+** ^If the value of a [parameter | host parameter] in the WHERE clause might
2423
+** change the query plan for a statement, then the statement may be
2424
+** automatically recompiled (as if there had been a schema change) on the first
2425
+** [sqlite3_step()] call following any change to the
2426
+** [sqlite3_bind_text | bindings] of the [parameter].
2427
+** </li>
24212428
** </ol>
24222429
**
24232430
** Requirements:
24242431
** [H13011] [H13012] [H13013] [H13014] [H13015] [H13016] [H13019] [H13021]
24252432
**
@@ -2948,10 +2955,12 @@
29482955
** result row of a query. In every case the first argument is a pointer
29492956
** to the [prepared statement] that is being evaluated (the [sqlite3_stmt*]
29502957
** that was returned from [sqlite3_prepare_v2()] or one of its variants)
29512958
** and the second argument is the index of the column for which information
29522959
** should be returned. The leftmost column of the result set has the index 0.
2960
+** The number of columns in the result can be determined using
2961
+** [sqlite3_column_count()].
29532962
**
29542963
** If the SQL statement does not currently point to a valid row, or if the
29552964
** column index is out of range, the result is undefined.
29562965
** These routines may only be called when the most recent call to
29572966
** [sqlite3_step()] has returned [SQLITE_ROW] and neither
29582967
--- src/sqlite3.h
+++ src/sqlite3.h
@@ -117,13 +117,13 @@
117 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
118 ** [sqlite_version()] and [sqlite_source_id()].
119 **
120 ** Requirements: [H10011] [H10014]
121 */
122 #define SQLITE_VERSION "3.6.19"
123 #define SQLITE_VERSION_NUMBER 3006019
124 #define SQLITE_SOURCE_ID "2009-10-14 11:33:55 c1d499afc50d54b376945b4efb65c56c787a073d"
125
126 /*
127 ** CAPI3REF: Run-Time Library Version Numbers {H10020} <S60100>
128 ** KEYWORDS: sqlite3_version
129 **
@@ -243,23 +243,13 @@
243 /*
244 ** CAPI3REF: Closing A Database Connection {H12010} <S30100><S40200>
245 **
246 ** This routine is the destructor for the [sqlite3] object.
247 **
248 ** Applications should [sqlite3_finalize | finalize] all [prepared statements]
249 ** and [sqlite3_blob_close | close] all [BLOB handles] associated with
250 ** the [sqlite3] object prior to attempting to close the object.
251 ** The [sqlite3_next_stmt()] interface can be used to locate all
252 ** [prepared statements] associated with a [database connection] if desired.
253 ** Typical code might look like this:
254 **
255 ** <blockquote><pre>
256 ** sqlite3_stmt *pStmt;
257 ** while( (pStmt = sqlite3_next_stmt(db, 0))!=0 ){
258 ** &nbsp; sqlite3_finalize(pStmt);
259 ** }
260 ** </pre></blockquote>
261 **
262 ** If [sqlite3_close()] is invoked while a transaction is open,
263 ** the transaction is automatically rolled back.
264 **
265 ** The C parameter to [sqlite3_close(C)] must be either a NULL
@@ -833,10 +823,13 @@
833 ** CAPI3REF: Initialize The SQLite Library {H10130} <S20000><S30100>
834 **
835 ** The sqlite3_initialize() routine initializes the
836 ** SQLite library. The sqlite3_shutdown() routine
837 ** deallocates any resources that were allocated by sqlite3_initialize().
 
 
 
838 **
839 ** A call to sqlite3_initialize() is an "effective" call if it is
840 ** the first time sqlite3_initialize() is invoked during the lifetime of
841 ** the process, or if it is the first time sqlite3_initialize() is invoked
842 ** following a call to sqlite3_shutdown(). Only an effective call
@@ -844,15 +837,21 @@
844 ** are harmless no-ops.
845 **
846 ** A call to sqlite3_shutdown() is an "effective" call if it is the first
847 ** call to sqlite3_shutdown() since the last sqlite3_initialize(). Only
848 ** an effective call to sqlite3_shutdown() does any deinitialization.
849 ** All other calls to sqlite3_shutdown() are harmless no-ops.
850 **
851 ** Among other things, sqlite3_initialize() shall invoke
 
 
 
 
 
 
852 ** sqlite3_os_init(). Similarly, sqlite3_shutdown()
853 ** shall invoke sqlite3_os_end().
854 **
855 ** The sqlite3_initialize() routine returns [SQLITE_OK] on success.
856 ** If for some reason, sqlite3_initialize() is unable to initialize
857 ** the library (perhaps it is unable to allocate a needed resource such
858 ** as a mutex) it returns an [error code] other than [SQLITE_OK].
@@ -2394,11 +2393,11 @@
2394 ** recommended for all new programs. The two older interfaces are retained
2395 ** for backwards compatibility, but their use is discouraged.
2396 ** In the "v2" interfaces, the prepared statement
2397 ** that is returned (the [sqlite3_stmt] object) contains a copy of the
2398 ** original SQL text. This causes the [sqlite3_step()] interface to
2399 ** behave a differently in two ways:
2400 **
2401 ** <ol>
2402 ** <li>
2403 ** If the database schema changes, instead of returning [SQLITE_SCHEMA] as it
2404 ** always used to do, [sqlite3_step()] will automatically recompile the SQL
@@ -2416,10 +2415,18 @@
2416 ** [sqlite3_step()] would only return a generic [SQLITE_ERROR] result code
2417 ** and you would have to make a second call to [sqlite3_reset()] in order
2418 ** to find the underlying cause of the problem. With the "v2" prepare
2419 ** interfaces, the underlying reason for the error is returned immediately.
2420 ** </li>
 
 
 
 
 
 
 
 
2421 ** </ol>
2422 **
2423 ** Requirements:
2424 ** [H13011] [H13012] [H13013] [H13014] [H13015] [H13016] [H13019] [H13021]
2425 **
@@ -2948,10 +2955,12 @@
2948 ** result row of a query. In every case the first argument is a pointer
2949 ** to the [prepared statement] that is being evaluated (the [sqlite3_stmt*]
2950 ** that was returned from [sqlite3_prepare_v2()] or one of its variants)
2951 ** and the second argument is the index of the column for which information
2952 ** should be returned. The leftmost column of the result set has the index 0.
 
 
2953 **
2954 ** If the SQL statement does not currently point to a valid row, or if the
2955 ** column index is out of range, the result is undefined.
2956 ** These routines may only be called when the most recent call to
2957 ** [sqlite3_step()] has returned [SQLITE_ROW] and neither
2958
--- src/sqlite3.h
+++ src/sqlite3.h
@@ -117,13 +117,13 @@
117 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
118 ** [sqlite_version()] and [sqlite_source_id()].
119 **
120 ** Requirements: [H10011] [H10014]
121 */
122 #define SQLITE_VERSION "3.6.20"
123 #define SQLITE_VERSION_NUMBER 3006020
124 #define SQLITE_SOURCE_ID "2009-10-30 14:27:15 612952743da28e651512547fc0d3925f4c698eb4"
125
126 /*
127 ** CAPI3REF: Run-Time Library Version Numbers {H10020} <S60100>
128 ** KEYWORDS: sqlite3_version
129 **
@@ -243,23 +243,13 @@
243 /*
244 ** CAPI3REF: Closing A Database Connection {H12010} <S30100><S40200>
245 **
246 ** This routine is the destructor for the [sqlite3] object.
247 **
248 ** Applications must [sqlite3_finalize | finalize] all [prepared statements]
249 ** and [sqlite3_blob_close | close] all [BLOB handles] associated with
250 ** the [sqlite3] object prior to attempting to close the object.
 
 
 
 
 
 
 
 
 
 
251 **
252 ** If [sqlite3_close()] is invoked while a transaction is open,
253 ** the transaction is automatically rolled back.
254 **
255 ** The C parameter to [sqlite3_close(C)] must be either a NULL
@@ -833,10 +823,13 @@
823 ** CAPI3REF: Initialize The SQLite Library {H10130} <S20000><S30100>
824 **
825 ** The sqlite3_initialize() routine initializes the
826 ** SQLite library. The sqlite3_shutdown() routine
827 ** deallocates any resources that were allocated by sqlite3_initialize().
828 ** This routines are designed to aid in process initialization and
829 ** shutdown on embedded systems. Workstation applications using
830 ** SQLite normally do not need to invoke either of these routines.
831 **
832 ** A call to sqlite3_initialize() is an "effective" call if it is
833 ** the first time sqlite3_initialize() is invoked during the lifetime of
834 ** the process, or if it is the first time sqlite3_initialize() is invoked
835 ** following a call to sqlite3_shutdown(). Only an effective call
@@ -844,15 +837,21 @@
837 ** are harmless no-ops.
838 **
839 ** A call to sqlite3_shutdown() is an "effective" call if it is the first
840 ** call to sqlite3_shutdown() since the last sqlite3_initialize(). Only
841 ** an effective call to sqlite3_shutdown() does any deinitialization.
842 ** All other valid calls to sqlite3_shutdown() are harmless no-ops.
843 **
844 ** The sqlite3_initialize() interface is threadsafe, but sqlite3_shutdown()
845 ** is not. The sqlite3_shutdown() interface must only be called from a
846 ** single thread. All open [database connections] must be closed and all
847 ** other SQLite resources must be deallocated prior to invoking
848 ** sqlite3_shutdown().
849 **
850 ** Among other things, sqlite3_initialize() will invoke
851 ** sqlite3_os_init(). Similarly, sqlite3_shutdown()
852 ** will invoke sqlite3_os_end().
853 **
854 ** The sqlite3_initialize() routine returns [SQLITE_OK] on success.
855 ** If for some reason, sqlite3_initialize() is unable to initialize
856 ** the library (perhaps it is unable to allocate a needed resource such
857 ** as a mutex) it returns an [error code] other than [SQLITE_OK].
@@ -2394,11 +2393,11 @@
2393 ** recommended for all new programs. The two older interfaces are retained
2394 ** for backwards compatibility, but their use is discouraged.
2395 ** In the "v2" interfaces, the prepared statement
2396 ** that is returned (the [sqlite3_stmt] object) contains a copy of the
2397 ** original SQL text. This causes the [sqlite3_step()] interface to
2398 ** behave a differently in three ways:
2399 **
2400 ** <ol>
2401 ** <li>
2402 ** If the database schema changes, instead of returning [SQLITE_SCHEMA] as it
2403 ** always used to do, [sqlite3_step()] will automatically recompile the SQL
@@ -2416,10 +2415,18 @@
2415 ** [sqlite3_step()] would only return a generic [SQLITE_ERROR] result code
2416 ** and you would have to make a second call to [sqlite3_reset()] in order
2417 ** to find the underlying cause of the problem. With the "v2" prepare
2418 ** interfaces, the underlying reason for the error is returned immediately.
2419 ** </li>
2420 **
2421 ** <li>
2422 ** ^If the value of a [parameter | host parameter] in the WHERE clause might
2423 ** change the query plan for a statement, then the statement may be
2424 ** automatically recompiled (as if there had been a schema change) on the first
2425 ** [sqlite3_step()] call following any change to the
2426 ** [sqlite3_bind_text | bindings] of the [parameter].
2427 ** </li>
2428 ** </ol>
2429 **
2430 ** Requirements:
2431 ** [H13011] [H13012] [H13013] [H13014] [H13015] [H13016] [H13019] [H13021]
2432 **
@@ -2948,10 +2955,12 @@
2955 ** result row of a query. In every case the first argument is a pointer
2956 ** to the [prepared statement] that is being evaluated (the [sqlite3_stmt*]
2957 ** that was returned from [sqlite3_prepare_v2()] or one of its variants)
2958 ** and the second argument is the index of the column for which information
2959 ** should be returned. The leftmost column of the result set has the index 0.
2960 ** The number of columns in the result can be determined using
2961 ** [sqlite3_column_count()].
2962 **
2963 ** If the SQL statement does not currently point to a valid row, or if the
2964 ** column index is out of range, the result is undefined.
2965 ** These routines may only be called when the most recent call to
2966 ** [sqlite3_step()] has returned [SQLITE_ROW] and neither
2967
+2 -2
--- src/th.c
+++ src/th.c
@@ -1823,12 +1823,12 @@
18231823
int iRight;
18241824
double fLeft;
18251825
double fRight;
18261826
18271827
/* Left and right arguments as strings */
1828
- char *zLeft = 0; int nLeft;
1829
- char *zRight = 0; int nRight;
1828
+ char *zLeft = 0; int nLeft = 0;
1829
+ char *zRight = 0; int nRight = 0;
18301830
18311831
/* Evaluate left and right arguments, if they exist. */
18321832
if( pExpr->pLeft ){
18331833
rc = exprEval(interp, pExpr->pLeft);
18341834
if( rc==TH_OK ){
18351835
--- src/th.c
+++ src/th.c
@@ -1823,12 +1823,12 @@
1823 int iRight;
1824 double fLeft;
1825 double fRight;
1826
1827 /* Left and right arguments as strings */
1828 char *zLeft = 0; int nLeft;
1829 char *zRight = 0; int nRight;
1830
1831 /* Evaluate left and right arguments, if they exist. */
1832 if( pExpr->pLeft ){
1833 rc = exprEval(interp, pExpr->pLeft);
1834 if( rc==TH_OK ){
1835
--- src/th.c
+++ src/th.c
@@ -1823,12 +1823,12 @@
1823 int iRight;
1824 double fLeft;
1825 double fRight;
1826
1827 /* Left and right arguments as strings */
1828 char *zLeft = 0; int nLeft = 0;
1829 char *zRight = 0; int nRight = 0;
1830
1831 /* Evaluate left and right arguments, if they exist. */
1832 if( pExpr->pLeft ){
1833 rc = exprEval(interp, pExpr->pLeft);
1834 if( rc==TH_OK ){
1835

Keyboard Shortcuts

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