enh: comment out unused codes in tsim

This commit is contained in:
Shengliang Guan 2022-10-18 18:08:49 +08:00
parent 25d6bbaf09
commit 797ed80f70
2 changed files with 20 additions and 0 deletions

View File

@ -37,6 +37,7 @@ void simLogSql(char *sql, bool useSharp) {
taosFsyncFile(pFile); taosFsyncFile(pFile);
} }
#if 0
char *simParseArbitratorName(char *varName) { char *simParseArbitratorName(char *varName) {
static char hostName[140]; static char hostName[140];
#ifdef WINDOWS #ifdef WINDOWS
@ -47,6 +48,7 @@ char *simParseArbitratorName(char *varName) {
#endif #endif
return hostName; return hostName;
} }
#endif
char *simParseHostName(char *varName) { char *simParseHostName(char *varName) {
static char hostName[140]; static char hostName[140];
@ -102,9 +104,11 @@ char *simGetVariable(SScript *script, char *varName, int32_t varLen) {
return simParseHostName(varName); return simParseHostName(varName);
} }
#if 0
if (strncmp(varName, "arbitrator", 10) == 0) { if (strncmp(varName, "arbitrator", 10) == 0) {
return simParseArbitratorName(varName); return simParseArbitratorName(varName);
} }
#endif
if (strncmp(varName, "error", varLen) == 0) return script->error; if (strncmp(varName, "error", varLen) == 0) return script->error;
@ -883,6 +887,7 @@ bool simExecuteSqlSlowCmd(SScript *script, char *rest) {
return simExecuteSqlImpCmd(script, rest, isSlow); return simExecuteSqlImpCmd(script, rest, isSlow);
} }
#if 0
bool simExecuteRestfulCmd(SScript *script, char *rest) { bool simExecuteRestfulCmd(SScript *script, char *rest) {
TdFilePtr pFile = NULL; TdFilePtr pFile = NULL;
char filename[256]; char filename[256];
@ -924,6 +929,7 @@ bool simExecuteRestfulCmd(SScript *script, char *rest) {
return simExecuteSystemCmd(script, cmd); return simExecuteSystemCmd(script, cmd);
} }
#endif
bool simExecuteSqlErrorCmd(SScript *script, char *rest) { bool simExecuteSqlErrorCmd(SScript *script, char *rest) {
char buf[3000]; char buf[3000];
@ -981,6 +987,7 @@ bool simExecuteSqlErrorCmd(SScript *script, char *rest) {
return false; return false;
} }
#if 0
bool simExecuteLineInsertCmd(SScript *script, char *rest) { bool simExecuteLineInsertCmd(SScript *script, char *rest) {
char buf[TSDB_MAX_BINARY_LEN] = {0}; char buf[TSDB_MAX_BINARY_LEN] = {0};
@ -1037,3 +1044,4 @@ bool simExecuteLineInsertErrorCmd(SScript *script, char *rest) {
return true; return true;
} }
} }
#endif

View File

@ -501,6 +501,7 @@ bool simParseEndwCmd(char *rest, SCommand *pCmd, int32_t lineNum) {
return true; return true;
} }
#if 0
bool simParseSwitchCmd(char *rest, SCommand *pCmd, int32_t lineNum) { bool simParseSwitchCmd(char *rest, SCommand *pCmd, int32_t lineNum) {
char *token; char *token;
int32_t tokenLen; int32_t tokenLen;
@ -647,6 +648,7 @@ bool simParseContinueCmd(char *rest, SCommand *pCmd, int32_t lineNum) {
numOfLines++; numOfLines++;
return true; return true;
} }
#endif
bool simParsePrintCmd(char *rest, SCommand *pCmd, int32_t lineNum) { bool simParsePrintCmd(char *rest, SCommand *pCmd, int32_t lineNum) {
int32_t expLen; int32_t expLen;
@ -715,6 +717,7 @@ bool simParseSqlErrorCmd(char *rest, SCommand *pCmd, int32_t lineNum) {
return true; return true;
} }
#if 0
bool simParseSqlSlowCmd(char *rest, SCommand *pCmd, int32_t lineNum) { bool simParseSqlSlowCmd(char *rest, SCommand *pCmd, int32_t lineNum) {
simParseSqlCmd(rest, pCmd, lineNum); simParseSqlCmd(rest, pCmd, lineNum);
cmdLine[numOfLines - 1].cmdno = SIM_CMD_SQL_SLOW; cmdLine[numOfLines - 1].cmdno = SIM_CMD_SQL_SLOW;
@ -726,6 +729,7 @@ bool simParseRestfulCmd(char *rest, SCommand *pCmd, int32_t lineNum) {
cmdLine[numOfLines - 1].cmdno = SIM_CMD_RESTFUL; cmdLine[numOfLines - 1].cmdno = SIM_CMD_RESTFUL;
return true; return true;
} }
#endif
bool simParseSystemCmd(char *rest, SCommand *pCmd, int32_t lineNum) { bool simParseSystemCmd(char *rest, SCommand *pCmd, int32_t lineNum) {
int32_t expLen; int32_t expLen;
@ -838,6 +842,7 @@ bool simParseRunBackCmd(char *rest, SCommand *pCmd, int32_t lineNum) {
return true; return true;
} }
#if 0
bool simParseLineInsertCmd(char *rest, SCommand *pCmd, int32_t lineNum) { bool simParseLineInsertCmd(char *rest, SCommand *pCmd, int32_t lineNum) {
int32_t expLen; int32_t expLen;
@ -869,6 +874,7 @@ bool simParseLineInsertErrorCmd(char *rest, SCommand *pCmd, int32_t lineNum) {
numOfLines++; numOfLines++;
return true; return true;
} }
#endif
void simInitsimCmdList() { void simInitsimCmdList() {
int32_t cmdno; int32_t cmdno;
@ -930,6 +936,7 @@ void simInitsimCmdList() {
simCmdList[cmdno].executeCmd = NULL; simCmdList[cmdno].executeCmd = NULL;
simAddCmdIntoHash(&(simCmdList[cmdno])); simAddCmdIntoHash(&(simCmdList[cmdno]));
#if 0
cmdno = SIM_CMD_SWITCH; cmdno = SIM_CMD_SWITCH;
simCmdList[cmdno].cmdno = cmdno; simCmdList[cmdno].cmdno = cmdno;
strcpy(simCmdList[cmdno].name, "switch"); strcpy(simCmdList[cmdno].name, "switch");
@ -977,6 +984,7 @@ void simInitsimCmdList() {
simCmdList[cmdno].parseCmd = simParseEndsCmd; simCmdList[cmdno].parseCmd = simParseEndsCmd;
simCmdList[cmdno].executeCmd = NULL; simCmdList[cmdno].executeCmd = NULL;
simAddCmdIntoHash(&(simCmdList[cmdno])); simAddCmdIntoHash(&(simCmdList[cmdno]));
#endif
cmdno = SIM_CMD_SLEEP; cmdno = SIM_CMD_SLEEP;
simCmdList[cmdno].cmdno = cmdno; simCmdList[cmdno].cmdno = cmdno;
@ -1050,6 +1058,7 @@ void simInitsimCmdList() {
simCmdList[cmdno].executeCmd = simExecuteSqlErrorCmd; simCmdList[cmdno].executeCmd = simExecuteSqlErrorCmd;
simAddCmdIntoHash(&(simCmdList[cmdno])); simAddCmdIntoHash(&(simCmdList[cmdno]));
#if 0
cmdno = SIM_CMD_SQL_SLOW; cmdno = SIM_CMD_SQL_SLOW;
simCmdList[cmdno].cmdno = cmdno; simCmdList[cmdno].cmdno = cmdno;
strcpy(simCmdList[cmdno].name, "sql_slow"); strcpy(simCmdList[cmdno].name, "sql_slow");
@ -1065,6 +1074,7 @@ void simInitsimCmdList() {
simCmdList[cmdno].parseCmd = simParseRestfulCmd; simCmdList[cmdno].parseCmd = simParseRestfulCmd;
simCmdList[cmdno].executeCmd = simExecuteRestfulCmd; simCmdList[cmdno].executeCmd = simExecuteRestfulCmd;
simAddCmdIntoHash(&(simCmdList[cmdno])); simAddCmdIntoHash(&(simCmdList[cmdno]));
#endif
/* test is only an internal command */ /* test is only an internal command */
cmdno = SIM_CMD_TEST; cmdno = SIM_CMD_TEST;
@ -1082,6 +1092,7 @@ void simInitsimCmdList() {
simCmdList[cmdno].executeCmd = simExecuteReturnCmd; simCmdList[cmdno].executeCmd = simExecuteReturnCmd;
simAddCmdIntoHash(&(simCmdList[cmdno])); simAddCmdIntoHash(&(simCmdList[cmdno]));
#if 0
cmdno = SIM_CMD_LINE_INSERT; cmdno = SIM_CMD_LINE_INSERT;
simCmdList[cmdno].cmdno = cmdno; simCmdList[cmdno].cmdno = cmdno;
strcpy(simCmdList[cmdno].name, "line_insert"); strcpy(simCmdList[cmdno].name, "line_insert");
@ -1097,4 +1108,5 @@ void simInitsimCmdList() {
simCmdList[cmdno].parseCmd = simParseLineInsertErrorCmd; simCmdList[cmdno].parseCmd = simParseLineInsertErrorCmd;
simCmdList[cmdno].executeCmd = simExecuteLineInsertErrorCmd; simCmdList[cmdno].executeCmd = simExecuteLineInsertErrorCmd;
simAddCmdIntoHash(&(simCmdList[cmdno])); simAddCmdIntoHash(&(simCmdList[cmdno]));
#endif
} }