better-sqlite3-multiple-ciphers 12.5.0 → 12.6.0

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 CHANGED
@@ -17,10 +17,10 @@ The fastest and simplest library for SQLite in Node.js. This particular fork sup
17
17
  ## Current versions
18
18
 
19
19
  - ### Stable
20
- - **better-sqlite3-multiple-ciphers** - [`12.5.0`](https://github.com/m4heshd/better-sqlite3-multiple-ciphers/releases/tag/v12.5.0)
21
- - **better-sqlite3** - [`12.5.0`](https://github.com/JoshuaWise/better-sqlite3/releases/tag/v12.5.0)
22
- - **SQLite** - [`3.51.1`](https://www.sqlite.org/releaselog/3_51_1.html)
23
- - **SQLite3 Multiple Ciphers** - [`2.2.6`](https://github.com/utelle/SQLite3MultipleCiphers/releases/tag/v2.2.6)
20
+ - **better-sqlite3-multiple-ciphers** - [`12.6.0`](https://github.com/m4heshd/better-sqlite3-multiple-ciphers/releases/tag/v12.6.0)
21
+ - **better-sqlite3** - [`12.6.0`](https://github.com/JoshuaWise/better-sqlite3/releases/tag/v12.6.0)
22
+ - **SQLite** - [`3.51.2`](https://www.sqlite.org/releaselog/3_51_2.html)
23
+ - **SQLite3 Multiple Ciphers** - [`2.2.7`](https://github.com/utelle/SQLite3MultipleCiphers/releases/tag/v2.2.7)
24
24
 
25
25
  - ### Beta
26
26
  - **better-sqlite3-multiple-ciphers** - [`11.0.0-beta.0`](https://github.com/m4heshd/better-sqlite3-multiple-ciphers/releases/tag/v11.0.0-beta.0)
@@ -123,7 +123,7 @@ SQLITE_API LPWSTR sqlite3_win32_utf8_to_unicode(const char*);
123
123
  /*** Begin of #include "sqlite3patched.c" ***/
124
124
  /******************************************************************************
125
125
  ** This file is an amalgamation of many separate C source files from SQLite
126
- ** version 3.51.1. By combining all the individual C code files into this
126
+ ** version 3.51.2. By combining all the individual C code files into this
127
127
  ** single large file, the entire code can be compiled as a single translation
128
128
  ** unit. This allows many compilers to do optimizations that would not be
129
129
  ** possible if the files were compiled separately. Performance improvements
@@ -141,7 +141,7 @@ SQLITE_API LPWSTR sqlite3_win32_utf8_to_unicode(const char*);
141
141
  ** separate file. This file contains only code for the core SQLite library.
142
142
  **
143
143
  ** The content in this amalgamation comes from Fossil check-in
144
- ** 281fc0e9afc38674b9b0991943b9e9d1e64c with changes in files:
144
+ ** b270f8339eb13b504d0b2ba154ebca966b7d with changes in files:
145
145
  **
146
146
  **
147
147
  */
@@ -591,12 +591,12 @@ extern "C" {
591
591
  ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
592
592
  ** [sqlite_version()] and [sqlite_source_id()].
593
593
  */
594
- #define SQLITE_VERSION "3.51.1"
595
- #define SQLITE_VERSION_NUMBER 3051001
596
- #define SQLITE_SOURCE_ID "2025-11-28 17:28:25 281fc0e9afc38674b9b0991943b9e9d1e64c6cbdb133d35f6f5c87ff6af38a88"
594
+ #define SQLITE_VERSION "3.51.2"
595
+ #define SQLITE_VERSION_NUMBER 3051002
596
+ #define SQLITE_SOURCE_ID "2026-01-09 17:27:48 b270f8339eb13b504d0b2ba154ebca966b7dde08e40c3ed7d559749818cb2075"
597
597
  #define SQLITE_SCM_BRANCH "branch-3.51"
598
- #define SQLITE_SCM_TAGS "release version-3.51.1"
599
- #define SQLITE_SCM_DATETIME "2025-11-28T17:28:25.933Z"
598
+ #define SQLITE_SCM_TAGS "release version-3.51.2"
599
+ #define SQLITE_SCM_DATETIME "2026-01-09T17:27:48.405Z"
600
600
 
601
601
  /*
602
602
  ** CAPI3REF: Run-Time Library Version Numbers
@@ -41376,12 +41376,18 @@ static int unixLock(sqlite3_file *id, int eFileLock){
41376
41376
  pInode->nLock++;
41377
41377
  pInode->nShared = 1;
41378
41378
  }
41379
- }else if( (eFileLock==EXCLUSIVE_LOCK && pInode->nShared>1)
41380
- || unixIsSharingShmNode(pFile)
41381
- ){
41379
+ }else if( eFileLock==EXCLUSIVE_LOCK && pInode->nShared>1 ){
41382
41380
  /* We are trying for an exclusive lock but another thread in this
41383
41381
  ** same process is still holding a shared lock. */
41384
41382
  rc = SQLITE_BUSY;
41383
+ }else if( unixIsSharingShmNode(pFile) ){
41384
+ /* We are in WAL mode and attempting to delete the SHM and WAL
41385
+ ** files due to closing the connection or changing out of WAL mode,
41386
+ ** but another process still holds locks on the SHM file, thus
41387
+ ** indicating that database locks have been broken, perhaps due
41388
+ ** to a rogue close(open(dbFile)) or similar.
41389
+ */
41390
+ rc = SQLITE_BUSY;
41385
41391
  }else{
41386
41392
  /* The request was for a RESERVED or EXCLUSIVE lock. It is
41387
41393
  ** assumed that there is a SHARED or greater lock on the file
@@ -44020,26 +44026,21 @@ static int unixFcntlExternalReader(unixFile *pFile, int *piOut){
44020
44026
  ** still not a disaster.
44021
44027
  */
44022
44028
  static int unixIsSharingShmNode(unixFile *pFile){
44023
- int rc;
44024
44029
  unixShmNode *pShmNode;
44030
+ struct flock lock;
44025
44031
  if( pFile->pShm==0 ) return 0;
44026
44032
  if( pFile->ctrlFlags & UNIXFILE_EXCL ) return 0;
44027
44033
  pShmNode = pFile->pShm->pShmNode;
44028
- rc = 1;
44029
- unixEnterMutex();
44030
- if( ALWAYS(pShmNode->nRef==1) ){
44031
- struct flock lock;
44032
- lock.l_whence = SEEK_SET;
44033
- lock.l_start = UNIX_SHM_DMS;
44034
- lock.l_len = 1;
44035
- lock.l_type = F_WRLCK;
44036
- osFcntl(pShmNode->hShm, F_GETLK, &lock);
44037
- if( lock.l_type==F_UNLCK ){
44038
- rc = 0;
44039
- }
44040
- }
44041
- unixLeaveMutex();
44042
- return rc;
44034
+ #if SQLITE_ATOMIC_INTRINSICS
44035
+ assert( AtomicLoad(&pShmNode->nRef)==1 );
44036
+ #endif
44037
+ memset(&lock, 0, sizeof(lock));
44038
+ lock.l_whence = SEEK_SET;
44039
+ lock.l_start = UNIX_SHM_DMS;
44040
+ lock.l_len = 1;
44041
+ lock.l_type = F_WRLCK;
44042
+ osFcntl(pShmNode->hShm, F_GETLK, &lock);
44043
+ return (lock.l_type!=F_UNLCK);
44043
44044
  }
44044
44045
 
44045
44046
  /*
@@ -115471,9 +115472,22 @@ SQLITE_PRIVATE int sqlite3CodeSubselect(Parse *pParse, Expr *pExpr){
115471
115472
  pParse->nMem += nReg;
115472
115473
  if( pExpr->op==TK_SELECT ){
115473
115474
  dest.eDest = SRT_Mem;
115474
- dest.iSdst = dest.iSDParm;
115475
+ if( (pSel->selFlags&SF_Distinct) && pSel->pLimit && pSel->pLimit->pRight ){
115476
+ /* If there is both a DISTINCT and an OFFSET clause, then allocate
115477
+ ** a separate dest.iSdst array for sqlite3Select() and other
115478
+ ** routines to populate. In this case results will be copied over
115479
+ ** into the dest.iSDParm array only after OFFSET processing. This
115480
+ ** ensures that in the case where OFFSET excludes all rows, the
115481
+ ** dest.iSDParm array is not left populated with the contents of the
115482
+ ** last row visited - it should be all NULLs if all rows were
115483
+ ** excluded by OFFSET. */
115484
+ dest.iSdst = pParse->nMem+1;
115485
+ pParse->nMem += nReg;
115486
+ }else{
115487
+ dest.iSdst = dest.iSDParm;
115488
+ }
115475
115489
  dest.nSdst = nReg;
115476
- sqlite3VdbeAddOp3(v, OP_Null, 0, dest.iSDParm, dest.iSDParm+nReg-1);
115490
+ sqlite3VdbeAddOp3(v, OP_Null, 0, dest.iSDParm, pParse->nMem);
115477
115491
  VdbeComment((v, "Init subquery result"));
115478
115492
  }else{
115479
115493
  dest.eDest = SRT_Exists;
@@ -148346,9 +148360,14 @@ static void selectInnerLoop(
148346
148360
  assert( nResultCol<=pDest->nSdst );
148347
148361
  pushOntoSorter(
148348
148362
  pParse, pSort, p, regResult, regOrig, nResultCol, nPrefixReg);
148363
+ pDest->iSDParm = regResult;
148349
148364
  }else{
148350
148365
  assert( nResultCol==pDest->nSdst );
148351
- assert( regResult==iParm );
148366
+ if( regResult!=iParm ){
148367
+ /* This occurs in cases where the SELECT had both a DISTINCT and
148368
+ ** an OFFSET clause. */
148369
+ sqlite3VdbeAddOp3(v, OP_Copy, regResult, iParm, nResultCol-1);
148370
+ }
148352
148371
  /* The LIMIT clause will jump out of the loop for us */
148353
148372
  }
148354
148373
  break;
@@ -154363,12 +154382,24 @@ static SQLITE_NOINLINE void existsToJoin(
154363
154382
  && (pSub->selFlags & SF_Aggregate)==0
154364
154383
  && !pSub->pSrc->a[0].fg.isSubquery
154365
154384
  && pSub->pLimit==0
154385
+ && pSub->pPrior==0
154366
154386
  ){
154387
+ /* Before combining the sub-select with the parent, renumber the
154388
+ ** cursor used by the subselect. This is because the EXISTS expression
154389
+ ** might be a copy of another EXISTS expression from somewhere
154390
+ ** else in the tree, and in this case it is important that it use
154391
+ ** a unique cursor number. */
154392
+ sqlite3 *db = pParse->db;
154393
+ int *aCsrMap = sqlite3DbMallocZero(db, (pParse->nTab+2)*sizeof(int));
154394
+ if( aCsrMap==0 ) return;
154395
+ aCsrMap[0] = (pParse->nTab+1);
154396
+ renumberCursors(pParse, pSub, -1, aCsrMap);
154397
+ sqlite3DbFree(db, aCsrMap);
154398
+
154367
154399
  memset(pWhere, 0, sizeof(*pWhere));
154368
154400
  pWhere->op = TK_INTEGER;
154369
154401
  pWhere->u.iValue = 1;
154370
154402
  ExprSetProperty(pWhere, EP_IntValue);
154371
-
154372
154403
  assert( p->pWhere!=0 );
154373
154404
  pSub->pSrc->a[0].fg.fromExists = 1;
154374
154405
  pSub->pSrc->a[0].fg.jointype |= JT_CROSS;
@@ -174170,6 +174201,9 @@ SQLITE_PRIVATE void sqlite3WhereEnd(WhereInfo *pWInfo){
174170
174201
  sqlite3 *db = pParse->db;
174171
174202
  int iEnd = sqlite3VdbeCurrentAddr(v);
174172
174203
  int nRJ = 0;
174204
+ #ifndef SQLITE_DISABLE_SKIPAHEAD_DISTINCT
174205
+ int addrSeek = 0;
174206
+ #endif
174173
174207
 
174174
174208
  /* Generate loop termination code.
174175
174209
  */
@@ -174182,7 +174216,10 @@ SQLITE_PRIVATE void sqlite3WhereEnd(WhereInfo *pWInfo){
174182
174216
  ** the RIGHT JOIN table */
174183
174217
  WhereRightJoin *pRJ = pLevel->pRJ;
174184
174218
  sqlite3VdbeResolveLabel(v, pLevel->addrCont);
174185
- pLevel->addrCont = 0;
174219
+ /* Replace addrCont with a new label that will never be used, just so
174220
+ ** the subsequent call to resolve pLevel->addrCont will have something
174221
+ ** to resolve. */
174222
+ pLevel->addrCont = sqlite3VdbeMakeLabel(pParse);
174186
174223
  pRJ->endSubrtn = sqlite3VdbeCurrentAddr(v);
174187
174224
  sqlite3VdbeAddOp3(v, OP_Return, pRJ->regReturn, pRJ->addrSubrtn, 1);
174188
174225
  VdbeCoverage(v);
@@ -174191,7 +174228,6 @@ SQLITE_PRIVATE void sqlite3WhereEnd(WhereInfo *pWInfo){
174191
174228
  pLoop = pLevel->pWLoop;
174192
174229
  if( pLevel->op!=OP_Noop ){
174193
174230
  #ifndef SQLITE_DISABLE_SKIPAHEAD_DISTINCT
174194
- int addrSeek = 0;
174195
174231
  Index *pIdx;
174196
174232
  int n;
174197
174233
  if( pWInfo->eDistinct==WHERE_DISTINCT_ORDERED
@@ -174214,25 +174250,26 @@ SQLITE_PRIVATE void sqlite3WhereEnd(WhereInfo *pWInfo){
174214
174250
  sqlite3VdbeAddOp2(v, OP_Goto, 1, pLevel->p2);
174215
174251
  }
174216
174252
  #endif /* SQLITE_DISABLE_SKIPAHEAD_DISTINCT */
174217
- if( pTabList->a[pLevel->iFrom].fg.fromExists && i==pWInfo->nLevel-1 ){
174218
- /* If the EXISTS-to-JOIN optimization was applied, then the EXISTS
174219
- ** loop(s) will be the inner-most loops of the join. There might be
174220
- ** multiple EXISTS loops, but they will all be nested, and the join
174221
- ** order will not have been changed by the query planner. If the
174222
- ** inner-most EXISTS loop sees a single successful row, it should
174223
- ** break out of *all* EXISTS loops. But only the inner-most of the
174224
- ** nested EXISTS loops should do this breakout. */
174225
- int nOuter = 0; /* Nr of outer EXISTS that this one is nested within */
174226
- while( nOuter<i ){
174227
- if( !pTabList->a[pLevel[-nOuter-1].iFrom].fg.fromExists ) break;
174228
- nOuter++;
174229
- }
174230
- testcase( nOuter>0 );
174231
- sqlite3VdbeAddOp2(v, OP_Goto, 0, pLevel[-nOuter].addrBrk);
174232
- VdbeComment((v, "EXISTS break"));
174233
- }
174234
- /* The common case: Advance to the next row */
174235
- if( pLevel->addrCont ) sqlite3VdbeResolveLabel(v, pLevel->addrCont);
174253
+ }
174254
+ if( pTabList->a[pLevel->iFrom].fg.fromExists && i==pWInfo->nLevel-1 ){
174255
+ /* If the EXISTS-to-JOIN optimization was applied, then the EXISTS
174256
+ ** loop(s) will be the inner-most loops of the join. There might be
174257
+ ** multiple EXISTS loops, but they will all be nested, and the join
174258
+ ** order will not have been changed by the query planner. If the
174259
+ ** inner-most EXISTS loop sees a single successful row, it should
174260
+ ** break out of *all* EXISTS loops. But only the inner-most of the
174261
+ ** nested EXISTS loops should do this breakout. */
174262
+ int nOuter = 0; /* Nr of outer EXISTS that this one is nested within */
174263
+ while( nOuter<i ){
174264
+ if( !pTabList->a[pLevel[-nOuter-1].iFrom].fg.fromExists ) break;
174265
+ nOuter++;
174266
+ }
174267
+ testcase( nOuter>0 );
174268
+ sqlite3VdbeAddOp2(v, OP_Goto, 0, pLevel[-nOuter].addrBrk);
174269
+ VdbeComment((v, "EXISTS break"));
174270
+ }
174271
+ sqlite3VdbeResolveLabel(v, pLevel->addrCont);
174272
+ if( pLevel->op!=OP_Noop ){
174236
174273
  sqlite3VdbeAddOp3(v, pLevel->op, pLevel->p1, pLevel->p2, pLevel->p3);
174237
174274
  sqlite3VdbeChangeP5(v, pLevel->p5);
174238
174275
  VdbeCoverage(v);
@@ -174245,10 +174282,11 @@ SQLITE_PRIVATE void sqlite3WhereEnd(WhereInfo *pWInfo){
174245
174282
  VdbeCoverage(v);
174246
174283
  }
174247
174284
  #ifndef SQLITE_DISABLE_SKIPAHEAD_DISTINCT
174248
- if( addrSeek ) sqlite3VdbeJumpHere(v, addrSeek);
174285
+ if( addrSeek ){
174286
+ sqlite3VdbeJumpHere(v, addrSeek);
174287
+ addrSeek = 0;
174288
+ }
174249
174289
  #endif
174250
- }else if( pLevel->addrCont ){
174251
- sqlite3VdbeResolveLabel(v, pLevel->addrCont);
174252
174290
  }
174253
174291
  if( (pLoop->wsFlags & WHERE_IN_ABLE)!=0 && pLevel->u.in.nIn>0 ){
174254
174292
  struct InLoop *pIn;
@@ -219651,7 +219689,7 @@ static void rtreenode(sqlite3_context *ctx, int nArg, sqlite3_value **apArg){
219651
219689
  if( node.zData==0 ) return;
219652
219690
  nData = sqlite3_value_bytes(apArg[1]);
219653
219691
  if( nData<4 ) return;
219654
- if( nData<NCELL(&node)*tree.nBytesPerCell ) return;
219692
+ if( nData<4+NCELL(&node)*tree.nBytesPerCell ) return;
219655
219693
 
219656
219694
  pOut = sqlite3_str_new(0);
219657
219695
  for(ii=0; ii<NCELL(&node); ii++){
@@ -238732,7 +238770,13 @@ typedef sqlite3_uint64 u64;
238732
238770
  # define FLEXARRAY 1
238733
238771
  #endif
238734
238772
 
238735
- #endif
238773
+ #endif /* SQLITE_AMALGAMATION */
238774
+
238775
+ /*
238776
+ ** Constants for the largest and smallest possible 32-bit signed integers.
238777
+ */
238778
+ # define LARGEST_INT32 ((int)(0x7fffffff))
238779
+ # define SMALLEST_INT32 ((int)((-1) - LARGEST_INT32))
238736
238780
 
238737
238781
  /* Truncate very long tokens to this many bytes. Hard limit is
238738
238782
  ** (65536-1-1-4-9)==65521 bytes. The limiting factor is the 16-bit offset
@@ -253295,7 +253339,7 @@ static int sqlite3Fts5IndexMerge(Fts5Index *p, int nMerge){
253295
253339
  fts5StructureRelease(pStruct);
253296
253340
  pStruct = pNew;
253297
253341
  nMin = 1;
253298
- nMerge = nMerge*-1;
253342
+ nMerge = (nMerge==SMALLEST_INT32 ? LARGEST_INT32 : (nMerge*-1));
253299
253343
  }
253300
253344
  if( pStruct && pStruct->nLevel ){
253301
253345
  if( fts5IndexMerge(p, &pStruct, nMerge, nMin) ){
@@ -260502,7 +260546,7 @@ static void fts5SourceIdFunc(
260502
260546
  ){
260503
260547
  assert( nArg==0 );
260504
260548
  UNUSED_PARAM2(nArg, apUnused);
260505
- sqlite3_result_text(pCtx, "fts5: 2025-11-28 17:28:25 281fc0e9afc38674b9b0991943b9e9d1e64c6cbdb133d35f6f5c87ff6af38a88", -1, SQLITE_TRANSIENT);
260549
+ sqlite3_result_text(pCtx, "fts5: 2026-01-09 17:27:48 b270f8339eb13b504d0b2ba154ebca966b7dde08e40c3ed7d559749818cb2075", -1, SQLITE_TRANSIENT);
260506
260550
  }
260507
260551
 
260508
260552
  /*
@@ -266342,7 +266386,7 @@ SQLITE_API const char *sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; }
266342
266386
  ** Purpose: SQLite3 Multiple Ciphers version numbers
266343
266387
  ** Author: Ulrich Telle
266344
266388
  ** Created: 2020-08-05
266345
- ** Copyright: (c) 2020-2025 Ulrich Telle
266389
+ ** Copyright: (c) 2020-2026 Ulrich Telle
266346
266390
  ** License: MIT
266347
266391
  */
266348
266392
 
@@ -266353,9 +266397,9 @@ SQLITE_API const char *sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; }
266353
266397
 
266354
266398
  #define SQLITE3MC_VERSION_MAJOR 2
266355
266399
  #define SQLITE3MC_VERSION_MINOR 2
266356
- #define SQLITE3MC_VERSION_RELEASE 6
266400
+ #define SQLITE3MC_VERSION_RELEASE 7
266357
266401
  #define SQLITE3MC_VERSION_SUBRELEASE 0
266358
- #define SQLITE3MC_VERSION_STRING "SQLite3 Multiple Ciphers 2.2.6"
266402
+ #define SQLITE3MC_VERSION_STRING "SQLite3 Multiple Ciphers 2.2.7"
266359
266403
 
266360
266404
  #endif /* SQLITE3MC_VERSION_H_ */
266361
266405
  /*** End of #include "sqlite3mc_version.h" ***/
@@ -266514,12 +266558,12 @@ extern "C" {
266514
266558
  ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
266515
266559
  ** [sqlite_version()] and [sqlite_source_id()].
266516
266560
  */
266517
- #define SQLITE_VERSION "3.51.1"
266518
- #define SQLITE_VERSION_NUMBER 3051001
266519
- #define SQLITE_SOURCE_ID "2025-11-28 17:28:25 281fc0e9afc38674b9b0991943b9e9d1e64c6cbdb133d35f6f5c87ff6af38a88"
266561
+ #define SQLITE_VERSION "3.51.2"
266562
+ #define SQLITE_VERSION_NUMBER 3051002
266563
+ #define SQLITE_SOURCE_ID "2026-01-09 17:27:48 b270f8339eb13b504d0b2ba154ebca966b7dde08e40c3ed7d559749818cb2075"
266520
266564
  #define SQLITE_SCM_BRANCH "branch-3.51"
266521
- #define SQLITE_SCM_TAGS "release version-3.51.1"
266522
- #define SQLITE_SCM_DATETIME "2025-11-28T17:28:25.933Z"
266565
+ #define SQLITE_SCM_TAGS "release version-3.51.2"
266566
+ #define SQLITE_SCM_DATETIME "2026-01-09T17:27:48.405Z"
266523
266567
 
266524
266568
  /*
266525
266569
  ** CAPI3REF: Run-Time Library Version Numbers
@@ -334540,7 +334584,7 @@ sqlite3mcBtreeSetPageSize(Btree* p, int pageSize, int nReserve, int iFix)
334540
334584
  ** Change 4: Call sqlite3mcBtreeSetPageSize instead of sqlite3BtreeSetPageSize for main database
334541
334585
  ** (sqlite3mcBtreeSetPageSize allows to reduce the number of reserved bytes)
334542
334586
  **
334543
- ** This code is generated by the script rekeyvacuum.sh from SQLite version 3.51.1 amalgamation.
334587
+ ** This code is generated by the script rekeyvacuum.sh from SQLite version 3.51.2 amalgamation.
334544
334588
  */
334545
334589
  SQLITE_PRIVATE SQLITE_NOINLINE int sqlite3mcRunVacuumForRekey(
334546
334590
  char **pzErrMsg, /* Write error message here */
@@ -338463,6 +338507,9 @@ SQLITE_EXTENSION_INIT1
338463
338507
  # define CSV_NOINLINE
338464
338508
  #endif
338465
338509
 
338510
+ #ifndef SQLITEINT_H
338511
+ typedef sqlite3_int64 i64;
338512
+ #endif
338466
338513
 
338467
338514
  /* Max size of the error message in a CsvReader */
338468
338515
  #define CSV_MXERR 200
@@ -338475,9 +338522,9 @@ typedef struct CsvReader CsvReader;
338475
338522
  struct CsvReader {
338476
338523
  FILE *in; /* Read the CSV text from this input stream */
338477
338524
  char *z; /* Accumulated text for a field */
338478
- int n; /* Number of bytes in z */
338479
- int nAlloc; /* Space allocated for z[] */
338480
- int nLine; /* Current line number */
338525
+ i64 n; /* Number of bytes in z */
338526
+ i64 nAlloc; /* Space allocated for z[] */
338527
+ i64 nLine; /* Current line number */
338481
338528
  int bNotFirst; /* True if prior text has been seen */
338482
338529
  int cTerm; /* Character that terminated the most recent field */
338483
338530
  size_t iIn; /* Next unread character in the input buffer */
@@ -338575,7 +338622,7 @@ static int csv_getc(CsvReader *p){
338575
338622
  ** Return 0 on success and non-zero if there is an OOM error */
338576
338623
  static CSV_NOINLINE int csv_resize_and_append(CsvReader *p, char c){
338577
338624
  char *zNew;
338578
- int nNew = p->nAlloc*2 + 100;
338625
+ i64 nNew = p->nAlloc*2 + 100;
338579
338626
  zNew = sqlite3_realloc64(p->z, nNew);
338580
338627
  if( zNew ){
338581
338628
  p->z = zNew;
@@ -338911,7 +338958,6 @@ static int csvtabConnect(
338911
338958
  # define CSV_DATA (azPValue[1])
338912
338959
  # define CSV_SCHEMA (azPValue[2])
338913
338960
 
338914
-
338915
338961
  assert( sizeof(azPValue)==sizeof(azParam) );
338916
338962
  memset(&sRdr, 0, sizeof(sRdr));
338917
338963
  memset(azPValue, 0, sizeof(azPValue));
@@ -342812,6 +342858,7 @@ static int fileStat(
342812
342858
  b1[sz] = 0;
342813
342859
  rc = _wstat(b1, pStatBuf);
342814
342860
  if( rc==0 ) statTimesToUtc(zPath, pStatBuf);
342861
+ sqlite3_free(b1);
342815
342862
  return rc;
342816
342863
  #else
342817
342864
  return stat(zPath, pStatBuf);
@@ -354930,7 +354977,7 @@ static void compressFunc(
354930
354977
  pIn = sqlite3_value_blob(argv[0]);
354931
354978
  nIn = sqlite3_value_bytes(argv[0]);
354932
354979
  nOut = 13 + nIn + (nIn+999)/1000;
354933
- pOut = sqlite3_malloc( nOut+5 );
354980
+ pOut = sqlite3_malloc64( nOut+5 );
354934
354981
  for(i=4; i>=0; i--){
354935
354982
  x[i] = (nIn >> (7*(4-i)))&0x7f;
354936
354983
  }
@@ -354969,7 +355016,7 @@ static void uncompressFunc(
354969
355016
  nOut = (nOut<<7) | (pIn[i]&0x7f);
354970
355017
  if( (pIn[i]&0x80)!=0 ){ i++; break; }
354971
355018
  }
354972
- pOut = sqlite3_malloc( nOut+1 );
355019
+ pOut = sqlite3_malloc64( nOut+1 );
354973
355020
  rc = uncompress(pOut, &nOut, &pIn[i], nIn-i);
354974
355021
  if( rc==Z_OK ){
354975
355022
  sqlite3_result_blob(context, pOut, nOut, sqlite3_free);
@@ -356032,7 +356079,7 @@ static int zipfileGetEntry(
356032
356079
  );
356033
356080
  }else{
356034
356081
  aRead = (u8*)&aBlob[iOff + ZIPFILE_CDS_FIXED_SZ];
356035
- if( (iOff + ZIPFILE_LFH_FIXED_SZ + nFile + nExtra)>nBlob ){
356082
+ if( (iOff + ZIPFILE_CDS_FIXED_SZ + nFile + nExtra)>nBlob ){
356036
356083
  rc = zipfileCorrupt(pzErr);
356037
356084
  }
356038
356085
  }
@@ -20,7 +20,7 @@
20
20
  ** Purpose: SQLite3 Multiple Ciphers version numbers
21
21
  ** Author: Ulrich Telle
22
22
  ** Created: 2020-08-05
23
- ** Copyright: (c) 2020-2025 Ulrich Telle
23
+ ** Copyright: (c) 2020-2026 Ulrich Telle
24
24
  ** License: MIT
25
25
  */
26
26
 
@@ -31,9 +31,9 @@
31
31
 
32
32
  #define SQLITE3MC_VERSION_MAJOR 2
33
33
  #define SQLITE3MC_VERSION_MINOR 2
34
- #define SQLITE3MC_VERSION_RELEASE 6
34
+ #define SQLITE3MC_VERSION_RELEASE 7
35
35
  #define SQLITE3MC_VERSION_SUBRELEASE 0
36
- #define SQLITE3MC_VERSION_STRING "SQLite3 Multiple Ciphers 2.2.6"
36
+ #define SQLITE3MC_VERSION_STRING "SQLite3 Multiple Ciphers 2.2.7"
37
37
 
38
38
  #endif /* SQLITE3MC_VERSION_H_ */
39
39
  /*** End of #include "sqlite3mc_version.h" ***/
@@ -192,12 +192,12 @@ extern "C" {
192
192
  ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
193
193
  ** [sqlite_version()] and [sqlite_source_id()].
194
194
  */
195
- #define SQLITE_VERSION "3.51.1"
196
- #define SQLITE_VERSION_NUMBER 3051001
197
- #define SQLITE_SOURCE_ID "2025-11-28 17:28:25 281fc0e9afc38674b9b0991943b9e9d1e64c6cbdb133d35f6f5c87ff6af38a88"
195
+ #define SQLITE_VERSION "3.51.2"
196
+ #define SQLITE_VERSION_NUMBER 3051002
197
+ #define SQLITE_SOURCE_ID "2026-01-09 17:27:48 b270f8339eb13b504d0b2ba154ebca966b7dde08e40c3ed7d559749818cb2075"
198
198
  #define SQLITE_SCM_BRANCH "branch-3.51"
199
- #define SQLITE_SCM_TAGS "release version-3.51.1"
200
- #define SQLITE_SCM_DATETIME "2025-11-28T17:28:25.933Z"
199
+ #define SQLITE_SCM_TAGS "release version-3.51.2"
200
+ #define SQLITE_SCM_DATETIME "2026-01-09T17:27:48.405Z"
201
201
 
202
202
  /*
203
203
  ** CAPI3REF: Run-Time Library Version Numbers
@@ -20,9 +20,9 @@
20
20
  # 4. node-gyp links the two resulting binaries to generate better_sqlite3.node.
21
21
  # ===
22
22
 
23
- YEAR="2025"
24
- VERSION="3510100"
25
- SQLITE3MC_VERSION="v2.2.6"
23
+ YEAR="2026"
24
+ VERSION="3510200"
25
+ SQLITE3MC_VERSION="v2.2.7"
26
26
 
27
27
  # Defines below are sorted alphabetically
28
28
  DEFINES="
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "better-sqlite3-multiple-ciphers",
3
- "version": "12.5.0",
3
+ "version": "12.6.0",
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>",