bugfix: char function data error in gc col
This commit is contained in:
		@ -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);
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user