Bug 52097 - Report Builder edit of Data Filter results in bad SQL syntax.
Summary: Report Builder edit of Data Filter results in bad SQL syntax.
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
3.5.5.3 release
Hardware: x86 (IA32) All
: medium critical
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-07-14 19:36 UTC by JD
Modified: 2013-08-17 03:44 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description JD 2012-07-14 19:36:34 UTC
A report built with Report Builder containing the following data filter executes correctly.:
( "Medical"."Date" >= {D '2011-01-01' } AND "Medical"."Date" < {D '2012-01-01' } )

When edited in the filter criteria interface of Report Builder the result becomes:
( "Medical"."Date" >= '{D ''2011-01-01'' }' AND "Medical"."Date" < '{D ''2013-01-01'' }' )
and, the report fails with an error message saying "Syntax error in SQL expression".  
(Note that the only edit made was to change the second date from 2012 to 2013.)

It appears that extraneous single quote (') marks are inserted in the SQL command.
Comment 1 Robert Großkopf 2012-07-15 19:37:12 UTC
I have tested it under OpenSuSE 11.4. In LO 3.3.4 it works. You could change the values with the filter-wizard during editing a report. The produced code is correct.
In LO 3.5.5 you could only change the code directly. The dialog produces wrong code.
Then I tested the dialog in tables. The dialog for filters didn't work under LO 3.5.5 here.
Have changed the Status to "New" and the Platform to "All".
Will report another bug for the filter-dialog in tables.
Comment 2 Robert Großkopf 2013-08-16 19:37:27 UTC
Have just tested it once more. The date in the filter changes in LO 3.5.7.2, when reopening a filter in the Report-Builder to a syntax error in SQL.

When I open it with LO 3.6.6.2 the filter could be edited and is saved in the right way.

I will close this bug as Resolved and Worksforme. Feel free to reopen, when the bug also appears in newer versions of LO.
Comment 3 JD 2013-08-17 03:44:44 UTC
Concur - Seems to be ok in 4.1.0.4

Slight oddity in that if the previous "bad" syntax had been saved in the report filter, it needs to be deleted before an edit can happen. No problem there really.