Commit 923d8efd authored by Carla Guillen's avatar Carla Guillen
Browse files

Bugfix: adding <= to begin timestamp so it finds the right table.

parent 18001cd1
......@@ -200,10 +200,10 @@ bool MariaDB::getDBJobID(const std::string & job_id_string, std::string& job_db_
}
bool MariaDB::getCurrentSuffixAggregateTable(std::string & suffix){
if(_end_aggregate_timestamp){
auto now_uts = getTimestamp();
if(_end_aggregate_timestamp){
auto now_uts = getTimestamp();
if(now_uts < _end_aggregate_timestamp) { //suffix found, don't do anything
suffix = _current_table_suffix;
suffix = _current_table_suffix;
return true;
}
}
......@@ -212,7 +212,7 @@ bool MariaDB::getCurrentSuffixAggregateTable(std::string & suffix){
std::replace( date_time.begin(), date_time.end(), 'T', ' ');
std::stringstream build_query;
build_query << "SELECT suffix, UNIX_TIMESTAMP(end_timestamp) FROM SuffixToAggregateTable WHERE begin_timestamp < \'";
build_query << "SELECT suffix, UNIX_TIMESTAMP(end_timestamp) FROM SuffixToAggregateTable WHERE begin_timestamp <= \'";
build_query << date_time << "\' AND end_timestamp > \'" << date_time << "\'";
auto query = build_query.str();
LOG(debug) << query;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment