Queries fail - no such column

Bug #63917 reported by Christian Vogel
4
Affects Status Importance Assigned to Milestone
bacula (Ubuntu)
Won't Fix
Medium
Unassigned

Bug Description

Binary package hint: bacula-director-sqlite

Apparently there is something wrong with quoting when bacula creates the SQL strings to query it's database.

Reproduce: connect to the director via "bconsole" (or gnome-console...), execute the QUERY command. Then choose one of the queries shown below. It seems the SQL is built incorrectly, for example:

    ... WHERE JobMedia.MediaId=STRING ...

STRING should be quoted with single ticmarks, like 'STRING'.

This is bacula-director-sqlite 1.36.3-2ubuntu2 on Dapper.

Choose a query (1-15): 14
Enter MediaId: BAK002L3
Query failed: no such column: BAK002L3
SELECT DISTINCT Job.JobId,Job.Name,Job.StartTime,Job.Type, Job.Level,Job.JobFiles,Job.JobBytes,Job.JobStatus FROM JobMedia,Job WHERE JobMedia.JobId=Job.JobId AND JobMedia.MediaId=BAK002L3 ORDER by Job.StartTime;

Choose a query (1-15): 13
Enter JobId: valar_all
Query failed: no such column: valar_all
SELECT Path.Path,Filename.Name FROM File,Filename,Path WHERE File.JobId=valar_all AND Filename.FilenameId=File.FilenameId AND Path.PathId=File.PathId ORDER BY Path.Path,Filename.Name;

Choose a query (1-15): 8
Enter JobId: valar_all
Query failed: no such column: valar_all
SELECT DISTINCT Job.JobId,VolumeName FROM Job,JobMedia,Media WHERE Job.JobId=valar_all AND Job.JobId=JobMedia.JobId AND JobMedia.MediaId=Media.MediaId;

Revision history for this message
Lionel Le Folgoc (mrpouit) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. You reported this bug a while ago and there hasn't been any activity in it recently. We were wondering is this still an issue for you? Thanks in advance.

Changed in bacula:
status: New → Incomplete
Revision history for this message
Ante Karamatić (ivoks) wrote :

Confirmed on Dapper.

Changed in bacula:
importance: Undecided → Medium
status: Incomplete → Confirmed
Revision history for this message
Kern Sibbald (kern) wrote :

This bug report should be closed as it is a user input error. On the queries reported as not working, the user has entered a string in places where the query expects integers (MediaId and JobId). The query command is not designed to check input types, that is the user's responsibility, so it is normal for the query to fail.

Revision history for this message
Chuck Short (zulcss) wrote :

Closing

Changed in bacula:
status: Confirmed → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.