2015-03-23 15:03 UTC+0100 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* include/hbapirdd.h
* include/hbusrrdd.ch
+ added DBTF_RECALL flag which disables transferring record DELETED flag
* src/rdd/dbcmd.c
* src/rdd/workarea.c
! disable transferring DELETED flag to destination area in SORT TO /
__dbArrange() operations
* src/rdd/delim1.c
* src/rdd/sdf1.c
+ added dummy RECALL() methods - now RECALL() can be executed by workarea
TRANSREC() method when DBTF_RECALL flag is set
This commit is contained in:
@@ -10,6 +10,21 @@
|
||||
* Change, ! Fix, % Optimization, + Addition, - Removal, ; Comment
|
||||
*/
|
||||
|
||||
2015-03-23 15:03 UTC+0100 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
|
||||
* include/hbapirdd.h
|
||||
* include/hbusrrdd.ch
|
||||
+ added DBTF_RECALL flag which disables transferring record DELETED flag
|
||||
|
||||
* src/rdd/dbcmd.c
|
||||
* src/rdd/workarea.c
|
||||
! disable transferring DELETED flag to destination area in SORT TO /
|
||||
__dbArrange() operations
|
||||
|
||||
* src/rdd/delim1.c
|
||||
* src/rdd/sdf1.c
|
||||
+ added dummy RECALL() methods - now RECALL() can be executed by workarea
|
||||
TRANSREC() method when DBTF_RECALL flag is set
|
||||
|
||||
2015-03-22 17:23 UTC+0100 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
|
||||
* src/rdd/dbf1.c
|
||||
* pacified warnings
|
||||
|
||||
@@ -126,6 +126,7 @@ HB_EXTERN_BEGIN
|
||||
#define DBTF_MATCH 0x0001
|
||||
#define DBTF_PUTREC 0x0002
|
||||
#define DBTF_CPYCTR 0x0004
|
||||
#define DBTF_RECALL 0x0008
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -203,6 +203,7 @@
|
||||
#define DBTF_MATCH 0x0001
|
||||
#define DBTF_PUTREC 0x0002
|
||||
#define DBTF_CPYCTR 0x0004
|
||||
#define DBTF_RECALL 0x0008
|
||||
|
||||
/* Codes for Locking methods */
|
||||
#define DBLM_EXCLUSIVE 1
|
||||
|
||||
@@ -1859,6 +1859,9 @@ HB_FUNC( __DBARRANGE )
|
||||
dbSortInfo.dbtri.dbsci.fOptimized = HB_FALSE;
|
||||
dbSortInfo.dbtri.dbsci.fIncludeDeleted = HB_TRUE;
|
||||
|
||||
/* do not transfer record deleted flag to destination area */
|
||||
dbSortInfo.dbtri.uiFlags |= DBTF_RECALL;
|
||||
|
||||
dbSortInfo.uiItemCount = pFields ? ( HB_USHORT ) hb_arrayLen( pFields ) : 0;
|
||||
if( dbSortInfo.uiItemCount > 0 )
|
||||
{
|
||||
|
||||
@@ -554,6 +554,18 @@ static HB_ERRCODE hb_delimDeleteRec( DELIMAREAP pArea )
|
||||
return HB_SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
* Undelete the current record.
|
||||
*/
|
||||
static HB_ERRCODE hb_delimRecall( DELIMAREAP pArea )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_delimRecall(%p)", pArea ) );
|
||||
|
||||
HB_SYMBOL_UNUSED( pArea );
|
||||
|
||||
return HB_SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
* Obtain the current value of a field.
|
||||
*/
|
||||
@@ -1518,7 +1530,7 @@ static const RDDFUNCS delimTable = { NULL /* hb_delimBof */,
|
||||
( DBENTRYP_V ) hb_delimGoHot,
|
||||
( DBENTRYP_P ) hb_delimPutRec,
|
||||
( DBENTRYP_SI ) hb_delimPutValue,
|
||||
NULL /* hb_delimRecall */,
|
||||
( DBENTRYP_V ) hb_delimRecall,
|
||||
( DBENTRYP_ULP ) hb_delimRecCount,
|
||||
NULL /* hb_delimRecInfo */,
|
||||
( DBENTRYP_ULP ) hb_delimRecNo,
|
||||
|
||||
@@ -367,6 +367,18 @@ static HB_ERRCODE hb_sdfDeleteRec( SDFAREAP pArea )
|
||||
return HB_SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
* Undelete the current record.
|
||||
*/
|
||||
static HB_ERRCODE hb_sdfRecall( SDFAREAP pArea )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_sdfRecall(%p)", pArea ) );
|
||||
|
||||
HB_SYMBOL_UNUSED( pArea );
|
||||
|
||||
return HB_SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
* Obtain the current value of a field.
|
||||
*/
|
||||
@@ -1247,7 +1259,7 @@ static const RDDFUNCS sdfTable = { NULL /* hb_sdfBof */,
|
||||
( DBENTRYP_V ) hb_sdfGoHot,
|
||||
( DBENTRYP_P ) hb_sdfPutRec,
|
||||
( DBENTRYP_SI ) hb_sdfPutValue,
|
||||
NULL /* hb_sdfRecall */,
|
||||
( DBENTRYP_V ) hb_sdfRecall,
|
||||
( DBENTRYP_ULP ) hb_sdfRecCount,
|
||||
NULL /* hb_sdfRecInfo */,
|
||||
( DBENTRYP_ULP ) hb_sdfRecNo,
|
||||
|
||||
@@ -1296,13 +1296,13 @@ static HB_ERRCODE hb_waTransRec( AREAP pArea, LPDBTRANSINFO pTransInfo )
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_waTransRec(%p, %p)", pArea, pTransInfo ) );
|
||||
|
||||
/* Record deleted? */
|
||||
errCode = SELF_DELETED( pArea, &bDeleted );
|
||||
if( errCode != HB_SUCCESS )
|
||||
return errCode;
|
||||
|
||||
if( pTransInfo->uiFlags & DBTF_MATCH && pTransInfo->uiFlags & DBTF_PUTREC )
|
||||
{
|
||||
/* Record deleted? */
|
||||
errCode = SELF_DELETED( pArea, &bDeleted );
|
||||
if( errCode != HB_SUCCESS )
|
||||
return errCode;
|
||||
|
||||
errCode = SELF_GETREC( pArea, &pRecord );
|
||||
if( errCode != HB_SUCCESS )
|
||||
return errCode;
|
||||
@@ -1321,6 +1321,16 @@ static HB_ERRCODE hb_waTransRec( AREAP pArea, LPDBTRANSINFO pTransInfo )
|
||||
PHB_ITEM pItem;
|
||||
HB_USHORT uiCount;
|
||||
|
||||
if( pTransInfo->uiFlags & DBTF_RECALL )
|
||||
bDeleted = HB_FALSE;
|
||||
else
|
||||
{
|
||||
/* Record deleted? */
|
||||
errCode = SELF_DELETED( pArea, &bDeleted );
|
||||
if( errCode != HB_SUCCESS )
|
||||
return errCode;
|
||||
}
|
||||
|
||||
/* Append a new record */
|
||||
errCode = SELF_APPEND( pTransInfo->lpaDest, HB_TRUE );
|
||||
if( errCode != HB_SUCCESS )
|
||||
@@ -1344,16 +1354,17 @@ static HB_ERRCODE hb_waTransRec( AREAP pArea, LPDBTRANSINFO pTransInfo )
|
||||
|
||||
/* Delete the new record if copy fail */
|
||||
if( errCode != HB_SUCCESS )
|
||||
{
|
||||
SELF_DELETE( pTransInfo->lpaDest );
|
||||
return errCode;
|
||||
else if( bDeleted )
|
||||
{
|
||||
/* Record with deleted flag */
|
||||
if( pTransInfo->uiFlags & DBTF_RECALL )
|
||||
errCode = SELF_RECALL( pTransInfo->lpaDest );
|
||||
else
|
||||
errCode = SELF_DELETE( pTransInfo->lpaDest );
|
||||
}
|
||||
|
||||
/* Delete the new record */
|
||||
if( bDeleted )
|
||||
return SELF_DELETE( pTransInfo->lpaDest );
|
||||
|
||||
return HB_SUCCESS;
|
||||
return errCode;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user