提交 12c338e4 编写于 作者: C Cary Xu

Merge branch 'develop' into feature/TS-238-D

...@@ -16,9 +16,9 @@ ...@@ -16,9 +16,9 @@
[submodule "deps/TSZ"] [submodule "deps/TSZ"]
path = deps/TSZ path = deps/TSZ
url = https://github.com/taosdata/TSZ.git url = https://github.com/taosdata/TSZ.git
[submodule "src/plugins/blm3"]
path = src/plugins/blm3
url = https://github.com/taosdata/blm3
[submodule "deps/avro"] [submodule "deps/avro"]
path = deps/avro path = deps/avro
url = https://github.com/apache/avro url = https://github.com/apache/avro
[submodule "src/plugins/taosadapter"]
path = src/plugins/taosadapter
url = https://github.com/taosdata/taosadapter
...@@ -181,6 +181,76 @@ def pre_test_noinstall(){ ...@@ -181,6 +181,76 @@ def pre_test_noinstall(){
''' '''
return 1 return 1
} }
def pre_test_mac(){
sh'hostname'
sh'''
cd ${WKC}
git reset --hard HEAD~10 >/dev/null
'''
script {
if (env.CHANGE_TARGET == 'master') {
sh '''
cd ${WKC}
git checkout master
'''
}
else if(env.CHANGE_TARGET == '2.0'){
sh '''
cd ${WKC}
git checkout 2.0
'''
}
else{
sh '''
cd ${WKC}
git checkout develop
'''
}
}
sh'''
cd ${WKC}
git pull >/dev/null
git fetch origin +refs/pull/${CHANGE_ID}/merge
git checkout -qf FETCH_HEAD
git clean -dfx
git submodule update --init --recursive
cd ${WK}
git reset --hard HEAD~10
'''
script {
if (env.CHANGE_TARGET == 'master') {
sh '''
cd ${WK}
git checkout master
'''
}
else if(env.CHANGE_TARGET == '2.0'){
sh '''
cd ${WK}
git checkout 2.0
'''
}
else{
sh '''
cd ${WK}
git checkout develop
'''
}
}
sh '''
cd ${WK}
git pull >/dev/null
export TZ=Asia/Harbin
date
git clean -dfx
mkdir debug
cd debug
cmake .. > /dev/null
cmake --build .
'''
return 1
}
def pre_test_win(){ def pre_test_win(){
bat ''' bat '''
taskkill /f /t /im python.exe taskkill /f /t /im python.exe
...@@ -581,6 +651,12 @@ pipeline { ...@@ -581,6 +651,12 @@ pipeline {
pre_test_noinstall() pre_test_noinstall()
} }
} }
stage('Mac_build') {
agent{label " catalina "}
steps {
pre_test_mac()
}
}
stage('build'){ stage('build'){
agent{label " wintest "} agent{label " wintest "}
......
...@@ -129,7 +129,7 @@ mkdir debug && cd debug ...@@ -129,7 +129,7 @@ mkdir debug && cd debug
cmake .. && cmake --build . cmake .. && cmake --build .
``` ```
Note TDengine 2.3.0.0 and later use a component named 'blm3' to play http daemon role by default instead of the http daemon embedded in the early version of TDengine. The blm3 is programmed by go language. If you pull TDengine source code to the latest from an existing codebase, please execute 'git submodule update --init --recursive' to pull blm3 source code. Please install go language 1.14 or above for compiling blm3. If you meet difficulties regarding 'go mod', especially you are from China, you can use a proxy to solve the problem. Note TDengine 2.3.x.0 and later use a component named 'taosadapter' to play http daemon role by default instead of the http daemon embedded in the early version of TDengine. The taosadapter is programmed by go language. If you pull TDengine source code to the latest from an existing codebase, please execute 'git submodule update --init --recursive' to pull taosadapter source code. Please install go language 1.14 or above for compiling taosadapter. If you meet difficulties regarding 'go mod', especially you are from China, you can use a proxy to solve the problem.
``` ```
go env -w GO111MODULE=on go env -w GO111MODULE=on
go env -w GOPROXY=https://goproxy.cn,direct go env -w GOPROXY=https://goproxy.cn,direct
......
CMAKE_MINIMUM_REQUIRED(VERSION 2.8...3.20) CMAKE_MINIMUM_REQUIRED(VERSION 3.0...3.20)
PROJECT(TDengine) PROJECT(TDengine)
IF (TD_ACCOUNT) IF (TD_ACCOUNT)
...@@ -121,7 +121,7 @@ IF (TD_MIPS_32) ...@@ -121,7 +121,7 @@ IF (TD_MIPS_32)
SET(COMMON_FLAGS "-Wall -Werror -fPIC -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE") SET(COMMON_FLAGS "-Wall -Werror -fPIC -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE")
ENDIF () ENDIF ()
IF (TD_APLHINE) IF (TD_ALPINE)
SET(COMMON_FLAGS "${COMMON_FLAGS} -largp") SET(COMMON_FLAGS "${COMMON_FLAGS} -largp")
link_libraries(/usr/lib/libargp.a) link_libraries(/usr/lib/libargp.a)
ADD_DEFINITIONS(-D_ALPINE) ADD_DEFINITIONS(-D_ALPINE)
...@@ -172,11 +172,14 @@ IF (TD_LINUX) ...@@ -172,11 +172,14 @@ IF (TD_LINUX)
ENDIF () ENDIF ()
IF (TD_MEMORY_SANITIZER) IF (TD_MEMORY_SANITIZER)
SET(DEBUG_FLAGS "-fsanitize=address -fsanitize=undefined -fno-sanitize-recover=all -fsanitize=float-divide-by-zero -fsanitize=float-cast-overflow -fno-sanitize=null -fno-sanitize=alignment -static-libasan -O0 -g3 -DDEBUG") IF (TD_ARCHLINUX)
MESSAGE(STATUS "memory sanitizer detected as true") SET(DEBUG_FLAGS "-fsanitize=address -fsanitize=undefined -fno-sanitize-recover=all -fsanitize=float-divide-by-zero -fsanitize=float-cast-overflow -fno-sanitize=null -fno-sanitize=alignment -O0 -g3 -DDEBUG")
ELSE ()
SET(DEBUG_FLAGS "-fsanitize=address -fsanitize=undefined -fno-sanitize-recover=all -fsanitize=float-divide-by-zero -fsanitize=float-cast-overflow -fno-sanitize=null -fno-sanitize=alignment -static-libasan -O0 -g3 -DDEBUG")
ENDIF ()
MESSAGE(STATUS "${BoldRed}Will compile with memory sanitizer! ${ColourReset}")
ELSE () ELSE ()
SET(DEBUG_FLAGS "-O0 -g3 -DDEBUG") SET(DEBUG_FLAGS "-O0 -g3 -DDEBUG")
MESSAGE(STATUS "memory sanitizer detected as false")
ENDIF () ENDIF ()
SET(RELEASE_FLAGS "-O3 -Wno-error") SET(RELEASE_FLAGS "-O3 -Wno-error")
......
CMAKE_MINIMUM_REQUIRED(VERSION 2.8...3.20) CMAKE_MINIMUM_REQUIRED(VERSION 3.0...3.20)
PROJECT(TDengine) PROJECT(TDengine)
SET(CMAKE_C_STANDARD 11) SET(CMAKE_C_STANDARD 11)
......
CMAKE_MINIMUM_REQUIRED(VERSION 2.8...3.20) CMAKE_MINIMUM_REQUIRED(VERSION 3.0...3.20)
PROJECT(TDengine) PROJECT(TDengine)
IF (${ACCOUNT} MATCHES "true") IF (${ACCOUNT} MATCHES "true")
......
CMAKE_MINIMUM_REQUIRED(VERSION 2.8...3.20) CMAKE_MINIMUM_REQUIRED(VERSION 3.0...3.20)
PROJECT(TDengine) PROJECT(TDengine)
# #
...@@ -21,7 +21,7 @@ SET(TD_LINUX FALSE) ...@@ -21,7 +21,7 @@ SET(TD_LINUX FALSE)
SET(TD_ARM_32 FALSE) SET(TD_ARM_32 FALSE)
SET(TD_MIPS_64 FALSE) SET(TD_MIPS_64 FALSE)
SET(TD_MIPS_32 FALSE) SET(TD_MIPS_32 FALSE)
SET(TD_APLHINE FALSE) SET(TD_ALPINE FALSE)
SET(TD_NINGSI FALSE) SET(TD_NINGSI FALSE)
SET(TD_NINGSI_60 FALSE) SET(TD_NINGSI_60 FALSE)
SET(TD_NINGSI_80 FALSE) SET(TD_NINGSI_80 FALSE)
...@@ -36,7 +36,7 @@ IF (${CMAKE_SYSTEM_NAME} MATCHES "Linux") ...@@ -36,7 +36,7 @@ IF (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
# Get OS information and store in variable TD_OS_INFO. # Get OS information and store in variable TD_OS_INFO.
# #
execute_process(COMMAND chmod 777 ${TD_COMMUNITY_DIR}/packaging/tools/get_os.sh) execute_process(COMMAND chmod 777 ${TD_COMMUNITY_DIR}/packaging/tools/get_os.sh)
execute_process(COMMAND ${TD_COMMUNITY_DIR}/packaging/tools/get_os.sh "" OUTPUT_VARIABLE TD_OS_INFO) execute_process(COMMAND sh ${TD_COMMUNITY_DIR}/packaging/tools/get_os.sh "" OUTPUT_VARIABLE TD_OS_INFO)
MESSAGE(STATUS "The current os is " ${TD_OS_INFO}) MESSAGE(STATUS "The current os is " ${TD_OS_INFO})
SET(TD_LINUX TRUE) SET(TD_LINUX TRUE)
...@@ -52,8 +52,13 @@ IF (${CMAKE_SYSTEM_NAME} MATCHES "Linux") ...@@ -52,8 +52,13 @@ IF (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
ENDIF () ENDIF ()
IF (${TD_OS_INFO} MATCHES "Alpine") IF (${TD_OS_INFO} MATCHES "Alpine")
SET(TD_APLHINE TRUE) SET(TD_ALPINE TRUE)
MESSAGE(STATUS "The current OS is Alpine, append extra flags") MESSAGE(STATUS "The current OS is Alpine Linux, append extra flags")
ELSEIF (${TD_OS_INFO} MATCHES "Arch")
SET(TD_ARCHLINUX TRUE)
MESSAGE(STATUS "The current OS is Arch Linux")
ELSE ()
MESSAGE(STATUS "Ths distro is " ${TD_OS_INFO})
ENDIF() ENDIF()
ELSEIF (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") ELSEIF (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
SET(TD_DARWIN TRUE) SET(TD_DARWIN TRUE)
...@@ -155,7 +160,7 @@ ELSEIF (${OSTYPE} MATCHES "Linux") ...@@ -155,7 +160,7 @@ ELSEIF (${OSTYPE} MATCHES "Linux")
MESSAGE(STATUS "input osType: Linux") MESSAGE(STATUS "input osType: Linux")
ELSEIF (${OSTYPE} MATCHES "Alpine") ELSEIF (${OSTYPE} MATCHES "Alpine")
MESSAGE(STATUS "input osType: Alpine") MESSAGE(STATUS "input osType: Alpine")
SET(TD_APLHINE TRUE) SET(TD_ALPINE TRUE)
ELSE () ELSE ()
MESSAGE(STATUS "The user specified osType is unknown: " ${OSTYPE}) MESSAGE(STATUS "The user specified osType is unknown: " ${OSTYPE})
ENDIF () ENDIF ()
CMAKE_MINIMUM_REQUIRED(VERSION 2.8...3.20) CMAKE_MINIMUM_REQUIRED(VERSION 3.0...3.20)
PROJECT(TDengine) PROJECT(TDengine)
IF (DEFINED VERNUMBER) IF (DEFINED VERNUMBER)
......
...@@ -145,7 +145,7 @@ insert delay, avg: 8.31ms, max: 860.12ms, min: 2.00ms ...@@ -145,7 +145,7 @@ insert delay, avg: 8.31ms, max: 860.12ms, min: 2.00ms
``` ```
$ taosdemo --help $ taosdemo --help
-f, --file=FILE The meta file to the execution procedure. -f, --file=FILE The meta file to the execution procedure. Currently, we support standard UTF-8 (without BOM) encoded files only.
-u, --user=USER The user name to use when connecting to the server. -u, --user=USER The user name to use when connecting to the server.
-p, --password The password to use when connecting to the server. -p, --password The password to use when connecting to the server.
-c, --config-dir=CONFIG_DIR Configuration directory. -c, --config-dir=CONFIG_DIR Configuration directory.
...@@ -442,7 +442,7 @@ TDengine是涛思数据专为物联网、车联网、工业互联网、IT运维 ...@@ -442,7 +442,7 @@ TDengine是涛思数据专为物联网、车联网、工业互联网、IT运维
taosdemo支持两种配置参数的模式,一种是命令行参数,一种是使用json格式的配置文件。 taosdemo支持两种配置参数的模式,一种是命令行参数,一种是使用json格式的配置文件。
一、命令行参数 一、命令行参数
-f:指定taosdemo所需参数的meta文件。当使用该参数时,其他所有命令行参数都失效。可选项,缺省是NULL。 -f:指定taosdemo所需参数的meta文件。当使用该参数时,其他所有命令行参数都失效。可选项,缺省是NULL。目前仅支持不含 BOM(byte-order mark)的标准 UTF-8 编码文件。
-u: 用户名。可选项,缺省是“root“。 -u: 用户名。可选项,缺省是“root“。
......
...@@ -185,23 +185,23 @@ TDengine 中时间戳的时区总是由客户端进行处理,而与服务端 ...@@ -185,23 +185,23 @@ TDengine 中时间戳的时区总是由客户端进行处理,而与服务端
| TCP | 6041 | 客户端与服务端之间的 RESTful 通讯。 | 随 serverPort 端口变化。 | | TCP | 6041 | 客户端与服务端之间的 RESTful 通讯。 | 随 serverPort 端口变化。 |
| TCP | 6042 | Arbitrator 的服务端口。 | 随 Arbitrator 启动参数设置变化。 | | TCP | 6042 | Arbitrator 的服务端口。 | 随 Arbitrator 启动参数设置变化。 |
| TCP | 6043 | TaosKeeper 监控服务端口。 | 随 TaosKeeper 启动参数设置变化。 | | TCP | 6043 | TaosKeeper 监控服务端口。 | 随 TaosKeeper 启动参数设置变化。 |
| TCP | 6044 | 支持 StatsD 的数据接入端口。 | 随 BLM3 启动参数设置变化(2.3.0.1+以上版本)。 | | TCP | 6044 | 支持 StatsD 的数据接入端口。 | 随 taosadapter 启动参数设置变化(2.3.0.1+以上版本)。 |
| TCP | 6045 | 支持 collectd 数据接入端口。 | 随 BLM3 启动参数设置变化(2.3.0.1+以上版本)。 | | TCP | 6045 | 支持 collectd 数据接入端口。 | 随 taosadapter 启动参数设置变化(2.3.0.1+以上版本)。 |
| TCP | 6060 | 企业版内 Monitor 服务的网络端口。 | | | TCP | 6060 | 企业版内 Monitor 服务的网络端口。 | |
| UDP | 6030-6034 | 客户端与服务端之间通讯。 | 随 serverPort 端口变化。 | | UDP | 6030-6034 | 客户端与服务端之间通讯。 | 随 serverPort 端口变化。 |
| UDP | 6035-6039 | 多节点集群的节点间通讯。 | 随 serverPort 端口变化。 | | UDP | 6035-6039 | 多节点集群的节点间通讯。 | 随 serverPort 端口变化。 |
## 20. go 语言编写组件编译失败怎样解决? ## 20. go 语言编写组件编译失败怎样解决?
新版本 TDengine 2.3.0.0 包含一个使用 go 语言开发的 BLM3 组件,取代之前内置的 httpd ,提供包含原 httpd 功能以及支持多种其他软件(Prometheus、Telegraf、collectd、StatsD等)的数据接入功能。 新版本 TDengine 2.3.0.0 包含一个使用 go 语言开发的 taosadapter 组件,取代之前内置的 httpd ,提供包含原 httpd 功能以及支持多种其他软件(Prometheus、Telegraf、collectd、StatsD等)的数据接入功能。
使用最新 develop 分支代码编译需要先 `git submodule update --init --recursive` 下载 blm3 仓库代码后再编译。 使用最新 develop 分支代码编译需要先 `git submodule update --init --recursive` 下载 taosadapter 仓库代码后再编译。
目前编译方式默认自动编译 blm3。go 语言版本要求 1.14 以上,如果发生 go 编译错误,往往是国内访问 go mod 问题,可以通过设置 go 环境变量来解决: 目前编译方式默认自动编译 taosadapter。go 语言版本要求 1.14 以上,如果发生 go 编译错误,往往是国内访问 go mod 问题,可以通过设置 go 环境变量来解决:
```sh ```sh
go env -w GO111MODULE=on go env -w GO111MODULE=on
go env -w GOPROXY=https://goproxy.cn,direct go env -w GOPROXY=https://goproxy.cn,direct
``` ```
如果希望继续使用之前的内置 httpd,可以关闭 blm3 编译,使用 如果希望继续使用之前的内置 httpd,可以关闭 taosadapter 编译,使用
`cmake .. -DBUILD_HTTP=true` 使用原来内置的 httpd。 `cmake .. -DBUILD_HTTP=true` 使用原来内置的 httpd。
...@@ -154,7 +154,7 @@ The complete list of taosdemo command-line arguments can be displayed via taosde ...@@ -154,7 +154,7 @@ The complete list of taosdemo command-line arguments can be displayed via taosde
``` ```
$ taosdemo --help $ taosdemo --help
-f, --file=FILE The meta file to the execution procedure. -f, --file=FILE The meta file to the execution procedure. Currently, we support standard UTF-8 (without BOM) encoded files only.
-u, --user=USER The user name to use when connecting to the server. -u, --user=USER The user name to use when connecting to the server.
-p, --password The password to use when connecting to the server. -p, --password The password to use when connecting to the server.
-c, --config-dir=CONFIG_DIR Configuration directory. -c, --config-dir=CONFIG_DIR Configuration directory.
......
...@@ -142,11 +142,11 @@ function check_main_path() { ...@@ -142,11 +142,11 @@ function check_main_path() {
function check_bin_path() { function check_bin_path() {
# check install bin dir and all sub dir # check install bin dir and all sub dir
bin_dir=("taos" "taosd" "blm3" "taosdemo" "taosdump" "remove.sh" "tarbitrator" "set_core.sh") bin_dir=("taos" "taosd" "taosadapter" "taosdemo" "taosdump" "remove.sh" "tarbitrator" "set_core.sh")
for i in "${bin_dir[@]}";do for i in "${bin_dir[@]}";do
check_file ${sbin_dir} $i check_file ${sbin_dir} $i
done done
lbin_dir=("taos" "taosd" "blm3" "taosdemo" "taosdump" "rmtaos" "tarbitrator" "set_core") lbin_dir=("taos" "taosd" "taosadapter" "taosdemo" "taosdump" "rmtaos" "tarbitrator" "set_core")
for i in "${lbin_dir[@]}";do for i in "${lbin_dir[@]}";do
check_link ${bin_link_dir}/$i check_link ${bin_link_dir}/$i
done done
...@@ -177,11 +177,11 @@ function check_header_path() { ...@@ -177,11 +177,11 @@ function check_header_path() {
echo -e "Check bin path:\033[32mOK\033[0m!" echo -e "Check bin path:\033[32mOK\033[0m!"
} }
function check_blm3_config_dir() { function check_taosadapter_config_dir() {
# check all config # check all config
check_file ${cfg_install_dir} blm.toml check_file ${cfg_install_dir} taosadapter.toml
check_file ${cfg_install_dir} blm3.service check_file ${cfg_install_dir} taosadapter.service
check_file ${install_main_dir}/cfg blm.toml.org check_file ${install_main_dir}/cfg taosadapter.toml.org
echo -e "Check conf path:\033[32mOK\033[0m!" echo -e "Check conf path:\033[32mOK\033[0m!"
} }
...@@ -222,7 +222,7 @@ function test_TDengine() { ...@@ -222,7 +222,7 @@ function test_TDengine() {
check_lib_path check_lib_path
check_header_path check_header_path
check_config_dir check_config_dir
check_blm3_config_dir check_taosadapter_config_dir
check_log_path check_log_path
check_data_path check_data_path
result=`taos -s 'create database test ;create table test.tt(ts timestamp ,i int);insert into test.tt values(now,11);select * from test.tt' 2>&1 ||:` result=`taos -s 'create database test ;create table test.tt(ts timestamp ,i int);insert into test.tt values(now,11);select * from test.tt' 2>&1 ||:`
......
...@@ -28,12 +28,12 @@ if [ -f "${install_main_dir}/taos.cfg" ]; then ...@@ -28,12 +28,12 @@ if [ -f "${install_main_dir}/taos.cfg" ]; then
${csudo} rm -f ${install_main_dir}/cfg/taos.cfg || : ${csudo} rm -f ${install_main_dir}/cfg/taos.cfg || :
fi fi
if [ -f "${install_main_dir}/blm.toml" ]; then if [ -f "${install_main_dir}/taosadapter.toml" ]; then
${csudo} rm -f ${install_main_dir}/cfg/blm.toml || : ${csudo} rm -f ${install_main_dir}/cfg/taosadapter.toml || :
fi fi
if [ -f "${install_main_dir}/blm3.service" ]; then if [ -f "${install_main_dir}/taosadapter.service" ]; then
${csudo} rm -f ${install_main_dir}/cfg/blm3.service || : ${csudo} rm -f ${install_main_dir}/cfg/taosadapter.service || :
fi fi
# there can not libtaos.so*, otherwise ln -s error # there can not libtaos.so*, otherwise ln -s error
......
...@@ -25,7 +25,7 @@ else ...@@ -25,7 +25,7 @@ else
# Remove all links # Remove all links
${csudo} rm -f ${bin_link_dir}/taos || : ${csudo} rm -f ${bin_link_dir}/taos || :
${csudo} rm -f ${bin_link_dir}/taosd || : ${csudo} rm -f ${bin_link_dir}/taosd || :
${csudo} rm -f ${bin_link_dir}/blm3 || : ${csudo} rm -f ${bin_link_dir}/taosadapter || :
${csudo} rm -f ${bin_link_dir}/taosdemo || : ${csudo} rm -f ${bin_link_dir}/taosdemo || :
${csudo} rm -f ${bin_link_dir}/taosdump || : ${csudo} rm -f ${bin_link_dir}/taosdump || :
${csudo} rm -f ${cfg_link_dir}/* || : ${csudo} rm -f ${cfg_link_dir}/* || :
......
...@@ -44,11 +44,11 @@ mkdir -p ${pkg_dir}${install_home_path}/init.d ...@@ -44,11 +44,11 @@ mkdir -p ${pkg_dir}${install_home_path}/init.d
mkdir -p ${pkg_dir}${install_home_path}/script mkdir -p ${pkg_dir}${install_home_path}/script
cp ${compile_dir}/../packaging/cfg/taos.cfg ${pkg_dir}${install_home_path}/cfg cp ${compile_dir}/../packaging/cfg/taos.cfg ${pkg_dir}${install_home_path}/cfg
if [ -f "${compile_dir}/test/cfg/blm.toml" ]; then if [ -f "${compile_dir}/test/cfg/taosadapter.toml" ]; then
cp ${compile_dir}/test/cfg/blm.toml ${pkg_dir}${install_home_path}/cfg cp ${compile_dir}/test/cfg/taosadapter.toml ${pkg_dir}${install_home_path}/cfg
fi fi
if [ -f "${compile_dir}/test/cfg/blm3.service" ]; then if [ -f "${compile_dir}/test/cfg/taosadapter.service" ]; then
cp ${compile_dir}/test/cfg/blm3.service ${pkg_dir}${install_home_path}/cfg ||: cp ${compile_dir}/test/cfg/taosadapter.service ${pkg_dir}${install_home_path}/cfg ||:
fi fi
cp ${compile_dir}/../packaging/deb/taosd ${pkg_dir}${install_home_path}/init.d cp ${compile_dir}/../packaging/deb/taosd ${pkg_dir}${install_home_path}/init.d
...@@ -62,8 +62,8 @@ cp ${compile_dir}/build/bin/taosdemo ${pkg_dir}${install_home_pat ...@@ -62,8 +62,8 @@ cp ${compile_dir}/build/bin/taosdemo ${pkg_dir}${install_home_pat
cp ${compile_dir}/build/bin/taosdump ${pkg_dir}${install_home_path}/bin cp ${compile_dir}/build/bin/taosdump ${pkg_dir}${install_home_path}/bin
cp ${compile_dir}/build/bin/taosd ${pkg_dir}${install_home_path}/bin cp ${compile_dir}/build/bin/taosd ${pkg_dir}${install_home_path}/bin
if [ -f "${compile_dir}/build/bin/blm3" ]; then if [ -f "${compile_dir}/build/bin/taosadapter" ]; then
cp ${compile_dir}/build/bin/blm3 ${pkg_dir}${install_home_path}/bin ||: cp ${compile_dir}/build/bin/taosadapter ${pkg_dir}${install_home_path}/bin ||:
fi fi
cp ${compile_dir}/build/bin/taos ${pkg_dir}${install_home_path}/bin cp ${compile_dir}/build/bin/taos ${pkg_dir}${install_home_path}/bin
......
#!/bin/bash #!/bin/bash
# #
# Modified from original source: Elastic Search # Modified from original source: Elastic Search
# https://github.com/elasticsearch/elasticsearch # https://github.com/elasticsearch/elasticsearch
...@@ -25,7 +25,7 @@ GROUP="root" ...@@ -25,7 +25,7 @@ GROUP="root"
DAEMON="/usr/local/taos/bin/taosd" DAEMON="/usr/local/taos/bin/taosd"
DAEMON_OPTS="" DAEMON_OPTS=""
HTTPD_NAME="blm3" HTTPD_NAME="taosadapter"
DAEMON_HTTPD_NAME=$HTTPD_NAME DAEMON_HTTPD_NAME=$HTTPD_NAME
DAEMON_HTTPD="/usr/local/taos/bin/$HTTPD_NAME" DAEMON_HTTPD="/usr/local/taos/bin/$HTTPD_NAME"
......
...@@ -54,11 +54,11 @@ mkdir -p %{buildroot}%{homepath}/init.d ...@@ -54,11 +54,11 @@ mkdir -p %{buildroot}%{homepath}/init.d
mkdir -p %{buildroot}%{homepath}/script mkdir -p %{buildroot}%{homepath}/script
cp %{_compiledir}/../packaging/cfg/taos.cfg %{buildroot}%{homepath}/cfg cp %{_compiledir}/../packaging/cfg/taos.cfg %{buildroot}%{homepath}/cfg
if [ -f %{_compiledir}/test/cfg/blm.toml ]; then if [ -f %{_compiledir}/test/cfg/taosadapter.toml ]; then
cp %{_compiledir}/test/cfg/blm.toml %{buildroot}%{homepath}/cfg cp %{_compiledir}/test/cfg/taosadapter.toml %{buildroot}%{homepath}/cfg
fi fi
if [ -f %{_compiledir}/test/cfg/blm3.service ]; then if [ -f %{_compiledir}/test/cfg/taosadapter.service ]; then
cp %{_compiledir}/test/cfg/blm3.service %{buildroot}%{homepath}/cfg cp %{_compiledir}/test/cfg/taosadapter.service %{buildroot}%{homepath}/cfg
fi fi
cp %{_compiledir}/../packaging/rpm/taosd %{buildroot}%{homepath}/init.d cp %{_compiledir}/../packaging/rpm/taosd %{buildroot}%{homepath}/init.d
cp %{_compiledir}/../packaging/tools/post.sh %{buildroot}%{homepath}/script cp %{_compiledir}/../packaging/tools/post.sh %{buildroot}%{homepath}/script
...@@ -68,8 +68,8 @@ cp %{_compiledir}/../packaging/tools/set_core.sh %{buildroot}%{homepath}/bin ...@@ -68,8 +68,8 @@ cp %{_compiledir}/../packaging/tools/set_core.sh %{buildroot}%{homepath}/bin
cp %{_compiledir}/../packaging/tools/taosd-dump-cfg.gdb %{buildroot}%{homepath}/bin cp %{_compiledir}/../packaging/tools/taosd-dump-cfg.gdb %{buildroot}%{homepath}/bin
cp %{_compiledir}/build/bin/taos %{buildroot}%{homepath}/bin cp %{_compiledir}/build/bin/taos %{buildroot}%{homepath}/bin
cp %{_compiledir}/build/bin/taosd %{buildroot}%{homepath}/bin cp %{_compiledir}/build/bin/taosd %{buildroot}%{homepath}/bin
if [ -f %{_compiledir}/build/bin/blm3 ]; then if [ -f %{_compiledir}/build/bin/taosadapter ]; then
cp %{_compiledir}/build/bin/blm3 %{buildroot}%{homepath}/bin ||: cp %{_compiledir}/build/bin/taosadapter %{buildroot}%{homepath}/bin ||:
fi fi
cp %{_compiledir}/build/bin/taosdemo %{buildroot}%{homepath}/bin cp %{_compiledir}/build/bin/taosdemo %{buildroot}%{homepath}/bin
cp %{_compiledir}/build/bin/taosdump %{buildroot}%{homepath}/bin cp %{_compiledir}/build/bin/taosdump %{buildroot}%{homepath}/bin
...@@ -161,9 +161,9 @@ if [ -f %{cfg_install_dir}/taos.cfg ]; then ...@@ -161,9 +161,9 @@ if [ -f %{cfg_install_dir}/taos.cfg ]; then
${csudo} rm -f %{cfg_install_dir}/cfg/taos.cfg || : ${csudo} rm -f %{cfg_install_dir}/cfg/taos.cfg || :
fi fi
# if blm.toml already exist, remove it # if taosadapter.toml already exist, remove it
if [ -f %{cfg_install_dir}/blm.toml ]; then if [ -f %{cfg_install_dir}/taosadapter.toml ]; then
${csudo} rm -f %{cfg_install_dir}/cfg/blm.toml || : ${csudo} rm -f %{cfg_install_dir}/cfg/taosadapter.toml || :
fi fi
# there can not libtaos.so*, otherwise ln -s error # there can not libtaos.so*, otherwise ln -s error
...@@ -204,7 +204,7 @@ if [ $1 -eq 0 ];then ...@@ -204,7 +204,7 @@ if [ $1 -eq 0 ];then
# Remove all links # Remove all links
${csudo} rm -f ${bin_link_dir}/taos || : ${csudo} rm -f ${bin_link_dir}/taos || :
${csudo} rm -f ${bin_link_dir}/taosd || : ${csudo} rm -f ${bin_link_dir}/taosd || :
${csudo} rm -f ${bin_link_dir}/blm3 || : ${csudo} rm -f ${bin_link_dir}/taosadapter || :
${csudo} rm -f ${bin_link_dir}/taosdemo || : ${csudo} rm -f ${bin_link_dir}/taosdemo || :
${csudo} rm -f ${bin_link_dir}/taosdump || : ${csudo} rm -f ${bin_link_dir}/taosdump || :
${csudo} rm -f ${cfg_link_dir}/* || : ${csudo} rm -f ${cfg_link_dir}/* || :
......
...@@ -185,7 +185,7 @@ function install_bin() { ...@@ -185,7 +185,7 @@ function install_bin() {
# Remove links # Remove links
${csudo} rm -f ${bin_link_dir}/taos || : ${csudo} rm -f ${bin_link_dir}/taos || :
${csudo} rm -f ${bin_link_dir}/taosd || : ${csudo} rm -f ${bin_link_dir}/taosd || :
${csudo} rm -f ${bin_link_dir}/blm3 || : ${csudo} rm -f ${bin_link_dir}/taosadapter || :
${csudo} rm -f ${bin_link_dir}/taosdemo || : ${csudo} rm -f ${bin_link_dir}/taosdemo || :
${csudo} rm -f ${bin_link_dir}/taosdump || : ${csudo} rm -f ${bin_link_dir}/taosdump || :
${csudo} rm -f ${bin_link_dir}/rmtaos || : ${csudo} rm -f ${bin_link_dir}/rmtaos || :
...@@ -197,7 +197,7 @@ function install_bin() { ...@@ -197,7 +197,7 @@ function install_bin() {
#Make link #Make link
[ -x ${install_main_dir}/bin/taos ] && ${csudo} ln -s ${install_main_dir}/bin/taos ${bin_link_dir}/taos || : [ -x ${install_main_dir}/bin/taos ] && ${csudo} ln -s ${install_main_dir}/bin/taos ${bin_link_dir}/taos || :
[ -x ${install_main_dir}/bin/taosd ] && ${csudo} ln -s ${install_main_dir}/bin/taosd ${bin_link_dir}/taosd || : [ -x ${install_main_dir}/bin/taosd ] && ${csudo} ln -s ${install_main_dir}/bin/taosd ${bin_link_dir}/taosd || :
[ -x ${install_main_dir}/bin/blm3 ] && ${csudo} ln -s ${install_main_dir}/bin/blm3 ${bin_link_dir}/blm3 || : [ -x ${install_main_dir}/bin/taosadapter ] && ${csudo} ln -s ${install_main_dir}/bin/taosadapter ${bin_link_dir}/taosadapter || :
[ -x ${install_main_dir}/bin/taosdemo ] && ${csudo} ln -s ${install_main_dir}/bin/taosdemo ${bin_link_dir}/taosdemo || : [ -x ${install_main_dir}/bin/taosdemo ] && ${csudo} ln -s ${install_main_dir}/bin/taosdemo ${bin_link_dir}/taosdemo || :
[ -x ${install_main_dir}/bin/taosdump ] && ${csudo} ln -s ${install_main_dir}/bin/taosdump ${bin_link_dir}/taosdump || : [ -x ${install_main_dir}/bin/taosdump ] && ${csudo} ln -s ${install_main_dir}/bin/taosdump ${bin_link_dir}/taosdump || :
[ -x ${install_main_dir}/bin/remove.sh ] && ${csudo} ln -s ${install_main_dir}/bin/remove.sh ${bin_link_dir}/rmtaos || : [ -x ${install_main_dir}/bin/remove.sh ] && ${csudo} ln -s ${install_main_dir}/bin/remove.sh ${bin_link_dir}/rmtaos || :
...@@ -447,18 +447,18 @@ function local_fqdn_check() { ...@@ -447,18 +447,18 @@ function local_fqdn_check() {
fi fi
} }
function install_blm3_config() { function install_taosadapter_config() {
if [ ! -f "${cfg_install_dir}/blm.toml" ]; then if [ ! -f "${cfg_install_dir}/taosadapter.toml" ]; then
${csudo} mkdir -p ${cfg_install_dir} ${csudo} mkdir -p ${cfg_install_dir}
[ -f ${script_dir}/cfg/blm.toml ] && ${csudo} cp ${script_dir}/cfg/blm.toml ${cfg_install_dir} [ -f ${script_dir}/cfg/taosadapter.toml ] && ${csudo} cp ${script_dir}/cfg/taosadapter.toml ${cfg_install_dir}
[ -f ${cfg_install_dir}/blm.toml ] && ${csudo} chmod 644 ${cfg_install_dir}/blm.toml [ -f ${cfg_install_dir}/taosadapter.toml ] && ${csudo} chmod 644 ${cfg_install_dir}/taosadapter.toml
fi fi
[ -f ${script_dir}/cfg/blm.toml ] && [ -f ${script_dir}/cfg/taosadapter.toml ] &&
${csudo} cp -f ${script_dir}/cfg/blm.toml ${cfg_install_dir}/blm.toml.new ${csudo} cp -f ${script_dir}/cfg/taosadapter.toml ${cfg_install_dir}/taosadapter.toml.new
[ -f ${cfg_install_dir}/blm.toml ] && [ -f ${cfg_install_dir}/taosadapter.toml ] &&
${csudo} ln -s ${cfg_install_dir}/blm.toml ${install_main_dir}/cfg/blm.toml ${csudo} ln -s ${cfg_install_dir}/taosadapter.toml ${install_main_dir}/cfg/taosadapter.toml
[ ! -z $1 ] && return 0 || : # only install client [ ! -z $1 ] && return 0 || : # only install client
...@@ -679,8 +679,8 @@ function install_service_on_systemd() { ...@@ -679,8 +679,8 @@ function install_service_on_systemd() {
taosd_service_config="${service_config_dir}/taosd.service" taosd_service_config="${service_config_dir}/taosd.service"
${csudo} bash -c "echo '[Unit]' >> ${taosd_service_config}" ${csudo} bash -c "echo '[Unit]' >> ${taosd_service_config}"
${csudo} bash -c "echo 'Description=TDengine server service' >> ${taosd_service_config}" ${csudo} bash -c "echo 'Description=TDengine server service' >> ${taosd_service_config}"
${csudo} bash -c "echo 'After=network-online.target blm3.service' >> ${taosd_service_config}" ${csudo} bash -c "echo 'After=network-online.target taosadapter.service' >> ${taosd_service_config}"
${csudo} bash -c "echo 'Wants=network-online.target blm3.service' >> ${taosd_service_config}" ${csudo} bash -c "echo 'Wants=network-online.target taosadapter.service' >> ${taosd_service_config}"
${csudo} bash -c "echo >> ${taosd_service_config}" ${csudo} bash -c "echo >> ${taosd_service_config}"
${csudo} bash -c "echo '[Service]' >> ${taosd_service_config}" ${csudo} bash -c "echo '[Service]' >> ${taosd_service_config}"
${csudo} bash -c "echo 'Type=simple' >> ${taosd_service_config}" ${csudo} bash -c "echo 'Type=simple' >> ${taosd_service_config}"
...@@ -756,9 +756,9 @@ function install_service_on_systemd() { ...@@ -756,9 +756,9 @@ function install_service_on_systemd() {
fi fi
} }
function install_blm3_service() { function install_taosadapter_service() {
[ -f ${script_dir}/cfg/blm3.service ] &&\ [ -f ${script_dir}/cfg/taosadapter.service ] &&\
${csudo} cp ${script_dir}/cfg/blm3.service ${service_config_dir}/ ${csudo} cp ${script_dir}/cfg/taosadapter.service ${service_config_dir}/
} }
function install_service() { function install_service() {
...@@ -883,9 +883,9 @@ function update_TDengine() { ...@@ -883,9 +883,9 @@ function update_TDengine() {
if [ -z $1 ]; then if [ -z $1 ]; then
install_bin install_bin
install_service install_service
install_blm3_service install_taosadapter_service
install_config install_config
install_blm3_config install_taosadapter_config
openresty_work=false openresty_work=false
if [ "$verMode" == "cluster" ]; then if [ "$verMode" == "cluster" ]; then
...@@ -965,7 +965,7 @@ function install_TDengine() { ...@@ -965,7 +965,7 @@ function install_TDengine() {
# For installing new # For installing new
install_bin install_bin
install_service install_service
install_blm3_service install_taosadapter_service
openresty_work=false openresty_work=false
if [ "$verMode" == "cluster" ]; then if [ "$verMode" == "cluster" ]; then
......
...@@ -114,8 +114,8 @@ if [ "$osType" != "Darwin" ]; then ...@@ -114,8 +114,8 @@ if [ "$osType" != "Darwin" ]; then
fi fi
fi fi
function kill_blm3() { function kill_taosadapter() {
pid=$(ps -ef | grep "blm3" | grep -v "grep" | awk '{print $2}') pid=$(ps -ef | grep "taosadapter" | grep -v "grep" | awk '{print $2}')
if [ -n "$pid" ]; then if [ -n "$pid" ]; then
${csudo} kill -9 $pid || : ${csudo} kill -9 $pid || :
fi fi
...@@ -156,7 +156,7 @@ function install_bin() { ...@@ -156,7 +156,7 @@ function install_bin() {
# Remove links # Remove links
${csudo} rm -f ${bin_link_dir}/taos || : ${csudo} rm -f ${bin_link_dir}/taos || :
${csudo} rm -f ${bin_link_dir}/taosd || : ${csudo} rm -f ${bin_link_dir}/taosd || :
${csudo} rm -f ${bin_link_dir}/blm3 || : ${csudo} rm -f ${bin_link_dir}/taosadapter || :
${csudo} rm -f ${bin_link_dir}/taosdemo || : ${csudo} rm -f ${bin_link_dir}/taosdemo || :
${csudo} rm -f ${bin_link_dir}/taosdump || : ${csudo} rm -f ${bin_link_dir}/taosdump || :
...@@ -176,7 +176,7 @@ function install_bin() { ...@@ -176,7 +176,7 @@ function install_bin() {
#Make link #Make link
[ -x ${install_main_dir}/bin/taos ] && ${csudo} ln -s ${install_main_dir}/bin/taos ${bin_link_dir}/taos || : [ -x ${install_main_dir}/bin/taos ] && ${csudo} ln -s ${install_main_dir}/bin/taos ${bin_link_dir}/taos || :
[ -x ${install_main_dir}/bin/taosd ] && ${csudo} ln -s ${install_main_dir}/bin/taosd ${bin_link_dir}/taosd || : [ -x ${install_main_dir}/bin/taosd ] && ${csudo} ln -s ${install_main_dir}/bin/taosd ${bin_link_dir}/taosd || :
[ -x ${install_main_dir}/bin/blm3 ] && ${csudo} ln -s ${install_main_dir}/bin/blm3 ${bin_link_dir}/blm3 || : [ -x ${install_main_dir}/bin/taosadapter ] && ${csudo} ln -s ${install_main_dir}/bin/taosadapter ${bin_link_dir}/taosadapter || :
[ -x ${install_main_dir}/bin/taosdump ] && ${csudo} ln -s ${install_main_dir}/bin/taosdump ${bin_link_dir}/taosdump || : [ -x ${install_main_dir}/bin/taosdump ] && ${csudo} ln -s ${install_main_dir}/bin/taosdump ${bin_link_dir}/taosdump || :
[ -x ${install_main_dir}/bin/taosdemo ] && ${csudo} ln -s ${install_main_dir}/bin/taosdemo ${bin_link_dir}/taosdemo || : [ -x ${install_main_dir}/bin/taosdemo ] && ${csudo} ln -s ${install_main_dir}/bin/taosdemo ${bin_link_dir}/taosdemo || :
[ -x ${install_main_dir}/bin/perfMonitor ] && ${csudo} ln -s ${install_main_dir}/bin/perfMonitor ${bin_link_dir}/perfMonitor || : [ -x ${install_main_dir}/bin/perfMonitor ] && ${csudo} ln -s ${install_main_dir}/bin/perfMonitor ${bin_link_dir}/perfMonitor || :
...@@ -191,7 +191,7 @@ function install_bin() { ...@@ -191,7 +191,7 @@ function install_bin() {
#Make link #Make link
[ -x ${install_main_dir}/bin/taos ] || [ -x ${install_main_2_dir}/bin/taos ] && ${csudo} ln -s ${install_main_dir}/bin/taos ${bin_link_dir}/taos || ${csudo} ln -s ${install_main_2_dir}/bin/taos || : [ -x ${install_main_dir}/bin/taos ] || [ -x ${install_main_2_dir}/bin/taos ] && ${csudo} ln -s ${install_main_dir}/bin/taos ${bin_link_dir}/taos || ${csudo} ln -s ${install_main_2_dir}/bin/taos || :
[ -x ${install_main_dir}/bin/taosd ] || [ -x ${install_main_2_dir}/bin/taosd ] && ${csudo} ln -s ${install_main_dir}/bin/taosd ${bin_link_dir}/taosd || ${csudo} ln -s ${install_main_2_dir}/bin/taosd || : [ -x ${install_main_dir}/bin/taosd ] || [ -x ${install_main_2_dir}/bin/taosd ] && ${csudo} ln -s ${install_main_dir}/bin/taosd ${bin_link_dir}/taosd || ${csudo} ln -s ${install_main_2_dir}/bin/taosd || :
[ -x ${install_main_dir}/bin/blm3 ] || [ -x ${install_main_2_dir}/bin/blm3 ] && ${csudo} ln -s ${install_main_dir}/bin/blm3 ${bin_link_dir}/blm3 || ${csudo} ln -s ${install_main_2_dir}/bin/blm3 || : [ -x ${install_main_dir}/bin/taosadapter ] || [ -x ${install_main_2_dir}/bin/taosadapter ] && ${csudo} ln -s ${install_main_dir}/bin/taosadapter ${bin_link_dir}/taosadapter || ${csudo} ln -s ${install_main_2_dir}/bin/taosadapter || :
[ -x ${install_main_dir}/bin/taosdump ] || [ -x ${install_main_2_dir}/bin/taosdump ] && ${csudo} ln -s ${install_main_dir}/bin/taosdump ${bin_link_dir}/taosdump || ln -s ${install_main_2_dir}/bin/taosdump ${bin_link_dir}/taosdump || : [ -x ${install_main_dir}/bin/taosdump ] || [ -x ${install_main_2_dir}/bin/taosdump ] && ${csudo} ln -s ${install_main_dir}/bin/taosdump ${bin_link_dir}/taosdump || ln -s ${install_main_2_dir}/bin/taosdump ${bin_link_dir}/taosdump || :
[ -x ${install_main_dir}/bin/taosdemo ] || [ -x ${install_main_2_dir}/bin/taosdemo ] && ${csudo} ln -s ${install_main_dir}/bin/taosdemo ${bin_link_dir}/taosdemo || ln -s ${install_main_2_dir}/bin/taosdemo ${bin_link_dir}/taosdemo || : [ -x ${install_main_dir}/bin/taosdemo ] || [ -x ${install_main_2_dir}/bin/taosdemo ] && ${csudo} ln -s ${install_main_dir}/bin/taosdemo ${bin_link_dir}/taosdemo || ln -s ${install_main_2_dir}/bin/taosdemo ${bin_link_dir}/taosdemo || :
fi fi
...@@ -361,23 +361,23 @@ function install_config() { ...@@ -361,23 +361,23 @@ function install_config() {
fi fi
} }
function install_blm3_config() { function install_taosadapter_config() {
if [ ! -f "${cfg_install_dir}/blm.toml" ]; then if [ ! -f "${cfg_install_dir}/taosadapter.toml" ]; then
${csudo} mkdir -p ${cfg_install_dir} ${csudo} mkdir -p ${cfg_install_dir}
[ -f ${binary_dir}/test/cfg/blm.toml ] && [ -f ${binary_dir}/test/cfg/taosadapter.toml ] &&
${csudo} cp ${binary_dir}/test/cfg/blm.toml ${cfg_install_dir} ${csudo} cp ${binary_dir}/test/cfg/taosadapter.toml ${cfg_install_dir}
[ -f ${cfg_install_dir}/blm.toml ] && [ -f ${cfg_install_dir}/taosadapter.toml ] &&
${csudo} chmod 644 ${cfg_install_dir}/blm.toml ${csudo} chmod 644 ${cfg_install_dir}/taosadapter.toml
[ -f ${binary_dir}/test/cfg/blm.toml ] && [ -f ${binary_dir}/test/cfg/taosadapter.toml ] &&
${csudo} cp -f ${binary_dir}/test/cfg/blm.toml \ ${csudo} cp -f ${binary_dir}/test/cfg/taosadapter.toml \
${cfg_install_dir}/blm.toml.${verNumber} ${cfg_install_dir}/taosadapter.toml.${verNumber}
[ -f ${cfg_install_dir}/blm.toml ] && \ [ -f ${cfg_install_dir}/taosadapter.toml ] && \
${csudo} ln -s ${cfg_install_dir}/blm.toml \ ${csudo} ln -s ${cfg_install_dir}/taosadapter.toml \
${install_main_dir}/cfg/blm.toml ${install_main_dir}/cfg/taosadapter.toml
else else
if [ -f "${binary_dir}/test/cfg/blm.toml" ]; then if [ -f "${binary_dir}/test/cfg/taosadapter.toml" ]; then
${csudo} cp -f ${binary_dir}/test/cfg/blm.toml \ ${csudo} cp -f ${binary_dir}/test/cfg/taosadapter.toml \
${cfg_install_dir}/blm.toml.${verNumber} ${cfg_install_dir}/taosadapter.toml.${verNumber}
fi fi
fi fi
} }
...@@ -497,8 +497,8 @@ function install_service_on_systemd() { ...@@ -497,8 +497,8 @@ function install_service_on_systemd() {
${csudo} bash -c "echo '[Unit]' >> ${taosd_service_config}" ${csudo} bash -c "echo '[Unit]' >> ${taosd_service_config}"
${csudo} bash -c "echo 'Description=TDengine server service' >> ${taosd_service_config}" ${csudo} bash -c "echo 'Description=TDengine server service' >> ${taosd_service_config}"
${csudo} bash -c "echo 'After=network-online.target blm3.service' >> ${taosd_service_config}" ${csudo} bash -c "echo 'After=network-online.target taosadapter.service' >> ${taosd_service_config}"
${csudo} bash -c "echo 'Wants=network-online.target blm3.service' >> ${taosd_service_config}" ${csudo} bash -c "echo 'Wants=network-online.target taosadapter.service' >> ${taosd_service_config}"
${csudo} bash -c "echo >> ${taosd_service_config}" ${csudo} bash -c "echo >> ${taosd_service_config}"
${csudo} bash -c "echo '[Service]' >> ${taosd_service_config}" ${csudo} bash -c "echo '[Service]' >> ${taosd_service_config}"
${csudo} bash -c "echo 'Type=simple' >> ${taosd_service_config}" ${csudo} bash -c "echo 'Type=simple' >> ${taosd_service_config}"
...@@ -519,9 +519,14 @@ function install_service_on_systemd() { ...@@ -519,9 +519,14 @@ function install_service_on_systemd() {
${csudo} systemctl enable taosd ${csudo} systemctl enable taosd
} }
function install_blm3_service() { function install_taosadapter_service() {
[ -f ${script_dir}/cfg/blm3.service ] &&\ if ((${service_mod}==0)); then
${csudo} cp ${script_dir}/cfg/blm3.service ${service_config_dir}/ [ -f ${binary_dir}/test/cfg/taosadapter.service ] &&\
${csudo} cp ${binary_dir}/test/cfg/taosadapter.service\
${service_config_dir}/ || :
else
kill_taosadapter
fi
} }
function install_service() { function install_service() {
...@@ -531,7 +536,6 @@ function install_service() { ...@@ -531,7 +536,6 @@ function install_service() {
install_service_on_sysvinit install_service_on_sysvinit
else else
# must manual stop taosd # must manual stop taosd
kill_blm3
kill_taosd kill_taosd
fi fi
} }
...@@ -547,7 +551,7 @@ function update_TDengine() { ...@@ -547,7 +551,7 @@ function update_TDengine() {
elif ((${service_mod}==1)); then elif ((${service_mod}==1)); then
${csudo} service taosd stop || : ${csudo} service taosd stop || :
else else
kill_blm3 kill_taosadapter
kill_taosd kill_taosd
fi fi
sleep 1 sleep 1
...@@ -565,11 +569,11 @@ function update_TDengine() { ...@@ -565,11 +569,11 @@ function update_TDengine() {
if [ "$osType" != "Darwin" ]; then if [ "$osType" != "Darwin" ]; then
install_service install_service
install_blm3_service install_taosadapter_service
fi fi
install_config install_config
install_blm3_config install_taosadapter_config
if [ "$osType" != "Darwin" ]; then if [ "$osType" != "Darwin" ]; then
echo echo
...@@ -577,7 +581,7 @@ function update_TDengine() { ...@@ -577,7 +581,7 @@ function update_TDengine() {
echo echo
echo -e "${GREEN_DARK}To configure TDengine ${NC}: edit /etc/taos/taos.cfg" echo -e "${GREEN_DARK}To configure TDengine ${NC}: edit /etc/taos/taos.cfg"
echo -e "${GREEN_DARK}To configure blm3 (if has) ${NC}: edit /etc/taos/blm.toml" echo -e "${GREEN_DARK}To configure taosadapter (if has) ${NC}: edit /etc/taos/taosadapter.toml"
if ((${service_mod}==0)); then if ((${service_mod}==0)); then
echo -e "${GREEN_DARK}To start TDengine ${NC}: ${csudo} systemctl start taosd${NC}" echo -e "${GREEN_DARK}To start TDengine ${NC}: ${csudo} systemctl start taosd${NC}"
elif ((${service_mod}==1)); then elif ((${service_mod}==1)); then
...@@ -620,11 +624,11 @@ function install_TDengine() { ...@@ -620,11 +624,11 @@ function install_TDengine() {
if [ "$osType" != "Darwin" ]; then if [ "$osType" != "Darwin" ]; then
install_service install_service
install_blm3_service install_taosadapter_service
fi fi
install_config install_config
install_blm3_config install_taosadapter_config
if [ "$osType" != "Darwin" ]; then if [ "$osType" != "Darwin" ]; then
# Ask if to start the service # Ask if to start the service
...@@ -632,7 +636,7 @@ function install_TDengine() { ...@@ -632,7 +636,7 @@ function install_TDengine() {
echo -e "\033[44;32;1mTDengine is installed successfully!${NC}" echo -e "\033[44;32;1mTDengine is installed successfully!${NC}"
echo echo
echo -e "${GREEN_DARK}To configure TDengine ${NC}: edit /etc/taos/taos.cfg" echo -e "${GREEN_DARK}To configure TDengine ${NC}: edit /etc/taos/taos.cfg"
echo -e "${GREEN_DARK}To configure blm (if has) ${NC}: edit /etc/taos/blm.toml" echo -e "${GREEN_DARK}To configure taosadapter (if has) ${NC}: edit /etc/taos/taosadapter.toml"
if ((${service_mod}==0)); then if ((${service_mod}==0)); then
echo -e "${GREEN_DARK}To start TDengine ${NC}: ${csudo} systemctl start taosd${NC}" echo -e "${GREEN_DARK}To start TDengine ${NC}: ${csudo} systemctl start taosd${NC}"
elif ((${service_mod}==1)); then elif ((${service_mod}==1)); then
......
...@@ -35,12 +35,12 @@ fi ...@@ -35,12 +35,12 @@ fi
if [ "$pagMode" == "lite" ]; then if [ "$pagMode" == "lite" ]; then
strip ${build_dir}/bin/taosd strip ${build_dir}/bin/taosd
strip ${build_dir}/bin/taos strip ${build_dir}/bin/taos
# lite version doesn't include blm3, which will lead to no restful interface # lite version doesn't include taosadapter, which will lead to no restful interface
bin_files="${build_dir}/bin/taosd ${build_dir}/bin/taos ${script_dir}/remove.sh ${script_dir}/startPre.sh" bin_files="${build_dir}/bin/taosd ${build_dir}/bin/taos ${script_dir}/remove.sh ${script_dir}/startPre.sh"
else else
bin_files="${build_dir}/bin/taosd \ bin_files="${build_dir}/bin/taosd \
${build_dir}/bin/taos \ ${build_dir}/bin/taos \
${build_dir}/bin/blm3 \ ${build_dir}/bin/taosadapter \
${build_dir}/bin/taosdump \ ${build_dir}/bin/taosdump \
${build_dir}/bin/taosdemo \ ${build_dir}/bin/taosdemo \
${build_dir}/bin/tarbitrator\ ${build_dir}/bin/tarbitrator\
...@@ -78,7 +78,7 @@ mkdir -p ${install_dir} ...@@ -78,7 +78,7 @@ mkdir -p ${install_dir}
mkdir -p ${install_dir}/inc && cp ${header_files} ${install_dir}/inc mkdir -p ${install_dir}/inc && cp ${header_files} ${install_dir}/inc
mkdir -p ${install_dir}/cfg && cp ${cfg_dir}/taos.cfg ${install_dir}/cfg/taos.cfg mkdir -p ${install_dir}/cfg && cp ${cfg_dir}/taos.cfg ${install_dir}/cfg/taos.cfg
[ -f ${cfg_dir}/blm.toml ] && cp ${cfg_dir}/blm.toml ${install_dir}/cfg/blm.toml [ -f ${cfg_dir}/taosadapter.toml ] && cp ${cfg_dir}/taosadapter.toml ${install_dir}/cfg/taosadapter.toml
mkdir -p ${install_dir}/bin && cp ${bin_files} ${install_dir}/bin && chmod a+x ${install_dir}/bin/* || : mkdir -p ${install_dir}/bin && cp ${bin_files} ${install_dir}/bin && chmod a+x ${install_dir}/bin/* || :
mkdir -p ${install_dir}/init.d && cp ${init_file_deb} ${install_dir}/init.d/taosd.deb mkdir -p ${install_dir}/init.d && cp ${init_file_deb} ${install_dir}/init.d/taosd.deb
......
...@@ -81,7 +81,7 @@ else ...@@ -81,7 +81,7 @@ else
# bin_files="${build_dir}/bin/powerd ${build_dir}/bin/power ${build_dir}/bin/powerdemo ${build_dir}/bin/tarbitrator ${script_dir}/remove_power.sh ${script_dir}/set_core.sh" # bin_files="${build_dir}/bin/powerd ${build_dir}/bin/power ${build_dir}/bin/powerdemo ${build_dir}/bin/tarbitrator ${script_dir}/remove_power.sh ${script_dir}/set_core.sh"
cp ${build_dir}/bin/taos ${install_dir}/bin/power cp ${build_dir}/bin/taos ${install_dir}/bin/power
cp ${build_dir}/bin/taosd ${install_dir}/bin/powerd cp ${build_dir}/bin/taosd ${install_dir}/bin/powerd
cp ${build_dir}/bin/blm3 ${install_dir}/bin/blm3 ||: cp ${build_dir}/bin/taosadapter ${install_dir}/bin/taosadapter ||:
cp ${script_dir}/remove_power.sh ${install_dir}/bin cp ${script_dir}/remove_power.sh ${install_dir}/bin
cp ${build_dir}/bin/taosdemo ${install_dir}/bin/powerdemo cp ${build_dir}/bin/taosdemo ${install_dir}/bin/powerdemo
cp ${build_dir}/bin/taosdump ${install_dir}/bin/powerdump cp ${build_dir}/bin/taosdump ${install_dir}/bin/powerdump
......
...@@ -62,7 +62,7 @@ else ...@@ -62,7 +62,7 @@ else
fi fi
cp ${build_dir}/bin/taos ${install_dir}/bin/prodbc cp ${build_dir}/bin/taos ${install_dir}/bin/prodbc
cp ${build_dir}/bin/taosd ${install_dir}/bin/prodbs cp ${build_dir}/bin/taosd ${install_dir}/bin/prodbs
cp ${build_dir}/bin/blm3 ${install_dir}/bin/blm3 ||: cp ${build_dir}/bin/taosadapter ${install_dir}/bin/taosadapter ||:
cp ${script_dir}/remove_pro.sh ${install_dir}/bin cp ${script_dir}/remove_pro.sh ${install_dir}/bin
chmod a+x ${install_dir}/bin/* || : chmod a+x ${install_dir}/bin/* || :
......
...@@ -82,7 +82,7 @@ else ...@@ -82,7 +82,7 @@ else
cp ${build_dir}/bin/taos ${install_dir}/bin/tq cp ${build_dir}/bin/taos ${install_dir}/bin/tq
cp ${build_dir}/bin/taosd ${install_dir}/bin/tqd cp ${build_dir}/bin/taosd ${install_dir}/bin/tqd
cp ${script_dir}/remove_tq.sh ${install_dir}/bin cp ${script_dir}/remove_tq.sh ${install_dir}/bin
cp ${build_dir}/bin/blm3 ${install_dir}/bin/blm3 ||: cp ${build_dir}/bin/taosadapter ${install_dir}/bin/taosadapter ||:
cp ${build_dir}/bin/taosdemo ${install_dir}/bin/tqdemo cp ${build_dir}/bin/taosdemo ${install_dir}/bin/tqdemo
cp ${build_dir}/bin/taosdump ${install_dir}/bin/tqdump cp ${build_dir}/bin/taosdump ${install_dir}/bin/tqdump
cp ${build_dir}/bin/tarbitrator ${install_dir}/bin cp ${build_dir}/bin/tarbitrator ${install_dir}/bin
......
...@@ -64,9 +64,9 @@ else ...@@ -64,9 +64,9 @@ else
service_mod=2 service_mod=2
fi fi
function kill_blm3() { function kill_taosadapter() {
# ${csudo} pkill -f blm3 || : # ${csudo} pkill -f taosadapter || :
pid=$(ps -ef | grep "blm3" | grep -v "grep" | awk '{print $2}') pid=$(ps -ef | grep "taosadapter" | grep -v "grep" | awk '{print $2}')
if [ -n "$pid" ]; then if [ -n "$pid" ]; then
${csudo} kill -9 $pid || : ${csudo} kill -9 $pid || :
fi fi
...@@ -123,7 +123,7 @@ function install_bin() { ...@@ -123,7 +123,7 @@ function install_bin() {
# Remove links # Remove links
${csudo} rm -f ${bin_link_dir}/taos || : ${csudo} rm -f ${bin_link_dir}/taos || :
${csudo} rm -f ${bin_link_dir}/taosd || : ${csudo} rm -f ${bin_link_dir}/taosd || :
${csudo} rm -f ${bin_link_dir}/blm3 || : ${csudo} rm -f ${bin_link_dir}/taosadapter || :
${csudo} rm -f ${bin_link_dir}/taosdemo || : ${csudo} rm -f ${bin_link_dir}/taosdemo || :
${csudo} rm -f ${bin_link_dir}/taosdump || : ${csudo} rm -f ${bin_link_dir}/taosdump || :
${csudo} rm -f ${bin_link_dir}/rmtaos || : ${csudo} rm -f ${bin_link_dir}/rmtaos || :
...@@ -134,7 +134,7 @@ function install_bin() { ...@@ -134,7 +134,7 @@ function install_bin() {
#Make link #Make link
[ -x ${bin_dir}/taos ] && ${csudo} ln -s ${bin_dir}/taos ${bin_link_dir}/taos || : [ -x ${bin_dir}/taos ] && ${csudo} ln -s ${bin_dir}/taos ${bin_link_dir}/taos || :
[ -x ${bin_dir}/taosd ] && ${csudo} ln -s ${bin_dir}/taosd ${bin_link_dir}/taosd || : [ -x ${bin_dir}/taosd ] && ${csudo} ln -s ${bin_dir}/taosd ${bin_link_dir}/taosd || :
[ -x ${bin_dir}/blm3 ] && ${csudo} ln -s ${bin_dir}/blm3 ${bin_link_dir}/blm3 || : [ -x ${bin_dir}/taosadapter ] && ${csudo} ln -s ${bin_dir}/taosadapter ${bin_link_dir}/taosadapter || :
[ -x ${bin_dir}/taosdemo ] && ${csudo} ln -s ${bin_dir}/taosdemo ${bin_link_dir}/taosdemo || : [ -x ${bin_dir}/taosdemo ] && ${csudo} ln -s ${bin_dir}/taosdemo ${bin_link_dir}/taosdemo || :
[ -x ${bin_dir}/taosdump ] && ${csudo} ln -s ${bin_dir}/taosdump ${bin_link_dir}/taosdump || : [ -x ${bin_dir}/taosdump ] && ${csudo} ln -s ${bin_dir}/taosdump ${bin_link_dir}/taosdump || :
[ -x ${bin_dir}/set_core.sh ] && ${csudo} ln -s ${bin_dir}/set_core.sh ${bin_link_dir}/set_core || : [ -x ${bin_dir}/set_core.sh ] && ${csudo} ln -s ${bin_dir}/set_core.sh ${bin_link_dir}/set_core || :
...@@ -291,20 +291,20 @@ function local_fqdn_check() { ...@@ -291,20 +291,20 @@ function local_fqdn_check() {
fi fi
} }
function install_blm3_config() { function install_taosadapter_config() {
if [ ! -f "${cfg_install_dir}/blm.toml" ]; then if [ ! -f "${cfg_install_dir}/taosadapter.toml" ]; then
[ ! -d %{cfg_install_dir} ] && [ ! -d %{cfg_install_dir} ] &&
${csudo} ${csudo} mkdir -p ${cfg_install_dir} ${csudo} ${csudo} mkdir -p ${cfg_install_dir}
[ -f ${cfg_dir}/blm.toml ] && ${csudo} cp ${cfg_dir}/blm.toml ${cfg_install_dir} [ -f ${cfg_dir}/taosadapter.toml ] && ${csudo} cp ${cfg_dir}/taosadapter.toml ${cfg_install_dir}
[ -f ${cfg_install_dir}/blm.toml ] && [ -f ${cfg_install_dir}/taosadapter.toml ] &&
${csudo} chmod 644 ${cfg_install_dir}/blm.toml ${csudo} chmod 644 ${cfg_install_dir}/taosadapter.toml
fi fi
[ -f ${cfg_dir}/blm.toml ] && [ -f ${cfg_dir}/taosadapter.toml ] &&
${csudo} mv ${cfg_dir}/blm.toml ${cfg_dir}/blm.toml.new ${csudo} mv ${cfg_dir}/taosadapter.toml ${cfg_dir}/taosadapter.toml.new
[ -f ${cfg_install_dir}/blm.toml ] && [ -f ${cfg_install_dir}/taosadapter.toml ] &&
${csudo} ln -s ${cfg_install_dir}/blm.toml ${cfg_dir} ${csudo} ln -s ${cfg_install_dir}/taosadapter.toml ${cfg_dir}
} }
function install_config() { function install_config() {
...@@ -444,8 +444,8 @@ function install_service_on_systemd() { ...@@ -444,8 +444,8 @@ function install_service_on_systemd() {
${csudo} bash -c "echo '[Unit]' >> ${taosd_service_config}" ${csudo} bash -c "echo '[Unit]' >> ${taosd_service_config}"
${csudo} bash -c "echo 'Description=TDengine server service' >> ${taosd_service_config}" ${csudo} bash -c "echo 'Description=TDengine server service' >> ${taosd_service_config}"
${csudo} bash -c "echo 'After=network-online.target blm3.service' >> ${taosd_service_config}" ${csudo} bash -c "echo 'After=network-online.target taosadapter.service' >> ${taosd_service_config}"
${csudo} bash -c "echo 'Wants=network-online.target blm3.service' >> ${taosd_service_config}" ${csudo} bash -c "echo 'Wants=network-online.target taosadapter.service' >> ${taosd_service_config}"
${csudo} bash -c "echo >> ${taosd_service_config}" ${csudo} bash -c "echo >> ${taosd_service_config}"
${csudo} bash -c "echo '[Service]' >> ${taosd_service_config}" ${csudo} bash -c "echo '[Service]' >> ${taosd_service_config}"
${csudo} bash -c "echo 'Type=simple' >> ${taosd_service_config}" ${csudo} bash -c "echo 'Type=simple' >> ${taosd_service_config}"
...@@ -466,8 +466,8 @@ function install_service_on_systemd() { ...@@ -466,8 +466,8 @@ function install_service_on_systemd() {
${csudo} systemctl enable taosd ${csudo} systemctl enable taosd
} }
function install_blm3_service() { function install_taosadapter_service() {
[ -f ${cfg_dir}/blm3.service ] && ${csudo} cp ${cfg_dir}/blm3.service ${service_config_dir} [ -f ${cfg_dir}/taosadapter.service ] && ${csudo} cp ${cfg_dir}/taosadapter.service ${service_config_dir}
} }
function install_service() { function install_service() {
...@@ -477,7 +477,7 @@ function install_service() { ...@@ -477,7 +477,7 @@ function install_service() {
install_service_on_sysvinit install_service_on_sysvinit
else else
# manual start taosd # manual start taosd
kill_blm3 kill_taosadapter
kill_taosd kill_taosd
fi fi
} }
...@@ -501,8 +501,8 @@ function install_TDengine() { ...@@ -501,8 +501,8 @@ function install_TDengine() {
install_avro_lib install_avro_lib
install_bin install_bin
install_config install_config
install_blm3_config install_taosadapter_config
install_blm3_service install_taosadapter_service
install_service install_service
# Ask if to start the service # Ask if to start the service
......
...@@ -43,8 +43,8 @@ else ...@@ -43,8 +43,8 @@ else
service_mod=2 service_mod=2
fi fi
function kill_blm3() { function kill_taosadapter() {
pid=$(ps -ef | grep "blm3" | grep -v "grep" | awk '{print $2}') pid=$(ps -ef | grep "taosadapter" | grep -v "grep" | awk '{print $2}')
if [ -n "$pid" ]; then if [ -n "$pid" ]; then
${csudo} kill -9 $pid || : ${csudo} kill -9 $pid || :
fi fi
...@@ -58,10 +58,10 @@ function kill_taosd() { ...@@ -58,10 +58,10 @@ function kill_taosd() {
} }
function clean_service_on_systemd() { function clean_service_on_systemd() {
blm3_service_config="${service_config_dir}/blm3.service" taosadapter_service_config="${service_config_dir}/taosadapter.service"
if systemctl is-active --quiet blm3; then if systemctl is-active --quiet taosadapter; then
echo "blm3 is running, stopping it..." echo "taosadapter is running, stopping it..."
${csudo} systemctl stop blm3 &> /dev/null || echo &> /dev/null ${csudo} systemctl stop taosadapter &> /dev/null || echo &> /dev/null
fi fi
taosd_service_config="${service_config_dir}/${taos_service_name}.service" taosd_service_config="${service_config_dir}/${taos_service_name}.service"
...@@ -74,7 +74,7 @@ function clean_service_on_systemd() { ...@@ -74,7 +74,7 @@ function clean_service_on_systemd() {
${csudo} rm -f ${taosd_service_config} ${csudo} rm -f ${taosd_service_config}
[ -f ${blm3_service_config} ] && ${csudo} rm -f ${blm3_service_config} [ -f ${taosadapter_service_config} ] && ${csudo} rm -f ${taosadapter_service_config}
} }
...@@ -109,7 +109,7 @@ function clean_service() { ...@@ -109,7 +109,7 @@ function clean_service() {
clean_service_on_sysvinit clean_service_on_sysvinit
else else
# must manual stop taosd # must manual stop taosd
kill_blm3 kill_taosadapter
kill_taosd kill_taosd
fi fi
} }
...@@ -120,7 +120,7 @@ clean_service ...@@ -120,7 +120,7 @@ clean_service
# Remove all links # Remove all links
${csudo} rm -f ${bin_link_dir}/taos || : ${csudo} rm -f ${bin_link_dir}/taos || :
${csudo} rm -f ${bin_link_dir}/taosd || : ${csudo} rm -f ${bin_link_dir}/taosd || :
${csudo} rm -f ${bin_link_dir}/blm3 || : ${csudo} rm -f ${bin_link_dir}/taosadapter || :
${csudo} rm -f ${bin_link_dir}/taosdemo || : ${csudo} rm -f ${bin_link_dir}/taosdemo || :
${csudo} rm -f ${bin_link_dir}/taosdump || : ${csudo} rm -f ${bin_link_dir}/taosdump || :
${csudo} rm -f ${bin_link_dir}/set_core || : ${csudo} rm -f ${bin_link_dir}/set_core || :
...@@ -134,7 +134,7 @@ ${csudo} rm -f ${log_link_dir} || : ...@@ -134,7 +134,7 @@ ${csudo} rm -f ${log_link_dir} || :
${csudo} rm -f ${data_link_dir} || : ${csudo} rm -f ${data_link_dir} || :
if ((${service_mod}==2)); then if ((${service_mod}==2)); then
kill_blm3 kill_taosadapter
kill_taosd kill_taosd
fi fi
......
...@@ -54,8 +54,8 @@ else ...@@ -54,8 +54,8 @@ else
service_mod=2 service_mod=2
fi fi
function kill_blm3() { function kill_taosadapter() {
pid=$(ps -ef | grep "blm3" | grep -v "grep" | awk '{print $2}') pid=$(ps -ef | grep "taosadapter" | grep -v "grep" | awk '{print $2}')
if [ -n "$pid" ]; then if [ -n "$pid" ]; then
${csudo} kill -9 $pid || : ${csudo} kill -9 $pid || :
fi fi
...@@ -78,7 +78,7 @@ function clean_bin() { ...@@ -78,7 +78,7 @@ function clean_bin() {
# Remove link # Remove link
${csudo} rm -f ${bin_link_dir}/taos || : ${csudo} rm -f ${bin_link_dir}/taos || :
${csudo} rm -f ${bin_link_dir}/taosd || : ${csudo} rm -f ${bin_link_dir}/taosd || :
${csudo} rm -f ${bin_link_dir}/blm3 || : ${csudo} rm -f ${bin_link_dir}/taosadapter || :
${csudo} rm -f ${bin_link_dir}/taosdemo || : ${csudo} rm -f ${bin_link_dir}/taosdemo || :
${csudo} rm -f ${bin_link_dir}/taosdump || : ${csudo} rm -f ${bin_link_dir}/taosdump || :
${csudo} rm -f ${bin_link_dir}/rmtaos || : ${csudo} rm -f ${bin_link_dir}/rmtaos || :
...@@ -111,14 +111,14 @@ function clean_log() { ...@@ -111,14 +111,14 @@ function clean_log() {
function clean_service_on_systemd() { function clean_service_on_systemd() {
taosd_service_config="${service_config_dir}/${taos_service_name}.service" taosd_service_config="${service_config_dir}/${taos_service_name}.service"
blm3_service_config="${service_config_dir}/blm3.service" taosadapter_service_config="${service_config_dir}/taosadapter.service"
if systemctl is-active --quiet ${taos_service_name}; then if systemctl is-active --quiet ${taos_service_name}; then
echo "TDengine taosd is running, stopping it..." echo "TDengine taosd is running, stopping it..."
${csudo} systemctl stop ${taos_service_name} &> /dev/null || echo &> /dev/null ${csudo} systemctl stop ${taos_service_name} &> /dev/null || echo &> /dev/null
fi fi
${csudo} systemctl disable ${taos_service_name} &> /dev/null || echo &> /dev/null ${csudo} systemctl disable ${taos_service_name} &> /dev/null || echo &> /dev/null
${csudo} rm -f ${taosd_service_config} ${csudo} rm -f ${taosd_service_config}
[ -f ${blm3_service_config} ] && ${sudo} rm -f ${blm3_service_config} [ -f ${taosadapter_service_config} ] && ${sudo} rm -f ${taosadapter_service_config}
tarbitratord_service_config="${service_config_dir}/${tarbitrator_service_name}.service" tarbitratord_service_config="${service_config_dir}/${tarbitrator_service_name}.service"
if systemctl is-active --quiet ${tarbitrator_service_name}; then if systemctl is-active --quiet ${tarbitrator_service_name}; then
...@@ -193,7 +193,7 @@ function clean_service() { ...@@ -193,7 +193,7 @@ function clean_service() {
clean_service_on_sysvinit clean_service_on_sysvinit
else else
# must manual stop taosd # must manual stop taosd
kill_blm3 kill_taosadapter
kill_taosd kill_taosd
kill_tarbitrator kill_tarbitrator
fi fi
......
...@@ -358,9 +358,13 @@ static int32_t tscGetTableTagValue(SCreateBuilder *builder, char *result) { ...@@ -358,9 +358,13 @@ static int32_t tscGetTableTagValue(SCreateBuilder *builder, char *result) {
int num_fields = taos_num_fields(pSql); int num_fields = taos_num_fields(pSql);
TAOS_FIELD *fields = taos_fetch_fields(pSql); TAOS_FIELD *fields = taos_fetch_fields(pSql);
char buf[TSDB_COL_NAME_LEN + 16];
for (int i = 0; i < num_fields; i++) { for (int i = 0; i < num_fields; i++) {
memset(buf, 0, sizeof(buf)); char *buf = calloc(1, lengths[i] + 1);
if (buf == NULL) {
return TSDB_CODE_TSC_OUT_OF_MEMORY;
}
memset(buf, 0, lengths[i] + 1);
int32_t ret = tscGetNthFieldResult(row, fields, lengths, i, buf); int32_t ret = tscGetNthFieldResult(row, fields, lengths, i, buf);
if (i == 0) { if (i == 0) {
...@@ -373,10 +377,13 @@ static int32_t tscGetTableTagValue(SCreateBuilder *builder, char *result) { ...@@ -373,10 +377,13 @@ static int32_t tscGetTableTagValue(SCreateBuilder *builder, char *result) {
} else { } else {
snprintf(result + strlen(result), TSDB_MAX_BINARY_LEN - strlen(result), "%s,", buf); snprintf(result + strlen(result), TSDB_MAX_BINARY_LEN - strlen(result), "%s,", buf);
} }
free(buf);
if (i == num_fields - 1) { if (i == num_fields - 1) {
sprintf(result + strlen(result) - 1, "%s", ")"); sprintf(result + strlen(result) - 1, "%s", ")");
} }
} }
if (0 == strlen(result)) { if (0 == strlen(result)) {
return TSDB_CODE_TSC_INVALID_TABLE_NAME; return TSDB_CODE_TSC_INVALID_TABLE_NAME;
......
...@@ -1512,9 +1512,9 @@ static bool convertStrToNumber(TAOS_SML_KV *pVal, char *str, SSmlLinesInfo* info ...@@ -1512,9 +1512,9 @@ static bool convertStrToNumber(TAOS_SML_KV *pVal, char *str, SSmlLinesInfo* info
errno = 0; errno = 0;
uint8_t type = pVal->type; uint8_t type = pVal->type;
int16_t length = pVal->length; int16_t length = pVal->length;
int64_t val_s; int64_t val_s = 0;
uint64_t val_u; uint64_t val_u = 0;
double val_d; double val_d = 0.0;
strntolower_s(str, str, (int32_t)strlen(str)); strntolower_s(str, str, (int32_t)strlen(str));
if (IS_FLOAT_TYPE(type)) { if (IS_FLOAT_TYPE(type)) {
...@@ -1814,7 +1814,7 @@ static int32_t getTimeStampValue(char *value, uint16_t len, ...@@ -1814,7 +1814,7 @@ static int32_t getTimeStampValue(char *value, uint16_t len,
int32_t convertSmlTimeStamp(TAOS_SML_KV *pVal, char *value, int32_t convertSmlTimeStamp(TAOS_SML_KV *pVal, char *value,
uint16_t len, SSmlLinesInfo* info) { uint16_t len, SSmlLinesInfo* info) {
int32_t ret; int32_t ret;
SMLTimeStampType type; SMLTimeStampType type = SML_TIME_STAMP_NOW;
int64_t tsVal; int64_t tsVal;
ret = isTimeStamp(value, len, &type, info); ret = isTimeStamp(value, len, &type, info);
...@@ -2413,7 +2413,7 @@ static SSqlObj* createSmlQueryObj(TAOS* taos, int32_t affected_rows, int32_t cod ...@@ -2413,7 +2413,7 @@ static SSqlObj* createSmlQueryObj(TAOS* taos, int32_t affected_rows, int32_t cod
TAOS_RES* taos_schemaless_insert(TAOS* taos, char* lines[], int numLines, int protocol, int precision) { TAOS_RES* taos_schemaless_insert(TAOS* taos, char* lines[], int numLines, int protocol, int precision) {
int code = TSDB_CODE_SUCCESS; int code = TSDB_CODE_SUCCESS;
int affected_rows = 0; int affected_rows = 0;
SMLTimeStampType tsType; SMLTimeStampType tsType = SML_TIME_STAMP_NOW;
if (protocol == TSDB_SML_LINE_PROTOCOL) { if (protocol == TSDB_SML_LINE_PROTOCOL) {
code = convertPrecisionType(precision, &tsType); code = convertPrecisionType(precision, &tsType);
......
...@@ -5753,6 +5753,7 @@ int32_t validateOrderbyNode(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, SSqlNode* pSq ...@@ -5753,6 +5753,7 @@ int32_t validateOrderbyNode(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, SSqlNode* pSq
const char* msg9 = "orderby column must projected in subquery"; const char* msg9 = "orderby column must projected in subquery";
const char* msg10 = "not support distinct mixed with order by"; const char* msg10 = "not support distinct mixed with order by";
const char* msg11 = "not support order with udf"; const char* msg11 = "not support order with udf";
const char* msg12 = "order by tags not supported with diff/derivative/csum/mavg";
setDefaultOrderInfo(pQueryInfo); setDefaultOrderInfo(pQueryInfo);
STableMetaInfo* pTableMetaInfo = tscGetMetaInfo(pQueryInfo, 0); STableMetaInfo* pTableMetaInfo = tscGetMetaInfo(pQueryInfo, 0);
...@@ -5851,6 +5852,9 @@ int32_t validateOrderbyNode(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, SSqlNode* pSq ...@@ -5851,6 +5852,9 @@ int32_t validateOrderbyNode(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, SSqlNode* pSq
size_t s = taosArrayGetSize(pSortOrder); size_t s = taosArrayGetSize(pSortOrder);
if (s == 1) { if (s == 1) {
if (orderByTags) { if (orderByTags) {
if (tscIsDiffDerivLikeQuery(pQueryInfo)) {
return invalidOperationMsg(pMsgBuf, msg12);
}
pQueryInfo->groupbyExpr.orderIndex = index.columnIndex - tscGetNumOfColumns(pTableMetaInfo->pTableMeta); pQueryInfo->groupbyExpr.orderIndex = index.columnIndex - tscGetNumOfColumns(pTableMetaInfo->pTableMeta);
tVariantListItem* p1 = taosArrayGet(pSqlNode->pSortOrder, 0); tVariantListItem* p1 = taosArrayGet(pSqlNode->pSortOrder, 0);
......
...@@ -2955,7 +2955,8 @@ int32_t tscGetTableMetaImpl(SSqlObj* pSql, STableMetaInfo *pTableMetaInfo, bool ...@@ -2955,7 +2955,8 @@ int32_t tscGetTableMetaImpl(SSqlObj* pSql, STableMetaInfo *pTableMetaInfo, bool
// in case of child table, here only get the // in case of child table, here only get the
if (pMeta->tableType == TSDB_CHILD_TABLE) { if (pMeta->tableType == TSDB_CHILD_TABLE) {
int32_t code = tscCreateTableMetaFromSTableMeta(pSql, &pTableMetaInfo->pTableMeta, name, &pTableMetaInfo->tableMetaCapacity, (STableMeta **)(&pSTMeta)); int32_t code = tscCreateTableMetaFromSTableMeta(pSql, &pTableMetaInfo->pTableMeta, name, &pTableMetaInfo->tableMetaCapacity, (STableMeta **)(&pSTMeta));
pSql->pBuf = (void *)(pSTMeta); pSql->pBuf = (void *)(pSTMeta);
pMeta = pTableMetaInfo->pTableMeta;
if (code != TSDB_CODE_SUCCESS) { if (code != TSDB_CODE_SUCCESS) {
return getTableMetaFromMnode(pSql, pTableMetaInfo, autocreate); return getTableMetaFromMnode(pSql, pTableMetaInfo, autocreate);
} }
......
...@@ -781,6 +781,16 @@ bool taos_is_null(TAOS_RES *res, int32_t row, int32_t col) { ...@@ -781,6 +781,16 @@ bool taos_is_null(TAOS_RES *res, int32_t row, int32_t col) {
return isNull(((char*) pSql->res.urow[col]) + row * pInfo->field.bytes, pInfo->field.type); return isNull(((char*) pSql->res.urow[col]) + row * pInfo->field.bytes, pInfo->field.type);
} }
bool taos_is_update_query(TAOS_RES *res) {
SSqlObj *pSql = (SSqlObj *)res;
if (pSql == NULL || pSql->signature != pSql) {
return false;
}
SSqlCmd* pCmd = &pSql->cmd;
return ((pCmd->command >= TSDB_SQL_INSERT && pCmd->command <= TSDB_SQL_DROP_DNODE) || TSDB_SQL_RESET_CACHE == pCmd->command || TSDB_SQL_USE_DB == pCmd->command);
}
int taos_print_row(char *str, TAOS_ROW row, TAOS_FIELD *fields, int num_fields) { int taos_print_row(char *str, TAOS_ROW row, TAOS_FIELD *fields, int num_fields) {
int len = 0; int len = 0;
...@@ -909,7 +919,6 @@ int taos_validate_sql(TAOS *taos, const char *sql) { ...@@ -909,7 +919,6 @@ int taos_validate_sql(TAOS *taos, const char *sql) {
strtolower(pSql->sqlstr, sql); strtolower(pSql->sqlstr, sql);
// pCmd->curSql = NULL;
if (NULL != pCmd->insertParam.pTableBlockHashList) { if (NULL != pCmd->insertParam.pTableBlockHashList) {
taosHashCleanup(pCmd->insertParam.pTableBlockHashList); taosHashCleanup(pCmd->insertParam.pTableBlockHashList);
pCmd->insertParam.pTableBlockHashList = NULL; pCmd->insertParam.pTableBlockHashList = NULL;
...@@ -934,6 +943,17 @@ int taos_validate_sql(TAOS *taos, const char *sql) { ...@@ -934,6 +943,17 @@ int taos_validate_sql(TAOS *taos, const char *sql) {
return code; return code;
} }
void taos_reset_current_db(TAOS *taos) {
STscObj* pObj = (STscObj*) taos;
if (pObj == NULL || pObj->signature != pObj) {
return;
}
pthread_mutex_lock(&pObj->mutex);
memset(pObj->db, 0, tListLen(pObj->db));
pthread_mutex_unlock(&pObj->mutex);
}
void loadMultiTableMetaCallback(void *param, TAOS_RES *res, int code) { void loadMultiTableMetaCallback(void *param, TAOS_RES *res, int code) {
SSqlObj* pSql = (SSqlObj*)taosAcquireRef(tscObjRef, (int64_t)param); SSqlObj* pSql = (SSqlObj*)taosAcquireRef(tscObjRef, (int64_t)param);
if (pSql == NULL) { if (pSql == NULL) {
......
Subproject commit 9ae793ad2d567eb11d10627b65698f612542e988 Subproject commit 792ef7c3036f15068796e09883d3f4d47a038fe2
...@@ -8,16 +8,35 @@ import java.sql.Connection; ...@@ -8,16 +8,35 @@ import java.sql.Connection;
import java.sql.SQLException; import java.sql.SQLException;
import java.sql.Statement; import java.sql.Statement;
/**
* @author huolibo@qq.com
* @version v1.0.0
* @JDK: 1.8
* @description: this class is an extension of {@link Statement}. use like:
* Statement statement = conn.createStatement();
* SchemalessStatement schemalessStatement = new SchemalessStatement(statement);
* schemalessStatement.execute(sql);
* schemalessStatement.executeSchemaless(lines, SchemalessProtocolType, SchemalessTimestampType);
* @since 2021-11-03 17:10
*/
public class SchemalessStatement extends AbstractStatementWrapper { public class SchemalessStatement extends AbstractStatementWrapper {
public SchemalessStatement(Statement statement) { public SchemalessStatement(Statement statement) {
super(statement); super(statement);
} }
public void executeSchemaless(String[] strings, SchemalessProtocolType protocolType, SchemalessTimestampType timestampType) throws SQLException { /**
* batch insert schemaless lines
*
* @param lines schemaless data
* @param protocolType schemaless type {@link SchemalessProtocolType}
* @param timestampType Time precision {@link SchemalessTimestampType}
* @throws SQLException execute insert exception
*/
public void executeSchemaless(String[] lines, SchemalessProtocolType protocolType, SchemalessTimestampType timestampType) throws SQLException {
Connection connection = this.getConnection(); Connection connection = this.getConnection();
if (connection instanceof TSDBConnection) { if (connection instanceof TSDBConnection) {
TSDBConnection tsdbConnection = (TSDBConnection) connection; TSDBConnection tsdbConnection = (TSDBConnection) connection;
tsdbConnection.getConnector().insertLines(strings, protocolType, timestampType); tsdbConnection.getConnector().insertLines(lines, protocolType, timestampType);
} else if (connection instanceof RestfulConnection) { } else if (connection instanceof RestfulConnection) {
throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_UNSUPPORTED_METHOD, "restful connection is not supported currently"); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_UNSUPPORTED_METHOD, "restful connection is not supported currently");
} else { } else {
...@@ -25,7 +44,15 @@ public class SchemalessStatement extends AbstractStatementWrapper { ...@@ -25,7 +44,15 @@ public class SchemalessStatement extends AbstractStatementWrapper {
} }
} }
public void executeSchemaless(String sql, SchemalessProtocolType protocolType, SchemalessTimestampType timestampType) throws SQLException { /**
executeSchemaless(new String[]{sql}, protocolType, timestampType); * only one insert
*
* @param line schemaless line
* @param protocolType schemaless type {@link SchemalessProtocolType}
* @param timestampType Time precision {@link SchemalessTimestampType}
* @throws SQLException execute insert exception
*/
public void executeSchemaless(String line, SchemalessProtocolType protocolType, SchemalessTimestampType timestampType) throws SQLException {
executeSchemaless(new String[]{line}, protocolType, timestampType);
} }
} }
package com.taosdata.jdbc.enums; package com.taosdata.jdbc.enums;
import java.util.Arrays;
public enum SchemalessProtocolType { public enum SchemalessProtocolType {
UNKNOWN, UNKNOWN,
LINE, LINE,
...@@ -7,4 +9,10 @@ public enum SchemalessProtocolType { ...@@ -7,4 +9,10 @@ public enum SchemalessProtocolType {
JSON, JSON,
; ;
public static SchemalessProtocolType parse(String type) {
return Arrays.stream(SchemalessProtocolType.values())
.filter(protocol -> type.equalsIgnoreCase(protocol.name()))
.findFirst().orElse(UNKNOWN);
}
} }
package com.taosdata.jdbc.enums; package com.taosdata.jdbc.enums;
public enum SchemalessTimestampType { public enum SchemalessTimestampType {
// Let the database decide
NOT_CONFIGURED, NOT_CONFIGURED,
HOURS, HOURS,
MINUTES, MINUTES,
......
package com.taosdata.jdbc; package com.taosdata.jdbc;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.taosdata.jdbc.enums.SchemalessProtocolType; import com.taosdata.jdbc.enums.SchemalessProtocolType;
import com.taosdata.jdbc.enums.SchemalessTimestampType; import com.taosdata.jdbc.enums.SchemalessTimestampType;
import org.junit.After; import org.junit.After;
...@@ -10,10 +12,14 @@ import org.junit.Test; ...@@ -10,10 +12,14 @@ import org.junit.Test;
import java.sql.*; import java.sql.*;
public class SchemalessInsertTest { public class SchemalessInsertTest {
private String host = "127.0.0.1"; private final String dbname = "test_schemaless_insert";
private String dbname = "test_schemaless_insert";
private Connection conn; private Connection conn;
/**
* schemaless insert compatible with influxdb
*
* @throws SQLException execute error
*/
@Test @Test
public void schemalessInsert() throws SQLException { public void schemalessInsert() throws SQLException {
// given // given
...@@ -41,6 +47,11 @@ public class SchemalessInsertTest { ...@@ -41,6 +47,11 @@ public class SchemalessInsertTest {
statement.close(); statement.close();
} }
/**
* telnet insert compatible with opentsdb
*
* @throws SQLException execute error
*/
@Test @Test
public void telnetInsert() throws SQLException { public void telnetInsert() throws SQLException {
// given // given
...@@ -71,6 +82,11 @@ public class SchemalessInsertTest { ...@@ -71,6 +82,11 @@ public class SchemalessInsertTest {
statement.close(); statement.close();
} }
/**
* json insert compatible with opentsdb json format
*
* @throws SQLException execute error
*/
@Test @Test
public void jsonInsert() throws SQLException { public void jsonInsert() throws SQLException {
// given // given
...@@ -113,13 +129,15 @@ public class SchemalessInsertTest { ...@@ -113,13 +129,15 @@ public class SchemalessInsertTest {
while (rs.next()) { while (rs.next()) {
rowCnt++; rowCnt++;
} }
// Assert.assertEquals(json.length, rowCnt);
Assert.assertEquals(((JSONArray) JSONObject.parse(json)).size(), rowCnt);
rs.close(); rs.close();
statement.close(); statement.close();
} }
@Before @Before
public void before() { public void before() {
String host = "127.0.0.1";
final String url = "jdbc:TAOS://" + host + ":6030/?user=root&password=taosdata"; final String url = "jdbc:TAOS://" + host + ":6030/?user=root&password=taosdata";
try { try {
conn = DriverManager.getConnection(url); conn = DriverManager.getConnection(url);
......
...@@ -12,6 +12,7 @@ const FieldTypes = require('./constants'); ...@@ -12,6 +12,7 @@ const FieldTypes = require('./constants');
const errors = require('./error'); const errors = require('./error');
const TaosObjects = require('./taosobjects'); const TaosObjects = require('./taosobjects');
const { NULL_POINTER } = require('ref-napi'); const { NULL_POINTER } = require('ref-napi');
const { Console } = require('console');
module.exports = CTaosInterface; module.exports = CTaosInterface;
...@@ -53,6 +54,18 @@ function convertTinyint(data, num_of_rows, nbytes = 0, offset = 0, precision = 0 ...@@ -53,6 +54,18 @@ function convertTinyint(data, num_of_rows, nbytes = 0, offset = 0, precision = 0
} }
return res; return res;
} }
function convertTinyintUnsigned(data, num_of_rows, nbytes = 0, offset = 0, precision = 0) {
data = ref.reinterpret(data.deref(), nbytes * num_of_rows, offset);
let res = [];
let currOffset = 0;
while (currOffset < data.length) {
let d = data.readUIntLE(currOffset, 1);
res.push(d == FieldTypes.C_TINYINT_UNSIGNED_NULL ? null : d);
currOffset += nbytes;
}
return res;
}
function convertSmallint(data, num_of_rows, nbytes = 0, offset = 0, precision = 0) { function convertSmallint(data, num_of_rows, nbytes = 0, offset = 0, precision = 0) {
data = ref.reinterpret(data.deref(), nbytes * num_of_rows, offset); data = ref.reinterpret(data.deref(), nbytes * num_of_rows, offset);
let res = []; let res = [];
...@@ -64,6 +77,18 @@ function convertSmallint(data, num_of_rows, nbytes = 0, offset = 0, precision = ...@@ -64,6 +77,18 @@ function convertSmallint(data, num_of_rows, nbytes = 0, offset = 0, precision =
} }
return res; return res;
} }
function convertSmallintUnsigned(data, num_of_rows, nbytes = 0, offset = 0, precision = 0) {
data = ref.reinterpret(data.deref(), nbytes * num_of_rows, offset);
let res = [];
let currOffset = 0;
while (currOffset < data.length) {
let d = data.readUIntLE(currOffset, 2);
res.push(d == FieldTypes.C_SMALLINT_UNSIGNED_NULL ? null : d);
currOffset += nbytes;
}
return res;
}
function convertInt(data, num_of_rows, nbytes = 0, offset = 0, precision = 0) { function convertInt(data, num_of_rows, nbytes = 0, offset = 0, precision = 0) {
data = ref.reinterpret(data.deref(), nbytes * num_of_rows, offset); data = ref.reinterpret(data.deref(), nbytes * num_of_rows, offset);
let res = []; let res = [];
...@@ -75,6 +100,19 @@ function convertInt(data, num_of_rows, nbytes = 0, offset = 0, precision = 0) { ...@@ -75,6 +100,19 @@ function convertInt(data, num_of_rows, nbytes = 0, offset = 0, precision = 0) {
} }
return res; return res;
} }
function convertIntUnsigned(data, num_of_rows, nbytes = 0, offset = 0, precision = 0) {
data = ref.reinterpret(data.deref(), nbytes * num_of_rows, offset);
let res = [];
let currOffset = 0;
while (currOffset < data.length) {
let d = data.readUInt32LE(currOffset);
res.push(d == FieldTypes.C_INT_UNSIGNED_NULL ? null : d);
currOffset += nbytes;
}
return res;
}
function convertBigint(data, num_of_rows, nbytes = 0, offset = 0, precision = 0) { function convertBigint(data, num_of_rows, nbytes = 0, offset = 0, precision = 0) {
data = ref.reinterpret(data.deref(), nbytes * num_of_rows, offset); data = ref.reinterpret(data.deref(), nbytes * num_of_rows, offset);
let res = []; let res = [];
...@@ -86,6 +124,19 @@ function convertBigint(data, num_of_rows, nbytes = 0, offset = 0, precision = 0) ...@@ -86,6 +124,19 @@ function convertBigint(data, num_of_rows, nbytes = 0, offset = 0, precision = 0)
} }
return res; return res;
} }
function convertBigintUnsigned(data, num_of_rows, nbytes = 0, offset = 0, precision = 0) {
data = ref.reinterpret(data.deref(), nbytes * num_of_rows, offset);
let res = [];
let currOffset = 0;
while (currOffset < data.length) {
let d = data.readUInt64LE(currOffset);
res.push(d == FieldTypes.C_BIGINT_UNSIGNED_NULL ? null : BigInt(d));
currOffset += nbytes;
}
return res;
}
function convertFloat(data, num_of_rows, nbytes = 0, offset = 0, precision = 0) { function convertFloat(data, num_of_rows, nbytes = 0, offset = 0, precision = 0) {
data = ref.reinterpret(data.deref(), nbytes * num_of_rows, offset); data = ref.reinterpret(data.deref(), nbytes * num_of_rows, offset);
let res = []; let res = [];
...@@ -156,7 +207,11 @@ let convertFunctions = { ...@@ -156,7 +207,11 @@ let convertFunctions = {
[FieldTypes.C_DOUBLE]: convertDouble, [FieldTypes.C_DOUBLE]: convertDouble,
[FieldTypes.C_BINARY]: convertBinary, [FieldTypes.C_BINARY]: convertBinary,
[FieldTypes.C_TIMESTAMP]: convertTimestamp, [FieldTypes.C_TIMESTAMP]: convertTimestamp,
[FieldTypes.C_NCHAR]: convertNchar [FieldTypes.C_NCHAR]: convertNchar,
[FieldTypes.C_TINYINT_UNSIGNED]: convertTinyintUnsigned,
[FieldTypes.C_SMALLINT_UNSIGNED]: convertSmallintUnsigned,
[FieldTypes.C_INT_UNSIGNED]: convertIntUnsigned,
[FieldTypes.C_BIGINT_UNSIGNED]: convertBigintUnsigned
} }
// Define TaosField structure // Define TaosField structure
...@@ -321,6 +376,7 @@ CTaosInterface.prototype.close = function close(connection) { ...@@ -321,6 +376,7 @@ CTaosInterface.prototype.close = function close(connection) {
CTaosInterface.prototype.query = function query(connection, sql) { CTaosInterface.prototype.query = function query(connection, sql) {
return this.libtaos.taos_query(connection, ref.allocCString(sql)); return this.libtaos.taos_query(connection, ref.allocCString(sql));
} }
CTaosInterface.prototype.affectedRows = function affectedRows(result) { CTaosInterface.prototype.affectedRows = function affectedRows(result) {
return this.libtaos.taos_affected_rows(result); return this.libtaos.taos_affected_rows(result);
} }
...@@ -413,6 +469,7 @@ CTaosInterface.prototype.query_a = function query_a(connection, sql, callback, p ...@@ -413,6 +469,7 @@ CTaosInterface.prototype.query_a = function query_a(connection, sql, callback, p
this.libtaos.taos_query_a(connection, ref.allocCString(sql), callback, param); this.libtaos.taos_query_a(connection, ref.allocCString(sql), callback, param);
return param; return param;
} }
/** Asynchrnously fetches the next block of rows. Wraps callback and transfers a 4th argument to the cursor, the row data as blocks in javascript form /** Asynchrnously fetches the next block of rows. Wraps callback and transfers a 4th argument to the cursor, the row data as blocks in javascript form
* Note: This isn't a recursive function, in order to fetch all data either use the TDengine cursor object, TaosQuery object, or implement a recrusive * Note: This isn't a recursive function, in order to fetch all data either use the TDengine cursor object, TaosQuery object, or implement a recrusive
* function yourself using the libtaos.taos_fetch_rows_a function * function yourself using the libtaos.taos_fetch_rows_a function
......
...@@ -36,13 +36,21 @@ module.exports = { ...@@ -36,13 +36,21 @@ module.exports = {
C_BINARY : 8, C_BINARY : 8,
C_TIMESTAMP : 9, C_TIMESTAMP : 9,
C_NCHAR : 10, C_NCHAR : 10,
C_TINYINT_UNSIGNED : 11,
C_SMALLINT_UNSIGNED : 12,
C_INT_UNSIGNED : 13,
C_BIGINT_UNSIGNED : 14,
// NULL value definition // NULL value definition
// NOTE: These values should change according to C definition in tsdb.h // NOTE: These values should change according to C definition in tsdb.h
C_BOOL_NULL : 2, C_BOOL_NULL : 2,
C_TINYINT_NULL : -128, C_TINYINT_NULL : -128,
C_TINYINT_UNSIGNED_NULL : 255,
C_SMALLINT_NULL : -32768, C_SMALLINT_NULL : -32768,
C_SMALLINT_UNSIGNED_NULL : 65535,
C_INT_NULL : -2147483648, C_INT_NULL : -2147483648,
C_BIGINT_NULL : -9223372036854775808, C_INT_UNSIGNED_NULL : 4294967295,
C_BIGINT_NULL : -9223372036854775808n,
C_BIGINT_UNSIGNED_NULL : 18446744073709551615n,
C_FLOAT_NULL : 2146435072, C_FLOAT_NULL : 2146435072,
C_DOUBLE_NULL : -9223370937343148032, C_DOUBLE_NULL : -9223370937343148032,
C_NCHAR_NULL : 4294967295, C_NCHAR_NULL : 4294967295,
...@@ -64,6 +72,10 @@ const typeCodesToName = { ...@@ -64,6 +72,10 @@ const typeCodesToName = {
8 : 'Binary', 8 : 'Binary',
9 : 'Timestamp', 9 : 'Timestamp',
10 : 'Nchar', 10 : 'Nchar',
11 : 'TINYINT_UNSIGNED',
12 : 'SMALLINT_UNSIGNED',
13 : 'INT_UNSIGNED',
14 : 'BIGINT_UNSIGNED',
} }
/** /**
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
"test": "test" "test": "test"
}, },
"scripts": { "scripts": {
"test": "node test/test.js && node test/testMicroseconds.js && node test/testNanoseconds.js" "test": "node test/test.js && node test/testMicroseconds.js && node test/testNanoseconds.js && node test/testUnsignedType.js "
}, },
"repository": { "repository": {
"type": "git", "type": "git",
......
...@@ -90,7 +90,7 @@ c1.execute("create table if not exists td_connector_test.weather(ts timestamp, t ...@@ -90,7 +90,7 @@ c1.execute("create table if not exists td_connector_test.weather(ts timestamp, t
c1.execute("insert into t1 using weather tags('北京') values(now, 11.11, 11)"); c1.execute("insert into t1 using weather tags('北京') values(now, 11.11, 11)");
c1.execute("insert into t1(ts, temperature) values(now, 22.22)"); c1.execute("insert into t1(ts, temperature) values(now, 22.22)");
c1.execute("insert into t1(ts, humidity) values(now, 33)"); c1.execute("insert into t1(ts, humidity) values(now, 33)");
c1.query('select * from test.t1', true).then(function (result) { c1.query('select * from td_connector_test.t1', true).then(function (result) {
result.pretty(); result.pretty();
}); });
......
const taos = require('../tdengine');
var conn = taos.connect({ host: "127.0.0.1", user: "root", password: "taosdata", config: "/etc/taos", port: 10 });
var c1 = conn.cursor();
executeUpdate("create database nodedb;");
executeUpdate("use nodedb;");
executeUpdate("create table unsigntest(ts timestamp,ut tinyint unsigned,us smallint unsigned,ui int unsigned,ub bigint unsigned,bi bigint);");
executeUpdate("insert into unsigntest values (now, 254,65534,4294967294,18446744073709551614,9223372036854775807);");
executeUpdate("insert into unsigntest values (now, 0,0,0,0,-9223372036854775807);");
executeQuery("select * from unsigntest;");
executeUpdate("drop database nodedb;");
function executeUpdate(sql) {
console.log(sql);
c1.execute(sql);
}
function executeQuery(sql) {
c1.execute(sql)
var data = c1.fetchall();
// Latest query's Field metadata is stored in cursor.fields
console.log(c1.fields);
// Latest query's result data is stored in cursor.data, also returned by fetchall.
console.log(c1.data);
}
setTimeout(()=>conn.close(),2000);
...@@ -175,11 +175,13 @@ DLL_EXPORT int taos_select_db(TAOS *taos, const char *db); ...@@ -175,11 +175,13 @@ DLL_EXPORT int taos_select_db(TAOS *taos, const char *db);
DLL_EXPORT int taos_print_row(char *str, TAOS_ROW row, TAOS_FIELD *fields, int num_fields); DLL_EXPORT int taos_print_row(char *str, TAOS_ROW row, TAOS_FIELD *fields, int num_fields);
DLL_EXPORT void taos_stop_query(TAOS_RES *res); DLL_EXPORT void taos_stop_query(TAOS_RES *res);
DLL_EXPORT bool taos_is_null(TAOS_RES *res, int32_t row, int32_t col); DLL_EXPORT bool taos_is_null(TAOS_RES *res, int32_t row, int32_t col);
DLL_EXPORT bool taos_is_update_query(TAOS_RES *res);
DLL_EXPORT int taos_fetch_block(TAOS_RES *res, TAOS_ROW *rows); DLL_EXPORT int taos_fetch_block(TAOS_RES *res, TAOS_ROW *rows);
DLL_EXPORT int taos_validate_sql(TAOS *taos, const char *sql);
DLL_EXPORT int* taos_fetch_lengths(TAOS_RES *res); DLL_EXPORT int* taos_fetch_lengths(TAOS_RES *res);
DLL_EXPORT int taos_validate_sql(TAOS *taos, const char *sql);
DLL_EXPORT void taos_reset_current_db(TAOS *taos);
// TAOS_RES *taos_list_tables(TAOS *mysql, const char *wild); // TAOS_RES *taos_list_tables(TAOS *mysql, const char *wild);
// TAOS_RES *taos_list_dbs(TAOS *mysql, const char *wild); // TAOS_RES *taos_list_dbs(TAOS *mysql, const char *wild);
...@@ -192,7 +194,6 @@ DLL_EXPORT int taos_errno(TAOS_RES *tres); ...@@ -192,7 +194,6 @@ DLL_EXPORT int taos_errno(TAOS_RES *tres);
DLL_EXPORT void taos_query_a(TAOS *taos, const char *sql, void (*fp)(void *param, TAOS_RES *, int code), void *param); DLL_EXPORT void taos_query_a(TAOS *taos, const char *sql, void (*fp)(void *param, TAOS_RES *, int code), void *param);
DLL_EXPORT void taos_fetch_rows_a(TAOS_RES *res, void (*fp)(void *param, TAOS_RES *, int numOfRows), void *param); DLL_EXPORT void taos_fetch_rows_a(TAOS_RES *res, void (*fp)(void *param, TAOS_RES *, int numOfRows), void *param);
//DLL_EXPORT void taos_fetch_row_a(TAOS_RES *res, void (*fp)(void *param, TAOS_RES *, TAOS_ROW row), void *param);
typedef void (*TAOS_SUBSCRIBE_CALLBACK)(TAOS_SUB* tsub, TAOS_RES *res, void* param, int code); typedef void (*TAOS_SUBSCRIBE_CALLBACK)(TAOS_SUB* tsub, TAOS_RES *res, void* param, int code);
DLL_EXPORT TAOS_SUB *taos_subscribe(TAOS* taos, int restart, const char* topic, const char *sql, TAOS_SUBSCRIBE_CALLBACK fp, void *param, int interval); DLL_EXPORT TAOS_SUB *taos_subscribe(TAOS* taos, int restart, const char* topic, const char *sql, TAOS_SUBSCRIBE_CALLBACK fp, void *param, int interval);
......
...@@ -415,7 +415,7 @@ typedef struct SColIndex { ...@@ -415,7 +415,7 @@ typedef struct SColIndex {
int16_t colId; // column id int16_t colId; // column id
int16_t colIndex; // column index in colList if it is a normal column or index in tagColList if a tag int16_t colIndex; // column index in colList if it is a normal column or index in tagColList if a tag
uint16_t flag; // denote if it is a tag or a normal column uint16_t flag; // denote if it is a tag or a normal column
char name[TSDB_COL_NAME_LEN + TSDB_DB_NAME_LEN + 1]; char name[TSDB_COL_NAME_LEN + TSDB_TABLE_NAME_LEN + 1];
} SColIndex; } SColIndex;
typedef struct SColumnFilterInfo { typedef struct SColumnFilterInfo {
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
static char **shellSQLFiles = NULL; static char **shellSQLFiles = NULL;
static int32_t shellSQLFileNum = 0; static int32_t shellSQLFileNum = 0;
static char shellTablesSQLFile[TSDB_FILENAME_LEN] = {0}; static char shellTablesSQLFile[4096] = {0};
typedef struct { typedef struct {
pthread_t threadID; pthread_t threadID;
......
...@@ -10969,7 +10969,7 @@ static void startMultiThreadInsertData(int threads, char* db_name, ...@@ -10969,7 +10969,7 @@ static void startMultiThreadInsertData(int threads, char* db_name,
} }
int64_t ntables = 0; int64_t ntables = 0;
uint64_t tableFrom; uint64_t tableFrom = 0;
if (stbInfo) { if (stbInfo) {
if (stbInfo->iface != SML_IFACE) { if (stbInfo->iface != SML_IFACE) {
......
...@@ -1167,7 +1167,7 @@ static int getTableDes( ...@@ -1167,7 +1167,7 @@ static int getTableDes(
while ((row = taos_fetch_row(res)) != NULL) { while ((row = taos_fetch_row(res)) != NULL) {
tstrncpy(tableDes->cols[colCount].field, tstrncpy(tableDes->cols[colCount].field,
(char *)row[TSDB_DESCRIBE_METRIC_FIELD_INDEX], (char *)row[TSDB_DESCRIBE_METRIC_FIELD_INDEX],
min(TSDB_COL_NAME_LEN + 1, min(TSDB_COL_NAME_LEN,
fields[TSDB_DESCRIBE_METRIC_FIELD_INDEX].bytes + 1)); fields[TSDB_DESCRIBE_METRIC_FIELD_INDEX].bytes + 1));
tstrncpy(tableDes->cols[colCount].type, tstrncpy(tableDes->cols[colCount].type,
(char *)row[TSDB_DESCRIBE_METRIC_TYPE_INDEX], (char *)row[TSDB_DESCRIBE_METRIC_TYPE_INDEX],
...@@ -1226,7 +1226,6 @@ static int getTableDes( ...@@ -1226,7 +1226,6 @@ static int getTableDes(
int32_t* length = taos_fetch_lengths(res); int32_t* length = taos_fetch_lengths(res);
//int32_t* length = taos_fetch_lengths(tmpResult);
switch (fields[0].type) { switch (fields[0].type) {
case TSDB_DATA_TYPE_BOOL: case TSDB_DATA_TYPE_BOOL:
sprintf(tableDes->cols[i].value, "%d", sprintf(tableDes->cols[i].value, "%d",
...@@ -1261,11 +1260,11 @@ static int getTableDes( ...@@ -1261,11 +1260,11 @@ static int getTableDes(
case TSDB_DATA_TYPE_BINARY: case TSDB_DATA_TYPE_BINARY:
memset(tableDes->cols[i].value, 0, memset(tableDes->cols[i].value, 0,
sizeof(tableDes->cols[i].value)); sizeof(tableDes->cols[i].value));
int len = strlen((char *)row[0]); int len = strlen((char *)row[TSDB_SHOW_TABLES_NAME_INDEX]);
// FIXME for long value // FIXME for long value
if (len < (COL_VALUEBUF_LEN - 2)) { if (len < (COL_VALUEBUF_LEN - 2)) {
converStringToReadable( converStringToReadable(
(char *)row[0], (char *)row[TSDB_SHOW_TABLES_NAME_INDEX],
length[0], length[0],
tableDes->cols[i].value, tableDes->cols[i].value,
len); len);
...@@ -1284,27 +1283,44 @@ static int getTableDes( ...@@ -1284,27 +1283,44 @@ static int getTableDes(
break; break;
case TSDB_DATA_TYPE_NCHAR: case TSDB_DATA_TYPE_NCHAR:
{ memset(tableDes->cols[i].value, 0,
memset(tableDes->cols[i].value, 0, sizeof(tableDes->cols[i].note)); sizeof(tableDes->cols[i].note));
char tbuf[COMMAND_SIZE-2]; // need reserve 2 bytes for ' ' int nlen = strlen((char *)row[TSDB_SHOW_TABLES_NAME_INDEX]);
if (nlen < (COL_VALUEBUF_LEN-2)) {
char tbuf[COL_VALUEBUF_LEN-2]; // need reserve 2 bytes for ' '
convertNCharToReadable( convertNCharToReadable(
(char *)row[TSDB_SHOW_TABLES_NAME_INDEX], (char *)row[TSDB_SHOW_TABLES_NAME_INDEX],
length[0], tbuf, COMMAND_SIZE-2); length[0], tbuf, COL_VALUEBUF_LEN-2);
sprintf(tableDes->cols[i].value, "%s", tbuf); sprintf(tableDes->cols[i].value, "%s", tbuf);
break; } else {
tableDes->cols[i].var_value = calloc(1, nlen * 4);
if (tableDes->cols[i].var_value == NULL) {
errorPrint("%s() LN%d, memory alalocation failed!\n",
__func__, __LINE__);
taos_free_result(res);
return -1;
}
converStringToReadable(
(char *)row[TSDB_SHOW_TABLES_NAME_INDEX],
length[0],
(char *)(tableDes->cols[i].var_value), nlen);
} }
break;
case TSDB_DATA_TYPE_TIMESTAMP: case TSDB_DATA_TYPE_TIMESTAMP:
sprintf(tableDes->cols[i].value, "%" PRId64 "", *(int64_t *)row[TSDB_SHOW_TABLES_NAME_INDEX]); sprintf(tableDes->cols[i].value, "%" PRId64 "",
*(int64_t *)row[TSDB_SHOW_TABLES_NAME_INDEX]);
#if 0 #if 0
if (!g_args.mysqlFlag) { if (!g_args.mysqlFlag) {
sprintf(tableDes->cols[i].value, "%" PRId64 "", *(int64_t *)row[TSDB_SHOW_TABLES_NAME_INDEX]); sprintf(tableDes->cols[i].value, "%" PRId64 "",
*(int64_t *)row[TSDB_SHOW_TABLES_NAME_INDEX]);
} else { } else {
char buf[64] = "\0"; char buf[64] = "\0";
int64_t ts = *((int64_t *)row[TSDB_SHOW_TABLES_NAME_INDEX]); int64_t ts = *((int64_t *)row[TSDB_SHOW_TABLES_NAME_INDEX]);
time_t tt = (time_t)(ts / 1000); time_t tt = (time_t)(ts / 1000);
struct tm *ptm = localtime(&tt); struct tm *ptm = localtime(&tt);
strftime(buf, 64, "%y-%m-%d %H:%M:%S", ptm); strftime(buf, 64, "%y-%m-%d %H:%M:%S", ptm);
sprintf(tableDes->cols[i].value, "\'%s.%03d\'", buf, (int)(ts % 1000)); sprintf(tableDes->cols[i].value, "\'%s.%03d\'", buf,
(int)(ts % 1000));
} }
#endif #endif
break; break;
......
...@@ -10,42 +10,42 @@ IF (TD_BUILD_HTTP) ...@@ -10,42 +10,42 @@ IF (TD_BUILD_HTTP)
ADD_SUBDIRECTORY(http) ADD_SUBDIRECTORY(http)
ELSE () ELSE ()
MESSAGE("") MESSAGE("")
MESSAGE("${Green} use blm3 as httpd ${ColourReset}") MESSAGE("${Green} use taosadapter as httpd ${ColourReset}")
EXECUTE_PROCESS( EXECUTE_PROCESS(
COMMAND cd ${CMAKE_CURRENT_SOURCE_DIR}/blm3 COMMAND cd ${CMAKE_CURRENT_SOURCE_DIR}/taosadapter
) )
EXECUTE_PROCESS( EXECUTE_PROCESS(
COMMAND git rev-parse --short HEAD COMMAND git rev-parse --short HEAD
RESULT_VARIABLE commit_sha1 RESULT_VARIABLE commit_sha1
OUTPUT_VARIABLE blm3_commit_sha1 OUTPUT_VARIABLE taosadapter_commit_sha1
) )
IF ("${blm3_commit_sha1}" STREQUAL "") IF ("${taosadapter_commit_sha1}" STREQUAL "")
SET(blm3_commit_sha1 "unknown") SET(taosadapter_commit_sha1 "unknown")
ELSE () ELSE ()
STRING(SUBSTRING "${blm3_commit_sha1}" 0 7 blm3_commit_sha1) STRING(SUBSTRING "${taosadapter_commit_sha1}" 0 7 taosadapter_commit_sha1)
STRING(STRIP "${blm3_commit_sha1}" blm3_commit_sha1) STRING(STRIP "${taosadapter_commit_sha1}" taosadapter_commit_sha1)
ENDIF () ENDIF ()
MESSAGE("${Green} blm3 commit: ${blm3_commit_sha1} ${ColourReset}") MESSAGE("${Green} taosadapter commit: ${taosadapter_commit_sha1} ${ColourReset}")
EXECUTE_PROCESS( EXECUTE_PROCESS(
COMMAND cd .. COMMAND cd ..
) )
include(ExternalProject) include(ExternalProject)
ExternalProject_Add(blm3 ExternalProject_Add(taosadapter
PREFIX "blm3" PREFIX "taosadapter"
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/blm3 SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/taosadapter
BUILD_ALWAYS off BUILD_ALWAYS off
DEPENDS taos DEPENDS taos
BUILD_IN_SOURCE 1 BUILD_IN_SOURCE 1
CONFIGURE_COMMAND cmake -E echo "blm3 no need cmake to config" CONFIGURE_COMMAND cmake -E echo "taosadapter no need cmake to config"
PATCH_COMMAND PATCH_COMMAND
COMMAND git clean -f -d COMMAND git clean -f -d
BUILD_COMMAND CGO_CFLAGS=-I${CMAKE_CURRENT_SOURCE_DIR}/../inc CGO_LDFLAGS=-L${CMAKE_BINARY_DIR}/build/lib go build -ldflags "-s -w -X github.com/taosdata/blm3/version.CommitID=${blm3_commit_sha1}" BUILD_COMMAND CGO_CFLAGS=-I${CMAKE_CURRENT_SOURCE_DIR}/../inc CGO_LDFLAGS=-L${CMAKE_BINARY_DIR}/build/lib go build -ldflags "-s -w -X github.com/taosdata/taosadapter/version.CommitID=${taosadapter_commit_sha1}"
INSTALL_COMMAND INSTALL_COMMAND
COMMAND curl -sL https://github.com/upx/upx/releases/download/v3.96/upx-3.96-amd64_linux.tar.xz -o upx.tar.xz && tar xvJf upx.tar.xz --strip-components 1 && ./upx blm3 COMMAND curl -sL https://github.com/upx/upx/releases/download/v3.96/upx-3.96-amd64_linux.tar.xz -o upx.tar.xz && tar xvJf upx.tar.xz --strip-components 1 > /dev/null && ./upx taosadapter || :
COMMAND cmake -E copy blm3 ${CMAKE_BINARY_DIR}/build/bin COMMAND cmake -E copy taosadapter ${CMAKE_BINARY_DIR}/build/bin
COMMAND cmake -E make_directory ${CMAKE_BINARY_DIR}/test/cfg/ COMMAND cmake -E make_directory ${CMAKE_BINARY_DIR}/test/cfg/
COMMAND cmake -E copy ./example/config/blm.toml ${CMAKE_BINARY_DIR}/test/cfg/ COMMAND cmake -E copy ./example/config/taosadapter.toml ${CMAKE_BINARY_DIR}/test/cfg/
COMMAND cmake -E copy ./blm3.service ${CMAKE_BINARY_DIR}/test/cfg/ COMMAND cmake -E copy ./taosadapter.service ${CMAKE_BINARY_DIR}/test/cfg/
) )
ENDIF () ENDIF ()
......
Subproject commit 598cb96ee60ec6a16c5b8b07ea8ca9748799e7e1
Subproject commit 6397bf5963f62f0aa5c4b9b961b16ed5c62579f1
...@@ -355,16 +355,16 @@ enum OPERATOR_TYPE_E { ...@@ -355,16 +355,16 @@ enum OPERATOR_TYPE_E {
typedef struct SOperatorInfo { typedef struct SOperatorInfo {
uint8_t operatorType; uint8_t operatorType;
bool blockingOptr; // block operator or not bool blockingOptr; // block operator or not
uint8_t status; // denote if current operator is completed uint8_t status; // denote if current operator is completed
int32_t numOfOutput; // number of columns of the current operator results int32_t numOfOutput; // number of columns of the current operator results
char *name; // name, used to show the query execution plan char *name; // name, used to show the query execution plan
void *info; // extension attribution void *info; // extension attribution
SExprInfo *pExpr; SExprInfo *pExpr;
SQueryRuntimeEnv *pRuntimeEnv; SQueryRuntimeEnv *pRuntimeEnv;
struct SOperatorInfo **upstream; // upstream pointer list struct SOperatorInfo **upstream; // upstream pointer list
int32_t numOfUpstream; // number of upstream. The value is always ONE expect for join operator int32_t numOfUpstream; // number of upstream. The value is always ONE expect for join operator
__operator_fn_t exec; __operator_fn_t exec;
__optr_cleanup_fn_t cleanup; __optr_cleanup_fn_t cleanup;
} SOperatorInfo; } SOperatorInfo;
......
...@@ -4231,7 +4231,7 @@ static int32_t doCopyToSDataBlock(SQueryRuntimeEnv* pRuntimeEnv, SGroupResInfo* ...@@ -4231,7 +4231,7 @@ static int32_t doCopyToSDataBlock(SQueryRuntimeEnv* pRuntimeEnv, SGroupResInfo*
int32_t start = 0; int32_t start = 0;
int32_t step = -1; int32_t step = -1;
qDebug("QInfo:0x%"PRIx64" start to copy data from windowResInfo to output buf", GET_QID(pRuntimeEnv)); qDebug("QInfo:0x%"PRIx64" start to copy data from resultrowInfo to output buf", GET_QID(pRuntimeEnv));
assert(orderType == TSDB_ORDER_ASC || orderType == TSDB_ORDER_DESC); assert(orderType == TSDB_ORDER_ASC || orderType == TSDB_ORDER_DESC);
if (orderType == TSDB_ORDER_ASC) { if (orderType == TSDB_ORDER_ASC) {
...@@ -5220,7 +5220,6 @@ SOperatorInfo* createTableScanOperator(void* pTsdbQueryHandle, SQueryRuntimeEnv* ...@@ -5220,7 +5220,6 @@ SOperatorInfo* createTableScanOperator(void* pTsdbQueryHandle, SQueryRuntimeEnv*
pInfo->reverseTimes = 0; pInfo->reverseTimes = 0;
pInfo->order = pRuntimeEnv->pQueryAttr->order.order; pInfo->order = pRuntimeEnv->pQueryAttr->order.order;
pInfo->current = 0; pInfo->current = 0;
// pInfo->prevGroupId = -1;
SOperatorInfo* pOperator = calloc(1, sizeof(SOperatorInfo)); SOperatorInfo* pOperator = calloc(1, sizeof(SOperatorInfo));
pOperator->name = "TableScanOperator"; pOperator->name = "TableScanOperator";
......
...@@ -448,7 +448,9 @@ int32_t tsDescOrder(const void* p1, const void* p2) { ...@@ -448,7 +448,9 @@ int32_t tsDescOrder(const void* p1, const void* p2) {
} }
} }
void orderTheResultRows(SQueryRuntimeEnv* pRuntimeEnv) { void
orderTheResultRows(SQueryRuntimeEnv* pRuntimeEnv) {
__compar_fn_t fn = NULL; __compar_fn_t fn = NULL;
if (pRuntimeEnv->pQueryAttr->order.order == TSDB_ORDER_ASC) { if (pRuntimeEnv->pQueryAttr->order.order == TSDB_ORDER_ASC) {
fn = tsAscOrder; fn = tsAscOrder;
......
...@@ -296,7 +296,7 @@ double tdigestQuantile(TDigest *t, double q) { ...@@ -296,7 +296,7 @@ double tdigestQuantile(TDigest *t, double q) {
a = b; a = b;
right = t->max; right = t->max;
if (idx < weight_so_far + a->weight) { if (idx < weight_so_far + a->weight && a->weight != 0) {
double p = (idx - weight_so_far) / a->weight; double p = (idx - weight_so_far) / a->weight;
return left * (1 - p) + right * p; return left * (1 - p) + right * p;
} }
......
...@@ -233,7 +233,7 @@ static int64_t syncProcessLastWal(SSyncPeer *pPeer, char *wname, int64_t index) ...@@ -233,7 +233,7 @@ static int64_t syncProcessLastWal(SSyncPeer *pPeer, char *wname, int64_t index)
int32_t once = 0; // last WAL has once ever been processed int32_t once = 0; // last WAL has once ever been processed
int64_t offset = 0; int64_t offset = 0;
uint64_t fversion = 0; uint64_t fversion = 0;
char fname[TSDB_FILENAME_LEN * 2] = {0}; // full path to wal file char fname[TSDB_FILENAME_LEN * 3] = {0}; // full path to wal file
// get full path to wal file // get full path to wal file
snprintf(fname, sizeof(fname), "%s/%s", pNode->path, wname); snprintf(fname, sizeof(fname), "%s/%s", pNode->path, wname);
......
...@@ -222,7 +222,7 @@ int tsdbWriteBlockIdx(SDFile *pHeadf, SArray *pIdxA, void **ppBuf) { ...@@ -222,7 +222,7 @@ int tsdbWriteBlockIdx(SDFile *pHeadf, SArray *pIdxA, void **ppBuf) {
SBlockIdx *pBlkIdx; SBlockIdx *pBlkIdx;
size_t nidx = taosArrayGetSize(pIdxA); size_t nidx = taosArrayGetSize(pIdxA);
int tlen = 0, size; int tlen = 0, size;
int64_t offset; int64_t offset = 0;
if (nidx <= 0) { if (nidx <= 0) {
// All data are deleted // All data are deleted
...@@ -1179,7 +1179,7 @@ int tsdbWriteBlockImpl(STsdbRepo *pRepo, STable *pTable, SDFile *pDFile, SDFile ...@@ -1179,7 +1179,7 @@ int tsdbWriteBlockImpl(STsdbRepo *pRepo, STable *pTable, SDFile *pDFile, SDFile
return -1; return -1;
} }
uint32_t aggrStatus = ((nColsNotAllNull > 0) && (rowsToWrite > 8)) ? 1 : 0; // TODO: How to make the decision? uint32_t aggrStatus = nColsNotAllNull > 0 ? 1 : 0;
if (aggrStatus > 0) { if (aggrStatus > 0) {
taosCalcChecksumAppend(0, (uint8_t *)pAggrBlkData, tsizeAggr); taosCalcChecksumAppend(0, (uint8_t *)pAggrBlkData, tsizeAggr);
......
...@@ -1544,7 +1544,7 @@ static void mergeTwoRowFromMem(STsdbQueryHandle* pQueryHandle, int32_t capacity, ...@@ -1544,7 +1544,7 @@ static void mergeTwoRowFromMem(STsdbQueryHandle* pQueryHandle, int32_t capacity,
int16_t offset; int16_t offset;
bool isRow1DataRow = isDataRow(row1); bool isRow1DataRow = isDataRow(row1);
bool isRow2DataRow; bool isRow2DataRow = false;
bool isChosenRowDataRow; bool isChosenRowDataRow;
int32_t chosen_itr; int32_t chosen_itr;
void *value; void *value;
...@@ -3452,9 +3452,12 @@ void filterPrepare(void* expr, void* param) { ...@@ -3452,9 +3452,12 @@ void filterPrepare(void* expr, void* param) {
int dummy = -1; int dummy = -1;
SHashObj *pObj = NULL; SHashObj *pObj = NULL;
if (pInfo->sch.colId == TSDB_TBNAME_COLUMN_INDEX) { if (pInfo->sch.colId == TSDB_TBNAME_COLUMN_INDEX) {
pObj = taosHashInit(256, taosGetDefaultHashFunction(pInfo->sch.type), true, false);
SArray *arr = (SArray *)(pCond->arr); SArray *arr = (SArray *)(pCond->arr);
for (size_t i = 0; i < taosArrayGetSize(arr); i++) {
size_t size = taosArrayGetSize(arr);
pObj = taosHashInit(size * 2, taosGetDefaultHashFunction(pInfo->sch.type), true, false);
for (size_t i = 0; i < size; i++) {
char* p = taosArrayGetP(arr, i); char* p = taosArrayGetP(arr, i);
strntolower_s(varDataVal(p), varDataVal(p), varDataLen(p)); strntolower_s(varDataVal(p), varDataVal(p), varDataLen(p));
taosHashPut(pObj, varDataVal(p), varDataLen(p), &dummy, sizeof(dummy)); taosHashPut(pObj, varDataVal(p), varDataLen(p), &dummy, sizeof(dummy));
...@@ -3462,12 +3465,14 @@ void filterPrepare(void* expr, void* param) { ...@@ -3462,12 +3465,14 @@ void filterPrepare(void* expr, void* param) {
} else { } else {
buildFilterSetFromBinary((void **)&pObj, pCond->pz, pCond->nLen); buildFilterSetFromBinary((void **)&pObj, pCond->pz, pCond->nLen);
} }
pInfo->q = (char *)pObj; pInfo->q = (char *)pObj;
} else if (pCond != NULL) { } else if (pCond != NULL) {
uint32_t size = pCond->nLen * TSDB_NCHAR_SIZE; uint32_t size = pCond->nLen * TSDB_NCHAR_SIZE;
if (size < (uint32_t)pSchema->bytes) { if (size < (uint32_t)pSchema->bytes) {
size = pSchema->bytes; size = pSchema->bytes;
} }
// to make sure tonchar does not cause invalid write, since the '\0' needs at least sizeof(wchar_t) space. // to make sure tonchar does not cause invalid write, since the '\0' needs at least sizeof(wchar_t) space.
pInfo->q = calloc(1, size + TSDB_NCHAR_SIZE + VARSTR_HEADER_SIZE); pInfo->q = calloc(1, size + TSDB_NCHAR_SIZE + VARSTR_HEADER_SIZE);
tVariantDump(pCond, pInfo->q, pSchema->type, true); tVariantDump(pCond, pInfo->q, pSchema->type, true);
...@@ -3615,7 +3620,7 @@ SArray* createTableGroup(SArray* pTableList, STSchema* pTagSchema, SColIndex* pC ...@@ -3615,7 +3620,7 @@ SArray* createTableGroup(SArray* pTableList, STSchema* pTagSchema, SColIndex* pC
return pTableGroup; return pTableGroup;
} }
int32_t tsdbQuerySTableByTagCond(STsdbRepo* tsdb, uint64_t uid, TSKEY skey, const char* pTagCond, size_t len, int32_t tsdbQuerySTableByTagCond(STsdbRepo* tsdb, uint64_t uid, TSKEY skey, const char* pTagCond, size_t len,
STableGroupInfo* pGroupInfo, SColIndex* pColIndex, int32_t numOfCols) { STableGroupInfo* pGroupInfo, SColIndex* pColIndex, int32_t numOfCols) {
if (tsdbRLockRepoMeta(tsdb) < 0) goto _error; if (tsdbRLockRepoMeta(tsdb) < 0) goto _error;
...@@ -3677,19 +3682,19 @@ int32_t tsdbQuerySTableByTagCond(STsdbRepo* tsdb, uint64_t uid, TSKEY skey, cons ...@@ -3677,19 +3682,19 @@ int32_t tsdbQuerySTableByTagCond(STsdbRepo* tsdb, uint64_t uid, TSKEY skey, cons
} END_TRY } END_TRY
void *filterInfo = NULL; void *filterInfo = NULL;
ret = filterInitFromTree(expr, &filterInfo, 0); ret = filterInitFromTree(expr, &filterInfo, 0);
if (ret != TSDB_CODE_SUCCESS) { if (ret != TSDB_CODE_SUCCESS) {
terrno = ret; terrno = ret;
goto _error; goto _error;
} }
tsdbQueryTableList(pTable, res, filterInfo); tsdbQueryTableList(pTable, res, filterInfo);
filterFreeInfo(filterInfo); filterFreeInfo(filterInfo);
tExprTreeDestroy(expr, NULL); tExprTreeDestroy(expr, NULL);
pGroupInfo->numOfTables = (uint32_t)taosArrayGetSize(res); pGroupInfo->numOfTables = (uint32_t)taosArrayGetSize(res);
pGroupInfo->pGroupList = createTableGroup(res, pTagSchema, pColIndex, numOfCols, skey); pGroupInfo->pGroupList = createTableGroup(res, pTagSchema, pColIndex, numOfCols, skey);
...@@ -3876,7 +3881,7 @@ void tsdbDestroyTableGroup(STableGroupInfo *pGroupList) { ...@@ -3876,7 +3881,7 @@ void tsdbDestroyTableGroup(STableGroupInfo *pGroupList) {
static FORCE_INLINE int32_t tsdbGetTagDataFromId(void *param, int32_t id, void **data) { static FORCE_INLINE int32_t tsdbGetTagDataFromId(void *param, int32_t id, void **data) {
STable* pTable = (STable*)(SL_GET_NODE_DATA((SSkipListNode *)param)); STable* pTable = (STable*)(SL_GET_NODE_DATA((SSkipListNode *)param));
if (id == TSDB_TBNAME_COLUMN_INDEX) { if (id == TSDB_TBNAME_COLUMN_INDEX) {
*data = TABLE_NAME(pTable); *data = TABLE_NAME(pTable);
} else { } else {
...@@ -3909,7 +3914,7 @@ static void queryIndexedColumn(SSkipList* pSkipList, void* filterInfo, SArray* r ...@@ -3909,7 +3914,7 @@ static void queryIndexedColumn(SSkipList* pSkipList, void* filterInfo, SArray* r
iter = tSkipListCreateIterFromVal(pSkipList, startVal, pSkipList->type, TSDB_ORDER_DESC); iter = tSkipListCreateIterFromVal(pSkipList, startVal, pSkipList->type, TSDB_ORDER_DESC);
FILTER_CLR_FLAG(order, TSDB_ORDER_DESC); FILTER_CLR_FLAG(order, TSDB_ORDER_DESC);
} }
while (tSkipListIterNext(iter)) { while (tSkipListIterNext(iter)) {
SSkipListNode *pNode = tSkipListIterGet(iter); SSkipListNode *pNode = tSkipListIterGet(iter);
...@@ -3918,7 +3923,7 @@ static void queryIndexedColumn(SSkipList* pSkipList, void* filterInfo, SArray* r ...@@ -3918,7 +3923,7 @@ static void queryIndexedColumn(SSkipList* pSkipList, void* filterInfo, SArray* r
filterSetColFieldData(filterInfo, pNode, tsdbGetTagDataFromId); filterSetColFieldData(filterInfo, pNode, tsdbGetTagDataFromId);
all = filterExecute(filterInfo, 1, &addToResult, NULL, 0); all = filterExecute(filterInfo, 1, &addToResult, NULL, 0);
} }
char *pData = SL_GET_NODE_DATA(pNode); char *pData = SL_GET_NODE_DATA(pNode);
tsdbDebug("filter index column, table:%s, result:%d", ((STable *)pData)->name->data, all); tsdbDebug("filter index column, table:%s, result:%d", ((STable *)pData)->name->data, all);
...@@ -3950,7 +3955,7 @@ static void queryIndexlessColumn(SSkipList* pSkipList, void* filterInfo, SArray* ...@@ -3950,7 +3955,7 @@ static void queryIndexlessColumn(SSkipList* pSkipList, void* filterInfo, SArray*
SSkipListNode *pNode = tSkipListIterGet(iter); SSkipListNode *pNode = tSkipListIterGet(iter);
filterSetColFieldData(filterInfo, pNode, tsdbGetTagDataFromId); filterSetColFieldData(filterInfo, pNode, tsdbGetTagDataFromId);
char *pData = SL_GET_NODE_DATA(pNode); char *pData = SL_GET_NODE_DATA(pNode);
bool all = filterExecute(filterInfo, 1, &addToResult, NULL, 0); bool all = filterExecute(filterInfo, 1, &addToResult, NULL, 0);
...@@ -3958,7 +3963,7 @@ static void queryIndexlessColumn(SSkipList* pSkipList, void* filterInfo, SArray* ...@@ -3958,7 +3963,7 @@ static void queryIndexlessColumn(SSkipList* pSkipList, void* filterInfo, SArray*
if (all || (addToResult && *addToResult)) { if (all || (addToResult && *addToResult)) {
STableKeyInfo info = {.pTable = (void*)pData, .lastKey = TSKEY_INITIAL_VAL}; STableKeyInfo info = {.pTable = (void*)pData, .lastKey = TSKEY_INITIAL_VAL};
taosArrayPush(res, &info); taosArrayPush(res, &info);
} }
} }
tfree(addToResult); tfree(addToResult);
...@@ -3971,9 +3976,9 @@ static int32_t tsdbQueryTableList(STable* pTable, SArray* pRes, void* filterInfo ...@@ -3971,9 +3976,9 @@ static int32_t tsdbQueryTableList(STable* pTable, SArray* pRes, void* filterInfo
STSchema* pTSSchema = pTable->tagSchema; STSchema* pTSSchema = pTable->tagSchema;
bool indexQuery = false; bool indexQuery = false;
SSkipList *pSkipList = pTable->pIndex; SSkipList *pSkipList = pTable->pIndex;
filterIsIndexedColumnQuery(filterInfo, pTSSchema->columns->colId, &indexQuery); filterIsIndexedColumnQuery(filterInfo, pTSSchema->columns->colId, &indexQuery);
if (indexQuery) { if (indexQuery) {
queryIndexedColumn(pSkipList, filterInfo, pRes); queryIndexedColumn(pSkipList, filterInfo, pRes);
} else { } else {
......
...@@ -230,7 +230,7 @@ void taosheapadjust(void *base, int32_t size, int32_t start, int32_t end, const ...@@ -230,7 +230,7 @@ void taosheapadjust(void *base, int32_t size, int32_t start, int32_t end, const
{ {
int32_t parent; int32_t parent;
int32_t child; int32_t child;
char *buf; char *buf = NULL;
if (base && size > 0 && compar) { if (base && size > 0 && compar) {
parent = start; parent = start;
......
...@@ -566,7 +566,7 @@ static int32_t taosPushLogBuffer(SLogBuff *tLogBuff, char *msg, int32_t msgLen) ...@@ -566,7 +566,7 @@ static int32_t taosPushLogBuffer(SLogBuff *tLogBuff, char *msg, int32_t msgLen)
int32_t end = 0; int32_t end = 0;
int32_t remainSize = 0; int32_t remainSize = 0;
static int64_t lostLine = 0; static int64_t lostLine = 0;
char tmpBuf[40] = {0}; char tmpBuf[60] = {0};
int32_t tmpBufLen = 0; int32_t tmpBufLen = 0;
if (tLogBuff == NULL || tLogBuff->stop) return -1; if (tLogBuff == NULL || tLogBuff->stop) return -1;
......
...@@ -258,9 +258,9 @@ void taosCloseQset(taos_qset param) { ...@@ -258,9 +258,9 @@ void taosCloseQset(taos_qset param) {
pthread_mutex_unlock(&qset->mutex); pthread_mutex_unlock(&qset->mutex);
pthread_mutex_destroy(&qset->mutex); pthread_mutex_destroy(&qset->mutex);
uTrace("qset:%p is closed", qset);
tsem_destroy(&qset->sem); tsem_destroy(&qset->sem);
free(qset); free(qset);
uTrace("qset:%p is closed", qset);
} }
// tsem_post 'qset->sem', so that reader threads waiting for it // tsem_post 'qset->sem', so that reader threads waiting for it
......
...@@ -91,6 +91,6 @@ void *tWorkerAllocQueue(SWorkerPool *pPool, void *ahandle) { ...@@ -91,6 +91,6 @@ void *tWorkerAllocQueue(SWorkerPool *pPool, void *ahandle) {
} }
void tWorkerFreeQueue(SWorkerPool *pPool, void *pQueue) { void tWorkerFreeQueue(SWorkerPool *pPool, void *pQueue) {
taosCloseQueue(pQueue);
uDebug("worker:%s, queue:%p is freed", pPool->name, pQueue); uDebug("worker:%s, queue:%p is freed", pPool->name, pQueue);
taosCloseQueue(pQueue);
} }
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
...@@ -25,8 +25,7 @@ class TDTestCase: ...@@ -25,8 +25,7 @@ class TDTestCase:
tdLog.debug("start to execute %s" % __file__) tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor(), logSql) tdSql.init(conn.cursor(), logSql)
now = time.time() self.ts = 1633333333000.
self.ts = int(round(now * 1000))
self.num = 10 self.num = 10
def run(self): def run(self):
...@@ -534,4 +533,4 @@ class TDTestCase: ...@@ -534,4 +533,4 @@ class TDTestCase:
tdCases.addWindows(__file__, TDTestCase()) tdCases.addWindows(__file__, TDTestCase())
tdCases.addLinux(__file__, TDTestCase()) tdCases.addLinux(__file__, TDTestCase())
\ No newline at end of file
...@@ -149,6 +149,22 @@ class TDTestCase: ...@@ -149,6 +149,22 @@ class TDTestCase:
tdLog.info("case for bug_6387") tdLog.info("case for bug_6387")
self.bug_6387() self.bug_6387()
#JIRA TS-583
tdLog.info("case for JIRA TS-583")
tdSql.execute("create database test2")
tdSql.execute("use test2")
tdSql.execute("create table stb(ts timestamp, c1 int) tags(t1 binary(120))")
tdSql.execute("create table t0 using stb tags('abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz')")
tdSql.query("show create table t0")
tdSql.checkRows(1)
tdSql.execute("create table stb2(ts timestamp, c1 int) tags(t1 nchar(120))")
tdSql.execute("create table t1 using stb2 tags('abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz')")
tdSql.query("show create table t1")
tdSql.checkRows(1)
def stop(self): def stop(self):
tdSql.close() tdSql.close()
tdLog.success("%s successfully executed" % __file__) tdLog.success("%s successfully executed" % __file__)
......
...@@ -275,7 +275,7 @@ class TDDnode: ...@@ -275,7 +275,7 @@ class TDDnode:
tdLog.info("taosd found in %s" % buildPath) tdLog.info("taosd found in %s" % buildPath)
binPath = buildPath + "/build/bin/taosd" binPath = buildPath + "/build/bin/taosd"
blm3BinPath = buildPath + "/build/bin/blm3" taosadapterBinPath = buildPath + "/build/bin/taosadapter"
if self.deployed == 0: if self.deployed == 0:
tdLog.exit("dnode:%d is not deployed" % (self.index)) tdLog.exit("dnode:%d is not deployed" % (self.index))
...@@ -291,10 +291,10 @@ class TDDnode: ...@@ -291,10 +291,10 @@ class TDDnode:
print(cmd) print(cmd)
blm3Cmd = "nohup %s > /dev/null 2>&1 & " % ( taosadapterCmd = "nohup %s > /dev/null 2>&1 & " % (
blm3BinPath) taosadapterBinPath)
if os.system(blm3Cmd) != 0: if os.system(taosadapterCmd) != 0:
tdLog.exit(blm3Cmd) tdLog.exit(taosadapterCmd)
if os.system(cmd) != 0: if os.system(cmd) != 0:
tdLog.exit(cmd) tdLog.exit(cmd)
...@@ -340,7 +340,7 @@ class TDDnode: ...@@ -340,7 +340,7 @@ class TDDnode:
tdLog.info("taosd found in %s" % buildPath) tdLog.info("taosd found in %s" % buildPath)
binPath = buildPath + "/build/bin/taosd" binPath = buildPath + "/build/bin/taosd"
blm3BinPath = buildPath + "/build/bin/blm3" taosadapterBinPath = buildPath + "/build/bin/taosadapter"
if self.deployed == 0: if self.deployed == 0:
tdLog.exit("dnode:%d is not deployed" % (self.index)) tdLog.exit("dnode:%d is not deployed" % (self.index))
...@@ -356,9 +356,9 @@ class TDDnode: ...@@ -356,9 +356,9 @@ class TDDnode:
print(cmd) print(cmd)
blm3Cmd = "%s > /dev/null 2>&1 & " % (blm3BinPath) taosadapterCmd = "%s > /dev/null 2>&1 & " % (taosadapterBinPath)
if os.system(blm3Cmd) != 0: if os.system(taosadapterCmd) != 0:
tdLog.exit(blm3Cmd) tdLog.exit(taosadapterCmd)
if os.system(cmd) != 0: if os.system(cmd) != 0:
tdLog.exit(cmd) tdLog.exit(cmd)
...@@ -366,18 +366,18 @@ class TDDnode: ...@@ -366,18 +366,18 @@ class TDDnode:
tdLog.debug("dnode:%d is running with %s " % (self.index, cmd)) tdLog.debug("dnode:%d is running with %s " % (self.index, cmd))
def stop(self): def stop(self):
blm3ToBeKilled = "blm3" taosadapterToBeKilled = "taosadapter"
blm3PsCmd = "ps -ef|grep -w %s| grep -v grep | awk '{print $2}'" % blm3ToBeKilled taosadapterPsCmd = "ps -ef|grep -w %s| grep -v grep | awk '{print $2}'" % taosadapterToBeKilled
blm3ProcessID = subprocess.check_output( taosadapterProcessID = subprocess.check_output(
blm3PsCmd, shell=True).decode("utf-8") taosadapterPsCmd, shell=True).decode("utf-8")
while(blm3ProcessID): while(taosadapterProcessID):
blm3KillCmd = "kill -INT %s > /dev/null 2>&1" % blm3ProcessID taosadapterKillCmd = "kill -INT %s > /dev/null 2>&1" % taosadapterProcessID
os.system(blm3KillCmd) os.system(taosadapterKillCmd)
time.sleep(1) time.sleep(1)
blm3ProcessID = subprocess.check_output( taosadapterProcessID = subprocess.check_output(
blm3PsCmd, shell=True).decode("utf-8") taosadapterPsCmd, shell=True).decode("utf-8")
if self.valgrind == 0: if self.valgrind == 0:
toBeKilled = "taosd" toBeKilled = "taosd"
......
...@@ -135,7 +135,7 @@ typedef struct _script_t { ...@@ -135,7 +135,7 @@ typedef struct _script_t {
int32_t numOfLines; // number of lines in the script int32_t numOfLines; // number of lines in the script
int32_t bgScriptLen; int32_t bgScriptLen;
char fileName[MAX_FILE_NAME_LEN]; // script file name char fileName[MAX_FILE_NAME_LEN]; // script file name
char error[MAX_ERROR_LEN]; char error[TSDB_MAX_BINARY_LEN + 100];
char * optionBuffer; char * optionBuffer;
SCmdLine *lines; // command list SCmdLine *lines; // command list
SVariable variables[MAX_VAR_LEN]; SVariable variables[MAX_VAR_LEN];
...@@ -178,4 +178,4 @@ bool simExecuteLineInsertCmd(SScript *script, char *option); ...@@ -178,4 +178,4 @@ bool simExecuteLineInsertCmd(SScript *script, char *option);
bool simExecuteLineInsertErrorCmd(SScript *script, char *option); bool simExecuteLineInsertErrorCmd(SScript *script, char *option);
void simVisuallizeOption(SScript *script, char *src, char *dst); void simVisuallizeOption(SScript *script, char *src, char *dst);
#endif #endif
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册