[
https://issues.apache.org/jira/browse/DERBY-991?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12805941#action_12805941
]
Rob Light commented on DERBY-991:
---------------------------------
Another use case where this breaks:
ij> create table t ( i int, b int, primary key (i), unique (i));
ERROR 42Z93: Constraints 'SQL100128100104821' and 'SQL100128100104820' have the
same set of columns, which is not allowed.
This is using the 10.3.0 release. Will this be fixed in the next release?
FWIW, this DDL was generated by Hibernate and works under MySQL.
Thanks.
> Defining the same primary key twice on a table actually attempts to create
> two constraints.
> --------------------------------------------------------------------------------------------
>
> Key: DERBY-991
> URL: https://issues.apache.org/jira/browse/DERBY-991
> Project: Derby
> Issue Type: Bug
> Components: SQL
> Affects Versions: 10.2.1.6
> Reporter: Daniel John Debrunner
> Priority: Minor
> Attachments: w.sql
>
>
> Defining the same primary key twice on a table actually attempts to create
> two constraints.
> ij> create table t ( i int, b int, primary key (i,b), primary key (i,b));
> ERROR 42Z93: Constraints 'SQL060215062628851' and 'SQL060215062628850' have
> the
> same set of columns, which is not allowed.
> ij> create table t ( i int primary key primary key primary key);
> ERROR 42Z93: Constraints 'SQL060214082337951' and 'SQL060214082337950' have
> the
> same set of columns, which is not allowed.
> Other combinations of two primary keys (that I could think of) return the
> correct error.
> ij> create table t ( i int, b int, primary key (i,b), primary key (b));
> ERROR 42X90: More than one primary key constraint specified for table 'T'.
> ij> create table t ( i int primary key, b int primary key);
> ERROR 42X90: More than one primary key constraint specified for table 'T'.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.