cvs -z9 diff -u -wb jrd\dpm.epp jrd\req.h (in directory E:\FB2\vulcan\src\)
Index: jrd/dpm.epp
===================================================================
RCS file: /cvsroot/firebird/vulcan/src/jrd/dpm.epp,v
retrieving revision 1.12
diff -u -w -b -r1.12 dpm.epp
--- jrd/dpm.epp	20 Jan 2006 16:52:55 -0000	1.12
+++ jrd/dpm.epp	30 Apr 2006 08:39:15 -0000
@@ -2052,7 +2052,7 @@
 
 	rpb.rpb_relation = blob->blb_relation;
 	blh* header = (blh*) locate_space(tdbb, &rpb, (SSHORT)(BLH_SIZE + length),
-										&stack, record, DPM_other);
+										&stack, record, DPM_blob);
 	header->blh_flags = rhd_blob;
 
 	if (blob->blb_flags & BLB_stream)
@@ -2513,7 +2513,7 @@
 		ib_printf("    about to store tail\n");
 #endif
 
-	DPM_store(tdbb, &tail_rpb, &stack, DPM_other);
+	DPM_store(tdbb, &tail_rpb, &stack, DPM_fragment);
 
 	// That was unreasonablly easy.  Now re-fetch the original page and
 	// fill in the fragment pointer
@@ -2985,7 +2985,8 @@
 
 	// If there is a preferred page, try there first
 
-	if (type == DPM_secondary) 
+	SLONG min_page = 0;
+	if (type == DPM_secondary || type == DPM_fragment) 
 		{
 		USHORT pp_sequence;
 		SSHORT slot, line;
@@ -2999,15 +3000,24 @@
 			SLONG dp_number;
 			if (slot < ppage->ppg_count && (dp_number = ppage->ppg_page[slot]))
 				{
+				min_page = dp_number;
+				if (type == DPM_secondary)
+				{
 				CCH_HANDOFF(tdbb, window, dp_number, LCK_write, pag_data);
 				UCHAR* space = find_space(tdbb, rpb, size, stack, record, type);
-				if (space)
+					if (space) {
 					return (RHD) space;
 				}
-			else
+				}
+				else {
 				CCH_RELEASE(tdbb, window);
 			}
 		}
+			else {
+				CCH_RELEASE(tdbb, window);
+			}
+		}
+	}
 
 	// Look for space anywhere
 
@@ -3028,7 +3038,7 @@
 			{
 			const SLONG dp_number = ppage->ppg_page[slot];
 			
-			if (dp_number && ~bits[slot >> 2] & (1 << ((slot & 3) << 1))) 
+			if (dp_number && (dp_number >= min_page) && ~bits[slot >> 2] & (1 << ((slot & 3) << 1))) 
 				{
 				CCH_HANDOFF(tdbb, window, dp_number, LCK_write, pag_data);
 				UCHAR* space = find_space(tdbb, rpb, size, stack, record, type);
@@ -3350,7 +3360,7 @@
 		SQZ_length(tdbb, (SCHAR*) rpb->rpb_address, in - (SCHAR *) rpb->rpb_address,
 				   head_dcc);
 	header = (RHDF)locate_space(tdbb, rpb, (SSHORT)(RHDF_SIZE + size), stack,
-								NULL, DPM_other);
+								NULL, DPM_fragment);
 
 	header->rhdf_flags = rhd_incomplete | rhd_large | rpb->rpb_flags;
 	header->rhdf_transaction = rpb->rpb_transaction;
Index: jrd/req.h
===================================================================
RCS file: /cvsroot/firebird/vulcan/src/jrd/req.h,v
retrieving revision 1.8
diff -u -w -b -r1.8 req.h
--- jrd/req.h	25 Sep 2005 20:44:53 -0000	1.8
+++ jrd/req.h	28 Apr 2006 20:14:55 -0000
@@ -106,7 +106,9 @@
 
 const USHORT DPM_primary	= 1;		/* New primary record */
 const USHORT DPM_secondary	= 2;		/* Chained version of primary record */
-const USHORT DPM_other		= 3;		/* Independent (or don't care) record */
+const USHORT DPM_fragment	= 3;		
+const USHORT DPM_blob		= 4;		
+const USHORT DPM_other		= 5;		/* Independent (or don't care) record */
 
 /* Record block (holds data, remember data?) */
 

***** CVS exited normally with code 1 *****

