Skip to content

Release/v3.46.1 #43

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Sep 11, 2024
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
13 changes: 13 additions & 0 deletions source/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Changelog

## SQLite Release 3.46.1 On 2024-08-13

1. Improved robustness while parsing the tokenize= arguments in FTS5. Forum post 171bcc2bcd.
2. Enhancements to covering index prediction in the query planner. Add early detection of over-prediction of covering indexes so that sqlite3_prepare() will return an error rather than just generate bad bytecode. Forum post e60e4c295d22f8ce.
3. Do not let the number of terms on a VALUES clause be limited by SQLITE_LIMIT_COMPOUND_SELECT, even if the VALUES clause contains elements that appear to be variables due to double-quoted string literals.
4. Fix the window function version of group_concat() so that it returns an empty string if it has one or more empty string inputs.
5. In FTS5 secure-delete mode, fix false-positive integrity-check reports about corrupt indexes.
6. Syntax errors in ALTER TABLE should always return SQLITE_ERROR. In some cases, they were formerly returning SQLITE_INTERNAL.
7. JavaScript/WASM:
1. Fix a corruption-causing bug in the JavaScript "opfs" VFS.
2. Work around a couple of browser-specific OPFS quirks.
8. Other minor fixes.

## SQLite Release 3.46.0 On 2024-05-23

1. Enhance PRAGMA optimize in multiple ways, to make it simpler to use:
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-3460000.zip
Download: https://sqlite.org/2024/sqlite-amalgamation-3460100.zip

```
Archive: sqlite-amalgamation-3460000.zip
Archive: sqlite-amalgamation-3460100.zip
Length Method Size Cmpr Date Time CRC-32 Name
-------- ------ ------- ---- ---------- ----- -------- ----
0 Stored 0 0% 2024-05-23 15:51 00000000 sqlite-amalgamation-3460000/
9089040 Defl:N 2341603 74% 2024-05-23 15:51 89547100 sqlite-amalgamation-3460000/sqlite3.c
957898 Defl:N 247821 74% 2024-05-23 15:51 291389cf sqlite-amalgamation-3460000/shell.c
644069 Defl:N 166685 74% 2024-05-23 15:51 fc181678 sqlite-amalgamation-3460000/sqlite3.h
38149 Defl:N 6615 83% 2024-05-23 15:51 c5ea7fc8 sqlite-amalgamation-3460000/sqlite3ext.h
0 Stored 0 0% 2024-08-13 13:02 00000000 sqlite-amalgamation-3460100/
9089564 Defl:N 2341816 74% 2024-08-13 13:02 a9a33f43 sqlite-amalgamation-3460100/sqlite3.c
958266 Defl:N 247900 74% 2024-08-13 13:02 2a9cd0d9 sqlite-amalgamation-3460100/shell.c
644069 Defl:N 166685 74% 2024-08-13 13:02 e4c8855a sqlite-amalgamation-3460100/sqlite3.h
38149 Defl:N 6615 83% 2024-08-13 13:02 c5ea7fc8 sqlite-amalgamation-3460100/sqlite3ext.h
-------- ------- --- -------
10729156 2762724 74% 5 files
10730048 2763016 74% 5 files
```
40 changes: 22 additions & 18 deletions source/shell.c
Original file line number Diff line number Diff line change
Expand Up @@ -604,11 +604,6 @@ zSkipValidUtf8(const char *z, int nAccept, long ccm);
# define CIO_WIN_WC_XLATE 0 /* Not exposing translation routines at all */
#endif

#if CIO_WIN_WC_XLATE
/* Character used to represent a known-incomplete UTF-8 char group (�) */
static WCHAR cBadGroup = 0xfffd;
#endif

