Skip to content

Commit 1d3124a

Browse files
authored
Merge pull request #44 from jlmjanssen/release/v3.47.0
Release/v3.47.0
2 parents b46194e + 42f025f commit 1d3124a

File tree

6 files changed

+10021
-4804
lines changed

6 files changed

+10021
-4804
lines changed

CMakeLists.txt

Lines changed: 78 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#
1111
# ------------------------------------------------------------------------------
1212

13-
cmake_minimum_required(VERSION 3.16...3.25.2)
13+
cmake_minimum_required(VERSION 3.23...3.30)
1414

1515
# -- Project -------------------------------------------------------------------
1616

@@ -171,37 +171,28 @@ if(SQLITE_ENABLE_ICU)
171171
find_package(ICU REQUIRED COMPONENTS i18n uc)
172172
endif()
173173

174-
if(SQLITE_THREADSAFE STREQUAL "0")
175-
message(STATUS "Building the SQLite3 library in single-threading mode")
176-
set(SQLITE_THREADMODEL_SUFFIX "-st")
177-
elseif(SQLITE_THREADSAFE STREQUAL "1")
178-
message(STATUS "Building the SQLite3 library in serialized mode")
179-
set(SQLITE_THREADMODEL_SUFFIX "")
180-
elseif(SQLITE_THREADSAFE STREQUAL "2")
181-
message(STATUS "Building the SQLite3 library in multi-threading mode")
182-
set(SQLITE_THREADMODEL_SUFFIX "-mt")
183-
endif()
184-
185174
if(UNIX)
186175
find_library(MATH_LIBRARY m)
187176
endif()
188177

189-
if(UNIX)
190-
find_package(PkgConfig)
191-
if(PKG_CONFIG_FOUND)
192-
pkg_search_module(Readline IMPORTED_TARGET readline)
193-
endif()
194-
endif()
195-
196-
find_package(ZLIB)
197-
198178
# -- Library -------------------------------------------------------------------
199179

200180
option(BUILD_SHARED_LIBS "Build using shared libraries." OFF)
201181

202182
add_library(SQLite3)
203183
add_library(SQLite::SQLite3 ALIAS SQLite3)
204184

185+
if(SQLITE_THREADSAFE STREQUAL "0")
186+
message(STATUS "Building the SQLite3 library in single-threading mode")
187+
set(SQLITE_THREADMODEL_SUFFIX "-st")
188+
elseif(SQLITE_THREADSAFE STREQUAL "1")
189+
message(STATUS "Building the SQLite3 library in serialized mode")
190+
set(SQLITE_THREADMODEL_SUFFIX "")
191+
elseif(SQLITE_THREADSAFE STREQUAL "2")
192+
message(STATUS "Building the SQLite3 library in multi-threading mode")
193+
set(SQLITE_THREADMODEL_SUFFIX "-mt")
194+
endif()
195+
205196
set_target_properties(SQLite3 PROPERTIES
206197
OUTPUT_NAME sqlite3${SQLITE_THREADMODEL_SUFFIX}
207198
DEBUG_POSTFIX "-dbg"
@@ -211,20 +202,36 @@ set_target_properties(SQLite3 PROPERTIES
211202
WINDOWS_EXPORT_ALL_SYMBOLS ON)
212203

213204
target_sources(SQLite3
214-
PRIVATE source/sqlite3.c)
205+
PRIVATE source/sqlite3.c
206+
PUBLIC FILE_SET HEADERS BASE_DIRS source
207+
FILES source/sqlite3.h source/sqlite3ext.h)
215208

216209
target_include_directories(SQLite3
217210
INTERFACE
218211
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/source>
219212
$<INSTALL_INTERFACE:include>)
220213

