Fossil SCM

merged trunk [b54b8e751a].

stephan 2011-09-18 05:51 UTC json merge
Commit 76c4ae5e5e4387aaeda4c9c13b6910bd92bb6c40
2 files changed +313 -814 +1 -1
+313 -814
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -24,11 +24,10 @@
2424
#endif
2525
#ifndef SQLITE_API
2626
# define SQLITE_API
2727
#endif
2828
/************** Begin file sqliteInt.h ***************************************/
29
-#line 1 "tsrc/sqliteInt.h"
3029
/*
3130
** 2001 September 15
3231
**
3332
** The author disclaims copyright to this source code. In place of
3433
** a legal notice, here is a blessing:
@@ -79,11 +78,10 @@
7978
#include "config.h"
8079
#endif
8180
8281
/************** Include sqliteLimit.h in the middle of sqliteInt.h ***********/
8382
/************** Begin file sqliteLimit.h *************************************/
84
-#line 1 "tsrc/sqliteLimit.h"
8583
/*
8684
** 2007 May 7
8785
**
8886
** The author disclaims copyright to this source code. In place of
8987
** a legal notice, here is a blessing:
@@ -291,11 +289,10 @@
291289
# define SQLITE_MAX_TRIGGER_DEPTH 1000
292290
#endif
293291
294292
/************** End of sqliteLimit.h *****************************************/
295293
/************** Continuing where we left off in sqliteInt.h ******************/
296
-#line 54 "tsrc/sqliteInt.h"
297294
298295
/* Disable nuisance warnings on Borland compilers */
299296
#if defined(__BORLANDC__)
300297
#pragma warn -rch /* unreachable code */
301298
#pragma warn -ccc /* Condition is always true or false */
@@ -548,11 +545,10 @@
548545
# define unlikely(X) !!(X)
549546
#endif
550547
551548
/************** Include sqlite3.h in the middle of sqliteInt.h ***************/
552549
/************** Begin file sqlite3.h *****************************************/
553
-#line 1 "tsrc/sqlite3.h"
554550
/*
555551
** 2001 September 15
556552
**
557553
** The author disclaims copyright to this source code. In place of
558554
** a legal notice, here is a blessing:
@@ -660,11 +656,11 @@
660656
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
661657
** [sqlite_version()] and [sqlite_source_id()].
662658
*/
663659
#define SQLITE_VERSION "3.7.8"
664660
#define SQLITE_VERSION_NUMBER 3007008
665
-#define SQLITE_SOURCE_ID "2011-09-14 13:41:40 a1f3aeeb0988c848d40ce8f6da6e902935a997e2"
661
+#define SQLITE_SOURCE_ID "2011-09-17 17:29:20 b31a7d7db9040d8eedaf1ecd89ea0033f579d0f1"
666662
667663
/*
668664
** CAPI3REF: Run-Time Library Version Numbers
669665
** KEYWORDS: sqlite3_version, sqlite3_sourceid
670666
**
@@ -7309,14 +7305,12 @@
73097305
#endif /* ifndef _SQLITE3RTREE_H_ */
73107306
73117307
73127308
/************** End of sqlite3.h *********************************************/
73137309
/************** Continuing where we left off in sqliteInt.h ******************/
7314
-#line 309 "tsrc/sqliteInt.h"
73157310
/************** Include hash.h in the middle of sqliteInt.h ******************/
73167311
/************** Begin file hash.h ********************************************/
7317
-#line 1 "tsrc/hash.h"
73187312
/*
73197313
** 2001 September 22
73207314
**
73217315
** The author disclaims copyright to this source code. In place of
73227316
** a legal notice, here is a blessing:
@@ -7412,14 +7406,12 @@
74127406
74137407
#endif /* _SQLITE_HASH_H_ */
74147408
74157409
/************** End of hash.h ************************************************/
74167410
/************** Continuing where we left off in sqliteInt.h ******************/
7417
-#line 310 "tsrc/sqliteInt.h"
74187411
/************** Include parse.h in the middle of sqliteInt.h *****************/
74197412
/************** Begin file parse.h *******************************************/
7420
-#line 1 "tsrc/parse.h"
74217413
#define TK_SEMI 1
74227414
#define TK_EXPLAIN 2
74237415
#define TK_QUERY 3
74247416
#define TK_PLAN 4
74257417
#define TK_BEGIN 5
@@ -7576,11 +7568,10 @@
75767568
#define TK_UMINUS 156
75777569
#define TK_UPLUS 157
75787570
75797571
/************** End of parse.h ***********************************************/
75807572
/************** Continuing where we left off in sqliteInt.h ******************/
7581
-#line 311 "tsrc/sqliteInt.h"
75827573
#include <stdio.h>
75837574
#include <stdlib.h>
75847575
#include <string.h>
75857576
#include <assert.h>
75867577
#include <stddef.h>
@@ -7920,11 +7911,10 @@
79207911
** "BusyHandler" typedefs. vdbe.h also requires a few of the opaque
79217912
** pointer types (i.e. FuncDef) defined above.
79227913
*/
79237914
/************** Include btree.h in the middle of sqliteInt.h *****************/
79247915
/************** Begin file btree.h *******************************************/
7925
-#line 1 "tsrc/btree.h"
79267916
/*
79277917
** 2001 September 15
79287918
**
79297919
** The author disclaims copyright to this source code. In place of
79307920
** a legal notice, here is a blessing:
@@ -8165,14 +8155,12 @@
81658155
81668156
#endif /* _BTREE_H_ */
81678157
81688158
/************** End of btree.h ***********************************************/
81698159
/************** Continuing where we left off in sqliteInt.h ******************/
8170
-#line 653 "tsrc/sqliteInt.h"
81718160
/************** Include vdbe.h in the middle of sqliteInt.h ******************/
81728161
/************** Begin file vdbe.h ********************************************/
8173
-#line 1 "tsrc/vdbe.h"
81748162
/*
81758163
** 2001 September 15
81768164
**
81778165
** The author disclaims copyright to this source code. In place of
81788166
** a legal notice, here is a blessing:
@@ -8333,11 +8321,10 @@
83338321
** The makefile scans the vdbe.c source file and creates the "opcodes.h"
83348322
** header file that defines a number for each opcode used by the VDBE.
83358323
*/
83368324
/************** Include opcodes.h in the middle of vdbe.h ********************/
83378325
/************** Begin file opcodes.h *****************************************/
8338
-#line 1 "tsrc/opcodes.h"
83398326
/* Automatically generated. Do not edit */
83408327
/* See the mkopcodeh.awk script for details */
83418328
#define OP_Goto 1
83428329
#define OP_Gosub 2
83438330
#define OP_Return 3
@@ -8387,108 +8374,109 @@
83878374
#define OP_Jump 25
83888375
#define OP_And 69 /* same as TK_AND */
83898376
#define OP_Or 68 /* same as TK_OR */
83908377
#define OP_Not 19 /* same as TK_NOT */
83918378
#define OP_BitNot 93 /* same as TK_BITNOT */
8392
-#define OP_If 26
8393
-#define OP_IfNot 27
8379
+#define OP_Once 26
8380
+#define OP_If 27
8381
+#define OP_IfNot 28
83948382
#define OP_IsNull 73 /* same as TK_ISNULL */
83958383
#define OP_NotNull 74 /* same as TK_NOTNULL */
8396
-#define OP_Column 28
8397
-#define OP_Affinity 29
8398
-#define OP_MakeRecord 30
8399
-#define OP_Count 31
8400
-#define OP_Savepoint 32
8401
-#define OP_AutoCommit 33
8402
-#define OP_Transaction 34
8403
-#define OP_ReadCookie 35
8404
-#define OP_SetCookie 36
8405
-#define OP_VerifyCookie 37
8406
-#define OP_OpenRead 38
8407
-#define OP_OpenWrite 39
8408
-#define OP_OpenAutoindex 40
8409
-#define OP_OpenEphemeral 41
8410
-#define OP_SorterOpen 42
8411
-#define OP_OpenPseudo 43
8412
-#define OP_Close 44
8413
-#define OP_SeekLt 45
8414
-#define OP_SeekLe 46
8415
-#define OP_SeekGe 47
8416
-#define OP_SeekGt 48
8417
-#define OP_Seek 49
8418
-#define OP_NotFound 50
8419
-#define OP_Found 51
8420
-#define OP_IsUnique 52
8421
-#define OP_NotExists 53
8422
-#define OP_Sequence 54
8423
-#define OP_NewRowid 55
8424
-#define OP_Insert 56
8425
-#define OP_InsertInt 57
8426
-#define OP_Delete 58
8427
-#define OP_ResetCount 59
8428
-#define OP_SorterCompare 60
8429
-#define OP_SorterData 61
8430
-#define OP_RowKey 62
8431
-#define OP_RowData 63
8432
-#define OP_Rowid 64
8433
-#define OP_NullRow 65
8434
-#define OP_Last 66
8435
-#define OP_SorterSort 67
8436
-#define OP_Sort 70
8437
-#define OP_Rewind 71
8438
-#define OP_SorterNext 72
8439
-#define OP_Prev 81
8440
-#define OP_Next 92
8441
-#define OP_SorterInsert 95
8442
-#define OP_IdxInsert 96
8443
-#define OP_IdxDelete 97
8444
-#define OP_IdxRowid 98
8445
-#define OP_IdxLT 99
8446
-#define OP_IdxGE 100
8447
-#define OP_Destroy 101
8448
-#define OP_Clear 102
8449
-#define OP_CreateIndex 103
8450
-#define OP_CreateTable 104
8451
-#define OP_ParseSchema 105
8452
-#define OP_LoadAnalysis 106
8453
-#define OP_DropTable 107
8454
-#define OP_DropIndex 108
8455
-#define OP_DropTrigger 109
8456
-#define OP_IntegrityCk 110
8457
-#define OP_RowSetAdd 111
8458
-#define OP_RowSetRead 112
8459
-#define OP_RowSetTest 113
8460
-#define OP_Program 114
8461
-#define OP_Param 115
8462
-#define OP_FkCounter 116
8463
-#define OP_FkIfZero 117
8464
-#define OP_MemMax 118
8465
-#define OP_IfPos 119
8466
-#define OP_IfNeg 120
8467
-#define OP_IfZero 121
8468
-#define OP_AggStep 122
8469
-#define OP_AggFinal 123
8470
-#define OP_Checkpoint 124
8471
-#define OP_JournalMode 125
8472
-#define OP_Vacuum 126
8473
-#define OP_IncrVacuum 127
8474
-#define OP_Expire 128
8475
-#define OP_TableLock 129
8476
-#define OP_VBegin 131
8477
-#define OP_VCreate 132
8478
-#define OP_VDestroy 133
8479
-#define OP_VOpen 134
8480
-#define OP_VFilter 135
8481
-#define OP_VColumn 136
8482
-#define OP_VNext 137
8483
-#define OP_VRename 138
8484
-#define OP_VUpdate 139
8485
-#define OP_Pagecount 140
8486
-#define OP_MaxPgcnt 146
8487
-#define OP_Trace 147
8488
-#define OP_Noop 148
8489
-#define OP_Explain 149
8384
+#define OP_Column 29
8385
+#define OP_Affinity 30
8386
+#define OP_MakeRecord 31
8387
+#define OP_Count 32
8388
+#define OP_Savepoint 33
8389
+#define OP_AutoCommit 34
8390
+#define OP_Transaction 35
8391
+#define OP_ReadCookie 36
8392
+#define OP_SetCookie 37
8393
+#define OP_VerifyCookie 38
8394
+#define OP_OpenRead 39
8395
+#define OP_OpenWrite 40
8396
+#define OP_OpenAutoindex 41
8397
+#define OP_OpenEphemeral 42
8398
+#define OP_SorterOpen 43
8399
+#define OP_OpenPseudo 44
8400
+#define OP_Close 45
8401
+#define OP_SeekLt 46
8402
+#define OP_SeekLe 47
8403
+#define OP_SeekGe 48
8404
+#define OP_SeekGt 49
8405
+#define OP_Seek 50
8406
+#define OP_NotFound 51
8407
+#define OP_Found 52
8408
+#define OP_IsUnique 53
8409
+#define OP_NotExists 54
8410
+#define OP_Sequence 55
8411
+#define OP_NewRowid 56
8412
+#define OP_Insert 57
8413
+#define OP_InsertInt 58
8414
+#define OP_Delete 59
8415
+#define OP_ResetCount 60
8416
+#define OP_SorterCompare 61
8417
+#define OP_SorterData 62
8418
+#define OP_RowKey 63
8419
+#define OP_RowData 64
8420
+#define OP_Rowid 65
8421
+#define OP_NullRow 66
8422
+#define OP_Last 67
8423
+#define OP_SorterSort 70
8424
+#define OP_Sort 71
8425
+#define OP_Rewind 72
8426
+#define OP_SorterNext 81
8427
+#define OP_Prev 92
8428
+#define OP_Next 95
8429
+#define OP_SorterInsert 96
8430
+#define OP_IdxInsert 97
8431
+#define OP_IdxDelete 98
8432
+#define OP_IdxRowid 99
8433
+#define OP_IdxLT 100
8434
+#define OP_IdxGE 101
8435
+#define OP_Destroy 102
8436
+#define OP_Clear 103
8437
+#define OP_CreateIndex 104
8438
+#define OP_CreateTable 105
8439
+#define OP_ParseSchema 106
8440
+#define OP_LoadAnalysis 107
8441
+#define OP_DropTable 108
8442
+#define OP_DropIndex 109
8443
+#define OP_DropTrigger 110
8444
+#define OP_IntegrityCk 111
8445
+#define OP_RowSetAdd 112
8446
+#define OP_RowSetRead 113
8447
+#define OP_RowSetTest 114
8448
+#define OP_Program 115
8449
+#define OP_Param 116
8450
+#define OP_FkCounter 117
8451
+#define OP_FkIfZero 118
8452
+#define OP_MemMax 119
8453
+#define OP_IfPos 120
8454
+#define OP_IfNeg 121
8455
+#define OP_IfZero 122
8456
+#define OP_AggStep 123
8457
+#define OP_AggFinal 124
8458
+#define OP_Checkpoint 125
8459
+#define OP_JournalMode 126
8460
+#define OP_Vacuum 127
8461
+#define OP_IncrVacuum 128
8462
+#define OP_Expire 129
8463
+#define OP_TableLock 131
8464
+#define OP_VBegin 132
8465
+#define OP_VCreate 133
8466
+#define OP_VDestroy 134
8467
+#define OP_VOpen 135
8468
+#define OP_VFilter 136
8469
+#define OP_VColumn 137
8470
+#define OP_VNext 138
8471
+#define OP_VRename 139
8472
+#define OP_VUpdate 140
8473
+#define OP_Pagecount 146
8474
+#define OP_MaxPgcnt 147
8475
+#define OP_Trace 148
8476
+#define OP_Noop 149
8477
+#define OP_Explain 150
84908478
84918479
84928480
/* Properties such as "out2" or "jump" that are specified in
84938481
** comments following the "case" for each opcode in the vdbe.c
84948482
** are encoded into bitvectors as follows:
@@ -8502,30 +8490,29 @@
85028490
#define OPFLG_OUT3 0x0040 /* out3: P3 is an output */
85038491
#define OPFLG_INITIALIZER {\
85048492
/* 0 */ 0x00, 0x01, 0x05, 0x04, 0x04, 0x10, 0x00, 0x02,\
85058493
/* 8 */ 0x02, 0x02, 0x02, 0x02, 0x02, 0x00, 0x24, 0x24,\
85068494
/* 16 */ 0x00, 0x00, 0x00, 0x24, 0x04, 0x05, 0x04, 0x00,\
8507
-/* 24 */ 0x00, 0x01, 0x05, 0x05, 0x00, 0x00, 0x00, 0x02,\
8508
-/* 32 */ 0x00, 0x00, 0x00, 0x02, 0x10, 0x00, 0x00, 0x00,\
8509
-/* 40 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x11, 0x11,\
8510
-/* 48 */ 0x11, 0x08, 0x11, 0x11, 0x11, 0x11, 0x02, 0x02,\
8511
-/* 56 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\
8512
-/* 64 */ 0x02, 0x00, 0x01, 0x01, 0x4c, 0x4c, 0x01, 0x01,\
8495
+/* 24 */ 0x00, 0x01, 0x05, 0x05, 0x05, 0x00, 0x00, 0x00,\
8496
+/* 32 */ 0x02, 0x00, 0x00, 0x00, 0x02, 0x10, 0x00, 0x00,\
8497
+/* 40 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x11,\
8498
+/* 48 */ 0x11, 0x11, 0x08, 0x11, 0x11, 0x11, 0x11, 0x02,\
8499
+/* 56 */ 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\
8500
+/* 64 */ 0x00, 0x02, 0x00, 0x01, 0x4c, 0x4c, 0x01, 0x01,\
85138501
/* 72 */ 0x01, 0x05, 0x05, 0x15, 0x15, 0x15, 0x15, 0x15,\
85148502
/* 80 */ 0x15, 0x01, 0x4c, 0x4c, 0x4c, 0x4c, 0x4c, 0x4c,\
8515
-/* 88 */ 0x4c, 0x4c, 0x4c, 0x4c, 0x01, 0x24, 0x02, 0x08,\
8516
-/* 96 */ 0x08, 0x00, 0x02, 0x01, 0x01, 0x02, 0x00, 0x02,\
8517
-/* 104 */ 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c,\
8518
-/* 112 */ 0x45, 0x15, 0x01, 0x02, 0x00, 0x01, 0x08, 0x05,\
8519
-/* 120 */ 0x05, 0x05, 0x00, 0x00, 0x00, 0x02, 0x00, 0x01,\
8520
-/* 128 */ 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x01,\
8521
-/* 136 */ 0x00, 0x01, 0x00, 0x00, 0x02, 0x04, 0x04, 0x04,\
8522
-/* 144 */ 0x04, 0x04, 0x02, 0x00, 0x00, 0x00,}
8503
+/* 88 */ 0x4c, 0x4c, 0x4c, 0x4c, 0x01, 0x24, 0x02, 0x01,\
8504
+/* 96 */ 0x08, 0x08, 0x00, 0x02, 0x01, 0x01, 0x02, 0x00,\
8505
+/* 104 */ 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\
8506
+/* 112 */ 0x0c, 0x45, 0x15, 0x01, 0x02, 0x00, 0x01, 0x08,\
8507
+/* 120 */ 0x05, 0x05, 0x05, 0x00, 0x00, 0x00, 0x02, 0x00,\
8508
+/* 128 */ 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00,\
8509
+/* 136 */ 0x01, 0x00, 0x01, 0x00, 0x00, 0x04, 0x04, 0x04,\
8510
+/* 144 */ 0x04, 0x04, 0x02, 0x02, 0x00, 0x00, 0x00,}
85238511
85248512
/************** End of opcodes.h *********************************************/
85258513
/************** Continuing where we left off in vdbe.h ***********************/
8526
-#line 164 "tsrc/vdbe.h"
85278514
85288515
/*
85298516
** Prototypes for the VDBE interface. See comments on the implementation
85308517
** for a description of what each of these routines does.
85318518
*/
@@ -8541,11 +8528,11 @@
85418528
SQLITE_PRIVATE void sqlite3VdbeChangeP1(Vdbe*, u32 addr, int P1);
85428529
SQLITE_PRIVATE void sqlite3VdbeChangeP2(Vdbe*, u32 addr, int P2);
85438530
SQLITE_PRIVATE void sqlite3VdbeChangeP3(Vdbe*, u32 addr, int P3);
85448531
SQLITE_PRIVATE void sqlite3VdbeChangeP5(Vdbe*, u8 P5);
85458532
SQLITE_PRIVATE void sqlite3VdbeJumpHere(Vdbe*, int addr);
8546
-SQLITE_PRIVATE void sqlite3VdbeChangeToNoop(Vdbe*, int addr, int N);
8533
+SQLITE_PRIVATE void sqlite3VdbeChangeToNoop(Vdbe*, int addr);
85478534
SQLITE_PRIVATE void sqlite3VdbeChangeP4(Vdbe*, int addr, const char *zP4, int N);
85488535
SQLITE_PRIVATE void sqlite3VdbeUsesBtree(Vdbe*, int);
85498536
SQLITE_PRIVATE VdbeOp *sqlite3VdbeGetOp(Vdbe*, int);
85508537
SQLITE_PRIVATE int sqlite3VdbeMakeLabel(Vdbe*);
85518538
SQLITE_PRIVATE void sqlite3VdbeRunOnlyOnce(Vdbe*);
@@ -8596,14 +8583,12 @@
85968583
85978584
#endif
85988585
85998586
/************** End of vdbe.h ************************************************/
86008587
/************** Continuing where we left off in sqliteInt.h ******************/
8601
-#line 654 "tsrc/sqliteInt.h"
86028588
/************** Include pager.h in the middle of sqliteInt.h *****************/
86038589
/************** Begin file pager.h *******************************************/
8604
-#line 1 "tsrc/pager.h"
86058590
/*
86068591
** 2001 September 15
86078592
**
86088593
** The author disclaims copyright to this source code. In place of
86098594
** a legal notice, here is a blessing:
@@ -8785,14 +8770,12 @@
87858770
87868771
#endif /* _PAGER_H_ */
87878772
87888773
/************** End of pager.h ***********************************************/
87898774
/************** Continuing where we left off in sqliteInt.h ******************/
8790
-#line 655 "tsrc/sqliteInt.h"
87918775
/************** Include pcache.h in the middle of sqliteInt.h ****************/
87928776
/************** Begin file pcache.h ******************************************/
8793
-#line 1 "tsrc/pcache.h"
87948777
/*
87958778
** 2008 August 05
87968779
**
87978780
** The author disclaims copyright to this source code. In place of
87988781
** a legal notice, here is a blessing:
@@ -8947,15 +8930,13 @@
89478930
89488931
#endif /* _PCACHE_H_ */
89498932
89508933
/************** End of pcache.h **********************************************/
89518934
/************** Continuing where we left off in sqliteInt.h ******************/
8952
-#line 656 "tsrc/sqliteInt.h"
89538935
89548936
/************** Include os.h in the middle of sqliteInt.h ********************/
89558937
/************** Begin file os.h **********************************************/
8956
-#line 1 "tsrc/os.h"
89578938
/*
89588939
** 2001 September 16
89598940
**
89608941
** The author disclaims copyright to this source code. In place of
89618942
** a legal notice, here is a blessing:
@@ -9234,14 +9215,12 @@
92349215
92359216
#endif /* _SQLITE_OS_H_ */
92369217
92379218
/************** End of os.h **************************************************/
92389219
/************** Continuing where we left off in sqliteInt.h ******************/
9239
-#line 658 "tsrc/sqliteInt.h"
92409220
/************** Include mutex.h in the middle of sqliteInt.h *****************/
92419221
/************** Begin file mutex.h *******************************************/
9242
-#line 1 "tsrc/mutex.h"
92439222
/*
92449223
** 2007 August 28
92459224
**
92469225
** The author disclaims copyright to this source code. In place of
92479226
** a legal notice, here is a blessing:
@@ -9312,11 +9291,10 @@
93129291
#define sqlite3MutexEnd()
93139292
#endif /* defined(SQLITE_MUTEX_OMIT) */
93149293
93159294
/************** End of mutex.h ***********************************************/
93169295
/************** Continuing where we left off in sqliteInt.h ******************/
9317
-#line 659 "tsrc/sqliteInt.h"
93189296
93199297
93209298
/*
93219299
** Each database file to be accessed by the system is an instance
93229300
** of the following structure. There are normally two of these structures
@@ -10509,11 +10487,12 @@
1050910487
char *zDatabase; /* Name of database holding this table */
1051010488
char *zName; /* Name of the table */
1051110489
char *zAlias; /* The "B" part of a "A AS B" phrase. zName is the "A" */
1051210490
Table *pTab; /* An SQL table corresponding to zName */
1051310491
Select *pSelect; /* A SELECT statement used in place of a table name */
10514
- u8 isPopulated; /* Temporary table associated with SELECT is populated */
10492
+ int addrFillSub; /* Address of subroutine to manifest a subquery */
10493
+ int regReturn; /* Register holding return address of addrFillSub */
1051510494
u8 jointype; /* Type of join between this able and the previous */
1051610495
u8 notIndexed; /* True if there is a NOT INDEXED clause */
1051710496
u8 isCorrelated; /* True if sub-query is correlated */
1051810497
#ifndef SQLITE_OMIT_EXPLAIN
1051910498
u8 iSelectId; /* If pSelect!=0, the id of the sub-select in EQP */
@@ -11915,11 +11894,10 @@
1191511894
1191611895
#endif /* _SQLITEINT_H_ */
1191711896
1191811897
/************** End of sqliteInt.h *******************************************/
1191911898
/************** Begin file global.c ******************************************/
11920
-#line 1 "tsrc/global.c"
1192111899
/*
1192211900
** 2008 June 13
1192311901
**
1192411902
** The author disclaims copyright to this source code. In place of
1192511903
** a legal notice, here is a blessing:
@@ -12138,11 +12116,10 @@
1213812116
*/
1213912117
SQLITE_PRIVATE const unsigned char sqlite3OpcodeProperty[] = OPFLG_INITIALIZER;
1214012118
1214112119
/************** End of global.c **********************************************/
1214212120
/************** Begin file ctime.c *******************************************/
12143
-#line 1 "tsrc/ctime.c"
1214412121
/*
1214512122
** 2010 February 23
1214612123
**
1214712124
** The author disclaims copyright to this source code. In place of
1214812125
** a legal notice, here is a blessing:
@@ -12543,11 +12520,10 @@
1254312520
1254412521
#endif /* SQLITE_OMIT_COMPILEOPTION_DIAGS */
1254512522
1254612523
/************** End of ctime.c ***********************************************/
1254712524
/************** Begin file status.c ******************************************/
12548
-#line 1 "tsrc/status.c"
1254912525
/*
1255012526
** 2008 June 18
1255112527
**
1255212528
** The author disclaims copyright to this source code. In place of
1255312529
** a legal notice, here is a blessing:
@@ -12561,11 +12537,10 @@
1256112537
** This module implements the sqlite3_status() interface and related
1256212538
** functionality.
1256312539
*/
1256412540
/************** Include vdbeInt.h in the middle of status.c ******************/
1256512541
/************** Begin file vdbeInt.h *****************************************/
12566
-#line 1 "tsrc/vdbeInt.h"
1256712542
/*
1256812543
** 2003 September 6
1256912544
**
1257012545
** The author disclaims copyright to this source code. In place of
1257112546
** a legal notice, here is a blessing:
@@ -13013,11 +12988,10 @@
1301312988
1301412989
#endif /* !defined(_VDBEINT_H_) */
1301512990
1301612991
/************** End of vdbeInt.h *********************************************/
1301712992
/************** Continuing where we left off in status.c *********************/
13018
-#line 18 "tsrc/status.c"
1301912993
1302012994
/*
1302112995
** Variables in which to record status information.
1302212996
*/
1302312997
typedef struct sqlite3StatType sqlite3StatType;
@@ -13227,11 +13201,10 @@
1322713201
return rc;
1322813202
}
1322913203
1323013204
/************** End of status.c **********************************************/
1323113205
/************** Begin file date.c ********************************************/
13232
-#line 1 "tsrc/date.c"
1323313206
/*
1323413207
** 2003 October 31
1323513208
**
1323613209
** The author disclaims copyright to this source code. In place of
1323713210
** a legal notice, here is a blessing:
@@ -14355,11 +14328,10 @@
1435514328
}
1435614329
}
1435714330
1435814331
/************** End of date.c ************************************************/
1435914332
/************** Begin file os.c **********************************************/
14360
-#line 1 "tsrc/os.c"
1436114333
/*
1436214334
** 2005 November 29
1436314335
**
1436414336
** The author disclaims copyright to this source code. In place of
1436514337
** a legal notice, here is a blessing:
@@ -14565,11 +14537,11 @@
1456514537
int flags,
1456614538
int *pOutFlags
1456714539
){
1456814540
int rc = SQLITE_NOMEM;
1456914541
sqlite3_file *pFile;
14570
- pFile = (sqlite3_file *)sqlite3Malloc(pVfs->szOsFile);
14542
+ pFile = (sqlite3_file *)sqlite3MallocZero(pVfs->szOsFile);
1457114543
if( pFile ){
1457214544
rc = sqlite3OsOpen(pVfs, zFile, pFile, flags, pOutFlags);
1457314545
if( rc!=SQLITE_OK ){
1457414546
sqlite3_free(pFile);
1457514547
}else{
@@ -14689,11 +14661,10 @@
1468914661
return SQLITE_OK;
1469014662
}
1469114663
1469214664
/************** End of os.c **************************************************/
1469314665
/************** Begin file fault.c *******************************************/
14694
-#line 1 "tsrc/fault.c"
1469514666
/*
1469614667
** 2008 Jan 22
1469714668
**
1469814669
** The author disclaims copyright to this source code. In place of
1469914670
** a legal notice, here is a blessing:
@@ -14779,11 +14750,10 @@
1477914750
1478014751
#endif /* #ifndef SQLITE_OMIT_BUILTIN_TEST */
1478114752
1478214753
/************** End of fault.c ***********************************************/
1478314754
/************** Begin file mem0.c ********************************************/
14784
-#line 1 "tsrc/mem0.c"
1478514755
/*
1478614756
** 2008 October 28
1478714757
**
1478814758
** The author disclaims copyright to this source code. In place of
1478914759
** a legal notice, here is a blessing:
@@ -14841,11 +14811,10 @@
1484114811
1484214812
#endif /* SQLITE_ZERO_MALLOC */
1484314813
1484414814
/************** End of mem0.c ************************************************/
1484514815
/************** Begin file mem1.c ********************************************/
14846
-#line 1 "tsrc/mem1.c"
1484714816
/*
1484814817
** 2007 August 14
1484914818
**
1485014819
** The author disclaims copyright to this source code. In place of
1485114820
** a legal notice, here is a blessing:
@@ -14994,11 +14963,10 @@
1499414963
1499514964
#endif /* SQLITE_SYSTEM_MALLOC */
1499614965
1499714966
/************** End of mem1.c ************************************************/
1499814967
/************** Begin file mem2.c ********************************************/
14999
-#line 1 "tsrc/mem2.c"
1500014968
/*
1500114969
** 2007 August 15
1500214970
**
1500314971
** The author disclaims copyright to this source code. In place of
1500414972
** a legal notice, here is a blessing:
@@ -15525,11 +15493,10 @@
1552515493
1552615494
#endif /* SQLITE_MEMDEBUG */
1552715495
1552815496
/************** End of mem2.c ************************************************/
1552915497
/************** Begin file mem3.c ********************************************/
15530
-#line 1 "tsrc/mem3.c"
1553115498
/*
1553215499
** 2007 October 14
1553315500
**
1553415501
** The author disclaims copyright to this source code. In place of
1553515502
** a legal notice, here is a blessing:
@@ -16215,11 +16182,10 @@
1621516182
1621616183
#endif /* SQLITE_ENABLE_MEMSYS3 */
1621716184
1621816185
/************** End of mem3.c ************************************************/
1621916186
/************** Begin file mem5.c ********************************************/
16220
-#line 1 "tsrc/mem5.c"
1622116187
/*
1622216188
** 2007 October 14
1622316189
**
1622416190
** The author disclaims copyright to this source code. In place of
1622516191
** a legal notice, here is a blessing:
@@ -16799,11 +16765,10 @@
1679916765
1680016766
#endif /* SQLITE_ENABLE_MEMSYS5 */
1680116767
1680216768
/************** End of mem5.c ************************************************/
1680316769
/************** Begin file mutex.c *******************************************/
16804
-#line 1 "tsrc/mutex.c"
1680516770
/*
1680616771
** 2007 August 14
1680716772
**
1680816773
** The author disclaims copyright to this source code. In place of
1680916774
** a legal notice, here is a blessing:
@@ -16955,11 +16920,10 @@
1695516920
1695616921
#endif /* SQLITE_MUTEX_OMIT */
1695716922
1695816923
/************** End of mutex.c ***********************************************/
1695916924
/************** Begin file mutex_noop.c **************************************/
16960
-#line 1 "tsrc/mutex_noop.c"
1696116925
/*
1696216926
** 2008 October 07
1696316927
**
1696416928
** The author disclaims copyright to this source code. In place of
1696516929
** a legal notice, here is a blessing:
@@ -17164,11 +17128,10 @@
1716417128
#endif /* SQLITE_MUTEX_NOOP */
1716517129
#endif /* SQLITE_MUTEX_OMIT */
1716617130
1716717131
/************** End of mutex_noop.c ******************************************/
1716817132
/************** Begin file mutex_os2.c ***************************************/
17169
-#line 1 "tsrc/mutex_os2.c"
1717017133
/*
1717117134
** 2007 August 28
1717217135
**
1717317136
** The author disclaims copyright to this source code. In place of
1717417137
** a legal notice, here is a blessing:
@@ -17441,11 +17404,10 @@
1744117404
}
1744217405
#endif /* SQLITE_MUTEX_OS2 */
1744317406
1744417407
/************** End of mutex_os2.c *******************************************/
1744517408
/************** Begin file mutex_unix.c **************************************/
17446
-#line 1 "tsrc/mutex_unix.c"
1744717409
/*
1744817410
** 2007 August 28
1744917411
**
1745017412
** The author disclaims copyright to this source code. In place of
1745117413
** a legal notice, here is a blessing:
@@ -17795,11 +17757,10 @@
1779517757
1779617758
#endif /* SQLITE_MUTEX_PTHREAD */
1779717759
1779817760
/************** End of mutex_unix.c ******************************************/
1779917761
/************** Begin file mutex_w32.c ***************************************/
17800
-#line 1 "tsrc/mutex_w32.c"
1780117762
/*
1780217763
** 2007 August 14
1780317764
**
1780417765
** The author disclaims copyright to this source code. In place of
1780517766
** a legal notice, here is a blessing:
@@ -18130,11 +18091,10 @@
1813018091
}
1813118092
#endif /* SQLITE_MUTEX_W32 */
1813218093
1813318094
/************** End of mutex_w32.c *******************************************/
1813418095
/************** Begin file malloc.c ******************************************/
18135
-#line 1 "tsrc/malloc.c"
1813618096
/*
1813718097
** 2001 September 15
1813818098
**
1813918099
** The author disclaims copyright to this source code. In place of
1814018100
** a legal notice, here is a blessing:
@@ -18910,11 +18870,10 @@
1891018870
return rc & (db ? db->errMask : 0xff);
1891118871
}
1891218872
1891318873
/************** End of malloc.c **********************************************/
1891418874
/************** Begin file printf.c ******************************************/
18915
-#line 1 "tsrc/printf.c"
1891618875
/*
1891718876
** The "printf" code that follows dates from the 1980's. It is in
1891818877
** the public domain. The original comments are included here for
1891918878
** completeness. They are very out-of-date but might be useful as
1892018879
** an historical reference. Most of the "enhancements" have been backed
@@ -19942,11 +19901,10 @@
1994219901
}
1994319902
#endif
1994419903
1994519904
/************** End of printf.c **********************************************/
1994619905
/************** Begin file random.c ******************************************/
19947
-#line 1 "tsrc/random.c"
1994819906
/*
1994919907
** 2001 September 15
1995019908
**
1995119909
** The author disclaims copyright to this source code. In place of
1995219910
** a legal notice, here is a blessing:
@@ -20090,11 +20048,10 @@
2009020048
}
2009120049
#endif /* SQLITE_OMIT_BUILTIN_TEST */
2009220050
2009320051
/************** End of random.c **********************************************/
2009420052
/************** Begin file utf.c *********************************************/
20095
-#line 1 "tsrc/utf.c"
2009620053
/*
2009720054
** 2004 April 13
2009820055
**
2009920056
** The author disclaims copyright to this source code. In place of
2010020057
** a legal notice, here is a blessing:
@@ -20652,11 +20609,10 @@
2065220609
#endif /* SQLITE_TEST */
2065320610
#endif /* SQLITE_OMIT_UTF16 */
2065420611
2065520612
/************** End of utf.c *************************************************/
2065620613
/************** Begin file util.c ********************************************/
20657
-#line 1 "tsrc/util.c"
2065820614
/*
2065920615
** 2001 September 15
2066020616
**
2066120617
** The author disclaims copyright to this source code. In place of
2066220618
** a legal notice, here is a blessing:
@@ -21835,11 +21791,10 @@
2183521791
}
2183621792
#endif
2183721793
2183821794
/************** End of util.c ************************************************/
2183921795
/************** Begin file hash.c ********************************************/
21840
-#line 1 "tsrc/hash.c"
2184121796
/*
2184221797
** 2001 September 22
2184321798
**
2184421799
** The author disclaims copyright to this source code. In place of
2184521800
** a legal notice, here is a blessing:
@@ -22115,11 +22070,10 @@
2211522070
return 0;
2211622071
}
2211722072
2211822073
/************** End of hash.c ************************************************/
2211922074
/************** Begin file opcodes.c *****************************************/
22120
-#line 1 "tsrc/opcodes.c"
2212122075
/* Automatically generated. Do not edit */
2212222076
/* See the mkopcodec.awk script for details. */
2212322077
#if !defined(SQLITE_OMIT_EXPLAIN) || !defined(NDEBUG) || defined(VDBE_PROFILE) || defined(SQLITE_DEBUG)
2212422078
SQLITE_PRIVATE const char *sqlite3OpcodeName(int i){
2212522079
static const char *const azName[] = { "?",
@@ -22146,66 +22100,66 @@
2214622100
/* 21 */ "MustBeInt",
2214722101
/* 22 */ "RealAffinity",
2214822102
/* 23 */ "Permutation",
2214922103
/* 24 */ "Compare",
2215022104
/* 25 */ "Jump",
22151
- /* 26 */ "If",
22152
- /* 27 */ "IfNot",
22153
- /* 28 */ "Column",
22154
- /* 29 */ "Affinity",
22155
- /* 30 */ "MakeRecord",
22156
- /* 31 */ "Count",
22157
- /* 32 */ "Savepoint",
22158
- /* 33 */ "AutoCommit",
22159
- /* 34 */ "Transaction",
22160
- /* 35 */ "ReadCookie",
22161
- /* 36 */ "SetCookie",
22162
- /* 37 */ "VerifyCookie",
22163
- /* 38 */ "OpenRead",
22164
- /* 39 */ "OpenWrite",
22165
- /* 40 */ "OpenAutoindex",
22166
- /* 41 */ "OpenEphemeral",
22167
- /* 42 */ "SorterOpen",
22168
- /* 43 */ "OpenPseudo",
22169
- /* 44 */ "Close",
22170
- /* 45 */ "SeekLt",
22171
- /* 46 */ "SeekLe",
22172
- /* 47 */ "SeekGe",
22173
- /* 48 */ "SeekGt",
22174
- /* 49 */ "Seek",
22175
- /* 50 */ "NotFound",
22176
- /* 51 */ "Found",
22177
- /* 52 */ "IsUnique",
22178
- /* 53 */ "NotExists",
22179
- /* 54 */ "Sequence",
22180
- /* 55 */ "NewRowid",
22181
- /* 56 */ "Insert",
22182
- /* 57 */ "InsertInt",
22183
- /* 58 */ "Delete",
22184
- /* 59 */ "ResetCount",
22185
- /* 60 */ "SorterCompare",
22186
- /* 61 */ "SorterData",
22187
- /* 62 */ "RowKey",
22188
- /* 63 */ "RowData",
22189
- /* 64 */ "Rowid",
22190
- /* 65 */ "NullRow",
22191
- /* 66 */ "Last",
22192
- /* 67 */ "SorterSort",
22105
+ /* 26 */ "Once",
22106
+ /* 27 */ "If",
22107
+ /* 28 */ "IfNot",
22108
+ /* 29 */ "Column",
22109
+ /* 30 */ "Affinity",
22110
+ /* 31 */ "MakeRecord",
22111
+ /* 32 */ "Count",
22112
+ /* 33 */ "Savepoint",
22113
+ /* 34 */ "AutoCommit",
22114
+ /* 35 */ "Transaction",
22115
+ /* 36 */ "ReadCookie",
22116
+ /* 37 */ "SetCookie",
22117
+ /* 38 */ "VerifyCookie",
22118
+ /* 39 */ "OpenRead",
22119
+ /* 40 */ "OpenWrite",
22120
+ /* 41 */ "OpenAutoindex",
22121
+ /* 42 */ "OpenEphemeral",
22122
+ /* 43 */ "SorterOpen",
22123
+ /* 44 */ "OpenPseudo",
22124
+ /* 45 */ "Close",
22125
+ /* 46 */ "SeekLt",
22126
+ /* 47 */ "SeekLe",
22127
+ /* 48 */ "SeekGe",
22128
+ /* 49 */ "SeekGt",
22129
+ /* 50 */ "Seek",
22130
+ /* 51 */ "NotFound",
22131
+ /* 52 */ "Found",
22132
+ /* 53 */ "IsUnique",
22133
+ /* 54 */ "NotExists",
22134
+ /* 55 */ "Sequence",
22135
+ /* 56 */ "NewRowid",
22136
+ /* 57 */ "Insert",
22137
+ /* 58 */ "InsertInt",
22138
+ /* 59 */ "Delete",
22139
+ /* 60 */ "ResetCount",
22140
+ /* 61 */ "SorterCompare",
22141
+ /* 62 */ "SorterData",
22142
+ /* 63 */ "RowKey",
22143
+ /* 64 */ "RowData",
22144
+ /* 65 */ "Rowid",
22145
+ /* 66 */ "NullRow",
22146
+ /* 67 */ "Last",
2219322147
/* 68 */ "Or",
2219422148
/* 69 */ "And",
22195
- /* 70 */ "Sort",
22196
- /* 71 */ "Rewind",
22197
- /* 72 */ "SorterNext",
22149
+ /* 70 */ "SorterSort",
22150
+ /* 71 */ "Sort",
22151
+ /* 72 */ "Rewind",
2219822152
/* 73 */ "IsNull",
2219922153
/* 74 */ "NotNull",
2220022154
/* 75 */ "Ne",
2220122155
/* 76 */ "Eq",
2220222156
/* 77 */ "Gt",
2220322157
/* 78 */ "Le",
2220422158
/* 79 */ "Lt",
2220522159
/* 80 */ "Ge",
22206
- /* 81 */ "Prev",
22160
+ /* 81 */ "SorterNext",
2220722161
/* 82 */ "BitAnd",
2220822162
/* 83 */ "BitOr",
2220922163
/* 84 */ "ShiftLeft",
2221022164
/* 85 */ "ShiftRight",
2221122165
/* 86 */ "Add",
@@ -22212,76 +22166,76 @@
2221222166
/* 87 */ "Subtract",
2221322167
/* 88 */ "Multiply",
2221422168
/* 89 */ "Divide",
2221522169
/* 90 */ "Remainder",
2221622170
/* 91 */ "Concat",
22217
- /* 92 */ "Next",
22171
+ /* 92 */ "Prev",
2221822172
/* 93 */ "BitNot",
2221922173
/* 94 */ "String8",
22220
- /* 95 */ "SorterInsert",
22221
- /* 96 */ "IdxInsert",
22222
- /* 97 */ "IdxDelete",
22223
- /* 98 */ "IdxRowid",
22224
- /* 99 */ "IdxLT",
22225
- /* 100 */ "IdxGE",
22226
- /* 101 */ "Destroy",
22227
- /* 102 */ "Clear",
22228
- /* 103 */ "CreateIndex",
22229
- /* 104 */ "CreateTable",
22230
- /* 105 */ "ParseSchema",
22231
- /* 106 */ "LoadAnalysis",
22232
- /* 107 */ "DropTable",
22233
- /* 108 */ "DropIndex",
22234
- /* 109 */ "DropTrigger",
22235
- /* 110 */ "IntegrityCk",
22236
- /* 111 */ "RowSetAdd",
22237
- /* 112 */ "RowSetRead",
22238
- /* 113 */ "RowSetTest",
22239
- /* 114 */ "Program",
22240
- /* 115 */ "Param",
22241
- /* 116 */ "FkCounter",
22242
- /* 117 */ "FkIfZero",
22243
- /* 118 */ "MemMax",
22244
- /* 119 */ "IfPos",
22245
- /* 120 */ "IfNeg",
22246
- /* 121 */ "IfZero",
22247
- /* 122 */ "AggStep",
22248
- /* 123 */ "AggFinal",
22249
- /* 124 */ "Checkpoint",
22250
- /* 125 */ "JournalMode",
22251
- /* 126 */ "Vacuum",
22252
- /* 127 */ "IncrVacuum",
22253
- /* 128 */ "Expire",
22254
- /* 129 */ "TableLock",
22174
+ /* 95 */ "Next",
22175
+ /* 96 */ "SorterInsert",
22176
+ /* 97 */ "IdxInsert",
22177
+ /* 98 */ "IdxDelete",
22178
+ /* 99 */ "IdxRowid",
22179
+ /* 100 */ "IdxLT",
22180
+ /* 101 */ "IdxGE",
22181
+ /* 102 */ "Destroy",
22182
+ /* 103 */ "Clear",
22183
+ /* 104 */ "CreateIndex",
22184
+ /* 105 */ "CreateTable",
22185
+ /* 106 */ "ParseSchema",
22186
+ /* 107 */ "LoadAnalysis",
22187
+ /* 108 */ "DropTable",
22188
+ /* 109 */ "DropIndex",
22189
+ /* 110 */ "DropTrigger",
22190
+ /* 111 */ "IntegrityCk",
22191
+ /* 112 */ "RowSetAdd",
22192
+ /* 113 */ "RowSetRead",
22193
+ /* 114 */ "RowSetTest",
22194
+ /* 115 */ "Program",
22195
+ /* 116 */ "Param",
22196
+ /* 117 */ "FkCounter",
22197
+ /* 118 */ "FkIfZero",
22198
+ /* 119 */ "MemMax",
22199
+ /* 120 */ "IfPos",
22200
+ /* 121 */ "IfNeg",
22201
+ /* 122 */ "IfZero",
22202
+ /* 123 */ "AggStep",
22203
+ /* 124 */ "AggFinal",
22204
+ /* 125 */ "Checkpoint",
22205
+ /* 126 */ "JournalMode",
22206
+ /* 127 */ "Vacuum",
22207
+ /* 128 */ "IncrVacuum",
22208
+ /* 129 */ "Expire",
2225522209
/* 130 */ "Real",
22256
- /* 131 */ "VBegin",
22257
- /* 132 */ "VCreate",
22258
- /* 133 */ "VDestroy",
22259
- /* 134 */ "VOpen",
22260
- /* 135 */ "VFilter",
22261
- /* 136 */ "VColumn",
22262
- /* 137 */ "VNext",
22263
- /* 138 */ "VRename",
22264
- /* 139 */ "VUpdate",
22265
- /* 140 */ "Pagecount",
22210
+ /* 131 */ "TableLock",
22211
+ /* 132 */ "VBegin",
22212
+ /* 133 */ "VCreate",
22213
+ /* 134 */ "VDestroy",
22214
+ /* 135 */ "VOpen",
22215
+ /* 136 */ "VFilter",
22216
+ /* 137 */ "VColumn",
22217
+ /* 138 */ "VNext",
22218
+ /* 139 */ "VRename",
22219
+ /* 140 */ "VUpdate",
2226622220
/* 141 */ "ToText",
2226722221
/* 142 */ "ToBlob",
2226822222
/* 143 */ "ToNumeric",
2226922223
/* 144 */ "ToInt",
2227022224
/* 145 */ "ToReal",
22271
- /* 146 */ "MaxPgcnt",
22272
- /* 147 */ "Trace",
22273
- /* 148 */ "Noop",
22274
- /* 149 */ "Explain",
22225
+ /* 146 */ "Pagecount",
22226
+ /* 147 */ "MaxPgcnt",
22227
+ /* 148 */ "Trace",
22228
+ /* 149 */ "Noop",
22229
+ /* 150 */ "Explain",
2227522230
};
2227622231
return azName[i];
2227722232
}
2227822233
#endif
2227922234
2228022235
/************** End of opcodes.c *********************************************/
2228122236
/************** Begin file os_os2.c ******************************************/
22282
-#line 1 "tsrc/os_os2.c"
2228322237
/*
2228422238
** 2006 Feb 14
2228522239
**
2228622240
** The author disclaims copyright to this source code. In place of
2228722241
** a legal notice, here is a blessing:
@@ -22334,11 +22288,10 @@
2233422288
/*
2233522289
** Include code that is common to all os_*.c files
2233622290
*/
2233722291
/************** Include os_common.h in the middle of os_os2.c ****************/
2233822292
/************** Begin file os_common.h ***************************************/
22339
-#line 1 "tsrc/os_common.h"
2234022293
/*
2234122294
** 2004 May 22
2234222295
**
2234322296
** The author disclaims copyright to this source code. In place of
2234422297
** a legal notice, here is a blessing:
@@ -22388,11 +22341,10 @@
2238822341
** hwtime.h contains inline assembler code for implementing
2238922342
** high-performance timing routines.
2239022343
*/
2239122344
/************** Include hwtime.h in the middle of os_common.h ****************/
2239222345
/************** Begin file hwtime.h ******************************************/
22393
-#line 1 "tsrc/hwtime.h"
2239422346
/*
2239522347
** 2008 May 27
2239622348
**
2239722349
** The author disclaims copyright to this source code. In place of
2239822350
** a legal notice, here is a blessing:
@@ -22477,11 +22429,10 @@
2247722429
2247822430
#endif /* !defined(_HWTIME_H_) */
2247922431
2248022432
/************** End of hwtime.h **********************************************/
2248122433
/************** Continuing where we left off in os_common.h ******************/
22482
-#line 53 "tsrc/os_common.h"
2248322434
2248422435
static sqlite_uint64 g_start;
2248522436
static sqlite_uint64 g_elapsed;
2248622437
#define TIMER_START g_start=sqlite3Hwtime()
2248722438
#define TIMER_END g_elapsed=sqlite3Hwtime()-g_start
@@ -22544,11 +22495,10 @@
2254422495
2254522496
#endif /* !defined(_OS_COMMON_H_) */
2254622497
2254722498
/************** End of os_common.h *******************************************/
2254822499
/************** Continuing where we left off in os_os2.c *********************/
22549
-#line 57 "tsrc/os_os2.c"
2255022500
2255122501
/* Forward references */
2255222502
typedef struct os2File os2File; /* The file structure */
2255322503
typedef struct os2ShmNode os2ShmNode; /* A shared descritive memory node */
2255422504
typedef struct os2ShmLink os2ShmLink; /* A connection to shared-memory */
@@ -24416,11 +24366,10 @@
2441624366
2441724367
#endif /* SQLITE_OS_OS2 */
2441824368
2441924369
/************** End of os_os2.c **********************************************/
2442024370
/************** Begin file os_unix.c *****************************************/
24421
-#line 1 "tsrc/os_unix.c"
2442224371
/*
2442324372
** 2004 May 22
2442424373
**
2442524374
** The author disclaims copyright to this source code. In place of
2442624375
** a legal notice, here is a blessing:
@@ -24681,11 +24630,10 @@
2468124630
/*
2468224631
** Include code that is common to all os_*.c files
2468324632
*/
2468424633
/************** Include os_common.h in the middle of os_unix.c ***************/
2468524634
/************** Begin file os_common.h ***************************************/
24686
-#line 1 "tsrc/os_common.h"
2468724635
/*
2468824636
** 2004 May 22
2468924637
**
2469024638
** The author disclaims copyright to this source code. In place of
2469124639
** a legal notice, here is a blessing:
@@ -24735,11 +24683,10 @@
2473524683
** hwtime.h contains inline assembler code for implementing
2473624684
** high-performance timing routines.
2473724685
*/
2473824686
/************** Include hwtime.h in the middle of os_common.h ****************/
2473924687
/************** Begin file hwtime.h ******************************************/
24740
-#line 1 "tsrc/hwtime.h"
2474124688
/*
2474224689
** 2008 May 27
2474324690
**
2474424691
** The author disclaims copyright to this source code. In place of
2474524692
** a legal notice, here is a blessing:
@@ -24824,11 +24771,10 @@
2482424771
2482524772
#endif /* !defined(_HWTIME_H_) */
2482624773
2482724774
/************** End of hwtime.h **********************************************/
2482824775
/************** Continuing where we left off in os_common.h ******************/
24829
-#line 53 "tsrc/os_common.h"
2483024776
2483124777
static sqlite_uint64 g_start;
2483224778
static sqlite_uint64 g_elapsed;
2483324779
#define TIMER_START g_start=sqlite3Hwtime()
2483424780
#define TIMER_END g_elapsed=sqlite3Hwtime()-g_start
@@ -24891,11 +24837,10 @@
2489124837
2489224838
#endif /* !defined(_OS_COMMON_H_) */
2489324839
2489424840
/************** End of os_common.h *******************************************/
2489524841
/************** Continuing where we left off in os_unix.c ********************/
24896
-#line 265 "tsrc/os_unix.c"
2489724842
2489824843
/*
2489924844
** Define various macros that are missing from some systems.
2490024845
*/
2490124846
#ifndef O_LARGEFILE
@@ -31401,11 +31346,10 @@
3140131346
3140231347
#endif /* SQLITE_OS_UNIX */
3140331348
3140431349
/************** End of os_unix.c *********************************************/
3140531350
/************** Begin file os_win.c ******************************************/
31406
-#line 1 "tsrc/os_win.c"
3140731351
/*
3140831352
** 2004 May 22
3140931353
**
3141031354
** The author disclaims copyright to this source code. In place of
3141131355
** a legal notice, here is a blessing:
@@ -31463,11 +31407,10 @@
3146331407
/*
3146431408
** Include code that is common to all os_*.c files
3146531409
*/
3146631410
/************** Include os_common.h in the middle of os_win.c ****************/
3146731411
/************** Begin file os_common.h ***************************************/
31468
-#line 1 "tsrc/os_common.h"
3146931412
/*
3147031413
** 2004 May 22
3147131414
**
3147231415
** The author disclaims copyright to this source code. In place of
3147331416
** a legal notice, here is a blessing:
@@ -31517,11 +31460,10 @@
3151731460
** hwtime.h contains inline assembler code for implementing
3151831461
** high-performance timing routines.
3151931462
*/
3152031463
/************** Include hwtime.h in the middle of os_common.h ****************/
3152131464
/************** Begin file hwtime.h ******************************************/
31522
-#line 1 "tsrc/hwtime.h"
3152331465
/*
3152431466
** 2008 May 27
3152531467
**
3152631468
** The author disclaims copyright to this source code. In place of
3152731469
** a legal notice, here is a blessing:
@@ -31606,11 +31548,10 @@
3160631548
3160731549
#endif /* !defined(_HWTIME_H_) */
3160831550
3160931551
/************** End of hwtime.h **********************************************/
3161031552
/************** Continuing where we left off in os_common.h ******************/
31611
-#line 53 "tsrc/os_common.h"
3161231553
3161331554
static sqlite_uint64 g_start;
3161431555
static sqlite_uint64 g_elapsed;
3161531556
#define TIMER_START g_start=sqlite3Hwtime()
3161631557
#define TIMER_END g_elapsed=sqlite3Hwtime()-g_start
@@ -31673,11 +31614,10 @@
3167331614
3167431615
#endif /* !defined(_OS_COMMON_H_) */
3167531616
3167631617
/************** End of os_common.h *******************************************/
3167731618
/************** Continuing where we left off in os_win.c *********************/
31678
-#line 62 "tsrc/os_win.c"
3167931619
3168031620
/*
3168131621
** Some microsoft compilers lack this definition.
3168231622
*/
3168331623
#ifndef INVALID_FILE_ATTRIBUTES
@@ -32860,13 +32800,23 @@
3286032800
3286132801
/*
3286232802
** Make sure all writes to a particular file are committed to disk.
3286332803
*/
3286432804
static int winSync(sqlite3_file *id, int flags){
32865
-#if !defined(NDEBUG) || !defined(SQLITE_NO_SYNC) || defined(SQLITE_DEBUG)
32866
- winFile *pFile = (winFile*)id;
32805
+#ifndef SQLITE_NO_SYNC
32806
+ /*
32807
+ ** Used only when SQLITE_NO_SYNC is not defined.
32808
+ */
3286732809
BOOL rc;
32810
+#endif
32811
+#if !defined(NDEBUG) || !defined(SQLITE_NO_SYNC) || \
32812
+ (defined(SQLITE_TEST) && defined(SQLITE_DEBUG))
32813
+ /*
32814
+ ** Used when SQLITE_NO_SYNC is not defined and by the assert() and/or
32815
+ ** OSTRACE() macros.
32816
+ */
32817
+ winFile *pFile = (winFile*)id;
3286832818
#else
3286932819
UNUSED_PARAMETER(id);
3287032820
#endif
3287132821
3287232822
assert( pFile );
@@ -34809,11 +34759,10 @@
3480934759
3481034760
#endif /* SQLITE_OS_WIN */
3481134761
3481234762
/************** End of os_win.c **********************************************/
3481334763
/************** Begin file bitvec.c ******************************************/
34814
-#line 1 "tsrc/bitvec.c"
3481534764
/*
3481634765
** 2008 February 16
3481734766
**
3481834767
** The author disclaims copyright to this source code. In place of
3481934768
** a legal notice, here is a blessing:
@@ -35220,11 +35169,10 @@
3522035169
}
3522135170
#endif /* SQLITE_OMIT_BUILTIN_TEST */
3522235171
3522335172
/************** End of bitvec.c **********************************************/
3522435173
/************** Begin file pcache.c ******************************************/
35225
-#line 1 "tsrc/pcache.c"
3522635174
/*
3522735175
** 2008 August 05
3522835176
**
3522935177
** The author disclaims copyright to this source code. In place of
3523035178
** a legal notice, here is a blessing:
@@ -35817,11 +35765,10 @@
3581735765
}
3581835766
#endif
3581935767
3582035768
/************** End of pcache.c **********************************************/
3582135769
/************** Begin file pcache1.c *****************************************/
35822
-#line 1 "tsrc/pcache1.c"
3582335770
/*
3582435771
** 2008 November 05
3582535772
**
3582635773
** The author disclaims copyright to this source code. In place of
3582735774
** a legal notice, here is a blessing:
@@ -37034,11 +36981,10 @@
3703436981
}
3703536982
#endif
3703636983
3703736984
/************** End of pcache1.c *********************************************/
3703836985
/************** Begin file rowset.c ******************************************/
37039
-#line 1 "tsrc/rowset.c"
3704036986
/*
3704136987
** 2008 December 3
3704236988
**
3704336989
** The author disclaims copyright to this source code. In place of
3704436990
** a legal notice, here is a blessing:
@@ -37459,11 +37405,10 @@
3745937405
return 0;
3746037406
}
3746137407
3746237408
/************** End of rowset.c **********************************************/
3746337409
/************** Begin file pager.c *******************************************/
37464
-#line 1 "tsrc/pager.c"
3746537410
/*
3746637411
** 2001 September 15
3746737412
**
3746837413
** The author disclaims copyright to this source code. In place of
3746937414
** a legal notice, here is a blessing:
@@ -37483,11 +37428,10 @@
3748337428
** another is writing.
3748437429
*/
3748537430
#ifndef SQLITE_OMIT_DISKIO
3748637431
/************** Include wal.h in the middle of pager.c ***********************/
3748737432
/************** Begin file wal.h *********************************************/
37488
-#line 1 "tsrc/wal.h"
3748937433
/*
3749037434
** 2010 February 1
3749137435
**
3749237436
** The author disclaims copyright to this source code. In place of
3749337437
** a legal notice, here is a blessing:
@@ -37608,11 +37552,10 @@
3760837552
#endif /* ifndef SQLITE_OMIT_WAL */
3760937553
#endif /* _WAL_H_ */
3761037554
3761137555
/************** End of wal.h *************************************************/
3761237556
/************** Continuing where we left off in pager.c **********************/
37613
-#line 24 "tsrc/pager.c"
3761437557
3761537558
3761637559
/******************* NOTES ON THE DESIGN OF THE PAGER ************************
3761737560
**
3761837561
** This comment block describes invariants that hold when using a rollback
@@ -44422,11 +44365,10 @@
4442244365
4442344366
#endif /* SQLITE_OMIT_DISKIO */
4442444367
4442544368
/************** End of pager.c ***********************************************/
4442644369
/************** Begin file wal.c *********************************************/
44427
-#line 1 "tsrc/wal.c"
4442844370
/*
4442944371
** 2010 February 1
4443044372
**
4443144373
** The author disclaims copyright to this source code. In place of
4443244374
** a legal notice, here is a blessing:
@@ -47377,11 +47319,10 @@
4737747319
4737847320
#endif /* #ifndef SQLITE_OMIT_WAL */
4737947321
4738047322
/************** End of wal.c *************************************************/
4738147323
/************** Begin file btmutex.c *****************************************/
47382
-#line 1 "tsrc/btmutex.c"
4738347324
/*
4738447325
** 2007 August 27
4738547326
**
4738647327
** The author disclaims copyright to this source code. In place of
4738747328
** a legal notice, here is a blessing:
@@ -47397,11 +47338,10 @@
4739747338
** big and we want to break it down some. This packaged seemed like
4739847339
** a good breakout.
4739947340
*/
4740047341
/************** Include btreeInt.h in the middle of btmutex.c ****************/
4740147342
/************** Begin file btreeInt.h ****************************************/
47402
-#line 1 "tsrc/btreeInt.h"
4740347343
/*
4740447344
** 2004 April 6
4740547345
**
4740647346
** The author disclaims copyright to this source code. In place of
4740747347
** a legal notice, here is a blessing:
@@ -48043,11 +47983,10 @@
4804347983
#define get4byte sqlite3Get4byte
4804447984
#define put4byte sqlite3Put4byte
4804547985
4804647986
/************** End of btreeInt.h ********************************************/
4804747987
/************** Continuing where we left off in btmutex.c ********************/
48048
-#line 19 "tsrc/btmutex.c"
4804947988
#ifndef SQLITE_OMIT_SHARED_CACHE
4805047989
#if SQLITE_THREADSAFE
4805147990
4805247991
/*
4805347992
** Obtain the BtShared mutex associated with B-Tree handle p. Also,
@@ -48316,11 +48255,10 @@
4831648255
#endif /* if SQLITE_THREADSAFE */
4831748256
#endif /* ifndef SQLITE_OMIT_SHARED_CACHE */
4831848257
4831948258
/************** End of btmutex.c *********************************************/
4832048259
/************** Begin file btree.c *******************************************/
48321
-#line 1 "tsrc/btree.c"
4832248260
/*
4832348261
** 2004 April 6
4832448262
**
4832548263
** The author disclaims copyright to this source code. In place of
4832648264
** a legal notice, here is a blessing:
@@ -48982,11 +48920,11 @@
4898248920
assert( nKey==(i64)(int)nKey );
4898348921
pIdxKey = sqlite3VdbeAllocUnpackedRecord(
4898448922
pCur->pKeyInfo, aSpace, sizeof(aSpace), &pFree
4898548923
);
4898648924
if( pIdxKey==0 ) return SQLITE_NOMEM;
48987
- sqlite3VdbeRecordUnpack(pCur->pKeyInfo, nKey, pKey, pIdxKey);
48925
+ sqlite3VdbeRecordUnpack(pCur->pKeyInfo, (int)nKey, pKey, pIdxKey);
4898848926
}else{
4898948927
pIdxKey = 0;
4899048928
}
4899148929
rc = sqlite3BtreeMovetoUnpacked(pCur, pIdxKey, nKey, bias, pRes);
4899248930
if( pFree ){
@@ -56504,11 +56442,10 @@
5650456442
return rc;
5650556443
}
5650656444
5650756445
/************** End of btree.c ***********************************************/
5650856446
/************** Begin file backup.c ******************************************/
56509
-#line 1 "tsrc/backup.c"
5651056447
/*
5651156448
** 2009 January 28
5651256449
**
5651356450
** The author disclaims copyright to this source code. In place of
5651456451
** a legal notice, here is a blessing:
@@ -57211,11 +57148,10 @@
5721157148
}
5721257149
#endif /* SQLITE_OMIT_VACUUM */
5721357150
5721457151
/************** End of backup.c **********************************************/
5721557152
/************** Begin file vdbemem.c *****************************************/
57216
-#line 1 "tsrc/vdbemem.c"
5721757153
/*
5721857154
** 2004 May 26
5721957155
**
5722057156
** The author disclaims copyright to this source code. In place of
5722157157
** a legal notice, here is a blessing:
@@ -58366,11 +58302,10 @@
5836658302
return 0;
5836758303
}
5836858304
5836958305
/************** End of vdbemem.c *********************************************/
5837058306
/************** Begin file vdbeaux.c *****************************************/
58371
-#line 1 "tsrc/vdbeaux.c"
5837258307
/*
5837358308
** 2003 September 6
5837458309
**
5837558310
** The author disclaims copyright to this source code. In place of
5837658311
** a legal notice, here is a blessing:
@@ -59037,22 +58972,19 @@
5903758972
p->pNext = pVdbe->pProgram;
5903858973
pVdbe->pProgram = p;
5903958974
}
5904058975
5904158976
/*
59042
-** Change N opcodes starting at addr to No-ops.
58977
+** Change the opcode at addr into OP_Noop
5904358978
*/
59044
-SQLITE_PRIVATE void sqlite3VdbeChangeToNoop(Vdbe *p, int addr, int N){
58979
+SQLITE_PRIVATE void sqlite3VdbeChangeToNoop(Vdbe *p, int addr){
5904558980
if( p->aOp ){
5904658981
VdbeOp *pOp = &p->aOp[addr];
5904758982
sqlite3 *db = p->db;
59048
- while( N-- ){
59049
- freeP4(db, pOp->p4type, pOp->p4.p);
59050
- memset(pOp, 0, sizeof(pOp[0]));
59051
- pOp->opcode = OP_Noop;
59052
- pOp++;
59053
- }
58983
+ freeP4(db, pOp->p4type, pOp->p4.p);
58984
+ memset(pOp, 0, sizeof(pOp[0]));
58985
+ pOp->opcode = OP_Noop;
5905458986
}
5905558987
}
5905658988
5905758989
/*
5905858990
** Change the value of the P4 operand for a specific instruction.
@@ -59204,11 +59136,11 @@
5920459136
** check the value of p->nOp-1 before continuing.
5920559137
*/
5920659138
SQLITE_PRIVATE VdbeOp *sqlite3VdbeGetOp(Vdbe *p, int addr){
5920759139
/* C89 specifies that the constant "dummy" will be initialized to all
5920859140
** zeros, which is correct. MSVC generates a warning, nevertheless. */
59209
- static const VdbeOp dummy; /* Ignore the MSVC warning about no initializer */
59141
+ static VdbeOp dummy; /* Ignore the MSVC warning about no initializer */
5921059142
assert( p->magic==VDBE_MAGIC_INIT );
5921159143
if( addr<0 ){
5921259144
#ifdef SQLITE_OMIT_TRACE
5921359145
if( p->nOp==0 ) return (VdbeOp*)&dummy;
5921459146
#endif
@@ -61609,11 +61541,10 @@
6160961541
}
6161061542
}
6161161543
6161261544
/************** End of vdbeaux.c *********************************************/
6161361545
/************** Begin file vdbeapi.c *****************************************/
61614
-#line 1 "tsrc/vdbeapi.c"
6161561546
/*
6161661547
** 2004 May 26
6161761548
**
6161861549
** The author disclaims copyright to this source code. In place of
6161961550
** a legal notice, here is a blessing:
@@ -62917,11 +62848,10 @@
6291762848
return v;
6291862849
}
6291962850
6292062851
/************** End of vdbeapi.c *********************************************/
6292162852
/************** Begin file vdbetrace.c ***************************************/
62922
-#line 1 "tsrc/vdbetrace.c"
6292362853
/*
6292462854
** 2009 November 25
6292562855
**
6292662856
** The author disclaims copyright to this source code. In place of
6292762857
** a legal notice, here is a blessing:
@@ -63073,11 +63003,10 @@
6307363003
6307463004
#endif /* #ifndef SQLITE_OMIT_TRACE */
6307563005
6307663006
/************** End of vdbetrace.c *******************************************/
6307763007
/************** Begin file vdbe.c ********************************************/
63078
-#line 1 "tsrc/vdbe.c"
6307963008
/*
6308063009
** 2001 September 15
6308163010
**
6308263011
** The author disclaims copyright to this source code. In place of
6308363012
** a legal notice, here is a blessing:
@@ -63543,11 +63472,10 @@
6354363472
** hwtime.h contains inline assembler code for implementing
6354463473
** high-performance timing routines.
6354563474
*/
6354663475
/************** Include hwtime.h in the middle of vdbe.c *********************/
6354763476
/************** Begin file hwtime.h ******************************************/
63548
-#line 1 "tsrc/hwtime.h"
6354963477
/*
6355063478
** 2008 May 27
6355163479
**
6355263480
** The author disclaims copyright to this source code. In place of
6355363481
** a legal notice, here is a blessing:
@@ -63632,11 +63560,10 @@
6363263560
6363363561
#endif /* !defined(_HWTIME_H_) */
6363463562
6363563563
/************** End of hwtime.h **********************************************/
6363663564
/************** Continuing where we left off in vdbe.c ***********************/
63637
-#line 471 "tsrc/vdbe.c"
6363863565
6363963566
#endif
6364063567
6364163568
/*
6364263569
** The CHECK_FOR_INTERRUPT macro defined here looks to see if the
@@ -65627,10 +65554,20 @@
6562765554
sqlite3VdbeMemSetInt64(pOut, ~sqlite3VdbeIntValue(pIn1));
6562865555
}
6562965556
break;
6563065557
}
6563165558
65559
+/* Opcode: Once P1 P2 * * *
65560
+**
65561
+** Jump to P2 if the value in register P1 is a not null or zero. If
65562
+** the value is NULL or zero, fall through and change the P1 register
65563
+** to an integer 1.
65564
+**
65565
+** When P1 is not used otherwise in a program, this opcode falls through
65566
+** once and jumps on all subsequent invocations. It is the equivalent
65567
+** of "OP_If P1 P2", followed by "OP_Integer 1 P1".
65568
+*/
6563265569
/* Opcode: If P1 P2 P3 * *
6563365570
**
6563465571
** Jump to P2 if the value in register P1 is true. The value
6563565572
** is considered true if it is numeric and non-zero. If the value
6563665573
** in P1 is NULL then take the jump if P3 is true.
@@ -65639,10 +65576,11 @@
6563965576
**
6564065577
** Jump to P2 if the value in register P1 is False. The value
6564165578
** is considered true if it has a numeric value of zero. If the value
6564265579
** in P1 is NULL then take the jump if P3 is true.
6564365580
*/
65581
+case OP_Once: /* jump, in1 */
6564465582
case OP_If: /* jump, in1 */
6564565583
case OP_IfNot: { /* jump, in1 */
6564665584
#if 0 /* local variables moved into u.al */
6564765585
int c;
6564865586
#endif /* local variables moved into u.al */
@@ -65657,10 +65595,16 @@
6565765595
#endif
6565865596
if( pOp->opcode==OP_IfNot ) u.al.c = !u.al.c;
6565965597
}
6566065598
if( u.al.c ){
6566165599
pc = pOp->p2-1;
65600
+ }else if( pOp->opcode==OP_Once ){
65601
+ assert( (pIn1->flags & (MEM_Agg|MEM_Dyn|MEM_RowSet|MEM_Frame))==0 );
65602
+ memAboutToChange(p, pIn1);
65603
+ pIn1->flags = MEM_Int;
65604
+ pIn1->u.i = 1;
65605
+ REGISTER_TRACE(pOp->p1, pIn1);
6566265606
}
6566365607
break;
6566465608
}
6566565609
6566665610
/* Opcode: IsNull P1 P2 * * *
@@ -69860,11 +69804,10 @@
6986069804
goto vdbe_error_halt;
6986169805
}
6986269806
6986369807
/************** End of vdbe.c ************************************************/
6986469808
/************** Begin file vdbeblob.c ****************************************/
69865
-#line 1 "tsrc/vdbeblob.c"
6986669809
/*
6986769810
** 2007 May 1
6986869811
**
6986969812
** The author disclaims copyright to this source code. In place of
6987069813
** a legal notice, here is a blessing:
@@ -70134,21 +70077,21 @@
7013470077
/* Make sure a mutex is held on the table to be accessed */
7013570078
sqlite3VdbeUsesBtree(v, iDb);
7013670079
7013770080
/* Configure the OP_TableLock instruction */
7013870081
#ifdef SQLITE_OMIT_SHARED_CACHE
70139
- sqlite3VdbeChangeToNoop(v, 2, 1);
70082
+ sqlite3VdbeChangeToNoop(v, 2);
7014070083
#else
7014170084
sqlite3VdbeChangeP1(v, 2, iDb);
7014270085
sqlite3VdbeChangeP2(v, 2, pTab->tnum);
7014370086
sqlite3VdbeChangeP3(v, 2, flags);
7014470087
sqlite3VdbeChangeP4(v, 2, pTab->zName, P4_TRANSIENT);
7014570088
#endif
7014670089
7014770090
/* Remove either the OP_OpenWrite or OpenRead. Set the P2
7014870091
** parameter of the other to pTab->tnum. */
70149
- sqlite3VdbeChangeToNoop(v, 4 - flags, 1);
70092
+ sqlite3VdbeChangeToNoop(v, 4 - flags);
7015070093
sqlite3VdbeChangeP2(v, 3 + flags, pTab->tnum);
7015170094
sqlite3VdbeChangeP3(v, 3 + flags, iDb);
7015270095
7015370096
/* Configure the number of columns. Configure the cursor to
7015470097
** think that the table has one more column than it really
@@ -70331,11 +70274,10 @@
7033170274
7033270275
#endif /* #ifndef SQLITE_OMIT_INCRBLOB */
7033370276
7033470277
/************** End of vdbeblob.c ********************************************/
7033570278
/************** Begin file vdbesort.c ****************************************/
70336
-#line 1 "tsrc/vdbesort.c"
7033770279
/*
7033870280
** 2011 July 9
7033970281
**
7034070282
** The author disclaims copyright to this source code. In place of
7034170283
** a legal notice, here is a blessing:
@@ -70492,12 +70434,16 @@
7049270434
int rc; /* Return Code */
7049370435
int nRead; /* Number of bytes read */
7049470436
int nRec = 0; /* Size of record in bytes */
7049570437
int iOff = 0; /* Size of serialized size varint in bytes */
7049670438
70497
- nRead = pIter->iEof - pIter->iReadOff;
70498
- if( nRead>5 ) nRead = 5;
70439
+ assert( pIter->iEof>=pIter->iReadOff );
70440
+ if( pIter->iEof-pIter->iReadOff>5 ){
70441
+ nRead = 5;
70442
+ }else{
70443
+ nRead = (int)(pIter->iEof - pIter->iReadOff);
70444
+ }
7049970445
if( nRead<=0 ){
7050070446
/* This is an EOF condition */
7050170447
vdbeSorterIterZero(db, pIter);
7050270448
return SQLITE_OK;
7050370449
}
@@ -71211,11 +71157,10 @@
7121171157
7121271158
#endif /* #ifndef SQLITE_OMIT_MERGE_SORT */
7121371159
7121471160
/************** End of vdbesort.c ********************************************/
7121571161
/************** Begin file journal.c *****************************************/
71216
-#line 1 "tsrc/journal.c"
7121771162
/*
7121871163
** 2007 August 22
7121971164
**
7122071165
** The author disclaims copyright to this source code. In place of
7122171166
** a legal notice, here is a blessing:
@@ -71452,11 +71397,10 @@
7145271397
}
7145371398
#endif
7145471399
7145571400
/************** End of journal.c *********************************************/
7145671401
/************** Begin file memjournal.c **************************************/
71457
-#line 1 "tsrc/memjournal.c"
7145871402
/*
7145971403
** 2008 October 7
7146071404
**
7146171405
** The author disclaims copyright to this source code. In place of
7146271406
** a legal notice, here is a blessing:
@@ -71714,11 +71658,10 @@
7171471658
return sizeof(MemJournal);
7171571659
}
7171671660
7171771661
/************** End of memjournal.c ******************************************/
7171871662
/************** Begin file walker.c ******************************************/
71719
-#line 1 "tsrc/walker.c"
7172071663
/*
7172171664
** 2008 August 16
7172271665
**
7172371666
** The author disclaims copyright to this source code. In place of
7172471667
** a legal notice, here is a blessing:
@@ -71853,11 +71796,10 @@
7185371796
return rc & WRC_Abort;
7185471797
}
7185571798
7185671799
/************** End of walker.c **********************************************/
7185771800
/************** Begin file resolve.c *****************************************/
71858
-#line 1 "tsrc/resolve.c"
7185971801
/*
7186071802
** 2008 August 18
7186171803
**
7186271804
** The author disclaims copyright to this source code. In place of
7186371805
** a legal notice, here is a blessing:
@@ -73074,11 +73016,10 @@
7307473016
sqlite3WalkSelect(&w, p);
7307573017
}
7307673018
7307773019
/************** End of resolve.c *********************************************/
7307873020
/************** Begin file expr.c ********************************************/
73079
-#line 1 "tsrc/expr.c"
7308073021
/*
7308173022
** 2001 September 15
7308273023
**
7308373024
** The author disclaims copyright to this source code. In place of
7308473025
** a legal notice, here is a blessing:
@@ -73977,11 +73918,12 @@
7397773918
pNewItem->zDatabase = sqlite3DbStrDup(db, pOldItem->zDatabase);
7397873919
pNewItem->zName = sqlite3DbStrDup(db, pOldItem->zName);
7397973920
pNewItem->zAlias = sqlite3DbStrDup(db, pOldItem->zAlias);
7398073921
pNewItem->jointype = pOldItem->jointype;
7398173922
pNewItem->iCursor = pOldItem->iCursor;
73982
- pNewItem->isPopulated = pOldItem->isPopulated;
73923
+ pNewItem->addrFillSub = pOldItem->addrFillSub;
73924
+ pNewItem->regReturn = pOldItem->regReturn;
7398373925
pNewItem->isCorrelated = pOldItem->isCorrelated;
7398473926
pNewItem->zIndex = sqlite3DbStrDup(db, pOldItem->zIndex);
7398573927
pNewItem->notIndexed = pOldItem->notIndexed;
7398673928
pNewItem->pIndex = pOldItem->pIndex;
7398773929
pTab = pNewItem->pTab = pOldItem->pTab;
@@ -74537,12 +74479,11 @@
7453774479
assert(v);
7453874480
if( iCol<0 ){
7453974481
int iMem = ++pParse->nMem;
7454074482
int iAddr;
7454174483
74542
- iAddr = sqlite3VdbeAddOp1(v, OP_If, iMem);
74543
- sqlite3VdbeAddOp2(v, OP_Integer, 1, iMem);
74484
+ iAddr = sqlite3VdbeAddOp1(v, OP_Once, iMem);
7454474485
7454574486
sqlite3OpenTable(pParse, iTab, iDb, pTab, OP_OpenRead);
7454674487
eType = IN_INDEX_ROWID;
7454774488
7454874489
sqlite3VdbeJumpHere(v, iAddr);
@@ -74569,12 +74510,11 @@
7456974510
int iMem = ++pParse->nMem;
7457074511
int iAddr;
7457174512
char *pKey;
7457274513
7457374514
pKey = (char *)sqlite3IndexKeyinfo(pParse, pIdx);
74574
- iAddr = sqlite3VdbeAddOp1(v, OP_If, iMem);
74575
- sqlite3VdbeAddOp2(v, OP_Integer, 1, iMem);
74515
+ iAddr = sqlite3VdbeAddOp1(v, OP_Once, iMem);
7457674516
7457774517
sqlite3VdbeAddOp4(v, OP_OpenRead, iTab, pIdx->tnum, iDb,
7457874518
pKey,P4_KEYINFO_HANDOFF);
7457974519
VdbeComment((v, "%s", pIdx->zName));
7458074520
eType = IN_INDEX_INDEX;
@@ -74651,11 +74591,11 @@
7465174591
Parse *pParse, /* Parsing context */
7465274592
Expr *pExpr, /* The IN, SELECT, or EXISTS operator */
7465374593
int rMayHaveNull, /* Register that records whether NULLs exist in RHS */
7465474594
int isRowid /* If true, LHS of IN operator is a rowid */
7465574595
){
74656
- int testAddr = 0; /* One-time test address */
74596
+ int testAddr = -1; /* One-time test address */
7465774597
int rReg = 0; /* Register storing resulting */
7465874598
Vdbe *v = sqlite3GetVdbe(pParse);
7465974599
if( NEVER(v==0) ) return 0;
7466074600
sqlite3ExprCachePush(pParse);
7466174601
@@ -74669,19 +74609,17 @@
7466974609
** If all of the above are false, then we can run this code just once
7467074610
** save the results, and reuse the same result on subsequent invocations.
7467174611
*/
7467274612
if( !ExprHasAnyProperty(pExpr, EP_VarSelect) && !pParse->pTriggerTab ){
7467374613
int mem = ++pParse->nMem;
74674
- sqlite3VdbeAddOp1(v, OP_If, mem);
74675
- testAddr = sqlite3VdbeAddOp2(v, OP_Integer, 1, mem);
74676
- assert( testAddr>0 || pParse->db->mallocFailed );
74614
+ testAddr = sqlite3VdbeAddOp1(v, OP_Once, mem);
7467774615
}
7467874616
7467974617
#ifndef SQLITE_OMIT_EXPLAIN
7468074618
if( pParse->explain==2 ){
7468174619
char *zMsg = sqlite3MPrintf(
74682
- pParse->db, "EXECUTE %s%s SUBQUERY %d", testAddr?"":"CORRELATED ",
74620
+ pParse->db, "EXECUTE %s%s SUBQUERY %d", testAddr>=0?"":"CORRELATED ",
7468374621
pExpr->op==TK_IN?"LIST":"SCALAR", pParse->iNextSelectId
7468474622
);
7468574623
sqlite3VdbeAddOp4(v, OP_Explain, pParse->iSelectId, 0, 0, zMsg, P4_DYNAMIC);
7468674624
}
7468774625
#endif
@@ -74769,13 +74707,13 @@
7476974707
/* If the expression is not constant then we will need to
7477074708
** disable the test that was generated above that makes sure
7477174709
** this code only executes once. Because for a non-constant
7477274710
** expression we need to rerun this code each time.
7477374711
*/
74774
- if( testAddr && !sqlite3ExprIsConstant(pE2) ){
74775
- sqlite3VdbeChangeToNoop(v, testAddr-1, 2);
74776
- testAddr = 0;
74712
+ if( testAddr>=0 && !sqlite3ExprIsConstant(pE2) ){
74713
+ sqlite3VdbeChangeToNoop(v, testAddr);
74714
+ testAddr = -1;
7477774715
}
7477874716
7477974717
/* Evaluate the expression and insert it into the temp table */
7478074718
if( isRowid && sqlite3ExprIsInteger(pE2, &iValToIns) ){
7478174719
sqlite3VdbeAddOp3(v, OP_InsertInt, pExpr->iTable, r2, iValToIns);
@@ -74840,12 +74778,12 @@
7484074778
ExprSetIrreducible(pExpr);
7484174779
break;
7484274780
}
7484374781
}
7484474782
74845
- if( testAddr ){
74846
- sqlite3VdbeJumpHere(v, testAddr-1);
74783
+ if( testAddr>=0 ){
74784
+ sqlite3VdbeJumpHere(v, testAddr);
7484774785
}
7484874786
sqlite3ExprCachePop(pParse, 1);
7484974787
7485074788
return rReg;
7485174789
}
@@ -76835,11 +76773,10 @@
7683576773
}
7683676774
}
7683776775
7683876776
/************** End of expr.c ************************************************/
7683976777
/************** Begin file alter.c *******************************************/
76840
-#line 1 "tsrc/alter.c"
7684176778
/*
7684276779
** 2005 February 15
7684376780
**
7684476781
** The author disclaims copyright to this source code. In place of
7684576782
** a legal notice, here is a blessing:
@@ -77664,11 +77601,10 @@
7766477601
}
7766577602
#endif /* SQLITE_ALTER_TABLE */
7766677603
7766777604
/************** End of alter.c ***********************************************/
7766877605
/************** Begin file analyze.c *****************************************/
77669
-#line 1 "tsrc/analyze.c"
7767077606
/*
7767177607
** 2005 July 8
7767277608
**
7767377609
** The author disclaims copyright to this source code. In place of
7767477610
** a legal notice, here is a blessing:
@@ -78386,11 +78322,10 @@
7838678322
7838778323
#endif /* SQLITE_OMIT_ANALYZE */
7838878324
7838978325
/************** End of analyze.c *********************************************/
7839078326
/************** Begin file attach.c ******************************************/
78391
-#line 1 "tsrc/attach.c"
7839278327
/*
7839378328
** 2003 April 6
7839478329
**
7839578330
** The author disclaims copyright to this source code. In place of
7839678331
** a legal notice, here is a blessing:
@@ -78946,11 +78881,10 @@
7894678881
}
7894778882
#endif
7894878883
7894978884
/************** End of attach.c **********************************************/
7895078885
/************** Begin file auth.c ********************************************/
78951
-#line 1 "tsrc/auth.c"
7895278886
/*
7895378887
** 2003 January 11
7895478888
**
7895578889
** The author disclaims copyright to this source code. In place of
7895678890
** a legal notice, here is a blessing:
@@ -79198,11 +79132,10 @@
7919879132
7919979133
#endif /* SQLITE_OMIT_AUTHORIZATION */
7920079134
7920179135
/************** End of auth.c ************************************************/
7920279136
/************** Begin file build.c *******************************************/
79203
-#line 1 "tsrc/build.c"
7920479137
/*
7920579138
** 2001 September 15
7920679139
**
7920779140
** The author disclaims copyright to this source code. In place of
7920879141
** a legal notice, here is a blessing:
@@ -83002,11 +82935,10 @@
8300282935
return pKey;
8300382936
}
8300482937
8300582938
/************** End of build.c ***********************************************/
8300682939
/************** Begin file callback.c ****************************************/
83007
-#line 1 "tsrc/callback.c"
8300882940
/*
8300982941
** 2005 May 23
8301082942
**
8301182943
** The author disclaims copyright to this source code. In place of
8301282944
** a legal notice, here is a blessing:
@@ -83462,11 +83394,10 @@
8346283394
return p;
8346383395
}
8346483396
8346583397
/************** End of callback.c ********************************************/
8346683398
/************** Begin file delete.c ******************************************/
83467
-#line 1 "tsrc/delete.c"
8346883399
/*
8346983400
** 2001 September 15
8347083401
**
8347183402
** The author disclaims copyright to this source code. In place of
8347283403
** a legal notice, here is a blessing:
@@ -84117,11 +84048,10 @@
8411784048
return regBase;
8411884049
}
8411984050
8412084051
/************** End of delete.c **********************************************/
8412184052
/************** Begin file func.c ********************************************/
84122
-#line 1 "tsrc/func.c"
8412384053
/*
8412484054
** 2002 February 23
8412584055
**
8412684056
** The author disclaims copyright to this source code. In place of
8412784057
** a legal notice, here is a blessing:
@@ -85726,11 +85656,10 @@
8572685656
#endif
8572785657
}
8572885658
8572985659
/************** End of func.c ************************************************/
8573085660
/************** Begin file fkey.c ********************************************/
85731
-#line 1 "tsrc/fkey.c"
8573285661
/*
8573385662
**
8573485663
** The author disclaims copyright to this source code. In place of
8573585664
** a legal notice, here is a blessing:
8573685665
**
@@ -86947,11 +86876,10 @@
8694786876
}
8694886877
#endif /* ifndef SQLITE_OMIT_FOREIGN_KEY */
8694986878
8695086879
/************** End of fkey.c ************************************************/
8695186880
/************** Begin file insert.c ******************************************/
86952
-#line 1 "tsrc/insert.c"
8695386881
/*
8695486882
** 2001 September 15
8695586883
**
8695686884
** The author disclaims copyright to this source code. In place of
8695786885
** a legal notice, here is a blessing:
@@ -88793,11 +88721,10 @@
8879388721
}
8879488722
#endif /* SQLITE_OMIT_XFER_OPT */
8879588723
8879688724
/************** End of insert.c **********************************************/
8879788725
/************** Begin file legacy.c ******************************************/
88798
-#line 1 "tsrc/legacy.c"
8879988726
/*
8880088727
** 2001 September 15
8880188728
**
8880288729
** The author disclaims copyright to this source code. In place of
8880388730
** a legal notice, here is a blessing:
@@ -88941,11 +88868,10 @@
8894188868
return rc;
8894288869
}
8894388870
8894488871
/************** End of legacy.c **********************************************/
8894588872
/************** Begin file loadext.c *****************************************/
88946
-#line 1 "tsrc/loadext.c"
8894788873
/*
8894888874
** 2006 June 7
8894988875
**
8895088876
** The author disclaims copyright to this source code. In place of
8895188877
** a legal notice, here is a blessing:
@@ -88962,11 +88888,10 @@
8896288888
#ifndef SQLITE_CORE
8896388889
#define SQLITE_CORE 1 /* Disable the API redefinition in sqlite3ext.h */
8896488890
#endif
8896588891
/************** Include sqlite3ext.h in the middle of loadext.c **************/
8896688892
/************** Begin file sqlite3ext.h **************************************/
88967
-#line 1 "tsrc/sqlite3ext.h"
8896888893
/*
8896988894
** 2006 June 7
8897088895
**
8897188896
** The author disclaims copyright to this source code. In place of
8897288897
** a legal notice, here is a blessing:
@@ -89391,11 +89316,10 @@
8939189316
8939289317
#endif /* _SQLITE3EXT_H_ */
8939389318
8939489319
/************** End of sqlite3ext.h ******************************************/
8939589320
/************** Continuing where we left off in loadext.c ********************/
89396
-#line 20 "tsrc/loadext.c"
8939789321
/* #include <string.h> */
8939889322
8939989323
#ifndef SQLITE_OMIT_LOAD_EXTENSION
8940089324
8940189325
/*
@@ -90031,11 +89955,10 @@
9003189955
}
9003289956
}
9003389957
9003489958
/************** End of loadext.c *********************************************/
9003589959
/************** Begin file pragma.c ******************************************/
90036
-#line 1 "tsrc/pragma.c"
9003789960
/*
9003889961
** 2003 April 6
9003989962
**
9004089963
** The author disclaims copyright to this source code. In place of
9004189964
** a legal notice, here is a blessing:
@@ -91560,11 +91483,10 @@
9156091483
9156191484
#endif /* SQLITE_OMIT_PRAGMA */
9156291485
9156391486
/************** End of pragma.c **********************************************/
9156491487
/************** Begin file prepare.c *****************************************/
91565
-#line 1 "tsrc/prepare.c"
9156691488
/*
9156791489
** 2005 May 25
9156891490
**
9156991491
** The author disclaims copyright to this source code. In place of
9157091492
** a legal notice, here is a blessing:
@@ -92421,11 +92343,10 @@
9242192343
9242292344
#endif /* SQLITE_OMIT_UTF16 */
9242392345
9242492346
/************** End of prepare.c *********************************************/
9242592347
/************** Begin file select.c ******************************************/
92426
-#line 1 "tsrc/select.c"
9242792348
/*
9242892349
** 2001 September 15
9242992350
**
9243092351
** The author disclaims copyright to this source code. In place of
9243192352
** a legal notice, here is a blessing:
@@ -92512,10 +92433,12 @@
9251292433
pNew->addrOpenEphm[2] = -1;
9251392434
if( db->mallocFailed ) {
9251492435
clearSelect(db, pNew);
9251592436
if( pNew!=&standin ) sqlite3DbFree(db, pNew);
9251692437
pNew = 0;
92438
+ }else{
92439
+ assert( pNew->pSrc!=0 || pParse->nErr>0 );
9251792440
}
9251892441
return pNew;
9251992442
}
9252092443
9252192444
/*
@@ -96224,11 +96147,15 @@
9622496147
struct SrcList_item *pItem = &pTabList->a[i];
9622596148
SelectDest dest;
9622696149
Select *pSub = pItem->pSelect;
9622796150
int isAggSub;
9622896151
96229
- if( pSub==0 || pItem->isPopulated ) continue;
96152
+ if( pSub==0 ) continue;
96153
+ if( pItem->addrFillSub ){
96154
+ sqlite3VdbeAddOp2(v, OP_Gosub, pItem->regReturn, pItem->addrFillSub);
96155
+ continue;
96156
+ }
9623096157
9623196158
/* Increment Parse.nHeight by the height of the largest expression
9623296159
** tree refered to by this, the parent select. The child select
9623396160
** may contain expression trees of at most
9623496161
** (SQLITE_MAX_EXPR_DEPTH-Parse.nHeight) height. This is a bit
@@ -96235,25 +96162,48 @@
9623596162
** more conservative than necessary, but much easier than enforcing
9623696163
** an exact limit.
9623796164
*/
9623896165
pParse->nHeight += sqlite3SelectExprHeight(p);
9623996166
96240
- /* Check to see if the subquery can be absorbed into the parent. */
9624196167
isAggSub = (pSub->selFlags & SF_Aggregate)!=0;
9624296168
if( flattenSubquery(pParse, p, i, isAgg, isAggSub) ){
96169
+ /* This subquery can be absorbed into its parent. */
9624396170
if( isAggSub ){
9624496171
isAgg = 1;
9624596172
p->selFlags |= SF_Aggregate;
9624696173
}
9624796174
i = -1;
9624896175
}else{
96176
+ /* Generate a subroutine that will fill an ephemeral table with
96177
+ ** the content of this subquery. pItem->addrFillSub will point
96178
+ ** to the address of the generated subroutine. pItem->regReturn
96179
+ ** is a register allocated to hold the subroutine return address
96180
+ */
96181
+ int topAddr;
96182
+ int onceAddr = 0;
96183
+ int retAddr;
96184
+ assert( pItem->addrFillSub==0 );
96185
+ pItem->regReturn = ++pParse->nMem;
96186
+ topAddr = sqlite3VdbeAddOp2(v, OP_Integer, 0, pItem->regReturn);
96187
+ pItem->addrFillSub = topAddr+1;
96188
+ VdbeNoopComment((v, "materialize %s", pItem->pTab->zName));
96189
+ if( pItem->isCorrelated==0 && pParse->pTriggerTab==0 ){
96190
+ /* If the subquery is no correlated and if we are not inside of
96191
+ ** a trigger, then we only need to compute the value of the subquery
96192
+ ** once. */
96193
+ int regOnce = ++pParse->nMem;
96194
+ onceAddr = sqlite3VdbeAddOp1(v, OP_Once, regOnce);
96195
+ }
9624996196
sqlite3SelectDestInit(&dest, SRT_EphemTab, pItem->iCursor);
96250
- assert( pItem->isPopulated==0 );
9625196197
explainSetInteger(pItem->iSelectId, (u8)pParse->iNextSelectId);
9625296198
sqlite3Select(pParse, pSub, &dest);
96253
- pItem->isPopulated = 1;
9625496199
pItem->pTab->nRowEst = (unsigned)pSub->nSelectRow;
96200
+ if( onceAddr ) sqlite3VdbeJumpHere(v, onceAddr);
96201
+ retAddr = sqlite3VdbeAddOp1(v, OP_Return, pItem->regReturn);
96202
+ VdbeComment((v, "end %s", pItem->pTab->zName));
96203
+ sqlite3VdbeChangeP1(v, topAddr, retAddr);
96204
+
9625596205
}
9625696206
if( /*pParse->nErr ||*/ db->mallocFailed ){
9625796207
goto select_end;
9625896208
}
9625996209
pParse->nHeight -= sqlite3SelectExprHeight(p);
@@ -96390,11 +96340,11 @@
9639096340
/* If sorting index that was created by a prior OP_OpenEphemeral
9639196341
** instruction ended up not being needed, then change the OP_OpenEphemeral
9639296342
** into an OP_Noop.
9639396343
*/
9639496344
if( addrSortIndex>=0 && pOrderBy==0 ){
96395
- sqlite3VdbeChangeToNoop(v, addrSortIndex, 1);
96345
+ sqlite3VdbeChangeToNoop(v, addrSortIndex);
9639696346
p->addrOpenEphm[2] = -1;
9639796347
}
9639896348
9639996349
if( pWInfo->eDistinct ){
9640096350
VdbeOp *pOp; /* No longer required OpenEphemeral instr. */
@@ -96673,11 +96623,11 @@
9667396623
*/
9667496624
if( groupBySort ){
9667596625
sqlite3VdbeAddOp2(v, OP_SorterNext, sAggInfo.sortingIdx, addrTopOfLoop);
9667696626
}else{
9667796627
sqlite3WhereEnd(pWInfo);
96678
- sqlite3VdbeChangeToNoop(v, addrSortingIdx, 1);
96628
+ sqlite3VdbeChangeToNoop(v, addrSortingIdx);
9667996629
}
9668096630
9668196631
/* Output the final row of result
9668296632
*/
9668396633
sqlite3VdbeAddOp2(v, OP_Gosub, regOutputRow, addrOutputRow);
@@ -96981,11 +96931,10 @@
9698196931
*****************************************************************************/
9698296932
#endif /* defined(SQLITE_TEST) || defined(SQLITE_DEBUG) */
9698396933
9698496934
/************** End of select.c **********************************************/
9698596935
/************** Begin file table.c *******************************************/
96986
-#line 1 "tsrc/table.c"
9698796936
/*
9698896937
** 2001 September 15
9698996938
**
9699096939
** The author disclaims copyright to this source code. In place of
9699196940
** a legal notice, here is a blessing:
@@ -97181,11 +97130,10 @@
9718197130
9718297131
#endif /* SQLITE_OMIT_GET_TABLE */
9718397132
9718497133
/************** End of table.c ***********************************************/
9718597134
/************** Begin file trigger.c *****************************************/
97186
-#line 1 "tsrc/trigger.c"
9718797135
/*
9718897136
**
9718997137
** The author disclaims copyright to this source code. In place of
9719097138
** a legal notice, here is a blessing:
9719197139
**
@@ -98307,11 +98255,10 @@
9830798255
9830898256
#endif /* !defined(SQLITE_OMIT_TRIGGER) */
9830998257
9831098258
/************** End of trigger.c *********************************************/
9831198259
/************** Begin file update.c ******************************************/
98312
-#line 1 "tsrc/update.c"
9831398260
/*
9831498261
** 2001 September 15
9831598262
**
9831698263
** The author disclaims copyright to this source code. In place of
9831798264
** a legal notice, here is a blessing:
@@ -98980,11 +98927,10 @@
9898098927
}
9898198928
#endif /* SQLITE_OMIT_VIRTUALTABLE */
9898298929
9898398930
/************** End of update.c **********************************************/
9898498931
/************** Begin file vacuum.c ******************************************/
98985
-#line 1 "tsrc/vacuum.c"
9898698932
/*
9898798933
** 2003 April 6
9898898934
**
9898998935
** The author disclaims copyright to this source code. In place of
9899098936
** a legal notice, here is a blessing:
@@ -99327,11 +99273,10 @@
9932799273
9932899274
#endif /* SQLITE_OMIT_VACUUM && SQLITE_OMIT_ATTACH */
9932999275
9933099276
/************** End of vacuum.c **********************************************/
9933199277
/************** Begin file vtab.c ********************************************/
99332
-#line 1 "tsrc/vtab.c"
9933399278
/*
9933499279
** 2006 June 10
9933599280
**
9933699281
** The author disclaims copyright to this source code. In place of
9933799282
** a legal notice, here is a blessing:
@@ -100396,11 +100341,10 @@
100396100341
100397100342
#endif /* SQLITE_OMIT_VIRTUALTABLE */
100398100343
100399100344
/************** End of vtab.c ************************************************/
100400100345
/************** Begin file where.c *******************************************/
100401
-#line 1 "tsrc/where.c"
100402100346
/*
100403100347
** 2001 September 15
100404100348
**
100405100349
** The author disclaims copyright to this source code. In place of
100406100350
** a legal notice, here is a blessing:
@@ -100865,15 +100809,23 @@
100865100809
return mask;
100866100810
}
100867100811
static Bitmask exprSelectTableUsage(WhereMaskSet *pMaskSet, Select *pS){
100868100812
Bitmask mask = 0;
100869100813
while( pS ){
100814
+ SrcList *pSrc = pS->pSrc;
100870100815
mask |= exprListTableUsage(pMaskSet, pS->pEList);
100871100816
mask |= exprListTableUsage(pMaskSet, pS->pGroupBy);
100872100817
mask |= exprListTableUsage(pMaskSet, pS->pOrderBy);
100873100818
mask |= exprTableUsage(pMaskSet, pS->pWhere);
100874100819
mask |= exprTableUsage(pMaskSet, pS->pHaving);
100820
+ if( ALWAYS(pSrc!=0) ){
100821
+ int i;
100822
+ for(i=0; i<pSrc->nSrc; i++){
100823
+ mask |= exprSelectTableUsage(pMaskSet, pSrc->a[i].pSelect);
100824
+ mask |= exprTableUsage(pMaskSet, pSrc->a[i].pOn);
100825
+ }
100826
+ }
100875100827
pS = pS->pPrior;
100876100828
}
100877100829
return mask;
100878100830
}
100879100831
@@ -102392,12 +102344,11 @@
102392102344
/* Generate code to skip over the creation and initialization of the
102393102345
** transient index on 2nd and subsequent iterations of the loop. */
102394102346
v = pParse->pVdbe;
102395102347
assert( v!=0 );
102396102348
regIsInit = ++pParse->nMem;
102397
- addrInit = sqlite3VdbeAddOp1(v, OP_If, regIsInit);
102398
- sqlite3VdbeAddOp2(v, OP_Integer, 1, regIsInit);
102349
+ addrInit = sqlite3VdbeAddOp1(v, OP_Once, regIsInit);
102399102350
102400102351
/* Count the number of columns that will be added to the index
102401102352
** and used to match WHERE clause constraints */
102402102353
nColumn = 0;
102403102354
pTable = pSrc->pTab;
@@ -105583,11 +105534,10 @@
105583105534
return;
105584105535
}
105585105536
105586105537
/************** End of where.c ***********************************************/
105587105538
/************** Begin file parse.c *******************************************/
105588
-#line 1 "tsrc/parse.c"
105589105539
/* Driver template for the LEMON parser generator.
105590105540
** The author disclaims copyright to this source code.
105591105541
**
105592105542
** This version of "lempar.c" is modified, slightly, for use by SQLite.
105593105543
** The only modifications are the addition of a couple of NEVER()
@@ -105596,11 +105546,10 @@
105596105546
** specific grammar used by SQLite.
105597105547
*/
105598105548
/* First off, code is included that follows the "include" declaration
105599105549
** in the input grammar file. */
105600105550
/* #include <stdio.h> */
105601
-#line 51 "parse.y"
105602105551
105603105552
105604105553
/*
105605105554
** Disable all error recovery processing in the parser push-down
105606105555
** automaton.
@@ -105644,11 +105593,10 @@
105644105593
/*
105645105594
** An instance of this structure holds the ATTACH key and the key type.
105646105595
*/
105647105596
struct AttachKey { int type; Token key; };
105648105597
105649
-#line 722 "parse.y"
105650105598
105651105599
/* This is a utility routine used to set the ExprSpan.zStart and
105652105600
** ExprSpan.zEnd values of pOut so that the span covers the complete
105653105601
** range of text beginning with pStart and going to the end of pEnd.
105654105602
*/
@@ -105664,11 +105612,10 @@
105664105612
static void spanExpr(ExprSpan *pOut, Parse *pParse, int op, Token *pValue){
105665105613
pOut->pExpr = sqlite3PExpr(pParse, op, 0, 0, pValue);
105666105614
pOut->zStart = pValue->z;
105667105615
pOut->zEnd = &pValue->z[pValue->n];
105668105616
}
105669
-#line 817 "parse.y"
105670105617
105671105618
/* This routine constructs a binary expression node out of two ExprSpan
105672105619
** objects and uses the result to populate a new ExprSpan object.
105673105620
*/
105674105621
static void spanBinaryExpr(
@@ -105680,11 +105627,10 @@
105680105627
){
105681105628
pOut->pExpr = sqlite3PExpr(pParse, op, pLeft->pExpr, pRight->pExpr, 0);
105682105629
pOut->zStart = pLeft->zStart;
105683105630
pOut->zEnd = pRight->zEnd;
105684105631
}
105685
-#line 873 "parse.y"
105686105632
105687105633
/* Construct an expression node for a unary postfix operator
105688105634
*/
105689105635
static void spanUnaryPostfix(
105690105636
ExprSpan *pOut, /* Write the new expression node here */
@@ -105695,11 +105641,10 @@
105695105641
){
105696105642
pOut->pExpr = sqlite3PExpr(pParse, op, pOperand->pExpr, 0, 0);
105697105643
pOut->zStart = pOperand->zStart;
105698105644
pOut->zEnd = &pPostOp->z[pPostOp->n];
105699105645
}
105700
-#line 892 "parse.y"
105701105646
105702105647
/* A routine to convert a binary TK_IS or TK_ISNOT expression into a
105703105648
** unary TK_ISNULL or TK_NOTNULL expression. */
105704105649
static void binaryToUnaryIfNull(Parse *pParse, Expr *pY, Expr *pA, int op){
105705105650
sqlite3 *db = pParse->db;
@@ -105707,11 +105652,10 @@
105707105652
pA->op = (u8)op;
105708105653
sqlite3ExprDelete(db, pA->pRight);
105709105654
pA->pRight = 0;
105710105655
}
105711105656
}
105712
-#line 920 "parse.y"
105713105657
105714105658
/* Construct an expression node for a unary prefix operator
105715105659
*/
105716105660
static void spanUnaryPrefix(
105717105661
ExprSpan *pOut, /* Write the new expression node here */
@@ -105722,11 +105666,10 @@
105722105666
){
105723105667
pOut->pExpr = sqlite3PExpr(pParse, op, pOperand->pExpr, 0, 0);
105724105668
pOut->zStart = pPreOp->z;
105725105669
pOut->zEnd = pOperand->zEnd;
105726105670
}
105727
-#line 141 "parse.c"
105728105671
/* Next is all token values, in a form suitable for use by makeheaders.
105729105672
** This section will be null unless lemon is run with the -m switch.
105730105673
*/
105731105674
/*
105732105675
** These constants (all generated automatically by the parser generator)
@@ -106978,21 +106921,17 @@
106978106921
** inside the C code.
106979106922
*/
106980106923
case 160: /* select */
106981106924
case 194: /* oneselect */
106982106925
{
106983
-#line 403 "parse.y"
106984106926
sqlite3SelectDelete(pParse->db, (yypminor->yy387));
106985
-#line 1399 "parse.c"
106986106927
}
106987106928
break;
106988106929
case 174: /* term */
106989106930
case 175: /* expr */
106990106931
{
106991
-#line 720 "parse.y"
106992106932
sqlite3ExprDelete(pParse->db, (yypminor->yy118).pExpr);
106993
-#line 1407 "parse.c"
106994106933
}
106995106934
break;
106996106935
case 179: /* idxlist_opt */
106997106936
case 187: /* idxlist */
106998106937
case 197: /* selcollist */
@@ -107004,23 +106943,19 @@
107004106943
case 217: /* setlist */
107005106944
case 220: /* itemlist */
107006106945
case 221: /* exprlist */
107007106946
case 226: /* case_exprlist */
107008106947
{
107009
-#line 1103 "parse.y"
107010106948
sqlite3ExprListDelete(pParse->db, (yypminor->yy322));
107011
-#line 1425 "parse.c"
107012106949
}
107013106950
break;
107014106951
case 193: /* fullname */
107015106952
case 198: /* from */
107016106953
case 206: /* seltablist */
107017106954
case 207: /* stl_prefix */
107018106955
{
107019
-#line 534 "parse.y"
107020106956
sqlite3SrcListDelete(pParse->db, (yypminor->yy259));
107021
-#line 1435 "parse.c"
107022106957
}
107023106958
break;
107024106959
case 199: /* where_opt */
107025106960
case 201: /* having_opt */
107026106961
case 210: /* on_opt */
@@ -107028,37 +106963,29 @@
107028106963
case 225: /* case_operand */
107029106964
case 227: /* case_else */
107030106965
case 238: /* when_clause */
107031106966
case 243: /* key_opt */
107032106967
{
107033
-#line 644 "parse.y"
107034106968
sqlite3ExprDelete(pParse->db, (yypminor->yy314));
107035
-#line 1449 "parse.c"
107036106969
}
107037106970
break;
107038106971
case 211: /* using_opt */
107039106972
case 213: /* inscollist */
107040106973
case 219: /* inscollist_opt */
107041106974
{
107042
-#line 566 "parse.y"
107043106975
sqlite3IdListDelete(pParse->db, (yypminor->yy384));
107044
-#line 1458 "parse.c"
107045106976
}
107046106977
break;
107047106978
case 234: /* trigger_cmd_list */
107048106979
case 239: /* trigger_cmd */
107049106980
{
107050
-#line 1210 "parse.y"
107051106981
sqlite3DeleteTriggerStep(pParse->db, (yypminor->yy203));
107052
-#line 1466 "parse.c"
107053106982
}
107054106983
break;
107055106984
case 236: /* trigger_event */
107056106985
{
107057
-#line 1196 "parse.y"
107058106986
sqlite3IdListDelete(pParse->db, (yypminor->yy90).b);
107059
-#line 1473 "parse.c"
107060106987
}
107061106988
break;
107062106989
default: break; /* If no destructor action specified: do nothing */
107063106990
}
107064106991
}
@@ -107240,16 +107167,14 @@
107240107167
}
107241107168
#endif
107242107169
while( yypParser->yyidx>=0 ) yy_pop_parser_stack(yypParser);
107243107170
/* Here code is inserted which will execute if the parser
107244107171
** stack every overflows */
107245
-#line 38 "parse.y"
107246107172
107247107173
UNUSED_PARAMETER(yypMinor); /* Silence some compiler warnings */
107248107174
sqlite3ErrorMsg(pParse, "parser stack overflow");
107249107175
pParse->parseError = 1;
107250
-#line 1664 "parse.c"
107251107176
sqlite3ParserARG_STORE; /* Suppress warning about unused %extra_argument var */
107252107177
}
107253107178
107254107179
/*
107255107180
** Perform a shift action.
@@ -107686,94 +107611,66 @@
107686107611
** { ... } // User supplied code
107687107612
** #line <lineno> <thisfile>
107688107613
** break;
107689107614
*/
107690107615
case 5: /* explain ::= */
107691
-#line 107 "parse.y"
107692107616
{ sqlite3BeginParse(pParse, 0); }
107693
-#line 2107 "parse.c"
107694107617
break;
107695107618
case 6: /* explain ::= EXPLAIN */
107696
-#line 109 "parse.y"
107697107619
{ sqlite3BeginParse(pParse, 1); }
107698
-#line 2112 "parse.c"
107699107620
break;
107700107621
case 7: /* explain ::= EXPLAIN QUERY PLAN */
107701
-#line 110 "parse.y"
107702107622
{ sqlite3BeginParse(pParse, 2); }
107703
-#line 2117 "parse.c"
107704107623
break;
107705107624
case 8: /* cmdx ::= cmd */
107706
-#line 112 "parse.y"
107707107625
{ sqlite3FinishCoding(pParse); }
107708
-#line 2122 "parse.c"
107709107626
break;
107710107627
case 9: /* cmd ::= BEGIN transtype trans_opt */
107711
-#line 117 "parse.y"
107712107628
{sqlite3BeginTransaction(pParse, yymsp[-1].minor.yy4);}
107713
-#line 2127 "parse.c"
107714107629
break;
107715107630
case 13: /* transtype ::= */
107716
-#line 122 "parse.y"
107717107631
{yygotominor.yy4 = TK_DEFERRED;}
107718
-#line 2132 "parse.c"
107719107632
break;
107720107633
case 14: /* transtype ::= DEFERRED */
107721107634
case 15: /* transtype ::= IMMEDIATE */ yytestcase(yyruleno==15);
107722107635
case 16: /* transtype ::= EXCLUSIVE */ yytestcase(yyruleno==16);
107723107636
case 115: /* multiselect_op ::= UNION */ yytestcase(yyruleno==115);
107724107637
case 117: /* multiselect_op ::= EXCEPT|INTERSECT */ yytestcase(yyruleno==117);
107725
-#line 123 "parse.y"
107726107638
{yygotominor.yy4 = yymsp[0].major;}
107727
-#line 2141 "parse.c"
107728107639
break;
107729107640
case 17: /* cmd ::= COMMIT trans_opt */
107730107641
case 18: /* cmd ::= END trans_opt */ yytestcase(yyruleno==18);
107731
-#line 126 "parse.y"
107732107642
{sqlite3CommitTransaction(pParse);}
107733
-#line 2147 "parse.c"
107734107643
break;
107735107644
case 19: /* cmd ::= ROLLBACK trans_opt */
107736
-#line 128 "parse.y"
107737107645
{sqlite3RollbackTransaction(pParse);}
107738
-#line 2152 "parse.c"
107739107646
break;
107740107647
case 22: /* cmd ::= SAVEPOINT nm */
107741
-#line 132 "parse.y"
107742107648
{
107743107649
sqlite3Savepoint(pParse, SAVEPOINT_BEGIN, &yymsp[0].minor.yy0);
107744107650
}
107745
-#line 2159 "parse.c"
107746107651
break;
107747107652
case 23: /* cmd ::= RELEASE savepoint_opt nm */
107748
-#line 135 "parse.y"
107749107653
{
107750107654
sqlite3Savepoint(pParse, SAVEPOINT_RELEASE, &yymsp[0].minor.yy0);
107751107655
}
107752
-#line 2166 "parse.c"
107753107656
break;
107754107657
case 24: /* cmd ::= ROLLBACK trans_opt TO savepoint_opt nm */
107755
-#line 138 "parse.y"
107756107658
{
107757107659
sqlite3Savepoint(pParse, SAVEPOINT_ROLLBACK, &yymsp[0].minor.yy0);
107758107660
}
107759
-#line 2173 "parse.c"
107760107661
break;
107761107662
case 26: /* create_table ::= createkw temp TABLE ifnotexists nm dbnm */
107762
-#line 145 "parse.y"
107763107663
{
107764107664
sqlite3StartTable(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,yymsp[-4].minor.yy4,0,0,yymsp[-2].minor.yy4);
107765107665
}
107766
-#line 2180 "parse.c"
107767107666
break;
107768107667
case 27: /* createkw ::= CREATE */
107769
-#line 148 "parse.y"
107770107668
{
107771107669
pParse->db->lookaside.bEnabled = 0;
107772107670
yygotominor.yy0 = yymsp[0].minor.yy0;
107773107671
}
107774
-#line 2188 "parse.c"
107775107672
break;
107776107673
case 28: /* ifnotexists ::= */
107777107674
case 31: /* temp ::= */ yytestcase(yyruleno==31);
107778107675
case 70: /* autoinc ::= */ yytestcase(yyruleno==70);
107779107676
case 83: /* defer_subclause ::= NOT DEFERRABLE init_deferred_pred_opt */ yytestcase(yyruleno==83);
@@ -107783,56 +107680,44 @@
107783107680
case 109: /* ifexists ::= */ yytestcase(yyruleno==109);
107784107681
case 120: /* distinct ::= ALL */ yytestcase(yyruleno==120);
107785107682
case 121: /* distinct ::= */ yytestcase(yyruleno==121);
107786107683
case 222: /* between_op ::= BETWEEN */ yytestcase(yyruleno==222);
107787107684
case 225: /* in_op ::= IN */ yytestcase(yyruleno==225);
107788
-#line 153 "parse.y"
107789107685
{yygotominor.yy4 = 0;}
107790
-#line 2204 "parse.c"
107791107686
break;
107792107687
case 29: /* ifnotexists ::= IF NOT EXISTS */
107793107688
case 30: /* temp ::= TEMP */ yytestcase(yyruleno==30);
107794107689
case 71: /* autoinc ::= AUTOINCR */ yytestcase(yyruleno==71);
107795107690
case 86: /* init_deferred_pred_opt ::= INITIALLY DEFERRED */ yytestcase(yyruleno==86);
107796107691
case 108: /* ifexists ::= IF EXISTS */ yytestcase(yyruleno==108);
107797107692
case 119: /* distinct ::= DISTINCT */ yytestcase(yyruleno==119);
107798107693
case 223: /* between_op ::= NOT BETWEEN */ yytestcase(yyruleno==223);
107799107694
case 226: /* in_op ::= NOT IN */ yytestcase(yyruleno==226);
107800
-#line 154 "parse.y"
107801107695
{yygotominor.yy4 = 1;}
107802
-#line 2216 "parse.c"
107803107696
break;
107804107697
case 32: /* create_table_args ::= LP columnlist conslist_opt RP */
107805
-#line 160 "parse.y"
107806107698
{
107807107699
sqlite3EndTable(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,0);
107808107700
}
107809
-#line 2223 "parse.c"
107810107701
break;
107811107702
case 33: /* create_table_args ::= AS select */
107812
-#line 163 "parse.y"
107813107703
{
107814107704
sqlite3EndTable(pParse,0,0,yymsp[0].minor.yy387);
107815107705
sqlite3SelectDelete(pParse->db, yymsp[0].minor.yy387);
107816107706
}
107817
-#line 2231 "parse.c"
107818107707
break;
107819107708
case 36: /* column ::= columnid type carglist */
107820
-#line 175 "parse.y"
107821107709
{
107822107710
yygotominor.yy0.z = yymsp[-2].minor.yy0.z;
107823107711
yygotominor.yy0.n = (int)(pParse->sLastToken.z-yymsp[-2].minor.yy0.z) + pParse->sLastToken.n;
107824107712
}
107825
-#line 2239 "parse.c"
107826107713
break;
107827107714
case 37: /* columnid ::= nm */
107828
-#line 179 "parse.y"
107829107715
{
107830107716
sqlite3AddColumn(pParse,&yymsp[0].minor.yy0);
107831107717
yygotominor.yy0 = yymsp[0].minor.yy0;
107832107718
}
107833
-#line 2247 "parse.c"
107834107719
break;
107835107720
case 38: /* id ::= ID */
107836107721
case 39: /* id ::= INDEXED */ yytestcase(yyruleno==39);
107837107722
case 40: /* ids ::= ID|STRING */ yytestcase(yyruleno==40);
107838107723
case 41: /* nm ::= id */ yytestcase(yyruleno==41);
@@ -107852,373 +107737,256 @@
107852107737
case 264: /* nmnum ::= DEFAULT */ yytestcase(yyruleno==264);
107853107738
case 265: /* plus_num ::= plus_opt number */ yytestcase(yyruleno==265);
107854107739
case 266: /* minus_num ::= MINUS number */ yytestcase(yyruleno==266);
107855107740
case 267: /* number ::= INTEGER|FLOAT */ yytestcase(yyruleno==267);
107856107741
case 285: /* trnm ::= nm */ yytestcase(yyruleno==285);
107857
-#line 189 "parse.y"
107858107742
{yygotominor.yy0 = yymsp[0].minor.yy0;}
107859
-#line 2273 "parse.c"
107860107743
break;
107861107744
case 45: /* type ::= typetoken */
107862
-#line 251 "parse.y"
107863107745
{sqlite3AddColumnType(pParse,&yymsp[0].minor.yy0);}
107864
-#line 2278 "parse.c"
107865107746
break;
107866107747
case 47: /* typetoken ::= typename LP signed RP */
107867
-#line 253 "parse.y"
107868107748
{
107869107749
yygotominor.yy0.z = yymsp[-3].minor.yy0.z;
107870107750
yygotominor.yy0.n = (int)(&yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n] - yymsp[-3].minor.yy0.z);
107871107751
}
107872
-#line 2286 "parse.c"
107873107752
break;
107874107753
case 48: /* typetoken ::= typename LP signed COMMA signed RP */
107875
-#line 257 "parse.y"
107876107754
{
107877107755
yygotominor.yy0.z = yymsp[-5].minor.yy0.z;
107878107756
yygotominor.yy0.n = (int)(&yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n] - yymsp[-5].minor.yy0.z);
107879107757
}
107880
-#line 2294 "parse.c"
107881107758
break;
107882107759
case 50: /* typename ::= typename ids */
107883
-#line 263 "parse.y"
107884107760
{yygotominor.yy0.z=yymsp[-1].minor.yy0.z; yygotominor.yy0.n=yymsp[0].minor.yy0.n+(int)(yymsp[0].minor.yy0.z-yymsp[-1].minor.yy0.z);}
107885
-#line 2299 "parse.c"
107886107761
break;
107887107762
case 57: /* ccons ::= DEFAULT term */
107888107763
case 59: /* ccons ::= DEFAULT PLUS term */ yytestcase(yyruleno==59);
107889
-#line 274 "parse.y"
107890107764
{sqlite3AddDefaultValue(pParse,&yymsp[0].minor.yy118);}
107891
-#line 2305 "parse.c"
107892107765
break;
107893107766
case 58: /* ccons ::= DEFAULT LP expr RP */
107894
-#line 275 "parse.y"
107895107767
{sqlite3AddDefaultValue(pParse,&yymsp[-1].minor.yy118);}
107896
-#line 2310 "parse.c"
107897107768
break;
107898107769
case 60: /* ccons ::= DEFAULT MINUS term */
107899
-#line 277 "parse.y"
107900107770
{
107901107771
ExprSpan v;
107902107772
v.pExpr = sqlite3PExpr(pParse, TK_UMINUS, yymsp[0].minor.yy118.pExpr, 0, 0);
107903107773
v.zStart = yymsp[-1].minor.yy0.z;
107904107774
v.zEnd = yymsp[0].minor.yy118.zEnd;
107905107775
sqlite3AddDefaultValue(pParse,&v);
107906107776
}
107907
-#line 2321 "parse.c"
107908107777
break;
107909107778
case 61: /* ccons ::= DEFAULT id */
107910
-#line 284 "parse.y"
107911107779
{
107912107780
ExprSpan v;
107913107781
spanExpr(&v, pParse, TK_STRING, &yymsp[0].minor.yy0);
107914107782
sqlite3AddDefaultValue(pParse,&v);
107915107783
}
107916
-#line 2330 "parse.c"
107917107784
break;
107918107785
case 63: /* ccons ::= NOT NULL onconf */
107919
-#line 294 "parse.y"
107920107786
{sqlite3AddNotNull(pParse, yymsp[0].minor.yy4);}
107921
-#line 2335 "parse.c"
107922107787
break;
107923107788
case 64: /* ccons ::= PRIMARY KEY sortorder onconf autoinc */
107924
-#line 296 "parse.y"
107925107789
{sqlite3AddPrimaryKey(pParse,0,yymsp[-1].minor.yy4,yymsp[0].minor.yy4,yymsp[-2].minor.yy4);}
107926
-#line 2340 "parse.c"
107927107790
break;
107928107791
case 65: /* ccons ::= UNIQUE onconf */
107929
-#line 297 "parse.y"
107930107792
{sqlite3CreateIndex(pParse,0,0,0,0,yymsp[0].minor.yy4,0,0,0,0);}
107931
-#line 2345 "parse.c"
107932107793
break;
107933107794
case 66: /* ccons ::= CHECK LP expr RP */
107934
-#line 298 "parse.y"
107935107795
{sqlite3AddCheckConstraint(pParse,yymsp[-1].minor.yy118.pExpr);}
107936
-#line 2350 "parse.c"
107937107796
break;
107938107797
case 67: /* ccons ::= REFERENCES nm idxlist_opt refargs */
107939
-#line 300 "parse.y"
107940107798
{sqlite3CreateForeignKey(pParse,0,&yymsp[-2].minor.yy0,yymsp[-1].minor.yy322,yymsp[0].minor.yy4);}
107941
-#line 2355 "parse.c"
107942107799
break;
107943107800
case 68: /* ccons ::= defer_subclause */
107944
-#line 301 "parse.y"
107945107801
{sqlite3DeferForeignKey(pParse,yymsp[0].minor.yy4);}
107946
-#line 2360 "parse.c"
107947107802
break;
107948107803
case 69: /* ccons ::= COLLATE ids */
107949
-#line 302 "parse.y"
107950107804
{sqlite3AddCollateType(pParse, &yymsp[0].minor.yy0);}
107951
-#line 2365 "parse.c"
107952107805
break;
107953107806
case 72: /* refargs ::= */
107954
-#line 315 "parse.y"
107955107807
{ yygotominor.yy4 = OE_None*0x0101; /* EV: R-19803-45884 */}
107956
-#line 2370 "parse.c"
107957107808
break;
107958107809
case 73: /* refargs ::= refargs refarg */
107959
-#line 316 "parse.y"
107960107810
{ yygotominor.yy4 = (yymsp[-1].minor.yy4 & ~yymsp[0].minor.yy215.mask) | yymsp[0].minor.yy215.value; }
107961
-#line 2375 "parse.c"
107962107811
break;
107963107812
case 74: /* refarg ::= MATCH nm */
107964107813
case 75: /* refarg ::= ON INSERT refact */ yytestcase(yyruleno==75);
107965
-#line 318 "parse.y"
107966107814
{ yygotominor.yy215.value = 0; yygotominor.yy215.mask = 0x000000; }
107967
-#line 2381 "parse.c"
107968107815
break;
107969107816
case 76: /* refarg ::= ON DELETE refact */
107970
-#line 320 "parse.y"
107971107817
{ yygotominor.yy215.value = yymsp[0].minor.yy4; yygotominor.yy215.mask = 0x0000ff; }
107972
-#line 2386 "parse.c"
107973107818
break;
107974107819
case 77: /* refarg ::= ON UPDATE refact */
107975
-#line 321 "parse.y"
107976107820
{ yygotominor.yy215.value = yymsp[0].minor.yy4<<8; yygotominor.yy215.mask = 0x00ff00; }
107977
-#line 2391 "parse.c"
107978107821
break;
107979107822
case 78: /* refact ::= SET NULL */
107980
-#line 323 "parse.y"
107981107823
{ yygotominor.yy4 = OE_SetNull; /* EV: R-33326-45252 */}
107982
-#line 2396 "parse.c"
107983107824
break;
107984107825
case 79: /* refact ::= SET DEFAULT */
107985
-#line 324 "parse.y"
107986107826
{ yygotominor.yy4 = OE_SetDflt; /* EV: R-33326-45252 */}
107987
-#line 2401 "parse.c"
107988107827
break;
107989107828
case 80: /* refact ::= CASCADE */
107990
-#line 325 "parse.y"
107991107829
{ yygotominor.yy4 = OE_Cascade; /* EV: R-33326-45252 */}
107992
-#line 2406 "parse.c"
107993107830
break;
107994107831
case 81: /* refact ::= RESTRICT */
107995
-#line 326 "parse.y"
107996107832
{ yygotominor.yy4 = OE_Restrict; /* EV: R-33326-45252 */}
107997
-#line 2411 "parse.c"
107998107833
break;
107999107834
case 82: /* refact ::= NO ACTION */
108000
-#line 327 "parse.y"
108001107835
{ yygotominor.yy4 = OE_None; /* EV: R-33326-45252 */}
108002
-#line 2416 "parse.c"
108003107836
break;
108004107837
case 84: /* defer_subclause ::= DEFERRABLE init_deferred_pred_opt */
108005107838
case 99: /* defer_subclause_opt ::= defer_subclause */ yytestcase(yyruleno==99);
108006107839
case 101: /* onconf ::= ON CONFLICT resolvetype */ yytestcase(yyruleno==101);
108007107840
case 104: /* resolvetype ::= raisetype */ yytestcase(yyruleno==104);
108008
-#line 330 "parse.y"
108009107841
{yygotominor.yy4 = yymsp[0].minor.yy4;}
108010
-#line 2424 "parse.c"
108011107842
break;
108012107843
case 88: /* conslist_opt ::= */
108013
-#line 339 "parse.y"
108014107844
{yygotominor.yy0.n = 0; yygotominor.yy0.z = 0;}
108015
-#line 2429 "parse.c"
108016107845
break;
108017107846
case 89: /* conslist_opt ::= COMMA conslist */
108018
-#line 340 "parse.y"
108019107847
{yygotominor.yy0 = yymsp[-1].minor.yy0;}
108020
-#line 2434 "parse.c"
108021107848
break;
108022107849
case 94: /* tcons ::= PRIMARY KEY LP idxlist autoinc RP onconf */
108023
-#line 346 "parse.y"
108024107850
{sqlite3AddPrimaryKey(pParse,yymsp[-3].minor.yy322,yymsp[0].minor.yy4,yymsp[-2].minor.yy4,0);}
108025
-#line 2439 "parse.c"
108026107851
break;
108027107852
case 95: /* tcons ::= UNIQUE LP idxlist RP onconf */
108028
-#line 348 "parse.y"
108029107853
{sqlite3CreateIndex(pParse,0,0,0,yymsp[-2].minor.yy322,yymsp[0].minor.yy4,0,0,0,0);}
108030
-#line 2444 "parse.c"
108031107854
break;
108032107855
case 96: /* tcons ::= CHECK LP expr RP onconf */
108033
-#line 350 "parse.y"
108034107856
{sqlite3AddCheckConstraint(pParse,yymsp[-2].minor.yy118.pExpr);}
108035
-#line 2449 "parse.c"
108036107857
break;
108037107858
case 97: /* tcons ::= FOREIGN KEY LP idxlist RP REFERENCES nm idxlist_opt refargs defer_subclause_opt */
108038
-#line 352 "parse.y"
108039107859
{
108040107860
sqlite3CreateForeignKey(pParse, yymsp[-6].minor.yy322, &yymsp[-3].minor.yy0, yymsp[-2].minor.yy322, yymsp[-1].minor.yy4);
108041107861
sqlite3DeferForeignKey(pParse, yymsp[0].minor.yy4);
108042107862
}
108043
-#line 2457 "parse.c"
108044107863
break;
108045107864
case 100: /* onconf ::= */
108046
-#line 366 "parse.y"
108047107865
{yygotominor.yy4 = OE_Default;}
108048
-#line 2462 "parse.c"
108049107866
break;
108050107867
case 102: /* orconf ::= */
108051
-#line 368 "parse.y"
108052107868
{yygotominor.yy210 = OE_Default;}
108053
-#line 2467 "parse.c"
108054107869
break;
108055107870
case 103: /* orconf ::= OR resolvetype */
108056
-#line 369 "parse.y"
108057107871
{yygotominor.yy210 = (u8)yymsp[0].minor.yy4;}
108058
-#line 2472 "parse.c"
108059107872
break;
108060107873
case 105: /* resolvetype ::= IGNORE */
108061
-#line 371 "parse.y"
108062107874
{yygotominor.yy4 = OE_Ignore;}
108063
-#line 2477 "parse.c"
108064107875
break;
108065107876
case 106: /* resolvetype ::= REPLACE */
108066
-#line 372 "parse.y"
108067107877
{yygotominor.yy4 = OE_Replace;}
108068
-#line 2482 "parse.c"
108069107878
break;
108070107879
case 107: /* cmd ::= DROP TABLE ifexists fullname */
108071
-#line 376 "parse.y"
108072107880
{
108073107881
sqlite3DropTable(pParse, yymsp[0].minor.yy259, 0, yymsp[-1].minor.yy4);
108074107882
}
108075
-#line 2489 "parse.c"
108076107883
break;
108077107884
case 110: /* cmd ::= createkw temp VIEW ifnotexists nm dbnm AS select */
108078
-#line 386 "parse.y"
108079107885
{
108080107886
sqlite3CreateView(pParse, &yymsp[-7].minor.yy0, &yymsp[-3].minor.yy0, &yymsp[-2].minor.yy0, yymsp[0].minor.yy387, yymsp[-6].minor.yy4, yymsp[-4].minor.yy4);
108081107887
}
108082
-#line 2496 "parse.c"
108083107888
break;
108084107889
case 111: /* cmd ::= DROP VIEW ifexists fullname */
108085
-#line 389 "parse.y"
108086107890
{
108087107891
sqlite3DropTable(pParse, yymsp[0].minor.yy259, 1, yymsp[-1].minor.yy4);
108088107892
}
108089
-#line 2503 "parse.c"
108090107893
break;
108091107894
case 112: /* cmd ::= select */
108092
-#line 396 "parse.y"
108093107895
{
108094107896
SelectDest dest = {SRT_Output, 0, 0, 0, 0};
108095107897
sqlite3Select(pParse, yymsp[0].minor.yy387, &dest);
108096107898
sqlite3SelectDelete(pParse->db, yymsp[0].minor.yy387);
108097107899
}
108098
-#line 2512 "parse.c"
108099107900
break;
108100107901
case 113: /* select ::= oneselect */
108101
-#line 407 "parse.y"
108102107902
{yygotominor.yy387 = yymsp[0].minor.yy387;}
108103
-#line 2517 "parse.c"
108104107903
break;
108105107904
case 114: /* select ::= select multiselect_op oneselect */
108106
-#line 409 "parse.y"
108107107905
{
108108107906
if( yymsp[0].minor.yy387 ){
108109107907
yymsp[0].minor.yy387->op = (u8)yymsp[-1].minor.yy4;
108110107908
yymsp[0].minor.yy387->pPrior = yymsp[-2].minor.yy387;
108111107909
}else{
108112107910
sqlite3SelectDelete(pParse->db, yymsp[-2].minor.yy387);
108113107911
}
108114107912
yygotominor.yy387 = yymsp[0].minor.yy387;
108115107913
}
108116
-#line 2530 "parse.c"
108117107914
break;
108118107915
case 116: /* multiselect_op ::= UNION ALL */
108119
-#line 420 "parse.y"
108120107916
{yygotominor.yy4 = TK_ALL;}
108121
-#line 2535 "parse.c"
108122107917
break;
108123107918
case 118: /* oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt orderby_opt limit_opt */
108124
-#line 424 "parse.y"
108125107919
{
108126107920
yygotominor.yy387 = sqlite3SelectNew(pParse,yymsp[-6].minor.yy322,yymsp[-5].minor.yy259,yymsp[-4].minor.yy314,yymsp[-3].minor.yy322,yymsp[-2].minor.yy314,yymsp[-1].minor.yy322,yymsp[-7].minor.yy4,yymsp[0].minor.yy292.pLimit,yymsp[0].minor.yy292.pOffset);
108127107921
}
108128
-#line 2542 "parse.c"
108129107922
break;
108130107923
case 122: /* sclp ::= selcollist COMMA */
108131107924
case 247: /* idxlist_opt ::= LP idxlist RP */ yytestcase(yyruleno==247);
108132
-#line 445 "parse.y"
108133107925
{yygotominor.yy322 = yymsp[-1].minor.yy322;}
108134
-#line 2548 "parse.c"
108135107926
break;
108136107927
case 123: /* sclp ::= */
108137107928
case 151: /* orderby_opt ::= */ yytestcase(yyruleno==151);
108138107929
case 159: /* groupby_opt ::= */ yytestcase(yyruleno==159);
108139107930
case 240: /* exprlist ::= */ yytestcase(yyruleno==240);
108140107931
case 246: /* idxlist_opt ::= */ yytestcase(yyruleno==246);
108141
-#line 446 "parse.y"
108142107932
{yygotominor.yy322 = 0;}
108143
-#line 2557 "parse.c"
108144107933
break;
108145107934
case 124: /* selcollist ::= sclp expr as */
108146
-#line 447 "parse.y"
108147107935
{
108148107936
yygotominor.yy322 = sqlite3ExprListAppend(pParse, yymsp[-2].minor.yy322, yymsp[-1].minor.yy118.pExpr);
108149107937
if( yymsp[0].minor.yy0.n>0 ) sqlite3ExprListSetName(pParse, yygotominor.yy322, &yymsp[0].minor.yy0, 1);
108150107938
sqlite3ExprListSetSpan(pParse,yygotominor.yy322,&yymsp[-1].minor.yy118);
108151107939
}
108152
-#line 2566 "parse.c"
108153107940
break;
108154107941
case 125: /* selcollist ::= sclp STAR */
108155
-#line 452 "parse.y"
108156107942
{
108157107943
Expr *p = sqlite3Expr(pParse->db, TK_ALL, 0);
108158107944
yygotominor.yy322 = sqlite3ExprListAppend(pParse, yymsp[-1].minor.yy322, p);
108159107945
}
108160
-#line 2574 "parse.c"
108161107946
break;
108162107947
case 126: /* selcollist ::= sclp nm DOT STAR */
108163
-#line 456 "parse.y"
108164107948
{
108165107949
Expr *pRight = sqlite3PExpr(pParse, TK_ALL, 0, 0, &yymsp[0].minor.yy0);
108166107950
Expr *pLeft = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-2].minor.yy0);
108167107951
Expr *pDot = sqlite3PExpr(pParse, TK_DOT, pLeft, pRight, 0);
108168107952
yygotominor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-3].minor.yy322, pDot);
108169107953
}
108170
-#line 2584 "parse.c"
108171107954
break;
108172107955
case 129: /* as ::= */
108173
-#line 469 "parse.y"
108174107956
{yygotominor.yy0.n = 0;}
108175
-#line 2589 "parse.c"
108176107957
break;
108177107958
case 130: /* from ::= */
108178
-#line 481 "parse.y"
108179107959
{yygotominor.yy259 = sqlite3DbMallocZero(pParse->db, sizeof(*yygotominor.yy259));}
108180
-#line 2594 "parse.c"
108181107960
break;
108182107961
case 131: /* from ::= FROM seltablist */
108183
-#line 482 "parse.y"
108184107962
{
108185107963
yygotominor.yy259 = yymsp[0].minor.yy259;
108186107964
sqlite3SrcListShiftJoinType(yygotominor.yy259);
108187107965
}
108188
-#line 2602 "parse.c"
108189107966
break;
108190107967
case 132: /* stl_prefix ::= seltablist joinop */
108191
-#line 490 "parse.y"
108192107968
{
108193107969
yygotominor.yy259 = yymsp[-1].minor.yy259;
108194107970
if( ALWAYS(yygotominor.yy259 && yygotominor.yy259->nSrc>0) ) yygotominor.yy259->a[yygotominor.yy259->nSrc-1].jointype = (u8)yymsp[0].minor.yy4;
108195107971
}
108196
-#line 2610 "parse.c"
108197107972
break;
108198107973
case 133: /* stl_prefix ::= */
108199
-#line 494 "parse.y"
108200107974
{yygotominor.yy259 = 0;}
108201
-#line 2615 "parse.c"
108202107975
break;
108203107976
case 134: /* seltablist ::= stl_prefix nm dbnm as indexed_opt on_opt using_opt */
108204
-#line 495 "parse.y"
108205107977
{
108206107978
yygotominor.yy259 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy259,&yymsp[-5].minor.yy0,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,0,yymsp[-1].minor.yy314,yymsp[0].minor.yy384);
108207107979
sqlite3SrcListIndexedBy(pParse, yygotominor.yy259, &yymsp[-2].minor.yy0);
108208107980
}
108209
-#line 2623 "parse.c"
108210107981
break;
108211107982
case 135: /* seltablist ::= stl_prefix LP select RP as on_opt using_opt */
108212
-#line 501 "parse.y"
108213107983
{
108214107984
yygotominor.yy259 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy259,0,0,&yymsp[-2].minor.yy0,yymsp[-4].minor.yy387,yymsp[-1].minor.yy314,yymsp[0].minor.yy384);
108215107985
}
108216
-#line 2630 "parse.c"
108217107986
break;
108218107987
case 136: /* seltablist ::= stl_prefix LP seltablist RP as on_opt using_opt */
108219
-#line 505 "parse.y"
108220107988
{
108221107989
if( yymsp[-6].minor.yy259==0 && yymsp[-2].minor.yy0.n==0 && yymsp[-1].minor.yy314==0 && yymsp[0].minor.yy384==0 ){
108222107990
yygotominor.yy259 = yymsp[-4].minor.yy259;
108223107991
}else{
108224107992
Select *pSubquery;
@@ -108225,260 +107993,180 @@
108225107993
sqlite3SrcListShiftJoinType(yymsp[-4].minor.yy259);
108226107994
pSubquery = sqlite3SelectNew(pParse,0,yymsp[-4].minor.yy259,0,0,0,0,0,0,0);
108227107995
yygotominor.yy259 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy259,0,0,&yymsp[-2].minor.yy0,pSubquery,yymsp[-1].minor.yy314,yymsp[0].minor.yy384);
108228107996
}
108229107997
}
108230
-#line 2644 "parse.c"
108231107998
break;
108232107999
case 137: /* dbnm ::= */
108233108000
case 146: /* indexed_opt ::= */ yytestcase(yyruleno==146);
108234
-#line 530 "parse.y"
108235108001
{yygotominor.yy0.z=0; yygotominor.yy0.n=0;}
108236
-#line 2650 "parse.c"
108237108002
break;
108238108003
case 139: /* fullname ::= nm dbnm */
108239
-#line 535 "parse.y"
108240108004
{yygotominor.yy259 = sqlite3SrcListAppend(pParse->db,0,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0);}
108241
-#line 2655 "parse.c"
108242108005
break;
108243108006
case 140: /* joinop ::= COMMA|JOIN */
108244
-#line 539 "parse.y"
108245108007
{ yygotominor.yy4 = JT_INNER; }
108246
-#line 2660 "parse.c"
108247108008
break;
108248108009
case 141: /* joinop ::= JOIN_KW JOIN */
108249
-#line 540 "parse.y"
108250108010
{ yygotominor.yy4 = sqlite3JoinType(pParse,&yymsp[-1].minor.yy0,0,0); }
108251
-#line 2665 "parse.c"
108252108011
break;
108253108012
case 142: /* joinop ::= JOIN_KW nm JOIN */
108254
-#line 541 "parse.y"
108255108013
{ yygotominor.yy4 = sqlite3JoinType(pParse,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0,0); }
108256
-#line 2670 "parse.c"
108257108014
break;
108258108015
case 143: /* joinop ::= JOIN_KW nm nm JOIN */
108259
-#line 543 "parse.y"
108260108016
{ yygotominor.yy4 = sqlite3JoinType(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0); }
108261
-#line 2675 "parse.c"
108262108017
break;
108263108018
case 144: /* on_opt ::= ON expr */
108264108019
case 155: /* sortitem ::= expr */ yytestcase(yyruleno==155);
108265108020
case 162: /* having_opt ::= HAVING expr */ yytestcase(yyruleno==162);
108266108021
case 169: /* where_opt ::= WHERE expr */ yytestcase(yyruleno==169);
108267108022
case 235: /* case_else ::= ELSE expr */ yytestcase(yyruleno==235);
108268108023
case 237: /* case_operand ::= expr */ yytestcase(yyruleno==237);
108269
-#line 547 "parse.y"
108270108024
{yygotominor.yy314 = yymsp[0].minor.yy118.pExpr;}
108271
-#line 2685 "parse.c"
108272108025
break;
108273108026
case 145: /* on_opt ::= */
108274108027
case 161: /* having_opt ::= */ yytestcase(yyruleno==161);
108275108028
case 168: /* where_opt ::= */ yytestcase(yyruleno==168);
108276108029
case 236: /* case_else ::= */ yytestcase(yyruleno==236);
108277108030
case 238: /* case_operand ::= */ yytestcase(yyruleno==238);
108278
-#line 548 "parse.y"
108279108031
{yygotominor.yy314 = 0;}
108280
-#line 2694 "parse.c"
108281108032
break;
108282108033
case 148: /* indexed_opt ::= NOT INDEXED */
108283
-#line 563 "parse.y"
108284108034
{yygotominor.yy0.z=0; yygotominor.yy0.n=1;}
108285
-#line 2699 "parse.c"
108286108035
break;
108287108036
case 149: /* using_opt ::= USING LP inscollist RP */
108288108037
case 181: /* inscollist_opt ::= LP inscollist RP */ yytestcase(yyruleno==181);
108289
-#line 567 "parse.y"
108290108038
{yygotominor.yy384 = yymsp[-1].minor.yy384;}
108291
-#line 2705 "parse.c"
108292108039
break;
108293108040
case 150: /* using_opt ::= */
108294108041
case 180: /* inscollist_opt ::= */ yytestcase(yyruleno==180);
108295
-#line 568 "parse.y"
108296108042
{yygotominor.yy384 = 0;}
108297
-#line 2711 "parse.c"
108298108043
break;
108299108044
case 152: /* orderby_opt ::= ORDER BY sortlist */
108300108045
case 160: /* groupby_opt ::= GROUP BY nexprlist */ yytestcase(yyruleno==160);
108301108046
case 239: /* exprlist ::= nexprlist */ yytestcase(yyruleno==239);
108302
-#line 579 "parse.y"
108303108047
{yygotominor.yy322 = yymsp[0].minor.yy322;}
108304
-#line 2718 "parse.c"
108305108048
break;
108306108049
case 153: /* sortlist ::= sortlist COMMA sortitem sortorder */
108307
-#line 580 "parse.y"
108308108050
{
108309108051
yygotominor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-3].minor.yy322,yymsp[-1].minor.yy314);
108310108052
if( yygotominor.yy322 ) yygotominor.yy322->a[yygotominor.yy322->nExpr-1].sortOrder = (u8)yymsp[0].minor.yy4;
108311108053
}
108312
-#line 2726 "parse.c"
108313108054
break;
108314108055
case 154: /* sortlist ::= sortitem sortorder */
108315
-#line 584 "parse.y"
108316108056
{
108317108057
yygotominor.yy322 = sqlite3ExprListAppend(pParse,0,yymsp[-1].minor.yy314);
108318108058
if( yygotominor.yy322 && ALWAYS(yygotominor.yy322->a) ) yygotominor.yy322->a[0].sortOrder = (u8)yymsp[0].minor.yy4;
108319108059
}
108320
-#line 2734 "parse.c"
108321108060
break;
108322108061
case 156: /* sortorder ::= ASC */
108323108062
case 158: /* sortorder ::= */ yytestcase(yyruleno==158);
108324
-#line 592 "parse.y"
108325108063
{yygotominor.yy4 = SQLITE_SO_ASC;}
108326
-#line 2740 "parse.c"
108327108064
break;
108328108065
case 157: /* sortorder ::= DESC */
108329
-#line 593 "parse.y"
108330108066
{yygotominor.yy4 = SQLITE_SO_DESC;}
108331
-#line 2745 "parse.c"
108332108067
break;
108333108068
case 163: /* limit_opt ::= */
108334
-#line 619 "parse.y"
108335108069
{yygotominor.yy292.pLimit = 0; yygotominor.yy292.pOffset = 0;}
108336
-#line 2750 "parse.c"
108337108070
break;
108338108071
case 164: /* limit_opt ::= LIMIT expr */
108339
-#line 620 "parse.y"
108340108072
{yygotominor.yy292.pLimit = yymsp[0].minor.yy118.pExpr; yygotominor.yy292.pOffset = 0;}
108341
-#line 2755 "parse.c"
108342108073
break;
108343108074
case 165: /* limit_opt ::= LIMIT expr OFFSET expr */
108344
-#line 622 "parse.y"
108345108075
{yygotominor.yy292.pLimit = yymsp[-2].minor.yy118.pExpr; yygotominor.yy292.pOffset = yymsp[0].minor.yy118.pExpr;}
108346
-#line 2760 "parse.c"
108347108076
break;
108348108077
case 166: /* limit_opt ::= LIMIT expr COMMA expr */
108349
-#line 624 "parse.y"
108350108078
{yygotominor.yy292.pOffset = yymsp[-2].minor.yy118.pExpr; yygotominor.yy292.pLimit = yymsp[0].minor.yy118.pExpr;}
108351
-#line 2765 "parse.c"
108352108079
break;
108353108080
case 167: /* cmd ::= DELETE FROM fullname indexed_opt where_opt */
108354
-#line 637 "parse.y"
108355108081
{
108356108082
sqlite3SrcListIndexedBy(pParse, yymsp[-2].minor.yy259, &yymsp[-1].minor.yy0);
108357108083
sqlite3DeleteFrom(pParse,yymsp[-2].minor.yy259,yymsp[0].minor.yy314);
108358108084
}
108359
-#line 2773 "parse.c"
108360108085
break;
108361108086
case 170: /* cmd ::= UPDATE orconf fullname indexed_opt SET setlist where_opt */
108362
-#line 660 "parse.y"
108363108087
{
108364108088
sqlite3SrcListIndexedBy(pParse, yymsp[-4].minor.yy259, &yymsp[-3].minor.yy0);
108365108089
sqlite3ExprListCheckLength(pParse,yymsp[-1].minor.yy322,"set list");
108366108090
sqlite3Update(pParse,yymsp[-4].minor.yy259,yymsp[-1].minor.yy322,yymsp[0].minor.yy314,yymsp[-5].minor.yy210);
108367108091
}
108368
-#line 2782 "parse.c"
108369108092
break;
108370108093
case 171: /* setlist ::= setlist COMMA nm EQ expr */
108371
-#line 670 "parse.y"
108372108094
{
108373108095
yygotominor.yy322 = sqlite3ExprListAppend(pParse, yymsp[-4].minor.yy322, yymsp[0].minor.yy118.pExpr);
108374108096
sqlite3ExprListSetName(pParse, yygotominor.yy322, &yymsp[-2].minor.yy0, 1);
108375108097
}
108376
-#line 2790 "parse.c"
108377108098
break;
108378108099
case 172: /* setlist ::= nm EQ expr */
108379
-#line 674 "parse.y"
108380108100
{
108381108101
yygotominor.yy322 = sqlite3ExprListAppend(pParse, 0, yymsp[0].minor.yy118.pExpr);
108382108102
sqlite3ExprListSetName(pParse, yygotominor.yy322, &yymsp[-2].minor.yy0, 1);
108383108103
}
108384
-#line 2798 "parse.c"
108385108104
break;
108386108105
case 173: /* cmd ::= insert_cmd INTO fullname inscollist_opt VALUES LP itemlist RP */
108387
-#line 683 "parse.y"
108388108106
{sqlite3Insert(pParse, yymsp[-5].minor.yy259, yymsp[-1].minor.yy322, 0, yymsp[-4].minor.yy384, yymsp[-7].minor.yy210);}
108389
-#line 2803 "parse.c"
108390108107
break;
108391108108
case 174: /* cmd ::= insert_cmd INTO fullname inscollist_opt select */
108392
-#line 685 "parse.y"
108393108109
{sqlite3Insert(pParse, yymsp[-2].minor.yy259, 0, yymsp[0].minor.yy387, yymsp[-1].minor.yy384, yymsp[-4].minor.yy210);}
108394
-#line 2808 "parse.c"
108395108110
break;
108396108111
case 175: /* cmd ::= insert_cmd INTO fullname inscollist_opt DEFAULT VALUES */
108397
-#line 687 "parse.y"
108398108112
{sqlite3Insert(pParse, yymsp[-3].minor.yy259, 0, 0, yymsp[-2].minor.yy384, yymsp[-5].minor.yy210);}
108399
-#line 2813 "parse.c"
108400108113
break;
108401108114
case 176: /* insert_cmd ::= INSERT orconf */
108402
-#line 690 "parse.y"
108403108115
{yygotominor.yy210 = yymsp[0].minor.yy210;}
108404
-#line 2818 "parse.c"
108405108116
break;
108406108117
case 177: /* insert_cmd ::= REPLACE */
108407
-#line 691 "parse.y"
108408108118
{yygotominor.yy210 = OE_Replace;}
108409
-#line 2823 "parse.c"
108410108119
break;
108411108120
case 178: /* itemlist ::= itemlist COMMA expr */
108412108121
case 241: /* nexprlist ::= nexprlist COMMA expr */ yytestcase(yyruleno==241);
108413
-#line 698 "parse.y"
108414108122
{yygotominor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-2].minor.yy322,yymsp[0].minor.yy118.pExpr);}
108415
-#line 2829 "parse.c"
108416108123
break;
108417108124
case 179: /* itemlist ::= expr */
108418108125
case 242: /* nexprlist ::= expr */ yytestcase(yyruleno==242);
108419
-#line 700 "parse.y"
108420108126
{yygotominor.yy322 = sqlite3ExprListAppend(pParse,0,yymsp[0].minor.yy118.pExpr);}
108421
-#line 2835 "parse.c"
108422108127
break;
108423108128
case 182: /* inscollist ::= inscollist COMMA nm */
108424
-#line 710 "parse.y"
108425108129
{yygotominor.yy384 = sqlite3IdListAppend(pParse->db,yymsp[-2].minor.yy384,&yymsp[0].minor.yy0);}
108426
-#line 2840 "parse.c"
108427108130
break;
108428108131
case 183: /* inscollist ::= nm */
108429
-#line 712 "parse.y"
108430108132
{yygotominor.yy384 = sqlite3IdListAppend(pParse->db,0,&yymsp[0].minor.yy0);}
108431
-#line 2845 "parse.c"
108432108133
break;
108433108134
case 184: /* expr ::= term */
108434
-#line 743 "parse.y"
108435108135
{yygotominor.yy118 = yymsp[0].minor.yy118;}
108436
-#line 2850 "parse.c"
108437108136
break;
108438108137
case 185: /* expr ::= LP expr RP */
108439
-#line 744 "parse.y"
108440108138
{yygotominor.yy118.pExpr = yymsp[-1].minor.yy118.pExpr; spanSet(&yygotominor.yy118,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0);}
108441
-#line 2855 "parse.c"
108442108139
break;
108443108140
case 186: /* term ::= NULL */
108444108141
case 191: /* term ::= INTEGER|FLOAT|BLOB */ yytestcase(yyruleno==191);
108445108142
case 192: /* term ::= STRING */ yytestcase(yyruleno==192);
108446
-#line 745 "parse.y"
108447108143
{spanExpr(&yygotominor.yy118, pParse, yymsp[0].major, &yymsp[0].minor.yy0);}
108448
-#line 2862 "parse.c"
108449108144
break;
108450108145
case 187: /* expr ::= id */
108451108146
case 188: /* expr ::= JOIN_KW */ yytestcase(yyruleno==188);
108452
-#line 746 "parse.y"
108453108147
{spanExpr(&yygotominor.yy118, pParse, TK_ID, &yymsp[0].minor.yy0);}
108454
-#line 2868 "parse.c"
108455108148
break;
108456108149
case 189: /* expr ::= nm DOT nm */
108457
-#line 748 "parse.y"
108458108150
{
108459108151
Expr *temp1 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-2].minor.yy0);
108460108152
Expr *temp2 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[0].minor.yy0);
108461108153
yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_DOT, temp1, temp2, 0);
108462108154
spanSet(&yygotominor.yy118,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0);
108463108155
}
108464
-#line 2878 "parse.c"
108465108156
break;
108466108157
case 190: /* expr ::= nm DOT nm DOT nm */
108467
-#line 754 "parse.y"
108468108158
{
108469108159
Expr *temp1 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-4].minor.yy0);
108470108160
Expr *temp2 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-2].minor.yy0);
108471108161
Expr *temp3 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[0].minor.yy0);
108472108162
Expr *temp4 = sqlite3PExpr(pParse, TK_DOT, temp2, temp3, 0);
108473108163
yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_DOT, temp1, temp4, 0);
108474108164
spanSet(&yygotominor.yy118,&yymsp[-4].minor.yy0,&yymsp[0].minor.yy0);
108475108165
}
108476
-#line 2890 "parse.c"
108477108166
break;
108478108167
case 193: /* expr ::= REGISTER */
108479
-#line 764 "parse.y"
108480108168
{
108481108169
/* When doing a nested parse, one can include terms in an expression
108482108170
** that look like this: #1 #2 ... These terms refer to registers
108483108171
** in the virtual machine. #N is the N-th register. */
108484108172
if( pParse->nested==0 ){
@@ -108488,40 +108176,32 @@
108488108176
yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_REGISTER, 0, 0, &yymsp[0].minor.yy0);
108489108177
if( yygotominor.yy118.pExpr ) sqlite3GetInt32(&yymsp[0].minor.yy0.z[1], &yygotominor.yy118.pExpr->iTable);
108490108178
}
108491108179
spanSet(&yygotominor.yy118, &yymsp[0].minor.yy0, &yymsp[0].minor.yy0);
108492108180
}
108493
-#line 2907 "parse.c"
108494108181
break;
108495108182
case 194: /* expr ::= VARIABLE */
108496
-#line 777 "parse.y"
108497108183
{
108498108184
spanExpr(&yygotominor.yy118, pParse, TK_VARIABLE, &yymsp[0].minor.yy0);
108499108185
sqlite3ExprAssignVarNumber(pParse, yygotominor.yy118.pExpr);
108500108186
spanSet(&yygotominor.yy118, &yymsp[0].minor.yy0, &yymsp[0].minor.yy0);
108501108187
}
108502
-#line 2916 "parse.c"
108503108188
break;
108504108189
case 195: /* expr ::= expr COLLATE ids */
108505
-#line 782 "parse.y"
108506108190
{
108507108191
yygotominor.yy118.pExpr = sqlite3ExprSetCollByToken(pParse, yymsp[-2].minor.yy118.pExpr, &yymsp[0].minor.yy0);
108508108192
yygotominor.yy118.zStart = yymsp[-2].minor.yy118.zStart;
108509108193
yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
108510108194
}
108511
-#line 2925 "parse.c"
108512108195
break;
108513108196
case 196: /* expr ::= CAST LP expr AS typetoken RP */
108514
-#line 788 "parse.y"
108515108197
{
108516108198
yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_CAST, yymsp[-3].minor.yy118.pExpr, 0, &yymsp[-1].minor.yy0);
108517108199
spanSet(&yygotominor.yy118,&yymsp[-5].minor.yy0,&yymsp[0].minor.yy0);
108518108200
}
108519
-#line 2933 "parse.c"
108520108201
break;
108521108202
case 197: /* expr ::= ID LP distinct exprlist RP */
108522
-#line 793 "parse.y"
108523108203
{
108524108204
if( yymsp[-1].minor.yy322 && yymsp[-1].minor.yy322->nExpr>pParse->db->aLimit[SQLITE_LIMIT_FUNCTION_ARG] ){
108525108205
sqlite3ErrorMsg(pParse, "too many arguments on function %T", &yymsp[-4].minor.yy0);
108526108206
}
108527108207
yygotominor.yy118.pExpr = sqlite3ExprFunction(pParse, yymsp[-1].minor.yy322, &yymsp[-4].minor.yy0);
@@ -108528,59 +108208,47 @@
108528108208
spanSet(&yygotominor.yy118,&yymsp[-4].minor.yy0,&yymsp[0].minor.yy0);
108529108209
if( yymsp[-2].minor.yy4 && yygotominor.yy118.pExpr ){
108530108210
yygotominor.yy118.pExpr->flags |= EP_Distinct;
108531108211
}
108532108212
}
108533
-#line 2947 "parse.c"
108534108213
break;
108535108214
case 198: /* expr ::= ID LP STAR RP */
108536
-#line 803 "parse.y"
108537108215
{
108538108216
yygotominor.yy118.pExpr = sqlite3ExprFunction(pParse, 0, &yymsp[-3].minor.yy0);
108539108217
spanSet(&yygotominor.yy118,&yymsp[-3].minor.yy0,&yymsp[0].minor.yy0);
108540108218
}
108541
-#line 2955 "parse.c"
108542108219
break;
108543108220
case 199: /* term ::= CTIME_KW */
108544
-#line 807 "parse.y"
108545108221
{
108546108222
/* The CURRENT_TIME, CURRENT_DATE, and CURRENT_TIMESTAMP values are
108547108223
** treated as functions that return constants */
108548108224
yygotominor.yy118.pExpr = sqlite3ExprFunction(pParse, 0,&yymsp[0].minor.yy0);
108549108225
if( yygotominor.yy118.pExpr ){
108550108226
yygotominor.yy118.pExpr->op = TK_CONST_FUNC;
108551108227
}
108552108228
spanSet(&yygotominor.yy118, &yymsp[0].minor.yy0, &yymsp[0].minor.yy0);
108553108229
}
108554
-#line 2968 "parse.c"
108555108230
break;
108556108231
case 200: /* expr ::= expr AND expr */
108557108232
case 201: /* expr ::= expr OR expr */ yytestcase(yyruleno==201);
108558108233
case 202: /* expr ::= expr LT|GT|GE|LE expr */ yytestcase(yyruleno==202);
108559108234
case 203: /* expr ::= expr EQ|NE expr */ yytestcase(yyruleno==203);
108560108235
case 204: /* expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr */ yytestcase(yyruleno==204);
108561108236
case 205: /* expr ::= expr PLUS|MINUS expr */ yytestcase(yyruleno==205);
108562108237
case 206: /* expr ::= expr STAR|SLASH|REM expr */ yytestcase(yyruleno==206);
108563108238
case 207: /* expr ::= expr CONCAT expr */ yytestcase(yyruleno==207);
108564
-#line 834 "parse.y"
108565108239
{spanBinaryExpr(&yygotominor.yy118,pParse,yymsp[-1].major,&yymsp[-2].minor.yy118,&yymsp[0].minor.yy118);}
108566
-#line 2980 "parse.c"
108567108240
break;
108568108241
case 208: /* likeop ::= LIKE_KW */
108569108242
case 210: /* likeop ::= MATCH */ yytestcase(yyruleno==210);
108570
-#line 847 "parse.y"
108571108243
{yygotominor.yy342.eOperator = yymsp[0].minor.yy0; yygotominor.yy342.not = 0;}
108572
-#line 2986 "parse.c"
108573108244
break;
108574108245
case 209: /* likeop ::= NOT LIKE_KW */
108575108246
case 211: /* likeop ::= NOT MATCH */ yytestcase(yyruleno==211);
108576
-#line 848 "parse.y"
108577108247
{yygotominor.yy342.eOperator = yymsp[0].minor.yy0; yygotominor.yy342.not = 1;}
108578
-#line 2992 "parse.c"
108579108248
break;
108580108249
case 212: /* expr ::= expr likeop expr */
108581
-#line 851 "parse.y"
108582108250
{
108583108251
ExprList *pList;
108584108252
pList = sqlite3ExprListAppend(pParse,0, yymsp[0].minor.yy118.pExpr);
108585108253
pList = sqlite3ExprListAppend(pParse,pList, yymsp[-2].minor.yy118.pExpr);
108586108254
yygotominor.yy118.pExpr = sqlite3ExprFunction(pParse, pList, &yymsp[-1].minor.yy342.eOperator);
@@ -108587,14 +108255,12 @@
108587108255
if( yymsp[-1].minor.yy342.not ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0);
108588108256
yygotominor.yy118.zStart = yymsp[-2].minor.yy118.zStart;
108589108257
yygotominor.yy118.zEnd = yymsp[0].minor.yy118.zEnd;
108590108258
if( yygotominor.yy118.pExpr ) yygotominor.yy118.pExpr->flags |= EP_InfixFunc;
108591108259
}
108592
-#line 3006 "parse.c"
108593108260
break;
108594108261
case 213: /* expr ::= expr likeop expr ESCAPE expr */
108595
-#line 861 "parse.y"
108596108262
{
108597108263
ExprList *pList;
108598108264
pList = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy118.pExpr);
108599108265
pList = sqlite3ExprListAppend(pParse,pList, yymsp[-4].minor.yy118.pExpr);
108600108266
pList = sqlite3ExprListAppend(pParse,pList, yymsp[0].minor.yy118.pExpr);
@@ -108602,56 +108268,40 @@
108602108268
if( yymsp[-3].minor.yy342.not ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0);
108603108269
yygotominor.yy118.zStart = yymsp[-4].minor.yy118.zStart;
108604108270
yygotominor.yy118.zEnd = yymsp[0].minor.yy118.zEnd;
108605108271
if( yygotominor.yy118.pExpr ) yygotominor.yy118.pExpr->flags |= EP_InfixFunc;
108606108272
}
108607
-#line 3021 "parse.c"
108608108273
break;
108609108274
case 214: /* expr ::= expr ISNULL|NOTNULL */
108610
-#line 889 "parse.y"
108611108275
{spanUnaryPostfix(&yygotominor.yy118,pParse,yymsp[0].major,&yymsp[-1].minor.yy118,&yymsp[0].minor.yy0);}
108612
-#line 3026 "parse.c"
108613108276
break;
108614108277
case 215: /* expr ::= expr NOT NULL */
108615
-#line 890 "parse.y"
108616108278
{spanUnaryPostfix(&yygotominor.yy118,pParse,TK_NOTNULL,&yymsp[-2].minor.yy118,&yymsp[0].minor.yy0);}
108617
-#line 3031 "parse.c"
108618108279
break;
108619108280
case 216: /* expr ::= expr IS expr */
108620
-#line 911 "parse.y"
108621108281
{
108622108282
spanBinaryExpr(&yygotominor.yy118,pParse,TK_IS,&yymsp[-2].minor.yy118,&yymsp[0].minor.yy118);
108623108283
binaryToUnaryIfNull(pParse, yymsp[0].minor.yy118.pExpr, yygotominor.yy118.pExpr, TK_ISNULL);
108624108284
}
108625
-#line 3039 "parse.c"
108626108285
break;
108627108286
case 217: /* expr ::= expr IS NOT expr */
108628
-#line 915 "parse.y"
108629108287
{
108630108288
spanBinaryExpr(&yygotominor.yy118,pParse,TK_ISNOT,&yymsp[-3].minor.yy118,&yymsp[0].minor.yy118);
108631108289
binaryToUnaryIfNull(pParse, yymsp[0].minor.yy118.pExpr, yygotominor.yy118.pExpr, TK_NOTNULL);
108632108290
}
108633
-#line 3047 "parse.c"
108634108291
break;
108635108292
case 218: /* expr ::= NOT expr */
108636108293
case 219: /* expr ::= BITNOT expr */ yytestcase(yyruleno==219);
108637
-#line 938 "parse.y"
108638108294
{spanUnaryPrefix(&yygotominor.yy118,pParse,yymsp[-1].major,&yymsp[0].minor.yy118,&yymsp[-1].minor.yy0);}
108639
-#line 3053 "parse.c"
108640108295
break;
108641108296
case 220: /* expr ::= MINUS expr */
108642
-#line 941 "parse.y"
108643108297
{spanUnaryPrefix(&yygotominor.yy118,pParse,TK_UMINUS,&yymsp[0].minor.yy118,&yymsp[-1].minor.yy0);}
108644
-#line 3058 "parse.c"
108645108298
break;
108646108299
case 221: /* expr ::= PLUS expr */
108647
-#line 943 "parse.y"
108648108300
{spanUnaryPrefix(&yygotominor.yy118,pParse,TK_UPLUS,&yymsp[0].minor.yy118,&yymsp[-1].minor.yy0);}
108649
-#line 3063 "parse.c"
108650108301
break;
108651108302
case 224: /* expr ::= expr between_op expr AND expr */
108652
-#line 948 "parse.y"
108653108303
{
108654108304
ExprList *pList = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy118.pExpr);
108655108305
pList = sqlite3ExprListAppend(pParse,pList, yymsp[0].minor.yy118.pExpr);
108656108306
yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_BETWEEN, yymsp[-4].minor.yy118.pExpr, 0, 0);
108657108307
if( yygotominor.yy118.pExpr ){
@@ -108661,14 +108311,12 @@
108661108311
}
108662108312
if( yymsp[-3].minor.yy4 ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0);
108663108313
yygotominor.yy118.zStart = yymsp[-4].minor.yy118.zStart;
108664108314
yygotominor.yy118.zEnd = yymsp[0].minor.yy118.zEnd;
108665108315
}
108666
-#line 3080 "parse.c"
108667108316
break;
108668108317
case 227: /* expr ::= expr in_op LP exprlist RP */
108669
-#line 965 "parse.y"
108670108318
{
108671108319
if( yymsp[-1].minor.yy322==0 ){
108672108320
/* Expressions of the form
108673108321
**
108674108322
** expr1 IN ()
@@ -108690,14 +108338,12 @@
108690108338
if( yymsp[-3].minor.yy4 ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0);
108691108339
}
108692108340
yygotominor.yy118.zStart = yymsp[-4].minor.yy118.zStart;
108693108341
yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
108694108342
}
108695
-#line 3109 "parse.c"
108696108343
break;
108697108344
case 228: /* expr ::= LP select RP */
108698
-#line 990 "parse.y"
108699108345
{
108700108346
yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_SELECT, 0, 0, 0);
108701108347
if( yygotominor.yy118.pExpr ){
108702108348
yygotominor.yy118.pExpr->x.pSelect = yymsp[-1].minor.yy387;
108703108349
ExprSetProperty(yygotominor.yy118.pExpr, EP_xIsSelect);
@@ -108706,14 +108352,12 @@
108706108352
sqlite3SelectDelete(pParse->db, yymsp[-1].minor.yy387);
108707108353
}
108708108354
yygotominor.yy118.zStart = yymsp[-2].minor.yy0.z;
108709108355
yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
108710108356
}
108711
-#line 3125 "parse.c"
108712108357
break;
108713108358
case 229: /* expr ::= expr in_op LP select RP */
108714
-#line 1002 "parse.y"
108715108359
{
108716108360
yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy118.pExpr, 0, 0);
108717108361
if( yygotominor.yy118.pExpr ){
108718108362
yygotominor.yy118.pExpr->x.pSelect = yymsp[-1].minor.yy387;
108719108363
ExprSetProperty(yygotominor.yy118.pExpr, EP_xIsSelect);
@@ -108723,14 +108367,12 @@
108723108367
}
108724108368
if( yymsp[-3].minor.yy4 ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0);
108725108369
yygotominor.yy118.zStart = yymsp[-4].minor.yy118.zStart;
108726108370
yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
108727108371
}
108728
-#line 3142 "parse.c"
108729108372
break;
108730108373
case 230: /* expr ::= expr in_op nm dbnm */
108731
-#line 1015 "parse.y"
108732108374
{
108733108375
SrcList *pSrc = sqlite3SrcListAppend(pParse->db, 0,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0);
108734108376
yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_IN, yymsp[-3].minor.yy118.pExpr, 0, 0);
108735108377
if( yygotominor.yy118.pExpr ){
108736108378
yygotominor.yy118.pExpr->x.pSelect = sqlite3SelectNew(pParse, 0,pSrc,0,0,0,0,0,0,0);
@@ -108741,14 +108383,12 @@
108741108383
}
108742108384
if( yymsp[-2].minor.yy4 ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0);
108743108385
yygotominor.yy118.zStart = yymsp[-3].minor.yy118.zStart;
108744108386
yygotominor.yy118.zEnd = yymsp[0].minor.yy0.z ? &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n] : &yymsp[-1].minor.yy0.z[yymsp[-1].minor.yy0.n];
108745108387
}
108746
-#line 3160 "parse.c"
108747108388
break;
108748108389
case 231: /* expr ::= EXISTS LP select RP */
108749
-#line 1029 "parse.y"
108750108390
{
108751108391
Expr *p = yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_EXISTS, 0, 0, 0);
108752108392
if( p ){
108753108393
p->x.pSelect = yymsp[-1].minor.yy387;
108754108394
ExprSetProperty(p, EP_xIsSelect);
@@ -108757,14 +108397,12 @@
108757108397
sqlite3SelectDelete(pParse->db, yymsp[-1].minor.yy387);
108758108398
}
108759108399
yygotominor.yy118.zStart = yymsp[-3].minor.yy0.z;
108760108400
yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
108761108401
}
108762
-#line 3176 "parse.c"
108763108402
break;
108764108403
case 232: /* expr ::= CASE case_operand case_exprlist case_else END */
108765
-#line 1044 "parse.y"
108766108404
{
108767108405
yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_CASE, yymsp[-3].minor.yy314, yymsp[-1].minor.yy314, 0);
108768108406
if( yygotominor.yy118.pExpr ){
108769108407
yygotominor.yy118.pExpr->x.pList = yymsp[-2].minor.yy322;
108770108408
sqlite3ExprSetHeight(pParse, yygotominor.yy118.pExpr);
@@ -108772,50 +108410,38 @@
108772108410
sqlite3ExprListDelete(pParse->db, yymsp[-2].minor.yy322);
108773108411
}
108774108412
yygotominor.yy118.zStart = yymsp[-4].minor.yy0.z;
108775108413
yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
108776108414
}
108777
-#line 3191 "parse.c"
108778108415
break;
108779108416
case 233: /* case_exprlist ::= case_exprlist WHEN expr THEN expr */
108780
-#line 1057 "parse.y"
108781108417
{
108782108418
yygotominor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy322, yymsp[-2].minor.yy118.pExpr);
108783108419
yygotominor.yy322 = sqlite3ExprListAppend(pParse,yygotominor.yy322, yymsp[0].minor.yy118.pExpr);
108784108420
}
108785
-#line 3199 "parse.c"
108786108421
break;
108787108422
case 234: /* case_exprlist ::= WHEN expr THEN expr */
108788
-#line 1061 "parse.y"
108789108423
{
108790108424
yygotominor.yy322 = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy118.pExpr);
108791108425
yygotominor.yy322 = sqlite3ExprListAppend(pParse,yygotominor.yy322, yymsp[0].minor.yy118.pExpr);
108792108426
}
108793
-#line 3207 "parse.c"
108794108427
break;
108795108428
case 243: /* cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP idxlist RP */
108796
-#line 1090 "parse.y"
108797108429
{
108798108430
sqlite3CreateIndex(pParse, &yymsp[-6].minor.yy0, &yymsp[-5].minor.yy0,
108799108431
sqlite3SrcListAppend(pParse->db,0,&yymsp[-3].minor.yy0,0), yymsp[-1].minor.yy322, yymsp[-9].minor.yy4,
108800108432
&yymsp[-10].minor.yy0, &yymsp[0].minor.yy0, SQLITE_SO_ASC, yymsp[-7].minor.yy4);
108801108433
}
108802
-#line 3216 "parse.c"
108803108434
break;
108804108435
case 244: /* uniqueflag ::= UNIQUE */
108805108436
case 298: /* raisetype ::= ABORT */ yytestcase(yyruleno==298);
108806
-#line 1097 "parse.y"
108807108437
{yygotominor.yy4 = OE_Abort;}
108808
-#line 3222 "parse.c"
108809108438
break;
108810108439
case 245: /* uniqueflag ::= */
108811
-#line 1098 "parse.y"
108812108440
{yygotominor.yy4 = OE_None;}
108813
-#line 3227 "parse.c"
108814108441
break;
108815108442
case 248: /* idxlist ::= idxlist COMMA nm collate sortorder */
108816
-#line 1107 "parse.y"
108817108443
{
108818108444
Expr *p = 0;
108819108445
if( yymsp[-1].minor.yy0.n>0 ){
108820108446
p = sqlite3Expr(pParse->db, TK_COLUMN, 0);
108821108447
sqlite3ExprSetCollByToken(pParse, p, &yymsp[-1].minor.yy0);
@@ -108823,14 +108449,12 @@
108823108449
yygotominor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy322, p);
108824108450
sqlite3ExprListSetName(pParse,yygotominor.yy322,&yymsp[-2].minor.yy0,1);
108825108451
sqlite3ExprListCheckLength(pParse, yygotominor.yy322, "index");
108826108452
if( yygotominor.yy322 ) yygotominor.yy322->a[yygotominor.yy322->nExpr-1].sortOrder = (u8)yymsp[0].minor.yy4;
108827108453
}
108828
-#line 3242 "parse.c"
108829108454
break;
108830108455
case 249: /* idxlist ::= nm collate sortorder */
108831
-#line 1118 "parse.y"
108832108456
{
108833108457
Expr *p = 0;
108834108458
if( yymsp[-1].minor.yy0.n>0 ){
108835108459
p = sqlite3PExpr(pParse, TK_COLUMN, 0, 0, 0);
108836108460
sqlite3ExprSetCollByToken(pParse, p, &yymsp[-1].minor.yy0);
@@ -108838,307 +108462,214 @@
108838108462
yygotominor.yy322 = sqlite3ExprListAppend(pParse,0, p);
108839108463
sqlite3ExprListSetName(pParse, yygotominor.yy322, &yymsp[-2].minor.yy0, 1);
108840108464
sqlite3ExprListCheckLength(pParse, yygotominor.yy322, "index");
108841108465
if( yygotominor.yy322 ) yygotominor.yy322->a[yygotominor.yy322->nExpr-1].sortOrder = (u8)yymsp[0].minor.yy4;
108842108466
}
108843
-#line 3257 "parse.c"
108844108467
break;
108845108468
case 250: /* collate ::= */
108846
-#line 1131 "parse.y"
108847108469
{yygotominor.yy0.z = 0; yygotominor.yy0.n = 0;}
108848
-#line 3262 "parse.c"
108849108470
break;
108850108471
case 252: /* cmd ::= DROP INDEX ifexists fullname */
108851
-#line 1137 "parse.y"
108852108472
{sqlite3DropIndex(pParse, yymsp[0].minor.yy259, yymsp[-1].minor.yy4);}
108853
-#line 3267 "parse.c"
108854108473
break;
108855108474
case 253: /* cmd ::= VACUUM */
108856108475
case 254: /* cmd ::= VACUUM nm */ yytestcase(yyruleno==254);
108857
-#line 1143 "parse.y"
108858108476
{sqlite3Vacuum(pParse);}
108859
-#line 3273 "parse.c"
108860108477
break;
108861108478
case 255: /* cmd ::= PRAGMA nm dbnm */
108862
-#line 1151 "parse.y"
108863108479
{sqlite3Pragma(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,0,0);}
108864
-#line 3278 "parse.c"
108865108480
break;
108866108481
case 256: /* cmd ::= PRAGMA nm dbnm EQ nmnum */
108867
-#line 1152 "parse.y"
108868108482
{sqlite3Pragma(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0,0);}
108869
-#line 3283 "parse.c"
108870108483
break;
108871108484
case 257: /* cmd ::= PRAGMA nm dbnm LP nmnum RP */
108872
-#line 1153 "parse.y"
108873108485
{sqlite3Pragma(pParse,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,&yymsp[-1].minor.yy0,0);}
108874
-#line 3288 "parse.c"
108875108486
break;
108876108487
case 258: /* cmd ::= PRAGMA nm dbnm EQ minus_num */
108877
-#line 1155 "parse.y"
108878108488
{sqlite3Pragma(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0,1);}
108879
-#line 3293 "parse.c"
108880108489
break;
108881108490
case 259: /* cmd ::= PRAGMA nm dbnm LP minus_num RP */
108882
-#line 1157 "parse.y"
108883108491
{sqlite3Pragma(pParse,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,&yymsp[-1].minor.yy0,1);}
108884
-#line 3298 "parse.c"
108885108492
break;
108886108493
case 270: /* cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END */
108887
-#line 1175 "parse.y"
108888108494
{
108889108495
Token all;
108890108496
all.z = yymsp[-3].minor.yy0.z;
108891108497
all.n = (int)(yymsp[0].minor.yy0.z - yymsp[-3].minor.yy0.z) + yymsp[0].minor.yy0.n;
108892108498
sqlite3FinishTrigger(pParse, yymsp[-1].minor.yy203, &all);
108893108499
}
108894
-#line 3308 "parse.c"
108895108500
break;
108896108501
case 271: /* trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause */
108897
-#line 1184 "parse.y"
108898108502
{
108899108503
sqlite3BeginTrigger(pParse, &yymsp[-7].minor.yy0, &yymsp[-6].minor.yy0, yymsp[-5].minor.yy4, yymsp[-4].minor.yy90.a, yymsp[-4].minor.yy90.b, yymsp[-2].minor.yy259, yymsp[0].minor.yy314, yymsp[-10].minor.yy4, yymsp[-8].minor.yy4);
108900108504
yygotominor.yy0 = (yymsp[-6].minor.yy0.n==0?yymsp[-7].minor.yy0:yymsp[-6].minor.yy0);
108901108505
}
108902
-#line 3316 "parse.c"
108903108506
break;
108904108507
case 272: /* trigger_time ::= BEFORE */
108905108508
case 275: /* trigger_time ::= */ yytestcase(yyruleno==275);
108906
-#line 1190 "parse.y"
108907108509
{ yygotominor.yy4 = TK_BEFORE; }
108908
-#line 3322 "parse.c"
108909108510
break;
108910108511
case 273: /* trigger_time ::= AFTER */
108911
-#line 1191 "parse.y"
108912108512
{ yygotominor.yy4 = TK_AFTER; }
108913
-#line 3327 "parse.c"
108914108513
break;
108915108514
case 274: /* trigger_time ::= INSTEAD OF */
108916
-#line 1192 "parse.y"
108917108515
{ yygotominor.yy4 = TK_INSTEAD;}
108918
-#line 3332 "parse.c"
108919108516
break;
108920108517
case 276: /* trigger_event ::= DELETE|INSERT */
108921108518
case 277: /* trigger_event ::= UPDATE */ yytestcase(yyruleno==277);
108922
-#line 1197 "parse.y"
108923108519
{yygotominor.yy90.a = yymsp[0].major; yygotominor.yy90.b = 0;}
108924
-#line 3338 "parse.c"
108925108520
break;
108926108521
case 278: /* trigger_event ::= UPDATE OF inscollist */
108927
-#line 1199 "parse.y"
108928108522
{yygotominor.yy90.a = TK_UPDATE; yygotominor.yy90.b = yymsp[0].minor.yy384;}
108929
-#line 3343 "parse.c"
108930108523
break;
108931108524
case 281: /* when_clause ::= */
108932108525
case 303: /* key_opt ::= */ yytestcase(yyruleno==303);
108933
-#line 1206 "parse.y"
108934108526
{ yygotominor.yy314 = 0; }
108935
-#line 3349 "parse.c"
108936108527
break;
108937108528
case 282: /* when_clause ::= WHEN expr */
108938108529
case 304: /* key_opt ::= KEY expr */ yytestcase(yyruleno==304);
108939
-#line 1207 "parse.y"
108940108530
{ yygotominor.yy314 = yymsp[0].minor.yy118.pExpr; }
108941
-#line 3355 "parse.c"
108942108531
break;
108943108532
case 283: /* trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI */
108944
-#line 1211 "parse.y"
108945108533
{
108946108534
assert( yymsp[-2].minor.yy203!=0 );
108947108535
yymsp[-2].minor.yy203->pLast->pNext = yymsp[-1].minor.yy203;
108948108536
yymsp[-2].minor.yy203->pLast = yymsp[-1].minor.yy203;
108949108537
yygotominor.yy203 = yymsp[-2].minor.yy203;
108950108538
}
108951
-#line 3365 "parse.c"
108952108539
break;
108953108540
case 284: /* trigger_cmd_list ::= trigger_cmd SEMI */
108954
-#line 1217 "parse.y"
108955108541
{
108956108542
assert( yymsp[-1].minor.yy203!=0 );
108957108543
yymsp[-1].minor.yy203->pLast = yymsp[-1].minor.yy203;
108958108544
yygotominor.yy203 = yymsp[-1].minor.yy203;
108959108545
}
108960
-#line 3374 "parse.c"
108961108546
break;
108962108547
case 286: /* trnm ::= nm DOT nm */
108963
-#line 1229 "parse.y"
108964108548
{
108965108549
yygotominor.yy0 = yymsp[0].minor.yy0;
108966108550
sqlite3ErrorMsg(pParse,
108967108551
"qualified table names are not allowed on INSERT, UPDATE, and DELETE "
108968108552
"statements within triggers");
108969108553
}
108970
-#line 3384 "parse.c"
108971108554
break;
108972108555
case 288: /* tridxby ::= INDEXED BY nm */
108973
-#line 1241 "parse.y"
108974108556
{
108975108557
sqlite3ErrorMsg(pParse,
108976108558
"the INDEXED BY clause is not allowed on UPDATE or DELETE statements "
108977108559
"within triggers");
108978108560
}
108979
-#line 3393 "parse.c"
108980108561
break;
108981108562
case 289: /* tridxby ::= NOT INDEXED */
108982
-#line 1246 "parse.y"
108983108563
{
108984108564
sqlite3ErrorMsg(pParse,
108985108565
"the NOT INDEXED clause is not allowed on UPDATE or DELETE statements "
108986108566
"within triggers");
108987108567
}
108988
-#line 3402 "parse.c"
108989108568
break;
108990108569
case 290: /* trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist where_opt */
108991
-#line 1259 "parse.y"
108992108570
{ yygotominor.yy203 = sqlite3TriggerUpdateStep(pParse->db, &yymsp[-4].minor.yy0, yymsp[-1].minor.yy322, yymsp[0].minor.yy314, yymsp[-5].minor.yy210); }
108993
-#line 3407 "parse.c"
108994108571
break;
108995108572
case 291: /* trigger_cmd ::= insert_cmd INTO trnm inscollist_opt VALUES LP itemlist RP */
108996
-#line 1264 "parse.y"
108997108573
{yygotominor.yy203 = sqlite3TriggerInsertStep(pParse->db, &yymsp[-5].minor.yy0, yymsp[-4].minor.yy384, yymsp[-1].minor.yy322, 0, yymsp[-7].minor.yy210);}
108998
-#line 3412 "parse.c"
108999108574
break;
109000108575
case 292: /* trigger_cmd ::= insert_cmd INTO trnm inscollist_opt select */
109001
-#line 1267 "parse.y"
109002108576
{yygotominor.yy203 = sqlite3TriggerInsertStep(pParse->db, &yymsp[-2].minor.yy0, yymsp[-1].minor.yy384, 0, yymsp[0].minor.yy387, yymsp[-4].minor.yy210);}
109003
-#line 3417 "parse.c"
109004108577
break;
109005108578
case 293: /* trigger_cmd ::= DELETE FROM trnm tridxby where_opt */
109006
-#line 1271 "parse.y"
109007108579
{yygotominor.yy203 = sqlite3TriggerDeleteStep(pParse->db, &yymsp[-2].minor.yy0, yymsp[0].minor.yy314);}
109008
-#line 3422 "parse.c"
109009108580
break;
109010108581
case 294: /* trigger_cmd ::= select */
109011
-#line 1274 "parse.y"
109012108582
{yygotominor.yy203 = sqlite3TriggerSelectStep(pParse->db, yymsp[0].minor.yy387); }
109013
-#line 3427 "parse.c"
109014108583
break;
109015108584
case 295: /* expr ::= RAISE LP IGNORE RP */
109016
-#line 1277 "parse.y"
109017108585
{
109018108586
yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_RAISE, 0, 0, 0);
109019108587
if( yygotominor.yy118.pExpr ){
109020108588
yygotominor.yy118.pExpr->affinity = OE_Ignore;
109021108589
}
109022108590
yygotominor.yy118.zStart = yymsp[-3].minor.yy0.z;
109023108591
yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
109024108592
}
109025
-#line 3439 "parse.c"
109026108593
break;
109027108594
case 296: /* expr ::= RAISE LP raisetype COMMA nm RP */
109028
-#line 1285 "parse.y"
109029108595
{
109030108596
yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_RAISE, 0, 0, &yymsp[-1].minor.yy0);
109031108597
if( yygotominor.yy118.pExpr ) {
109032108598
yygotominor.yy118.pExpr->affinity = (char)yymsp[-3].minor.yy4;
109033108599
}
109034108600
yygotominor.yy118.zStart = yymsp[-5].minor.yy0.z;
109035108601
yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
109036108602
}
109037
-#line 3451 "parse.c"
109038108603
break;
109039108604
case 297: /* raisetype ::= ROLLBACK */
109040
-#line 1296 "parse.y"
109041108605
{yygotominor.yy4 = OE_Rollback;}
109042
-#line 3456 "parse.c"
109043108606
break;
109044108607
case 299: /* raisetype ::= FAIL */
109045
-#line 1298 "parse.y"
109046108608
{yygotominor.yy4 = OE_Fail;}
109047
-#line 3461 "parse.c"
109048108609
break;
109049108610
case 300: /* cmd ::= DROP TRIGGER ifexists fullname */
109050
-#line 1303 "parse.y"
109051108611
{
109052108612
sqlite3DropTrigger(pParse,yymsp[0].minor.yy259,yymsp[-1].minor.yy4);
109053108613
}
109054
-#line 3468 "parse.c"
109055108614
break;
109056108615
case 301: /* cmd ::= ATTACH database_kw_opt expr AS expr key_opt */
109057
-#line 1310 "parse.y"
109058108616
{
109059108617
sqlite3Attach(pParse, yymsp[-3].minor.yy118.pExpr, yymsp[-1].minor.yy118.pExpr, yymsp[0].minor.yy314);
109060108618
}
109061
-#line 3475 "parse.c"
109062108619
break;
109063108620
case 302: /* cmd ::= DETACH database_kw_opt expr */
109064
-#line 1313 "parse.y"
109065108621
{
109066108622
sqlite3Detach(pParse, yymsp[0].minor.yy118.pExpr);
109067108623
}
109068
-#line 3482 "parse.c"
109069108624
break;
109070108625
case 307: /* cmd ::= REINDEX */
109071
-#line 1328 "parse.y"
109072108626
{sqlite3Reindex(pParse, 0, 0);}
109073
-#line 3487 "parse.c"
109074108627
break;
109075108628
case 308: /* cmd ::= REINDEX nm dbnm */
109076
-#line 1329 "parse.y"
109077108629
{sqlite3Reindex(pParse, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0);}
109078
-#line 3492 "parse.c"
109079108630
break;
109080108631
case 309: /* cmd ::= ANALYZE */
109081
-#line 1334 "parse.y"
109082108632
{sqlite3Analyze(pParse, 0, 0);}
109083
-#line 3497 "parse.c"
109084108633
break;
109085108634
case 310: /* cmd ::= ANALYZE nm dbnm */
109086
-#line 1335 "parse.y"
109087108635
{sqlite3Analyze(pParse, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0);}
109088
-#line 3502 "parse.c"
109089108636
break;
109090108637
case 311: /* cmd ::= ALTER TABLE fullname RENAME TO nm */
109091
-#line 1340 "parse.y"
109092108638
{
109093108639
sqlite3AlterRenameTable(pParse,yymsp[-3].minor.yy259,&yymsp[0].minor.yy0);
109094108640
}
109095
-#line 3509 "parse.c"
109096108641
break;
109097108642
case 312: /* cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt column */
109098
-#line 1343 "parse.y"
109099108643
{
109100108644
sqlite3AlterFinishAddColumn(pParse, &yymsp[0].minor.yy0);
109101108645
}
109102
-#line 3516 "parse.c"
109103108646
break;
109104108647
case 313: /* add_column_fullname ::= fullname */
109105
-#line 1346 "parse.y"
109106108648
{
109107108649
pParse->db->lookaside.bEnabled = 0;
109108108650
sqlite3AlterBeginAddColumn(pParse, yymsp[0].minor.yy259);
109109108651
}
109110
-#line 3524 "parse.c"
109111108652
break;
109112108653
case 316: /* cmd ::= create_vtab */
109113
-#line 1356 "parse.y"
109114108654
{sqlite3VtabFinishParse(pParse,0);}
109115
-#line 3529 "parse.c"
109116108655
break;
109117108656
case 317: /* cmd ::= create_vtab LP vtabarglist RP */
109118
-#line 1357 "parse.y"
109119108657
{sqlite3VtabFinishParse(pParse,&yymsp[0].minor.yy0);}
109120
-#line 3534 "parse.c"
109121108658
break;
109122108659
case 318: /* create_vtab ::= createkw VIRTUAL TABLE nm dbnm USING nm */
109123
-#line 1358 "parse.y"
109124108660
{
109125108661
sqlite3VtabBeginParse(pParse, &yymsp[-3].minor.yy0, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0);
109126108662
}
109127
-#line 3541 "parse.c"
109128108663
break;
109129108664
case 321: /* vtabarg ::= */
109130
-#line 1363 "parse.y"
109131108665
{sqlite3VtabArgInit(pParse);}
109132
-#line 3546 "parse.c"
109133108666
break;
109134108667
case 323: /* vtabargtoken ::= ANY */
109135108668
case 324: /* vtabargtoken ::= lp anylist RP */ yytestcase(yyruleno==324);
109136108669
case 325: /* lp ::= LP */ yytestcase(yyruleno==325);
109137
-#line 1365 "parse.y"
109138108670
{sqlite3VtabArgExtend(pParse,&yymsp[0].minor.yy0);}
109139
-#line 3553 "parse.c"
109140108671
break;
109141108672
default:
109142108673
/* (0) input ::= cmdlist */ yytestcase(yyruleno==0);
109143108674
/* (1) cmdlist ::= cmdlist ecmd */ yytestcase(yyruleno==1);
109144108675
/* (2) cmdlist ::= ecmd */ yytestcase(yyruleno==2);
@@ -109236,17 +108767,15 @@
109236108767
int yymajor, /* The major type of the error token */
109237108768
YYMINORTYPE yyminor /* The minor type of the error token */
109238108769
){
109239108770
sqlite3ParserARG_FETCH;
109240108771
#define TOKEN (yyminor.yy0)
109241
-#line 32 "parse.y"
109242108772
109243108773
UNUSED_PARAMETER(yymajor); /* Silence some compiler warnings */
109244108774
assert( TOKEN.z[0] ); /* The tokenizer always gives us a token */
109245108775
sqlite3ErrorMsg(pParse, "near \"%T\": syntax error", &TOKEN);
109246108776
pParse->parseError = 1;
109247
-#line 3661 "parse.c"
109248108777
sqlite3ParserARG_STORE; /* Suppress warning about unused %extra_argument variable */
109249108778
}
109250108779
109251108780
/*
109252108781
** The following is executed when the parser accepts
@@ -109436,11 +108965,10 @@
109436108965
return;
109437108966
}
109438108967
109439108968
/************** End of parse.c ***********************************************/
109440108969
/************** Begin file tokenize.c ****************************************/
109441
-#line 1 "tsrc/tokenize.c"
109442108970
/*
109443108971
** 2001 September 15
109444108972
**
109445108973
** The author disclaims copyright to this source code. In place of
109446108974
** a legal notice, here is a blessing:
@@ -109502,11 +109030,10 @@
109502109030
** named keywordhash.h and then included into this source file by
109503109031
** the #include below.
109504109032
*/
109505109033
/************** Include keywordhash.h in the middle of tokenize.c ************/
109506109034
/************** Begin file keywordhash.h *************************************/
109507
-#line 1 "tsrc/keywordhash.h"
109508109035
/***** This file contains automatically generated code ******
109509109036
**
109510109037
** The code in this file has been automatically generated by
109511109038
**
109512109039
** sqlite/tool/mkkeywordhash.c
@@ -109776,11 +109303,10 @@
109776109303
}
109777109304
#define SQLITE_N_KEYWORD 121
109778109305
109779109306
/************** End of keywordhash.h *****************************************/
109780109307
/************** Continuing where we left off in tokenize.c *******************/
109781
-#line 66 "tsrc/tokenize.c"
109782109308
109783109309
109784109310
/*
109785109311
** If X is a character that can be used in an identifier then
109786109312
** IdChar(X) will be true. Otherwise it is false.
@@ -110241,11 +109767,10 @@
110241109767
return nErr;
110242109768
}
110243109769
110244109770
/************** End of tokenize.c ********************************************/
110245109771
/************** Begin file complete.c ****************************************/
110246
-#line 1 "tsrc/complete.c"
110247109772
/*
110248109773
** 2001 September 15
110249109774
**
110250109775
** The author disclaims copyright to this source code. In place of
110251109776
** a legal notice, here is a blessing:
@@ -110527,11 +110052,10 @@
110527110052
#endif /* SQLITE_OMIT_UTF16 */
110528110053
#endif /* SQLITE_OMIT_COMPLETE */
110529110054
110530110055
/************** End of complete.c ********************************************/
110531110056
/************** Begin file main.c ********************************************/
110532
-#line 1 "tsrc/main.c"
110533110057
/*
110534110058
** 2001 September 15
110535110059
**
110536110060
** The author disclaims copyright to this source code. In place of
110537110061
** a legal notice, here is a blessing:
@@ -110548,11 +110072,10 @@
110548110072
*/
110549110073
110550110074
#ifdef SQLITE_ENABLE_FTS3
110551110075
/************** Include fts3.h in the middle of main.c ***********************/
110552110076
/************** Begin file fts3.h ********************************************/
110553
-#line 1 "tsrc/fts3.h"
110554110077
/*
110555110078
** 2006 Oct 10
110556110079
**
110557110080
** The author disclaims copyright to this source code. In place of
110558110081
** a legal notice, here is a blessing:
@@ -110577,16 +110100,14 @@
110577110100
} /* extern "C" */
110578110101
#endif /* __cplusplus */
110579110102
110580110103
/************** End of fts3.h ************************************************/
110581110104
/************** Continuing where we left off in main.c ***********************/
110582
-#line 21 "tsrc/main.c"
110583110105
#endif
110584110106
#ifdef SQLITE_ENABLE_RTREE
110585110107
/************** Include rtree.h in the middle of main.c **********************/
110586110108
/************** Begin file rtree.h *******************************************/
110587
-#line 1 "tsrc/rtree.h"
110588110109
/*
110589110110
** 2008 May 26
110590110111
**
110591110112
** The author disclaims copyright to this source code. In place of
110592110113
** a legal notice, here is a blessing:
@@ -110611,16 +110132,14 @@
110611110132
} /* extern "C" */
110612110133
#endif /* __cplusplus */
110613110134
110614110135
/************** End of rtree.h ***********************************************/
110615110136
/************** Continuing where we left off in main.c ***********************/
110616
-#line 24 "tsrc/main.c"
110617110137
#endif
110618110138
#ifdef SQLITE_ENABLE_ICU
110619110139
/************** Include sqliteicu.h in the middle of main.c ******************/
110620110140
/************** Begin file sqliteicu.h ***************************************/
110621
-#line 1 "tsrc/sqliteicu.h"
110622110141
/*
110623110142
** 2008 May 26
110624110143
**
110625110144
** The author disclaims copyright to this source code. In place of
110626110145
** a legal notice, here is a blessing:
@@ -110646,11 +110165,10 @@
110646110165
#endif /* __cplusplus */
110647110166
110648110167
110649110168
/************** End of sqliteicu.h *******************************************/
110650110169
/************** Continuing where we left off in main.c ***********************/
110651
-#line 27 "tsrc/main.c"
110652110170
#endif
110653110171
110654110172
#ifndef SQLITE_AMALGAMATION
110655110173
/* IMPLEMENTATION-OF: R-46656-45156 The sqlite3_version[] string constant
110656110174
** contains the text of SQLITE_VERSION macro.
@@ -113577,11 +113095,10 @@
113577113095
return 0;
113578113096
}
113579113097
113580113098
/************** End of main.c ************************************************/
113581113099
/************** Begin file notify.c ******************************************/
113582
-#line 1 "tsrc/notify.c"
113583113100
/*
113584113101
** 2009 March 3
113585113102
**
113586113103
** The author disclaims copyright to this source code. In place of
113587113104
** a legal notice, here is a blessing:
@@ -113911,11 +113428,10 @@
113911113428
}
113912113429
#endif
113913113430
113914113431
/************** End of notify.c **********************************************/
113915113432
/************** Begin file fts3.c ********************************************/
113916
-#line 1 "tsrc/fts3.c"
113917113433
/*
113918113434
** 2006 Oct 10
113919113435
**
113920113436
** The author disclaims copyright to this source code. In place of
113921113437
** a legal notice, here is a blessing:
@@ -114208,11 +113724,10 @@
114208113724
** into a single segment.
114209113725
*/
114210113726
114211113727
/************** Include fts3Int.h in the middle of fts3.c ********************/
114212113728
/************** Begin file fts3Int.h *****************************************/
114213
-#line 1 "tsrc/fts3Int.h"
114214113729
/*
114215113730
** 2009 Nov 12
114216113731
**
114217113732
** The author disclaims copyright to this source code. In place of
114218113733
** a legal notice, here is a blessing:
@@ -114247,11 +113762,10 @@
114247113762
SQLITE_API extern const sqlite3_api_routines *sqlite3_api;
114248113763
#endif
114249113764
114250113765
/************** Include fts3_tokenizer.h in the middle of fts3Int.h **********/
114251113766
/************** Begin file fts3_tokenizer.h **********************************/
114252
-#line 1 "tsrc/fts3_tokenizer.h"
114253113767
/*
114254113768
** 2006 July 10
114255113769
**
114256113770
** The author disclaims copyright to this source code.
114257113771
**
@@ -114402,14 +113916,12 @@
114402113916
114403113917
#endif /* _FTS3_TOKENIZER_H_ */
114404113918
114405113919
/************** End of fts3_tokenizer.h **************************************/
114406113920
/************** Continuing where we left off in fts3Int.h ********************/
114407
-#line 40 "tsrc/fts3Int.h"
114408113921
/************** Include fts3_hash.h in the middle of fts3Int.h ***************/
114409113922
/************** Begin file fts3_hash.h ***************************************/
114410
-#line 1 "tsrc/fts3_hash.h"
114411113923
/*
114412113924
** 2001 September 22
114413113925
**
114414113926
** The author disclaims copyright to this source code. In place of
114415113927
** a legal notice, here is a blessing:
@@ -114521,11 +114033,10 @@
114521114033
114522114034
#endif /* _FTS3_HASH_H_ */
114523114035
114524114036
/************** End of fts3_hash.h *******************************************/
114525114037
/************** Continuing where we left off in fts3Int.h ********************/
114526
-#line 41 "tsrc/fts3Int.h"
114527114038
114528114039
/*
114529114040
** This constant controls how often segments are merged. Once there are
114530114041
** FTS3_MERGE_COUNT segments of level N, they are merged into a single
114531114042
** segment of level N+1.
@@ -114998,11 +114509,10 @@
114998114509
#endif /* !SQLITE_CORE || SQLITE_ENABLE_FTS3 */
114999114510
#endif /* _FTSINT_H */
115000114511
115001114512
/************** End of fts3Int.h *********************************************/
115002114513
/************** Continuing where we left off in fts3.c ***********************/
115003
-#line 296 "tsrc/fts3.c"
115004114514
#if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3)
115005114515
115006114516
#if defined(SQLITE_ENABLE_FTS3) && !defined(SQLITE_CORE)
115007114517
# define SQLITE_CORE 1
115008114518
#endif
@@ -119548,11 +119058,10 @@
119548119058
119549119059
#endif
119550119060
119551119061
/************** End of fts3.c ************************************************/
119552119062
/************** Begin file fts3_aux.c ****************************************/
119553
-#line 1 "tsrc/fts3_aux.c"
119554119063
/*
119555119064
** 2011 Jan 27
119556119065
**
119557119066
** The author disclaims copyright to this source code. In place of
119558119067
** a legal notice, here is a blessing:
@@ -120025,11 +119534,10 @@
120025119534
120026119535
#endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */
120027119536
120028119537
/************** End of fts3_aux.c ********************************************/
120029119538
/************** Begin file fts3_expr.c ***************************************/
120030
-#line 1 "tsrc/fts3_expr.c"
120031119539
/*
120032119540
** 2008 Nov 28
120033119541
**
120034119542
** The author disclaims copyright to this source code. In place of
120035119543
** a legal notice, here is a blessing:
@@ -120992,11 +120500,10 @@
120992120500
#endif
120993120501
#endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */
120994120502
120995120503
/************** End of fts3_expr.c *******************************************/
120996120504
/************** Begin file fts3_hash.c ***************************************/
120997
-#line 1 "tsrc/fts3_hash.c"
120998120505
/*
120999120506
** 2001 September 22
121000120507
**
121001120508
** The author disclaims copyright to this source code. In place of
121002120509
** a legal notice, here is a blessing:
@@ -121377,11 +120884,10 @@
121377120884
121378120885
#endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */
121379120886
121380120887
/************** End of fts3_hash.c *******************************************/
121381120888
/************** Begin file fts3_porter.c *************************************/
121382
-#line 1 "tsrc/fts3_porter.c"
121383120889
/*
121384120890
** 2006 September 30
121385120891
**
121386120892
** The author disclaims copyright to this source code. In place of
121387120893
** a legal notice, here is a blessing:
@@ -122024,11 +121530,10 @@
122024121530
122025121531
#endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */
122026121532
122027121533
/************** End of fts3_porter.c *****************************************/
122028121534
/************** Begin file fts3_tokenizer.c **********************************/
122029
-#line 1 "tsrc/fts3_tokenizer.c"
122030121535
/*
122031121536
** 2007 June 22
122032121537
**
122033121538
** The author disclaims copyright to this source code. In place of
122034121539
** a legal notice, here is a blessing:
@@ -122516,11 +122021,10 @@
122516122021
122517122022
#endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */
122518122023
122519122024
/************** End of fts3_tokenizer.c **************************************/
122520122025
/************** Begin file fts3_tokenizer1.c *********************************/
122521
-#line 1 "tsrc/fts3_tokenizer1.c"
122522122026
/*
122523122027
** 2006 Oct 10
122524122028
**
122525122029
** The author disclaims copyright to this source code. In place of
122526122030
** a legal notice, here is a blessing:
@@ -122751,11 +122255,10 @@
122751122255
122752122256
#endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */
122753122257
122754122258
/************** End of fts3_tokenizer1.c *************************************/
122755122259
/************** Begin file fts3_write.c **************************************/
122756
-#line 1 "tsrc/fts3_write.c"
122757122260
/*
122758122261
** 2009 Oct 23
122759122262
**
122760122263
** The author disclaims copyright to this source code. In place of
122761122264
** a legal notice, here is a blessing:
@@ -126022,11 +125525,10 @@
126022125525
126023125526
#endif
126024125527
126025125528
/************** End of fts3_write.c ******************************************/
126026125529
/************** Begin file fts3_snippet.c ************************************/
126027
-#line 1 "tsrc/fts3_snippet.c"
126028125530
/*
126029125531
** 2009 Oct 23
126030125532
**
126031125533
** The author disclaims copyright to this source code. In place of
126032125534
** a legal notice, here is a blessing:
@@ -127524,11 +127026,10 @@
127524127026
127525127027
#endif
127526127028
127527127029
/************** End of fts3_snippet.c ****************************************/
127528127030
/************** Begin file rtree.c *******************************************/
127529
-#line 1 "tsrc/rtree.c"
127530127031
/*
127531127032
** 2001 September 15
127532127033
**
127533127034
** The author disclaims copyright to this source code. In place of
127534127035
** a legal notice, here is a blessing:
@@ -130806,11 +130307,10 @@
130806130307
130807130308
#endif
130808130309
130809130310
/************** End of rtree.c ***********************************************/
130810130311
/************** Begin file icu.c *********************************************/
130811
-#line 1 "tsrc/icu.c"
130812130312
/*
130813130313
** 2007 May 6
130814130314
**
130815130315
** The author disclaims copyright to this source code. In place of
130816130316
** a legal notice, here is a blessing:
@@ -131309,11 +130809,10 @@
131309130809
131310130810
#endif
131311130811
131312130812
/************** End of icu.c *************************************************/
131313130813
/************** Begin file fts3_icu.c ****************************************/
131314
-#line 1 "tsrc/fts3_icu.c"
131315130814
/*
131316130815
** 2007 June 22
131317130816
**
131318130817
** The author disclaims copyright to this source code. In place of
131319130818
** a legal notice, here is a blessing:
131320130819
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -24,11 +24,10 @@
24 #endif
25 #ifndef SQLITE_API
26 # define SQLITE_API
27 #endif
28 /************** Begin file sqliteInt.h ***************************************/
29 #line 1 "tsrc/sqliteInt.h"
30 /*
31 ** 2001 September 15
32 **
33 ** The author disclaims copyright to this source code. In place of
34 ** a legal notice, here is a blessing:
@@ -79,11 +78,10 @@
79 #include "config.h"
80 #endif
81
82 /************** Include sqliteLimit.h in the middle of sqliteInt.h ***********/
83 /************** Begin file sqliteLimit.h *************************************/
84 #line 1 "tsrc/sqliteLimit.h"
85 /*
86 ** 2007 May 7
87 **
88 ** The author disclaims copyright to this source code. In place of
89 ** a legal notice, here is a blessing:
@@ -291,11 +289,10 @@
291 # define SQLITE_MAX_TRIGGER_DEPTH 1000
292 #endif
293
294 /************** End of sqliteLimit.h *****************************************/
295 /************** Continuing where we left off in sqliteInt.h ******************/
296 #line 54 "tsrc/sqliteInt.h"
297
298 /* Disable nuisance warnings on Borland compilers */
299 #if defined(__BORLANDC__)
300 #pragma warn -rch /* unreachable code */
301 #pragma warn -ccc /* Condition is always true or false */
@@ -548,11 +545,10 @@
548 # define unlikely(X) !!(X)
549 #endif
550
551 /************** Include sqlite3.h in the middle of sqliteInt.h ***************/
552 /************** Begin file sqlite3.h *****************************************/
553 #line 1 "tsrc/sqlite3.h"
554 /*
555 ** 2001 September 15
556 **
557 ** The author disclaims copyright to this source code. In place of
558 ** a legal notice, here is a blessing:
@@ -660,11 +656,11 @@
660 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
661 ** [sqlite_version()] and [sqlite_source_id()].
662 */
663 #define SQLITE_VERSION "3.7.8"
664 #define SQLITE_VERSION_NUMBER 3007008
665 #define SQLITE_SOURCE_ID "2011-09-14 13:41:40 a1f3aeeb0988c848d40ce8f6da6e902935a997e2"
666
667 /*
668 ** CAPI3REF: Run-Time Library Version Numbers
669 ** KEYWORDS: sqlite3_version, sqlite3_sourceid
670 **
@@ -7309,14 +7305,12 @@
7309 #endif /* ifndef _SQLITE3RTREE_H_ */
7310
7311
7312 /************** End of sqlite3.h *********************************************/
7313 /************** Continuing where we left off in sqliteInt.h ******************/
7314 #line 309 "tsrc/sqliteInt.h"
7315 /************** Include hash.h in the middle of sqliteInt.h ******************/
7316 /************** Begin file hash.h ********************************************/
7317 #line 1 "tsrc/hash.h"
7318 /*
7319 ** 2001 September 22
7320 **
7321 ** The author disclaims copyright to this source code. In place of
7322 ** a legal notice, here is a blessing:
@@ -7412,14 +7406,12 @@
7412
7413 #endif /* _SQLITE_HASH_H_ */
7414
7415 /************** End of hash.h ************************************************/
7416 /************** Continuing where we left off in sqliteInt.h ******************/
7417 #line 310 "tsrc/sqliteInt.h"
7418 /************** Include parse.h in the middle of sqliteInt.h *****************/
7419 /************** Begin file parse.h *******************************************/
7420 #line 1 "tsrc/parse.h"
7421 #define TK_SEMI 1
7422 #define TK_EXPLAIN 2
7423 #define TK_QUERY 3
7424 #define TK_PLAN 4
7425 #define TK_BEGIN 5
@@ -7576,11 +7568,10 @@
7576 #define TK_UMINUS 156
7577 #define TK_UPLUS 157
7578
7579 /************** End of parse.h ***********************************************/
7580 /************** Continuing where we left off in sqliteInt.h ******************/
7581 #line 311 "tsrc/sqliteInt.h"
7582 #include <stdio.h>
7583 #include <stdlib.h>
7584 #include <string.h>
7585 #include <assert.h>
7586 #include <stddef.h>
@@ -7920,11 +7911,10 @@
7920 ** "BusyHandler" typedefs. vdbe.h also requires a few of the opaque
7921 ** pointer types (i.e. FuncDef) defined above.
7922 */
7923 /************** Include btree.h in the middle of sqliteInt.h *****************/
7924 /************** Begin file btree.h *******************************************/
7925 #line 1 "tsrc/btree.h"
7926 /*
7927 ** 2001 September 15
7928 **
7929 ** The author disclaims copyright to this source code. In place of
7930 ** a legal notice, here is a blessing:
@@ -8165,14 +8155,12 @@
8165
8166 #endif /* _BTREE_H_ */
8167
8168 /************** End of btree.h ***********************************************/
8169 /************** Continuing where we left off in sqliteInt.h ******************/
8170 #line 653 "tsrc/sqliteInt.h"
8171 /************** Include vdbe.h in the middle of sqliteInt.h ******************/
8172 /************** Begin file vdbe.h ********************************************/
8173 #line 1 "tsrc/vdbe.h"
8174 /*
8175 ** 2001 September 15
8176 **
8177 ** The author disclaims copyright to this source code. In place of
8178 ** a legal notice, here is a blessing:
@@ -8333,11 +8321,10 @@
8333 ** The makefile scans the vdbe.c source file and creates the "opcodes.h"
8334 ** header file that defines a number for each opcode used by the VDBE.
8335 */
8336 /************** Include opcodes.h in the middle of vdbe.h ********************/
8337 /************** Begin file opcodes.h *****************************************/
8338 #line 1 "tsrc/opcodes.h"
8339 /* Automatically generated. Do not edit */
8340 /* See the mkopcodeh.awk script for details */
8341 #define OP_Goto 1
8342 #define OP_Gosub 2
8343 #define OP_Return 3
@@ -8387,108 +8374,109 @@
8387 #define OP_Jump 25
8388 #define OP_And 69 /* same as TK_AND */
8389 #define OP_Or 68 /* same as TK_OR */
8390 #define OP_Not 19 /* same as TK_NOT */
8391 #define OP_BitNot 93 /* same as TK_BITNOT */
8392 #define OP_If 26
8393 #define OP_IfNot 27
 
8394 #define OP_IsNull 73 /* same as TK_ISNULL */
8395 #define OP_NotNull 74 /* same as TK_NOTNULL */
8396 #define OP_Column 28
8397 #define OP_Affinity 29
8398 #define OP_MakeRecord 30
8399 #define OP_Count 31
8400 #define OP_Savepoint 32
8401 #define OP_AutoCommit 33
8402 #define OP_Transaction 34
8403 #define OP_ReadCookie 35
8404 #define OP_SetCookie 36
8405 #define OP_VerifyCookie 37
8406 #define OP_OpenRead 38
8407 #define OP_OpenWrite 39
8408 #define OP_OpenAutoindex 40
8409 #define OP_OpenEphemeral 41
8410 #define OP_SorterOpen 42
8411 #define OP_OpenPseudo 43
8412 #define OP_Close 44
8413 #define OP_SeekLt 45
8414 #define OP_SeekLe 46
8415 #define OP_SeekGe 47
8416 #define OP_SeekGt 48
8417 #define OP_Seek 49
8418 #define OP_NotFound 50
8419 #define OP_Found 51
8420 #define OP_IsUnique 52
8421 #define OP_NotExists 53
8422 #define OP_Sequence 54
8423 #define OP_NewRowid 55
8424 #define OP_Insert 56
8425 #define OP_InsertInt 57
8426 #define OP_Delete 58
8427 #define OP_ResetCount 59
8428 #define OP_SorterCompare 60
8429 #define OP_SorterData 61
8430 #define OP_RowKey 62
8431 #define OP_RowData 63
8432 #define OP_Rowid 64
8433 #define OP_NullRow 65
8434 #define OP_Last 66
8435 #define OP_SorterSort 67
8436 #define OP_Sort 70
8437 #define OP_Rewind 71
8438 #define OP_SorterNext 72
8439 #define OP_Prev 81
8440 #define OP_Next 92
8441 #define OP_SorterInsert 95
8442 #define OP_IdxInsert 96
8443 #define OP_IdxDelete 97
8444 #define OP_IdxRowid 98
8445 #define OP_IdxLT 99
8446 #define OP_IdxGE 100
8447 #define OP_Destroy 101
8448 #define OP_Clear 102
8449 #define OP_CreateIndex 103
8450 #define OP_CreateTable 104
8451 #define OP_ParseSchema 105
8452 #define OP_LoadAnalysis 106
8453 #define OP_DropTable 107
8454 #define OP_DropIndex 108
8455 #define OP_DropTrigger 109
8456 #define OP_IntegrityCk 110
8457 #define OP_RowSetAdd 111
8458 #define OP_RowSetRead 112
8459 #define OP_RowSetTest 113
8460 #define OP_Program 114
8461 #define OP_Param 115
8462 #define OP_FkCounter 116
8463 #define OP_FkIfZero 117
8464 #define OP_MemMax 118
8465 #define OP_IfPos 119
8466 #define OP_IfNeg 120
8467 #define OP_IfZero 121
8468 #define OP_AggStep 122
8469 #define OP_AggFinal 123
8470 #define OP_Checkpoint 124
8471 #define OP_JournalMode 125
8472 #define OP_Vacuum 126
8473 #define OP_IncrVacuum 127
8474 #define OP_Expire 128
8475 #define OP_TableLock 129
8476 #define OP_VBegin 131
8477 #define OP_VCreate 132
8478 #define OP_VDestroy 133
8479 #define OP_VOpen 134
8480 #define OP_VFilter 135
8481 #define OP_VColumn 136
8482 #define OP_VNext 137
8483 #define OP_VRename 138
8484 #define OP_VUpdate 139
8485 #define OP_Pagecount 140
8486 #define OP_MaxPgcnt 146
8487 #define OP_Trace 147
8488 #define OP_Noop 148
8489 #define OP_Explain 149
8490
8491
8492 /* Properties such as "out2" or "jump" that are specified in
8493 ** comments following the "case" for each opcode in the vdbe.c
8494 ** are encoded into bitvectors as follows:
@@ -8502,30 +8490,29 @@
8502 #define OPFLG_OUT3 0x0040 /* out3: P3 is an output */
8503 #define OPFLG_INITIALIZER {\
8504 /* 0 */ 0x00, 0x01, 0x05, 0x04, 0x04, 0x10, 0x00, 0x02,\
8505 /* 8 */ 0x02, 0x02, 0x02, 0x02, 0x02, 0x00, 0x24, 0x24,\
8506 /* 16 */ 0x00, 0x00, 0x00, 0x24, 0x04, 0x05, 0x04, 0x00,\
8507 /* 24 */ 0x00, 0x01, 0x05, 0x05, 0x00, 0x00, 0x00, 0x02,\
8508 /* 32 */ 0x00, 0x00, 0x00, 0x02, 0x10, 0x00, 0x00, 0x00,\
8509 /* 40 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x11, 0x11,\
8510 /* 48 */ 0x11, 0x08, 0x11, 0x11, 0x11, 0x11, 0x02, 0x02,\
8511 /* 56 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\
8512 /* 64 */ 0x02, 0x00, 0x01, 0x01, 0x4c, 0x4c, 0x01, 0x01,\
8513 /* 72 */ 0x01, 0x05, 0x05, 0x15, 0x15, 0x15, 0x15, 0x15,\
8514 /* 80 */ 0x15, 0x01, 0x4c, 0x4c, 0x4c, 0x4c, 0x4c, 0x4c,\
8515 /* 88 */ 0x4c, 0x4c, 0x4c, 0x4c, 0x01, 0x24, 0x02, 0x08,\
8516 /* 96 */ 0x08, 0x00, 0x02, 0x01, 0x01, 0x02, 0x00, 0x02,\
8517 /* 104 */ 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c,\
8518 /* 112 */ 0x45, 0x15, 0x01, 0x02, 0x00, 0x01, 0x08, 0x05,\
8519 /* 120 */ 0x05, 0x05, 0x00, 0x00, 0x00, 0x02, 0x00, 0x01,\
8520 /* 128 */ 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x01,\
8521 /* 136 */ 0x00, 0x01, 0x00, 0x00, 0x02, 0x04, 0x04, 0x04,\
8522 /* 144 */ 0x04, 0x04, 0x02, 0x00, 0x00, 0x00,}
8523
8524 /************** End of opcodes.h *********************************************/
8525 /************** Continuing where we left off in vdbe.h ***********************/
8526 #line 164 "tsrc/vdbe.h"
8527
8528 /*
8529 ** Prototypes for the VDBE interface. See comments on the implementation
8530 ** for a description of what each of these routines does.
8531 */
@@ -8541,11 +8528,11 @@
8541 SQLITE_PRIVATE void sqlite3VdbeChangeP1(Vdbe*, u32 addr, int P1);
8542 SQLITE_PRIVATE void sqlite3VdbeChangeP2(Vdbe*, u32 addr, int P2);
8543 SQLITE_PRIVATE void sqlite3VdbeChangeP3(Vdbe*, u32 addr, int P3);
8544 SQLITE_PRIVATE void sqlite3VdbeChangeP5(Vdbe*, u8 P5);
8545 SQLITE_PRIVATE void sqlite3VdbeJumpHere(Vdbe*, int addr);
8546 SQLITE_PRIVATE void sqlite3VdbeChangeToNoop(Vdbe*, int addr, int N);
8547 SQLITE_PRIVATE void sqlite3VdbeChangeP4(Vdbe*, int addr, const char *zP4, int N);
8548 SQLITE_PRIVATE void sqlite3VdbeUsesBtree(Vdbe*, int);
8549 SQLITE_PRIVATE VdbeOp *sqlite3VdbeGetOp(Vdbe*, int);
8550 SQLITE_PRIVATE int sqlite3VdbeMakeLabel(Vdbe*);
8551 SQLITE_PRIVATE void sqlite3VdbeRunOnlyOnce(Vdbe*);
@@ -8596,14 +8583,12 @@
8596
8597 #endif
8598
8599 /************** End of vdbe.h ************************************************/
8600 /************** Continuing where we left off in sqliteInt.h ******************/
8601 #line 654 "tsrc/sqliteInt.h"
8602 /************** Include pager.h in the middle of sqliteInt.h *****************/
8603 /************** Begin file pager.h *******************************************/
8604 #line 1 "tsrc/pager.h"
8605 /*
8606 ** 2001 September 15
8607 **
8608 ** The author disclaims copyright to this source code. In place of
8609 ** a legal notice, here is a blessing:
@@ -8785,14 +8770,12 @@
8785
8786 #endif /* _PAGER_H_ */
8787
8788 /************** End of pager.h ***********************************************/
8789 /************** Continuing where we left off in sqliteInt.h ******************/
8790 #line 655 "tsrc/sqliteInt.h"
8791 /************** Include pcache.h in the middle of sqliteInt.h ****************/
8792 /************** Begin file pcache.h ******************************************/
8793 #line 1 "tsrc/pcache.h"
8794 /*
8795 ** 2008 August 05
8796 **
8797 ** The author disclaims copyright to this source code. In place of
8798 ** a legal notice, here is a blessing:
@@ -8947,15 +8930,13 @@
8947
8948 #endif /* _PCACHE_H_ */
8949
8950 /************** End of pcache.h **********************************************/
8951 /************** Continuing where we left off in sqliteInt.h ******************/
8952 #line 656 "tsrc/sqliteInt.h"
8953
8954 /************** Include os.h in the middle of sqliteInt.h ********************/
8955 /************** Begin file os.h **********************************************/
8956 #line 1 "tsrc/os.h"
8957 /*
8958 ** 2001 September 16
8959 **
8960 ** The author disclaims copyright to this source code. In place of
8961 ** a legal notice, here is a blessing:
@@ -9234,14 +9215,12 @@
9234
9235 #endif /* _SQLITE_OS_H_ */
9236
9237 /************** End of os.h **************************************************/
9238 /************** Continuing where we left off in sqliteInt.h ******************/
9239 #line 658 "tsrc/sqliteInt.h"
9240 /************** Include mutex.h in the middle of sqliteInt.h *****************/
9241 /************** Begin file mutex.h *******************************************/
9242 #line 1 "tsrc/mutex.h"
9243 /*
9244 ** 2007 August 28
9245 **
9246 ** The author disclaims copyright to this source code. In place of
9247 ** a legal notice, here is a blessing:
@@ -9312,11 +9291,10 @@
9312 #define sqlite3MutexEnd()
9313 #endif /* defined(SQLITE_MUTEX_OMIT) */
9314
9315 /************** End of mutex.h ***********************************************/
9316 /************** Continuing where we left off in sqliteInt.h ******************/
9317 #line 659 "tsrc/sqliteInt.h"
9318
9319
9320 /*
9321 ** Each database file to be accessed by the system is an instance
9322 ** of the following structure. There are normally two of these structures
@@ -10509,11 +10487,12 @@
10509 char *zDatabase; /* Name of database holding this table */
10510 char *zName; /* Name of the table */
10511 char *zAlias; /* The "B" part of a "A AS B" phrase. zName is the "A" */
10512 Table *pTab; /* An SQL table corresponding to zName */
10513 Select *pSelect; /* A SELECT statement used in place of a table name */
10514 u8 isPopulated; /* Temporary table associated with SELECT is populated */
 
10515 u8 jointype; /* Type of join between this able and the previous */
10516 u8 notIndexed; /* True if there is a NOT INDEXED clause */
10517 u8 isCorrelated; /* True if sub-query is correlated */
10518 #ifndef SQLITE_OMIT_EXPLAIN
10519 u8 iSelectId; /* If pSelect!=0, the id of the sub-select in EQP */
@@ -11915,11 +11894,10 @@
11915
11916 #endif /* _SQLITEINT_H_ */
11917
11918 /************** End of sqliteInt.h *******************************************/
11919 /************** Begin file global.c ******************************************/
11920 #line 1 "tsrc/global.c"
11921 /*
11922 ** 2008 June 13
11923 **
11924 ** The author disclaims copyright to this source code. In place of
11925 ** a legal notice, here is a blessing:
@@ -12138,11 +12116,10 @@
12138 */
12139 SQLITE_PRIVATE const unsigned char sqlite3OpcodeProperty[] = OPFLG_INITIALIZER;
12140
12141 /************** End of global.c **********************************************/
12142 /************** Begin file ctime.c *******************************************/
12143 #line 1 "tsrc/ctime.c"
12144 /*
12145 ** 2010 February 23
12146 **
12147 ** The author disclaims copyright to this source code. In place of
12148 ** a legal notice, here is a blessing:
@@ -12543,11 +12520,10 @@
12543
12544 #endif /* SQLITE_OMIT_COMPILEOPTION_DIAGS */
12545
12546 /************** End of ctime.c ***********************************************/
12547 /************** Begin file status.c ******************************************/
12548 #line 1 "tsrc/status.c"
12549 /*
12550 ** 2008 June 18
12551 **
12552 ** The author disclaims copyright to this source code. In place of
12553 ** a legal notice, here is a blessing:
@@ -12561,11 +12537,10 @@
12561 ** This module implements the sqlite3_status() interface and related
12562 ** functionality.
12563 */
12564 /************** Include vdbeInt.h in the middle of status.c ******************/
12565 /************** Begin file vdbeInt.h *****************************************/
12566 #line 1 "tsrc/vdbeInt.h"
12567 /*
12568 ** 2003 September 6
12569 **
12570 ** The author disclaims copyright to this source code. In place of
12571 ** a legal notice, here is a blessing:
@@ -13013,11 +12988,10 @@
13013
13014 #endif /* !defined(_VDBEINT_H_) */
13015
13016 /************** End of vdbeInt.h *********************************************/
13017 /************** Continuing where we left off in status.c *********************/
13018 #line 18 "tsrc/status.c"
13019
13020 /*
13021 ** Variables in which to record status information.
13022 */
13023 typedef struct sqlite3StatType sqlite3StatType;
@@ -13227,11 +13201,10 @@
13227 return rc;
13228 }
13229
13230 /************** End of status.c **********************************************/
13231 /************** Begin file date.c ********************************************/
13232 #line 1 "tsrc/date.c"
13233 /*
13234 ** 2003 October 31
13235 **
13236 ** The author disclaims copyright to this source code. In place of
13237 ** a legal notice, here is a blessing:
@@ -14355,11 +14328,10 @@
14355 }
14356 }
14357
14358 /************** End of date.c ************************************************/
14359 /************** Begin file os.c **********************************************/
14360 #line 1 "tsrc/os.c"
14361 /*
14362 ** 2005 November 29
14363 **
14364 ** The author disclaims copyright to this source code. In place of
14365 ** a legal notice, here is a blessing:
@@ -14565,11 +14537,11 @@
14565 int flags,
14566 int *pOutFlags
14567 ){
14568 int rc = SQLITE_NOMEM;
14569 sqlite3_file *pFile;
14570 pFile = (sqlite3_file *)sqlite3Malloc(pVfs->szOsFile);
14571 if( pFile ){
14572 rc = sqlite3OsOpen(pVfs, zFile, pFile, flags, pOutFlags);
14573 if( rc!=SQLITE_OK ){
14574 sqlite3_free(pFile);
14575 }else{
@@ -14689,11 +14661,10 @@
14689 return SQLITE_OK;
14690 }
14691
14692 /************** End of os.c **************************************************/
14693 /************** Begin file fault.c *******************************************/
14694 #line 1 "tsrc/fault.c"
14695 /*
14696 ** 2008 Jan 22
14697 **
14698 ** The author disclaims copyright to this source code. In place of
14699 ** a legal notice, here is a blessing:
@@ -14779,11 +14750,10 @@
14779
14780 #endif /* #ifndef SQLITE_OMIT_BUILTIN_TEST */
14781
14782 /************** End of fault.c ***********************************************/
14783 /************** Begin file mem0.c ********************************************/
14784 #line 1 "tsrc/mem0.c"
14785 /*
14786 ** 2008 October 28
14787 **
14788 ** The author disclaims copyright to this source code. In place of
14789 ** a legal notice, here is a blessing:
@@ -14841,11 +14811,10 @@
14841
14842 #endif /* SQLITE_ZERO_MALLOC */
14843
14844 /************** End of mem0.c ************************************************/
14845 /************** Begin file mem1.c ********************************************/
14846 #line 1 "tsrc/mem1.c"
14847 /*
14848 ** 2007 August 14
14849 **
14850 ** The author disclaims copyright to this source code. In place of
14851 ** a legal notice, here is a blessing:
@@ -14994,11 +14963,10 @@
14994
14995 #endif /* SQLITE_SYSTEM_MALLOC */
14996
14997 /************** End of mem1.c ************************************************/
14998 /************** Begin file mem2.c ********************************************/
14999 #line 1 "tsrc/mem2.c"
15000 /*
15001 ** 2007 August 15
15002 **
15003 ** The author disclaims copyright to this source code. In place of
15004 ** a legal notice, here is a blessing:
@@ -15525,11 +15493,10 @@
15525
15526 #endif /* SQLITE_MEMDEBUG */
15527
15528 /************** End of mem2.c ************************************************/
15529 /************** Begin file mem3.c ********************************************/
15530 #line 1 "tsrc/mem3.c"
15531 /*
15532 ** 2007 October 14
15533 **
15534 ** The author disclaims copyright to this source code. In place of
15535 ** a legal notice, here is a blessing:
@@ -16215,11 +16182,10 @@
16215
16216 #endif /* SQLITE_ENABLE_MEMSYS3 */
16217
16218 /************** End of mem3.c ************************************************/
16219 /************** Begin file mem5.c ********************************************/
16220 #line 1 "tsrc/mem5.c"
16221 /*
16222 ** 2007 October 14
16223 **
16224 ** The author disclaims copyright to this source code. In place of
16225 ** a legal notice, here is a blessing:
@@ -16799,11 +16765,10 @@
16799
16800 #endif /* SQLITE_ENABLE_MEMSYS5 */
16801
16802 /************** End of mem5.c ************************************************/
16803 /************** Begin file mutex.c *******************************************/
16804 #line 1 "tsrc/mutex.c"
16805 /*
16806 ** 2007 August 14
16807 **
16808 ** The author disclaims copyright to this source code. In place of
16809 ** a legal notice, here is a blessing:
@@ -16955,11 +16920,10 @@
16955
16956 #endif /* SQLITE_MUTEX_OMIT */
16957
16958 /************** End of mutex.c ***********************************************/
16959 /************** Begin file mutex_noop.c **************************************/
16960 #line 1 "tsrc/mutex_noop.c"
16961 /*
16962 ** 2008 October 07
16963 **
16964 ** The author disclaims copyright to this source code. In place of
16965 ** a legal notice, here is a blessing:
@@ -17164,11 +17128,10 @@
17164 #endif /* SQLITE_MUTEX_NOOP */
17165 #endif /* SQLITE_MUTEX_OMIT */
17166
17167 /************** End of mutex_noop.c ******************************************/
17168 /************** Begin file mutex_os2.c ***************************************/
17169 #line 1 "tsrc/mutex_os2.c"
17170 /*
17171 ** 2007 August 28
17172 **
17173 ** The author disclaims copyright to this source code. In place of
17174 ** a legal notice, here is a blessing:
@@ -17441,11 +17404,10 @@
17441 }
17442 #endif /* SQLITE_MUTEX_OS2 */
17443
17444 /************** End of mutex_os2.c *******************************************/
17445 /************** Begin file mutex_unix.c **************************************/
17446 #line 1 "tsrc/mutex_unix.c"
17447 /*
17448 ** 2007 August 28
17449 **
17450 ** The author disclaims copyright to this source code. In place of
17451 ** a legal notice, here is a blessing:
@@ -17795,11 +17757,10 @@
17795
17796 #endif /* SQLITE_MUTEX_PTHREAD */
17797
17798 /************** End of mutex_unix.c ******************************************/
17799 /************** Begin file mutex_w32.c ***************************************/
17800 #line 1 "tsrc/mutex_w32.c"
17801 /*
17802 ** 2007 August 14
17803 **
17804 ** The author disclaims copyright to this source code. In place of
17805 ** a legal notice, here is a blessing:
@@ -18130,11 +18091,10 @@
18130 }
18131 #endif /* SQLITE_MUTEX_W32 */
18132
18133 /************** End of mutex_w32.c *******************************************/
18134 /************** Begin file malloc.c ******************************************/
18135 #line 1 "tsrc/malloc.c"
18136 /*
18137 ** 2001 September 15
18138 **
18139 ** The author disclaims copyright to this source code. In place of
18140 ** a legal notice, here is a blessing:
@@ -18910,11 +18870,10 @@
18910 return rc & (db ? db->errMask : 0xff);
18911 }
18912
18913 /************** End of malloc.c **********************************************/
18914 /************** Begin file printf.c ******************************************/
18915 #line 1 "tsrc/printf.c"
18916 /*
18917 ** The "printf" code that follows dates from the 1980's. It is in
18918 ** the public domain. The original comments are included here for
18919 ** completeness. They are very out-of-date but might be useful as
18920 ** an historical reference. Most of the "enhancements" have been backed
@@ -19942,11 +19901,10 @@
19942 }
19943 #endif
19944
19945 /************** End of printf.c **********************************************/
19946 /************** Begin file random.c ******************************************/
19947 #line 1 "tsrc/random.c"
19948 /*
19949 ** 2001 September 15
19950 **
19951 ** The author disclaims copyright to this source code. In place of
19952 ** a legal notice, here is a blessing:
@@ -20090,11 +20048,10 @@
20090 }
20091 #endif /* SQLITE_OMIT_BUILTIN_TEST */
20092
20093 /************** End of random.c **********************************************/
20094 /************** Begin file utf.c *********************************************/
20095 #line 1 "tsrc/utf.c"
20096 /*
20097 ** 2004 April 13
20098 **
20099 ** The author disclaims copyright to this source code. In place of
20100 ** a legal notice, here is a blessing:
@@ -20652,11 +20609,10 @@
20652 #endif /* SQLITE_TEST */
20653 #endif /* SQLITE_OMIT_UTF16 */
20654
20655 /************** End of utf.c *************************************************/
20656 /************** Begin file util.c ********************************************/
20657 #line 1 "tsrc/util.c"
20658 /*
20659 ** 2001 September 15
20660 **
20661 ** The author disclaims copyright to this source code. In place of
20662 ** a legal notice, here is a blessing:
@@ -21835,11 +21791,10 @@
21835 }
21836 #endif
21837
21838 /************** End of util.c ************************************************/
21839 /************** Begin file hash.c ********************************************/
21840 #line 1 "tsrc/hash.c"
21841 /*
21842 ** 2001 September 22
21843 **
21844 ** The author disclaims copyright to this source code. In place of
21845 ** a legal notice, here is a blessing:
@@ -22115,11 +22070,10 @@
22115 return 0;
22116 }
22117
22118 /************** End of hash.c ************************************************/
22119 /************** Begin file opcodes.c *****************************************/
22120 #line 1 "tsrc/opcodes.c"
22121 /* Automatically generated. Do not edit */
22122 /* See the mkopcodec.awk script for details. */
22123 #if !defined(SQLITE_OMIT_EXPLAIN) || !defined(NDEBUG) || defined(VDBE_PROFILE) || defined(SQLITE_DEBUG)
22124 SQLITE_PRIVATE const char *sqlite3OpcodeName(int i){
22125 static const char *const azName[] = { "?",
@@ -22146,66 +22100,66 @@
22146 /* 21 */ "MustBeInt",
22147 /* 22 */ "RealAffinity",
22148 /* 23 */ "Permutation",
22149 /* 24 */ "Compare",
22150 /* 25 */ "Jump",
22151 /* 26 */ "If",
22152 /* 27 */ "IfNot",
22153 /* 28 */ "Column",
22154 /* 29 */ "Affinity",
22155 /* 30 */ "MakeRecord",
22156 /* 31 */ "Count",
22157 /* 32 */ "Savepoint",
22158 /* 33 */ "AutoCommit",
22159 /* 34 */ "Transaction",
22160 /* 35 */ "ReadCookie",
22161 /* 36 */ "SetCookie",
22162 /* 37 */ "VerifyCookie",
22163 /* 38 */ "OpenRead",
22164 /* 39 */ "OpenWrite",
22165 /* 40 */ "OpenAutoindex",
22166 /* 41 */ "OpenEphemeral",
22167 /* 42 */ "SorterOpen",
22168 /* 43 */ "OpenPseudo",
22169 /* 44 */ "Close",
22170 /* 45 */ "SeekLt",
22171 /* 46 */ "SeekLe",
22172 /* 47 */ "SeekGe",
22173 /* 48 */ "SeekGt",
22174 /* 49 */ "Seek",
22175 /* 50 */ "NotFound",
22176 /* 51 */ "Found",
22177 /* 52 */ "IsUnique",
22178 /* 53 */ "NotExists",
22179 /* 54 */ "Sequence",
22180 /* 55 */ "NewRowid",
22181 /* 56 */ "Insert",
22182 /* 57 */ "InsertInt",
22183 /* 58 */ "Delete",
22184 /* 59 */ "ResetCount",
22185 /* 60 */ "SorterCompare",
22186 /* 61 */ "SorterData",
22187 /* 62 */ "RowKey",
22188 /* 63 */ "RowData",
22189 /* 64 */ "Rowid",
22190 /* 65 */ "NullRow",
22191 /* 66 */ "Last",
22192 /* 67 */ "SorterSort",
22193 /* 68 */ "Or",
22194 /* 69 */ "And",
22195 /* 70 */ "Sort",
22196 /* 71 */ "Rewind",
22197 /* 72 */ "SorterNext",
22198 /* 73 */ "IsNull",
22199 /* 74 */ "NotNull",
22200 /* 75 */ "Ne",
22201 /* 76 */ "Eq",
22202 /* 77 */ "Gt",
22203 /* 78 */ "Le",
22204 /* 79 */ "Lt",
22205 /* 80 */ "Ge",
22206 /* 81 */ "Prev",
22207 /* 82 */ "BitAnd",
22208 /* 83 */ "BitOr",
22209 /* 84 */ "ShiftLeft",
22210 /* 85 */ "ShiftRight",
22211 /* 86 */ "Add",
@@ -22212,76 +22166,76 @@
22212 /* 87 */ "Subtract",
22213 /* 88 */ "Multiply",
22214 /* 89 */ "Divide",
22215 /* 90 */ "Remainder",
22216 /* 91 */ "Concat",
22217 /* 92 */ "Next",
22218 /* 93 */ "BitNot",
22219 /* 94 */ "String8",
22220 /* 95 */ "SorterInsert",
22221 /* 96 */ "IdxInsert",
22222 /* 97 */ "IdxDelete",
22223 /* 98 */ "IdxRowid",
22224 /* 99 */ "IdxLT",
22225 /* 100 */ "IdxGE",
22226 /* 101 */ "Destroy",
22227 /* 102 */ "Clear",
22228 /* 103 */ "CreateIndex",
22229 /* 104 */ "CreateTable",
22230 /* 105 */ "ParseSchema",
22231 /* 106 */ "LoadAnalysis",
22232 /* 107 */ "DropTable",
22233 /* 108 */ "DropIndex",
22234 /* 109 */ "DropTrigger",
22235 /* 110 */ "IntegrityCk",
22236 /* 111 */ "RowSetAdd",
22237 /* 112 */ "RowSetRead",
22238 /* 113 */ "RowSetTest",
22239 /* 114 */ "Program",
22240 /* 115 */ "Param",
22241 /* 116 */ "FkCounter",
22242 /* 117 */ "FkIfZero",
22243 /* 118 */ "MemMax",
22244 /* 119 */ "IfPos",
22245 /* 120 */ "IfNeg",
22246 /* 121 */ "IfZero",
22247 /* 122 */ "AggStep",
22248 /* 123 */ "AggFinal",
22249 /* 124 */ "Checkpoint",
22250 /* 125 */ "JournalMode",
22251 /* 126 */ "Vacuum",
22252 /* 127 */ "IncrVacuum",
22253 /* 128 */ "Expire",
22254 /* 129 */ "TableLock",
22255 /* 130 */ "Real",
22256 /* 131 */ "VBegin",
22257 /* 132 */ "VCreate",
22258 /* 133 */ "VDestroy",
22259 /* 134 */ "VOpen",
22260 /* 135 */ "VFilter",
22261 /* 136 */ "VColumn",
22262 /* 137 */ "VNext",
22263 /* 138 */ "VRename",
22264 /* 139 */ "VUpdate",
22265 /* 140 */ "Pagecount",
22266 /* 141 */ "ToText",
22267 /* 142 */ "ToBlob",
22268 /* 143 */ "ToNumeric",
22269 /* 144 */ "ToInt",
22270 /* 145 */ "ToReal",
22271 /* 146 */ "MaxPgcnt",
22272 /* 147 */ "Trace",
22273 /* 148 */ "Noop",
22274 /* 149 */ "Explain",
 
22275 };
22276 return azName[i];
22277 }
22278 #endif
22279
22280 /************** End of opcodes.c *********************************************/
22281 /************** Begin file os_os2.c ******************************************/
22282 #line 1 "tsrc/os_os2.c"
22283 /*
22284 ** 2006 Feb 14
22285 **
22286 ** The author disclaims copyright to this source code. In place of
22287 ** a legal notice, here is a blessing:
@@ -22334,11 +22288,10 @@
22334 /*
22335 ** Include code that is common to all os_*.c files
22336 */
22337 /************** Include os_common.h in the middle of os_os2.c ****************/
22338 /************** Begin file os_common.h ***************************************/
22339 #line 1 "tsrc/os_common.h"
22340 /*
22341 ** 2004 May 22
22342 **
22343 ** The author disclaims copyright to this source code. In place of
22344 ** a legal notice, here is a blessing:
@@ -22388,11 +22341,10 @@
22388 ** hwtime.h contains inline assembler code for implementing
22389 ** high-performance timing routines.
22390 */
22391 /************** Include hwtime.h in the middle of os_common.h ****************/
22392 /************** Begin file hwtime.h ******************************************/
22393 #line 1 "tsrc/hwtime.h"
22394 /*
22395 ** 2008 May 27
22396 **
22397 ** The author disclaims copyright to this source code. In place of
22398 ** a legal notice, here is a blessing:
@@ -22477,11 +22429,10 @@
22477
22478 #endif /* !defined(_HWTIME_H_) */
22479
22480 /************** End of hwtime.h **********************************************/
22481 /************** Continuing where we left off in os_common.h ******************/
22482 #line 53 "tsrc/os_common.h"
22483
22484 static sqlite_uint64 g_start;
22485 static sqlite_uint64 g_elapsed;
22486 #define TIMER_START g_start=sqlite3Hwtime()
22487 #define TIMER_END g_elapsed=sqlite3Hwtime()-g_start
@@ -22544,11 +22495,10 @@
22544
22545 #endif /* !defined(_OS_COMMON_H_) */
22546
22547 /************** End of os_common.h *******************************************/
22548 /************** Continuing where we left off in os_os2.c *********************/
22549 #line 57 "tsrc/os_os2.c"
22550
22551 /* Forward references */
22552 typedef struct os2File os2File; /* The file structure */
22553 typedef struct os2ShmNode os2ShmNode; /* A shared descritive memory node */
22554 typedef struct os2ShmLink os2ShmLink; /* A connection to shared-memory */
@@ -24416,11 +24366,10 @@
24416
24417 #endif /* SQLITE_OS_OS2 */
24418
24419 /************** End of os_os2.c **********************************************/
24420 /************** Begin file os_unix.c *****************************************/
24421 #line 1 "tsrc/os_unix.c"
24422 /*
24423 ** 2004 May 22
24424 **
24425 ** The author disclaims copyright to this source code. In place of
24426 ** a legal notice, here is a blessing:
@@ -24681,11 +24630,10 @@
24681 /*
24682 ** Include code that is common to all os_*.c files
24683 */
24684 /************** Include os_common.h in the middle of os_unix.c ***************/
24685 /************** Begin file os_common.h ***************************************/
24686 #line 1 "tsrc/os_common.h"
24687 /*
24688 ** 2004 May 22
24689 **
24690 ** The author disclaims copyright to this source code. In place of
24691 ** a legal notice, here is a blessing:
@@ -24735,11 +24683,10 @@
24735 ** hwtime.h contains inline assembler code for implementing
24736 ** high-performance timing routines.
24737 */
24738 /************** Include hwtime.h in the middle of os_common.h ****************/
24739 /************** Begin file hwtime.h ******************************************/
24740 #line 1 "tsrc/hwtime.h"
24741 /*
24742 ** 2008 May 27
24743 **
24744 ** The author disclaims copyright to this source code. In place of
24745 ** a legal notice, here is a blessing:
@@ -24824,11 +24771,10 @@
24824
24825 #endif /* !defined(_HWTIME_H_) */
24826
24827 /************** End of hwtime.h **********************************************/
24828 /************** Continuing where we left off in os_common.h ******************/
24829 #line 53 "tsrc/os_common.h"
24830
24831 static sqlite_uint64 g_start;
24832 static sqlite_uint64 g_elapsed;
24833 #define TIMER_START g_start=sqlite3Hwtime()
24834 #define TIMER_END g_elapsed=sqlite3Hwtime()-g_start
@@ -24891,11 +24837,10 @@
24891
24892 #endif /* !defined(_OS_COMMON_H_) */
24893
24894 /************** End of os_common.h *******************************************/
24895 /************** Continuing where we left off in os_unix.c ********************/
24896 #line 265 "tsrc/os_unix.c"
24897
24898 /*
24899 ** Define various macros that are missing from some systems.
24900 */
24901 #ifndef O_LARGEFILE
@@ -31401,11 +31346,10 @@
31401
31402 #endif /* SQLITE_OS_UNIX */
31403
31404 /************** End of os_unix.c *********************************************/
31405 /************** Begin file os_win.c ******************************************/
31406 #line 1 "tsrc/os_win.c"
31407 /*
31408 ** 2004 May 22
31409 **
31410 ** The author disclaims copyright to this source code. In place of
31411 ** a legal notice, here is a blessing:
@@ -31463,11 +31407,10 @@
31463 /*
31464 ** Include code that is common to all os_*.c files
31465 */
31466 /************** Include os_common.h in the middle of os_win.c ****************/
31467 /************** Begin file os_common.h ***************************************/
31468 #line 1 "tsrc/os_common.h"
31469 /*
31470 ** 2004 May 22
31471 **
31472 ** The author disclaims copyright to this source code. In place of
31473 ** a legal notice, here is a blessing:
@@ -31517,11 +31460,10 @@
31517 ** hwtime.h contains inline assembler code for implementing
31518 ** high-performance timing routines.
31519 */
31520 /************** Include hwtime.h in the middle of os_common.h ****************/
31521 /************** Begin file hwtime.h ******************************************/
31522 #line 1 "tsrc/hwtime.h"
31523 /*
31524 ** 2008 May 27
31525 **
31526 ** The author disclaims copyright to this source code. In place of
31527 ** a legal notice, here is a blessing:
@@ -31606,11 +31548,10 @@
31606
31607 #endif /* !defined(_HWTIME_H_) */
31608
31609 /************** End of hwtime.h **********************************************/
31610 /************** Continuing where we left off in os_common.h ******************/
31611 #line 53 "tsrc/os_common.h"
31612
31613 static sqlite_uint64 g_start;
31614 static sqlite_uint64 g_elapsed;
31615 #define TIMER_START g_start=sqlite3Hwtime()
31616 #define TIMER_END g_elapsed=sqlite3Hwtime()-g_start
@@ -31673,11 +31614,10 @@
31673
31674 #endif /* !defined(_OS_COMMON_H_) */
31675
31676 /************** End of os_common.h *******************************************/
31677 /************** Continuing where we left off in os_win.c *********************/
31678 #line 62 "tsrc/os_win.c"
31679
31680 /*
31681 ** Some microsoft compilers lack this definition.
31682 */
31683 #ifndef INVALID_FILE_ATTRIBUTES
@@ -32860,13 +32800,23 @@
32860
32861 /*
32862 ** Make sure all writes to a particular file are committed to disk.
32863 */
32864 static int winSync(sqlite3_file *id, int flags){
32865 #if !defined(NDEBUG) || !defined(SQLITE_NO_SYNC) || defined(SQLITE_DEBUG)
32866 winFile *pFile = (winFile*)id;
 
 
32867 BOOL rc;
 
 
 
 
 
 
 
 
32868 #else
32869 UNUSED_PARAMETER(id);
32870 #endif
32871
32872 assert( pFile );
@@ -34809,11 +34759,10 @@
34809
34810 #endif /* SQLITE_OS_WIN */
34811
34812 /************** End of os_win.c **********************************************/
34813 /************** Begin file bitvec.c ******************************************/
34814 #line 1 "tsrc/bitvec.c"
34815 /*
34816 ** 2008 February 16
34817 **
34818 ** The author disclaims copyright to this source code. In place of
34819 ** a legal notice, here is a blessing:
@@ -35220,11 +35169,10 @@
35220 }
35221 #endif /* SQLITE_OMIT_BUILTIN_TEST */
35222
35223 /************** End of bitvec.c **********************************************/
35224 /************** Begin file pcache.c ******************************************/
35225 #line 1 "tsrc/pcache.c"
35226 /*
35227 ** 2008 August 05
35228 **
35229 ** The author disclaims copyright to this source code. In place of
35230 ** a legal notice, here is a blessing:
@@ -35817,11 +35765,10 @@
35817 }
35818 #endif
35819
35820 /************** End of pcache.c **********************************************/
35821 /************** Begin file pcache1.c *****************************************/
35822 #line 1 "tsrc/pcache1.c"
35823 /*
35824 ** 2008 November 05
35825 **
35826 ** The author disclaims copyright to this source code. In place of
35827 ** a legal notice, here is a blessing:
@@ -37034,11 +36981,10 @@
37034 }
37035 #endif
37036
37037 /************** End of pcache1.c *********************************************/
37038 /************** Begin file rowset.c ******************************************/
37039 #line 1 "tsrc/rowset.c"
37040 /*
37041 ** 2008 December 3
37042 **
37043 ** The author disclaims copyright to this source code. In place of
37044 ** a legal notice, here is a blessing:
@@ -37459,11 +37405,10 @@
37459 return 0;
37460 }
37461
37462 /************** End of rowset.c **********************************************/
37463 /************** Begin file pager.c *******************************************/
37464 #line 1 "tsrc/pager.c"
37465 /*
37466 ** 2001 September 15
37467 **
37468 ** The author disclaims copyright to this source code. In place of
37469 ** a legal notice, here is a blessing:
@@ -37483,11 +37428,10 @@
37483 ** another is writing.
37484 */
37485 #ifndef SQLITE_OMIT_DISKIO
37486 /************** Include wal.h in the middle of pager.c ***********************/
37487 /************** Begin file wal.h *********************************************/
37488 #line 1 "tsrc/wal.h"
37489 /*
37490 ** 2010 February 1
37491 **
37492 ** The author disclaims copyright to this source code. In place of
37493 ** a legal notice, here is a blessing:
@@ -37608,11 +37552,10 @@
37608 #endif /* ifndef SQLITE_OMIT_WAL */
37609 #endif /* _WAL_H_ */
37610
37611 /************** End of wal.h *************************************************/
37612 /************** Continuing where we left off in pager.c **********************/
37613 #line 24 "tsrc/pager.c"
37614
37615
37616 /******************* NOTES ON THE DESIGN OF THE PAGER ************************
37617 **
37618 ** This comment block describes invariants that hold when using a rollback
@@ -44422,11 +44365,10 @@
44422
44423 #endif /* SQLITE_OMIT_DISKIO */
44424
44425 /************** End of pager.c ***********************************************/
44426 /************** Begin file wal.c *********************************************/
44427 #line 1 "tsrc/wal.c"
44428 /*
44429 ** 2010 February 1
44430 **
44431 ** The author disclaims copyright to this source code. In place of
44432 ** a legal notice, here is a blessing:
@@ -47377,11 +47319,10 @@
47377
47378 #endif /* #ifndef SQLITE_OMIT_WAL */
47379
47380 /************** End of wal.c *************************************************/
47381 /************** Begin file btmutex.c *****************************************/
47382 #line 1 "tsrc/btmutex.c"
47383 /*
47384 ** 2007 August 27
47385 **
47386 ** The author disclaims copyright to this source code. In place of
47387 ** a legal notice, here is a blessing:
@@ -47397,11 +47338,10 @@
47397 ** big and we want to break it down some. This packaged seemed like
47398 ** a good breakout.
47399 */
47400 /************** Include btreeInt.h in the middle of btmutex.c ****************/
47401 /************** Begin file btreeInt.h ****************************************/
47402 #line 1 "tsrc/btreeInt.h"
47403 /*
47404 ** 2004 April 6
47405 **
47406 ** The author disclaims copyright to this source code. In place of
47407 ** a legal notice, here is a blessing:
@@ -48043,11 +47983,10 @@
48043 #define get4byte sqlite3Get4byte
48044 #define put4byte sqlite3Put4byte
48045
48046 /************** End of btreeInt.h ********************************************/
48047 /************** Continuing where we left off in btmutex.c ********************/
48048 #line 19 "tsrc/btmutex.c"
48049 #ifndef SQLITE_OMIT_SHARED_CACHE
48050 #if SQLITE_THREADSAFE
48051
48052 /*
48053 ** Obtain the BtShared mutex associated with B-Tree handle p. Also,
@@ -48316,11 +48255,10 @@
48316 #endif /* if SQLITE_THREADSAFE */
48317 #endif /* ifndef SQLITE_OMIT_SHARED_CACHE */
48318
48319 /************** End of btmutex.c *********************************************/
48320 /************** Begin file btree.c *******************************************/
48321 #line 1 "tsrc/btree.c"
48322 /*
48323 ** 2004 April 6
48324 **
48325 ** The author disclaims copyright to this source code. In place of
48326 ** a legal notice, here is a blessing:
@@ -48982,11 +48920,11 @@
48982 assert( nKey==(i64)(int)nKey );
48983 pIdxKey = sqlite3VdbeAllocUnpackedRecord(
48984 pCur->pKeyInfo, aSpace, sizeof(aSpace), &pFree
48985 );
48986 if( pIdxKey==0 ) return SQLITE_NOMEM;
48987 sqlite3VdbeRecordUnpack(pCur->pKeyInfo, nKey, pKey, pIdxKey);
48988 }else{
48989 pIdxKey = 0;
48990 }
48991 rc = sqlite3BtreeMovetoUnpacked(pCur, pIdxKey, nKey, bias, pRes);
48992 if( pFree ){
@@ -56504,11 +56442,10 @@
56504 return rc;
56505 }
56506
56507 /************** End of btree.c ***********************************************/
56508 /************** Begin file backup.c ******************************************/
56509 #line 1 "tsrc/backup.c"
56510 /*
56511 ** 2009 January 28
56512 **
56513 ** The author disclaims copyright to this source code. In place of
56514 ** a legal notice, here is a blessing:
@@ -57211,11 +57148,10 @@
57211 }
57212 #endif /* SQLITE_OMIT_VACUUM */
57213
57214 /************** End of backup.c **********************************************/
57215 /************** Begin file vdbemem.c *****************************************/
57216 #line 1 "tsrc/vdbemem.c"
57217 /*
57218 ** 2004 May 26
57219 **
57220 ** The author disclaims copyright to this source code. In place of
57221 ** a legal notice, here is a blessing:
@@ -58366,11 +58302,10 @@
58366 return 0;
58367 }
58368
58369 /************** End of vdbemem.c *********************************************/
58370 /************** Begin file vdbeaux.c *****************************************/
58371 #line 1 "tsrc/vdbeaux.c"
58372 /*
58373 ** 2003 September 6
58374 **
58375 ** The author disclaims copyright to this source code. In place of
58376 ** a legal notice, here is a blessing:
@@ -59037,22 +58972,19 @@
59037 p->pNext = pVdbe->pProgram;
59038 pVdbe->pProgram = p;
59039 }
59040
59041 /*
59042 ** Change N opcodes starting at addr to No-ops.
59043 */
59044 SQLITE_PRIVATE void sqlite3VdbeChangeToNoop(Vdbe *p, int addr, int N){
59045 if( p->aOp ){
59046 VdbeOp *pOp = &p->aOp[addr];
59047 sqlite3 *db = p->db;
59048 while( N-- ){
59049 freeP4(db, pOp->p4type, pOp->p4.p);
59050 memset(pOp, 0, sizeof(pOp[0]));
59051 pOp->opcode = OP_Noop;
59052 pOp++;
59053 }
59054 }
59055 }
59056
59057 /*
59058 ** Change the value of the P4 operand for a specific instruction.
@@ -59204,11 +59136,11 @@
59204 ** check the value of p->nOp-1 before continuing.
59205 */
59206 SQLITE_PRIVATE VdbeOp *sqlite3VdbeGetOp(Vdbe *p, int addr){
59207 /* C89 specifies that the constant "dummy" will be initialized to all
59208 ** zeros, which is correct. MSVC generates a warning, nevertheless. */
59209 static const VdbeOp dummy; /* Ignore the MSVC warning about no initializer */
59210 assert( p->magic==VDBE_MAGIC_INIT );
59211 if( addr<0 ){
59212 #ifdef SQLITE_OMIT_TRACE
59213 if( p->nOp==0 ) return (VdbeOp*)&dummy;
59214 #endif
@@ -61609,11 +61541,10 @@
61609 }
61610 }
61611
61612 /************** End of vdbeaux.c *********************************************/
61613 /************** Begin file vdbeapi.c *****************************************/
61614 #line 1 "tsrc/vdbeapi.c"
61615 /*
61616 ** 2004 May 26
61617 **
61618 ** The author disclaims copyright to this source code. In place of
61619 ** a legal notice, here is a blessing:
@@ -62917,11 +62848,10 @@
62917 return v;
62918 }
62919
62920 /************** End of vdbeapi.c *********************************************/
62921 /************** Begin file vdbetrace.c ***************************************/
62922 #line 1 "tsrc/vdbetrace.c"
62923 /*
62924 ** 2009 November 25
62925 **
62926 ** The author disclaims copyright to this source code. In place of
62927 ** a legal notice, here is a blessing:
@@ -63073,11 +63003,10 @@
63073
63074 #endif /* #ifndef SQLITE_OMIT_TRACE */
63075
63076 /************** End of vdbetrace.c *******************************************/
63077 /************** Begin file vdbe.c ********************************************/
63078 #line 1 "tsrc/vdbe.c"
63079 /*
63080 ** 2001 September 15
63081 **
63082 ** The author disclaims copyright to this source code. In place of
63083 ** a legal notice, here is a blessing:
@@ -63543,11 +63472,10 @@
63543 ** hwtime.h contains inline assembler code for implementing
63544 ** high-performance timing routines.
63545 */
63546 /************** Include hwtime.h in the middle of vdbe.c *********************/
63547 /************** Begin file hwtime.h ******************************************/
63548 #line 1 "tsrc/hwtime.h"
63549 /*
63550 ** 2008 May 27
63551 **
63552 ** The author disclaims copyright to this source code. In place of
63553 ** a legal notice, here is a blessing:
@@ -63632,11 +63560,10 @@
63632
63633 #endif /* !defined(_HWTIME_H_) */
63634
63635 /************** End of hwtime.h **********************************************/
63636 /************** Continuing where we left off in vdbe.c ***********************/
63637 #line 471 "tsrc/vdbe.c"
63638
63639 #endif
63640
63641 /*
63642 ** The CHECK_FOR_INTERRUPT macro defined here looks to see if the
@@ -65627,10 +65554,20 @@
65627 sqlite3VdbeMemSetInt64(pOut, ~sqlite3VdbeIntValue(pIn1));
65628 }
65629 break;
65630 }
65631
 
 
 
 
 
 
 
 
 
 
65632 /* Opcode: If P1 P2 P3 * *
65633 **
65634 ** Jump to P2 if the value in register P1 is true. The value
65635 ** is considered true if it is numeric and non-zero. If the value
65636 ** in P1 is NULL then take the jump if P3 is true.
@@ -65639,10 +65576,11 @@
65639 **
65640 ** Jump to P2 if the value in register P1 is False. The value
65641 ** is considered true if it has a numeric value of zero. If the value
65642 ** in P1 is NULL then take the jump if P3 is true.
65643 */
 
65644 case OP_If: /* jump, in1 */
65645 case OP_IfNot: { /* jump, in1 */
65646 #if 0 /* local variables moved into u.al */
65647 int c;
65648 #endif /* local variables moved into u.al */
@@ -65657,10 +65595,16 @@
65657 #endif
65658 if( pOp->opcode==OP_IfNot ) u.al.c = !u.al.c;
65659 }
65660 if( u.al.c ){
65661 pc = pOp->p2-1;
 
 
 
 
 
 
65662 }
65663 break;
65664 }
65665
65666 /* Opcode: IsNull P1 P2 * * *
@@ -69860,11 +69804,10 @@
69860 goto vdbe_error_halt;
69861 }
69862
69863 /************** End of vdbe.c ************************************************/
69864 /************** Begin file vdbeblob.c ****************************************/
69865 #line 1 "tsrc/vdbeblob.c"
69866 /*
69867 ** 2007 May 1
69868 **
69869 ** The author disclaims copyright to this source code. In place of
69870 ** a legal notice, here is a blessing:
@@ -70134,21 +70077,21 @@
70134 /* Make sure a mutex is held on the table to be accessed */
70135 sqlite3VdbeUsesBtree(v, iDb);
70136
70137 /* Configure the OP_TableLock instruction */
70138 #ifdef SQLITE_OMIT_SHARED_CACHE
70139 sqlite3VdbeChangeToNoop(v, 2, 1);
70140 #else
70141 sqlite3VdbeChangeP1(v, 2, iDb);
70142 sqlite3VdbeChangeP2(v, 2, pTab->tnum);
70143 sqlite3VdbeChangeP3(v, 2, flags);
70144 sqlite3VdbeChangeP4(v, 2, pTab->zName, P4_TRANSIENT);
70145 #endif
70146
70147 /* Remove either the OP_OpenWrite or OpenRead. Set the P2
70148 ** parameter of the other to pTab->tnum. */
70149 sqlite3VdbeChangeToNoop(v, 4 - flags, 1);
70150 sqlite3VdbeChangeP2(v, 3 + flags, pTab->tnum);
70151 sqlite3VdbeChangeP3(v, 3 + flags, iDb);
70152
70153 /* Configure the number of columns. Configure the cursor to
70154 ** think that the table has one more column than it really
@@ -70331,11 +70274,10 @@
70331
70332 #endif /* #ifndef SQLITE_OMIT_INCRBLOB */
70333
70334 /************** End of vdbeblob.c ********************************************/
70335 /************** Begin file vdbesort.c ****************************************/
70336 #line 1 "tsrc/vdbesort.c"
70337 /*
70338 ** 2011 July 9
70339 **
70340 ** The author disclaims copyright to this source code. In place of
70341 ** a legal notice, here is a blessing:
@@ -70492,12 +70434,16 @@
70492 int rc; /* Return Code */
70493 int nRead; /* Number of bytes read */
70494 int nRec = 0; /* Size of record in bytes */
70495 int iOff = 0; /* Size of serialized size varint in bytes */
70496
70497 nRead = pIter->iEof - pIter->iReadOff;
70498 if( nRead>5 ) nRead = 5;
 
 
 
 
70499 if( nRead<=0 ){
70500 /* This is an EOF condition */
70501 vdbeSorterIterZero(db, pIter);
70502 return SQLITE_OK;
70503 }
@@ -71211,11 +71157,10 @@
71211
71212 #endif /* #ifndef SQLITE_OMIT_MERGE_SORT */
71213
71214 /************** End of vdbesort.c ********************************************/
71215 /************** Begin file journal.c *****************************************/
71216 #line 1 "tsrc/journal.c"
71217 /*
71218 ** 2007 August 22
71219 **
71220 ** The author disclaims copyright to this source code. In place of
71221 ** a legal notice, here is a blessing:
@@ -71452,11 +71397,10 @@
71452 }
71453 #endif
71454
71455 /************** End of journal.c *********************************************/
71456 /************** Begin file memjournal.c **************************************/
71457 #line 1 "tsrc/memjournal.c"
71458 /*
71459 ** 2008 October 7
71460 **
71461 ** The author disclaims copyright to this source code. In place of
71462 ** a legal notice, here is a blessing:
@@ -71714,11 +71658,10 @@
71714 return sizeof(MemJournal);
71715 }
71716
71717 /************** End of memjournal.c ******************************************/
71718 /************** Begin file walker.c ******************************************/
71719 #line 1 "tsrc/walker.c"
71720 /*
71721 ** 2008 August 16
71722 **
71723 ** The author disclaims copyright to this source code. In place of
71724 ** a legal notice, here is a blessing:
@@ -71853,11 +71796,10 @@
71853 return rc & WRC_Abort;
71854 }
71855
71856 /************** End of walker.c **********************************************/
71857 /************** Begin file resolve.c *****************************************/
71858 #line 1 "tsrc/resolve.c"
71859 /*
71860 ** 2008 August 18
71861 **
71862 ** The author disclaims copyright to this source code. In place of
71863 ** a legal notice, here is a blessing:
@@ -73074,11 +73016,10 @@
73074 sqlite3WalkSelect(&w, p);
73075 }
73076
73077 /************** End of resolve.c *********************************************/
73078 /************** Begin file expr.c ********************************************/
73079 #line 1 "tsrc/expr.c"
73080 /*
73081 ** 2001 September 15
73082 **
73083 ** The author disclaims copyright to this source code. In place of
73084 ** a legal notice, here is a blessing:
@@ -73977,11 +73918,12 @@
73977 pNewItem->zDatabase = sqlite3DbStrDup(db, pOldItem->zDatabase);
73978 pNewItem->zName = sqlite3DbStrDup(db, pOldItem->zName);
73979 pNewItem->zAlias = sqlite3DbStrDup(db, pOldItem->zAlias);
73980 pNewItem->jointype = pOldItem->jointype;
73981 pNewItem->iCursor = pOldItem->iCursor;
73982 pNewItem->isPopulated = pOldItem->isPopulated;
 
73983 pNewItem->isCorrelated = pOldItem->isCorrelated;
73984 pNewItem->zIndex = sqlite3DbStrDup(db, pOldItem->zIndex);
73985 pNewItem->notIndexed = pOldItem->notIndexed;
73986 pNewItem->pIndex = pOldItem->pIndex;
73987 pTab = pNewItem->pTab = pOldItem->pTab;
@@ -74537,12 +74479,11 @@
74537 assert(v);
74538 if( iCol<0 ){
74539 int iMem = ++pParse->nMem;
74540 int iAddr;
74541
74542 iAddr = sqlite3VdbeAddOp1(v, OP_If, iMem);
74543 sqlite3VdbeAddOp2(v, OP_Integer, 1, iMem);
74544
74545 sqlite3OpenTable(pParse, iTab, iDb, pTab, OP_OpenRead);
74546 eType = IN_INDEX_ROWID;
74547
74548 sqlite3VdbeJumpHere(v, iAddr);
@@ -74569,12 +74510,11 @@
74569 int iMem = ++pParse->nMem;
74570 int iAddr;
74571 char *pKey;
74572
74573 pKey = (char *)sqlite3IndexKeyinfo(pParse, pIdx);
74574 iAddr = sqlite3VdbeAddOp1(v, OP_If, iMem);
74575 sqlite3VdbeAddOp2(v, OP_Integer, 1, iMem);
74576
74577 sqlite3VdbeAddOp4(v, OP_OpenRead, iTab, pIdx->tnum, iDb,
74578 pKey,P4_KEYINFO_HANDOFF);
74579 VdbeComment((v, "%s", pIdx->zName));
74580 eType = IN_INDEX_INDEX;
@@ -74651,11 +74591,11 @@
74651 Parse *pParse, /* Parsing context */
74652 Expr *pExpr, /* The IN, SELECT, or EXISTS operator */
74653 int rMayHaveNull, /* Register that records whether NULLs exist in RHS */
74654 int isRowid /* If true, LHS of IN operator is a rowid */
74655 ){
74656 int testAddr = 0; /* One-time test address */
74657 int rReg = 0; /* Register storing resulting */
74658 Vdbe *v = sqlite3GetVdbe(pParse);
74659 if( NEVER(v==0) ) return 0;
74660 sqlite3ExprCachePush(pParse);
74661
@@ -74669,19 +74609,17 @@
74669 ** If all of the above are false, then we can run this code just once
74670 ** save the results, and reuse the same result on subsequent invocations.
74671 */
74672 if( !ExprHasAnyProperty(pExpr, EP_VarSelect) && !pParse->pTriggerTab ){
74673 int mem = ++pParse->nMem;
74674 sqlite3VdbeAddOp1(v, OP_If, mem);
74675 testAddr = sqlite3VdbeAddOp2(v, OP_Integer, 1, mem);
74676 assert( testAddr>0 || pParse->db->mallocFailed );
74677 }
74678
74679 #ifndef SQLITE_OMIT_EXPLAIN
74680 if( pParse->explain==2 ){
74681 char *zMsg = sqlite3MPrintf(
74682 pParse->db, "EXECUTE %s%s SUBQUERY %d", testAddr?"":"CORRELATED ",
74683 pExpr->op==TK_IN?"LIST":"SCALAR", pParse->iNextSelectId
74684 );
74685 sqlite3VdbeAddOp4(v, OP_Explain, pParse->iSelectId, 0, 0, zMsg, P4_DYNAMIC);
74686 }
74687 #endif
@@ -74769,13 +74707,13 @@
74769 /* If the expression is not constant then we will need to
74770 ** disable the test that was generated above that makes sure
74771 ** this code only executes once. Because for a non-constant
74772 ** expression we need to rerun this code each time.
74773 */
74774 if( testAddr && !sqlite3ExprIsConstant(pE2) ){
74775 sqlite3VdbeChangeToNoop(v, testAddr-1, 2);
74776 testAddr = 0;
74777 }
74778
74779 /* Evaluate the expression and insert it into the temp table */
74780 if( isRowid && sqlite3ExprIsInteger(pE2, &iValToIns) ){
74781 sqlite3VdbeAddOp3(v, OP_InsertInt, pExpr->iTable, r2, iValToIns);
@@ -74840,12 +74778,12 @@
74840 ExprSetIrreducible(pExpr);
74841 break;
74842 }
74843 }
74844
74845 if( testAddr ){
74846 sqlite3VdbeJumpHere(v, testAddr-1);
74847 }
74848 sqlite3ExprCachePop(pParse, 1);
74849
74850 return rReg;
74851 }
@@ -76835,11 +76773,10 @@
76835 }
76836 }
76837
76838 /************** End of expr.c ************************************************/
76839 /************** Begin file alter.c *******************************************/
76840 #line 1 "tsrc/alter.c"
76841 /*
76842 ** 2005 February 15
76843 **
76844 ** The author disclaims copyright to this source code. In place of
76845 ** a legal notice, here is a blessing:
@@ -77664,11 +77601,10 @@
77664 }
77665 #endif /* SQLITE_ALTER_TABLE */
77666
77667 /************** End of alter.c ***********************************************/
77668 /************** Begin file analyze.c *****************************************/
77669 #line 1 "tsrc/analyze.c"
77670 /*
77671 ** 2005 July 8
77672 **
77673 ** The author disclaims copyright to this source code. In place of
77674 ** a legal notice, here is a blessing:
@@ -78386,11 +78322,10 @@
78386
78387 #endif /* SQLITE_OMIT_ANALYZE */
78388
78389 /************** End of analyze.c *********************************************/
78390 /************** Begin file attach.c ******************************************/
78391 #line 1 "tsrc/attach.c"
78392 /*
78393 ** 2003 April 6
78394 **
78395 ** The author disclaims copyright to this source code. In place of
78396 ** a legal notice, here is a blessing:
@@ -78946,11 +78881,10 @@
78946 }
78947 #endif
78948
78949 /************** End of attach.c **********************************************/
78950 /************** Begin file auth.c ********************************************/
78951 #line 1 "tsrc/auth.c"
78952 /*
78953 ** 2003 January 11
78954 **
78955 ** The author disclaims copyright to this source code. In place of
78956 ** a legal notice, here is a blessing:
@@ -79198,11 +79132,10 @@
79198
79199 #endif /* SQLITE_OMIT_AUTHORIZATION */
79200
79201 /************** End of auth.c ************************************************/
79202 /************** Begin file build.c *******************************************/
79203 #line 1 "tsrc/build.c"
79204 /*
79205 ** 2001 September 15
79206 **
79207 ** The author disclaims copyright to this source code. In place of
79208 ** a legal notice, here is a blessing:
@@ -83002,11 +82935,10 @@
83002 return pKey;
83003 }
83004
83005 /************** End of build.c ***********************************************/
83006 /************** Begin file callback.c ****************************************/
83007 #line 1 "tsrc/callback.c"
83008 /*
83009 ** 2005 May 23
83010 **
83011 ** The author disclaims copyright to this source code. In place of
83012 ** a legal notice, here is a blessing:
@@ -83462,11 +83394,10 @@
83462 return p;
83463 }
83464
83465 /************** End of callback.c ********************************************/
83466 /************** Begin file delete.c ******************************************/
83467 #line 1 "tsrc/delete.c"
83468 /*
83469 ** 2001 September 15
83470 **
83471 ** The author disclaims copyright to this source code. In place of
83472 ** a legal notice, here is a blessing:
@@ -84117,11 +84048,10 @@
84117 return regBase;
84118 }
84119
84120 /************** End of delete.c **********************************************/
84121 /************** Begin file func.c ********************************************/
84122 #line 1 "tsrc/func.c"
84123 /*
84124 ** 2002 February 23
84125 **
84126 ** The author disclaims copyright to this source code. In place of
84127 ** a legal notice, here is a blessing:
@@ -85726,11 +85656,10 @@
85726 #endif
85727 }
85728
85729 /************** End of func.c ************************************************/
85730 /************** Begin file fkey.c ********************************************/
85731 #line 1 "tsrc/fkey.c"
85732 /*
85733 **
85734 ** The author disclaims copyright to this source code. In place of
85735 ** a legal notice, here is a blessing:
85736 **
@@ -86947,11 +86876,10 @@
86947 }
86948 #endif /* ifndef SQLITE_OMIT_FOREIGN_KEY */
86949
86950 /************** End of fkey.c ************************************************/
86951 /************** Begin file insert.c ******************************************/
86952 #line 1 "tsrc/insert.c"
86953 /*
86954 ** 2001 September 15
86955 **
86956 ** The author disclaims copyright to this source code. In place of
86957 ** a legal notice, here is a blessing:
@@ -88793,11 +88721,10 @@
88793 }
88794 #endif /* SQLITE_OMIT_XFER_OPT */
88795
88796 /************** End of insert.c **********************************************/
88797 /************** Begin file legacy.c ******************************************/
88798 #line 1 "tsrc/legacy.c"
88799 /*
88800 ** 2001 September 15
88801 **
88802 ** The author disclaims copyright to this source code. In place of
88803 ** a legal notice, here is a blessing:
@@ -88941,11 +88868,10 @@
88941 return rc;
88942 }
88943
88944 /************** End of legacy.c **********************************************/
88945 /************** Begin file loadext.c *****************************************/
88946 #line 1 "tsrc/loadext.c"
88947 /*
88948 ** 2006 June 7
88949 **
88950 ** The author disclaims copyright to this source code. In place of
88951 ** a legal notice, here is a blessing:
@@ -88962,11 +88888,10 @@
88962 #ifndef SQLITE_CORE
88963 #define SQLITE_CORE 1 /* Disable the API redefinition in sqlite3ext.h */
88964 #endif
88965 /************** Include sqlite3ext.h in the middle of loadext.c **************/
88966 /************** Begin file sqlite3ext.h **************************************/
88967 #line 1 "tsrc/sqlite3ext.h"
88968 /*
88969 ** 2006 June 7
88970 **
88971 ** The author disclaims copyright to this source code. In place of
88972 ** a legal notice, here is a blessing:
@@ -89391,11 +89316,10 @@
89391
89392 #endif /* _SQLITE3EXT_H_ */
89393
89394 /************** End of sqlite3ext.h ******************************************/
89395 /************** Continuing where we left off in loadext.c ********************/
89396 #line 20 "tsrc/loadext.c"
89397 /* #include <string.h> */
89398
89399 #ifndef SQLITE_OMIT_LOAD_EXTENSION
89400
89401 /*
@@ -90031,11 +89955,10 @@
90031 }
90032 }
90033
90034 /************** End of loadext.c *********************************************/
90035 /************** Begin file pragma.c ******************************************/
90036 #line 1 "tsrc/pragma.c"
90037 /*
90038 ** 2003 April 6
90039 **
90040 ** The author disclaims copyright to this source code. In place of
90041 ** a legal notice, here is a blessing:
@@ -91560,11 +91483,10 @@
91560
91561 #endif /* SQLITE_OMIT_PRAGMA */
91562
91563 /************** End of pragma.c **********************************************/
91564 /************** Begin file prepare.c *****************************************/
91565 #line 1 "tsrc/prepare.c"
91566 /*
91567 ** 2005 May 25
91568 **
91569 ** The author disclaims copyright to this source code. In place of
91570 ** a legal notice, here is a blessing:
@@ -92421,11 +92343,10 @@
92421
92422 #endif /* SQLITE_OMIT_UTF16 */
92423
92424 /************** End of prepare.c *********************************************/
92425 /************** Begin file select.c ******************************************/
92426 #line 1 "tsrc/select.c"
92427 /*
92428 ** 2001 September 15
92429 **
92430 ** The author disclaims copyright to this source code. In place of
92431 ** a legal notice, here is a blessing:
@@ -92512,10 +92433,12 @@
92512 pNew->addrOpenEphm[2] = -1;
92513 if( db->mallocFailed ) {
92514 clearSelect(db, pNew);
92515 if( pNew!=&standin ) sqlite3DbFree(db, pNew);
92516 pNew = 0;
 
 
92517 }
92518 return pNew;
92519 }
92520
92521 /*
@@ -96224,11 +96147,15 @@
96224 struct SrcList_item *pItem = &pTabList->a[i];
96225 SelectDest dest;
96226 Select *pSub = pItem->pSelect;
96227 int isAggSub;
96228
96229 if( pSub==0 || pItem->isPopulated ) continue;
 
 
 
 
96230
96231 /* Increment Parse.nHeight by the height of the largest expression
96232 ** tree refered to by this, the parent select. The child select
96233 ** may contain expression trees of at most
96234 ** (SQLITE_MAX_EXPR_DEPTH-Parse.nHeight) height. This is a bit
@@ -96235,25 +96162,48 @@
96235 ** more conservative than necessary, but much easier than enforcing
96236 ** an exact limit.
96237 */
96238 pParse->nHeight += sqlite3SelectExprHeight(p);
96239
96240 /* Check to see if the subquery can be absorbed into the parent. */
96241 isAggSub = (pSub->selFlags & SF_Aggregate)!=0;
96242 if( flattenSubquery(pParse, p, i, isAgg, isAggSub) ){
 
96243 if( isAggSub ){
96244 isAgg = 1;
96245 p->selFlags |= SF_Aggregate;
96246 }
96247 i = -1;
96248 }else{
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
96249 sqlite3SelectDestInit(&dest, SRT_EphemTab, pItem->iCursor);
96250 assert( pItem->isPopulated==0 );
96251 explainSetInteger(pItem->iSelectId, (u8)pParse->iNextSelectId);
96252 sqlite3Select(pParse, pSub, &dest);
96253 pItem->isPopulated = 1;
96254 pItem->pTab->nRowEst = (unsigned)pSub->nSelectRow;
 
 
 
 
 
96255 }
96256 if( /*pParse->nErr ||*/ db->mallocFailed ){
96257 goto select_end;
96258 }
96259 pParse->nHeight -= sqlite3SelectExprHeight(p);
@@ -96390,11 +96340,11 @@
96390 /* If sorting index that was created by a prior OP_OpenEphemeral
96391 ** instruction ended up not being needed, then change the OP_OpenEphemeral
96392 ** into an OP_Noop.
96393 */
96394 if( addrSortIndex>=0 && pOrderBy==0 ){
96395 sqlite3VdbeChangeToNoop(v, addrSortIndex, 1);
96396 p->addrOpenEphm[2] = -1;
96397 }
96398
96399 if( pWInfo->eDistinct ){
96400 VdbeOp *pOp; /* No longer required OpenEphemeral instr. */
@@ -96673,11 +96623,11 @@
96673 */
96674 if( groupBySort ){
96675 sqlite3VdbeAddOp2(v, OP_SorterNext, sAggInfo.sortingIdx, addrTopOfLoop);
96676 }else{
96677 sqlite3WhereEnd(pWInfo);
96678 sqlite3VdbeChangeToNoop(v, addrSortingIdx, 1);
96679 }
96680
96681 /* Output the final row of result
96682 */
96683 sqlite3VdbeAddOp2(v, OP_Gosub, regOutputRow, addrOutputRow);
@@ -96981,11 +96931,10 @@
96981 *****************************************************************************/
96982 #endif /* defined(SQLITE_TEST) || defined(SQLITE_DEBUG) */
96983
96984 /************** End of select.c **********************************************/
96985 /************** Begin file table.c *******************************************/
96986 #line 1 "tsrc/table.c"
96987 /*
96988 ** 2001 September 15
96989 **
96990 ** The author disclaims copyright to this source code. In place of
96991 ** a legal notice, here is a blessing:
@@ -97181,11 +97130,10 @@
97181
97182 #endif /* SQLITE_OMIT_GET_TABLE */
97183
97184 /************** End of table.c ***********************************************/
97185 /************** Begin file trigger.c *****************************************/
97186 #line 1 "tsrc/trigger.c"
97187 /*
97188 **
97189 ** The author disclaims copyright to this source code. In place of
97190 ** a legal notice, here is a blessing:
97191 **
@@ -98307,11 +98255,10 @@
98307
98308 #endif /* !defined(SQLITE_OMIT_TRIGGER) */
98309
98310 /************** End of trigger.c *********************************************/
98311 /************** Begin file update.c ******************************************/
98312 #line 1 "tsrc/update.c"
98313 /*
98314 ** 2001 September 15
98315 **
98316 ** The author disclaims copyright to this source code. In place of
98317 ** a legal notice, here is a blessing:
@@ -98980,11 +98927,10 @@
98980 }
98981 #endif /* SQLITE_OMIT_VIRTUALTABLE */
98982
98983 /************** End of update.c **********************************************/
98984 /************** Begin file vacuum.c ******************************************/
98985 #line 1 "tsrc/vacuum.c"
98986 /*
98987 ** 2003 April 6
98988 **
98989 ** The author disclaims copyright to this source code. In place of
98990 ** a legal notice, here is a blessing:
@@ -99327,11 +99273,10 @@
99327
99328 #endif /* SQLITE_OMIT_VACUUM && SQLITE_OMIT_ATTACH */
99329
99330 /************** End of vacuum.c **********************************************/
99331 /************** Begin file vtab.c ********************************************/
99332 #line 1 "tsrc/vtab.c"
99333 /*
99334 ** 2006 June 10
99335 **
99336 ** The author disclaims copyright to this source code. In place of
99337 ** a legal notice, here is a blessing:
@@ -100396,11 +100341,10 @@
100396
100397 #endif /* SQLITE_OMIT_VIRTUALTABLE */
100398
100399 /************** End of vtab.c ************************************************/
100400 /************** Begin file where.c *******************************************/
100401 #line 1 "tsrc/where.c"
100402 /*
100403 ** 2001 September 15
100404 **
100405 ** The author disclaims copyright to this source code. In place of
100406 ** a legal notice, here is a blessing:
@@ -100865,15 +100809,23 @@
100865 return mask;
100866 }
100867 static Bitmask exprSelectTableUsage(WhereMaskSet *pMaskSet, Select *pS){
100868 Bitmask mask = 0;
100869 while( pS ){
 
100870 mask |= exprListTableUsage(pMaskSet, pS->pEList);
100871 mask |= exprListTableUsage(pMaskSet, pS->pGroupBy);
100872 mask |= exprListTableUsage(pMaskSet, pS->pOrderBy);
100873 mask |= exprTableUsage(pMaskSet, pS->pWhere);
100874 mask |= exprTableUsage(pMaskSet, pS->pHaving);
 
 
 
 
 
 
 
100875 pS = pS->pPrior;
100876 }
100877 return mask;
100878 }
100879
@@ -102392,12 +102344,11 @@
102392 /* Generate code to skip over the creation and initialization of the
102393 ** transient index on 2nd and subsequent iterations of the loop. */
102394 v = pParse->pVdbe;
102395 assert( v!=0 );
102396 regIsInit = ++pParse->nMem;
102397 addrInit = sqlite3VdbeAddOp1(v, OP_If, regIsInit);
102398 sqlite3VdbeAddOp2(v, OP_Integer, 1, regIsInit);
102399
102400 /* Count the number of columns that will be added to the index
102401 ** and used to match WHERE clause constraints */
102402 nColumn = 0;
102403 pTable = pSrc->pTab;
@@ -105583,11 +105534,10 @@
105583 return;
105584 }
105585
105586 /************** End of where.c ***********************************************/
105587 /************** Begin file parse.c *******************************************/
105588 #line 1 "tsrc/parse.c"
105589 /* Driver template for the LEMON parser generator.
105590 ** The author disclaims copyright to this source code.
105591 **
105592 ** This version of "lempar.c" is modified, slightly, for use by SQLite.
105593 ** The only modifications are the addition of a couple of NEVER()
@@ -105596,11 +105546,10 @@
105596 ** specific grammar used by SQLite.
105597 */
105598 /* First off, code is included that follows the "include" declaration
105599 ** in the input grammar file. */
105600 /* #include <stdio.h> */
105601 #line 51 "parse.y"
105602
105603
105604 /*
105605 ** Disable all error recovery processing in the parser push-down
105606 ** automaton.
@@ -105644,11 +105593,10 @@
105644 /*
105645 ** An instance of this structure holds the ATTACH key and the key type.
105646 */
105647 struct AttachKey { int type; Token key; };
105648
105649 #line 722 "parse.y"
105650
105651 /* This is a utility routine used to set the ExprSpan.zStart and
105652 ** ExprSpan.zEnd values of pOut so that the span covers the complete
105653 ** range of text beginning with pStart and going to the end of pEnd.
105654 */
@@ -105664,11 +105612,10 @@
105664 static void spanExpr(ExprSpan *pOut, Parse *pParse, int op, Token *pValue){
105665 pOut->pExpr = sqlite3PExpr(pParse, op, 0, 0, pValue);
105666 pOut->zStart = pValue->z;
105667 pOut->zEnd = &pValue->z[pValue->n];
105668 }
105669 #line 817 "parse.y"
105670
105671 /* This routine constructs a binary expression node out of two ExprSpan
105672 ** objects and uses the result to populate a new ExprSpan object.
105673 */
105674 static void spanBinaryExpr(
@@ -105680,11 +105627,10 @@
105680 ){
105681 pOut->pExpr = sqlite3PExpr(pParse, op, pLeft->pExpr, pRight->pExpr, 0);
105682 pOut->zStart = pLeft->zStart;
105683 pOut->zEnd = pRight->zEnd;
105684 }
105685 #line 873 "parse.y"
105686
105687 /* Construct an expression node for a unary postfix operator
105688 */
105689 static void spanUnaryPostfix(
105690 ExprSpan *pOut, /* Write the new expression node here */
@@ -105695,11 +105641,10 @@
105695 ){
105696 pOut->pExpr = sqlite3PExpr(pParse, op, pOperand->pExpr, 0, 0);
105697 pOut->zStart = pOperand->zStart;
105698 pOut->zEnd = &pPostOp->z[pPostOp->n];
105699 }
105700 #line 892 "parse.y"
105701
105702 /* A routine to convert a binary TK_IS or TK_ISNOT expression into a
105703 ** unary TK_ISNULL or TK_NOTNULL expression. */
105704 static void binaryToUnaryIfNull(Parse *pParse, Expr *pY, Expr *pA, int op){
105705 sqlite3 *db = pParse->db;
@@ -105707,11 +105652,10 @@
105707 pA->op = (u8)op;
105708 sqlite3ExprDelete(db, pA->pRight);
105709 pA->pRight = 0;
105710 }
105711 }
105712 #line 920 "parse.y"
105713
105714 /* Construct an expression node for a unary prefix operator
105715 */
105716 static void spanUnaryPrefix(
105717 ExprSpan *pOut, /* Write the new expression node here */
@@ -105722,11 +105666,10 @@
105722 ){
105723 pOut->pExpr = sqlite3PExpr(pParse, op, pOperand->pExpr, 0, 0);
105724 pOut->zStart = pPreOp->z;
105725 pOut->zEnd = pOperand->zEnd;
105726 }
105727 #line 141 "parse.c"
105728 /* Next is all token values, in a form suitable for use by makeheaders.
105729 ** This section will be null unless lemon is run with the -m switch.
105730 */
105731 /*
105732 ** These constants (all generated automatically by the parser generator)
@@ -106978,21 +106921,17 @@
106978 ** inside the C code.
106979 */
106980 case 160: /* select */
106981 case 194: /* oneselect */
106982 {
106983 #line 403 "parse.y"
106984 sqlite3SelectDelete(pParse->db, (yypminor->yy387));
106985 #line 1399 "parse.c"
106986 }
106987 break;
106988 case 174: /* term */
106989 case 175: /* expr */
106990 {
106991 #line 720 "parse.y"
106992 sqlite3ExprDelete(pParse->db, (yypminor->yy118).pExpr);
106993 #line 1407 "parse.c"
106994 }
106995 break;
106996 case 179: /* idxlist_opt */
106997 case 187: /* idxlist */
106998 case 197: /* selcollist */
@@ -107004,23 +106943,19 @@
107004 case 217: /* setlist */
107005 case 220: /* itemlist */
107006 case 221: /* exprlist */
107007 case 226: /* case_exprlist */
107008 {
107009 #line 1103 "parse.y"
107010 sqlite3ExprListDelete(pParse->db, (yypminor->yy322));
107011 #line 1425 "parse.c"
107012 }
107013 break;
107014 case 193: /* fullname */
107015 case 198: /* from */
107016 case 206: /* seltablist */
107017 case 207: /* stl_prefix */
107018 {
107019 #line 534 "parse.y"
107020 sqlite3SrcListDelete(pParse->db, (yypminor->yy259));
107021 #line 1435 "parse.c"
107022 }
107023 break;
107024 case 199: /* where_opt */
107025 case 201: /* having_opt */
107026 case 210: /* on_opt */
@@ -107028,37 +106963,29 @@
107028 case 225: /* case_operand */
107029 case 227: /* case_else */
107030 case 238: /* when_clause */
107031 case 243: /* key_opt */
107032 {
107033 #line 644 "parse.y"
107034 sqlite3ExprDelete(pParse->db, (yypminor->yy314));
107035 #line 1449 "parse.c"
107036 }
107037 break;
107038 case 211: /* using_opt */
107039 case 213: /* inscollist */
107040 case 219: /* inscollist_opt */
107041 {
107042 #line 566 "parse.y"
107043 sqlite3IdListDelete(pParse->db, (yypminor->yy384));
107044 #line 1458 "parse.c"
107045 }
107046 break;
107047 case 234: /* trigger_cmd_list */
107048 case 239: /* trigger_cmd */
107049 {
107050 #line 1210 "parse.y"
107051 sqlite3DeleteTriggerStep(pParse->db, (yypminor->yy203));
107052 #line 1466 "parse.c"
107053 }
107054 break;
107055 case 236: /* trigger_event */
107056 {
107057 #line 1196 "parse.y"
107058 sqlite3IdListDelete(pParse->db, (yypminor->yy90).b);
107059 #line 1473 "parse.c"
107060 }
107061 break;
107062 default: break; /* If no destructor action specified: do nothing */
107063 }
107064 }
@@ -107240,16 +107167,14 @@
107240 }
107241 #endif
107242 while( yypParser->yyidx>=0 ) yy_pop_parser_stack(yypParser);
107243 /* Here code is inserted which will execute if the parser
107244 ** stack every overflows */
107245 #line 38 "parse.y"
107246
107247 UNUSED_PARAMETER(yypMinor); /* Silence some compiler warnings */
107248 sqlite3ErrorMsg(pParse, "parser stack overflow");
107249 pParse->parseError = 1;
107250 #line 1664 "parse.c"
107251 sqlite3ParserARG_STORE; /* Suppress warning about unused %extra_argument var */
107252 }
107253
107254 /*
107255 ** Perform a shift action.
@@ -107686,94 +107611,66 @@
107686 ** { ... } // User supplied code
107687 ** #line <lineno> <thisfile>
107688 ** break;
107689 */
107690 case 5: /* explain ::= */
107691 #line 107 "parse.y"
107692 { sqlite3BeginParse(pParse, 0); }
107693 #line 2107 "parse.c"
107694 break;
107695 case 6: /* explain ::= EXPLAIN */
107696 #line 109 "parse.y"
107697 { sqlite3BeginParse(pParse, 1); }
107698 #line 2112 "parse.c"
107699 break;
107700 case 7: /* explain ::= EXPLAIN QUERY PLAN */
107701 #line 110 "parse.y"
107702 { sqlite3BeginParse(pParse, 2); }
107703 #line 2117 "parse.c"
107704 break;
107705 case 8: /* cmdx ::= cmd */
107706 #line 112 "parse.y"
107707 { sqlite3FinishCoding(pParse); }
107708 #line 2122 "parse.c"
107709 break;
107710 case 9: /* cmd ::= BEGIN transtype trans_opt */
107711 #line 117 "parse.y"
107712 {sqlite3BeginTransaction(pParse, yymsp[-1].minor.yy4);}
107713 #line 2127 "parse.c"
107714 break;
107715 case 13: /* transtype ::= */
107716 #line 122 "parse.y"
107717 {yygotominor.yy4 = TK_DEFERRED;}
107718 #line 2132 "parse.c"
107719 break;
107720 case 14: /* transtype ::= DEFERRED */
107721 case 15: /* transtype ::= IMMEDIATE */ yytestcase(yyruleno==15);
107722 case 16: /* transtype ::= EXCLUSIVE */ yytestcase(yyruleno==16);
107723 case 115: /* multiselect_op ::= UNION */ yytestcase(yyruleno==115);
107724 case 117: /* multiselect_op ::= EXCEPT|INTERSECT */ yytestcase(yyruleno==117);
107725 #line 123 "parse.y"
107726 {yygotominor.yy4 = yymsp[0].major;}
107727 #line 2141 "parse.c"
107728 break;
107729 case 17: /* cmd ::= COMMIT trans_opt */
107730 case 18: /* cmd ::= END trans_opt */ yytestcase(yyruleno==18);
107731 #line 126 "parse.y"
107732 {sqlite3CommitTransaction(pParse);}
107733 #line 2147 "parse.c"
107734 break;
107735 case 19: /* cmd ::= ROLLBACK trans_opt */
107736 #line 128 "parse.y"
107737 {sqlite3RollbackTransaction(pParse);}
107738 #line 2152 "parse.c"
107739 break;
107740 case 22: /* cmd ::= SAVEPOINT nm */
107741 #line 132 "parse.y"
107742 {
107743 sqlite3Savepoint(pParse, SAVEPOINT_BEGIN, &yymsp[0].minor.yy0);
107744 }
107745 #line 2159 "parse.c"
107746 break;
107747 case 23: /* cmd ::= RELEASE savepoint_opt nm */
107748 #line 135 "parse.y"
107749 {
107750 sqlite3Savepoint(pParse, SAVEPOINT_RELEASE, &yymsp[0].minor.yy0);
107751 }
107752 #line 2166 "parse.c"
107753 break;
107754 case 24: /* cmd ::= ROLLBACK trans_opt TO savepoint_opt nm */
107755 #line 138 "parse.y"
107756 {
107757 sqlite3Savepoint(pParse, SAVEPOINT_ROLLBACK, &yymsp[0].minor.yy0);
107758 }
107759 #line 2173 "parse.c"
107760 break;
107761 case 26: /* create_table ::= createkw temp TABLE ifnotexists nm dbnm */
107762 #line 145 "parse.y"
107763 {
107764 sqlite3StartTable(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,yymsp[-4].minor.yy4,0,0,yymsp[-2].minor.yy4);
107765 }
107766 #line 2180 "parse.c"
107767 break;
107768 case 27: /* createkw ::= CREATE */
107769 #line 148 "parse.y"
107770 {
107771 pParse->db->lookaside.bEnabled = 0;
107772 yygotominor.yy0 = yymsp[0].minor.yy0;
107773 }
107774 #line 2188 "parse.c"
107775 break;
107776 case 28: /* ifnotexists ::= */
107777 case 31: /* temp ::= */ yytestcase(yyruleno==31);
107778 case 70: /* autoinc ::= */ yytestcase(yyruleno==70);
107779 case 83: /* defer_subclause ::= NOT DEFERRABLE init_deferred_pred_opt */ yytestcase(yyruleno==83);
@@ -107783,56 +107680,44 @@
107783 case 109: /* ifexists ::= */ yytestcase(yyruleno==109);
107784 case 120: /* distinct ::= ALL */ yytestcase(yyruleno==120);
107785 case 121: /* distinct ::= */ yytestcase(yyruleno==121);
107786 case 222: /* between_op ::= BETWEEN */ yytestcase(yyruleno==222);
107787 case 225: /* in_op ::= IN */ yytestcase(yyruleno==225);
107788 #line 153 "parse.y"
107789 {yygotominor.yy4 = 0;}
107790 #line 2204 "parse.c"
107791 break;
107792 case 29: /* ifnotexists ::= IF NOT EXISTS */
107793 case 30: /* temp ::= TEMP */ yytestcase(yyruleno==30);
107794 case 71: /* autoinc ::= AUTOINCR */ yytestcase(yyruleno==71);
107795 case 86: /* init_deferred_pred_opt ::= INITIALLY DEFERRED */ yytestcase(yyruleno==86);
107796 case 108: /* ifexists ::= IF EXISTS */ yytestcase(yyruleno==108);
107797 case 119: /* distinct ::= DISTINCT */ yytestcase(yyruleno==119);
107798 case 223: /* between_op ::= NOT BETWEEN */ yytestcase(yyruleno==223);
107799 case 226: /* in_op ::= NOT IN */ yytestcase(yyruleno==226);
107800 #line 154 "parse.y"
107801 {yygotominor.yy4 = 1;}
107802 #line 2216 "parse.c"
107803 break;
107804 case 32: /* create_table_args ::= LP columnlist conslist_opt RP */
107805 #line 160 "parse.y"
107806 {
107807 sqlite3EndTable(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,0);
107808 }
107809 #line 2223 "parse.c"
107810 break;
107811 case 33: /* create_table_args ::= AS select */
107812 #line 163 "parse.y"
107813 {
107814 sqlite3EndTable(pParse,0,0,yymsp[0].minor.yy387);
107815 sqlite3SelectDelete(pParse->db, yymsp[0].minor.yy387);
107816 }
107817 #line 2231 "parse.c"
107818 break;
107819 case 36: /* column ::= columnid type carglist */
107820 #line 175 "parse.y"
107821 {
107822 yygotominor.yy0.z = yymsp[-2].minor.yy0.z;
107823 yygotominor.yy0.n = (int)(pParse->sLastToken.z-yymsp[-2].minor.yy0.z) + pParse->sLastToken.n;
107824 }
107825 #line 2239 "parse.c"
107826 break;
107827 case 37: /* columnid ::= nm */
107828 #line 179 "parse.y"
107829 {
107830 sqlite3AddColumn(pParse,&yymsp[0].minor.yy0);
107831 yygotominor.yy0 = yymsp[0].minor.yy0;
107832 }
107833 #line 2247 "parse.c"
107834 break;
107835 case 38: /* id ::= ID */
107836 case 39: /* id ::= INDEXED */ yytestcase(yyruleno==39);
107837 case 40: /* ids ::= ID|STRING */ yytestcase(yyruleno==40);
107838 case 41: /* nm ::= id */ yytestcase(yyruleno==41);
@@ -107852,373 +107737,256 @@
107852 case 264: /* nmnum ::= DEFAULT */ yytestcase(yyruleno==264);
107853 case 265: /* plus_num ::= plus_opt number */ yytestcase(yyruleno==265);
107854 case 266: /* minus_num ::= MINUS number */ yytestcase(yyruleno==266);
107855 case 267: /* number ::= INTEGER|FLOAT */ yytestcase(yyruleno==267);
107856 case 285: /* trnm ::= nm */ yytestcase(yyruleno==285);
107857 #line 189 "parse.y"
107858 {yygotominor.yy0 = yymsp[0].minor.yy0;}
107859 #line 2273 "parse.c"
107860 break;
107861 case 45: /* type ::= typetoken */
107862 #line 251 "parse.y"
107863 {sqlite3AddColumnType(pParse,&yymsp[0].minor.yy0);}
107864 #line 2278 "parse.c"
107865 break;
107866 case 47: /* typetoken ::= typename LP signed RP */
107867 #line 253 "parse.y"
107868 {
107869 yygotominor.yy0.z = yymsp[-3].minor.yy0.z;
107870 yygotominor.yy0.n = (int)(&yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n] - yymsp[-3].minor.yy0.z);
107871 }
107872 #line 2286 "parse.c"
107873 break;
107874 case 48: /* typetoken ::= typename LP signed COMMA signed RP */
107875 #line 257 "parse.y"
107876 {
107877 yygotominor.yy0.z = yymsp[-5].minor.yy0.z;
107878 yygotominor.yy0.n = (int)(&yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n] - yymsp[-5].minor.yy0.z);
107879 }
107880 #line 2294 "parse.c"
107881 break;
107882 case 50: /* typename ::= typename ids */
107883 #line 263 "parse.y"
107884 {yygotominor.yy0.z=yymsp[-1].minor.yy0.z; yygotominor.yy0.n=yymsp[0].minor.yy0.n+(int)(yymsp[0].minor.yy0.z-yymsp[-1].minor.yy0.z);}
107885 #line 2299 "parse.c"
107886 break;
107887 case 57: /* ccons ::= DEFAULT term */
107888 case 59: /* ccons ::= DEFAULT PLUS term */ yytestcase(yyruleno==59);
107889 #line 274 "parse.y"
107890 {sqlite3AddDefaultValue(pParse,&yymsp[0].minor.yy118);}
107891 #line 2305 "parse.c"
107892 break;
107893 case 58: /* ccons ::= DEFAULT LP expr RP */
107894 #line 275 "parse.y"
107895 {sqlite3AddDefaultValue(pParse,&yymsp[-1].minor.yy118);}
107896 #line 2310 "parse.c"
107897 break;
107898 case 60: /* ccons ::= DEFAULT MINUS term */
107899 #line 277 "parse.y"
107900 {
107901 ExprSpan v;
107902 v.pExpr = sqlite3PExpr(pParse, TK_UMINUS, yymsp[0].minor.yy118.pExpr, 0, 0);
107903 v.zStart = yymsp[-1].minor.yy0.z;
107904 v.zEnd = yymsp[0].minor.yy118.zEnd;
107905 sqlite3AddDefaultValue(pParse,&v);
107906 }
107907 #line 2321 "parse.c"
107908 break;
107909 case 61: /* ccons ::= DEFAULT id */
107910 #line 284 "parse.y"
107911 {
107912 ExprSpan v;
107913 spanExpr(&v, pParse, TK_STRING, &yymsp[0].minor.yy0);
107914 sqlite3AddDefaultValue(pParse,&v);
107915 }
107916 #line 2330 "parse.c"
107917 break;
107918 case 63: /* ccons ::= NOT NULL onconf */
107919 #line 294 "parse.y"
107920 {sqlite3AddNotNull(pParse, yymsp[0].minor.yy4);}
107921 #line 2335 "parse.c"
107922 break;
107923 case 64: /* ccons ::= PRIMARY KEY sortorder onconf autoinc */
107924 #line 296 "parse.y"
107925 {sqlite3AddPrimaryKey(pParse,0,yymsp[-1].minor.yy4,yymsp[0].minor.yy4,yymsp[-2].minor.yy4);}
107926 #line 2340 "parse.c"
107927 break;
107928 case 65: /* ccons ::= UNIQUE onconf */
107929 #line 297 "parse.y"
107930 {sqlite3CreateIndex(pParse,0,0,0,0,yymsp[0].minor.yy4,0,0,0,0);}
107931 #line 2345 "parse.c"
107932 break;
107933 case 66: /* ccons ::= CHECK LP expr RP */
107934 #line 298 "parse.y"
107935 {sqlite3AddCheckConstraint(pParse,yymsp[-1].minor.yy118.pExpr);}
107936 #line 2350 "parse.c"
107937 break;
107938 case 67: /* ccons ::= REFERENCES nm idxlist_opt refargs */
107939 #line 300 "parse.y"
107940 {sqlite3CreateForeignKey(pParse,0,&yymsp[-2].minor.yy0,yymsp[-1].minor.yy322,yymsp[0].minor.yy4);}
107941 #line 2355 "parse.c"
107942 break;
107943 case 68: /* ccons ::= defer_subclause */
107944 #line 301 "parse.y"
107945 {sqlite3DeferForeignKey(pParse,yymsp[0].minor.yy4);}
107946 #line 2360 "parse.c"
107947 break;
107948 case 69: /* ccons ::= COLLATE ids */
107949 #line 302 "parse.y"
107950 {sqlite3AddCollateType(pParse, &yymsp[0].minor.yy0);}
107951 #line 2365 "parse.c"
107952 break;
107953 case 72: /* refargs ::= */
107954 #line 315 "parse.y"
107955 { yygotominor.yy4 = OE_None*0x0101; /* EV: R-19803-45884 */}
107956 #line 2370 "parse.c"
107957 break;
107958 case 73: /* refargs ::= refargs refarg */
107959 #line 316 "parse.y"
107960 { yygotominor.yy4 = (yymsp[-1].minor.yy4 & ~yymsp[0].minor.yy215.mask) | yymsp[0].minor.yy215.value; }
107961 #line 2375 "parse.c"
107962 break;
107963 case 74: /* refarg ::= MATCH nm */
107964 case 75: /* refarg ::= ON INSERT refact */ yytestcase(yyruleno==75);
107965 #line 318 "parse.y"
107966 { yygotominor.yy215.value = 0; yygotominor.yy215.mask = 0x000000; }
107967 #line 2381 "parse.c"
107968 break;
107969 case 76: /* refarg ::= ON DELETE refact */
107970 #line 320 "parse.y"
107971 { yygotominor.yy215.value = yymsp[0].minor.yy4; yygotominor.yy215.mask = 0x0000ff; }
107972 #line 2386 "parse.c"
107973 break;
107974 case 77: /* refarg ::= ON UPDATE refact */
107975 #line 321 "parse.y"
107976 { yygotominor.yy215.value = yymsp[0].minor.yy4<<8; yygotominor.yy215.mask = 0x00ff00; }
107977 #line 2391 "parse.c"
107978 break;
107979 case 78: /* refact ::= SET NULL */
107980 #line 323 "parse.y"
107981 { yygotominor.yy4 = OE_SetNull; /* EV: R-33326-45252 */}
107982 #line 2396 "parse.c"
107983 break;
107984 case 79: /* refact ::= SET DEFAULT */
107985 #line 324 "parse.y"
107986 { yygotominor.yy4 = OE_SetDflt; /* EV: R-33326-45252 */}
107987 #line 2401 "parse.c"
107988 break;
107989 case 80: /* refact ::= CASCADE */
107990 #line 325 "parse.y"
107991 { yygotominor.yy4 = OE_Cascade; /* EV: R-33326-45252 */}
107992 #line 2406 "parse.c"
107993 break;
107994 case 81: /* refact ::= RESTRICT */
107995 #line 326 "parse.y"
107996 { yygotominor.yy4 = OE_Restrict; /* EV: R-33326-45252 */}
107997 #line 2411 "parse.c"
107998 break;
107999 case 82: /* refact ::= NO ACTION */
108000 #line 327 "parse.y"
108001 { yygotominor.yy4 = OE_None; /* EV: R-33326-45252 */}
108002 #line 2416 "parse.c"
108003 break;
108004 case 84: /* defer_subclause ::= DEFERRABLE init_deferred_pred_opt */
108005 case 99: /* defer_subclause_opt ::= defer_subclause */ yytestcase(yyruleno==99);
108006 case 101: /* onconf ::= ON CONFLICT resolvetype */ yytestcase(yyruleno==101);
108007 case 104: /* resolvetype ::= raisetype */ yytestcase(yyruleno==104);
108008 #line 330 "parse.y"
108009 {yygotominor.yy4 = yymsp[0].minor.yy4;}
108010 #line 2424 "parse.c"
108011 break;
108012 case 88: /* conslist_opt ::= */
108013 #line 339 "parse.y"
108014 {yygotominor.yy0.n = 0; yygotominor.yy0.z = 0;}
108015 #line 2429 "parse.c"
108016 break;
108017 case 89: /* conslist_opt ::= COMMA conslist */
108018 #line 340 "parse.y"
108019 {yygotominor.yy0 = yymsp[-1].minor.yy0;}
108020 #line 2434 "parse.c"
108021 break;
108022 case 94: /* tcons ::= PRIMARY KEY LP idxlist autoinc RP onconf */
108023 #line 346 "parse.y"
108024 {sqlite3AddPrimaryKey(pParse,yymsp[-3].minor.yy322,yymsp[0].minor.yy4,yymsp[-2].minor.yy4,0);}
108025 #line 2439 "parse.c"
108026 break;
108027 case 95: /* tcons ::= UNIQUE LP idxlist RP onconf */
108028 #line 348 "parse.y"
108029 {sqlite3CreateIndex(pParse,0,0,0,yymsp[-2].minor.yy322,yymsp[0].minor.yy4,0,0,0,0);}
108030 #line 2444 "parse.c"
108031 break;
108032 case 96: /* tcons ::= CHECK LP expr RP onconf */
108033 #line 350 "parse.y"
108034 {sqlite3AddCheckConstraint(pParse,yymsp[-2].minor.yy118.pExpr);}
108035 #line 2449 "parse.c"
108036 break;
108037 case 97: /* tcons ::= FOREIGN KEY LP idxlist RP REFERENCES nm idxlist_opt refargs defer_subclause_opt */
108038 #line 352 "parse.y"
108039 {
108040 sqlite3CreateForeignKey(pParse, yymsp[-6].minor.yy322, &yymsp[-3].minor.yy0, yymsp[-2].minor.yy322, yymsp[-1].minor.yy4);
108041 sqlite3DeferForeignKey(pParse, yymsp[0].minor.yy4);
108042 }
108043 #line 2457 "parse.c"
108044 break;
108045 case 100: /* onconf ::= */
108046 #line 366 "parse.y"
108047 {yygotominor.yy4 = OE_Default;}
108048 #line 2462 "parse.c"
108049 break;
108050 case 102: /* orconf ::= */
108051 #line 368 "parse.y"
108052 {yygotominor.yy210 = OE_Default;}
108053 #line 2467 "parse.c"
108054 break;
108055 case 103: /* orconf ::= OR resolvetype */
108056 #line 369 "parse.y"
108057 {yygotominor.yy210 = (u8)yymsp[0].minor.yy4;}
108058 #line 2472 "parse.c"
108059 break;
108060 case 105: /* resolvetype ::= IGNORE */
108061 #line 371 "parse.y"
108062 {yygotominor.yy4 = OE_Ignore;}
108063 #line 2477 "parse.c"
108064 break;
108065 case 106: /* resolvetype ::= REPLACE */
108066 #line 372 "parse.y"
108067 {yygotominor.yy4 = OE_Replace;}
108068 #line 2482 "parse.c"
108069 break;
108070 case 107: /* cmd ::= DROP TABLE ifexists fullname */
108071 #line 376 "parse.y"
108072 {
108073 sqlite3DropTable(pParse, yymsp[0].minor.yy259, 0, yymsp[-1].minor.yy4);
108074 }
108075 #line 2489 "parse.c"
108076 break;
108077 case 110: /* cmd ::= createkw temp VIEW ifnotexists nm dbnm AS select */
108078 #line 386 "parse.y"
108079 {
108080 sqlite3CreateView(pParse, &yymsp[-7].minor.yy0, &yymsp[-3].minor.yy0, &yymsp[-2].minor.yy0, yymsp[0].minor.yy387, yymsp[-6].minor.yy4, yymsp[-4].minor.yy4);
108081 }
108082 #line 2496 "parse.c"
108083 break;
108084 case 111: /* cmd ::= DROP VIEW ifexists fullname */
108085 #line 389 "parse.y"
108086 {
108087 sqlite3DropTable(pParse, yymsp[0].minor.yy259, 1, yymsp[-1].minor.yy4);
108088 }
108089 #line 2503 "parse.c"
108090 break;
108091 case 112: /* cmd ::= select */
108092 #line 396 "parse.y"
108093 {
108094 SelectDest dest = {SRT_Output, 0, 0, 0, 0};
108095 sqlite3Select(pParse, yymsp[0].minor.yy387, &dest);
108096 sqlite3SelectDelete(pParse->db, yymsp[0].minor.yy387);
108097 }
108098 #line 2512 "parse.c"
108099 break;
108100 case 113: /* select ::= oneselect */
108101 #line 407 "parse.y"
108102 {yygotominor.yy387 = yymsp[0].minor.yy387;}
108103 #line 2517 "parse.c"
108104 break;
108105 case 114: /* select ::= select multiselect_op oneselect */
108106 #line 409 "parse.y"
108107 {
108108 if( yymsp[0].minor.yy387 ){
108109 yymsp[0].minor.yy387->op = (u8)yymsp[-1].minor.yy4;
108110 yymsp[0].minor.yy387->pPrior = yymsp[-2].minor.yy387;
108111 }else{
108112 sqlite3SelectDelete(pParse->db, yymsp[-2].minor.yy387);
108113 }
108114 yygotominor.yy387 = yymsp[0].minor.yy387;
108115 }
108116 #line 2530 "parse.c"
108117 break;
108118 case 116: /* multiselect_op ::= UNION ALL */
108119 #line 420 "parse.y"
108120 {yygotominor.yy4 = TK_ALL;}
108121 #line 2535 "parse.c"
108122 break;
108123 case 118: /* oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt orderby_opt limit_opt */
108124 #line 424 "parse.y"
108125 {
108126 yygotominor.yy387 = sqlite3SelectNew(pParse,yymsp[-6].minor.yy322,yymsp[-5].minor.yy259,yymsp[-4].minor.yy314,yymsp[-3].minor.yy322,yymsp[-2].minor.yy314,yymsp[-1].minor.yy322,yymsp[-7].minor.yy4,yymsp[0].minor.yy292.pLimit,yymsp[0].minor.yy292.pOffset);
108127 }
108128 #line 2542 "parse.c"
108129 break;
108130 case 122: /* sclp ::= selcollist COMMA */
108131 case 247: /* idxlist_opt ::= LP idxlist RP */ yytestcase(yyruleno==247);
108132 #line 445 "parse.y"
108133 {yygotominor.yy322 = yymsp[-1].minor.yy322;}
108134 #line 2548 "parse.c"
108135 break;
108136 case 123: /* sclp ::= */
108137 case 151: /* orderby_opt ::= */ yytestcase(yyruleno==151);
108138 case 159: /* groupby_opt ::= */ yytestcase(yyruleno==159);
108139 case 240: /* exprlist ::= */ yytestcase(yyruleno==240);
108140 case 246: /* idxlist_opt ::= */ yytestcase(yyruleno==246);
108141 #line 446 "parse.y"
108142 {yygotominor.yy322 = 0;}
108143 #line 2557 "parse.c"
108144 break;
108145 case 124: /* selcollist ::= sclp expr as */
108146 #line 447 "parse.y"
108147 {
108148 yygotominor.yy322 = sqlite3ExprListAppend(pParse, yymsp[-2].minor.yy322, yymsp[-1].minor.yy118.pExpr);
108149 if( yymsp[0].minor.yy0.n>0 ) sqlite3ExprListSetName(pParse, yygotominor.yy322, &yymsp[0].minor.yy0, 1);
108150 sqlite3ExprListSetSpan(pParse,yygotominor.yy322,&yymsp[-1].minor.yy118);
108151 }
108152 #line 2566 "parse.c"
108153 break;
108154 case 125: /* selcollist ::= sclp STAR */
108155 #line 452 "parse.y"
108156 {
108157 Expr *p = sqlite3Expr(pParse->db, TK_ALL, 0);
108158 yygotominor.yy322 = sqlite3ExprListAppend(pParse, yymsp[-1].minor.yy322, p);
108159 }
108160 #line 2574 "parse.c"
108161 break;
108162 case 126: /* selcollist ::= sclp nm DOT STAR */
108163 #line 456 "parse.y"
108164 {
108165 Expr *pRight = sqlite3PExpr(pParse, TK_ALL, 0, 0, &yymsp[0].minor.yy0);
108166 Expr *pLeft = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-2].minor.yy0);
108167 Expr *pDot = sqlite3PExpr(pParse, TK_DOT, pLeft, pRight, 0);
108168 yygotominor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-3].minor.yy322, pDot);
108169 }
108170 #line 2584 "parse.c"
108171 break;
108172 case 129: /* as ::= */
108173 #line 469 "parse.y"
108174 {yygotominor.yy0.n = 0;}
108175 #line 2589 "parse.c"
108176 break;
108177 case 130: /* from ::= */
108178 #line 481 "parse.y"
108179 {yygotominor.yy259 = sqlite3DbMallocZero(pParse->db, sizeof(*yygotominor.yy259));}
108180 #line 2594 "parse.c"
108181 break;
108182 case 131: /* from ::= FROM seltablist */
108183 #line 482 "parse.y"
108184 {
108185 yygotominor.yy259 = yymsp[0].minor.yy259;
108186 sqlite3SrcListShiftJoinType(yygotominor.yy259);
108187 }
108188 #line 2602 "parse.c"
108189 break;
108190 case 132: /* stl_prefix ::= seltablist joinop */
108191 #line 490 "parse.y"
108192 {
108193 yygotominor.yy259 = yymsp[-1].minor.yy259;
108194 if( ALWAYS(yygotominor.yy259 && yygotominor.yy259->nSrc>0) ) yygotominor.yy259->a[yygotominor.yy259->nSrc-1].jointype = (u8)yymsp[0].minor.yy4;
108195 }
108196 #line 2610 "parse.c"
108197 break;
108198 case 133: /* stl_prefix ::= */
108199 #line 494 "parse.y"
108200 {yygotominor.yy259 = 0;}
108201 #line 2615 "parse.c"
108202 break;
108203 case 134: /* seltablist ::= stl_prefix nm dbnm as indexed_opt on_opt using_opt */
108204 #line 495 "parse.y"
108205 {
108206 yygotominor.yy259 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy259,&yymsp[-5].minor.yy0,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,0,yymsp[-1].minor.yy314,yymsp[0].minor.yy384);
108207 sqlite3SrcListIndexedBy(pParse, yygotominor.yy259, &yymsp[-2].minor.yy0);
108208 }
108209 #line 2623 "parse.c"
108210 break;
108211 case 135: /* seltablist ::= stl_prefix LP select RP as on_opt using_opt */
108212 #line 501 "parse.y"
108213 {
108214 yygotominor.yy259 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy259,0,0,&yymsp[-2].minor.yy0,yymsp[-4].minor.yy387,yymsp[-1].minor.yy314,yymsp[0].minor.yy384);
108215 }
108216 #line 2630 "parse.c"
108217 break;
108218 case 136: /* seltablist ::= stl_prefix LP seltablist RP as on_opt using_opt */
108219 #line 505 "parse.y"
108220 {
108221 if( yymsp[-6].minor.yy259==0 && yymsp[-2].minor.yy0.n==0 && yymsp[-1].minor.yy314==0 && yymsp[0].minor.yy384==0 ){
108222 yygotominor.yy259 = yymsp[-4].minor.yy259;
108223 }else{
108224 Select *pSubquery;
@@ -108225,260 +107993,180 @@
108225 sqlite3SrcListShiftJoinType(yymsp[-4].minor.yy259);
108226 pSubquery = sqlite3SelectNew(pParse,0,yymsp[-4].minor.yy259,0,0,0,0,0,0,0);
108227 yygotominor.yy259 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy259,0,0,&yymsp[-2].minor.yy0,pSubquery,yymsp[-1].minor.yy314,yymsp[0].minor.yy384);
108228 }
108229 }
108230 #line 2644 "parse.c"
108231 break;
108232 case 137: /* dbnm ::= */
108233 case 146: /* indexed_opt ::= */ yytestcase(yyruleno==146);
108234 #line 530 "parse.y"
108235 {yygotominor.yy0.z=0; yygotominor.yy0.n=0;}
108236 #line 2650 "parse.c"
108237 break;
108238 case 139: /* fullname ::= nm dbnm */
108239 #line 535 "parse.y"
108240 {yygotominor.yy259 = sqlite3SrcListAppend(pParse->db,0,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0);}
108241 #line 2655 "parse.c"
108242 break;
108243 case 140: /* joinop ::= COMMA|JOIN */
108244 #line 539 "parse.y"
108245 { yygotominor.yy4 = JT_INNER; }
108246 #line 2660 "parse.c"
108247 break;
108248 case 141: /* joinop ::= JOIN_KW JOIN */
108249 #line 540 "parse.y"
108250 { yygotominor.yy4 = sqlite3JoinType(pParse,&yymsp[-1].minor.yy0,0,0); }
108251 #line 2665 "parse.c"
108252 break;
108253 case 142: /* joinop ::= JOIN_KW nm JOIN */
108254 #line 541 "parse.y"
108255 { yygotominor.yy4 = sqlite3JoinType(pParse,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0,0); }
108256 #line 2670 "parse.c"
108257 break;
108258 case 143: /* joinop ::= JOIN_KW nm nm JOIN */
108259 #line 543 "parse.y"
108260 { yygotominor.yy4 = sqlite3JoinType(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0); }
108261 #line 2675 "parse.c"
108262 break;
108263 case 144: /* on_opt ::= ON expr */
108264 case 155: /* sortitem ::= expr */ yytestcase(yyruleno==155);
108265 case 162: /* having_opt ::= HAVING expr */ yytestcase(yyruleno==162);
108266 case 169: /* where_opt ::= WHERE expr */ yytestcase(yyruleno==169);
108267 case 235: /* case_else ::= ELSE expr */ yytestcase(yyruleno==235);
108268 case 237: /* case_operand ::= expr */ yytestcase(yyruleno==237);
108269 #line 547 "parse.y"
108270 {yygotominor.yy314 = yymsp[0].minor.yy118.pExpr;}
108271 #line 2685 "parse.c"
108272 break;
108273 case 145: /* on_opt ::= */
108274 case 161: /* having_opt ::= */ yytestcase(yyruleno==161);
108275 case 168: /* where_opt ::= */ yytestcase(yyruleno==168);
108276 case 236: /* case_else ::= */ yytestcase(yyruleno==236);
108277 case 238: /* case_operand ::= */ yytestcase(yyruleno==238);
108278 #line 548 "parse.y"
108279 {yygotominor.yy314 = 0;}
108280 #line 2694 "parse.c"
108281 break;
108282 case 148: /* indexed_opt ::= NOT INDEXED */
108283 #line 563 "parse.y"
108284 {yygotominor.yy0.z=0; yygotominor.yy0.n=1;}
108285 #line 2699 "parse.c"
108286 break;
108287 case 149: /* using_opt ::= USING LP inscollist RP */
108288 case 181: /* inscollist_opt ::= LP inscollist RP */ yytestcase(yyruleno==181);
108289 #line 567 "parse.y"
108290 {yygotominor.yy384 = yymsp[-1].minor.yy384;}
108291 #line 2705 "parse.c"
108292 break;
108293 case 150: /* using_opt ::= */
108294 case 180: /* inscollist_opt ::= */ yytestcase(yyruleno==180);
108295 #line 568 "parse.y"
108296 {yygotominor.yy384 = 0;}
108297 #line 2711 "parse.c"
108298 break;
108299 case 152: /* orderby_opt ::= ORDER BY sortlist */
108300 case 160: /* groupby_opt ::= GROUP BY nexprlist */ yytestcase(yyruleno==160);
108301 case 239: /* exprlist ::= nexprlist */ yytestcase(yyruleno==239);
108302 #line 579 "parse.y"
108303 {yygotominor.yy322 = yymsp[0].minor.yy322;}
108304 #line 2718 "parse.c"
108305 break;
108306 case 153: /* sortlist ::= sortlist COMMA sortitem sortorder */
108307 #line 580 "parse.y"
108308 {
108309 yygotominor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-3].minor.yy322,yymsp[-1].minor.yy314);
108310 if( yygotominor.yy322 ) yygotominor.yy322->a[yygotominor.yy322->nExpr-1].sortOrder = (u8)yymsp[0].minor.yy4;
108311 }
108312 #line 2726 "parse.c"
108313 break;
108314 case 154: /* sortlist ::= sortitem sortorder */
108315 #line 584 "parse.y"
108316 {
108317 yygotominor.yy322 = sqlite3ExprListAppend(pParse,0,yymsp[-1].minor.yy314);
108318 if( yygotominor.yy322 && ALWAYS(yygotominor.yy322->a) ) yygotominor.yy322->a[0].sortOrder = (u8)yymsp[0].minor.yy4;
108319 }
108320 #line 2734 "parse.c"
108321 break;
108322 case 156: /* sortorder ::= ASC */
108323 case 158: /* sortorder ::= */ yytestcase(yyruleno==158);
108324 #line 592 "parse.y"
108325 {yygotominor.yy4 = SQLITE_SO_ASC;}
108326 #line 2740 "parse.c"
108327 break;
108328 case 157: /* sortorder ::= DESC */
108329 #line 593 "parse.y"
108330 {yygotominor.yy4 = SQLITE_SO_DESC;}
108331 #line 2745 "parse.c"
108332 break;
108333 case 163: /* limit_opt ::= */
108334 #line 619 "parse.y"
108335 {yygotominor.yy292.pLimit = 0; yygotominor.yy292.pOffset = 0;}
108336 #line 2750 "parse.c"
108337 break;
108338 case 164: /* limit_opt ::= LIMIT expr */
108339 #line 620 "parse.y"
108340 {yygotominor.yy292.pLimit = yymsp[0].minor.yy118.pExpr; yygotominor.yy292.pOffset = 0;}
108341 #line 2755 "parse.c"
108342 break;
108343 case 165: /* limit_opt ::= LIMIT expr OFFSET expr */
108344 #line 622 "parse.y"
108345 {yygotominor.yy292.pLimit = yymsp[-2].minor.yy118.pExpr; yygotominor.yy292.pOffset = yymsp[0].minor.yy118.pExpr;}
108346 #line 2760 "parse.c"
108347 break;
108348 case 166: /* limit_opt ::= LIMIT expr COMMA expr */
108349 #line 624 "parse.y"
108350 {yygotominor.yy292.pOffset = yymsp[-2].minor.yy118.pExpr; yygotominor.yy292.pLimit = yymsp[0].minor.yy118.pExpr;}
108351 #line 2765 "parse.c"
108352 break;
108353 case 167: /* cmd ::= DELETE FROM fullname indexed_opt where_opt */
108354 #line 637 "parse.y"
108355 {
108356 sqlite3SrcListIndexedBy(pParse, yymsp[-2].minor.yy259, &yymsp[-1].minor.yy0);
108357 sqlite3DeleteFrom(pParse,yymsp[-2].minor.yy259,yymsp[0].minor.yy314);
108358 }
108359 #line 2773 "parse.c"
108360 break;
108361 case 170: /* cmd ::= UPDATE orconf fullname indexed_opt SET setlist where_opt */
108362 #line 660 "parse.y"
108363 {
108364 sqlite3SrcListIndexedBy(pParse, yymsp[-4].minor.yy259, &yymsp[-3].minor.yy0);
108365 sqlite3ExprListCheckLength(pParse,yymsp[-1].minor.yy322,"set list");
108366 sqlite3Update(pParse,yymsp[-4].minor.yy259,yymsp[-1].minor.yy322,yymsp[0].minor.yy314,yymsp[-5].minor.yy210);
108367 }
108368 #line 2782 "parse.c"
108369 break;
108370 case 171: /* setlist ::= setlist COMMA nm EQ expr */
108371 #line 670 "parse.y"
108372 {
108373 yygotominor.yy322 = sqlite3ExprListAppend(pParse, yymsp[-4].minor.yy322, yymsp[0].minor.yy118.pExpr);
108374 sqlite3ExprListSetName(pParse, yygotominor.yy322, &yymsp[-2].minor.yy0, 1);
108375 }
108376 #line 2790 "parse.c"
108377 break;
108378 case 172: /* setlist ::= nm EQ expr */
108379 #line 674 "parse.y"
108380 {
108381 yygotominor.yy322 = sqlite3ExprListAppend(pParse, 0, yymsp[0].minor.yy118.pExpr);
108382 sqlite3ExprListSetName(pParse, yygotominor.yy322, &yymsp[-2].minor.yy0, 1);
108383 }
108384 #line 2798 "parse.c"
108385 break;
108386 case 173: /* cmd ::= insert_cmd INTO fullname inscollist_opt VALUES LP itemlist RP */
108387 #line 683 "parse.y"
108388 {sqlite3Insert(pParse, yymsp[-5].minor.yy259, yymsp[-1].minor.yy322, 0, yymsp[-4].minor.yy384, yymsp[-7].minor.yy210);}
108389 #line 2803 "parse.c"
108390 break;
108391 case 174: /* cmd ::= insert_cmd INTO fullname inscollist_opt select */
108392 #line 685 "parse.y"
108393 {sqlite3Insert(pParse, yymsp[-2].minor.yy259, 0, yymsp[0].minor.yy387, yymsp[-1].minor.yy384, yymsp[-4].minor.yy210);}
108394 #line 2808 "parse.c"
108395 break;
108396 case 175: /* cmd ::= insert_cmd INTO fullname inscollist_opt DEFAULT VALUES */
108397 #line 687 "parse.y"
108398 {sqlite3Insert(pParse, yymsp[-3].minor.yy259, 0, 0, yymsp[-2].minor.yy384, yymsp[-5].minor.yy210);}
108399 #line 2813 "parse.c"
108400 break;
108401 case 176: /* insert_cmd ::= INSERT orconf */
108402 #line 690 "parse.y"
108403 {yygotominor.yy210 = yymsp[0].minor.yy210;}
108404 #line 2818 "parse.c"
108405 break;
108406 case 177: /* insert_cmd ::= REPLACE */
108407 #line 691 "parse.y"
108408 {yygotominor.yy210 = OE_Replace;}
108409 #line 2823 "parse.c"
108410 break;
108411 case 178: /* itemlist ::= itemlist COMMA expr */
108412 case 241: /* nexprlist ::= nexprlist COMMA expr */ yytestcase(yyruleno==241);
108413 #line 698 "parse.y"
108414 {yygotominor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-2].minor.yy322,yymsp[0].minor.yy118.pExpr);}
108415 #line 2829 "parse.c"
108416 break;
108417 case 179: /* itemlist ::= expr */
108418 case 242: /* nexprlist ::= expr */ yytestcase(yyruleno==242);
108419 #line 700 "parse.y"
108420 {yygotominor.yy322 = sqlite3ExprListAppend(pParse,0,yymsp[0].minor.yy118.pExpr);}
108421 #line 2835 "parse.c"
108422 break;
108423 case 182: /* inscollist ::= inscollist COMMA nm */
108424 #line 710 "parse.y"
108425 {yygotominor.yy384 = sqlite3IdListAppend(pParse->db,yymsp[-2].minor.yy384,&yymsp[0].minor.yy0);}
108426 #line 2840 "parse.c"
108427 break;
108428 case 183: /* inscollist ::= nm */
108429 #line 712 "parse.y"
108430 {yygotominor.yy384 = sqlite3IdListAppend(pParse->db,0,&yymsp[0].minor.yy0);}
108431 #line 2845 "parse.c"
108432 break;
108433 case 184: /* expr ::= term */
108434 #line 743 "parse.y"
108435 {yygotominor.yy118 = yymsp[0].minor.yy118;}
108436 #line 2850 "parse.c"
108437 break;
108438 case 185: /* expr ::= LP expr RP */
108439 #line 744 "parse.y"
108440 {yygotominor.yy118.pExpr = yymsp[-1].minor.yy118.pExpr; spanSet(&yygotominor.yy118,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0);}
108441 #line 2855 "parse.c"
108442 break;
108443 case 186: /* term ::= NULL */
108444 case 191: /* term ::= INTEGER|FLOAT|BLOB */ yytestcase(yyruleno==191);
108445 case 192: /* term ::= STRING */ yytestcase(yyruleno==192);
108446 #line 745 "parse.y"
108447 {spanExpr(&yygotominor.yy118, pParse, yymsp[0].major, &yymsp[0].minor.yy0);}
108448 #line 2862 "parse.c"
108449 break;
108450 case 187: /* expr ::= id */
108451 case 188: /* expr ::= JOIN_KW */ yytestcase(yyruleno==188);
108452 #line 746 "parse.y"
108453 {spanExpr(&yygotominor.yy118, pParse, TK_ID, &yymsp[0].minor.yy0);}
108454 #line 2868 "parse.c"
108455 break;
108456 case 189: /* expr ::= nm DOT nm */
108457 #line 748 "parse.y"
108458 {
108459 Expr *temp1 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-2].minor.yy0);
108460 Expr *temp2 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[0].minor.yy0);
108461 yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_DOT, temp1, temp2, 0);
108462 spanSet(&yygotominor.yy118,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0);
108463 }
108464 #line 2878 "parse.c"
108465 break;
108466 case 190: /* expr ::= nm DOT nm DOT nm */
108467 #line 754 "parse.y"
108468 {
108469 Expr *temp1 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-4].minor.yy0);
108470 Expr *temp2 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-2].minor.yy0);
108471 Expr *temp3 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[0].minor.yy0);
108472 Expr *temp4 = sqlite3PExpr(pParse, TK_DOT, temp2, temp3, 0);
108473 yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_DOT, temp1, temp4, 0);
108474 spanSet(&yygotominor.yy118,&yymsp[-4].minor.yy0,&yymsp[0].minor.yy0);
108475 }
108476 #line 2890 "parse.c"
108477 break;
108478 case 193: /* expr ::= REGISTER */
108479 #line 764 "parse.y"
108480 {
108481 /* When doing a nested parse, one can include terms in an expression
108482 ** that look like this: #1 #2 ... These terms refer to registers
108483 ** in the virtual machine. #N is the N-th register. */
108484 if( pParse->nested==0 ){
@@ -108488,40 +108176,32 @@
108488 yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_REGISTER, 0, 0, &yymsp[0].minor.yy0);
108489 if( yygotominor.yy118.pExpr ) sqlite3GetInt32(&yymsp[0].minor.yy0.z[1], &yygotominor.yy118.pExpr->iTable);
108490 }
108491 spanSet(&yygotominor.yy118, &yymsp[0].minor.yy0, &yymsp[0].minor.yy0);
108492 }
108493 #line 2907 "parse.c"
108494 break;
108495 case 194: /* expr ::= VARIABLE */
108496 #line 777 "parse.y"
108497 {
108498 spanExpr(&yygotominor.yy118, pParse, TK_VARIABLE, &yymsp[0].minor.yy0);
108499 sqlite3ExprAssignVarNumber(pParse, yygotominor.yy118.pExpr);
108500 spanSet(&yygotominor.yy118, &yymsp[0].minor.yy0, &yymsp[0].minor.yy0);
108501 }
108502 #line 2916 "parse.c"
108503 break;
108504 case 195: /* expr ::= expr COLLATE ids */
108505 #line 782 "parse.y"
108506 {
108507 yygotominor.yy118.pExpr = sqlite3ExprSetCollByToken(pParse, yymsp[-2].minor.yy118.pExpr, &yymsp[0].minor.yy0);
108508 yygotominor.yy118.zStart = yymsp[-2].minor.yy118.zStart;
108509 yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
108510 }
108511 #line 2925 "parse.c"
108512 break;
108513 case 196: /* expr ::= CAST LP expr AS typetoken RP */
108514 #line 788 "parse.y"
108515 {
108516 yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_CAST, yymsp[-3].minor.yy118.pExpr, 0, &yymsp[-1].minor.yy0);
108517 spanSet(&yygotominor.yy118,&yymsp[-5].minor.yy0,&yymsp[0].minor.yy0);
108518 }
108519 #line 2933 "parse.c"
108520 break;
108521 case 197: /* expr ::= ID LP distinct exprlist RP */
108522 #line 793 "parse.y"
108523 {
108524 if( yymsp[-1].minor.yy322 && yymsp[-1].minor.yy322->nExpr>pParse->db->aLimit[SQLITE_LIMIT_FUNCTION_ARG] ){
108525 sqlite3ErrorMsg(pParse, "too many arguments on function %T", &yymsp[-4].minor.yy0);
108526 }
108527 yygotominor.yy118.pExpr = sqlite3ExprFunction(pParse, yymsp[-1].minor.yy322, &yymsp[-4].minor.yy0);
@@ -108528,59 +108208,47 @@
108528 spanSet(&yygotominor.yy118,&yymsp[-4].minor.yy0,&yymsp[0].minor.yy0);
108529 if( yymsp[-2].minor.yy4 && yygotominor.yy118.pExpr ){
108530 yygotominor.yy118.pExpr->flags |= EP_Distinct;
108531 }
108532 }
108533 #line 2947 "parse.c"
108534 break;
108535 case 198: /* expr ::= ID LP STAR RP */
108536 #line 803 "parse.y"
108537 {
108538 yygotominor.yy118.pExpr = sqlite3ExprFunction(pParse, 0, &yymsp[-3].minor.yy0);
108539 spanSet(&yygotominor.yy118,&yymsp[-3].minor.yy0,&yymsp[0].minor.yy0);
108540 }
108541 #line 2955 "parse.c"
108542 break;
108543 case 199: /* term ::= CTIME_KW */
108544 #line 807 "parse.y"
108545 {
108546 /* The CURRENT_TIME, CURRENT_DATE, and CURRENT_TIMESTAMP values are
108547 ** treated as functions that return constants */
108548 yygotominor.yy118.pExpr = sqlite3ExprFunction(pParse, 0,&yymsp[0].minor.yy0);
108549 if( yygotominor.yy118.pExpr ){
108550 yygotominor.yy118.pExpr->op = TK_CONST_FUNC;
108551 }
108552 spanSet(&yygotominor.yy118, &yymsp[0].minor.yy0, &yymsp[0].minor.yy0);
108553 }
108554 #line 2968 "parse.c"
108555 break;
108556 case 200: /* expr ::= expr AND expr */
108557 case 201: /* expr ::= expr OR expr */ yytestcase(yyruleno==201);
108558 case 202: /* expr ::= expr LT|GT|GE|LE expr */ yytestcase(yyruleno==202);
108559 case 203: /* expr ::= expr EQ|NE expr */ yytestcase(yyruleno==203);
108560 case 204: /* expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr */ yytestcase(yyruleno==204);
108561 case 205: /* expr ::= expr PLUS|MINUS expr */ yytestcase(yyruleno==205);
108562 case 206: /* expr ::= expr STAR|SLASH|REM expr */ yytestcase(yyruleno==206);
108563 case 207: /* expr ::= expr CONCAT expr */ yytestcase(yyruleno==207);
108564 #line 834 "parse.y"
108565 {spanBinaryExpr(&yygotominor.yy118,pParse,yymsp[-1].major,&yymsp[-2].minor.yy118,&yymsp[0].minor.yy118);}
108566 #line 2980 "parse.c"
108567 break;
108568 case 208: /* likeop ::= LIKE_KW */
108569 case 210: /* likeop ::= MATCH */ yytestcase(yyruleno==210);
108570 #line 847 "parse.y"
108571 {yygotominor.yy342.eOperator = yymsp[0].minor.yy0; yygotominor.yy342.not = 0;}
108572 #line 2986 "parse.c"
108573 break;
108574 case 209: /* likeop ::= NOT LIKE_KW */
108575 case 211: /* likeop ::= NOT MATCH */ yytestcase(yyruleno==211);
108576 #line 848 "parse.y"
108577 {yygotominor.yy342.eOperator = yymsp[0].minor.yy0; yygotominor.yy342.not = 1;}
108578 #line 2992 "parse.c"
108579 break;
108580 case 212: /* expr ::= expr likeop expr */
108581 #line 851 "parse.y"
108582 {
108583 ExprList *pList;
108584 pList = sqlite3ExprListAppend(pParse,0, yymsp[0].minor.yy118.pExpr);
108585 pList = sqlite3ExprListAppend(pParse,pList, yymsp[-2].minor.yy118.pExpr);
108586 yygotominor.yy118.pExpr = sqlite3ExprFunction(pParse, pList, &yymsp[-1].minor.yy342.eOperator);
@@ -108587,14 +108255,12 @@
108587 if( yymsp[-1].minor.yy342.not ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0);
108588 yygotominor.yy118.zStart = yymsp[-2].minor.yy118.zStart;
108589 yygotominor.yy118.zEnd = yymsp[0].minor.yy118.zEnd;
108590 if( yygotominor.yy118.pExpr ) yygotominor.yy118.pExpr->flags |= EP_InfixFunc;
108591 }
108592 #line 3006 "parse.c"
108593 break;
108594 case 213: /* expr ::= expr likeop expr ESCAPE expr */
108595 #line 861 "parse.y"
108596 {
108597 ExprList *pList;
108598 pList = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy118.pExpr);
108599 pList = sqlite3ExprListAppend(pParse,pList, yymsp[-4].minor.yy118.pExpr);
108600 pList = sqlite3ExprListAppend(pParse,pList, yymsp[0].minor.yy118.pExpr);
@@ -108602,56 +108268,40 @@
108602 if( yymsp[-3].minor.yy342.not ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0);
108603 yygotominor.yy118.zStart = yymsp[-4].minor.yy118.zStart;
108604 yygotominor.yy118.zEnd = yymsp[0].minor.yy118.zEnd;
108605 if( yygotominor.yy118.pExpr ) yygotominor.yy118.pExpr->flags |= EP_InfixFunc;
108606 }
108607 #line 3021 "parse.c"
108608 break;
108609 case 214: /* expr ::= expr ISNULL|NOTNULL */
108610 #line 889 "parse.y"
108611 {spanUnaryPostfix(&yygotominor.yy118,pParse,yymsp[0].major,&yymsp[-1].minor.yy118,&yymsp[0].minor.yy0);}
108612 #line 3026 "parse.c"
108613 break;
108614 case 215: /* expr ::= expr NOT NULL */
108615 #line 890 "parse.y"
108616 {spanUnaryPostfix(&yygotominor.yy118,pParse,TK_NOTNULL,&yymsp[-2].minor.yy118,&yymsp[0].minor.yy0);}
108617 #line 3031 "parse.c"
108618 break;
108619 case 216: /* expr ::= expr IS expr */
108620 #line 911 "parse.y"
108621 {
108622 spanBinaryExpr(&yygotominor.yy118,pParse,TK_IS,&yymsp[-2].minor.yy118,&yymsp[0].minor.yy118);
108623 binaryToUnaryIfNull(pParse, yymsp[0].minor.yy118.pExpr, yygotominor.yy118.pExpr, TK_ISNULL);
108624 }
108625 #line 3039 "parse.c"
108626 break;
108627 case 217: /* expr ::= expr IS NOT expr */
108628 #line 915 "parse.y"
108629 {
108630 spanBinaryExpr(&yygotominor.yy118,pParse,TK_ISNOT,&yymsp[-3].minor.yy118,&yymsp[0].minor.yy118);
108631 binaryToUnaryIfNull(pParse, yymsp[0].minor.yy118.pExpr, yygotominor.yy118.pExpr, TK_NOTNULL);
108632 }
108633 #line 3047 "parse.c"
108634 break;
108635 case 218: /* expr ::= NOT expr */
108636 case 219: /* expr ::= BITNOT expr */ yytestcase(yyruleno==219);
108637 #line 938 "parse.y"
108638 {spanUnaryPrefix(&yygotominor.yy118,pParse,yymsp[-1].major,&yymsp[0].minor.yy118,&yymsp[-1].minor.yy0);}
108639 #line 3053 "parse.c"
108640 break;
108641 case 220: /* expr ::= MINUS expr */
108642 #line 941 "parse.y"
108643 {spanUnaryPrefix(&yygotominor.yy118,pParse,TK_UMINUS,&yymsp[0].minor.yy118,&yymsp[-1].minor.yy0);}
108644 #line 3058 "parse.c"
108645 break;
108646 case 221: /* expr ::= PLUS expr */
108647 #line 943 "parse.y"
108648 {spanUnaryPrefix(&yygotominor.yy118,pParse,TK_UPLUS,&yymsp[0].minor.yy118,&yymsp[-1].minor.yy0);}
108649 #line 3063 "parse.c"
108650 break;
108651 case 224: /* expr ::= expr between_op expr AND expr */
108652 #line 948 "parse.y"
108653 {
108654 ExprList *pList = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy118.pExpr);
108655 pList = sqlite3ExprListAppend(pParse,pList, yymsp[0].minor.yy118.pExpr);
108656 yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_BETWEEN, yymsp[-4].minor.yy118.pExpr, 0, 0);
108657 if( yygotominor.yy118.pExpr ){
@@ -108661,14 +108311,12 @@
108661 }
108662 if( yymsp[-3].minor.yy4 ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0);
108663 yygotominor.yy118.zStart = yymsp[-4].minor.yy118.zStart;
108664 yygotominor.yy118.zEnd = yymsp[0].minor.yy118.zEnd;
108665 }
108666 #line 3080 "parse.c"
108667 break;
108668 case 227: /* expr ::= expr in_op LP exprlist RP */
108669 #line 965 "parse.y"
108670 {
108671 if( yymsp[-1].minor.yy322==0 ){
108672 /* Expressions of the form
108673 **
108674 ** expr1 IN ()
@@ -108690,14 +108338,12 @@
108690 if( yymsp[-3].minor.yy4 ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0);
108691 }
108692 yygotominor.yy118.zStart = yymsp[-4].minor.yy118.zStart;
108693 yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
108694 }
108695 #line 3109 "parse.c"
108696 break;
108697 case 228: /* expr ::= LP select RP */
108698 #line 990 "parse.y"
108699 {
108700 yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_SELECT, 0, 0, 0);
108701 if( yygotominor.yy118.pExpr ){
108702 yygotominor.yy118.pExpr->x.pSelect = yymsp[-1].minor.yy387;
108703 ExprSetProperty(yygotominor.yy118.pExpr, EP_xIsSelect);
@@ -108706,14 +108352,12 @@
108706 sqlite3SelectDelete(pParse->db, yymsp[-1].minor.yy387);
108707 }
108708 yygotominor.yy118.zStart = yymsp[-2].minor.yy0.z;
108709 yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
108710 }
108711 #line 3125 "parse.c"
108712 break;
108713 case 229: /* expr ::= expr in_op LP select RP */
108714 #line 1002 "parse.y"
108715 {
108716 yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy118.pExpr, 0, 0);
108717 if( yygotominor.yy118.pExpr ){
108718 yygotominor.yy118.pExpr->x.pSelect = yymsp[-1].minor.yy387;
108719 ExprSetProperty(yygotominor.yy118.pExpr, EP_xIsSelect);
@@ -108723,14 +108367,12 @@
108723 }
108724 if( yymsp[-3].minor.yy4 ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0);
108725 yygotominor.yy118.zStart = yymsp[-4].minor.yy118.zStart;
108726 yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
108727 }
108728 #line 3142 "parse.c"
108729 break;
108730 case 230: /* expr ::= expr in_op nm dbnm */
108731 #line 1015 "parse.y"
108732 {
108733 SrcList *pSrc = sqlite3SrcListAppend(pParse->db, 0,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0);
108734 yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_IN, yymsp[-3].minor.yy118.pExpr, 0, 0);
108735 if( yygotominor.yy118.pExpr ){
108736 yygotominor.yy118.pExpr->x.pSelect = sqlite3SelectNew(pParse, 0,pSrc,0,0,0,0,0,0,0);
@@ -108741,14 +108383,12 @@
108741 }
108742 if( yymsp[-2].minor.yy4 ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0);
108743 yygotominor.yy118.zStart = yymsp[-3].minor.yy118.zStart;
108744 yygotominor.yy118.zEnd = yymsp[0].minor.yy0.z ? &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n] : &yymsp[-1].minor.yy0.z[yymsp[-1].minor.yy0.n];
108745 }
108746 #line 3160 "parse.c"
108747 break;
108748 case 231: /* expr ::= EXISTS LP select RP */
108749 #line 1029 "parse.y"
108750 {
108751 Expr *p = yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_EXISTS, 0, 0, 0);
108752 if( p ){
108753 p->x.pSelect = yymsp[-1].minor.yy387;
108754 ExprSetProperty(p, EP_xIsSelect);
@@ -108757,14 +108397,12 @@
108757 sqlite3SelectDelete(pParse->db, yymsp[-1].minor.yy387);
108758 }
108759 yygotominor.yy118.zStart = yymsp[-3].minor.yy0.z;
108760 yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
108761 }
108762 #line 3176 "parse.c"
108763 break;
108764 case 232: /* expr ::= CASE case_operand case_exprlist case_else END */
108765 #line 1044 "parse.y"
108766 {
108767 yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_CASE, yymsp[-3].minor.yy314, yymsp[-1].minor.yy314, 0);
108768 if( yygotominor.yy118.pExpr ){
108769 yygotominor.yy118.pExpr->x.pList = yymsp[-2].minor.yy322;
108770 sqlite3ExprSetHeight(pParse, yygotominor.yy118.pExpr);
@@ -108772,50 +108410,38 @@
108772 sqlite3ExprListDelete(pParse->db, yymsp[-2].minor.yy322);
108773 }
108774 yygotominor.yy118.zStart = yymsp[-4].minor.yy0.z;
108775 yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
108776 }
108777 #line 3191 "parse.c"
108778 break;
108779 case 233: /* case_exprlist ::= case_exprlist WHEN expr THEN expr */
108780 #line 1057 "parse.y"
108781 {
108782 yygotominor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy322, yymsp[-2].minor.yy118.pExpr);
108783 yygotominor.yy322 = sqlite3ExprListAppend(pParse,yygotominor.yy322, yymsp[0].minor.yy118.pExpr);
108784 }
108785 #line 3199 "parse.c"
108786 break;
108787 case 234: /* case_exprlist ::= WHEN expr THEN expr */
108788 #line 1061 "parse.y"
108789 {
108790 yygotominor.yy322 = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy118.pExpr);
108791 yygotominor.yy322 = sqlite3ExprListAppend(pParse,yygotominor.yy322, yymsp[0].minor.yy118.pExpr);
108792 }
108793 #line 3207 "parse.c"
108794 break;
108795 case 243: /* cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP idxlist RP */
108796 #line 1090 "parse.y"
108797 {
108798 sqlite3CreateIndex(pParse, &yymsp[-6].minor.yy0, &yymsp[-5].minor.yy0,
108799 sqlite3SrcListAppend(pParse->db,0,&yymsp[-3].minor.yy0,0), yymsp[-1].minor.yy322, yymsp[-9].minor.yy4,
108800 &yymsp[-10].minor.yy0, &yymsp[0].minor.yy0, SQLITE_SO_ASC, yymsp[-7].minor.yy4);
108801 }
108802 #line 3216 "parse.c"
108803 break;
108804 case 244: /* uniqueflag ::= UNIQUE */
108805 case 298: /* raisetype ::= ABORT */ yytestcase(yyruleno==298);
108806 #line 1097 "parse.y"
108807 {yygotominor.yy4 = OE_Abort;}
108808 #line 3222 "parse.c"
108809 break;
108810 case 245: /* uniqueflag ::= */
108811 #line 1098 "parse.y"
108812 {yygotominor.yy4 = OE_None;}
108813 #line 3227 "parse.c"
108814 break;
108815 case 248: /* idxlist ::= idxlist COMMA nm collate sortorder */
108816 #line 1107 "parse.y"
108817 {
108818 Expr *p = 0;
108819 if( yymsp[-1].minor.yy0.n>0 ){
108820 p = sqlite3Expr(pParse->db, TK_COLUMN, 0);
108821 sqlite3ExprSetCollByToken(pParse, p, &yymsp[-1].minor.yy0);
@@ -108823,14 +108449,12 @@
108823 yygotominor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy322, p);
108824 sqlite3ExprListSetName(pParse,yygotominor.yy322,&yymsp[-2].minor.yy0,1);
108825 sqlite3ExprListCheckLength(pParse, yygotominor.yy322, "index");
108826 if( yygotominor.yy322 ) yygotominor.yy322->a[yygotominor.yy322->nExpr-1].sortOrder = (u8)yymsp[0].minor.yy4;
108827 }
108828 #line 3242 "parse.c"
108829 break;
108830 case 249: /* idxlist ::= nm collate sortorder */
108831 #line 1118 "parse.y"
108832 {
108833 Expr *p = 0;
108834 if( yymsp[-1].minor.yy0.n>0 ){
108835 p = sqlite3PExpr(pParse, TK_COLUMN, 0, 0, 0);
108836 sqlite3ExprSetCollByToken(pParse, p, &yymsp[-1].minor.yy0);
@@ -108838,307 +108462,214 @@
108838 yygotominor.yy322 = sqlite3ExprListAppend(pParse,0, p);
108839 sqlite3ExprListSetName(pParse, yygotominor.yy322, &yymsp[-2].minor.yy0, 1);
108840 sqlite3ExprListCheckLength(pParse, yygotominor.yy322, "index");
108841 if( yygotominor.yy322 ) yygotominor.yy322->a[yygotominor.yy322->nExpr-1].sortOrder = (u8)yymsp[0].minor.yy4;
108842 }
108843 #line 3257 "parse.c"
108844 break;
108845 case 250: /* collate ::= */
108846 #line 1131 "parse.y"
108847 {yygotominor.yy0.z = 0; yygotominor.yy0.n = 0;}
108848 #line 3262 "parse.c"
108849 break;
108850 case 252: /* cmd ::= DROP INDEX ifexists fullname */
108851 #line 1137 "parse.y"
108852 {sqlite3DropIndex(pParse, yymsp[0].minor.yy259, yymsp[-1].minor.yy4);}
108853 #line 3267 "parse.c"
108854 break;
108855 case 253: /* cmd ::= VACUUM */
108856 case 254: /* cmd ::= VACUUM nm */ yytestcase(yyruleno==254);
108857 #line 1143 "parse.y"
108858 {sqlite3Vacuum(pParse);}
108859 #line 3273 "parse.c"
108860 break;
108861 case 255: /* cmd ::= PRAGMA nm dbnm */
108862 #line 1151 "parse.y"
108863 {sqlite3Pragma(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,0,0);}
108864 #line 3278 "parse.c"
108865 break;
108866 case 256: /* cmd ::= PRAGMA nm dbnm EQ nmnum */
108867 #line 1152 "parse.y"
108868 {sqlite3Pragma(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0,0);}
108869 #line 3283 "parse.c"
108870 break;
108871 case 257: /* cmd ::= PRAGMA nm dbnm LP nmnum RP */
108872 #line 1153 "parse.y"
108873 {sqlite3Pragma(pParse,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,&yymsp[-1].minor.yy0,0);}
108874 #line 3288 "parse.c"
108875 break;
108876 case 258: /* cmd ::= PRAGMA nm dbnm EQ minus_num */
108877 #line 1155 "parse.y"
108878 {sqlite3Pragma(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0,1);}
108879 #line 3293 "parse.c"
108880 break;
108881 case 259: /* cmd ::= PRAGMA nm dbnm LP minus_num RP */
108882 #line 1157 "parse.y"
108883 {sqlite3Pragma(pParse,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,&yymsp[-1].minor.yy0,1);}
108884 #line 3298 "parse.c"
108885 break;
108886 case 270: /* cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END */
108887 #line 1175 "parse.y"
108888 {
108889 Token all;
108890 all.z = yymsp[-3].minor.yy0.z;
108891 all.n = (int)(yymsp[0].minor.yy0.z - yymsp[-3].minor.yy0.z) + yymsp[0].minor.yy0.n;
108892 sqlite3FinishTrigger(pParse, yymsp[-1].minor.yy203, &all);
108893 }
108894 #line 3308 "parse.c"
108895 break;
108896 case 271: /* trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause */
108897 #line 1184 "parse.y"
108898 {
108899 sqlite3BeginTrigger(pParse, &yymsp[-7].minor.yy0, &yymsp[-6].minor.yy0, yymsp[-5].minor.yy4, yymsp[-4].minor.yy90.a, yymsp[-4].minor.yy90.b, yymsp[-2].minor.yy259, yymsp[0].minor.yy314, yymsp[-10].minor.yy4, yymsp[-8].minor.yy4);
108900 yygotominor.yy0 = (yymsp[-6].minor.yy0.n==0?yymsp[-7].minor.yy0:yymsp[-6].minor.yy0);
108901 }
108902 #line 3316 "parse.c"
108903 break;
108904 case 272: /* trigger_time ::= BEFORE */
108905 case 275: /* trigger_time ::= */ yytestcase(yyruleno==275);
108906 #line 1190 "parse.y"
108907 { yygotominor.yy4 = TK_BEFORE; }
108908 #line 3322 "parse.c"
108909 break;
108910 case 273: /* trigger_time ::= AFTER */
108911 #line 1191 "parse.y"
108912 { yygotominor.yy4 = TK_AFTER; }
108913 #line 3327 "parse.c"
108914 break;
108915 case 274: /* trigger_time ::= INSTEAD OF */
108916 #line 1192 "parse.y"
108917 { yygotominor.yy4 = TK_INSTEAD;}
108918 #line 3332 "parse.c"
108919 break;
108920 case 276: /* trigger_event ::= DELETE|INSERT */
108921 case 277: /* trigger_event ::= UPDATE */ yytestcase(yyruleno==277);
108922 #line 1197 "parse.y"
108923 {yygotominor.yy90.a = yymsp[0].major; yygotominor.yy90.b = 0;}
108924 #line 3338 "parse.c"
108925 break;
108926 case 278: /* trigger_event ::= UPDATE OF inscollist */
108927 #line 1199 "parse.y"
108928 {yygotominor.yy90.a = TK_UPDATE; yygotominor.yy90.b = yymsp[0].minor.yy384;}
108929 #line 3343 "parse.c"
108930 break;
108931 case 281: /* when_clause ::= */
108932 case 303: /* key_opt ::= */ yytestcase(yyruleno==303);
108933 #line 1206 "parse.y"
108934 { yygotominor.yy314 = 0; }
108935 #line 3349 "parse.c"
108936 break;
108937 case 282: /* when_clause ::= WHEN expr */
108938 case 304: /* key_opt ::= KEY expr */ yytestcase(yyruleno==304);
108939 #line 1207 "parse.y"
108940 { yygotominor.yy314 = yymsp[0].minor.yy118.pExpr; }
108941 #line 3355 "parse.c"
108942 break;
108943 case 283: /* trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI */
108944 #line 1211 "parse.y"
108945 {
108946 assert( yymsp[-2].minor.yy203!=0 );
108947 yymsp[-2].minor.yy203->pLast->pNext = yymsp[-1].minor.yy203;
108948 yymsp[-2].minor.yy203->pLast = yymsp[-1].minor.yy203;
108949 yygotominor.yy203 = yymsp[-2].minor.yy203;
108950 }
108951 #line 3365 "parse.c"
108952 break;
108953 case 284: /* trigger_cmd_list ::= trigger_cmd SEMI */
108954 #line 1217 "parse.y"
108955 {
108956 assert( yymsp[-1].minor.yy203!=0 );
108957 yymsp[-1].minor.yy203->pLast = yymsp[-1].minor.yy203;
108958 yygotominor.yy203 = yymsp[-1].minor.yy203;
108959 }
108960 #line 3374 "parse.c"
108961 break;
108962 case 286: /* trnm ::= nm DOT nm */
108963 #line 1229 "parse.y"
108964 {
108965 yygotominor.yy0 = yymsp[0].minor.yy0;
108966 sqlite3ErrorMsg(pParse,
108967 "qualified table names are not allowed on INSERT, UPDATE, and DELETE "
108968 "statements within triggers");
108969 }
108970 #line 3384 "parse.c"
108971 break;
108972 case 288: /* tridxby ::= INDEXED BY nm */
108973 #line 1241 "parse.y"
108974 {
108975 sqlite3ErrorMsg(pParse,
108976 "the INDEXED BY clause is not allowed on UPDATE or DELETE statements "
108977 "within triggers");
108978 }
108979 #line 3393 "parse.c"
108980 break;
108981 case 289: /* tridxby ::= NOT INDEXED */
108982 #line 1246 "parse.y"
108983 {
108984 sqlite3ErrorMsg(pParse,
108985 "the NOT INDEXED clause is not allowed on UPDATE or DELETE statements "
108986 "within triggers");
108987 }
108988 #line 3402 "parse.c"
108989 break;
108990 case 290: /* trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist where_opt */
108991 #line 1259 "parse.y"
108992 { yygotominor.yy203 = sqlite3TriggerUpdateStep(pParse->db, &yymsp[-4].minor.yy0, yymsp[-1].minor.yy322, yymsp[0].minor.yy314, yymsp[-5].minor.yy210); }
108993 #line 3407 "parse.c"
108994 break;
108995 case 291: /* trigger_cmd ::= insert_cmd INTO trnm inscollist_opt VALUES LP itemlist RP */
108996 #line 1264 "parse.y"
108997 {yygotominor.yy203 = sqlite3TriggerInsertStep(pParse->db, &yymsp[-5].minor.yy0, yymsp[-4].minor.yy384, yymsp[-1].minor.yy322, 0, yymsp[-7].minor.yy210);}
108998 #line 3412 "parse.c"
108999 break;
109000 case 292: /* trigger_cmd ::= insert_cmd INTO trnm inscollist_opt select */
109001 #line 1267 "parse.y"
109002 {yygotominor.yy203 = sqlite3TriggerInsertStep(pParse->db, &yymsp[-2].minor.yy0, yymsp[-1].minor.yy384, 0, yymsp[0].minor.yy387, yymsp[-4].minor.yy210);}
109003 #line 3417 "parse.c"
109004 break;
109005 case 293: /* trigger_cmd ::= DELETE FROM trnm tridxby where_opt */
109006 #line 1271 "parse.y"
109007 {yygotominor.yy203 = sqlite3TriggerDeleteStep(pParse->db, &yymsp[-2].minor.yy0, yymsp[0].minor.yy314);}
109008 #line 3422 "parse.c"
109009 break;
109010 case 294: /* trigger_cmd ::= select */
109011 #line 1274 "parse.y"
109012 {yygotominor.yy203 = sqlite3TriggerSelectStep(pParse->db, yymsp[0].minor.yy387); }
109013 #line 3427 "parse.c"
109014 break;
109015 case 295: /* expr ::= RAISE LP IGNORE RP */
109016 #line 1277 "parse.y"
109017 {
109018 yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_RAISE, 0, 0, 0);
109019 if( yygotominor.yy118.pExpr ){
109020 yygotominor.yy118.pExpr->affinity = OE_Ignore;
109021 }
109022 yygotominor.yy118.zStart = yymsp[-3].minor.yy0.z;
109023 yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
109024 }
109025 #line 3439 "parse.c"
109026 break;
109027 case 296: /* expr ::= RAISE LP raisetype COMMA nm RP */
109028 #line 1285 "parse.y"
109029 {
109030 yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_RAISE, 0, 0, &yymsp[-1].minor.yy0);
109031 if( yygotominor.yy118.pExpr ) {
109032 yygotominor.yy118.pExpr->affinity = (char)yymsp[-3].minor.yy4;
109033 }
109034 yygotominor.yy118.zStart = yymsp[-5].minor.yy0.z;
109035 yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
109036 }
109037 #line 3451 "parse.c"
109038 break;
109039 case 297: /* raisetype ::= ROLLBACK */
109040 #line 1296 "parse.y"
109041 {yygotominor.yy4 = OE_Rollback;}
109042 #line 3456 "parse.c"
109043 break;
109044 case 299: /* raisetype ::= FAIL */
109045 #line 1298 "parse.y"
109046 {yygotominor.yy4 = OE_Fail;}
109047 #line 3461 "parse.c"
109048 break;
109049 case 300: /* cmd ::= DROP TRIGGER ifexists fullname */
109050 #line 1303 "parse.y"
109051 {
109052 sqlite3DropTrigger(pParse,yymsp[0].minor.yy259,yymsp[-1].minor.yy4);
109053 }
109054 #line 3468 "parse.c"
109055 break;
109056 case 301: /* cmd ::= ATTACH database_kw_opt expr AS expr key_opt */
109057 #line 1310 "parse.y"
109058 {
109059 sqlite3Attach(pParse, yymsp[-3].minor.yy118.pExpr, yymsp[-1].minor.yy118.pExpr, yymsp[0].minor.yy314);
109060 }
109061 #line 3475 "parse.c"
109062 break;
109063 case 302: /* cmd ::= DETACH database_kw_opt expr */
109064 #line 1313 "parse.y"
109065 {
109066 sqlite3Detach(pParse, yymsp[0].minor.yy118.pExpr);
109067 }
109068 #line 3482 "parse.c"
109069 break;
109070 case 307: /* cmd ::= REINDEX */
109071 #line 1328 "parse.y"
109072 {sqlite3Reindex(pParse, 0, 0);}
109073 #line 3487 "parse.c"
109074 break;
109075 case 308: /* cmd ::= REINDEX nm dbnm */
109076 #line 1329 "parse.y"
109077 {sqlite3Reindex(pParse, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0);}
109078 #line 3492 "parse.c"
109079 break;
109080 case 309: /* cmd ::= ANALYZE */
109081 #line 1334 "parse.y"
109082 {sqlite3Analyze(pParse, 0, 0);}
109083 #line 3497 "parse.c"
109084 break;
109085 case 310: /* cmd ::= ANALYZE nm dbnm */
109086 #line 1335 "parse.y"
109087 {sqlite3Analyze(pParse, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0);}
109088 #line 3502 "parse.c"
109089 break;
109090 case 311: /* cmd ::= ALTER TABLE fullname RENAME TO nm */
109091 #line 1340 "parse.y"
109092 {
109093 sqlite3AlterRenameTable(pParse,yymsp[-3].minor.yy259,&yymsp[0].minor.yy0);
109094 }
109095 #line 3509 "parse.c"
109096 break;
109097 case 312: /* cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt column */
109098 #line 1343 "parse.y"
109099 {
109100 sqlite3AlterFinishAddColumn(pParse, &yymsp[0].minor.yy0);
109101 }
109102 #line 3516 "parse.c"
109103 break;
109104 case 313: /* add_column_fullname ::= fullname */
109105 #line 1346 "parse.y"
109106 {
109107 pParse->db->lookaside.bEnabled = 0;
109108 sqlite3AlterBeginAddColumn(pParse, yymsp[0].minor.yy259);
109109 }
109110 #line 3524 "parse.c"
109111 break;
109112 case 316: /* cmd ::= create_vtab */
109113 #line 1356 "parse.y"
109114 {sqlite3VtabFinishParse(pParse,0);}
109115 #line 3529 "parse.c"
109116 break;
109117 case 317: /* cmd ::= create_vtab LP vtabarglist RP */
109118 #line 1357 "parse.y"
109119 {sqlite3VtabFinishParse(pParse,&yymsp[0].minor.yy0);}
109120 #line 3534 "parse.c"
109121 break;
109122 case 318: /* create_vtab ::= createkw VIRTUAL TABLE nm dbnm USING nm */
109123 #line 1358 "parse.y"
109124 {
109125 sqlite3VtabBeginParse(pParse, &yymsp[-3].minor.yy0, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0);
109126 }
109127 #line 3541 "parse.c"
109128 break;
109129 case 321: /* vtabarg ::= */
109130 #line 1363 "parse.y"
109131 {sqlite3VtabArgInit(pParse);}
109132 #line 3546 "parse.c"
109133 break;
109134 case 323: /* vtabargtoken ::= ANY */
109135 case 324: /* vtabargtoken ::= lp anylist RP */ yytestcase(yyruleno==324);
109136 case 325: /* lp ::= LP */ yytestcase(yyruleno==325);
109137 #line 1365 "parse.y"
109138 {sqlite3VtabArgExtend(pParse,&yymsp[0].minor.yy0);}
109139 #line 3553 "parse.c"
109140 break;
109141 default:
109142 /* (0) input ::= cmdlist */ yytestcase(yyruleno==0);
109143 /* (1) cmdlist ::= cmdlist ecmd */ yytestcase(yyruleno==1);
109144 /* (2) cmdlist ::= ecmd */ yytestcase(yyruleno==2);
@@ -109236,17 +108767,15 @@
109236 int yymajor, /* The major type of the error token */
109237 YYMINORTYPE yyminor /* The minor type of the error token */
109238 ){
109239 sqlite3ParserARG_FETCH;
109240 #define TOKEN (yyminor.yy0)
109241 #line 32 "parse.y"
109242
109243 UNUSED_PARAMETER(yymajor); /* Silence some compiler warnings */
109244 assert( TOKEN.z[0] ); /* The tokenizer always gives us a token */
109245 sqlite3ErrorMsg(pParse, "near \"%T\": syntax error", &TOKEN);
109246 pParse->parseError = 1;
109247 #line 3661 "parse.c"
109248 sqlite3ParserARG_STORE; /* Suppress warning about unused %extra_argument variable */
109249 }
109250
109251 /*
109252 ** The following is executed when the parser accepts
@@ -109436,11 +108965,10 @@
109436 return;
109437 }
109438
109439 /************** End of parse.c ***********************************************/
109440 /************** Begin file tokenize.c ****************************************/
109441 #line 1 "tsrc/tokenize.c"
109442 /*
109443 ** 2001 September 15
109444 **
109445 ** The author disclaims copyright to this source code. In place of
109446 ** a legal notice, here is a blessing:
@@ -109502,11 +109030,10 @@
109502 ** named keywordhash.h and then included into this source file by
109503 ** the #include below.
109504 */
109505 /************** Include keywordhash.h in the middle of tokenize.c ************/
109506 /************** Begin file keywordhash.h *************************************/
109507 #line 1 "tsrc/keywordhash.h"
109508 /***** This file contains automatically generated code ******
109509 **
109510 ** The code in this file has been automatically generated by
109511 **
109512 ** sqlite/tool/mkkeywordhash.c
@@ -109776,11 +109303,10 @@
109776 }
109777 #define SQLITE_N_KEYWORD 121
109778
109779 /************** End of keywordhash.h *****************************************/
109780 /************** Continuing where we left off in tokenize.c *******************/
109781 #line 66 "tsrc/tokenize.c"
109782
109783
109784 /*
109785 ** If X is a character that can be used in an identifier then
109786 ** IdChar(X) will be true. Otherwise it is false.
@@ -110241,11 +109767,10 @@
110241 return nErr;
110242 }
110243
110244 /************** End of tokenize.c ********************************************/
110245 /************** Begin file complete.c ****************************************/
110246 #line 1 "tsrc/complete.c"
110247 /*
110248 ** 2001 September 15
110249 **
110250 ** The author disclaims copyright to this source code. In place of
110251 ** a legal notice, here is a blessing:
@@ -110527,11 +110052,10 @@
110527 #endif /* SQLITE_OMIT_UTF16 */
110528 #endif /* SQLITE_OMIT_COMPLETE */
110529
110530 /************** End of complete.c ********************************************/
110531 /************** Begin file main.c ********************************************/
110532 #line 1 "tsrc/main.c"
110533 /*
110534 ** 2001 September 15
110535 **
110536 ** The author disclaims copyright to this source code. In place of
110537 ** a legal notice, here is a blessing:
@@ -110548,11 +110072,10 @@
110548 */
110549
110550 #ifdef SQLITE_ENABLE_FTS3
110551 /************** Include fts3.h in the middle of main.c ***********************/
110552 /************** Begin file fts3.h ********************************************/
110553 #line 1 "tsrc/fts3.h"
110554 /*
110555 ** 2006 Oct 10
110556 **
110557 ** The author disclaims copyright to this source code. In place of
110558 ** a legal notice, here is a blessing:
@@ -110577,16 +110100,14 @@
110577 } /* extern "C" */
110578 #endif /* __cplusplus */
110579
110580 /************** End of fts3.h ************************************************/
110581 /************** Continuing where we left off in main.c ***********************/
110582 #line 21 "tsrc/main.c"
110583 #endif
110584 #ifdef SQLITE_ENABLE_RTREE
110585 /************** Include rtree.h in the middle of main.c **********************/
110586 /************** Begin file rtree.h *******************************************/
110587 #line 1 "tsrc/rtree.h"
110588 /*
110589 ** 2008 May 26
110590 **
110591 ** The author disclaims copyright to this source code. In place of
110592 ** a legal notice, here is a blessing:
@@ -110611,16 +110132,14 @@
110611 } /* extern "C" */
110612 #endif /* __cplusplus */
110613
110614 /************** End of rtree.h ***********************************************/
110615 /************** Continuing where we left off in main.c ***********************/
110616 #line 24 "tsrc/main.c"
110617 #endif
110618 #ifdef SQLITE_ENABLE_ICU
110619 /************** Include sqliteicu.h in the middle of main.c ******************/
110620 /************** Begin file sqliteicu.h ***************************************/
110621 #line 1 "tsrc/sqliteicu.h"
110622 /*
110623 ** 2008 May 26
110624 **
110625 ** The author disclaims copyright to this source code. In place of
110626 ** a legal notice, here is a blessing:
@@ -110646,11 +110165,10 @@
110646 #endif /* __cplusplus */
110647
110648
110649 /************** End of sqliteicu.h *******************************************/
110650 /************** Continuing where we left off in main.c ***********************/
110651 #line 27 "tsrc/main.c"
110652 #endif
110653
110654 #ifndef SQLITE_AMALGAMATION
110655 /* IMPLEMENTATION-OF: R-46656-45156 The sqlite3_version[] string constant
110656 ** contains the text of SQLITE_VERSION macro.
@@ -113577,11 +113095,10 @@
113577 return 0;
113578 }
113579
113580 /************** End of main.c ************************************************/
113581 /************** Begin file notify.c ******************************************/
113582 #line 1 "tsrc/notify.c"
113583 /*
113584 ** 2009 March 3
113585 **
113586 ** The author disclaims copyright to this source code. In place of
113587 ** a legal notice, here is a blessing:
@@ -113911,11 +113428,10 @@
113911 }
113912 #endif
113913
113914 /************** End of notify.c **********************************************/
113915 /************** Begin file fts3.c ********************************************/
113916 #line 1 "tsrc/fts3.c"
113917 /*
113918 ** 2006 Oct 10
113919 **
113920 ** The author disclaims copyright to this source code. In place of
113921 ** a legal notice, here is a blessing:
@@ -114208,11 +113724,10 @@
114208 ** into a single segment.
114209 */
114210
114211 /************** Include fts3Int.h in the middle of fts3.c ********************/
114212 /************** Begin file fts3Int.h *****************************************/
114213 #line 1 "tsrc/fts3Int.h"
114214 /*
114215 ** 2009 Nov 12
114216 **
114217 ** The author disclaims copyright to this source code. In place of
114218 ** a legal notice, here is a blessing:
@@ -114247,11 +113762,10 @@
114247 SQLITE_API extern const sqlite3_api_routines *sqlite3_api;
114248 #endif
114249
114250 /************** Include fts3_tokenizer.h in the middle of fts3Int.h **********/
114251 /************** Begin file fts3_tokenizer.h **********************************/
114252 #line 1 "tsrc/fts3_tokenizer.h"
114253 /*
114254 ** 2006 July 10
114255 **
114256 ** The author disclaims copyright to this source code.
114257 **
@@ -114402,14 +113916,12 @@
114402
114403 #endif /* _FTS3_TOKENIZER_H_ */
114404
114405 /************** End of fts3_tokenizer.h **************************************/
114406 /************** Continuing where we left off in fts3Int.h ********************/
114407 #line 40 "tsrc/fts3Int.h"
114408 /************** Include fts3_hash.h in the middle of fts3Int.h ***************/
114409 /************** Begin file fts3_hash.h ***************************************/
114410 #line 1 "tsrc/fts3_hash.h"
114411 /*
114412 ** 2001 September 22
114413 **
114414 ** The author disclaims copyright to this source code. In place of
114415 ** a legal notice, here is a blessing:
@@ -114521,11 +114033,10 @@
114521
114522 #endif /* _FTS3_HASH_H_ */
114523
114524 /************** End of fts3_hash.h *******************************************/
114525 /************** Continuing where we left off in fts3Int.h ********************/
114526 #line 41 "tsrc/fts3Int.h"
114527
114528 /*
114529 ** This constant controls how often segments are merged. Once there are
114530 ** FTS3_MERGE_COUNT segments of level N, they are merged into a single
114531 ** segment of level N+1.
@@ -114998,11 +114509,10 @@
114998 #endif /* !SQLITE_CORE || SQLITE_ENABLE_FTS3 */
114999 #endif /* _FTSINT_H */
115000
115001 /************** End of fts3Int.h *********************************************/
115002 /************** Continuing where we left off in fts3.c ***********************/
115003 #line 296 "tsrc/fts3.c"
115004 #if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3)
115005
115006 #if defined(SQLITE_ENABLE_FTS3) && !defined(SQLITE_CORE)
115007 # define SQLITE_CORE 1
115008 #endif
@@ -119548,11 +119058,10 @@
119548
119549 #endif
119550
119551 /************** End of fts3.c ************************************************/
119552 /************** Begin file fts3_aux.c ****************************************/
119553 #line 1 "tsrc/fts3_aux.c"
119554 /*
119555 ** 2011 Jan 27
119556 **
119557 ** The author disclaims copyright to this source code. In place of
119558 ** a legal notice, here is a blessing:
@@ -120025,11 +119534,10 @@
120025
120026 #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */
120027
120028 /************** End of fts3_aux.c ********************************************/
120029 /************** Begin file fts3_expr.c ***************************************/
120030 #line 1 "tsrc/fts3_expr.c"
120031 /*
120032 ** 2008 Nov 28
120033 **
120034 ** The author disclaims copyright to this source code. In place of
120035 ** a legal notice, here is a blessing:
@@ -120992,11 +120500,10 @@
120992 #endif
120993 #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */
120994
120995 /************** End of fts3_expr.c *******************************************/
120996 /************** Begin file fts3_hash.c ***************************************/
120997 #line 1 "tsrc/fts3_hash.c"
120998 /*
120999 ** 2001 September 22
121000 **
121001 ** The author disclaims copyright to this source code. In place of
121002 ** a legal notice, here is a blessing:
@@ -121377,11 +120884,10 @@
121377
121378 #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */
121379
121380 /************** End of fts3_hash.c *******************************************/
121381 /************** Begin file fts3_porter.c *************************************/
121382 #line 1 "tsrc/fts3_porter.c"
121383 /*
121384 ** 2006 September 30
121385 **
121386 ** The author disclaims copyright to this source code. In place of
121387 ** a legal notice, here is a blessing:
@@ -122024,11 +121530,10 @@
122024
122025 #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */
122026
122027 /************** End of fts3_porter.c *****************************************/
122028 /************** Begin file fts3_tokenizer.c **********************************/
122029 #line 1 "tsrc/fts3_tokenizer.c"
122030 /*
122031 ** 2007 June 22
122032 **
122033 ** The author disclaims copyright to this source code. In place of
122034 ** a legal notice, here is a blessing:
@@ -122516,11 +122021,10 @@
122516
122517 #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */
122518
122519 /************** End of fts3_tokenizer.c **************************************/
122520 /************** Begin file fts3_tokenizer1.c *********************************/
122521 #line 1 "tsrc/fts3_tokenizer1.c"
122522 /*
122523 ** 2006 Oct 10
122524 **
122525 ** The author disclaims copyright to this source code. In place of
122526 ** a legal notice, here is a blessing:
@@ -122751,11 +122255,10 @@
122751
122752 #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */
122753
122754 /************** End of fts3_tokenizer1.c *************************************/
122755 /************** Begin file fts3_write.c **************************************/
122756 #line 1 "tsrc/fts3_write.c"
122757 /*
122758 ** 2009 Oct 23
122759 **
122760 ** The author disclaims copyright to this source code. In place of
122761 ** a legal notice, here is a blessing:
@@ -126022,11 +125525,10 @@
126022
126023 #endif
126024
126025 /************** End of fts3_write.c ******************************************/
126026 /************** Begin file fts3_snippet.c ************************************/
126027 #line 1 "tsrc/fts3_snippet.c"
126028 /*
126029 ** 2009 Oct 23
126030 **
126031 ** The author disclaims copyright to this source code. In place of
126032 ** a legal notice, here is a blessing:
@@ -127524,11 +127026,10 @@
127524
127525 #endif
127526
127527 /************** End of fts3_snippet.c ****************************************/
127528 /************** Begin file rtree.c *******************************************/
127529 #line 1 "tsrc/rtree.c"
127530 /*
127531 ** 2001 September 15
127532 **
127533 ** The author disclaims copyright to this source code. In place of
127534 ** a legal notice, here is a blessing:
@@ -130806,11 +130307,10 @@
130806
130807 #endif
130808
130809 /************** End of rtree.c ***********************************************/
130810 /************** Begin file icu.c *********************************************/
130811 #line 1 "tsrc/icu.c"
130812 /*
130813 ** 2007 May 6
130814 **
130815 ** The author disclaims copyright to this source code. In place of
130816 ** a legal notice, here is a blessing:
@@ -131309,11 +130809,10 @@
131309
131310 #endif
131311
131312 /************** End of icu.c *************************************************/
131313 /************** Begin file fts3_icu.c ****************************************/
131314 #line 1 "tsrc/fts3_icu.c"
131315 /*
131316 ** 2007 June 22
131317 **
131318 ** The author disclaims copyright to this source code. In place of
131319 ** a legal notice, here is a blessing:
131320
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -24,11 +24,10 @@
24 #endif
25 #ifndef SQLITE_API
26 # define SQLITE_API
27 #endif
28 /************** Begin file sqliteInt.h ***************************************/
 
29 /*
30 ** 2001 September 15
31 **
32 ** The author disclaims copyright to this source code. In place of
33 ** a legal notice, here is a blessing:
@@ -79,11 +78,10 @@
78 #include "config.h"
79 #endif
80
81 /************** Include sqliteLimit.h in the middle of sqliteInt.h ***********/
82 /************** Begin file sqliteLimit.h *************************************/
 
83 /*
84 ** 2007 May 7
85 **
86 ** The author disclaims copyright to this source code. In place of
87 ** a legal notice, here is a blessing:
@@ -291,11 +289,10 @@
289 # define SQLITE_MAX_TRIGGER_DEPTH 1000
290 #endif
291
292 /************** End of sqliteLimit.h *****************************************/
293 /************** Continuing where we left off in sqliteInt.h ******************/
 
294
295 /* Disable nuisance warnings on Borland compilers */
296 #if defined(__BORLANDC__)
297 #pragma warn -rch /* unreachable code */
298 #pragma warn -ccc /* Condition is always true or false */
@@ -548,11 +545,10 @@
545 # define unlikely(X) !!(X)
546 #endif
547
548 /************** Include sqlite3.h in the middle of sqliteInt.h ***************/
549 /************** Begin file sqlite3.h *****************************************/
 
550 /*
551 ** 2001 September 15
552 **
553 ** The author disclaims copyright to this source code. In place of
554 ** a legal notice, here is a blessing:
@@ -660,11 +656,11 @@
656 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
657 ** [sqlite_version()] and [sqlite_source_id()].
658 */
659 #define SQLITE_VERSION "3.7.8"
660 #define SQLITE_VERSION_NUMBER 3007008
661 #define SQLITE_SOURCE_ID "2011-09-17 17:29:20 b31a7d7db9040d8eedaf1ecd89ea0033f579d0f1"
662
663 /*
664 ** CAPI3REF: Run-Time Library Version Numbers
665 ** KEYWORDS: sqlite3_version, sqlite3_sourceid
666 **
@@ -7309,14 +7305,12 @@
7305 #endif /* ifndef _SQLITE3RTREE_H_ */
7306
7307
7308 /************** End of sqlite3.h *********************************************/
7309 /************** Continuing where we left off in sqliteInt.h ******************/
 
7310 /************** Include hash.h in the middle of sqliteInt.h ******************/
7311 /************** Begin file hash.h ********************************************/
 
7312 /*
7313 ** 2001 September 22
7314 **
7315 ** The author disclaims copyright to this source code. In place of
7316 ** a legal notice, here is a blessing:
@@ -7412,14 +7406,12 @@
7406
7407 #endif /* _SQLITE_HASH_H_ */
7408
7409 /************** End of hash.h ************************************************/
7410 /************** Continuing where we left off in sqliteInt.h ******************/
 
7411 /************** Include parse.h in the middle of sqliteInt.h *****************/
7412 /************** Begin file parse.h *******************************************/
 
7413 #define TK_SEMI 1
7414 #define TK_EXPLAIN 2
7415 #define TK_QUERY 3
7416 #define TK_PLAN 4
7417 #define TK_BEGIN 5
@@ -7576,11 +7568,10 @@
7568 #define TK_UMINUS 156
7569 #define TK_UPLUS 157
7570
7571 /************** End of parse.h ***********************************************/
7572 /************** Continuing where we left off in sqliteInt.h ******************/
 
7573 #include <stdio.h>
7574 #include <stdlib.h>
7575 #include <string.h>
7576 #include <assert.h>
7577 #include <stddef.h>
@@ -7920,11 +7911,10 @@
7911 ** "BusyHandler" typedefs. vdbe.h also requires a few of the opaque
7912 ** pointer types (i.e. FuncDef) defined above.
7913 */
7914 /************** Include btree.h in the middle of sqliteInt.h *****************/
7915 /************** Begin file btree.h *******************************************/
 
7916 /*
7917 ** 2001 September 15
7918 **
7919 ** The author disclaims copyright to this source code. In place of
7920 ** a legal notice, here is a blessing:
@@ -8165,14 +8155,12 @@
8155
8156 #endif /* _BTREE_H_ */
8157
8158 /************** End of btree.h ***********************************************/
8159 /************** Continuing where we left off in sqliteInt.h ******************/
 
8160 /************** Include vdbe.h in the middle of sqliteInt.h ******************/
8161 /************** Begin file vdbe.h ********************************************/
 
8162 /*
8163 ** 2001 September 15
8164 **
8165 ** The author disclaims copyright to this source code. In place of
8166 ** a legal notice, here is a blessing:
@@ -8333,11 +8321,10 @@
8321 ** The makefile scans the vdbe.c source file and creates the "opcodes.h"
8322 ** header file that defines a number for each opcode used by the VDBE.
8323 */
8324 /************** Include opcodes.h in the middle of vdbe.h ********************/
8325 /************** Begin file opcodes.h *****************************************/
 
8326 /* Automatically generated. Do not edit */
8327 /* See the mkopcodeh.awk script for details */
8328 #define OP_Goto 1
8329 #define OP_Gosub 2
8330 #define OP_Return 3
@@ -8387,108 +8374,109 @@
8374 #define OP_Jump 25
8375 #define OP_And 69 /* same as TK_AND */
8376 #define OP_Or 68 /* same as TK_OR */
8377 #define OP_Not 19 /* same as TK_NOT */
8378 #define OP_BitNot 93 /* same as TK_BITNOT */
8379 #define OP_Once 26
8380 #define OP_If 27
8381 #define OP_IfNot 28
8382 #define OP_IsNull 73 /* same as TK_ISNULL */
8383 #define OP_NotNull 74 /* same as TK_NOTNULL */
8384 #define OP_Column 29
8385 #define OP_Affinity 30
8386 #define OP_MakeRecord 31
8387 #define OP_Count 32
8388 #define OP_Savepoint 33
8389 #define OP_AutoCommit 34
8390 #define OP_Transaction 35
8391 #define OP_ReadCookie 36
8392 #define OP_SetCookie 37
8393 #define OP_VerifyCookie 38
8394 #define OP_OpenRead 39
8395 #define OP_OpenWrite 40
8396 #define OP_OpenAutoindex 41
8397 #define OP_OpenEphemeral 42
8398 #define OP_SorterOpen 43
8399 #define OP_OpenPseudo 44
8400 #define OP_Close 45
8401 #define OP_SeekLt 46
8402 #define OP_SeekLe 47
8403 #define OP_SeekGe 48
8404 #define OP_SeekGt 49
8405 #define OP_Seek 50
8406 #define OP_NotFound 51
8407 #define OP_Found 52
8408 #define OP_IsUnique 53
8409 #define OP_NotExists 54
8410 #define OP_Sequence 55
8411 #define OP_NewRowid 56
8412 #define OP_Insert 57
8413 #define OP_InsertInt 58
8414 #define OP_Delete 59
8415 #define OP_ResetCount 60
8416 #define OP_SorterCompare 61
8417 #define OP_SorterData 62
8418 #define OP_RowKey 63
8419 #define OP_RowData 64
8420 #define OP_Rowid 65
8421 #define OP_NullRow 66
8422 #define OP_Last 67
8423 #define OP_SorterSort 70
8424 #define OP_Sort 71
8425 #define OP_Rewind 72
8426 #define OP_SorterNext 81
8427 #define OP_Prev 92
8428 #define OP_Next 95
8429 #define OP_SorterInsert 96
8430 #define OP_IdxInsert 97
8431 #define OP_IdxDelete 98
8432 #define OP_IdxRowid 99
8433 #define OP_IdxLT 100
8434 #define OP_IdxGE 101
8435 #define OP_Destroy 102
8436 #define OP_Clear 103
8437 #define OP_CreateIndex 104
8438 #define OP_CreateTable 105
8439 #define OP_ParseSchema 106
8440 #define OP_LoadAnalysis 107
8441 #define OP_DropTable 108
8442 #define OP_DropIndex 109
8443 #define OP_DropTrigger 110
8444 #define OP_IntegrityCk 111
8445 #define OP_RowSetAdd 112
8446 #define OP_RowSetRead 113
8447 #define OP_RowSetTest 114
8448 #define OP_Program 115
8449 #define OP_Param 116
8450 #define OP_FkCounter 117
8451 #define OP_FkIfZero 118
8452 #define OP_MemMax 119
8453 #define OP_IfPos 120
8454 #define OP_IfNeg 121
8455 #define OP_IfZero 122
8456 #define OP_AggStep 123
8457 #define OP_AggFinal 124
8458 #define OP_Checkpoint 125
8459 #define OP_JournalMode 126
8460 #define OP_Vacuum 127
8461 #define OP_IncrVacuum 128
8462 #define OP_Expire 129
8463 #define OP_TableLock 131
8464 #define OP_VBegin 132
8465 #define OP_VCreate 133
8466 #define OP_VDestroy 134
8467 #define OP_VOpen 135
8468 #define OP_VFilter 136
8469 #define OP_VColumn 137
8470 #define OP_VNext 138
8471 #define OP_VRename 139
8472 #define OP_VUpdate 140
8473 #define OP_Pagecount 146
8474 #define OP_MaxPgcnt 147
8475 #define OP_Trace 148
8476 #define OP_Noop 149
8477 #define OP_Explain 150
8478
8479
8480 /* Properties such as "out2" or "jump" that are specified in
8481 ** comments following the "case" for each opcode in the vdbe.c
8482 ** are encoded into bitvectors as follows:
@@ -8502,30 +8490,29 @@
8490 #define OPFLG_OUT3 0x0040 /* out3: P3 is an output */
8491 #define OPFLG_INITIALIZER {\
8492 /* 0 */ 0x00, 0x01, 0x05, 0x04, 0x04, 0x10, 0x00, 0x02,\
8493 /* 8 */ 0x02, 0x02, 0x02, 0x02, 0x02, 0x00, 0x24, 0x24,\
8494 /* 16 */ 0x00, 0x00, 0x00, 0x24, 0x04, 0x05, 0x04, 0x00,\
8495 /* 24 */ 0x00, 0x01, 0x05, 0x05, 0x05, 0x00, 0x00, 0x00,\
8496 /* 32 */ 0x02, 0x00, 0x00, 0x00, 0x02, 0x10, 0x00, 0x00,\
8497 /* 40 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x11,\
8498 /* 48 */ 0x11, 0x11, 0x08, 0x11, 0x11, 0x11, 0x11, 0x02,\
8499 /* 56 */ 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\
8500 /* 64 */ 0x00, 0x02, 0x00, 0x01, 0x4c, 0x4c, 0x01, 0x01,\
8501 /* 72 */ 0x01, 0x05, 0x05, 0x15, 0x15, 0x15, 0x15, 0x15,\
8502 /* 80 */ 0x15, 0x01, 0x4c, 0x4c, 0x4c, 0x4c, 0x4c, 0x4c,\
8503 /* 88 */ 0x4c, 0x4c, 0x4c, 0x4c, 0x01, 0x24, 0x02, 0x01,\
8504 /* 96 */ 0x08, 0x08, 0x00, 0x02, 0x01, 0x01, 0x02, 0x00,\
8505 /* 104 */ 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\
8506 /* 112 */ 0x0c, 0x45, 0x15, 0x01, 0x02, 0x00, 0x01, 0x08,\
8507 /* 120 */ 0x05, 0x05, 0x05, 0x00, 0x00, 0x00, 0x02, 0x00,\
8508 /* 128 */ 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00,\
8509 /* 136 */ 0x01, 0x00, 0x01, 0x00, 0x00, 0x04, 0x04, 0x04,\
8510 /* 144 */ 0x04, 0x04, 0x02, 0x02, 0x00, 0x00, 0x00,}
8511
8512 /************** End of opcodes.h *********************************************/
8513 /************** Continuing where we left off in vdbe.h ***********************/
 
8514
8515 /*
8516 ** Prototypes for the VDBE interface. See comments on the implementation
8517 ** for a description of what each of these routines does.
8518 */
@@ -8541,11 +8528,11 @@
8528 SQLITE_PRIVATE void sqlite3VdbeChangeP1(Vdbe*, u32 addr, int P1);
8529 SQLITE_PRIVATE void sqlite3VdbeChangeP2(Vdbe*, u32 addr, int P2);
8530 SQLITE_PRIVATE void sqlite3VdbeChangeP3(Vdbe*, u32 addr, int P3);
8531 SQLITE_PRIVATE void sqlite3VdbeChangeP5(Vdbe*, u8 P5);
8532 SQLITE_PRIVATE void sqlite3VdbeJumpHere(Vdbe*, int addr);
8533 SQLITE_PRIVATE void sqlite3VdbeChangeToNoop(Vdbe*, int addr);
8534 SQLITE_PRIVATE void sqlite3VdbeChangeP4(Vdbe*, int addr, const char *zP4, int N);
8535 SQLITE_PRIVATE void sqlite3VdbeUsesBtree(Vdbe*, int);
8536 SQLITE_PRIVATE VdbeOp *sqlite3VdbeGetOp(Vdbe*, int);
8537 SQLITE_PRIVATE int sqlite3VdbeMakeLabel(Vdbe*);
8538 SQLITE_PRIVATE void sqlite3VdbeRunOnlyOnce(Vdbe*);
@@ -8596,14 +8583,12 @@
8583
8584 #endif
8585
8586 /************** End of vdbe.h ************************************************/
8587 /************** Continuing where we left off in sqliteInt.h ******************/
 
8588 /************** Include pager.h in the middle of sqliteInt.h *****************/
8589 /************** Begin file pager.h *******************************************/
 
8590 /*
8591 ** 2001 September 15
8592 **
8593 ** The author disclaims copyright to this source code. In place of
8594 ** a legal notice, here is a blessing:
@@ -8785,14 +8770,12 @@
8770
8771 #endif /* _PAGER_H_ */
8772
8773 /************** End of pager.h ***********************************************/
8774 /************** Continuing where we left off in sqliteInt.h ******************/
 
8775 /************** Include pcache.h in the middle of sqliteInt.h ****************/
8776 /************** Begin file pcache.h ******************************************/
 
8777 /*
8778 ** 2008 August 05
8779 **
8780 ** The author disclaims copyright to this source code. In place of
8781 ** a legal notice, here is a blessing:
@@ -8947,15 +8930,13 @@
8930
8931 #endif /* _PCACHE_H_ */
8932
8933 /************** End of pcache.h **********************************************/
8934 /************** Continuing where we left off in sqliteInt.h ******************/
 
8935
8936 /************** Include os.h in the middle of sqliteInt.h ********************/
8937 /************** Begin file os.h **********************************************/
 
8938 /*
8939 ** 2001 September 16
8940 **
8941 ** The author disclaims copyright to this source code. In place of
8942 ** a legal notice, here is a blessing:
@@ -9234,14 +9215,12 @@
9215
9216 #endif /* _SQLITE_OS_H_ */
9217
9218 /************** End of os.h **************************************************/
9219 /************** Continuing where we left off in sqliteInt.h ******************/
 
9220 /************** Include mutex.h in the middle of sqliteInt.h *****************/
9221 /************** Begin file mutex.h *******************************************/
 
9222 /*
9223 ** 2007 August 28
9224 **
9225 ** The author disclaims copyright to this source code. In place of
9226 ** a legal notice, here is a blessing:
@@ -9312,11 +9291,10 @@
9291 #define sqlite3MutexEnd()
9292 #endif /* defined(SQLITE_MUTEX_OMIT) */
9293
9294 /************** End of mutex.h ***********************************************/
9295 /************** Continuing where we left off in sqliteInt.h ******************/
 
9296
9297
9298 /*
9299 ** Each database file to be accessed by the system is an instance
9300 ** of the following structure. There are normally two of these structures
@@ -10509,11 +10487,12 @@
10487 char *zDatabase; /* Name of database holding this table */
10488 char *zName; /* Name of the table */
10489 char *zAlias; /* The "B" part of a "A AS B" phrase. zName is the "A" */
10490 Table *pTab; /* An SQL table corresponding to zName */
10491 Select *pSelect; /* A SELECT statement used in place of a table name */
10492 int addrFillSub; /* Address of subroutine to manifest a subquery */
10493 int regReturn; /* Register holding return address of addrFillSub */
10494 u8 jointype; /* Type of join between this able and the previous */
10495 u8 notIndexed; /* True if there is a NOT INDEXED clause */
10496 u8 isCorrelated; /* True if sub-query is correlated */
10497 #ifndef SQLITE_OMIT_EXPLAIN
10498 u8 iSelectId; /* If pSelect!=0, the id of the sub-select in EQP */
@@ -11915,11 +11894,10 @@
11894
11895 #endif /* _SQLITEINT_H_ */
11896
11897 /************** End of sqliteInt.h *******************************************/
11898 /************** Begin file global.c ******************************************/
 
11899 /*
11900 ** 2008 June 13
11901 **
11902 ** The author disclaims copyright to this source code. In place of
11903 ** a legal notice, here is a blessing:
@@ -12138,11 +12116,10 @@
12116 */
12117 SQLITE_PRIVATE const unsigned char sqlite3OpcodeProperty[] = OPFLG_INITIALIZER;
12118
12119 /************** End of global.c **********************************************/
12120 /************** Begin file ctime.c *******************************************/
 
12121 /*
12122 ** 2010 February 23
12123 **
12124 ** The author disclaims copyright to this source code. In place of
12125 ** a legal notice, here is a blessing:
@@ -12543,11 +12520,10 @@
12520
12521 #endif /* SQLITE_OMIT_COMPILEOPTION_DIAGS */
12522
12523 /************** End of ctime.c ***********************************************/
12524 /************** Begin file status.c ******************************************/
 
12525 /*
12526 ** 2008 June 18
12527 **
12528 ** The author disclaims copyright to this source code. In place of
12529 ** a legal notice, here is a blessing:
@@ -12561,11 +12537,10 @@
12537 ** This module implements the sqlite3_status() interface and related
12538 ** functionality.
12539 */
12540 /************** Include vdbeInt.h in the middle of status.c ******************/
12541 /************** Begin file vdbeInt.h *****************************************/
 
12542 /*
12543 ** 2003 September 6
12544 **
12545 ** The author disclaims copyright to this source code. In place of
12546 ** a legal notice, here is a blessing:
@@ -13013,11 +12988,10 @@
12988
12989 #endif /* !defined(_VDBEINT_H_) */
12990
12991 /************** End of vdbeInt.h *********************************************/
12992 /************** Continuing where we left off in status.c *********************/
 
12993
12994 /*
12995 ** Variables in which to record status information.
12996 */
12997 typedef struct sqlite3StatType sqlite3StatType;
@@ -13227,11 +13201,10 @@
13201 return rc;
13202 }
13203
13204 /************** End of status.c **********************************************/
13205 /************** Begin file date.c ********************************************/
 
13206 /*
13207 ** 2003 October 31
13208 **
13209 ** The author disclaims copyright to this source code. In place of
13210 ** a legal notice, here is a blessing:
@@ -14355,11 +14328,10 @@
14328 }
14329 }
14330
14331 /************** End of date.c ************************************************/
14332 /************** Begin file os.c **********************************************/
 
14333 /*
14334 ** 2005 November 29
14335 **
14336 ** The author disclaims copyright to this source code. In place of
14337 ** a legal notice, here is a blessing:
@@ -14565,11 +14537,11 @@
14537 int flags,
14538 int *pOutFlags
14539 ){
14540 int rc = SQLITE_NOMEM;
14541 sqlite3_file *pFile;
14542 pFile = (sqlite3_file *)sqlite3MallocZero(pVfs->szOsFile);
14543 if( pFile ){
14544 rc = sqlite3OsOpen(pVfs, zFile, pFile, flags, pOutFlags);
14545 if( rc!=SQLITE_OK ){
14546 sqlite3_free(pFile);
14547 }else{
@@ -14689,11 +14661,10 @@
14661 return SQLITE_OK;
14662 }
14663
14664 /************** End of os.c **************************************************/
14665 /************** Begin file fault.c *******************************************/
 
14666 /*
14667 ** 2008 Jan 22
14668 **
14669 ** The author disclaims copyright to this source code. In place of
14670 ** a legal notice, here is a blessing:
@@ -14779,11 +14750,10 @@
14750
14751 #endif /* #ifndef SQLITE_OMIT_BUILTIN_TEST */
14752
14753 /************** End of fault.c ***********************************************/
14754 /************** Begin file mem0.c ********************************************/
 
14755 /*
14756 ** 2008 October 28
14757 **
14758 ** The author disclaims copyright to this source code. In place of
14759 ** a legal notice, here is a blessing:
@@ -14841,11 +14811,10 @@
14811
14812 #endif /* SQLITE_ZERO_MALLOC */
14813
14814 /************** End of mem0.c ************************************************/
14815 /************** Begin file mem1.c ********************************************/
 
14816 /*
14817 ** 2007 August 14
14818 **
14819 ** The author disclaims copyright to this source code. In place of
14820 ** a legal notice, here is a blessing:
@@ -14994,11 +14963,10 @@
14963
14964 #endif /* SQLITE_SYSTEM_MALLOC */
14965
14966 /************** End of mem1.c ************************************************/
14967 /************** Begin file mem2.c ********************************************/
 
14968 /*
14969 ** 2007 August 15
14970 **
14971 ** The author disclaims copyright to this source code. In place of
14972 ** a legal notice, here is a blessing:
@@ -15525,11 +15493,10 @@
15493
15494 #endif /* SQLITE_MEMDEBUG */
15495
15496 /************** End of mem2.c ************************************************/
15497 /************** Begin file mem3.c ********************************************/
 
15498 /*
15499 ** 2007 October 14
15500 **
15501 ** The author disclaims copyright to this source code. In place of
15502 ** a legal notice, here is a blessing:
@@ -16215,11 +16182,10 @@
16182
16183 #endif /* SQLITE_ENABLE_MEMSYS3 */
16184
16185 /************** End of mem3.c ************************************************/
16186 /************** Begin file mem5.c ********************************************/
 
16187 /*
16188 ** 2007 October 14
16189 **
16190 ** The author disclaims copyright to this source code. In place of
16191 ** a legal notice, here is a blessing:
@@ -16799,11 +16765,10 @@
16765
16766 #endif /* SQLITE_ENABLE_MEMSYS5 */
16767
16768 /************** End of mem5.c ************************************************/
16769 /************** Begin file mutex.c *******************************************/
 
16770 /*
16771 ** 2007 August 14
16772 **
16773 ** The author disclaims copyright to this source code. In place of
16774 ** a legal notice, here is a blessing:
@@ -16955,11 +16920,10 @@
16920
16921 #endif /* SQLITE_MUTEX_OMIT */
16922
16923 /************** End of mutex.c ***********************************************/
16924 /************** Begin file mutex_noop.c **************************************/
 
16925 /*
16926 ** 2008 October 07
16927 **
16928 ** The author disclaims copyright to this source code. In place of
16929 ** a legal notice, here is a blessing:
@@ -17164,11 +17128,10 @@
17128 #endif /* SQLITE_MUTEX_NOOP */
17129 #endif /* SQLITE_MUTEX_OMIT */
17130
17131 /************** End of mutex_noop.c ******************************************/
17132 /************** Begin file mutex_os2.c ***************************************/
 
17133 /*
17134 ** 2007 August 28
17135 **
17136 ** The author disclaims copyright to this source code. In place of
17137 ** a legal notice, here is a blessing:
@@ -17441,11 +17404,10 @@
17404 }
17405 #endif /* SQLITE_MUTEX_OS2 */
17406
17407 /************** End of mutex_os2.c *******************************************/
17408 /************** Begin file mutex_unix.c **************************************/
 
17409 /*
17410 ** 2007 August 28
17411 **
17412 ** The author disclaims copyright to this source code. In place of
17413 ** a legal notice, here is a blessing:
@@ -17795,11 +17757,10 @@
17757
17758 #endif /* SQLITE_MUTEX_PTHREAD */
17759
17760 /************** End of mutex_unix.c ******************************************/
17761 /************** Begin file mutex_w32.c ***************************************/
 
17762 /*
17763 ** 2007 August 14
17764 **
17765 ** The author disclaims copyright to this source code. In place of
17766 ** a legal notice, here is a blessing:
@@ -18130,11 +18091,10 @@
18091 }
18092 #endif /* SQLITE_MUTEX_W32 */
18093
18094 /************** End of mutex_w32.c *******************************************/
18095 /************** Begin file malloc.c ******************************************/
 
18096 /*
18097 ** 2001 September 15
18098 **
18099 ** The author disclaims copyright to this source code. In place of
18100 ** a legal notice, here is a blessing:
@@ -18910,11 +18870,10 @@
18870 return rc & (db ? db->errMask : 0xff);
18871 }
18872
18873 /************** End of malloc.c **********************************************/
18874 /************** Begin file printf.c ******************************************/
 
18875 /*
18876 ** The "printf" code that follows dates from the 1980's. It is in
18877 ** the public domain. The original comments are included here for
18878 ** completeness. They are very out-of-date but might be useful as
18879 ** an historical reference. Most of the "enhancements" have been backed
@@ -19942,11 +19901,10 @@
19901 }
19902 #endif
19903
19904 /************** End of printf.c **********************************************/
19905 /************** Begin file random.c ******************************************/
 
19906 /*
19907 ** 2001 September 15
19908 **
19909 ** The author disclaims copyright to this source code. In place of
19910 ** a legal notice, here is a blessing:
@@ -20090,11 +20048,10 @@
20048 }
20049 #endif /* SQLITE_OMIT_BUILTIN_TEST */
20050
20051 /************** End of random.c **********************************************/
20052 /************** Begin file utf.c *********************************************/
 
20053 /*
20054 ** 2004 April 13
20055 **
20056 ** The author disclaims copyright to this source code. In place of
20057 ** a legal notice, here is a blessing:
@@ -20652,11 +20609,10 @@
20609 #endif /* SQLITE_TEST */
20610 #endif /* SQLITE_OMIT_UTF16 */
20611
20612 /************** End of utf.c *************************************************/
20613 /************** Begin file util.c ********************************************/
 
20614 /*
20615 ** 2001 September 15
20616 **
20617 ** The author disclaims copyright to this source code. In place of
20618 ** a legal notice, here is a blessing:
@@ -21835,11 +21791,10 @@
21791 }
21792 #endif
21793
21794 /************** End of util.c ************************************************/
21795 /************** Begin file hash.c ********************************************/
 
21796 /*
21797 ** 2001 September 22
21798 **
21799 ** The author disclaims copyright to this source code. In place of
21800 ** a legal notice, here is a blessing:
@@ -22115,11 +22070,10 @@
22070 return 0;
22071 }
22072
22073 /************** End of hash.c ************************************************/
22074 /************** Begin file opcodes.c *****************************************/
 
22075 /* Automatically generated. Do not edit */
22076 /* See the mkopcodec.awk script for details. */
22077 #if !defined(SQLITE_OMIT_EXPLAIN) || !defined(NDEBUG) || defined(VDBE_PROFILE) || defined(SQLITE_DEBUG)
22078 SQLITE_PRIVATE const char *sqlite3OpcodeName(int i){
22079 static const char *const azName[] = { "?",
@@ -22146,66 +22100,66 @@
22100 /* 21 */ "MustBeInt",
22101 /* 22 */ "RealAffinity",
22102 /* 23 */ "Permutation",
22103 /* 24 */ "Compare",
22104 /* 25 */ "Jump",
22105 /* 26 */ "Once",
22106 /* 27 */ "If",
22107 /* 28 */ "IfNot",
22108 /* 29 */ "Column",
22109 /* 30 */ "Affinity",
22110 /* 31 */ "MakeRecord",
22111 /* 32 */ "Count",
22112 /* 33 */ "Savepoint",
22113 /* 34 */ "AutoCommit",
22114 /* 35 */ "Transaction",
22115 /* 36 */ "ReadCookie",
22116 /* 37 */ "SetCookie",
22117 /* 38 */ "VerifyCookie",
22118 /* 39 */ "OpenRead",
22119 /* 40 */ "OpenWrite",
22120 /* 41 */ "OpenAutoindex",
22121 /* 42 */ "OpenEphemeral",
22122 /* 43 */ "SorterOpen",
22123 /* 44 */ "OpenPseudo",
22124 /* 45 */ "Close",
22125 /* 46 */ "SeekLt",
22126 /* 47 */ "SeekLe",
22127 /* 48 */ "SeekGe",
22128 /* 49 */ "SeekGt",
22129 /* 50 */ "Seek",
22130 /* 51 */ "NotFound",
22131 /* 52 */ "Found",
22132 /* 53 */ "IsUnique",
22133 /* 54 */ "NotExists",
22134 /* 55 */ "Sequence",
22135 /* 56 */ "NewRowid",
22136 /* 57 */ "Insert",
22137 /* 58 */ "InsertInt",
22138 /* 59 */ "Delete",
22139 /* 60 */ "ResetCount",
22140 /* 61 */ "SorterCompare",
22141 /* 62 */ "SorterData",
22142 /* 63 */ "RowKey",
22143 /* 64 */ "RowData",
22144 /* 65 */ "Rowid",
22145 /* 66 */ "NullRow",
22146 /* 67 */ "Last",
22147 /* 68 */ "Or",
22148 /* 69 */ "And",
22149 /* 70 */ "SorterSort",
22150 /* 71 */ "Sort",
22151 /* 72 */ "Rewind",
22152 /* 73 */ "IsNull",
22153 /* 74 */ "NotNull",
22154 /* 75 */ "Ne",
22155 /* 76 */ "Eq",
22156 /* 77 */ "Gt",
22157 /* 78 */ "Le",
22158 /* 79 */ "Lt",
22159 /* 80 */ "Ge",
22160 /* 81 */ "SorterNext",
22161 /* 82 */ "BitAnd",
22162 /* 83 */ "BitOr",
22163 /* 84 */ "ShiftLeft",
22164 /* 85 */ "ShiftRight",
22165 /* 86 */ "Add",
@@ -22212,76 +22166,76 @@
22166 /* 87 */ "Subtract",
22167 /* 88 */ "Multiply",
22168 /* 89 */ "Divide",
22169 /* 90 */ "Remainder",
22170 /* 91 */ "Concat",
22171 /* 92 */ "Prev",
22172 /* 93 */ "BitNot",
22173 /* 94 */ "String8",
22174 /* 95 */ "Next",
22175 /* 96 */ "SorterInsert",
22176 /* 97 */ "IdxInsert",
22177 /* 98 */ "IdxDelete",
22178 /* 99 */ "IdxRowid",
22179 /* 100 */ "IdxLT",
22180 /* 101 */ "IdxGE",
22181 /* 102 */ "Destroy",
22182 /* 103 */ "Clear",
22183 /* 104 */ "CreateIndex",
22184 /* 105 */ "CreateTable",
22185 /* 106 */ "ParseSchema",
22186 /* 107 */ "LoadAnalysis",
22187 /* 108 */ "DropTable",
22188 /* 109 */ "DropIndex",
22189 /* 110 */ "DropTrigger",
22190 /* 111 */ "IntegrityCk",
22191 /* 112 */ "RowSetAdd",
22192 /* 113 */ "RowSetRead",
22193 /* 114 */ "RowSetTest",
22194 /* 115 */ "Program",
22195 /* 116 */ "Param",
22196 /* 117 */ "FkCounter",
22197 /* 118 */ "FkIfZero",
22198 /* 119 */ "MemMax",
22199 /* 120 */ "IfPos",
22200 /* 121 */ "IfNeg",
22201 /* 122 */ "IfZero",
22202 /* 123 */ "AggStep",
22203 /* 124 */ "AggFinal",
22204 /* 125 */ "Checkpoint",
22205 /* 126 */ "JournalMode",
22206 /* 127 */ "Vacuum",
22207 /* 128 */ "IncrVacuum",
22208 /* 129 */ "Expire",
22209 /* 130 */ "Real",
22210 /* 131 */ "TableLock",
22211 /* 132 */ "VBegin",
22212 /* 133 */ "VCreate",
22213 /* 134 */ "VDestroy",
22214 /* 135 */ "VOpen",
22215 /* 136 */ "VFilter",
22216 /* 137 */ "VColumn",
22217 /* 138 */ "VNext",
22218 /* 139 */ "VRename",
22219 /* 140 */ "VUpdate",
22220 /* 141 */ "ToText",
22221 /* 142 */ "ToBlob",
22222 /* 143 */ "ToNumeric",
22223 /* 144 */ "ToInt",
22224 /* 145 */ "ToReal",
22225 /* 146 */ "Pagecount",
22226 /* 147 */ "MaxPgcnt",
22227 /* 148 */ "Trace",
22228 /* 149 */ "Noop",
22229 /* 150 */ "Explain",
22230 };
22231 return azName[i];
22232 }
22233 #endif
22234
22235 /************** End of opcodes.c *********************************************/
22236 /************** Begin file os_os2.c ******************************************/
 
22237 /*
22238 ** 2006 Feb 14
22239 **
22240 ** The author disclaims copyright to this source code. In place of
22241 ** a legal notice, here is a blessing:
@@ -22334,11 +22288,10 @@
22288 /*
22289 ** Include code that is common to all os_*.c files
22290 */
22291 /************** Include os_common.h in the middle of os_os2.c ****************/
22292 /************** Begin file os_common.h ***************************************/
 
22293 /*
22294 ** 2004 May 22
22295 **
22296 ** The author disclaims copyright to this source code. In place of
22297 ** a legal notice, here is a blessing:
@@ -22388,11 +22341,10 @@
22341 ** hwtime.h contains inline assembler code for implementing
22342 ** high-performance timing routines.
22343 */
22344 /************** Include hwtime.h in the middle of os_common.h ****************/
22345 /************** Begin file hwtime.h ******************************************/
 
22346 /*
22347 ** 2008 May 27
22348 **
22349 ** The author disclaims copyright to this source code. In place of
22350 ** a legal notice, here is a blessing:
@@ -22477,11 +22429,10 @@
22429
22430 #endif /* !defined(_HWTIME_H_) */
22431
22432 /************** End of hwtime.h **********************************************/
22433 /************** Continuing where we left off in os_common.h ******************/
 
22434
22435 static sqlite_uint64 g_start;
22436 static sqlite_uint64 g_elapsed;
22437 #define TIMER_START g_start=sqlite3Hwtime()
22438 #define TIMER_END g_elapsed=sqlite3Hwtime()-g_start
@@ -22544,11 +22495,10 @@
22495
22496 #endif /* !defined(_OS_COMMON_H_) */
22497
22498 /************** End of os_common.h *******************************************/
22499 /************** Continuing where we left off in os_os2.c *********************/
 
22500
22501 /* Forward references */
22502 typedef struct os2File os2File; /* The file structure */
22503 typedef struct os2ShmNode os2ShmNode; /* A shared descritive memory node */
22504 typedef struct os2ShmLink os2ShmLink; /* A connection to shared-memory */
@@ -24416,11 +24366,10 @@
24366
24367 #endif /* SQLITE_OS_OS2 */
24368
24369 /************** End of os_os2.c **********************************************/
24370 /************** Begin file os_unix.c *****************************************/
 
24371 /*
24372 ** 2004 May 22
24373 **
24374 ** The author disclaims copyright to this source code. In place of
24375 ** a legal notice, here is a blessing:
@@ -24681,11 +24630,10 @@
24630 /*
24631 ** Include code that is common to all os_*.c files
24632 */
24633 /************** Include os_common.h in the middle of os_unix.c ***************/
24634 /************** Begin file os_common.h ***************************************/
 
24635 /*
24636 ** 2004 May 22
24637 **
24638 ** The author disclaims copyright to this source code. In place of
24639 ** a legal notice, here is a blessing:
@@ -24735,11 +24683,10 @@
24683 ** hwtime.h contains inline assembler code for implementing
24684 ** high-performance timing routines.
24685 */
24686 /************** Include hwtime.h in the middle of os_common.h ****************/
24687 /************** Begin file hwtime.h ******************************************/
 
24688 /*
24689 ** 2008 May 27
24690 **
24691 ** The author disclaims copyright to this source code. In place of
24692 ** a legal notice, here is a blessing:
@@ -24824,11 +24771,10 @@
24771
24772 #endif /* !defined(_HWTIME_H_) */
24773
24774 /************** End of hwtime.h **********************************************/
24775 /************** Continuing where we left off in os_common.h ******************/
 
24776
24777 static sqlite_uint64 g_start;
24778 static sqlite_uint64 g_elapsed;
24779 #define TIMER_START g_start=sqlite3Hwtime()
24780 #define TIMER_END g_elapsed=sqlite3Hwtime()-g_start
@@ -24891,11 +24837,10 @@
24837
24838 #endif /* !defined(_OS_COMMON_H_) */
24839
24840 /************** End of os_common.h *******************************************/
24841 /************** Continuing where we left off in os_unix.c ********************/
 
24842
24843 /*
24844 ** Define various macros that are missing from some systems.
24845 */
24846 #ifndef O_LARGEFILE
@@ -31401,11 +31346,10 @@
31346
31347 #endif /* SQLITE_OS_UNIX */
31348
31349 /************** End of os_unix.c *********************************************/
31350 /************** Begin file os_win.c ******************************************/
 
31351 /*
31352 ** 2004 May 22
31353 **
31354 ** The author disclaims copyright to this source code. In place of
31355 ** a legal notice, here is a blessing:
@@ -31463,11 +31407,10 @@
31407 /*
31408 ** Include code that is common to all os_*.c files
31409 */
31410 /************** Include os_common.h in the middle of os_win.c ****************/
31411 /************** Begin file os_common.h ***************************************/
 
31412 /*
31413 ** 2004 May 22
31414 **
31415 ** The author disclaims copyright to this source code. In place of
31416 ** a legal notice, here is a blessing:
@@ -31517,11 +31460,10 @@
31460 ** hwtime.h contains inline assembler code for implementing
31461 ** high-performance timing routines.
31462 */
31463 /************** Include hwtime.h in the middle of os_common.h ****************/
31464 /************** Begin file hwtime.h ******************************************/
 
31465 /*
31466 ** 2008 May 27
31467 **
31468 ** The author disclaims copyright to this source code. In place of
31469 ** a legal notice, here is a blessing:
@@ -31606,11 +31548,10 @@
31548
31549 #endif /* !defined(_HWTIME_H_) */
31550
31551 /************** End of hwtime.h **********************************************/
31552 /************** Continuing where we left off in os_common.h ******************/
 
31553
31554 static sqlite_uint64 g_start;
31555 static sqlite_uint64 g_elapsed;
31556 #define TIMER_START g_start=sqlite3Hwtime()
31557 #define TIMER_END g_elapsed=sqlite3Hwtime()-g_start
@@ -31673,11 +31614,10 @@
31614
31615 #endif /* !defined(_OS_COMMON_H_) */
31616
31617 /************** End of os_common.h *******************************************/
31618 /************** Continuing where we left off in os_win.c *********************/
 
31619
31620 /*
31621 ** Some microsoft compilers lack this definition.
31622 */
31623 #ifndef INVALID_FILE_ATTRIBUTES
@@ -32860,13 +32800,23 @@
32800
32801 /*
32802 ** Make sure all writes to a particular file are committed to disk.
32803 */
32804 static int winSync(sqlite3_file *id, int flags){
32805 #ifndef SQLITE_NO_SYNC
32806 /*
32807 ** Used only when SQLITE_NO_SYNC is not defined.
32808 */
32809 BOOL rc;
32810 #endif
32811 #if !defined(NDEBUG) || !defined(SQLITE_NO_SYNC) || \
32812 (defined(SQLITE_TEST) && defined(SQLITE_DEBUG))
32813 /*
32814 ** Used when SQLITE_NO_SYNC is not defined and by the assert() and/or
32815 ** OSTRACE() macros.
32816 */
32817 winFile *pFile = (winFile*)id;
32818 #else
32819 UNUSED_PARAMETER(id);
32820 #endif
32821
32822 assert( pFile );
@@ -34809,11 +34759,10 @@
34759
34760 #endif /* SQLITE_OS_WIN */
34761
34762 /************** End of os_win.c **********************************************/
34763 /************** Begin file bitvec.c ******************************************/
 
34764 /*
34765 ** 2008 February 16
34766 **
34767 ** The author disclaims copyright to this source code. In place of
34768 ** a legal notice, here is a blessing:
@@ -35220,11 +35169,10 @@
35169 }
35170 #endif /* SQLITE_OMIT_BUILTIN_TEST */
35171
35172 /************** End of bitvec.c **********************************************/
35173 /************** Begin file pcache.c ******************************************/
 
35174 /*
35175 ** 2008 August 05
35176 **
35177 ** The author disclaims copyright to this source code. In place of
35178 ** a legal notice, here is a blessing:
@@ -35817,11 +35765,10 @@
35765 }
35766 #endif
35767
35768 /************** End of pcache.c **********************************************/
35769 /************** Begin file pcache1.c *****************************************/
 
35770 /*
35771 ** 2008 November 05
35772 **
35773 ** The author disclaims copyright to this source code. In place of
35774 ** a legal notice, here is a blessing:
@@ -37034,11 +36981,10 @@
36981 }
36982 #endif
36983
36984 /************** End of pcache1.c *********************************************/
36985 /************** Begin file rowset.c ******************************************/
 
36986 /*
36987 ** 2008 December 3
36988 **
36989 ** The author disclaims copyright to this source code. In place of
36990 ** a legal notice, here is a blessing:
@@ -37459,11 +37405,10 @@
37405 return 0;
37406 }
37407
37408 /************** End of rowset.c **********************************************/
37409 /************** Begin file pager.c *******************************************/
 
37410 /*
37411 ** 2001 September 15
37412 **
37413 ** The author disclaims copyright to this source code. In place of
37414 ** a legal notice, here is a blessing:
@@ -37483,11 +37428,10 @@
37428 ** another is writing.
37429 */
37430 #ifndef SQLITE_OMIT_DISKIO
37431 /************** Include wal.h in the middle of pager.c ***********************/
37432 /************** Begin file wal.h *********************************************/
 
37433 /*
37434 ** 2010 February 1
37435 **
37436 ** The author disclaims copyright to this source code. In place of
37437 ** a legal notice, here is a blessing:
@@ -37608,11 +37552,10 @@
37552 #endif /* ifndef SQLITE_OMIT_WAL */
37553 #endif /* _WAL_H_ */
37554
37555 /************** End of wal.h *************************************************/
37556 /************** Continuing where we left off in pager.c **********************/
 
37557
37558
37559 /******************* NOTES ON THE DESIGN OF THE PAGER ************************
37560 **
37561 ** This comment block describes invariants that hold when using a rollback
@@ -44422,11 +44365,10 @@
44365
44366 #endif /* SQLITE_OMIT_DISKIO */
44367
44368 /************** End of pager.c ***********************************************/
44369 /************** Begin file wal.c *********************************************/
 
44370 /*
44371 ** 2010 February 1
44372 **
44373 ** The author disclaims copyright to this source code. In place of
44374 ** a legal notice, here is a blessing:
@@ -47377,11 +47319,10 @@
47319
47320 #endif /* #ifndef SQLITE_OMIT_WAL */
47321
47322 /************** End of wal.c *************************************************/
47323 /************** Begin file btmutex.c *****************************************/
 
47324 /*
47325 ** 2007 August 27
47326 **
47327 ** The author disclaims copyright to this source code. In place of
47328 ** a legal notice, here is a blessing:
@@ -47397,11 +47338,10 @@
47338 ** big and we want to break it down some. This packaged seemed like
47339 ** a good breakout.
47340 */
47341 /************** Include btreeInt.h in the middle of btmutex.c ****************/
47342 /************** Begin file btreeInt.h ****************************************/
 
47343 /*
47344 ** 2004 April 6
47345 **
47346 ** The author disclaims copyright to this source code. In place of
47347 ** a legal notice, here is a blessing:
@@ -48043,11 +47983,10 @@
47983 #define get4byte sqlite3Get4byte
47984 #define put4byte sqlite3Put4byte
47985
47986 /************** End of btreeInt.h ********************************************/
47987 /************** Continuing where we left off in btmutex.c ********************/
 
47988 #ifndef SQLITE_OMIT_SHARED_CACHE
47989 #if SQLITE_THREADSAFE
47990
47991 /*
47992 ** Obtain the BtShared mutex associated with B-Tree handle p. Also,
@@ -48316,11 +48255,10 @@
48255 #endif /* if SQLITE_THREADSAFE */
48256 #endif /* ifndef SQLITE_OMIT_SHARED_CACHE */
48257
48258 /************** End of btmutex.c *********************************************/
48259 /************** Begin file btree.c *******************************************/
 
48260 /*
48261 ** 2004 April 6
48262 **
48263 ** The author disclaims copyright to this source code. In place of
48264 ** a legal notice, here is a blessing:
@@ -48982,11 +48920,11 @@
48920 assert( nKey==(i64)(int)nKey );
48921 pIdxKey = sqlite3VdbeAllocUnpackedRecord(
48922 pCur->pKeyInfo, aSpace, sizeof(aSpace), &pFree
48923 );
48924 if( pIdxKey==0 ) return SQLITE_NOMEM;
48925 sqlite3VdbeRecordUnpack(pCur->pKeyInfo, (int)nKey, pKey, pIdxKey);
48926 }else{
48927 pIdxKey = 0;
48928 }
48929 rc = sqlite3BtreeMovetoUnpacked(pCur, pIdxKey, nKey, bias, pRes);
48930 if( pFree ){
@@ -56504,11 +56442,10 @@
56442 return rc;
56443 }
56444
56445 /************** End of btree.c ***********************************************/
56446 /************** Begin file backup.c ******************************************/
 
56447 /*
56448 ** 2009 January 28
56449 **
56450 ** The author disclaims copyright to this source code. In place of
56451 ** a legal notice, here is a blessing:
@@ -57211,11 +57148,10 @@
57148 }
57149 #endif /* SQLITE_OMIT_VACUUM */
57150
57151 /************** End of backup.c **********************************************/
57152 /************** Begin file vdbemem.c *****************************************/
 
57153 /*
57154 ** 2004 May 26
57155 **
57156 ** The author disclaims copyright to this source code. In place of
57157 ** a legal notice, here is a blessing:
@@ -58366,11 +58302,10 @@
58302 return 0;
58303 }
58304
58305 /************** End of vdbemem.c *********************************************/
58306 /************** Begin file vdbeaux.c *****************************************/
 
58307 /*
58308 ** 2003 September 6
58309 **
58310 ** The author disclaims copyright to this source code. In place of
58311 ** a legal notice, here is a blessing:
@@ -59037,22 +58972,19 @@
58972 p->pNext = pVdbe->pProgram;
58973 pVdbe->pProgram = p;
58974 }
58975
58976 /*
58977 ** Change the opcode at addr into OP_Noop
58978 */
58979 SQLITE_PRIVATE void sqlite3VdbeChangeToNoop(Vdbe *p, int addr){
58980 if( p->aOp ){
58981 VdbeOp *pOp = &p->aOp[addr];
58982 sqlite3 *db = p->db;
58983 freeP4(db, pOp->p4type, pOp->p4.p);
58984 memset(pOp, 0, sizeof(pOp[0]));
58985 pOp->opcode = OP_Noop;
 
 
 
58986 }
58987 }
58988
58989 /*
58990 ** Change the value of the P4 operand for a specific instruction.
@@ -59204,11 +59136,11 @@
59136 ** check the value of p->nOp-1 before continuing.
59137 */
59138 SQLITE_PRIVATE VdbeOp *sqlite3VdbeGetOp(Vdbe *p, int addr){
59139 /* C89 specifies that the constant "dummy" will be initialized to all
59140 ** zeros, which is correct. MSVC generates a warning, nevertheless. */
59141 static VdbeOp dummy; /* Ignore the MSVC warning about no initializer */
59142 assert( p->magic==VDBE_MAGIC_INIT );
59143 if( addr<0 ){
59144 #ifdef SQLITE_OMIT_TRACE
59145 if( p->nOp==0 ) return (VdbeOp*)&dummy;
59146 #endif
@@ -61609,11 +61541,10 @@
61541 }
61542 }
61543
61544 /************** End of vdbeaux.c *********************************************/
61545 /************** Begin file vdbeapi.c *****************************************/
 
61546 /*
61547 ** 2004 May 26
61548 **
61549 ** The author disclaims copyright to this source code. In place of
61550 ** a legal notice, here is a blessing:
@@ -62917,11 +62848,10 @@
62848 return v;
62849 }
62850
62851 /************** End of vdbeapi.c *********************************************/
62852 /************** Begin file vdbetrace.c ***************************************/
 
62853 /*
62854 ** 2009 November 25
62855 **
62856 ** The author disclaims copyright to this source code. In place of
62857 ** a legal notice, here is a blessing:
@@ -63073,11 +63003,10 @@
63003
63004 #endif /* #ifndef SQLITE_OMIT_TRACE */
63005
63006 /************** End of vdbetrace.c *******************************************/
63007 /************** Begin file vdbe.c ********************************************/
 
63008 /*
63009 ** 2001 September 15
63010 **
63011 ** The author disclaims copyright to this source code. In place of
63012 ** a legal notice, here is a blessing:
@@ -63543,11 +63472,10 @@
63472 ** hwtime.h contains inline assembler code for implementing
63473 ** high-performance timing routines.
63474 */
63475 /************** Include hwtime.h in the middle of vdbe.c *********************/
63476 /************** Begin file hwtime.h ******************************************/
 
63477 /*
63478 ** 2008 May 27
63479 **
63480 ** The author disclaims copyright to this source code. In place of
63481 ** a legal notice, here is a blessing:
@@ -63632,11 +63560,10 @@
63560
63561 #endif /* !defined(_HWTIME_H_) */
63562
63563 /************** End of hwtime.h **********************************************/
63564 /************** Continuing where we left off in vdbe.c ***********************/
 
63565
63566 #endif
63567
63568 /*
63569 ** The CHECK_FOR_INTERRUPT macro defined here looks to see if the
@@ -65627,10 +65554,20 @@
65554 sqlite3VdbeMemSetInt64(pOut, ~sqlite3VdbeIntValue(pIn1));
65555 }
65556 break;
65557 }
65558
65559 /* Opcode: Once P1 P2 * * *
65560 **
65561 ** Jump to P2 if the value in register P1 is a not null or zero. If
65562 ** the value is NULL or zero, fall through and change the P1 register
65563 ** to an integer 1.
65564 **
65565 ** When P1 is not used otherwise in a program, this opcode falls through
65566 ** once and jumps on all subsequent invocations. It is the equivalent
65567 ** of "OP_If P1 P2", followed by "OP_Integer 1 P1".
65568 */
65569 /* Opcode: If P1 P2 P3 * *
65570 **
65571 ** Jump to P2 if the value in register P1 is true. The value
65572 ** is considered true if it is numeric and non-zero. If the value
65573 ** in P1 is NULL then take the jump if P3 is true.
@@ -65639,10 +65576,11 @@
65576 **
65577 ** Jump to P2 if the value in register P1 is False. The value
65578 ** is considered true if it has a numeric value of zero. If the value
65579 ** in P1 is NULL then take the jump if P3 is true.
65580 */
65581 case OP_Once: /* jump, in1 */
65582 case OP_If: /* jump, in1 */
65583 case OP_IfNot: { /* jump, in1 */
65584 #if 0 /* local variables moved into u.al */
65585 int c;
65586 #endif /* local variables moved into u.al */
@@ -65657,10 +65595,16 @@
65595 #endif
65596 if( pOp->opcode==OP_IfNot ) u.al.c = !u.al.c;
65597 }
65598 if( u.al.c ){
65599 pc = pOp->p2-1;
65600 }else if( pOp->opcode==OP_Once ){
65601 assert( (pIn1->flags & (MEM_Agg|MEM_Dyn|MEM_RowSet|MEM_Frame))==0 );
65602 memAboutToChange(p, pIn1);
65603 pIn1->flags = MEM_Int;
65604 pIn1->u.i = 1;
65605 REGISTER_TRACE(pOp->p1, pIn1);
65606 }
65607 break;
65608 }
65609
65610 /* Opcode: IsNull P1 P2 * * *
@@ -69860,11 +69804,10 @@
69804 goto vdbe_error_halt;
69805 }
69806
69807 /************** End of vdbe.c ************************************************/
69808 /************** Begin file vdbeblob.c ****************************************/
 
69809 /*
69810 ** 2007 May 1
69811 **
69812 ** The author disclaims copyright to this source code. In place of
69813 ** a legal notice, here is a blessing:
@@ -70134,21 +70077,21 @@
70077 /* Make sure a mutex is held on the table to be accessed */
70078 sqlite3VdbeUsesBtree(v, iDb);
70079
70080 /* Configure the OP_TableLock instruction */
70081 #ifdef SQLITE_OMIT_SHARED_CACHE
70082 sqlite3VdbeChangeToNoop(v, 2);
70083 #else
70084 sqlite3VdbeChangeP1(v, 2, iDb);
70085 sqlite3VdbeChangeP2(v, 2, pTab->tnum);
70086 sqlite3VdbeChangeP3(v, 2, flags);
70087 sqlite3VdbeChangeP4(v, 2, pTab->zName, P4_TRANSIENT);
70088 #endif
70089
70090 /* Remove either the OP_OpenWrite or OpenRead. Set the P2
70091 ** parameter of the other to pTab->tnum. */
70092 sqlite3VdbeChangeToNoop(v, 4 - flags);
70093 sqlite3VdbeChangeP2(v, 3 + flags, pTab->tnum);
70094 sqlite3VdbeChangeP3(v, 3 + flags, iDb);
70095
70096 /* Configure the number of columns. Configure the cursor to
70097 ** think that the table has one more column than it really
@@ -70331,11 +70274,10 @@
70274
70275 #endif /* #ifndef SQLITE_OMIT_INCRBLOB */
70276
70277 /************** End of vdbeblob.c ********************************************/
70278 /************** Begin file vdbesort.c ****************************************/
 
70279 /*
70280 ** 2011 July 9
70281 **
70282 ** The author disclaims copyright to this source code. In place of
70283 ** a legal notice, here is a blessing:
@@ -70492,12 +70434,16 @@
70434 int rc; /* Return Code */
70435 int nRead; /* Number of bytes read */
70436 int nRec = 0; /* Size of record in bytes */
70437 int iOff = 0; /* Size of serialized size varint in bytes */
70438
70439 assert( pIter->iEof>=pIter->iReadOff );
70440 if( pIter->iEof-pIter->iReadOff>5 ){
70441 nRead = 5;
70442 }else{
70443 nRead = (int)(pIter->iEof - pIter->iReadOff);
70444 }
70445 if( nRead<=0 ){
70446 /* This is an EOF condition */
70447 vdbeSorterIterZero(db, pIter);
70448 return SQLITE_OK;
70449 }
@@ -71211,11 +71157,10 @@
71157
71158 #endif /* #ifndef SQLITE_OMIT_MERGE_SORT */
71159
71160 /************** End of vdbesort.c ********************************************/
71161 /************** Begin file journal.c *****************************************/
 
71162 /*
71163 ** 2007 August 22
71164 **
71165 ** The author disclaims copyright to this source code. In place of
71166 ** a legal notice, here is a blessing:
@@ -71452,11 +71397,10 @@
71397 }
71398 #endif
71399
71400 /************** End of journal.c *********************************************/
71401 /************** Begin file memjournal.c **************************************/
 
71402 /*
71403 ** 2008 October 7
71404 **
71405 ** The author disclaims copyright to this source code. In place of
71406 ** a legal notice, here is a blessing:
@@ -71714,11 +71658,10 @@
71658 return sizeof(MemJournal);
71659 }
71660
71661 /************** End of memjournal.c ******************************************/
71662 /************** Begin file walker.c ******************************************/
 
71663 /*
71664 ** 2008 August 16
71665 **
71666 ** The author disclaims copyright to this source code. In place of
71667 ** a legal notice, here is a blessing:
@@ -71853,11 +71796,10 @@
71796 return rc & WRC_Abort;
71797 }
71798
71799 /************** End of walker.c **********************************************/
71800 /************** Begin file resolve.c *****************************************/
 
71801 /*
71802 ** 2008 August 18
71803 **
71804 ** The author disclaims copyright to this source code. In place of
71805 ** a legal notice, here is a blessing:
@@ -73074,11 +73016,10 @@
73016 sqlite3WalkSelect(&w, p);
73017 }
73018
73019 /************** End of resolve.c *********************************************/
73020 /************** Begin file expr.c ********************************************/
 
73021 /*
73022 ** 2001 September 15
73023 **
73024 ** The author disclaims copyright to this source code. In place of
73025 ** a legal notice, here is a blessing:
@@ -73977,11 +73918,12 @@
73918 pNewItem->zDatabase = sqlite3DbStrDup(db, pOldItem->zDatabase);
73919 pNewItem->zName = sqlite3DbStrDup(db, pOldItem->zName);
73920 pNewItem->zAlias = sqlite3DbStrDup(db, pOldItem->zAlias);
73921 pNewItem->jointype = pOldItem->jointype;
73922 pNewItem->iCursor = pOldItem->iCursor;
73923 pNewItem->addrFillSub = pOldItem->addrFillSub;
73924 pNewItem->regReturn = pOldItem->regReturn;
73925 pNewItem->isCorrelated = pOldItem->isCorrelated;
73926 pNewItem->zIndex = sqlite3DbStrDup(db, pOldItem->zIndex);
73927 pNewItem->notIndexed = pOldItem->notIndexed;
73928 pNewItem->pIndex = pOldItem->pIndex;
73929 pTab = pNewItem->pTab = pOldItem->pTab;
@@ -74537,12 +74479,11 @@
74479 assert(v);
74480 if( iCol<0 ){
74481 int iMem = ++pParse->nMem;
74482 int iAddr;
74483
74484 iAddr = sqlite3VdbeAddOp1(v, OP_Once, iMem);
 
74485
74486 sqlite3OpenTable(pParse, iTab, iDb, pTab, OP_OpenRead);
74487 eType = IN_INDEX_ROWID;
74488
74489 sqlite3VdbeJumpHere(v, iAddr);
@@ -74569,12 +74510,11 @@
74510 int iMem = ++pParse->nMem;
74511 int iAddr;
74512 char *pKey;
74513
74514 pKey = (char *)sqlite3IndexKeyinfo(pParse, pIdx);
74515 iAddr = sqlite3VdbeAddOp1(v, OP_Once, iMem);
 
74516
74517 sqlite3VdbeAddOp4(v, OP_OpenRead, iTab, pIdx->tnum, iDb,
74518 pKey,P4_KEYINFO_HANDOFF);
74519 VdbeComment((v, "%s", pIdx->zName));
74520 eType = IN_INDEX_INDEX;
@@ -74651,11 +74591,11 @@
74591 Parse *pParse, /* Parsing context */
74592 Expr *pExpr, /* The IN, SELECT, or EXISTS operator */
74593 int rMayHaveNull, /* Register that records whether NULLs exist in RHS */
74594 int isRowid /* If true, LHS of IN operator is a rowid */
74595 ){
74596 int testAddr = -1; /* One-time test address */
74597 int rReg = 0; /* Register storing resulting */
74598 Vdbe *v = sqlite3GetVdbe(pParse);
74599 if( NEVER(v==0) ) return 0;
74600 sqlite3ExprCachePush(pParse);
74601
@@ -74669,19 +74609,17 @@
74609 ** If all of the above are false, then we can run this code just once
74610 ** save the results, and reuse the same result on subsequent invocations.
74611 */
74612 if( !ExprHasAnyProperty(pExpr, EP_VarSelect) && !pParse->pTriggerTab ){
74613 int mem = ++pParse->nMem;
74614 testAddr = sqlite3VdbeAddOp1(v, OP_Once, mem);
 
 
74615 }
74616
74617 #ifndef SQLITE_OMIT_EXPLAIN
74618 if( pParse->explain==2 ){
74619 char *zMsg = sqlite3MPrintf(
74620 pParse->db, "EXECUTE %s%s SUBQUERY %d", testAddr>=0?"":"CORRELATED ",
74621 pExpr->op==TK_IN?"LIST":"SCALAR", pParse->iNextSelectId
74622 );
74623 sqlite3VdbeAddOp4(v, OP_Explain, pParse->iSelectId, 0, 0, zMsg, P4_DYNAMIC);
74624 }
74625 #endif
@@ -74769,13 +74707,13 @@
74707 /* If the expression is not constant then we will need to
74708 ** disable the test that was generated above that makes sure
74709 ** this code only executes once. Because for a non-constant
74710 ** expression we need to rerun this code each time.
74711 */
74712 if( testAddr>=0 && !sqlite3ExprIsConstant(pE2) ){
74713 sqlite3VdbeChangeToNoop(v, testAddr);
74714 testAddr = -1;
74715 }
74716
74717 /* Evaluate the expression and insert it into the temp table */
74718 if( isRowid && sqlite3ExprIsInteger(pE2, &iValToIns) ){
74719 sqlite3VdbeAddOp3(v, OP_InsertInt, pExpr->iTable, r2, iValToIns);
@@ -74840,12 +74778,12 @@
74778 ExprSetIrreducible(pExpr);
74779 break;
74780 }
74781 }
74782
74783 if( testAddr>=0 ){
74784 sqlite3VdbeJumpHere(v, testAddr);
74785 }
74786 sqlite3ExprCachePop(pParse, 1);
74787
74788 return rReg;
74789 }
@@ -76835,11 +76773,10 @@
76773 }
76774 }
76775
76776 /************** End of expr.c ************************************************/
76777 /************** Begin file alter.c *******************************************/
 
76778 /*
76779 ** 2005 February 15
76780 **
76781 ** The author disclaims copyright to this source code. In place of
76782 ** a legal notice, here is a blessing:
@@ -77664,11 +77601,10 @@
77601 }
77602 #endif /* SQLITE_ALTER_TABLE */
77603
77604 /************** End of alter.c ***********************************************/
77605 /************** Begin file analyze.c *****************************************/
 
77606 /*
77607 ** 2005 July 8
77608 **
77609 ** The author disclaims copyright to this source code. In place of
77610 ** a legal notice, here is a blessing:
@@ -78386,11 +78322,10 @@
78322
78323 #endif /* SQLITE_OMIT_ANALYZE */
78324
78325 /************** End of analyze.c *********************************************/
78326 /************** Begin file attach.c ******************************************/
 
78327 /*
78328 ** 2003 April 6
78329 **
78330 ** The author disclaims copyright to this source code. In place of
78331 ** a legal notice, here is a blessing:
@@ -78946,11 +78881,10 @@
78881 }
78882 #endif
78883
78884 /************** End of attach.c **********************************************/
78885 /************** Begin file auth.c ********************************************/
 
78886 /*
78887 ** 2003 January 11
78888 **
78889 ** The author disclaims copyright to this source code. In place of
78890 ** a legal notice, here is a blessing:
@@ -79198,11 +79132,10 @@
79132
79133 #endif /* SQLITE_OMIT_AUTHORIZATION */
79134
79135 /************** End of auth.c ************************************************/
79136 /************** Begin file build.c *******************************************/
 
79137 /*
79138 ** 2001 September 15
79139 **
79140 ** The author disclaims copyright to this source code. In place of
79141 ** a legal notice, here is a blessing:
@@ -83002,11 +82935,10 @@
82935 return pKey;
82936 }
82937
82938 /************** End of build.c ***********************************************/
82939 /************** Begin file callback.c ****************************************/
 
82940 /*
82941 ** 2005 May 23
82942 **
82943 ** The author disclaims copyright to this source code. In place of
82944 ** a legal notice, here is a blessing:
@@ -83462,11 +83394,10 @@
83394 return p;
83395 }
83396
83397 /************** End of callback.c ********************************************/
83398 /************** Begin file delete.c ******************************************/
 
83399 /*
83400 ** 2001 September 15
83401 **
83402 ** The author disclaims copyright to this source code. In place of
83403 ** a legal notice, here is a blessing:
@@ -84117,11 +84048,10 @@
84048 return regBase;
84049 }
84050
84051 /************** End of delete.c **********************************************/
84052 /************** Begin file func.c ********************************************/
 
84053 /*
84054 ** 2002 February 23
84055 **
84056 ** The author disclaims copyright to this source code. In place of
84057 ** a legal notice, here is a blessing:
@@ -85726,11 +85656,10 @@
85656 #endif
85657 }
85658
85659 /************** End of func.c ************************************************/
85660 /************** Begin file fkey.c ********************************************/
 
85661 /*
85662 **
85663 ** The author disclaims copyright to this source code. In place of
85664 ** a legal notice, here is a blessing:
85665 **
@@ -86947,11 +86876,10 @@
86876 }
86877 #endif /* ifndef SQLITE_OMIT_FOREIGN_KEY */
86878
86879 /************** End of fkey.c ************************************************/
86880 /************** Begin file insert.c ******************************************/
 
86881 /*
86882 ** 2001 September 15
86883 **
86884 ** The author disclaims copyright to this source code. In place of
86885 ** a legal notice, here is a blessing:
@@ -88793,11 +88721,10 @@
88721 }
88722 #endif /* SQLITE_OMIT_XFER_OPT */
88723
88724 /************** End of insert.c **********************************************/
88725 /************** Begin file legacy.c ******************************************/
 
88726 /*
88727 ** 2001 September 15
88728 **
88729 ** The author disclaims copyright to this source code. In place of
88730 ** a legal notice, here is a blessing:
@@ -88941,11 +88868,10 @@
88868 return rc;
88869 }
88870
88871 /************** End of legacy.c **********************************************/
88872 /************** Begin file loadext.c *****************************************/
 
88873 /*
88874 ** 2006 June 7
88875 **
88876 ** The author disclaims copyright to this source code. In place of
88877 ** a legal notice, here is a blessing:
@@ -88962,11 +88888,10 @@
88888 #ifndef SQLITE_CORE
88889 #define SQLITE_CORE 1 /* Disable the API redefinition in sqlite3ext.h */
88890 #endif
88891 /************** Include sqlite3ext.h in the middle of loadext.c **************/
88892 /************** Begin file sqlite3ext.h **************************************/
 
88893 /*
88894 ** 2006 June 7
88895 **
88896 ** The author disclaims copyright to this source code. In place of
88897 ** a legal notice, here is a blessing:
@@ -89391,11 +89316,10 @@
89316
89317 #endif /* _SQLITE3EXT_H_ */
89318
89319 /************** End of sqlite3ext.h ******************************************/
89320 /************** Continuing where we left off in loadext.c ********************/
 
89321 /* #include <string.h> */
89322
89323 #ifndef SQLITE_OMIT_LOAD_EXTENSION
89324
89325 /*
@@ -90031,11 +89955,10 @@
89955 }
89956 }
89957
89958 /************** End of loadext.c *********************************************/
89959 /************** Begin file pragma.c ******************************************/
 
89960 /*
89961 ** 2003 April 6
89962 **
89963 ** The author disclaims copyright to this source code. In place of
89964 ** a legal notice, here is a blessing:
@@ -91560,11 +91483,10 @@
91483
91484 #endif /* SQLITE_OMIT_PRAGMA */
91485
91486 /************** End of pragma.c **********************************************/
91487 /************** Begin file prepare.c *****************************************/
 
91488 /*
91489 ** 2005 May 25
91490 **
91491 ** The author disclaims copyright to this source code. In place of
91492 ** a legal notice, here is a blessing:
@@ -92421,11 +92343,10 @@
92343
92344 #endif /* SQLITE_OMIT_UTF16 */
92345
92346 /************** End of prepare.c *********************************************/
92347 /************** Begin file select.c ******************************************/
 
92348 /*
92349 ** 2001 September 15
92350 **
92351 ** The author disclaims copyright to this source code. In place of
92352 ** a legal notice, here is a blessing:
@@ -92512,10 +92433,12 @@
92433 pNew->addrOpenEphm[2] = -1;
92434 if( db->mallocFailed ) {
92435 clearSelect(db, pNew);
92436 if( pNew!=&standin ) sqlite3DbFree(db, pNew);
92437 pNew = 0;
92438 }else{
92439 assert( pNew->pSrc!=0 || pParse->nErr>0 );
92440 }
92441 return pNew;
92442 }
92443
92444 /*
@@ -96224,11 +96147,15 @@
96147 struct SrcList_item *pItem = &pTabList->a[i];
96148 SelectDest dest;
96149 Select *pSub = pItem->pSelect;
96150 int isAggSub;
96151
96152 if( pSub==0 ) continue;
96153 if( pItem->addrFillSub ){
96154 sqlite3VdbeAddOp2(v, OP_Gosub, pItem->regReturn, pItem->addrFillSub);
96155 continue;
96156 }
96157
96158 /* Increment Parse.nHeight by the height of the largest expression
96159 ** tree refered to by this, the parent select. The child select
96160 ** may contain expression trees of at most
96161 ** (SQLITE_MAX_EXPR_DEPTH-Parse.nHeight) height. This is a bit
@@ -96235,25 +96162,48 @@
96162 ** more conservative than necessary, but much easier than enforcing
96163 ** an exact limit.
96164 */
96165 pParse->nHeight += sqlite3SelectExprHeight(p);
96166
 
96167 isAggSub = (pSub->selFlags & SF_Aggregate)!=0;
96168 if( flattenSubquery(pParse, p, i, isAgg, isAggSub) ){
96169 /* This subquery can be absorbed into its parent. */
96170 if( isAggSub ){
96171 isAgg = 1;
96172 p->selFlags |= SF_Aggregate;
96173 }
96174 i = -1;
96175 }else{
96176 /* Generate a subroutine that will fill an ephemeral table with
96177 ** the content of this subquery. pItem->addrFillSub will point
96178 ** to the address of the generated subroutine. pItem->regReturn
96179 ** is a register allocated to hold the subroutine return address
96180 */
96181 int topAddr;
96182 int onceAddr = 0;
96183 int retAddr;
96184 assert( pItem->addrFillSub==0 );
96185 pItem->regReturn = ++pParse->nMem;
96186 topAddr = sqlite3VdbeAddOp2(v, OP_Integer, 0, pItem->regReturn);
96187 pItem->addrFillSub = topAddr+1;
96188 VdbeNoopComment((v, "materialize %s", pItem->pTab->zName));
96189 if( pItem->isCorrelated==0 && pParse->pTriggerTab==0 ){
96190 /* If the subquery is no correlated and if we are not inside of
96191 ** a trigger, then we only need to compute the value of the subquery
96192 ** once. */
96193 int regOnce = ++pParse->nMem;
96194 onceAddr = sqlite3VdbeAddOp1(v, OP_Once, regOnce);
96195 }
96196 sqlite3SelectDestInit(&dest, SRT_EphemTab, pItem->iCursor);
 
96197 explainSetInteger(pItem->iSelectId, (u8)pParse->iNextSelectId);
96198 sqlite3Select(pParse, pSub, &dest);
 
96199 pItem->pTab->nRowEst = (unsigned)pSub->nSelectRow;
96200 if( onceAddr ) sqlite3VdbeJumpHere(v, onceAddr);
96201 retAddr = sqlite3VdbeAddOp1(v, OP_Return, pItem->regReturn);
96202 VdbeComment((v, "end %s", pItem->pTab->zName));
96203 sqlite3VdbeChangeP1(v, topAddr, retAddr);
96204
96205 }
96206 if( /*pParse->nErr ||*/ db->mallocFailed ){
96207 goto select_end;
96208 }
96209 pParse->nHeight -= sqlite3SelectExprHeight(p);
@@ -96390,11 +96340,11 @@
96340 /* If sorting index that was created by a prior OP_OpenEphemeral
96341 ** instruction ended up not being needed, then change the OP_OpenEphemeral
96342 ** into an OP_Noop.
96343 */
96344 if( addrSortIndex>=0 && pOrderBy==0 ){
96345 sqlite3VdbeChangeToNoop(v, addrSortIndex);
96346 p->addrOpenEphm[2] = -1;
96347 }
96348
96349 if( pWInfo->eDistinct ){
96350 VdbeOp *pOp; /* No longer required OpenEphemeral instr. */
@@ -96673,11 +96623,11 @@
96623 */
96624 if( groupBySort ){
96625 sqlite3VdbeAddOp2(v, OP_SorterNext, sAggInfo.sortingIdx, addrTopOfLoop);
96626 }else{
96627 sqlite3WhereEnd(pWInfo);
96628 sqlite3VdbeChangeToNoop(v, addrSortingIdx);
96629 }
96630
96631 /* Output the final row of result
96632 */
96633 sqlite3VdbeAddOp2(v, OP_Gosub, regOutputRow, addrOutputRow);
@@ -96981,11 +96931,10 @@
96931 *****************************************************************************/
96932 #endif /* defined(SQLITE_TEST) || defined(SQLITE_DEBUG) */
96933
96934 /************** End of select.c **********************************************/
96935 /************** Begin file table.c *******************************************/
 
96936 /*
96937 ** 2001 September 15
96938 **
96939 ** The author disclaims copyright to this source code. In place of
96940 ** a legal notice, here is a blessing:
@@ -97181,11 +97130,10 @@
97130
97131 #endif /* SQLITE_OMIT_GET_TABLE */
97132
97133 /************** End of table.c ***********************************************/
97134 /************** Begin file trigger.c *****************************************/
 
97135 /*
97136 **
97137 ** The author disclaims copyright to this source code. In place of
97138 ** a legal notice, here is a blessing:
97139 **
@@ -98307,11 +98255,10 @@
98255
98256 #endif /* !defined(SQLITE_OMIT_TRIGGER) */
98257
98258 /************** End of trigger.c *********************************************/
98259 /************** Begin file update.c ******************************************/
 
98260 /*
98261 ** 2001 September 15
98262 **
98263 ** The author disclaims copyright to this source code. In place of
98264 ** a legal notice, here is a blessing:
@@ -98980,11 +98927,10 @@
98927 }
98928 #endif /* SQLITE_OMIT_VIRTUALTABLE */
98929
98930 /************** End of update.c **********************************************/
98931 /************** Begin file vacuum.c ******************************************/
 
98932 /*
98933 ** 2003 April 6
98934 **
98935 ** The author disclaims copyright to this source code. In place of
98936 ** a legal notice, here is a blessing:
@@ -99327,11 +99273,10 @@
99273
99274 #endif /* SQLITE_OMIT_VACUUM && SQLITE_OMIT_ATTACH */
99275
99276 /************** End of vacuum.c **********************************************/
99277 /************** Begin file vtab.c ********************************************/
 
99278 /*
99279 ** 2006 June 10
99280 **
99281 ** The author disclaims copyright to this source code. In place of
99282 ** a legal notice, here is a blessing:
@@ -100396,11 +100341,10 @@
100341
100342 #endif /* SQLITE_OMIT_VIRTUALTABLE */
100343
100344 /************** End of vtab.c ************************************************/
100345 /************** Begin file where.c *******************************************/
 
100346 /*
100347 ** 2001 September 15
100348 **
100349 ** The author disclaims copyright to this source code. In place of
100350 ** a legal notice, here is a blessing:
@@ -100865,15 +100809,23 @@
100809 return mask;
100810 }
100811 static Bitmask exprSelectTableUsage(WhereMaskSet *pMaskSet, Select *pS){
100812 Bitmask mask = 0;
100813 while( pS ){
100814 SrcList *pSrc = pS->pSrc;
100815 mask |= exprListTableUsage(pMaskSet, pS->pEList);
100816 mask |= exprListTableUsage(pMaskSet, pS->pGroupBy);
100817 mask |= exprListTableUsage(pMaskSet, pS->pOrderBy);
100818 mask |= exprTableUsage(pMaskSet, pS->pWhere);
100819 mask |= exprTableUsage(pMaskSet, pS->pHaving);
100820 if( ALWAYS(pSrc!=0) ){
100821 int i;
100822 for(i=0; i<pSrc->nSrc; i++){
100823 mask |= exprSelectTableUsage(pMaskSet, pSrc->a[i].pSelect);
100824 mask |= exprTableUsage(pMaskSet, pSrc->a[i].pOn);
100825 }
100826 }
100827 pS = pS->pPrior;
100828 }
100829 return mask;
100830 }
100831
@@ -102392,12 +102344,11 @@
102344 /* Generate code to skip over the creation and initialization of the
102345 ** transient index on 2nd and subsequent iterations of the loop. */
102346 v = pParse->pVdbe;
102347 assert( v!=0 );
102348 regIsInit = ++pParse->nMem;
102349 addrInit = sqlite3VdbeAddOp1(v, OP_Once, regIsInit);
 
102350
102351 /* Count the number of columns that will be added to the index
102352 ** and used to match WHERE clause constraints */
102353 nColumn = 0;
102354 pTable = pSrc->pTab;
@@ -105583,11 +105534,10 @@
105534 return;
105535 }
105536
105537 /************** End of where.c ***********************************************/
105538 /************** Begin file parse.c *******************************************/
 
105539 /* Driver template for the LEMON parser generator.
105540 ** The author disclaims copyright to this source code.
105541 **
105542 ** This version of "lempar.c" is modified, slightly, for use by SQLite.
105543 ** The only modifications are the addition of a couple of NEVER()
@@ -105596,11 +105546,10 @@
105546 ** specific grammar used by SQLite.
105547 */
105548 /* First off, code is included that follows the "include" declaration
105549 ** in the input grammar file. */
105550 /* #include <stdio.h> */
 
105551
105552
105553 /*
105554 ** Disable all error recovery processing in the parser push-down
105555 ** automaton.
@@ -105644,11 +105593,10 @@
105593 /*
105594 ** An instance of this structure holds the ATTACH key and the key type.
105595 */
105596 struct AttachKey { int type; Token key; };
105597
 
105598
105599 /* This is a utility routine used to set the ExprSpan.zStart and
105600 ** ExprSpan.zEnd values of pOut so that the span covers the complete
105601 ** range of text beginning with pStart and going to the end of pEnd.
105602 */
@@ -105664,11 +105612,10 @@
105612 static void spanExpr(ExprSpan *pOut, Parse *pParse, int op, Token *pValue){
105613 pOut->pExpr = sqlite3PExpr(pParse, op, 0, 0, pValue);
105614 pOut->zStart = pValue->z;
105615 pOut->zEnd = &pValue->z[pValue->n];
105616 }
 
105617
105618 /* This routine constructs a binary expression node out of two ExprSpan
105619 ** objects and uses the result to populate a new ExprSpan object.
105620 */
105621 static void spanBinaryExpr(
@@ -105680,11 +105627,10 @@
105627 ){
105628 pOut->pExpr = sqlite3PExpr(pParse, op, pLeft->pExpr, pRight->pExpr, 0);
105629 pOut->zStart = pLeft->zStart;
105630 pOut->zEnd = pRight->zEnd;
105631 }
 
105632
105633 /* Construct an expression node for a unary postfix operator
105634 */
105635 static void spanUnaryPostfix(
105636 ExprSpan *pOut, /* Write the new expression node here */
@@ -105695,11 +105641,10 @@
105641 ){
105642 pOut->pExpr = sqlite3PExpr(pParse, op, pOperand->pExpr, 0, 0);
105643 pOut->zStart = pOperand->zStart;
105644 pOut->zEnd = &pPostOp->z[pPostOp->n];
105645 }
 
105646
105647 /* A routine to convert a binary TK_IS or TK_ISNOT expression into a
105648 ** unary TK_ISNULL or TK_NOTNULL expression. */
105649 static void binaryToUnaryIfNull(Parse *pParse, Expr *pY, Expr *pA, int op){
105650 sqlite3 *db = pParse->db;
@@ -105707,11 +105652,10 @@
105652 pA->op = (u8)op;
105653 sqlite3ExprDelete(db, pA->pRight);
105654 pA->pRight = 0;
105655 }
105656 }
 
105657
105658 /* Construct an expression node for a unary prefix operator
105659 */
105660 static void spanUnaryPrefix(
105661 ExprSpan *pOut, /* Write the new expression node here */
@@ -105722,11 +105666,10 @@
105666 ){
105667 pOut->pExpr = sqlite3PExpr(pParse, op, pOperand->pExpr, 0, 0);
105668 pOut->zStart = pPreOp->z;
105669 pOut->zEnd = pOperand->zEnd;
105670 }
 
105671 /* Next is all token values, in a form suitable for use by makeheaders.
105672 ** This section will be null unless lemon is run with the -m switch.
105673 */
105674 /*
105675 ** These constants (all generated automatically by the parser generator)
@@ -106978,21 +106921,17 @@
106921 ** inside the C code.
106922 */
106923 case 160: /* select */
106924 case 194: /* oneselect */
106925 {
 
106926 sqlite3SelectDelete(pParse->db, (yypminor->yy387));
 
106927 }
106928 break;
106929 case 174: /* term */
106930 case 175: /* expr */
106931 {
 
106932 sqlite3ExprDelete(pParse->db, (yypminor->yy118).pExpr);
 
106933 }
106934 break;
106935 case 179: /* idxlist_opt */
106936 case 187: /* idxlist */
106937 case 197: /* selcollist */
@@ -107004,23 +106943,19 @@
106943 case 217: /* setlist */
106944 case 220: /* itemlist */
106945 case 221: /* exprlist */
106946 case 226: /* case_exprlist */
106947 {
 
106948 sqlite3ExprListDelete(pParse->db, (yypminor->yy322));
 
106949 }
106950 break;
106951 case 193: /* fullname */
106952 case 198: /* from */
106953 case 206: /* seltablist */
106954 case 207: /* stl_prefix */
106955 {
 
106956 sqlite3SrcListDelete(pParse->db, (yypminor->yy259));
 
106957 }
106958 break;
106959 case 199: /* where_opt */
106960 case 201: /* having_opt */
106961 case 210: /* on_opt */
@@ -107028,37 +106963,29 @@
106963 case 225: /* case_operand */
106964 case 227: /* case_else */
106965 case 238: /* when_clause */
106966 case 243: /* key_opt */
106967 {
 
106968 sqlite3ExprDelete(pParse->db, (yypminor->yy314));
 
106969 }
106970 break;
106971 case 211: /* using_opt */
106972 case 213: /* inscollist */
106973 case 219: /* inscollist_opt */
106974 {
 
106975 sqlite3IdListDelete(pParse->db, (yypminor->yy384));
 
106976 }
106977 break;
106978 case 234: /* trigger_cmd_list */
106979 case 239: /* trigger_cmd */
106980 {
 
106981 sqlite3DeleteTriggerStep(pParse->db, (yypminor->yy203));
 
106982 }
106983 break;
106984 case 236: /* trigger_event */
106985 {
 
106986 sqlite3IdListDelete(pParse->db, (yypminor->yy90).b);
 
106987 }
106988 break;
106989 default: break; /* If no destructor action specified: do nothing */
106990 }
106991 }
@@ -107240,16 +107167,14 @@
107167 }
107168 #endif
107169 while( yypParser->yyidx>=0 ) yy_pop_parser_stack(yypParser);
107170 /* Here code is inserted which will execute if the parser
107171 ** stack every overflows */
 
107172
107173 UNUSED_PARAMETER(yypMinor); /* Silence some compiler warnings */
107174 sqlite3ErrorMsg(pParse, "parser stack overflow");
107175 pParse->parseError = 1;
 
107176 sqlite3ParserARG_STORE; /* Suppress warning about unused %extra_argument var */
107177 }
107178
107179 /*
107180 ** Perform a shift action.
@@ -107686,94 +107611,66 @@
107611 ** { ... } // User supplied code
107612 ** #line <lineno> <thisfile>
107613 ** break;
107614 */
107615 case 5: /* explain ::= */
 
107616 { sqlite3BeginParse(pParse, 0); }
 
107617 break;
107618 case 6: /* explain ::= EXPLAIN */
 
107619 { sqlite3BeginParse(pParse, 1); }
 
107620 break;
107621 case 7: /* explain ::= EXPLAIN QUERY PLAN */
 
107622 { sqlite3BeginParse(pParse, 2); }
 
107623 break;
107624 case 8: /* cmdx ::= cmd */
 
107625 { sqlite3FinishCoding(pParse); }
 
107626 break;
107627 case 9: /* cmd ::= BEGIN transtype trans_opt */
 
107628 {sqlite3BeginTransaction(pParse, yymsp[-1].minor.yy4);}
 
107629 break;
107630 case 13: /* transtype ::= */
 
107631 {yygotominor.yy4 = TK_DEFERRED;}
 
107632 break;
107633 case 14: /* transtype ::= DEFERRED */
107634 case 15: /* transtype ::= IMMEDIATE */ yytestcase(yyruleno==15);
107635 case 16: /* transtype ::= EXCLUSIVE */ yytestcase(yyruleno==16);
107636 case 115: /* multiselect_op ::= UNION */ yytestcase(yyruleno==115);
107637 case 117: /* multiselect_op ::= EXCEPT|INTERSECT */ yytestcase(yyruleno==117);
 
107638 {yygotominor.yy4 = yymsp[0].major;}
 
107639 break;
107640 case 17: /* cmd ::= COMMIT trans_opt */
107641 case 18: /* cmd ::= END trans_opt */ yytestcase(yyruleno==18);
 
107642 {sqlite3CommitTransaction(pParse);}
 
107643 break;
107644 case 19: /* cmd ::= ROLLBACK trans_opt */
 
107645 {sqlite3RollbackTransaction(pParse);}
 
107646 break;
107647 case 22: /* cmd ::= SAVEPOINT nm */
 
107648 {
107649 sqlite3Savepoint(pParse, SAVEPOINT_BEGIN, &yymsp[0].minor.yy0);
107650 }
 
107651 break;
107652 case 23: /* cmd ::= RELEASE savepoint_opt nm */
 
107653 {
107654 sqlite3Savepoint(pParse, SAVEPOINT_RELEASE, &yymsp[0].minor.yy0);
107655 }
 
107656 break;
107657 case 24: /* cmd ::= ROLLBACK trans_opt TO savepoint_opt nm */
 
107658 {
107659 sqlite3Savepoint(pParse, SAVEPOINT_ROLLBACK, &yymsp[0].minor.yy0);
107660 }
 
107661 break;
107662 case 26: /* create_table ::= createkw temp TABLE ifnotexists nm dbnm */
 
107663 {
107664 sqlite3StartTable(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,yymsp[-4].minor.yy4,0,0,yymsp[-2].minor.yy4);
107665 }
 
107666 break;
107667 case 27: /* createkw ::= CREATE */
 
107668 {
107669 pParse->db->lookaside.bEnabled = 0;
107670 yygotominor.yy0 = yymsp[0].minor.yy0;
107671 }
 
107672 break;
107673 case 28: /* ifnotexists ::= */
107674 case 31: /* temp ::= */ yytestcase(yyruleno==31);
107675 case 70: /* autoinc ::= */ yytestcase(yyruleno==70);
107676 case 83: /* defer_subclause ::= NOT DEFERRABLE init_deferred_pred_opt */ yytestcase(yyruleno==83);
@@ -107783,56 +107680,44 @@
107680 case 109: /* ifexists ::= */ yytestcase(yyruleno==109);
107681 case 120: /* distinct ::= ALL */ yytestcase(yyruleno==120);
107682 case 121: /* distinct ::= */ yytestcase(yyruleno==121);
107683 case 222: /* between_op ::= BETWEEN */ yytestcase(yyruleno==222);
107684 case 225: /* in_op ::= IN */ yytestcase(yyruleno==225);
 
107685 {yygotominor.yy4 = 0;}
 
107686 break;
107687 case 29: /* ifnotexists ::= IF NOT EXISTS */
107688 case 30: /* temp ::= TEMP */ yytestcase(yyruleno==30);
107689 case 71: /* autoinc ::= AUTOINCR */ yytestcase(yyruleno==71);
107690 case 86: /* init_deferred_pred_opt ::= INITIALLY DEFERRED */ yytestcase(yyruleno==86);
107691 case 108: /* ifexists ::= IF EXISTS */ yytestcase(yyruleno==108);
107692 case 119: /* distinct ::= DISTINCT */ yytestcase(yyruleno==119);
107693 case 223: /* between_op ::= NOT BETWEEN */ yytestcase(yyruleno==223);
107694 case 226: /* in_op ::= NOT IN */ yytestcase(yyruleno==226);
 
107695 {yygotominor.yy4 = 1;}
 
107696 break;
107697 case 32: /* create_table_args ::= LP columnlist conslist_opt RP */
 
107698 {
107699 sqlite3EndTable(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,0);
107700 }
 
107701 break;
107702 case 33: /* create_table_args ::= AS select */
 
107703 {
107704 sqlite3EndTable(pParse,0,0,yymsp[0].minor.yy387);
107705 sqlite3SelectDelete(pParse->db, yymsp[0].minor.yy387);
107706 }
 
107707 break;
107708 case 36: /* column ::= columnid type carglist */
 
107709 {
107710 yygotominor.yy0.z = yymsp[-2].minor.yy0.z;
107711 yygotominor.yy0.n = (int)(pParse->sLastToken.z-yymsp[-2].minor.yy0.z) + pParse->sLastToken.n;
107712 }
 
107713 break;
107714 case 37: /* columnid ::= nm */
 
107715 {
107716 sqlite3AddColumn(pParse,&yymsp[0].minor.yy0);
107717 yygotominor.yy0 = yymsp[0].minor.yy0;
107718 }
 
107719 break;
107720 case 38: /* id ::= ID */
107721 case 39: /* id ::= INDEXED */ yytestcase(yyruleno==39);
107722 case 40: /* ids ::= ID|STRING */ yytestcase(yyruleno==40);
107723 case 41: /* nm ::= id */ yytestcase(yyruleno==41);
@@ -107852,373 +107737,256 @@
107737 case 264: /* nmnum ::= DEFAULT */ yytestcase(yyruleno==264);
107738 case 265: /* plus_num ::= plus_opt number */ yytestcase(yyruleno==265);
107739 case 266: /* minus_num ::= MINUS number */ yytestcase(yyruleno==266);
107740 case 267: /* number ::= INTEGER|FLOAT */ yytestcase(yyruleno==267);
107741 case 285: /* trnm ::= nm */ yytestcase(yyruleno==285);
 
107742 {yygotominor.yy0 = yymsp[0].minor.yy0;}
 
107743 break;
107744 case 45: /* type ::= typetoken */
 
107745 {sqlite3AddColumnType(pParse,&yymsp[0].minor.yy0);}
 
107746 break;
107747 case 47: /* typetoken ::= typename LP signed RP */
 
107748 {
107749 yygotominor.yy0.z = yymsp[-3].minor.yy0.z;
107750 yygotominor.yy0.n = (int)(&yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n] - yymsp[-3].minor.yy0.z);
107751 }
 
107752 break;
107753 case 48: /* typetoken ::= typename LP signed COMMA signed RP */
 
107754 {
107755 yygotominor.yy0.z = yymsp[-5].minor.yy0.z;
107756 yygotominor.yy0.n = (int)(&yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n] - yymsp[-5].minor.yy0.z);
107757 }
 
107758 break;
107759 case 50: /* typename ::= typename ids */
 
107760 {yygotominor.yy0.z=yymsp[-1].minor.yy0.z; yygotominor.yy0.n=yymsp[0].minor.yy0.n+(int)(yymsp[0].minor.yy0.z-yymsp[-1].minor.yy0.z);}
 
107761 break;
107762 case 57: /* ccons ::= DEFAULT term */
107763 case 59: /* ccons ::= DEFAULT PLUS term */ yytestcase(yyruleno==59);
 
107764 {sqlite3AddDefaultValue(pParse,&yymsp[0].minor.yy118);}
 
107765 break;
107766 case 58: /* ccons ::= DEFAULT LP expr RP */
 
107767 {sqlite3AddDefaultValue(pParse,&yymsp[-1].minor.yy118);}
 
107768 break;
107769 case 60: /* ccons ::= DEFAULT MINUS term */
 
107770 {
107771 ExprSpan v;
107772 v.pExpr = sqlite3PExpr(pParse, TK_UMINUS, yymsp[0].minor.yy118.pExpr, 0, 0);
107773 v.zStart = yymsp[-1].minor.yy0.z;
107774 v.zEnd = yymsp[0].minor.yy118.zEnd;
107775 sqlite3AddDefaultValue(pParse,&v);
107776 }
 
107777 break;
107778 case 61: /* ccons ::= DEFAULT id */
 
107779 {
107780 ExprSpan v;
107781 spanExpr(&v, pParse, TK_STRING, &yymsp[0].minor.yy0);
107782 sqlite3AddDefaultValue(pParse,&v);
107783 }
 
107784 break;
107785 case 63: /* ccons ::= NOT NULL onconf */
 
107786 {sqlite3AddNotNull(pParse, yymsp[0].minor.yy4);}
 
107787 break;
107788 case 64: /* ccons ::= PRIMARY KEY sortorder onconf autoinc */
 
107789 {sqlite3AddPrimaryKey(pParse,0,yymsp[-1].minor.yy4,yymsp[0].minor.yy4,yymsp[-2].minor.yy4);}
 
107790 break;
107791 case 65: /* ccons ::= UNIQUE onconf */
 
107792 {sqlite3CreateIndex(pParse,0,0,0,0,yymsp[0].minor.yy4,0,0,0,0);}
 
107793 break;
107794 case 66: /* ccons ::= CHECK LP expr RP */
 
107795 {sqlite3AddCheckConstraint(pParse,yymsp[-1].minor.yy118.pExpr);}
 
107796 break;
107797 case 67: /* ccons ::= REFERENCES nm idxlist_opt refargs */
 
107798 {sqlite3CreateForeignKey(pParse,0,&yymsp[-2].minor.yy0,yymsp[-1].minor.yy322,yymsp[0].minor.yy4);}
 
107799 break;
107800 case 68: /* ccons ::= defer_subclause */
 
107801 {sqlite3DeferForeignKey(pParse,yymsp[0].minor.yy4);}
 
107802 break;
107803 case 69: /* ccons ::= COLLATE ids */
 
107804 {sqlite3AddCollateType(pParse, &yymsp[0].minor.yy0);}
 
107805 break;
107806 case 72: /* refargs ::= */
 
107807 { yygotominor.yy4 = OE_None*0x0101; /* EV: R-19803-45884 */}
 
107808 break;
107809 case 73: /* refargs ::= refargs refarg */
 
107810 { yygotominor.yy4 = (yymsp[-1].minor.yy4 & ~yymsp[0].minor.yy215.mask) | yymsp[0].minor.yy215.value; }
 
107811 break;
107812 case 74: /* refarg ::= MATCH nm */
107813 case 75: /* refarg ::= ON INSERT refact */ yytestcase(yyruleno==75);
 
107814 { yygotominor.yy215.value = 0; yygotominor.yy215.mask = 0x000000; }
 
107815 break;
107816 case 76: /* refarg ::= ON DELETE refact */
 
107817 { yygotominor.yy215.value = yymsp[0].minor.yy4; yygotominor.yy215.mask = 0x0000ff; }
 
107818 break;
107819 case 77: /* refarg ::= ON UPDATE refact */
 
107820 { yygotominor.yy215.value = yymsp[0].minor.yy4<<8; yygotominor.yy215.mask = 0x00ff00; }
 
107821 break;
107822 case 78: /* refact ::= SET NULL */
 
107823 { yygotominor.yy4 = OE_SetNull; /* EV: R-33326-45252 */}
 
107824 break;
107825 case 79: /* refact ::= SET DEFAULT */
 
107826 { yygotominor.yy4 = OE_SetDflt; /* EV: R-33326-45252 */}
 
107827 break;
107828 case 80: /* refact ::= CASCADE */
 
107829 { yygotominor.yy4 = OE_Cascade; /* EV: R-33326-45252 */}
 
107830 break;
107831 case 81: /* refact ::= RESTRICT */
 
107832 { yygotominor.yy4 = OE_Restrict; /* EV: R-33326-45252 */}
 
107833 break;
107834 case 82: /* refact ::= NO ACTION */
 
107835 { yygotominor.yy4 = OE_None; /* EV: R-33326-45252 */}
 
107836 break;
107837 case 84: /* defer_subclause ::= DEFERRABLE init_deferred_pred_opt */
107838 case 99: /* defer_subclause_opt ::= defer_subclause */ yytestcase(yyruleno==99);
107839 case 101: /* onconf ::= ON CONFLICT resolvetype */ yytestcase(yyruleno==101);
107840 case 104: /* resolvetype ::= raisetype */ yytestcase(yyruleno==104);
 
107841 {yygotominor.yy4 = yymsp[0].minor.yy4;}
 
107842 break;
107843 case 88: /* conslist_opt ::= */
 
107844 {yygotominor.yy0.n = 0; yygotominor.yy0.z = 0;}
 
107845 break;
107846 case 89: /* conslist_opt ::= COMMA conslist */
 
107847 {yygotominor.yy0 = yymsp[-1].minor.yy0;}
 
107848 break;
107849 case 94: /* tcons ::= PRIMARY KEY LP idxlist autoinc RP onconf */
 
107850 {sqlite3AddPrimaryKey(pParse,yymsp[-3].minor.yy322,yymsp[0].minor.yy4,yymsp[-2].minor.yy4,0);}
 
107851 break;
107852 case 95: /* tcons ::= UNIQUE LP idxlist RP onconf */
 
107853 {sqlite3CreateIndex(pParse,0,0,0,yymsp[-2].minor.yy322,yymsp[0].minor.yy4,0,0,0,0);}
 
107854 break;
107855 case 96: /* tcons ::= CHECK LP expr RP onconf */
 
107856 {sqlite3AddCheckConstraint(pParse,yymsp[-2].minor.yy118.pExpr);}
 
107857 break;
107858 case 97: /* tcons ::= FOREIGN KEY LP idxlist RP REFERENCES nm idxlist_opt refargs defer_subclause_opt */
 
107859 {
107860 sqlite3CreateForeignKey(pParse, yymsp[-6].minor.yy322, &yymsp[-3].minor.yy0, yymsp[-2].minor.yy322, yymsp[-1].minor.yy4);
107861 sqlite3DeferForeignKey(pParse, yymsp[0].minor.yy4);
107862 }
 
107863 break;
107864 case 100: /* onconf ::= */
 
107865 {yygotominor.yy4 = OE_Default;}
 
107866 break;
107867 case 102: /* orconf ::= */
 
107868 {yygotominor.yy210 = OE_Default;}
 
107869 break;
107870 case 103: /* orconf ::= OR resolvetype */
 
107871 {yygotominor.yy210 = (u8)yymsp[0].minor.yy4;}
 
107872 break;
107873 case 105: /* resolvetype ::= IGNORE */
 
107874 {yygotominor.yy4 = OE_Ignore;}
 
107875 break;
107876 case 106: /* resolvetype ::= REPLACE */
 
107877 {yygotominor.yy4 = OE_Replace;}
 
107878 break;
107879 case 107: /* cmd ::= DROP TABLE ifexists fullname */
 
107880 {
107881 sqlite3DropTable(pParse, yymsp[0].minor.yy259, 0, yymsp[-1].minor.yy4);
107882 }
 
107883 break;
107884 case 110: /* cmd ::= createkw temp VIEW ifnotexists nm dbnm AS select */
 
107885 {
107886 sqlite3CreateView(pParse, &yymsp[-7].minor.yy0, &yymsp[-3].minor.yy0, &yymsp[-2].minor.yy0, yymsp[0].minor.yy387, yymsp[-6].minor.yy4, yymsp[-4].minor.yy4);
107887 }
 
107888 break;
107889 case 111: /* cmd ::= DROP VIEW ifexists fullname */
 
107890 {
107891 sqlite3DropTable(pParse, yymsp[0].minor.yy259, 1, yymsp[-1].minor.yy4);
107892 }
 
107893 break;
107894 case 112: /* cmd ::= select */
 
107895 {
107896 SelectDest dest = {SRT_Output, 0, 0, 0, 0};
107897 sqlite3Select(pParse, yymsp[0].minor.yy387, &dest);
107898 sqlite3SelectDelete(pParse->db, yymsp[0].minor.yy387);
107899 }
 
107900 break;
107901 case 113: /* select ::= oneselect */
 
107902 {yygotominor.yy387 = yymsp[0].minor.yy387;}
 
107903 break;
107904 case 114: /* select ::= select multiselect_op oneselect */
 
107905 {
107906 if( yymsp[0].minor.yy387 ){
107907 yymsp[0].minor.yy387->op = (u8)yymsp[-1].minor.yy4;
107908 yymsp[0].minor.yy387->pPrior = yymsp[-2].minor.yy387;
107909 }else{
107910 sqlite3SelectDelete(pParse->db, yymsp[-2].minor.yy387);
107911 }
107912 yygotominor.yy387 = yymsp[0].minor.yy387;
107913 }
 
107914 break;
107915 case 116: /* multiselect_op ::= UNION ALL */
 
107916 {yygotominor.yy4 = TK_ALL;}
 
107917 break;
107918 case 118: /* oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt orderby_opt limit_opt */
 
107919 {
107920 yygotominor.yy387 = sqlite3SelectNew(pParse,yymsp[-6].minor.yy322,yymsp[-5].minor.yy259,yymsp[-4].minor.yy314,yymsp[-3].minor.yy322,yymsp[-2].minor.yy314,yymsp[-1].minor.yy322,yymsp[-7].minor.yy4,yymsp[0].minor.yy292.pLimit,yymsp[0].minor.yy292.pOffset);
107921 }
 
107922 break;
107923 case 122: /* sclp ::= selcollist COMMA */
107924 case 247: /* idxlist_opt ::= LP idxlist RP */ yytestcase(yyruleno==247);
 
107925 {yygotominor.yy322 = yymsp[-1].minor.yy322;}
 
107926 break;
107927 case 123: /* sclp ::= */
107928 case 151: /* orderby_opt ::= */ yytestcase(yyruleno==151);
107929 case 159: /* groupby_opt ::= */ yytestcase(yyruleno==159);
107930 case 240: /* exprlist ::= */ yytestcase(yyruleno==240);
107931 case 246: /* idxlist_opt ::= */ yytestcase(yyruleno==246);
 
107932 {yygotominor.yy322 = 0;}
 
107933 break;
107934 case 124: /* selcollist ::= sclp expr as */
 
107935 {
107936 yygotominor.yy322 = sqlite3ExprListAppend(pParse, yymsp[-2].minor.yy322, yymsp[-1].minor.yy118.pExpr);
107937 if( yymsp[0].minor.yy0.n>0 ) sqlite3ExprListSetName(pParse, yygotominor.yy322, &yymsp[0].minor.yy0, 1);
107938 sqlite3ExprListSetSpan(pParse,yygotominor.yy322,&yymsp[-1].minor.yy118);
107939 }
 
107940 break;
107941 case 125: /* selcollist ::= sclp STAR */
 
107942 {
107943 Expr *p = sqlite3Expr(pParse->db, TK_ALL, 0);
107944 yygotominor.yy322 = sqlite3ExprListAppend(pParse, yymsp[-1].minor.yy322, p);
107945 }
 
107946 break;
107947 case 126: /* selcollist ::= sclp nm DOT STAR */
 
107948 {
107949 Expr *pRight = sqlite3PExpr(pParse, TK_ALL, 0, 0, &yymsp[0].minor.yy0);
107950 Expr *pLeft = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-2].minor.yy0);
107951 Expr *pDot = sqlite3PExpr(pParse, TK_DOT, pLeft, pRight, 0);
107952 yygotominor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-3].minor.yy322, pDot);
107953 }
 
107954 break;
107955 case 129: /* as ::= */
 
107956 {yygotominor.yy0.n = 0;}
 
107957 break;
107958 case 130: /* from ::= */
 
107959 {yygotominor.yy259 = sqlite3DbMallocZero(pParse->db, sizeof(*yygotominor.yy259));}
 
107960 break;
107961 case 131: /* from ::= FROM seltablist */
 
107962 {
107963 yygotominor.yy259 = yymsp[0].minor.yy259;
107964 sqlite3SrcListShiftJoinType(yygotominor.yy259);
107965 }
 
107966 break;
107967 case 132: /* stl_prefix ::= seltablist joinop */
 
107968 {
107969 yygotominor.yy259 = yymsp[-1].minor.yy259;
107970 if( ALWAYS(yygotominor.yy259 && yygotominor.yy259->nSrc>0) ) yygotominor.yy259->a[yygotominor.yy259->nSrc-1].jointype = (u8)yymsp[0].minor.yy4;
107971 }
 
107972 break;
107973 case 133: /* stl_prefix ::= */
 
107974 {yygotominor.yy259 = 0;}
 
107975 break;
107976 case 134: /* seltablist ::= stl_prefix nm dbnm as indexed_opt on_opt using_opt */
 
107977 {
107978 yygotominor.yy259 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy259,&yymsp[-5].minor.yy0,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,0,yymsp[-1].minor.yy314,yymsp[0].minor.yy384);
107979 sqlite3SrcListIndexedBy(pParse, yygotominor.yy259, &yymsp[-2].minor.yy0);
107980 }
 
107981 break;
107982 case 135: /* seltablist ::= stl_prefix LP select RP as on_opt using_opt */
 
107983 {
107984 yygotominor.yy259 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy259,0,0,&yymsp[-2].minor.yy0,yymsp[-4].minor.yy387,yymsp[-1].minor.yy314,yymsp[0].minor.yy384);
107985 }
 
107986 break;
107987 case 136: /* seltablist ::= stl_prefix LP seltablist RP as on_opt using_opt */
 
107988 {
107989 if( yymsp[-6].minor.yy259==0 && yymsp[-2].minor.yy0.n==0 && yymsp[-1].minor.yy314==0 && yymsp[0].minor.yy384==0 ){
107990 yygotominor.yy259 = yymsp[-4].minor.yy259;
107991 }else{
107992 Select *pSubquery;
@@ -108225,260 +107993,180 @@
107993 sqlite3SrcListShiftJoinType(yymsp[-4].minor.yy259);
107994 pSubquery = sqlite3SelectNew(pParse,0,yymsp[-4].minor.yy259,0,0,0,0,0,0,0);
107995 yygotominor.yy259 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy259,0,0,&yymsp[-2].minor.yy0,pSubquery,yymsp[-1].minor.yy314,yymsp[0].minor.yy384);
107996 }
107997 }
 
107998 break;
107999 case 137: /* dbnm ::= */
108000 case 146: /* indexed_opt ::= */ yytestcase(yyruleno==146);
 
108001 {yygotominor.yy0.z=0; yygotominor.yy0.n=0;}
 
108002 break;
108003 case 139: /* fullname ::= nm dbnm */
 
108004 {yygotominor.yy259 = sqlite3SrcListAppend(pParse->db,0,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0);}
 
108005 break;
108006 case 140: /* joinop ::= COMMA|JOIN */
 
108007 { yygotominor.yy4 = JT_INNER; }
 
108008 break;
108009 case 141: /* joinop ::= JOIN_KW JOIN */
 
108010 { yygotominor.yy4 = sqlite3JoinType(pParse,&yymsp[-1].minor.yy0,0,0); }
 
108011 break;
108012 case 142: /* joinop ::= JOIN_KW nm JOIN */
 
108013 { yygotominor.yy4 = sqlite3JoinType(pParse,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0,0); }
 
108014 break;
108015 case 143: /* joinop ::= JOIN_KW nm nm JOIN */
 
108016 { yygotominor.yy4 = sqlite3JoinType(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0); }
 
108017 break;
108018 case 144: /* on_opt ::= ON expr */
108019 case 155: /* sortitem ::= expr */ yytestcase(yyruleno==155);
108020 case 162: /* having_opt ::= HAVING expr */ yytestcase(yyruleno==162);
108021 case 169: /* where_opt ::= WHERE expr */ yytestcase(yyruleno==169);
108022 case 235: /* case_else ::= ELSE expr */ yytestcase(yyruleno==235);
108023 case 237: /* case_operand ::= expr */ yytestcase(yyruleno==237);
 
108024 {yygotominor.yy314 = yymsp[0].minor.yy118.pExpr;}
 
108025 break;
108026 case 145: /* on_opt ::= */
108027 case 161: /* having_opt ::= */ yytestcase(yyruleno==161);
108028 case 168: /* where_opt ::= */ yytestcase(yyruleno==168);
108029 case 236: /* case_else ::= */ yytestcase(yyruleno==236);
108030 case 238: /* case_operand ::= */ yytestcase(yyruleno==238);
 
108031 {yygotominor.yy314 = 0;}
 
108032 break;
108033 case 148: /* indexed_opt ::= NOT INDEXED */
 
108034 {yygotominor.yy0.z=0; yygotominor.yy0.n=1;}
 
108035 break;
108036 case 149: /* using_opt ::= USING LP inscollist RP */
108037 case 181: /* inscollist_opt ::= LP inscollist RP */ yytestcase(yyruleno==181);
 
108038 {yygotominor.yy384 = yymsp[-1].minor.yy384;}
 
108039 break;
108040 case 150: /* using_opt ::= */
108041 case 180: /* inscollist_opt ::= */ yytestcase(yyruleno==180);
 
108042 {yygotominor.yy384 = 0;}
 
108043 break;
108044 case 152: /* orderby_opt ::= ORDER BY sortlist */
108045 case 160: /* groupby_opt ::= GROUP BY nexprlist */ yytestcase(yyruleno==160);
108046 case 239: /* exprlist ::= nexprlist */ yytestcase(yyruleno==239);
 
108047 {yygotominor.yy322 = yymsp[0].minor.yy322;}
 
108048 break;
108049 case 153: /* sortlist ::= sortlist COMMA sortitem sortorder */
 
108050 {
108051 yygotominor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-3].minor.yy322,yymsp[-1].minor.yy314);
108052 if( yygotominor.yy322 ) yygotominor.yy322->a[yygotominor.yy322->nExpr-1].sortOrder = (u8)yymsp[0].minor.yy4;
108053 }
 
108054 break;
108055 case 154: /* sortlist ::= sortitem sortorder */
 
108056 {
108057 yygotominor.yy322 = sqlite3ExprListAppend(pParse,0,yymsp[-1].minor.yy314);
108058 if( yygotominor.yy322 && ALWAYS(yygotominor.yy322->a) ) yygotominor.yy322->a[0].sortOrder = (u8)yymsp[0].minor.yy4;
108059 }
 
108060 break;
108061 case 156: /* sortorder ::= ASC */
108062 case 158: /* sortorder ::= */ yytestcase(yyruleno==158);
 
108063 {yygotominor.yy4 = SQLITE_SO_ASC;}
 
108064 break;
108065 case 157: /* sortorder ::= DESC */
 
108066 {yygotominor.yy4 = SQLITE_SO_DESC;}
 
108067 break;
108068 case 163: /* limit_opt ::= */
 
108069 {yygotominor.yy292.pLimit = 0; yygotominor.yy292.pOffset = 0;}
 
108070 break;
108071 case 164: /* limit_opt ::= LIMIT expr */
 
108072 {yygotominor.yy292.pLimit = yymsp[0].minor.yy118.pExpr; yygotominor.yy292.pOffset = 0;}
 
108073 break;
108074 case 165: /* limit_opt ::= LIMIT expr OFFSET expr */
 
108075 {yygotominor.yy292.pLimit = yymsp[-2].minor.yy118.pExpr; yygotominor.yy292.pOffset = yymsp[0].minor.yy118.pExpr;}
 
108076 break;
108077 case 166: /* limit_opt ::= LIMIT expr COMMA expr */
 
108078 {yygotominor.yy292.pOffset = yymsp[-2].minor.yy118.pExpr; yygotominor.yy292.pLimit = yymsp[0].minor.yy118.pExpr;}
 
108079 break;
108080 case 167: /* cmd ::= DELETE FROM fullname indexed_opt where_opt */
 
108081 {
108082 sqlite3SrcListIndexedBy(pParse, yymsp[-2].minor.yy259, &yymsp[-1].minor.yy0);
108083 sqlite3DeleteFrom(pParse,yymsp[-2].minor.yy259,yymsp[0].minor.yy314);
108084 }
 
108085 break;
108086 case 170: /* cmd ::= UPDATE orconf fullname indexed_opt SET setlist where_opt */
 
108087 {
108088 sqlite3SrcListIndexedBy(pParse, yymsp[-4].minor.yy259, &yymsp[-3].minor.yy0);
108089 sqlite3ExprListCheckLength(pParse,yymsp[-1].minor.yy322,"set list");
108090 sqlite3Update(pParse,yymsp[-4].minor.yy259,yymsp[-1].minor.yy322,yymsp[0].minor.yy314,yymsp[-5].minor.yy210);
108091 }
 
108092 break;
108093 case 171: /* setlist ::= setlist COMMA nm EQ expr */
 
108094 {
108095 yygotominor.yy322 = sqlite3ExprListAppend(pParse, yymsp[-4].minor.yy322, yymsp[0].minor.yy118.pExpr);
108096 sqlite3ExprListSetName(pParse, yygotominor.yy322, &yymsp[-2].minor.yy0, 1);
108097 }
 
108098 break;
108099 case 172: /* setlist ::= nm EQ expr */
 
108100 {
108101 yygotominor.yy322 = sqlite3ExprListAppend(pParse, 0, yymsp[0].minor.yy118.pExpr);
108102 sqlite3ExprListSetName(pParse, yygotominor.yy322, &yymsp[-2].minor.yy0, 1);
108103 }
 
108104 break;
108105 case 173: /* cmd ::= insert_cmd INTO fullname inscollist_opt VALUES LP itemlist RP */
 
108106 {sqlite3Insert(pParse, yymsp[-5].minor.yy259, yymsp[-1].minor.yy322, 0, yymsp[-4].minor.yy384, yymsp[-7].minor.yy210);}
 
108107 break;
108108 case 174: /* cmd ::= insert_cmd INTO fullname inscollist_opt select */
 
108109 {sqlite3Insert(pParse, yymsp[-2].minor.yy259, 0, yymsp[0].minor.yy387, yymsp[-1].minor.yy384, yymsp[-4].minor.yy210);}
 
108110 break;
108111 case 175: /* cmd ::= insert_cmd INTO fullname inscollist_opt DEFAULT VALUES */
 
108112 {sqlite3Insert(pParse, yymsp[-3].minor.yy259, 0, 0, yymsp[-2].minor.yy384, yymsp[-5].minor.yy210);}
 
108113 break;
108114 case 176: /* insert_cmd ::= INSERT orconf */
 
108115 {yygotominor.yy210 = yymsp[0].minor.yy210;}
 
108116 break;
108117 case 177: /* insert_cmd ::= REPLACE */
 
108118 {yygotominor.yy210 = OE_Replace;}
 
108119 break;
108120 case 178: /* itemlist ::= itemlist COMMA expr */
108121 case 241: /* nexprlist ::= nexprlist COMMA expr */ yytestcase(yyruleno==241);
 
108122 {yygotominor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-2].minor.yy322,yymsp[0].minor.yy118.pExpr);}
 
108123 break;
108124 case 179: /* itemlist ::= expr */
108125 case 242: /* nexprlist ::= expr */ yytestcase(yyruleno==242);
 
108126 {yygotominor.yy322 = sqlite3ExprListAppend(pParse,0,yymsp[0].minor.yy118.pExpr);}
 
108127 break;
108128 case 182: /* inscollist ::= inscollist COMMA nm */
 
108129 {yygotominor.yy384 = sqlite3IdListAppend(pParse->db,yymsp[-2].minor.yy384,&yymsp[0].minor.yy0);}
 
108130 break;
108131 case 183: /* inscollist ::= nm */
 
108132 {yygotominor.yy384 = sqlite3IdListAppend(pParse->db,0,&yymsp[0].minor.yy0);}
 
108133 break;
108134 case 184: /* expr ::= term */
 
108135 {yygotominor.yy118 = yymsp[0].minor.yy118;}
 
108136 break;
108137 case 185: /* expr ::= LP expr RP */
 
108138 {yygotominor.yy118.pExpr = yymsp[-1].minor.yy118.pExpr; spanSet(&yygotominor.yy118,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0);}
 
108139 break;
108140 case 186: /* term ::= NULL */
108141 case 191: /* term ::= INTEGER|FLOAT|BLOB */ yytestcase(yyruleno==191);
108142 case 192: /* term ::= STRING */ yytestcase(yyruleno==192);
 
108143 {spanExpr(&yygotominor.yy118, pParse, yymsp[0].major, &yymsp[0].minor.yy0);}
 
108144 break;
108145 case 187: /* expr ::= id */
108146 case 188: /* expr ::= JOIN_KW */ yytestcase(yyruleno==188);
 
108147 {spanExpr(&yygotominor.yy118, pParse, TK_ID, &yymsp[0].minor.yy0);}
 
108148 break;
108149 case 189: /* expr ::= nm DOT nm */
 
108150 {
108151 Expr *temp1 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-2].minor.yy0);
108152 Expr *temp2 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[0].minor.yy0);
108153 yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_DOT, temp1, temp2, 0);
108154 spanSet(&yygotominor.yy118,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0);
108155 }
 
108156 break;
108157 case 190: /* expr ::= nm DOT nm DOT nm */
 
108158 {
108159 Expr *temp1 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-4].minor.yy0);
108160 Expr *temp2 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-2].minor.yy0);
108161 Expr *temp3 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[0].minor.yy0);
108162 Expr *temp4 = sqlite3PExpr(pParse, TK_DOT, temp2, temp3, 0);
108163 yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_DOT, temp1, temp4, 0);
108164 spanSet(&yygotominor.yy118,&yymsp[-4].minor.yy0,&yymsp[0].minor.yy0);
108165 }
 
108166 break;
108167 case 193: /* expr ::= REGISTER */
 
108168 {
108169 /* When doing a nested parse, one can include terms in an expression
108170 ** that look like this: #1 #2 ... These terms refer to registers
108171 ** in the virtual machine. #N is the N-th register. */
108172 if( pParse->nested==0 ){
@@ -108488,40 +108176,32 @@
108176 yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_REGISTER, 0, 0, &yymsp[0].minor.yy0);
108177 if( yygotominor.yy118.pExpr ) sqlite3GetInt32(&yymsp[0].minor.yy0.z[1], &yygotominor.yy118.pExpr->iTable);
108178 }
108179 spanSet(&yygotominor.yy118, &yymsp[0].minor.yy0, &yymsp[0].minor.yy0);
108180 }
 
108181 break;
108182 case 194: /* expr ::= VARIABLE */
 
108183 {
108184 spanExpr(&yygotominor.yy118, pParse, TK_VARIABLE, &yymsp[0].minor.yy0);
108185 sqlite3ExprAssignVarNumber(pParse, yygotominor.yy118.pExpr);
108186 spanSet(&yygotominor.yy118, &yymsp[0].minor.yy0, &yymsp[0].minor.yy0);
108187 }
 
108188 break;
108189 case 195: /* expr ::= expr COLLATE ids */
 
108190 {
108191 yygotominor.yy118.pExpr = sqlite3ExprSetCollByToken(pParse, yymsp[-2].minor.yy118.pExpr, &yymsp[0].minor.yy0);
108192 yygotominor.yy118.zStart = yymsp[-2].minor.yy118.zStart;
108193 yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
108194 }
 
108195 break;
108196 case 196: /* expr ::= CAST LP expr AS typetoken RP */
 
108197 {
108198 yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_CAST, yymsp[-3].minor.yy118.pExpr, 0, &yymsp[-1].minor.yy0);
108199 spanSet(&yygotominor.yy118,&yymsp[-5].minor.yy0,&yymsp[0].minor.yy0);
108200 }
 
108201 break;
108202 case 197: /* expr ::= ID LP distinct exprlist RP */
 
108203 {
108204 if( yymsp[-1].minor.yy322 && yymsp[-1].minor.yy322->nExpr>pParse->db->aLimit[SQLITE_LIMIT_FUNCTION_ARG] ){
108205 sqlite3ErrorMsg(pParse, "too many arguments on function %T", &yymsp[-4].minor.yy0);
108206 }
108207 yygotominor.yy118.pExpr = sqlite3ExprFunction(pParse, yymsp[-1].minor.yy322, &yymsp[-4].minor.yy0);
@@ -108528,59 +108208,47 @@
108208 spanSet(&yygotominor.yy118,&yymsp[-4].minor.yy0,&yymsp[0].minor.yy0);
108209 if( yymsp[-2].minor.yy4 && yygotominor.yy118.pExpr ){
108210 yygotominor.yy118.pExpr->flags |= EP_Distinct;
108211 }
108212 }
 
108213 break;
108214 case 198: /* expr ::= ID LP STAR RP */
 
108215 {
108216 yygotominor.yy118.pExpr = sqlite3ExprFunction(pParse, 0, &yymsp[-3].minor.yy0);
108217 spanSet(&yygotominor.yy118,&yymsp[-3].minor.yy0,&yymsp[0].minor.yy0);
108218 }
 
108219 break;
108220 case 199: /* term ::= CTIME_KW */
 
108221 {
108222 /* The CURRENT_TIME, CURRENT_DATE, and CURRENT_TIMESTAMP values are
108223 ** treated as functions that return constants */
108224 yygotominor.yy118.pExpr = sqlite3ExprFunction(pParse, 0,&yymsp[0].minor.yy0);
108225 if( yygotominor.yy118.pExpr ){
108226 yygotominor.yy118.pExpr->op = TK_CONST_FUNC;
108227 }
108228 spanSet(&yygotominor.yy118, &yymsp[0].minor.yy0, &yymsp[0].minor.yy0);
108229 }
 
108230 break;
108231 case 200: /* expr ::= expr AND expr */
108232 case 201: /* expr ::= expr OR expr */ yytestcase(yyruleno==201);
108233 case 202: /* expr ::= expr LT|GT|GE|LE expr */ yytestcase(yyruleno==202);
108234 case 203: /* expr ::= expr EQ|NE expr */ yytestcase(yyruleno==203);
108235 case 204: /* expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr */ yytestcase(yyruleno==204);
108236 case 205: /* expr ::= expr PLUS|MINUS expr */ yytestcase(yyruleno==205);
108237 case 206: /* expr ::= expr STAR|SLASH|REM expr */ yytestcase(yyruleno==206);
108238 case 207: /* expr ::= expr CONCAT expr */ yytestcase(yyruleno==207);
 
108239 {spanBinaryExpr(&yygotominor.yy118,pParse,yymsp[-1].major,&yymsp[-2].minor.yy118,&yymsp[0].minor.yy118);}
 
108240 break;
108241 case 208: /* likeop ::= LIKE_KW */
108242 case 210: /* likeop ::= MATCH */ yytestcase(yyruleno==210);
 
108243 {yygotominor.yy342.eOperator = yymsp[0].minor.yy0; yygotominor.yy342.not = 0;}
 
108244 break;
108245 case 209: /* likeop ::= NOT LIKE_KW */
108246 case 211: /* likeop ::= NOT MATCH */ yytestcase(yyruleno==211);
 
108247 {yygotominor.yy342.eOperator = yymsp[0].minor.yy0; yygotominor.yy342.not = 1;}
 
108248 break;
108249 case 212: /* expr ::= expr likeop expr */
 
108250 {
108251 ExprList *pList;
108252 pList = sqlite3ExprListAppend(pParse,0, yymsp[0].minor.yy118.pExpr);
108253 pList = sqlite3ExprListAppend(pParse,pList, yymsp[-2].minor.yy118.pExpr);
108254 yygotominor.yy118.pExpr = sqlite3ExprFunction(pParse, pList, &yymsp[-1].minor.yy342.eOperator);
@@ -108587,14 +108255,12 @@
108255 if( yymsp[-1].minor.yy342.not ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0);
108256 yygotominor.yy118.zStart = yymsp[-2].minor.yy118.zStart;
108257 yygotominor.yy118.zEnd = yymsp[0].minor.yy118.zEnd;
108258 if( yygotominor.yy118.pExpr ) yygotominor.yy118.pExpr->flags |= EP_InfixFunc;
108259 }
 
108260 break;
108261 case 213: /* expr ::= expr likeop expr ESCAPE expr */
 
108262 {
108263 ExprList *pList;
108264 pList = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy118.pExpr);
108265 pList = sqlite3ExprListAppend(pParse,pList, yymsp[-4].minor.yy118.pExpr);
108266 pList = sqlite3ExprListAppend(pParse,pList, yymsp[0].minor.yy118.pExpr);
@@ -108602,56 +108268,40 @@
108268 if( yymsp[-3].minor.yy342.not ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0);
108269 yygotominor.yy118.zStart = yymsp[-4].minor.yy118.zStart;
108270 yygotominor.yy118.zEnd = yymsp[0].minor.yy118.zEnd;
108271 if( yygotominor.yy118.pExpr ) yygotominor.yy118.pExpr->flags |= EP_InfixFunc;
108272 }
 
108273 break;
108274 case 214: /* expr ::= expr ISNULL|NOTNULL */
 
108275 {spanUnaryPostfix(&yygotominor.yy118,pParse,yymsp[0].major,&yymsp[-1].minor.yy118,&yymsp[0].minor.yy0);}
 
108276 break;
108277 case 215: /* expr ::= expr NOT NULL */
 
108278 {spanUnaryPostfix(&yygotominor.yy118,pParse,TK_NOTNULL,&yymsp[-2].minor.yy118,&yymsp[0].minor.yy0);}
 
108279 break;
108280 case 216: /* expr ::= expr IS expr */
 
108281 {
108282 spanBinaryExpr(&yygotominor.yy118,pParse,TK_IS,&yymsp[-2].minor.yy118,&yymsp[0].minor.yy118);
108283 binaryToUnaryIfNull(pParse, yymsp[0].minor.yy118.pExpr, yygotominor.yy118.pExpr, TK_ISNULL);
108284 }
 
108285 break;
108286 case 217: /* expr ::= expr IS NOT expr */
 
108287 {
108288 spanBinaryExpr(&yygotominor.yy118,pParse,TK_ISNOT,&yymsp[-3].minor.yy118,&yymsp[0].minor.yy118);
108289 binaryToUnaryIfNull(pParse, yymsp[0].minor.yy118.pExpr, yygotominor.yy118.pExpr, TK_NOTNULL);
108290 }
 
108291 break;
108292 case 218: /* expr ::= NOT expr */
108293 case 219: /* expr ::= BITNOT expr */ yytestcase(yyruleno==219);
 
108294 {spanUnaryPrefix(&yygotominor.yy118,pParse,yymsp[-1].major,&yymsp[0].minor.yy118,&yymsp[-1].minor.yy0);}
 
108295 break;
108296 case 220: /* expr ::= MINUS expr */
 
108297 {spanUnaryPrefix(&yygotominor.yy118,pParse,TK_UMINUS,&yymsp[0].minor.yy118,&yymsp[-1].minor.yy0);}
 
108298 break;
108299 case 221: /* expr ::= PLUS expr */
 
108300 {spanUnaryPrefix(&yygotominor.yy118,pParse,TK_UPLUS,&yymsp[0].minor.yy118,&yymsp[-1].minor.yy0);}
 
108301 break;
108302 case 224: /* expr ::= expr between_op expr AND expr */
 
108303 {
108304 ExprList *pList = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy118.pExpr);
108305 pList = sqlite3ExprListAppend(pParse,pList, yymsp[0].minor.yy118.pExpr);
108306 yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_BETWEEN, yymsp[-4].minor.yy118.pExpr, 0, 0);
108307 if( yygotominor.yy118.pExpr ){
@@ -108661,14 +108311,12 @@
108311 }
108312 if( yymsp[-3].minor.yy4 ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0);
108313 yygotominor.yy118.zStart = yymsp[-4].minor.yy118.zStart;
108314 yygotominor.yy118.zEnd = yymsp[0].minor.yy118.zEnd;
108315 }
 
108316 break;
108317 case 227: /* expr ::= expr in_op LP exprlist RP */
 
108318 {
108319 if( yymsp[-1].minor.yy322==0 ){
108320 /* Expressions of the form
108321 **
108322 ** expr1 IN ()
@@ -108690,14 +108338,12 @@
108338 if( yymsp[-3].minor.yy4 ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0);
108339 }
108340 yygotominor.yy118.zStart = yymsp[-4].minor.yy118.zStart;
108341 yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
108342 }
 
108343 break;
108344 case 228: /* expr ::= LP select RP */
 
108345 {
108346 yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_SELECT, 0, 0, 0);
108347 if( yygotominor.yy118.pExpr ){
108348 yygotominor.yy118.pExpr->x.pSelect = yymsp[-1].minor.yy387;
108349 ExprSetProperty(yygotominor.yy118.pExpr, EP_xIsSelect);
@@ -108706,14 +108352,12 @@
108352 sqlite3SelectDelete(pParse->db, yymsp[-1].minor.yy387);
108353 }
108354 yygotominor.yy118.zStart = yymsp[-2].minor.yy0.z;
108355 yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
108356 }
 
108357 break;
108358 case 229: /* expr ::= expr in_op LP select RP */
 
108359 {
108360 yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy118.pExpr, 0, 0);
108361 if( yygotominor.yy118.pExpr ){
108362 yygotominor.yy118.pExpr->x.pSelect = yymsp[-1].minor.yy387;
108363 ExprSetProperty(yygotominor.yy118.pExpr, EP_xIsSelect);
@@ -108723,14 +108367,12 @@
108367 }
108368 if( yymsp[-3].minor.yy4 ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0);
108369 yygotominor.yy118.zStart = yymsp[-4].minor.yy118.zStart;
108370 yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
108371 }
 
108372 break;
108373 case 230: /* expr ::= expr in_op nm dbnm */
 
108374 {
108375 SrcList *pSrc = sqlite3SrcListAppend(pParse->db, 0,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0);
108376 yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_IN, yymsp[-3].minor.yy118.pExpr, 0, 0);
108377 if( yygotominor.yy118.pExpr ){
108378 yygotominor.yy118.pExpr->x.pSelect = sqlite3SelectNew(pParse, 0,pSrc,0,0,0,0,0,0,0);
@@ -108741,14 +108383,12 @@
108383 }
108384 if( yymsp[-2].minor.yy4 ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0);
108385 yygotominor.yy118.zStart = yymsp[-3].minor.yy118.zStart;
108386 yygotominor.yy118.zEnd = yymsp[0].minor.yy0.z ? &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n] : &yymsp[-1].minor.yy0.z[yymsp[-1].minor.yy0.n];
108387 }
 
108388 break;
108389 case 231: /* expr ::= EXISTS LP select RP */
 
108390 {
108391 Expr *p = yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_EXISTS, 0, 0, 0);
108392 if( p ){
108393 p->x.pSelect = yymsp[-1].minor.yy387;
108394 ExprSetProperty(p, EP_xIsSelect);
@@ -108757,14 +108397,12 @@
108397 sqlite3SelectDelete(pParse->db, yymsp[-1].minor.yy387);
108398 }
108399 yygotominor.yy118.zStart = yymsp[-3].minor.yy0.z;
108400 yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
108401 }
 
108402 break;
108403 case 232: /* expr ::= CASE case_operand case_exprlist case_else END */
 
108404 {
108405 yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_CASE, yymsp[-3].minor.yy314, yymsp[-1].minor.yy314, 0);
108406 if( yygotominor.yy118.pExpr ){
108407 yygotominor.yy118.pExpr->x.pList = yymsp[-2].minor.yy322;
108408 sqlite3ExprSetHeight(pParse, yygotominor.yy118.pExpr);
@@ -108772,50 +108410,38 @@
108410 sqlite3ExprListDelete(pParse->db, yymsp[-2].minor.yy322);
108411 }
108412 yygotominor.yy118.zStart = yymsp[-4].minor.yy0.z;
108413 yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
108414 }
 
108415 break;
108416 case 233: /* case_exprlist ::= case_exprlist WHEN expr THEN expr */
 
108417 {
108418 yygotominor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy322, yymsp[-2].minor.yy118.pExpr);
108419 yygotominor.yy322 = sqlite3ExprListAppend(pParse,yygotominor.yy322, yymsp[0].minor.yy118.pExpr);
108420 }
 
108421 break;
108422 case 234: /* case_exprlist ::= WHEN expr THEN expr */
 
108423 {
108424 yygotominor.yy322 = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy118.pExpr);
108425 yygotominor.yy322 = sqlite3ExprListAppend(pParse,yygotominor.yy322, yymsp[0].minor.yy118.pExpr);
108426 }
 
108427 break;
108428 case 243: /* cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP idxlist RP */
 
108429 {
108430 sqlite3CreateIndex(pParse, &yymsp[-6].minor.yy0, &yymsp[-5].minor.yy0,
108431 sqlite3SrcListAppend(pParse->db,0,&yymsp[-3].minor.yy0,0), yymsp[-1].minor.yy322, yymsp[-9].minor.yy4,
108432 &yymsp[-10].minor.yy0, &yymsp[0].minor.yy0, SQLITE_SO_ASC, yymsp[-7].minor.yy4);
108433 }
 
108434 break;
108435 case 244: /* uniqueflag ::= UNIQUE */
108436 case 298: /* raisetype ::= ABORT */ yytestcase(yyruleno==298);
 
108437 {yygotominor.yy4 = OE_Abort;}
 
108438 break;
108439 case 245: /* uniqueflag ::= */
 
108440 {yygotominor.yy4 = OE_None;}
 
108441 break;
108442 case 248: /* idxlist ::= idxlist COMMA nm collate sortorder */
 
108443 {
108444 Expr *p = 0;
108445 if( yymsp[-1].minor.yy0.n>0 ){
108446 p = sqlite3Expr(pParse->db, TK_COLUMN, 0);
108447 sqlite3ExprSetCollByToken(pParse, p, &yymsp[-1].minor.yy0);
@@ -108823,14 +108449,12 @@
108449 yygotominor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy322, p);
108450 sqlite3ExprListSetName(pParse,yygotominor.yy322,&yymsp[-2].minor.yy0,1);
108451 sqlite3ExprListCheckLength(pParse, yygotominor.yy322, "index");
108452 if( yygotominor.yy322 ) yygotominor.yy322->a[yygotominor.yy322->nExpr-1].sortOrder = (u8)yymsp[0].minor.yy4;
108453 }
 
108454 break;
108455 case 249: /* idxlist ::= nm collate sortorder */
 
108456 {
108457 Expr *p = 0;
108458 if( yymsp[-1].minor.yy0.n>0 ){
108459 p = sqlite3PExpr(pParse, TK_COLUMN, 0, 0, 0);
108460 sqlite3ExprSetCollByToken(pParse, p, &yymsp[-1].minor.yy0);
@@ -108838,307 +108462,214 @@
108462 yygotominor.yy322 = sqlite3ExprListAppend(pParse,0, p);
108463 sqlite3ExprListSetName(pParse, yygotominor.yy322, &yymsp[-2].minor.yy0, 1);
108464 sqlite3ExprListCheckLength(pParse, yygotominor.yy322, "index");
108465 if( yygotominor.yy322 ) yygotominor.yy322->a[yygotominor.yy322->nExpr-1].sortOrder = (u8)yymsp[0].minor.yy4;
108466 }
 
108467 break;
108468 case 250: /* collate ::= */
 
108469 {yygotominor.yy0.z = 0; yygotominor.yy0.n = 0;}
 
108470 break;
108471 case 252: /* cmd ::= DROP INDEX ifexists fullname */
 
108472 {sqlite3DropIndex(pParse, yymsp[0].minor.yy259, yymsp[-1].minor.yy4);}
 
108473 break;
108474 case 253: /* cmd ::= VACUUM */
108475 case 254: /* cmd ::= VACUUM nm */ yytestcase(yyruleno==254);
 
108476 {sqlite3Vacuum(pParse);}
 
108477 break;
108478 case 255: /* cmd ::= PRAGMA nm dbnm */
 
108479 {sqlite3Pragma(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,0,0);}
 
108480 break;
108481 case 256: /* cmd ::= PRAGMA nm dbnm EQ nmnum */
 
108482 {sqlite3Pragma(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0,0);}
 
108483 break;
108484 case 257: /* cmd ::= PRAGMA nm dbnm LP nmnum RP */
 
108485 {sqlite3Pragma(pParse,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,&yymsp[-1].minor.yy0,0);}
 
108486 break;
108487 case 258: /* cmd ::= PRAGMA nm dbnm EQ minus_num */
 
108488 {sqlite3Pragma(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0,1);}
 
108489 break;
108490 case 259: /* cmd ::= PRAGMA nm dbnm LP minus_num RP */
 
108491 {sqlite3Pragma(pParse,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,&yymsp[-1].minor.yy0,1);}
 
108492 break;
108493 case 270: /* cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END */
 
108494 {
108495 Token all;
108496 all.z = yymsp[-3].minor.yy0.z;
108497 all.n = (int)(yymsp[0].minor.yy0.z - yymsp[-3].minor.yy0.z) + yymsp[0].minor.yy0.n;
108498 sqlite3FinishTrigger(pParse, yymsp[-1].minor.yy203, &all);
108499 }
 
108500 break;
108501 case 271: /* trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause */
 
108502 {
108503 sqlite3BeginTrigger(pParse, &yymsp[-7].minor.yy0, &yymsp[-6].minor.yy0, yymsp[-5].minor.yy4, yymsp[-4].minor.yy90.a, yymsp[-4].minor.yy90.b, yymsp[-2].minor.yy259, yymsp[0].minor.yy314, yymsp[-10].minor.yy4, yymsp[-8].minor.yy4);
108504 yygotominor.yy0 = (yymsp[-6].minor.yy0.n==0?yymsp[-7].minor.yy0:yymsp[-6].minor.yy0);
108505 }
 
108506 break;
108507 case 272: /* trigger_time ::= BEFORE */
108508 case 275: /* trigger_time ::= */ yytestcase(yyruleno==275);
 
108509 { yygotominor.yy4 = TK_BEFORE; }
 
108510 break;
108511 case 273: /* trigger_time ::= AFTER */
 
108512 { yygotominor.yy4 = TK_AFTER; }
 
108513 break;
108514 case 274: /* trigger_time ::= INSTEAD OF */
 
108515 { yygotominor.yy4 = TK_INSTEAD;}
 
108516 break;
108517 case 276: /* trigger_event ::= DELETE|INSERT */
108518 case 277: /* trigger_event ::= UPDATE */ yytestcase(yyruleno==277);
 
108519 {yygotominor.yy90.a = yymsp[0].major; yygotominor.yy90.b = 0;}
 
108520 break;
108521 case 278: /* trigger_event ::= UPDATE OF inscollist */
 
108522 {yygotominor.yy90.a = TK_UPDATE; yygotominor.yy90.b = yymsp[0].minor.yy384;}
 
108523 break;
108524 case 281: /* when_clause ::= */
108525 case 303: /* key_opt ::= */ yytestcase(yyruleno==303);
 
108526 { yygotominor.yy314 = 0; }
 
108527 break;
108528 case 282: /* when_clause ::= WHEN expr */
108529 case 304: /* key_opt ::= KEY expr */ yytestcase(yyruleno==304);
 
108530 { yygotominor.yy314 = yymsp[0].minor.yy118.pExpr; }
 
108531 break;
108532 case 283: /* trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI */
 
108533 {
108534 assert( yymsp[-2].minor.yy203!=0 );
108535 yymsp[-2].minor.yy203->pLast->pNext = yymsp[-1].minor.yy203;
108536 yymsp[-2].minor.yy203->pLast = yymsp[-1].minor.yy203;
108537 yygotominor.yy203 = yymsp[-2].minor.yy203;
108538 }
 
108539 break;
108540 case 284: /* trigger_cmd_list ::= trigger_cmd SEMI */
 
108541 {
108542 assert( yymsp[-1].minor.yy203!=0 );
108543 yymsp[-1].minor.yy203->pLast = yymsp[-1].minor.yy203;
108544 yygotominor.yy203 = yymsp[-1].minor.yy203;
108545 }
 
108546 break;
108547 case 286: /* trnm ::= nm DOT nm */
 
108548 {
108549 yygotominor.yy0 = yymsp[0].minor.yy0;
108550 sqlite3ErrorMsg(pParse,
108551 "qualified table names are not allowed on INSERT, UPDATE, and DELETE "
108552 "statements within triggers");
108553 }
 
108554 break;
108555 case 288: /* tridxby ::= INDEXED BY nm */
 
108556 {
108557 sqlite3ErrorMsg(pParse,
108558 "the INDEXED BY clause is not allowed on UPDATE or DELETE statements "
108559 "within triggers");
108560 }
 
108561 break;
108562 case 289: /* tridxby ::= NOT INDEXED */
 
108563 {
108564 sqlite3ErrorMsg(pParse,
108565 "the NOT INDEXED clause is not allowed on UPDATE or DELETE statements "
108566 "within triggers");
108567 }
 
108568 break;
108569 case 290: /* trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist where_opt */
 
108570 { yygotominor.yy203 = sqlite3TriggerUpdateStep(pParse->db, &yymsp[-4].minor.yy0, yymsp[-1].minor.yy322, yymsp[0].minor.yy314, yymsp[-5].minor.yy210); }
 
108571 break;
108572 case 291: /* trigger_cmd ::= insert_cmd INTO trnm inscollist_opt VALUES LP itemlist RP */
 
108573 {yygotominor.yy203 = sqlite3TriggerInsertStep(pParse->db, &yymsp[-5].minor.yy0, yymsp[-4].minor.yy384, yymsp[-1].minor.yy322, 0, yymsp[-7].minor.yy210);}
 
108574 break;
108575 case 292: /* trigger_cmd ::= insert_cmd INTO trnm inscollist_opt select */
 
108576 {yygotominor.yy203 = sqlite3TriggerInsertStep(pParse->db, &yymsp[-2].minor.yy0, yymsp[-1].minor.yy384, 0, yymsp[0].minor.yy387, yymsp[-4].minor.yy210);}
 
108577 break;
108578 case 293: /* trigger_cmd ::= DELETE FROM trnm tridxby where_opt */
 
108579 {yygotominor.yy203 = sqlite3TriggerDeleteStep(pParse->db, &yymsp[-2].minor.yy0, yymsp[0].minor.yy314);}
 
108580 break;
108581 case 294: /* trigger_cmd ::= select */
 
108582 {yygotominor.yy203 = sqlite3TriggerSelectStep(pParse->db, yymsp[0].minor.yy387); }
 
108583 break;
108584 case 295: /* expr ::= RAISE LP IGNORE RP */
 
108585 {
108586 yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_RAISE, 0, 0, 0);
108587 if( yygotominor.yy118.pExpr ){
108588 yygotominor.yy118.pExpr->affinity = OE_Ignore;
108589 }
108590 yygotominor.yy118.zStart = yymsp[-3].minor.yy0.z;
108591 yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
108592 }
 
108593 break;
108594 case 296: /* expr ::= RAISE LP raisetype COMMA nm RP */
 
108595 {
108596 yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_RAISE, 0, 0, &yymsp[-1].minor.yy0);
108597 if( yygotominor.yy118.pExpr ) {
108598 yygotominor.yy118.pExpr->affinity = (char)yymsp[-3].minor.yy4;
108599 }
108600 yygotominor.yy118.zStart = yymsp[-5].minor.yy0.z;
108601 yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
108602 }
 
108603 break;
108604 case 297: /* raisetype ::= ROLLBACK */
 
108605 {yygotominor.yy4 = OE_Rollback;}
 
108606 break;
108607 case 299: /* raisetype ::= FAIL */
 
108608 {yygotominor.yy4 = OE_Fail;}
 
108609 break;
108610 case 300: /* cmd ::= DROP TRIGGER ifexists fullname */
 
108611 {
108612 sqlite3DropTrigger(pParse,yymsp[0].minor.yy259,yymsp[-1].minor.yy4);
108613 }
 
108614 break;
108615 case 301: /* cmd ::= ATTACH database_kw_opt expr AS expr key_opt */
 
108616 {
108617 sqlite3Attach(pParse, yymsp[-3].minor.yy118.pExpr, yymsp[-1].minor.yy118.pExpr, yymsp[0].minor.yy314);
108618 }
 
108619 break;
108620 case 302: /* cmd ::= DETACH database_kw_opt expr */
 
108621 {
108622 sqlite3Detach(pParse, yymsp[0].minor.yy118.pExpr);
108623 }
 
108624 break;
108625 case 307: /* cmd ::= REINDEX */
 
108626 {sqlite3Reindex(pParse, 0, 0);}
 
108627 break;
108628 case 308: /* cmd ::= REINDEX nm dbnm */
 
108629 {sqlite3Reindex(pParse, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0);}
 
108630 break;
108631 case 309: /* cmd ::= ANALYZE */
 
108632 {sqlite3Analyze(pParse, 0, 0);}
 
108633 break;
108634 case 310: /* cmd ::= ANALYZE nm dbnm */
 
108635 {sqlite3Analyze(pParse, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0);}
 
108636 break;
108637 case 311: /* cmd ::= ALTER TABLE fullname RENAME TO nm */
 
108638 {
108639 sqlite3AlterRenameTable(pParse,yymsp[-3].minor.yy259,&yymsp[0].minor.yy0);
108640 }
 
108641 break;
108642 case 312: /* cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt column */
 
108643 {
108644 sqlite3AlterFinishAddColumn(pParse, &yymsp[0].minor.yy0);
108645 }
 
108646 break;
108647 case 313: /* add_column_fullname ::= fullname */
 
108648 {
108649 pParse->db->lookaside.bEnabled = 0;
108650 sqlite3AlterBeginAddColumn(pParse, yymsp[0].minor.yy259);
108651 }
 
108652 break;
108653 case 316: /* cmd ::= create_vtab */
 
108654 {sqlite3VtabFinishParse(pParse,0);}
 
108655 break;
108656 case 317: /* cmd ::= create_vtab LP vtabarglist RP */
 
108657 {sqlite3VtabFinishParse(pParse,&yymsp[0].minor.yy0);}
 
108658 break;
108659 case 318: /* create_vtab ::= createkw VIRTUAL TABLE nm dbnm USING nm */
 
108660 {
108661 sqlite3VtabBeginParse(pParse, &yymsp[-3].minor.yy0, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0);
108662 }
 
108663 break;
108664 case 321: /* vtabarg ::= */
 
108665 {sqlite3VtabArgInit(pParse);}
 
108666 break;
108667 case 323: /* vtabargtoken ::= ANY */
108668 case 324: /* vtabargtoken ::= lp anylist RP */ yytestcase(yyruleno==324);
108669 case 325: /* lp ::= LP */ yytestcase(yyruleno==325);
 
108670 {sqlite3VtabArgExtend(pParse,&yymsp[0].minor.yy0);}
 
108671 break;
108672 default:
108673 /* (0) input ::= cmdlist */ yytestcase(yyruleno==0);
108674 /* (1) cmdlist ::= cmdlist ecmd */ yytestcase(yyruleno==1);
108675 /* (2) cmdlist ::= ecmd */ yytestcase(yyruleno==2);
@@ -109236,17 +108767,15 @@
108767 int yymajor, /* The major type of the error token */
108768 YYMINORTYPE yyminor /* The minor type of the error token */
108769 ){
108770 sqlite3ParserARG_FETCH;
108771 #define TOKEN (yyminor.yy0)
 
108772
108773 UNUSED_PARAMETER(yymajor); /* Silence some compiler warnings */
108774 assert( TOKEN.z[0] ); /* The tokenizer always gives us a token */
108775 sqlite3ErrorMsg(pParse, "near \"%T\": syntax error", &TOKEN);
108776 pParse->parseError = 1;
 
108777 sqlite3ParserARG_STORE; /* Suppress warning about unused %extra_argument variable */
108778 }
108779
108780 /*
108781 ** The following is executed when the parser accepts
@@ -109436,11 +108965,10 @@
108965 return;
108966 }
108967
108968 /************** End of parse.c ***********************************************/
108969 /************** Begin file tokenize.c ****************************************/
 
108970 /*
108971 ** 2001 September 15
108972 **
108973 ** The author disclaims copyright to this source code. In place of
108974 ** a legal notice, here is a blessing:
@@ -109502,11 +109030,10 @@
109030 ** named keywordhash.h and then included into this source file by
109031 ** the #include below.
109032 */
109033 /************** Include keywordhash.h in the middle of tokenize.c ************/
109034 /************** Begin file keywordhash.h *************************************/
 
109035 /***** This file contains automatically generated code ******
109036 **
109037 ** The code in this file has been automatically generated by
109038 **
109039 ** sqlite/tool/mkkeywordhash.c
@@ -109776,11 +109303,10 @@
109303 }
109304 #define SQLITE_N_KEYWORD 121
109305
109306 /************** End of keywordhash.h *****************************************/
109307 /************** Continuing where we left off in tokenize.c *******************/
 
109308
109309
109310 /*
109311 ** If X is a character that can be used in an identifier then
109312 ** IdChar(X) will be true. Otherwise it is false.
@@ -110241,11 +109767,10 @@
109767 return nErr;
109768 }
109769
109770 /************** End of tokenize.c ********************************************/
109771 /************** Begin file complete.c ****************************************/
 
109772 /*
109773 ** 2001 September 15
109774 **
109775 ** The author disclaims copyright to this source code. In place of
109776 ** a legal notice, here is a blessing:
@@ -110527,11 +110052,10 @@
110052 #endif /* SQLITE_OMIT_UTF16 */
110053 #endif /* SQLITE_OMIT_COMPLETE */
110054
110055 /************** End of complete.c ********************************************/
110056 /************** Begin file main.c ********************************************/
 
110057 /*
110058 ** 2001 September 15
110059 **
110060 ** The author disclaims copyright to this source code. In place of
110061 ** a legal notice, here is a blessing:
@@ -110548,11 +110072,10 @@
110072 */
110073
110074 #ifdef SQLITE_ENABLE_FTS3
110075 /************** Include fts3.h in the middle of main.c ***********************/
110076 /************** Begin file fts3.h ********************************************/
 
110077 /*
110078 ** 2006 Oct 10
110079 **
110080 ** The author disclaims copyright to this source code. In place of
110081 ** a legal notice, here is a blessing:
@@ -110577,16 +110100,14 @@
110100 } /* extern "C" */
110101 #endif /* __cplusplus */
110102
110103 /************** End of fts3.h ************************************************/
110104 /************** Continuing where we left off in main.c ***********************/
 
110105 #endif
110106 #ifdef SQLITE_ENABLE_RTREE
110107 /************** Include rtree.h in the middle of main.c **********************/
110108 /************** Begin file rtree.h *******************************************/
 
110109 /*
110110 ** 2008 May 26
110111 **
110112 ** The author disclaims copyright to this source code. In place of
110113 ** a legal notice, here is a blessing:
@@ -110611,16 +110132,14 @@
110132 } /* extern "C" */
110133 #endif /* __cplusplus */
110134
110135 /************** End of rtree.h ***********************************************/
110136 /************** Continuing where we left off in main.c ***********************/
 
110137 #endif
110138 #ifdef SQLITE_ENABLE_ICU
110139 /************** Include sqliteicu.h in the middle of main.c ******************/
110140 /************** Begin file sqliteicu.h ***************************************/
 
110141 /*
110142 ** 2008 May 26
110143 **
110144 ** The author disclaims copyright to this source code. In place of
110145 ** a legal notice, here is a blessing:
@@ -110646,11 +110165,10 @@
110165 #endif /* __cplusplus */
110166
110167
110168 /************** End of sqliteicu.h *******************************************/
110169 /************** Continuing where we left off in main.c ***********************/
 
110170 #endif
110171
110172 #ifndef SQLITE_AMALGAMATION
110173 /* IMPLEMENTATION-OF: R-46656-45156 The sqlite3_version[] string constant
110174 ** contains the text of SQLITE_VERSION macro.
@@ -113577,11 +113095,10 @@
113095 return 0;
113096 }
113097
113098 /************** End of main.c ************************************************/
113099 /************** Begin file notify.c ******************************************/
 
113100 /*
113101 ** 2009 March 3
113102 **
113103 ** The author disclaims copyright to this source code. In place of
113104 ** a legal notice, here is a blessing:
@@ -113911,11 +113428,10 @@
113428 }
113429 #endif
113430
113431 /************** End of notify.c **********************************************/
113432 /************** Begin file fts3.c ********************************************/
 
113433 /*
113434 ** 2006 Oct 10
113435 **
113436 ** The author disclaims copyright to this source code. In place of
113437 ** a legal notice, here is a blessing:
@@ -114208,11 +113724,10 @@
113724 ** into a single segment.
113725 */
113726
113727 /************** Include fts3Int.h in the middle of fts3.c ********************/
113728 /************** Begin file fts3Int.h *****************************************/
 
113729 /*
113730 ** 2009 Nov 12
113731 **
113732 ** The author disclaims copyright to this source code. In place of
113733 ** a legal notice, here is a blessing:
@@ -114247,11 +113762,10 @@
113762 SQLITE_API extern const sqlite3_api_routines *sqlite3_api;
113763 #endif
113764
113765 /************** Include fts3_tokenizer.h in the middle of fts3Int.h **********/
113766 /************** Begin file fts3_tokenizer.h **********************************/
 
113767 /*
113768 ** 2006 July 10
113769 **
113770 ** The author disclaims copyright to this source code.
113771 **
@@ -114402,14 +113916,12 @@
113916
113917 #endif /* _FTS3_TOKENIZER_H_ */
113918
113919 /************** End of fts3_tokenizer.h **************************************/
113920 /************** Continuing where we left off in fts3Int.h ********************/
 
113921 /************** Include fts3_hash.h in the middle of fts3Int.h ***************/
113922 /************** Begin file fts3_hash.h ***************************************/
 
113923 /*
113924 ** 2001 September 22
113925 **
113926 ** The author disclaims copyright to this source code. In place of
113927 ** a legal notice, here is a blessing:
@@ -114521,11 +114033,10 @@
114033
114034 #endif /* _FTS3_HASH_H_ */
114035
114036 /************** End of fts3_hash.h *******************************************/
114037 /************** Continuing where we left off in fts3Int.h ********************/
 
114038
114039 /*
114040 ** This constant controls how often segments are merged. Once there are
114041 ** FTS3_MERGE_COUNT segments of level N, they are merged into a single
114042 ** segment of level N+1.
@@ -114998,11 +114509,10 @@
114509 #endif /* !SQLITE_CORE || SQLITE_ENABLE_FTS3 */
114510 #endif /* _FTSINT_H */
114511
114512 /************** End of fts3Int.h *********************************************/
114513 /************** Continuing where we left off in fts3.c ***********************/
 
114514 #if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3)
114515
114516 #if defined(SQLITE_ENABLE_FTS3) && !defined(SQLITE_CORE)
114517 # define SQLITE_CORE 1
114518 #endif
@@ -119548,11 +119058,10 @@
119058
119059 #endif
119060
119061 /************** End of fts3.c ************************************************/
119062 /************** Begin file fts3_aux.c ****************************************/
 
119063 /*
119064 ** 2011 Jan 27
119065 **
119066 ** The author disclaims copyright to this source code. In place of
119067 ** a legal notice, here is a blessing:
@@ -120025,11 +119534,10 @@
119534
119535 #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */
119536
119537 /************** End of fts3_aux.c ********************************************/
119538 /************** Begin file fts3_expr.c ***************************************/
 
119539 /*
119540 ** 2008 Nov 28
119541 **
119542 ** The author disclaims copyright to this source code. In place of
119543 ** a legal notice, here is a blessing:
@@ -120992,11 +120500,10 @@
120500 #endif
120501 #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */
120502
120503 /************** End of fts3_expr.c *******************************************/
120504 /************** Begin file fts3_hash.c ***************************************/
 
120505 /*
120506 ** 2001 September 22
120507 **
120508 ** The author disclaims copyright to this source code. In place of
120509 ** a legal notice, here is a blessing:
@@ -121377,11 +120884,10 @@
120884
120885 #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */
120886
120887 /************** End of fts3_hash.c *******************************************/
120888 /************** Begin file fts3_porter.c *************************************/
 
120889 /*
120890 ** 2006 September 30
120891 **
120892 ** The author disclaims copyright to this source code. In place of
120893 ** a legal notice, here is a blessing:
@@ -122024,11 +121530,10 @@
121530
121531 #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */
121532
121533 /************** End of fts3_porter.c *****************************************/
121534 /************** Begin file fts3_tokenizer.c **********************************/
 
121535 /*
121536 ** 2007 June 22
121537 **
121538 ** The author disclaims copyright to this source code. In place of
121539 ** a legal notice, here is a blessing:
@@ -122516,11 +122021,10 @@
122021
122022 #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */
122023
122024 /************** End of fts3_tokenizer.c **************************************/
122025 /************** Begin file fts3_tokenizer1.c *********************************/
 
122026 /*
122027 ** 2006 Oct 10
122028 **
122029 ** The author disclaims copyright to this source code. In place of
122030 ** a legal notice, here is a blessing:
@@ -122751,11 +122255,10 @@
122255
122256 #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */
122257
122258 /************** End of fts3_tokenizer1.c *************************************/
122259 /************** Begin file fts3_write.c **************************************/
 
122260 /*
122261 ** 2009 Oct 23
122262 **
122263 ** The author disclaims copyright to this source code. In place of
122264 ** a legal notice, here is a blessing:
@@ -126022,11 +125525,10 @@
125525
125526 #endif
125527
125528 /************** End of fts3_write.c ******************************************/
125529 /************** Begin file fts3_snippet.c ************************************/
 
125530 /*
125531 ** 2009 Oct 23
125532 **
125533 ** The author disclaims copyright to this source code. In place of
125534 ** a legal notice, here is a blessing:
@@ -127524,11 +127026,10 @@
127026
127027 #endif
127028
127029 /************** End of fts3_snippet.c ****************************************/
127030 /************** Begin file rtree.c *******************************************/
 
127031 /*
127032 ** 2001 September 15
127033 **
127034 ** The author disclaims copyright to this source code. In place of
127035 ** a legal notice, here is a blessing:
@@ -130806,11 +130307,10 @@
130307
130308 #endif
130309
130310 /************** End of rtree.c ***********************************************/
130311 /************** Begin file icu.c *********************************************/
 
130312 /*
130313 ** 2007 May 6
130314 **
130315 ** The author disclaims copyright to this source code. In place of
130316 ** a legal notice, here is a blessing:
@@ -131309,11 +130809,10 @@
130809
130810 #endif
130811
130812 /************** End of icu.c *************************************************/
130813 /************** Begin file fts3_icu.c ****************************************/
 
130814 /*
130815 ** 2007 June 22
130816 **
130817 ** The author disclaims copyright to this source code. In place of
130818 ** a legal notice, here is a blessing:
130819
+1 -1
--- src/sqlite3.h
+++ src/sqlite3.h
@@ -107,11 +107,11 @@
107107
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
108108
** [sqlite_version()] and [sqlite_source_id()].
109109
*/
110110
#define SQLITE_VERSION "3.7.8"
111111
#define SQLITE_VERSION_NUMBER 3007008
112
-#define SQLITE_SOURCE_ID "2011-09-14 13:41:40 a1f3aeeb0988c848d40ce8f6da6e902935a997e2"
112
+#define SQLITE_SOURCE_ID "2011-09-17 17:29:20 b31a7d7db9040d8eedaf1ecd89ea0033f579d0f1"
113113
114114
/*
115115
** CAPI3REF: Run-Time Library Version Numbers
116116
** KEYWORDS: sqlite3_version, sqlite3_sourceid
117117
**
118118
--- src/sqlite3.h
+++ src/sqlite3.h
@@ -107,11 +107,11 @@
107 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
108 ** [sqlite_version()] and [sqlite_source_id()].
109 */
110 #define SQLITE_VERSION "3.7.8"
111 #define SQLITE_VERSION_NUMBER 3007008
112 #define SQLITE_SOURCE_ID "2011-09-14 13:41:40 a1f3aeeb0988c848d40ce8f6da6e902935a997e2"
113
114 /*
115 ** CAPI3REF: Run-Time Library Version Numbers
116 ** KEYWORDS: sqlite3_version, sqlite3_sourceid
117 **
118
--- src/sqlite3.h
+++ src/sqlite3.h
@@ -107,11 +107,11 @@
107 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
108 ** [sqlite_version()] and [sqlite_source_id()].
109 */
110 #define SQLITE_VERSION "3.7.8"
111 #define SQLITE_VERSION_NUMBER 3007008
112 #define SQLITE_SOURCE_ID "2011-09-17 17:29:20 b31a7d7db9040d8eedaf1ecd89ea0033f579d0f1"
113
114 /*
115 ** CAPI3REF: Run-Time Library Version Numbers
116 ** KEYWORDS: sqlite3_version, sqlite3_sourceid
117 **
118

Keyboard Shortcuts

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