From 9070408ee1839bf5217fe0c985af736cbc922f75 Mon Sep 17 00:00:00 2001 From: "Alexander S.Kresin" Date: Mon, 22 Apr 2002 10:12:27 +0000 Subject: [PATCH] 2002-04-22 14:14 UTC+0300 Alexander Kresin --- harbour/ChangeLog | 6 ++++++ harbour/source/rdd/dbcmd.c | 3 ++- harbour/source/rdd/dbfntx/dbfntx1.c | 32 +++++++++++++++++++++++++---- 3 files changed, 36 insertions(+), 5 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index c48db3de9a..2fab37dc71 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -7,6 +7,12 @@ For example: 2002-12-01 23:12 UTC+0100 Foo Bar */ + DBOI_ORDERCOUNT, DBOI_UNIQUE, ordName, ordBagName. + ! fixed a bug in: gotop, gobbotom, skip + + begin of hb_cdxZap + + added support for: DBOI_ISCOND, DBOI_ISDESC, DBOI_FILEHANDLE + + added index locking routines + ! fixed some structures definitions for gcc/vc/... ! fixed autopen bug on Linux ! fixed recno() while indexing diff --git a/harbour/source/rdd/dbcmd.c b/harbour/source/rdd/dbcmd.c index 4f434c8750..a6fe593606 100644 --- a/harbour/source/rdd/dbcmd.c +++ b/harbour/source/rdd/dbcmd.c @@ -2322,7 +2322,8 @@ HB_FUNC( ORDCONDSET ) if( lpdbOrdCondInfo->itmCobWhile ) lpdbOrdCondInfo->fRest = TRUE; - if( lpdbOrdCondInfo->lNextCount || lpdbOrdCondInfo->lRecno || lpdbOrdCondInfo->fRest ) + if( lpdbOrdCondInfo->lNextCount || lpdbOrdCondInfo->lRecno || + lpdbOrdCondInfo->fRest || lpdbOrdCondInfo->fUseCurrent ) lpdbOrdCondInfo->fAll = FALSE; hb_retl( SELF_ORDSETCOND( ( AREAP ) s_pCurrArea->pArea, lpdbOrdCondInfo ) == SUCCESS ); diff --git a/harbour/source/rdd/dbfntx/dbfntx1.c b/harbour/source/rdd/dbfntx/dbfntx1.c index 34bc8f3b1b..c19f0919e5 100644 --- a/harbour/source/rdd/dbfntx/dbfntx1.c +++ b/harbour/source/rdd/dbfntx/dbfntx1.c @@ -2356,6 +2356,9 @@ static BOOL hb_ntxReadBuf( NTXAREAP pArea, BYTE* readBuffer, USHORT* numRecinBuf } if( lpdbOrdCondInfo->itmCobWhile ) return checkLogicalExpr( lpdbOrdCondInfo->itmCobWhile, NULL ); + if( lpdbOrdCondInfo->fUseCurrent && pArea->fEof ) + return FALSE; + return TRUE; } } @@ -2433,6 +2436,8 @@ static ERRCODE hb_ntxIndexCreate( LPNTXINDEX pIndex ) pArea->fValidBuffer = TRUE; hb_fsSeek( pArea->hDataFile, pArea->uiHeaderLen, FS_SET ); } + else if( pArea->lpdbOrdCondInfo->fUseCurrent ) + SELF_GOTOP( ( AREAP ) pArea ); for( ulRecNo = 1; ulRecNo <= ulRecCount; ulRecNo++) { if( !hb_ntxReadBuf( pArea, readBuffer, &numRecinBuf, pArea->lpdbOrdCondInfo ) ) @@ -2665,7 +2670,8 @@ static void hb_ntxIndexFree( LPNTXINDEX pIndex ) hb_itemRelease( pTag->pForItem ); } hb_ntxKeyFree( pTag->CurKeyInfo ); - SELF_CLEARSCOPE( (AREAP) pIndex->Owner ); + hb_ntxClearScope( pTag,0 ); + hb_ntxClearScope( pTag,1 ); hb_xfree( pTag->stack ); hb_xfree( pTag ); hb_xfree( pIndex->IndexName ); @@ -3267,7 +3273,8 @@ static ERRCODE ntxOrderCreate( NTXAREAP pArea, LPDBORDERCREATEINFO pOrderInfo ) /* printf( "\nntxOrderCreate - 0\n" ); */ if( SELF_GOCOLD( ( AREAP ) pArea ) == FAILURE ) return FAILURE; - if( !pArea->lpdbOrdCondInfo || pArea->lpdbOrdCondInfo->fAll ) + if( !pArea->lpdbOrdCondInfo || ( pArea->lpdbOrdCondInfo->fAll && + !pArea->lpdbOrdCondInfo->fAdditive ) ) SELF_ORDLSTCLEAR( ( AREAP ) pArea ); /* If we have a codeblock for the expression, use it */ @@ -3459,9 +3466,26 @@ static ERRCODE ntxOrderCreate( NTXAREAP pArea, LPDBORDERCREATEINFO pOrderInfo ) { return FAILURE; } - if( pArea->lpdbOrdCondInfo && !pArea->lpdbOrdCondInfo->fAll ) + if( pArea->lpdbOrdCondInfo && !pArea->lpdbOrdCondInfo->fAll && + !pArea->lpdbOrdCondInfo->fAdditive ) SELF_ORDLSTCLEAR( ( AREAP ) pArea ); - pArea->lpNtxIndex = pIndex; + if( pArea->lpdbOrdCondInfo && pArea->lpdbOrdCondInfo->fAdditive ) + { + if( pArea->lpNtxIndex ) + { + LPNTXINDEX pIndexNext = pArea->lpNtxIndex; + + pIndex->TagRoot++; + while( pIndexNext->pNext ) + { + pIndex->TagRoot++; + pIndexNext = pIndexNext->pNext; + } + pIndexNext->pNext = pIndex; + } + } + else + pArea->lpNtxIndex = pIndex; pArea->lpCurIndex = pIndex; hb_ntxHeaderSave( pIndex, TRUE ); {