#if CIO_WIN_WC_XLATE
static HANDLE handleOfFile(FILE *pf){
int fileDesc = _fileno(pf);
Expand Down Expand Up @@ -12547,7 +12542,7 @@ static int expertFilter(
pCsr->pData = 0;
if( rc==SQLITE_OK ){
rc = idxPrintfPrepareStmt(pExpert->db, &pCsr->pData, &pVtab->base.zErrMsg,
"SELECT * FROM main.%Q WHERE sample()", pVtab->pTab->zName
"SELECT * FROM main.%Q WHERE sqlite_expert_sample()", pVtab->pTab->zName
);
}

Expand Down Expand Up @@ -13421,7 +13416,7 @@ struct IdxRemCtx {
};

/*
** Implementation of scalar function rem().
** Implementation of scalar function sqlite_expert_rem().
*/
static void idxRemFunc(
sqlite3_context *pCtx,
Expand All @@ -13434,7 +13429,7 @@ static void idxRemFunc(
assert( argc==2 );

iSlot = sqlite3_value_int(argv[0]);
assert( iSlot<=p->nSlot );
assert( iSlot<p->nSlot );
pSlot = &p->aSlot[iSlot];

switch( pSlot->eType ){
Expand Down Expand Up @@ -13545,7 +13540,8 @@ static int idxPopulateOneStat1(
const char *zName = (const char*)sqlite3_column_text(pIndexXInfo, 0);
const char *zColl = (const char*)sqlite3_column_text(pIndexXInfo, 1);
zCols = idxAppendText(&rc, zCols,
"%sx.%Q IS rem(%d, x.%Q) COLLATE %s", zComma, zName, nCol, zName, zColl
"%sx.%Q IS sqlite_expert_rem(%d, x.%Q) COLLATE %s",
zComma, zName, nCol, zName, zColl
);
zOrder = idxAppendText(&rc, zOrder, "%s%d", zComma, ++nCol);
}
Expand Down Expand Up @@ -13678,13 +13674,13 @@ static int idxPopulateStat1(sqlite3expert *p, char **pzErr){

if( rc==SQLITE_OK ){
sqlite3 *dbrem = (p->iSample==100 ? p->db : p->dbv);
rc = sqlite3_create_function(
dbrem, "rem", 2, SQLITE_UTF8, (void*)pCtx, idxRemFunc, 0, 0
rc = sqlite3_create_function(dbrem, "sqlite_expert_rem",
2, SQLITE_UTF8, (void*)pCtx, idxRemFunc, 0, 0
);
}
if( rc==SQLITE_OK ){
rc = sqlite3_create_function(
p->db, "sample", 0, SQLITE_UTF8, (void*)&samplectx, idxSampleFunc, 0, 0
rc = sqlite3_create_function(p->db, "sqlite_expert_sample",
0, SQLITE_UTF8, (void*)&samplectx, idxSampleFunc, 0, 0
);
}

Expand Down Expand Up @@ -13736,6 +13732,9 @@ static int idxPopulateStat1(sqlite3expert *p, char **pzErr){
rc = sqlite3_exec(p->dbm, "ANALYZE sqlite_schema", 0, 0, 0);
}

sqlite3_create_function(p->db, "sqlite_expert_rem", 2, SQLITE_UTF8, 0,0,0,0);
sqlite3_create_function(p->db, "sqlite_expert_sample", 0,SQLITE_UTF8,0,0,0,0);

sqlite3_exec(p->db, "DROP TABLE IF EXISTS temp."UNIQUE_TABLE_NAME,0,0,0);
return rc;
}
Expand Down Expand Up @@ -16836,8 +16835,8 @@ static int recoverError(
va_start(ap, zFmt);
if( zFmt ){
z = sqlite3_vmprintf(zFmt, ap);
va_end(ap);
}
va_end(ap);
sqlite3_free(p->zErrMsg);
p->zErrMsg = z;
p->errCode = errCode;
Expand Down Expand Up @@ -27085,7 +27084,6 @@ static int do_meta_command(char *zLine, ShellState *p){
import_cleanup(&sCtx);
shell_out_of_memory();
}
nByte = strlen(zSql);
rc = sqlite3_prepare_v2(p->db, zSql, -1, &pStmt, 0);
sqlite3_free(zSql);
zSql = 0;
Expand All @@ -27104,16 +27102,21 @@ static int do_meta_command(char *zLine, ShellState *p){
sqlite3_finalize(pStmt);
pStmt = 0;
if( nCol==0 ) return 0; /* no columns, no error */
zSql = sqlite3_malloc64( nByte*2 + 20 + nCol*2 );

nByte = 64 /* space for "INSERT INTO", "VALUES(", ")\0" */
+ (zSchema ? strlen(zSchema)*2 + 2: 0) /* Quoted schema name */
+ strlen(zTable)*2 + 2 /* Quoted table name */
+ nCol*2; /* Space for ",?" for each column */
zSql = sqlite3_malloc64( nByte );
if( zSql==0 ){
import_cleanup(&sCtx);
shell_out_of_memory();
}
if( zSchema ){
sqlite3_snprintf(nByte+20, zSql, "INSERT INTO \"%w\".\"%w\" VALUES(?",
sqlite3_snprintf(nByte, zSql, "INSERT INTO \"%w\".\"%w\" VALUES(?",
zSchema, zTable);
}else{
sqlite3_snprintf(nByte+20, zSql, "INSERT INTO \"%w\" VALUES(?", zTable);
sqlite3_snprintf(nByte, zSql, "INSERT INTO \"%w\" VALUES(?", zTable);
}
j = strlen30(zSql);
for(i=1; i<nCol; i++){
Expand All @@ -27122,6 +27125,7 @@ static int do_meta_command(char *zLine, ShellState *p){
}
zSql[j++] = ')';
zSql[j] = 0;
assert( j<nByte );
if( eVerbose>=2 ){
oputf("Insert using: %s\n", zSql);
}
Expand Down
Loading