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

            Bug ID: 103715
           Summary: TABLE CREATION blues, including AutoValue option and
                    Primary Key issues
           Product: LibreOffice
           Version: 5.2.2.2 release
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Severity: normal
          Priority: medium
         Component: Base
          Assignee: libreoffice-bugs@lists.freedesktop.org
          Reporter: bridgeportcontrac...@gmail.com

Since these are related, I am submitting them together:



ISSUE #1 - with both HSQLDB and MySQL (via MaraiDB 10.1) JDBC connector:

Create Table in Design View

Field-1 Name: ID
Field-1 Type: Integer [INTEGER]

Field-2 Name: txt
Field-2 Type: Text [VARCHAR]

Close dialog.

Do you want to save the changes?  Yes.  Table name:  foo
No Primary key ... Should a primary key be created now?  NO

Open the table.

Failed result:  I can not add any records to this table.

Suggestion: While many tables need a primary key for a variety of reasons, a
table should be operable without a primary key.  Surely in MySQL you can have a
table and not need a primary key.



ISSUE #2 - with HSQLDB:

Create Table in Design View

Field-1 Name: txt
Field-1 Type: Text [VARCHAR]

Close dialog.

Do you want to save the changes?  Yes.  Table name:  foo
No Primary key ... Should a primary key be created now?  YES

Result: Although a primary key is added to the table, it is not very usable by
most application because ID does not AutoValue itself.  You must manually enter
key values when you add records.

Suggestion: I think it would make sense to turn on the AutoValue when this
Primary Key is added.  That is what you will need most of the time. 
Fortunately with HSQLDB you can at this point manually set AutoValue to Yes to
fix this, but not with MySQL connector, see ISSUE #3 below.



ISSUE #3 - with MySQL via JDBC:

Create Table in Design View

Field-1 Name: txt
Field-1 Type: Text [VARCHAR]

Close dialog.

Do you want to save the changes?  Yes.  Table name:  foo
No Primary key ... Should a primary key be created now?  YES

Comment: Note, that AutoValue is still set to NO.

Edit the table foo.
Select the ID field.
Set AutoValue to Yes.
Close and save.

Edit the table foo.
Select the ID field.

Result: AutoValue is still set to NO.  It should have been set to Yes!


Workarounds: There are two ways you can get AutoValue set to Yes with JDBC
MySQL connector.

1) In LOB first delete the table and start over, making sure that you set
AutoValue to YES when you first save the table.

2) Close LOB and use PHPMyAdmin to set A_I (Auto Incrument) on.  Then reopen
LOB, and hit View | Refresh Tables.

IMHO, neither of these solutions are a very good way to deal with this bug.


Further failures: You can not fix the problem (without malfunction) trying as
follows:

* Delete the ID field, save the table, re-edit, add new ID2 with AutoValue ON.
* Add a 2nd ID2 field, set it to the Primary Key and save the table.
* etc.


I would expect that this would work much better, given how fundamental it is to
using SQL.


Thanks guys!  I'm very excited about Base and am glad to do my part to find the
rough edges.

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

Reply via email to