Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ unset(_ver_line)
project(SQLite3
VERSION ${SQLITE_VERSION}
DESCRIPTION "SQLite: an embedded SQL database engine"
HOMEPAGE_URL https://github.com/algoritnl/sqlite-amalgamation-cmake-buildsystem
HOMEPAGE_URL https://github.com/algoritnl/sqlite-amalgamation
LANGUAGES C)

if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
if(PROJECT_IS_TOP_LEVEL)
option(BUILD_SHARED_LIBS "Build using shared libraries." OFF)
include(CTest)
endif()
Expand Down Expand Up @@ -120,6 +120,9 @@ endif()

# -- Introspection -------------------------------------------------------------

include(CMakePushCheckState)
cmake_push_check_state(RESET)

if(CMAKE_C_COMPILER_ID MATCHES "(GNU|Clang)")
list(APPEND CMAKE_REQUIRED_DEFINITIONS -D_GNU_SOURCE)
list(APPEND CMAKE_REQUIRED_LIBRARIES m)
Expand Down Expand Up @@ -166,6 +169,8 @@ check_symbol_exists(usleep unistd.h HAVE_USLEEP)

check_symbol_exists(utime utime.h HAVE_UTIME)

cmake_pop_check_state()

# -- External Dependencies -----------------------------------------------------

if(NOT SQLITE_THREADSAFE STREQUAL "0")
Expand Down Expand Up @@ -368,7 +373,6 @@ endif()
# -- Testing -------------------------------------------------------------------

if(BUILD_TESTING AND SQLITE_BUILD_SHELL)
enable_testing()
add_test(NAME SQLiteShellCheckVersion
COMMAND SQLite::Shell -version)
set_tests_properties(SQLiteShellCheckVersion PROPERTIES
Expand All @@ -388,8 +392,6 @@ if(SQLITE_BUILD_SHELL)
EXPORT SQLite3Targets)
endif()

# -- Export --------------------------------------------------------------------

install(EXPORT SQLite3Targets
NAMESPACE SQLite::
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/SQLite3)
Expand Down Expand Up @@ -417,7 +419,7 @@ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/SQLite3Config.cmake

# -- Packaging -----------------------------------------------------------------

if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
if(PROJECT_IS_TOP_LEVEL)
include(InstallRequiredSystemLibraries)
set(CPACK_RESOURCE_FILE_LICENSE ${CMAKE_CURRENT_SOURCE_DIR}/LICENSE.md)
set(CPACK_RESOURCE_FILE_README ${CMAKE_CURRENT_SOURCE_DIR}/README.md)
Expand Down
5 changes: 5 additions & 0 deletions source/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## SQLite Release 3.47.2 On 2024-12-07

1. Fix a problem in text-to-floating-point conversion for SQLite that can cause values between '1.8446744073709550592eNNN' and '1.8446744073709551609eNNN' for any exponent NNN to be rendered incorrectly. In other words, some numeric text values where the first 16 significant digits are '1844674407370955' might be converted into the wrong floating-point value. See forum thread 569a7209179a7f5e. This problem only arises on x64 and i386 hardware. The problem was introduced in 3.47.0.
2. Other minor bug fixes.

## SQLite Release 3.47.1 On 2024-11-25

1. Fix the makefiles so that they once again honored DESTDIR for the "install" target.
Expand Down
16 changes: 8 additions & 8 deletions source/README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
Download: https://sqlite.org/2024/sqlite-amalgamation-3470100.zip
Download: https://sqlite.org/2024/sqlite-amalgamation-3470200.zip

