Skip to content

Commit

Permalink
Merge pull request #19517 from ggovi/condcore-conddb-fix-iov-range-0-93X
Browse files Browse the repository at this point in the history
IOV range returned ordered by since
  • Loading branch information
cmsbuild committed Jul 3, 2017
2 parents 526d318 + 368d5eb commit aee2fec
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions CondCore/CondDB/src/IOVSchema.cc
Original file line number Diff line number Diff line change
Expand Up @@ -226,10 +226,15 @@ namespace cond {
q1.addCondition<INSERTION_TIME>( snapshotTime,"<=" );
}
q1.addCondition<SINCE>( end, "<=");
q1.addOrderClause<SINCE>();
q1.addOrderClause<INSERTION_TIME>( false );
size_t initialSize = iovs.size();
for( auto row: q1 ){
iovs.push_back( row );
// starting from the second iov in the array, skip the rows with older timestamp
if( iovs.size()-initialSize && std::get<0>(iovs.back()) == std::get<0>(row) ) continue;
iovs.push_back( row );
}
return iovs.size();
return iovs.size()-initialSize;
}

void IOV::Table::insertOne( const std::string& tag,
Expand Down

0 comments on commit aee2fec

Please sign in to comment.