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): bacula-director-mysql-5.0.3-9.fc15.x86_64 bacula-director-common-5.0.3-9.fc15.x86_64 How reproducible: static Steps to Reproduce: 1. yum install mysql-server bacula-director-mysql 2. /usr/libexec/bacula/create_bacula_database 3. /usr/libexec/bacula/make_mysql_tables Actual results: 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 Expected results: All tables should be created Additional info: 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: http://bugs.bacula.org/view.php?id=1753
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. https://admin.fedoraproject.org/updates/bacula-5.0.3-10.fc15
Package bacula-5.0.3-10.fc15: * 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: https://admin.fedoraproject.org/updates/FEDORA-2011-15370 then log in and leave karma (feedback).
bacula-5.0.3-16.fc15 has been submitted as an update for Fedora 15. https://admin.fedoraproject.org/updates/bacula-5.0.3-16.fc15