Fossil SCM

SQLite 3.27.2

jan.nijtmans 2019-02-25 22:56 branch-2.8
Commit 367831eaac4349e60f424a474044711232057e829ba0ee0a12d05d38206d6b02
2 files changed +170 -182 +4 -4
+170 -182
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -1,8 +1,8 @@
11
/******************************************************************************
22
** This file is an amalgamation of many separate C source files from SQLite
3
-** version 3.27.1. By combining all the individual C code files into this
3
+** version 3.27.2. By combining all the individual C code files into this
44
** single large file, the entire code can be compiled as a single translation
55
** unit. This allows many compilers to do optimizations that would not be
66
** possible if the files were compiled separately. Performance improvements
77
** of 5% or more are commonly seen when SQLite is compiled as a single
88
** translation unit.
@@ -1160,13 +1160,13 @@
11601160
**
11611161
** See also: [sqlite3_libversion()],
11621162
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
11631163
** [sqlite_version()] and [sqlite_source_id()].
11641164
*/
1165
-#define SQLITE_VERSION "3.27.1"
1166
-#define SQLITE_VERSION_NUMBER 3027001
1167
-#define SQLITE_SOURCE_ID "2019-02-08 13:17:39 0eca3dd3d38b31c92b49ca2d311128b74584714d9e7de895b1a6286ef959a1dd"
1165
+#define SQLITE_VERSION "3.27.2"
1166
+#define SQLITE_VERSION_NUMBER 3027002
1167
+#define SQLITE_SOURCE_ID "2019-02-25 16:06:06 bd49a8271d650fa89e446b42e513b595a717b9212c91dd384aab871fc1d0f6d7"
11681168
11691169
/*
11701170
** CAPI3REF: Run-Time Library Version Numbers
11711171
** KEYWORDS: sqlite3_version sqlite3_sourceid
11721172
**
@@ -3406,11 +3406,11 @@
34063406
** ^Changes made as part of [foreign key actions] are included in the
34073407
** count, but those made as part of REPLACE constraint resolution are
34083408
** not. ^Changes to a view that are intercepted by INSTEAD OF triggers
34093409
** are not counted.
34103410
**
3411
-** This the [sqlite3_total_changes(D)] interface only reports the number
3411
+** The [sqlite3_total_changes(D)] interface only reports the number
34123412
** of rows that changed due to SQL statement run against database
34133413
** connection D. Any changes by other database connections are ignored.
34143414
** To detect changes against a database file from other database
34153415
** connections use the [PRAGMA data_version] command or the
34163416
** [SQLITE_FCNTL_DATA_VERSION] [file control].
@@ -14935,61 +14935,60 @@
1493514935
#define OP_ColumnsUsed 118
1493614936
#define OP_SeekHit 119 /* synopsis: seekHit=P2 */
1493714937
#define OP_Sequence 120 /* synopsis: r[P2]=cursor[P1].ctr++ */
1493814938
#define OP_NewRowid 121 /* synopsis: r[P2]=rowid */
1493914939
#define OP_Insert 122 /* synopsis: intkey=r[P3] data=r[P2] */
14940
-#define OP_InsertInt 123 /* synopsis: intkey=P3 data=r[P2] */
14941
-#define OP_Delete 124
14942
-#define OP_ResetCount 125
14943
-#define OP_SorterCompare 126 /* synopsis: if key(P1)!=trim(r[P3],P4) goto P2 */
14944
-#define OP_SorterData 127 /* synopsis: r[P2]=data */
14945
-#define OP_RowData 128 /* synopsis: r[P2]=data */
14946
-#define OP_Rowid 129 /* synopsis: r[P2]=rowid */
14947
-#define OP_NullRow 130
14948
-#define OP_SeekEnd 131
14949
-#define OP_SorterInsert 132 /* synopsis: key=r[P2] */
14950
-#define OP_IdxInsert 133 /* synopsis: key=r[P2] */
14951
-#define OP_IdxDelete 134 /* synopsis: key=r[P2@P3] */
14952
-#define OP_DeferredSeek 135 /* synopsis: Move P3 to P1.rowid if needed */
14953
-#define OP_IdxRowid 136 /* synopsis: r[P2]=rowid */
14954
-#define OP_Destroy 137
14955
-#define OP_Clear 138
14956
-#define OP_ResetSorter 139
14957
-#define OP_CreateBtree 140 /* synopsis: r[P2]=root iDb=P1 flags=P3 */
14940
+#define OP_Delete 123
14941
+#define OP_ResetCount 124
14942
+#define OP_SorterCompare 125 /* synopsis: if key(P1)!=trim(r[P3],P4) goto P2 */
14943
+#define OP_SorterData 126 /* synopsis: r[P2]=data */
14944
+#define OP_RowData 127 /* synopsis: r[P2]=data */
14945
+#define OP_Rowid 128 /* synopsis: r[P2]=rowid */
14946
+#define OP_NullRow 129
14947
+#define OP_SeekEnd 130
14948
+#define OP_SorterInsert 131 /* synopsis: key=r[P2] */
14949
+#define OP_IdxInsert 132 /* synopsis: key=r[P2] */
14950
+#define OP_IdxDelete 133 /* synopsis: key=r[P2@P3] */
14951
+#define OP_DeferredSeek 134 /* synopsis: Move P3 to P1.rowid if needed */
14952
+#define OP_IdxRowid 135 /* synopsis: r[P2]=rowid */
14953
+#define OP_Destroy 136
14954
+#define OP_Clear 137
14955
+#define OP_ResetSorter 138
14956
+#define OP_CreateBtree 139 /* synopsis: r[P2]=root iDb=P1 flags=P3 */
14957
+#define OP_SqlExec 140
1495814958
#define OP_Real 141 /* same as TK_FLOAT, synopsis: r[P2]=P4 */
14959
-#define OP_SqlExec 142
14960
-#define OP_ParseSchema 143
14961
-#define OP_LoadAnalysis 144
14962
-#define OP_DropTable 145
14963
-#define OP_DropIndex 146
14964
-#define OP_DropTrigger 147
14965
-#define OP_IntegrityCk 148
14966
-#define OP_RowSetAdd 149 /* synopsis: rowset(P1)=r[P2] */
14967
-#define OP_Param 150
14968
-#define OP_FkCounter 151 /* synopsis: fkctr[P1]+=P2 */
14969
-#define OP_MemMax 152 /* synopsis: r[P1]=max(r[P1],r[P2]) */
14970
-#define OP_OffsetLimit 153 /* synopsis: if r[P1]>0 then r[P2]=r[P1]+max(0,r[P3]) else r[P2]=(-1) */
14971
-#define OP_AggInverse 154 /* synopsis: accum=r[P3] inverse(r[P2@P5]) */
14972
-#define OP_AggStep 155 /* synopsis: accum=r[P3] step(r[P2@P5]) */
14973
-#define OP_AggStep1 156 /* synopsis: accum=r[P3] step(r[P2@P5]) */
14974
-#define OP_AggValue 157 /* synopsis: r[P3]=value N=P2 */
14975
-#define OP_AggFinal 158 /* synopsis: accum=r[P1] N=P2 */
14976
-#define OP_Expire 159
14977
-#define OP_TableLock 160 /* synopsis: iDb=P1 root=P2 write=P3 */
14978
-#define OP_VBegin 161
14979
-#define OP_VCreate 162
14980
-#define OP_VDestroy 163
14981
-#define OP_VOpen 164
14982
-#define OP_VColumn 165 /* synopsis: r[P3]=vcolumn(P2) */
14983
-#define OP_VRename 166
14984
-#define OP_Pagecount 167
14985
-#define OP_MaxPgcnt 168
14986
-#define OP_Trace 169
14987
-#define OP_CursorHint 170
14988
-#define OP_Noop 171
14989
-#define OP_Explain 172
14990
-#define OP_Abortable 173
14959
+#define OP_ParseSchema 142
14960
+#define OP_LoadAnalysis 143
14961
+#define OP_DropTable 144
14962
+#define OP_DropIndex 145
14963
+#define OP_DropTrigger 146
14964
+#define OP_IntegrityCk 147
14965
+#define OP_RowSetAdd 148 /* synopsis: rowset(P1)=r[P2] */
14966
+#define OP_Param 149
14967
+#define OP_FkCounter 150 /* synopsis: fkctr[P1]+=P2 */
14968
+#define OP_MemMax 151 /* synopsis: r[P1]=max(r[P1],r[P2]) */
14969
+#define OP_OffsetLimit 152 /* synopsis: if r[P1]>0 then r[P2]=r[P1]+max(0,r[P3]) else r[P2]=(-1) */
14970
+#define OP_AggInverse 153 /* synopsis: accum=r[P3] inverse(r[P2@P5]) */
14971
+#define OP_AggStep 154 /* synopsis: accum=r[P3] step(r[P2@P5]) */
14972
+#define OP_AggStep1 155 /* synopsis: accum=r[P3] step(r[P2@P5]) */
14973
+#define OP_AggValue 156 /* synopsis: r[P3]=value N=P2 */
14974
+#define OP_AggFinal 157 /* synopsis: accum=r[P1] N=P2 */
14975
+#define OP_Expire 158
14976
+#define OP_TableLock 159 /* synopsis: iDb=P1 root=P2 write=P3 */
14977
+#define OP_VBegin 160
14978
+#define OP_VCreate 161
14979
+#define OP_VDestroy 162
14980
+#define OP_VOpen 163
14981
+#define OP_VColumn 164 /* synopsis: r[P3]=vcolumn(P2) */
14982
+#define OP_VRename 165
14983
+#define OP_Pagecount 166
14984
+#define OP_MaxPgcnt 167
14985
+#define OP_Trace 168
14986
+#define OP_CursorHint 169
14987
+#define OP_Noop 170
14988
+#define OP_Explain 171
14989
+#define OP_Abortable 172
1499114990
1499214991
/* Properties such as "out2" or "jump" that are specified in
1499314992
** comments following the "case" for each opcode in the vdbe.c
1499414993
** are encoded into bitvectors as follows:
1499514994
*/
@@ -15014,16 +15013,16 @@
1501415013
/* 88 */ 0x12, 0x20, 0x00, 0x00, 0x26, 0x26, 0x26, 0x26,\
1501515014
/* 96 */ 0x26, 0x26, 0x26, 0x26, 0x26, 0x26, 0x00, 0x12,\
1501615015
/* 104 */ 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,\
1501715016
/* 112 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\
1501815017
/* 120 */ 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\
15019
-/* 128 */ 0x00, 0x10, 0x00, 0x00, 0x04, 0x04, 0x00, 0x00,\
15020
-/* 136 */ 0x10, 0x10, 0x00, 0x00, 0x10, 0x10, 0x00, 0x00,\
15021
-/* 144 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x10, 0x00,\
15022
-/* 152 */ 0x04, 0x1a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\
15023
-/* 160 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10,\
15024
-/* 168 */ 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,}
15018
+/* 128 */ 0x10, 0x00, 0x00, 0x04, 0x04, 0x00, 0x00, 0x10,\
15019
+/* 136 */ 0x10, 0x00, 0x00, 0x10, 0x00, 0x10, 0x00, 0x00,\
15020
+/* 144 */ 0x00, 0x00, 0x00, 0x00, 0x06, 0x10, 0x00, 0x04,\
15021
+/* 152 */ 0x1a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\
15022
+/* 160 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10,\
15023
+/* 168 */ 0x00, 0x00, 0x00, 0x00, 0x00,}
1502515024
1502615025
/* The sqlite3P2Values() routine is able to run faster if it knows
1502715026
** the value of the largest JUMP opcode. The smaller the maximum
1502815027
** JUMP opcode the better, so the mkopcodeh.tcl script that
1502915028
** generated this include file strives to group all JUMP opcodes
@@ -19172,11 +19171,11 @@
1917219171
SQLITE_PRIVATE void sqlite3AlterRenameTable(Parse*, SrcList*, Token*);
1917319172
SQLITE_PRIVATE void sqlite3AlterRenameColumn(Parse*, SrcList*, Token*, Token*);
1917419173
SQLITE_PRIVATE int sqlite3GetToken(const unsigned char *, int *);
1917519174
SQLITE_PRIVATE void sqlite3NestedParse(Parse*, const char*, ...);
1917619175
SQLITE_PRIVATE void sqlite3ExpirePreparedStatements(sqlite3*, int);
19177
-SQLITE_PRIVATE void sqlite3CodeRhsOfIN(Parse*, Expr*, int, int);
19176
+SQLITE_PRIVATE void sqlite3CodeRhsOfIN(Parse*, Expr*, int);
1917819177
SQLITE_PRIVATE int sqlite3CodeSubselect(Parse*, Expr*);
1917919178
SQLITE_PRIVATE void sqlite3SelectPrep(Parse*, Select*, NameContext*);
1918019179
SQLITE_PRIVATE void sqlite3SelectWrongNumTermsError(Parse *pParse, Select *p);
1918119180
SQLITE_PRIVATE int sqlite3MatchSpanName(const char*, const char*, const char*, const char*);
1918219181
SQLITE_PRIVATE int sqlite3ResolveExprNames(NameContext*, Expr*);
@@ -32137,61 +32136,60 @@
3213732136
/* 118 */ "ColumnsUsed" OpHelp(""),
3213832137
/* 119 */ "SeekHit" OpHelp("seekHit=P2"),
3213932138
/* 120 */ "Sequence" OpHelp("r[P2]=cursor[P1].ctr++"),
3214032139
/* 121 */ "NewRowid" OpHelp("r[P2]=rowid"),
3214132140
/* 122 */ "Insert" OpHelp("intkey=r[P3] data=r[P2]"),
32142
- /* 123 */ "InsertInt" OpHelp("intkey=P3 data=r[P2]"),
32143
- /* 124 */ "Delete" OpHelp(""),
32144
- /* 125 */ "ResetCount" OpHelp(""),
32145
- /* 126 */ "SorterCompare" OpHelp("if key(P1)!=trim(r[P3],P4) goto P2"),
32146
- /* 127 */ "SorterData" OpHelp("r[P2]=data"),
32147
- /* 128 */ "RowData" OpHelp("r[P2]=data"),
32148
- /* 129 */ "Rowid" OpHelp("r[P2]=rowid"),
32149
- /* 130 */ "NullRow" OpHelp(""),
32150
- /* 131 */ "SeekEnd" OpHelp(""),
32151
- /* 132 */ "SorterInsert" OpHelp("key=r[P2]"),
32152
- /* 133 */ "IdxInsert" OpHelp("key=r[P2]"),
32153
- /* 134 */ "IdxDelete" OpHelp("key=r[P2@P3]"),
32154
- /* 135 */ "DeferredSeek" OpHelp("Move P3 to P1.rowid if needed"),
32155
- /* 136 */ "IdxRowid" OpHelp("r[P2]=rowid"),
32156
- /* 137 */ "Destroy" OpHelp(""),
32157
- /* 138 */ "Clear" OpHelp(""),
32158
- /* 139 */ "ResetSorter" OpHelp(""),
32159
- /* 140 */ "CreateBtree" OpHelp("r[P2]=root iDb=P1 flags=P3"),
32141
+ /* 123 */ "Delete" OpHelp(""),
32142
+ /* 124 */ "ResetCount" OpHelp(""),
32143
+ /* 125 */ "SorterCompare" OpHelp("if key(P1)!=trim(r[P3],P4) goto P2"),
32144
+ /* 126 */ "SorterData" OpHelp("r[P2]=data"),
32145
+ /* 127 */ "RowData" OpHelp("r[P2]=data"),
32146
+ /* 128 */ "Rowid" OpHelp("r[P2]=rowid"),
32147
+ /* 129 */ "NullRow" OpHelp(""),
32148
+ /* 130 */ "SeekEnd" OpHelp(""),
32149
+ /* 131 */ "SorterInsert" OpHelp("key=r[P2]"),
32150
+ /* 132 */ "IdxInsert" OpHelp("key=r[P2]"),
32151
+ /* 133 */ "IdxDelete" OpHelp("key=r[P2@P3]"),
32152
+ /* 134 */ "DeferredSeek" OpHelp("Move P3 to P1.rowid if needed"),
32153
+ /* 135 */ "IdxRowid" OpHelp("r[P2]=rowid"),
32154
+ /* 136 */ "Destroy" OpHelp(""),
32155
+ /* 137 */ "Clear" OpHelp(""),
32156
+ /* 138 */ "ResetSorter" OpHelp(""),
32157
+ /* 139 */ "CreateBtree" OpHelp("r[P2]=root iDb=P1 flags=P3"),
32158
+ /* 140 */ "SqlExec" OpHelp(""),
3216032159
/* 141 */ "Real" OpHelp("r[P2]=P4"),
32161
- /* 142 */ "SqlExec" OpHelp(""),
32162
- /* 143 */ "ParseSchema" OpHelp(""),
32163
- /* 144 */ "LoadAnalysis" OpHelp(""),
32164
- /* 145 */ "DropTable" OpHelp(""),
32165
- /* 146 */ "DropIndex" OpHelp(""),
32166
- /* 147 */ "DropTrigger" OpHelp(""),
32167
- /* 148 */ "IntegrityCk" OpHelp(""),
32168
- /* 149 */ "RowSetAdd" OpHelp("rowset(P1)=r[P2]"),
32169
- /* 150 */ "Param" OpHelp(""),
32170
- /* 151 */ "FkCounter" OpHelp("fkctr[P1]+=P2"),
32171
- /* 152 */ "MemMax" OpHelp("r[P1]=max(r[P1],r[P2])"),
32172
- /* 153 */ "OffsetLimit" OpHelp("if r[P1]>0 then r[P2]=r[P1]+max(0,r[P3]) else r[P2]=(-1)"),
32173
- /* 154 */ "AggInverse" OpHelp("accum=r[P3] inverse(r[P2@P5])"),
32174
- /* 155 */ "AggStep" OpHelp("accum=r[P3] step(r[P2@P5])"),
32175
- /* 156 */ "AggStep1" OpHelp("accum=r[P3] step(r[P2@P5])"),
32176
- /* 157 */ "AggValue" OpHelp("r[P3]=value N=P2"),
32177
- /* 158 */ "AggFinal" OpHelp("accum=r[P1] N=P2"),
32178
- /* 159 */ "Expire" OpHelp(""),
32179
- /* 160 */ "TableLock" OpHelp("iDb=P1 root=P2 write=P3"),
32180
- /* 161 */ "VBegin" OpHelp(""),
32181
- /* 162 */ "VCreate" OpHelp(""),
32182
- /* 163 */ "VDestroy" OpHelp(""),
32183
- /* 164 */ "VOpen" OpHelp(""),
32184
- /* 165 */ "VColumn" OpHelp("r[P3]=vcolumn(P2)"),
32185
- /* 166 */ "VRename" OpHelp(""),
32186
- /* 167 */ "Pagecount" OpHelp(""),
32187
- /* 168 */ "MaxPgcnt" OpHelp(""),
32188
- /* 169 */ "Trace" OpHelp(""),
32189
- /* 170 */ "CursorHint" OpHelp(""),
32190
- /* 171 */ "Noop" OpHelp(""),
32191
- /* 172 */ "Explain" OpHelp(""),
32192
- /* 173 */ "Abortable" OpHelp(""),
32160
+ /* 142 */ "ParseSchema" OpHelp(""),
32161
+ /* 143 */ "LoadAnalysis" OpHelp(""),
32162
+ /* 144 */ "DropTable" OpHelp(""),
32163
+ /* 145 */ "DropIndex" OpHelp(""),
32164
+ /* 146 */ "DropTrigger" OpHelp(""),
32165
+ /* 147 */ "IntegrityCk" OpHelp(""),
32166
+ /* 148 */ "RowSetAdd" OpHelp("rowset(P1)=r[P2]"),
32167
+ /* 149 */ "Param" OpHelp(""),
32168
+ /* 150 */ "FkCounter" OpHelp("fkctr[P1]+=P2"),
32169
+ /* 151 */ "MemMax" OpHelp("r[P1]=max(r[P1],r[P2])"),
32170
+ /* 152 */ "OffsetLimit" OpHelp("if r[P1]>0 then r[P2]=r[P1]+max(0,r[P3]) else r[P2]=(-1)"),
32171
+ /* 153 */ "AggInverse" OpHelp("accum=r[P3] inverse(r[P2@P5])"),
32172
+ /* 154 */ "AggStep" OpHelp("accum=r[P3] step(r[P2@P5])"),
32173
+ /* 155 */ "AggStep1" OpHelp("accum=r[P3] step(r[P2@P5])"),
32174
+ /* 156 */ "AggValue" OpHelp("r[P3]=value N=P2"),
32175
+ /* 157 */ "AggFinal" OpHelp("accum=r[P1] N=P2"),
32176
+ /* 158 */ "Expire" OpHelp(""),
32177
+ /* 159 */ "TableLock" OpHelp("iDb=P1 root=P2 write=P3"),
32178
+ /* 160 */ "VBegin" OpHelp(""),
32179
+ /* 161 */ "VCreate" OpHelp(""),
32180
+ /* 162 */ "VDestroy" OpHelp(""),
32181
+ /* 163 */ "VOpen" OpHelp(""),
32182
+ /* 164 */ "VColumn" OpHelp("r[P3]=vcolumn(P2)"),
32183
+ /* 165 */ "VRename" OpHelp(""),
32184
+ /* 166 */ "Pagecount" OpHelp(""),
32185
+ /* 167 */ "MaxPgcnt" OpHelp(""),
32186
+ /* 168 */ "Trace" OpHelp(""),
32187
+ /* 169 */ "CursorHint" OpHelp(""),
32188
+ /* 170 */ "Noop" OpHelp(""),
32189
+ /* 171 */ "Explain" OpHelp(""),
32190
+ /* 172 */ "Abortable" OpHelp(""),
3219332191
};
3219432192
return azName[i];
3219532193
}
3219632194
#endif
3219732195
@@ -87933,18 +87931,11 @@
8793387931
** cause any problems.)
8793487932
**
8793587933
** This instruction only works on tables. The equivalent instruction
8793687934
** for indices is OP_IdxInsert.
8793787935
*/
87938
-/* Opcode: InsertInt P1 P2 P3 P4 P5
87939
-** Synopsis: intkey=P3 data=r[P2]
87940
-**
87941
-** This works exactly like OP_Insert except that the key is the
87942
-** integer value P3, not the value of the integer stored in register P3.
87943
-*/
87944
-case OP_Insert:
87945
-case OP_InsertInt: {
87936
+case OP_Insert: {
8794687937
Mem *pData; /* MEM cell holding data for the record to be inserted */
8794787938
Mem *pKey; /* MEM cell holding key for the record */
8794887939
VdbeCursor *pC; /* Cursor to table into which insert is written */
8794987940
int seekResult; /* Result of prior seek or 0 if no USESEEKRESULT flag */
8795087941
const char *zDb; /* database name - used by the update hook */
@@ -87961,20 +87952,15 @@
8796187952
assert( (pOp->p5 & OPFLAG_ISNOOP) || pC->isTable );
8796287953
assert( pOp->p4type==P4_TABLE || pOp->p4type>=P4_STATIC );
8796387954
REGISTER_TRACE(pOp->p2, pData);
8796487955
sqlite3VdbeIncrWriteCounter(p, pC);
8796587956
87966
- if( pOp->opcode==OP_Insert ){
87967
- pKey = &aMem[pOp->p3];
87968
- assert( pKey->flags & MEM_Int );
87969
- assert( memIsValid(pKey) );
87970
- REGISTER_TRACE(pOp->p3, pKey);
87971
- x.nKey = pKey->u.i;
87972
- }else{
87973
- assert( pOp->opcode==OP_InsertInt );
87974
- x.nKey = pOp->p3;
87975
- }
87957
+ pKey = &aMem[pOp->p3];
87958
+ assert( pKey->flags & MEM_Int );
87959
+ assert( memIsValid(pKey) );
87960
+ REGISTER_TRACE(pOp->p3, pKey);
87961
+ x.nKey = pKey->u.i;
8797687962
8797787963
if( pOp->p4type==P4_TABLE && HAS_UPDATE_HOOK(db) ){
8797887964
assert( pC->iDb>=0 );
8797987965
zDb = db->aDb[pC->iDb].zDbSName;
8798087966
pTab = pOp->p4.pTab;
@@ -96129,10 +96115,42 @@
9612996115
}
9613096116
}
9613196117
return 0;
9613296118
}
9613396119
96120
+#ifndef SQLITE_OMIT_WINDOWFUNC
96121
+/*
96122
+** Walker callback for resolveRemoveWindows().
96123
+*/
96124
+static int resolveRemoveWindowsCb(Walker *pWalker, Expr *pExpr){
96125
+ if( ExprHasProperty(pExpr, EP_WinFunc) ){
96126
+ Window **pp;
96127
+ for(pp=&pWalker->u.pSelect->pWin; *pp; pp=&(*pp)->pNextWin){
96128
+ if( *pp==pExpr->y.pWin ){
96129
+ *pp = (*pp)->pNextWin;
96130
+ break;
96131
+ }
96132
+ }
96133
+ }
96134
+ return WRC_Continue;
96135
+}
96136
+
96137
+/*
96138
+** Remove any Window objects owned by the expression pExpr from the
96139
+** Select.pWin list of Select object pSelect.
96140
+*/
96141
+static void resolveRemoveWindows(Select *pSelect, Expr *pExpr){
96142
+ Walker sWalker;
96143
+ memset(&sWalker, 0, sizeof(Walker));
96144
+ sWalker.xExprCallback = resolveRemoveWindowsCb;
96145
+ sWalker.u.pSelect = pSelect;
96146
+ sqlite3WalkExpr(&sWalker, pExpr);
96147
+}
96148
+#else
96149
+# define resolveRemoveWindows(x,y)
96150
+#endif
96151
+
9613496152
/*
9613596153
** pOrderBy is an ORDER BY or GROUP BY clause in SELECT statement pSelect.
9613696154
** The Name context of the SELECT statement is pNC. zType is either
9613796155
** "ORDER" or "GROUP" depending on which type of clause pOrderBy is.
9613896156
**
@@ -96195,23 +96213,14 @@
9619596213
if( sqlite3ResolveExprNames(pNC, pE) ){
9619696214
return 1;
9619796215
}
9619896216
for(j=0; j<pSelect->pEList->nExpr; j++){
9619996217
if( sqlite3ExprCompare(0, pE, pSelect->pEList->a[j].pExpr, -1)==0 ){
96200
-#ifndef SQLITE_OMIT_WINDOWFUNC
96201
- if( ExprHasProperty(pE, EP_WinFunc) ){
96202
- /* Since this window function is being changed into a reference
96203
- ** to the same window function the result set, remove the instance
96204
- ** of this window function from the Select.pWin list. */
96205
- Window **pp;
96206
- for(pp=&pSelect->pWin; *pp; pp=&(*pp)->pNextWin){
96207
- if( *pp==pE->y.pWin ){
96208
- *pp = (*pp)->pNextWin;
96209
- }
96210
- }
96211
- }
96212
-#endif
96218
+ /* Since this expresion is being changed into a reference
96219
+ ** to an identical expression in the result set, remove all Window
96220
+ ** objects belonging to the expression from the Select.pWin list. */
96221
+ resolveRemoveWindows(pSelect, pE);
9621396222
pItem->u.x.iOrderByCol = j+1;
9621496223
}
9621596224
}
9621696225
}
9621796226
return sqlite3ResolveOrderGroupBy(pParse, pSelect, pOrderBy, zType);
@@ -99179,18 +99188,15 @@
9917999188
u32 savedNQueryLoop = pParse->nQueryLoop;
9918099189
int rMayHaveNull = 0;
9918199190
eType = IN_INDEX_EPH;
9918299191
if( inFlags & IN_INDEX_LOOP ){
9918399192
pParse->nQueryLoop = 0;
99184
- if( pX->pLeft->iColumn<0 && !ExprHasProperty(pX, EP_xIsSelect) ){
99185
- eType = IN_INDEX_ROWID;
99186
- }
9918799193
}else if( prRhsHasNull ){
9918899194
*prRhsHasNull = rMayHaveNull = ++pParse->nMem;
9918999195
}
9919099196
assert( pX->op==TK_IN );
99191
- sqlite3CodeRhsOfIN(pParse, pX, iTab, eType==IN_INDEX_ROWID);
99197
+ sqlite3CodeRhsOfIN(pParse, pX, iTab);
9919299198
if( rMayHaveNull ){
9919399199
sqlite3SetHasNullFlag(v, iTab, rMayHaveNull);
9919499200
}
9919599201
pParse->nQueryLoop = savedNQueryLoop;
9919699202
}
@@ -99287,16 +99293,10 @@
9928799293
** constructed ephermeral table is returned. The first time the ephemeral
9928899294
** table is computed, the cursor number is also stored in pExpr->iTable,
9928999295
** however the cursor number returned might not be the same, as it might
9929099296
** have been duplicated using OP_OpenDup.
9929199297
**
99292
-** If parameter isRowid is non-zero, then LHS of the IN operator is guaranteed
99293
-** to be a non-null integer. In this case, the ephemeral table can be an
99294
-** table B-Tree that keyed by only integers. The more general cases uses
99295
-** an index B-Tree which can have arbitrary keys, but is slower to both
99296
-** read and write.
99297
-**
9929899298
** If the LHS expression ("x" in the examples) is a column value, or
9929999299
** the SELECT statement returns a column value, then the affinity of that
9930099300
** column is used to build the index keys. If both 'x' and the
9930199301
** SELECT... statement are columns, then numeric affinity is used
9930299302
** if either column has NUMERIC or INTEGER affinity. If neither
@@ -99304,12 +99304,11 @@
9930499304
** is used.
9930599305
*/
9930699306
SQLITE_PRIVATE void sqlite3CodeRhsOfIN(
9930799307
Parse *pParse, /* Parsing context */
9930899308
Expr *pExpr, /* The IN operator */
99309
- int iTab, /* Use this cursor number */
99310
- int isRowid /* If true, LHS is a rowid */
99309
+ int iTab /* Use this cursor number */
9931199310
){
9931299311
int addrOnce = 0; /* Address of the OP_Once instruction at top */
9931399312
int addr; /* Address of OP_OpenEphemeral instruction */
9931499313
Expr *pLeft; /* the LHS of the IN operator */
9931599314
KeyInfo *pKeyInfo = 0; /* Key information */
@@ -99358,26 +99357,24 @@
9935899357
}
9935999358
9936099359
/* Check to see if this is a vector IN operator */
9936199360
pLeft = pExpr->pLeft;
9936299361
nVal = sqlite3ExprVectorSize(pLeft);
99363
- assert( !isRowid || nVal==1 );
9936499362
9936599363
/* Construct the ephemeral table that will contain the content of
9936699364
** RHS of the IN operator.
9936799365
*/
9936899366
pExpr->iTable = iTab;
99369
- addr = sqlite3VdbeAddOp2(v, OP_OpenEphemeral,
99370
- pExpr->iTable, (isRowid?0:nVal));
99367
+ addr = sqlite3VdbeAddOp2(v, OP_OpenEphemeral, pExpr->iTable, nVal);
9937199368
#ifdef SQLITE_ENABLE_EXPLAIN_COMMENTS
9937299369
if( ExprHasProperty(pExpr, EP_xIsSelect) ){
9937399370
VdbeComment((v, "Result of SELECT %u", pExpr->x.pSelect->selId));
9937499371
}else{
9937599372
VdbeComment((v, "RHS of IN operator"));
9937699373
}
9937799374
#endif
99378
- pKeyInfo = isRowid ? 0 : sqlite3KeyInfoAlloc(pParse->db, nVal, 1);
99375
+ pKeyInfo = sqlite3KeyInfoAlloc(pParse->db, nVal, 1);
9937999376
9938099377
if( ExprHasProperty(pExpr, EP_xIsSelect) ){
9938199378
/* Case 1: expr IN (SELECT ...)
9938299379
**
9938399380
** Generate code to write the results of the select into the temporary
@@ -99387,11 +99384,10 @@
9938799384
ExprList *pEList = pSelect->pEList;
9938899385
9938999386
ExplainQueryPlan((pParse, 1, "%sLIST SUBQUERY %d",
9939099387
addrOnce?"":"CORRELATED ", pSelect->selId
9939199388
));
99392
- assert( !isRowid );
9939399389
/* If the LHS and RHS of the IN operator do not match, that
9939499390
** error will have been caught long before we reach this point. */
9939599391
if( ALWAYS(pEList->nExpr==nVal) ){
9939699392
SelectDest dest;
9939799393
int i;
@@ -99440,14 +99436,12 @@
9944099436
}
9944199437
9944299438
/* Loop through each expression in <exprlist>. */
9944399439
r1 = sqlite3GetTempReg(pParse);
9944499440
r2 = sqlite3GetTempReg(pParse);
99445
- if( isRowid ) sqlite3VdbeAddOp4(v, OP_Blob, 0, r2, 0, "", P4_STATIC);
9944699441
for(i=pList->nExpr, pItem=pList->a; i>0; i--, pItem++){
9944799442
Expr *pE2 = pItem->pExpr;
99448
- int iValToIns;
9944999443
9945099444
/* If the expression is not constant then we will need to
9945199445
** disable the test that was generated above that makes sure
9945299446
** this code only executes once. Because for a non-constant
9945399447
** expression we need to rerun this code each time.
@@ -99456,24 +99450,13 @@
9945699450
sqlite3VdbeChangeToNoop(v, addrOnce);
9945799451
addrOnce = 0;
9945899452
}
9945999453
9946099454
/* Evaluate the expression and insert it into the temp table */
99461
- if( isRowid && sqlite3ExprIsInteger(pE2, &iValToIns) ){
99462
- sqlite3VdbeAddOp3(v, OP_InsertInt, iTab, r2, iValToIns);
99463
- }else{
99464
- r3 = sqlite3ExprCodeTarget(pParse, pE2, r1);
99465
- if( isRowid ){
99466
- sqlite3VdbeAddOp2(v, OP_MustBeInt, r3,
99467
- sqlite3VdbeCurrentAddr(v)+2);
99468
- VdbeCoverage(v);
99469
- sqlite3VdbeAddOp3(v, OP_Insert, iTab, r2, r3);
99470
- }else{
99471
- sqlite3VdbeAddOp4(v, OP_MakeRecord, r3, 1, r2, &affinity, 1);
99472
- sqlite3VdbeAddOp4Int(v, OP_IdxInsert, iTab, r2, r3, 1);
99473
- }
99474
- }
99455
+ r3 = sqlite3ExprCodeTarget(pParse, pE2, r1);
99456
+ sqlite3VdbeAddOp4(v, OP_MakeRecord, r3, 1, r2, &affinity, 1);
99457
+ sqlite3VdbeAddOp4Int(v, OP_IdxInsert, iTab, r2, r3, 1);
9947599458
}
9947699459
sqlite3ReleaseTempReg(pParse, r1);
9947799460
sqlite3ReleaseTempReg(pParse, r2);
9947899461
}
9947999462
if( pKeyInfo ){
@@ -118105,14 +118088,17 @@
118105118088
assert( pParse->nested==0 );
118106118089
pik_flags |= OPFLAG_NCHANGE;
118107118090
pik_flags |= (update_flags & OPFLAG_SAVEPOSITION);
118108118091
#ifdef SQLITE_ENABLE_PREUPDATE_HOOK
118109118092
if( update_flags==0 ){
118110
- sqlite3VdbeAddOp4(v, OP_InsertInt,
118111
- iIdxCur+i, aRegIdx[i], 0, (char*)pTab, P4_TABLE
118093
+ int r = sqlite3GetTempReg(pParse);
118094
+ sqlite3VdbeAddOp2(v, OP_Integer, 0, r);
118095
+ sqlite3VdbeAddOp4(v, OP_Insert,
118096
+ iIdxCur+i, aRegIdx[i], r, (char*)pTab, P4_TABLE
118112118097
);
118113118098
sqlite3VdbeChangeP5(v, OPFLAG_ISNOOP);
118099
+ sqlite3ReleaseTempReg(pParse, r);
118114118100
}
118115118101
#endif
118116118102
}
118117118103
sqlite3VdbeAddOp4Int(v, OP_IdxInsert, iIdxCur+i, aRegIdx[i],
118118118104
aRegIdx[i]+1,
@@ -136425,11 +136411,10 @@
136425136411
pIn += i;
136426136412
for(i=iEq;i<pLoop->nLTerm; i++){
136427136413
if( pLoop->aLTerm[i]->pExpr==pX ){
136428136414
int iOut = iReg + i - iEq;
136429136415
if( eType==IN_INDEX_ROWID ){
136430
- testcase( nEq>1 ); /* Happens with a UNIQUE index on ROWID */
136431136416
pIn->addrInTop = sqlite3VdbeAddOp2(v, OP_Rowid, iTab, iOut);
136432136417
}else{
136433136418
int iCol = aiMap ? aiMap[iMap++] : 0;
136434136419
pIn->addrInTop = sqlite3VdbeAddOp3(v,OP_Column,iTab, iCol, iOut);
136435136420
}
@@ -137187,10 +137172,13 @@
137187137172
if( iRowidReg!=iReleaseReg ) sqlite3ReleaseTempReg(pParse, iReleaseReg);
137188137173
addrNxt = pLevel->addrNxt;
137189137174
sqlite3VdbeAddOp3(v, OP_SeekRowid, iCur, addrNxt, iRowidReg);
137190137175
VdbeCoverage(v);
137191137176
pLevel->op = OP_Noop;
137177
+ if( (pTerm->prereqAll & pLevel->notReady)==0 ){
137178
+ pTerm->wtFlags |= TERM_CODED;
137179
+ }
137192137180
}else if( (pLoop->wsFlags & WHERE_IPK)!=0
137193137181
&& (pLoop->wsFlags & WHERE_COLUMN_RANGE)!=0
137194137182
){
137195137183
/* Case 3: We have an inequality comparison against the ROWID field.
137196137184
*/
@@ -217074,11 +217062,11 @@
217074217062
int nArg, /* Number of args */
217075217063
sqlite3_value **apUnused /* Function arguments */
217076217064
){
217077217065
assert( nArg==0 );
217078217066
UNUSED_PARAM2(nArg, apUnused);
217079
- sqlite3_result_text(pCtx, "fts5: 2019-02-08 13:17:39 0eca3dd3d38b31c92b49ca2d311128b74584714d9e7de895b1a6286ef959a1dd", -1, SQLITE_TRANSIENT);
217067
+ sqlite3_result_text(pCtx, "fts5: 2019-02-25 16:06:06 bd49a8271d650fa89e446b42e513b595a717b9212c91dd384aab871fc1d0f6d7", -1, SQLITE_TRANSIENT);
217080217068
}
217081217069
217082217070
/*
217083217071
** Return true if zName is the extension on one of the shadow tables used
217084217072
** by this module.
@@ -221838,12 +221826,12 @@
221838221826
}
221839221827
#endif /* SQLITE_CORE */
221840221828
#endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_STMTVTAB) */
221841221829
221842221830
/************** End of stmt.c ************************************************/
221843
-#if __LINE__!=221843
221831
+#if __LINE__!=221831
221844221832
#undef SQLITE_SOURCE_ID
221845
-#define SQLITE_SOURCE_ID "2019-02-08 13:17:39 0eca3dd3d38b31c92b49ca2d311128b74584714d9e7de895b1a6286ef959alt2"
221833
+#define SQLITE_SOURCE_ID "2019-02-25 16:06:06 bd49a8271d650fa89e446b42e513b595a717b9212c91dd384aab871fc1d0alt2"
221846221834
#endif
221847221835
/* Return the source-id for this library */
221848221836
SQLITE_API const char *sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; }
221849221837
/************************** End of sqlite3.c ******************************/
221850221838
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -1,8 +1,8 @@
1 /******************************************************************************
2 ** This file is an amalgamation of many separate C source files from SQLite
3 ** version 3.27.1. By combining all the individual C code files into this
4 ** single large file, the entire code can be compiled as a single translation
5 ** unit. This allows many compilers to do optimizations that would not be
6 ** possible if the files were compiled separately. Performance improvements
7 ** of 5% or more are commonly seen when SQLite is compiled as a single
8 ** translation unit.
@@ -1160,13 +1160,13 @@
1160 **
1161 ** See also: [sqlite3_libversion()],
1162 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
1163 ** [sqlite_version()] and [sqlite_source_id()].
1164 */
1165 #define SQLITE_VERSION "3.27.1"
1166 #define SQLITE_VERSION_NUMBER 3027001
1167 #define SQLITE_SOURCE_ID "2019-02-08 13:17:39 0eca3dd3d38b31c92b49ca2d311128b74584714d9e7de895b1a6286ef959a1dd"
1168
1169 /*
1170 ** CAPI3REF: Run-Time Library Version Numbers
1171 ** KEYWORDS: sqlite3_version sqlite3_sourceid
1172 **
@@ -3406,11 +3406,11 @@
3406 ** ^Changes made as part of [foreign key actions] are included in the
3407 ** count, but those made as part of REPLACE constraint resolution are
3408 ** not. ^Changes to a view that are intercepted by INSTEAD OF triggers
3409 ** are not counted.
3410 **
3411 ** This the [sqlite3_total_changes(D)] interface only reports the number
3412 ** of rows that changed due to SQL statement run against database
3413 ** connection D. Any changes by other database connections are ignored.
3414 ** To detect changes against a database file from other database
3415 ** connections use the [PRAGMA data_version] command or the
3416 ** [SQLITE_FCNTL_DATA_VERSION] [file control].
@@ -14935,61 +14935,60 @@
14935 #define OP_ColumnsUsed 118
14936 #define OP_SeekHit 119 /* synopsis: seekHit=P2 */
14937 #define OP_Sequence 120 /* synopsis: r[P2]=cursor[P1].ctr++ */
14938 #define OP_NewRowid 121 /* synopsis: r[P2]=rowid */
14939 #define OP_Insert 122 /* synopsis: intkey=r[P3] data=r[P2] */
14940 #define OP_InsertInt 123 /* synopsis: intkey=P3 data=r[P2] */
14941 #define OP_Delete 124
14942 #define OP_ResetCount 125
14943 #define OP_SorterCompare 126 /* synopsis: if key(P1)!=trim(r[P3],P4) goto P2 */
14944 #define OP_SorterData 127 /* synopsis: r[P2]=data */
14945 #define OP_RowData 128 /* synopsis: r[P2]=data */
14946 #define OP_Rowid 129 /* synopsis: r[P2]=rowid */
14947 #define OP_NullRow 130
14948 #define OP_SeekEnd 131
14949 #define OP_SorterInsert 132 /* synopsis: key=r[P2] */
14950 #define OP_IdxInsert 133 /* synopsis: key=r[P2] */
14951 #define OP_IdxDelete 134 /* synopsis: key=r[P2@P3] */
14952 #define OP_DeferredSeek 135 /* synopsis: Move P3 to P1.rowid if needed */
14953 #define OP_IdxRowid 136 /* synopsis: r[P2]=rowid */
14954 #define OP_Destroy 137
14955 #define OP_Clear 138
14956 #define OP_ResetSorter 139
14957 #define OP_CreateBtree 140 /* synopsis: r[P2]=root iDb=P1 flags=P3 */
14958 #define OP_Real 141 /* same as TK_FLOAT, synopsis: r[P2]=P4 */
14959 #define OP_SqlExec 142
14960 #define OP_ParseSchema 143
14961 #define OP_LoadAnalysis 144
14962 #define OP_DropTable 145
14963 #define OP_DropIndex 146
14964 #define OP_DropTrigger 147
14965 #define OP_IntegrityCk 148
14966 #define OP_RowSetAdd 149 /* synopsis: rowset(P1)=r[P2] */
14967 #define OP_Param 150
14968 #define OP_FkCounter 151 /* synopsis: fkctr[P1]+=P2 */
14969 #define OP_MemMax 152 /* synopsis: r[P1]=max(r[P1],r[P2]) */
14970 #define OP_OffsetLimit 153 /* synopsis: if r[P1]>0 then r[P2]=r[P1]+max(0,r[P3]) else r[P2]=(-1) */
14971 #define OP_AggInverse 154 /* synopsis: accum=r[P3] inverse(r[P2@P5]) */
14972 #define OP_AggStep 155 /* synopsis: accum=r[P3] step(r[P2@P5]) */
14973 #define OP_AggStep1 156 /* synopsis: accum=r[P3] step(r[P2@P5]) */
14974 #define OP_AggValue 157 /* synopsis: r[P3]=value N=P2 */
14975 #define OP_AggFinal 158 /* synopsis: accum=r[P1] N=P2 */
14976 #define OP_Expire 159
14977 #define OP_TableLock 160 /* synopsis: iDb=P1 root=P2 write=P3 */
14978 #define OP_VBegin 161
14979 #define OP_VCreate 162
14980 #define OP_VDestroy 163
14981 #define OP_VOpen 164
14982 #define OP_VColumn 165 /* synopsis: r[P3]=vcolumn(P2) */
14983 #define OP_VRename 166
14984 #define OP_Pagecount 167
14985 #define OP_MaxPgcnt 168
14986 #define OP_Trace 169
14987 #define OP_CursorHint 170
14988 #define OP_Noop 171
14989 #define OP_Explain 172
14990 #define OP_Abortable 173
14991
14992 /* Properties such as "out2" or "jump" that are specified in
14993 ** comments following the "case" for each opcode in the vdbe.c
14994 ** are encoded into bitvectors as follows:
14995 */
@@ -15014,16 +15013,16 @@
15014 /* 88 */ 0x12, 0x20, 0x00, 0x00, 0x26, 0x26, 0x26, 0x26,\
15015 /* 96 */ 0x26, 0x26, 0x26, 0x26, 0x26, 0x26, 0x00, 0x12,\
15016 /* 104 */ 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,\
15017 /* 112 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\
15018 /* 120 */ 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\
15019 /* 128 */ 0x00, 0x10, 0x00, 0x00, 0x04, 0x04, 0x00, 0x00,\
15020 /* 136 */ 0x10, 0x10, 0x00, 0x00, 0x10, 0x10, 0x00, 0x00,\
15021 /* 144 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x10, 0x00,\
15022 /* 152 */ 0x04, 0x1a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\
15023 /* 160 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10,\
15024 /* 168 */ 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,}
15025
15026 /* The sqlite3P2Values() routine is able to run faster if it knows
15027 ** the value of the largest JUMP opcode. The smaller the maximum
15028 ** JUMP opcode the better, so the mkopcodeh.tcl script that
15029 ** generated this include file strives to group all JUMP opcodes
@@ -19172,11 +19171,11 @@
19172 SQLITE_PRIVATE void sqlite3AlterRenameTable(Parse*, SrcList*, Token*);
19173 SQLITE_PRIVATE void sqlite3AlterRenameColumn(Parse*, SrcList*, Token*, Token*);
19174 SQLITE_PRIVATE int sqlite3GetToken(const unsigned char *, int *);
19175 SQLITE_PRIVATE void sqlite3NestedParse(Parse*, const char*, ...);
19176 SQLITE_PRIVATE void sqlite3ExpirePreparedStatements(sqlite3*, int);
19177 SQLITE_PRIVATE void sqlite3CodeRhsOfIN(Parse*, Expr*, int, int);
19178 SQLITE_PRIVATE int sqlite3CodeSubselect(Parse*, Expr*);
19179 SQLITE_PRIVATE void sqlite3SelectPrep(Parse*, Select*, NameContext*);
19180 SQLITE_PRIVATE void sqlite3SelectWrongNumTermsError(Parse *pParse, Select *p);
19181 SQLITE_PRIVATE int sqlite3MatchSpanName(const char*, const char*, const char*, const char*);
19182 SQLITE_PRIVATE int sqlite3ResolveExprNames(NameContext*, Expr*);
@@ -32137,61 +32136,60 @@
32137 /* 118 */ "ColumnsUsed" OpHelp(""),
32138 /* 119 */ "SeekHit" OpHelp("seekHit=P2"),
32139 /* 120 */ "Sequence" OpHelp("r[P2]=cursor[P1].ctr++"),
32140 /* 121 */ "NewRowid" OpHelp("r[P2]=rowid"),
32141 /* 122 */ "Insert" OpHelp("intkey=r[P3] data=r[P2]"),
32142 /* 123 */ "InsertInt" OpHelp("intkey=P3 data=r[P2]"),
32143 /* 124 */ "Delete" OpHelp(""),
32144 /* 125 */ "ResetCount" OpHelp(""),
32145 /* 126 */ "SorterCompare" OpHelp("if key(P1)!=trim(r[P3],P4) goto P2"),
32146 /* 127 */ "SorterData" OpHelp("r[P2]=data"),
32147 /* 128 */ "RowData" OpHelp("r[P2]=data"),
32148 /* 129 */ "Rowid" OpHelp("r[P2]=rowid"),
32149 /* 130 */ "NullRow" OpHelp(""),
32150 /* 131 */ "SeekEnd" OpHelp(""),
32151 /* 132 */ "SorterInsert" OpHelp("key=r[P2]"),
32152 /* 133 */ "IdxInsert" OpHelp("key=r[P2]"),
32153 /* 134 */ "IdxDelete" OpHelp("key=r[P2@P3]"),
32154 /* 135 */ "DeferredSeek" OpHelp("Move P3 to P1.rowid if needed"),
32155 /* 136 */ "IdxRowid" OpHelp("r[P2]=rowid"),
32156 /* 137 */ "Destroy" OpHelp(""),
32157 /* 138 */ "Clear" OpHelp(""),
32158 /* 139 */ "ResetSorter" OpHelp(""),
32159 /* 140 */ "CreateBtree" OpHelp("r[P2]=root iDb=P1 flags=P3"),
32160 /* 141 */ "Real" OpHelp("r[P2]=P4"),
32161 /* 142 */ "SqlExec" OpHelp(""),
32162 /* 143 */ "ParseSchema" OpHelp(""),
32163 /* 144 */ "LoadAnalysis" OpHelp(""),
32164 /* 145 */ "DropTable" OpHelp(""),
32165 /* 146 */ "DropIndex" OpHelp(""),
32166 /* 147 */ "DropTrigger" OpHelp(""),
32167 /* 148 */ "IntegrityCk" OpHelp(""),
32168 /* 149 */ "RowSetAdd" OpHelp("rowset(P1)=r[P2]"),
32169 /* 150 */ "Param" OpHelp(""),
32170 /* 151 */ "FkCounter" OpHelp("fkctr[P1]+=P2"),
32171 /* 152 */ "MemMax" OpHelp("r[P1]=max(r[P1],r[P2])"),
32172 /* 153 */ "OffsetLimit" OpHelp("if r[P1]>0 then r[P2]=r[P1]+max(0,r[P3]) else r[P2]=(-1)"),
32173 /* 154 */ "AggInverse" OpHelp("accum=r[P3] inverse(r[P2@P5])"),
32174 /* 155 */ "AggStep" OpHelp("accum=r[P3] step(r[P2@P5])"),
32175 /* 156 */ "AggStep1" OpHelp("accum=r[P3] step(r[P2@P5])"),
32176 /* 157 */ "AggValue" OpHelp("r[P3]=value N=P2"),
32177 /* 158 */ "AggFinal" OpHelp("accum=r[P1] N=P2"),
32178 /* 159 */ "Expire" OpHelp(""),
32179 /* 160 */ "TableLock" OpHelp("iDb=P1 root=P2 write=P3"),
32180 /* 161 */ "VBegin" OpHelp(""),
32181 /* 162 */ "VCreate" OpHelp(""),
32182 /* 163 */ "VDestroy" OpHelp(""),
32183 /* 164 */ "VOpen" OpHelp(""),
32184 /* 165 */ "VColumn" OpHelp("r[P3]=vcolumn(P2)"),
32185 /* 166 */ "VRename" OpHelp(""),
32186 /* 167 */ "Pagecount" OpHelp(""),
32187 /* 168 */ "MaxPgcnt" OpHelp(""),
32188 /* 169 */ "Trace" OpHelp(""),
32189 /* 170 */ "CursorHint" OpHelp(""),
32190 /* 171 */ "Noop" OpHelp(""),
32191 /* 172 */ "Explain" OpHelp(""),
32192 /* 173 */ "Abortable" OpHelp(""),
32193 };
32194 return azName[i];
32195 }
32196 #endif
32197
@@ -87933,18 +87931,11 @@
87933 ** cause any problems.)
87934 **
87935 ** This instruction only works on tables. The equivalent instruction
87936 ** for indices is OP_IdxInsert.
87937 */
87938 /* Opcode: InsertInt P1 P2 P3 P4 P5
87939 ** Synopsis: intkey=P3 data=r[P2]
87940 **
87941 ** This works exactly like OP_Insert except that the key is the
87942 ** integer value P3, not the value of the integer stored in register P3.
87943 */
87944 case OP_Insert:
87945 case OP_InsertInt: {
87946 Mem *pData; /* MEM cell holding data for the record to be inserted */
87947 Mem *pKey; /* MEM cell holding key for the record */
87948 VdbeCursor *pC; /* Cursor to table into which insert is written */
87949 int seekResult; /* Result of prior seek or 0 if no USESEEKRESULT flag */
87950 const char *zDb; /* database name - used by the update hook */
@@ -87961,20 +87952,15 @@
87961 assert( (pOp->p5 & OPFLAG_ISNOOP) || pC->isTable );
87962 assert( pOp->p4type==P4_TABLE || pOp->p4type>=P4_STATIC );
87963 REGISTER_TRACE(pOp->p2, pData);
87964 sqlite3VdbeIncrWriteCounter(p, pC);
87965
87966 if( pOp->opcode==OP_Insert ){
87967 pKey = &aMem[pOp->p3];
87968 assert( pKey->flags & MEM_Int );
87969 assert( memIsValid(pKey) );
87970 REGISTER_TRACE(pOp->p3, pKey);
87971 x.nKey = pKey->u.i;
87972 }else{
87973 assert( pOp->opcode==OP_InsertInt );
87974 x.nKey = pOp->p3;
87975 }
87976
87977 if( pOp->p4type==P4_TABLE && HAS_UPDATE_HOOK(db) ){
87978 assert( pC->iDb>=0 );
87979 zDb = db->aDb[pC->iDb].zDbSName;
87980 pTab = pOp->p4.pTab;
@@ -96129,10 +96115,42 @@
96129 }
96130 }
96131 return 0;
96132 }
96133
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
96134 /*
96135 ** pOrderBy is an ORDER BY or GROUP BY clause in SELECT statement pSelect.
96136 ** The Name context of the SELECT statement is pNC. zType is either
96137 ** "ORDER" or "GROUP" depending on which type of clause pOrderBy is.
96138 **
@@ -96195,23 +96213,14 @@
96195 if( sqlite3ResolveExprNames(pNC, pE) ){
96196 return 1;
96197 }
96198 for(j=0; j<pSelect->pEList->nExpr; j++){
96199 if( sqlite3ExprCompare(0, pE, pSelect->pEList->a[j].pExpr, -1)==0 ){
96200 #ifndef SQLITE_OMIT_WINDOWFUNC
96201 if( ExprHasProperty(pE, EP_WinFunc) ){
96202 /* Since this window function is being changed into a reference
96203 ** to the same window function the result set, remove the instance
96204 ** of this window function from the Select.pWin list. */
96205 Window **pp;
96206 for(pp=&pSelect->pWin; *pp; pp=&(*pp)->pNextWin){
96207 if( *pp==pE->y.pWin ){
96208 *pp = (*pp)->pNextWin;
96209 }
96210 }
96211 }
96212 #endif
96213 pItem->u.x.iOrderByCol = j+1;
96214 }
96215 }
96216 }
96217 return sqlite3ResolveOrderGroupBy(pParse, pSelect, pOrderBy, zType);
@@ -99179,18 +99188,15 @@
99179 u32 savedNQueryLoop = pParse->nQueryLoop;
99180 int rMayHaveNull = 0;
99181 eType = IN_INDEX_EPH;
99182 if( inFlags & IN_INDEX_LOOP ){
99183 pParse->nQueryLoop = 0;
99184 if( pX->pLeft->iColumn<0 && !ExprHasProperty(pX, EP_xIsSelect) ){
99185 eType = IN_INDEX_ROWID;
99186 }
99187 }else if( prRhsHasNull ){
99188 *prRhsHasNull = rMayHaveNull = ++pParse->nMem;
99189 }
99190 assert( pX->op==TK_IN );
99191 sqlite3CodeRhsOfIN(pParse, pX, iTab, eType==IN_INDEX_ROWID);
99192 if( rMayHaveNull ){
99193 sqlite3SetHasNullFlag(v, iTab, rMayHaveNull);
99194 }
99195 pParse->nQueryLoop = savedNQueryLoop;
99196 }
@@ -99287,16 +99293,10 @@
99287 ** constructed ephermeral table is returned. The first time the ephemeral
99288 ** table is computed, the cursor number is also stored in pExpr->iTable,
99289 ** however the cursor number returned might not be the same, as it might
99290 ** have been duplicated using OP_OpenDup.
99291 **
99292 ** If parameter isRowid is non-zero, then LHS of the IN operator is guaranteed
99293 ** to be a non-null integer. In this case, the ephemeral table can be an
99294 ** table B-Tree that keyed by only integers. The more general cases uses
99295 ** an index B-Tree which can have arbitrary keys, but is slower to both
99296 ** read and write.
99297 **
99298 ** If the LHS expression ("x" in the examples) is a column value, or
99299 ** the SELECT statement returns a column value, then the affinity of that
99300 ** column is used to build the index keys. If both 'x' and the
99301 ** SELECT... statement are columns, then numeric affinity is used
99302 ** if either column has NUMERIC or INTEGER affinity. If neither
@@ -99304,12 +99304,11 @@
99304 ** is used.
99305 */
99306 SQLITE_PRIVATE void sqlite3CodeRhsOfIN(
99307 Parse *pParse, /* Parsing context */
99308 Expr *pExpr, /* The IN operator */
99309 int iTab, /* Use this cursor number */
99310 int isRowid /* If true, LHS is a rowid */
99311 ){
99312 int addrOnce = 0; /* Address of the OP_Once instruction at top */
99313 int addr; /* Address of OP_OpenEphemeral instruction */
99314 Expr *pLeft; /* the LHS of the IN operator */
99315 KeyInfo *pKeyInfo = 0; /* Key information */
@@ -99358,26 +99357,24 @@
99358 }
99359
99360 /* Check to see if this is a vector IN operator */
99361 pLeft = pExpr->pLeft;
99362 nVal = sqlite3ExprVectorSize(pLeft);
99363 assert( !isRowid || nVal==1 );
99364
99365 /* Construct the ephemeral table that will contain the content of
99366 ** RHS of the IN operator.
99367 */
99368 pExpr->iTable = iTab;
99369 addr = sqlite3VdbeAddOp2(v, OP_OpenEphemeral,
99370 pExpr->iTable, (isRowid?0:nVal));
99371 #ifdef SQLITE_ENABLE_EXPLAIN_COMMENTS
99372 if( ExprHasProperty(pExpr, EP_xIsSelect) ){
99373 VdbeComment((v, "Result of SELECT %u", pExpr->x.pSelect->selId));
99374 }else{
99375 VdbeComment((v, "RHS of IN operator"));
99376 }
99377 #endif
99378 pKeyInfo = isRowid ? 0 : sqlite3KeyInfoAlloc(pParse->db, nVal, 1);
99379
99380 if( ExprHasProperty(pExpr, EP_xIsSelect) ){
99381 /* Case 1: expr IN (SELECT ...)
99382 **
99383 ** Generate code to write the results of the select into the temporary
@@ -99387,11 +99384,10 @@
99387 ExprList *pEList = pSelect->pEList;
99388
99389 ExplainQueryPlan((pParse, 1, "%sLIST SUBQUERY %d",
99390 addrOnce?"":"CORRELATED ", pSelect->selId
99391 ));
99392 assert( !isRowid );
99393 /* If the LHS and RHS of the IN operator do not match, that
99394 ** error will have been caught long before we reach this point. */
99395 if( ALWAYS(pEList->nExpr==nVal) ){
99396 SelectDest dest;
99397 int i;
@@ -99440,14 +99436,12 @@
99440 }
99441
99442 /* Loop through each expression in <exprlist>. */
99443 r1 = sqlite3GetTempReg(pParse);
99444 r2 = sqlite3GetTempReg(pParse);
99445 if( isRowid ) sqlite3VdbeAddOp4(v, OP_Blob, 0, r2, 0, "", P4_STATIC);
99446 for(i=pList->nExpr, pItem=pList->a; i>0; i--, pItem++){
99447 Expr *pE2 = pItem->pExpr;
99448 int iValToIns;
99449
99450 /* If the expression is not constant then we will need to
99451 ** disable the test that was generated above that makes sure
99452 ** this code only executes once. Because for a non-constant
99453 ** expression we need to rerun this code each time.
@@ -99456,24 +99450,13 @@
99456 sqlite3VdbeChangeToNoop(v, addrOnce);
99457 addrOnce = 0;
99458 }
99459
99460 /* Evaluate the expression and insert it into the temp table */
99461 if( isRowid && sqlite3ExprIsInteger(pE2, &iValToIns) ){
99462 sqlite3VdbeAddOp3(v, OP_InsertInt, iTab, r2, iValToIns);
99463 }else{
99464 r3 = sqlite3ExprCodeTarget(pParse, pE2, r1);
99465 if( isRowid ){
99466 sqlite3VdbeAddOp2(v, OP_MustBeInt, r3,
99467 sqlite3VdbeCurrentAddr(v)+2);
99468 VdbeCoverage(v);
99469 sqlite3VdbeAddOp3(v, OP_Insert, iTab, r2, r3);
99470 }else{
99471 sqlite3VdbeAddOp4(v, OP_MakeRecord, r3, 1, r2, &affinity, 1);
99472 sqlite3VdbeAddOp4Int(v, OP_IdxInsert, iTab, r2, r3, 1);
99473 }
99474 }
99475 }
99476 sqlite3ReleaseTempReg(pParse, r1);
99477 sqlite3ReleaseTempReg(pParse, r2);
99478 }
99479 if( pKeyInfo ){
@@ -118105,14 +118088,17 @@
118105 assert( pParse->nested==0 );
118106 pik_flags |= OPFLAG_NCHANGE;
118107 pik_flags |= (update_flags & OPFLAG_SAVEPOSITION);
118108 #ifdef SQLITE_ENABLE_PREUPDATE_HOOK
118109 if( update_flags==0 ){
118110 sqlite3VdbeAddOp4(v, OP_InsertInt,
118111 iIdxCur+i, aRegIdx[i], 0, (char*)pTab, P4_TABLE
 
 
118112 );
118113 sqlite3VdbeChangeP5(v, OPFLAG_ISNOOP);
 
118114 }
118115 #endif
118116 }
118117 sqlite3VdbeAddOp4Int(v, OP_IdxInsert, iIdxCur+i, aRegIdx[i],
118118 aRegIdx[i]+1,
@@ -136425,11 +136411,10 @@
136425 pIn += i;
136426 for(i=iEq;i<pLoop->nLTerm; i++){
136427 if( pLoop->aLTerm[i]->pExpr==pX ){
136428 int iOut = iReg + i - iEq;
136429 if( eType==IN_INDEX_ROWID ){
136430 testcase( nEq>1 ); /* Happens with a UNIQUE index on ROWID */
136431 pIn->addrInTop = sqlite3VdbeAddOp2(v, OP_Rowid, iTab, iOut);
136432 }else{
136433 int iCol = aiMap ? aiMap[iMap++] : 0;
136434 pIn->addrInTop = sqlite3VdbeAddOp3(v,OP_Column,iTab, iCol, iOut);
136435 }
@@ -137187,10 +137172,13 @@
137187 if( iRowidReg!=iReleaseReg ) sqlite3ReleaseTempReg(pParse, iReleaseReg);
137188 addrNxt = pLevel->addrNxt;
137189 sqlite3VdbeAddOp3(v, OP_SeekRowid, iCur, addrNxt, iRowidReg);
137190 VdbeCoverage(v);
137191 pLevel->op = OP_Noop;
 
 
 
137192 }else if( (pLoop->wsFlags & WHERE_IPK)!=0
137193 && (pLoop->wsFlags & WHERE_COLUMN_RANGE)!=0
137194 ){
137195 /* Case 3: We have an inequality comparison against the ROWID field.
137196 */
@@ -217074,11 +217062,11 @@
217074 int nArg, /* Number of args */
217075 sqlite3_value **apUnused /* Function arguments */
217076 ){
217077 assert( nArg==0 );
217078 UNUSED_PARAM2(nArg, apUnused);
217079 sqlite3_result_text(pCtx, "fts5: 2019-02-08 13:17:39 0eca3dd3d38b31c92b49ca2d311128b74584714d9e7de895b1a6286ef959a1dd", -1, SQLITE_TRANSIENT);
217080 }
217081
217082 /*
217083 ** Return true if zName is the extension on one of the shadow tables used
217084 ** by this module.
@@ -221838,12 +221826,12 @@
221838 }
221839 #endif /* SQLITE_CORE */
221840 #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_STMTVTAB) */
221841
221842 /************** End of stmt.c ************************************************/
221843 #if __LINE__!=221843
221844 #undef SQLITE_SOURCE_ID
221845 #define SQLITE_SOURCE_ID "2019-02-08 13:17:39 0eca3dd3d38b31c92b49ca2d311128b74584714d9e7de895b1a6286ef959alt2"
221846 #endif
221847 /* Return the source-id for this library */
221848 SQLITE_API const char *sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; }
221849 /************************** End of sqlite3.c ******************************/
221850
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -1,8 +1,8 @@
1 /******************************************************************************
2 ** This file is an amalgamation of many separate C source files from SQLite
3 ** version 3.27.2. By combining all the individual C code files into this
4 ** single large file, the entire code can be compiled as a single translation
5 ** unit. This allows many compilers to do optimizations that would not be
6 ** possible if the files were compiled separately. Performance improvements
7 ** of 5% or more are commonly seen when SQLite is compiled as a single
8 ** translation unit.
@@ -1160,13 +1160,13 @@
1160 **
1161 ** See also: [sqlite3_libversion()],
1162 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
1163 ** [sqlite_version()] and [sqlite_source_id()].
1164 */
1165 #define SQLITE_VERSION "3.27.2"
1166 #define SQLITE_VERSION_NUMBER 3027002
1167 #define SQLITE_SOURCE_ID "2019-02-25 16:06:06 bd49a8271d650fa89e446b42e513b595a717b9212c91dd384aab871fc1d0f6d7"
1168
1169 /*
1170 ** CAPI3REF: Run-Time Library Version Numbers
1171 ** KEYWORDS: sqlite3_version sqlite3_sourceid
1172 **
@@ -3406,11 +3406,11 @@
3406 ** ^Changes made as part of [foreign key actions] are included in the
3407 ** count, but those made as part of REPLACE constraint resolution are
3408 ** not. ^Changes to a view that are intercepted by INSTEAD OF triggers
3409 ** are not counted.
3410 **
3411 ** The [sqlite3_total_changes(D)] interface only reports the number
3412 ** of rows that changed due to SQL statement run against database
3413 ** connection D. Any changes by other database connections are ignored.
3414 ** To detect changes against a database file from other database
3415 ** connections use the [PRAGMA data_version] command or the
3416 ** [SQLITE_FCNTL_DATA_VERSION] [file control].
@@ -14935,61 +14935,60 @@
14935 #define OP_ColumnsUsed 118
14936 #define OP_SeekHit 119 /* synopsis: seekHit=P2 */
14937 #define OP_Sequence 120 /* synopsis: r[P2]=cursor[P1].ctr++ */
14938 #define OP_NewRowid 121 /* synopsis: r[P2]=rowid */
14939 #define OP_Insert 122 /* synopsis: intkey=r[P3] data=r[P2] */
14940 #define OP_Delete 123
14941 #define OP_ResetCount 124
14942 #define OP_SorterCompare 125 /* synopsis: if key(P1)!=trim(r[P3],P4) goto P2 */
14943 #define OP_SorterData 126 /* synopsis: r[P2]=data */
14944 #define OP_RowData 127 /* synopsis: r[P2]=data */
14945 #define OP_Rowid 128 /* synopsis: r[P2]=rowid */
14946 #define OP_NullRow 129
14947 #define OP_SeekEnd 130
14948 #define OP_SorterInsert 131 /* synopsis: key=r[P2] */
14949 #define OP_IdxInsert 132 /* synopsis: key=r[P2] */
14950 #define OP_IdxDelete 133 /* synopsis: key=r[P2@P3] */
14951 #define OP_DeferredSeek 134 /* synopsis: Move P3 to P1.rowid if needed */
14952 #define OP_IdxRowid 135 /* synopsis: r[P2]=rowid */
14953 #define OP_Destroy 136
14954 #define OP_Clear 137
14955 #define OP_ResetSorter 138
14956 #define OP_CreateBtree 139 /* synopsis: r[P2]=root iDb=P1 flags=P3 */
14957 #define OP_SqlExec 140
14958 #define OP_Real 141 /* same as TK_FLOAT, synopsis: r[P2]=P4 */
14959 #define OP_ParseSchema 142
14960 #define OP_LoadAnalysis 143
14961 #define OP_DropTable 144
14962 #define OP_DropIndex 145
14963 #define OP_DropTrigger 146
14964 #define OP_IntegrityCk 147
14965 #define OP_RowSetAdd 148 /* synopsis: rowset(P1)=r[P2] */
14966 #define OP_Param 149
14967 #define OP_FkCounter 150 /* synopsis: fkctr[P1]+=P2 */
14968 #define OP_MemMax 151 /* synopsis: r[P1]=max(r[P1],r[P2]) */
14969 #define OP_OffsetLimit 152 /* synopsis: if r[P1]>0 then r[P2]=r[P1]+max(0,r[P3]) else r[P2]=(-1) */
14970 #define OP_AggInverse 153 /* synopsis: accum=r[P3] inverse(r[P2@P5]) */
14971 #define OP_AggStep 154 /* synopsis: accum=r[P3] step(r[P2@P5]) */
14972 #define OP_AggStep1 155 /* synopsis: accum=r[P3] step(r[P2@P5]) */
14973 #define OP_AggValue 156 /* synopsis: r[P3]=value N=P2 */
14974 #define OP_AggFinal 157 /* synopsis: accum=r[P1] N=P2 */
14975 #define OP_Expire 158
14976 #define OP_TableLock 159 /* synopsis: iDb=P1 root=P2 write=P3 */
14977 #define OP_VBegin 160
14978 #define OP_VCreate 161
14979 #define OP_VDestroy 162
14980 #define OP_VOpen 163
14981 #define OP_VColumn 164 /* synopsis: r[P3]=vcolumn(P2) */
14982 #define OP_VRename 165
14983 #define OP_Pagecount 166
14984 #define OP_MaxPgcnt 167
14985 #define OP_Trace 168
14986 #define OP_CursorHint 169
14987 #define OP_Noop 170
14988 #define OP_Explain 171
14989 #define OP_Abortable 172
 
14990
14991 /* Properties such as "out2" or "jump" that are specified in
14992 ** comments following the "case" for each opcode in the vdbe.c
14993 ** are encoded into bitvectors as follows:
14994 */
@@ -15014,16 +15013,16 @@
15013 /* 88 */ 0x12, 0x20, 0x00, 0x00, 0x26, 0x26, 0x26, 0x26,\
15014 /* 96 */ 0x26, 0x26, 0x26, 0x26, 0x26, 0x26, 0x00, 0x12,\
15015 /* 104 */ 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,\
15016 /* 112 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\
15017 /* 120 */ 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\
15018 /* 128 */ 0x10, 0x00, 0x00, 0x04, 0x04, 0x00, 0x00, 0x10,\
15019 /* 136 */ 0x10, 0x00, 0x00, 0x10, 0x00, 0x10, 0x00, 0x00,\
15020 /* 144 */ 0x00, 0x00, 0x00, 0x00, 0x06, 0x10, 0x00, 0x04,\
15021 /* 152 */ 0x1a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\
15022 /* 160 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10,\
15023 /* 168 */ 0x00, 0x00, 0x00, 0x00, 0x00,}
15024
15025 /* The sqlite3P2Values() routine is able to run faster if it knows
15026 ** the value of the largest JUMP opcode. The smaller the maximum
15027 ** JUMP opcode the better, so the mkopcodeh.tcl script that
15028 ** generated this include file strives to group all JUMP opcodes
@@ -19172,11 +19171,11 @@
19171 SQLITE_PRIVATE void sqlite3AlterRenameTable(Parse*, SrcList*, Token*);
19172 SQLITE_PRIVATE void sqlite3AlterRenameColumn(Parse*, SrcList*, Token*, Token*);
19173 SQLITE_PRIVATE int sqlite3GetToken(const unsigned char *, int *);
19174 SQLITE_PRIVATE void sqlite3NestedParse(Parse*, const char*, ...);
19175 SQLITE_PRIVATE void sqlite3ExpirePreparedStatements(sqlite3*, int);
19176 SQLITE_PRIVATE void sqlite3CodeRhsOfIN(Parse*, Expr*, int);
19177 SQLITE_PRIVATE int sqlite3CodeSubselect(Parse*, Expr*);
19178 SQLITE_PRIVATE void sqlite3SelectPrep(Parse*, Select*, NameContext*);
19179 SQLITE_PRIVATE void sqlite3SelectWrongNumTermsError(Parse *pParse, Select *p);
19180 SQLITE_PRIVATE int sqlite3MatchSpanName(const char*, const char*, const char*, const char*);
19181 SQLITE_PRIVATE int sqlite3ResolveExprNames(NameContext*, Expr*);
@@ -32137,61 +32136,60 @@
32136 /* 118 */ "ColumnsUsed" OpHelp(""),
32137 /* 119 */ "SeekHit" OpHelp("seekHit=P2"),
32138 /* 120 */ "Sequence" OpHelp("r[P2]=cursor[P1].ctr++"),
32139 /* 121 */ "NewRowid" OpHelp("r[P2]=rowid"),
32140 /* 122 */ "Insert" OpHelp("intkey=r[P3] data=r[P2]"),
32141 /* 123 */ "Delete" OpHelp(""),
32142 /* 124 */ "ResetCount" OpHelp(""),
32143 /* 125 */ "SorterCompare" OpHelp("if key(P1)!=trim(r[P3],P4) goto P2"),
32144 /* 126 */ "SorterData" OpHelp("r[P2]=data"),
32145 /* 127 */ "RowData" OpHelp("r[P2]=data"),
32146 /* 128 */ "Rowid" OpHelp("r[P2]=rowid"),
32147 /* 129 */ "NullRow" OpHelp(""),
32148 /* 130 */ "SeekEnd" OpHelp(""),
32149 /* 131 */ "SorterInsert" OpHelp("key=r[P2]"),
32150 /* 132 */ "IdxInsert" OpHelp("key=r[P2]"),
32151 /* 133 */ "IdxDelete" OpHelp("key=r[P2@P3]"),
32152 /* 134 */ "DeferredSeek" OpHelp("Move P3 to P1.rowid if needed"),
32153 /* 135 */ "IdxRowid" OpHelp("r[P2]=rowid"),
32154 /* 136 */ "Destroy" OpHelp(""),
32155 /* 137 */ "Clear" OpHelp(""),
32156 /* 138 */ "ResetSorter" OpHelp(""),
32157 /* 139 */ "CreateBtree" OpHelp("r[P2]=root iDb=P1 flags=P3"),
32158 /* 140 */ "SqlExec" OpHelp(""),
32159 /* 141 */ "Real" OpHelp("r[P2]=P4"),
32160 /* 142 */ "ParseSchema" OpHelp(""),
32161 /* 143 */ "LoadAnalysis" OpHelp(""),
32162 /* 144 */ "DropTable" OpHelp(""),
32163 /* 145 */ "DropIndex" OpHelp(""),
32164 /* 146 */ "DropTrigger" OpHelp(""),
32165 /* 147 */ "IntegrityCk" OpHelp(""),
32166 /* 148 */ "RowSetAdd" OpHelp("rowset(P1)=r[P2]"),
32167 /* 149 */ "Param" OpHelp(""),
32168 /* 150 */ "FkCounter" OpHelp("fkctr[P1]+=P2"),
32169 /* 151 */ "MemMax" OpHelp("r[P1]=max(r[P1],r[P2])"),
32170 /* 152 */ "OffsetLimit" OpHelp("if r[P1]>0 then r[P2]=r[P1]+max(0,r[P3]) else r[P2]=(-1)"),
32171 /* 153 */ "AggInverse" OpHelp("accum=r[P3] inverse(r[P2@P5])"),
32172 /* 154 */ "AggStep" OpHelp("accum=r[P3] step(r[P2@P5])"),
32173 /* 155 */ "AggStep1" OpHelp("accum=r[P3] step(r[P2@P5])"),
32174 /* 156 */ "AggValue" OpHelp("r[P3]=value N=P2"),
32175 /* 157 */ "AggFinal" OpHelp("accum=r[P1] N=P2"),
32176 /* 158 */ "Expire" OpHelp(""),
32177 /* 159 */ "TableLock" OpHelp("iDb=P1 root=P2 write=P3"),
32178 /* 160 */ "VBegin" OpHelp(""),
32179 /* 161 */ "VCreate" OpHelp(""),
32180 /* 162 */ "VDestroy" OpHelp(""),
32181 /* 163 */ "VOpen" OpHelp(""),
32182 /* 164 */ "VColumn" OpHelp("r[P3]=vcolumn(P2)"),
32183 /* 165 */ "VRename" OpHelp(""),
32184 /* 166 */ "Pagecount" OpHelp(""),
32185 /* 167 */ "MaxPgcnt" OpHelp(""),
32186 /* 168 */ "Trace" OpHelp(""),
32187 /* 169 */ "CursorHint" OpHelp(""),
32188 /* 170 */ "Noop" OpHelp(""),
32189 /* 171 */ "Explain" OpHelp(""),
32190 /* 172 */ "Abortable" OpHelp(""),
 
