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-Tag: Release-7.0.0~1622 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=4f60917747e2540714b7514954d11e826bd7fe70;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 9fcd97ee90..6ebfc8f915 100644 --- a/bacula/src/cats/make_mysql_tables.in +++ b/bacula/src/cats/make_mysql_tables.in @@ -355,8 +355,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 e040071ce0..3dcc13c81e 100644 --- a/bacula/src/cats/sql_create.c +++ b/bacula/src/cats/sql_create.c @@ -625,7 +625,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 3057fda626..372fd9e79b 100644 --- a/bacula/src/cats/sql_get.c +++ b/bacula/src/cats/sql_get.c @@ -736,7 +736,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 0bc5787bbc..23d2da3223 100644 --- a/bacula/src/cats/sql_update.c +++ b/bacula/src/cats/sql_update.c @@ -241,7 +241,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);