2000-10-13 0:33 UTC+0800 Brian Hays <bhays@abacuslaw.com>

This commit is contained in:
Brian Hays
2000-10-13 07:38:04 +00:00
parent b22e7dab37
commit ee2253880c
4 changed files with 67 additions and 11 deletions

View File

@@ -1,8 +1,13 @@
2000-10-13 11:28 GMT+3 Alexander Kresin <alex@belacy.belgorod.su>
* source/rdd/dbfcdx/dbfcdx1.c
* source/rdd/dbcmd.c
* source/include/hbrddcdx.h
* fixed some warnings, added HB_TRACE_...
2000-10-13 0:33 UTC+0800 Brian Hays <bhays@abacuslaw.com>
* source/rdd/dbcmd.c
fixed ORDKEY to accept 0 as a parameter (to get current index's key)
* contrib/rdd_ads/ads1.c
* added to adsSkip() a check for skip -1 from EOF.
ADS behavior is to go to TOP if EOF had been reached by GO LASTREC()+1.
Forced to Go Bottom instead, to stay compatible with standard behavior.
* source/rdd/workarea.c
* added a TODO note to review questionable code in hb_waSkipFilter
2000-10-12 23:50 UTC-0400 David G. Holm <dholm@jsd-llc.com>
* include/hbver.h
@@ -204,6 +209,12 @@
*tests/testbrw.prg
! Added call to Configure() method
tion/deletion
calling method Configure(). Method Configure() _has_ to be called when an already added TBColumn
object is changed.
*tests/testbrw.prg
! Added call to Configure() method
2000-09-30 22:22 GMT+2 Maurilio Longo <maurilio.longo@libero.it>
*contrib/mysql/tmysql.prg
! fixes / changes to work with tsqlbrw.prg

View File

@@ -324,7 +324,6 @@ static ERRCODE adsGoTo( ADSAREAP pArea, ULONG ulRecNo )
if( ulRecNo > 0 && ulRecNo <= pArea->ulRecCount )
{
// bh: do we use ulRecno??
pArea->ulRecNo = ulRecNo;
pArea->fBof = pArea->fEof = FALSE;
AdsGotoRecord( pArea->hTable, ulRecNo );
@@ -437,6 +436,19 @@ static ERRCODE adsSkip( ADSAREAP pArea, LONG lToSkip )
HB_TRACE(HB_TR_DEBUG, ("adsSkip(%p, %ld)", pArea, lToSkip));
/* -----------------10/11/00 Brian Hays ------------------
In ADS, if you GO 0 (as opposed to skipping past lastrec),
it considers the record pointer "unpositioned".
If you then try to skip -1 you end up at Top with BOF True.
(If you skip past lastrec, then skip -1 it works right.)
To fix this we need to trap for a (negative lToSkip .AND. EOF)
and do a GoBottom--but only after letting ads try first and
testing for BOF. We need to avoid our GoBottom hack as much as
possible because with a filter set it could be quite slow.
--------------------------------------------------*/
pArea->fTop = pArea->fBottom = FALSE;
AdsSkip ( (pArea->hOrdCurrent) ? pArea->hOrdCurrent : pArea->hTable, lToSkip );
@@ -444,8 +456,22 @@ static ERRCODE adsSkip( ADSAREAP pArea, LONG lToSkip )
return SUCCESS; /*bh: dbskip(0) created infinite loop; this should never move the record pointer via skipfilter */
else
{
if ( lToSkip < 0 && pArea->fEof ) /* skipped -1 or more from EOF will NOT go to bottom in ads if we went straight to 0! It sets BOF in this case. */
{
AdsAtBOF( pArea->hTable, (UNSIGNED16 *)&(pArea->fBof) );
if ( pArea->fBof ) /* might also be true in and empty data set, but this is probably our problem situation so move again */
{
//pArea->fTop = FALSE;
pArea->fBottom = TRUE;
AdsGotoBottom ( (pArea->hOrdCurrent) ? pArea->hOrdCurrent : pArea->hTable );
if ( lToSkip < -1 )
{
AdsSkip ( (pArea->hOrdCurrent) ? pArea->hOrdCurrent : pArea->hTable, (lToSkip + 1) );
}
}
}
hb_adsCheckBofEof( pArea );
return SUPER_SKIPFILTER( (AREAP)pArea, lToSkip>0 ? 1:-1 );
return SUPER_SKIPFILTER( (AREAP)pArea, lToSkip>0 ? 1 : -1 );
}
}

View File

@@ -2338,9 +2338,23 @@ HB_FUNC( ORDKEY )
if( s_pCurrArea )
{
pOrderInfo.itmOrder = hb_param( 1, HB_IT_STRING );
if( !pOrderInfo.itmOrder )
pOrderInfo.itmOrder = hb_param( 1, HB_IT_NUMERIC );
if ( ISNUM(1) )
{
if ( hb_parnl(1) == 0 ) /* if ask for 0, get current order */
{
pOrderInfo.itmResult = hb_itemPutNI( NULL, 0 );
pOrderInfo.itmOrder = NULL; /* This is necessary to get the NUMBER back */
SELF_ORDINFO( ( AREAP ) s_pCurrArea->pArea, DBOI_NUMBER, &pOrderInfo );
pOrderInfo.itmOrder = hb_param( 1, HB_IT_NUMERIC );
hb_itemPutNI( pOrderInfo.itmOrder, hb_itemGetNI( pOrderInfo.itmResult ) );
hb_itemRelease( pOrderInfo.itmResult );
}
else
pOrderInfo.itmOrder = hb_param( 1, HB_IT_NUMERIC );
}else
pOrderInfo.itmOrder = hb_param( 1, HB_IT_STRING );
pOrderInfo.atomBagName = hb_param( 2, HB_IT_STRING );
if( !pOrderInfo.itmOrder )
{
@@ -3095,4 +3109,4 @@ HB_FUNC( DBFILEPUT )
}
#endif
#include "rddcpy.c"
#include "rddcpy.c"

View File

@@ -169,6 +169,11 @@ ERRCODE hb_waSkipFilter( AREAP pArea, LONG lUpDown )
}
if( bOutOfRange )
{
/*
TODO: these calls to SELF_GOTO are redundant; in most cases
we are already at EOF from the skips above, and GO 0 is not necessary.
We should take a closer look at these. --BH
*/
if( bTop && lUpDown > 0 )
uiError = SELF_GOTO( pArea, 0 );
else if( bBottom && lUpDown < 0 )