Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
大炮V587
oceanbase
提交
26e1fb4b
O
oceanbase
项目概览
大炮V587
/
oceanbase
与 Fork 源项目一致
Fork自
oceanbase / oceanbase
通知
1
Star
0
Fork
0
代码
文件
提交
分支
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,发现更多精彩内容 >>
提交
26e1fb4b
编写于
3月 14, 2023
作者:
L
Larry955
提交者:
ob-robot
3月 14, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[CP] fix query range bug when both contain row and in exprs
上级
91a52683
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
13 addition
and
3 deletion
+13
-3
src/sql/rewrite/ob_query_range.cpp
src/sql/rewrite/ob_query_range.cpp
+13
-3
未找到文件。
src/sql/rewrite/ob_query_range.cpp
浏览文件 @
26e1fb4b
...
...
@@ -1926,7 +1926,6 @@ int ObQueryRange::get_row_key_part(const ObRawExpr *l_expr,
}
else
{
bool
row_is_precise
=
true
;
if
(
T_OP_EQ
!=
cmp_type
)
{
contain_row_
=
true
;
row_is_precise
=
false
;
}
ObKeyPartList
key_part_list
;
...
...
@@ -1960,6 +1959,7 @@ int ObQueryRange::get_row_key_part(const ObRawExpr *l_expr,
ObArenaAllocator
alloc
;
ObExprResType
res_type
(
alloc
);
ObKeyPart
*
tmp_key_part
=
NULL
;
int64_t
normal_key_cnt
=
0
;
for
(
int
i
=
0
;
OB_SUCC
(
ret
)
&&
!
b_flag
&&
i
<
num
;
++
i
)
{
res_type
.
set_calc_meta
(
result_type
.
get_row_calc_cmp_types
().
at
(
i
));
tmp_key_part
=
NULL
;
...
...
@@ -2004,6 +2004,7 @@ int ObQueryRange::get_row_key_part(const ObRawExpr *l_expr,
out_key_part
=
tmp_key_part
;
}
row_tail
=
tmp_key_part
;
normal_key_cnt
+=
(
tmp_key_part
->
is_always_true
()
?
0
:
1
);
}
}
if
(
OB_SUCC
(
ret
))
{
...
...
@@ -2011,12 +2012,17 @@ int ObQueryRange::get_row_key_part(const ObRawExpr *l_expr,
GET_ALWAYS_TRUE_OR_FALSE
(
true
,
out_key_part
);
}
if
(
OB_FAIL
(
ret
))
{
}
else
if
(
out_key_part
->
is_always_true
()
||
out_key_part
->
is_always_false
()
)
{
contain_row_
=
false
;
}
else
if
(
out_key_part
->
is_always_true
()
||
out_key_part
->
is_always_false
()
||
(
normal_key_cnt
<=
1
&&
T_OP_EQ
!=
cmp_type
))
{
query_range_ctx_
->
cur_expr_is_precise_
=
false
;
}
else
{
if
(
!
contain_row_
&&
T_OP_EQ
!=
cmp_type
)
{
contain_row_
=
true
;
}
query_range_ctx_
->
cur_expr_is_precise_
=
row_is_precise
;
}
LOG_TRACE
(
"succeed to get row key part"
,
K
(
contain_row_
),
K
(
b_flag
),
K
(
row_is_precise
),
K
(
normal_key_cnt
),
K
(
*
out_key_part
));
}
}
return
ret
;
...
...
@@ -4275,6 +4281,10 @@ int ObQueryRange::do_row_gt_and(ObKeyPart *l_gt, ObKeyPart *r_gt, ObKeyPart *&r
res_gt
=
r_gt
;
}
else
if
(
NULL
==
r_gt
)
{
res_gt
=
l_gt
;
}
else
if
(
l_gt
->
is_in_key
()
&&
r_gt
->
is_in_key
())
{
res_gt
=
l_gt
->
in_keypart_
->
get_min_offset
()
<=
r_gt
->
in_keypart_
->
get_min_offset
()
?
l_gt
:
r_gt
;
// if in key do and with normal key here,
// the result is in key
}
else
if
(
l_gt
->
pos_
.
offset_
<
r_gt
->
pos_
.
offset_
)
{
res_gt
=
l_gt
;
//两个向量做and,右边向量前缀缺失,直接用左边向量的结果
}
else
if
(
r_gt
->
pos_
.
offset_
<
l_gt
->
pos_
.
offset_
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录