View Issue Details

IDProjectCategoryView StatusLast Update
0000566bareos-coredirectorpublic2017-06-08 15:26
Reporterpascal Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
PlatformLinuxOSDebianOS Version8
Product Version15.2.1 
Summary0000566: SQL syntax error while trying to restore from copy job
DescriptionThe normal restore operation works on the client.

If I add the 'copies' keyword to the restore call the original backup gets selected and not the (remote) copy. In the Logfile of the director i see the following SQL error:

17-Nov 11:32 xxxxxxxxxxx-dir JobId 0: Fatal error: sql_list.c:296 sql_list.c:296 query SELECT DISTINCT Job.PriorJobId AS JobId, Job.Job, Job.JobId AS CopyJobId, Media.MediaType FROM Job JOIN JobMedia USING (JobId) JOIN Media USING (MediaId) WHERE Job.Type = 'C' AND (Job.PriorJobId IN (562,570,571,576,927,928) OR Job.JobId IN (562,570,571,576,927,928)) ORDER BY Job.PriorJobId DESC <NULL> failed:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '<NULL>' at line 1


If I query the Database without the <NULL> character I get what looks like a correct result:

+-------+-------------------------------------------------------------+-----------+---------------+
| JobId | Job | CopyJobId | MediaType |
+-------+-------------------------------------------------------------+-----------+---------------+
| 576 | xxxxxxxxxxx.2015-11-16_15.34.36_07 | 918 | store03.bkp01 |
| 571 | xxxxxxxxxxx.2015-11-16_15.34.36_05 | 916 | store03.bkp01 |
| 570 | xxxxxxxxxxx.2015-11-16_15.34.36_03 | 914 | store03.bkp01 |
| 562 | xxxxxxxxxxx.2015-11-16_15.57.21_10 | 925 | store03.bkp01 |
+-------+-------------------------------------------------------------+-----------+---------------+

I'm using Mysql 5.5.46 as a database backend.
TagsNo tags attached.

Activities

mvwieringen

mvwieringen

2015-11-19 14:49

developer   ~0002003

Fix committed to bareos bareos-15.2 branch with changesetid 5892.

Related Changesets

bareos: bareos-15.2 3ce3c571

2015-11-17 13:53

mvwieringen

Ported: N/A

Details Diff
Fix SQL syntax error while trying to restore from copy job

Fixes 0000566: SQL syntax error while trying to restore from copy job
Affected Issues
0000566
mod - src/dird/ua_restore.c Diff File

Issue History

Date Modified Username Field Change
2015-11-17 11:53 pascal New Issue
2015-11-17 12:54 mvwieringen Assigned To => mvwieringen
2015-11-17 12:54 mvwieringen Status new => assigned
2015-11-19 14:49 mvwieringen Changeset attached => bareos bareos-15.2 3ce3c571
2015-11-19 14:49 mvwieringen Note Added: 0002003
2015-11-19 14:49 mvwieringen Status assigned => resolved
2015-11-19 14:49 mvwieringen Resolution open => fixed
2017-06-08 15:26 joergs Status resolved => closed
2017-06-08 15:26 joergs Assigned To mvwieringen =>