提交 db7f2f84 编写于 作者: G Ganlin Zhao

Merge branch 'master' into fix/TD-11891-master

version: 1.0.{build}
image:
- Visual Studio 2015
- macos
environment:
matrix:
- ARCH: amd64
- ARCH: x86
matrix:
exclude:
- image: macos
ARCH: x86
for:
-
matrix:
only:
- image: Visual Studio 2015
clone_folder: c:\dev\TDengine
clone_depth: 1
init:
- call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" %ARCH%
before_build:
- cd c:\dev\TDengine
- md build
build_script:
- cd build
- cmake -G "NMake Makefiles" .. -DBUILD_JDBC=false
- nmake install
-
matrix:
only:
- image: macos
clone_depth: 1
build_script:
- mkdir debug
- cd debug
- cmake .. > /dev/null
- make > /dev/null
notifications:
- provider: Email
to:
- sangshuduo@gmail.com
on_build_success: true
on_build_failure: true
on_build_status_changed: true
...@@ -38,7 +38,8 @@ def pre_test(){ ...@@ -38,7 +38,8 @@ def pre_test(){
sudo rmtaos || echo "taosd has not installed" sudo rmtaos || echo "taosd has not installed"
''' '''
sh ''' sh '''
killall -9 taosd ||echo "no taosd running" kill -9 $(pidof taosd) ||echo "no taosd running"
kill -9 $(pidof taosadapter) ||echo "no taosadapter running"
killall -9 gdb || echo "no gdb running" killall -9 gdb || echo "no gdb running"
killall -9 python3.8 || echo "no python program running" killall -9 python3.8 || echo "no python program running"
cd ${WKC} cd ${WKC}
......
...@@ -349,8 +349,16 @@ if [[ "$dbName" == "kh" ]]; then ...@@ -349,8 +349,16 @@ if [[ "$dbName" == "kh" ]]; then
sed -i "s/taos\.cfg/kinghistorian\.cfg/g" ${top_dir}/src/util/src/tconfig.c sed -i "s/taos\.cfg/kinghistorian\.cfg/g" ${top_dir}/src/util/src/tconfig.c
sed -i "s/etc\/taos/etc\/kinghistorian/g" ${top_dir}/src/util/src/tconfig.c sed -i "s/etc\/taos/etc\/kinghistorian/g" ${top_dir}/src/util/src/tconfig.c
# src/kit/taosdemo/taosdemo.c # src/kit/taosdemo/taosdemo.c
sed -i "s/taosdemo --help/khdemo --help/g" ${top_dir}/src/kit/taosdemo/taosdemo.c
sed -i "s/taosdemo --usage/khdemo --usage/g" ${top_dir}/src/kit/taosdemo/taosdemo.c
sed -i "s/Usage: taosdemo/Usage: khdemo/g" ${top_dir}/src/kit/taosdemo/taosdemo.c
sed -i "s/taosdemo is simulating/khdemo is simulating/g" ${top_dir}/src/kit/taosdemo/taosdemo.c
sed -i "s/taosdemo version/khdemo version/g" ${top_dir}/src/kit/taosdemo/taosdemo.c
sed -i "s/\"taosdata\"/\"khroot\"/g" ${top_dir}/src/kit/taosdemo/taosdemo.c sed -i "s/\"taosdata\"/\"khroot\"/g" ${top_dir}/src/kit/taosdemo/taosdemo.c
sed -i "s/support@taosdata.com/support@wellintech.com/g" ${top_dir}/src/kit/taosdemo/taosdemo.c sed -i "s/support@taosdata.com/support@wellintech.com/g" ${top_dir}/src/kit/taosdemo/taosdemo.c
sed -i "s/taosc, rest, and stmt/khclient, rest, and stmt/g" ${top_dir}/src/kit/taosdemo/taosdemo.c
sed -i "s/taosdemo uses/khdemo uses/g" ${top_dir}/src/kit/taosdemo/taosdemo.c
sed -i "s/use 'taosc'/use 'khclient'/g" ${top_dir}/src/kit/taosdemo/taosdemo.c
# src/util/src/tlog.c # src/util/src/tlog.c
sed -i "s/log\/taos/log\/kinghistorian/g" ${top_dir}/src/util/src/tlog.c sed -i "s/log\/taos/log\/kinghistorian/g" ${top_dir}/src/util/src/tlog.c
# src/dnode/src/dnodeSystem.c # src/dnode/src/dnodeSystem.c
...@@ -363,7 +371,7 @@ if [[ "$dbName" == "kh" ]]; then ...@@ -363,7 +371,7 @@ if [[ "$dbName" == "kh" ]]; then
sed -i "s/taosinfo/khinfo/g" ${top_dir}/src/util/src/tnote.c sed -i "s/taosinfo/khinfo/g" ${top_dir}/src/util/src/tnote.c
# src/dnode/CMakeLists.txt # src/dnode/CMakeLists.txt
sed -i "s/taos\.cfg/kinghistorian\.cfg/g" ${top_dir}/src/dnode/CMakeLists.txt sed -i "s/taos\.cfg/kinghistorian\.cfg/g" ${top_dir}/src/dnode/CMakeLists.txt
# src/dnode/CMakeLists.txt # src/kit/taosdump/taosdump.c
sed -i "s/Default is taosdata/Default is khroot/g" ${top_dir}/src/kit/taosdump/taosdump.c sed -i "s/Default is taosdata/Default is khroot/g" ${top_dir}/src/kit/taosdump/taosdump.c
sed -i "s/\"taosdata\"/\"khroot\"/g" ${top_dir}/src/kit/taosdump/taosdump.c sed -i "s/\"taosdata\"/\"khroot\"/g" ${top_dir}/src/kit/taosdump/taosdump.c
sed -i "s/TDengine/KingHistorian/g" ${top_dir}/src/kit/taosdump/taosdump.c sed -i "s/TDengine/KingHistorian/g" ${top_dir}/src/kit/taosdump/taosdump.c
...@@ -372,6 +380,12 @@ if [[ "$dbName" == "kh" ]]; then ...@@ -372,6 +380,12 @@ if [[ "$dbName" == "kh" ]]; then
sed -i "s/etc\/taos/etc\/kinghistorian/g" ${top_dir}/src/os/src/linux/linuxEnv.c sed -i "s/etc\/taos/etc\/kinghistorian/g" ${top_dir}/src/os/src/linux/linuxEnv.c
sed -i "s/lib\/taos/lib\/kinghistorian/g" ${top_dir}/src/os/src/linux/linuxEnv.c sed -i "s/lib\/taos/lib\/kinghistorian/g" ${top_dir}/src/os/src/linux/linuxEnv.c
sed -i "s/log\/taos/log\/kinghistorian/g" ${top_dir}/src/os/src/linux/linuxEnv.c sed -i "s/log\/taos/log\/kinghistorian/g" ${top_dir}/src/os/src/linux/linuxEnv.c
# src/kit/shell/src/shellDarwin.c
sed -i "s/TDengine shell/KingHistorian shell/g" ${top_dir}/src/kit/shell/src/shellDarwin.c
sed -i "s/2020 by TAOS Data/2021 by Wellintech/g" ${top_dir}/src/kit/shell/src/shellDarwin.c
# src/kit/shell/src/shellLinux.c
sed -i "s/TDengine shell/KingHistorian shell/g" ${top_dir}/src/kit/shell/src/shellLinux.c
sed -i "s/2020 by TAOS Data/2021 by Wellintech/g" ${top_dir}/src/kit/shell/src/shellLinux.c
# src/os/src/windows/wEnv.c # src/os/src/windows/wEnv.c
sed -i "s/TDengine/KingHistorian/g" ${top_dir}/src/os/src/windows/wEnv.c sed -i "s/TDengine/KingHistorian/g" ${top_dir}/src/os/src/windows/wEnv.c
# src/kit/shell/src/shellEngine.c # src/kit/shell/src/shellEngine.c
......
...@@ -188,9 +188,6 @@ function update() { ...@@ -188,9 +188,6 @@ function update() {
install_log install_log
install_header install_header
install_lib install_lib
if [ "$pagMode" != "lite" ]; then
install_connector
fi
install_examples install_examples
install_bin install_bin
install_config install_config
...@@ -215,9 +212,6 @@ function install() { ...@@ -215,9 +212,6 @@ function install() {
install_log install_log
install_header install_header
install_lib install_lib
if [ "$pagMode" != "lite" ]; then
install_connector
fi
install_examples install_examples
install_bin install_bin
install_config install_config
......
...@@ -189,9 +189,6 @@ function update() { ...@@ -189,9 +189,6 @@ function update() {
install_log install_log
install_header install_header
install_lib install_lib
if [ "$pagMode" != "lite" ]; then
install_connector
fi
install_examples install_examples
install_bin install_bin
install_config install_config
...@@ -216,9 +213,6 @@ function install() { ...@@ -216,9 +213,6 @@ function install() {
install_log install_log
install_header install_header
install_lib install_lib
if [ "$pagMode" != "lite" ]; then
install_connector
fi
install_examples install_examples
install_bin install_bin
install_config install_config
......
...@@ -246,9 +246,6 @@ function update_PowerDB() { ...@@ -246,9 +246,6 @@ function update_PowerDB() {
install_log install_log
install_header install_header
install_lib install_lib
if [ "$pagMode" != "lite" ]; then
install_connector
fi
install_examples install_examples
install_bin install_bin
install_config install_config
...@@ -274,9 +271,6 @@ function install_PowerDB() { ...@@ -274,9 +271,6 @@ function install_PowerDB() {
install_header install_header
install_lib install_lib
install_jemalloc install_jemalloc
if [ "$pagMode" != "lite" ]; then
install_connector
fi
install_examples install_examples
install_bin install_bin
install_config install_config
......
...@@ -188,9 +188,6 @@ function update_prodb() { ...@@ -188,9 +188,6 @@ function update_prodb() {
install_log install_log
install_header install_header
install_lib install_lib
if [ "$pagMode" != "lite" ]; then
install_connector
fi
install_examples install_examples
install_bin install_bin
install_config install_config
...@@ -215,9 +212,6 @@ function install_prodb() { ...@@ -215,9 +212,6 @@ function install_prodb() {
install_log install_log
install_header install_header
install_lib install_lib
if [ "$pagMode" != "lite" ]; then
install_connector
fi
install_examples install_examples
install_bin install_bin
install_config install_config
......
...@@ -192,9 +192,6 @@ function update_tq() { ...@@ -192,9 +192,6 @@ function update_tq() {
install_log install_log
install_header install_header
install_lib install_lib
if [ "$pagMode" != "lite" ]; then
install_connector
fi
install_examples install_examples
install_bin install_bin
install_config install_config
...@@ -219,9 +216,6 @@ function install_tq() { ...@@ -219,9 +216,6 @@ function install_tq() {
install_log install_log
install_header install_header
install_lib install_lib
if [ "$pagMode" != "lite" ]; then
install_connector
fi
install_examples install_examples
install_bin install_bin
install_config install_config
......
...@@ -69,10 +69,10 @@ if [ "$osType" != "Darwin" ]; then ...@@ -69,10 +69,10 @@ if [ "$osType" != "Darwin" ]; then
if [ "$pagMode" == "lite" ]; then if [ "$pagMode" == "lite" ]; then
strip ${build_dir}/bin/taos strip ${build_dir}/bin/taos
cp ${build_dir}/bin/taos ${install_dir}/bin/jh_taos cp ${build_dir}/bin/taos ${install_dir}/bin/jh_taos
cp ${script_dir}/remove_jh.sh ${install_dir}/bin cp ${script_dir}/remove_client_jh.sh ${install_dir}/bin
else else
cp ${build_dir}/bin/taos ${install_dir}/bin/jh_taos cp ${build_dir}/bin/taos ${install_dir}/bin/jh_taos
cp ${script_dir}/remove_jh.sh ${install_dir}/bin cp ${script_dir}/remove_client_jh.sh ${install_dir}/bin
cp ${build_dir}/bin/taosdemo ${install_dir}/bin/jhdemo cp ${build_dir}/bin/taosdemo ${install_dir}/bin/jhdemo
cp ${build_dir}/bin/taosdump ${install_dir}/bin/jh_taosdump cp ${build_dir}/bin/taosdump ${install_dir}/bin/jh_taosdump
cp ${script_dir}/set_core.sh ${install_dir}/bin cp ${script_dir}/set_core.sh ${install_dir}/bin
......
...@@ -70,10 +70,10 @@ if [ "$osType" != "Darwin" ]; then ...@@ -70,10 +70,10 @@ if [ "$osType" != "Darwin" ]; then
if [ "$pagMode" == "lite" ]; then if [ "$pagMode" == "lite" ]; then
strip ${build_dir}/bin/taos strip ${build_dir}/bin/taos
cp ${build_dir}/bin/taos ${install_dir}/bin/khclient cp ${build_dir}/bin/taos ${install_dir}/bin/khclient
cp ${script_dir}/remove_kh.sh ${install_dir}/bin cp ${script_dir}/remove_client_kh.sh ${install_dir}/bin
else else
cp ${build_dir}/bin/taos ${install_dir}/bin/khclient cp ${build_dir}/bin/taos ${install_dir}/bin/khclient
cp ${script_dir}/remove_kh.sh ${install_dir}/bin cp ${script_dir}/remove_client_kh.sh ${install_dir}/bin
cp ${build_dir}/bin/taosdemo ${install_dir}/bin/khdemo cp ${build_dir}/bin/taosdemo ${install_dir}/bin/khdemo
cp ${build_dir}/bin/taosdump ${install_dir}/bin/khdump cp ${build_dir}/bin/taosdump ${install_dir}/bin/khdump
cp ${script_dir}/set_core.sh ${install_dir}/bin cp ${script_dir}/set_core.sh ${install_dir}/bin
......
...@@ -109,10 +109,10 @@ if [ "$osType" != "Darwin" ]; then ...@@ -109,10 +109,10 @@ if [ "$osType" != "Darwin" ]; then
if [ "$pagMode" == "lite" ]; then if [ "$pagMode" == "lite" ]; then
strip ${build_dir}/bin/taos strip ${build_dir}/bin/taos
cp ${build_dir}/bin/taos ${install_dir}/bin/power cp ${build_dir}/bin/taos ${install_dir}/bin/power
cp ${script_dir}/remove_power.sh ${install_dir}/bin cp ${script_dir}/remove_client_power.sh ${install_dir}/bin
else else
cp ${build_dir}/bin/taos ${install_dir}/bin/power cp ${build_dir}/bin/taos ${install_dir}/bin/power
cp ${script_dir}/remove_power.sh ${install_dir}/bin cp ${script_dir}/remove_client_power.sh ${install_dir}/bin
cp ${build_dir}/bin/taosdemo ${install_dir}/bin/powerdemo cp ${build_dir}/bin/taosdemo ${install_dir}/bin/powerdemo
cp ${build_dir}/bin/taosdump ${install_dir}/bin/powerdump cp ${build_dir}/bin/taosdump ${install_dir}/bin/powerdump
cp ${script_dir}/set_core.sh ${install_dir}/bin cp ${script_dir}/set_core.sh ${install_dir}/bin
......
...@@ -69,10 +69,10 @@ if [ "$osType" != "Darwin" ]; then ...@@ -69,10 +69,10 @@ if [ "$osType" != "Darwin" ]; then
if [ "$pagMode" == "lite" ]; then if [ "$pagMode" == "lite" ]; then
strip ${build_dir}/bin/taos strip ${build_dir}/bin/taos
cp ${build_dir}/bin/taos ${install_dir}/bin/prodbc cp ${build_dir}/bin/taos ${install_dir}/bin/prodbc
cp ${script_dir}/remove_pro.sh ${install_dir}/bin cp ${script_dir}/remove_client_pro.sh ${install_dir}/bin
else else
cp ${build_dir}/bin/taos ${install_dir}/bin/prodbc cp ${build_dir}/bin/taos ${install_dir}/bin/prodbc
cp ${script_dir}/remove_pro.sh ${install_dir}/bin cp ${script_dir}/remove_client_pro.sh ${install_dir}/bin
cp ${build_dir}/bin/taosdemo ${install_dir}/bin/prodemo cp ${build_dir}/bin/taosdemo ${install_dir}/bin/prodemo
cp ${build_dir}/bin/taosdump ${install_dir}/bin/prodump cp ${build_dir}/bin/taosdump ${install_dir}/bin/prodump
cp ${script_dir}/set_core.sh ${install_dir}/bin cp ${script_dir}/set_core.sh ${install_dir}/bin
......
...@@ -69,10 +69,10 @@ if [ "$osType" != "Darwin" ]; then ...@@ -69,10 +69,10 @@ if [ "$osType" != "Darwin" ]; then
if [ "$pagMode" == "lite" ]; then if [ "$pagMode" == "lite" ]; then
strip ${build_dir}/bin/taos strip ${build_dir}/bin/taos
cp ${build_dir}/bin/taos ${install_dir}/bin/tq cp ${build_dir}/bin/taos ${install_dir}/bin/tq
cp ${script_dir}/remove_tq.sh ${install_dir}/bin cp ${script_dir}/remove_client_tq.sh ${install_dir}/bin
else else
cp ${build_dir}/bin/taos ${install_dir}/bin/tq cp ${build_dir}/bin/taos ${install_dir}/bin/tq
cp ${script_dir}/remove_tq.sh ${install_dir}/bin cp ${script_dir}/remove_client_tq.sh ${install_dir}/bin
cp ${build_dir}/bin/taosdemo ${install_dir}/bin/tqdemo cp ${build_dir}/bin/taosdemo ${install_dir}/bin/tqdemo
cp ${build_dir}/bin/taosdump ${install_dir}/bin/tqdump cp ${build_dir}/bin/taosdump ${install_dir}/bin/tqdump
cp ${script_dir}/set_core.sh ${install_dir}/bin cp ${script_dir}/set_core.sh ${install_dir}/bin
......
...@@ -1527,6 +1527,41 @@ int stmtGenInsertStatement(SSqlObj* pSql, STscStmt* pStmt, const char* name, TAO ...@@ -1527,6 +1527,41 @@ int stmtGenInsertStatement(SSqlObj* pSql, STscStmt* pStmt, const char* name, TAO
return TSDB_CODE_SUCCESS; return TSDB_CODE_SUCCESS;
} }
int32_t stmtValidateValuesFields(SSqlCmd *pCmd, char * sql) {
int32_t loopCont = 1, index0 = 0, values = 0;
SStrToken sToken;
while (loopCont) {
sToken = tStrGetToken(sql, &index0, false);
if (sToken.n <= 0) {
return TSDB_CODE_SUCCESS;
}
switch (sToken.type) {
case TK_RP:
if (values) {
return TSDB_CODE_SUCCESS;
}
break;
case TK_VALUES:
values = 1;
break;
case TK_QUESTION:
case TK_LP:
break;
default:
if (values) {
tscError("only ? allowed in values");
return tscInvalidOperationMsg(pCmd->payload, "only ? allowed in values", NULL);
}
break;
}
}
return TSDB_CODE_SUCCESS;
}
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
// interface functions // interface functions
...@@ -1631,6 +1666,11 @@ int taos_stmt_prepare(TAOS_STMT* stmt, const char* sql, unsigned long length) { ...@@ -1631,6 +1666,11 @@ int taos_stmt_prepare(TAOS_STMT* stmt, const char* sql, unsigned long length) {
STMT_RET(ret); STMT_RET(ret);
} }
ret = stmtValidateValuesFields(&pSql->cmd, pSql->sqlstr);
if (ret != TSDB_CODE_SUCCESS) {
STMT_RET(ret);
}
if (pStmt->multiTbInsert) { if (pStmt->multiTbInsert) {
STMT_RET(TSDB_CODE_SUCCESS); STMT_RET(TSDB_CODE_SUCCESS);
} }
......
...@@ -34,10 +34,10 @@ void insertChar(Command *cmd, char *c, int size); ...@@ -34,10 +34,10 @@ void insertChar(Command *cmd, char *c, int size);
void printHelp() { void printHelp() {
char indent[10] = " "; char indent[10] = " ";
printf("taos shell is used to test the TDengine database\n"); printf("taos shell is used to test the database\n");
printf("%s%s\n", indent, "-h"); printf("%s%s\n", indent, "-h");
printf("%s%s%s\n", indent, indent, "TDengine server IP address to connect. The default host is localhost."); printf("%s%s%s\n", indent, indent, "Server IP address to connect. The default host is localhost.");
printf("%s%s\n", indent, "-p"); printf("%s%s\n", indent, "-p");
printf("%s%s%s\n", indent, indent, "The password to use when connecting to the server."); printf("%s%s%s\n", indent, indent, "The password to use when connecting to the server.");
printf("%s%s\n", indent, "-P"); printf("%s%s\n", indent, "-P");
......
...@@ -37,8 +37,8 @@ const char *argp_program_bug_address = "<support@taosdata.com>"; ...@@ -37,8 +37,8 @@ const char *argp_program_bug_address = "<support@taosdata.com>";
static char doc[] = ""; static char doc[] = "";
static char args_doc[] = ""; static char args_doc[] = "";
static struct argp_option options[] = { static struct argp_option options[] = {
{"host", 'h', "HOST", 0, "TDengine server FQDN to connect. The default host is localhost."}, {"host", 'h', "HOST", 0, "Server FQDN to connect. The default host is localhost."},
{"password", 'p', 0, 0, "The password to use when connecting to the server."}, {"password", 'p', 0, 0, "The password to use when connecting to the server."},
{"port", 'P', "PORT", 0, "The TCP/IP port number to use for the connection."}, {"port", 'P', "PORT", 0, "The TCP/IP port number to use for the connection."},
{"user", 'u', "USER", 0, "The user name to use when connecting to the server."}, {"user", 'u', "USER", 0, "The user name to use when connecting to the server."},
{"auth", 'A', "Auth", 0, "The auth string to use when connecting to the server."}, {"auth", 'A', "Auth", 0, "The auth string to use when connecting to the server."},
......
...@@ -21,8 +21,26 @@ ...@@ -21,8 +21,26 @@
extern char configDir[]; extern char configDir[];
#ifdef _TD_POWER_
char WINCLIENT_VERSION[] = "Welcome to the PowerDB shell from %s, Client Version:%s\n"
"Copyright (c) 2020 by PowerDB, Inc. All rights reserved.\n\n";
#elif (_TD_TQ_ == true)
char WINCLIENT_VERSION[] = "Welcome to the TQ shell from %s, Client Version:%s\n"
"Copyright (c) 2020 by TAOS Data, Inc. All rights reserved.\n\n";
#elif (_TD_PRO_ == true)
char WINCLIENT_VERSION[] = "Welcome to the ProDB shell from %s, Client Version:%s\n"
"Copyright (c) 2020 by Hanatech, Inc. All rights reserved.\n\n";
#elif (_TD_KH_ == true)
char WINCLIENT_VERSION[] = "Welcome to the KingHistorian shell from %s, Client Version:%s\n"
"Copyright (c) 2021 by Wellintech, Inc. All rights reserved.\n\n";
#elif (_TD_JH_ == true)
char WINCLIENT_VERSION[] = "Welcome to the jh_iot shell from %s, Client Version:%s\n"
"Copyright (c) 2021 by jinheng, Inc. All rights reserved.\n\n";
#else
char WINCLIENT_VERSION[] = "Welcome to the TDengine shell from %s, Client Version:%s\n" char WINCLIENT_VERSION[] = "Welcome to the TDengine shell from %s, Client Version:%s\n"
"Copyright (c) 2020 by TAOS Data, Inc. All rights reserved.\n\n"; "Copyright (c) 2020 by TAOS Data, Inc. All rights reserved.\n\n";
#endif
void printVersion() { void printVersion() {
printf("version: %s\n", version); printf("version: %s\n", version);
...@@ -30,10 +48,10 @@ void printVersion() { ...@@ -30,10 +48,10 @@ void printVersion() {
void printHelp() { void printHelp() {
char indent[10] = " "; char indent[10] = " ";
printf("taos shell is used to test the TDengine database\n"); printf("taos shell is used to test the database\n");
printf("%s%s\n", indent, "-h"); printf("%s%s\n", indent, "-h");
printf("%s%s%s\n", indent, indent, "TDengine server FQDN to connect. The default host is localhost."); printf("%s%s%s\n", indent, indent, "Server FQDN to connect. The default host is localhost.");
printf("%s%s\n", indent, "-p"); printf("%s%s\n", indent, "-p");
printf("%s%s%s\n", indent, indent, "The password to use when connecting to the server."); printf("%s%s%s\n", indent, indent, "The password to use when connecting to the server.");
printf("%s%s\n", indent, "-P"); printf("%s%s\n", indent, "-P");
......
...@@ -773,7 +773,7 @@ static void printHelp() { ...@@ -773,7 +773,7 @@ static void printHelp() {
printf("%s%s%s%s\n", indent, "-c, --config-dir=CONFIG_DIR", "\t", printf("%s%s%s%s\n", indent, "-c, --config-dir=CONFIG_DIR", "\t",
"Configuration directory."); "Configuration directory.");
printf("%s%s%s%s\n", indent, "-h, --host=HOST", "\t\t", printf("%s%s%s%s\n", indent, "-h, --host=HOST", "\t\t",
"TDengine server FQDN to connect. The default host is localhost."); "Server FQDN to connect. The default host is localhost.");
printf("%s%s%s%s\n", indent, "-P, --port=PORT", "\t\t", printf("%s%s%s%s\n", indent, "-P, --port=PORT", "\t\t",
"The TCP/IP port number to use for the connection."); "The TCP/IP port number to use for the connection.");
printf("%s%s%s%s\n", indent, "-I, --interface=INTERFACE", "\t", printf("%s%s%s%s\n", indent, "-I, --interface=INTERFACE", "\t",
...@@ -10963,8 +10963,6 @@ static int insertTestProcess() { ...@@ -10963,8 +10963,6 @@ static int insertTestProcess() {
assert(cmdBuffer); assert(cmdBuffer);
if(createDatabasesAndStables(cmdBuffer) != 0) { if(createDatabasesAndStables(cmdBuffer) != 0) {
if (g_fpOfInsertResult)
fclose(g_fpOfInsertResult);
free(cmdBuffer); free(cmdBuffer);
return -1; return -1;
} }
......
...@@ -467,7 +467,7 @@ bool taosReadGlobalCfg() { ...@@ -467,7 +467,7 @@ bool taosReadGlobalCfg() {
} }
void taosPrintGlobalCfg() { void taosPrintGlobalCfg() {
uInfo(" taos config & system info:"); uInfo(" config & system info:");
uInfo("=================================="); uInfo("==================================");
for (int i = 0; i < tsGlobalConfigNum; ++i) { for (int i = 0; i < tsGlobalConfigNum; ++i) {
...@@ -553,7 +553,7 @@ static void taosDumpCfg(SGlobalCfg *cfg) { ...@@ -553,7 +553,7 @@ static void taosDumpCfg(SGlobalCfg *cfg) {
} }
void taosDumpGlobalCfg() { void taosDumpGlobalCfg() {
printf("taos global config:\n"); printf(" global config:\n");
printf("==================================\n"); printf("==================================\n");
for (int i = 0; i < tsGlobalConfigNum; ++i) { for (int i = 0; i < tsGlobalConfigNum; ++i) {
SGlobalCfg *cfg = tsGlobalConfig + i; SGlobalCfg *cfg = tsGlobalConfig + i;
...@@ -564,7 +564,7 @@ void taosDumpGlobalCfg() { ...@@ -564,7 +564,7 @@ void taosDumpGlobalCfg() {
taosDumpCfg(cfg); taosDumpCfg(cfg);
} }
printf("\ntaos local config:\n"); printf("\n local config:\n");
printf("==================================\n"); printf("==================================\n");
for (int i = 0; i < tsGlobalConfigNum; ++i) { for (int i = 0; i < tsGlobalConfigNum; ++i) {
......
...@@ -2020,7 +2020,7 @@ int stmt_funcb_autoctb_e2(TAOS_STMT *stmt) { ...@@ -2020,7 +2020,7 @@ int stmt_funcb_autoctb_e2(TAOS_STMT *stmt) {
code = taos_stmt_set_tbname_tags(stmt, buf, NULL); code = taos_stmt_set_tbname_tags(stmt, buf, NULL);
if (code != 0){ if (code != 0){
printf("failed to execute taos_stmt_set_tbname_tags. code:%s\n", taos_stmt_errstr(stmt)); printf("failed to execute taos_stmt_set_tbname_tags. code:%s\n", taos_stmt_errstr(stmt));
return -1; goto exit;
} }
taos_stmt_bind_param_batch(stmt, params + id * 10); taos_stmt_bind_param_batch(stmt, params + id * 10);
...@@ -2037,6 +2037,7 @@ int stmt_funcb_autoctb_e2(TAOS_STMT *stmt) { ...@@ -2037,6 +2037,7 @@ int stmt_funcb_autoctb_e2(TAOS_STMT *stmt) {
unsigned long long endtime = getCurrentTime(); unsigned long long endtime = getCurrentTime();
printf("insert total %d records, used %u seconds, avg:%u useconds\n", 10, (endtime-starttime)/1000000UL, (endtime-starttime)/(10)); printf("insert total %d records, used %u seconds, avg:%u useconds\n", 10, (endtime-starttime)/1000000UL, (endtime-starttime)/(10));
exit:
free(v.ts); free(v.ts);
free(lb); free(lb);
free(params); free(params);
...@@ -2227,7 +2228,7 @@ int stmt_funcb_autoctb_e3(TAOS_STMT *stmt) { ...@@ -2227,7 +2228,7 @@ int stmt_funcb_autoctb_e3(TAOS_STMT *stmt) {
int code = taos_stmt_prepare(stmt, sql, 0); int code = taos_stmt_prepare(stmt, sql, 0);
if (code != 0){ if (code != 0){
printf("failed to execute taos_stmt_prepare. code:%s\n", taos_stmt_errstr(stmt)); printf("failed to execute taos_stmt_prepare. code:%s\n", taos_stmt_errstr(stmt));
return -1; goto exit;
//exit(1); //exit(1);
} }
...@@ -2255,6 +2256,7 @@ int stmt_funcb_autoctb_e3(TAOS_STMT *stmt) { ...@@ -2255,6 +2256,7 @@ int stmt_funcb_autoctb_e3(TAOS_STMT *stmt) {
unsigned long long endtime = getCurrentTime(); unsigned long long endtime = getCurrentTime();
printf("insert total %d records, used %u seconds, avg:%u useconds\n", 10, (endtime-starttime)/1000000UL, (endtime-starttime)/(10)); printf("insert total %d records, used %u seconds, avg:%u useconds\n", 10, (endtime-starttime)/1000000UL, (endtime-starttime)/(10));
exit:
free(v.ts); free(v.ts);
free(lb); free(lb);
free(params); free(params);
...@@ -2464,7 +2466,7 @@ int stmt_funcb_autoctb_e4(TAOS_STMT *stmt) { ...@@ -2464,7 +2466,7 @@ int stmt_funcb_autoctb_e4(TAOS_STMT *stmt) {
code = taos_stmt_bind_param_batch(stmt, params + id * 10); code = taos_stmt_bind_param_batch(stmt, params + id * 10);
if (code != 0) { if (code != 0) {
printf("failed to execute taos_stmt_bind_param_batch. error:%s\n", taos_stmt_errstr(stmt)); printf("failed to execute taos_stmt_bind_param_batch. error:%s\n", taos_stmt_errstr(stmt));
return -1; goto exit;
} }
taos_stmt_add_batch(stmt); taos_stmt_add_batch(stmt);
...@@ -2480,6 +2482,7 @@ int stmt_funcb_autoctb_e4(TAOS_STMT *stmt) { ...@@ -2480,6 +2482,7 @@ int stmt_funcb_autoctb_e4(TAOS_STMT *stmt) {
unsigned long long endtime = getCurrentTime(); unsigned long long endtime = getCurrentTime();
printf("insert total %d records, used %u seconds, avg:%u useconds\n", 10, (endtime-starttime)/1000000UL, (endtime-starttime)/(10)); printf("insert total %d records, used %u seconds, avg:%u useconds\n", 10, (endtime-starttime)/1000000UL, (endtime-starttime)/(10));
exit:
free(v.ts); free(v.ts);
free(lb); free(lb);
free(params); free(params);
...@@ -2691,7 +2694,7 @@ int stmt_funcb_autoctb_e5(TAOS_STMT *stmt) { ...@@ -2691,7 +2694,7 @@ int stmt_funcb_autoctb_e5(TAOS_STMT *stmt) {
code = taos_stmt_bind_param_batch(stmt, params + id * 10); code = taos_stmt_bind_param_batch(stmt, params + id * 10);
if (code != 0) { if (code != 0) {
printf("failed to execute taos_stmt_bind_param_batch. error:%s\n", taos_stmt_errstr(stmt)); printf("failed to execute taos_stmt_bind_param_batch. error:%s\n", taos_stmt_errstr(stmt));
return -1; goto exit;
} }
taos_stmt_add_batch(stmt); taos_stmt_add_batch(stmt);
...@@ -2707,6 +2710,8 @@ int stmt_funcb_autoctb_e5(TAOS_STMT *stmt) { ...@@ -2707,6 +2710,8 @@ int stmt_funcb_autoctb_e5(TAOS_STMT *stmt) {
unsigned long long endtime = getCurrentTime(); unsigned long long endtime = getCurrentTime();
printf("insert total %d records, used %u seconds, avg:%u useconds\n", 10, (endtime-starttime)/1000000UL, (endtime-starttime)/(10)); printf("insert total %d records, used %u seconds, avg:%u useconds\n", 10, (endtime-starttime)/1000000UL, (endtime-starttime)/(10));
exit:
free(v.ts); free(v.ts);
free(lb); free(lb);
free(params); free(params);
...@@ -2718,6 +2723,38 @@ int stmt_funcb_autoctb_e5(TAOS_STMT *stmt) { ...@@ -2718,6 +2723,38 @@ int stmt_funcb_autoctb_e5(TAOS_STMT *stmt) {
} }
int stmt_funcb_autoctb_e6(TAOS_STMT *stmt) {
char *sql = "insert into ? using stb1 tags(?,?,?,?,?,?,?,?,?) values(now,?,?,?,?,?,?,?,?,?)";
int code = taos_stmt_prepare(stmt, sql, 0);
if (code != 0){
printf("case success:failed to execute taos_stmt_prepare. code:%s\n", taos_stmt_errstr(stmt));
}
return 0;
}
int stmt_funcb_autoctb_e7(TAOS_STMT *stmt) {
char *sql = "insert into ? using stb1 tags(?,?,?,?,?,?,?,?,?) values(?,true,?,?,?,?,?,?,?,?)";
int code = taos_stmt_prepare(stmt, sql, 0);
if (code != 0){
printf("case success:failed to execute taos_stmt_prepare. code:%s\n", taos_stmt_errstr(stmt));
}
return 0;
}
int stmt_funcb_autoctb_e8(TAOS_STMT *stmt) {
char *sql = "insert into ? using stb1 tags(?,?,?,?,?,?,?,?,?) values(?,?,1,?,?,?,?,?,?,?)";
int code = taos_stmt_prepare(stmt, sql, 0);
if (code != 0){
printf("case success:failed to execute taos_stmt_prepare. code:%s\n", taos_stmt_errstr(stmt));
}
return 0;
}
//300 tables 60 records //300 tables 60 records
int stmt_funcb1(TAOS_STMT *stmt) { int stmt_funcb1(TAOS_STMT *stmt) {
...@@ -4853,6 +4890,44 @@ void* runcase(void *par) { ...@@ -4853,6 +4890,44 @@ void* runcase(void *par) {
#endif #endif
#if 1
prepare(taos, 1, 0);
stmt = taos_stmt_init(taos);
printf("e6 start\n");
stmt_funcb_autoctb_e6(stmt);
printf("e6 end\n");
taos_stmt_close(stmt);
#endif
#if 1
prepare(taos, 1, 0);
stmt = taos_stmt_init(taos);
printf("e7 start\n");
stmt_funcb_autoctb_e7(stmt);
printf("e7 end\n");
taos_stmt_close(stmt);
#endif
#if 1
prepare(taos, 1, 0);
stmt = taos_stmt_init(taos);
printf("e8 start\n");
stmt_funcb_autoctb_e8(stmt);
printf("e8 end\n");
taos_stmt_close(stmt);
#endif
#if 1 #if 1
prepare(taos, 1, 0); prepare(taos, 1, 0);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册