diff options
author | Mavridis Philippe <mavridisf@gmail.com> | 2024-09-30 00:04:56 +0300 |
---|---|---|
committer | Philippe Mavridis <philippe.mavridis@yandex.com> | 2025-05-15 21:00:25 +0300 |
commit | 04e86613f67d171cc965fce64a4310c0d25c98e1 (patch) | |
tree | 08a85d43bc40568f94259601339ccd7e1de11773 /kexi/3rdparty/kexisql3/src/btree.c | |
parent | cf85b9c285a2b9baa87c9d0cb9d683b48e82a475 (diff) | |
download | koffice-feat/cmake-port.tar.gz koffice-feat/cmake-port.zip |
WIP: CMake portfeat/cmake-port
Signed-off-by: Philippe Mavridis <philippe.mavridis@yandex.com>
Diffstat (limited to 'kexi/3rdparty/kexisql3/src/btree.c')
-rw-r--r-- | kexi/3rdparty/kexisql3/src/btree.c | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/kexi/3rdparty/kexisql3/src/btree.c b/kexi/3rdparty/kexisql3/src/btree.c index 472d63a60..5b82e4287 100644 --- a/kexi/3rdparty/kexisql3/src/btree.c +++ b/kexi/3rdparty/kexisql3/src/btree.c @@ -5297,7 +5297,7 @@ struct IntegrityCk { /* ** Append a message to the error message string. */ -static void checkAppendMsg( +static void chectdeAppendMsg( IntegrityCk *pCheck, char *zMsg1, const char *zFormat, @@ -5333,11 +5333,11 @@ static void checkAppendMsg( static int checkRef(IntegrityCk *pCheck, int iPage, char *zContext){ if( iPage==0 ) return 1; if( iPage>pCheck->nPage || iPage<0 ){ - checkAppendMsg(pCheck, zContext, "invalid page number %d", iPage); + chectdeAppendMsg(pCheck, zContext, "invalid page number %d", iPage); return 1; } if( pCheck->anRef[iPage]==1 ){ - checkAppendMsg(pCheck, zContext, "2nd reference to page %d", iPage); + chectdeAppendMsg(pCheck, zContext, "2nd reference to page %d", iPage); return 1; } return (pCheck->anRef[iPage]++)>1; @@ -5362,12 +5362,12 @@ static void checkPtrmap( rc = ptrmapGet(pCheck->pBt, iChild, &ePtrmapType, &iPtrmapParent); if( rc!=SQLITE_OK ){ - checkAppendMsg(pCheck, zContext, "Failed to read ptrmap key=%d", iChild); + chectdeAppendMsg(pCheck, zContext, "Failed to read ptrmap key=%d", iChild); return; } if( ePtrmapType!=eType || iPtrmapParent!=iParent ){ - checkAppendMsg(pCheck, zContext, + chectdeAppendMsg(pCheck, zContext, "Bad ptr map entry key=%d expected=(%d,%d) got=(%d,%d)", iChild, eType, iParent, ePtrmapType, iPtrmapParent); } @@ -5391,14 +5391,14 @@ static void checkList( while( N-- > 0 ){ unsigned char *pOvfl; if( iPage<1 ){ - checkAppendMsg(pCheck, zContext, + chectdeAppendMsg(pCheck, zContext, "%d of %d pages missing from overflow list starting at %d", N+1, expected, iFirst); break; } if( checkRef(pCheck, iPage, zContext) ) break; if( sqlite3pager_get(pCheck->pPager, (Pgno)iPage, (void**)&pOvfl) ){ - checkAppendMsg(pCheck, zContext, "failed to get page %d", iPage); + chectdeAppendMsg(pCheck, zContext, "failed to get page %d", iPage); break; } if( isFreeList ){ @@ -5409,7 +5409,7 @@ static void checkList( } #endif if( n>pCheck->pBt->usableSize/4-8 ){ - checkAppendMsg(pCheck, zContext, + chectdeAppendMsg(pCheck, zContext, "freelist leaf count too big on page %d", iPage); N--; }else{ @@ -5492,12 +5492,12 @@ static int checkTreePage( if( iPage==0 ) return 0; if( checkRef(pCheck, iPage, zParentContext) ) return 0; if( (rc = getPage(pBt, (Pgno)iPage, &pPage))!=0 ){ - checkAppendMsg(pCheck, zContext, + chectdeAppendMsg(pCheck, zContext, "unable to get the page. error code=%d", rc); return 0; } if( (rc = initPage(pPage, pParent))!=0 ){ - checkAppendMsg(pCheck, zContext, "initPage() returns error code %d", rc); + chectdeAppendMsg(pCheck, zContext, "initPage() returns error code %d", rc); releasePage(pPage); return 0; } @@ -5540,7 +5540,7 @@ static int checkTreePage( #endif d2 = checkTreePage(pCheck,pgno,pPage,zContext,0,0,0,0); if( i>0 && d2!=depth ){ - checkAppendMsg(pCheck, zContext, "Child page depth differs"); + chectdeAppendMsg(pCheck, zContext, "Child page depth differs"); } depth = d2; } @@ -5570,7 +5570,7 @@ static int checkTreePage( int size = cellSizePtr(pPage, &data[pc]); int j; if( (pc+size-1)>=usableSize || pc<0 ){ - checkAppendMsg(pCheck, 0, + chectdeAppendMsg(pCheck, 0, "Corruption detected in cell %d on page %d",i,iPage,0); }else{ for(j=pc+size-1; j>=pc; j--) hit[j]++; @@ -5581,7 +5581,7 @@ static int checkTreePage( int size = get2byte(&data[i+2]); int j; if( (i+size-1)>=usableSize || i<0 ){ - checkAppendMsg(pCheck, 0, + chectdeAppendMsg(pCheck, 0, "Corruption detected in cell %d on page %d",i,iPage,0); }else{ for(j=i+size-1; j>=i; j--) hit[j]++; @@ -5592,13 +5592,13 @@ static int checkTreePage( if( hit[i]==0 ){ cnt++; }else if( hit[i]>1 ){ - checkAppendMsg(pCheck, 0, + chectdeAppendMsg(pCheck, 0, "Multiple uses for byte %d of page %d", i, iPage); break; } } if( cnt!=data[hdr+7] ){ - checkAppendMsg(pCheck, 0, + chectdeAppendMsg(pCheck, 0, "Fragmented space is %d byte reported as %d on page %d", cnt, data[hdr+7], iPage); } @@ -5672,7 +5672,7 @@ char *sqlite3BtreeIntegrityCheck(Btree *pBt, int *aRoot, int nRoot){ for(i=1; i<=sCheck.nPage; i++){ #ifdef SQLITE_OMIT_AUTOVACUUM if( sCheck.anRef[i]==0 ){ - checkAppendMsg(&sCheck, 0, "Page %d is never used", i); + chectdeAppendMsg(&sCheck, 0, "Page %d is never used", i); } #else /* If the database supports auto-vacuum, make sure no tables contain @@ -5680,11 +5680,11 @@ char *sqlite3BtreeIntegrityCheck(Btree *pBt, int *aRoot, int nRoot){ */ if( sCheck.anRef[i]==0 && (PTRMAP_PAGENO(pBt->usableSize, i)!=i || !pBt->autoVacuum) ){ - checkAppendMsg(&sCheck, 0, "Page %d is never used", i); + chectdeAppendMsg(&sCheck, 0, "Page %d is never used", i); } if( sCheck.anRef[i]!=0 && (PTRMAP_PAGENO(pBt->usableSize, i)==i && pBt->autoVacuum) ){ - checkAppendMsg(&sCheck, 0, "Pointer map page %d is referenced", i); + chectdeAppendMsg(&sCheck, 0, "Pointer map page %d is referenced", i); } #endif } @@ -5693,7 +5693,7 @@ char *sqlite3BtreeIntegrityCheck(Btree *pBt, int *aRoot, int nRoot){ */ unlockBtreeIfUnused(pBt); if( nRef != *sqlite3pager_stats(pBt->pPager) ){ - checkAppendMsg(&sCheck, 0, + chectdeAppendMsg(&sCheck, 0, "Outstanding page count goes from %d to %d during this analysis", nRef, *sqlite3pager_stats(pBt->pPager) ); |