Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
oceanbase
oceanbase
提交
4a61aa99
O
oceanbase
项目概览
oceanbase
/
oceanbase
10 个月 前同步成功
通知
261
Star
6084
Fork
1301
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
oceanbase
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
4a61aa99
编写于
12月 15, 2021
作者:
Y
yishenglanlingzui
提交者:
LINGuanRen
12月 15, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix bug multi_insert_up cause an incorrect result
上级
0dc88201
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
17 addition
and
0 deletion
+17
-0
src/sql/optimizer/ob_log_insert.cpp
src/sql/optimizer/ob_log_insert.cpp
+17
-0
未找到文件。
src/sql/optimizer/ob_log_insert.cpp
浏览文件 @
4a61aa99
...
@@ -772,6 +772,23 @@ int ObLogInsert::need_multi_table_dml(AllocExchContext& ctx, ObShardingInfo& sha
...
@@ -772,6 +772,23 @@ int ObLogInsert::need_multi_table_dml(AllocExchContext& ctx, ObShardingInfo& sha
}
}
}
}
if
(
OB_SUCC
(
ret
)
&&
get_insert_up
()
&&
is_needed
)
{
// multi insert on duplicate key At present, the static engine has a correctness problem,
// and the old engine is no problem. Currently, it will fall back to the old engine for execution.
// create table t1(c1 int primary key, c2 int auto_increment) partition by key(c1) partitions 2;
// create table t2(c1 int, c2 int) partition by key(c1) partitions 3;
// insert into t2 values('1',1000),('1',-100), (1, -300),('1',-200);
// insert into t1 select t2.c1, t2.c2 from t2 on duplicate key update t1.c2 = t1.c2 + t2.c2;
ObSQLSessionInfo
*
session
=
NULL
;
if
(
OB_ISNULL
(
session
=
get_plan
()
->
get_optimizer_context
().
get_session_info
()))
{
ret
=
OB_INVALID_ARGUMENT
;
LOG_WARN
(
"session is null"
,
K
(
ret
));
}
else
if
(
session
->
use_static_typing_engine
())
{
ret
=
STATIC_ENG_NOT_IMPLEMENT
;
LOG_WARN
(
"multi part insert up have some bug, must use old sql engine"
,
K
(
ret
),
K
(
is_needed
));
}
}
if
(
OB_SUCC
(
ret
))
{
if
(
OB_SUCC
(
ret
))
{
LOG_TRACE
(
"succeed to check whether need multi-table dml for insert operator"
,
LOG_TRACE
(
"succeed to check whether need multi-table dml for insert operator"
,
K
(
is_match
),
K
(
is_match
),
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录