Created attachment 196294 [details] errordetails Edit Test_01 Run query Query works Insert any field like idTyp by double click set function to “group by” to the new column run query Error in Libreoffice 24.8 delete column idTyp Impossible to run or save the query again There is no error in 24.2.4.2 Version: 24.8.0.3 (X86_64) / LibreOffice Community Build ID: 0bdf1299c94fe897b119f97f3c613e9dca6be583 CPU threads: 24; OS: Windows 11 X86_64 (10.0 build 22631); UI render: Skia/Raster; VCL: win Locale: de-DE (de_DE); UI: de-DE Calc: CL threaded
Created attachment 196295 [details] Database to show the error
Different behavior here: Opening the query in LO 24.2.5.2 for editing in GUI. Executing query → no problem Adding field to query → no problem Opening in LO 24.8.0.3 for editing in GUI. Executing query → Crash of LO Opening in LO 24.8.1.1 for editing in GUI. Executing query → "Syntax error in SQL statement" and in details the old unusable "syntax error, unexpected $end, expecting BETWEEN or IN or SQL_TOKEN_LIKE" If opening the query for editing in SQL mode query could be executed. You won't need to add any field to produce the buggy behavior of GUI. Version: 24.8.1.1 (X86_64) / LibreOffice Community Build ID: ef51c4a0cd35185debf25ad9d0db6a1c14bed5a0 CPU threads: 6; OS: Linux 6.4; UI render: default; VCL: kf5 (cairo+xcb) Locale: de-DE (de_DE.UTF-8); UI: en-US Calc: threaded
On pc Debian x86-64 with master sources updated today, I could reproduce the error message. After some gdb trace, I noticed that when opening the query in edition, I got: #0 dbaui::OQueryController::setStatement_fireEvent (this=0x5583a3cb8d90, _rNewStatement="SELECT \"fiPayTermin\", SUM( CASE WHEN \"dtPayTyp\" = 1 THEN \"dtPayBetrag\" * - 1 ELSE \"dtPayBetrag\" END ) \"qcpSollHabenErsatz\" FROM \"tblmPay\" GROUP BY \"tblmPay\".\"fiPayTermin\"", _bFireStatementChange=true) at dbaccess/source/ui/querydesign/querycontroller.cxx:1724 #1 0x00007fe3f1eb882f in dbaui::OQueryController::impl_reset (this=0x5583a3cb8d90, i_bForceCurrentControllerSettings=false) at dbaccess/source/ui/querydesign/querycontroller.cxx:1609 #2 0x00007fe3f1eb7de4 in dbaui::OQueryController::impl_initialize (this=0x5583a3cb8d90, rArguments=...) at dbaccess/source/ui/querydesign/querycontroller.cxx:809 #3 0x00007fe3f1bb4fe2 in dbaui::OGenericUnoController::initialize (this=0x5583a3cb8d90, aArguments=uno::Sequence of length 13 = {...}) at dbaccess/source/ui/browser/genericcontroller.cxx:217 #4 0x00007fe3f1b2a76d in (anonymous namespace)::DBContentLoader::load (this=0x5583a1707c50, rFrame=uno::Reference to ((anonymous namespace)::XFrameImpl *) 0x5583a3d45af0, rURL=".component:DB/QueryDesign", rArgs=uno::Sequence of length 12 = {...}, rListener=uno::Reference to (framework::(anonymous namespace)::LoadEnvListener *) 0x5583a3aad4a8) at dbaccess/source/ui/browser/dbloader.cxx:226 #5 0x00007fe424c1da70 in framework::LoadEnv::impl_loadContent (this=0x7fff543b7218) at framework/source/loadenv/loadenv.cxx:1163 #6 0x00007fe424c1aa84 in framework::LoadEnv::start (this=0x7fff543b7218) at framework/source/loadenv/loadenv.cxx:412 so _rNewStatement="SELECT \"fiPayTermin\", SUM( CASE WHEN \"dtPayTyp\" = 1 THEN \"dtPayBetrag\" * - 1 ELSE \"dtPayBetrag\" END ) \"qcpSollHabenErsatz\" FROM \"tblmPay\" GROUP BY \"tblmPay\".\"fiPayTermin\"" but when executing, i got: #0 dbaui::OQueryController::setStatement_fireEvent (this=0x5583a49acae0, _rNewStatement="SELECT \"fiPayTermin\", Sum(Sum( WHEN \"dtPayTyp\" = 1 THEN \"dtPayBetrag\" * - 1 ELSE \"dtPayBetrag\" END) AS \"qcpSollHabenErsatz\" FROM \"tblmPay\" GROUP BY \"tblmPay\".\"fiPayTermin\" ", _bFireStatementChange=false) at dbaccess/source/ui/querydesign/querycontroller.cxx:1724 #1 0x00007fe3f1ebaca4 in dbaui::OQueryController::translateStatement (this=0x5583a49acae0, _bFireStatementChange=false) at dbaccess/source/ui/querydesign/querycontroller.cxx:1520 #2 0x00007fe3f1eb53ab in dbaui::OQueryController::executeQuery (this=0x5583a49acae0) at dbaccess/source/ui/querydesign/querycontroller.cxx:1081 #3 0x00007fe3f1eb2bb7 in dbaui::OQueryController::Execute (this=0x5583a49acae0, _nId=10721, aArgs=uno::Sequence of length 1 = {...}) at dbaccess/source/ui/querydesign/querycontroller.cxx:582 SELECT \"fiPayTermin\", Sum(Sum( WHEN \"dtPayTyp\" = 1 THEN \"dtPayBetrag\" * - 1 ELSE \"dtPayBetrag\" END) AS \"qcpSollHabenErsatz\" FROM \"tblmPay\" GROUP BY \"tblmPay\".\"fiPayTermin\" " Notice the "SUM ( CASE" is transformed in "Sum(Sum"
I gave a try with https://gerrit.libreoffice.org/c/core/+/172989
Just for info, this bug isn't specific to Firebird, it's related to queries in general which include an aggregate function (SUM, COUNT, etc.) So there may be already existing bugs with the same root cause.
Julien Nabet committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/c0fd5f82ff96ab8d5df166aae654243dce0beea2 tdf#162833: don't use an OUStringBuffer directly in a concat to assign itself It will be available in 25.2.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.
cherry-pick for 24.8: https://gerrit.libreoffice.org/c/core/+/173007 cherry-pick for 24.8.1: https://gerrit.libreoffice.org/c/core/+/173008
Well that was very fast. Thank you
Julien Nabet committed a patch related to this issue. It has been pushed to "libreoffice-24-8": https://git.libreoffice.org/core/commit/05de49bad2c8d097dc6bf18f1d16093b90fb5768 tdf#162833: don't use an OUStringBuffer directly in a concat to assign itself It will be available in 24.8.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.
Julien Nabet committed a patch related to this issue. It has been pushed to "libreoffice-24-8-1": https://git.libreoffice.org/core/commit/3a32f7ad5ada5b3ea83d7160127f09302e3cb16d tdf#162833: don't use an OUStringBuffer directly in a concat to assign itself It will be available in 24.8.1. 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.
Works for me now with: Version: 25.2.0.0.alpha0+ (X86_64) / LibreOffice Community Build ID: c8eb95e8407ef24436e0e8e218dce535df6bb2e5 CPU threads: 16; OS: Windows 11 X86_64 (10.0 build 22631); UI render: Skia/Vulkan; VCL: win Locale: de-DE (de_DE); UI: de-DE Calc: threaded
Thank you for the check Ulf! :-)