[CP][to #37396440] fix dynamic sql question mark count
This commit is contained in:
		| @ -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)) { | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 obdev
					obdev