Github user sandhyasun commented on a diff in the pull request:
https://github.com/apache/incubator-trafodion/pull/1022#discussion_r108307111
--- Diff: core/sql/optimizer/BindItemExpr.cpp ---
@@ -6173,7 +6173,35 @@ ItemExpr *Assign::bindNode(BindWA *bindWA)
} // QSTUFF
} // isUserSpecified
+ NABuiltInTypeEnum sourceType =
child(1)->castToItemExpr()->getValueId().getType().getTypeQualifier() ;
+ NABuiltInTypeEnum targetType =
child(0)->castToItemExpr()->getValueId().getType().getTypeQualifier() ;
+ if ((sourceType == NA_CHARACTER_TYPE) && (targetType == NA_LOB_TYPE))
+ {
+ ValueId vid1 = child(1)->castToItemExpr()->getValueId();
+ // Add a stringToLob node
+ ItemExpr *newChild = new (bindWA->wHeap()) LOBinsert(
vid1.getItemExpr(), NULL, LOBoper::STRING_, FALSE);
+ newChild->bindNode(bindWA);
+ if (bindWA->errStatus())
+ return boundExpr;
+ setChild(1, newChild);
+ }
+ /* if ((sourceType == NA_UNKNOWN_TYPE) && (targetType = NA_LOB_TYPE))
--- End diff --
No I will remove the commented out code. I had initilaly tried to do this
cast in the binder but it was not the right place. The type coercion needed to
be done in the ::doSynthType() method.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---