[upstream] view cannot be a UNION SELECT in trusty base

Bug #1480978 reported by Rolf Leggewie
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
LibreOffice
Invalid
Medium
libreoffice (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

This is either an upstream bug already fixed in the version in wily or a regression introduced in Ubuntu. I run trusty.

https://bugs.documentfoundation.org/show_bug.cgi?id=92987

SELECT "company_name",
 DATEDIFF( 'DD', '1899-12-30', TO_CHAR( CURDATE( ), 'YYYY-MM-' ) + "integer" ) AS "Zahltag"
 FROM "company", "integer"
UNION SELECT ALL "company_name",
 DATEDIFF( 'DD', '1899-12-30', TO_CHAR( CURDATE( ), 'YYYY-MM-' ) + "payday2" ) AS "Zahltag"
 FROM "company"

The above works fine as a query in trusty base but only the first select will be accepted as a view. The UNION SELECT will trigger the error "The given command is not a select statement. Only queries are allowed."

Verifications whether this affects later versions than trusty appreciated.

Tags: trusty
Revision history for this message
In , Libreoffice-4 (libreoffice-4) wrote :

SELECT "company_name",
 DATEDIFF( 'DD', '1899-12-30', TO_CHAR( CURDATE( ), 'YYYY-MM-' ) + "integer" ) AS "Zahltag"
 FROM "company", "integer"
UNION SELECT ALL "company_name",
 DATEDIFF( 'DD', '1899-12-30', TO_CHAR( CURDATE( ), 'YYYY-MM-' ) + "payday2" ) AS "Zahltag"
 FROM "company"

The above works fine as a query but only the first select will be accepted as a view. The UNION SELECT will trigger the error "The given command is not a select statement. Only queries are allowed."

Revision history for this message
In , Iplaw67-h (iplaw67-h) wrote :

@Rolf : which db backend are you using ?

Revision history for this message
In , Libreoffice-4 (libreoffice-4) wrote :

HSQLDB embedded

Revision history for this message
In , Nv4y-robert (nv4y-robert) wrote :

Have tested this also.
Build two tables for the content I guessed by the given example.
Copied the query in a Base-query.
Could only execute the query in direct SQL-Mode, not in GUI-Mode. Think this is what you mean with "query works fine ...".
Now I took the query and created a view from this query.
View works the same way the query works.

So I could not confirm the described bug.

My System: OpenSUSE 13.2, 64bit rpm Linux, different LO-versions

Revision history for this message
In , Iplaw67-h (iplaw67-h) wrote :

@Rolf : as with other bugs you have reported, you are using 4.2.8 provided by Ubuntu. TDF builds of the 4.2.8 line are EOL since Jan 2015.

Please update your version of LO to a current TDF production release, test again and report back here, or else close this bug and file a report against the Ubuntu provided version

Revision history for this message
In , Libreoffice-4 (libreoffice-4) wrote :

I can actually save the view when I choose to run SQL directly even in 4.2.8.2. But open opening the view in 4.2.8.2 produces an error of "The content could not be loaded - Wrong datatype: java.lang.illegalArgumentException: Timestamp format must be yyyy-mm-dd hh:mm:ss[.fffffffff] in statement [SELECT * FROM "VIEW1"]

The UNION SELECT opens fine even as a view in 4.4.5, so this problem is indeed fixed in the latest release. Thanks.

Revision history for this message
Marcus Tomlinson (marcustomlinson) wrote :

This release of Ubuntu is no longer receiving maintenance updates. If this is still an issue on a maintained version of Ubuntu please let us know.

Changed in libreoffice (Ubuntu):
status: New → Incomplete
Rolf Leggewie (r0lf)
Changed in libreoffice (Ubuntu):
status: Incomplete → New
Revision history for this message
Marcus Tomlinson (marcustomlinson) wrote :

You have acknowledged this to be fixed in the upstream report.

Changed in libreoffice (Ubuntu):
status: New → Fix Released
summary: - view cannot be a UNION SELECT in trusty base
+ [upstream] view cannot be a UNION SELECT in trusty base
Rolf Leggewie (r0lf)
description: updated
Changed in df-libreoffice:
importance: Unknown → Medium
status: Unknown → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.