Bug 724894 - Can't create bacula MySQL tables
Can't create bacula MySQL tables
Product: Fedora
Classification: Fedora
Component: bacula (Show other bugs)
All Linux
unspecified Severity high
: ---
: ---
Assigned To: Andreas Thienemann
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2011-07-22 04:17 EDT by Edouard Bourguignon
Modified: 2012-07-18 05:19 EDT (History)
10 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2012-07-18 05:19:14 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
proposed patch which adds quotes to MaxValue column (7.05 KB, patch)
2011-08-17 06:54 EDT, Honza Horak
no flags Details | Diff
Patch for MaxValue issue from upstream git (2.07 KB, patch)
2011-10-24 05:04 EDT, Lukáš Nykrýn
no flags Details | Diff

  None (edit)
Description Edouard Bourguignon 2011-07-22 04:17:48 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):

How reproducible:

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?
Comment 1 Edouard Bourguignon 2011-07-25 09:08:04 EDT
MaxValue is a reserved word in mysql 5.5 cf http://dev.mysql.com/doc/refman/5.5/en/reserved-words.html
Comment 2 Edouard Bourguignon 2011-07-25 09:22:09 EDT
Have reported this bug upstream:
Comment 3 Edouard Bourguignon 2011-07-25 11:04:04 EDT
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 (
-   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?
Comment 4 Honza Horak 2011-08-17 06:54:30 EDT
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.
Comment 5 Lukáš Nykrýn 2011-10-24 05:04:23 EDT
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.
Comment 6 Lukáš Nykrýn 2011-11-03 09:23:35 EDT
Fix commited to git -> http://lists.fedoraproject.org/pipermail/scm-commits/2011-November/679426.html ->modified
Comment 7 Fedora Update System 2011-11-03 09:48:10 EDT
bacula-5.0.3-10.fc15 has been submitted as an update for Fedora 15.
Comment 8 Fedora Update System 2011-11-04 16:26:15 EDT
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:
then log in and leave karma (feedback).
Comment 9 Fedora Update System 2012-01-02 03:56:35 EST
bacula-5.0.3-16.fc15 has been submitted as an update for Fedora 15.

Note You need to log in before you can comment on or make changes to this bug.