Skip to content

Commit 534e7fd

Browse files
authored
Merge pull request #51 from jlmjanssen/release/v3.49.0
feat: import release 3.49.0
2 parents f913a83 + e4ff87b commit 534e7fd

File tree

5 files changed

+2404
-1875
lines changed

5 files changed

+2404
-1875
lines changed

source/CHANGELOG.md

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

3+
## SQLite Release 3.49.0 On 2025-02-06
4+
5+
1. Enhancements to the query planner:
6+
1. Improve the query-time index optimization so that it works on WITHOUT ROWID tables.
7+
2. Better query plans for large star-query joins. This fixes three different performance regressions that were reported on the SQLite Forum.
8+
3. When two or more queries have the same estimated cost, use the one with the fewer bytes per row.
9+
2. Enhance the iif() SQL function so that it can accept any number of arguments greater than or equal to two.
10+
3. Enhance the session extension so that it works on databases that make use of generated columns.
11+
4. Omit the SQLITE_USE_STDIO_FOR_CONSOLE compile-time option which was not implemented correctly and never worked right. In its place add the SQLITE_USE_W32_FOR_CONSOLE_IO compile-time option. This option applies to command-line tools like the CLI only, not to the SQLite core. It causes Win32 APIs to be used for console I/O instead of stdio. This option affects Windows builds only.
12+
5. Three new options to sqlite3_db_config(). All default to "on".
13+
1. SQLITE_DBCONFIG_ENABLE_ATTACH_CREATE
14+
2. SQLITE_DBCONFIG_ENABLE_ATTACH_WRITE
15+
3. SQLITE_DBCONFIG_ENABLE_COMMENTS
16+
6. Replace Autotools with Autosetup for the configure script used in the precompiled amalgamation tarball. The configure script for the canonical source code was changed to Autosetup in the previous (3.48.0) release. Only the main SQLite configure script in the amalgamation tarball is changed. The (deprecated) configuration script use by TEA subdirectory of the amalgamation tarball still relies on Autotools.
17+
7. Various minor patches and fixes for problems seen in the 3.48.0 release.
18+
319
## SQLite Release 3.48.0 On 2025-01-14
420

521
1. Refactor the "configure" script used to help build SQLite from canonical sources, to fix bugs, improve performance, and make the code more maintainable.

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/2025/sqlite-amalgamation-3480000.zip
1+
Download: https://sqlite.org/2025/sqlite-amalgamation-3490000.zip
22

33
```
4-
Archive: sqlite-amalgamation-3480000.zip
4+
Archive: sqlite-amalgamation-3490000.zip
55
Length Method Size Cmpr Date Time CRC-32 Name
66
-------- ------ ------- ---- ---------- ----- -------- ----
7-
0 Stored 0 0% 2025-01-14 12:22 00000000 sqlite-amalgamation-3480000/
8-
9215145 Defl:N 2374125 74% 2025-01-14 12:22 2ab2f383 sqlite-amalgamation-3480000/sqlite3.c
9-
1055648 Defl:N 269788 74% 2025-01-14 12:22 153c494b sqlite-amalgamation-3480000/shell.c
10-
653276 Defl:N 168945 74% 2025-01-14 12:22 addf6ccf sqlite-amalgamation-3480000/sqlite3.h
11-
38149 Defl:N 6615 83% 2025-01-14 12:22 c5ea7fc8 sqlite-amalgamation-3480000/sqlite3ext.h
7+
0 Stored 0 0% 2025-02-06 14:59 00000000 sqlite-amalgamation-3490000/
8+
9232623 Defl:N 2378534 74% 2025-02-06 14:59 192a8c39 sqlite-amalgamation-3490000/sqlite3.c
9+
1056211 Defl:N 269962 74% 2025-02-06 14:59 028b8fa6 sqlite-amalgamation-3490000/shell.c
10+
658960 Defl:N 170172 74% 2025-02-06 14:59 6d20a34a sqlite-amalgamation-3490000/sqlite3.h
11+
38149 Defl:N 6615 83% 2025-02-06 14:59 c5ea7fc8 sqlite-amalgamation-3490000/sqlite3ext.h
1212
-------- ------- --- -------
13-
10962218 2819473 74% 5 files
13+
10985943 2825283 74% 5 files
1414
```

