Bug 76072 - Not allowed to create view with embedded Firebird ?
Summary: Not allowed to create view with embedded Firebird ?
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
4.2.0.1 rc
Hardware: All Windows (All)
: medium normal
Assignee: Tamas Bunth
URL:
Whiteboard:
Keywords:
Depends on: 103373
Blocks: Database-Firebird-Default
  Show dependency treegraph
 
Reported: 2014-03-12 11:49 UTC by ribotb
Modified: 2018-04-17 14:15 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments
Try to create a view from one of the queries. Try to create directly. Won#t work. (3.50 KB, application/vnd.oasis.opendocument.database)
2016-10-08 17:51 UTC, Robert Großkopf
Details

Note You need to log in before you can comment on or make changes to this bug.
Description ribotb 2014-03-12 11:49:28 UTC
Hi,

In the main window of a database, in tab "Tables" the function "Create view" does not exist. And in Insert menu, "View design" is  grayed.

Best regards,
Bernard
Comment 1 Alex Thurgood 2014-03-14 15:33:12 UTC
Confirming also on Linux 64bit master 4.3

This is probably a not yet implemented feature.

Adding Andrzej, Lionel to CC
Comment 2 ribotb 2014-04-25 07:40:33 UTC
Adding as blocker for making Firebird the default
Comment 3 Alex Thurgood 2015-01-03 17:40:38 UTC Comment hidden (no-value)
Comment 4 QA Administrators 2016-01-17 20:03:29 UTC Comment hidden (obsolete)
Comment 5 ribotb 2016-01-18 18:03:50 UTC
(In reply to ribotb from comment #0)
> Hi,
> 
> In the main window of a database, in tab "Tables" the function "Create view"
> does not exist. And in Insert menu, "View design" is  grayed.
> 

Function "Create view" does not exist with :
Version: 5.1.0.2
Build ID: ecd3574d51754b043f865cf5bafee286d24db7cc
CPU Threads: 2; OS Version: Windows 6.1; UI Render: default; 
Locale : fr-FR (fr_FR)
on Win7/x86

Bernard
Comment 6 Lionel Elie Mamane 2016-09-08 11:46:21 UTC
This might be because the firebird driver does not provide the XAlterView and/or XViewsSupplier interfaces
Comment 7 Tamas Bunth 2016-10-08 11:08:14 UTC
Works for me, both "create view" and "insert" -> "View Design".

Version: 5.3.0.0.alpha0+
Build ID: 6bdcb730faa5b996882b4648b86b7caf93b8f421
CPU Threads: 4; OS Version: Linux 4.4;

Note that you have to select "Tables" tab at least once before using "View Design". I don't know if it's intentional.
Comment 8 ribotb 2016-10-08 17:21:17 UTC
OK for me with :

Version: 5.3.0.0.alpha0+
Build ID: d4936e876b1b965505ee2e82efaa35eef65d2135
CPU Threads: 2; OS Version: Windows 6.1; UI Render: default; 
TinderBox: Win-x86@42, Branch:master, Time: 2016-10-08_07:31:22
Locale: fr-FR (fr_FR); Calc: group

And it's also OK with LO 5.2.2.2 (!) I don't know for LO 5.2.1

(In reply to Tamas Bunth from comment #7)
> Note that you have to select "Tables" tab at least once before using "View
> Design". I don't know if it's intentional.

It's the same thing witn no Firebird database and it's the same thing with previous release (5.2). For me, it's intentional.

Bernard
Comment 9 Robert Großkopf 2016-10-08 17:46:51 UTC
I tried to take a query and get a view by the contextmenue. This is the errormessage I got:

firebird_sdbc error:
*unsuccessful metadata update
*CREATE VIEW Dateadd failed
*There is no privilege for this operation
caused by
'CREATE VIEW "Dateadd" AS SELECT DATEADD(-6 DAY TO "Datum") AS "6TageVorher", "Datum", DATEADD(MONTH, 9, "Datum") FROM "Table1"'

I get the same errormessage when I try to create a view trough Tables > Create view.

You are not allowed to create a view. Only the menue isn't greyed out any more. So the bug still exists.

Tested with 
Version: 5.3.0.0.alpha0+
Build-ID: 06f91e5c6d4528de00a188f0f8ba4b5678b94ad3
CPU-Threads: 4; BS-Version: Linux 4.1; UI-Render: Standard; 
TinderBox: Linux-rpm_deb-x86_64@70-TDF, Branch:master, Time: 2016-10-08_00:41:09
Gebietsschema: de-DE (de_DE.UTF-8); Calc: group
Comment 10 Robert Großkopf 2016-10-08 17:51:14 UTC
Created attachment 127880 [details]
Try to create a view from one of the queries. Try to create directly. Won#t work.

Attached database would only work with LO 5.3, not 5.2, because the internal Firebird-database has been changed to Firebird 3. Try to create a view - the errormessages says, you won't have privilegies for this.
Comment 11 ribotb 2016-10-08 18:00:26 UTC
(In reply to ribotb from comment #8)

> And it's also OK with LO 5.2.2.2 (!) I don't know for LO 5.2.1
It does not work with LO 5.2.0.2
Comment 12 Robert Großkopf 2016-10-08 18:35:42 UTC
(In reply to ribotb from comment #8)
Hi Bernhard,
> 
> And it's also OK with LO 5.2.2.2 (!) I don't know for LO 5.2.1
> 
> Bernard

You are right. It works with LO 5.2.2.2. But when I tried with LO 5.3.0.0 it doesn't. 
Tamas has just assigned himself for this bug. Hope it could be fixed for the new LO 5.3.
Comment 13 Robert Großkopf 2016-10-08 18:46:33 UTC
Hi,
seems to be a bigger problem with new internal Firebird. You aren't allowed to create a table, too.
Comment 14 Tamas Bunth 2016-10-08 19:18:53 UTC
(In reply to robert from comment #13)
> Hi,
> seems to be a bigger problem with new internal Firebird. You aren't allowed
> to create a table, too.

It seems, without a username specified, it uses OS username, that causes privilege error, when the database is opened from another OS.
That comes with fb 3.0

I'm about to solve that with a default username specified, possibly "sysdba", or something like that.

see: http://stackoverflow.com/questions/38395381/no-privilege-for-this-operation
Comment 15 ribotb 2016-10-08 21:13:51 UTC
(In reply to robert from comment #10)
> Created attachment 127880 [details]
> Try to create a view from one of the queries. Try to create directly. Won#t
> work.
> 
> Attached database would only work with LO 5.3, not 5.2, because the internal
> Firebird-database has been changed to Firebird 3. Try to create a view - the
> errormessages says, you won't have privilegies for this.

With this database and LO 5.2 I can't open tab 'Tables' and queries do not works.
Ok with LO 5.3 master. 

Windows 7/x86
Comment 16 Robert Großkopf 2016-10-21 06:35:31 UTC
Have tested a little bit more, because I could create a new Firebird 3.0 - database with LO in the past. So I detected, what I wrote down in bug 103373: It is possible to create a view with the new internal Firebird 3.0 - database. But this is only possible the first time you use this database. After you close it and reopen it you are not allowed to create a view or a table any more.

So this bug has been gone, but a new bug appeared. Should we set this to Resolved ad Worksforme?
Comment 17 Robert Großkopf 2016-11-06 18:58:20 UTC
Have tested again, because it is now possible to change tables after reopening Firebird 3.0.

I am able to create views trough Tables > Create View
I have to set View > Refresh Tables to see the view afterwords.

I am also able to create views from a query by the contextmenue, but at last a warning appears:
"No table format could be found."
When setting View > Refresh Tables the view has been created also.

I am also able to create views from a query with alias for fields. The alias will be shown in the view.

All this tested with
Version: 5.3.0.0.alpha1+
Build ID: 5d39c2013374727b1c8f147b8b99d54402a7ff02
CPU Threads: 4; OS Version: Linux 4.1; UI Render: default; VCL: gtk2; Layout Engine: old; 
TinderBox: Linux-rpm_deb-x86_64@70-TDF, Branch:master, Time: 2016-11-02_00:55:24
Locale: de-DE (de_DE.UTF-8); Calc: group

I will set this bug to Resolved and Worksforme.