[pkg-bacula-devel] Bug#975970: bacula-director-mysql broken SQL schema for mariadb-server-10.5
Radoslav Bodó
bodik at cesnet.cz
Fri Nov 27 19:48:57 GMT 2020
> I don't really have an exact explanation but at least the schema seem to
> be created ...
I've been a little bit too rash, database gets created but director was
unable to run a single job ...
```
27-Nov 19:40 xxx JobId 0: Fatal error: sql_create.c:83 Create DB Job
record INSERT INTO Job
(Job,Name,Type,Level,JobStatus,SchedTime,JobTDate,ClientId,Comment)
VALUES
('job_tester.xxx_fs_autotest.2020-11-27_19.40.13_03','job_xxx_fs_autotest','B','F','C','2020-11-27
19:40:13',1606502413,2,'') failed. ERR=Cannot add or update a child row:
a foreign key constraint fails (`bacula`.`Job`, CONSTRAINT `Job_ibfk_2`
FOREIGN KEY (`PoolId`) REFERENCES `Pool` (`PoolId`))
```
... so I consulted sources about the postgresl db structure and found,
that there does not seem to be any FKs in the original/supported schema.
So I went to create another patch and just dropped the REFERENCES from
mysql schema (see the attachment). Director seem to be fully working at
least in our CI with it.
I wonder whether this might be a proper solution which works for everybody:
* it resolved the original issue
* it matches postgresql schema a bit more
* also ClientId types gets synced across all columns in all tables
bodik
-------------- next part --------------
A non-text attachment was scrubbed...
Name: debian-bacula-mysql-install-schema1.patch
Type: text/x-patch
Size: 6742 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/pkg-bacula-devel/attachments/20201127/7872e8bd/attachment-0001.bin>
More information about the pkg-bacula-devel
mailing list