Take the following attachment: https://bugs.documentfoundation.org/attachment.cgi?id=173603 Go to Queries → Create Query in Design view. Choose "Table1". Choose field "Date" from table. Run query - works. Choose function "Maximum". Run Query. Query fails (and most of the editor disappears here). The created code is completely nonsense: Column not found: Maximu in statement [SELECT MAX( "Maximu" ) FROM "Table1"] It has to be SELECT MAX("Date") FROM "Table1" This bug first appears in LO 7.2.0.1, has never appeared in any version 7.1 or before.
It is the same behavior with other functions like "Minimum", "Count" and - if field "ID" is choosen - SUM … Seems no function except GROUP will work any more. Unusable!
Confirming with Version: 7.2.0.1 / LibreOffice Community Build ID: 32efc3b7f3a71cfa6a7fa3f6c208333df48656cc CPU threads: 8; OS: Mac OS X 10.16; UI render: default; VCL: osx Locale: fr-FR (fr_FR.UTF-8); UI: en-US Calc: threaded
On pc Debian x86-64 with master sources updated today, I could reproduce this. Regression from https://cgit.freedesktop.org/libreoffice/core/commit/?id=04aafba860f613c20e7078d038cc83eb02de0b54 loplugin:stringadd simplify some *StringBuffer operations pulled from a larger patch which I created with a more permissive variant of this plugin Specifically here: -------------- dbaccess/source/ui/querydesign/QueryDesignView.cxx -------------- index 22408bbc58aa..63c5d07998ec 100644 @@ -658,11 +658,10 @@ namespace if ( field->isAggregateFunction() ) { OSL_ENSURE(!field->GetFunction().isEmpty(),"Function name must not be empty! ;-("); - OUStringBuffer aTmpStr2( field->GetFunction()); - aTmpStr2.append("("); - aTmpStr2.append(aTmpStr.makeStringAndClear()); - aTmpStr2.append(")"); - aTmpStr = aTmpStr2; + aTmpStr = field->GetFunction() + + "(" + + aTmpStr + + ")"; } if (!rFieldAlias.isEmpty() &&
I gave a try with: https://gerrit.libreoffice.org/c/core/+/119088
Julien Nabet committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/4a096b9c787fa2079ef1c8f00fed91d432d46fae tdf#143400: fix query with most functions could not be created in GUI It will be available in 7.3.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Backport for 7.2 waiting for review here: https://gerrit.libreoffice.org/c/core/+/119039 Thank you Robert for having spotted this one!
Julien Nabet committed a patch related to this issue. It has been pushed to "libreoffice-7-2": https://git.libreoffice.org/core/commit/0c8d209683e04f22e924e125f778e00836c0b132 tdf#143400: fix query with most functions could not be created in GUI It will be available in 7.2.0.2. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.