further regression test core/030 seabase/038 and code refactor

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

Branch: refs/heads/master
Commit: 98463fd55da7a02f3437c6d930396feda5f3180e
Parents: 758bc38
Author: Liu Ming <[email protected]>
Authored: Sat Sep 3 01:11:53 2016 +0000
Committer: Liu Ming <[email protected]>
Committed: Sat Sep 3 01:11:53 2016 +0000

----------------------------------------------------------------------
 core/sql/exp/exp_datetime.cpp           | 8 ++++----
 core/sql/regress/core/EXPECTED038.LINUX | 2 +-
 core/sql/regress/seabase/EXPECTED030    | 4 ++--
 3 files changed, 7 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/98463fd5/core/sql/exp/exp_datetime.cpp
----------------------------------------------------------------------
diff --git a/core/sql/exp/exp_datetime.cpp b/core/sql/exp/exp_datetime.cpp
index 2f7ce07..60ae7c2 100644
--- a/core/sql/exp/exp_datetime.cpp
+++ b/core/sql/exp/exp_datetime.cpp
@@ -99,10 +99,10 @@ static void
 raiseDateConvErrorWithSrcData(int srcLen, ComDiagsArea** diagsArea, char 
*srcData, CollHeap *heap)
 {
     char errstr[MAX_OFFENDING_SOURCE_DATA_DISPLAY_LEN];
-    memset(errstr, 0 , sizeof(errstr) );
+    str_pad(errstr, sizeof(errstr), 0 );
     if(srcLen > MAX_OFFENDING_SOURCE_DATA_DISPLAY_LEN -1 )
       srcLen = MAX_OFFENDING_SOURCE_DATA_DISPLAY_LEN -1;
-    strncpy(errstr, srcData, srcLen);
+    str_cpy_all(errstr, srcData, srcLen);
     ExRaiseSqlError(heap, diagsArea, 
EXE_CONVERT_DATETIME_ERROR,NULL,NULL,NULL,NULL,errstr);
 }
 
@@ -112,8 +112,8 @@ static void
 raiseDateConvErrorWithSrcDataNumeric(ComDiagsArea** diagsArea, long srcData, 
CollHeap *heap)
 {
    char errstr[MAX_OFFENDING_SOURCE_DATA_DISPLAY_LEN];
-   memset(errstr, 0 , sizeof(errstr) );
-   sprintf(errstr,"%ld",srcData);
+   str_pad(errstr, sizeof(errstr), 0 );
+   str_sprintf(errstr,"%ld",srcData);
    ExRaiseSqlError(heap, diagsArea, 
EXE_CONVERT_DATETIME_ERROR,NULL,NULL,NULL,NULL,errstr);
 }
 //////////////////////////////////////////////

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/98463fd5/core/sql/regress/core/EXPECTED038.LINUX
----------------------------------------------------------------------
diff --git a/core/sql/regress/core/EXPECTED038.LINUX 
b/core/sql/regress/core/EXPECTED038.LINUX
index 2d33c7a..6a07dd3 100644
--- a/core/sql/regress/core/EXPECTED038.LINUX
+++ b/core/sql/regress/core/EXPECTED038.LINUX
@@ -2748,7 +2748,7 @@ B1
 --- 0 row(s) selected.
 >>select * from T038b where b1 < cast('1997-28-02' as DATE) + interval '2' day;
 
-*** ERROR[8415] The provided DATE, TIME, or TIMESTAMP is not valid and cannot 
be converted. Source data: 1997-28-02
+*** ERROR[8415] The provided DATE, TIME, or TIMESTAMP is not valid and cannot 
be converted. Source data: 1997-28-02
 
 --- 0 row(s) selected.
 >>

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/98463fd5/core/sql/regress/seabase/EXPECTED030
----------------------------------------------------------------------
diff --git a/core/sql/regress/seabase/EXPECTED030 
b/core/sql/regress/seabase/EXPECTED030
index 431dfaa..db42984 100644
--- a/core/sql/regress/seabase/EXPECTED030
+++ b/core/sql/regress/seabase/EXPECTED030
@@ -631,14 +631,14 @@ A           B                               C
 >>-- ms4 error cases
 >>select to_date(123456789, '99:99:99:99') from (values(1)) x(a);
 
-*** ERROR[8415] The provided DATE, TIME, or TIMESTAMP is not valid and cannot 
be converted. Source data: ?
+*** ERROR[8415] The provided DATE, TIME, or TIMESTAMP is not valid and cannot 
be converted. Source data: 1
 
 *** ERROR[8001] An internal executor error occurred.
 
 --- 0 row(s) selected.
 >>select to_date(-12345678, '99:99:99:99') from (values(1)) x(a);
 
-*** ERROR[8415] The provided DATE, TIME, or TIMESTAMP is not valid and cannot 
be converted. Source data: ?
+*** ERROR[8415] The provided DATE, TIME, or TIMESTAMP is not valid and cannot 
be converted. Source data: -12345678
 
 *** ERROR[8001] An internal executor error occurred.
 

Reply via email to