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

    https://github.com/apache/trafodion/pull/1642#discussion_r202841083
  
    --- Diff: core/sql/exp/exp_function.cpp ---
    @@ -2746,6 +2754,59 @@ ex_expr::exp_return_type 
ex_function_unixtime::eval(char *op_data[],
       return ex_expr::EXPR_OK;
     }
     
    +ex_expr::exp_return_type ex_function_split_part::eval(char *op_data[]
    +                               , CollHeap* heap
    +                               , ComDiagsArea** diagsArea)
    +{
    +  size_t sourceLen = getOperand(1)->getLength(op_data[-MAX_OPERANDS+1]);
    +  size_t patternLen = getOperand(2)->getLength(op_data[-MAX_OPERANDS+2]);
    +  Lng32 indexOfTarget = *(Lng32 *)op_data[3];
    +
    +  if (indexOfTarget <= 0)
    +    {
    +       ExRaiseSqlError(heap, diagsArea, (ExeErrorCode)4497);
    --- End diff --
    
    Since this is a run-time error, it should be in the 8000-8999 range. Also, 
there is an enum file for these error numbers. See 
https://cwiki.apache.org/confluence/display/TRAFODION/How+to+Add+A+New+SQL+Error+Diagnostic.


---

Reply via email to