From 81f8f85be56fe516b6b660143314f1f10e0c2090 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Tue, 25 Feb 2020 16:38:31 -0500 Subject: [PATCH] Revert "use CONCAT when updating event notes so that we don't overwrite notes set by other processes." This reverts commit a90033e026d03e76d00f0fafb4d60a06e0419d1b. --- src/zm_event.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/zm_event.cpp b/src/zm_event.cpp index 67c7a4210..e564479f3 100644 --- a/src/zm_event.cpp +++ b/src/zm_event.cpp @@ -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));