Hello
I have been having issues with a query in LO base that has the substring function in a where clause. I think I have managed to isolate the problem and would like to submit a bug report. I was reading through the documentation on bugzilla, and it says it is best to check here first before filing.
So here goes:
The following query initially works when created in SQL view
SELECT "Subjects"."Subject", "Classes"."Class"
FROM "Classes", "Subjects"
WHERE "Subjects"."Subject" = SUBSTRING ( "Classes"."Class" FROM 1 FOR 5 )
However, if I open the query in design view and then save it, the query does not work anymore. It seems the design view interpretter modifies the SQL slightly. If I open the now broken query in SQL view it reads as:
SELECT "Subjects"."Subject", "Classes"."Class"
FROM "Classes", "Subjects"
WHERE "Subjects"."Subject" = SUBSTRING ( "Classes"."Class" FROM '1' FOR '5' )
The design view interpreter puts apostrophes around the integers 1 and 5 which the substring function cannot then process.
Having the substring function elsewhere in the query does not seem to have the same problem. In the case below, toggling between the design and SQL views does not put apostrophes around the integers.
SELECT SUBSTRING ( "Classes"."Class" FROM 1 FOR 5 )
FROM "Classes"
Below is the database I was using to generate the problem.
Would this behavior better be attributed to either a design feature or user error? Or is it a bug that I should file?
Libreoffice 7.0.2.2, Firebird Embedded, macOS 10.15.7
Thanks a lot