Skip to content

Commit

Permalink
updated sqlite to 3.47.2
Browse files Browse the repository at this point in the history
  • Loading branch information
gittiver committed Dec 9, 2024
1 parent 68068cb commit d60f3fe
Show file tree
Hide file tree
Showing 4 changed files with 138 additions and 71 deletions.
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ if(POLICY CMP0135)
cmake_policy(SET CMP0135 NEW)
endif()

project(sqlite3 VERSION 3.46.1)
project(sqlite3 VERSION 3.47.2)

enable_language(C)

Expand Down Expand Up @@ -38,8 +38,8 @@ endif(NOT SQLITE3_USE_SHARED_CRT)
endif(MSVC)

ExternalProject_Add(sqlite3-src
URL https://www.sqlite.org/2024/sqlite-amalgamation-3470000.zip
URL_HASH SHA3_256=e35ee48efc24fe58d0e9102034ac0a41e3904641a745e94ab11a841fe9d7355e
URL https://www.sqlite.org/2024/sqlite-amalgamation-3470200.zip
URL_HASH SHA3_256=0e4df2263ef8169f9396b9535d9654d8d64ae8eb1a339ba06c7b12a72e6fb020
PREFIX 3rdparty
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src/sqlite3

Expand Down
23 changes: 13 additions & 10 deletions src/sqlite3/shell.c
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ char *sqlite3_fgets(char *buf, int sz, FILE *in){
** that into UTF-8. Otherwise, non-ASCII characters all get translated
** into '?'.
*/
wchar_t *b1 = malloc( sz*sizeof(wchar_t) );
wchar_t *b1 = sqlite3_malloc( sz*sizeof(wchar_t) );
if( b1==0 ) return 0;
_setmode(_fileno(in), IsConsole(in) ? _O_WTEXT : _O_U8TEXT);
if( fgetws(b1, sz/4, in)==0 ){
Expand Down Expand Up @@ -526,7 +526,7 @@ int sqlite3_fputs(const char *z, FILE *out){
** use O_U8TEXT for everything in text mode.
*/
int sz = (int)strlen(z);
wchar_t *b1 = malloc( (sz+1)*sizeof(wchar_t) );
wchar_t *b1 = sqlite3_malloc( (sz+1)*sizeof(wchar_t) );
if( b1==0 ) return 0;
sz = MultiByteToWideChar(CP_UTF8, 0, z, sz, b1, sz);
b1[sz] = 0;
Expand Down Expand Up @@ -5072,10 +5072,10 @@ int sqlite3_percentile_init(
){
int rc = SQLITE_OK;
unsigned int i;
#if defined(SQLITE3_H) || defined(SQLITE_STATIC_PERCENTILE)
(void)pApi; /* Unused parameter */
#else
#ifdef SQLITE3EXT_H
SQLITE_EXTENSION_INIT2(pApi);
#else
(void)pApi; /* Unused parameter */
#endif
(void)pzErrMsg; /* Unused parameter */
for(i=0; i<sizeof(aPercentFunc)/sizeof(aPercentFunc[0]); i++){
Expand Down Expand Up @@ -6833,31 +6833,37 @@ static int seriesBestIndex(
continue;
}
if( pConstraint->iColumn<SERIES_COLUMN_START ){
if( pConstraint->iColumn==SERIES_COLUMN_VALUE ){
if( pConstraint->iColumn==SERIES_COLUMN_VALUE && pConstraint->usable ){
switch( op ){
case SQLITE_INDEX_CONSTRAINT_EQ:
case SQLITE_INDEX_CONSTRAINT_IS: {
idxNum |= 0x0080;
idxNum &= ~0x3300;
aIdx[5] = i;
aIdx[6] = -1;
#ifndef ZERO_ARGUMENT_GENERATE_SERIES
bStartSeen = 1;
#endif
break;
}
case SQLITE_INDEX_CONSTRAINT_GE: {
if( idxNum & 0x0080 ) break;
idxNum |= 0x0100;
idxNum &= ~0x0200;
aIdx[5] = i;
#ifndef ZERO_ARGUMENT_GENERATE_SERIES
bStartSeen = 1;
#endif
break;
}
case SQLITE_INDEX_CONSTRAINT_GT: {
if( idxNum & 0x0080 ) break;
idxNum |= 0x0200;
idxNum &= ~0x0100;
aIdx[5] = i;
#ifndef ZERO_ARGUMENT_GENERATE_SERIES
bStartSeen = 1;
#endif
break;
}
case SQLITE_INDEX_CONSTRAINT_LE: {
Expand Down Expand Up @@ -14169,7 +14175,7 @@ static int idxCreateVtabSchema(sqlite3expert *p, char **pzErrmsg){
}else{
IdxTable *pTab;
rc = idxGetTableInfo(p->db, zName, &pTab, pzErrmsg);
if( rc==SQLITE_OK ){
if( rc==SQLITE_OK && ALWAYS(pTab!=0) ){
int i;
char *zInner = 0;
char *zOuter = 0;
Expand Down Expand Up @@ -31840,7 +31846,6 @@ static QuickScanState quickscan(char *zLine, QuickScanState qss,
char cWait = (char)qss; /* intentional narrowing loss */
if( cWait==0 ){
PlainScan:
assert( cWait==0 );
while( (cin = *zLine++)!=0 ){
if( IsSpace(cin) )
continue;
Expand Down Expand Up @@ -31892,7 +31897,6 @@ static QuickScanState quickscan(char *zLine, QuickScanState qss,
if( *zLine != '/' )
continue;
++zLine;
cWait = 0;
CONTINUE_PROMPT_AWAITC(pst, 0);
qss = QSS_SETV(qss, 0);
goto PlainScan;
Expand All @@ -31904,7 +31908,6 @@ static QuickScanState quickscan(char *zLine, QuickScanState qss,
}
deliberate_fall_through;
case ']':
cWait = 0;
CONTINUE_PROMPT_AWAITC(pst, 0);
qss = QSS_SETV(qss, 0);
goto PlainScan;
Expand Down
Loading

0 comments on commit d60f3fe

Please sign in to comment.