Bug 71009 - EDITING: Embedded Firebird - Creating relationship in GUI impossible, but Firebird supports relations
Summary: EDITING: Embedded Firebird - Creating relationship in GUI impossible, but Fir...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
4.2.0.0.alpha0+ Master
Hardware: x86-64 (AMD64) Linux (All)
: medium major
Assignee: Tamas Bunth
URL:
Whiteboard: target:5.3.0 target:5.2.1
Keywords:
Depends on:
Blocks: Database-Firebird-Default
  Show dependency treegraph
 
Reported: 2013-10-29 17:07 UTC by Robert Großkopf
Modified: 2016-10-25 18:40 UTC (History)
8 users (show)

See Also:
Crash report or crash signature:


Attachments
Open the database. Try Tools → Relationships. GUI doesn't support relationship. (43.69 KB, application/vnd.oasis.opendocument.base)
2013-10-29 17:07 UTC, Robert Großkopf
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Großkopf 2013-10-29 17:07:21 UTC
Created attachment 88308 [details]
Open the database. Try Tools → Relationships. GUI doesn't support relationship.

Open the attached database.
Try Tools → Relationships.
A dialog appears: "The database does not support relations."

I have created relations in the attached database by Tools → SQL with:
ALTER TABLE "Name" ADD FOREIGN KEY ("Town_ID") REFERENCES "Town";

Open the Table "Name" and try to set "Town_ID" to '3' in one of the rows - the database will show a violated foreignkey in a dialog.

Firebird does support relationships, but the GUI doesn't support them for Firebird.
Comment 1 Julien Nabet 2013-10-29 23:22:25 UTC
Comment on attachment 88308 [details]
Open the database. Try Tools → Relationships. GUI doesn't support relationship.

