8000 Snapshot of upstream SQLite 3.45.2 · sqlcipher/sqlcipher@0eb6029 · GitHub
[go: up one dir, main page]

Skip to content

Commit 0eb6029

Browse files
committed
Snapshot of upstream SQLite 3.45.2
1 parent a23eddc commit 0eb6029

39 files changed

+839
-174
lines changed

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.45.1
1+
3.45.2

autoconf/tea/configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ dnl to configure the system for the local environment.
1919
# so that we create the export library with the dll.
2020
#-----------------------------------------------------------------------
2121

22-
AC_INIT([sqlite],[3.45.1])
22+
AC_INIT([sqlite],[3.45.2])
2323

2424
#--------------------------------------------------------------------
2525
# Call TEA_INIT as the first TEA_ macro to set up initial vars.

configure

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#! /bin/sh
22
# Guess values for system-dependent variables and create Makefiles.
3-
# Generated by GNU Autoconf 2.69 for sqlite 3.45.1.
3+
# Generated by GNU Autoconf 2.69 for sqlite 3.45.2.
44
#
55
#
66
# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
@@ -726,8 +726,8 @@ MAKEFLAGS=
726726
# Identity of this package.
727727
PACKAGE_NAME='sqlite'
728728
PACKAGE_TARNAME='sqlite'
729-
PACKAGE_VERSION='3.45.1'
730-
PACKAGE_STRING='sqlite 3.45.1'
729+
PACKAGE_VERSION='3.45.2'
730+
PACKAGE_STRING='sqlite 3.45.2'
731731
PACKAGE_BUGREPORT=''
732732
PACKAGE_URL=''
733733