214+
if(SQLITE_ENABLE_PREUPDATE_HOOK)
215+
target_compile_definitions(SQLite3 PUBLIC SQLITE_ENABLE_PREUPDATE_HOOK)
216+
endif()
217+
218+
if(SQLITE_ENABLE_SESSION)
219+
target_compile_definitions(SQLite3 PUBLIC SQLITE_ENABLE_SESSION)
220+
endif()
221+
222+
if(SQLITE_OMIT_COMPILEOPTION_DIAGS)
223+
target_compile_definitions(SQLite3 PUBLIC SQLITE_OMIT_COMPILEOPTION_DIAGS)
224+
endif()
225+
226+
if(SQLITE_OMIT_DEPRECATED)
227+
target_compile_definitions(SQLite3 PUBLIC SQLITE_OMIT_DEPRECATED)
228+
endif()
229+
230+
if(SQLITE_OMIT_LOAD_EXTENSION)
231+
target_compile_definitions(SQLite3 PUBLIC SQLITE_OMIT_LOAD_EXTENSION)
232+
endif()
233+
221234
target_compile_definitions(SQLite3
222-
PUBLIC
223-
$<$<BOOL:${SQLITE_ENABLE_PREUPDATE_HOOK}>:SQLITE_ENABLE_PREUPDATE_HOOK>
224-
$<$<BOOL:${SQLITE_ENABLE_SESSION}>:SQLITE_ENABLE_SESSION>
225-
$<$<BOOL:${SQLITE_OMIT_COMPILEOPTION_DIAGS}>:SQLITE_OMIT_COMPILEOPTION_DIAGS>
226-
$<$<BOOL:${SQLITE_OMIT_DEPRECATED}>:SQLITE_OMIT_DEPRECATED>
227-
$<$<BOOL:${SQLITE_OMIT_LOAD_EXTENSION}>:SQLITE_OMIT_LOAD_EXTENSION>
228235
PRIVATE
229236
SQLITE_DEFAULT_MEMSTATUS=${SQLITE_DEFAULT_MEMSTATUS}
230237
SQLITE_DEFAULT_SYNCHRONOUS=${SQLITE_DEFAULT_SYNCHRONOUS}
@@ -291,59 +298,63 @@ target_compile_definitions(SQLite3
291298
$<$<BOOL:${HAVE_UTIME}>:HAVE_UTIME>)
292299

293300
if(MATH_LIBRARY)
294-
target_link_libraries(SQLite3
295-
INTERFACE $<$<NOT:$<BOOL:${BUILD_SHARED_LIBS}>>:${MATH_LIBRARY}>
296-
PRIVATE $<$<BOOL:${BUILD_SHARED_LIBS}>:${MATH_LIBRARY}>)
301+
target_link_libraries(SQLite3 PUBLIC ${MATH_LIBRARY})
297302
endif()
298303

299304
if(TARGET Threads::Threads)
300-
target_link_libraries(SQLite3
301-
INTERFACE $<$<NOT:$<BOOL:${BUILD_SHARED_LIBS}>>:Threads::Threads>
302-
PRIVATE $<$<BOOL:${BUILD_SHARED_LIBS}>:Threads::Threads>)
305+
target_link_libraries(SQLite3 PUBLIC Threads::Threads)
303306
endif()
304307

305308
if(NOT SQLITE_OMIT_LOAD_EXTENSION)
306-
target_link_libraries(SQLite3
307-
INTERFACE $<$<NOT:$<BOOL:${BUILD_SHARED_LIBS}>>:${CMAKE_DL_LIBS}>
308-
PRIVATE $<$<BOOL:${BUILD_SHARED_LIBS}>:${CMAKE_DL_LIBS}>)
309+
target_link_libraries(SQLite3 PUBLIC ${CMAKE_DL_LIBS})
309310
endif()
310311

311312
if(SQLITE_ENABLE_ICU)
312-
target_link_libraries(SQLite3
313-
INTERFACE $<$<NOT:$<BOOL:${BUILD_SHARED_LIBS}>>:ICU::i18n ICU::uc>
314-
PRIVATE $<$<BOOL:${BUILD_SHARED_LIBS}>:ICU::i18n ICU::uc>)
313+
target_link_libraries(SQLite3 PUBLIC ICU::i18n ICU::uc)
315314
endif()
316315

317316
# -- Interactive shell ---------------------------------------------------------
318317

319-
add_executable(Shell)
320-
add_executable(SQLite::Shell ALIAS Shell)
318+
option(SQLITE_BUILD_SHELL "Build the SQLite3 interactive shell." ON)
321319

322-
set_target_properties(Shell PROPERTIES
323-
OUTPUT_NAME sqlite3
324-
INSTALL_RPATH "$ORIGIN/../lib")
320+
if(SQLITE_BUILD_SHELL)
321+
add_executable(Shell)
322+
add_executable(SQLite::Shell ALIAS Shell)
325323

326-
target_sources(Shell
327-
PRIVATE source/shell.c)
324+
set_target_properties(Shell PROPERTIES
325+
OUTPUT_NAME sqlite3
326+
INSTALL_RPATH "$ORIGIN/../lib")
328327

329-
target_link_libraries(Shell
330-
PRIVATE SQLite::SQLite3)
328+
target_sources(Shell
329+
PRIVATE source/shell.c)
331330

332-
if(TARGET PkgConfig::Readline)
333-
target_compile_definitions(Shell PRIVATE HAVE_READLINE)
334-
target_link_libraries(Shell PRIVATE PkgConfig::Readline)
335-
endif()
331+
target_link_libraries(Shell PRIVATE SQLite::SQLite3)
332+
333+
if(UNIX)
334+
find_package(PkgConfig)
335+
if(PKG_CONFIG_FOUND)
336+
pkg_search_module(Readline IMPORTED_TARGET readline)
337+
endif()
338+
endif()
339+
340+
find_package(ZLIB)
336341

337-
if(TARGET ZLIB::ZLIB)
338-
target_compile_definitions(Shell PRIVATE SQLITE_HAVE_ZLIB)
339-
target_link_libraries(Shell PRIVATE ZLIB::ZLIB)
342+
if(TARGET PkgConfig::Readline)
343+
target_compile_definitions(Shell PRIVATE HAVE_READLINE)
344+
target_link_libraries(Shell PRIVATE PkgConfig::Readline)
345+
endif()
346+
347+
if(TARGET ZLIB::ZLIB)
348+
target_compile_definitions(Shell PRIVATE SQLITE_HAVE_ZLIB)
349+
target_link_libraries(Shell PRIVATE ZLIB::ZLIB)
350+
endif()
340351
endif()
341352

342353
# -- Testing -------------------------------------------------------------------
343354

344355
option(BUILD_TESTING "Build the testing tree." ON)
345356

346-
if(BUILD_TESTING)
357+
if(BUILD_TESTING AND SQLITE_BUILD_SHELL)
347358
enable_testing()
348359
add_test(NAME SQLiteShellCheckVersion
349360
COMMAND SQLite::Shell -version)
@@ -355,21 +366,23 @@ endif()
355366

356367
include(GNUInstallDirs)
357368

358-
install(TARGETS SQLite3 Shell
359-
EXPORT SQLite3Targets)
369+
install(TARGETS SQLite3
370+
EXPORT SQLite3Targets
371+
FILE_SET HEADERS)
360372

361-
install(FILES source/sqlite3.h
362-
source/sqlite3ext.h
363-
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
373+
if(SQLITE_BUILD_SHELL)
374+
install(TARGETS Shell
375+
EXPORT SQLite3Targets)
376+
endif()
364377

365378
# -- Export --------------------------------------------------------------------
366379

367380
install(EXPORT SQLite3Targets
368-
FILE SQLite3Targets.cmake
369-
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/SQLite3
370-
NAMESPACE SQLite::)
381+
NAMESPACE SQLite::
382+
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/SQLite3)
371383

372384
export(EXPORT SQLite3Targets
385+
NAMESPACE SQLite::
373386
FILE ${CMAKE_CURRENT_BINARY_DIR}/SQLite3Targets.cmake)
374387

375388
include(CMakePackageConfigHelpers)

source/CHANGELOG.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,41 @@
11
# Changelog
22

3+
## SQLite Release 3.47.0 On 2024-10-21
4+
5+
1. Allow arbitrary expressions in the second argument to the RAISE function.
6+
2. If the RHS of the ->> operator is negative, then access array elements counting from the right.
7+
3. Fix a problem with rolling back hot journal files in the seldom-used unix-dotfile VFS.
8+
4. FTS5 tables can now be dropped even if they use a non-standard tokenizer that has not been registered.
9+
5. Fix the group_concat() aggregate function so that it returns an empty string, not a NULL, if it receives a single input value which is an empty string.
10+
6. Enhance the generate_series() table-valued function so that it is able to recognize and use constraints on its output value.
11+
7. Preupdate hooks now recognize when a column added by ALTER TABLE ADD COLUMN has a non-null default value.
12+
8. Performance optimizations:
13+
1. Improved reuse of subqueries associated with the IN operator, especially when the IN operator has been duplicated due to predicate push-down.
14+
2. Use a Bloom filter on subqueries on the right-hand side of the IN operator, in cases where that seems likely to improve performance.
15+
3. Ensure that queries like "SELECT func(a) FROM tab GROUP BY 1" only invoke the func() function once per row.
16+
4. No attempt is made to create automatic indexes on a column that is known to be non-selective because of its use in other indexes that have been analyzed.
17+
5. Adjustments to the query planner so that it produces better plans for star queries with a large number of dimension tables.
18+
6. Add the "order-by-subquery" optimization, that seeks to disable sort operations in outer queries if the desired order is obtained naturally due to ORDER BY clauses in subqueries.
19+
7. The "indexed-subtype-expr" optimization strives to use expressions that are part of an index rather than recomputing the expression based on table values, as long as the query planner can prove that the subtype of the expression will never be used.
20+
8. Miscellaneous coding tweaks for faster runtimes.
21+
9. Enhancements to SQLite-related command-line programs:
22+
1. Add the experimental sqlite3_rsync program.
23+
2. Add extension functions median(), percentile(), percentile_cont(), and percentile_disc() to the CLI.
24+
3. Add the .www dot-command to the CLI.
25+
4. The sqlite3_analyzer utility now provides a break-out of statistics for WITHOUT ROWID tables.
26+
5. The sqldiff utility avoids creating an empty database if its second argument does not exist.
27+
10. Enhance the sqlite_dbpage table-valued function such that INSERT can be used to increase or decrease the size of the database file.
28+
11. SQLite no longer makes any use of the "long double" data type, as hardware support for long double is becoming less common and long double creates challenges for some compiler tool chains. Instead, SQLite uses [Dekker's algorithm](https://csclub.uwaterloo.ca/~pbarfuss/dekker1971.pdf) when extended precision is needed.
29+
12. The TCL Interface for SQLite supports TCL9. Everything probably still works for TCL 8.5 and later, though this is not guaranteed. Users are encouraged to upgrade to TCL9.
30+
13. JavaScript/WASM:
31+
1. Fix a corruption-causing bug in the JavaScript "opfs" VFS.
32+
2. Correct "mode=ro" handling for the "opfs" VFS.
33+
3. Work around a couple of browser-specific OPFS quirks.
34+
14. FTS5 Changes:
35+
1. Add the fts5_tokenizer_v2 API and the locale=1 option, for creating custom locale-aware tokenizers and fts5 tables that may take advantage of them.
36+
2. Add the contentless_unindexed=1 option, for creating contentless fts5 tables that store the values of any UNINDEXED columns persistently in the database.
37+
3. Allow an FTS5 table to be dropped even if it uses a custom tokenizer whose implementation is not available.
38+
339
## SQLite Release 3.46.1 On 2024-08-13
440

541
1. Improved robustness while parsing the tokenize= arguments in FTS5. Forum post 171bcc2bcd.

source/README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
Download: https://sqlite.org/2024/sqlite-amalgamation-3460100.zip
1+
Download: https://sqlite.org/2024/sqlite-amalgamation-3470000.zip
22

33
```
4-
Archive: sqlite-amalgamation-3460100.zip
4+
Archive: sqlite-amalgamation-3470000.zip
55
Length Method Size Cmpr Date Time CRC-32 Name
66
-------- ------ ------- ---- ---------- ----- -------- ----
7-
0 Stored 0 0% 2024-08-13 13:02 00000000 sqlite-amalgamation-3460100/
8-
9089564 Defl:N 2341816 74% 2024-08-13 13:02 a9a33f43 sqlite-amalgamation-3460100/sqlite3.c
9-
958266 Defl:N 247900 74% 2024-08-13 13:02 2a9cd0d9 sqlite-amalgamation-3460100/shell.c
10-
644069 Defl:N 166685 74% 2024-08-13 13:02 e4c8855a sqlite-amalgamation-3460100/sqlite3.h
11-
38149 Defl:N 6615 83% 2024-08-13 13:02 c5ea7fc8 sqlite-amalgamation-3460100/sqlite3ext.h
7+
0 Stored 0 0% 2024-10-21 18:48 00000000 sqlite-amalgamation-3470000/
8+
9193275 Defl:N 2367775 74% 2024-10-21 18:48 771e2638 sqlite-amalgamation-3470000/sqlite3.c
9+
1044127 Defl:N 267023 74% 2024-10-21 18:48 c073b82b sqlite-amalgamation-3470000/shell.c
10+
650689 Defl:N 168160 74% 2024-10-21 18:48 33ab194f sqlite-amalgamation-3470000/sqlite3.h
11+
38149 Defl:N 6615 83% 2024-10-21 18:48 c5ea7fc8 sqlite-amalgamation-3470000/sqlite3ext.h
1212
-------- ------- --- -------
13-
10730048 2763016 74% 5 files
13+
10926240 2809573 74% 5 files
1414
```

0 commit comments

Comments
 (0)