未验证 提交 4562a4d4 编写于 作者: Y Yiqing Liu 提交者: GitHub

Merge pull request #8462 from taosdata/windows_compile

fix Windows compile
...@@ -179,9 +179,9 @@ def pre_test_win(){ ...@@ -179,9 +179,9 @@ def pre_test_win(){
git clean -dfx git clean -dfx
mkdir debug mkdir debug
cd 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" cmake ../ -G "NMake Makefiles"
nmake || exit 8 set CL=/MP nmake nmake || exit 8
nmake install || exit 8 nmake install || exit 8
xcopy /e/y/i/f C:\\workspace\\TDinternal\\debug\\build\\lib\\taos.dll C:\\Windows\\System32 || 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 cd C:\\workspace\\TDinternal\\community\\src\\connector\\python
...@@ -470,35 +470,35 @@ pipeline { ...@@ -470,35 +470,35 @@ pipeline {
} }
} }
// stage('build'){ stage('build'){
// agent{label " wintest "} agent{label " wintest "}
// steps { steps {
// pre_test() pre_test()
// script{ script{
// while(win_stop == 0){ while(win_stop == 0){
// sleep(1) sleep(1)
// } }
// } }
// } }
// } }
// stage('test'){ stage('test'){
// agent{label "win"} agent{label "win"}
// steps{ steps{
// catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') { catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
// pre_test_win() pre_test_win()
// timeout(time: 20, unit: 'MINUTES'){ timeout(time: 20, unit: 'MINUTES'){
// bat''' bat'''
// cd C:\\workspace\\TDinternal\\community\\tests\\pytest cd C:\\workspace\\TDinternal\\community\\tests\\pytest
// .\\test-all.bat Wintest .\\test-all.bat wintest
// ''' '''
// } }
// } }
// script{ script{
// win_stop=1 win_stop=1
// } }
// } }
// } }
} }
......
...@@ -64,7 +64,7 @@ typedef struct { ...@@ -64,7 +64,7 @@ typedef struct {
SMLTimeStampType tsType; SMLTimeStampType tsType;
SHashObj* smlDataToSchema; SHashObj* smlDataToSchema;
int64_t affectedRows; int32_t affectedRows;
} SSmlLinesInfo; } SSmlLinesInfo;
void addEscapeCharToString(char *str, int32_t len); void addEscapeCharToString(char *str, int32_t len);
......
...@@ -509,7 +509,7 @@ static int32_t parseMetricFromJSON(cJSON *root, TAOS_SML_DATA_POINT* pSml, SSmlL ...@@ -509,7 +509,7 @@ static int32_t parseMetricFromJSON(cJSON *root, TAOS_SML_DATA_POINT* pSml, SSmlL
tstrncpy(pSml->stableName, metric->valuestring, stableLen + 1); tstrncpy(pSml->stableName, metric->valuestring, stableLen + 1);
strntolower_s(pSml->stableName, pSml->stableName, (int32_t)stableLen); strntolower_s(pSml->stableName, pSml->stableName, (int32_t)stableLen);
addEscapeCharToString(pSml->stableName, stableLen); addEscapeCharToString(pSml->stableName, (int32_t)stableLen);
return TSDB_CODE_SUCCESS; return TSDB_CODE_SUCCESS;
...@@ -903,7 +903,7 @@ static int32_t parseTagsFromJSON(cJSON *root, TAOS_SML_KV **pKVs, int *num_kvs, ...@@ -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)); *childTableName = tcalloc(idLen + TS_ESCAPE_CHAR_SIZE + 1, sizeof(char));
memcpy(*childTableName, id->valuestring, idLen); memcpy(*childTableName, id->valuestring, idLen);
strntolower_s(*childTableName, *childTableName, (int32_t)idLen); strntolower_s(*childTableName, *childTableName, (int32_t)idLen);
addEscapeCharToString(*childTableName, idLen); addEscapeCharToString(*childTableName, (int32_t)idLen);
//check duplicate IDs //check duplicate IDs
cJSON_DeleteItemFromObject(tags, "ID"); cJSON_DeleteItemFromObject(tags, "ID");
...@@ -940,7 +940,7 @@ static int32_t parseTagsFromJSON(cJSON *root, TAOS_SML_KV **pKVs, int *num_kvs, ...@@ -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)); pkv->key = tcalloc(keyLen + TS_ESCAPE_CHAR_SIZE + 1, sizeof(char));
strncpy(pkv->key, tag->string, keyLen); strncpy(pkv->key, tag->string, keyLen);
strntolower_s(pkv->key, pkv->key, (int32_t)keyLen); strntolower_s(pkv->key, pkv->key, (int32_t)keyLen);
addEscapeCharToString(pkv->key, keyLen); addEscapeCharToString(pkv->key, (int32_t)keyLen);
//value //value
ret = parseValueFromJSON(tag, pkv, info); ret = parseValueFromJSON(tag, pkv, info);
if (ret != TSDB_CODE_SUCCESS) { if (ret != TSDB_CODE_SUCCESS) {
......
...@@ -5790,7 +5790,7 @@ int32_t validateOrderbyNode(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, SSqlNode* pSq ...@@ -5790,7 +5790,7 @@ int32_t validateOrderbyNode(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, SSqlNode* pSq
bool udf = false; bool udf = false;
if (pQueryInfo->pUdfInfo && taosArrayGetSize(pQueryInfo->pUdfInfo) > 0) { 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) { for (int32_t i = 0; i < usize; ++i) {
SUdfInfo* pUdfInfo = taosArrayGet(pQueryInfo->pUdfInfo, i); SUdfInfo* pUdfInfo = taosArrayGet(pQueryInfo->pUdfInfo, i);
...@@ -8644,7 +8644,7 @@ int32_t loadAllTableMeta(SSqlObj* pSql, struct SSqlInfo* pInfo) { ...@@ -8644,7 +8644,7 @@ int32_t loadAllTableMeta(SSqlObj* pSql, struct SSqlInfo* pInfo) {
for (int32_t j = 0; j < usize; ++j) { for (int32_t j = 0; j < usize; ++j) {
SUdfInfo* pUdfInfo = taosArrayGet(pQueryInfo->pUdfInfo, 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) { if (len == t->n && strncasecmp(info.name, pUdfInfo->name, t->n) == 0) {
exist = 1; exist = 1;
break; break;
......
...@@ -3554,7 +3554,7 @@ static int postProceSql(char *host, uint16_t port, ...@@ -3554,7 +3554,7 @@ static int postProceSql(char *host, uint16_t port,
do { do {
#ifdef WINDOWS #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 #else
bytes = read(pThreadInfo->sockfd, response_buf + received, resp_len - received); bytes = read(pThreadInfo->sockfd, response_buf + received, resp_len - received);
#endif #endif
...@@ -9868,14 +9868,16 @@ static void* syncWriteInterlaceSml(threadInfo *pThreadInfo, uint32_t interlaceRo ...@@ -9868,14 +9868,16 @@ static void* syncWriteInterlaceSml(threadInfo *pThreadInfo, uint32_t interlaceRo
batchPerTblTimes = 1; batchPerTblTimes = 1;
} }
char *smlHead[pThreadInfo->ntables]; char **smlHeadList = calloc(pThreadInfo->ntables, sizeof(char *));
assert(smlHeadList);
for (int t = 0; t < pThreadInfo->ntables; t++) { for (int t = 0; t < pThreadInfo->ntables; t++) {
smlHead[t] = (char *)calloc(HEAD_BUFF_LEN, 1); char* smlHead = *((char **)smlHeadList + t * sizeof(char *));
if (NULL == smlHead[t]) { smlHead = (char *)calloc(HEAD_BUFF_LEN, 1);
if (NULL == smlHead) {
errorPrint2("calloc failed! size:%d\n", HEAD_BUFF_LEN); errorPrint2("calloc failed! size:%d\n", HEAD_BUFF_LEN);
exit(EXIT_FAILURE); 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 ...@@ -9925,7 +9927,7 @@ static void* syncWriteInterlaceSml(threadInfo *pThreadInfo, uint32_t interlaceRo
errorPrint2("Failed to alloc %d bytes, reason:%s\n", errorPrint2("Failed to alloc %d bytes, reason:%s\n",
BUFFER_SIZE, strerror(errno)); 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; timestamp += timeStampStep;
} }
tableSeq ++; tableSeq ++;
...@@ -10044,8 +10046,9 @@ static void* syncWriteInterlaceSml(threadInfo *pThreadInfo, uint32_t interlaceRo ...@@ -10044,8 +10046,9 @@ static void* syncWriteInterlaceSml(threadInfo *pThreadInfo, uint32_t interlaceRo
free_of_interlace: free_of_interlace:
tmfree(pThreadInfo->lines); tmfree(pThreadInfo->lines);
for (int index = 0; index < pThreadInfo->ntables; index++) { for (int index = 0; index < pThreadInfo->ntables; index++) {
free(smlHead[index]); tmfree(*(smlHeadList + index*(sizeof(char*))));
} }
tmfree(smlHeadList);
printStatPerThread(pThreadInfo); printStatPerThread(pThreadInfo);
return NULL; return NULL;
} }
...@@ -10469,14 +10472,16 @@ static void* syncWriteProgressiveSml(threadInfo *pThreadInfo) { ...@@ -10469,14 +10472,16 @@ static void* syncWriteProgressiveSml(threadInfo *pThreadInfo) {
pThreadInfo->samplePos = 0; pThreadInfo->samplePos = 0;
char *smlHead[pThreadInfo->ntables]; char *smlHeadList = calloc(pThreadInfo->ntables, sizeof(char *));
assert(smlHeadList);
for (int t = 0; t < pThreadInfo->ntables; t++) { for (int t = 0; t < pThreadInfo->ntables; t++) {
smlHead[t] = (char *)calloc(HEAD_BUFF_LEN, 1); char* smlHead = *((char**)smlHeadList + t * sizeof(char *));
if (NULL == smlHead[t]) { smlHead = (char *)calloc(HEAD_BUFF_LEN, 1);
if (NULL == smlHead) {
errorPrint2("calloc failed! size:%d\n", HEAD_BUFF_LEN); errorPrint2("calloc failed! size:%d\n", HEAD_BUFF_LEN);
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
generateSmlHead(smlHead[t], stbInfo, pThreadInfo, t); generateSmlHead(smlHead, stbInfo, pThreadInfo, t);
} }
int currentPercent = 0; int currentPercent = 0;
...@@ -10503,7 +10508,7 @@ static void* syncWriteProgressiveSml(threadInfo *pThreadInfo) { ...@@ -10503,7 +10508,7 @@ static void* syncWriteProgressiveSml(threadInfo *pThreadInfo) {
errorPrint2("Failed to alloc %d bytes, reason:%s\n", errorPrint2("Failed to alloc %d bytes, reason:%s\n",
BUFFER_SIZE, strerror(errno)); 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; timestamp += timeStampStep;
j++; j++;
if (j == insertRows) { if (j == insertRows) {
...@@ -10559,8 +10564,9 @@ static void* syncWriteProgressiveSml(threadInfo *pThreadInfo) { ...@@ -10559,8 +10564,9 @@ static void* syncWriteProgressiveSml(threadInfo *pThreadInfo) {
} }
tmfree(pThreadInfo->lines); tmfree(pThreadInfo->lines);
for (int index = 0; index < pThreadInfo->ntables; index++) { for (int index = 0; index < pThreadInfo->ntables; index++) {
free(smlHead[index]); free(*((char**)smlHeadList + index * sizeof(char *)));
} }
tmfree(smlHeadList);
return NULL; return NULL;
} }
......
...@@ -170,7 +170,7 @@ static int32_t vnodeProcessSubmitMsg(SVnodeObj *pVnode, void *pCont, SRspRet *pR ...@@ -170,7 +170,7 @@ static int32_t vnodeProcessSubmitMsg(SVnodeObj *pVnode, void *pCont, SRspRet *pR
static int32_t vnodeCheckWal(SVnodeObj *pVnode) { static int32_t vnodeCheckWal(SVnodeObj *pVnode) {
if (pVnode->isCommiting == 0) { if (pVnode->isCommiting == 0) {
return tsdbCheckWal(pVnode->tsdb, walGetFSize(pVnode->wal) >> 20); return tsdbCheckWal(pVnode->tsdb, (uint32_t)(walGetFSize(pVnode->wal) >> 20));
} }
return 0; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册