When Base is connected to a MySQL/MariaDB database a new bug in the GUI query editor breaks joins

I use Base as a GUI interface to a MariaDB database where the actual records are stored.

I’m seeing that a new bug (new to me, which is somewhere after LO V5.4) in the GUI query editor now breaks outer JOINs in my SQL statements.

For example, here is a FROM with some JOINs statement (i.e. obtained from QUERIES | then right click on the query name | Edit in SQL view) that works (i.e. I can run it and get a results list). Note this was hand-edited to add line breaks before the JOIN statements so it’s easier to read:

FROM { oj 
`links`.`locations` AS `locations` 
LEFT OUTER JOIN `links`.`locations house areas` AS `locations house areas` ON `locations`.`Location House Area ID` = `locations house areas`.`Location House Area ID` 
LEFT OUTER JOIN `links`.`locations houses` AS `locations houses` ON `locations houses`.`House ID` = `locations house areas`.`House ID` 
RIGHT OUTER JOIN `links`.`battery appliances` AS `battery appliances` ON `locations`.`Location ID` = `battery appliances`.`Location ID` 
LEFT OUTER JOIN `links`.`battery types` AS `battery types` ON `battery appliances`.`Battery type ID` = `battery types`.`Battery type ID` 
LEFT OUTER JOIN `links`.`battery technologies` AS `battery technologies` ON `battery types`.`Battery technology ID` = `battery technologies`.`Battery technology ID` 
LEFT OUTER JOIN `links`.`stuff, owners` AS `stuff, owners` ON `battery appliances`.`Owner ID` = `stuff, owners`.`Owner ID` 
LEFT OUTER JOIN `links`.`locations possible` AS `locations possible` ON `locations`.`Possible Location ID` = `locations possible`.`Possible Location ID` 
}

But if I first click ‘Switch Design View On/Off’ to see/and possibly edit the SQL with the GUI editor:

And then if I click ‘Switch Design View On/Off’ again to return to the SQL text view, I now have this FROM statement which is broken by inclusion of two extra }, {s:

FROM { oj 
`links`.`locations` AS `locations` 
LEFT OUTER JOIN `links`.`locations house areas` AS `locations house areas` ON `locations`.`Location House Area ID` = `locations house areas`.`Location House Area ID` 
LEFT OUTER JOIN `links`.`locations houses` AS `locations houses` ON `locations house areas`.`House ID` = `locations houses`.`House ID` 
}, { oj 
`links`.`locations` AS `locations` 
RIGHT OUTER JOIN `links`.`battery appliances` AS `battery appliances` ON `locations`.`Location ID` = `battery appliances`.`Location ID` 
RIGHT OUTER JOIN `links`.`battery types` AS `battery types` ON `battery types`.`Battery type ID` = `battery appliances`.`Battery type ID` RIGHT OUTER JOIN `links`.`battery technologies` AS `battery technologies` ON `battery technologies`.`Battery technology ID` = `battery types`.`Battery technology ID` 
RIGHT OUTER JOIN `links`.`stuff, owners` AS `stuff, owners` ON `stuff, owners`.`Owner ID` = `battery appliances`.`Owner ID` 
}, { oj 
`links`.`locations` AS `locations` 
LEFT OUTER JOIN `links`.`locations possible` AS `locations possible` ON `locations`.`Possible Location ID` = `locations possible`.`Possible Location ID` 
}

And when run it produces this error:

Screenshot from 2023-12-17 07-02-56

This bug did not exist in LO 5.4 which I used for many years. As near as I can tell the {oj ..} construct has something to do with jdbc (the Java database Connector). I think the idea is that because different databases have somewhat different syntax, it is a way to deal with translating the outer join syntax to work correctly for any given connector.

Workaround

I can use snapper to get a previous copy of the database, open this older copy in SQL mode, extract the old SQL’s FROM statement and insert it into the broken SQL and run it and my query works again. It requires that I no longer can ever use the GUI query editor, but rather now must edit my SQL only in text.

Am I the only one with this problem? I wish I had hope that I could report this as a bug and hope to get it fixed, but that hope was lost many years ago. Now it seems the only way to maintain my databases is by hand editing the SQL going forwards, which pretty much means that the flashy LO Base GUI is useless now, not entirely, but much closer to useless.

Also, for what it’s worth, the old bug in the GUI query editor that would mixup/mangle JOIN LEFT/RIGHT directions is still there after all these years. You’ll see this bug when you have more than about 3 joins. My old workaround for that was to hand check all of my joins every time before I saved.

I know this can’t be true, but it almost seems like someone is deliberately trying to destroy LO base, little by little. But that’s probably just my own paranoia. More likely is that someone is improving base for some other connector, like Fire…whatever, and accidentally breaking other things as they do that work.

The other thing that is annoying and could be improved is to not destroy white space between SQL text edits. If one is going to edit SQL as text, keeping line breaks and spacing in place is very helpful to re-editing it. Having to start parsing it all over with each new edit is easy for a computer but hard for a human.

Related: [Bug 112801] Improve LO SQL parser to allow GUI Query editor usage with more SQL connection varieties

Think working with LEFT JOIN and RIGHT JOIN in GUI (and special when changing from GUI to SQL and back) never worked.
See
https://bugs.documentfoundation.org/show_bug.cgi?id=83121
https://bugs.documentfoundation.org/show_bug.cgi?id=108375
I’m using the GUI for first design - clicking all the fields together I need. Then change to SQL-code and never go back to GUI mode.

Thanks RobertG. You’re right, it still works to sort of get things going. Also it can be used to display what is going on so long as you don’t save it.

But I’m pretty sure GUI query editing used to work properly, like back in 2016 when I started with Base. Then at some point the LEFT/RIGHT JOIN bug crept in, or perhaps I just finally noticed it at some point. Too long ago to remember for sure.

Now we have this second miserable issue. As I’m getting older this is getting more and more annoying and out of hand. I laid in bed today wondering if I should move back to MS Access, or keep a second computer with all of the working 5.4 version stuff and never move forward with LO Base versions. A few years ago I worked on learning C++ and successfully got one edit to LO (to fix an incorrect comment documenting an incorrect URL, lol), but life issues stopped my efforts and perhaps I will try again someday before I fully run out of gas so to speak. But another thing that really frustrated me with that C++ effort was that it took the git keepers over a month to merge in my fix to the incorrect comment. It seemed like for whatever reason they didn’t want anyone helping fix things, I don’t know for sure. I weighted the idea of just forking base but that is a huge and overwhelming thing. So I’m really not sure how to proceed.

So: Try to reproduce this bug with a small example and internal database.
Write it to the bugtracker and attach this example.
Will work better than long text content.
Let us set it as a regression. This kind of bugs could be solved better than bugs, that are bugs since start of LO.

I wish I had your hope, but over the years I carefully reported many bugs. Almost all of them languished for years and were finally ignored when the bot sweeper would come around and ask me to re-test them and report of they were still a bug. In other words, they weren’t fixed and closed. There was no one to fix any bugs. … but I have an idea:

The other problem is the LO source code is so very hard to read and is hugely lacking in comments to explain what’s what. Very hard to accurately fix bugs in this huge mess. But what if I forked LO, not to carry the fork forward, but just for a scratchpad for bug fixers. I/we could add comments to the LO source base and re-factor without stepping on anyone’s toes. The hope would be to get to where the code was not a mystery, and then find where to fix these bugs, and just port the fixes back to the master LO tree. Sadly, the comments added would never be usable by many others, and as LO marches forward the fork would slowly go out of date (or with a huge merge effort could possibly be kept up to date). I don’t know, but the Base LO bug fixing business is really badly broken and someone needs to come at it a new way I think.

I have also reported many bugs, but also found people to fix many bugs. There are still 179 open bugs reported by me -most of them reported for Base. There are only a few persons who could fix bugs for Base … Most of developers know there is a component like Base but never used this component and won’t have a look at this code.

Thank you for the work you have done on this.