32191 };
32192 return azName[i];
32193 }
32194 #endif
32195
@@ -87933,18 +87931,11 @@
87931 ** cause any problems.)
87932 **
87933 ** This instruction only works on tables. The equivalent instruction
87934 ** for indices is OP_IdxInsert.
87935 */
87936 case OP_Insert: {
 
 
 
 
 
 
 
87937 Mem *pData; /* MEM cell holding data for the record to be inserted */
87938 Mem *pKey; /* MEM cell holding key for the record */
87939 VdbeCursor *pC; /* Cursor to table into which insert is written */
87940 int seekResult; /* Result of prior seek or 0 if no USESEEKRESULT flag */
87941 const char *zDb; /* database name - used by the update hook */
@@ -87961,20 +87952,15 @@
87952 assert( (pOp->p5 & OPFLAG_ISNOOP) || pC->isTable );
87953 assert( pOp->p4type==P4_TABLE || pOp->p4type>=P4_STATIC );
87954 REGISTER_TRACE(pOp->p2, pData);
87955 sqlite3VdbeIncrWriteCounter(p, pC);
87956
87957 pKey = &aMem[pOp->p3];
87958 assert( pKey->flags & MEM_Int );
87959 assert( memIsValid(pKey) );
87960 REGISTER_TRACE(pOp->p3, pKey);
87961 x.nKey = pKey->u.i;
 
 
 
 
 
87962
87963 if( pOp->p4type==P4_TABLE && HAS_UPDATE_HOOK(db) ){
87964 assert( pC->iDb>=0 );
87965 zDb = db->aDb[pC->iDb].zDbSName;
87966 pTab = pOp->p4.pTab;
@@ -96129,10 +96115,42 @@
96115 }
96116 }
96117 return 0;
96118 }
96119
96120 #ifndef SQLITE_OMIT_WINDOWFUNC
96121 /*
96122 ** Walker callback for resolveRemoveWindows().
96123 */
96124 static int resolveRemoveWindowsCb(Walker *pWalker, Expr *pExpr){
96125 if( ExprHasProperty(pExpr, EP_WinFunc) ){
96126 Window **pp;
96127 for(pp=&pWalker->u.pSelect->pWin; *pp; pp=&(*pp)->pNextWin){
96128 if( *pp==pExpr->y.pWin ){
96129 *pp = (*pp)->pNextWin;
96130 break;
96131 }
96132 }
96133 }
96134 return WRC_Continue;
96135 }
96136
96137 /*
96138 ** Remove any Window objects owned by the expression pExpr from the
96139 ** Select.pWin list of Select object pSelect.
96140 */
96141 static void resolveRemoveWindows(Select *pSelect, Expr *pExpr){
96142 Walker sWalker;
96143 memset(&sWalker, 0, sizeof(Walker));
96144 sWalker.xExprCallback = resolveRemoveWindowsCb;
96145 sWalker.u.pSelect = pSelect;
96146 sqlite3WalkExpr(&sWalker, pExpr);
96147 }
96148 #else
96149 # define resolveRemoveWindows(x,y)
96150 #endif
96151
96152 /*
96153 ** pOrderBy is an ORDER BY or GROUP BY clause in SELECT statement pSelect.
96154 ** The Name context of the SELECT statement is pNC. zType is either
96155 ** "ORDER" or "GROUP" depending on which type of clause pOrderBy is.
96156 **
@@ -96195,23 +96213,14 @@
96213 if( sqlite3ResolveExprNames(pNC, pE) ){
96214 return 1;
96215 }
96216 for(j=0; j<pSelect->pEList->nExpr; j++){
96217 if( sqlite3ExprCompare(0, pE, pSelect->pEList->a[j].pExpr, -1)==0 ){
96218 /* Since this expresion is being changed into a reference
96219 ** to an identical expression in the result set, remove all Window
96220 ** objects belonging to the expression from the Select.pWin list. */
96221 resolveRemoveWindows(pSelect, pE);
 
 
 
 
 
 
 
 
 
