[ 
https://issues.apache.org/jira/browse/TRAFODION-1676?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15355451#comment-15355451
 ] 

ASF GitHub Bot commented on TRAFODION-1676:
-------------------------------------------

Github user sureshsubbiah commented on a diff in the pull request:

    https://github.com/apache/incubator-trafodion/pull/564#discussion_r68971688
  
    --- Diff: core/sql/exp/exp_conv.cpp ---
    @@ -1445,6 +1445,10 @@ ex_expr::exp_return_type convUnicodeToDatetime(char 
*target,
        }
     
        ExRaiseSqlError(heap, diagsArea, EXE_CONVERT_DATETIME_ERROR);
    +   char hexstr[256];
    +   if(*diagsArea)
    --- End diff --
    
    Can heap, or diagsArea be null here (or other places below)? 
ExRaiseSqlError does allow these 2 possibilities and returns NULL in both 
cases. We may be able to convince ourselves that this should never happen, I 
get uneasy seeing a dereference of a pointer.
     One possibility is that we change 1447 to be 
    ExRaiseSqlError(heap, diagsArea, EXE_CONVERT_DATETIME_ERROR, NULL, NULL, 
NULL, NULL, stringToHex(hexstr, sizeof(hexstr) , source, sourceLen ));
    Then lines 1449 and 1450 can be removed.


> support better runtime error message when a SQL function meet fital error
> -------------------------------------------------------------------------
>
>                 Key: TRAFODION-1676
>                 URL: https://issues.apache.org/jira/browse/TRAFODION-1676
>             Project: Apache Trafodion
>          Issue Type: Improvement
>          Components: sql-exe
>            Reporter: liu ming
>            Assignee: liu ming
>            Priority: Minor
>
> A sql contains some SQL function, for example UPPER(), when the input data of 
> UPPER() contains invalid data, UPPER() will fail. In this case, the whole 
> query abort, and the error message cannot tell which row has invalid data, so 
> it is very hard to fix the problem.
> It will be good to have row id or the real value of the error row in the 
> error message to help trouble shooting.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to