Bug 162893 - Group by missing when using Query Editor with example DB
Summary: Group by missing when using Query Editor with example DB
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
24.2.6.2 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Database-Queries
  Show dependency treegraph
 
Reported: 2024-09-09 21:30 UTC by Ulf
Modified: 2024-12-21 12:08 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Example Firebird (3.90 KB, application/vnd.sun.xml.base)
2024-09-09 21:30 UTC, Ulf
Details
Example HSQL (4.28 KB, application/vnd.sun.xml.base)
2024-09-09 21:31 UTC, Ulf
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ulf 2024-09-09 21:30:04 UTC
Created attachment 196348 [details]
Example Firebird

This SQL-Code works well in HSQL with the QueryComposer

SELECT SUM( "dtPayBetrag" ) AS "Betrag", YEAR( "dtPayDatum" ) AS "Jahr" FROM "tblmPay" GROUP BY YEAR( "dtPayDatum" )

The most similar SQL-Code gives Errors with FIREBIRD and the QueryComposer

SELECT SUM( "dtPayBetrag" ) AS "Betrag", EXTRACT( YEAR FROM "dtPayDatum" ) AS "Jahr" FROM "tblmPay" GROUP BY EXTRACT( YEAR FROM "dtPayDatum" )

Both querys are working with enabled run SQL directly

Firebird:
1 Open Query to edit and run query
Result: query executed
3 Uncheck „run in SQL directly“
4 switch to QueryComposer
Result Editor seems to work with the code (See [] insted of ““)

Run query (F5)

Error: “Syntaxfehler im SQL-Ausdruck”

Open Aggregation 2 Column “Jahr”
1) There is no aggregate function Group by to select

Tested 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
Comment 1 Ulf 2024-09-09 21:31:15 UTC
Created attachment 196349 [details]
Example HSQL
Comment 2 Robert Großkopf 2024-09-10 09:42:21 UTC
Tested this:
Could execute queries in direct SQL.
Couldn't execute query

SELECT SUM( "dtPayBetrag" ) AS "Betrag", EXTRACT( YEAR FROM "dtPayDatum" ) FROM "tblmPay" GROUP BY EXTRACT( YEAR FROM "dtPayDatum" )

if it isn't set to direct SQL, but could execute

SELECT SUM( "dtPayBetrag" ) AS "Betrag", EXTRACT( YEAR FROM "dtPayDatum" ) AS "Jahr" FROM "tblmPay" GROUP BY "Jahr"

Changed the second query to GUI-mode and get the error "Syntax error …".
In GUI will be shown 
EXTRACT( YEAR FROM [dtPayDatum] )

When switching from brackets to " 
EXTRACT( YEAR FROM "dtPayDatum" )
GUI doesn't offer 'Group by' any more.

Could confirm the buggy behavior for 
Version: 25.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 0427231a1485d324519e94246ff702bc0cb18b89
CPU threads: 6; OS: Linux 6.4; UI render: default; VCL: kf5 (cairo+xcb)
Locale: de-DE (de_DE.UTF-8); UI: de-DE
Calc: threaded
and also with older versions like LO 24.2.5.2