Repository: trafodion Updated Branches: refs/heads/master 5738beb27 -> 3e149d2c3
fix TRAFODION-2931 call udf function on chinese character will casuse core dump Project: http://git-wip-us.apache.org/repos/asf/trafodion/repo Commit: http://git-wip-us.apache.org/repos/asf/trafodion/commit/f24da815 Tree: http://git-wip-us.apache.org/repos/asf/trafodion/tree/f24da815 Diff: http://git-wip-us.apache.org/repos/asf/trafodion/diff/f24da815 Branch: refs/heads/master Commit: f24da815b280f0bbf5c8db191ebb47fcb1baf9d9 Parents: 6d38e58 Author: kakaxi3019 <[email protected]> Authored: Thu Feb 1 02:00:24 2018 +0000 Committer: kakaxi3019 <[email protected]> Committed: Thu Feb 1 02:00:24 2018 +0000 ---------------------------------------------------------------------- core/sql/parser/sqlparser.y | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/trafodion/blob/f24da815/core/sql/parser/sqlparser.y ---------------------------------------------------------------------- diff --git a/core/sql/parser/sqlparser.y b/core/sql/parser/sqlparser.y index 2c805da..2e9dcee 100755 --- a/core/sql/parser/sqlparser.y +++ b/core/sql/parser/sqlparser.y @@ -8333,8 +8333,15 @@ user_defined_scalar_function : user_defined_function_name '(' udr_value_expressi = ParScannedTokens->getScannedTokenInfo(0); Int32 pos = tokInfo.tokenStrPos - tokInfo.tokenStrOffset + tokInfo.tokenStrLen; - NAString *input = unicodeToChar(&inputStr[0], pos, (long) SqlParser_ISO_MAPPING, - PARSERHEAP()); + //TRAFODION-2931 + //Chinese character of inputStr will cause core dump + //NAString *input = unicodeToChar(&inputStr[0], pos, (long) SqlParser_ISO_MAPPING, + // PARSERHEAP()); + NAString *input = unicodeToChar(&inputStr[0], + pos, + (CharInfo::CharSet) (ComGetNameInterfaceCharSet()), + PARSERHEAP()); + //TRAFODION-2931 char *inputC = new (PARSERHEAP()) char[pos+1]; strncpy(inputC, input->data(), pos+1); delete input;
