Red Hat Bugzilla – Bug 724894
Can't create bacula MySQL tables
Last modified: 2012-07-18 05:19:14 EDT
Description of problem:
After the bacula database have been created with bacula's scripts, the tables creation fails on a mysql syntax error. Only the "Counters" table is not created, but this table is certainly mandatory.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. yum install mysql-server bacula-director-mysql
Script make_mysql_tables fails with:
manual that corresponds to your MySQL server version for the right syntax to use near 'MaxValue INTEGER DEFAULT 0,
CurrentValue INTEGER DEFAULT 0,
WrapCounter TI' at line 4
All tables should be created
Is there any readme file for fedora installation of bacula?
MaxValue is a reserved word in mysql 5.5 cf http://dev.mysql.com/doc/refman/5.5/en/reserved-words.html
Have reported this bug upstream:
Here is the patch found on the bacula mantis:
--- make_mysql_tables.orig 2010-02-15 16:05:14.000000000 +0200
+++ make_mysql_tables 2010-02-15 16:09:50.000000000 +0200
@@ -322,12 +322,12 @@
-CREATE TABLE Counters (
- Counter TINYBLOB NOT NULL,
- MinValue INTEGER DEFAULT 0,
- MaxValue INTEGER DEFAULT 0,
- CurrentValue INTEGER DEFAULT 0,
- WrapCounter TINYBLOB NOT NULL,
+CREATE TABLE \`Counters\` (
+ \`Counter\` TINYBLOB NOT NULL,
+ \`MinValue\` INTEGER DEFAULT 0,
+ \`MaxValue\` INTEGER DEFAULT 0,
+ \`CurrentValue\` INTEGER DEFAULT 0,
+ \`WrapCounter\` TINYBLOB NOT NULL,
PRIMARY KEY (Counter(128))
I try and it works now. Can someone integrate it in a new release of bacula packages?
Created attachment 518652 [details]
proposed patch which adds quotes to MaxValue column
This patch adds quotes to all sql queries where MaxValue is used. I've tested it only in some use cases, so another tests are welcome.
Created attachment 529756 [details]
Patch for MaxValue issue from upstream git
In bacula git they have solved it only for files in src/cats/. But they have used different type of quotation in .c files.
Fix commited to git -> http://lists.fedoraproject.org/pipermail/scm-commits/2011-November/679426.html ->modified
bacula-5.0.3-10.fc15 has been submitted as an update for Fedora 15.
* should fix your issue,
* was pushed to the Fedora 15 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing bacula-5.0.3-10.fc15'
as soon as you are able to.
Please go to the following url:
then log in and leave karma (feedback).
bacula-5.0.3-16.fc15 has been submitted as an update for Fedora 15.