From: Kern Sibbald Date: Tue, 17 Jan 2012 14:15:20 +0000 (+0100) Subject: Definitive fix for MySQL MaxValue problem X-Git-Tag: Release-7.0.0~335 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=8c75a49bed8f47dcae23da07484fc12abf9c1158;p=bacula%2Fbacula Definitive fix for MySQL MaxValue problem --- diff --git a/bacula/src/cats/sql_create.c b/bacula/src/cats/sql_create.c index 0facbb2a79..a4a6f47222 100644 --- a/bacula/src/cats/sql_create.c +++ b/bacula/src/cats/sql_create.c @@ -656,7 +656,7 @@ int db_create_counter_record(JCR *jcr, B_DB *mdb, COUNTER_DBR *cr) } mdb->db_escape_string(jcr, esc, cr->Counter, strlen(cr->Counter)); /* Must create it */ - Mmsg(mdb->cmd, "INSERT INTO Counters (Counter,MinValue,MaxValue,CurrentValue," + Mmsg(mdb->cmd, "INSERT INTO Counters (Counter,Counters.MinValue,Counters.MaxValue,CurrentValue," "WrapCounter) VALUES ('%s','%d','%d','%d','%s')", esc, cr->MinValue, cr->MaxValue, cr->CurrentValue, cr->WrapCounter); diff --git a/bacula/src/cats/sql_get.c b/bacula/src/cats/sql_get.c index 3062d729f4..f3e4a24b93 100644 --- a/bacula/src/cats/sql_get.c +++ b/bacula/src/cats/sql_get.c @@ -756,7 +756,7 @@ int db_get_counter_record(JCR *jcr, B_DB *mdb, COUNTER_DBR *cr) db_lock(mdb); mdb->db_escape_string(jcr, esc, cr->Counter, strlen(cr->Counter)); - Mmsg(mdb->cmd, "SELECT MinValue,MaxValue,CurrentValue,WrapCounter " + Mmsg(mdb->cmd, "SELECT Counters.MinValue,Counters.MaxValue,CurrentValue,WrapCounter " "FROM Counters WHERE Counter='%s'", esc); if (QUERY_DB(jcr, mdb, mdb->cmd)) { diff --git a/bacula/src/cats/sql_update.c b/bacula/src/cats/sql_update.c index 62ce20ec19..422edd888b 100644 --- a/bacula/src/cats/sql_update.c +++ b/bacula/src/cats/sql_update.c @@ -253,7 +253,7 @@ int db_update_counter_record(JCR *jcr, B_DB *mdb, COUNTER_DBR *cr) db_lock(mdb); mdb->db_escape_string(jcr, esc, cr->Counter, strlen(cr->Counter)); Mmsg(mdb->cmd, -"UPDATE Counters SET MinValue=%d,MaxValue=%d,CurrentValue=%d," +"UPDATE Counters SET Counters.MinValue=%d,Counters.MaxValue=%d,CurrentValue=%d," "WrapCounter='%s' WHERE Counter='%s'", cr->MinValue, cr->MaxValue, cr->CurrentValue, cr->WrapCounter, esc);