Fossil SCM

Update the built-in SQLite to the latest 3.22.0 beta, with a fix for a compile-time issue reported on the mailing list.

drh 2018-01-12 14:36 trunk
Commit 9d80ad8574d22da2e71360052ad62bdcb3e7c78d18e24fb5a2bcf32513bd413d
3 files changed +32 -24 +49 -10 +13 -1
+32 -24
--- src/shell.c
+++ src/shell.c
@@ -2128,10 +2128,11 @@
21282128
#include <fcntl.h>
21292129
#if !defined(_WIN32) && !defined(WIN32)
21302130
# include <unistd.h>
21312131
# include <dirent.h>
21322132
# include <utime.h>
2133
+# include <sys/time.h>
21332134
#else
21342135
# include "windows.h"
21352136
# include <io.h>
21362137
# include <direct.h>
21372138
/* # include "test_windirent.h" */
@@ -2327,11 +2328,11 @@
23272328
CloseHandle(hFile);
23282329
return !bResult;
23292330
}else{
23302331
return 1;
23312332
}
2332
-#elif defined(AT_FDCWD)
2333
+#elif defined(AT_FDCWD) && 0 /* utimensat() is not univerally available */
23332334
/* Recent unix */
23342335
struct timespec times[2];
23352336
times[0].tv_nsec = times[1].tv_nsec = 0;
23362337
times[0].tv_sec = time(0);
23372338
times[1].tv_sec = mtime;
@@ -3959,10 +3960,23 @@
39593960
** May you find forgiveness for yourself and forgive others.
39603961
** May you share freely, never taking more than you give.
39613962
**
39623963
******************************************************************************
39633964
**
3965
+** This file implements a virtual table for reading and writing ZIP archive
3966
+** files.
3967
+**
3968
+** Usage example:
3969
+**
3970
+** SELECT name, sz, datetime(mtime,'unixepoch') FROM zipfile($filename);
3971
+**
3972
+** Current limitations:
3973
+**
3974
+** * No support for encryption
3975
+** * No support for ZIP archives spanning multiple files
3976
+** * No support for zip64 extensions
3977
+** * Only the "inflate/deflate" (zlib) compression method is supported
39643978
*/
39653979
SQLITE_EXTENSION_INIT1
39663980
#include <stdio.h>
39673981
#include <string.h>
39683982
#include <assert.h>
@@ -3990,22 +4004,23 @@
39904004
typedef unsigned short u16;
39914005
typedef unsigned long u32;
39924006
#define MIN(a,b) ((a)<(b) ? (a) : (b))
39934007
#endif
39944008
3995
-#define ZIPFILE_SCHEMA "CREATE TABLE y(" \
3996
- "name, /* 0: Name of file in zip archive */" \
3997
- "mode, /* 1: POSIX mode for file */" \
3998
- "mtime, /* 2: Last modification time in seconds since epoch */" \
3999
- "sz, /* 3: Size of object */" \
4000
- "rawdata, /* 4: Raw data */" \
4001
- "data, /* 5: Uncompressed data */" \
4002
- "method, /* 6: Compression method (integer) */" \
4003
- "file HIDDEN /* Name of zip file */" \
4004
-");"
4005
-
4006
-#define ZIPFILE_F_COLUMN_IDX 7 /* Index of column "f" in the above */
4009
+static const char ZIPFILE_SCHEMA[] =
4010
+ "CREATE TABLE y("
4011
+ "name PRIMARY KEY," /* 0: Name of file in zip archive */
4012
+ "mode," /* 1: POSIX mode for file */
4013
+ "mtime," /* 2: Last modification time (secs since 1970)*/
4014
+ "sz," /* 3: Size of object */
4015
+ "rawdata," /* 4: Raw data */
4016
+ "data," /* 5: Uncompressed data */
4017
+ "method," /* 6: Compression method (integer) */
4018
+ "file HIDDEN" /* 7: Name of zip file */
4019
+ ") WITHOUT ROWID;";
4020
+
4021
+#define ZIPFILE_F_COLUMN_IDX 7 /* Index of column "file" in the above */
40074022
#define ZIPFILE_BUFFER_SIZE (64*1024)
40084023
40094024
40104025
/*
40114026
** Magic numbers used to read and write zip files.
@@ -4157,11 +4172,10 @@
41574172
};
41584173
41594174
typedef struct ZipfileEntry ZipfileEntry;
41604175
struct ZipfileEntry {
41614176
char *zPath; /* Path of zipfile entry */
4162
- i64 iRowid; /* Rowid for this value if queried */
41634177
u8 *aCdsEntry; /* Buffer containing entire CDS entry */
41644178
int nCdsEntry; /* Size of buffer aCdsEntry[] in bytes */
41654179
int bDeleted; /* True if entry has been deleted */
41664180
ZipfileEntry *pNext; /* Next element in in-memory CDS */
41674181
};
@@ -4764,16 +4778,11 @@
47644778
47654779
/*
47664780
** Return the rowid for the current row.
47674781
*/
47684782
static int zipfileRowid(sqlite3_vtab_cursor *cur, sqlite_int64 *pRowid){
4769
- ZipfileCsr *pCsr = (ZipfileCsr*)cur;
4770
- if( pCsr->pCurrent ){
4771
- *pRowid = pCsr->pCurrent->iRowid;
4772
- }else{
4773
- *pRowid = pCsr->cds.iOffset;
4774
- }
4783
+ assert( 0 );
47754784
return SQLITE_OK;
47764785
}
47774786
47784787
/*
47794788
** Return TRUE if the cursor has been moved off of the last
@@ -4933,15 +4942,13 @@
49334942
*/
49344943
static void zipfileAddEntry(ZipfileTab *pTab, ZipfileEntry *pNew){
49354944
assert( (pTab->pFirstEntry==0)==(pTab->pLastEntry==0) );
49364945
assert( pNew->pNext==0 );
49374946
if( pTab->pFirstEntry==0 ){
4938
- pNew->iRowid = 1;
49394947
pTab->pFirstEntry = pTab->pLastEntry = pNew;
49404948
}else{
49414949
assert( pTab->pLastEntry->pNext==0 );
4942
- pNew->iRowid = pTab->pLastEntry->iRowid+1;
49434950
pTab->pLastEntry->pNext = pNew;
49444951
pTab->pLastEntry = pNew;
49454952
}
49464953
}
49474954
@@ -5185,14 +5192,15 @@
51855192
51865193
if( sqlite3_value_type(apVal[0])!=SQLITE_NULL ){
51875194
if( nVal>1 ){
51885195
return SQLITE_CONSTRAINT;
51895196
}else{
5190
- i64 iDelete = sqlite3_value_int64(apVal[0]);
5197
+ const char *zDelete = (const char*)sqlite3_value_text(apVal[0]);
5198
+ int nDelete = strlen(zDelete);
51915199
ZipfileEntry *p;
51925200
for(p=pTab->pFirstEntry; p; p=p->pNext){
5193
- if( p->iRowid==iDelete ){
5201
+ if( zipfileComparePath(p->zPath, zDelete, nDelete)==0 ){
51945202
p->bDeleted = 1;
51955203
break;
51965204
}
51975205
}
51985206
return SQLITE_OK;
51995207
--- src/shell.c
+++ src/shell.c
@@ -2128,10 +2128,11 @@
2128 #include <fcntl.h>
2129 #if !defined(_WIN32) && !defined(WIN32)
2130 # include <unistd.h>
2131 # include <dirent.h>
2132 # include <utime.h>
 
2133 #else
2134 # include "windows.h"
2135 # include <io.h>
2136 # include <direct.h>
2137 /* # include "test_windirent.h" */
@@ -2327,11 +2328,11 @@
2327 CloseHandle(hFile);
2328 return !bResult;
2329 }else{
2330 return 1;
2331 }
2332 #elif defined(AT_FDCWD)
2333 /* Recent unix */
2334 struct timespec times[2];
2335 times[0].tv_nsec = times[1].tv_nsec = 0;
2336 times[0].tv_sec = time(0);
2337 times[1].tv_sec = mtime;
@@ -3959,10 +3960,23 @@
3959 ** May you find forgiveness for yourself and forgive others.
3960 ** May you share freely, never taking more than you give.
3961 **
3962 ******************************************************************************
3963 **
 
 
 
 
 
 
 
 
 
 
 
 
 
3964 */
3965 SQLITE_EXTENSION_INIT1
3966 #include <stdio.h>
3967 #include <string.h>
3968 #include <assert.h>
@@ -3990,22 +4004,23 @@
3990 typedef unsigned short u16;
3991 typedef unsigned long u32;
3992 #define MIN(a,b) ((a)<(b) ? (a) : (b))
3993 #endif
3994
3995 #define ZIPFILE_SCHEMA "CREATE TABLE y(" \
3996 "name, /* 0: Name of file in zip archive */" \
3997 "mode, /* 1: POSIX mode for file */" \
3998 "mtime, /* 2: Last modification time in seconds since epoch */" \
3999 "sz, /* 3: Size of object */" \
4000 "rawdata, /* 4: Raw data */" \
4001 "data, /* 5: Uncompressed data */" \
4002 "method, /* 6: Compression method (integer) */" \
4003 "file HIDDEN /* Name of zip file */" \
4004 ");"
4005
4006 #define ZIPFILE_F_COLUMN_IDX 7 /* Index of column "f" in the above */
 
4007 #define ZIPFILE_BUFFER_SIZE (64*1024)
4008
4009
4010 /*
4011 ** Magic numbers used to read and write zip files.
@@ -4157,11 +4172,10 @@
4157 };
4158
4159 typedef struct ZipfileEntry ZipfileEntry;
4160 struct ZipfileEntry {
4161 char *zPath; /* Path of zipfile entry */
4162 i64 iRowid; /* Rowid for this value if queried */
4163 u8 *aCdsEntry; /* Buffer containing entire CDS entry */
4164 int nCdsEntry; /* Size of buffer aCdsEntry[] in bytes */
4165 int bDeleted; /* True if entry has been deleted */
4166 ZipfileEntry *pNext; /* Next element in in-memory CDS */
4167 };
@@ -4764,16 +4778,11 @@
4764
4765 /*
4766 ** Return the rowid for the current row.
4767 */
4768 static int zipfileRowid(sqlite3_vtab_cursor *cur, sqlite_int64 *pRowid){
4769 ZipfileCsr *pCsr = (ZipfileCsr*)cur;
4770 if( pCsr->pCurrent ){
4771 *pRowid = pCsr->pCurrent->iRowid;
4772 }else{
4773 *pRowid = pCsr->cds.iOffset;
4774 }
4775 return SQLITE_OK;
4776 }
4777
4778 /*
4779 ** Return TRUE if the cursor has been moved off of the last
@@ -4933,15 +4942,13 @@
4933 */
4934 static void zipfileAddEntry(ZipfileTab *pTab, ZipfileEntry *pNew){
4935 assert( (pTab->pFirstEntry==0)==(pTab->pLastEntry==0) );
4936 assert( pNew->pNext==0 );
4937 if( pTab->pFirstEntry==0 ){
4938 pNew->iRowid = 1;
4939 pTab->pFirstEntry = pTab->pLastEntry = pNew;
4940 }else{
4941 assert( pTab->pLastEntry->pNext==0 );
4942 pNew->iRowid = pTab->pLastEntry->iRowid+1;
4943 pTab->pLastEntry->pNext = pNew;
4944 pTab->pLastEntry = pNew;
4945 }
4946 }
4947
@@ -5185,14 +5192,15 @@
5185
5186 if( sqlite3_value_type(apVal[0])!=SQLITE_NULL ){
5187 if( nVal>1 ){
5188 return SQLITE_CONSTRAINT;
5189 }else{
5190 i64 iDelete = sqlite3_value_int64(apVal[0]);
 
5191 ZipfileEntry *p;
5192 for(p=pTab->pFirstEntry; p; p=p->pNext){
5193 if( p->iRowid==iDelete ){
5194 p->bDeleted = 1;
5195 break;
5196 }
5197 }
5198 return SQLITE_OK;
5199
--- src/shell.c
+++ src/shell.c
@@ -2128,10 +2128,11 @@
2128 #include <fcntl.h>
2129 #if !defined(_WIN32) && !defined(WIN32)
2130 # include <unistd.h>
2131 # include <dirent.h>
2132 # include <utime.h>
2133 # include <sys/time.h>
2134 #else
2135 # include "windows.h"
2136 # include <io.h>
2137 # include <direct.h>
2138 /* # include "test_windirent.h" */
@@ -2327,11 +2328,11 @@
2328 CloseHandle(hFile);
2329 return !bResult;
2330 }else{
2331 return 1;
2332 }
2333 #elif defined(AT_FDCWD) && 0 /* utimensat() is not univerally available */
2334 /* Recent unix */
2335 struct timespec times[2];
2336 times[0].tv_nsec = times[1].tv_nsec = 0;
2337 times[0].tv_sec = time(0);
2338 times[1].tv_sec = mtime;
@@ -3959,10 +3960,23 @@
3960 ** May you find forgiveness for yourself and forgive others.
3961 ** May you share freely, never taking more than you give.
3962 **
3963 ******************************************************************************
3964 **
3965 ** This file implements a virtual table for reading and writing ZIP archive
3966 ** files.
3967 **
3968 ** Usage example:
3969 **
3970 ** SELECT name, sz, datetime(mtime,'unixepoch') FROM zipfile($filename);
3971 **
3972 ** Current limitations:
3973 **
3974 ** * No support for encryption
3975 ** * No support for ZIP archives spanning multiple files
3976 ** * No support for zip64 extensions
3977 ** * Only the "inflate/deflate" (zlib) compression method is supported
3978 */
3979 SQLITE_EXTENSION_INIT1
3980 #include <stdio.h>
3981 #include <string.h>
3982 #include <assert.h>
@@ -3990,22 +4004,23 @@
4004 typedef unsigned short u16;
4005 typedef unsigned long u32;
4006 #define MIN(a,b) ((a)<(b) ? (a) : (b))
4007 #endif
4008
4009 static const char ZIPFILE_SCHEMA[] =
4010 "CREATE TABLE y("
4011 "name PRIMARY KEY," /* 0: Name of file in zip archive */
4012 "mode," /* 1: POSIX mode for file */
4013 "mtime," /* 2: Last modification time (secs since 1970)*/
4014 "sz," /* 3: Size of object */
4015 "rawdata," /* 4: Raw data */
4016 "data," /* 5: Uncompressed data */
4017 "method," /* 6: Compression method (integer) */
4018 "file HIDDEN" /* 7: Name of zip file */
4019 ") WITHOUT ROWID;";
4020
4021 #define ZIPFILE_F_COLUMN_IDX 7 /* Index of column "file" in the above */
4022 #define ZIPFILE_BUFFER_SIZE (64*1024)
4023
4024
4025 /*
4026 ** Magic numbers used to read and write zip files.
@@ -4157,11 +4172,10 @@
4172 };
4173
4174 typedef struct ZipfileEntry ZipfileEntry;
4175 struct ZipfileEntry {
4176 char *zPath; /* Path of zipfile entry */
 
4177 u8 *aCdsEntry; /* Buffer containing entire CDS entry */
4178 int nCdsEntry; /* Size of buffer aCdsEntry[] in bytes */
4179 int bDeleted; /* True if entry has been deleted */
4180 ZipfileEntry *pNext; /* Next element in in-memory CDS */
4181 };
@@ -4764,16 +4778,11 @@
4778
4779 /*
4780 ** Return the rowid for the current row.
4781 */
4782 static int zipfileRowid(sqlite3_vtab_cursor *cur, sqlite_int64 *pRowid){
4783 assert( 0 );
 
 
 
 
 
4784 return SQLITE_OK;
4785 }
4786
4787 /*
4788 ** Return TRUE if the cursor has been moved off of the last
@@ -4933,15 +4942,13 @@
4942 */
4943 static void zipfileAddEntry(ZipfileTab *pTab, ZipfileEntry *pNew){
4944 assert( (pTab->pFirstEntry==0)==(pTab->pLastEntry==0) );
4945 assert( pNew->pNext==0 );
4946 if( pTab->pFirstEntry==0 ){
 
4947 pTab->pFirstEntry = pTab->pLastEntry = pNew;
4948 }else{
4949 assert( pTab->pLastEntry->pNext==0 );
 
4950 pTab->pLastEntry->pNext = pNew;
4951 pTab->pLastEntry = pNew;
4952 }
4953 }
4954
@@ -5185,14 +5192,15 @@
5192
5193 if( sqlite3_value_type(apVal[0])!=SQLITE_NULL ){
5194 if( nVal>1 ){
5195 return SQLITE_CONSTRAINT;
5196 }else{
5197 const char *zDelete = (const char*)sqlite3_value_text(apVal[0]);
5198 int nDelete = strlen(zDelete);
5199 ZipfileEntry *p;
5200 for(p=pTab->pFirstEntry; p; p=p->pNext){
5201 if( zipfileComparePath(p->zPath, zDelete, nDelete)==0 ){
5202 p->bDeleted = 1;
5203 break;
5204 }
5205 }
5206 return SQLITE_OK;
5207
+49 -10
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -1147,11 +1147,11 @@
11471147
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
11481148
** [sqlite_version()] and [sqlite_source_id()].
11491149
*/
11501150
#define SQLITE_VERSION "3.22.0"
11511151
#define SQLITE_VERSION_NUMBER 3022000
1152
-#define SQLITE_SOURCE_ID "2018-01-11 00:38:39 b8d92d8dc239597c6f01a6e572b047f98ce374a8f48257683fa839dde3ec993f"
1152
+#define SQLITE_SOURCE_ID "2018-01-12 14:34:45 30ed7a4b6408f0ca921abc4d8b7bb5404fc7708cedcd104b017b361054e7148c"
11531153
11541154
/*
11551155
** CAPI3REF: Run-Time Library Version Numbers
11561156
** KEYWORDS: sqlite3_version sqlite3_sourceid
11571157
**
@@ -9319,10 +9319,22 @@
93199319
** of the SQL statement that triggered the call to the [xUpdate] method of the
93209320
** [virtual table].
93219321
*/
93229322
SQLITE_API int sqlite3_vtab_on_conflict(sqlite3 *);
93239323
9324
+/*
9325
+** CAPI3REF: Determine If Virtual Table Column Access Is For UPDATE
9326
+**
9327
+** If the sqlite3_vtab_nochange(X) routine is called within the [xColumn]
9328
+** method of a [virtual table], then it returns true if and only if the
9329
+** column is being fetched as part of an UPDATE operation during which the
9330
+** column value will not change. Applications might use this to substitute
9331
+** a lighter-weight value to return that the corresponding [xUpdate] method
9332
+** understands as a "no-change" value.
9333
+*/
9334
+SQLITE_API int sqlite3_vtab_nochange(sqlite3_context*);
9335
+
93249336
/*
93259337
** CAPI3REF: Determine The Collation For a Virtual Table Constraint
93269338
**
93279339
** This function may only be called from within a call to the [xBestIndex]
93289340
** method of a [virtual table].
@@ -18883,10 +18895,11 @@
1888318895
Vdbe *pVdbe; /* The VM that owns this context */
1888418896
int iOp; /* Instruction number of OP_Function */
1888518897
int isError; /* Error code returned by the function. */
1888618898
u8 skipFlag; /* Skip accumulator loading if true */
1888718899
u8 fErrorOrAux; /* isError!=0 or pVdbe->pAuxData modified */
18900
+ u8 bVtabNoChng; /* Fetching an unchanging column in a vtab UPDATE */
1888818901
u8 argc; /* Number of arguments */
1888918902
sqlite3_value *argv[1]; /* Argument set */
1889018903
};
1889118904
1889218905
/* A bitfield type for use inside of structures. Always follow with :N where
@@ -78345,10 +78358,29 @@
7834578358
*/
7834678359
SQLITE_API sqlite3 *sqlite3_context_db_handle(sqlite3_context *p){
7834778360
assert( p && p->pOut );
7834878361
return p->pOut->db;
7834978362
}
78363
+
78364
+/*
78365
+** If this routine is invoked from within an xColumn method of a virtual
78366
+** table, then it returns true if and only if the the call is during an
78367
+** UPDATE operation and the value of the column will not be modified
78368
+** by the UPDATE.
78369
+**
78370
+** If this routine is called from any context other than within the
78371
+** xColumn method of a virtual table, then the return value is meaningless
78372
+** and arbitrary.
78373
+**
78374
+** Virtual table implements might use this routine to optimize their
78375
+** performance by substituting a NULL result, or some other light-weight
78376
+** value, as a signal to the xUpdate routine that the column is unchanged.
78377
+*/
78378
+SQLITE_API int sqlite3_vtab_nochange(sqlite3_context *p){
78379
+ assert( p );
78380
+ return p->bVtabNoChng;
78381
+}
7835078382
7835178383
/*
7835278384
** Return the current time for a statement. If the current time
7835378385
** is requested more than once within the same run of a single prepared
7835478386
** statement, the exact same time is returned for each invocation regardless
@@ -86545,16 +86577,22 @@
8654586577
break;
8654686578
}
8654786579
#endif /* SQLITE_OMIT_VIRTUALTABLE */
8654886580
8654986581
#ifndef SQLITE_OMIT_VIRTUALTABLE
86550
-/* Opcode: VColumn P1 P2 P3 * *
86582
+/* Opcode: VColumn P1 P2 P3 P4 *
8655186583
** Synopsis: r[P3]=vcolumn(P2)
8655286584
**
86553
-** Store the value of the P2-th column of
86554
-** the row of the virtual-table that the
86555
-** P1 cursor is pointing to into register P3.
86585
+** Store in register P3 the value of the P2-th column of
86586
+** the current row of the virtual-table of cursor P1.
86587
+**
86588
+** If the VColumn opcode is being used to fetch the value of
86589
+** an unchanging column during an UPDATE operation, then the P4
86590
+** value is 1. Otherwise, P4 is 0. The P4 value is returned
86591
+** by sqlite3_vtab_nochange() routine can can be used
86592
+** by virtual table implementations to return special "no-change"
86593
+** marks which can be more efficient, depending on the virtual table.
8655686594
*/
8655786595
case OP_VColumn: {
8655886596
sqlite3_vtab *pVtab;
8655986597
const sqlite3_module *pModule;
8656086598
Mem *pDest;
@@ -86572,10 +86610,11 @@
8657286610
pVtab = pCur->uc.pVCur->pVtab;
8657386611
pModule = pVtab->pModule;
8657486612
assert( pModule->xColumn );
8657586613
memset(&sContext, 0, sizeof(sContext));
8657686614
sContext.pOut = pDest;
86615
+ sContext.bVtabNoChng = pOp->p4.i!=0;
8657786616
MemSetTypeFlag(pDest, MEM_Null);
8657886617
rc = pModule->xColumn(pCur->uc.pVCur, &sContext, pOp->p2);
8657986618
sqlite3VtabImportErrmsg(p, pVtab);
8658086619
if( sContext.isError ){
8658186620
rc = sContext.isError;
@@ -126691,11 +126730,11 @@
126691126730
int iCsr = pSrc->a[0].iCursor; /* Cursor used for virtual table scan */
126692126731
int aDummy[2]; /* Unused arg for sqlite3WhereOkOnePass() */
126693126732
int bOnePass; /* True to use onepass strategy */
126694126733
int addr; /* Address of OP_OpenEphemeral */
126695126734
126696
- /* Allocate nArg registers to martial the arguments to VUpdate. Then
126735
+ /* Allocate nArg registers in which to gather the arguments for VUpdate. Then
126697126736
** create and open the ephemeral table in which the records created from
126698126737
** these arguments will be temporarily stored. */
126699126738
assert( v );
126700126739
ephemTab = pParse->nTab++;
126701126740
addr= sqlite3VdbeAddOp2(v, OP_OpenEphemeral, ephemTab, nArg);
@@ -126711,11 +126750,11 @@
126711126750
/* Populate the argument registers. */
126712126751
for(i=0; i<pTab->nCol; i++){
126713126752
if( aXRef[i]>=0 ){
126714126753
sqlite3ExprCode(pParse, pChanges->a[aXRef[i]].pExpr, regArg+2+i);
126715126754
}else{
126716
- sqlite3VdbeAddOp3(v, OP_VColumn, iCsr, i, regArg+2+i);
126755
+ sqlite3VdbeAddOp4Int(v, OP_VColumn, iCsr, i, regArg+2+i, 1);
126717126756
}
126718126757
}
126719126758
if( HasRowid(pTab) ){
126720126759
sqlite3VdbeAddOp2(v, OP_Rowid, iCsr, regArg);
126721126760
if( pRowid ){
@@ -202949,11 +202988,11 @@
202949202988
int nArg, /* Number of args */
202950202989
sqlite3_value **apUnused /* Function arguments */
202951202990
){
202952202991
assert( nArg==0 );
202953202992
UNUSED_PARAM2(nArg, apUnused);
202954
- sqlite3_result_text(pCtx, "fts5: 2018-01-11 00:38:39 b8d92d8dc239597c6f01a6e572b047f98ce374a8f48257683fa839dde3ec993f", -1, SQLITE_TRANSIENT);
202993
+ sqlite3_result_text(pCtx, "fts5: 2018-01-12 14:34:45 30ed7a4b6408f0ca921abc4d8b7bb5404fc7708cedcd104b017b361054e7148c", -1, SQLITE_TRANSIENT);
202955202994
}
202956202995
202957202996
static int fts5Init(sqlite3 *db){
202958202997
static const sqlite3_module fts5Mod = {
202959202998
/* iVersion */ 2,
@@ -207217,12 +207256,12 @@
207217207256
}
207218207257
#endif /* SQLITE_CORE */
207219207258
#endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_STMTVTAB) */
207220207259
207221207260
/************** End of stmt.c ************************************************/
207222
-#if __LINE__!=207222
207261
+#if __LINE__!=207261
207223207262
#undef SQLITE_SOURCE_ID
207224
-#define SQLITE_SOURCE_ID "2018-01-11 00:38:39 b8d92d8dc239597c6f01a6e572b047f98ce374a8f48257683fa839dde3ecalt2"
207263
+#define SQLITE_SOURCE_ID "2018-01-12 14:34:45 30ed7a4b6408f0ca921abc4d8b7bb5404fc7708cedcd104b017b361054e7alt2"
207225207264
#endif
207226207265
/* Return the source-id for this library */
207227207266
SQLITE_API const char *sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; }
207228207267
/************************** End of sqlite3.c ******************************/
207229207268
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -1147,11 +1147,11 @@
1147 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
1148 ** [sqlite_version()] and [sqlite_source_id()].
1149 */
1150 #define SQLITE_VERSION "3.22.0"
1151 #define SQLITE_VERSION_NUMBER 3022000
1152 #define SQLITE_SOURCE_ID "2018-01-11 00:38:39 b8d92d8dc239597c6f01a6e572b047f98ce374a8f48257683fa839dde3ec993f"
1153
1154 /*
1155 ** CAPI3REF: Run-Time Library Version Numbers
1156 ** KEYWORDS: sqlite3_version sqlite3_sourceid
1157 **
@@ -9319,10 +9319,22 @@
9319 ** of the SQL statement that triggered the call to the [xUpdate] method of the
9320 ** [virtual table].
9321 */
9322 SQLITE_API int sqlite3_vtab_on_conflict(sqlite3 *);
9323
 
 
 
 
 
 
 
 
 
 
 
 
9324 /*
9325 ** CAPI3REF: Determine The Collation For a Virtual Table Constraint
9326 **
9327 ** This function may only be called from within a call to the [xBestIndex]
9328 ** method of a [virtual table].
@@ -18883,10 +18895,11 @@
18883 Vdbe *pVdbe; /* The VM that owns this context */
18884 int iOp; /* Instruction number of OP_Function */
18885 int isError; /* Error code returned by the function. */
18886 u8 skipFlag; /* Skip accumulator loading if true */
18887 u8 fErrorOrAux; /* isError!=0 or pVdbe->pAuxData modified */
 
18888 u8 argc; /* Number of arguments */
18889 sqlite3_value *argv[1]; /* Argument set */
18890 };
18891
18892 /* A bitfield type for use inside of structures. Always follow with :N where
@@ -78345,10 +78358,29 @@
78345 */
78346 SQLITE_API sqlite3 *sqlite3_context_db_handle(sqlite3_context *p){
78347 assert( p && p->pOut );
78348 return p->pOut->db;
78349 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
78350
78351 /*
78352 ** Return the current time for a statement. If the current time
78353 ** is requested more than once within the same run of a single prepared
78354 ** statement, the exact same time is returned for each invocation regardless
@@ -86545,16 +86577,22 @@
86545 break;
86546 }
86547 #endif /* SQLITE_OMIT_VIRTUALTABLE */
86548
86549 #ifndef SQLITE_OMIT_VIRTUALTABLE
86550 /* Opcode: VColumn P1 P2 P3 * *
86551 ** Synopsis: r[P3]=vcolumn(P2)
86552 **
86553 ** Store the value of the P2-th column of
86554 ** the row of the virtual-table that the
86555 ** P1 cursor is pointing to into register P3.
 
 
 
 
 
 
86556 */
86557 case OP_VColumn: {
86558 sqlite3_vtab *pVtab;
86559 const sqlite3_module *pModule;
86560 Mem *pDest;
@@ -86572,10 +86610,11 @@
86572 pVtab = pCur->uc.pVCur->pVtab;
86573 pModule = pVtab->pModule;
86574 assert( pModule->xColumn );
86575 memset(&sContext, 0, sizeof(sContext));
86576 sContext.pOut = pDest;
 
86577 MemSetTypeFlag(pDest, MEM_Null);
86578 rc = pModule->xColumn(pCur->uc.pVCur, &sContext, pOp->p2);
86579 sqlite3VtabImportErrmsg(p, pVtab);
86580 if( sContext.isError ){
86581 rc = sContext.isError;
@@ -126691,11 +126730,11 @@
126691 int iCsr = pSrc->a[0].iCursor; /* Cursor used for virtual table scan */
126692 int aDummy[2]; /* Unused arg for sqlite3WhereOkOnePass() */
126693 int bOnePass; /* True to use onepass strategy */
126694 int addr; /* Address of OP_OpenEphemeral */
126695
126696 /* Allocate nArg registers to martial the arguments to VUpdate. Then
126697 ** create and open the ephemeral table in which the records created from
126698 ** these arguments will be temporarily stored. */
126699 assert( v );
126700 ephemTab = pParse->nTab++;
126701 addr= sqlite3VdbeAddOp2(v, OP_OpenEphemeral, ephemTab, nArg);
@@ -126711,11 +126750,11 @@
126711 /* Populate the argument registers. */
126712 for(i=0; i<pTab->nCol; i++){
126713 if( aXRef[i]>=0 ){
126714 sqlite3ExprCode(pParse, pChanges->a[aXRef[i]].pExpr, regArg+2+i);
126715 }else{
126716 sqlite3VdbeAddOp3(v, OP_VColumn, iCsr, i, regArg+2+i);
126717 }
126718 }
126719 if( HasRowid(pTab) ){
126720 sqlite3VdbeAddOp2(v, OP_Rowid, iCsr, regArg);
126721 if( pRowid ){
@@ -202949,11 +202988,11 @@
202949 int nArg, /* Number of args */
202950 sqlite3_value **apUnused /* Function arguments */
202951 ){
202952 assert( nArg==0 );
202953 UNUSED_PARAM2(nArg, apUnused);
202954 sqlite3_result_text(pCtx, "fts5: 2018-01-11 00:38:39 b8d92d8dc239597c6f01a6e572b047f98ce374a8f48257683fa839dde3ec993f", -1, SQLITE_TRANSIENT);
202955 }
202956
202957 static int fts5Init(sqlite3 *db){
202958 static const sqlite3_module fts5Mod = {
202959 /* iVersion */ 2,
@@ -207217,12 +207256,12 @@
207217 }
207218 #endif /* SQLITE_CORE */
207219 #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_STMTVTAB) */
207220
207221 /************** End of stmt.c ************************************************/
207222 #if __LINE__!=207222
207223 #undef SQLITE_SOURCE_ID
207224 #define SQLITE_SOURCE_ID "2018-01-11 00:38:39 b8d92d8dc239597c6f01a6e572b047f98ce374a8f48257683fa839dde3ecalt2"
207225 #endif
207226 /* Return the source-id for this library */
207227 SQLITE_API const char *sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; }
207228 /************************** End of sqlite3.c ******************************/
207229
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -1147,11 +1147,11 @@
1147 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
1148 ** [sqlite_version()] and [sqlite_source_id()].
1149 */
1150 #define SQLITE_VERSION "3.22.0"
1151 #define SQLITE_VERSION_NUMBER 3022000
1152 #define SQLITE_SOURCE_ID "2018-01-12 14:34:45 30ed7a4b6408f0ca921abc4d8b7bb5404fc7708cedcd104b017b361054e7148c"
1153
1154 /*
1155 ** CAPI3REF: Run-Time Library Version Numbers
1156 ** KEYWORDS: sqlite3_version sqlite3_sourceid
1157 **
@@ -9319,10 +9319,22 @@
9319 ** of the SQL statement that triggered the call to the [xUpdate] method of the
9320 ** [virtual table].
9321 */
9322 SQLITE_API int sqlite3_vtab_on_conflict(sqlite3 *);
9323
9324 /*
9325 ** CAPI3REF: Determine If Virtual Table Column Access Is For UPDATE
9326 **
9327 ** If the sqlite3_vtab_nochange(X) routine is called within the [xColumn]
9328 ** method of a [virtual table], then it returns true if and only if the
9329 ** column is being fetched as part of an UPDATE operation during which the
9330 ** column value will not change. Applications might use this to substitute
9331 ** a lighter-weight value to return that the corresponding [xUpdate] method
9332 ** understands as a "no-change" value.
9333 */
9334 SQLITE_API int sqlite3_vtab_nochange(sqlite3_context*);
9335
9336 /*
9337 ** CAPI3REF: Determine The Collation For a Virtual Table Constraint
9338 **
9339 ** This function may only be called from within a call to the [xBestIndex]
9340 ** method of a [virtual table].
@@ -18883,10 +18895,11 @@
18895 Vdbe *pVdbe; /* The VM that owns this context */
18896 int iOp; /* Instruction number of OP_Function */
18897 int isError; /* Error code returned by the function. */
18898 u8 skipFlag; /* Skip accumulator loading if true */
18899 u8 fErrorOrAux; /* isError!=0 or pVdbe->pAuxData modified */
18900 u8 bVtabNoChng; /* Fetching an unchanging column in a vtab UPDATE */
18901 u8 argc; /* Number of arguments */
18902 sqlite3_value *argv[1]; /* Argument set */
18903 };
18904
18905 /* A bitfield type for use inside of structures. Always follow with :N where
@@ -78345,10 +78358,29 @@
78358 */
78359 SQLITE_API sqlite3 *sqlite3_context_db_handle(sqlite3_context *p){
78360 assert( p && p->pOut );
78361 return p->pOut->db;
78362 }
78363
78364 /*
78365 ** If this routine is invoked from within an xColumn method of a virtual
78366 ** table, then it returns true if and only if the the call is during an
78367 ** UPDATE operation and the value of the column will not be modified
78368 ** by the UPDATE.
78369 **
78370 ** If this routine is called from any context other than within the
78371 ** xColumn method of a virtual table, then the return value is meaningless
78372 ** and arbitrary.
78373 **
78374 ** Virtual table implements might use this routine to optimize their
78375 ** performance by substituting a NULL result, or some other light-weight
78376 ** value, as a signal to the xUpdate routine that the column is unchanged.
78377 */
78378 SQLITE_API int sqlite3_vtab_nochange(sqlite3_context *p){
78379 assert( p );
78380 return p->bVtabNoChng;
78381 }
78382
78383 /*
78384 ** Return the current time for a statement. If the current time
78385 ** is requested more than once within the same run of a single prepared
78386 ** statement, the exact same time is returned for each invocation regardless
@@ -86545,16 +86577,22 @@
86577 break;
86578 }
86579 #endif /* SQLITE_OMIT_VIRTUALTABLE */
86580
86581 #ifndef SQLITE_OMIT_VIRTUALTABLE
86582 /* Opcode: VColumn P1 P2 P3 P4 *
86583 ** Synopsis: r[P3]=vcolumn(P2)
86584 **
86585 ** Store in register P3 the value of the P2-th column of
86586 ** the current row of the virtual-table of cursor P1.
86587 **
86588 ** If the VColumn opcode is being used to fetch the value of
86589 ** an unchanging column during an UPDATE operation, then the P4
86590 ** value is 1. Otherwise, P4 is 0. The P4 value is returned
86591 ** by sqlite3_vtab_nochange() routine can can be used
86592 ** by virtual table implementations to return special "no-change"
86593 ** marks which can be more efficient, depending on the virtual table.
86594 */
86595 case OP_VColumn: {
86596 sqlite3_vtab *pVtab;
86597 const sqlite3_module *pModule;
86598 Mem *pDest;
@@ -86572,10 +86610,11 @@
86610 pVtab = pCur->uc.pVCur->pVtab;
86611 pModule = pVtab->pModule;
86612 assert( pModule->xColumn );
86613 memset(&sContext, 0, sizeof(sContext));
86614 sContext.pOut = pDest;
86615 sContext.bVtabNoChng = pOp->p4.i!=0;
86616 MemSetTypeFlag(pDest, MEM_Null);
86617 rc = pModule->xColumn(pCur->uc.pVCur, &sContext, pOp->p2);
86618 sqlite3VtabImportErrmsg(p, pVtab);
86619 if( sContext.isError ){
86620 rc = sContext.isError;
@@ -126691,11 +126730,11 @@
126730 int iCsr = pSrc->a[0].iCursor; /* Cursor used for virtual table scan */
126731 int aDummy[2]; /* Unused arg for sqlite3WhereOkOnePass() */
126732 int bOnePass; /* True to use onepass strategy */
126733 int addr; /* Address of OP_OpenEphemeral */
126734
126735 /* Allocate nArg registers in which to gather the arguments for VUpdate. Then
126736 ** create and open the ephemeral table in which the records created from
126737 ** these arguments will be temporarily stored. */
126738 assert( v );
126739 ephemTab = pParse->nTab++;
126740 addr= sqlite3VdbeAddOp2(v, OP_OpenEphemeral, ephemTab, nArg);
@@ -126711,11 +126750,11 @@
126750 /* Populate the argument registers. */
126751 for(i=0; i<pTab->nCol; i++){
126752 if( aXRef[i]>=0 ){
126753 sqlite3ExprCode(pParse, pChanges->a[aXRef[i]].pExpr, regArg+2+i);
126754 }else{
126755 sqlite3VdbeAddOp4Int(v, OP_VColumn, iCsr, i, regArg+2+i, 1);
126756 }
126757 }
126758 if( HasRowid(pTab) ){
126759 sqlite3VdbeAddOp2(v, OP_Rowid, iCsr, regArg);
126760 if( pRowid ){
@@ -202949,11 +202988,11 @@
202988 int nArg, /* Number of args */
202989 sqlite3_value **apUnused /* Function arguments */
202990 ){
202991 assert( nArg==0 );
202992 UNUSED_PARAM2(nArg, apUnused);
202993 sqlite3_result_text(pCtx, "fts5: 2018-01-12 14:34:45 30ed7a4b6408f0ca921abc4d8b7bb5404fc7708cedcd104b017b361054e7148c", -1, SQLITE_TRANSIENT);
202994 }
202995
202996 static int fts5Init(sqlite3 *db){
202997 static const sqlite3_module fts5Mod = {
202998 /* iVersion */ 2,
@@ -207217,12 +207256,12 @@
207256 }
207257 #endif /* SQLITE_CORE */
207258 #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_STMTVTAB) */
207259
207260 /************** End of stmt.c ************************************************/
207261 #if __LINE__!=207261
207262 #undef SQLITE_SOURCE_ID
207263 #define SQLITE_SOURCE_ID "2018-01-12 14:34:45 30ed7a4b6408f0ca921abc4d8b7bb5404fc7708cedcd104b017b361054e7alt2"
207264 #endif
207265 /* Return the source-id for this library */
207266 SQLITE_API const char *sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; }
207267 /************************** End of sqlite3.c ******************************/
207268
+13 -1
--- src/sqlite3.h
+++ src/sqlite3.h
@@ -123,11 +123,11 @@
123123
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
124124
** [sqlite_version()] and [sqlite_source_id()].
125125
*/
126126
#define SQLITE_VERSION "3.22.0"
127127
#define SQLITE_VERSION_NUMBER 3022000
128
-#define SQLITE_SOURCE_ID "2018-01-11 00:38:39 b8d92d8dc239597c6f01a6e572b047f98ce374a8f48257683fa839dde3ec993f"
128
+#define SQLITE_SOURCE_ID "2018-01-12 14:34:45 30ed7a4b6408f0ca921abc4d8b7bb5404fc7708cedcd104b017b361054e7148c"
129129
130130
/*
131131
** CAPI3REF: Run-Time Library Version Numbers
132132
** KEYWORDS: sqlite3_version sqlite3_sourceid
133133
**
@@ -8295,10 +8295,22 @@
82958295
** of the SQL statement that triggered the call to the [xUpdate] method of the
82968296
** [virtual table].
82978297
*/
82988298
SQLITE_API int sqlite3_vtab_on_conflict(sqlite3 *);
82998299
8300
+/*
8301
+** CAPI3REF: Determine If Virtual Table Column Access Is For UPDATE
8302
+**
8303
+** If the sqlite3_vtab_nochange(X) routine is called within the [xColumn]
8304
+** method of a [virtual table], then it returns true if and only if the
8305
+** column is being fetched as part of an UPDATE operation during which the
8306
+** column value will not change. Applications might use this to substitute
8307
+** a lighter-weight value to return that the corresponding [xUpdate] method
8308
+** understands as a "no-change" value.
8309
+*/
8310
+SQLITE_API int sqlite3_vtab_nochange(sqlite3_context*);
8311
+
83008312
/*
83018313
** CAPI3REF: Determine The Collation For a Virtual Table Constraint
83028314
**
83038315
** This function may only be called from within a call to the [xBestIndex]
83048316
** method of a [virtual table].
83058317
--- src/sqlite3.h
+++ src/sqlite3.h
@@ -123,11 +123,11 @@
123 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
124 ** [sqlite_version()] and [sqlite_source_id()].
125 */
126 #define SQLITE_VERSION "3.22.0"
127 #define SQLITE_VERSION_NUMBER 3022000
128 #define SQLITE_SOURCE_ID "2018-01-11 00:38:39 b8d92d8dc239597c6f01a6e572b047f98ce374a8f48257683fa839dde3ec993f"
129
130 /*
131 ** CAPI3REF: Run-Time Library Version Numbers
132 ** KEYWORDS: sqlite3_version sqlite3_sourceid
133 **
@@ -8295,10 +8295,22 @@
8295 ** of the SQL statement that triggered the call to the [xUpdate] method of the
8296 ** [virtual table].
8297 */
8298 SQLITE_API int sqlite3_vtab_on_conflict(sqlite3 *);
8299
 
 
 
 
 
 
 
 
 
 
 
 
8300 /*
8301 ** CAPI3REF: Determine The Collation For a Virtual Table Constraint
8302 **
8303 ** This function may only be called from within a call to the [xBestIndex]
8304 ** method of a [virtual table].
8305
--- src/sqlite3.h
+++ src/sqlite3.h
@@ -123,11 +123,11 @@
123 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
124 ** [sqlite_version()] and [sqlite_source_id()].
125 */
126 #define SQLITE_VERSION "3.22.0"
127 #define SQLITE_VERSION_NUMBER 3022000
128 #define SQLITE_SOURCE_ID "2018-01-12 14:34:45 30ed7a4b6408f0ca921abc4d8b7bb5404fc7708cedcd104b017b361054e7148c"
129
130 /*
131 ** CAPI3REF: Run-Time Library Version Numbers
132 ** KEYWORDS: sqlite3_version sqlite3_sourceid
133 **
@@ -8295,10 +8295,22 @@
8295 ** of the SQL statement that triggered the call to the [xUpdate] method of the
8296 ** [virtual table].
8297 */
8298 SQLITE_API int sqlite3_vtab_on_conflict(sqlite3 *);
8299
8300 /*
8301 ** CAPI3REF: Determine If Virtual Table Column Access Is For UPDATE
8302 **
8303 ** If the sqlite3_vtab_nochange(X) routine is called within the [xColumn]
8304 ** method of a [virtual table], then it returns true if and only if the
8305 ** column is being fetched as part of an UPDATE operation during which the
8306 ** column value will not change. Applications might use this to substitute
8307 ** a lighter-weight value to return that the corresponding [xUpdate] method
8308 ** understands as a "no-change" value.
8309 */
8310 SQLITE_API int sqlite3_vtab_nochange(sqlite3_context*);
8311
8312 /*
8313 ** CAPI3REF: Determine The Collation For a Virtual Table Constraint
8314 **
8315 ** This function may only be called from within a call to the [xBestIndex]
8316 ** method of a [virtual table].
8317

Keyboard Shortcuts

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