Github user selvaganesang commented on a diff in the pull request:
https://github.com/apache/trafodion/pull/1502#discussion_r179560631
--- Diff: core/sql/exp/exp_function.cpp ---
@@ -2224,12 +2232,51 @@ ex_function_char_length_doublebyte::eval(char
*op_data[],
return ex_expr::EXPR_OK;
};
+Lng32 ex_function_position::errorChecks(Lng32 startPos, Lng32 occurrence,
+ CollHeap* heap, ComDiagsArea**
diagsArea)
+{
+ // startPos is 1 based. Cannot be <= 0
+ if (startPos < 0)
+ {
+ ExRaiseSqlError(heap, diagsArea, (ExeErrorCode)1572);
--- End diff --
1572 can't be cast to ExeErrorCode unless this error code is added to
ExpErrorEnum.h
---