未验证 提交 356ccb73 编写于 作者: wafwerar's avatar wafwerar 提交者: GitHub

Merge pull request #12347 from taosdata/fix/ZhiqiangWang/fix-15189-windows-compile-TDinternal

fix(os): windows compile TDinternal.
...@@ -402,7 +402,7 @@ static int32_t smlModifyDBSchemas(SSmlHandle* info) { ...@@ -402,7 +402,7 @@ static int32_t smlModifyDBSchemas(SSmlHandle* info) {
code = catalogGetSTableMeta(info->pCatalog, info->taos->pAppInfo->pTransporter, &ep, &pName, &pTableMeta); code = catalogGetSTableMeta(info->pCatalog, info->taos->pAppInfo->pTransporter, &ep, &pName, &pTableMeta);
if (code == TSDB_CODE_PAR_TABLE_NOT_EXIST || code == TSDB_CODE_MND_INVALID_STB) { if (code == TSDB_CODE_PAR_TABLE_NOT_EXIST || code == TSDB_CODE_MND_INVALID_STB) {
SSchemaAction schemaAction = {.action = SCHEMA_ACTION_CREATE_STABLE}; SSchemaAction schemaAction = { SCHEMA_ACTION_CREATE_STABLE, 0};
memcpy(schemaAction.createSTable.sTableName, superTable, superTableLen); memcpy(schemaAction.createSTable.sTableName, superTable, superTableLen);
schemaAction.createSTable.tags = sTableData->tags; schemaAction.createSTable.tags = sTableData->tags;
schemaAction.createSTable.fields = sTableData->cols; schemaAction.createSTable.fields = sTableData->cols;
...@@ -1505,8 +1505,8 @@ static int32_t smlParseLine(SSmlHandle* info, const char* sql) { ...@@ -1505,8 +1505,8 @@ static int32_t smlParseLine(SSmlHandle* info, const char* sql) {
tinfo->sTableName = elements.measure; tinfo->sTableName = elements.measure;
tinfo->sTableNameLen = elements.measureLen; tinfo->sTableNameLen = elements.measureLen;
RandTableName rName = {.tags=tinfo->tags, .sTableName=tinfo->sTableName, .sTableNameLen=tinfo->sTableNameLen, RandTableName rName = { tinfo->tags, tinfo->sTableName, tinfo->sTableNameLen,
.childTableName=tinfo->childTableName}; tinfo->childTableName, 0 };
buildChildTableName(&rName); buildChildTableName(&rName);
tinfo->uid = rName.uid; tinfo->uid = rName.uid;
......
...@@ -38,7 +38,7 @@ struct SMemTable { ...@@ -38,7 +38,7 @@ struct SMemTable {
struct SMemSkipListNode { struct SMemSkipListNode {
int8_t level; int8_t level;
SMemSkipListNode *forwards[]; SMemSkipListNode *forwards[1]; // Windows does not allow 0
}; };
struct SMemSkipList { struct SMemSkipList {
...@@ -46,7 +46,7 @@ struct SMemSkipList { ...@@ -46,7 +46,7 @@ struct SMemSkipList {
int8_t maxLevel; int8_t maxLevel;
int8_t level; int8_t level;
int32_t size; int32_t size;
SMemSkipListNode pHead[]; SMemSkipListNode pHead[1]; // Windows does not allow 0
}; };
struct SMemData { struct SMemData {
......
...@@ -103,7 +103,8 @@ Dwarf_Debug tDbg; ...@@ -103,7 +103,8 @@ Dwarf_Debug tDbg;
static TdThreadOnce traceThreadInit = PTHREAD_ONCE_INIT; static TdThreadOnce traceThreadInit = PTHREAD_ONCE_INIT;
void endTrace() { void endTrace() {
if (traceThreadInit != PTHREAD_ONCE_INIT) { TdThreadOnce tmp = PTHREAD_ONCE_INIT;
if (memcmp(&traceThreadInit, &tmp, sizeof(TdThreadOnce)) != 0) {
delete_lookup_table(&lookup_table); delete_lookup_table(&lookup_table);
dwarf_finish(tDbg); dwarf_finish(tDbg);
} }
......
...@@ -911,7 +911,8 @@ void taosCacheRefresh(SCacheObj *pCacheObj, __cache_trav_fn_t fp, void *param1) ...@@ -911,7 +911,8 @@ void taosCacheRefresh(SCacheObj *pCacheObj, __cache_trav_fn_t fp, void *param1)
void taosStopCacheRefreshWorker(void) { void taosStopCacheRefreshWorker(void) {
stopRefreshWorker = true; stopRefreshWorker = true;
if(cacheThreadInit != PTHREAD_ONCE_INIT) taosThreadJoin(cacheRefreshWorker, NULL); TdThreadOnce tmp = PTHREAD_ONCE_INIT;
if (memcmp(&cacheRefreshWorker, &tmp, sizeof(TdThreadOnce)) != 0) taosThreadJoin(cacheRefreshWorker, NULL);
taosArrayDestroy(pCacheArrayList); taosArrayDestroy(pCacheArrayList);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册