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.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---