Skip to content

Commit 5d37f90

Browse files
authored
Merge pull request #147 from CV-Bowen/bug
unqlite: bug fix, assgin the pEngine->pHeader when get the page one
2 parents 9c4cd30 + 799d2b5 commit 5d37f90

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

unqlite.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49654,7 +49654,7 @@ static int lhRecordLookup(
4965449654
sxu32 nHash;
4965549655
int rc;
4965649656
/* Acquire the first page (hash Header) so that everything gets loaded autmatically */
49657-
rc = pEngine->pIo->xGet(pEngine->pIo->pHandle,1,0);
49657+
rc = pEngine->pIo->xGet(pEngine->pIo->pHandle,1,&pEngine->pHeader);
4965849658
if( rc != UNQLITE_OK ){
4965949659
return rc;
4966049660
}
@@ -51094,7 +51094,7 @@ static int lh_record_insert(
5109451094
int rc;
5109551095

5109651096
/* Acquire the first page (DB hash Header) so that everything gets loaded automatically */
51097-
rc = pEngine->pIo->xGet(pEngine->pIo->pHandle,1,0);
51097+
rc = pEngine->pIo->xGet(pEngine->pIo->pHandle,1,&pEngine->pHeader);
5109851098
if( rc != UNQLITE_OK ){
5109951099
return rc;
5110051100
}
@@ -51530,7 +51530,7 @@ static int lhCursorFirst(unqlite_kv_cursor *pCursor)
5153051530
int rc;
5153151531
if( pCur->is_first ){
5153251532
/* Read the database header first */
51533-
rc = pEngine->pIo->xGet(pEngine->pIo->pHandle,1,0);
51533+
rc = pEngine->pIo->xGet(pEngine->pIo->pHandle,1,&pEngine->pHeader);
5153451534
if( rc != UNQLITE_OK ){
5153551535
return rc;
5153651536
}
@@ -51552,7 +51552,7 @@ static int lhCursorLast(unqlite_kv_cursor *pCursor)
5155251552
int rc;
5155351553
if( pCur->is_first ){
5155451554
/* Read the database header first */
51555-
rc = pEngine->pIo->xGet(pEngine->pIo->pHandle,1,0);
51555+
rc = pEngine->pIo->xGet(pEngine->pIo->pHandle,1,&pEngine->pHeader);
5155651556
if( rc != UNQLITE_OK ){
5155751557
return rc;
5155851558
}

0 commit comments

Comments
 (0)