You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafodion.apache.org by db...@apache.org on 2018/05/30 22:45:54 UTC

[1/3] trafodion git commit: [TRAFODION-3088] Fix data conversion issue with INTERVAL literals

Repository: trafodion
Updated Branches:
  refs/heads/master 0f5f8a7a3 -> ed0daf50f


[TRAFODION-3088] Fix data conversion issue with INTERVAL literals


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

Branch: refs/heads/master
Commit: 3662b90c7a51513a6f5cf0bd31943fbf4c996cfe
Parents: b04bfda
Author: Dave Birdsall <db...@apache.org>
Authored: Tue May 29 20:32:37 2018 +0000
Committer: Dave Birdsall <db...@apache.org>
Committed: Tue May 29 20:32:37 2018 +0000

----------------------------------------------------------------------
 core/sql/optimizer/ValueDesc.cpp | 27 ++++++++++++++++++++++++++-
 1 file changed, 26 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafodion/blob/3662b90c/core/sql/optimizer/ValueDesc.cpp
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/ValueDesc.cpp b/core/sql/optimizer/ValueDesc.cpp
index 45f92e1..e32b3d5 100644
--- a/core/sql/optimizer/ValueDesc.cpp
+++ b/core/sql/optimizer/ValueDesc.cpp
@@ -6382,7 +6382,32 @@ void ValueIdList::convertToTextKey(const ValueIdList& keyList, NAString& result)
 	 {
            short vLen = val.length();
 
-	   if ((constType->getTypeQualifier()  == NA_NUMERIC_TYPE) &&
+	   if (constType->getTypeQualifier() == NA_INTERVAL_TYPE)
+	     {
+	       // In some code paths, the text may have "INTERVAL 'xxx' <qualifier>"
+	       // junk around it so we have to strip that off. (Example: An equality
+	       // predicate when query caching has been turned off via 
+	       // CQD QUERY_CACHE '0'. Another example happens with BETWEEN, whether 
+	       // or not query caching is turned off. See JIRA TRAFODION-3088 for
+	       // that example.)
+	       Lng32 start = val.index("'");
+	       Lng32 minus = val.index("-");
+	       if (start > 0)
+	         {
+	           Lng32 end = val.index("'", start+1);
+	           if (end > 0)
+	             {
+	               val = val(start+1, (end-start-1));
+	               if (minus > 0)
+	                 {
+	                   // prepend '-' to the output
+	                   val.prepend('-', 1);
+	                 }
+	               vLen = val.length();		         
+	             }
+	         }             
+	     }
+	   else if ((constType->getTypeQualifier()  == NA_NUMERIC_TYPE) &&
 	       (((NumericType*)constType)->isExact()) &&
                (NOT ((NumericType*)constType)->isBigNum()) &&
 	       (constType->getScale() > 0))


[2/3] trafodion git commit: Rework addressing issue raised by Hans

Posted by db...@apache.org.
Rework addressing issue raised by Hans


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

Branch: refs/heads/master
Commit: 7f979aaa8065e3719606d17aab0bec41b1a60cd6
Parents: 3662b90
Author: Dave Birdsall <db...@apache.org>
Authored: Tue May 29 23:10:25 2018 +0000
Committer: Dave Birdsall <db...@apache.org>
Committed: Tue May 29 23:10:25 2018 +0000

----------------------------------------------------------------------
 core/sql/optimizer/ValueDesc.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafodion/blob/7f979aaa/core/sql/optimizer/ValueDesc.cpp
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/ValueDesc.cpp b/core/sql/optimizer/ValueDesc.cpp
index e32b3d5..0e12ffb 100644
--- a/core/sql/optimizer/ValueDesc.cpp
+++ b/core/sql/optimizer/ValueDesc.cpp
@@ -6398,7 +6398,7 @@ void ValueIdList::convertToTextKey(const ValueIdList& keyList, NAString& result)
 	           if (end > 0)
 	             {
 	               val = val(start+1, (end-start-1));
-	               if (minus > 0)
+	               if ((minus > 0) && (minus < start))  // '-' before the string part
 	                 {
 	                   // prepend '-' to the output
 	                   val.prepend('-', 1);


[3/3] trafodion git commit: Merge [TRAFODION-3088] PR 1584 Fix data conversion issue with INTERVAL lits

Posted by db...@apache.org.
Merge [TRAFODION-3088] PR 1584 Fix data conversion issue with INTERVAL lits


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

Branch: refs/heads/master
Commit: ed0daf50f3ec17c7ae0a5177fe6f563ffab80f83
Parents: 0f5f8a7 7f979aa
Author: Dave Birdsall <db...@apache.org>
Authored: Wed May 30 22:45:22 2018 +0000
Committer: Dave Birdsall <db...@apache.org>
Committed: Wed May 30 22:45:22 2018 +0000

----------------------------------------------------------------------
 core/sql/optimizer/ValueDesc.cpp | 27 ++++++++++++++++++++++++++-
 1 file changed, 26 insertions(+), 1 deletion(-)
----------------------------------------------------------------------