2009-06-06 02:24 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)

* harbour/source/rdd/dbfnsx/dbfnsx1.c
    ! fixed stupid typo in C else block scope which caused false alarm
      about corrupted index. Many thanks to Vitor Mangabeira for information
      and self contain example.
This commit is contained in:
Przemyslaw Czerpak
2009-06-06 00:15:16 +00:00
parent b16692e111
commit bf151a6400
2 changed files with 30 additions and 19 deletions

View File

@@ -17,6 +17,12 @@
past entries belonging to author(s): Viktor Szakats.
*/
2009-06-06 02:24 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/source/rdd/dbfnsx/dbfnsx1.c
! fixed stupid typo in C else block scope which caused false alarm
about corrupted index. Many thanks to Vitor Mangabeira for information
and self contain example.
2009-06-06 01:19 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
* bin/hb-mkdyn.bat
! Applied version number change to this file, too.

View File

@@ -2401,30 +2401,35 @@ static BOOL hb_nsxTagGetCurKey( LPTAGINFO pTag, LPPAGEINFO pPage, USHORT uiKey )
if( hb_nsxIsLeaf( pPage ) )
{
if( uiKey >= pPage->uiKeys )
{
pTag->CurKeyInfo->rec = pTag->CurKeyInfo->page = 0;
else if( pTag->CurKeyInfo->rec == 0 ||
pTag->CurKeyInfo->page != pPage->Page ||
uiKey < pTag->CurKeyNo || pTag->CurKeyOffset == 0 )
{
pTag->CurKeyOffset = NSX_LEAFKEYOFFSET;
pTag->CurKeyNo = ( USHORT ) -1;
hb_nsxTagGetPrevKey( pTag, pTag->CurKeyInfo->val, pTag->stackLevel - 1 );
}
pTag->CurKeyInfo->page = pPage->Page;
while( pTag->CurKeyNo != uiKey )
else
{
pTag->CurKeyOffset = hb_nsxLeafGetKey( pTag, pPage,
pTag->CurKeyOffset,
pTag->CurKeyInfo->val,
&pTag->CurKeyInfo->rec );
if( pTag->CurKeyOffset == 0 )
if( pTag->CurKeyInfo->rec == 0 ||
pTag->CurKeyInfo->page != pPage->Page ||
uiKey < pTag->CurKeyNo || pTag->CurKeyOffset == 0 )
{
hb_nsxCorruptError( pTag->pIndex );
pTag->CurKeyInfo->rec = 0;
return FALSE;
pTag->CurKeyOffset = NSX_LEAFKEYOFFSET;
pTag->CurKeyNo = ( USHORT ) -1;
hb_nsxTagGetPrevKey( pTag, pTag->CurKeyInfo->val, pTag->stackLevel - 1 );
}
pTag->CurKeyInfo->page = pPage->Page;
while( pTag->CurKeyNo != uiKey )
{
pTag->CurKeyOffset = hb_nsxLeafGetKey( pTag, pPage,
pTag->CurKeyOffset,
pTag->CurKeyInfo->val,
&pTag->CurKeyInfo->rec );
if( pTag->CurKeyOffset == 0 )
{
hb_nsxCorruptError( pTag->pIndex );
pTag->CurKeyInfo->rec = 0;
return FALSE;
}
pTag->CurKeyNo++;
}
pTag->CurKeyNo++;
}
}
else if( uiKey && uiKey <= pPage->uiKeys )