@@ -1472,7 +1472,7 @@ if test "$ac_init_help" = "long"; then
14721472
# Omit some internal or obsolete options to make the list less imposing.
14731473
# This message is too long to be a string in the A/UX 3.1 sh.
14741474
cat <<_ACEOF
1475-
\`configure' configures sqlite 3.45.1 to adapt to many kinds of systems.
1475+
\`configure' configures sqlite 3.45.2 to adapt to many kinds of systems.
14761476
14771477
Usage: $0 [OPTION]... [VAR=VALUE]...
14781478
@@ -1537,7 +1537,7 @@ fi
15371537

15381538
if test -n "$ac_init_help"; then
15391539
case $ac_init_help in
1540-
short | recursive ) echo "Configuration of sqlite 3.45.1:";;
1540+
short | recursive ) echo "Configuration of sqlite 3.45.2:";;
15411541
esac
15421542
cat <<\_ACEOF
15431543
@@ -1668,7 +1668,7 @@ fi
16681668
test -n "$ac_init_help" && exit $ac_status
16691669
if $ac_init_version; then
16701670
cat <<\_ACEOF
1671-
sqlite configure 3.45.1
1671+
sqlite configure 3.45.2
16721672
generated by GNU Autoconf 2.69
16731673
16741674
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2087,7 +2087,7 @@ cat >config.log <<_ACEOF
20872087
This file contains any messages produced by compilers while
20882088
running configure, to aid debugging if configure makes a mistake.
20892089
2090-
It was created by sqlite $as_me 3.45.1, which was
2090+
It was created by sqlite $as_me 3.45.2, which was
20912091
generated by GNU Autoconf 2.69. Invocation command line was
20922092
20932093
$ $0 $@
@@ -12481,7 +12481,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
1248112481
# report actual input values of CONFIG_FILES etc. instead of their
1248212482
# values after options handling.
1248312483
ac_log="
12484-
This file was extended by sqlite $as_me 3.45.1, which was
12484+
This file was extended by sqlite $as_me 3.45.2, which was
1248512485
generated by GNU Autoconf 2.69. Invocation command line was
1248612486
1248712487
CONFIG_FILES = $CONFIG_FILES
@@ -12547,7 +12547,7 @@ _ACEOF
1254712547
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
1254812548
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
1254912549
ac_cs_version="\\
12550-
sqlite config.status 3.45.1
12550+
sqlite config.status 3.45.2
1255112551
configured by $0, generated by GNU Autoconf 2.69,
1255212552
with options \\"\$ac_cs_config\\"
1255312553

ext/consio/console_io.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@
2929
#ifndef HAVE_CONSOLE_IO_H
3030
# include "console_io.h"
3131
#endif
32+
#if defined(_MSC_VER)
33+
# pragma warning(disable : 4204)
34+
#endif
3235

3336
#ifndef SQLITE_CIO_NO_TRANSLATE
3437
# if (defined(_WIN32) || defined(WIN32)) && !SQLITE_OS_WINRT
@@ -127,6 +130,10 @@ static short streamOfConsole(FILE *pf, /* out */ PerStreamTags *ppst){
127130
# endif
128131
}
129132

133+
# ifndef ENABLE_VIRTUAL_TERMINAL_PROCESSING
134+
# define ENABLE_VIRTUAL_TERMINAL_PROCESSING (0x4)
135+
# endif
136+
130137
# if CIO_WIN_WC_XLATE
131138
/* Define console modes for use with the Windows Console API. */
132139
# define SHELL_CONI_MODE \
@@ -677,4 +684,8 @@ SQLITE_INTERNAL_LINKAGE char* fGetsUtf8(char *cBuf, int ncMax, FILE *pfIn){
677684
}
678685
#endif /* !defined(SQLITE_CIO_NO_TRANSLATE) */
679686

687+
#if defined(_MSC_VER)
688+
# pragma warning(default : 4204)
689+
#endif
690+
680691
#undef SHELL_INVALID_FILE_PTR

ext/fts5/fts5_index.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6837,23 +6837,26 @@ static void fts5IterSetOutputsTokendata(Fts5Iter *pIter){
68376837
static void fts5TokendataIterNext(Fts5Iter *pIter, int bFrom, i64 iFrom){
68386838
int ii;
68396839
Fts5TokenDataIter *pT = pIter->pTokenDataIter;
6840+
Fts5Index *pIndex = pIter->pIndex;
68406841

68416842
for(ii=0; ii<pT->nIter; ii++){
68426843
Fts5Iter *p = pT->apIter[ii];
68436844
if( p->base.bEof==0
68446845
&& (p->base.iRowid==pIter->base.iRowid || (bFrom && p->base.iRowid<iFrom))
68456846
){
6846-
fts5MultiIterNext(p->pIndex, p, bFrom, iFrom);
6847+
fts5MultiIterNext(pIndex, p, bFrom, iFrom);
68476848
while( bFrom && p->base.bEof==0
68486849
&& p->base.iRowid<iFrom
6849-
&& p->pIndex->rc==SQLITE_OK
6850+
&& pIndex->rc==SQLITE_OK
68506851
){
6851-
fts5MultiIterNext(p->pIndex, p, 0, 0);
6852+
fts5MultiIterNext(pIndex, p, 0, 0);
68526853
}
68536854
}
68546855
}
68556856

6856-
fts5IterSetOutputsTokendata(pIter);
6857+
if( pIndex->rc==SQLITE_OK ){
6858+
fts5IterSetOutputsTokendata(pIter);
6859+
}
68576860
}
68586861

68596862
/*

ext/fts5/fts5_tcl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1169,7 +1169,7 @@ struct OriginTextTokenizer {
11691169
*/
11701170
static void f5tOrigintextTokenizerDelete(void *pCtx){
11711171
OriginTextCtx *p = (OriginTextCtx*)pCtx;
1172-
ckfree(p);
1172+
ckfree((char*)p);
11731173
}
11741174

11751175
static int f5tOrigintextCreate(

ext/fts5/test/fts5faultH.test

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ do_execsql_test 3.0 {
127127
COMMIT;
128128
}
129129

130-
do_faultsim_test 3 -faults oom* -prep {
130+
do_faultsim_test 3.1 -faults oom* -prep {
131131
} -body {
132132
execsql {
133133
SELECT rowid FROM t1('BBB AND AAA');
@@ -136,6 +136,15 @@ do_faultsim_test 3 -faults oom* -prep {
136136
faultsim_integrity_check
137137
faultsim_test_result {0 {10 35}}
138138
}
139+
do_faultsim_test 3.2 -faults oom* -prep {
140+
} -body {
141+
execsql {
142+
SELECT count(*) FROM t1('BBB');
143+
}
144+
} -test {
145+
faultsim_integrity_check
146+
faultsim_test_result {0 27}
147+
}
139148

140149

141150
finish_test

ext/misc/noop.c

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,24 @@ static void noopfunc(
3838
sqlite3_result_value(context, argv[0]);
3939
}
4040

41+
/*
42+
** Implementation of the multitype_text() function.
43+
**
44+
** The function returns its argument. The result will always have a
45+
** TEXT value. But if the original input is numeric, it will also
46+
** have that numeric value.
47+
*/
48+
static void multitypeTextFunc(
49+
sqlite3_context *context,
50+
int argc,
51+
sqlite3_value **argv
52+
){
53+
assert( argc==1 );
54+
(void)argc;
55+
(void)sqlite3_value_text(argv[0]);
56+
sqlite3_result_value(context, argv[0]);
57+
}
58+
4159
#ifdef _WIN32
4260
__declspec(dllexport)
4361
#endif
@@ -64,5 +82,9 @@ int sqlite3_noop_init(
6482
rc = sqlite3_create_function(db, "noop_nd", 1,
6583
SQLITE_UTF8,
6684
0, noopfunc, 0, 0);
85+
if( rc ) return rc;
86+
rc = sqlite3_create_function(db, "multitype_text", 1,
87+
SQLITE_UTF8,
88+
0, multitypeTextFunc, 0, 0);
6789
return rc;
6890
}

ext/recover/test_recover.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ static int test_sqlite3_recover_init(
236236
zDb = Tcl_GetString(objv[2]);
237237
if( zDb[0]=='\0' ) zDb = 0;
238238

239-
pNew = ckalloc(sizeof(TestRecover));
239+
pNew = (TestRecover*)ckalloc(sizeof(TestRecover));
240240
if( bSql==0 ){
241241
zUri = Tcl_GetString(objv[3]);
242242
pNew->p = sqlite3_recover_init(db, zDb, zUri);

ext/rtree/rtree.c

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -694,11 +694,9 @@ static RtreeNode *nodeNew(Rtree *pRtree, RtreeNode *pParent){
694694
** Clear the Rtree.pNodeBlob object
695695
*/
696696
static void nodeBlobReset(Rtree *pRtree){
697-
if( pRtree->pNodeBlob && pRtree->inWrTrans==0 && pRtree->nCursor==0 ){
698-
sqlite3_blob *pBlob = pRtree->pNodeBlob;
699-
pRtree->pNodeBlob = 0;
700-
sqlite3_blob_close(pBlob);
701-
}
697+
sqlite3_blob *pBlob = pRtree->pNodeBlob;
698+
pRtree->pNodeBlob = 0;
699+
sqlite3_blob_close(pBlob);
702700
}
703701

704702
/*
@@ -742,7 +740,6 @@ static int nodeAcquire(
742740
&pRtree->pNodeBlob);
743741
}
744742
if( rc ){
745-
nodeBlobReset(pRtree);
746743
*ppNode = 0;
747744
/* If unable to open an sqlite3_blob on the desired row, that can only
748745
** be because the shadow tables hold erroneous data. */
@@ -802,6 +799,7 @@ static int nodeAcquire(
802799
}
803800
*ppNode = pNode;
804801
}else{
802+
nodeBlobReset(pRtree);
805803
if( pNode ){
806804
pRtree->nNodeRef--;
807805
sqlite3_free(pNode);
@@ -946,6 +944,7 @@ static void nodeGetCoord(
946944
int iCoord, /* Which coordinate to extract */
947945
RtreeCoord *pCoord /* OUT: Space to write result to */
948946
){
947+
assert( iCell<NCELL(pNode) );
949948
readCoord(&pNode->zData[12 + pRtree->nBytesPerCell*iCell + 4*iCoord], pCoord);
950949
}
951950

@@ -1135,7 +1134,9 @@ static int rtreeClose(sqlite3_vtab_cursor *cur){
11351134
sqlite3_finalize(pCsr->pReadAux);
11361135
sqlite3_free(pCsr);
11371136
pRtree->nCursor--;
1138-
nodeBlobReset(pRtree);
1137+
if( pRtree->nCursor==0 && pRtree->inWrTrans==0 ){
1138+
nodeBlobReset(pRtree);
1139+
}
11391140
return SQLITE_OK;
11401141
}
11411142

@@ -1720,7 +1721,11 @@ static int rtreeRowid(sqlite3_vtab_cursor *pVtabCursor, sqlite_int64 *pRowid){
17201721
int rc = SQLITE_OK;
17211722
RtreeNode *pNode = rtreeNodeOfFirstSearchPoint(pCsr, &rc);
17221723
if( rc==SQLITE_OK && ALWAYS(p) ){
1723-
*pRowid = nodeGetRowid(RTREE_OF_CURSOR(pCsr), pNode, p->iCell);
1724+
if( p->iCell>=NCELL(pNode) ){
1725+
rc = SQLITE_ABORT;
1726+
}else{
1727+
*pRowid = nodeGetRowid(RTREE_OF_CURSOR(pCsr), pNode, p->iCell);
1728+
}
17241729
}
17251730
return rc;
17261731
}
@@ -1738,6 +1743,7 @@ static int rtreeColumn(sqlite3_vtab_cursor *cur, sqlite3_context *ctx, int i){
17381743

17391744
if( rc ) return rc;
17401745
if( NEVER(p==0) ) return SQLITE_OK;
1746+
if( p->iCell>=NCELL(pNode) ) return SQLITE_ABORT;
17411747
if( i==0 ){
17421748
sqlite3_result_int64(ctx, nodeGetRowid(pRtree, pNode, p->iCell));
17431749
}else if( i<=pRtree->nDim2 ){
@@ -3219,8 +3225,7 @@ static int rtreeUpdate(
32193225
*/
32203226
static int rtreeBeginTransaction(sqlite3_vtab *pVtab){
32213227
Rtree *pRtree = (Rtree *)pVtab;
3222-
assert( pRtree->inWrTrans==0 );
3223-
pRtree->inWrTrans++;
3228+
pRtree->inWrTrans = 1;
32243229
return SQLITE_OK;
32253230
}
32263231

@@ -3234,6 +3239,9 @@ static int rtreeEndTransaction(sqlite3_vtab *pVtab){
32343239
nodeBlobReset(pRtree);
32353240
return SQLITE_OK;
32363241
}
3242+
static int rtreeRollback(sqlite3_vtab *pVtab){
3243+
return rtreeEndTransaction(pVtab);
3244+
}
32373245

32383246
/*
32393247
** The xRename method for rtree module virtual tables.
@@ -3352,7 +3360,7 @@ static sqlite3_module rtreeModule = {
33523360
rtreeBeginTransaction, /* xBegin - begin transaction */
33533361
rtreeEndTransaction, /* xSync - sync transaction */
33543362
rtreeEndTransaction, /* xCommit - commit transaction */
3355-
rtreeEndTransaction, /* xRollback - rollback transaction */
3363+
rtreeRollback, /* xRollback - rollback transaction */
33563364
0, /* xFindFunction - function overloading */
33573365
rtreeRename, /* xRename - rename the table */
33583366
rtreeSavepoint, /* xSavepoint */

0 commit comments

Comments
 (0)
0