source/shell.c

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,11 @@ void sqlite3_fsetmode(FILE *stream, int mode);
357357
** use O_U8TEXT when writing to the Windows console (or anything
358358
** else for which _isatty() returns true) and to use O_BINARY or O_TEXT
359359
** for all other output channels.
360+
**
361+
** The SQLITE_USE_W32_FOR_CONSOLE_IO macro is also available. If
362+
** defined, it forces the use of Win32 APIs for all console I/O, both
363+
** input and output. This is necessary for some non-Microsoft run-times
364+
** that implement stdio differently from Microsoft/Visual-Studio.
360365
*/
361366
#if defined(SQLITE_U8TEXT_ONLY)
362367
# define UseWtextForOutput(fd) 1
@@ -459,10 +464,10 @@ char *sqlite3_fgets(char *buf, int sz, FILE *in){
459464
*/
460465
wchar_t *b1 = sqlite3_malloc( sz*sizeof(wchar_t) );
461466
if( b1==0 ) return 0;
462-
#ifndef SQLITE_USE_STDIO_FOR_CONSOLE
467+
#ifdef SQLITE_USE_W32_FOR_CONSOLE_IO
463468
DWORD nRead = 0;
464469
if( IsConsole(in)
465-
&& ReadConsoleW(GetStdHandle(STD_INPUT_HANDLE), b1, sz, &nRead, 0)
470+
&& ReadConsoleW(GetStdHandle(STD_INPUT_HANDLE), b1, sz-1, &nRead, 0)
466471
){
467472
b1[nRead] = 0;
468473
}else
@@ -537,7 +542,7 @@ int sqlite3_fputs(const char *z, FILE *out){
537542
sz = MultiByteToWideChar(CP_UTF8, 0, z, sz, b1, sz);
538543
b1[sz] = 0;
539544

540-
#ifndef SQLITE_STDIO_FOR_CONSOLE
545+
#ifdef SQLITE_USE_W32_FOR_CONSOLE_IO
541546
DWORD nWr = 0;
542547
if( IsConsole(out)
543548
&& WriteConsoleW(GetStdHandle(STD_OUTPUT_HANDLE),b1,sz,&nWr,0)
@@ -547,8 +552,9 @@ int sqlite3_fputs(const char *z, FILE *out){
547552
}else
548553
#endif
549554
{
550-
/* For non-console I/O, or if SQLITE_USE_STDIO_FOR_CONSOLE is defined
551-
** then write using the standard library. */
555+
/* As long as SQLITE_USE_W32_FOR_CONSOLE_IO is not defined, or for
556+
** non-console I/O even if that macro is defined, write using the
557+
** standard library. */
552558
_setmode(_fileno(out), _O_U8TEXT);
553559
if( UseBinaryWText(out) ){
554560
piecemealOutput(b1, sz, out);
@@ -5314,7 +5320,7 @@ static u8* fromBase64( char *pIn, int ncIn, u8 *pOut ){
53145320
deliberate_fall_through; /* FALLTHRU */
53155321
case 1:
53165322
pOut[0] = (qv>>16) & 0xff;
5317-
deliberate_fall_through; /* FALLTHRU */
5323+
break;
53185324
}
53195325
pOut += nbo;
53205326
}
@@ -17199,7 +17205,7 @@ static void vfstraceDlClose(sqlite3_vfs *pVfs, void *pHandle){
1719917205
vfstrace_info *pInfo = (vfstrace_info*)pVfs->pAppData;
1720017206
sqlite3_vfs *pRoot = pInfo->pRootVfs;
1720117207
vfstraceOnOff(pInfo, VTR_DLCLOSE);
17202-
vfstrace_printf(pInfo, "%s.xDlOpen()\n", pInfo->zVfsName);
17208+
vfstrace_printf(pInfo, "%s.xDlClose()\n", pInfo->zVfsName);
1720317209
pRoot->xDlClose(pRoot, pHandle);
1720417210
}
1720517211

@@ -28885,6 +28891,9 @@ static int do_meta_command(char *zLine, ShellState *p){
2888528891
const char *zName;
2888628892
int op;
2888728893
} aDbConfig[] = {
28894+
{ "attach_create", SQLITE_DBCONFIG_ENABLE_ATTACH_CREATE },
28895+
{ "attach_write", SQLITE_DBCONFIG_ENABLE_ATTACH_WRITE },
28896+
{ "comments", SQLITE_DBCONFIG_ENABLE_COMMENTS },
2888828897
{ "defensive", SQLITE_DBCONFIG_DEFENSIVE },
2888928898
{ "dqs_ddl", SQLITE_DBCONFIG_DQS_DDL },
2889028899
{ "dqs_dml", SQLITE_DBCONFIG_DQS_DML },
@@ -31635,6 +31644,7 @@ static int do_meta_command(char *zLine, ShellState *p){
3163531644
{ 0x04000000, 1, "NullUnusedCols" },
3163631645
{ 0x08000000, 1, "OnePass" },
3163731646
{ 0x10000000, 1, "OrderBySubq" },
31647+
{ 0x20000000, 1, "StarQuery" },
3163831648
{ 0xffffffff, 0, "All" },
3163931649
};
3164031650
unsigned int curOpt;

0 commit comments

Comments
 (0)