Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
4df4b2d1
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看板
未验证
提交
4df4b2d1
编写于
6月 17, 2022
作者:
wafwerar
提交者:
GitHub
6月 17, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #13934 from taosdata/fix/ZhiqiangWang/TD-16357-fix-sim-udf-test-error
test: fix sim udf test error
上级
c556e5f2
105a6e08
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
44 addition
and
5 deletion
+44
-5
source/dnode/mnode/impl/src/mndDnode.c
source/dnode/mnode/impl/src/mndDnode.c
+2
-1
source/util/src/tenv.c
source/util/src/tenv.c
+3
-0
tests/script/sh/copy_udf.bat
tests/script/sh/copy_udf.bat
+23
-0
tests/script/tsim/query/udf.sim
tests/script/tsim/query/udf.sim
+8
-2
tests/tsim/src/simExe.c
tests/tsim/src/simExe.c
+7
-1
tests/tsim/src/simParse.c
tests/tsim/src/simParse.c
+1
-1
未找到文件。
source/dnode/mnode/impl/src/mndDnode.c
浏览文件 @
4df4b2d1
...
...
@@ -761,11 +761,12 @@ static int32_t mndRetrieveDnodes(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pB
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataAppend
(
pColInfo
,
numOfRows
,
(
const
char
*
)
&
pDnode
->
createdTime
,
false
);
char
b
[
tListLen
(
offlineReason
)
+
VARSTR_HEADER_SIZE
]
=
{
0
}
;
char
*
b
=
taosMemoryCalloc
(
VARSTR_HEADER_SIZE
+
strlen
(
offlineReason
[
pDnode
->
offlineReason
])
+
1
,
1
)
;
STR_TO_VARSTR
(
b
,
online
?
""
:
offlineReason
[
pDnode
->
offlineReason
]);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataAppend
(
pColInfo
,
numOfRows
,
b
,
false
);
taosMemoryFreeClear
(
b
);
numOfRows
++
;
sdbRelease
(
pSdb
,
pDnode
);
...
...
source/util/src/tenv.c
浏览文件 @
4df4b2d1
...
...
@@ -72,6 +72,9 @@ int32_t taosEnvToCfg(const char *envStr, char *cfgStr) {
if
(
cfgNameLen
>
0
)
{
memcpy
(
cfgStr
,
buf
,
cfgNameLen
);
memset
(
&
cfgStr
[
cfgNameLen
],
' '
,
p
-
cfgStr
-
cfgNameLen
+
1
);
}
else
{
*
cfgStr
=
'\0'
;
return
-
1
;
}
}
return
strlen
(
cfgStr
);
...
...
tests/script/sh/copy_udf.bat
0 → 100644
浏览文件 @
4df4b2d1
@echo
off
echo
Executing
copy_udf
.bat
set
SCRIPT_DIR
=
%cd%
echo
SCRIPT_DIR
:
%SCRIPT_DIR%
cd
..\..\..
set
TAOS_DIR
=
%cd%
echo
find
udf
library
in
%TAOS_DIR%
set
UDF1_DIR
=
%TAOS_DIR%
\debug\build\lib\udf1.dll
set
UDF2_DIR
=
%TAOS_DIR%
\debug\build\lib\udf2.dll
echo
%UDF1
_DIR
%
echo
%UDF2
_DIR
%
set
UDF_TMP
=
C
:\Windows\Temp\udf
rm
-rf
%UDF_TMP%
mkdir
%UDF_TMP%
echo
Copy
udf
shared
library
files
to
%UDF_TMP%
cp
%UDF1
_DIR
%
%UDF_TMP%
cp
%UDF2
_DIR
%
%UDF_TMP%
tests/script/tsim/query/udf.sim
浏览文件 @
4df4b2d1
...
...
@@ -19,8 +19,14 @@ sql show databases;
sql create table t (ts timestamp, f int);
sql insert into t values(now, 1)(now+1s, 2);
sql create function udf1 as '/tmp/udf/libudf1.so' outputtype int bufSize 8;
sql create aggregate function udf2 as '/tmp/udf/libudf2.so' outputtype double bufSize 8;
system_content printf %OS%
if $system_content == Windows_NT then
sql create function udf1 as 'C:\\Windows\\Temp\\udf1.dll' outputtype int bufSize 8;
sql create aggregate function udf2 as 'C:\\Windows\\Temp\\udf2.dll' outputtype double bufSize 8;
else
sql create function udf1 as '/tmp/udf/libudf1.so' outputtype int bufSize 8;
sql create aggregate function udf2 as '/tmp/udf/libudf2.so' outputtype double bufSize 8;
endi
sql show functions;
if $rows != 2 then
return -1
...
...
tests/tsim/src/simExe.c
浏览文件 @
4df4b2d1
...
...
@@ -458,11 +458,17 @@ bool simExecuteSystemContentCmd(SScript *script, char *option) {
char
buf
[
4096
]
=
{
0
};
char
buf1
[
4096
+
512
]
=
{
0
};
char
filename
[
400
]
=
{
0
};
sprintf
(
filename
,
"%s
/
%s.tmp"
,
simScriptDir
,
script
->
fileName
);
sprintf
(
filename
,
"%s
"
TD_DIRSEP
"
%s.tmp"
,
simScriptDir
,
script
->
fileName
);
#ifdef WINDOWS
sprintf
(
buf
,
"cd %s && "
,
simScriptDir
);
simVisuallizeOption
(
script
,
option
,
buf
+
strlen
(
buf
));
sprintf
(
buf1
,
"%s > %s 2>nul"
,
buf
,
filename
);
#else
sprintf
(
buf
,
"cd %s; "
,
simScriptDir
);
simVisuallizeOption
(
script
,
option
,
buf
+
strlen
(
buf
));
sprintf
(
buf1
,
"%s > %s 2>/dev/null"
,
buf
,
filename
);
#endif
sprintf
(
script
->
system_exit_code
,
"%d"
,
system
(
buf1
));
simStoreSystemContentResult
(
script
,
filename
);
...
...
tests/tsim/src/simParse.c
浏览文件 @
4df4b2d1
...
...
@@ -206,7 +206,7 @@ SScript *simParseScript(char *fileName) {
for
(
int32_t
i
=
0
;
i
<
cmdlen
;
++
i
)
{
if
(
buffer
[
i
]
==
'\r'
||
buffer
[
i
]
==
'\n'
)
{
buffer
[
i
]
=
'
'
;
buffer
[
i
]
=
'
\0
'
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录