Skip to content

Commit df9898d

Browse files
committed
Prepare release of version 2.1.1
- Based on SQLite version 3.49.2
1 parent 892b6bc commit df9898d

File tree

10 files changed

+245
-169
lines changed

10 files changed

+245
-169
lines changed

CHANGELOG.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [2.1.1] - 2025-05-08
11+
12+
### Changed
13+
14+
- Based on SQLite version 3.49.2
15+
1016
## [2.1.0] - 2025-03-01
1117

1218
### Changed
@@ -608,7 +614,8 @@ The following ciphers are supported:
608614
- AES 256 Bit CBC - SHA1/SHA256/SHA512 HMAC ([SQLCipher](https://www.zetetic.net/sqlcipher/), database versions 1, 2, 3, and 4)
609615
- RC4 - No HMAC ([System.Data.SQLite](http://system.data.sqlite.org))
610616

611-
[Unreleased]: ../../compare/v2.1.0...HEAD
617+
[Unreleased]: ../../compare/v2.1.1...HEAD
618+
[2.1.1]: ../../compare/v2.1.0...v2.1.1
612619
[2.1.0]: ../../compare/v2.0.4...v2.1.0
613620
[2.0.4]: ../../compare/v2.0.3...v2.0.4
614621
[2.0.3]: ../../compare/v2.0.2...v2.0.3

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ dnl Copyright (C) 2019-2025 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], [2.1.0], [[email protected]])
7+
AC_INIT([sqlite3mc], [2.1.1], [[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 & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,8 @@ The code was mainly developed under Windows, but was tested under Linux as well.
1010

1111
## Version information
1212

13-
* 2.1.0 - *March 2025*
14-
- Based on SQLite version 3.49.1
15-
- Remove use of `SQLITE_EXTRA_INIT` and `SQLITE_EXTRA_SHUTDOWN`
16-
- Disable cipher scheme AEGIS for MSVC 2015 and below - workaround for issue #195
17-
- Fixed issue #194 - race condition when registering VFS
13+
* 2.1.1 - *May 2025*
14+
- Based on SQLite version 3.49.2
1815

1916
For further version information please consult the [CHANGELOG](CHANGELOG.md).
2017

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.49.1 amalgamation.
30+
** This code is generated by the script rekeyvacuum.sh from SQLite version 3.49.2 amalgamation.
3131
*/
3232
SQLITE_PRIVATE SQLITE_NOINLINE int sqlite3mcRunVacuumForRekey(
3333
char **pzErrMsg, /* Write error message here */

src/series.c

Lines changed: 49 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,7 @@
6060
** step HIDDEN
6161
** );
6262
**
63-
** The virtual table also has a rowid, logically equivalent to n+1 where
64-
** "n" is the ascending integer in the aforesaid production definition.
63+
** The virtual table also has a rowid which is an alias for the value.
6564
**
6665
** Function arguments in queries against this virtual table are translated
6766
** into equality constraints against successive hidden columns. In other
@@ -116,6 +115,7 @@ SQLITE_EXTENSION_INIT1
116115
#include <assert.h>
117116
#include <string.h>
118117
#include <limits.h>
118+
#include <math.h>
119119

120120
#ifndef SQLITE_OMIT_VIRTUALTABLE
121121
/*
@@ -276,6 +276,7 @@ static int seriesConnect(
276276
int rc;
277277

278278
/* Column numbers */
279+
#define SERIES_COLUMN_ROWID (-1)
279280
#define SERIES_COLUMN_VALUE 0
280281
#define SERIES_COLUMN_START 1
281282
#define SERIES_COLUMN_STOP 2
@@ -363,13 +364,11 @@ static int seriesColumn(
363364
#endif
364365

365366
/*
366-
** Return the rowid for the current row, logically equivalent to n+1 where
367-
** "n" is the ascending integer in the aforesaid production definition.
367+
** The rowid is the same as the value.
368368
*/
369369
static int seriesRowid(sqlite3_vtab_cursor *cur, sqlite_int64 *pRowid){
370370
series_cursor *pCur = (series_cursor*)cur;
371-
sqlite3_uint64 n = pCur->ss.uSeqIndexNow;
372-
*pRowid = (sqlite3_int64)((n<LARGEST_UINT64)? n+1 : 0);
371+
*pRowid = pCur->ss.iValueNow;
373372
return SQLITE_OK;
374373
}
375374

@@ -482,25 +481,52 @@ static int seriesFilter(
482481
** constraints on the "value" column.
483482
*/
484483
if( idxNum & 0x0080 ){
485-
iMin = iMax = sqlite3_value_int64(argv[i++]);
484+
if( sqlite3_value_numeric_type(argv[i])==SQLITE_FLOAT ){
485+
double r = sqlite3_value_double(argv[i++]);
486+
if( r==ceil(r) ){
487+
iMin = iMax = (sqlite3_int64)r;
488+
}else{
489+
returnNoRows = 1;
490+
}
491+
}else{
492+
iMin = iMax = sqlite3_value_int64(argv[i++]);
493+
}
486494
}else{
487495
if( idxNum & 0x0300 ){
488-
iMin = sqlite3_value_int64(argv[i++]);
489-
if( idxNum & 0x0200 ){
490-
if( iMin==LARGEST_INT64 ){
491-
returnNoRows = 1;
496+
if( sqlite3_value_numeric_type(argv[i])==SQLITE_FLOAT ){
497+
double r = sqlite3_value_double(argv[i++]);
498+
if( idxNum & 0x0200 && r==ceil(r) ){
499+
iMin = (sqlite3_int64)ceil(r+1.0);
492500
}else{
493-
iMin++;
501+
iMin = (sqlite3_int64)ceil(r);
502+
}
503+
}else{
504+
iMin = sqlite3_value_int64(argv[i++]);
505+
if( idxNum & 0x0200 ){
506+
if( iMin==LARGEST_INT64 ){
507+
returnNoRows = 1;
508+
}else{
509+
iMin++;
510+
}
494511
}
495512
}
496513
}
497514
if( idxNum & 0x3000 ){
498-
iMax = sqlite3_value_int64(argv[i++]);
499-
if( idxNum & 0x2000 ){
500-
if( iMax==SMALLEST_INT64 ){
501-
returnNoRows = 1;
515+
if( sqlite3_value_numeric_type(argv[i])==SQLITE_FLOAT ){
516+
double r = sqlite3_value_double(argv[i++]);
517+
if( (idxNum & 0x2000)!=0 && r==floor(r) ){
518+
iMax = (sqlite3_int64)(r-1.0);
502519
}else{
503-
iMax--;
520+
iMax = (sqlite3_int64)floor(r);
521+
}
522+
}else{
523+
iMax = sqlite3_value_int64(argv[i++]);
524+
if( idxNum & 0x2000 ){
525+
if( iMax==SMALLEST_INT64 ){
526+
returnNoRows = 1;
527+
}else{
528+
iMax--;
529+
}
504530
}
505531
}
506532
}
@@ -519,8 +545,7 @@ static int seriesFilter(
519545
pCur->ss.iBase += ((d+szStep-1)/szStep)*szStep;
520546
}
521547
if( pCur->ss.iTerm>iMax ){
522-
sqlite3_uint64 d = pCur->ss.iTerm - iMax;
523-
pCur->ss.iTerm -= ((d+szStep-1)/szStep)*szStep;
548+
pCur->ss.iTerm = iMax;
524549
}
525550
}else{
526551
sqlite3_int64 szStep = -pCur->ss.iStep;
@@ -530,8 +555,7 @@ static int seriesFilter(
530555
pCur->ss.iBase -= ((d+szStep-1)/szStep)*szStep;
531556
}
532557
if( pCur->ss.iTerm<iMin ){
533-
sqlite3_uint64 d = iMin - pCur->ss.iTerm;
534-
pCur->ss.iTerm += ((d+szStep-1)/szStep)*szStep;
558+
pCur->ss.iTerm = iMin;
535559
}
536560
}
537561
}
@@ -659,7 +683,10 @@ static int seriesBestIndex(
659683
continue;
660684
}
661685
if( pConstraint->iColumn<SERIES_COLUMN_START ){
662-
if( pConstraint->iColumn==SERIES_COLUMN_VALUE && pConstraint->usable ){
686+
if( (pConstraint->iColumn==SERIES_COLUMN_VALUE ||
687+
pConstraint->iColumn==SERIES_COLUMN_ROWID)
688+
&& pConstraint->usable
689+
){
663690
switch( op ){
664691
case SQLITE_INDEX_CONSTRAINT_EQ:
665692
case SQLITE_INDEX_CONSTRAINT_IS: {

src/shell.c

Lines changed: 49 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -6275,8 +6275,7 @@ int sqlite3_ieee_init(
62756275
** step HIDDEN
62766276
** );
62776277
**
6278-
** The virtual table also has a rowid, logically equivalent to n+1 where
6279-
** "n" is the ascending integer in the aforesaid production definition.
6278+
** The virtual table also has a rowid which is an alias for the value.
62806279
**
62816280
** Function arguments in queries against this virtual table are translated
62826281
** into equality constraints against successive hidden columns. In other
@@ -6331,6 +6330,7 @@ SQLITE_EXTENSION_INIT1
63316330
#include <assert.h>
63326331
#include <string.h>
63336332
#include <limits.h>
6333+
#include <math.h>
63346334

63356335
#ifndef SQLITE_OMIT_VIRTUALTABLE
63366336
/*
@@ -6491,6 +6491,7 @@ static int seriesConnect(
64916491
int rc;
64926492

64936493
/* Column numbers */
6494+
#define SERIES_COLUMN_ROWID (-1)
64946495
#define SERIES_COLUMN_VALUE 0
64956496
#define SERIES_COLUMN_START 1
64966497
#define SERIES_COLUMN_STOP 2
@@ -6578,13 +6579,11 @@ static int seriesColumn(
65786579
#endif
65796580

65806581
/*
6581-
** Return the rowid for the current row, logically equivalent to n+1 where
6582-
** "n" is the ascending integer in the aforesaid production definition.
6582+
** The rowid is the same as the value.
65836583
*/
65846584
static int seriesRowid(sqlite3_vtab_cursor *cur, sqlite_int64 *pRowid){
65856585
series_cursor *pCur = (series_cursor*)cur;
6586-
sqlite3_uint64 n = pCur->ss.uSeqIndexNow;
6587-
*pRowid = (sqlite3_int64)((n<LARGEST_UINT64)? n+1 : 0);
6586+
*pRowid = pCur->ss.iValueNow;
65886587
return SQLITE_OK;
65896588
}
65906589

@@ -6697,25 +6696,52 @@ static int seriesFilter(
66976696
** constraints on the "value" column.
66986697
*/
66996698
if( idxNum & 0x0080 ){
6700-
iMin = iMax = sqlite3_value_int64(argv[i++]);
6699+
if( sqlite3_value_numeric_type(argv[i])==SQLITE_FLOAT ){
6700+
double r = sqlite3_value_double(argv[i++]);
6701+
if( r==ceil(r) ){
6702+
iMin = iMax = (sqlite3_int64)r;
6703+
}else{
6704+
returnNoRows = 1;
6705+
}
6706+
}else{
6707+
iMin = iMax = sqlite3_value_int64(argv[i++]);
6708+
}
67016709
}else{
67026710
if( idxNum & 0x0300 ){
6703-
iMin = sqlite3_value_int64(argv[i++]);
6704-
if( idxNum & 0x0200 ){
6705-
if( iMin==LARGEST_INT64 ){
6706-
returnNoRows = 1;
6711+
if( sqlite3_value_numeric_type(argv[i])==SQLITE_FLOAT ){
6712+
double r = sqlite3_value_double(argv[i++]);
6713+
if( idxNum & 0x0200 && r==ceil(r) ){
6714+
iMin = (sqlite3_int64)ceil(r+1.0);
67076715
}else{
6708-
iMin++;
6716+
iMin = (sqlite3_int64)ceil(r);
6717+
}
6718+
}else{
6719+
iMin = sqlite3_value_int64(argv[i++]);
6720+
if( idxNum & 0x0200 ){
6721+
if( iMin==LARGEST_INT64 ){
6722+
returnNoRows = 1;
6723+
}else{
6724+
iMin++;
6725+
}
67096726
}
67106727
}
67116728
}
67126729
if( idxNum & 0x3000 ){
6713-
iMax = sqlite3_value_int64(argv[i++]);
6714-
if( idxNum & 0x2000 ){
6715-
if( iMax==SMALLEST_INT64 ){
6716-
returnNoRows = 1;
6730+
if( sqlite3_value_numeric_type(argv[i])==SQLITE_FLOAT ){
6731+
double r = sqlite3_value_double(argv[i++]);
6732+
if( (idxNum & 0x2000)!=0 && r==floor(r) ){
6733+
iMax = (sqlite3_int64)(r-1.0);
67176734
}else{
6718-
iMax--;
6735+
iMax = (sqlite3_int64)floor(r);
6736+
}
6737+
}else{
6738+
iMax = sqlite3_value_int64(argv[i++]);
6739+
if( idxNum & 0x2000 ){
6740+
if( iMax==SMALLEST_INT64 ){
6741+
returnNoRows = 1;
6742+
}else{
6743+
iMax--;
6744+
}
67196745
}
67206746
}
67216747
}
@@ -6734,8 +6760,7 @@ static int seriesFilter(
67346760
pCur->ss.iBase += ((d+szStep-1)/szStep)*szStep;
67356761
}
67366762
if( pCur->ss.iTerm>iMax ){
6737-
sqlite3_uint64 d = pCur->ss.iTerm - iMax;
6738-
pCur->ss.iTerm -= ((d+szStep-1)/szStep)*szStep;
6763+
pCur->ss.iTerm = iMax;
67396764
}
67406765
}else{
67416766
sqlite3_int64 szStep = -pCur->ss.iStep;
@@ -6745,8 +6770,7 @@ static int seriesFilter(
67456770
pCur->ss.iBase -= ((d+szStep-1)/szStep)*szStep;
67466771
}
67476772
if( pCur->ss.iTerm<iMin ){
6748-
sqlite3_uint64 d = iMin - pCur->ss.iTerm;
6749-
pCur->ss.iTerm += ((d+szStep-1)/szStep)*szStep;
6773+
pCur->ss.iTerm = iMin;
67506774
}
67516775
}
67526776
}
@@ -6874,7 +6898,10 @@ static int seriesBestIndex(
68746898
continue;
68756899
}
68766900
if( pConstraint->iColumn<SERIES_COLUMN_START ){
6877-
if( pConstraint->iColumn==SERIES_COLUMN_VALUE && pConstraint->usable ){
6901+
if( (pConstraint->iColumn==SERIES_COLUMN_VALUE ||
6902+
pConstraint->iColumn==SERIES_COLUMN_ROWID)
6903+
&& pConstraint->usable
6904+
){
68786905
switch( op ){
68796906
case SQLITE_INDEX_CONSTRAINT_EQ:
68806907
case SQLITE_INDEX_CONSTRAINT_IS: {

0 commit comments

Comments
 (0)