diff --git a/source/client/src/clientSml.c b/source/client/src/clientSml.c index c82f54f32b075760df00311ad5c14b11f51c0a68..b5d09d6fd5462f6a65d1a6c7fcd40f68afe75e3a 100644 --- a/source/client/src/clientSml.c +++ b/source/client/src/clientSml.c @@ -402,7 +402,7 @@ static int32_t smlModifyDBSchemas(SSmlHandle* info) { 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) { - SSchemaAction schemaAction = {.action = SCHEMA_ACTION_CREATE_STABLE}; + SSchemaAction schemaAction = { SCHEMA_ACTION_CREATE_STABLE, 0}; memcpy(schemaAction.createSTable.sTableName, superTable, superTableLen); schemaAction.createSTable.tags = sTableData->tags; schemaAction.createSTable.fields = sTableData->cols; @@ -1505,8 +1505,8 @@ static int32_t smlParseLine(SSmlHandle* info, const char* sql) { tinfo->sTableName = elements.measure; tinfo->sTableNameLen = elements.measureLen; - RandTableName rName = {.tags=tinfo->tags, .sTableName=tinfo->sTableName, .sTableNameLen=tinfo->sTableNameLen, - .childTableName=tinfo->childTableName}; + RandTableName rName = { tinfo->tags, tinfo->sTableName, tinfo->sTableNameLen, + tinfo->childTableName, 0 }; buildChildTableName(&rName); tinfo->uid = rName.uid; diff --git a/source/dnode/vnode/src/tsdb/tsdbMemTable2.c b/source/dnode/vnode/src/tsdb/tsdbMemTable2.c index 3168ff53f6c2051e3c67f6fdfce601c21bccce15..2acca738fbc3f2950f537f3b4492fd56b03ccee3 100644 --- a/source/dnode/vnode/src/tsdb/tsdbMemTable2.c +++ b/source/dnode/vnode/src/tsdb/tsdbMemTable2.c @@ -38,7 +38,7 @@ struct SMemTable { struct SMemSkipListNode { int8_t level; - SMemSkipListNode *forwards[]; + SMemSkipListNode *forwards[1]; // Windows does not allow 0 }; struct SMemSkipList { @@ -46,7 +46,7 @@ struct SMemSkipList { int8_t maxLevel; int8_t level; int32_t size; - SMemSkipListNode pHead[]; + SMemSkipListNode pHead[1]; // Windows does not allow 0 }; struct SMemData { diff --git a/source/os/src/osMemory.c b/source/os/src/osMemory.c index 3400f8c5167bb64bd89a9d91b53fe4601098223b..7c877b463a785f46e4b04694462539bcadeeb405 100644 --- a/source/os/src/osMemory.c +++ b/source/os/src/osMemory.c @@ -103,7 +103,8 @@ Dwarf_Debug tDbg; static TdThreadOnce traceThreadInit = PTHREAD_ONCE_INIT; void endTrace() { - if (traceThreadInit != PTHREAD_ONCE_INIT) { + TdThreadOnce tmp = PTHREAD_ONCE_INIT; + if (memcmp(&traceThreadInit, &tmp, sizeof(TdThreadOnce)) != 0) { delete_lookup_table(&lookup_table); dwarf_finish(tDbg); } diff --git a/source/util/src/tcache.c b/source/util/src/tcache.c index 9dcbafca7a1b0a2e3dbc67e2bbec1231b9e0a6a1..10a54755559f60f80b0b3f5b64ddf1060de71c6c 100644 --- a/source/util/src/tcache.c +++ b/source/util/src/tcache.c @@ -911,7 +911,8 @@ void taosCacheRefresh(SCacheObj *pCacheObj, __cache_trav_fn_t fp, void *param1) void taosStopCacheRefreshWorker(void) { 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); }