Merge branch 'szhou/star-tbname' of github.com:taosdata/TDengine into szhou/star-tbname

This commit is contained in:
slzhou 2023-09-22 13:34:26 +08:00
commit 484854b4fa
2 changed files with 6 additions and 0 deletions

View File

@ -162,6 +162,7 @@ typedef struct _script_t {
bool killed;
void *taos;
char rows[12]; // number of rows data retrieved
char cols[12]; // number of columns data retrieved
char data[MAX_QUERY_ROW_NUM][MAX_QUERY_COL_NUM][MAX_QUERY_VALUE_LEN]; // query results
char system_exit_code[12];
char system_ret_content[MAX_SYSTEM_RESULT_LEN];

View File

@ -93,6 +93,8 @@ char *simGetVariable(SScript *script, char *varName, int32_t varLen) {
if (strncmp(varName, "rows", varLen) == 0) return script->rows;
if (strncmp(varName, "cols", varLen) == 0) return script->cols;
if (strncmp(varName, "system_exit", varLen) == 0) return script->system_exit_code;
if (strncmp(varName, "system_content", varLen) == 0) return script->system_ret_content;
@ -828,6 +830,7 @@ bool simExecuteNativeSqlCommand(SScript *script, char *rest, bool isSlow) {
taos_free_result(pSql);
sprintf(script->rows, "%d", numOfRows);
sprintf(script->cols, "%d", num_fields);
script->linePos++;
return true;
@ -842,6 +845,7 @@ bool simExecuteSqlImpCmd(SScript *script, char *rest, bool isSlow) {
simDebug("script:%s, exec:%s", script->fileName, rest);
strcpy(script->rows, "-1");
strcpy(script->cols, "-1");
for (int32_t row = 0; row < MAX_QUERY_ROW_NUM; ++row) {
for (int32_t col = 0; col < MAX_QUERY_COL_NUM; ++col) {
strcpy(script->data[row][col], "null");
@ -938,6 +942,7 @@ bool simExecuteSqlErrorCmd(SScript *script, char *rest) {
simDebug("script:%s, exec:%s", script->fileName, rest);
strcpy(script->rows, "-1");
strcpy(script->cols, "-1");
for (int32_t row = 0; row < MAX_QUERY_ROW_NUM; ++row) {
for (int32_t col = 0; col < MAX_QUERY_COL_NUM; ++col) {
strcpy(script->data[row][col], "null");