Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
d0c55ef5
T
TDengine
项目概览
taosdata
/
TDengine
大约 2 年 前同步成功
通知
1192
Star
22018
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看板
提交
d0c55ef5
编写于
3月 28, 2023
作者:
wmmhello
浏览文件
操作
浏览文件
下载
差异文件
fix:conflicts
上级
5c9638d2
b5a1246f
变更
31
隐藏空白更改
内联
并排
Showing
31 changed file
with
404 addition
and
173 deletion
+404
-173
CMakeLists.txt
CMakeLists.txt
+2
-0
cmake/cmake.version
cmake/cmake.version
+18
-1
cmake/taostools_CMakeLists.txt.in
cmake/taostools_CMakeLists.txt.in
+1
-1
include/libs/executor/executor.h
include/libs/executor/executor.h
+1
-9
include/libs/sync/sync.h
include/libs/sync/sync.h
+1
-1
include/util/tarray.h
include/util/tarray.h
+2
-16
include/util/version.h
include/util/version.h
+1
-0
packaging/rpm/tdengine.spec
packaging/rpm/tdengine.spec
+14
-26
packaging/tools/makepkg.sh
packaging/tools/makepkg.sh
+2
-2
packaging/tools/post.sh
packaging/tools/post.sh
+54
-0
source/dnode/mgmt/exe/dmMain.c
source/dnode/mgmt/exe/dmMain.c
+13
-9
source/dnode/mnode/impl/src/mndConsumer.c
source/dnode/mnode/impl/src/mndConsumer.c
+8
-1
source/dnode/vnode/src/tq/tq.c
source/dnode/vnode/src/tq/tq.c
+7
-1
source/dnode/vnode/src/tq/tqExec.c
source/dnode/vnode/src/tq/tqExec.c
+1
-0
source/dnode/vnode/src/tsdb/tsdbRead.c
source/dnode/vnode/src/tsdb/tsdbRead.c
+7
-2
source/dnode/vnode/src/vnd/vnodeCommit.c
source/dnode/vnode/src/vnd/vnodeCommit.c
+3
-6
source/libs/executor/src/executor.c
source/libs/executor/src/executor.c
+17
-0
source/libs/executor/src/executorimpl.c
source/libs/executor/src/executorimpl.c
+1
-1
source/libs/function/src/builtins.c
source/libs/function/src/builtins.c
+2
-2
source/libs/parser/src/parCalcConst.c
source/libs/parser/src/parCalcConst.c
+13
-10
source/libs/parser/src/parInsertUtil.c
source/libs/parser/src/parInsertUtil.c
+3
-3
source/libs/parser/src/parTranslater.c
source/libs/parser/src/parTranslater.c
+8
-4
source/util/src/tarray.c
source/util/src/tarray.c
+3
-56
source/util/src/tconfig.c
source/util/src/tconfig.c
+2
-0
source/util/src/version.c.in
source/util/src/version.c.in
+1
-0
tests/parallel_test/cases.task
tests/parallel_test/cases.task
+1
-0
tests/parallel_test/run.sh
tests/parallel_test/run.sh
+6
-4
tests/system-test/7-tmq/raw_block_interface_test.py
tests/system-test/7-tmq/raw_block_interface_test.py
+54
-0
tools/shell/src/shellArguments.c
tools/shell/src/shellArguments.c
+21
-18
utils/test/c/CMakeLists.txt
utils/test/c/CMakeLists.txt
+9
-0
utils/test/c/write_raw_block_test.c
utils/test/c/write_raw_block_test.c
+128
-0
未找到文件。
CMakeLists.txt
浏览文件 @
d0c55ef5
...
...
@@ -10,6 +10,8 @@ if (NOT DEFINED TD_SOURCE_DIR)
set
(
TD_SOURCE_DIR
${
PROJECT_SOURCE_DIR
}
)
endif
()
SET
(
TD_COMMUNITY_DIR
${
PROJECT_SOURCE_DIR
}
)
set
(
TD_SUPPORT_DIR
"
${
TD_SOURCE_DIR
}
/cmake"
)
set
(
TD_CONTRIB_DIR
"
${
TD_SOURCE_DIR
}
/contrib"
)
...
...
cmake/cmake.version
浏览文件 @
d0c55ef5
...
...
@@ -16,7 +16,7 @@ find_program(HAVE_GIT NAMES git)
IF (DEFINED GITINFO)
SET(TD_VER_GIT ${GITINFO})
ELSEIF (HAVE_GIT)
execute_process(COMMAND git log -1 --format=%H WORKING_DIRECTORY ${
CMAKE_CURRENT_SOURCE
_DIR} OUTPUT_VARIABLE GIT_COMMITID)
execute_process(COMMAND git log -1 --format=%H WORKING_DIRECTORY ${
TD_COMMUNITY
_DIR} OUTPUT_VARIABLE GIT_COMMITID)
#message(STATUS "git log result:${GIT_COMMITID}")
IF (GIT_COMMITID)
string (REGEX REPLACE "[\n\t\r]" "" GIT_COMMITID ${GIT_COMMITID})
...
...
@@ -30,6 +30,23 @@ ELSE ()
SET(TD_VER_GIT "no git commit id")
ENDIF ()
IF (DEFINED GITINFOI)
SET(TD_VER_GIT_INTERNAL ${GITINFOI})
ELSEIF (HAVE_GIT)
execute_process(COMMAND git log -1 --format=%H WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} OUTPUT_VARIABLE GIT_COMMITID)
message(STATUS "git log result:${GIT_COMMITID}")
IF (GIT_COMMITID)
string (REGEX REPLACE "[\n\t\r]" "" GIT_COMMITID ${GIT_COMMITID})
SET(TD_VER_GIT_INTERNAL ${GIT_COMMITID})
ELSE ()
message(STATUS "not a git repository")
SET(TD_VER_GIT "no git commit id")
ENDIF ()
ELSE ()
message(STATUS "no git cmd")
SET(TD_VER_GIT_INTERNAL "no git commit id")
ENDIF ()
IF (DEFINED VERDATE)
SET(TD_VER_DATE ${VERDATE})
ELSE ()
...
...
cmake/taostools_CMakeLists.txt.in
浏览文件 @
d0c55ef5
...
...
@@ -2,7 +2,7 @@
# taos-tools
ExternalProject_Add(taos-tools
GIT_REPOSITORY https://github.com/taosdata/taos-tools.git
GIT_TAG
04296a5
GIT_TAG
2864326
SOURCE_DIR "${TD_SOURCE_DIR}/tools/taos-tools"
BINARY_DIR ""
#BUILD_IN_SOURCE TRUE
...
...
include/libs/executor/executor.h
浏览文件 @
d0c55ef5
...
...
@@ -149,7 +149,6 @@ int32_t qGetQueryTableSchemaVersion(qTaskInfo_t tinfo, char* dbName, char* table
* @param handle
* @return
*/
int32_t
qExecTaskOpt
(
qTaskInfo_t
tinfo
,
SArray
*
pResList
,
uint64_t
*
useconds
,
bool
*
hasMore
,
SLocalFetch
*
pLocal
);
int32_t
qExecTask
(
qTaskInfo_t
tinfo
,
SSDataBlock
**
pBlock
,
uint64_t
*
useconds
);
...
...
@@ -162,6 +161,7 @@ void qCleanExecTaskBlockBuf(qTaskInfo_t tinfo);
* @return
*/
int32_t
qAsyncKillTask
(
qTaskInfo_t
tinfo
,
int32_t
rspCode
);
int32_t
qKillTask
(
qTaskInfo_t
tinfo
,
int32_t
rspCode
);
bool
qTaskIsExecuting
(
qTaskInfo_t
qinfo
);
...
...
@@ -171,14 +171,6 @@ bool qTaskIsExecuting(qTaskInfo_t qinfo);
*/
void
qDestroyTask
(
qTaskInfo_t
tinfo
);
/**
* Extract the qualified table id list, and than pass them to the TSDB driver to load the required table data blocks.
*
* @param iter the table iterator to traverse all tables belongs to a super table, or an invert index
* @return
*/
int32_t
qGetQualifiedTableIdList
(
void
*
pTableList
,
const
char
*
tagCond
,
int32_t
tagCondLen
,
SArray
*
pTableIdList
);
void
qProcessRspMsg
(
void
*
parent
,
struct
SRpcMsg
*
pMsg
,
struct
SEpSet
*
pEpSet
);
int32_t
qGetExplainExecInfo
(
qTaskInfo_t
tinfo
,
SArray
*
pExecInfoList
/*,int32_t* resNum, SExplainExecInfo** pRes*/
);
...
...
include/libs/sync/sync.h
浏览文件 @
d0c55ef5
...
...
@@ -48,7 +48,7 @@ extern "C" {
#define SYNC_HEARTBEAT_REPLY_SLOW_MS 1500
#define SYNC_SNAP_RESEND_MS 1000 * 60
#define SYNC_VND_COMMIT_MIN_MS
1
000
#define SYNC_VND_COMMIT_MIN_MS
3
000
#define SYNC_MAX_BATCH_SIZE 1
#define SYNC_INDEX_BEGIN 0
...
...
include/util/tarray.h
浏览文件 @
d0c55ef5
...
...
@@ -69,14 +69,6 @@ void* taosArrayAddBatch(SArray* pArray, const void* pData, int32_t nEles);
*/
void
taosArrayRemoveDuplicate
(
SArray
*
pArray
,
__compar_fn_t
comparFn
,
void
(
*
fp
)(
void
*
));
/**
*
* @param pArray
* @param comparFn
* @param fp
*/
void
taosArrayRemoveDuplicateP
(
SArray
*
pArray
,
__compar_fn_t
comparFn
,
void
(
*
fp
)(
void
*
));
/**
* add all element from the source array list into the destination
* @param pArray
...
...
@@ -216,6 +208,8 @@ void taosArrayDestroyP(SArray* pArray, FDelete fp);
void
taosArrayDestroyEx
(
SArray
*
pArray
,
FDelete
fp
);
void
taosArraySwap
(
SArray
*
a
,
SArray
*
b
);
/**
* sort the array
* @param pArray
...
...
@@ -252,14 +246,6 @@ void taosArraySortPWithExt(SArray* pArray, __ext_compar_fn_t fn, const void* par
int32_t
taosEncodeArray
(
void
**
buf
,
const
SArray
*
pArray
,
FEncode
encode
);
void
*
taosDecodeArray
(
const
void
*
buf
,
SArray
**
pArray
,
FDecode
decode
,
int32_t
dataSz
);
/**
* swap array
* @param a
* @param b
* @return
*/
void
taosArraySwap
(
SArray
*
a
,
SArray
*
b
);
#ifdef __cplusplus
}
#endif
...
...
include/util/version.h
浏览文件 @
d0c55ef5
...
...
@@ -23,6 +23,7 @@ extern "C" {
extern
char
version
[];
extern
char
compatible_version
[];
extern
char
gitinfo
[];
extern
char
gitinfoOfInternal
[];
extern
char
buildinfo
[];
#ifdef __cplusplus
...
...
packaging/rpm/tdengine.spec
浏览文件 @
d0c55ef5
...
...
@@ -90,45 +90,33 @@ cp %{_compiledir}/../include/libs/function/taosudf.h %{buildroot}%{homepat
cp -r %{_compiledir}/../examples/* %{buildroot}%{homepath}/examples
if [ -f %{_compiledir}/build/bin/jemalloc-config ]; then
mkdir -p %{buildroot}%{userlocalpath}/bin
mkdir -p %{buildroot}%{userlocalpath}/lib
mkdir -p %{buildroot}%{userlocalpath}/lib/pkgconfig
mkdir -p %{buildroot}%{userlocalpath}/include
mkdir -p %{buildroot}%{userlocalpath}/include/jemalloc
mkdir -p %{buildroot}%{userlocalpath}/share
mkdir -p %{buildroot}%{userlocalpath}/share/doc
mkdir -p %{buildroot}%{userlocalpath}/share/doc/jemalloc
mkdir -p %{buildroot}%{userlocalpath}/share/man
mkdir -p %{buildroot}%{userlocalpath}/share/man/man3
cp %{_compiledir}/build/bin/jemalloc-config %{buildroot}%{userlocalpath}/bin/
mkdir -p %{buildroot}%{homepath}/jemalloc/ ||:
mkdir -p %{buildroot}%{homepath}/jemalloc/include/jemalloc/ ||:
mkdir -p %{buildroot}%{homepath}/jemalloc/lib/ ||:
mkdir -p %{buildroot}%{homepath}/jemalloc/lib/pkgconfig ||:
cp %{_compiledir}/build/bin/jemalloc-config %{buildroot}%{homepath}/jemalloc/bin
if [ -f %{_compiledir}/build/bin/jemalloc.sh ]; then
cp %{_compiledir}/build/bin/jemalloc.sh %{buildroot}%{
userlocalpath}/bin/
cp %{_compiledir}/build/bin/jemalloc.sh %{buildroot}%{
homepath}/jemalloc/bin
fi
if [ -f %{_compiledir}/build/bin/jeprof ]; then
cp %{_compiledir}/build/bin/jeprof %{buildroot}%{
userlocalpath}/bin/
cp %{_compiledir}/build/bin/jeprof %{buildroot}%{
homepath}/jemalloc/bin
fi
if [ -f %{_compiledir}/build/include/jemalloc/jemalloc.h ]; then
cp %{_compiledir}/build/include/jemalloc/jemalloc.h %{buildroot}%{
userlocalpath}
/include/jemalloc/
cp %{_compiledir}/build/include/jemalloc/jemalloc.h %{buildroot}%{
homepath}/jemalloc
/include/jemalloc/
fi
if [ -f %{_compiledir}/build/lib/libjemalloc.so.2 ]; then
cp %{_compiledir}/build/lib/libjemalloc.so.2 %{buildroot}%{
userlocalpath}/lib/
ln -sf libjemalloc.so.2 %{buildroot}%{
userlocalpath}
/lib/libjemalloc.so
cp %{_compiledir}/build/lib/libjemalloc.so.2 %{buildroot}%{
homepath}/jemalloc/lib
ln -sf libjemalloc.so.2 %{buildroot}%{
homepath}/jemalloc
/lib/libjemalloc.so
fi
if [ -f %{_compiledir}/build/lib/libjemalloc.a ]; then
cp %{_compiledir}/build/lib/libjemalloc.a %{buildroot}%{
userlocalpath}/lib/
cp %{_compiledir}/build/lib/libjemalloc.a %{buildroot}%{
homepath}/jemalloc/lib
fi
if [ -f %{_compiledir}/build/lib/libjemalloc_pic.a ]; then
cp %{_compiledir}/build/lib/libjemalloc_pic.a %{buildroot}%{
userlocalpath}/lib/
cp %{_compiledir}/build/lib/libjemalloc_pic.a %{buildroot}%{
homepath}/jemalloc/lib
fi
if [ -f %{_compiledir}/build/lib/pkgconfig/jemalloc.pc ]; then
cp %{_compiledir}/build/lib/pkgconfig/jemalloc.pc %{buildroot}%{userlocalpath}/lib/pkgconfig/
fi
if [ -f %{_compiledir}/build/share/doc/jemalloc/jemalloc.html ]; then
cp %{_compiledir}/build/share/doc/jemalloc/jemalloc.html %{buildroot}%{userlocalpath}/share/doc/jemalloc/
fi
if [ -f %{_compiledir}/build/share/man/man3/jemalloc.3 ]; then
cp %{_compiledir}/build/share/man/man3/jemalloc.3 %{buildroot}%{userlocalpath}/share/man/man3/
cp %{_compiledir}/build/lib/pkgconfig/jemalloc.pc %{buildroot}%{homepath}/jemalloc/lib/pkgconfig
fi
fi
...
...
packaging/tools/makepkg.sh
浏览文件 @
d0c55ef5
...
...
@@ -51,9 +51,9 @@ fi
if
[
-d
${
top_dir
}
/tools/taos-tools/packaging/deb
]
;
then
cd
${
top_dir
}
/tools/taos-tools/packaging/deb
[
-z
"
$taos_tools_ver
"
]
&&
taos_tools_ver
=
"0.1.0"
taostools_ver
=
$(
git
for
-each-ref
--sort
=
taggerdate
--format
'%(tag)'
refs/tags|grep
-v
taos |
tail
-1
)
[
-z
"
$taos_tools_ver
"
]
&&
taos_tools_ver
=
"0.1.0"
taostools_install_dir
=
"
${
release_dir
}
/
${
clientName2
}
Tools-
${
taostools_ver
}
"
cd
${
curr_dir
}
...
...
packaging/tools/post.sh
浏览文件 @
d0c55ef5
...
...
@@ -145,6 +145,59 @@ function install_include() {
log_print
"install include success"
}
function
install_jemalloc
()
{
jemalloc_dir
=
${
script_dir
}
/../jemalloc
if
[
-d
${
jemalloc_dir
}
]
;
then
${
csudo
}
/usr/bin/install
-c
-d
/usr/local/bin
if
[
-f
${
jemalloc_dir
}
/bin/jemalloc-config
]
;
then
${
csudo
}
/usr/bin/install
-c
-m
755
${
jemalloc_dir
}
/bin/jemalloc-config /usr/local/bin
fi
if
[
-f
${
jemalloc_dir
}
/bin/jemalloc.sh
]
;
then
${
csudo
}
/usr/bin/install
-c
-m
755
${
jemalloc_dir
}
/bin/jemalloc.sh /usr/local/bin
fi
if
[
-f
${
jemalloc_dir
}
/bin/jeprof
]
;
then
${
csudo
}
/usr/bin/install
-c
-m
755
${
jemalloc_dir
}
/bin/jeprof /usr/local/bin
fi
if
[
-f
${
jemalloc_dir
}
/include/jemalloc/jemalloc.h
]
;
then
${
csudo
}
/usr/bin/install
-c
-d
/usr/local/include/jemalloc
${
csudo
}
/usr/bin/install
-c
-m
644
${
jemalloc_dir
}
/include/jemalloc/jemalloc.h /usr/local/include/jemalloc
fi
if
[
-f
${
jemalloc_dir
}
/lib/libjemalloc.so.2
]
;
then
${
csudo
}
/usr/bin/install
-c
-d
/usr/local/lib
${
csudo
}
/usr/bin/install
-c
-m
755
${
jemalloc_dir
}
/lib/libjemalloc.so.2 /usr/local/lib
${
csudo
}
ln
-sf
libjemalloc.so.2 /usr/local/lib/libjemalloc.so
${
csudo
}
/usr/bin/install
-c
-d
/usr/local/lib
if
[
-f
${
jemalloc_dir
}
/lib/libjemalloc.a
]
;
then
${
csudo
}
/usr/bin/install
-c
-m
755
${
jemalloc_dir
}
/lib/libjemalloc.a /usr/local/lib
fi
if
[
-f
${
jemalloc_dir
}
/lib/libjemalloc_pic.a
]
;
then
${
csudo
}
/usr/bin/install
-c
-m
755
${
jemalloc_dir
}
/lib/libjemalloc_pic.a /usr/local/lib
fi
if
[
-f
${
jemalloc_dir
}
/lib/libjemalloc_pic.a
]
;
then
${
csudo
}
/usr/bin/install
-c
-d
/usr/local/lib/pkgconfig
${
csudo
}
/usr/bin/install
-c
-m
644
${
jemalloc_dir
}
/lib/pkgconfig/jemalloc.pc /usr/local/lib/pkgconfig
fi
fi
if
[
-f
${
jemalloc_dir
}
/share/doc/jemalloc/jemalloc.html
]
;
then
${
csudo
}
/usr/bin/install
-c
-d
/usr/local/share/doc/jemalloc
${
csudo
}
/usr/bin/install
-c
-m
644
${
jemalloc_dir
}
/share/doc/jemalloc/jemalloc.html /usr/local/share/doc/jemalloc
fi
if
[
-f
${
jemalloc_dir
}
/share/man/man3/jemalloc.3
]
;
then
${
csudo
}
/usr/bin/install
-c
-d
/usr/local/share/man/man3
${
csudo
}
/usr/bin/install
-c
-m
644
${
jemalloc_dir
}
/share/man/man3/jemalloc.3 /usr/local/share/man/man3
fi
if
[
-d
/etc/ld.so.conf.d
]
;
then
echo
"/usr/local/lib"
|
${
csudo
}
tee
/etc/ld.so.conf.d/jemalloc.conf
>
/dev/null
||
echo
-e
"failed to write /etc/ld.so.conf.d/jemalloc.conf"
${
csudo
}
ldconfig
else
echo
"/etc/ld.so.conf.d not found!"
fi
fi
}
function
install_lib
()
{
log_print
"start install lib from
${
lib_dir
}
to
${
lib_link_dir
}
"
${
csudo
}
rm
-f
${
lib_link_dir
}
/libtaos
*
||
:
...
...
@@ -663,6 +716,7 @@ function install_TDengine() {
# Install include, lib, binary and service
install_include
&&
install_lib
&&
install_jemalloc
install_bin
if
[[
"
$?
"
!=
0
]]
;
then
...
...
source/dnode/mgmt/exe/dmMain.c
浏览文件 @
d0c55ef5
...
...
@@ -18,6 +18,7 @@
#include "mnode.h"
#include "tconfig.h"
#include "tglobal.h"
#include "version.h"
// clang-format off
#define DM_APOLLO_URL "The apollo string to use when configuring the server, such as: -a 'jsonFile:./tests/cfg.json', cfg.json text can be '{\"fqdn\":\"td1\"}'."
...
...
@@ -76,28 +77,28 @@ void dmLogCrash(int signum, void *sigInfo, void *context) {
taosIgnSignal
(
SIGINT
);
taosIgnSignal
(
SIGBREAK
);
#ifndef WINDOWS
#ifndef WINDOWS
taosIgnSignal
(
SIGBUS
);
#endif
taosIgnSignal
(
SIGABRT
);
taosIgnSignal
(
SIGFPE
);
taosIgnSignal
(
SIGSEGV
);
char
*
pMsg
=
NULL
;
char
*
pMsg
=
NULL
;
const
char
*
flags
=
"UTL FATAL "
;
ELogLevel
level
=
DEBUG_FATAL
;
int32_t
dflag
=
255
;
int64_t
msgLen
=
-
1
;
int64_t
msgLen
=
-
1
;
if
(
tsEnableCrashReport
)
{
if
(
taosGenCrashJsonMsg
(
signum
,
&
pMsg
,
dmGetClusterId
(),
global
.
startTime
))
{
taosPrintLog
(
flags
,
level
,
dflag
,
"failed to generate crash json msg"
);
goto
_return
;
}
else
{
msgLen
=
strlen
(
pMsg
);
msgLen
=
strlen
(
pMsg
);
}
}
_return:
taosLogCrashInfo
(
"taosd"
,
pMsg
,
msgLen
,
signum
,
sigInfo
);
...
...
@@ -123,7 +124,7 @@ static void dmSetSignalHandle() {
#ifndef WINDOWS
taosSetSignal
(
SIGBUS
,
dmLogCrash
);
#endif
#endif
taosSetSignal
(
SIGABRT
,
dmLogCrash
);
taosSetSignal
(
SIGFPE
,
dmLogCrash
);
taosSetSignal
(
SIGSEGV
,
dmLogCrash
);
...
...
@@ -134,7 +135,7 @@ static int32_t dmParseArgs(int32_t argc, char const *argv[]) {
int32_t
cmdEnvIndex
=
0
;
if
(
argc
<
2
)
return
0
;
global
.
envCmd
=
taosMemoryMalloc
((
argc
-
1
)
*
sizeof
(
char
*
));
memset
(
global
.
envCmd
,
0
,
(
argc
-
1
)
*
sizeof
(
char
*
));
for
(
int32_t
i
=
1
;
i
<
argc
;
++
i
)
{
...
...
@@ -203,6 +204,9 @@ static void dmPrintVersion() {
#endif
printf
(
"%s version: %s compatible_version: %s
\n
"
,
releaseName
,
version
,
compatible_version
);
printf
(
"gitinfo: %s
\n
"
,
gitinfo
);
#ifdef TD_ENTERPRISE
printf
(
"gitinfoOfInternal: %s
\n
"
,
gitinfoOfInternal
);
#endif
printf
(
"buildInfo: %s
\n
"
,
buildinfo
);
}
...
...
@@ -284,7 +288,7 @@ int mainWindows(int argc, char **argv) {
printf
(
"failed to init memory dbg, error:%s
\n
"
,
tstrerror
(
code
));
return
code
;
}
tsAsyncLog
=
false
;
tsAsyncLog
=
false
;
printf
(
"memory dbg enabled
\n
"
);
}
#endif
...
...
source/dnode/mnode/impl/src/mndConsumer.c
浏览文件 @
d0c55ef5
...
...
@@ -601,6 +601,13 @@ static void* topicNameDup(void* p){
return
taosStrdup
((
char
*
)
p
);
}
static
void
freeItem
(
void
*
param
)
{
void
*
pItem
=
*
(
void
**
)
param
;
if
(
pItem
!=
NULL
)
{
taosMemoryFree
(
pItem
);
}
}
int32_t
mndProcessSubscribeReq
(
SRpcMsg
*
pMsg
)
{
SMnode
*
pMnode
=
pMsg
->
info
.
node
;
char
*
msgStr
=
pMsg
->
pCont
;
...
...
@@ -616,7 +623,7 @@ int32_t mndProcessSubscribeReq(SRpcMsg *pMsg) {
int32_t
code
=
-
1
;
SArray
*
pTopicList
=
subscribe
.
topicNames
;
taosArraySort
(
pTopicList
,
taosArrayCompareString
);
taosArrayRemoveDuplicate
P
(
pTopicList
,
taosArrayCompareString
,
taosMemoryFree
);
taosArrayRemoveDuplicate
(
pTopicList
,
taosArrayCompareString
,
freeItem
);
int32_t
newTopicNum
=
taosArrayGetSize
(
pTopicList
);
...
...
source/dnode/vnode/src/tq/tq.c
浏览文件 @
d0c55ef5
...
...
@@ -858,6 +858,12 @@ int32_t tqProcessSubscribeReq(STQ* pTq, int64_t sversion, char* msg, int32_t msg
tqInfo
(
"vgId:%d switch consumer from Id:0x%"
PRIx64
" to Id:0x%"
PRIx64
,
req
.
vgId
,
pHandle
->
consumerId
,
req
.
newConsumerId
);
// kill executing task
qTaskInfo_t
pTaskInfo
=
pHandle
->
execHandle
.
task
;
if
(
pTaskInfo
!=
NULL
)
{
qKillTask
(
pTaskInfo
,
TSDB_CODE_SUCCESS
);
}
taosWLockLatch
(
&
pTq
->
lock
);
atomic_store_32
(
&
pHandle
->
epoch
,
-
1
);
...
...
@@ -868,7 +874,7 @@ int32_t tqProcessSubscribeReq(STQ* pTq, int64_t sversion, char* msg, int32_t msg
atomic_add_fetch_32
(
&
pHandle
->
epoch
,
1
);
if
(
pHandle
->
execHandle
.
subType
==
TOPIC_SUB_TYPE__COLUMN
)
{
qStreamCloseTsdbReader
(
p
Handle
->
execHandle
.
task
);
qStreamCloseTsdbReader
(
p
TaskInfo
);
}
taosWUnLockLatch
(
&
pTq
->
lock
);
...
...
source/dnode/vnode/src/tq/tqExec.c
浏览文件 @
d0c55ef5
...
...
@@ -65,6 +65,7 @@ int32_t tqScanData(STQ* pTq, const STqHandle* pHandle, SMqDataRsp* pRsp, STqOffs
const
STqExecHandle
*
pExec
=
&
pHandle
->
execHandle
;
qTaskInfo_t
task
=
pExec
->
task
;
int32_t
vgId
=
TD_VID
(
pTq
->
pVnode
);
if
(
qStreamPrepareScan
(
task
,
pOffset
,
pHandle
->
execHandle
.
subType
)
<
0
)
{
tqError
(
"prepare scan failed, return"
);
...
...
source/dnode/vnode/src/tsdb/tsdbRead.c
浏览文件 @
d0c55ef5
...
...
@@ -3929,8 +3929,13 @@ int32_t tsdbSetTableList(STsdbReader* pReader, const void* pTableList, int32_t n
if
(
code
)
{
return
code
;
}
pReader
->
status
.
uidList
.
tableUidList
=
(
uint64_t
*
)
taosMemoryRealloc
(
pReader
->
status
.
uidList
.
tableUidList
,
sizeof
(
uint64_t
)
*
num
);
char
*
p1
=
taosMemoryRealloc
(
pReader
->
status
.
uidList
.
tableUidList
,
sizeof
(
uint64_t
)
*
num
);
if
(
p1
==
NULL
)
{
return
TSDB_CODE_OUT_OF_MEMORY
;
}
pReader
->
status
.
uidList
.
tableUidList
=
(
uint64_t
*
)
p1
;
}
taosHashClear
(
pReader
->
status
.
pTableMap
);
...
...
source/dnode/vnode/src/vnd/vnodeCommit.c
浏览文件 @
d0c55ef5
...
...
@@ -156,13 +156,10 @@ int vnodeShouldCommit(SVnode *pVnode) {
bool
needCommit
=
false
;
taosThreadMutexLock
(
&
pVnode
->
mutex
);
if
(
!
pVnode
->
inUse
||
!
diskAvail
)
{
goto
_out
;
if
(
pVnode
->
inUse
&&
diskAvail
)
{
needCommit
=
((
pVnode
->
inUse
->
size
>
pVnode
->
inUse
->
node
.
size
)
&&
(
pSched
->
commitMs
+
SYNC_VND_COMMIT_MIN_MS
<
nowMs
));
}
needCommit
=
(((
pVnode
->
inUse
->
size
>
pVnode
->
inUse
->
node
.
size
)
&&
(
pSched
->
commitMs
+
SYNC_VND_COMMIT_MIN_MS
<
nowMs
))
||
(
pVnode
->
inUse
->
size
>
0
&&
pSched
->
commitMs
+
pSched
->
maxWaitMs
<
nowMs
));
_out:
taosThreadMutexUnlock
(
&
pVnode
->
mutex
);
return
needCommit
;
}
...
...
source/libs/executor/src/executor.c
浏览文件 @
d0c55ef5
...
...
@@ -749,6 +749,23 @@ int32_t qAsyncKillTask(qTaskInfo_t qinfo, int32_t rspCode) {
return
TSDB_CODE_SUCCESS
;
}
int32_t
qKillTask
(
qTaskInfo_t
tinfo
,
int32_t
rspCode
)
{
SExecTaskInfo
*
pTaskInfo
=
(
SExecTaskInfo
*
)
tinfo
;
if
(
pTaskInfo
==
NULL
)
{
return
TSDB_CODE_QRY_INVALID_QHANDLE
;
}
qDebug
(
"%s execTask async killed"
,
GET_TASKID
(
pTaskInfo
));
setTaskKilled
(
pTaskInfo
,
rspCode
);
while
(
qTaskIsExecuting
(
pTaskInfo
))
{
taosMsleep
(
10
);
}
pTaskInfo
->
code
=
rspCode
;
return
TSDB_CODE_SUCCESS
;
}
bool
qTaskIsExecuting
(
qTaskInfo_t
qinfo
)
{
SExecTaskInfo
*
pTaskInfo
=
(
SExecTaskInfo
*
)
qinfo
;
if
(
NULL
==
pTaskInfo
)
{
...
...
source/libs/executor/src/executorimpl.c
浏览文件 @
d0c55ef5
...
...
@@ -633,7 +633,7 @@ void setBlockSMAInfo(SqlFunctionCtx* pCtx, SExprInfo* pExprInfo, SSDataBlock* pB
}
}
bool
isTaskKilled
(
SExecTaskInfo
*
pTaskInfo
)
{
return
(
0
!=
pTaskInfo
->
code
)
?
true
:
false
;
}
bool
isTaskKilled
(
SExecTaskInfo
*
pTaskInfo
)
{
return
(
0
!=
pTaskInfo
->
code
)
;
}
void
setTaskKilled
(
SExecTaskInfo
*
pTaskInfo
,
int32_t
rspCode
)
{
pTaskInfo
->
code
=
rspCode
;
}
...
...
source/libs/function/src/builtins.c
浏览文件 @
d0c55ef5
...
...
@@ -2375,7 +2375,7 @@ const SBuiltinFuncDefinition funcMgtBuiltins[] = {
{
.
name
=
"spread"
,
.
type
=
FUNCTION_TYPE_SPREAD
,
.
classification
=
FUNC_MGT_AGG_FUNC
,
.
classification
=
FUNC_MGT_AGG_FUNC
|
FUNC_MGT_SPECIAL_DATA_REQUIRED
,
.
translateFunc
=
translateSpread
,
.
dataRequiredFunc
=
statisDataRequired
,
.
getEnvFunc
=
getSpreadFuncEnv
,
...
...
@@ -2417,7 +2417,7 @@ const SBuiltinFuncDefinition funcMgtBuiltins[] = {
{
.
name
=
"elapsed"
,
.
type
=
FUNCTION_TYPE_ELAPSED
,
.
classification
=
FUNC_MGT_AGG_FUNC
|
FUNC_MGT_TIMELINE_FUNC
|
FUNC_MGT_INTERVAL_INTERPO_FUNC
|
FUNC_MGT_FORBID_STREAM_FUNC
,
.
classification
=
FUNC_MGT_AGG_FUNC
|
FUNC_MGT_TIMELINE_FUNC
|
FUNC_MGT_INTERVAL_INTERPO_FUNC
|
FUNC_MGT_FORBID_STREAM_FUNC
|
FUNC_MGT_SPECIAL_DATA_REQUIRED
,
.
dataRequiredFunc
=
statisDataRequired
,
.
translateFunc
=
translateElapsed
,
.
getEnvFunc
=
getElapsedFuncEnv
,
...
...
source/libs/parser/src/parCalcConst.c
浏览文件 @
d0c55ef5
...
...
@@ -183,16 +183,18 @@ static int32_t calcConstProject(SNode* pProject, bool dual, SNode** pNew) {
}
else
{
code
=
scalarCalculateConstants
(
pProject
,
pNew
);
}
if
(
TSDB_CODE_SUCCESS
==
code
&&
QUERY_NODE_VALUE
==
nodeType
(
*
pNew
)
&&
NULL
!=
pAssociation
)
{
if
(
TSDB_CODE_SUCCESS
==
code
)
{
strcpy
(((
SExprNode
*
)
*
pNew
)
->
aliasName
,
aliasName
);
int32_t
size
=
taosArrayGetSize
(
pAssociation
);
for
(
int32_t
i
=
0
;
i
<
size
;
++
i
)
{
SNode
**
pCol
=
taosArrayGetP
(
pAssociation
,
i
);
nodesDestroyNode
(
*
pCol
);
*
pCol
=
nodesCloneNode
(
*
pNew
);
if
(
NULL
==
*
pCol
)
{
code
=
TSDB_CODE_OUT_OF_MEMORY
;
break
;
if
(
QUERY_NODE_VALUE
==
nodeType
(
*
pNew
)
&&
NULL
!=
pAssociation
)
{
int32_t
size
=
taosArrayGetSize
(
pAssociation
);
for
(
int32_t
i
=
0
;
i
<
size
;
++
i
)
{
SNode
**
pCol
=
taosArrayGetP
(
pAssociation
,
i
);
nodesDestroyNode
(
*
pCol
);
*
pCol
=
nodesCloneNode
(
*
pNew
);
if
(
NULL
==
*
pCol
)
{
code
=
TSDB_CODE_OUT_OF_MEMORY
;
break
;
}
}
}
}
...
...
@@ -383,7 +385,8 @@ static int32_t calcConstSetOpProjections(SCalcConstContext* pCxt, SSetOperator*
int32_t
index
=
0
;
SNode
*
pProj
=
NULL
;
WHERE_EACH
(
pProj
,
pSetOp
->
pProjectionList
)
{
if
(
subquery
&&
notRefByOrderBy
((
SColumnNode
*
)
pProj
,
pSetOp
->
pOrderByList
)
&&
isSetUselessCol
(
pSetOp
,
index
,
(
SExprNode
*
)
pProj
))
{
if
(
subquery
&&
notRefByOrderBy
((
SColumnNode
*
)
pProj
,
pSetOp
->
pOrderByList
)
&&
isSetUselessCol
(
pSetOp
,
index
,
(
SExprNode
*
)
pProj
))
{
ERASE_NODE
(
pSetOp
->
pProjectionList
);
eraseSetOpChildProjection
(
pSetOp
,
index
);
continue
;
...
...
source/libs/parser/src/parInsertUtil.c
浏览文件 @
d0c55ef5
...
...
@@ -621,12 +621,12 @@ int rawBlockBindData(SQuery* query, STableMeta* pTableMeta, void* data, SVCreate
SSchema
*
pSchema
=
getTableColumnSchema
(
pTableCxt
->
pMeta
);
SBoundColInfo
*
boundInfo
=
&
pTableCxt
->
boundColsInfo
;
if
(
numFields
!=
numOfCols
)
{
if
(
tFields
!=
NULL
&&
numFields
!=
numOfCols
)
{
uError
(
"numFields:%d != numOfCols:%d"
,
numFields
,
numOfCols
);
ret
=
TSDB_CODE_INVALID_PARA
;
goto
end
;
}
if
(
numFields
>
boundInfo
->
numOfBound
)
{
if
(
tFields
!=
NULL
&&
numFields
>
boundInfo
->
numOfBound
)
{
uError
(
"numFields:%d > boundInfo->numOfBound:%d"
,
numFields
,
boundInfo
->
numOfBound
);
ret
=
TSDB_CODE_INVALID_PARA
;
goto
end
;
...
...
@@ -634,7 +634,7 @@ int rawBlockBindData(SQuery* query, STableMeta* pTableMeta, void* data, SVCreate
for
(
int
c
=
0
;
c
<
boundInfo
->
numOfBound
;
++
c
)
{
SSchema
*
pColSchema
=
&
pSchema
[
c
];
SColData
*
pCol
=
taosArrayGet
(
pTableCxt
->
pData
->
aCol
,
c
);
if
(
findFileds
(
pColSchema
,
tFields
,
numFields
)){
if
(
tFields
==
NULL
||
findFileds
(
pColSchema
,
tFields
,
numFields
)){
if
(
*
fields
!=
pColSchema
->
type
&&
*
(
int32_t
*
)(
fields
+
sizeof
(
int8_t
))
!=
pColSchema
->
bytes
)
{
uError
(
"type or bytes not equal"
);
ret
=
TSDB_CODE_INVALID_PARA
;
...
...
source/libs/parser/src/parTranslater.c
浏览文件 @
d0c55ef5
...
...
@@ -1342,8 +1342,8 @@ static bool isCountNotNullValue(SFunctionNode* pFunc) {
// count(1) is rewritten as count(ts) for scannning optimization
static
int32_t
rewriteCountNotNullValue
(
STranslateContext
*
pCxt
,
SFunctionNode
*
pCount
)
{
SValueNode
*
pValue
=
(
SValueNode
*
)
nodesListGetNode
(
pCount
->
pParameterList
,
0
);
STableNode
*
pTable
=
NULL
;
int32_t
code
=
findTable
(
pCxt
,
NULL
,
&
pTable
);
STableNode
*
pTable
=
NULL
;
int32_t
code
=
findTable
(
pCxt
,
NULL
,
&
pTable
);
if
(
TSDB_CODE_SUCCESS
==
code
&&
QUERY_NODE_REAL_TABLE
==
nodeType
(
pTable
))
{
SColumnNode
*
pCol
=
(
SColumnNode
*
)
nodesMakeNode
(
QUERY_NODE_COLUMN
);
if
(
NULL
==
pCol
)
{
...
...
@@ -1424,7 +1424,7 @@ static int32_t translateAggFunc(STranslateContext* pCxt, SFunctionNode* pFunc) {
}
if
(
isCountNotNullValue
(
pFunc
))
{
return
rewriteCountNotNullValue
(
pCxt
,
pFunc
);
}
}
if
(
isCountTbname
(
pFunc
))
{
return
rewriteCountTbname
(
pCxt
,
pFunc
);
}
...
...
@@ -5923,11 +5923,15 @@ static int32_t addSubtableInfoToCreateStreamQuery(STranslateContext* pCxt, STabl
return
code
;
}
static
bool
isEventWindowQuery
(
SSelectStmt
*
pSelect
)
{
return
NULL
!=
pSelect
->
pWindow
&&
QUERY_NODE_EVENT_WINDOW
==
nodeType
(
pSelect
->
pWindow
);
}
static
int32_t
checkStreamQuery
(
STranslateContext
*
pCxt
,
SCreateStreamStmt
*
pStmt
)
{
SSelectStmt
*
pSelect
=
(
SSelectStmt
*
)
pStmt
->
pQuery
;
if
(
TSDB_DATA_TYPE_TIMESTAMP
!=
((
SExprNode
*
)
nodesListGetNode
(
pSelect
->
pProjectionList
,
0
))
->
resType
.
type
||
!
pSelect
->
isTimeLineResult
||
crossTableWithoutAggOper
(
pSelect
)
||
NULL
!=
pSelect
->
pOrderByList
||
crossTableWithUdaf
(
pSelect
))
{
crossTableWithUdaf
(
pSelect
)
||
isEventWindowQuery
(
pSelect
)
)
{
return
generateSyntaxErrMsgExt
(
&
pCxt
->
msgBuf
,
TSDB_CODE_PAR_INVALID_STREAM_QUERY
,
"Unsupported stream query"
);
}
if
(
NULL
!=
pSelect
->
pSubtable
&&
TSDB_DATA_TYPE_VARCHAR
!=
((
SExprNode
*
)
pSelect
->
pSubtable
)
->
resType
.
type
)
{
...
...
source/util/src/tarray.c
浏览文件 @
d0c55ef5
...
...
@@ -140,46 +140,7 @@ void taosArrayRemoveDuplicate(SArray* pArray, __compar_fn_t comparFn, void (*fp)
taosArraySet
(
pArray
,
pos
+
1
,
p2
);
memset
(
TARRAY_GET_ELEM
(
pArray
,
i
),
0
,
pArray
->
elemSize
);
pos
+=
1
;
}
else
{
pos
+=
1
;
}
}
}
if
(
fp
!=
NULL
)
{
for
(
int32_t
i
=
pos
+
1
;
i
<
pArray
->
size
;
++
i
)
{
void
*
p
=
taosArrayGet
(
pArray
,
i
);
fp
(
p
);
}
}
pArray
->
size
=
pos
+
1
;
}
void
taosArrayRemoveDuplicateP
(
SArray
*
pArray
,
__compar_fn_t
comparFn
,
void
(
*
fp
)(
void
*
))
{
size_t
size
=
pArray
->
size
;
if
(
size
<=
1
)
{
return
;
}
int32_t
pos
=
0
;
for
(
int32_t
i
=
1
;
i
<
size
;
++
i
)
{
char
*
p1
=
taosArrayGet
(
pArray
,
pos
);
char
*
p2
=
taosArrayGet
(
pArray
,
i
);
if
(
comparFn
(
p1
,
p2
)
==
0
)
{
// do nothing
}
else
{
if
(
pos
+
1
!=
i
)
{
void
*
p
=
taosArrayGetP
(
pArray
,
pos
+
1
);
if
(
fp
!=
NULL
)
{
fp
(
p
);
}
taosArraySet
(
pArray
,
pos
+
1
,
p2
);
memset
(
TARRAY_GET_ELEM
(
pArray
,
i
),
0
,
pArray
->
elemSize
);
pos
+=
1
;
}
else
{
pos
+=
1
;
}
...
...
@@ -188,7 +149,7 @@ void taosArrayRemoveDuplicateP(SArray* pArray, __compar_fn_t comparFn, void (*fp
if
(
fp
!=
NULL
)
{
for
(
int32_t
i
=
pos
+
1
;
i
<
pArray
->
size
;
++
i
)
{
void
*
p
=
taosArrayGet
P
(
pArray
,
i
);
void
*
p
=
taosArrayGet
(
pArray
,
i
);
fp
(
p
);
}
}
...
...
@@ -392,20 +353,6 @@ void taosArrayClearEx(SArray* pArray, void (*fp)(void*)) {
pArray
->
size
=
0
;
}
void
taosArrayClearP
(
SArray
*
pArray
,
FDelete
fp
)
{
if
(
pArray
==
NULL
)
return
;
if
(
fp
==
NULL
)
{
pArray
->
size
=
0
;
return
;
}
for
(
int32_t
i
=
0
;
i
<
pArray
->
size
;
++
i
)
{
fp
(
*
(
void
**
)
TARRAY_GET_ELEM
(
pArray
,
i
));
}
pArray
->
size
=
0
;
}
void
*
taosArrayDestroy
(
SArray
*
pArray
)
{
if
(
pArray
)
{
taosMemoryFree
(
pArray
->
pData
);
...
...
@@ -495,6 +442,7 @@ static void taosArrayInsertSort(SArray* pArray, __ext_compar_fn_t fn, const void
if
(
pArray
->
size
<=
1
)
{
return
;
}
for
(
int32_t
i
=
1
;
i
<=
pArray
->
size
-
1
;
++
i
)
{
for
(
int32_t
j
=
i
;
j
>
0
;
--
j
)
{
if
(
fn
(
taosArrayGetP
(
pArray
,
j
),
taosArrayGetP
(
pArray
,
j
-
1
),
param
)
==
-
1
)
{
...
...
@@ -507,7 +455,6 @@ static void taosArrayInsertSort(SArray* pArray, __ext_compar_fn_t fn, const void
}
}
}
return
;
}
int32_t
taosEncodeArray
(
void
**
buf
,
const
SArray
*
pArray
,
FEncode
encode
)
{
...
...
@@ -556,4 +503,4 @@ void taosArraySwap(SArray* a, SArray* b) {
void
*
data
=
a
->
pData
;
a
->
pData
=
b
->
pData
;
b
->
pData
=
data
;
}
}
\ No newline at end of file
source/util/src/tconfig.c
浏览文件 @
d0c55ef5
...
...
@@ -637,6 +637,8 @@ int32_t cfgLoadFromEnvVar(SConfig *pConfig) {
int32_t
code
=
0
;
char
**
pEnv
=
environ
;
line
[
1023
]
=
0
;
if
(
pEnv
==
NULL
)
return
0
;
while
(
*
pEnv
!=
NULL
)
{
name
=
value
=
value2
=
value3
=
NULL
;
olen
=
vlen
=
vlen2
=
vlen3
=
0
;
...
...
source/util/src/version.c.in
浏览文件 @
d0c55ef5
char version[64] = "${TD_VER_NUMBER}";
char compatible_version[12] = "${TD_VER_COMPATIBLE}";
char gitinfo[48] = "${TD_VER_GIT}";
char gitinfoOfInternal[48] = "${TD_VER_GIT_INTERNAL}";
char buildinfo[64] = "Built at ${TD_VER_DATE}";
void libtaos_${TD_LIB_VER_NUMBER}_${TD_VER_OSTYPE}_${TD_VER_CPUTYPE}_${TD_VER_VERTYPE}() {};
tests/parallel_test/cases.task
浏览文件 @
d0c55ef5
...
...
@@ -93,6 +93,7 @@
,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/dataFromTsdbNWal.py
,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/dataFromTsdbNWal-multiCtb.py
,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/tmq_taosx.py
,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/raw_block_interface_test.py
,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/stbTagFilter-multiCtb.py
,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/tmqSubscribeStb-r3.py -N 5
,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/tmq3mnodeSwitch.py -N 6 -M 3
...
...
tests/parallel_test/run.sh
浏览文件 @
d0c55ef5
...
...
@@ -167,8 +167,10 @@ function run_thread() {
local
case_build_san
=
`
echo
"
$line
"
|cut
-d
,
-f3
`
if
[
"
${
case_build_san
}
"
==
"y"
]
;
then
case_build_san
=
"y"
DEBUGPATH
=
"debugSan"
elif
[[
"
${
case_build_san
}
"
==
"n"
]]
||
[[
"
${
case_build_san
}
"
==
""
]]
;
then
case_build_san
=
"n"
DEBUGPATH
=
"debugNoSan"
else
usage
exit
1
...
...
@@ -301,10 +303,10 @@ function run_thread() {
if
[
!
-z
"
$corefile
"
]
;
then
echo
-e
"
\e
[34m corefiles:
$corefile
\e
[0m"
local
build_dir
=
$log_dir
/build_
${
hosts
[index]
}
local
remote_build_dir
=
"
${
workdirs
[index]
}
/
TDengine/debug
/build"
if
[
$ent
-ne
0
]
;
then
remote_build_dir
=
"
${
workdirs
[index]
}
/TDinternal/debug
/build"
fi
local
remote_build_dir
=
"
${
workdirs
[index]
}
/
{DEBUGPATH}
/build"
#
if [ $ent -ne 0 ]; then
# remote_build_dir="${workdirs[index]}/{DEBUGPATH}
/build"
#
fi
mkdir
$build_dir
2>/dev/null
if
[
$?
-eq
0
]
;
then
# scp build binary
...
...
tests/system-test/7-tmq/raw_block_interface_test.py
0 → 100644
浏览文件 @
d0c55ef5
import
taos
import
sys
import
time
import
socket
import
os
import
threading
from
util.log
import
*
from
util.sql
import
*
from
util.cases
import
*
from
util.dnodes
import
*
from
util.common
import
*
sys
.
path
.
append
(
"./7-tmq"
)
from
tmqCommon
import
*
class
TDTestCase
:
def
init
(
self
,
conn
,
logSql
,
replicaVar
=
1
):
self
.
replicaVar
=
int
(
replicaVar
)
tdLog
.
debug
(
f
"start to excute
{
__file__
}
"
)
tdSql
.
init
(
conn
.
cursor
())
def
checkData
(
self
):
tdSql
.
execute
(
'use db_raw'
)
tdSql
.
query
(
"select * from d1"
)
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
1
,
120
)
tdSql
.
query
(
"select * from d2"
)
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
1
,
None
)
return
def
check
(
self
):
buildPath
=
tdCom
.
getBuildPath
()
cmdStr
=
'%s/build/bin/write_raw_block_test'
%
(
buildPath
)
tdLog
.
info
(
cmdStr
)
os
.
system
(
cmdStr
)
self
.
checkData
()
return
def
run
(
self
):
tdSql
.
prepare
()
self
.
check
()
def
stop
(
self
):
tdSql
.
close
()
tdLog
.
success
(
f
"
{
__file__
}
successfully executed"
)
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
tdCases
.
addWindows
(
__file__
,
TDTestCase
())
tools/shell/src/shellArguments.c
浏览文件 @
d0c55ef5
...
...
@@ -18,17 +18,18 @@
#endif
#include "shellInt.h"
#include "version.h"
#ifndef CUS_NAME
char
cusName
[]
=
"TDengine"
;
char
cusName
[]
=
"TDengine"
;
#endif
#ifndef CUS_PROMPT
char
cusPrompt
[]
=
"taos"
;
char
cusPrompt
[]
=
"taos"
;
#endif
#ifndef CUS_EMAIL
char
cusEmail
[]
=
"<support@taosdata.com>"
;
char
cusEmail
[]
=
"<support@taosdata.com>"
;
#endif
#if defined(CUS_NAME) || defined(CUS_PROMPT) || defined(CUS_EMAIL)
...
...
@@ -58,9 +59,9 @@
#define SHELL_VERSION "Print program version."
#ifdef WEBSOCKET
#define SHELL_DSN
"The dsn to use when connecting to cloud server."
#define SHELL_REST
"Use restful mode when connecting."
#define SHELL_TIMEOUT
"Set the timeout for websocket query in seconds, default is 30."
#define SHELL_DSN "The dsn to use when connecting to cloud server."
#define SHELL_REST "Use restful mode when connecting."
#define SHELL_TIMEOUT "Set the timeout for websocket query in seconds, default is 30."
#endif
static
int32_t
shellParseSingleOpt
(
int32_t
key
,
char
*
arg
);
...
...
@@ -145,7 +146,7 @@ static void shellParseArgsUseArgp(int argc, char *argv[]) {
#endif
#ifndef ARGP_ERR_UNKNOWN
#define ARGP_ERR_UNKNOWN E2BIG
#define ARGP_ERR_UNKNOWN E2BIG
#endif
static
int32_t
shellParseSingleOpt
(
int32_t
key
,
char
*
arg
)
{
...
...
@@ -246,8 +247,8 @@ int32_t shellParseArgsWithoutArgp(int argc, char *argv[]) {
SShellArgs
*
pArgs
=
&
shell
.
args
;
for
(
int
i
=
1
;
i
<
argc
;
i
++
)
{
if
(
strcmp
(
argv
[
i
],
"--help"
)
==
0
||
strcmp
(
argv
[
i
],
"--usage"
)
==
0
||
strcmp
(
argv
[
i
],
"-?"
)
==
0
||
strcmp
(
argv
[
i
],
"/?"
)
==
0
)
{
if
(
strcmp
(
argv
[
i
],
"--help"
)
==
0
||
strcmp
(
argv
[
i
],
"--usage"
)
==
0
||
strcmp
(
argv
[
i
],
"-?"
)
==
0
||
strcmp
(
argv
[
i
],
"/?"
)
==
0
)
{
shellParseSingleOpt
(
'?'
,
NULL
);
return
0
;
}
...
...
@@ -263,10 +264,8 @@ int32_t shellParseArgsWithoutArgp(int argc, char *argv[]) {
return
-
1
;
}
if
(
key
[
1
]
==
'h'
||
key
[
1
]
==
'P'
||
key
[
1
]
==
'u'
||
key
[
1
]
==
'a'
||
key
[
1
]
==
'c'
||
key
[
1
]
==
's'
||
key
[
1
]
==
'f'
||
key
[
1
]
==
'd'
||
key
[
1
]
==
'w'
||
key
[
1
]
==
'n'
||
key
[
1
]
==
'l'
||
key
[
1
]
==
'N'
if
(
key
[
1
]
==
'h'
||
key
[
1
]
==
'P'
||
key
[
1
]
==
'u'
||
key
[
1
]
==
'a'
||
key
[
1
]
==
'c'
||
key
[
1
]
==
's'
||
key
[
1
]
==
'f'
||
key
[
1
]
==
'd'
||
key
[
1
]
==
'w'
||
key
[
1
]
==
'n'
||
key
[
1
]
==
'l'
||
key
[
1
]
==
'N'
#ifdef WEBSOCKET
||
key
[
1
]
==
'E'
||
key
[
1
]
==
'T'
#endif
...
...
@@ -282,12 +281,10 @@ int32_t shellParseArgsWithoutArgp(int argc, char *argv[]) {
}
shellParseSingleOpt
(
key
[
1
],
val
);
i
++
;
}
else
if
(
key
[
1
]
==
'p'
||
key
[
1
]
==
'A'
||
key
[
1
]
==
'C'
||
key
[
1
]
==
'r'
||
key
[
1
]
==
'k'
||
key
[
1
]
==
't'
||
key
[
1
]
==
'V'
||
key
[
1
]
==
'?'
||
key
[
1
]
==
1
}
else
if
(
key
[
1
]
==
'p'
||
key
[
1
]
==
'A'
||
key
[
1
]
==
'C'
||
key
[
1
]
==
'r'
||
key
[
1
]
==
'k'
||
key
[
1
]
==
't'
||
key
[
1
]
==
'V'
||
key
[
1
]
==
'?'
||
key
[
1
]
==
1
#ifdef WEBSOCKET
||
key
[
1
]
==
'R'
||
key
[
1
]
==
'R'
#endif
)
{
shellParseSingleOpt
(
key
[
1
],
NULL
);
...
...
@@ -420,9 +417,15 @@ int32_t shellParseArgs(int32_t argc, char *argv[]) {
sprintf
(
promptContinueFormat
,
"%%%zus> "
,
strlen
(
cusPrompt
));
sprintf
(
shell
.
info
.
promptContinue
,
promptContinueFormat
,
" "
);
shell
.
info
.
promptSize
=
strlen
(
shell
.
info
.
promptHeader
);
#ifdef TD_ENTERPRISE
snprintf
(
shell
.
info
.
programVersion
,
sizeof
(
shell
.
info
.
programVersion
),
"version: %s compatible_version: %s
\n
gitinfo: %s
\n
gitinfoOfInternal: %s
\n
buildInfo: %s"
,
version
,
compatible_version
,
gitinfo
,
gitinfoOfInternal
,
buildinfo
);
#else
snprintf
(
shell
.
info
.
programVersion
,
sizeof
(
shell
.
info
.
programVersion
),
"version: %s compatible_version: %s
\n
gitinfo: %s
\n
buildInfo: %s"
,
version
,
compatible_version
,
gitinfo
,
buildinfo
);
#endif
#if defined(_TD_WINDOWS_64) || defined(_TD_WINDOWS_32)
shell
.
info
.
osname
=
"Windows"
;
...
...
utils/test/c/CMakeLists.txt
浏览文件 @
d0c55ef5
...
...
@@ -3,6 +3,7 @@ add_dependencies(tmq_demo taos)
add_executable
(
tmq_sim tmqSim.c
)
add_executable
(
create_table createTable.c
)
add_executable
(
tmq_taosx_ci tmq_taosx_ci.c
)
add_executable
(
write_raw_block_test write_raw_block_test.c
)
add_executable
(
sml_test sml_test.c
)
add_executable
(
get_db_name_test get_db_name_test.c
)
target_link_libraries
(
...
...
@@ -34,6 +35,14 @@ target_link_libraries(
PUBLIC os
)
target_link_libraries
(
write_raw_block_test
PUBLIC taos_static
PUBLIC util
PUBLIC common
PUBLIC os
)
target_link_libraries
(
sml_test
PUBLIC taos_static
...
...
utils/test/c/write_raw_block_test.c
0 → 100644
浏览文件 @
d0c55ef5
/*
* Copyright (c) 2019 TAOS Data, Inc. <jhtao@taosdata.com>
*
* This program is free software: you can use, redistribute, and/or modify
* it under the terms of the GNU Affero General Public License, version 3
* or later ("AGPL"), as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <assert.h>
#include <stdio.h>
#include <time.h>
#include "taos.h"
#include "types.h"
int
buildStable
(
TAOS
*
pConn
,
TAOS_RES
*
pRes
)
{
pRes
=
taos_query
(
pConn
,
"CREATE STABLE `meters` (`ts` TIMESTAMP, `current` INT, `voltage` INT, `phase` FLOAT) TAGS "
"(`groupid` INT, `location` VARCHAR(16))"
);
if
(
taos_errno
(
pRes
)
!=
0
)
{
printf
(
"failed to create super table meters, reason:%s
\n
"
,
taos_errstr
(
pRes
));
return
-
1
;
}
taos_free_result
(
pRes
);
pRes
=
taos_query
(
pConn
,
"create table d0 using meters tags(1, 'San Francisco')"
);
if
(
taos_errno
(
pRes
)
!=
0
)
{
printf
(
"failed to create child table d0, reason:%s
\n
"
,
taos_errstr
(
pRes
));
return
-
1
;
}
taos_free_result
(
pRes
);
pRes
=
taos_query
(
pConn
,
"insert into d0 (ts, current) values (now, 120)"
);
if
(
taos_errno
(
pRes
)
!=
0
)
{
printf
(
"failed to insert into table d0, reason:%s
\n
"
,
taos_errstr
(
pRes
));
return
-
1
;
}
taos_free_result
(
pRes
);
pRes
=
taos_query
(
pConn
,
"create table d1 using meters tags(2, 'San Francisco')"
);
if
(
taos_errno
(
pRes
)
!=
0
)
{
printf
(
"failed to create child table d1, reason:%s
\n
"
,
taos_errstr
(
pRes
));
return
-
1
;
}
taos_free_result
(
pRes
);
pRes
=
taos_query
(
pConn
,
"create table d2 using meters tags(3, 'San Francisco')"
);
if
(
taos_errno
(
pRes
)
!=
0
)
{
printf
(
"failed to create child table d1, reason:%s
\n
"
,
taos_errstr
(
pRes
));
return
-
1
;
}
taos_free_result
(
pRes
);
return
0
;
}
int32_t
init_env
()
{
TAOS
*
pConn
=
taos_connect
(
"localhost"
,
"root"
,
"taosdata"
,
NULL
,
0
);
if
(
pConn
==
NULL
)
{
return
-
1
;
}
TAOS_RES
*
pRes
=
taos_query
(
pConn
,
"drop database if exists db_raw"
);
if
(
taos_errno
(
pRes
)
!=
0
)
{
printf
(
"error in drop db_taosx, reason:%s
\n
"
,
taos_errstr
(
pRes
));
return
-
1
;
}
taos_free_result
(
pRes
);
pRes
=
taos_query
(
pConn
,
"create database if not exists db_raw vgroups 2"
);
if
(
taos_errno
(
pRes
)
!=
0
)
{
printf
(
"error in create db_taosx, reason:%s
\n
"
,
taos_errstr
(
pRes
));
return
-
1
;
}
taos_free_result
(
pRes
);
pRes
=
taos_query
(
pConn
,
"use db_raw"
);
if
(
taos_errno
(
pRes
)
!=
0
)
{
printf
(
"error in create db_taosx, reason:%s
\n
"
,
taos_errstr
(
pRes
));
return
-
1
;
}
taos_free_result
(
pRes
);
buildStable
(
pConn
,
pRes
);
pRes
=
taos_query
(
pConn
,
"select * from d0"
);
if
(
taos_errno
(
pRes
)
!=
0
)
{
printf
(
"error in drop db_taosx, reason:%s
\n
"
,
taos_errstr
(
pRes
));
return
-
1
;
}
void
*
data
=
NULL
;
int32_t
numOfRows
=
0
;
int
error_code
=
taos_fetch_raw_block
(
pRes
,
&
numOfRows
,
&
data
);
ASSERT
(
error_code
==
0
);
ASSERT
(
numOfRows
==
1
);
taos_write_raw_block
(
pConn
,
numOfRows
,
data
,
"d1"
);
taos_free_result
(
pRes
);
pRes
=
taos_query
(
pConn
,
"select ts,phase from d0"
);
if
(
taos_errno
(
pRes
)
!=
0
)
{
printf
(
"error in drop db_taosx, reason:%s
\n
"
,
taos_errstr
(
pRes
));
return
-
1
;
}
error_code
=
taos_fetch_raw_block
(
pRes
,
&
numOfRows
,
&
data
);
ASSERT
(
error_code
==
0
);
ASSERT
(
numOfRows
==
1
);
int
numFields
=
taos_num_fields
(
pRes
);
TAOS_FIELD
*
fields
=
taos_fetch_fields
(
pRes
);
taos_write_raw_block_with_fields
(
pConn
,
numOfRows
,
data
,
"d2"
,
fields
,
numFields
);
taos_free_result
(
pRes
);
taos_close
(
pConn
);
return
0
;
}
int
main
(
int
argc
,
char
*
argv
[])
{
if
(
init_env
()
<
0
)
{
return
-
1
;
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录