Skip to content

Commit a3befec

Browse files
committed
Prepare release of version 1.4.7
- Based on SQLite version 3.39.2
1 parent 41ed516 commit a3befec

File tree

8 files changed

+84
-92
lines changed

8 files changed

+84
-92
lines changed

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ dnl Copyright (C) 2019-2022 Ulrich Telle <[email protected]>
44
dnl
55
dnl This file is covered by the same licence as the entire SQLite3 Multiple Ciphers package.
66

7-
AC_INIT([sqlite3mc], [1.4.6], [[email protected]])
7+
AC_INIT([sqlite3mc], [1.4.7], [[email protected]])
88

99
dnl This is the version tested with, might work with earlier ones.
1010
AC_PREREQ([2.69])

readme.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ The code was mainly developed under Windows, but was tested under Linux as well.
1010

1111
## Version history
1212

13+
* 1.4.7 - *July 2022*
14+
- Based on SQLite version 3.39.2
1315
* 1.4.6 - *July 2022*
1416
- Based on SQLite version 3.39.1
1517
* 1.4.5 - *July 2022*

src/rekeyvacuum.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
** Change 4: Call sqlite3mcBtreeSetPageSize instead of sqlite3BtreeSetPageSize for main database
2828
** (sqlite3mcBtreeSetPageSize allows to reduce the number of reserved bytes)
2929
**
30-
** This code is generated by the script rekeyvacuum.sh from SQLite version 3.39.1 amalgamation.
30+
** This code is generated by the script rekeyvacuum.sh from SQLite version 3.39.2 amalgamation.
3131
*/
3232
SQLITE_PRIVATE SQLITE_NOINLINE int sqlite3mcRunVacuumForRekey(
3333
char **pzErrMsg, /* Write error message here */

src/shell.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23086,7 +23086,7 @@ int SQLITE_CDECL wmain(int argc, wchar_t **wargv){
2308623086
char **argv;
2308723087
#endif
2308823088
#ifdef SQLITE_DEBUG
23089-
sqlite3_uint64 mem_main_enter = sqlite3_memory_used();
23089+
sqlite3_int64 mem_main_enter = sqlite3_memory_used();
2309023090
#endif
2309123091
char *zErrMsg = 0;
2309223092
#ifdef SQLITE_SHELL_WASM_MODE

src/sqlite3.c

Lines changed: 37 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/******************************************************************************
22
** This file is an amalgamation of many separate C source files from SQLite
3-
** version 3.39.1. By combining all the individual C code files into this
3+
** version 3.39.2. By combining all the individual C code files into this
44
** single large file, the entire code can be compiled as a single translation
55
** unit. This allows many compilers to do optimizations that would not be
66
** possible if the files were compiled separately. Performance improvements
@@ -452,9 +452,9 @@ extern "C" {
452452
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
453453
** [sqlite_version()] and [sqlite_source_id()].
454454
*/
455-
#define SQLITE_VERSION "3.39.1"
456-
#define SQLITE_VERSION_NUMBER 3039001
457-
#define SQLITE_SOURCE_ID "2022-07-13 19:41:41 7c16541a0efb3985578181171c9f2bb3fdc4bad6a2ec85c6e31ab96f3eff201f"
455+
#define SQLITE_VERSION "3.39.2"
456+
#define SQLITE_VERSION_NUMBER 3039002
457+
#define SQLITE_SOURCE_ID "2022-07-21 15:24:47 698edb77537b67c41adc68f9b892db56bcf9a55e00371a61420f3ddd668e6603"
458458

459459
/*
460460
** CAPI3REF: Run-Time Library Version Numbers
@@ -30430,8 +30430,8 @@ SQLITE_API void sqlite3_str_vappendf(
3043030430
case etSQLESCAPE: /* %q: Escape ' characters */
3043130431
case etSQLESCAPE2: /* %Q: Escape ' and enclose in '...' */
3043230432
case etSQLESCAPE3: { /* %w: Escape " characters */
30433-
int i, j, k, n, isnull;
30434-
int needQuote;
30433+
i64 i, j, k, n;
30434+
int needQuote, isnull;
3043530435
char ch;
3043630436
char q = ((xtype==etSQLESCAPE3)?'"':'\''); /* Quote character */
3043730437
char *escarg;
@@ -31119,8 +31119,8 @@ SQLITE_PRIVATE void sqlite3TreeViewColumnList(
3111931119
sqlite3TreeViewLine(pView, "COLUMNS");
3112031120
for(i=0; i<nCol; i++){
3112131121
u16 flg = aCol[i].colFlags;
31122-
int moreToFollow = i<(nCol - 1);
31123-
sqlite3TreeViewPush(&pView, moreToFollow);
31122+
int colMoreToFollow = i<(nCol - 1);
31123+
sqlite3TreeViewPush(&pView, colMoreToFollow);
3112431124
sqlite3TreeViewLine(pView, 0);
3112531125
printf(" %s", aCol[i].zCnName);
3112631126
switch( aCol[i].eCType ){
@@ -31251,7 +31251,7 @@ SQLITE_PRIVATE void sqlite3TreeViewSrcList(TreeView *pView, const SrcList *pSrc)
3125131251
Table *pTab = pItem->pTab;
3125231252
sqlite3TreeViewColumnList(pView, pTab->aCol, pTab->nCol, 1);
3125331253
}
31254-
assert( pItem->fg.isNestedFrom == IsNestedFrom(pItem->pSelect) );
31254+
assert( (int)pItem->fg.isNestedFrom == IsNestedFrom(pItem->pSelect) );
3125531255
sqlite3TreeViewSelect(pView, pItem->pSelect, (--n)>0);
3125631256
}
3125731257
if( pItem->fg.isTabFunc ){
@@ -101540,33 +101540,23 @@ static void resolveAlias(
101540101540
sqlite3ExprDelete(db, pDup);
101541101541
pDup = 0;
101542101542
}else{
101543+
Expr temp;
101543101544
incrAggFunctionDepth(pDup, nSubquery);
101544101545
if( pExpr->op==TK_COLLATE ){
101545101546
assert( !ExprHasProperty(pExpr, EP_IntValue) );
101546101547
pDup = sqlite3ExprAddCollateString(pParse, pDup, pExpr->u.zToken);
101547101548
}
101548-
101549-
/* Before calling sqlite3ExprDelete(), set the EP_Static flag. This
101550-
** prevents ExprDelete() from deleting the Expr structure itself,
101551-
** allowing it to be repopulated by the memcpy() on the following line.
101552-
** The pExpr->u.zToken might point into memory that will be freed by the
101553-
** sqlite3DbFree(db, pDup) on the last line of this block, so be sure to
101554-
** make a copy of the token before doing the sqlite3DbFree().
101555-
*/
101556-
ExprSetProperty(pExpr, EP_Static);
101557-
sqlite3ExprDelete(db, pExpr);
101558-
memcpy(pExpr, pDup, sizeof(*pExpr));
101559-
if( !ExprHasProperty(pExpr, EP_IntValue) && pExpr->u.zToken!=0 ){
101560-
assert( (pExpr->flags & (EP_Reduced|EP_TokenOnly))==0 );
101561-
pExpr->u.zToken = sqlite3DbStrDup(db, pExpr->u.zToken);
101562-
pExpr->flags |= EP_MemToken;
101563-
}
101549+
memcpy(&temp, pDup, sizeof(Expr));
101550+
memcpy(pDup, pExpr, sizeof(Expr));
101551+
memcpy(pExpr, &temp, sizeof(Expr));
101564101552
if( ExprHasProperty(pExpr, EP_WinFunc) ){
101565101553
if( ALWAYS(pExpr->y.pWin!=0) ){
101566101554
pExpr->y.pWin->pOwner = pExpr;
101567101555
}
101568101556
}
101569-
sqlite3DbFree(db, pDup);
101557+
sqlite3ParserAddCleanup(pParse,
101558+
(void(*)(sqlite3*,void*))sqlite3ExprDelete,
101559+
pDup);
101570101560
}
101571101561
}
101572101562

@@ -101769,7 +101759,7 @@ static int lookupName(
101769101759
pTab = pItem->pTab;
101770101760
assert( pTab!=0 && pTab->zName!=0 );
101771101761
assert( pTab->nCol>0 || pParse->nErr );
101772-
assert( pItem->fg.isNestedFrom == IsNestedFrom(pItem->pSelect) );
101762+
assert( (int)pItem->fg.isNestedFrom == IsNestedFrom(pItem->pSelect) );
101773101763
if( pItem->fg.isNestedFrom ){
101774101764
/* In this case, pItem is a subquery that has been formed from a
101775101765
** parenthesized subset of the FROM clause terms. Example:
@@ -135859,7 +135849,7 @@ SQLITE_PRIVATE int sqlite3ColumnIndex(Table *pTab, const char *zCol){
135859135849
*/
135860135850
SQLITE_PRIVATE void sqlite3SrcItemColumnUsed(SrcItem *pItem, int iCol){
135861135851
assert( pItem!=0 );
135862-
assert( pItem->fg.isNestedFrom == IsNestedFrom(pItem->pSelect) );
135852+
assert( (int)pItem->fg.isNestedFrom == IsNestedFrom(pItem->pSelect) );
135863135853
if( pItem->fg.isNestedFrom ){
135864135854
ExprList *pResults;
135865135855
assert( pItem->pSelect!=0 );
@@ -141446,7 +141436,7 @@ static int selectExpander(Walker *pWalker, Select *p){
141446141436
zTabName = pTab->zName;
141447141437
}
141448141438
if( db->mallocFailed ) break;
141449-
assert( pFrom->fg.isNestedFrom == IsNestedFrom(pFrom->pSelect) );
141439+
assert( (int)pFrom->fg.isNestedFrom == IsNestedFrom(pFrom->pSelect) );
141450141440
if( pFrom->fg.isNestedFrom ){
141451141441
assert( pFrom->pSelect!=0 );
141452141442
pNestedFrom = pFrom->pSelect->pEList;
@@ -142375,7 +142365,9 @@ SQLITE_PRIVATE int sqlite3Select(
142375142365
){
142376142366
SELECTTRACE(0x100,pParse,p,
142377142367
("omit superfluous ORDER BY on %r FROM-clause subquery\n",i+1));
142378-
sqlite3ExprListDelete(db, pSub->pOrderBy);
142368+
sqlite3ParserAddCleanup(pParse,
142369+
(void(*)(sqlite3*,void*))sqlite3ExprListDelete,
142370+
pSub->pOrderBy);
142379142371
pSub->pOrderBy = 0;
142380142372
}
142381142373

@@ -155375,7 +155367,7 @@ static int whereKeyStats(
155375155367
#endif
155376155368
assert( pRec!=0 );
155377155369
assert( pIdx->nSample>0 );
155378-
assert( pRec->nField>0 && pRec->nField<=pIdx->nSampleCol );
155370+
assert( pRec->nField>0 );
155379155371

155380155372
/* Do a binary search to find the first sample greater than or equal
155381155373
** to pRec. If pRec contains a single field, the set of samples to search
@@ -155421,7 +155413,7 @@ static int whereKeyStats(
155421155413
** it is extended to two fields. The duplicates that this creates do not
155422155414
** cause any problems.
155423155415
*/
155424-
nField = pRec->nField;
155416+
nField = MIN(pRec->nField, pIdx->nSample);
155425155417
iCol = 0;
155426155418
iSample = pIdx->nSample * nField;
155427155419
do{
@@ -158110,6 +158102,7 @@ static int whereLoopAddAll(WhereLoopBuilder *pBuilder){
158110158102
sqlite3 *db = pWInfo->pParse->db;
158111158103
int rc = SQLITE_OK;
158112158104
int bFirstPastRJ = 0;
158105+
int hasRightJoin = 0;
158113158106
WhereLoop *pNew;
158114158107

158115158108

@@ -158130,15 +158123,16 @@ static int whereLoopAddAll(WhereLoopBuilder *pBuilder){
158130158123
** prevents the right operand of a RIGHT JOIN from being swapped with
158131158124
** other elements even further to the right.
158132158125
**
158133-
** The JT_LTORJ term prevents any FROM-clause term reordering for terms
158134-
** to the left of a RIGHT JOIN. This is conservative. Relaxing this
158135-
** constraint somewhat to prevent terms from crossing from the right
158136-
** side of a LEFT JOIN over to the left side when they are on the
158137-
** left side of a RIGHT JOIN would be sufficient for all known failure
158138-
** cases. FIX ME: Implement this optimization.
158126+
** The JT_LTORJ case and the hasRightJoin flag work together to
158127+
** prevent FROM-clause terms from moving from the right side of
158128+
** a LEFT JOIN over to the left side of that join if the LEFT JOIN
158129+
** is itself on the left side of a RIGHT JOIN.
158139158130
*/
158131+
if( pItem->fg.jointype & JT_LTORJ ) hasRightJoin = 1;
158140158132
mPrereq |= mPrior;
158141158133
bFirstPastRJ = (pItem->fg.jointype & JT_RIGHT)!=0;
158134+
}else if( !hasRightJoin ){
158135+
mPrereq = 0;
158142158136
}
158143158137
#ifndef SQLITE_OMIT_VIRTUALTABLE
158144158138
if( IsVirtual(pItem->pTab) ){
@@ -181058,8 +181052,7 @@ static int fts3EvalDeferredPhrase(Fts3Cursor *pCsr, Fts3Phrase *pPhrase){
181058181052
char *aPoslist = 0; /* Position list for deferred tokens */
181059181053
int nPoslist = 0; /* Number of bytes in aPoslist */
181060181054
int iPrev = -1; /* Token number of previous deferred token */
181061-
181062-
assert( pPhrase->doclist.bFreeList==0 );
181055+
char *aFree = (pPhrase->doclist.bFreeList ? pPhrase->doclist.pList : 0);
181063181056

181064181057
for(iToken=0; iToken<pPhrase->nToken; iToken++){
181065181058
Fts3PhraseToken *pToken = &pPhrase->aToken[iToken];
@@ -181073,6 +181066,7 @@ static int fts3EvalDeferredPhrase(Fts3Cursor *pCsr, Fts3Phrase *pPhrase){
181073181066

181074181067
if( pList==0 ){
181075181068
sqlite3_free(aPoslist);
181069+
sqlite3_free(aFree);
181076181070
pPhrase->doclist.pList = 0;
181077181071
pPhrase->doclist.nList = 0;
181078181072
return SQLITE_OK;
@@ -181093,6 +181087,7 @@ static int fts3EvalDeferredPhrase(Fts3Cursor *pCsr, Fts3Phrase *pPhrase){
181093181087
nPoslist = (int)(aOut - aPoslist);
181094181088
if( nPoslist==0 ){
181095181089
sqlite3_free(aPoslist);
181090+
sqlite3_free(aFree);
181096181091
pPhrase->doclist.pList = 0;
181097181092
pPhrase->doclist.nList = 0;
181098181093
return SQLITE_OK;
@@ -181145,6 +181140,7 @@ static int fts3EvalDeferredPhrase(Fts3Cursor *pCsr, Fts3Phrase *pPhrase){
181145181140
}
181146181141
}
181147181142

181143+
if( pPhrase->doclist.pList!=aFree ) sqlite3_free(aFree);
181148181144
return SQLITE_OK;
181149181145
}
181150181146
#endif /* SQLITE_DISABLE_FTS4_DEFERRED */
@@ -182323,7 +182319,6 @@ static int fts3EvalTestExpr(
182323182319
pExpr->iDocid==pCsr->iPrevId && pExpr->pPhrase->doclist.pList
182324182320
))){
182325182321
Fts3Phrase *pPhrase = pExpr->pPhrase;
182326-
assert( pExpr->bDeferred || pPhrase->doclist.bFreeList==0 );
182327182322
if( pExpr->bDeferred ){
182328182323
fts3EvalInvalidatePoslist(pPhrase);
182329182324
}
@@ -236641,7 +236636,7 @@ static void fts5SourceIdFunc(
236641236636
){
236642236637
assert( nArg==0 );
236643236638
UNUSED_PARAM2(nArg, apUnused);
236644-
sqlite3_result_text(pCtx, "fts5: 2022-07-13 19:41:41 7c16541a0efb3985578181171c9f2bb3fdc4bad6a2ec85c6e31ab96f3eff201f", -1, SQLITE_TRANSIENT);
236639+
sqlite3_result_text(pCtx, "fts5: 2022-07-21 15:24:47 698edb77537b67c41adc68f9b892db56bcf9a55e00371a61420f3ddd668e6603", -1, SQLITE_TRANSIENT);
236645236640
}
236646236641

236647236642
/*

src/sqlite3.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,9 @@ extern "C" {
146146
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
147147
** [sqlite_version()] and [sqlite_source_id()].
148148
*/
149-
#define SQLITE_VERSION "3.39.1"
150-
#define SQLITE_VERSION_NUMBER 3039001
151-
#define SQLITE_SOURCE_ID "2022-07-13 19:41:41 7c16541a0efb3985578181171c9f2bb3fdc4bad6a2ec85c6e31ab96f3eff201f"
149+
#define SQLITE_VERSION "3.39.2"
150+
#define SQLITE_VERSION_NUMBER 3039002
151+
#define SQLITE_SOURCE_ID "2022-07-21 15:24:47 698edb77537b67c41adc68f9b892db56bcf9a55e00371a61420f3ddd668e6603"
152152

153153
/*
154154
** CAPI3REF: Run-Time Library Version Numbers

src/sqlite3mc_version.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414

1515
#define SQLITE3MC_VERSION_MAJOR 1
1616
#define SQLITE3MC_VERSION_MINOR 4
17-
#define SQLITE3MC_VERSION_RELEASE 6
17+
#define SQLITE3MC_VERSION_RELEASE 7
1818
#define SQLITE3MC_VERSION_SUBRELEASE 0
19-
#define SQLITE3MC_VERSION_STRING "SQLite3 Multiple Ciphers 1.4.6"
19+
#define SQLITE3MC_VERSION_STRING "SQLite3 Multiple Ciphers 1.4.7"
2020

2121
#endif /* SQLITE3MC_VERSION_H_ */

0 commit comments

Comments
 (0)