Merge pull request #5678 from taosdata/feature/qrefactor
Feature/qrefactor
This commit is contained in:
commit
4f6fa025d3
|
@ -1159,9 +1159,10 @@ static void fillMultiRowsOfTagsVal(SQueryInfo *pQueryInfo, int32_t numOfRes, SLo
|
|||
memset(buf, 0, (size_t)maxBufSize);
|
||||
memcpy(buf, pCtx->pOutput, (size_t)pCtx->outputBytes);
|
||||
|
||||
char* next = pCtx->pOutput;
|
||||
for (int32_t i = 0; i < inc; ++i) {
|
||||
pCtx->pOutput += pCtx->outputBytes;
|
||||
memcpy(pCtx->pOutput, buf, (size_t)pCtx->outputBytes);
|
||||
next += pCtx->outputBytes;
|
||||
memcpy(next, buf, (size_t)pCtx->outputBytes);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -159,8 +159,9 @@ if $data03 != @abc15@ then
|
|||
return -1
|
||||
endi
|
||||
|
||||
#sql select top(c6, 3) from select_tags_mt0 interval(10a)
|
||||
#sql select top(c6, 3) from select_tags_mt0 interval(10a) group by tbname;
|
||||
sql select top(c6, 3) from select_tags_mt0 interval(10a)
|
||||
sql select top(c3,10) from select_tags_mt0 interval(10a) group by tbname
|
||||
sql select top(c6, 3) from select_tags_mt0 interval(10a) group by tbname;
|
||||
|
||||
sql select top(c6, 10) from select_tags_mt0 interval(10a);
|
||||
if $rows != 12800 then
|
||||
|
|
|
@ -149,6 +149,7 @@ extern int32_t simScriptSucced;
|
|||
extern int32_t simDebugFlag;
|
||||
extern char tsScriptDir[];
|
||||
extern bool simAsyncQuery;
|
||||
extern bool abortExecution;
|
||||
|
||||
SScript *simParseScript(char *fileName);
|
||||
SScript *simProcessCallOver(SScript *script);
|
||||
|
|
|
@ -645,8 +645,12 @@ bool simCreateRestFulConnect(SScript *script, char *user, char *pass) {
|
|||
bool simCreateNativeConnect(SScript *script, char *user, char *pass) {
|
||||
simCloseTaosdConnect(script);
|
||||
void *taos = NULL;
|
||||
taosMsleep(2000);
|
||||
for (int32_t attempt = 0; attempt < 10; ++attempt) {
|
||||
if (abortExecution) {
|
||||
script->killed = true;
|
||||
return false;
|
||||
}
|
||||
|
||||
taos = taos_connect(NULL, user, pass, NULL, tsDnodeShellPort);
|
||||
if (taos == NULL) {
|
||||
simDebug("script:%s, user:%s connect taosd failed:%s, attempt:%d", script->fileName, user, taos_errstr(NULL),
|
||||
|
@ -697,6 +701,11 @@ bool simExecuteNativeSqlCommand(SScript *script, char *rest, bool isSlow) {
|
|||
TAOS_RES *pSql = NULL;
|
||||
|
||||
for (int32_t attempt = 0; attempt < 10; ++attempt) {
|
||||
if (abortExecution) {
|
||||
script->killed = true;
|
||||
return false;
|
||||
}
|
||||
|
||||
simLogSql(rest, false);
|
||||
pSql = taos_query(script->taos, rest);
|
||||
ret = taos_errno(pSql);
|
||||
|
|
|
@ -21,10 +21,13 @@
|
|||
|
||||
bool simAsyncQuery = false;
|
||||
bool simExecSuccess = false;
|
||||
bool abortExecution = false;
|
||||
|
||||
void simHandleSignal(int32_t signo, void *sigInfo, void *context) {
|
||||
simSystemCleanUp();
|
||||
exit(1);
|
||||
abortExecution = true;
|
||||
// runningScript->killed = true;
|
||||
// exit(1);
|
||||
}
|
||||
|
||||
int32_t main(int32_t argc, char *argv[]) {
|
||||
|
@ -60,6 +63,11 @@ int32_t main(int32_t argc, char *argv[]) {
|
|||
return -1;
|
||||
}
|
||||
|
||||
if (abortExecution) {
|
||||
simError("execute abort");
|
||||
return -1;
|
||||
}
|
||||
|
||||
simScriptList[++simScriptPos] = script;
|
||||
simExecuteScript(script);
|
||||
|
||||
|
|
|
@ -159,9 +159,17 @@ void *simExecuteScript(void *inputScript) {
|
|||
script = simScriptList[simScriptPos];
|
||||
}
|
||||
|
||||
if (abortExecution) {
|
||||
script->killed = true;
|
||||
}
|
||||
|
||||
if (script->killed || script->linePos >= script->numOfLines) {
|
||||
printf("killed ---------------------->\n");
|
||||
script = simProcessCallOver(script);
|
||||
if (script == NULL) break;
|
||||
if (script == NULL) {
|
||||
printf("abort now!\n");
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
SCmdLine *line = &script->lines[script->linePos];
|
||||
char * option = script->optionBuffer + line->optionOffset;
|
||||
|
|
Loading…
Reference in New Issue