Repository: incubator-trafodion Updated Branches: refs/heads/master 2a1e5fa12 -> 6a8b0f438
sql regression test executor test022 fix, min largeint Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/17ea9351 Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/17ea9351 Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/17ea9351 Branch: refs/heads/master Commit: 17ea9351120580d7fc0c7ca82aea948473aeb50f Parents: 057ae46 Author: Liu Ming <lium...@apache.org> Authored: Thu Sep 15 17:50:46 2016 +0000 Committer: Liu Ming <lium...@apache.org> Committed: Thu Sep 15 17:50:46 2016 +0000 ---------------------------------------------------------------------- core/sql/exp/exp_conv.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/17ea9351/core/sql/exp/exp_conv.cpp ---------------------------------------------------------------------- diff --git a/core/sql/exp/exp_conv.cpp b/core/sql/exp/exp_conv.cpp index a2ce1e3..a368654 100644 --- a/core/sql/exp/exp_conv.cpp +++ b/core/sql/exp/exp_conv.cpp @@ -2091,8 +2091,11 @@ ex_expr::exp_return_type convAsciiToInt64(Int64 &target, heap, diagsArea, flags); if (ert == ex_expr::EXPR_ERROR) return ert; - - if (tempTgt > LLONG_MAX) + UInt64 maxLongPlus1 = LLONG_MAX ; + maxLongPlus1 ++; // min 64bit long integer is -9223372036854775808 + // max 64bit long integer is 9223372036854775807 + // so if negative value convert to non-negative value, should check with LLONG_MAX + 1 + if ((tempTgt > LLONG_MAX && NOT negative) || (tempTgt > maxLongPlus1) ) { ExRaiseDetailSqlError(heap, diagsArea, EXE_NUMERIC_OVERFLOW, source, sourceLen, REC_BYTE_F_ASCII,