File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -271,9 +271,10 @@ impl VidRange {
271
271
}
272
272
273
273
pub fn size ( & self ) -> usize {
274
- ( self . max - self . min + 1 ) as usize
274
+ ( self . max - self . min ) as usize + 1
275
275
}
276
276
277
+ /// Return the full range of `vid` values in the table `src`
277
278
pub fn for_copy (
278
279
conn : & mut PgConnection ,
279
280
src : & Table ,
@@ -285,11 +286,13 @@ impl VidRange {
285
286
"lower(block_range) <= $1"
286
287
} ;
287
288
let vid_range = sql_query ( format ! (
288
- "select coalesce(min(vid), 0) as min_vid, \
289
+ "/* controller=copy,target={target_number} */ \
290
+ select coalesce(min(vid), 0) as min_vid, \
289
291
coalesce(max(vid), -1) as max_vid \
290
- from {} where {}",
291
- src. qualified_name. as_str( ) ,
292
- max_block_clause
292
+ from {src_name} where {max_block_clause}",
293
+ target_number = target_block. number,
294
+ src_name = src. qualified_name. as_str( ) ,
295
+ max_block_clause = max_block_clause
293
296
) )
294
297
. bind :: < Integer , _ > ( & target_block. number )
295
298
. load :: < VidRange > ( conn) ?
You can’t perform that action at this time.
0 commit comments