fix handling invalid character in identifier
This commit is contained in:
@ -13,6 +13,7 @@
|
||||
#define USING_LOG_PREFIX SQL_ENG
|
||||
|
||||
#include <string.h>
|
||||
#include "lib/utility/ob_print_utils.h"
|
||||
#include "share/object/ob_obj_cast.h"
|
||||
#include "objit/common/ob_item_type.h"
|
||||
#include "sql/engine/expr/ob_expr_func_dump.h"
|
||||
@ -229,7 +230,7 @@ int ObExprFuncDump::calc_number(const common::ObObj &input,
|
||||
input.get_type(), nmb.get_deep_copy_size()))) {
|
||||
LOG_WARN("failed to databuff_printf", K(ret), K(nmb));
|
||||
} else if (ReturnFormat::RF_OB_SEPC == fmt_enum) {
|
||||
if (OB_FAIL(databuff_print_obj(tmp_buf, buff_size, pos, nmb))) {
|
||||
if (OB_FAIL(common::databuff_print_obj(tmp_buf, buff_size, pos, nmb))) {
|
||||
LOG_WARN("failed to databuff_printf", K(ret), K(pos));
|
||||
}
|
||||
} else {
|
||||
@ -461,7 +462,7 @@ static int dump_ob_spec(char *buf, int64_t buf_len, int64_t &buf_pos, bool &dump
|
||||
case ObNumberType:
|
||||
case ObNumberFloatType: {
|
||||
number::ObNumber nmb(datum.get_number());
|
||||
OZ(databuff_print_obj(buf, buf_len, buf_pos, nmb));
|
||||
OZ(common::databuff_print_obj(buf, buf_len, buf_pos, nmb));
|
||||
break;
|
||||
}
|
||||
case ObDateTimeType: {
|
||||
|
||||
@ -50,7 +50,9 @@ int calc_digest_text(ObIAllocator &allocator,
|
||||
sql_ctx.schema_guard_ = schema_guard;
|
||||
ObPlanCacheCtx pc_ctx(sql_str, PC_TEXT_MODE, allocator, sql_ctx, exec_ctx,
|
||||
session->get_effective_tenant_id());
|
||||
ObParser parser(allocator, session->get_sql_mode(), cs_type);
|
||||
ObCharsets4Parser charsets4parser = session->get_charsets4parser();
|
||||
charsets4parser.string_collation_ = cs_type;
|
||||
ObParser parser(allocator, session->get_sql_mode(), charsets4parser);
|
||||
ObSEArray<ObString, 1> queries;
|
||||
ObMPParseStat parse_stat;
|
||||
if (OB_FAIL(parser.split_multiple_stmt(sql_str, queries, parse_stat))) {
|
||||
@ -90,7 +92,7 @@ int calc_digest_text(ObIAllocator &allocator,
|
||||
pc_ctx,
|
||||
parse_result.result_tree_,
|
||||
tmp_params,
|
||||
cs_type))) {
|
||||
charsets4parser))) {
|
||||
LOG_WARN("fail to parameterize syntax tree", K(sql_str), K(ret));
|
||||
} else {
|
||||
digest_str = pc_ctx.sql_ctx_.spm_ctx_.bl_key_.constructed_sql_;
|
||||
|
||||
@ -28,7 +28,7 @@ int ObPrepareExecutor::multiple_query_check(
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
ObSEArray<ObString, 1> queries;
|
||||
ObParser parser(allocator, session.get_sql_mode(), session.get_local_collation_connection());
|
||||
ObParser parser(allocator, session.get_sql_mode(), session.get_charsets4parser());
|
||||
ObMPParseStat parse_stat;
|
||||
if (OB_FAIL(parser.split_multiple_stmt(sql, queries, parse_stat, false, true))) {
|
||||
LOG_WARN("failed to split multiple stmt", K(ret), K(sql));
|
||||
|
||||
Reference in New Issue
Block a user