Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lihongda1002
oceanbase
提交
2146f1d1
O
oceanbase
项目概览
lihongda1002
/
oceanbase
与 Fork 源项目一致
Fork自
oceanbase / oceanbase
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
oceanbase
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
2146f1d1
编写于
6月 30, 2022
作者:
O
obdev
提交者:
linzhigang.lzg
7月 04, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[CP] fix bit type extract query range bug
上级
560dbb58
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
18 addition
and
7 deletion
+18
-7
src/sql/optimizer/ob_optimizer_util.cpp
src/sql/optimizer/ob_optimizer_util.cpp
+11
-0
src/sql/parser/sql_parser_mysql_mode.l
src/sql/parser/sql_parser_mysql_mode.l
+1
-1
src/sql/resolver/dml/ob_dml_resolver.cpp
src/sql/resolver/dml/ob_dml_resolver.cpp
+2
-2
src/sql/resolver/dml/ob_sql_hint.cpp
src/sql/resolver/dml/ob_sql_hint.cpp
+3
-0
src/sql/rewrite/ob_transform_join_elimination.cpp
src/sql/rewrite/ob_transform_join_elimination.cpp
+0
-3
src/sql/rewrite/ob_transform_outerjoin_limit_pushdown.cpp
src/sql/rewrite/ob_transform_outerjoin_limit_pushdown.cpp
+1
-1
未找到文件。
src/sql/optimizer/ob_optimizer_util.cpp
浏览文件 @
2146f1d1
...
...
@@ -4764,6 +4764,17 @@ int ObOptimizerUtil::is_lossless_column_cast(const ObRawExpr* expr, bool& is_los
is_lossless
=
true
;
}
}
}
else
if
(
ObBitTC
==
column_tc
)
{
if
(
ObNumberTC
==
dst_tc
)
{
const
double
log10_2
=
0.30103
;
ObAccuracy
lossless_acc
=
column_type
.
get_accuracy
();
if
(
dst_acc
.
get_scale
()
>=
0
&&
dst_acc
.
get_precision
()
-
dst_acc
.
get_scale
()
>=
lossless_acc
.
get_precision
()
*
log10_2
)
{
// log10(2) = 0.30102999566398114; log10(2^n) = n*log10(2);
// cast(b'111' as decimal(1,0)) is lossless
is_lossless
=
true
;
}
}
}
else
if
(
ObFloatTC
==
column_tc
||
ObDoubleTC
==
column_tc
)
{
if
(
ObDoubleTC
==
dst_tc
)
{
if
(
-
1
==
dst_acc
.
get_precision
()
&&
-
1
==
dst_acc
.
get_scale
())
{
...
...
src/sql/parser/sql_parser_mysql_mode.l
浏览文件 @
2146f1d1
...
...
@@ -1349,7 +1349,7 @@ BEGIN(in_c_comment);
// for 'select - -1 from dual'
// the first neg sign is not copied when it is parsed
// but when the second neg sign is parsed, the first neg sign must be put where is should be
if ('-' == yytext[0]) {
if ('-' == yytext[0]
&& IS_NEED_PARAMETERIZE
) {
REPUT_NEG_SIGN(p);
p->minus_ctx_.pos_ = p->no_param_sql_len_;
p->minus_ctx_.raw_sql_offset_ = yylloc->first_column - 1;
...
...
src/sql/resolver/dml/ob_dml_resolver.cpp
浏览文件 @
2146f1d1
...
...
@@ -5329,8 +5329,8 @@ int ObDMLResolver::parse_qb_in_rewrite_hint(const ParseNode* hint_node, common::
ret
=
OB_ERR_UNEXPECTED
;
LOG_WARN
(
"qb table name has no one children."
,
K
(
ret
));
}
else
if
(
OB_ISNULL
(
qb_table_name
->
children_
[
0
]))
{
ret
=
OB_ERR_UNEXPECTED
;
LOG_WARN
(
"qb table name has null children."
,
K
(
ret
))
;
// allowed use hint like USE_CONCAT()
type
=
hint_type
;
}
else
if
(
OB_FAIL
(
resolve_qb_name_node
(
qb_table_name
->
children_
[
0
],
qb_name
)))
{
LOG_WARN
(
"failed to resolve the rewrite hint."
,
K
(
ret
));
}
else
if
(
OB_FAIL
(
qb_names
.
push_back
(
qb_name
)))
{
...
...
src/sql/resolver/dml/ob_sql_hint.cpp
浏览文件 @
2146f1d1
...
...
@@ -1209,6 +1209,9 @@ int ObStmtHint::print_rewrite_hints_for_outline(planText& plan_text, const char*
for
(
int64_t
idx
=
0
;
OB_SUCC
(
ret
)
&&
idx
<
qb_names
.
count
();
++
idx
)
{
ObString
qb_name
=
qb_names
.
at
(
idx
);
if
(
OUTLINE_DATA
==
outline_type
&&
OB_FAIL
(
query_ctx
->
get_stmt_org_name
(
qb_name
,
origin_name
)))
{
// for invalid qb name, reset ret
// select /*+use_concat(@sel$5)*/ * from t1;
ret
=
OB_SUCCESS
;
}
else
if
(
USED_HINT
==
outline_type
&&
FALSE_IT
(
origin_name
=
qb_name
))
{
}
else
if
(
!
is_oneline
&&
OB_FAIL
(
BUF_PRINTF
(
"
\n
"
)))
{
}
else
if
(
OB_FAIL
(
BUF_PRINTF
(
get_outline_indent
(
is_oneline
))))
{
...
...
src/sql/rewrite/ob_transform_join_elimination.cpp
浏览文件 @
2146f1d1
...
...
@@ -694,9 +694,6 @@ int ObTransformJoinElimination::eliminate_outer_join(ObDMLStmt* stmt, bool& tran
LOG_WARN
(
"semi info is null"
,
K
(
ret
));
}
else
if
(
OB_FAIL
(
ObOptimizerUtil
::
remove_item
(
semi_infos
.
at
(
i
)
->
left_table_ids_
,
table_ids
)))
{
LOG_WARN
(
"failed to eliminate outer join in from items."
,
K
(
ret
));
}
else
if
(
OB_UNLIKELY
(
semi_infos
.
at
(
i
)
->
left_table_ids_
.
empty
()))
{
ret
=
OB_ERR_UNEXPECTED
;
LOG_WARN
(
"left_table_ids_ is empty"
,
K
(
ret
));
}
}
if
(
OB_FAIL
(
ret
))
{
...
...
src/sql/rewrite/ob_transform_outerjoin_limit_pushdown.cpp
浏览文件 @
2146f1d1
...
...
@@ -452,7 +452,7 @@ int ObTransformOuterJoinLimitPushDown::do_transform(OjLimitPushDownHelper& helpe
helper
.
view_table_
,
helper
.
extracted_conditions_
,
helper
.
saved_order_items_
,
!
helper
.
need_create_view
_
,
helper
.
need_rename
_
,
helper
.
is_limit_only_
)))
{
LOG_WARN
(
"failed to push down view table"
,
K
(
ret
));
}
else
{
/* do nothing */
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录