diff --git a/src/client/src/tscParseInsert.c b/src/client/src/tscParseInsert.c index f2e2e55e9075af02cbf34063e24c923238377772..8039fbe405feada1552993cc2c1d78364ec2b2ab 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 2c0d0f898a39b0cab5d62bd00a51d0c0461ecd4b..e76cc0446c8b7c665e39a96af5e902b88abd1f21 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 143c5397e8301da5bf411258ed721f8e63f84098..c1e572cdccefa35c11346f6ae6e728126900bac1 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 0aea5a127c3531595f54e46980ecc89989b5899b..dcc224ef05483e92c514e34ed8cb0122f0e902e3 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 98f82b2e722f6122b277ffcc99329e8c8168cb15..a180a963d8e4497ed903c9d545166f4a47b817c9 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 5d5d29f4e0fae91c8e30bfb3aaa78fb440b8a188..c75d84d731e48410ea124739988cebcfb2d0d57a 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 8d54d5fda591acd790c4bfab751cec079762e561..70511db53369fc0e69ba870bd8c3c151e580cbe7 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 db3e5e81c43754abe46cd907463737ceeb2b1116..a605abea5f6bdbb4470b80892910d1e49d6ee951 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 62239116bd6d1e3c7900e23e6632825248f7f51b..b0617353d9e54c40257eb29b68eb0c1ac16a32d3 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 2e848ebfcdc56e8fff4102900ae7dd8c67fb4e08..8e2f82e024a0560cea5570b9ebd11292b875ecd0 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 4c8d7868fdebdcdcbee016cf605881b8070a277d..ea8fb630c8b97efe43592beed267d8991db3103e 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"; } }