[ https://issues.apache.org/jira/browse/TRAFODION-288?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14708663#comment-14708663 ]
Atanu Mishra commented on TRAFODION-288: ---------------------------------------- Anoop Sharma (anoop-sharma) on 2014-08-20 Changed in trafodion: status: In Progress → Fix Committed Weishiun Tsai (wei-shiun-tsai) wrote on 2014-08-20: #2 Verified on the 0819_0830 build installed on a workstation. This problem has been fixed: >>create table t (a int not null not droppable primary key, b char(10) check (b >>in ('AB', 'CD'))); --- SQL operation complete. >>insert into t values (1, 'AB'); --- 1 row(s) inserted. >>update t set b = 'EF' where b = 'AB'; *** ERROR[8101] The operation is prevented by check constraint TRAFODION.MYTEST.T_118787894_2398 on table TRAFODION.MYTEST.T. --- 0 row(s) updated. >>select * from t; A B ----------- ---------- 1 AB --- 1 row(s) selected. Changed in trafodion: status: Fix Committed → Fix Released > LP Bug: 1321479 - Updating char column violates a check constraint > ------------------------------------------------------------------ > > Key: TRAFODION-288 > URL: https://issues.apache.org/jira/browse/TRAFODION-288 > Project: Apache Trafodion > Issue Type: Bug > Components: sql-cmp > Reporter: Weishiun Tsai > Assignee: Anoop Sharma > Priority: Critical > Fix For: 1.0 (pre-incubation) > > > In the following example, column b is a char column with a constraint to > check that it is either ‘AB’ or ‘CD’. But an update statement allows it to > be updated to ‘EF’ as shown in the output. > This is seen on the datalake v40671 build. > ======================================================================== > Here is the script to reproduce this problem: > create table t (a int not null not droppable primary key, b char(10) check (b > in ('AB', 'CD'))); > insert into t values (1, 'AB'); > update t set b = 'EF' where b = 'AB'; > select * from t; > ======================================================================== > Here is the output of the execution: > >>create table t (a int not null not droppable primary key, b char(10) check > >>(b in ('AB', 'CD'))); > --- SQL operation complete. > >>insert into t values (1, 'AB'); > --- 1 row(s) inserted. > >>update t set b = 'EF' where b = 'AB'; > --- 1 row(s) updated. > >>select * from t; > A B > ----------- ---------- > 1 EF > --- 1 row(s) selected. > ======================================================================== > For reference purpose, here is the behavior on SQ: > >>create table t (a int not null not droppable primary key, b char(10) check > >>(b > in ('AB', 'CD'))); > --- SQL operation complete. > >>insert into t values (1, 'AB'); > --- 1 row(s) inserted. > >>update t set b = 'EF' where b = 'AB'; > *** ERROR[8101] The operation is prevented by check constraint > NEO.USR.T_5226969 > 13_6872 on table NEO.USR.T. > --- 0 row(s) updated. > >>select * from t; > A B > ----------- ---------- > 1 AB > --- 1 row(s) selected. -- This message was sent by Atlassian JIRA (v6.3.4#6332)