提交 80900600 编写于 作者: A Alex Duan

Merge branch '2.4' of github.com:taosdata/TDengine into 2.4

...@@ -22,7 +22,7 @@ ELSEIF (TD_WINDOWS) ...@@ -22,7 +22,7 @@ ELSEIF (TD_WINDOWS)
INSTALL(FILES ${EXECUTABLE_OUTPUT_PATH}/taos.exe DESTINATION .) INSTALL(FILES ${EXECUTABLE_OUTPUT_PATH}/taos.exe DESTINATION .)
IF (TD_MVN_INSTALLED) IF (TD_MVN_INSTALLED)
INSTALL(FILES ${LIBRARY_OUTPUT_PATH}/taos-jdbcdriver-2.0.36-dist.jar DESTINATION connector/jdbc) INSTALL(FILES ${LIBRARY_OUTPUT_PATH}/taos-jdbcdriver-2.0.37-dist.jar DESTINATION connector/jdbc)
ENDIF () ENDIF ()
ELSEIF (TD_DARWIN) ELSEIF (TD_DARWIN)
SET(TD_MAKE_INSTALL_SH "${TD_COMMUNITY_DIR}/packaging/tools/make_install.sh") SET(TD_MAKE_INSTALL_SH "${TD_COMMUNITY_DIR}/packaging/tools/make_install.sh")
......
...@@ -4,7 +4,7 @@ PROJECT(TDengine) ...@@ -4,7 +4,7 @@ PROJECT(TDengine)
IF (DEFINED VERNUMBER) IF (DEFINED VERNUMBER)
SET(TD_VER_NUMBER ${VERNUMBER}) SET(TD_VER_NUMBER ${VERNUMBER})
ELSE () ELSE ()
SET(TD_VER_NUMBER "2.4.0.4") SET(TD_VER_NUMBER "2.4.0.5")
ENDIF () ENDIF ()
IF (DEFINED VERCOMPATIBLE) IF (DEFINED VERCOMPATIBLE)
......
[Unit] [Unit]
Description=jh_iot server service Description=jh_iot server service
After=network-online.target taosadapter.service After=network-online.target
Wants=network-online.target taosadapter.service Wants=network-online.target
[Service] [Service]
Type=simple Type=simple
......
[Unit] [Unit]
Description=KingHistorian server service Description=KingHistorian server service
After=network-online.target taosadapter.service After=network-online.target
Wants=network-online.target taosadapter.service Wants=network-online.target
[Service] [Service]
Type=simple Type=simple
......
[Unit] [Unit]
Description=Power server service Description=Power server service
After=network-online.target taosadapter.service After=network-online.target
Wants=network-online.target taosadapter.service Wants=network-online.target
[Service] [Service]
Type=simple Type=simple
......
[Unit] [Unit]
Description=ProDB server service Description=ProDB server service
After=network-online.target taosadapter.service After=network-online.target
Wants=network-online.target taosadapter.service Wants=network-online.target
[Service] [Service]
Type=simple Type=simple
......
[Unit] [Unit]
Description=TQ server service Description=TQ server service
After=network-online.target taosadapter.service After=network-online.target
Wants=network-online.target taosadapter.service Wants=network-online.target
[Service] [Service]
Type=simple Type=simple
......
...@@ -205,6 +205,7 @@ else ...@@ -205,6 +205,7 @@ else
allocator_macro="" allocator_macro=""
fi fi
# 3. replace product info
if [[ "$dbName" != "taos" ]]; then if [[ "$dbName" != "taos" ]]; then
replace_community_$dbName replace_community_$dbName
fi fi
......
#!/bin/bash #!/bin/bash
function replace_community_pro() { function replace_community_pro() {
# src/kit/taos-tools/packaging/tools/install-taostools.sh
sed -i "s/demoName=\"taosdemo\"/demoName=\"prodemo\"/g" ${top_dir}/src/kit/taos-tools/packaging/tools/install-taostools.sh
sed -i "s/benchmarkName=\"taosBenchmark\"/benchmarkName=\"proBenchmark\"/g" ${top_dir}/src/kit/taos-tools/packaging/tools/install-taostools.sh
sed -i "s/dumpName=\"taosdump\"/dumpName=\"prodump\"/g" ${top_dir}/src/kit/taos-tools/packaging/tools/install-taostools.sh
sed -i "s/emailName=\"taosdata\.com\"/emailName=\"hanatech\.com\.cn\"/g" ${top_dir}/src/kit/taos-tools/packaging/tools/install-taostools.sh
sed -i "s/taosName=\"taos\"/taosName=\"prodb\"/g" ${top_dir}/src/kit/taos-tools/packaging/tools/install-taostools.sh
sed -i "s/toolsName=\"taostools\"/toolsName=\"prodbtools\"/g" ${top_dir}/src/kit/taos-tools/packaging/tools/install-taostools.sh
cp -f ${top_dir}/src/kit/taos-tools/packaging/tools/install-taostools.sh ${top_dir}/src/kit/taos-tools/packaging/tools/install-prodbtools.sh
# src/kit/taos-tools/packaging/tools/uninstall-taostools.sh
sed -i "s/demoName=\"taosdemo\"/demoName=\"prodemo\"/g" ${top_dir}/src/kit/taos-tools/packaging/tools/uninstall-taostools.sh
sed -i "s/benchmarkName=\"taosBenchmark\"/benchmarkName=\"proBenchmark\"/g" ${top_dir}/src/kit/taos-tools/packaging/tools/uninstall-taostools.sh
sed -i "s/dumpName=\"taosdump\"/dumpName=\"prodump\"/g" ${top_dir}/src/kit/taos-tools/packaging/tools/uninstall-taostools.sh
sed -i "s/taosName=\"taos\"/taosName=\"prodb\"/g" ${top_dir}/src/kit/taos-tools/packaging/tools/uninstall-taostools.sh
sed -i "s/toolsName=\"taostools\"/toolsName=\"prodbtools\"/g" ${top_dir}/src/kit/taos-tools/packaging/tools/uninstall-taostools.sh
cp -f ${top_dir}/src/kit/taos-tools/packaging/tools/uninstall-taostools.sh ${top_dir}/src/kit/taos-tools/packaging/tools/uninstall-prodbtools.sh
# src/kit/taos-tools/src/CMakeLists.txt
sed -i "s/taosBenchmark /proBenchmark /g" ${top_dir}/src/kit/taos-tools/src/CMakeLists.txt
sed -i "s/taosdump /prodump /g" ${top_dir}/src/kit/taos-tools/src/CMakeLists.txt
# src/kit/taos-tools/CMakeLists.txt
sed -i "s/taosdump/prodump/g" ${top_dir}/src/kit/taos-tools/CMakeLists.txt
sed -i "s/taosBenchmark/proBenchmark/g" ${top_dir}/src/kit/taos-tools/CMakeLists.txt
# src/kit/taos-tools/src/benchCommandOpt.c
sed -i "s/support@taosdata\.com/support@hanatech\.com\.cn/g" ${top_dir}/src/kit/taos-tools/src/benchCommandOpt.c
sed -i "s/taosc/prodbc/g" ${top_dir}/src/kit/taos-tools/src/benchCommandOpt.c
sed -i "s/default is taosdata/default is prodb/g" ${top_dir}/src/kit/taos-tools/src/benchCommandOpt.c
# src/kit/taos-tools/src/taosdump.c
sed -i "s/support@taosdata\.com/support@hanatech\.com\.cn/g" ${top_dir}/src/kit/taos-tools/src/taosdump.c
sed -i "s/\/etc\/taos/\/etc\/ProDB/g" ${top_dir}/src/kit/taos-tools/src/taosdump.c
sed -i "s/taosdata/prodb/g" ${top_dir}/src/kit/taos-tools/src/taosdump.c
sed -i "s/taosdump version/prodump version/g" ${top_dir}/src/kit/taos-tools/src/taosdump.c
sed -i "s/taosdump --help/prodump --help/g" ${top_dir}/src/kit/taos-tools/src/taosdump.c
sed -i "s/taosdump --usage/prodump --usage/g" ${top_dir}/src/kit/taos-tools/src/taosdump.c
sed -i "s/\"taosdump\"/\"prodump\"/g" ${top_dir}/src/kit/taos-tools/src/taosdump.c
sed -i "s/TDengine/ProDB/g" ${top_dir}/src/kit/taos-tools/src/taosdump.c
sed -i "s/taosdump requires/prodump requires/g" ${top_dir}/src/kit/taos-tools/src/taosdump.c
# cmake/install.inc # cmake/install.inc
sed -i "s/C:\/TDengine/C:\/ProDB/g" ${top_dir}/cmake/install.inc sed -i "s/C:\/TDengine/C:\/ProDB/g" ${top_dir}/cmake/install.inc
sed -i "s/taos\.cfg/prodb\.cfg/g" ${top_dir}/cmake/install.inc sed -i "s/taos\.cfg/prodb\.cfg/g" ${top_dir}/cmake/install.inc
...@@ -59,17 +97,26 @@ function replace_community_pro() { ...@@ -59,17 +97,26 @@ function replace_community_pro() {
sed -i "s/clientName=\"taos\"/clientName=\"prodbc\"/g" ${top_dir}/packaging/tools/makepkg.sh sed -i "s/clientName=\"taos\"/clientName=\"prodbc\"/g" ${top_dir}/packaging/tools/makepkg.sh
sed -i "s/configFile=\"taos\.cfg\"/configFile=\"prodb\.cfg\"/g" ${top_dir}/packaging/tools/makepkg.sh sed -i "s/configFile=\"taos\.cfg\"/configFile=\"prodb\.cfg\"/g" ${top_dir}/packaging/tools/makepkg.sh
sed -i "s/tarName=\"taos\.tar\.gz\"/tarName=\"prodb\.tar\.gz\"/g" ${top_dir}/packaging/tools/makepkg.sh sed -i "s/tarName=\"taos\.tar\.gz\"/tarName=\"prodb\.tar\.gz\"/g" ${top_dir}/packaging/tools/makepkg.sh
sed -i "s/dumpName=\"taosdump\"/dumpName=\"prodump\"/g" ${top_dir}/packaging/tools/makepkg.sh
sed -i "s/benchmarkName=\"taosBenchmark\"/benchmarkName=\"proBenchmark\"/g" ${top_dir}/packaging/tools/makepkg.sh
sed -i "s/toolsName=\"taostools\"/toolsName=\"prodbtools\"/g" ${top_dir}/packaging/tools/makepkg.sh
sed -i "s/adapterName=\"taosadapter\"/adapterName=\"proadapter\"/g" ${top_dir}/packaging/tools/makepkg.sh
sed -i "s/defaultPasswd=\"taosdata\"/defaultPasswd=\"prodb\"/g" ${top_dir}/packaging/tools/makepkg.sh
# packaging/tools/remove.sh # packaging/tools/remove.sh
sed -i "s/installDir=\"\/usr\/local\/taos\"/installDir=\"\/usr\/local\/ProDB\"/g" ${top_dir}/packaging/tools/remove.sh sed -i "s/installDir=\"\/usr\/local\/taos\"/installDir=\"\/usr\/local\/ProDB\"/g" ${top_dir}/packaging/tools/remove.sh
sed -i "s/serverName=\"taosd\"/serverName=\"prodbs\"/g" ${top_dir}/packaging/tools/remove.sh sed -i "s/serverName=\"taosd\"/serverName=\"prodbs\"/g" ${top_dir}/packaging/tools/remove.sh
sed -i "s/clientName=\"taos\"/clientName=\"prodbc\"/g" ${top_dir}/packaging/tools/remove.sh sed -i "s/clientName=\"taos\"/clientName=\"prodbc\"/g" ${top_dir}/packaging/tools/remove.sh
sed -i "s/uninstallScript=\"rmtaos\"/uninstallScript=\"rmpro\"/g" ${top_dir}/packaging/tools/remove.sh sed -i "s/uninstallScript=\"rmtaos\"/uninstallScript=\"rmpro\"/g" ${top_dir}/packaging/tools/remove.sh
sed -i "s/productName=\"TDengine\"/productName=\"ProDB\"/g" ${top_dir}/packaging/tools/remove.sh sed -i "s/productName=\"TDengine\"/productName=\"ProDB\"/g" ${top_dir}/packaging/tools/remove.sh
sed -i "s/adapterName=\"taosadapter\"/adapterName=\"proadapter\"/g" ${top_dir}/packaging/tools/remove.sh
# packaging/tools/startPre.sh # packaging/tools/startPre.sh
sed -i "s/serverName=\"taosd\"/serverName=\"prodbs\"/g" ${top_dir}/packaging/tools/startPre.sh sed -i "s/serverName=\"taosd\"/serverName=\"prodbs\"/g" ${top_dir}/packaging/tools/startPre.sh
sed -i "s/logDir=\"\/var\/log\/taos\"/logDir=\"\/var\/log\/ProDB\"/g" ${top_dir}/packaging/tools/startPre.sh sed -i "s/logDir=\"\/var\/log\/taos\"/logDir=\"\/var\/log\/ProDB\"/g" ${top_dir}/packaging/tools/startPre.sh
# packaging/tools/run_taosd_and_taosadapter.sh # packaging/tools/run_taosd_and_taosadapter.sh
sed -i "s/taosd/prodbs/g" ${top_dir}/packaging/tools/run_taosd_and_taosadapter.sh sed -i "s/taosd/prodbs/g" ${top_dir}/packaging/tools/run_taosd_and_taosadapter.sh
sed -i "s/taosadapter/proadapter/g" ${top_dir}/packaging/tools/run_taosd_and_taosadapter.sh
# packaging/tools/install.sh # packaging/tools/install.sh
sed -i "s/clientName=\"taos\"/clientName=\"prodbc\"/g" ${top_dir}/packaging/tools/install.sh sed -i "s/clientName=\"taos\"/clientName=\"prodbc\"/g" ${top_dir}/packaging/tools/install.sh
sed -i "s/serverName=\"taosd\"/serverName=\"prodbs\"/g" ${top_dir}/packaging/tools/install.sh sed -i "s/serverName=\"taosd\"/serverName=\"prodbs\"/g" ${top_dir}/packaging/tools/install.sh
...@@ -83,6 +130,7 @@ function replace_community_pro() { ...@@ -83,6 +130,7 @@ function replace_community_pro() {
sed -i "s/logDir=\"\/var\/log\/taos\"/logDir=\"\/var\/log\/ProDB\"/g" ${top_dir}/packaging/tools/install.sh sed -i "s/logDir=\"\/var\/log\/taos\"/logDir=\"\/var\/log\/ProDB\"/g" ${top_dir}/packaging/tools/install.sh
sed -i "s/configDir=\"\/etc\/taos\"/configDir=\"\/etc\/ProDB\"/g" ${top_dir}/packaging/tools/install.sh sed -i "s/configDir=\"\/etc\/taos\"/configDir=\"\/etc\/ProDB\"/g" ${top_dir}/packaging/tools/install.sh
sed -i "s/installDir=\"\/usr\/local\/taos\"/installDir=\"\/usr\/local\/ProDB\"/g" ${top_dir}/packaging/tools/install.sh sed -i "s/installDir=\"\/usr\/local\/taos\"/installDir=\"\/usr\/local\/ProDB\"/g" ${top_dir}/packaging/tools/install.sh
sed -i "s/adapterName=\"taosadapter\"/adapterName=\"proadapter\"/g" ${top_dir}/packaging/tools/install.sh
# packaging/tools/makeclient.sh # packaging/tools/makeclient.sh
sed -i "s/productName=\"TDengine\"/productName=\"ProDB\"/g" ${top_dir}/packaging/tools/makeclient.sh sed -i "s/productName=\"TDengine\"/productName=\"ProDB\"/g" ${top_dir}/packaging/tools/makeclient.sh
......
...@@ -28,6 +28,7 @@ dataDir="/var/lib/taos" ...@@ -28,6 +28,7 @@ dataDir="/var/lib/taos"
logDir="/var/log/taos" logDir="/var/log/taos"
configDir="/etc/taos" configDir="/etc/taos"
installDir="/usr/local/taos" installDir="/usr/local/taos"
adapterName="taosadapter"
data_dir=${dataDir} data_dir=${dataDir}
log_dir=${logDir} log_dir=${logDir}
...@@ -188,25 +189,21 @@ function install_bin() { ...@@ -188,25 +189,21 @@ function install_bin() {
# Remove links # Remove links
${csudo}rm -f ${bin_link_dir}/${clientName} || : ${csudo}rm -f ${bin_link_dir}/${clientName} || :
${csudo}rm -f ${bin_link_dir}/${serverName} || : ${csudo}rm -f ${bin_link_dir}/${serverName} || :
${csudo}rm -f ${bin_link_dir}/taosadapter || : ${csudo}rm -f ${bin_link_dir}/${adapterName} || :
${csudo}rm -f ${bin_link_dir}/taosdemo || :
${csudo}rm -f ${bin_link_dir}/taosdump || :
${csudo}rm -f ${bin_link_dir}/${uninstallScript} || : ${csudo}rm -f ${bin_link_dir}/${uninstallScript} || :
${csudo}rm -f ${bin_link_dir}/tarbitrator || : ${csudo}rm -f ${bin_link_dir}/tarbitrator || :
${csudo}rm -f ${bin_link_dir}/set_core || : ${csudo}rm -f ${bin_link_dir}/set_core || :
${csudo}rm -f ${bin_link_dir}/run_taosd_and_taosadapter.sh || : ${csudo}rm -f ${bin_link_dir}/run_taosd_and_${adapterName}.sh || :
${csudo}cp -r ${script_dir}/bin/* ${install_main_dir}/bin && ${csudo}chmod 0555 ${install_main_dir}/bin/* ${csudo}cp -r ${script_dir}/bin/* ${install_main_dir}/bin && ${csudo}chmod 0555 ${install_main_dir}/bin/*
#Make link #Make link
[ -x ${install_main_dir}/bin/${clientName} ] && ${csudo}ln -s ${install_main_dir}/bin/${clientName} ${bin_link_dir}/${clientName} || : [ -x ${install_main_dir}/bin/${clientName} ] && ${csudo}ln -s ${install_main_dir}/bin/${clientName} ${bin_link_dir}/${clientName} || :
[ -x ${install_main_dir}/bin/${serverName} ] && ${csudo}ln -s ${install_main_dir}/bin/${serverName} ${bin_link_dir}/${serverName} || : [ -x ${install_main_dir}/bin/${serverName} ] && ${csudo}ln -s ${install_main_dir}/bin/${serverName} ${bin_link_dir}/${serverName} || :
[ -x ${install_main_dir}/bin/taosadapter ] && ${csudo}ln -s ${install_main_dir}/bin/taosadapter ${bin_link_dir}/taosadapter || : [ -x ${install_main_dir}/bin/${adapterName} ] && ${csudo}ln -s ${install_main_dir}/bin/${adapterName} ${bin_link_dir}/${adapterName} || :
[ -x ${install_main_dir}/bin/taosBenchmark ] && ${csudo}ln -s ${install_main_dir}/bin/taosBenchmark ${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/remove.sh ] && ${csudo}ln -s ${install_main_dir}/bin/remove.sh ${bin_link_dir}/${uninstallScript} || : [ -x ${install_main_dir}/bin/remove.sh ] && ${csudo}ln -s ${install_main_dir}/bin/remove.sh ${bin_link_dir}/${uninstallScript} || :
[ -x ${install_main_dir}/bin/set_core.sh ] && ${csudo}ln -s ${install_main_dir}/bin/set_core.sh ${bin_link_dir}/set_core || : [ -x ${install_main_dir}/bin/set_core.sh ] && ${csudo}ln -s ${install_main_dir}/bin/set_core.sh ${bin_link_dir}/set_core || :
[ -x ${install_main_dir}/bin/run_taosd_and_taosadapter.sh ] && ${csudo}ln -s ${install_main_dir}/bin/run_taosd_and_taosadapter.sh ${bin_link_dir}/run_taosd_and_taosadapter.sh || : [ -x ${install_main_dir}/bin/run_taosd_and_${adapterName}.sh ] && ${csudo}ln -s ${install_main_dir}/bin/run_taosd_and_${adapterName}.sh ${bin_link_dir}/run_taosd_and_${adapterName}.sh || :
[ -x ${install_main_dir}/bin/tarbitrator ] && ${csudo}ln -s ${install_main_dir}/bin/tarbitrator ${bin_link_dir}/tarbitrator || : [ -x ${install_main_dir}/bin/tarbitrator ] && ${csudo}ln -s ${install_main_dir}/bin/tarbitrator ${bin_link_dir}/tarbitrator || :
if [ "$verMode" == "cluster" ]; then if [ "$verMode" == "cluster" ]; then
...@@ -464,17 +461,17 @@ function local_fqdn_check() { ...@@ -464,17 +461,17 @@ function local_fqdn_check() {
} }
function install_taosadapter_config() { function install_taosadapter_config() {
if [ ! -f "${cfg_install_dir}/taosadapter.toml" ]; then if [ ! -f "${cfg_install_dir}/${adapterName}.toml" ]; then
${csudo}mkdir -p ${cfg_install_dir} ${csudo}mkdir -p ${cfg_install_dir}
[ -f ${script_dir}/cfg/taosadapter.toml ] && ${csudo}cp ${script_dir}/cfg/taosadapter.toml ${cfg_install_dir} [ -f ${script_dir}/cfg/${adapterName}.toml ] && ${csudo}cp ${script_dir}/cfg/${adapterName}.toml ${cfg_install_dir}
[ -f ${cfg_install_dir}/taosadapter.toml ] && ${csudo}chmod 644 ${cfg_install_dir}/taosadapter.toml [ -f ${cfg_install_dir}/${adapterName}.toml ] && ${csudo}chmod 644 ${cfg_install_dir}/${adapterName}.toml
fi fi
[ -f ${script_dir}/cfg/taosadapter.toml ] && [ -f ${script_dir}/cfg/${adapterName}.toml ] &&
${csudo}cp -f ${script_dir}/cfg/taosadapter.toml ${cfg_install_dir}/taosadapter.toml.new ${csudo}cp -f ${script_dir}/cfg/${adapterName}.toml ${cfg_install_dir}/${adapterName}.toml.new
[ -f ${cfg_install_dir}/taosadapter.toml ] && [ -f ${cfg_install_dir}/${adapterName}.toml ] &&
${csudo}ln -s ${cfg_install_dir}/taosadapter.toml ${install_main_dir}/cfg/taosadapter.toml ${csudo}ln -s ${cfg_install_dir}/${adapterName}.toml ${install_main_dir}/cfg/${adapterName}.toml
[ ! -z $1 ] && return 0 || : # only install client [ ! -z $1 ] && return 0 || : # only install client
...@@ -687,8 +684,8 @@ function install_service_on_systemd() { ...@@ -687,8 +684,8 @@ function install_service_on_systemd() {
function install_taosadapter_service() { function install_taosadapter_service() {
if ((${service_mod} == 0)); then if ((${service_mod} == 0)); then
[ -f ${script_dir}/cfg/taosadapter.service ] && [ -f ${script_dir}/cfg/${adapterName}.service ] &&
${csudo}cp ${script_dir}/cfg/taosadapter.service \ ${csudo}cp ${script_dir}/cfg/${adapterName}.service \
${service_config_dir}/ || : ${service_config_dir}/ || :
${csudo}systemctl daemon-reload ${csudo}systemctl daemon-reload
fi fi
...@@ -831,13 +828,13 @@ function update_TDengine() { ...@@ -831,13 +828,13 @@ function update_TDengine() {
echo echo
echo -e "${GREEN_DARK}To configure ${productName} ${NC}: edit ${cfg_install_dir}/${configFile}" echo -e "${GREEN_DARK}To configure ${productName} ${NC}: edit ${cfg_install_dir}/${configFile}"
echo -e "${GREEN_DARK}To configure Taos Adapter (if has) ${NC}: edit ${cfg_install_dir}/taosadapter.toml" echo -e "${GREEN_DARK}To configure Taos Adapter (if has) ${NC}: edit ${cfg_install_dir}/${adapterName}.toml"
if ((${service_mod} == 0)); then if ((${service_mod} == 0)); then
echo -e "${GREEN_DARK}To start ${productName} ${NC}: ${csudo}systemctl start ${serverName}${NC}" echo -e "${GREEN_DARK}To start ${productName} ${NC}: ${csudo}systemctl start ${serverName}${NC}"
elif ((${service_mod} == 1)); then elif ((${service_mod} == 1)); then
echo -e "${GREEN_DARK}To start ${productName} ${NC}: ${csudo}service ${serverName} start${NC}" echo -e "${GREEN_DARK}To start ${productName} ${NC}: ${csudo}service ${serverName} start${NC}"
else else
echo -e "${GREEN_DARK}To start Taos Adapter (if has)${NC}: taosadapter &${NC}" echo -e "${GREEN_DARK}To start Taos Adapter (if has)${NC}: ${adapterName} &${NC}"
echo -e "${GREEN_DARK}To start ${productName} ${NC}: ./${serverName}${NC}" echo -e "${GREEN_DARK}To start ${productName} ${NC}: ./${serverName}${NC}"
fi fi
...@@ -917,13 +914,13 @@ function install_TDengine() { ...@@ -917,13 +914,13 @@ function install_TDengine() {
# Ask if to start the service # Ask if to start the service
echo echo
echo -e "${GREEN_DARK}To configure ${productName} ${NC}: edit ${cfg_install_dir}/${configFile}" echo -e "${GREEN_DARK}To configure ${productName} ${NC}: edit ${cfg_install_dir}/${configFile}"
echo -e "${GREEN_DARK}To configure taosadapter (if has) ${NC}: edit ${cfg_install_dir}/taosadapter.toml" echo -e "${GREEN_DARK}To configure ${adapterName} (if has) ${NC}: edit ${cfg_install_dir}/${adapterName}.toml"
if ((${service_mod} == 0)); then if ((${service_mod} == 0)); then
echo -e "${GREEN_DARK}To start ${productName} ${NC}: ${csudo}systemctl start ${serverName}${NC}" echo -e "${GREEN_DARK}To start ${productName} ${NC}: ${csudo}systemctl start ${serverName}${NC}"
elif ((${service_mod} == 1)); then elif ((${service_mod} == 1)); then
echo -e "${GREEN_DARK}To start ${productName} ${NC}: ${csudo}service ${serverName} start${NC}" echo -e "${GREEN_DARK}To start ${productName} ${NC}: ${csudo}service ${serverName} start${NC}"
else else
echo -e "${GREEN_DARK}To start Taos Adapter (if has)${NC}: taosadapter &${NC}" echo -e "${GREEN_DARK}To start Taos Adapter (if has)${NC}: ${adapterName} &${NC}"
echo -e "${GREEN_DARK}To start ${productName} ${NC}: ${serverName}${NC}" echo -e "${GREEN_DARK}To start ${productName} ${NC}: ${serverName}${NC}"
fi fi
......
...@@ -92,9 +92,6 @@ function install_main_path() { ...@@ -92,9 +92,6 @@ function install_main_path() {
function install_bin() { function install_bin() {
# Remove links # Remove links
${csudo}rm -f ${bin_link_dir}/${clientName} || : ${csudo}rm -f ${bin_link_dir}/${clientName} || :
if [ "$osType" != "Darwin" ]; then
${csudo}rm -f ${bin_link_dir}/taosdemo || :
fi
${csudo}rm -f ${bin_link_dir}/${uninstallScript} || : ${csudo}rm -f ${bin_link_dir}/${uninstallScript} || :
${csudo}rm -f ${bin_link_dir}/set_core || : ${csudo}rm -f ${bin_link_dir}/set_core || :
...@@ -102,9 +99,6 @@ function install_bin() { ...@@ -102,9 +99,6 @@ function install_bin() {
#Make link #Make link
[ -x ${install_main_dir}/bin/${clientName} ] && ${csudo}ln -s ${install_main_dir}/bin/${clientName} ${bin_link_dir}/${clientName} || : [ -x ${install_main_dir}/bin/${clientName} ] && ${csudo}ln -s ${install_main_dir}/bin/${clientName} ${bin_link_dir}/${clientName} || :
if [ "$osType" != "Darwin" ]; then
[ -x ${install_main_dir}/bin/taosdemo ] && ${csudo}ln -s ${install_main_dir}/bin/taosdemo ${bin_link_dir}/taosdemo || :
fi
[ -x ${install_main_dir}/bin/remove_client.sh ] && ${csudo}ln -s ${install_main_dir}/bin/remove_client.sh ${bin_link_dir}/${uninstallScript} || : [ -x ${install_main_dir}/bin/remove_client.sh ] && ${csudo}ln -s ${install_main_dir}/bin/remove_client.sh ${bin_link_dir}/${uninstallScript} || :
[ -x ${install_main_dir}/bin/set_core.sh ] && ${csudo}ln -s ${install_main_dir}/bin/set_core.sh ${bin_link_dir}/set_core || : [ -x ${install_main_dir}/bin/set_core.sh ] && ${csudo}ln -s ${install_main_dir}/bin/set_core.sh ${bin_link_dir}/set_core || :
} }
......
...@@ -169,8 +169,6 @@ function install_bin() { ...@@ -169,8 +169,6 @@ function install_bin() {
${csudo}rm -f ${bin_link_dir}/${clientName} || : ${csudo}rm -f ${bin_link_dir}/${clientName} || :
${csudo}rm -f ${bin_link_dir}/${serverName} || : ${csudo}rm -f ${bin_link_dir}/${serverName} || :
${csudo}rm -f ${bin_link_dir}/taosadapter || : ${csudo}rm -f ${bin_link_dir}/taosadapter || :
${csudo}rm -f ${bin_link_dir}/taosdemo || :
${csudo}rm -f ${bin_link_dir}/taosdump || :
if [ "$osType" != "Darwin" ]; then if [ "$osType" != "Darwin" ]; then
${csudo}rm -f ${bin_link_dir}/perfMonitor || : ${csudo}rm -f ${bin_link_dir}/perfMonitor || :
...@@ -180,9 +178,6 @@ function install_bin() { ...@@ -180,9 +178,6 @@ function install_bin() {
${csudo}rm -f ${bin_link_dir}/${uninstallScript} || : ${csudo}rm -f ${bin_link_dir}/${uninstallScript} || :
${csudo}cp -r ${binary_dir}/build/bin/taos ${install_main_dir}/bin || : ${csudo}cp -r ${binary_dir}/build/bin/taos ${install_main_dir}/bin || :
[ -f ${binary_dir}/build/bin/taosBenchmark ] && ${csudo}cp -r ${binary_dir}/build/bin/taosBenchmark ${install_main_dir}/bin || :
[ -f ${install_main_dir}/bin/taosBenchmark ] && ${csudo}ln -sf ${install_main_dir}/bin/taosBenchmark ${install_main_dir}/bin/taosdemo || :
[ -f ${binary_dir}/build/bin/taosdump ] && ${csudo}cp -r ${binary_dir}/build/bin/taosdump ${install_main_dir}/bin || :
[ -f ${binary_dir}/build/bin/taosadapter ] && ${csudo}cp -r ${binary_dir}/build/bin/taosadapter ${install_main_dir}/bin || : [ -f ${binary_dir}/build/bin/taosadapter ] && ${csudo}cp -r ${binary_dir}/build/bin/taosadapter ${install_main_dir}/bin || :
${csudo}cp -r ${binary_dir}/build/bin/taosd ${install_main_dir}/bin || : ${csudo}cp -r ${binary_dir}/build/bin/taosd ${install_main_dir}/bin || :
${csudo}cp -r ${binary_dir}/build/bin/tarbitrator ${install_main_dir}/bin || : ${csudo}cp -r ${binary_dir}/build/bin/tarbitrator ${install_main_dir}/bin || :
...@@ -198,8 +193,6 @@ function install_bin() { ...@@ -198,8 +193,6 @@ function install_bin() {
[ -x ${install_main_dir}/bin/${clientName} ] && ${csudo}ln -s ${install_main_dir}/bin/${clientName} ${bin_link_dir}/${clientName} || : [ -x ${install_main_dir}/bin/${clientName} ] && ${csudo}ln -s ${install_main_dir}/bin/${clientName} ${bin_link_dir}/${clientName} || :
[ -x ${install_main_dir}/bin/${serverName} ] && ${csudo}ln -s ${install_main_dir}/bin/${serverName} ${bin_link_dir}/${serverName} || : [ -x ${install_main_dir}/bin/${serverName} ] && ${csudo}ln -s ${install_main_dir}/bin/${serverName} ${bin_link_dir}/${serverName} || :
[ -x ${install_main_dir}/bin/taosadapter ] && ${csudo}ln -s ${install_main_dir}/bin/taosadapter ${bin_link_dir}/taosadapter || : [ -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/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 || :
[ -x ${install_main_dir}/set_core.sh ] && ${csudo}ln -s ${install_main_dir}/bin/set_core.sh ${bin_link_dir}/set_core || : [ -x ${install_main_dir}/set_core.sh ] && ${csudo}ln -s ${install_main_dir}/bin/set_core.sh ${bin_link_dir}/set_core || :
[ -x ${install_main_dir}/run_taosd_and_taosadapter.sh ] && ${csudo}ln -s ${install_main_dir}/bin/run_taosd_and_taosadapter.sh ${bin_link_dir}/run_taosd_and_taosadapter.sh || : [ -x ${install_main_dir}/run_taosd_and_taosadapter.sh ] && ${csudo}ln -s ${install_main_dir}/bin/run_taosd_and_taosadapter.sh ${bin_link_dir}/run_taosd_and_taosadapter.sh || :
...@@ -214,8 +207,6 @@ function install_bin() { ...@@ -214,8 +207,6 @@ function install_bin() {
[ -x ${install_main_dir}/bin/${clientName} ] || [ -x ${install_main_2_dir}/bin/${clientName} ] && ${csudo}ln -s ${install_main_dir}/bin/${clientName} ${bin_link_dir}/${clientName} || ${csudo}ln -s ${install_main_2_dir}/bin/${clientName} || : [ -x ${install_main_dir}/bin/${clientName} ] || [ -x ${install_main_2_dir}/bin/${clientName} ] && ${csudo}ln -s ${install_main_dir}/bin/${clientName} ${bin_link_dir}/${clientName} || ${csudo}ln -s ${install_main_2_dir}/bin/${clientName} || :
[ -x ${install_main_dir}/bin/${serverName} ] || [ -x ${install_main_2_dir}/bin/${serverName} ] && ${csudo}ln -s ${install_main_dir}/bin/${serverName} ${bin_link_dir}/${serverName} || ${csudo}ln -s ${install_main_2_dir}/bin/${serverName} || : [ -x ${install_main_dir}/bin/${serverName} ] || [ -x ${install_main_2_dir}/bin/${serverName} ] && ${csudo}ln -s ${install_main_dir}/bin/${serverName} ${bin_link_dir}/${serverName} || ${csudo}ln -s ${install_main_2_dir}/bin/${serverName} || :
[ -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/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/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
} }
...@@ -509,8 +500,8 @@ function install_service_on_systemd() { ...@@ -509,8 +500,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=${productName} server service' >> ${taosd_service_config}" ${csudo}bash -c "echo 'Description=${productName} server service' >> ${taosd_service_config}"
${csudo}bash -c "echo 'After=network-online.target taosadapter.service' >> ${taosd_service_config}" ${csudo}bash -c "echo 'After=network-online.target' >> ${taosd_service_config}"
${csudo}bash -c "echo 'Wants=network-online.target taosadapter.service' >> ${taosd_service_config}" ${csudo}bash -c "echo 'Wants=network-online.target' >> ${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}"
......
...@@ -25,6 +25,11 @@ serverName="taosd" ...@@ -25,6 +25,11 @@ serverName="taosd"
clientName="taos" clientName="taos"
configFile="taos.cfg" configFile="taos.cfg"
tarName="taos.tar.gz" tarName="taos.tar.gz"
dumpName="taosdump"
benchmarkName="taosBenchmark"
toolsName="taostools"
adapterName="taosadapter"
defaultPasswd="taosdata"
# create compressed install file. # create compressed install file.
build_dir="${compile_dir}/build" build_dir="${compile_dir}/build"
...@@ -68,8 +73,8 @@ else ...@@ -68,8 +73,8 @@ else
${script_dir}/startPre.sh \ ${script_dir}/startPre.sh \
${script_dir}/taosd-dump-cfg.gdb" ${script_dir}/taosd-dump-cfg.gdb"
taostools_bin_files=" ${build_dir}/bin/taosdump \ taostools_bin_files=" ${build_dir}/bin/${dumpName} \
${build_dir}/bin/taosBenchmark" ${build_dir}/bin/${benchmarkName}"
fi fi
lib_files="${build_dir}/lib/libtaos.so.${version}" lib_files="${build_dir}/lib/libtaos.so.${version}"
...@@ -101,6 +106,8 @@ if [ -f "${compile_dir}/test/cfg/taosadapter.service" ]; then ...@@ -101,6 +106,8 @@ if [ -f "${compile_dir}/test/cfg/taosadapter.service" ]; then
cp ${compile_dir}/test/cfg/taosadapter.service ${install_dir}/cfg || : cp ${compile_dir}/test/cfg/taosadapter.service ${install_dir}/cfg || :
fi fi
if [ -f "${cfg_dir}/${serverName}.service" ]; then if [ -f "${cfg_dir}/${serverName}.service" ]; then
cp ${cfg_dir}/${serverName}.service ${install_dir}/cfg || : cp ${cfg_dir}/${serverName}.service ${install_dir}/cfg || :
fi fi
...@@ -119,28 +126,42 @@ mkdir -p ${install_dir}/init.d && cp ${init_file_rpm} ${install_dir}/init.d/${se ...@@ -119,28 +126,42 @@ mkdir -p ${install_dir}/init.d && cp ${init_file_rpm} ${install_dir}/init.d/${se
mkdir -p ${install_dir}/init.d && cp ${init_file_tarbitrator_deb} ${install_dir}/init.d/tarbitratord.deb || : mkdir -p ${install_dir}/init.d && cp ${init_file_tarbitrator_deb} ${install_dir}/init.d/tarbitratord.deb || :
mkdir -p ${install_dir}/init.d && cp ${init_file_tarbitrator_rpm} ${install_dir}/init.d/tarbitratord.rpm || : mkdir -p ${install_dir}/init.d && cp ${init_file_tarbitrator_rpm} ${install_dir}/init.d/tarbitratord.rpm || :
if [ $adapterName != "taosadapter" ]; then
mv ${install_dir}/cfg/taosadapter.toml ${install_dir}/cfg/$adapterName.toml
sed -i "s/path = \"\/var\/log\/taos\"/path = \"\/var\/log\/${productName}\"/g" ${install_dir}/cfg/$adapterName.toml
sed -i "s/password = \"taosdata\"/password = \"${defaultPasswd}\"/g" ${install_dir}/cfg/$adapterName.toml
mv ${install_dir}/cfg/taosadapter.service ${install_dir}/cfg/$adapterName.service
sed -i "s/TDengine/${productName}/g" ${install_dir}/cfg/$adapterName.service
sed -i "s/taosAdapter/${adapterName}/g" ${install_dir}/cfg/$adapterName.service
sed -i "s/taosadapter/${adapterName}/g" ${install_dir}/cfg/$adapterName.service
mv ${install_dir}/bin/taosadapter ${install_dir}/bin/${adapterName}
mv ${install_dir}/bin/run_taosd_and_taosadapter.sh ${install_dir}/bin/run_taosd_and_${adapterName}.sh
fi
if [ -n "${taostools_bin_files}" ]; then if [ -n "${taostools_bin_files}" ]; then
mkdir -p ${taostools_install_dir} || echo -e "failed to create ${taostools_install_dir}" mkdir -p ${taostools_install_dir} || echo -e "failed to create ${taostools_install_dir}"
mkdir -p ${taostools_install_dir}/bin && mkdir -p ${taostools_install_dir}/bin &&
cp ${taostools_bin_files} ${taostools_install_dir}/bin && cp ${taostools_bin_files} ${taostools_install_dir}/bin &&
chmod a+x ${taostools_install_dir}/bin/* || : chmod a+x ${taostools_install_dir}/bin/* || :
if [ -f ${top_dir}/src/kit/taos-tools/packaging/tools/install-taostools.sh ]; then if [ -f ${top_dir}/src/kit/taos-tools/packaging/tools/install-${toolsName}.sh ]; then
cp ${top_dir}/src/kit/taos-tools/packaging/tools/install-taostools.sh \ cp ${top_dir}/src/kit/taos-tools/packaging/tools/install-${toolsName}.sh \
${taostools_install_dir}/ >/dev/null && ${taostools_install_dir}/ >/dev/null &&
chmod a+x ${taostools_install_dir}/install-taostools.sh || chmod a+x ${taostools_install_dir}/install-${toolsName}.sh ||
echo -e "failed to copy install-taostools.sh" echo -e "failed to copy install-${toolsName}.sh"
else else
echo -e "install-taostools.sh not found" echo -e "install-${toolsName}.sh not found"
fi fi
if [ -f ${top_dir}/src/kit/taos-tools/packaging/tools/uninstall-taostools.sh ]; then if [ -f ${top_dir}/src/kit/taos-tools/packaging/tools/uninstall-${toolsName}.sh ]; then
cp ${top_dir}/src/kit/taos-tools/packaging/tools/uninstall-taostools.sh \ cp ${top_dir}/src/kit/taos-tools/packaging/tools/uninstall-${toolsName}.sh \
${taostools_install_dir}/ >/dev/null && ${taostools_install_dir}/ >/dev/null &&
chmod a+x ${taostools_install_dir}/uninstall-taostools.sh || chmod a+x ${taostools_install_dir}/uninstall-${toolsName}.sh ||
echo -e "failed to copy uninstall-taostools.sh" echo -e "failed to copy uninstall-${toolsName}.sh"
else else
echo -e "uninstall-taostools.sh not found" echo -e "uninstall-${toolsName}.sh not found"
fi fi
if [ -f ${build_dir}/lib/libavro.so.23.0.0 ]; then if [ -f ${build_dir}/lib/libavro.so.23.0.0 ]; then
......
...@@ -427,8 +427,8 @@ function install_service_on_systemd() { ...@@ -427,8 +427,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 taosadapter.service' >> ${taosd_service_config}" ${csudo}bash -c "echo 'After=network-online.target' >> ${taosd_service_config}"
${csudo}bash -c "echo 'Wants=network-online.target taosadapter.service' >> ${taosd_service_config}" ${csudo}bash -c "echo 'Wants=network-online.target' >> ${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}"
......
...@@ -16,6 +16,7 @@ serverName="taosd" ...@@ -16,6 +16,7 @@ serverName="taosd"
clientName="taos" clientName="taos"
uninstallScript="rmtaos" uninstallScript="rmtaos"
productName="TDengine" productName="TDengine"
adapterName="taosadapter"
#install main path #install main path
install_main_dir=${installDir} install_main_dir=${installDir}
...@@ -30,7 +31,7 @@ install_nginxd_dir="/usr/local/nginxd" ...@@ -30,7 +31,7 @@ install_nginxd_dir="/usr/local/nginxd"
service_config_dir="/etc/systemd/system" service_config_dir="/etc/systemd/system"
taos_service_name=${serverName} taos_service_name=${serverName}
taosadapter_service_name="taosadapter" taosadapter_service_name=${adapterName}
tarbitrator_service_name="tarbitratord" tarbitrator_service_name="tarbitratord"
nginx_service_name="nginxd" nginx_service_name="nginxd"
csudo="" csudo=""
...@@ -59,7 +60,7 @@ else ...@@ -59,7 +60,7 @@ else
fi fi
function kill_taosadapter() { function kill_taosadapter() {
pid=$(ps -ef | grep "taosadapter" | grep -v "grep" | awk '{print $2}') pid=$(ps -ef | grep ${adapterName} | grep -v "grep" | awk '{print $2}')
if [ -n "$pid" ]; then if [ -n "$pid" ]; then
${csudo}kill -9 $pid || : ${csudo}kill -9 $pid || :
fi fi
...@@ -82,13 +83,11 @@ function clean_bin() { ...@@ -82,13 +83,11 @@ function clean_bin() {
# Remove link # Remove link
${csudo}rm -f ${bin_link_dir}/${clientName} || : ${csudo}rm -f ${bin_link_dir}/${clientName} || :
${csudo}rm -f ${bin_link_dir}/${serverName} || : ${csudo}rm -f ${bin_link_dir}/${serverName} || :
${csudo}rm -f ${bin_link_dir}/taosadapter || : ${csudo}rm -f ${bin_link_dir}/${adapterName} || :
${csudo}rm -f ${bin_link_dir}/taosdemo || :
${csudo}rm -f ${bin_link_dir}/taosdump || :
${csudo}rm -f ${bin_link_dir}/${uninstallScript} || : ${csudo}rm -f ${bin_link_dir}/${uninstallScript} || :
${csudo}rm -f ${bin_link_dir}/tarbitrator || : ${csudo}rm -f ${bin_link_dir}/tarbitrator || :
${csudo}rm -f ${bin_link_dir}/set_core || : ${csudo}rm -f ${bin_link_dir}/set_core || :
${csudo}rm -f ${bin_link_dir}/run_taosd_and_taosadapter.sh || : ${csudo}rm -f ${bin_link_dir}/run_taosd_and_${adapterName}.sh || :
} }
function clean_lib() { function clean_lib() {
...@@ -124,9 +123,9 @@ function clean_service_on_systemd() { ...@@ -124,9 +123,9 @@ function clean_service_on_systemd() {
${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}
taosadapter_service_config="${service_config_dir}/taosadapter.service" taosadapter_service_config="${service_config_dir}/${adapterName}.service"
if systemctl is-active --quiet ${taosadapter_service_name}; then if systemctl is-active --quiet ${taosadapter_service_name}; then
echo "${productName} taosAdapter is running, stopping it..." echo "${productName} ${adapterName} is running, stopping it..."
${csudo}systemctl stop ${taosadapter_service_name} &>/dev/null || echo &>/dev/null ${csudo}systemctl stop ${taosadapter_service_name} &>/dev/null || echo &>/dev/null
fi fi
${csudo}systemctl disable ${taosadapter_service_name} &>/dev/null || echo &>/dev/null ${csudo}systemctl disable ${taosadapter_service_name} &>/dev/null || echo &>/dev/null
......
...@@ -36,8 +36,6 @@ function kill_client() { ...@@ -36,8 +36,6 @@ function kill_client() {
function clean_bin() { function clean_bin() {
# Remove link # Remove link
${csudo}rm -f ${bin_link_dir}/${clientName} || : ${csudo}rm -f ${bin_link_dir}/${clientName} || :
${csudo}rm -f ${bin_link_dir}/taosdemo || :
${csudo}rm -f ${bin_link_dir}/taosdump || :
${csudo}rm -f ${bin_link_dir}/${uninstallScript} || : ${csudo}rm -f ${bin_link_dir}/${uninstallScript} || :
${csudo}rm -f ${bin_link_dir}/set_core || : ${csudo}rm -f ${bin_link_dir}/set_core || :
} }
......
name: tdengine name: tdengine
base: core20 base: core20
version: '2.4.0.4' version: '2.4.0.5'
icon: snap/gui/t-dengine.svg icon: snap/gui/t-dengine.svg
summary: an open-source big data platform designed and optimized for IoT. summary: an open-source big data platform designed and optimized for IoT.
description: | description: |
...@@ -25,11 +25,6 @@ apps: ...@@ -25,11 +25,6 @@ apps:
- network - network
- system-observe - system-observe
taosdemo:
command: usr/bin/taosdemo
plugs:
- network
parts: parts:
script: script:
plugin: dump plugin: dump
...@@ -74,8 +69,7 @@ parts: ...@@ -74,8 +69,7 @@ parts:
- etc/taos/taos.cfg - etc/taos/taos.cfg
- usr/bin/taosd - usr/bin/taosd
- usr/bin/taos - usr/bin/taos
- usr/bin/taosdemo - usr/lib/libtaos.so.2.4.0.5
- usr/lib/libtaos.so.2.3.0.0
- usr/lib/libtaos.so.1 - usr/lib/libtaos.so.1
- usr/lib/libtaos.so - usr/lib/libtaos.so
......
...@@ -1584,9 +1584,6 @@ int tsInsertInitialCheck(SSqlObj *pSql) { ...@@ -1584,9 +1584,6 @@ int tsInsertInitialCheck(SSqlObj *pSql) {
int32_t index = 0; int32_t index = 0;
SSqlCmd *pCmd = &pSql->cmd; SSqlCmd *pCmd = &pSql->cmd;
SStrToken sToken = tStrGetToken(pSql->sqlstr, &index, false);
assert(sToken.type == TK_INSERT || sToken.type == TK_IMPORT);
pCmd->count = 0; pCmd->count = 0;
pCmd->command = TSDB_SQL_INSERT; pCmd->command = TSDB_SQL_INSERT;
SInsertStatementParam* pInsertParam = &pCmd->insertParam; SInsertStatementParam* pInsertParam = &pCmd->insertParam;
...@@ -1594,6 +1591,11 @@ int tsInsertInitialCheck(SSqlObj *pSql) { ...@@ -1594,6 +1591,11 @@ int tsInsertInitialCheck(SSqlObj *pSql) {
SQueryInfo *pQueryInfo = tscGetQueryInfoS(pCmd); SQueryInfo *pQueryInfo = tscGetQueryInfoS(pCmd);
TSDB_QUERY_SET_TYPE(pQueryInfo->type, TSDB_QUERY_TYPE_INSERT); TSDB_QUERY_SET_TYPE(pQueryInfo->type, TSDB_QUERY_TYPE_INSERT);
SStrToken sToken = tStrGetToken(pSql->sqlstr, &index, false);
if (sToken.type != TK_INSERT && sToken.type != TK_IMPORT) {
return tscSQLSyntaxErrMsg(pInsertParam->msg, NULL, sToken.z);
}
sToken = tStrGetToken(pSql->sqlstr, &index, false); sToken = tStrGetToken(pSql->sqlstr, &index, false);
if (sToken.type != TK_INTO) { if (sToken.type != TK_INTO) {
return tscSQLSyntaxErrMsg(pInsertParam->msg, "keyword INTO is expected", sToken.z); return tscSQLSyntaxErrMsg(pInsertParam->msg, "keyword INTO is expected", sToken.z);
......
...@@ -280,7 +280,7 @@ int tscBuildQueryStreamDesc(void *pMsg, STscObj *pObj) { ...@@ -280,7 +280,7 @@ int tscBuildQueryStreamDesc(void *pMsg, STscObj *pObj) {
// } else { // } else {
// pQdesc->stableQuery = 0; // pQdesc->stableQuery = 0;
// } // }
pthread_mutex_lock(&pSql->subState.mutex);
if (pSql->pSubs != NULL && pSql->subState.states != NULL) { if (pSql->pSubs != NULL && pSql->subState.states != NULL) {
for (int32_t i = 0; i < pQdesc->numOfSub; ++i) { for (int32_t i = 0; i < pQdesc->numOfSub; ++i) {
SSqlObj *psub = pSql->pSubs[i]; SSqlObj *psub = pSql->pSubs[i];
...@@ -295,6 +295,7 @@ int tscBuildQueryStreamDesc(void *pMsg, STscObj *pObj) { ...@@ -295,6 +295,7 @@ int tscBuildQueryStreamDesc(void *pMsg, STscObj *pObj) {
p += len; p += len;
} }
} }
pthread_mutex_unlock(&pSql->subState.mutex);
} }
pQdesc->numOfSub = htonl(pQdesc->numOfSub); pQdesc->numOfSub = htonl(pQdesc->numOfSub);
......
...@@ -3439,10 +3439,7 @@ static int16_t doGetColumnIndex(SQueryInfo* pQueryInfo, int32_t index, SStrToken ...@@ -3439,10 +3439,7 @@ static int16_t doGetColumnIndex(SQueryInfo* pQueryInfo, int32_t index, SStrToken
strncpy(tmpTokenBuf, pToken->z, pToken->n); strncpy(tmpTokenBuf, pToken->z, pToken->n);
pToken->z = tmpTokenBuf; pToken->z = tmpTokenBuf;
if (pToken->type == TK_ID) {
pToken->n = stringProcess(pToken->z, pToken->n); pToken->n = stringProcess(pToken->z, pToken->n);
}
for (int16_t i = 0; i < numOfCols; ++i) { for (int16_t i = 0; i < numOfCols; ++i) {
if (pToken->n != strlen(pSchema[i].name)) { if (pToken->n != strlen(pSchema[i].name)) {
...@@ -6835,7 +6832,7 @@ int32_t setAlterTableInfo(SSqlObj* pSql, struct SSqlInfo* pInfo) { ...@@ -6835,7 +6832,7 @@ int32_t setAlterTableInfo(SSqlObj* pSql, struct SSqlInfo* pInfo) {
} }
SColumnIndex index = COLUMN_INDEX_INITIALIZER; SColumnIndex index = COLUMN_INDEX_INITIALIZER;
SStrToken name = {.z = pItem->pVar.pz, .n = pItem->pVar.nLen, .type = TK_STRING}; SStrToken name = {.z = pItem->pVar.pz, .n = pItem->pVar.nLen};
if (getColumnIndexByName(&name, pQueryInfo, &index, tscGetErrorMsgPayload(pCmd)) != TSDB_CODE_SUCCESS) { if (getColumnIndexByName(&name, pQueryInfo, &index, tscGetErrorMsgPayload(pCmd)) != TSDB_CODE_SUCCESS) {
return TSDB_CODE_TSC_INVALID_OPERATION; return TSDB_CODE_TSC_INVALID_OPERATION;
...@@ -6850,7 +6847,7 @@ int32_t setAlterTableInfo(SSqlObj* pSql, struct SSqlInfo* pInfo) { ...@@ -6850,7 +6847,7 @@ int32_t setAlterTableInfo(SSqlObj* pSql, struct SSqlInfo* pInfo) {
char name1[128] = {0}; char name1[128] = {0};
strncpy(name1, pItem->pVar.pz, pItem->pVar.nLen); strncpy(name1, pItem->pVar.pz, pItem->pVar.nLen);
stringProcess(name1, (int32_t)strlen(name1));
TAOS_FIELD f = tscCreateField(TSDB_DATA_TYPE_INT, name1, tDataTypes[TSDB_DATA_TYPE_INT].bytes); TAOS_FIELD f = tscCreateField(TSDB_DATA_TYPE_INT, name1, tDataTypes[TSDB_DATA_TYPE_INT].bytes);
tscFieldInfoAppend(&pQueryInfo->fieldsInfo, &f); tscFieldInfoAppend(&pQueryInfo->fieldsInfo, &f);
} else if (pAlterSQL->type == TSDB_ALTER_TABLE_CHANGE_TAG_COLUMN) { } else if (pAlterSQL->type == TSDB_ALTER_TABLE_CHANGE_TAG_COLUMN) {
...@@ -6873,12 +6870,12 @@ int32_t setAlterTableInfo(SSqlObj* pSql, struct SSqlInfo* pInfo) { ...@@ -6873,12 +6870,12 @@ int32_t setAlterTableInfo(SSqlObj* pSql, struct SSqlInfo* pInfo) {
SColumnIndex srcIndex = COLUMN_INDEX_INITIALIZER; SColumnIndex srcIndex = COLUMN_INDEX_INITIALIZER;
SColumnIndex destIndex = COLUMN_INDEX_INITIALIZER; SColumnIndex destIndex = COLUMN_INDEX_INITIALIZER;
SStrToken srcToken = {.z = pSrcItem->pVar.pz, .n = pSrcItem->pVar.nLen, .type = TK_STRING}; SStrToken srcToken = {.z = pSrcItem->pVar.pz, .n = pSrcItem->pVar.nLen};
if (getColumnIndexByName(&srcToken, pQueryInfo, &srcIndex, tscGetErrorMsgPayload(pCmd)) != TSDB_CODE_SUCCESS) { if (getColumnIndexByName(&srcToken, pQueryInfo, &srcIndex, tscGetErrorMsgPayload(pCmd)) != TSDB_CODE_SUCCESS) {
return invalidOperationMsg(pMsg, msg17); return invalidOperationMsg(pMsg, msg17);
} }
SStrToken destToken = {.z = pDstItem->pVar.pz, .n = pDstItem->pVar.nLen, .type = TK_STRING}; SStrToken destToken = {.z = pDstItem->pVar.pz, .n = pDstItem->pVar.nLen};
if (getColumnIndexByName(&destToken, pQueryInfo, &destIndex, tscGetErrorMsgPayload(pCmd)) == TSDB_CODE_SUCCESS) { if (getColumnIndexByName(&destToken, pQueryInfo, &destIndex, tscGetErrorMsgPayload(pCmd)) == TSDB_CODE_SUCCESS) {
return invalidOperationMsg(pMsg, msg19); return invalidOperationMsg(pMsg, msg19);
} }
...@@ -6887,6 +6884,7 @@ int32_t setAlterTableInfo(SSqlObj* pSql, struct SSqlInfo* pInfo) { ...@@ -6887,6 +6884,7 @@ int32_t setAlterTableInfo(SSqlObj* pSql, struct SSqlInfo* pInfo) {
char name[TSDB_COL_NAME_LEN] = {0}; char name[TSDB_COL_NAME_LEN] = {0};
strncpy(name, pItem->pVar.pz, pItem->pVar.nLen); strncpy(name, pItem->pVar.pz, pItem->pVar.nLen);
stringProcess(name, (int32_t)strlen(name));
TAOS_FIELD f = tscCreateField(TSDB_DATA_TYPE_INT, name, tDataTypes[TSDB_DATA_TYPE_INT].bytes); TAOS_FIELD f = tscCreateField(TSDB_DATA_TYPE_INT, name, tDataTypes[TSDB_DATA_TYPE_INT].bytes);
tscFieldInfoAppend(&pQueryInfo->fieldsInfo, &f); tscFieldInfoAppend(&pQueryInfo->fieldsInfo, &f);
...@@ -6894,6 +6892,7 @@ int32_t setAlterTableInfo(SSqlObj* pSql, struct SSqlInfo* pInfo) { ...@@ -6894,6 +6892,7 @@ int32_t setAlterTableInfo(SSqlObj* pSql, struct SSqlInfo* pInfo) {
memset(name, 0, tListLen(name)); memset(name, 0, tListLen(name));
strncpy(name, pItem->pVar.pz, pItem->pVar.nLen); strncpy(name, pItem->pVar.pz, pItem->pVar.nLen);
stringProcess(name, (int32_t)strlen(name));
f = tscCreateField(TSDB_DATA_TYPE_INT, name, tDataTypes[TSDB_DATA_TYPE_INT].bytes); f = tscCreateField(TSDB_DATA_TYPE_INT, name, tDataTypes[TSDB_DATA_TYPE_INT].bytes);
tscFieldInfoAppend(&pQueryInfo->fieldsInfo, &f); tscFieldInfoAppend(&pQueryInfo->fieldsInfo, &f);
} else if (pAlterSQL->type == TSDB_ALTER_TABLE_UPDATE_TAG_VAL) { } else if (pAlterSQL->type == TSDB_ALTER_TABLE_UPDATE_TAG_VAL) {
...@@ -6906,7 +6905,7 @@ int32_t setAlterTableInfo(SSqlObj* pSql, struct SSqlInfo* pInfo) { ...@@ -6906,7 +6905,7 @@ int32_t setAlterTableInfo(SSqlObj* pSql, struct SSqlInfo* pInfo) {
int16_t numOfTags = tscGetNumOfTags(pTableMeta); int16_t numOfTags = tscGetNumOfTags(pTableMeta);
SColumnIndex columnIndex = COLUMN_INDEX_INITIALIZER; SColumnIndex columnIndex = COLUMN_INDEX_INITIALIZER;
SStrToken name = {.type = TK_STRING, .z = item->pVar.pz, .n = item->pVar.nLen}; SStrToken name = {.z = item->pVar.pz, .n = item->pVar.nLen};
if (getColumnIndexByName(&name, pQueryInfo, &columnIndex, tscGetErrorMsgPayload(pCmd)) != TSDB_CODE_SUCCESS) { if (getColumnIndexByName(&name, pQueryInfo, &columnIndex, tscGetErrorMsgPayload(pCmd)) != TSDB_CODE_SUCCESS) {
return TSDB_CODE_TSC_INVALID_OPERATION; return TSDB_CODE_TSC_INVALID_OPERATION;
} }
...@@ -7039,14 +7038,7 @@ int32_t setAlterTableInfo(SSqlObj* pSql, struct SSqlInfo* pInfo) { ...@@ -7039,14 +7038,7 @@ int32_t setAlterTableInfo(SSqlObj* pSql, struct SSqlInfo* pInfo) {
tVariantListItem* pItem = taosArrayGet(pAlterSQL->varList, 0); tVariantListItem* pItem = taosArrayGet(pAlterSQL->varList, 0);
SColumnIndex columnIndex = COLUMN_INDEX_INITIALIZER; SColumnIndex columnIndex = COLUMN_INDEX_INITIALIZER;
SStrToken name = {.type = TK_STRING, .z = pItem->pVar.pz, .n = pItem->pVar.nLen}; SStrToken name = {.z = pItem->pVar.pz, .n = pItem->pVar.nLen};
//handle Escape character backstick
bool inEscape = false;
if (name.z[0] == TS_BACKQUOTE_CHAR && name.z[name.n - 1] == TS_BACKQUOTE_CHAR) {
inEscape = true;
name.type = TK_ID;
}
if (getColumnIndexByName(&name, pQueryInfo, &columnIndex, tscGetErrorMsgPayload(pCmd)) != TSDB_CODE_SUCCESS) { if (getColumnIndexByName(&name, pQueryInfo, &columnIndex, tscGetErrorMsgPayload(pCmd)) != TSDB_CODE_SUCCESS) {
return invalidOperationMsg(pMsg, msg17); return invalidOperationMsg(pMsg, msg17);
...@@ -7058,13 +7050,7 @@ int32_t setAlterTableInfo(SSqlObj* pSql, struct SSqlInfo* pInfo) { ...@@ -7058,13 +7050,7 @@ int32_t setAlterTableInfo(SSqlObj* pSql, struct SSqlInfo* pInfo) {
char name1[TSDB_COL_NAME_LEN] = {0}; char name1[TSDB_COL_NAME_LEN] = {0};
tstrncpy(name1, pItem->pVar.pz, sizeof(name1)); tstrncpy(name1, pItem->pVar.pz, sizeof(name1));
stringProcess(name1, (int32_t)strlen(name1));
int32_t nameLen = pItem->pVar.nLen;
if (inEscape) {
memmove(name1, name1 + 1, nameLen);
name1[nameLen - TS_BACKQUOTE_CHAR_SIZE] = '\0';
}
TAOS_FIELD f = tscCreateField(TSDB_DATA_TYPE_INT, name1, tDataTypes[TSDB_DATA_TYPE_INT].bytes); TAOS_FIELD f = tscCreateField(TSDB_DATA_TYPE_INT, name1, tDataTypes[TSDB_DATA_TYPE_INT].bytes);
tscFieldInfoAppend(&pQueryInfo->fieldsInfo, &f); tscFieldInfoAppend(&pQueryInfo->fieldsInfo, &f);
} else if (pAlterSQL->type == TSDB_ALTER_TABLE_CHANGE_COLUMN) { } else if (pAlterSQL->type == TSDB_ALTER_TABLE_CHANGE_COLUMN) {
...@@ -7072,21 +7058,13 @@ int32_t setAlterTableInfo(SSqlObj* pSql, struct SSqlInfo* pInfo) { ...@@ -7072,21 +7058,13 @@ int32_t setAlterTableInfo(SSqlObj* pSql, struct SSqlInfo* pInfo) {
return invalidOperationMsg(pMsg, msg16); return invalidOperationMsg(pMsg, msg16);
} }
TAOS_FIELD* pItem = taosArrayGet(pAlterSQL->pAddColumns, 0); TAOS_FIELD* pItem = taosArrayGet(pAlterSQL->pAddColumns, 0);
if (pItem->type != TSDB_DATA_TYPE_BINARY && pItem->type != TSDB_DATA_TYPE_NCHAR) { if (pItem->type != TSDB_DATA_TYPE_BINARY && pItem->type != TSDB_DATA_TYPE_NCHAR) {
return invalidOperationMsg(pMsg, msg21); return invalidOperationMsg(pMsg, msg21);
} }
SColumnIndex columnIndex = COLUMN_INDEX_INITIALIZER; SColumnIndex columnIndex = COLUMN_INDEX_INITIALIZER;
SStrToken name = {.type = TK_STRING, .z = pItem->name, .n = (uint32_t)strlen(pItem->name)}; SStrToken name = {.z = pItem->name, .n = (uint32_t)strlen(pItem->name)};
//handle Escape character backstick
bool inEscape = false;
if (name.z[0] == TS_BACKQUOTE_CHAR && name.z[name.n - 1] == TS_BACKQUOTE_CHAR) {
inEscape = true;
name.type = TK_ID;
}
if (getColumnIndexByName(&name, pQueryInfo, &columnIndex, tscGetErrorMsgPayload(pCmd)) != TSDB_CODE_SUCCESS) { if (getColumnIndexByName(&name, pQueryInfo, &columnIndex, tscGetErrorMsgPayload(pCmd)) != TSDB_CODE_SUCCESS) {
return invalidOperationMsg(pMsg, msg17); return invalidOperationMsg(pMsg, msg17);
...@@ -7122,12 +7100,7 @@ int32_t setAlterTableInfo(SSqlObj* pSql, struct SSqlInfo* pInfo) { ...@@ -7122,12 +7100,7 @@ int32_t setAlterTableInfo(SSqlObj* pSql, struct SSqlInfo* pInfo) {
return invalidOperationMsg(pMsg, msg24); return invalidOperationMsg(pMsg, msg24);
} }
if (inEscape) { stringProcess(name.z, name.n);
memmove(name.z, name.z + 1, name.n);
name.z[name.n - TS_BACKQUOTE_CHAR_SIZE] = '\0';
name.n -= TS_BACKQUOTE_CHAR_SIZE;
}
TAOS_FIELD f = tscCreateField(pColSchema->type, name.z, pItem->bytes); TAOS_FIELD f = tscCreateField(pColSchema->type, name.z, pItem->bytes);
tscFieldInfoAppend(&pQueryInfo->fieldsInfo, &f); tscFieldInfoAppend(&pQueryInfo->fieldsInfo, &f);
}else if (pAlterSQL->type == TSDB_ALTER_TABLE_MODIFY_TAG_COLUMN) { }else if (pAlterSQL->type == TSDB_ALTER_TABLE_MODIFY_TAG_COLUMN) {
...@@ -7141,13 +7114,7 @@ int32_t setAlterTableInfo(SSqlObj* pSql, struct SSqlInfo* pInfo) { ...@@ -7141,13 +7114,7 @@ int32_t setAlterTableInfo(SSqlObj* pSql, struct SSqlInfo* pInfo) {
} }
SColumnIndex columnIndex = COLUMN_INDEX_INITIALIZER; SColumnIndex columnIndex = COLUMN_INDEX_INITIALIZER;
SStrToken name = {.type = TK_STRING, .z = pItem->name, .n = (uint32_t)strlen(pItem->name)}; SStrToken name = {.z = pItem->name, .n = (uint32_t)strlen(pItem->name)};
//handle Escape character backstick
if (name.z[0] == TS_BACKQUOTE_CHAR && name.z[name.n - 1] == TS_BACKQUOTE_CHAR) {
memmove(name.z, name.z + 1, name.n);
name.z[name.n - TS_BACKQUOTE_CHAR_SIZE] = '\0';
name.n -= TS_BACKQUOTE_CHAR_SIZE;
}
if (getColumnIndexByName(&name, pQueryInfo, &columnIndex, tscGetErrorMsgPayload(pCmd)) != TSDB_CODE_SUCCESS) { if (getColumnIndexByName(&name, pQueryInfo, &columnIndex, tscGetErrorMsgPayload(pCmd)) != TSDB_CODE_SUCCESS) {
return invalidOperationMsg(pMsg, msg17); return invalidOperationMsg(pMsg, msg17);
} }
...@@ -7188,6 +7155,7 @@ int32_t setAlterTableInfo(SSqlObj* pSql, struct SSqlInfo* pInfo) { ...@@ -7188,6 +7155,7 @@ int32_t setAlterTableInfo(SSqlObj* pSql, struct SSqlInfo* pInfo) {
return invalidOperationMsg(pMsg, msg24); return invalidOperationMsg(pMsg, msg24);
} }
stringProcess(name.z, name.n);
TAOS_FIELD f = tscCreateField(pColSchema->type, name.z, pItem->bytes); TAOS_FIELD f = tscCreateField(pColSchema->type, name.z, pItem->bytes);
tscFieldInfoAppend(&pQueryInfo->fieldsInfo, &f); tscFieldInfoAppend(&pQueryInfo->fieldsInfo, &f);
} }
...@@ -7541,9 +7509,8 @@ int32_t validateLimitNode(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, SSqlNode* pSqlN ...@@ -7541,9 +7509,8 @@ int32_t validateLimitNode(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, SSqlNode* pSqlN
*/ */
if (pQueryInfo->limit.limit > 0) { if (pQueryInfo->limit.limit > 0) {
pQueryInfo->vgroupLimit = pQueryInfo->limit.limit + pQueryInfo->limit.offset; pQueryInfo->vgroupLimit = pQueryInfo->limit.limit + pQueryInfo->limit.offset;
//pQueryInfo->limit.limit = -1; pQueryInfo->limit.limit += pQueryInfo->limit.offset;
} }
pQueryInfo->limit.offset = 0; pQueryInfo->limit.offset = 0;
} }
} else { } else {
......
...@@ -201,9 +201,9 @@ TAOS *taos_connect_internal(const char *ip, const char *user, const char *pass, ...@@ -201,9 +201,9 @@ TAOS *taos_connect_internal(const char *ip, const char *user, const char *pass,
if (pSql->res.code != TSDB_CODE_SUCCESS) { if (pSql->res.code != TSDB_CODE_SUCCESS) {
terrno = pSql->res.code; terrno = pSql->res.code;
if (terrno ==TSDB_CODE_RPC_FQDN_ERROR) { if (terrno ==TSDB_CODE_RPC_FQDN_ERROR) {
printf("taos connect failed, reason: %s\n\n", taos_errstr(pSql)); printf("connect failed, reason: %s\n\n", taos_errstr(pSql));
} else { } else {
printf("taos connect failed, reason: %s.\n\n", tstrerror(terrno)); printf("connect failed, reason: %s.\n\n", tstrerror(terrno));
} }
taos_free_result(pSql); taos_free_result(pSql);
taos_close(pObj); taos_close(pObj);
......
...@@ -3167,6 +3167,8 @@ static void tscRetrieveFromDnodeCallBack(void *param, TAOS_RES *tres, int numOfR ...@@ -3167,6 +3167,8 @@ static void tscRetrieveFromDnodeCallBack(void *param, TAOS_RES *tres, int numOfR
static SSqlObj *tscCreateSTableSubquery(SSqlObj *pSql, SRetrieveSupport *trsupport, SSqlObj *prevSqlObj) { static SSqlObj *tscCreateSTableSubquery(SSqlObj *pSql, SRetrieveSupport *trsupport, SSqlObj *prevSqlObj) {
const int32_t table_index = 0; const int32_t table_index = 0;
SSqlCmd * pCmd = &pSql->cmd;
SQueryInfo *pPQueryInfo = tscGetQueryInfo(pCmd); // Parent SQueryInfo
SSqlObj *pNew = createSubqueryObj(pSql, table_index, tscRetrieveDataRes, trsupport, TSDB_SQL_SELECT, prevSqlObj); SSqlObj *pNew = createSubqueryObj(pSql, table_index, tscRetrieveDataRes, trsupport, TSDB_SQL_SELECT, prevSqlObj);
if (pNew != NULL) { // the sub query of two-stage super table query if (pNew != NULL) { // the sub query of two-stage super table query
...@@ -3176,8 +3178,14 @@ static SSqlObj *tscCreateSTableSubquery(SSqlObj *pSql, SRetrieveSupport *trsuppo ...@@ -3176,8 +3178,14 @@ static SSqlObj *tscCreateSTableSubquery(SSqlObj *pSql, SRetrieveSupport *trsuppo
pQueryInfo->type |= TSDB_QUERY_TYPE_STABLE_SUBQUERY; pQueryInfo->type |= TSDB_QUERY_TYPE_STABLE_SUBQUERY;
// clear the limit/offset info, since it should not be sent to vnode to be executed. // clear the limit/offset info, since it should not be sent to vnode to be executed.
// pQueryInfo->limit.limit = -1; // alexduan subquery limit is same with parent is ok if (pQueryInfo->limit.offset > 0 && pQueryInfo->limit.limit > 0) {
pQueryInfo->limit.limit += pQueryInfo->limit.offset;
}
pQueryInfo->limit.offset = 0; pQueryInfo->limit.offset = 0;
// if groupby must retrieve all subquery data
if(pPQueryInfo->groupbyColumn || pPQueryInfo->groupbyTag) {
pQueryInfo->limit.limit = -1;
}
assert(trsupport->subqueryIndex < pSql->subState.numOfSub); assert(trsupport->subqueryIndex < pSql->subState.numOfSub);
......
...@@ -4517,6 +4517,7 @@ void tscTryQueryNextClause(SSqlObj* pSql, __async_cb_func_t fp) { ...@@ -4517,6 +4517,7 @@ void tscTryQueryNextClause(SSqlObj* pSql, __async_cb_func_t fp) {
pRes->final = finalBk; pRes->final = finalBk;
pRes->numOfTotal = num; pRes->numOfTotal = num;
pthread_mutex_lock(&pSql->subState.mutex);
for(int32_t i = 0; i < pSql->subState.numOfSub; ++i) { for(int32_t i = 0; i < pSql->subState.numOfSub; ++i) {
taos_free_result(pSql->pSubs[i]); taos_free_result(pSql->pSubs[i]);
} }
...@@ -4524,6 +4525,7 @@ void tscTryQueryNextClause(SSqlObj* pSql, __async_cb_func_t fp) { ...@@ -4524,6 +4525,7 @@ void tscTryQueryNextClause(SSqlObj* pSql, __async_cb_func_t fp) {
tfree(pSql->pSubs); tfree(pSql->pSubs);
tfree(pSql->subState.states); tfree(pSql->subState.states);
pSql->subState.numOfSub = 0; pSql->subState.numOfSub = 0;
pthread_mutex_unlock(&pSql->subState.mutex);
pthread_mutex_destroy(&pSql->subState.mutex); pthread_mutex_destroy(&pSql->subState.mutex);
pSql->fp = fp; pSql->fp = fp;
...@@ -5387,7 +5389,7 @@ int parseJsontoTagData(char* json, SKVRowBuilder* kvRowBuilder, char* errMsg, in ...@@ -5387,7 +5389,7 @@ int parseJsontoTagData(char* json, SKVRowBuilder* kvRowBuilder, char* errMsg, in
varDataSetLen(nullTypeVal + CHAR_BYTES, INT_BYTES); varDataSetLen(nullTypeVal + CHAR_BYTES, INT_BYTES);
*(uint32_t*)(varDataVal(nullTypeKey)) = jsonNULL; *(uint32_t*)(varDataVal(nullTypeKey)) = jsonNULL;
tdAddColToKVRow(kvRowBuilder, jsonIndex++, TSDB_DATA_TYPE_NCHAR, nullTypeKey, false); // add json null type tdAddColToKVRow(kvRowBuilder, jsonIndex++, TSDB_DATA_TYPE_NCHAR, nullTypeKey, false); // add json null type
if (!json || strtrim(json) == 0 || strcasecmp(json, "null") == 0){ if (!json || strtrim(json) == 0 || strncasecmp(json, "null", 4) == 0){
*(uint32_t*)(varDataVal(nullTypeVal + CHAR_BYTES)) = jsonNULL; *(uint32_t*)(varDataVal(nullTypeVal + CHAR_BYTES)) = jsonNULL;
tdAddColToKVRow(kvRowBuilder, jsonIndex++, TSDB_DATA_TYPE_NCHAR, nullTypeVal, true); // add json null value tdAddColToKVRow(kvRowBuilder, jsonIndex++, TSDB_DATA_TYPE_NCHAR, nullTypeVal, true); // add json null value
return TSDB_CODE_SUCCESS; return TSDB_CODE_SUCCESS;
......
...@@ -8,7 +8,7 @@ IF (TD_MVN_INSTALLED) ...@@ -8,7 +8,7 @@ IF (TD_MVN_INSTALLED)
ADD_CUSTOM_COMMAND(OUTPUT ${JDBC_CMD_NAME} ADD_CUSTOM_COMMAND(OUTPUT ${JDBC_CMD_NAME}
POST_BUILD POST_BUILD
COMMAND mvn -Dmaven.test.skip=true install -f ${CMAKE_CURRENT_SOURCE_DIR}/pom.xml COMMAND mvn -Dmaven.test.skip=true install -f ${CMAKE_CURRENT_SOURCE_DIR}/pom.xml
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/target/taos-jdbcdriver-2.0.36-dist.jar ${LIBRARY_OUTPUT_PATH} COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/target/taos-jdbcdriver-2.0.37-dist.jar ${LIBRARY_OUTPUT_PATH}
COMMAND mvn -Dmaven.test.skip=true clean -f ${CMAKE_CURRENT_SOURCE_DIR}/pom.xml COMMAND mvn -Dmaven.test.skip=true clean -f ${CMAKE_CURRENT_SOURCE_DIR}/pom.xml
COMMENT "build jdbc driver") COMMENT "build jdbc driver")
ADD_CUSTOM_TARGET(${JDBC_TARGET_NAME} ALL WORKING_DIRECTORY ${EXECUTABLE_OUTPUT_PATH} DEPENDS ${JDBC_CMD_NAME}) ADD_CUSTOM_TARGET(${JDBC_TARGET_NAME} ALL WORKING_DIRECTORY ${EXECUTABLE_OUTPUT_PATH} DEPENDS ${JDBC_CMD_NAME})
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<groupId>com.taosdata.jdbc</groupId> <groupId>com.taosdata.jdbc</groupId>
<artifactId>taos-jdbcdriver</artifactId> <artifactId>taos-jdbcdriver</artifactId>
<version>2.0.36</version> <version>2.0.37</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<name>JDBCDriver</name> <name>JDBCDriver</name>
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>com.taosdata.jdbc</groupId> <groupId>com.taosdata.jdbc</groupId>
<artifactId>taos-jdbcdriver</artifactId> <artifactId>taos-jdbcdriver</artifactId>
<version>2.0.36</version> <version>2.0.37</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<name>JDBCDriver</name> <name>JDBCDriver</name>
<url>https://github.com/taosdata/TDengine/tree/master/src/connector/jdbc</url> <url>https://github.com/taosdata/TDengine/tree/master/src/connector/jdbc</url>
......
...@@ -63,7 +63,6 @@ public class TSDBConnection extends AbstractConnection { ...@@ -63,7 +63,6 @@ public class TSDBConnection extends AbstractConnection {
if (isClosed()) { if (isClosed()) {
throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_CONNECTION_CLOSED); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_CONNECTION_CLOSED);
} }
return new TSDBPreparedStatement(this, sql); return new TSDBPreparedStatement(this, sql);
} }
...@@ -71,7 +70,6 @@ public class TSDBConnection extends AbstractConnection { ...@@ -71,7 +70,6 @@ public class TSDBConnection extends AbstractConnection {
if (isClosed) { if (isClosed) {
return; return;
} }
this.connector.closeConnection(); this.connector.closeConnection();
this.isClosed = true; this.isClosed = true;
} }
......
...@@ -28,6 +28,8 @@ public class TSDBJNIConnector { ...@@ -28,6 +28,8 @@ public class TSDBJNIConnector {
System.loadLibrary("taos"); System.loadLibrary("taos");
} }
/***********************************************************************/
//NOTE: JDBC
public static void init(Properties props) throws SQLWarning { public static void init(Properties props) throws SQLWarning {
synchronized (LOCK) { synchronized (LOCK) {
if (!isInitialized) { if (!isInitialized) {
...@@ -242,6 +244,9 @@ public class TSDBJNIConnector { ...@@ -242,6 +244,9 @@ public class TSDBJNIConnector {
private native int closeConnectionImp(long connection); private native int closeConnectionImp(long connection);
/*****************************************************************************************/
// NOTE: subscribe
/** /**
* Create a subscription * Create a subscription
*/ */
...@@ -269,6 +274,8 @@ public class TSDBJNIConnector { ...@@ -269,6 +274,8 @@ public class TSDBJNIConnector {
private native void unsubscribeImp(long subscription, boolean isKeep); private native void unsubscribeImp(long subscription, boolean isKeep);
/******************************************************************************************************/
// NOTE: parameter binding
public long prepareStmt(String sql) throws SQLException { public long prepareStmt(String sql) throws SQLException {
long stmt = prepareStmtImp(sql.getBytes(), this.taos); long stmt = prepareStmtImp(sql.getBytes(), this.taos);
...@@ -293,16 +300,19 @@ public class TSDBJNIConnector { ...@@ -293,16 +300,19 @@ public class TSDBJNIConnector {
public void setBindTableName(long stmt, String tableName) throws SQLException { public void setBindTableName(long stmt, String tableName) throws SQLException {
int code = setBindTableNameImp(stmt, tableName, this.taos); int code = setBindTableNameImp(stmt, tableName, this.taos);
if (code != TSDBConstants.JNI_SUCCESS) { if (code != TSDBConstants.JNI_SUCCESS) {
throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_UNKNOWN, "failed to set table name"); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_UNKNOWN,
"failed to set table name, reason: " + stmtErrorMsgImp(stmt, this.taos));
} }
} }
private native int setBindTableNameImp(long stmt, String name, long conn); private native int setBindTableNameImp(long stmt, String name, long conn);
public void setBindTableNameAndTags(long stmt, String tableName, int numOfTags, ByteBuffer tags, ByteBuffer typeList, ByteBuffer lengthList, ByteBuffer nullList) throws SQLException { public void setBindTableNameAndTags(long stmt, String tableName, int numOfTags, ByteBuffer tags,
ByteBuffer typeList, ByteBuffer lengthList, ByteBuffer nullList) throws SQLException {
int code = setTableNameTagsImp(stmt, tableName, numOfTags, tags.array(), typeList.array(), lengthList.array(), nullList.array(), this.taos); int code = setTableNameTagsImp(stmt, tableName, numOfTags, tags.array(), typeList.array(), lengthList.array(), nullList.array(), this.taos);
if (code != TSDBConstants.JNI_SUCCESS) { if (code != TSDBConstants.JNI_SUCCESS) {
throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_UNKNOWN, "failed to bind table name and corresponding tags"); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_UNKNOWN,
"failed to bind table name and corresponding tags, reason: " + stmtErrorMsgImp(stmt, this.taos));
} }
} }
...@@ -311,7 +321,8 @@ public class TSDBJNIConnector { ...@@ -311,7 +321,8 @@ public class TSDBJNIConnector {
public void bindColumnDataArray(long stmt, ByteBuffer colDataList, ByteBuffer lengthList, ByteBuffer isNullList, int type, int bytes, int numOfRows, int columnIndex) throws SQLException { public void bindColumnDataArray(long stmt, ByteBuffer colDataList, ByteBuffer lengthList, ByteBuffer isNullList, int type, int bytes, int numOfRows, int columnIndex) throws SQLException {
int code = bindColDataImp(stmt, colDataList.array(), lengthList.array(), isNullList.array(), type, bytes, numOfRows, columnIndex, this.taos); int code = bindColDataImp(stmt, colDataList.array(), lengthList.array(), isNullList.array(), type, bytes, numOfRows, columnIndex, this.taos);
if (code != TSDBConstants.JNI_SUCCESS) { if (code != TSDBConstants.JNI_SUCCESS) {
throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_UNKNOWN, "failed to bind column data"); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_UNKNOWN,
"failed to bind column data, reason: " + stmtErrorMsgImp(stmt, this.taos));
} }
} }
...@@ -320,10 +331,20 @@ public class TSDBJNIConnector { ...@@ -320,10 +331,20 @@ public class TSDBJNIConnector {
public void executeBatch(long stmt) throws SQLException { public void executeBatch(long stmt) throws SQLException {
int code = executeBatchImp(stmt, this.taos); int code = executeBatchImp(stmt, this.taos);
if (code != TSDBConstants.JNI_SUCCESS) { if (code != TSDBConstants.JNI_SUCCESS) {
throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_UNKNOWN, "failed to execute batch bind"); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_UNKNOWN,
"failed to execute batch bind, reason: " + stmtErrorMsgImp(stmt, this.taos));
}
}
public void addBatch(long stmt) throws SQLException {
int code = addBatchImp(stmt, this.taos);
if (code != TSDBConstants.JNI_SUCCESS){
throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_UNKNOWN, stmtErrorMsgImp(stmt, this.taos));
} }
} }
private native int addBatchImp(long stmt, long con);
private native int executeBatchImp(long stmt, long con); private native int executeBatchImp(long stmt, long con);
public void closeBatch(long stmt) throws SQLException { public void closeBatch(long stmt) throws SQLException {
...@@ -335,6 +356,10 @@ public class TSDBJNIConnector { ...@@ -335,6 +356,10 @@ public class TSDBJNIConnector {
private native int closeStmt(long stmt, long con); private native int closeStmt(long stmt, long con);
private native String stmtErrorMsgImp(long stmt, long con);
/*************************************************************************************************/
// NOTE: schemaless-lines
public void insertLines(String[] lines, SchemalessProtocolType protocolType, SchemalessTimestampType timestampType) throws SQLException { public void insertLines(String[] lines, SchemalessProtocolType protocolType, SchemalessTimestampType timestampType) throws SQLException {
int code = insertLinesImp(lines, this.taos, protocolType.ordinal(), timestampType.ordinal()); int code = insertLinesImp(lines, this.taos, protocolType.ordinal(), timestampType.ordinal());
if (code != TSDBConstants.JNI_SUCCESS) { if (code != TSDBConstants.JNI_SUCCESS) {
......
...@@ -40,25 +40,28 @@ public class TSDBPreparedStatement extends TSDBStatement implements PreparedStat ...@@ -40,25 +40,28 @@ public class TSDBPreparedStatement extends TSDBStatement implements PreparedStat
private String rawSql; private String rawSql;
private Object[] parameters; private Object[] parameters;
// for parameter binding // for parameter binding
private long nativeStmtHandle = 0; private long nativeStmtHandle;
private String tableName; private String tableName;
private ArrayList<TableTagInfo> tableTags; private ArrayList<TableTagInfo> tableTags;
private int tagValueLength; private int tagValueLength;
private ArrayList<ColumnInfo> colData; private ArrayList<ColumnInfo> colData;
TSDBPreparedStatement(TSDBConnection connection, String sql) { TSDBPreparedStatement(TSDBConnection connection, String sql) throws SQLException {
super(connection); super(connection);
init(sql); init(sql);
int parameterCnt = 0; int parameterCnt = 0;
if (sql.contains("?")) { if (!sql.contains("?"))
return;
for (int i = 0; i < sql.length(); i++) { for (int i = 0; i < sql.length(); i++) {
if ('?' == sql.charAt(i)) { if ('?' == sql.charAt(i)) {
parameterCnt++; parameterCnt++;
} }
} }
}
parameters = new Object[parameterCnt]; parameters = new Object[parameterCnt];
// for parameter-binding
// TSDBJNIConnector connector = ((TSDBConnection) this.getConnection()).getConnector();
// this.nativeStmtHandle = connector.prepareStmt(rawSql);
if (parameterCnt > 1) { if (parameterCnt > 1) {
// the table name is also a parameter, so ignore it. // the table name is also a parameter, so ignore it.
this.colData = new ArrayList<>(); this.colData = new ArrayList<>();
...@@ -686,7 +689,6 @@ public class TSDBPreparedStatement extends TSDBStatement implements PreparedStat ...@@ -686,7 +689,6 @@ public class TSDBPreparedStatement extends TSDBStatement implements PreparedStat
if (rawSql == null) { if (rawSql == null) {
throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_UNKNOWN, "sql statement not set yet"); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_UNKNOWN, "sql statement not set yet");
} }
// table name is not set yet, abort // table name is not set yet, abort
if (this.tableName == null) { if (this.tableName == null) {
throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_UNKNOWN, "table name not set yet"); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_UNKNOWN, "table name not set yet");
...@@ -696,24 +698,25 @@ public class TSDBPreparedStatement extends TSDBStatement implements PreparedStat ...@@ -696,24 +698,25 @@ public class TSDBPreparedStatement extends TSDBStatement implements PreparedStat
if (numOfCols == 0) { if (numOfCols == 0) {
throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_UNKNOWN, "column data not bind"); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_UNKNOWN, "column data not bind");
} }
if (nativeStmtHandle == 0) {
throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_UNKNOWN, "stmt is null");
}
TSDBJNIConnector connector = ((TSDBConnection) this.getConnection()).getConnector(); TSDBJNIConnector connector = ((TSDBConnection) this.getConnection()).getConnector();
this.nativeStmtHandle = connector.prepareStmt(rawSql);
if (this.tableTags == null) { if (this.tableTags == null) {
connector.setBindTableName(this.nativeStmtHandle, this.tableName); connector.setBindTableName(this.nativeStmtHandle, this.tableName);
} else { } else {
int num = this.tableTags.size(); int tagSize = this.tableTags.size();
ByteBuffer tagDataList = ByteBuffer.allocate(this.tagValueLength); ByteBuffer tagDataList = ByteBuffer.allocate(this.tagValueLength);
tagDataList.order(ByteOrder.LITTLE_ENDIAN); tagDataList.order(ByteOrder.LITTLE_ENDIAN);
ByteBuffer typeList = ByteBuffer.allocate(num); ByteBuffer typeList = ByteBuffer.allocate(tagSize);
typeList.order(ByteOrder.LITTLE_ENDIAN); typeList.order(ByteOrder.LITTLE_ENDIAN);
ByteBuffer lengthList = ByteBuffer.allocate(num * Long.BYTES); ByteBuffer lengthList = ByteBuffer.allocate(tagSize * Long.BYTES);
lengthList.order(ByteOrder.LITTLE_ENDIAN); lengthList.order(ByteOrder.LITTLE_ENDIAN);
ByteBuffer isNullList = ByteBuffer.allocate(num * Integer.BYTES); ByteBuffer isNullList = ByteBuffer.allocate(tagSize * Integer.BYTES);
isNullList.order(ByteOrder.LITTLE_ENDIAN); isNullList.order(ByteOrder.LITTLE_ENDIAN);
for (TableTagInfo tag : this.tableTags) { for (TableTagInfo tag : this.tableTags) {
...@@ -737,53 +740,42 @@ public class TSDBPreparedStatement extends TSDBStatement implements PreparedStat ...@@ -737,53 +740,42 @@ public class TSDBPreparedStatement extends TSDBStatement implements PreparedStat
lengthList.putLong(Byte.BYTES); lengthList.putLong(Byte.BYTES);
break; break;
} }
case TSDBConstants.TSDB_DATA_TYPE_BOOL: { case TSDBConstants.TSDB_DATA_TYPE_BOOL: {
Boolean val = (Boolean) tag.value; Boolean val = (Boolean) tag.value;
tagDataList.put((byte) (val ? 1 : 0)); tagDataList.put((byte) (val ? 1 : 0));
lengthList.putLong(Byte.BYTES); lengthList.putLong(Byte.BYTES);
break; break;
} }
case TSDBConstants.TSDB_DATA_TYPE_SMALLINT: { case TSDBConstants.TSDB_DATA_TYPE_SMALLINT: {
Short val = (Short) tag.value; Short val = (Short) tag.value;
tagDataList.putShort(val); tagDataList.putShort(val);
lengthList.putLong(Short.BYTES); lengthList.putLong(Short.BYTES);
break; break;
} }
case TSDBConstants.TSDB_DATA_TYPE_TIMESTAMP: case TSDBConstants.TSDB_DATA_TYPE_TIMESTAMP:
case TSDBConstants.TSDB_DATA_TYPE_BIGINT: { case TSDBConstants.TSDB_DATA_TYPE_BIGINT: {
Long val = (Long) tag.value; Long val = (Long) tag.value;
tagDataList.putLong(val == null ? 0 : val); tagDataList.putLong(val == null ? 0 : val);
lengthList.putLong(Long.BYTES); lengthList.putLong(Long.BYTES);
break; break;
} }
case TSDBConstants.TSDB_DATA_TYPE_FLOAT: { case TSDBConstants.TSDB_DATA_TYPE_FLOAT: {
Float val = (Float) tag.value; Float val = (Float) tag.value;
tagDataList.putFloat(val == null ? 0 : val); tagDataList.putFloat(val == null ? 0 : val);
lengthList.putLong(Float.BYTES); lengthList.putLong(Float.BYTES);
break; break;
} }
case TSDBConstants.TSDB_DATA_TYPE_DOUBLE: { case TSDBConstants.TSDB_DATA_TYPE_DOUBLE: {
Double val = (Double) tag.value; Double val = (Double) tag.value;
tagDataList.putDouble(val == null ? 0 : val); tagDataList.putDouble(val == null ? 0 : val);
lengthList.putLong(Double.BYTES); lengthList.putLong(Double.BYTES);
break; break;
} }
case TSDBConstants.TSDB_DATA_TYPE_NCHAR: case TSDBConstants.TSDB_DATA_TYPE_NCHAR:
case TSDBConstants.TSDB_DATA_TYPE_BINARY: { case TSDBConstants.TSDB_DATA_TYPE_BINARY: {
String charset = TaosGlobalConfig.getCharset(); String charset = TaosGlobalConfig.getCharset();
String val = (String) tag.value; String val = (String) tag.value;
byte[] b;
byte[] b = null;
try { try {
if (tag.type == TSDBConstants.TSDB_DATA_TYPE_BINARY) { if (tag.type == TSDBConstants.TSDB_DATA_TYPE_BINARY) {
b = val.getBytes(); b = val.getBytes();
...@@ -793,12 +785,10 @@ public class TSDBPreparedStatement extends TSDBStatement implements PreparedStat ...@@ -793,12 +785,10 @@ public class TSDBPreparedStatement extends TSDBStatement implements PreparedStat
} catch (UnsupportedEncodingException e) { } catch (UnsupportedEncodingException e) {
throw new RuntimeException(e.getMessage()); throw new RuntimeException(e.getMessage());
} }
tagDataList.put(b); tagDataList.put(b);
lengthList.putLong(b.length); lengthList.putLong(b.length);
break; break;
} }
case TSDBConstants.TSDB_DATA_TYPE_UTINYINT: case TSDBConstants.TSDB_DATA_TYPE_UTINYINT:
case TSDBConstants.TSDB_DATA_TYPE_USMALLINT: case TSDBConstants.TSDB_DATA_TYPE_USMALLINT:
case TSDBConstants.TSDB_DATA_TYPE_UINT: case TSDBConstants.TSDB_DATA_TYPE_UINT:
...@@ -806,13 +796,12 @@ public class TSDBPreparedStatement extends TSDBStatement implements PreparedStat ...@@ -806,13 +796,12 @@ public class TSDBPreparedStatement extends TSDBStatement implements PreparedStat
throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_UNKNOWN, "not support data types"); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_UNKNOWN, "not support data types");
} }
} }
typeList.put((byte) tag.type); typeList.put((byte) tag.type);
isNullList.putInt(tag.isNull ? 1 : 0); isNullList.putInt(tag.isNull ? 1 : 0);
} }
connector.setBindTableNameAndTags(this.nativeStmtHandle, this.tableName, this.tableTags.size(), tagDataList, connector.setBindTableNameAndTags(this.nativeStmtHandle, this.tableName, this.tableTags.size(),
typeList, lengthList, isNullList); tagDataList, typeList, lengthList, isNullList);
} }
ColumnInfo colInfo = this.colData.get(0); ColumnInfo colInfo = this.colData.get(0);
...@@ -826,7 +815,6 @@ public class TSDBPreparedStatement extends TSDBStatement implements PreparedStat ...@@ -826,7 +815,6 @@ public class TSDBPreparedStatement extends TSDBStatement implements PreparedStat
if (col1 == null || !col1.isTypeSet()) { if (col1 == null || !col1.isTypeSet()) {
throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_UNKNOWN, "column data not bind"); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_UNKNOWN, "column data not bind");
} }
if (rows != col1.data.size()) { if (rows != col1.data.size()) {
throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_UNKNOWN, "the rows in column data not identical"); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_UNKNOWN, "the rows in column data not identical");
} }
...@@ -943,7 +931,6 @@ public class TSDBPreparedStatement extends TSDBStatement implements PreparedStat ...@@ -943,7 +931,6 @@ public class TSDBPreparedStatement extends TSDBStatement implements PreparedStat
} }
break; break;
} }
case TSDBConstants.TSDB_DATA_TYPE_UTINYINT: case TSDBConstants.TSDB_DATA_TYPE_UTINYINT:
case TSDBConstants.TSDB_DATA_TYPE_USMALLINT: case TSDBConstants.TSDB_DATA_TYPE_USMALLINT:
case TSDBConstants.TSDB_DATA_TYPE_UINT: case TSDBConstants.TSDB_DATA_TYPE_UINT:
...@@ -954,6 +941,8 @@ public class TSDBPreparedStatement extends TSDBStatement implements PreparedStat ...@@ -954,6 +941,8 @@ public class TSDBPreparedStatement extends TSDBStatement implements PreparedStat
connector.bindColumnDataArray(this.nativeStmtHandle, colDataList, lengthList, isNullList, col1.type, col1.bytes, rows, i); connector.bindColumnDataArray(this.nativeStmtHandle, colDataList, lengthList, isNullList, col1.type, col1.bytes, rows, i);
} }
connector.addBatch(this.nativeStmtHandle);
this.columnDataClearBatchInternal();
} }
public void columnDataExecuteBatch() throws SQLException { public void columnDataExecuteBatch() throws SQLException {
...@@ -971,12 +960,11 @@ public class TSDBPreparedStatement extends TSDBStatement implements PreparedStat ...@@ -971,12 +960,11 @@ public class TSDBPreparedStatement extends TSDBStatement implements PreparedStat
this.tableName = null; this.tableName = null;
if (this.tableTags != null) if (this.tableTags != null)
this.tableTags.clear(); this.tableTags.clear();
this.tagValueLength = 0; tagValueLength = 0;
if (this.colData != null) if (this.colData != null)
this.colData.clear(); this.colData.clear();
} }
public void columnDataCloseBatch() throws SQLException { public void columnDataCloseBatch() throws SQLException {
TSDBJNIConnector connector = ((TSDBConnection) this.getConnection()).getConnector(); TSDBJNIConnector connector = ((TSDBConnection) this.getConnection()).getConnector();
connector.closeBatch(this.nativeStmtHandle); connector.closeBatch(this.nativeStmtHandle);
......
package com.taosdata.jdbc; package com.taosdata.jdbc;
import org.junit.After; import org.junit.*;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import java.sql.*; import java.sql.*;
import java.time.Instant;
import java.time.temporal.ChronoUnit;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
...@@ -21,13 +20,17 @@ public class ParameterBindTest { ...@@ -21,13 +20,17 @@ public class ParameterBindTest {
private final Random random = new Random(System.currentTimeMillis()); private final Random random = new Random(System.currentTimeMillis());
@Test @Test
public void test() { public void one_batch_multi_table() throws SQLException {
// given // given
String[] tbnames = {"t1", "t2", "t3"}; String[] tbnames = {"t1", "t2", "t3"};
int rows = 10; int rows = 10;
// when // when
insertIntoTables(tbnames, 10); String sql = "insert into ? using " + stable + " tags(?, ?) values(?, ?, ?)";
try (TSDBPreparedStatement pstmt = conn.prepareStatement(sql).unwrap(TSDBPreparedStatement.class)) {
long current = System.currentTimeMillis();
insertIntoTables(pstmt, tbnames, current, 10);
}
// then // then
assertRows(stable, tbnames.length * rows); assertRows(stable, tbnames.length * rows);
...@@ -37,13 +40,48 @@ public class ParameterBindTest { ...@@ -37,13 +40,48 @@ public class ParameterBindTest {
} }
@Test @Test
public void testMultiThreads() { public void multi_batch_multi_table() throws SQLException {
// given
int rows = 10;
int batchSize = 10;
String[] tbnames = {"t1", "t2", "t3"};
// when
String sql = "insert into ? using " + stable + " tags(?, ?) values(?, ?, ?)";
try (TSDBPreparedStatement pstmt = conn.prepareStatement(sql).unwrap(TSDBPreparedStatement.class)) {
long current = System.currentTimeMillis();
for (int i = 0; i < batchSize; i++) {
insertIntoTables(pstmt, tbnames, current + 1000 * i * rows, rows);
}
}
// then
assertRows(stable, tbnames.length * batchSize * rows);
for (String t : tbnames) {
assertRows(t, rows * batchSize);
}
}
@Test
public void multiThreads() {
// given // given
String[][] tables = {{"t1", "t2", "t3"}, {"t4", "t5", "t6"}, {"t7", "t8", "t9"}, {"t10"}}; String[][] tables = {{"t1", "t2", "t3"}, {"t4", "t5", "t6"}, {"t7", "t8", "t9"}, {"t10"}};
int rows = 10; int rows = 10;
// when // when
List<Thread> threads = Arrays.stream(tables).map(tbnames -> new Thread(() -> insertIntoTables(tbnames, rows))).collect(Collectors.toList()); List<Thread> threads = Arrays.stream(tables).map(tbnames -> new Thread(() -> {
String sql = "insert into ? using " + stable + " tags(?, ?) values(?, ?, ?)";
try (TSDBPreparedStatement pstmt = conn.prepareStatement(sql).unwrap(TSDBPreparedStatement.class)) {
long current = System.currentTimeMillis();
insertIntoTables(pstmt, tbnames, current, 10);
} catch (SQLException throwables) {
throwables.printStackTrace();
}
})).collect(Collectors.toList());
threads.forEach(Thread::start); threads.forEach(Thread::start);
for (Thread thread : threads) { for (Thread thread : threads) {
try { try {
...@@ -59,9 +97,26 @@ public class ParameterBindTest { ...@@ -59,9 +97,26 @@ public class ParameterBindTest {
assertRows(t, rows); assertRows(t, rows);
} }
} }
}
@Ignore
@Test
public void testOOM() throws SQLException {
String[] tbnames = {"t1", "t2", "t3", "t4", "t5", "t6", "t7", "t8", "t9", "t10"};
String sql = "insert into ? using " + stable + " tags(?, ?) values(?, ?, ?)";
int rows = 1000;
try (TSDBPreparedStatement pstmt = conn.prepareStatement(sql).unwrap(TSDBPreparedStatement.class)) {
long ts = Instant.now().minus(5 * 365, ChronoUnit.DAYS).getEpochSecond() * 1000;
while (true) {
insertIntoTables(pstmt, tbnames, ts, rows);
ts += 1000 * rows;
}
}
} }
private void assertRows(String tbname, int rows) { private void assertRows(String tbname, int rows) {
try (Statement stmt = conn.createStatement()) { try (Statement stmt = conn.createStatement()) {
ResultSet rs = stmt.executeQuery("select count(*) from " + tbname); ResultSet rs = stmt.executeQuery("select count(*) from " + tbname);
...@@ -74,40 +129,36 @@ public class ParameterBindTest { ...@@ -74,40 +129,36 @@ public class ParameterBindTest {
} }
} }
private void insertIntoTables(String[] tbnames, int rowsEachTable) { private void insertIntoTables(TSDBPreparedStatement pstmt, String[] tbnames, long ts_start, int rowsEachTable) throws SQLException {
long current = System.currentTimeMillis();
String sql = "insert into ? using " + stable + " tags(?, ?) values(?, ?, ?)";
try (TSDBPreparedStatement pstmt = conn.prepareStatement(sql).unwrap(TSDBPreparedStatement.class)) {
for (int i = 0; i < tbnames.length; i++) { for (int i = 0; i < tbnames.length; i++) {
// set table name
pstmt.setTableName(tbnames[i]); pstmt.setTableName(tbnames[i]);
// set tags
pstmt.setTagInt(0, random.nextInt(100)); pstmt.setTagInt(0, random.nextInt(100));
pstmt.setTagInt(1, random.nextInt(100)); pstmt.setTagInt(1, random.nextInt(100));
// set column: ts
ArrayList<Long> timestampList = new ArrayList<>(); ArrayList<Long> timestampList = new ArrayList<>();
for (int j = 0; j < rowsEachTable; j++) { for (int j = 0; j < rowsEachTable; j++) {
timestampList.add(current + i * 1000 + j); timestampList.add(ts_start + j * 1000L);
} }
pstmt.setTimestamp(0, timestampList); pstmt.setTimestamp(0, timestampList);
// set column: f1
ArrayList<Integer> f1List = new ArrayList<>(); ArrayList<Integer> f1List = new ArrayList<>();
for (int j = 0; j < rowsEachTable; j++) { for (int j = 0; j < rowsEachTable; j++) {
f1List.add(random.nextInt(100)); f1List.add(random.nextInt(100));
} }
pstmt.setInt(1, f1List); pstmt.setInt(1, f1List);
// set column: f2
ArrayList<Integer> f2List = new ArrayList<>(); ArrayList<Integer> f2List = new ArrayList<>();
for (int j = 0; j < rowsEachTable; j++) { for (int j = 0; j < rowsEachTable; j++) {
f2List.add(random.nextInt(100)); f2List.add(random.nextInt(100));
} }
pstmt.setInt(2, f2List); pstmt.setInt(2, f2List);
// add batch
pstmt.columnDataAddBatch(); pstmt.columnDataAddBatch();
} }
// execute batch
pstmt.columnDataExecuteBatch(); pstmt.columnDataExecuteBatch();
} catch (SQLException e) {
e.printStackTrace();
}
} }
@Before @Before
......
...@@ -4,38 +4,25 @@ import com.taosdata.jdbc.enums.SchemalessProtocolType; ...@@ -4,38 +4,25 @@ import com.taosdata.jdbc.enums.SchemalessProtocolType;
import com.taosdata.jdbc.enums.SchemalessTimestampType; import com.taosdata.jdbc.enums.SchemalessTimestampType;
import org.junit.Test; import org.junit.Test;
import java.lang.management.ManagementFactory; import java.nio.ByteBuffer;
import java.lang.management.RuntimeMXBean; import java.nio.ByteOrder;
import java.sql.SQLException; import java.sql.SQLException;
import java.sql.SQLWarning;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Properties; import java.util.Properties;
import java.util.Random;
import java.util.stream.IntStream;
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue; import static org.junit.Assert.assertTrue;
public class TSDBJNIConnectorTest { public class TSDBJNIConnectorTest {
private static final String host = "127.0.0.1";
private static TSDBResultSetRowData rowData; private static TSDBResultSetRowData rowData;
@Test @Test
public void test() throws SQLException { public void test() throws SQLException {
try {
//change sleepSeconds when debugging with attach to process to find PID
int sleepSeconds = -1;
if (sleepSeconds > 0) {
RuntimeMXBean runtimeBean = ManagementFactory.getRuntimeMXBean();
String jvmName = runtimeBean.getName();
long pid = Long.valueOf(jvmName.split("@")[0]);
System.out.println("JVM PID = " + pid);
Thread.sleep(sleepSeconds * 1000);
}
} catch (Exception e) {
e.printStackTrace();
}
// init // init
Properties properties = new Properties(); Properties properties = new Properties();
properties.setProperty(TSDBDriver.PROPERTY_KEY_CONFIG_DIR, "/etc/taos"); properties.setProperty(TSDBDriver.PROPERTY_KEY_CONFIG_DIR, "/etc/taos");
...@@ -43,7 +30,7 @@ public class TSDBJNIConnectorTest { ...@@ -43,7 +30,7 @@ public class TSDBJNIConnectorTest {
// connect // connect
TSDBJNIConnector connector = new TSDBJNIConnector(); TSDBJNIConnector connector = new TSDBJNIConnector();
connector.connect("127.0.0.1", 6030, null, "root", "taosdata"); connector.connect(host, 6030, null, "root", "taosdata");
// setup // setup
String setupSqlStrs[] = {"create database if not exists d precision \"us\"", String setupSqlStrs[] = {"create database if not exists d precision \"us\"",
...@@ -141,4 +128,128 @@ public class TSDBJNIConnectorTest { ...@@ -141,4 +128,128 @@ public class TSDBJNIConnectorTest {
} else return code != TSDBConstants.JNI_FETCH_END; } else return code != TSDBConstants.JNI_FETCH_END;
} }
@Test
public void param_bind_one_batch_multi_table() throws SQLException {
TSDBJNIConnector connector = new TSDBJNIConnector();
connector.connect(host, 6030, null, "root", "taosdata");
connector.executeQuery("drop database if exists test");
connector.executeQuery("create database if not exists test");
connector.executeQuery("use test");
connector.executeQuery("create table weather(ts timestamp, f1 int) tags(t1 int)");
// 1. init + prepare
long stmt = connector.prepareStmt("insert into ? using weather tags(?) values(?,?)");
for (int i = 0; i < 10; i++) {
// 2. set_tbname_tags
stmt_set_table_tags(connector, stmt, "t" + i);
// 3. bind_single_param_batch
// bind timestamp
long ts = System.currentTimeMillis();
bind_col_timestamp(connector, stmt, ts, 100);
// bind int
bind_col_integer(connector, stmt, 100);
// 4. add_batch
connector.addBatch(stmt);
}
connector.executeBatch(stmt);
connector.closeBatch(stmt);
connector.executeQuery("drop database if exists test");
connector.closeConnection();
}
@Test
public void param_bind_multi_batch_multi_table() throws SQLException {
TSDBJNIConnector connector = new TSDBJNIConnector();
connector.connect(host, 6030, null, "root", "taosdata");
connector.executeQuery("drop database if exists test");
connector.executeQuery("create database if not exists test");
connector.executeQuery("use test");
connector.executeQuery("create table weather(ts timestamp, f1 int) tags(t1 int)");
// 1. init + prepare
long stmt = connector.prepareStmt("insert into ? using weather tags(?) values(?,?)");
long ts = System.currentTimeMillis();
for (int ind_batch = 0; ind_batch < 10; ind_batch++) {
ts += ind_batch * 1000 * 1000;
System.out.println("batch: " + ind_batch + ", ts: " + ts);
for (int i = 0; i < 10; i++) {
// 2. set_tbname_tags
stmt_set_table_tags(connector, stmt, "t" + i);
// 3. bind_single_param_batch
// bind timestamp
bind_col_timestamp(connector, stmt, ts, 100);
// bind int
bind_col_integer(connector, stmt, 100);
// 4. add_batch
connector.addBatch(stmt);
}
connector.executeBatch(stmt);
}
connector.closeBatch(stmt);
connector.executeQuery("drop database if exists test");
connector.closeConnection();
}
private void bind_col_timestamp(TSDBJNIConnector connector, long stmt, long ts_start, int numOfRows) throws SQLException {
ByteBuffer colDataList = ByteBuffer.allocate(numOfRows * Long.BYTES);
colDataList.order(ByteOrder.LITTLE_ENDIAN);
IntStream.range(0, numOfRows).forEach(ind -> colDataList.putLong(ts_start + ind * 1000L));
ByteBuffer lengthList = ByteBuffer.allocate(numOfRows * Long.BYTES);
lengthList.order(ByteOrder.LITTLE_ENDIAN);
IntStream.range(0, numOfRows).forEach(ind -> lengthList.putLong(Integer.BYTES));
ByteBuffer isNullList = ByteBuffer.allocate(numOfRows * Integer.BYTES);
isNullList.order(ByteOrder.LITTLE_ENDIAN);
IntStream.range(0, numOfRows).forEach(ind -> isNullList.putInt(0));
connector.bindColumnDataArray(stmt, colDataList, lengthList, isNullList, TSDBConstants.TSDB_DATA_TYPE_TIMESTAMP, Long.BYTES, numOfRows, 0);
}
private void bind_col_integer(TSDBJNIConnector connector, long stmt, int numOfRows) throws SQLException {
ByteBuffer colDataList = ByteBuffer.allocate(numOfRows * Integer.BYTES);
colDataList.order(ByteOrder.LITTLE_ENDIAN);
IntStream.range(0, numOfRows).forEach(ind -> colDataList.putInt(new Random().nextInt(100)));
ByteBuffer lengthList = ByteBuffer.allocate(numOfRows * Long.BYTES);
lengthList.order(ByteOrder.LITTLE_ENDIAN);
IntStream.range(0, numOfRows).forEach(ind -> lengthList.putLong(Integer.BYTES));
ByteBuffer isNullList = ByteBuffer.allocate(numOfRows * Integer.BYTES);
isNullList.order(ByteOrder.LITTLE_ENDIAN);
IntStream.range(0, numOfRows).forEach(ind -> isNullList.putInt(0));
connector.bindColumnDataArray(stmt, colDataList, lengthList, isNullList, TSDBConstants.TSDB_DATA_TYPE_INT, Integer.BYTES, numOfRows, 1);
}
private void stmt_set_table_tags(TSDBJNIConnector connector, long stmt, String tbname) throws SQLException {
ByteBuffer tagDataList = ByteBuffer.allocate(Integer.BYTES);
tagDataList.order(ByteOrder.LITTLE_ENDIAN);
tagDataList.putInt(new Random().nextInt(100));
ByteBuffer typeList = ByteBuffer.allocate(1);
typeList.order(ByteOrder.LITTLE_ENDIAN);
typeList.put((byte) TSDBConstants.TSDB_DATA_TYPE_INT);
ByteBuffer lengthList = ByteBuffer.allocate(1 * Long.BYTES);
lengthList.order(ByteOrder.LITTLE_ENDIAN);
lengthList.putLong(Integer.BYTES);
ByteBuffer isNullList = ByteBuffer.allocate(1 * Integer.BYTES);
isNullList.order(ByteOrder.LITTLE_ENDIAN);
isNullList.putInt(0);
connector.setBindTableNameAndTags(stmt, tbname, 1, tagDataList, typeList, lengthList, isNullList);
}
} }
...@@ -432,6 +432,16 @@ void* getJsonTagValueElment(void* data, char* key, int32_t keyLen, char* out, in ...@@ -432,6 +432,16 @@ void* getJsonTagValueElment(void* data, char* key, int32_t keyLen, char* out, in
void getJsonTagValueAll(void* data, void* dst, int16_t bytes); void getJsonTagValueAll(void* data, void* dst, int16_t bytes);
char* parseTagDatatoJson(void *p); char* parseTagDatatoJson(void *p);
//
// scan callback
//
// type define
#define READ_TABLE 1
#define READ_QUERY 2
typedef bool (*readover_callback)(void* param, int8_t type, int32_t tid);
void tsdbAddScanCallback(TsdbQueryHandleT* queryHandle, readover_callback callback, void* param);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
......
Subproject commit a6531c1528b5b50fb234e2519106feae91cc8d38 Subproject commit 0cc64c42245d4e455b66b2717482155637682f23
Subproject commit 6d401bb95e1125ce4aad012dc23191ed85af8b3b Subproject commit dd3f71d011e5e0bc3447b408c95bf99a047344b9
...@@ -325,6 +325,8 @@ typedef struct SQueryRuntimeEnv { ...@@ -325,6 +325,8 @@ typedef struct SQueryRuntimeEnv {
SHashObj *pTableRetrieveTsMap; SHashObj *pTableRetrieveTsMap;
SUdfInfo *pUdfInfo; SUdfInfo *pUdfInfo;
bool udfIsCopy; bool udfIsCopy;
SHashObj *pTablesRead; // record child tables already read rows by tid hash
int32_t cntTableReadOver; // read table over count
} SQueryRuntimeEnv; } SQueryRuntimeEnv;
enum { enum {
...@@ -721,4 +723,10 @@ void doInvokeUdf(SUdfInfo* pUdfInfo, SQLFunctionCtx *pCtx, int32_t idx, int32_t ...@@ -721,4 +723,10 @@ void doInvokeUdf(SUdfInfo* pUdfInfo, SQLFunctionCtx *pCtx, int32_t idx, int32_t
int32_t getColumnDataFromId(void *param, int32_t id, void **data); int32_t getColumnDataFromId(void *param, int32_t id, void **data);
void qInfoLogSSDataBlock(SSDataBlock* block, char* location); void qInfoLogSSDataBlock(SSDataBlock* block, char* location);
// add table read rows count. pHashTables must not be NULL
void addTableReadRows(SQueryRuntimeEnv* pEnv, int32_t tid, int32_t rows);
// tsdb scan table callback table or query is over. param is SQueryRuntimeEnv*
bool qReadOverCB(void* param, int8_t type, int32_t tid);
#endif // TDENGINE_QEXECUTOR_H #endif // TDENGINE_QEXECUTOR_H
...@@ -859,7 +859,7 @@ cmd ::= ALTER TABLE ids(X) cpxName(Z) DROP TAG ids(Y). { ...@@ -859,7 +859,7 @@ cmd ::= ALTER TABLE ids(X) cpxName(Z) DROP TAG ids(Y). {
X.n += Z.n; X.n += Z.n;
toTSDBType(Y.type); toTSDBType(Y.type);
SArray* A = tVariantListAppendToken(NULL, &Y, -1, true); SArray* A = tVariantListAppendToken(NULL, &Y, -1, false);
SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&X, NULL, A, TSDB_ALTER_TABLE_DROP_TAG_COLUMN, -1); SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&X, NULL, A, TSDB_ALTER_TABLE_DROP_TAG_COLUMN, -1);
setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
...@@ -869,10 +869,10 @@ cmd ::= ALTER TABLE ids(X) cpxName(F) CHANGE TAG ids(Y) ids(Z). { ...@@ -869,10 +869,10 @@ cmd ::= ALTER TABLE ids(X) cpxName(F) CHANGE TAG ids(Y) ids(Z). {
X.n += F.n; X.n += F.n;
toTSDBType(Y.type); toTSDBType(Y.type);
SArray* A = tVariantListAppendToken(NULL, &Y, -1, true); SArray* A = tVariantListAppendToken(NULL, &Y, -1, false);
toTSDBType(Z.type); toTSDBType(Z.type);
A = tVariantListAppendToken(A, &Z, -1, true); A = tVariantListAppendToken(A, &Z, -1, false);
SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&X, NULL, A, TSDB_ALTER_TABLE_CHANGE_TAG_COLUMN, -1); SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&X, NULL, A, TSDB_ALTER_TABLE_CHANGE_TAG_COLUMN, -1);
setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
...@@ -882,7 +882,7 @@ cmd ::= ALTER TABLE ids(X) cpxName(F) SET TAG ids(Y) EQ tagitem(Z). { ...@@ -882,7 +882,7 @@ cmd ::= ALTER TABLE ids(X) cpxName(F) SET TAG ids(Y) EQ tagitem(Z). {
X.n += F.n; X.n += F.n;
toTSDBType(Y.type); toTSDBType(Y.type);
SArray* A = tVariantListAppendToken(NULL, &Y, -1, true); SArray* A = tVariantListAppendToken(NULL, &Y, -1, false);
A = tVariantListAppend(A, &Z, -1); A = tVariantListAppend(A, &Z, -1);
SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&X, NULL, A, TSDB_ALTER_TABLE_UPDATE_TAG_VAL, -1); SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&X, NULL, A, TSDB_ALTER_TABLE_UPDATE_TAG_VAL, -1);
...@@ -906,7 +906,7 @@ cmd ::= ALTER STABLE ids(X) cpxName(F) DROP COLUMN ids(A). { ...@@ -906,7 +906,7 @@ cmd ::= ALTER STABLE ids(X) cpxName(F) DROP COLUMN ids(A). {
X.n += F.n; X.n += F.n;
toTSDBType(A.type); toTSDBType(A.type);
SArray* K = tVariantListAppendToken(NULL, &A, -1, true); SArray* K = tVariantListAppendToken(NULL, &A, -1, false);
SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&X, NULL, K, TSDB_ALTER_TABLE_DROP_COLUMN, TSDB_SUPER_TABLE); SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&X, NULL, K, TSDB_ALTER_TABLE_DROP_COLUMN, TSDB_SUPER_TABLE);
setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
...@@ -928,7 +928,7 @@ cmd ::= ALTER STABLE ids(X) cpxName(Z) DROP TAG ids(Y). { ...@@ -928,7 +928,7 @@ cmd ::= ALTER STABLE ids(X) cpxName(Z) DROP TAG ids(Y). {
X.n += Z.n; X.n += Z.n;
toTSDBType(Y.type); toTSDBType(Y.type);
SArray* A = tVariantListAppendToken(NULL, &Y, -1, true); SArray* A = tVariantListAppendToken(NULL, &Y, -1, false);
SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&X, NULL, A, TSDB_ALTER_TABLE_DROP_TAG_COLUMN, TSDB_SUPER_TABLE); SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&X, NULL, A, TSDB_ALTER_TABLE_DROP_TAG_COLUMN, TSDB_SUPER_TABLE);
setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
...@@ -938,10 +938,10 @@ cmd ::= ALTER STABLE ids(X) cpxName(F) CHANGE TAG ids(Y) ids(Z). { ...@@ -938,10 +938,10 @@ cmd ::= ALTER STABLE ids(X) cpxName(F) CHANGE TAG ids(Y) ids(Z). {
X.n += F.n; X.n += F.n;
toTSDBType(Y.type); toTSDBType(Y.type);
SArray* A = tVariantListAppendToken(NULL, &Y, -1, true); SArray* A = tVariantListAppendToken(NULL, &Y, -1, false);
toTSDBType(Z.type); toTSDBType(Z.type);
A = tVariantListAppendToken(A, &Z, -1, true); A = tVariantListAppendToken(A, &Z, -1, false);
SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&X, NULL, A, TSDB_ALTER_TABLE_CHANGE_TAG_COLUMN, TSDB_SUPER_TABLE); SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&X, NULL, A, TSDB_ALTER_TABLE_CHANGE_TAG_COLUMN, TSDB_SUPER_TABLE);
setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
...@@ -951,7 +951,7 @@ cmd ::= ALTER STABLE ids(X) cpxName(F) SET TAG ids(Y) EQ tagitem(Z). { ...@@ -951,7 +951,7 @@ cmd ::= ALTER STABLE ids(X) cpxName(F) SET TAG ids(Y) EQ tagitem(Z). {
X.n += F.n; X.n += F.n;
toTSDBType(Y.type); toTSDBType(Y.type);
SArray* A = tVariantListAppendToken(NULL, &Y, -1, true); SArray* A = tVariantListAppendToken(NULL, &Y, -1, false);
A = tVariantListAppend(A, &Z, -1); A = tVariantListAppend(A, &Z, -1);
SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&X, NULL, A, TSDB_ALTER_TABLE_UPDATE_TAG_VAL, TSDB_SUPER_TABLE); SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&X, NULL, A, TSDB_ALTER_TABLE_UPDATE_TAG_VAL, TSDB_SUPER_TABLE);
......
...@@ -2057,6 +2057,22 @@ static int32_t setupQueryRuntimeEnv(SQueryRuntimeEnv *pRuntimeEnv, int32_t numOf ...@@ -2057,6 +2057,22 @@ static int32_t setupQueryRuntimeEnv(SQueryRuntimeEnv *pRuntimeEnv, int32_t numOf
pRuntimeEnv->prevRow = malloc(POINTER_BYTES * pQueryAttr->numOfCols + pQueryAttr->srcRowSize); pRuntimeEnv->prevRow = malloc(POINTER_BYTES * pQueryAttr->numOfCols + pQueryAttr->srcRowSize);
pRuntimeEnv->tagVal = malloc(pQueryAttr->tagLen); pRuntimeEnv->tagVal = malloc(pQueryAttr->tagLen);
// malloc pTablesRead value if super table && project query and && has order by && limit is true
if( pRuntimeEnv->pQueryHandle && // client merge no tsdb query, so pQueryHandle is NULL, except client merge case in here
pQueryAttr->limit.limit > 0 &&
pQueryAttr->limit.offset == 0 && // if have offset, ignore limit optimization
pQueryAttr->stableQuery &&
isProjQuery(pQueryAttr) &&
pQueryAttr->order.orderColId != -1 ) {
// can be optimizate limit
pRuntimeEnv->pTablesRead = taosHashInit(numOfTables, taosGetDefaultHashFunction(TSDB_DATA_TYPE_INT), true, HASH_NO_LOCK);
if (pRuntimeEnv->pTablesRead) // must malloc ok, set callback to tsdb
tsdbAddScanCallback(pRuntimeEnv->pQueryHandle, qReadOverCB, pRuntimeEnv);
} else {
pRuntimeEnv->pTablesRead = NULL;
}
pRuntimeEnv->cntTableReadOver= 0;
// NOTE: pTableCheckInfo need to update the query time range and the lastKey info // NOTE: pTableCheckInfo need to update the query time range and the lastKey info
pRuntimeEnv->pTableRetrieveTsMap = taosHashInit(numOfTables, taosGetDefaultHashFunction(TSDB_DATA_TYPE_INT), false, HASH_NO_LOCK); pRuntimeEnv->pTableRetrieveTsMap = taosHashInit(numOfTables, taosGetDefaultHashFunction(TSDB_DATA_TYPE_INT), false, HASH_NO_LOCK);
...@@ -5990,6 +6006,9 @@ static SSDataBlock* doProjectOperation(void* param, bool* newgroup) { ...@@ -5990,6 +6006,9 @@ static SSDataBlock* doProjectOperation(void* param, bool* newgroup) {
STableQueryInfo* pTableQueryInfo = pRuntimeEnv->current; STableQueryInfo* pTableQueryInfo = pRuntimeEnv->current;
SSDataBlock* pBlock = pProjectInfo->existDataBlock; SSDataBlock* pBlock = pProjectInfo->existDataBlock;
// record table read rows
addTableReadRows(pRuntimeEnv, pBlock->info.tid, pBlock->info.rows);
pProjectInfo->existDataBlock = NULL; pProjectInfo->existDataBlock = NULL;
*newgroup = true; *newgroup = true;
...@@ -6036,6 +6055,9 @@ static SSDataBlock* doProjectOperation(void* param, bool* newgroup) { ...@@ -6036,6 +6055,9 @@ static SSDataBlock* doProjectOperation(void* param, bool* newgroup) {
break; break;
} }
// record table read rows
addTableReadRows(pRuntimeEnv, pBlock->info.tid, pBlock->info.rows);
// Return result of the previous group in the firstly. // Return result of the previous group in the firstly.
if (*newgroup) { if (*newgroup) {
if (pRes->info.rows > 0) { if (pRes->info.rows > 0) {
...@@ -10015,3 +10037,69 @@ void freeQueryAttr(SQueryAttr* pQueryAttr) { ...@@ -10015,3 +10037,69 @@ void freeQueryAttr(SQueryAttr* pQueryAttr) {
filterFreeInfo(pQueryAttr->pFilters); filterFreeInfo(pQueryAttr->pFilters);
} }
} }
// add table read rows count. pHashTables must not be NULL
void addTableReadRows(SQueryRuntimeEnv* pEnv, int32_t tid, int32_t rows) {
SHashObj* pHashObj = pEnv->pTablesRead;
int32_t limit = (int32_t)pEnv->pQueryAttr->limit.limit;
if (pHashObj == NULL) {
return ;
}
// read old value
int32_t v = 0;
int32_t* pv = (int32_t* )taosHashGet(pHashObj, &tid, sizeof(int32_t));
if (pv && *pv > 0) {
v = *pv;
}
bool over = v >= limit;
// add new and save
v += rows;
taosHashPut(pHashObj, &tid, sizeof(int32_t), &rows, sizeof(int32_t));
// update read table over cnt
if (!over && v >= limit) {
pEnv->cntTableReadOver += 1;
}
}
// tsdb scan table callback table or query is over. param is SQueryRuntimeEnv*
bool qReadOverCB(void* param, int8_t type, int32_t tid) {
SQueryRuntimeEnv* pEnv = (SQueryRuntimeEnv* )param;
if (pEnv->pTablesRead == NULL) {
return false;
}
// check query is over
if (pEnv->cntTableReadOver >= pEnv->pQueryAttr->tableGroupInfo.numOfTables) {
return true;
}
// if type is read_query can return
if (type == READ_QUERY) {
return false;
}
// read tid value
int32_t* pv = (int32_t* )taosHashGet(pEnv->pTablesRead, &tid, sizeof(int32_t));
if (pv == NULL) {
return false;
}
// compare
if (pEnv->pQueryAttr->limit.limit > 0 && *pv >= pEnv->pQueryAttr->limit.limit ) {
return true; // need data is read ok
}
return false;
}
// check query read is over, retur true over. param is SQueryRuntimeEnv*
bool queryReadOverCB(void* param) {
SQueryRuntimeEnv* pEnv = (SQueryRuntimeEnv* )param;
if (pEnv->cntTableReadOver >= pEnv->pQueryAttr->tableGroupInfo.numOfTables) {
return true;
}
return false;
}
\ No newline at end of file
...@@ -3843,7 +3843,7 @@ static YYACTIONTYPE yy_reduce( ...@@ -3843,7 +3843,7 @@ static YYACTIONTYPE yy_reduce(
yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n;
toTSDBType(yymsp[0].minor.yy0.type); toTSDBType(yymsp[0].minor.yy0.type);
SArray* A = tVariantListAppendToken(NULL, &yymsp[0].minor.yy0, -1, true); SArray* A = tVariantListAppendToken(NULL, &yymsp[0].minor.yy0, -1, false);
SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, NULL, A, TSDB_ALTER_TABLE_DROP_TAG_COLUMN, -1); SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, NULL, A, TSDB_ALTER_TABLE_DROP_TAG_COLUMN, -1);
setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
...@@ -3854,10 +3854,10 @@ static YYACTIONTYPE yy_reduce( ...@@ -3854,10 +3854,10 @@ static YYACTIONTYPE yy_reduce(
yymsp[-5].minor.yy0.n += yymsp[-4].minor.yy0.n; yymsp[-5].minor.yy0.n += yymsp[-4].minor.yy0.n;
toTSDBType(yymsp[-1].minor.yy0.type); toTSDBType(yymsp[-1].minor.yy0.type);
SArray* A = tVariantListAppendToken(NULL, &yymsp[-1].minor.yy0, -1, true); SArray* A = tVariantListAppendToken(NULL, &yymsp[-1].minor.yy0, -1, false);
toTSDBType(yymsp[0].minor.yy0.type); toTSDBType(yymsp[0].minor.yy0.type);
A = tVariantListAppendToken(A, &yymsp[0].minor.yy0, -1, true); A = tVariantListAppendToken(A, &yymsp[0].minor.yy0, -1, false);
SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-5].minor.yy0, NULL, A, TSDB_ALTER_TABLE_CHANGE_TAG_COLUMN, -1); SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-5].minor.yy0, NULL, A, TSDB_ALTER_TABLE_CHANGE_TAG_COLUMN, -1);
setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
...@@ -3868,7 +3868,7 @@ static YYACTIONTYPE yy_reduce( ...@@ -3868,7 +3868,7 @@ static YYACTIONTYPE yy_reduce(
yymsp[-6].minor.yy0.n += yymsp[-5].minor.yy0.n; yymsp[-6].minor.yy0.n += yymsp[-5].minor.yy0.n;
toTSDBType(yymsp[-2].minor.yy0.type); toTSDBType(yymsp[-2].minor.yy0.type);
SArray* A = tVariantListAppendToken(NULL, &yymsp[-2].minor.yy0, -1, true); SArray* A = tVariantListAppendToken(NULL, &yymsp[-2].minor.yy0, -1, false);
A = tVariantListAppend(A, &yymsp[0].minor.yy162, -1); A = tVariantListAppend(A, &yymsp[0].minor.yy162, -1);
SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-6].minor.yy0, NULL, A, TSDB_ALTER_TABLE_UPDATE_TAG_VAL, -1); SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-6].minor.yy0, NULL, A, TSDB_ALTER_TABLE_UPDATE_TAG_VAL, -1);
...@@ -3894,7 +3894,7 @@ static YYACTIONTYPE yy_reduce( ...@@ -3894,7 +3894,7 @@ static YYACTIONTYPE yy_reduce(
yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n;
toTSDBType(yymsp[0].minor.yy0.type); toTSDBType(yymsp[0].minor.yy0.type);
SArray* K = tVariantListAppendToken(NULL, &yymsp[0].minor.yy0, -1, true); SArray* K = tVariantListAppendToken(NULL, &yymsp[0].minor.yy0, -1, false);
SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, NULL, K, TSDB_ALTER_TABLE_DROP_COLUMN, TSDB_SUPER_TABLE); SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, NULL, K, TSDB_ALTER_TABLE_DROP_COLUMN, TSDB_SUPER_TABLE);
setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
...@@ -3919,7 +3919,7 @@ static YYACTIONTYPE yy_reduce( ...@@ -3919,7 +3919,7 @@ static YYACTIONTYPE yy_reduce(
yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n;
toTSDBType(yymsp[0].minor.yy0.type); toTSDBType(yymsp[0].minor.yy0.type);
SArray* A = tVariantListAppendToken(NULL, &yymsp[0].minor.yy0, -1, true); SArray* A = tVariantListAppendToken(NULL, &yymsp[0].minor.yy0, -1, false);
SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, NULL, A, TSDB_ALTER_TABLE_DROP_TAG_COLUMN, TSDB_SUPER_TABLE); SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, NULL, A, TSDB_ALTER_TABLE_DROP_TAG_COLUMN, TSDB_SUPER_TABLE);
setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
...@@ -3930,10 +3930,10 @@ static YYACTIONTYPE yy_reduce( ...@@ -3930,10 +3930,10 @@ static YYACTIONTYPE yy_reduce(
yymsp[-5].minor.yy0.n += yymsp[-4].minor.yy0.n; yymsp[-5].minor.yy0.n += yymsp[-4].minor.yy0.n;
toTSDBType(yymsp[-1].minor.yy0.type); toTSDBType(yymsp[-1].minor.yy0.type);
SArray* A = tVariantListAppendToken(NULL, &yymsp[-1].minor.yy0, -1, true); SArray* A = tVariantListAppendToken(NULL, &yymsp[-1].minor.yy0, -1, false);
toTSDBType(yymsp[0].minor.yy0.type); toTSDBType(yymsp[0].minor.yy0.type);
A = tVariantListAppendToken(A, &yymsp[0].minor.yy0, -1, true); A = tVariantListAppendToken(A, &yymsp[0].minor.yy0, -1, false);
SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-5].minor.yy0, NULL, A, TSDB_ALTER_TABLE_CHANGE_TAG_COLUMN, TSDB_SUPER_TABLE); SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-5].minor.yy0, NULL, A, TSDB_ALTER_TABLE_CHANGE_TAG_COLUMN, TSDB_SUPER_TABLE);
setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
...@@ -3944,7 +3944,7 @@ static YYACTIONTYPE yy_reduce( ...@@ -3944,7 +3944,7 @@ static YYACTIONTYPE yy_reduce(
yymsp[-6].minor.yy0.n += yymsp[-5].minor.yy0.n; yymsp[-6].minor.yy0.n += yymsp[-5].minor.yy0.n;
toTSDBType(yymsp[-2].minor.yy0.type); toTSDBType(yymsp[-2].minor.yy0.type);
SArray* A = tVariantListAppendToken(NULL, &yymsp[-2].minor.yy0, -1, true); SArray* A = tVariantListAppendToken(NULL, &yymsp[-2].minor.yy0, -1, false);
A = tVariantListAppend(A, &yymsp[0].minor.yy162, -1); A = tVariantListAppend(A, &yymsp[0].minor.yy162, -1);
SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-6].minor.yy0, NULL, A, TSDB_ALTER_TABLE_UPDATE_TAG_VAL, TSDB_SUPER_TABLE); SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-6].minor.yy0, NULL, A, TSDB_ALTER_TABLE_UPDATE_TAG_VAL, TSDB_SUPER_TABLE);
......
...@@ -186,9 +186,11 @@ static void *taosRecvUdpData(void *param) { ...@@ -186,9 +186,11 @@ static void *taosRecvUdpData(void *param) {
SUdpConn *pConn = param; SUdpConn *pConn = param;
struct sockaddr_in sourceAdd; struct sockaddr_in sourceAdd;
ssize_t dataLen; ssize_t dataLen;
int32_t msgLen;
unsigned int addLen; unsigned int addLen;
uint16_t port; uint16_t port;
SRecvInfo recvInfo; SRecvInfo recvInfo;
SRpcHead *pHead;
memset(&sourceAdd, 0, sizeof(sourceAdd)); memset(&sourceAdd, 0, sizeof(sourceAdd));
addLen = sizeof(sourceAdd); addLen = sizeof(sourceAdd);
...@@ -218,6 +220,13 @@ static void *taosRecvUdpData(void *param) { ...@@ -218,6 +220,13 @@ static void *taosRecvUdpData(void *param) {
continue; continue;
} }
pHead = (SRpcHead *)msg;
msgLen = (int32_t)htonl((uint32_t)pHead->msgLen);
if (dataLen < msgLen) {
tError("%s recvfrom failed(%s): dataLen: %ld, msgLen: %d", pConn->label, strerror(errno), (long)dataLen, msgLen);
continue;
}
int32_t size = dataLen + tsRpcOverhead; int32_t size = dataLen + tsRpcOverhead;
char *tmsg = malloc(size); char *tmsg = malloc(size);
if (NULL == tmsg) { if (NULL == tmsg) {
......
...@@ -39,6 +39,9 @@ ...@@ -39,6 +39,9 @@
.tid = (_checkInfo)->tableId.tid, \ .tid = (_checkInfo)->tableId.tid, \
.uid = (_checkInfo)->tableId.uid}) .uid = (_checkInfo)->tableId.uid})
#define IS_END_BLOCK(cur, numOfBlocks, ascTrav) \
((cur->slot == numOfBlocks - 1 && ascTrav) || (cur->slot == 0 && !ascTrav))
// limit offset start optimization for rows read over this value // limit offset start optimization for rows read over this value
#define OFFSET_SKIP_THRESHOLD 5000 #define OFFSET_SKIP_THRESHOLD 5000
...@@ -153,6 +156,10 @@ typedef struct STsdbQueryHandle { ...@@ -153,6 +156,10 @@ typedef struct STsdbQueryHandle {
SArray *prev; // previous row which is before than time window SArray *prev; // previous row which is before than time window
SArray *next; // next row which is after the query time window SArray *next; // next row which is after the query time window
SIOCostSummary cost; SIOCostSummary cost;
// callback
readover_callback readover_cb;
void* param;
} STsdbQueryHandle; } STsdbQueryHandle;
typedef struct STableGroupSupporter { typedef struct STableGroupSupporter {
...@@ -182,6 +189,7 @@ static void* doFreeColumnInfoData(SArray* pColumnInfoData); ...@@ -182,6 +189,7 @@ static void* doFreeColumnInfoData(SArray* pColumnInfoData);
static void* destroyTableCheckInfo(SArray* pTableCheckInfo); static void* destroyTableCheckInfo(SArray* pTableCheckInfo);
static bool tsdbGetExternalRow(TsdbQueryHandleT pHandle); static bool tsdbGetExternalRow(TsdbQueryHandleT pHandle);
static int32_t tsdbQueryTableList(STable* pTable, SArray* pRes, void* filterInfo); static int32_t tsdbQueryTableList(STable* pTable, SArray* pRes, void* filterInfo);
static STableBlockInfo* moveToNextDataBlockInCurrentFile(STsdbQueryHandle* pQueryHandle);
static void tsdbInitDataBlockLoadInfo(SDataBlockLoadInfo* pBlockLoadInfo) { static void tsdbInitDataBlockLoadInfo(SDataBlockLoadInfo* pBlockLoadInfo) {
pBlockLoadInfo->slot = -1; pBlockLoadInfo->slot = -1;
...@@ -2560,26 +2568,25 @@ static int32_t createDataBlocksInfo(STsdbQueryHandle* pQueryHandle, int32_t numO ...@@ -2560,26 +2568,25 @@ static int32_t createDataBlocksInfo(STsdbQueryHandle* pQueryHandle, int32_t numO
static int32_t getFirstFileDataBlock(STsdbQueryHandle* pQueryHandle, bool* exists); static int32_t getFirstFileDataBlock(STsdbQueryHandle* pQueryHandle, bool* exists);
static int32_t getDataBlockRv(STsdbQueryHandle* pQueryHandle, STableBlockInfo* pNext, bool *exists) { static int32_t getDataBlockRv(STsdbQueryHandle* pQueryHandle, STableBlockInfo* pNext, bool *exists) {
int32_t step = ASCENDING_TRAVERSE(pQueryHandle->order)? 1 : -1;
SQueryFilePos* cur = &pQueryHandle->cur; SQueryFilePos* cur = &pQueryHandle->cur;
while(1) { while(pNext) {
int32_t code = loadFileDataBlock(pQueryHandle, pNext->compBlock, pNext->pTableCheckInfo, exists); int32_t code = loadFileDataBlock(pQueryHandle, pNext->compBlock, pNext->pTableCheckInfo, exists);
// load error or have data, return
if (code != TSDB_CODE_SUCCESS || *exists) { if (code != TSDB_CODE_SUCCESS || *exists) {
return code; return code;
} }
if ((cur->slot == pQueryHandle->numOfBlocks - 1 && ASCENDING_TRAVERSE(pQueryHandle->order)) || // no data, continue to find next block util have data
(cur->slot == 0 && !ASCENDING_TRAVERSE(pQueryHandle->order))) { if (IS_END_BLOCK(cur, pQueryHandle->numOfBlocks, ASCENDING_TRAVERSE(pQueryHandle->order))) {
// all data blocks in current file has been checked already, try next file if exists // all data blocks in current file has been checked already, try next file if exists
return getFirstFileDataBlock(pQueryHandle, exists); return getFirstFileDataBlock(pQueryHandle, exists);
} else { // next block of the same file } else { // next block of the same file
cur->slot += step; pNext = moveToNextDataBlockInCurrentFile(pQueryHandle);
cur->mixBlock = false;
cur->blockCompleted = false;
pNext = &pQueryHandle->pDataBlockInfo[cur->slot];
} }
} }
return TSDB_CODE_SUCCESS; // pNext == NULL no other blocks to move to
} }
static int32_t getFirstFileDataBlock(STsdbQueryHandle* pQueryHandle, bool* exists) { static int32_t getFirstFileDataBlock(STsdbQueryHandle* pQueryHandle, bool* exists) {
...@@ -2594,6 +2601,15 @@ static int32_t getFirstFileDataBlock(STsdbQueryHandle* pQueryHandle, bool* exist ...@@ -2594,6 +2601,15 @@ static int32_t getFirstFileDataBlock(STsdbQueryHandle* pQueryHandle, bool* exist
STsdbCfg* pCfg = &pQueryHandle->pTsdb->config; STsdbCfg* pCfg = &pQueryHandle->pTsdb->config;
STimeWindow win = TSWINDOW_INITIALIZER; STimeWindow win = TSWINDOW_INITIALIZER;
// check query scan data is over for limit query
if (pQueryHandle->readover_cb && pQueryHandle->readover_cb(pQueryHandle->param, READ_QUERY, -1)) {
// query scan data is over , no need read more
cur->fid = INT32_MIN;
*exists = false;
tsdbInfo("%p LIMIT_READ query is over and stop read. tables=%d qId=0x%"PRIx64, pQueryHandle, numOfTables, pQueryHandle->qId);
return TSDB_CODE_SUCCESS;
}
while (true) { while (true) {
tsdbRLockFS(REPO_FS(pQueryHandle->pTsdb)); tsdbRLockFS(REPO_FS(pQueryHandle->pTsdb));
...@@ -2670,20 +2686,52 @@ static int32_t getFirstFileDataBlock(STsdbQueryHandle* pQueryHandle, bool* exist ...@@ -2670,20 +2686,52 @@ static int32_t getFirstFileDataBlock(STsdbQueryHandle* pQueryHandle, bool* exist
return getDataBlockRv(pQueryHandle, pBlockInfo, exists); return getDataBlockRv(pQueryHandle, pBlockInfo, exists);
} }
static bool isEndFileDataBlock(SQueryFilePos* cur, int32_t numOfBlocks, bool ascTrav) { static STableBlockInfo* moveToNextDataBlockInCurrentFile(STsdbQueryHandle* pQueryHandle) {
assert(cur != NULL && numOfBlocks > 0);
return (cur->slot == numOfBlocks - 1 && ascTrav) || (cur->slot == 0 && !ascTrav);
}
static void moveToNextDataBlockInCurrentFile(STsdbQueryHandle* pQueryHandle) {
int32_t step = ASCENDING_TRAVERSE(pQueryHandle->order)? 1 : -1; int32_t step = ASCENDING_TRAVERSE(pQueryHandle->order)? 1 : -1;
SQueryFilePos* cur = &pQueryHandle->cur; SQueryFilePos* cur = &pQueryHandle->cur;
if (IS_END_BLOCK(cur, pQueryHandle->numOfBlocks, ASCENDING_TRAVERSE(pQueryHandle->order))) {
return NULL;
}
assert(cur->slot < pQueryHandle->numOfBlocks && cur->slot >= 0); assert(cur->slot < pQueryHandle->numOfBlocks && cur->slot >= 0);
cur->slot += step; cur->slot += step;
cur->mixBlock = false; cur->mixBlock = false;
cur->blockCompleted = false; cur->blockCompleted = false;
// no callback check
STableBlockInfo* pBlockInfo = &pQueryHandle->pDataBlockInfo[cur->slot];
if(pQueryHandle->readover_cb == NULL) {
return pBlockInfo;
}
// have callback check
int32_t tid = -1;
bool over = false;
do {
// tid changed, re-get over of tid status
if(tid != pBlockInfo->pTableCheckInfo->tableId.tid) {
tid = pBlockInfo->pTableCheckInfo->tableId.tid;
over = pQueryHandle->readover_cb(pQueryHandle->param, READ_TABLE, pBlockInfo->pTableCheckInfo->tableId.tid);
if (!over) // this tid not over
return pBlockInfo;
}
//
// this tid is over, skip all blocks of this tid in following
//
// check end
if (IS_END_BLOCK(cur, pQueryHandle->numOfBlocks, ASCENDING_TRAVERSE(pQueryHandle->order)))
return NULL;
// move next
cur->slot += step;
cur->mixBlock = false;
cur->blockCompleted = false;
pBlockInfo = &pQueryHandle->pDataBlockInfo[cur->slot];
} while(1);
return NULL;
} }
int32_t tsdbGetFileBlocksDistInfo(TsdbQueryHandleT* queryHandle, STableBlockDist* pTableBlockInfo) { int32_t tsdbGetFileBlocksDistInfo(TsdbQueryHandleT* queryHandle, STableBlockDist* pTableBlockInfo) {
...@@ -2816,11 +2864,14 @@ static int32_t getDataBlocksInFiles(STsdbQueryHandle* pQueryHandle, bool* exists ...@@ -2816,11 +2864,14 @@ static int32_t getDataBlocksInFiles(STsdbQueryHandle* pQueryHandle, bool* exists
// current block is empty, try next block in file // current block is empty, try next block in file
// all data blocks in current file has been checked already, try next file if exists // all data blocks in current file has been checked already, try next file if exists
if (isEndFileDataBlock(cur, pQueryHandle->numOfBlocks, ASCENDING_TRAVERSE(pQueryHandle->order))) { if (IS_END_BLOCK(cur, pQueryHandle->numOfBlocks, ASCENDING_TRAVERSE(pQueryHandle->order))) {
return getFirstFileDataBlock(pQueryHandle, exists); return getFirstFileDataBlock(pQueryHandle, exists);
} else { } else {
moveToNextDataBlockInCurrentFile(pQueryHandle); // get next block in currentfile. return NULL if no block in current file
STableBlockInfo* pNext = &pQueryHandle->pDataBlockInfo[cur->slot]; STableBlockInfo* pNext = moveToNextDataBlockInCurrentFile(pQueryHandle);
if (pNext == NULL) // file end
return getFirstFileDataBlock(pQueryHandle, exists);
else
return getDataBlockRv(pQueryHandle, pNext, exists); return getDataBlockRv(pQueryHandle, pNext, exists);
} }
} }
...@@ -4600,3 +4651,11 @@ int64_t tsdbSkipOffset(TsdbQueryHandleT queryHandle) { ...@@ -4600,3 +4651,11 @@ int64_t tsdbSkipOffset(TsdbQueryHandleT queryHandle) {
} }
return 0; return 0;
} }
// add scan table need callback
void tsdbAddScanCallback(TsdbQueryHandleT* queryHandle, readover_callback callback, void* param) {
STsdbQueryHandle* pQueryHandle = (STsdbQueryHandle*)queryHandle;
pQueryHandle->readover_cb = callback;
pQueryHandle->param = param;
return ;
}
\ No newline at end of file
###################################################################
# Copyright (c) 2021 by TAOS Technologies, Inc.
# All rights reserved.
#
# This file is proprietary and confidential to TAOS Technologies.
# No part of this file may be reproduced, stored, transmitted,
# disclosed or used in any form or by any means other than as
# expressly provided by the written permission from Jianhui Tao
#
###################################################################
# -*- coding: utf-8 -*-
import sys
from util.log import *
from util.cases import *
from util.sql import *
class TDTestCase:
def caseDescription(self):
'''
case1<ganlin zhao>: [TD-13246] Coredump when parentheses appear before the insert_sql
'''
return
def init(self, conn, logSql):
tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor(), logSql)
self._conn = conn
def run(self):
print("running {}".format(__file__))
tdSql.prepare()
tdSql.execute('create stable st(ts timestamp , value int) tags (ind int)')
tdSql.execute('create table ctb using st tags(1)')
tdSql.execute('create table tb (ts timestamp, value int)')
tdSql.query('insert into ctb values(now, 1)');
tdSql.query('insert into tb values(now, 1)');
tdSql.error('(insert into ctb values(now, 1)');
tdSql.error('(insert into tb values(now, 1)');
tdSql.error('(insert into ctb values');
tdSql.error('(insert into ctb');
tdSql.error('(insert into');
tdSql.error('(insert');
tdSql.error('(');
def stop(self):
tdSql.close()
tdLog.success("%s successfully executed" % __file__)
tdCases.addWindows(__file__, TDTestCase())
tdCases.addLinux(__file__, TDTestCase())
#!/bin/bash #!/bin/bash
function stopTaosd {
echo "Stop taosd" function stopProcess {
sudo systemctl stop taosd || echo 'no sudo or systemctl or stop fail' echo "Stop $1"
PID=`ps -ef|grep -w taosd | grep -v grep | awk '{print $2}'` sudo systemctl stop $1 || echo 'no sudo or systemctl or stop fail'
PID=`ps -ef|grep -w $1 | grep -v grep | awk '{print $2}'`
while [ -n "$PID" ] while [ -n "$PID" ]
do do
pkill -TERM -x taosd pkill -TERM -x $1
sleep 1 sleep 1
PID=`ps -ef|grep -w taosd | grep -v grep | awk '{print $2}'` PID=`ps -ef|grep -w $1 | grep -v grep | awk '{print $2}'`
done done
} }
stopTaosd
stopProcess taosadapter
stopProcess taosd
rm -rf /var/lib/taos/* rm -rf /var/lib/taos/*
rm -rf /var/log/taos/* rm -rf /var/log/taos/*
nohup taosd -c /etc/taos/ > /dev/null 2>&1 &
nohup taosadapter -c /etc/taos/taosadapter.toml > /dev/null 2>&1 & curDir=$(dirname $(readlink -f "$0"))
taosdConfig=$curDir/../../../../packaging/cfg
adapterConfig=$curDir/../../../../src/plugins/taosadapter/example/config/taosadapter.toml
nohup taosd -c ${taosdConfig} > /dev/null 2>&1 &
nohup taosadapter -c ${adapterConfig} > /dev/null 2>&1 &
sleep 10 sleep 10
cd ../../../../ cd ../../../../
......
...@@ -7,3 +7,4 @@ python3 ./test.py -f 2-query/ts_2016.py ...@@ -7,3 +7,4 @@ python3 ./test.py -f 2-query/ts_2016.py
python3 ./test.py -f 2-query/escape.py python3 ./test.py -f 2-query/escape.py
python3 ./test.py -f 2-query/function_mavg.py python3 ./test.py -f 2-query/function_mavg.py
python3 ./test.py -f 2-query/func_compare.py python3 ./test.py -f 2-query/func_compare.py
python3 ./test.py -f 2-query/TD-13246.py
import hudson.model.Result
import hudson.model.*;
import jenkins.model.CauseOfInterruption
node {
}
def sync_source() {
sh '''
hostname
date
'''
sh '''
cd ${WKC}
[ -f src/connector/grafanaplugin/README.md ] && rm -f src/connector/grafanaplugin/README.md > /dev/null || echo "failed to remove grafanaplugin README.md"
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 if (env.CHANGE_TARGET == '2.4') {
sh '''
cd ${WKC}
git checkout 2.4
'''
} else {
sh '''
cd ${WKC}
git checkout develop
'''
}
}
sh'''
cd ${WKC}
git remote prune origin
[ -f src/connector/grafanaplugin/README.md ] && rm -f src/connector/grafanaplugin/README.md > /dev/null || echo "failed to remove grafanaplugin README.md"
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 if (env.CHANGE_TARGET == '2.4') {
sh '''
cd ${WK}
git checkout 2.4
'''
} else {
sh '''
cd ${WK}
git checkout develop
'''
}
}
sh '''
cd ${WK}
git pull >/dev/null
export TZ=Asia/Harbin
date
git clean -dfx
'''
}
def pre_test() {
sync_source()
sh '''
cd ${WK}
mkdir -p debug
cd debug
go env -w GOPROXY=https://goproxy.cn,direct
go env -w GO111MODULE=on
cmake .. -DBUILD_HTTP=false -DBUILD_TOOLS=true > /dev/null
make -j8 >/dev/null
'''
return 1
}
def pre_test_mac() {
sync_source()
sh '''
cd ${WK}
mkdir -p debug
cd debug
go env -w GOPROXY=https://goproxy.cn,direct
go env -w GO111MODULE=on
cmake .. -DBUILD_TOOLS=false > /dev/null
make -j8 >/dev/null
'''
return 1
}
pipeline {
agent {label " dispatcher "}
options { skipDefaultCheckout() }
environment{
WK = '/var/data/jenkins/workspace/TDinternal'
WKC = '/var/data/jenkins/workspace/TDinternal/community'
LOGDIR = '/var/data/jenkins/workspace/log'
}
stages {
stage ('pre_build') {
steps {
sh '''
date
pwd
env
hostname
'''
}
}
stage ('Parallel build stage') {
//only build pr
options { skipDefaultCheckout() }
when {
allOf {
changeRequest()
not { expression { env.CHANGE_BRANCH =~ /docs\// }}
}
}
parallel {
stage ('dispatcher sync source') {
steps {
timeout(time: 20, unit: 'MINUTES') {
sync_source()
script {
sh '''
echo "dispatcher ready"
date
'''
}
}
}
}
stage ('build worker01') {
agent {label " worker01 "}
steps {
timeout(time: 20, unit: 'MINUTES') {
pre_test()
script {
sh '''
echo "worker01 build done"
date
'''
}
}
}
}
stage ('build worker02') {
agent {label " worker02 "}
steps {
timeout(time: 20, unit: 'MINUTES') {
pre_test()
script {
sh '''
echo "worker02 build done"
date
'''
}
}
}
}
stage ('build worker03') {
agent {label " worker03 "}
steps {
timeout(time: 20, unit: 'MINUTES') {
pre_test()
script {
sh '''
echo "worker03 build done"
date
'''
}
}
}
}
stage ('build worker04') {
agent {label " worker04 "}
steps {
timeout(time: 20, unit: 'MINUTES') {
pre_test()
script {
sh '''
echo "worker04 build done"
date
'''
}
}
}
}
stage ('build worker05') {
agent {label " worker05 "}
steps {
timeout(time: 20, unit: 'MINUTES') {
pre_test()
script {
sh '''
echo "worker05 build done"
date
'''
}
}
}
}
}
}
stage('run test') {
parallel {
stage ('build worker06_arm64') {
agent {label " worker06_arm64 "}
steps {
timeout(time: 20, unit: 'MINUTES') {
pre_test()
script {
sh '''
echo "worker06_arm64 build done"
date
'''
}
}
}
}
stage ('build worker07_arm64') {
agent {label " worker07_arm64 "}
steps {
timeout(time: 20, unit: 'MINUTES') {
pre_test()
script {
sh '''
echo "worker07_arm64 build done"
date
'''
}
}
}
}
stage ('build Mac_catalina ') {
agent {label " Mac_catalina "}
steps {
timeout(time: 20, unit: 'MINUTES') {
pre_test_mac()
script {
sh '''
echo "Mac_catalina build done"
date
'''
}
}
}
}
stage('run cases') {
steps {
sh '''
date
hostname
'''
timeout(time: 60, unit: 'MINUTES') {
sh '''
date
cd ${WKC}/tests/parallel_test
time ./run.sh -m m.json -t cases.task -l ${LOGDIR} -b ${BRANCH_NAME}
date
hostname
'''
}
}
}
}
}
}
post {
success {
emailext (
subject: "PR-result: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]' SUCCESS",
body: """<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
</head>
<body leftmargin="8" marginwidth="0" topmargin="8" marginheight="4" offset="0">
<table width="95%" cellpadding="0" cellspacing="0" style="font-size: 16pt; font-family: Tahoma, Arial, Helvetica, sans-serif">
<tr>
<td>
<br/>
<b><font color="#0B610B"><font size="6">构建信息</font></font></b>
<hr size="2" width="100%" align="center" />
</td>
</tr>
<tr>
<td>
<ul>
<div style="font-size:18px">
<li>构建名称>>分支:${env.BRANCH_NAME}</li>
<li>构建结果:<span style="color:green"> Successful </span></li>
<li>构建编号:${BUILD_NUMBER}</li>
<li>触发用户:${env.CHANGE_AUTHOR}</li>
<li>提交信息:${env.CHANGE_TITLE}</li>
<li>构建地址:<a href=${BUILD_URL}>${BUILD_URL}</a></li>
<li>构建日志:<a href=${BUILD_URL}console>${BUILD_URL}console</a></li>
</div>
</ul>
</td>
</tr>
</table>
</body>
</html>""",
to: "${env.CHANGE_AUTHOR_EMAIL}",
from: "support@taosdata.com"
)
}
failure {
emailext (
subject: "PR-result: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]' FAIL",
body: """<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
</head>
<body leftmargin="8" marginwidth="0" topmargin="8" marginheight="4" offset="0">
<table width="95%" cellpadding="0" cellspacing="0" style="font-size: 16pt; font-family: Tahoma, Arial, Helvetica, sans-serif">
<tr>
<td>
<br/>
<b><font color="#0B610B"><font size="6">构建信息</font></font></b>
<hr size="2" width="100%" align="center" />
</td>
</tr>
<tr>
<td>
<ul>
<div style="font-size:18px">
<li>构建名称>>分支:${env.BRANCH_NAME}</li>
<li>构建结果:<span style="color:red"> Failure </span></li>
<li>构建编号:${BUILD_NUMBER}</li>
<li>触发用户:${env.CHANGE_AUTHOR}</li>
<li>提交信息:${env.CHANGE_TITLE}</li>
<li>构建地址:<a href=${BUILD_URL}>${BUILD_URL}</a></li>
<li>构建日志:<a href=${BUILD_URL}console>${BUILD_URL}console</a></li>
</div>
</ul>
</td>
</tr>
</table>
</body>
</html>""",
to: "${env.CHANGE_AUTHOR_EMAIL}",
from: "support@taosdata.com"
)
}
}
}
113,,pytest,python3 test.py -f update/append_commit_data.py
# 20,,pytest,insert/retentionpolicy.py change date time
368,,develop-test/3-connectors/java,bash test.sh
299,,pytest,python3 test.py -f update/merge_commit_data-0.py
290,,pytest,python3 test.py -f update/merge_commit_data.py
263,,script,./test.sh -f general/stream/stream_3.sim
259,,script,./test.sh -f general/stream/restart_stream.sim
241,,pytest,python3 test.py -f update/merge_commit_data2.py
224,,pytest,python3 test.py -f query/queryNullValueTest.py
221,,pytest,python3 test.py -f query/nestedQuery/nestedQuery.py
220,,pytest,python3 test.py -f update/merge_commit_data2_update0.py
208,,pytest,python3 test.py -f update/merge_commit_last.py
203,,pytest,python3 test.py -f update/merge_commit_last-0.py
201,,pytest,python3 ./test.py -f tsdb/tsdbComp.py
191,,pytest,python3 test.py -f stream/stream1.py
188,,pytest,python3 test.py -f stream/stream2.py
151,,script,./test.sh -f unique/vnode/replica3_repeat.sim
143,,script,./test.sh -f general/stream/stream_restart.sim
138,,pytest,python3 test.py -f insert/randomNullCommit.py
132,,pytest,python3 test.py -f functions/function_interp.py
131,,system-test,bash 3-connectors/python/test.sh
128,,develop-test,bash 3-connectors/python/test.sh
127,,script,./test.sh -f general/stream/table_replica1_vnoden.sim
127,,script,./test.sh -f general/stream/table_del.sim
127,,script,./test.sh -f general/stream/metrics_replica1_vnoden.sim
127,,script,./test.sh -f general/stream/metrics_del.sim
127,,pytest,python3 test.py -f query/queryConnection.py
121,2,script,./test.sh -f unique/cluster/balance3.sim
114,,script,./test.sh -f general/db/alter_tables_d2.sim
113,,pytest,python3 test.py -f update/append_commit_last.py
111,,script,./test.sh -f unique/vnode/replica2_repeat.sim
111,,script,./test.sh -f unique/vnode/many.sim
110,,pytest,python3 test.py -f update/append_commit_last-0.py
109,,script,./test.sh -f unique/cluster/vgroup100.sim
102,,script,./test.sh -f general/parser/selectResNum.sim
99,,script,./test.sh -f general/parser/repeatAlter.sim
89,,script,./test.sh -f unique/big/balance.sim
86,,script,./test.sh -f unique/dnode/balance1.sim
86,,script,./test.sh -f unique/cluster/balance2.sim
85,,pytest,python3 test.py -f insert/boundary2.py
83,,script,./test.sh -f general/parser/limit2.sim
83,,script,./test.sh -f general/parser/limit1_tblocks100.sim
82,,script,./test.sh -f general/parser/limit1.sim
82,,pytest,python3 test.py -f query/last_row_cache.py
### 81,,develop-test,bash 3-connectors/c#/test.sh
80,,system-test,bash 3-connectors/c#/test.sh
80,,develop-test,bash 3-connectors/nodejs/test.sh
79,,script,./test.sh -f general/db/alter_tables_v4.sim
79,,pytest,python3 test.py -f insert/verifyMemToDiskCrash.py
78,2,script,./test.sh -f unique/dnode/balance3.sim
78,,script,./test.sh -f unique/cluster/balance1.sim
### 77,,system-test,bash 3-connectors/nodejs/test.sh
76,,script,./test.sh -f unique/import/replica3.sim
76,,script,./test.sh -f unique/db/replica_add13.sim
75,,script,./test.sh -f unique/db/replica_reduce32.sim
75,,script,./test.sh -f unique/db/replica_add23.sim
75,,script,./test.sh -f unique/account/usage.sim
74,,script,./test.sh -f unique/arbitrator/dn3_mn1_replica_change.sim
74,,script,./test.sh -f unique/arbitrator/dn3_mn1_r3_vnode_delDir.sim
71,,script,./test.sh -f unique/mnode/mgmtr2.sim
69,,script,./test.sh -f unique/import/replica3.sim
69,,script,./test.sh -f unique/arbitrator/check_cluster_cfg_para.sim
69,,pytest,python3 test.py -f functions/function_sample.py -r 1
68,,script,./test.sh -f unique/mnode/mgmt20.sim
68,,script,./test.sh -f general/parser/groupby.sim
67,,script,./test.sh -f unique/dnode/data1.sim
67,,pytest,python3 test.py -f client/taoshellCheckCase.py
66,,script,./test.sh -f unique/db/delete.sim
66,,script,./test.sh -f unique/account/authority.sim
66,,script,./test.sh -f general/db/alter_tables_v1.sim
65,,script,./test.sh -f unique/vnode/replica3_basic.sim
65,,script,./test.sh -f unique/import/replica2.sim
65,2,script,./test.sh -f unique/dnode/m2.sim
65,,script,./test.sh -f unique/db/delete_part.sim
65,,script,./test.sh -f issue/TD-2713.sim
64,,script,./test.sh -f unique/arbitrator/dn3_mn1_vnode_delDir.sim
63,2,script,./test.sh -f unique/dnode/m3.sim
63,,script,./test.sh -f unique/db/replica_reduce31.sim
63,,script,./test.sh -f unique/arbitrator/dn3_mn1_vnode_noCorruptFile_offline.sim
63,,script,./test.sh -f general/parser/where.sim
63,,script,./test.sh -f general/parser/union.sim
63,,pytest,python3 test.py -f stream/new.py
62,,script,./test.sh -f unique/dnode/vnode_clean.sim
61,,script,./test.sh -f unique/db/replica_part.sim
61,,pytest,python3 test.py -f stream/cqSupportBefore1970.py
60,,script,./test.sh -f unique/vnode/replica2_basic2.sim
60,,script,./test.sh -f general/parser/first_last.sim
60,,script,./test.sh -f general/db/delete_reuse1.sim
60,,pytest,python3 test.py -f tools/taosdemoAllTest/TD-5213/insert4096columns_not_use_taosdemo.py
60,,pytest,python3 test.py -f stream/sys.py
59,,script,./test.sh -f unique/import/replica2.sim
59,,script,./test.sh -f unique/dnode/balance2.sim
59,,script,./test.sh -f general/parser/projection_limit_offset.sim
58,,script,./test.sh -f unique/dnode/balancex.sim
58,,pytest,python3 test.py -f stream/table_1.py
57,,script,./test.sh -f unique/dnode/offline2.sim
57,,script,./test.sh -f unique/arbitrator/replica_changeWithArbitrator.sim
57,,script,./test.sh -f unique/arbitrator/dn3_mn1_replica_change_dropDnod.sim
57,,script,./test.sh -f general/db/delete_writing1.sim
56,,script,./test.sh -f general/parser/commit.sim
55,,script,./test.sh -f unique/dnode/remove2.sim
55,,script,./test.sh -f unique/dnode/remove1.sim
55,,script,./test.sh -f general/db/delete_reusevnode.sim
55,,pytest,python3 test.py -f stream/metric_n.py
55,,develop-test,python3 ./test.py -f 1-insert/batchInsert.py
,,pytest,python3 ./test.py -f functions/function_elapsed.py
,,pytest,python3 ./test.py -f alter/alterBackQuoteCol.py
# ,,pytest,python3 ./test.py -f ../system-test/0-management/1-stable/create_col_tag.py no such file
# ,,pytest,python3 ./test.py -f ../develop-test/0-management/3-tag/json_tag.py no such file
,,develop-test,python3 ./test.py -f 2-query/TD-13246.py
54,,script,./test.sh -f unique/arbitrator/dn3_mn1_vnode_nomaster.sim
54,,script,./test.sh -f unique/arbitrator/dn3_mn1_r2_vnode_delDir.sim
54,,script,./test.sh -f unique/arbitrator/dn3_mn1_multiCreateDropTable.sim
54,,script,./test.sh -f general/parser/sliding.sim
54,,script,./test.sh -f general/parser/interp_full.sim
54,,pytest,python3 test.py -f stream/table_n.py
54,,pytest,python3 test.py -f stream/metric_1.py
53,,script,./test.sh -f unique/mnode/mgmt26.sim
53,,script,./test.sh -f unique/mnode/mgmt23.sim
53,,script,./test.sh -f unique/mnode/mgmt22.sim
53,,script,./test.sh -f unique/db/replica_add12.sim
# 53,,pytest,python3 test.py -f tools/taosdemoAllTest/taosdemoTestInsertWithJsonSml.py
52,,script,./test.sh -f unique/account/pass_alter.sim
52,,script,./test.sh -f general/parser/topbot.sim
52,,script,./test.sh -f general/parser/join_manyblocks.sim
51,,script,./test.sh -f unique/dnode/reason.sim
51,,script,./test.sh -f unique/cluster/alter.sim
50,,script,./test.sh -f unique/mnode/mgmt34.sim
50,,script,./test.sh -f unique/dnode/datatrans_3node_2.sim
49,,script,./test.sh -f unique/db/commit.sim
48,,script,./test.sh -f unique/dnode/datatrans_3node.sim
48,,script,./test.sh -f unique/big/tcp.sim
48,,script,./test.sh -f general/parser/nestquery.sim
48,,script,./test.sh -f general/parser/col_arithmetic_operation.sim
48,,pytest,python3 test.py -f query/queryStateWindow.py
47,,script,./test.sh -f unique/stable/balance_replica1.sim
47,,script,./test.sh -f unique/migrate/mn2_vn2_repl2_rmMnodeVnodeDir.sim
47,,script,./test.sh -f unique/migrate/mn2_vn2_repl2_rmMnodeDir.sim
47,,script,./test.sh -f unique/dnode/monitor.sim
47,,script,./test.sh -f unique/big/maxvnodes.sim
47,,pytest,python3 test.py -f tools/taosdemoAllTest/NanoTestCase/taosdemoTestSupportNanosubscribe.py
45,,script,./test.sh -f unique/mnode/mgmt24.sim
45,,pytest,python3 test.py -f tools/taosdemoAllTest/TD-5213/insertSigcolumnsNum4096.py
44,,script,./test.sh -f unique/vnode/replica3_vgroup.sim
44,,script,./test.sh -f unique/mnode/mgmt33.sim
44,,pytest,python3 test.py -f wal/sdbComp.py
43,,script,./test.sh -f unique/migrate/mn2_vn2_repl2_rmVnodeDir.sim
43,,script,./test.sh -f unique/dnode/offline1.sim
43,,script,./test.sh -f general/import/replica1.sim
43,,pytest,python3 test.py -f query/select_last_crash.py
43,,pytest,python3 test.py -f import_merge/import_update_2.py
42,,script,./test.sh -f unique/dnode/monitor_bug.sim
42,,script,./test.sh -f unique/arbitrator/sync_replica3_alterTable_drop.sim
42,,script,./test.sh -f general/wal/kill.sim
41,,script,./test.sh -f unique/dnode/lossdata.sim
41,,script,./test.sh -f unique/arbitrator/sync_replica3_dropDb.sim
41,,script,./test.sh -f unique/arbitrator/sync_replica2_alterTable_drop.sim
41,,script,./test.sh -f general/alter/count.sim
# 41,,pytest,python3 test.py -f tools/taosdemoAllTest/taosdemoTestQueryWithJson.py
41,,pytest,python3 test.py -f import_merge/import_update_0.py
40,,script,./test.sh -f unique/arbitrator/sync_replica3_dropTable.sim
40,,script,./test.sh -f unique/arbitrator/sync_replica3_alterTable_add.sim
40,,script,./test.sh -f unique/arbitrator/sync_replica2_dropTable.sim
39,,script,./test.sh -f unique/mnode/mgmt25.sim
39,,script,./test.sh -f unique/arbitrator/offline_replica3_alterTable_online.sim
39,,script,./test.sh -f general/wal/kill.sim
39,,script,./test.sh -f general/db/alter_vgroups.sim
39,,pytest,python3 test.py -f update/allow_update.py
# 39,,pytest,python3 test.py -f tools/taosdemoAllTest/taosdemoTestInsertWithJsonStmt.py
39,,pytest,python3 test.py -f query/last_cache.py
38,,script,./test.sh -f unique/dnode/offline3.sim
38,,script,./test.sh -f unique/arbitrator/sync_replica2_dropDb.sim
38,,script,./test.sh -f general/table/delete_reuse2.sim
38,,script,./test.sh -f general/insert/insert_drop.sim
37,,script,./test.sh -f unique/mnode/mgmt30.sim
37,,script,./test.sh -f unique/column/replica3.sim
37,,script,./test.sh -f unique/arbitrator/offline_replica2_createTable_online.sim
37,,script,./test.sh -f unique/arbitrator/offline_replica2_alterTable_online.sim
37,,script,./test.sh -f general/table/delete_reuse1.sim
37,,script,./test.sh -f general/db/delete_reuse2.sim
36,,script,./test.sh -f unique/stable/replica3_vnode3.sim
36,,script,./test.sh -f unique/stable/dnode2_stop.sim
36,,script,./test.sh -f unique/arbitrator/sync_replica2_alterTable_add.sim
36,,script,./test.sh -f unique/arbitrator/offline_replica3_createTable_online.sim
36,,script,./test.sh -f unique/arbitrator/offline_replica2_dropTable_online.sim
36,,script,./test.sh -f general/parser/tbnameIn.sim
36,,pytest,python3 test.py -f tools/taosdumpTestNanoSupport.py
35,,script,./test.sh -f unique/migrate/mn2_vn2_repl2_rmMnodeVnodeDir_stopAll_starAll.sim
35,,script,./test.sh -f unique/arbitrator/offline_replica3_alterTag_online.sim
35,,script,./test.sh -f unique/arbitrator/offline_replica2_alterTag_online.sim
35,,script,./test.sh -f issue/TD-2680.sim
35,,pytest,python3 test.py -f update/update_options.py
35,,pytest,python3 test.py -f insert/flushwhiledrop.py
35,,pytest,python3 test.py -f import_merge/import_update_1.py
34,,script,./test.sh -f unique/dnode/alternativeRole.sim
34,,script,./test.sh -f unique/arbitrator/offline_replica3_dropTable_online.sim
34,,script,./test.sh -f unique/arbitrator/offline_replica2_dropDb_online.sim
34,,script,./test.sh -f issue/TD-2677.sim
33,,script,./test.sh -f general/table/delete_writing.sim
33,,script,./test.sh -f general/parser/slimit.sim
33,,script,./test.sh -f general/db/topic1.sim
32,,script,./test.sh -f unique/mnode/mgmt21.sim
32,,script,./test.sh -f unique/arbitrator/offline_replica3_dropDb_online.sim
32,,script,./test.sh -f unique/arbitrator/dn3_mn2_killDnode.sim
32,,script,./test.sh -f general/db/delete_reusevnode2.sim
32,,script,./test.sh -f general/compress/compress.sim
32,,script,./test.sh -f general/compress/commitlog.sim
32,,pytest,python3 test.py -f tools/taosdemoAllTest/taosdemoTestInsertAllType.py
31,,script,./test.sh -f general/user/pass_alter.sim
31,,script,./test.sh -f general/stable/disk.sim
31,,script,./test.sh -f general/parser/lastrow.sim
31,,script,./test.sh -f general/db/delete_writing2.sim
31,,script,./test.sh -f general/alter/cached_schema_after_alter.sim
30,2,script,./test.sh -f unique/dnode/simple.sim
30,,script,./test.sh -f unique/account/account_delete.sim
30,,script,./test.sh -f general/import/commit.sim
30,,script,./test.sh -f general/compute/diff2.sim
29,,system-test,python3 ./test.py -f 0-others/create_col_tag.py
29,,script,./test.sh -f unique/arbitrator/dn3_mn1_full_createTableFail.sim
29,,script,./test.sh -f general/wal/maxtables.sim
29,,script,./test.sh -f general/compress/compress2.sim
29,,script,./test.sh -f general/alter/insert1.sim
29,,pytest,python3 test.py -f functions/function_mavg.py
28,,script,./test.sh -f general/user/authority.sim
28,,script,./test.sh -f general/parser/select_with_tags.sim
28,,script,./test.sh -f general/insert/query_multi_file.sim
28,,script,./test.sh -f general/compress/uncompress.sim
28,,script,./test.sh -f general/column/commit.sim
28,,pytest,python3 test.py -f queryCount.py
28,,pytest,python3 test.py -f alter/alter_table.py
27,,script,./test.sh -f unique/cluster/cache.sim
27,,script,./test.sh -f general/user/monitor.sim
27,,script,./test.sh -f general/parser/slimit_alter_tags.sim
27,,script,./test.sh -f general/column/table.sim
27,,script,./test.sh -f general/column/metrics.sim
27,,script,./test.sh -f general/alter/cached_schema_after_alter.sim
27,,pytest,python3 test.py -f functions/function_csum.py
26,,script,./test.sh -f general/parser/set_tag_vals.sim
26,,script,./test.sh -f general/db/nosuchfile.sim
26,,script,./test.sh -f general/alter/table.sim
26,,pytest,python3 test.py -f stable/query_after_reset.py
26,,develop-test,python3 ./test.py -f 5-taos-tools/taosbenchmark/commandline.py
25,,script,./test.sh -f unique/stable/dnode3.sim
25,,script,./test.sh -f general/parser/auto_create_tb.sim
25,,script,./test.sh -f general/alter/metrics.sim
25,,pytest,python3 test.py -f tools/taosdemoTestInterlace.py
25,,pytest,python3 test.py -f alter/alter_cacheLastRow.py
25,,develop-test,bash 3-connectors/go/test.sh
24,,script,./test.sh -f general/wal/maxtables.sim
24,,script,./test.sh -f general/connection/test_old_data.sim
24,,script,./test.sh -f general/cache/restart_metrics.sim
24,,script,./test.sh -f general/alter/insert2.sim
24,,pytest,python3 test.py -f tag_lite/datatype-without-alter.py
23,,script,./test.sh -f general/parser/select_from_cache_disk.sim
23,,script,./test.sh -f general/parser/mixed_blocks.sim
23,,script,./test.sh -f general/import/large.sim
22,,script,./test.sh -f general/stable/metrics.sim
22,,script,./test.sh -f general/parser/slimit1.sim
22,,script,./test.sh -f general/parser/limit.sim
22,,script,./test.sh -f general/insert/tcp.sim
22,,script,./test.sh -f general/cache/restart_table.sim
22,,pytest,python3 test.py -f tools/taosdemoAllTest/taosdemoTestInsertShell.py
22,,pytest,python3 test.py -f tag_lite/datatype.py
22,,pytest,python3 test.py -f import_merge/importDataLastH.py
22,,pytest,python3 test.py -f import_merge/importDataHO2.py
22,,pytest,python3 test.py -f import_merge/importCacheFileH.py
21,,script,./test.sh -f general/parser/single_row_in_tb.sim
21,,script,./test.sh -f general/parser/last_cache.sim
21,,script,./test.sh -f general/parser/join_multivnode.sim
21,,script,./test.sh -f general/db/repeat.sim
21,,pytest,python3 test.py -f import_merge/importLastT.py
21,,pytest,python3 test.py -f import_merge/importDataLastS.py
21,,pytest,python3 test.py -f import_merge/importDataLastHPO.py
21,,pytest,python3 test.py -f import_merge/importDataHO.py
21,,pytest,python3 test.py -f import_merge/importDataH2.py
21,,pytest,python3 test.py -f import_merge/importCacheFileT.py
21,,pytest,python3 test.py -f import_merge/importCacheFileTPO.py
21,,pytest,python3 test.py -f import_merge/importCacheFileTO.py
21,,pytest,python3 test.py -f import_merge/importCacheFileSub.py
21,,pytest,python3 test.py -f import_merge/importCacheFileS.py
21,,pytest,python3 test.py -f import_merge/importCacheFileHPO.py
21,,pytest,python3 test.py -f import_merge/importCacheFileHO.py
20,,script,./test.sh -f unique/account/user_create.sim
20,,script,./test.sh -f general/parser/auto_create_tb_drop_tb.sim
20,,script,./test.sh -f general/import/basic.sim
20,2,script,./test.sh -f general/alter/dnode.sim
20,,pytest,python3 test.py -f query/query.py
20,,pytest,python3 test.py -f import_merge/importLastTO.py
20,,pytest,python3 test.py -f import_merge/importDataSub.py
20,,pytest,python3 test.py -f import_merge/importDataLastSub.py
19,,script,./test.sh -f unique/stable/dnode2.sim
19,,script,./test.sh -f general/db/vnodes.sim
19,,pytest,python3 test.py -f tools/taosdumpTest3.py
19,,pytest,python3 test.py -f query/udf.py
19,,pytest,python3 test.py -f import_merge/importLastTPO.py
19,,pytest,python3 test.py -f import_merge/importDataLastHO.py
19,,pytest,python3 test.py -f import_merge/importDataHPO.py
19,,pytest,python3 test.py -f import_merge/importCSV.py
19,,pytest,python3 test.py -f functions/function_operations.py -r 1
18,,script,./test.sh -f unique/stable/replica3_dnode6.sim
18,,script,./test.sh -f general/vector/table_field.sim
18,,script,./test.sh -f general/vector/single.sim
18,,script,./test.sh -f general/parser/join.sim
18,,script,./test.sh -f general/insert/query_block2_file.sim
18,,script,./test.sh -f general/db/tables.sim
18,,pytest,python3 test.py -f tools/taosdemoAllTest/TD-4985/query-limit-offset.py
18,,pytest,python3 test.py -f stream/history.py
18,,pytest,python3 test.py -f query/queryTscomputWithNow.py
18,,pytest,python3 test.py -f query/queryInterval.py
18,,develop-test,python3 ./test.py -f 5-taos-tools/taosbenchmark/sml_telnet_alltypes.py
17,,script,./test.sh -f unique/account/user_len.sim
17,,script,./test.sh -f general/vector/metrics_mix.sim
17,,script,./test.sh -f general/user/user_create.sim
17,,script,./test.sh -f general/parser/import_commit3.sim
17,,script,./test.sh -f general/parser/function.sim
17,,script,./test.sh -f general/insert/query_file_memory.sim
17,,script,./test.sh -f general/field/binary.sim
17,,script,./test.sh -f general/field/4.sim
17,,pytest,python3 test.py -f subscribe/supertable.py
17,,pytest,python3 test.py -f query/query1970YearsAf.py
16,,script,./test.sh -f unique/account/account_len.sim
16,,script,./test.sh -f general/vector/table_time.sim
16,,script,./test.sh -f general/vector/multi.sim
16,,script,./test.sh -f general/vector/metrics_time.sim
16,,script,./test.sh -f general/vector/metrics_tag.sim
16,,script,./test.sh -f general/vector/metrics_query.sim
16,,script,./test.sh -f general/vector/metrics_field.sim
16,,script,./test.sh -f general/user/pass_len.sim
16,,script,./test.sh -f general/stable/show.sim
16,,script,./test.sh -f general/stable/dnode3.sim
16,,script,./test.sh -f general/parser/import_commit2.sim
16,,script,./test.sh -f general/parser/import_commit1.sim
16,,script,./test.sh -f general/parser/fill_stb.sim
16,,script,./test.sh -f general/parser/create_mt.sim
16,,script,./test.sh -f general/insert/query_block1_file.sim
16,,script,./test.sh -f general/field/single.sim
16,,script,./test.sh -f general/field/6.sim
16,2,script,./test.sh -f general/db/topic2.sim
16,,script,./test.sh -f general/connection/connection.sim
16,,pytest,python3 test.py -f query/bug1471.py
16,,pytest,python3 test.py -f import_merge/importSRestart.py
16,,pytest,python3 test.py -f functions/function_last_row.py -r 1
16,,pytest,python3 test.py -f functions/function_first.py -r 1
15,,system-test,python3 ./test.py -f 4-taosAdapter/taosAdapter_query.py
15,,script,./test.sh -f unique/db/replica_reduce21.sim
15,,script,./test.sh -f unique/account/paras.sim
15,,script,./test.sh -f unique/account/account_create.sim
15,,script,./test.sh -f general/vector/table_query.sim
15,,script,./test.sh -f general/vector/table_mix.sim
15,,script,./test.sh -f general/user/user_len.sim
15,,script,./test.sh -f general/parser/timestamp.sim
15,,script,./test.sh -f general/parser/tags_filter.sim
15,,script,./test.sh -f general/parser/select_across_vnodes.sim
15,,script,./test.sh -f general/parser/nchar.sim
15,,script,./test.sh -f general/parser/dbtbnameValidate.sim
15,,script,./test.sh -f general/parser/binary_escapeCharacter.sim
15,,script,./test.sh -f general/parser/alter_stable.sim
15,,script,./test.sh -f general/insert/query_block2_memory.sim
15,,script,./test.sh -f general/insert/query_block1_memory.sim
15,,script,./test.sh -f general/insert/basic.sim
15,,script,./test.sh -f general/field/tinyint.sim
15,,script,./test.sh -f general/field/bool.sim
15,,script,./test.sh -f general/field/5.sim
15,,script,./test.sh -f general/cache/new_metrics.sim
15,,script,./test.sh -f general/alter/import.sim
15,,pytest,python3 test.py -f tools/taosdemoTestTblAlt.py
15,,pytest,python3 test.py -f query/queryNormal.py
15,,pytest,python3 test.py -f query/queryLimit.py
15,,pytest,python3 test.py -f query/distinctOneColTb.py
15,,pytest,python3 test.py -f functions/function_sum.py -r 1
15,,pytest,python3 test.py -f functions/function_spread.py -r 1
15,,pytest,python3 test.py -f functions/function_min.py -r 1
15,,pytest,python3 test.py -f functions/function_max.py -r 1
15,,pytest,python3 test.py -f functions/function_last.py -r 1
15,,pytest,python3 test.py -f functions/function_avg.py -r 1
14,,script,./test.sh -f unique/account/basic.sim
14,,script,./test.sh -f general/table/limit.sim
14,,script,./test.sh -f general/table/createmulti.sim
14,,script,./test.sh -f general/parser/null_char.sim
14,,script,./test.sh -f general/parser/insert_tb.sim
14,,script,./test.sh -f general/parser/fill.sim
14,,script,./test.sh -f general/parser/create_tb.sim
14,,script,./test.sh -f general/parser/create_db.sim
14,,script,./test.sh -f general/parser/alter.sim
14,,script,./test.sh -f general/field/smallint.sim
14,,script,./test.sh -f general/field/bigint.sim
14,,script,./test.sh -f general/field/3.sim
14,,script,./test.sh -f general/field/2.sim
14,,script,./test.sh -f general/compute/avg.sim
14,,pytest,python3 test.py -f tools/taosdemoAllTest/taosdemoTestInsertWithJson.py
14,,pytest,python3 test.py -f query/queryWithTaosdKilled.py
14,,pytest,python3 test.py -f query/queryStddevWithGroupby.py
14,,pytest,python3 test.py -f query/queryJoin10tables.py
14,,pytest,python3 test.py -f insert/insertFromCSV.py
14,,pytest,python3 test.py -f import_merge/importSubRestart.py
14,,pytest,python3 test.py -f import_merge/importBlock1T.py
14,,pytest,python3 test.py -f functions/function_twa.py -r 1
14,,pytest,python3 test.py -f functions/function_top.py -r 1
14,,pytest,python3 test.py -f functions/function_stddev.py -r 1
14,,pytest,python3 test.py -f functions/function_percentile.py -r 1
14,,pytest,python3 test.py -f functions/function_leastsquares.py -r 1
14,,pytest,python3 test.py -f functions/function_diff.py -r 1
14,,pytest,python3 test.py -f functions/function_count.py -r 1
14,,pytest,python3 test.py -f client/noConnectionErrorTest.py
14,,develop-test,bash 3-connectors/rust/test.sh
13,,system-test,python3 ./test.py -f 5-taos-tools/basic.py
13,,system-test,bash 3-connectors/go/test.sh
13,,script,./test.sh -f unique/account/pass_len.sim
13,,script,./test.sh -f general/table/vgroup.sim
13,,script,./test.sh -f general/table/tinyint.sim
13,,script,./test.sh -f general/table/float.sim
13,,script,./test.sh -f general/stable/vnode3.sim
13,,script,./test.sh -f general/stable/values.sim
13,,script,./test.sh -f general/stable/refcount.sim
13,,script,./test.sh -f general/parser/tags_dynamically_specifiy.sim
13,,script,./test.sh -f general/parser/select_distinct_tag.sim
13,,script,./test.sh -f general/compute/sum.sim
13,,script,./test.sh -f general/compute/percentile.sim
13,,script,./test.sh -f general/compute/min.sim
13,,script,./test.sh -f general/compute/last.sim
13,,script,./test.sh -f general/compute/bottom.sim
13,,pytest,python3 test.py -f tools/taosdemoAllTest/NanoTestCase/taosdemoTestSupportNanoQuery.py
13,,pytest,python3 test.py -f query/queryInsertValue.py
13,,pytest,python3 test.py -f query/queryGroupTbname.py
13,,pytest,python3 test.py -f insert/openTsdbTelnetLinesInsert.py
13,,pytest,python3 test.py -f insert/metadataUpdate.py
13,,pytest,python3 test.py -f insert/before_1970.py
13,,pytest,python3 test.py -f import_merge/importTRestart.py
13,,pytest,python3 test.py -f import_merge/importTPORestart.py
13,,pytest,python3 test.py -f import_merge/importTORestart.py
13,,pytest,python3 test.py -f import_merge/importTailPartOverlap.py
13,,pytest,python3 test.py -f import_merge/importLastSub.py
13,,pytest,python3 test.py -f import_merge/importHead.py
13,,pytest,python3 test.py -f import_merge/importDataLastT.py
13,,pytest,python3 test.py -f import_merge/importBlockbetween.py
13,,pytest,python3 test.py -f import_merge/importBlock2T.py
13,,pytest,python3 test.py -f import_merge/importBlock2TO.py
13,,pytest,python3 test.py -f import_merge/importBlock2Sub.py
13,,pytest,python3 test.py -f import_merge/importBlock1TO.py
13,,pytest,python3 test.py -f import_merge/importBlock1S.py
13,,pytest,python3 test.py -f import_merge/importBlock1HO.py
13,,pytest,python3 test.py -f functions/function_bottom.py -r 1
13,,develop-test,bash 3-connectors/restful/test.sh
12,,system-test,bash 3-connectors/rust/test.sh
12,,system-test,bash 3-connectors/restful/test.sh
12,,system-test,bash 3-connectors/java/test.sh
12,,script,./test.sh -f general/table/table.sim
12,,script,./test.sh -f general/table/table_len.sim
12,,script,./test.sh -f general/table/int.sim
12,,script,./test.sh -f general/table/double.sim
12,,script,./test.sh -f general/table/describe.sim
12,,script,./test.sh -f general/table/date.sim
12,,script,./test.sh -f general/table/column_num.sim
12,,script,./test.sh -f general/table/column_name.sim
12,,script,./test.sh -f general/table/column2.sim
12,,script,./test.sh -f general/table/bool.sim
12,,script,./test.sh -f general/table/binary.sim
12,,script,./test.sh -f general/table/bigint.sim
12,,script,./test.sh -f general/table/basic3.sim
12,,script,./test.sh -f general/table/basic2.sim
12,,script,./test.sh -f general/parser/udf.sim
12,,script,./test.sh -f general/parser/udf_dll.sim
12,,script,./test.sh -f general/parser/columnValue.sim
12,,script,./test.sh -f general/db/len.sim
12,,script,./test.sh -f general/db/basic.sim
12,,script,./test.sh -f general/db/basic5.sim
12,,script,./test.sh -f general/db/basic3.sim
12,,script,./test.sh -f general/db/basic2.sim
12,,script,./test.sh -f general/db/basic1.sim
12,,script,./test.sh -f general/db/alter_option.sim
12,,script,./test.sh -f general/compute/top.sim
12,,script,./test.sh -f general/compute/stddev.sim
12,,script,./test.sh -f general/compute/null.sim
12,,script,./test.sh -f general/compute/max.sim
12,,script,./test.sh -f general/compute/leastsquare.sim
12,,script,./test.sh -f general/compute/interval.sim
12,,script,./test.sh -f general/compute/first.sim
12,,script,./test.sh -f general/compute/diff.sim
12,,script,./test.sh -f general/compute/count.sim
12,,pytest,python3 test.py -f update/allow_update-0.py
12,,pytest,python3 test.py -f table/alter_wal0.py
12,,pytest,python3 test.py -f import_merge/importTail.py
12,,pytest,python3 test.py -f import_merge/importTailOverlap.py
12,,pytest,python3 test.py -f import_merge/importSpan.py
12,,pytest,python3 test.py -f import_merge/importLastS.py
12,,pytest,python3 test.py -f import_merge/importLastH.py
12,,pytest,python3 test.py -f import_merge/importLastHO.py
12,,pytest,python3 test.py -f import_merge/importInsertThenImport.py
12,,pytest,python3 test.py -f import_merge/importDataT.py
12,,pytest,python3 test.py -f import_merge/importDataTPO.py
12,,pytest,python3 test.py -f import_merge/importDataS.py
12,,pytest,python3 test.py -f import_merge/importDataLastTPO.py
12,,pytest,python3 test.py -f import_merge/importDataLastTO.py
12,,pytest,python3 test.py -f import_merge/importBlock2TPO.py
12,,pytest,python3 test.py -f import_merge/importBlock2S.py
12,,pytest,python3 test.py -f import_merge/importBlock2H.py
12,,pytest,python3 test.py -f import_merge/importBlock2HPO.py
12,,pytest,python3 test.py -f import_merge/importBlock2HO.py
12,,pytest,python3 test.py -f import_merge/importBlock1TPO.py
12,,pytest,python3 test.py -f import_merge/importBlock1H.py
12,,pytest,python3 test.py -f import_merge/importBlock1HPO.py
12,,pytest,python3 test.py -f functions/variable_httpDbNameMandatory.py
12,,pytest,python3 test.py -f functions/function_round.py
12,,pytest,python3 test.py -f functions/function_percentile2.py
12,,pytest,python3 test.py -f functions/function_ceil.py
11,,script,./test.sh -f unique/stable/replica2_dnode4.sim
11,,script,./test.sh -f general/table/smallint.sim
11,,script,./test.sh -f general/table/db.table.sim
11,,script,./test.sh -f general/table/column_value.sim
11,,script,./test.sh -f general/table/basic1.sim
11,,script,./test.sh -f general/table/autocreate.sim
11,,script,./test.sh -f general/parser/udf_dll_stable.sim
11,,script,./test.sh -f general/parser/stableOp.sim
11,,script,./test.sh -f general/parser/having.sim
11,,script,./test.sh -f general/parser/having_child.sim
11,,script,./test.sh -f general/parser/between_and.sim
11,,script,./test.sh -f general/db/basic4.sim
11,,pytest,python3 testNoCompress.py
11,,pytest,python3 test.py -f import_merge/importToCommit.py
11,,pytest,python3 test.py -f import_merge/importLastHPO.py
11,,pytest,python3 test.py -f import_merge/importDataTO.py
11,,pytest,python3 test.py -f import_merge/importBlock1Sub.py
10,,system-test,python3 ./test.py -f 2-query/TD-12344.py
10,,script,./test.sh -f unique/stable/replica2_vnode3.sim
10,,pytest,python3 testCompress.py
10,,pytest,python3 test.py -f client/client.py
9,,script,./test.sh -f general/parser/alter1.sim
9,,script,./test.sh -f general/db/delete.sim
9,,pytest,python3 test.py -f tools/taosdemoTestLimitOffset.py
9,,pytest,python3 test.py -f tools/taosdemoAllTest/NanoTestCase/taosdemoTestSupportNanoInsert.py
9,,pytest,python3 test.py -f stream/showStreamExecTimeisNull.py
9,,pytest,python3 test.py -f query/bug1876.py
9,,pytest,python3 test.py -f alter/alter_table_crash.py
9,,develop-test,python3 ./test.py -f 5-taos-tools/taosdump/taosdumpTestTypeSmallInt.py
9,,develop-test,python3 ./test.py -f 5-taos-tools/taosdump/taosdumpTestTypeFloat.py
9,,develop-test,python3 ./test.py -f 5-taos-tools/taosbenchmark/sml_json_alltypes.py
8,,pytest,python3 test.py -f tools/taosdumpTest.py
8,,pytest,python3 test.py -f query/unionAllTest.py
8,,pytest,python3 test.py -f query/queryFilterTswithDateUnit.py
8,,pytest,python3 test.py -f query/queryDiffColsTagsAndOr.py
8,2,pytest,python3 test.py -f query/nestedQuery/nestedQuery_datacheck.py
8,,pytest,python3 test.py -f query/bug1874.py
8,,pytest,python3 test.py -f functions/function_floor.py
8,,develop-test,python3 ./test.py -f 5-taos-tools/taosdump/taosdumpTestTypeUnsignedTinyInt.py
8,,develop-test,python3 ./test.py -f 5-taos-tools/taosdump/taosdumpTestTypeUnsignedBigInt.py
8,,develop-test,python3 ./test.py -f 5-taos-tools/taosdump/taosdumpTestTypeTinyInt.py
8,,develop-test,python3 ./test.py -f 5-taos-tools/taosdump/taosdumpTestTypeInt.py
8,,develop-test,python3 ./test.py -f 5-taos-tools/taosdump/taosdumpTestTypeDouble.py
8,,develop-test,python3 ./test.py -f 5-taos-tools/taosbenchmark/insert_alltypes_json.py
8,,develop-test,python3 ./test.py -f 5-taos-tools/taosbenchmark/query_json.py
8,,develop-test,python3 ./test.py -f 5-taos-tools/taosbenchmark/sml_interlace.py
8,,develop-test,python3 ./test.py -f 5-taos-tools/taosbenchmark/subscripe_json.py
8,,develop-test,python3 ./test.py -f 5-taos-tools/taosbenchmark/invalid_commandline.py
## 7,,system-test,python3 ./test.py -f 2-query/TD-12191.py
7,,pytest,python3 test.py -f tools/taosdumpTest2.py
7,,pytest,python3 test.py -f tools/taosdemoTestdatatype.py
7,,pytest,python3 test.py -f tag_lite/unsignedInt.py
7,,pytest,python3 test.py -f query/bug1875.py
7,,pytest,python3 test.py -f functions/function_stateWindow.py
7,,pytest,python3 test.py -f client/version.py
7,,pytest,python3 client/twoClients.py
7,,develop-test,python3 ./test.py -f 5-taos-tools/taosdump/taosdumpTestTypeUnsignedSmallInt.py
7,,develop-test,python3 ./test.py -f 5-taos-tools/taosdump/taosdumpTestTypeUnsignedInt.py
7,,develop-test,python3 ./test.py -f 5-taos-tools/taosdump/taosdumpTestTypeJson.py
7,,develop-test,python3 ./test.py -f 5-taos-tools/taosdump/taosdumpTestTypeBool.py
7,,develop-test,python3 ./test.py -f 5-taos-tools/taosdump/taosdumpTestTypeBigInt.py
7,,develop-test,python3 ./test.py -f 2-query/constant_compare.py
7,,develop-test,python3 ./test.py -f 5-taos-tools/taosbenchmark/limit_offset_json.py
## 6,,system-test,python3 ./test.py -f 2-query/TD-11483.py
# 6,,system-test,python3 ./test.py -f 2-query/function_elapsed.py
6,,pytest,python3 test.py -f wal/addOldWalTest.py
6,,pytest,python3 test.py -f topic/topicQuery.py
6,,pytest,python3 test.py -f tools/taosdemoTestWithoutMetric.py
6,,pytest,python3 test.py -f tools/taosdemoTest.py
6,,pytest,python3 test.py -f tag_lite/unsignedSmallint.py
6,,pytest,python3 test.py -f tag_lite/double.py
6,,pytest,python3 test.py -f tag_lite/alter_tag.py
6,,pytest,python3 test.py -f tag_lite/add.py
6,,pytest,python3 test.py -f tag_lite/6.py
6,,pytest,python3 test.py -f table/boundary.py
6,,pytest,python3 test.py -f query/subqueryFilter.py
6,,pytest,python3 test.py -f query/queryStableJoin.py
6,,pytest,python3 test.py -f query/querySort.py
6,,pytest,python3 test.py -f query/queryJoin.py
6,,pytest,python3 test.py -f query/queryGroupbySort.py
6,,pytest,python3 test.py -f query/queryFillTest.py
6,,pytest,python3 test.py -f query/filterAllUnsignedIntTypes.py
6,,pytest,python3 test.py -f query/bug2218.py
6,,pytest,python3 test.py -f query/bug2118.py
6,,pytest,python3 test.py -f query/bug2117.py
6,,pytest,python3 test.py -f perfbenchmark/bug3433.py
6,,pytest,python3 test.py -f insert/insert_before_use_db.py
6,,pytest,python3 test.py -f import_merge/importHPORestart.py
6,,pytest,python3 test.py -f import_merge/importHORestart.py
6,,pytest,python3 test.py -f functions/showOfflineThresholdIs864000.py
6,,pytest,python3 test.py -f alter/alterColMultiTimes.py
6,,develop-test,python3 ./test.py -f 2-query/ts_2016.py
6,,develop-test,python3 ./test.py -f 2-query/escape.py
6,,develop-test,python3 ./test.py -f 2-query/func_compare.py
6,,develop-test,python3 ./test.py -f 5-taos-tools/taosbenchmark/auto_create_table_json.py
6,,develop-test,python3 ./test.py -f 5-taos-tools/taosbenchmark/json_tag.py
6,,develop-test,python3 ./test.py -f 5-taos-tools/taosbenchmark/default_json.py
5,,system-test,python3 ./test.py -f 4-taosAdapter/taosAdapter_insert.py
5,,system-test,python3 ./test.py -f 2-query/TD-12340-12342.py
5,,system-test,python3 ./test.py -f 2-query/TD-11945_crash.py
5,,system-test,python3 ./test.py -f 2-query/TD-11256.py
5,,system-test,python3 test.py -f 1-insert/TD-11970.py
5,,pytest,python3 test.py -f user/user_create.py
5,,pytest,python3 test.py -f tools/taosdemoTestWithJson.py
5,,pytest,python3 test.py -f tools/taosdemoTestSampleData.py
5,,pytest,python3 test.py -f tools/taosdemoAllTest/NanoTestCase/taosdemoTestInsertTime_step.py
5,,pytest,python3 testMinTablesPerVnode.py
5,,pytest,python3 test.py -f tag_lite/unsignedTinyint.py
5,,pytest,python3 test.py -f tag_lite/timestamp.py
5,,pytest,python3 test.py -f tag_lite/TestModifyTag.py
5,,pytest,python3 test.py -f tag_lite/json_tag_extra.py
5,,pytest,python3 test.py -f tag_lite/int_binary.py
5,,pytest,python3 test.py -f tag_lite/float.py
5,,pytest,python3 test.py -f tag_lite/drop_auto_create.py
5,,pytest,python3 test.py -f tag_lite/create.py
5,,pytest,python3 test.py -f tag_lite/change.py
5,,pytest,python3 test.py -f tag_lite/bool.py
5,,pytest,python3 test.py -f tag_lite/bool_binary.py
5,,pytest,python3 test.py -f tag_lite/5.py
5,,pytest,python3 test.py -f tag_lite/4.py
5,,pytest,python3 test.py -f table/db_table.py
5,,pytest,python3 test.py -f table/create_sensitive.py
5,,pytest,python3 test.py -f table/column_num.py
5,,pytest,python3 test.py -f subscribe/singlemeter.py
5,,pytest,python3 test.py -f stable/insert.py
5,,pytest,python3 test.py -f query/querySession.py
5,,pytest,python3 test.py -f query/querySecondtscolumnTowherenow.py
5,,pytest,python3 test.py -f query/queryRegex.py
5,,pytest,python3 test.py -f query/queryGroupbyWithInterval.py
5,,pytest,python3 test.py -f query/queryCountCSVData.py
5,,pytest,python3 test.py -f query/queryCnameDisplay.py
5,,pytest,python3 test.py -f query/queryBetweenAnd.py
5,,pytest,python3 test.py -f query/nestquery_last_row.py
5,,pytest,python3 test.py -f query/nestedQuery/queryWithSpread.py
5,,pytest,python3 test.py -f query/nestedQuery/queryInterval.py
5,,pytest,python3 test.py -f query/isNullTest.py
5,,pytest,python3 test.py -f query/filterOtherTypes.py
5,,pytest,python3 test.py -f query/filterFloatAndDouble.py
5,,pytest,python3 test.py -f query/computeErrorinWhere.py
5,,pytest,python3 test.py -f query/bug6586.py
5,,pytest,python3 test.py -f query/bug2143.py
5,,pytest,python3 test.py -f query/bug2119.py
5,,pytest,python3 test.py -f insert/unsignedTinyint.py
5,,pytest,python3 test.py -f insert/unsignedSmallint.py
5,,pytest,python3 test.py -f insert/unsignedInt.py
5,,pytest,python3 test.py -f insert/nchar-unicode.py
5,,pytest,python3 test.py -f insert/insert_locking.py
5,,pytest,python3 test.py -f insert/in_function.py
5,,pytest,python3 test.py -f insert/binary.py
5,,pytest,python3 test.py -f import_merge/importHRestart.py
5,,pytest,python3 test.py -f import_merge/importHeadOverlap.py
5,,pytest,python3 test.py -f functions/function_twa_test2.py
5,,pytest,python3 test.py -f functions/function_irate.py
5,,pytest,python3 test.py -f functions/function_derivative.py
5,,pytest,python3 test.py -f functions/function_count_last_stab.py
5,,pytest,python3 test.py -f functions/all_null_value.py
5,,pytest,python3 test.py -f client/nettest.py
5,,pytest,python3 test.py -f client/alterDatabase.py
5,,pytest,python3 test.py -f alter/alterTimestampColDataProcess.py
5,,pytest,python3 test.py -f alter/alter_keep.py
5,,pytest,python3 test.py -f account/account_create.py
5,,develop-test,python3 ./test.py -f 2-query/union-order.py
5,,develop-test,python3 ./test.py -f 2-query/timeline_agg_func_groupby.py
5,,develop-test,python3 ./test.py -f 2-query/session_two_stage.py
5,,develop-test,python3 ./test.py -f 0-others/TD-12435.py
5,,develop-test,python3 ./test.py -f 0-others/json_tag.py
5,,system-test,python3 ./test.py -f 2-query/TD-12909.py
5,,develop-test,python3 ./test.py -f 2-query/function_mavg.py
4,,system-test,python3 test.py -f 4-taosAdapter/TD-12163.py
4,,pytest,python3 test.py -f user/pass_len.py
4,,pytest,python3 test.py -f TimeZone/TestCaseTimeZone.py
4,,pytest,python3 test.py -f tag_lite/unsignedBigint.py
4,,pytest,python3 test.py -f tag_lite/tinyint.py
4,,pytest,python3 test.py -f tag_lite/smallint.py
4,,pytest,python3 test.py -f tag_lite/set.py
4,,pytest,python3 test.py -f tag_lite/int.py
4,,pytest,python3 test.py -f tag_lite/int_float.py
4,,pytest,python3 test.py -f tag_lite/filter.py
4,,pytest,python3 test.py -f tag_lite/delete.py
4,,pytest,python3 test.py -f tag_lite/create-tags-boundary.py
4,,pytest,python3 test.py -f tag_lite/commit.py
4,,pytest,python3 test.py -f tag_lite/column.py
4,,pytest,python3 test.py -f tag_lite/bool_int.py
4,,pytest,python3 test.py -f tag_lite/binary_binary.py
4,,pytest,python3 test.py -f tag_lite/bigint.py
4,,pytest,python3 test.py -f tag_lite/3.py
4,,pytest,python3 test.py -f table/tablename-boundary.py
4,,pytest,python3 test.py -f table/max_table_length.py
4,,pytest,python3 test.py -f table/del_stable.py
4,,pytest,python3 test.py -f table/create_db_from_normal_db.py
4,,pytest,python3 test.py -f table/column_name.py
4,,pytest,python3 test.py -f table/alter_column.py
4,,pytest,python3 test.py -f query/sliding.py
4,,pytest,python3 test.py -f query/queryWildcardLength.py
4,,pytest,python3 test.py -f query/queryTsisNull.py
4,,pytest,python3 test.py -f query/queryTbnameUpperLower.py
4,,pytest,python3 test.py -f query/queryPriKey.py
4,,pytest,python3 test.py -f query/queryError.py
4,,pytest,python3 test.py -f query/queryBase.py
4,,pytest,python3 test.py -f query/natualInterval.py
4,,pytest,python3 test.py -f query/floatCompare.py
4,,pytest,python3 test.py -f query/filter.py
4,,pytest,python3 test.py -f query/filterCombo.py
4,,pytest,python3 test.py -f query/bug3375.py
4,,pytest,python3 test.py -f query/bug3351.py
4,,pytest,python3 test.py -f query/bug2281.py
4,,pytest,python3 test.py -f insert/unsignedBigint.py
4,,pytest,python3 test.py -f insert/tinyint.py
4,,pytest,python3 test.py -f insert/timestamp.py
4,,pytest,python3 test.py -f insert/specialSql.py
4,,pytest,python3 test.py -f insert/special_character_show.py
4,,pytest,python3 test.py -f insert/smallint.py
4,,pytest,python3 test.py -f insert/nchar.py
4,,pytest,python3 test.py -f insert/multi.py
4,,pytest,python3 test.py -f insert/modify_column.py
4,,pytest,python3 test.py -f insert/int.py
4,,pytest,python3 test.py -f insert/insertIntoTwoTables.py
4,,pytest,python3 test.py -f insert/insertDynamicColBeforeVal.py
4,,pytest,python3 test.py -f insert/float.py
4,,pytest,python3 test.py -f insert/double.py
4,,pytest,python3 test.py -f insert/date.py
4,,pytest,python3 test.py -f insert/bug3654.py
4,,pytest,python3 test.py -f insert/bool.py
4,,pytest,python3 test.py -f insert/bigint.py
4,,pytest,python3 test.py -f insert/basic.py
4,,pytest,python3 test.py -f insert/alterTableAndInsert.py
4,,pytest,python3 test.py -f import_merge/importHeadPartOverlap.py
4,,pytest,python3 test.py -f functions/function_stddev_td2555.py
4,,pytest,python3 test.py -f dbmgmt/nanoSecondCheck.py
4,,pytest,python3 bug2265.py
4,,pytest,python3 test.py -f alter/alterTabAddTagWithNULL.py
4,,pytest,python3 test.py -f alter/alter_debugFlag.py
4,,pytest,python3 test.py -f alter/alter_create_exception.py
3,,pytest,python3 test.py -f tag_lite/binary.py
3,,pytest,python3 test.py -f query/filterAllIntTypes.py
3,,pytest,python3 ./test.py -f query/queryNcharNull.py
3,,develop-test,python3 ./test.py -f 2-query/ts_hidden_column.py
3,,develop-test,python3 ./test.py -f 1-insert/uppercase_in_stmt.py
#2,,coredump-test,./test.sh
[{
"host":"192.168.0.210",
"username":"root",
"workdir":"/var/data/jenkins/workspace",
"thread":25
},
{
"host":"192.168.0.211",
"username":"root",
"workdir":"/var/data/jenkins/workspace",
"thread":25
},
{
"host":"192.168.0.212",
"username":"root",
"workdir":"/var/data/jenkins/workspace",
"thread":25
},
{
"host":"192.168.0.213",
"username":"root",
"workdir":"/var/data/jenkins/workspace",
"thread":25
},
{
"host":"192.168.0.214",
"username":"root",
"workdir":"/var/data/jenkins/workspace",
"thread":25
}]
#!/bin/bash
function usage() {
echo "$0"
echo -e "\t -m vm config file"
echo -e "\t -t task file"
echo -e "\t -b branch"
echo -e "\t -l log dir"
echo -e "\t -h help"
}
while getopts "m:t:b:l:h" opt; do
case $opt in
m)
config_file=$OPTARG
;;
t)
t_file=$OPTARG
;;
b)
branch=$OPTARG
;;
l)
log_dir=$OPTARG
;;
h)
usage
exit 0
;;
\?)
echo "Invalid option: -$OPTARG"
usage
exit 0
;;
esac
done
#config_file=$1
if [ -z $config_file ]; then
usage
exit 1
fi
if [ ! -f $config_file ]; then
echo "$config_file not found"
usage
exit 1
fi
#t_file=$2
if [ -z $t_file ]; then
usage
exit 1
fi
if [ ! -f $t_file ]; then
echo "$t_file not found"
usage
exit 1
fi
date_tag=`date +%Y%m%d-%H%M%S`
if [ -z $log_dir ]; then
log_dir="log/${branch}_${date_tag}"
else
log_dir="$log_dir/${branch}_${date_tag}"
fi
hosts=()
usernames=()
passwords=()
workdirs=()
threads=()
i=0
while [ 1 ]; do
host=`jq .[$i].host $config_file`
if [ "$host" = "null" ]; then
break
fi
username=`jq .[$i].username $config_file`
if [ "$username" = "null" ]; then
break
fi
password=`jq .[$i].password $config_file`
if [ "$password" = "null" ]; then
password=""
fi
workdir=`jq .[$i].workdir $config_file`
if [ "$workdir" = "null" ]; then
break
fi
thread=`jq .[$i].thread $config_file`
if [ "$thread" = "null" ]; then
break
fi
hosts[i]=`echo $host|sed 's/\"$//'|sed 's/^\"//'`
usernames[i]=`echo $username|sed 's/\"$//'|sed 's/^\"//'`
passwords[i]=`echo $password|sed 's/\"$//'|sed 's/^\"//'`
workdirs[i]=`echo $workdir|sed 's/\"$//'|sed 's/^\"//'`
threads[i]=$thread
i=$(( i + 1 ))
done
function prepare_cases() {
cat $t_file >>$task_file
local i=0
while [ $i -lt $1 ]; do
echo "%%FINISHED%%" >>$task_file
i=$(( i + 1 ))
done
}
function clean_tmp() {
# clean tmp dir
local index=$1
local ssh_script="sshpass -p ${passwords[index]} ssh -o StrictHostKeyChecking=no ${usernames[index]}@${hosts[index]}"
if [ -z ${passwords[index]} ]; then
ssh_script="ssh -o StrictHostKeyChecking=no ${usernames[index]}@${hosts[index]}"
fi
local cmd="${ssh_script} rm -rf ${workdirs[index]}/tmp"
${cmd}
}
# build source
function build_src() {
echo "build source"
local index=$1
local ssh_script="sshpass -p ${passwords[index]} ssh -o StrictHostKeyChecking=no ${usernames[index]}@${hosts[index]}"
if [ -z ${passwords[index]} ]; then
ssh_script="ssh -o StrictHostKeyChecking=no ${usernames[index]}@${hosts[index]}"
fi
local script=". ~/.bashrc;cd ${workdirs[index]}/TDinternal;mkdir -p debug;cd debug;cmake .. -DBUILD_HTTP=false -DBUILD_TOOLS=true;make -j8;make install"
local cmd="${ssh_script} sh -c \"$script\""
echo "$cmd"
${cmd}
if [ $? -ne 0 ]; then
flock -x $lock_file -c "echo \"${hosts[index]} TDengine build failed\" >>$log_dir/failed.log"
return
fi
script=". ~/.bashrc;cd ${workdirs[index]}/taos-tools;git submodule update --init --recursive;mkdir -p build;cd build;cmake ..;make -j4"
cmd="${ssh_script} sh -c \"$script\""
${cmd}
if [ $? -ne 0 ]; then
flock -x $lock_file -c "echo \"${hosts[index]} taos-tools build failed\" >>$log_dir/failed.log"
return
fi
script="cp -rf ${workdirs[index]}/taos-tools/build/build/bin/* ${workdirs[index]}/TDinternal/debug/build/bin/;cp -rf ${workdirs[index]}/taos-tools/build/build/lib/* ${workdirs[index]}/TDinternal/debug/build/lib/;cp -rf ${workdirs[index]}/taos-tools/build/build/lib64/* ${workdirs[index]}/TDinternal/debug/build/lib/;cp -rf ${workdirs[index]}/TDinternal/debug/build/bin/taosBenchmark ${workdirs[index]}/TDinternal/debug/build/bin/taosdemo"
cmd="${ssh_script} sh -c \"$script\""
${cmd}
}
function rename_taosdemo() {
local index=$1
local ssh_script="sshpass -p ${passwords[index]} ssh -o StrictHostKeyChecking=no ${usernames[index]}@${hosts[index]}"
if [ -z ${passwords[index]} ]; then
ssh_script="ssh -o StrictHostKeyChecking=no ${usernames[index]}@${hosts[index]}"
fi
local script="cp -rf ${workdirs[index]}/TDinternal/debug/build/bin/taosBenchmark ${workdirs[index]}/TDinternal/debug/build/bin/taosdemo 2>/dev/null"
cmd="${ssh_script} sh -c \"$script\""
${cmd}
}
function run_thread() {
local index=$1
local thread_no=$2
local runcase_script="sshpass -p ${passwords[index]} ssh -o StrictHostKeyChecking=no ${usernames[index]}@${hosts[index]}"
if [ -z ${passwords[index]} ]; then
runcase_script="ssh -o StrictHostKeyChecking=no ${usernames[index]}@${hosts[index]}"
fi
local count=0
local script="${workdirs[index]}/TDinternal/community/tests/parallel_test/run_container.sh"
local cmd="${runcase_script} ${script}"
# script="echo"
while [ 1 ]; do
local line=`flock -x $lock_file -c "head -n1 $task_file;sed -i \"1d\" $task_file"`
if [ "x$line" = "x%%FINISHED%%" ]; then
# echo "$index . $thread_no EXIT"
break
fi
if [ -z "$line" ]; then
continue
fi
echo "$line"|grep -q "^#"
if [ $? -eq 0 ]; then
continue
fi
local case_redo_time=`echo "$line"|cut -d, -f2`
if [ -z "$case_redo_time" ]; then
case_redo_time=${DEFAULT_RETRY_TIME:-2}
fi
local exec_dir=`echo "$line"|cut -d, -f3`
local case_cmd=`echo "$line"|cut -d, -f4`
local case_file=""
echo "$case_cmd"|grep -q "^python3"
if [ $? -eq 0 ]; then
case_file=`echo "$case_cmd"|grep -o ".*\.py"|awk '{print $NF}'`
fi
echo "$case_cmd"|grep -q "\.sim"
if [ $? -eq 0 ]; then
case_file=`echo "$case_cmd"|grep -o ".*\.sim"|awk '{print $NF}'`
fi
if [ -z "$case_file" ]; then
case_file=`echo "$case_cmd"|awk '{print $NF}'`
fi
if [ -z "$case_file" ]; then
continue
fi
case_file="$exec_dir/${case_file}.${index}.${thread_no}"
count=$(( count + 1 ))
local case_path=`dirname "$case_file"`
if [ ! -z "$case_path" ]; then
mkdir -p $log_dir/$case_path
fi
cmd="${runcase_script} ${script} -w ${workdirs[index]} -c \"${case_cmd}\" -t ${thread_no} -d ${exec_dir}"
# echo "$thread_no $count $cmd"
local ret=0
local redo_count=1
start_time=`date +%s`
while [ ${redo_count} -lt 6 ]; do
echo "${hosts[index]}-${thread_no} order:${count}, redo:${redo_count} task:${line}" >$log_dir/$case_file.log
echo -e "\e[33m >>>>> \e[0m ${case_cmd}"
date >>$log_dir/$case_file.log
# $cmd 2>&1 | tee -a $log_dir/$case_file.log
# ret=${PIPESTATUS[0]}
$cmd >>$log_dir/$case_file.log 2>&1
ret=$?
if [ $ret -eq 0 ]; then
break
fi
redo=0
grep -q "wait too long for taosd start" $log_dir/$case_file.log
if [ $? -eq 0 ]; then
redo=1
fi
grep -q "kex_exchange_identification: Connection closed by remote host" $log_dir/$case_file.log
if [ $? -eq 0 ]; then
redo=1
fi
grep -q "ssh_exchange_identification: Connection closed by remote host" $log_dir/$case_file.log
if [ $? -eq 0 ]; then
redo=1
fi
grep -q "kex_exchange_identification: read: Connection reset by peer" $log_dir/$case_file.log
if [ $? -eq 0 ]; then
redo=1
fi
grep -q "Database not ready" $log_dir/$case_file.log
if [ $? -eq 0 ]; then
redo=1
fi
grep -q "Unable to establish connection" $log_dir/$case_file.log
if [ $? -eq 0 ]; then
redo=1
fi
if [ $redo_count -lt $case_redo_time ]; then
redo=1
fi
if [ $redo -eq 0 ]; then
break
fi
redo_count=$(( redo_count + 1 ))
done
end_time=`date +%s`
echo >>$log_dir/$case_file.log
echo "${hosts[index]} execute time: $(( end_time - start_time ))s" >>$log_dir/$case_file.log
# echo "$thread_no ${line} DONE"
if [ $ret -ne 0 ]; then
flock -x $lock_file -c "echo \"${hosts[index]} ret:${ret} ${line}\" >>$log_dir/failed.log"
mkdir -p $log_dir/${case_file}.coredump
local remote_coredump_dir="${workdirs[index]}/tmp/thread_volume/$thread_no/coredump"
cmd="sshpass -p ${passwords[index]} scp -o StrictHostKeyChecking=no ${usernames[index]}@${hosts[index]}:${remote_coredump_dir}/* $log_dir/${case_file}.coredump/"
if [ -z ${passwords[index]} ]; then
cmd="scp -o StrictHostKeyChecking=no ${usernames[index]}@${hosts[index]}:${remote_coredump_dir}/* $log_dir/${case_file}.coredump/"
fi
$cmd # 2>/dev/null
local case_info=`echo "$line"|cut -d, -f 3,4`
local corefile=`ls $log_dir/${case_file}.coredump/`
corefile=`find $log_dir/${case_file}.coredump/ -name "core.*"`
echo -e "$case_info \e[31m failed\e[0m"
echo "=========================log============================"
cat $log_dir/$case_file.log
echo "====================================================="
echo -e "\e[34m log file: $log_dir/$case_file.log \e[0m"
if [ ! -z "$corefile" ]; then
echo -e "\e[34m corefiles: $corefile \e[0m"
fi
fi
done
}
# echo "hosts: ${hosts[@]}"
# echo "usernames: ${usernames[@]}"
# echo "passwords: ${passwords[@]}"
# echo "workdirs: ${workdirs[@]}"
# echo "threads: ${threads[@]}"
# TODO: check host accessibility
i=0
while [ $i -lt ${#hosts[*]} ]; do
clean_tmp $i &
i=$(( i + 1 ))
done
wait
mkdir -p $log_dir
rm -rf $log_dir/*
task_file=$log_dir/$$.task
lock_file=$log_dir/$$.lock
i=0
while [ $i -lt ${#hosts[*]} ]; do
# build_src $i &
rename_taosdemo $i &
i=$(( i + 1 ))
done
wait
# if [ -f "$log_dir/failed.log" ]; then
# cat $log_dir/failed.log
# exit 1
# fi
i=0
j=0
while [ $i -lt ${#hosts[*]} ]; do
j=$(( j + threads[i] ))
i=$(( i + 1 ))
done
prepare_cases $j
i=0
while [ $i -lt ${#hosts[*]} ]; do
j=0
while [ $j -lt ${threads[i]} ]; do
run_thread $i $j &
j=$(( j + 1 ))
done
i=$(( i + 1 ))
done
wait
rm -f $lock_file
rm -f $task_file
# docker ps -a|grep -v CONTAINER|awk '{print $1}'|xargs docker rm -f
RET=0
i=1
if [ -f "$log_dir/failed.log" ]; then
echo "====================================================="
while read line; do
line=`echo "$line"|cut -d, -f 3,4`
echo -e "$i. $line \e[31m failed\e[0m" >&2
i=$(( i + 1 ))
done <$log_dir/failed.log
RET=1
fi
echo "${log_dir}" >&2
date
exit $RET
#!/bin/bash
CONTAINER_TESTDIR=/home/community
# CONTAINER_TESTDIR=/root/tang/repository/TDengine
# export PATH=$PATH:$CONTAINER_TESTDIR/debug/build/bin
function usage() {
echo "$0"
echo -e "\t -d execution dir"
echo -e "\t -c command"
echo -e "\t -h help"
}
while getopts "d:c:h" opt; do
case $opt in
d)
exec_dir=$OPTARG
;;
c)
cmd=$OPTARG
;;
h)
usage
exit 0
;;
\?)
echo "Invalid option: -$OPTARG"
usage
exit 0
;;
esac
done
if [ -z "$exec_dir" ]; then
usage
exit 0
fi
if [ -z "$cmd" ]; then
usage
exit 0
fi
go env -w GOPROXY=https://goproxy.cn
echo "StrictHostKeyChecking no" >>/etc/ssh/ssh_config
ln -s /home/debug/build/lib/libtaos.so /usr/lib/libtaos.so 2>/dev/null
npm config -g set unsafe-perm
npm config -g set registry https://registry.npm.taobao.org
mkdir -p /home/sim/tsim
mkdir -p /var/lib/taos/subscribe
rm -rf ${CONTAINER_TESTDIR}/src/connector/nodejs/node_modules
rm -rf ${CONTAINER_TESTDIR}/tests/examples/nodejs/node_modules
rm -rf ${CONTAINER_TESTDIR}/tests/connectorTest/nodejsTest/nanosupport/node_modules
# ln -s /home/node_modules ${CONTAINER_TESTDIR}/src/connector/nodejs/
# ln -s /home/node_modules ${CONTAINER_TESTDIR}/tests/examples/nodejs/
# ln -s /home/node_modules ${CONTAINER_TESTDIR}/tests/connectorTest/nodejsTest/nanosupport/
# echo "$cmd"|grep -q "nodejs"
# if [ $? -eq 0 ]; then
# cd $CONTAINER_TESTDIR/src/connector/nodejs
# npm install node-gyp-build@4.3.0 --ignore-scripts
# fi
cd $CONTAINER_TESTDIR/tests/$exec_dir
ulimit -c unlimited
$cmd
RET=$?
if [ $RET -ne 0 ]; then
pwd
fi
exit $RET
#!/bin/bash
function usage() {
echo "$0"
echo -e "\t -w work dir"
echo -e "\t -d execution dir"
echo -e "\t -c command"
echo -e "\t -t thread number"
echo -e "\t -h help"
}
while getopts "w:d:c:t:h" opt; do
case $opt in
w)
WORKDIR=$OPTARG
;;
d)
exec_dir=$OPTARG
;;
c)
cmd=$OPTARG
;;
t)
thread_no=$OPTARG
;;
h)
usage
exit 0
;;
\?)
echo "Invalid option: -$OPTARG"
usage
exit 0
;;
esac
done
if [ -z "$WORKDIR" ]; then
usage
exit 1
fi
if [ -z "$exec_dir" ]; then
usage
exit 1
fi
if [ -z "$cmd" ]; then
usage
exit 1
fi
if [ -z "$thread_no" ]; then
usage
exit 1
fi
ulimit -c unlimited
INTERNAL_REPDIR=$WORKDIR/TDinternal
REPDIR=$INTERNAL_REPDIR/community
CONTAINER_TESTDIR=/home/community
TMP_DIR=$WORKDIR/tmp
MOUNT_DIR=""
mkdir -p ${TMP_DIR}/thread_volume/$thread_no/sim/tsim
mkdir -p ${TMP_DIR}/thread_volume/$thread_no/node_modules
mkdir -p ${TMP_DIR}/thread_volume/$thread_no/coredump
rm -rf ${TMP_DIR}/thread_volume/$thread_no/coredump/*
if [ ! -d "${TMP_DIR}/thread_volume/$thread_no/$exec_dir" ]; then
subdir=`echo "$exec_dir"|cut -d/ -f1`
echo "cp -rf ${REPDIR}/tests/$subdir ${TMP_DIR}/thread_volume/$thread_no/"
cp -rf ${REPDIR}/tests/$subdir ${TMP_DIR}/thread_volume/$thread_no/
fi
MOUNT_DIR="$TMP_DIR/thread_volume/$thread_no/$exec_dir:$CONTAINER_TESTDIR/tests/$exec_dir"
echo "$thread_no -> ${exec_dir}:$cmd"
echo "$cmd"|grep -q "nodejs"
if [ $? -eq 0 ]; then
MOUNT_NODE_MOD="-v $TMP_DIR/thread_volume/$thread_no/node_modules:${CONTAINER_TESTDIR}/src/connector/nodejs/node_modules \
-v $TMP_DIR/thread_volume/$thread_no/node_modules:${CONTAINER_TESTDIR}/tests/examples/nodejs/node_modules \
-v $TMP_DIR/thread_volume/$thread_no/node_modules:${CONTAINER_TESTDIR}/tests/connectorTest/nodejsTest/nanosupport/node_modules"
fi
if [ -f "$REPDIR/src/plugins/taosadapter/example/config/taosadapter.toml" ]; then
TAOSADAPTER_TOML="-v $REPDIR/src/plugins/taosadapter/example/config/taosadapter.toml:/etc/taos/taosadapter.toml:ro"
fi
docker run \
-v $REPDIR/tests:$CONTAINER_TESTDIR/tests \
-v $MOUNT_DIR \
-v "$TMP_DIR/thread_volume/$thread_no/sim:${CONTAINER_TESTDIR}/sim" \
-v ${TMP_DIR}/thread_volume/$thread_no/coredump:/home/coredump \
-v $INTERNAL_REPDIR/debug:/home/debug:ro \
-v $REPDIR/deps:$CONTAINER_TESTDIR/deps:ro \
-v $REPDIR/src:$CONTAINER_TESTDIR/src \
-v $REPDIR/src/inc/taos.h:/usr/include/taos.h:ro \
$TAOSADAPTER_TOML \
-v $REPDIR/tests/examples:$CONTAINER_TESTDIR/tests/examples \
-v $REPDIR/snap:$CONTAINER_TESTDIR/snap:ro \
-v $REPDIR/alert:$CONTAINER_TESTDIR/alert:ro \
-v $REPDIR/packaging/cfg/taos.cfg:/etc/taos/taos.cfg:ro \
-v $REPDIR/packaging:$CONTAINER_TESTDIR/packaging:ro \
-v $REPDIR/README.md:$CONTAINER_TESTDIR/README.md:ro \
-v $REPDIR/src/connector/python/taos:/usr/local/lib/python3.8/site-packages/taos:ro \
-e LD_LIBRARY_PATH=/home/debug/build/lib:/home/debug/build/lib64 \
-e PATH=/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/debug/build/bin:/usr/local/go/bin:/usr/local/node-v12.20.0-linux-x64/bin:/usr/local/apache-maven-3.8.4/bin:/usr/local/jdk1.8.0_144/bin \
-e JAVA_HOME=/usr/local/jdk1.8.0_144 \
--rm --ulimit core=-1 taos_test:v1.0 $CONTAINER_TESTDIR/tests/parallel_test/run_case.sh -d "$exec_dir" -c "$cmd"
ret=$?
exit $ret
# -*- coding: utf-8 -*-
import random
import string
import subprocess
import sys
from util.log import *
from util.cases import *
from util.sql import *
class TDTestCase:
def init(self, conn, logSql):
tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor(), logSql)
def run(self):
tdLog.debug("check databases")
tdSql.prepare()
### test normal table
tdSql.execute("create database if not exists db")
tdSql.execute("use db")
tdSql.execute("create stable `sch.job.create` (`ts` TIMESTAMP, `tint` int, `node.value` NCHAR(7)) TAGS (`endpoint` NCHAR(7),`task.type` NCHAR(3))")
tdSql.execute("alter table `sch.job.create` modify tag `task.type` NCHAR(4)")
tdSql.execute("alter table `sch.job.create` change tag `task.type` `chan.type`")
tdSql.execute("alter table `sch.job.create` drop tag `chan.type`")
tdSql.execute("alter table `sch.job.create` add tag `add.type` NCHAR(6)")
tdSql.query("describe `sch.job.create`")
tdSql.checkData(4, 0, "add.type")
tdSql.execute("alter table `sch.job.create` modify column `node.value` NCHAR(8)")
tdSql.execute("alter table `sch.job.create` drop column `node.value`")
tdSql.execute("alter table `sch.job.create` add column `add.value` NCHAR(6)")
tdSql.query("describe `sch.job.create`")
tdSql.checkData(2, 0, "add.value")
tdSql.execute("insert into `tsch.job.create` using `sch.job.create`(`add.type`) TAGS('tag1') values(now, 1, 'here')")
tdSql.execute("alter table `tsch.job.create` set tag `add.type` = 'tag2'")
tdSql.query("select `add.type` from `tsch.job.create`")
tdSql.checkData(0, 0, "tag2")
### test stable
tdSql.execute("create stable `ssch.job.create` (`ts` TIMESTAMP, `tint` int, `node.value` NCHAR(7)) TAGS (`endpoint` NCHAR(7),`task.type` NCHAR(3))")
tdSql.execute("alter stable `ssch.job.create` modify tag `task.type` NCHAR(4)")
tdSql.execute("alter stable `ssch.job.create` change tag `task.type` `chan.type`")
tdSql.execute("alter stable `ssch.job.create` drop tag `chan.type`")
tdSql.execute("alter stable `ssch.job.create` add tag `add.type` NCHAR(6)")
tdSql.query("describe `ssch.job.create`")
tdSql.checkData(4, 0, "add.type")
tdSql.execute("alter stable `ssch.job.create` modify column `node.value` NCHAR(8)")
tdSql.execute("alter stable `ssch.job.create` drop column `node.value`")
tdSql.execute("alter stable `ssch.job.create` add column `add.value` NCHAR(6)")
tdSql.query("describe `ssch.job.create`")
tdSql.checkData(2, 0, "add.value")
tdSql.execute("insert into `tssch.job.create` using `ssch.job.create`(`add.type`) TAGS('tag1') values(now, 1, 'here')")
tdSql.error("alter stable `tssch.job.create` set tag `add.type` = 'tag2'")
def stop(self):
tdSql.close()
tdLog.success("%s successfully executed" % __file__)
tdCases.addWindows(__file__, TDTestCase())
tdCases.addLinux(__file__, TDTestCase())
\ No newline at end of file
...@@ -417,6 +417,7 @@ python3 ./test.py -f insert/flushwhiledrop.py ...@@ -417,6 +417,7 @@ python3 ./test.py -f insert/flushwhiledrop.py
python3 ./test.py -f alter/alterColMultiTimes.py python3 ./test.py -f alter/alterColMultiTimes.py
python3 ./test.py -f query/queryWildcardLength.py python3 ./test.py -f query/queryWildcardLength.py
python3 ./test.py -f query/queryTbnameUpperLower.py python3 ./test.py -f query/queryTbnameUpperLower.py
python3 ./test.py -f alter/alterBackQuoteCol.py
python3 ./test.py -f query/query.py python3 ./test.py -f query/query.py
python3 ./test.py -f query/queryDiffColsTagsAndOr.py python3 ./test.py -f query/queryDiffColsTagsAndOr.py
......
...@@ -130,9 +130,16 @@ class TDTestCase: ...@@ -130,9 +130,16 @@ class TDTestCase:
if 'httpDbNameMandatory' not in rj: if 'httpDbNameMandatory' not in rj:
tdLog.info('has no httpDbNameMandatory shown') tdLog.info('has no httpDbNameMandatory shown')
tdLog.exit(1) tdLog.exit(1)
if rj['httpDbNameMandatory'] != '1': val = None
pname = 'taosadapter' #httpDbNameMandatory doesn't work in taosadapter
cmd = 'ps -ef|grep %s|grep -v "grep"' % pname
p = subprocess.Popen(cmd,shell=True, stdout=subprocess.PIPE)
if p.wait() == 0:
val = p.stdout.read()
if rj['httpDbNameMandatory'] != '1' and pname not in str(val):
tdLog.info('httpDbNameMandatory data:%s == expect:0'%rj['httpDbNameMandatory']) tdLog.info('httpDbNameMandatory data:%s == expect:0'%rj['httpDbNameMandatory'])
tdLog.exit(1) tdLog.exit(1)
if pname not in str(val):
tdLog.info("httpDbNameMandatory by restful query data:%s == expect:1" % (rj['httpDbNameMandatory'])) tdLog.info("httpDbNameMandatory by restful query data:%s == expect:1" % (rj['httpDbNameMandatory']))
def run(self): def run(self):
......
...@@ -56,6 +56,13 @@ class TDTestCase: ...@@ -56,6 +56,13 @@ class TDTestCase:
self.test_case2() self.test_case2()
tdLog.debug(" LIMIT test_case2 ............ [OK]") tdLog.debug(" LIMIT test_case2 ............ [OK]")
# insert data
self.insert_data("t2", self.ts, 100*10000, 30000);
self.insert_data("t3", self.ts, 200*10000, 30000);
# test supper table
self.test_limit()
tdLog.debug(" LIMIT test super table ............ [OK]")
# stop # stop
def stop(self): def stop(self):
...@@ -186,6 +193,31 @@ class TDTestCase: ...@@ -186,6 +193,31 @@ class TDTestCase:
tdSql.waitedQuery(sql, 3, WAITS) tdSql.waitedQuery(sql, 3, WAITS)
tdSql.checkData(0, 1, 1) tdSql.checkData(0, 1, 1)
# test limit
def test_limit(self):
#
# base test
#
# offset
sql = "select * from st order by ts limit 20"
tdSql.waitedQuery(sql, 20, WAITS)
tdSql.checkData(19, 1, 6)
sql = "select * from st order by ts desc limit 20"
tdSql.waitedQuery(sql, 20, WAITS)
tdSql.checkData(19, 1, 2999980)
sql = "select * from st where ts>='2017-07-14 10:40:10' and ts<'2017-07-22 18:40:10' order by ts limit 16;"
tdSql.waitedQuery(sql, 16, WAITS)
tdSql.checkData(15, 1, 15)
sql = "select * from st where ts>='2017-07-14 10:40:10' and ts<'2017-07-22 18:40:10' order by ts desc limit 16;"
tdSql.waitedQuery(sql, 16, WAITS)
tdSql.checkData(15, 1, 720004)
sql = "select * from st where ts>='2017-07-14 10:40:10' and ts<'2017-07-22 18:40:10' order by ts desc limit 16;"
tdSql.waitedQuery(sql, 16, WAITS)
tdSql.checkData(15, 1, 720004)
sql = "select * from st where ts>='2017-07-14 10:40:10' and ts<'2017-07-22 18:40:10' order by ts desc limit 16 offset 3;"
tdSql.waitedQuery(sql, 16, WAITS)
tdSql.checkData(15, 1, 720003)
# #
# add case with filename # add case with filename
......
...@@ -59,7 +59,7 @@ class TDTestCase: ...@@ -59,7 +59,7 @@ class TDTestCase:
tdSql.query("select * from db.t1") tdSql.query("select * from db.t1")
tdSql.checkRows(insertRows) tdSql.checkRows(insertRows)
for k in range(0,100): for k in range(0,10):
tdLog.info("insert %d rows" % (insertRows)) tdLog.info("insert %d rows" % (insertRows))
temp='' temp=''
for i in range (0,insertRows): for i in range (0,insertRows):
...@@ -75,6 +75,7 @@ class TDTestCase: ...@@ -75,6 +75,7 @@ class TDTestCase:
tdDnodes.start(1) tdDnodes.start(1)
tdSql.query("select * from db.t1") tdSql.query("select * from db.t1")
tdSql.checkRows(insertRows+200*k) tdSql.checkRows(insertRows+200*k)
insertRows = insertRows * 2
print("==========step3") print("==========step3")
print("insert into another table ") print("insert into another table ")
s = 'use db' s = 'use db'
......
...@@ -293,7 +293,7 @@ class TDDnode: ...@@ -293,7 +293,7 @@ class TDDnode:
print(cmd) print(cmd)
taosadapterCmd = "nohup %s > /dev/null 2>&1 & " % ( taosadapterCmd = "nohup %s --opentsdb_telnet.enable=true > /dev/null 2>&1 & " % (
taosadapterBinPath) taosadapterBinPath)
if os.system(taosadapterCmd) != 0: if os.system(taosadapterCmd) != 0:
tdLog.exit(taosadapterCmd) tdLog.exit(taosadapterCmd)
......
...@@ -117,7 +117,7 @@ if $data00 != NULL then ...@@ -117,7 +117,7 @@ if $data00 != NULL then
endi endi
sql select count(*), a from mt_unsigned_1 group by a; sql select count(*), a from mt_unsigned_1 group by a;
if $rows != 1 then if $rows != 2 then
return -1 return -1
endi endi
...@@ -125,12 +125,20 @@ if $data00 != 1 then ...@@ -125,12 +125,20 @@ if $data00 != 1 then
return -1 return -1
endi endi
if $data01 != 1 then if $data01 != NULL then
return -1
endi
if $data10 != 1 then
return -1
endi
if $data11 != 1 then
return -1 return -1
endi endi
sql select count(*), b from mt_unsigned_1 group by b; sql select count(*), b from mt_unsigned_1 group by b;
if $rows != 1 then if $rows != 2 then
return -1 return -1
endi endi
...@@ -138,12 +146,20 @@ if $data00 != 1 then ...@@ -138,12 +146,20 @@ if $data00 != 1 then
return -1 return -1
endi endi
if $data01 != 2 then if $data01 != NULL then
return -1
endi
if $data10 != 1 then
return -1
endi
if $data11 != 2 then
return -1 return -1
endi endi
sql select count(*), c from mt_unsigned_1 group by c; sql select count(*), c from mt_unsigned_1 group by c;
if $rows != 1 then if $rows != 2 then
return -1 return -1
endi endi
...@@ -151,12 +167,20 @@ if $data00 != 1 then ...@@ -151,12 +167,20 @@ if $data00 != 1 then
return -1 return -1
endi endi
if $data01 != 3 then if $data01 != NULL then
return -1
endi
if $data10 != 1 then
return -1
endi
if $data11 != 3 then
return -1 return -1
endi endi
sql select count(*), d from mt_unsigned_1 group by d; sql select count(*), d from mt_unsigned_1 group by d;
if $rows != 1 then if $rows != 2 then
return -1 return -1
endi endi
...@@ -164,7 +188,15 @@ if $data00 != 1 then ...@@ -164,7 +188,15 @@ if $data00 != 1 then
return -1 return -1
endi endi
if $data01 != 4 then if $data01 != NULL then
return -1
endi
if $data10 != 1 then
return -1
endi
if $data11 != 4 then
return -1 return -1
endi endi
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册