1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-20 10:50:08 +03:00

M #-: Fix HA replication bug (#3432)

(cherry picked from commit 77883d94c516265a1a9cac59b82cd2ca05beea3c)
This commit is contained in:
Christian González 2019-06-14 16:02:34 +02:00 committed by Ruben S. Montero
parent 995ec0ca7d
commit f852bc6ead
No known key found for this signature in database
GPG Key ID: A0CEA6FA880A1D87

View File

@ -330,24 +330,20 @@ int LogDB::insert(uint64_t index, unsigned int term, const std::string& sql,
if (replace)
{
oss << "UPDATE " << table << " SET "
<< "term = " << term << ", "
<< "sqlcmd = '" << sql_db << "', "
<< "timestamp = " << tstamp << ", "
<< "fed_index = " << fed_index << ", "
<< "applied = " << applied
<< " WHERE log_index = " << index;
oss << "REPLACE";
}
else
{
oss << "INSERT INTO " << table << " ("<< db_names <<") VALUES ("
oss << "INSERT";
}
oss << " INTO " << table << " ("<< db_names <<") VALUES ("
<< index << ","
<< term << ","
<< "'" << sql_db << "',"
<< tstamp << ","
<< fed_index << ","
<< applied << ")";
}
int rc = db->exec_wr(oss);