Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
c34c5353
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22017
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看板
提交
c34c5353
编写于
4月 20, 2023
作者:
A
Alex Duan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
test: add udf2_dup test case
上级
de76a02a
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
30 addition
and
0 deletion
+30
-0
source/libs/function/CMakeLists.txt
source/libs/function/CMakeLists.txt
+20
-0
tests/system-test/0-others/udf_create.py
tests/system-test/0-others/udf_create.py
+10
-0
未找到文件。
source/libs/function/CMakeLists.txt
浏览文件 @
c34c5353
...
...
@@ -119,6 +119,26 @@ target_link_libraries(
udf2 PUBLIC os
${
LINK_JEMALLOC
}
)
add_library
(
udf2_dup STATIC MODULE test/udf2_dup.c
)
target_include_directories
(
udf2_dup
PUBLIC
"
${
TD_SOURCE_DIR
}
/include/libs/function"
"
${
TD_SOURCE_DIR
}
/include/util"
"
${
TD_SOURCE_DIR
}
/include/common"
"
${
TD_SOURCE_DIR
}
/include/client"
"
${
TD_SOURCE_DIR
}
/include/os"
PRIVATE
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/inc"
)
IF
(
TD_LINUX_64 AND JEMALLOC_ENABLED
)
ADD_DEPENDENCIES
(
udf2_dup jemalloc
)
ENDIF
()
target_link_libraries
(
udf2_dup PUBLIC os
${
LINK_JEMALLOC
}
)
#SET(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/build/bin)
add_executable
(
udfd src/udfd.c
)
target_include_directories
(
...
...
tests/system-test/0-others/udf_create.py
浏览文件 @
c34c5353
...
...
@@ -49,20 +49,25 @@ class TDTestCase:
self
.
libudf1
=
subprocess
.
Popen
(
'(for /r %s %%i in ("udf1.d*") do @echo %%i)|grep lib|head -n1'
%
projPath
,
shell
=
True
,
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
STDOUT
).
stdout
.
read
().
decode
(
"utf-8"
)
self
.
libudf1_dup
=
subprocess
.
Popen
(
'(for /r %s %%i in ("udf1_dup.d*") do @echo %%i)|grep lib|head -n1'
%
projPath
,
shell
=
True
,
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
STDOUT
).
stdout
.
read
().
decode
(
"utf-8"
)
self
.
libudf2
=
subprocess
.
Popen
(
'(for /r %s %%i in ("udf2.d*") do @echo %%i)|grep lib|head -n1'
%
projPath
,
shell
=
True
,
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
STDOUT
).
stdout
.
read
().
decode
(
"utf-8"
)
self
.
libudf2_dup
=
subprocess
.
Popen
(
'(for /r %s %%i in ("udf2_dup.d*") do @echo %%i)|grep lib|head -n1'
%
projPath
,
shell
=
True
,
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
STDOUT
).
stdout
.
read
().
decode
(
"utf-8"
)
if
(
not
tdDnodes
.
dnodes
[
0
].
remoteIP
==
""
):
tdDnodes
.
dnodes
[
0
].
remote_conn
.
get
(
tdDnodes
.
dnodes
[
0
].
config
[
"path"
]
+
'/debug/build/lib/libudf1.so'
,
projPath
+
"
\\
debug
\\
build
\\
lib
\\
"
)
tdDnodes
.
dnodes
[
0
].
remote_conn
.
get
(
tdDnodes
.
dnodes
[
0
].
config
[
"path"
]
+
'/debug/build/lib/libudf1_dup.so'
,
projPath
+
"
\\
debug
\\
build
\\
lib
\\
"
)
tdDnodes
.
dnodes
[
0
].
remote_conn
.
get
(
tdDnodes
.
dnodes
[
0
].
config
[
"path"
]
+
'/debug/build/lib/libudf2.so'
,
projPath
+
"
\\
debug
\\
build
\\
lib
\\
"
)
tdDnodes
.
dnodes
[
0
].
remote_conn
.
get
(
tdDnodes
.
dnodes
[
0
].
config
[
"path"
]
+
'/debug/build/lib/libudf2_dup.so'
,
projPath
+
"
\\
debug
\\
build
\\
lib
\\
"
)
self
.
libudf1
=
self
.
libudf1
.
replace
(
'udf1.dll'
,
'libudf1.so'
)
self
.
libudf1_dup
=
self
.
libudf1_dup
.
replace
(
'udf1_dup.dll'
,
'libudf1_dup.so'
)
self
.
libudf2
=
self
.
libudf2
.
replace
(
'udf2.dll'
,
'libudf2.so'
)
self
.
libudf2_dup
=
self
.
libudf2_dup
.
replace
(
'udf2_dup.dll'
,
'libudf2_dup.so'
)
else
:
self
.
libudf1
=
subprocess
.
Popen
(
'find %s -name "libudf1.so"|grep lib|head -n1'
%
projPath
,
shell
=
True
,
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
STDOUT
).
stdout
.
read
().
decode
(
"utf-8"
)
self
.
libudf1_dup
=
subprocess
.
Popen
(
'find %s -name "libudf1_dup.so"|grep lib|head -n1'
%
projPath
,
shell
=
True
,
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
STDOUT
).
stdout
.
read
().
decode
(
"utf-8"
)
self
.
libudf2
=
subprocess
.
Popen
(
'find %s -name "libudf2.so"|grep lib|head -n1'
%
projPath
,
shell
=
True
,
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
STDOUT
).
stdout
.
read
().
decode
(
"utf-8"
)
self
.
libudf2_dup
=
subprocess
.
Popen
(
'find %s -name "libudf2_dup.so"|grep lib|head -n1'
%
projPath
,
shell
=
True
,
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
STDOUT
).
stdout
.
read
().
decode
(
"utf-8"
)
self
.
libudf1
=
self
.
libudf1
.
replace
(
'
\r
'
,
''
).
replace
(
'
\n
'
,
''
)
self
.
libudf1_dup
=
self
.
libudf1_dup
.
replace
(
'
\r
'
,
''
).
replace
(
'
\n
'
,
''
)
self
.
libudf2
=
self
.
libudf2
.
replace
(
'
\r
'
,
''
).
replace
(
'
\n
'
,
''
)
self
.
libudf2_dup
=
self
.
libudf2_dup
.
replace
(
'
\r
'
,
''
).
replace
(
'
\n
'
,
''
)
def
prepare_data
(
self
):
...
...
@@ -184,6 +189,7 @@ class TDTestCase:
# create aggregate functions
tdSql
.
execute
(
"create aggregate function udf2 as '%s' outputtype double bufSize 8;"
%
self
.
libudf2
)
tdSql
.
execute
(
"create aggregate function udf2_dup as '%s' outputtype double bufSize 8;"
%
self
.
libudf2_dup
)
functions
=
tdSql
.
getResult
(
"show functions"
)
function_nums
=
len
(
functions
)
...
...
@@ -251,6 +257,10 @@ class TDTestCase:
# aggregate functions
tdSql
.
query
(
"select udf2(num1) ,udf2_dup(num2) from tb"
)
val
=
tdSql
.
queryResult
[
0
][
0
]
+
100
tdSql
.
checkData
(
0
,
1
,
val
)
tdSql
.
query
(
"select udf2(num1) ,udf2(num2), udf2(num3) from tb"
)
tdSql
.
checkData
(
0
,
0
,
15.362291496
)
tdSql
.
checkData
(
0
,
1
,
10000949.553189287
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录