You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafodion.apache.org by li...@apache.org on 2018/02/23 09:45:23 UTC
[4/9] trafodion git commit: modify for the review comments to
strictly check the input to unix_timestamp
modify for the review comments to strictly check the input to unix_timestamp
Project: http://git-wip-us.apache.org/repos/asf/trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafodion/commit/dc9f5b5a
Tree: http://git-wip-us.apache.org/repos/asf/trafodion/tree/dc9f5b5a
Diff: http://git-wip-us.apache.org/repos/asf/trafodion/diff/dc9f5b5a
Branch: refs/heads/master
Commit: dc9f5b5ae64cfb1df3a27ca67e46e1568c42dafd
Parents: 3c6bce6
Author: Liu Ming <ov...@sina.com>
Authored: Thu Feb 15 19:28:20 2018 +0000
Committer: Liu Ming <ov...@sina.com>
Committed: Thu Feb 15 19:28:20 2018 +0000
----------------------------------------------------------------------
core/sql/exp/exp_function.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/trafodion/blob/dc9f5b5a/core/sql/exp/exp_function.cpp
----------------------------------------------------------------------
diff --git a/core/sql/exp/exp_function.cpp b/core/sql/exp/exp_function.cpp
index 9e5e49e..8f03bab 100644
--- a/core/sql/exp/exp_function.cpp
+++ b/core/sql/exp/exp_function.cpp
@@ -2593,7 +2593,7 @@ ex_expr::exp_return_type ex_function_unixtime::eval(char *op_data[],
{
struct tm* ptr;
char* r = strptime(opData, "%Y-%m-%d %H:%M:%S", ptr);
- if( r == NULL)
+ if( (r == NULL) || (*r != '\0') )
{
ExRaiseSqlError(heap, diagsArea, EXE_BAD_ARG_TO_MATH_FUNC);
*(*diagsArea) << DgString0("UNIX_TIMESTAMP");