Revert "use CONCAT when updating event notes so that we don't overwrite notes set by other processes."

This reverts commit a90033e026.
This commit is contained in:
Isaac Connor 2020-02-25 16:38:31 -05:00
parent a7c782efa5
commit 81f8f85be5
1 changed files with 2 additions and 2 deletions

View File

@ -418,7 +418,7 @@ void Event::updateNotes(const StringSetMap &newNoteSetMap) {
unsigned long notesLen = 0;
if ( !stmt ) {
const char *sql = "UPDATE `Events` SET `Notes` = CONCAT(`Notes`,?) WHERE `Id` = ?";
const char *sql = "UPDATE `Events` SET `Notes` = ? WHERE `Id` = ?";
stmt = mysql_stmt_init(&dbconn);
if ( mysql_stmt_prepare(stmt, sql, strlen(sql)) ) {
@ -461,7 +461,7 @@ void Event::updateNotes(const StringSetMap &newNoteSetMap) {
mysql_real_escape_string(&dbconn, escapedNotes, notes.c_str(), notes.length());
snprintf(sql, sizeof(sql), "UPDATE `Events` SET `Notes` = CONCAT(`Notes`,'%s') WHERE `Id` = %" PRIu64, escapedNotes, id);
snprintf(sql, sizeof(sql), "UPDATE `Events` SET `Notes` = '%s' WHERE `Id` = %" PRIu64, escapedNotes, id);
db_mutex.lock();
if ( mysql_query(&dbconn, sql) ) {
Error("Can't insert event: %s", mysql_error(&dbconn));