better-sqlite3-multiple-ciphers 7.5.3 → 7.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/deps/setup.ps1 +1 -1
- package/deps/sqlite3/sqlite3.c +145 -73
- package/deps/sqlite3/sqlite3.h +6 -6
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -17,10 +17,10 @@ The fastest and simplest library for SQLite3 in Node.js. This particular fork su
|
|
|
17
17
|
## Current versions
|
|
18
18
|
|
|
19
19
|
- ### Stable
|
|
20
|
-
- **better-sqlite3-multiple-ciphers** - [`7.
|
|
21
|
-
- **better-sqlite3** - [`7.
|
|
22
|
-
- **SQLite** - [`3.39.
|
|
23
|
-
- **SQLite3 Multiple Ciphers** - [`1.4.
|
|
20
|
+
- **better-sqlite3-multiple-ciphers** - [`7.6.2`](https://github.com/m4heshd/better-sqlite3-multiple-ciphers/releases/tag/v7.6.2)
|
|
21
|
+
- **better-sqlite3** - [`7.6.2`](https://github.com/JoshuaWise/better-sqlite3/releases/tag/v7.6.2)
|
|
22
|
+
- **SQLite** - [`3.39.1`](https://www.sqlite.org/releaselog/3_39_1.html)
|
|
23
|
+
- **SQLite3 Multiple Ciphers** - [`1.4.6`](https://github.com/utelle/SQLite3MultipleCiphers/releases/tag/v1.4.6)
|
|
24
24
|
|
|
25
25
|
- ### Beta
|
|
26
26
|
- **better-sqlite3-multiple-ciphers** - [`7.5.2-beta.3`](https://github.com/m4heshd/better-sqlite3-multiple-ciphers/releases/tag/v7.5.2-beta.3)
|
package/deps/setup.ps1
CHANGED
package/deps/sqlite3/sqlite3.c
CHANGED
|
@@ -92,7 +92,7 @@ extern SQLITE_API LPWSTR sqlite3_win32_utf8_to_unicode(const char*);
|
|
|
92
92
|
/*** Begin of #include "sqlite3patched.c" ***/
|
|
93
93
|
/******************************************************************************
|
|
94
94
|
** This file is an amalgamation of many separate C source files from SQLite
|
|
95
|
-
** version 3.39.
|
|
95
|
+
** version 3.39.1. By combining all the individual C code files into this
|
|
96
96
|
** single large file, the entire code can be compiled as a single translation
|
|
97
97
|
** unit. This allows many compilers to do optimizations that would not be
|
|
98
98
|
** possible if the files were compiled separately. Performance improvements
|
|
@@ -544,9 +544,9 @@ extern "C" {
|
|
|
544
544
|
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
|
|
545
545
|
** [sqlite_version()] and [sqlite_source_id()].
|
|
546
546
|
*/
|
|
547
|
-
#define SQLITE_VERSION "3.39.
|
|
548
|
-
#define SQLITE_VERSION_NUMBER
|
|
549
|
-
#define SQLITE_SOURCE_ID "2022-
|
|
547
|
+
#define SQLITE_VERSION "3.39.1"
|
|
548
|
+
#define SQLITE_VERSION_NUMBER 3039001
|
|
549
|
+
#define SQLITE_SOURCE_ID "2022-07-13 19:41:41 7c16541a0efb3985578181171c9f2bb3fdc4bad6a2ec85c6e31ab96f3eff201f"
|
|
550
550
|
|
|
551
551
|
/*
|
|
552
552
|
** CAPI3REF: Run-Time Library Version Numbers
|
|
@@ -6680,7 +6680,7 @@ SQLITE_API sqlite3 *sqlite3_db_handle(sqlite3_stmt*);
|
|
|
6680
6680
|
**
|
|
6681
6681
|
** ^The sqlite3_db_name(D,N) interface returns a pointer to the schema name
|
|
6682
6682
|
** for the N-th database on database connection D, or a NULL pointer of N is
|
|
6683
|
-
** out of range. An N
|
|
6683
|
+
** out of range. An N value of 0 means the main database file. An N of 1 is
|
|
6684
6684
|
** the "temp" schema. Larger values of N correspond to various ATTACH-ed
|
|
6685
6685
|
** databases.
|
|
6686
6686
|
**
|
|
@@ -19878,6 +19878,7 @@ SQLITE_PRIVATE void sqlite3TreeViewSrcList(TreeView*, const SrcList*);
|
|
|
19878
19878
|
SQLITE_PRIVATE void sqlite3TreeViewSelect(TreeView*, const Select*, u8);
|
|
19879
19879
|
SQLITE_PRIVATE void sqlite3TreeViewWith(TreeView*, const With*, u8);
|
|
19880
19880
|
SQLITE_PRIVATE void sqlite3TreeViewUpsert(TreeView*, const Upsert*, u8);
|
|
19881
|
+
#if TREETRACE_ENABLED
|
|
19881
19882
|
SQLITE_PRIVATE void sqlite3TreeViewDelete(const With*, const SrcList*, const Expr*,
|
|
19882
19883
|
const ExprList*,const Expr*, const Trigger*);
|
|
19883
19884
|
SQLITE_PRIVATE void sqlite3TreeViewInsert(const With*, const SrcList*,
|
|
@@ -19886,6 +19887,7 @@ SQLITE_PRIVATE void sqlite3TreeViewInsert(const With*, const SrcList*,
|
|
|
19886
19887
|
SQLITE_PRIVATE void sqlite3TreeViewUpdate(const With*, const SrcList*, const ExprList*,
|
|
19887
19888
|
const Expr*, int, const ExprList*, const Expr*,
|
|
19888
19889
|
const Upsert*, const Trigger*);
|
|
19890
|
+
#endif
|
|
19889
19891
|
#ifndef SQLITE_OMIT_TRIGGER
|
|
19890
19892
|
SQLITE_PRIVATE void sqlite3TreeViewTriggerStep(TreeView*, const TriggerStep*, u8, u8);
|
|
19891
19893
|
SQLITE_PRIVATE void sqlite3TreeViewTrigger(TreeView*, const Trigger*, u8, u8);
|
|
@@ -32115,6 +32117,7 @@ SQLITE_PRIVATE void sqlite3TreeViewUpsert(
|
|
|
32115
32117
|
sqlite3TreeViewPop(&pView);
|
|
32116
32118
|
}
|
|
32117
32119
|
|
|
32120
|
+
#if TREETRACE_ENABLED
|
|
32118
32121
|
/*
|
|
32119
32122
|
** Generate a human-readable diagram of the data structure that go
|
|
32120
32123
|
** into generating an DELETE statement.
|
|
@@ -32168,7 +32171,9 @@ SQLITE_PRIVATE void sqlite3TreeViewDelete(
|
|
|
32168
32171
|
}
|
|
32169
32172
|
sqlite3TreeViewPop(&pView);
|
|
32170
32173
|
}
|
|
32174
|
+
#endif /* TREETRACE_ENABLED */
|
|
32171
32175
|
|
|
32176
|
+
#if TREETRACE_ENABLED
|
|
32172
32177
|
/*
|
|
32173
32178
|
** Generate a human-readable diagram of the data structure that go
|
|
32174
32179
|
** into generating an INSERT statement.
|
|
@@ -32236,7 +32241,9 @@ SQLITE_PRIVATE void sqlite3TreeViewInsert(
|
|
|
32236
32241
|
}
|
|
32237
32242
|
sqlite3TreeViewPop(&pView);
|
|
32238
32243
|
}
|
|
32244
|
+
#endif /* TREETRACE_ENABLED */
|
|
32239
32245
|
|
|
32246
|
+
#if TREETRACE_ENABLED
|
|
32240
32247
|
/*
|
|
32241
32248
|
** Generate a human-readable diagram of the data structure that go
|
|
32242
32249
|
** into generating an UPDATE statement.
|
|
@@ -32312,6 +32319,7 @@ SQLITE_PRIVATE void sqlite3TreeViewUpdate(
|
|
|
32312
32319
|
}
|
|
32313
32320
|
sqlite3TreeViewPop(&pView);
|
|
32314
32321
|
}
|
|
32322
|
+
#endif /* TREETRACE_ENABLED */
|
|
32315
32323
|
|
|
32316
32324
|
#ifndef SQLITE_OMIT_TRIGGER
|
|
32317
32325
|
/*
|
|
@@ -115555,8 +115563,6 @@ SQLITE_PRIVATE void sqlite3NestedParse(Parse *pParse, const char *zFormat, ...){
|
|
|
115555
115563
|
memset(PARSE_TAIL(pParse), 0, PARSE_TAIL_SZ);
|
|
115556
115564
|
db->mDbFlags |= DBFLAG_PreferBuiltin;
|
|
115557
115565
|
sqlite3RunParser(pParse, zSql);
|
|
115558
|
-
sqlite3DbFree(db, pParse->zErrMsg);
|
|
115559
|
-
pParse->zErrMsg = 0;
|
|
115560
115566
|
db->mDbFlags = savedDbFlags;
|
|
115561
115567
|
sqlite3DbFree(db, zSql);
|
|
115562
115568
|
memcpy(PARSE_TAIL(pParse), saveBuf, PARSE_TAIL_SZ);
|
|
@@ -139755,6 +139761,9 @@ static void renumberCursors(
|
|
|
139755
139761
|
** (17d2) DISTINCT
|
|
139756
139762
|
** (17e) the subquery may not contain window functions, and
|
|
139757
139763
|
** (17f) the subquery must not be the RHS of a LEFT JOIN.
|
|
139764
|
+
** (17g) either the subquery is the first element of the outer
|
|
139765
|
+
** query or there are no RIGHT or FULL JOINs in any arm
|
|
139766
|
+
** of the subquery. (This is a duplicate of condition (27b).)
|
|
139758
139767
|
**
|
|
139759
139768
|
** The parent and sub-query may contain WHERE clauses. Subject to
|
|
139760
139769
|
** rules (11), (13) and (14), they may also contain ORDER BY,
|
|
@@ -139806,7 +139815,11 @@ static void renumberCursors(
|
|
|
139806
139815
|
** See also (3) for restrictions on LEFT JOIN.
|
|
139807
139816
|
**
|
|
139808
139817
|
** (27) The subquery may not contain a FULL or RIGHT JOIN unless it
|
|
139809
|
-
** is the first element of the parent query.
|
|
139818
|
+
** is the first element of the parent query. This must be the
|
|
139819
|
+
** the case if:
|
|
139820
|
+
** (27a) the subquery is not compound query, and
|
|
139821
|
+
** (27b) the subquery is a compound query and the RIGHT JOIN occurs
|
|
139822
|
+
** in any arm of the compound query. (See also (17g).)
|
|
139810
139823
|
**
|
|
139811
139824
|
** (28) The subquery is not a MATERIALIZED CTE.
|
|
139812
139825
|
**
|
|
@@ -139936,7 +139949,7 @@ static int flattenSubquery(
|
|
|
139936
139949
|
|
|
139937
139950
|
assert( pSubSrc->nSrc>0 ); /* True by restriction (7) */
|
|
139938
139951
|
if( iFrom>0 && (pSubSrc->a[0].fg.jointype & JT_LTORJ)!=0 ){
|
|
139939
|
-
return 0; /* Restriction (
|
|
139952
|
+
return 0; /* Restriction (27a) */
|
|
139940
139953
|
}
|
|
139941
139954
|
if( pSubitem->fg.isCte && pSubitem->u2.pCteUse->eM10d==M10d_Yes ){
|
|
139942
139955
|
return 0; /* (28) */
|
|
@@ -139956,7 +139969,7 @@ static int flattenSubquery(
|
|
|
139956
139969
|
** NATURAL join or a join that as an ON or USING clause.
|
|
139957
139970
|
**
|
|
139958
139971
|
** These conditions are sufficient to keep an EP_OuterON from being
|
|
139959
|
-
** flattened into an EP_InnerON. Restrictions (3a) and (
|
|
139972
|
+
** flattened into an EP_InnerON. Restrictions (3a) and (27a) prevent
|
|
139960
139973
|
** an EP_InnerON from being flattened into an EP_OuterON.
|
|
139961
139974
|
*/
|
|
139962
139975
|
if( pSubSrc->nSrc>=2
|
|
@@ -139998,6 +140011,12 @@ static int flattenSubquery(
|
|
|
139998
140011
|
){
|
|
139999
140012
|
return 0;
|
|
140000
140013
|
}
|
|
140014
|
+
if( iFrom>0 && (pSub1->pSrc->a[0].fg.jointype & JT_LTORJ)!=0 ){
|
|
140015
|
+
/* Without this restriction, the JT_LTORJ flag would end up being
|
|
140016
|
+
** omitted on left-hand tables of the right join that is being
|
|
140017
|
+
** flattened. */
|
|
140018
|
+
return 0; /* Restrictions (17g), (27b) */
|
|
140019
|
+
}
|
|
140001
140020
|
testcase( pSub1->pSrc->nSrc>1 );
|
|
140002
140021
|
}
|
|
140003
140022
|
|
|
@@ -170064,6 +170083,7 @@ SQLITE_PRIVATE int sqlite3RunParser(Parse *pParse, const char *zSql){
|
|
|
170064
170083
|
mxSqlLen -= n;
|
|
170065
170084
|
if( mxSqlLen<0 ){
|
|
170066
170085
|
pParse->rc = SQLITE_TOOBIG;
|
|
170086
|
+
pParse->nErr++;
|
|
170067
170087
|
break;
|
|
170068
170088
|
}
|
|
170069
170089
|
#ifndef SQLITE_OMIT_WINDOWFUNC
|
|
@@ -174809,8 +174829,11 @@ SQLITE_API int sqlite3_test_control(int op, ...){
|
|
|
174809
174829
|
sqlite3ShowTriggerStepList(0);
|
|
174810
174830
|
sqlite3ShowTrigger(0);
|
|
174811
174831
|
sqlite3ShowTriggerList(0);
|
|
174832
|
+
#ifndef SQLITE_OMIT_WINDOWFUNC
|
|
174812
174833
|
sqlite3ShowWindow(0);
|
|
174813
174834
|
sqlite3ShowWinFunc(0);
|
|
174835
|
+
#endif
|
|
174836
|
+
sqlite3ShowSelect(0);
|
|
174814
174837
|
}
|
|
174815
174838
|
#endif
|
|
174816
174839
|
break;
|
|
@@ -181218,6 +181241,7 @@ static int fts3EvalDeferredPhrase(Fts3Cursor *pCsr, Fts3Phrase *pPhrase){
|
|
|
181218
181241
|
}
|
|
181219
181242
|
|
|
181220
181243
|
pPhrase->doclist.pList = aOut;
|
|
181244
|
+
assert( p1 && p2 );
|
|
181221
181245
|
if( fts3PoslistPhraseMerge(&aOut, nDistance, 0, 1, &p1, &p2) ){
|
|
181222
181246
|
pPhrase->doclist.bFreeList = 1;
|
|
181223
181247
|
pPhrase->doclist.nList = (int)(aOut - pPhrase->doclist.pList);
|
|
@@ -182404,9 +182428,9 @@ static int fts3EvalTestExpr(
|
|
|
182404
182428
|
|
|
182405
182429
|
default: {
|
|
182406
182430
|
#ifndef SQLITE_DISABLE_FTS4_DEFERRED
|
|
182407
|
-
if( pCsr->pDeferred
|
|
182408
|
-
|
|
182409
|
-
){
|
|
182431
|
+
if( pCsr->pDeferred && (pExpr->bDeferred || (
|
|
182432
|
+
pExpr->iDocid==pCsr->iPrevId && pExpr->pPhrase->doclist.pList
|
|
182433
|
+
))){
|
|
182410
182434
|
Fts3Phrase *pPhrase = pExpr->pPhrase;
|
|
182411
182435
|
assert( pExpr->bDeferred || pPhrase->doclist.bFreeList==0 );
|
|
182412
182436
|
if( pExpr->bDeferred ){
|
|
@@ -236726,7 +236750,7 @@ static void fts5SourceIdFunc(
|
|
|
236726
236750
|
){
|
|
236727
236751
|
assert( nArg==0 );
|
|
236728
236752
|
UNUSED_PARAM2(nArg, apUnused);
|
|
236729
|
-
sqlite3_result_text(pCtx, "fts5: 2022-
|
|
236753
|
+
sqlite3_result_text(pCtx, "fts5: 2022-07-13 19:41:41 7c16541a0efb3985578181171c9f2bb3fdc4bad6a2ec85c6e31ab96f3eff201f", -1, SQLITE_TRANSIENT);
|
|
236730
236754
|
}
|
|
236731
236755
|
|
|
236732
236756
|
/*
|
|
@@ -241397,6 +241421,16 @@ SQLITE_EXTENSION_INIT1
|
|
|
241397
241421
|
|
|
241398
241422
|
#ifndef SQLITE_OMIT_VIRTUALTABLE
|
|
241399
241423
|
|
|
241424
|
+
|
|
241425
|
+
#define STMT_NUM_INTEGER_COLUMN 10
|
|
241426
|
+
typedef struct StmtRow StmtRow;
|
|
241427
|
+
struct StmtRow {
|
|
241428
|
+
sqlite3_int64 iRowid; /* Rowid value */
|
|
241429
|
+
char *zSql; /* column "sql" */
|
|
241430
|
+
int aCol[STMT_NUM_INTEGER_COLUMN+1]; /* all other column values */
|
|
241431
|
+
StmtRow *pNext; /* Next row to return */
|
|
241432
|
+
};
|
|
241433
|
+
|
|
241400
241434
|
/* stmt_vtab is a subclass of sqlite3_vtab which will
|
|
241401
241435
|
** serve as the underlying representation of a stmt virtual table
|
|
241402
241436
|
*/
|
|
@@ -241414,8 +241448,7 @@ typedef struct stmt_cursor stmt_cursor;
|
|
|
241414
241448
|
struct stmt_cursor {
|
|
241415
241449
|
sqlite3_vtab_cursor base; /* Base class - must be first */
|
|
241416
241450
|
sqlite3 *db; /* Database connection for this cursor */
|
|
241417
|
-
|
|
241418
|
-
sqlite3_int64 iRowid; /* The rowid */
|
|
241451
|
+
StmtRow *pRow; /* Current row */
|
|
241419
241452
|
};
|
|
241420
241453
|
|
|
241421
241454
|
/*
|
|
@@ -241459,7 +241492,7 @@ static int stmtConnect(
|
|
|
241459
241492
|
"CREATE TABLE x(sql,ncol,ro,busy,nscan,nsort,naidx,nstep,"
|
|
241460
241493
|
"reprep,run,mem)");
|
|
241461
241494
|
if( rc==SQLITE_OK ){
|
|
241462
|
-
pNew =
|
|
241495
|
+
pNew = sqlite3_malloc64( sizeof(*pNew) );
|
|
241463
241496
|
*ppVtab = (sqlite3_vtab*)pNew;
|
|
241464
241497
|
if( pNew==0 ) return SQLITE_NOMEM;
|
|
241465
241498
|
memset(pNew, 0, sizeof(*pNew));
|
|
@@ -241481,7 +241514,7 @@ static int stmtDisconnect(sqlite3_vtab *pVtab){
|
|
|
241481
241514
|
*/
|
|
241482
241515
|
static int stmtOpen(sqlite3_vtab *p, sqlite3_vtab_cursor **ppCursor){
|
|
241483
241516
|
stmt_cursor *pCur;
|
|
241484
|
-
pCur =
|
|
241517
|
+
pCur = sqlite3_malloc64( sizeof(*pCur) );
|
|
241485
241518
|
if( pCur==0 ) return SQLITE_NOMEM;
|
|
241486
241519
|
memset(pCur, 0, sizeof(*pCur));
|
|
241487
241520
|
pCur->db = ((stmt_vtab*)p)->db;
|
|
@@ -241489,10 +241522,21 @@ static int stmtOpen(sqlite3_vtab *p, sqlite3_vtab_cursor **ppCursor){
|
|
|
241489
241522
|
return SQLITE_OK;
|
|
241490
241523
|
}
|
|
241491
241524
|
|
|
241525
|
+
static void stmtCsrReset(stmt_cursor *pCur){
|
|
241526
|
+
StmtRow *pRow = 0;
|
|
241527
|
+
StmtRow *pNext = 0;
|
|
241528
|
+
for(pRow=pCur->pRow; pRow; pRow=pNext){
|
|
241529
|
+
pNext = pRow->pNext;
|
|
241530
|
+
sqlite3_free(pRow);
|
|
241531
|
+
}
|
|
241532
|
+
pCur->pRow = 0;
|
|
241533
|
+
}
|
|
241534
|
+
|
|
241492
241535
|
/*
|
|
241493
241536
|
** Destructor for a stmt_cursor.
|
|
241494
241537
|
*/
|
|
241495
241538
|
static int stmtClose(sqlite3_vtab_cursor *cur){
|
|
241539
|
+
stmtCsrReset((stmt_cursor*)cur);
|
|
241496
241540
|
sqlite3_free(cur);
|
|
241497
241541
|
return SQLITE_OK;
|
|
241498
241542
|
}
|
|
@@ -241503,8 +241547,9 @@ static int stmtClose(sqlite3_vtab_cursor *cur){
|
|
|
241503
241547
|
*/
|
|
241504
241548
|
static int stmtNext(sqlite3_vtab_cursor *cur){
|
|
241505
241549
|
stmt_cursor *pCur = (stmt_cursor*)cur;
|
|
241506
|
-
pCur->
|
|
241507
|
-
|
|
241550
|
+
StmtRow *pNext = pCur->pRow->pNext;
|
|
241551
|
+
sqlite3_free(pCur->pRow);
|
|
241552
|
+
pCur->pRow = pNext;
|
|
241508
241553
|
return SQLITE_OK;
|
|
241509
241554
|
}
|
|
241510
241555
|
|
|
@@ -241518,39 +241563,11 @@ static int stmtColumn(
|
|
|
241518
241563
|
int i /* Which column to return */
|
|
241519
241564
|
){
|
|
241520
241565
|
stmt_cursor *pCur = (stmt_cursor*)cur;
|
|
241521
|
-
|
|
241522
|
-
|
|
241523
|
-
|
|
241524
|
-
|
|
241525
|
-
|
|
241526
|
-
case STMT_COLUMN_NCOL: {
|
|
241527
|
-
sqlite3_result_int(ctx, sqlite3_column_count(pCur->pStmt));
|
|
241528
|
-
break;
|
|
241529
|
-
}
|
|
241530
|
-
case STMT_COLUMN_RO: {
|
|
241531
|
-
sqlite3_result_int(ctx, sqlite3_stmt_readonly(pCur->pStmt));
|
|
241532
|
-
break;
|
|
241533
|
-
}
|
|
241534
|
-
case STMT_COLUMN_BUSY: {
|
|
241535
|
-
sqlite3_result_int(ctx, sqlite3_stmt_busy(pCur->pStmt));
|
|
241536
|
-
break;
|
|
241537
|
-
}
|
|
241538
|
-
default: {
|
|
241539
|
-
assert( i==STMT_COLUMN_MEM );
|
|
241540
|
-
i = SQLITE_STMTSTATUS_MEMUSED +
|
|
241541
|
-
STMT_COLUMN_NSCAN - SQLITE_STMTSTATUS_FULLSCAN_STEP;
|
|
241542
|
-
/* Fall thru */
|
|
241543
|
-
}
|
|
241544
|
-
case STMT_COLUMN_NSCAN:
|
|
241545
|
-
case STMT_COLUMN_NSORT:
|
|
241546
|
-
case STMT_COLUMN_NAIDX:
|
|
241547
|
-
case STMT_COLUMN_NSTEP:
|
|
241548
|
-
case STMT_COLUMN_REPREP:
|
|
241549
|
-
case STMT_COLUMN_RUN: {
|
|
241550
|
-
sqlite3_result_int(ctx, sqlite3_stmt_status(pCur->pStmt,
|
|
241551
|
-
i-STMT_COLUMN_NSCAN+SQLITE_STMTSTATUS_FULLSCAN_STEP, 0));
|
|
241552
|
-
break;
|
|
241553
|
-
}
|
|
241566
|
+
StmtRow *pRow = pCur->pRow;
|
|
241567
|
+
if( i==STMT_COLUMN_SQL ){
|
|
241568
|
+
sqlite3_result_text(ctx, pRow->zSql, -1, SQLITE_TRANSIENT);
|
|
241569
|
+
}else{
|
|
241570
|
+
sqlite3_result_int(ctx, pRow->aCol[i]);
|
|
241554
241571
|
}
|
|
241555
241572
|
return SQLITE_OK;
|
|
241556
241573
|
}
|
|
@@ -241561,7 +241578,7 @@ static int stmtColumn(
|
|
|
241561
241578
|
*/
|
|
241562
241579
|
static int stmtRowid(sqlite3_vtab_cursor *cur, sqlite_int64 *pRowid){
|
|
241563
241580
|
stmt_cursor *pCur = (stmt_cursor*)cur;
|
|
241564
|
-
*pRowid = pCur->iRowid;
|
|
241581
|
+
*pRowid = pCur->pRow->iRowid;
|
|
241565
241582
|
return SQLITE_OK;
|
|
241566
241583
|
}
|
|
241567
241584
|
|
|
@@ -241571,7 +241588,7 @@ static int stmtRowid(sqlite3_vtab_cursor *cur, sqlite_int64 *pRowid){
|
|
|
241571
241588
|
*/
|
|
241572
241589
|
static int stmtEof(sqlite3_vtab_cursor *cur){
|
|
241573
241590
|
stmt_cursor *pCur = (stmt_cursor*)cur;
|
|
241574
|
-
return pCur->
|
|
241591
|
+
return pCur->pRow==0;
|
|
241575
241592
|
}
|
|
241576
241593
|
|
|
241577
241594
|
/*
|
|
@@ -241586,9 +241603,53 @@ static int stmtFilter(
|
|
|
241586
241603
|
int argc, sqlite3_value **argv
|
|
241587
241604
|
){
|
|
241588
241605
|
stmt_cursor *pCur = (stmt_cursor *)pVtabCursor;
|
|
241589
|
-
|
|
241590
|
-
|
|
241591
|
-
|
|
241606
|
+
sqlite3_stmt *p = 0;
|
|
241607
|
+
sqlite3_int64 iRowid = 1;
|
|
241608
|
+
StmtRow **ppRow = 0;
|
|
241609
|
+
|
|
241610
|
+
stmtCsrReset(pCur);
|
|
241611
|
+
ppRow = &pCur->pRow;
|
|
241612
|
+
for(p=sqlite3_next_stmt(pCur->db, 0); p; p=sqlite3_next_stmt(pCur->db, p)){
|
|
241613
|
+
const char *zSql = sqlite3_sql(p);
|
|
241614
|
+
sqlite3_int64 nSql = zSql ? strlen(zSql)+1 : 0;
|
|
241615
|
+
StmtRow *pNew = (StmtRow*)sqlite3_malloc64(sizeof(StmtRow) + nSql);
|
|
241616
|
+
|
|
241617
|
+
if( pNew==0 ) return SQLITE_NOMEM;
|
|
241618
|
+
memset(pNew, 0, sizeof(StmtRow));
|
|
241619
|
+
if( zSql ){
|
|
241620
|
+
pNew->zSql = (char*)&pNew[1];
|
|
241621
|
+
memcpy(pNew->zSql, zSql, nSql);
|
|
241622
|
+
}
|
|
241623
|
+
pNew->aCol[STMT_COLUMN_NCOL] = sqlite3_column_count(p);
|
|
241624
|
+
pNew->aCol[STMT_COLUMN_RO] = sqlite3_stmt_readonly(p);
|
|
241625
|
+
pNew->aCol[STMT_COLUMN_BUSY] = sqlite3_stmt_busy(p);
|
|
241626
|
+
pNew->aCol[STMT_COLUMN_NSCAN] = sqlite3_stmt_status(
|
|
241627
|
+
p, SQLITE_STMTSTATUS_FULLSCAN_STEP, 0
|
|
241628
|
+
);
|
|
241629
|
+
pNew->aCol[STMT_COLUMN_NSORT] = sqlite3_stmt_status(
|
|
241630
|
+
p, SQLITE_STMTSTATUS_SORT, 0
|
|
241631
|
+
);
|
|
241632
|
+
pNew->aCol[STMT_COLUMN_NAIDX] = sqlite3_stmt_status(
|
|
241633
|
+
p, SQLITE_STMTSTATUS_AUTOINDEX, 0
|
|
241634
|
+
);
|
|
241635
|
+
pNew->aCol[STMT_COLUMN_NSTEP] = sqlite3_stmt_status(
|
|
241636
|
+
p, SQLITE_STMTSTATUS_VM_STEP, 0
|
|
241637
|
+
);
|
|
241638
|
+
pNew->aCol[STMT_COLUMN_REPREP] = sqlite3_stmt_status(
|
|
241639
|
+
p, SQLITE_STMTSTATUS_REPREPARE, 0
|
|
241640
|
+
);
|
|
241641
|
+
pNew->aCol[STMT_COLUMN_RUN] = sqlite3_stmt_status(
|
|
241642
|
+
p, SQLITE_STMTSTATUS_RUN, 0
|
|
241643
|
+
);
|
|
241644
|
+
pNew->aCol[STMT_COLUMN_MEM] = sqlite3_stmt_status(
|
|
241645
|
+
p, SQLITE_STMTSTATUS_MEMUSED, 0
|
|
241646
|
+
);
|
|
241647
|
+
pNew->iRowid = iRowid++;
|
|
241648
|
+
*ppRow = pNew;
|
|
241649
|
+
ppRow = &pNew->pNext;
|
|
241650
|
+
}
|
|
241651
|
+
|
|
241652
|
+
return SQLITE_OK;
|
|
241592
241653
|
}
|
|
241593
241654
|
|
|
241594
241655
|
/*
|
|
@@ -241855,9 +241916,9 @@ SQLITE_API const char *sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; }
|
|
|
241855
241916
|
|
|
241856
241917
|
#define SQLITE3MC_VERSION_MAJOR 1
|
|
241857
241918
|
#define SQLITE3MC_VERSION_MINOR 4
|
|
241858
|
-
#define SQLITE3MC_VERSION_RELEASE
|
|
241919
|
+
#define SQLITE3MC_VERSION_RELEASE 6
|
|
241859
241920
|
#define SQLITE3MC_VERSION_SUBRELEASE 0
|
|
241860
|
-
#define SQLITE3MC_VERSION_STRING "SQLite3 Multiple Ciphers 1.4.
|
|
241921
|
+
#define SQLITE3MC_VERSION_STRING "SQLite3 Multiple Ciphers 1.4.6"
|
|
241861
241922
|
|
|
241862
241923
|
#endif /* SQLITE3MC_VERSION_H_ */
|
|
241863
241924
|
/*** End of #include "sqlite3mc_version.h" ***/
|
|
@@ -242016,9 +242077,9 @@ extern "C" {
|
|
|
242016
242077
|
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
|
|
242017
242078
|
** [sqlite_version()] and [sqlite_source_id()].
|
|
242018
242079
|
*/
|
|
242019
|
-
#define SQLITE_VERSION "3.39.
|
|
242020
|
-
#define SQLITE_VERSION_NUMBER
|
|
242021
|
-
#define SQLITE_SOURCE_ID "2022-
|
|
242080
|
+
#define SQLITE_VERSION "3.39.1"
|
|
242081
|
+
#define SQLITE_VERSION_NUMBER 3039001
|
|
242082
|
+
#define SQLITE_SOURCE_ID "2022-07-13 19:41:41 7c16541a0efb3985578181171c9f2bb3fdc4bad6a2ec85c6e31ab96f3eff201f"
|
|
242022
242083
|
|
|
242023
242084
|
/*
|
|
242024
242085
|
** CAPI3REF: Run-Time Library Version Numbers
|
|
@@ -248152,7 +248213,7 @@ SQLITE_API sqlite3 *sqlite3_db_handle(sqlite3_stmt*);
|
|
|
248152
248213
|
**
|
|
248153
248214
|
** ^The sqlite3_db_name(D,N) interface returns a pointer to the schema name
|
|
248154
248215
|
** for the N-th database on database connection D, or a NULL pointer of N is
|
|
248155
|
-
** out of range. An N
|
|
248216
|
+
** out of range. An N value of 0 means the main database file. An N of 1 is
|
|
248156
248217
|
** the "temp" schema. Larger values of N correspond to various ATTACH-ed
|
|
248157
248218
|
** databases.
|
|
248158
248219
|
**
|
|
@@ -264871,7 +264932,7 @@ sqlite3mcBtreeSetPageSize(Btree* p, int pageSize, int nReserve, int iFix)
|
|
|
264871
264932
|
** Change 4: Call sqlite3mcBtreeSetPageSize instead of sqlite3BtreeSetPageSize for main database
|
|
264872
264933
|
** (sqlite3mcBtreeSetPageSize allows to reduce the number of reserved bytes)
|
|
264873
264934
|
**
|
|
264874
|
-
** This code is generated by the script rekeyvacuum.sh from SQLite version 3.39.
|
|
264935
|
+
** This code is generated by the script rekeyvacuum.sh from SQLite version 3.39.1 amalgamation.
|
|
264875
264936
|
*/
|
|
264876
264937
|
SQLITE_PRIVATE SQLITE_NOINLINE int sqlite3mcRunVacuumForRekey(
|
|
264877
264938
|
char **pzErrMsg, /* Write error message here */
|
|
@@ -269975,6 +270036,7 @@ static char *vsv_read_one_field(VsvReader *p)
|
|
|
269975
270036
|
}
|
|
269976
270037
|
p->cTerm = (char)c;
|
|
269977
270038
|
}
|
|
270039
|
+
assert( p->z==0 || p->n<p->nAlloc );
|
|
269978
270040
|
if (p->z)
|
|
269979
270041
|
{
|
|
269980
270042
|
p->z[p->n] = 0;
|
|
@@ -271211,6 +271273,12 @@ static int vsvtabFilter(
|
|
|
271211
271273
|
VsvCursor *pCur = (VsvCursor*)pVtabCursor;
|
|
271212
271274
|
VsvTable *pTab = (VsvTable*)pVtabCursor->pVtab;
|
|
271213
271275
|
pCur->iRowid = 0;
|
|
271276
|
+
|
|
271277
|
+
/* Ensure the field buffer is always allocated. Otherwise, if the
|
|
271278
|
+
** first field is zero bytes in size, this may be mistaken for an OOM
|
|
271279
|
+
** error in csvtabNext(). */
|
|
271280
|
+
if( vsv_append(&pCur->rdr, 0) ) return SQLITE_NOMEM;
|
|
271281
|
+
|
|
271214
271282
|
if (pCur->rdr.in==0)
|
|
271215
271283
|
{
|
|
271216
271284
|
assert( pCur->rdr.zIn==pTab->zData );
|
|
@@ -275107,9 +275175,9 @@ static int re_match(ReCompiled *pRe, const unsigned char *zIn, int nIn){
|
|
|
275107
275175
|
}
|
|
275108
275176
|
case RE_OP_CC_EXC: {
|
|
275109
275177
|
if( c==0 ) break;
|
|
275110
|
-
/* fall-through */
|
|
275178
|
+
/* fall-through */ goto re_op_cc_inc;
|
|
275111
275179
|
}
|
|
275112
|
-
case RE_OP_CC_INC: {
|
|
275180
|
+
case RE_OP_CC_INC: re_op_cc_inc: {
|
|
275113
275181
|
int j = 1;
|
|
275114
275182
|
int n = pRe->aArg[x];
|
|
275115
275183
|
int hit = 0;
|
|
@@ -275493,7 +275561,7 @@ static const char *re_compile(ReCompiled **ppRe, const char *zIn, int noCase){
|
|
|
275493
275561
|
pRe->zInit[j++] = (unsigned char)(0xc0 | (x>>6));
|
|
275494
275562
|
pRe->zInit[j++] = 0x80 | (x&0x3f);
|
|
275495
275563
|
}else if( x<=0xffff ){
|
|
275496
|
-
pRe->zInit[j++] = (unsigned char)(
|
|
275564
|
+
pRe->zInit[j++] = (unsigned char)(0xe0 | (x>>12));
|
|
275497
275565
|
pRe->zInit[j++] = 0x80 | ((x>>6)&0x3f);
|
|
275498
275566
|
pRe->zInit[j++] = 0x80 | (x&0x3f);
|
|
275499
275567
|
}else{
|
|
@@ -275567,15 +275635,15 @@ int sqlite3_regexp_init(
|
|
|
275567
275635
|
int rc = SQLITE_OK;
|
|
275568
275636
|
SQLITE_EXTENSION_INIT2(pApi);
|
|
275569
275637
|
(void)pzErrMsg; /* Unused */
|
|
275570
|
-
rc = sqlite3_create_function(db, "regexp", 2,
|
|
275571
|
-
|
|
275572
|
-
|
|
275638
|
+
rc = sqlite3_create_function(db, "regexp", 2,
|
|
275639
|
+
SQLITE_UTF8|SQLITE_INNOCUOUS|SQLITE_DETERMINISTIC,
|
|
275640
|
+
0, re_sql_func, 0, 0);
|
|
275573
275641
|
if( rc==SQLITE_OK ){
|
|
275574
275642
|
/* The regexpi(PATTERN,STRING) function is a case-insensitive version
|
|
275575
275643
|
** of regexp(PATTERN,STRING). */
|
|
275576
275644
|
rc = sqlite3_create_function(db, "regexpi", 2,
|
|
275577
|
-
|
|
275578
|
-
|
|
275645
|
+
SQLITE_UTF8|SQLITE_INNOCUOUS|SQLITE_DETERMINISTIC,
|
|
275646
|
+
(void*)db, re_sql_func, 0, 0);
|
|
275579
275647
|
}
|
|
275580
275648
|
return rc;
|
|
275581
275649
|
}
|
|
@@ -287179,6 +287247,10 @@ static int zipfileRegister(sqlite3 *db){
|
|
|
287179
287247
|
zipfileRollback, /* xRollback */
|
|
287180
287248
|
zipfileFindFunction, /* xFindMethod */
|
|
287181
287249
|
0, /* xRename */
|
|
287250
|
+
0, /* xSavepoint */
|
|
287251
|
+
0, /* xRelease */
|
|
287252
|
+
0, /* xRollback */
|
|
287253
|
+
0 /* xShadowName */
|
|
287182
287254
|
};
|
|
287183
287255
|
|
|
287184
287256
|
int rc = sqlite3_create_module(db, "zipfile" , &zipfileModule, 0);
|
package/deps/sqlite3/sqlite3.h
CHANGED
|
@@ -31,9 +31,9 @@
|
|
|
31
31
|
|
|
32
32
|
#define SQLITE3MC_VERSION_MAJOR 1
|
|
33
33
|
#define SQLITE3MC_VERSION_MINOR 4
|
|
34
|
-
#define SQLITE3MC_VERSION_RELEASE
|
|
34
|
+
#define SQLITE3MC_VERSION_RELEASE 6
|
|
35
35
|
#define SQLITE3MC_VERSION_SUBRELEASE 0
|
|
36
|
-
#define SQLITE3MC_VERSION_STRING "SQLite3 Multiple Ciphers 1.4.
|
|
36
|
+
#define SQLITE3MC_VERSION_STRING "SQLite3 Multiple Ciphers 1.4.6"
|
|
37
37
|
|
|
38
38
|
#endif /* SQLITE3MC_VERSION_H_ */
|
|
39
39
|
/*** End of #include "sqlite3mc_version.h" ***/
|
|
@@ -192,9 +192,9 @@ extern "C" {
|
|
|
192
192
|
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
|
|
193
193
|
** [sqlite_version()] and [sqlite_source_id()].
|
|
194
194
|
*/
|
|
195
|
-
#define SQLITE_VERSION "3.39.
|
|
196
|
-
#define SQLITE_VERSION_NUMBER
|
|
197
|
-
#define SQLITE_SOURCE_ID "2022-
|
|
195
|
+
#define SQLITE_VERSION "3.39.1"
|
|
196
|
+
#define SQLITE_VERSION_NUMBER 3039001
|
|
197
|
+
#define SQLITE_SOURCE_ID "2022-07-13 19:41:41 7c16541a0efb3985578181171c9f2bb3fdc4bad6a2ec85c6e31ab96f3eff201f"
|
|
198
198
|
|
|
199
199
|
/*
|
|
200
200
|
** CAPI3REF: Run-Time Library Version Numbers
|
|
@@ -6328,7 +6328,7 @@ SQLITE_API sqlite3 *sqlite3_db_handle(sqlite3_stmt*);
|
|
|
6328
6328
|
**
|
|
6329
6329
|
** ^The sqlite3_db_name(D,N) interface returns a pointer to the schema name
|
|
6330
6330
|
** for the N-th database on database connection D, or a NULL pointer of N is
|
|
6331
|
-
** out of range. An N
|
|
6331
|
+
** out of range. An N value of 0 means the main database file. An N of 1 is
|
|
6332
6332
|
** the "temp" schema. Larger values of N correspond to various ATTACH-ed
|
|
6333
6333
|
** databases.
|
|
6334
6334
|
**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "better-sqlite3-multiple-ciphers",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.6.2",
|
|
4
4
|
"description": "better-sqlite3 with multiple-cipher encryption support",
|
|
5
5
|
"homepage": "https://github.com/m4heshd/better-sqlite3-multiple-ciphers",
|
|
6
6
|
"author": "Mahesh Bandara Wijerathna (m4heshd) <m4heshd@gmail.com>",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"fs-extra": "^10.1.0",
|
|
26
26
|
"mocha": "^8.3.2",
|
|
27
27
|
"nodemark": "^0.3.0",
|
|
28
|
-
"prebuild": "^11.0.
|
|
28
|
+
"prebuild": "^11.0.4",
|
|
29
29
|
"sqlite": "^4.1.1",
|
|
30
30
|
"sqlite3": "^5.0.8"
|
|
31
31
|
},
|