8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-22 22:43:03 +01:00

Fix problem in explicit locking logic implicitly noted by Ann Harrison

This commit is contained in:
skidder 2003-07-11 22:39:14 +00:00
parent 811c48b9ca
commit 91e889d0f4
3 changed files with 11 additions and 5 deletions

View File

@ -20,7 +20,7 @@
* All Rights Reserved.
* Contributor(s): ______________________________________.
*
* $Id: rse.cpp,v 1.28 2003-07-06 07:04:02 dimitr Exp $
* $Id: rse.cpp,v 1.29 2003-07-11 22:39:13 skidder Exp $
*
* 2001.07.28: John Bellardo: Implemented rse_skip and made rse_first work with
* seekable streams.
@ -460,13 +460,13 @@ BOOLEAN RSE_get_record(TDBB tdbb, RSB rsb, RSE_GET_MODE mode)
RPB* org_rpb = request->req_rpb + test_rsb->rsb_stream;
JRD_REL relation = org_rpb->rpb_relation;
if (relation && !relation->rel_view_rse && !relation->rel_file)
{
RLCK_reserve_relation(tdbb, transaction, relation, TRUE, TRUE);
// Fetch next record if current was deleted before being locked
if (!VIO_writelock(tdbb, org_rpb, transaction)) {
if (!VIO_writelock(tdbb, org_rpb, rsb, transaction)) {
continue;
}
}

View File

@ -2162,7 +2162,7 @@ void VIO_modify(TDBB tdbb, RPB * org_rpb, RPB * new_rpb, JRD_TRA transaction)
}
BOOLEAN VIO_writelock(TDBB tdbb, RPB * org_rpb, JRD_TRA transaction)
BOOLEAN VIO_writelock(TDBB tdbb, RPB * org_rpb, RSB rsb, JRD_TRA transaction)
{
/**************************************
*
@ -2229,6 +2229,12 @@ BOOLEAN VIO_writelock(TDBB tdbb, RPB * org_rpb, JRD_TRA transaction)
reinterpret_cast < blk * >(tdbb->tdbb_request->req_pool));
org_rpb->rpb_stream_flags &= ~RPB_s_refetch;
// Make sure refetched record still fulfills search condition
RSB r;
for (r = rsb; r && r->rsb_type != rsb_boolean ; r = r->rsb_next);
if (r && !EVL_boolean(tdbb, (JRD_NOD) r->rsb_arg[0]))
return FALSE;
}
relation = org_rpb->rpb_relation;

View File

@ -52,7 +52,7 @@ extern int VIO_get_current(TDBB, struct rpb *, struct jrd_tra *, struct blk *,
extern void VIO_init(TDBB);
#endif
extern void VIO_merge_proc_sav_points(TDBB, struct jrd_tra *, struct sav **);
extern BOOLEAN VIO_writelock(TDBB, struct rpb *, struct jrd_tra *);
extern BOOLEAN VIO_writelock(TDBB, struct rpb *, class Rsb *, struct jrd_tra *);
extern void VIO_modify(TDBB, struct rpb *, struct rpb *, struct jrd_tra *);
extern BOOLEAN VIO_next_record(TDBB, struct rpb *, class Rsb *, struct jrd_tra *,
struct blk *, BOOLEAN, BOOLEAN);