]> git.sur5r.net Git - bacula/bacula/commitdiff
Definitive fix for MySQL MaxValue problem
authorKern Sibbald <kern@sibbald.com>
Tue, 17 Jan 2012 14:15:20 +0000 (15:15 +0100)
committerKern Sibbald <kern@sibbald.com>
Sat, 20 Apr 2013 12:50:27 +0000 (14:50 +0200)
bacula/src/cats/sql_create.c
bacula/src/cats/sql_get.c
bacula/src/cats/sql_update.c

index 0facbb2a790e559ff4cf4954d927e135c6fd85ed..a4a6f47222e96ac21f910011209157280fd569fe 100644 (file)
@@ -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);
index 3062d729f4b5f75a612d44bbd5f05b2d963fbd38..f3e4a24b93e1bca52f7a31028f36f2810aed7830 100644 (file)
@@ -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)) {
index 62ce20ec1941ad1e8fb168d6acbb319ea581270a..422edd888b2f04471a2d34dabae3b3f8f2c2198f 100644 (file)
@@ -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);