```
Archive: sqlite-amalgamation-3470100.zip
Archive: sqlite-amalgamation-3470200.zip
Length Method Size Cmpr Date Time CRC-32 Name
-------- ------ ------- ---- ---------- ----- -------- ----
0 Stored 0 0% 2024-11-25 14:55 00000000 sqlite-amalgamation-3470100/
9195316 Defl:N 2368442 74% 2024-11-25 14:55 9447f8cd sqlite-amalgamation-3470100/sqlite3.c
1044254 Defl:N 267036 74% 2024-11-25 14:55 95272fac sqlite-amalgamation-3470100/shell.c
651186 Defl:N 168326 74% 2024-11-25 14:55 ab5341bd sqlite-amalgamation-3470100/sqlite3.h
38149 Defl:N 6615 83% 2024-11-25 14:55 c5ea7fc8 sqlite-amalgamation-3470100/sqlite3ext.h
0 Stored 0 0% 2024-12-07 21:57 00000000 sqlite-amalgamation-3470200/
9195458 Defl:N 2368505 74% 2024-12-07 21:57 d4f520a7 sqlite-amalgamation-3470200/sqlite3.c
1044214 Defl:N 267040 74% 2024-12-07 21:57 24f3c07f sqlite-amalgamation-3470200/shell.c
651186 Defl:N 168328 74% 2024-12-07 21:57 b4edf4b4 sqlite-amalgamation-3470200/sqlite3.h
38149 Defl:N 6615 83% 2024-12-07 21:57 c5ea7fc8 sqlite-amalgamation-3470200/sqlite3ext.h
-------- ------- --- -------
10928905 2810419 74% 5 files
10929007 2810488 74% 5 files
```
6 changes: 3 additions & 3 deletions source/shell.c
Original file line number Diff line number Diff line change
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
59 changes: 32 additions & 27 deletions source/sqlite3.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/******************************************************************************
** This file is an amalgamation of many separate C source files from SQLite
** version 3.47.1. By combining all the individual C code files into this
** version 3.47.2. By combining all the individual C code files into this
** single large file, the entire code can be compiled as a single translation
** unit. This allows many compilers to do optimizations that would not be
** possible if the files were compiled separately. Performance improvements
Expand All @@ -18,7 +18,7 @@
** separate file. This file contains only code for the core SQLite library.
**
** The content in this amalgamation comes from Fossil check-in
** b95d11e958643b969c47a8e5857f3793b9e6.
** 2aabe05e2e8cae4847a802ee2daddc1d7413.
*/
#define SQLITE_CORE 1
#define SQLITE_AMALGAMATION 1
Expand Down Expand Up @@ -462,9 +462,9 @@ extern "C" {
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
** [sqlite_version()] and [sqlite_source_id()].
*/
#define SQLITE_VERSION "3.47.1"
#define SQLITE_VERSION_NUMBER 3047001
#define SQLITE_SOURCE_ID "2024-11-25 12:07:48 b95d11e958643b969c47a8e5857f3793b9e69700b8f1469371386369a26e577e"
#define SQLITE_VERSION "3.47.2"
#define SQLITE_VERSION_NUMBER 3047002
#define SQLITE_SOURCE_ID "2024-12-07 20:39:59 2aabe05e2e8cae4847a802ee2daddc1d7413d8fc560254d93ee3e72c14685b6c"

/*
** CAPI3REF: Run-Time Library Version Numbers
Expand Down Expand Up @@ -35697,8 +35697,8 @@ SQLITE_PRIVATE int sqlite3AtoF(const char *z, double *pResult, int length, u8 en
int eValid = 1; /* True exponent is either not used or is well-formed */
int nDigit = 0; /* Number of digits processed */
int eType = 1; /* 1: pure integer, 2+: fractional -1 or less: bad UTF16 */
u64 s2; /* round-tripped significand */
double rr[2];
u64 s2;

assert( enc==SQLITE_UTF8 || enc==SQLITE_UTF16LE || enc==SQLITE_UTF16BE );
*pResult = 0.0; /* Default return value, in case of an error */
Expand Down Expand Up @@ -35801,7 +35801,7 @@ SQLITE_PRIVATE int sqlite3AtoF(const char *z, double *pResult, int length, u8 en
e = (e*esign) + d;

/* Try to adjust the exponent to make it smaller */
while( e>0 && s<(LARGEST_UINT64/10) ){
while( e>0 && s<((LARGEST_UINT64-0x7ff)/10) ){
s *= 10;
e--;
}
Expand All @@ -35811,11 +35811,16 @@ SQLITE_PRIVATE int sqlite3AtoF(const char *z, double *pResult, int length, u8 en
}

rr[0] = (double)s;
s2 = (u64)rr[0];
#if defined(_MSC_VER) && _MSC_VER<1700
if( s2==0x8000000000000000LL ){ s2 = 2*(u64)(0.5*rr[0]); }
#endif
rr[1] = s>=s2 ? (double)(s - s2) : -(double)(s2 - s);
assert( sizeof(s2)==sizeof(rr[0]) );
memcpy(&s2, &rr[0], sizeof(s2));
if( s2<=0x43efffffffffffffLL ){
s2 = (u64)rr[0];
rr[1] = s>=s2 ? (double)(s - s2) : -(double)(s2 - s);
}else{
rr[1] = 0.0;
}
assert( rr[1]<=1.0e-10*rr[0] ); /* Equal only when rr[0]==0.0 */

if( e>0 ){
while( e>=100 ){
e -= 100;
Expand Down Expand Up @@ -147605,32 +147610,32 @@ static Expr *substExpr(
if( pSubst->isOuterJoin ){
ExprSetProperty(pNew, EP_CanBeNull);
}
if( ExprHasProperty(pExpr,EP_OuterON|EP_InnerON) ){
sqlite3SetJoinExpr(pNew, pExpr->w.iJoin,
pExpr->flags & (EP_OuterON|EP_InnerON));
}
sqlite3ExprDelete(db, pExpr);
pExpr = pNew;
if( pExpr->op==TK_TRUEFALSE ){
pExpr->u.iValue = sqlite3ExprTruthValue(pExpr);
pExpr->op = TK_INTEGER;
ExprSetProperty(pExpr, EP_IntValue);
if( pNew->op==TK_TRUEFALSE ){
pNew->u.iValue = sqlite3ExprTruthValue(pNew);
pNew->op = TK_INTEGER;
ExprSetProperty(pNew, EP_IntValue);
}

/* Ensure that the expression now has an implicit collation sequence,
** just as it did when it was a column of a view or sub-query. */
{
CollSeq *pNat = sqlite3ExprCollSeq(pSubst->pParse, pExpr);
CollSeq *pNat = sqlite3ExprCollSeq(pSubst->pParse, pNew);
CollSeq *pColl = sqlite3ExprCollSeq(pSubst->pParse,
pSubst->pCList->a[iColumn].pExpr
);
if( pNat!=pColl || (pExpr->op!=TK_COLUMN && pExpr->op!=TK_COLLATE) ){
pExpr = sqlite3ExprAddCollateString(pSubst->pParse, pExpr,
if( pNat!=pColl || (pNew->op!=TK_COLUMN && pNew->op!=TK_COLLATE) ){
pNew = sqlite3ExprAddCollateString(pSubst->pParse, pNew,
(pColl ? pColl->zName : "BINARY")
);
}
}
ExprClearProperty(pExpr, EP_Collate);
ExprClearProperty(pNew, EP_Collate);
if( ExprHasProperty(pExpr,EP_OuterON|EP_InnerON) ){
sqlite3SetJoinExpr(pNew, pExpr->w.iJoin,
pExpr->flags & (EP_OuterON|EP_InnerON));
}
sqlite3ExprDelete(db, pExpr);
pExpr = pNew;
}
}
}else{
Expand Down Expand Up @@ -254938,7 +254943,7 @@ static void fts5SourceIdFunc(
){
assert( nArg==0 );
UNUSED_PARAM2(nArg, apUnused);
sqlite3_result_text(pCtx, "fts5: 2024-11-25 12:07:48 b95d11e958643b969c47a8e5857f3793b9e69700b8f1469371386369a26e577e", -1, SQLITE_TRANSIENT);
sqlite3_result_text(pCtx, "fts5: 2024-12-07 20:39:59 2aabe05e2e8cae4847a802ee2daddc1d7413d8fc560254d93ee3e72c14685b6c", -1, SQLITE_TRANSIENT);
}

/*
Expand Down
6 changes: 3 additions & 3 deletions source/sqlite3.h
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,9 @@ extern "C" {
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
** [sqlite_version()] and [sqlite_source_id()].
*/
#define SQLITE_VERSION "3.47.1"
#define SQLITE_VERSION_NUMBER 3047001
#define SQLITE_SOURCE_ID "2024-11-25 12:07:48 b95d11e958643b969c47a8e5857f3793b9e69700b8f1469371386369a26e577e"
#define SQLITE_VERSION "3.47.2"
#define SQLITE_VERSION_NUMBER 3047002
#define SQLITE_SOURCE_ID "2024-12-07 20:39:59 2aabe05e2e8cae4847a802ee2daddc1d7413d8fc560254d93ee3e72c14685b6c"

/*
** CAPI3REF: Run-Time Library Version Numbers
Expand Down
Loading