From 8c94c6f0e4eeb0eaa278a5fadeb6906f08a46789 Mon Sep 17 00:00:00 2001 From: Anoop Sharma Date: Fri, 7 Aug 2015 20:32:53 +0000 Subject: [PATCH] commit #1 --- core/sql/regress/seabase/EXPECTED020 | 7 ++----- core/sql/regress/seabase/TEST020 | 1 - core/sql/sqlcomp/CmpSeabaseDDLtable.cpp | 4 ++-- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/core/sql/regress/seabase/EXPECTED020 b/core/sql/regress/seabase/EXPECTED020 index e5d0e40fba..ac4c1769c6 100644 --- a/core/sql/regress/seabase/EXPECTED020 +++ b/core/sql/regress/seabase/EXPECTED020 @@ -408,10 +408,7 @@ ATEST BTEST CTEST DTEST >> >>alter table TEST020T29 add constraint TEST020T29CNT2 foreign key (a) references TEST020T28(a); -*** ERROR[1143] Validation of constraint TRAFODION.SCH.TEST020T29CNT2 failed; incompatible data exists in referencing base table TEST020T29 and referenced base table TEST020T28. To display the data that violates the constraint, please use the following DML statement: select count(*) from "TRAFODION"."SCH"."TEST020T29" where not (("A") in (select "A" from "TRAFODION"."SCH"."TEST020T28")) or "A" is null ; - ---- SQL operation failed with errors. ->>-- expecting error reported +--- SQL operation complete. >> >>select * from TEST020T29; @@ -455,7 +452,7 @@ A >>--this alter should fail >>alter table TEST020T31 add constraint C44B FOREIGN KEY (ssnum) references TEST020T30(ssnum); -*** ERROR[1143] Validation of constraint TRAFODION.SCH.C44B failed; incompatible data exists in referencing base table TEST020T31 and referenced base table TEST020T30. To display the data that violates the constraint, please use the following DML statement: select count(*) from "TRAFODION"."SCH"."TEST020T31" where not (("SSNUM") in (select "SSNUM" from "TRAFODION"."SCH"."TEST020T30")) or "SSNUM" is null ; +*** ERROR[1143] Validation of constraint TRAFODION.SCH.C44B failed; incompatible data exists in referencing base table TEST020T31 and referenced base table TEST020T30. To display the data that violates the constraint, please use the following DML statement: select count(*) from "TRAFODION"."SCH"."TEST020T31" where not (("SSNUM") in (select "SSNUM" from "TRAFODION"."SCH"."TEST020T30")) and "SSNUM" is not null ; --- SQL operation failed with errors. >> diff --git a/core/sql/regress/seabase/TEST020 b/core/sql/regress/seabase/TEST020 index 79a0b17862..7ce419f7d8 100755 --- a/core/sql/regress/seabase/TEST020 +++ b/core/sql/regress/seabase/TEST020 @@ -250,7 +250,6 @@ alter table TEST020T29 drop constraint TEST020T29CNT1; insert into TEST020T29 values (1),(null), (3); alter table TEST020T29 add constraint TEST020T29CNT2 foreign key (a) references TEST020T28(a); --- expecting error reported select * from TEST020T29; diff --git a/core/sql/sqlcomp/CmpSeabaseDDLtable.cpp b/core/sql/sqlcomp/CmpSeabaseDDLtable.cpp index ef5d58b810..10940ba5ef 100644 --- a/core/sql/sqlcomp/CmpSeabaseDDLtable.cpp +++ b/core/sql/sqlcomp/CmpSeabaseDDLtable.cpp @@ -5737,11 +5737,11 @@ void CmpSeabaseDDL::alterSeabaseTableAddRIConstraint( if (j < (ringCols.entries() - 1)) ringColListForValidation += ", "; - ringNullList += "or "; + ringNullList += "and "; ringNullList += "\""; ringNullList += colName; ringNullList += "\""; - ringNullList += " is null "; + ringNullList += " is not null "; } if (constraintErrorChecks(&cliInterface,