I have a bacula installation (mariadb based) I connect correctely with dbbeaver via JDBC and also with libreofficebase. I finally have to implement this query written via SQL: SELECT MediaId ,VolumeName ,Slot ,VolStatus ,Enabled ,VolBytes ,VolFiles ,VolRetention ,Recycle ,MediaType ,VolType ,VolParts ,LastWritten ,ExpiresIn FROM ( SELECT MediaId ,CAST(VolumeName AS VARCHAR(20)) AS VolumeName ,VolStatus ,Enabled ,VolByte ,VolFiles ,VolRetention ,Recycle ,CONCAT ( CASE WHEN Slot < 13 THEN 'Left ' ELSE 'Right ' END , Slot ) AS Slot ,CAST( MediaType AS VARCHAR(10)) AS MediaType ,VolType ,VolParts ,LastWritten ,GREATEST( 0 , CAST(UNIX_TIMESTAMP(LastWritten) AS INTEGER) + CAST(VolRetention AS INTEGER) - CAST(UNIX_TIMESTAMP(NOW()) AS INTEGER)) AS ExpiresIn FROM Media WHERE InChanger = 1 ORDER by ExpiresIn DESC LIMIT :ask ) AS InsiemeNastri ORDER BY Slot The problem is: If I save the query "as is" or try to run, it fail with a "SQL Syntax Error". If I substitute the ":ask" parameter with a number (e.g. 6) It works and I can run the query correctly. If I try to view it in "design mode" it fails with "SQL Error". I'm going to port the error in hsqldb so I can add the attachment to this bug
Created attachment 168872 [details] "partial" test bench with HSQLDB embedded database Here it is the document I promised... the problem is that Here I have another kind of problem as Here, when I try to run the query obtain: Accesso negato: GREATEST in statement [SELECT "MediaId", "VolumeName", "Slot", "VolStatus", "Enabled", "VolBytes", "VolFiles", "VolRetention", "Recycle", "MediaType", "VolType", "VolParts", "LastWritten", "ExpiresIn" FROM ( SELECT "MediaId", CAST( "VolumeName" AS VARCHAR ( 20 ) ) AS "VolumeName", "VolStatus", "Enabled", "VolByte", "VolFiles", "VolRetention", "Recycle", CONCAT( CASE WHEN "Slot" < 13 THEN 'Left ' ELSE 'Right ' END, "Slot" ) AS "Slot", CAST( "MediaType" AS VARCHAR ( 10 ) ) AS "MediaType", "VolType", "VolParts", "LastWritten", GREATEST( 0, CAST( UNIX_TIMESTAMP( "LastWritten" ) AS INTEGER ) + CAST( "VolRetention" AS INTEGER ) - CAST( UNIX_TIMESTAMP( NOW( ) ) AS INTEGER ) ) AS "ExpiresIn" FROM "Media2createdmanually" WHERE "InChanger" = 1 ORDER BY "ExpiresIn" DESC LIMIT 6 ) AS "InsiemeNastri" ORDER BY "Slot"] Other 2 things, here it is the table definition under MariaDB: CREATE TABLE `Media` ( `MediaId` int(10) unsigned NOT NULL AUTO_INCREMENT, `VolumeName` tinyblob NOT NULL, `Slot` int(11) DEFAULT 0, `PoolId` int(10) unsigned DEFAULT 0, `MediaType` tinyblob NOT NULL, `MediaTypeId` int(10) unsigned DEFAULT 0, `LabelType` tinyint(4) DEFAULT 0, `FirstWritten` datetime DEFAULT NULL, `LastWritten` datetime DEFAULT NULL, `LabelDate` datetime DEFAULT NULL, `VolJobs` int(10) unsigned DEFAULT 0, `VolFiles` int(10) unsigned DEFAULT 0, `VolBlocks` int(10) unsigned DEFAULT 0, `VolMounts` int(10) unsigned DEFAULT 0, `VolBytes` bigint(20) unsigned DEFAULT 0, `VolType` int(10) unsigned DEFAULT 0, `VolErrors` int(10) unsigned DEFAULT 0, `VolWrites` bigint(20) unsigned DEFAULT NULL, `VolCapacityBytes` bigint(20) unsigned DEFAULT 0, `VolStatus` enum('Full','Archive','Append','Recycle','Purged','Read-Only','Disabled','Error','Busy','Used','Cleaning') NOT NULL, `Enabled` tinyint(4) DEFAULT 1, `Recycle` tinyint(4) DEFAULT 0, `ActionOnPurge` tinyint(4) DEFAULT 0, `VolRetention` bigint(20) unsigned DEFAULT 0, `VolUseDuration` bigint(20) unsigned DEFAULT 0, `MaxVolJobs` int(10) unsigned DEFAULT 0, `MaxVolFiles` int(10) unsigned DEFAULT 0, `MaxVolBytes` bigint(20) unsigned DEFAULT 0, `InChanger` tinyint(4) DEFAULT 0, `StorageId` int(10) unsigned DEFAULT 0, `DeviceId` int(10) unsigned DEFAULT 0, `MediaAddressing` tinyint(4) DEFAULT 0, `VolReadTime` bigint(20) unsigned DEFAULT 0, `VolWriteTime` bigint(20) unsigned DEFAULT 0, `EndFile` int(10) unsigned DEFAULT 0, `EndBlock` int(10) unsigned DEFAULT 0, `LocationId` int(10) unsigned DEFAULT 0, `RecycleCount` int(10) unsigned DEFAULT 0, `InitialWrite` datetime DEFAULT NULL, `ScratchPoolId` int(10) unsigned DEFAULT 0, `RecyclePoolId` int(10) unsigned DEFAULT 0, `Comment` blob DEFAULT NULL, `VolABytes` bigint(20) unsigned DEFAULT 0, `VolAPadding` bigint(20) unsigned DEFAULT 0, `VolHoleBytes` bigint(20) unsigned DEFAULT 0, `VolHoles` int(10) unsigned DEFAULT 0, `VolParts` int(11) DEFAULT 0, `VolCloudParts` int(11) DEFAULT 0, `LastPartBytes` bigint(20) DEFAULT 0, `CacheRetention` bigint(20) DEFAULT 0, PRIMARY KEY (`MediaId`), UNIQUE KEY `inx8` (`VolumeName`(128)), KEY `PoolId` (`PoolId`) ) ENGINE=MyISAM AUTO_INCREMENT=121 DEFAULT CHARSET=latin1 And Here it is my translation: CREATE TABLE "Media" ( "MediaId" int GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY, "VolumeName" varbinary NOT NULL, "Slot" int DEFAULT 0, "PoolId" int DEFAULT 0, "MediaType" varbinary NOT NULL, "MediaTypeId" int DEFAULT 0, "LabelType" int DEFAULT 0, "FirstWritten" datetime DEFAULT NULL, "LastWritten" datetime DEFAULT NULL, "LabelDate" datetime DEFAULT NULL, "VolJobs" int DEFAULT 0, "VolFiles" int DEFAULT 0, "VolBlocks" int DEFAULT 0, "VolMounts" int DEFAULT 0, "VolBytes" bigint DEFAULT 0, "VolType" int DEFAULT 0, "VolErrors" int DEFAULT 0, "VolWrites" bigint DEFAULT NULL, "VolCapacityBytes" bigint DEFAULT 0, "VolStatus" varchar(50) NOT NULL, "Enabled" tinyint DEFAULT 1, "Recycle" tinyint DEFAULT 0, "ActionOnPurge" tinyint DEFAULT 0, "VolRetention" bigint DEFAULT 0, "VolUseDuration" bigint DEFAULT 0, "MaxVolJobs" int DEFAULT 0, "MaxVolFiles" int DEFAULT 0, "MaxVolBytes" bigint DEFAULT 0, "InChanger" tinyint DEFAULT 0, "StorageId" int DEFAULT 0, "DeviceId" int DEFAULT 0, "MediaAddressing" tinyint DEFAULT 0, "VolReadTime" bigint DEFAULT 0, "VolWriteTime" bigint DEFAULT 0, "EndFile" int DEFAULT 0, "EndBlock" int DEFAULT 0, "LocationId" int DEFAULT 0, "RecycleCount" int DEFAULT 0, "InitialWrite" datetime DEFAULT NULL, "ScratchPoolId" int DEFAULT 0, "RecyclePoolId" int DEFAULT 0, "Comment" varbinary DEFAULT NULL, "VolABytes" bigint DEFAULT 0, "VolAPadding" bigint DEFAULT 0, "VolHoleBytes" bigint DEFAULT 0, "VolHoles" int DEFAULT 0, "VolParts" int DEFAULT 0, "VolCloudParts" int DEFAULT 0, "LastPartBytes" bigint DEFAULT 0, "CacheRetention" bigint DEFAULT 0, Constraint CK_VolStatus CHECK ( "VolStatus" in ('Full','Archive','Append','Recycle','Purged','Read-Only','Disabled','Error','Busy','Used','Cleaning')) );
Have tried it with the attached database. You could get the buggy behavior with this query: SELECT * FROM "Media2createdmanually" LIMIT :ask Seems parameter in Base couldn't be used with LIMIT. LIMIT is introduced in Base GUI with version LO 4.1. Could be the reason the parameter input hasn't been implemented for this function. It will give an error in /home/buildslave/source/libo-core/dbaccess/source/core/api/SingleSelectQueryComposer.cxx:109 Tested with LO 7.1.5.1 on OpenSUSE 15.2 64bit rpm Linux.
Dear Diego, To make sure we're focusing on the bugs that affect our users today, LibreOffice QA is asking bug reporters and confirmers to retest open, confirmed bugs which have not been touched for over a year. There have been thousands of bug fixes and commits since anyone checked on this bug report. During that time, it's possible that the bug has been fixed, or the details of the problem have changed. We'd really appreciate your help in getting confirmation that the bug is still present. If you have time, please do the following: Test to see if the bug is still present with the latest version of LibreOffice from https://www.libreoffice.org/download/ If the bug is present, please leave a comment that includes the information from Help - About LibreOffice. If the bug is NOT present, please set the bug's Status field to RESOLVED-WORKSFORME and leave a comment that includes the information from Help - About LibreOffice. Please DO NOT Update the version field Reply via email (please reply directly on the bug tracker) Set the bug's Status field to RESOLVED - FIXED (this status has a particular meaning that is not appropriate in this case) If you want to do more to help you can test to see if your issue is a REGRESSION. To do so: 1. Download and install oldest version of LibreOffice (usually 3.3 unless your bug pertains to a feature added after 3.3) from https://downloadarchive.documentfoundation.org/libreoffice/old/ 2. Test your bug 3. Leave a comment with your results. 4a. If the bug was present with 3.3 - set version to 'inherited from OOo'; 4b. If the bug was not present in 3.3 - add 'regression' to keyword Feel free to come ask questions or to say hello in our QA chat: https://web.libera.chat/?settings=#libreoffice-qa Thank you for helping us make LibreOffice even better for everyone! Warm Regards, QA Team MassPing-UntouchedBug
Bug still exists in LO 7.6.0.1 on OpenSUS 15.4 64bit rpm Linux