Repository: trafodion Updated Branches: refs/heads/master 27897caaf -> 63e1083d1
[TRAFODION-2904] optionally add leading space when get a number column to display Project: http://git-wip-us.apache.org/repos/asf/trafodion/repo Commit: http://git-wip-us.apache.org/repos/asf/trafodion/commit/56e9a807 Tree: http://git-wip-us.apache.org/repos/asf/trafodion/tree/56e9a807 Diff: http://git-wip-us.apache.org/repos/asf/trafodion/diff/56e9a807 Branch: refs/heads/master Commit: 56e9a807ed98b5f304befe834b13d4e62cbebb36 Parents: 8e332e5 Author: Liu Ming <[email protected]> Authored: Sat Jan 13 09:37:45 2018 +0000 Committer: Liu Ming <[email protected]> Committed: Sat Jan 13 09:37:45 2018 +0000 ---------------------------------------------------------------------- core/sql/optimizer/BindItemExpr.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/trafodion/blob/56e9a807/core/sql/optimizer/BindItemExpr.cpp ---------------------------------------------------------------------- diff --git a/core/sql/optimizer/BindItemExpr.cpp b/core/sql/optimizer/BindItemExpr.cpp index dcd6897..6bf942f 100644 --- a/core/sql/optimizer/BindItemExpr.cpp +++ b/core/sql/optimizer/BindItemExpr.cpp @@ -3654,12 +3654,10 @@ ItemExpr *Concat::bindNode(BindWA *bindWA) else if (convType == 2) { Parser parser(bindWA->currentCmpContext()); - char buf[1000]; + char buf[128]; - // right justify the string representation of numeric operand - // and then do the concat - sprintf(buf, "CAST(SPACE(%d - CHAR_LENGTH(CAST(@A1 AS VARCHAR(%d)))) || CAST(@A1 AS VARCHAR(%d)) AS VARCHAR(%d))", - dLen, dLen, dLen, dLen); + sprintf(buf, "CAST(CAST(@A1 AS VARCHAR(%d)) AS VARCHAR(%d))", + dLen, dLen); newChild = parser.getItemExprTree(buf, strlen(buf), BINDITEMEXPR_STMTCHARSET, 1, child(srcChildIndex));
