提交 ab81f000 编写于 作者: S Shuduo Sang

Merge branch 'hotfix/sangshuduo/TD-3197-fix-taosdemo-coverity-scan' into...

Merge branch 'hotfix/sangshuduo/TD-3197-fix-taosdemo-coverity-scan' into feature/sangshuduo/TD-3317-taosdemo-interlace
...@@ -32,11 +32,10 @@ def abort_previous(){ ...@@ -32,11 +32,10 @@ def abort_previous(){
milestone(buildNumber) milestone(buildNumber)
} }
def pre_test(){ def pre_test(){
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
sh ''' sh '''
sudo rmtaos sudo rmtaos || echo "taosd has not installed"
''' '''
}
sh ''' sh '''
cd ${WKC} cd ${WKC}
......
...@@ -2344,13 +2344,13 @@ int32_t addExprAndResultField(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, int32_t col ...@@ -2344,13 +2344,13 @@ int32_t addExprAndResultField(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, int32_t col
// todo REFACTOR // todo REFACTOR
// set the first column ts for top/bottom query // set the first column ts for top/bottom query
SColumnIndex index1 = {0, PRIMARYKEY_TIMESTAMP_COL_INDEX}; SColumnIndex index1 = {index.tableIndex, PRIMARYKEY_TIMESTAMP_COL_INDEX};
pExpr = tscSqlExprAppend(pQueryInfo, TSDB_FUNC_TS, &index1, TSDB_DATA_TYPE_TIMESTAMP, TSDB_KEYSIZE, getNewResColId(pQueryInfo), pExpr = tscSqlExprAppend(pQueryInfo, TSDB_FUNC_TS, &index1, TSDB_DATA_TYPE_TIMESTAMP, TSDB_KEYSIZE, getNewResColId(pQueryInfo),
TSDB_KEYSIZE, false); TSDB_KEYSIZE, false);
tstrncpy(pExpr->aliasName, aAggs[TSDB_FUNC_TS].name, sizeof(pExpr->aliasName)); tstrncpy(pExpr->aliasName, aAggs[TSDB_FUNC_TS].name, sizeof(pExpr->aliasName));
const int32_t TS_COLUMN_INDEX = PRIMARYKEY_TIMESTAMP_COL_INDEX; const int32_t TS_COLUMN_INDEX = PRIMARYKEY_TIMESTAMP_COL_INDEX;
SColumnList ids = getColumnList(1, 0, TS_COLUMN_INDEX); SColumnList ids = getColumnList(1, index.tableIndex, TS_COLUMN_INDEX);
insertResultField(pQueryInfo, TS_COLUMN_INDEX, &ids, TSDB_KEYSIZE, TSDB_DATA_TYPE_TIMESTAMP, insertResultField(pQueryInfo, TS_COLUMN_INDEX, &ids, TSDB_KEYSIZE, TSDB_DATA_TYPE_TIMESTAMP,
aAggs[TSDB_FUNC_TS].name, pExpr); aAggs[TSDB_FUNC_TS].name, pExpr);
...@@ -2363,7 +2363,7 @@ int32_t addExprAndResultField(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, int32_t col ...@@ -2363,7 +2363,7 @@ int32_t addExprAndResultField(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, int32_t col
memset(pExpr->aliasName, 0, tListLen(pExpr->aliasName)); memset(pExpr->aliasName, 0, tListLen(pExpr->aliasName));
getColumnName(pItem, pExpr->aliasName, sizeof(pExpr->aliasName) - 1); getColumnName(pItem, pExpr->aliasName, sizeof(pExpr->aliasName) - 1);
SColumnList ids = getColumnList(1, 0, index.columnIndex); SColumnList ids = getColumnList(1, index.tableIndex, index.columnIndex);
if (finalResult) { if (finalResult) {
insertResultField(pQueryInfo, colIndex, &ids, resultSize, resultType, pExpr->aliasName, pExpr); insertResultField(pQueryInfo, colIndex, &ids, resultSize, resultType, pExpr->aliasName, pExpr);
} else { } else {
......
...@@ -2633,10 +2633,10 @@ static void createChildTables() { ...@@ -2633,10 +2633,10 @@ static void createChildTables() {
if ((strncasecmp(g_args.datatype[j], "BINARY", strlen("BINARY")) == 0) if ((strncasecmp(g_args.datatype[j], "BINARY", strlen("BINARY")) == 0)
|| (strncasecmp(g_args.datatype[j], || (strncasecmp(g_args.datatype[j],
"NCHAR", strlen("NCHAR")) == 0)) { "NCHAR", strlen("NCHAR")) == 0)) {
len = snprintf(tblColsBuf + len, MAX_SQL_SIZE, len = snprintf(tblColsBuf + len, MAX_SQL_SIZE - len,
", COL%d %s(60)", j, g_args.datatype[j]); ", COL%d %s(60)", j, g_args.datatype[j]);
} else { } else {
len = snprintf(tblColsBuf + len, MAX_SQL_SIZE, len = snprintf(tblColsBuf + len, MAX_SQL_SIZE - len,
", COL%d %s", j, g_args.datatype[j]); ", COL%d %s", j, g_args.datatype[j]);
} }
len = strlen(tblColsBuf); len = strlen(tblColsBuf);
...@@ -4319,7 +4319,8 @@ static int generateDataTail(char *tableName, int32_t tableSeq, ...@@ -4319,7 +4319,8 @@ static int generateDataTail(char *tableName, int32_t tableSeq,
return k; return k;
} }
static int generateSQLHead(char *tableName, int32_t tableSeq, threadInfo* pThreadInfo, SSuperTable* superTblInfo, char *buffer) static int generateSQLHead(char *tableName, int32_t tableSeq,
threadInfo* pThreadInfo, SSuperTable* superTblInfo, char *buffer)
{ {
int len; int len;
if (superTblInfo) { if (superTblInfo) {
...@@ -5487,7 +5488,11 @@ static int queryTestProcess() { ...@@ -5487,7 +5488,11 @@ static int queryTestProcess() {
char sqlStr[MAX_TB_NAME_SIZE*2]; char sqlStr[MAX_TB_NAME_SIZE*2];
sprintf(sqlStr, "use %s", g_queryInfo.dbName); sprintf(sqlStr, "use %s", g_queryInfo.dbName);
verbosePrint("%s() %d sqlStr: %s\n", __func__, __LINE__, sqlStr); verbosePrint("%s() %d sqlStr: %s\n", __func__, __LINE__, sqlStr);
(void)queryDbExec(t_info->taos, sqlStr, NO_INSERT_TYPE); if (0 != queryDbExec(t_info->taos, sqlStr, NO_INSERT_TYPE)) {
errorPrint( "use database %s failed!\n\n",
g_queryInfo.dbName);
return -1;
}
} else { } else {
t_info->taos = NULL; t_info->taos = NULL;
} }
...@@ -5757,22 +5762,27 @@ static int subscribeTestProcess() { ...@@ -5757,22 +5762,27 @@ static int subscribeTestProcess() {
pthread_t *pids = NULL; pthread_t *pids = NULL;
threadInfo *infos = NULL; threadInfo *infos = NULL;
//==== create sub threads for query from super table //==== create sub threads for query from super table
if (g_queryInfo.superQueryInfo.sqlCount > 0 if ((g_queryInfo.superQueryInfo.sqlCount <= 0) ||
&& g_queryInfo.superQueryInfo.concurrent > 0) { (g_queryInfo.superQueryInfo.concurrent <= 0)) {
pids = malloc(g_queryInfo.superQueryInfo.concurrent * sizeof(pthread_t)); errorPrint("%s() LN%d, query sqlCount %d or concurrent %d is not correct.\n",
infos = malloc(g_queryInfo.superQueryInfo.concurrent * sizeof(threadInfo)); __func__, __LINE__, g_queryInfo.superQueryInfo.sqlCount,
if ((NULL == pids) || (NULL == infos)) { g_queryInfo.superQueryInfo.concurrent);
exit(-1);
}
pids = malloc(g_queryInfo.superQueryInfo.concurrent * sizeof(pthread_t));
infos = malloc(g_queryInfo.superQueryInfo.concurrent * sizeof(threadInfo));
if ((NULL == pids) || (NULL == infos)) {
printf("malloc failed for create threads\n"); printf("malloc failed for create threads\n");
taos_close(taos); taos_close(taos);
exit(-1); exit(-1);
} }
for (int i = 0; i < g_queryInfo.superQueryInfo.concurrent; i++) { for (int i = 0; i < g_queryInfo.superQueryInfo.concurrent; i++) {
threadInfo *t_info = infos + i; threadInfo *t_info = infos + i;
t_info->threadID = i; t_info->threadID = i;
t_info->taos = taos; t_info->taos = taos;
pthread_create(pids + i, NULL, superSubscribeProcess, t_info); pthread_create(pids + i, NULL, superSubscribeProcess, t_info);
}
} }
//==== create sub threads for query from sub table //==== create sub threads for query from sub table
...@@ -6032,7 +6042,6 @@ static void querySqlFile(TAOS* taos, char* sqlFile) ...@@ -6032,7 +6042,6 @@ static void querySqlFile(TAOS* taos, char* sqlFile)
memcpy(cmd + cmd_len, line, read_len); memcpy(cmd + cmd_len, line, read_len);
verbosePrint("%s() LN%d cmd: %s\n", __func__, __LINE__, cmd); verbosePrint("%s() LN%d cmd: %s\n", __func__, __LINE__, cmd);
queryDbExec(taos, cmd, NO_INSERT_TYPE);
if (0 != queryDbExec(taos, cmd, NO_INSERT_TYPE)) { if (0 != queryDbExec(taos, cmd, NO_INSERT_TYPE)) {
printf("queryDbExec %s failed!\n", cmd); printf("queryDbExec %s failed!\n", cmd);
tmfree(cmd); tmfree(cmd);
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
#include "mnodeSdb.h" #include "mnodeSdb.h"
#define SDB_TABLE_LEN 12 #define SDB_TABLE_LEN 12
#define MAX_QUEUED_MSG_NUM 10000 #define MAX_QUEUED_MSG_NUM 100000
typedef enum { typedef enum {
SDB_ACTION_INSERT = 0, SDB_ACTION_INSERT = 0,
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
#include "dnode.h" #include "dnode.h"
#include "vnodeStatus.h" #include "vnodeStatus.h"
#define MAX_QUEUED_MSG_NUM 10000 #define MAX_QUEUED_MSG_NUM 100000
extern void * tsDnodeTmr; extern void * tsDnodeTmr;
static int32_t (*vnodeProcessWriteMsgFp[TSDB_MSG_TYPE_MAX])(SVnodeObj *, void *pCont, SRspRet *); static int32_t (*vnodeProcessWriteMsgFp[TSDB_MSG_TYPE_MAX])(SVnodeObj *, void *pCont, SRspRet *);
......
...@@ -275,7 +275,7 @@ python3 ./test.py -f functions/function_twa.py -r 1 ...@@ -275,7 +275,7 @@ python3 ./test.py -f functions/function_twa.py -r 1
python3 ./test.py -f functions/function_twa_test2.py python3 ./test.py -f functions/function_twa_test2.py
python3 ./test.py -f functions/function_stddev_td2555.py python3 ./test.py -f functions/function_stddev_td2555.py
python3 ./test.py -f insert/metadataUpdate.py python3 ./test.py -f insert/metadataUpdate.py
#python3 ./test.py -f query/last_cache.py python3 ./test.py -f query/last_cache.py
python3 ./test.py -f query/last_row_cache.py python3 ./test.py -f query/last_row_cache.py
python3 ./test.py -f account/account_create.py python3 ./test.py -f account/account_create.py
python3 ./test.py -f alter/alter_table.py python3 ./test.py -f alter/alter_table.py
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册