From e3ab73460efada9654b7f8dd421aa68867acd447 Mon Sep 17 00:00:00 2001 From: slguan Date: Sat, 15 Feb 2020 11:47:56 +0800 Subject: [PATCH] compile options --- src/client/src/tscParseInsert.c | 2 +- src/client/src/tscSql.c | 4 ++-- src/dnode/CMakeLists.txt | 21 +++++++-------------- src/inc/taoserror.h | 3 +++ src/inc/taosmsg.h | 3 --- src/modules/http/src/httpJson.c | 2 +- src/rpc/CMakeLists.txt | 3 ++- src/rpc/src/tudp.c | 3 --- src/sdb/CMakeLists.txt | 3 ++- src/util/inc/tstatus.h | 14 +++++++------- src/util/src/tstatus.c | 14 +++++++------- 11 files changed, 32 insertions(+), 40 deletions(-) diff --git a/src/client/src/tscParseInsert.c b/src/client/src/tscParseInsert.c index f2e2e55e90..8039fbe405 100644 --- a/src/client/src/tscParseInsert.c +++ b/src/client/src/tscParseInsert.c @@ -1071,7 +1071,7 @@ int doParseInsertSql(SSqlObj *pSql, char *str) { } // todo add to return - tscError("async insert parse error, code:%d, %s", code, tsError[code]); + tscError("async insert parse error, code:%d, %s", code, tstrerror(code)); pSql->asyncTblPos = NULL; } diff --git a/src/client/src/tscSql.c b/src/client/src/tscSql.c index 2c0d0f898a..e76cc0446c 100644 --- a/src/client/src/tscSql.c +++ b/src/client/src/tscSql.c @@ -849,7 +849,7 @@ char *taos_errstr(TAOS *taos) { STscObj *pObj = (STscObj *)taos; uint8_t code; - if (pObj == NULL || pObj->signature != pObj) return tsError[globalCode]; + if (pObj == NULL || pObj->signature != pObj) return tstrerror(globalCode); SSqlObj* pSql = pObj->pSql; @@ -862,7 +862,7 @@ char *taos_errstr(TAOS *taos) { if (hasAdditionalErrorInfo(code, &pSql->cmd)) { return pSql->cmd.payload; } else { - return tsError[code]; + return tstrerror(code); } } diff --git a/src/dnode/CMakeLists.txt b/src/dnode/CMakeLists.txt index 143c5397e8..c1e572cdcc 100644 --- a/src/dnode/CMakeLists.txt +++ b/src/dnode/CMakeLists.txt @@ -4,25 +4,18 @@ PROJECT(TDengine) IF ((TD_LINUX_64) OR (TD_LINUX_32 AND TD_ARM)) INCLUDE_DIRECTORIES(${TD_OS_DIR}/inc) INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/inc) + INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/util/inc) INCLUDE_DIRECTORIES(${TD_ENTERPRISE_DIR}/src/inc) - - INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/dnode/inc) - INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/mnode/detail/inc) - INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/vnode/detail/inc) - INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/client/inc) - INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/modules/http/inc) - INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/modules/monitor/inc) - INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/inc) - INCLUDE_DIRECTORIES(${TD_ENTERPRISE_DIR}/src/util/cluster/inc) INCLUDE_DIRECTORIES(inc) AUX_SOURCE_DIRECTORY(src SRC) - ADD_EXECUTABLE(taosd ${SRC}) - TARGET_LINK_LIBRARIES(taosd mnode vnode taos_static monitor http) + ADD_LIBRARY(dnode ${SRC}) + #ADD_EXECUTABLE(taosd ${SRC}) + #TARGET_LINK_LIBRARIES(taosd mnode sdb vnode taos_static monitor http) - IF (TD_CLUSTER) - TARGET_LINK_LIBRARIES(taosd dcluster) - ENDIF () + #IF (TD_CLUSTER) + # TARGET_LINK_LIBRARIES(taosd dcluster) + #ENDIF () SET(PREPARE_ENV_CMD "prepare_env_cmd") SET(PREPARE_ENV_TARGET "prepare_env_target") diff --git a/src/inc/taoserror.h b/src/inc/taoserror.h index 0aea5a127c..dcc224ef05 100644 --- a/src/inc/taoserror.h +++ b/src/inc/taoserror.h @@ -20,6 +20,9 @@ extern "C" { #endif +#include +#include + #ifdef TAOS_ERROR_C #define TAOS_DEFINE_ERROR(name, mod, code, msg) {.val = (0x80000000 | ((mod)<<16) | (code)), .str=(msg)}, #else diff --git a/src/inc/taosmsg.h b/src/inc/taosmsg.h index 98f82b2e72..a180a963d8 100644 --- a/src/inc/taosmsg.h +++ b/src/inc/taosmsg.h @@ -319,9 +319,6 @@ typedef struct { char reserved[16]; int32_t sversion; SMColumn schema[]; - - SVariableMsg tags; - } SCreateMsg; typedef struct { diff --git a/src/modules/http/src/httpJson.c b/src/modules/http/src/httpJson.c index 5d5d29f4e0..c75d84d731 100644 --- a/src/modules/http/src/httpJson.c +++ b/src/modules/http/src/httpJson.c @@ -451,7 +451,7 @@ void httpJsonPairStatus(JsonBuf* buf, int code) { } else if (code == TSDB_CODE_INVALID_TABLE) { httpJsonPair(buf, "desc", 4, "failed to create table", 22); } else - httpJsonPair(buf, "desc", 4, tsError[code], (int)strlen(tsError[code])); + httpJsonPair(buf, "desc", 4, tstrerror(code), (int)strlen(tstrerror(code))); } } } \ No newline at end of file diff --git a/src/rpc/CMakeLists.txt b/src/rpc/CMakeLists.txt index 8d54d5fda5..70511db533 100644 --- a/src/rpc/CMakeLists.txt +++ b/src/rpc/CMakeLists.txt @@ -1,8 +1,9 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8) PROJECT(TDengine) -INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/inc) INCLUDE_DIRECTORIES(${TD_OS_DIR}/inc) +INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/inc) +INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/util/inc) INCLUDE_DIRECTORIES(inc) IF ((TD_LINUX_64) OR (TD_LINUX_32 AND TD_ARM)) diff --git a/src/rpc/src/tudp.c b/src/rpc/src/tudp.c index db3e5e81c4..a605abea5f 100644 --- a/src/rpc/src/tudp.c +++ b/src/rpc/src/tudp.c @@ -699,10 +699,7 @@ int taosSendPacketViaTcp(uint32_t ip, uint16_t port, char *data, int dataLen, vo pHead = (STaosHeader *)buffer; memcpy(pHead, data, sizeof(STaosHeader)); -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wbitfield-constant-conversion" pHead->tcp = 2; -#pragma GCC diagnostic pop msgLen = sizeof(STaosHeader); pHead->msgLen = (int32_t)htonl(msgLen); diff --git a/src/sdb/CMakeLists.txt b/src/sdb/CMakeLists.txt index 62239116bd..b0617353d9 100644 --- a/src/sdb/CMakeLists.txt +++ b/src/sdb/CMakeLists.txt @@ -1,8 +1,9 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8) PROJECT(TDengine) -INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/inc) INCLUDE_DIRECTORIES(${TD_OS_DIR}/inc) +INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/inc) +INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/util/inc) INCLUDE_DIRECTORIES(inc) IF ((TD_LINUX_64) OR (TD_LINUX_32 AND TD_ARM)) diff --git a/src/util/inc/tstatus.h b/src/util/inc/tstatus.h index 2e848ebfcd..8e2f82e024 100644 --- a/src/util/inc/tstatus.h +++ b/src/util/inc/tstatus.h @@ -25,13 +25,13 @@ extern "C" { #include "taoserror.h" enum _TSDB_VG_STATUS { - TSDB_VG_STATUS_READY = TSDB_CODE_SUCCESS, - TSDB_VG_STATUS_IN_PROGRESS = TSDB_CODE_ACTION_IN_PROGRESS, - TSDB_VG_STATUS_NO_DISK_PERMISSIONS = TSDB_CODE_NO_DISK_PERMISSIONS, - TSDB_VG_STATUS_SERVER_NO_PACE = TSDB_CODE_SERV_NO_DISKSPACE, - TSDB_VG_STATUS_SERV_OUT_OF_MEMORY = TSDB_CODE_SERV_OUT_OF_MEMORY, - TSDB_VG_STATUS_INIT_FAILED = TSDB_CODE_VG_INIT_FAILED, - TSDB_VG_STATUS_FULL = TSDB_CODE_NO_ENOUGH_DNODES, + TSDB_VG_STATUS_READY = TSDB_CODE_SUCCESS, + TSDB_VG_STATUS_IN_PROGRESS = 1, //TSDB_CODE_ACTION_IN_PROGRESS, + TSDB_VG_STATUS_NO_DISK_PERMISSIONS = 73,//TSDB_CODE_NO_DISK_PERMISSIONS, + TSDB_VG_STATUS_SERVER_NO_PACE = 110, //TSDB_CODE_SERV_NO_DISKSPACE, + TSDB_VG_STATUS_SERV_OUT_OF_MEMORY = 69, //TSDB_CODE_SERV_OUT_OF_MEMORY, + TSDB_VG_STATUS_INIT_FAILED = 74, //TSDB_CODE_VG_INIT_FAILED, + TSDB_VG_STATUS_FULL = 48, //TSDB_CODE_NO_ENOUGH_DNODES, }; enum _TSDB_DB_STATUS { diff --git a/src/util/src/tstatus.c b/src/util/src/tstatus.c index 4c8d7868fd..ea8fb630c8 100644 --- a/src/util/src/tstatus.c +++ b/src/util/src/tstatus.c @@ -18,13 +18,13 @@ const char* taosGetVgroupStatusStr(int32_t vgroupStatus) { switch (vgroupStatus) { - case TSDB_VG_STATUS_READY: return tsError[vgroupStatus]; - case TSDB_VG_STATUS_IN_PROGRESS: return tsError[vgroupStatus]; - case TSDB_VG_STATUS_NO_DISK_PERMISSIONS: return tsError[vgroupStatus]; - case TSDB_VG_STATUS_SERVER_NO_PACE: return tsError[vgroupStatus]; - case TSDB_VG_STATUS_SERV_OUT_OF_MEMORY: return tsError[vgroupStatus]; - case TSDB_VG_STATUS_INIT_FAILED: return tsError[vgroupStatus]; - case TSDB_VG_STATUS_FULL: return tsError[vgroupStatus]; + case TSDB_VG_STATUS_READY: return tstrerror(vgroupStatus); + case TSDB_VG_STATUS_IN_PROGRESS: return tstrerror(vgroupStatus); + case TSDB_VG_STATUS_NO_DISK_PERMISSIONS: return tstrerror(vgroupStatus); + case TSDB_VG_STATUS_SERVER_NO_PACE: return tstrerror(vgroupStatus); + case TSDB_VG_STATUS_SERV_OUT_OF_MEMORY: return tstrerror(vgroupStatus); + case TSDB_VG_STATUS_INIT_FAILED: return tstrerror(vgroupStatus); + case TSDB_VG_STATUS_FULL: return tstrerror(vgroupStatus); default: return "undefined"; } } -- GitLab