mirror of
https://github.com/sqlite/sqlite.git
synced 2025-07-30 19:03:16 +03:00
Merge the 3.50.2 changes into the reuse-schema-3.50 branch.
FossilOrigin-Name: b66f853a242c33e270ab744adbd277c4343ef1fd6b88e5f72b43deda94590d7a
This commit is contained in:
@ -539,6 +539,7 @@ static int fts5StorageDeleteFromIndex(
|
||||
for(iCol=1; rc==SQLITE_OK && iCol<=pConfig->nCol; iCol++){
|
||||
if( pConfig->abUnindexed[iCol-1]==0 ){
|
||||
sqlite3_value *pVal = 0;
|
||||
sqlite3_value *pFree = 0;
|
||||
const char *pText = 0;
|
||||
int nText = 0;
|
||||
const char *pLoc = 0;
|
||||
@ -555,11 +556,22 @@ static int fts5StorageDeleteFromIndex(
|
||||
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( sqlite3_value_type(pVal)!=SQLITE_TEXT ){
|
||||
/* Make a copy of the value to work with. This is because the call
|
||||
** to sqlite3_value_text() below forces the type of the value to
|
||||
** SQLITE_TEXT, and we may need to use it again later. */
|
||||
pFree = pVal = sqlite3_value_dup(pVal);
|
||||
if( pVal==0 ){
|
||||
rc = SQLITE_NOMEM;
|
||||
}
|
||||
}
|
||||
if( rc==SQLITE_OK ){
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -575,6 +587,7 @@ static int fts5StorageDeleteFromIndex(
|
||||
}
|
||||
sqlite3Fts5ClearLocale(pConfig);
|
||||
}
|
||||
sqlite3_value_free(pFree);
|
||||
}
|
||||
}
|
||||
if( rc==SQLITE_OK && p->nTotalRow<1 ){
|
||||
|
@ -325,5 +325,25 @@ ifcapable foreignkey {
|
||||
}
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
reset_db
|
||||
|
||||
do_execsql_test 13.0 {
|
||||
CREATE VIRTUAL TABLE t1 USING fts5(a, b);
|
||||
INSERT INTO t1 VALUES('abc def', X'123456');
|
||||
}
|
||||
faultsim_save_and_close
|
||||
|
||||
|
||||
do_faultsim_test 13 -faults oom* -prep {
|
||||
faultsim_restore_and_reopen
|
||||
} -body {
|
||||
execsql {
|
||||
UPDATE t1 SET a='def abc'
|
||||
}
|
||||
} -test {
|
||||
faultsim_test_result {0 {}}
|
||||
}
|
||||
|
||||
finish_test
|
||||
|
||||
|
@ -28,4 +28,34 @@ do_execsql_test 1.1 {
|
||||
INSERT INTO sss VALUES('まりや');
|
||||
}
|
||||
|
||||
foreach {tn enc tok} {
|
||||
1 utf-8 ascii
|
||||
2 utf-16 ascii
|
||||
3 utf-8 unicode61
|
||||
4 utf-16 unicode61
|
||||
} {
|
||||
reset_db
|
||||
|
||||
do_execsql_test 1.$tn.0 "
|
||||
PRAGMA encoding = '$enc';
|
||||
CREATE VIRTUAL TABLE vt2 USING fts5(c0, c1, tokenize=$tok);
|
||||
"
|
||||
|
||||
do_execsql_test 1.$tn.1 {
|
||||
INSERT INTO vt2(c0, c1) VALUES ('bhal', x'17db');
|
||||
}
|
||||
|
||||
do_execsql_test 1.$tn.2 {
|
||||
UPDATE vt2 SET c0='bhal';
|
||||
}
|
||||
|
||||
do_execsql_test 1.$tn.3 {
|
||||
INSERT INTO vt2(vt2) VALUES('integrity-check')
|
||||
}
|
||||
|
||||
do_execsql_test 1.$tn.4 {
|
||||
SELECT quote(c1) FROM vt2
|
||||
} {X'17DB'}
|
||||
}
|
||||
|
||||
finish_test
|
||||
|
@ -92,13 +92,14 @@ SQLITE_EXTENSION_INIT1
|
||||
# include <dirent.h>
|
||||
# include <utime.h>
|
||||
# include <sys/time.h>
|
||||
# define STRUCT_STAT struct stat
|
||||
#else
|
||||
# include "windows.h"
|
||||
# include <io.h>
|
||||
# include <direct.h>
|
||||
# include "test_windirent.h"
|
||||
# define dirent DIRENT
|
||||
# define stat _stat
|
||||
# define STRUCT_STAT struct _stat
|
||||
# define chmod(path,mode) fileio_chmod(path,mode)
|
||||
# define mkdir(path,mode) fileio_mkdir(path)
|
||||
#endif
|
||||
@ -289,7 +290,7 @@ LPWSTR utf8_to_utf16(const char *z){
|
||||
*/
|
||||
static void statTimesToUtc(
|
||||
const char *zPath,
|
||||
struct stat *pStatBuf
|
||||
STRUCT_STAT *pStatBuf
|
||||
){
|
||||
HANDLE hFindFile;
|
||||
WIN32_FIND_DATAW fd;
|
||||
@ -317,7 +318,7 @@ static void statTimesToUtc(
|
||||
*/
|
||||
static int fileStat(
|
||||
const char *zPath,
|
||||
struct stat *pStatBuf
|
||||
STRUCT_STAT *pStatBuf
|
||||
){
|
||||
#if defined(_WIN32)
|
||||
sqlite3_int64 sz = strlen(zPath);
|
||||
@ -341,7 +342,7 @@ static int fileStat(
|
||||
*/
|
||||
static int fileLinkStat(
|
||||
const char *zPath,
|
||||
struct stat *pStatBuf
|
||||
STRUCT_STAT *pStatBuf
|
||||
){
|
||||
#if defined(_WIN32)
|
||||
return fileStat(zPath, pStatBuf);
|
||||
@ -374,7 +375,7 @@ static int makeDirectory(
|
||||
int i = 1;
|
||||
|
||||
while( rc==SQLITE_OK ){
|
||||
struct stat sStat;
|
||||
STRUCT_STAT sStat;
|
||||
int rc2;
|
||||
|
||||
for(; zCopy[i]!='/' && i<nCopy; i++);
|
||||
@ -424,7 +425,7 @@ static int writeFile(
|
||||
** be an error though - if there is already a directory at the same
|
||||
** path and either the permissions already match or can be changed
|
||||
** to do so using chmod(), it is not an error. */
|
||||
struct stat sStat;
|
||||
STRUCT_STAT sStat;
|
||||
if( errno!=EEXIST
|
||||
|| 0!=fileStat(zFile, &sStat)
|
||||
|| !S_ISDIR(sStat.st_mode)
|
||||
@ -626,7 +627,7 @@ struct fsdir_cursor {
|
||||
const char *zBase;
|
||||
int nBase;
|
||||
|
||||
struct stat sStat; /* Current lstat() results */
|
||||
STRUCT_STAT sStat; /* Current lstat() results */
|
||||
char *zPath; /* Path to current entry */
|
||||
sqlite3_int64 iRowid; /* Current rowid */
|
||||
};
|
||||
|
@ -1193,9 +1193,11 @@ push-testing:
|
||||
########################################################################
|
||||
# If we find a copy of the sqlite.org/wasm docs checked out, copy
|
||||
# certain files over to it, noting that some need automatable edits...
|
||||
wasm.docs.home ?= ../../../wasm
|
||||
wasm.docs.found = $(if $(wildcard $(wasm.docs.home)/api-index.md),\
|
||||
$(wildcard $(wasm.docs.home)),)
|
||||
wasm.docs.home ?= $(firstword $(wildcard ../../../wasm $(HOME)/f/s/wasm))
|
||||
wasm.docs.found = $(if \
|
||||
$(wildcard $(wasm.docs.home)/api-index.md),$(wildcard $(wasm.docs.home)),)
|
||||
# ^^^ don't split between the args there, else it can introduce an extra
|
||||
# space.
|
||||
.PHONY: update-docs
|
||||
ifeq (,$(wasm.docs.found))
|
||||
update-docs:
|
||||
|
49
manifest
49
manifest
@ -1,5 +1,5 @@
|
||||
C Update\sthe\sreuse-schema\sbranch\sto\sthe\s3.50.1\spatch\srelease.
|
||||
D 2025-06-06T15:43:39.917
|
||||
C Merge\sthe\s3.50.2\schanges\sinto\sthe\sreuse-schema-3.50\sbranch.
|
||||
D 2025-06-28T14:35:51.827
|
||||
F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x
|
||||
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
|
||||
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
|
||||
@ -8,7 +8,7 @@ F Makefile.in c3e414df4dc8dfb12f1f6baf129fcb6d18cd0ebd3c9109370fb3fceeeef9a37a
|
||||
F Makefile.linux-generic bd3e3cacd369821a6241d4ea1967395c962dfe3057e38cb0a435cee0e8b789d0
|
||||
F Makefile.msc 2250e3e432caecbf419b37abffa6b51d1eaef2025402c4af444eea6e5b21377a
|
||||
F README.md e28077cfbef795e99c9c75ed95aa7257a1166709b562076441a8506ac421b7c1
|
||||
F VERSION 1283c71d85c60203d57aafc1457c71668ba6090ceaa709a16b90279f54146579
|
||||
F VERSION 56fffb7f40e1117f5ab0cfe06e918a82d522c686d1dfff7f570f4ca414eb256a
|
||||
F art/icon-243x273.gif 9750b734f82fdb3dc43127753d5e6fbf3b62c9f4e136c2fbf573b2f57ea87af5
|
||||
F art/icon-80x90.gif 65509ce3e5f86a9cd64fe7fca2d23954199f31fe44c1e09e208c80fb83d87031
|
||||
F art/sqlite370.eps aa97a671332b432a54e1d74ff5e8775be34200c2
|
||||
@ -117,7 +117,7 @@ F ext/fts5/fts5_expr.c be9e5f7f11d87e7bd3680832c93c13050fe351994b5052b0215c2ef40
|
||||
F ext/fts5/fts5_hash.c a6266cedd801ab7964fa9e74ebcdda6d30ec6a96107fa24148ec6b7b5b80f6e0
|
||||
F ext/fts5/fts5_index.c d171f2a507abccb3d524bf461b01f0d3971a9bf221be622ac7c671a991cb62ee
|
||||
F ext/fts5/fts5_main.c 57933c18efe1058d8871199875c7a59744dabc3904f3aefbf9ff4a4e11fc79e2
|
||||
F ext/fts5/fts5_storage.c 1ad05dab4830a4e2eaf2900bb143477f93bc17437093582f36f4b818809e88d8
|
||||
F ext/fts5/fts5_storage.c 19bc7c4cbe1e6a2dd9849ef7d84b5ca1fcbf194cefc3e386b901e00e08bf05c2
|
||||
F ext/fts5/fts5_tcl.c 7fb5a3d3404099075aaa2457307cb459bbc257c0de3dbd52b1e80a5b503e0329
|
||||
F ext/fts5/fts5_test_mi.c 4308d5658cb1f5eee5998dcbaac7d5bdf7a2ef43c8192ca6e0c843f856ccee26
|
||||
F ext/fts5/fts5_test_tok.c 3cb0a9b508b30d17ef025ccddd26ae3dc8ddffbe76c057616e59a9aa85d36f3b
|
||||
@ -194,7 +194,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 9b33d664bccee4bbde0f275a48b2df3ea2f05d41f6d1d171aa2e844382cba621
|
||||
F ext/fts5/test/fts5faultI.test 4e3d5a9d3e3b3f17d5e5087ee069414632667719dcfccafd715bc87c72838c72
|
||||
F ext/fts5/test/fts5first.test bfd685b96905bf541d99d8644e0a7219d1d833455a08ab64e344071a613b6ba9
|
||||
F ext/fts5/test/fts5full.test 97d263c1072f4a560929cca31e70f65d2ae232610e17e6affcf7e979df59547b
|
||||
F ext/fts5/test/fts5fuzz1.test 238d8c45f3b81342aa384de3e581ff2fa330bf922a7b69e484bbc06051a1080e
|
||||
@ -262,7 +262,7 @@ F ext/fts5/test/fts5umlaut.test a42fe2fe6387c40c49ab27ccbd070e1ae38e07f38d059264
|
||||
F ext/fts5/test/fts5unicode.test 41898f7e476e6515cd4b737c02a442cda5a580a74509788aa9072a2074948e0e
|
||||
F ext/fts5/test/fts5unicode2.test 3bbd30152f9f760bf13886e5b1e5ec23ff62f56758ddda5d9c775a6082fb4c7c
|
||||
F ext/fts5/test/fts5unicode3.test f4891a3dac3b49c3d7c0fdb29566e9eb0ecff35263370c89f9661b1952b20818
|
||||
F ext/fts5/test/fts5unicode4.test 728c8f0caafb05567f524ad313d9f8b780fa45987b8a8df04eff87923c74b4d0
|
||||
F ext/fts5/test/fts5unicode4.test 6d70dbe56e5179bb1990cfb22e62fdf2aae9458e443ade856e598ce95832fe9b
|
||||
F ext/fts5/test/fts5unindexed.test 168838d2c385e131120bbf5b516d2432a5fabc4caa2259c932e1d49ae209a4ae
|
||||
F ext/fts5/test/fts5unindexed2.test 516236eceaac05ace322290a0d3705b4c4ffe4760d8eb9d014d9d27d56dfcc02
|
||||
F ext/fts5/test/fts5update.test b8affd796e45c94a4d19ad5c26606ea06065a0f162a9562d9f005b5a80ccf0bc
|
||||
@ -419,7 +419,7 @@ F ext/misc/dbdump.c b8592f6f2da292c62991a13864a60d6c573c47a9cc58362131b9e6a64f82
|
||||
F ext/misc/decimal.c 228d47e9ef4de60daf5851da19e3ac9ac1eda9e94432816914469501db6a1129
|
||||
F ext/misc/eval.c 04bc9aada78c888394204b4ed996ab834b99726fb59603b0ee3ed6e049755dc1
|
||||
F ext/misc/explain.c 606100185fb90d6a1eade1ed0414d53503c86820d8956a06e3b0a56291894f2b
|
||||
F ext/misc/fileio.c 34993b810514c58ff99d7b4254d4a388d844a4774ea77bec68a1dafe8de5ce41
|
||||
F ext/misc/fileio.c 69b70008290598030592aec969bcd2cba04466a7b85ad3e906f87981690aab3b
|
||||
F ext/misc/fossildelta.c 0aeb099e9627eea693cf21ae47826ecd1e0319b93143bed23090838b2ef0c162
|
||||
F ext/misc/fuzzer.c 6b231352815304ba60d8e9ec2ee73d4918e74d9b76bda8940ba2b64e8777515e
|
||||
F ext/misc/ieee754.c c9dd9d77c8e8e18e0a5706f8ffcccf4ccb6562073709f7453d4d73f5122f4362
|
||||
@ -622,7 +622,7 @@ F ext/session/sqlite3session.c 6b0877fe1ab832aa4b85eaca72606dfd1630a1363a1be7af1
|
||||
F ext/session/sqlite3session.h 9bb1a6687b467764b35178dc29bbd2c57ab8cd3acdc8a62f088c34ad17e4fe2b
|
||||
F ext/session/test_session.c 2ddff73ea368d827028c32851b291416e1008845832feb27b751d15e57e13cc3
|
||||
F ext/wasm/EXPORTED_FUNCTIONS.fiddle 7fb73f7150ab79d83bb45a67d257553c905c78cd3d693101699243f36c5ae6c3
|
||||
F ext/wasm/GNUmakefile d6b869cf3d3eaaec8cf56adf925910c3e443f455562bcb4a4cd2d1e43c933d8d
|
||||
F ext/wasm/GNUmakefile a9acd702e7423cd47b96b78d0ef546bb7612fa7731e1b400261def96bd90385e
|
||||
F ext/wasm/README-dist.txt f01081a850ce38a56706af6b481e3a7878e24e42b314cfcd4b129f0f8427066a
|
||||
F ext/wasm/README.md b89605f65661cf35bf034ff6d43e448cc169b8017fc105d498e33b81218b482c
|
||||
F ext/wasm/SQLTester/GNUmakefile e0794f676d55819951bbfae45cc5e8d7818dc460492dc317ce7f0d2eca15caff
|
||||
@ -725,7 +725,7 @@ F src/analyze.c cad85c559c13633e249023f081202f2dd22355cf00d8f384bc22528810e8f593
|
||||
F src/attach.c 82a709d96b7043d9c9c52589e77ee5420415809d765405b0cc2f35894dd3fb13
|
||||
F src/auth.c 54ab9c6c5803b47c0d45b76ce27eff22a03b4b1f767c5945a3a4eb13aa4c78dc
|
||||
F src/backup.c 5c97e8023aab1ce14a42387eb3ae00ba5a0644569e3476f38661fa6f824c3523
|
||||
F src/bitvec.c 782cc29b42b47e7ec6348eb0aaf9ffe60063f498387e7249f458d445af4b53e9
|
||||
F src/bitvec.c 203368f515a36e5537f1efc2a7f47903e9e44a6626e4fd0554f8feed981bba88
|
||||
F src/btmutex.c 30dada73a819a1ef5b7583786370dce1842e12e1ad941e4d05ac29695528daea
|
||||
F src/btree.c da98489a981c347cc3a3982ea2810bbb583511a73cc34762547f30dbb4cda7f0
|
||||
F src/btree.h 18e5e7b2124c23426a283523e5f31a4bff029131b795bb82391f9d2f3136fc50
|
||||
@ -737,10 +737,10 @@ F src/date.c 9db4d604e699a73e10b8e85a44db074a1f04c0591a77e2abfd77703f50dce1e9
|
||||
F src/dbpage.c fcb1aafe00872a8aff9a7aa0ef7ff1b01e5817ec7bbd521f8f3e1e674ac8d609
|
||||
F src/dbstat.c 73362c0df0f40ad5523a6f5501224959d0976757b511299bf892313e79d14f5c
|
||||
F src/delete.c 03a77ba20e54f0f42ebd8eddf15411ed6bdb06a2c472ac4b6b336521bf7cea42
|
||||
F src/expr.c f16fa5cbd849991462edf1d31bb7def5b970bb9611afcb4ea21c77e88e52a220
|
||||
F src/expr.c 41f193b96b3757db1a82e7590823ca833f6215b38d7b17c98d181208cf9cdd6b
|
||||
F src/fault.c 460f3e55994363812d9d60844b2a6de88826e007
|
||||
F src/fkey.c 928ed2517e8732113d2b9821aa37af639688d752f4ea9ac6e0e393d713eeb76f
|
||||
F src/func.c 7686ea382b20e8bfe2ab9de76150c99ee7b6e83523561f3c7787e0f68cb435c2
|
||||
F src/func.c de47a8295503aa130baae5e6d9868ecf4f7c4dbffa65d83ad1f70bdbac0ee2d6
|
||||
F src/global.c a19e4b1ca1335f560e9560e590fc13081e21f670643367f99cb9e8f9dc7d615b
|
||||
F src/hash.c 73934a7f7ab1cb110614a9388cb516893b0cf5b7b69e4fd1a0780ac4ce166be7
|
||||
F src/hash.h 46b92795a95bfefb210f52f0c316e9d7cdbcdd7e7fcfb0d8be796d3a5767cddf
|
||||
@ -750,7 +750,7 @@ F src/insert.c d05934dfab2c5c0c480fc6fd2038f11215661de08ea6ff38d2563216bd555c1b
|
||||
F src/json.c cb87977b1ee25ee7d27505d65a9261b687395bf895342c8ba566b7c01aee2047
|
||||
F src/legacy.c d7874bc885906868cd51e6c2156698f2754f02d9eee1bae2d687323c3ca8e5aa
|
||||
F src/loadext.c d7edd8e671237539d795d30daaf888908a2c82e99bade4c78f3be021e8b7d655
|
||||
F src/main.c a3f2f92765ace08ec85aaac7982606d38043aa50e03a6178069c02a42429ec4b
|
||||
F src/main.c 844cae2cb0d9ba4f8f3b186b69dd8a1ec5a1585ee360d4af13be46ab7f2267fc
|
||||
F src/malloc.c 410e570b30c26cc36e3372577df50f7a96ee3eed5b2b161c6b6b48773c650c5e
|
||||
F src/mem0.c 6a55ebe57c46ca1a7d98da93aaa07f99f1059645
|
||||
F src/mem1.c 3bb59158c38e05f6270e761a9f435bf19827a264c13d1631c58b84bdc96d73b2
|
||||
@ -788,10 +788,10 @@ F src/resolve.c d40fe18d7c2fd0339f5846ffcf7d6809866e380acdf14c76fb2af87e9fe13f64
|
||||
F src/rowset.c 8432130e6c344b3401a8874c3cb49fefe6873fec593294de077afea2dce5ec97
|
||||
F src/select.c 7a21df5db6bb1a4c1bb6d9fb76c8e2485a22ff8306519ad69d8ddf0d5fa10903
|
||||
F src/shell.c.in 189a3d8e4e16337c461155cc072fc98b9b80ba0458ff00eb146db182cf4f1b3c
|
||||
F src/sqlite.h.in 9a2e0d5be1448eddbe93cc0e06b3ff0354cb5ec12f17e50ea0b4955af61ecd4f
|
||||
F src/sqlite.h.in acb26cf8b48d4414318e86f23443841235c5b42054cf5c01dc375512398b674a
|
||||
F src/sqlite3.rc 015537e6ac1eec6c7050e17b616c2ffe6f70fca241835a84a4f0d5937383c479
|
||||
F src/sqlite3ext.h 0bfd049bb2088cc44c2ad54f2079d1c6e43091a4e1ce8868779b75f6c1484f1e
|
||||
F src/sqliteInt.h 740112eb59c80a71b63e00ff9666f5b2fd6a303b92e25dcc94fd16dada5d296b
|
||||
F src/sqliteInt.h 0ed6adf6095cc180c57e5ec6ba0c4abcf09e2ee2627f19b9c28b367c2c91cfb3
|
||||
F src/sqliteLimit.h 6d817c28a8f19af95e6f4921933b7fbbca48a962bce0eb0ec81e8bb3ef38e68b
|
||||
F src/status.c 9adeef15f9b2bd4a72ccd22b1f29e34dea6ca898baf420016332ba7e63f55539
|
||||
F src/table.c 0f141b58a16de7e2fbe81c308379e7279f4c6b50eb08efeec5892794a0ba30d1
|
||||
@ -868,13 +868,13 @@ F src/vdbetrace.c fe0bc29ebd4e02c8bc5c1945f1d2e6be5927ec12c06d89b03ef2a4def34bf8
|
||||
F src/vdbevtab.c fc46b9cbd759dc013f0b3724549cc0d71379183c667df3a5988f7e2f1bd485f3
|
||||
F src/vtab.c 0c2567d6caa2f1df28362eedcd29a2fbc9f4d7a7ff6b13086cc23f4e6ab239c5
|
||||
F src/vxworks.h d2988f4e5a61a4dfe82c6524dd3d6e4f2ce3cdb9
|
||||
F src/wal.c b0f848cfba8dd057f77073493cdd542f9125b4cf87941f53e9d0db21604155c8
|
||||
F src/wal.c 20be6f0a25a80b7897cf2a5369bfd37ef198e6f0b6cdef16d83eee856056b159
|
||||
F src/wal.h ba252daaa94f889f4b2c17c027e823d9be47ce39da1d3799886bbd51f0490452
|
||||
F src/walker.c d5006d6b005e4ea7302ad390957a8d41ed83faa177e412f89bc5600a7462a014
|
||||
F src/where.c 0f77decad05b6993a85f8ee7685cd73f866ef4e8c867ca494517428b3bfc7d81
|
||||
F src/whereInt.h ecdbfb5551cf394f04ec7f0bc7ad963146d80eee3071405ac29aa84950128b8e
|
||||
F src/wherecode.c 65670d1ef85ef54a4db3826d63be8b646c9ac280962166b645950901ed1bda29
|
||||
F src/whereexpr.c 2415c8eee5ff89a8b709d7d83d71c1ff986cd720d0520057e1d8a5371339012a
|
||||
F src/whereexpr.c 1c60db88b6e8472f4864b98014d1b2d9d16bdd42d5d181ec515acbcdeddc18db
|
||||
F src/window.c d01227141f622f24fbe36ca105fbe6ef023f9fd98f1ccd65da95f88886565db5
|
||||
F test/8_3_names.test ebbb5cd36741350040fd28b432ceadf495be25b2
|
||||
F test/affinity2.test 4d7a34d328e58ca2a2d78fd76c27614a41ca7ddf4312ded9c68c04f430b3b47d
|
||||
@ -1276,7 +1276,7 @@ F test/func5.test 863e6d1bd0013d09c17236f8a13ea34008dd857d87d85a13a673960e4c25d8
|
||||
F test/func6.test 3bc89ec0f2605736d3a118f43d25ef58115a7db4dba8ae939a363917d815c0bb
|
||||
F test/func7.test 7e009275f52c52954c8c028fdb62f8bc16cc47276fcc8753c1d2b22c6e074598
|
||||
F test/func8.test c4e2ecacf9f16e47a245e7a25fbabcc7e78f9c7c41a80f158527cdfdc6dd299d
|
||||
F test/func9.test 62750dbbbcc9a2d241918b5f999f59e2126084d5f81904f9e1d8ee466666a19d
|
||||
F test/func9.test d56aa5b0f7d0e4fec01cb19b797671221dece2b00714bb71679588666be7530d
|
||||
F test/fuzz-oss1.test 514dcabb24687818ea949fa6760229eaacad74ca70157743ef36d35bbe01ffb0
|
||||
F test/fuzz.test 819ea7e483bcee91209aacbe6f9eaf3287baa1841479ee5f639f57c5e7c42b86
|
||||
F test/fuzz2.test 76dc35b32b6d6f965259508508abce75a6c4d7e1
|
||||
@ -1363,7 +1363,7 @@ F test/ioerr4.test f130fe9e71008577b342b8874d52984bd04ede2c
|
||||
F test/ioerr5.test 5984da7bf74b6540aa356f2ab0c6ae68a6d12039a3d798a9ac6a100abc17d520
|
||||
F test/ioerr6.test a395a6ab144b26a9e3e21059a1ab6a7149cca65b
|
||||
F test/istrue.test e7f285bb70282625c258e866ce6337d4c762922f5a300e1b50f958aef6e7d9c9
|
||||
F test/join.test 255c1f42b7fe027b518cadb2bf40f41a793a95e7f8db2bceb54faaf59ff19c6c
|
||||
F test/join.test 2fcfd84640cfd9ff48f31b4b0d370c4d5498c355ae4384544668ca54d37ae186
|
||||
F test/join2.test f59d63264fb24784ae9c3bc9d867eb569cd6d442da5660f8852effe5c1938c27
|
||||
F test/join3.test 6f0c774ff1ba0489e6c88a3e77b9d3528fb4fda0
|
||||
F test/join4.test 1a352e4e267114444c29266ce79e941af5885916
|
||||
@ -2027,7 +2027,7 @@ F test/wal_common.tcl 204d1721ac13c5e0c7fae6380315b5ab7f4e8423f580d826c5e9df1995
|
||||
F test/walbak.test 018d4e5a3d45c6298d11b99f09a8ef6876527946
|
||||
F test/walbig.test f437473a16cfb314867c6b5d1dbcd519e73e3434
|
||||
F test/walblock.test 6bb472e82730e7e4e81395e907a01d8cfc2bd9e1f01f8a9184ca572e2955a4bf
|
||||
F test/walcksum.test ba02b4fe6d22cb42e57a323003cbae62f77a740983e1355b2b520e019ae261c7
|
||||
F test/walcksum.test 50e204500eed9c691b6045e467bb2923f49aa93d8adf315e2be135fdb202c1c2
|
||||
F test/walcrash.test 21038858cc552077b0522f50b0fa87e38139306a
|
||||
F test/walcrash2.test a0edab4e5390f03b99a790de89aad15d6ec70b36
|
||||
F test/walcrash3.test e426aa58122d20f2b9fbe9a507f9eb8cab85b8af
|
||||
@ -2046,7 +2046,7 @@ F test/walro2.test 33955a6fd874dd9724005e17f77fef89d334b3171454a1256fe4941a96766
|
||||
F test/walrofault.test c70cb6e308c443867701856cce92ad8288cd99488fa52afab77cca6cfd51af68
|
||||
F test/walseh1.test bae700eb99519b6d5cd3f893c04759accc5a59c391d4189fe4dd6995a533442b
|
||||
F test/walsetlk.test 9079cd8ef82570b8cf0067f31e049a72bec353fb2d5f0cc88f1736dc42ba9704
|
||||
F test/walsetlk2.test 9097083633cdf55bf1098b694fb8651d0356d38fef28b869481d18029d7ceaf4
|
||||
F test/walsetlk2.test 4a67823b1e759ac5a4fe78a83c1f857c3c5761bf8d755421c8b55907957f23dd
|
||||
F test/walsetlk3.test 1b82bd92dea7e58f498b4399b0b3d26773dd8ac5c74205ce4a23c207cb8e85fe
|
||||
F test/walsetlk_recover.test adccbffc59e365063a4efd2da6b661ae2fcf15d775b6719fe46acd87face08ff
|
||||
F test/walsetlk_snapshot.test 86d5588380f9927d8fcbbd75133b0a34fddf959378d6823c6f164a390123f70a
|
||||
@ -2221,11 +2221,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350
|
||||
F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7
|
||||
F tool/warnings.sh 1ad0169b022b280bcaaf94a7fa231591be96b514230ab5c98fbf15cd7df842dd
|
||||
F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
|
||||
P 4b1a38ff6bba84d54667a4a12cad1dcecc05f1c466ab55231725ecf01a99bdf8 b77dc5e0f596d2140d9ac682b2893ff65d3a4140aa86067a3efebe29dc914c95
|
||||
R bb83e0a0f935401aeb14007a2220dede
|
||||
T *branch * reuse-schema-3.50
|
||||
T *sym-reuse-schema-3.50 *
|
||||
T -sym-reuse-schema *
|
||||
P b5463d75604c6be244f47061e64cdb14b27417521bcba1fd3fe230f2948cbd91 2af157d77fb1304a74176eaee7fbc7c7e932d946bf25325e9c26c91db19e3079
|
||||
R d245f5bae530f84465215a6c47666925
|
||||
U drh
|
||||
Z 73d2af9e5210d6cfc2d7a10d8fd5c18d
|
||||
Z e127564960c794000cccd7b98771c6fc
|
||||
# Remove this line to create a well-formed Fossil manifest.
|
||||
|
@ -1 +1 @@
|
||||
b5463d75604c6be244f47061e64cdb14b27417521bcba1fd3fe230f2948cbd91
|
||||
b66f853a242c33e270ab744adbd277c4343ef1fd6b88e5f72b43deda94590d7a
|
||||
|
@ -216,7 +216,9 @@ bitvec_set_rehash:
|
||||
}else{
|
||||
memcpy(aiValues, p->u.aHash, sizeof(p->u.aHash));
|
||||
memset(p->u.apSub, 0, sizeof(p->u.apSub));
|
||||
p->iDivisor = (p->iSize + BITVEC_NPTR - 1)/BITVEC_NPTR;
|
||||
p->iDivisor = p->iSize/BITVEC_NPTR;
|
||||
if( (p->iSize%BITVEC_NPTR)!=0 ) p->iDivisor++;
|
||||
if( p->iDivisor<BITVEC_NBIT ) p->iDivisor = BITVEC_NBIT;
|
||||
rc = sqlite3BitvecSet(p, i);
|
||||
for(j=0; j<BITVEC_NINT; j++){
|
||||
if( aiValues[j] ) rc |= sqlite3BitvecSet(p, aiValues[j]);
|
||||
|
16
src/expr.c
16
src/expr.c
@ -7010,7 +7010,9 @@ static void findOrCreateAggInfoColumn(
|
||||
){
|
||||
struct AggInfo_col *pCol;
|
||||
int k;
|
||||
int mxTerm = pParse->db->aLimit[SQLITE_LIMIT_COLUMN];
|
||||
|
||||
assert( mxTerm <= SMXV(i16) );
|
||||
assert( pAggInfo->iFirstReg==0 );
|
||||
pCol = pAggInfo->aCol;
|
||||
for(k=0; k<pAggInfo->nColumn; k++, pCol++){
|
||||
@ -7028,6 +7030,10 @@ static void findOrCreateAggInfoColumn(
|
||||
assert( pParse->db->mallocFailed );
|
||||
return;
|
||||
}
|
||||
if( k>mxTerm ){
|
||||
sqlite3ErrorMsg(pParse, "more than %d aggregate terms", mxTerm);
|
||||
k = mxTerm;
|
||||
}
|
||||
pCol = &pAggInfo->aCol[k];
|
||||
assert( ExprUseYTab(pExpr) );
|
||||
pCol->pTab = pExpr->y.pTab;
|
||||
@ -7061,6 +7067,7 @@ fix_up_expr:
|
||||
if( pExpr->op==TK_COLUMN ){
|
||||
pExpr->op = TK_AGG_COLUMN;
|
||||
}
|
||||
assert( k <= SMXV(pExpr->iAgg) );
|
||||
pExpr->iAgg = (i16)k;
|
||||
}
|
||||
|
||||
@ -7145,13 +7152,19 @@ static int analyzeAggregate(Walker *pWalker, Expr *pExpr){
|
||||
** function that is already in the pAggInfo structure
|
||||
*/
|
||||
struct AggInfo_func *pItem = pAggInfo->aFunc;
|
||||
int mxTerm = pParse->db->aLimit[SQLITE_LIMIT_COLUMN];
|
||||
assert( mxTerm <= SMXV(i16) );
|
||||
for(i=0; i<pAggInfo->nFunc; i++, pItem++){
|
||||
if( NEVER(pItem->pFExpr==pExpr) ) break;
|
||||
if( sqlite3ExprCompare(0, pItem->pFExpr, pExpr, -1)==0 ){
|
||||
break;
|
||||
}
|
||||
}
|
||||
if( i>=pAggInfo->nFunc ){
|
||||
if( i>mxTerm ){
|
||||
sqlite3ErrorMsg(pParse, "more than %d aggregate terms", mxTerm);
|
||||
i = mxTerm;
|
||||
assert( i<pAggInfo->nFunc );
|
||||
}else if( i>=pAggInfo->nFunc ){
|
||||
/* pExpr is original. Make a new entry in pAggInfo->aFunc[]
|
||||
*/
|
||||
u8 enc = ENC(pParse->db);
|
||||
@ -7205,6 +7218,7 @@ static int analyzeAggregate(Walker *pWalker, Expr *pExpr){
|
||||
*/
|
||||
assert( !ExprHasProperty(pExpr, EP_TokenOnly|EP_Reduced) );
|
||||
ExprSetVVAProperty(pExpr, EP_NoReduce);
|
||||
assert( i <= SMXV(pExpr->iAgg) );
|
||||
pExpr->iAgg = (i16)i;
|
||||
pExpr->pAggInfo = pAggInfo;
|
||||
return WRC_Prune;
|
||||
|
@ -1667,7 +1667,7 @@ static void concatFuncCore(
|
||||
int nSep,
|
||||
const char *zSep
|
||||
){
|
||||
i64 j, k, n = 0;
|
||||
i64 j, n = 0;
|
||||
int i;
|
||||
char *z;
|
||||
for(i=0; i<argc; i++){
|
||||
@ -1681,8 +1681,8 @@ static void concatFuncCore(
|
||||
}
|
||||
j = 0;
|
||||
for(i=0; i<argc; i++){
|
||||
k = sqlite3_value_bytes(argv[i]);
|
||||
if( k>0 ){
|
||||
if( sqlite3_value_type(argv[i])!=SQLITE_NULL ){
|
||||
int k = sqlite3_value_bytes(argv[i]);
|
||||
const char *v = (const char*)sqlite3_value_text(argv[i]);
|
||||
if( v!=0 ){
|
||||
if( j>0 && nSep>0 ){
|
||||
|
@ -1873,6 +1873,7 @@ int sqlite3_setlk_timeout(sqlite3 *db, int ms, int flags){
|
||||
#endif
|
||||
if( ms<-1 ) return SQLITE_RANGE;
|
||||
#ifdef SQLITE_ENABLE_SETLK_TIMEOUT
|
||||
sqlite3_mutex_enter(db->mutex);
|
||||
db->setlkTimeout = ms;
|
||||
db->setlkFlags = flags;
|
||||
sqlite3BtreeEnterAll(db);
|
||||
@ -1884,6 +1885,7 @@ int sqlite3_setlk_timeout(sqlite3 *db, int ms, int flags){
|
||||
}
|
||||
}
|
||||
sqlite3BtreeLeaveAll(db);
|
||||
sqlite3_mutex_leave(db->mutex);
|
||||
#endif
|
||||
#if !defined(SQLITE_ENABLE_API_ARMOR) && !defined(SQLITE_ENABLE_SETLK_TIMEOUT)
|
||||
UNUSED_PARAMETER(db);
|
||||
|
@ -4080,7 +4080,7 @@ sqlite3_file *sqlite3_database_file_object(const char*);
|
||||
**
|
||||
** The sqlite3_create_filename(D,J,W,N,P) allocates memory to hold a version of
|
||||
** database filename D with corresponding journal file J and WAL file W and
|
||||
** with N URI parameters key/values pairs in the array P. The result from
|
||||
** an array P of N URI Key/Value pairs. The result from
|
||||
** sqlite3_create_filename(D,J,W,N,P) is a pointer to a database filename that
|
||||
** is safe to pass to routines like:
|
||||
** <ul>
|
||||
@ -4761,7 +4761,7 @@ typedef struct sqlite3_context sqlite3_context;
|
||||
** METHOD: sqlite3_stmt
|
||||
**
|
||||
** ^(In the SQL statement text input to [sqlite3_prepare_v2()] and its variants,
|
||||
** literals may be replaced by a [parameter] that matches one of following
|
||||
** literals may be replaced by a [parameter] that matches one of the following
|
||||
** templates:
|
||||
**
|
||||
** <ul>
|
||||
@ -4806,7 +4806,7 @@ typedef struct sqlite3_context sqlite3_context;
|
||||
**
|
||||
** [[byte-order determination rules]] ^The byte-order of
|
||||
** UTF16 input text is determined by the byte-order mark (BOM, U+FEFF)
|
||||
** found in first character, which is removed, or in the absence of a BOM
|
||||
** found in the first character, which is removed, or in the absence of a BOM
|
||||
** the byte order is the native byte order of the host
|
||||
** machine for sqlite3_bind_text16() or the byte order specified in
|
||||
** the 6th parameter for sqlite3_bind_text64().)^
|
||||
@ -4826,7 +4826,7 @@ typedef struct sqlite3_context sqlite3_context;
|
||||
** or sqlite3_bind_text16() or sqlite3_bind_text64() then
|
||||
** that parameter must be the byte offset
|
||||
** where the NUL terminator would occur assuming the string were NUL
|
||||
** terminated. If any NUL characters occurs at byte offsets less than
|
||||
** terminated. If any NUL characters occur at byte offsets less than
|
||||
** the value of the fourth parameter then the resulting string value will
|
||||
** contain embedded NULs. The result of expressions involving strings
|
||||
** with embedded NULs is undefined.
|
||||
@ -5038,7 +5038,7 @@ const void *sqlite3_column_name16(sqlite3_stmt*, int N);
|
||||
** METHOD: sqlite3_stmt
|
||||
**
|
||||
** ^These routines provide a means to determine the database, table, and
|
||||
** table column that is the origin of a particular result column in
|
||||
** table column that is the origin of a particular result column in a
|
||||
** [SELECT] statement.
|
||||
** ^The name of the database or table or column can be returned as
|
||||
** either a UTF-8 or UTF-16 string. ^The _database_ routines return
|
||||
@ -5607,8 +5607,8 @@ int sqlite3_reset(sqlite3_stmt *pStmt);
|
||||
**
|
||||
** For best security, the [SQLITE_DIRECTONLY] flag is recommended for
|
||||
** all application-defined SQL functions that do not need to be
|
||||
** used inside of triggers, view, CHECK constraints, or other elements of
|
||||
** the database schema. This flags is especially recommended for SQL
|
||||
** used inside of triggers, views, CHECK constraints, or other elements of
|
||||
** the database schema. This flag is especially recommended for SQL
|
||||
** functions that have side effects or reveal internal application state.
|
||||
** Without this flag, an attacker might be able to modify the schema of
|
||||
** a database file to include invocations of the function with parameters
|
||||
@ -5639,7 +5639,7 @@ int sqlite3_reset(sqlite3_stmt *pStmt);
|
||||
** [user-defined window functions|available here].
|
||||
**
|
||||
** ^(If the final parameter to sqlite3_create_function_v2() or
|
||||
** sqlite3_create_window_function() is not NULL, then it is destructor for
|
||||
** sqlite3_create_window_function() is not NULL, then it is the destructor for
|
||||
** the application data pointer. The destructor is invoked when the function
|
||||
** is deleted, either by being overloaded or when the database connection
|
||||
** closes.)^ ^The destructor is also invoked if the call to
|
||||
@ -6039,7 +6039,7 @@ unsigned int sqlite3_value_subtype(sqlite3_value*);
|
||||
** METHOD: sqlite3_value
|
||||
**
|
||||
** ^The sqlite3_value_dup(V) interface makes a copy of the [sqlite3_value]
|
||||
** object D and returns a pointer to that copy. ^The [sqlite3_value] returned
|
||||
** object V and returns a pointer to that copy. ^The [sqlite3_value] returned
|
||||
** is a [protected sqlite3_value] object even if the input is not.
|
||||
** ^The sqlite3_value_dup(V) interface returns NULL if V is NULL or if a
|
||||
** memory allocation fails. ^If V is a [pointer value], then the result
|
||||
@ -6077,7 +6077,7 @@ void sqlite3_value_free(sqlite3_value*);
|
||||
** allocation error occurs.
|
||||
**
|
||||
** ^(The amount of space allocated by sqlite3_aggregate_context(C,N) is
|
||||
** determined by the N parameter on first successful call. Changing the
|
||||
** determined by the N parameter on the first successful call. Changing the
|
||||
** value of N in any subsequent call to sqlite3_aggregate_context() within
|
||||
** the same aggregate function instance will not resize the memory
|
||||
** allocation.)^ Within the xFinal callback, it is customary to set
|
||||
@ -6239,7 +6239,7 @@ void sqlite3_set_auxdata(sqlite3_context*, int N, void*, void (*)(void*));
|
||||
**
|
||||
** Security Warning: These interfaces should not be exposed in scripting
|
||||
** languages or in other circumstances where it might be possible for an
|
||||
** an attacker to invoke them. Any agent that can invoke these interfaces
|
||||
** attacker to invoke them. Any agent that can invoke these interfaces
|
||||
** can probably also take control of the process.
|
||||
**
|
||||
** Database connection client data is only available for SQLite
|
||||
@ -6353,7 +6353,7 @@ typedef void (*sqlite3_destructor_type)(void*);
|
||||
** pointed to by the 2nd parameter are taken as the application-defined
|
||||
** function result. If the 3rd parameter is non-negative, then it
|
||||
** must be the byte offset into the string where the NUL terminator would
|
||||
** appear if the string where NUL terminated. If any NUL characters occur
|
||||
** appear if the string were NUL terminated. If any NUL characters occur
|
||||
** in the string at a byte offset that is less than the value of the 3rd
|
||||
** parameter, then the resulting string will contain embedded NULs and the
|
||||
** result of expressions operating on strings with embedded NULs is undefined.
|
||||
@ -6411,7 +6411,7 @@ typedef void (*sqlite3_destructor_type)(void*);
|
||||
** string and preferably a string literal. The sqlite3_result_pointer()
|
||||
** routine is part of the [pointer passing interface] added for SQLite 3.20.0.
|
||||
**
|
||||
** If these routines are called from within the different thread
|
||||
** If these routines are called from within a different thread
|
||||
** than the one containing the application-defined function that received
|
||||
** the [sqlite3_context] pointer, the results are undefined.
|
||||
*/
|
||||
@ -6817,7 +6817,7 @@ sqlite3 *sqlite3_db_handle(sqlite3_stmt*);
|
||||
** METHOD: sqlite3
|
||||
**
|
||||
** ^The sqlite3_db_name(D,N) interface returns a pointer to the schema name
|
||||
** for the N-th database on database connection D, or a NULL pointer of N is
|
||||
** for the N-th database on database connection D, or a NULL pointer if N is
|
||||
** out of range. An N value of 0 means the main database file. An N of 1 is
|
||||
** the "temp" schema. Larger values of N correspond to various ATTACH-ed
|
||||
** databases.
|
||||
@ -6912,7 +6912,7 @@ int sqlite3_txn_state(sqlite3*,const char *zSchema);
|
||||
** <dd>The SQLITE_TXN_READ state means that the database is currently
|
||||
** in a read transaction. Content has been read from the database file
|
||||
** but nothing in the database file has changed. The transaction state
|
||||
** will advanced to SQLITE_TXN_WRITE if any changes occur and there are
|
||||
** will be advanced to SQLITE_TXN_WRITE if any changes occur and there are
|
||||
** no other conflicting concurrent write transactions. The transaction
|
||||
** state will revert to SQLITE_TXN_NONE following a [ROLLBACK] or
|
||||
** [COMMIT].</dd>
|
||||
@ -6921,7 +6921,7 @@ int sqlite3_txn_state(sqlite3*,const char *zSchema);
|
||||
** <dd>The SQLITE_TXN_WRITE state means that the database is currently
|
||||
** in a write transaction. Content has been written to the database file
|
||||
** but has not yet committed. The transaction state will change to
|
||||
** to SQLITE_TXN_NONE at the next [ROLLBACK] or [COMMIT].</dd>
|
||||
** SQLITE_TXN_NONE at the next [ROLLBACK] or [COMMIT].</dd>
|
||||
*/
|
||||
#define SQLITE_TXN_NONE 0
|
||||
#define SQLITE_TXN_READ 1
|
||||
@ -7202,7 +7202,7 @@ int sqlite3_db_release_memory(sqlite3*);
|
||||
** CAPI3REF: Impose A Limit On Heap Size
|
||||
**
|
||||
** These interfaces impose limits on the amount of heap memory that will be
|
||||
** by all database connections within a single process.
|
||||
** used by all database connections within a single process.
|
||||
**
|
||||
** ^The sqlite3_soft_heap_limit64() interface sets and/or queries the
|
||||
** soft limit on the amount of heap memory that may be allocated by SQLite.
|
||||
@ -7260,7 +7260,7 @@ int sqlite3_db_release_memory(sqlite3*);
|
||||
** </ul>)^
|
||||
**
|
||||
** The circumstances under which SQLite will enforce the heap limits may
|
||||
** changes in future releases of SQLite.
|
||||
** change in future releases of SQLite.
|
||||
*/
|
||||
sqlite3_int64 sqlite3_soft_heap_limit64(sqlite3_int64 N);
|
||||
sqlite3_int64 sqlite3_hard_heap_limit64(sqlite3_int64 N);
|
||||
@ -7375,8 +7375,8 @@ int sqlite3_table_column_metadata(
|
||||
** ^The entry point is zProc.
|
||||
** ^(zProc may be 0, in which case SQLite will try to come up with an
|
||||
** entry point name on its own. It first tries "sqlite3_extension_init".
|
||||
** If that does not work, it constructs a name "sqlite3_X_init" where the
|
||||
** X is consists of the lower-case equivalent of all ASCII alphabetic
|
||||
** If that does not work, it constructs a name "sqlite3_X_init" where
|
||||
** X consists of the lower-case equivalent of all ASCII alphabetic
|
||||
** characters in the filename from the last "/" to the first following
|
||||
** "." and omitting any initial "lib".)^
|
||||
** ^The sqlite3_load_extension() interface returns
|
||||
@ -7447,7 +7447,7 @@ int sqlite3_enable_load_extension(sqlite3 *db, int onoff);
|
||||
** ^(Even though the function prototype shows that xEntryPoint() takes
|
||||
** no arguments and returns void, SQLite invokes xEntryPoint() with three
|
||||
** arguments and expects an integer result as if the signature of the
|
||||
** entry point where as follows:
|
||||
** entry point were as follows:
|
||||
**
|
||||
** <blockquote><pre>
|
||||
** int xEntryPoint(
|
||||
@ -7611,7 +7611,7 @@ struct sqlite3_module {
|
||||
** virtual table and might not be checked again by the byte code.)^ ^(The
|
||||
** aConstraintUsage[].omit flag is an optimization hint. When the omit flag
|
||||
** is left in its default setting of false, the constraint will always be
|
||||
** checked separately in byte code. If the omit flag is change to true, then
|
||||
** checked separately in byte code. If the omit flag is changed to true, then
|
||||
** the constraint may or may not be checked in byte code. In other words,
|
||||
** when the omit flag is true there is no guarantee that the constraint will
|
||||
** not be checked again using byte code.)^
|
||||
@ -7637,7 +7637,7 @@ struct sqlite3_module {
|
||||
** The xBestIndex method may optionally populate the idxFlags field with a
|
||||
** mask of SQLITE_INDEX_SCAN_* flags. One such flag is
|
||||
** [SQLITE_INDEX_SCAN_HEX], which if set causes the [EXPLAIN QUERY PLAN]
|
||||
** output to show the idxNum has hex instead of as decimal. Another flag is
|
||||
** output to show the idxNum as hex instead of as decimal. Another flag is
|
||||
** SQLITE_INDEX_SCAN_UNIQUE, which if set indicates that the query plan will
|
||||
** return at most one row.
|
||||
**
|
||||
@ -7778,7 +7778,7 @@ struct sqlite3_index_info {
|
||||
** the implementation of the [virtual table module]. ^The fourth
|
||||
** parameter is an arbitrary client data pointer that is passed through
|
||||
** into the [xCreate] and [xConnect] methods of the virtual table module
|
||||
** when a new virtual table is be being created or reinitialized.
|
||||
** when a new virtual table is being created or reinitialized.
|
||||
**
|
||||
** ^The sqlite3_create_module_v2() interface has a fifth parameter which
|
||||
** is a pointer to a destructor for the pClientData. ^SQLite will
|
||||
@ -7943,7 +7943,7 @@ typedef struct sqlite3_blob sqlite3_blob;
|
||||
** in *ppBlob. Otherwise an [error code] is returned and, unless the error
|
||||
** code is SQLITE_MISUSE, *ppBlob is set to NULL.)^ ^This means that, provided
|
||||
** the API is not misused, it is always safe to call [sqlite3_blob_close()]
|
||||
** on *ppBlob after this function it returns.
|
||||
** on *ppBlob after this function returns.
|
||||
**
|
||||
** This function fails with SQLITE_ERROR if any of the following are true:
|
||||
** <ul>
|
||||
@ -8063,7 +8063,7 @@ int sqlite3_blob_close(sqlite3_blob *);
|
||||
**
|
||||
** ^Returns the size in bytes of the BLOB accessible via the
|
||||
** successfully opened [BLOB handle] in its only argument. ^The
|
||||
** incremental blob I/O routines can only read or overwriting existing
|
||||
** incremental blob I/O routines can only read or overwrite existing
|
||||
** blob content; they cannot change the size of a blob.
|
||||
**
|
||||
** This routine only works on a [BLOB handle] which has been created
|
||||
@ -8213,7 +8213,7 @@ int sqlite3_vfs_unregister(sqlite3_vfs*);
|
||||
** ^The sqlite3_mutex_alloc() routine allocates a new
|
||||
** mutex and returns a pointer to it. ^The sqlite3_mutex_alloc()
|
||||
** routine returns NULL if it is unable to allocate the requested
|
||||
** mutex. The argument to sqlite3_mutex_alloc() must one of these
|
||||
** mutex. The argument to sqlite3_mutex_alloc() must be one of these
|
||||
** integer constants:
|
||||
**
|
||||
** <ul>
|
||||
@ -8446,7 +8446,7 @@ int sqlite3_mutex_notheld(sqlite3_mutex*);
|
||||
** CAPI3REF: Retrieve the mutex for a database connection
|
||||
** METHOD: sqlite3
|
||||
**
|
||||
** ^This interface returns a pointer the [sqlite3_mutex] object that
|
||||
** ^This interface returns a pointer to the [sqlite3_mutex] object that
|
||||
** serializes access to the [database connection] given in the argument
|
||||
** when the [threading mode] is Serialized.
|
||||
** ^If the [threading mode] is Single-thread or Multi-thread then this
|
||||
@ -8569,7 +8569,7 @@ int sqlite3_test_control(int op, ...);
|
||||
** CAPI3REF: SQL Keyword Checking
|
||||
**
|
||||
** These routines provide access to the set of SQL language keywords
|
||||
** recognized by SQLite. Applications can uses these routines to determine
|
||||
** recognized by SQLite. Applications can use these routines to determine
|
||||
** whether or not a specific identifier needs to be escaped (for example,
|
||||
** by enclosing in double-quotes) so as not to confuse the parser.
|
||||
**
|
||||
@ -8737,7 +8737,7 @@ void sqlite3_str_reset(sqlite3_str*);
|
||||
** content of the dynamic string under construction in X. The value
|
||||
** returned by [sqlite3_str_value(X)] is managed by the sqlite3_str object X
|
||||
** and might be freed or altered by any subsequent method on the same
|
||||
** [sqlite3_str] object. Applications must not used the pointer returned
|
||||
** [sqlite3_str] object. Applications must not use the pointer returned by
|
||||
** [sqlite3_str_value(X)] after any subsequent method call on the same
|
||||
** object. ^Applications may change the content of the string returned
|
||||
** by [sqlite3_str_value(X)] as long as they do not write into any bytes
|
||||
@ -8823,7 +8823,7 @@ int sqlite3_status64(
|
||||
** allocation which could not be satisfied by the [SQLITE_CONFIG_PAGECACHE]
|
||||
** buffer and where forced to overflow to [sqlite3_malloc()]. The
|
||||
** returned value includes allocations that overflowed because they
|
||||
** where too large (they were larger than the "sz" parameter to
|
||||
** were too large (they were larger than the "sz" parameter to
|
||||
** [SQLITE_CONFIG_PAGECACHE]) and allocations that overflowed because
|
||||
** no space was left in the page cache.</dd>)^
|
||||
**
|
||||
@ -8907,28 +8907,29 @@ int sqlite3_db_status(sqlite3*, int op, int *pCur, int *pHiwtr, int resetFlg);
|
||||
** [[SQLITE_DBSTATUS_LOOKASIDE_HIT]] ^(<dt>SQLITE_DBSTATUS_LOOKASIDE_HIT</dt>
|
||||
** <dd>This parameter returns the number of malloc attempts that were
|
||||
** satisfied using lookaside memory. Only the high-water value is meaningful;
|
||||
** the current value is always zero.)^
|
||||
** the current value is always zero.</dd>)^
|
||||
**
|
||||
** [[SQLITE_DBSTATUS_LOOKASIDE_MISS_SIZE]]
|
||||
** ^(<dt>SQLITE_DBSTATUS_LOOKASIDE_MISS_SIZE</dt>
|
||||
** <dd>This parameter returns the number malloc attempts that might have
|
||||
** <dd>This parameter returns the number of malloc attempts that might have
|
||||
** been satisfied using lookaside memory but failed due to the amount of
|
||||
** memory requested being larger than the lookaside slot size.
|
||||
** Only the high-water value is meaningful;
|
||||
** the current value is always zero.)^
|
||||
** the current value is always zero.</dd>)^
|
||||
**
|
||||
** [[SQLITE_DBSTATUS_LOOKASIDE_MISS_FULL]]
|
||||
** ^(<dt>SQLITE_DBSTATUS_LOOKASIDE_MISS_FULL</dt>
|
||||
** <dd>This parameter returns the number malloc attempts that might have
|
||||
** <dd>This parameter returns the number of malloc attempts that might have
|
||||
** been satisfied using lookaside memory but failed due to all lookaside
|
||||
** memory already being in use.
|
||||
** Only the high-water value is meaningful;
|
||||
** the current value is always zero.)^
|
||||
** the current value is always zero.</dd>)^
|
||||
**
|
||||
** [[SQLITE_DBSTATUS_CACHE_USED]] ^(<dt>SQLITE_DBSTATUS_CACHE_USED</dt>
|
||||
** <dd>This parameter returns the approximate number of bytes of heap
|
||||
** memory used by all pager caches associated with the database connection.)^
|
||||
** ^The highwater mark associated with SQLITE_DBSTATUS_CACHE_USED is always 0.
|
||||
** </dd>
|
||||
**
|
||||
** [[SQLITE_DBSTATUS_CACHE_USED_SHARED]]
|
||||
** ^(<dt>SQLITE_DBSTATUS_CACHE_USED_SHARED</dt>
|
||||
@ -8937,10 +8938,10 @@ int sqlite3_db_status(sqlite3*, int op, int *pCur, int *pHiwtr, int resetFlg);
|
||||
** memory used by that pager cache is divided evenly between the attached
|
||||
** connections.)^ In other words, if none of the pager caches associated
|
||||
** with the database connection are shared, this request returns the same
|
||||
** value as DBSTATUS_CACHE_USED. Or, if one or more or the pager caches are
|
||||
** value as DBSTATUS_CACHE_USED. Or, if one or more of the pager caches are
|
||||
** shared, the value returned by this call will be smaller than that returned
|
||||
** by DBSTATUS_CACHE_USED. ^The highwater mark associated with
|
||||
** SQLITE_DBSTATUS_CACHE_USED_SHARED is always 0.
|
||||
** SQLITE_DBSTATUS_CACHE_USED_SHARED is always 0.</dd>
|
||||
**
|
||||
** [[SQLITE_DBSTATUS_SCHEMA_USED]] ^(<dt>SQLITE_DBSTATUS_SCHEMA_USED</dt>
|
||||
** <dd>This parameter returns the approximate number of bytes of heap
|
||||
@ -8950,6 +8951,7 @@ int sqlite3_db_status(sqlite3*, int op, int *pCur, int *pHiwtr, int resetFlg);
|
||||
** schema memory is shared with other database connections due to
|
||||
** [shared cache mode] being enabled.
|
||||
** ^The highwater mark associated with SQLITE_DBSTATUS_SCHEMA_USED is always 0.
|
||||
** </dd>
|
||||
**
|
||||
** [[SQLITE_DBSTATUS_STMT_USED]] ^(<dt>SQLITE_DBSTATUS_STMT_USED</dt>
|
||||
** <dd>This parameter returns the approximate number of bytes of heap
|
||||
@ -8986,7 +8988,7 @@ int sqlite3_db_status(sqlite3*, int op, int *pCur, int *pHiwtr, int resetFlg);
|
||||
** been written to disk in the middle of a transaction due to the page
|
||||
** cache overflowing. Transactions are more efficient if they are written
|
||||
** to disk all at once. When pages spill mid-transaction, that introduces
|
||||
** additional overhead. This parameter can be used help identify
|
||||
** additional overhead. This parameter can be used to help identify
|
||||
** inefficiencies that can be resolved by increasing the cache size.
|
||||
** </dd>
|
||||
**
|
||||
@ -9466,7 +9468,7 @@ typedef struct sqlite3_backup sqlite3_backup;
|
||||
** external process or via a database connection other than the one being
|
||||
** used by the backup operation, then the backup will be automatically
|
||||
** restarted by the next call to sqlite3_backup_step(). ^If the source
|
||||
** database is modified by the using the same database connection as is used
|
||||
** database is modified by using the same database connection as is used
|
||||
** by the backup operation, then the backup database is automatically
|
||||
** updated at the same time.
|
||||
**
|
||||
@ -9483,7 +9485,7 @@ typedef struct sqlite3_backup sqlite3_backup;
|
||||
** and may not be used following a call to sqlite3_backup_finish().
|
||||
**
|
||||
** ^The value returned by sqlite3_backup_finish is [SQLITE_OK] if no
|
||||
** sqlite3_backup_step() errors occurred, regardless or whether or not
|
||||
** sqlite3_backup_step() errors occurred, regardless of whether or not
|
||||
** sqlite3_backup_step() completed.
|
||||
** ^If an out-of-memory condition or IO error occurred during any prior
|
||||
** sqlite3_backup_step() call on the same [sqlite3_backup] object, then
|
||||
@ -10522,14 +10524,14 @@ int sqlite3_stmt_scanstatus(
|
||||
int idx, /* Index of loop to report on */
|
||||
int iScanStatusOp, /* Information desired. SQLITE_SCANSTAT_* */
|
||||
void *pOut /* Result written here */
|
||||
);
|
||||
);
|
||||
int sqlite3_stmt_scanstatus_v2(
|
||||
sqlite3_stmt *pStmt, /* Prepared statement for which info desired */
|
||||
int idx, /* Index of loop to report on */
|
||||
int iScanStatusOp, /* Information desired. SQLITE_SCANSTAT_* */
|
||||
int flags, /* Mask of flags defined below */
|
||||
void *pOut /* Result written here */
|
||||
);
|
||||
);
|
||||
|
||||
/*
|
||||
** CAPI3REF: Prepared Statement Scan Status
|
||||
@ -10553,7 +10555,7 @@ void sqlite3_stmt_scanstatus_reset(sqlite3_stmt*);
|
||||
** METHOD: sqlite3
|
||||
**
|
||||
** ^If a write-transaction is open on [database connection] D when the
|
||||
** [sqlite3_db_cacheflush(D)] interface invoked, any dirty
|
||||
** [sqlite3_db_cacheflush(D)] interface is invoked, any dirty
|
||||
** pages in the pager-cache that are not currently in use are written out
|
||||
** to disk. A dirty page may be in use if a database cursor created by an
|
||||
** active SQL statement is reading from it, or if it is page 1 of a database
|
||||
|
@ -1031,8 +1031,8 @@ typedef INT16_TYPE LogEst;
|
||||
** assuming n is a signed integer type. UMXV(n) is similar for unsigned
|
||||
** integer types.
|
||||
*/
|
||||
#define SMXV(n) ((((i64)1)<<(sizeof(n)-1))-1)
|
||||
#define UMXV(n) ((((i64)1)<<(sizeof(n)))-1)
|
||||
#define SMXV(n) ((((i64)1)<<(sizeof(n)*8-1))-1)
|
||||
#define UMXV(n) ((((i64)1)<<(sizeof(n)*8))-1)
|
||||
|
||||
/*
|
||||
** Round up a number to the next larger multiple of 8. This is used
|
||||
@ -2900,7 +2900,7 @@ struct AggInfo {
|
||||
** from source tables rather than from accumulators */
|
||||
u8 useSortingIdx; /* In direct mode, reference the sorting index rather
|
||||
** than the source table */
|
||||
u16 nSortingColumn; /* Number of columns in the sorting index */
|
||||
u32 nSortingColumn; /* Number of columns in the sorting index */
|
||||
int sortingIdx; /* Cursor number of the sorting index */
|
||||
int sortingIdxPTab; /* Cursor number of pseudo-table */
|
||||
int iFirstReg; /* First register in range for aCol[] and aFunc[] */
|
||||
@ -2909,8 +2909,8 @@ struct AggInfo {
|
||||
Table *pTab; /* Source table */
|
||||
Expr *pCExpr; /* The original expression */
|
||||
int iTable; /* Cursor number of the source table */
|
||||
i16 iColumn; /* Column number within the source table */
|
||||
i16 iSorterColumn; /* Column number in the sorting index */
|
||||
int iColumn; /* Column number within the source table */
|
||||
int iSorterColumn; /* Column number in the sorting index */
|
||||
} *aCol;
|
||||
int nColumn; /* Number of used entries in aCol[] */
|
||||
int nAccumulator; /* Number of columns that show through to the output.
|
||||
|
@ -3781,6 +3781,7 @@ int sqlite3WalUndo(Wal *pWal, int (*xUndo)(void *, Pgno), void *pUndoCtx){
|
||||
if( iMax!=pWal->hdr.mxFrame ) walCleanupHash(pWal);
|
||||
}
|
||||
SEH_EXCEPT( rc = SQLITE_IOERR_IN_PAGE; )
|
||||
pWal->iReCksum = 0;
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
@ -3828,6 +3829,9 @@ int sqlite3WalSavepointUndo(Wal *pWal, u32 *aWalData){
|
||||
walCleanupHash(pWal);
|
||||
}
|
||||
SEH_EXCEPT( rc = SQLITE_IOERR_IN_PAGE; )
|
||||
if( pWal->iReCksum>pWal->hdr.mxFrame ){
|
||||
pWal->iReCksum = 0;
|
||||
}
|
||||
}
|
||||
|
||||
return rc;
|
||||
|
@ -931,30 +931,42 @@ static void exprAnalyzeOrTerm(
|
||||
** 1. The SQLITE_Transitive optimization must be enabled
|
||||
** 2. Must be either an == or an IS operator
|
||||
** 3. Not originating in the ON clause of an OUTER JOIN
|
||||
** 4. The affinities of A and B must be compatible
|
||||
** 5a. Both operands use the same collating sequence OR
|
||||
** 5b. The overall collating sequence is BINARY
|
||||
** 4. The operator is not IS or else the query does not contain RIGHT JOIN
|
||||
** 5. The affinities of A and B must be compatible
|
||||
** 6a. Both operands use the same collating sequence OR
|
||||
** 6b. The overall collating sequence is BINARY
|
||||
** If this routine returns TRUE, that means that the RHS can be substituted
|
||||
** for the LHS anyplace else in the WHERE clause where the LHS column occurs.
|
||||
** This is an optimization. No harm comes from returning 0. But if 1 is
|
||||
** returned when it should not be, then incorrect answers might result.
|
||||
*/
|
||||
static int termIsEquivalence(Parse *pParse, Expr *pExpr){
|
||||
static int termIsEquivalence(Parse *pParse, Expr *pExpr, SrcList *pSrc){
|
||||
char aff1, aff2;
|
||||
CollSeq *pColl;
|
||||
if( !OptimizationEnabled(pParse->db, SQLITE_Transitive) ) return 0;
|
||||
if( pExpr->op!=TK_EQ && pExpr->op!=TK_IS ) return 0;
|
||||
if( ExprHasProperty(pExpr, EP_OuterON) ) return 0;
|
||||
if( !OptimizationEnabled(pParse->db, SQLITE_Transitive) ) return 0; /* (1) */
|
||||
if( pExpr->op!=TK_EQ && pExpr->op!=TK_IS ) return 0; /* (2) */
|
||||
if( ExprHasProperty(pExpr, EP_OuterON) ) return 0; /* (3) */
|
||||
assert( pSrc!=0 );
|
||||
if( pExpr->op==TK_IS
|
||||
&& pSrc->nSrc
|
||||
&& (pSrc->a[0].fg.jointype & JT_LTORJ)!=0
|
||||
){
|
||||
return 0; /* (4) */
|
||||
}
|
||||
aff1 = sqlite3ExprAffinity(pExpr->pLeft);
|
||||
aff2 = sqlite3ExprAffinity(pExpr->pRight);
|
||||
if( aff1!=aff2
|
||||
&& (!sqlite3IsNumericAffinity(aff1) || !sqlite3IsNumericAffinity(aff2))
|
||||
){
|
||||
return 0;
|
||||
return 0; /* (5) */
|
||||
}
|
||||
pColl = sqlite3ExprCompareCollSeq(pParse, pExpr);
|
||||
if( sqlite3IsBinary(pColl) ) return 1;
|
||||
return sqlite3ExprCollSeqMatch(pParse, pExpr->pLeft, pExpr->pRight);
|
||||
if( !sqlite3IsBinary(pColl)
|
||||
&& !sqlite3ExprCollSeqMatch(pParse, pExpr->pLeft, pExpr->pRight)
|
||||
){
|
||||
return 0; /* (6) */
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*
|
||||
@ -1219,8 +1231,8 @@ static void exprAnalyze(
|
||||
if( op==TK_IS ) pNew->wtFlags |= TERM_IS;
|
||||
pTerm = &pWC->a[idxTerm];
|
||||
pTerm->wtFlags |= TERM_COPIED;
|
||||
|
||||
if( termIsEquivalence(pParse, pDup) ){
|
||||
assert( pWInfo->pTabList!=0 );
|
||||
if( termIsEquivalence(pParse, pDup, pWInfo->pTabList) ){
|
||||
pTerm->eOperator |= WO_EQUIV;
|
||||
eExtraOp = WO_EQUIV;
|
||||
}
|
||||
|
@ -26,6 +26,9 @@ do_catchsql_test func9-120 {
|
||||
do_execsql_test func9-130 {
|
||||
SELECT concat_ws(',',1,2,3,4,5,6,7,8,NULL,9,10,11,12);
|
||||
} {1,2,3,4,5,6,7,8,9,10,11,12}
|
||||
do_execsql_test func9-131 {
|
||||
SELECT concat_ws(',',1,2,3,4,'',6,7,8,NULL,9,10,11,12);
|
||||
} {1,2,3,4,,6,7,8,9,10,11,12}
|
||||
do_execsql_test func9-140 {
|
||||
SELECT concat_ws(NULL,1,2,3,4,5,6,7,8,NULL,9,10,11,12);
|
||||
} {{}}
|
||||
|
@ -1342,4 +1342,31 @@ do_execsql_test join-31.8 {
|
||||
SELECT * FROM t3 LEFT JOIN t2 ON true JOIN t4 ON true NATURAL LEFT JOIN t1;
|
||||
} {3 NULL 4 NULL}
|
||||
|
||||
# 2025-06-16 https://sqlite.org/forum/forumpost/68f29a2005
|
||||
#
|
||||
# The transitive-constraint optimization was not working for RIGHT JOIN.
|
||||
#
|
||||
reset_db
|
||||
db null NULL
|
||||
do_execsql_test join-32.1 {
|
||||
CREATE TABLE t0(w INT);
|
||||
CREATE TABLE t1(x INT);
|
||||
CREATE TABLE t2(y INT UNIQUE);
|
||||
CREATE VIEW v0(z) AS SELECT CAST(x AS INT) FROM t1 LEFT JOIN t2 ON true;
|
||||
INSERT INTO t1(x) VALUES(123);
|
||||
INSERT INTO t2(y) VALUES(NULL);
|
||||
}
|
||||
do_execsql_test join-32.2 {
|
||||
SELECT *
|
||||
FROM t0 JOIN v0 ON w=z
|
||||
RIGHT JOIN t1 ON true
|
||||
INNER JOIN t2 ON y IS z;
|
||||
} {NULL NULL 123 NULL}
|
||||
do_execsql_test join-32.3 {
|
||||
SELECT *
|
||||
FROM t0 JOIN v0 ON w=z
|
||||
RIGHT JOIN t1 ON true
|
||||
INNER JOIN t2 ON +y IS z;
|
||||
} {NULL NULL 123 NULL}
|
||||
|
||||
finish_test
|
||||
|
@ -16,6 +16,7 @@ source $testdir/lock_common.tcl
|
||||
source $testdir/wal_common.tcl
|
||||
|
||||
ifcapable !wal {finish_test ; return }
|
||||
set testprefix walcksum
|
||||
|
||||
# Read and return the contents of file $filename. Treat the content as
|
||||
# binary data.
|
||||
@ -331,5 +332,152 @@ do_test walcksum-2.1 {
|
||||
catch { db close }
|
||||
catch { db2 close }
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
# Test cases based on the bug reported at:
|
||||
#
|
||||
# <https://sqlite.org/forum/forumpost/b490f726db>
|
||||
#
|
||||
reset_db
|
||||
|
||||
do_execsql_test 3.0 {
|
||||
PRAGMA auto_vacuum = 0;
|
||||
PRAGMA synchronous = NORMAL;
|
||||
PRAGMA journal_mode = WAL;
|
||||
PRAGMA cache_size = 1;
|
||||
|
||||
CREATE TABLE t1 (i INTEGER PRIMARY KEY, b BLOB, t TEXT);
|
||||
PRAGMA wal_checkpoint;
|
||||
INSERT INTO t1 VALUES(1, randomblob(2048), 'one');
|
||||
} {wal 0 2 2}
|
||||
|
||||
do_execsql_test 3.1 {
|
||||
BEGIN;
|
||||
INSERT INTO t1 VALUES(2, randomblob(2048), 'two');
|
||||
SAVEPOINT one;
|
||||
INSERT INTO t1 VALUES(3, randomblob(2048), 'three');
|
||||
INSERT INTO t1 VALUES(4, randomblob(2048), 'four');
|
||||
INSERT INTO t1 VALUES(5, randomblob(2048), 'five');
|
||||
INSERT INTO t1 VALUES(6, randomblob(2048), 'six');
|
||||
INSERT INTO t1 VALUES(7, randomblob(2048), 'seven');
|
||||
|
||||
UPDATE t1 SET b=randomblob(2048) WHERE i=5;
|
||||
UPDATE t1 SET b=randomblob(2048) WHERE i=6;
|
||||
UPDATE t1 SET b=randomblob(2048) WHERE i=7;
|
||||
ROLLBACK TO one;
|
||||
INSERT INTO t1 VALUES(8, NULL, 'eight');
|
||||
COMMIT;
|
||||
} {}
|
||||
|
||||
do_execsql_test 3.2 {
|
||||
SELECT i, t FROM t1
|
||||
} {1 one 2 two 8 eight}
|
||||
|
||||
forcecopy test.db test2.db
|
||||
forcecopy test.db-wal test2.db-wal
|
||||
|
||||
sqlite3 db2 test2.db
|
||||
do_test 1.3 {
|
||||
execsql {
|
||||
SELECT i, t FROM t1
|
||||
} db2
|
||||
} {1 one 2 two 8 eight}
|
||||
|
||||
catch { db2 close }
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
reset_db
|
||||
|
||||
do_execsql_test 4.0 {
|
||||
PRAGMA auto_vacuum = 0;
|
||||
PRAGMA synchronous = NORMAL;
|
||||
PRAGMA journal_mode = WAL;
|
||||
PRAGMA cache_size = 1;
|
||||
|
||||
CREATE TABLE t1 (i INTEGER PRIMARY KEY, b BLOB, t TEXT);
|
||||
PRAGMA wal_checkpoint;
|
||||
INSERT INTO t1 VALUES(1, randomblob(2048), 'one');
|
||||
} {wal 0 2 2}
|
||||
|
||||
do_execsql_test 4.1.1 {
|
||||
SAVEPOINT one;
|
||||
INSERT INTO t1 VALUES(2, randomblob(2048), 'two');
|
||||
INSERT INTO t1 VALUES(3, randomblob(2048), 'three');
|
||||
INSERT INTO t1 VALUES(4, randomblob(2048), 'four');
|
||||
INSERT INTO t1 VALUES(5, randomblob(2048), 'five');
|
||||
INSERT INTO t1 VALUES(6, randomblob(2048), 'six');
|
||||
INSERT INTO t1 VALUES(7, randomblob(2048), 'seven');
|
||||
|
||||
UPDATE t1 SET b=randomblob(2048) WHERE i=5;
|
||||
UPDATE t1 SET b=randomblob(2048) WHERE i=6;
|
||||
UPDATE t1 SET b=randomblob(2048) WHERE i=7;
|
||||
}
|
||||
|
||||
do_execsql_test 4.1.2 {
|
||||
ROLLBACK TO one;
|
||||
INSERT INTO t1 VALUES(8, NULL, 'eight');
|
||||
RELEASE one;
|
||||
} {}
|
||||
|
||||
do_execsql_test 4.2 {
|
||||
SELECT i, t FROM t1
|
||||
} {1 one 8 eight}
|
||||
|
||||
forcecopy test.db test2.db
|
||||
forcecopy test.db-wal test2.db-wal
|
||||
|
||||
sqlite3 db2 test2.db
|
||||
do_test 4.3 {
|
||||
execsql {
|
||||
SELECT i, t FROM t1
|
||||
} db2
|
||||
} {1 one 8 eight}
|
||||
|
||||
catch { db2 close }
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
reset_db
|
||||
|
||||
do_execsql_test 5.0 {
|
||||
PRAGMA auto_vacuum = 0;
|
||||
PRAGMA synchronous = NORMAL;
|
||||
PRAGMA journal_mode = WAL;
|
||||
PRAGMA cache_size = 1;
|
||||
|
||||
CREATE TABLE t1 (i INTEGER PRIMARY KEY, b BLOB, t TEXT);
|
||||
INSERT INTO t1 VALUES(1, randomblob(2048), 'one');
|
||||
INSERT INTO t1 VALUES(2, randomblob(2048), 'two');
|
||||
INSERT INTO t1 VALUES(3, randomblob(2048), 'three');
|
||||
PRAGMA wal_checkpoint;
|
||||
} {wal 0 14 14}
|
||||
|
||||
do_execsql_test 5.1 {
|
||||
BEGIN;
|
||||
SELECT count(*) FROM t1;
|
||||
SAVEPOINT one;
|
||||
INSERT INTO t1 VALUES(4, randomblob(2048), 'four');
|
||||
INSERT INTO t1 VALUES(5, randomblob(2048), 'five');
|
||||
INSERT INTO t1 VALUES(6, randomblob(2048), 'six');
|
||||
INSERT INTO t1 VALUES(7, randomblob(2048), 'seven');
|
||||
ROLLBACK TO one;
|
||||
INSERT INTO t1 VALUES(8, randomblob(2048), 'eight');
|
||||
INSERT INTO t1 VALUES(9, randomblob(2048), 'nine');
|
||||
COMMIT;
|
||||
} {3}
|
||||
|
||||
forcecopy test.db test2.db
|
||||
forcecopy test.db-wal test2.db-wal
|
||||
|
||||
sqlite3 db2 test2.db
|
||||
do_test 5.2 {
|
||||
execsql {
|
||||
SELECT i, t FROM t1
|
||||
} db2
|
||||
} {1 one 2 two 3 three 8 eight 9 nine}
|
||||
db2 close
|
||||
|
||||
do_execsql_test 5.3 {
|
||||
SELECT i, t FROM t1
|
||||
} {1 one 2 two 3 three 8 eight 9 nine}
|
||||
|
||||
|
||||
finish_test
|
||||
|
@ -90,6 +90,8 @@ tvfs delete
|
||||
# but other operations do not use the retry mechanism.
|
||||
#
|
||||
reset_db
|
||||
db close
|
||||
sqlite3 db test.db -fullmutex 1
|
||||
|
||||
do_execsql_test 2.0 {
|
||||
CREATE TABLE t1(a, b);
|
||||
|
Reference in New Issue
Block a user