Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
c12fb5e5
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
c12fb5e5
编写于
9月 01, 2021
作者:
D
dapan1121
提交者:
GitHub
9月 01, 2021
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #7735 from taosdata/enchance/TD-5466
[TD-5466]<enhance> enhance like pattern
上级
11c964e6
350c22c8
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
30 addition
and
10 deletion
+30
-10
src/client/src/tscSQLParser.c
src/client/src/tscSQLParser.c
+13
-2
src/kit/shell/src/shellEngine.c
src/kit/shell/src/shellEngine.c
+6
-2
src/util/src/tcompare.c
src/util/src/tcompare.c
+1
-0
src/util/src/tsocket.c
src/util/src/tsocket.c
+1
-1
src/util/src/tutil.c
src/util/src/tutil.c
+8
-5
tests/script/fullGeneralSuite.sim
tests/script/fullGeneralSuite.sim
+1
-0
未找到文件。
src/client/src/tscSQLParser.c
浏览文件 @
c12fb5e5
...
...
@@ -430,6 +430,7 @@ int32_t handleUserDefinedFunc(SSqlObj* pSql, struct SSqlInfo* pInfo) {
const
char
*
msg2
=
"path is too long"
;
const
char
*
msg3
=
"invalid outputtype"
;
const
char
*
msg4
=
"invalid script"
;
const
char
*
msg5
=
"invalid dyn lib"
;
SSqlCmd
*
pCmd
=
&
pSql
->
cmd
;
switch
(
pInfo
->
type
)
{
...
...
@@ -443,6 +444,10 @@ int32_t handleUserDefinedFunc(SSqlObj* pSql, struct SSqlInfo* pInfo) {
}
createInfo
->
name
.
z
[
createInfo
->
name
.
n
]
=
0
;
// funcname's naming rule is same to column
if
(
validateColumnName
(
createInfo
->
name
.
z
)
!=
TSDB_CODE_SUCCESS
)
{
return
invalidOperationMsg
(
tscGetErrorMsgPayload
(
pCmd
),
msg1
);
}
strdequote
(
createInfo
->
name
.
z
);
...
...
@@ -462,10 +467,16 @@ int32_t handleUserDefinedFunc(SSqlObj* pSql, struct SSqlInfo* pInfo) {
if
(
ret
)
{
return
ret
;
}
//
distinguish *.lua and *
.so
//
validate *.lua or
.so
int32_t
pathLen
=
(
int32_t
)
strlen
(
createInfo
->
path
.
z
);
if
((
pathLen
>
3
)
&&
(
0
==
strncmp
(
createInfo
->
path
.
z
+
pathLen
-
3
,
"lua"
,
3
))
&&
!
isValidScript
(
buf
,
len
))
{
if
((
pathLen
>
4
)
&&
(
0
==
strncmp
(
createInfo
->
path
.
z
+
pathLen
-
4
,
".lua"
,
4
))
&&
!
isValidScript
(
buf
,
len
))
{
return
invalidOperationMsg
(
tscGetErrorMsgPayload
(
pCmd
),
msg4
);
}
else
if
(
pathLen
>
3
&&
(
0
==
strncmp
(
createInfo
->
path
.
z
+
pathLen
-
3
,
".so"
,
3
)))
{
void
*
handle
=
taosLoadDll
(
createInfo
->
path
.
z
);
taosCloseDll
(
handle
);
if
(
handle
==
NULL
)
{
return
invalidOperationMsg
(
tscGetErrorMsgPayload
(
pCmd
),
msg5
);
}
}
//TODO CHECK CODE
...
...
src/kit/shell/src/shellEngine.c
浏览文件 @
c12fb5e5
...
...
@@ -255,8 +255,12 @@ int32_t shellRunCommand(TAOS* con, char* command) {
}
if
(
c
==
'\\'
)
{
esc
=
true
;
continue
;
if
(
quote
!=
0
&&
(
*
command
==
'_'
||
*
command
==
'\\'
))
{
//DO nothing
}
else
{
esc
=
true
;
continue
;
}
}
if
(
quote
==
c
)
{
...
...
src/util/src/tcompare.c
浏览文件 @
c12fb5e5
...
...
@@ -262,6 +262,7 @@ int patternMatch(const char *patterStr, const char *str, size_t size, const SPat
c1
=
str
[
j
++
];
if
(
j
<=
size
)
{
if
(
c
==
'\\'
&&
patterStr
[
i
]
==
'_'
&&
c1
==
'_'
)
{
i
++
;
continue
;
}
if
(
c
==
c1
||
tolower
(
c
)
==
tolower
(
c1
)
||
(
c
==
pInfo
->
matchOne
&&
c1
!=
0
))
{
continue
;
}
...
...
src/util/src/tsocket.c
浏览文件 @
c12fb5e5
...
...
@@ -488,7 +488,7 @@ SOCKET taosOpenTcpServerSocket(uint32_t ip, uint16_t port) {
return
-
1
;
}
if
(
listen
(
sockFd
,
10
)
<
0
)
{
if
(
listen
(
sockFd
,
10
24
)
<
0
)
{
uError
(
"listen tcp server socket failed, 0x%x:%hu(%s)"
,
ip
,
port
,
strerror
(
errno
));
taosCloseSocket
(
sockFd
);
return
-
1
;
...
...
src/util/src/tutil.c
浏览文件 @
c12fb5e5
...
...
@@ -64,12 +64,15 @@ int32_t strRmquote(char *z, int32_t len){
int32_t
j
=
0
;
for
(
uint32_t
k
=
1
;
k
<
len
-
1
;
++
k
)
{
if
(
z
[
k
]
==
'\\'
||
(
z
[
k
]
==
delim
&&
z
[
k
+
1
]
==
delim
))
{
if
(
z
[
k
]
==
'\\'
&&
z
[
k
+
1
]
==
'_'
)
{
//match '_' self
}
else
{
z
[
j
]
=
z
[
k
+
1
];
cnt
++
;
j
++
;
k
++
;
continue
;
cnt
++
;
j
++
;
k
++
;
continue
;
}
}
z
[
j
]
=
z
[
k
];
...
...
tests/script/fullGeneralSuite.sim
浏览文件 @
c12fb5e5
...
...
@@ -221,3 +221,4 @@ run general/stream/table_replica1_vnoden.sim
run general/stream/metrics_replica1_vnoden.sim
run general/db/show_create_db.sim
run general/db/show_create_table.sim
run general/parser/like.sim
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录