提交 c6f5f093 编写于 作者: O obdev 提交者: wangzelin.wzl

bugfix: char function data error in gc col

上级 eb4dc363
......@@ -1284,6 +1284,42 @@ int ObRawExprPrinter::print(ObSysFunRawExpr* expr)
}
break;
}
case T_FUN_SYS_POSITION: {
DATA_PRINTF("%.*s", LEN_AND_PTR(func_name));
if (2 != expr->get_param_count()) {
ret = OB_ERR_UNEXPECTED;
LOG_WARN("param count should be equal 2", K(ret), K(expr->get_param_count()));
} else {
DATA_PRINTF("(");
PRINT_EXPR(expr->get_param_expr(0));
DATA_PRINTF(" in ");
PRINT_EXPR(expr->get_param_expr(1));
DATA_PRINTF(")");
}
break;
}
case T_FUN_SYS_CHAR: {
DATA_PRINTF("%.*s(", LEN_AND_PTR(func_name));
if (OB_SUCC(ret)) {
if (expr->get_param_count() < 2) {
ret = OB_ERR_UNEXPECTED;
LOG_WARN("param count should be great or equ 2", K(ret), K(expr->get_param_count()));
} else {
int64_t i = 0;
for (; OB_SUCC(ret) && i < expr->get_param_count() - 1; ++i) {
PRINT_EXPR(expr->get_param_expr(i));
DATA_PRINTF(",");
}
if (OB_SUCC(ret)) {
--*pos_;
DATA_PRINTF(" using ");
PRINT_EXPR(expr->get_param_expr(expr->get_param_count() - 1));
DATA_PRINTF(")");
}
}
}
break;
}
default: {
// substr
// date, month
......
......@@ -1608,7 +1608,7 @@ int ObRawExprResolverImpl::process_char_charset_node(const ParseNode* node, ObRa
LOG_WARN("invalid character set", K(charset_str), K(ret));
LOG_USER_ERROR(OB_ERR_UNKNOWN_CHARSET, charset_str.length(), charset_str.ptr());
} else {
ObCollationType coll_type = ObCharset::get_default_collation(charset_type);
ObCollationType coll_type = ObCharset::get_system_collation();
ObObj val;
val.set_varchar(charset_str);
val.set_collation_type(coll_type);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册