set the initial value of wrs to scn min
This commit is contained in:
@ -1901,7 +1901,7 @@ int ObFastParserMysql::process_string(const char quote)
|
||||
ret = OB_ERR_PARSER_SYNTAX;
|
||||
LOG_WARN("parser syntax error", K(ret), K(raw_sql_.to_string()), K_(raw_sql_.cur_pos));
|
||||
} else if (is_ansi_quotes && quote == '"') {
|
||||
cur_token_type_ = IGNORE_TOKEN;
|
||||
cur_token_type_ = NORMAL_TOKEN;
|
||||
} else {
|
||||
char *buf = nullptr;
|
||||
cur_token_type_ = PARAM_TOKEN;
|
||||
|
||||
@ -638,7 +638,7 @@ int ObParser::split_multiple_stmt(const ObString &stmt,
|
||||
ObString part(str_len, stmt.ptr() + offset);
|
||||
ObString remain_part(remain, stmt.ptr() + offset);
|
||||
//first try parse part str, because it's have less length and need less memory
|
||||
if (OB_FAIL(tmp_ret = parse(part, parse_result, parse_mode, false, false, true))) {
|
||||
if (OB_FAIL(tmp_ret = parse(part, parse_result, parse_mode, false, true))) {
|
||||
//if parser part str failed, then try parse all remain part, avoid parse many times
|
||||
//bug: https://work.aone.alibaba-inc.com/issue/34642901
|
||||
tmp_ret = OB_SUCCESS;
|
||||
@ -720,7 +720,7 @@ int ObParser::reconstruct_insert_sql(const common::ObString &stmt,
|
||||
allocator.set_label("InsMultiValOpt");
|
||||
ObIAllocator *bak_allocator = allocator_;
|
||||
allocator_ = &allocator;
|
||||
if (OB_FAIL(parse(stmt, parse_result, parse_mode, false, false, true))) {
|
||||
if (OB_FAIL(parse(stmt, parse_result, parse_mode, false, true))) {
|
||||
// if parser SQL failed,then we won't rewrite it and keep it as it is
|
||||
LOG_WARN("failed to parser insert sql", K(ret));
|
||||
} else if (parse_result.ins_multi_value_res_->values_count_ == 1) {
|
||||
@ -944,7 +944,6 @@ int ObParser::parse(const ObString &query,
|
||||
ParseResult &parse_result,
|
||||
ParseMode parse_mode,
|
||||
const bool is_batched_multi_stmt_split_on,
|
||||
const bool is_normal_ps_prepare,
|
||||
const bool no_throw_parser_error)
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
@ -979,7 +978,6 @@ int ObParser::parse(const ObString &query,
|
||||
parse_result.is_for_trigger_ = (TRIGGER_MODE == parse_mode);
|
||||
parse_result.is_dynamic_sql_ = (DYNAMIC_SQL_MODE == parse_mode);
|
||||
parse_result.is_dbms_sql_ = (DBMS_SQL_MODE == parse_mode);
|
||||
parse_result.is_normal_ps_prepare_ = is_normal_ps_prepare;
|
||||
parse_result.is_batched_multi_enabled_split_ = is_batched_multi_stmt_split_on;
|
||||
parse_result.is_not_utf8_connection_ = ObCharset::is_valid_collation(connection_collation_) ?
|
||||
(ObCharset::charset_type_by_coll(connection_collation_) != CHARSET_UTF8MB4) : false;
|
||||
@ -1008,7 +1006,7 @@ int ObParser::parse(const ObString &query,
|
||||
}
|
||||
}
|
||||
|
||||
if (parse_result.is_fp_ || parse_result.is_dynamic_sql_ || parse_result.is_normal_ps_prepare_) {
|
||||
if (parse_result.is_fp_ || parse_result.is_dynamic_sql_) {
|
||||
int64_t new_length = parse_result.is_fp_ ? stmt.length() + 1 : stmt.length() * 2;
|
||||
char *buf = (char *)parse_malloc(new_length, parse_result.malloc_pool_);
|
||||
if (OB_UNLIKELY(NULL == buf)) {
|
||||
|
||||
@ -85,7 +85,6 @@ public:
|
||||
ParseResult &parse_result,
|
||||
ParseMode mode=STD_MODE,
|
||||
const bool is_batched_multi_stmt_split_on = false,
|
||||
const bool is_normal_ps_prepare = false,
|
||||
const bool no_throw_parser_error = false);
|
||||
|
||||
virtual void free_result(ParseResult &parse_result);
|
||||
|
||||
@ -332,8 +332,8 @@ do {
|
||||
do { \
|
||||
if (NULL == result) { \
|
||||
YY_UNEXPECTED_ERROR("invalid var node\n"); \
|
||||
} else if ((result->pl_parse_info_.is_pl_parse_ && NULL == result->pl_parse_info_.pl_ns_) || \
|
||||
result->is_dynamic_sql_) { \
|
||||
} else if ((result->pl_parse_info_.is_pl_parse_ && NULL == result->pl_parse_info_.pl_ns_) \
|
||||
|| result->is_dynamic_sql_) { \
|
||||
if (result->no_param_sql_len_ + (start - result->pl_parse_info_.last_pl_symbol_pos_ - 1) \
|
||||
+ (int)(log10(idx)) + 3 \
|
||||
> result->no_param_sql_buf_len_) { \
|
||||
|
||||
@ -912,7 +912,6 @@ Timestamp{whitespace}?\"[^\"]*\" {
|
||||
}
|
||||
}
|
||||
}
|
||||
<hint>HOTSPOT { return HOTSPOT; }
|
||||
<hint>LOG_LEVEL { return LOG_LEVEL; }
|
||||
<hint>LEADING { return LEADING_HINT; }
|
||||
<hint>ORDERED { return ORDERED; }
|
||||
@ -942,6 +941,7 @@ Timestamp{whitespace}?\"[^\"]*\" {
|
||||
<hint>END_OUTLINE_DATA { return END_OUTLINE_DATA; }
|
||||
<hint>OPTIMIZER_FEATURES_ENABLE { return OPTIMIZER_FEATURES_ENABLE; }
|
||||
<hint>NO_QUERY_TRANSFORMATION { return NO_QUERY_TRANSFORMATION; }
|
||||
<hint>NO_COST_BASED_QUERY_TRANSFORMATION { return NO_COST_BASED_QUERY_TRANSFORMATION; }
|
||||
<hint>TRANS_PARAM { return TRANS_PARAM; }
|
||||
<hint>PQ_DISTRIBUTE { return PQ_DISTRIBUTE; }
|
||||
<hint>PQ_DISTRIBUTE_WINDOW { return PQ_DISTRIBUTE_WINDOW; }
|
||||
|
||||
@ -149,10 +149,10 @@ extern void obsql_oracle_parse_fatal_error(int32_t errcode, yyscan_t yyscanner,
|
||||
// hint structure
|
||||
BEGIN_OUTLINE_DATA END_OUTLINE_DATA OPTIMIZER_FEATURES_ENABLE QB_NAME
|
||||
// global hint
|
||||
FROZEN_VERSION TOPK QUERY_TIMEOUT READ_CONSISTENCY HOTSPOT LOG_LEVEL USE_PLAN_CACHE
|
||||
FROZEN_VERSION TOPK QUERY_TIMEOUT READ_CONSISTENCY LOG_LEVEL USE_PLAN_CACHE
|
||||
TRACE_LOG LOAD_BATCH_SIZE TRANS_PARAM OPT_PARAM OB_DDL_SCHEMA_VERSION FORCE_REFRESH_LOCATION_CACHE
|
||||
DISABLE_PARALLEL_DML ENABLE_PARALLEL_DML MONITOR NO_PARALLEL CURSOR_SHARING_EXACT
|
||||
MAX_CONCURRENT DOP TRACING NO_QUERY_TRANSFORMATION
|
||||
MAX_CONCURRENT DOP TRACING NO_QUERY_TRANSFORMATION NO_COST_BASED_QUERY_TRANSFORMATION
|
||||
// transform hint
|
||||
NO_REWRITE MERGE_HINT NO_MERGE_HINT NO_EXPAND USE_CONCAT UNNEST NO_UNNEST
|
||||
PLACE_GROUP_BY NO_PLACE_GROUP_BY INLINE MATERIALIZE SEMI_TO_INNER NO_SEMI_TO_INNER
|
||||
@ -8081,10 +8081,6 @@ READ_CONSISTENCY '(' consistency_level ')'
|
||||
{
|
||||
malloc_non_terminal_node($$, result->malloc_pool_, T_TOPK, 2, $3, $4);
|
||||
}
|
||||
| HOTSPOT
|
||||
{
|
||||
malloc_terminal_node($$, result->malloc_pool_, T_HOTSPOT);
|
||||
}
|
||||
| LOG_LEVEL '(' NAME_OB ')'
|
||||
{
|
||||
malloc_non_terminal_node($$, result->malloc_pool_, T_LOG_LEVEL, 1, $3);
|
||||
@ -8173,6 +8169,10 @@ READ_CONSISTENCY '(' consistency_level ')'
|
||||
{
|
||||
malloc_terminal_node($$, result->malloc_pool_, T_NO_QUERY_TRANSFORMATION);
|
||||
}
|
||||
| NO_COST_BASED_QUERY_TRANSFORMATION
|
||||
{
|
||||
malloc_terminal_node($$, result->malloc_pool_, T_NO_COST_BASED_QUERY_TRANSFORMATION);
|
||||
}
|
||||
;
|
||||
|
||||
transform_hint:
|
||||
|
||||
Reference in New Issue
Block a user