Github user traflm commented on a diff in the pull request:
https://github.com/apache/trafodion/pull/1397#discussion_r161424099
--- Diff: 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))",
--- End diff --
That is my question as well :-)
I don't really understand the syntax here, if without the out CAST, the
parser will fail to parse this string.
There are many such cases, I wish to understand the special syntax here
later. But this is what it required for now.
---