Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
soremi
oceanbase
提交
a43efe37
O
oceanbase
项目概览
soremi
/
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,发现更多精彩内容 >>
提交
a43efe37
编写于
8月 22, 2022
作者:
W
wangt1xiuyi
提交者:
wangyunlai.wyl
8月 23, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[CP] regexp use const pattern uncorrectly in non-static engine
上级
9e838563
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
35 addition
and
1 deletion
+35
-1
src/sql/code_generator/ob_expr_generator_impl.cpp
src/sql/code_generator/ob_expr_generator_impl.cpp
+3
-1
tools/deploy/mysql_test/test_suite/expr/r/mysql/func_regexp.result
...loy/mysql_test/test_suite/expr/r/mysql/func_regexp.result
+15
-0
tools/deploy/mysql_test/test_suite/expr/t/func_regexp.test
tools/deploy/mysql_test/test_suite/expr/t/func_regexp.test
+17
-0
未找到文件。
src/sql/code_generator/ob_expr_generator_impl.cpp
浏览文件 @
a43efe37
...
@@ -597,9 +597,11 @@ inline int ObExprGeneratorImpl::visit_regex_expr(ObOpRawExpr& expr, ObExprRegexp
...
@@ -597,9 +597,11 @@ inline int ObExprGeneratorImpl::visit_regex_expr(ObOpRawExpr& expr, ObExprRegexp
}
else
{
}
else
{
// The value && pattern are const, it is calculated in pre_calculate
// The value && pattern are const, it is calculated in pre_calculate
regexp_op
->
set_value_is_const
(
value_expr
->
has_flag
(
IS_CONST
)
||
value_expr
->
has_flag
(
IS_CONST_EXPR
));
regexp_op
->
set_value_is_const
(
value_expr
->
has_flag
(
IS_CONST
)
||
value_expr
->
has_flag
(
IS_CONST_EXPR
));
if
(
!
pattern_expr
->
has_flag
(
CNT_EXEC_PARAM
))
{
regexp_op
->
set_pattern_is_const
(
pattern_expr
->
has_flag
(
IS_CONST
)
||
pattern_expr
->
has_flag
(
IS_CONST_EXPR
));
regexp_op
->
set_pattern_is_const
(
pattern_expr
->
has_flag
(
IS_CONST
)
||
pattern_expr
->
has_flag
(
IS_CONST_EXPR
));
}
}
}
}
}
return
ret
;
return
ret
;
}
}
...
...
tools/deploy/mysql_test/test_suite/expr/r/mysql/func_regexp.result
浏览文件 @
a43efe37
...
@@ -6287,3 +6287,18 @@ insert into t values ('');
...
@@ -6287,3 +6287,18 @@ insert into t values ('');
select c1 regexp 'ddd' from t;
select c1 regexp 'ddd' from t;
c1 regexp 'ddd'
c1 regexp 'ddd'
0
0
drop table if exists t1, t2;
create table t1(c1 int, c2 varchar(10));
insert into t1 values(1, '1');
create table t2(c1 int);
insert into t2 values(1), (2);
select t2.*, (select t1.c1 from t1 where t1.c2 REGEXP t2.c1 limit 1 ) from t2;
c1 (select t1.c1 from t1 where t1.c2 REGEXP t2.c1 limit 1 )
1 1
2 NULL
select t2.*, (select t1.c1 from t1 where t1.c2 REGEXP t2.c1+1-1 limit 1 ) from t2;
c1 (select t1.c1 from t1 where t1.c2 REGEXP t2.c1+1-1 limit 1 )
1 1
2 NULL
drop table t1;
drop table t2;
tools/deploy/mysql_test/test_suite/expr/t/func_regexp.test
浏览文件 @
a43efe37
...
@@ -442,3 +442,20 @@ drop table if exists t;
...
@@ -442,3 +442,20 @@ drop table if exists t;
create
table
t
(
c1
char
(
20
));
create
table
t
(
c1
char
(
20
));
insert
into
t
values
(
''
);
insert
into
t
values
(
''
);
select
c1
regexp
'ddd'
from
t
;
select
c1
regexp
'ddd'
from
t
;
##bug:https://work.aone.alibaba-inc.com/issue/43976234
--
disable_warnings
drop
table
if
exists
t1
,
t2
;
--
enable_warnings
create
table
t1
(
c1
int
,
c2
varchar
(
10
));
insert
into
t1
values
(
1
,
'1'
);
create
table
t2
(
c1
int
);
insert
into
t2
values
(
1
),
(
2
);
select
t2
.
*
,
(
select
t1
.
c1
from
t1
where
t1
.
c2
REGEXP
t2
.
c1
limit
1
)
from
t2
;
select
t2
.
*
,
(
select
t1
.
c1
from
t1
where
t1
.
c2
REGEXP
t2
.
c1
+
1
-
1
limit
1
)
from
t2
;
drop
table
t1
;
drop
table
t2
;
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录