https://bugs.documentfoundation.org/show_bug.cgi?id=167933
Bug ID: 167933
Summary: Libreoffice Base SQL parser does not understand WITH
ROLLUP statement
Product: LibreOffice
Version: unspecified
Hardware: All
OS: All
Status: UNCONFIRMED
Severity: normal
Priority: medium
Component: Base
Assignee: [email protected]
Reporter: [email protected]
Description:
The following query in a single table mysql database works when send directly
to MariaDB, but not when send via the parser:
SELECT `ANK`.`company`, `ANK`.`journal`,`ANK`.`pb`, `ANK`.`db`,
`DEUTERO`.`dbdesc`, SUM( CASE WHEN `ANK`.`year` = 2024 THEN `ANK`.`dc` END ) AS
`T`, SUM( CASE WHEN `ANK`.`year` = 2024 - 1 THEN `ANK`.`dc` END ) AS `T_prev`,
SUM( CASE WHEN `ANK`.`year` = 2024 THEN `ANK`.`dc` END ) - SUM( CASE WHEN
`ANK`.`year` = 2024 - 1 THEN `ANK`.`dc` END ) AS `Diff`, ( SUM( CASE WHEN
`ANK`.`year` = 2024 THEN `ANK`.`dc` END ) / NULLIF ( SUM( CASE WHEN
`ANK`.`year` = 2024 - 1 THEN `ANK`.`dc` END ), 0 ) - 1 ) AS `Percent` FROM
`ANK` LEFT JOIN `DEUTERO` ON `ANK`.`db` = `DEUTERO`.`db` WHERE `ANK`.`year` >=
2024 - 1 AND `company` = 'VD' AND `ANK`.`omada` = '6' AND `ANK`.`month` <= 12
AND `ANK`.`journal` = 'ΓΗ' GROUP BY `ANK`.`pb`, `ANK`.`db` WITH ROLLUP
The reason is the usage of WITH ROLLUP in the GROUP BY statement.
However, as I would like to use parameters, I would like to use the parser.
Steps to Reproduce:
1. Connect to a MariaDB or MySQL database
2. Write a query with a WITH ROLLUP in the GROUP BY statement.
3. Send it via the parser
Actual Results:
Syntax error
Expected Results:
The requested query
Reproducible: Always
User Profile Reset: Yes
Additional Info:
Version: 25.2.5.2 (X86_64) / LibreOffice Community
Build ID: 03d19516eb2e1dd5d4ccd751a0d6f35f35e08022
CPU threads: 12; OS: Linux 6.14; UI render: default; VCL: gtk3
Locale: el-GR (en_US.UTF-8); UI: en-US
Flatpak
Calc: threaded
--
You are receiving this mail because:
You are the assignee for the bug.