2009-12-31 13:59 UTC+0200 Mindaugas Kavaliauskas (dbtopas/at/dbtopas.lt)
* harbour/contrib/rddads/ads1.c
! fixed softseek seeklast behavior in case seek positions at EOF
* added additional ADS function return value check in seek operation
This commit is contained in:
@@ -17,6 +17,11 @@
|
||||
past entries belonging to author(s): Viktor Szakats.
|
||||
*/
|
||||
|
||||
2009-12-31 13:59 UTC+0200 Mindaugas Kavaliauskas (dbtopas/at/dbtopas.lt)
|
||||
* harbour/contrib/rddads/ads1.c
|
||||
! fixed softseek seeklast behavior in case seek positions at EOF
|
||||
* added additional ADS function return value check in seek operation
|
||||
|
||||
2009-12-31 12:43 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
|
||||
* harbour/include/hbextcdp.ch
|
||||
* harbour/include/hbextlng.ch
|
||||
|
||||
@@ -1058,33 +1058,29 @@ static HB_ERRCODE adsSeek( ADSAREAP pArea, BOOL bSoftSeek, PHB_ITEM pKey, BOOL b
|
||||
|
||||
if( bFindLast )
|
||||
{
|
||||
AdsSeekLast( pArea->hOrdCurrent,
|
||||
pszKey, u16KeyLen, u16KeyType, &u16Found );
|
||||
if( bSoftSeek && ! u16Found )
|
||||
u32RetVal = AdsSeekLast( pArea->hOrdCurrent,
|
||||
pszKey, u16KeyLen, u16KeyType, &u16Found );
|
||||
if( u32RetVal == AE_SUCCESS && bSoftSeek && ! u16Found )
|
||||
{
|
||||
UNSIGNED16 u16Eof;
|
||||
|
||||
/* in such case ADS set record at EOF position so we
|
||||
should make normal soft seek and then skip -1 to emulate
|
||||
Clipper behavior, Druzus */
|
||||
AdsSeek( pArea->hOrdCurrent, pszKey, u16KeyLen,
|
||||
u16KeyType, u16SeekType, &u16Found );
|
||||
u32RetVal = AdsSeek( pArea->hOrdCurrent, pszKey, u16KeyLen,
|
||||
u16KeyType, u16SeekType, &u16Found );
|
||||
|
||||
AdsAtEOF( pArea->hTable, &u16Eof );
|
||||
if( !u16Eof )
|
||||
{
|
||||
if( u32RetVal == AE_SUCCESS )
|
||||
u32RetVal = AdsSkip( pArea->hOrdCurrent, -1 );
|
||||
if( u32RetVal != AE_SUCCESS )
|
||||
{
|
||||
commonError( pArea, EG_CORRUPTION, ( HB_ERRCODE ) u32RetVal, 0, NULL, EF_CANDEFAULT, NULL );
|
||||
return HB_FAILURE;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
AdsSeek( pArea->hOrdCurrent, pszKey, u16KeyLen,
|
||||
u16KeyType, u16SeekType, &u16Found );
|
||||
u32RetVal = AdsSeek( pArea->hOrdCurrent, pszKey, u16KeyLen,
|
||||
u16KeyType, u16SeekType, &u16Found );
|
||||
|
||||
if( u32RetVal != AE_SUCCESS )
|
||||
{
|
||||
commonError( pArea, EG_CORRUPTION, ( HB_ERRCODE ) u32RetVal, 0, NULL, EF_CANDEFAULT, NULL );
|
||||
return HB_FAILURE;
|
||||
}
|
||||
|
||||
hb_adsUpdateAreaFlags( pArea );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user