sqlite-amalgamation-3410200.zip

git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4247 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
2023-03-25 00:13:39 +00:00
parent 0d9fac7363
commit 19c1784864
3 changed files with 79 additions and 37 deletions

10
deps/sqlite/shell.c vendored
View File

@ -13023,10 +13023,14 @@ static int dbdataNext(sqlite3_vtab_cursor *pCursor){
if( pCsr->bOnePage==0 && pCsr->iPgno>pCsr->szDb ) return SQLITE_OK;
rc = dbdataLoadPage(pCsr, pCsr->iPgno, &pCsr->aPage, &pCsr->nPage);
if( rc!=SQLITE_OK ) return rc;
if( pCsr->aPage ) break;
if( pCsr->aPage && pCsr->nPage>=256 ) break;
sqlite3_free(pCsr->aPage);
pCsr->aPage = 0;
if( pCsr->bOnePage ) return SQLITE_OK;
pCsr->iPgno++;
}
assert( iOff+3+2<=pCsr->nPage );
pCsr->iCell = pTab->bPtr ? -2 : 0;
pCsr->nCell = get_uint16(&pCsr->aPage[iOff+3]);
}
@ -13261,8 +13265,7 @@ static int dbdataGetEncoding(DbdataCursor *pCsr){
int nPg1 = 0;
u8 *aPg1 = 0;
rc = dbdataLoadPage(pCsr, 1, &aPg1, &nPg1);
assert( rc!=SQLITE_OK || nPg1==0 || nPg1>=512 );
if( rc==SQLITE_OK && nPg1>0 ){
if( rc==SQLITE_OK && nPg1>=(56+4) ){
pCsr->enc = get_uint32(&aPg1[56]);
}
sqlite3_free(aPg1);
@ -17921,6 +17924,7 @@ static char *shell_error_context(const char *zSql, sqlite3 *db){
if( db==0
|| zSql==0
|| (iOffset = sqlite3_error_offset(db))<0
|| iOffset>=strlen(zSql)
){
return sqlite3_mprintf("");
}