96222 pItem->u.x.iOrderByCol = j+1;
96223 }
96224 }
96225 }
96226 return sqlite3ResolveOrderGroupBy(pParse, pSelect, pOrderBy, zType);
@@ -99179,18 +99188,15 @@
99188 u32 savedNQueryLoop = pParse->nQueryLoop;
99189 int rMayHaveNull = 0;
99190 eType = IN_INDEX_EPH;
99191 if( inFlags & IN_INDEX_LOOP ){
99192 pParse->nQueryLoop = 0;
 
 
 
99193 }else if( prRhsHasNull ){
99194 *prRhsHasNull = rMayHaveNull = ++pParse->nMem;
99195 }
99196 assert( pX->op==TK_IN );
99197 sqlite3CodeRhsOfIN(pParse, pX, iTab);
99198 if( rMayHaveNull ){
99199 sqlite3SetHasNullFlag(v, iTab, rMayHaveNull);
99200 }
99201 pParse->nQueryLoop = savedNQueryLoop;
99202 }
@@ -99287,16 +99293,10 @@
99293 ** constructed ephermeral table is returned. The first time the ephemeral
99294 ** table is computed, the cursor number is also stored in pExpr->iTable,
99295 ** however the cursor number returned might not be the same, as it might
99296 ** have been duplicated using OP_OpenDup.
99297 **
 
 
 
 
 
 
99298 ** If the LHS expression ("x" in the examples) is a column value, or
99299 ** the SELECT statement returns a column value, then the affinity of that
99300 ** column is used to build the index keys. If both 'x' and the
99301 ** SELECT... statement are columns, then numeric affinity is used
99302 ** if either column has NUMERIC or INTEGER affinity. If neither
@@ -99304,12 +99304,11 @@
99304 ** is used.
99305 */
99306 SQLITE_PRIVATE void sqlite3CodeRhsOfIN(
99307 Parse *pParse, /* Parsing context */
99308 Expr *pExpr, /* The IN operator */
99309 int iTab /* Use this cursor number */
 
99310 ){
99311 int addrOnce = 0; /* Address of the OP_Once instruction at top */
99312 int addr; /* Address of OP_OpenEphemeral instruction */
99313 Expr *pLeft; /* the LHS of the IN operator */
99314 KeyInfo *pKeyInfo = 0; /* Key information */
@@ -99358,26 +99357,24 @@
99357 }
99358
99359 /* Check to see if this is a vector IN operator */
99360 pLeft = pExpr->pLeft;
99361 nVal = sqlite3ExprVectorSize(pLeft);
 
