Fossil SCM

Update the built-in SQLite amalgamation to the latest 3.7.8 beta.

drh 2011-09-14 13:45 trunk
Commit a0cf985a42a7552525c74a8e5d6c6427f9cc0146
2 files changed +699 -151 +1 -1
+699 -151
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -24,10 +24,11 @@
2424
#endif
2525
#ifndef SQLITE_API
2626
# define SQLITE_API
2727
#endif
2828
/************** Begin file sqliteInt.h ***************************************/
29
+#line 1 "tsrc/sqliteInt.h"
2930
/*
3031
** 2001 September 15
3132
**
3233
** The author disclaims copyright to this source code. In place of
3334
** a legal notice, here is a blessing:
@@ -78,10 +79,11 @@
7879
#include "config.h"
7980
#endif
8081
8182
/************** Include sqliteLimit.h in the middle of sqliteInt.h ***********/
8283
/************** Begin file sqliteLimit.h *************************************/
84
+#line 1 "tsrc/sqliteLimit.h"
8385
/*
8486
** 2007 May 7
8587
**
8688
** The author disclaims copyright to this source code. In place of
8789
** a legal notice, here is a blessing:
@@ -289,10 +291,11 @@
289291
# define SQLITE_MAX_TRIGGER_DEPTH 1000
290292
#endif
291293
292294
/************** End of sqliteLimit.h *****************************************/
293295
/************** Continuing where we left off in sqliteInt.h ******************/
296
+#line 54 "tsrc/sqliteInt.h"
294297
295298
/* Disable nuisance warnings on Borland compilers */
296299
#if defined(__BORLANDC__)
297300
#pragma warn -rch /* unreachable code */
298301
#pragma warn -ccc /* Condition is always true or false */
@@ -545,10 +548,11 @@
545548
# define unlikely(X) !!(X)
546549
#endif
547550
548551
/************** Include sqlite3.h in the middle of sqliteInt.h ***************/
549552
/************** Begin file sqlite3.h *****************************************/
553
+#line 1 "tsrc/sqlite3.h"
550554
/*
551555
** 2001 September 15
552556
**
553557
** The author disclaims copyright to this source code. In place of
554558
** a legal notice, here is a blessing:
@@ -656,11 +660,11 @@
656660
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
657661
** [sqlite_version()] and [sqlite_source_id()].
658662
*/
659663
#define SQLITE_VERSION "3.7.8"
660664
#define SQLITE_VERSION_NUMBER 3007008
661
-#define SQLITE_SOURCE_ID "2011-09-04 01:27:00 6b657ae75035eb10b0ad640998d3c9eadfdffa6e"
665
+#define SQLITE_SOURCE_ID "2011-09-14 13:41:40 a1f3aeeb0988c848d40ce8f6da6e902935a997e2"
662666
663667
/*
664668
** CAPI3REF: Run-Time Library Version Numbers
665669
** KEYWORDS: sqlite3_version, sqlite3_sourceid
666670
**
@@ -7305,12 +7309,14 @@
73057309
#endif /* ifndef _SQLITE3RTREE_H_ */
73067310
73077311
73087312
/************** End of sqlite3.h *********************************************/
73097313
/************** Continuing where we left off in sqliteInt.h ******************/
7314
+#line 309 "tsrc/sqliteInt.h"
73107315
/************** Include hash.h in the middle of sqliteInt.h ******************/
73117316
/************** Begin file hash.h ********************************************/
7317
+#line 1 "tsrc/hash.h"
73127318
/*
73137319
** 2001 September 22
73147320
**
73157321
** The author disclaims copyright to this source code. In place of
73167322
** a legal notice, here is a blessing:
@@ -7406,12 +7412,14 @@
74067412
74077413
#endif /* _SQLITE_HASH_H_ */
74087414
74097415
/************** End of hash.h ************************************************/
74107416
/************** Continuing where we left off in sqliteInt.h ******************/
7417
+#line 310 "tsrc/sqliteInt.h"
74117418
/************** Include parse.h in the middle of sqliteInt.h *****************/
74127419
/************** Begin file parse.h *******************************************/
7420
+#line 1 "tsrc/parse.h"
74137421
#define TK_SEMI 1
74147422
#define TK_EXPLAIN 2
74157423
#define TK_QUERY 3
74167424
#define TK_PLAN 4
74177425
#define TK_BEGIN 5
@@ -7568,10 +7576,11 @@
75687576
#define TK_UMINUS 156
75697577
#define TK_UPLUS 157
75707578
75717579
/************** End of parse.h ***********************************************/
75727580
/************** Continuing where we left off in sqliteInt.h ******************/
7581
+#line 311 "tsrc/sqliteInt.h"
75737582
#include <stdio.h>
75747583
#include <stdlib.h>
75757584
#include <string.h>
75767585
#include <assert.h>
75777586
#include <stddef.h>
@@ -7911,10 +7920,11 @@
79117920
** "BusyHandler" typedefs. vdbe.h also requires a few of the opaque
79127921
** pointer types (i.e. FuncDef) defined above.
79137922
*/
79147923
/************** Include btree.h in the middle of sqliteInt.h *****************/
79157924
/************** Begin file btree.h *******************************************/
7925
+#line 1 "tsrc/btree.h"
79167926
/*
79177927
** 2001 September 15
79187928
**
79197929
** The author disclaims copyright to this source code. In place of
79207930
** a legal notice, here is a blessing:
@@ -8155,12 +8165,14 @@
81558165
81568166
#endif /* _BTREE_H_ */
81578167
81588168
/************** End of btree.h ***********************************************/
81598169
/************** Continuing where we left off in sqliteInt.h ******************/
8170
+#line 653 "tsrc/sqliteInt.h"
81608171
/************** Include vdbe.h in the middle of sqliteInt.h ******************/
81618172
/************** Begin file vdbe.h ********************************************/
8173
+#line 1 "tsrc/vdbe.h"
81628174
/*
81638175
** 2001 September 15
81648176
**
81658177
** The author disclaims copyright to this source code. In place of
81668178
** a legal notice, here is a blessing:
@@ -8321,10 +8333,11 @@
83218333
** The makefile scans the vdbe.c source file and creates the "opcodes.h"
83228334
** header file that defines a number for each opcode used by the VDBE.
83238335
*/
83248336
/************** Include opcodes.h in the middle of vdbe.h ********************/
83258337
/************** Begin file opcodes.h *****************************************/
8338
+#line 1 "tsrc/opcodes.h"
83268339
/* Automatically generated. Do not edit */
83278340
/* See the mkopcodeh.awk script for details */
83288341
#define OP_Goto 1
83298342
#define OP_Gosub 2
83308343
#define OP_Return 3
@@ -8508,10 +8521,11 @@
85088521
/* 136 */ 0x00, 0x01, 0x00, 0x00, 0x02, 0x04, 0x04, 0x04,\
85098522
/* 144 */ 0x04, 0x04, 0x02, 0x00, 0x00, 0x00,}
85108523
85118524
/************** End of opcodes.h *********************************************/
85128525
/************** Continuing where we left off in vdbe.h ***********************/
8526
+#line 164 "tsrc/vdbe.h"
85138527
85148528
/*
85158529
** Prototypes for the VDBE interface. See comments on the implementation
85168530
** for a description of what each of these routines does.
85178531
*/
@@ -8559,13 +8573,13 @@
85598573
SQLITE_PRIVATE void sqlite3VdbeSetVarmask(Vdbe*, int);
85608574
#ifndef SQLITE_OMIT_TRACE
85618575
SQLITE_PRIVATE char *sqlite3VdbeExpandSql(Vdbe*, const char*);
85628576
#endif
85638577
8564
-SQLITE_PRIVATE UnpackedRecord *sqlite3VdbeRecordUnpack(KeyInfo*,int,const void*,char*,int);
8565
-SQLITE_PRIVATE void sqlite3VdbeDeleteUnpackedRecord(UnpackedRecord*);
8578
+SQLITE_PRIVATE void sqlite3VdbeRecordUnpack(KeyInfo*,int,const void*,UnpackedRecord*);
85668579
SQLITE_PRIVATE int sqlite3VdbeRecordCompare(int,const void*,UnpackedRecord*);
8580
+SQLITE_PRIVATE UnpackedRecord *sqlite3VdbeAllocUnpackedRecord(KeyInfo *, char *, int, char **);
85678581
85688582
#ifndef SQLITE_OMIT_TRIGGER
85698583
SQLITE_PRIVATE void sqlite3VdbeLinkSubProgram(Vdbe *, SubProgram *);
85708584
#endif
85718585
@@ -8582,12 +8596,14 @@
85828596
85838597
#endif
85848598
85858599
/************** End of vdbe.h ************************************************/
85868600
/************** Continuing where we left off in sqliteInt.h ******************/
8601
+#line 654 "tsrc/sqliteInt.h"
85878602
/************** Include pager.h in the middle of sqliteInt.h *****************/
85888603
/************** Begin file pager.h *******************************************/
8604
+#line 1 "tsrc/pager.h"
85898605
/*
85908606
** 2001 September 15
85918607
**
85928608
** The author disclaims copyright to this source code. In place of
85938609
** a legal notice, here is a blessing:
@@ -8769,12 +8785,14 @@
87698785
87708786
#endif /* _PAGER_H_ */
87718787
87728788
/************** End of pager.h ***********************************************/
87738789
/************** Continuing where we left off in sqliteInt.h ******************/
8790
+#line 655 "tsrc/sqliteInt.h"
87748791
/************** Include pcache.h in the middle of sqliteInt.h ****************/
87758792
/************** Begin file pcache.h ******************************************/
8793
+#line 1 "tsrc/pcache.h"
87768794
/*
87778795
** 2008 August 05
87788796
**
87798797
** The author disclaims copyright to this source code. In place of
87808798
** a legal notice, here is a blessing:
@@ -8929,13 +8947,15 @@
89298947
89308948
#endif /* _PCACHE_H_ */
89318949
89328950
/************** End of pcache.h **********************************************/
89338951
/************** Continuing where we left off in sqliteInt.h ******************/
8952
+#line 656 "tsrc/sqliteInt.h"
89348953
89358954
/************** Include os.h in the middle of sqliteInt.h ********************/
89368955
/************** Begin file os.h **********************************************/
8956
+#line 1 "tsrc/os.h"
89378957
/*
89388958
** 2001 September 16
89398959
**
89408960
** The author disclaims copyright to this source code. In place of
89418961
** a legal notice, here is a blessing:
@@ -9214,12 +9234,14 @@
92149234
92159235
#endif /* _SQLITE_OS_H_ */
92169236
92179237
/************** End of os.h **************************************************/
92189238
/************** Continuing where we left off in sqliteInt.h ******************/
9239
+#line 658 "tsrc/sqliteInt.h"
92199240
/************** Include mutex.h in the middle of sqliteInt.h *****************/
92209241
/************** Begin file mutex.h *******************************************/
9242
+#line 1 "tsrc/mutex.h"
92219243
/*
92229244
** 2007 August 28
92239245
**
92249246
** The author disclaims copyright to this source code. In place of
92259247
** a legal notice, here is a blessing:
@@ -9290,10 +9312,11 @@
92909312
#define sqlite3MutexEnd()
92919313
#endif /* defined(SQLITE_MUTEX_OMIT) */
92929314
92939315
/************** End of mutex.h ***********************************************/
92949316
/************** Continuing where we left off in sqliteInt.h ******************/
9317
+#line 659 "tsrc/sqliteInt.h"
92959318
92969319
92979320
/*
92989321
** Each database file to be accessed by the system is an instance
92999322
** of the following structure. There are normally two of these structures
@@ -11892,10 +11915,11 @@
1189211915
1189311916
#endif /* _SQLITEINT_H_ */
1189411917
1189511918
/************** End of sqliteInt.h *******************************************/
1189611919
/************** Begin file global.c ******************************************/
11920
+#line 1 "tsrc/global.c"
1189711921
/*
1189811922
** 2008 June 13
1189911923
**
1190011924
** The author disclaims copyright to this source code. In place of
1190111925
** a legal notice, here is a blessing:
@@ -12114,10 +12138,11 @@
1211412138
*/
1211512139
SQLITE_PRIVATE const unsigned char sqlite3OpcodeProperty[] = OPFLG_INITIALIZER;
1211612140
1211712141
/************** End of global.c **********************************************/
1211812142
/************** Begin file ctime.c *******************************************/
12143
+#line 1 "tsrc/ctime.c"
1211912144
/*
1212012145
** 2010 February 23
1212112146
**
1212212147
** The author disclaims copyright to this source code. In place of
1212312148
** a legal notice, here is a blessing:
@@ -12518,10 +12543,11 @@
1251812543
1251912544
#endif /* SQLITE_OMIT_COMPILEOPTION_DIAGS */
1252012545
1252112546
/************** End of ctime.c ***********************************************/
1252212547
/************** Begin file status.c ******************************************/
12548
+#line 1 "tsrc/status.c"
1252312549
/*
1252412550
** 2008 June 18
1252512551
**
1252612552
** The author disclaims copyright to this source code. In place of
1252712553
** a legal notice, here is a blessing:
@@ -12535,10 +12561,11 @@
1253512561
** This module implements the sqlite3_status() interface and related
1253612562
** functionality.
1253712563
*/
1253812564
/************** Include vdbeInt.h in the middle of status.c ******************/
1253912565
/************** Begin file vdbeInt.h *****************************************/
12566
+#line 1 "tsrc/vdbeInt.h"
1254012567
/*
1254112568
** 2003 September 6
1254212569
**
1254312570
** The author disclaims copyright to this source code. In place of
1254412571
** a legal notice, here is a blessing:
@@ -12986,10 +13013,11 @@
1298613013
1298713014
#endif /* !defined(_VDBEINT_H_) */
1298813015
1298913016
/************** End of vdbeInt.h *********************************************/
1299013017
/************** Continuing where we left off in status.c *********************/
13018
+#line 18 "tsrc/status.c"
1299113019
1299213020
/*
1299313021
** Variables in which to record status information.
1299413022
*/
1299513023
typedef struct sqlite3StatType sqlite3StatType;
@@ -13199,10 +13227,11 @@
1319913227
return rc;
1320013228
}
1320113229
1320213230
/************** End of status.c **********************************************/
1320313231
/************** Begin file date.c ********************************************/
13232
+#line 1 "tsrc/date.c"
1320413233
/*
1320513234
** 2003 October 31
1320613235
**
1320713236
** The author disclaims copyright to this source code. In place of
1320813237
** a legal notice, here is a blessing:
@@ -14326,10 +14355,11 @@
1432614355
}
1432714356
}
1432814357
1432914358
/************** End of date.c ************************************************/
1433014359
/************** Begin file os.c **********************************************/
14360
+#line 1 "tsrc/os.c"
1433114361
/*
1433214362
** 2005 November 29
1433314363
**
1433414364
** The author disclaims copyright to this source code. In place of
1433514365
** a legal notice, here is a blessing:
@@ -14659,10 +14689,11 @@
1465914689
return SQLITE_OK;
1466014690
}
1466114691
1466214692
/************** End of os.c **************************************************/
1466314693
/************** Begin file fault.c *******************************************/
14694
+#line 1 "tsrc/fault.c"
1466414695
/*
1466514696
** 2008 Jan 22
1466614697
**
1466714698
** The author disclaims copyright to this source code. In place of
1466814699
** a legal notice, here is a blessing:
@@ -14748,10 +14779,11 @@
1474814779
1474914780
#endif /* #ifndef SQLITE_OMIT_BUILTIN_TEST */
1475014781
1475114782
/************** End of fault.c ***********************************************/
1475214783
/************** Begin file mem0.c ********************************************/
14784
+#line 1 "tsrc/mem0.c"
1475314785
/*
1475414786
** 2008 October 28
1475514787
**
1475614788
** The author disclaims copyright to this source code. In place of
1475714789
** a legal notice, here is a blessing:
@@ -14809,10 +14841,11 @@
1480914841
1481014842
#endif /* SQLITE_ZERO_MALLOC */
1481114843
1481214844
/************** End of mem0.c ************************************************/
1481314845
/************** Begin file mem1.c ********************************************/
14846
+#line 1 "tsrc/mem1.c"
1481414847
/*
1481514848
** 2007 August 14
1481614849
**
1481714850
** The author disclaims copyright to this source code. In place of
1481814851
** a legal notice, here is a blessing:
@@ -14961,10 +14994,11 @@
1496114994
1496214995
#endif /* SQLITE_SYSTEM_MALLOC */
1496314996
1496414997
/************** End of mem1.c ************************************************/
1496514998
/************** Begin file mem2.c ********************************************/
14999
+#line 1 "tsrc/mem2.c"
1496615000
/*
1496715001
** 2007 August 15
1496815002
**
1496915003
** The author disclaims copyright to this source code. In place of
1497015004
** a legal notice, here is a blessing:
@@ -15491,10 +15525,11 @@
1549115525
1549215526
#endif /* SQLITE_MEMDEBUG */
1549315527
1549415528
/************** End of mem2.c ************************************************/
1549515529
/************** Begin file mem3.c ********************************************/
15530
+#line 1 "tsrc/mem3.c"
1549615531
/*
1549715532
** 2007 October 14
1549815533
**
1549915534
** The author disclaims copyright to this source code. In place of
1550015535
** a legal notice, here is a blessing:
@@ -16180,10 +16215,11 @@
1618016215
1618116216
#endif /* SQLITE_ENABLE_MEMSYS3 */
1618216217
1618316218
/************** End of mem3.c ************************************************/
1618416219
/************** Begin file mem5.c ********************************************/
16220
+#line 1 "tsrc/mem5.c"
1618516221
/*
1618616222
** 2007 October 14
1618716223
**
1618816224
** The author disclaims copyright to this source code. In place of
1618916225
** a legal notice, here is a blessing:
@@ -16763,10 +16799,11 @@
1676316799
1676416800
#endif /* SQLITE_ENABLE_MEMSYS5 */
1676516801
1676616802
/************** End of mem5.c ************************************************/
1676716803
/************** Begin file mutex.c *******************************************/
16804
+#line 1 "tsrc/mutex.c"
1676816805
/*
1676916806
** 2007 August 14
1677016807
**
1677116808
** The author disclaims copyright to this source code. In place of
1677216809
** a legal notice, here is a blessing:
@@ -16918,10 +16955,11 @@
1691816955
1691916956
#endif /* SQLITE_MUTEX_OMIT */
1692016957
1692116958
/************** End of mutex.c ***********************************************/
1692216959
/************** Begin file mutex_noop.c **************************************/
16960
+#line 1 "tsrc/mutex_noop.c"
1692316961
/*
1692416962
** 2008 October 07
1692516963
**
1692616964
** The author disclaims copyright to this source code. In place of
1692716965
** a legal notice, here is a blessing:
@@ -17126,10 +17164,11 @@
1712617164
#endif /* SQLITE_MUTEX_NOOP */
1712717165
#endif /* SQLITE_MUTEX_OMIT */
1712817166
1712917167
/************** End of mutex_noop.c ******************************************/
1713017168
/************** Begin file mutex_os2.c ***************************************/
17169
+#line 1 "tsrc/mutex_os2.c"
1713117170
/*
1713217171
** 2007 August 28
1713317172
**
1713417173
** The author disclaims copyright to this source code. In place of
1713517174
** a legal notice, here is a blessing:
@@ -17402,10 +17441,11 @@
1740217441
}
1740317442
#endif /* SQLITE_MUTEX_OS2 */
1740417443
1740517444
/************** End of mutex_os2.c *******************************************/
1740617445
/************** Begin file mutex_unix.c **************************************/
17446
+#line 1 "tsrc/mutex_unix.c"
1740717447
/*
1740817448
** 2007 August 28
1740917449
**
1741017450
** The author disclaims copyright to this source code. In place of
1741117451
** a legal notice, here is a blessing:
@@ -17755,10 +17795,11 @@
1775517795
1775617796
#endif /* SQLITE_MUTEX_PTHREAD */
1775717797
1775817798
/************** End of mutex_unix.c ******************************************/
1775917799
/************** Begin file mutex_w32.c ***************************************/
17800
+#line 1 "tsrc/mutex_w32.c"
1776017801
/*
1776117802
** 2007 August 14
1776217803
**
1776317804
** The author disclaims copyright to this source code. In place of
1776417805
** a legal notice, here is a blessing:
@@ -18089,10 +18130,11 @@
1808918130
}
1809018131
#endif /* SQLITE_MUTEX_W32 */
1809118132
1809218133
/************** End of mutex_w32.c *******************************************/
1809318134
/************** Begin file malloc.c ******************************************/
18135
+#line 1 "tsrc/malloc.c"
1809418136
/*
1809518137
** 2001 September 15
1809618138
**
1809718139
** The author disclaims copyright to this source code. In place of
1809818140
** a legal notice, here is a blessing:
@@ -18868,10 +18910,11 @@
1886818910
return rc & (db ? db->errMask : 0xff);
1886918911
}
1887018912
1887118913
/************** End of malloc.c **********************************************/
1887218914
/************** Begin file printf.c ******************************************/
18915
+#line 1 "tsrc/printf.c"
1887318916
/*
1887418917
** The "printf" code that follows dates from the 1980's. It is in
1887518918
** the public domain. The original comments are included here for
1887618919
** completeness. They are very out-of-date but might be useful as
1887718920
** an historical reference. Most of the "enhancements" have been backed
@@ -19899,10 +19942,11 @@
1989919942
}
1990019943
#endif
1990119944
1990219945
/************** End of printf.c **********************************************/
1990319946
/************** Begin file random.c ******************************************/
19947
+#line 1 "tsrc/random.c"
1990419948
/*
1990519949
** 2001 September 15
1990619950
**
1990719951
** The author disclaims copyright to this source code. In place of
1990819952
** a legal notice, here is a blessing:
@@ -20046,10 +20090,11 @@
2004620090
}
2004720091
#endif /* SQLITE_OMIT_BUILTIN_TEST */
2004820092
2004920093
/************** End of random.c **********************************************/
2005020094
/************** Begin file utf.c *********************************************/
20095
+#line 1 "tsrc/utf.c"
2005120096
/*
2005220097
** 2004 April 13
2005320098
**
2005420099
** The author disclaims copyright to this source code. In place of
2005520100
** a legal notice, here is a blessing:
@@ -20607,10 +20652,11 @@
2060720652
#endif /* SQLITE_TEST */
2060820653
#endif /* SQLITE_OMIT_UTF16 */
2060920654
2061020655
/************** End of utf.c *************************************************/
2061120656
/************** Begin file util.c ********************************************/
20657
+#line 1 "tsrc/util.c"
2061220658
/*
2061320659
** 2001 September 15
2061420660
**
2061520661
** The author disclaims copyright to this source code. In place of
2061620662
** a legal notice, here is a blessing:
@@ -21789,10 +21835,11 @@
2178921835
}
2179021836
#endif
2179121837
2179221838
/************** End of util.c ************************************************/
2179321839
/************** Begin file hash.c ********************************************/
21840
+#line 1 "tsrc/hash.c"
2179421841
/*
2179521842
** 2001 September 22
2179621843
**
2179721844
** The author disclaims copyright to this source code. In place of
2179821845
** a legal notice, here is a blessing:
@@ -22068,10 +22115,11 @@
2206822115
return 0;
2206922116
}
2207022117
2207122118
/************** End of hash.c ************************************************/
2207222119
/************** Begin file opcodes.c *****************************************/
22120
+#line 1 "tsrc/opcodes.c"
2207322121
/* Automatically generated. Do not edit */
2207422122
/* See the mkopcodec.awk script for details. */
2207522123
#if !defined(SQLITE_OMIT_EXPLAIN) || !defined(NDEBUG) || defined(VDBE_PROFILE) || defined(SQLITE_DEBUG)
2207622124
SQLITE_PRIVATE const char *sqlite3OpcodeName(int i){
2207722125
static const char *const azName[] = { "?",
@@ -22229,10 +22277,11 @@
2222922277
}
2223022278
#endif
2223122279
2223222280
/************** End of opcodes.c *********************************************/
2223322281
/************** Begin file os_os2.c ******************************************/
22282
+#line 1 "tsrc/os_os2.c"
2223422283
/*
2223522284
** 2006 Feb 14
2223622285
**
2223722286
** The author disclaims copyright to this source code. In place of
2223822287
** a legal notice, here is a blessing:
@@ -22285,10 +22334,11 @@
2228522334
/*
2228622335
** Include code that is common to all os_*.c files
2228722336
*/
2228822337
/************** Include os_common.h in the middle of os_os2.c ****************/
2228922338
/************** Begin file os_common.h ***************************************/
22339
+#line 1 "tsrc/os_common.h"
2229022340
/*
2229122341
** 2004 May 22
2229222342
**
2229322343
** The author disclaims copyright to this source code. In place of
2229422344
** a legal notice, here is a blessing:
@@ -22338,10 +22388,11 @@
2233822388
** hwtime.h contains inline assembler code for implementing
2233922389
** high-performance timing routines.
2234022390
*/
2234122391
/************** Include hwtime.h in the middle of os_common.h ****************/
2234222392
/************** Begin file hwtime.h ******************************************/
22393
+#line 1 "tsrc/hwtime.h"
2234322394
/*
2234422395
** 2008 May 27
2234522396
**
2234622397
** The author disclaims copyright to this source code. In place of
2234722398
** a legal notice, here is a blessing:
@@ -22426,10 +22477,11 @@
2242622477
2242722478
#endif /* !defined(_HWTIME_H_) */
2242822479
2242922480
/************** End of hwtime.h **********************************************/
2243022481
/************** Continuing where we left off in os_common.h ******************/
22482
+#line 53 "tsrc/os_common.h"
2243122483
2243222484
static sqlite_uint64 g_start;
2243322485
static sqlite_uint64 g_elapsed;
2243422486
#define TIMER_START g_start=sqlite3Hwtime()
2243522487
#define TIMER_END g_elapsed=sqlite3Hwtime()-g_start
@@ -22492,10 +22544,11 @@
2249222544
2249322545
#endif /* !defined(_OS_COMMON_H_) */
2249422546
2249522547
/************** End of os_common.h *******************************************/
2249622548
/************** Continuing where we left off in os_os2.c *********************/
22549
+#line 57 "tsrc/os_os2.c"
2249722550
2249822551
/* Forward references */
2249922552
typedef struct os2File os2File; /* The file structure */
2250022553
typedef struct os2ShmNode os2ShmNode; /* A shared descritive memory node */
2250122554
typedef struct os2ShmLink os2ShmLink; /* A connection to shared-memory */
@@ -24363,10 +24416,11 @@
2436324416
2436424417
#endif /* SQLITE_OS_OS2 */
2436524418
2436624419
/************** End of os_os2.c **********************************************/
2436724420
/************** Begin file os_unix.c *****************************************/
24421
+#line 1 "tsrc/os_unix.c"
2436824422
/*
2436924423
** 2004 May 22
2437024424
**
2437124425
** The author disclaims copyright to this source code. In place of
2437224426
** a legal notice, here is a blessing:
@@ -24627,10 +24681,11 @@
2462724681
/*
2462824682
** Include code that is common to all os_*.c files
2462924683
*/
2463024684
/************** Include os_common.h in the middle of os_unix.c ***************/
2463124685
/************** Begin file os_common.h ***************************************/
24686
+#line 1 "tsrc/os_common.h"
2463224687
/*
2463324688
** 2004 May 22
2463424689
**
2463524690
** The author disclaims copyright to this source code. In place of
2463624691
** a legal notice, here is a blessing:
@@ -24680,10 +24735,11 @@
2468024735
** hwtime.h contains inline assembler code for implementing
2468124736
** high-performance timing routines.
2468224737
*/
2468324738
/************** Include hwtime.h in the middle of os_common.h ****************/
2468424739
/************** Begin file hwtime.h ******************************************/
24740
+#line 1 "tsrc/hwtime.h"
2468524741
/*
2468624742
** 2008 May 27
2468724743
**
2468824744
** The author disclaims copyright to this source code. In place of
2468924745
** a legal notice, here is a blessing:
@@ -24768,10 +24824,11 @@
2476824824
2476924825
#endif /* !defined(_HWTIME_H_) */
2477024826
2477124827
/************** End of hwtime.h **********************************************/
2477224828
/************** Continuing where we left off in os_common.h ******************/
24829
+#line 53 "tsrc/os_common.h"
2477324830
2477424831
static sqlite_uint64 g_start;
2477524832
static sqlite_uint64 g_elapsed;
2477624833
#define TIMER_START g_start=sqlite3Hwtime()
2477724834
#define TIMER_END g_elapsed=sqlite3Hwtime()-g_start
@@ -24834,10 +24891,11 @@
2483424891
2483524892
#endif /* !defined(_OS_COMMON_H_) */
2483624893
2483724894
/************** End of os_common.h *******************************************/
2483824895
/************** Continuing where we left off in os_unix.c ********************/
24896
+#line 265 "tsrc/os_unix.c"
2483924897
2484024898
/*
2484124899
** Define various macros that are missing from some systems.
2484224900
*/
2484324901
#ifndef O_LARGEFILE
@@ -31343,10 +31401,11 @@
3134331401
3134431402
#endif /* SQLITE_OS_UNIX */
3134531403
3134631404
/************** End of os_unix.c *********************************************/
3134731405
/************** Begin file os_win.c ******************************************/
31406
+#line 1 "tsrc/os_win.c"
3134831407
/*
3134931408
** 2004 May 22
3135031409
**
3135131410
** The author disclaims copyright to this source code. In place of
3135231411
** a legal notice, here is a blessing:
@@ -31404,10 +31463,11 @@
3140431463
/*
3140531464
** Include code that is common to all os_*.c files
3140631465
*/
3140731466
/************** Include os_common.h in the middle of os_win.c ****************/
3140831467
/************** Begin file os_common.h ***************************************/
31468
+#line 1 "tsrc/os_common.h"
3140931469
/*
3141031470
** 2004 May 22
3141131471
**
3141231472
** The author disclaims copyright to this source code. In place of
3141331473
** a legal notice, here is a blessing:
@@ -31457,10 +31517,11 @@
3145731517
** hwtime.h contains inline assembler code for implementing
3145831518
** high-performance timing routines.
3145931519
*/
3146031520
/************** Include hwtime.h in the middle of os_common.h ****************/
3146131521
/************** Begin file hwtime.h ******************************************/
31522
+#line 1 "tsrc/hwtime.h"
3146231523
/*
3146331524
** 2008 May 27
3146431525
**
3146531526
** The author disclaims copyright to this source code. In place of
3146631527
** a legal notice, here is a blessing:
@@ -31545,10 +31606,11 @@
3154531606
3154631607
#endif /* !defined(_HWTIME_H_) */
3154731608
3154831609
/************** End of hwtime.h **********************************************/
3154931610
/************** Continuing where we left off in os_common.h ******************/
31611
+#line 53 "tsrc/os_common.h"
3155031612
3155131613
static sqlite_uint64 g_start;
3155231614
static sqlite_uint64 g_elapsed;
3155331615
#define TIMER_START g_start=sqlite3Hwtime()
3155431616
#define TIMER_END g_elapsed=sqlite3Hwtime()-g_start
@@ -31611,10 +31673,11 @@
3161131673
3161231674
#endif /* !defined(_OS_COMMON_H_) */
3161331675
3161431676
/************** End of os_common.h *******************************************/
3161531677
/************** Continuing where we left off in os_win.c *********************/
31678
+#line 62 "tsrc/os_win.c"
3161631679
3161731680
/*
3161831681
** Some microsoft compilers lack this definition.
3161931682
*/
3162031683
#ifndef INVALID_FILE_ATTRIBUTES
@@ -34746,10 +34809,11 @@
3474634809
3474734810
#endif /* SQLITE_OS_WIN */
3474834811
3474934812
/************** End of os_win.c **********************************************/
3475034813
/************** Begin file bitvec.c ******************************************/
34814
+#line 1 "tsrc/bitvec.c"
3475134815
/*
3475234816
** 2008 February 16
3475334817
**
3475434818
** The author disclaims copyright to this source code. In place of
3475534819
** a legal notice, here is a blessing:
@@ -35156,10 +35220,11 @@
3515635220
}
3515735221
#endif /* SQLITE_OMIT_BUILTIN_TEST */
3515835222
3515935223
/************** End of bitvec.c **********************************************/
3516035224
/************** Begin file pcache.c ******************************************/
35225
+#line 1 "tsrc/pcache.c"
3516135226
/*
3516235227
** 2008 August 05
3516335228
**
3516435229
** The author disclaims copyright to this source code. In place of
3516535230
** a legal notice, here is a blessing:
@@ -35752,10 +35817,11 @@
3575235817
}
3575335818
#endif
3575435819
3575535820
/************** End of pcache.c **********************************************/
3575635821
/************** Begin file pcache1.c *****************************************/
35822
+#line 1 "tsrc/pcache1.c"
3575735823
/*
3575835824
** 2008 November 05
3575935825
**
3576035826
** The author disclaims copyright to this source code. In place of
3576135827
** a legal notice, here is a blessing:
@@ -36968,10 +37034,11 @@
3696837034
}
3696937035
#endif
3697037036
3697137037
/************** End of pcache1.c *********************************************/
3697237038
/************** Begin file rowset.c ******************************************/
37039
+#line 1 "tsrc/rowset.c"
3697337040
/*
3697437041
** 2008 December 3
3697537042
**
3697637043
** The author disclaims copyright to this source code. In place of
3697737044
** a legal notice, here is a blessing:
@@ -37392,10 +37459,11 @@
3739237459
return 0;
3739337460
}
3739437461
3739537462
/************** End of rowset.c **********************************************/
3739637463
/************** Begin file pager.c *******************************************/
37464
+#line 1 "tsrc/pager.c"
3739737465
/*
3739837466
** 2001 September 15
3739937467
**
3740037468
** The author disclaims copyright to this source code. In place of
3740137469
** a legal notice, here is a blessing:
@@ -37415,10 +37483,11 @@
3741537483
** another is writing.
3741637484
*/
3741737485
#ifndef SQLITE_OMIT_DISKIO
3741837486
/************** Include wal.h in the middle of pager.c ***********************/
3741937487
/************** Begin file wal.h *********************************************/
37488
+#line 1 "tsrc/wal.h"
3742037489
/*
3742137490
** 2010 February 1
3742237491
**
3742337492
** The author disclaims copyright to this source code. In place of
3742437493
** a legal notice, here is a blessing:
@@ -37539,10 +37608,11 @@
3753937608
#endif /* ifndef SQLITE_OMIT_WAL */
3754037609
#endif /* _WAL_H_ */
3754137610
3754237611
/************** End of wal.h *************************************************/
3754337612
/************** Continuing where we left off in pager.c **********************/
37613
+#line 24 "tsrc/pager.c"
3754437614
3754537615
3754637616
/******************* NOTES ON THE DESIGN OF THE PAGER ************************
3754737617
**
3754837618
** This comment block describes invariants that hold when using a rollback
@@ -44352,10 +44422,11 @@
4435244422
4435344423
#endif /* SQLITE_OMIT_DISKIO */
4435444424
4435544425
/************** End of pager.c ***********************************************/
4435644426
/************** Begin file wal.c *********************************************/
44427
+#line 1 "tsrc/wal.c"
4435744428
/*
4435844429
** 2010 February 1
4435944430
**
4436044431
** The author disclaims copyright to this source code. In place of
4436144432
** a legal notice, here is a blessing:
@@ -47306,10 +47377,11 @@
4730647377
4730747378
#endif /* #ifndef SQLITE_OMIT_WAL */
4730847379
4730947380
/************** End of wal.c *************************************************/
4731047381
/************** Begin file btmutex.c *****************************************/
47382
+#line 1 "tsrc/btmutex.c"
4731147383
/*
4731247384
** 2007 August 27
4731347385
**
4731447386
** The author disclaims copyright to this source code. In place of
4731547387
** a legal notice, here is a blessing:
@@ -47325,10 +47397,11 @@
4732547397
** big and we want to break it down some. This packaged seemed like
4732647398
** a good breakout.
4732747399
*/
4732847400
/************** Include btreeInt.h in the middle of btmutex.c ****************/
4732947401
/************** Begin file btreeInt.h ****************************************/
47402
+#line 1 "tsrc/btreeInt.h"
4733047403
/*
4733147404
** 2004 April 6
4733247405
**
4733347406
** The author disclaims copyright to this source code. In place of
4733447407
** a legal notice, here is a blessing:
@@ -47970,10 +48043,11 @@
4797048043
#define get4byte sqlite3Get4byte
4797148044
#define put4byte sqlite3Put4byte
4797248045
4797348046
/************** End of btreeInt.h ********************************************/
4797448047
/************** Continuing where we left off in btmutex.c ********************/
48048
+#line 19 "tsrc/btmutex.c"
4797548049
#ifndef SQLITE_OMIT_SHARED_CACHE
4797648050
#if SQLITE_THREADSAFE
4797748051
4797848052
/*
4797948053
** Obtain the BtShared mutex associated with B-Tree handle p. Also,
@@ -48242,10 +48316,11 @@
4824248316
#endif /* if SQLITE_THREADSAFE */
4824348317
#endif /* ifndef SQLITE_OMIT_SHARED_CACHE */
4824448318
4824548319
/************** End of btmutex.c *********************************************/
4824648320
/************** Begin file btree.c *******************************************/
48321
+#line 1 "tsrc/btree.c"
4824748322
/*
4824848323
** 2004 April 6
4824948324
**
4825048325
** The author disclaims copyright to this source code. In place of
4825148326
** a legal notice, here is a blessing:
@@ -48899,22 +48974,25 @@
4889948974
int *pRes /* Write search results here */
4890048975
){
4890148976
int rc; /* Status code */
4890248977
UnpackedRecord *pIdxKey; /* Unpacked index key */
4890348978
char aSpace[150]; /* Temp space for pIdxKey - to avoid a malloc */
48979
+ char *pFree = 0;
4890448980
4890548981
if( pKey ){
4890648982
assert( nKey==(i64)(int)nKey );
48907
- pIdxKey = sqlite3VdbeRecordUnpack(pCur->pKeyInfo, (int)nKey, pKey,
48908
- aSpace, sizeof(aSpace));
48983
+ pIdxKey = sqlite3VdbeAllocUnpackedRecord(
48984
+ pCur->pKeyInfo, aSpace, sizeof(aSpace), &pFree
48985
+ );
4890948986
if( pIdxKey==0 ) return SQLITE_NOMEM;
48987
+ sqlite3VdbeRecordUnpack(pCur->pKeyInfo, nKey, pKey, pIdxKey);
4891048988
}else{
4891148989
pIdxKey = 0;
4891248990
}
4891348991
rc = sqlite3BtreeMovetoUnpacked(pCur, pIdxKey, nKey, bias, pRes);
48914
- if( pKey ){
48915
- sqlite3VdbeDeleteUnpackedRecord(pIdxKey);
48992
+ if( pFree ){
48993
+ sqlite3DbFree(pCur->pKeyInfo->db, pFree);
4891648994
}
4891748995
return rc;
4891848996
}
4891948997
4892048998
/*
@@ -56426,10 +56504,11 @@
5642656504
return rc;
5642756505
}
5642856506
5642956507
/************** End of btree.c ***********************************************/
5643056508
/************** Begin file backup.c ******************************************/
56509
+#line 1 "tsrc/backup.c"
5643156510
/*
5643256511
** 2009 January 28
5643356512
**
5643456513
** The author disclaims copyright to this source code. In place of
5643556514
** a legal notice, here is a blessing:
@@ -57132,10 +57211,11 @@
5713257211
}
5713357212
#endif /* SQLITE_OMIT_VACUUM */
5713457213
5713557214
/************** End of backup.c **********************************************/
5713657215
/************** Begin file vdbemem.c *****************************************/
57216
+#line 1 "tsrc/vdbemem.c"
5713757217
/*
5713857218
** 2004 May 26
5713957219
**
5714057220
** The author disclaims copyright to this source code. In place of
5714157221
** a legal notice, here is a blessing:
@@ -58286,10 +58366,11 @@
5828658366
return 0;
5828758367
}
5828858368
5828958369
/************** End of vdbemem.c *********************************************/
5829058370
/************** Begin file vdbeaux.c *****************************************/
58371
+#line 1 "tsrc/vdbeaux.c"
5829158372
/*
5829258373
** 2003 September 6
5829358374
**
5829458375
** The author disclaims copyright to this source code. In place of
5829558376
** a legal notice, here is a blessing:
@@ -61116,61 +61197,74 @@
6111661197
}
6111761198
}
6111861199
return 0;
6111961200
}
6112061201
61121
-
61122
-/*
61123
-** Given the nKey-byte encoding of a record in pKey[], parse the
61124
-** record into a UnpackedRecord structure. Return a pointer to
61125
-** that structure.
61126
-**
61127
-** The calling function might provide szSpace bytes of memory
61128
-** space at pSpace. This space can be used to hold the returned
61129
-** VDbeParsedRecord structure if it is large enough. If it is
61130
-** not big enough, space is obtained from sqlite3_malloc().
61131
-**
61132
-** The returned structure should be closed by a call to
61133
-** sqlite3VdbeDeleteUnpackedRecord().
61134
-*/
61135
-SQLITE_PRIVATE UnpackedRecord *sqlite3VdbeRecordUnpack(
61136
- KeyInfo *pKeyInfo, /* Information about the record format */
61137
- int nKey, /* Size of the binary record */
61138
- const void *pKey, /* The binary record */
61139
- char *pSpace, /* Unaligned space available to hold the object */
61140
- int szSpace /* Size of pSpace[] in bytes */
61141
-){
61142
- const unsigned char *aKey = (const unsigned char *)pKey;
61143
- UnpackedRecord *p; /* The unpacked record that we will return */
61144
- int nByte; /* Memory space needed to hold p, in bytes */
61145
- int d;
61146
- u32 idx;
61147
- u16 u; /* Unsigned loop counter */
61148
- u32 szHdr;
61149
- Mem *pMem;
61150
- int nOff; /* Increase pSpace by this much to 8-byte align it */
61151
-
61152
- /*
61153
- ** We want to shift the pointer pSpace up such that it is 8-byte aligned.
61202
+/*
61203
+** This routine is used to allocate sufficient space for an UnpackedRecord
61204
+** structure large enough to be used with sqlite3VdbeRecordUnpack() if
61205
+** the first argument is a pointer to KeyInfo structure pKeyInfo.
61206
+**
61207
+** The space is either allocated using sqlite3DbMallocRaw() or from within
61208
+** the unaligned buffer passed via the second and third arguments (presumably
61209
+** stack space). If the former, then *ppFree is set to a pointer that should
61210
+** be eventually freed by the caller using sqlite3DbFree(). Or, if the
61211
+** allocation comes from the pSpace/szSpace buffer, *ppFree is set to NULL
61212
+** before returning.
61213
+**
61214
+** If an OOM error occurs, NULL is returned.
61215
+*/
61216
+SQLITE_PRIVATE UnpackedRecord *sqlite3VdbeAllocUnpackedRecord(
61217
+ KeyInfo *pKeyInfo, /* Description of the record */
61218
+ char *pSpace, /* Unaligned space available */
61219
+ int szSpace, /* Size of pSpace[] in bytes */
61220
+ char **ppFree /* OUT: Caller should free this pointer */
61221
+){
61222
+ UnpackedRecord *p; /* Unpacked record to return */
61223
+ int nOff; /* Increment pSpace by nOff to align it */
61224
+ int nByte; /* Number of bytes required for *p */
61225
+
61226
+ /* We want to shift the pointer pSpace up such that it is 8-byte aligned.
6115461227
** Thus, we need to calculate a value, nOff, between 0 and 7, to shift
6115561228
** it by. If pSpace is already 8-byte aligned, nOff should be zero.
6115661229
*/
6115761230
nOff = (8 - (SQLITE_PTR_TO_INT(pSpace) & 7)) & 7;
61158
- pSpace += nOff;
61159
- szSpace -= nOff;
6116061231
nByte = ROUND8(sizeof(UnpackedRecord)) + sizeof(Mem)*(pKeyInfo->nField+1);
61161
- if( nByte>szSpace ){
61162
- p = sqlite3DbMallocRaw(pKeyInfo->db, nByte);
61163
- if( p==0 ) return 0;
61164
- p->flags = UNPACKED_NEED_FREE | UNPACKED_NEED_DESTROY;
61232
+ if( nByte>szSpace+nOff ){
61233
+ p = (UnpackedRecord *)sqlite3DbMallocRaw(pKeyInfo->db, nByte);
61234
+ *ppFree = (char *)p;
61235
+ if( !p ) return 0;
6116561236
}else{
61166
- p = (UnpackedRecord*)pSpace;
61167
- p->flags = UNPACKED_NEED_DESTROY;
61237
+ p = (UnpackedRecord*)&pSpace[nOff];
61238
+ *ppFree = 0;
6116861239
}
61240
+
61241
+ p->aMem = (Mem*)&((char*)p)[ROUND8(sizeof(UnpackedRecord))];
6116961242
p->pKeyInfo = pKeyInfo;
6117061243
p->nField = pKeyInfo->nField + 1;
61171
- p->aMem = pMem = (Mem*)&((char*)p)[ROUND8(sizeof(UnpackedRecord))];
61244
+ return p;
61245
+}
61246
+
61247
+/*
61248
+** Given the nKey-byte encoding of a record in pKey[], populate the
61249
+** UnpackedRecord structure indicated by the fourth argument with the
61250
+** contents of the decoded record.
61251
+*/
61252
+SQLITE_PRIVATE void sqlite3VdbeRecordUnpack(
61253
+ KeyInfo *pKeyInfo, /* Information about the record format */
61254
+ int nKey, /* Size of the binary record */
61255
+ const void *pKey, /* The binary record */
61256
+ UnpackedRecord *p /* Populate this structure before returning. */
61257
+){
61258
+ const unsigned char *aKey = (const unsigned char *)pKey;
61259
+ int d;
61260
+ u32 idx; /* Offset in aKey[] to read from */
61261
+ u16 u; /* Unsigned loop counter */
61262
+ u32 szHdr;
61263
+ Mem *pMem = p->aMem;
61264
+
61265
+ p->flags = 0;
6117261266
assert( EIGHT_BYTE_ALIGNMENT(pMem) );
6117361267
idx = getVarint32(aKey, szHdr);
6117461268
d = szHdr;
6117561269
u = 0;
6117661270
while( idx<szHdr && u<p->nField && d<=nKey ){
@@ -61185,35 +61279,10 @@
6118561279
pMem++;
6118661280
u++;
6118761281
}
6118861282
assert( u<=pKeyInfo->nField + 1 );
6118961283
p->nField = u;
61190
- return (void*)p;
61191
-}
61192
-
61193
-/*
61194
-** This routine destroys a UnpackedRecord object.
61195
-*/
61196
-SQLITE_PRIVATE void sqlite3VdbeDeleteUnpackedRecord(UnpackedRecord *p){
61197
-#ifdef SQLITE_DEBUG
61198
- int i;
61199
- Mem *pMem;
61200
-
61201
- assert( p!=0 );
61202
- assert( p->flags & UNPACKED_NEED_DESTROY );
61203
- for(i=0, pMem=p->aMem; i<p->nField; i++, pMem++){
61204
- /* The unpacked record is always constructed by the
61205
- ** sqlite3VdbeUnpackRecord() function above, which makes all
61206
- ** strings and blobs static. And none of the elements are
61207
- ** ever transformed, so there is never anything to delete.
61208
- */
61209
- if( NEVER(pMem->zMalloc) ) sqlite3VdbeMemRelease(pMem);
61210
- }
61211
-#endif
61212
- if( p->flags & UNPACKED_NEED_FREE ){
61213
- sqlite3DbFree(p->pKeyInfo->db, p);
61214
- }
6121561284
}
6121661285
6121761286
/*
6121861287
** This function compares the two table rows or index records
6121961288
** specified by {nKey1, pKey1} and pPKey2. It returns a negative, zero
@@ -61540,10 +61609,11 @@
6154061609
}
6154161610
}
6154261611
6154361612
/************** End of vdbeaux.c *********************************************/
6154461613
/************** Begin file vdbeapi.c *****************************************/
61614
+#line 1 "tsrc/vdbeapi.c"
6154561615
/*
6154661616
** 2004 May 26
6154761617
**
6154861618
** The author disclaims copyright to this source code. In place of
6154961619
** a legal notice, here is a blessing:
@@ -62847,10 +62917,11 @@
6284762917
return v;
6284862918
}
6284962919
6285062920
/************** End of vdbeapi.c *********************************************/
6285162921
/************** Begin file vdbetrace.c ***************************************/
62922
+#line 1 "tsrc/vdbetrace.c"
6285262923
/*
6285362924
** 2009 November 25
6285462925
**
6285562926
** The author disclaims copyright to this source code. In place of
6285662927
** a legal notice, here is a blessing:
@@ -63002,10 +63073,11 @@
6300263073
6300363074
#endif /* #ifndef SQLITE_OMIT_TRACE */
6300463075
6300563076
/************** End of vdbetrace.c *******************************************/
6300663077
/************** Begin file vdbe.c ********************************************/
63078
+#line 1 "tsrc/vdbe.c"
6300763079
/*
6300863080
** 2001 September 15
6300963081
**
6301063082
** The author disclaims copyright to this source code. In place of
6301163083
** a legal notice, here is a blessing:
@@ -63471,10 +63543,11 @@
6347163543
** hwtime.h contains inline assembler code for implementing
6347263544
** high-performance timing routines.
6347363545
*/
6347463546
/************** Include hwtime.h in the middle of vdbe.c *********************/
6347563547
/************** Begin file hwtime.h ******************************************/
63548
+#line 1 "tsrc/hwtime.h"
6347663549
/*
6347763550
** 2008 May 27
6347863551
**
6347963552
** The author disclaims copyright to this source code. In place of
6348063553
** a legal notice, here is a blessing:
@@ -63559,10 +63632,11 @@
6355963632
6356063633
#endif /* !defined(_HWTIME_H_) */
6356163634
6356263635
/************** End of hwtime.h **********************************************/
6356363636
/************** Continuing where we left off in vdbe.c ***********************/
63637
+#line 471 "tsrc/vdbe.c"
6356463638
6356563639
#endif
6356663640
6356763641
/*
6356863642
** The CHECK_FOR_INTERRUPT macro defined here looks to see if the
@@ -63853,10 +63927,11 @@
6385363927
} bb;
6385463928
struct OP_Found_stack_vars {
6385563929
int alreadyExists;
6385663930
VdbeCursor *pC;
6385763931
int res;
63932
+ char *pFree;
6385863933
UnpackedRecord *pIdxKey;
6385963934
UnpackedRecord r;
6386063935
char aTempRec[ROUND8(sizeof(UnpackedRecord)) + sizeof(Mem)*3 + 7];
6386163936
} bc;
6386263937
struct OP_IsUnique_stack_vars {
@@ -67097,10 +67172,11 @@
6709767172
case OP_Found: { /* jump, in3 */
6709867173
#if 0 /* local variables moved into u.bc */
6709967174
int alreadyExists;
6710067175
VdbeCursor *pC;
6710167176
int res;
67177
+ char *pFree;
6710267178
UnpackedRecord *pIdxKey;
6710367179
UnpackedRecord r;
6710467180
char aTempRec[ROUND8(sizeof(UnpackedRecord)) + sizeof(Mem)*3 + 7];
6710567181
#endif /* local variables moved into u.bc */
6710667182
@@ -67125,22 +67201,22 @@
6712567201
{ int i; for(i=0; i<u.bc.r.nField; i++) assert( memIsValid(&u.bc.r.aMem[i]) ); }
6712667202
#endif
6712767203
u.bc.r.flags = UNPACKED_PREFIX_MATCH;
6712867204
u.bc.pIdxKey = &u.bc.r;
6712967205
}else{
67206
+ u.bc.pIdxKey = sqlite3VdbeAllocUnpackedRecord(
67207
+ u.bc.pC->pKeyInfo, u.bc.aTempRec, sizeof(u.bc.aTempRec), &u.bc.pFree
67208
+ );
67209
+ if( u.bc.pIdxKey==0 ) goto no_mem;
6713067210
assert( pIn3->flags & MEM_Blob );
6713167211
assert( (pIn3->flags & MEM_Zero)==0 ); /* zeroblobs already expanded */
67132
- u.bc.pIdxKey = sqlite3VdbeRecordUnpack(u.bc.pC->pKeyInfo, pIn3->n, pIn3->z,
67133
- u.bc.aTempRec, sizeof(u.bc.aTempRec));
67134
- if( u.bc.pIdxKey==0 ){
67135
- goto no_mem;
67136
- }
67212
+ sqlite3VdbeRecordUnpack(u.bc.pC->pKeyInfo, pIn3->n, pIn3->z, u.bc.pIdxKey);
6713767213
u.bc.pIdxKey->flags |= UNPACKED_PREFIX_MATCH;
6713867214
}
6713967215
rc = sqlite3BtreeMovetoUnpacked(u.bc.pC->pCursor, u.bc.pIdxKey, 0, 0, &u.bc.res);
6714067216
if( pOp->p4.i==0 ){
67141
- sqlite3VdbeDeleteUnpackedRecord(u.bc.pIdxKey);
67217
+ sqlite3DbFree(db, u.bc.pFree);
6714267218
}
6714367219
if( rc!=SQLITE_OK ){
6714467220
break;
6714567221
}
6714667222
u.bc.alreadyExists = (u.bc.res==0);
@@ -69784,10 +69860,11 @@
6978469860
goto vdbe_error_halt;
6978569861
}
6978669862
6978769863
/************** End of vdbe.c ************************************************/
6978869864
/************** Begin file vdbeblob.c ****************************************/
69865
+#line 1 "tsrc/vdbeblob.c"
6978969866
/*
6979069867
** 2007 May 1
6979169868
**
6979269869
** The author disclaims copyright to this source code. In place of
6979369870
** a legal notice, here is a blessing:
@@ -70254,10 +70331,11 @@
7025470331
7025570332
#endif /* #ifndef SQLITE_OMIT_INCRBLOB */
7025670333
7025770334
/************** End of vdbeblob.c ********************************************/
7025870335
/************** Begin file vdbesort.c ****************************************/
70336
+#line 1 "tsrc/vdbesort.c"
7025970337
/*
7026070338
** 2011 July 9
7026170339
**
7026270340
** The author disclaims copyright to this source code. In place of
7026370341
** a legal notice, here is a blessing:
@@ -70358,12 +70436,11 @@
7035870436
sqlite3_file *pTemp1; /* PMA file 1 */
7035970437
int nPMA; /* Number of PMAs stored in pTemp1 */
7036070438
SorterRecord *pRecord; /* Head of in-memory record list */
7036170439
int mnPmaSize; /* Minimum PMA size, in bytes */
7036270440
int mxPmaSize; /* Maximum PMA size, in bytes. 0==no limit */
70363
- char *aSpace; /* Space for UnpackRecord() */
70364
- int nSpace; /* Size of aSpace in bytes */
70441
+ UnpackedRecord *pUnpacked; /* Used to unpack keys */
7036570442
};
7036670443
7036770444
/*
7036870445
** The following type is an iterator for a PMA. It caches the current key in
7036970446
** variables nKey/aKey. If the iterator is at EOF, pFile==0.
@@ -70553,56 +70630,39 @@
7055370630
** be less than key2. Even if key2 also contains NULL values.
7055470631
**
7055570632
** If pKey2 is passed a NULL pointer, then it is assumed that the pCsr->aSpace
7055670633
** has been allocated and contains an unpacked record that is used as key2.
7055770634
*/
70558
-static int vdbeSorterCompare(
70635
+static void vdbeSorterCompare(
7055970636
VdbeCursor *pCsr, /* Cursor object (for pKeyInfo) */
7056070637
int bOmitRowid, /* Ignore rowid field at end of keys */
7056170638
void *pKey1, int nKey1, /* Left side of comparison */
7056270639
void *pKey2, int nKey2, /* Right side of comparison */
7056370640
int *pRes /* OUT: Result of comparison */
7056470641
){
7056570642
KeyInfo *pKeyInfo = pCsr->pKeyInfo;
7056670643
VdbeSorter *pSorter = pCsr->pSorter;
70567
- char *aSpace = pSorter->aSpace;
70568
- int nSpace = pSorter->nSpace;
70569
- UnpackedRecord *r2;
70644
+ UnpackedRecord *r2 = pSorter->pUnpacked;
7057070645
int i;
7057170646
70572
- if( aSpace==0 ){
70573
- nSpace = ROUND8(sizeof(UnpackedRecord))+(pKeyInfo->nField+1)*sizeof(Mem);
70574
- aSpace = (char *)sqlite3Malloc(nSpace);
70575
- if( aSpace==0 ) return SQLITE_NOMEM;
70576
- pSorter->aSpace = aSpace;
70577
- pSorter->nSpace = nSpace;
70578
- }
70579
-
7058070647
if( pKey2 ){
70581
- /* This call cannot fail. As the memory is already allocated. */
70582
- r2 = sqlite3VdbeRecordUnpack(pKeyInfo, nKey2, pKey2, aSpace, nSpace);
70583
- assert( r2 && (r2->flags & UNPACKED_NEED_FREE)==0 );
70584
- assert( r2==(UnpackedRecord*)aSpace );
70585
- }else{
70586
- r2 = (UnpackedRecord *)aSpace;
70587
- assert( !bOmitRowid );
70648
+ sqlite3VdbeRecordUnpack(pKeyInfo, nKey2, pKey2, r2);
7058870649
}
7058970650
7059070651
if( bOmitRowid ){
70591
- for(i=0; i<r2->nField-1; i++){
70652
+ r2->nField = pKeyInfo->nField;
70653
+ assert( r2->nField>0 );
70654
+ for(i=0; i<r2->nField; i++){
7059270655
if( r2->aMem[i].flags & MEM_Null ){
7059370656
*pRes = -1;
70594
- return SQLITE_OK;
70657
+ return;
7059570658
}
7059670659
}
7059770660
r2->flags |= UNPACKED_PREFIX_MATCH;
70598
- r2->nField--;
70599
- assert( r2->nField>0 );
7060070661
}
7060170662
7060270663
*pRes = sqlite3VdbeRecordCompare(nKey1, pKey1, r2);
70603
- return SQLITE_OK;
7060470664
}
7060570665
7060670666
/*
7060770667
** This function is called to compare two iterator keys when merging
7060870668
** multiple b-tree segments. Parameter iOut is the index of the aTree[]
@@ -70633,19 +70693,14 @@
7063370693
iRes = i2;
7063470694
}else if( p2->pFile==0 ){
7063570695
iRes = i1;
7063670696
}else{
7063770697
int res;
70638
- int rc;
70639
- assert( pCsr->pSorter->aSpace!=0 ); /* allocated in vdbeSorterMerge() */
70640
- rc = vdbeSorterCompare(
70698
+ assert( pCsr->pSorter->pUnpacked!=0 ); /* allocated in vdbeSorterMerge() */
70699
+ vdbeSorterCompare(
7064170700
pCsr, 0, p1->aKey, p1->nKey, p2->aKey, p2->nKey, &res
7064270701
);
70643
- /* The vdbeSorterCompare() call cannot fail since pCsr->pSorter->aSpace
70644
- ** has already been allocated. */
70645
- assert( rc==SQLITE_OK );
70646
-
7064770702
if( res<=0 ){
7064870703
iRes = i1;
7064970704
}else{
7065070705
iRes = i2;
7065170706
}
@@ -70660,16 +70715,21 @@
7066070715
*/
7066170716
SQLITE_PRIVATE int sqlite3VdbeSorterInit(sqlite3 *db, VdbeCursor *pCsr){
7066270717
int pgsz; /* Page size of main database */
7066370718
int mxCache; /* Cache size */
7066470719
VdbeSorter *pSorter; /* The new sorter */
70720
+ char *d; /* Dummy */
7066570721
7066670722
assert( pCsr->pKeyInfo && pCsr->pBt==0 );
7066770723
pCsr->pSorter = pSorter = sqlite3DbMallocZero(db, sizeof(VdbeSorter));
7066870724
if( pSorter==0 ){
7066970725
return SQLITE_NOMEM;
7067070726
}
70727
+
70728
+ pSorter->pUnpacked = sqlite3VdbeAllocUnpackedRecord(pCsr->pKeyInfo, 0, 0, &d);
70729
+ if( pSorter->pUnpacked==0 ) return SQLITE_NOMEM;
70730
+ assert( pSorter->pUnpacked==(UnpackedRecord *)d );
7067170731
7067270732
if( !sqlite3TempInMemory(db) ){
7067370733
pgsz = sqlite3BtreeGetPageSize(db->aDb[0].pBt);
7067470734
pSorter->mnPmaSize = SORTER_MIN_WORKING * pgsz;
7067570735
mxCache = db->aDb[0].pSchema->cache_size;
@@ -70707,11 +70767,11 @@
7070770767
}
7070870768
if( pSorter->pTemp1 ){
7070970769
sqlite3OsCloseFree(pSorter->pTemp1);
7071070770
}
7071170771
vdbeSorterRecordFree(db, pSorter->pRecord);
70712
- sqlite3_free(pSorter->aSpace);
70772
+ sqlite3DbFree(db, pSorter->pUnpacked);
7071370773
sqlite3DbFree(db, pSorter);
7071470774
pCsr->pSorter = 0;
7071570775
}
7071670776
}
7071770777
@@ -70728,36 +70788,26 @@
7072870788
SQLITE_OPEN_EXCLUSIVE | SQLITE_OPEN_DELETEONCLOSE, &dummy
7072970789
);
7073070790
}
7073170791
7073270792
/*
70733
-** Attemp to merge the two sorted lists p1 and p2 into a single list. If no
70734
-** error occurs set *ppOut to the head of the new list and return SQLITE_OK.
70793
+** Merge the two sorted lists p1 and p2 into a single list.
70794
+** Set *ppOut to the head of the new list.
7073570795
*/
70736
-static int vdbeSorterMerge(
70737
- sqlite3 *db, /* Database handle */
70796
+static void vdbeSorterMerge(
7073870797
VdbeCursor *pCsr, /* For pKeyInfo */
7073970798
SorterRecord *p1, /* First list to merge */
7074070799
SorterRecord *p2, /* Second list to merge */
7074170800
SorterRecord **ppOut /* OUT: Head of merged list */
7074270801
){
70743
- int rc = SQLITE_OK;
7074470802
SorterRecord *pFinal = 0;
7074570803
SorterRecord **pp = &pFinal;
7074670804
void *pVal2 = p2 ? p2->pVal : 0;
7074770805
7074870806
while( p1 && p2 ){
7074970807
int res;
70750
- rc = vdbeSorterCompare(pCsr, 0, p1->pVal, p1->nVal, pVal2, p2->nVal, &res);
70751
- if( rc!=SQLITE_OK ){
70752
- *pp = 0;
70753
- vdbeSorterRecordFree(db, p1);
70754
- vdbeSorterRecordFree(db, p2);
70755
- vdbeSorterRecordFree(db, pFinal);
70756
- *ppOut = 0;
70757
- return rc;
70758
- }
70808
+ vdbeSorterCompare(pCsr, 0, p1->pVal, p1->nVal, pVal2, p2->nVal, &res);
7075970809
if( res<=0 ){
7076070810
*pp = p1;
7076170811
pp = &p1->pNext;
7076270812
p1 = p1->pNext;
7076370813
pVal2 = 0;
@@ -70768,22 +70818,19 @@
7076870818
if( p2==0 ) break;
7076970819
pVal2 = p2->pVal;
7077070820
}
7077170821
}
7077270822
*pp = p1 ? p1 : p2;
70773
-
7077470823
*ppOut = pFinal;
70775
- return SQLITE_OK;
7077670824
}
7077770825
7077870826
/*
7077970827
** Sort the linked list of records headed at pCsr->pRecord. Return SQLITE_OK
7078070828
** if successful, or an SQLite error code (i.e. SQLITE_NOMEM) if an error
7078170829
** occurs.
7078270830
*/
70783
-static int vdbeSorterSort(sqlite3 *db, VdbeCursor *pCsr){
70784
- int rc = SQLITE_OK;
70831
+static int vdbeSorterSort(VdbeCursor *pCsr){
7078570832
int i;
7078670833
SorterRecord **aSlot;
7078770834
SorterRecord *p;
7078870835
VdbeSorter *pSorter = pCsr->pSorter;
7078970836
@@ -70794,34 +70841,26 @@
7079470841
7079570842
p = pSorter->pRecord;
7079670843
while( p ){
7079770844
SorterRecord *pNext = p->pNext;
7079870845
p->pNext = 0;
70799
- for(i=0; rc==SQLITE_OK && aSlot[i]; i++){
70800
- rc = vdbeSorterMerge(db, pCsr, p, aSlot[i], &p);
70846
+ for(i=0; aSlot[i]; i++){
70847
+ vdbeSorterMerge(pCsr, p, aSlot[i], &p);
7080170848
aSlot[i] = 0;
7080270849
}
70803
- if( rc!=SQLITE_OK ){
70804
- vdbeSorterRecordFree(db, pNext);
70805
- break;
70806
- }
7080770850
aSlot[i] = p;
7080870851
p = pNext;
7080970852
}
7081070853
7081170854
p = 0;
7081270855
for(i=0; i<64; i++){
70813
- if( rc==SQLITE_OK ){
70814
- rc = vdbeSorterMerge(db, pCsr, p, aSlot[i], &p);
70815
- }else{
70816
- vdbeSorterRecordFree(db, aSlot[i]);
70817
- }
70856
+ vdbeSorterMerge(pCsr, p, aSlot[i], &p);
7081870857
}
7081970858
pSorter->pRecord = p;
7082070859
7082170860
sqlite3_free(aSlot);
70822
- return rc;
70861
+ return SQLITE_OK;
7082370862
}
7082470863
7082570864
7082670865
/*
7082770866
** Write the current contents of the in-memory linked-list to a PMA. Return
@@ -70843,11 +70882,11 @@
7084370882
if( pSorter->nInMemory==0 ){
7084470883
assert( pSorter->pRecord==0 );
7084570884
return rc;
7084670885
}
7084770886
70848
- rc = vdbeSorterSort(db, pCsr);
70887
+ rc = vdbeSorterSort(pCsr);
7084970888
7085070889
/* If the first temporary PMA file has not been opened, open it now. */
7085170890
if( rc==SQLITE_OK && pSorter->pTemp1==0 ){
7085270891
rc = vdbeSorterOpenTempFile(db, &pSorter->pTemp1);
7085370892
assert( rc!=SQLITE_OK || pSorter->pTemp1 );
@@ -70990,11 +71029,11 @@
7099071029
** sort the VdbeSorter.pRecord list. The vdbe layer will read data directly
7099171030
** from the in-memory list. */
7099271031
if( pSorter->nPMA==0 ){
7099371032
*pbEof = !pSorter->pRecord;
7099471033
assert( pSorter->aTree==0 );
70995
- return vdbeSorterSort(db, pCsr);
71034
+ return vdbeSorterSort(pCsr);
7099671035
}
7099771036
7099871037
/* Write the current b-tree to a PMA. Close the b-tree cursor. */
7099971038
rc = vdbeSorterListToPMA(db, pCsr);
7100071039
if( rc!=SQLITE_OK ) return rc;
@@ -71160,24 +71199,23 @@
7116071199
SQLITE_PRIVATE int sqlite3VdbeSorterCompare(
7116171200
VdbeCursor *pCsr, /* Sorter cursor */
7116271201
Mem *pVal, /* Value to compare to current sorter key */
7116371202
int *pRes /* OUT: Result of comparison */
7116471203
){
71165
- int rc;
7116671204
VdbeSorter *pSorter = pCsr->pSorter;
7116771205
void *pKey; int nKey; /* Sorter key to compare pVal with */
7116871206
7116971207
pKey = vdbeSorterRowkey(pSorter, &nKey);
71170
- rc = vdbeSorterCompare(pCsr, 1, pVal->z, pVal->n, pKey, nKey, pRes);
71171
- assert( rc!=SQLITE_OK || pVal->db->mallocFailed || (*pRes)<=0 );
71172
- return rc;
71208
+ vdbeSorterCompare(pCsr, 1, pVal->z, pVal->n, pKey, nKey, pRes);
71209
+ return SQLITE_OK;
7117371210
}
7117471211
7117571212
#endif /* #ifndef SQLITE_OMIT_MERGE_SORT */
7117671213
7117771214
/************** End of vdbesort.c ********************************************/
7117871215
/************** Begin file journal.c *****************************************/
71216
+#line 1 "tsrc/journal.c"
7117971217
/*
7118071218
** 2007 August 22
7118171219
**
7118271220
** The author disclaims copyright to this source code. In place of
7118371221
** a legal notice, here is a blessing:
@@ -71414,10 +71452,11 @@
7141471452
}
7141571453
#endif
7141671454
7141771455
/************** End of journal.c *********************************************/
7141871456
/************** Begin file memjournal.c **************************************/
71457
+#line 1 "tsrc/memjournal.c"
7141971458
/*
7142071459
** 2008 October 7
7142171460
**
7142271461
** The author disclaims copyright to this source code. In place of
7142371462
** a legal notice, here is a blessing:
@@ -71675,10 +71714,11 @@
7167571714
return sizeof(MemJournal);
7167671715
}
7167771716
7167871717
/************** End of memjournal.c ******************************************/
7167971718
/************** Begin file walker.c ******************************************/
71719
+#line 1 "tsrc/walker.c"
7168071720
/*
7168171721
** 2008 August 16
7168271722
**
7168371723
** The author disclaims copyright to this source code. In place of
7168471724
** a legal notice, here is a blessing:
@@ -71813,10 +71853,11 @@
7181371853
return rc & WRC_Abort;
7181471854
}
7181571855
7181671856
/************** End of walker.c **********************************************/
7181771857
/************** Begin file resolve.c *****************************************/
71858
+#line 1 "tsrc/resolve.c"
7181871859
/*
7181971860
** 2008 August 18
7182071861
**
7182171862
** The author disclaims copyright to this source code. In place of
7182271863
** a legal notice, here is a blessing:
@@ -73033,10 +73074,11 @@
7303373074
sqlite3WalkSelect(&w, p);
7303473075
}
7303573076
7303673077
/************** End of resolve.c *********************************************/
7303773078
/************** Begin file expr.c ********************************************/
73079
+#line 1 "tsrc/expr.c"
7303873080
/*
7303973081
** 2001 September 15
7304073082
**
7304173083
** The author disclaims copyright to this source code. In place of
7304273084
** a legal notice, here is a blessing:
@@ -76793,10 +76835,11 @@
7679376835
}
7679476836
}
7679576837
7679676838
/************** End of expr.c ************************************************/
7679776839
/************** Begin file alter.c *******************************************/
76840
+#line 1 "tsrc/alter.c"
7679876841
/*
7679976842
** 2005 February 15
7680076843
**
7680176844
** The author disclaims copyright to this source code. In place of
7680276845
** a legal notice, here is a blessing:
@@ -77621,10 +77664,11 @@
7762177664
}
7762277665
#endif /* SQLITE_ALTER_TABLE */
7762377666
7762477667
/************** End of alter.c ***********************************************/
7762577668
/************** Begin file analyze.c *****************************************/
77669
+#line 1 "tsrc/analyze.c"
7762677670
/*
7762777671
** 2005 July 8
7762877672
**
7762977673
** The author disclaims copyright to this source code. In place of
7763077674
** a legal notice, here is a blessing:
@@ -78342,10 +78386,11 @@
7834278386
7834378387
#endif /* SQLITE_OMIT_ANALYZE */
7834478388
7834578389
/************** End of analyze.c *********************************************/
7834678390
/************** Begin file attach.c ******************************************/
78391
+#line 1 "tsrc/attach.c"
7834778392
/*
7834878393
** 2003 April 6
7834978394
**
7835078395
** The author disclaims copyright to this source code. In place of
7835178396
** a legal notice, here is a blessing:
@@ -78901,10 +78946,11 @@
7890178946
}
7890278947
#endif
7890378948
7890478949
/************** End of attach.c **********************************************/
7890578950
/************** Begin file auth.c ********************************************/
78951
+#line 1 "tsrc/auth.c"
7890678952
/*
7890778953
** 2003 January 11
7890878954
**
7890978955
** The author disclaims copyright to this source code. In place of
7891078956
** a legal notice, here is a blessing:
@@ -79152,10 +79198,11 @@
7915279198
7915379199
#endif /* SQLITE_OMIT_AUTHORIZATION */
7915479200
7915579201
/************** End of auth.c ************************************************/
7915679202
/************** Begin file build.c *******************************************/
79203
+#line 1 "tsrc/build.c"
7915779204
/*
7915879205
** 2001 September 15
7915979206
**
7916079207
** The author disclaims copyright to this source code. In place of
7916179208
** a legal notice, here is a blessing:
@@ -82955,10 +83002,11 @@
8295583002
return pKey;
8295683003
}
8295783004
8295883005
/************** End of build.c ***********************************************/
8295983006
/************** Begin file callback.c ****************************************/
83007
+#line 1 "tsrc/callback.c"
8296083008
/*
8296183009
** 2005 May 23
8296283010
**
8296383011
** The author disclaims copyright to this source code. In place of
8296483012
** a legal notice, here is a blessing:
@@ -83414,10 +83462,11 @@
8341483462
return p;
8341583463
}
8341683464
8341783465
/************** End of callback.c ********************************************/
8341883466
/************** Begin file delete.c ******************************************/
83467
+#line 1 "tsrc/delete.c"
8341983468
/*
8342083469
** 2001 September 15
8342183470
**
8342283471
** The author disclaims copyright to this source code. In place of
8342383472
** a legal notice, here is a blessing:
@@ -84068,10 +84117,11 @@
8406884117
return regBase;
8406984118
}
8407084119
8407184120
/************** End of delete.c **********************************************/
8407284121
/************** Begin file func.c ********************************************/
84122
+#line 1 "tsrc/func.c"
8407384123
/*
8407484124
** 2002 February 23
8407584125
**
8407684126
** The author disclaims copyright to this source code. In place of
8407784127
** a legal notice, here is a blessing:
@@ -85676,10 +85726,11 @@
8567685726
#endif
8567785727
}
8567885728
8567985729
/************** End of func.c ************************************************/
8568085730
/************** Begin file fkey.c ********************************************/
85731
+#line 1 "tsrc/fkey.c"
8568185732
/*
8568285733
**
8568385734
** The author disclaims copyright to this source code. In place of
8568485735
** a legal notice, here is a blessing:
8568585736
**
@@ -86896,10 +86947,11 @@
8689686947
}
8689786948
#endif /* ifndef SQLITE_OMIT_FOREIGN_KEY */
8689886949
8689986950
/************** End of fkey.c ************************************************/
8690086951
/************** Begin file insert.c ******************************************/
86952
+#line 1 "tsrc/insert.c"
8690186953
/*
8690286954
** 2001 September 15
8690386955
**
8690486956
** The author disclaims copyright to this source code. In place of
8690586957
** a legal notice, here is a blessing:
@@ -88741,10 +88793,11 @@
8874188793
}
8874288794
#endif /* SQLITE_OMIT_XFER_OPT */
8874388795
8874488796
/************** End of insert.c **********************************************/
8874588797
/************** Begin file legacy.c ******************************************/
88798
+#line 1 "tsrc/legacy.c"
8874688799
/*
8874788800
** 2001 September 15
8874888801
**
8874988802
** The author disclaims copyright to this source code. In place of
8875088803
** a legal notice, here is a blessing:
@@ -88888,10 +88941,11 @@
8888888941
return rc;
8888988942
}
8889088943
8889188944
/************** End of legacy.c **********************************************/
8889288945
/************** Begin file loadext.c *****************************************/
88946
+#line 1 "tsrc/loadext.c"
8889388947
/*
8889488948
** 2006 June 7
8889588949
**
8889688950
** The author disclaims copyright to this source code. In place of
8889788951
** a legal notice, here is a blessing:
@@ -88908,10 +88962,11 @@
8890888962
#ifndef SQLITE_CORE
8890988963
#define SQLITE_CORE 1 /* Disable the API redefinition in sqlite3ext.h */
8891088964
#endif
8891188965
/************** Include sqlite3ext.h in the middle of loadext.c **************/
8891288966
/************** Begin file sqlite3ext.h **************************************/
88967
+#line 1 "tsrc/sqlite3ext.h"
8891388968
/*
8891488969
** 2006 June 7
8891588970
**
8891688971
** The author disclaims copyright to this source code. In place of
8891788972
** a legal notice, here is a blessing:
@@ -89336,10 +89391,11 @@
8933689391
8933789392
#endif /* _SQLITE3EXT_H_ */
8933889393
8933989394
/************** End of sqlite3ext.h ******************************************/
8934089395
/************** Continuing where we left off in loadext.c ********************/
89396
+#line 20 "tsrc/loadext.c"
8934189397
/* #include <string.h> */
8934289398
8934389399
#ifndef SQLITE_OMIT_LOAD_EXTENSION
8934489400
8934589401
/*
@@ -89975,10 +90031,11 @@
8997590031
}
8997690032
}
8997790033
8997890034
/************** End of loadext.c *********************************************/
8997990035
/************** Begin file pragma.c ******************************************/
90036
+#line 1 "tsrc/pragma.c"
8998090037
/*
8998190038
** 2003 April 6
8998290039
**
8998390040
** The author disclaims copyright to this source code. In place of
8998490041
** a legal notice, here is a blessing:
@@ -91503,10 +91560,11 @@
9150391560
9150491561
#endif /* SQLITE_OMIT_PRAGMA */
9150591562
9150691563
/************** End of pragma.c **********************************************/
9150791564
/************** Begin file prepare.c *****************************************/
91565
+#line 1 "tsrc/prepare.c"
9150891566
/*
9150991567
** 2005 May 25
9151091568
**
9151191569
** The author disclaims copyright to this source code. In place of
9151291570
** a legal notice, here is a blessing:
@@ -92363,10 +92421,11 @@
9236392421
9236492422
#endif /* SQLITE_OMIT_UTF16 */
9236592423
9236692424
/************** End of prepare.c *********************************************/
9236792425
/************** Begin file select.c ******************************************/
92426
+#line 1 "tsrc/select.c"
9236892427
/*
9236992428
** 2001 September 15
9237092429
**
9237192430
** The author disclaims copyright to this source code. In place of
9237292431
** a legal notice, here is a blessing:
@@ -96922,10 +96981,11 @@
9692296981
*****************************************************************************/
9692396982
#endif /* defined(SQLITE_TEST) || defined(SQLITE_DEBUG) */
9692496983
9692596984
/************** End of select.c **********************************************/
9692696985
/************** Begin file table.c *******************************************/
96986
+#line 1 "tsrc/table.c"
9692796987
/*
9692896988
** 2001 September 15
9692996989
**
9693096990
** The author disclaims copyright to this source code. In place of
9693196991
** a legal notice, here is a blessing:
@@ -97121,10 +97181,11 @@
9712197181
9712297182
#endif /* SQLITE_OMIT_GET_TABLE */
9712397183
9712497184
/************** End of table.c ***********************************************/
9712597185
/************** Begin file trigger.c *****************************************/
97186
+#line 1 "tsrc/trigger.c"
9712697187
/*
9712797188
**
9712897189
** The author disclaims copyright to this source code. In place of
9712997190
** a legal notice, here is a blessing:
9713097191
**
@@ -98246,10 +98307,11 @@
9824698307
9824798308
#endif /* !defined(SQLITE_OMIT_TRIGGER) */
9824898309
9824998310
/************** End of trigger.c *********************************************/
9825098311
/************** Begin file update.c ******************************************/
98312
+#line 1 "tsrc/update.c"
9825198313
/*
9825298314
** 2001 September 15
9825398315
**
9825498316
** The author disclaims copyright to this source code. In place of
9825598317
** a legal notice, here is a blessing:
@@ -98918,10 +98980,11 @@
9891898980
}
9891998981
#endif /* SQLITE_OMIT_VIRTUALTABLE */
9892098982
9892198983
/************** End of update.c **********************************************/
9892298984
/************** Begin file vacuum.c ******************************************/
98985
+#line 1 "tsrc/vacuum.c"
9892398986
/*
9892498987
** 2003 April 6
9892598988
**
9892698989
** The author disclaims copyright to this source code. In place of
9892798990
** a legal notice, here is a blessing:
@@ -99264,10 +99327,11 @@
9926499327
9926599328
#endif /* SQLITE_OMIT_VACUUM && SQLITE_OMIT_ATTACH */
9926699329
9926799330
/************** End of vacuum.c **********************************************/
9926899331
/************** Begin file vtab.c ********************************************/
99332
+#line 1 "tsrc/vtab.c"
9926999333
/*
9927099334
** 2006 June 10
9927199335
**
9927299336
** The author disclaims copyright to this source code. In place of
9927399337
** a legal notice, here is a blessing:
@@ -100332,10 +100396,11 @@
100332100396
100333100397
#endif /* SQLITE_OMIT_VIRTUALTABLE */
100334100398
100335100399
/************** End of vtab.c ************************************************/
100336100400
/************** Begin file where.c *******************************************/
100401
+#line 1 "tsrc/where.c"
100337100402
/*
100338100403
** 2001 September 15
100339100404
**
100340100405
** The author disclaims copyright to this source code. In place of
100341100406
** a legal notice, here is a blessing:
@@ -105518,10 +105583,11 @@
105518105583
return;
105519105584
}
105520105585
105521105586
/************** End of where.c ***********************************************/
105522105587
/************** Begin file parse.c *******************************************/
105588
+#line 1 "tsrc/parse.c"
105523105589
/* Driver template for the LEMON parser generator.
105524105590
** The author disclaims copyright to this source code.
105525105591
**
105526105592
** This version of "lempar.c" is modified, slightly, for use by SQLite.
105527105593
** The only modifications are the addition of a couple of NEVER()
@@ -105530,10 +105596,11 @@
105530105596
** specific grammar used by SQLite.
105531105597
*/
105532105598
/* First off, code is included that follows the "include" declaration
105533105599
** in the input grammar file. */
105534105600
/* #include <stdio.h> */
105601
+#line 51 "parse.y"
105535105602
105536105603
105537105604
/*
105538105605
** Disable all error recovery processing in the parser push-down
105539105606
** automaton.
@@ -105577,10 +105644,11 @@
105577105644
/*
105578105645
** An instance of this structure holds the ATTACH key and the key type.
105579105646
*/
105580105647
struct AttachKey { int type; Token key; };
105581105648
105649
+#line 722 "parse.y"
105582105650
105583105651
/* This is a utility routine used to set the ExprSpan.zStart and
105584105652
** ExprSpan.zEnd values of pOut so that the span covers the complete
105585105653
** range of text beginning with pStart and going to the end of pEnd.
105586105654
*/
@@ -105596,10 +105664,11 @@
105596105664
static void spanExpr(ExprSpan *pOut, Parse *pParse, int op, Token *pValue){
105597105665
pOut->pExpr = sqlite3PExpr(pParse, op, 0, 0, pValue);
105598105666
pOut->zStart = pValue->z;
105599105667
pOut->zEnd = &pValue->z[pValue->n];
105600105668
}
105669
+#line 817 "parse.y"
105601105670
105602105671
/* This routine constructs a binary expression node out of two ExprSpan
105603105672
** objects and uses the result to populate a new ExprSpan object.
105604105673
*/
105605105674
static void spanBinaryExpr(
@@ -105611,10 +105680,11 @@
105611105680
){
105612105681
pOut->pExpr = sqlite3PExpr(pParse, op, pLeft->pExpr, pRight->pExpr, 0);
105613105682
pOut->zStart = pLeft->zStart;
105614105683
pOut->zEnd = pRight->zEnd;
105615105684
}
105685
+#line 873 "parse.y"
105616105686
105617105687
/* Construct an expression node for a unary postfix operator
105618105688
*/
105619105689
static void spanUnaryPostfix(
105620105690
ExprSpan *pOut, /* Write the new expression node here */
@@ -105625,10 +105695,11 @@
105625105695
){
105626105696
pOut->pExpr = sqlite3PExpr(pParse, op, pOperand->pExpr, 0, 0);
105627105697
pOut->zStart = pOperand->zStart;
105628105698
pOut->zEnd = &pPostOp->z[pPostOp->n];
105629105699
}
105700
+#line 892 "parse.y"
105630105701
105631105702
/* A routine to convert a binary TK_IS or TK_ISNOT expression into a
105632105703
** unary TK_ISNULL or TK_NOTNULL expression. */
105633105704
static void binaryToUnaryIfNull(Parse *pParse, Expr *pY, Expr *pA, int op){
105634105705
sqlite3 *db = pParse->db;
@@ -105636,10 +105707,11 @@
105636105707
pA->op = (u8)op;
105637105708
sqlite3ExprDelete(db, pA->pRight);
105638105709
pA->pRight = 0;
105639105710
}
105640105711
}
105712
+#line 920 "parse.y"
105641105713
105642105714
/* Construct an expression node for a unary prefix operator
105643105715
*/
105644105716
static void spanUnaryPrefix(
105645105717
ExprSpan *pOut, /* Write the new expression node here */
@@ -105650,10 +105722,11 @@
105650105722
){
105651105723
pOut->pExpr = sqlite3PExpr(pParse, op, pOperand->pExpr, 0, 0);
105652105724
pOut->zStart = pPreOp->z;
105653105725
pOut->zEnd = pOperand->zEnd;
105654105726
}
105727
+#line 141 "parse.c"
105655105728
/* Next is all token values, in a form suitable for use by makeheaders.
105656105729
** This section will be null unless lemon is run with the -m switch.
105657105730
*/
105658105731
/*
105659105732
** These constants (all generated automatically by the parser generator)
@@ -106905,17 +106978,21 @@
106905106978
** inside the C code.
106906106979
*/
106907106980
case 160: /* select */
106908106981
case 194: /* oneselect */
106909106982
{
106983
+#line 403 "parse.y"
106910106984
sqlite3SelectDelete(pParse->db, (yypminor->yy387));
106985
+#line 1399 "parse.c"
106911106986
}
106912106987
break;
106913106988
case 174: /* term */
106914106989
case 175: /* expr */
106915106990
{
106991
+#line 720 "parse.y"
106916106992
sqlite3ExprDelete(pParse->db, (yypminor->yy118).pExpr);
106993
+#line 1407 "parse.c"
106917106994
}
106918106995
break;
106919106996
case 179: /* idxlist_opt */
106920106997
case 187: /* idxlist */
106921106998
case 197: /* selcollist */
@@ -106927,19 +107004,23 @@
106927107004
case 217: /* setlist */
106928107005
case 220: /* itemlist */
106929107006
case 221: /* exprlist */
106930107007
case 226: /* case_exprlist */
106931107008
{
107009
+#line 1103 "parse.y"
106932107010
sqlite3ExprListDelete(pParse->db, (yypminor->yy322));
107011
+#line 1425 "parse.c"
106933107012
}
106934107013
break;
106935107014
case 193: /* fullname */
106936107015
case 198: /* from */
106937107016
case 206: /* seltablist */
106938107017
case 207: /* stl_prefix */
106939107018
{
107019
+#line 534 "parse.y"
106940107020
sqlite3SrcListDelete(pParse->db, (yypminor->yy259));
107021
+#line 1435 "parse.c"
106941107022
}
106942107023
break;
106943107024
case 199: /* where_opt */
106944107025
case 201: /* having_opt */
106945107026
case 210: /* on_opt */
@@ -106947,29 +107028,37 @@
106947107028
case 225: /* case_operand */
106948107029
case 227: /* case_else */
106949107030
case 238: /* when_clause */
106950107031
case 243: /* key_opt */
106951107032
{
107033
+#line 644 "parse.y"
106952107034
sqlite3ExprDelete(pParse->db, (yypminor->yy314));
107035
+#line 1449 "parse.c"
106953107036
}
106954107037
break;
106955107038
case 211: /* using_opt */
106956107039
case 213: /* inscollist */
106957107040
case 219: /* inscollist_opt */
106958107041
{
107042
+#line 566 "parse.y"
106959107043
sqlite3IdListDelete(pParse->db, (yypminor->yy384));
107044
+#line 1458 "parse.c"
106960107045
}
106961107046
break;
106962107047
case 234: /* trigger_cmd_list */
106963107048
case 239: /* trigger_cmd */
106964107049
{
107050
+#line 1210 "parse.y"
106965107051
sqlite3DeleteTriggerStep(pParse->db, (yypminor->yy203));
107052
+#line 1466 "parse.c"
106966107053
}
106967107054
break;
106968107055
case 236: /* trigger_event */
106969107056
{
107057
+#line 1196 "parse.y"
106970107058
sqlite3IdListDelete(pParse->db, (yypminor->yy90).b);
107059
+#line 1473 "parse.c"
106971107060
}
106972107061
break;
106973107062
default: break; /* If no destructor action specified: do nothing */
106974107063
}
106975107064
}
@@ -107151,14 +107240,16 @@
107151107240
}
107152107241
#endif
107153107242
while( yypParser->yyidx>=0 ) yy_pop_parser_stack(yypParser);
107154107243
/* Here code is inserted which will execute if the parser
107155107244
** stack every overflows */
107245
+#line 38 "parse.y"
107156107246
107157107247
UNUSED_PARAMETER(yypMinor); /* Silence some compiler warnings */
107158107248
sqlite3ErrorMsg(pParse, "parser stack overflow");
107159107249
pParse->parseError = 1;
107250
+#line 1664 "parse.c"
107160107251
sqlite3ParserARG_STORE; /* Suppress warning about unused %extra_argument var */
107161107252
}
107162107253
107163107254
/*
107164107255
** Perform a shift action.
@@ -107595,66 +107686,94 @@
107595107686
** { ... } // User supplied code
107596107687
** #line <lineno> <thisfile>
107597107688
** break;
107598107689
*/
107599107690
case 5: /* explain ::= */
107691
+#line 107 "parse.y"
107600107692
{ sqlite3BeginParse(pParse, 0); }
107693
+#line 2107 "parse.c"
107601107694
break;
107602107695
case 6: /* explain ::= EXPLAIN */
107696
+#line 109 "parse.y"
107603107697
{ sqlite3BeginParse(pParse, 1); }
107698
+#line 2112 "parse.c"
107604107699
break;
107605107700
case 7: /* explain ::= EXPLAIN QUERY PLAN */
107701
+#line 110 "parse.y"
107606107702
{ sqlite3BeginParse(pParse, 2); }
107703
+#line 2117 "parse.c"
107607107704
break;
107608107705
case 8: /* cmdx ::= cmd */
107706
+#line 112 "parse.y"
107609107707
{ sqlite3FinishCoding(pParse); }
107708
+#line 2122 "parse.c"
107610107709
break;
107611107710
case 9: /* cmd ::= BEGIN transtype trans_opt */
107711
+#line 117 "parse.y"
107612107712
{sqlite3BeginTransaction(pParse, yymsp[-1].minor.yy4);}
107713
+#line 2127 "parse.c"
107613107714
break;
107614107715
case 13: /* transtype ::= */
107716
+#line 122 "parse.y"
107615107717
{yygotominor.yy4 = TK_DEFERRED;}
107718
+#line 2132 "parse.c"
107616107719
break;
107617107720
case 14: /* transtype ::= DEFERRED */
107618107721
case 15: /* transtype ::= IMMEDIATE */ yytestcase(yyruleno==15);
107619107722
case 16: /* transtype ::= EXCLUSIVE */ yytestcase(yyruleno==16);
107620107723
case 115: /* multiselect_op ::= UNION */ yytestcase(yyruleno==115);
107621107724
case 117: /* multiselect_op ::= EXCEPT|INTERSECT */ yytestcase(yyruleno==117);
107725
+#line 123 "parse.y"
107622107726
{yygotominor.yy4 = yymsp[0].major;}
107727
+#line 2141 "parse.c"
107623107728
break;
107624107729
case 17: /* cmd ::= COMMIT trans_opt */
107625107730
case 18: /* cmd ::= END trans_opt */ yytestcase(yyruleno==18);
107731
+#line 126 "parse.y"
107626107732
{sqlite3CommitTransaction(pParse);}
107733
+#line 2147 "parse.c"
107627107734
break;
107628107735
case 19: /* cmd ::= ROLLBACK trans_opt */
107736
+#line 128 "parse.y"
107629107737
{sqlite3RollbackTransaction(pParse);}
107738
+#line 2152 "parse.c"
107630107739
break;
107631107740
case 22: /* cmd ::= SAVEPOINT nm */
107741
+#line 132 "parse.y"
107632107742
{
107633107743
sqlite3Savepoint(pParse, SAVEPOINT_BEGIN, &yymsp[0].minor.yy0);
107634107744
}
107745
+#line 2159 "parse.c"
107635107746
break;
107636107747
case 23: /* cmd ::= RELEASE savepoint_opt nm */
107748
+#line 135 "parse.y"
107637107749
{
107638107750
sqlite3Savepoint(pParse, SAVEPOINT_RELEASE, &yymsp[0].minor.yy0);
107639107751
}
107752
+#line 2166 "parse.c"
107640107753
break;
107641107754
case 24: /* cmd ::= ROLLBACK trans_opt TO savepoint_opt nm */
107755
+#line 138 "parse.y"
107642107756
{
107643107757
sqlite3Savepoint(pParse, SAVEPOINT_ROLLBACK, &yymsp[0].minor.yy0);
107644107758
}
107759
+#line 2173 "parse.c"
107645107760
break;
107646107761
case 26: /* create_table ::= createkw temp TABLE ifnotexists nm dbnm */
107762
+#line 145 "parse.y"
107647107763
{
107648107764
sqlite3StartTable(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,yymsp[-4].minor.yy4,0,0,yymsp[-2].minor.yy4);
107649107765
}
107766
+#line 2180 "parse.c"
107650107767
break;
107651107768
case 27: /* createkw ::= CREATE */
107769
+#line 148 "parse.y"
107652107770
{
107653107771
pParse->db->lookaside.bEnabled = 0;
107654107772
yygotominor.yy0 = yymsp[0].minor.yy0;
107655107773
}
107774
+#line 2188 "parse.c"
107656107775
break;
107657107776
case 28: /* ifnotexists ::= */
107658107777
case 31: /* temp ::= */ yytestcase(yyruleno==31);
107659107778
case 70: /* autoinc ::= */ yytestcase(yyruleno==70);
107660107779
case 83: /* defer_subclause ::= NOT DEFERRABLE init_deferred_pred_opt */ yytestcase(yyruleno==83);
@@ -107664,44 +107783,56 @@
107664107783
case 109: /* ifexists ::= */ yytestcase(yyruleno==109);
107665107784
case 120: /* distinct ::= ALL */ yytestcase(yyruleno==120);
107666107785
case 121: /* distinct ::= */ yytestcase(yyruleno==121);
107667107786
case 222: /* between_op ::= BETWEEN */ yytestcase(yyruleno==222);
107668107787
case 225: /* in_op ::= IN */ yytestcase(yyruleno==225);
107788
+#line 153 "parse.y"
107669107789
{yygotominor.yy4 = 0;}
107790
+#line 2204 "parse.c"
107670107791
break;
107671107792
case 29: /* ifnotexists ::= IF NOT EXISTS */
107672107793
case 30: /* temp ::= TEMP */ yytestcase(yyruleno==30);
107673107794
case 71: /* autoinc ::= AUTOINCR */ yytestcase(yyruleno==71);
107674107795
case 86: /* init_deferred_pred_opt ::= INITIALLY DEFERRED */ yytestcase(yyruleno==86);
107675107796
case 108: /* ifexists ::= IF EXISTS */ yytestcase(yyruleno==108);
107676107797
case 119: /* distinct ::= DISTINCT */ yytestcase(yyruleno==119);
107677107798
case 223: /* between_op ::= NOT BETWEEN */ yytestcase(yyruleno==223);
107678107799
case 226: /* in_op ::= NOT IN */ yytestcase(yyruleno==226);
107800
+#line 154 "parse.y"
107679107801
{yygotominor.yy4 = 1;}
107802
+#line 2216 "parse.c"
107680107803
break;
107681107804
case 32: /* create_table_args ::= LP columnlist conslist_opt RP */
107805
+#line 160 "parse.y"
107682107806
{
107683107807
sqlite3EndTable(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,0);
107684107808
}
107809
+#line 2223 "parse.c"
107685107810
break;
107686107811
case 33: /* create_table_args ::= AS select */
107812
+#line 163 "parse.y"
107687107813
{
107688107814
sqlite3EndTable(pParse,0,0,yymsp[0].minor.yy387);
107689107815
sqlite3SelectDelete(pParse->db, yymsp[0].minor.yy387);
107690107816
}
107817
+#line 2231 "parse.c"
107691107818
break;
107692107819
case 36: /* column ::= columnid type carglist */
107820
+#line 175 "parse.y"
107693107821
{
107694107822
yygotominor.yy0.z = yymsp[-2].minor.yy0.z;
107695107823
yygotominor.yy0.n = (int)(pParse->sLastToken.z-yymsp[-2].minor.yy0.z) + pParse->sLastToken.n;
107696107824
}
107825
+#line 2239 "parse.c"
107697107826
break;
107698107827
case 37: /* columnid ::= nm */
107828
+#line 179 "parse.y"
107699107829
{
107700107830
sqlite3AddColumn(pParse,&yymsp[0].minor.yy0);
107701107831
yygotominor.yy0 = yymsp[0].minor.yy0;
107702107832
}
107833
+#line 2247 "parse.c"
107703107834
break;
107704107835
case 38: /* id ::= ID */
107705107836
case 39: /* id ::= INDEXED */ yytestcase(yyruleno==39);
107706107837
case 40: /* ids ::= ID|STRING */ yytestcase(yyruleno==40);
107707107838
case 41: /* nm ::= id */ yytestcase(yyruleno==41);
@@ -107721,256 +107852,373 @@
107721107852
case 264: /* nmnum ::= DEFAULT */ yytestcase(yyruleno==264);
107722107853
case 265: /* plus_num ::= plus_opt number */ yytestcase(yyruleno==265);
107723107854
case 266: /* minus_num ::= MINUS number */ yytestcase(yyruleno==266);
107724107855
case 267: /* number ::= INTEGER|FLOAT */ yytestcase(yyruleno==267);
107725107856
case 285: /* trnm ::= nm */ yytestcase(yyruleno==285);
107857
+#line 189 "parse.y"
107726107858
{yygotominor.yy0 = yymsp[0].minor.yy0;}
107859
+#line 2273 "parse.c"
107727107860
break;
107728107861
case 45: /* type ::= typetoken */
107862
+#line 251 "parse.y"
107729107863
{sqlite3AddColumnType(pParse,&yymsp[0].minor.yy0);}
107864
+#line 2278 "parse.c"
107730107865
break;
107731107866
case 47: /* typetoken ::= typename LP signed RP */
107867
+#line 253 "parse.y"
107732107868
{
107733107869
yygotominor.yy0.z = yymsp[-3].minor.yy0.z;
107734107870
yygotominor.yy0.n = (int)(&yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n] - yymsp[-3].minor.yy0.z);
107735107871
}
107872
+#line 2286 "parse.c"
107736107873
break;
107737107874
case 48: /* typetoken ::= typename LP signed COMMA signed RP */
107875
+#line 257 "parse.y"
107738107876
{
107739107877
yygotominor.yy0.z = yymsp[-5].minor.yy0.z;
107740107878
yygotominor.yy0.n = (int)(&yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n] - yymsp[-5].minor.yy0.z);
107741107879
}
107880
+#line 2294 "parse.c"
107742107881
break;
107743107882
case 50: /* typename ::= typename ids */
107883
+#line 263 "parse.y"
107744107884
{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"
107745107886
break;
107746107887
case 57: /* ccons ::= DEFAULT term */
107747107888
case 59: /* ccons ::= DEFAULT PLUS term */ yytestcase(yyruleno==59);
107889
+#line 274 "parse.y"
107748107890
{sqlite3AddDefaultValue(pParse,&yymsp[0].minor.yy118);}
107891
+#line 2305 "parse.c"
107749107892
break;
107750107893
case 58: /* ccons ::= DEFAULT LP expr RP */
107894
+#line 275 "parse.y"
107751107895
{sqlite3AddDefaultValue(pParse,&yymsp[-1].minor.yy118);}
107896
+#line 2310 "parse.c"
107752107897
break;
107753107898
case 60: /* ccons ::= DEFAULT MINUS term */
107899
+#line 277 "parse.y"
107754107900
{
107755107901
ExprSpan v;
107756107902
v.pExpr = sqlite3PExpr(pParse, TK_UMINUS, yymsp[0].minor.yy118.pExpr, 0, 0);
107757107903
v.zStart = yymsp[-1].minor.yy0.z;
107758107904
v.zEnd = yymsp[0].minor.yy118.zEnd;
107759107905
sqlite3AddDefaultValue(pParse,&v);
107760107906
}
107907
+#line 2321 "parse.c"
107761107908
break;
107762107909
case 61: /* ccons ::= DEFAULT id */
107910
+#line 284 "parse.y"
107763107911
{
107764107912
ExprSpan v;
107765107913
spanExpr(&v, pParse, TK_STRING, &yymsp[0].minor.yy0);
107766107914
sqlite3AddDefaultValue(pParse,&v);
107767107915
}
107916
+#line 2330 "parse.c"
107768107917
break;
107769107918
case 63: /* ccons ::= NOT NULL onconf */
107919
+#line 294 "parse.y"
107770107920
{sqlite3AddNotNull(pParse, yymsp[0].minor.yy4);}
107921
+#line 2335 "parse.c"
107771107922
break;
107772107923
case 64: /* ccons ::= PRIMARY KEY sortorder onconf autoinc */
107924
+#line 296 "parse.y"
107773107925
{sqlite3AddPrimaryKey(pParse,0,yymsp[-1].minor.yy4,yymsp[0].minor.yy4,yymsp[-2].minor.yy4);}
107926
+#line 2340 "parse.c"
107774107927
break;
107775107928
case 65: /* ccons ::= UNIQUE onconf */
107929
+#line 297 "parse.y"
107776107930
{sqlite3CreateIndex(pParse,0,0,0,0,yymsp[0].minor.yy4,0,0,0,0);}
107931
+#line 2345 "parse.c"
107777107932
break;
107778107933
case 66: /* ccons ::= CHECK LP expr RP */
107934
+#line 298 "parse.y"
107779107935
{sqlite3AddCheckConstraint(pParse,yymsp[-1].minor.yy118.pExpr);}
107936
+#line 2350 "parse.c"
107780107937
break;
107781107938
case 67: /* ccons ::= REFERENCES nm idxlist_opt refargs */
107939
+#line 300 "parse.y"
107782107940
{sqlite3CreateForeignKey(pParse,0,&yymsp[-2].minor.yy0,yymsp[-1].minor.yy322,yymsp[0].minor.yy4);}
107941
+#line 2355 "parse.c"
107783107942
break;
107784107943
case 68: /* ccons ::= defer_subclause */
107944
+#line 301 "parse.y"
107785107945
{sqlite3DeferForeignKey(pParse,yymsp[0].minor.yy4);}
107946
+#line 2360 "parse.c"
107786107947
break;
107787107948
case 69: /* ccons ::= COLLATE ids */
107949
+#line 302 "parse.y"
107788107950
{sqlite3AddCollateType(pParse, &yymsp[0].minor.yy0);}
107951
+#line 2365 "parse.c"
107789107952
break;
107790107953
case 72: /* refargs ::= */
107954
+#line 315 "parse.y"
107791107955
{ yygotominor.yy4 = OE_None*0x0101; /* EV: R-19803-45884 */}
107956
+#line 2370 "parse.c"
107792107957
break;
107793107958
case 73: /* refargs ::= refargs refarg */
107959
+#line 316 "parse.y"
107794107960
{ yygotominor.yy4 = (yymsp[-1].minor.yy4 & ~yymsp[0].minor.yy215.mask) | yymsp[0].minor.yy215.value; }
107961
+#line 2375 "parse.c"
107795107962
break;
107796107963
case 74: /* refarg ::= MATCH nm */
107797107964
case 75: /* refarg ::= ON INSERT refact */ yytestcase(yyruleno==75);
107965
+#line 318 "parse.y"
107798107966
{ yygotominor.yy215.value = 0; yygotominor.yy215.mask = 0x000000; }
107967
+#line 2381 "parse.c"
107799107968
break;
107800107969
case 76: /* refarg ::= ON DELETE refact */
107970
+#line 320 "parse.y"
107801107971
{ yygotominor.yy215.value = yymsp[0].minor.yy4; yygotominor.yy215.mask = 0x0000ff; }
107972
+#line 2386 "parse.c"
107802107973
break;
107803107974
case 77: /* refarg ::= ON UPDATE refact */
107975
+#line 321 "parse.y"
107804107976
{ yygotominor.yy215.value = yymsp[0].minor.yy4<<8; yygotominor.yy215.mask = 0x00ff00; }
107977
+#line 2391 "parse.c"
107805107978
break;
107806107979
case 78: /* refact ::= SET NULL */
107980
+#line 323 "parse.y"
107807107981
{ yygotominor.yy4 = OE_SetNull; /* EV: R-33326-45252 */}
107982
+#line 2396 "parse.c"
107808107983
break;
107809107984
case 79: /* refact ::= SET DEFAULT */
107985
+#line 324 "parse.y"
107810107986
{ yygotominor.yy4 = OE_SetDflt; /* EV: R-33326-45252 */}
107987
+#line 2401 "parse.c"
107811107988
break;
107812107989
case 80: /* refact ::= CASCADE */
107990
+#line 325 "parse.y"
107813107991
{ yygotominor.yy4 = OE_Cascade; /* EV: R-33326-45252 */}
107992
+#line 2406 "parse.c"
107814107993
break;
107815107994
case 81: /* refact ::= RESTRICT */
107995
+#line 326 "parse.y"
107816107996
{ yygotominor.yy4 = OE_Restrict; /* EV: R-33326-45252 */}
107997
+#line 2411 "parse.c"
107817107998
break;
107818107999
case 82: /* refact ::= NO ACTION */
108000
+#line 327 "parse.y"
107819108001
{ yygotominor.yy4 = OE_None; /* EV: R-33326-45252 */}
108002
+#line 2416 "parse.c"
107820108003
break;
107821108004
case 84: /* defer_subclause ::= DEFERRABLE init_deferred_pred_opt */
107822108005
case 99: /* defer_subclause_opt ::= defer_subclause */ yytestcase(yyruleno==99);
107823108006
case 101: /* onconf ::= ON CONFLICT resolvetype */ yytestcase(yyruleno==101);
107824108007
case 104: /* resolvetype ::= raisetype */ yytestcase(yyruleno==104);
108008
+#line 330 "parse.y"
107825108009
{yygotominor.yy4 = yymsp[0].minor.yy4;}
108010
+#line 2424 "parse.c"
107826108011
break;
107827108012
case 88: /* conslist_opt ::= */
108013
+#line 339 "parse.y"
107828108014
{yygotominor.yy0.n = 0; yygotominor.yy0.z = 0;}
108015
+#line 2429 "parse.c"
107829108016
break;
107830108017
case 89: /* conslist_opt ::= COMMA conslist */
108018
+#line 340 "parse.y"
107831108019
{yygotominor.yy0 = yymsp[-1].minor.yy0;}
108020
+#line 2434 "parse.c"
107832108021
break;
107833108022
case 94: /* tcons ::= PRIMARY KEY LP idxlist autoinc RP onconf */
108023
+#line 346 "parse.y"
107834108024
{sqlite3AddPrimaryKey(pParse,yymsp[-3].minor.yy322,yymsp[0].minor.yy4,yymsp[-2].minor.yy4,0);}
108025
+#line 2439 "parse.c"
107835108026
break;
107836108027
case 95: /* tcons ::= UNIQUE LP idxlist RP onconf */
108028
+#line 348 "parse.y"
107837108029
{sqlite3CreateIndex(pParse,0,0,0,yymsp[-2].minor.yy322,yymsp[0].minor.yy4,0,0,0,0);}
108030
+#line 2444 "parse.c"
107838108031
break;
107839108032
case 96: /* tcons ::= CHECK LP expr RP onconf */
108033
+#line 350 "parse.y"
107840108034
{sqlite3AddCheckConstraint(pParse,yymsp[-2].minor.yy118.pExpr);}
108035
+#line 2449 "parse.c"
107841108036
break;
107842108037
case 97: /* tcons ::= FOREIGN KEY LP idxlist RP REFERENCES nm idxlist_opt refargs defer_subclause_opt */
108038
+#line 352 "parse.y"
107843108039
{
107844108040
sqlite3CreateForeignKey(pParse, yymsp[-6].minor.yy322, &yymsp[-3].minor.yy0, yymsp[-2].minor.yy322, yymsp[-1].minor.yy4);
107845108041
sqlite3DeferForeignKey(pParse, yymsp[0].minor.yy4);
107846108042
}
108043
+#line 2457 "parse.c"
107847108044
break;
107848108045
case 100: /* onconf ::= */
108046
+#line 366 "parse.y"
107849108047
{yygotominor.yy4 = OE_Default;}
108048
+#line 2462 "parse.c"
107850108049
break;
107851108050
case 102: /* orconf ::= */
108051
+#line 368 "parse.y"
107852108052
{yygotominor.yy210 = OE_Default;}
108053
+#line 2467 "parse.c"
107853108054
break;
107854108055
case 103: /* orconf ::= OR resolvetype */
108056
+#line 369 "parse.y"
107855108057
{yygotominor.yy210 = (u8)yymsp[0].minor.yy4;}
108058
+#line 2472 "parse.c"
107856108059
break;
107857108060
case 105: /* resolvetype ::= IGNORE */
108061
+#line 371 "parse.y"
107858108062
{yygotominor.yy4 = OE_Ignore;}
108063
+#line 2477 "parse.c"
107859108064
break;
107860108065
case 106: /* resolvetype ::= REPLACE */
108066
+#line 372 "parse.y"
107861108067
{yygotominor.yy4 = OE_Replace;}
108068
+#line 2482 "parse.c"
107862108069
break;
107863108070
case 107: /* cmd ::= DROP TABLE ifexists fullname */
108071
+#line 376 "parse.y"
107864108072
{
107865108073
sqlite3DropTable(pParse, yymsp[0].minor.yy259, 0, yymsp[-1].minor.yy4);
107866108074
}
108075
+#line 2489 "parse.c"
107867108076
break;
107868108077
case 110: /* cmd ::= createkw temp VIEW ifnotexists nm dbnm AS select */
108078
+#line 386 "parse.y"
107869108079
{
107870108080
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);
107871108081
}
108082
+#line 2496 "parse.c"
107872108083
break;
107873108084
case 111: /* cmd ::= DROP VIEW ifexists fullname */
108085
+#line 389 "parse.y"
107874108086
{
107875108087
sqlite3DropTable(pParse, yymsp[0].minor.yy259, 1, yymsp[-1].minor.yy4);
107876108088
}
108089
+#line 2503 "parse.c"
107877108090
break;
107878108091
case 112: /* cmd ::= select */
108092
+#line 396 "parse.y"
107879108093
{
107880108094
SelectDest dest = {SRT_Output, 0, 0, 0, 0};
107881108095
sqlite3Select(pParse, yymsp[0].minor.yy387, &dest);
107882108096
sqlite3SelectDelete(pParse->db, yymsp[0].minor.yy387);
107883108097
}
108098
+#line 2512 "parse.c"
107884108099
break;
107885108100
case 113: /* select ::= oneselect */
108101
+#line 407 "parse.y"
107886108102
{yygotominor.yy387 = yymsp[0].minor.yy387;}
108103
+#line 2517 "parse.c"
107887108104
break;
107888108105
case 114: /* select ::= select multiselect_op oneselect */
108106
+#line 409 "parse.y"
107889108107
{
107890108108
if( yymsp[0].minor.yy387 ){
107891108109
yymsp[0].minor.yy387->op = (u8)yymsp[-1].minor.yy4;
107892108110
yymsp[0].minor.yy387->pPrior = yymsp[-2].minor.yy387;
107893108111
}else{
107894108112
sqlite3SelectDelete(pParse->db, yymsp[-2].minor.yy387);
107895108113
}
107896108114
yygotominor.yy387 = yymsp[0].minor.yy387;
107897108115
}
108116
+#line 2530 "parse.c"
107898108117
break;
107899108118
case 116: /* multiselect_op ::= UNION ALL */
108119
+#line 420 "parse.y"
107900108120
{yygotominor.yy4 = TK_ALL;}
108121
+#line 2535 "parse.c"
107901108122
break;
107902108123
case 118: /* oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt orderby_opt limit_opt */
108124
+#line 424 "parse.y"
107903108125
{
107904108126
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);
107905108127
}
108128
+#line 2542 "parse.c"
107906108129
break;
107907108130
case 122: /* sclp ::= selcollist COMMA */
107908108131
case 247: /* idxlist_opt ::= LP idxlist RP */ yytestcase(yyruleno==247);
108132
+#line 445 "parse.y"
107909108133
{yygotominor.yy322 = yymsp[-1].minor.yy322;}
108134
+#line 2548 "parse.c"
107910108135
break;
107911108136
case 123: /* sclp ::= */
107912108137
case 151: /* orderby_opt ::= */ yytestcase(yyruleno==151);
107913108138
case 159: /* groupby_opt ::= */ yytestcase(yyruleno==159);
107914108139
case 240: /* exprlist ::= */ yytestcase(yyruleno==240);
107915108140
case 246: /* idxlist_opt ::= */ yytestcase(yyruleno==246);
108141
+#line 446 "parse.y"
107916108142
{yygotominor.yy322 = 0;}
108143
+#line 2557 "parse.c"
107917108144
break;
107918108145
case 124: /* selcollist ::= sclp expr as */
108146
+#line 447 "parse.y"
107919108147
{
107920108148
yygotominor.yy322 = sqlite3ExprListAppend(pParse, yymsp[-2].minor.yy322, yymsp[-1].minor.yy118.pExpr);
107921108149
if( yymsp[0].minor.yy0.n>0 ) sqlite3ExprListSetName(pParse, yygotominor.yy322, &yymsp[0].minor.yy0, 1);
107922108150
sqlite3ExprListSetSpan(pParse,yygotominor.yy322,&yymsp[-1].minor.yy118);
107923108151
}
108152
+#line 2566 "parse.c"
107924108153
break;
107925108154
case 125: /* selcollist ::= sclp STAR */
108155
+#line 452 "parse.y"
107926108156
{
107927108157
Expr *p = sqlite3Expr(pParse->db, TK_ALL, 0);
107928108158
yygotominor.yy322 = sqlite3ExprListAppend(pParse, yymsp[-1].minor.yy322, p);
107929108159
}
108160
+#line 2574 "parse.c"
107930108161
break;
107931108162
case 126: /* selcollist ::= sclp nm DOT STAR */
108163
+#line 456 "parse.y"
107932108164
{
107933108165
Expr *pRight = sqlite3PExpr(pParse, TK_ALL, 0, 0, &yymsp[0].minor.yy0);
107934108166
Expr *pLeft = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-2].minor.yy0);
107935108167
Expr *pDot = sqlite3PExpr(pParse, TK_DOT, pLeft, pRight, 0);
107936108168
yygotominor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-3].minor.yy322, pDot);
107937108169
}
108170
+#line 2584 "parse.c"
107938108171
break;
107939108172
case 129: /* as ::= */
108173
+#line 469 "parse.y"
107940108174
{yygotominor.yy0.n = 0;}
108175
+#line 2589 "parse.c"
107941108176
break;
107942108177
case 130: /* from ::= */
108178
+#line 481 "parse.y"
107943108179
{yygotominor.yy259 = sqlite3DbMallocZero(pParse->db, sizeof(*yygotominor.yy259));}
108180
+#line 2594 "parse.c"
107944108181
break;
107945108182
case 131: /* from ::= FROM seltablist */
108183
+#line 482 "parse.y"
107946108184
{
107947108185
yygotominor.yy259 = yymsp[0].minor.yy259;
107948108186
sqlite3SrcListShiftJoinType(yygotominor.yy259);
107949108187
}
108188
+#line 2602 "parse.c"
107950108189
break;
107951108190
case 132: /* stl_prefix ::= seltablist joinop */
108191
+#line 490 "parse.y"
107952108192
{
107953108193
yygotominor.yy259 = yymsp[-1].minor.yy259;
107954108194
if( ALWAYS(yygotominor.yy259 && yygotominor.yy259->nSrc>0) ) yygotominor.yy259->a[yygotominor.yy259->nSrc-1].jointype = (u8)yymsp[0].minor.yy4;
107955108195
}
108196
+#line 2610 "parse.c"
107956108197
break;
107957108198
case 133: /* stl_prefix ::= */
108199
+#line 494 "parse.y"
107958108200
{yygotominor.yy259 = 0;}
108201
+#line 2615 "parse.c"
107959108202
break;
107960108203
case 134: /* seltablist ::= stl_prefix nm dbnm as indexed_opt on_opt using_opt */
108204
+#line 495 "parse.y"
107961108205
{
107962108206
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);
107963108207
sqlite3SrcListIndexedBy(pParse, yygotominor.yy259, &yymsp[-2].minor.yy0);
107964108208
}
108209
+#line 2623 "parse.c"
107965108210
break;
107966108211
case 135: /* seltablist ::= stl_prefix LP select RP as on_opt using_opt */
108212
+#line 501 "parse.y"
107967108213
{
107968108214
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);
107969108215
}
108216
+#line 2630 "parse.c"
107970108217
break;
107971108218
case 136: /* seltablist ::= stl_prefix LP seltablist RP as on_opt using_opt */
108219
+#line 505 "parse.y"
107972108220
{
107973108221
if( yymsp[-6].minor.yy259==0 && yymsp[-2].minor.yy0.n==0 && yymsp[-1].minor.yy314==0 && yymsp[0].minor.yy384==0 ){
107974108222
yygotominor.yy259 = yymsp[-4].minor.yy259;
107975108223
}else{
107976108224
Select *pSubquery;
@@ -107977,180 +108225,260 @@
107977108225
sqlite3SrcListShiftJoinType(yymsp[-4].minor.yy259);
107978108226
pSubquery = sqlite3SelectNew(pParse,0,yymsp[-4].minor.yy259,0,0,0,0,0,0,0);
107979108227
yygotominor.yy259 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy259,0,0,&yymsp[-2].minor.yy0,pSubquery,yymsp[-1].minor.yy314,yymsp[0].minor.yy384);
107980108228
}
107981108229
}
108230
+#line 2644 "parse.c"
107982108231
break;
107983108232
case 137: /* dbnm ::= */
107984108233
case 146: /* indexed_opt ::= */ yytestcase(yyruleno==146);
108234
+#line 530 "parse.y"
107985108235
{yygotominor.yy0.z=0; yygotominor.yy0.n=0;}
108236
+#line 2650 "parse.c"
107986108237
break;
107987108238
case 139: /* fullname ::= nm dbnm */
108239
+#line 535 "parse.y"
107988108240
{yygotominor.yy259 = sqlite3SrcListAppend(pParse->db,0,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0);}
108241
+#line 2655 "parse.c"
107989108242
break;
107990108243
case 140: /* joinop ::= COMMA|JOIN */
108244
+#line 539 "parse.y"
107991108245
{ yygotominor.yy4 = JT_INNER; }
108246
+#line 2660 "parse.c"
107992108247
break;
107993108248
case 141: /* joinop ::= JOIN_KW JOIN */
108249
+#line 540 "parse.y"
107994108250
{ yygotominor.yy4 = sqlite3JoinType(pParse,&yymsp[-1].minor.yy0,0,0); }
108251
+#line 2665 "parse.c"
107995108252
break;
107996108253
case 142: /* joinop ::= JOIN_KW nm JOIN */
108254
+#line 541 "parse.y"
107997108255
{ yygotominor.yy4 = sqlite3JoinType(pParse,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0,0); }
108256
+#line 2670 "parse.c"
107998108257
break;
107999108258
case 143: /* joinop ::= JOIN_KW nm nm JOIN */
108259
+#line 543 "parse.y"
108000108260
{ yygotominor.yy4 = sqlite3JoinType(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0); }
108261
+#line 2675 "parse.c"
108001108262
break;
108002108263
case 144: /* on_opt ::= ON expr */
108003108264
case 155: /* sortitem ::= expr */ yytestcase(yyruleno==155);
108004108265
case 162: /* having_opt ::= HAVING expr */ yytestcase(yyruleno==162);
108005108266
case 169: /* where_opt ::= WHERE expr */ yytestcase(yyruleno==169);
108006108267
case 235: /* case_else ::= ELSE expr */ yytestcase(yyruleno==235);
108007108268
case 237: /* case_operand ::= expr */ yytestcase(yyruleno==237);
108269
+#line 547 "parse.y"
108008108270
{yygotominor.yy314 = yymsp[0].minor.yy118.pExpr;}
108271
+#line 2685 "parse.c"
108009108272
break;
108010108273
case 145: /* on_opt ::= */
108011108274
case 161: /* having_opt ::= */ yytestcase(yyruleno==161);
108012108275
case 168: /* where_opt ::= */ yytestcase(yyruleno==168);
108013108276
case 236: /* case_else ::= */ yytestcase(yyruleno==236);
108014108277
case 238: /* case_operand ::= */ yytestcase(yyruleno==238);
108278
+#line 548 "parse.y"
108015108279
{yygotominor.yy314 = 0;}
108280
+#line 2694 "parse.c"
108016108281
break;
108017108282
case 148: /* indexed_opt ::= NOT INDEXED */
108283
+#line 563 "parse.y"
108018108284
{yygotominor.yy0.z=0; yygotominor.yy0.n=1;}
108285
+#line 2699 "parse.c"
108019108286
break;
108020108287
case 149: /* using_opt ::= USING LP inscollist RP */
108021108288
case 181: /* inscollist_opt ::= LP inscollist RP */ yytestcase(yyruleno==181);
108289
+#line 567 "parse.y"
108022108290
{yygotominor.yy384 = yymsp[-1].minor.yy384;}
108291
+#line 2705 "parse.c"
108023108292
break;
108024108293
case 150: /* using_opt ::= */
108025108294
case 180: /* inscollist_opt ::= */ yytestcase(yyruleno==180);
108295
+#line 568 "parse.y"
108026108296
{yygotominor.yy384 = 0;}
108297
+#line 2711 "parse.c"
108027108298
break;
108028108299
case 152: /* orderby_opt ::= ORDER BY sortlist */
108029108300
case 160: /* groupby_opt ::= GROUP BY nexprlist */ yytestcase(yyruleno==160);
108030108301
case 239: /* exprlist ::= nexprlist */ yytestcase(yyruleno==239);
108302
+#line 579 "parse.y"
108031108303
{yygotominor.yy322 = yymsp[0].minor.yy322;}
108304
+#line 2718 "parse.c"
108032108305
break;
108033108306
case 153: /* sortlist ::= sortlist COMMA sortitem sortorder */
108307
+#line 580 "parse.y"
108034108308
{
108035108309
yygotominor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-3].minor.yy322,yymsp[-1].minor.yy314);
108036108310
if( yygotominor.yy322 ) yygotominor.yy322->a[yygotominor.yy322->nExpr-1].sortOrder = (u8)yymsp[0].minor.yy4;
108037108311
}
108312
+#line 2726 "parse.c"
108038108313
break;
108039108314
case 154: /* sortlist ::= sortitem sortorder */
108315
+#line 584 "parse.y"
108040108316
{
108041108317
yygotominor.yy322 = sqlite3ExprListAppend(pParse,0,yymsp[-1].minor.yy314);
108042108318
if( yygotominor.yy322 && ALWAYS(yygotominor.yy322->a) ) yygotominor.yy322->a[0].sortOrder = (u8)yymsp[0].minor.yy4;
108043108319
}
108320
+#line 2734 "parse.c"
108044108321
break;
108045108322
case 156: /* sortorder ::= ASC */
108046108323
case 158: /* sortorder ::= */ yytestcase(yyruleno==158);
108324
+#line 592 "parse.y"
108047108325
{yygotominor.yy4 = SQLITE_SO_ASC;}
108326
+#line 2740 "parse.c"
108048108327
break;
108049108328
case 157: /* sortorder ::= DESC */
108329
+#line 593 "parse.y"
108050108330
{yygotominor.yy4 = SQLITE_SO_DESC;}
108331
+#line 2745 "parse.c"
108051108332
break;
108052108333
case 163: /* limit_opt ::= */
108334
+#line 619 "parse.y"
108053108335
{yygotominor.yy292.pLimit = 0; yygotominor.yy292.pOffset = 0;}
108336
+#line 2750 "parse.c"
108054108337
break;
108055108338
case 164: /* limit_opt ::= LIMIT expr */
108339
+#line 620 "parse.y"
108056108340
{yygotominor.yy292.pLimit = yymsp[0].minor.yy118.pExpr; yygotominor.yy292.pOffset = 0;}
108341
+#line 2755 "parse.c"
108057108342
break;
108058108343
case 165: /* limit_opt ::= LIMIT expr OFFSET expr */
108344
+#line 622 "parse.y"
108059108345
{yygotominor.yy292.pLimit = yymsp[-2].minor.yy118.pExpr; yygotominor.yy292.pOffset = yymsp[0].minor.yy118.pExpr;}
108346
+#line 2760 "parse.c"
108060108347
break;
108061108348
case 166: /* limit_opt ::= LIMIT expr COMMA expr */
108349
+#line 624 "parse.y"
108062108350
{yygotominor.yy292.pOffset = yymsp[-2].minor.yy118.pExpr; yygotominor.yy292.pLimit = yymsp[0].minor.yy118.pExpr;}
108351
+#line 2765 "parse.c"
108063108352
break;
108064108353
case 167: /* cmd ::= DELETE FROM fullname indexed_opt where_opt */
108354
+#line 637 "parse.y"
108065108355
{
108066108356
sqlite3SrcListIndexedBy(pParse, yymsp[-2].minor.yy259, &yymsp[-1].minor.yy0);
108067108357
sqlite3DeleteFrom(pParse,yymsp[-2].minor.yy259,yymsp[0].minor.yy314);
108068108358
}
108359
+#line 2773 "parse.c"
108069108360
break;
108070108361
case 170: /* cmd ::= UPDATE orconf fullname indexed_opt SET setlist where_opt */
108362
+#line 660 "parse.y"
108071108363
{
108072108364
sqlite3SrcListIndexedBy(pParse, yymsp[-4].minor.yy259, &yymsp[-3].minor.yy0);
108073108365
sqlite3ExprListCheckLength(pParse,yymsp[-1].minor.yy322,"set list");
108074108366
sqlite3Update(pParse,yymsp[-4].minor.yy259,yymsp[-1].minor.yy322,yymsp[0].minor.yy314,yymsp[-5].minor.yy210);
108075108367
}
108368
+#line 2782 "parse.c"
108076108369
break;
108077108370
case 171: /* setlist ::= setlist COMMA nm EQ expr */
108371
+#line 670 "parse.y"
108078108372
{
108079108373
yygotominor.yy322 = sqlite3ExprListAppend(pParse, yymsp[-4].minor.yy322, yymsp[0].minor.yy118.pExpr);
108080108374
sqlite3ExprListSetName(pParse, yygotominor.yy322, &yymsp[-2].minor.yy0, 1);
108081108375
}
108376
+#line 2790 "parse.c"
108082108377
break;
108083108378
case 172: /* setlist ::= nm EQ expr */
108379
+#line 674 "parse.y"
108084108380
{
108085108381
yygotominor.yy322 = sqlite3ExprListAppend(pParse, 0, yymsp[0].minor.yy118.pExpr);
108086108382
sqlite3ExprListSetName(pParse, yygotominor.yy322, &yymsp[-2].minor.yy0, 1);
108087108383
}
108384
+#line 2798 "parse.c"
108088108385
break;
108089108386
case 173: /* cmd ::= insert_cmd INTO fullname inscollist_opt VALUES LP itemlist RP */
108387
+#line 683 "parse.y"
108090108388
{sqlite3Insert(pParse, yymsp[-5].minor.yy259, yymsp[-1].minor.yy322, 0, yymsp[-4].minor.yy384, yymsp[-7].minor.yy210);}
108389
+#line 2803 "parse.c"
108091108390
break;
108092108391
case 174: /* cmd ::= insert_cmd INTO fullname inscollist_opt select */
108392
+#line 685 "parse.y"
108093108393
{sqlite3Insert(pParse, yymsp[-2].minor.yy259, 0, yymsp[0].minor.yy387, yymsp[-1].minor.yy384, yymsp[-4].minor.yy210);}
108394
+#line 2808 "parse.c"
108094108395
break;
108095108396
case 175: /* cmd ::= insert_cmd INTO fullname inscollist_opt DEFAULT VALUES */
108397
+#line 687 "parse.y"
108096108398
{sqlite3Insert(pParse, yymsp[-3].minor.yy259, 0, 0, yymsp[-2].minor.yy384, yymsp[-5].minor.yy210);}
108399
+#line 2813 "parse.c"
108097108400
break;
108098108401
case 176: /* insert_cmd ::= INSERT orconf */
108402
+#line 690 "parse.y"
108099108403
{yygotominor.yy210 = yymsp[0].minor.yy210;}
108404
+#line 2818 "parse.c"
108100108405
break;
108101108406
case 177: /* insert_cmd ::= REPLACE */
108407
+#line 691 "parse.y"
108102108408
{yygotominor.yy210 = OE_Replace;}
108409
+#line 2823 "parse.c"
108103108410
break;
108104108411
case 178: /* itemlist ::= itemlist COMMA expr */
108105108412
case 241: /* nexprlist ::= nexprlist COMMA expr */ yytestcase(yyruleno==241);
108413
+#line 698 "parse.y"
108106108414
{yygotominor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-2].minor.yy322,yymsp[0].minor.yy118.pExpr);}
108415
+#line 2829 "parse.c"
108107108416
break;
108108108417
case 179: /* itemlist ::= expr */
108109108418
case 242: /* nexprlist ::= expr */ yytestcase(yyruleno==242);
108419
+#line 700 "parse.y"
108110108420
{yygotominor.yy322 = sqlite3ExprListAppend(pParse,0,yymsp[0].minor.yy118.pExpr);}
108421
+#line 2835 "parse.c"
108111108422
break;
108112108423
case 182: /* inscollist ::= inscollist COMMA nm */
108424
+#line 710 "parse.y"
108113108425
{yygotominor.yy384 = sqlite3IdListAppend(pParse->db,yymsp[-2].minor.yy384,&yymsp[0].minor.yy0);}
108426
+#line 2840 "parse.c"
108114108427
break;
108115108428
case 183: /* inscollist ::= nm */
108429
+#line 712 "parse.y"
108116108430
{yygotominor.yy384 = sqlite3IdListAppend(pParse->db,0,&yymsp[0].minor.yy0);}
108431
+#line 2845 "parse.c"
108117108432
break;
108118108433
case 184: /* expr ::= term */
108434
+#line 743 "parse.y"
108119108435
{yygotominor.yy118 = yymsp[0].minor.yy118;}
108436
+#line 2850 "parse.c"
108120108437
break;
108121108438
case 185: /* expr ::= LP expr RP */
108439
+#line 744 "parse.y"
108122108440
{yygotominor.yy118.pExpr = yymsp[-1].minor.yy118.pExpr; spanSet(&yygotominor.yy118,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0);}
108441
+#line 2855 "parse.c"
108123108442
break;
108124108443
case 186: /* term ::= NULL */
108125108444
case 191: /* term ::= INTEGER|FLOAT|BLOB */ yytestcase(yyruleno==191);
108126108445
case 192: /* term ::= STRING */ yytestcase(yyruleno==192);
108446
+#line 745 "parse.y"
108127108447
{spanExpr(&yygotominor.yy118, pParse, yymsp[0].major, &yymsp[0].minor.yy0);}
108448
+#line 2862 "parse.c"
108128108449
break;
108129108450
case 187: /* expr ::= id */
108130108451
case 188: /* expr ::= JOIN_KW */ yytestcase(yyruleno==188);
108452
+#line 746 "parse.y"
108131108453
{spanExpr(&yygotominor.yy118, pParse, TK_ID, &yymsp[0].minor.yy0);}
108454
+#line 2868 "parse.c"
108132108455
break;
108133108456
case 189: /* expr ::= nm DOT nm */
108457
+#line 748 "parse.y"
108134108458
{
108135108459
Expr *temp1 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-2].minor.yy0);
108136108460
Expr *temp2 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[0].minor.yy0);
108137108461
yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_DOT, temp1, temp2, 0);
108138108462
spanSet(&yygotominor.yy118,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0);
108139108463
}
108464
+#line 2878 "parse.c"
108140108465
break;
108141108466
case 190: /* expr ::= nm DOT nm DOT nm */
108467
+#line 754 "parse.y"
108142108468
{
108143108469
Expr *temp1 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-4].minor.yy0);
108144108470
Expr *temp2 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-2].minor.yy0);
108145108471
Expr *temp3 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[0].minor.yy0);
108146108472
Expr *temp4 = sqlite3PExpr(pParse, TK_DOT, temp2, temp3, 0);
108147108473
yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_DOT, temp1, temp4, 0);
108148108474
spanSet(&yygotominor.yy118,&yymsp[-4].minor.yy0,&yymsp[0].minor.yy0);
108149108475
}
108476
+#line 2890 "parse.c"
108150108477
break;
108151108478
case 193: /* expr ::= REGISTER */
108479
+#line 764 "parse.y"
108152108480
{
108153108481
/* When doing a nested parse, one can include terms in an expression
108154108482
** that look like this: #1 #2 ... These terms refer to registers
108155108483
** in the virtual machine. #N is the N-th register. */
108156108484
if( pParse->nested==0 ){
@@ -108160,32 +108488,40 @@
108160108488
yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_REGISTER, 0, 0, &yymsp[0].minor.yy0);
108161108489
if( yygotominor.yy118.pExpr ) sqlite3GetInt32(&yymsp[0].minor.yy0.z[1], &yygotominor.yy118.pExpr->iTable);
108162108490
}
108163108491
spanSet(&yygotominor.yy118, &yymsp[0].minor.yy0, &yymsp[0].minor.yy0);
108164108492
}
108493
+#line 2907 "parse.c"
108165108494
break;
108166108495
case 194: /* expr ::= VARIABLE */
108496
+#line 777 "parse.y"
108167108497
{
108168108498
spanExpr(&yygotominor.yy118, pParse, TK_VARIABLE, &yymsp[0].minor.yy0);
108169108499
sqlite3ExprAssignVarNumber(pParse, yygotominor.yy118.pExpr);
108170108500
spanSet(&yygotominor.yy118, &yymsp[0].minor.yy0, &yymsp[0].minor.yy0);
108171108501
}
108502
+#line 2916 "parse.c"
108172108503
break;
108173108504
case 195: /* expr ::= expr COLLATE ids */
108505
+#line 782 "parse.y"
108174108506
{
108175108507
yygotominor.yy118.pExpr = sqlite3ExprSetCollByToken(pParse, yymsp[-2].minor.yy118.pExpr, &yymsp[0].minor.yy0);
108176108508
yygotominor.yy118.zStart = yymsp[-2].minor.yy118.zStart;
108177108509
yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
108178108510
}
108511
+#line 2925 "parse.c"
108179108512
break;
108180108513
case 196: /* expr ::= CAST LP expr AS typetoken RP */
108514
+#line 788 "parse.y"
108181108515
{
108182108516
yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_CAST, yymsp[-3].minor.yy118.pExpr, 0, &yymsp[-1].minor.yy0);
108183108517
spanSet(&yygotominor.yy118,&yymsp[-5].minor.yy0,&yymsp[0].minor.yy0);
108184108518
}
108519
+#line 2933 "parse.c"
108185108520
break;
108186108521
case 197: /* expr ::= ID LP distinct exprlist RP */
108522
+#line 793 "parse.y"
108187108523
{
108188108524
if( yymsp[-1].minor.yy322 && yymsp[-1].minor.yy322->nExpr>pParse->db->aLimit[SQLITE_LIMIT_FUNCTION_ARG] ){
108189108525
sqlite3ErrorMsg(pParse, "too many arguments on function %T", &yymsp[-4].minor.yy0);
108190108526
}
108191108527
yygotominor.yy118.pExpr = sqlite3ExprFunction(pParse, yymsp[-1].minor.yy322, &yymsp[-4].minor.yy0);
@@ -108192,47 +108528,59 @@
108192108528
spanSet(&yygotominor.yy118,&yymsp[-4].minor.yy0,&yymsp[0].minor.yy0);
108193108529
if( yymsp[-2].minor.yy4 && yygotominor.yy118.pExpr ){
108194108530
yygotominor.yy118.pExpr->flags |= EP_Distinct;
108195108531
}
108196108532
}
108533
+#line 2947 "parse.c"
108197108534
break;
108198108535
case 198: /* expr ::= ID LP STAR RP */
108536
+#line 803 "parse.y"
108199108537
{
108200108538
yygotominor.yy118.pExpr = sqlite3ExprFunction(pParse, 0, &yymsp[-3].minor.yy0);
108201108539
spanSet(&yygotominor.yy118,&yymsp[-3].minor.yy0,&yymsp[0].minor.yy0);
108202108540
}
108541
+#line 2955 "parse.c"
108203108542
break;
108204108543
case 199: /* term ::= CTIME_KW */
108544
+#line 807 "parse.y"
108205108545
{
108206108546
/* The CURRENT_TIME, CURRENT_DATE, and CURRENT_TIMESTAMP values are
108207108547
** treated as functions that return constants */
108208108548
yygotominor.yy118.pExpr = sqlite3ExprFunction(pParse, 0,&yymsp[0].minor.yy0);
108209108549
if( yygotominor.yy118.pExpr ){
108210108550
yygotominor.yy118.pExpr->op = TK_CONST_FUNC;
108211108551
}
108212108552
spanSet(&yygotominor.yy118, &yymsp[0].minor.yy0, &yymsp[0].minor.yy0);
108213108553
}
108554
+#line 2968 "parse.c"
108214108555
break;
108215108556
case 200: /* expr ::= expr AND expr */
108216108557
case 201: /* expr ::= expr OR expr */ yytestcase(yyruleno==201);
108217108558
case 202: /* expr ::= expr LT|GT|GE|LE expr */ yytestcase(yyruleno==202);
108218108559
case 203: /* expr ::= expr EQ|NE expr */ yytestcase(yyruleno==203);
108219108560
case 204: /* expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr */ yytestcase(yyruleno==204);
108220108561
case 205: /* expr ::= expr PLUS|MINUS expr */ yytestcase(yyruleno==205);
108221108562
case 206: /* expr ::= expr STAR|SLASH|REM expr */ yytestcase(yyruleno==206);
108222108563
case 207: /* expr ::= expr CONCAT expr */ yytestcase(yyruleno==207);
108564
+#line 834 "parse.y"
108223108565
{spanBinaryExpr(&yygotominor.yy118,pParse,yymsp[-1].major,&yymsp[-2].minor.yy118,&yymsp[0].minor.yy118);}
108566
+#line 2980 "parse.c"
108224108567
break;
108225108568
case 208: /* likeop ::= LIKE_KW */
108226108569
case 210: /* likeop ::= MATCH */ yytestcase(yyruleno==210);
108570
+#line 847 "parse.y"
108227108571
{yygotominor.yy342.eOperator = yymsp[0].minor.yy0; yygotominor.yy342.not = 0;}
108572
+#line 2986 "parse.c"
108228108573
break;
108229108574
case 209: /* likeop ::= NOT LIKE_KW */
108230108575
case 211: /* likeop ::= NOT MATCH */ yytestcase(yyruleno==211);
108576
+#line 848 "parse.y"
108231108577
{yygotominor.yy342.eOperator = yymsp[0].minor.yy0; yygotominor.yy342.not = 1;}
108578
+#line 2992 "parse.c"
108232108579
break;
108233108580
case 212: /* expr ::= expr likeop expr */
108581
+#line 851 "parse.y"
108234108582
{
108235108583
ExprList *pList;
108236108584
pList = sqlite3ExprListAppend(pParse,0, yymsp[0].minor.yy118.pExpr);
108237108585
pList = sqlite3ExprListAppend(pParse,pList, yymsp[-2].minor.yy118.pExpr);
108238108586
yygotominor.yy118.pExpr = sqlite3ExprFunction(pParse, pList, &yymsp[-1].minor.yy342.eOperator);
@@ -108239,12 +108587,14 @@
108239108587
if( yymsp[-1].minor.yy342.not ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0);
108240108588
yygotominor.yy118.zStart = yymsp[-2].minor.yy118.zStart;
108241108589
yygotominor.yy118.zEnd = yymsp[0].minor.yy118.zEnd;
108242108590
if( yygotominor.yy118.pExpr ) yygotominor.yy118.pExpr->flags |= EP_InfixFunc;
108243108591
}
108592
+#line 3006 "parse.c"
108244108593
break;
108245108594
case 213: /* expr ::= expr likeop expr ESCAPE expr */
108595
+#line 861 "parse.y"
108246108596
{
108247108597
ExprList *pList;
108248108598
pList = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy118.pExpr);
108249108599
pList = sqlite3ExprListAppend(pParse,pList, yymsp[-4].minor.yy118.pExpr);
108250108600
pList = sqlite3ExprListAppend(pParse,pList, yymsp[0].minor.yy118.pExpr);
@@ -108252,40 +108602,56 @@
108252108602
if( yymsp[-3].minor.yy342.not ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0);
108253108603
yygotominor.yy118.zStart = yymsp[-4].minor.yy118.zStart;
108254108604
yygotominor.yy118.zEnd = yymsp[0].minor.yy118.zEnd;
108255108605
if( yygotominor.yy118.pExpr ) yygotominor.yy118.pExpr->flags |= EP_InfixFunc;
108256108606
}
108607
+#line 3021 "parse.c"
108257108608
break;
108258108609
case 214: /* expr ::= expr ISNULL|NOTNULL */
108610
+#line 889 "parse.y"
108259108611
{spanUnaryPostfix(&yygotominor.yy118,pParse,yymsp[0].major,&yymsp[-1].minor.yy118,&yymsp[0].minor.yy0);}
108612
+#line 3026 "parse.c"
108260108613
break;
108261108614
case 215: /* expr ::= expr NOT NULL */
108615
+#line 890 "parse.y"
108262108616
{spanUnaryPostfix(&yygotominor.yy118,pParse,TK_NOTNULL,&yymsp[-2].minor.yy118,&yymsp[0].minor.yy0);}
108617
+#line 3031 "parse.c"
108263108618
break;
108264108619
case 216: /* expr ::= expr IS expr */
108620
+#line 911 "parse.y"
108265108621
{
108266108622
spanBinaryExpr(&yygotominor.yy118,pParse,TK_IS,&yymsp[-2].minor.yy118,&yymsp[0].minor.yy118);
108267108623
binaryToUnaryIfNull(pParse, yymsp[0].minor.yy118.pExpr, yygotominor.yy118.pExpr, TK_ISNULL);
108268108624
}
108625
+#line 3039 "parse.c"
108269108626
break;
108270108627
case 217: /* expr ::= expr IS NOT expr */
108628
+#line 915 "parse.y"
108271108629
{
108272108630
spanBinaryExpr(&yygotominor.yy118,pParse,TK_ISNOT,&yymsp[-3].minor.yy118,&yymsp[0].minor.yy118);
108273108631
binaryToUnaryIfNull(pParse, yymsp[0].minor.yy118.pExpr, yygotominor.yy118.pExpr, TK_NOTNULL);
108274108632
}
108633
+#line 3047 "parse.c"
108275108634
break;
108276108635
case 218: /* expr ::= NOT expr */
108277108636
case 219: /* expr ::= BITNOT expr */ yytestcase(yyruleno==219);
108637
+#line 938 "parse.y"
108278108638
{spanUnaryPrefix(&yygotominor.yy118,pParse,yymsp[-1].major,&yymsp[0].minor.yy118,&yymsp[-1].minor.yy0);}
108639
+#line 3053 "parse.c"
108279108640
break;
108280108641
case 220: /* expr ::= MINUS expr */
108642
+#line 941 "parse.y"
108281108643
{spanUnaryPrefix(&yygotominor.yy118,pParse,TK_UMINUS,&yymsp[0].minor.yy118,&yymsp[-1].minor.yy0);}
108644
+#line 3058 "parse.c"
108282108645
break;
108283108646
case 221: /* expr ::= PLUS expr */
108647
+#line 943 "parse.y"
108284108648
{spanUnaryPrefix(&yygotominor.yy118,pParse,TK_UPLUS,&yymsp[0].minor.yy118,&yymsp[-1].minor.yy0);}
108649
+#line 3063 "parse.c"
108285108650
break;
108286108651
case 224: /* expr ::= expr between_op expr AND expr */
108652
+#line 948 "parse.y"
108287108653
{
108288108654
ExprList *pList = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy118.pExpr);
108289108655
pList = sqlite3ExprListAppend(pParse,pList, yymsp[0].minor.yy118.pExpr);
108290108656
yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_BETWEEN, yymsp[-4].minor.yy118.pExpr, 0, 0);
108291108657
if( yygotominor.yy118.pExpr ){
@@ -108295,12 +108661,14 @@
108295108661
}
108296108662
if( yymsp[-3].minor.yy4 ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0);
108297108663
yygotominor.yy118.zStart = yymsp[-4].minor.yy118.zStart;
108298108664
yygotominor.yy118.zEnd = yymsp[0].minor.yy118.zEnd;
108299108665
}
108666
+#line 3080 "parse.c"
108300108667
break;
108301108668
case 227: /* expr ::= expr in_op LP exprlist RP */
108669
+#line 965 "parse.y"
108302108670
{
108303108671
if( yymsp[-1].minor.yy322==0 ){
108304108672
/* Expressions of the form
108305108673
**
108306108674
** expr1 IN ()
@@ -108322,12 +108690,14 @@
108322108690
if( yymsp[-3].minor.yy4 ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0);
108323108691
}
108324108692
yygotominor.yy118.zStart = yymsp[-4].minor.yy118.zStart;
108325108693
yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
108326108694
}
108695
+#line 3109 "parse.c"
108327108696
break;
108328108697
case 228: /* expr ::= LP select RP */
108698
+#line 990 "parse.y"
108329108699
{
108330108700
yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_SELECT, 0, 0, 0);
108331108701
if( yygotominor.yy118.pExpr ){
108332108702
yygotominor.yy118.pExpr->x.pSelect = yymsp[-1].minor.yy387;
108333108703
ExprSetProperty(yygotominor.yy118.pExpr, EP_xIsSelect);
@@ -108336,12 +108706,14 @@
108336108706
sqlite3SelectDelete(pParse->db, yymsp[-1].minor.yy387);
108337108707
}
108338108708
yygotominor.yy118.zStart = yymsp[-2].minor.yy0.z;
108339108709
yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
108340108710
}
108711
+#line 3125 "parse.c"
108341108712
break;
108342108713
case 229: /* expr ::= expr in_op LP select RP */
108714
+#line 1002 "parse.y"
108343108715
{
108344108716
yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy118.pExpr, 0, 0);
108345108717
if( yygotominor.yy118.pExpr ){
108346108718
yygotominor.yy118.pExpr->x.pSelect = yymsp[-1].minor.yy387;
108347108719
ExprSetProperty(yygotominor.yy118.pExpr, EP_xIsSelect);
@@ -108351,12 +108723,14 @@
108351108723
}
108352108724
if( yymsp[-3].minor.yy4 ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0);
108353108725
yygotominor.yy118.zStart = yymsp[-4].minor.yy118.zStart;
108354108726
yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
108355108727
}
108728
+#line 3142 "parse.c"
108356108729
break;
108357108730
case 230: /* expr ::= expr in_op nm dbnm */
108731
+#line 1015 "parse.y"
108358108732
{
108359108733
SrcList *pSrc = sqlite3SrcListAppend(pParse->db, 0,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0);
108360108734
yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_IN, yymsp[-3].minor.yy118.pExpr, 0, 0);
108361108735
if( yygotominor.yy118.pExpr ){
108362108736
yygotominor.yy118.pExpr->x.pSelect = sqlite3SelectNew(pParse, 0,pSrc,0,0,0,0,0,0,0);
@@ -108367,12 +108741,14 @@
108367108741
}
108368108742
if( yymsp[-2].minor.yy4 ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0);
108369108743
yygotominor.yy118.zStart = yymsp[-3].minor.yy118.zStart;
108370108744
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];
108371108745
}
108746
+#line 3160 "parse.c"
108372108747
break;
108373108748
case 231: /* expr ::= EXISTS LP select RP */
108749
+#line 1029 "parse.y"
108374108750
{
108375108751
Expr *p = yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_EXISTS, 0, 0, 0);
108376108752
if( p ){
108377108753
p->x.pSelect = yymsp[-1].minor.yy387;
108378108754
ExprSetProperty(p, EP_xIsSelect);
@@ -108381,12 +108757,14 @@
108381108757
sqlite3SelectDelete(pParse->db, yymsp[-1].minor.yy387);
108382108758
}
108383108759
yygotominor.yy118.zStart = yymsp[-3].minor.yy0.z;
108384108760
yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
108385108761
}
108762
+#line 3176 "parse.c"
108386108763
break;
108387108764
case 232: /* expr ::= CASE case_operand case_exprlist case_else END */
108765
+#line 1044 "parse.y"
108388108766
{
108389108767
yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_CASE, yymsp[-3].minor.yy314, yymsp[-1].minor.yy314, 0);
108390108768
if( yygotominor.yy118.pExpr ){
108391108769
yygotominor.yy118.pExpr->x.pList = yymsp[-2].minor.yy322;
108392108770
sqlite3ExprSetHeight(pParse, yygotominor.yy118.pExpr);
@@ -108394,38 +108772,50 @@
108394108772
sqlite3ExprListDelete(pParse->db, yymsp[-2].minor.yy322);
108395108773
}
108396108774
yygotominor.yy118.zStart = yymsp[-4].minor.yy0.z;
108397108775
yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
108398108776
}
108777
+#line 3191 "parse.c"
108399108778
break;
108400108779
case 233: /* case_exprlist ::= case_exprlist WHEN expr THEN expr */
108780
+#line 1057 "parse.y"
108401108781
{
108402108782
yygotominor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy322, yymsp[-2].minor.yy118.pExpr);
108403108783
yygotominor.yy322 = sqlite3ExprListAppend(pParse,yygotominor.yy322, yymsp[0].minor.yy118.pExpr);
108404108784
}
108785
+#line 3199 "parse.c"
108405108786
break;
108406108787
case 234: /* case_exprlist ::= WHEN expr THEN expr */
108788
+#line 1061 "parse.y"
108407108789
{
108408108790
yygotominor.yy322 = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy118.pExpr);
108409108791
yygotominor.yy322 = sqlite3ExprListAppend(pParse,yygotominor.yy322, yymsp[0].minor.yy118.pExpr);
108410108792
}
108793
+#line 3207 "parse.c"
108411108794
break;
108412108795
case 243: /* cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP idxlist RP */
108796
+#line 1090 "parse.y"
108413108797
{
108414108798
sqlite3CreateIndex(pParse, &yymsp[-6].minor.yy0, &yymsp[-5].minor.yy0,
108415108799
sqlite3SrcListAppend(pParse->db,0,&yymsp[-3].minor.yy0,0), yymsp[-1].minor.yy322, yymsp[-9].minor.yy4,
108416108800
&yymsp[-10].minor.yy0, &yymsp[0].minor.yy0, SQLITE_SO_ASC, yymsp[-7].minor.yy4);
108417108801
}
108802
+#line 3216 "parse.c"
108418108803
break;
108419108804
case 244: /* uniqueflag ::= UNIQUE */
108420108805
case 298: /* raisetype ::= ABORT */ yytestcase(yyruleno==298);
108806
+#line 1097 "parse.y"
108421108807
{yygotominor.yy4 = OE_Abort;}
108808
+#line 3222 "parse.c"
108422108809
break;
108423108810
case 245: /* uniqueflag ::= */
108811
+#line 1098 "parse.y"
108424108812
{yygotominor.yy4 = OE_None;}
108813
+#line 3227 "parse.c"
108425108814
break;
108426108815
case 248: /* idxlist ::= idxlist COMMA nm collate sortorder */
108816
+#line 1107 "parse.y"
108427108817
{
108428108818
Expr *p = 0;
108429108819
if( yymsp[-1].minor.yy0.n>0 ){
108430108820
p = sqlite3Expr(pParse->db, TK_COLUMN, 0);
108431108821
sqlite3ExprSetCollByToken(pParse, p, &yymsp[-1].minor.yy0);
@@ -108433,12 +108823,14 @@
108433108823
yygotominor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy322, p);
108434108824
sqlite3ExprListSetName(pParse,yygotominor.yy322,&yymsp[-2].minor.yy0,1);
108435108825
sqlite3ExprListCheckLength(pParse, yygotominor.yy322, "index");
108436108826
if( yygotominor.yy322 ) yygotominor.yy322->a[yygotominor.yy322->nExpr-1].sortOrder = (u8)yymsp[0].minor.yy4;
108437108827
}
108828
+#line 3242 "parse.c"
108438108829
break;
108439108830
case 249: /* idxlist ::= nm collate sortorder */
108831
+#line 1118 "parse.y"
108440108832
{
108441108833
Expr *p = 0;
108442108834
if( yymsp[-1].minor.yy0.n>0 ){
108443108835
p = sqlite3PExpr(pParse, TK_COLUMN, 0, 0, 0);
108444108836
sqlite3ExprSetCollByToken(pParse, p, &yymsp[-1].minor.yy0);
@@ -108446,214 +108838,307 @@
108446108838
yygotominor.yy322 = sqlite3ExprListAppend(pParse,0, p);
108447108839
sqlite3ExprListSetName(pParse, yygotominor.yy322, &yymsp[-2].minor.yy0, 1);
108448108840
sqlite3ExprListCheckLength(pParse, yygotominor.yy322, "index");
108449108841
if( yygotominor.yy322 ) yygotominor.yy322->a[yygotominor.yy322->nExpr-1].sortOrder = (u8)yymsp[0].minor.yy4;
108450108842
}
108843
+#line 3257 "parse.c"
108451108844
break;
108452108845
case 250: /* collate ::= */
108846
+#line 1131 "parse.y"
108453108847
{yygotominor.yy0.z = 0; yygotominor.yy0.n = 0;}
108848
+#line 3262 "parse.c"
108454108849
break;
108455108850
case 252: /* cmd ::= DROP INDEX ifexists fullname */
108851
+#line 1137 "parse.y"
108456108852
{sqlite3DropIndex(pParse, yymsp[0].minor.yy259, yymsp[-1].minor.yy4);}
108853
+#line 3267 "parse.c"
108457108854
break;
108458108855
case 253: /* cmd ::= VACUUM */
108459108856
case 254: /* cmd ::= VACUUM nm */ yytestcase(yyruleno==254);
108857
+#line 1143 "parse.y"
108460108858
{sqlite3Vacuum(pParse);}
108859
+#line 3273 "parse.c"
108461108860
break;
108462108861
case 255: /* cmd ::= PRAGMA nm dbnm */
108862
+#line 1151 "parse.y"
108463108863
{sqlite3Pragma(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,0,0);}
108864
+#line 3278 "parse.c"
108464108865
break;
108465108866
case 256: /* cmd ::= PRAGMA nm dbnm EQ nmnum */
108867
+#line 1152 "parse.y"
108466108868
{sqlite3Pragma(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0,0);}
108869
+#line 3283 "parse.c"
108467108870
break;
108468108871
case 257: /* cmd ::= PRAGMA nm dbnm LP nmnum RP */
108872
+#line 1153 "parse.y"
108469108873
{sqlite3Pragma(pParse,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,&yymsp[-1].minor.yy0,0);}
108874
+#line 3288 "parse.c"
108470108875
break;
108471108876
case 258: /* cmd ::= PRAGMA nm dbnm EQ minus_num */
108877
+#line 1155 "parse.y"
108472108878
{sqlite3Pragma(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0,1);}
108879
+#line 3293 "parse.c"
108473108880
break;
108474108881
case 259: /* cmd ::= PRAGMA nm dbnm LP minus_num RP */
108882
+#line 1157 "parse.y"
108475108883
{sqlite3Pragma(pParse,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,&yymsp[-1].minor.yy0,1);}
108884
+#line 3298 "parse.c"
108476108885
break;
108477108886
case 270: /* cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END */
108887
+#line 1175 "parse.y"
108478108888
{
108479108889
Token all;
108480108890
all.z = yymsp[-3].minor.yy0.z;
108481108891
all.n = (int)(yymsp[0].minor.yy0.z - yymsp[-3].minor.yy0.z) + yymsp[0].minor.yy0.n;
108482108892
sqlite3FinishTrigger(pParse, yymsp[-1].minor.yy203, &all);
108483108893
}
108894
+#line 3308 "parse.c"
108484108895
break;
108485108896
case 271: /* trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause */
108897
+#line 1184 "parse.y"
108486108898
{
108487108899
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);
108488108900
yygotominor.yy0 = (yymsp[-6].minor.yy0.n==0?yymsp[-7].minor.yy0:yymsp[-6].minor.yy0);
108489108901
}
108902
+#line 3316 "parse.c"
108490108903
break;
108491108904
case 272: /* trigger_time ::= BEFORE */
108492108905
case 275: /* trigger_time ::= */ yytestcase(yyruleno==275);
108906
+#line 1190 "parse.y"
108493108907
{ yygotominor.yy4 = TK_BEFORE; }
108908
+#line 3322 "parse.c"
108494108909
break;
108495108910
case 273: /* trigger_time ::= AFTER */
108911
+#line 1191 "parse.y"
108496108912
{ yygotominor.yy4 = TK_AFTER; }
108913
+#line 3327 "parse.c"
108497108914
break;
108498108915
case 274: /* trigger_time ::= INSTEAD OF */
108916
+#line 1192 "parse.y"
108499108917
{ yygotominor.yy4 = TK_INSTEAD;}
108918
+#line 3332 "parse.c"
108500108919
break;
108501108920
case 276: /* trigger_event ::= DELETE|INSERT */
108502108921
case 277: /* trigger_event ::= UPDATE */ yytestcase(yyruleno==277);
108922
+#line 1197 "parse.y"
108503108923
{yygotominor.yy90.a = yymsp[0].major; yygotominor.yy90.b = 0;}
108924
+#line 3338 "parse.c"
108504108925
break;
108505108926
case 278: /* trigger_event ::= UPDATE OF inscollist */
108927
+#line 1199 "parse.y"
108506108928
{yygotominor.yy90.a = TK_UPDATE; yygotominor.yy90.b = yymsp[0].minor.yy384;}
108929
+#line 3343 "parse.c"
108507108930
break;
108508108931
case 281: /* when_clause ::= */
108509108932
case 303: /* key_opt ::= */ yytestcase(yyruleno==303);
108933
+#line 1206 "parse.y"
108510108934
{ yygotominor.yy314 = 0; }
108935
+#line 3349 "parse.c"
108511108936
break;
108512108937
case 282: /* when_clause ::= WHEN expr */
108513108938
case 304: /* key_opt ::= KEY expr */ yytestcase(yyruleno==304);
108939
+#line 1207 "parse.y"
108514108940
{ yygotominor.yy314 = yymsp[0].minor.yy118.pExpr; }
108941
+#line 3355 "parse.c"
108515108942
break;
108516108943
case 283: /* trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI */
108944
+#line 1211 "parse.y"
108517108945
{
108518108946
assert( yymsp[-2].minor.yy203!=0 );
108519108947
yymsp[-2].minor.yy203->pLast->pNext = yymsp[-1].minor.yy203;
108520108948
yymsp[-2].minor.yy203->pLast = yymsp[-1].minor.yy203;
108521108949
yygotominor.yy203 = yymsp[-2].minor.yy203;
108522108950
}
108951
+#line 3365 "parse.c"
108523108952
break;
108524108953
case 284: /* trigger_cmd_list ::= trigger_cmd SEMI */
108954
+#line 1217 "parse.y"
108525108955
{
108526108956
assert( yymsp[-1].minor.yy203!=0 );
108527108957
yymsp[-1].minor.yy203->pLast = yymsp[-1].minor.yy203;
108528108958
yygotominor.yy203 = yymsp[-1].minor.yy203;
108529108959
}
108960
+#line 3374 "parse.c"
108530108961
break;
108531108962
case 286: /* trnm ::= nm DOT nm */
108963
+#line 1229 "parse.y"
108532108964
{
108533108965
yygotominor.yy0 = yymsp[0].minor.yy0;
108534108966
sqlite3ErrorMsg(pParse,
108535108967
"qualified table names are not allowed on INSERT, UPDATE, and DELETE "
108536108968
"statements within triggers");
108537108969
}
108970
+#line 3384 "parse.c"
108538108971
break;
108539108972
case 288: /* tridxby ::= INDEXED BY nm */
108973
+#line 1241 "parse.y"
108540108974
{
108541108975
sqlite3ErrorMsg(pParse,
108542108976
"the INDEXED BY clause is not allowed on UPDATE or DELETE statements "
108543108977
"within triggers");
108544108978
}
108979
+#line 3393 "parse.c"
108545108980
break;
108546108981
case 289: /* tridxby ::= NOT INDEXED */
108982
+#line 1246 "parse.y"
108547108983
{
108548108984
sqlite3ErrorMsg(pParse,
108549108985
"the NOT INDEXED clause is not allowed on UPDATE or DELETE statements "
108550108986
"within triggers");
108551108987
}
108988
+#line 3402 "parse.c"
108552108989
break;
108553108990
case 290: /* trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist where_opt */
108991
+#line 1259 "parse.y"
108554108992
{ 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"
108555108994
break;
108556108995
case 291: /* trigger_cmd ::= insert_cmd INTO trnm inscollist_opt VALUES LP itemlist RP */
108996
+#line 1264 "parse.y"
108557108997
{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"
108558108999
break;
108559109000
case 292: /* trigger_cmd ::= insert_cmd INTO trnm inscollist_opt select */
109001
+#line 1267 "parse.y"
108560109002
{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"
108561109004
break;
108562109005
case 293: /* trigger_cmd ::= DELETE FROM trnm tridxby where_opt */
109006
+#line 1271 "parse.y"
108563109007
{yygotominor.yy203 = sqlite3TriggerDeleteStep(pParse->db, &yymsp[-2].minor.yy0, yymsp[0].minor.yy314);}
109008
+#line 3422 "parse.c"
108564109009
break;
108565109010
case 294: /* trigger_cmd ::= select */
109011
+#line 1274 "parse.y"
108566109012
{yygotominor.yy203 = sqlite3TriggerSelectStep(pParse->db, yymsp[0].minor.yy387); }
109013
+#line 3427 "parse.c"
108567109014
break;
108568109015
case 295: /* expr ::= RAISE LP IGNORE RP */
109016
+#line 1277 "parse.y"
108569109017
{
108570109018
yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_RAISE, 0, 0, 0);
108571109019
if( yygotominor.yy118.pExpr ){
108572109020
yygotominor.yy118.pExpr->affinity = OE_Ignore;
108573109021
}
108574109022
yygotominor.yy118.zStart = yymsp[-3].minor.yy0.z;
108575109023
yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
108576109024
}
109025
+#line 3439 "parse.c"
108577109026
break;
108578109027
case 296: /* expr ::= RAISE LP raisetype COMMA nm RP */
109028
+#line 1285 "parse.y"
108579109029
{
108580109030
yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_RAISE, 0, 0, &yymsp[-1].minor.yy0);
108581109031
if( yygotominor.yy118.pExpr ) {
108582109032
yygotominor.yy118.pExpr->affinity = (char)yymsp[-3].minor.yy4;
108583109033
}
108584109034
yygotominor.yy118.zStart = yymsp[-5].minor.yy0.z;
108585109035
yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
108586109036
}
109037
+#line 3451 "parse.c"
108587109038
break;
108588109039
case 297: /* raisetype ::= ROLLBACK */
109040
+#line 1296 "parse.y"
108589109041
{yygotominor.yy4 = OE_Rollback;}
109042
+#line 3456 "parse.c"
108590109043
break;
108591109044
case 299: /* raisetype ::= FAIL */
109045
+#line 1298 "parse.y"
108592109046
{yygotominor.yy4 = OE_Fail;}
109047
+#line 3461 "parse.c"
108593109048
break;
108594109049
case 300: /* cmd ::= DROP TRIGGER ifexists fullname */
109050
+#line 1303 "parse.y"
108595109051
{
108596109052
sqlite3DropTrigger(pParse,yymsp[0].minor.yy259,yymsp[-1].minor.yy4);
108597109053
}
109054
+#line 3468 "parse.c"
108598109055
break;
108599109056
case 301: /* cmd ::= ATTACH database_kw_opt expr AS expr key_opt */
109057
+#line 1310 "parse.y"
108600109058
{
108601109059
sqlite3Attach(pParse, yymsp[-3].minor.yy118.pExpr, yymsp[-1].minor.yy118.pExpr, yymsp[0].minor.yy314);
108602109060
}
109061
+#line 3475 "parse.c"
108603109062
break;
108604109063
case 302: /* cmd ::= DETACH database_kw_opt expr */
109064
+#line 1313 "parse.y"
108605109065
{
108606109066
sqlite3Detach(pParse, yymsp[0].minor.yy118.pExpr);
108607109067
}
109068
+#line 3482 "parse.c"
108608109069
break;
108609109070
case 307: /* cmd ::= REINDEX */
109071
+#line 1328 "parse.y"
108610109072
{sqlite3Reindex(pParse, 0, 0);}
109073
+#line 3487 "parse.c"
108611109074
break;
108612109075
case 308: /* cmd ::= REINDEX nm dbnm */
109076
+#line 1329 "parse.y"
108613109077
{sqlite3Reindex(pParse, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0);}
109078
+#line 3492 "parse.c"
108614109079
break;
108615109080
case 309: /* cmd ::= ANALYZE */
109081
+#line 1334 "parse.y"
108616109082
{sqlite3Analyze(pParse, 0, 0);}
109083
+#line 3497 "parse.c"
108617109084
break;
108618109085
case 310: /* cmd ::= ANALYZE nm dbnm */
109086
+#line 1335 "parse.y"
108619109087
{sqlite3Analyze(pParse, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0);}
109088
+#line 3502 "parse.c"
108620109089
break;
108621109090
case 311: /* cmd ::= ALTER TABLE fullname RENAME TO nm */
109091
+#line 1340 "parse.y"
108622109092
{
108623109093
sqlite3AlterRenameTable(pParse,yymsp[-3].minor.yy259,&yymsp[0].minor.yy0);
108624109094
}
109095
+#line 3509 "parse.c"
108625109096
break;
108626109097
case 312: /* cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt column */
109098
+#line 1343 "parse.y"
108627109099
{
108628109100
sqlite3AlterFinishAddColumn(pParse, &yymsp[0].minor.yy0);
108629109101
}
109102
+#line 3516 "parse.c"
108630109103
break;
108631109104
case 313: /* add_column_fullname ::= fullname */
109105
+#line 1346 "parse.y"
108632109106
{
108633109107
pParse->db->lookaside.bEnabled = 0;
108634109108
sqlite3AlterBeginAddColumn(pParse, yymsp[0].minor.yy259);
108635109109
}
109110
+#line 3524 "parse.c"
108636109111
break;
108637109112
case 316: /* cmd ::= create_vtab */
109113
+#line 1356 "parse.y"
108638109114
{sqlite3VtabFinishParse(pParse,0);}
109115
+#line 3529 "parse.c"
108639109116
break;
108640109117
case 317: /* cmd ::= create_vtab LP vtabarglist RP */
109118
+#line 1357 "parse.y"
108641109119
{sqlite3VtabFinishParse(pParse,&yymsp[0].minor.yy0);}
109120
+#line 3534 "parse.c"
108642109121
break;
108643109122
case 318: /* create_vtab ::= createkw VIRTUAL TABLE nm dbnm USING nm */
109123
+#line 1358 "parse.y"
108644109124
{
108645109125
sqlite3VtabBeginParse(pParse, &yymsp[-3].minor.yy0, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0);
108646109126
}
109127
+#line 3541 "parse.c"
108647109128
break;
108648109129
case 321: /* vtabarg ::= */
109130
+#line 1363 "parse.y"
108649109131
{sqlite3VtabArgInit(pParse);}
109132
+#line 3546 "parse.c"
108650109133
break;
108651109134
case 323: /* vtabargtoken ::= ANY */
108652109135
case 324: /* vtabargtoken ::= lp anylist RP */ yytestcase(yyruleno==324);
108653109136
case 325: /* lp ::= LP */ yytestcase(yyruleno==325);
109137
+#line 1365 "parse.y"
108654109138
{sqlite3VtabArgExtend(pParse,&yymsp[0].minor.yy0);}
109139
+#line 3553 "parse.c"
108655109140
break;
108656109141
default:
108657109142
/* (0) input ::= cmdlist */ yytestcase(yyruleno==0);
108658109143
/* (1) cmdlist ::= cmdlist ecmd */ yytestcase(yyruleno==1);
108659109144
/* (2) cmdlist ::= ecmd */ yytestcase(yyruleno==2);
@@ -108751,15 +109236,17 @@
108751109236
int yymajor, /* The major type of the error token */
108752109237
YYMINORTYPE yyminor /* The minor type of the error token */
108753109238
){
108754109239
sqlite3ParserARG_FETCH;
108755109240
#define TOKEN (yyminor.yy0)
109241
+#line 32 "parse.y"
108756109242
108757109243
UNUSED_PARAMETER(yymajor); /* Silence some compiler warnings */
108758109244
assert( TOKEN.z[0] ); /* The tokenizer always gives us a token */
108759109245
sqlite3ErrorMsg(pParse, "near \"%T\": syntax error", &TOKEN);
108760109246
pParse->parseError = 1;
109247
+#line 3661 "parse.c"
108761109248
sqlite3ParserARG_STORE; /* Suppress warning about unused %extra_argument variable */
108762109249
}
108763109250
108764109251
/*
108765109252
** The following is executed when the parser accepts
@@ -108949,10 +109436,11 @@
108949109436
return;
108950109437
}
108951109438
108952109439
/************** End of parse.c ***********************************************/
108953109440
/************** Begin file tokenize.c ****************************************/
109441
+#line 1 "tsrc/tokenize.c"
108954109442
/*
108955109443
** 2001 September 15
108956109444
**
108957109445
** The author disclaims copyright to this source code. In place of
108958109446
** a legal notice, here is a blessing:
@@ -109014,10 +109502,11 @@
109014109502
** named keywordhash.h and then included into this source file by
109015109503
** the #include below.
109016109504
*/
109017109505
/************** Include keywordhash.h in the middle of tokenize.c ************/
109018109506
/************** Begin file keywordhash.h *************************************/
109507
+#line 1 "tsrc/keywordhash.h"
109019109508
/***** This file contains automatically generated code ******
109020109509
**
109021109510
** The code in this file has been automatically generated by
109022109511
**
109023109512
** sqlite/tool/mkkeywordhash.c
@@ -109287,10 +109776,11 @@
109287109776
}
109288109777
#define SQLITE_N_KEYWORD 121
109289109778
109290109779
/************** End of keywordhash.h *****************************************/
109291109780
/************** Continuing where we left off in tokenize.c *******************/
109781
+#line 66 "tsrc/tokenize.c"
109292109782
109293109783
109294109784
/*
109295109785
** If X is a character that can be used in an identifier then
109296109786
** IdChar(X) will be true. Otherwise it is false.
@@ -109751,10 +110241,11 @@
109751110241
return nErr;
109752110242
}
109753110243
109754110244
/************** End of tokenize.c ********************************************/
109755110245
/************** Begin file complete.c ****************************************/
110246
+#line 1 "tsrc/complete.c"
109756110247
/*
109757110248
** 2001 September 15
109758110249
**
109759110250
** The author disclaims copyright to this source code. In place of
109760110251
** a legal notice, here is a blessing:
@@ -110036,10 +110527,11 @@
110036110527
#endif /* SQLITE_OMIT_UTF16 */
110037110528
#endif /* SQLITE_OMIT_COMPLETE */
110038110529
110039110530
/************** End of complete.c ********************************************/
110040110531
/************** Begin file main.c ********************************************/
110532
+#line 1 "tsrc/main.c"
110041110533
/*
110042110534
** 2001 September 15
110043110535
**
110044110536
** The author disclaims copyright to this source code. In place of
110045110537
** a legal notice, here is a blessing:
@@ -110056,10 +110548,11 @@
110056110548
*/
110057110549
110058110550
#ifdef SQLITE_ENABLE_FTS3
110059110551
/************** Include fts3.h in the middle of main.c ***********************/
110060110552
/************** Begin file fts3.h ********************************************/
110553
+#line 1 "tsrc/fts3.h"
110061110554
/*
110062110555
** 2006 Oct 10
110063110556
**
110064110557
** The author disclaims copyright to this source code. In place of
110065110558
** a legal notice, here is a blessing:
@@ -110084,14 +110577,16 @@
110084110577
} /* extern "C" */
110085110578
#endif /* __cplusplus */
110086110579
110087110580
/************** End of fts3.h ************************************************/
110088110581
/************** Continuing where we left off in main.c ***********************/
110582
+#line 21 "tsrc/main.c"
110089110583
#endif
110090110584
#ifdef SQLITE_ENABLE_RTREE
110091110585
/************** Include rtree.h in the middle of main.c **********************/
110092110586
/************** Begin file rtree.h *******************************************/
110587
+#line 1 "tsrc/rtree.h"
110093110588
/*
110094110589
** 2008 May 26
110095110590
**
110096110591
** The author disclaims copyright to this source code. In place of
110097110592
** a legal notice, here is a blessing:
@@ -110116,14 +110611,16 @@
110116110611
} /* extern "C" */
110117110612
#endif /* __cplusplus */
110118110613
110119110614
/************** End of rtree.h ***********************************************/
110120110615
/************** Continuing where we left off in main.c ***********************/
110616
+#line 24 "tsrc/main.c"
110121110617
#endif
110122110618
#ifdef SQLITE_ENABLE_ICU
110123110619
/************** Include sqliteicu.h in the middle of main.c ******************/
110124110620
/************** Begin file sqliteicu.h ***************************************/
110621
+#line 1 "tsrc/sqliteicu.h"
110125110622
/*
110126110623
** 2008 May 26
110127110624
**
110128110625
** The author disclaims copyright to this source code. In place of
110129110626
** a legal notice, here is a blessing:
@@ -110149,10 +110646,11 @@
110149110646
#endif /* __cplusplus */
110150110647
110151110648
110152110649
/************** End of sqliteicu.h *******************************************/
110153110650
/************** Continuing where we left off in main.c ***********************/
110651
+#line 27 "tsrc/main.c"
110154110652
#endif
110155110653
110156110654
#ifndef SQLITE_AMALGAMATION
110157110655
/* IMPLEMENTATION-OF: R-46656-45156 The sqlite3_version[] string constant
110158110656
** contains the text of SQLITE_VERSION macro.
@@ -113079,10 +113577,11 @@
113079113577
return 0;
113080113578
}
113081113579
113082113580
/************** End of main.c ************************************************/
113083113581
/************** Begin file notify.c ******************************************/
113582
+#line 1 "tsrc/notify.c"
113084113583
/*
113085113584
** 2009 March 3
113086113585
**
113087113586
** The author disclaims copyright to this source code. In place of
113088113587
** a legal notice, here is a blessing:
@@ -113412,10 +113911,11 @@
113412113911
}
113413113912
#endif
113414113913
113415113914
/************** End of notify.c **********************************************/
113416113915
/************** Begin file fts3.c ********************************************/
113916
+#line 1 "tsrc/fts3.c"
113417113917
/*
113418113918
** 2006 Oct 10
113419113919
**
113420113920
** The author disclaims copyright to this source code. In place of
113421113921
** a legal notice, here is a blessing:
@@ -113708,10 +114208,11 @@
113708114208
** into a single segment.
113709114209
*/
113710114210
113711114211
/************** Include fts3Int.h in the middle of fts3.c ********************/
113712114212
/************** Begin file fts3Int.h *****************************************/
114213
+#line 1 "tsrc/fts3Int.h"
113713114214
/*
113714114215
** 2009 Nov 12
113715114216
**
113716114217
** The author disclaims copyright to this source code. In place of
113717114218
** a legal notice, here is a blessing:
@@ -113746,10 +114247,11 @@
113746114247
SQLITE_API extern const sqlite3_api_routines *sqlite3_api;
113747114248
#endif
113748114249
113749114250
/************** Include fts3_tokenizer.h in the middle of fts3Int.h **********/
113750114251
/************** Begin file fts3_tokenizer.h **********************************/
114252
+#line 1 "tsrc/fts3_tokenizer.h"
113751114253
/*
113752114254
** 2006 July 10
113753114255
**
113754114256
** The author disclaims copyright to this source code.
113755114257
**
@@ -113900,12 +114402,14 @@
113900114402
113901114403
#endif /* _FTS3_TOKENIZER_H_ */
113902114404
113903114405
/************** End of fts3_tokenizer.h **************************************/
113904114406
/************** Continuing where we left off in fts3Int.h ********************/
114407
+#line 40 "tsrc/fts3Int.h"
113905114408
/************** Include fts3_hash.h in the middle of fts3Int.h ***************/
113906114409
/************** Begin file fts3_hash.h ***************************************/
114410
+#line 1 "tsrc/fts3_hash.h"
113907114411
/*
113908114412
** 2001 September 22
113909114413
**
113910114414
** The author disclaims copyright to this source code. In place of
113911114415
** a legal notice, here is a blessing:
@@ -114017,10 +114521,11 @@
114017114521
114018114522
#endif /* _FTS3_HASH_H_ */
114019114523
114020114524
/************** End of fts3_hash.h *******************************************/
114021114525
/************** Continuing where we left off in fts3Int.h ********************/
114526
+#line 41 "tsrc/fts3Int.h"
114022114527
114023114528
/*
114024114529
** This constant controls how often segments are merged. Once there are
114025114530
** FTS3_MERGE_COUNT segments of level N, they are merged into a single
114026114531
** segment of level N+1.
@@ -114493,10 +114998,11 @@
114493114998
#endif /* !SQLITE_CORE || SQLITE_ENABLE_FTS3 */
114494114999
#endif /* _FTSINT_H */
114495115000
114496115001
/************** End of fts3Int.h *********************************************/
114497115002
/************** Continuing where we left off in fts3.c ***********************/
115003
+#line 296 "tsrc/fts3.c"
114498115004
#if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3)
114499115005
114500115006
#if defined(SQLITE_ENABLE_FTS3) && !defined(SQLITE_CORE)
114501115007
# define SQLITE_CORE 1
114502115008
#endif
@@ -116264,11 +116770,41 @@
116264116770
char *aOut;
116265116771
int bFirstOut = 0;
116266116772
116267116773
*paOut = 0;
116268116774
*pnOut = 0;
116269
- aOut = sqlite3_malloc(n1+n2);
116775
+
116776
+ /* Allocate space for the output. Both the input and output doclists
116777
+ ** are delta encoded. If they are in ascending order (bDescDoclist==0),
116778
+ ** then the first docid in each list is simply encoded as a varint. For
116779
+ ** each subsequent docid, the varint stored is the difference between the
116780
+ ** current and previous docid (a positive number - since the list is in
116781
+ ** ascending order).
116782
+ **
116783
+ ** The first docid written to the output is therefore encoded using the
116784
+ ** same number of bytes as it is in whichever of the input lists it is
116785
+ ** read from. And each subsequent docid read from the same input list
116786
+ ** consumes either the same or less bytes as it did in the input (since
116787
+ ** the difference between it and the previous value in the output must
116788
+ ** be a positive value less than or equal to the delta value read from
116789
+ ** the input list). The same argument applies to all but the first docid
116790
+ ** read from the 'other' list. And to the contents of all position lists
116791
+ ** that will be copied and merged from the input to the output.
116792
+ **
116793
+ ** However, if the first docid copied to the output is a negative number,
116794
+ ** then the encoding of the first docid from the 'other' input list may
116795
+ ** be larger in the output than it was in the input (since the delta value
116796
+ ** may be a larger positive integer than the actual docid).
116797
+ **
116798
+ ** The space required to store the output is therefore the sum of the
116799
+ ** sizes of the two inputs, plus enough space for exactly one of the input
116800
+ ** docids to grow.
116801
+ **
116802
+ ** A symetric argument may be made if the doclists are in descending
116803
+ ** order.
116804
+ */
116805
+ aOut = sqlite3_malloc(n1+n2+FTS3_VARINT_MAX-1);
116270116806
if( !aOut ) return SQLITE_NOMEM;
116271116807
116272116808
p = aOut;
116273116809
fts3GetDeltaVarint3(&p1, pEnd1, 0, &i1);
116274116810
fts3GetDeltaVarint3(&p2, pEnd2, 0, &i2);
@@ -116291,10 +116827,11 @@
116291116827
}
116292116828
}
116293116829
116294116830
*paOut = aOut;
116295116831
*pnOut = (p-aOut);
116832
+ assert( *pnOut<=n1+n2+FTS3_VARINT_MAX-1 );
116296116833
return SQLITE_OK;
116297116834
}
116298116835
116299116836
/*
116300116837
** This function does a "phrase" merge of two doclists. In a phrase merge,
@@ -119011,10 +119548,11 @@
119011119548
119012119549
#endif
119013119550
119014119551
/************** End of fts3.c ************************************************/
119015119552
/************** Begin file fts3_aux.c ****************************************/
119553
+#line 1 "tsrc/fts3_aux.c"
119016119554
/*
119017119555
** 2011 Jan 27
119018119556
**
119019119557
** The author disclaims copyright to this source code. In place of
119020119558
** a legal notice, here is a blessing:
@@ -119487,10 +120025,11 @@
119487120025
119488120026
#endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */
119489120027
119490120028
/************** End of fts3_aux.c ********************************************/
119491120029
/************** Begin file fts3_expr.c ***************************************/
120030
+#line 1 "tsrc/fts3_expr.c"
119492120031
/*
119493120032
** 2008 Nov 28
119494120033
**
119495120034
** The author disclaims copyright to this source code. In place of
119496120035
** a legal notice, here is a blessing:
@@ -120453,10 +120992,11 @@
120453120992
#endif
120454120993
#endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */
120455120994
120456120995
/************** End of fts3_expr.c *******************************************/
120457120996
/************** Begin file fts3_hash.c ***************************************/
120997
+#line 1 "tsrc/fts3_hash.c"
120458120998
/*
120459120999
** 2001 September 22
120460121000
**
120461121001
** The author disclaims copyright to this source code. In place of
120462121002
** a legal notice, here is a blessing:
@@ -120837,10 +121377,11 @@
120837121377
120838121378
#endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */
120839121379
120840121380
/************** End of fts3_hash.c *******************************************/
120841121381
/************** Begin file fts3_porter.c *************************************/
121382
+#line 1 "tsrc/fts3_porter.c"
120842121383
/*
120843121384
** 2006 September 30
120844121385
**
120845121386
** The author disclaims copyright to this source code. In place of
120846121387
** a legal notice, here is a blessing:
@@ -121483,10 +122024,11 @@
121483122024
121484122025
#endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */
121485122026
121486122027
/************** End of fts3_porter.c *****************************************/
121487122028
/************** Begin file fts3_tokenizer.c **********************************/
122029
+#line 1 "tsrc/fts3_tokenizer.c"
121488122030
/*
121489122031
** 2007 June 22
121490122032
**
121491122033
** The author disclaims copyright to this source code. In place of
121492122034
** a legal notice, here is a blessing:
@@ -121974,10 +122516,11 @@
121974122516
121975122517
#endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */
121976122518
121977122519
/************** End of fts3_tokenizer.c **************************************/
121978122520
/************** Begin file fts3_tokenizer1.c *********************************/
122521
+#line 1 "tsrc/fts3_tokenizer1.c"
121979122522
/*
121980122523
** 2006 Oct 10
121981122524
**
121982122525
** The author disclaims copyright to this source code. In place of
121983122526
** a legal notice, here is a blessing:
@@ -122208,10 +122751,11 @@
122208122751
122209122752
#endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */
122210122753
122211122754
/************** End of fts3_tokenizer1.c *************************************/
122212122755
/************** Begin file fts3_write.c **************************************/
122756
+#line 1 "tsrc/fts3_write.c"
122213122757
/*
122214122758
** 2009 Oct 23
122215122759
**
122216122760
** The author disclaims copyright to this source code. In place of
122217122761
** a legal notice, here is a blessing:
@@ -125478,10 +126022,11 @@
125478126022
125479126023
#endif
125480126024
125481126025
/************** End of fts3_write.c ******************************************/
125482126026
/************** Begin file fts3_snippet.c ************************************/
126027
+#line 1 "tsrc/fts3_snippet.c"
125483126028
/*
125484126029
** 2009 Oct 23
125485126030
**
125486126031
** The author disclaims copyright to this source code. In place of
125487126032
** a legal notice, here is a blessing:
@@ -126979,10 +127524,11 @@
126979127524
126980127525
#endif
126981127526
126982127527
/************** End of fts3_snippet.c ****************************************/
126983127528
/************** Begin file rtree.c *******************************************/
127529
+#line 1 "tsrc/rtree.c"
126984127530
/*
126985127531
** 2001 September 15
126986127532
**
126987127533
** The author disclaims copyright to this source code. In place of
126988127534
** a legal notice, here is a blessing:
@@ -130260,10 +130806,11 @@
130260130806
130261130807
#endif
130262130808
130263130809
/************** End of rtree.c ***********************************************/
130264130810
/************** Begin file icu.c *********************************************/
130811
+#line 1 "tsrc/icu.c"
130265130812
/*
130266130813
** 2007 May 6
130267130814
**
130268130815
** The author disclaims copyright to this source code. In place of
130269130816
** a legal notice, here is a blessing:
@@ -130762,10 +131309,11 @@
130762131309
130763131310
#endif
130764131311
130765131312
/************** End of icu.c *************************************************/
130766131313
/************** Begin file fts3_icu.c ****************************************/
131314
+#line 1 "tsrc/fts3_icu.c"
130767131315
/*
130768131316
** 2007 June 22
130769131317
**
130770131318
** The author disclaims copyright to this source code. In place of
130771131319
** a legal notice, here is a blessing:
130772131320
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -24,10 +24,11 @@
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:
@@ -78,10 +79,11 @@
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:
@@ -289,10 +291,11 @@
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 */
@@ -545,10 +548,11 @@
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:
@@ -656,11 +660,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-04 01:27:00 6b657ae75035eb10b0ad640998d3c9eadfdffa6e"
662
663 /*
664 ** CAPI3REF: Run-Time Library Version Numbers
665 ** KEYWORDS: sqlite3_version, sqlite3_sourceid
666 **
@@ -7305,12 +7309,14 @@
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:
@@ -7406,12 +7412,14 @@
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
@@ -7568,10 +7576,11 @@
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>
@@ -7911,10 +7920,11 @@
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:
@@ -8155,12 +8165,14 @@
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:
@@ -8321,10 +8333,11 @@
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
@@ -8508,10 +8521,11 @@
8508 /* 136 */ 0x00, 0x01, 0x00, 0x00, 0x02, 0x04, 0x04, 0x04,\
8509 /* 144 */ 0x04, 0x04, 0x02, 0x00, 0x00, 0x00,}
8510
8511 /************** End of opcodes.h *********************************************/
8512 /************** Continuing where we left off in vdbe.h ***********************/
 
8513
8514 /*
8515 ** Prototypes for the VDBE interface. See comments on the implementation
8516 ** for a description of what each of these routines does.
8517 */
@@ -8559,13 +8573,13 @@
8559 SQLITE_PRIVATE void sqlite3VdbeSetVarmask(Vdbe*, int);
8560 #ifndef SQLITE_OMIT_TRACE
8561 SQLITE_PRIVATE char *sqlite3VdbeExpandSql(Vdbe*, const char*);
8562 #endif
8563
8564 SQLITE_PRIVATE UnpackedRecord *sqlite3VdbeRecordUnpack(KeyInfo*,int,const void*,char*,int);
8565 SQLITE_PRIVATE void sqlite3VdbeDeleteUnpackedRecord(UnpackedRecord*);
8566 SQLITE_PRIVATE int sqlite3VdbeRecordCompare(int,const void*,UnpackedRecord*);
 
8567
8568 #ifndef SQLITE_OMIT_TRIGGER
8569 SQLITE_PRIVATE void sqlite3VdbeLinkSubProgram(Vdbe *, SubProgram *);
8570 #endif
8571
@@ -8582,12 +8596,14 @@
8582
8583 #endif
8584
8585 /************** End of vdbe.h ************************************************/
8586 /************** Continuing where we left off in sqliteInt.h ******************/
 
8587 /************** Include pager.h in the middle of sqliteInt.h *****************/
8588 /************** Begin file pager.h *******************************************/
 
8589 /*
8590 ** 2001 September 15
8591 **
8592 ** The author disclaims copyright to this source code. In place of
8593 ** a legal notice, here is a blessing:
@@ -8769,12 +8785,14 @@
8769
8770 #endif /* _PAGER_H_ */
8771
8772 /************** End of pager.h ***********************************************/
8773 /************** Continuing where we left off in sqliteInt.h ******************/
 
8774 /************** Include pcache.h in the middle of sqliteInt.h ****************/
8775 /************** Begin file pcache.h ******************************************/
 
8776 /*
8777 ** 2008 August 05
8778 **
8779 ** The author disclaims copyright to this source code. In place of
8780 ** a legal notice, here is a blessing:
@@ -8929,13 +8947,15 @@
8929
8930 #endif /* _PCACHE_H_ */
8931
8932 /************** End of pcache.h **********************************************/
8933 /************** Continuing where we left off in sqliteInt.h ******************/
 
8934
8935 /************** Include os.h in the middle of sqliteInt.h ********************/
8936 /************** Begin file os.h **********************************************/
 
8937 /*
8938 ** 2001 September 16
8939 **
8940 ** The author disclaims copyright to this source code. In place of
8941 ** a legal notice, here is a blessing:
@@ -9214,12 +9234,14 @@
9214
9215 #endif /* _SQLITE_OS_H_ */
9216
9217 /************** End of os.h **************************************************/
9218 /************** Continuing where we left off in sqliteInt.h ******************/
 
9219 /************** Include mutex.h in the middle of sqliteInt.h *****************/
9220 /************** Begin file mutex.h *******************************************/
 
9221 /*
9222 ** 2007 August 28
9223 **
9224 ** The author disclaims copyright to this source code. In place of
9225 ** a legal notice, here is a blessing:
@@ -9290,10 +9312,11 @@
9290 #define sqlite3MutexEnd()
9291 #endif /* defined(SQLITE_MUTEX_OMIT) */
9292
9293 /************** End of mutex.h ***********************************************/
9294 /************** Continuing where we left off in sqliteInt.h ******************/
 
9295
9296
9297 /*
9298 ** Each database file to be accessed by the system is an instance
9299 ** of the following structure. There are normally two of these structures
@@ -11892,10 +11915,11 @@
11892
11893 #endif /* _SQLITEINT_H_ */
11894
11895 /************** End of sqliteInt.h *******************************************/
11896 /************** Begin file global.c ******************************************/
 
11897 /*
11898 ** 2008 June 13
11899 **
11900 ** The author disclaims copyright to this source code. In place of
11901 ** a legal notice, here is a blessing:
@@ -12114,10 +12138,11 @@
12114 */
12115 SQLITE_PRIVATE const unsigned char sqlite3OpcodeProperty[] = OPFLG_INITIALIZER;
12116
12117 /************** End of global.c **********************************************/
12118 /************** Begin file ctime.c *******************************************/
 
12119 /*
12120 ** 2010 February 23
12121 **
12122 ** The author disclaims copyright to this source code. In place of
12123 ** a legal notice, here is a blessing:
@@ -12518,10 +12543,11 @@
12518
12519 #endif /* SQLITE_OMIT_COMPILEOPTION_DIAGS */
12520
12521 /************** End of ctime.c ***********************************************/
12522 /************** Begin file status.c ******************************************/
 
12523 /*
12524 ** 2008 June 18
12525 **
12526 ** The author disclaims copyright to this source code. In place of
12527 ** a legal notice, here is a blessing:
@@ -12535,10 +12561,11 @@
12535 ** This module implements the sqlite3_status() interface and related
12536 ** functionality.
12537 */
12538 /************** Include vdbeInt.h in the middle of status.c ******************/
12539 /************** Begin file vdbeInt.h *****************************************/
 
12540 /*
12541 ** 2003 September 6
12542 **
12543 ** The author disclaims copyright to this source code. In place of
12544 ** a legal notice, here is a blessing:
@@ -12986,10 +13013,11 @@
12986
12987 #endif /* !defined(_VDBEINT_H_) */
12988
12989 /************** End of vdbeInt.h *********************************************/
12990 /************** Continuing where we left off in status.c *********************/
 
12991
12992 /*
12993 ** Variables in which to record status information.
12994 */
12995 typedef struct sqlite3StatType sqlite3StatType;
@@ -13199,10 +13227,11 @@
13199 return rc;
13200 }
13201
13202 /************** End of status.c **********************************************/
13203 /************** Begin file date.c ********************************************/
 
13204 /*
13205 ** 2003 October 31
13206 **
13207 ** The author disclaims copyright to this source code. In place of
13208 ** a legal notice, here is a blessing:
@@ -14326,10 +14355,11 @@
14326 }
14327 }
14328
14329 /************** End of date.c ************************************************/
14330 /************** Begin file os.c **********************************************/
 
14331 /*
14332 ** 2005 November 29
14333 **
14334 ** The author disclaims copyright to this source code. In place of
14335 ** a legal notice, here is a blessing:
@@ -14659,10 +14689,11 @@
14659 return SQLITE_OK;
14660 }
14661
14662 /************** End of os.c **************************************************/
14663 /************** Begin file fault.c *******************************************/
 
14664 /*
14665 ** 2008 Jan 22
14666 **
14667 ** The author disclaims copyright to this source code. In place of
14668 ** a legal notice, here is a blessing:
@@ -14748,10 +14779,11 @@
14748
14749 #endif /* #ifndef SQLITE_OMIT_BUILTIN_TEST */
14750
14751 /************** End of fault.c ***********************************************/
14752 /************** Begin file mem0.c ********************************************/
 
14753 /*
14754 ** 2008 October 28
14755 **
14756 ** The author disclaims copyright to this source code. In place of
14757 ** a legal notice, here is a blessing:
@@ -14809,10 +14841,11 @@
14809
14810 #endif /* SQLITE_ZERO_MALLOC */
14811
14812 /************** End of mem0.c ************************************************/
14813 /************** Begin file mem1.c ********************************************/
 
14814 /*
14815 ** 2007 August 14
14816 **
14817 ** The author disclaims copyright to this source code. In place of
14818 ** a legal notice, here is a blessing:
@@ -14961,10 +14994,11 @@
14961
14962 #endif /* SQLITE_SYSTEM_MALLOC */
14963
14964 /************** End of mem1.c ************************************************/
14965 /************** Begin file mem2.c ********************************************/
 
14966 /*
14967 ** 2007 August 15
14968 **
14969 ** The author disclaims copyright to this source code. In place of
14970 ** a legal notice, here is a blessing:
@@ -15491,10 +15525,11 @@
15491
15492 #endif /* SQLITE_MEMDEBUG */
15493
15494 /************** End of mem2.c ************************************************/
15495 /************** Begin file mem3.c ********************************************/
 
15496 /*
15497 ** 2007 October 14
15498 **
15499 ** The author disclaims copyright to this source code. In place of
15500 ** a legal notice, here is a blessing:
@@ -16180,10 +16215,11 @@
16180
16181 #endif /* SQLITE_ENABLE_MEMSYS3 */
16182
16183 /************** End of mem3.c ************************************************/
16184 /************** Begin file mem5.c ********************************************/
 
16185 /*
16186 ** 2007 October 14
16187 **
16188 ** The author disclaims copyright to this source code. In place of
16189 ** a legal notice, here is a blessing:
@@ -16763,10 +16799,11 @@
16763
16764 #endif /* SQLITE_ENABLE_MEMSYS5 */
16765
16766 /************** End of mem5.c ************************************************/
16767 /************** Begin file mutex.c *******************************************/
 
16768 /*
16769 ** 2007 August 14
16770 **
16771 ** The author disclaims copyright to this source code. In place of
16772 ** a legal notice, here is a blessing:
@@ -16918,10 +16955,11 @@
16918
16919 #endif /* SQLITE_MUTEX_OMIT */
16920
16921 /************** End of mutex.c ***********************************************/
16922 /************** Begin file mutex_noop.c **************************************/
 
16923 /*
16924 ** 2008 October 07
16925 **
16926 ** The author disclaims copyright to this source code. In place of
16927 ** a legal notice, here is a blessing:
@@ -17126,10 +17164,11 @@
17126 #endif /* SQLITE_MUTEX_NOOP */
17127 #endif /* SQLITE_MUTEX_OMIT */
17128
17129 /************** End of mutex_noop.c ******************************************/
17130 /************** Begin file mutex_os2.c ***************************************/
 
17131 /*
17132 ** 2007 August 28
17133 **
17134 ** The author disclaims copyright to this source code. In place of
17135 ** a legal notice, here is a blessing:
@@ -17402,10 +17441,11 @@
17402 }
17403 #endif /* SQLITE_MUTEX_OS2 */
17404
17405 /************** End of mutex_os2.c *******************************************/
17406 /************** Begin file mutex_unix.c **************************************/
 
17407 /*
17408 ** 2007 August 28
17409 **
17410 ** The author disclaims copyright to this source code. In place of
17411 ** a legal notice, here is a blessing:
@@ -17755,10 +17795,11 @@
17755
17756 #endif /* SQLITE_MUTEX_PTHREAD */
17757
17758 /************** End of mutex_unix.c ******************************************/
17759 /************** Begin file mutex_w32.c ***************************************/
 
17760 /*
17761 ** 2007 August 14
17762 **
17763 ** The author disclaims copyright to this source code. In place of
17764 ** a legal notice, here is a blessing:
@@ -18089,10 +18130,11 @@
18089 }
18090 #endif /* SQLITE_MUTEX_W32 */
18091
18092 /************** End of mutex_w32.c *******************************************/
18093 /************** Begin file malloc.c ******************************************/
 
18094 /*
18095 ** 2001 September 15
18096 **
18097 ** The author disclaims copyright to this source code. In place of
18098 ** a legal notice, here is a blessing:
@@ -18868,10 +18910,11 @@
18868 return rc & (db ? db->errMask : 0xff);
18869 }
18870
18871 /************** End of malloc.c **********************************************/
18872 /************** Begin file printf.c ******************************************/
 
18873 /*
18874 ** The "printf" code that follows dates from the 1980's. It is in
18875 ** the public domain. The original comments are included here for
18876 ** completeness. They are very out-of-date but might be useful as
18877 ** an historical reference. Most of the "enhancements" have been backed
@@ -19899,10 +19942,11 @@
19899 }
19900 #endif
19901
19902 /************** End of printf.c **********************************************/
19903 /************** Begin file random.c ******************************************/
 
19904 /*
19905 ** 2001 September 15
19906 **
19907 ** The author disclaims copyright to this source code. In place of
19908 ** a legal notice, here is a blessing:
@@ -20046,10 +20090,11 @@
20046 }
20047 #endif /* SQLITE_OMIT_BUILTIN_TEST */
20048
20049 /************** End of random.c **********************************************/
20050 /************** Begin file utf.c *********************************************/
 
20051 /*
20052 ** 2004 April 13
20053 **
20054 ** The author disclaims copyright to this source code. In place of
20055 ** a legal notice, here is a blessing:
@@ -20607,10 +20652,11 @@
20607 #endif /* SQLITE_TEST */
20608 #endif /* SQLITE_OMIT_UTF16 */
20609
20610 /************** End of utf.c *************************************************/
20611 /************** Begin file util.c ********************************************/
 
20612 /*
20613 ** 2001 September 15
20614 **
20615 ** The author disclaims copyright to this source code. In place of
20616 ** a legal notice, here is a blessing:
@@ -21789,10 +21835,11 @@
21789 }
21790 #endif
21791
21792 /************** End of util.c ************************************************/
21793 /************** Begin file hash.c ********************************************/
 
21794 /*
21795 ** 2001 September 22
21796 **
21797 ** The author disclaims copyright to this source code. In place of
21798 ** a legal notice, here is a blessing:
@@ -22068,10 +22115,11 @@
22068 return 0;
22069 }
22070
22071 /************** End of hash.c ************************************************/
22072 /************** Begin file opcodes.c *****************************************/
 
22073 /* Automatically generated. Do not edit */
22074 /* See the mkopcodec.awk script for details. */
22075 #if !defined(SQLITE_OMIT_EXPLAIN) || !defined(NDEBUG) || defined(VDBE_PROFILE) || defined(SQLITE_DEBUG)
22076 SQLITE_PRIVATE const char *sqlite3OpcodeName(int i){
22077 static const char *const azName[] = { "?",
@@ -22229,10 +22277,11 @@
22229 }
22230 #endif
22231
22232 /************** End of opcodes.c *********************************************/
22233 /************** Begin file os_os2.c ******************************************/
 
22234 /*
22235 ** 2006 Feb 14
22236 **
22237 ** The author disclaims copyright to this source code. In place of
22238 ** a legal notice, here is a blessing:
@@ -22285,10 +22334,11 @@
22285 /*
22286 ** Include code that is common to all os_*.c files
22287 */
22288 /************** Include os_common.h in the middle of os_os2.c ****************/
22289 /************** Begin file os_common.h ***************************************/
 
22290 /*
22291 ** 2004 May 22
22292 **
22293 ** The author disclaims copyright to this source code. In place of
22294 ** a legal notice, here is a blessing:
@@ -22338,10 +22388,11 @@
22338 ** hwtime.h contains inline assembler code for implementing
22339 ** high-performance timing routines.
22340 */
22341 /************** Include hwtime.h in the middle of os_common.h ****************/
22342 /************** Begin file hwtime.h ******************************************/
 
22343 /*
22344 ** 2008 May 27
22345 **
22346 ** The author disclaims copyright to this source code. In place of
22347 ** a legal notice, here is a blessing:
@@ -22426,10 +22477,11 @@
22426
22427 #endif /* !defined(_HWTIME_H_) */
22428
22429 /************** End of hwtime.h **********************************************/
22430 /************** Continuing where we left off in os_common.h ******************/
 
22431
22432 static sqlite_uint64 g_start;
22433 static sqlite_uint64 g_elapsed;
22434 #define TIMER_START g_start=sqlite3Hwtime()
22435 #define TIMER_END g_elapsed=sqlite3Hwtime()-g_start
@@ -22492,10 +22544,11 @@
22492
22493 #endif /* !defined(_OS_COMMON_H_) */
22494
22495 /************** End of os_common.h *******************************************/
22496 /************** Continuing where we left off in os_os2.c *********************/
 
22497
22498 /* Forward references */
22499 typedef struct os2File os2File; /* The file structure */
22500 typedef struct os2ShmNode os2ShmNode; /* A shared descritive memory node */
22501 typedef struct os2ShmLink os2ShmLink; /* A connection to shared-memory */
@@ -24363,10 +24416,11 @@
24363
24364 #endif /* SQLITE_OS_OS2 */
24365
24366 /************** End of os_os2.c **********************************************/
24367 /************** Begin file os_unix.c *****************************************/
 
24368 /*
24369 ** 2004 May 22
24370 **
24371 ** The author disclaims copyright to this source code. In place of
24372 ** a legal notice, here is a blessing:
@@ -24627,10 +24681,11 @@
24627 /*
24628 ** Include code that is common to all os_*.c files
24629 */
24630 /************** Include os_common.h in the middle of os_unix.c ***************/
24631 /************** Begin file os_common.h ***************************************/
 
24632 /*
24633 ** 2004 May 22
24634 **
24635 ** The author disclaims copyright to this source code. In place of
24636 ** a legal notice, here is a blessing:
@@ -24680,10 +24735,11 @@
24680 ** hwtime.h contains inline assembler code for implementing
24681 ** high-performance timing routines.
24682 */
24683 /************** Include hwtime.h in the middle of os_common.h ****************/
24684 /************** Begin file hwtime.h ******************************************/
 
24685 /*
24686 ** 2008 May 27
24687 **
24688 ** The author disclaims copyright to this source code. In place of
24689 ** a legal notice, here is a blessing:
@@ -24768,10 +24824,11 @@
24768
24769 #endif /* !defined(_HWTIME_H_) */
24770
24771 /************** End of hwtime.h **********************************************/
24772 /************** Continuing where we left off in os_common.h ******************/
 
24773
24774 static sqlite_uint64 g_start;
24775 static sqlite_uint64 g_elapsed;
24776 #define TIMER_START g_start=sqlite3Hwtime()
24777 #define TIMER_END g_elapsed=sqlite3Hwtime()-g_start
@@ -24834,10 +24891,11 @@
24834
24835 #endif /* !defined(_OS_COMMON_H_) */
24836
24837 /************** End of os_common.h *******************************************/
24838 /************** Continuing where we left off in os_unix.c ********************/
 
24839
24840 /*
24841 ** Define various macros that are missing from some systems.
24842 */
24843 #ifndef O_LARGEFILE
@@ -31343,10 +31401,11 @@
31343
31344 #endif /* SQLITE_OS_UNIX */
31345
31346 /************** End of os_unix.c *********************************************/
31347 /************** Begin file os_win.c ******************************************/
 
31348 /*
31349 ** 2004 May 22
31350 **
31351 ** The author disclaims copyright to this source code. In place of
31352 ** a legal notice, here is a blessing:
@@ -31404,10 +31463,11 @@
31404 /*
31405 ** Include code that is common to all os_*.c files
31406 */
31407 /************** Include os_common.h in the middle of os_win.c ****************/
31408 /************** Begin file os_common.h ***************************************/
 
31409 /*
31410 ** 2004 May 22
31411 **
31412 ** The author disclaims copyright to this source code. In place of
31413 ** a legal notice, here is a blessing:
@@ -31457,10 +31517,11 @@
31457 ** hwtime.h contains inline assembler code for implementing
31458 ** high-performance timing routines.
31459 */
31460 /************** Include hwtime.h in the middle of os_common.h ****************/
31461 /************** Begin file hwtime.h ******************************************/
 
31462 /*
31463 ** 2008 May 27
31464 **
31465 ** The author disclaims copyright to this source code. In place of
31466 ** a legal notice, here is a blessing:
@@ -31545,10 +31606,11 @@
31545
31546 #endif /* !defined(_HWTIME_H_) */
31547
31548 /************** End of hwtime.h **********************************************/
31549 /************** Continuing where we left off in os_common.h ******************/
 
31550
31551 static sqlite_uint64 g_start;
31552 static sqlite_uint64 g_elapsed;
31553 #define TIMER_START g_start=sqlite3Hwtime()
31554 #define TIMER_END g_elapsed=sqlite3Hwtime()-g_start
@@ -31611,10 +31673,11 @@
31611
31612 #endif /* !defined(_OS_COMMON_H_) */
31613
31614 /************** End of os_common.h *******************************************/
31615 /************** Continuing where we left off in os_win.c *********************/
 
31616
31617 /*
31618 ** Some microsoft compilers lack this definition.
31619 */
31620 #ifndef INVALID_FILE_ATTRIBUTES
@@ -34746,10 +34809,11 @@
34746
34747 #endif /* SQLITE_OS_WIN */
34748
34749 /************** End of os_win.c **********************************************/
34750 /************** Begin file bitvec.c ******************************************/
 
34751 /*
34752 ** 2008 February 16
34753 **
34754 ** The author disclaims copyright to this source code. In place of
34755 ** a legal notice, here is a blessing:
@@ -35156,10 +35220,11 @@
35156 }
35157 #endif /* SQLITE_OMIT_BUILTIN_TEST */
35158
35159 /************** End of bitvec.c **********************************************/
35160 /************** Begin file pcache.c ******************************************/
 
35161 /*
35162 ** 2008 August 05
35163 **
35164 ** The author disclaims copyright to this source code. In place of
35165 ** a legal notice, here is a blessing:
@@ -35752,10 +35817,11 @@
35752 }
35753 #endif
35754
35755 /************** End of pcache.c **********************************************/
35756 /************** Begin file pcache1.c *****************************************/
 
35757 /*
35758 ** 2008 November 05
35759 **
35760 ** The author disclaims copyright to this source code. In place of
35761 ** a legal notice, here is a blessing:
@@ -36968,10 +37034,11 @@
36968 }
36969 #endif
36970
36971 /************** End of pcache1.c *********************************************/
36972 /************** Begin file rowset.c ******************************************/
 
36973 /*
36974 ** 2008 December 3
36975 **
36976 ** The author disclaims copyright to this source code. In place of
36977 ** a legal notice, here is a blessing:
@@ -37392,10 +37459,11 @@
37392 return 0;
37393 }
37394
37395 /************** End of rowset.c **********************************************/
37396 /************** Begin file pager.c *******************************************/
 
37397 /*
37398 ** 2001 September 15
37399 **
37400 ** The author disclaims copyright to this source code. In place of
37401 ** a legal notice, here is a blessing:
@@ -37415,10 +37483,11 @@
37415 ** another is writing.
37416 */
37417 #ifndef SQLITE_OMIT_DISKIO
37418 /************** Include wal.h in the middle of pager.c ***********************/
37419 /************** Begin file wal.h *********************************************/
 
37420 /*
37421 ** 2010 February 1
37422 **
37423 ** The author disclaims copyright to this source code. In place of
37424 ** a legal notice, here is a blessing:
@@ -37539,10 +37608,11 @@
37539 #endif /* ifndef SQLITE_OMIT_WAL */
37540 #endif /* _WAL_H_ */
37541
37542 /************** End of wal.h *************************************************/
37543 /************** Continuing where we left off in pager.c **********************/
 
37544
37545
37546 /******************* NOTES ON THE DESIGN OF THE PAGER ************************
37547 **
37548 ** This comment block describes invariants that hold when using a rollback
@@ -44352,10 +44422,11 @@
44352
44353 #endif /* SQLITE_OMIT_DISKIO */
44354
44355 /************** End of pager.c ***********************************************/
44356 /************** Begin file wal.c *********************************************/
 
44357 /*
44358 ** 2010 February 1
44359 **
44360 ** The author disclaims copyright to this source code. In place of
44361 ** a legal notice, here is a blessing:
@@ -47306,10 +47377,11 @@
47306
47307 #endif /* #ifndef SQLITE_OMIT_WAL */
47308
47309 /************** End of wal.c *************************************************/
47310 /************** Begin file btmutex.c *****************************************/
 
47311 /*
47312 ** 2007 August 27
47313 **
47314 ** The author disclaims copyright to this source code. In place of
47315 ** a legal notice, here is a blessing:
@@ -47325,10 +47397,11 @@
47325 ** big and we want to break it down some. This packaged seemed like
47326 ** a good breakout.
47327 */
47328 /************** Include btreeInt.h in the middle of btmutex.c ****************/
47329 /************** Begin file btreeInt.h ****************************************/
 
47330 /*
47331 ** 2004 April 6
47332 **
47333 ** The author disclaims copyright to this source code. In place of
47334 ** a legal notice, here is a blessing:
@@ -47970,10 +48043,11 @@
47970 #define get4byte sqlite3Get4byte
47971 #define put4byte sqlite3Put4byte
47972
47973 /************** End of btreeInt.h ********************************************/
47974 /************** Continuing where we left off in btmutex.c ********************/
 
47975 #ifndef SQLITE_OMIT_SHARED_CACHE
47976 #if SQLITE_THREADSAFE
47977
47978 /*
47979 ** Obtain the BtShared mutex associated with B-Tree handle p. Also,
@@ -48242,10 +48316,11 @@
48242 #endif /* if SQLITE_THREADSAFE */
48243 #endif /* ifndef SQLITE_OMIT_SHARED_CACHE */
48244
48245 /************** End of btmutex.c *********************************************/
48246 /************** Begin file btree.c *******************************************/
 
48247 /*
48248 ** 2004 April 6
48249 **
48250 ** The author disclaims copyright to this source code. In place of
48251 ** a legal notice, here is a blessing:
@@ -48899,22 +48974,25 @@
48899 int *pRes /* Write search results here */
48900 ){
48901 int rc; /* Status code */
48902 UnpackedRecord *pIdxKey; /* Unpacked index key */
48903 char aSpace[150]; /* Temp space for pIdxKey - to avoid a malloc */
 
48904
48905 if( pKey ){
48906 assert( nKey==(i64)(int)nKey );
48907 pIdxKey = sqlite3VdbeRecordUnpack(pCur->pKeyInfo, (int)nKey, pKey,
48908 aSpace, sizeof(aSpace));
 
48909 if( pIdxKey==0 ) return SQLITE_NOMEM;
 
48910 }else{
48911 pIdxKey = 0;
48912 }
48913 rc = sqlite3BtreeMovetoUnpacked(pCur, pIdxKey, nKey, bias, pRes);
48914 if( pKey ){
48915 sqlite3VdbeDeleteUnpackedRecord(pIdxKey);
48916 }
48917 return rc;
48918 }
48919
48920 /*
@@ -56426,10 +56504,11 @@
56426 return rc;
56427 }
56428
56429 /************** End of btree.c ***********************************************/
56430 /************** Begin file backup.c ******************************************/
 
56431 /*
56432 ** 2009 January 28
56433 **
56434 ** The author disclaims copyright to this source code. In place of
56435 ** a legal notice, here is a blessing:
@@ -57132,10 +57211,11 @@
57132 }
57133 #endif /* SQLITE_OMIT_VACUUM */
57134
57135 /************** End of backup.c **********************************************/
57136 /************** Begin file vdbemem.c *****************************************/
 
57137 /*
57138 ** 2004 May 26
57139 **
57140 ** The author disclaims copyright to this source code. In place of
57141 ** a legal notice, here is a blessing:
@@ -58286,10 +58366,11 @@
58286 return 0;
58287 }
58288
58289 /************** End of vdbemem.c *********************************************/
58290 /************** Begin file vdbeaux.c *****************************************/
 
58291 /*
58292 ** 2003 September 6
58293 **
58294 ** The author disclaims copyright to this source code. In place of
58295 ** a legal notice, here is a blessing:
@@ -61116,61 +61197,74 @@
61116 }
61117 }
61118 return 0;
61119 }
61120
61121
61122 /*
61123 ** Given the nKey-byte encoding of a record in pKey[], parse the
61124 ** record into a UnpackedRecord structure. Return a pointer to
61125 ** that structure.
61126 **
61127 ** The calling function might provide szSpace bytes of memory
61128 ** space at pSpace. This space can be used to hold the returned
61129 ** VDbeParsedRecord structure if it is large enough. If it is
61130 ** not big enough, space is obtained from sqlite3_malloc().
61131 **
61132 ** The returned structure should be closed by a call to
61133 ** sqlite3VdbeDeleteUnpackedRecord().
61134 */
61135 SQLITE_PRIVATE UnpackedRecord *sqlite3VdbeRecordUnpack(
61136 KeyInfo *pKeyInfo, /* Information about the record format */
61137 int nKey, /* Size of the binary record */
61138 const void *pKey, /* The binary record */
61139 char *pSpace, /* Unaligned space available to hold the object */
61140 int szSpace /* Size of pSpace[] in bytes */
61141 ){
61142 const unsigned char *aKey = (const unsigned char *)pKey;
61143 UnpackedRecord *p; /* The unpacked record that we will return */
61144 int nByte; /* Memory space needed to hold p, in bytes */
61145 int d;
61146 u32 idx;
61147 u16 u; /* Unsigned loop counter */
61148 u32 szHdr;
61149 Mem *pMem;
61150 int nOff; /* Increase pSpace by this much to 8-byte align it */
61151
61152 /*
61153 ** We want to shift the pointer pSpace up such that it is 8-byte aligned.
61154 ** Thus, we need to calculate a value, nOff, between 0 and 7, to shift
61155 ** it by. If pSpace is already 8-byte aligned, nOff should be zero.
61156 */
61157 nOff = (8 - (SQLITE_PTR_TO_INT(pSpace) & 7)) & 7;
61158 pSpace += nOff;
61159 szSpace -= nOff;
61160 nByte = ROUND8(sizeof(UnpackedRecord)) + sizeof(Mem)*(pKeyInfo->nField+1);
61161 if( nByte>szSpace ){
61162 p = sqlite3DbMallocRaw(pKeyInfo->db, nByte);
61163 if( p==0 ) return 0;
61164 p->flags = UNPACKED_NEED_FREE | UNPACKED_NEED_DESTROY;
61165 }else{
61166 p = (UnpackedRecord*)pSpace;
61167 p->flags = UNPACKED_NEED_DESTROY;
61168 }
 
 
61169 p->pKeyInfo = pKeyInfo;
61170 p->nField = pKeyInfo->nField + 1;
61171 p->aMem = pMem = (Mem*)&((char*)p)[ROUND8(sizeof(UnpackedRecord))];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
61172 assert( EIGHT_BYTE_ALIGNMENT(pMem) );
61173 idx = getVarint32(aKey, szHdr);
61174 d = szHdr;
61175 u = 0;
61176 while( idx<szHdr && u<p->nField && d<=nKey ){
@@ -61185,35 +61279,10 @@
61185 pMem++;
61186 u++;
61187 }
61188 assert( u<=pKeyInfo->nField + 1 );
61189 p->nField = u;
61190 return (void*)p;
61191 }
61192
61193 /*
61194 ** This routine destroys a UnpackedRecord object.
61195 */
61196 SQLITE_PRIVATE void sqlite3VdbeDeleteUnpackedRecord(UnpackedRecord *p){
61197 #ifdef SQLITE_DEBUG
61198 int i;
61199 Mem *pMem;
61200
61201 assert( p!=0 );
61202 assert( p->flags & UNPACKED_NEED_DESTROY );
61203 for(i=0, pMem=p->aMem; i<p->nField; i++, pMem++){
61204 /* The unpacked record is always constructed by the
61205 ** sqlite3VdbeUnpackRecord() function above, which makes all
61206 ** strings and blobs static. And none of the elements are
61207 ** ever transformed, so there is never anything to delete.
61208 */
61209 if( NEVER(pMem->zMalloc) ) sqlite3VdbeMemRelease(pMem);
61210 }
61211 #endif
61212 if( p->flags & UNPACKED_NEED_FREE ){
61213 sqlite3DbFree(p->pKeyInfo->db, p);
61214 }
61215 }
61216
61217 /*
61218 ** This function compares the two table rows or index records
61219 ** specified by {nKey1, pKey1} and pPKey2. It returns a negative, zero
@@ -61540,10 +61609,11 @@
61540 }
61541 }
61542
61543 /************** End of vdbeaux.c *********************************************/
61544 /************** Begin file vdbeapi.c *****************************************/
 
61545 /*
61546 ** 2004 May 26
61547 **
61548 ** The author disclaims copyright to this source code. In place of
61549 ** a legal notice, here is a blessing:
@@ -62847,10 +62917,11 @@
62847 return v;
62848 }
62849
62850 /************** End of vdbeapi.c *********************************************/
62851 /************** Begin file vdbetrace.c ***************************************/
 
62852 /*
62853 ** 2009 November 25
62854 **
62855 ** The author disclaims copyright to this source code. In place of
62856 ** a legal notice, here is a blessing:
@@ -63002,10 +63073,11 @@
63002
63003 #endif /* #ifndef SQLITE_OMIT_TRACE */
63004
63005 /************** End of vdbetrace.c *******************************************/
63006 /************** Begin file vdbe.c ********************************************/
 
63007 /*
63008 ** 2001 September 15
63009 **
63010 ** The author disclaims copyright to this source code. In place of
63011 ** a legal notice, here is a blessing:
@@ -63471,10 +63543,11 @@
63471 ** hwtime.h contains inline assembler code for implementing
63472 ** high-performance timing routines.
63473 */
63474 /************** Include hwtime.h in the middle of vdbe.c *********************/
63475 /************** Begin file hwtime.h ******************************************/
 
63476 /*
63477 ** 2008 May 27
63478 **
63479 ** The author disclaims copyright to this source code. In place of
63480 ** a legal notice, here is a blessing:
@@ -63559,10 +63632,11 @@
63559
63560 #endif /* !defined(_HWTIME_H_) */
63561
63562 /************** End of hwtime.h **********************************************/
63563 /************** Continuing where we left off in vdbe.c ***********************/
 
63564
63565 #endif
63566
63567 /*
63568 ** The CHECK_FOR_INTERRUPT macro defined here looks to see if the
@@ -63853,10 +63927,11 @@
63853 } bb;
63854 struct OP_Found_stack_vars {
63855 int alreadyExists;
63856 VdbeCursor *pC;
63857 int res;
 
63858 UnpackedRecord *pIdxKey;
63859 UnpackedRecord r;
63860 char aTempRec[ROUND8(sizeof(UnpackedRecord)) + sizeof(Mem)*3 + 7];
63861 } bc;
63862 struct OP_IsUnique_stack_vars {
@@ -67097,10 +67172,11 @@
67097 case OP_Found: { /* jump, in3 */
67098 #if 0 /* local variables moved into u.bc */
67099 int alreadyExists;
67100 VdbeCursor *pC;
67101 int res;
 
67102 UnpackedRecord *pIdxKey;
67103 UnpackedRecord r;
67104 char aTempRec[ROUND8(sizeof(UnpackedRecord)) + sizeof(Mem)*3 + 7];
67105 #endif /* local variables moved into u.bc */
67106
@@ -67125,22 +67201,22 @@
67125 { int i; for(i=0; i<u.bc.r.nField; i++) assert( memIsValid(&u.bc.r.aMem[i]) ); }
67126 #endif
67127 u.bc.r.flags = UNPACKED_PREFIX_MATCH;
67128 u.bc.pIdxKey = &u.bc.r;
67129 }else{
 
 
 
 
67130 assert( pIn3->flags & MEM_Blob );
67131 assert( (pIn3->flags & MEM_Zero)==0 ); /* zeroblobs already expanded */
67132 u.bc.pIdxKey = sqlite3VdbeRecordUnpack(u.bc.pC->pKeyInfo, pIn3->n, pIn3->z,
67133 u.bc.aTempRec, sizeof(u.bc.aTempRec));
67134 if( u.bc.pIdxKey==0 ){
67135 goto no_mem;
67136 }
67137 u.bc.pIdxKey->flags |= UNPACKED_PREFIX_MATCH;
67138 }
67139 rc = sqlite3BtreeMovetoUnpacked(u.bc.pC->pCursor, u.bc.pIdxKey, 0, 0, &u.bc.res);
67140 if( pOp->p4.i==0 ){
67141 sqlite3VdbeDeleteUnpackedRecord(u.bc.pIdxKey);
67142 }
67143 if( rc!=SQLITE_OK ){
67144 break;
67145 }
67146 u.bc.alreadyExists = (u.bc.res==0);
@@ -69784,10 +69860,11 @@
69784 goto vdbe_error_halt;
69785 }
69786
69787 /************** End of vdbe.c ************************************************/
69788 /************** Begin file vdbeblob.c ****************************************/
 
69789 /*
69790 ** 2007 May 1
69791 **
69792 ** The author disclaims copyright to this source code. In place of
69793 ** a legal notice, here is a blessing:
@@ -70254,10 +70331,11 @@
70254
70255 #endif /* #ifndef SQLITE_OMIT_INCRBLOB */
70256
70257 /************** End of vdbeblob.c ********************************************/
70258 /************** Begin file vdbesort.c ****************************************/
 
70259 /*
70260 ** 2011 July 9
70261 **
70262 ** The author disclaims copyright to this source code. In place of
70263 ** a legal notice, here is a blessing:
@@ -70358,12 +70436,11 @@
70358 sqlite3_file *pTemp1; /* PMA file 1 */
70359 int nPMA; /* Number of PMAs stored in pTemp1 */
70360 SorterRecord *pRecord; /* Head of in-memory record list */
70361 int mnPmaSize; /* Minimum PMA size, in bytes */
70362 int mxPmaSize; /* Maximum PMA size, in bytes. 0==no limit */
70363 char *aSpace; /* Space for UnpackRecord() */
70364 int nSpace; /* Size of aSpace in bytes */
70365 };
70366
70367 /*
70368 ** The following type is an iterator for a PMA. It caches the current key in
70369 ** variables nKey/aKey. If the iterator is at EOF, pFile==0.
@@ -70553,56 +70630,39 @@
70553 ** be less than key2. Even if key2 also contains NULL values.
70554 **
70555 ** If pKey2 is passed a NULL pointer, then it is assumed that the pCsr->aSpace
70556 ** has been allocated and contains an unpacked record that is used as key2.
70557 */
70558 static int vdbeSorterCompare(
70559 VdbeCursor *pCsr, /* Cursor object (for pKeyInfo) */
70560 int bOmitRowid, /* Ignore rowid field at end of keys */
70561 void *pKey1, int nKey1, /* Left side of comparison */
70562 void *pKey2, int nKey2, /* Right side of comparison */
70563 int *pRes /* OUT: Result of comparison */
70564 ){
70565 KeyInfo *pKeyInfo = pCsr->pKeyInfo;
70566 VdbeSorter *pSorter = pCsr->pSorter;
70567 char *aSpace = pSorter->aSpace;
70568 int nSpace = pSorter->nSpace;
70569 UnpackedRecord *r2;
70570 int i;
70571
70572 if( aSpace==0 ){
70573 nSpace = ROUND8(sizeof(UnpackedRecord))+(pKeyInfo->nField+1)*sizeof(Mem);
70574 aSpace = (char *)sqlite3Malloc(nSpace);
70575 if( aSpace==0 ) return SQLITE_NOMEM;
70576 pSorter->aSpace = aSpace;
70577 pSorter->nSpace = nSpace;
70578 }
70579
70580 if( pKey2 ){
70581 /* This call cannot fail. As the memory is already allocated. */
70582 r2 = sqlite3VdbeRecordUnpack(pKeyInfo, nKey2, pKey2, aSpace, nSpace);
70583 assert( r2 && (r2->flags & UNPACKED_NEED_FREE)==0 );
70584 assert( r2==(UnpackedRecord*)aSpace );
70585 }else{
70586 r2 = (UnpackedRecord *)aSpace;
70587 assert( !bOmitRowid );
70588 }
70589
70590 if( bOmitRowid ){
70591 for(i=0; i<r2->nField-1; i++){
 
 
70592 if( r2->aMem[i].flags & MEM_Null ){
70593 *pRes = -1;
70594 return SQLITE_OK;
70595 }
70596 }
70597 r2->flags |= UNPACKED_PREFIX_MATCH;
70598 r2->nField--;
70599 assert( r2->nField>0 );
70600 }
70601
70602 *pRes = sqlite3VdbeRecordCompare(nKey1, pKey1, r2);
70603 return SQLITE_OK;
70604 }
70605
70606 /*
70607 ** This function is called to compare two iterator keys when merging
70608 ** multiple b-tree segments. Parameter iOut is the index of the aTree[]
@@ -70633,19 +70693,14 @@
70633 iRes = i2;
70634 }else if( p2->pFile==0 ){
70635 iRes = i1;
70636 }else{
70637 int res;
70638 int rc;
70639 assert( pCsr->pSorter->aSpace!=0 ); /* allocated in vdbeSorterMerge() */
70640 rc = vdbeSorterCompare(
70641 pCsr, 0, p1->aKey, p1->nKey, p2->aKey, p2->nKey, &res
70642 );
70643 /* The vdbeSorterCompare() call cannot fail since pCsr->pSorter->aSpace
70644 ** has already been allocated. */
70645 assert( rc==SQLITE_OK );
70646
70647 if( res<=0 ){
70648 iRes = i1;
70649 }else{
70650 iRes = i2;
70651 }
@@ -70660,16 +70715,21 @@
70660 */
70661 SQLITE_PRIVATE int sqlite3VdbeSorterInit(sqlite3 *db, VdbeCursor *pCsr){
70662 int pgsz; /* Page size of main database */
70663 int mxCache; /* Cache size */
70664 VdbeSorter *pSorter; /* The new sorter */
 
70665
70666 assert( pCsr->pKeyInfo && pCsr->pBt==0 );
70667 pCsr->pSorter = pSorter = sqlite3DbMallocZero(db, sizeof(VdbeSorter));
70668 if( pSorter==0 ){
70669 return SQLITE_NOMEM;
70670 }
 
 
 
 
70671
70672 if( !sqlite3TempInMemory(db) ){
70673 pgsz = sqlite3BtreeGetPageSize(db->aDb[0].pBt);
70674 pSorter->mnPmaSize = SORTER_MIN_WORKING * pgsz;
70675 mxCache = db->aDb[0].pSchema->cache_size;
@@ -70707,11 +70767,11 @@
70707 }
70708 if( pSorter->pTemp1 ){
70709 sqlite3OsCloseFree(pSorter->pTemp1);
70710 }
70711 vdbeSorterRecordFree(db, pSorter->pRecord);
70712 sqlite3_free(pSorter->aSpace);
70713 sqlite3DbFree(db, pSorter);
70714 pCsr->pSorter = 0;
70715 }
70716 }
70717
@@ -70728,36 +70788,26 @@
70728 SQLITE_OPEN_EXCLUSIVE | SQLITE_OPEN_DELETEONCLOSE, &dummy
70729 );
70730 }
70731
70732 /*
70733 ** Attemp to merge the two sorted lists p1 and p2 into a single list. If no
70734 ** error occurs set *ppOut to the head of the new list and return SQLITE_OK.
70735 */
70736 static int vdbeSorterMerge(
70737 sqlite3 *db, /* Database handle */
70738 VdbeCursor *pCsr, /* For pKeyInfo */
70739 SorterRecord *p1, /* First list to merge */
70740 SorterRecord *p2, /* Second list to merge */
70741 SorterRecord **ppOut /* OUT: Head of merged list */
70742 ){
70743 int rc = SQLITE_OK;
70744 SorterRecord *pFinal = 0;
70745 SorterRecord **pp = &pFinal;
70746 void *pVal2 = p2 ? p2->pVal : 0;
70747
70748 while( p1 && p2 ){
70749 int res;
70750 rc = vdbeSorterCompare(pCsr, 0, p1->pVal, p1->nVal, pVal2, p2->nVal, &res);
70751 if( rc!=SQLITE_OK ){
70752 *pp = 0;
70753 vdbeSorterRecordFree(db, p1);
70754 vdbeSorterRecordFree(db, p2);
70755 vdbeSorterRecordFree(db, pFinal);
70756 *ppOut = 0;
70757 return rc;
70758 }
70759 if( res<=0 ){
70760 *pp = p1;
70761 pp = &p1->pNext;
70762 p1 = p1->pNext;
70763 pVal2 = 0;
@@ -70768,22 +70818,19 @@
70768 if( p2==0 ) break;
70769 pVal2 = p2->pVal;
70770 }
70771 }
70772 *pp = p1 ? p1 : p2;
70773
70774 *ppOut = pFinal;
70775 return SQLITE_OK;
70776 }
70777
70778 /*
70779 ** Sort the linked list of records headed at pCsr->pRecord. Return SQLITE_OK
70780 ** if successful, or an SQLite error code (i.e. SQLITE_NOMEM) if an error
70781 ** occurs.
70782 */
70783 static int vdbeSorterSort(sqlite3 *db, VdbeCursor *pCsr){
70784 int rc = SQLITE_OK;
70785 int i;
70786 SorterRecord **aSlot;
70787 SorterRecord *p;
70788 VdbeSorter *pSorter = pCsr->pSorter;
70789
@@ -70794,34 +70841,26 @@
70794
70795 p = pSorter->pRecord;
70796 while( p ){
70797 SorterRecord *pNext = p->pNext;
70798 p->pNext = 0;
70799 for(i=0; rc==SQLITE_OK && aSlot[i]; i++){
70800 rc = vdbeSorterMerge(db, pCsr, p, aSlot[i], &p);
70801 aSlot[i] = 0;
70802 }
70803 if( rc!=SQLITE_OK ){
70804 vdbeSorterRecordFree(db, pNext);
70805 break;
70806 }
70807 aSlot[i] = p;
70808 p = pNext;
70809 }
70810
70811 p = 0;
70812 for(i=0; i<64; i++){
70813 if( rc==SQLITE_OK ){
70814 rc = vdbeSorterMerge(db, pCsr, p, aSlot[i], &p);
70815 }else{
70816 vdbeSorterRecordFree(db, aSlot[i]);
70817 }
70818 }
70819 pSorter->pRecord = p;
70820
70821 sqlite3_free(aSlot);
70822 return rc;
70823 }
70824
70825
70826 /*
70827 ** Write the current contents of the in-memory linked-list to a PMA. Return
@@ -70843,11 +70882,11 @@
70843 if( pSorter->nInMemory==0 ){
70844 assert( pSorter->pRecord==0 );
70845 return rc;
70846 }
70847
70848 rc = vdbeSorterSort(db, pCsr);
70849
70850 /* If the first temporary PMA file has not been opened, open it now. */
70851 if( rc==SQLITE_OK && pSorter->pTemp1==0 ){
70852 rc = vdbeSorterOpenTempFile(db, &pSorter->pTemp1);
70853 assert( rc!=SQLITE_OK || pSorter->pTemp1 );
@@ -70990,11 +71029,11 @@
70990 ** sort the VdbeSorter.pRecord list. The vdbe layer will read data directly
70991 ** from the in-memory list. */
70992 if( pSorter->nPMA==0 ){
70993 *pbEof = !pSorter->pRecord;
70994 assert( pSorter->aTree==0 );
70995 return vdbeSorterSort(db, pCsr);
70996 }
70997
70998 /* Write the current b-tree to a PMA. Close the b-tree cursor. */
70999 rc = vdbeSorterListToPMA(db, pCsr);
71000 if( rc!=SQLITE_OK ) return rc;
@@ -71160,24 +71199,23 @@
71160 SQLITE_PRIVATE int sqlite3VdbeSorterCompare(
71161 VdbeCursor *pCsr, /* Sorter cursor */
71162 Mem *pVal, /* Value to compare to current sorter key */
71163 int *pRes /* OUT: Result of comparison */
71164 ){
71165 int rc;
71166 VdbeSorter *pSorter = pCsr->pSorter;
71167 void *pKey; int nKey; /* Sorter key to compare pVal with */
71168
71169 pKey = vdbeSorterRowkey(pSorter, &nKey);
71170 rc = vdbeSorterCompare(pCsr, 1, pVal->z, pVal->n, pKey, nKey, pRes);
71171 assert( rc!=SQLITE_OK || pVal->db->mallocFailed || (*pRes)<=0 );
71172 return rc;
71173 }
71174
71175 #endif /* #ifndef SQLITE_OMIT_MERGE_SORT */
71176
71177 /************** End of vdbesort.c ********************************************/
71178 /************** Begin file journal.c *****************************************/
 
71179 /*
71180 ** 2007 August 22
71181 **
71182 ** The author disclaims copyright to this source code. In place of
71183 ** a legal notice, here is a blessing:
@@ -71414,10 +71452,11 @@
71414 }
71415 #endif
71416
71417 /************** End of journal.c *********************************************/
71418 /************** Begin file memjournal.c **************************************/
 
71419 /*
71420 ** 2008 October 7
71421 **
71422 ** The author disclaims copyright to this source code. In place of
71423 ** a legal notice, here is a blessing:
@@ -71675,10 +71714,11 @@
71675 return sizeof(MemJournal);
71676 }
71677
71678 /************** End of memjournal.c ******************************************/
71679 /************** Begin file walker.c ******************************************/
 
71680 /*
71681 ** 2008 August 16
71682 **
71683 ** The author disclaims copyright to this source code. In place of
71684 ** a legal notice, here is a blessing:
@@ -71813,10 +71853,11 @@
71813 return rc & WRC_Abort;
71814 }
71815
71816 /************** End of walker.c **********************************************/
71817 /************** Begin file resolve.c *****************************************/
 
71818 /*
71819 ** 2008 August 18
71820 **
71821 ** The author disclaims copyright to this source code. In place of
71822 ** a legal notice, here is a blessing:
@@ -73033,10 +73074,11 @@
73033 sqlite3WalkSelect(&w, p);
73034 }
73035
73036 /************** End of resolve.c *********************************************/
73037 /************** Begin file expr.c ********************************************/
 
73038 /*
73039 ** 2001 September 15
73040 **
73041 ** The author disclaims copyright to this source code. In place of
73042 ** a legal notice, here is a blessing:
@@ -76793,10 +76835,11 @@
76793 }
76794 }
76795
76796 /************** End of expr.c ************************************************/
76797 /************** Begin file alter.c *******************************************/
 
76798 /*
76799 ** 2005 February 15
76800 **
76801 ** The author disclaims copyright to this source code. In place of
76802 ** a legal notice, here is a blessing:
@@ -77621,10 +77664,11 @@
77621 }
77622 #endif /* SQLITE_ALTER_TABLE */
77623
77624 /************** End of alter.c ***********************************************/
77625 /************** Begin file analyze.c *****************************************/
 
77626 /*
77627 ** 2005 July 8
77628 **
77629 ** The author disclaims copyright to this source code. In place of
77630 ** a legal notice, here is a blessing:
@@ -78342,10 +78386,11 @@
78342
78343 #endif /* SQLITE_OMIT_ANALYZE */
78344
78345 /************** End of analyze.c *********************************************/
78346 /************** Begin file attach.c ******************************************/
 
78347 /*
78348 ** 2003 April 6
78349 **
78350 ** The author disclaims copyright to this source code. In place of
78351 ** a legal notice, here is a blessing:
@@ -78901,10 +78946,11 @@
78901 }
78902 #endif
78903
78904 /************** End of attach.c **********************************************/
78905 /************** Begin file auth.c ********************************************/
 
78906 /*
78907 ** 2003 January 11
78908 **
78909 ** The author disclaims copyright to this source code. In place of
78910 ** a legal notice, here is a blessing:
@@ -79152,10 +79198,11 @@
79152
79153 #endif /* SQLITE_OMIT_AUTHORIZATION */
79154
79155 /************** End of auth.c ************************************************/
79156 /************** Begin file build.c *******************************************/
 
79157 /*
79158 ** 2001 September 15
79159 **
79160 ** The author disclaims copyright to this source code. In place of
79161 ** a legal notice, here is a blessing:
@@ -82955,10 +83002,11 @@
82955 return pKey;
82956 }
82957
82958 /************** End of build.c ***********************************************/
82959 /************** Begin file callback.c ****************************************/
 
82960 /*
82961 ** 2005 May 23
82962 **
82963 ** The author disclaims copyright to this source code. In place of
82964 ** a legal notice, here is a blessing:
@@ -83414,10 +83462,11 @@
83414 return p;
83415 }
83416
83417 /************** End of callback.c ********************************************/
83418 /************** Begin file delete.c ******************************************/
 
83419 /*
83420 ** 2001 September 15
83421 **
83422 ** The author disclaims copyright to this source code. In place of
83423 ** a legal notice, here is a blessing:
@@ -84068,10 +84117,11 @@
84068 return regBase;
84069 }
84070
84071 /************** End of delete.c **********************************************/
84072 /************** Begin file func.c ********************************************/
 
84073 /*
84074 ** 2002 February 23
84075 **
84076 ** The author disclaims copyright to this source code. In place of
84077 ** a legal notice, here is a blessing:
@@ -85676,10 +85726,11 @@
85676 #endif
85677 }
85678
85679 /************** End of func.c ************************************************/
85680 /************** Begin file fkey.c ********************************************/
 
85681 /*
85682 **
85683 ** The author disclaims copyright to this source code. In place of
85684 ** a legal notice, here is a blessing:
85685 **
@@ -86896,10 +86947,11 @@
86896 }
86897 #endif /* ifndef SQLITE_OMIT_FOREIGN_KEY */
86898
86899 /************** End of fkey.c ************************************************/
86900 /************** Begin file insert.c ******************************************/
 
86901 /*
86902 ** 2001 September 15
86903 **
86904 ** The author disclaims copyright to this source code. In place of
86905 ** a legal notice, here is a blessing:
@@ -88741,10 +88793,11 @@
88741 }
88742 #endif /* SQLITE_OMIT_XFER_OPT */
88743
88744 /************** End of insert.c **********************************************/
88745 /************** Begin file legacy.c ******************************************/
 
88746 /*
88747 ** 2001 September 15
88748 **
88749 ** The author disclaims copyright to this source code. In place of
88750 ** a legal notice, here is a blessing:
@@ -88888,10 +88941,11 @@
88888 return rc;
88889 }
88890
88891 /************** End of legacy.c **********************************************/
88892 /************** Begin file loadext.c *****************************************/
 
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:
@@ -88908,10 +88962,11 @@
88908 #ifndef SQLITE_CORE
88909 #define SQLITE_CORE 1 /* Disable the API redefinition in sqlite3ext.h */
88910 #endif
88911 /************** Include sqlite3ext.h in the middle of loadext.c **************/
88912 /************** Begin file sqlite3ext.h **************************************/
 
88913 /*
88914 ** 2006 June 7
88915 **
88916 ** The author disclaims copyright to this source code. In place of
88917 ** a legal notice, here is a blessing:
@@ -89336,10 +89391,11 @@
89336
89337 #endif /* _SQLITE3EXT_H_ */
89338
89339 /************** End of sqlite3ext.h ******************************************/
89340 /************** Continuing where we left off in loadext.c ********************/
 
89341 /* #include <string.h> */
89342
89343 #ifndef SQLITE_OMIT_LOAD_EXTENSION
89344
89345 /*
@@ -89975,10 +90031,11 @@
89975 }
89976 }
89977
89978 /************** End of loadext.c *********************************************/
89979 /************** Begin file pragma.c ******************************************/
 
89980 /*
89981 ** 2003 April 6
89982 **
89983 ** The author disclaims copyright to this source code. In place of
89984 ** a legal notice, here is a blessing:
@@ -91503,10 +91560,11 @@
91503
91504 #endif /* SQLITE_OMIT_PRAGMA */
91505
91506 /************** End of pragma.c **********************************************/
91507 /************** Begin file prepare.c *****************************************/
 
91508 /*
91509 ** 2005 May 25
91510 **
91511 ** The author disclaims copyright to this source code. In place of
91512 ** a legal notice, here is a blessing:
@@ -92363,10 +92421,11 @@
92363
92364 #endif /* SQLITE_OMIT_UTF16 */
92365
92366 /************** End of prepare.c *********************************************/
92367 /************** Begin file select.c ******************************************/
 
92368 /*
92369 ** 2001 September 15
92370 **
92371 ** The author disclaims copyright to this source code. In place of
92372 ** a legal notice, here is a blessing:
@@ -96922,10 +96981,11 @@
96922 *****************************************************************************/
96923 #endif /* defined(SQLITE_TEST) || defined(SQLITE_DEBUG) */
96924
96925 /************** End of select.c **********************************************/
96926 /************** Begin file table.c *******************************************/
 
96927 /*
96928 ** 2001 September 15
96929 **
96930 ** The author disclaims copyright to this source code. In place of
96931 ** a legal notice, here is a blessing:
@@ -97121,10 +97181,11 @@
97121
97122 #endif /* SQLITE_OMIT_GET_TABLE */
97123
97124 /************** End of table.c ***********************************************/
97125 /************** Begin file trigger.c *****************************************/
 
97126 /*
97127 **
97128 ** The author disclaims copyright to this source code. In place of
97129 ** a legal notice, here is a blessing:
97130 **
@@ -98246,10 +98307,11 @@
98246
98247 #endif /* !defined(SQLITE_OMIT_TRIGGER) */
98248
98249 /************** End of trigger.c *********************************************/
98250 /************** Begin file update.c ******************************************/
 
98251 /*
98252 ** 2001 September 15
98253 **
98254 ** The author disclaims copyright to this source code. In place of
98255 ** a legal notice, here is a blessing:
@@ -98918,10 +98980,11 @@
98918 }
98919 #endif /* SQLITE_OMIT_VIRTUALTABLE */
98920
98921 /************** End of update.c **********************************************/
98922 /************** Begin file vacuum.c ******************************************/
 
98923 /*
98924 ** 2003 April 6
98925 **
98926 ** The author disclaims copyright to this source code. In place of
98927 ** a legal notice, here is a blessing:
@@ -99264,10 +99327,11 @@
99264
99265 #endif /* SQLITE_OMIT_VACUUM && SQLITE_OMIT_ATTACH */
99266
99267 /************** End of vacuum.c **********************************************/
99268 /************** Begin file vtab.c ********************************************/
 
99269 /*
99270 ** 2006 June 10
99271 **
99272 ** The author disclaims copyright to this source code. In place of
99273 ** a legal notice, here is a blessing:
@@ -100332,10 +100396,11 @@
100332
100333 #endif /* SQLITE_OMIT_VIRTUALTABLE */
100334
100335 /************** End of vtab.c ************************************************/
100336 /************** Begin file where.c *******************************************/
 
100337 /*
100338 ** 2001 September 15
100339 **
100340 ** The author disclaims copyright to this source code. In place of
100341 ** a legal notice, here is a blessing:
@@ -105518,10 +105583,11 @@
105518 return;
105519 }
105520
105521 /************** End of where.c ***********************************************/
105522 /************** Begin file parse.c *******************************************/
 
105523 /* Driver template for the LEMON parser generator.
105524 ** The author disclaims copyright to this source code.
105525 **
105526 ** This version of "lempar.c" is modified, slightly, for use by SQLite.
105527 ** The only modifications are the addition of a couple of NEVER()
@@ -105530,10 +105596,11 @@
105530 ** specific grammar used by SQLite.
105531 */
105532 /* First off, code is included that follows the "include" declaration
105533 ** in the input grammar file. */
105534 /* #include <stdio.h> */
 
105535
105536
105537 /*
105538 ** Disable all error recovery processing in the parser push-down
105539 ** automaton.
@@ -105577,10 +105644,11 @@
105577 /*
105578 ** An instance of this structure holds the ATTACH key and the key type.
105579 */
105580 struct AttachKey { int type; Token key; };
105581
 
105582
105583 /* This is a utility routine used to set the ExprSpan.zStart and
105584 ** ExprSpan.zEnd values of pOut so that the span covers the complete
105585 ** range of text beginning with pStart and going to the end of pEnd.
105586 */
@@ -105596,10 +105664,11 @@
105596 static void spanExpr(ExprSpan *pOut, Parse *pParse, int op, Token *pValue){
105597 pOut->pExpr = sqlite3PExpr(pParse, op, 0, 0, pValue);
105598 pOut->zStart = pValue->z;
105599 pOut->zEnd = &pValue->z[pValue->n];
105600 }
 
105601
105602 /* This routine constructs a binary expression node out of two ExprSpan
105603 ** objects and uses the result to populate a new ExprSpan object.
105604 */
105605 static void spanBinaryExpr(
@@ -105611,10 +105680,11 @@
105611 ){
105612 pOut->pExpr = sqlite3PExpr(pParse, op, pLeft->pExpr, pRight->pExpr, 0);
105613 pOut->zStart = pLeft->zStart;
105614 pOut->zEnd = pRight->zEnd;
105615 }
 
105616
105617 /* Construct an expression node for a unary postfix operator
105618 */
105619 static void spanUnaryPostfix(
105620 ExprSpan *pOut, /* Write the new expression node here */
@@ -105625,10 +105695,11 @@
105625 ){
105626 pOut->pExpr = sqlite3PExpr(pParse, op, pOperand->pExpr, 0, 0);
105627 pOut->zStart = pOperand->zStart;
105628 pOut->zEnd = &pPostOp->z[pPostOp->n];
105629 }
 
105630
105631 /* A routine to convert a binary TK_IS or TK_ISNOT expression into a
105632 ** unary TK_ISNULL or TK_NOTNULL expression. */
105633 static void binaryToUnaryIfNull(Parse *pParse, Expr *pY, Expr *pA, int op){
105634 sqlite3 *db = pParse->db;
@@ -105636,10 +105707,11 @@
105636 pA->op = (u8)op;
105637 sqlite3ExprDelete(db, pA->pRight);
105638 pA->pRight = 0;
105639 }
105640 }
 
105641
105642 /* Construct an expression node for a unary prefix operator
105643 */
105644 static void spanUnaryPrefix(
105645 ExprSpan *pOut, /* Write the new expression node here */
@@ -105650,10 +105722,11 @@
105650 ){
105651 pOut->pExpr = sqlite3PExpr(pParse, op, pOperand->pExpr, 0, 0);
105652 pOut->zStart = pPreOp->z;
105653 pOut->zEnd = pOperand->zEnd;
105654 }
 
105655 /* Next is all token values, in a form suitable for use by makeheaders.
105656 ** This section will be null unless lemon is run with the -m switch.
105657 */
105658 /*
105659 ** These constants (all generated automatically by the parser generator)
@@ -106905,17 +106978,21 @@
106905 ** inside the C code.
106906 */
106907 case 160: /* select */
106908 case 194: /* oneselect */
106909 {
 
106910 sqlite3SelectDelete(pParse->db, (yypminor->yy387));
 
106911 }
106912 break;
106913 case 174: /* term */
106914 case 175: /* expr */
106915 {
 
106916 sqlite3ExprDelete(pParse->db, (yypminor->yy118).pExpr);
 
106917 }
106918 break;
106919 case 179: /* idxlist_opt */
106920 case 187: /* idxlist */
106921 case 197: /* selcollist */
@@ -106927,19 +107004,23 @@
106927 case 217: /* setlist */
106928 case 220: /* itemlist */
106929 case 221: /* exprlist */
106930 case 226: /* case_exprlist */
106931 {
 
106932 sqlite3ExprListDelete(pParse->db, (yypminor->yy322));
 
106933 }
106934 break;
106935 case 193: /* fullname */
106936 case 198: /* from */
106937 case 206: /* seltablist */
106938 case 207: /* stl_prefix */
106939 {
 
106940 sqlite3SrcListDelete(pParse->db, (yypminor->yy259));
 
106941 }
106942 break;
106943 case 199: /* where_opt */
106944 case 201: /* having_opt */
106945 case 210: /* on_opt */
@@ -106947,29 +107028,37 @@
106947 case 225: /* case_operand */
106948 case 227: /* case_else */
106949 case 238: /* when_clause */
106950 case 243: /* key_opt */
106951 {
 
106952 sqlite3ExprDelete(pParse->db, (yypminor->yy314));
 
106953 }
106954 break;
106955 case 211: /* using_opt */
106956 case 213: /* inscollist */
106957 case 219: /* inscollist_opt */
106958 {
 
106959 sqlite3IdListDelete(pParse->db, (yypminor->yy384));
 
106960 }
106961 break;
106962 case 234: /* trigger_cmd_list */
106963 case 239: /* trigger_cmd */
106964 {
 
106965 sqlite3DeleteTriggerStep(pParse->db, (yypminor->yy203));
 
106966 }
106967 break;
106968 case 236: /* trigger_event */
106969 {
 
106970 sqlite3IdListDelete(pParse->db, (yypminor->yy90).b);
 
106971 }
106972 break;
106973 default: break; /* If no destructor action specified: do nothing */
106974 }
106975 }
@@ -107151,14 +107240,16 @@
107151 }
107152 #endif
107153 while( yypParser->yyidx>=0 ) yy_pop_parser_stack(yypParser);
107154 /* Here code is inserted which will execute if the parser
107155 ** stack every overflows */
 
107156
107157 UNUSED_PARAMETER(yypMinor); /* Silence some compiler warnings */
107158 sqlite3ErrorMsg(pParse, "parser stack overflow");
107159 pParse->parseError = 1;
 
107160 sqlite3ParserARG_STORE; /* Suppress warning about unused %extra_argument var */
107161 }
107162
107163 /*
107164 ** Perform a shift action.
@@ -107595,66 +107686,94 @@
107595 ** { ... } // User supplied code
107596 ** #line <lineno> <thisfile>
107597 ** break;
107598 */
107599 case 5: /* explain ::= */
 
107600 { sqlite3BeginParse(pParse, 0); }
 
107601 break;
107602 case 6: /* explain ::= EXPLAIN */
 
107603 { sqlite3BeginParse(pParse, 1); }
 
107604 break;
107605 case 7: /* explain ::= EXPLAIN QUERY PLAN */
 
107606 { sqlite3BeginParse(pParse, 2); }
 
107607 break;
107608 case 8: /* cmdx ::= cmd */
 
107609 { sqlite3FinishCoding(pParse); }
 
107610 break;
107611 case 9: /* cmd ::= BEGIN transtype trans_opt */
 
107612 {sqlite3BeginTransaction(pParse, yymsp[-1].minor.yy4);}
 
107613 break;
107614 case 13: /* transtype ::= */
 
107615 {yygotominor.yy4 = TK_DEFERRED;}
 
107616 break;
107617 case 14: /* transtype ::= DEFERRED */
107618 case 15: /* transtype ::= IMMEDIATE */ yytestcase(yyruleno==15);
107619 case 16: /* transtype ::= EXCLUSIVE */ yytestcase(yyruleno==16);
107620 case 115: /* multiselect_op ::= UNION */ yytestcase(yyruleno==115);
107621 case 117: /* multiselect_op ::= EXCEPT|INTERSECT */ yytestcase(yyruleno==117);
 
107622 {yygotominor.yy4 = yymsp[0].major;}
 
107623 break;
107624 case 17: /* cmd ::= COMMIT trans_opt */
107625 case 18: /* cmd ::= END trans_opt */ yytestcase(yyruleno==18);
 
107626 {sqlite3CommitTransaction(pParse);}
 
107627 break;
107628 case 19: /* cmd ::= ROLLBACK trans_opt */
 
107629 {sqlite3RollbackTransaction(pParse);}
 
107630 break;
107631 case 22: /* cmd ::= SAVEPOINT nm */
 
107632 {
107633 sqlite3Savepoint(pParse, SAVEPOINT_BEGIN, &yymsp[0].minor.yy0);
107634 }
 
107635 break;
107636 case 23: /* cmd ::= RELEASE savepoint_opt nm */
 
107637 {
107638 sqlite3Savepoint(pParse, SAVEPOINT_RELEASE, &yymsp[0].minor.yy0);
107639 }
 
107640 break;
107641 case 24: /* cmd ::= ROLLBACK trans_opt TO savepoint_opt nm */
 
107642 {
107643 sqlite3Savepoint(pParse, SAVEPOINT_ROLLBACK, &yymsp[0].minor.yy0);
107644 }
 
107645 break;
107646 case 26: /* create_table ::= createkw temp TABLE ifnotexists nm dbnm */
 
107647 {
107648 sqlite3StartTable(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,yymsp[-4].minor.yy4,0,0,yymsp[-2].minor.yy4);
107649 }
 
107650 break;
107651 case 27: /* createkw ::= CREATE */
 
107652 {
107653 pParse->db->lookaside.bEnabled = 0;
107654 yygotominor.yy0 = yymsp[0].minor.yy0;
107655 }
 
107656 break;
107657 case 28: /* ifnotexists ::= */
107658 case 31: /* temp ::= */ yytestcase(yyruleno==31);
107659 case 70: /* autoinc ::= */ yytestcase(yyruleno==70);
107660 case 83: /* defer_subclause ::= NOT DEFERRABLE init_deferred_pred_opt */ yytestcase(yyruleno==83);
@@ -107664,44 +107783,56 @@
107664 case 109: /* ifexists ::= */ yytestcase(yyruleno==109);
107665 case 120: /* distinct ::= ALL */ yytestcase(yyruleno==120);
107666 case 121: /* distinct ::= */ yytestcase(yyruleno==121);
107667 case 222: /* between_op ::= BETWEEN */ yytestcase(yyruleno==222);
107668 case 225: /* in_op ::= IN */ yytestcase(yyruleno==225);
 
107669 {yygotominor.yy4 = 0;}
 
107670 break;
107671 case 29: /* ifnotexists ::= IF NOT EXISTS */
107672 case 30: /* temp ::= TEMP */ yytestcase(yyruleno==30);
107673 case 71: /* autoinc ::= AUTOINCR */ yytestcase(yyruleno==71);
107674 case 86: /* init_deferred_pred_opt ::= INITIALLY DEFERRED */ yytestcase(yyruleno==86);
107675 case 108: /* ifexists ::= IF EXISTS */ yytestcase(yyruleno==108);
107676 case 119: /* distinct ::= DISTINCT */ yytestcase(yyruleno==119);
107677 case 223: /* between_op ::= NOT BETWEEN */ yytestcase(yyruleno==223);
107678 case 226: /* in_op ::= NOT IN */ yytestcase(yyruleno==226);
 
107679 {yygotominor.yy4 = 1;}
 
107680 break;
107681 case 32: /* create_table_args ::= LP columnlist conslist_opt RP */
 
107682 {
107683 sqlite3EndTable(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,0);
107684 }
 
107685 break;
107686 case 33: /* create_table_args ::= AS select */
 
107687 {
107688 sqlite3EndTable(pParse,0,0,yymsp[0].minor.yy387);
107689 sqlite3SelectDelete(pParse->db, yymsp[0].minor.yy387);
107690 }
 
107691 break;
107692 case 36: /* column ::= columnid type carglist */
 
107693 {
107694 yygotominor.yy0.z = yymsp[-2].minor.yy0.z;
107695 yygotominor.yy0.n = (int)(pParse->sLastToken.z-yymsp[-2].minor.yy0.z) + pParse->sLastToken.n;
107696 }
 
107697 break;
107698 case 37: /* columnid ::= nm */
 
107699 {
107700 sqlite3AddColumn(pParse,&yymsp[0].minor.yy0);
107701 yygotominor.yy0 = yymsp[0].minor.yy0;
107702 }
 
107703 break;
107704 case 38: /* id ::= ID */
107705 case 39: /* id ::= INDEXED */ yytestcase(yyruleno==39);
107706 case 40: /* ids ::= ID|STRING */ yytestcase(yyruleno==40);
107707 case 41: /* nm ::= id */ yytestcase(yyruleno==41);
@@ -107721,256 +107852,373 @@
107721 case 264: /* nmnum ::= DEFAULT */ yytestcase(yyruleno==264);
107722 case 265: /* plus_num ::= plus_opt number */ yytestcase(yyruleno==265);
107723 case 266: /* minus_num ::= MINUS number */ yytestcase(yyruleno==266);
107724 case 267: /* number ::= INTEGER|FLOAT */ yytestcase(yyruleno==267);
107725 case 285: /* trnm ::= nm */ yytestcase(yyruleno==285);
 
107726 {yygotominor.yy0 = yymsp[0].minor.yy0;}
 
107727 break;
107728 case 45: /* type ::= typetoken */
 
107729 {sqlite3AddColumnType(pParse,&yymsp[0].minor.yy0);}
 
107730 break;
107731 case 47: /* typetoken ::= typename LP signed RP */
 
107732 {
107733 yygotominor.yy0.z = yymsp[-3].minor.yy0.z;
107734 yygotominor.yy0.n = (int)(&yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n] - yymsp[-3].minor.yy0.z);
107735 }
 
107736 break;
107737 case 48: /* typetoken ::= typename LP signed COMMA signed RP */
 
107738 {
107739 yygotominor.yy0.z = yymsp[-5].minor.yy0.z;
107740 yygotominor.yy0.n = (int)(&yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n] - yymsp[-5].minor.yy0.z);
107741 }
 
107742 break;
107743 case 50: /* typename ::= typename ids */
 
107744 {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);}
 
107745 break;
107746 case 57: /* ccons ::= DEFAULT term */
107747 case 59: /* ccons ::= DEFAULT PLUS term */ yytestcase(yyruleno==59);
 
107748 {sqlite3AddDefaultValue(pParse,&yymsp[0].minor.yy118);}
 
107749 break;
107750 case 58: /* ccons ::= DEFAULT LP expr RP */
 
107751 {sqlite3AddDefaultValue(pParse,&yymsp[-1].minor.yy118);}
 
107752 break;
107753 case 60: /* ccons ::= DEFAULT MINUS term */
 
107754 {
107755 ExprSpan v;
107756 v.pExpr = sqlite3PExpr(pParse, TK_UMINUS, yymsp[0].minor.yy118.pExpr, 0, 0);
107757 v.zStart = yymsp[-1].minor.yy0.z;
107758 v.zEnd = yymsp[0].minor.yy118.zEnd;
107759 sqlite3AddDefaultValue(pParse,&v);
107760 }
 
107761 break;
107762 case 61: /* ccons ::= DEFAULT id */
 
107763 {
107764 ExprSpan v;
107765 spanExpr(&v, pParse, TK_STRING, &yymsp[0].minor.yy0);
107766 sqlite3AddDefaultValue(pParse,&v);
107767 }
 
107768 break;
107769 case 63: /* ccons ::= NOT NULL onconf */
 
107770 {sqlite3AddNotNull(pParse, yymsp[0].minor.yy4);}
 
107771 break;
107772 case 64: /* ccons ::= PRIMARY KEY sortorder onconf autoinc */
 
107773 {sqlite3AddPrimaryKey(pParse,0,yymsp[-1].minor.yy4,yymsp[0].minor.yy4,yymsp[-2].minor.yy4);}
 
107774 break;
107775 case 65: /* ccons ::= UNIQUE onconf */
 
107776 {sqlite3CreateIndex(pParse,0,0,0,0,yymsp[0].minor.yy4,0,0,0,0);}
 
107777 break;
107778 case 66: /* ccons ::= CHECK LP expr RP */
 
107779 {sqlite3AddCheckConstraint(pParse,yymsp[-1].minor.yy118.pExpr);}
 
107780 break;
107781 case 67: /* ccons ::= REFERENCES nm idxlist_opt refargs */
 
107782 {sqlite3CreateForeignKey(pParse,0,&yymsp[-2].minor.yy0,yymsp[-1].minor.yy322,yymsp[0].minor.yy4);}
 
107783 break;
107784 case 68: /* ccons ::= defer_subclause */
 
107785 {sqlite3DeferForeignKey(pParse,yymsp[0].minor.yy4);}
 
107786 break;
107787 case 69: /* ccons ::= COLLATE ids */
 
107788 {sqlite3AddCollateType(pParse, &yymsp[0].minor.yy0);}
 
107789 break;
107790 case 72: /* refargs ::= */
 
107791 { yygotominor.yy4 = OE_None*0x0101; /* EV: R-19803-45884 */}
 
107792 break;
107793 case 73: /* refargs ::= refargs refarg */
 
107794 { yygotominor.yy4 = (yymsp[-1].minor.yy4 & ~yymsp[0].minor.yy215.mask) | yymsp[0].minor.yy215.value; }
 
107795 break;
107796 case 74: /* refarg ::= MATCH nm */
107797 case 75: /* refarg ::= ON INSERT refact */ yytestcase(yyruleno==75);
 
107798 { yygotominor.yy215.value = 0; yygotominor.yy215.mask = 0x000000; }
 
107799 break;
107800 case 76: /* refarg ::= ON DELETE refact */
 
107801 { yygotominor.yy215.value = yymsp[0].minor.yy4; yygotominor.yy215.mask = 0x0000ff; }
 
107802 break;
107803 case 77: /* refarg ::= ON UPDATE refact */
 
107804 { yygotominor.yy215.value = yymsp[0].minor.yy4<<8; yygotominor.yy215.mask = 0x00ff00; }
 
107805 break;
107806 case 78: /* refact ::= SET NULL */
 
107807 { yygotominor.yy4 = OE_SetNull; /* EV: R-33326-45252 */}
 
107808 break;
107809 case 79: /* refact ::= SET DEFAULT */
 
107810 { yygotominor.yy4 = OE_SetDflt; /* EV: R-33326-45252 */}
 
107811 break;
107812 case 80: /* refact ::= CASCADE */
 
107813 { yygotominor.yy4 = OE_Cascade; /* EV: R-33326-45252 */}
 
107814 break;
107815 case 81: /* refact ::= RESTRICT */
 
107816 { yygotominor.yy4 = OE_Restrict; /* EV: R-33326-45252 */}
 
107817 break;
107818 case 82: /* refact ::= NO ACTION */
 
107819 { yygotominor.yy4 = OE_None; /* EV: R-33326-45252 */}
 
107820 break;
107821 case 84: /* defer_subclause ::= DEFERRABLE init_deferred_pred_opt */
107822 case 99: /* defer_subclause_opt ::= defer_subclause */ yytestcase(yyruleno==99);
107823 case 101: /* onconf ::= ON CONFLICT resolvetype */ yytestcase(yyruleno==101);
107824 case 104: /* resolvetype ::= raisetype */ yytestcase(yyruleno==104);
 
107825 {yygotominor.yy4 = yymsp[0].minor.yy4;}
 
107826 break;
107827 case 88: /* conslist_opt ::= */
 
107828 {yygotominor.yy0.n = 0; yygotominor.yy0.z = 0;}
 
107829 break;
107830 case 89: /* conslist_opt ::= COMMA conslist */
 
107831 {yygotominor.yy0 = yymsp[-1].minor.yy0;}
 
107832 break;
107833 case 94: /* tcons ::= PRIMARY KEY LP idxlist autoinc RP onconf */
 
107834 {sqlite3AddPrimaryKey(pParse,yymsp[-3].minor.yy322,yymsp[0].minor.yy4,yymsp[-2].minor.yy4,0);}
 
107835 break;
107836 case 95: /* tcons ::= UNIQUE LP idxlist RP onconf */
 
107837 {sqlite3CreateIndex(pParse,0,0,0,yymsp[-2].minor.yy322,yymsp[0].minor.yy4,0,0,0,0);}
 
107838 break;
107839 case 96: /* tcons ::= CHECK LP expr RP onconf */
 
107840 {sqlite3AddCheckConstraint(pParse,yymsp[-2].minor.yy118.pExpr);}
 
107841 break;
107842 case 97: /* tcons ::= FOREIGN KEY LP idxlist RP REFERENCES nm idxlist_opt refargs defer_subclause_opt */
 
107843 {
107844 sqlite3CreateForeignKey(pParse, yymsp[-6].minor.yy322, &yymsp[-3].minor.yy0, yymsp[-2].minor.yy322, yymsp[-1].minor.yy4);
107845 sqlite3DeferForeignKey(pParse, yymsp[0].minor.yy4);
107846 }
 
107847 break;
107848 case 100: /* onconf ::= */
 
107849 {yygotominor.yy4 = OE_Default;}
 
107850 break;
107851 case 102: /* orconf ::= */
 
107852 {yygotominor.yy210 = OE_Default;}
 
107853 break;
107854 case 103: /* orconf ::= OR resolvetype */
 
107855 {yygotominor.yy210 = (u8)yymsp[0].minor.yy4;}
 
107856 break;
107857 case 105: /* resolvetype ::= IGNORE */
 
107858 {yygotominor.yy4 = OE_Ignore;}
 
107859 break;
107860 case 106: /* resolvetype ::= REPLACE */
 
107861 {yygotominor.yy4 = OE_Replace;}
 
107862 break;
107863 case 107: /* cmd ::= DROP TABLE ifexists fullname */
 
107864 {
107865 sqlite3DropTable(pParse, yymsp[0].minor.yy259, 0, yymsp[-1].minor.yy4);
107866 }
 
107867 break;
107868 case 110: /* cmd ::= createkw temp VIEW ifnotexists nm dbnm AS select */
 
107869 {
107870 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);
107871 }
 
107872 break;
107873 case 111: /* cmd ::= DROP VIEW ifexists fullname */
 
107874 {
107875 sqlite3DropTable(pParse, yymsp[0].minor.yy259, 1, yymsp[-1].minor.yy4);
107876 }
 
107877 break;
107878 case 112: /* cmd ::= select */
 
107879 {
107880 SelectDest dest = {SRT_Output, 0, 0, 0, 0};
107881 sqlite3Select(pParse, yymsp[0].minor.yy387, &dest);
107882 sqlite3SelectDelete(pParse->db, yymsp[0].minor.yy387);
107883 }
 
107884 break;
107885 case 113: /* select ::= oneselect */
 
107886 {yygotominor.yy387 = yymsp[0].minor.yy387;}
 
107887 break;
107888 case 114: /* select ::= select multiselect_op oneselect */
 
107889 {
107890 if( yymsp[0].minor.yy387 ){
107891 yymsp[0].minor.yy387->op = (u8)yymsp[-1].minor.yy4;
107892 yymsp[0].minor.yy387->pPrior = yymsp[-2].minor.yy387;
107893 }else{
107894 sqlite3SelectDelete(pParse->db, yymsp[-2].minor.yy387);
107895 }
107896 yygotominor.yy387 = yymsp[0].minor.yy387;
107897 }
 
107898 break;
107899 case 116: /* multiselect_op ::= UNION ALL */
 
107900 {yygotominor.yy4 = TK_ALL;}
 
107901 break;
107902 case 118: /* oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt orderby_opt limit_opt */
 
107903 {
107904 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);
107905 }
 
107906 break;
107907 case 122: /* sclp ::= selcollist COMMA */
107908 case 247: /* idxlist_opt ::= LP idxlist RP */ yytestcase(yyruleno==247);
 
107909 {yygotominor.yy322 = yymsp[-1].minor.yy322;}
 
107910 break;
107911 case 123: /* sclp ::= */
107912 case 151: /* orderby_opt ::= */ yytestcase(yyruleno==151);
107913 case 159: /* groupby_opt ::= */ yytestcase(yyruleno==159);
107914 case 240: /* exprlist ::= */ yytestcase(yyruleno==240);
107915 case 246: /* idxlist_opt ::= */ yytestcase(yyruleno==246);
 
107916 {yygotominor.yy322 = 0;}
 
107917 break;
107918 case 124: /* selcollist ::= sclp expr as */
 
107919 {
107920 yygotominor.yy322 = sqlite3ExprListAppend(pParse, yymsp[-2].minor.yy322, yymsp[-1].minor.yy118.pExpr);
107921 if( yymsp[0].minor.yy0.n>0 ) sqlite3ExprListSetName(pParse, yygotominor.yy322, &yymsp[0].minor.yy0, 1);
107922 sqlite3ExprListSetSpan(pParse,yygotominor.yy322,&yymsp[-1].minor.yy118);
107923 }
 
107924 break;
107925 case 125: /* selcollist ::= sclp STAR */
 
107926 {
107927 Expr *p = sqlite3Expr(pParse->db, TK_ALL, 0);
107928 yygotominor.yy322 = sqlite3ExprListAppend(pParse, yymsp[-1].minor.yy322, p);
107929 }
 
107930 break;
107931 case 126: /* selcollist ::= sclp nm DOT STAR */
 
107932 {
107933 Expr *pRight = sqlite3PExpr(pParse, TK_ALL, 0, 0, &yymsp[0].minor.yy0);
107934 Expr *pLeft = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-2].minor.yy0);
107935 Expr *pDot = sqlite3PExpr(pParse, TK_DOT, pLeft, pRight, 0);
107936 yygotominor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-3].minor.yy322, pDot);
107937 }
 
107938 break;
107939 case 129: /* as ::= */
 
107940 {yygotominor.yy0.n = 0;}
 
107941 break;
107942 case 130: /* from ::= */
 
107943 {yygotominor.yy259 = sqlite3DbMallocZero(pParse->db, sizeof(*yygotominor.yy259));}
 
107944 break;
107945 case 131: /* from ::= FROM seltablist */
 
107946 {
107947 yygotominor.yy259 = yymsp[0].minor.yy259;
107948 sqlite3SrcListShiftJoinType(yygotominor.yy259);
107949 }
 
107950 break;
107951 case 132: /* stl_prefix ::= seltablist joinop */
 
107952 {
107953 yygotominor.yy259 = yymsp[-1].minor.yy259;
107954 if( ALWAYS(yygotominor.yy259 && yygotominor.yy259->nSrc>0) ) yygotominor.yy259->a[yygotominor.yy259->nSrc-1].jointype = (u8)yymsp[0].minor.yy4;
107955 }
 
107956 break;
107957 case 133: /* stl_prefix ::= */
 
107958 {yygotominor.yy259 = 0;}
 
107959 break;
107960 case 134: /* seltablist ::= stl_prefix nm dbnm as indexed_opt on_opt using_opt */
 
107961 {
107962 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);
107963 sqlite3SrcListIndexedBy(pParse, yygotominor.yy259, &yymsp[-2].minor.yy0);
107964 }
 
107965 break;
107966 case 135: /* seltablist ::= stl_prefix LP select RP as on_opt using_opt */
 
107967 {
107968 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);
107969 }
 
107970 break;
107971 case 136: /* seltablist ::= stl_prefix LP seltablist RP as on_opt using_opt */
 
107972 {
107973 if( yymsp[-6].minor.yy259==0 && yymsp[-2].minor.yy0.n==0 && yymsp[-1].minor.yy314==0 && yymsp[0].minor.yy384==0 ){
107974 yygotominor.yy259 = yymsp[-4].minor.yy259;
107975 }else{
107976 Select *pSubquery;
@@ -107977,180 +108225,260 @@
107977 sqlite3SrcListShiftJoinType(yymsp[-4].minor.yy259);
107978 pSubquery = sqlite3SelectNew(pParse,0,yymsp[-4].minor.yy259,0,0,0,0,0,0,0);
107979 yygotominor.yy259 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy259,0,0,&yymsp[-2].minor.yy0,pSubquery,yymsp[-1].minor.yy314,yymsp[0].minor.yy384);
107980 }
107981 }
 
107982 break;
107983 case 137: /* dbnm ::= */
107984 case 146: /* indexed_opt ::= */ yytestcase(yyruleno==146);
 
107985 {yygotominor.yy0.z=0; yygotominor.yy0.n=0;}
 
107986 break;
107987 case 139: /* fullname ::= nm dbnm */
 
107988 {yygotominor.yy259 = sqlite3SrcListAppend(pParse->db,0,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0);}
 
107989 break;
107990 case 140: /* joinop ::= COMMA|JOIN */
 
107991 { yygotominor.yy4 = JT_INNER; }
 
107992 break;
107993 case 141: /* joinop ::= JOIN_KW JOIN */
 
107994 { yygotominor.yy4 = sqlite3JoinType(pParse,&yymsp[-1].minor.yy0,0,0); }
 
107995 break;
107996 case 142: /* joinop ::= JOIN_KW nm JOIN */
 
107997 { yygotominor.yy4 = sqlite3JoinType(pParse,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0,0); }
 
107998 break;
107999 case 143: /* joinop ::= JOIN_KW nm nm JOIN */
 
108000 { yygotominor.yy4 = sqlite3JoinType(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0); }
 
108001 break;
108002 case 144: /* on_opt ::= ON expr */
108003 case 155: /* sortitem ::= expr */ yytestcase(yyruleno==155);
108004 case 162: /* having_opt ::= HAVING expr */ yytestcase(yyruleno==162);
108005 case 169: /* where_opt ::= WHERE expr */ yytestcase(yyruleno==169);
108006 case 235: /* case_else ::= ELSE expr */ yytestcase(yyruleno==235);
108007 case 237: /* case_operand ::= expr */ yytestcase(yyruleno==237);
 
108008 {yygotominor.yy314 = yymsp[0].minor.yy118.pExpr;}
 
108009 break;
108010 case 145: /* on_opt ::= */
108011 case 161: /* having_opt ::= */ yytestcase(yyruleno==161);
108012 case 168: /* where_opt ::= */ yytestcase(yyruleno==168);
108013 case 236: /* case_else ::= */ yytestcase(yyruleno==236);
108014 case 238: /* case_operand ::= */ yytestcase(yyruleno==238);
 
108015 {yygotominor.yy314 = 0;}
 
108016 break;
108017 case 148: /* indexed_opt ::= NOT INDEXED */
 
108018 {yygotominor.yy0.z=0; yygotominor.yy0.n=1;}
 
108019 break;
108020 case 149: /* using_opt ::= USING LP inscollist RP */
108021 case 181: /* inscollist_opt ::= LP inscollist RP */ yytestcase(yyruleno==181);
 
108022 {yygotominor.yy384 = yymsp[-1].minor.yy384;}
 
108023 break;
108024 case 150: /* using_opt ::= */
108025 case 180: /* inscollist_opt ::= */ yytestcase(yyruleno==180);
 
108026 {yygotominor.yy384 = 0;}
 
108027 break;
108028 case 152: /* orderby_opt ::= ORDER BY sortlist */
108029 case 160: /* groupby_opt ::= GROUP BY nexprlist */ yytestcase(yyruleno==160);
108030 case 239: /* exprlist ::= nexprlist */ yytestcase(yyruleno==239);
 
108031 {yygotominor.yy322 = yymsp[0].minor.yy322;}
 
108032 break;
108033 case 153: /* sortlist ::= sortlist COMMA sortitem sortorder */
 
108034 {
108035 yygotominor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-3].minor.yy322,yymsp[-1].minor.yy314);
108036 if( yygotominor.yy322 ) yygotominor.yy322->a[yygotominor.yy322->nExpr-1].sortOrder = (u8)yymsp[0].minor.yy4;
108037 }
 
108038 break;
108039 case 154: /* sortlist ::= sortitem sortorder */
 
108040 {
108041 yygotominor.yy322 = sqlite3ExprListAppend(pParse,0,yymsp[-1].minor.yy314);
108042 if( yygotominor.yy322 && ALWAYS(yygotominor.yy322->a) ) yygotominor.yy322->a[0].sortOrder = (u8)yymsp[0].minor.yy4;
108043 }
 
108044 break;
108045 case 156: /* sortorder ::= ASC */
108046 case 158: /* sortorder ::= */ yytestcase(yyruleno==158);
 
108047 {yygotominor.yy4 = SQLITE_SO_ASC;}
 
108048 break;
108049 case 157: /* sortorder ::= DESC */
 
108050 {yygotominor.yy4 = SQLITE_SO_DESC;}
 
108051 break;
108052 case 163: /* limit_opt ::= */
 
108053 {yygotominor.yy292.pLimit = 0; yygotominor.yy292.pOffset = 0;}
 
108054 break;
108055 case 164: /* limit_opt ::= LIMIT expr */
 
108056 {yygotominor.yy292.pLimit = yymsp[0].minor.yy118.pExpr; yygotominor.yy292.pOffset = 0;}
 
108057 break;
108058 case 165: /* limit_opt ::= LIMIT expr OFFSET expr */
 
108059 {yygotominor.yy292.pLimit = yymsp[-2].minor.yy118.pExpr; yygotominor.yy292.pOffset = yymsp[0].minor.yy118.pExpr;}
 
108060 break;
108061 case 166: /* limit_opt ::= LIMIT expr COMMA expr */
 
108062 {yygotominor.yy292.pOffset = yymsp[-2].minor.yy118.pExpr; yygotominor.yy292.pLimit = yymsp[0].minor.yy118.pExpr;}
 
108063 break;
108064 case 167: /* cmd ::= DELETE FROM fullname indexed_opt where_opt */
 
108065 {
108066 sqlite3SrcListIndexedBy(pParse, yymsp[-2].minor.yy259, &yymsp[-1].minor.yy0);
108067 sqlite3DeleteFrom(pParse,yymsp[-2].minor.yy259,yymsp[0].minor.yy314);
108068 }
 
108069 break;
108070 case 170: /* cmd ::= UPDATE orconf fullname indexed_opt SET setlist where_opt */
 
108071 {
108072 sqlite3SrcListIndexedBy(pParse, yymsp[-4].minor.yy259, &yymsp[-3].minor.yy0);
108073 sqlite3ExprListCheckLength(pParse,yymsp[-1].minor.yy322,"set list");
108074 sqlite3Update(pParse,yymsp[-4].minor.yy259,yymsp[-1].minor.yy322,yymsp[0].minor.yy314,yymsp[-5].minor.yy210);
108075 }
 
108076 break;
108077 case 171: /* setlist ::= setlist COMMA nm EQ expr */
 
108078 {
108079 yygotominor.yy322 = sqlite3ExprListAppend(pParse, yymsp[-4].minor.yy322, yymsp[0].minor.yy118.pExpr);
108080 sqlite3ExprListSetName(pParse, yygotominor.yy322, &yymsp[-2].minor.yy0, 1);
108081 }
 
108082 break;
108083 case 172: /* setlist ::= nm EQ expr */
 
108084 {
108085 yygotominor.yy322 = sqlite3ExprListAppend(pParse, 0, yymsp[0].minor.yy118.pExpr);
108086 sqlite3ExprListSetName(pParse, yygotominor.yy322, &yymsp[-2].minor.yy0, 1);
108087 }
 
108088 break;
108089 case 173: /* cmd ::= insert_cmd INTO fullname inscollist_opt VALUES LP itemlist RP */
 
108090 {sqlite3Insert(pParse, yymsp[-5].minor.yy259, yymsp[-1].minor.yy322, 0, yymsp[-4].minor.yy384, yymsp[-7].minor.yy210);}
 
108091 break;
108092 case 174: /* cmd ::= insert_cmd INTO fullname inscollist_opt select */
 
108093 {sqlite3Insert(pParse, yymsp[-2].minor.yy259, 0, yymsp[0].minor.yy387, yymsp[-1].minor.yy384, yymsp[-4].minor.yy210);}
 
108094 break;
108095 case 175: /* cmd ::= insert_cmd INTO fullname inscollist_opt DEFAULT VALUES */
 
108096 {sqlite3Insert(pParse, yymsp[-3].minor.yy259, 0, 0, yymsp[-2].minor.yy384, yymsp[-5].minor.yy210);}
 
108097 break;
108098 case 176: /* insert_cmd ::= INSERT orconf */
 
108099 {yygotominor.yy210 = yymsp[0].minor.yy210;}
 
108100 break;
108101 case 177: /* insert_cmd ::= REPLACE */
 
108102 {yygotominor.yy210 = OE_Replace;}
 
108103 break;
108104 case 178: /* itemlist ::= itemlist COMMA expr */
108105 case 241: /* nexprlist ::= nexprlist COMMA expr */ yytestcase(yyruleno==241);
 
108106 {yygotominor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-2].minor.yy322,yymsp[0].minor.yy118.pExpr);}
 
108107 break;
108108 case 179: /* itemlist ::= expr */
108109 case 242: /* nexprlist ::= expr */ yytestcase(yyruleno==242);
 
108110 {yygotominor.yy322 = sqlite3ExprListAppend(pParse,0,yymsp[0].minor.yy118.pExpr);}
 
108111 break;
108112 case 182: /* inscollist ::= inscollist COMMA nm */
 
108113 {yygotominor.yy384 = sqlite3IdListAppend(pParse->db,yymsp[-2].minor.yy384,&yymsp[0].minor.yy0);}
 
108114 break;
108115 case 183: /* inscollist ::= nm */
 
108116 {yygotominor.yy384 = sqlite3IdListAppend(pParse->db,0,&yymsp[0].minor.yy0);}
 
108117 break;
108118 case 184: /* expr ::= term */
 
108119 {yygotominor.yy118 = yymsp[0].minor.yy118;}
 
108120 break;
108121 case 185: /* expr ::= LP expr RP */
 
108122 {yygotominor.yy118.pExpr = yymsp[-1].minor.yy118.pExpr; spanSet(&yygotominor.yy118,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0);}
 
108123 break;
108124 case 186: /* term ::= NULL */
108125 case 191: /* term ::= INTEGER|FLOAT|BLOB */ yytestcase(yyruleno==191);
108126 case 192: /* term ::= STRING */ yytestcase(yyruleno==192);
 
108127 {spanExpr(&yygotominor.yy118, pParse, yymsp[0].major, &yymsp[0].minor.yy0);}
 
108128 break;
108129 case 187: /* expr ::= id */
108130 case 188: /* expr ::= JOIN_KW */ yytestcase(yyruleno==188);
 
108131 {spanExpr(&yygotominor.yy118, pParse, TK_ID, &yymsp[0].minor.yy0);}
 
108132 break;
108133 case 189: /* expr ::= nm DOT nm */
 
108134 {
108135 Expr *temp1 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-2].minor.yy0);
108136 Expr *temp2 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[0].minor.yy0);
108137 yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_DOT, temp1, temp2, 0);
108138 spanSet(&yygotominor.yy118,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0);
108139 }
 
108140 break;
108141 case 190: /* expr ::= nm DOT nm DOT nm */
 
108142 {
108143 Expr *temp1 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-4].minor.yy0);
108144 Expr *temp2 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-2].minor.yy0);
108145 Expr *temp3 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[0].minor.yy0);
108146 Expr *temp4 = sqlite3PExpr(pParse, TK_DOT, temp2, temp3, 0);
108147 yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_DOT, temp1, temp4, 0);
108148 spanSet(&yygotominor.yy118,&yymsp[-4].minor.yy0,&yymsp[0].minor.yy0);
108149 }
 
108150 break;
108151 case 193: /* expr ::= REGISTER */
 
108152 {
108153 /* When doing a nested parse, one can include terms in an expression
108154 ** that look like this: #1 #2 ... These terms refer to registers
108155 ** in the virtual machine. #N is the N-th register. */
108156 if( pParse->nested==0 ){
@@ -108160,32 +108488,40 @@
108160 yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_REGISTER, 0, 0, &yymsp[0].minor.yy0);
108161 if( yygotominor.yy118.pExpr ) sqlite3GetInt32(&yymsp[0].minor.yy0.z[1], &yygotominor.yy118.pExpr->iTable);
108162 }
108163 spanSet(&yygotominor.yy118, &yymsp[0].minor.yy0, &yymsp[0].minor.yy0);
108164 }
 
108165 break;
108166 case 194: /* expr ::= VARIABLE */
 
108167 {
108168 spanExpr(&yygotominor.yy118, pParse, TK_VARIABLE, &yymsp[0].minor.yy0);
108169 sqlite3ExprAssignVarNumber(pParse, yygotominor.yy118.pExpr);
108170 spanSet(&yygotominor.yy118, &yymsp[0].minor.yy0, &yymsp[0].minor.yy0);
108171 }
 
108172 break;
108173 case 195: /* expr ::= expr COLLATE ids */
 
108174 {
108175 yygotominor.yy118.pExpr = sqlite3ExprSetCollByToken(pParse, yymsp[-2].minor.yy118.pExpr, &yymsp[0].minor.yy0);
108176 yygotominor.yy118.zStart = yymsp[-2].minor.yy118.zStart;
108177 yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
108178 }
 
108179 break;
108180 case 196: /* expr ::= CAST LP expr AS typetoken RP */
 
108181 {
108182 yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_CAST, yymsp[-3].minor.yy118.pExpr, 0, &yymsp[-1].minor.yy0);
108183 spanSet(&yygotominor.yy118,&yymsp[-5].minor.yy0,&yymsp[0].minor.yy0);
108184 }
 
108185 break;
108186 case 197: /* expr ::= ID LP distinct exprlist RP */
 
108187 {
108188 if( yymsp[-1].minor.yy322 && yymsp[-1].minor.yy322->nExpr>pParse->db->aLimit[SQLITE_LIMIT_FUNCTION_ARG] ){
108189 sqlite3ErrorMsg(pParse, "too many arguments on function %T", &yymsp[-4].minor.yy0);
108190 }
108191 yygotominor.yy118.pExpr = sqlite3ExprFunction(pParse, yymsp[-1].minor.yy322, &yymsp[-4].minor.yy0);
@@ -108192,47 +108528,59 @@
108192 spanSet(&yygotominor.yy118,&yymsp[-4].minor.yy0,&yymsp[0].minor.yy0);
108193 if( yymsp[-2].minor.yy4 && yygotominor.yy118.pExpr ){
108194 yygotominor.yy118.pExpr->flags |= EP_Distinct;
108195 }
108196 }
 
108197 break;
108198 case 198: /* expr ::= ID LP STAR RP */
 
108199 {
108200 yygotominor.yy118.pExpr = sqlite3ExprFunction(pParse, 0, &yymsp[-3].minor.yy0);
108201 spanSet(&yygotominor.yy118,&yymsp[-3].minor.yy0,&yymsp[0].minor.yy0);
108202 }
 
108203 break;
108204 case 199: /* term ::= CTIME_KW */
 
108205 {
108206 /* The CURRENT_TIME, CURRENT_DATE, and CURRENT_TIMESTAMP values are
108207 ** treated as functions that return constants */
108208 yygotominor.yy118.pExpr = sqlite3ExprFunction(pParse, 0,&yymsp[0].minor.yy0);
108209 if( yygotominor.yy118.pExpr ){
108210 yygotominor.yy118.pExpr->op = TK_CONST_FUNC;
108211 }
108212 spanSet(&yygotominor.yy118, &yymsp[0].minor.yy0, &yymsp[0].minor.yy0);
108213 }
 
108214 break;
108215 case 200: /* expr ::= expr AND expr */
108216 case 201: /* expr ::= expr OR expr */ yytestcase(yyruleno==201);
108217 case 202: /* expr ::= expr LT|GT|GE|LE expr */ yytestcase(yyruleno==202);
108218 case 203: /* expr ::= expr EQ|NE expr */ yytestcase(yyruleno==203);
108219 case 204: /* expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr */ yytestcase(yyruleno==204);
108220 case 205: /* expr ::= expr PLUS|MINUS expr */ yytestcase(yyruleno==205);
108221 case 206: /* expr ::= expr STAR|SLASH|REM expr */ yytestcase(yyruleno==206);
108222 case 207: /* expr ::= expr CONCAT expr */ yytestcase(yyruleno==207);
 
108223 {spanBinaryExpr(&yygotominor.yy118,pParse,yymsp[-1].major,&yymsp[-2].minor.yy118,&yymsp[0].minor.yy118);}
 
108224 break;
108225 case 208: /* likeop ::= LIKE_KW */
108226 case 210: /* likeop ::= MATCH */ yytestcase(yyruleno==210);
 
108227 {yygotominor.yy342.eOperator = yymsp[0].minor.yy0; yygotominor.yy342.not = 0;}
 
108228 break;
108229 case 209: /* likeop ::= NOT LIKE_KW */
108230 case 211: /* likeop ::= NOT MATCH */ yytestcase(yyruleno==211);
 
108231 {yygotominor.yy342.eOperator = yymsp[0].minor.yy0; yygotominor.yy342.not = 1;}
 
108232 break;
108233 case 212: /* expr ::= expr likeop expr */
 
108234 {
108235 ExprList *pList;
108236 pList = sqlite3ExprListAppend(pParse,0, yymsp[0].minor.yy118.pExpr);
108237 pList = sqlite3ExprListAppend(pParse,pList, yymsp[-2].minor.yy118.pExpr);
108238 yygotominor.yy118.pExpr = sqlite3ExprFunction(pParse, pList, &yymsp[-1].minor.yy342.eOperator);
@@ -108239,12 +108587,14 @@
108239 if( yymsp[-1].minor.yy342.not ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0);
108240 yygotominor.yy118.zStart = yymsp[-2].minor.yy118.zStart;
108241 yygotominor.yy118.zEnd = yymsp[0].minor.yy118.zEnd;
108242 if( yygotominor.yy118.pExpr ) yygotominor.yy118.pExpr->flags |= EP_InfixFunc;
108243 }
 
108244 break;
108245 case 213: /* expr ::= expr likeop expr ESCAPE expr */
 
108246 {
108247 ExprList *pList;
108248 pList = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy118.pExpr);
108249 pList = sqlite3ExprListAppend(pParse,pList, yymsp[-4].minor.yy118.pExpr);
108250 pList = sqlite3ExprListAppend(pParse,pList, yymsp[0].minor.yy118.pExpr);
@@ -108252,40 +108602,56 @@
108252 if( yymsp[-3].minor.yy342.not ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0);
108253 yygotominor.yy118.zStart = yymsp[-4].minor.yy118.zStart;
108254 yygotominor.yy118.zEnd = yymsp[0].minor.yy118.zEnd;
108255 if( yygotominor.yy118.pExpr ) yygotominor.yy118.pExpr->flags |= EP_InfixFunc;
108256 }
 
108257 break;
108258 case 214: /* expr ::= expr ISNULL|NOTNULL */
 
108259 {spanUnaryPostfix(&yygotominor.yy118,pParse,yymsp[0].major,&yymsp[-1].minor.yy118,&yymsp[0].minor.yy0);}
 
108260 break;
108261 case 215: /* expr ::= expr NOT NULL */
 
108262 {spanUnaryPostfix(&yygotominor.yy118,pParse,TK_NOTNULL,&yymsp[-2].minor.yy118,&yymsp[0].minor.yy0);}
 
108263 break;
108264 case 216: /* expr ::= expr IS expr */
 
108265 {
108266 spanBinaryExpr(&yygotominor.yy118,pParse,TK_IS,&yymsp[-2].minor.yy118,&yymsp[0].minor.yy118);
108267 binaryToUnaryIfNull(pParse, yymsp[0].minor.yy118.pExpr, yygotominor.yy118.pExpr, TK_ISNULL);
108268 }
 
108269 break;
108270 case 217: /* expr ::= expr IS NOT expr */
 
108271 {
108272 spanBinaryExpr(&yygotominor.yy118,pParse,TK_ISNOT,&yymsp[-3].minor.yy118,&yymsp[0].minor.yy118);
108273 binaryToUnaryIfNull(pParse, yymsp[0].minor.yy118.pExpr, yygotominor.yy118.pExpr, TK_NOTNULL);
108274 }
 
108275 break;
108276 case 218: /* expr ::= NOT expr */
108277 case 219: /* expr ::= BITNOT expr */ yytestcase(yyruleno==219);
 
108278 {spanUnaryPrefix(&yygotominor.yy118,pParse,yymsp[-1].major,&yymsp[0].minor.yy118,&yymsp[-1].minor.yy0);}
 
108279 break;
108280 case 220: /* expr ::= MINUS expr */
 
108281 {spanUnaryPrefix(&yygotominor.yy118,pParse,TK_UMINUS,&yymsp[0].minor.yy118,&yymsp[-1].minor.yy0);}
 
108282 break;
108283 case 221: /* expr ::= PLUS expr */
 
108284 {spanUnaryPrefix(&yygotominor.yy118,pParse,TK_UPLUS,&yymsp[0].minor.yy118,&yymsp[-1].minor.yy0);}
 
108285 break;
108286 case 224: /* expr ::= expr between_op expr AND expr */
 
108287 {
108288 ExprList *pList = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy118.pExpr);
108289 pList = sqlite3ExprListAppend(pParse,pList, yymsp[0].minor.yy118.pExpr);
108290 yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_BETWEEN, yymsp[-4].minor.yy118.pExpr, 0, 0);
108291 if( yygotominor.yy118.pExpr ){
@@ -108295,12 +108661,14 @@
108295 }
108296 if( yymsp[-3].minor.yy4 ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0);
108297 yygotominor.yy118.zStart = yymsp[-4].minor.yy118.zStart;
108298 yygotominor.yy118.zEnd = yymsp[0].minor.yy118.zEnd;
108299 }
 
108300 break;
108301 case 227: /* expr ::= expr in_op LP exprlist RP */
 
108302 {
108303 if( yymsp[-1].minor.yy322==0 ){
108304 /* Expressions of the form
108305 **
108306 ** expr1 IN ()
@@ -108322,12 +108690,14 @@
108322 if( yymsp[-3].minor.yy4 ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0);
108323 }
108324 yygotominor.yy118.zStart = yymsp[-4].minor.yy118.zStart;
108325 yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
108326 }
 
108327 break;
108328 case 228: /* expr ::= LP select RP */
 
108329 {
108330 yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_SELECT, 0, 0, 0);
108331 if( yygotominor.yy118.pExpr ){
108332 yygotominor.yy118.pExpr->x.pSelect = yymsp[-1].minor.yy387;
108333 ExprSetProperty(yygotominor.yy118.pExpr, EP_xIsSelect);
@@ -108336,12 +108706,14 @@
108336 sqlite3SelectDelete(pParse->db, yymsp[-1].minor.yy387);
108337 }
108338 yygotominor.yy118.zStart = yymsp[-2].minor.yy0.z;
108339 yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
108340 }
 
108341 break;
108342 case 229: /* expr ::= expr in_op LP select RP */
 
108343 {
108344 yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy118.pExpr, 0, 0);
108345 if( yygotominor.yy118.pExpr ){
108346 yygotominor.yy118.pExpr->x.pSelect = yymsp[-1].minor.yy387;
108347 ExprSetProperty(yygotominor.yy118.pExpr, EP_xIsSelect);
@@ -108351,12 +108723,14 @@
108351 }
108352 if( yymsp[-3].minor.yy4 ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0);
108353 yygotominor.yy118.zStart = yymsp[-4].minor.yy118.zStart;
108354 yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
108355 }
 
108356 break;
108357 case 230: /* expr ::= expr in_op nm dbnm */
 
108358 {
108359 SrcList *pSrc = sqlite3SrcListAppend(pParse->db, 0,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0);
108360 yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_IN, yymsp[-3].minor.yy118.pExpr, 0, 0);
108361 if( yygotominor.yy118.pExpr ){
108362 yygotominor.yy118.pExpr->x.pSelect = sqlite3SelectNew(pParse, 0,pSrc,0,0,0,0,0,0,0);
@@ -108367,12 +108741,14 @@
108367 }
108368 if( yymsp[-2].minor.yy4 ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0);
108369 yygotominor.yy118.zStart = yymsp[-3].minor.yy118.zStart;
108370 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];
108371 }
 
108372 break;
108373 case 231: /* expr ::= EXISTS LP select RP */
 
108374 {
108375 Expr *p = yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_EXISTS, 0, 0, 0);
108376 if( p ){
108377 p->x.pSelect = yymsp[-1].minor.yy387;
108378 ExprSetProperty(p, EP_xIsSelect);
@@ -108381,12 +108757,14 @@
108381 sqlite3SelectDelete(pParse->db, yymsp[-1].minor.yy387);
108382 }
108383 yygotominor.yy118.zStart = yymsp[-3].minor.yy0.z;
108384 yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
108385 }
 
108386 break;
108387 case 232: /* expr ::= CASE case_operand case_exprlist case_else END */
 
108388 {
108389 yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_CASE, yymsp[-3].minor.yy314, yymsp[-1].minor.yy314, 0);
108390 if( yygotominor.yy118.pExpr ){
108391 yygotominor.yy118.pExpr->x.pList = yymsp[-2].minor.yy322;
108392 sqlite3ExprSetHeight(pParse, yygotominor.yy118.pExpr);
@@ -108394,38 +108772,50 @@
108394 sqlite3ExprListDelete(pParse->db, yymsp[-2].minor.yy322);
108395 }
108396 yygotominor.yy118.zStart = yymsp[-4].minor.yy0.z;
108397 yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
108398 }
 
108399 break;
108400 case 233: /* case_exprlist ::= case_exprlist WHEN expr THEN expr */
 
108401 {
108402 yygotominor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy322, yymsp[-2].minor.yy118.pExpr);
108403 yygotominor.yy322 = sqlite3ExprListAppend(pParse,yygotominor.yy322, yymsp[0].minor.yy118.pExpr);
108404 }
 
108405 break;
108406 case 234: /* case_exprlist ::= WHEN expr THEN expr */
 
108407 {
108408 yygotominor.yy322 = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy118.pExpr);
108409 yygotominor.yy322 = sqlite3ExprListAppend(pParse,yygotominor.yy322, yymsp[0].minor.yy118.pExpr);
108410 }
 
108411 break;
108412 case 243: /* cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP idxlist RP */
 
108413 {
108414 sqlite3CreateIndex(pParse, &yymsp[-6].minor.yy0, &yymsp[-5].minor.yy0,
108415 sqlite3SrcListAppend(pParse->db,0,&yymsp[-3].minor.yy0,0), yymsp[-1].minor.yy322, yymsp[-9].minor.yy4,
108416 &yymsp[-10].minor.yy0, &yymsp[0].minor.yy0, SQLITE_SO_ASC, yymsp[-7].minor.yy4);
108417 }
 
108418 break;
108419 case 244: /* uniqueflag ::= UNIQUE */
108420 case 298: /* raisetype ::= ABORT */ yytestcase(yyruleno==298);
 
108421 {yygotominor.yy4 = OE_Abort;}
 
108422 break;
108423 case 245: /* uniqueflag ::= */
 
108424 {yygotominor.yy4 = OE_None;}
 
108425 break;
108426 case 248: /* idxlist ::= idxlist COMMA nm collate sortorder */
 
108427 {
108428 Expr *p = 0;
108429 if( yymsp[-1].minor.yy0.n>0 ){
108430 p = sqlite3Expr(pParse->db, TK_COLUMN, 0);
108431 sqlite3ExprSetCollByToken(pParse, p, &yymsp[-1].minor.yy0);
@@ -108433,12 +108823,14 @@
108433 yygotominor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy322, p);
108434 sqlite3ExprListSetName(pParse,yygotominor.yy322,&yymsp[-2].minor.yy0,1);
108435 sqlite3ExprListCheckLength(pParse, yygotominor.yy322, "index");
108436 if( yygotominor.yy322 ) yygotominor.yy322->a[yygotominor.yy322->nExpr-1].sortOrder = (u8)yymsp[0].minor.yy4;
108437 }
 
108438 break;
108439 case 249: /* idxlist ::= nm collate sortorder */
 
108440 {
108441 Expr *p = 0;
108442 if( yymsp[-1].minor.yy0.n>0 ){
108443 p = sqlite3PExpr(pParse, TK_COLUMN, 0, 0, 0);
108444 sqlite3ExprSetCollByToken(pParse, p, &yymsp[-1].minor.yy0);
@@ -108446,214 +108838,307 @@
108446 yygotominor.yy322 = sqlite3ExprListAppend(pParse,0, p);
108447 sqlite3ExprListSetName(pParse, yygotominor.yy322, &yymsp[-2].minor.yy0, 1);
108448 sqlite3ExprListCheckLength(pParse, yygotominor.yy322, "index");
108449 if( yygotominor.yy322 ) yygotominor.yy322->a[yygotominor.yy322->nExpr-1].sortOrder = (u8)yymsp[0].minor.yy4;
108450 }
 
108451 break;
108452 case 250: /* collate ::= */
 
108453 {yygotominor.yy0.z = 0; yygotominor.yy0.n = 0;}
 
108454 break;
108455 case 252: /* cmd ::= DROP INDEX ifexists fullname */
 
108456 {sqlite3DropIndex(pParse, yymsp[0].minor.yy259, yymsp[-1].minor.yy4);}
 
108457 break;
108458 case 253: /* cmd ::= VACUUM */
108459 case 254: /* cmd ::= VACUUM nm */ yytestcase(yyruleno==254);
 
108460 {sqlite3Vacuum(pParse);}
 
108461 break;
108462 case 255: /* cmd ::= PRAGMA nm dbnm */
 
108463 {sqlite3Pragma(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,0,0);}
 
108464 break;
108465 case 256: /* cmd ::= PRAGMA nm dbnm EQ nmnum */
 
108466 {sqlite3Pragma(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0,0);}
 
108467 break;
108468 case 257: /* cmd ::= PRAGMA nm dbnm LP nmnum RP */
 
108469 {sqlite3Pragma(pParse,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,&yymsp[-1].minor.yy0,0);}
 
108470 break;
108471 case 258: /* cmd ::= PRAGMA nm dbnm EQ minus_num */
 
108472 {sqlite3Pragma(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0,1);}
 
108473 break;
108474 case 259: /* cmd ::= PRAGMA nm dbnm LP minus_num RP */
 
108475 {sqlite3Pragma(pParse,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,&yymsp[-1].minor.yy0,1);}
 
108476 break;
108477 case 270: /* cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END */
 
108478 {
108479 Token all;
108480 all.z = yymsp[-3].minor.yy0.z;
108481 all.n = (int)(yymsp[0].minor.yy0.z - yymsp[-3].minor.yy0.z) + yymsp[0].minor.yy0.n;
108482 sqlite3FinishTrigger(pParse, yymsp[-1].minor.yy203, &all);
108483 }
 
108484 break;
108485 case 271: /* trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause */
 
108486 {
108487 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);
108488 yygotominor.yy0 = (yymsp[-6].minor.yy0.n==0?yymsp[-7].minor.yy0:yymsp[-6].minor.yy0);
108489 }
 
108490 break;
108491 case 272: /* trigger_time ::= BEFORE */
108492 case 275: /* trigger_time ::= */ yytestcase(yyruleno==275);
 
108493 { yygotominor.yy4 = TK_BEFORE; }
 
108494 break;
108495 case 273: /* trigger_time ::= AFTER */
 
108496 { yygotominor.yy4 = TK_AFTER; }
 
108497 break;
108498 case 274: /* trigger_time ::= INSTEAD OF */
 
108499 { yygotominor.yy4 = TK_INSTEAD;}
 
108500 break;
108501 case 276: /* trigger_event ::= DELETE|INSERT */
108502 case 277: /* trigger_event ::= UPDATE */ yytestcase(yyruleno==277);
 
108503 {yygotominor.yy90.a = yymsp[0].major; yygotominor.yy90.b = 0;}
 
108504 break;
108505 case 278: /* trigger_event ::= UPDATE OF inscollist */
 
108506 {yygotominor.yy90.a = TK_UPDATE; yygotominor.yy90.b = yymsp[0].minor.yy384;}
 
108507 break;
108508 case 281: /* when_clause ::= */
108509 case 303: /* key_opt ::= */ yytestcase(yyruleno==303);
 
108510 { yygotominor.yy314 = 0; }
 
108511 break;
108512 case 282: /* when_clause ::= WHEN expr */
108513 case 304: /* key_opt ::= KEY expr */ yytestcase(yyruleno==304);
 
108514 { yygotominor.yy314 = yymsp[0].minor.yy118.pExpr; }
 
108515 break;
108516 case 283: /* trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI */
 
108517 {
108518 assert( yymsp[-2].minor.yy203!=0 );
108519 yymsp[-2].minor.yy203->pLast->pNext = yymsp[-1].minor.yy203;
108520 yymsp[-2].minor.yy203->pLast = yymsp[-1].minor.yy203;
108521 yygotominor.yy203 = yymsp[-2].minor.yy203;
108522 }
 
108523 break;
108524 case 284: /* trigger_cmd_list ::= trigger_cmd SEMI */
 
108525 {
108526 assert( yymsp[-1].minor.yy203!=0 );
108527 yymsp[-1].minor.yy203->pLast = yymsp[-1].minor.yy203;
108528 yygotominor.yy203 = yymsp[-1].minor.yy203;
108529 }
 
108530 break;
108531 case 286: /* trnm ::= nm DOT nm */
 
108532 {
108533 yygotominor.yy0 = yymsp[0].minor.yy0;
108534 sqlite3ErrorMsg(pParse,
108535 "qualified table names are not allowed on INSERT, UPDATE, and DELETE "
108536 "statements within triggers");
108537 }
 
108538 break;
108539 case 288: /* tridxby ::= INDEXED BY nm */
 
108540 {
108541 sqlite3ErrorMsg(pParse,
108542 "the INDEXED BY clause is not allowed on UPDATE or DELETE statements "
108543 "within triggers");
108544 }
 
108545 break;
108546 case 289: /* tridxby ::= NOT INDEXED */
 
108547 {
108548 sqlite3ErrorMsg(pParse,
108549 "the NOT INDEXED clause is not allowed on UPDATE or DELETE statements "
108550 "within triggers");
108551 }
 
108552 break;
108553 case 290: /* trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist where_opt */
 
108554 { yygotominor.yy203 = sqlite3TriggerUpdateStep(pParse->db, &yymsp[-4].minor.yy0, yymsp[-1].minor.yy322, yymsp[0].minor.yy314, yymsp[-5].minor.yy210); }
 
108555 break;
108556 case 291: /* trigger_cmd ::= insert_cmd INTO trnm inscollist_opt VALUES LP itemlist RP */
 
108557 {yygotominor.yy203 = sqlite3TriggerInsertStep(pParse->db, &yymsp[-5].minor.yy0, yymsp[-4].minor.yy384, yymsp[-1].minor.yy322, 0, yymsp[-7].minor.yy210);}
 
108558 break;
108559 case 292: /* trigger_cmd ::= insert_cmd INTO trnm inscollist_opt select */
 
108560 {yygotominor.yy203 = sqlite3TriggerInsertStep(pParse->db, &yymsp[-2].minor.yy0, yymsp[-1].minor.yy384, 0, yymsp[0].minor.yy387, yymsp[-4].minor.yy210);}
 
108561 break;
108562 case 293: /* trigger_cmd ::= DELETE FROM trnm tridxby where_opt */
 
108563 {yygotominor.yy203 = sqlite3TriggerDeleteStep(pParse->db, &yymsp[-2].minor.yy0, yymsp[0].minor.yy314);}
 
108564 break;
108565 case 294: /* trigger_cmd ::= select */
 
108566 {yygotominor.yy203 = sqlite3TriggerSelectStep(pParse->db, yymsp[0].minor.yy387); }
 
108567 break;
108568 case 295: /* expr ::= RAISE LP IGNORE RP */
 
108569 {
108570 yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_RAISE, 0, 0, 0);
108571 if( yygotominor.yy118.pExpr ){
108572 yygotominor.yy118.pExpr->affinity = OE_Ignore;
108573 }
108574 yygotominor.yy118.zStart = yymsp[-3].minor.yy0.z;
108575 yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
108576 }
 
108577 break;
108578 case 296: /* expr ::= RAISE LP raisetype COMMA nm RP */
 
108579 {
108580 yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_RAISE, 0, 0, &yymsp[-1].minor.yy0);
108581 if( yygotominor.yy118.pExpr ) {
108582 yygotominor.yy118.pExpr->affinity = (char)yymsp[-3].minor.yy4;
108583 }
108584 yygotominor.yy118.zStart = yymsp[-5].minor.yy0.z;
108585 yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
108586 }
 
108587 break;
108588 case 297: /* raisetype ::= ROLLBACK */
 
108589 {yygotominor.yy4 = OE_Rollback;}
 
108590 break;
108591 case 299: /* raisetype ::= FAIL */
 
108592 {yygotominor.yy4 = OE_Fail;}
 
108593 break;
108594 case 300: /* cmd ::= DROP TRIGGER ifexists fullname */
 
108595 {
108596 sqlite3DropTrigger(pParse,yymsp[0].minor.yy259,yymsp[-1].minor.yy4);
108597 }
 
108598 break;
108599 case 301: /* cmd ::= ATTACH database_kw_opt expr AS expr key_opt */
 
108600 {
108601 sqlite3Attach(pParse, yymsp[-3].minor.yy118.pExpr, yymsp[-1].minor.yy118.pExpr, yymsp[0].minor.yy314);
108602 }
 
108603 break;
108604 case 302: /* cmd ::= DETACH database_kw_opt expr */
 
108605 {
108606 sqlite3Detach(pParse, yymsp[0].minor.yy118.pExpr);
108607 }
 
108608 break;
108609 case 307: /* cmd ::= REINDEX */
 
108610 {sqlite3Reindex(pParse, 0, 0);}
 
108611 break;
108612 case 308: /* cmd ::= REINDEX nm dbnm */
 
108613 {sqlite3Reindex(pParse, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0);}
 
108614 break;
108615 case 309: /* cmd ::= ANALYZE */
 
108616 {sqlite3Analyze(pParse, 0, 0);}
 
108617 break;
108618 case 310: /* cmd ::= ANALYZE nm dbnm */
 
108619 {sqlite3Analyze(pParse, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0);}
 
108620 break;
108621 case 311: /* cmd ::= ALTER TABLE fullname RENAME TO nm */
 
108622 {
108623 sqlite3AlterRenameTable(pParse,yymsp[-3].minor.yy259,&yymsp[0].minor.yy0);
108624 }
 
108625 break;
108626 case 312: /* cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt column */
 
108627 {
108628 sqlite3AlterFinishAddColumn(pParse, &yymsp[0].minor.yy0);
108629 }
 
108630 break;
108631 case 313: /* add_column_fullname ::= fullname */
 
108632 {
108633 pParse->db->lookaside.bEnabled = 0;
108634 sqlite3AlterBeginAddColumn(pParse, yymsp[0].minor.yy259);
108635 }
 
108636 break;
108637 case 316: /* cmd ::= create_vtab */
 
108638 {sqlite3VtabFinishParse(pParse,0);}
 
108639 break;
108640 case 317: /* cmd ::= create_vtab LP vtabarglist RP */
 
108641 {sqlite3VtabFinishParse(pParse,&yymsp[0].minor.yy0);}
 
108642 break;
108643 case 318: /* create_vtab ::= createkw VIRTUAL TABLE nm dbnm USING nm */
 
108644 {
108645 sqlite3VtabBeginParse(pParse, &yymsp[-3].minor.yy0, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0);
108646 }
 
108647 break;
108648 case 321: /* vtabarg ::= */
 
108649 {sqlite3VtabArgInit(pParse);}
 
108650 break;
108651 case 323: /* vtabargtoken ::= ANY */
108652 case 324: /* vtabargtoken ::= lp anylist RP */ yytestcase(yyruleno==324);
108653 case 325: /* lp ::= LP */ yytestcase(yyruleno==325);
 
108654 {sqlite3VtabArgExtend(pParse,&yymsp[0].minor.yy0);}
 
108655 break;
108656 default:
108657 /* (0) input ::= cmdlist */ yytestcase(yyruleno==0);
108658 /* (1) cmdlist ::= cmdlist ecmd */ yytestcase(yyruleno==1);
108659 /* (2) cmdlist ::= ecmd */ yytestcase(yyruleno==2);
@@ -108751,15 +109236,17 @@
108751 int yymajor, /* The major type of the error token */
108752 YYMINORTYPE yyminor /* The minor type of the error token */
108753 ){
108754 sqlite3ParserARG_FETCH;
108755 #define TOKEN (yyminor.yy0)
 
108756
108757 UNUSED_PARAMETER(yymajor); /* Silence some compiler warnings */
108758 assert( TOKEN.z[0] ); /* The tokenizer always gives us a token */
108759 sqlite3ErrorMsg(pParse, "near \"%T\": syntax error", &TOKEN);
108760 pParse->parseError = 1;
 
108761 sqlite3ParserARG_STORE; /* Suppress warning about unused %extra_argument variable */
108762 }
108763
108764 /*
108765 ** The following is executed when the parser accepts
@@ -108949,10 +109436,11 @@
108949 return;
108950 }
108951
108952 /************** End of parse.c ***********************************************/
108953 /************** Begin file tokenize.c ****************************************/
 
108954 /*
108955 ** 2001 September 15
108956 **
108957 ** The author disclaims copyright to this source code. In place of
108958 ** a legal notice, here is a blessing:
@@ -109014,10 +109502,11 @@
109014 ** named keywordhash.h and then included into this source file by
109015 ** the #include below.
109016 */
109017 /************** Include keywordhash.h in the middle of tokenize.c ************/
109018 /************** Begin file keywordhash.h *************************************/
 
109019 /***** This file contains automatically generated code ******
109020 **
109021 ** The code in this file has been automatically generated by
109022 **
109023 ** sqlite/tool/mkkeywordhash.c
@@ -109287,10 +109776,11 @@
109287 }
109288 #define SQLITE_N_KEYWORD 121
109289
109290 /************** End of keywordhash.h *****************************************/
109291 /************** Continuing where we left off in tokenize.c *******************/
 
109292
109293
109294 /*
109295 ** If X is a character that can be used in an identifier then
109296 ** IdChar(X) will be true. Otherwise it is false.
@@ -109751,10 +110241,11 @@
109751 return nErr;
109752 }
109753
109754 /************** End of tokenize.c ********************************************/
109755 /************** Begin file complete.c ****************************************/
 
109756 /*
109757 ** 2001 September 15
109758 **
109759 ** The author disclaims copyright to this source code. In place of
109760 ** a legal notice, here is a blessing:
@@ -110036,10 +110527,11 @@
110036 #endif /* SQLITE_OMIT_UTF16 */
110037 #endif /* SQLITE_OMIT_COMPLETE */
110038
110039 /************** End of complete.c ********************************************/
110040 /************** Begin file main.c ********************************************/
 
110041 /*
110042 ** 2001 September 15
110043 **
110044 ** The author disclaims copyright to this source code. In place of
110045 ** a legal notice, here is a blessing:
@@ -110056,10 +110548,11 @@
110056 */
110057
110058 #ifdef SQLITE_ENABLE_FTS3
110059 /************** Include fts3.h in the middle of main.c ***********************/
110060 /************** Begin file fts3.h ********************************************/
 
110061 /*
110062 ** 2006 Oct 10
110063 **
110064 ** The author disclaims copyright to this source code. In place of
110065 ** a legal notice, here is a blessing:
@@ -110084,14 +110577,16 @@
110084 } /* extern "C" */
110085 #endif /* __cplusplus */
110086
110087 /************** End of fts3.h ************************************************/
110088 /************** Continuing where we left off in main.c ***********************/
 
110089 #endif
110090 #ifdef SQLITE_ENABLE_RTREE
110091 /************** Include rtree.h in the middle of main.c **********************/
110092 /************** Begin file rtree.h *******************************************/
 
110093 /*
110094 ** 2008 May 26
110095 **
110096 ** The author disclaims copyright to this source code. In place of
110097 ** a legal notice, here is a blessing:
@@ -110116,14 +110611,16 @@
110116 } /* extern "C" */
110117 #endif /* __cplusplus */
110118
110119 /************** End of rtree.h ***********************************************/
110120 /************** Continuing where we left off in main.c ***********************/
 
110121 #endif
110122 #ifdef SQLITE_ENABLE_ICU
110123 /************** Include sqliteicu.h in the middle of main.c ******************/
110124 /************** Begin file sqliteicu.h ***************************************/
 
110125 /*
110126 ** 2008 May 26
110127 **
110128 ** The author disclaims copyright to this source code. In place of
110129 ** a legal notice, here is a blessing:
@@ -110149,10 +110646,11 @@
110149 #endif /* __cplusplus */
110150
110151
110152 /************** End of sqliteicu.h *******************************************/
110153 /************** Continuing where we left off in main.c ***********************/
 
110154 #endif
110155
110156 #ifndef SQLITE_AMALGAMATION
110157 /* IMPLEMENTATION-OF: R-46656-45156 The sqlite3_version[] string constant
110158 ** contains the text of SQLITE_VERSION macro.
@@ -113079,10 +113577,11 @@
113079 return 0;
113080 }
113081
113082 /************** End of main.c ************************************************/
113083 /************** Begin file notify.c ******************************************/
 
113084 /*
113085 ** 2009 March 3
113086 **
113087 ** The author disclaims copyright to this source code. In place of
113088 ** a legal notice, here is a blessing:
@@ -113412,10 +113911,11 @@
113412 }
113413 #endif
113414
113415 /************** End of notify.c **********************************************/
113416 /************** Begin file fts3.c ********************************************/
 
113417 /*
113418 ** 2006 Oct 10
113419 **
113420 ** The author disclaims copyright to this source code. In place of
113421 ** a legal notice, here is a blessing:
@@ -113708,10 +114208,11 @@
113708 ** into a single segment.
113709 */
113710
113711 /************** Include fts3Int.h in the middle of fts3.c ********************/
113712 /************** Begin file fts3Int.h *****************************************/
 
113713 /*
113714 ** 2009 Nov 12
113715 **
113716 ** The author disclaims copyright to this source code. In place of
113717 ** a legal notice, here is a blessing:
@@ -113746,10 +114247,11 @@
113746 SQLITE_API extern const sqlite3_api_routines *sqlite3_api;
113747 #endif
113748
113749 /************** Include fts3_tokenizer.h in the middle of fts3Int.h **********/
113750 /************** Begin file fts3_tokenizer.h **********************************/
 
113751 /*
113752 ** 2006 July 10
113753 **
113754 ** The author disclaims copyright to this source code.
113755 **
@@ -113900,12 +114402,14 @@
113900
113901 #endif /* _FTS3_TOKENIZER_H_ */
113902
113903 /************** End of fts3_tokenizer.h **************************************/
113904 /************** Continuing where we left off in fts3Int.h ********************/
 
113905 /************** Include fts3_hash.h in the middle of fts3Int.h ***************/
113906 /************** Begin file fts3_hash.h ***************************************/
 
113907 /*
113908 ** 2001 September 22
113909 **
113910 ** The author disclaims copyright to this source code. In place of
113911 ** a legal notice, here is a blessing:
@@ -114017,10 +114521,11 @@
114017
114018 #endif /* _FTS3_HASH_H_ */
114019
114020 /************** End of fts3_hash.h *******************************************/
114021 /************** Continuing where we left off in fts3Int.h ********************/
 
114022
114023 /*
114024 ** This constant controls how often segments are merged. Once there are
114025 ** FTS3_MERGE_COUNT segments of level N, they are merged into a single
114026 ** segment of level N+1.
@@ -114493,10 +114998,11 @@
114493 #endif /* !SQLITE_CORE || SQLITE_ENABLE_FTS3 */
114494 #endif /* _FTSINT_H */
114495
114496 /************** End of fts3Int.h *********************************************/
114497 /************** Continuing where we left off in fts3.c ***********************/
 
114498 #if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3)
114499
114500 #if defined(SQLITE_ENABLE_FTS3) && !defined(SQLITE_CORE)
114501 # define SQLITE_CORE 1
114502 #endif
@@ -116264,11 +116770,41 @@
116264 char *aOut;
116265 int bFirstOut = 0;
116266
116267 *paOut = 0;
116268 *pnOut = 0;
116269 aOut = sqlite3_malloc(n1+n2);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
116270 if( !aOut ) return SQLITE_NOMEM;
116271
116272 p = aOut;
116273 fts3GetDeltaVarint3(&p1, pEnd1, 0, &i1);
116274 fts3GetDeltaVarint3(&p2, pEnd2, 0, &i2);
@@ -116291,10 +116827,11 @@
116291 }
116292 }
116293
116294 *paOut = aOut;
116295 *pnOut = (p-aOut);
 
116296 return SQLITE_OK;
116297 }
116298
116299 /*
116300 ** This function does a "phrase" merge of two doclists. In a phrase merge,
@@ -119011,10 +119548,11 @@
119011
119012 #endif
119013
119014 /************** End of fts3.c ************************************************/
119015 /************** Begin file fts3_aux.c ****************************************/
 
119016 /*
119017 ** 2011 Jan 27
119018 **
119019 ** The author disclaims copyright to this source code. In place of
119020 ** a legal notice, here is a blessing:
@@ -119487,10 +120025,11 @@
119487
119488 #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */
119489
119490 /************** End of fts3_aux.c ********************************************/
119491 /************** Begin file fts3_expr.c ***************************************/
 
119492 /*
119493 ** 2008 Nov 28
119494 **
119495 ** The author disclaims copyright to this source code. In place of
119496 ** a legal notice, here is a blessing:
@@ -120453,10 +120992,11 @@
120453 #endif
120454 #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */
120455
120456 /************** End of fts3_expr.c *******************************************/
120457 /************** Begin file fts3_hash.c ***************************************/
 
120458 /*
120459 ** 2001 September 22
120460 **
120461 ** The author disclaims copyright to this source code. In place of
120462 ** a legal notice, here is a blessing:
@@ -120837,10 +121377,11 @@
120837
120838 #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */
120839
120840 /************** End of fts3_hash.c *******************************************/
120841 /************** Begin file fts3_porter.c *************************************/
 
120842 /*
120843 ** 2006 September 30
120844 **
120845 ** The author disclaims copyright to this source code. In place of
120846 ** a legal notice, here is a blessing:
@@ -121483,10 +122024,11 @@
121483
121484 #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */
121485
121486 /************** End of fts3_porter.c *****************************************/
121487 /************** Begin file fts3_tokenizer.c **********************************/
 
121488 /*
121489 ** 2007 June 22
121490 **
121491 ** The author disclaims copyright to this source code. In place of
121492 ** a legal notice, here is a blessing:
@@ -121974,10 +122516,11 @@
121974
121975 #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */
121976
121977 /************** End of fts3_tokenizer.c **************************************/
121978 /************** Begin file fts3_tokenizer1.c *********************************/
 
121979 /*
121980 ** 2006 Oct 10
121981 **
121982 ** The author disclaims copyright to this source code. In place of
121983 ** a legal notice, here is a blessing:
@@ -122208,10 +122751,11 @@
122208
122209 #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */
122210
122211 /************** End of fts3_tokenizer1.c *************************************/
122212 /************** Begin file fts3_write.c **************************************/
 
122213 /*
122214 ** 2009 Oct 23
122215 **
122216 ** The author disclaims copyright to this source code. In place of
122217 ** a legal notice, here is a blessing:
@@ -125478,10 +126022,11 @@
125478
125479 #endif
125480
125481 /************** End of fts3_write.c ******************************************/
125482 /************** Begin file fts3_snippet.c ************************************/
 
125483 /*
125484 ** 2009 Oct 23
125485 **
125486 ** The author disclaims copyright to this source code. In place of
125487 ** a legal notice, here is a blessing:
@@ -126979,10 +127524,11 @@
126979
126980 #endif
126981
126982 /************** End of fts3_snippet.c ****************************************/
126983 /************** Begin file rtree.c *******************************************/
 
126984 /*
126985 ** 2001 September 15
126986 **
126987 ** The author disclaims copyright to this source code. In place of
126988 ** a legal notice, here is a blessing:
@@ -130260,10 +130806,11 @@
130260
130261 #endif
130262
130263 /************** End of rtree.c ***********************************************/
130264 /************** Begin file icu.c *********************************************/
 
130265 /*
130266 ** 2007 May 6
130267 **
130268 ** The author disclaims copyright to this source code. In place of
130269 ** a legal notice, here is a blessing:
@@ -130762,10 +131309,11 @@
130762
130763 #endif
130764
130765 /************** End of icu.c *************************************************/
130766 /************** Begin file fts3_icu.c ****************************************/
 
130767 /*
130768 ** 2007 June 22
130769 **
130770 ** The author disclaims copyright to this source code. In place of
130771 ** a legal notice, here is a blessing:
130772
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -24,10 +24,11 @@
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:
@@ -78,10 +79,11 @@
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:
@@ -289,10 +291,11 @@
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 */
@@ -545,10 +548,11 @@
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:
@@ -656,11 +660,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 **
@@ -7305,12 +7309,14 @@
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:
@@ -7406,12 +7412,14 @@
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
@@ -7568,10 +7576,11 @@
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>
@@ -7911,10 +7920,11 @@
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:
@@ -8155,12 +8165,14 @@
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:
@@ -8321,10 +8333,11 @@
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
@@ -8508,10 +8521,11 @@
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 */
@@ -8559,13 +8573,13 @@
8573 SQLITE_PRIVATE void sqlite3VdbeSetVarmask(Vdbe*, int);
8574 #ifndef SQLITE_OMIT_TRACE
8575 SQLITE_PRIVATE char *sqlite3VdbeExpandSql(Vdbe*, const char*);
8576 #endif
8577
8578 SQLITE_PRIVATE void sqlite3VdbeRecordUnpack(KeyInfo*,int,const void*,UnpackedRecord*);
 
8579 SQLITE_PRIVATE int sqlite3VdbeRecordCompare(int,const void*,UnpackedRecord*);
8580 SQLITE_PRIVATE UnpackedRecord *sqlite3VdbeAllocUnpackedRecord(KeyInfo *, char *, int, char **);
8581
8582 #ifndef SQLITE_OMIT_TRIGGER
8583 SQLITE_PRIVATE void sqlite3VdbeLinkSubProgram(Vdbe *, SubProgram *);
8584 #endif
8585
@@ -8582,12 +8596,14 @@
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:
@@ -8769,12 +8785,14 @@
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:
@@ -8929,13 +8947,15 @@
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:
@@ -9214,12 +9234,14 @@
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:
@@ -9290,10 +9312,11 @@
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
@@ -11892,10 +11915,11 @@
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:
@@ -12114,10 +12138,11 @@
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:
@@ -12518,10 +12543,11 @@
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:
@@ -12535,10 +12561,11 @@
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:
@@ -12986,10 +13013,11 @@
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;
@@ -13199,10 +13227,11 @@
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:
@@ -14326,10 +14355,11 @@
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:
@@ -14659,10 +14689,11 @@
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:
@@ -14748,10 +14779,11 @@
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:
@@ -14809,10 +14841,11 @@
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:
@@ -14961,10 +14994,11 @@
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:
@@ -15491,10 +15525,11 @@
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:
@@ -16180,10 +16215,11 @@
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:
@@ -16763,10 +16799,11 @@
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:
@@ -16918,10 +16955,11 @@
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:
@@ -17126,10 +17164,11 @@
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:
@@ -17402,10 +17441,11 @@
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:
@@ -17755,10 +17795,11 @@
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:
@@ -18089,10 +18130,11 @@
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:
@@ -18868,10 +18910,11 @@
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
@@ -19899,10 +19942,11 @@
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:
@@ -20046,10 +20090,11 @@
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:
@@ -20607,10 +20652,11 @@
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:
@@ -21789,10 +21835,11 @@
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:
@@ -22068,10 +22115,11 @@
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[] = { "?",
@@ -22229,10 +22277,11 @@
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:
@@ -22285,10 +22334,11 @@
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:
@@ -22338,10 +22388,11 @@
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:
@@ -22426,10 +22477,11 @@
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
@@ -22492,10 +22544,11 @@
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 */
@@ -24363,10 +24416,11 @@
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:
@@ -24627,10 +24681,11 @@
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:
@@ -24680,10 +24735,11 @@
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:
@@ -24768,10 +24824,11 @@
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
@@ -24834,10 +24891,11 @@
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
@@ -31343,10 +31401,11 @@
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:
@@ -31404,10 +31463,11 @@
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:
@@ -31457,10 +31517,11 @@
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:
@@ -31545,10 +31606,11 @@
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
@@ -31611,10 +31673,11 @@
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
@@ -34746,10 +34809,11 @@
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:
@@ -35156,10 +35220,11 @@
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:
@@ -35752,10 +35817,11 @@
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:
@@ -36968,10 +37034,11 @@
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:
@@ -37392,10 +37459,11 @@
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:
@@ -37415,10 +37483,11 @@
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:
@@ -37539,10 +37608,11 @@
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
@@ -44352,10 +44422,11 @@
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:
@@ -47306,10 +47377,11 @@
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:
@@ -47325,10 +47397,11 @@
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:
@@ -47970,10 +48043,11 @@
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,
@@ -48242,10 +48316,11 @@
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:
@@ -48899,22 +48974,25 @@
48974 int *pRes /* Write search results here */
48975 ){
48976 int rc; /* Status code */
48977 UnpackedRecord *pIdxKey; /* Unpacked index key */
48978 char aSpace[150]; /* Temp space for pIdxKey - to avoid a malloc */
48979 char *pFree = 0;
48980
48981 if( pKey ){
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 ){
48993 sqlite3DbFree(pCur->pKeyInfo->db, pFree);
48994 }
48995 return rc;
48996 }
48997
48998 /*
@@ -56426,10 +56504,11 @@
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:
@@ -57132,10 +57211,11 @@
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:
@@ -58286,10 +58366,11 @@
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:
@@ -61116,61 +61197,74 @@
61197 }
61198 }
61199 return 0;
61200 }
61201
61202 /*
61203 ** This routine is used to allocate sufficient space for an UnpackedRecord
61204 ** structure large enough to be used with sqlite3VdbeRecordUnpack() if
61205 ** the first argument is a pointer to KeyInfo structure pKeyInfo.
61206 **
61207 ** The space is either allocated using sqlite3DbMallocRaw() or from within
61208 ** the unaligned buffer passed via the second and third arguments (presumably
61209 ** stack space). If the former, then *ppFree is set to a pointer that should
61210 ** be eventually freed by the caller using sqlite3DbFree(). Or, if the
61211 ** allocation comes from the pSpace/szSpace buffer, *ppFree is set to NULL
61212 ** before returning.
61213 **
61214 ** If an OOM error occurs, NULL is returned.
61215 */
61216 SQLITE_PRIVATE UnpackedRecord *sqlite3VdbeAllocUnpackedRecord(
61217 KeyInfo *pKeyInfo, /* Description of the record */
61218 char *pSpace, /* Unaligned space available */
61219 int szSpace, /* Size of pSpace[] in bytes */
61220 char **ppFree /* OUT: Caller should free this pointer */
61221 ){
61222 UnpackedRecord *p; /* Unpacked record to return */
61223 int nOff; /* Increment pSpace by nOff to align it */
61224 int nByte; /* Number of bytes required for *p */
61225
61226 /* We want to shift the pointer pSpace up such that it is 8-byte aligned.
 
 
 
 
 
 
 
 
61227 ** Thus, we need to calculate a value, nOff, between 0 and 7, to shift
61228 ** it by. If pSpace is already 8-byte aligned, nOff should be zero.
61229 */
61230 nOff = (8 - (SQLITE_PTR_TO_INT(pSpace) & 7)) & 7;
 
 
61231 nByte = ROUND8(sizeof(UnpackedRecord)) + sizeof(Mem)*(pKeyInfo->nField+1);
61232 if( nByte>szSpace+nOff ){
61233 p = (UnpackedRecord *)sqlite3DbMallocRaw(pKeyInfo->db, nByte);
61234 *ppFree = (char *)p;
61235 if( !p ) return 0;
61236 }else{
61237 p = (UnpackedRecord*)&pSpace[nOff];
61238 *ppFree = 0;
61239 }
61240
61241 p->aMem = (Mem*)&((char*)p)[ROUND8(sizeof(UnpackedRecord))];
61242 p->pKeyInfo = pKeyInfo;
61243 p->nField = pKeyInfo->nField + 1;
61244 return p;
61245 }
61246
61247 /*
61248 ** Given the nKey-byte encoding of a record in pKey[], populate the
61249 ** UnpackedRecord structure indicated by the fourth argument with the
61250 ** contents of the decoded record.
61251 */
61252 SQLITE_PRIVATE void sqlite3VdbeRecordUnpack(
61253 KeyInfo *pKeyInfo, /* Information about the record format */
61254 int nKey, /* Size of the binary record */
61255 const void *pKey, /* The binary record */
61256 UnpackedRecord *p /* Populate this structure before returning. */
61257 ){
61258 const unsigned char *aKey = (const unsigned char *)pKey;
61259 int d;
61260 u32 idx; /* Offset in aKey[] to read from */
61261 u16 u; /* Unsigned loop counter */
61262 u32 szHdr;
61263 Mem *pMem = p->aMem;
61264
61265 p->flags = 0;
61266 assert( EIGHT_BYTE_ALIGNMENT(pMem) );
61267 idx = getVarint32(aKey, szHdr);
61268 d = szHdr;
61269 u = 0;
61270 while( idx<szHdr && u<p->nField && d<=nKey ){
@@ -61185,35 +61279,10 @@
61279 pMem++;
61280 u++;
61281 }
61282 assert( u<=pKeyInfo->nField + 1 );
61283 p->nField = u;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
61284 }
61285
61286 /*
61287 ** This function compares the two table rows or index records
61288 ** specified by {nKey1, pKey1} and pPKey2. It returns a negative, zero
@@ -61540,10 +61609,11 @@
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:
@@ -62847,10 +62917,11 @@
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:
@@ -63002,10 +63073,11 @@
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:
@@ -63471,10 +63543,11 @@
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:
@@ -63559,10 +63632,11 @@
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
@@ -63853,10 +63927,11 @@
63927 } bb;
63928 struct OP_Found_stack_vars {
63929 int alreadyExists;
63930 VdbeCursor *pC;
63931 int res;
63932 char *pFree;
63933 UnpackedRecord *pIdxKey;
63934 UnpackedRecord r;
63935 char aTempRec[ROUND8(sizeof(UnpackedRecord)) + sizeof(Mem)*3 + 7];
63936 } bc;
63937 struct OP_IsUnique_stack_vars {
@@ -67097,10 +67172,11 @@
67172 case OP_Found: { /* jump, in3 */
67173 #if 0 /* local variables moved into u.bc */
67174 int alreadyExists;
67175 VdbeCursor *pC;
67176 int res;
67177 char *pFree;
67178 UnpackedRecord *pIdxKey;
67179 UnpackedRecord r;
67180 char aTempRec[ROUND8(sizeof(UnpackedRecord)) + sizeof(Mem)*3 + 7];
67181 #endif /* local variables moved into u.bc */
67182
@@ -67125,22 +67201,22 @@
67201 { int i; for(i=0; i<u.bc.r.nField; i++) assert( memIsValid(&u.bc.r.aMem[i]) ); }
67202 #endif
67203 u.bc.r.flags = UNPACKED_PREFIX_MATCH;
67204 u.bc.pIdxKey = &u.bc.r;
67205 }else{
67206 u.bc.pIdxKey = sqlite3VdbeAllocUnpackedRecord(
67207 u.bc.pC->pKeyInfo, u.bc.aTempRec, sizeof(u.bc.aTempRec), &u.bc.pFree
67208 );
67209 if( u.bc.pIdxKey==0 ) goto no_mem;
67210 assert( pIn3->flags & MEM_Blob );
67211 assert( (pIn3->flags & MEM_Zero)==0 ); /* zeroblobs already expanded */
67212 sqlite3VdbeRecordUnpack(u.bc.pC->pKeyInfo, pIn3->n, pIn3->z, u.bc.pIdxKey);
 
 
 
 
67213 u.bc.pIdxKey->flags |= UNPACKED_PREFIX_MATCH;
67214 }
67215 rc = sqlite3BtreeMovetoUnpacked(u.bc.pC->pCursor, u.bc.pIdxKey, 0, 0, &u.bc.res);
67216 if( pOp->p4.i==0 ){
67217 sqlite3DbFree(db, u.bc.pFree);
67218 }
67219 if( rc!=SQLITE_OK ){
67220 break;
67221 }
67222 u.bc.alreadyExists = (u.bc.res==0);
@@ -69784,10 +69860,11 @@
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:
@@ -70254,10 +70331,11 @@
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:
@@ -70358,12 +70436,11 @@
70436 sqlite3_file *pTemp1; /* PMA file 1 */
70437 int nPMA; /* Number of PMAs stored in pTemp1 */
70438 SorterRecord *pRecord; /* Head of in-memory record list */
70439 int mnPmaSize; /* Minimum PMA size, in bytes */
70440 int mxPmaSize; /* Maximum PMA size, in bytes. 0==no limit */
70441 UnpackedRecord *pUnpacked; /* Used to unpack keys */
 
70442 };
70443
70444 /*
70445 ** The following type is an iterator for a PMA. It caches the current key in
70446 ** variables nKey/aKey. If the iterator is at EOF, pFile==0.
@@ -70553,56 +70630,39 @@
70630 ** be less than key2. Even if key2 also contains NULL values.
70631 **
70632 ** If pKey2 is passed a NULL pointer, then it is assumed that the pCsr->aSpace
70633 ** has been allocated and contains an unpacked record that is used as key2.
70634 */
70635 static void vdbeSorterCompare(
70636 VdbeCursor *pCsr, /* Cursor object (for pKeyInfo) */
70637 int bOmitRowid, /* Ignore rowid field at end of keys */
70638 void *pKey1, int nKey1, /* Left side of comparison */
70639 void *pKey2, int nKey2, /* Right side of comparison */
70640 int *pRes /* OUT: Result of comparison */
70641 ){
70642 KeyInfo *pKeyInfo = pCsr->pKeyInfo;
70643 VdbeSorter *pSorter = pCsr->pSorter;
70644 UnpackedRecord *r2 = pSorter->pUnpacked;
 
 
70645 int i;
70646
 
 
 
 
 
 
 
 
70647 if( pKey2 ){
70648 sqlite3VdbeRecordUnpack(pKeyInfo, nKey2, pKey2, r2);
 
 
 
 
 
 
70649 }
70650
70651 if( bOmitRowid ){
70652 r2->nField = pKeyInfo->nField;
70653 assert( r2->nField>0 );
70654 for(i=0; i<r2->nField; i++){
70655 if( r2->aMem[i].flags & MEM_Null ){
70656 *pRes = -1;
70657 return;
70658 }
70659 }
70660 r2->flags |= UNPACKED_PREFIX_MATCH;
 
 
70661 }
70662
70663 *pRes = sqlite3VdbeRecordCompare(nKey1, pKey1, r2);
 
70664 }
70665
70666 /*
70667 ** This function is called to compare two iterator keys when merging
70668 ** multiple b-tree segments. Parameter iOut is the index of the aTree[]
@@ -70633,19 +70693,14 @@
70693 iRes = i2;
70694 }else if( p2->pFile==0 ){
70695 iRes = i1;
70696 }else{
70697 int res;
70698 assert( pCsr->pSorter->pUnpacked!=0 ); /* allocated in vdbeSorterMerge() */
70699 vdbeSorterCompare(
 
70700 pCsr, 0, p1->aKey, p1->nKey, p2->aKey, p2->nKey, &res
70701 );
 
 
 
 
70702 if( res<=0 ){
70703 iRes = i1;
70704 }else{
70705 iRes = i2;
70706 }
@@ -70660,16 +70715,21 @@
70715 */
70716 SQLITE_PRIVATE int sqlite3VdbeSorterInit(sqlite3 *db, VdbeCursor *pCsr){
70717 int pgsz; /* Page size of main database */
70718 int mxCache; /* Cache size */
70719 VdbeSorter *pSorter; /* The new sorter */
70720 char *d; /* Dummy */
70721
70722 assert( pCsr->pKeyInfo && pCsr->pBt==0 );
70723 pCsr->pSorter = pSorter = sqlite3DbMallocZero(db, sizeof(VdbeSorter));
70724 if( pSorter==0 ){
70725 return SQLITE_NOMEM;
70726 }
70727
70728 pSorter->pUnpacked = sqlite3VdbeAllocUnpackedRecord(pCsr->pKeyInfo, 0, 0, &d);
70729 if( pSorter->pUnpacked==0 ) return SQLITE_NOMEM;
70730 assert( pSorter->pUnpacked==(UnpackedRecord *)d );
70731
70732 if( !sqlite3TempInMemory(db) ){
70733 pgsz = sqlite3BtreeGetPageSize(db->aDb[0].pBt);
70734 pSorter->mnPmaSize = SORTER_MIN_WORKING * pgsz;
70735 mxCache = db->aDb[0].pSchema->cache_size;
@@ -70707,11 +70767,11 @@
70767 }
70768 if( pSorter->pTemp1 ){
70769 sqlite3OsCloseFree(pSorter->pTemp1);
70770 }
70771 vdbeSorterRecordFree(db, pSorter->pRecord);
70772 sqlite3DbFree(db, pSorter->pUnpacked);
70773 sqlite3DbFree(db, pSorter);
70774 pCsr->pSorter = 0;
70775 }
70776 }
70777
@@ -70728,36 +70788,26 @@
70788 SQLITE_OPEN_EXCLUSIVE | SQLITE_OPEN_DELETEONCLOSE, &dummy
70789 );
70790 }
70791
70792 /*
70793 ** Merge the two sorted lists p1 and p2 into a single list.
70794 ** Set *ppOut to the head of the new list.
70795 */
70796 static void vdbeSorterMerge(
 
70797 VdbeCursor *pCsr, /* For pKeyInfo */
70798 SorterRecord *p1, /* First list to merge */
70799 SorterRecord *p2, /* Second list to merge */
70800 SorterRecord **ppOut /* OUT: Head of merged list */
70801 ){
 
70802 SorterRecord *pFinal = 0;
70803 SorterRecord **pp = &pFinal;
70804 void *pVal2 = p2 ? p2->pVal : 0;
70805
70806 while( p1 && p2 ){
70807 int res;
70808 vdbeSorterCompare(pCsr, 0, p1->pVal, p1->nVal, pVal2, p2->nVal, &res);
 
 
 
 
 
 
 
 
70809 if( res<=0 ){
70810 *pp = p1;
70811 pp = &p1->pNext;
70812 p1 = p1->pNext;
70813 pVal2 = 0;
@@ -70768,22 +70818,19 @@
70818 if( p2==0 ) break;
70819 pVal2 = p2->pVal;
70820 }
70821 }
70822 *pp = p1 ? p1 : p2;
 
70823 *ppOut = pFinal;
 
70824 }
70825
70826 /*
70827 ** Sort the linked list of records headed at pCsr->pRecord. Return SQLITE_OK
70828 ** if successful, or an SQLite error code (i.e. SQLITE_NOMEM) if an error
70829 ** occurs.
70830 */
70831 static int vdbeSorterSort(VdbeCursor *pCsr){
 
70832 int i;
70833 SorterRecord **aSlot;
70834 SorterRecord *p;
70835 VdbeSorter *pSorter = pCsr->pSorter;
70836
@@ -70794,34 +70841,26 @@
70841
70842 p = pSorter->pRecord;
70843 while( p ){
70844 SorterRecord *pNext = p->pNext;
70845 p->pNext = 0;
70846 for(i=0; aSlot[i]; i++){
70847 vdbeSorterMerge(pCsr, p, aSlot[i], &p);
70848 aSlot[i] = 0;
70849 }
 
 
 
 
70850 aSlot[i] = p;
70851 p = pNext;
70852 }
70853
70854 p = 0;
70855 for(i=0; i<64; i++){
70856 vdbeSorterMerge(pCsr, p, aSlot[i], &p);
 
 
 
 
70857 }
70858 pSorter->pRecord = p;
70859
70860 sqlite3_free(aSlot);
70861 return SQLITE_OK;
70862 }
70863
70864
70865 /*
70866 ** Write the current contents of the in-memory linked-list to a PMA. Return
@@ -70843,11 +70882,11 @@
70882 if( pSorter->nInMemory==0 ){
70883 assert( pSorter->pRecord==0 );
70884 return rc;
70885 }
70886
70887 rc = vdbeSorterSort(pCsr);
70888
70889 /* If the first temporary PMA file has not been opened, open it now. */
70890 if( rc==SQLITE_OK && pSorter->pTemp1==0 ){
70891 rc = vdbeSorterOpenTempFile(db, &pSorter->pTemp1);
70892 assert( rc!=SQLITE_OK || pSorter->pTemp1 );
@@ -70990,11 +71029,11 @@
71029 ** sort the VdbeSorter.pRecord list. The vdbe layer will read data directly
71030 ** from the in-memory list. */
71031 if( pSorter->nPMA==0 ){
71032 *pbEof = !pSorter->pRecord;
71033 assert( pSorter->aTree==0 );
71034 return vdbeSorterSort(pCsr);
71035 }
71036
71037 /* Write the current b-tree to a PMA. Close the b-tree cursor. */
71038 rc = vdbeSorterListToPMA(db, pCsr);
71039 if( rc!=SQLITE_OK ) return rc;
@@ -71160,24 +71199,23 @@
71199 SQLITE_PRIVATE int sqlite3VdbeSorterCompare(
71200 VdbeCursor *pCsr, /* Sorter cursor */
71201 Mem *pVal, /* Value to compare to current sorter key */
71202 int *pRes /* OUT: Result of comparison */
71203 ){
 
71204 VdbeSorter *pSorter = pCsr->pSorter;
71205 void *pKey; int nKey; /* Sorter key to compare pVal with */
71206
71207 pKey = vdbeSorterRowkey(pSorter, &nKey);
71208 vdbeSorterCompare(pCsr, 1, pVal->z, pVal->n, pKey, nKey, pRes);
71209 return SQLITE_OK;
 
71210 }
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:
@@ -71414,10 +71452,11 @@
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:
@@ -71675,10 +71714,11 @@
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:
@@ -71813,10 +71853,11 @@
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:
@@ -73033,10 +73074,11 @@
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:
@@ -76793,10 +76835,11 @@
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:
@@ -77621,10 +77664,11 @@
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:
@@ -78342,10 +78386,11 @@
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:
@@ -78901,10 +78946,11 @@
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:
@@ -79152,10 +79198,11 @@
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:
@@ -82955,10 +83002,11 @@
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:
@@ -83414,10 +83462,11 @@
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:
@@ -84068,10 +84117,11 @@
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:
@@ -85676,10 +85726,11 @@
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 **
@@ -86896,10 +86947,11 @@
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:
@@ -88741,10 +88793,11 @@
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:
@@ -88888,10 +88941,11 @@
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:
@@ -88908,10 +88962,11 @@
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:
@@ -89336,10 +89391,11 @@
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 /*
@@ -89975,10 +90031,11 @@
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:
@@ -91503,10 +91560,11 @@
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:
@@ -92363,10 +92421,11 @@
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:
@@ -96922,10 +96981,11 @@
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:
@@ -97121,10 +97181,11 @@
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 **
@@ -98246,10 +98307,11 @@
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:
@@ -98918,10 +98980,11 @@
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:
@@ -99264,10 +99327,11 @@
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:
@@ -100332,10 +100396,11 @@
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:
@@ -105518,10 +105583,11 @@
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()
@@ -105530,10 +105596,11 @@
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.
@@ -105577,10 +105644,11 @@
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 */
@@ -105596,10 +105664,11 @@
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(
@@ -105611,10 +105680,11 @@
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 */
@@ -105625,10 +105695,11 @@
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;
@@ -105636,10 +105707,11 @@
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 */
@@ -105650,10 +105722,11 @@
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)
@@ -106905,17 +106978,21 @@
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 */
@@ -106927,19 +107004,23 @@
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 */
@@ -106947,29 +107028,37 @@
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 }
@@ -107151,14 +107240,16 @@
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.
@@ -107595,66 +107686,94 @@
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);
@@ -107664,44 +107783,56 @@
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);
@@ -107721,256 +107852,373 @@
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;
@@ -107977,180 +108225,260 @@
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 ){
@@ -108160,32 +108488,40 @@
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);
@@ -108192,47 +108528,59 @@
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);
@@ -108239,12 +108587,14 @@
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);
@@ -108252,40 +108602,56 @@
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 ){
@@ -108295,12 +108661,14 @@
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 ()
@@ -108322,12 +108690,14 @@
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);
@@ -108336,12 +108706,14 @@
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);
@@ -108351,12 +108723,14 @@
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);
@@ -108367,12 +108741,14 @@
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);
@@ -108381,12 +108757,14 @@
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);
@@ -108394,38 +108772,50 @@
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);
@@ -108433,12 +108823,14 @@
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);
@@ -108446,214 +108838,307 @@
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);
@@ -108751,15 +109236,17 @@
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
@@ -108949,10 +109436,11 @@
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:
@@ -109014,10 +109502,11 @@
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
@@ -109287,10 +109776,11 @@
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.
@@ -109751,10 +110241,11 @@
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:
@@ -110036,10 +110527,11 @@
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:
@@ -110056,10 +110548,11 @@
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:
@@ -110084,14 +110577,16 @@
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:
@@ -110116,14 +110611,16 @@
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:
@@ -110149,10 +110646,11 @@
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.
@@ -113079,10 +113577,11 @@
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:
@@ -113412,10 +113911,11 @@
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:
@@ -113708,10 +114208,11 @@
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:
@@ -113746,10 +114247,11 @@
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 **
@@ -113900,12 +114402,14 @@
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:
@@ -114017,10 +114521,11 @@
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.
@@ -114493,10 +114998,11 @@
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
@@ -116264,11 +116770,41 @@
116770 char *aOut;
116771 int bFirstOut = 0;
116772
116773 *paOut = 0;
116774 *pnOut = 0;
116775
116776 /* Allocate space for the output. Both the input and output doclists
116777 ** are delta encoded. If they are in ascending order (bDescDoclist==0),
116778 ** then the first docid in each list is simply encoded as a varint. For
116779 ** each subsequent docid, the varint stored is the difference between the
116780 ** current and previous docid (a positive number - since the list is in
116781 ** ascending order).
116782 **
116783 ** The first docid written to the output is therefore encoded using the
116784 ** same number of bytes as it is in whichever of the input lists it is
116785 ** read from. And each subsequent docid read from the same input list
116786 ** consumes either the same or less bytes as it did in the input (since
116787 ** the difference between it and the previous value in the output must
116788 ** be a positive value less than or equal to the delta value read from
116789 ** the input list). The same argument applies to all but the first docid
116790 ** read from the 'other' list. And to the contents of all position lists
116791 ** that will be copied and merged from the input to the output.
116792 **
116793 ** However, if the first docid copied to the output is a negative number,
116794 ** then the encoding of the first docid from the 'other' input list may
116795 ** be larger in the output than it was in the input (since the delta value
116796 ** may be a larger positive integer than the actual docid).
116797 **
116798 ** The space required to store the output is therefore the sum of the
116799 ** sizes of the two inputs, plus enough space for exactly one of the input
116800 ** docids to grow.
116801 **
116802 ** A symetric argument may be made if the doclists are in descending
116803 ** order.
116804 */
116805 aOut = sqlite3_malloc(n1+n2+FTS3_VARINT_MAX-1);
116806 if( !aOut ) return SQLITE_NOMEM;
116807
116808 p = aOut;
116809 fts3GetDeltaVarint3(&p1, pEnd1, 0, &i1);
116810 fts3GetDeltaVarint3(&p2, pEnd2, 0, &i2);
@@ -116291,10 +116827,11 @@
116827 }
116828 }
116829
116830 *paOut = aOut;
116831 *pnOut = (p-aOut);
116832 assert( *pnOut<=n1+n2+FTS3_VARINT_MAX-1 );
116833 return SQLITE_OK;
116834 }
116835
116836 /*
116837 ** This function does a "phrase" merge of two doclists. In a phrase merge,
@@ -119011,10 +119548,11 @@
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:
@@ -119487,10 +120025,11 @@
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:
@@ -120453,10 +120992,11 @@
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:
@@ -120837,10 +121377,11 @@
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:
@@ -121483,10 +122024,11 @@
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:
@@ -121974,10 +122516,11 @@
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:
@@ -122208,10 +122751,11 @@
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:
@@ -125478,10 +126022,11 @@
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:
@@ -126979,10 +127524,11 @@
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:
@@ -130260,10 +130806,11 @@
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:
@@ -130762,10 +131309,11 @@
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
+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-04 01:27:00 6b657ae75035eb10b0ad640998d3c9eadfdffa6e"
112
+#define SQLITE_SOURCE_ID "2011-09-14 13:41:40 a1f3aeeb0988c848d40ce8f6da6e902935a997e2"
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-04 01:27:00 6b657ae75035eb10b0ad640998d3c9eadfdffa6e"
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-14 13:41:40 a1f3aeeb0988c848d40ce8f6da6e902935a997e2"
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