Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
6363169a
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
6363169a
编写于
9月 01, 2021
作者:
S
Shenglian Zhou
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[TD-6145]<feature>:add test for regex filter
上级
28f2f0d7
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
55 addition
and
3 deletion
+55
-3
src/client/src/tscSQLParser.c
src/client/src/tscSQLParser.c
+1
-1
src/tsdb/src/tsdbRead.c
src/tsdb/src/tsdbRead.c
+1
-1
src/util/src/tcompare.c
src/util/src/tcompare.c
+1
-1
tests/script/fullGeneralSuite.sim
tests/script/fullGeneralSuite.sim
+1
-0
tests/script/general/parser/regex.sim
tests/script/general/parser/regex.sim
+51
-0
未找到文件。
src/client/src/tscSQLParser.c
浏览文件 @
6363169a
...
@@ -4525,7 +4525,7 @@ static int32_t validateMatchExpr(tSqlExpr* pExpr, STableMeta* pTableMeta, int32_
...
@@ -4525,7 +4525,7 @@ static int32_t validateMatchExpr(tSqlExpr* pExpr, STableMeta* pTableMeta, int32_
char
regErrBuf
[
256
]
=
{
0
};
char
regErrBuf
[
256
]
=
{
0
};
const
char
*
pattern
=
pRight
->
value
.
pz
;
const
char
*
pattern
=
pRight
->
value
.
pz
;
int
cflags
=
REG_EXTENDED
|
REG_ICASE
;
int
cflags
=
REG_EXTENDED
;
if
((
errCode
=
regcomp
(
&
regex
,
pattern
,
cflags
))
!=
0
)
{
if
((
errCode
=
regcomp
(
&
regex
,
pattern
,
cflags
))
!=
0
)
{
regerror
(
errCode
,
&
regex
,
regErrBuf
,
sizeof
(
regErrBuf
));
regerror
(
errCode
,
&
regex
,
regErrBuf
,
sizeof
(
regErrBuf
));
tscError
(
"Failed to compile regex pattern %s. reason %s"
,
pattern
,
regErrBuf
);
tscError
(
"Failed to compile regex pattern %s. reason %s"
,
pattern
,
regErrBuf
);
...
...
src/tsdb/src/tsdbRead.c
浏览文件 @
6363169a
...
@@ -4236,7 +4236,7 @@ void getTableListfromSkipList(tExprNode *pExpr, SSkipList *pSkipList, SArray *re
...
@@ -4236,7 +4236,7 @@ void getTableListfromSkipList(tExprNode *pExpr, SSkipList *pSkipList, SArray *re
param
->
setupInfoFn
(
pExpr
,
param
->
pExtInfo
);
param
->
setupInfoFn
(
pExpr
,
param
->
pExtInfo
);
tQueryInfo
*
pQueryInfo
=
pExpr
->
_node
.
info
;
tQueryInfo
*
pQueryInfo
=
pExpr
->
_node
.
info
;
if
(
pQueryInfo
->
indexed
&&
(
pQueryInfo
->
optr
!=
TSDB_RELATION_LIKE
&&
pQueryInfo
->
optr
=
=
TSDB_RELATION_MATCH
if
(
pQueryInfo
->
indexed
&&
(
pQueryInfo
->
optr
!=
TSDB_RELATION_LIKE
&&
pQueryInfo
->
optr
!
=
TSDB_RELATION_MATCH
&&
pQueryInfo
->
optr
!=
TSDB_RELATION_IN
))
{
&&
pQueryInfo
->
optr
!=
TSDB_RELATION_IN
))
{
queryIndexedColumn
(
pSkipList
,
pQueryInfo
,
result
);
queryIndexedColumn
(
pSkipList
,
pQueryInfo
,
result
);
}
else
{
}
else
{
...
...
src/util/src/tcompare.c
浏览文件 @
6363169a
...
@@ -365,7 +365,7 @@ int32_t compareStrRegexComp(const void* pLeft, const void* pRight) {
...
@@ -365,7 +365,7 @@ int32_t compareStrRegexComp(const void* pLeft, const void* pRight) {
regex_t
regex
;
regex_t
regex
;
char
msgbuf
[
256
]
=
{
0
};
char
msgbuf
[
256
]
=
{
0
};
int
cflags
=
REG_EXTENDED
|
REG_ICASE
;
int
cflags
=
REG_EXTENDED
;
if
((
errCode
=
regcomp
(
&
regex
,
pattern
,
cflags
))
!=
0
)
{
if
((
errCode
=
regcomp
(
&
regex
,
pattern
,
cflags
))
!=
0
)
{
regerror
(
errCode
,
&
regex
,
msgbuf
,
sizeof
(
msgbuf
));
regerror
(
errCode
,
&
regex
,
msgbuf
,
sizeof
(
msgbuf
));
uError
(
"Failed to compile regex pattern %s. reason %s"
,
pattern
,
msgbuf
);
uError
(
"Failed to compile regex pattern %s. reason %s"
,
pattern
,
msgbuf
);
...
...
tests/script/fullGeneralSuite.sim
浏览文件 @
6363169a
...
@@ -222,3 +222,4 @@ run general/stream/metrics_replica1_vnoden.sim
...
@@ -222,3 +222,4 @@ run general/stream/metrics_replica1_vnoden.sim
run general/db/show_create_db.sim
run general/db/show_create_db.sim
run general/db/show_create_table.sim
run general/db/show_create_table.sim
run general/parser/like.sim
run general/parser/like.sim
run general/parser/regex.sim
tests/script/general/parser/regex.sim
0 → 100644
浏览文件 @
6363169a
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 4
system sh/exec.sh -n dnode1 -s start
sleep 100
sql connect
$db = testdb
sql drop database if exists $db
sql create database $db
sql use $db
print ======================== regular expression match test
$st_name = st
$ct1_name = ct1
$ct2_name = ct2
sql create table $st_name (ts timestamp, c1b binary(20)) tags(t1b binary(20));
sql create table $ct1_name using $st_name tags('taosdata1')
sql create table $ct2_name using $st_name tags('taosdata2')
sql create table not_match using $st_name tags('NOTMATCH')
sql select tbname from $st_name where tbname match '^ct[[:digit:]]'
if $rows != 2 then
return -1
endi
sql select tbname from $st_name where t1b match '[[:lower:]]+'
if $rows != 2 then
return -1
endi
sql insert into $ct1_name values(now, 'this is engine')
sql insert into $ct2_name values(now, 'this is app egnine')
sql select c1b from $st_name where c1b match 'engine'
if $data00 != @this is engine@ then
return -1
endi
if $rows != 1 then
return -1
endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录