Mimetype fixed
Comment 2 Julien Nabet 2013-10-29 23:35:11 UTC
Lionel/Andrzej:
I suppose this patch isn't sufficient
diff --git a/connectivity/source/drivers/firebird/DatabaseMetaData.cxx b/connectivity/source/drivers/firebird/DatabaseMetaData.cxx
index fbc82ba..0791946 100644
--- a/connectivity/source/drivers/firebird/DatabaseMetaData.cxx
+++ b/connectivity/source/drivers/firebird/DatabaseMetaData.cxx
@@ -480,7 +480,7 @@ sal_Bool SAL_CALL ODatabaseMetaData::supportsANSI92EntryLevelSQL(  ) throw(SQLEx
 // -------------------------------------------------------------------------
 sal_Bool SAL_CALL ODatabaseMetaData::supportsIntegrityEnhancementFacility(  ) throw(SQLException, RuntimeException)
 {
-    return sal_False;
+    return sal_True;
 }
 // -------------------------------------------------------------------------

since, even if I can get the GUI relationships, I got these logs then:
warn:legacy.osl:21201:1:connectivity/source/drivers/firebird/DatabaseMetaData.cxx:845: Not implemented yet! (ODatabaseMetaData::getTableTypes)

warn:connectivity.firebird:21201:13:connectivity/source/drivers/firebird/DatabaseMetaData.cxx:1473: Not yet implemented
warn:legacy.osl:21201:13:connectivity/source/drivers/firebird/DatabaseMetaData.cxx:1477: Not implemented yet!
(ODatabaseMetaData::getImportedKeys)

(See http://opengrok.libreoffice.org/xref/core/connectivity/source/drivers/firebird/DatabaseMetaData.cxx#843)
Comment 3 ribotb 2013-12-02 12:19:27 UTC
I confirm in 4.2.0 beta 1

Bernard Ribot
Comment 4 ribotb 2014-04-25 07:37:07 UTC
Adding as blocker for making Firebird the default
Comment 5 Alex Thurgood 2015-01-03 17:40:02 UTC Comment hidden (no-value)
Comment 6 QA Administrators 2016-01-17 20:02:04 UTC Comment hidden (obsolete)
Comment 7 ribotb 2016-01-18 17:30:35 UTC
Hi,

(In reply to robert from comment #0)
> Created attachment 88308 [details]
> Open the database. Try Tools → Relationships. GUI doesn't support
> relationship.
> 
> Open the attached database.
> Try Tools → Relationships.
> A dialog appears: "The database does not support relations."
> 

Bug still present 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 8 Commit Notification 2016-07-15 11:19:15 UTC
Wastack committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=ba3f703f01089361ac3ff3d2f231b17097c1d173

tdf#71009 GSoC firebird metadata functions

It will be available in 5.3.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 9 ribotb 2016-07-16 19:03:59 UTC
Hi,

It seems that it works correctly. With the database in attachment with the description,   I created the relationship by ALTER TABLE "Name" ADD FOREIGN KEY ("Town_ID") REFERENCES "Town". But I can't open the tables : they don't appear in the main window (Tables)!

However the relationship seems exist because, in Tools > Relationship, when I try to create the relationship a message says that relationship already exists.

Bernard

Tested with :

Version: 5.3.0.0.alpha0+
Build ID: ab1b351840160655a9f0caedbb35e9fdf203c5a0
CPU Threads: 2; OS Version: Windows 6.1; UI Render: default; 
TinderBox: Win-x86@42, Branch:master, Time: 2016-07-15_23:53:13
Locale: fr-FR (fr_FR); Calc: group
Comment 10 Robert Großkopf 2016-07-17 08:55:34 UTC
Opened the attachement with
Version: 5.3.0.0.alpha0+
Build ID: a2c557d80ac68c06ea59586245a7431e061938f0
CPU Threads: 4; OS Version: Linux 4.1; UI Render: default; 
TinderBox: Linux-rpm_deb-x86_64@70-TDF, Branch:master, Time: 2016-07-15_23:35:01
Locale: de-DE (de_DE.UTF-8); Calc: group

The GUI allows to open the window for creating relationships, but doesn't show the existing relationship.

Editing the existing relationship seem to be impossible. The GUI will only draw a relation between the two tables after choosing the right connection between the fields. The connection between the fields won't be shown.

So the first part of this bug is done:
- Opening tools > relationships and adding tables is possible
But this doesn't work:
- Existing relations won't be shown
- New relations between fields of the tables couldn't be created

Should I report this as a new bug?

Another bug hides all tables, queries, forms and reports. Will report this as a new bug.
Comment 11 Commit Notification 2016-07-18 15:17:33 UTC
Wastack committed a patch related to this issue.
It has been pushed to "libreoffice-5-2":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=08a7c0af982fec3dfe869d07b549b1f7419d450f&h=libreoffice-5-2

tdf#71009 GSoC firebird metadata functions

It will be available in 5.2.1.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 12 Robert Großkopf 2016-07-21 08:34:45 UTC
Tested with 
Version: 5.3.0.0.alpha0+
Build ID: 0ccb3ccc4c7bafeb2fbbd689c90f710bc65d37e0
CPU Threads: 4; OS Version: Linux 4.1; UI Render: default; 
TinderBox: Linux-rpm_deb-x86_64@70-TDF, Branch:master, Time: 2016-07-20_23:34:15
Locale: de-DE (de_DE.UTF-8); Calc: group

Created a new database with two tables.
One table should have a foreignkey from the other table.
Opened Tools > Relationships.
Choosed the tables.
Draw from the foreignkey to the primarykey of the other table.
Couldn't see any connection.
Saved the action.
Opened again Tools > Relationships.
Connection is shown from the tablename of the first table to the tablename of the other table. Connection couldn't be edited any more (error message from Firebird).
Closed Tools > Relationships.
Opened the first table and tried to write a value for foreignkey, which doesn't exist.
And *now*: Relation has been created. Wrong foreignkey hasn't been excepted.

So the creating of a relation in GUI works, but isn't shown (shown wrong afterwords) and couldn't be edited any more by the GUI.

Should I open a new bug for this?
Comment 13 Robert Großkopf 2016-07-31 09:14:37 UTC
Opening of Tools > Relationships works now for internal Firebird database. So I will set this bug to RESOLVED and FIXED.

For creating and editing the relations in the relationship-dialog I filed a new bug.