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]
Commit
80c42a33128ff26f35400f128bbefc4c7e06c560
Parent
ea442f3704397b1…
1 file changed
+6
-7
+6
-7
| --- src/manifest.c | ||
| +++ src/manifest.c | ||
| @@ -104,10 +104,15 @@ | ||
| 104 | 104 | int nxAge; |
| 105 | 105 | int aAge[MX_MANIFEST_CACHE]; |
| 106 | 106 | Manifest *apManifest[MX_MANIFEST_CACHE]; |
| 107 | 107 | } manifestCache; |
| 108 | 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; | |
| 109 | 114 | |
| 110 | 115 | /* |
| 111 | 116 | ** Clear the memory allocated in a manifest object |
| 112 | 117 | */ |
| 113 | 118 | void manifest_destroy(Manifest *p){ |
| @@ -1224,11 +1229,11 @@ | ||
| 1224 | 1229 | } |
| 1225 | 1230 | |
| 1226 | 1231 | /* Remember all children less than 2 seconds younger than their parent, |
| 1227 | 1232 | ** as we might want to fudge the times for those children. |
| 1228 | 1233 | */ |
| 1229 | - if( pChild->rDate<pParent->rDate+2.3e-5 ){ | |
| 1234 | + if( pChild->rDate<pParent->rDate+2.3e-5 && manifest_crosslink_busy ){ | |
| 1230 | 1235 | db_multi_exec( |
| 1231 | 1236 | "INSERT OR REPLACE INTO time_fudge VALUES(%d, %.17g, %d, %.17g);", |
| 1232 | 1237 | pParent->rid, pParent->rDate, pChild->rid, pChild->rDate |
| 1233 | 1238 | ); |
| 1234 | 1239 | } |
| @@ -1270,16 +1275,10 @@ | ||
| 1270 | 1275 | } |
| 1271 | 1276 | } |
| 1272 | 1277 | manifest_cache_insert(*ppOther); |
| 1273 | 1278 | } |
| 1274 | 1279 | |
| 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 | 1280 | /* |
| 1282 | 1281 | ** Setup to do multiple manifest_crosslink() calls. |
| 1283 | 1282 | ** This is only required if processing ticket changes. |
| 1284 | 1283 | */ |
| 1285 | 1284 | void manifest_crosslink_begin(void){ |
| 1286 | 1285 |
| --- 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 |