From dbac6c1ce1f03fd92d376224d234245dc711b400 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Sun, 8 Aug 2010 18:00:07 +0200 Subject: [PATCH] Fix bug #1504 -- Error when creating tables in MySQL 5.5 --- bacula/src/cats/make_mysql_tables.in | 4 ++-- bacula/src/cats/sql_create.c | 2 +- bacula/src/cats/sql_get.c | 2 +- bacula/src/cats/sql_update.c | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) 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); -- 2.39.5