Issue 48442 - Error in auto generated column for primary key feature
Summary: Error in auto generated column for primary key feature
Status: CONFIRMED
Alias: None
Product: Base
Classification: Application
Component: code (show other issues)
Version: OOO 2.0 Beta2
Hardware: All Windows XP
: P3 Trivial with 1 vote (vote)
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-04-29 13:31 UTC by vyho
Modified: 2013-08-07 15:45 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
screenshot of temp'ry tabledef corruption and err msg (57.82 KB, image/gif)
2005-09-08 22:48 UTC, drc
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description vyho 2005-04-29 13:31:09 UTC
The Base application.

If you create a new table with a column that has a "number" type and
auto-increment, but not specify it as primary it. It will be primary key when
save the table.  Is this a desired behavior?  When you create a table with
auto-increment column and not specify any col as primary key, it will ask you if
you want to auto generate a primary key column.  If you answer yes, you'll see
an error:

Attempt to define a second primary key in statement [CREATE TABLE "Table2" ("ID"
INTEGER NOT NULL,"a" VARCHAR(50),"b" VARCHAR(50),"c" INTEGER IDENTITY, PRIMARY
KEY  ("ID")]

As you can see, a, b,c are the manually created columns with "c" being the
auto-increment.  "ID" is the autogenerated column.

So, shouldn't it detect that "c" already a primary key, and not asking for the
auto-creation of "ID"?
Comment 1 christoph.lukasiak 2005-05-02 14:29:33 UTC
clu->oj: i can repro that (seems wrong to me)
Comment 2 ocke.janssen 2005-05-03 06:47:19 UTC
As far as I can see the problem is that the column c is not marked as a primary
key. And for that reason column ID is appended. The other problem is that HQLDB
doesn't seem to allow an identity column which is not the primary key. I'll ask
the HSQLDB team.
Comment 3 ocke.janssen 2005-05-03 11:34:14 UTC
I just get the answer that they are working on it. I set this bug to the owner
issues@dba. So we don't lost it.
Comment 4 Frank Schönheit 2005-07-25 13:28:00 UTC
UNCONFIRMED and "confirmed to be an external problem" contradict each other
Comment 5 drc 2005-09-08 22:37:45 UTC
OOo.1.9.125 (Beta2) on W98SE
Create new database (unregistered) called test in My documents.
Open and create new table in design view.
Create name (text) address (text) and customerID as an autogenerated integer.
Close, Save (table name customers) and get the 'No primary key' message.
Accept the 'create primary key' offer.
Error while connecting to the data source message.
The table is corrupt - Field names have been shifted down, but field types have not.
Row 1 has been overwritten.
OK
Error message disappears.  Second field type corrects itself to text - sometimes
after clicking elsewhere.
customerID field type is missing but appears later after some clicking about.
The table can be saved if the customerID field is deleted from the table definition.
Comment 6 drc 2005-09-08 22:46:06 UTC
OOo.1.9.125 (Beta2) on W98SE
Create new database (unregistered) called test in My documents.
Open and create new table in design view.
Create name (text) address (text) and customerID as an autogenerated integer.
Close, Save (table name customers) and get the 'No primary key' message.
Accept the 'create primary key' offer.
Error while connecting to the data source message.
The table is corrupt - Field names have been shifted down, but field types have not.
Row 1 has been overwritten.
OK
Error message disappears.  Second field type corrects itself to text - sometimes
after clicking elsewhere.
customerID field type is missing but appears later after some clicking about.
The table can be saved if the customerID field is deleted from the table definition.
Comment 7 drc 2005-09-08 22:48:29 UTC
Created attachment 29408 [details]
screenshot of temp'ry tabledef corruption and err msg
Comment 8 marc.neumann 2006-01-24 11:18:33 UTC
set target to "not determined" because it's an external issue with the hsql
database engine.