Merge latest trunk changes, including the changes to the fts5 locale=1 feature, into this branch.
FossilOrigin-Name: d2f0d19936222911bc317efecc831007d3aba81f9b32877030ffb29d1728bbdc
This commit is contained in:
commit
6e8b3d3caa
17
Makefile.in
17
Makefile.in
@ -661,11 +661,16 @@ SQLITE3_SHELL_TARGET_ = sqlite3$(TEXE)
|
||||
SQLITE3_SHELL_TARGET_1 =
|
||||
SQLITE3_SHELL_TARGET = $(SQLITE3_SHELL_TARGET_@HAVE_WASI_SDK@)
|
||||
|
||||
# Use $(libtclsqlite3.la_$(HAVE_TCL)) to resolve to either
|
||||
# libtclsqlite3.la or an empty value.
|
||||
libtclsqlite3.la_0 =
|
||||
libtclsqlite3.la_1 = libtclsqlite3.la
|
||||
|
||||
# This is the default Makefile target. The objects listed here
|
||||
# are what get build when you type just "make" with no arguments.
|
||||
#
|
||||
all: sqlite3.h libsqlite3.la $(SQLITE3_SHELL_TARGET) \
|
||||
$(HAVE_TCL:1=libtclsqlite3.la)
|
||||
$(libtclsqlite3.la_$(HAVE_TCL))
|
||||
|
||||
Makefile: $(TOP)/Makefile.in
|
||||
./config.status
|
||||
@ -1189,6 +1194,7 @@ SHELL_DEP = \
|
||||
$(TOP)/ext/misc/shathree.c \
|
||||
$(TOP)/ext/misc/sqlar.c \
|
||||
$(TOP)/ext/misc/uint.c \
|
||||
$(TOP)/ext/misc/vfstrace.c \
|
||||
$(TOP)/ext/misc/zipfile.c \
|
||||
$(TOP)/ext/recover/dbdata.c \
|
||||
$(TOP)/ext/recover/sqlite3recover.c \
|
||||
@ -1566,7 +1572,12 @@ lib_install: libsqlite3.la
|
||||
$(INSTALL) -d $(DESTDIR)$(libdir)
|
||||
$(LTINSTALL) libsqlite3.la $(DESTDIR)$(libdir)
|
||||
|
||||
install: sqlite3$(TEXE) lib_install sqlite3.h sqlite3.pc ${HAVE_TCL:1=tcl_install}
|
||||
# Use $(tcl_install_$(HAVE_TCL)) to resolve to either tcl_install or
|
||||
# an empty value.
|
||||
tcl_install_0 =
|
||||
tcl_install_1 = tcl_install
|
||||
|
||||
install: sqlite3$(TEXE) lib_install sqlite3.h sqlite3.pc $(tcl_install_$(HAVE_TCL))
|
||||
$(INSTALL) -d $(DESTDIR)$(bindir)
|
||||
$(LTINSTALL) sqlite3$(TEXE) $(DESTDIR)$(bindir)
|
||||
$(INSTALL) -d $(DESTDIR)$(includedir)
|
||||
@ -1626,7 +1637,7 @@ tidy:
|
||||
rm -f LogEst$(TEXE) fts3view$(TEXE) rollback-test$(TEXE) showdb$(TEXE)
|
||||
rm -f showjournal$(TEXE) showstat4$(TEXE) showwal$(TEXE) speedtest1$(TEXE)
|
||||
rm -f wordcount$(TEXE) changeset$(TEXE) version-info$(TEXE)
|
||||
rm -f *.dll *.lib *.exp *.def *.pc *.vsix
|
||||
rm -f *.dll *.lib *.exp *.def *.pc *.vsix *.so *.dylib pkgIndex.tcl
|
||||
rm -f sqlite3_analyzer$(TEXE)
|
||||
rm -f mptester$(TEXE) rbu$(TEXE) srcck1$(TEXE)
|
||||
rm -f fuzzershell$(TEXE) fuzzcheck$(TEXE) sqldiff$(TEXE) dbhash$(TEXE)
|
||||
|
@ -938,7 +938,7 @@ TCLSUFFIX =
|
||||
!ENDIF
|
||||
|
||||
!IFNDEF TCLDIR
|
||||
TCLDIR = $(TOP)\compat\tcl
|
||||
TCLDIR = C:\Tcl
|
||||
!ENDIF
|
||||
|
||||
!IFNDEF TCLINCDIR
|
||||
@ -2320,6 +2320,7 @@ SHELL_DEP = \
|
||||
$(TOP)\ext\misc\shathree.c \
|
||||
$(TOP)\ext\misc\sqlar.c \
|
||||
$(TOP)\ext\misc\uint.c \
|
||||
$(TOP)\ext\misc\vfstrace.c \
|
||||
$(TOP)\ext\misc\zipfile.c \
|
||||
$(TOP)\ext\recover\dbdata.c \
|
||||
$(TOP)\ext\recover\sqlite3recover.c \
|
||||
|
50
README.md
50
README.md
@ -73,23 +73,26 @@ archives or [SQLite archives](https://sqlite.org/cli.html#sqlar) as follows:
|
||||
then click on the "Tarball" or "ZIP Archive" links on the information
|
||||
page.
|
||||
|
||||
To access sources directly using Fossil, first install Fossil version 2.0 or later.
|
||||
Source tarballs and precompiled binaries available
|
||||
[here](https://www.fossil-scm.org/home/uv/download.html). Fossil is
|
||||
To access sources directly using [Fossil](https://fossil-scm.org/home),
|
||||
first install Fossil version 2.0 or later.
|
||||
Source tarballs and precompiled binaries available at
|
||||
<https://fossil-scm.org/home/uv/download.html>. Fossil is
|
||||
a stand-alone program. To install, simply download or build the single
|
||||
executable file and put that file someplace on your $PATH.
|
||||
Then run commands like this:
|
||||
|
||||
mkdir -p ~/sqlite ~/Fossils
|
||||
mkdir -p ~/sqlite
|
||||
cd ~/sqlite
|
||||
fossil clone https://www.sqlite.org/src ~/Fossils/sqlite.fossil
|
||||
fossil open ~/Fossils/sqlite.fossil
|
||||
fossil open https://sqlite.org/src
|
||||
|
||||
After setting up a repository using the steps above, you can do
|
||||
bandwidth-efficient updates to the latest version using:
|
||||
The "fossil open" command will take two or three minutes. Afterwards,
|
||||
you can do fast, bandwidth-efficient updates to the whatever versions
|
||||
of SQLite you like. Some examples:
|
||||
|
||||
fossil update trunk ;# latest trunk check-in
|
||||
fossil update release ;# latest official release
|
||||
fossil update trunk:2024-01-01 ;# First trunk check-in after 2024-01-01
|
||||
fossil update version-3.39.0 ;# Version 3.39.0
|
||||
|
||||
Or type "fossil ui" to get a web-based user interface.
|
||||
|
||||
@ -103,17 +106,19 @@ script found at the root of the source tree. Then run "make".
|
||||
|
||||
For example:
|
||||
|
||||
apt install gcc make tcl-dev ;# Make sure you have all the necessary build tools
|
||||
tar xzf sqlite.tar.gz ;# Unpack the source tree into "sqlite"
|
||||
mkdir bld ;# Build will occur in a sibling directory
|
||||
cd bld ;# Change to the build directory
|
||||
../sqlite/configure ;# Run the configure script
|
||||
make sqlite3 ;# Builds the "sqlite3" command-line tool
|
||||
make sqlite3.c ;# Build the "amalgamation" source file
|
||||
make devtest ;# Run development tests (requires tcl-dev)
|
||||
make releasetest ;# Run full release tests (requires tcl-dev)
|
||||
make sqldiff ;# Builds the "sqldiff" command-line tool
|
||||
make sqlite3_analyzer ;# Builds the "sqlite3_analyzer" tool (requires tcl-dev)
|
||||
# Makefile targets below this point require tcl-dev
|
||||
make tclextension-install ;# Build and install the SQLite TCL extension
|
||||
make devtest ;# Run development tests
|
||||
make releasetest ;# Run full release tests
|
||||
make sqlite3_analyzer ;# Builds the "sqlite3_analyzer" tool
|
||||
|
||||
See the makefile for additional targets. For debugging builds, the
|
||||
core developers typically run "configure" with options like this:
|
||||
@ -124,9 +129,12 @@ For release builds, the core developers usually do:
|
||||
|
||||
../sqlite/configure --enable-all
|
||||
|
||||
Almost all makefile targets require a "tclsh" TCL interpreter
|
||||
version 8.6 or later. The targets marked with "(requires tcl-dev)" also require
|
||||
the TCL development libraries.
|
||||
Almost all makefile targets require a "tclsh" TCL interpreter version 8.6 or
|
||||
later. The "tclextension-install" target and the test targets that follow
|
||||
all require TCL development libraries too. ("apt install tcl-dev"). It is
|
||||
helpful, but is not required, to install the SQLite TCL extension (the
|
||||
"tclextension-install" target) prior to running tests. The "releasetest"
|
||||
target has additional requiremenst, such as "valgrind".
|
||||
|
||||
On "make" command-lines, one can add "OPTIONS=..." to specify additional
|
||||
compile-time options over and above those set by ./configure. For example,
|
||||
@ -143,7 +151,7 @@ show what changes are needed.
|
||||
|
||||
## Compiling for Windows Using MSVC
|
||||
|
||||
On Windows, all applicable build products can be compiled with MSVC.
|
||||
On Windows, everything can be compiled with MSVC.
|
||||
You will also need a working installation of TCL.
|
||||
See the [compile-for-windows.md](doc/compile-for-windows.md) document for
|
||||
additional information about how to install MSVC and TCL and configure your
|
||||
@ -157,15 +165,21 @@ TCL library, using a command like this:
|
||||
SQLite uses "tclsh.exe" as part of the build process, and so that
|
||||
program will need to be somewhere on your %PATH%. SQLite itself
|
||||
does not contain any TCL code, but it does use TCL to help with the
|
||||
build process and to run tests.
|
||||
build process and to run tests. You may need to install TCL development
|
||||
libraries in order to successfully complete some makefile targets.
|
||||
It is helpful, but is not required, to install the SQLite TCL extension
|
||||
(the "tclextension-install" target) prior to running tests.
|
||||
|
||||
Build using Makefile.msc. Example:
|
||||
|
||||
nmake /f Makefile.msc sqlite3.exe
|
||||
nmake /f Makefile.msc sqlite3.c
|
||||
nmake /f Makefile.msc sqldiff.exe
|
||||
# Makefile targets below this point require TCL development libraries
|
||||
nmake /f Makefile.msc tclextension-install
|
||||
nmake /f Makefile.msc devtest
|
||||
nmake /f Makefile.msc releasetest
|
||||
nmake /f Makefile.msc tclextension-install
|
||||
nmake /f Makefile.msc sqlite3_analyzer.exe
|
||||
|
||||
There are many other makefile targets. See comments in Makefile.msc for
|
||||
details.
|
||||
@ -372,7 +386,7 @@ implementation. It will not be the easiest library in the world to hack.
|
||||
* **VERSION**, **manifest**, and **manifest.uuid** - These files define
|
||||
the current SQLite version number. The "VERSION" file is human generated,
|
||||
but the "manifest" and "manifest.uuid" files are automatically generated
|
||||
by the [Fossil version control system](https://fossil-scm/).
|
||||
by the [Fossil version control system](https://fossil-scm.org/).
|
||||
|
||||
There are many other source files. Each has a succinct header comment that
|
||||
describes its purpose and role within the larger system.
|
||||
|
@ -57,11 +57,22 @@ canonical source on a new Windows 11 PC, as of 2023-11-01:
|
||||
<ul>
|
||||
<li> `nmake /f makefile.msc`
|
||||
<li> `nmake /f makefile.msc sqlite3.c`
|
||||
<li> `nmake /f makefile.msc sqlite3.exe`
|
||||
<li> `nmake /f makefile.msc sqldiff.exe`
|
||||
<li> `nmake /f makefile.msc tclextension-install`
|
||||
<li> `nmake /f makefile.msc devtest`
|
||||
<li> `nmake /f makefile.msc releasetest`
|
||||
<li> `nmake /f makefile.msc sqlite3.exe`
|
||||
<li> `nmake /f makefile.msc sqlite3_analyzer.exe`
|
||||
</ul>
|
||||
|
||||
It is not required that you run the "tclextension-install" target prior to
|
||||
running tests. However, the tests will run more smoothly if you do.
|
||||
The version of SQLite used for the TCL extension does *not* need to
|
||||
correspond to the version of SQLite under test. So you can install the
|
||||
SQLite TCL extension once, and then use it to test many different versions
|
||||
of SQLite.
|
||||
|
||||
|
||||
7. For a debugging build of the CLI, where the ".treetrace" and ".wheretrace"
|
||||
commands work, add the DEBUG=3 argument to nmake. Like this:
|
||||
<ul>
|
||||
|
@ -655,6 +655,10 @@ cfWrite(const void *buf, size_t osz, size_t ocnt, FILE *pf){
|
||||
return rv;
|
||||
}
|
||||
|
||||
/* An fgets() equivalent, using Win32 file API for actual input.
|
||||
** Input ends when given buffer is filled or a newline is read.
|
||||
** If the FILE object is in text mode, swallows 0x0D. (ASCII CR)
|
||||
*/
|
||||
SQLITE_INTERNAL_LINKAGE char *
|
||||
cfGets(char *cBuf, int n, FILE *pf){
|
||||
int nci = 0;
|
||||
@ -665,7 +669,10 @@ cfGets(char *cBuf, int n, FILE *pf){
|
||||
while( nci < n-1 ){
|
||||
DWORD nr;
|
||||
if( !ReadFile(fai.fh, cBuf+nci, 1, &nr, 0) || nr==0 ) break;
|
||||
if( nr>0 && (!eatCR || cBuf[nci]!='\r') ) nci += nr;
|
||||
if( nr>0 && (!eatCR || cBuf[nci]!='\r') ){
|
||||
nci += nr;
|
||||
if( cBuf[nci-nr]=='\n' ) break;
|
||||
}
|
||||
}
|
||||
if( nci < n ) cBuf[nci] = 0;
|
||||
return (nci>0)? cBuf : 0;
|
||||
|
@ -637,16 +637,13 @@ Fts5Table *sqlite3Fts5TableFromCsrid(Fts5Global*, i64);
|
||||
|
||||
int sqlite3Fts5FlushToDisk(Fts5Table*);
|
||||
|
||||
int sqlite3Fts5ExtractText(
|
||||
Fts5Config *pConfig,
|
||||
sqlite3_value *pVal, /* Value to extract text from */
|
||||
int bContent, /* Loaded from content table */
|
||||
int *pbResetTokenizer, /* OUT: True if ClearLocale() required */
|
||||
const char **ppText, /* OUT: Pointer to text buffer */
|
||||
int *pnText /* OUT: Size of (*ppText) in bytes */
|
||||
);
|
||||
|
||||
void sqlite3Fts5ClearLocale(Fts5Config *pConfig);
|
||||
void sqlite3Fts5SetLocale(Fts5Config *pConfig, const char *pLoc, int nLoc);
|
||||
|
||||
int sqlite3Fts5IsLocaleValue(Fts5Config *pConfig, sqlite3_value *pVal);
|
||||
int sqlite3Fts5DecodeLocaleValue(sqlite3_value *pVal,
|
||||
const char **ppText, int *pnText, const char **ppLoc, int *pnLoc
|
||||
);
|
||||
|
||||
/*
|
||||
** End of interface to code in fts5.c.
|
||||
|
@ -524,6 +524,15 @@ static int fts5ConfigMakeExprlist(Fts5Config *p){
|
||||
}
|
||||
}
|
||||
}
|
||||
if( p->eContent==FTS5_CONTENT_NORMAL && p->bLocale ){
|
||||
for(i=0; i<p->nCol; i++){
|
||||
if( p->abUnindexed[i]==0 ){
|
||||
sqlite3Fts5BufferAppendPrintf(&rc, &buf, ", T.l%d", i);
|
||||
}else{
|
||||
sqlite3Fts5BufferAppendPrintf(&rc, &buf, ", NULL");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
assert( p->zContentExprlist==0 );
|
||||
p->zContentExprlist = (char*)buf.p;
|
||||
|
@ -83,8 +83,17 @@ struct Fts5Global {
|
||||
Fts5TokenizerModule *pTok; /* First in list of all tokenizer modules */
|
||||
Fts5TokenizerModule *pDfltTok; /* Default tokenizer module */
|
||||
Fts5Cursor *pCsr; /* First in list of all open cursors */
|
||||
u32 aLocaleHdr[4];
|
||||
};
|
||||
|
||||
/*
|
||||
** Size of header on fts5_locale() values. And macro to access a buffer
|
||||
** containing a copy of the header from an Fts5Config pointer.
|
||||
*/
|
||||
#define FTS5_LOCALE_HDR_SIZE ((int)sizeof( ((Fts5Global*)0)->aLocaleHdr ))
|
||||
#define FTS5_LOCALE_HDR(pConfig) ((const u8*)(pConfig->pGlobal->aLocaleHdr))
|
||||
|
||||
|
||||
/*
|
||||
** Each auxiliary function registered with the FTS5 module is represented
|
||||
** by an object of the following type. All such objects are stored as part
|
||||
@ -247,12 +256,6 @@ struct Fts5Cursor {
|
||||
#define BitFlagAllTest(x,y) (((x) & (y))==(y))
|
||||
#define BitFlagTest(x,y) (((x) & (y))!=0)
|
||||
|
||||
/*
|
||||
** The subtype value and header bytes used by fts5_locale().
|
||||
*/
|
||||
#define FTS5_LOCALE_SUBTYPE ((unsigned int)'L')
|
||||
#define FTS5_LOCALE_HEADER "\x00\xE0\xB2\xEB"
|
||||
|
||||
|
||||
/*
|
||||
** Macros to Set(), Clear() and Test() cursor flags.
|
||||
@ -1256,7 +1259,7 @@ static void fts5SetVtabError(Fts5FullTable *p, const char *zFormat, ...){
|
||||
** valid until after the final call to sqlite3Fts5Tokenize() that will use
|
||||
** the locale.
|
||||
*/
|
||||
static void fts5SetLocale(
|
||||
static void sqlite3Fts5SetLocale(
|
||||
Fts5Config *pConfig,
|
||||
const char *zLocale,
|
||||
int nLocale
|
||||
@ -1267,127 +1270,74 @@ static void fts5SetLocale(
|
||||
}
|
||||
|
||||
/*
|
||||
** Clear any locale configured by an earlier call to fts5SetLocale() or
|
||||
** sqlite3Fts5ExtractText().
|
||||
** Clear any locale configured by an earlier call to sqlite3Fts5SetLocale().
|
||||
*/
|
||||
void sqlite3Fts5ClearLocale(Fts5Config *pConfig){
|
||||
fts5SetLocale(pConfig, 0, 0);
|
||||
sqlite3Fts5SetLocale(pConfig, 0, 0);
|
||||
}
|
||||
|
||||
/*
|
||||
** This function is used to extract utf-8 text from an sqlite3_value. This
|
||||
** is usually done in order to tokenize it. For example, when:
|
||||
**
|
||||
** * a value is written to an fts5 table,
|
||||
** * a value is deleted from an FTS5_CONTENT_NORMAL table,
|
||||
** * a value containing a query expression is passed to xFilter()
|
||||
**
|
||||
** and so on.
|
||||
**
|
||||
** This function handles 2 cases:
|
||||
**
|
||||
** 1) Ordinary values. The text can be extracted from these using
|
||||
** sqlite3_value_text().
|
||||
**
|
||||
** 2) Combination text/locale blobs created by fts5_locale(). There
|
||||
** are several cases for these:
|
||||
**
|
||||
** * Blobs tagged with FTS5_LOCALE_SUBTYPE.
|
||||
** * Blobs read from the content table of a locale=1 external-content
|
||||
** table, and
|
||||
** * Blobs read from the content table of a locale=1 regular
|
||||
** content table.
|
||||
**
|
||||
** The first two cases above should have the 4 byte FTS5_LOCALE_HEADER
|
||||
** header. It is an error if a blob with the subtype or a blob read
|
||||
** from the content table of an external content table does not have
|
||||
** the required header. A blob read from the content table of a regular
|
||||
** locale=1 table does not have the header. This is to save space.
|
||||
**
|
||||
** If successful, SQLITE_OK is returned and output parameters (*ppText)
|
||||
** and (*pnText) are set to point to a buffer containing the extracted utf-8
|
||||
** text and its length in bytes, respectively. The buffer is not
|
||||
** nul-terminated. It has the same lifetime as the sqlite3_value object
|
||||
** from which it is extracted.
|
||||
**
|
||||
** Parameter bContent must be true if the value was read from an indexed
|
||||
** column (i.e. not UNINDEXED) of the on disk content.
|
||||
**
|
||||
** If pbResetTokenizer is not NULL and if case (2) is used, then
|
||||
** fts5SetLocale() is called to ensure subsequent sqlite3Fts5Tokenize() calls
|
||||
** use the locale. In this case (*pbResetTokenizer) is set to true before
|
||||
** returning, to indicate that the caller must call sqlite3Fts5ClearLocale()
|
||||
** to clear the locale after tokenizing the text.
|
||||
** Return true if the value passed as the only argument is an
|
||||
** fts5_locale() value.
|
||||
*/
|
||||
int sqlite3Fts5ExtractText(
|
||||
Fts5Config *pConfig,
|
||||
sqlite3_value *pVal, /* Value to extract text from */
|
||||
int bContent, /* True if indexed table content */
|
||||
int *pbResetTokenizer, /* OUT: True if xSetLocale(NULL) required */
|
||||
const char **ppText, /* OUT: Pointer to text buffer */
|
||||
int *pnText /* OUT: Size of (*ppText) in bytes */
|
||||
){
|
||||
const char *pText = 0;
|
||||
int nText = 0;
|
||||
int rc = SQLITE_OK;
|
||||
int bDecodeBlob = 0;
|
||||
|
||||
assert( pbResetTokenizer==0 || *pbResetTokenizer==0 );
|
||||
assert( bContent==0 || pConfig->eContent!=FTS5_CONTENT_NONE );
|
||||
assert( bContent==0 || sqlite3_value_subtype(pVal)==0 );
|
||||
|
||||
int sqlite3Fts5IsLocaleValue(Fts5Config *pConfig, sqlite3_value *pVal){
|
||||
int ret = 0;
|
||||
if( sqlite3_value_type(pVal)==SQLITE_BLOB ){
|
||||
if( sqlite3_value_subtype(pVal)==FTS5_LOCALE_SUBTYPE
|
||||
|| (bContent && pConfig->bLocale)
|
||||
){
|
||||
bDecodeBlob = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if( bDecodeBlob ){
|
||||
const int SZHDR = sizeof(FTS5_LOCALE_HEADER)-1;
|
||||
/* Call sqlite3_value_bytes() after sqlite3_value_blob() in this case.
|
||||
** If the blob was created using zeroblob(), then sqlite3_value_blob()
|
||||
** may call malloc(). If this malloc() fails, then the values returned
|
||||
** by both value_blob() and value_bytes() will be 0. If value_bytes() were
|
||||
** called first, then the NULL pointer returned by value_blob() might
|
||||
** be dereferenced. */
|
||||
const u8 *pBlob = sqlite3_value_blob(pVal);
|
||||
int nBlob = sqlite3_value_bytes(pVal);
|
||||
if( nBlob>FTS5_LOCALE_HDR_SIZE
|
||||
&& 0==memcmp(pBlob, FTS5_LOCALE_HDR(pConfig), FTS5_LOCALE_HDR_SIZE)
|
||||
){
|
||||
ret = 1;
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* Unless this blob was read from the %_content table of an
|
||||
** FTS5_CONTENT_NORMAL table, it should have the 4 byte fts5_locale()
|
||||
** header. Check for this. If it is not found, return an error. */
|
||||
if( (!bContent || pConfig->eContent!=FTS5_CONTENT_NORMAL) ){
|
||||
if( nBlob<SZHDR || memcmp(FTS5_LOCALE_HEADER, pBlob, SZHDR) ){
|
||||
rc = SQLITE_ERROR;
|
||||
}else{
|
||||
pBlob += 4;
|
||||
nBlob -= 4;
|
||||
}
|
||||
}
|
||||
/*
|
||||
** Value pVal is guaranteed to be an fts5_locale() value, according to
|
||||
** sqlite3Fts5IsLocaleValue(). This function extracts the text and locale
|
||||
** from the value and returns them separately.
|
||||
**
|
||||
** If successful, SQLITE_OK is returned and (*ppText) and (*ppLoc) set
|
||||
** to point to buffers containing the text and locale, as utf-8,
|
||||
** respectively. In this case output parameters (*pnText) and (*pnLoc) are
|
||||
** set to the sizes in bytes of these two buffers.
|
||||
**
|
||||
** Or, if an error occurs, then an SQLite error code is returned. The final
|
||||
** value of the four output parameters is undefined in this case.
|
||||
*/
|
||||
int sqlite3Fts5DecodeLocaleValue(
|
||||
sqlite3_value *pVal,
|
||||
const char **ppText,
|
||||
int *pnText,
|
||||
const char **ppLoc,
|
||||
int *pnLoc
|
||||
){
|
||||
const char *p = sqlite3_value_blob(pVal);
|
||||
int n = sqlite3_value_bytes(pVal);
|
||||
int nLoc = 0;
|
||||
|
||||
if( rc==SQLITE_OK ){
|
||||
int nLocale = 0;
|
||||
assert( sqlite3_value_type(pVal)==SQLITE_BLOB );
|
||||
assert( n>FTS5_LOCALE_HDR_SIZE );
|
||||
|
||||
for(nLocale=0; nLocale<nBlob; nLocale++){
|
||||
if( pBlob[nLocale]==0x00 ) break;
|
||||
for(nLoc=FTS5_LOCALE_HDR_SIZE; p[nLoc]; nLoc++){
|
||||
if( nLoc==(n-1) ){
|
||||
return SQLITE_MISMATCH;
|
||||
}
|
||||
if( nLocale==nBlob || nLocale==0 ){
|
||||
rc = SQLITE_ERROR;
|
||||
}else{
|
||||
pText = (const char*)&pBlob[nLocale+1];
|
||||
nText = nBlob-nLocale-1;
|
||||
}
|
||||
*ppLoc = &p[FTS5_LOCALE_HDR_SIZE];
|
||||
*pnLoc = nLoc - FTS5_LOCALE_HDR_SIZE;
|
||||
|
||||
if( pbResetTokenizer ){
|
||||
fts5SetLocale(pConfig, (const char*)pBlob, nLocale);
|
||||
*pbResetTokenizer = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}else{
|
||||
pText = (const char*)sqlite3_value_text(pVal);
|
||||
nText = sqlite3_value_bytes(pVal);
|
||||
}
|
||||
|
||||
*ppText = pText;
|
||||
*pnText = nText;
|
||||
return rc;
|
||||
*ppText = &p[nLoc+1];
|
||||
*pnText = n - nLoc - 1;
|
||||
return SQLITE_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
@ -1396,8 +1346,8 @@ int sqlite3Fts5ExtractText(
|
||||
** the text of the expression, and sets output variable (*pzText) to
|
||||
** point to a nul-terminated buffer containing the expression.
|
||||
**
|
||||
** If pVal was an fts5_locale() value, then fts5SetLocale() is called to
|
||||
** set the tokenizer to use the specified locale.
|
||||
** If pVal was an fts5_locale() value, then sqlite3Fts5SetLocale() is called
|
||||
** to set the tokenizer to use the specified locale.
|
||||
**
|
||||
** If output variable (*pbFreeAndReset) is set to true, then the caller
|
||||
** is required to (a) call sqlite3Fts5ClearLocale() to reset the tokenizer
|
||||
@ -1409,24 +1359,22 @@ static int fts5ExtractExprText(
|
||||
char **pzText, /* OUT: nul-terminated buffer of text */
|
||||
int *pbFreeAndReset /* OUT: Free (*pzText) and clear locale */
|
||||
){
|
||||
const char *zText = 0;
|
||||
int nText = 0;
|
||||
int rc = SQLITE_OK;
|
||||
int bReset = 0;
|
||||
|
||||
*pbFreeAndReset = 0;
|
||||
rc = sqlite3Fts5ExtractText(pConfig, pVal, 0, &bReset, &zText, &nText);
|
||||
if( sqlite3Fts5IsLocaleValue(pConfig, pVal) ){
|
||||
const char *pText = 0;
|
||||
int nText = 0;
|
||||
const char *pLoc = 0;
|
||||
int nLoc = 0;
|
||||
rc = sqlite3Fts5DecodeLocaleValue(pVal, &pText, &nText, &pLoc, &nLoc);
|
||||
*pzText = sqlite3Fts5Mprintf(&rc, "%.*s", nText, pText);
|
||||
if( rc==SQLITE_OK ){
|
||||
if( bReset ){
|
||||
*pzText = sqlite3Fts5Mprintf(&rc, "%.*s", nText, zText);
|
||||
if( rc!=SQLITE_OK ){
|
||||
sqlite3Fts5ClearLocale(pConfig);
|
||||
}else{
|
||||
sqlite3Fts5SetLocale(pConfig, pLoc, nLoc);
|
||||
}
|
||||
*pbFreeAndReset = 1;
|
||||
}
|
||||
}else{
|
||||
*pzText = (char*)zText;
|
||||
}
|
||||
*pzText = (char*)sqlite3_value_text(pVal);
|
||||
*pbFreeAndReset = 0;
|
||||
}
|
||||
|
||||
return rc;
|
||||
@ -1968,19 +1916,14 @@ static int fts5UpdateMethod(
|
||||
else{
|
||||
int eType1 = sqlite3_value_numeric_type(apVal[1]);
|
||||
|
||||
/* Ensure that no fts5_locale() values are written to locale=0 tables.
|
||||
** And that no blobs except fts5_locale() blobs are written to indexed
|
||||
** (i.e. not UNINDEXED) columns of locale=1 tables. */
|
||||
/* It is an error to write an fts5_locale() value to a table without
|
||||
** the locale=1 option. */
|
||||
if( pConfig->bLocale==0 ){
|
||||
int ii;
|
||||
for(ii=0; ii<pConfig->nCol; ii++){
|
||||
if( sqlite3_value_type(apVal[ii+2])==SQLITE_BLOB ){
|
||||
int bSub = (sqlite3_value_subtype(apVal[ii+2])==FTS5_LOCALE_SUBTYPE);
|
||||
if( (pConfig->bLocale && !bSub && pConfig->abUnindexed[ii]==0)
|
||||
|| (pConfig->bLocale==0 && bSub)
|
||||
){
|
||||
if( pConfig->bLocale==0 ){
|
||||
sqlite3_value *pVal = apVal[ii+2];
|
||||
if( sqlite3Fts5IsLocaleValue(pConfig, pVal) ){
|
||||
fts5SetVtabError(pTab, "fts5_locale() requires locale=1");
|
||||
}
|
||||
rc = SQLITE_MISMATCH;
|
||||
goto update_out;
|
||||
}
|
||||
@ -2141,11 +2084,11 @@ static int fts5ApiTokenize_v2(
|
||||
Fts5Table *pTab = (Fts5Table*)(pCsr->base.pVtab);
|
||||
int rc = SQLITE_OK;
|
||||
|
||||
fts5SetLocale(pTab->pConfig, pLoc, nLoc);
|
||||
sqlite3Fts5SetLocale(pTab->pConfig, pLoc, nLoc);
|
||||
rc = sqlite3Fts5Tokenize(pTab->pConfig,
|
||||
FTS5_TOKENIZE_AUX, pText, nText, pUserData, xToken
|
||||
);
|
||||
fts5SetLocale(pTab->pConfig, 0, 0);
|
||||
sqlite3Fts5SetLocale(pTab->pConfig, 0, 0);
|
||||
|
||||
return rc;
|
||||
}
|
||||
@ -2173,6 +2116,49 @@ static int fts5ApiPhraseSize(Fts5Context *pCtx, int iPhrase){
|
||||
return sqlite3Fts5ExprPhraseSize(pCsr->pExpr, iPhrase);
|
||||
}
|
||||
|
||||
/*
|
||||
** Argument pStmt is an SQL statement of the type used by Fts5Cursor. This
|
||||
** function extracts the text value of column iCol of the current row.
|
||||
** Additionally, if there is an associated locale, it invokes
|
||||
** sqlite3Fts5SetLocale() to configure the tokenizer. In all cases the caller
|
||||
** should invoke sqlite3Fts5ClearLocale() to clear the locale at some point
|
||||
** after this function returns.
|
||||
**
|
||||
** If successful, (*ppText) is set to point to a buffer containing the text
|
||||
** value as utf-8 and SQLITE_OK returned. (*pnText) is set to the size of that
|
||||
** buffer in bytes. It is not guaranteed to be nul-terminated. If an error
|
||||
** occurs, an SQLite error code is returned. The final values of the two
|
||||
** output parameters are undefined in this case.
|
||||
*/
|
||||
static int fts5TextFromStmt(
|
||||
Fts5Config *pConfig,
|
||||
sqlite3_stmt *pStmt,
|
||||
int iCol,
|
||||
const char **ppText,
|
||||
int *pnText
|
||||
){
|
||||
sqlite3_value *pVal = sqlite3_column_value(pStmt, iCol+1);
|
||||
const char *pLoc = 0;
|
||||
int nLoc = 0;
|
||||
int rc = SQLITE_OK;
|
||||
|
||||
if( pConfig->bLocale
|
||||
&& pConfig->eContent==FTS5_CONTENT_EXTERNAL
|
||||
&& sqlite3Fts5IsLocaleValue(pConfig, pVal)
|
||||
){
|
||||
rc = sqlite3Fts5DecodeLocaleValue(pVal, ppText, pnText, &pLoc, &nLoc);
|
||||
}else{
|
||||
*ppText = (const char*)sqlite3_value_text(pVal);
|
||||
*pnText = sqlite3_value_bytes(pVal);
|
||||
if( pConfig->bLocale && pConfig->eContent==FTS5_CONTENT_NORMAL ){
|
||||
pLoc = (const char*)sqlite3_column_text(pStmt, iCol+1+pConfig->nCol);
|
||||
nLoc = sqlite3_column_bytes(pStmt, iCol+1+pConfig->nCol);
|
||||
}
|
||||
}
|
||||
sqlite3Fts5SetLocale(pConfig, pLoc, nLoc);
|
||||
return rc;
|
||||
}
|
||||
|
||||
static int fts5ApiColumnText(
|
||||
Fts5Context *pCtx,
|
||||
int iCol,
|
||||
@ -2192,10 +2178,8 @@ static int fts5ApiColumnText(
|
||||
}else{
|
||||
rc = fts5SeekCursor(pCsr, 0);
|
||||
if( rc==SQLITE_OK ){
|
||||
Fts5Config *pConfig = pTab->pConfig;
|
||||
int bContent = (pConfig->abUnindexed[iCol]==0);
|
||||
sqlite3_value *pVal = sqlite3_column_value(pCsr->pStmt, iCol+1);
|
||||
sqlite3Fts5ExtractText(pConfig, pVal, bContent, 0, pz, pn);
|
||||
rc = fts5TextFromStmt(pTab->pConfig, pCsr->pStmt, iCol, pz, pn);
|
||||
sqlite3Fts5ClearLocale(pTab->pConfig);
|
||||
}
|
||||
}
|
||||
return rc;
|
||||
@ -2237,17 +2221,15 @@ static int fts5CsrPoslist(
|
||||
rc = fts5SeekCursor(pCsr, 0);
|
||||
}
|
||||
for(i=0; i<pConfig->nCol && rc==SQLITE_OK; i++){
|
||||
sqlite3_value *pVal = sqlite3_column_value(pCsr->pStmt, i+1);
|
||||
const char *z = 0;
|
||||
int n = 0;
|
||||
int bReset = 0;
|
||||
rc = sqlite3Fts5ExtractText(pConfig, pVal, 1, &bReset, &z, &n);
|
||||
rc = fts5TextFromStmt(pConfig, pCsr->pStmt, i, &z, &n);
|
||||
if( rc==SQLITE_OK ){
|
||||
rc = sqlite3Fts5ExprPopulatePoslists(
|
||||
pConfig, pCsr->pExpr, aPopulator, i, z, n
|
||||
);
|
||||
}
|
||||
if( bReset ) sqlite3Fts5ClearLocale(pConfig);
|
||||
sqlite3Fts5ClearLocale(pConfig);
|
||||
}
|
||||
sqlite3_free(aPopulator);
|
||||
|
||||
@ -2419,7 +2401,7 @@ static int fts5ApiColumnSize(Fts5Context *pCtx, int iCol, int *pnToken){
|
||||
if( pConfig->bColumnsize ){
|
||||
i64 iRowid = fts5CursorRowid(pCsr);
|
||||
rc = sqlite3Fts5StorageDocsize(pTab->pStorage, iRowid, pCsr->aColumnSize);
|
||||
}else if( pConfig->zContent==0 ){
|
||||
}else if( !pConfig->zContent || pConfig->eContent==FTS5_CONTENT_UNINDEXED ){
|
||||
int i;
|
||||
for(i=0; i<pConfig->nCol; i++){
|
||||
if( pConfig->abUnindexed[i]==0 ){
|
||||
@ -2433,17 +2415,14 @@ static int fts5ApiColumnSize(Fts5Context *pCtx, int iCol, int *pnToken){
|
||||
if( pConfig->abUnindexed[i]==0 ){
|
||||
const char *z = 0;
|
||||
int n = 0;
|
||||
int bReset = 0;
|
||||
sqlite3_value *pVal = sqlite3_column_value(pCsr->pStmt, i+1);
|
||||
|
||||
pCsr->aColumnSize[i] = 0;
|
||||
rc = sqlite3Fts5ExtractText(pConfig, pVal, 1, &bReset, &z, &n);
|
||||
rc = fts5TextFromStmt(pConfig, pCsr->pStmt, i, &z, &n);
|
||||
if( rc==SQLITE_OK ){
|
||||
rc = sqlite3Fts5Tokenize(pConfig, FTS5_TOKENIZE_AUX,
|
||||
z, n, (void*)&pCsr->aColumnSize[i], fts5ColumnSizeCb
|
||||
);
|
||||
if( bReset ) sqlite3Fts5ClearLocale(pConfig);
|
||||
}
|
||||
sqlite3Fts5ClearLocale(pConfig);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2715,37 +2694,14 @@ static int fts5ApiColumnLocale(
|
||||
){
|
||||
rc = fts5SeekCursor(pCsr, 0);
|
||||
if( rc==SQLITE_OK ){
|
||||
/* Load the value into pVal. pVal is a locale/text pair iff:
|
||||
**
|
||||
** 1) It is an SQLITE_BLOB, and
|
||||
** 2) Either the subtype is FTS5_LOCALE_SUBTYPE, or else the
|
||||
** value was loaded from an FTS5_CONTENT_NORMAL table, and
|
||||
** 3) It does not begin with an 0x00 byte.
|
||||
*/
|
||||
sqlite3_value *pVal = sqlite3_column_value(pCsr->pStmt, iCol+1);
|
||||
if( sqlite3_value_type(pVal)==SQLITE_BLOB ){
|
||||
const u8 *pBlob = (const u8*)sqlite3_value_blob(pVal);
|
||||
int nBlob = sqlite3_value_bytes(pVal);
|
||||
if( pConfig->eContent==FTS5_CONTENT_EXTERNAL ){
|
||||
const int SZHDR = sizeof(FTS5_LOCALE_HEADER)-1;
|
||||
if( nBlob<SZHDR || memcmp(FTS5_LOCALE_HEADER, pBlob, SZHDR) ){
|
||||
rc = SQLITE_ERROR;
|
||||
}
|
||||
pBlob += 4;
|
||||
nBlob -= 4;
|
||||
}
|
||||
const char *zDummy = 0;
|
||||
int nDummy = 0;
|
||||
rc = fts5TextFromStmt(pConfig, pCsr->pStmt, iCol, &zDummy, &nDummy);
|
||||
if( rc==SQLITE_OK ){
|
||||
int nLocale = 0;
|
||||
for(nLocale=0; nLocale<nBlob && pBlob[nLocale]!=0x00; nLocale++);
|
||||
if( nLocale==nBlob || nLocale==0 ){
|
||||
rc = SQLITE_ERROR;
|
||||
}else{
|
||||
/* A locale/text pair */
|
||||
*pzLocale = (const char*)pBlob;
|
||||
*pnLocale = nLocale;
|
||||
}
|
||||
}
|
||||
*pzLocale = pConfig->t.pLocale;
|
||||
*pnLocale = pConfig->t.nLocale;
|
||||
}
|
||||
sqlite3Fts5ClearLocale(pConfig);
|
||||
}
|
||||
}
|
||||
|
||||
@ -2966,57 +2922,6 @@ static int fts5PoslistBlob(sqlite3_context *pCtx, Fts5Cursor *pCsr){
|
||||
return rc;
|
||||
}
|
||||
|
||||
/*
|
||||
** Value pVal was read from column iCol of the FTS5 table. This function
|
||||
** returns it to the owner of pCtx via a call to an sqlite3_result_xxx()
|
||||
** function. This function deals with the same cases as
|
||||
** sqlite3Fts5ExtractText():
|
||||
**
|
||||
** 1) Ordinary values. These can be returned using sqlite3_result_value().
|
||||
**
|
||||
** 2) Blobs from fts5_locale(). The text is extracted from these and
|
||||
** returned via sqlite3_result_text(). The locale is discarded.
|
||||
*/
|
||||
static void fts5ExtractValueFromColumn(
|
||||
sqlite3_context *pCtx,
|
||||
Fts5Config *pConfig,
|
||||
int iCol,
|
||||
sqlite3_value *pVal
|
||||
){
|
||||
assert( pConfig->eContent!=FTS5_CONTENT_NONE );
|
||||
|
||||
if( pConfig->bLocale
|
||||
&& sqlite3_value_type(pVal)==SQLITE_BLOB
|
||||
&& pConfig->abUnindexed[iCol]==0
|
||||
){
|
||||
const int SZHDR = sizeof(FTS5_LOCALE_HEADER)-1;
|
||||
const u8 *pBlob = sqlite3_value_blob(pVal);
|
||||
int nBlob = sqlite3_value_bytes(pVal);
|
||||
int ii;
|
||||
|
||||
if( pConfig->eContent==FTS5_CONTENT_EXTERNAL ){
|
||||
if( nBlob<SZHDR || memcmp(pBlob, FTS5_LOCALE_HEADER, SZHDR) ){
|
||||
sqlite3_result_error_code(pCtx, SQLITE_ERROR);
|
||||
return;
|
||||
}else{
|
||||
pBlob += 4;
|
||||
nBlob -= 4;
|
||||
}
|
||||
}
|
||||
|
||||
for(ii=0; ii<nBlob && pBlob[ii]; ii++);
|
||||
if( ii==0 || ii==nBlob ){
|
||||
sqlite3_result_error_code(pCtx, SQLITE_ERROR);
|
||||
}else{
|
||||
const char *pText = (const char*)&pBlob[ii+1];
|
||||
sqlite3_result_text(pCtx, pText, nBlob-ii-1, SQLITE_TRANSIENT);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
sqlite3_result_value(pCtx, pVal);
|
||||
}
|
||||
|
||||
/*
|
||||
** This is the xColumn method, called by SQLite to request a value from
|
||||
** the row that the supplied cursor currently points to.
|
||||
@ -3073,8 +2978,22 @@ static int fts5ColumnMethod(
|
||||
rc = fts5SeekCursor(pCsr, 1);
|
||||
if( rc==SQLITE_OK ){
|
||||
sqlite3_value *pVal = sqlite3_column_value(pCsr->pStmt, iCol+1);
|
||||
fts5ExtractValueFromColumn(pCtx, pConfig, iCol, pVal);
|
||||
if( pConfig->bLocale
|
||||
&& pConfig->eContent==FTS5_CONTENT_EXTERNAL
|
||||
&& sqlite3Fts5IsLocaleValue(pConfig, pVal)
|
||||
){
|
||||
const char *z = 0;
|
||||
int n = 0;
|
||||
rc = fts5TextFromStmt(pConfig, pCsr->pStmt, iCol, &z, &n);
|
||||
if( rc==SQLITE_OK ){
|
||||
sqlite3_result_text(pCtx, z, n, SQLITE_TRANSIENT);
|
||||
}
|
||||
sqlite3Fts5ClearLocale(pConfig);
|
||||
}else{
|
||||
sqlite3_result_value(pCtx, pVal);
|
||||
}
|
||||
}
|
||||
|
||||
pConfig->pzErrmsg = 0;
|
||||
}
|
||||
}
|
||||
@ -3636,13 +3555,12 @@ static void fts5LocaleFunc(
|
||||
if( zLocale==0 || zLocale[0]=='\0' ){
|
||||
sqlite3_result_text(pCtx, zText, nText, SQLITE_TRANSIENT);
|
||||
}else{
|
||||
Fts5Global *p = (Fts5Global*)sqlite3_user_data(pCtx);
|
||||
u8 *pBlob = 0;
|
||||
u8 *pCsr = 0;
|
||||
int nBlob = 0;
|
||||
const int nHdr = 4;
|
||||
assert( sizeof(FTS5_LOCALE_HEADER)==nHdr+1 );
|
||||
|
||||
nBlob = nHdr + nLocale + 1 + nText;
|
||||
nBlob = FTS5_LOCALE_HDR_SIZE + nLocale + 1 + nText;
|
||||
pBlob = (u8*)sqlite3_malloc(nBlob);
|
||||
if( pBlob==0 ){
|
||||
sqlite3_result_error_nomem(pCtx);
|
||||
@ -3650,8 +3568,8 @@ static void fts5LocaleFunc(
|
||||
}
|
||||
|
||||
pCsr = pBlob;
|
||||
memcpy(pCsr, FTS5_LOCALE_HEADER, nHdr);
|
||||
pCsr += nHdr;
|
||||
memcpy(pCsr, (const u8*)p->aLocaleHdr, FTS5_LOCALE_HDR_SIZE);
|
||||
pCsr += FTS5_LOCALE_HDR_SIZE;
|
||||
memcpy(pCsr, zLocale, nLocale);
|
||||
pCsr += nLocale;
|
||||
(*pCsr++) = 0x00;
|
||||
@ -3659,7 +3577,6 @@ static void fts5LocaleFunc(
|
||||
assert( &pCsr[nText]==&pBlob[nBlob] );
|
||||
|
||||
sqlite3_result_blob(pCtx, pBlob, nBlob, sqlite3_free);
|
||||
sqlite3_result_subtype(pCtx, FTS5_LOCALE_SUBTYPE);
|
||||
}
|
||||
}
|
||||
|
||||
@ -3761,6 +3678,16 @@ static int fts5Init(sqlite3 *db){
|
||||
pGlobal->api.xFindTokenizer = fts5FindTokenizer;
|
||||
pGlobal->api.xCreateTokenizer_v2 = fts5CreateTokenizer_v2;
|
||||
pGlobal->api.xFindTokenizer_v2 = fts5FindTokenizer_v2;
|
||||
|
||||
/* Initialize pGlobal->aLocaleHdr[] to a 128-bit pseudo-random vector.
|
||||
** The constants below were generated randomly. */
|
||||
sqlite3_randomness(sizeof(pGlobal->aLocaleHdr), pGlobal->aLocaleHdr);
|
||||
pGlobal->aLocaleHdr[0] ^= 0xF924976D;
|
||||
pGlobal->aLocaleHdr[1] ^= 0x16596E13;
|
||||
pGlobal->aLocaleHdr[2] ^= 0x7C80BEAA;
|
||||
pGlobal->aLocaleHdr[3] ^= 0x9B03A67F;
|
||||
assert( sizeof(pGlobal->aLocaleHdr)==16 );
|
||||
|
||||
rc = sqlite3_create_module_v2(db, "fts5", &fts5Mod, p, fts5ModuleDestroy);
|
||||
if( rc==SQLITE_OK ) rc = sqlite3Fts5IndexInit(db);
|
||||
if( rc==SQLITE_OK ) rc = sqlite3Fts5ExprInit(pGlobal, db);
|
||||
|
@ -141,9 +141,7 @@ static int fts5StorageGetStmt(
|
||||
);
|
||||
break;
|
||||
|
||||
case FTS5_STMT_INSERT_CONTENT:
|
||||
case FTS5_STMT_REPLACE_CONTENT: {
|
||||
int nCol = pC->nCol + 1;
|
||||
case FTS5_STMT_INSERT_CONTENT: {
|
||||
char *zBind = 0;
|
||||
int i;
|
||||
|
||||
@ -151,12 +149,26 @@ static int fts5StorageGetStmt(
|
||||
|| pC->eContent==FTS5_CONTENT_UNINDEXED
|
||||
);
|
||||
|
||||
for(i=0; rc==SQLITE_OK && i<nCol; i++){
|
||||
/* Add bindings for the "c*" columns - those that store the actual
|
||||
** table content. If eContent==NORMAL, then there is one binding
|
||||
** for each column. Or, if eContent==UNINDEXED, then there are only
|
||||
** bindings for the UNINDEXED columns. */
|
||||
for(i=0; rc==SQLITE_OK && i<(pC->nCol+1); i++){
|
||||
if( !i || pC->eContent==FTS5_CONTENT_NORMAL || pC->abUnindexed[i-1] ){
|
||||
zBind = sqlite3Fts5Mprintf(&rc, "%z%s?%d", zBind, zBind?",":"",i+1);
|
||||
}
|
||||
}
|
||||
|
||||
/* Add bindings for any "l*" columns. Only non-UNINDEXED columns
|
||||
** require these. */
|
||||
if( pC->bLocale && pC->eContent==FTS5_CONTENT_NORMAL ){
|
||||
for(i=0; rc==SQLITE_OK && i<pC->nCol; i++){
|
||||
if( pC->abUnindexed[i]==0 ){
|
||||
zBind = sqlite3Fts5Mprintf(&rc, "%z,?%d", zBind, pC->nCol+i+2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
zSql = sqlite3Fts5Mprintf(&rc, azStmt[eStmt], pC->zDb, pC->zName,zBind);
|
||||
sqlite3_free(zBind);
|
||||
break;
|
||||
@ -348,7 +360,7 @@ int sqlite3Fts5StorageOpen(
|
||||
|| pConfig->eContent==FTS5_CONTENT_UNINDEXED
|
||||
){
|
||||
int nDefn = 32 + pConfig->nCol*10;
|
||||
char *zDefn = sqlite3_malloc64(32 + (sqlite3_int64)pConfig->nCol * 10);
|
||||
char *zDefn = sqlite3_malloc64(32 + (sqlite3_int64)pConfig->nCol * 20);
|
||||
if( zDefn==0 ){
|
||||
rc = SQLITE_NOMEM;
|
||||
}else{
|
||||
@ -364,6 +376,14 @@ int sqlite3Fts5StorageOpen(
|
||||
iOff += (int)strlen(&zDefn[iOff]);
|
||||
}
|
||||
}
|
||||
if( pConfig->bLocale ){
|
||||
for(i=0; i<pConfig->nCol; i++){
|
||||
if( pConfig->abUnindexed[i]==0 ){
|
||||
sqlite3_snprintf(nDefn-iOff, &zDefn[iOff], ", l%d", i);
|
||||
iOff += (int)strlen(&zDefn[iOff]);
|
||||
}
|
||||
}
|
||||
}
|
||||
rc = sqlite3Fts5CreateTable(pConfig, "content", zDefn, 0, pzErr);
|
||||
}
|
||||
sqlite3_free(zDefn);
|
||||
@ -515,7 +535,8 @@ static int fts5StorageDeleteFromIndex(
|
||||
sqlite3_value *pVal = 0;
|
||||
const char *pText = 0;
|
||||
int nText = 0;
|
||||
int bReset = 0;
|
||||
const char *pLoc = 0;
|
||||
int nLoc = 0;
|
||||
|
||||
assert( pSeek==0 || apVal==0 );
|
||||
assert( pSeek!=0 || apVal!=0 );
|
||||
@ -525,10 +546,19 @@ static int fts5StorageDeleteFromIndex(
|
||||
pVal = apVal[iCol-1];
|
||||
}
|
||||
|
||||
rc = sqlite3Fts5ExtractText(
|
||||
pConfig, pVal, pSeek!=0, &bReset, &pText, &nText
|
||||
);
|
||||
if( pConfig->bLocale && sqlite3Fts5IsLocaleValue(pConfig, pVal) ){
|
||||
rc = sqlite3Fts5DecodeLocaleValue(pVal, &pText, &nText, &pLoc, &nLoc);
|
||||
}else{
|
||||
pText = (const char*)sqlite3_value_text(pVal);
|
||||
nText = sqlite3_value_bytes(pVal);
|
||||
if( pConfig->bLocale && pSeek ){
|
||||
pLoc = (const char*)sqlite3_column_text(pSeek, iCol + pConfig->nCol);
|
||||
nLoc = sqlite3_column_bytes(pSeek, iCol + pConfig->nCol);
|
||||
}
|
||||
}
|
||||
|
||||
if( rc==SQLITE_OK ){
|
||||
sqlite3Fts5SetLocale(pConfig, pLoc, nLoc);
|
||||
ctx.szCol = 0;
|
||||
rc = sqlite3Fts5Tokenize(pConfig, FTS5_TOKENIZE_DOCUMENT,
|
||||
pText, nText, (void*)&ctx, fts5StorageInsertCallback
|
||||
@ -537,7 +567,7 @@ static int fts5StorageDeleteFromIndex(
|
||||
if( rc==SQLITE_OK && p->aTotalSize[iCol-1]<0 ){
|
||||
rc = FTS5_CORRUPT;
|
||||
}
|
||||
if( bReset ) sqlite3Fts5ClearLocale(pConfig);
|
||||
sqlite3Fts5ClearLocale(pConfig);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -805,20 +835,35 @@ int sqlite3Fts5StorageRebuild(Fts5Storage *p){
|
||||
for(ctx.iCol=0; rc==SQLITE_OK && ctx.iCol<pConfig->nCol; ctx.iCol++){
|
||||
ctx.szCol = 0;
|
||||
if( pConfig->abUnindexed[ctx.iCol]==0 ){
|
||||
int bReset = 0; /* True if tokenizer locale must be reset */
|
||||
int nText = 0; /* Size of pText in bytes */
|
||||
const char *pText = 0; /* Pointer to buffer containing text value */
|
||||
sqlite3_value *pVal = sqlite3_column_value(pScan, ctx.iCol+1);
|
||||
int nLoc = 0; /* Size of pLoc in bytes */
|
||||
const char *pLoc = 0; /* Pointer to buffer containing text value */
|
||||
|
||||
sqlite3_value *pVal = sqlite3_column_value(pScan, ctx.iCol+1);
|
||||
if( pConfig->eContent==FTS5_CONTENT_EXTERNAL
|
||||
&& sqlite3Fts5IsLocaleValue(pConfig, pVal)
|
||||
){
|
||||
rc = sqlite3Fts5DecodeLocaleValue(pVal, &pText, &nText, &pLoc, &nLoc);
|
||||
}else{
|
||||
pText = (const char*)sqlite3_value_text(pVal);
|
||||
nText = sqlite3_value_bytes(pVal);
|
||||
if( pConfig->bLocale ){
|
||||
int iCol = ctx.iCol + 1 + pConfig->nCol;
|
||||
pLoc = (const char*)sqlite3_column_text(pScan, iCol);
|
||||
nLoc = sqlite3_column_bytes(pScan, iCol);
|
||||
}
|
||||
}
|
||||
|
||||
rc = sqlite3Fts5ExtractText(pConfig, pVal, 1, &bReset, &pText, &nText);
|
||||
if( rc==SQLITE_OK ){
|
||||
sqlite3Fts5SetLocale(pConfig, pLoc, nLoc);
|
||||
rc = sqlite3Fts5Tokenize(pConfig,
|
||||
FTS5_TOKENIZE_DOCUMENT,
|
||||
pText, nText,
|
||||
(void*)&ctx,
|
||||
fts5StorageInsertCallback
|
||||
);
|
||||
if( bReset ) sqlite3Fts5ClearLocale(pConfig);
|
||||
sqlite3Fts5ClearLocale(pConfig);
|
||||
}
|
||||
}
|
||||
sqlite3Fts5BufferAppendVarint(&rc, &buf, ctx.szCol);
|
||||
@ -904,32 +949,43 @@ int sqlite3Fts5StorageContentInsert(
|
||||
sqlite3_stmt *pInsert = 0; /* Statement to write %_content table */
|
||||
int i; /* Counter variable */
|
||||
rc = fts5StorageGetStmt(p, FTS5_STMT_INSERT_CONTENT, &pInsert, 0);
|
||||
for(i=1; rc==SQLITE_OK && i<=pConfig->nCol+1; i++){
|
||||
if( i==1
|
||||
|| pConfig->eContent==FTS5_CONTENT_NORMAL
|
||||
|| pConfig->abUnindexed[i-2]
|
||||
){
|
||||
if( pInsert ) sqlite3_clear_bindings(pInsert);
|
||||
|
||||
/* Bind the rowid value */
|
||||
sqlite3_bind_value(pInsert, 1, apVal[1]);
|
||||
|
||||
/* Loop through values for user-defined columns. i=2 is the leftmost
|
||||
** user-defined column. As is column 1 of pSavedRow. */
|
||||
for(i=2; rc==SQLITE_OK && i<=pConfig->nCol+1; i++){
|
||||
int bUnindexed = pConfig->abUnindexed[i-2];
|
||||
if( pConfig->eContent==FTS5_CONTENT_NORMAL || bUnindexed ){
|
||||
sqlite3_value *pVal = apVal[i];
|
||||
|
||||
if( sqlite3_value_nochange(pVal) && p->pSavedRow ){
|
||||
/* This is an UPDATE statement, and column (i-2) was not modified.
|
||||
** Retrieve the value from Fts5Storage.pSavedRow instead. */
|
||||
/* This is an UPDATE statement, and user-defined column (i-2) was not
|
||||
** modified. Retrieve the value from Fts5Storage.pSavedRow. */
|
||||
pVal = sqlite3_column_value(p->pSavedRow, i-1);
|
||||
}else if( sqlite3_value_subtype(pVal)==FTS5_LOCALE_SUBTYPE ){
|
||||
assert( pConfig->bLocale );
|
||||
assert( i>1 );
|
||||
if( pConfig->abUnindexed[i-2] ){
|
||||
/* At attempt to insert an fts5_locale() value into an UNINDEXED
|
||||
** column. Strip the locale away and just bind the text. */
|
||||
const char *pText = 0;
|
||||
int nText = 0;
|
||||
rc = sqlite3Fts5ExtractText(pConfig, pVal, 0, 0, &pText, &nText);
|
||||
sqlite3_bind_text(pInsert, i, pText, nText, SQLITE_TRANSIENT);
|
||||
}else{
|
||||
const u8 *pBlob = (const u8*)sqlite3_value_blob(pVal);
|
||||
int nBlob = sqlite3_value_bytes(pVal);
|
||||
assert( nBlob>4 );
|
||||
sqlite3_bind_blob(pInsert, i, pBlob+4, nBlob-4, SQLITE_TRANSIENT);
|
||||
if( pConfig->bLocale && bUnindexed==0 ){
|
||||
sqlite3_bind_value(pInsert, pConfig->nCol + i,
|
||||
sqlite3_column_value(p->pSavedRow, pConfig->nCol + i - 1)
|
||||
);
|
||||
}
|
||||
}else if( sqlite3Fts5IsLocaleValue(pConfig, pVal) ){
|
||||
const char *pText = 0;
|
||||
const char *pLoc = 0;
|
||||
int nText = 0;
|
||||
int nLoc = 0;
|
||||
assert( pConfig->bLocale );
|
||||
|
||||
rc = sqlite3Fts5DecodeLocaleValue(pVal, &pText, &nText, &pLoc, &nLoc);
|
||||
if( rc==SQLITE_OK ){
|
||||
sqlite3_bind_text(pInsert, i, pText, nText, SQLITE_TRANSIENT);
|
||||
if( bUnindexed==0 ){
|
||||
int iLoc = pConfig->nCol + i;
|
||||
sqlite3_bind_text(pInsert, iLoc, pLoc, nLoc, SQLITE_TRANSIENT);
|
||||
}
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -969,23 +1025,37 @@ int sqlite3Fts5StorageIndexInsert(
|
||||
for(ctx.iCol=0; rc==SQLITE_OK && ctx.iCol<pConfig->nCol; ctx.iCol++){
|
||||
ctx.szCol = 0;
|
||||
if( pConfig->abUnindexed[ctx.iCol]==0 ){
|
||||
int bReset = 0; /* True if tokenizer locale must be reset */
|
||||
int nText = 0; /* Size of pText in bytes */
|
||||
const char *pText = 0; /* Pointer to buffer containing text value */
|
||||
int nLoc = 0; /* Size of pText in bytes */
|
||||
const char *pLoc = 0; /* Pointer to buffer containing text value */
|
||||
|
||||
sqlite3_value *pVal = apVal[ctx.iCol+2];
|
||||
int bDisk = 0;
|
||||
if( p->pSavedRow && sqlite3_value_nochange(pVal) ){
|
||||
pVal = sqlite3_column_value(p->pSavedRow, ctx.iCol+1);
|
||||
bDisk = 1;
|
||||
if( pConfig->eContent==FTS5_CONTENT_NORMAL && pConfig->bLocale ){
|
||||
int iCol = ctx.iCol + 1 + pConfig->nCol;
|
||||
pLoc = (const char*)sqlite3_column_text(p->pSavedRow, iCol);
|
||||
nLoc = sqlite3_column_bytes(p->pSavedRow, iCol);
|
||||
}
|
||||
rc = sqlite3Fts5ExtractText(pConfig, pVal, bDisk, &bReset, &pText,&nText);
|
||||
}else{
|
||||
pVal = apVal[ctx.iCol+2];
|
||||
}
|
||||
|
||||
if( pConfig->bLocale && sqlite3Fts5IsLocaleValue(pConfig, pVal) ){
|
||||
rc = sqlite3Fts5DecodeLocaleValue(pVal, &pText, &nText, &pLoc, &nLoc);
|
||||
}else{
|
||||
pText = (const char*)sqlite3_value_text(pVal);
|
||||
nText = sqlite3_value_bytes(pVal);
|
||||
}
|
||||
|
||||
if( rc==SQLITE_OK ){
|
||||
assert( bReset==0 || pConfig->bLocale );
|
||||
sqlite3Fts5SetLocale(pConfig, pLoc, nLoc);
|
||||
rc = sqlite3Fts5Tokenize(pConfig,
|
||||
FTS5_TOKENIZE_DOCUMENT, pText, nText, (void*)&ctx,
|
||||
fts5StorageInsertCallback
|
||||
);
|
||||
if( bReset ) sqlite3Fts5ClearLocale(pConfig);
|
||||
sqlite3Fts5ClearLocale(pConfig);
|
||||
}
|
||||
}
|
||||
sqlite3Fts5BufferAppendVarint(&rc, &buf, ctx.szCol);
|
||||
@ -1150,31 +1220,54 @@ int sqlite3Fts5StorageIntegrity(Fts5Storage *p, int iArg){
|
||||
rc = sqlite3Fts5TermsetNew(&ctx.pTermset);
|
||||
}
|
||||
for(i=0; rc==SQLITE_OK && i<pConfig->nCol; i++){
|
||||
if( pConfig->abUnindexed[i] ) continue;
|
||||
if( pConfig->abUnindexed[i]==0 ){
|
||||
const char *pText = 0;
|
||||
int nText = 0;
|
||||
const char *pLoc = 0;
|
||||
int nLoc = 0;
|
||||
sqlite3_value *pVal = sqlite3_column_value(pScan, i+1);
|
||||
|
||||
if( pConfig->eContent==FTS5_CONTENT_EXTERNAL
|
||||
&& sqlite3Fts5IsLocaleValue(pConfig, pVal)
|
||||
){
|
||||
rc = sqlite3Fts5DecodeLocaleValue(
|
||||
pVal, &pText, &nText, &pLoc, &nLoc
|
||||
);
|
||||
}else{
|
||||
if( pConfig->eContent==FTS5_CONTENT_NORMAL && pConfig->bLocale ){
|
||||
int iCol = i + 1 + pConfig->nCol;
|
||||
pLoc = (const char*)sqlite3_column_text(pScan, iCol);
|
||||
nLoc = sqlite3_column_bytes(pScan, iCol);
|
||||
}
|
||||
pText = (const char*)sqlite3_value_text(pVal);
|
||||
nText = sqlite3_value_bytes(pVal);
|
||||
}
|
||||
|
||||
ctx.iCol = i;
|
||||
ctx.szCol = 0;
|
||||
if( pConfig->eDetail==FTS5_DETAIL_COLUMNS ){
|
||||
|
||||
if( rc==SQLITE_OK && pConfig->eDetail==FTS5_DETAIL_COLUMNS ){
|
||||
rc = sqlite3Fts5TermsetNew(&ctx.pTermset);
|
||||
}
|
||||
if( rc==SQLITE_OK ){
|
||||
int bReset = 0; /* True if tokenizer locale must be reset */
|
||||
int nText = 0; /* Size of pText in bytes */
|
||||
const char *pText = 0; /* Pointer to buffer containing text value */
|
||||
|
||||
rc = sqlite3Fts5ExtractText(pConfig,
|
||||
sqlite3_column_value(pScan, i+1), 1, &bReset, &pText, &nText
|
||||
);
|
||||
if( rc==SQLITE_OK ){
|
||||
sqlite3Fts5SetLocale(pConfig, pLoc, nLoc);
|
||||
rc = sqlite3Fts5Tokenize(pConfig,
|
||||
FTS5_TOKENIZE_DOCUMENT,
|
||||
pText, nText,
|
||||
(void*)&ctx,
|
||||
fts5StorageIntegrityCallback
|
||||
);
|
||||
if( bReset ) sqlite3Fts5ClearLocale(pConfig);
|
||||
sqlite3Fts5ClearLocale(pConfig);
|
||||
}
|
||||
}
|
||||
if( rc==SQLITE_OK && pConfig->bColumnsize && ctx.szCol!=aColSize[i] ){
|
||||
|
||||
/* If this is not a columnsize=0 database, check that the number
|
||||
** of tokens in the value matches the aColSize[] value read from
|
||||
** the %_docsize table. */
|
||||
if( rc==SQLITE_OK
|
||||
&& pConfig->bColumnsize
|
||||
&& ctx.szCol!=aColSize[i]
|
||||
){
|
||||
rc = FTS5_CORRUPT;
|
||||
}
|
||||
aTotalSize[i] += ctx.szCol;
|
||||
@ -1183,6 +1276,7 @@ int sqlite3Fts5StorageIntegrity(Fts5Storage *p, int iArg){
|
||||
ctx.pTermset = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
sqlite3Fts5TermsetFree(ctx.pTermset);
|
||||
ctx.pTermset = 0;
|
||||
|
||||
|
@ -103,13 +103,13 @@ do_execsql_test 3.0 {
|
||||
|
||||
do_catchsql_test 3.1 {
|
||||
INSERT INTO x1(rowid, a, b) VALUES(113, 'hello world', X'123456');
|
||||
} {1 {datatype mismatch}}
|
||||
} {0 {}}
|
||||
do_catchsql_test 3.2 {
|
||||
INSERT INTO x2(rowid, a, b) VALUES(113, 'hello world', X'123456');
|
||||
} {1 {datatype mismatch}}
|
||||
} {0 {}}
|
||||
do_catchsql_test 3.3 {
|
||||
INSERT INTO x3(rowid, a, b) VALUES(113, 'hello world', X'123456');
|
||||
} {1 {datatype mismatch}}
|
||||
} {0 {}}
|
||||
|
||||
|
||||
#--------------------------------------------------------------------------
|
||||
|
@ -246,7 +246,7 @@ do_execsql_test 10.1 {
|
||||
} {hello}
|
||||
|
||||
faultsim_save_and_close
|
||||
do_faultsim_test 10 -faults oom* -prep {
|
||||
do_faultsim_test 10.1 -faults oom* -prep {
|
||||
faultsim_restore_and_reopen
|
||||
} -body {
|
||||
execsql {
|
||||
@ -256,6 +256,18 @@ do_faultsim_test 10 -faults oom* -prep {
|
||||
faultsim_test_result {0 hello}
|
||||
}
|
||||
|
||||
breakpoint
|
||||
faultsim_save_and_close
|
||||
do_faultsim_test 10.2 -faults oom-t* -prep {
|
||||
faultsim_restore_and_reopen
|
||||
} -body {
|
||||
execsql {
|
||||
INSERT INTO ft VALUES(zeroblob(10000));
|
||||
}
|
||||
} -test {
|
||||
faultsim_test_result {0 {}}
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
reset_db
|
||||
|
||||
|
@ -73,6 +73,7 @@ do_execsql_test 1.2 {
|
||||
SELECT rowid, a FROM t1( fts5_locale('reverse', 'abc') );
|
||||
} {2 cba}
|
||||
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
# Test that the locale= option exists and seems to accept values. And
|
||||
# that fts5_locale() values may only be inserted into an internal-content
|
||||
@ -99,8 +100,11 @@ do_catchsql_test 2.3 {
|
||||
INSERT INTO b1(b1, rank) VALUES('locale', 0);
|
||||
} {1 {SQL logic error}}
|
||||
|
||||
do_execsql_test 2.4 {
|
||||
do_execsql_test 2.4.1 {
|
||||
INSERT INTO b1 VALUES('abc', 'one two three');
|
||||
}
|
||||
|
||||
do_execsql_test 2.4.2 {
|
||||
INSERT INTO b1 VALUES('def', fts5_locale('reverse', 'four five six'));
|
||||
}
|
||||
|
||||
@ -131,6 +135,7 @@ do_execsql_test 2.12 { SELECT quote(y) FROM b1('ruof') } {
|
||||
do_execsql_test 2.13 {
|
||||
INSERT INTO b1(b1) VALUES('integrity-check');
|
||||
}
|
||||
|
||||
do_execsql_test 2.14 {
|
||||
INSERT INTO b1(b1) VALUES('rebuild');
|
||||
}
|
||||
@ -149,7 +154,6 @@ do_execsql_test 2.18 {
|
||||
INSERT INTO b1(rowid, x, y) VALUES(
|
||||
test_setsubtype(45, 76), 'abc def', 'def abc'
|
||||
);
|
||||
INSERT INTO b1(b1) VALUES('integrity-check');
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
@ -278,9 +282,9 @@ do_execsql_test 5.2 {
|
||||
}
|
||||
|
||||
do_execsql_test 5.3 {
|
||||
SELECT typeof(c0), typeof(c1) FROM t1_content
|
||||
SELECT typeof(c0), typeof(c1), typeof(l0) FROM t1_content
|
||||
} {
|
||||
blob text
|
||||
text text text
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
@ -305,37 +309,37 @@ foreach {tn opt} {
|
||||
|
||||
fts5_aux_test_functions db
|
||||
|
||||
do_execsql_test 5.$tn.3 {
|
||||
do_execsql_test 6.$tn.3 {
|
||||
SELECT fts5_test_columnsize(y1) FROM y1
|
||||
} {
|
||||
2 3 2 4
|
||||
}
|
||||
|
||||
do_execsql_test 5.$tn.4 {
|
||||
do_execsql_test 6.$tn.4 {
|
||||
SELECT rowid, fts5_test_columnsize(y1) FROM y1('shall');
|
||||
} {
|
||||
2 3
|
||||
}
|
||||
|
||||
do_execsql_test 5.$tn.5 {
|
||||
do_execsql_test 6.$tn.5 {
|
||||
SELECT rowid, fts5_test_columnsize(y1) FROM y1('shall');
|
||||
} {
|
||||
2 3
|
||||
}
|
||||
|
||||
do_execsql_test 5.$tn.6 {
|
||||
do_execsql_test 6.$tn.6 {
|
||||
SELECT rowid, fts5_test_columnsize(y1) FROM y1('have');
|
||||
} {
|
||||
4 4
|
||||
}
|
||||
|
||||
do_execsql_test 5.$tn.7 {
|
||||
do_execsql_test 6.$tn.7 {
|
||||
SELECT rowid, highlight(y1, 0, '[', ']') FROM y1('have');
|
||||
} {
|
||||
4 {which it hath been used to [have]}
|
||||
}
|
||||
|
||||
do_execsql_test 5.$tn.8 {
|
||||
do_execsql_test 6.$tn.8 {
|
||||
SELECT rowid,
|
||||
highlight(y1, 0, '[', ']'),
|
||||
snippet(y1, 0, '[', ']', '...', 10)
|
||||
@ -473,7 +477,7 @@ foreach_detail_mode $::testprefix {
|
||||
}
|
||||
|
||||
foreach {tn v} {
|
||||
1 X'001122'
|
||||
1 X'001152'
|
||||
2 X'0011223344'
|
||||
3 X'00E0B2EB68656c6c6f'
|
||||
4 X'00E0B2EB0068656c6c6f'
|
||||
@ -484,33 +488,33 @@ foreach_detail_mode $::testprefix {
|
||||
|
||||
do_catchsql_test 10.2.$tn.3 {
|
||||
INSERT INTO ft(ft) VALUES('rebuild');
|
||||
} {1 {SQL logic error}}
|
||||
} {0 {}}
|
||||
|
||||
do_catchsql_test 10.2.$tn.4 "
|
||||
SELECT * FROM ft( test_setsubtype($v, 76) );
|
||||
" {1 {SQL logic error}}
|
||||
" {1 {fts5: syntax error near ""}}
|
||||
|
||||
do_execsql_test 10.2.$tn.5 {
|
||||
INSERT INTO ft(rowid, x) VALUES(1, 'hello world');
|
||||
}
|
||||
|
||||
if {"%DETAIL%"!="full"} {
|
||||
do_catchsql_test 10.2.$tn.6 {
|
||||
if {"%DETAIL%"=="full"} {
|
||||
do_execsql_test 10.2.$tn.6 {
|
||||
SELECT fts5_test_poslist(ft) FROM ft('world');
|
||||
} {1 SQLITE_ERROR}
|
||||
} {0.0.1}
|
||||
|
||||
do_catchsql_test 10.2.$tn.7 {
|
||||
do_execsql_test 10.2.$tn.7.1 {
|
||||
SELECT fts5_test_columnsize(ft) FROM ft('world');
|
||||
} {1 SQLITE_ERROR}
|
||||
} {1}
|
||||
|
||||
do_catchsql_test 10.2.$tn.7 {
|
||||
do_execsql_test 10.2.$tn.7.2 {
|
||||
SELECT fts5_test_columnlocale(ft) FROM ft('world');
|
||||
} {1 SQLITE_ERROR}
|
||||
} {{{}}}
|
||||
}
|
||||
|
||||
do_catchsql_test 10.2.$tn.8 {
|
||||
SELECT * FROM ft('hello')
|
||||
} {1 {SQL logic error}}
|
||||
SELECT count(*) FROM ft('hello')
|
||||
} {0 1}
|
||||
|
||||
do_catchsql_test 10.2.$tn.9 {
|
||||
PRAGMA integrity_check;
|
||||
@ -523,11 +527,11 @@ foreach_detail_mode $::testprefix {
|
||||
|
||||
do_catchsql_test 10.2.$tn.11 "
|
||||
INSERT INTO ft(ft, rowid, x) VALUES('delete', 1, test_setsubtype($v,76) )
|
||||
" {1 {SQL logic error}}
|
||||
" {0 {}}
|
||||
|
||||
do_catchsql_test 10.2.$tn.12 "
|
||||
INSERT INTO ft(rowid, x) VALUES(2, test_setsubtype($v,76) )
|
||||
" {1 {SQL logic error}}
|
||||
" {0 {}}
|
||||
|
||||
do_execsql_test 10.2.$tn.13 {
|
||||
INSERT INTO ft2(rowid, x) VALUES(1, 'hello world');
|
||||
@ -536,7 +540,7 @@ foreach_detail_mode $::testprefix {
|
||||
|
||||
do_catchsql_test 10.2.$tn.15 {
|
||||
PRAGMA integrity_check;
|
||||
} {1 {SQL logic error}}
|
||||
} {0 {{malformed inverted index for FTS5 table main.ft2}}}
|
||||
|
||||
do_execsql_test 10.2.$tn.16 {
|
||||
DELETE FROM ft2_content;
|
||||
@ -663,5 +667,82 @@ do_catchsql_test 13.2.7 {
|
||||
FROM ft('one AND three') ORDER BY rowid
|
||||
} {1 {non-integer argument passed to function fts5_get_locale()}}
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
# Check that UPDATE statements that may affect more than one row work.
|
||||
#
|
||||
reset_db
|
||||
do_execsql_test 14.1 {
|
||||
CREATE VIRTUAL TABLE ft USING fts5(a, b, locale=1);
|
||||
}
|
||||
|
||||
do_execsql_test 14.2 {
|
||||
INSERT INTO ft VALUES('hello', 'world');
|
||||
}
|
||||
|
||||
do_execsql_test 14.3 {
|
||||
UPDATE ft SET b = fts5_locale('en_AU', 'world');
|
||||
}
|
||||
|
||||
do_execsql_test 14.4 {
|
||||
INSERT INTO ft VALUES(X'abcd', X'1234');
|
||||
} {}
|
||||
|
||||
do_execsql_test 14.5 {
|
||||
SELECT quote(a), quote(b) FROM ft
|
||||
} {'hello' 'world' X'ABCD' X'1234'}
|
||||
|
||||
do_execsql_test 14.6 {
|
||||
DELETE FROM ft;
|
||||
INSERT INTO ft VALUES(NULL, 'null');
|
||||
INSERT INTO ft VALUES(123, 'int');
|
||||
INSERT INTO ft VALUES(345.0, 'real');
|
||||
INSERT INTO ft VALUES('abc', 'text');
|
||||
INSERT INTO ft VALUES(fts5_locale('abc', 'def'), 'text');
|
||||
|
||||
SELECT a, typeof(a), b FROM ft
|
||||
} {
|
||||
{} null null
|
||||
123 integer int
|
||||
345.0 real real
|
||||
abc text text
|
||||
def text text
|
||||
}
|
||||
|
||||
do_execsql_test 14.7 {
|
||||
SELECT quote(c0), typeof(c0) FROM ft_content
|
||||
} {
|
||||
NULL null
|
||||
123 integer
|
||||
345.0 real
|
||||
'abc' text
|
||||
'def' text
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
# Check that inserting UNINDEXED columns between indexed columns of a
|
||||
# locale=1 table does not cause a problem.
|
||||
#
|
||||
reset_db
|
||||
sqlite3_fts5_create_tokenizer -v2 db tcl tcl_create
|
||||
fts5_aux_test_functions db
|
||||
|
||||
do_execsql_test 15.1 {
|
||||
CREATE VIRTUAL TABLE ft USING fts5(a, b UNINDEXED, c, locale=1, tokenize=tcl);
|
||||
}
|
||||
|
||||
do_execsql_test 15.2 {
|
||||
INSERT INTO ft VALUES('one', 'two', 'three');
|
||||
INSERT INTO ft VALUES('one', 'two', fts5_locale('loc', 'three'));
|
||||
}
|
||||
|
||||
do_execsql_test 15.3 {
|
||||
SELECT c2, l2 FROM ft_content
|
||||
} {three {} three loc}
|
||||
|
||||
do_execsql_test 15.4 {
|
||||
SELECT c, fts5_columnlocale(ft, 2) FROM ft
|
||||
} {three {} three loc}
|
||||
|
||||
|
||||
finish_test
|
||||
|
||||
|
@ -93,15 +93,21 @@ foreach {tn cols tokens} {
|
||||
10 {b} "i e"
|
||||
11 {a} "i e"
|
||||
} {
|
||||
set fts "{$cols}:[join $tokens +]"
|
||||
set where [list]
|
||||
foreach c $cols { lappend where "pmatch($c, '$tokens')" }
|
||||
set where [join $where " OR "]
|
||||
|
||||
foreach fts [list \
|
||||
"{$cols}:[join $tokens +]" \
|
||||
"{$cols}:NEAR([join $tokens +])" \
|
||||
"{$cols}:NEAR([join $tokens +],1)" \
|
||||
"{$cols}:NEAR([join $tokens +],111)" \
|
||||
] {
|
||||
set res [db eval "SELECT rowid FROM t3 WHERE $where"]
|
||||
do_execsql_test "1.$tn.$fts->([llength $res] rows)" {
|
||||
SELECT rowid FROM t3($fts)
|
||||
} $res
|
||||
}
|
||||
}
|
||||
|
||||
do_execsql_test 2.0 {
|
||||
|
@ -307,7 +307,7 @@ static void percentStep(sqlite3_context *pCtx, int argc, sqlite3_value **argv){
|
||||
}else if( p->bKeepSorted ){
|
||||
int i;
|
||||
i = percentBinarySearch(p, y, 0);
|
||||
if( i<p->nUsed ){
|
||||
if( i<(int)p->nUsed ){
|
||||
memmove(&p->a[i+1], &p->a[i], (p->nUsed-i)*sizeof(p->a[0]));
|
||||
}
|
||||
p->a[i] = y;
|
||||
@ -423,7 +423,7 @@ static void percentInverse(sqlite3_context *pCtx,int argc,sqlite3_value **argv){
|
||||
i = percentBinarySearch(p, y, 1);
|
||||
if( i>=0 ){
|
||||
p->nUsed--;
|
||||
if( i<p->nUsed ){
|
||||
if( i<(int)p->nUsed ){
|
||||
memmove(&p->a[i], &p->a[i+1], (p->nUsed - i)*sizeof(p->a[0]));
|
||||
}
|
||||
}
|
||||
@ -483,7 +483,7 @@ int sqlite3_percentile_init(
|
||||
const sqlite3_api_routines *pApi
|
||||
){
|
||||
int rc = SQLITE_OK;
|
||||
int i;
|
||||
unsigned int i;
|
||||
#if defined(SQLITE3_H) || defined(SQLITE_STATIC_PERCENTILE)
|
||||
(void)pApi; /* Unused parameter */
|
||||
#else
|
||||
|
@ -182,7 +182,7 @@ static const char *vfstraceNextSystemCall(sqlite3_vfs*, const char *zName);
|
||||
** xyzzy.txt -> xyzzy.txt
|
||||
*/
|
||||
static const char *fileTail(const char *z){
|
||||
int i;
|
||||
size_t i;
|
||||
if( z==0 ) return 0;
|
||||
i = strlen(z)-1;
|
||||
while( i>0 && z[i-1]!='/' ){ i--; }
|
||||
@ -207,32 +207,30 @@ static void vfstrace_printf(
|
||||
}
|
||||
|
||||
/*
|
||||
** Convert value rc into a string and print it using zFormat. zFormat
|
||||
** should have exactly one %s
|
||||
** Try to convert an error code into a symbolic name for that error code.
|
||||
*/
|
||||
static void vfstrace_print_errcode(
|
||||
vfstrace_info *pInfo,
|
||||
const char *zFormat,
|
||||
int rc
|
||||
){
|
||||
char zBuf[50];
|
||||
char *zVal;
|
||||
static const char *vfstrace_errcode_name(int rc ){
|
||||
const char *zVal = 0;
|
||||
switch( rc ){
|
||||
case SQLITE_OK: zVal = "SQLITE_OK"; break;
|
||||
case SQLITE_INTERNAL: zVal = "SQLITE_INTERNAL"; break;
|
||||
case SQLITE_ERROR: zVal = "SQLITE_ERROR"; break;
|
||||
case SQLITE_PERM: zVal = "SQLITE_PERM"; break;
|
||||
case SQLITE_ABORT: zVal = "SQLITE_ABORT"; break;
|
||||
case SQLITE_BUSY: zVal = "SQLITE_BUSY"; break;
|
||||
case SQLITE_LOCKED: zVal = "SQLITE_LOCKED"; break;
|
||||
case SQLITE_NOMEM: zVal = "SQLITE_NOMEM"; break;
|
||||
case SQLITE_READONLY: zVal = "SQLITE_READONLY"; break;
|
||||
case SQLITE_INTERRUPT: zVal = "SQLITE_INTERRUPT"; break;
|
||||
case SQLITE_IOERR: zVal = "SQLITE_IOERR"; break;
|
||||
case SQLITE_CORRUPT: zVal = "SQLITE_CORRUPT"; break;
|
||||
case SQLITE_NOTFOUND: zVal = "SQLITE_NOTFOUND"; break;
|
||||
case SQLITE_FULL: zVal = "SQLITE_FULL"; break;
|
||||
case SQLITE_CANTOPEN: zVal = "SQLITE_CANTOPEN"; break;
|
||||
case SQLITE_PROTOCOL: zVal = "SQLITE_PROTOCOL"; break;
|
||||
case SQLITE_EMPTY: zVal = "SQLITE_EMPTY"; break;
|
||||
case SQLITE_SCHEMA: zVal = "SQLITE_SCHEMA"; break;
|
||||
case SQLITE_TOOBIG: zVal = "SQLITE_TOOBIG"; break;
|
||||
case SQLITE_CONSTRAINT: zVal = "SQLITE_CONSTRAINT"; break;
|
||||
case SQLITE_MISMATCH: zVal = "SQLITE_MISMATCH"; break;
|
||||
case SQLITE_MISUSE: zVal = "SQLITE_MISUSE"; break;
|
||||
@ -266,11 +264,30 @@ static void vfstrace_print_errcode(
|
||||
case SQLITE_LOCKED_SHAREDCACHE: zVal = "SQLITE_LOCKED_SHAREDCACHE"; break;
|
||||
case SQLITE_BUSY_RECOVERY: zVal = "SQLITE_BUSY_RECOVERY"; break;
|
||||
case SQLITE_CANTOPEN_NOTEMPDIR: zVal = "SQLITE_CANTOPEN_NOTEMPDIR"; break;
|
||||
default: {
|
||||
sqlite3_snprintf(sizeof(zBuf), zBuf, "%d", rc);
|
||||
zVal = zBuf;
|
||||
break;
|
||||
}
|
||||
return zVal;
|
||||
}
|
||||
|
||||
/*
|
||||
** Convert value rc into a string and print it using zFormat. zFormat
|
||||
** should have exactly one %s
|
||||
*/
|
||||
static void vfstrace_print_errcode(
|
||||
vfstrace_info *pInfo,
|
||||
const char *zFormat,
|
||||
int rc
|
||||
){
|
||||
const char *zVal;
|
||||
char zBuf[50];
|
||||
zVal = vfstrace_errcode_name(rc);
|
||||
if( zVal==0 ){
|
||||
zVal = vfstrace_errcode_name(rc&0xff);
|
||||
if( zVal ){
|
||||
sqlite3_snprintf(sizeof(zBuf), zBuf, "%s | 0x%x", zVal, rc&0xffff00);
|
||||
}else{
|
||||
sqlite3_snprintf(sizeof(zBuf), zBuf, "%d (0x%x)", rc, rc);
|
||||
}
|
||||
zVal = zBuf;
|
||||
}
|
||||
vfstrace_printf(pInfo, zFormat, zVal);
|
||||
}
|
||||
@ -457,7 +474,9 @@ static int vfstraceFileControl(sqlite3_file *pFile, int op, void *pArg){
|
||||
vfstrace_info *pInfo = p->pInfo;
|
||||
int rc;
|
||||
char zBuf[100];
|
||||
char zBuf2[100];
|
||||
char *zOp;
|
||||
char *zRVal = 0;
|
||||
switch( op ){
|
||||
case SQLITE_FCNTL_LOCKSTATE: zOp = "LOCKSTATE"; break;
|
||||
case SQLITE_GET_LOCKPROXYFILE: zOp = "GET_LOCKPROXYFILE"; break;
|
||||
@ -475,19 +494,61 @@ static int vfstraceFileControl(sqlite3_file *pFile, int op, void *pArg){
|
||||
break;
|
||||
}
|
||||
case SQLITE_FCNTL_FILE_POINTER: zOp = "FILE_POINTER"; break;
|
||||
case SQLITE_FCNTL_SYNC_OMITTED: zOp = "SYNC_OMITTED"; break;
|
||||
case SQLITE_FCNTL_WIN32_AV_RETRY: zOp = "WIN32_AV_RETRY"; break;
|
||||
case SQLITE_FCNTL_PERSIST_WAL: zOp = "PERSIST_WAL"; break;
|
||||
case SQLITE_FCNTL_PERSIST_WAL: {
|
||||
sqlite3_snprintf(sizeof(zBuf), zBuf, "PERSIST_WAL,%d", *(int*)pArg);
|
||||
zOp = zBuf;
|
||||
break;
|
||||
}
|
||||
case SQLITE_FCNTL_OVERWRITE: zOp = "OVERWRITE"; break;
|
||||
case SQLITE_FCNTL_VFSNAME: zOp = "VFSNAME"; break;
|
||||
case SQLITE_FCNTL_TEMPFILENAME: zOp = "TEMPFILENAME"; break;
|
||||
case 0xca093fa0: zOp = "DB_UNCHANGED"; break;
|
||||
case SQLITE_FCNTL_POWERSAFE_OVERWRITE: zOp = "POWERSAFE_OVERWRITE"; break;
|
||||
case SQLITE_FCNTL_PRAGMA: {
|
||||
const char *const* a = (const char*const*)pArg;
|
||||
sqlite3_snprintf(sizeof(zBuf), zBuf, "PRAGMA,[%s,%s]",a[1],a[2]);
|
||||
zOp = zBuf;
|
||||
break;
|
||||
}
|
||||
case SQLITE_FCNTL_BUSYHANDLER: zOp = "BUSYHANDLER"; break;
|
||||
case SQLITE_FCNTL_TEMPFILENAME: zOp = "TEMPFILENAME"; break;
|
||||
case SQLITE_FCNTL_MMAP_SIZE: {
|
||||
sqlite3_int64 iMMap = *(sqlite3_int64*)pArg;
|
||||
sqlite3_snprintf(sizeof(zBuf), zBuf, "MMAP_SIZE,%lld",iMMap);
|
||||
zOp = zBuf;
|
||||
break;
|
||||
}
|
||||
case SQLITE_FCNTL_TRACE: zOp = "TRACE"; break;
|
||||
case SQLITE_FCNTL_HAS_MOVED: zOp = "HAS_MOVED"; break;
|
||||
case SQLITE_FCNTL_SYNC: zOp = "SYNC"; break;
|
||||
case SQLITE_FCNTL_COMMIT_PHASETWO: zOp = "COMMIT_PHASETWO"; break;
|
||||
case SQLITE_FCNTL_WIN32_SET_HANDLE: zOp = "WIN32_SET_HANDLE"; break;
|
||||
case SQLITE_FCNTL_WAL_BLOCK: zOp = "WAL_BLOCK"; break;
|
||||
case SQLITE_FCNTL_ZIPVFS: zOp = "ZIPVFS"; break;
|
||||
case SQLITE_FCNTL_RBU: zOp = "RBU"; break;
|
||||
case SQLITE_FCNTL_VFS_POINTER: zOp = "VFS_POINTER"; break;
|
||||
case SQLITE_FCNTL_JOURNAL_POINTER: zOp = "JOURNAL_POINTER"; break;
|
||||
case SQLITE_FCNTL_WIN32_GET_HANDLE: zOp = "WIN32_GET_HANDLE"; break;
|
||||
case SQLITE_FCNTL_PDB: zOp = "PDB"; break;
|
||||
case SQLITE_FCNTL_BEGIN_ATOMIC_WRITE: zOp = "BEGIN_ATOMIC_WRITE"; break;
|
||||
case SQLITE_FCNTL_COMMIT_ATOMIC_WRITE: zOp = "COMMIT_ATOMIC_WRITE"; break;
|
||||
case SQLITE_FCNTL_ROLLBACK_ATOMIC_WRITE: {
|
||||
zOp = "ROLLBACK_ATOMIC_WRITE";
|
||||
break;
|
||||
}
|
||||
case SQLITE_FCNTL_LOCK_TIMEOUT: {
|
||||
sqlite3_snprintf(sizeof(zBuf), zBuf, "LOCK_TIMEOUT,%d", *(int*)pArg);
|
||||
zOp = zBuf;
|
||||
break;
|
||||
}
|
||||
case SQLITE_FCNTL_DATA_VERSION: zOp = "DATA_VERSION"; break;
|
||||
case SQLITE_FCNTL_SIZE_LIMIT: zOp = "SIZE_LIMIT"; break;
|
||||
case SQLITE_FCNTL_CKPT_DONE: zOp = "CKPT_DONE"; break;
|
||||
case SQLITE_FCNTL_RESERVE_BYTES: zOp = "RESERVED_BYTES"; break;
|
||||
case SQLITE_FCNTL_CKPT_START: zOp = "CKPT_START"; break;
|
||||
case SQLITE_FCNTL_EXTERNAL_READER: zOp = "EXTERNAL_READER"; break;
|
||||
case SQLITE_FCNTL_CKSM_FILE: zOp = "CKSM_FILE"; break;
|
||||
case SQLITE_FCNTL_RESET_CACHE: zOp = "RESET_CACHE"; break;
|
||||
case 0xca093fa0: zOp = "DB_UNCHANGED"; break;
|
||||
default: {
|
||||
sqlite3_snprintf(sizeof zBuf, zBuf, "%d", op);
|
||||
zOp = zBuf;
|
||||
@ -497,15 +558,37 @@ static int vfstraceFileControl(sqlite3_file *pFile, int op, void *pArg){
|
||||
vfstrace_printf(pInfo, "%s.xFileControl(%s,%s)",
|
||||
pInfo->zVfsName, p->zFName, zOp);
|
||||
rc = p->pReal->pMethods->xFileControl(p->pReal, op, pArg);
|
||||
vfstrace_print_errcode(pInfo, " -> %s\n", rc);
|
||||
if( op==SQLITE_FCNTL_VFSNAME && rc==SQLITE_OK ){
|
||||
if( rc==SQLITE_OK ){
|
||||
switch( op ){
|
||||
case SQLITE_FCNTL_VFSNAME: {
|
||||
*(char**)pArg = sqlite3_mprintf("vfstrace.%s/%z",
|
||||
pInfo->zVfsName, *(char**)pArg);
|
||||
zRVal = *(char**)pArg;
|
||||
break;
|
||||
}
|
||||
if( (op==SQLITE_FCNTL_PRAGMA || op==SQLITE_FCNTL_TEMPFILENAME)
|
||||
&& rc==SQLITE_OK && *(char**)pArg ){
|
||||
vfstrace_printf(pInfo, "%s.xFileControl(%s,%s) returns %s",
|
||||
pInfo->zVfsName, p->zFName, zOp, *(char**)pArg);
|
||||
case SQLITE_FCNTL_MMAP_SIZE: {
|
||||
sqlite3_snprintf(sizeof(zBuf2), zBuf2, "%lld", *(sqlite3_int64*)pArg);
|
||||
zRVal = zBuf2;
|
||||
break;
|
||||
}
|
||||
case SQLITE_FCNTL_HAS_MOVED:
|
||||
case SQLITE_FCNTL_PERSIST_WAL: {
|
||||
sqlite3_snprintf(sizeof(zBuf2), zBuf2, "%d", *(int*)pArg);
|
||||
zRVal = zBuf2;
|
||||
break;
|
||||
}
|
||||
case SQLITE_FCNTL_PRAGMA:
|
||||
case SQLITE_FCNTL_TEMPFILENAME: {
|
||||
zRVal = *(char**)pArg;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if( zRVal ){
|
||||
vfstrace_print_errcode(pInfo, " -> %s", rc);
|
||||
vfstrace_printf(pInfo, ", %s\n", zRVal);
|
||||
}else{
|
||||
vfstrace_print_errcode(pInfo, " -> %s\n", rc);
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
@ -840,14 +923,14 @@ int vfstrace_register(
|
||||
sqlite3_vfs *pNew;
|
||||
sqlite3_vfs *pRoot;
|
||||
vfstrace_info *pInfo;
|
||||
int nName;
|
||||
int nByte;
|
||||
size_t nName;
|
||||
size_t nByte;
|
||||
|
||||
pRoot = sqlite3_vfs_find(zOldVfsName);
|
||||
if( pRoot==0 ) return SQLITE_NOTFOUND;
|
||||
nName = strlen(zTraceName);
|
||||
nByte = sizeof(*pNew) + sizeof(*pInfo) + nName + 1;
|
||||
pNew = sqlite3_malloc( nByte );
|
||||
pNew = sqlite3_malloc64( nByte );
|
||||
if( pNew==0 ) return SQLITE_NOMEM;
|
||||
memset(pNew, 0, nByte);
|
||||
pInfo = (vfstrace_info*)&pNew[1];
|
||||
@ -890,3 +973,15 @@ int vfstrace_register(
|
||||
pInfo->zVfsName, pRoot->zName);
|
||||
return sqlite3_vfs_register(pNew, makeDefault);
|
||||
}
|
||||
|
||||
/*
|
||||
** Look for the named VFS. If it is a TRACEVFS, then unregister it
|
||||
** and delete it.
|
||||
*/
|
||||
void vfstrace_unregister(const char *zTraceName){
|
||||
sqlite3_vfs *pVfs = sqlite3_vfs_find(zTraceName);
|
||||
if( pVfs==0 ) return;
|
||||
if( pVfs->xOpen!=vfstraceOpen ) return;
|
||||
sqlite3_vfs_unregister(pVfs);
|
||||
sqlite3_free(pVfs);
|
||||
}
|
@ -336,6 +336,27 @@ struct RbuFrame {
|
||||
u32 iWalFrame;
|
||||
};
|
||||
|
||||
#ifndef UNUSED_PARAMETER
|
||||
/*
|
||||
** The following macros are used to suppress compiler warnings and to
|
||||
** make it clear to human readers when a function parameter is deliberately
|
||||
** left unused within the body of a function. This usually happens when
|
||||
** a function is called via a function pointer. For example the
|
||||
** implementation of an SQL aggregate step callback may not use the
|
||||
** parameter indicating the number of arguments passed to the aggregate,
|
||||
** if it knows that this is enforced elsewhere.
|
||||
**
|
||||
** When a function parameter is not used at all within the body of a function,
|
||||
** it is generally named "NotUsed" or "NotUsed2" to make things even clearer.
|
||||
** However, these macros may also be used to suppress warnings related to
|
||||
** parameters that may or may not be used depending on compilation options.
|
||||
** For example those parameters only used in assert() statements. In these
|
||||
** cases the parameters are named as per the usual conventions.
|
||||
*/
|
||||
#define UNUSED_PARAMETER(x) (void)(x)
|
||||
#define UNUSED_PARAMETER2(x,y) UNUSED_PARAMETER(x),UNUSED_PARAMETER(y)
|
||||
#endif
|
||||
|
||||
/*
|
||||
** RBU handle.
|
||||
**
|
||||
@ -387,7 +408,7 @@ struct sqlite3rbu {
|
||||
int rc; /* Value returned by last rbu_step() call */
|
||||
char *zErrmsg; /* Error message if rc!=SQLITE_OK */
|
||||
int nStep; /* Rows processed for current object */
|
||||
int nProgress; /* Rows processed for all objects */
|
||||
sqlite3_int64 nProgress; /* Rows processed for all objects */
|
||||
RbuObjIter objiter; /* Iterator for skipping through tbl/idx */
|
||||
const char *zVfsName; /* Name of automatically created rbu vfs */
|
||||
rbu_file *pTargetFd; /* File handle open on target db */
|
||||
@ -504,7 +525,7 @@ static unsigned int rbuDeltaGetInt(const char **pz, int *pLen){
|
||||
v = (v<<6) + c;
|
||||
}
|
||||
z--;
|
||||
*pLen -= z - zStart;
|
||||
*pLen -= (int)(z - zStart);
|
||||
*pz = (char*)z;
|
||||
return v;
|
||||
}
|
||||
@ -689,6 +710,7 @@ static void rbuFossilDeltaFunc(
|
||||
char *aOut;
|
||||
|
||||
assert( argc==2 );
|
||||
UNUSED_PARAMETER(argc);
|
||||
|
||||
nOrig = sqlite3_value_bytes(argv[0]);
|
||||
aOrig = (const char*)sqlite3_value_blob(argv[0]);
|
||||
@ -2268,13 +2290,13 @@ static char *rbuObjIterGetIndexWhere(sqlite3rbu *p, RbuObjIter *pIter){
|
||||
else if( c==')' ){
|
||||
nParen--;
|
||||
if( nParen==0 ){
|
||||
int nSpan = &zSql[i] - pIter->aIdxCol[iIdxCol].zSpan;
|
||||
int nSpan = (int)(&zSql[i] - pIter->aIdxCol[iIdxCol].zSpan);
|
||||
pIter->aIdxCol[iIdxCol++].nSpan = nSpan;
|
||||
i++;
|
||||
break;
|
||||
}
|
||||
}else if( c==',' && nParen==1 ){
|
||||
int nSpan = &zSql[i] - pIter->aIdxCol[iIdxCol].zSpan;
|
||||
int nSpan = (int)(&zSql[i] - pIter->aIdxCol[iIdxCol].zSpan);
|
||||
pIter->aIdxCol[iIdxCol++].nSpan = nSpan;
|
||||
pIter->aIdxCol[iIdxCol].zSpan = &zSql[i+1];
|
||||
}else if( c=='"' || c=='\'' || c=='`' ){
|
||||
@ -2964,6 +2986,8 @@ static void rbuFileSuffix3(const char *zBase, char *z){
|
||||
for(i=sz-1; i>0 && z[i]!='/' && z[i]!='.'; i--){}
|
||||
if( z[i]=='.' && sz>i+4 ) memmove(&z[i+1], &z[sz-3], 4);
|
||||
}
|
||||
#else
|
||||
UNUSED_PARAMETER2(zBase,z);
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -3548,7 +3572,7 @@ static void rbuSaveState(sqlite3rbu *p, int eStage){
|
||||
"(%d, %Q), "
|
||||
"(%d, %Q), "
|
||||
"(%d, %d), "
|
||||
"(%d, %d), "
|
||||
"(%d, %lld), "
|
||||
"(%d, %lld), "
|
||||
"(%d, %lld), "
|
||||
"(%d, %lld), "
|
||||
@ -3906,6 +3930,7 @@ static void rbuIndexCntFunc(
|
||||
sqlite3 *db = (rbuIsVacuum(p) ? p->dbRbu : p->dbMain);
|
||||
|
||||
assert( nVal==1 );
|
||||
UNUSED_PARAMETER(nVal);
|
||||
|
||||
rc = prepareFreeAndCollectError(db, &pStmt, &zErrmsg,
|
||||
sqlite3_mprintf("SELECT count(*) FROM sqlite_schema "
|
||||
@ -4181,7 +4206,7 @@ sqlite3rbu *sqlite3rbu_vacuum(
|
||||
){
|
||||
if( zTarget==0 ){ return rbuMisuseError(); }
|
||||
if( zState ){
|
||||
int n = strlen(zState);
|
||||
size_t n = strlen(zState);
|
||||
if( n>=7 && 0==memcmp("-vactmp", &zState[n-7], 7) ){
|
||||
return rbuMisuseError();
|
||||
}
|
||||
@ -4398,6 +4423,7 @@ int sqlite3rbu_savestate(sqlite3rbu *p){
|
||||
*/
|
||||
static int xDefaultRename(void *pArg, const char *zOld, const char *zNew){
|
||||
int rc = SQLITE_OK;
|
||||
UNUSED_PARAMETER(pArg);
|
||||
#if defined(_WIN32_WCE)
|
||||
{
|
||||
LPWSTR zWideOld;
|
||||
@ -5302,6 +5328,9 @@ static int rbuVfsCurrentTime(sqlite3_vfs *pVfs, double *pTimeOut){
|
||||
** No-op.
|
||||
*/
|
||||
static int rbuVfsGetLastError(sqlite3_vfs *pVfs, int a, char *b){
|
||||
UNUSED_PARAMETER(pVfs);
|
||||
UNUSED_PARAMETER(a);
|
||||
UNUSED_PARAMETER(b);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -383,10 +383,10 @@ static int SQLITE_TCLAPI test_session_cmd(
|
||||
{ "rowid", SQLITE_SESSION_OBJCONFIG_ROWID },
|
||||
{ 0, 0 }
|
||||
};
|
||||
size_t sz = sizeof(aOpt[0]);
|
||||
int sz = (int)sizeof(aOpt[0]);
|
||||
|
||||
int iArg;
|
||||
int iOpt;
|
||||
Tcl_Size iOpt;
|
||||
if( Tcl_GetIndexFromObjStruct(interp,objv[2],aOpt,sz,"option",0,&iOpt) ){
|
||||
return TCL_ERROR;
|
||||
}
|
||||
@ -803,7 +803,7 @@ static int SQLITE_TCLAPI testSqlite3changesetApply(
|
||||
if( bV2 ){
|
||||
while( objc>1 ){
|
||||
const char *z1 = Tcl_GetString(objv[1]);
|
||||
int n = strlen(z1);
|
||||
int n = (int)strlen(z1);
|
||||
if( n>3 && n<=12 && 0==sqlite3_strnicmp("-nosavepoint", z1, n) ){
|
||||
flags |= SQLITE_CHANGESETAPPLY_NOSAVEPOINT;
|
||||
}
|
||||
@ -1119,7 +1119,7 @@ static int SQLITE_TCLAPI test_sqlite3session_foreach(
|
||||
|
||||
while( objc>1 ){
|
||||
char *zOpt = Tcl_GetString(objv[1]);
|
||||
int nOpt = strlen(zOpt);
|
||||
int nOpt = (int)strlen(zOpt);
|
||||
if( zOpt[0]!='-' ) break;
|
||||
if( nOpt<=7 && 0==sqlite3_strnicmp(zOpt, "-invert", nOpt) ){
|
||||
isInvert = 1;
|
||||
|
1
main.mk
1
main.mk
@ -771,6 +771,7 @@ SHELL_DEP = \
|
||||
$(TOP)/ext/misc/shathree.c \
|
||||
$(TOP)/ext/misc/sqlar.c \
|
||||
$(TOP)/ext/misc/uint.c \
|
||||
$(TOP)/ext/misc/vfstrace.c \
|
||||
$(TOP)/ext/misc/zipfile.c \
|
||||
$(TOP)/ext/recover/dbdata.c \
|
||||
$(TOP)/ext/recover/sqlite3recover.c \
|
||||
|
87
manifest
87
manifest
@ -1,12 +1,12 @@
|
||||
C Store\sthe\svalues\sof\sany\sUNINDEXED\scolumns\sof\sa\scontentless\sfts5\stable\spersistently\sin\sthe\sdatabase.\sWarning:\sThis\scurrently\screates\sa\s(technically)\sincompatible\sfile-format\sfor\scontentless\sfts5\stables\sthat\shave\sUNINDEXED\scolumns.
|
||||
D 2024-09-03T18:55:38.957
|
||||
C Merge\slatest\strunk\schanges,\sincluding\sthe\schanges\sto\sthe\sfts5\slocale=1\sfeature,\sinto\sthis\sbranch.
|
||||
D 2024-09-13T15:37:31.588
|
||||
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
|
||||
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
|
||||
F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
|
||||
F Makefile.in af5fbc3453b745daa68c7aa5dfdb945c09cb724971db3b783d6b5e1a62279e28
|
||||
F Makefile.in 7753650b4204e3ccd55a4e6a0d73a5a01f737dcefb099d901ce1de5df9d0b82c
|
||||
F Makefile.linux-gcc f3842a0b1efbfbb74ac0ef60e56b301836d05b4d867d014f714fa750048f1ab6
|
||||
F Makefile.msc 2c905f4c795a628d7fd892294e8fdec6d5f719fa5b252cb839fed147e64435a0
|
||||
F README.md 5b678e264236788390d11991f2c0052bd73f19790173883fc56d638bcb849154
|
||||
F Makefile.msc 6e8925dca6dc8c3e9cce042bbf347d20164653e63aeafcf6f6a28e27cf976d8b
|
||||
F README.md c3c0f19532ce28f6297a71870f3c7b424729f0e6d9ab889616d3587dd2332159
|
||||
F VERSION 0db40f92c04378404eb45bff93e9e42c148c7e54fd3da99469ed21e22411f5a6
|
||||
F aclocal.m4 a5c22d164aff7ed549d53a90fa56d56955281f50
|
||||
F art/icon-243x273.gif 9750b734f82fdb3dc43127753d5e6fbf3b62c9f4e136c2fbf573b2f57ea87af5
|
||||
@ -39,7 +39,7 @@ F configure 49523f0a070b583cea040d26eff53a65fb0893eca4663b1343a4d5a9a964da53 x
|
||||
F configure.ac a100ebf7a07f5dedd319ef547dd467d1676ed059b85a7877aa9c44ac309f7000
|
||||
F contrib/sqlitecon.tcl 210a913ad63f9f991070821e599d600bd913e0ad
|
||||
F doc/F2FS.txt c1d4a0ae9711cfe0e1d8b019d154f1c29e0d3abfe820787ba1e9ed7691160fcd
|
||||
F doc/compile-for-windows.md e8635eea9153dcd6a51fd2740666ebc4492b3813cb1ac31cd8e99150df91762d
|
||||
F doc/compile-for-windows.md 4d4bfafda42a7a33f166d23aed4db1bb4ea1e5751595a5cced2bad349fd14652
|
||||
F doc/json-enhancements.md e356fc834781f1f1aa22ee300027a270b2c960122468499bf347bb123ce1ea4f
|
||||
F doc/jsonb.md 5fab4b8613aa9153fbeb6259297bd4697988af8b3d23900deba588fa7841456b
|
||||
F doc/lemon.html 8b266ff711d2ec7f867c3dca37634963f48a630329908cc282beebfa8c708706
|
||||
@ -53,7 +53,7 @@ F ext/README.md fd5f78013b0a2bc6f0067afb19e6ad040e89a10179b4f6f03eee58fac5f169bd
|
||||
F ext/async/README.txt e12275968f6fde133a80e04387d0e839b0c51f91
|
||||
F ext/async/sqlite3async.c 6f247666b495c477628dd19364d279c78ea48cd90c72d9f9b98ad1aff3294f94
|
||||
F ext/async/sqlite3async.h 46b47c79357b97ad85d20d2795942c0020dc20c532114a49808287f04aa5309a
|
||||
F ext/consio/console_io.c 6e02dea912a49f55785b0027fe77960aafee6c236307c23f82ec86a69f1a2001 x
|
||||
F ext/consio/console_io.c d2b74afae8d301de2e8447b1045fcd33eb59df13bf581d906d99c74fe5d2b13f x
|
||||
F ext/consio/console_io.h b5ebe34aa15b357621ebbea3d3f2e2b24750d4280b5802516409e23947fd9ee5
|
||||
F ext/expert/README.md b321c2762bb93c18ea102d5a5f7753a4b8bac646cb392b3b437f633caf2020c3
|
||||
F ext/expert/expert.c d548d603a4cc9e61f446cc179c120c6713511c413f82a4a32b1e1e69d3f086a4
|
||||
@ -93,15 +93,15 @@ F ext/fts3/unicode/mkunicode.tcl 63db9624ccf70d4887836c320eda93ab552f21008f3be7e
|
||||
F ext/fts3/unicode/parseunicode.tcl a981bd6466d12dd17967515801c3ff23f74a281be1a03cf1e6f52a6959fc77eb
|
||||
F ext/fts5/extract_api_docs.tcl 009cf59c77afa86d137b0cca3e3b1a5efbe2264faa2df233f9a7aa8563926d15
|
||||
F ext/fts5/fts5.h efaaac0df3d3bc740383044c144b582f47921aafa21d7b10eb98f42c24c740b0
|
||||
F ext/fts5/fts5Int.h d0c9bee4edfff9f0899648a9efc0afdebabbadb24403e2e50a1bb17aed6267d0
|
||||
F ext/fts5/fts5Int.h 6ec0c8a49412e2d7433ebc416cc5a5fd8583dbda30ba46c8835027a4e5c9b41a
|
||||
F ext/fts5/fts5_aux.c 65a0468dd177d6093aa9ae1622e6d86b0136b8d267c62c0ad6493ad1e9a3d759
|
||||
F ext/fts5/fts5_buffer.c 0eec58bff585f1a44ea9147eae5da2447292080ea435957f7488c70673cb6f09
|
||||
F ext/fts5/fts5_config.c 8dba11620a7964e1e561aaae3d27fdd2d16b2769c979f157dd55a53903a9b734
|
||||
F ext/fts5/fts5_config.c 700d7accca99d931390c4fcb7c71b92bbcff9093aa9c2d566d7f16a3c9550a59
|
||||
F ext/fts5/fts5_expr.c 9a56f53700d1860f0ee2f373c2b9074eaf2a7aa0637d0e27a6476de26a3fee33
|
||||
F ext/fts5/fts5_hash.c adda4272be401566a6e0ba1acbe70ee5cb97fce944bc2e04dc707152a0ec91b1
|
||||
F ext/fts5/fts5_index.c 571483823193f09439356741669aa8c81da838ae6f5e1bfa7517f7ee2fb3addd
|
||||
F ext/fts5/fts5_main.c 402a65b6d922203a90e7d440f29d71f19f6863e6b663ca9f06c7321f291bda40
|
||||
F ext/fts5/fts5_storage.c ca3bdb799b9b039133e9b6e4881fc974ba34ae4ea57530210289f82313b409b5
|
||||
F ext/fts5/fts5_main.c be195e918c40c304f81d899f8a9b00d47ed266583dd931e22730e83b011ddadc
|
||||
F ext/fts5/fts5_storage.c 1fbaf212042bdb363d74a48d3293b2c453a46880e86656df3ee19ade63472681
|
||||
F ext/fts5/fts5_tcl.c 4db9258a7882c5eac0da4433042132aaf15b87dd1e1636c7a6ca203abd2c8bfe
|
||||
F ext/fts5/fts5_test_mi.c 08c11ec968148d4cb4119d96d819f8c1f329812c568bac3684f5464be177d3ee
|
||||
F ext/fts5/fts5_test_tok.c 3cb0a9b508b30d17ef025ccddd26ae3dc8ddffbe76c057616e59a9aa85d36f3b
|
||||
@ -132,7 +132,7 @@ F ext/fts5/test/fts5auxdata.test 372549088ff792655f73e62b9dfaf4863ce74f5e604c06c
|
||||
F ext/fts5/test/fts5bigid.test 2860854c2561a57594192b00c33a29f91cb85e25f3d6c03b5c2b8f62708f39dd
|
||||
F ext/fts5/test/fts5bigpl.test 8f09858aab866c33593560e6480b2b6975ae7ff29ca32ad7b77e2da61402f8ef
|
||||
F ext/fts5/test/fts5bigtok.test 541119e616c637caea925a8c028c37c2c29e94383e00aa2f9198d530724b6e36
|
||||
F ext/fts5/test/fts5blob.test caa33369e93e99ff494cd1103506ae34c5afbc0bcc369ed5e58e135144e33689
|
||||
F ext/fts5/test/fts5blob.test 9644a5f917306690e08c5f89a470a3f2489376eaa52026eeca3209d149d6af74
|
||||
F ext/fts5/test/fts5cat.test bf67dd335f964482ee658287521b81e2b88697b45eb7f73933e15f198ed447cb
|
||||
F ext/fts5/test/fts5circref.test f880dfd0d99f6fb73b88ccacb0927d18e833672fd906cc47d6b4e529419eaa62
|
||||
F ext/fts5/test/fts5colset.test 544f4998cdbfe06a3123887fc0221612e8aa8192cdaff152872f1aadb10e6897
|
||||
@ -178,7 +178,7 @@ F ext/fts5/test/fts5faultE.test 844586ce71dab4be85bb86880e87b624d089f851654cd22e
|
||||
F ext/fts5/test/fts5faultF.test 4abef99f86e99d9f0c6460dd68c586a766b6b9f1f660ada55bf2e8266bd1bbc1
|
||||
F ext/fts5/test/fts5faultG.test 0544411ffcb3e19b42866f757a8a5e0fb8fef3a62c06f61d14deebc571bb7ea9
|
||||
F ext/fts5/test/fts5faultH.test 2b2b5b8cb1b3fd7679f488c06e22af44107fbc6137eaf45b3e771dc7b149312d
|
||||
F ext/fts5/test/fts5faultI.test ae4b83ac953200bd7b66d53038f7d6a4fc29cd64831b8e1795538babcea7c638
|
||||
F ext/fts5/test/fts5faultI.test 0706b307b208638554c9e65b4091e1c0dd8c92941535089a301df454ff2c56f4
|
||||
F ext/fts5/test/fts5first.test bfd685b96905bf541d99d8644e0a7219d1d833455a08ab64e344071a613b6ba9
|
||||
F ext/fts5/test/fts5full.test 97d263c1072f4a560929cca31e70f65d2ae232610e17e6affcf7e979df59547b
|
||||
F ext/fts5/test/fts5fuzz1.test 238d8c45f3b81342aa384de3e581ff2fa330bf922a7b69e484bbc06051a1080e
|
||||
@ -189,7 +189,7 @@ F ext/fts5/test/fts5interrupt.test 20d04204d3e341b104c0c24a41596b6393a3a81eba104
|
||||
F ext/fts5/test/fts5lastrowid.test f36298a1fb9f988bde060a274a7ce638faa9c38a31400f8d2d27ea9373e0c4a1
|
||||
F ext/fts5/test/fts5leftjoin.test c0b4cafb9661379e576dc4405c0891d8fcc2782680740513c4d1fc114b43d4ad
|
||||
F ext/fts5/test/fts5limits.test 8ab67cf5d311c124b6ceb0062d0297767176df4572d955fce79fa43004dff01c
|
||||
F ext/fts5/test/fts5locale.test 797cf6f5e017462ab11313ce884b9f1df8ff063811e74ef42190cd19ed6b600b
|
||||
F ext/fts5/test/fts5locale.test 83ba7ee12628b540d3098f39c39c1de0c0440eddff8f7512c8c698d0c4a3ae3c
|
||||
F ext/fts5/test/fts5matchinfo.test 877520582feb86bbfd95ab780099bcba4526f18ac75ee34979144cf86ba3a5a3
|
||||
F ext/fts5/test/fts5merge.test 2654df0bcdb2d117c2d38b6aeb0168061be01c643f9e9194b36c43a2970e8082
|
||||
F ext/fts5/test/fts5merge2.test 3ebad1a59d6ad3fb66eff6523a09e95dc6367cbefb3cd73196801dea0425c8e2
|
||||
@ -206,7 +206,7 @@ F ext/fts5/test/fts5origintext2.test f4505ff79bf7369f2b8b10b9cef7476049d844e20b3
|
||||
F ext/fts5/test/fts5origintext3.test 45c33cf0c91a9ca0e36d298462db3edc7c8fe45fd185649a9dbfd66bb670058b
|
||||
F ext/fts5/test/fts5origintext4.test 0d3ef0a8038f471dbc83001c34fe5f7ae39b571bfc209670771eb28bc0fc50e8
|
||||
F ext/fts5/test/fts5origintext5.test ee12b440ec335e5b422d1668aca0051b52ff28b6ee67073e8bbc29f509fd562b
|
||||
F ext/fts5/test/fts5phrase.test 6260b8be40d51ec287992cd983a5e58a9be92e5dc6e01d48cbce1ad0e95a99d8
|
||||
F ext/fts5/test/fts5phrase.test bb2554bb61d15f859678c96dc89a7de415cd5fc3b7b54c29b82a0d0ad138091c
|
||||
F ext/fts5/test/fts5plan.test f8b0d752a818059a934cdc96c0f77de058a67a0a57bb3a8181d28307ab5b1626
|
||||
F ext/fts5/test/fts5porter.test 15b514fac8690b58e99c330efe5bf5615bc43f2fae4a3cca3f923dbaff55a0c0
|
||||
F ext/fts5/test/fts5porter2.test 94f0e4351e2c99b4e74f1fae05a4ddf1cb5b926620a8c14554160d075ddc7a59
|
||||
@ -412,7 +412,7 @@ F ext/misc/nextchar.c 7877914c2a80c2f181dd04c3dbef550dfb54c93495dc03da2403b5dd58
|
||||
F ext/misc/noop.c f1a21cc9b7a4e667e5c8458d80ba680b8bd4315a003f256006046879f679c5a0
|
||||
F ext/misc/normalize.c bd84355c118e297522aba74de34a4fd286fc775524e0499b14473918d09ea61f
|
||||
F ext/misc/pcachetrace.c f4227ce03fb16aa8d6f321b72dd051097419d7a028a9853af048bee7645cb405
|
||||
F ext/misc/percentile.c b37f01f559cec6ed3c4bcf5079e355cfe8a64eb32cc15c3b0f531980fd632b67
|
||||
F ext/misc/percentile.c 42eb041edab407e512aaa087f99ed9287fe0b3224f7a6d194456c00fc1454312
|
||||
F ext/misc/prefixes.c 82645f79229877afab08c8b08ca1e7fa31921280906b90a61c294e4f540cd2a6
|
||||
F ext/misc/qpvtab.c fc189e127f68f791af90a487f4460ec91539a716daf45a0c357e963fd47cc06c
|
||||
F ext/misc/randomjson.c ef835fc64289e76ac4873b85fe12f9463a036168d7683cf2b773e36e6262c4ed
|
||||
@ -436,6 +436,7 @@ F ext/misc/urifuncs.c f71360d14fa9e7626b563f1f781c6148109462741c5235ac63ae0f8917
|
||||
F ext/misc/uuid.c 5bb2264c1b64d163efa46509544fd7500cb8769cb7c16dd52052da8d961505cf
|
||||
F ext/misc/vfslog.c 3932ab932eeb2601dbc4447cb14d445aaa9fbe43b863ef5f014401c3420afd20
|
||||
F ext/misc/vfsstat.c a85df08654743922a19410d7b1e3111de41bb7cd07d20dd16eda4e2b808d269d
|
||||
F ext/misc/vfstrace.c 03f90dd465968e01f5d1d3e79c36cbc53a5bfe1bd55d239435ce94df19d5b0ac w src/test_vfstrace.c
|
||||
F ext/misc/vtablog.c 1100250ce8782db37c833e3a9a5c9a3ecf1af5e15b8325572b82e6e0a138ffb5
|
||||
F ext/misc/vtshim.c 1976e6dd68dd0d64508c91a6dfab8e75f8aaf6cd
|
||||
F ext/misc/wholenumber.c 0fa0c082676b7868bf2fa918e911133f2b349bcdceabd1198bba5f65b4fc0668
|
||||
@ -485,7 +486,7 @@ F ext/rbu/rbuvacuum.test 542561741ff2b262e3694bc6012b44694ee62c545845319a06f3237
|
||||
F ext/rbu/rbuvacuum2.test ae097d04feb041446a74fac94b24bffeb3fdd60e32b848c5611e507ab702b81b
|
||||
F ext/rbu/rbuvacuum3.test 3ce42695fdf21aaa3499e857d7d4253bc499ad759bcd6c9362042c13cd37d8de
|
||||
F ext/rbu/rbuvacuum4.test ffccd22f67e2d0b380d2889685742159dfe0d19a3880ca3d2d1d69eefaebb205
|
||||
F ext/rbu/sqlite3rbu.c 4a3376c0fb9a844a799ac529fb81260523f6b13c9f629bc270c632dbae5fc1f8
|
||||
F ext/rbu/sqlite3rbu.c c07817e89477b8fc286ab6ed87da5bc82fc3490bbbe9e9b22eb2d900e81ee5dc
|
||||
F ext/rbu/sqlite3rbu.h 9d923eb135c5d04aa6afd7c39ca47b0d1d0707c100e02f19fdde6a494e414304
|
||||
F ext/rbu/test_rbu.c b9727c3394307d058e806c1da0f8bb7b24daf3c6bb94cb10cca88ea4d5c806c0
|
||||
F ext/recover/dbdata.c 5295f4f922b60d7035b6b9fd5846b13071b9d97ed7fad8496837bb7640d24771
|
||||
@ -596,7 +597,7 @@ F ext/session/sessionstat1.test 5e718d5888c0c49bbb33a7a4f816366db85f59f6a4f97544
|
||||
F ext/session/sessionwor.test 6fd9a2256442cebde5b2284936ae9e0d54bde692d0f5fd009ecef8511f4cf3fc
|
||||
F ext/session/sqlite3session.c c7473aafbd88f796391a8c25aa90975a8f3729ab7f4f8cf74ab9d3b014e10abe
|
||||
F ext/session/sqlite3session.h 683ccbf16e2c2521661fc4c1cf918ce57002039efbcabcd8097fa4bca569104b
|
||||
F ext/session/test_session.c 6acbe67db80ab0806147eb62a12f9e3a44930f4a740b68b0a4340dddda2c10d7
|
||||
F ext/session/test_session.c aa29abdcc9011ac02f4fa38e8ede226106eaeee7c3ea7d8b2b999a124e0c368c
|
||||
F ext/userauth/sqlite3userauth.h 7f3ea8c4686db8e40b0a0e7a8e0b00fac13aa7a3
|
||||
F ext/userauth/user-auth.txt ca7e9ee82ca4e1c1744295f8184dd70edfae1992865d26c64303f539eb6c084c
|
||||
F ext/userauth/userauth.c 7f00cded7dcaa5d47f54539b290a43d2e59f4b1eb5f447545fa865f002fc80cb
|
||||
@ -687,7 +688,7 @@ F ext/wasm/wasmfs.make 8a4955882aaa0783b3f60a9484a1f0f3d8b6f775c0fcd17c082f31966
|
||||
F install-sh 9d4de14ab9fb0facae2f48780b874848cbf2f895 x
|
||||
F ltmain.sh 3ff0879076df340d2e23ae905484d8c15d5fdea8
|
||||
F magic.txt 5ade0bc977aa135e79e3faaea894d5671b26107cc91e70783aa7dc83f22f3ba0
|
||||
F main.mk 5a2e7d4a852c058373efc78407816de41595d06975148c766092b3cf0fea4298
|
||||
F main.mk 391342c3c0907f57bbb9ab60ce4b3cfe1ea61161996b449033984673d18980fd
|
||||
F mptest/config01.test 3c6adcbc50b991866855f1977ff172eb6d901271
|
||||
F mptest/config02.test 4415dfe36c48785f751e16e32c20b077c28ae504
|
||||
F mptest/crash01.test 61e61469e257df0850df4293d7d4d6c2af301421
|
||||
@ -714,7 +715,7 @@ F src/callback.c db3a45e376deff6a16c0058163fe0ae2b73a2945f3f408ca32cf74960b28d49
|
||||
F src/complete.c a3634ab1e687055cd002e11b8f43eb75c17da23e
|
||||
F src/ctime.c b224d3db0f28c4a5f1407c50107a0a8133bd244ff3c7f6f8cedeb896a8cf1b64
|
||||
F src/date.c 89ce1ff20512a7fa5070ba6e7dd5c171148ca7d580955795bf97c79c2456144a
|
||||
F src/dbpage.c 80e46e1df623ec40486da7a5086cb723b0275a6e2a7b01d9f9b5da0f04ba2782
|
||||
F src/dbpage.c f8c93e845d1093554247c1e757cb443fc48ffbcb112cecfdebeca4b6aa6e5c6e
|
||||
F src/dbstat.c 73362c0df0f40ad5523a6f5501224959d0976757b511299bf892313e79d14f5c
|
||||
F src/delete.c 444c4d1eaac40103461e3b6f0881846dd3aafc1cec1dd169d3482fa331667da7
|
||||
F src/expr.c 6d5f2c38fe3ec06a7eac599dac822788b36064124e20112a844e9cd5156cb239
|
||||
@ -727,7 +728,7 @@ F src/hash.h 3340ab6e1d13e725571d7cee6d3e3135f0779a7d8e76a9ce0a85971fa3953c51
|
||||
F src/hwtime.h f9c2dfb84dce7acf95ce6d289e46f5f9d3d1afd328e53da8f8e9008e3b3caae6
|
||||
F src/in-operator.md 10cd8f4bcd225a32518407c2fb2484089112fd71
|
||||
F src/insert.c f8d1a0f8ee258411009c6b7f2d93170e351bd19f5ad89d57e1180644297cbe70
|
||||
F src/json.c 5b6a1d6015997b9ee848a32948720bdb26a0ef2de5a2127ebf7355ce66dbdc0d
|
||||
F src/json.c 68a98c020c22127f2d65f08855f7fc7460ff352a6ce0b543d8931dde83319c22
|
||||
F src/legacy.c d7874bc885906868cd51e6c2156698f2754f02d9eee1bae2d687323c3ca8e5aa
|
||||
F src/loadext.c 7432c944ff197046d67a1207790a1b13eec4548c85a9457eb0896bb3641dfb36
|
||||
F src/main.c e7b53893f9fb3ad76baa8513f85c167b34d5c8e25ce64608db440f5637d0fe9e
|
||||
@ -740,7 +741,7 @@ F src/mem5.c b7da5c10a726aacacc9ad7cdcb0667deec643e117591cc69cf9b4b9e7f3e96ff
|
||||
F src/memdb.c 16679def118b5fd75292a253166d3feba3ec9c6189205bf209643ecdb2174ecc
|
||||
F src/memjournal.c c283c6c95d940eb9dc70f1863eef3ee40382dbd35e5a1108026e7817c206e8a0
|
||||
F src/msvc.h 80b35f95d93bf996ccb3e498535255f2ef1118c78764719a7cd15ab4106ccac9
|
||||
F src/mutex.c 1b4c7e5e3621b510e0c18397210be27cd54c8084141144fbbafd003fde948e88
|
||||
F src/mutex.c 06bcd9c3dbf2d9b21fcd182606c00fafb9bfe0287983c8e17acd13d2c81a2fa9
|
||||
F src/mutex.h a7b2293c48db5f27007c3bdb21d438873637d12658f5a0bf8ad025bb96803c4a
|
||||
F src/mutex_noop.c 9d4309c075ba9cc7249e19412d3d62f7f94839c4
|
||||
F src/mutex_unix.c f7ee5a2061a4c11815a2bf4fc0e2bfa6fb8d9dc89390eb613ca0cec32fc9a3d1
|
||||
@ -768,7 +769,7 @@ F src/random.c 606b00941a1d7dd09c381d3279a058d771f406c5213c9932bbd93d5587be4b9c
|
||||
F src/resolve.c 2c127880c0634962837f16f2f48a295e514357af959330cc038de73015d5b5e8
|
||||
F src/rowset.c 8432130e6c344b3401a8874c3cb49fefe6873fec593294de077afea2dce5ec97
|
||||
F src/select.c 4b14337a2742f0c0beeba490e9a05507e9b4b12184b9cd12773501d08d48e3fe
|
||||
F src/shell.c.in 40de636c1d90fb8a9ca7f49dc8f50d930f1b60736e73aca5eb37c4c7d0e47f9d
|
||||
F src/shell.c.in 470db843788d74234cc1e6873ac51c0ae6529994a52146fefe2e77c0754cbf96
|
||||
F src/sqlite.h.in 77f55bd1978a04a14db211732f0a609077cf60ba4ccf9baf39988f508945419c
|
||||
F src/sqlite3.rc 5121c9e10c3964d5755191c80dd1180c122fc3a8
|
||||
F src/sqlite3ext.h 3f046c04ea3595d6bfda99b781926b17e672fd6d27da2ba6d8d8fc39981dcb54
|
||||
@ -778,7 +779,7 @@ F src/status.c cb11f8589a6912af2da3bb1ec509a94dd8ef27df4d4c1a97e0bcf2309ece972b
|
||||
F src/table.c 0f141b58a16de7e2fbe81c308379e7279f4c6b50eb08efeec5892794a0ba30d1
|
||||
F src/tclsqlite.c c6888598f08dee3d9112a38ef42c8f5c89ca7f3190f4694744d0b84250f4bf8c
|
||||
F src/tclsqlite.h c6af51f31a2b2172d674608763a4b98fdf5cd587e4025053e546fb8077757262
|
||||
F src/test1.c 3f18399557d954bc85f4564aec8ea1777d2161a81d98a3ff6c9e9046bf3554c1
|
||||
F src/test1.c 8d7cd219c004cd2ced60659ebf045025cc5c16ce19d12459589dacd4310f7f07
|
||||
F src/test2.c 7ebc518e6735939d8979273a6f7b1d9b5702babf059f6ad62499f7f60a9eb9a3
|
||||
F src/test3.c e7573aa0f78ee4e070a4bc8c3493941c1aa64d5c66d4825c74c0f055451f432b
|
||||
F src/test4.c 13e57ae7ec7a959ee180970aef09deed141252fe9bb07c61054f0dfa4f1dfd5d
|
||||
@ -824,7 +825,6 @@ F src/test_tclvar.c ae873248a0188459b1c16ca7cc431265dacce524399e8b46725c2b3b7e04
|
||||
F src/test_thread.c d7a8bcea7445f37cc2a1f7f81dd6059634f45e0c61bfe80182b02872fb0328bb
|
||||
F src/test_vdbecov.c 5c426d9cd2b351f5f9ceb30cabf8c64a63bfcad644c507e0bd9ce2f6ae1a3bf3
|
||||
F src/test_vfs.c f298475e468c7e14945b20af885917181090c265aa3c4ade897849c9fbd396f2
|
||||
F src/test_vfstrace.c a2ea82df2ed8927e9eba49bdba1aa1aeb1dcb13dbf6558cff036da813031de9a
|
||||
F src/test_windirent.c a895e2c068a06644eef91a7f0a32182445a893b9a0f33d0cdb4283dca2486ac1
|
||||
F src/test_windirent.h da2e5b73c32d09905fbdd00f27cd802212a32a58ead882736fe4f5eb775ebc50
|
||||
F src/test_window.c 6d80e11fba89a1796525e6f0048ff0c7789aa2c6b0b11c80827dc1437bd8ea72
|
||||
@ -850,10 +850,10 @@ F src/vdbetrace.c fe0bc29ebd4e02c8bc5c1945f1d2e6be5927ec12c06d89b03ef2a4def34bf8
|
||||
F src/vdbevtab.c fc46b9cbd759dc013f0b3724549cc0d71379183c667df3a5988f7e2f1bd485f3
|
||||
F src/vtab.c 5fb499d20494b7eecaadb7584634af9afcb374cb0524912b475fcb1712458a1b
|
||||
F src/vxworks.h d2988f4e5a61a4dfe82c6524dd3d6e4f2ce3cdb9
|
||||
F src/wal.c 887fc4ca3f020ebb2e376f222069570834ac63bf50111ef0cbf3ae417048ed89
|
||||
F src/wal.c ef68130ba330ee18c1cb22da36a881c82e3a3b109badbdc6a9b9acaf788a6688
|
||||
F src/wal.h ba252daaa94f889f4b2c17c027e823d9be47ce39da1d3799886bbd51f0490452
|
||||
F src/walker.c d5006d6b005e4ea7302ad390957a8d41ed83faa177e412f89bc5600a7462a014
|
||||
F src/where.c c046dd58c3410f7b7528e1e6317cb876398557bad346d568ed8562321a7d002d
|
||||
F src/where.c 7fb55836eb7fd07f0a0d8400c50619fc02cda1f46a617cfb003c2990f040193d
|
||||
F src/whereInt.h a5d079c346a658b7a6e9e47bb943d021e02fa1e6aed3b964ca112112a4892192
|
||||
F src/wherecode.c 5172d647798134e7c92536ddffe7e530c393d79b5dedd648b88faf2646c65baf
|
||||
F src/whereexpr.c 44f41ae554c7572e1de1485b3169b233ee04d464b2ee5881687ede3bf07cacfa
|
||||
@ -1185,7 +1185,7 @@ F test/fts3conf.test c9cd45433b6787d48a43e84949aa2eb8b3b3d242bac7276731c1476290d
|
||||
F test/fts3corrupt.test 6732477c5ace050c5758a40a8b5706c8c0cccd416b9c558e0e15224805a40e57
|
||||
F test/fts3corrupt2.test e318f0676e5e78d5a4b702637e2bb25265954c08a1b1e4aaf93c7880bb0c67d0
|
||||
F test/fts3corrupt3.test 0d5b69a0998b4adf868cc301fc78f3d0707745f1d984ce044c205cdb764b491f
|
||||
F test/fts3corrupt4.test 48bd57baed9654e511709a02dbef2d22ee54c012ad466e8648f0f825233faa08
|
||||
F test/fts3corrupt4.test a451033ae31db9c5979a7612dee80fb4f221db104a2eeeabd1c9adcc8e8fe95a
|
||||
F test/fts3corrupt5.test 0549f85ec4bd22e992f645f13c59b99d652f2f5e643dac75568bfd23a6db7ed5
|
||||
F test/fts3corrupt6.test f417c910254f32c0bc9ead7affa991a1d5aec35b3b32a183ffb05eea78289525
|
||||
F test/fts3cov.test 7eacdbefd756cfa4dc2241974e3db2834e9b372ca215880e00032222f32194cf
|
||||
@ -1268,7 +1268,7 @@ F test/fuzz3.test 70ba57260364b83e964707b9d4b5625284239768ab907dd387c740c0370ce3
|
||||
F test/fuzz4.test c229bcdb45518a89e1d208a21343e061503460ac69fae1539320a89f572eb634
|
||||
F test/fuzz_common.tcl b7197de6ed1ee8250a4f82d67876f4561b42ee8cbbfc6160dcb66331bad3f830
|
||||
F test/fuzz_malloc.test f348276e732e814802e39f042b1f6da6362a610af73a528d8f76898fde6b22f2
|
||||
F test/fuzzcheck.c 20be6c96bd0da2e91d25f089a037c1b3f8142211c97104f20629bf15610019e6
|
||||
F test/fuzzcheck.c 89b71d92b150a532e945e489d6e0721a4b15353c9255e079c198ed2a1958018b
|
||||
F test/fuzzdata1.db 3e86d9cf5aea68ddb8e27c02d7dfdaa226347426c7eb814918e4d95475bf8517
|
||||
F test/fuzzdata2.db 128b3feeb78918d075c9b14b48610145a0dd4c8d6f1ca7c2870c7e425f5bf31f
|
||||
F test/fuzzdata3.db c6586d3e3cef0fbc18108f9bb649aa77bfc38aba
|
||||
@ -1280,7 +1280,7 @@ F test/fuzzdata8.db 4a53b6d077c6a5c23b609d8d3ac66996fa55ba3f8d02f9b6efdd0214a767
|
||||
F test/fuzzer1.test 3d4c4b7e547aba5e5511a2991e3e3d07166cfbb8
|
||||
F test/fuzzer2.test a85ef814ce071293bce1ad8dffa217cbbaad4c14
|
||||
F test/fuzzerfault.test f64c4aef4c9e9edf1d6dc0d3f1e65dcc81e67c996403c88d14f09b74807a42bc
|
||||
F test/fuzzinvariants.c 81167c9a7e82c0539a1d704aeb3384046d01f4108cda160a2447cb2a149d6362
|
||||
F test/fuzzinvariants.c 057e910241d85aa4aaf75cef1a7adc45c632b173288d07d9dbbef4e6bda83d5a
|
||||
F test/gcfault.test 4ea410ac161e685f17b19e1f606f58514a2850e806c65b846d05f60d436c5b0d
|
||||
F test/gencol1.test e169bdfa11c7ed5e9f322a98a7db3afe9e66235750b68c923efee8e1876b46ec
|
||||
F test/genesis.tcl 1e2e2e8e5cc4058549a154ff1892fe5c9de19f98
|
||||
@ -1347,7 +1347,7 @@ F test/ioerr5.test 5984da7bf74b6540aa356f2ab0c6ae68a6d12039a3d798a9ac6a100abc17d
|
||||
F test/ioerr6.test a395a6ab144b26a9e3e21059a1ab6a7149cca65b
|
||||
F test/istrue.test e7f285bb70282625c258e866ce6337d4c762922f5a300e1b50f958aef6e7d9c9
|
||||
F test/join.test f7abfef3faeaf2800308872e33a57e5b6e4a2b44fb8c6b90c6068412e71a6cf4
|
||||
F test/join2.test 8561fe82ce434ac96de91544072e578dc2cadddf2d9bc9cd802f866a9b92502e
|
||||
F test/join2.test f59d63264fb24784ae9c3bc9d867eb569cd6d442da5660f8852effe5c1938c27
|
||||
F test/join3.test 6f0c774ff1ba0489e6c88a3e77b9d3528fb4fda0
|
||||
F test/join4.test 1a352e4e267114444c29266ce79e941af5885916
|
||||
F test/join5.test 380d12a9350f99f0cc681a4f1fea999886f18b3fe0d71a9b3065bcaead1e007f
|
||||
@ -1382,7 +1382,7 @@ F test/json106.test 4aed3afd16549045d198a8d9cea00deea96e1f2ecf55864dce96cac558b8
|
||||
F test/json107.test 59054e815c8f6b67d634d44ace421cf975828fb5651c4460aa66015c8e19d562
|
||||
F test/json108.test 0a5f1e2d4b35a1bc33052563d2a5ede03052e2099e58cb424547656c898e0f49
|
||||
F test/json501.test b95e2d14988b682a5cadf079dd6162f0f85fb74cd59c6b1f1624110104a974eb
|
||||
F test/json502.test 84634d3dbb521d2814e43624025b760c6198456c8197bbec6c977c0236648f5b
|
||||
F test/json502.test 4ef68e4f272dfb083d4cbceb4e9e51d67ec1186a185e0c13637c50a4dc2f9796
|
||||
F test/jsonb01.test f4cdfb4cf5a0c940091b17675ed9583f45add0c938f07d65b0de0e19d3a9a101
|
||||
F test/keyword1.test 37ef6bba5d2ed5b07ecdd6810571de2956599dff
|
||||
F test/kvtest.c 6e0228409ea7ca0497dad503fbd109badb5e59545d131014b6aaac68b56f484a
|
||||
@ -1715,9 +1715,9 @@ F test/temptable.test d2c9b87a54147161bcd1822e30c1d1cd891e5b30
|
||||
F test/temptable2.test 76821347810ecc88203e6ef0dd6897b6036ac788e9dd3e6b04fd4d1631311a16
|
||||
F test/temptable3.test d11a0974e52b347e45ee54ef1923c91ed91e4637
|
||||
F test/temptrigger.test 38f0ca479b1822d3117069e014daabcaacefffcc
|
||||
F test/tester.tcl 2c203a2dd664298f239f0ec3ce22fbc65b5f021c1e09edbae8452af8a694e052
|
||||
F test/testrunner.tcl 92e3c63072362cd56d7dec2548284425104b5b3a5c0af3371ee2911712d89bf6
|
||||
F test/testrunner_data.tcl d64e69aba227492fc459eb0f6a88c3e1b252bd9323847b7e8bcf5e1faa358714
|
||||
F test/tester.tcl 7b44f1a9b9a2de8112695b908afc21dd9a68cd2d44e84b73f1b27b53492c0d59
|
||||
F test/testrunner.tcl 3dd75b45593d2afa2e3bca76121297a9f163bebb98474b13536f326829a71db1 x
|
||||
F test/testrunner_data.tcl dbc0bb1c5b912dfd1e32b25d544318e412edd6085bd5fc9e6619cb93a739b786
|
||||
F test/thread001.test a0985c117eab62c0c65526e9fa5d1360dd1cac5b03bde223902763274ce21899
|
||||
F test/thread002.test c24c83408e35ba5a952a3638b7ac03ccdf1ce4409289c54a050ac4c5f1de7502
|
||||
F test/thread003.test ee4c9efc3b86a6a2767516a37bd64251272560a7
|
||||
@ -2052,7 +2052,7 @@ F test/wherelimit3.test 22d73e046870cf8bbe15573eda6b432b07ebe64a88711f9f849c6b36
|
||||
F test/widetab1.test c296a98e123762de79917350e45fa33fdf88577a2571eb3a64c8bf7e44ef74d1
|
||||
F test/win32heap.test 10fd891266bd00af68671e702317726375e5407561d859be1aa04696f2aeee74
|
||||
F test/win32lock.test e0924eb8daac02bf80e9da88930747bd44dd9b230b7759fed927b1655b467c9c
|
||||
F test/win32longpath.test 42210789bcfc5c0ac202643d6d0237db08df2c9218f2070d9a69e8af1eccf7d7
|
||||
F test/win32longpath.test 304006024ca47104bf5a7415ef31ca83ecfc29351af202baf8588b880cffc116
|
||||
F test/win32nolock.test ac4f08811a562e45a5755e661f45ca85892bdbbc
|
||||
F test/window1.test 79dc3b9a2226f622d7e104a1fc750d1c4c3c08d6147b59085bdbe05352947ffa
|
||||
F test/window2.tcl 492c125fa550cda1dd3555768a2303b3effbeceee215293adf8871efc25f1476
|
||||
@ -2103,7 +2103,7 @@ F tool/GetFile.cs 47852aa0d806fe47ed1ac5138bdce7f000fe87aaa7f28107d0cb1e26682aeb
|
||||
F tool/GetTclKit.bat d84033c6a93dfe735d247f48ba00292a1cc284dcf69963e5e672444e04534bbf
|
||||
F tool/Replace.cs 02c67258801c2fb5f63231e0ac0f220b4b36ba91
|
||||
F tool/build-all-msvc.bat c817b716e0edeecaf265a6775b63e5f45c34a6544f1d4114a222701ed5ac79ab x
|
||||
F tool/build-shell.sh f193b5e3eb4afcb4abbf96bf1475be6cfb74763ee2e50c82bc7ca105e8a136c5
|
||||
F tool/build-shell.sh 369c4b171cc877ad974fef691e4da782b4c1e99fe8f4361316c735f64d49280f
|
||||
F tool/buildtclext.tcl b64d250517b148e644d26fcbc097851867a0df52cd4bafe9bcd94b8421e1428a
|
||||
F tool/cg_anno.tcl c1f875f5a4c9caca3d59937b16aff716f8b1883935f1b4c9ae23124705bc8099 x
|
||||
F tool/checkSpacing.c 810e51703529a204fc4e1eb060e9ab663e3c06d2
|
||||
@ -2153,12 +2153,12 @@ F tool/offsets.c 8ed2b344d33f06e71366a9b93ccedaa38c096cc1dbd4c3c26ad08c611528584
|
||||
F tool/omittest-msvc.tcl d6b8f501ac1d7798c4126065030f89812379012cad98a1735d6d7221492abc08
|
||||
F tool/omittest.tcl 5ca5e4e01716d5f35b48b00fd351d929f01fbb98169a5a3cd00baf3d2e2019a9
|
||||
F tool/opcodesum.tcl 740ed206ba8c5040018988129abbf3089a0ccf4a
|
||||
F tool/pagesig.c ff0ca355fd3c2398e933da5e22439bbff89b803b
|
||||
F tool/pagesig.c f98909b4168d9cac11a2de7f031adea0e2f3131faa7515a72807c03ec58eafeb
|
||||
F tool/replace.tcl 511c61acfe563dfb58675efb4628bb158a13d48ff8322123ac447e9d25a82d9a
|
||||
F tool/restore_jrnl.tcl 1079ecba47cc82fa82115b81c1f68097ab1f956f357ee8da5fc4b2589af6bd98
|
||||
F tool/rollback-test.c 9fc98427d1e23e84429d7e6d07d9094fbdec65a5
|
||||
F tool/run-speed-test.sh f95d19fd669b68c4c38b6b475242841d47c66076
|
||||
F tool/showdb.c 0f74b54cc67076c76cba9b2b7f54d3e05b78d130c70ffc394eb84c5b41bab017
|
||||
F tool/showdb.c 81b04bfaa9a63665f75945947323aa68b820570aa156b1574f440fc8276092c6
|
||||
F tool/showjournal.c 5bad7ae8784a43d2b270d953060423b8bd480818
|
||||
F tool/showlocks.c 9cc5e66d4ebbf2d194f39db2527ece92077e86ae627ddd233ee48e16e8142564
|
||||
F tool/showshm.c a0ab6ec32dd1f11218ca2a4018f8fb875b59414801ab8ceed8b2e69b7b45a809
|
||||
@ -2213,11 +2213,8 @@ F vsixtest/vsixtest.tcl 6195aba1f12a5e10efc2b8c0009532167be5e301abe5b31385638080
|
||||
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
|
||||
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
|
||||
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
|
||||
P 0ef65fd4ba17def4c13986365b3af300c4024725af4bc314845d1af8be568ab4
|
||||
R 87dfb79be977919afc56ac91ca0cf0b0
|
||||
T *branch * fts5-contentless-unindexed
|
||||
T *sym-fts5-contentless-unindexed *
|
||||
T -sym-trunk *
|
||||
P dcacb1a8ef359b4507b4733356d3150ba5dc105cc9867c103d16a0908a1a9f64 4cad385b90eaca2d90e3375e473472145af4134160b81097a8535d06638c2e4a
|
||||
R 6b427d068701369235fcf90674c4aaf6
|
||||
U dan
|
||||
Z f39a0e93422c865c24dfd629a9a47017
|
||||
Z a31c0a78609956d9ed51a360c49325fd
|
||||
# Remove this line to create a well-formed Fossil manifest.
|
||||
|
@ -1 +1 @@
|
||||
dcacb1a8ef359b4507b4733356d3150ba5dc105cc9867c103d16a0908a1a9f64
|
||||
d2f0d19936222911bc317efecc831007d3aba81f9b32877030ffb29d1728bbdc
|
||||
|
21
src/dbpage.c
21
src/dbpage.c
@ -321,7 +321,6 @@ static int dbpageUpdate(
|
||||
DbPage *pDbPage = 0;
|
||||
int rc = SQLITE_OK;
|
||||
char *zErr = 0;
|
||||
const char *zSchema;
|
||||
int iDb;
|
||||
Btree *pBt;
|
||||
Pager *pPager;
|
||||
@ -336,21 +335,27 @@ static int dbpageUpdate(
|
||||
zErr = "cannot delete";
|
||||
goto update_fail;
|
||||
}
|
||||
if( sqlite3_value_type(argv[0])==SQLITE_NULL ){
|
||||
pgno = (Pgno)sqlite3_value_int(argv[2]);
|
||||
}else{
|
||||
pgno = sqlite3_value_int(argv[0]);
|
||||
if( sqlite3_value_type(argv[0])==SQLITE_NULL
|
||||
|| (Pgno)sqlite3_value_int(argv[1])!=pgno
|
||||
){
|
||||
if( (Pgno)sqlite3_value_int(argv[1])!=pgno ){
|
||||
zErr = "cannot insert";
|
||||
goto update_fail;
|
||||
}
|
||||
zSchema = (const char*)sqlite3_value_text(argv[4]);
|
||||
iDb = ALWAYS(zSchema) ? sqlite3FindDbName(pTab->db, zSchema) : -1;
|
||||
if( NEVER(iDb<0) ){
|
||||
}
|
||||
if( sqlite3_value_type(argv[4])==SQLITE_NULL ){
|
||||
iDb = 0;
|
||||
}else{
|
||||
const char *zSchema = (const char*)sqlite3_value_text(argv[4]);
|
||||
iDb = zSchema ? sqlite3FindDbName(pTab->db, zSchema) : -1;
|
||||
if( iDb<0 ){
|
||||
zErr = "no such schema";
|
||||
goto update_fail;
|
||||
}
|
||||
}
|
||||
pBt = pTab->db->aDb[iDb].pBt;
|
||||
if( NEVER(pgno<1) || NEVER(pBt==0) || NEVER(pgno>sqlite3BtreeLastPage(pBt)) ){
|
||||
if( pgno<1 || NEVER(pBt==0) ){
|
||||
zErr = "bad page number";
|
||||
goto update_fail;
|
||||
}
|
||||
|
@ -2847,7 +2847,9 @@ static u32 jsonLookupStep(
|
||||
zPath++;
|
||||
if( zPath[0]=='"' ){
|
||||
zKey = zPath + 1;
|
||||
for(i=1; zPath[i] && zPath[i]!='"'; i++){}
|
||||
for(i=1; zPath[i] && zPath[i]!='"'; i++){
|
||||
if( zPath[i]=='\\' && zPath[i+1]!=0 ) i++;
|
||||
}
|
||||
nKey = i-1;
|
||||
if( zPath[i] ){
|
||||
i++;
|
||||
|
15
src/mutex.c
15
src/mutex.c
@ -347,15 +347,28 @@ void sqlite3_mutex_leave(sqlite3_mutex *p){
|
||||
/*
|
||||
** The sqlite3_mutex_held() and sqlite3_mutex_notheld() routine are
|
||||
** intended for use inside assert() statements.
|
||||
**
|
||||
** Because these routines raise false-positive alerts in TSAN, disable
|
||||
** them (make them always return 1) when compiling with TSAN.
|
||||
*/
|
||||
int sqlite3_mutex_held(sqlite3_mutex *p){
|
||||
# if defined(__has_feature)
|
||||
# if __has_feature(thread_sanitizer)
|
||||
p = 0;
|
||||
# endif
|
||||
# endif
|
||||
assert( p==0 || sqlite3GlobalConfig.mutex.xMutexHeld );
|
||||
return p==0 || sqlite3GlobalConfig.mutex.xMutexHeld(p);
|
||||
}
|
||||
int sqlite3_mutex_notheld(sqlite3_mutex *p){
|
||||
# if defined(__has_feature)
|
||||
# if __has_feature(thread_sanitizer)
|
||||
p = 0;
|
||||
# endif
|
||||
# endif
|
||||
assert( p==0 || sqlite3GlobalConfig.mutex.xMutexNotheld );
|
||||
return p==0 || sqlite3GlobalConfig.mutex.xMutexNotheld(p);
|
||||
}
|
||||
#endif
|
||||
#endif /* NDEBUG */
|
||||
|
||||
#endif /* !defined(SQLITE_MUTEX_OMIT) */
|
||||
|
@ -1236,6 +1236,7 @@ INCLUDE ../ext/expert/sqlite3expert.c
|
||||
INCLUDE ../ext/intck/sqlite3intck.h
|
||||
INCLUDE ../ext/intck/sqlite3intck.c
|
||||
INCLUDE ../ext/misc/stmtrand.c
|
||||
INCLUDE ../ext/misc/vfstrace.c
|
||||
|
||||
#if !defined(SQLITE_OMIT_VIRTUALTABLE) && defined(SQLITE_ENABLE_DBPAGE_VTAB)
|
||||
#define SQLITE_SHELL_HAVE_RECOVER 1
|
||||
@ -12254,9 +12255,7 @@ static const char zOptions[] =
|
||||
" -unsafe-testing allow unsafe commands and modes for testing\n"
|
||||
" -version show SQLite version\n"
|
||||
" -vfs NAME use NAME as the default VFS\n"
|
||||
#ifdef SQLITE_ENABLE_VFSTRACE
|
||||
" -vfstrace enable tracing of all VFS calls\n"
|
||||
#endif
|
||||
#ifdef SQLITE_HAVE_ZLIB
|
||||
" -zip open the file as a ZIP Archive\n"
|
||||
#endif
|
||||
@ -12382,6 +12381,7 @@ int SQLITE_CDECL wmain(int argc, wchar_t **wargv){
|
||||
int readStdin = 1;
|
||||
int nCmd = 0;
|
||||
int nOptsEnd = argc;
|
||||
int bEnableVfstrace = 0;
|
||||
char **azCmd = 0;
|
||||
const char *zVfs = 0; /* Value of -vfs command-line option */
|
||||
#if !SQLITE_SHELL_IS_UTF8
|
||||
@ -12576,17 +12576,9 @@ int SQLITE_CDECL wmain(int argc, wchar_t **wargv){
|
||||
case 2: sqlite3_config(SQLITE_CONFIG_MULTITHREAD); break;
|
||||
default: sqlite3_config(SQLITE_CONFIG_SERIALIZED); break;
|
||||
}
|
||||
#ifdef SQLITE_ENABLE_VFSTRACE
|
||||
}else if( cli_strcmp(z,"-vfstrace")==0 ){
|
||||
extern int vfstrace_register(
|
||||
const char *zTraceName,
|
||||
const char *zOldVfsName,
|
||||
int (*xOut)(const char*,void*),
|
||||
void *pOutArg,
|
||||
int makeDefault
|
||||
);
|
||||
vfstrace_register("trace",0,(int(*)(const char*,void*))fputs,stderr,1);
|
||||
#endif
|
||||
bEnableVfstrace = 1;
|
||||
#ifdef SQLITE_ENABLE_MULTIPLEX
|
||||
}else if( cli_strcmp(z,"-multiplex")==0 ){
|
||||
extern int sqlite3_multiplex_initialize(const char*,int);
|
||||
@ -12642,7 +12634,7 @@ int SQLITE_CDECL wmain(int argc, wchar_t **wargv){
|
||||
}
|
||||
}
|
||||
#ifndef SQLITE_SHELL_FIDDLE
|
||||
verify_uninitialized();
|
||||
if( !bEnableVfstrace ) verify_uninitialized();
|
||||
#endif
|
||||
|
||||
|
||||
@ -12831,10 +12823,8 @@ int SQLITE_CDECL wmain(int argc, wchar_t **wargv){
|
||||
#endif
|
||||
}else if( cli_strcmp(z,"-vfs")==0 ){
|
||||
i++;
|
||||
#ifdef SQLITE_ENABLE_VFSTRACE
|
||||
}else if( cli_strcmp(z,"-vfstrace")==0 ){
|
||||
i++;
|
||||
#endif
|
||||
#ifdef SQLITE_ENABLE_MULTIPLEX
|
||||
}else if( cli_strcmp(z,"-multiplex")==0 ){
|
||||
i++;
|
||||
@ -13002,6 +12992,9 @@ int SQLITE_CDECL wmain(int argc, wchar_t **wargv){
|
||||
/* Clear the global data structure so that valgrind will detect memory
|
||||
** leaks */
|
||||
memset(&data, 0, sizeof(data));
|
||||
if( bEnableVfstrace ){
|
||||
vfstrace_unregister("trace");
|
||||
}
|
||||
#ifdef SQLITE_DEBUG
|
||||
if( sqlite3_memory_used()>mem_main_enter ){
|
||||
eputf("Memory leaked: %u bytes\n",
|
||||
|
@ -2343,7 +2343,7 @@ static int SQLITE_TCLAPI test_stmt_scanstatus(
|
||||
}
|
||||
for(ii=0; ii<(int)nFlag; ii++){
|
||||
int iVal = 0;
|
||||
int res = Tcl_GetIndexFromObjStruct(
|
||||
res = Tcl_GetIndexFromObjStruct(
|
||||
interp, aFlag[ii], aTbl, sizeof(aTbl[0]), "flag", 0, &iVal
|
||||
);
|
||||
if( res ) return TCL_ERROR;
|
||||
|
@ -44,7 +44,7 @@
|
||||
** 28: Checksum-2 (second part of checksum for first 24 bytes of header).
|
||||
**
|
||||
** Immediately following the wal-header are zero or more frames. Each
|
||||
** frame consists of a 24-byte frame-header followed by a <page-size> bytes
|
||||
** frame consists of a 24-byte frame-header followed by <page-size> bytes
|
||||
** of page data. The frame-header is six big-endian 32-bit unsigned
|
||||
** integer values, as follows:
|
||||
**
|
||||
|
@ -6199,6 +6199,7 @@ static SQLITE_NOINLINE Bitmask whereOmitNoopJoin(
|
||||
WhereTerm *pTerm, *pEnd;
|
||||
SrcItem *pItem;
|
||||
WhereLoop *pLoop;
|
||||
Bitmask m1;
|
||||
pLoop = pWInfo->a[i].pWLoop;
|
||||
pItem = &pWInfo->pTabList->a[pLoop->iTab];
|
||||
if( (pItem->fg.jointype & (JT_LEFT|JT_RIGHT))!=JT_LEFT ) continue;
|
||||
@ -6225,7 +6226,10 @@ static SQLITE_NOINLINE Bitmask whereOmitNoopJoin(
|
||||
}
|
||||
}
|
||||
if( pTerm<pEnd ) continue;
|
||||
WHERETRACE(0xffffffff, ("-> drop loop %c not used\n", pLoop->cId));
|
||||
WHERETRACE(0xffffffff,("-> omit unused FROM-clause term %c\n",pLoop->cId));
|
||||
m1 = MASKBIT(i)-1;
|
||||
testcase( ((pWInfo->revMask>>1) & ~m1)!=0 );
|
||||
pWInfo->revMask = (m1 & pWInfo->revMask) | ((pWInfo->revMask>>1) & ~m1);
|
||||
notReady &= ~pLoop->maskSelf;
|
||||
for(pTerm=pWInfo->sWC.a; pTerm<pEnd; pTerm++){
|
||||
if( (pTerm->prereqAll & pLoop->maskSelf)!=0 ){
|
||||
|
@ -4376,6 +4376,8 @@ do_test 25.0 {
|
||||
| end crash-dde9e76ed8ab2d.db
|
||||
}]} {}
|
||||
|
||||
reset_prng_state
|
||||
|
||||
do_catchsql_test 25.1 {
|
||||
PRAGMA writable_schema = 1;
|
||||
WITH RECURSIVE c(x) AS (VALUES(1) UNION ALL SELECT x%1 FROM c WHERE x<599237)
|
||||
|
@ -1038,17 +1038,18 @@ static int recoverDatabase(sqlite3 *db){
|
||||
static void bindDebugParameters(sqlite3_stmt *pStmt){
|
||||
int nVar = sqlite3_bind_parameter_count(pStmt);
|
||||
int i;
|
||||
for(i=0; i<nVar; i++){
|
||||
const char *zVar = sqlite3_bind_parameter_name(pStmt, i+1);
|
||||
for(i=1; i<=nVar; i++){
|
||||
const char *zVar = sqlite3_bind_parameter_name(pStmt, i);
|
||||
if( zVar==0 ) continue;
|
||||
if( strncmp(zVar, "$int_", 5)==0 ){
|
||||
sqlite3_bind_int(pStmt, i+1, atoi(&zVar[5]));
|
||||
sqlite3_bind_int(pStmt, i, atoi(&zVar[5]));
|
||||
}else
|
||||
if( strncmp(zVar, "$text_", 6)==0 ){
|
||||
char *zBuf = sqlite3_malloc64( strlen(zVar)-5 );
|
||||
size_t szVar = strlen(zVar);
|
||||
char *zBuf = sqlite3_malloc64( szVar-5 );
|
||||
if( zBuf ){
|
||||
memcpy(zBuf, &zVar[6], strlen(zVar)-5);
|
||||
sqlite3_bind_text64(pStmt, i+1, zBuf, -1, sqlite3_free, SQLITE_UTF8);
|
||||
memcpy(zBuf, &zVar[6], szVar-5);
|
||||
sqlite3_bind_text64(pStmt, i, zBuf, szVar-6, sqlite3_free, SQLITE_UTF8);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -47,17 +47,18 @@ static void reportInvariantFailed(
|
||||
static void bindDebugParameters(sqlite3_stmt *pStmt){
|
||||
int nVar = sqlite3_bind_parameter_count(pStmt);
|
||||
int i;
|
||||
for(i=0; i<nVar; i++){
|
||||
const char *zVar = sqlite3_bind_parameter_name(pStmt, i+1);
|
||||
for(i=1; i<=nVar; i++){
|
||||
const char *zVar = sqlite3_bind_parameter_name(pStmt, i);
|
||||
if( zVar==0 ) continue;
|
||||
if( strncmp(zVar, "$int_", 5)==0 ){
|
||||
sqlite3_bind_int(pStmt, i+1, atoi(&zVar[5]));
|
||||
sqlite3_bind_int(pStmt, i, atoi(&zVar[5]));
|
||||
}else
|
||||
if( strncmp(zVar, "$text_", 6)==0 ){
|
||||
char *zBuf = sqlite3_malloc64( strlen(zVar)-5 );
|
||||
size_t szVar = strlen(zVar);
|
||||
char *zBuf = sqlite3_malloc64( szVar-5 );
|
||||
if( zBuf ){
|
||||
memcpy(zBuf, &zVar[6], strlen(zVar)-5);
|
||||
sqlite3_bind_text64(pStmt, i+1, zBuf, -1, sqlite3_free, SQLITE_UTF8);
|
||||
memcpy(zBuf, &zVar[6], szVar-5);
|
||||
sqlite3_bind_text64(pStmt, i, zBuf, szVar-6, sqlite3_free, SQLITE_UTF8);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -428,4 +428,25 @@ do_eqp_test 12.3 {
|
||||
`--SEARCH t1 USING INTEGER PRIMARY KEY (rowid=?) LEFT-JOIN
|
||||
}
|
||||
|
||||
# 2024-09-05 https://sqlite.org/forum/forumpost/8a1e467e905b8d27
|
||||
# When performing the Omit-Noop-Join optimization, if FROM clause terms
|
||||
# to the right of the omitted join have the reverse-order bit set in the
|
||||
# WhereInfo.revMask bitmask, those bits need to be shifted to account
|
||||
# for the omitted join.
|
||||
#
|
||||
reset_db
|
||||
do_execsql_test 13.0 {
|
||||
CREATE TABLE t1(a1 INTEGER PRIMARY KEY, b1 INT);
|
||||
CREATE TABLE t2(c2 INT, d2 INTEGER PRIMARY KEY);
|
||||
CREATE TABLE t3(e3 INTEGER PRIMARY KEY);
|
||||
INSERT INTO t1 VALUES(33,0);
|
||||
INSERT INTO t2 VALUES(33,1),(33,2);
|
||||
}
|
||||
do_execsql_test 13.1 {
|
||||
SELECT t1.a1, t2.d2
|
||||
FROM (t1 LEFT JOIN t3 ON t3.e3=t1.b1) JOIN t2 ON t2.c2=t1.a1
|
||||
WHERE t1.a1=33
|
||||
ORDER BY t2.d2 DESC;
|
||||
} {33 2 33 1}
|
||||
|
||||
finish_test
|
||||
|
@ -64,4 +64,17 @@ ifcapable vtab {
|
||||
} {{\x17} 1 integer 1 1 null {$."\x17"} {$}}
|
||||
}
|
||||
|
||||
# JSON PATH parsing bug involving backslash escapes, reported via
|
||||
# private email from Florent De'Neve on 2024-09-04.
|
||||
#
|
||||
do_execsql_test 5.1 {
|
||||
SELECT json_extract('{"A\"Key":1}', '$.A"Key');
|
||||
} 1
|
||||
do_execsql_test 5.2 {
|
||||
SELECT json_extract('{"A\"Key":1}', '$."A\"Key"');
|
||||
} 1
|
||||
do_execsql_test 5.3 {
|
||||
SELECT JSON_SET('{}', '$."\"Key"', 1);
|
||||
} {{{"\"Key":1}}}
|
||||
|
||||
finish_test
|
||||
|
@ -1279,10 +1279,15 @@ proc finalize_testing {} {
|
||||
out of $nTest tests"
|
||||
} else {
|
||||
set cpuinfo {}
|
||||
if {[catch {exec hostname} hname]==0} {set cpuinfo [string trim $hname]}
|
||||
if {[catch {exec hostname} hname]==0} {
|
||||
regsub {\.local$} $hname {} hname
|
||||
set cpuinfo [string trim $hname]
|
||||
}
|
||||
append cpuinfo " $::tcl_platform(os)"
|
||||
append cpuinfo " [expr {$::tcl_platform(pointerSize)*8}]-bit"
|
||||
if {[string match big* $::tcl_platform(byteOrder)]} {
|
||||
append cpuinfo " [string map {E -e} $::tcl_platform(byteOrder)]"
|
||||
}
|
||||
output2 "SQLite [sqlite3 -sourceid]"
|
||||
output2 "$nErr errors out of $nTest tests on $cpuinfo"
|
||||
}
|
||||
|
165
test/testrunner.tcl
Normal file → Executable file
165
test/testrunner.tcl
Normal file → Executable file
@ -1,3 +1,6 @@
|
||||
#!/bin/sh
|
||||
# Script to runs tests for SQLite. Run with option "help" for more info. \
|
||||
exec tclsh "$0" "$@"
|
||||
|
||||
set dir [pwd]
|
||||
set testdir [file normalize [file dirname $argv0]]
|
||||
@ -14,8 +17,14 @@ cd $dir
|
||||
# recommend that the user build one.
|
||||
#
|
||||
proc find_interpreter {} {
|
||||
global dir
|
||||
set interpreter [file tail [info nameofexec]]
|
||||
set rc [catch { package require sqlite3 }]
|
||||
if {$rc} {
|
||||
if {[file readable pkgIndex.tcl] && [catch {source pkgIndex.tcl}]==0} {
|
||||
set rc [catch { package require sqlite3 }]
|
||||
}
|
||||
}
|
||||
if {$rc} {
|
||||
if { [string match -nocase testfixture* $interpreter]==0
|
||||
&& [file executable ./testfixture]
|
||||
@ -28,8 +37,30 @@ proc find_interpreter {} {
|
||||
}
|
||||
}
|
||||
if {$rc} {
|
||||
puts stderr "Failed to find tcl package sqlite3"
|
||||
puts stderr "Run \"make testfixture\" and then try again..."
|
||||
puts "Cannot find tcl package sqlite3: Trying to build it now..."
|
||||
if {$::tcl_platform(platform)=="windows"} {
|
||||
set bat [open make-tcl-extension.bat w]
|
||||
puts $bat "nmake /f Makefile.msc tclextension"
|
||||
close $bat
|
||||
catch {exec -ignorestderr -- make-tcl-extension.bat}
|
||||
} else {
|
||||
catch {exec make tclextension}
|
||||
}
|
||||
if {[file readable pkgIndex.tcl] && [catch {source pkgIndex.tcl}]==0} {
|
||||
set rc [catch { package require sqlite3 }]
|
||||
}
|
||||
if {$rc==0} {
|
||||
puts "The SQLite tcl extension was successfully built and loaded."
|
||||
puts "Run \"make tclextension-install\" to avoid having to rebuild\
|
||||
it in the future."
|
||||
} else {
|
||||
puts "Unable to build the SQLite tcl extension"
|
||||
}
|
||||
}
|
||||
if {$rc} {
|
||||
puts stderr "Cannot find a working instance of the SQLite tcl extension."
|
||||
puts stderr "Run \"make tclextension\" or \"make testfixture\" and\
|
||||
try again..."
|
||||
exit 1
|
||||
}
|
||||
}
|
||||
@ -54,8 +85,9 @@ proc usage {} {
|
||||
Usage:
|
||||
$a0 ?SWITCHES? ?PERMUTATION? ?PATTERNS?
|
||||
$a0 PERMUTATION FILE
|
||||
$a0 errors ?-v|--verbose?
|
||||
$a0 errors ?-v|--verbose? ?-s|--summary? ?PATTERN?
|
||||
$a0 help
|
||||
$a0 joblist ?PATTERN?
|
||||
$a0 njob ?NJOB?
|
||||
$a0 script ?-msvc? CONFIG
|
||||
$a0 status ?-d SECS? ?--cls?
|
||||
@ -112,10 +144,12 @@ The "script" command outputs the script used to build a configuration.
|
||||
Add the "-msvc" option for a Windows-compatible script. For a list of
|
||||
available configurations enter "$a0 script help".
|
||||
|
||||
The "errors" commands shows the output of all tests that failed in the
|
||||
The "errors" commands shows the output of tests that failed in the
|
||||
most recent run. Complete output is shown if the -v or --verbose options
|
||||
are used. Otherwise, an attempt is made to minimize the output to show
|
||||
only the parts that contain the error messages.
|
||||
only the parts that contain the error messages. The --summary option just
|
||||
shows the jobs that failed. If PATTERN are provided, the error information
|
||||
is only provided for jobs that match PATTERN.
|
||||
|
||||
Full documentation here: https://sqlite.org/src/doc/trunk/doc/testrunner.md
|
||||
}]]
|
||||
@ -284,6 +318,8 @@ set TRG(schema) {
|
||||
state TEXT CHECK( state IN ('','ready','running','done','failed','omit') ),
|
||||
ntest INT, -- Number of test cases run
|
||||
nerr INT, -- Number of errors reported
|
||||
svers TEXT, -- Reported SQLite version
|
||||
pltfm TEXT, -- Host platform reported
|
||||
output TEXT -- test output
|
||||
);
|
||||
|
||||
@ -577,44 +613,80 @@ if {[llength $argv]>=1
|
||||
exit
|
||||
}
|
||||
|
||||
#--------------------------------------------------------------------------
|
||||
# Check if this is the "joblist" command:
|
||||
#
|
||||
if {[llength $argv]>=1
|
||||
&& [string compare -nocase "joblist" [lindex $argv 0]]==0
|
||||
} {
|
||||
set pattern {}
|
||||
for {set ii 1} {$ii<[llength $argv]} {incr ii} {
|
||||
set a0 [lindex $argv $ii]
|
||||
if {$pattern==""} {
|
||||
set pattern [string trim $a0 *]
|
||||
} else {
|
||||
puts "unknown option: \"$a0\""
|
||||
exit 1
|
||||
}
|
||||
}
|
||||
set SQL {SELECT displaytype, displayname, state FROM jobs}
|
||||
if {$pattern!=""} {
|
||||
regsub -all {[^a-zA-Z0-9*.-/]} $pattern ? pattern
|
||||
append SQL " WHERE displayname GLOB '*$pattern*'"
|
||||
}
|
||||
append SQL " ORDER BY starttime"
|
||||
|
||||
if {![file readable $TRG(dbname)]} {
|
||||
puts "Database missing: $TRG(dbname)"
|
||||
exit
|
||||
}
|
||||
sqlite3 mydb $TRG(dbname)
|
||||
mydb timeout 2000
|
||||
|
||||
mydb eval $SQL {
|
||||
set label UNKNOWN
|
||||
switch -- $state {
|
||||
ready {set label READY}
|
||||
done {set label DONE}
|
||||
failed {set label FAILED}
|
||||
omit {set label OMIT}
|
||||
running {set label RUNNING}
|
||||
}
|
||||
puts [format {%-7s %-5s %s} $label $displaytype $displayname]
|
||||
}
|
||||
mydb close
|
||||
exit
|
||||
}
|
||||
|
||||
# Scan the output of all jobs looking for the summary lines that
|
||||
# report the number of test cases and the number of errors.
|
||||
# Aggregate these numbers and return them.
|
||||
#
|
||||
proc aggregate_test_counts {db} {
|
||||
set ncase 0
|
||||
set nerr 0
|
||||
$db eval {SELECT output FROM jobs WHERE displaytype IN ('tcl','fuzz')} {
|
||||
set n 0
|
||||
set m 0
|
||||
if {[regexp {(\d+) errors out of (\d+) tests} $output all n m]
|
||||
&& [string is integer -strict $n]
|
||||
&& [string is integer -strict $m]} {
|
||||
incr ncase $m
|
||||
incr nerr $n
|
||||
} elseif {[regexp {sessionfuzz.*: *(\d+) cases, (\d+) crash} $output \
|
||||
all m n]
|
||||
&& [string is integer -strict $m]
|
||||
&& [string is integer -strict $n]} {
|
||||
incr ncase $m
|
||||
incr nerr $n
|
||||
}
|
||||
}
|
||||
return [list $nerr $ncase]
|
||||
set ne 0
|
||||
set nt 0
|
||||
$db eval {SELECT sum(nerr) AS ne, sum(ntest) as nt FROM jobs} break
|
||||
return [list $ne $nt]
|
||||
}
|
||||
|
||||
#--------------------------------------------------------------------------
|
||||
# Check if this is the "errors" command:
|
||||
#
|
||||
if {[llength $argv]>=1 && [llength $argv]<=2
|
||||
if {[llength $argv]>=1
|
||||
&& ([string compare -nocase errors [lindex $argv 0]]==0 ||
|
||||
[string match err* [lindex $argv 0]]==1)
|
||||
} {
|
||||
set verbose 0
|
||||
set pattern {}
|
||||
set summary 0
|
||||
for {set ii 1} {$ii<[llength $argv]} {incr ii} {
|
||||
set a0 [lindex $argv $ii]
|
||||
if {$a0=="-v" || $a0=="--verbose" || $a0=="-verbose"} {
|
||||
set verbose 1
|
||||
} elseif {$a0=="-s" || $a0=="--summary" || $a0=="-summary"} {
|
||||
set summary 1
|
||||
} elseif {$pattern==""} {
|
||||
set pattern *[string trim $a0 *]*
|
||||
} else {
|
||||
puts "unknown option: \"$a0\"". Use --help for more info."
|
||||
exit 1
|
||||
@ -622,9 +694,22 @@ if {[llength $argv]>=1 && [llength $argv]<=2
|
||||
}
|
||||
set cnt 0
|
||||
sqlite3 mydb $TRG(dbname)
|
||||
mydb timeout 2000
|
||||
mydb eval {SELECT displaytype, displayname, output
|
||||
FROM jobs WHERE state='failed'} {
|
||||
mydb timeout 5000
|
||||
if {$summary} {
|
||||
set sql "SELECT displayname FROM jobs WHERE state='failed'"
|
||||
} else {
|
||||
set sql "SELECT displaytype, displayname, output FROM jobs \
|
||||
WHERE state='failed'"
|
||||
}
|
||||
if {$pattern!=""} {
|
||||
regsub -all {[^a-zA-Z0-9*/ ?]} $pattern . pattern
|
||||
append sql " AND displayname GLOB '$pattern'"
|
||||
}
|
||||
mydb eval $sql {
|
||||
if {$summary} {
|
||||
puts "FAILED: $displayname"
|
||||
continue
|
||||
}
|
||||
puts "**** $displayname ****"
|
||||
if {$verbose || $displaytype!="tcl"} {
|
||||
puts $output
|
||||
@ -637,9 +722,13 @@ if {[llength $argv]>=1 && [llength $argv]<=2
|
||||
}
|
||||
incr cnt
|
||||
}
|
||||
if {$pattern==""} {
|
||||
set summary [aggregate_test_counts mydb]
|
||||
mydb close
|
||||
puts "Total [lindex $summary 0] errors out of [lindex $summary 1] tests"
|
||||
} else {
|
||||
mydb close
|
||||
}
|
||||
exit
|
||||
}
|
||||
|
||||
@ -1105,6 +1194,7 @@ proc add_jobs_from_cmdline {patternlist} {
|
||||
}
|
||||
}
|
||||
|
||||
devtest -
|
||||
mdevtest {
|
||||
set config_set {
|
||||
All-O0
|
||||
@ -1192,10 +1282,13 @@ proc mark_job_as_finished {jobid output state endtm} {
|
||||
set ntest 1
|
||||
set nerr 0
|
||||
if {$endtm>0} {
|
||||
if {[regexp {\y(\d+) errors out of (\d+) tests} $output all a b]} {
|
||||
set re {\y(\d+) errors out of (\d+) tests( on [^\n]+\n)?}
|
||||
if {[regexp $re $output all a b pltfm]} {
|
||||
set nerr $a
|
||||
set ntest $b
|
||||
}
|
||||
regexp {\ySQLite \d\d\d\d-\d\d-\d\d \d\d:\d\d:\d\d [0-9a-fA-F]+} \
|
||||
$output svers
|
||||
}
|
||||
r_write_db {
|
||||
if {$state=="failed"} {
|
||||
@ -1204,10 +1297,11 @@ proc mark_job_as_finished {jobid output state endtm} {
|
||||
} else {
|
||||
set childstate ready
|
||||
}
|
||||
if {[info exists pltfm]} {set pltfm [string trim $pltfm]}
|
||||
trdb eval {
|
||||
UPDATE jobs
|
||||
SET output=$output, state=$state, endtime=$endtm,
|
||||
ntest=$ntest, nerr=$nerr
|
||||
ntest=$ntest, nerr=$nerr, svers=$svers, pltfm=$pltfm
|
||||
WHERE jobid=$jobid;
|
||||
UPDATE jobs SET state=$childstate WHERE depid=$jobid;
|
||||
}
|
||||
@ -1460,7 +1554,16 @@ proc run_testset {} {
|
||||
FROM jobs WHERE endtime>0
|
||||
} break;
|
||||
set et [elapsetime $totaltime]
|
||||
puts "$totalerr errors out of $totaltest tests in about $et"
|
||||
set pltfm {}
|
||||
trdb eval {
|
||||
SELECT pltfm, count(*) FROM jobs WHERE pltfm IS NOT NULL
|
||||
ORDER BY 2 DESC LIMIT 1
|
||||
} break
|
||||
puts "$totalerr errors out of $totaltest tests in $et $pltfm"
|
||||
trdb eval {
|
||||
SELECT DISTINCT substr(svers,1,79) as v1 FROM jobs WHERE svers IS NOT NULL
|
||||
} {puts $v1}
|
||||
|
||||
}
|
||||
|
||||
# Handle the --buildonly option, if it was specified.
|
||||
|
@ -88,6 +88,7 @@ namespace eval trd {
|
||||
--disable-amalgamation --disable-shared
|
||||
--enable-session
|
||||
-DSQLITE_ENABLE_RBU
|
||||
-DSQLITE_ENABLE_STMT_SCANSTATUS
|
||||
}
|
||||
|
||||
# These two are used by [testrunner.tcl mdevtest] (All-O0) and
|
||||
|
@ -127,6 +127,17 @@ foreach tn {1a 1b 1c 1d 1e 1f} {
|
||||
db3 close
|
||||
}
|
||||
|
||||
# These over-length file and directory names are difficult to delete.
|
||||
# The "file delete -force" might not work, depending on the TCL build
|
||||
# being used. So first try to delete using the windows rmdir command.
|
||||
#
|
||||
set fd [open cleanup.bat w]
|
||||
puts $fd "rmdir /q /s $longPath(1)"
|
||||
close $fd
|
||||
if {[catch {exec cleanup.bat} msg]} {
|
||||
puts "Command \[cleanup.bat\] returns $msg"
|
||||
}
|
||||
|
||||
file delete -force $fileName
|
||||
file delete -force $longPath(3)
|
||||
file delete -force $longPath(2)
|
||||
|
@ -17,5 +17,5 @@ gcc -o sqlite3 -g -Os -I. \
|
||||
-DSQLITE_ENABLE_RTREE \
|
||||
-DHAVE_READLINE \
|
||||
../sqlite/src/shell.c \
|
||||
../sqlite/src/test_vfstrace.c \
|
||||
../sqlite/ext/misc/vfstrace.c \
|
||||
sqlite3.c -ldl -lreadline -lncurses
|
||||
|
@ -26,7 +26,7 @@
|
||||
** the entire block.
|
||||
**
|
||||
** For blocks of more than 16 bytes, the signature is a hex dump of the
|
||||
** first 8 bytes followed by a 64-bit has of the entire block.
|
||||
** first 8 bytes followed by a 64-bit hash of the entire block.
|
||||
*/
|
||||
static void vlogSignature(unsigned char *p, int n, char *zCksum){
|
||||
unsigned int s0 = 0, s1 = 0;
|
||||
|
@ -1084,17 +1084,28 @@ static void ptrmap_coverage_report(const char *zDbName){
|
||||
printf("%5llu: PTRMAP page covering %llu..%llu\n", pgno,
|
||||
pgno+1, pgno+perPage);
|
||||
a = fileRead((pgno-1)*g.pagesize, usable);
|
||||
for(i=0; i+5<=usable && pgno+1+i/5<=g.mxPage; i+=5){
|
||||
const char *zType = "???";
|
||||
for(i=0; i+5<=usable; i+=5){
|
||||
const char *zType;
|
||||
u32 iFrom = decodeInt32(&a[i+1]);
|
||||
const char *zExtra = pgno+1+i/5>g.mxPage ? " (off end of DB)" : "";
|
||||
switch( a[i] ){
|
||||
case 1: zType = "b-tree root page"; break;
|
||||
case 2: zType = "freelist page"; break;
|
||||
case 3: zType = "first page of overflow"; break;
|
||||
case 4: zType = "later page of overflow"; break;
|
||||
case 5: zType = "b-tree non-root page"; break;
|
||||
default: {
|
||||
if( zExtra[0]==0 ){
|
||||
printf("%5llu: invalid (0x%02x), parent=%u\n",
|
||||
pgno+1+i/5, a[i], iFrom);
|
||||
}
|
||||
zType = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if( zType ){
|
||||
printf("%5llu: %s, parent=%u%s\n", pgno+1+i/5, zType, iFrom, zExtra);
|
||||
}
|
||||
printf("%5llu: %s, parent=%u\n", pgno+1+i/5, zType, iFrom);
|
||||
}
|
||||
sqlite3_free(a);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user