Merge recent enhancements from trunk. Default page size is 4096. Writes
to statement journals are avoided. FossilOrigin-Name: 456df3365e2df60e34762f2024bb551538b3f72b
@ -380,6 +380,7 @@ TESTSRC = \
|
||||
$(TOP)/src/test_autoext.c \
|
||||
$(TOP)/src/test_async.c \
|
||||
$(TOP)/src/test_backup.c \
|
||||
$(TOP)/src/test_bestindex.c \
|
||||
$(TOP)/src/test_blob.c \
|
||||
$(TOP)/src/test_btree.c \
|
||||
$(TOP)/src/test_config.c \
|
||||
@ -1060,6 +1061,8 @@ sqlite3rbu.lo: $(TOP)/ext/rbu/sqlite3rbu.c $(HDR) $(EXTHDR)
|
||||
TESTFIXTURE_FLAGS = -DTCLSH=1 -DSQLITE_TEST=1 -DSQLITE_CRASH_TEST=1
|
||||
TESTFIXTURE_FLAGS += -DSQLITE_SERVER=1 -DSQLITE_PRIVATE="" -DSQLITE_CORE
|
||||
TESTFIXTURE_FLAGS += -DBUILD_sqlite
|
||||
TESTFIXTURE_FLAGS += -DSQLITE_SERIES_CONSTRAINT_VERIFY=1
|
||||
TESTFIXTURE_FLAGS += -DSQLITE_DEFAULT_PAGE_SIZE=1024
|
||||
|
||||
TESTFIXTURE_SRC0 = $(TESTSRC2) libsqlite3.la
|
||||
TESTFIXTURE_SRC1 = sqlite3.c
|
||||
|
59
Makefile.msc
@ -306,6 +306,14 @@ PROGRAMFILES_X86 = $(PROGRAMFILES_X86:\\=\)
|
||||
CC = cl.exe
|
||||
!ENDIF
|
||||
|
||||
# Check for the predefined command macro CSC. This should point to a working
|
||||
# C Sharp compiler binary. If it is not defined, simply define it to the
|
||||
# legacy default value 'csc.exe'.
|
||||
#
|
||||
!IFNDEF CSC
|
||||
CSC = csc.exe
|
||||
!ENDIF
|
||||
|
||||
# Check for the command macro LD. This should point to the linker binary for
|
||||
# the target platform. If it is not defined, simply define it to the legacy
|
||||
# default value 'link.exe'.
|
||||
@ -472,20 +480,24 @@ CORE_COMPILE_OPTS = $(CORE_CCONV_OPTS)
|
||||
# when linking.
|
||||
#
|
||||
!IFNDEF CORE_LINK_DEP
|
||||
!IF $(DYNAMIC_SHELL)!=0 || $(FOR_WIN10)!=0
|
||||
!IF $(DYNAMIC_SHELL)!=0
|
||||
CORE_LINK_DEP =
|
||||
!ELSE
|
||||
!ELSEIF $(FOR_WIN10)==0 || "$(PLATFORM)"=="x86"
|
||||
CORE_LINK_DEP = sqlite3.def
|
||||
!ELSE
|
||||
CORE_LINK_DEP =
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
|
||||
# These are additional linker options used for the core library.
|
||||
#
|
||||
!IFNDEF CORE_LINK_OPTS
|
||||
!IF $(DYNAMIC_SHELL)!=0 || $(FOR_WIN10)!=0
|
||||
!IF $(DYNAMIC_SHELL)!=0
|
||||
CORE_LINK_OPTS =
|
||||
!ELSE
|
||||
!ELSEIF $(FOR_WIN10)==0 || "$(PLATFORM)"=="x86"
|
||||
CORE_LINK_OPTS = /DEF:sqlite3.def
|
||||
!ELSE
|
||||
CORE_LINK_OPTS =
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
|
||||
@ -1238,6 +1250,7 @@ TESTSRC = \
|
||||
$(TOP)\src\test_autoext.c \
|
||||
$(TOP)\src\test_async.c \
|
||||
$(TOP)\src\test_backup.c \
|
||||
$(TOP)\src\test_bestindex.c \
|
||||
$(TOP)\src\test_blob.c \
|
||||
$(TOP)\src\test_btree.c \
|
||||
$(TOP)\src\test_config.c \
|
||||
@ -1412,11 +1425,11 @@ all: dll libsqlite3.lib shell $(ALL_TCL_TARGETS)
|
||||
|
||||
# Dynamic link library section.
|
||||
#
|
||||
dll: $(SQLITE3DLL)
|
||||
dll: $(SQLITE3DLL)
|
||||
|
||||
# Shell executable.
|
||||
#
|
||||
shell: $(SQLITE3EXE)
|
||||
shell: $(SQLITE3EXE)
|
||||
|
||||
# <<mark>>
|
||||
libsqlite3.lib: $(LIBOBJ)
|
||||
@ -1426,16 +1439,16 @@ libtclsqlite3.lib: tclsqlite.lo libsqlite3.lib
|
||||
$(LTLIB) $(LTLIBOPTS) $(LTLIBPATHS) /OUT:$@ tclsqlite.lo libsqlite3.lib $(LIBTCLSTUB) $(TLIBS)
|
||||
# <</mark>>
|
||||
|
||||
$(SQLITE3DLL): $(LIBOBJ) $(LIBRESOBJS) $(CORE_LINK_DEP)
|
||||
$(SQLITE3DLL): $(LIBOBJ) $(LIBRESOBJS) $(CORE_LINK_DEP)
|
||||
$(LD) $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) /DLL $(CORE_LINK_OPTS) /OUT:$@ $(LIBOBJ) $(LIBRESOBJS) $(LTLIBS) $(TLIBS)
|
||||
|
||||
# <<mark>>
|
||||
sqlite3.def: libsqlite3.lib
|
||||
# <<block2>>
|
||||
sqlite3.def: libsqlite3.lib
|
||||
echo EXPORTS > sqlite3.def
|
||||
dumpbin /all libsqlite3.lib \
|
||||
| $(TCLSH_CMD) $(TOP)\tool\replace.tcl include "^\s+1 _?(sqlite3_.*)$$" \1 \
|
||||
| $(TCLSH_CMD) $(TOP)\tool\replace.tcl include "^\s+1 _?(sqlite3_[^@]*)(?:@\d+)?$$" \1 \
|
||||
| sort >> sqlite3.def
|
||||
# <</mark>>
|
||||
# <</block2>>
|
||||
|
||||
$(SQLITE3EXE): $(TOP)\src\shell.c $(SHELL_CORE_DEP) $(LIBRESOBJS) $(SHELL_CORE_SRC) $(SQLITE3H)
|
||||
$(LTLINK) $(SHELL_COMPILE_OPTS) $(READLINE_FLAGS) $(TOP)\src\shell.c $(SHELL_CORE_SRC) \
|
||||
@ -1810,7 +1823,7 @@ parse.c: $(TOP)\src\parse.y lemon.exe $(TOP)\tool\addopcodes.tcl
|
||||
$(SQLITE3H): $(TOP)\src\sqlite.h.in $(TOP)\manifest.uuid $(TOP)\VERSION
|
||||
$(TCLSH_CMD) $(TOP)\tool\mksqlite3h.tcl $(TOP:\=/) > $(SQLITE3H)
|
||||
|
||||
sqlite3ext.h: .target_source
|
||||
sqlite3ext.h: .target_source
|
||||
copy tsrc\sqlite3ext.h .
|
||||
|
||||
mkkeywordhash.exe: $(TOP)\tool\mkkeywordhash.c
|
||||
@ -1914,9 +1927,9 @@ fts5parse.c: $(TOP)\ext\fts5\fts5parse.y lemon.exe
|
||||
del /Q fts5parse.h 2>NUL
|
||||
.\lemon.exe $(REQ_FEATURE_FLAGS) $(OPT_FEATURE_FLAGS) $(EXT_FEATURE_FLAGS) $(OPTS) fts5parse.y
|
||||
|
||||
fts5parse.h: fts5parse.c
|
||||
fts5parse.h: fts5parse.c
|
||||
|
||||
fts5.c: $(FTS5_SRC)
|
||||
fts5.c: $(FTS5_SRC)
|
||||
$(TCLSH_CMD) $(TOP)\ext\fts5\tool\mkfts5c.tcl
|
||||
copy $(TOP)\ext\fts5\fts5.h .
|
||||
|
||||
@ -1942,6 +1955,8 @@ sqlite3rbu.lo: $(TOP)\ext\rbu\sqlite3rbu.c $(HDR) $(EXTHDR)
|
||||
TESTFIXTURE_FLAGS = -DTCLSH=1 -DSQLITE_TEST=1 -DSQLITE_CRASH_TEST=1
|
||||
TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) -DSQLITE_SERVER=1 -DSQLITE_PRIVATE=""
|
||||
TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) -DSQLITE_CORE $(NO_WARN)
|
||||
TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) -DSQLITE_SERIES_CONSTRAINT_VERIFY=1
|
||||
TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) -DSQLITE_DEFAULT_PAGE_SIZE=1024
|
||||
|
||||
TESTFIXTURE_SRC0 = $(TESTEXT) $(TESTSRC2)
|
||||
TESTFIXTURE_SRC1 = $(TESTEXT) $(TESTSRC3) $(SQLITE3C)
|
||||
@ -1957,7 +1972,7 @@ testfixture.exe: $(TESTFIXTURE_SRC) $(SQLITE3H) $(LIBRESOBJS) $(HDR)
|
||||
$(TESTFIXTURE_SRC) \
|
||||
/link $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) $(LIBRESOBJS) $(LTLIBS) $(TLIBS)
|
||||
|
||||
extensiontest: testfixture.exe testloadext.dll
|
||||
extensiontest: testfixture.exe testloadext.dll
|
||||
@set PATH=$(LIBTCLPATH);$(PATH)
|
||||
.\testfixture.exe $(TOP)\test\loadext.test $(TESTOPTS)
|
||||
|
||||
@ -2000,7 +2015,7 @@ smoketest: $(TESTPROGS)
|
||||
@set PATH=$(LIBTCLPATH);$(PATH)
|
||||
.\testfixture.exe $(TOP)\test\main.test $(TESTOPTS)
|
||||
|
||||
sqlite3_analyzer.c: $(SQLITE3C) $(SQLITE3H) $(TOP)\src\tclsqlite.c $(TOP)\tool\spaceanal.tcl
|
||||
sqlite3_analyzer.c: $(SQLITE3C) $(SQLITE3H) $(TOP)\src\tclsqlite.c $(TOP)\tool\spaceanal.tcl
|
||||
echo #define TCLSH 2 > $@
|
||||
echo #define SQLITE_ENABLE_DBSTAT_VTAB 1 >> $@
|
||||
copy $@ + $(SQLITE3C) + $(TOP)\src\tclsqlite.c $@
|
||||
@ -2016,7 +2031,7 @@ sqlite3_analyzer.exe: sqlite3_analyzer.c $(LIBRESOBJS)
|
||||
testloadext.lo: $(TOP)\src\test_loadext.c
|
||||
$(LTCOMPILE) $(NO_WARN) -c $(TOP)\src\test_loadext.c
|
||||
|
||||
testloadext.dll: testloadext.lo
|
||||
testloadext.dll: testloadext.lo
|
||||
$(LD) $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) /DLL /OUT:$@ testloadext.lo
|
||||
|
||||
showdb.exe: $(TOP)\tool\showdb.c $(SQLITE3C) $(SQLITE3H)
|
||||
@ -2058,17 +2073,21 @@ speedtest1.exe: $(TOP)\test\speedtest1.c $(SQLITE3C) $(SQLITE3H)
|
||||
$(LTLINK) $(NO_WARN) -DSQLITE_OMIT_LOAD_EXTENSION -Fe$@ \
|
||||
$(TOP)\test\speedtest1.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
|
||||
|
||||
rbu.exe: $(TOP)\ext\rbu\rbu.c $(TOP)\ext\rbu\sqlite3rbu.c $(SQLITE3C) $(SQLITE3H)
|
||||
rbu.exe: $(TOP)\ext\rbu\rbu.c $(TOP)\ext\rbu\sqlite3rbu.c $(SQLITE3C) $(SQLITE3H)
|
||||
$(LTLINK) $(NO_WARN) -DSQLITE_ENABLE_RBU -Fe$@ \
|
||||
$(TOP)\ext\rbu\rbu.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
|
||||
|
||||
moreclean: clean
|
||||
del /Q $(SQLITE3C) $(SQLITE3H) 2>NUL
|
||||
# <</mark>>
|
||||
|
||||
clean:
|
||||
del /Q *.exp *.lo *.ilk *.lib *.obj *.ncb *.pdb *.sdf *.suo 2>NUL
|
||||
del /Q *.bsc *.def *.cod *.da *.bb *.bbg *.vc gmon.out 2>NUL
|
||||
del /Q $(SQLITE3EXE) $(SQLITE3DLL) 2>NUL
|
||||
del /Q $(SQLITE3EXE) $(SQLITE3DLL) Replace.exe 2>NUL
|
||||
# <<mark>>
|
||||
del /Q $(SQLITE3C) $(SQLITE3H) opcodes.c opcodes.h 2>NUL
|
||||
del /Q sqlite3.c sqlite3.h 2>NUL
|
||||
del /Q opcodes.c opcodes.h 2>NUL
|
||||
del /Q lemon.* lempar.c parse.* 2>NUL
|
||||
del /Q mkkeywordhash.* keywordhash.h 2>NUL
|
||||
del /Q notasharedlib.* 2>NUL
|
||||
|
@ -13,7 +13,7 @@ sqlite3_CFLAGS = $(AM_CFLAGS) -DSQLITE_ENABLE_EXPLAIN_COMMENTS
|
||||
|
||||
include_HEADERS = sqlite3.h sqlite3ext.h
|
||||
|
||||
EXTRA_DIST = sqlite3.1 tea Makefile.msc sqlite3.rc README.txt
|
||||
EXTRA_DIST = sqlite3.1 tea Makefile.msc sqlite3.rc README.txt Replace.cs
|
||||
pkgconfigdir = ${libdir}/pkgconfig
|
||||
pkgconfig_DATA = sqlite3.pc
|
||||
|
||||
|
@ -291,6 +291,14 @@ PROGRAMFILES_X86 = $(PROGRAMFILES_X86:\\=\)
|
||||
CC = cl.exe
|
||||
!ENDIF
|
||||
|
||||
# Check for the predefined command macro CSC. This should point to a working
|
||||
# C Sharp compiler binary. If it is not defined, simply define it to the
|
||||
# legacy default value 'csc.exe'.
|
||||
#
|
||||
!IFNDEF CSC
|
||||
CSC = csc.exe
|
||||
!ENDIF
|
||||
|
||||
# Check for the command macro LD. This should point to the linker binary for
|
||||
# the target platform. If it is not defined, simply define it to the legacy
|
||||
# default value 'link.exe'.
|
||||
@ -457,8 +465,10 @@ CORE_COMPILE_OPTS = $(CORE_CCONV_OPTS)
|
||||
# when linking.
|
||||
#
|
||||
!IFNDEF CORE_LINK_DEP
|
||||
!IF $(DYNAMIC_SHELL)!=0 || $(FOR_WIN10)!=0
|
||||
!IF $(DYNAMIC_SHELL)!=0
|
||||
CORE_LINK_DEP =
|
||||
!ELSEIF $(FOR_WIN10)==0 || "$(PLATFORM)"=="x86"
|
||||
CORE_LINK_DEP = sqlite3.def
|
||||
!ELSE
|
||||
CORE_LINK_DEP =
|
||||
!ENDIF
|
||||
@ -467,8 +477,10 @@ CORE_LINK_DEP =
|
||||
# These are additional linker options used for the core library.
|
||||
#
|
||||
!IFNDEF CORE_LINK_OPTS
|
||||
!IF $(DYNAMIC_SHELL)!=0 || $(FOR_WIN10)!=0
|
||||
!IF $(DYNAMIC_SHELL)!=0
|
||||
CORE_LINK_OPTS =
|
||||
!ELSEIF $(FOR_WIN10)==0 || "$(PLATFORM)"=="x86"
|
||||
CORE_LINK_OPTS = /DEF:sqlite3.def
|
||||
!ELSE
|
||||
CORE_LINK_OPTS =
|
||||
!ENDIF
|
||||
@ -874,16 +886,24 @@ all: dll shell
|
||||
|
||||
# Dynamic link library section.
|
||||
#
|
||||
dll: $(SQLITE3DLL)
|
||||
dll: $(SQLITE3DLL)
|
||||
|
||||
# Shell executable.
|
||||
#
|
||||
shell: $(SQLITE3EXE)
|
||||
shell: $(SQLITE3EXE)
|
||||
|
||||
|
||||
$(SQLITE3DLL): $(LIBOBJ) $(LIBRESOBJS) $(CORE_LINK_DEP)
|
||||
$(SQLITE3DLL): $(LIBOBJ) $(LIBRESOBJS) $(CORE_LINK_DEP)
|
||||
$(LD) $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) /DLL $(CORE_LINK_OPTS) /OUT:$@ $(LIBOBJ) $(LIBRESOBJS) $(LTLIBS) $(TLIBS)
|
||||
|
||||
Replace.exe:
|
||||
$(CSC) /target:exe $(TOP)\Replace.cs
|
||||
|
||||
sqlite3.def: Replace.exe $(LIBOBJ)
|
||||
echo EXPORTS > sqlite3.def
|
||||
dumpbin /all $(LIBOBJ) \
|
||||
| .\Replace.exe "^\s+/EXPORT:_?(sqlite3_[^@,]*)(?:@\d+|,DATA)?$$" $$1 true \
|
||||
| sort >> sqlite3.def
|
||||
|
||||
$(SQLITE3EXE): $(TOP)\shell.c $(SHELL_CORE_DEP) $(LIBRESOBJS) $(SHELL_CORE_SRC) $(SQLITE3H)
|
||||
$(LTLINK) $(SHELL_COMPILE_OPTS) $(READLINE_FLAGS) $(TOP)\shell.c $(SHELL_CORE_SRC) \
|
||||
@ -923,4 +943,4 @@ $(LIBRESOBJS): $(TOP)\sqlite3.rc rcver.vc $(SQLITE3H)
|
||||
clean:
|
||||
del /Q *.exp *.lo *.ilk *.lib *.obj *.ncb *.pdb *.sdf *.suo 2>NUL
|
||||
del /Q *.bsc *.def *.cod *.da *.bb *.bbg *.vc gmon.out 2>NUL
|
||||
del /Q $(SQLITE3EXE) $(SQLITE3DLL) 2>NUL
|
||||
del /Q $(SQLITE3EXE) $(SQLITE3DLL) Replace.exe 2>NUL
|
||||
|
@ -6,8 +6,8 @@ This package contains:
|
||||
* the shell.c file used to build the sqlite3 command-line shell program
|
||||
* autoconf/automake installation infrastucture for building on POSIX
|
||||
compliant systems
|
||||
* a Makefile.msc and sqlite3.rc for building with Microsoft Visual C++ on
|
||||
Windows
|
||||
* a Makefile.msc, sqlite3.rc, and Replace.cs for building with Microsoft
|
||||
Visual C++ on Windows
|
||||
|
||||
SUMMARY OF HOW TO BUILD
|
||||
=======================
|
||||
|
12
config.h.in
@ -45,6 +45,18 @@
|
||||
/* Define to 1 if you have the <memory.h> header file. */
|
||||
#undef HAVE_MEMORY_H
|
||||
|
||||
/* Define to 1 if you have the pread() function. */
|
||||
#undef HAVE_PREAD
|
||||
|
||||
/* Define to 1 if you have the pread64() function. */
|
||||
#undef HAVE_PREAD64
|
||||
|
||||
/* Define to 1 if you have the pwrite() function. */
|
||||
#undef HAVE_PWRITE
|
||||
|
||||
/* Define to 1 if you have the pwrite64() function. */
|
||||
#undef HAVE_PWRITE64
|
||||
|
||||
/* Define to 1 if you have the <stdint.h> header file. */
|
||||
#undef HAVE_STDINT_H
|
||||
|
||||
|
2
configure
vendored
@ -10273,7 +10273,7 @@ done
|
||||
#########
|
||||
# Figure out whether or not we have these functions
|
||||
#
|
||||
for ac_func in fdatasync gmtime_r isnan localtime_r localtime_s malloc_usable_size strchrnul usleep utime
|
||||
for ac_func in fdatasync gmtime_r isnan localtime_r localtime_s malloc_usable_size strchrnul usleep utime pread pread64 pwrite pwrite64
|
||||
do :
|
||||
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
|
||||
ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
|
||||
|
@ -108,7 +108,7 @@ AC_CHECK_HEADERS([sys/types.h stdlib.h stdint.h inttypes.h malloc.h])
|
||||
#########
|
||||
# Figure out whether or not we have these functions
|
||||
#
|
||||
AC_CHECK_FUNCS([fdatasync gmtime_r isnan localtime_r localtime_s malloc_usable_size strchrnul usleep utime])
|
||||
AC_CHECK_FUNCS([fdatasync gmtime_r isnan localtime_r localtime_s malloc_usable_size strchrnul usleep utime pread pread64 pwrite pwrite64])
|
||||
|
||||
#########
|
||||
# By default, we use the amalgamation (this may be changed below...)
|
||||
|
@ -29,6 +29,18 @@
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
|
||||
/*
|
||||
** Return true if the two-argument version of fts3_tokenizer()
|
||||
** has been activated via a prior call to sqlite3_db_config(db,
|
||||
** SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER, 1, 0);
|
||||
*/
|
||||
static int fts3TokenizerEnabled(sqlite3_context *context){
|
||||
sqlite3 *db = sqlite3_context_db_handle(context);
|
||||
int isEnabled = 0;
|
||||
sqlite3_db_config(db,SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER,-1,&isEnabled);
|
||||
return isEnabled;
|
||||
}
|
||||
|
||||
/*
|
||||
** Implementation of the SQL scalar function for accessing the underlying
|
||||
** hash table. This function may be called as follows:
|
||||
@ -49,7 +61,7 @@
|
||||
** is a blob containing the pointer stored as the hash data corresponding
|
||||
** to string <key-name> (after the hash-table is updated, if applicable).
|
||||
*/
|
||||
static void scalarFunc(
|
||||
static void fts3TokenizerFunc(
|
||||
sqlite3_context *context,
|
||||
int argc,
|
||||
sqlite3_value **argv
|
||||
@ -67,27 +79,23 @@ static void scalarFunc(
|
||||
nName = sqlite3_value_bytes(argv[0])+1;
|
||||
|
||||
if( argc==2 ){
|
||||
#ifdef SQLITE_ENABLE_FTS3_TOKENIZER
|
||||
void *pOld;
|
||||
int n = sqlite3_value_bytes(argv[1]);
|
||||
if( zName==0 || n!=sizeof(pPtr) ){
|
||||
sqlite3_result_error(context, "argument type mismatch", -1);
|
||||
if( fts3TokenizerEnabled(context) ){
|
||||
void *pOld;
|
||||
int n = sqlite3_value_bytes(argv[1]);
|
||||
if( zName==0 || n!=sizeof(pPtr) ){
|
||||
sqlite3_result_error(context, "argument type mismatch", -1);
|
||||
return;
|
||||
}
|
||||
pPtr = *(void **)sqlite3_value_blob(argv[1]);
|
||||
pOld = sqlite3Fts3HashInsert(pHash, (void *)zName, nName, pPtr);
|
||||
if( pOld==pPtr ){
|
||||
sqlite3_result_error(context, "out of memory", -1);
|
||||
}
|
||||
}else{
|
||||
sqlite3_result_error(context, "fts3tokenize disabled", -1);
|
||||
return;
|
||||
}
|
||||
pPtr = *(void **)sqlite3_value_blob(argv[1]);
|
||||
pOld = sqlite3Fts3HashInsert(pHash, (void *)zName, nName, pPtr);
|
||||
if( pOld==pPtr ){
|
||||
sqlite3_result_error(context, "out of memory", -1);
|
||||
return;
|
||||
}
|
||||
#else
|
||||
sqlite3_result_error(context, "fts3tokenize: "
|
||||
"disabled - rebuild with -DSQLITE_ENABLE_FTS3_TOKENIZER", -1
|
||||
);
|
||||
return;
|
||||
#endif /* SQLITE_ENABLE_FTS3_TOKENIZER */
|
||||
}else
|
||||
{
|
||||
}else{
|
||||
if( zName ){
|
||||
pPtr = sqlite3Fts3HashFind(pHash, zName, nName);
|
||||
}
|
||||
@ -98,7 +106,6 @@ static void scalarFunc(
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
sqlite3_result_blob(context, (void *)&pPtr, sizeof(pPtr), SQLITE_TRANSIENT);
|
||||
}
|
||||
|
||||
@ -336,7 +343,6 @@ finish:
|
||||
Tcl_DecrRefCount(pRet);
|
||||
}
|
||||
|
||||
#ifdef SQLITE_ENABLE_FTS3_TOKENIZER
|
||||
static
|
||||
int registerTokenizer(
|
||||
sqlite3 *db,
|
||||
@ -358,7 +364,6 @@ int registerTokenizer(
|
||||
|
||||
return sqlite3_finalize(pStmt);
|
||||
}
|
||||
#endif /* SQLITE_ENABLE_FTS3_TOKENIZER */
|
||||
|
||||
|
||||
static
|
||||
@ -431,13 +436,13 @@ static void intTestFunc(
|
||||
assert( 0==strcmp(sqlite3_errmsg(db), "unknown tokenizer: nosuchtokenizer") );
|
||||
|
||||
/* Test the storage function */
|
||||
#ifdef SQLITE_ENABLE_FTS3_TOKENIZER
|
||||
rc = registerTokenizer(db, "nosuchtokenizer", p1);
|
||||
assert( rc==SQLITE_OK );
|
||||
rc = queryTokenizer(db, "nosuchtokenizer", &p2);
|
||||
assert( rc==SQLITE_OK );
|
||||
assert( p2==p1 );
|
||||
#endif
|
||||
if( fts3TokenizerEnabled(context) ){
|
||||
rc = registerTokenizer(db, "nosuchtokenizer", p1);
|
||||
assert( rc==SQLITE_OK );
|
||||
rc = queryTokenizer(db, "nosuchtokenizer", &p2);
|
||||
assert( rc==SQLITE_OK );
|
||||
assert( p2==p1 );
|
||||
}
|
||||
|
||||
sqlite3_result_text(context, "ok", -1, SQLITE_STATIC);
|
||||
}
|
||||
@ -453,7 +458,7 @@ static void intTestFunc(
|
||||
** sqlite3Fts3HashInit(pHash, FTS3_HASH_STRING, 1);
|
||||
**
|
||||
** This function adds a scalar function (see header comment above
|
||||
** scalarFunc() in this file for details) and, if ENABLE_TABLE is
|
||||
** fts3TokenizerFunc() in this file for details) and, if ENABLE_TABLE is
|
||||
** defined at compilation time, a temporary virtual table (see header
|
||||
** comment above struct HashTableVtab) to the database schema. Both
|
||||
** provide read/write access to the contents of *pHash.
|
||||
@ -482,10 +487,10 @@ int sqlite3Fts3InitHashTable(
|
||||
#endif
|
||||
|
||||
if( SQLITE_OK==rc ){
|
||||
rc = sqlite3_create_function(db, zName, 1, any, p, scalarFunc, 0, 0);
|
||||
rc = sqlite3_create_function(db, zName, 1, any, p, fts3TokenizerFunc, 0, 0);
|
||||
}
|
||||
if( SQLITE_OK==rc ){
|
||||
rc = sqlite3_create_function(db, zName, 2, any, p, scalarFunc, 0, 0);
|
||||
rc = sqlite3_create_function(db, zName, 2, any, p, fts3TokenizerFunc, 0, 0);
|
||||
}
|
||||
#ifdef SQLITE_TEST
|
||||
if( SQLITE_OK==rc ){
|
||||
|
@ -698,6 +698,7 @@ static Fts5Data *fts5DataRead(Fts5Index *p, i64 iRowid){
|
||||
return pRet;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
** Release a reference to data record returned by an earlier call to
|
||||
** fts5DataRead().
|
||||
@ -2154,6 +2155,10 @@ static void fts5LeafSeek(
|
||||
iPgidx = szLeaf;
|
||||
iPgidx += fts5GetVarint32(&a[iPgidx], iTermOff);
|
||||
iOff = iTermOff;
|
||||
if( iOff>n ){
|
||||
p->rc = FTS5_CORRUPT;
|
||||
return;
|
||||
}
|
||||
|
||||
while( 1 ){
|
||||
|
||||
@ -4499,7 +4504,10 @@ int sqlite3Fts5IndexOptimize(Fts5Index *p){
|
||||
if( pLvl->aSeg ){
|
||||
int iLvl, iSeg;
|
||||
int iSegOut = 0;
|
||||
for(iLvl=0; iLvl<pStruct->nLevel; iLvl++){
|
||||
/* Iterate through all segments, from oldest to newest. Add them to
|
||||
** the new Fts5Level object so that pLvl->aSeg[0] is the oldest
|
||||
** segment in the data structure. */
|
||||
for(iLvl=pStruct->nLevel-1; iLvl>=0; iLvl--){
|
||||
for(iSeg=0; iSeg<pStruct->aLevel[iLvl].nSeg; iSeg++){
|
||||
pLvl->aSeg[iSegOut] = pStruct->aLevel[iLvl].aSeg[iSeg];
|
||||
iSegOut++;
|
||||
|
@ -16,8 +16,13 @@ if {![info exists testdir]} {
|
||||
source $testdir/tester.tcl
|
||||
|
||||
ifcapable !fts5 {
|
||||
finish_test
|
||||
proc return_if_no_fts5 {} {
|
||||
finish_test
|
||||
return -code return
|
||||
}
|
||||
return
|
||||
} else {
|
||||
proc return_if_no_fts5 {} {}
|
||||
}
|
||||
|
||||
catch {
|
||||
@ -25,12 +30,6 @@ catch {
|
||||
reset_db
|
||||
}
|
||||
|
||||
# If SQLITE_ENABLE_FTS5 is not defined, skip this test.
|
||||
ifcapable !fts5 {
|
||||
finish_test
|
||||
return
|
||||
}
|
||||
|
||||
proc fts5_test_poslist {cmd} {
|
||||
set res [list]
|
||||
for {set i 0} {$i < [$cmd xInstCount]} {incr i} {
|
||||
|
@ -14,6 +14,7 @@
|
||||
|
||||
source [file join [file dirname [info script]] fts5_common.tcl]
|
||||
set testprefix fts5bigtok
|
||||
return_if_no_fts5
|
||||
|
||||
proc rndterm {} {
|
||||
set L [list a b c d e f g h i j k l m n o p q r s t u v w x y z]
|
||||
|
@ -13,7 +13,8 @@
|
||||
#
|
||||
|
||||
source [file join [file dirname [info script]] fts5_common.tcl]
|
||||
set testprefix fts5merge
|
||||
set testprefix fts5merge2
|
||||
return_if_no_fts5
|
||||
|
||||
proc dump_structure {} {
|
||||
db eval {SELECT fts5_decode(id, block) AS t FROM t1_data WHERE id=10} {
|
||||
@ -26,8 +27,6 @@ proc dump_structure {} {
|
||||
|
||||
foreach_detail_mode $testprefix {
|
||||
|
||||
if {[detail_is_none]==0} continue
|
||||
|
||||
do_execsql_test 1.0 {
|
||||
CREATE VIRTUAL TABLE t1 USING fts5(x, detail=%DETAIL%);
|
||||
INSERT INTO t1(t1, rank) VALUES('pgsz', 32);
|
||||
|
@ -409,5 +409,43 @@ do_catchsql_test 19.2 {
|
||||
SELECT * FROM x1 WHERE x1 MATCH 'c0 AND (c1 AND (c2 AND (c3 AND (c4 AND (c5 AND (c6 AND (c7 AND (c8 AND (c9 AND (c10 AND (c11 AND (c12 AND (c13 AND (c14 AND (c15 AND (c16 AND (c17 AND (c18 AND (c19 AND (c20 AND (c21 AND (c22 AND (c23 AND (c24 AND (c25 AND (c26 AND (c27 AND (c28 AND (c29 AND (c30 AND (c31 AND (c32 AND (c33 AND (c34 AND (c35 AND (c36 AND (c37 AND (c38 AND (c39 AND (c40 AND (c41 AND (c42 AND (c43 AND (c44 AND (c45 AND (c46 AND (c47 AND (c48 AND (c49 AND (c50 AND (c51 AND (c52 AND (c53 AND (c54 AND (c55 AND (c56 AND (c57 AND (c58 AND (c59 AND (c60 AND (c61 AND (c62 AND (c63 AND (c64 AND (c65 AND (c66 AND (c67 AND (c68 AND (c69 AND (c70 AND (c71 AND (c72 AND (c73 AND (c74 AND (c75 AND (c76 AND (c77 AND (c78 AND (c79 AND (c80 AND (c81 AND (c82 AND (c83 AND (c84 AND (c85 AND (c86 AND (c87 AND (c88 AND (c89 AND (c90 AND (c91 AND (c92 AND (c93 AND (c94 AND (c95 AND (c96 AND (c97 AND (c98 AND (c99 AND (c100 AND (c101 AND (c102 AND (c103 AND (c104 AND (c105 AND (c106 AND (c107 AND (c108 AND (c109 AND (c110 AND (c111 AND (c112 AND (c113 AND (c114 AND (c115 AND (c116 AND (c117 AND (c118 AND (c119 AND (c120 AND (c121 AND (c122 AND (c123 AND (c124 AND (c125 AND (c126 AND (c127 AND (c128 AND (c129 AND (c130 AND (c131 AND (c132 AND (c133 AND (c134 AND (c135 AND (c136 AND (c137 AND (c138 AND (c139 AND (c140 AND (c141 AND (c142 AND (c143 AND (c144 AND (c145 AND (c146 AND (c147 AND (c148 AND (c149 AND (c150 AND (c151 AND (c152 AND (c153 AND (c154 AND (c155 AND (c156 AND (c157 AND (c158 AND (c159 AND (c160 AND (c161 AND (c162 AND (c163 AND (c164 AND (c165 AND (c166 AND (c167 AND (c168 AND (c169 AND (c170 AND (c171 AND (c172 AND (c173 AND (c174 AND (c175 AND (c176 AND (c177 AND (c178 AND (c179 AND (c180 AND (c181 AND (c182 AND (c183 AND (c184 AND (c185 AND (c186 AND (c187 AND (c188 AND (c189 AND (c190 AND (c191 AND (c192 AND (c193 AND (c194 AND (c195 AND (c196 AND (c197 AND (c198 AND (c199 AND c200)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))';
|
||||
} {1 {fts5: parser stack overflow}}
|
||||
|
||||
finish_test
|
||||
#-------------------------------------------------------------------------
|
||||
reset_db
|
||||
breakpoint
|
||||
do_execsql_test 20.0 {
|
||||
CREATE VIRTUAL TABLE x1 USING fts5(x);
|
||||
INSERT INTO x1(x1, rank) VALUES('pgsz', 32);
|
||||
INSERT INTO x1(rowid, x) VALUES(11111, 'onetwothree');
|
||||
}
|
||||
do_test 20.1 {
|
||||
for {set i 1} {$i <= 200} {incr i} {
|
||||
execsql { INSERT INTO x1(rowid, x) VALUES($i, 'one two three'); }
|
||||
}
|
||||
execsql { INSERT INTO x1(x1) VALUES('optimize'); }
|
||||
execsql { DELETE FROM x1 WHERE rowid = 4; }
|
||||
} {}
|
||||
do_execsql_test 20.2 {
|
||||
INSERT INTO x1(x1) VALUES('optimize');
|
||||
INSERT INTO x1(x1) VALUES('integrity-check');
|
||||
} {}
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
reset_db
|
||||
do_execsql_test 20.0 {
|
||||
CREATE VIRTUAL TABLE x1 USING fts5(x);
|
||||
INSERT INTO x1(x1, rank) VALUES('pgsz', 32);
|
||||
INSERT INTO x1(rowid, x) VALUES(11111, 'onetwothree');
|
||||
}
|
||||
do_test 20.1 {
|
||||
for {set i 1} {$i <= 200} {incr i} {
|
||||
execsql { INSERT INTO x1(rowid, x) VALUES($i, 'one two three'); }
|
||||
}
|
||||
execsql { INSERT INTO x1(x1) VALUES('optimize'); }
|
||||
execsql { DELETE FROM x1 WHERE rowid = 4; }
|
||||
} {}
|
||||
do_execsql_test 20.2 {
|
||||
INSERT INTO x1(x1) VALUES('optimize');
|
||||
INSERT INTO x1(x1) VALUES('integrity-check');
|
||||
} {}
|
||||
|
||||
finish_test
|
||||
|
112
ext/icu/icu.c
@ -60,6 +60,38 @@ static void xFree(void *p){
|
||||
sqlite3_free(p);
|
||||
}
|
||||
|
||||
/*
|
||||
** This lookup table is used to help decode the first byte of
|
||||
** a multi-byte UTF8 character. It is copied here from SQLite source
|
||||
** code file utf8.c.
|
||||
*/
|
||||
static const unsigned char icuUtf8Trans1[] = {
|
||||
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
|
||||
0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
|
||||
0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
|
||||
0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,
|
||||
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
|
||||
0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
|
||||
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
|
||||
0x00, 0x01, 0x02, 0x03, 0x00, 0x01, 0x00, 0x00,
|
||||
};
|
||||
|
||||
#define SQLITE_ICU_READ_UTF8(zIn, c) \
|
||||
c = *(zIn++); \
|
||||
if( c>=0xc0 ){ \
|
||||
c = icuUtf8Trans1[c-0xc0]; \
|
||||
while( (*zIn & 0xc0)==0x80 ){ \
|
||||
c = (c<<6) + (0x3f & *(zIn++)); \
|
||||
} \
|
||||
}
|
||||
|
||||
#define SQLITE_ICU_SKIP_UTF8(zIn) \
|
||||
assert( *zIn ); \
|
||||
if( *(zIn++)>=0xc0 ){ \
|
||||
while( (*zIn & 0xc0)==0x80 ){zIn++;} \
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
** Compare two UTF-8 strings for equality where the first string is
|
||||
** a "LIKE" expression. Return true (1) if they are the same and
|
||||
@ -73,16 +105,14 @@ static int icuLikeCompare(
|
||||
static const int MATCH_ONE = (UChar32)'_';
|
||||
static const int MATCH_ALL = (UChar32)'%';
|
||||
|
||||
int iPattern = 0; /* Current byte index in zPattern */
|
||||
int iString = 0; /* Current byte index in zString */
|
||||
|
||||
int prevEscape = 0; /* True if the previous character was uEsc */
|
||||
|
||||
while( zPattern[iPattern]!=0 ){
|
||||
while( 1 ){
|
||||
|
||||
/* Read (and consume) the next character from the input pattern. */
|
||||
UChar32 uPattern;
|
||||
U8_NEXT_UNSAFE(zPattern, iPattern, uPattern);
|
||||
SQLITE_ICU_READ_UTF8(zPattern, uPattern);
|
||||
if( uPattern==0 ) break;
|
||||
|
||||
/* There are now 4 possibilities:
|
||||
**
|
||||
@ -99,28 +129,28 @@ static int icuLikeCompare(
|
||||
** MATCH_ALL. For each MATCH_ONE, skip one character in the
|
||||
** test string.
|
||||
*/
|
||||
while( (c=zPattern[iPattern]) == MATCH_ALL || c == MATCH_ONE ){
|
||||
while( (c=*zPattern) == MATCH_ALL || c == MATCH_ONE ){
|
||||
if( c==MATCH_ONE ){
|
||||
if( zString[iString]==0 ) return 0;
|
||||
U8_FWD_1_UNSAFE(zString, iString);
|
||||
if( *zString==0 ) return 0;
|
||||
SQLITE_ICU_SKIP_UTF8(zString);
|
||||
}
|
||||
iPattern++;
|
||||
zPattern++;
|
||||
}
|
||||
|
||||
if( zPattern[iPattern]==0 ) return 1;
|
||||
if( *zPattern==0 ) return 1;
|
||||
|
||||
while( zString[iString] ){
|
||||
if( icuLikeCompare(&zPattern[iPattern], &zString[iString], uEsc) ){
|
||||
while( *zString ){
|
||||
if( icuLikeCompare(zPattern, zString, uEsc) ){
|
||||
return 1;
|
||||
}
|
||||
U8_FWD_1_UNSAFE(zString, iString);
|
||||
SQLITE_ICU_SKIP_UTF8(zString);
|
||||
}
|
||||
return 0;
|
||||
|
||||
}else if( !prevEscape && uPattern==MATCH_ONE ){
|
||||
/* Case 2. */
|
||||
if( zString[iString]==0 ) return 0;
|
||||
U8_FWD_1_UNSAFE(zString, iString);
|
||||
if( *zString==0 ) return 0;
|
||||
SQLITE_ICU_SKIP_UTF8(zString);
|
||||
|
||||
}else if( !prevEscape && uPattern==uEsc){
|
||||
/* Case 3. */
|
||||
@ -129,7 +159,7 @@ static int icuLikeCompare(
|
||||
}else{
|
||||
/* Case 4. */
|
||||
UChar32 uString;
|
||||
U8_NEXT_UNSAFE(zString, iString, uString);
|
||||
SQLITE_ICU_READ_UTF8(zString, uString);
|
||||
uString = u_foldCase(uString, U_FOLD_CASE_DEFAULT);
|
||||
uPattern = u_foldCase(uPattern, U_FOLD_CASE_DEFAULT);
|
||||
if( uString!=uPattern ){
|
||||
@ -139,7 +169,7 @@ static int icuLikeCompare(
|
||||
}
|
||||
}
|
||||
|
||||
return zString[iString]==0;
|
||||
return *zString==0;
|
||||
}
|
||||
|
||||
/*
|
||||
@ -325,11 +355,11 @@ static void icuRegexpFunc(sqlite3_context *p, int nArg, sqlite3_value **apArg){
|
||||
*/
|
||||
static void icuCaseFunc16(sqlite3_context *p, int nArg, sqlite3_value **apArg){
|
||||
const UChar *zInput;
|
||||
UChar *zOutput;
|
||||
UChar *zOutput = 0;
|
||||
int nInput;
|
||||
int nOutput;
|
||||
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
int nOut;
|
||||
int cnt;
|
||||
UErrorCode status;
|
||||
const char *zLocale = 0;
|
||||
|
||||
assert(nArg==1 || nArg==2);
|
||||
@ -341,26 +371,34 @@ static void icuCaseFunc16(sqlite3_context *p, int nArg, sqlite3_value **apArg){
|
||||
if( !zInput ){
|
||||
return;
|
||||
}
|
||||
nInput = sqlite3_value_bytes16(apArg[0]);
|
||||
|
||||
nOutput = nInput * 2 + 2;
|
||||
zOutput = sqlite3_malloc(nOutput);
|
||||
if( !zOutput ){
|
||||
nOut = nInput = sqlite3_value_bytes16(apArg[0]);
|
||||
if( nOut==0 ){
|
||||
sqlite3_result_text16(p, "", 0, SQLITE_STATIC);
|
||||
return;
|
||||
}
|
||||
|
||||
if( sqlite3_user_data(p) ){
|
||||
u_strToUpper(zOutput, nOutput/2, zInput, nInput/2, zLocale, &status);
|
||||
}else{
|
||||
u_strToLower(zOutput, nOutput/2, zInput, nInput/2, zLocale, &status);
|
||||
for(cnt=0; cnt<2; cnt++){
|
||||
UChar *zNew = sqlite3_realloc(zOutput, nOut);
|
||||
if( zNew==0 ){
|
||||
sqlite3_free(zOutput);
|
||||
sqlite3_result_error_nomem(p);
|
||||
return;
|
||||
}
|
||||
zOutput = zNew;
|
||||
status = U_ZERO_ERROR;
|
||||
if( sqlite3_user_data(p) ){
|
||||
nOut = 2*u_strToUpper(zOutput,nOut/2,zInput,nInput/2,zLocale,&status);
|
||||
}else{
|
||||
nOut = 2*u_strToLower(zOutput,nOut/2,zInput,nInput/2,zLocale,&status);
|
||||
}
|
||||
if( !U_SUCCESS(status) ){
|
||||
if( status==U_BUFFER_OVERFLOW_ERROR ) continue;
|
||||
icuFunctionError(p,
|
||||
sqlite3_user_data(p) ? "u_strToUpper" : "u_strToLower", status);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if( !U_SUCCESS(status) ){
|
||||
icuFunctionError(p, "u_strToLower()/u_strToUpper", status);
|
||||
return;
|
||||
}
|
||||
|
||||
sqlite3_result_text16(p, zOutput, -1, xFree);
|
||||
sqlite3_result_text16(p, zOutput, nOut, xFree);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -217,6 +217,14 @@ static int seriesEof(sqlite3_vtab_cursor *cur){
|
||||
}
|
||||
}
|
||||
|
||||
/* True to cause run-time checking of the start=, stop=, and/or step=
|
||||
** parameters. The only reason to do this is for testing the
|
||||
** constraint checking logic for virtual tables in the SQLite core.
|
||||
*/
|
||||
#ifndef SQLITE_SERIES_CONSTRAINT_VERIFY
|
||||
# define SQLITE_SERIES_CONSTRAINT_VERIFY 0
|
||||
#endif
|
||||
|
||||
/*
|
||||
** This method is called to "rewind" the series_cursor object back
|
||||
** to the first row of output. This method is always called at least
|
||||
@ -324,20 +332,20 @@ static int seriesBestIndex(
|
||||
}
|
||||
if( startIdx>=0 ){
|
||||
pIdxInfo->aConstraintUsage[startIdx].argvIndex = ++nArg;
|
||||
pIdxInfo->aConstraintUsage[startIdx].omit = 1;
|
||||
pIdxInfo->aConstraintUsage[startIdx].omit= !SQLITE_SERIES_CONSTRAINT_VERIFY;
|
||||
}
|
||||
if( stopIdx>=0 ){
|
||||
pIdxInfo->aConstraintUsage[stopIdx].argvIndex = ++nArg;
|
||||
pIdxInfo->aConstraintUsage[stopIdx].omit = 1;
|
||||
pIdxInfo->aConstraintUsage[stopIdx].omit = !SQLITE_SERIES_CONSTRAINT_VERIFY;
|
||||
}
|
||||
if( stepIdx>=0 ){
|
||||
pIdxInfo->aConstraintUsage[stepIdx].argvIndex = ++nArg;
|
||||
pIdxInfo->aConstraintUsage[stepIdx].omit = 1;
|
||||
pIdxInfo->aConstraintUsage[stepIdx].omit = !SQLITE_SERIES_CONSTRAINT_VERIFY;
|
||||
}
|
||||
if( (idxNum & 3)==3 ){
|
||||
/* Both start= and stop= boundaries are available. This is the
|
||||
** the preferred case */
|
||||
pIdxInfo->estimatedCost = (double)1;
|
||||
pIdxInfo->estimatedCost = (double)(2 - ((idxNum&4)!=0));
|
||||
pIdxInfo->estimatedRows = 1000;
|
||||
if( pIdxInfo->nOrderBy==1 ){
|
||||
if( pIdxInfo->aOrderBy[0].desc ) idxNum |= 8;
|
||||
|
@ -1775,7 +1775,7 @@ static void scriptCodeSqlFunc(
|
||||
*/
|
||||
|
||||
/* Maximum length of a phonehash used for querying the shadow table */
|
||||
#define SPELLFIX_MX_HASH 8
|
||||
#define SPELLFIX_MX_HASH 32
|
||||
|
||||
/* Maximum number of hash strings to examine per query */
|
||||
#define SPELLFIX_MX_RUN 1
|
||||
|
5
main.mk
@ -290,6 +290,7 @@ TESTSRC = \
|
||||
$(TOP)/src/test_autoext.c \
|
||||
$(TOP)/src/test_async.c \
|
||||
$(TOP)/src/test_backup.c \
|
||||
$(TOP)/src/test_bestindex.c \
|
||||
$(TOP)/src/test_blob.c \
|
||||
$(TOP)/src/test_btree.c \
|
||||
$(TOP)/src/test_config.c \
|
||||
@ -736,7 +737,9 @@ sqlite3_analyzer$(EXE): sqlite3_analyzer.c
|
||||
# Rules to build the 'testfixture' application.
|
||||
#
|
||||
TESTFIXTURE_FLAGS = -DSQLITE_TEST=1 -DSQLITE_CRASH_TEST=1
|
||||
TESTFIXTURE_FLAGS += -DSQLITE_SERVER=1 -DSQLITE_PRIVATE="" -DSQLITE_CORE
|
||||
TESTFIXTURE_FLAGS += -DSQLITE_SERVER=1 -DSQLITE_PRIVATE="" -DSQLITE_CORE
|
||||
TESTFIXTURE_FLAGS += -DSQLITE_SERIES_CONSTRAINT_VERIFY=1
|
||||
TESTFIXTURE_FLAGS += -DSQLITE_DEFAULT_PAGE_SIZE=1024
|
||||
|
||||
testfixture$(EXE): $(TESTSRC2) libsqlite3.a $(TESTSRC) $(TOP)/src/tclsqlite.c
|
||||
$(TCCX) $(TCL_FLAGS) -DTCLSH=1 $(TESTFIXTURE_FLAGS) \
|
||||
|
176
manifest
@ -1,8 +1,8 @@
|
||||
C Disable\sthe\sRESTRICT\sforeign\skey\saction\sif\s"PRAGMA\sdefer_foreign_keys"\sis\sset.
|
||||
D 2016-02-25T19:52:11.580
|
||||
F Makefile.in 5cbf3f753328d1bcd3a6117785b4874d99612f8f
|
||||
C Merge\srecent\senhancements\sfrom\strunk.\s\sDefault\spage\ssize\sis\s4096.\s\sWrites\nto\sstatement\sjournals\sare\savoided.
|
||||
D 2016-03-04T16:42:43.133
|
||||
F Makefile.in 055473c5b509b37ae18d4c3ed39af4b124476f0d
|
||||
F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434
|
||||
F Makefile.msc cf5496f4c4e256a79bae1804da61703647b26398
|
||||
F Makefile.msc ea016bfc6d772cb81c2ba2722460937f04ae07f9
|
||||
F README.md 8ecc12493ff9f820cdea6520a9016001cb2e59b7
|
||||
F VERSION c6b1f51809551d60ad001e6d87cf3ab2c7f54b6f
|
||||
F aclocal.m4 a5c22d164aff7ed549d53a90fa56d56955281f50
|
||||
@ -10,10 +10,10 @@ F art/sqlite370.eps aa97a671332b432a54e1d74ff5e8775be34200c2
|
||||
F art/sqlite370.ico af56c1d00fee7cd4753e8631ed60703ed0fc6e90
|
||||
F art/sqlite370.jpg d512473dae7e378a67e28ff96a34da7cb331def2
|
||||
F autoconf/INSTALL 83e4a25da9fd053c7b3665eaaaf7919707915903
|
||||
F autoconf/Makefile.am 29e2a6e8d0c5e32723a48b4faf6b168854dde5f4
|
||||
F autoconf/Makefile.msc d5ab32cf30d6ba8b5ce20835b4042f6cc2a4cb39
|
||||
F autoconf/Makefile.am 4b8bd7896fffb6b22a57747f1f98cba1da9108ae
|
||||
F autoconf/Makefile.msc b8ada5177e6f39c126a88295af5ad0255e08d280
|
||||
F autoconf/README.first 6c4f34fe115ff55d4e8dbfa3cecf04a0188292f7
|
||||
F autoconf/README.txt 7c31da66232f7590bb987cfcd4e2381744b25d24
|
||||
F autoconf/README.txt 4f04b0819303aabaa35fff5f7b257fb0c1ef95f1
|
||||
F autoconf/configure.ac 72a5e42beb090b32bca580285dc0ab3c4670adb8
|
||||
F autoconf/tea/Makefile.in b438a7020446c8a8156e8d97c8914a04833da6fd
|
||||
F autoconf/tea/README 3e9a3c060f29a44344ab50aec506f4db903fb873
|
||||
@ -28,10 +28,10 @@ F autoconf/tea/win/makefile.vc f89d0184d0eee5f7e356ea407964dcd139939928
|
||||
F autoconf/tea/win/nmakehlp.c 247538ad8e8c508f33c03ec1fbd67d3a07ef6291
|
||||
F autoconf/tea/win/rules.vc c511f222b80064096b705dbeb97060ee1d6b6d63
|
||||
F config.guess 226d9a188c6196f3033ffc651cbc9dcee1a42977
|
||||
F config.h.in 42b71ad3fe21c9e88fa59e8458ca1a6bc72eb0c0
|
||||
F config.h.in 6376abec766e9a0785178b1823b5a587e9f1ccbc
|
||||
F config.sub 9ebe4c3b3dab6431ece34f16828b594fb420da55
|
||||
F configure 0339a635cd2943a3b56000a10a11b4b2e6ed6d1b x
|
||||
F configure.ac a2224b1162f79848982d3618ac1deffcd94e88ec
|
||||
F configure c01a159fdf7ea0171ad01ce2937283f2c7972bde x
|
||||
F configure.ac 89e4e02a83d8a1528011f8395621b8c3186b4089
|
||||
F contrib/sqlitecon.tcl 210a913ad63f9f991070821e599d600bd913e0ad
|
||||
F doc/lemon.html c30255bea0fd87a81f082d17a72c9dffbc3f6dd9
|
||||
F doc/pager-invariants.txt 27fed9a70ddad2088750c4a2b493b63853da2710
|
||||
@ -83,7 +83,7 @@ F ext/fts3/fts3_snippet.c 68ae118b0f834ea53d2b89e4087fc0f0b8c4ee4e
|
||||
F ext/fts3/fts3_term.c 88c55a6fa1a51ab494e33dced0401a6c28791fd7
|
||||
F ext/fts3/fts3_test.c 11e36437b0f3f2266acea5b4787f615e4337a237
|
||||
F ext/fts3/fts3_tokenize_vtab.c a27593ab19657166f6fa5ec073b678cc29a75860
|
||||
F ext/fts3/fts3_tokenizer.c 4bd72f767f61c9ce5a7575c844e8d1ed2c3c561a
|
||||
F ext/fts3/fts3_tokenizer.c 3cf21cd2212db17a88d4ef7da0fd8a80275979a1
|
||||
F ext/fts3/fts3_tokenizer.h 64c6ef6c5272c51ebe60fc607a896e84288fcbc3
|
||||
F ext/fts3/fts3_tokenizer1.c 5c98225a53705e5ee34824087478cf477bdb7004
|
||||
F ext/fts3/fts3_unicode.c a93f5edc0aff44ef8b06d7cb55b52026541ca145
|
||||
@ -104,7 +104,7 @@ F ext/fts5/fts5_buffer.c 4c1502d4c956cd092c89ce4480867f9d8bf325cd
|
||||
F ext/fts5/fts5_config.c 35c5173cae4eb17e82164a7f5aeef56a48903079
|
||||
F ext/fts5/fts5_expr.c 8e8e4635f655133eb39018072fc0f0942a2c4337
|
||||
F ext/fts5/fts5_hash.c f3a7217c86eb8f272871be5f6aa1b6798960a337
|
||||
F ext/fts5/fts5_index.c 78069efb54559a17c35906a741362d0b5c899bd0
|
||||
F ext/fts5/fts5_index.c 26a4a6112864feb599a6f6144d06a78bb179736a
|
||||
F ext/fts5/fts5_main.c db24ac714c6c4a1b3c24a1f8c25889f2952148c1
|
||||
F ext/fts5/fts5_storage.c f8343db90d8c95a4d4b52f6676e354b4649ffd6e
|
||||
F ext/fts5/fts5_tcl.c f8731e0508299bd43f1a2eff7dbeaac870768966
|
||||
@ -116,7 +116,7 @@ F ext/fts5/fts5_varint.c a5aceacda04dafcbae725413d7a16818ecd65738
|
||||
F ext/fts5/fts5_vocab.c dba72ca393d71c2588548b51380387f6b44c77a8
|
||||
F ext/fts5/fts5parse.y 86fe6ba094a47e02fe8be2571539e6833d197764
|
||||
F ext/fts5/mkportersteps.tcl 5acf962d2e0074f701620bb5308155fa1e4a63ba
|
||||
F ext/fts5/test/fts5_common.tcl 61ff0d1a29d98a91c4553b20b3f410d858834ee9
|
||||
F ext/fts5/test/fts5_common.tcl b9b1fed811c0390511cef8b254826ea15d380f4d
|
||||
F ext/fts5/test/fts5aa.test 7e814df4a0e6c22a6fe2d84f210fdc0b5068a084
|
||||
F ext/fts5/test/fts5ab.test 30325a89453280160106be411bba3acf138e6d1b
|
||||
F ext/fts5/test/fts5ac.test 55cad4275a1f5acabfe14d8442a8046b47e49e5f
|
||||
@ -134,7 +134,7 @@ F ext/fts5/test/fts5auto.test 401c20e89f1114d733b94809be1e6f893e16c09e
|
||||
F ext/fts5/test/fts5aux.test 8c687c948cc98e9a94be014df7d518acc1b3b74f
|
||||
F ext/fts5/test/fts5auxdata.test 141a7cbffcceb1bd2799b4b29c183ff8780d586e
|
||||
F ext/fts5/test/fts5bigpl.test 04ee0d7eebbebf17c31f5a0b5c5f9494eac3a0cb
|
||||
F ext/fts5/test/fts5bigtok.test 981b2790f6fa02773c889bd35d42c6b97f80f0f4
|
||||
F ext/fts5/test/fts5bigtok.test 017a9397b14e7598883a6328ead4a6539b42d59a
|
||||
F ext/fts5/test/fts5columnsize.test a8cfef21ffa1c264b9f670a7d94eeaccb5341c07
|
||||
F ext/fts5/test/fts5config.test 8b2bc6dcc0eb06fa2b7dd65b2ce2db09e829e873
|
||||
F ext/fts5/test/fts5conflict.test 26f4e46c4d31e16221794832a990dc4e30e18de5
|
||||
@ -163,7 +163,7 @@ F ext/fts5/test/fts5hash.test 06f9309ccb4d5050a131594e9e47d0b21456837d
|
||||
F ext/fts5/test/fts5integrity.test f5e4f8d284385875068ad0f3e894ce43e9de835d
|
||||
F ext/fts5/test/fts5matchinfo.test f7dde99697bcb310ea8faa8eb2714d9f4dfc0e1b
|
||||
F ext/fts5/test/fts5merge.test 8f3cdba2ec9c5e7e568246e81b700ad37f764367
|
||||
F ext/fts5/test/fts5merge2.test c0cb66eb38a41c26cc5848fb9e50093e0f59ac93
|
||||
F ext/fts5/test/fts5merge2.test a6da3c16d694235938d1939f503cfa53f0943d75
|
||||
F ext/fts5/test/fts5near.test b214cddb1c1f1bddf45c75af768f20145f7e71cc
|
||||
F ext/fts5/test/fts5onepass.test 7ed9608e258132cb8d55e7c479b08676ad68810c
|
||||
F ext/fts5/test/fts5optimize.test 42741e7c085ee0a1276140a752d4407d97c2c9f5
|
||||
@ -177,7 +177,7 @@ F ext/fts5/test/fts5rank.test 7e9e64eac7245637f6f2033aec4b292aaf611aab
|
||||
F ext/fts5/test/fts5rebuild.test 03935f617ace91ed23a6099c7c74d905227ff29b
|
||||
F ext/fts5/test/fts5restart.test c17728fdea26e7d0f617d22ad5b4b2862b994c17
|
||||
F ext/fts5/test/fts5rowid.test 16908a99d6efc9ba21081b4f2b86b3fc699839a6
|
||||
F ext/fts5/test/fts5simple.test e6fe2fb10a2b9193648b32bbc2caecabdf8c333d
|
||||
F ext/fts5/test/fts5simple.test ac5006cc3d0d08b3538e1e76c7300de9f24fbed1
|
||||
F ext/fts5/test/fts5simple2.test 98377ae1ff7749a42c21fe1a139c1ed312522c46
|
||||
F ext/fts5/test/fts5simple3.test 8e71733b3d1b0e695011d02c68ebc5ca40b6124e
|
||||
F ext/fts5/test/fts5synonym.test 6475d189c2e20d60795808f83e36bf9318708d48
|
||||
@ -198,7 +198,7 @@ F ext/fts5/tool/loadfts5.tcl 95b03429ee6b138645703c6ca192c3ac96eaf093
|
||||
F ext/fts5/tool/mkfts5c.tcl d1c2a9ab8e0ec690a52316f33dd9b1d379942f45
|
||||
F ext/fts5/tool/showfts5.tcl d54da0e067306663e2d5d523965ca487698e722c
|
||||
F ext/icu/README.txt d9fbbad0c2f647c3fdf715fc9fd64af53aedfc43
|
||||
F ext/icu/icu.c b2732aef0b076e4276d9b39b5a33cec7a05e1413
|
||||
F ext/icu/icu.c 4bdf4c5daedabcd8e6eb6e6a377657f7b978f9f7
|
||||
F ext/icu/sqliteicu.h 728867a802baa5a96de7495e9689a8e01715ef37
|
||||
F ext/misc/amatch.c a1a8f66c29d40bd71b075546ddeddb477b17a2bb
|
||||
F ext/misc/closure.c 0d2a038df8fbae7f19de42e7c7d71f2e4dc88704
|
||||
@ -212,9 +212,9 @@ F ext/misc/nextchar.c 35c8b8baacb96d92abbb34a83a997b797075b342
|
||||
F ext/misc/percentile.c bcbee3c061b884eccb80e21651daaae8e1e43c63
|
||||
F ext/misc/regexp.c af92cdaa5058fcec1451e49becc7ba44dba023dc
|
||||
F ext/misc/rot13.c 1ac6f95f99b575907b9b09c81a349114cf9be45a
|
||||
F ext/misc/series.c b8fb7befd85b3a9b4a10e701b30b2b79ca92b6d4
|
||||
F ext/misc/series.c e11e534ada797d5b816d7e7a93c022306563ca35
|
||||
F ext/misc/showauth.c 732578f0fe4ce42d577e1c86dc89dd14a006ab52
|
||||
F ext/misc/spellfix.c 525190484b7a9dbc6be646c4842274fff4f27d53
|
||||
F ext/misc/spellfix.c 194b5fc3a9a63cb6c5680d8f713800012bddca7c
|
||||
F ext/misc/totype.c 4a167594e791abeed95e0a8db028822b5e8fe512
|
||||
F ext/misc/vfslog.c fe40fab5c077a40477f7e5eba994309ecac6cc95
|
||||
F ext/misc/vtshim.c babb0dc2bf116029e3e7c9a618b8a1377045303e
|
||||
@ -293,7 +293,7 @@ F ext/userauth/userauth.c 5fa3bdb492f481bbc1709fc83c91ebd13460c69e
|
||||
F install-sh 9d4de14ab9fb0facae2f48780b874848cbf2f895 x
|
||||
F ltmain.sh 3ff0879076df340d2e23ae905484d8c15d5fdea8
|
||||
F magic.txt 8273bf49ba3b0c8559cb2774495390c31fd61c60
|
||||
F main.mk 347535e93b4a3b65c2b73002fefc931308cd034b
|
||||
F main.mk b61722224cf37810ee3160a5c3f927e1a90cc25b
|
||||
F mkso.sh fd21c06b063bb16a5d25deea1752c2da6ac3ed83
|
||||
F mptest/config01.test 3c6adcbc50b991866855f1977ff172eb6d901271
|
||||
F mptest/config02.test 4415dfe36c48785f751e16e32c20b077c28ae504
|
||||
@ -305,7 +305,7 @@ F spec.template 86a4a43b99ebb3e75e6b9a735d5fd293a24e90ca
|
||||
F sqlite.pc.in 42b7bf0d02e08b9e77734a47798d1a55a9e0716b
|
||||
F sqlite3.1 fc7ad8990fc8409983309bb80de8c811a7506786
|
||||
F sqlite3.pc.in 48fed132e7cb71ab676105d2a4dc77127d8c1f3a
|
||||
F src/alter.c 7603afbd61f55e7c644b8de4a42f33e58c0b7eaa
|
||||
F src/alter.c 1bb0709b3048e24217b80ec6bd78a3e99a47c01b
|
||||
F src/analyze.c ab57b6763dd4c6170a20673d14882c033affd188
|
||||
F src/attach.c a3724c64de1099d85e30751213d285752aed9505
|
||||
F src/auth.c b56c78ebe40a2110fd361379f7e8162d23f92240
|
||||
@ -315,33 +315,33 @@ F src/btmutex.c bc87dd3b062cc26edfe79918de2200ccb8d41e73
|
||||
F src/btree.c 7bb920c473c277380fcb3e8a8ee28ce1a48e0abc
|
||||
F src/btree.h a5008b9afe56e8e54ade6c436a910f112defcca9
|
||||
F src/btreeInt.h c18b7d2a3494695133e4e60ee36061d37f45d9a5
|
||||
F src/build.c 6661513c8f90a23d44ed5e5ada7ea40fac6b6b77
|
||||
F src/build.c 43b93fe757bfffe00f97462596418b052eefdccd
|
||||
F src/callback.c 2e76147783386374bf01b227f752c81ec872d730
|
||||
F src/complete.c a3634ab1e687055cd002e11b8f43eb75c17da23e
|
||||
F src/ctime.c 60e135af364d777a9ab41c97e5e89cd224da6198
|
||||
F src/date.c 0b73e681c11fca867fec554750c07fe0d4e417c1
|
||||
F src/dbstat.c c845548d4346e606e2f2b7d2e714ace2b8a7dd1b
|
||||
F src/delete.c eeac28b3d3d88e3541bdf93e91ea7492a7b67842
|
||||
F src/expr.c 9adb58153f6e943b703d43e9a1f67f77b5a75721
|
||||
F src/expr.c c4dad2cd6cec00387b75fef4551aff655430dcd2
|
||||
F src/fault.c 160a0c015b6c2629d3899ed2daf63d75754a32bb
|
||||
F src/fkey.c a842533c411b9aef63a2814bbdc24f8a21e14cd8
|
||||
F src/fkey.c 5da47ff524e2f687997a74737ce598f043e1342a
|
||||
F src/func.c 552d300265aed09eea21f68ac742a440550c0062
|
||||
F src/global.c ded7b97efd16efda5062b65e857198e46c40e652
|
||||
F src/hash.c 4263fbc955f26c2e8cdc0cf214bc42435aa4e4f5
|
||||
F src/hash.h c8f3c31722cf3277d03713909761e152a5b81094
|
||||
F src/hwtime.h d32741c8f4df852c7d959236615444e2b1063b08
|
||||
F src/insert.c d53917351d0542ce2be88888dca6b0b076e46aaa
|
||||
F src/journal.c fe3a3e2559ce3ce9d371afd30fbabbc074174575
|
||||
F src/insert.c 8f4e9fcbd8e95e85f15647ba8b413b18d556ec2b
|
||||
F src/journal.c 673cbdde5676eb0c55848f561575d45b609c820d
|
||||
F src/legacy.c 75d3023be8f0d2b99d60f905090341a03358c58e
|
||||
F src/loadext.c 9e2a41adcaff16ebc1ebff1f336cbf33de55396f
|
||||
F src/main.c 254cb296471997935fade3aeefb4618941a330ea
|
||||
F src/main.c 56edbba4bd69e5f650bd75ae45f1a7d081e1e892
|
||||
F src/malloc.c 1443d1ad95d67c21d77af7ae3f44678252f0efec
|
||||
F src/mem0.c 6a55ebe57c46ca1a7d98da93aaa07f99f1059645
|
||||
F src/mem1.c 6919bcf12f221868ea066eec27e579fed95ce98b
|
||||
F src/mem2.c f1940d9e91948dd6a908fbb9ce3835c36b5d83c3
|
||||
F src/mem3.c 8768ac94694f31ffaf8b4d0ea5dc08af7010a35a
|
||||
F src/mem5.c 9bf955937b07f8c32541c8a9991f33ce3173d944
|
||||
F src/memjournal.c 349a04fb803db40532cde0993e39758f1acaecce
|
||||
F src/memjournal.c 56c7688565cf407c5f22f03e3be478d3a92bdc81
|
||||
F src/msvc.h d9ba56c6851227ab44b3f228a35f3f5772296495
|
||||
F src/mutex.c 8e45800ee78e0cd1f1f3fe8e398853307f4a085c
|
||||
F src/mutex.h 779d588e3b7756ec3ecf7d78cde1d84aba414f85
|
||||
@ -349,37 +349,37 @@ F src/mutex_noop.c 9d4309c075ba9cc7249e19412d3d62f7f94839c4
|
||||
F src/mutex_unix.c 27bb6cc49485ee46711a6580ab7b3f1402211d23
|
||||
F src/mutex_w32.c 5e6fe1c298fb5a8a15aaed4161d5759311431c17
|
||||
F src/notify.c 9711a7575036f0d3040ba61bc6e217f13a9888e7
|
||||
F src/os.c ca9a104b677328ee037cfdf1a54a16fd1805e8c9
|
||||
F src/os.c f89e3ca1c2e3d5015b847aec60371c474acbac82
|
||||
F src/os.h 3e57a24e2794a94d3cf2342c6d9a884888cd96bf
|
||||
F src/os_common.h b2f4707a603e36811d9b1a13278bffd757857b85
|
||||
F src/os_setup.h c9d4553b5aaa6f73391448b265b89bed0b890faa
|
||||
F src/os_unix.c 3a6f20736dfb8a0949cdd66553fdf59f6604be35
|
||||
F src/os_unix.c f5bac8e74aaefc4ea520e43b4540793c3b8a9e8f
|
||||
F src/os_win.c f0d7aa603eb6262143d7169a222aea07c4fca91d
|
||||
F src/os_win.h eb7a47aa17b26b77eb97e4823f20a00b8bda12ca
|
||||
F src/pager.c d034c69b958c01289eb8070cbf902e1a68cd7e0b
|
||||
F src/pager.c 2bc43817697b5a4e88fd6a2cdb2cb25f2223505c
|
||||
F src/pager.h e1d38a2f14849e219df0f91f8323504d134c8a56
|
||||
F src/parse.y c3ce2c4a7cbf0b699239be6b2a945c5cb51875e2
|
||||
F src/parse.y 5ea8c81c5c41b27887f41b4a7e1c58470d7d3821
|
||||
F src/pcache.c 647bb53a86b7bbcf55ad88089b3ea5a9170b90df
|
||||
F src/pcache.h 4d0ccaad264d360981ec5e6a2b596d6e85242545
|
||||
F src/pcache1.c 72f644dc9e1468c72922eff5904048427b817051
|
||||
F src/pragma.c 80ee77226d0008d9188356a6cbbe6010866e1bee
|
||||
F src/pragma.c 42b3f1475b483710ba1dd1cc1ecc0c0f8db59a2e
|
||||
F src/pragma.h 64c78a648751b9f4f297276c4eb7507b14b4628c
|
||||
F src/prepare.c 22df6171aec1d86904ed2ad30c2348a5748aa04e
|
||||
F src/printf.c 63e6fb12bbe702dd664dc3703776c090383a5a26
|
||||
F src/random.c ba2679f80ec82c4190062d756f22d0c358180696
|
||||
F src/resolve.c b8f7174e5f8c33c44ded3a25a973d0bb89228c20
|
||||
F src/rowset.c 9fe4b3ad7cc00944386bb600233d8f523de07a6e
|
||||
F src/select.c dbc73a63bee99bf7cfac6052477ffc21e899bb08
|
||||
F src/shell.c 529ff15fbafe9f698e0cb8f9f16d0ce5106fd6e9
|
||||
F src/sqlite.h.in ba31c7deaa59bc9a282239d9e39d918c6a2b346d
|
||||
F src/select.c 137b31daa84d57d67847bf621bb54f3353e2077b
|
||||
F src/shell.c cd3f82fdc5c895b817a375b7ab8319cb41f447ce
|
||||
F src/sqlite.h.in a51577ed847b75fff9c10b7ea35e37e8154cee71
|
||||
F src/sqlite3.rc 5121c9e10c3964d5755191c80dd1180c122fc3a8
|
||||
F src/sqlite3ext.h dfbe62ffd95b99afe2140d8c35b180d11924072d
|
||||
F src/sqliteInt.h 73f110a751b8e24e2e0c6020d761c16ad23acaff
|
||||
F src/sqliteLimit.h 216557999cb45f2e3578ed53ebefe228d779cb46
|
||||
F src/sqliteInt.h b0e28df3739ef7113eb1297db0766abf74635c90
|
||||
F src/sqliteLimit.h 7b28cf72cbd52f178bfc97ea266445e351f2cd24
|
||||
F src/status.c 70912d7be68e9e2dbc4010c93d344af61d4c59ba
|
||||
F src/table.c 5226df15ab9179b9ed558d89575ea0ce37b03fc9
|
||||
F src/tclsqlite.c 89b27573473e94257d9a2d296bc6c0626c9314d0
|
||||
F src/test1.c 8b17b1ff53aad71e7f9318a2fda247beddeaa601
|
||||
F src/tclsqlite.c 23a5c328898b86177b21718834d2b7b4f7bc083c
|
||||
F src/test1.c f14a6f9e2cff6cba4d83e2b0c52857f61886cead
|
||||
F src/test2.c 5586f43fcd9a1be0830793cf9d354082c261b25b
|
||||
F src/test3.c a8887dabbbee3059af338f20d290084a63ed1b0f
|
||||
F src/test4.c d168f83cc78d02e8d35567bb5630e40dcd85ac1e
|
||||
@ -391,9 +391,10 @@ F src/test9.c bea1e8cf52aa93695487badedd6e1886c321ea60
|
||||
F src/test_async.c 21e11293a2f72080eda70e1124e9102044531cd8
|
||||
F src/test_autoext.c dea8a01a7153b9adc97bd26161e4226329546e12
|
||||
F src/test_backup.c 2e6e6a081870150f20c526a2e9d0d29cda47d803
|
||||
F src/test_bestindex.c cd36324f05404df5f1a82608a321b91932a549ea
|
||||
F src/test_blob.c b2551a9b5573232db5f66f292307c37067937239
|
||||
F src/test_btree.c 2e9978eca99a9a4bfa8cae949efb00886860a64f
|
||||
F src/test_config.c 1e51263265c5b78adca10fa204d1e6f164387a20
|
||||
F src/test_config.c a0e8eeb86a7d9393f3bbf7315932c1cccd0e8010
|
||||
F src/test_demovfs.c 0de72c2c89551629f58486fde5734b7d90758852
|
||||
F src/test_devsym.c e7498904e72ba7491d142d5c83b476c4e76993bc
|
||||
F src/test_fs.c f10f840ca4f8c72e4837908bd8347ac4bcab074b
|
||||
@ -428,29 +429,29 @@ F src/test_windirent.h b12055cab6227f7be10f5c19296f67c60cc5e2a5
|
||||
F src/test_wsd.c 41cadfd9d97fe8e3e4e44f61a4a8ccd6f7ca8fe9
|
||||
F src/threads.c 4ae07fa022a3dc7c5beb373cf744a85d3c5c6c3c
|
||||
F src/tokenize.c 3d338cdd00d916ce8a05c397001d64ed58e6fe1c
|
||||
F src/treeview.c c525282442111b3f61eb176784567cd6654db5dc
|
||||
F src/treeview.c e4b41a37530a191579d3c53142cc44ee2eb99373
|
||||
F src/trigger.c e14840ee0c3e549e758ec9bf3e4146e166002280
|
||||
F src/update.c c0016d277a418360456ff6af29363effbd4272f7
|
||||
F src/utf.c 699001c79f28e48e9bcdf8a463da029ea660540c
|
||||
F src/util.c 38c06684c922694809ccb988a13562c16890a3d5
|
||||
F src/util.c a64585a74aef6feb16dfe4e090b5de01e26eba3b
|
||||
F src/vacuum.c feb1eabb20987983d9350cad98299b21fa811f52
|
||||
F src/vdbe.c 9ccb138cb7ac6c1bcda23dfaf52eff1f7761dfe5
|
||||
F src/vdbe.h 594aef1a7dcfc2944e2f266f148140c3427fd0f0
|
||||
F src/vdbeInt.h 177eca5abb111140d06a149d8c3ae40f9f2eb4fc
|
||||
F src/vdbeInt.h a205ce1ece3ab90be78a374e93cb5402fccdf865
|
||||
F src/vdbeapi.c ba85b78fe08dc4a9ce747e62c89a2b4a4547e74c
|
||||
F src/vdbeaux.c 325dcf1b944e6d339a5c5210b7b8c5724a8496fb
|
||||
F src/vdbeblob.c c9f2f494b911c6fa34efd9803f0a10807da80f77
|
||||
F src/vdbemem.c c2a7c2ece87b40f1e1345c07412f2143c05eee85
|
||||
F src/vdbemem.c 0bcc4af472ebd36e57603d733a6501573a82b526
|
||||
F src/vdbesort.c 307460bfa4de4d1c3901fcd42089159131e34062
|
||||
F src/vdbetrace.c f75c5455d8cf389ef86a8bfdfd3177e0e3692484
|
||||
F src/vtab.c 943c23b355f0a8f859f9583e7315d64bebdb0899
|
||||
F src/vtab.c fd69fd398e23e57ea4ea377d8a44b6998fc569c7
|
||||
F src/vxworks.h d2988f4e5a61a4dfe82c6524dd3d6e4f2ce3cdb9
|
||||
F src/wal.c 10deb6b43887662691e5f53d10b3c171c401169b
|
||||
F src/wal.h 2f7c831cf3b071fa548bf2d5cac640846a7ff19c
|
||||
F src/walker.c 0f142b5bd3ed2041fc52d773880748b212e63354
|
||||
F src/where.c b21a2b3cee42e1db4f14c8fc5124f607e0c668c0
|
||||
F src/where.c 56948ada5aacc3bf2628db3776986e8bf4085383
|
||||
F src/whereInt.h 93297d56edd137b7ea004490690fb6e2ce028a34
|
||||
F src/wherecode.c 39c1ef4598bedf1d66249334c74efd23ddd182ac
|
||||
F src/wherecode.c 3ca820435c5b597bb50e63ed11e938786fe5c23e
|
||||
F src/whereexpr.c fb87944b1254234e5bba671aaf6dee476241506a
|
||||
F test/8_3_names.test ebbb5cd36741350040fd28b432ceadf495be25b2
|
||||
F test/affinity2.test a6d901b436328bd67a79b41bb0ac2663918fe3bd
|
||||
@ -471,11 +472,11 @@ F test/analyze5.test 765c4e284aa69ca172772aa940946f55629bc8c4
|
||||
F test/analyze6.test f1c552ce39cca4ec922a7e4e0e5d0203d6b3281f
|
||||
F test/analyze7.test bb1409afc9e8629e414387ef048b8e0e3e0bdc4f
|
||||
F test/analyze8.test c05a461d0a6b05991106467d0c47480f2e709c82
|
||||
F test/analyze9.test 88c1f2aa20b614236f03e1cc38c3619e7e8a38b4
|
||||
F test/analyze9.test b817b8e798315fc65b820a5463f73ad5f48ed8dd
|
||||
F test/analyzeA.test 3335697f6700c7052295cfd0067fc5b2aacddf9a
|
||||
F test/analyzeB.test a4c1c3048f6d9e090eb76e83eecb18bcf6d31a70
|
||||
F test/analyzeC.test 555a6cc388b9818b6eda6df816f01ce0a75d3a93
|
||||
F test/analyzeD.test f3d77cd0fefe2849d784897d52df13beee19271d
|
||||
F test/analyzeD.test 42af58de25a6436502e43006e9e59e2d71bcb0cf
|
||||
F test/analyzeE.test 8684e8ac5722fb97c251887ad97e5d496a98af1d
|
||||
F test/analyzeF.test 5d1fe1024ba2dfea3c18bede8c1ccef8aba1ab34
|
||||
F test/analyzer1.test 498e2ff4b62740c2751c3a2f8b744fe26689fae9
|
||||
@ -512,6 +513,7 @@ F test/backup_malloc.test 7162d604ec2b4683c4b3799a48657fb8b5e2d450
|
||||
F test/badutf.test d5360fc31f643d37a973ab0d8b4fb85799c3169f
|
||||
F test/badutf2.test f5bc7f2d280670ecd79b9cf4f0f1760c607fe51f
|
||||
F test/bc_common.tcl 3eda41ef9cda7d5f6c205462c96228b301da4191
|
||||
F test/bestindex1.test e228fe1e3794dbe20271481164e000d695abcd24
|
||||
F test/between.test 34d375fb5ce1ae283ffe82b6b233e9f38e84fc6c
|
||||
F test/bigfile.test aa74f4e5db51c8e54a1d9de9fa65d01d1eb20b59
|
||||
F test/bigfile2.test 1b489a3a39ae90c7f027b79110d6b4e1dbc71bfc
|
||||
@ -559,8 +561,8 @@ F test/collate9.test 3adcc799229545940df2f25308dd1ad65869145a
|
||||
F test/collateA.test b8218ab90d1fa5c59dcf156efabb1b2599c580d6
|
||||
F test/colmeta.test 2c765ea61ee37bc43bbe6d6047f89004e6508eb1
|
||||
F test/colname.test 08948a4809d22817e0e5de89c7c0a8bd90cb551b
|
||||
F test/conflict.test 841bcf7cabbfca39c577eb8411ea8601843b46a8
|
||||
F test/conflict2.test a82dd3b9b41fceb5dd6ff0707c5c7ffba208d538
|
||||
F test/conflict.test 029faa2d81a0d1cafb5f88614beb663d972c01db
|
||||
F test/conflict2.test bb0b94cf7196c64a3cbd815c66d3ee98c2fecd9c
|
||||
F test/conflict3.test dec0634c0f31dec9a4b01c63063e939f0cd21b6b
|
||||
F test/contrib01.test 2a1cbc0f2f48955d7d073f725765da6fbceda6b4
|
||||
F test/corrupt.test 141c39ea650c1365e85a49e402fa05cb9617fb97
|
||||
@ -637,7 +639,7 @@ F test/e_vacuum.test 5bfbdc21b65c0abf24398d0ba31dc88d93ca77a9
|
||||
F test/e_wal.test ae9a593207a77d711443ee69ffe081fda9243625
|
||||
F test/e_walauto.test 280714ddf14e1a47dcbc59d515cd0b026dfd5567
|
||||
F test/e_walckpt.test 28c371a6bb5e5fe7f31679c1df1763a19d19e8a0
|
||||
F test/e_walhook.test da3ea8b3483d1af72190337bda50155a91a4b664
|
||||
F test/e_walhook.test 4c0613a0c76e7a9d5c4c211e1b4cbcc1143914df
|
||||
F test/enc.test e54531cd6bf941ee6760be041dff19a104c7acea
|
||||
F test/enc2.test 83437a79ba1545a55fb549309175c683fb334473
|
||||
F test/enc3.test 6807f7a7740a00361ca8d0ccd66bc60c8dc5f2b6
|
||||
@ -645,7 +647,7 @@ F test/enc4.test c8f1ce3618508fd0909945beb8b8831feef2c020
|
||||
F test/eqp.test 85873fa5816c48915c82c4e74cb5c35a5b48160f
|
||||
F test/errmsg.test f31592a594b44ee121371d25ddd5d63497bb3401
|
||||
F test/eval.test a64c9105d6ff163df7cf09d6ac29cdad5922078c
|
||||
F test/exclusive.test c7ebbc756eacf544c108b15eed64d7d4e5f86b75
|
||||
F test/exclusive.test f48243eaf40e0957215501a12f510a8644d13a02
|
||||
F test/exclusive2.test 32798111aae78a5deec980eee383213f189df308
|
||||
F test/exec.test e949714dc127eaa5ecc7d723efec1ec27118fdd7
|
||||
F test/exists.test 8f7b27b61c2fbe5822f0a1f899c715d14e416e30
|
||||
@ -718,7 +720,7 @@ F test/fts3al.test 07d64326e79bbdbab20ee87fc3328fbf01641c9f
|
||||
F test/fts3am.test 218aa6ba0dfc50c7c16b2022aac5c6be593d08d8
|
||||
F test/fts3an.test a49ccadc07a2f7d646ec1b81bc09da2d85a85b18
|
||||
F test/fts3ao.test 3e4e3d5e75c076520341d0bdf4eb17c00e8cbde2
|
||||
F test/fts3atoken.test 76262be798f23a390717d14266f0df551e52a7ee
|
||||
F test/fts3atoken.test 4b4c16fdcfc972f2cdbba212375a060a86ccf5f1
|
||||
F test/fts3auto.test b981fea19b132b4e6878f50d7c1f369b28f68eb9
|
||||
F test/fts3aux1.test f8f287a4a73f381f8fa15b6a70f36245f903d221
|
||||
F test/fts3aux2.test 7ae2b2c13aefdf4169279a27a5f51780ce57f6ba
|
||||
@ -765,7 +767,7 @@ F test/fts4docid.test e33c383cfbdff0284685604d256f347a18fdbf01
|
||||
F test/fts4growth.test 60d6bb3f78e25b34f533797dd9f2f9402310a13a
|
||||
F test/fts4growth2.test 13ad4e76451af6e6906c95cdc725d01b00044269
|
||||
F test/fts4incr.test 4e353a0bd886ea984e56fce9e77724fc923b8d0d
|
||||
F test/fts4langid.test 8bd8759e0d4b04d71771544b861193a6841fee84
|
||||
F test/fts4langid.test 9794addcc8faaee85ac60eceecdb52feb0c70f68
|
||||
F test/fts4merge.test c424309743fdd203f8e56a1f1cd7872cd66cc0ee
|
||||
F test/fts4merge2.test 5faa558d1b672f82b847d2a337465fa745e46891
|
||||
F test/fts4merge3.test aab02a09f50fe6baaddc2e159c3eabc116d45fc7
|
||||
@ -797,7 +799,7 @@ F test/genesis.tcl 1e2e2e8e5cc4058549a154ff1892fe5c9de19f98
|
||||
F test/hexlit.test d7b0a5f41123df1e43985b91b8b2e70f95282d21
|
||||
F test/hidden.test 23c1393a79e846d68fd902d72c85d5e5dcf98711
|
||||
F test/hook.test 40523db3aa76d62bda71c26f824fa0eabc420f0e
|
||||
F test/icu.test 70df4faca133254c042d02ae342c0a141f2663f4
|
||||
F test/icu.test 73956798bace8982909c00476b216714a6d0559a
|
||||
F test/ieee754.test 806fc0ce7f305f57e3331eaceeddcfec9339e607
|
||||
F test/imposter1.test c3f1db2d3db2c24611a6596a3fc0ffc14f1466c8
|
||||
F test/in.test 61a24ae38d4b64ec69f06ccdf022992f68a98176
|
||||
@ -917,7 +919,7 @@ F test/misc4.test 0d8be3466adf123a7791a66ba2bc8e8d229e87f3
|
||||
F test/misc5.test f96428ea95b3820aafc6f1c50cf48a09e4597ee1
|
||||
F test/misc6.test 953cc693924d88e6117aeba16f46f0bf5abede91
|
||||
F test/misc7.test edd0b63e2ee29a256900b0514f6fff27e19e9bb2
|
||||
F test/misc8.test fc2754d38892f7dac30c22db3616c2764f117d66
|
||||
F test/misc8.test 21ac9d35a5e110279ae9e1588b8914f54de1c60b
|
||||
F test/misuse.test 3c34719944ba045cc6c188a4852ba04680728912
|
||||
F test/mmap1.test 44a5ff1c1bcc7dcf2de50227d1f997e75a8ef1ae
|
||||
F test/mmap2.test 9d6dd9ddb4ad2379f29cc78f38ce1e63ed418022
|
||||
@ -965,7 +967,7 @@ F test/parser1.test 222b5cbf3e2e659fec1bf7d723488c8b9c94f1d0
|
||||
F test/pcache.test c8acbedd3b6fd0f9a7ca887a83b11d24a007972b
|
||||
F test/pcache2.test af7f3deb1a819f77a6d0d81534e97d1cf62cd442
|
||||
F test/percentile.test 4243af26b8f3f4555abe166f723715a1f74c77ff
|
||||
F test/permutations.test 74a48d89ce0d9ca8ad45a8f9f4bf66fa8bee0e34
|
||||
F test/permutations.test 1281140205caa8c2a957aa099a25a36fd3ab2f44
|
||||
F test/pragma.test 507ac7ef2ea5682241ea0ef041799ca70bb5e0bf
|
||||
F test/pragma2.test e5d5c176360c321344249354c0c16aec46214c9f
|
||||
F test/pragma3.test 6f849ccffeee7e496d2f2b5e74152306c0b8757c
|
||||
@ -986,7 +988,7 @@ F test/rdonly.test 64e2696c322e3538df0b1ed624e21f9a23ed9ff8
|
||||
F test/regexp1.test 497ea812f264d12b6198d6e50a76be4a1973a9d8
|
||||
F test/regexp2.test aa7ffcc21350007a78361b82bcf3b74d12227144
|
||||
F test/reindex.test 44edd3966b474468b823d481eafef0c305022254
|
||||
F test/releasetest.tcl 975449bf742b8bb9025208292208af816a1fcb58
|
||||
F test/releasetest.tcl a246ecb14ed594bf44bf77bd21df873971d779bf
|
||||
F test/resolver01.test f4022acafda7f4d40eca94dbf16bc5fc4ac30ceb
|
||||
F test/rollback.test 458fe73eb3ffdfdf9f6ba3e9b7350a6220414dea
|
||||
F test/rollback2.test 8435d6ff0f13f51d2a4181c232e706005fa90fc5
|
||||
@ -1041,10 +1043,10 @@ F test/sharedA.test 0cdf1a76dfa00e6beee66af5b534b1e8df2720f5
|
||||
F test/sharedB.test 16cc7178e20965d75278f410943109b77b2e645e
|
||||
F test/shared_err.test 2f2aee20db294b9924e81f6ccbe60f19e21e8506
|
||||
F test/sharedlock.test 5ede3c37439067c43b0198f580fd374ebf15d304
|
||||
F test/shell1.test ce5e744870387164703bf2dee2cc9753e4a71513
|
||||
F test/shell1.test a45b424ec23a4b946848ff9e1af5186c677162ab
|
||||
F test/shell2.test 12b8bf901b0e3a8ac58cf5c0c63a0a388d4d1862
|
||||
F test/shell3.test 5e8545ec72c4413a0e8d4c6be56496e3c257ca29
|
||||
F test/shell4.test ddf0a99044e2245a87fc17423e3aaa1445b3243b
|
||||
F test/shell4.test f43e250139dc5dc5f0f2ec1752c50284a1ede102
|
||||
F test/shell5.test c04e9f9f948305706b88377c464c7f08ce7479f9
|
||||
F test/shortread1.test bb591ef20f0fd9ed26d0d12e80eee6d7ac8897a3
|
||||
F test/show_speedtest1_rtree.tcl 32e6c5f073d7426148a6936a0408f4b5b169aba5
|
||||
@ -1055,7 +1057,7 @@ F test/skipscan2.test d1d1450952b7275f0b0a3a981f0230532743951a
|
||||
F test/skipscan3.test ec5bab3f81c7038b43450e7b3062e04a198bdbb5
|
||||
F test/skipscan5.test 67817a4b6857c47e0e33ba3e506da6f23ef68de2
|
||||
F test/skipscan6.test 5866039d03a56f5bd0b3d172a012074a1d90a15b
|
||||
F test/snapshot.test 5ec4651d16c3d1eb6c010d102febe32b3614bf56
|
||||
F test/snapshot.test c03eb5ba1602df33c1edc1d12393d6ca7a282a46
|
||||
F test/snapshot_fault.test 25973aeb1b86a280800e0bcf1eb5ce70e9ef57ab
|
||||
F test/soak.test 0b5b6375c9f4110c828070b826b3b4b0bb65cd5f
|
||||
F test/softheap1.test 843cd84db9891b2d01b9ab64cef3e9020f98d087
|
||||
@ -1073,7 +1075,7 @@ F test/speed3.test d32043614c08c53eafdc80f33191d5bd9b920523
|
||||
F test/speed4.test abc0ad3399dcf9703abed2fff8705e4f8e416715
|
||||
F test/speed4p.explain 6b5f104ebeb34a038b2f714150f51d01143e59aa
|
||||
F test/speed4p.test 0e51908951677de5a969b723e03a27a1c45db38b
|
||||
F test/speedtest1.c 947421c324f5cd4cb3dcae1ec214e4be763df718
|
||||
F test/speedtest1.c 1478cb3fb64ad30f291ddca87ca9dbd72ff552aa
|
||||
F test/spellfix.test f9c1f431e2c096c8775fec032952320c0e4700db
|
||||
F test/spellfix2.test dfc8f519a3fc204cb2dfa8b4f29821ae90f6f8c3
|
||||
F test/spellfix3.test f7bf7b3482971473d32b6b00f6944c5c066cff97
|
||||
@ -1082,7 +1084,7 @@ F test/sqllimits1.test a74ee2a3740b9f9c2437c246d8fb77354862a142
|
||||
F test/sqllog.test 6af6cb0b09f4e44e1917e06ce85be7670302517a
|
||||
F test/stat.test acc91e80517fff447ae8adcfd953cfdaa5efc0af
|
||||
F test/statfault.test f525a7bf633e50afd027700e9a486090684b1ac1
|
||||
F test/stmt.test 25d64e3dbf9a3ce89558667d7f39d966fe2a71b9
|
||||
F test/stmt.test 64844332db69cf1a735fcb3e11548557fc95392f
|
||||
F test/subquery.test d7268d193dd33d5505df965399d3a594e76ae13f
|
||||
F test/subquery2.test 438f8a7da1457277b22e4176510f7659b286995f
|
||||
F test/subselect.test d24fd8757daf97dafd2e889c73ea4c4272dcf4e4
|
||||
@ -1093,12 +1095,12 @@ F test/symlink.test c9ebe7330d228249e447038276bfc8a7b22f4849
|
||||
F test/sync.test 2f607e1821aa3af3c5c53b58835c05e511c95899
|
||||
F test/syscall.test f59ba4e25f7ba4a4c031026cc2ef8b6e4b4c639c
|
||||
F test/sysfault.test c9f2b0d8d677558f74de750c75e12a5454719d04
|
||||
F test/tabfunc01.test cc33684f9480fcf1fd5ce287ac28d22971cad1cc
|
||||
F test/tabfunc01.test f977868fa8bb7beb4b2072883190411653473906
|
||||
F test/table.test b708f3e5fa2542fa51dfab21fc07b36ea445cb2f
|
||||
F test/tableapi.test 2674633fa95d80da917571ebdd759a14d9819126
|
||||
F test/tableopts.test dba698ba97251017b7c80d738c198d39ab747930
|
||||
F test/tclsqlite.test 7179b4e0bf236ddf0bfa6bfaefa76fbe0a23c28a
|
||||
F test/tempdb.test 19d0f66e2e3eeffd68661a11c83ba5e6ace9128c
|
||||
F test/tempdb.test bd92eba8f20e16a9136e434e20b280794de3cdb6
|
||||
F test/temptable.test d2c9b87a54147161bcd1822e30c1d1cd891e5b30
|
||||
F test/temptrigger.test 8ec228b0db5d7ebc4ee9b458fc28cb9e7873f5e1
|
||||
F test/tester.tcl 9310df7ac540d4e97d8fa4a9605a639801ede65f
|
||||
@ -1348,7 +1350,7 @@ F test/walro.test 34422d1d95aaff0388f0791ec20edb34e2a3ed57
|
||||
F test/walshared.test 0befc811dcf0b287efae21612304d15576e35417
|
||||
F test/walslow.test c05c68d4dc2700a982f89133ce103a1a84cc285f
|
||||
F test/walthread.test de8dbaf6d9e41481c460ba31ca61e163d7348f8e
|
||||
F test/where.test 9902a3d84e9bc80357a2c54ed0e76c0d6d04a867
|
||||
F test/where.test f0c325563acde44f2c4ea6ba348e9e29f7121757
|
||||
F test/where2.test af78c55589cbc82d793449493adba0dc3d659f23
|
||||
F test/where3.test 1ad55ba900bd7747f98b6082e65bd3e442c5004e
|
||||
F test/where4.test 4a371bfcc607f41d233701bdec33ac2972908ba8
|
||||
@ -1389,7 +1391,8 @@ F test/zeroblob.test 3857870fe681b8185654414a9bccfde80b62a0fa
|
||||
F test/zerodamage.test cf6748bad89553cc1632be51a6f54e487e4039ac
|
||||
F tool/GetFile.cs a15e08acb5dd7539b75ba23501581d7c2b462cb5
|
||||
F tool/GetTclKit.bat 629d87562e0487c386db630033931d12d62e6372
|
||||
F tool/addopcodes.tcl 4ca9c3ef196f08da30add5d07ce0c9458dc8c633
|
||||
F tool/Replace.cs 02c67258801c2fb5f63231e0ac0f220b4b36ba91
|
||||
F tool/addopcodes.tcl 2b089684eb8b7d0db64cf9d8e6d2fe1b6d279e8d
|
||||
F tool/build-all-msvc.bat 55be1cf8545dabd69df2ba6b3de6868da0c26f52 x
|
||||
F tool/build-shell.sh 950f47c6174f1eea171319438b93ba67ff5bf367
|
||||
F tool/cg_anno.tcl 692ce4b8693d59e3a3de77ca97f4139ecfa641b0 x
|
||||
@ -1405,9 +1408,9 @@ F tool/lemon.c 251f5c3f21b553240cbdd42dd187a51bb2372cd3
|
||||
F tool/lempar.c d5114c7d13aa3af1e27ff3d02e4dea6eadec7ddf
|
||||
F tool/loadfts.c c3c64e4d5e90e8ba41159232c2189dba4be7b862
|
||||
F tool/logest.c eef612f8adf4d0993dafed0416064cf50d5d33c6
|
||||
F tool/mkautoconfamal.sh c78caa3214f25dc28ea157b5a82abb311f209906
|
||||
F tool/mkautoconfamal.sh e855df211ecbcc7131dee817110ff386cfb112f7
|
||||
F tool/mkkeywordhash.c f7f3b342211ac6a14258b9726d5b97cf4f548f22
|
||||
F tool/mkmsvcmin.tcl f9fc6f6a373084c0e0feef972485212bd0869c06
|
||||
F tool/mkmsvcmin.tcl 2f12f7fa8858bbe61cf81820a2da96c79ed1ca8d
|
||||
F tool/mkopcodec.tcl d1b6362bd3aa80d5520d4d6f3765badf01f6c43c
|
||||
F tool/mkopcodeh.tcl 385c62d78c38b2d92146dcb5abd319dbbc33506d
|
||||
F tool/mkopts.tcl 66ac10d240cc6e86abd37dc908d50382f84ff46e
|
||||
@ -1439,7 +1442,7 @@ F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
|
||||
F tool/speedtest8inst1.c 7ce07da76b5e745783e703a834417d725b7d45fd
|
||||
F tool/split-sqlite3c.tcl d9be87f1c340285a3e081eb19b4a247981ed290c
|
||||
F tool/sqldiff.c 5a26205111e6fa856d9b1535b1637744dcdb930b
|
||||
F tool/srcck1.c 4c39bdfa9a92edd20233ee720df84dbeb2417602
|
||||
F tool/srcck1.c 4f65e1a6748e42f24c0ea629dddc934d821c729a
|
||||
F tool/stack_usage.tcl f8e71b92cdb099a147dad572375595eae55eca43
|
||||
F tool/symbols-mingw.sh 4dbcea7e74768305384c9fd2ed2b41bbf9f0414d
|
||||
F tool/symbols.sh c5a617b8c61a0926747a56c65f5671ef8ac0e148
|
||||
@ -1450,7 +1453,28 @@ F tool/vdbe_profile.tcl 246d0da094856d72d2c12efec03250d71639d19f
|
||||
F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
|
||||
F tool/warnings.sh a98af506df552f3b3c0d904f94e4cdc4e1a6d598
|
||||
F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
|
||||
P b86590043e17705ada90562cf30f69b3e3ef65a4 82470d1c3a41221c78bcdd402b2219c4c21c43af
|
||||
R ed4175ea9b6a35a3a633e24a66e7650f
|
||||
U dan
|
||||
Z 25048b6cbead70238ee6379efe484cce
|
||||
F vsixtest/App.xaml b76d3b48860e7454775c47ea38ffea9c4abe3e85
|
||||
F vsixtest/App.xaml.cpp c465147f50871165c60ca16955219f6c5812d6d8
|
||||
F vsixtest/App.xaml.h 4a9768e2983d05600ad1e1c2f1b00a132967da9f
|
||||
F vsixtest/Assets/LockScreenLogo.scale-200.png e820c9a3deb909197081b0bf3216c06e13905f0a
|
||||
F vsixtest/Assets/SplashScreen.scale-200.png cab70988ca71bebec7bfeb3b6dbafe17b9ab0b4a
|
||||
F vsixtest/Assets/Square150x150Logo.scale-200.png e17b40817db7a239fc239d83efcc951fb824e3ff
|
||||
F vsixtest/Assets/Square44x44Logo.scale-200.png 2f166237094dea94d952d10b9eeae81806844f1c
|
||||
F vsixtest/Assets/Square44x44Logo.targetsize-24_altform-unplated.png 5f6a6d391b95a3061ccca6e6fdd6955ede63b4ed
|
||||
F vsixtest/Assets/StoreLogo.png 0828b7257db74a4ecd5eeb6b7b4971f0fdc4d9d1
|
||||
F vsixtest/Assets/Wide310x150Logo.scale-200.png 04ddefe5bc5f43ae12a7433f6f236ddab101ac42
|
||||
F vsixtest/MainPage.xaml 34f49897e3ca533a7e74506ba0759b66eebce151
|
||||
F vsixtest/MainPage.xaml.cpp 7f31fc6de751b64676c0924c97a5485d950a91d7
|
||||
F vsixtest/MainPage.xaml.h cc05cca10d50a003f6c6e4448b701cdd07f52f29
|
||||
F vsixtest/Package.appxmanifest 6b6db1eb7df3a315c5d681059754d5f0e0c47a93
|
||||
F vsixtest/pch.cpp cb823cfac36f1a39a7eb0acbd7e9a0b0de8f23af
|
||||
F vsixtest/pch.h 9cab7980f2ac4baa40807d8b5e52af32a21cf78c
|
||||
F vsixtest/vsixtest.sln 77cadbe4e96c1fe1bf51cd77de9e9b0a12ada547
|
||||
F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
|
||||
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
|
||||
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
|
||||
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
|
||||
P 8fea1166016c659ece83e0045bc348f478a9ba6a cb9302cca423de41305719a49208daa392ec09da
|
||||
R dd40074d0cb69f94c136cb2921dcb114
|
||||
U drh
|
||||
Z 1bfaeec3e683dbb2e879f4e9437ca024
|
||||
|
@ -1 +1 @@
|
||||
8fea1166016c659ece83e0045bc348f478a9ba6a
|
||||
456df3365e2df60e34762f2024bb551538b3f72b
|
@ -628,7 +628,8 @@ void sqlite3AlterFinishAddColumn(Parse *pParse, Token *pColDef){
|
||||
** literal NULL, then set pDflt to 0. This simplifies checking
|
||||
** for an SQL NULL default below.
|
||||
*/
|
||||
if( pDflt && pDflt->op==TK_NULL ){
|
||||
assert( pDflt==0 || pDflt->op==TK_SPAN );
|
||||
if( pDflt && pDflt->pLeft->op==TK_NULL ){
|
||||
pDflt = 0;
|
||||
}
|
||||
|
||||
@ -785,9 +786,7 @@ void sqlite3AlterBeginAddColumn(Parse *pParse, SrcList *pSrc){
|
||||
Column *pCol = &pNew->aCol[i];
|
||||
pCol->zName = sqlite3DbStrDup(db, pCol->zName);
|
||||
pCol->zColl = 0;
|
||||
pCol->zType = 0;
|
||||
pCol->pDflt = 0;
|
||||
pCol->zDflt = 0;
|
||||
}
|
||||
pNew->pSchema = db->aDb[iDb].pSchema;
|
||||
pNew->addColOffset = pTab->addColOffset;
|
||||
|
72
src/build.c
@ -571,8 +571,6 @@ void sqlite3DeleteColumnNames(sqlite3 *db, Table *pTable){
|
||||
for(i=0; i<pTable->nCol; i++, pCol++){
|
||||
sqlite3DbFree(db, pCol->zName);
|
||||
sqlite3ExprDelete(db, pCol->pDflt);
|
||||
sqlite3DbFree(db, pCol->zDflt);
|
||||
sqlite3DbFree(db, pCol->zType);
|
||||
sqlite3DbFree(db, pCol->zColl);
|
||||
}
|
||||
sqlite3DbFree(db, pTable->aCol);
|
||||
@ -1039,10 +1037,11 @@ void sqlite3ColumnPropertiesFromName(Table *pTab, Column *pCol){
|
||||
** first to get things going. Then this routine is called for each
|
||||
** column.
|
||||
*/
|
||||
void sqlite3AddColumn(Parse *pParse, Token *pName){
|
||||
void sqlite3AddColumn(Parse *pParse, Token *pName, Token *pType){
|
||||
Table *p;
|
||||
int i;
|
||||
char *z;
|
||||
char *zType;
|
||||
Column *pCol;
|
||||
sqlite3 *db = pParse->db;
|
||||
if( (p = pParse->pNewTable)==0 ) return;
|
||||
@ -1052,8 +1051,14 @@ void sqlite3AddColumn(Parse *pParse, Token *pName){
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
z = sqlite3NameFromToken(db, pName);
|
||||
z = sqlite3DbMallocRaw(db, pName->n + pType->n + 2);
|
||||
if( z==0 ) return;
|
||||
memcpy(z, pName->z, pName->n);
|
||||
z[pName->n] = 0;
|
||||
sqlite3Dequote(z);
|
||||
zType = z + sqlite3Strlen30(z) + 1;
|
||||
memcpy(zType, pType->z, pType->n);
|
||||
zType[pType->n] = 0;
|
||||
for(i=0; i<p->nCol; i++){
|
||||
if( sqlite3_stricmp(z, p->aCol[i].zName)==0 ){
|
||||
sqlite3ErrorMsg(pParse, "duplicate column name: %s", z);
|
||||
@ -1075,13 +1080,16 @@ void sqlite3AddColumn(Parse *pParse, Token *pName){
|
||||
pCol->zName = z;
|
||||
sqlite3ColumnPropertiesFromName(p, pCol);
|
||||
|
||||
/* If there is no type specified, columns have the default affinity
|
||||
** 'BLOB'. If there is a type specified, then sqlite3AddColumnType() will
|
||||
** be called next to set pCol->affinity correctly.
|
||||
*/
|
||||
pCol->affinity = SQLITE_AFF_BLOB;
|
||||
pCol->szEst = 1;
|
||||
if( pType->n==0 ){
|
||||
/* If there is no type specified, columns have the default affinity
|
||||
** 'BLOB'. */
|
||||
pCol->affinity = SQLITE_AFF_BLOB;
|
||||
pCol->szEst = 1;
|
||||
}else{
|
||||
pCol->affinity = sqlite3AffinityType(zType, &pCol->szEst);
|
||||
}
|
||||
p->nCol++;
|
||||
pParse->constraintName.n = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
@ -1184,28 +1192,6 @@ char sqlite3AffinityType(const char *zIn, u8 *pszEst){
|
||||
return aff;
|
||||
}
|
||||
|
||||
/*
|
||||
** This routine is called by the parser while in the middle of
|
||||
** parsing a CREATE TABLE statement. The pFirst token is the first
|
||||
** token in the sequence of tokens that describe the type of the
|
||||
** column currently under construction. pLast is the last token
|
||||
** in the sequence. Use this information to construct a string
|
||||
** that contains the typename of the column and store that string
|
||||
** in zType.
|
||||
*/
|
||||
void sqlite3AddColumnType(Parse *pParse, Token *pType){
|
||||
Table *p;
|
||||
Column *pCol;
|
||||
|
||||
p = pParse->pNewTable;
|
||||
if( p==0 || NEVER(p->nCol<1) ) return;
|
||||
pCol = &p->aCol[p->nCol-1];
|
||||
assert( pCol->zType==0 || CORRUPT_DB );
|
||||
sqlite3DbFree(pParse->db, pCol->zType);
|
||||
pCol->zType = sqlite3NameFromToken(pParse->db, pType);
|
||||
pCol->affinity = sqlite3AffinityType(pCol->zType, &pCol->szEst);
|
||||
}
|
||||
|
||||
/*
|
||||
** The expression is the default value for the most recently added column
|
||||
** of the table currently under construction.
|
||||
@ -1231,11 +1217,16 @@ void sqlite3AddDefaultValue(Parse *pParse, ExprSpan *pSpan){
|
||||
** tokens that point to volatile memory. The 'span' of the expression
|
||||
** is required by pragma table_info.
|
||||
*/
|
||||
Expr x;
|
||||
sqlite3ExprDelete(db, pCol->pDflt);
|
||||
pCol->pDflt = sqlite3ExprDup(db, pSpan->pExpr, EXPRDUP_REDUCE);
|
||||
sqlite3DbFree(db, pCol->zDflt);
|
||||
pCol->zDflt = sqlite3DbStrNDup(db, (char*)pSpan->zStart,
|
||||
(int)(pSpan->zEnd - pSpan->zStart));
|
||||
memset(&x, 0, sizeof(x));
|
||||
x.op = TK_SPAN;
|
||||
x.u.zToken = sqlite3DbStrNDup(db, (char*)pSpan->zStart,
|
||||
(int)(pSpan->zEnd - pSpan->zStart));
|
||||
x.pLeft = pSpan->pExpr;
|
||||
x.flags = EP_Skip;
|
||||
pCol->pDflt = sqlite3ExprDup(db, &x, EXPRDUP_REDUCE);
|
||||
sqlite3DbFree(db, x.u.zToken);
|
||||
}
|
||||
}
|
||||
sqlite3ExprDelete(db, pSpan->pExpr);
|
||||
@ -1291,7 +1282,7 @@ void sqlite3AddPrimaryKey(
|
||||
int sortOrder /* SQLITE_SO_ASC or SQLITE_SO_DESC */
|
||||
){
|
||||
Table *pTab = pParse->pNewTable;
|
||||
char *zType = 0;
|
||||
const char *zName = 0;
|
||||
int iCol = -1, i;
|
||||
int nTerm;
|
||||
if( pTab==0 || IN_DECLARE_VTAB ) goto primary_key_exit;
|
||||
@ -1304,7 +1295,7 @@ void sqlite3AddPrimaryKey(
|
||||
if( pList==0 ){
|
||||
iCol = pTab->nCol - 1;
|
||||
pTab->aCol[iCol].colFlags |= COLFLAG_PRIMKEY;
|
||||
zType = pTab->aCol[iCol].zType;
|
||||
zName = pTab->aCol[iCol].zName;
|
||||
nTerm = 1;
|
||||
}else{
|
||||
nTerm = pList->nExpr;
|
||||
@ -1317,7 +1308,7 @@ void sqlite3AddPrimaryKey(
|
||||
for(iCol=0; iCol<pTab->nCol; iCol++){
|
||||
if( sqlite3StrICmp(zCName, pTab->aCol[iCol].zName)==0 ){
|
||||
pTab->aCol[iCol].colFlags |= COLFLAG_PRIMKEY;
|
||||
zType = pTab->aCol[iCol].zType;
|
||||
zName = pTab->aCol[iCol].zName;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -1325,7 +1316,8 @@ void sqlite3AddPrimaryKey(
|
||||
}
|
||||
}
|
||||
if( nTerm==1
|
||||
&& zType && sqlite3StrICmp(zType, "INTEGER")==0
|
||||
&& zName
|
||||
&& sqlite3StrICmp(sqlite3StrNext(zName), "INTEGER")==0
|
||||
&& sortOrder!=SQLITE_SO_DESC
|
||||
){
|
||||
pTab->iPKey = iCol;
|
||||
|
@ -3070,6 +3070,7 @@ int sqlite3ExprCodeTarget(Parse *pParse, Expr *pExpr, int target){
|
||||
sqlite3ReleaseTempReg(pParse, r4);
|
||||
break;
|
||||
}
|
||||
case TK_SPAN:
|
||||
case TK_COLLATE:
|
||||
case TK_UPLUS: {
|
||||
inReg = sqlite3ExprCodeTarget(pParse, pExpr->pLeft, target);
|
||||
|
@ -1162,6 +1162,10 @@ static Trigger *fkActionTrigger(
|
||||
int iAction = (pChanges!=0); /* 1 for UPDATE, 0 for DELETE */
|
||||
|
||||
action = pFKey->aAction[iAction];
|
||||
if( action==OE_Restrict && (db->flags & SQLITE_DeferFKs) ){
|
||||
return 0;
|
||||
}
|
||||
|
||||
pTrigger = pFKey->apTrigger[iAction];
|
||||
if( (db->flags & SQLITE_DeferFKs) && action==OE_Restrict ){
|
||||
return 0;
|
||||
|
14
src/insert.c
@ -2008,11 +2008,15 @@ static int xferOptimization(
|
||||
return 0; /* tab2 must be NOT NULL if tab1 is */
|
||||
}
|
||||
/* Default values for second and subsequent columns need to match. */
|
||||
if( i>0
|
||||
&& ((pDestCol->zDflt==0)!=(pSrcCol->zDflt==0)
|
||||
|| (pDestCol->zDflt && strcmp(pDestCol->zDflt, pSrcCol->zDflt)!=0))
|
||||
){
|
||||
return 0; /* Default values must be the same for all columns */
|
||||
if( i>0 ){
|
||||
assert( pDestCol->pDflt==0 || pDestCol->pDflt->op==TK_SPAN );
|
||||
assert( pSrcCol->pDflt==0 || pSrcCol->pDflt->op==TK_SPAN );
|
||||
if( (pDestCol->pDflt==0)!=(pSrcCol->pDflt==0)
|
||||
|| (pDestCol->pDflt && strcmp(pDestCol->pDflt->u.zToken,
|
||||
pSrcCol->pDflt->u.zToken)!=0)
|
||||
){
|
||||
return 0; /* Default values must be the same for all columns */
|
||||
}
|
||||
}
|
||||
}
|
||||
for(pDestIdx=pDest->pIndex; pDestIdx; pDestIdx=pDestIdx->pNext){
|
||||
|
@ -24,6 +24,7 @@
|
||||
** buffer, or
|
||||
** 2) The sqlite3JournalCreate() function is called.
|
||||
*/
|
||||
#if 0
|
||||
#ifdef SQLITE_ENABLE_ATOMIC_WRITE
|
||||
#include "sqliteInt.h"
|
||||
|
||||
@ -254,3 +255,4 @@ int sqlite3JournalSize(sqlite3_vfs *pVfs){
|
||||
return (pVfs->szOsFile+sizeof(JournalFile));
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
11
src/main.c
@ -796,8 +796,9 @@ int sqlite3_db_config(sqlite3 *db, int op, ...){
|
||||
int op; /* The opcode */
|
||||
u32 mask; /* Mask of the bit in sqlite3.flags to set/clear */
|
||||
} aFlagOp[] = {
|
||||
{ SQLITE_DBCONFIG_ENABLE_FKEY, SQLITE_ForeignKeys },
|
||||
{ SQLITE_DBCONFIG_ENABLE_TRIGGER, SQLITE_EnableTrigger },
|
||||
{ SQLITE_DBCONFIG_ENABLE_FKEY, SQLITE_ForeignKeys },
|
||||
{ SQLITE_DBCONFIG_ENABLE_TRIGGER, SQLITE_EnableTrigger },
|
||||
{ SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER, SQLITE_Fts3Tokenizer },
|
||||
};
|
||||
unsigned int i;
|
||||
rc = SQLITE_ERROR; /* IMP: R-42790-23372 */
|
||||
@ -2832,6 +2833,9 @@ static int openDatabase(
|
||||
#endif
|
||||
#if defined(SQLITE_ENABLE_OVERSIZE_CELL_CHECK)
|
||||
| SQLITE_CellSizeCk
|
||||
#endif
|
||||
#if defined(SQLITE_ENABLE_FTS3_TOKENIZER)
|
||||
| SQLITE_Fts3Tokenizer
|
||||
#endif
|
||||
;
|
||||
sqlite3HashInit(&db->aCollSeq);
|
||||
@ -3352,7 +3356,8 @@ int sqlite3_table_column_metadata(
|
||||
** explicitly declared column. Copy meta information from *pCol.
|
||||
*/
|
||||
if( pCol ){
|
||||
zDataType = pCol->zType;
|
||||
zDataType = sqlite3StrNext(pCol->zName);
|
||||
if( zDataType[0]==0 ) zDataType = 0;
|
||||
zCollSeq = pCol->zColl;
|
||||
notnull = pCol->notNull!=0;
|
||||
primarykey = (pCol->colFlags & COLFLAG_PRIMKEY)!=0;
|
||||
|
362
src/memjournal.c
@ -21,24 +21,28 @@ typedef struct MemJournal MemJournal;
|
||||
typedef struct FilePoint FilePoint;
|
||||
typedef struct FileChunk FileChunk;
|
||||
|
||||
/* Space to hold the rollback journal is allocated in increments of
|
||||
** this many bytes.
|
||||
**
|
||||
** The size chosen is a little less than a power of two. That way,
|
||||
** the FileChunk object will have a size that almost exactly fills
|
||||
** a power-of-two allocation. This minimizes wasted space in power-of-two
|
||||
** memory allocators.
|
||||
*/
|
||||
#define JOURNAL_CHUNKSIZE ((int)(1024-sizeof(FileChunk*)))
|
||||
|
||||
/*
|
||||
** The rollback journal is composed of a linked list of these structures.
|
||||
**
|
||||
** The zChunk array is always at least 8 bytes in size - usually much more.
|
||||
** Its actual size is stored in the MemJournal.nChunkSize variable.
|
||||
*/
|
||||
struct FileChunk {
|
||||
FileChunk *pNext; /* Next chunk in the journal */
|
||||
u8 zChunk[JOURNAL_CHUNKSIZE]; /* Content of this chunk */
|
||||
u8 zChunk[8]; /* Content of this chunk */
|
||||
};
|
||||
|
||||
/*
|
||||
** By default, allocate this many bytes of memory for each FileChunk object.
|
||||
*/
|
||||
#define MEMJOURNAL_DFLT_FILECHUNKSIZE 1024
|
||||
|
||||
/*
|
||||
** For chunk size nChunkSize, return the number of bytes that should
|
||||
** be allocated for each FileChunk structure.
|
||||
*/
|
||||
#define fileChunkSize(nChunkSize) (sizeof(FileChunk) + ((nChunkSize)-8))
|
||||
|
||||
/*
|
||||
** An instance of this object serves as a cursor into the rollback journal.
|
||||
** The cursor can be either for reading or writing.
|
||||
@ -49,14 +53,23 @@ struct FilePoint {
|
||||
};
|
||||
|
||||
/*
|
||||
** This subclass is a subclass of sqlite3_file. Each open memory-journal
|
||||
** This structure is a subclass of sqlite3_file. Each open memory-journal
|
||||
** is an instance of this class.
|
||||
*/
|
||||
struct MemJournal {
|
||||
sqlite3_io_methods *pMethod; /* Parent class. MUST BE FIRST */
|
||||
const sqlite3_io_methods *pMethod; /* Parent class. MUST BE FIRST */
|
||||
int nChunkSize; /* In-memory chunk-size */
|
||||
|
||||
int nBuf; /* Bytes of data before flushing */
|
||||
int nSize; /* Bytes of data currently in memory */
|
||||
FileChunk *pFirst; /* Head of in-memory chunk-list */
|
||||
FilePoint endpoint; /* Pointer to the end of the file */
|
||||
FilePoint readpoint; /* Pointer to the end of the last xRead() */
|
||||
|
||||
int flags; /* xOpen flags */
|
||||
sqlite3_vfs *pVfs; /* The "real" underlying VFS */
|
||||
const char *zJournal; /* Name of the journal file */
|
||||
sqlite3_file *pReal; /* The "real" underlying file descriptor */
|
||||
};
|
||||
|
||||
/*
|
||||
@ -70,41 +83,96 @@ static int memjrnlRead(
|
||||
sqlite_int64 iOfst /* Begin reading at this offset */
|
||||
){
|
||||
MemJournal *p = (MemJournal *)pJfd;
|
||||
u8 *zOut = zBuf;
|
||||
int nRead = iAmt;
|
||||
int iChunkOffset;
|
||||
FileChunk *pChunk;
|
||||
|
||||
/* SQLite never tries to read past the end of a rollback journal file */
|
||||
assert( iOfst+iAmt<=p->endpoint.iOffset );
|
||||
|
||||
if( p->readpoint.iOffset!=iOfst || iOfst==0 ){
|
||||
sqlite3_int64 iOff = 0;
|
||||
for(pChunk=p->pFirst;
|
||||
ALWAYS(pChunk) && (iOff+JOURNAL_CHUNKSIZE)<=iOfst;
|
||||
pChunk=pChunk->pNext
|
||||
){
|
||||
iOff += JOURNAL_CHUNKSIZE;
|
||||
}
|
||||
if( p->pReal ){
|
||||
return sqlite3OsRead(p->pReal, zBuf, iAmt, iOfst);
|
||||
}else if( (iAmt+iOfst)>p->endpoint.iOffset ){
|
||||
return SQLITE_IOERR_SHORT_READ;
|
||||
}else{
|
||||
pChunk = p->readpoint.pChunk;
|
||||
}
|
||||
u8 *zOut = zBuf;
|
||||
int nRead = iAmt;
|
||||
int iChunkOffset;
|
||||
FileChunk *pChunk;
|
||||
|
||||
iChunkOffset = (int)(iOfst%JOURNAL_CHUNKSIZE);
|
||||
do {
|
||||
int iSpace = JOURNAL_CHUNKSIZE - iChunkOffset;
|
||||
int nCopy = MIN(nRead, (JOURNAL_CHUNKSIZE - iChunkOffset));
|
||||
memcpy(zOut, &pChunk->zChunk[iChunkOffset], nCopy);
|
||||
zOut += nCopy;
|
||||
nRead -= iSpace;
|
||||
iChunkOffset = 0;
|
||||
} while( nRead>=0 && (pChunk=pChunk->pNext)!=0 && nRead>0 );
|
||||
p->readpoint.iOffset = iOfst+iAmt;
|
||||
p->readpoint.pChunk = pChunk;
|
||||
if( p->readpoint.iOffset!=iOfst || iOfst==0 ){
|
||||
sqlite3_int64 iOff = 0;
|
||||
for(pChunk=p->pFirst;
|
||||
ALWAYS(pChunk) && (iOff+p->nChunkSize)<=iOfst;
|
||||
pChunk=pChunk->pNext
|
||||
){
|
||||
iOff += p->nChunkSize;
|
||||
}
|
||||
}else{
|
||||
pChunk = p->readpoint.pChunk;
|
||||
}
|
||||
|
||||
iChunkOffset = (int)(iOfst%p->nChunkSize);
|
||||
do {
|
||||
int iSpace = p->nChunkSize - iChunkOffset;
|
||||
int nCopy = MIN(nRead, (p->nChunkSize - iChunkOffset));
|
||||
memcpy(zOut, &pChunk->zChunk[iChunkOffset], nCopy);
|
||||
zOut += nCopy;
|
||||
nRead -= iSpace;
|
||||
iChunkOffset = 0;
|
||||
} while( nRead>=0 && (pChunk=pChunk->pNext)!=0 && nRead>0 );
|
||||
p->readpoint.iOffset = iOfst+iAmt;
|
||||
p->readpoint.pChunk = pChunk;
|
||||
}
|
||||
|
||||
return SQLITE_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
** Free the list of FileChunk structures headed at MemJournal.pFirst.
|
||||
*/
|
||||
static void memjrnlFreeChunks(MemJournal *p){
|
||||
FileChunk *pIter;
|
||||
FileChunk *pNext;
|
||||
for(pIter=p->pFirst; pIter; pIter=pNext){
|
||||
pNext = pIter->pNext;
|
||||
sqlite3_free(pIter);
|
||||
}
|
||||
p->pFirst = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
** Flush the contents of memory to a real file on disk.
|
||||
*/
|
||||
static int createFile(MemJournal *p){
|
||||
int rc = SQLITE_OK;
|
||||
if( !p->pReal ){
|
||||
sqlite3_file *pReal = (sqlite3_file *)&p[1];
|
||||
rc = sqlite3OsOpen(p->pVfs, p->zJournal, pReal, p->flags, 0);
|
||||
if( rc==SQLITE_OK ){
|
||||
int nChunk = p->nChunkSize;
|
||||
i64 iOff = 0;
|
||||
FileChunk *pIter;
|
||||
p->pReal = pReal;
|
||||
for(pIter=p->pFirst; pIter && rc==SQLITE_OK; pIter=pIter->pNext){
|
||||
int nWrite = nChunk;
|
||||
if( pIter==p->endpoint.pChunk ){
|
||||
nWrite = p->endpoint.iOffset % p->nChunkSize;
|
||||
if( nWrite==0 ) nWrite = p->nChunkSize;
|
||||
}
|
||||
rc = sqlite3OsWrite(pReal, pIter->zChunk, nWrite, iOff);
|
||||
iOff += nWrite;
|
||||
}
|
||||
if( rc!=SQLITE_OK ){
|
||||
/* If an error occurred while writing to the file, close it before
|
||||
** returning. This way, SQLite uses the in-memory journal data to
|
||||
** roll back changes made to the internal page-cache before this
|
||||
** function was called. */
|
||||
sqlite3OsClose(pReal);
|
||||
p->pReal = 0;
|
||||
}else{
|
||||
/* No error has occurred. Free the in-memory buffers. */
|
||||
memjrnlFreeChunks(p);
|
||||
}
|
||||
}
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
** Write data to the file.
|
||||
*/
|
||||
@ -118,38 +186,61 @@ static int memjrnlWrite(
|
||||
int nWrite = iAmt;
|
||||
u8 *zWrite = (u8 *)zBuf;
|
||||
|
||||
/* An in-memory journal file should only ever be appended to. Random
|
||||
** access writes are not required by sqlite.
|
||||
*/
|
||||
assert( iOfst==p->endpoint.iOffset );
|
||||
UNUSED_PARAMETER(iOfst);
|
||||
/* If the file has already been created on disk. */
|
||||
if( p->pReal ){
|
||||
return sqlite3OsWrite(p->pReal, zBuf, iAmt, iOfst);
|
||||
}
|
||||
|
||||
while( nWrite>0 ){
|
||||
FileChunk *pChunk = p->endpoint.pChunk;
|
||||
int iChunkOffset = (int)(p->endpoint.iOffset%JOURNAL_CHUNKSIZE);
|
||||
int iSpace = MIN(nWrite, JOURNAL_CHUNKSIZE - iChunkOffset);
|
||||
|
||||
if( iChunkOffset==0 ){
|
||||
/* New chunk is required to extend the file. */
|
||||
FileChunk *pNew = sqlite3_malloc(sizeof(FileChunk));
|
||||
if( !pNew ){
|
||||
return SQLITE_IOERR_NOMEM_BKPT;
|
||||
}
|
||||
pNew->pNext = 0;
|
||||
if( pChunk ){
|
||||
assert( p->pFirst );
|
||||
pChunk->pNext = pNew;
|
||||
}else{
|
||||
assert( !p->pFirst );
|
||||
p->pFirst = pNew;
|
||||
}
|
||||
p->endpoint.pChunk = pNew;
|
||||
/* If the file should be created now. */
|
||||
else if( p->nBuf>0 && (iAmt+iOfst)>p->nBuf ){
|
||||
int rc = createFile(p);
|
||||
if( rc==SQLITE_OK ){
|
||||
rc = memjrnlWrite(pJfd, zBuf, iAmt, iOfst);
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
||||
memcpy(&p->endpoint.pChunk->zChunk[iChunkOffset], zWrite, iSpace);
|
||||
zWrite += iSpace;
|
||||
nWrite -= iSpace;
|
||||
p->endpoint.iOffset += iSpace;
|
||||
/* If the contents of this write should be stored in memory */
|
||||
else{
|
||||
/* An in-memory journal file should only ever be appended to. Random
|
||||
** access writes are not required. The only exception to this is when
|
||||
** the in-memory journal is being used by a connection using the
|
||||
** atomic-write optimization. In this case the first 28 bytes of the
|
||||
** journal file may be written as part of committing the transaction. */
|
||||
assert( iOfst==p->endpoint.iOffset || iOfst==0 );
|
||||
if( iOfst==0 && p->pFirst ){
|
||||
assert( p->nChunkSize>iAmt );
|
||||
memcpy(p->pFirst->zChunk, zBuf, iAmt);
|
||||
}else{
|
||||
while( nWrite>0 ){
|
||||
FileChunk *pChunk = p->endpoint.pChunk;
|
||||
int iChunkOffset = (int)(p->endpoint.iOffset%p->nChunkSize);
|
||||
int iSpace = MIN(nWrite, p->nChunkSize - iChunkOffset);
|
||||
|
||||
if( iChunkOffset==0 ){
|
||||
/* New chunk is required to extend the file. */
|
||||
FileChunk *pNew = sqlite3_malloc(fileChunkSize(p->nChunkSize));
|
||||
if( !pNew ){
|
||||
return SQLITE_IOERR_NOMEM_BKPT;
|
||||
}
|
||||
pNew->pNext = 0;
|
||||
if( pChunk ){
|
||||
assert( p->pFirst );
|
||||
pChunk->pNext = pNew;
|
||||
}else{
|
||||
assert( !p->pFirst );
|
||||
p->pFirst = pNew;
|
||||
}
|
||||
p->endpoint.pChunk = pNew;
|
||||
}
|
||||
|
||||
memcpy(&p->endpoint.pChunk->zChunk[iChunkOffset], zWrite, iSpace);
|
||||
zWrite += iSpace;
|
||||
nWrite -= iSpace;
|
||||
p->endpoint.iOffset += iSpace;
|
||||
}
|
||||
p->nSize = iAmt + iOfst;
|
||||
}
|
||||
}
|
||||
|
||||
return SQLITE_OK;
|
||||
@ -157,19 +248,23 @@ static int memjrnlWrite(
|
||||
|
||||
/*
|
||||
** Truncate the file.
|
||||
**
|
||||
** If the journal file is already on disk, truncate it there. Or, if it
|
||||
** is still in main memory but is being truncated to zero bytes in size,
|
||||
** ignore
|
||||
*/
|
||||
static int memjrnlTruncate(sqlite3_file *pJfd, sqlite_int64 size){
|
||||
MemJournal *p = (MemJournal *)pJfd;
|
||||
FileChunk *pChunk;
|
||||
assert(size==0);
|
||||
UNUSED_PARAMETER(size);
|
||||
pChunk = p->pFirst;
|
||||
while( pChunk ){
|
||||
FileChunk *pTmp = pChunk;
|
||||
pChunk = pChunk->pNext;
|
||||
sqlite3_free(pTmp);
|
||||
if( p->pReal ){
|
||||
return sqlite3OsTruncate(p->pReal, size);
|
||||
}else if( size==0 ){
|
||||
memjrnlFreeChunks(p);
|
||||
p->nSize = 0;
|
||||
p->endpoint.pChunk = 0;
|
||||
p->endpoint.iOffset = 0;
|
||||
p->readpoint.pChunk = 0;
|
||||
p->readpoint.iOffset = 0;
|
||||
}
|
||||
sqlite3MemJournalOpen(pJfd);
|
||||
return SQLITE_OK;
|
||||
}
|
||||
|
||||
@ -177,21 +272,23 @@ static int memjrnlTruncate(sqlite3_file *pJfd, sqlite_int64 size){
|
||||
** Close the file.
|
||||
*/
|
||||
static int memjrnlClose(sqlite3_file *pJfd){
|
||||
memjrnlTruncate(pJfd, 0);
|
||||
MemJournal *p = (MemJournal *)pJfd;
|
||||
memjrnlFreeChunks(p);
|
||||
if( p->pReal ) sqlite3OsClose(p->pReal);
|
||||
return SQLITE_OK;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
** Sync the file.
|
||||
**
|
||||
** Syncing an in-memory journal is a no-op. And, in fact, this routine
|
||||
** is never called in a working implementation. This implementation
|
||||
** exists purely as a contingency, in case some malfunction in some other
|
||||
** part of SQLite causes Sync to be called by mistake.
|
||||
** If the real file has been created, call its xSync method. Otherwise,
|
||||
** syncing an in-memory journal is a no-op.
|
||||
*/
|
||||
static int memjrnlSync(sqlite3_file *NotUsed, int NotUsed2){
|
||||
UNUSED_PARAMETER2(NotUsed, NotUsed2);
|
||||
static int memjrnlSync(sqlite3_file *pJfd, int flags){
|
||||
MemJournal *p = (MemJournal *)pJfd;
|
||||
if( p->pReal ){
|
||||
return sqlite3OsSync(p->pReal, flags);
|
||||
}
|
||||
return SQLITE_OK;
|
||||
}
|
||||
|
||||
@ -200,6 +297,9 @@ static int memjrnlSync(sqlite3_file *NotUsed, int NotUsed2){
|
||||
*/
|
||||
static int memjrnlFileSize(sqlite3_file *pJfd, sqlite_int64 *pSize){
|
||||
MemJournal *p = (MemJournal *)pJfd;
|
||||
if( p->pReal ){
|
||||
return sqlite3OsFileSize(p->pReal, pSize);
|
||||
}
|
||||
*pSize = (sqlite_int64) p->endpoint.iOffset;
|
||||
return SQLITE_OK;
|
||||
}
|
||||
@ -230,26 +330,86 @@ static const struct sqlite3_io_methods MemJournalMethods = {
|
||||
};
|
||||
|
||||
/*
|
||||
** Open a journal file.
|
||||
** Open a journal file.
|
||||
**
|
||||
** The behaviour of the journal file depends on the value of parameter
|
||||
** nBuf. If nBuf is 0, then the journal file is always create and
|
||||
** accessed using the underlying VFS. If nBuf is less than zero, then
|
||||
** all content is always stored in main-memory. Finally, if nBuf is a
|
||||
** positive value, then the journal file is initially created in-memory
|
||||
** but may be flushed to disk later on. In this case the journal file is
|
||||
** flushed to disk either when it grows larger than nBuf bytes in size,
|
||||
** or when sqlite3JournalCreate() is called.
|
||||
*/
|
||||
void sqlite3MemJournalOpen(sqlite3_file *pJfd){
|
||||
MemJournal *p = (MemJournal *)pJfd;
|
||||
assert( EIGHT_BYTE_ALIGNMENT(p) );
|
||||
memset(p, 0, sqlite3MemJournalSize());
|
||||
p->pMethod = (sqlite3_io_methods*)&MemJournalMethods;
|
||||
int sqlite3JournalOpen(
|
||||
sqlite3_vfs *pVfs, /* The VFS to use for actual file I/O */
|
||||
const char *zName, /* Name of the journal file */
|
||||
sqlite3_file *pJfd, /* Preallocated, blank file handle */
|
||||
int flags, /* Opening flags */
|
||||
int nBuf /* Bytes buffered before opening the file */
|
||||
){
|
||||
MemJournal *p = (MemJournal*)pJfd;
|
||||
|
||||
/* Zero the file-handle object. If nBuf was passed zero, initialize
|
||||
** it using the sqlite3OsOpen() function of the underlying VFS. In this
|
||||
** case none of the code in this module is executed as a result of calls
|
||||
** made on the journal file-handle. */
|
||||
memset(p, 0, sizeof(MemJournal) + (pVfs ? pVfs->szOsFile : 0));
|
||||
if( nBuf==0 ){
|
||||
return sqlite3OsOpen(pVfs, zName, pJfd, flags, 0);
|
||||
}
|
||||
|
||||
if( nBuf>0 ){
|
||||
p->nChunkSize = nBuf;
|
||||
}else{
|
||||
p->nChunkSize = 8 + MEMJOURNAL_DFLT_FILECHUNKSIZE - sizeof(FileChunk);
|
||||
assert( MEMJOURNAL_DFLT_FILECHUNKSIZE==fileChunkSize(p->nChunkSize) );
|
||||
}
|
||||
|
||||
p->pMethod = (const sqlite3_io_methods*)&MemJournalMethods;
|
||||
p->nBuf = nBuf;
|
||||
p->flags = flags;
|
||||
p->zJournal = zName;
|
||||
p->pVfs = pVfs;
|
||||
return SQLITE_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
** Return true if the file-handle passed as an argument is
|
||||
** an in-memory journal
|
||||
** Open an in-memory journal file.
|
||||
*/
|
||||
int sqlite3IsMemJournal(sqlite3_file *pJfd){
|
||||
return pJfd->pMethods==&MemJournalMethods;
|
||||
void sqlite3MemJournalOpen(sqlite3_file *pJfd){
|
||||
sqlite3JournalOpen(0, 0, pJfd, 0, -1);
|
||||
}
|
||||
|
||||
#ifdef SQLITE_ENABLE_ATOMIC_WRITE
|
||||
/*
|
||||
** If the argument p points to a MemJournal structure that is not an
|
||||
** in-memory-only journal file (i.e. is one that was opened with a +ve
|
||||
** nBuf parameter), and the underlying file has not yet been created,
|
||||
** create it now.
|
||||
*/
|
||||
int sqlite3JournalCreate(sqlite3_file *p){
|
||||
int rc = SQLITE_OK;
|
||||
if( p->pMethods==&MemJournalMethods && ((MemJournal*)p)->nBuf>0 ){
|
||||
rc = createFile((MemJournal*)p);
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
** The file-handle passed as the only argument is open on a journal file.
|
||||
** Return true if this "journal file" is currently stored in heap memory,
|
||||
** or false otherwise.
|
||||
*/
|
||||
int sqlite3JournalIsInMemory(sqlite3_file *p){
|
||||
return p->pMethods==&MemJournalMethods && ((MemJournal*)p)->pReal==0;
|
||||
}
|
||||
|
||||
/*
|
||||
** Return the number of bytes required to store a MemJournal file descriptor.
|
||||
** Return the number of bytes required to store a JournalFile that uses vfs
|
||||
** pVfs to create the underlying on-disk files.
|
||||
*/
|
||||
int sqlite3MemJournalSize(void){
|
||||
return sizeof(MemJournal);
|
||||
int sqlite3JournalSize(sqlite3_vfs *pVfs){
|
||||
return pVfs->szOsFile + sizeof(MemJournal);
|
||||
}
|
||||
|
2
src/os.c
@ -66,7 +66,7 @@ int sqlite3_open_file_count = 0;
|
||||
#if defined(SQLITE_TEST)
|
||||
int sqlite3_memdebug_vfs_oom_test = 1;
|
||||
#define DO_OS_MALLOC_TEST(x) \
|
||||
if (sqlite3_memdebug_vfs_oom_test && (!x || !sqlite3IsMemJournal(x))) { \
|
||||
if (sqlite3_memdebug_vfs_oom_test && (!x || !sqlite3JournalIsInMemory(x))) { \
|
||||
void *pTstAlloc = sqlite3Malloc(10); \
|
||||
if (!pTstAlloc) return SQLITE_IOERR_NOMEM_BKPT; \
|
||||
sqlite3_free(pTstAlloc); \
|
||||
|
@ -71,6 +71,19 @@
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Use pread() and pwrite() if they are available */
|
||||
#if defined(__APPLE__)
|
||||
# define HAVE_PREAD 1
|
||||
# define HAVE_PWRITE 1
|
||||
#endif
|
||||
#if defined(HAVE_PREAD64) && defined(HAVE_PWRITE64)
|
||||
# undef USE_PREAD
|
||||
# define USE_PREAD64 1
|
||||
#elif defined(HAVE_PREAD) && defined(HAVE_PWRITE)
|
||||
# undef USE_PREAD64
|
||||
# define USE_PREAD 1
|
||||
#endif
|
||||
|
||||
/*
|
||||
** standard include files.
|
||||
*/
|
||||
|
39
src/pager.c
@ -1343,6 +1343,7 @@ static i64 journalHdrOffset(Pager *pPager){
|
||||
static int zeroJournalHdr(Pager *pPager, int doTruncate){
|
||||
int rc = SQLITE_OK; /* Return code */
|
||||
assert( isOpen(pPager->jfd) );
|
||||
assert( !sqlite3JournalIsInMemory(pPager->jfd) );
|
||||
if( pPager->journalOff ){
|
||||
const i64 iLimit = pPager->journalSizeLimit; /* Local cache of jsl */
|
||||
|
||||
@ -1724,7 +1725,7 @@ static void releaseAllSavepoints(Pager *pPager){
|
||||
for(ii=0; ii<pPager->nSavepoint; ii++){
|
||||
sqlite3BitvecDestroy(pPager->aSavepoint[ii].pInSavepoint);
|
||||
}
|
||||
if( !pPager->exclusiveMode || sqlite3IsMemJournal(pPager->sjfd) ){
|
||||
if( !pPager->exclusiveMode || sqlite3JournalIsInMemory(pPager->sjfd) ){
|
||||
sqlite3OsClose(pPager->sjfd);
|
||||
}
|
||||
sqlite3_free(pPager->aSavepoint);
|
||||
@ -1962,8 +1963,8 @@ static int pager_end_transaction(Pager *pPager, int hasMaster, int bCommit){
|
||||
assert( !pagerUseWal(pPager) );
|
||||
|
||||
/* Finalize the journal file. */
|
||||
if( sqlite3IsMemJournal(pPager->jfd) ){
|
||||
assert( pPager->journalMode==PAGER_JOURNALMODE_MEMORY );
|
||||
if( sqlite3JournalIsInMemory(pPager->jfd) ){
|
||||
/* assert( pPager->journalMode==PAGER_JOURNALMODE_MEMORY ); */
|
||||
sqlite3OsClose(pPager->jfd);
|
||||
}else if( pPager->journalMode==PAGER_JOURNALMODE_TRUNCATE ){
|
||||
if( pPager->journalOff==0 ){
|
||||
@ -1989,9 +1990,10 @@ static int pager_end_transaction(Pager *pPager, int hasMaster, int bCommit){
|
||||
/* This branch may be executed with Pager.journalMode==MEMORY if
|
||||
** a hot-journal was just rolled back. In this case the journal
|
||||
** file should be closed and deleted. If this connection writes to
|
||||
** the database file, it will do so using an in-memory journal.
|
||||
** the database file, it will do so using an in-memory journal.
|
||||
*/
|
||||
int bDelete = (!pPager->tempFile && sqlite3JournalExists(pPager->jfd));
|
||||
int bDelete = !pPager->tempFile;
|
||||
assert( sqlite3JournalIsInMemory(pPager->jfd)==0 );
|
||||
assert( pPager->journalMode==PAGER_JOURNALMODE_DELETE
|
||||
|| pPager->journalMode==PAGER_JOURNALMODE_MEMORY
|
||||
|| pPager->journalMode==PAGER_JOURNALMODE_WAL
|
||||
@ -2729,7 +2731,7 @@ static int pager_playback(Pager *pPager, int isHot){
|
||||
** TODO: Technically the following is an error because it assumes that
|
||||
** buffer Pager.pTmpSpace is (mxPathname+1) bytes or larger. i.e. that
|
||||
** (pPager->pageSize >= pPager->pVfs->mxPathname+1). Using os_unix.c,
|
||||
** mxPathname is 512, which is the same as the minimum allowable value
|
||||
** mxPathname is 512, which is the same as the minimum allowable value
|
||||
** for pageSize.
|
||||
*/
|
||||
zMaster = pPager->pTmpSpace;
|
||||
@ -4353,11 +4355,14 @@ static int pager_write_pagelist(Pager *pPager, PgHdr *pList){
|
||||
static int openSubJournal(Pager *pPager){
|
||||
int rc = SQLITE_OK;
|
||||
if( !isOpen(pPager->sjfd) ){
|
||||
const int flags = SQLITE_OPEN_SUBJOURNAL | SQLITE_OPEN_READWRITE
|
||||
| SQLITE_OPEN_CREATE | SQLITE_OPEN_EXCLUSIVE
|
||||
| SQLITE_OPEN_DELETEONCLOSE;
|
||||
int nBuf = 64*1024;
|
||||
if( pPager->journalMode==PAGER_JOURNALMODE_MEMORY || pPager->subjInMemory ){
|
||||
sqlite3MemJournalOpen(pPager->sjfd);
|
||||
}else{
|
||||
rc = pagerOpentemp(pPager, pPager->sjfd, SQLITE_OPEN_SUBJOURNAL);
|
||||
nBuf = -1;
|
||||
}
|
||||
rc = sqlite3JournalOpen(pPager->pVfs, 0, pPager->sjfd, flags, nBuf);
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
@ -4578,18 +4583,8 @@ int sqlite3PagerOpen(
|
||||
int nUri = 0; /* Number of bytes of URI args at *zUri */
|
||||
|
||||
/* Figure out how much space is required for each journal file-handle
|
||||
** (there are two of them, the main journal and the sub-journal). This
|
||||
** is the maximum space required for an in-memory journal file handle
|
||||
** and a regular journal file-handle. Note that a "regular journal-handle"
|
||||
** may be a wrapper capable of caching the first portion of the journal
|
||||
** file in memory to implement the atomic-write optimization (see
|
||||
** source file journal.c).
|
||||
*/
|
||||
if( sqlite3JournalSize(pVfs)>sqlite3MemJournalSize() ){
|
||||
journalFileSize = ROUND8(sqlite3JournalSize(pVfs));
|
||||
}else{
|
||||
journalFileSize = ROUND8(sqlite3MemJournalSize());
|
||||
}
|
||||
** (there are two of them, the main journal and the sub-journal). */
|
||||
journalFileSize = ROUND8(sqlite3JournalSize(pVfs));
|
||||
|
||||
/* Set the output variable to NULL in case an error occurs. */
|
||||
*ppPager = 0;
|
||||
@ -6667,7 +6662,7 @@ int sqlite3PagerSavepoint(Pager *pPager, int op, int iSavepoint){
|
||||
if( op==SAVEPOINT_RELEASE ){
|
||||
if( nNew==0 && isOpen(pPager->sjfd) ){
|
||||
/* Only truncate if it is an in-memory sub-journal. */
|
||||
if( sqlite3IsMemJournal(pPager->sjfd) ){
|
||||
if( sqlite3JournalIsInMemory(pPager->sjfd) ){
|
||||
rc = sqlite3OsTruncate(pPager->sjfd, 0);
|
||||
assert( rc==SQLITE_OK );
|
||||
}
|
||||
|
30
src/parse.y
@ -190,22 +190,9 @@ table_options(A) ::= WITHOUT nm(X). {
|
||||
sqlite3ErrorMsg(pParse, "unknown table option: %.*s", X.n, X.z);
|
||||
}
|
||||
}
|
||||
columnlist ::= columnlist COMMA column.
|
||||
columnlist ::= column.
|
||||
|
||||
// A "column" is a complete description of a single column in a
|
||||
// CREATE TABLE statement. This includes the column name, its
|
||||
// datatype, and other keywords such as PRIMARY KEY, UNIQUE, REFERENCES,
|
||||
// NOT NULL and so forth.
|
||||
//
|
||||
column(A) ::= columnid(A) type carglist. {
|
||||
A.n = (int)(pParse->sLastToken.z-A.z) + pParse->sLastToken.n;
|
||||
}
|
||||
columnid(A) ::= nm(A). {
|
||||
sqlite3AddColumn(pParse,&A);
|
||||
pParse->constraintName.n = 0;
|
||||
}
|
||||
|
||||
columnlist ::= columnlist COMMA columnname carglist.
|
||||
columnlist ::= columnname carglist.
|
||||
columnname(A) ::= nm(A) typetoken(Y). {sqlite3AddColumn(pParse,&A,&Y);}
|
||||
|
||||
// An IDENTIFIER can be a generic identifier, or one of several
|
||||
// keywords. Any non-standard keyword can also be an identifier.
|
||||
@ -264,13 +251,12 @@ nm(A) ::= id(A).
|
||||
nm(A) ::= STRING(A).
|
||||
nm(A) ::= JOIN_KW(A).
|
||||
|
||||
// A typetoken is really one or more tokens that form a type name such
|
||||
// A typetoken is really zero or more tokens that form a type name such
|
||||
// as can be found after the column name in a CREATE TABLE statement.
|
||||
// Multiple tokens are concatenated to form the value of the typetoken.
|
||||
//
|
||||
%type typetoken {Token}
|
||||
type ::= .
|
||||
type ::= typetoken(X). {sqlite3AddColumnType(pParse,&X);}
|
||||
typetoken(A) ::= . {A.n = 0; A.z = 0;}
|
||||
typetoken(A) ::= typename(A).
|
||||
typetoken(A) ::= typename(A) LP signed RP(Y). {
|
||||
A.n = (int)(&Y.z[Y.n] - A.z);
|
||||
@ -580,7 +566,7 @@ selcollist(A) ::= sclp(A) nm(X) DOT STAR(Y). {
|
||||
%type as {Token}
|
||||
as(X) ::= AS nm(Y). {X = Y;}
|
||||
as(X) ::= ids(X).
|
||||
as(X) ::= . {X.n = 0;}
|
||||
as(X) ::= . {X.n = 0; X.z = 0;}
|
||||
|
||||
|
||||
%type seltablist {SrcList*}
|
||||
@ -1499,7 +1485,9 @@ cmd ::= ANALYZE nm(X) dbnm(Y). {sqlite3Analyze(pParse, &X, &Y);}
|
||||
cmd ::= ALTER TABLE fullname(X) RENAME TO nm(Z). {
|
||||
sqlite3AlterRenameTable(pParse,X,&Z);
|
||||
}
|
||||
cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt column(Y). {
|
||||
cmd ::= ALTER TABLE add_column_fullname
|
||||
ADD kwcolumn_opt columnname(Y) carglist. {
|
||||
Y.n = (int)(pParse->sLastToken.z-Y.z) + pParse->sLastToken.n;
|
||||
sqlite3AlterFinishAddColumn(pParse, &Y);
|
||||
}
|
||||
add_column_fullname ::= fullname(X). {
|
||||
|
17
src/pragma.c
@ -1065,6 +1065,7 @@ void sqlite3Pragma(
|
||||
setAllColumnNames(v, 6, azCol); assert( 6==ArraySize(azCol) );
|
||||
sqlite3ViewGetColumnNames(pParse, pTab);
|
||||
for(i=0, pCol=pTab->aCol; i<pTab->nCol; i++, pCol++){
|
||||
const char *zName;
|
||||
if( IsHiddenColumn(pCol) ){
|
||||
nHidden++;
|
||||
continue;
|
||||
@ -1076,12 +1077,14 @@ void sqlite3Pragma(
|
||||
}else{
|
||||
for(k=1; k<=pTab->nCol && pPk->aiColumn[k-1]!=i; k++){}
|
||||
}
|
||||
assert( pCol->pDflt==0 || pCol->pDflt->op==TK_SPAN );
|
||||
zName = pCol->zName;
|
||||
sqlite3VdbeMultiLoad(v, 1, "issisi",
|
||||
i-nHidden,
|
||||
pCol->zName,
|
||||
pCol->zType ? pCol->zType : "",
|
||||
zName,
|
||||
sqlite3StrNext(zName),
|
||||
pCol->notNull ? 1 : 0,
|
||||
pCol->zDflt,
|
||||
pCol->pDflt ? pCol->pDflt->u.zToken : 0,
|
||||
k);
|
||||
sqlite3VdbeAddOp2(v, OP_ResultRow, 1, 6);
|
||||
}
|
||||
@ -1102,14 +1105,14 @@ void sqlite3Pragma(
|
||||
sqlite3VdbeMultiLoad(v, 1, "ssii",
|
||||
pTab->zName,
|
||||
0,
|
||||
(int)sqlite3LogEstToInt(pTab->szTabRow),
|
||||
(int)sqlite3LogEstToInt(pTab->nRowLogEst));
|
||||
pTab->szTabRow,
|
||||
pTab->nRowLogEst);
|
||||
sqlite3VdbeAddOp2(v, OP_ResultRow, 1, 4);
|
||||
for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){
|
||||
sqlite3VdbeMultiLoad(v, 2, "sii",
|
||||
pIdx->zName,
|
||||
(int)sqlite3LogEstToInt(pIdx->szIdxRow),
|
||||
(int)sqlite3LogEstToInt(pIdx->aiRowLogEst[0]));
|
||||
pIdx->szIdxRow,
|
||||
pIdx->aiRowLogEst[0]);
|
||||
sqlite3VdbeAddOp2(v, OP_ResultRow, 1, 4);
|
||||
}
|
||||
}
|
||||
|
10
src/select.c
@ -1429,8 +1429,8 @@ static const char *columnTypeImpl(
|
||||
zType = "INTEGER";
|
||||
zOrigCol = "rowid";
|
||||
}else{
|
||||
zType = pTab->aCol[iCol].zType;
|
||||
zOrigCol = pTab->aCol[iCol].zName;
|
||||
zType = sqlite3StrNext(zOrigCol);
|
||||
estWidth = pTab->aCol[iCol].szEst;
|
||||
}
|
||||
zOrigTab = pTab->zName;
|
||||
@ -1442,7 +1442,7 @@ static const char *columnTypeImpl(
|
||||
if( iCol<0 ){
|
||||
zType = "INTEGER";
|
||||
}else{
|
||||
zType = pTab->aCol[iCol].zType;
|
||||
zType = sqlite3StrNext(pTab->aCol[iCol].zName);
|
||||
estWidth = pTab->aCol[iCol].szEst;
|
||||
}
|
||||
#endif
|
||||
@ -1727,10 +1727,7 @@ static void selectAddColumnTypeAndCollation(
|
||||
a = pSelect->pEList->a;
|
||||
for(i=0, pCol=pTab->aCol; i<pTab->nCol; i++, pCol++){
|
||||
p = a[i].pExpr;
|
||||
if( pCol->zType==0 ){
|
||||
pCol->zType = sqlite3DbStrDup(db,
|
||||
columnType(&sNC, p,0,0,0, &pCol->szEst));
|
||||
}
|
||||
columnType(&sNC, p, 0, 0, 0, &pCol->szEst);
|
||||
szAll += pCol->szEst;
|
||||
pCol->affinity = sqlite3ExprAffinity(p);
|
||||
if( pCol->affinity==0 ) pCol->affinity = SQLITE_AFF_BLOB;
|
||||
@ -2225,7 +2222,6 @@ static int multiSelect(
|
||||
if( dest.eDest==SRT_EphemTab ){
|
||||
assert( p->pEList );
|
||||
sqlite3VdbeAddOp2(v, OP_OpenEphemeral, dest.iSDParm, p->pEList->nExpr);
|
||||
sqlite3VdbeChangeP5(v, BTREE_UNORDERED);
|
||||
dest.eDest = SRT_Table;
|
||||
}
|
||||
|
||||
|
47
src/shell.c
@ -1301,6 +1301,43 @@ static char *save_err_msg(
|
||||
return zErrMsg;
|
||||
}
|
||||
|
||||
#ifdef __linux__
|
||||
/*
|
||||
** Attempt to display I/O stats on Linux using /proc/PID/io
|
||||
*/
|
||||
static void displayLinuxIoStats(FILE *out){
|
||||
FILE *in;
|
||||
char z[200];
|
||||
sqlite3_snprintf(sizeof(z), z, "/proc/%d/io", getpid());
|
||||
in = fopen(z, "rb");
|
||||
if( in==0 ) return;
|
||||
while( fgets(z, sizeof(z), in)!=0 ){
|
||||
static const struct {
|
||||
const char *zPattern;
|
||||
const char *zDesc;
|
||||
} aTrans[] = {
|
||||
{ "rchar: ", "Bytes received by read():" },
|
||||
{ "wchar: ", "Bytes sent to write():" },
|
||||
{ "syscr: ", "Read() system calls:" },
|
||||
{ "syscw: ", "Write() system calls:" },
|
||||
{ "read_bytes: ", "Bytes read from storage:" },
|
||||
{ "write_bytes: ", "Bytes written to storage:" },
|
||||
{ "cancelled_write_bytes: ", "Cancelled write bytes:" },
|
||||
};
|
||||
int i;
|
||||
for(i=0; i<ArraySize(aTrans); i++){
|
||||
int n = (int)strlen(aTrans[i].zPattern);
|
||||
if( strncmp(aTrans[i].zPattern, z, n)==0 ){
|
||||
raw_printf(out, "%-36s %s", aTrans[i].zDesc, &z[n]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
fclose(in);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
** Display memory stats.
|
||||
*/
|
||||
@ -1423,6 +1460,10 @@ static int display_stats(
|
||||
raw_printf(pArg->out, "Virtual Machine Steps: %d\n", iCur);
|
||||
}
|
||||
|
||||
#ifdef __linux__
|
||||
displayLinuxIoStats(pArg->out);
|
||||
#endif
|
||||
|
||||
/* Do not remove this machine readable comment: extra-stats-output-here */
|
||||
|
||||
return 0;
|
||||
@ -1977,7 +2018,7 @@ static char zHelp[] =
|
||||
#endif
|
||||
".shell CMD ARGS... Run CMD ARGS... in a system shell\n"
|
||||
".show Show the current values for various settings\n"
|
||||
".stats on|off Turn stats on or off\n"
|
||||
".stats ?on|off? Show stats or turn stats on or off\n"
|
||||
".system CMD ARGS... Run CMD ARGS... in a system shell\n"
|
||||
".tables ?TABLE? List names of tables\n"
|
||||
" If TABLE specified, only list tables matching\n"
|
||||
@ -4116,8 +4157,10 @@ static int do_meta_command(char *zLine, ShellState *p){
|
||||
if( c=='s' && strncmp(azArg[0], "stats", n)==0 ){
|
||||
if( nArg==2 ){
|
||||
p->statsOn = booleanValue(azArg[1]);
|
||||
}else if( nArg==1 ){
|
||||
display_stats(p->db, p, 0);
|
||||
}else{
|
||||
raw_printf(stderr, "Usage: .stats on|off\n");
|
||||
raw_printf(stderr, "Usage: .stats ?on|off?\n");
|
||||
rc = 1;
|
||||
}
|
||||
}else
|
||||
|
@ -1228,7 +1228,7 @@ struct sqlite3_vfs {
|
||||
const char *(*xNextSystemCall)(sqlite3_vfs*, const char *zName);
|
||||
/*
|
||||
** The methods above are in versions 1 through 3 of the sqlite_vfs object.
|
||||
** New fields may be appended in figure versions. The iVersion
|
||||
** New fields may be appended in future versions. The iVersion
|
||||
** value will increment whenever this happens.
|
||||
*/
|
||||
};
|
||||
@ -1904,11 +1904,25 @@ struct sqlite3_mem_methods {
|
||||
** following this call. The second parameter may be a NULL pointer, in
|
||||
** which case the trigger setting is not reported back. </dd>
|
||||
**
|
||||
** <dt>SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER</dt>
|
||||
** <dd> ^This option is used to enable or disable the two-argument
|
||||
** version of the [fts3_tokenizer()] function which is part of the
|
||||
** [FTS3] full-text search engine extension.
|
||||
** There should be two additional arguments.
|
||||
** The first argument is an integer which is 0 to disable fts3_tokenizer() or
|
||||
** positive to enable fts3_tokenizer() or negative to leave the setting
|
||||
** unchanged.
|
||||
** The second parameter is a pointer to an integer into which
|
||||
** is written 0 or 1 to indicate whether fts3_tokenizer is disabled or enabled
|
||||
** following this call. The second parameter may be a NULL pointer, in
|
||||
** which case the new setting is not reported back. </dd>
|
||||
**
|
||||
** </dl>
|
||||
*/
|
||||
#define SQLITE_DBCONFIG_LOOKASIDE 1001 /* void* int int */
|
||||
#define SQLITE_DBCONFIG_ENABLE_FKEY 1002 /* int int* */
|
||||
#define SQLITE_DBCONFIG_ENABLE_TRIGGER 1003 /* int int* */
|
||||
#define SQLITE_DBCONFIG_LOOKASIDE 1001 /* void* int int */
|
||||
#define SQLITE_DBCONFIG_ENABLE_FKEY 1002 /* int int* */
|
||||
#define SQLITE_DBCONFIG_ENABLE_TRIGGER 1003 /* int int* */
|
||||
#define SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER 1004 /* int int* */
|
||||
|
||||
|
||||
/*
|
||||
@ -8049,7 +8063,11 @@ SQLITE_EXPERIMENTAL int sqlite3_snapshot_get(
|
||||
** the first operation, apart from other sqlite3_snapshot_open() calls,
|
||||
** following the [BEGIN] that starts a new read transaction.
|
||||
** ^A [snapshot] will fail to open if it has been overwritten by a
|
||||
** [checkpoint].
|
||||
** [checkpoint].
|
||||
** ^A [snapshot] will fail to open if the database connection D has not
|
||||
** previously completed at least one read operation against the database
|
||||
** file. (Hint: Run "[PRAGMA application_id]" against a newly opened
|
||||
** database connection in order to make it ready to use snapshots.)
|
||||
**
|
||||
** The [sqlite3_snapshot_open()] interface is only available when the
|
||||
** SQLITE_ENABLE_SNAPSHOT compile-time option is used.
|
||||
|
@ -1335,6 +1335,7 @@ struct sqlite3 {
|
||||
#define SQLITE_VdbeEQP 0x04000000 /* Debug EXPLAIN QUERY PLAN */
|
||||
#define SQLITE_Vacuum 0x08000000 /* Currently in a VACUUM */
|
||||
#define SQLITE_CellSizeCk 0x10000000 /* Check btree cell sizes on load */
|
||||
#define SQLITE_Fts3Tokenizer 0x20000000 /* Enable fts3_tokenizer(2) */
|
||||
|
||||
|
||||
/*
|
||||
@ -1550,10 +1551,8 @@ struct Module {
|
||||
** of this structure.
|
||||
*/
|
||||
struct Column {
|
||||
char *zName; /* Name of this column */
|
||||
char *zName; /* Name of this column, \000, then the type */
|
||||
Expr *pDflt; /* Default value of this column */
|
||||
char *zDflt; /* Original text of the default value */
|
||||
char *zType; /* Data type for this column */
|
||||
char *zColl; /* Collating sequence. If NULL, use the default */
|
||||
u8 notNull; /* An OE_ code for handling a NOT NULL constraint */
|
||||
char affinity; /* One of the SQLITE_AFF_... values */
|
||||
@ -3270,6 +3269,7 @@ int sqlite3IsIdChar(u8);
|
||||
*/
|
||||
int sqlite3StrICmp(const char*,const char*);
|
||||
int sqlite3Strlen30(const char*);
|
||||
const char *sqlite3StrNext(const char*);
|
||||
#define sqlite3StrNICmp sqlite3_strnicmp
|
||||
|
||||
int sqlite3MallocInit(void);
|
||||
@ -3425,11 +3425,10 @@ void sqlite3StartTable(Parse*,Token*,Token*,int,int,int,int);
|
||||
#else
|
||||
# define sqlite3ColumnPropertiesFromName(T,C) /* no-op */
|
||||
#endif
|
||||
void sqlite3AddColumn(Parse*,Token*);
|
||||
void sqlite3AddColumn(Parse*,Token*,Token*);
|
||||
void sqlite3AddNotNull(Parse*, int);
|
||||
void sqlite3AddPrimaryKey(Parse*, ExprList*, int, int, int);
|
||||
void sqlite3AddCheckConstraint(Parse*, Expr*);
|
||||
void sqlite3AddColumnType(Parse*,Token*);
|
||||
void sqlite3AddDefaultValue(Parse*,ExprSpan*);
|
||||
void sqlite3AddCollateType(Parse*, Token*);
|
||||
void sqlite3EndTable(Parse*,Token*,Token*,u8,Select*);
|
||||
@ -3698,7 +3697,11 @@ LogEst sqlite3LogEstAdd(LogEst,LogEst);
|
||||
#ifndef SQLITE_OMIT_VIRTUALTABLE
|
||||
LogEst sqlite3LogEstFromDouble(double);
|
||||
#endif
|
||||
#if defined(SQLITE_ENABLE_STMT_SCANSTAT) || \
|
||||
defined(SQLITE_ENABLE_STAT3_OR_STAT4) || \
|
||||
defined(SQLITE_EXPLAIN_ESTIMATED_ROWS)
|
||||
u64 sqlite3LogEstToInt(LogEst);
|
||||
#endif
|
||||
|
||||
/*
|
||||
** Routines to read and write variable-length integers. These used to
|
||||
@ -4007,19 +4010,14 @@ const char *sqlite3JournalModename(int);
|
||||
#define IN_INDEX_LOOP 0x0004 /* IN operator used as a loop */
|
||||
int sqlite3FindInIndex(Parse *, Expr *, u32, int*);
|
||||
|
||||
int sqlite3JournalOpen(sqlite3_vfs *, const char *, sqlite3_file *, int, int);
|
||||
int sqlite3JournalSize(sqlite3_vfs *);
|
||||
#ifdef SQLITE_ENABLE_ATOMIC_WRITE
|
||||
int sqlite3JournalOpen(sqlite3_vfs *, const char *, sqlite3_file *, int, int);
|
||||
int sqlite3JournalSize(sqlite3_vfs *);
|
||||
int sqlite3JournalCreate(sqlite3_file *);
|
||||
int sqlite3JournalExists(sqlite3_file *p);
|
||||
#else
|
||||
#define sqlite3JournalSize(pVfs) ((pVfs)->szOsFile)
|
||||
#define sqlite3JournalExists(p) 1
|
||||
#endif
|
||||
|
||||
int sqlite3JournalIsInMemory(sqlite3_file *p);
|
||||
void sqlite3MemJournalOpen(sqlite3_file *);
|
||||
int sqlite3MemJournalSize(void);
|
||||
int sqlite3IsMemJournal(sqlite3_file *);
|
||||
|
||||
void sqlite3ExprSetHeightAndFlags(Parse *pParse, Expr *p);
|
||||
#if SQLITE_MAX_EXPR_DEPTH>0
|
||||
|
@ -102,12 +102,12 @@
|
||||
** the main database table and for temporary tables.
|
||||
**
|
||||
** IMPLEMENTATION-OF: R-31093-59126 The default suggested cache size
|
||||
** is 2000 pages.
|
||||
** is 2000*1024 bytes.
|
||||
** IMPLEMENTATION-OF: R-48205-43578 The default suggested cache size can be
|
||||
** altered using the SQLITE_DEFAULT_CACHE_SIZE compile-time options.
|
||||
*/
|
||||
#ifndef SQLITE_DEFAULT_CACHE_SIZE
|
||||
# define SQLITE_DEFAULT_CACHE_SIZE 2000
|
||||
# define SQLITE_DEFAULT_CACHE_SIZE -2000
|
||||
#endif
|
||||
|
||||
/*
|
||||
@ -120,8 +120,9 @@
|
||||
|
||||
/*
|
||||
** The maximum number of attached databases. This must be between 0
|
||||
** and 62. The upper bound on 62 is because a 64-bit integer bitmap
|
||||
** is used internally to track attached databases.
|
||||
** and 125. The upper bound of 125 is because the attached databases are
|
||||
** counted using a signed 8-bit integer which has a maximum value of 127
|
||||
** and we have to allow 2 extra counts for the "main" and "temp" databases.
|
||||
*/
|
||||
#ifndef SQLITE_MAX_ATTACHED
|
||||
# define SQLITE_MAX_ATTACHED 10
|
||||
@ -156,7 +157,7 @@
|
||||
** The default size of a database page.
|
||||
*/
|
||||
#ifndef SQLITE_DEFAULT_PAGE_SIZE
|
||||
# define SQLITE_DEFAULT_PAGE_SIZE 1024
|
||||
# define SQLITE_DEFAULT_PAGE_SIZE 4096
|
||||
#endif
|
||||
#if SQLITE_DEFAULT_PAGE_SIZE>SQLITE_MAX_PAGE_SIZE
|
||||
# undef SQLITE_DEFAULT_PAGE_SIZE
|
||||
|
@ -3923,6 +3923,7 @@ static void init_all(Tcl_Interp *interp){
|
||||
#endif
|
||||
extern int Fts5tcl_Init(Tcl_Interp *);
|
||||
extern int SqliteRbu_Init(Tcl_Interp*);
|
||||
extern int Sqlitetesttcl_Init(Tcl_Interp*);
|
||||
#if defined(SQLITE_ENABLE_FTS3) || defined(SQLITE_ENABLE_FTS4)
|
||||
extern int Sqlitetestfts3_Init(Tcl_Interp *interp);
|
||||
#endif
|
||||
@ -3970,6 +3971,7 @@ static void init_all(Tcl_Interp *interp){
|
||||
#endif
|
||||
Fts5tcl_Init(interp);
|
||||
SqliteRbu_Init(interp);
|
||||
Sqlitetesttcl_Init(interp);
|
||||
|
||||
#if defined(SQLITE_ENABLE_FTS3) || defined(SQLITE_ENABLE_FTS4)
|
||||
Sqlitetestfts3_Init(interp);
|
||||
|
48
src/test1.c
@ -6920,6 +6920,53 @@ static int test_register_dbstat_vtab(
|
||||
#endif /* SQLITE_OMIT_VIRTUALTABLE */
|
||||
}
|
||||
|
||||
/*
|
||||
** tclcmd: sqlite3_db_config DB SETTING VALUE
|
||||
**
|
||||
** Invoke sqlite3_db_config() for one of the setting values.
|
||||
*/
|
||||
static int test_sqlite3_db_config(
|
||||
void *clientData,
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *CONST objv[]
|
||||
){
|
||||
static const struct {
|
||||
const char *zName;
|
||||
int eVal;
|
||||
} aSetting[] = {
|
||||
{ "FKEY", SQLITE_DBCONFIG_ENABLE_FKEY },
|
||||
{ "TRIGGER", SQLITE_DBCONFIG_ENABLE_TRIGGER },
|
||||
{ "FTS3_TOKENIZER", SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER },
|
||||
};
|
||||
int i;
|
||||
int v;
|
||||
const char *zSetting;
|
||||
sqlite3 *db;
|
||||
|
||||
if( objc!=4 ){
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "DB SETTING VALUE");
|
||||
return TCL_ERROR;
|
||||
}
|
||||
if( getDbPointer(interp, Tcl_GetString(objv[1]), &db) ) return TCL_ERROR;
|
||||
zSetting = Tcl_GetString(objv[2]);
|
||||
if( sqlite3_strglob("SQLITE_*", zSetting)==0 ) zSetting += 7;
|
||||
if( sqlite3_strglob("DBCONFIG_*", zSetting)==0 ) zSetting += 9;
|
||||
if( sqlite3_strglob("ENABLE_*", zSetting)==0 ) zSetting += 7;
|
||||
for(i=0; i<ArraySize(aSetting); i++){
|
||||
if( strcmp(zSetting, aSetting[i].zName)==0 ) break;
|
||||
}
|
||||
if( i>=ArraySize(aSetting) ){
|
||||
Tcl_SetObjResult(interp,
|
||||
Tcl_NewStringObj("unknown sqlite3_db_config setting", -1));
|
||||
return TCL_ERROR;
|
||||
}
|
||||
if( Tcl_GetIntFromObj(interp, objv[3], &v) ) return TCL_ERROR;
|
||||
sqlite3_db_config(db, aSetting[i].eVal, v, &v);
|
||||
Tcl_SetObjResult(interp, Tcl_NewIntObj(v));
|
||||
return TCL_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
** Register commands with the TCL interpreter.
|
||||
*/
|
||||
@ -6989,6 +7036,7 @@ int Sqlitetest1_Init(Tcl_Interp *interp){
|
||||
Tcl_ObjCmdProc *xProc;
|
||||
void *clientData;
|
||||
} aObjCmd[] = {
|
||||
{ "sqlite3_db_config", test_sqlite3_db_config, 0 },
|
||||
{ "bad_behavior", test_bad_behavior, (void*)&iZero },
|
||||
{ "register_dbstat_vtab", test_register_dbstat_vtab },
|
||||
{ "sqlite3_connection_pointer", get_sqlite_pointer, 0 },
|
||||
|
564
src/test_bestindex.c
Normal file
@ -0,0 +1,564 @@
|
||||
/*
|
||||
** 2016-03-01
|
||||
**
|
||||
** The author disclaims copyright to this source code. In place of
|
||||
** a legal notice, here is a blessing:
|
||||
**
|
||||
** May you do good and not evil.
|
||||
** May you find forgiveness for yourself and forgive others.
|
||||
** May you share freely, never taking more than you give.
|
||||
**
|
||||
*************************************************************************
|
||||
** Code for testing the virtual table xBestIndex method and the query
|
||||
** planner.
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
** INSTRUCTIONS
|
||||
**
|
||||
** This module exports a single tcl command - [register_tcl_module]. When
|
||||
** invoked, it registers a special virtual table module with a database
|
||||
** connection.
|
||||
**
|
||||
** The virtual table is currently read-only. And always returns zero rows.
|
||||
** It is created with a single argument - the name of a Tcl command - as
|
||||
** follows:
|
||||
**
|
||||
** CREATE VIRTUAL TABLE x1 USING tcl(tcl_command);
|
||||
**
|
||||
** The command [tcl_command] is invoked when the table is first created (or
|
||||
** connected), when the xBestIndex() method is invoked and when the xFilter()
|
||||
** method is called. When it is created (or connected), it is invoked as
|
||||
** follows:
|
||||
**
|
||||
** tcl_command xConnect
|
||||
**
|
||||
** In this case the return value of the script is passed to the
|
||||
** sqlite3_declare_vtab() function to create the virtual table schema.
|
||||
**
|
||||
** When the xBestIndex() method is called by SQLite, the Tcl command is
|
||||
** invoked as:
|
||||
**
|
||||
** tcl_command xBestIndex CONSTRAINTS ORDERBY MASK
|
||||
**
|
||||
** where CONSTRAINTS is a tcl representation of the aConstraints[] array,
|
||||
** ORDERBY is a representation of the contents of the aOrderBy[] array and
|
||||
** MASK is a copy of sqlite3_index_info.colUsed. For example if the virtual
|
||||
** table is declared as:
|
||||
**
|
||||
** CREATE TABLE x1(a, b, c)
|
||||
**
|
||||
** and the query is:
|
||||
**
|
||||
** SELECT * FROM x1 WHERE a=? AND c<? ORDER BY b, c;
|
||||
**
|
||||
** then the Tcl command is:
|
||||
**
|
||||
** tcl_command xBestIndex \
|
||||
** {{op eq column 0 usable 1} {op lt column 2 usable 1}} \
|
||||
** {{column 1 desc 0} {column 2 desc 0}} \
|
||||
** 7
|
||||
**
|
||||
** The return value of the script is a list of key-value pairs used to
|
||||
** populate the output fields of the sqlite3_index_info structure. Possible
|
||||
** keys and the usage of the accompanying values are:
|
||||
**
|
||||
** "orderby" (value of orderByConsumed flag)
|
||||
** "cost" (value of estimatedCost field)
|
||||
** "rows" (value of estimatedRows field)
|
||||
** "use" (index of used constraint in aConstraint[])
|
||||
** "omit" (like "use", but also sets omit flag)
|
||||
** "idxnum" (value of idxNum field)
|
||||
** "idxstr" (value of idxStr field)
|
||||
**
|
||||
** Refer to code below for further details.
|
||||
**
|
||||
** When SQLite calls the xFilter() method, this module invokes the following
|
||||
** Tcl script:
|
||||
**
|
||||
** tcl_command xFilter IDXNUM IDXSTR ARGLIST
|
||||
**
|
||||
** IDXNUM and IDXSTR are the values of the idxNum and idxStr parameters
|
||||
** passed to xFilter. ARGLIST is a Tcl list containing each of the arguments
|
||||
** passed to xFilter in text form.
|
||||
**
|
||||
** As with xBestIndex(), the return value of the script is interpreted as a
|
||||
** list of key-value pairs. There is currently only one key defined - "sql".
|
||||
** The value must be the full text of an SQL statement that returns the data
|
||||
** for the current scan. The leftmost column returned by the SELECT is assumed
|
||||
** to contain the rowid. Other columns must follow, in order from left to
|
||||
** right.
|
||||
*/
|
||||
|
||||
|
||||
#include "sqliteInt.h"
|
||||
#include "tcl.h"
|
||||
|
||||
#ifndef SQLITE_OMIT_VIRTUALTABLE
|
||||
|
||||
typedef struct tcl_vtab tcl_vtab;
|
||||
typedef struct tcl_cursor tcl_cursor;
|
||||
|
||||
/*
|
||||
** A fs virtual-table object
|
||||
*/
|
||||
struct tcl_vtab {
|
||||
sqlite3_vtab base;
|
||||
Tcl_Interp *interp;
|
||||
Tcl_Obj *pCmd;
|
||||
sqlite3 *db;
|
||||
};
|
||||
|
||||
/* A tcl cursor object */
|
||||
struct tcl_cursor {
|
||||
sqlite3_vtab_cursor base;
|
||||
sqlite3_stmt *pStmt; /* Read data from here */
|
||||
};
|
||||
|
||||
/*
|
||||
** This function is the implementation of both the xConnect and xCreate
|
||||
** methods of the fs virtual table.
|
||||
**
|
||||
** The argv[] array contains the following:
|
||||
**
|
||||
** argv[0] -> module name ("fs")
|
||||
** argv[1] -> database name
|
||||
** argv[2] -> table name
|
||||
** argv[...] -> other module argument fields.
|
||||
*/
|
||||
static int tclConnect(
|
||||
sqlite3 *db,
|
||||
void *pAux,
|
||||
int argc, const char *const*argv,
|
||||
sqlite3_vtab **ppVtab,
|
||||
char **pzErr
|
||||
){
|
||||
Tcl_Interp *interp = (Tcl_Interp*)pAux;
|
||||
tcl_vtab *pTab;
|
||||
const char *zCmd;
|
||||
Tcl_Obj *pScript = 0;
|
||||
int rc;
|
||||
|
||||
if( argc!=4 ){
|
||||
*pzErr = sqlite3_mprintf("wrong number of arguments");
|
||||
return SQLITE_ERROR;
|
||||
}
|
||||
zCmd = argv[3];
|
||||
|
||||
pTab = (tcl_vtab*)sqlite3_malloc(sizeof(tcl_vtab));
|
||||
if( pTab==0 ) return SQLITE_NOMEM;
|
||||
memset(pTab, 0, sizeof(tcl_vtab));
|
||||
|
||||
pTab->pCmd = Tcl_NewStringObj(zCmd, -1);
|
||||
pTab->interp = interp;
|
||||
pTab->db = db;
|
||||
Tcl_IncrRefCount(pTab->pCmd);
|
||||
|
||||
pScript = Tcl_DuplicateObj(pTab->pCmd);
|
||||
Tcl_IncrRefCount(pScript);
|
||||
Tcl_ListObjAppendElement(interp, pScript, Tcl_NewStringObj("xConnect", -1));
|
||||
|
||||
rc = Tcl_EvalObjEx(interp, pScript, TCL_EVAL_GLOBAL);
|
||||
if( rc!=TCL_OK ){
|
||||
*pzErr = sqlite3_mprintf("%s", Tcl_GetStringResult(interp));
|
||||
rc = SQLITE_ERROR;
|
||||
}else{
|
||||
rc = sqlite3_declare_vtab(db, Tcl_GetStringResult(interp));
|
||||
}
|
||||
|
||||
if( rc!=SQLITE_OK ){
|
||||
sqlite3_free(pTab);
|
||||
pTab = 0;
|
||||
}
|
||||
|
||||
*ppVtab = &pTab->base;
|
||||
return rc;
|
||||
}
|
||||
|
||||
/* The xDisconnect and xDestroy methods are also the same */
|
||||
static int tclDisconnect(sqlite3_vtab *pVtab){
|
||||
tcl_vtab *pTab = (tcl_vtab*)pVtab;
|
||||
Tcl_DecrRefCount(pTab->pCmd);
|
||||
sqlite3_free(pTab);
|
||||
return SQLITE_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
** Open a new tcl cursor.
|
||||
*/
|
||||
static int tclOpen(sqlite3_vtab *pVTab, sqlite3_vtab_cursor **ppCursor){
|
||||
tcl_cursor *pCur;
|
||||
pCur = sqlite3_malloc(sizeof(tcl_cursor));
|
||||
if( pCur==0 ) return SQLITE_NOMEM;
|
||||
memset(pCur, 0, sizeof(tcl_cursor));
|
||||
*ppCursor = &pCur->base;
|
||||
return SQLITE_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
** Close a tcl cursor.
|
||||
*/
|
||||
static int tclClose(sqlite3_vtab_cursor *cur){
|
||||
tcl_cursor *pCur = (tcl_cursor *)cur;
|
||||
if( pCur ){
|
||||
sqlite3_finalize(pCur->pStmt);
|
||||
sqlite3_free(pCur);
|
||||
}
|
||||
return SQLITE_OK;
|
||||
}
|
||||
|
||||
static int tclNext(sqlite3_vtab_cursor *pVtabCursor){
|
||||
tcl_cursor *pCsr = (tcl_cursor*)pVtabCursor;
|
||||
if( pCsr->pStmt ){
|
||||
tcl_vtab *pTab = (tcl_vtab*)(pVtabCursor->pVtab);
|
||||
int rc = sqlite3_step(pCsr->pStmt);
|
||||
if( rc!=SQLITE_ROW ){
|
||||
const char *zErr;
|
||||
rc = sqlite3_finalize(pCsr->pStmt);
|
||||
pCsr->pStmt = 0;
|
||||
if( rc!=SQLITE_OK ){
|
||||
zErr = sqlite3_errmsg(pTab->db);
|
||||
pTab->base.zErrMsg = sqlite3_mprintf("%s", zErr);
|
||||
}
|
||||
}
|
||||
}
|
||||
return SQLITE_OK;
|
||||
}
|
||||
|
||||
static int tclFilter(
|
||||
sqlite3_vtab_cursor *pVtabCursor,
|
||||
int idxNum, const char *idxStr,
|
||||
int argc, sqlite3_value **argv
|
||||
){
|
||||
tcl_cursor *pCsr = (tcl_cursor*)pVtabCursor;
|
||||
tcl_vtab *pTab = (tcl_vtab*)(pVtabCursor->pVtab);
|
||||
Tcl_Interp *interp = pTab->interp;
|
||||
Tcl_Obj *pScript;
|
||||
Tcl_Obj *pArg;
|
||||
int ii;
|
||||
int rc;
|
||||
|
||||
pScript = Tcl_DuplicateObj(pTab->pCmd);
|
||||
Tcl_IncrRefCount(pScript);
|
||||
Tcl_ListObjAppendElement(interp, pScript, Tcl_NewStringObj("xFilter", -1));
|
||||
Tcl_ListObjAppendElement(interp, pScript, Tcl_NewIntObj(idxNum));
|
||||
if( idxStr ){
|
||||
Tcl_ListObjAppendElement(interp, pScript, Tcl_NewStringObj(idxStr, -1));
|
||||
}else{
|
||||
Tcl_ListObjAppendElement(interp, pScript, Tcl_NewStringObj("", -1));
|
||||
}
|
||||
|
||||
pArg = Tcl_NewObj();
|
||||
Tcl_IncrRefCount(pArg);
|
||||
for(ii=0; ii<argc; ii++){
|
||||
const char *zVal = (const char*)sqlite3_value_text(argv[ii]);
|
||||
Tcl_Obj *pVal;
|
||||
if( zVal==0 ){
|
||||
pVal = Tcl_NewObj();
|
||||
}else{
|
||||
pVal = Tcl_NewStringObj(zVal, -1);
|
||||
}
|
||||
Tcl_ListObjAppendElement(interp, pArg, pVal);
|
||||
}
|
||||
Tcl_ListObjAppendElement(interp, pScript, pArg);
|
||||
Tcl_DecrRefCount(pArg);
|
||||
|
||||
rc = Tcl_EvalObjEx(interp, pScript, TCL_EVAL_GLOBAL);
|
||||
if( rc!=TCL_OK ){
|
||||
const char *zErr = Tcl_GetStringResult(interp);
|
||||
rc = SQLITE_ERROR;
|
||||
pTab->base.zErrMsg = sqlite3_mprintf("%s", zErr);
|
||||
}else{
|
||||
/* Analyze the scripts return value. The return value should be a tcl
|
||||
** list object with an even number of elements. The first element of each
|
||||
** pair must be one of:
|
||||
**
|
||||
** "sql" (SQL statement to return data)
|
||||
*/
|
||||
Tcl_Obj *pRes = Tcl_GetObjResult(interp);
|
||||
Tcl_Obj **apElem = 0;
|
||||
int nElem;
|
||||
rc = Tcl_ListObjGetElements(interp, pRes, &nElem, &apElem);
|
||||
if( rc!=TCL_OK ){
|
||||
const char *zErr = Tcl_GetStringResult(interp);
|
||||
rc = SQLITE_ERROR;
|
||||
pTab->base.zErrMsg = sqlite3_mprintf("%s", zErr);
|
||||
}else{
|
||||
for(ii=0; rc==SQLITE_OK && ii<nElem; ii+=2){
|
||||
const char *zCmd = Tcl_GetString(apElem[ii]);
|
||||
Tcl_Obj *p = apElem[ii+1];
|
||||
if( sqlite3_stricmp("sql", zCmd)==0 ){
|
||||
const char *zSql = Tcl_GetString(p);
|
||||
rc = sqlite3_prepare_v2(pTab->db, zSql, -1, &pCsr->pStmt, 0);
|
||||
if( rc!=SQLITE_OK ){
|
||||
const char *zErr = sqlite3_errmsg(pTab->db);
|
||||
pTab->base.zErrMsg = sqlite3_mprintf("unexpected: %s", zErr);
|
||||
}
|
||||
}else{
|
||||
rc = SQLITE_ERROR;
|
||||
pTab->base.zErrMsg = sqlite3_mprintf("unexpected: %s", zCmd);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if( rc==SQLITE_OK ){
|
||||
rc = tclNext(pVtabCursor);
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
||||
static int tclColumn(
|
||||
sqlite3_vtab_cursor *pVtabCursor,
|
||||
sqlite3_context *ctx,
|
||||
int i
|
||||
){
|
||||
tcl_cursor *pCsr = (tcl_cursor*)pVtabCursor;
|
||||
sqlite3_result_value(ctx, sqlite3_column_value(pCsr->pStmt, i+1));
|
||||
return SQLITE_OK;
|
||||
}
|
||||
|
||||
static int tclRowid(sqlite3_vtab_cursor *pVtabCursor, sqlite_int64 *pRowid){
|
||||
tcl_cursor *pCsr = (tcl_cursor*)pVtabCursor;
|
||||
*pRowid = sqlite3_column_int64(pCsr->pStmt, 0);
|
||||
return SQLITE_OK;
|
||||
}
|
||||
|
||||
static int tclEof(sqlite3_vtab_cursor *pVtabCursor){
|
||||
tcl_cursor *pCsr = (tcl_cursor*)pVtabCursor;
|
||||
return (pCsr->pStmt==0);
|
||||
}
|
||||
|
||||
static int tclBestIndex(sqlite3_vtab *tab, sqlite3_index_info *pIdxInfo){
|
||||
tcl_vtab *pTab = (tcl_vtab*)tab;
|
||||
Tcl_Interp *interp = pTab->interp;
|
||||
Tcl_Obj *pArg;
|
||||
Tcl_Obj *pScript;
|
||||
int ii;
|
||||
int rc = SQLITE_OK;
|
||||
|
||||
pScript = Tcl_DuplicateObj(pTab->pCmd);
|
||||
Tcl_IncrRefCount(pScript);
|
||||
Tcl_ListObjAppendElement(interp, pScript, Tcl_NewStringObj("xBestIndex", -1));
|
||||
|
||||
pArg = Tcl_NewObj();
|
||||
Tcl_IncrRefCount(pArg);
|
||||
for(ii=0; ii<pIdxInfo->nConstraint; ii++){
|
||||
struct sqlite3_index_constraint const *pCons = &pIdxInfo->aConstraint[ii];
|
||||
Tcl_Obj *pElem = Tcl_NewObj();
|
||||
const char *zOp = "?";
|
||||
|
||||
Tcl_IncrRefCount(pElem);
|
||||
|
||||
switch( pCons->op ){
|
||||
case SQLITE_INDEX_CONSTRAINT_EQ:
|
||||
zOp = "eq"; break;
|
||||
case SQLITE_INDEX_CONSTRAINT_GT:
|
||||
zOp = "gt"; break;
|
||||
case SQLITE_INDEX_CONSTRAINT_LE:
|
||||
zOp = "le"; break;
|
||||
case SQLITE_INDEX_CONSTRAINT_LT:
|
||||
zOp = "lt"; break;
|
||||
case SQLITE_INDEX_CONSTRAINT_GE:
|
||||
zOp = "ge"; break;
|
||||
case SQLITE_INDEX_CONSTRAINT_MATCH:
|
||||
zOp = "match"; break;
|
||||
case SQLITE_INDEX_CONSTRAINT_LIKE:
|
||||
zOp = "like"; break;
|
||||
case SQLITE_INDEX_CONSTRAINT_GLOB:
|
||||
zOp = "glob"; break;
|
||||
case SQLITE_INDEX_CONSTRAINT_REGEXP:
|
||||
zOp = "regexp"; break;
|
||||
}
|
||||
|
||||
Tcl_ListObjAppendElement(0, pElem, Tcl_NewStringObj("op", -1));
|
||||
Tcl_ListObjAppendElement(0, pElem, Tcl_NewStringObj(zOp, -1));
|
||||
Tcl_ListObjAppendElement(0, pElem, Tcl_NewStringObj("column", -1));
|
||||
Tcl_ListObjAppendElement(0, pElem, Tcl_NewIntObj(pCons->iColumn));
|
||||
Tcl_ListObjAppendElement(0, pElem, Tcl_NewStringObj("usable", -1));
|
||||
Tcl_ListObjAppendElement(0, pElem, Tcl_NewIntObj(pCons->usable));
|
||||
|
||||
Tcl_ListObjAppendElement(0, pArg, pElem);
|
||||
Tcl_DecrRefCount(pElem);
|
||||
}
|
||||
|
||||
Tcl_ListObjAppendElement(0, pScript, pArg);
|
||||
Tcl_DecrRefCount(pArg);
|
||||
|
||||
pArg = Tcl_NewObj();
|
||||
Tcl_IncrRefCount(pArg);
|
||||
for(ii=0; ii<pIdxInfo->nOrderBy; ii++){
|
||||
struct sqlite3_index_orderby const *pOrder = &pIdxInfo->aOrderBy[ii];
|
||||
Tcl_Obj *pElem = Tcl_NewObj();
|
||||
Tcl_IncrRefCount(pElem);
|
||||
|
||||
Tcl_ListObjAppendElement(0, pElem, Tcl_NewStringObj("column", -1));
|
||||
Tcl_ListObjAppendElement(0, pElem, Tcl_NewIntObj(pOrder->iColumn));
|
||||
Tcl_ListObjAppendElement(0, pElem, Tcl_NewStringObj("desc", -1));
|
||||
Tcl_ListObjAppendElement(0, pElem, Tcl_NewIntObj(pOrder->desc));
|
||||
|
||||
Tcl_ListObjAppendElement(0, pArg, pElem);
|
||||
Tcl_DecrRefCount(pElem);
|
||||
}
|
||||
|
||||
Tcl_ListObjAppendElement(0, pScript, pArg);
|
||||
Tcl_DecrRefCount(pArg);
|
||||
|
||||
Tcl_ListObjAppendElement(0, pScript, Tcl_NewWideIntObj(pIdxInfo->colUsed));
|
||||
|
||||
rc = Tcl_EvalObjEx(interp, pScript, TCL_EVAL_GLOBAL);
|
||||
Tcl_DecrRefCount(pScript);
|
||||
if( rc!=TCL_OK ){
|
||||
const char *zErr = Tcl_GetStringResult(interp);
|
||||
rc = SQLITE_ERROR;
|
||||
pTab->base.zErrMsg = sqlite3_mprintf("%s", zErr);
|
||||
}else{
|
||||
/* Analyze the scripts return value. The return value should be a tcl
|
||||
** list object with an even number of elements. The first element of each
|
||||
** pair must be one of:
|
||||
**
|
||||
** "orderby" (value of orderByConsumed flag)
|
||||
** "cost" (value of estimatedCost field)
|
||||
** "rows" (value of estimatedRows field)
|
||||
** "use" (index of used constraint in aConstraint[])
|
||||
** "idxnum" (value of idxNum field)
|
||||
** "idxstr" (value of idxStr field)
|
||||
** "omit" (index of omitted constraint in aConstraint[])
|
||||
*/
|
||||
Tcl_Obj *pRes = Tcl_GetObjResult(interp);
|
||||
Tcl_Obj **apElem = 0;
|
||||
int nElem;
|
||||
rc = Tcl_ListObjGetElements(interp, pRes, &nElem, &apElem);
|
||||
if( rc!=TCL_OK ){
|
||||
const char *zErr = Tcl_GetStringResult(interp);
|
||||
rc = SQLITE_ERROR;
|
||||
pTab->base.zErrMsg = sqlite3_mprintf("%s", zErr);
|
||||
}else{
|
||||
int iArgv = 1;
|
||||
for(ii=0; rc==SQLITE_OK && ii<nElem; ii+=2){
|
||||
const char *zCmd = Tcl_GetString(apElem[ii]);
|
||||
Tcl_Obj *p = apElem[ii+1];
|
||||
if( sqlite3_stricmp("cost", zCmd)==0 ){
|
||||
rc = Tcl_GetDoubleFromObj(interp, p, &pIdxInfo->estimatedCost);
|
||||
}else
|
||||
if( sqlite3_stricmp("orderby", zCmd)==0 ){
|
||||
rc = Tcl_GetIntFromObj(interp, p, &pIdxInfo->orderByConsumed);
|
||||
}else
|
||||
if( sqlite3_stricmp("idxnum", zCmd)==0 ){
|
||||
rc = Tcl_GetIntFromObj(interp, p, &pIdxInfo->idxNum);
|
||||
}else
|
||||
if( sqlite3_stricmp("idxstr", zCmd)==0 ){
|
||||
sqlite3_free(pIdxInfo->idxStr);
|
||||
pIdxInfo->idxStr = sqlite3_mprintf("%s", Tcl_GetString(p));
|
||||
pIdxInfo->needToFreeIdxStr = 1;
|
||||
}else
|
||||
if( sqlite3_stricmp("rows", zCmd)==0 ){
|
||||
rc = Tcl_GetWideIntFromObj(interp, p, &pIdxInfo->estimatedRows);
|
||||
}else
|
||||
if( sqlite3_stricmp("use", zCmd)==0
|
||||
|| sqlite3_stricmp("omit", zCmd)==0
|
||||
){
|
||||
int iCons;
|
||||
rc = Tcl_GetIntFromObj(interp, p, &iCons);
|
||||
if( rc==SQLITE_OK ){
|
||||
if( iCons<0 || iCons>=pIdxInfo->nConstraint ){
|
||||
rc = SQLITE_ERROR;
|
||||
pTab->base.zErrMsg = sqlite3_mprintf("unexpected: %d", iCons);
|
||||
}else{
|
||||
int bOmit = (zCmd[0]=='o' || zCmd[0]=='O');
|
||||
pIdxInfo->aConstraintUsage[iCons].argvIndex = iArgv++;
|
||||
pIdxInfo->aConstraintUsage[iCons].omit = bOmit;
|
||||
}
|
||||
}
|
||||
}else{
|
||||
rc = SQLITE_ERROR;
|
||||
pTab->base.zErrMsg = sqlite3_mprintf("unexpected: %s", zCmd);
|
||||
}
|
||||
if( rc!=SQLITE_OK && pTab->base.zErrMsg==0 ){
|
||||
const char *zErr = Tcl_GetStringResult(interp);
|
||||
pTab->base.zErrMsg = sqlite3_mprintf("%s", zErr);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
/*
|
||||
** A virtual table module that provides read-only access to a
|
||||
** Tcl global variable namespace.
|
||||
*/
|
||||
static sqlite3_module tclModule = {
|
||||
0, /* iVersion */
|
||||
tclConnect,
|
||||
tclConnect,
|
||||
tclBestIndex,
|
||||
tclDisconnect,
|
||||
tclDisconnect,
|
||||
tclOpen, /* xOpen - open a cursor */
|
||||
tclClose, /* xClose - close a cursor */
|
||||
tclFilter, /* xFilter - configure scan constraints */
|
||||
tclNext, /* xNext - advance a cursor */
|
||||
tclEof, /* xEof - check for end of scan */
|
||||
tclColumn, /* xColumn - read data */
|
||||
tclRowid, /* xRowid - read data */
|
||||
0, /* xUpdate */
|
||||
0, /* xBegin */
|
||||
0, /* xSync */
|
||||
0, /* xCommit */
|
||||
0, /* xRollback */
|
||||
0, /* xFindMethod */
|
||||
0, /* xRename */
|
||||
};
|
||||
|
||||
/*
|
||||
** Decode a pointer to an sqlite3 object.
|
||||
*/
|
||||
extern int getDbPointer(Tcl_Interp *interp, const char *zA, sqlite3 **ppDb);
|
||||
|
||||
/*
|
||||
** Register the echo virtual table module.
|
||||
*/
|
||||
static int register_tcl_module(
|
||||
ClientData clientData, /* Pointer to sqlite3_enable_XXX function */
|
||||
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
|
||||
int objc, /* Number of arguments */
|
||||
Tcl_Obj *CONST objv[] /* Command arguments */
|
||||
){
|
||||
sqlite3 *db;
|
||||
if( objc!=2 ){
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "DB");
|
||||
return TCL_ERROR;
|
||||
}
|
||||
if( getDbPointer(interp, Tcl_GetString(objv[1]), &db) ) return TCL_ERROR;
|
||||
#ifndef SQLITE_OMIT_VIRTUALTABLE
|
||||
sqlite3_create_module(db, "tcl", &tclModule, (void *)interp);
|
||||
#endif
|
||||
return TCL_OK;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
** Register commands with the TCL interpreter.
|
||||
*/
|
||||
int Sqlitetesttcl_Init(Tcl_Interp *interp){
|
||||
#ifndef SQLITE_OMIT_VIRTUALTABLE
|
||||
static struct {
|
||||
char *zName;
|
||||
Tcl_ObjCmdProc *xProc;
|
||||
void *clientData;
|
||||
} aObjCmd[] = {
|
||||
{ "register_tcl_module", register_tcl_module, 0 },
|
||||
};
|
||||
int i;
|
||||
for(i=0; i<sizeof(aObjCmd)/sizeof(aObjCmd[0]); i++){
|
||||
Tcl_CreateObjCommand(interp, aObjCmd[i].zName,
|
||||
aObjCmd[i].xProc, aObjCmd[i].clientData, 0);
|
||||
}
|
||||
#endif
|
||||
return TCL_OK;
|
||||
}
|
@ -376,12 +376,6 @@ static void set_options(Tcl_Interp *interp){
|
||||
Tcl_SetVar2(interp, "sqlite_options", "fts3", "0", TCL_GLOBAL_ONLY);
|
||||
#endif
|
||||
|
||||
#ifdef SQLITE_ENABLE_FTS3_TOKENIZER
|
||||
Tcl_SetVar2(interp, "sqlite_options", "fts3_tokenizer", "1", TCL_GLOBAL_ONLY);
|
||||
#else
|
||||
Tcl_SetVar2(interp, "sqlite_options", "fts3_tokenizer", "0", TCL_GLOBAL_ONLY);
|
||||
#endif
|
||||
|
||||
#ifdef SQLITE_ENABLE_FTS5
|
||||
Tcl_SetVar2(interp, "sqlite_options", "fts5", "1", TCL_GLOBAL_ONLY);
|
||||
#else
|
||||
|
@ -339,6 +339,12 @@ void sqlite3TreeViewExpr(TreeView *pView, const Expr *pExpr, u8 moreToFollow){
|
||||
case TK_ISNULL: zUniOp = "ISNULL"; break;
|
||||
case TK_NOTNULL: zUniOp = "NOTNULL"; break;
|
||||
|
||||
case TK_SPAN: {
|
||||
sqlite3TreeViewLine(pView, "SPAN %Q", pExpr->u.zToken);
|
||||
sqlite3TreeViewExpr(pView, pExpr->pLeft, 0);
|
||||
break;
|
||||
}
|
||||
|
||||
case TK_COLLATE: {
|
||||
sqlite3TreeViewLine(pView, "COLLATE %Q", pExpr->u.zToken);
|
||||
sqlite3TreeViewExpr(pView, pExpr->pLeft, 0);
|
||||
|
15
src/util.c
@ -109,6 +109,14 @@ int sqlite3Strlen30(const char *z){
|
||||
return 0x3fffffff & (int)strlen(z);
|
||||
}
|
||||
|
||||
/*
|
||||
** The string z[] is followed immediately by another string. Return
|
||||
** a poiner to that other string.
|
||||
*/
|
||||
const char *sqlite3StrNext(const char *z){
|
||||
return z + strlen(z) + 1;
|
||||
}
|
||||
|
||||
/*
|
||||
** Set the current error code to err_code and clear any prior error message.
|
||||
*/
|
||||
@ -1400,8 +1408,14 @@ LogEst sqlite3LogEstFromDouble(double x){
|
||||
}
|
||||
#endif /* SQLITE_OMIT_VIRTUALTABLE */
|
||||
|
||||
#if defined(SQLITE_ENABLE_STMT_SCANSTAT) || \
|
||||
defined(SQLITE_ENABLE_STAT3_OR_STAT4) || \
|
||||
defined(SQLITE_EXPLAIN_ESTIMATED_ROWS)
|
||||
/*
|
||||
** Convert a LogEst into an integer.
|
||||
**
|
||||
** Note that this routine is only used when one or more of various
|
||||
** non-standard compile-time options is enabled.
|
||||
*/
|
||||
u64 sqlite3LogEstToInt(LogEst x){
|
||||
u64 n;
|
||||
@ -1415,3 +1429,4 @@ u64 sqlite3LogEstToInt(LogEst x){
|
||||
}
|
||||
return (n+8)>>(3-x);
|
||||
}
|
||||
#endif /* defined SCANSTAT or STAT4 or ESTIMATED_ROWS */
|
||||
|
@ -87,7 +87,7 @@ struct VdbeCursor {
|
||||
#endif
|
||||
Bool isEphemeral:1; /* True for an ephemeral table */
|
||||
Bool useRandomRowid:1;/* Generate new record numbers semi-randomly */
|
||||
Bool isOrdered:1; /* True if the underlying table is BTREE_UNORDERED */
|
||||
Bool isOrdered:1; /* True if the table is not BTREE_UNORDERED */
|
||||
Pgno pgnoRoot; /* Root page of the open btree cursor */
|
||||
i16 nField; /* Number of fields in the header */
|
||||
u16 nHdrParsed; /* Number of header fields parsed so far */
|
||||
|
@ -1281,7 +1281,7 @@ static int valueFromExpr(
|
||||
*ppVal = 0;
|
||||
return SQLITE_OK;
|
||||
}
|
||||
while( (op = pExpr->op)==TK_UPLUS ) pExpr = pExpr->pLeft;
|
||||
while( (op = pExpr->op)==TK_UPLUS || op==TK_SPAN ) pExpr = pExpr->pLeft;
|
||||
if( NEVER(op==TK_REGISTER) ) op = pExpr->op2;
|
||||
|
||||
/* Compressed expressions only appear when parsing the DEFAULT clause
|
||||
|
@ -564,10 +564,10 @@ static int vtabCallConstructor(
|
||||
pTab->pVTable = pVTable;
|
||||
|
||||
for(iCol=0; iCol<pTab->nCol; iCol++){
|
||||
char *zType = pTab->aCol[iCol].zType;
|
||||
char *zType = (char*)sqlite3StrNext(pTab->aCol[iCol].zName);
|
||||
int nType;
|
||||
int i = 0;
|
||||
if( !zType ){
|
||||
if( !zType[0] ){
|
||||
pTab->tabFlags |= oooHidden;
|
||||
continue;
|
||||
}
|
||||
|
15
src/where.c
@ -1561,7 +1561,8 @@ static int whereEqualScanEst(
|
||||
pBuilder->nRecValid = nEq;
|
||||
|
||||
whereKeyStats(pParse, p, pRec, 0, a);
|
||||
WHERETRACE(0x10,("equality scan regions: %d\n", (int)a[1]));
|
||||
WHERETRACE(0x10,("equality scan regions %s(%d): %d\n",
|
||||
p->zName, nEq-1, (int)a[1]));
|
||||
*pnRow = a[1];
|
||||
|
||||
return rc;
|
||||
@ -2897,13 +2898,6 @@ static int whereLoopAddVirtual(
|
||||
testcase( iTerm==16 );
|
||||
if( iTerm<16 && pUsage[i].omit ) pNew->u.vtab.omitMask |= 1<<iTerm;
|
||||
if( (pTerm->eOperator & WO_IN)!=0 ){
|
||||
if( pUsage[i].omit==0 ){
|
||||
/* Do not attempt to use an IN constraint if the virtual table
|
||||
** says that the equivalent EQ constraint cannot be safely omitted.
|
||||
** If we do attempt to use such a constraint, some rows might be
|
||||
** repeated in the output. */
|
||||
break;
|
||||
}
|
||||
/* A virtual table that is constrained by an IN clause may not
|
||||
** consume the ORDER BY clause because (1) the order of IN terms
|
||||
** is not necessarily related to the order of output terms and
|
||||
@ -3463,9 +3457,8 @@ static LogEst whereSortingCost(
|
||||
|
||||
/* Multiple by log(M) where M is the number of output rows.
|
||||
** Use the LIMIT for M if it is smaller */
|
||||
if( (pWInfo->wctrlFlags & WHERE_USE_LIMIT)!=0 ){
|
||||
LogEst m = sqlite3LogEst(pWInfo->iLimit);
|
||||
if( m<nRow ) nRow = m;
|
||||
if( (pWInfo->wctrlFlags & WHERE_USE_LIMIT)!=0 && pWInfo->iLimit<nRow ){
|
||||
nRow = pWInfo->iLimit;
|
||||
}
|
||||
rSortCost += estLog(nRow);
|
||||
return rSortCost;
|
||||
|
@ -874,6 +874,7 @@ Bitmask sqlite3WhereCodeOneLoopStart(
|
||||
int iReg; /* P3 Value for OP_VFilter */
|
||||
int addrNotFound;
|
||||
int nConstraint = pLoop->nLTerm;
|
||||
int iIn; /* Counter for IN constraints */
|
||||
|
||||
sqlite3ExprCachePush(pParse);
|
||||
iReg = sqlite3GetTempRange(pParse, nConstraint+2);
|
||||
@ -896,14 +897,48 @@ Bitmask sqlite3WhereCodeOneLoopStart(
|
||||
pLoop->u.vtab.needFree ? P4_MPRINTF : P4_STATIC);
|
||||
VdbeCoverage(v);
|
||||
pLoop->u.vtab.needFree = 0;
|
||||
for(j=0; j<nConstraint && j<16; j++){
|
||||
if( (pLoop->u.vtab.omitMask>>j)&1 ){
|
||||
disableTerm(pLevel, pLoop->aLTerm[j]);
|
||||
}
|
||||
}
|
||||
pLevel->p1 = iCur;
|
||||
pLevel->op = pWInfo->eOnePass ? OP_Noop : OP_VNext;
|
||||
pLevel->p2 = sqlite3VdbeCurrentAddr(v);
|
||||
iIn = pLevel->u.in.nIn;
|
||||
for(j=nConstraint-1; j>=0; j--){
|
||||
pTerm = pLoop->aLTerm[j];
|
||||
if( j<16 && (pLoop->u.vtab.omitMask>>j)&1 ){
|
||||
disableTerm(pLevel, pTerm);
|
||||
}else if( (pTerm->eOperator & WO_IN)!=0 ){
|
||||
Expr *pCompare; /* The comparison operator */
|
||||
Expr *pRight; /* RHS of the comparison */
|
||||
VdbeOp *pOp; /* Opcode to access the value of the IN constraint */
|
||||
|
||||
/* Reload the constraint value into reg[iReg+j+2]. The same value
|
||||
** was loaded into the same register prior to the OP_VFilter, but
|
||||
** the xFilter implementation might have changed the datatype or
|
||||
** encoding of the value in the register, so it *must* be reloaded. */
|
||||
assert( pLevel->u.in.aInLoop!=0 || db->mallocFailed );
|
||||
if( pLevel->u.in.aInLoop!=0 ){
|
||||
assert( iIn>0 );
|
||||
pOp = sqlite3VdbeGetOp(v, pLevel->u.in.aInLoop[--iIn].addrInTop);
|
||||
assert( pOp->opcode==OP_Column || pOp->opcode==OP_Rowid );
|
||||
assert( pOp->opcode!=OP_Column || pOp->p3==iReg+j+2 );
|
||||
assert( pOp->opcode!=OP_Rowid || pOp->p2==iReg+j+2 );
|
||||
testcase( pOp->opcode==OP_Rowid );
|
||||
sqlite3VdbeAddOp3(v, pOp->opcode, pOp->p1, pOp->p2, pOp->p3);
|
||||
}
|
||||
|
||||
/* Generate code that will continue to the next row if
|
||||
** the IN constraint is not satisfied */
|
||||
pCompare = sqlite3PExpr(pParse, TK_EQ, 0, 0, 0);
|
||||
assert( pCompare!=0 || db->mallocFailed );
|
||||
if( pCompare ){
|
||||
pCompare->pLeft = pTerm->pExpr->pLeft;
|
||||
pCompare->pRight = pRight = sqlite3Expr(db, TK_REGISTER, 0);
|
||||
if( pRight ) pRight->iTable = iReg+j+2;
|
||||
sqlite3ExprIfFalse(pParse, pCompare, pLevel->addrCont, 0);
|
||||
pCompare->pLeft = 0;
|
||||
sqlite3ExprDelete(db, pCompare);
|
||||
}
|
||||
}
|
||||
}
|
||||
sqlite3ReleaseTempRange(pParse, iReg, nConstraint+2);
|
||||
sqlite3ExprCachePop(pParse);
|
||||
}else
|
||||
|
@ -1180,7 +1180,7 @@ do_execsql_test 26.1.3 {
|
||||
#
|
||||
# There should be no other samples that start with (x=10000). So it knows
|
||||
# that (x=10000 AND y<50) must match somewhere between 0 and 99 rows, but
|
||||
# know more than that. Guessing less than 20 is therefore unreasonable.
|
||||
# no more than that. Guessing less than 20 is therefore unreasonable.
|
||||
#
|
||||
# At one point though, due to a problem in whereKeyStats(), the planner was
|
||||
# estimating that (x=10000 AND y<50) would match only 2 rows.
|
||||
|
@ -1,4 +1,4 @@
|
||||
# 2005 July 22
|
||||
# 2014-10-04
|
||||
#
|
||||
# The author disclaims copyright to this source code. In place of
|
||||
# a legal notice, here is a blessing:
|
||||
@ -11,7 +11,6 @@
|
||||
# This file implements regression tests for SQLite library.
|
||||
# This file implements tests for the ANALYZE command.
|
||||
#
|
||||
# $Id: analyze.test,v 1.9 2008/08/11 18:44:58 drh Exp $
|
||||
|
||||
set testdir [file dirname $argv0]
|
||||
source $testdir/tester.tcl
|
||||
@ -75,7 +74,7 @@ do_test 1.3 {
|
||||
} {}
|
||||
|
||||
# Without stat1, because 3001 is larger than all samples in the stat4
|
||||
# table, SQLite things that a=3001 matches just 1 row. So it (incorrectly)
|
||||
# table, SQLite thinks that a=3001 matches just 1 row. So it (incorrectly)
|
||||
# chooses it over the c=150 index (5 rows). Even with stat1 data, things
|
||||
# worked this way before commit [e6f7f97dbc].
|
||||
#
|
||||
|
165
test/bestindex1.test
Normal file
@ -0,0 +1,165 @@
|
||||
# 2016-03-01
|
||||
#
|
||||
# The author disclaims copyright to this source code. In place of
|
||||
# a legal notice, here is a blessing:
|
||||
#
|
||||
# May you do good and not evil.
|
||||
# May you find forgiveness for yourself and forgive others.
|
||||
# May you share freely, never taking more than you give.
|
||||
#
|
||||
#***********************************************************************
|
||||
#
|
||||
#
|
||||
|
||||
set testdir [file dirname $argv0]
|
||||
source $testdir/tester.tcl
|
||||
set testprefix bestindex1
|
||||
|
||||
register_tcl_module db
|
||||
|
||||
proc vtab_command {method args} {
|
||||
switch -- $method {
|
||||
xConnect {
|
||||
return "CREATE TABLE t1(a, b, c)"
|
||||
}
|
||||
|
||||
xBestIndex {
|
||||
set clist [lindex $args 0]
|
||||
if {[llength $clist]!=1} { error "unexpected constraint list" }
|
||||
catch { array unset C }
|
||||
array set C [lindex $clist 0]
|
||||
if {$C(usable)} {
|
||||
return "omit 0 cost 0 rows 1 idxnum 555 idxstr eq!"
|
||||
} else {
|
||||
return "cost 1000000 rows 0 idxnum 0 idxstr scan..."
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return {}
|
||||
}
|
||||
|
||||
do_execsql_test 1.0 {
|
||||
CREATE VIRTUAL TABLE x1 USING tcl(vtab_command);
|
||||
} {}
|
||||
|
||||
do_eqp_test 1.1 {
|
||||
SELECT * FROM x1 WHERE a = 'abc'
|
||||
} {
|
||||
0 0 0 {SCAN TABLE x1 VIRTUAL TABLE INDEX 555:eq!}
|
||||
}
|
||||
|
||||
do_eqp_test 1.2 {
|
||||
SELECT * FROM x1 WHERE a IN ('abc', 'def');
|
||||
} {
|
||||
0 0 0 {SCAN TABLE x1 VIRTUAL TABLE INDEX 555:eq!}
|
||||
0 0 0 {EXECUTE LIST SUBQUERY 1}
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
reset_db
|
||||
register_tcl_module db
|
||||
|
||||
# Parameter $mode may be one of:
|
||||
#
|
||||
# "omit" - Implement filtering. Set the omit flag.
|
||||
# "use" - Implement filtering. Use the constraint, but do not set omit.
|
||||
# "use2" - Do not implement filtering. Use the constraint anyway.
|
||||
#
|
||||
#
|
||||
proc t1_vtab {mode method args} {
|
||||
switch -- $method {
|
||||
xConnect {
|
||||
return "CREATE TABLE t1(a, b)"
|
||||
}
|
||||
|
||||
xBestIndex {
|
||||
set SQL_FILTER {SELECT * FROM t1x WHERE a='%1%'}
|
||||
set SQL_SCAN {SELECT * FROM t1x}
|
||||
|
||||
set clist [lindex $args 0]
|
||||
set idx 0
|
||||
for {set idx 0} {$idx < [llength $clist]} {incr idx} {
|
||||
array unset C
|
||||
array set C [lindex $clist $idx]
|
||||
if {$C(column)==0 && $C(op)=="eq" && $C(usable)} {
|
||||
switch -- $mode {
|
||||
"omit" {
|
||||
return [list omit $idx rows 10 cost 10 idxstr $SQL_FILTER]
|
||||
}
|
||||
"use" {
|
||||
return [list use $idx rows 10 cost 10 idxstr $SQL_FILTER]
|
||||
}
|
||||
"use2" {
|
||||
return [list use $idx rows 10 cost 10 idxstr $SQL_SCAN]
|
||||
}
|
||||
default {
|
||||
error "Bad mode - $mode"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return [list idxstr {SELECT * FROM t1x}]
|
||||
}
|
||||
|
||||
xFilter {
|
||||
set map [list %1% [lindex $args 2 0]]
|
||||
set sql [string map $map [lindex $args 1]]
|
||||
return [list sql $sql]
|
||||
}
|
||||
}
|
||||
|
||||
return {}
|
||||
}
|
||||
|
||||
do_execsql_test 2.1 {
|
||||
CREATE TABLE t1x(i INTEGER PRIMARY KEY, a, b);
|
||||
INSERT INTO t1x VALUES(1, 'one', 1);
|
||||
INSERT INTO t1x VALUES(2, 'two', 2);
|
||||
INSERT INTO t1x VALUES(3, 'three', 3);
|
||||
INSERT INTO t1x VALUES(4, 'four', 4);
|
||||
}
|
||||
|
||||
foreach {tn mode} {
|
||||
1 use 2 omit 3 use2
|
||||
} {
|
||||
do_execsql_test 2.2.$mode.1 "
|
||||
DROP TABLE IF EXISTS t1;
|
||||
CREATE VIRTUAL TABLE t1 USING tcl(t1_vtab $mode);
|
||||
"
|
||||
|
||||
do_execsql_test 2.2.$mode.2 {SELECT * FROM t1} {one 1 two 2 three 3 four 4}
|
||||
do_execsql_test 2.2.$mode.3 {SELECT rowid FROM t1} {1 2 3 4}
|
||||
do_execsql_test 2.2.$mode.4 {SELECT rowid FROM t1 WHERE a='two'} {2}
|
||||
|
||||
do_execsql_test 2.2.$mode.5 {
|
||||
SELECT rowid FROM t1 WHERE a IN ('one', 'four') ORDER BY +rowid
|
||||
} {1 4}
|
||||
|
||||
set plan(use) {
|
||||
0 0 0 {SCAN TABLE t1 VIRTUAL TABLE INDEX 0:SELECT * FROM t1x WHERE a='%1%'}
|
||||
0 0 0 {EXECUTE LIST SUBQUERY 1}
|
||||
0 0 0 {USE TEMP B-TREE FOR ORDER BY}
|
||||
}
|
||||
set plan(omit) {
|
||||
0 0 0 {SCAN TABLE t1 VIRTUAL TABLE INDEX 0:SELECT * FROM t1x WHERE a='%1%'}
|
||||
0 0 0 {EXECUTE LIST SUBQUERY 1}
|
||||
0 0 0 {USE TEMP B-TREE FOR ORDER BY}
|
||||
}
|
||||
set plan(use2) {
|
||||
0 0 0 {SCAN TABLE t1 VIRTUAL TABLE INDEX 0:SELECT * FROM t1x}
|
||||
0 0 0 {EXECUTE LIST SUBQUERY 1}
|
||||
0 0 0 {USE TEMP B-TREE FOR ORDER BY}
|
||||
}
|
||||
|
||||
do_eqp_test 2.2.$mode.6 {
|
||||
SELECT rowid FROM t1 WHERE a IN ('one', 'four') ORDER BY +rowid
|
||||
} $plan($mode)
|
||||
}
|
||||
|
||||
finish_test
|
||||
|
||||
|
@ -285,15 +285,17 @@ do_test conflict-6.0 {
|
||||
# t3 Number of temporary files for tables
|
||||
# t4 Number of temporary files for statement journals
|
||||
#
|
||||
# Update: Since temporary table files are now opened lazily, and none
|
||||
# of the following tests use large quantities of data, t3 is always 0.
|
||||
# Update (2007-08-21): Since temporary table files are now opened lazily,
|
||||
# and none of the following tests use large quantities of data, t3 is always 0.
|
||||
#
|
||||
# Update (2016-03-04): Subjournals now also open lazily, so t4 is also always 0.
|
||||
#
|
||||
foreach {i conf1 cmd t0 t1 t2 t3 t4} {
|
||||
1 {} UPDATE 1 {6 7 8 9} 1 0 1
|
||||
1 {} UPDATE 1 {6 7 8 9} 1 0 0
|
||||
2 REPLACE UPDATE 0 {7 6 9} 1 0 0
|
||||
3 IGNORE UPDATE 0 {6 7 3 9} 1 0 0
|
||||
4 FAIL UPDATE 1 {6 7 3 4} 1 0 0
|
||||
5 ABORT UPDATE 1 {1 2 3 4} 1 0 1
|
||||
5 ABORT UPDATE 1 {1 2 3 4} 1 0 0
|
||||
6 ROLLBACK UPDATE 1 {1 2 3 4} 0 0 0
|
||||
7 REPLACE {UPDATE OR IGNORE} 0 {6 7 3 9} 1 0 0
|
||||
8 IGNORE {UPDATE OR REPLACE} 0 {7 6 9} 1 0 0
|
||||
@ -303,7 +305,7 @@ foreach {i conf1 cmd t0 t1 t2 t3 t4} {
|
||||
12 {} {UPDATE OR IGNORE} 0 {6 7 3 9} 1 0 0
|
||||
13 {} {UPDATE OR REPLACE} 0 {7 6 9} 1 0 0
|
||||
14 {} {UPDATE OR FAIL} 1 {6 7 3 4} 1 0 0
|
||||
15 {} {UPDATE OR ABORT} 1 {1 2 3 4} 1 0 1
|
||||
15 {} {UPDATE OR ABORT} 1 {1 2 3 4} 1 0 0
|
||||
16 {} {UPDATE OR ROLLBACK} 1 {1 2 3 4} 0 0 0
|
||||
} {
|
||||
if {$t0} {set t1 {UNIQUE constraint failed: t1.a}}
|
||||
|
@ -287,22 +287,25 @@ do_test conflict2-6.0 {
|
||||
# Update: Since temporary table files are now opened lazily, and none
|
||||
# of the following tests use large quantities of data, t3 is always 0.
|
||||
#
|
||||
# Update (2016-03-04): Subjournals now only open when their size
|
||||
# exceeds 64KB.
|
||||
#
|
||||
foreach {i conf1 cmd t0 t1 t2 t3 t4} {
|
||||
1 {} UPDATE 1 {6 7 8 9} 1 0 1
|
||||
2 REPLACE UPDATE 0 {7 6 9} 1 0 1
|
||||
3 IGNORE UPDATE 0 {6 7 3 9} 1 0 1
|
||||
4 FAIL UPDATE 1 {6 7 3 4} 1 0 1
|
||||
5 ABORT UPDATE 1 {1 2 3 4} 1 0 1
|
||||
6 ROLLBACK UPDATE 1 {1 2 3 4} 0 0 1
|
||||
1 {} UPDATE 1 {6 7 8 9} 1 0 0
|
||||
2 REPLACE UPDATE 0 {7 6 9} 1 0 0
|
||||
3 IGNORE UPDATE 0 {6 7 3 9} 1 0 0
|
||||
4 FAIL UPDATE 1 {6 7 3 4} 1 0 0
|
||||
5 ABORT UPDATE 1 {1 2 3 4} 1 0 0
|
||||
6 ROLLBACK UPDATE 1 {1 2 3 4} 0 0 0
|
||||
7 REPLACE {UPDATE OR IGNORE} 0 {6 7 3 9} 1 0 0
|
||||
8 IGNORE {UPDATE OR REPLACE} 0 {7 6 9} 1 0 1
|
||||
8 IGNORE {UPDATE OR REPLACE} 0 {7 6 9} 1 0 0
|
||||
9 FAIL {UPDATE OR IGNORE} 0 {6 7 3 9} 1 0 0
|
||||
10 ABORT {UPDATE OR REPLACE} 0 {7 6 9} 1 0 1
|
||||
10 ABORT {UPDATE OR REPLACE} 0 {7 6 9} 1 0 0
|
||||
11 ROLLBACK {UPDATE OR IGNORE} 0 {6 7 3 9} 1 0 0
|
||||
12 {} {UPDATE OR IGNORE} 0 {6 7 3 9} 1 0 0
|
||||
13 {} {UPDATE OR REPLACE} 0 {7 6 9} 1 0 1
|
||||
13 {} {UPDATE OR REPLACE} 0 {7 6 9} 1 0 0
|
||||
14 {} {UPDATE OR FAIL} 1 {6 7 3 4} 1 0 0
|
||||
15 {} {UPDATE OR ABORT} 1 {1 2 3 4} 1 0 1
|
||||
15 {} {UPDATE OR ABORT} 1 {1 2 3 4} 1 0 0
|
||||
16 {} {UPDATE OR ROLLBACK} 1 {1 2 3 4} 0 0 0
|
||||
} {
|
||||
|
||||
|
@ -161,10 +161,10 @@ do_test 5.2 {
|
||||
|
||||
|
||||
|
||||
# EVIDENCE-OF: R-42842-27162 Note that the sqlite3_wal_autocheckpoint()
|
||||
# EVIDENCE-OF: R-57445-43425 Note that the sqlite3_wal_autocheckpoint()
|
||||
# interface and the wal_autocheckpoint pragma both invoke
|
||||
# sqlite3_wal_hook() and will those overwrite any prior
|
||||
# sqlite3_wal_hook() settings.
|
||||
# sqlite3_wal_hook() and will overwrite any prior sqlite3_wal_hook()
|
||||
# settings.
|
||||
#
|
||||
set ::old_wal_hook 0
|
||||
proc my_old_wal_hook {args} { incr ::old_wal_hook ; return 0 }
|
||||
|
@ -420,9 +420,10 @@ do_test exclusive-5.0 {
|
||||
} {}
|
||||
do_test exclusive-5.1 {
|
||||
# Three files are open: The db, journal and statement-journal.
|
||||
# (2016-03-04) The statement-journal is now opened lazily
|
||||
set sqlite_open_file_count
|
||||
expr $sqlite_open_file_count-$extrafds
|
||||
} [expr 3 - ($TEMP_STORE>=2)]
|
||||
} [expr 2 - ($TEMP_STORE>=2)]
|
||||
do_test exclusive-5.2 {
|
||||
execsql {
|
||||
COMMIT;
|
||||
@ -446,17 +447,19 @@ do_test exclusive-5.4 {
|
||||
INSERT INTO abc SELECT a+10, b+10, c+10 FROM abc;
|
||||
}
|
||||
# Three files are open: The db, journal and statement-journal.
|
||||
# 2016-03-04: The statement-journal open is deferred
|
||||
set sqlite_open_file_count
|
||||
expr $sqlite_open_file_count-$extrafds
|
||||
} [expr 3 - ($TEMP_STORE>=2)]
|
||||
} [expr 2 - ($TEMP_STORE>=2)]
|
||||
do_test exclusive-5.5 {
|
||||
execsql {
|
||||
COMMIT;
|
||||
}
|
||||
# Three files are still open: The db, journal and statement-journal.
|
||||
# 2016-03-04: The statement-journal open is deferred
|
||||
set sqlite_open_file_count
|
||||
expr $sqlite_open_file_count-$extrafds
|
||||
} [expr 3 - ($TEMP_STORE>=2)]
|
||||
} [expr 2 - ($TEMP_STORE>=2)]
|
||||
do_test exclusive-5.6 {
|
||||
execsql {
|
||||
PRAGMA locking_mode = normal;
|
||||
|
@ -56,40 +56,41 @@ proc escape_string {str} {
|
||||
#
|
||||
# 5: Test that the table created to use tokenizer 'blah' is usable.
|
||||
#
|
||||
ifcapable fts3_tokenizer {
|
||||
do_test fts3atoken-1.1 {
|
||||
catchsql {
|
||||
CREATE VIRTUAL TABLE t1 USING fts3(content, tokenize blah);
|
||||
}
|
||||
} {1 {unknown tokenizer: blah}}
|
||||
do_test fts3atoken-1.2 {
|
||||
execsql {
|
||||
SELECT fts3_tokenizer('blah', fts3_tokenizer('simple')) IS NULL;
|
||||
}
|
||||
} {0}
|
||||
do_test fts3atoken-1.3 {
|
||||
execsql {
|
||||
SELECT fts3_tokenizer('blah') == fts3_tokenizer('simple');
|
||||
}
|
||||
} {1}
|
||||
do_test fts3atoken-1.4 {
|
||||
catchsql {
|
||||
CREATE VIRTUAL TABLE t1 USING fts3(content, tokenize blah);
|
||||
}
|
||||
} {0 {}}
|
||||
do_test fts3atoken-1.5 {
|
||||
execsql {
|
||||
INSERT INTO t1(content) VALUES('There was movement at the station');
|
||||
INSERT INTO t1(content) VALUES('For the word has passed around');
|
||||
INSERT INTO t1(content) VALUES('That the colt from ol regret had got');
|
||||
SELECT content FROM t1 WHERE content MATCH 'movement'
|
||||
}
|
||||
} {{There was movement at the station}}
|
||||
} else {
|
||||
do_catchsql_test 1.6 {
|
||||
sqlite3_db_config db SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER 1
|
||||
do_test fts3atoken-1.1 {
|
||||
catchsql {
|
||||
CREATE VIRTUAL TABLE t1 USING fts3(content, tokenize blah);
|
||||
}
|
||||
} {1 {unknown tokenizer: blah}}
|
||||
do_test fts3atoken-1.2 {
|
||||
execsql {
|
||||
SELECT fts3_tokenizer('blah', fts3_tokenizer('simple')) IS NULL;
|
||||
} {1 {fts3tokenize: disabled - rebuild with -DSQLITE_ENABLE_FTS3_TOKENIZER}}
|
||||
}
|
||||
}
|
||||
} {0}
|
||||
do_test fts3atoken-1.3 {
|
||||
execsql {
|
||||
SELECT fts3_tokenizer('blah') == fts3_tokenizer('simple');
|
||||
}
|
||||
} {1}
|
||||
do_test fts3atoken-1.4 {
|
||||
catchsql {
|
||||
CREATE VIRTUAL TABLE t1 USING fts3(content, tokenize blah);
|
||||
}
|
||||
} {0 {}}
|
||||
do_test fts3atoken-1.5 {
|
||||
execsql {
|
||||
INSERT INTO t1(content) VALUES('There was movement at the station');
|
||||
INSERT INTO t1(content) VALUES('For the word has passed around');
|
||||
INSERT INTO t1(content) VALUES('That the colt from ol regret had got');
|
||||
SELECT content FROM t1 WHERE content MATCH 'movement'
|
||||
}
|
||||
} {{There was movement at the station}}
|
||||
|
||||
sqlite3_db_config db SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER 0
|
||||
do_catchsql_test 1.6 {
|
||||
SELECT fts3_tokenizer('blah', fts3_tokenizer('simple')) IS NULL;
|
||||
} {1 {fts3tokenize disabled}}
|
||||
|
||||
|
||||
#--------------------------------------------------------------------------
|
||||
# Test cases fts3atoken-2.* test error cases in the scalar function based
|
||||
@ -212,14 +213,14 @@ do_catchsql_test 6.1.3 {
|
||||
do_catchsql_test 6.2.1 {
|
||||
SELECT fts3_tokenizer(NULL);
|
||||
} {1 {unknown tokenizer: }}
|
||||
ifcapable fts3_tokenizer {
|
||||
do_catchsql_test 6.2.2 {
|
||||
SELECT fts3_tokenizer(NULL, X'1234567812345678');
|
||||
} {1 {argument type mismatch}}
|
||||
do_catchsql_test 6.2.3 {
|
||||
SELECT fts3_tokenizer(NULL, X'12345678');
|
||||
} {1 {argument type mismatch}}
|
||||
}
|
||||
|
||||
sqlite3_db_config db SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER 1
|
||||
do_catchsql_test 6.2.2 {
|
||||
SELECT fts3_tokenizer(NULL, X'1234567812345678');
|
||||
} {1 {argument type mismatch}}
|
||||
do_catchsql_test 6.2.3 {
|
||||
SELECT fts3_tokenizer(NULL, X'12345678');
|
||||
} {1 {argument type mismatch}}
|
||||
|
||||
|
||||
finish_test
|
||||
|
@ -358,31 +358,30 @@ proc build_multilingual_db_2 {db} {
|
||||
}
|
||||
}
|
||||
|
||||
ifcapable fts3_tokenizer {
|
||||
do_test 4.1.0 {
|
||||
reset_db
|
||||
set ptr [fts3_test_tokenizer]
|
||||
execsql { SELECT fts3_tokenizer('testtokenizer', $ptr) }
|
||||
build_multilingual_db_2 db
|
||||
} {}
|
||||
do_execsql_test 4.1.1 {
|
||||
SELECT docid FROM t4 WHERE t4 MATCH 'quick';
|
||||
} {0}
|
||||
do_execsql_test 4.1.2 {
|
||||
SELECT docid FROM t4 WHERE t4 MATCH 'quick' AND lid=1;
|
||||
} {}
|
||||
do_execsql_test 4.1.3 {
|
||||
SELECT docid FROM t4 WHERE t4 MATCH 'Quick' AND lid=1;
|
||||
} {1}
|
||||
for {set i 0} {$i < 50} {incr i} {
|
||||
do_execsql_test 4.1.4.$i {
|
||||
SELECT count(*) FROM t4 WHERE t4 MATCH 'fox' AND lid=$i;
|
||||
} [expr 0==($i%2)]
|
||||
}
|
||||
do_catchsql_test 4.1.5 {
|
||||
INSERT INTO t4(content, lid) VALUES('hello world', 101)
|
||||
} {1 {SQL logic error or missing database}}
|
||||
do_test 4.1.0 {
|
||||
reset_db
|
||||
set ptr [fts3_test_tokenizer]
|
||||
sqlite3_db_config db SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER 1
|
||||
execsql { SELECT fts3_tokenizer('testtokenizer', $ptr) }
|
||||
build_multilingual_db_2 db
|
||||
} {}
|
||||
do_execsql_test 4.1.1 {
|
||||
SELECT docid FROM t4 WHERE t4 MATCH 'quick';
|
||||
} {0}
|
||||
do_execsql_test 4.1.2 {
|
||||
SELECT docid FROM t4 WHERE t4 MATCH 'quick' AND lid=1;
|
||||
} {}
|
||||
do_execsql_test 4.1.3 {
|
||||
SELECT docid FROM t4 WHERE t4 MATCH 'Quick' AND lid=1;
|
||||
} {1}
|
||||
for {set i 0} {$i < 50} {incr i} {
|
||||
do_execsql_test 4.1.4.$i {
|
||||
SELECT count(*) FROM t4 WHERE t4 MATCH 'fox' AND lid=$i;
|
||||
} [expr 0==($i%2)]
|
||||
}
|
||||
do_catchsql_test 4.1.5 {
|
||||
INSERT INTO t4(content, lid) VALUES('hello world', 101)
|
||||
} {1 {SQL logic error or missing database}}
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
# Test cases 5.*
|
||||
|
@ -72,6 +72,10 @@ test_expr icu-2.6 {i1=$::OGRAVE} {upper(i1)} $::OGRAVE
|
||||
test_expr icu-2.7 {i1=$::szlig} {upper(i1)} "SS"
|
||||
test_expr icu-2.8 {i1='SS'} {lower(i1)} "ss"
|
||||
|
||||
do_execsql_test icu-2.9 {
|
||||
SELECT upper(char(0xfb04,0xfb04,0xfb04,0xfb04));
|
||||
} {FFLFFLFFLFFL}
|
||||
|
||||
# In turkish (locale="tr_TR"), the lower case version of I
|
||||
# is "small dotless i" (code point 0x131 (decimal 305)).
|
||||
#
|
||||
@ -133,4 +137,9 @@ do_catchsql_test icu-5.4 {
|
||||
do_catchsql_test icu-5.4 { SELECT 'abc' REGEXP } {1 {near " ": syntax error}}
|
||||
do_catchsql_test icu-5.5 { SELECT 'abc' REGEXP, 1 } {1 {near ",": syntax error}}
|
||||
|
||||
|
||||
do_malloc_test icu-6.10 -sqlbody {
|
||||
SELECT upper(char(0xfb04,0xdf,0xfb04,0xe8,0xfb04));
|
||||
}
|
||||
|
||||
finish_test
|
||||
|
@ -94,5 +94,18 @@ do_execsql_test misc8-2.1 {
|
||||
0 10 {} 10 {} {}
|
||||
}
|
||||
|
||||
# 2016-02-26: An assertion fault found by the libFuzzer project
|
||||
#
|
||||
do_execsql_test misc8-3.0 {
|
||||
SELECT *
|
||||
FROM
|
||||
(
|
||||
(SELECT 0 AS i) AS x1,
|
||||
(SELECT 1) AS x2
|
||||
) AS x3,
|
||||
(SELECT 6 AS j UNION ALL SELECT 7) AS x4
|
||||
WHERE i<rowid
|
||||
ORDER BY 1;
|
||||
} {0 1 6 0 1 7}
|
||||
|
||||
finish_test
|
||||
|
@ -86,7 +86,10 @@ proc test_set {args} {
|
||||
#
|
||||
set alltests [list]
|
||||
foreach f [glob $testdir/*.test] { lappend alltests [file tail $f] }
|
||||
foreach f [glob -nocomplain $testdir/../ext/rtree/*.test] {
|
||||
foreach f [glob -nocomplain \
|
||||
$testdir/../ext/rtree/*.test \
|
||||
$testdir/../ext/fts5/test/*.test \
|
||||
] {
|
||||
lappend alltests $f
|
||||
}
|
||||
foreach f [glob -nocomplain $testdir/../ext/session/*.test] {
|
||||
@ -161,7 +164,8 @@ test_suite "veryquick" -prefix "" -description {
|
||||
This test suite is the same as the "quick" tests, except that some files
|
||||
that test malloc and IO errors are omitted.
|
||||
} -files [
|
||||
test_set $allquicktests -exclude *malloc* *ioerr* *fault* *bigfile* *_err*
|
||||
test_set $allquicktests -exclude *malloc* *ioerr* *fault* *bigfile* *_err* \
|
||||
*fts5corrupt* *fts5big* *fts5aj*
|
||||
]
|
||||
|
||||
test_suite "extraquick" -prefix "" -description {
|
||||
@ -616,6 +620,7 @@ test_suite "utf16" -description {
|
||||
trace.test trigger1.test trigger2.test trigger3.test
|
||||
trigger4.test types2.test types.test unique.test update.test
|
||||
vacuum.test view.test where.test
|
||||
bestindex1.test
|
||||
}
|
||||
|
||||
# Run some tests in exclusive locking mode.
|
||||
|
@ -203,6 +203,7 @@ array set ::Configs [strip_comments {
|
||||
-DSQLITE_MAX_ATTACHED=30
|
||||
-DSQLITE_ENABLE_COLUMN_METADATA
|
||||
-DSQLITE_ENABLE_FTS4
|
||||
-DSQLITE_ENABLE_FTS5
|
||||
-DSQLITE_ENABLE_FTS4_PARENTHESIS
|
||||
-DSQLITE_DISABLE_FTS4_DEFERRED
|
||||
-DSQLITE_ENABLE_RTREE
|
||||
|
@ -625,9 +625,9 @@ do_test shell1-3.23.2 {
|
||||
} {1 {Usage: .show}}
|
||||
|
||||
# .stats ON|OFF Turn stats on or off
|
||||
do_test shell1-3.23b.1 {
|
||||
catchcmd "test.db" ".stats"
|
||||
} {1 {Usage: .stats on|off}}
|
||||
#do_test shell1-3.23b.1 {
|
||||
# catchcmd "test.db" ".stats"
|
||||
#} {1 {Usage: .stats on|off}}
|
||||
do_test shell1-3.23b.2 {
|
||||
catchcmd "test.db" ".stats ON"
|
||||
} {0 {}}
|
||||
@ -637,7 +637,7 @@ do_test shell1-3.23b.3 {
|
||||
do_test shell1-3.23b.4 {
|
||||
# too many arguments
|
||||
catchcmd "test.db" ".stats OFF BAD"
|
||||
} {1 {Usage: .stats on|off}}
|
||||
} {1 {Usage: .stats ?on|off?}}
|
||||
|
||||
# .tables ?TABLE? List names of tables
|
||||
# If TABLE specified, only list tables matching
|
||||
|
@ -61,9 +61,9 @@ do_test shell4-1.2.2 {
|
||||
} {0}
|
||||
|
||||
# .stats ON|OFF Turn stats on or off
|
||||
do_test shell4-1.3.1 {
|
||||
catchcmd "test.db" ".stats"
|
||||
} {1 {Usage: .stats on|off}}
|
||||
#do_test shell4-1.3.1 {
|
||||
# catchcmd "test.db" ".stats"
|
||||
#} {1 {Usage: .stats on|off}}
|
||||
do_test shell4-1.3.2 {
|
||||
catchcmd "test.db" ".stats ON"
|
||||
} {0 {}}
|
||||
@ -73,7 +73,7 @@ do_test shell4-1.3.3 {
|
||||
do_test shell4-1.3.4 {
|
||||
# too many arguments
|
||||
catchcmd "test.db" ".stats OFF BAD"
|
||||
} {1 {Usage: .stats on|off}}
|
||||
} {1 {Usage: .stats ?on|off?}}
|
||||
|
||||
# NB. whitespace is important
|
||||
do_test shell4-1.4.1 {
|
||||
|
@ -334,6 +334,26 @@ do_test 6.3 {
|
||||
sqlite3_snapshot_open db2 main $::snapshot
|
||||
db2 eval { SELECT * FROM x1 }
|
||||
} {z zz zzz}
|
||||
do_test 6.4 {
|
||||
db2 close
|
||||
sqlite3 db2 test.db
|
||||
db2 eval "PRAGMA application_id"
|
||||
db2 eval "BEGIN"
|
||||
sqlite3_snapshot_open db2 main $::snapshot
|
||||
db2 eval { SELECT * FROM x1 }
|
||||
} {z zz zzz}
|
||||
|
||||
# EVIDENCE-OF: R-55491-50411 A snapshot will fail to open if the
|
||||
# database connection D has not previously completed at least one read
|
||||
# operation against the database file.
|
||||
#
|
||||
do_test 6.5 {
|
||||
db2 close
|
||||
sqlite3 db2 test.db
|
||||
db2 eval "BEGIN"
|
||||
list [catch {sqlite3_snapshot_open db2 main $::snapshot} msg] $msg
|
||||
} {1 SQLITE_ERROR}
|
||||
|
||||
sqlite3_snapshot_free $snapshot
|
||||
|
||||
finish_test
|
||||
|
@ -1167,6 +1167,45 @@ void testset_debug1(void){
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef __linux__
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
|
||||
/*
|
||||
** Attempt to display I/O stats on Linux using /proc/PID/io
|
||||
*/
|
||||
static void displayLinuxIoStats(FILE *out){
|
||||
FILE *in;
|
||||
char z[200];
|
||||
sqlite3_snprintf(sizeof(z), z, "/proc/%d/io", getpid());
|
||||
in = fopen(z, "rb");
|
||||
if( in==0 ) return;
|
||||
while( fgets(z, sizeof(z), in)!=0 ){
|
||||
static const struct {
|
||||
const char *zPattern;
|
||||
const char *zDesc;
|
||||
} aTrans[] = {
|
||||
{ "rchar: ", "Bytes received by read():" },
|
||||
{ "wchar: ", "Bytes sent to write():" },
|
||||
{ "syscr: ", "Read() system calls:" },
|
||||
{ "syscw: ", "Write() system calls:" },
|
||||
{ "read_bytes: ", "Bytes rcvd from storage:" },
|
||||
{ "write_bytes: ", "Bytes sent to storage:" },
|
||||
{ "cancelled_write_bytes: ", "Cancelled write bytes:" },
|
||||
};
|
||||
int i;
|
||||
for(i=0; i<sizeof(aTrans)/sizeof(aTrans[0]); i++){
|
||||
int n = (int)strlen(aTrans[i].zPattern);
|
||||
if( strncmp(aTrans[i].zPattern, z, n)==0 ){
|
||||
fprintf(out, "-- %-28s %s", aTrans[i].zDesc, &z[n]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
fclose(in);
|
||||
}
|
||||
#endif
|
||||
|
||||
int main(int argc, char **argv){
|
||||
int doAutovac = 0; /* True for --autovacuum */
|
||||
int cacheSize = 0; /* Desired cache size. 0 means default */
|
||||
@ -1460,6 +1499,12 @@ int main(int argc, char **argv){
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef __linux__
|
||||
if( showStats ){
|
||||
displayLinuxIoStats(stdout);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Release memory */
|
||||
free( pLook );
|
||||
free( pPCache );
|
||||
|
@ -46,7 +46,8 @@ do_test stmt-1.4 {
|
||||
INSERT INTO t1 SELECT a+1, b+1 FROM t1;
|
||||
}
|
||||
set sqlite_open_file_count
|
||||
} {3}
|
||||
# 2016-03-04: statement-journal open deferred
|
||||
} {2}
|
||||
do_test stmt-1.5 {
|
||||
execsql COMMIT
|
||||
set sqlite_open_file_count
|
||||
@ -61,7 +62,8 @@ do_test stmt-1.6.1 {
|
||||
do_test stmt-1.6.2 {
|
||||
execsql { INSERT INTO t1 SELECT a+4, b+4 FROM t1 }
|
||||
set sqlite_open_file_count
|
||||
} {3}
|
||||
# 2016-03-04: statement-journal open deferred
|
||||
} {2}
|
||||
do_test stmt-1.7 {
|
||||
execsql COMMIT
|
||||
set sqlite_open_file_count
|
||||
@ -84,7 +86,7 @@ filecount stmt-2.3 { INSERT INTO t1 SELECT 9, 9 } 2
|
||||
filecount stmt-2.4 {
|
||||
INSERT INTO t1 SELECT 9, 9;
|
||||
INSERT INTO t1 SELECT 10, 10;
|
||||
} 3
|
||||
} 2
|
||||
|
||||
do_test stmt-2.5 {
|
||||
execsql { CREATE INDEX i1 ON t1(b) }
|
||||
@ -92,6 +94,6 @@ do_test stmt-2.5 {
|
||||
filecount stmt-2.6 {
|
||||
REPLACE INTO t1 VALUES(5, 5);
|
||||
REPLACE INTO t1 VALUES(5, 5);
|
||||
} 3
|
||||
} 2
|
||||
|
||||
finish_test
|
||||
|
@ -120,4 +120,19 @@ do_catchsql_test tabfunc01-4.3 {
|
||||
SELECT * FROM aux1.generate_series(1,4)
|
||||
} {1 {no such table: aux1.generate_series}}
|
||||
|
||||
# The next series of tests is verifying that virtual table are able
|
||||
# to optimize the IN operator, even on terms that are not marked "omit".
|
||||
# When the generate_series virtual table is compiled for the testfixture,
|
||||
# the special -DSQLITE_SERIES_CONSTRAINT_VERIFY=1 option is used, which
|
||||
# causes the xBestIndex method of generate_series to leave the
|
||||
# sqlite3_index_constraint_usage.omit flag set to 0, which should cause
|
||||
# the SQLite core to verify the start=, stop=, and step= constraints on
|
||||
# each step of output. At one point, the IN operator could not be used
|
||||
# by virtual tables unless omit was set.
|
||||
#
|
||||
do_execsql_test tabfunc01-500 {
|
||||
SELECT * FROM generate_series WHERE start IN (1,7) AND stop=20 AND step=10
|
||||
ORDER BY +1;
|
||||
} {1 7 11 17}
|
||||
|
||||
finish_test
|
||||
|
@ -76,7 +76,7 @@ do_test tempdb-2.2 {
|
||||
}
|
||||
catchsql { INSERT INTO t1 SELECT * FROM t2 }
|
||||
set sqlite_open_file_count
|
||||
} [expr 1 + (0==$jrnl_in_memory) + (0==$subj_in_memory)]
|
||||
} [expr 1 + (0==$jrnl_in_memory)]
|
||||
do_test tempdb-2.3 {
|
||||
execsql {
|
||||
PRAGMA temp_store = 'memory';
|
||||
|
@ -573,11 +573,16 @@ do_test where-6.6 {
|
||||
SELECT * FROM t3 WHERE a>0 ORDER BY a LIMIT 3
|
||||
}
|
||||
} {1 100 4 2 99 9 3 98 16 nosort}
|
||||
do_test where-6.7 {
|
||||
do_test where-6.7.1 {
|
||||
cksort {
|
||||
SELECT * FROM t3 WHERE b>0 ORDER BY a LIMIT 3
|
||||
SELECT * FROM t3 WHERE b>0 ORDER BY a LIMIT 10
|
||||
}
|
||||
} {1 100 4 2 99 9 3 98 16 nosort}
|
||||
} {/1 100 4 2 99 9 3 98 16 .* nosort/}
|
||||
do_test where-6.7.2 {
|
||||
cksort {
|
||||
SELECT * FROM t3 WHERE b>0 ORDER BY a LIMIT 1
|
||||
}
|
||||
} {1 100 4 sort}
|
||||
ifcapable subquery {
|
||||
do_test where-6.8a {
|
||||
cksort {
|
||||
|
223
tool/Replace.cs
Normal file
@ -0,0 +1,223 @@
|
||||
/*
|
||||
** 2016 February 26
|
||||
**
|
||||
** The author disclaims copyright to this source code. In place of
|
||||
** a legal notice, here is a blessing:
|
||||
**
|
||||
** May you do good and not evil.
|
||||
** May you find forgiveness for yourself and forgive others.
|
||||
** May you share freely, never taking more than you give.
|
||||
**
|
||||
*************************************************************************
|
||||
** This file contains C# code to perform regular expression replacements
|
||||
** using the standard input and output channels.
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#region Assembly Metadata
|
||||
[assembly: AssemblyTitle("Replace Tool")]
|
||||
[assembly: AssemblyDescription("Replace text using standard input/output.")]
|
||||
[assembly: AssemblyCompany("SQLite Development Team")]
|
||||
[assembly: AssemblyProduct("SQLite")]
|
||||
[assembly: AssemblyCopyright("Public Domain")]
|
||||
[assembly: ComVisible(false)]
|
||||
[assembly: Guid("95a0513f-8863-48cd-a76f-cb80868cb578")]
|
||||
[assembly: AssemblyVersion("1.0.*")]
|
||||
|
||||
#if DEBUG
|
||||
[assembly: AssemblyConfiguration("Debug")]
|
||||
#else
|
||||
[assembly: AssemblyConfiguration("Release")]
|
||||
#endif
|
||||
#endregion
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
namespace Replace
|
||||
{
|
||||
/// <summary>
|
||||
/// This enumeration is used to represent all the possible exit codes from
|
||||
/// this tool.
|
||||
/// </summary>
|
||||
internal enum ExitCode
|
||||
{
|
||||
/// <summary>
|
||||
/// The file download was a success.
|
||||
/// </summary>
|
||||
Success = 0,
|
||||
|
||||
/// <summary>
|
||||
/// The command line arguments are missing (i.e. null). Generally,
|
||||
/// this should not happen.
|
||||
/// </summary>
|
||||
MissingArgs = 1,
|
||||
|
||||
/// <summary>
|
||||
/// The wrong number of command line arguments was supplied.
|
||||
/// </summary>
|
||||
WrongNumArgs = 2,
|
||||
|
||||
/// <summary>
|
||||
/// The "matchingOnly" flag could not be converted to a value of the
|
||||
/// <see cref="Boolean"/> type.
|
||||
/// </summary>
|
||||
BadMatchingOnlyFlag = 3,
|
||||
|
||||
/// <summary>
|
||||
/// An exception was caught in <see cref="Main" />. Generally, this
|
||||
/// should not happen.
|
||||
/// </summary>
|
||||
Exception = 4
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
internal static class Replace
|
||||
{
|
||||
#region Private Support Methods
|
||||
/// <summary>
|
||||
/// This method displays an error message to the console and/or
|
||||
/// displays the command line usage information for this tool.
|
||||
/// </summary>
|
||||
/// <param name="message">
|
||||
/// The error message to display, if any.
|
||||
/// </param>
|
||||
/// <param name="usage">
|
||||
/// Non-zero to display the command line usage information.
|
||||
/// </param>
|
||||
private static void Error(
|
||||
string message,
|
||||
bool usage
|
||||
)
|
||||
{
|
||||
if (message != null)
|
||||
Console.WriteLine(message);
|
||||
|
||||
string fileName = Path.GetFileName(
|
||||
Process.GetCurrentProcess().MainModule.FileName);
|
||||
|
||||
Console.WriteLine(String.Format(
|
||||
"usage: {0} <regExPattern> <regExSubSpec> <matchingOnly>",
|
||||
fileName));
|
||||
}
|
||||
#endregion
|
||||
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
|
||||
#region Program Entry Point
|
||||
/// <summary>
|
||||
/// This is the entry-point for this tool. It handles processing the
|
||||
/// command line arguments, reading from the standard input channel,
|
||||
/// replacing any matching lines of text, and writing to the standard
|
||||
/// output channel.
|
||||
/// </summary>
|
||||
/// <param name="args">
|
||||
/// The command line arguments.
|
||||
/// </param>
|
||||
/// <returns>
|
||||
/// Zero upon success; non-zero on failure. This will be one of the
|
||||
/// values from the <see cref="ExitCode" /> enumeration.
|
||||
/// </returns>
|
||||
private static int Main(
|
||||
string[] args
|
||||
)
|
||||
{
|
||||
//
|
||||
// NOTE: Sanity check the command line arguments.
|
||||
//
|
||||
if (args == null)
|
||||
{
|
||||
Error(null, true);
|
||||
return (int)ExitCode.MissingArgs;
|
||||
}
|
||||
|
||||
if (args.Length != 3)
|
||||
{
|
||||
Error(null, true);
|
||||
return (int)ExitCode.WrongNumArgs;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
//
|
||||
// NOTE: Create a regular expression from the first command
|
||||
// line argument. Then, grab the replacement string,
|
||||
// which is the second argument.
|
||||
//
|
||||
Regex regEx = new Regex(args[0]);
|
||||
string replacement = args[1];
|
||||
|
||||
//
|
||||
// NOTE: Attempt to convert the third argument to a boolean.
|
||||
//
|
||||
bool matchingOnly;
|
||||
|
||||
if (!bool.TryParse(args[2], out matchingOnly))
|
||||
{
|
||||
Error(null, true);
|
||||
return (int)ExitCode.BadMatchingOnlyFlag;
|
||||
}
|
||||
|
||||
//
|
||||
// NOTE: Grab the standard input and output channels from the
|
||||
// console.
|
||||
//
|
||||
TextReader inputTextReader = Console.In;
|
||||
TextWriter outputTextWriter = Console.Out;
|
||||
|
||||
//
|
||||
// NOTE: Loop until end-of-file is hit on the standard input
|
||||
// stream.
|
||||
//
|
||||
while (true)
|
||||
{
|
||||
//
|
||||
// NOTE: Read a line from the standard input channel. If
|
||||
// null is returned here, there is no more input and
|
||||
// we are done.
|
||||
//
|
||||
string inputLine = inputTextReader.ReadLine();
|
||||
|
||||
if (inputLine == null)
|
||||
break;
|
||||
|
||||
//
|
||||
// NOTE: Perform regular expression replacements on this
|
||||
// line, if any. Then, write the modified line to
|
||||
// the standard output channel.
|
||||
//
|
||||
string outputLine = regEx.Replace(inputLine, replacement);
|
||||
|
||||
if (!matchingOnly || !String.Equals(
|
||||
inputLine, outputLine, StringComparison.Ordinal))
|
||||
{
|
||||
outputTextWriter.WriteLine(outputLine);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// NOTE: At this point, everything has succeeded.
|
||||
//
|
||||
return (int)ExitCode.Success;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
//
|
||||
// NOTE: An exception was caught. Report it via the console
|
||||
// and return failure.
|
||||
//
|
||||
Error(e.ToString(), false);
|
||||
return (int)ExitCode.Exception;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
@ -38,6 +38,7 @@ set extras {
|
||||
UPLUS
|
||||
REGISTER
|
||||
ASTERISK
|
||||
SPAN
|
||||
SPACE
|
||||
ILLEGAL
|
||||
}
|
||||
|
@ -53,6 +53,7 @@ cp $TOP/sqlite3.1 $TMPSPACE
|
||||
cp $TOP/sqlite3.pc.in $TMPSPACE
|
||||
cp $TOP/src/shell.c $TMPSPACE
|
||||
cp $TOP/src/sqlite3.rc $TMPSPACE
|
||||
cp $TOP/tool/Replace.cs $TMPSPACE
|
||||
|
||||
cat $TMPSPACE/configure.ac |
|
||||
sed "s/--SQLITE-VERSION--/$VERSION/" > $TMPSPACE/tmp
|
||||
|
@ -72,6 +72,21 @@ $(LIBRESOBJS): $(TOP)\sqlite3.rc rcver.vc $(SQLITE3H)
|
||||
$(LTRCOMPILE) -fo $(LIBRESOBJS) -DRC_VERONLY $(TOP)\sqlite3.rc
|
||||
}]]
|
||||
|
||||
#
|
||||
# NOTE: This block is used to replace the section marked <<block2>> in
|
||||
# the Makefile, if it exists.
|
||||
#
|
||||
set blocks(2) [string trimleft [string map [list \\\\ \\] {
|
||||
Replace.exe:
|
||||
$(CSC) /target:exe $(TOP)\Replace.cs
|
||||
|
||||
sqlite3.def: Replace.exe $(LIBOBJ)
|
||||
echo EXPORTS > sqlite3.def
|
||||
dumpbin /all $(LIBOBJ) \\
|
||||
| .\Replace.exe "^\s+/EXPORT:_?(sqlite3_[^@,]*)(?:@\d+|,DATA)?$$" $$1 true \\
|
||||
| sort >> sqlite3.def
|
||||
}]]
|
||||
|
||||
set data "#### DO NOT EDIT ####\n"
|
||||
append data "# This makefile is automatically "
|
||||
append data "generated from the [file tail $fromFileName] at\n"
|
||||
@ -90,8 +105,6 @@ foreach i [lsort -integer [array names blocks]] {
|
||||
}
|
||||
|
||||
set data [string map [list " -I\$(TOP)\\src" ""] $data]
|
||||
set data [string map [list " /DEF:sqlite3.def" ""] $data]
|
||||
set data [string map [list " sqlite3.def" ""] $data]
|
||||
set data [string map [list " libsqlite3.lib" ""] $data]
|
||||
set data [string map [list " \$(ALL_TCL_TARGETS)" ""] $data]
|
||||
set data [string map [list "\$(TOP)\\src\\" "\$(TOP)\\"] $data]
|
||||
|
@ -111,11 +111,11 @@ static unsigned int findCloseParen(const char *z){
|
||||
** Print error messages whenever a side effect is found. Return the number
|
||||
** of problems seen.
|
||||
*/
|
||||
static unsigned int findAllSideEffects(const char *z){
|
||||
static unsigned int findAllSideEffects(const unsigned char *z){
|
||||
unsigned int lineno = 1; /* Line number */
|
||||
unsigned int i;
|
||||
unsigned int nErr = 0;
|
||||
char c, prevC = 0;
|
||||
unsigned char c, prevC = 0;
|
||||
for(i=0; (c = z[i])!=0; prevC=c, i++){
|
||||
if( c=='\n' ){ lineno++; continue; }
|
||||
if( isalpha(c) && !isalpha(prevC) ){
|
||||
@ -125,7 +125,7 @@ static unsigned int findAllSideEffects(const char *z){
|
||||
|| strncmp(&z[i],"testcase(",9)==0
|
||||
){
|
||||
unsigned int n;
|
||||
const char *z2 = &z[i+5];
|
||||
unsigned const char *z2 = &z[i+5];
|
||||
while( z2[0]!='(' ){ z2++; }
|
||||
z2++;
|
||||
n = findCloseParen(z2);
|
||||
@ -141,7 +141,7 @@ static unsigned int findAllSideEffects(const char *z){
|
||||
}
|
||||
|
||||
int main(int argc, char **argv){
|
||||
char *z;
|
||||
unsigned char *z;
|
||||
unsigned int nErr = 0;
|
||||
if( argc!=2 ){
|
||||
fprintf(stderr, "Usage: %s FILENAME\n", argv[0]);
|
||||
|
8
vsixtest/App.xaml
Normal file
@ -0,0 +1,8 @@
|
||||
<Application
|
||||
x:Class="vsixtest.App"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="using:vsixtest"
|
||||
RequestedTheme="Light">
|
||||
|
||||
</Application>
|
120
vsixtest/App.xaml.cpp
Normal file
@ -0,0 +1,120 @@
|
||||
//
|
||||
// App.xaml.cpp
|
||||
// Implementation of the App class.
|
||||
//
|
||||
|
||||
#include "pch.h"
|
||||
#include "MainPage.xaml.h"
|
||||
|
||||
using namespace vsixtest;
|
||||
|
||||
using namespace Platform;
|
||||
using namespace Windows::ApplicationModel;
|
||||
using namespace Windows::ApplicationModel::Activation;
|
||||
using namespace Windows::Foundation;
|
||||
using namespace Windows::Foundation::Collections;
|
||||
using namespace Windows::UI::Xaml;
|
||||
using namespace Windows::UI::Xaml::Controls;
|
||||
using namespace Windows::UI::Xaml::Controls::Primitives;
|
||||
using namespace Windows::UI::Xaml::Data;
|
||||
using namespace Windows::UI::Xaml::Input;
|
||||
using namespace Windows::UI::Xaml::Interop;
|
||||
using namespace Windows::UI::Xaml::Media;
|
||||
using namespace Windows::UI::Xaml::Navigation;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes the singleton application object. This is the first line of authored code
|
||||
/// executed, and as such is the logical equivalent of main() or WinMain().
|
||||
/// </summary>
|
||||
App::App()
|
||||
{
|
||||
InitializeComponent();
|
||||
Suspending += ref new SuspendingEventHandler(this, &App::OnSuspending);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Invoked when the application is launched normally by the end user. Other entry points
|
||||
/// will be used such as when the application is launched to open a specific file.
|
||||
/// </summary>
|
||||
/// <param name="e">Details about the launch request and process.</param>
|
||||
void App::OnLaunched(Windows::ApplicationModel::Activation::LaunchActivatedEventArgs^ e)
|
||||
{
|
||||
|
||||
#if _DEBUG
|
||||
// Show graphics profiling information while debugging.
|
||||
if (IsDebuggerPresent())
|
||||
{
|
||||
// Display the current frame rate counters
|
||||
DebugSettings->EnableFrameRateCounter = true;
|
||||
}
|
||||
#endif
|
||||
|
||||
auto rootFrame = dynamic_cast<Frame^>(Window::Current->Content);
|
||||
|
||||
// Do not repeat app initialization when the Window already has content,
|
||||
// just ensure that the window is active
|
||||
if (rootFrame == nullptr)
|
||||
{
|
||||
// Create a Frame to act as the navigation context and associate it with
|
||||
// a SuspensionManager key
|
||||
rootFrame = ref new Frame();
|
||||
|
||||
rootFrame->NavigationFailed += ref new Windows::UI::Xaml::Navigation::NavigationFailedEventHandler(this, &App::OnNavigationFailed);
|
||||
|
||||
if (e->PreviousExecutionState == ApplicationExecutionState::Terminated)
|
||||
{
|
||||
// TODO: Restore the saved session state only when appropriate, scheduling the
|
||||
// final launch steps after the restore is complete
|
||||
|
||||
}
|
||||
|
||||
if (rootFrame->Content == nullptr)
|
||||
{
|
||||
// When the navigation stack isn't restored navigate to the first page,
|
||||
// configuring the new page by passing required information as a navigation
|
||||
// parameter
|
||||
rootFrame->Navigate(TypeName(MainPage::typeid), e->Arguments);
|
||||
}
|
||||
// Place the frame in the current Window
|
||||
Window::Current->Content = rootFrame;
|
||||
// Ensure the current window is active
|
||||
Window::Current->Activate();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (rootFrame->Content == nullptr)
|
||||
{
|
||||
// When the navigation stack isn't restored navigate to the first page,
|
||||
// configuring the new page by passing required information as a navigation
|
||||
// parameter
|
||||
rootFrame->Navigate(TypeName(MainPage::typeid), e->Arguments);
|
||||
}
|
||||
// Ensure the current window is active
|
||||
Window::Current->Activate();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Invoked when application execution is being suspended. Application state is saved
|
||||
/// without knowing whether the application will be terminated or resumed with the contents
|
||||
/// of memory still intact.
|
||||
/// </summary>
|
||||
/// <param name="sender">The source of the suspend request.</param>
|
||||
/// <param name="e">Details about the suspend request.</param>
|
||||
void App::OnSuspending(Object^ sender, SuspendingEventArgs^ e)
|
||||
{
|
||||
(void) sender; // Unused parameter
|
||||
(void) e; // Unused parameter
|
||||
|
||||
//TODO: Save application state and stop any background activity
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Invoked when Navigation to a certain page fails
|
||||
/// </summary>
|
||||
/// <param name="sender">The Frame which failed navigation</param>
|
||||
/// <param name="e">Details about the navigation failure</param>
|
||||
void App::OnNavigationFailed(Platform::Object ^sender, Windows::UI::Xaml::Navigation::NavigationFailedEventArgs ^e)
|
||||
{
|
||||
throw ref new FailureException("Failed to load Page " + e->SourcePageType.Name);
|
||||
}
|
27
vsixtest/App.xaml.h
Normal file
@ -0,0 +1,27 @@
|
||||
//
|
||||
// App.xaml.h
|
||||
// Declaration of the App class.
|
||||
//
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "App.g.h"
|
||||
|
||||
namespace vsixtest
|
||||
{
|
||||
/// <summary>
|
||||
/// Provides application-specific behavior to supplement the default Application class.
|
||||
/// </summary>
|
||||
ref class App sealed
|
||||
{
|
||||
protected:
|
||||
virtual void OnLaunched(Windows::ApplicationModel::Activation::LaunchActivatedEventArgs^ e) override;
|
||||
|
||||
internal:
|
||||
App();
|
||||
|
||||
private:
|
||||
void OnSuspending(Platform::Object^ sender, Windows::ApplicationModel::SuspendingEventArgs^ e);
|
||||
void OnNavigationFailed(Platform::Object ^sender, Windows::UI::Xaml::Navigation::NavigationFailedEventArgs ^e);
|
||||
};
|
||||
}
|
BIN
vsixtest/Assets/LockScreenLogo.scale-200.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
vsixtest/Assets/SplashScreen.scale-200.png
Normal file
After Width: | Height: | Size: 7.5 KiB |
BIN
vsixtest/Assets/Square150x150Logo.scale-200.png
Normal file
After Width: | Height: | Size: 2.9 KiB |
BIN
vsixtest/Assets/Square44x44Logo.scale-200.png
Normal file
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 1.2 KiB |
BIN
vsixtest/Assets/StoreLogo.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
vsixtest/Assets/Wide310x150Logo.scale-200.png
Normal file
After Width: | Height: | Size: 3.1 KiB |
13
vsixtest/MainPage.xaml
Normal file
@ -0,0 +1,13 @@
|
||||
<Page
|
||||
x:Class="vsixtest.MainPage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="using:vsixtest"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
|
||||
|
||||
</Grid>
|
||||
</Page>
|
53
vsixtest/MainPage.xaml.cpp
Normal file
@ -0,0 +1,53 @@
|
||||
//
|
||||
// MainPage.xaml.cpp
|
||||
// Implementation of the MainPage class.
|
||||
//
|
||||
|
||||
#include "pch.h"
|
||||
#include "MainPage.xaml.h"
|
||||
#include "sqlite3.h"
|
||||
|
||||
using namespace vsixtest;
|
||||
|
||||
using namespace Platform;
|
||||
using namespace Windows::Foundation;
|
||||
using namespace Windows::Foundation::Collections;
|
||||
using namespace Windows::UI::Xaml;
|
||||
using namespace Windows::UI::Xaml::Controls;
|
||||
using namespace Windows::UI::Xaml::Controls::Primitives;
|
||||
using namespace Windows::UI::Xaml::Data;
|
||||
using namespace Windows::UI::Xaml::Input;
|
||||
using namespace Windows::UI::Xaml::Media;
|
||||
using namespace Windows::UI::Xaml::Navigation;
|
||||
|
||||
// The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=402352&clcid=0x409
|
||||
|
||||
MainPage::MainPage()
|
||||
{
|
||||
InitializeComponent();
|
||||
UseSQLite();
|
||||
}
|
||||
|
||||
void MainPage::UseSQLite(void)
|
||||
{
|
||||
int rc = SQLITE_OK;
|
||||
sqlite3 *pDb = nullptr;
|
||||
|
||||
rc = sqlite3_open_v2("test.db", &pDb,
|
||||
SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, nullptr);
|
||||
|
||||
if (rc != SQLITE_OK)
|
||||
throw ref new FailureException("Failed to open database.");
|
||||
|
||||
rc = sqlite3_exec(pDb, "VACUUM;", nullptr, nullptr, nullptr);
|
||||
|
||||
if (rc != SQLITE_OK)
|
||||
throw ref new FailureException("Failed to vacuum database.");
|
||||
|
||||
rc = sqlite3_close(pDb);
|
||||
|
||||
if (rc != SQLITE_OK)
|
||||
throw ref new FailureException("Failed to close database.");
|
||||
|
||||
pDb = nullptr;
|
||||
}
|
22
vsixtest/MainPage.xaml.h
Normal file
@ -0,0 +1,22 @@
|
||||
//
|
||||
// MainPage.xaml.h
|
||||
// Declaration of the MainPage class.
|
||||
//
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "MainPage.g.h"
|
||||
|
||||
namespace vsixtest
|
||||
{
|
||||
/// <summary>
|
||||
/// An empty page that can be used on its own or navigated to within a Frame.
|
||||
/// </summary>
|
||||
public ref class MainPage sealed
|
||||
{
|
||||
public:
|
||||
MainPage();
|
||||
void UseSQLite(void);
|
||||
|
||||
};
|
||||
}
|
49
vsixtest/Package.appxmanifest
Normal file
@ -0,0 +1,49 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<Package
|
||||
xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
|
||||
xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest"
|
||||
xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
|
||||
IgnorableNamespaces="uap mp">
|
||||
|
||||
<Identity
|
||||
Name="bb52b3e1-5c8a-4516-a5ff-8b9f9baadef7"
|
||||
Publisher="CN=mistachkin"
|
||||
Version="1.0.0.0" />
|
||||
|
||||
<mp:PhoneIdentity PhoneProductId="bb52b3e1-5c8a-4516-a5ff-8b9f9baadef7" PhonePublisherId="00000000-0000-0000-0000-000000000000"/>
|
||||
|
||||
<Properties>
|
||||
<DisplayName>vsixtest</DisplayName>
|
||||
<PublisherDisplayName>mistachkin</PublisherDisplayName>
|
||||
<Logo>Assets\StoreLogo.png</Logo>
|
||||
</Properties>
|
||||
|
||||
<Dependencies>
|
||||
<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.0.0" MaxVersionTested="10.0.0.0" />
|
||||
</Dependencies>
|
||||
|
||||
<Resources>
|
||||
<Resource Language="x-generate"/>
|
||||
</Resources>
|
||||
|
||||
<Applications>
|
||||
<Application Id="App"
|
||||
Executable="$targetnametoken$.exe"
|
||||
EntryPoint="vsixtest.App">
|
||||
<uap:VisualElements
|
||||
DisplayName="vsixtest"
|
||||
Square150x150Logo="Assets\Square150x150Logo.png"
|
||||
Square44x44Logo="Assets\Square44x44Logo.png"
|
||||
Description="vsixtest"
|
||||
BackgroundColor="transparent">
|
||||
<uap:DefaultTile Wide310x150Logo="Assets\Wide310x150Logo.png"/>
|
||||
<uap:SplashScreen Image="Assets\SplashScreen.png" />
|
||||
</uap:VisualElements>
|
||||
</Application>
|
||||
</Applications>
|
||||
|
||||
<Capabilities>
|
||||
<Capability Name="internetClient" />
|
||||
</Capabilities>
|
||||
</Package>
|
6
vsixtest/pch.cpp
Normal file
@ -0,0 +1,6 @@
|
||||
//
|
||||
// pch.cpp
|
||||
// Include the standard header and generate the precompiled header.
|
||||
//
|
||||
|
||||
#include "pch.h"
|
11
vsixtest/pch.h
Normal file
@ -0,0 +1,11 @@
|
||||
//
|
||||
// pch.h
|
||||
// Header for standard system include files.
|
||||
//
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <collection.h>
|
||||
#include <ppltasks.h>
|
||||
|
||||
#include "App.xaml.h"
|
39
vsixtest/vsixtest.sln
Normal file
@ -0,0 +1,39 @@
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 14
|
||||
VisualStudioVersion = 14.0.24720.0
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vsixtest", "vsixtest.vcxproj", "{60BB14A5-0871-4656-BC38-4F0958230F9A}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|ARM = Debug|ARM
|
||||
Debug|x64 = Debug|x64
|
||||
Debug|x86 = Debug|x86
|
||||
Release|ARM = Release|ARM
|
||||
Release|x64 = Release|x64
|
||||
Release|x86 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{60BB14A5-0871-4656-BC38-4F0958230F9A}.Debug|ARM.ActiveCfg = Debug|ARM
|
||||
{60BB14A5-0871-4656-BC38-4F0958230F9A}.Debug|ARM.Build.0 = Debug|ARM
|
||||
{60BB14A5-0871-4656-BC38-4F0958230F9A}.Debug|ARM.Deploy.0 = Debug|ARM
|
||||
{60BB14A5-0871-4656-BC38-4F0958230F9A}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{60BB14A5-0871-4656-BC38-4F0958230F9A}.Debug|x64.Build.0 = Debug|x64
|
||||
{60BB14A5-0871-4656-BC38-4F0958230F9A}.Debug|x64.Deploy.0 = Debug|x64
|
||||
{60BB14A5-0871-4656-BC38-4F0958230F9A}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{60BB14A5-0871-4656-BC38-4F0958230F9A}.Debug|x86.Build.0 = Debug|Win32
|
||||
{60BB14A5-0871-4656-BC38-4F0958230F9A}.Debug|x86.Deploy.0 = Debug|Win32
|
||||
{60BB14A5-0871-4656-BC38-4F0958230F9A}.Release|ARM.ActiveCfg = Release|ARM
|
||||
{60BB14A5-0871-4656-BC38-4F0958230F9A}.Release|ARM.Build.0 = Release|ARM
|
||||
{60BB14A5-0871-4656-BC38-4F0958230F9A}.Release|ARM.Deploy.0 = Release|ARM
|
||||
{60BB14A5-0871-4656-BC38-4F0958230F9A}.Release|x64.ActiveCfg = Release|x64
|
||||
{60BB14A5-0871-4656-BC38-4F0958230F9A}.Release|x64.Build.0 = Release|x64
|
||||
{60BB14A5-0871-4656-BC38-4F0958230F9A}.Release|x64.Deploy.0 = Release|x64
|
||||
{60BB14A5-0871-4656-BC38-4F0958230F9A}.Release|x86.ActiveCfg = Release|Win32
|
||||
{60BB14A5-0871-4656-BC38-4F0958230F9A}.Release|x86.Build.0 = Release|Win32
|
||||
{60BB14A5-0871-4656-BC38-4F0958230F9A}.Release|x86.Deploy.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
373
vsixtest/vsixtest.tcl
Normal file
@ -0,0 +1,373 @@
|
||||
#!/usr/bin/tclsh
|
||||
#
|
||||
# This script is used to quickly test a VSIX (Visual Studio Extension) file
|
||||
# with Visual Studio 2015 on Windows.
|
||||
#
|
||||
# PREREQUISITES
|
||||
#
|
||||
# 1. This tool is Windows only.
|
||||
#
|
||||
# 2. This tool must be executed with "elevated administrator" privileges.
|
||||
#
|
||||
# 3. Tcl 8.4 and later are supported, earlier versions have not been tested.
|
||||
#
|
||||
# 4. The "sqlite-UWP-output.vsix" file is assumed to exist in the parent
|
||||
# directory of the directory containing this script. The [optional] first
|
||||
# command line argument to this script may be used to specify an alternate
|
||||
# file. However, currently, the file must be compatible with both Visual
|
||||
# Studio 2015 and the Universal Windows Platform.
|
||||
#
|
||||
# 5. The "VERSION" file is assumed to exist in the parent directory of the
|
||||
# directory containing this script. It must contain a version number that
|
||||
# matches the VSIX file being tested.
|
||||
#
|
||||
# 6. The temporary directory specified in the TEMP or TMP environment variables
|
||||
# must refer to an existing directory writable by the current user.
|
||||
#
|
||||
# 7. The VS140COMNTOOLS environment variable must refer to the Visual Studio
|
||||
# 2015 common tools directory.
|
||||
#
|
||||
# USAGE
|
||||
#
|
||||
# The first argument to this script is optional. If specified, it must be the
|
||||
# name of the VSIX file to test.
|
||||
#
|
||||
package require Tcl 8.4
|
||||
|
||||
proc fail { {error ""} {usage false} } {
|
||||
if {[string length $error] > 0} then {
|
||||
puts stdout $error
|
||||
if {!$usage} then {exit 1}
|
||||
}
|
||||
|
||||
puts stdout "usage:\
|
||||
[file tail [info nameofexecutable]]\
|
||||
[file tail [info script]] \[vsixFile\]"
|
||||
|
||||
exit 1
|
||||
}
|
||||
|
||||
proc isWindows {} {
|
||||
#
|
||||
# NOTE: Returns non-zero only when running on Windows.
|
||||
#
|
||||
return [expr {[info exists ::tcl_platform(platform)] && \
|
||||
$::tcl_platform(platform) eq "windows"}]
|
||||
}
|
||||
|
||||
proc isAdministrator {} {
|
||||
#
|
||||
# NOTE: Returns non-zero only when running as "elevated administrator".
|
||||
#
|
||||
if {[isWindows]} then {
|
||||
if {[catch {exec -- whoami /groups} groups] == 0} then {
|
||||
set groups [string map [list \r\n \n] $groups]
|
||||
|
||||
foreach group [split $groups \n] {
|
||||
#
|
||||
# NOTE: Match this group line against the "well-known" SID for
|
||||
# the "Administrators" group on Windows.
|
||||
#
|
||||
if {[regexp -- {\sS-1-5-32-544\s} $group]} then {
|
||||
#
|
||||
# NOTE: Match this group line against the attributes column
|
||||
# sub-value that should be present when running with
|
||||
# elevated administrator credentials.
|
||||
#
|
||||
if {[regexp -- {\sEnabled group(?:,|\s)} $group]} then {
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
proc getEnvironmentVariable { name } {
|
||||
#
|
||||
# NOTE: Returns the value of the specified environment variable or an empty
|
||||
# string for environment variables that do not exist in the current
|
||||
# process environment.
|
||||
#
|
||||
return [expr {[info exists ::env($name)] ? $::env($name) : ""}]
|
||||
}
|
||||
|
||||
proc getTemporaryPath {} {
|
||||
#
|
||||
# NOTE: Returns the normalized path to the first temporary directory found
|
||||
# in the typical set of environment variables used for that purpose
|
||||
# or an empty string to signal a failure to locate such a directory.
|
||||
#
|
||||
set names [list]
|
||||
|
||||
foreach name [list TEMP TMP] {
|
||||
lappend names [string toupper $name] [string tolower $name] \
|
||||
[string totitle $name]
|
||||
}
|
||||
|
||||
foreach name $names {
|
||||
set value [getEnvironmentVariable $name]
|
||||
|
||||
if {[string length $value] > 0} then {
|
||||
return [file normalize $value]
|
||||
}
|
||||
}
|
||||
|
||||
return ""
|
||||
}
|
||||
|
||||
proc appendArgs { args } {
|
||||
#
|
||||
# NOTE: Returns all passed arguments joined together as a single string
|
||||
# with no intervening spaces between arguments.
|
||||
#
|
||||
eval append result $args
|
||||
}
|
||||
|
||||
proc readFile { fileName } {
|
||||
#
|
||||
# NOTE: Reads and returns the entire contents of the specified file, which
|
||||
# may contain binary data.
|
||||
#
|
||||
set file_id [open $fileName RDONLY]
|
||||
fconfigure $file_id -encoding binary -translation binary
|
||||
set result [read $file_id]
|
||||
close $file_id
|
||||
return $result
|
||||
}
|
||||
|
||||
proc writeFile { fileName data } {
|
||||
#
|
||||
# NOTE: Writes the entire contents of the specified file, which may contain
|
||||
# binary data.
|
||||
#
|
||||
set file_id [open $fileName {WRONLY CREAT TRUNC}]
|
||||
fconfigure $file_id -encoding binary -translation binary
|
||||
puts -nonewline $file_id $data
|
||||
close $file_id
|
||||
return ""
|
||||
}
|
||||
|
||||
proc putsAndEval { command } {
|
||||
#
|
||||
# NOTE: Outputs a command to the standard output channel and then evaluates
|
||||
# it in the callers context.
|
||||
#
|
||||
catch {
|
||||
puts stdout [appendArgs "Running: " [lrange $command 1 end] ...\n]
|
||||
}
|
||||
|
||||
return [uplevel 1 $command]
|
||||
}
|
||||
|
||||
proc isBadDirectory { directory } {
|
||||
#
|
||||
# NOTE: Returns non-zero if the directory is empty, does not exist, -OR- is
|
||||
# not a directory.
|
||||
#
|
||||
catch {
|
||||
puts stdout [appendArgs "Checking directory \"" $directory \"...\n]
|
||||
}
|
||||
|
||||
return [expr {[string length $directory] == 0 || \
|
||||
![file exists $directory] || ![file isdirectory $directory]}]
|
||||
}
|
||||
|
||||
proc isBadFile { fileName } {
|
||||
#
|
||||
# NOTE: Returns non-zero if the file name is empty, does not exist, -OR- is
|
||||
# not a regular file.
|
||||
#
|
||||
catch {
|
||||
puts stdout [appendArgs "Checking file \"" $fileName \"...\n]
|
||||
}
|
||||
|
||||
return [expr {[string length $fileName] == 0 || \
|
||||
![file exists $fileName] || ![file isfile $fileName]}]
|
||||
}
|
||||
|
||||
#
|
||||
# NOTE: This is the entry point for this script.
|
||||
#
|
||||
set script [file normalize [info script]]
|
||||
|
||||
if {[string length $script] == 0} then {
|
||||
fail "script file currently being evaluated is unknown" true
|
||||
}
|
||||
|
||||
if {![isWindows]} then {
|
||||
fail "this tool only works properly on Windows"
|
||||
}
|
||||
|
||||
if {![isAdministrator]} then {
|
||||
fail "this tool must run with \"elevated administrator\" privileges"
|
||||
}
|
||||
|
||||
set path [file normalize [file dirname $script]]
|
||||
set argc [llength $argv]; if {$argc > 1} then {fail "" true}
|
||||
|
||||
if {$argc == 1} then {
|
||||
set vsixFileName [lindex $argv 0]
|
||||
} else {
|
||||
set vsixFileName [file join \
|
||||
[file dirname $path] sqlite-UWP-output.vsix]
|
||||
}
|
||||
|
||||
###############################################################################
|
||||
|
||||
if {[isBadFile $vsixFileName]} then {
|
||||
fail [appendArgs \
|
||||
"VSIX file \"" $vsixFileName "\" does not exist"]
|
||||
}
|
||||
|
||||
set versionFileName [file join [file dirname $path] VERSION]
|
||||
|
||||
if {[isBadFile $versionFileName]} then {
|
||||
fail [appendArgs \
|
||||
"Version file \"" $versionFileName "\" does not exist"]
|
||||
}
|
||||
|
||||
set projectTemplateFileName [file join $path vsixtest.vcxproj.data]
|
||||
|
||||
if {[isBadFile $projectTemplateFileName]} then {
|
||||
fail [appendArgs \
|
||||
"Project template file \"" $projectTemplateFileName \
|
||||
"\" does not exist"]
|
||||
}
|
||||
|
||||
set envVarName VS140COMNTOOLS
|
||||
set vsDirectory [getEnvironmentVariable $envVarName]
|
||||
|
||||
if {[isBadDirectory $vsDirectory]} then {
|
||||
fail [appendArgs \
|
||||
"Visual Studio 2015 directory \"" $vsDirectory \
|
||||
"\" from environment variable \"" $envVarName \
|
||||
"\" does not exist"]
|
||||
}
|
||||
|
||||
set vsixInstaller [file join \
|
||||
[file dirname $vsDirectory] IDE VSIXInstaller.exe]
|
||||
|
||||
if {[isBadFile $vsixInstaller]} then {
|
||||
fail [appendArgs \
|
||||
"Visual Studio 2015 VSIX installer \"" $vsixInstaller \
|
||||
"\" does not exist"]
|
||||
}
|
||||
|
||||
set envVarName ProgramFiles
|
||||
set programFiles [getEnvironmentVariable $envVarName]
|
||||
|
||||
if {[isBadDirectory $programFiles]} then {
|
||||
fail [appendArgs \
|
||||
"Program Files directory \"" $programFiles \
|
||||
"\" from environment variable \"" $envVarName \
|
||||
"\" does not exist"]
|
||||
}
|
||||
|
||||
set msBuild [file join $programFiles MSBuild 14.0 Bin MSBuild.exe]
|
||||
|
||||
if {[isBadFile $msBuild]} then {
|
||||
fail [appendArgs \
|
||||
"MSBuild v14.0 executable file \"" $msBuild \
|
||||
"\" does not exist"]
|
||||
}
|
||||
|
||||
set temporaryDirectory [getTemporaryPath]
|
||||
|
||||
if {[isBadDirectory $temporaryDirectory]} then {
|
||||
fail [appendArgs \
|
||||
"Temporary directory \"" $temporaryDirectory \
|
||||
"\" does not exist"]
|
||||
}
|
||||
|
||||
###############################################################################
|
||||
|
||||
set installLogFileName [appendArgs \
|
||||
[file rootname [file tail $vsixFileName]] \
|
||||
-install- [pid] .log]
|
||||
|
||||
set commands(1) [list exec [file nativename $vsixInstaller]]
|
||||
|
||||
lappend commands(1) /quiet /norepair
|
||||
lappend commands(1) [appendArgs /logFile: $installLogFileName]
|
||||
lappend commands(1) [file nativename $vsixFileName]
|
||||
|
||||
###############################################################################
|
||||
|
||||
set buildLogFileName [appendArgs \
|
||||
[file rootname [file tail $vsixFileName]] \
|
||||
-build-%configuration%-%platform%- [pid] .log]
|
||||
|
||||
set commands(2) [list exec [file nativename $msBuild]]
|
||||
|
||||
lappend commands(2) [file nativename [file join $path vsixtest.sln]]
|
||||
lappend commands(2) /target:Rebuild
|
||||
lappend commands(2) /property:Configuration=%configuration%
|
||||
lappend commands(2) /property:Platform=%platform%
|
||||
|
||||
lappend commands(2) [appendArgs \
|
||||
/logger:FileLogger,Microsoft.Build.Engine\;Logfile= \
|
||||
[file nativename [file join $temporaryDirectory \
|
||||
$buildLogFileName]] \;Verbosity=diagnostic]
|
||||
|
||||
###############################################################################
|
||||
|
||||
set uninstallLogFileName [appendArgs \
|
||||
[file rootname [file tail $vsixFileName]] \
|
||||
-uninstall- [pid] .log]
|
||||
|
||||
set commands(3) [list exec [file nativename $vsixInstaller]]
|
||||
|
||||
lappend commands(3) /quiet /norepair
|
||||
lappend commands(3) [appendArgs /logFile: $uninstallLogFileName]
|
||||
lappend commands(3) [appendArgs /uninstall:SQLite.UWP.2015]
|
||||
|
||||
###############################################################################
|
||||
|
||||
if {1} then {
|
||||
catch {
|
||||
puts stdout [appendArgs \
|
||||
"Install log: \"" [file nativename [file join \
|
||||
$temporaryDirectory $installLogFileName]] \"\n]
|
||||
}
|
||||
|
||||
catch {
|
||||
puts stdout [appendArgs \
|
||||
"Build logs: \"" [file nativename [file join \
|
||||
$temporaryDirectory $buildLogFileName]] \"\n]
|
||||
}
|
||||
|
||||
catch {
|
||||
puts stdout [appendArgs \
|
||||
"Uninstall log: \"" [file nativename [file join \
|
||||
$temporaryDirectory $uninstallLogFileName]] \"\n]
|
||||
}
|
||||
}
|
||||
|
||||
###############################################################################
|
||||
|
||||
if {1} then {
|
||||
putsAndEval $commands(1)
|
||||
|
||||
set versionNumber [string trim [readFile $versionFileName]]
|
||||
set data [readFile $projectTemplateFileName]
|
||||
set data [string map [list %versionNumber% $versionNumber] $data]
|
||||
|
||||
set projectFileName [file join $path vsixtest.vcxproj]
|
||||
writeFile $projectFileName $data
|
||||
|
||||
set platforms [list x86 x64 ARM]
|
||||
set configurations [list Debug Release]
|
||||
|
||||
foreach platform $platforms {
|
||||
foreach configuration $configurations {
|
||||
putsAndEval [string map [list \
|
||||
%platform% $platform %configuration% $configuration] \
|
||||
$commands(2)]
|
||||
}
|
||||
}
|
||||
|
||||
putsAndEval $commands(3)
|
||||
}
|
198
vsixtest/vsixtest.vcxproj.data
Normal file
@ -0,0 +1,198 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{60bb14a5-0871-4656-bc38-4f0958230f9a}</ProjectGuid>
|
||||
<RootNamespace>vsixtest</RootNamespace>
|
||||
<DefaultLanguage>en-US</DefaultLanguage>
|
||||
<MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
|
||||
<AppContainerApplication>true</AppContainerApplication>
|
||||
<ApplicationType>Windows Store</ApplicationType>
|
||||
<WindowsTargetPlatformVersion>10.0.10586.0</WindowsTargetPlatformVersion>
|
||||
<WindowsTargetPlatformMinVersion>10.0.10586.0</WindowsTargetPlatformMinVersion>
|
||||
<ApplicationTypeRevision>10.0</ApplicationTypeRevision>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|ARM">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>ARM</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|ARM">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>ARM</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$([Microsoft.Build.Utilities.ToolLocationHelper]::GetPlatformExtensionSDKLocation(`SQLite.UWP.2015, Version=%versionNumber%`, $(TargetPlatformIdentifier), $(TargetPlatformVersion), $(SDKReferenceDirectoryRoot), $(SDKExtensionDirectoryRoot), $(SDKReferenceRegistryRoot)))\DesignTime\CommonConfiguration\Neutral\SQLite.UWP.2015.props" Condition="exists('$([Microsoft.Build.Utilities.ToolLocationHelper]::GetPlatformExtensionSDKLocation(`SQLite.UWP.2015, Version=%versionNumber%`, $(TargetPlatformIdentifier), $(TargetPlatformVersion), $(SDKReferenceDirectoryRoot), $(SDKExtensionDirectoryRoot), $(SDKReferenceRegistryRoot)))\DesignTime\CommonConfiguration\Neutral\SQLite.UWP.2015.props')" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$([Microsoft.Build.Utilities.ToolLocationHelper]::GetPlatformExtensionSDKLocation(`SQLite.UWP.2015, Version=%versionNumber%`, $(TargetPlatformIdentifier), $(TargetPlatformVersion), $(SDKReferenceDirectoryRoot), $(SDKExtensionDirectoryRoot), $(SDKReferenceRegistryRoot)))\DesignTime\CommonConfiguration\Neutral\SQLite.UWP.2015.props" Condition="exists('$([Microsoft.Build.Utilities.ToolLocationHelper]::GetPlatformExtensionSDKLocation(`SQLite.UWP.2015, Version=%versionNumber%`, $(TargetPlatformIdentifier), $(TargetPlatformVersion), $(SDKReferenceDirectoryRoot), $(SDKExtensionDirectoryRoot), $(SDKReferenceRegistryRoot)))\DesignTime\CommonConfiguration\Neutral\SQLite.UWP.2015.props')" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$([Microsoft.Build.Utilities.ToolLocationHelper]::GetPlatformExtensionSDKLocation(`SQLite.UWP.2015, Version=%versionNumber%`, $(TargetPlatformIdentifier), $(TargetPlatformVersion), $(SDKReferenceDirectoryRoot), $(SDKExtensionDirectoryRoot), $(SDKReferenceRegistryRoot)))\DesignTime\CommonConfiguration\Neutral\SQLite.UWP.2015.props" Condition="exists('$([Microsoft.Build.Utilities.ToolLocationHelper]::GetPlatformExtensionSDKLocation(`SQLite.UWP.2015, Version=%versionNumber%`, $(TargetPlatformIdentifier), $(TargetPlatformVersion), $(SDKReferenceDirectoryRoot), $(SDKExtensionDirectoryRoot), $(SDKReferenceRegistryRoot)))\DesignTime\CommonConfiguration\Neutral\SQLite.UWP.2015.props')" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$([Microsoft.Build.Utilities.ToolLocationHelper]::GetPlatformExtensionSDKLocation(`SQLite.UWP.2015, Version=%versionNumber%`, $(TargetPlatformIdentifier), $(TargetPlatformVersion), $(SDKReferenceDirectoryRoot), $(SDKExtensionDirectoryRoot), $(SDKReferenceRegistryRoot)))\DesignTime\CommonConfiguration\Neutral\SQLite.UWP.2015.props" Condition="exists('$([Microsoft.Build.Utilities.ToolLocationHelper]::GetPlatformExtensionSDKLocation(`SQLite.UWP.2015, Version=%versionNumber%`, $(TargetPlatformIdentifier), $(TargetPlatformVersion), $(SDKReferenceDirectoryRoot), $(SDKExtensionDirectoryRoot), $(SDKReferenceRegistryRoot)))\DesignTime\CommonConfiguration\Neutral\SQLite.UWP.2015.props')" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$([Microsoft.Build.Utilities.ToolLocationHelper]::GetPlatformExtensionSDKLocation(`SQLite.UWP.2015, Version=%versionNumber%`, $(TargetPlatformIdentifier), $(TargetPlatformVersion), $(SDKReferenceDirectoryRoot), $(SDKExtensionDirectoryRoot), $(SDKReferenceRegistryRoot)))\DesignTime\CommonConfiguration\Neutral\SQLite.UWP.2015.props" Condition="exists('$([Microsoft.Build.Utilities.ToolLocationHelper]::GetPlatformExtensionSDKLocation(`SQLite.UWP.2015, Version=%versionNumber%`, $(TargetPlatformIdentifier), $(TargetPlatformVersion), $(SDKReferenceDirectoryRoot), $(SDKExtensionDirectoryRoot), $(SDKReferenceRegistryRoot)))\DesignTime\CommonConfiguration\Neutral\SQLite.UWP.2015.props')" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$([Microsoft.Build.Utilities.ToolLocationHelper]::GetPlatformExtensionSDKLocation(`SQLite.UWP.2015, Version=%versionNumber%`, $(TargetPlatformIdentifier), $(TargetPlatformVersion), $(SDKReferenceDirectoryRoot), $(SDKExtensionDirectoryRoot), $(SDKReferenceRegistryRoot)))\DesignTime\CommonConfiguration\Neutral\SQLite.UWP.2015.props" Condition="exists('$([Microsoft.Build.Utilities.ToolLocationHelper]::GetPlatformExtensionSDKLocation(`SQLite.UWP.2015, Version=%versionNumber%`, $(TargetPlatformIdentifier), $(TargetPlatformVersion), $(SDKReferenceDirectoryRoot), $(SDKExtensionDirectoryRoot), $(SDKReferenceRegistryRoot)))\DesignTime\CommonConfiguration\Neutral\SQLite.UWP.2015.props')" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
<PackageCertificateKeyFile>vsixtest_TemporaryKey.pfx</PackageCertificateKeyFile>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
|
||||
<ClCompile>
|
||||
<AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
|
||||
<DisableSpecificWarnings>4453;28204</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
|
||||
<ClCompile>
|
||||
<AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
|
||||
<DisableSpecificWarnings>4453;28204</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
|
||||
<DisableSpecificWarnings>4453;28204</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
|
||||
<DisableSpecificWarnings>4453;28204</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
|
||||
<DisableSpecificWarnings>4453;28204</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
|
||||
<DisableSpecificWarnings>4453;28204</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="pch.h" />
|
||||
<ClInclude Include="App.xaml.h">
|
||||
<DependentUpon>App.xaml</DependentUpon>
|
||||
</ClInclude>
|
||||
<ClInclude Include="MainPage.xaml.h">
|
||||
<DependentUpon>MainPage.xaml</DependentUpon>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ApplicationDefinition Include="App.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
</ApplicationDefinition>
|
||||
<Page Include="MainPage.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<AppxManifest Include="Package.appxmanifest">
|
||||
<SubType>Designer</SubType>
|
||||
</AppxManifest>
|
||||
<None Include="vsixtest_TemporaryKey.pfx" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Image Include="Assets\LockScreenLogo.scale-200.png" />
|
||||
<Image Include="Assets\SplashScreen.scale-200.png" />
|
||||
<Image Include="Assets\Square150x150Logo.scale-200.png" />
|
||||
<Image Include="Assets\Square44x44Logo.scale-200.png" />
|
||||
<Image Include="Assets\Square44x44Logo.targetsize-24_altform-unplated.png" />
|
||||
<Image Include="Assets\StoreLogo.png" />
|
||||
<Image Include="Assets\Wide310x150Logo.scale-200.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="App.xaml.cpp">
|
||||
<DependentUpon>App.xaml</DependentUpon>
|
||||
</ClCompile>
|
||||
<ClCompile Include="MainPage.xaml.cpp">
|
||||
<DependentUpon>MainPage.xaml</DependentUpon>
|
||||
</ClCompile>
|
||||
<ClCompile Include="pch.cpp">
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<SDKReference Include="SQLite.UWP.2015, Version=%versionNumber%" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
57
vsixtest/vsixtest.vcxproj.filters
Normal file
@ -0,0 +1,57 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Common">
|
||||
<UniqueIdentifier>60bb14a5-0871-4656-bc38-4f0958230f9a</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Assets">
|
||||
<UniqueIdentifier>e6271362-8f96-476d-907f-4da227b02435</UniqueIdentifier>
|
||||
<Extensions>bmp;fbx;gif;jpg;jpeg;tga;tiff;tif;png</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ApplicationDefinition Include="App.xaml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="App.xaml.cpp" />
|
||||
<ClCompile Include="MainPage.xaml.cpp" />
|
||||
<ClCompile Include="pch.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="pch.h" />
|
||||
<ClInclude Include="App.xaml.h" />
|
||||
<ClInclude Include="MainPage.xaml.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Image Include="Assets\LockScreenLogo.scale-200.png">
|
||||
<Filter>Assets</Filter>
|
||||
</Image>
|
||||
<Image Include="Assets\SplashScreen.scale-200.png">
|
||||
<Filter>Assets</Filter>
|
||||
</Image>
|
||||
<Image Include="Assets\Square150x150Logo.scale-200.png">
|
||||
<Filter>Assets</Filter>
|
||||
</Image>
|
||||
<Image Include="Assets\Square44x44Logo.scale-200.png">
|
||||
<Filter>Assets</Filter>
|
||||
</Image>
|
||||
<Image Include="Assets\Square44x44Logo.targetsize-24_altform-unplated.png">
|
||||
<Filter>Assets</Filter>
|
||||
</Image>
|
||||
<Image Include="Assets\StoreLogo.png">
|
||||
<Filter>Assets</Filter>
|
||||
</Image>
|
||||
<Image Include="Assets\Wide310x150Logo.scale-200.png">
|
||||
<Filter>Assets</Filter>
|
||||
</Image>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<AppxManifest Include="Package.appxmanifest" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="vsixtest_TemporaryKey.pfx" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Page Include="MainPage.xaml" />
|
||||
</ItemGroup>
|
||||
</Project>
|