You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafodion.apache.org by hz...@apache.org on 2017/06/29 22:42:09 UTC
[1/2] incubator-trafodion git commit: [TRAFODION-2669] Improve error
message 8402 - string overflow
Repository: incubator-trafodion
Updated Branches:
refs/heads/master ab675697e -> bfd4de2d7
[TRAFODION-2669] Improve error message 8402 - string overflow
Trying to give a better indication in some cases, to show
whether we exceeded the character limit or the byte limit.
The character limit is defined by a "precision" that is
a positive number.
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/8c9c7c2e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/8c9c7c2e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/8c9c7c2e
Branch: refs/heads/master
Commit: 8c9c7c2ee5c3e76e7eb63806f3849db6f00a0da3
Parents: 4d4b220
Author: Hans Zeller <hz...@apache.org>
Authored: Thu Jun 29 17:15:38 2017 +0000
Committer: Hans Zeller <hz...@apache.org>
Committed: Thu Jun 29 17:15:38 2017 +0000
----------------------------------------------------------------------
core/sql/exp/ExpError.cpp | 8 +++++---
core/sql/exp/ExpError.h | 3 ++-
core/sql/exp/exp_conv.cpp | 6 ++++--
3 files changed, 11 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/8c9c7c2e/core/sql/exp/ExpError.cpp
----------------------------------------------------------------------
diff --git a/core/sql/exp/ExpError.cpp b/core/sql/exp/ExpError.cpp
index 8a79d91..652b8cf 100644
--- a/core/sql/exp/ExpError.cpp
+++ b/core/sql/exp/ExpError.cpp
@@ -536,7 +536,8 @@ ComDiagsArea *ExRaiseDetailSqlError(CollHeap* heap,
Int16 tgtType,
UInt32 flags,
Int32 tgtLength,
- Int32 tgtScale)
+ Int32 tgtScale,
+ Int32 tgtPrecision)
{
//if looping situation, no need to proceed further, return back.
if(flags & CONV_CONTROL_LOOPING)
@@ -593,9 +594,10 @@ ComDiagsArea *ExRaiseDetailSqlError(CollHeap* heap,
if ((DFS2REC::isAnyCharacter(tgtType)) &&
(tgtLength >= 0) &&
(tgtScale > 0))
- str_sprintf(tgtDatatypeDetail, "%s,%d BYTES,%s",
+ str_sprintf(tgtDatatypeDetail, "%s,%d %s,%s",
getDatatypeAsString(tgtType, false),
- tgtLength,
+ tgtPrecision ? tgtPrecision : tgtLength,
+ tgtPrecision ? "CHARS" : "BYTES",
// tgtLength/CharInfo::bytesPerChar((CharInfo::CharSet)tgtScale),
(tgtScale == CharInfo::ISO88591 ? "ISO88591" : "UTF8"));
else
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/8c9c7c2e/core/sql/exp/ExpError.h
----------------------------------------------------------------------
diff --git a/core/sql/exp/ExpError.h b/core/sql/exp/ExpError.h
index a04afff..bc30682 100644
--- a/core/sql/exp/ExpError.h
+++ b/core/sql/exp/ExpError.h
@@ -139,7 +139,8 @@ ComDiagsArea *ExRaiseDetailSqlError(CollHeap* heap,
Int16 tgtType,
UInt32 flags,
Int32 tgtLength = -1,
- Int32 tgtScale = -1);
+ Int32 tgtScale = -1,
+ Int32 tgtPrecision = 0);
NA_EIDPROC
SQLEXP_LIB_FUNC
char *stringToHex(char * out, Int32 outLen, char * in, Int32 inLen);
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/8c9c7c2e/core/sql/exp/exp_conv.cpp
----------------------------------------------------------------------
diff --git a/core/sql/exp/exp_conv.cpp b/core/sql/exp/exp_conv.cpp
index 8467be4..8c5d443 100644
--- a/core/sql/exp/exp_conv.cpp
+++ b/core/sql/exp/exp_conv.cpp
@@ -671,7 +671,8 @@ ex_expr::exp_return_type convInt64ToAscii(char *target,
(char*)&source,
sizeof(Int64), REC_BIN64_SIGNED, scale, trgType,
flags,
- targetLen, targetScale);
+ targetLen, targetScale,
+ targetPrecision);
return ex_expr::EXPR_ERROR;
}
@@ -11825,7 +11826,8 @@ ex_expr::exp_return_type ex_conv_clause::eval(char *op_data[],
tgt->getDatatype(),
0,
tgt->getLength(),
- tgt->getScale());
+ tgt->getScale(),
+ tgt->getPrecision());
retcode = ex_expr::EXPR_ERROR;
}
else if (((*diagsArea)->getWarningEntry(warningMark2 - counter + 1))->
[2/2] incubator-trafodion git commit: Merge [TRAFODION-2669] Improve
error message 8402 - string overflow PR-1156
Posted by hz...@apache.org.
Merge [TRAFODION-2669] Improve error message 8402 - string overflow PR-1156
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/bfd4de2d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/bfd4de2d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/bfd4de2d
Branch: refs/heads/master
Commit: bfd4de2d7e9bef5953333a2fd39c8e74c98c3794
Parents: ab67569 8c9c7c2
Author: Hans Zeller <hz...@apache.org>
Authored: Thu Jun 29 22:41:38 2017 +0000
Committer: Hans Zeller <hz...@apache.org>
Committed: Thu Jun 29 22:41:38 2017 +0000
----------------------------------------------------------------------
core/sql/exp/ExpError.cpp | 8 +++++---
core/sql/exp/ExpError.h | 3 ++-
core/sql/exp/exp_conv.cpp | 6 ++++--
3 files changed, 11 insertions(+), 6 deletions(-)
----------------------------------------------------------------------