From c501c81266deede6ec81c95eb622d0f45180fc25 Mon Sep 17 00:00:00 2001 From: Alex Duan <417921451@qq.com> Date: Sat, 11 Feb 2023 17:19:21 +0800 Subject: [PATCH 01/13] modify format and remove no use delete --- tools/shell/src/shellAuto.c | 84 +++++++++++++++++++------------------ 1 file changed, 43 insertions(+), 41 deletions(-) diff --git a/tools/shell/src/shellAuto.c b/tools/shell/src/shellAuto.c index b391d59725..dbd378f718 100644 --- a/tools/shell/src/shellAuto.c +++ b/tools/shell/src/shellAuto.c @@ -60,23 +60,23 @@ SWords shellCommands[] = { {"alter database " " ;", 0, 0, NULL}, - {"alter dnode balance ", 0, 0, NULL}, - {"alter dnode resetlog;", 0, 0, NULL}, - {"alter dnode debugFlag 141;", 0, 0, NULL}, - {"alter dnode monitor 1;", 0, 0, NULL}, - {"alter all dnodes monitor ", 0, 0, NULL}, - {"alter alldnodes balance ", 0, 0, NULL}, - {"alter alldnodes resetlog;", 0, 0, NULL}, - {"alter alldnodes debugFlag 141;", 0, 0, NULL}, - {"alter alldnodes monitor 1;", 0, 0, NULL}, + {"alter dnode \"resetlog\";", 0, 0, NULL}, + {"alter dnode \"debugFlag\" \"141\";", 0, 0, NULL}, + {"alter dnode \"monitor\" \"0\";", 0, 0, NULL}, + {"alter dnode \"monitor\" \"1\";", 0, 0, NULL}, + {"alter all dnodes \"monitor\" ", 0, 0, NULL}, + {"alter all dnodes \"balance\" ", 0, 0, NULL}, + {"alter all dnodes \"resetlog\";", 0, 0, NULL}, + {"alter all dnodes \"debugFlag\" \"141\";", 0, 0, NULL}, + {"alter all dnodes \"monitor\" \"1\";", 0, 0, NULL}, {"alter table ;", 0, 0, NULL}, {"alter table modify column", 0, 0, NULL}, - {"alter local resetlog;", 0, 0, NULL}, - {"alter local DebugFlag 143;", 0, 0, NULL}, - {"alter local cDebugFlag 143;", 0, 0, NULL}, - {"alter local uDebugFlag 143;", 0, 0, NULL}, - {"alter local rpcDebugFlag 143;", 0, 0, NULL}, - {"alter local tmrDebugFlag 143;", 0, 0, NULL}, + {"alter local \"resetlog\";", 0, 0, NULL}, + {"alter local \"DebugFlag\" \"143\";", 0, 0, NULL}, + {"alter local \"cDebugFlag\" \"143\";", 0, 0, NULL}, + {"alter local \"uDebugFlag\" \"143\";", 0, 0, NULL}, + {"alter local \"rpcDebugFlag\" \"143\";", 0, 0, NULL}, + {"alter local \"tmrDebugFlag\" \"143\";", 0, 0, NULL}, {"alter topic", 0, 0, NULL}, {"alter user ;", 0, 0, NULL}, // 20 @@ -108,6 +108,7 @@ SWords shellCommands[] = { {"drop topic ;", 0, 0, NULL}, {"drop stream ;", 0, 0, NULL}, {"explain select", 0, 0, NULL}, // 44 append sub sql + {"flush database ;", 0, 0, NULL}, {"help;", 0, 0, NULL}, {"grant all on to ;", 0, 0, NULL}, {"grant read on to ;", 0, 0, NULL}, @@ -121,7 +122,6 @@ SWords shellCommands[] = { {"revoke read on from ;", 0, 0, NULL}, {"revoke write on from ;", 0, 0, NULL}, {"select * from ", 0, 0, NULL}, - {"select _block_dist() from \\G;", 0, 0, NULL}, {"select client_version();", 0, 0, NULL}, // 60 {"select current_user();", 0, 0, NULL}, @@ -247,7 +247,7 @@ char* db_options[] = {"keep ", "wal_retention_size ", "wal_segment_size "}; -char* alter_db_options[] = {"keep ", "cachemodel ", "cachesize ", "wal_fsync_period ", "wal_level "}; +char* alter_db_options[] = {"cachemodel ", "replica ", "keep ", "cachesize ", "wal_fsync_period ", "wal_level "}; char* data_types[] = {"timestamp", "int", "int unsigned", "varchar(16)", @@ -327,19 +327,19 @@ int cntDel = 0; // delete byte count after next press tab // show auto tab introduction void printfIntroduction() { - printf(" ****************************** Tab Completion **********************************\n"); - printf(" * The TDengine CLI supports tab completion for a variety of items, *\n"); - printf(" * including database names, table names, function names and keywords. *\n"); - printf(" * The full list of shortcut keys is as follows: *\n"); - printf(" * [ TAB ] ...... complete the current word *\n"); - printf(" * ...... if used on a blank line, display all valid commands *\n"); - printf(" * [ Ctrl + A ] ...... move cursor to the st[A]rt of the line *\n"); - printf(" * [ Ctrl + E ] ...... move cursor to the [E]nd of the line *\n"); - printf(" * [ Ctrl + W ] ...... move cursor to the middle of the line *\n"); - printf(" * [ Ctrl + L ] ...... clear the entire screen *\n"); - printf(" * [ Ctrl + K ] ...... clear the screen after the cursor *\n"); - printf(" * [ Ctrl + U ] ...... clear the screen before the cursor *\n"); - printf(" **********************************************************************************\n\n"); + printf(" ****************************** Tab Completion *************************************\n"); + printf(" * The TDengine CLI supports tab completion for a variety of items, *\n"); + printf(" * including database names, table names, function names and keywords. *\n"); + printf(" * The full list of shortcut keys is as follows: *\n"); + printf(" * [ TAB ] ...... complete the current word *\n"); + printf(" * ...... if used on a blank line, display all supported commands *\n"); + printf(" * [ Ctrl + A ] ...... move cursor to the st[A]rt of the line *\n"); + printf(" * [ Ctrl + E ] ...... move cursor to the [E]nd of the line *\n"); + printf(" * [ Ctrl + W ] ...... move cursor to the middle of the line *\n"); + printf(" * [ Ctrl + L ] ...... clear the entire screen *\n"); + printf(" * [ Ctrl + K ] ...... clear the screen after the cursor *\n"); + printf(" * [ Ctrl + U ] ...... clear the screen before the cursor *\n"); + printf(" *************************************************************************************\n\n"); } void showHelp() { @@ -348,23 +348,24 @@ void showHelp() { "\n\ ----- A ----- \n\ alter database \n\ - alter dnode balance \n\ - alter dnode resetlog;\n\ - alter all dnodes monitor \n\ - alter alldnodes balance \n\ - alter alldnodes resetlog;\n\ - alter alldnodes debugFlag \n\ - alter alldnodes monitor \n\ + alter dnode \"resetlog\";\n\ + alter dnode \"monitor\" \"0\";\n\ + alter dnode \"monitor\" \"1\";\n\ + alter dnode \"debugflag\" \"143\";\n\ + alter all dnodes \"monitor\" \"0\";\n\ + alter all dnodes \"monitor\" \"1\";\n\ + alter all dnodes \"resetlog\";\n\ + alter all dnodes \"debugFlag\" \n\ alter table ;\n\ alter table modify column\n\ - alter local resetlog;\n\ - alter local DebugFlag 143;\n\ + alter local \"resetlog\";\n\ + alter local \"DebugFlag\" \"143\";\n\ alter topic\n\ alter user ...\n\ ----- C ----- \n\ create table using tags ...\n\ create database ...\n\ - create dnode ...\n\ + create dnode \"fqdn:port\"n\ create index ...\n\ create mnode on dnode ;\n\ create qnode on dnode ;\n\ @@ -387,6 +388,8 @@ void showHelp() { drop stream ;\n\ ----- E ----- \n\ explain select clause ...\n\ + ----- F ----- \n\ + flush database ; ----- H ----- \n\ help;\n\ ----- I ----- \n\ @@ -409,7 +412,6 @@ void showHelp() { revoke write on from ;\n\ ----- S ----- \n\ select * from where ... \n\ - select _block_dist() from ;\n\ select client_version();\n\ select current_user();\n\ select database();\n\ From 503b03d661247e21296968d94091ef3cfc2ef385 Mon Sep 17 00:00:00 2001 From: Alex Duan <417921451@qq.com> Date: Sat, 11 Feb 2023 18:29:49 +0800 Subject: [PATCH 02/13] fix: build error --- tools/shell/src/shellAuto.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/shell/src/shellAuto.c b/tools/shell/src/shellAuto.c index dbd378f718..2817ae2324 100644 --- a/tools/shell/src/shellAuto.c +++ b/tools/shell/src/shellAuto.c @@ -348,9 +348,9 @@ void showHelp() { "\n\ ----- A ----- \n\ alter database \n\ - alter dnode \"resetlog\";\n\ - alter dnode \"monitor\" \"0\";\n\ - alter dnode \"monitor\" \"1\";\n\ + alter dnode 'resetlog';\n\ + alter dnode 'monitor' '0';\n\ + alter dnode 'monitor' \"1\";\n\ alter dnode \"debugflag\" \"143\";\n\ alter all dnodes \"monitor\" \"0\";\n\ alter all dnodes \"monitor\" \"1\";\n\ @@ -389,7 +389,7 @@ void showHelp() { ----- E ----- \n\ explain select clause ...\n\ ----- F ----- \n\ - flush database ; + flush database ;\n\ ----- H ----- \n\ help;\n\ ----- I ----- \n\ From f5c2c6858bb5fae0fef394e89f4ca2f060635c91 Mon Sep 17 00:00:00 2001 From: Alex Duan <417921451@qq.com> Date: Sat, 11 Feb 2023 18:33:45 +0800 Subject: [PATCH 03/13] remove alter balance cmd --- tools/shell/src/shellAuto.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tools/shell/src/shellAuto.c b/tools/shell/src/shellAuto.c index 2817ae2324..0c8c801ae7 100644 --- a/tools/shell/src/shellAuto.c +++ b/tools/shell/src/shellAuto.c @@ -64,10 +64,9 @@ SWords shellCommands[] = { {"alter dnode \"debugFlag\" \"141\";", 0, 0, NULL}, {"alter dnode \"monitor\" \"0\";", 0, 0, NULL}, {"alter dnode \"monitor\" \"1\";", 0, 0, NULL}, - {"alter all dnodes \"monitor\" ", 0, 0, NULL}, - {"alter all dnodes \"balance\" ", 0, 0, NULL}, {"alter all dnodes \"resetlog\";", 0, 0, NULL}, {"alter all dnodes \"debugFlag\" \"141\";", 0, 0, NULL}, + {"alter all dnodes \"monitor\" \"0\";", 0, 0, NULL}, {"alter all dnodes \"monitor\" \"1\";", 0, 0, NULL}, {"alter table ;", 0, 0, NULL}, {"alter table modify column", 0, 0, NULL}, From c13b0e68d9aa648c2304226a44e5b4062effbfe5 Mon Sep 17 00:00:00 2001 From: Alex Duan <417921451@qq.com> Date: Sat, 11 Feb 2023 22:19:45 +0800 Subject: [PATCH 04/13] feat: auto fill database name and sys table name --- tools/shell/src/shellAuto.c | 43 ++++++++++++++++++++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-) diff --git a/tools/shell/src/shellAuto.c b/tools/shell/src/shellAuto.c index 0c8c801ae7..d6538ddf57 100644 --- a/tools/shell/src/shellAuto.c +++ b/tools/shell/src/shellAuto.c @@ -261,6 +261,12 @@ char* key_tags[] = {"tags("}; char* key_select[] = {"select "}; +char* key_systable[] = { + "ins_dnodes", "ins_mnodes", "ins_modules", "ins_qnodes", "ins_snodes", "ins_cluster", + "ins_databases", "ins_functions", "ins_indexes", "ins_stables", "ins_tables", "ins_tags", + "ins_users", "ins_grants", "ins_vgroups", "ins_configs", "ins_dnode_variables", "ins_topics", + "ins_subscriptions", "ins_streams", "ins_stream_tasks", "ins_vnodes", "ins_user_privileges"}; + // // ------- gobal variant define --------- // @@ -292,8 +298,9 @@ bool waitAutoFill = false; #define WT_VAR_TBOPTION 16 #define WT_VAR_USERACTION 17 #define WT_VAR_KEYSELECT 18 +#define WT_VAR_SYSTABLE 19 -#define WT_VAR_CNT 19 +#define WT_VAR_CNT 20 #define WT_FROM_DB_MAX 6 // max get content from db #define WT_FROM_DB_CNT (WT_FROM_DB_MAX + 1) @@ -609,6 +616,10 @@ bool shellAutoInit() { // threads memset(threads, 0, sizeof(TdThread*) * WT_FROM_DB_CNT); + // init database and stable + tireSearchWord(WT_VAR_DBNAME, ""); + tireSearchWord(WT_VAR_STABLE, ""); + // generate varType GenerateVarType(WT_VAR_FUNC, functions, sizeof(functions) / sizeof(char*)); GenerateVarType(WT_VAR_KEYWORD, keywords, sizeof(keywords) / sizeof(char*)); @@ -620,6 +631,7 @@ bool shellAutoInit() { GenerateVarType(WT_VAR_TBOPTION, tb_options, sizeof(tb_options) / sizeof(char*)); GenerateVarType(WT_VAR_USERACTION, user_actions, sizeof(user_actions) / sizeof(char*)); GenerateVarType(WT_VAR_KEYSELECT, key_select, sizeof(key_select) / sizeof(char*)); + GenerateVarType(WT_VAR_SYSTABLE, key_systable, sizeof(key_systable) / sizeof(char*)); return true; } @@ -1661,6 +1673,32 @@ bool matchOther(TAOS* con, SShellCmd* cmd) { return false; } +// last match if nothing matched +bool matchEnd(TAOS* con, SShellCmd* cmd) { + // str dump + bool ret = false; + char* ps = strndup(cmd->command, cmd->commandSize); + char* last = lastWord(ps); + if(strlen(last) < 2 ) { + goto _return; + } + + // match database + if (fillWithType(con, last, WT_VAR_DBNAME)) { + ret = true + goto _return; + } + + if (fillWithType(con, last, WT_VAR_SYSTABLE)) { + ret = true + goto _return; + } + +_return: + taosMemoryFree(ps); + return ret; +} + // main key press tab void pressTabKey(SShellCmd* cmd) { // check @@ -1696,6 +1734,9 @@ void pressTabKey(SShellCmd* cmd) { matched = matchSelectQuery(varCon, cmd); if (matched) return; + // match end + matched = matchEnd(varCon, cmd); + return; } From af14254639f5e74c73fc626c1ee51848c008754b Mon Sep 17 00:00:00 2001 From: Alex Duan <417921451@qq.com> Date: Sat, 11 Feb 2023 22:22:17 +0800 Subject: [PATCH 05/13] feat: auto fill database name and sys table name1 --- tools/shell/src/shellAuto.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/shell/src/shellAuto.c b/tools/shell/src/shellAuto.c index d6538ddf57..f1b6c47881 100644 --- a/tools/shell/src/shellAuto.c +++ b/tools/shell/src/shellAuto.c @@ -1685,12 +1685,12 @@ bool matchEnd(TAOS* con, SShellCmd* cmd) { // match database if (fillWithType(con, last, WT_VAR_DBNAME)) { - ret = true + ret = true; goto _return; } if (fillWithType(con, last, WT_VAR_SYSTABLE)) { - ret = true + ret = true; goto _return; } From adfdb0967cb70928c27bb46b70bf8932316ef1d5 Mon Sep 17 00:00:00 2001 From: Alex Duan <417921451@qq.com> Date: Sat, 11 Feb 2023 22:25:39 +0800 Subject: [PATCH 06/13] feat: auto fill database name and sys table name2 --- tools/shell/src/shellAuto.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/shell/src/shellAuto.c b/tools/shell/src/shellAuto.c index f1b6c47881..7db4a6f11e 100644 --- a/tools/shell/src/shellAuto.c +++ b/tools/shell/src/shellAuto.c @@ -32,6 +32,7 @@ void shellShowOnScreen(SShellCmd* cmd); void shellInsertChar(SShellCmd* cmd, char* c, int size); void shellInsertStr(SShellCmd* cmd, char* str, int size); bool appendAfterSelect(TAOS* con, SShellCmd* cmd, char* p, int32_t len); +char* tireSearchWord(int type, char* pre); typedef struct SAutoPtr { STire* p; @@ -1684,12 +1685,12 @@ bool matchEnd(TAOS* con, SShellCmd* cmd) { } // match database - if (fillWithType(con, last, WT_VAR_DBNAME)) { + if (fillWithType(con, cmd, last, WT_VAR_DBNAME)) { ret = true; goto _return; } - if (fillWithType(con, last, WT_VAR_SYSTABLE)) { + if (fillWithType(con, cmd, last, WT_VAR_SYSTABLE)) { ret = true; goto _return; } From 2fe1ee2aab9a8b3641e9959785a8204445ee5cfc Mon Sep 17 00:00:00 2001 From: Alex Duan <417921451@qq.com> Date: Sat, 11 Feb 2023 22:39:33 +0800 Subject: [PATCH 07/13] feat: get dbname after set conn --- tools/shell/src/shellAuto.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/tools/shell/src/shellAuto.c b/tools/shell/src/shellAuto.c index 7db4a6f11e..4be35255b7 100644 --- a/tools/shell/src/shellAuto.c +++ b/tools/shell/src/shellAuto.c @@ -617,10 +617,6 @@ bool shellAutoInit() { // threads memset(threads, 0, sizeof(TdThread*) * WT_FROM_DB_CNT); - // init database and stable - tireSearchWord(WT_VAR_DBNAME, ""); - tireSearchWord(WT_VAR_STABLE, ""); - // generate varType GenerateVarType(WT_VAR_FUNC, functions, sizeof(functions) / sizeof(char*)); GenerateVarType(WT_VAR_KEYWORD, keywords, sizeof(keywords) / sizeof(char*)); @@ -638,7 +634,12 @@ bool shellAutoInit() { } // set conn -void shellSetConn(TAOS* conn) { varCon = conn; } +void shellSetConn(TAOS* conn) { + varCon = conn; + // init database and stable + tireSearchWord(WT_VAR_DBNAME, ""); + tireSearchWord(WT_VAR_STABLE, ""); +} // exit shell auto funciton, shell exit call once void shellAutoExit() { @@ -817,6 +818,7 @@ void* varObtainThread(void* param) { // only match next one word from all match words, return valuue must free by caller char* matchNextPrefix(STire* tire, char* pre) { SMatch* match = NULL; + if(tire == NULL) return NULL; // re-use last result if (lastMatch) { From 8bde21894fd33f39312fe9ae296e26d3deaaeffa Mon Sep 17 00:00:00 2001 From: Alex Duan <417921451@qq.com> Date: Sat, 11 Feb 2023 22:44:43 +0800 Subject: [PATCH 08/13] feat: get dbname after set conn --- tools/shell/src/shellAuto.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/shell/src/shellAuto.c b/tools/shell/src/shellAuto.c index 4be35255b7..fcf0d247f1 100644 --- a/tools/shell/src/shellAuto.c +++ b/tools/shell/src/shellAuto.c @@ -1132,6 +1132,7 @@ void printScreen(TAOS* con, SShellCmd* cmd, SWords* match) { // main key press tab , matched return true else false bool firstMatchCommand(TAOS* con, SShellCmd* cmd) { + if(con == NULL || cmd == NULL) return false; // parse command SWords* input = (SWords*)taosMemoryMalloc(sizeof(SWords)); memset(input, 0, sizeof(SWords)); From 095a6e0f82bc4dbe34ef4ba52d0737aeeff76c55 Mon Sep 17 00:00:00 2001 From: Alex Duan <417921451@qq.com> Date: Sat, 11 Feb 2023 22:49:17 +0800 Subject: [PATCH 09/13] feat: auto get stable after use db --- tools/shell/src/shellAuto.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/shell/src/shellAuto.c b/tools/shell/src/shellAuto.c index fcf0d247f1..9ea6626e22 100644 --- a/tools/shell/src/shellAuto.c +++ b/tools/shell/src/shellAuto.c @@ -638,7 +638,6 @@ void shellSetConn(TAOS* conn) { varCon = conn; // init database and stable tireSearchWord(WT_VAR_DBNAME, ""); - tireSearchWord(WT_VAR_STABLE, ""); } // exit shell auto funciton, shell exit call once @@ -1957,6 +1956,7 @@ void callbackAutoTab(char* sqlstr, TAOS* pSql, bool usedb) { if (dealUseDB(sql)) { // change to new db + tireSearchWord(WT_VAR_STABLE, ""); return; } From 932dc94f7ed13a7cac45d782f67c0b6a9fcb2e44 Mon Sep 17 00:00:00 2001 From: Alex Duan <417921451@qq.com> Date: Sat, 11 Feb 2023 22:58:18 +0800 Subject: [PATCH 10/13] feat: auto get stable after use db --- tools/shell/src/shellAuto.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/shell/src/shellAuto.c b/tools/shell/src/shellAuto.c index 9ea6626e22..bcb2143b4e 100644 --- a/tools/shell/src/shellAuto.c +++ b/tools/shell/src/shellAuto.c @@ -1682,6 +1682,11 @@ bool matchEnd(TAOS* con, SShellCmd* cmd) { bool ret = false; char* ps = strndup(cmd->command, cmd->commandSize); char* last = lastWord(ps); + char* elast = strrchr(last, '.'); // find end last + if(elast) { + last = elast; + } + if(strlen(last) < 2 ) { goto _return; } From 17b77c44bed13f705ab2214f24608889359af84a Mon Sep 17 00:00:00 2001 From: Alex Duan <417921451@qq.com> Date: Sat, 11 Feb 2023 23:02:11 +0800 Subject: [PATCH 11/13] feat: auto get stable after use db --- tools/shell/src/shellAuto.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/shell/src/shellAuto.c b/tools/shell/src/shellAuto.c index bcb2143b4e..97ed3dfdb9 100644 --- a/tools/shell/src/shellAuto.c +++ b/tools/shell/src/shellAuto.c @@ -1684,7 +1684,7 @@ bool matchEnd(TAOS* con, SShellCmd* cmd) { char* last = lastWord(ps); char* elast = strrchr(last, '.'); // find end last if(elast) { - last = elast; + last = elast + 1; } if(strlen(last) < 2 ) { From 979ca40214384ce2fc0deb3c4317c96eb8c16f76 Mon Sep 17 00:00:00 2001 From: Alex Duan <417921451@qq.com> Date: Sat, 11 Feb 2023 23:09:47 +0800 Subject: [PATCH 12/13] feat: add perf systable name --- tools/shell/src/shellAuto.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tools/shell/src/shellAuto.c b/tools/shell/src/shellAuto.c index 97ed3dfdb9..bf07eebf1d 100644 --- a/tools/shell/src/shellAuto.c +++ b/tools/shell/src/shellAuto.c @@ -263,10 +263,12 @@ char* key_tags[] = {"tags("}; char* key_select[] = {"select "}; char* key_systable[] = { - "ins_dnodes", "ins_mnodes", "ins_modules", "ins_qnodes", "ins_snodes", "ins_cluster", - "ins_databases", "ins_functions", "ins_indexes", "ins_stables", "ins_tables", "ins_tags", - "ins_users", "ins_grants", "ins_vgroups", "ins_configs", "ins_dnode_variables", "ins_topics", - "ins_subscriptions", "ins_streams", "ins_stream_tasks", "ins_vnodes", "ins_user_privileges"}; + "ins_dnodes", "ins_mnodes", "ins_modules", "ins_qnodes", "ins_snodes", "ins_cluster", + "ins_databases", "ins_functions", "ins_indexes", "ins_stables", "ins_tables", "ins_tags", + "ins_users", "ins_grants", "ins_vgroups", "ins_configs", "ins_dnode_variables", "ins_topics", + "ins_subscriptions", "ins_streams", "ins_stream_tasks", "ins_vnodes", "ins_user_privileges", "perf_connections", + "perf_queries", "perf_consumers", "perf_trans", "perf_apps"}; + // // ------- gobal variant define --------- From 494b1f1d8311df693b4cce97af61d90cc3bd451f Mon Sep 17 00:00:00 2001 From: Alex Duan <417921451@qq.com> Date: Sat, 11 Feb 2023 23:19:19 +0800 Subject: [PATCH 13/13] feat: less one char to match --- tools/shell/src/shellAuto.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/shell/src/shellAuto.c b/tools/shell/src/shellAuto.c index bf07eebf1d..ae020576cf 100644 --- a/tools/shell/src/shellAuto.c +++ b/tools/shell/src/shellAuto.c @@ -1689,7 +1689,8 @@ bool matchEnd(TAOS* con, SShellCmd* cmd) { last = elast + 1; } - if(strlen(last) < 2 ) { + // less one char can match + if(strlen(last) == 0 ) { goto _return; }