diff --git a/src/jrd/rse.cpp b/src/jrd/rse.cpp index ba8f1000e9..9207a21115 100644 --- a/src/jrd/rse.cpp +++ b/src/jrd/rse.cpp @@ -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; } } diff --git a/src/jrd/vio.cpp b/src/jrd/vio.cpp index b2b8367dbb..640492af86 100644 --- a/src/jrd/vio.cpp +++ b/src/jrd/vio.cpp @@ -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; diff --git a/src/jrd/vio_proto.h b/src/jrd/vio_proto.h index 7824009747..fc46ea4819 100644 --- a/src/jrd/vio_proto.h +++ b/src/jrd/vio_proto.h @@ -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);