diff --git a/Jenkinsfile b/Jenkinsfile index 495b1fb1adb122a5c59c2f4f964af758698b4598..6e6daf5c59f29dc678d4f4485ff77d7e2f257fae 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -179,9 +179,9 @@ def pre_test_win(){ git clean -dfx mkdir debug cd debug - call "C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\vcvarsall.bat" amd64 + call "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Auxiliary\\Build\\vcvarsall.bat" amd64 cmake ../ -G "NMake Makefiles" - nmake || exit 8 + set CL=/MP nmake nmake || exit 8 nmake install || exit 8 xcopy /e/y/i/f C:\\workspace\\TDinternal\\debug\\build\\lib\\taos.dll C:\\Windows\\System32 || exit 8 cd C:\\workspace\\TDinternal\\community\\src\\connector\\python @@ -470,35 +470,35 @@ pipeline { } } - // stage('build'){ - // agent{label " wintest "} - // steps { - // pre_test() - // script{ - // while(win_stop == 0){ - // sleep(1) - // } - // } - // } - // } - // stage('test'){ - // agent{label "win"} - // steps{ + stage('build'){ + agent{label " wintest "} + steps { + pre_test() + script{ + while(win_stop == 0){ + sleep(1) + } + } + } + } + stage('test'){ + agent{label "win"} + steps{ - // catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') { - // pre_test_win() - // timeout(time: 20, unit: 'MINUTES'){ - // bat''' - // cd C:\\workspace\\TDinternal\\community\\tests\\pytest - // .\\test-all.bat Wintest - // ''' - // } - // } - // script{ - // win_stop=1 - // } - // } - // } + catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') { + pre_test_win() + timeout(time: 20, unit: 'MINUTES'){ + bat''' + cd C:\\workspace\\TDinternal\\community\\tests\\pytest + .\\test-all.bat wintest + ''' + } + } + script{ + win_stop=1 + } + } + } } diff --git a/src/client/inc/tscParseLine.h b/src/client/inc/tscParseLine.h index f5db644a96d7d447ac6b5851b641e41f8745e98e..74ba9ab3d9c5251e1cf8ab4e8549c8da0353ea49 100644 --- a/src/client/inc/tscParseLine.h +++ b/src/client/inc/tscParseLine.h @@ -64,7 +64,7 @@ typedef struct { SMLTimeStampType tsType; SHashObj* smlDataToSchema; - int64_t affectedRows; + int32_t affectedRows; } SSmlLinesInfo; void addEscapeCharToString(char *str, int32_t len); diff --git a/src/client/src/tscParseOpenTSDB.c b/src/client/src/tscParseOpenTSDB.c index 717638f8407c47c3fc621a3dbd037f9b05dae553..f6b723ef3cd554a4062035c6352ee485022340ac 100644 --- a/src/client/src/tscParseOpenTSDB.c +++ b/src/client/src/tscParseOpenTSDB.c @@ -509,7 +509,7 @@ static int32_t parseMetricFromJSON(cJSON *root, TAOS_SML_DATA_POINT* pSml, SSmlL tstrncpy(pSml->stableName, metric->valuestring, stableLen + 1); strntolower_s(pSml->stableName, pSml->stableName, (int32_t)stableLen); - addEscapeCharToString(pSml->stableName, stableLen); + addEscapeCharToString(pSml->stableName, (int32_t)stableLen); return TSDB_CODE_SUCCESS; @@ -903,7 +903,7 @@ static int32_t parseTagsFromJSON(cJSON *root, TAOS_SML_KV **pKVs, int *num_kvs, *childTableName = tcalloc(idLen + TS_ESCAPE_CHAR_SIZE + 1, sizeof(char)); memcpy(*childTableName, id->valuestring, idLen); strntolower_s(*childTableName, *childTableName, (int32_t)idLen); - addEscapeCharToString(*childTableName, idLen); + addEscapeCharToString(*childTableName, (int32_t)idLen); //check duplicate IDs cJSON_DeleteItemFromObject(tags, "ID"); @@ -940,7 +940,7 @@ static int32_t parseTagsFromJSON(cJSON *root, TAOS_SML_KV **pKVs, int *num_kvs, pkv->key = tcalloc(keyLen + TS_ESCAPE_CHAR_SIZE + 1, sizeof(char)); strncpy(pkv->key, tag->string, keyLen); strntolower_s(pkv->key, pkv->key, (int32_t)keyLen); - addEscapeCharToString(pkv->key, keyLen); + addEscapeCharToString(pkv->key, (int32_t)keyLen); //value ret = parseValueFromJSON(tag, pkv, info); if (ret != TSDB_CODE_SUCCESS) { diff --git a/src/client/src/tscSQLParser.c b/src/client/src/tscSQLParser.c index 2587ce1120aa7411732061f4e4eb3174d920654e..e96e7e5b232a500f5780688cab8a82ab6545e624 100644 --- a/src/client/src/tscSQLParser.c +++ b/src/client/src/tscSQLParser.c @@ -5790,7 +5790,7 @@ int32_t validateOrderbyNode(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, SSqlNode* pSq bool udf = false; if (pQueryInfo->pUdfInfo && taosArrayGetSize(pQueryInfo->pUdfInfo) > 0) { - int32_t usize = taosArrayGetSize(pQueryInfo->pUdfInfo); + int32_t usize = (int32_t)taosArrayGetSize(pQueryInfo->pUdfInfo); for (int32_t i = 0; i < usize; ++i) { SUdfInfo* pUdfInfo = taosArrayGet(pQueryInfo->pUdfInfo, i); @@ -8644,7 +8644,7 @@ int32_t loadAllTableMeta(SSqlObj* pSql, struct SSqlInfo* pInfo) { for (int32_t j = 0; j < usize; ++j) { SUdfInfo* pUdfInfo = taosArrayGet(pQueryInfo->pUdfInfo, j); - int32_t len = strlen(pUdfInfo->name); + int32_t len = (int32_t)strlen(pUdfInfo->name); if (len == t->n && strncasecmp(info.name, pUdfInfo->name, t->n) == 0) { exist = 1; break; diff --git a/src/kit/taosdemo/taosdemo.c b/src/kit/taosdemo/taosdemo.c index 3acffe06ed599fb952fb00a4b1e6e0c509c941e3..902d2adcb33f5828343037afb042c9aff7627630 100644 --- a/src/kit/taosdemo/taosdemo.c +++ b/src/kit/taosdemo/taosdemo.c @@ -3554,7 +3554,7 @@ static int postProceSql(char *host, uint16_t port, do { #ifdef WINDOWS - bytes = recv(pThreadInfo->sockfds, response_buf + received, resp_len - received, 0); + bytes = recv(pThreadInfo->sockfd, response_buf + received, resp_len - received, 0); #else bytes = read(pThreadInfo->sockfd, response_buf + received, resp_len - received); #endif @@ -9868,14 +9868,16 @@ static void* syncWriteInterlaceSml(threadInfo *pThreadInfo, uint32_t interlaceRo batchPerTblTimes = 1; } - char *smlHead[pThreadInfo->ntables]; + char **smlHeadList = calloc(pThreadInfo->ntables, sizeof(char *)); + assert(smlHeadList); for (int t = 0; t < pThreadInfo->ntables; t++) { - smlHead[t] = (char *)calloc(HEAD_BUFF_LEN, 1); - if (NULL == smlHead[t]) { + char* smlHead = *((char **)smlHeadList + t * sizeof(char *)); + smlHead = (char *)calloc(HEAD_BUFF_LEN, 1); + if (NULL == smlHead) { errorPrint2("calloc failed! size:%d\n", HEAD_BUFF_LEN); exit(EXIT_FAILURE); } - generateSmlHead(smlHead[t], stbInfo, pThreadInfo, t); + generateSmlHead(smlHead, stbInfo, pThreadInfo, t); } @@ -9925,7 +9927,7 @@ static void* syncWriteInterlaceSml(threadInfo *pThreadInfo, uint32_t interlaceRo errorPrint2("Failed to alloc %d bytes, reason:%s\n", BUFFER_SIZE, strerror(errno)); } - generateSmlTail(pThreadInfo->lines[j], smlHead[i], stbInfo, pThreadInfo, timestamp); + generateSmlTail(pThreadInfo->lines[j], *((char **)smlHeadList + i * sizeof(char *)), stbInfo, pThreadInfo, timestamp); timestamp += timeStampStep; } tableSeq ++; @@ -10044,8 +10046,9 @@ static void* syncWriteInterlaceSml(threadInfo *pThreadInfo, uint32_t interlaceRo free_of_interlace: tmfree(pThreadInfo->lines); for (int index = 0; index < pThreadInfo->ntables; index++) { - free(smlHead[index]); + tmfree(*(smlHeadList + index*(sizeof(char*)))); } + tmfree(smlHeadList); printStatPerThread(pThreadInfo); return NULL; } @@ -10469,14 +10472,16 @@ static void* syncWriteProgressiveSml(threadInfo *pThreadInfo) { pThreadInfo->samplePos = 0; - char *smlHead[pThreadInfo->ntables]; + char *smlHeadList = calloc(pThreadInfo->ntables, sizeof(char *)); + assert(smlHeadList); for (int t = 0; t < pThreadInfo->ntables; t++) { - smlHead[t] = (char *)calloc(HEAD_BUFF_LEN, 1); - if (NULL == smlHead[t]) { + char* smlHead = *((char**)smlHeadList + t * sizeof(char *)); + smlHead = (char *)calloc(HEAD_BUFF_LEN, 1); + if (NULL == smlHead) { errorPrint2("calloc failed! size:%d\n", HEAD_BUFF_LEN); exit(EXIT_FAILURE); } - generateSmlHead(smlHead[t], stbInfo, pThreadInfo, t); + generateSmlHead(smlHead, stbInfo, pThreadInfo, t); } int currentPercent = 0; @@ -10503,7 +10508,7 @@ static void* syncWriteProgressiveSml(threadInfo *pThreadInfo) { errorPrint2("Failed to alloc %d bytes, reason:%s\n", BUFFER_SIZE, strerror(errno)); } - generateSmlTail(pThreadInfo->lines[k], smlHead[i], stbInfo, pThreadInfo, timestamp); + generateSmlTail(pThreadInfo->lines[k], *((char**)smlHeadList + i * sizeof(char *)), stbInfo, pThreadInfo, timestamp); timestamp += timeStampStep; j++; if (j == insertRows) { @@ -10559,8 +10564,9 @@ static void* syncWriteProgressiveSml(threadInfo *pThreadInfo) { } tmfree(pThreadInfo->lines); for (int index = 0; index < pThreadInfo->ntables; index++) { - free(smlHead[index]); + free(*((char**)smlHeadList + index * sizeof(char *))); } + tmfree(smlHeadList); return NULL; } diff --git a/src/vnode/src/vnodeWrite.c b/src/vnode/src/vnodeWrite.c index a0c772f5409ed7b231e2e655c849037f81f7c67e..35c2ab72dfdf55f66b1095c757fc4f90656c842b 100644 --- a/src/vnode/src/vnodeWrite.c +++ b/src/vnode/src/vnodeWrite.c @@ -170,7 +170,7 @@ static int32_t vnodeProcessSubmitMsg(SVnodeObj *pVnode, void *pCont, SRspRet *pR static int32_t vnodeCheckWal(SVnodeObj *pVnode) { if (pVnode->isCommiting == 0) { - return tsdbCheckWal(pVnode->tsdb, walGetFSize(pVnode->wal) >> 20); + return tsdbCheckWal(pVnode->tsdb, (uint32_t)(walGetFSize(pVnode->wal) >> 20)); } return 0; }