From: Kern Sibbald Date: Sun, 8 Aug 2010 16:00:07 +0000 (+0200) Subject: Fix bug #1504 -- Error when creating tables in MySQL 5.5 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=448cd337f99cdc43aef9431d4194fc792bd08271;p=bacula%2Fbacula Fix bug #1504 -- Error when creating tables in MySQL 5.5 --- diff --git a/bacula/src/cats/make_mysql_tables.in b/bacula/src/cats/make_mysql_tables.in index 37a10d235b..6cf24a3f67 100644 --- a/bacula/src/cats/make_mysql_tables.in +++ b/bacula/src/cats/make_mysql_tables.in @@ -324,8 +324,8 @@ CREATE TABLE UnsavedFiles ( CREATE TABLE Counters ( Counter TINYBLOB NOT NULL, - MinValue INTEGER DEFAULT 0, - MaxValue INTEGER DEFAULT 0, + `MinValue` INTEGER DEFAULT 0, + `MaxValue` INTEGER DEFAULT 0, CurrentValue INTEGER DEFAULT 0, WrapCounter TINYBLOB NOT NULL, PRIMARY KEY (Counter(128)) diff --git a/bacula/src/cats/sql_create.c b/bacula/src/cats/sql_create.c index e3d4f74497..ad84e678f2 100644 --- a/bacula/src/cats/sql_create.c +++ b/bacula/src/cats/sql_create.c @@ -627,7 +627,7 @@ int db_create_counter_record(JCR *jcr, B_DB *mdb, COUNTER_DBR *cr) } /* Must create it */ - Mmsg(mdb->cmd, "INSERT INTO Counters (Counter,MinValue,MaxValue,CurrentValue," + Mmsg(mdb->cmd, "INSERT INTO Counters (Counter,\"MinValue\",\"MaxValue\",CurrentValue," "WrapCounter) VALUES ('%s','%d','%d','%d','%s')", cr->Counter, 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 13f053bf11..e9d3bcc929 100644 --- a/bacula/src/cats/sql_get.c +++ b/bacula/src/cats/sql_get.c @@ -730,7 +730,7 @@ int db_get_counter_record(JCR *jcr, B_DB *mdb, COUNTER_DBR *cr) SQL_ROW row; db_lock(mdb); - Mmsg(mdb->cmd, "SELECT MinValue,MaxValue,CurrentValue,WrapCounter " + Mmsg(mdb->cmd, "SELECT \"MinValue\",\"MaxValue\",CurrentValue,WrapCounter " "FROM Counters WHERE Counter='%s'", cr->Counter); if (QUERY_DB(jcr, mdb, mdb->cmd)) { diff --git a/bacula/src/cats/sql_update.c b/bacula/src/cats/sql_update.c index 30f60fd277..5ac95e5fbf 100644 --- a/bacula/src/cats/sql_update.c +++ b/bacula/src/cats/sql_update.c @@ -243,7 +243,7 @@ int db_update_counter_record(JCR *jcr, B_DB *mdb, COUNTER_DBR *cr) db_lock(mdb); Mmsg(mdb->cmd, -"UPDATE Counters SET MinValue=%d,MaxValue=%d,CurrentValue=%d," +"UPDATE Counters SET \"MinValue\"=%d,\"MaxValue\"=%d,CurrentValue=%d," "WrapCounter='%s' WHERE Counter='%s'", cr->MinValue, cr->MaxValue, cr->CurrentValue, cr->WrapCounter, cr->Counter);