Github user DaveBirdsall commented on a diff in the pull request:
https://github.com/apache/trafodion/pull/1481#discussion_r175629733
--- Diff: core/sql/parser/sqlparser.y ---
@@ -8734,6 +8738,30 @@ datetime_value_function : TOK_CURDATE '(' ')'
$$ = new (PARSERHEAP()) Cast(uniqueId,type);
}
+/* type item */
+datetime_misc_function_used_as_default: TOK_TO_CHAR '('
value_expression ',' character_string_literal ')'
+ {
+ NAString * ves= unicodeToChar
+ (ToTokvalPlusYYText(&$3)->yytext,
+ ToTokvalPlusYYText(&$3)->yyleng,
+ (CharInfo::CharSet) (
+ ComGetNameInterfaceCharSet() //
CharInfo::UTF8
+ ),
+ PARSERHEAP());
+ //save the original text
+ NAString fullstr;
+ fullstr += "TO_CHAR(";
--- End diff --
I'm curious why you needed to save the original text. Was the unparse
function on the DateFormat node not adequate?
---