Compatible with MySQL's auto_increment jump behavior for values statement
This commit is contained in:
@ -4437,6 +4437,8 @@ int ObSql::after_get_plan(ObPlanCacheCtx &pc_ctx,
|
||||
param.autoinc_offset_ = session.get_local_auto_increment_offset();
|
||||
if (pc_ctx.sql_ctx_.is_do_insert_batch_opt()) {
|
||||
param.total_value_count_ = pc_ctx.sql_ctx_.get_insert_batch_row_cnt();
|
||||
} else if (phy_plan->is_plain_insert() && pctx->get_array_param_groups().count() == 1) {
|
||||
param.total_value_count_ = pctx->get_array_param_groups().at(0).row_count_;
|
||||
}
|
||||
} // end for
|
||||
}
|
||||
|
||||
@ -8101,7 +8101,12 @@ int ObResolverUtils::handle_varchar_charset(ObCharsetType charset_type,
|
||||
if ((T_HEX_STRING == node->type_ || T_VARCHAR == node->type_)
|
||||
&& CHARSET_INVALID != charset_type) {
|
||||
ParseNode *charset_node = new_node(&allocator, T_CHARSET, 0);
|
||||
ParseNode *varchar_node = new_non_terminal_node(&allocator, T_VARCHAR, 2, charset_node, node);
|
||||
ParseNode *varchar_node = NULL;
|
||||
if (T_HEX_STRING == node->type_) {
|
||||
varchar_node = new_non_terminal_node(&allocator, T_VARCHAR, 1, charset_node);
|
||||
} else if (T_VARCHAR == node->type_) {
|
||||
varchar_node = new_non_terminal_node(&allocator, T_VARCHAR, 2, charset_node, node);
|
||||
}
|
||||
|
||||
if (OB_ISNULL(charset_node) || OB_ISNULL(varchar_node)) {
|
||||
ret = OB_ALLOCATE_MEMORY_FAILED;
|
||||
|
||||
Reference in New Issue
Block a user