Duplicate rows removed, but alter table add constraint still returns error

Bug #1438925 reported by Paul Low
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Trafodion
Fix Released
High
Roberta Marton

Bug Description

Error returned seems to indicate that the previous failed command left behind something.
It says that the constraint already exist.

SQL>alter table tab2 add constraint con1 primary key(a);
*** ERROR[1390] Object TRAFODION.SCHEMA1.CON1 already exists in Trafodion.
*** ERROR[20123] A user-defined transaction has been started. This DDL operation cannot be performed.
*** ERROR[1029] Object TRAFODION.SCHEMA1.CON1 could not be created.

User creates schema and table.
USer inserts rows into table.
User tries to create constraint adding primary key, but was unsucessful as expected.
User removed offending rows and tries to create constraint again.
Unexpected error returns.

See log below:

SQL>set schema schema1;

--- SQL operation complete.

SQL>create table tab2(a int, b int) no partition;

--- SQL operation complete.

SQL>insert into tab2 values(9,1);

--- 1 row(s) inserted.

SQL>insert into tab2 values(9,1),(8,2);

--- 2 row(s) inserted.

SQL>alter table tab2 add constraint con1 primary key(a);

*** ERROR[8110] Duplicate rows detected.
*** ERROR[20123] A user-defined transaction has been started. This DDL operation cannot be performed.
*** ERROR[1029] Object TRAFODION.SCHEMA1.CON1 could not be created.

SQL>delete from tab2 where a=9;

--- 2 row(s) deleted.

SQL>alter table tab2 add constraint con1 primary key(a);

*** ERROR[1390] Object TRAFODION.SCHEMA1.CON1 already exists in Trafodion.
*** ERROR[20123] A user-defined transaction has been started. This DDL operation cannot be performed.
*** ERROR[1029] Object TRAFODION.SCHEMA1.CON1 could not be created.

SQL>drop schema schema1 cascade;

--- SQL operation complete.

Tags: sql-cmu
Changed in trafodion:
assignee: nobody → Roberta Marton (roberta-marton)
status: New → In Progress
Paul Low (paul-low-x)
Changed in trafodion:
milestone: none → r1.2
Revision history for this message
Roberta Marton (roberta-marton) wrote :

Probably fixed

Changed in trafodion:
status: In Progress → Fix Committed
Revision history for this message
Paul Low (paul-low-x) wrote :

verified on 0417 build

Changed in trafodion:
status: Fix Committed → Fix Released
milestone: r2.0 → r1.1
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.