Created attachment 114731 [details] Screenshot If you create a SQL Query as <Create Query in SQL View...> and use an AS in front of an Aliasname it is removed by <switch Design View On/Off> or by close and edit again. The query works fine, but it is more readable for Humans if they stay. It worked before in older Versions of LibreOffice as well. I use Win 8.1 and attached a screenshot
I can confirm with Version: 4.5.0.0.alpha0+ Build ID: b024e36ddb3b53163d7a01f6f7b5aadb7a858cd9 TinderBox: Linux-rpm_deb-x86_64@46-TDF, Branch:master, Time: 2015-03-31_09:12:20 @Ulf:In which version it worked?
I can not remember but i tetsted the last version i have 4.3.6.2 and it is the same behavior.
Hi I tested with older portable Versions of LibO from http://downloadarchive.documentfoundation.org/libreoffice/old/ The last version i found, where the AS for aliasnames stayes was the 4.3.0.4 4.2.8.2 OK 4.3.0.4 OK 4.3.1.2 defekt 4.3.6.2 defekt I hope it will be help
(In reply to Ulf from comment #3) > Hi > I tested with older portable Versions of LibO from > http://downloadarchive.documentfoundation.org/libreoffice/old/ > > The last version i found, where the AS for aliasnames stayes was the 4.3.0.4 > 4.2.8.2 OK > 4.3.0.4 OK > 4.3.1.2 defekt > 4.3.6.2 defekt > > I hope it will be help Thanks! It will help.
This changed at the below commit. Adding Cc: to serval2412@yahoo.fr; I see this relates to a deliberate change, but there is some discussion on the below mentioned bug as to when it should apply. Is this now the intended behaviour, including for built in databases? commit 568778874429595855b435792e5ebecd52956dae Author: Julien Nabet <serval2412@yahoo.fr> AuthorDate: Tue Jul 22 18:36:05 2014 +0200 Commit: Julien Nabet <serval2412@yahoo.fr> CommitDate: Tue Jul 22 18:38:21 2014 +0200 Resolves fdo#81213: Wrong table-clause generated by reportbuilder Oracle doesn't accept "AS" for making an alias from a table See https://bugs.freedesktop.org/show_bug.cgi?id=81213#c2 https://bugs.freedesktop.org/show_bug.cgi?id=81213#c4 https://bugs.freedesktop.org/show_bug.cgi?id=81213#c5 for more information (thank you Lionel) Change-Id: I33c86d78b2590116d4af46ffd3e54c3c791268ea
Matthew: it seems so since at least it works for every DB. If not, perhaps we should add "UseKeywordAsBeforeAlias"/"AppendTableAliasInSelect" block in connectivity/registry/hsqldb/org/openoffice/Office/DataAccess/Drivers.xcu + "GenerateASBeforeCorrelationName" block in connectivity/source/drivers/hsqldb/HDriver.cxx. Lionel: any thoughts?
Migrating Whiteboard tags to Keywords: (bibisected) [NinjaEdit]
(In reply to Julien Nabet from comment #6) > Matthew: it seems so since at least it works for every DB. > If not, perhaps we should add > "UseKeywordAsBeforeAlias"/"AppendTableAliasInSelect" block in > connectivity/registry/hsqldb/org/openoffice/Office/DataAccess/Drivers.xcu + > "GenerateASBeforeCorrelationName" block in > connectivity/source/drivers/hsqldb/HDriver.cxx. > Lionel: any thoughts? Adding "UseKeywordAsBeforeAlias" to hsqldb's Drivers.xcu (in the properties section) should work, yes. Technically, as both work, it does not matter. From a human POV I prefer seeing the "AS", too. You can add it. If we do that, design view will add "AS" if it is not there, but I guess that is not a problem. Adding GenerateASBeforeCorrelationName in HDriver.cxx should not be necessary.
Julien Nabet committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=6807e21f5f8d7da8b9a7593a21eb09404712dd20 tdf#90561: Add AS keyword in Query-designer for hsqldb It will be available in 5.2.0. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Julien Nabet committed a patch related to this issue. It has been pushed to "libreoffice-5-1": http://cgit.freedesktop.org/libreoffice/core/commit/?id=4d3ca45bf2e0a2b06ea897b5084184a57a299102&h=libreoffice-5-1 tdf#90561: Add AS keyword in Query-designer for hsqldb It will be available in 5.1.3. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Couldn't confirm this bug has been fixed. Have tested it with LO 6.2.5.2. Created a query an added an alias for a field in the GUI. No "AS" appears in the SQL-code. Added "AS" to the SQL-code, changed back to the design view and then to SQL view. "AS" has been gone again. All tested with an internal HSQLDB on LO 6.2.5.2 with OpenSUSE 15 64bit rpm Linux.
(In reply to Robert Großkopf from comment #11) > Couldn't confirm this bug has been fixed. Have tested it with LO 6.2.5.2. > Created a query an added an alias for a field in the GUI. No "AS" appears in > the SQL-code. Added "AS" to the SQL-code, changed back to the design view > and then to SQL view. "AS" has been gone again. > > All tested with an internal HSQLDB on LO 6.2.5.2 with OpenSUSE 15 64bit rpm > Linux. I gave a new try with master sources updated today but don't reproduce the bug. Perhaps I missed something. Lionel: any thoughts here?