trafodion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dbirds...@apache.org
Subject [3/6] incubator-trafodion git commit: [TRAFODION-2074] Create index should avoid populating the index within a transaction
Date Tue, 21 Jun 2016 15:37:31 GMT
[TRAFODION-2074] Create index should avoid populating the index within a transaction

Fix for regression failure core/TEST116

Fix to return the error 8034 when an inconsistency due to missing column values
is detected at the time of fetching the row.


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/abb96bbc
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/abb96bbc
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/abb96bbc

Branch: refs/heads/master
Commit: abb96bbce270cb8f9458625025b903a81b20862d
Parents: 7bc7d61
Author: selvaganesang <selva.govindarajan@esgyn.com>
Authored: Sun Jun 19 04:21:36 2016 +0000
Committer: selvaganesang <selva.govindarajan@esgyn.com>
Committed: Sun Jun 19 04:21:36 2016 +0000

----------------------------------------------------------------------
 core/sql/bin/SqlciErrors.txt        |  1 +
 core/sql/executor/ExHbaseAccess.cpp | 26 ++++++++++++++++++++++++++
 core/sql/regress/core/EXPECTED116   |  5 +----
 core/sql/regress/core/TEST116       |  2 +-
 4 files changed, 29 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/abb96bbc/core/sql/bin/SqlciErrors.txt
----------------------------------------------------------------------
diff --git a/core/sql/bin/SqlciErrors.txt b/core/sql/bin/SqlciErrors.txt
index 0b96d26..867f6b7 100644
--- a/core/sql/bin/SqlciErrors.txt
+++ b/core/sql/bin/SqlciErrors.txt
@@ -1492,6 +1492,7 @@ $1~String1 --------------------------------
 8031 HY018 99999 BEGINNER INFRM LOGONLY Server declined cancel request for query ID $0~String0.
$1~String1.
 8032 ZZZZZ 99999 ADVANCED MAJOR DBADMIN Explain information for the provided query id is
not available in repository.
 8033 ZZZZZ 99999 ADVANCED MAJOR DBADMIN Explain information is too large to be stored in
repository.
+8034 ZZZZZ 99999 ADVANCED MAJOR DBADMIN Column $0~String0 of object $1~string0 does not have
a default clause but it is missing in database. This indicates inconsistent data.
 8100 ZZZZZ 99999 BEGINNER MINOR LOGONLY Define $1~string0 does not exist
 8101 23000 99999 BEGINNER MAJOR DBADMIN The operation is prevented by check constraint $0~ConstraintName
on table $1~TableName.
 8102 23000 99999 BEGINNER MAJOR DBADMIN The operation is prevented by a unique constraint.

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/abb96bbc/core/sql/executor/ExHbaseAccess.cpp
----------------------------------------------------------------------
diff --git a/core/sql/executor/ExHbaseAccess.cpp b/core/sql/executor/ExHbaseAccess.cpp
index 3072b6c..e51d89f 100644
--- a/core/sql/executor/ExHbaseAccess.cpp
+++ b/core/sql/executor/ExHbaseAccess.cpp
@@ -1153,6 +1153,32 @@ Lng32 ExHbaseAccessTcb::createSQRowFromHbaseFormat(Int64 *latestRowTimestamp)
              ex_assert(FALSE, "Attr not found -2");
 	  
 	  char * defVal = attr->getDefaultValue();
+          if (! defVal)
+            {
+              char * colVal = (char*)
+                hbaseAccessTdb().listOfFetchedColNames()->get(idx);
+
+              Text colFam, colName;
+              extractColFamilyAndName(colVal, colFam, colName);
+
+              Int64 v = 0;
+              if (colName.length() == sizeof(char))
+                v = *(char*)colName.data();
+              else if (colName.length() == sizeof(unsigned short))
+                v = *(UInt16*)colName.data();
+              else if (colName.length() == sizeof(Lng32))
+                v = *(ULng32*)colName.data();
+
+              char buf[10];
+              str_sprintf(buf, "%Ld", v);
+              ComDiagsArea * diagsArea = NULL;
+              ExRaiseSqlError(getHeap(), &diagsArea,
+                              (ExeErrorCode)(8034),
+                              NULL, NULL, NULL, NULL, buf);
+              pentry_down->setDiagsArea(diagsArea);
+              return -1;
+            }
+
 	  char * defValPtr = defVal;
 	  short nullVal = 0;
 	  if (attr->getNullFlag())

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/abb96bbc/core/sql/regress/core/EXPECTED116
----------------------------------------------------------------------
diff --git a/core/sql/regress/core/EXPECTED116 b/core/sql/regress/core/EXPECTED116
index be139a8..b3e1201 100644
--- a/core/sql/regress/core/EXPECTED116
+++ b/core/sql/regress/core/EXPECTED116
@@ -644,7 +644,6 @@ Tables in Schema TRAFODION.T116SCH1
 
 SB_HISTOGRAMS
 SB_HISTOGRAM_INTERVALS
-T116T4
 
 --- SQL operation complete.
 >>create table t116t2 (a int);
@@ -658,7 +657,6 @@ Tables in Schema TRAFODION.T116SCH1
 SB_HISTOGRAMS
 SB_HISTOGRAM_INTERVALS
 T116T2
-T116T4
 
 --- SQL operation complete.
 >>drop schema t116sch1 cascade;
@@ -687,7 +685,6 @@ Tables in Schema TRAFODION.T116SCH1
 SB_HISTOGRAMS
 SB_HISTOGRAM_INTERVALS
 T116T1
-T116T4
 
 --- SQL operation complete.
 >>
@@ -792,7 +789,7 @@ T116T4
 >>set parserflags 1;
 
 --- SQL operation complete.
->>select count(*) from table(index_table t116t4_i1);
+>>select count(*) from table(index_table t116t5_i1);
 
 (EXPR)              
 --------------------

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/abb96bbc/core/sql/regress/core/TEST116
----------------------------------------------------------------------
diff --git a/core/sql/regress/core/TEST116 b/core/sql/regress/core/TEST116
index 91174bc..5380d71 100755
--- a/core/sql/regress/core/TEST116
+++ b/core/sql/regress/core/TEST116
@@ -227,7 +227,7 @@ insert into t116t5 values (1,1,1), (2,2,2), (3,3,2);
 create index t116t5_i1 on t116t5(c2);
 create index t116t5_i1 on t116t5(c2);
 set parserflags 1;
-select count(*) from table(index_table t116t4_i1);
+select count(*) from table(index_table t116t5_i1);
 -- create unique index - Both attempts should fail with the same error
 create unique index t116t5_i2 on t116t5(c3);
 create unique index t116t5_i2 on t116t5(c3);


Mime
View raw message