diff --git a/utils/tsim/inc/simInt.h b/utils/tsim/inc/simInt.h index 9438e11fbd3fbfbf6b67e2b5afbfcb78d37a7144..f512b119b4299c9146a3a9a915a2359ca52fc4c4 100644 --- a/utils/tsim/inc/simInt.h +++ b/utils/tsim/inc/simInt.h @@ -19,20 +19,20 @@ #include "os.h" #include "cJSON.h" -#include "tconfig.h" #include "taos.h" #include "taoserror.h" +#include "tconfig.h" +#include "tglobal.h" #include "tidpool.h" #include "tlog.h" #include "ttimer.h" #include "ttypes.h" #include "tutil.h" -#include "tglobal.h" #define MAX_MAIN_SCRIPT_NUM 10 #define MAX_BACKGROUND_SCRIPT_NUM 10 #define MAX_FILE_NAME_LEN 256 -#define MAX_ERROR_LEN 1024 +#define MAX_ERROR_LEN 4096 #define MAX_QUERY_VALUE_LEN 1024 #define MAX_QUERY_COL_NUM 100 #define MAX_QUERY_ROW_NUM 100 @@ -55,12 +55,42 @@ #define FAILED_POSTFIX "" #endif -#define simFatal(...) { if (simDebugFlag & DEBUG_FATAL) { taosPrintLog("SIM FATAL ", DEBUG_FATAL, 255, __VA_ARGS__); }} -#define simError(...) { if (simDebugFlag & DEBUG_ERROR) { taosPrintLog("SIM ERROR ", DEBUG_ERROR, 255, __VA_ARGS__); }} -#define simWarn(...) { if (simDebugFlag & DEBUG_WARN) { taosPrintLog("SIM WARN ", DEBUG_WARN, 255, __VA_ARGS__); }} -#define simInfo(...) { if (simDebugFlag & DEBUG_INFO) { taosPrintLog("SIM ", DEBUG_INFO, 255, __VA_ARGS__); }} -#define simDebug(...) { if (simDebugFlag & DEBUG_DEBUG) { taosPrintLog("SIM ", DEBUG_DEBUG, simDebugFlag, __VA_ARGS__); }} -#define simTrace(...) { if (simDebugFlag & DEBUG_TRACE) { taosPrintLog("SIM ", DEBUG_TRACE, simDebugFlag, __VA_ARGS__); }} +#define simFatal(...) \ + { \ + if (simDebugFlag & DEBUG_FATAL) { \ + taosPrintLog("SIM FATAL ", DEBUG_FATAL, 255, __VA_ARGS__); \ + } \ + } +#define simError(...) \ + { \ + if (simDebugFlag & DEBUG_ERROR) { \ + taosPrintLog("SIM ERROR ", DEBUG_ERROR, 255, __VA_ARGS__); \ + } \ + } +#define simWarn(...) \ + { \ + if (simDebugFlag & DEBUG_WARN) { \ + taosPrintLog("SIM WARN ", DEBUG_WARN, 255, __VA_ARGS__); \ + } \ + } +#define simInfo(...) \ + { \ + if (simDebugFlag & DEBUG_INFO) { \ + taosPrintLog("SIM ", DEBUG_INFO, 255, __VA_ARGS__); \ + } \ + } +#define simDebug(...) \ + { \ + if (simDebugFlag & DEBUG_DEBUG) { \ + taosPrintLog("SIM ", DEBUG_DEBUG, simDebugFlag, __VA_ARGS__); \ + } \ + } +#define simTrace(...) \ + { \ + if (simDebugFlag & DEBUG_TRACE) { \ + taosPrintLog("SIM ", DEBUG_TRACE, simDebugFlag, __VA_ARGS__); \ + } \ + } enum { SIM_SCRIPT_TYPE_MAIN, SIM_SCRIPT_TYPE_BACKGROUND }; @@ -143,7 +173,7 @@ typedef struct _script_t { char *optionBuffer; SCmdLine *lines; // command list SVariable variables[MAX_VAR_LEN]; - TdThread bgPid; + TdThread bgPid; char auth[128]; struct _script_t *bgScripts[MAX_BACKGROUND_SCRIPT_NUM]; } SScript; @@ -182,4 +212,4 @@ bool simExecuteLineInsertCmd(SScript *script, char *option); bool simExecuteLineInsertErrorCmd(SScript *script, char *option); void simVisuallizeOption(SScript *script, char *src, char *dst); -#endif /*_TD_SIM_INT_H_*/ \ No newline at end of file +#endif /*_TD_SIM_INT_H_*/ diff --git a/utils/tsim/src/simExe.c b/utils/tsim/src/simExe.c index 7218ea39f86eb40586b8c3b1815db5d574090eec..5ef6cd16bef9ccde8485b5740076e7b27f7e68e4 100644 --- a/utils/tsim/src/simExe.c +++ b/utils/tsim/src/simExe.c @@ -657,11 +657,11 @@ bool simCreateTaosdConnect(SScript *script, char *rest) { } bool simExecuteNativeSqlCommand(SScript *script, char *rest, bool isSlow) { - char timeStr[80] = {0}; - time_t tt; - struct tm tp; - SCmdLine *line = &script->lines[script->linePos]; - int32_t ret = -1; + char timeStr[80] = {0}; + time_t tt; + struct tm tp; + SCmdLine *line = &script->lines[script->linePos]; + int32_t ret = -1; TAOS_RES *pSql = NULL;