You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafodion.apache.org by an...@apache.org on 2016/03/17 02:54:11 UTC

[6/9] incubator-trafodion git commit: fix for compGeneral/test006 diff

fix for compGeneral/test006 diff


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

Branch: refs/heads/master
Commit: 62eefa12ca4d6e010745867620fade71b930cd2f
Parents: d406cc5
Author: Cloud User <ce...@ansharma-3.novalocal>
Authored: Sun Mar 13 16:53:25 2016 +0000
Committer: Cloud User <ce...@ansharma-3.novalocal>
Committed: Sun Mar 13 16:53:25 2016 +0000

----------------------------------------------------------------------
 core/sql/optimizer/BindItemExpr.cpp         | 16 +++++++++++++++-
 core/sql/regress/compGeneral/EXPECTED006.SB |  2 +-
 2 files changed, 16 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/62eefa12/core/sql/optimizer/BindItemExpr.cpp
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/BindItemExpr.cpp b/core/sql/optimizer/BindItemExpr.cpp
index ba7595f..173e373 100644
--- a/core/sql/optimizer/BindItemExpr.cpp
+++ b/core/sql/optimizer/BindItemExpr.cpp
@@ -4043,6 +4043,12 @@ NABoolean DateFormat::errorChecks(Lng32 frmt, BindWA *bindWA,
       else if ((NOT ms4) && (opType->getTypeQualifier() != NA_CHARACTER_TYPE))
         error = 4; // error 4043
 
+      // operand must be numeric with nf (numeric format)
+      else if (ms4 && nf && (opType->getTypeQualifier() != NA_NUMERIC_TYPE))
+        {
+          error = 7; // error 4045
+        }
+
       // numeric must be exact with scale of 0
       else if (ms4 && (opType->getTypeQualifier() == NA_NUMERIC_TYPE))
         {
@@ -4100,8 +4106,16 @@ NABoolean DateFormat::errorChecks(Lng32 frmt, BindWA *bindWA,
             bindWA->setErrStatus();
           }
           break;
-        } // switch
       
+        case 7:
+          {
+            *CmpCommon::diags() << DgSqlCode(-4045) << DgString0("TO_DATE");
+            bindWA->setErrStatus();
+          }
+          break;
+
+        } // switch
+
       return TRUE;
     }
   

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/62eefa12/core/sql/regress/compGeneral/EXPECTED006.SB
----------------------------------------------------------------------
diff --git a/core/sql/regress/compGeneral/EXPECTED006.SB b/core/sql/regress/compGeneral/EXPECTED006.SB
index 96cd90c..c72e759 100644
--- a/core/sql/regress/compGeneral/EXPECTED006.SB
+++ b/core/sql/regress/compGeneral/EXPECTED006.SB
@@ -280,7 +280,7 @@
 --- SQL operation complete.
 >>prepare xx from select * from t006t1 where to_date(A, '99:99:99:99') = A;
 
-*** ERROR[4045] The operand of function FORMAT must be numeric.
+*** ERROR[4045] The operand of function TO_DATE must be numeric.
 
 *** ERROR[8822] The statement was not prepared.