Fossil SCM

Do not use the "time_fudge" temp-table if it has not been created by a prior call to manifest_crosslink_begin(). Ticket [289844a2cb535a465]

drh 2010-11-15 20:10 trunk
Commit 80c42a33128ff26f35400f128bbefc4c7e06c560
1 file changed +6 -7
+6 -7
--- src/manifest.c
+++ src/manifest.c
@@ -104,10 +104,15 @@
104104
int nxAge;
105105
int aAge[MX_MANIFEST_CACHE];
106106
Manifest *apManifest[MX_MANIFEST_CACHE];
107107
} manifestCache;
108108
109
+/*
110
+** True if manifest_crosslink_begin() has been called but
111
+** manifest_crosslink_end() is still pending.
112
+*/
113
+static int manifest_crosslink_busy = 0;
109114
110115
/*
111116
** Clear the memory allocated in a manifest object
112117
*/
113118
void manifest_destroy(Manifest *p){
@@ -1224,11 +1229,11 @@
12241229
}
12251230
12261231
/* Remember all children less than 2 seconds younger than their parent,
12271232
** as we might want to fudge the times for those children.
12281233
*/
1229
- if( pChild->rDate<pParent->rDate+2.3e-5 ){
1234
+ if( pChild->rDate<pParent->rDate+2.3e-5 && manifest_crosslink_busy ){
12301235
db_multi_exec(
12311236
"INSERT OR REPLACE INTO time_fudge VALUES(%d, %.17g, %d, %.17g);",
12321237
pParent->rid, pParent->rDate, pChild->rid, pChild->rDate
12331238
);
12341239
}
@@ -1270,16 +1275,10 @@
12701275
}
12711276
}
12721277
manifest_cache_insert(*ppOther);
12731278
}
12741279
1275
-/*
1276
-** True if manifest_crosslink_begin() has been called but
1277
-** manifest_crosslink_end() is still pending.
1278
-*/
1279
-static int manifest_crosslink_busy = 0;
1280
-
12811280
/*
12821281
** Setup to do multiple manifest_crosslink() calls.
12831282
** This is only required if processing ticket changes.
12841283
*/
12851284
void manifest_crosslink_begin(void){
12861285
--- src/manifest.c
+++ src/manifest.c
@@ -104,10 +104,15 @@
104 int nxAge;
105 int aAge[MX_MANIFEST_CACHE];
106 Manifest *apManifest[MX_MANIFEST_CACHE];
107 } manifestCache;
108
 
 
 
 
 
109
110 /*
111 ** Clear the memory allocated in a manifest object
112 */
113 void manifest_destroy(Manifest *p){
@@ -1224,11 +1229,11 @@
1224 }
1225
1226 /* Remember all children less than 2 seconds younger than their parent,
1227 ** as we might want to fudge the times for those children.
1228 */
1229 if( pChild->rDate<pParent->rDate+2.3e-5 ){
1230 db_multi_exec(
1231 "INSERT OR REPLACE INTO time_fudge VALUES(%d, %.17g, %d, %.17g);",
1232 pParent->rid, pParent->rDate, pChild->rid, pChild->rDate
1233 );
1234 }
@@ -1270,16 +1275,10 @@
1270 }
1271 }
1272 manifest_cache_insert(*ppOther);
1273 }
1274
1275 /*
1276 ** True if manifest_crosslink_begin() has been called but
1277 ** manifest_crosslink_end() is still pending.
1278 */
1279 static int manifest_crosslink_busy = 0;
1280
1281 /*
1282 ** Setup to do multiple manifest_crosslink() calls.
1283 ** This is only required if processing ticket changes.
1284 */
1285 void manifest_crosslink_begin(void){
1286
--- src/manifest.c
+++ src/manifest.c
@@ -104,10 +104,15 @@
104 int nxAge;
105 int aAge[MX_MANIFEST_CACHE];
106 Manifest *apManifest[MX_MANIFEST_CACHE];
107 } manifestCache;
108
109 /*
110 ** True if manifest_crosslink_begin() has been called but
111 ** manifest_crosslink_end() is still pending.
112 */
113 static int manifest_crosslink_busy = 0;
114
115 /*
116 ** Clear the memory allocated in a manifest object
117 */
118 void manifest_destroy(Manifest *p){
@@ -1224,11 +1229,11 @@
1229 }
1230
1231 /* Remember all children less than 2 seconds younger than their parent,
1232 ** as we might want to fudge the times for those children.
1233 */
1234 if( pChild->rDate<pParent->rDate+2.3e-5 && manifest_crosslink_busy ){
1235 db_multi_exec(
1236 "INSERT OR REPLACE INTO time_fudge VALUES(%d, %.17g, %d, %.17g);",
1237 pParent->rid, pParent->rDate, pChild->rid, pChild->rDate
1238 );
1239 }
@@ -1270,16 +1275,10 @@
1275 }
1276 }
1277 manifest_cache_insert(*ppOther);
1278 }
1279
 
 
 
 
 
 
1280 /*
1281 ** Setup to do multiple manifest_crosslink() calls.
1282 ** This is only required if processing ticket changes.
1283 */
1284 void manifest_crosslink_begin(void){
1285

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button