提交 22ac6d5f 编写于 作者: G Ganlin Zhao

Merge branch 'master' of github.com:taosdata/TDengine

......@@ -385,9 +385,14 @@ if [[ "$dbName" == "kh" ]]; then
# src/kit/shell/src/shellEngine.c
sed -i "s/TDengine shell/KingHistorian shell/g" ${top_dir}/src/kit/shell/src/shellEngine.c
sed -i "s/2020 by TAOS Data, Inc/2021 by Wellintech, Inc/g" ${top_dir}/src/kit/shell/src/shellEngine.c
sed -i "s/\"taos> \"/\"kh> \"/g" ${top_dir}/src/kit/shell/src/shellEngine.c
sed -i "s/taos connect failed/kh connect failed/g" ${top_dir}/src/kit/shell/src/shellEngine.c
sed -i "s/\"taos> \"/\"khclient> \"/g" ${top_dir}/src/kit/shell/src/shellEngine.c
sed -i "s/\" -> \"/\" -> \"/g" ${top_dir}/src/kit/shell/src/shellEngine.c
sed -i "s/prompt_size = 6/prompt_size = 4/g" ${top_dir}/src/kit/shell/src/shellEngine.c
# src/rpc/src/rpcMain.c
sed -i "s/taos connections/kh connections/g" ${top_dir}/src/rpc/src/rpcMain.c
# src/plugins/monitor/src/monMain.c
sed -i "s/taosd is quiting/khserver is quiting/g" ${top_dir}/src/plugins/monitor/src/monMain.c
fi
......
......@@ -63,6 +63,7 @@ mkdir -p ${install_dir}/cfg && cp ${cfg_dir}/taos.cfg ${install_dir}/cfg/kinghis
sed -i '/dataDir/ {s/taos/kinghistorian/g}' ${install_dir}/cfg/kinghistorian.cfg
sed -i '/logDir/ {s/taos/kinghistorian/g}' ${install_dir}/cfg/kinghistorian.cfg
sed -i "s/TDengine/KingHistorian/g" ${install_dir}/cfg/kinghistorian.cfg
sed -i "s/TAOS/KingHistorian/g" ${install_dir}/cfg/kinghistorian.cfg
mkdir -p ${install_dir}/bin
if [ "$osType" != "Darwin" ]; then
......
......@@ -74,7 +74,6 @@ if [ "$verMode" == "cluster" ]; then
cp ${nginx_dir}/png/taos.png ${install_dir}/nginxd/admin/images/taos.png
rm -rf ${install_dir}/nginxd/png
# replace the OEM name, add by yangzy@2021-09-22
sed -i -e 's/www.taosdata.com/www.wellintech.com/g' $(grep -r 'www.taosdata.com' ${install_dir}/nginxd | sed -r "s/(.*\.html):\s*(.*)/\1/g")
sed -i -e 's/2017/2021/g' $(grep -r '2017' ${install_dir}/nginxd | sed -r "s/(.*\.html):\s*(.*)/\1/g")
sed -i -e 's/TAOS Data/Wellintech/g' $(grep -r 'TAOS Data' ${install_dir}/nginxd | sed -r "s/(.*\.html):\s*(.*)/\1/g")
......@@ -99,6 +98,7 @@ sed -i "s/TDengine/KingHistorian/g" ${install_dir}/cfg/kinghistorian.cfg
sed -i "s/support@taosdata.com/support@wellintech.com/g" ${install_dir}/cfg/kinghistorian.cfg
sed -i "s/taos client/khclient/g" ${install_dir}/cfg/kinghistorian.cfg
sed -i "s/taosd/khserver/g" ${install_dir}/cfg/kinghistorian.cfg
sed -i "s/TAOS/KingHistorian/g" ${install_dir}/cfg/kinghistorian.cfg
cd ${install_dir}
tar -zcv -f kinghistorian.tar.gz * --remove-files || :
......
......@@ -4606,7 +4606,7 @@ int32_t createProjectionExpr(SQueryInfo* pQueryInfo, STableMetaInfo* pTableMetaI
}
}
pse->colInfo.flag = TSDB_COL_NORMAL;
pse->colInfo.flag = pSource->base.colInfo.flag; //TSDB_COL_NORMAL;
pse->resType = pSource->base.resType;
pse->resBytes = pSource->base.resBytes;
strncpy(pse->colInfo.name, pSource->base.aliasName, tListLen(pse->colInfo.name));
......
......@@ -53,11 +53,11 @@ char CONTINUE_PROMPT[] = " -> ";
int prompt_size = 7;
#elif (_TD_KH_ == true)
char CLIENT_VERSION[] = "Welcome to the KingHistorian shell from %s, Client Version:%s\n"
"Copyright (c) 2021 by Hanatech, Inc. All rights reserved.\n\n";
char PROMPT_HEADER[] = "kh> ";
"Copyright (c) 2021 by Wellintech, Inc. All rights reserved.\n\n";
char PROMPT_HEADER[] = "khclient> ";
char CONTINUE_PROMPT[] = " -> ";
int prompt_size = 4;
char CONTINUE_PROMPT[] = " -> ";
int prompt_size = 10;
#else
char CLIENT_VERSION[] = "Welcome to the TDengine shell from %s, Client Version:%s\n"
"Copyright (c) 2020 by TAOS Data, Inc. All rights reserved.\n\n";
......@@ -118,7 +118,11 @@ TAOS *shellInit(SShellArguments *_args) {
}
if (con == NULL) {
#ifdef _TD_KH_
printf("kh connect failed, reason: %s.\n\n", tstrerror(terrno));
#else
printf("taos connect failed, reason: %s.\n\n", tstrerror(terrno));
#endif
fflush(stdout);
return con;
}
......
......@@ -53,7 +53,7 @@ static void httpStopThread(HttpThread *pThread) {
break;
}
} while (0);
if (r) {
if (r && taosCheckPthreadValid(pThread->thread)) {
pthread_cancel(pThread->thread);
}
#else
......@@ -63,15 +63,21 @@ static void httpStopThread(HttpThread *pThread) {
httpError("%s, failed to create eventfd, will call pthread_cancel instead, which may result in data corruption: %s",
pThread->label, strerror(errno));
pThread->stop = true;
pthread_cancel(pThread->thread);
if (taosCheckPthreadValid(pThread->thread)) {
pthread_cancel(pThread->thread);
}
} else if (epoll_ctl(pThread->pollFd, EPOLL_CTL_ADD, fd, &event) < 0) {
httpError("%s, failed to call epoll_ctl, will call pthread_cancel instead, which may result in data corruption: %s",
pThread->label, strerror(errno));
pthread_cancel(pThread->thread);
if (taosCheckPthreadValid(pThread->thread)) {
pthread_cancel(pThread->thread);
}
}
#endif // __APPLE__
pthread_join(pThread->thread, NULL);
if (taosCheckPthreadValid(pThread->thread)) {
pthread_join(pThread->thread, NULL);
}
#ifdef __APPLE__
if (sv[0] != -1) {
......
......@@ -123,7 +123,11 @@ static void *monThreadFunc(void *param) {
if (tsMonitor.quiting) {
tsMonitor.state = MON_STATE_NOT_INIT;
#ifdef _TD_KH_
monInfo("monitor thread will quit, for khserver is quiting");
#else
monInfo("monitor thread will quit, for taosd is quiting");
#endif
break;
} else {
taosGetDisk();
......
......@@ -1713,9 +1713,6 @@ static void doHashGroupbyAgg(SOperatorInfo* pOperator, SGroupbyOperatorInfo *pIn
int32_t num = 0;
for (int32_t j = 0; j < pSDataBlock->info.rows; ++j) {
char* val = ((char*)pColInfoData->pData) + bytes * j;
if (isNull(val, type)) {
continue;
}
// Compare with the previous row of this column, and do not set the output buffer again if they are identical.
if (pInfo->prevData == NULL) {
......
......@@ -42,22 +42,22 @@ class TDTestCase:
% (self.ts + i, i + 1, 1, i + 1, i + 1, i + 0.1, i + 0.1, i % 2, i + 1, i + 1, i + 1, i + 1, i + 1, i + 1))
tdSql.query("select count(*),last(*) from stest group by col1")
tdSql.checkRows(10)
tdSql.checkData(0, 0, 1)
tdSql.checkData(1, 2, 2)
tdSql.checkData(1, 3, 1)
tdSql.checkRows(11)
tdSql.checkData(1, 0, 1)
tdSql.checkData(2, 2, 2)
tdSql.checkData(2, 3, 1)
tdSql.query("select count(*),last(*) from stest group by col2")
tdSql.checkRows(1)
tdSql.checkData(0, 0, 10)
tdSql.checkData(0, 2, 10)
tdSql.checkData(0, 3, 1)
tdSql.checkRows(2)
tdSql.checkData(1, 0, 10)
tdSql.checkData(1, 2, 10)
tdSql.checkData(1, 3, 1)
tdSql.query("select count(*),last(ts,stest.*) from stest group by col1")
tdSql.checkRows(10)
tdSql.checkData(0, 0, 1)
tdSql.checkData(0, 2, "2018-09-17 09:00:00")
tdSql.checkData(1, 4, 1)
tdSql.checkRows(11)
tdSql.checkData(1, 0, 1)
tdSql.checkData(1, 2, "2018-09-17 09:00:00")
tdSql.checkData(2, 4, 1)
......
......@@ -488,7 +488,7 @@ class TDTestCase:
tdLog.info(len(sql))
tdSql.query(sql)
#tdSql.checkData(0,0,'2020-09-13 20:26:40.000')
tdSql.checkRows(6*self.num)
tdSql.checkRows(6*self.num)
#1 outer union not support
#dcDB = self.dropandcreateDB(random.randint(1,3))
......@@ -2164,6 +2164,68 @@ class TDTestCase:
tdLog.info(len(sql))
tdSql.query(sql)
tdSql.query("select 21-4 from table_0;")
for i in range(self.fornum):
sql = "select avg(res1),min(res2),max(res3) from ( select "
sql += "%s res1, " % random.choice(calc_aggregate_all)
sql += "%s res2," % random.choice(calc_aggregate_all)
sql += "%s res3 " % random.choice(calc_aggregate_all)
sql += " from regular_table_1 t1 "
sql += " where %s " % random.choice(q_where)
sql += " %s ) " % random.choice(interval_sliding)
sql += "group by ts "
sql += "%s ;" % random.choice(limit_where)
tdLog.info(sql)
tdLog.info(len(sql))
tdSql.query(sql)
tdSql.query("select 21-5 from table_0;")
for i in range(self.fornum):
sql = "select avg(res1),min(res2),max(res3) from ( select "
sql += "%s res1, " % random.choice(calc_aggregate_all)
sql += "%s res2," % random.choice(calc_aggregate_all)
sql += "%s res3 " % random.choice(calc_aggregate_all)
sql += " from table_1 t1 "
sql += " where %s " % random.choice(q_where)
sql += " %s ) " % random.choice(interval_sliding)
sql += "group by ts "
sql += "%s ;" % random.choice([limit_where[2] , limit_where[3]] )
tdLog.info(sql)
tdLog.info(len(sql))
tdSql.query(sql)
tdSql.query("select 21-6 from table_0;")
for i in range(self.fornum):
sql = "select avg(res1),min(res2),max(res3) from ( select "
sql += "%s res1, " % random.choice(calc_aggregate_all)
sql += "%s res2," % random.choice(calc_aggregate_all)
sql += "%s res3 " % random.choice(calc_aggregate_all)
sql += " from stable_1 t1 "
sql += " where %s " % random.choice(q_where)
sql += " %s ) " % random.choice(interval_sliding)
sql += "group by ts "
sql += "%s ;" % random.choice(limit_where)
tdLog.info(sql)
tdLog.info(len(sql))
tdSql.query(sql)
tdSql.query("select 21-7 from table_0;")
for i in range(self.fornum):
sql = "select avg(res1),min(res2),max(res3) from ( select "
sql += "%s res1, " % random.choice(calc_aggregate_all)
sql += "%s res2," % random.choice(calc_aggregate_all)
sql += "%s res3 " % random.choice(calc_aggregate_all)
sql += " from stable_1 t1 "
sql += " where %s " % random.choice(q_where)
sql += " %s " % random.choice(interval_sliding)
sql += " %s ) " % random.choice(group_where)
sql += "group by ts "
sql += "%s ;" % random.choice(limit_where)
tdLog.info(sql)
tdLog.info(len(sql))
tdSql.query(sql)
# error
#1 select * from (select * from (select * form regular_table where <\>\in\and\or order by limit ))
tdSql.query("select 1-1 from table_1;")
......
......@@ -553,19 +553,19 @@ endi
sql_error select first(c6) - last(c6) *12 / count(*) from $stb group by c3;
sql select first(c6) - last(c6) *12 / count(*) from $stb group by c5;
if $rows != 10 then
if $rows != 11 then
return -1
endi
if $data00 != 0.000000000 then
if $data00 != -0.002160000 then
return -1
endi
if $data10 != 0.997600000 then
if $data10 != 0.000000000 then
return -1
endi
if $data90 != 8.978400000 then
if $data90 != 7.980800000 then
return -1
endi
......
......@@ -884,5 +884,18 @@ if $data00 != 24 then
return -1
endi
sql select sum(a)/sum(b) from meters where ts >= '2021-09-30 15:00:00.000' and ts <= '2021-09-30 15:00:05.000' interval(1s) fill(null) group by area order by area;
if $rows != 12 then
return -1
endi
if $data00 != @21-09-30 15:00:00.000@ then
return -1
endi
if $data01 != NULL then
return -1
endi
if $data02 != 0 then
return -1
endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册