You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafodion.apache.org by "Suresh Subbiah (JIRA)" <ji...@apache.org> on 2015/10/08 01:14:28 UTC

[jira] [Assigned] (TRAFODION-1277) LP Bug: 1465854 - Duplicate unique constraints no longer return error 1254

     [ https://issues.apache.org/jira/browse/TRAFODION-1277?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Suresh Subbiah reassigned TRAFODION-1277:
-----------------------------------------

    Assignee: Suresh Subbiah

> LP Bug: 1465854 - Duplicate unique constraints no longer return error 1254
> --------------------------------------------------------------------------
>
>                 Key: TRAFODION-1277
>                 URL: https://issues.apache.org/jira/browse/TRAFODION-1277
>             Project: Apache Trafodion
>          Issue Type: Bug
>          Components: sql-exe
>            Reporter: Weishiun Tsai
>            Assignee: Suresh Subbiah
>            Priority: Critical
>             Fix For: 2.0-incubating
>
>
> Trafodion used to check and make sure that there are no duplicate unique constraints.  It would return error 1254 during the ddl operations if this rule is violated.   This new behavior was first seen in the v0609 build.  In the v0528 build, such a ddl operation still returned error 1254.  The behavior change was introduced somewhere between v0528 and v0609.   This bug report is filed to seek clarification on whether this is a desired new behavior or if it is a bug.
> --------------------------------------------------
> This was the behavior in the v0528 build:
> SQL>create table n6a3
> (c1 date not null not droppable,
> c2 time not null not droppable,
> c3 timestamp not null not droppable,
> unique (c2,c1),
> unique (c2,c1)) no partition;
> *** ERROR[1254] Duplicate unique constraints are not allowed with same set of columns. [2015-05-29 15:11:57]
> *** ERROR[1029] Object TRAFODION.DDL_TAB001_T001B.N6A3 could not be created. [2015-05-29 15:11:57]
> --------------------------------------------------
> This was the new behavior in the v0609 build:
> create table n6a3
> (c1 date not null not droppable,
> c2 time not null not droppable,
> c3 timestamp not null not droppable,
> unique (c2,c1),
> unique (c2,c1)) no partition;
> --- SQL operation complete.
> --------------------------------------------------
> Here is the entire script to reproduce this problem:
> create schema mytest;
> set schema mytest;
> create table n6a3
> (c1 date not null not droppable,
> c2 time not null not droppable,
> c3 timestamp not null not droppable,
> unique (c2,c1),
> unique (c2,c1)) no partition;
> showddl n6a3;
> drop schema mytest cascade;
> --------------------------------------------------
> Here is the execution output since the v0609 build:
> >>create schema mytest;
> --- SQL operation complete.
> >>set schema mytest;
> --- SQL operation complete.
> >>
> >>create table n6a3
> +>(c1 date not null not droppable,
> +>c2 time not null not droppable,
> +>c3 timestamp not null not droppable,
> +>unique (c2,c1),
> +>unique (c2,c1)) no partition;
> --- SQL operation complete.
> >>
> >>showddl n6a3;
> CREATE TABLE TRAFODION.MYTEST.N6A3
>   (
>     C1                               DATE NO DEFAULT NOT NULL NOT DROPPABLE
>   , C2                               TIME(0) NO DEFAULT NOT NULL NOT DROPPABLE
>   , C3                               TIMESTAMP(6) NO DEFAULT NOT NULL NOT
>       DROPPABLE
>   )
> ;
> -- The following index is a system created index --
> CREATE UNIQUE INDEX N6A3_677163825_3374 ON TRAFODION.MYTEST.N6A3
>   (
>     C2 ASC
>   , C1 ASC
>   )
> ;
> -- The following index is a system created index --
> CREATE UNIQUE INDEX N6A3_745363825_3374 ON TRAFODION.MYTEST.N6A3
>   (
>     C2 ASC
>   , C1 ASC
>   )
> ;
> ALTER TABLE TRAFODION.MYTEST.N6A3 ADD CONSTRAINT
>   TRAFODION.MYTEST.N6A3_677163825_3374 UNIQUE
>   (
>     C2
>   , C1
>   )
> ;
> ALTER TABLE TRAFODION.MYTEST.N6A3 ADD CONSTRAINT
>   TRAFODION.MYTEST.N6A3_745363825_3374 UNIQUE
>   (
>     C2
>   , C1
>   )
> ;
> -- GRANT SELECT, INSERT, DELETE, UPDATE, REFERENCES ON TRAFODION.MYTEST.N6A3 TO DB__ROOT WITH GRANT OPTION;
> --- SQL operation complete.
> >>
> >>drop schema mytest cascade;
> --- SQL operation complete.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)