99362
99363 /* Construct the ephemeral table that will contain the content of
99364 ** RHS of the IN operator.
99365 */
99366 pExpr->iTable = iTab;
99367 addr = sqlite3VdbeAddOp2(v, OP_OpenEphemeral, pExpr->iTable, nVal);
 
99368 #ifdef SQLITE_ENABLE_EXPLAIN_COMMENTS
99369 if( ExprHasProperty(pExpr, EP_xIsSelect) ){
99370 VdbeComment((v, "Result of SELECT %u", pExpr->x.pSelect->selId));
99371 }else{
99372 VdbeComment((v, "RHS of IN operator"));
99373 }
99374 #endif
99375 pKeyInfo = sqlite3KeyInfoAlloc(pParse->db, nVal, 1);
99376
99377 if( ExprHasProperty(pExpr, EP_xIsSelect) ){
99378 /* Case 1: expr IN (SELECT ...)
99379 **
99380 ** Generate code to write the results of the select into the temporary
@@ -99387,11 +99384,10 @@
99384 ExprList *pEList = pSelect->pEList;
99385
99386 ExplainQueryPlan((pParse, 1, "%sLIST SUBQUERY %d",
99387 addrOnce?"":"CORRELATED ", pSelect->selId
99388 ));
 
99389 /* If the LHS and RHS of the IN operator do not match, that
99390 ** error will have been caught long before we reach this point. */
99391 if( ALWAYS(pEList->nExpr==nVal) ){
99392 SelectDest dest;
99393 int i;
@@ -99440,14 +99436,12 @@
99436 }
99437
99438 /* Loop through each expression in <exprlist>. */
99439 r1 = sqlite3GetTempReg(pParse);
99440 r2 = sqlite3GetTempReg(pParse);
 
99441 for(i=pList->nExpr, pItem=pList->a; i>0; i--, pItem++){
99442 Expr *pE2 = pItem->pExpr;
 
99443
99444 /* If the expression is not constant then we will need to
99445 ** disable the test that was generated above that makes sure
99446 ** this code only executes once. Because for a non-constant
99447 ** expression we need to rerun this code each time.
@@ -99456,24 +99450,13 @@
99450 sqlite3VdbeChangeToNoop(v, addrOnce);
99451 addrOnce = 0;
99452 }
99453
99454 /* Evaluate the expression and insert it into the temp table */
99455 r3 = sqlite3ExprCodeTarget(pParse, pE2, r1);
99456 sqlite3VdbeAddOp4(v, OP_MakeRecord, r3, 1, r2, &affinity, 1);
99457 sqlite3VdbeAddOp4Int(v, OP_IdxInsert, iTab, r2, r3, 1);
 
 
 
 
 
 
 
 
 
 
 
99458 }
99459 sqlite3ReleaseTempReg(pParse, r1);
99460 sqlite3ReleaseTempReg(pParse, r2);
99461 }
99462 if( pKeyInfo ){
@@ -118105,14 +118088,17 @@
118088 assert( pParse->nested==0 );
118089 pik_flags |= OPFLAG_NCHANGE;
118090 pik_flags |= (update_flags & OPFLAG_SAVEPOSITION);
118091 #ifdef SQLITE_ENABLE_PREUPDATE_HOOK
118092 if( update_flags==0 ){
118093 int r = sqlite3GetTempReg(pParse);
118094 sqlite3VdbeAddOp2(v, OP_Integer, 0, r);
118095 sqlite3VdbeAddOp4(v, OP_Insert,
118096 iIdxCur+i, aRegIdx[i], r, (char*)pTab, P4_TABLE
118097 );
118098 sqlite3VdbeChangeP5(v, OPFLAG_ISNOOP);
118099 sqlite3ReleaseTempReg(pParse, r);
118100 }
118101 #endif
118102 }
118103 sqlite3VdbeAddOp4Int(v, OP_IdxInsert, iIdxCur+i, aRegIdx[i],
118104 aRegIdx[i]+1,
@@ -136425,11 +136411,10 @@
136411 pIn += i;
136412 for(i=iEq;i<pLoop->nLTerm; i++){
136413 if( pLoop->aLTerm[i]->pExpr==pX ){
136414 int iOut = iReg + i - iEq;
136415 if( eType==IN_INDEX_ROWID ){
 
136416 pIn->addrInTop = sqlite3VdbeAddOp2(v, OP_Rowid, iTab, iOut);
136417 }else{
136418 int iCol = aiMap ? aiMap[iMap++] : 0;
136419 pIn->addrInTop = sqlite3VdbeAddOp3(v,OP_Column,iTab, iCol, iOut);
136420 }
@@ -137187,10 +137172,13 @@
137172 if( iRowidReg!=iReleaseReg ) sqlite3ReleaseTempReg(pParse, iReleaseReg);
137173 addrNxt = pLevel->addrNxt;
137174 sqlite3VdbeAddOp3(v, OP_SeekRowid, iCur, addrNxt, iRowidReg);
137175 VdbeCoverage(v);
137176 pLevel->op = OP_Noop;
137177 if( (pTerm->prereqAll & pLevel->notReady)==0 ){
137178 pTerm->wtFlags |= TERM_CODED;
137179 }
137180 }else if( (pLoop->wsFlags & WHERE_IPK)!=0
137181 && (pLoop->wsFlags & WHERE_COLUMN_RANGE)!=0
137182 ){
137183 /* Case 3: We have an inequality comparison against the ROWID field.
137184 */
@@ -217074,11 +217062,11 @@
217062 int nArg, /* Number of args */
217063 sqlite3_value **apUnused /* Function arguments */
217064 ){
217065 assert( nArg==0 );
217066 UNUSED_PARAM2(nArg, apUnused);
217067 sqlite3_result_text(pCtx, "fts5: 2019-02-25 16:06:06 bd49a8271d650fa89e446b42e513b595a717b9212c91dd384aab871fc1d0f6d7", -1, SQLITE_TRANSIENT);
217068 }
217069
217070 /*
217071 ** Return true if zName is the extension on one of the shadow tables used
217072 ** by this module.
@@ -221838,12 +221826,12 @@
221826 }
221827 #endif /* SQLITE_CORE */
221828 #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_STMTVTAB) */
221829
221830 /************** End of stmt.c ************************************************/
221831 #if __LINE__!=221831
221832 #undef SQLITE_SOURCE_ID
221833 #define SQLITE_SOURCE_ID "2019-02-25 16:06:06 bd49a8271d650fa89e446b42e513b595a717b9212c91dd384aab871fc1d0alt2"
221834 #endif
221835 /* Return the source-id for this library */
221836 SQLITE_API const char *sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; }
221837 /************************** End of sqlite3.c ******************************/
221838
+4 -4
--- src/sqlite3.h
+++ src/sqlite3.h
@@ -121,13 +121,13 @@
121121
**
122122
** See also: [sqlite3_libversion()],
123123
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
124124
** [sqlite_version()] and [sqlite_source_id()].
125125
*/
126
-#define SQLITE_VERSION "3.27.1"
127
-#define SQLITE_VERSION_NUMBER 3027001
128
-#define SQLITE_SOURCE_ID "2019-02-08 13:17:39 0eca3dd3d38b31c92b49ca2d311128b74584714d9e7de895b1a6286ef959a1dd"
126
+#define SQLITE_VERSION "3.27.2"
127
+#define SQLITE_VERSION_NUMBER 3027002
128
+#define SQLITE_SOURCE_ID "2019-02-25 16:06:06 bd49a8271d650fa89e446b42e513b595a717b9212c91dd384aab871fc1d0f6d7"
129129
130130
/*
131131
** CAPI3REF: Run-Time Library Version Numbers
132132
** KEYWORDS: sqlite3_version sqlite3_sourceid
133133
**
@@ -2367,11 +2367,11 @@
23672367
** ^Changes made as part of [foreign key actions] are included in the
23682368
** count, but those made as part of REPLACE constraint resolution are
23692369
** not. ^Changes to a view that are intercepted by INSTEAD OF triggers
23702370
** are not counted.
23712371
**
2372
-** This the [sqlite3_total_changes(D)] interface only reports the number
2372
+** The [sqlite3_total_changes(D)] interface only reports the number
23732373
** of rows that changed due to SQL statement run against database
23742374
** connection D. Any changes by other database connections are ignored.
23752375
** To detect changes against a database file from other database
23762376
** connections use the [PRAGMA data_version] command or the
23772377
** [SQLITE_FCNTL_DATA_VERSION] [file control].
23782378
--- src/sqlite3.h
+++ src/sqlite3.h
@@ -121,13 +121,13 @@
121 **
122 ** See also: [sqlite3_libversion()],
123 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
124 ** [sqlite_version()] and [sqlite_source_id()].
125 */
126 #define SQLITE_VERSION "3.27.1"
127 #define SQLITE_VERSION_NUMBER 3027001
128 #define SQLITE_SOURCE_ID "2019-02-08 13:17:39 0eca3dd3d38b31c92b49ca2d311128b74584714d9e7de895b1a6286ef959a1dd"
129
130 /*
131 ** CAPI3REF: Run-Time Library Version Numbers
132 ** KEYWORDS: sqlite3_version sqlite3_sourceid
133 **
@@ -2367,11 +2367,11 @@
2367 ** ^Changes made as part of [foreign key actions] are included in the
2368 ** count, but those made as part of REPLACE constraint resolution are
2369 ** not. ^Changes to a view that are intercepted by INSTEAD OF triggers
2370 ** are not counted.
2371 **
2372 ** This the [sqlite3_total_changes(D)] interface only reports the number
2373 ** of rows that changed due to SQL statement run against database
2374 ** connection D. Any changes by other database connections are ignored.
2375 ** To detect changes against a database file from other database
2376 ** connections use the [PRAGMA data_version] command or the
2377 ** [SQLITE_FCNTL_DATA_VERSION] [file control].
2378
--- src/sqlite3.h
+++ src/sqlite3.h
@@ -121,13 +121,13 @@
121 **
122 ** See also: [sqlite3_libversion()],
123 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
124 ** [sqlite_version()] and [sqlite_source_id()].
125 */
126 #define SQLITE_VERSION "3.27.2"
127 #define SQLITE_VERSION_NUMBER 3027002
128 #define SQLITE_SOURCE_ID "2019-02-25 16:06:06 bd49a8271d650fa89e446b42e513b595a717b9212c91dd384aab871fc1d0f6d7"
129
130 /*
131 ** CAPI3REF: Run-Time Library Version Numbers
132 ** KEYWORDS: sqlite3_version sqlite3_sourceid
133 **
@@ -2367,11 +2367,11 @@
2367 ** ^Changes made as part of [foreign key actions] are included in the
2368 ** count, but those made as part of REPLACE constraint resolution are
2369 ** not. ^Changes to a view that are intercepted by INSTEAD OF triggers
2370 ** are not counted.
2371 **
2372 ** The [sqlite3_total_changes(D)] interface only reports the number
2373 ** of rows that changed due to SQL statement run against database
2374 ** connection D. Any changes by other database connections are ignored.
2375 ** To detect changes against a database file from other database
2376 ** connections use the [PRAGMA data_version] command or the
2377 ** [SQLITE_FCNTL_DATA_VERSION] [file control].
2378

Keyboard Shortcuts

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