From 5628086b7d42a12bf3c42675c2db5f4576dad980 Mon Sep 17 00:00:00 2001 From: lihui Date: Fri, 17 Jan 2020 11:08:09 +0800 Subject: [PATCH 1/5] [TBASE-1357] --- packaging/tools/install.sh | 15 ++++++++------- packaging/tools/make_install.sh | 6 +++--- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/packaging/tools/install.sh b/packaging/tools/install.sh index 0edabbe0bf..beca20e68d 100644 --- a/packaging/tools/install.sh +++ b/packaging/tools/install.sh @@ -78,23 +78,24 @@ osinfo=$(cat /etc/os-release | grep "NAME" | cut -d '"' -f2) #echo "osinfo: ${osinfo}" os_type=0 if echo $osinfo | grep -qwi "ubuntu" ; then - echo "this is ubuntu system" + echo "This is ubuntu system" os_type=1 elif echo $osinfo | grep -qwi "debian" ; then - echo "this is debian system" + echo "This is debian system" os_type=1 elif echo $osinfo | grep -qwi "Kylin" ; then - echo "this is Kylin system" + echo "This is Kylin system" os_type=1 elif echo $osinfo | grep -qwi "centos" ; then - echo "this is centos system" + echo "This is centos system" os_type=2 elif echo $osinfo | grep -qwi "fedora" ; then - echo "this is fedora system" + echo "This is fedora system" os_type=2 else - echo "this is other linux system" - os_type=0 + echo "${osinfo}: This is an officially unverified linux system, If there are any problems with the installation and operation, " + echo "please feel free to contact taosdata.com for support." + os_type=1 fi function kill_taosd() { diff --git a/packaging/tools/make_install.sh b/packaging/tools/make_install.sh index 97a95685a9..2200c7f13d 100755 --- a/packaging/tools/make_install.sh +++ b/packaging/tools/make_install.sh @@ -105,10 +105,10 @@ if [ "$osType" != "Darwin" ]; then echo "this is fedora system" os_type=2 else - echo "this is other linux system" - os_type=0 + echo "${osinfo}: This is an officially unverified linux system, If there are any problems with the installation and operation, " + echo "please feel free to contact taosdata.com for support." + os_type=1 fi - fi function kill_taosd() { From b252163e2285803393f0dcaf0d79f56f3ce38230 Mon Sep 17 00:00:00 2001 From: fangpanpan Date: Fri, 17 Jan 2020 15:01:18 +0800 Subject: [PATCH 2/5] [check overflow] --- src/client/src/tscSQLParser.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/client/src/tscSQLParser.c b/src/client/src/tscSQLParser.c index b6b3a63b5f..70620de329 100644 --- a/src/client/src/tscSQLParser.c +++ b/src/client/src/tscSQLParser.c @@ -5705,16 +5705,23 @@ void tscPrintSelectClause(SSqlCmd* pCmd) { return; } - char* str = calloc(1, 10240); + int32_t totalBufSize = 10240; + char* str = (char*)calloc(1, 10240); + if (str == NULL) return; + int32_t offset = 0; - offset += sprintf(str, "%d [", pCmd->exprsInfo.numOfExprs); + offset += sprintf(str, "num:%d [", pCmd->exprsInfo.numOfExprs); for (int32_t i = 0; i < pCmd->exprsInfo.numOfExprs; ++i) { SSqlExpr* pExpr = tscSqlExprGet(pCmd, i); - int32_t size = sprintf(str + offset, "%s(%d)", aAggs[pExpr->functionId].aName, pExpr->colInfo.colId); - offset += size; + char tmpBuf[1024] = {0}; + int32_t tmpLen = 0; + tmpLen = sprintf(tmpBuf, "%s(uid:%" PRId64 ", %d)", aAggs[pExpr->functionId].aName, pExpr->uid, pExpr->colInfo.colId); + if (tmpLen + offset > totalBufSize) break; + offset += sprintf(str + offset, "%s", tmpBuf); + if (i < pCmd->exprsInfo.numOfExprs - 1) { str[offset++] = ','; } From 1177110a0218cfaf3d065fc345fe9d56fec65dd7 Mon Sep 17 00:00:00 2001 From: localvar Date: Fri, 17 Jan 2020 18:34:56 +0800 Subject: [PATCH 3/5] fix #1134 --- documentation/webdocs/markdowndocs/Connector.md | 2 +- documentation/webdocs/markdowndocs/connector-ch.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/documentation/webdocs/markdowndocs/Connector.md b/documentation/webdocs/markdowndocs/Connector.md index 9c57a106ab..79e98efdc6 100644 --- a/documentation/webdocs/markdowndocs/Connector.md +++ b/documentation/webdocs/markdowndocs/Connector.md @@ -583,7 +583,7 @@ data = c1.fetchall() numOfRows = c1.rowcount numOfCols = len(c1.description) for irow in range(numOfRows): - print("Row%d: ts=%s, temperature=%d, humidity=%f" %(irow, data[irow][0], data[irow][1],data[irow][2]) + print("Row%d: ts=%s, temperature=%d, humidity=%f" %(irow, data[irow][0], data[irow][1],data[irow][2])) # use the cursor as an iterator to retrieve all returned results c1.execute('select * from tb') diff --git a/documentation/webdocs/markdowndocs/connector-ch.md b/documentation/webdocs/markdowndocs/connector-ch.md index 1dfc6b896c..9b4dc5a2e5 100644 --- a/documentation/webdocs/markdowndocs/connector-ch.md +++ b/documentation/webdocs/markdowndocs/connector-ch.md @@ -579,7 +579,7 @@ data = c1.fetchall() numOfRows = c1.rowcount numOfCols = len(c1.description) for irow in range(numOfRows): - print("Row%d: ts=%s, temperature=%d, humidity=%f" %(irow, data[irow][0], data[irow][1],data[irow][2]) + print("Row%d: ts=%s, temperature=%d, humidity=%f" %(irow, data[irow][0], data[irow][1],data[irow][2])) # 直接使用cursor 循环拉取查询结果 c1.execute('select * from tb') From 69c95d0d75b491674efc512f60fac034c7f610be Mon Sep 17 00:00:00 2001 From: Hongze Cheng Date: Fri, 17 Jan 2020 22:56:18 +0800 Subject: [PATCH 4/5] Fix dump memory leak --- src/kit/taosdump/taosdump.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/kit/taosdump/taosdump.c b/src/kit/taosdump/taosdump.c index f722d24c26..07c52b912f 100644 --- a/src/kit/taosdump/taosdump.c +++ b/src/kit/taosdump/taosdump.c @@ -797,7 +797,10 @@ int32_t taosDumpTable(char *table, char *metric, struct arguments *arguments, FI if (metric != NULL && metric[0] != '\0') { // dump metric definition count = taosGetTableDes(metric, tableDes); - if (count < 0) return -1; + if (count < 0) { + free(tableDes); + return -1; + } taosDumpCreateTableClause(tableDes, count, arguments, fp); @@ -805,18 +808,26 @@ int32_t taosDumpTable(char *table, char *metric, struct arguments *arguments, FI count = taosGetTableDes(table, tableDes); - if (count < 0) return -1; + if (count < 0) { + free(tableDes); + return -1; + } taosDumpCreateMTableClause(tableDes, metric, count, arguments, fp); } else { // dump table definition count = taosGetTableDes(table, tableDes); - if (count < 0) return -1; + if (count < 0) { + free(tableDes); + return -1; + } taosDumpCreateTableClause(tableDes, count, arguments, fp); } + free(tableDes); + return taosDumpTableData(fp, table, arguments); } From e12f765b8fb9689900fe76210be6028acac2d821 Mon Sep 17 00:00:00 2001 From: hjxilinx Date: Sat, 18 Jan 2020 10:24:07 +0800 Subject: [PATCH 5/5] fix the bug of deref the qhandle --- src/system/detail/src/vnodeShell.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/system/detail/src/vnodeShell.c b/src/system/detail/src/vnodeShell.c index ce1cabe141..4943eb1da9 100644 --- a/src/system/detail/src/vnodeShell.c +++ b/src/system/detail/src/vnodeShell.c @@ -215,7 +215,7 @@ void vnodeCloseShellVnode(int vnode) { if (shellList[vnode] == NULL) return; for (int i = 0; i < vnodeList[vnode].cfg.maxSessions; ++i) { - vnodeFreeQInfo(shellList[vnode][i].qhandle, true); + vnodeDecRefCount(shellList[vnode][i].qhandle); } int32_t* v = malloc(sizeof(int32_t)); @@ -369,8 +369,10 @@ int vnodeProcessQueryRequest(char *pMsg, int msgLen, SShellObj *pObj) { if (pObj->qhandle) { dTrace("QInfo:%p %s free qhandle", pObj->qhandle, __FUNCTION__); - vnodeFreeQInfo(pObj->qhandle, true); + void* qHandle = pObj->qhandle; pObj->qhandle = NULL; + + vnodeDecRefCount(qHandle); } if (QUERY_IS_STABLE_QUERY(pQueryMsg->queryType)) {