diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 0d6d32b536..82bf2fadaa 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,23 @@ past entries belonging to author(s): Viktor Szakats. */ +2009-10-31 16:42 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl) + * harbour/contrib/rddads/ads1.c + ! In APPEND metohd generate RT error EG_APPENDLOCK only if ACE returns + 1024 error code (Append Lock Failed). In all other cases generate + EG_CORRUPTION RTE. + This modifications allows to early detect some serious problems like + index corruptions in Mindaugas example with long keys in ADSCDX. + Warning! Before ADS RDD generated EG_APPENDLOCK for each errors + returned by AdsAppendRecord() and they were caught by default error + handler (ERRORSYS) and silently converted to NetErr(). + Now only for 1024 ACE error which is real append lock error + EG_APPENDLOCK is generated and all other errors will not be silently + ignored so it's also possible that this modification will exploit + some errors in concurrent accessed which are not reported by ADS/ACE + as 1024 and maybe we will have to report them as EG_APPENDLOCK too. + In such case please send information about such error codes here. + 2009-10-31 12:44 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/src/rdd/dbfcdx/dbfcdx1.c % added small protection against code which may want to create diff --git a/harbour/contrib/rddads/ads1.c b/harbour/contrib/rddads/ads1.c index caa73195e4..894f175a18 100644 --- a/harbour/contrib/rddads/ads1.c +++ b/harbour/contrib/rddads/ads1.c @@ -1422,11 +1422,13 @@ static HB_ERRCODE adsAppend( ADSAREAP pArea, BOOL fUnLockAll ) { commonError( pArea, EG_READONLY, EDBF_READONLY, 0, NULL, 0, NULL ); } + else if( u32RetVal == 1024 /* Append Lock Failed */ ) + { + commonError( pArea, EG_APPENDLOCK, EDBF_APPENDLOCK, 0, NULL, EF_CANDEFAULT, NULL ); + } else { - /* 1001 and 7008 are standard ADS Open Errors that will usually be sharing issues */ - USHORT uiOsCOde = u32RetVal == 1001 || u32RetVal == 7008 ? 32 : 0; - commonError( pArea, EG_APPENDLOCK, ( USHORT ) u32RetVal, uiOsCOde, NULL, EF_CANDEFAULT, NULL ); + commonError( pArea, EG_CORRUPTION, ( USHORT ) u32RetVal, 0, NULL, EF_CANDEFAULT, NULL ); } return HB_FAILURE;