From de2ef67b066deef5049e4b727a036ae87c98e762 Mon Sep 17 00:00:00 2001 From: hjxilinx Date: Sat, 16 Nov 2019 10:35:12 +0800 Subject: [PATCH 1/7] [TBASE-1165] --- src/inc/taoserror.h | 142 ++++++++++++++++++++++++++++++++++++++++++++ src/inc/taosmsg.h | 116 +----------------------------------- 2 files changed, 143 insertions(+), 115 deletions(-) create mode 100644 src/inc/taoserror.h diff --git a/src/inc/taoserror.h b/src/inc/taoserror.h new file mode 100644 index 0000000000..fbb7bf86da --- /dev/null +++ b/src/inc/taoserror.h @@ -0,0 +1,142 @@ +/* + * Copyright (c) 2019 TAOS Data, Inc. + * + * This program is free software: you can use, redistribute, and/or modify + * it under the terms of the GNU Affero General Public License, version 3 + * or later ("AGPL"), as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +#ifndef TDENGINE_TAOSERROR_H +#define TDENGINE_TAOSERROR_H + +#ifdef __cplusplus +extern "C" { +#endif + +#define TSDB_CODE_SUCCESS 0 +#define TSDB_CODE_ACTION_IN_PROGRESS 1 + +#define TSDB_CODE_LAST_SESSION_NOT_FINISHED 5 +#define TSDB_CODE_INVALID_SESSION_ID 6 +#define TSDB_CODE_INVALID_TRAN_ID 7 +#define TSDB_CODE_INVALID_MSG_TYPE 8 +#define TSDB_CODE_ALREADY_PROCESSED 9 +#define TSDB_CODE_AUTH_FAILURE 10 +#define TSDB_CODE_WRONG_MSG_SIZE 11 +#define TSDB_CODE_UNEXPECTED_RESPONSE 12 +#define TSDB_CODE_INVALID_RESPONSE_TYPE 13 +#define TSDB_CODE_NO_RESOURCE 14 +#define TSDB_CODE_INVALID_TIME_STAMP 15 +#define TSDB_CODE_MISMATCHED_METER_ID 16 +#define TSDB_CODE_ACTION_TRANS_NOT_FINISHED 17 +#define TSDB_CODE_ACTION_NOT_ONLINE 18 +#define TSDB_CODE_ACTION_SEND_FAILD 19 +#define TSDB_CODE_NOT_ACTIVE_SESSION 20 +#define TSDB_CODE_INVALID_VNODE_ID 21 +#define TSDB_CODE_APP_ERROR 22 +#define TSDB_CODE_INVALID_IE 23 +#define TSDB_CODE_INVALID_VALUE 24 +#define TSDB_CODE_REDIRECT 25 +#define TSDB_CODE_ALREADY_THERE 26 +#define TSDB_CODE_INVALID_METER_ID 27 +#define TSDB_CODE_INVALID_SQL 28 +#define TSDB_CODE_NETWORK_UNAVAIL 29 +#define TSDB_CODE_INVALID_MSG_LEN 30 +#define TSDB_CODE_INVALID_DB 31 +#define TSDB_CODE_INVALID_TABLE 32 +#define TSDB_CODE_DB_ALREADY_EXIST 33 +#define TSDB_CODE_TABLE_ALREADY_EXIST 34 +#define TSDB_CODE_INVALID_USER 35 +#define TSDB_CODE_INVALID_ACCT 36 +#define TSDB_CODE_INVALID_PASS 37 +#define TSDB_CODE_DB_NOT_SELECTED 38 +#define TSDB_CODE_MEMORY_CORRUPTED 39 +#define TSDB_CODE_USER_ALREADY_EXIST 40 +#define TSDB_CODE_NO_RIGHTS 41 +#define TSDB_CODE_DISCONNECTED 42 +#define TSDB_CODE_NO_MASTER 43 +#define TSDB_CODE_NOT_CONFIGURED 44 +#define TSDB_CODE_INVALID_OPTION 45 +#define TSDB_CODE_NODE_OFFLINE 46 +#define TSDB_CODE_SYNC_REQUIRED 47 +#define TSDB_CODE_NO_ENOUGH_DNODES 48 +#define TSDB_CODE_UNSYNCED 49 +#define TSDB_CODE_TOO_SLOW 50 +#define TSDB_CODE_OTHERS 51 +#define TSDB_CODE_NO_REMOVE_MASTER 52 +#define TSDB_CODE_WRONG_SCHEMA 53 +#define TSDB_CODE_NOT_ACTIVE_VNODE 54 +#define TSDB_CODE_TOO_MANY_USERS 55 +#define TSDB_CODE_TOO_MANY_DATABSES 56 +#define TSDB_CODE_TOO_MANY_TABLES 57 +#define TSDB_CODE_TOO_MANY_DNODES 58 +#define TSDB_CODE_TOO_MANY_ACCTS 59 +#define TSDB_CODE_ACCT_ALREADY_EXIST 60 +#define TSDB_CODE_DNODE_ALREADY_EXIST 61 +#define TSDB_CODE_SDB_ERROR 62 +#define TSDB_CODE_METRICMETA_EXPIRED 63 // local cached metric-meta expired causes error in metric query +#define TSDB_CODE_NOT_READY 64 // peer is not ready to process data +#define TSDB_CODE_MAX_SESSIONS 65 // too many sessions +#define TSDB_CODE_MAX_CONNECTIONS 66 // too many connections +#define TSDB_CODE_SESSION_ALREADY_EXIST 67 +#define TSDB_CODE_NO_QSUMMARY 68 +#define TSDB_CODE_SERV_OUT_OF_MEMORY 69 +#define TSDB_CODE_INVALID_QHANDLE 70 +#define TSDB_CODE_RELATED_TABLES_EXIST 71 +#define TSDB_CODE_MONITOR_DB_FORBEIDDEN 72 +#define TSDB_CODE_VG_COMMITLOG_INIT_FAILED 73 +#define TSDB_CODE_VG_INIT_FAILED 74 +#define TSDB_CODE_DATA_ALREADY_IMPORTED 75 +#define TSDB_CODE_OPS_NOT_SUPPORT 76 +#define TSDB_CODE_INVALID_QUERY_ID 77 +#define TSDB_CODE_INVALID_STREAM_ID 78 +#define TSDB_CODE_INVALID_CONNECTION 79 +#define TSDB_CODE_ACTION_NOT_BALANCED 80 +#define TSDB_CODE_CLI_OUT_OF_MEMORY 81 +#define TSDB_CODE_DATA_OVERFLOW 82 +#define TSDB_CODE_QUERY_CANCELLED 83 +#define TSDB_CODE_GRANT_TIMESERIES_LIMITED 84 +#define TSDB_CODE_GRANT_EXPIRED 85 +#define TSDB_CODE_CLI_NO_DISKSPACE 86 +#define TSDB_CODE_FILE_CORRUPTED 87 +#define TSDB_CODE_INVALID_CLIENT_VERSION 88 +#define TSDB_CODE_INVALID_ACCT_PARAMETER 89 +#define TSDB_CODE_NOT_ENOUGH_TIME_SERIES 90 +#define TSDB_CODE_NO_WRITE_ACCESS 91 +#define TSDB_CODE_NO_READ_ACCESS 92 +#define TSDB_CODE_GRANT_DB_LIMITED 93 +#define TSDB_CODE_GRANT_USER_LIMITED 94 +#define TSDB_CODE_GRANT_CONN_LIMITED 95 +#define TSDB_CODE_GRANT_STREAM_LIMITED 96 +#define TSDB_CODE_GRANT_SPEED_LIMITED 97 +#define TSDB_CODE_GRANT_STORAGE_LIMITED 98 +#define TSDB_CODE_GRANT_QUERYTIME_LIMITED 99 +#define TSDB_CODE_GRANT_ACCT_LIMITED 100 +#define TSDB_CODE_GRANT_DNODE_LIMITED 101 +#define TSDB_CODE_GRANT_CPU_LIMITED 102 +#define TSDB_CODE_SESSION_NOT_READY 103 // table NOT in ready state +#define TSDB_CODE_BATCH_SIZE_TOO_BIG 104 +#define TSDB_CODE_TIMESTAMP_OUT_OF_RANGE 105 +#define TSDB_CODE_INVALID_QUERY_MSG 106 // failed to validate the sql expression msg by vnode +#define TSDB_CODE_CACHE_BLOCK_TS_DISORDERED 107 // time stamp in cache block is disordered +#define TSDB_CODE_FILE_BLOCK_TS_DISORDERED 108 // time stamp in file block is disordered +#define TSDB_CODE_INVALID_COMMIT_LOG 109 // commit log init failed +#define TSDB_CODE_SERVER_NO_SPACE 110 +#define TSDB_CODE_NOT_SUPER_TABLE 111 // operation only available for super table +#define TSDB_CODE_DUPLICATE_TAGS 112 // tags value for join not unique +#define TSDB_CODE_INVALID_SUBMIT_MSG 113 +#define TSDB_CODE_NOT_ACTIVE_TABLE 114 +#define TSDB_CODE_INVALID_TABLE_ID 115 + +#ifdef __cplusplus +} +#endif + +#endif //TDENGINE_TAOSERROR_H diff --git a/src/inc/taosmsg.h b/src/inc/taosmsg.h index 71e4c75634..e75404ad98 100644 --- a/src/inc/taosmsg.h +++ b/src/inc/taosmsg.h @@ -21,121 +21,7 @@ extern "C" { #endif #include "tsdb.h" - -#define TSDB_CODE_SUCCESS 0 -#define TSDB_CODE_ACTION_IN_PROGRESS 1 - -#define TSDB_CODE_LAST_SESSION_NOT_FINISHED 5 -#define TSDB_CODE_INVALID_SESSION_ID 6 -#define TSDB_CODE_INVALID_TRAN_ID 7 -#define TSDB_CODE_INVALID_MSG_TYPE 8 -#define TSDB_CODE_ALREADY_PROCESSED 9 -#define TSDB_CODE_AUTH_FAILURE 10 -#define TSDB_CODE_WRONG_MSG_SIZE 11 -#define TSDB_CODE_UNEXPECTED_RESPONSE 12 -#define TSDB_CODE_INVALID_RESPONSE_TYPE 13 -#define TSDB_CODE_NO_RESOURCE 14 -#define TSDB_CODE_INVALID_TIME_STAMP 15 -#define TSDB_CODE_MISMATCHED_METER_ID 16 -#define TSDB_CODE_ACTION_TRANS_NOT_FINISHED 17 -#define TSDB_CODE_ACTION_NOT_ONLINE 18 -#define TSDB_CODE_ACTION_SEND_FAILD 19 -#define TSDB_CODE_NOT_ACTIVE_SESSION 20 -#define TSDB_CODE_INVALID_VNODE_ID 21 -#define TSDB_CODE_APP_ERROR 22 -#define TSDB_CODE_INVALID_IE 23 -#define TSDB_CODE_INVALID_VALUE 24 -#define TSDB_CODE_REDIRECT 25 -#define TSDB_CODE_ALREADY_THERE 26 -#define TSDB_CODE_INVALID_METER_ID 27 -#define TSDB_CODE_INVALID_SQL 28 -#define TSDB_CODE_NETWORK_UNAVAIL 29 -#define TSDB_CODE_INVALID_MSG_LEN 30 -#define TSDB_CODE_INVALID_DB 31 -#define TSDB_CODE_INVALID_TABLE 32 -#define TSDB_CODE_DB_ALREADY_EXIST 33 -#define TSDB_CODE_TABLE_ALREADY_EXIST 34 -#define TSDB_CODE_INVALID_USER 35 -#define TSDB_CODE_INVALID_ACCT 36 -#define TSDB_CODE_INVALID_PASS 37 -#define TSDB_CODE_DB_NOT_SELECTED 38 -#define TSDB_CODE_MEMORY_CORRUPTED 39 -#define TSDB_CODE_USER_ALREADY_EXIST 40 -#define TSDB_CODE_NO_RIGHTS 41 -#define TSDB_CODE_DISCONNECTED 42 -#define TSDB_CODE_NO_MASTER 43 -#define TSDB_CODE_NOT_CONFIGURED 44 -#define TSDB_CODE_INVALID_OPTION 45 -#define TSDB_CODE_NODE_OFFLINE 46 -#define TSDB_CODE_SYNC_REQUIRED 47 -#define TSDB_CODE_NO_ENOUGH_DNODES 48 -#define TSDB_CODE_UNSYNCED 49 -#define TSDB_CODE_TOO_SLOW 50 -#define TSDB_CODE_OTHERS 51 -#define TSDB_CODE_NO_REMOVE_MASTER 52 -#define TSDB_CODE_WRONG_SCHEMA 53 -#define TSDB_CODE_NOT_ACTIVE_VNODE 54 -#define TSDB_CODE_TOO_MANY_USERS 55 -#define TSDB_CODE_TOO_MANY_DATABSES 56 -#define TSDB_CODE_TOO_MANY_TABLES 57 -#define TSDB_CODE_TOO_MANY_DNODES 58 -#define TSDB_CODE_TOO_MANY_ACCTS 59 -#define TSDB_CODE_ACCT_ALREADY_EXIST 60 -#define TSDB_CODE_DNODE_ALREADY_EXIST 61 -#define TSDB_CODE_SDB_ERROR 62 -#define TSDB_CODE_METRICMETA_EXPIRED 63 // local cached metric-meta expired causes error in metric query -#define TSDB_CODE_NOT_READY 64 // peer is not ready to process data -#define TSDB_CODE_MAX_SESSIONS 65 // too many sessions -#define TSDB_CODE_MAX_CONNECTIONS 66 // too many connections -#define TSDB_CODE_SESSION_ALREADY_EXIST 67 -#define TSDB_CODE_NO_QSUMMARY 68 -#define TSDB_CODE_SERV_OUT_OF_MEMORY 69 -#define TSDB_CODE_INVALID_QHANDLE 70 -#define TSDB_CODE_RELATED_TABLES_EXIST 71 -#define TSDB_CODE_MONITOR_DB_FORBEIDDEN 72 -#define TSDB_CODE_VG_COMMITLOG_INIT_FAILED 73 -#define TSDB_CODE_VG_INIT_FAILED 74 -#define TSDB_CODE_DATA_ALREADY_IMPORTED 75 -#define TSDB_CODE_OPS_NOT_SUPPORT 76 -#define TSDB_CODE_INVALID_QUERY_ID 77 -#define TSDB_CODE_INVALID_STREAM_ID 78 -#define TSDB_CODE_INVALID_CONNECTION 79 -#define TSDB_CODE_ACTION_NOT_BALANCED 80 -#define TSDB_CODE_CLI_OUT_OF_MEMORY 81 -#define TSDB_CODE_DATA_OVERFLOW 82 -#define TSDB_CODE_QUERY_CANCELLED 83 -#define TSDB_CODE_GRANT_TIMESERIES_LIMITED 84 -#define TSDB_CODE_GRANT_EXPIRED 85 -#define TSDB_CODE_CLI_NO_DISKSPACE 86 -#define TSDB_CODE_FILE_CORRUPTED 87 -#define TSDB_CODE_INVALID_CLIENT_VERSION 88 -#define TSDB_CODE_INVALID_ACCT_PARAMETER 89 -#define TSDB_CODE_NOT_ENOUGH_TIME_SERIES 90 -#define TSDB_CODE_NO_WRITE_ACCESS 91 -#define TSDB_CODE_NO_READ_ACCESS 92 -#define TSDB_CODE_GRANT_DB_LIMITED 93 -#define TSDB_CODE_GRANT_USER_LIMITED 94 -#define TSDB_CODE_GRANT_CONN_LIMITED 95 -#define TSDB_CODE_GRANT_STREAM_LIMITED 96 -#define TSDB_CODE_GRANT_SPEED_LIMITED 97 -#define TSDB_CODE_GRANT_STORAGE_LIMITED 98 -#define TSDB_CODE_GRANT_QUERYTIME_LIMITED 99 -#define TSDB_CODE_GRANT_ACCT_LIMITED 100 -#define TSDB_CODE_GRANT_DNODE_LIMITED 101 -#define TSDB_CODE_GRANT_CPU_LIMITED 102 -#define TSDB_CODE_SESSION_NOT_READY 103 // table NOT in ready state -#define TSDB_CODE_BATCH_SIZE_TOO_BIG 104 -#define TSDB_CODE_TIMESTAMP_OUT_OF_RANGE 105 -#define TSDB_CODE_INVALID_QUERY_MSG 106 // failed to validate the sql expression msg by vnode -#define TSDB_CODE_CACHE_BLOCK_TS_DISORDERED 107 // time stamp in cache block is disordered -#define TSDB_CODE_FILE_BLOCK_TS_DISORDERED 108 // time stamp in file block is disordered -#define TSDB_CODE_INVALID_COMMIT_LOG 109 // commit log init failed -#define TSDB_CODE_SERVER_NO_SPACE 110 -#define TSDB_CODE_NOT_SUPER_TABLE 111 // -#define TSDB_CODE_DUPLICATE_TAGS 112 // tags value for join not unique -#define TSDB_CODE_INVALID_SUBMIT_MSG 113 -#define TSDB_CODE_NOT_ACTIVE_TABLE 114 -#define TSDB_CODE_INVALID_TABLE_ID 115 +#include "taoserror.h" // message type #define TSDB_MSG_TYPE_REG 1 From 4e7e75b7ad34e142953cfeca307c7397226d730f Mon Sep 17 00:00:00 2001 From: hjxilinx Date: Sat, 16 Nov 2019 10:39:47 +0800 Subject: [PATCH 2/7] 4] --- src/client/src/tscServer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/client/src/tscServer.c b/src/client/src/tscServer.c index 8a6a7e30ab..025b7968ac 100644 --- a/src/client/src/tscServer.c +++ b/src/client/src/tscServer.c @@ -281,9 +281,9 @@ void tscGetConnToVnode(SSqlObj *pSql, uint8_t *pCode) { break; } - // the pSql->res.code is the previous error code. + // the pSql->res.code is the previous error(status) code. if (pSql->thandle == NULL && pSql->retry >= pSql->maxRetry) { - if (pSql->res.code != TSDB_CODE_SUCCESS) { + if (pSql->res.code != TSDB_CODE_SUCCESS && pSql->res.code != TSDB_CODE_ACTION_IN_PROGRESS) { *pCode = pSql->res.code; } From edbf603ee44326fbf586c0185a5e53b5bd4b2dea Mon Sep 17 00:00:00 2001 From: lihui Date: Sat, 16 Nov 2019 13:35:46 +0800 Subject: [PATCH 3/7] [change return error result] --- src/client/src/tscParseInsert.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/client/src/tscParseInsert.c b/src/client/src/tscParseInsert.c index c8ce728de1..abebea64df 100644 --- a/src/client/src/tscParseInsert.c +++ b/src/client/src/tscParseInsert.c @@ -191,10 +191,10 @@ int32_t tsParseOneColumnData(SSchema *pSchema, SSQLToken *pToken, char *payload, *((int8_t *)payload) = TSDB_DATA_TINYINT_NULL; } else { numType = tscToInteger(pToken, &iv, &endptr); - if (errno == ERANGE || iv > INT8_MAX || iv <= INT8_MIN) { - INVALID_SQL_RET_MSG(msg, "data is overflow"); - } else if (TK_ILLEGAL == numType) { + if (TK_ILLEGAL == numType) { INVALID_SQL_RET_MSG(msg, "data is illegal"); + } else if (errno == ERANGE || iv > INT8_MAX || iv <= INT8_MIN) { + INVALID_SQL_RET_MSG(msg, "data is overflow"); } *((int8_t *)payload) = (int8_t)iv; @@ -210,10 +210,10 @@ int32_t tsParseOneColumnData(SSchema *pSchema, SSQLToken *pToken, char *payload, *((int16_t *)payload) = TSDB_DATA_SMALLINT_NULL; } else { numType = tscToInteger(pToken, &iv, &endptr); - if (errno == ERANGE || iv > INT16_MAX || iv <= INT16_MIN) { - INVALID_SQL_RET_MSG(msg, "data is overflow"); - } else if (TK_ILLEGAL == numType) { + if (TK_ILLEGAL == numType) { INVALID_SQL_RET_MSG(msg, "data is illegal"); + } else if (errno == ERANGE || iv > INT16_MAX || iv <= INT16_MIN) { + INVALID_SQL_RET_MSG(msg, "data is overflow"); } *((int16_t *)payload) = (int16_t)iv; @@ -228,10 +228,10 @@ int32_t tsParseOneColumnData(SSchema *pSchema, SSQLToken *pToken, char *payload, *((int32_t *)payload) = TSDB_DATA_INT_NULL; } else { numType = tscToInteger(pToken, &iv, &endptr); - if (errno == ERANGE || iv > INT32_MAX || iv <= INT32_MIN) { - INVALID_SQL_RET_MSG(msg, "data is overflow"); - } else if (TK_ILLEGAL == numType) { + if (TK_ILLEGAL == numType) { INVALID_SQL_RET_MSG(msg, "data is illegal"); + } else if (errno == ERANGE || iv > INT32_MAX || iv <= INT32_MIN) { + INVALID_SQL_RET_MSG(msg, "data is overflow"); } *((int32_t *)payload) = (int32_t)iv; @@ -247,10 +247,10 @@ int32_t tsParseOneColumnData(SSchema *pSchema, SSQLToken *pToken, char *payload, *((int64_t *)payload) = TSDB_DATA_BIGINT_NULL; } else { numType = tscToInteger(pToken, &iv, &endptr); - if (errno == ERANGE || iv > INT64_MAX || iv <= INT64_MIN) { - INVALID_SQL_RET_MSG(msg, "data is overflow"); - } else if (TK_ILLEGAL == numType) { + if (TK_ILLEGAL == numType) { INVALID_SQL_RET_MSG(msg, "data is illegal"); + } else if (errno == ERANGE || iv > INT64_MAX || iv <= INT64_MIN) { + INVALID_SQL_RET_MSG(msg, "data is overflow"); } *((int64_t *)payload) = iv; From 1efed1e01b13291e64cb5f1727d468fcf9a5b8b0 Mon Sep 17 00:00:00 2001 From: lihui Date: Sat, 16 Nov 2019 13:37:05 +0800 Subject: [PATCH 4/7] [add taoserror.h] --- packaging/deb/makedeb.sh | 1 + packaging/rpm/tdengine.spec | 2 ++ packaging/tools/install.sh | 3 ++- packaging/tools/make_install.sh | 5 +++-- packaging/tools/post.sh | 3 ++- packaging/tools/preun.sh | 1 + packaging/tools/remove.sh | 1 + 7 files changed, 12 insertions(+), 4 deletions(-) diff --git a/packaging/deb/makedeb.sh b/packaging/deb/makedeb.sh index d54953113a..e4c795f1b8 100755 --- a/packaging/deb/makedeb.sh +++ b/packaging/deb/makedeb.sh @@ -49,6 +49,7 @@ cp ${compile_dir}/build/bin/taosd ${pkg_dir}${install_home_pat cp ${compile_dir}/build/bin/taos ${pkg_dir}${install_home_path}/bin cp ${compile_dir}/build/lib/${libfile} ${pkg_dir}${install_home_path}/driver cp ${compile_dir}/../src/inc/taos.h ${pkg_dir}${install_home_path}/include +cp ${compile_dir}/../src/inc/taoserror.h ${pkg_dir}${install_home_path}/include cp -r ${top_dir}/tests/examples/* ${pkg_dir}${install_home_path}/examples cp -r ${top_dir}/src/connector/grafana ${pkg_dir}${install_home_path}/connector cp -r ${top_dir}/src/connector/python ${pkg_dir}${install_home_path}/connector diff --git a/packaging/rpm/tdengine.spec b/packaging/rpm/tdengine.spec index 6e9e5e6f87..9ede4102e7 100644 --- a/packaging/rpm/tdengine.spec +++ b/packaging/rpm/tdengine.spec @@ -62,6 +62,7 @@ cp %{_compiledir}/build/bin/taosdemo %{buildroot}%{homepath}/bin cp %{_compiledir}/build/bin/taosdump %{buildroot}%{homepath}/bin cp %{_compiledir}/build/lib/${libfile} %{buildroot}%{homepath}/driver cp %{_compiledir}/../src/inc/taos.h %{buildroot}%{homepath}/include +cp %{_compiledir}/../src/inc/taoserror.h %{buildroot}%{homepath}/include cp -r %{_compiledir}/../src/connector/grafana %{buildroot}%{homepath}/connector cp -r %{_compiledir}/../src/connector/python %{buildroot}%{homepath}/connector cp -r %{_compiledir}/../src/connector/go %{buildroot}%{homepath}/connector @@ -138,6 +139,7 @@ if [ $1 -eq 0 ];then ${csudo} rm -f ${bin_link_dir}/taosdump || : ${csudo} rm -f ${cfg_link_dir}/* || : ${csudo} rm -f ${inc_link_dir}/taos.h || : + ${csudo} rm -f ${inc_link_dir}/taoserror.h || : ${csudo} rm -f ${lib_link_dir}/libtaos.* || : ${csudo} rm -f ${log_link_dir} || : diff --git a/packaging/tools/install.sh b/packaging/tools/install.sh index acd6c6ccce..4b653dec9c 100755 --- a/packaging/tools/install.sh +++ b/packaging/tools/install.sh @@ -98,9 +98,10 @@ function install_lib() { } function install_header() { - ${csudo} rm -f ${inc_link_dir}/taos.h || : + ${csudo} rm -f ${inc_link_dir}/taos.h ${inc_link_dir}/taoserror.h || : ${csudo} cp -f ${script_dir}/inc/* ${install_main_dir}/include && ${csudo} chmod 644 ${install_main_dir}/include/* ${csudo} ln -s ${install_main_dir}/include/taos.h ${inc_link_dir}/taos.h + ${csudo} ln -s ${install_main_dir}/include/taoserror.h ${inc_link_dir}/taoserror.h } function install_config() { diff --git a/packaging/tools/make_install.sh b/packaging/tools/make_install.sh index 4660ba5b2a..c43f918e8d 100755 --- a/packaging/tools/make_install.sh +++ b/packaging/tools/make_install.sh @@ -109,9 +109,10 @@ function install_lib() { function install_header() { - ${csudo} rm -f ${inc_link_dir}/taos.h || : - ${csudo} cp -f ${source_dir}/src/inc/taos.h ${install_main_dir}/include && ${csudo} chmod 644 ${install_main_dir}/include/* + ${csudo} rm -f ${inc_link_dir}/taos.h ${inc_link_dir}/taoserror.h || : + ${csudo} cp -f ${source_dir}/src/inc/taos.h ${source_dir}/src/inc/taoserror.h ${install_main_dir}/include && ${csudo} chmod 644 ${install_main_dir}/include/* ${csudo} ln -s ${install_main_dir}/include/taos.h ${inc_link_dir}/taos.h + ${csudo} ln -s ${install_main_dir}/include/taoserror.h ${inc_link_dir}/taoserror.h } function install_config() { diff --git a/packaging/tools/post.sh b/packaging/tools/post.sh index 9e18783657..11f3ab9a9b 100755 --- a/packaging/tools/post.sh +++ b/packaging/tools/post.sh @@ -61,8 +61,9 @@ function kill_taosd() { } function install_include() { - ${csudo} rm -f ${inc_link_dir}/taos.h || : + ${csudo} rm -f ${inc_link_dir}/taos.h ${inc_link_dir}/taoserror.h|| : ${csudo} ln -s ${inc_dir}/taos.h ${inc_link_dir}/taos.h + ${csudo} ln -s ${inc_dir}/taoserror.h ${inc_link_dir}/taoserror.h } function install_lib() { diff --git a/packaging/tools/preun.sh b/packaging/tools/preun.sh index 4566db1b5a..a08f4e304e 100755 --- a/packaging/tools/preun.sh +++ b/packaging/tools/preun.sh @@ -94,6 +94,7 @@ ${csudo} rm -f ${bin_link_dir}/taosdemo || : ${csudo} rm -f ${bin_link_dir}/taosdump || : ${csudo} rm -f ${cfg_link_dir}/* || : ${csudo} rm -f ${inc_link_dir}/taos.h || : +${csudo} rm -f ${inc_link_dir}/taoserror.h || : ${csudo} rm -f ${lib_link_dir}/libtaos.* || : ${csudo} rm -f ${log_link_dir} || : diff --git a/packaging/tools/remove.sh b/packaging/tools/remove.sh index 4ada19762c..6c2c6d5ea8 100755 --- a/packaging/tools/remove.sh +++ b/packaging/tools/remove.sh @@ -61,6 +61,7 @@ function clean_lib() { function clean_header() { # Remove link ${csudo} rm -f ${inc_link_dir}/taos.h || : + ${csudo} rm -f ${inc_link_dir}/taoserror.h || : } function clean_config() { From 55ed99d78e413a43070a0ad1e5c9812146eb77a9 Mon Sep 17 00:00:00 2001 From: lihui Date: Sat, 16 Nov 2019 13:39:51 +0800 Subject: [PATCH 5/7] [add taoserror.h] --- packaging/tools/makepkg.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/tools/makepkg.sh b/packaging/tools/makepkg.sh index 1a24ae8a1f..967b14cee9 100755 --- a/packaging/tools/makepkg.sh +++ b/packaging/tools/makepkg.sh @@ -22,7 +22,7 @@ install_dir="${release_dir}/taos-${version}-${package_name}-$(echo ${build_time} bin_files="${build_dir}/bin/taosd ${build_dir}/bin/taos ${build_dir}/bin/taosdemo ${build_dir}/bin/taosdump ${script_dir}/remove.sh" versioninfo=$(${script_dir}/get_version.sh ${code_dir}/util/src/version.c) lib_files="${build_dir}/lib/libtaos.so.${versioninfo}" -header_files="${code_dir}/inc/taos.h" +header_files="${code_dir}/inc/taos.h ${code_dir}/inc/taoserror.h" cfg_files="${top_dir}/packaging/cfg/*.cfg" install_files="${script_dir}/install.sh ${script_dir}/install_client.sh" From 6e7b3cf17a7a53860d4cb67afa9ef0c422e1a628 Mon Sep 17 00:00:00 2001 From: Hongze Cheng Date: Sat, 16 Nov 2019 14:36:54 +0800 Subject: [PATCH 6/7] add an assert for debug purpose --- src/system/detail/src/vnodeFile.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/system/detail/src/vnodeFile.c b/src/system/detail/src/vnodeFile.c index fdafc01352..132ee3f7de 100644 --- a/src/system/detail/src/vnodeFile.c +++ b/src/system/detail/src/vnodeFile.c @@ -216,6 +216,7 @@ int vnodeOpenCommitFiles(SVnodeObj *pVnode, int noTempLast) { if (numOfFiles >= pVnode->numOfFiles) { // create empty header files backward filesAdded = numOfFiles - pVnode->numOfFiles + 1; + assert(filesAdded <= pVnode->maxFiles + 2); for (int i = 0; i < filesAdded; ++i) { fileId = pVnode->fileId - pVnode->numOfFiles - i; if (vnodeCreateEmptyCompFile(vnode, fileId) < 0) From c302d338e7d5af23e16f678b26e549b872bf7f0c Mon Sep 17 00:00:00 2001 From: hjxilinx Date: Sat, 16 Nov 2019 15:30:28 +0800 Subject: [PATCH 7/7] refactor code, reorganize the header files --- src/kit/shell/src/shellCommand.c | 8 -------- src/kit/shell/src/shellEngine.c | 10 ---------- src/kit/shell/src/shellLinux.c | 20 +------------------- src/kit/shell/src/shellMain.c | 7 ------- src/modules/http/src/httpServer.c | 18 +----------------- src/os/linux/inc/os.h | 8 ++++++++ src/rpc/src/thaship.c | 8 -------- src/rpc/src/tmsghdr.c | 5 +---- src/rpc/src/trpc.c | 10 +--------- src/rpc/src/ttcpclient.c | 9 --------- src/rpc/src/ttcpserver.c | 10 ---------- src/rpc/src/tudp.c | 9 --------- src/sdb/src/hashstr.c | 8 +------- src/sdb/src/sdbEngine.c | 14 +------------- src/system/detail/inc/mgmt.h | 7 +------ src/system/detail/inc/mgmtBalance.h | 4 +--- src/system/detail/inc/mgmtSystem.h | 2 -- src/system/detail/inc/vnode.h | 7 +------ src/system/detail/inc/vnodePeer.h | 2 +- src/system/detail/inc/vnodeQueryImpl.h | 3 +-- src/system/detail/inc/vnodeRead.h | 2 +- src/system/detail/inc/vnodeShell.h | 2 +- src/system/detail/inc/vnodeStore.h | 2 -- src/system/detail/inc/vnodeSystem.h | 2 -- src/system/detail/src/dnodeMgmt.c | 5 ++--- src/system/detail/src/dnodeService.c | 16 ++-------------- src/system/detail/src/dnodeSystem.c | 6 +----- src/system/detail/src/mgmtAcct.c | 2 +- src/system/detail/src/mgmtConn.c | 4 +++- src/system/detail/src/mgmtDnode.c | 4 +--- src/system/detail/src/mgmtDnodeInt.c | 3 +-- src/system/detail/src/mgmtMeter.c | 5 +---- src/system/detail/src/mgmtProfile.c | 3 ++- src/system/detail/src/mgmtShell.c | 2 +- src/system/detail/src/mgmtSupertableQuery.c | 5 +---- src/system/detail/src/mgmtSystem.c | 11 +---------- src/system/detail/src/mgmtUser.c | 2 +- src/system/detail/src/mgmtUtil.c | 5 +---- src/system/detail/src/mgmtVgroup.c | 2 +- src/system/detail/src/vnodeCache.c | 4 +--- src/system/detail/src/vnodeCommit.c | 10 +--------- src/system/detail/src/vnodeFile.c | 10 +--------- src/system/detail/src/vnodeFileUtil.c | 6 +----- src/system/detail/src/vnodeFilterFunc.c | 6 +----- src/system/detail/src/vnodeImport.c | 5 +---- src/system/detail/src/vnodeMeter.c | 5 +---- src/system/detail/src/vnodeQueryProcess.c | 5 +---- src/system/detail/src/vnodeRead.c | 7 +------ src/system/detail/src/vnodeShell.c | 6 ++---- src/system/detail/src/vnodeStore.c | 6 +----- src/system/detail/src/vnodeSystem.c | 10 +--------- src/system/detail/src/vnodeTagMgmt.c | 4 +--- src/system/detail/src/vnodeUtil.c | 5 +---- src/util/src/ihash.c | 7 ------- src/util/src/tcache.c | 10 +--------- src/util/src/tcompression.c | 6 ------ src/util/src/textbuffer.c | 11 ----------- src/util/src/thash.c | 7 ------- src/util/src/thistogram.c | 8 +------- src/util/src/tidpool.c | 5 +---- src/util/src/tlog.c | 16 ---------------- src/util/src/tmem.c | 8 +------- src/util/src/tmodule.c | 6 ------ src/util/src/tsched.c | 8 -------- src/util/src/tsocket.c | 11 ----------- src/util/src/ttimer.c | 6 ------ src/util/src/ttypes.c | 9 --------- src/util/src/tutil.c | 8 -------- 68 files changed, 60 insertions(+), 407 deletions(-) diff --git a/src/kit/shell/src/shellCommand.c b/src/kit/shell/src/shellCommand.c index 9bf182ab0e..46aa04c1d7 100644 --- a/src/kit/shell/src/shellCommand.c +++ b/src/kit/shell/src/shellCommand.c @@ -13,16 +13,8 @@ * along with this program. If not, see . */ -#include -#include -#include -#include -#include - #define __USE_XOPEN -#include - #include "os.h" #include "shell.h" #include "shellCommand.h" diff --git a/src/kit/shell/src/shellEngine.c b/src/kit/shell/src/shellEngine.c index 34f51e3b3f..e2897da698 100644 --- a/src/kit/shell/src/shellEngine.c +++ b/src/kit/shell/src/shellEngine.c @@ -16,16 +16,6 @@ #define _XOPEN_SOURCE #define _DEFAULT_SOURCE -#include -#include -#include -#include -#include -#include -#include -#include -#include - #include "os.h" #include "shell.h" #include "shellCommand.h" diff --git a/src/kit/shell/src/shellLinux.c b/src/kit/shell/src/shellLinux.c index 145025cbe1..0ece4efbb2 100644 --- a/src/kit/shell/src/shellLinux.c +++ b/src/kit/shell/src/shellLinux.c @@ -13,27 +13,9 @@ * along with this program. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - #define __USE_XOPEN -#include +#include "os.h" #include "shell.h" #include "shellCommand.h" diff --git a/src/kit/shell/src/shellMain.c b/src/kit/shell/src/shellMain.c index 63c9eac0db..82333020f1 100644 --- a/src/kit/shell/src/shellMain.c +++ b/src/kit/shell/src/shellMain.c @@ -13,13 +13,6 @@ * along with this program. If not, see . */ -#include -#include -#include -#include -#include -#include - #include "os.h" #include "shell.h" #include "tsclient.h" diff --git a/src/modules/http/src/httpServer.c b/src/modules/http/src/httpServer.c index 49ff3562bf..ae8f9eeaad 100644 --- a/src/modules/http/src/httpServer.c +++ b/src/modules/http/src/httpServer.c @@ -13,23 +13,7 @@ * along with this program. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "os.h" #include "taosmsg.h" #include "tlog.h" diff --git a/src/os/linux/inc/os.h b/src/os/linux/inc/os.h index 6ecb64eda5..dc3dc1cfdf 100644 --- a/src/os/linux/inc/os.h +++ b/src/os/linux/inc/os.h @@ -23,6 +23,7 @@ extern "C" { #include #include +#include #include #include #include @@ -31,6 +32,7 @@ extern "C" { #include #include #include +#include #include #include #include @@ -41,9 +43,12 @@ extern "C" { #include #include #include +#include #include +#include #include #include +#include #include #include #include @@ -55,7 +60,9 @@ extern "C" { #include #include #include +#include #include +#include #include #include #include @@ -65,6 +72,7 @@ extern "C" { #include #include + #define taosCloseSocket(x) \ { \ if (VALIDFD(x)) { \ diff --git a/src/rpc/src/thaship.c b/src/rpc/src/thaship.c index 4cc6feeea3..2c46e53258 100644 --- a/src/rpc/src/thaship.c +++ b/src/rpc/src/thaship.c @@ -13,14 +13,6 @@ * along with this program. If not, see . */ -#include -#include -#include -#include -#include -#include -#include - #include "os.h" #include "tlog.h" #include "tmempool.h" diff --git a/src/rpc/src/tmsghdr.c b/src/rpc/src/tmsghdr.c index 960d1fc5f6..a46f182b1d 100644 --- a/src/rpc/src/tmsghdr.c +++ b/src/rpc/src/tmsghdr.c @@ -13,10 +13,7 @@ * along with this program. If not, see . */ -#include -#include -#include -#include +#include "os.h" void taosFreeMsgHdr(void *hdr) { struct msghdr *msgHdr = (struct msghdr *)hdr; diff --git a/src/rpc/src/trpc.c b/src/rpc/src/trpc.c index 41c628e169..de21598dd9 100644 --- a/src/rpc/src/trpc.c +++ b/src/rpc/src/trpc.c @@ -13,16 +13,8 @@ * along with this program. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include - #include "os.h" + #include "shash.h" #include "taosmsg.h" #include "tidpool.h" diff --git a/src/rpc/src/ttcpclient.c b/src/rpc/src/ttcpclient.c index e12f1e1728..8e6f91a661 100644 --- a/src/rpc/src/ttcpclient.c +++ b/src/rpc/src/ttcpclient.c @@ -13,15 +13,6 @@ * along with this program. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include - #include "os.h" #include "taosmsg.h" #include "tlog.h" diff --git a/src/rpc/src/ttcpserver.c b/src/rpc/src/ttcpserver.c index b6b0e07230..04078abb64 100644 --- a/src/rpc/src/ttcpserver.c +++ b/src/rpc/src/ttcpserver.c @@ -13,16 +13,6 @@ * along with this program. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include - #include "os.h" #include "taosmsg.h" #include "tlog.h" diff --git a/src/rpc/src/tudp.c b/src/rpc/src/tudp.c index 1940c89e85..7a4961f90c 100644 --- a/src/rpc/src/tudp.c +++ b/src/rpc/src/tudp.c @@ -13,15 +13,6 @@ * along with this program. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include - #include "os.h" #include "taosmsg.h" #include "thash.h" diff --git a/src/sdb/src/hashstr.c b/src/sdb/src/hashstr.c index 1a9a7fefb4..4b9aa33928 100644 --- a/src/sdb/src/hashstr.c +++ b/src/sdb/src/hashstr.c @@ -13,13 +13,7 @@ * along with this program. If not, see . */ -#include -#include -#include -#include -#include -#include -#include +#include "os.h" #include "tsdb.h" #define MAX_STR_LEN 40 diff --git a/src/sdb/src/sdbEngine.c b/src/sdb/src/sdbEngine.c index 59e3d7e039..326e9a4df2 100644 --- a/src/sdb/src/sdbEngine.c +++ b/src/sdb/src/sdbEngine.c @@ -13,19 +13,7 @@ * along with this program. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "os.h" #include "sdb.h" #include "sdbint.h" diff --git a/src/system/detail/inc/mgmt.h b/src/system/detail/inc/mgmt.h index 1d1f325ec2..702eb00875 100644 --- a/src/system/detail/inc/mgmt.h +++ b/src/system/detail/inc/mgmt.h @@ -20,11 +20,7 @@ extern "C" { #endif -#include -#include -#include -#include -#include +#include "os.h" #include "sdb.h" #include "tglobalcfg.h" @@ -34,7 +30,6 @@ extern "C" { #include "tmempool.h" #include "trpc.h" #include "tsdb.h" -#include "tsdb.h" #include "tskiplist.h" #include "tsocket.h" #include "ttime.h" diff --git a/src/system/detail/inc/mgmtBalance.h b/src/system/detail/inc/mgmtBalance.h index 4157458a7f..7d478416ac 100644 --- a/src/system/detail/inc/mgmtBalance.h +++ b/src/system/detail/inc/mgmtBalance.h @@ -20,9 +20,7 @@ extern "C" { #endif -#include -#include -#include +#include "os.h" #include "dnodeSystem.h" #include "mgmt.h" diff --git a/src/system/detail/inc/mgmtSystem.h b/src/system/detail/inc/mgmtSystem.h index 1262d7e834..44bb0331e1 100644 --- a/src/system/detail/inc/mgmtSystem.h +++ b/src/system/detail/inc/mgmtSystem.h @@ -20,8 +20,6 @@ extern "C" { #endif -#include - int mgmtInitRedirect(); void mgmtCleanUpRedirect(); diff --git a/src/system/detail/inc/vnode.h b/src/system/detail/inc/vnode.h index 373d9e713b..35b5c010ab 100644 --- a/src/system/detail/inc/vnode.h +++ b/src/system/detail/inc/vnode.h @@ -20,11 +20,7 @@ extern "C" { #endif -#include -#include -#include -#include -#include +#include "os.h" #include "tglobalcfg.h" #include "tidpool.h" @@ -33,7 +29,6 @@ extern "C" { #include "trpc.h" #include "tsclient.h" #include "tsdb.h" -#include "tsdb.h" #include "tsocket.h" #include "ttime.h" #include "ttimer.h" diff --git a/src/system/detail/inc/vnodePeer.h b/src/system/detail/inc/vnodePeer.h index d44143e619..4f17e66a70 100644 --- a/src/system/detail/inc/vnodePeer.h +++ b/src/system/detail/inc/vnodePeer.h @@ -16,7 +16,7 @@ #ifndef TDENGINE_VNODEPEER_H #define TDENGINE_VNODEPEER_H -#include +#include "os.h" #ifdef __cplusplus extern "C" { diff --git a/src/system/detail/inc/vnodeQueryImpl.h b/src/system/detail/inc/vnodeQueryImpl.h index c00af3b8e9..810105d638 100644 --- a/src/system/detail/inc/vnodeQueryImpl.h +++ b/src/system/detail/inc/vnodeQueryImpl.h @@ -20,8 +20,7 @@ extern "C" { #endif -#include -#include +#include "os.h" #include "ihash.h" diff --git a/src/system/detail/inc/vnodeRead.h b/src/system/detail/inc/vnodeRead.h index 20f49354f2..1de9f97e82 100644 --- a/src/system/detail/inc/vnodeRead.h +++ b/src/system/detail/inc/vnodeRead.h @@ -20,7 +20,7 @@ extern "C" { #endif -#include +#include "os.h" #include "tinterpolation.h" #include "vnodeTagMgmt.h" diff --git a/src/system/detail/inc/vnodeShell.h b/src/system/detail/inc/vnodeShell.h index d0194a1765..e450983dd7 100644 --- a/src/system/detail/inc/vnodeShell.h +++ b/src/system/detail/inc/vnodeShell.h @@ -20,7 +20,7 @@ extern "C" { #endif -#include +#include "os.h" typedef struct { int sid; diff --git a/src/system/detail/inc/vnodeStore.h b/src/system/detail/inc/vnodeStore.h index d4eedd4ce0..638bcb54bb 100644 --- a/src/system/detail/inc/vnodeStore.h +++ b/src/system/detail/inc/vnodeStore.h @@ -16,8 +16,6 @@ #ifndef TDENGINE_VNODESTORE_H #define TDENGINE_VNODESTORE_H -#include - #ifdef __cplusplus extern "C" { #endif diff --git a/src/system/detail/inc/vnodeSystem.h b/src/system/detail/inc/vnodeSystem.h index e69b0b9f1e..e436288fc1 100644 --- a/src/system/detail/inc/vnodeSystem.h +++ b/src/system/detail/inc/vnodeSystem.h @@ -16,8 +16,6 @@ #ifndef TDENGINE_VNODESYSTEM_H #define TDENGINE_VNODESYSTEM_H -#include - #ifdef __cplusplus extern "C" { #endif diff --git a/src/system/detail/src/dnodeMgmt.c b/src/system/detail/src/dnodeMgmt.c index d3f84639a6..ac651f05f2 100644 --- a/src/system/detail/src/dnodeMgmt.c +++ b/src/system/detail/src/dnodeMgmt.c @@ -14,9 +14,8 @@ */ #define _DEFAULT_SOURCE -#include -#include -#include + +#include "os.h" #include "dnodeSystem.h" #include "taosmsg.h" diff --git a/src/system/detail/src/dnodeService.c b/src/system/detail/src/dnodeService.c index 86d3b4a795..a14ec1fda6 100644 --- a/src/system/detail/src/dnodeService.c +++ b/src/system/detail/src/dnodeService.c @@ -14,20 +14,8 @@ */ #define _DEFAULT_SOURCE -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include + +#include "os.h" #include "dnodeSystem.h" #include "tglobalcfg.h" diff --git a/src/system/detail/src/dnodeSystem.c b/src/system/detail/src/dnodeSystem.c index 1b5d9418b4..a6392cee4d 100644 --- a/src/system/detail/src/dnodeSystem.c +++ b/src/system/detail/src/dnodeSystem.c @@ -14,11 +14,7 @@ */ #define _DEFAULT_SOURCE -#include -#include -#include -#include -#include +#include "os.h" #include "mgmt.h" #include "vnode.h" diff --git a/src/system/detail/src/mgmtAcct.c b/src/system/detail/src/mgmtAcct.c index dac67518e9..e5f52b17f9 100644 --- a/src/system/detail/src/mgmtAcct.c +++ b/src/system/detail/src/mgmtAcct.c @@ -14,7 +14,7 @@ */ #define _DEFAULT_SOURCE -#include +#include "os.h" #include "mgmt.h" #include "tschemautil.h" diff --git a/src/system/detail/src/mgmtConn.c b/src/system/detail/src/mgmtConn.c index b3fb24de6b..40385d2fc4 100644 --- a/src/system/detail/src/mgmtConn.c +++ b/src/system/detail/src/mgmtConn.c @@ -14,8 +14,10 @@ */ #define _DEFAULT_SOURCE + +#include "os.h" + #include "mgmt.h" -#include #include "taosmsg.h" #include "tschemautil.h" diff --git a/src/system/detail/src/mgmtDnode.c b/src/system/detail/src/mgmtDnode.c index 36e3a41595..3a4936041c 100644 --- a/src/system/detail/src/mgmtDnode.c +++ b/src/system/detail/src/mgmtDnode.c @@ -15,9 +15,7 @@ #define _DEFAULT_SOURCE -#include -#include -#include +#include "os.h" #include "dnodeSystem.h" #include "mgmt.h" diff --git a/src/system/detail/src/mgmtDnodeInt.c b/src/system/detail/src/mgmtDnodeInt.c index e215022869..af86757d51 100644 --- a/src/system/detail/src/mgmtDnodeInt.c +++ b/src/system/detail/src/mgmtDnodeInt.c @@ -14,8 +14,7 @@ */ #define _DEFAULT_SOURCE -#include -#include +#include "os.h" #include "dnodeSystem.h" #include "mgmt.h" diff --git a/src/system/detail/src/mgmtMeter.c b/src/system/detail/src/mgmtMeter.c index 2db920fdd7..d4ffabe4b7 100644 --- a/src/system/detail/src/mgmtMeter.c +++ b/src/system/detail/src/mgmtMeter.c @@ -14,10 +14,7 @@ */ #define _DEFAULT_SOURCE -#include -#include -#include -#include +#include "os.h" #include "mgmt.h" #include "mgmtUtil.h" diff --git a/src/system/detail/src/mgmtProfile.c b/src/system/detail/src/mgmtProfile.c index e641739e31..bd5540e5ee 100644 --- a/src/system/detail/src/mgmtProfile.c +++ b/src/system/detail/src/mgmtProfile.c @@ -14,8 +14,9 @@ */ #define _DEFAULT_SOURCE +#include "os.h" + #include "mgmt.h" -#include #include "mgmtProfile.h" #include "taosmsg.h" #include "tschemautil.h" diff --git a/src/system/detail/src/mgmtShell.c b/src/system/detail/src/mgmtShell.c index f74ee9f51f..efd863a7ef 100644 --- a/src/system/detail/src/mgmtShell.c +++ b/src/system/detail/src/mgmtShell.c @@ -14,7 +14,7 @@ */ #define _DEFAULT_SOURCE -#include +#include "os.h" #include "dnodeSystem.h" #include "mgmt.h" diff --git a/src/system/detail/src/mgmtSupertableQuery.c b/src/system/detail/src/mgmtSupertableQuery.c index 31f3e29425..f5e0509c24 100644 --- a/src/system/detail/src/mgmtSupertableQuery.c +++ b/src/system/detail/src/mgmtSupertableQuery.c @@ -14,10 +14,7 @@ */ #define _DEFAULT_SOURCE -#include -#include -#include -#include +#include "os.h" #include "mgmt.h" #include "mgmtUtil.h" diff --git a/src/system/detail/src/mgmtSystem.c b/src/system/detail/src/mgmtSystem.c index bb05c35e9b..375e100a83 100644 --- a/src/system/detail/src/mgmtSystem.c +++ b/src/system/detail/src/mgmtSystem.c @@ -14,16 +14,7 @@ */ #define _DEFAULT_SOURCE -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "os.h" #include "dnodeSystem.h" #include "mgmt.h" diff --git a/src/system/detail/src/mgmtUser.c b/src/system/detail/src/mgmtUser.c index 83e619841b..1acceb1ade 100644 --- a/src/system/detail/src/mgmtUser.c +++ b/src/system/detail/src/mgmtUser.c @@ -14,7 +14,7 @@ */ #define _DEFAULT_SOURCE -#include +#include "os.h" #include "mgmt.h" #include "tschemautil.h" diff --git a/src/system/detail/src/mgmtUtil.c b/src/system/detail/src/mgmtUtil.c index 3be2e1288d..d31198be64 100644 --- a/src/system/detail/src/mgmtUtil.c +++ b/src/system/detail/src/mgmtUtil.c @@ -14,10 +14,7 @@ */ #define _DEFAULT_SOURCE -#include -#include -#include -#include +#include "os.h" #include "mgmt.h" #include "mgmtUtil.h" diff --git a/src/system/detail/src/mgmtVgroup.c b/src/system/detail/src/mgmtVgroup.c index 5858be54ca..3b1da25a0a 100644 --- a/src/system/detail/src/mgmtVgroup.c +++ b/src/system/detail/src/mgmtVgroup.c @@ -14,7 +14,7 @@ */ #define _DEFAULT_SOURCE -#include +#include "os.h" #include "mgmt.h" #include "tschemautil.h" diff --git a/src/system/detail/src/vnodeCache.c b/src/system/detail/src/vnodeCache.c index f4bea682e9..94ac006060 100644 --- a/src/system/detail/src/vnodeCache.c +++ b/src/system/detail/src/vnodeCache.c @@ -14,9 +14,7 @@ */ #define _DEFAULT_SOURCE -#include -#include -#include +#include "os.h" #include "taosmsg.h" #include "vnode.h" diff --git a/src/system/detail/src/vnodeCommit.c b/src/system/detail/src/vnodeCommit.c index af14f2be4a..73c891f7bb 100644 --- a/src/system/detail/src/vnodeCommit.c +++ b/src/system/detail/src/vnodeCommit.c @@ -14,15 +14,7 @@ */ #define _GNU_SOURCE /* See feature_test_macros(7) */ -#include - -#include -#include -#include -#include -#include -#include -#include +#include "os.h" #include "tsdb.h" #include "vnode.h" diff --git a/src/system/detail/src/vnodeFile.c b/src/system/detail/src/vnodeFile.c index fdafc01352..5292f5bac7 100644 --- a/src/system/detail/src/vnodeFile.c +++ b/src/system/detail/src/vnodeFile.c @@ -14,15 +14,7 @@ */ #define _DEFAULT_SOURCE -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "os.h" #include "tscompression.h" #include "tutil.h" diff --git a/src/system/detail/src/vnodeFileUtil.c b/src/system/detail/src/vnodeFileUtil.c index f8de6c4a42..b40e7cfd41 100644 --- a/src/system/detail/src/vnodeFileUtil.c +++ b/src/system/detail/src/vnodeFileUtil.c @@ -14,11 +14,7 @@ */ #define _DEFAULT_SOURCE -#include -#include -#include -#include -#include +#include "os.h" #include "vnode.h" diff --git a/src/system/detail/src/vnodeFilterFunc.c b/src/system/detail/src/vnodeFilterFunc.c index bd829460d9..08fe78c188 100644 --- a/src/system/detail/src/vnodeFilterFunc.c +++ b/src/system/detail/src/vnodeFilterFunc.c @@ -14,11 +14,7 @@ */ #define _DEFAULT_SOURCE -#include -#include -#include -#include -#include +#include "os.h" #include "taosmsg.h" #include "tsqlfunction.h" diff --git a/src/system/detail/src/vnodeImport.c b/src/system/detail/src/vnodeImport.c index de795f820b..260d531200 100644 --- a/src/system/detail/src/vnodeImport.c +++ b/src/system/detail/src/vnodeImport.c @@ -14,10 +14,7 @@ */ #define _DEFAULT_SOURCE -#include -#include -#include -#include +#include "os.h" #include "trpc.h" #include "ttimer.h" diff --git a/src/system/detail/src/vnodeMeter.c b/src/system/detail/src/vnodeMeter.c index e3cde9a84d..14cdf9eb78 100644 --- a/src/system/detail/src/vnodeMeter.c +++ b/src/system/detail/src/vnodeMeter.c @@ -14,10 +14,7 @@ */ #define _DEFAULT_SOURCE -#include -#include -#include -#include +#include "os.h" #include "trpc.h" #include "tschemautil.h" diff --git a/src/system/detail/src/vnodeQueryProcess.c b/src/system/detail/src/vnodeQueryProcess.c index 73d97f5e6e..7378963301 100644 --- a/src/system/detail/src/vnodeQueryProcess.c +++ b/src/system/detail/src/vnodeQueryProcess.c @@ -14,10 +14,7 @@ */ #define _DEFAULT_SOURCE -#include -#include -#include -#include +#include "os.h" #include "taosmsg.h" #include "textbuffer.h" diff --git a/src/system/detail/src/vnodeRead.c b/src/system/detail/src/vnodeRead.c index f35567e720..0f9565a3b5 100644 --- a/src/system/detail/src/vnodeRead.c +++ b/src/system/detail/src/vnodeRead.c @@ -14,12 +14,7 @@ */ #define _DEFAULT_SOURCE -#include -#include -#include -#include -#include -#include +#include "os.h" #include "ihash.h" #include "taosmsg.h" diff --git a/src/system/detail/src/vnodeShell.c b/src/system/detail/src/vnodeShell.c index 5973b01d71..47b7b470bb 100644 --- a/src/system/detail/src/vnodeShell.c +++ b/src/system/detail/src/vnodeShell.c @@ -14,10 +14,8 @@ */ #define _DEFAULT_SOURCE -#include -#include -#include -#include +#include "os.h" + #include "taosmsg.h" #include "vnode.h" #include "vnodeShell.h" diff --git a/src/system/detail/src/vnodeStore.c b/src/system/detail/src/vnodeStore.c index e4294d72c6..d299d7fbf8 100644 --- a/src/system/detail/src/vnodeStore.c +++ b/src/system/detail/src/vnodeStore.c @@ -14,11 +14,7 @@ */ #define _DEFAULT_SOURCE -#include -#include -#include -#include -#include +#include "os.h" #include "dnodeSystem.h" #include "trpc.h" diff --git a/src/system/detail/src/vnodeSystem.c b/src/system/detail/src/vnodeSystem.c index 2f350db3fa..631e258b25 100644 --- a/src/system/detail/src/vnodeSystem.c +++ b/src/system/detail/src/vnodeSystem.c @@ -14,15 +14,7 @@ */ #define _DEFAULT_SOURCE -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "os.h" #include "tsdb.h" #include "tsocket.h" diff --git a/src/system/detail/src/vnodeTagMgmt.c b/src/system/detail/src/vnodeTagMgmt.c index 9b76e14854..adf4e544bb 100644 --- a/src/system/detail/src/vnodeTagMgmt.c +++ b/src/system/detail/src/vnodeTagMgmt.c @@ -14,9 +14,7 @@ */ #define _DEFAULT_SOURCE -#include -#include -#include +#include "os.h" #include "tsdb.h" #include "tlog.h" diff --git a/src/system/detail/src/vnodeUtil.c b/src/system/detail/src/vnodeUtil.c index 6691b2245d..b8c463f50b 100644 --- a/src/system/detail/src/vnodeUtil.c +++ b/src/system/detail/src/vnodeUtil.c @@ -14,10 +14,7 @@ */ #define _DEFAULT_SOURCE -#include -#include -#include -#include +#include "os.h" #include "tast.h" #include "tscUtil.h" diff --git a/src/util/src/ihash.c b/src/util/src/ihash.c index 606bddd79b..8c492b03f8 100644 --- a/src/util/src/ihash.c +++ b/src/util/src/ihash.c @@ -13,13 +13,6 @@ * along with this program. If not, see . */ -#include -#include -#include -#include -#include -#include - #include "os.h" typedef struct _str_node_t { diff --git a/src/util/src/tcache.c b/src/util/src/tcache.c index e92ac5d46d..8a2f1347df 100644 --- a/src/util/src/tcache.c +++ b/src/util/src/tcache.c @@ -13,15 +13,7 @@ * along with this program. If not, see . */ -#include -#include -#include -#include -#include - -#include -#include -#include +#include "os.h" #include "tcache.h" #include "tlog.h" diff --git a/src/util/src/tcompression.c b/src/util/src/tcompression.c index cd69f30c3f..1ac42377fb 100644 --- a/src/util/src/tcompression.c +++ b/src/util/src/tcompression.c @@ -46,12 +46,6 @@ * of the XORed value with informations. If not, record the first corresponding bytes. * */ -#include -#include -#include -#include -#include -#include #include "os.h" #include "lz4.h" diff --git a/src/util/src/textbuffer.c b/src/util/src/textbuffer.c index ebb6b9e0b8..8944dd4391 100644 --- a/src/util/src/textbuffer.c +++ b/src/util/src/textbuffer.c @@ -13,17 +13,6 @@ * along with this program. If not, see . */ -#include -#include -#include -#include - -#include -#include -#include - -#include - #include "os.h" #include "taos.h" #include "taosmsg.h" diff --git a/src/util/src/thash.c b/src/util/src/thash.c index 3b9cec0df5..e3c6fe26b4 100644 --- a/src/util/src/thash.c +++ b/src/util/src/thash.c @@ -13,13 +13,6 @@ * along with this program. If not, see . */ -#include -#include -#include -#include -#include -#include -#include #include "os.h" #include "tmempool.h" diff --git a/src/util/src/thistogram.c b/src/util/src/thistogram.c index 6cd02cc72e..5fef9077ea 100644 --- a/src/util/src/thistogram.c +++ b/src/util/src/thistogram.c @@ -13,13 +13,7 @@ * along with this program. If not, see . */ -#include -#include -#include -#include -#include -#include -#include +#include "os.h" #include "taosmsg.h" #include "thistogram.h" diff --git a/src/util/src/tidpool.c b/src/util/src/tidpool.c index a9cc78a026..c50c38aa3c 100644 --- a/src/util/src/tidpool.c +++ b/src/util/src/tidpool.c @@ -13,10 +13,7 @@ * along with this program. If not, see . */ -#include -#include -#include -#include +#include "os.h" #include "tlog.h" typedef struct { diff --git a/src/util/src/tlog.c b/src/util/src/tlog.c index b88cb7dc17..1a7f672e00 100644 --- a/src/util/src/tlog.c +++ b/src/util/src/tlog.c @@ -13,22 +13,6 @@ * along with this program. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - #include "os.h" #include "tlog.h" #include "tutil.h" diff --git a/src/util/src/tmem.c b/src/util/src/tmem.c index c2bb836635..462da884b9 100644 --- a/src/util/src/tmem.c +++ b/src/util/src/tmem.c @@ -13,13 +13,7 @@ * along with this program. If not, see . */ -#include -#include -#include -#include -#include -#include - +#include "os.h" #include "tlog.h" extern int32_t taosGetTimestampSec(); diff --git a/src/util/src/tmodule.c b/src/util/src/tmodule.c index fabdc1ed4f..54669a20be 100644 --- a/src/util/src/tmodule.c +++ b/src/util/src/tmodule.c @@ -13,12 +13,6 @@ * along with this program. If not, see . */ -#include -#include -#include -#include -#include - #include "os.h" #include "tmodule.h" #include "tutil.h" diff --git a/src/util/src/tsched.c b/src/util/src/tsched.c index ee16b92b65..bd49c670f6 100644 --- a/src/util/src/tsched.c +++ b/src/util/src/tsched.c @@ -13,14 +13,6 @@ * along with this program. If not, see . */ -#include -#include -#include -#include -#include -#include -#include - #include "os.h" #include "tlog.h" #include "tsched.h" diff --git a/src/util/src/tsocket.c b/src/util/src/tsocket.c index be352eb7ad..8de70f8a01 100644 --- a/src/util/src/tsocket.c +++ b/src/util/src/tsocket.c @@ -13,17 +13,6 @@ * along with this program. If not, see . */ -#include -#include -#include -#include - -#include -#include -#include -#include -#include - #include "os.h" #include "tglobalcfg.h" #include "tlog.h" diff --git a/src/util/src/ttimer.c b/src/util/src/ttimer.c index cf09aaee5e..9dad1e4e1e 100644 --- a/src/util/src/ttimer.c +++ b/src/util/src/ttimer.c @@ -13,12 +13,6 @@ * along with this program. If not, see . */ -#include -#include -#include -#include -#include -#include #include "os.h" #include "tlog.h" #include "tsched.h" diff --git a/src/util/src/ttypes.c b/src/util/src/ttypes.c index 3b36b1b31c..185a63c0eb 100644 --- a/src/util/src/ttypes.c +++ b/src/util/src/ttypes.c @@ -13,15 +13,6 @@ * along with this program. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include - #include "os.h" #include "taos.h" #include "tsdb.h" diff --git a/src/util/src/tutil.c b/src/util/src/tutil.c index af75a3ce0f..8413294bcc 100644 --- a/src/util/src/tutil.c +++ b/src/util/src/tutil.c @@ -13,14 +13,6 @@ * along with this program. If not, see . */ -#include -#include -#include -#include -#include -#include -#include - #include "os.h" #ifdef USE_LIBICONV