Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
213591f0
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22017
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
213591f0
编写于
9月 19, 2022
作者:
A
Alex Duan
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'feat/TD-17777-V30' into 3.0
上级
1490b114
92d3c4f3
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
61 addition
and
14 deletion
+61
-14
tools/shell/src/shellAuto.c
tools/shell/src/shellAuto.c
+60
-14
tools/shell/src/shellEngine.c
tools/shell/src/shellEngine.c
+1
-0
未找到文件。
tools/shell/src/shellAuto.c
浏览文件 @
213591f0
...
...
@@ -58,7 +58,7 @@ typedef struct {
SWords
shellCommands
[]
=
{
{
"alter database <db_name> <
db_options> <anyword> <db_options> <anyword> <db_options> <anyword> <db_options> <anyword> <db_options> <anyword> <
db_options> <anyword>"
,
0
,
0
,
NULL
},
{
"alter database <db_name> <
alter_db_options> <anyword> <alter_db_options> <anyword> <alter_db_options> <anyword> <alter_db_options> <anyword> <alter_
db_options> <anyword>"
,
0
,
0
,
NULL
},
{
"alter dnode <dnode_id> balance "
,
0
,
0
,
NULL
},
{
"alter dnode <dnode_id> resetlog;"
,
0
,
0
,
NULL
},
{
"alter dnode <dnode_id> debugFlag 141;"
,
0
,
0
,
NULL
},
...
...
@@ -76,7 +76,7 @@ SWords shellCommands[] = {
{
"alter user <user_name> privilege read"
,
0
,
0
,
NULL
},
{
"alter user <user_name> privilege write"
,
0
,
0
,
NULL
},
{
"create table <anyword> using <stb_name> tags("
,
0
,
0
,
NULL
},
{
"create database "
,
0
,
0
,
NULL
},
{
"create database
<anyword> <db_options> <anyword> <db_options> <anyword> <db_options> <anyword> <db_options> <anyword> <db_options> <anyword> <db_options> <anyword> <db_options> <anyword> <db_options> <anyword> <db_options> <anyword> <db_options> <anyword>
"
,
0
,
0
,
NULL
},
{
"create table <anyword> as "
,
0
,
0
,
NULL
},
{
"create dnode "
,
0
,
0
,
NULL
},
{
"create topic"
,
0
,
0
,
NULL
},
...
...
@@ -84,9 +84,7 @@ SWords shellCommands[] = {
{
"create user <anyword> pass"
,
0
,
0
,
NULL
},
{
"compact vnode in"
,
0
,
0
,
NULL
},
{
"describe <all_table>"
,
0
,
0
,
NULL
},
#ifdef TD_ENTERPRISE
{
"delete from <all_table> where"
,
0
,
0
,
NULL
},
#endif
{
"drop database <db_name>"
,
0
,
0
,
NULL
},
{
"drop table <all_table> "
,
0
,
0
,
NULL
},
{
"drop dnode <dnode_id>"
,
0
,
0
,
NULL
},
...
...
@@ -223,24 +221,69 @@ char * tb_actions[] = {
};
char
*
db_options
[]
=
{
"blocks"
,
"cachelast"
,
"comp"
,
"keep"
,
"replica"
,
"quorum"
,
"keep 3650"
,
"replica 1"
,
"replica 3"
,
"precision
\'
ms
\'
"
,
"precision
\'
us
\'
"
,
"precision
\'
ns
\'
"
,
"strict
\'
off
\'
"
,
"strict
\'
on
\'
"
,
"buffer "
,
"cachemodel
\'
none
\'
"
,
"cachemodel
\'
last_row
\'
"
,
"cachemodel
\'
last_value
\'
"
,
"cachemodel
\'
both
\'
"
,
"cachesize 1 "
,
"comp 0 "
,
"comp 1 "
,
"comp 2 "
,
"duration "
,
"wal_fsync_period 3000"
,
"maxrows 4096"
,
"minrows 100"
,
"pages 256"
,
"pagesize 4"
,
"retentions"
,
"wal_level 1"
,
"wal_level 2"
,
"vgroups"
,
"single_stable 0"
,
"single_stable 1"
,
"wal_retention_period"
,
"wal_roll_period"
,
"wal_retention_size"
,
"wal_segment_size"
};
char
*
alter_db_options
[]
=
{
"keep 3650"
,
"cachemodel
\'
none
\'
"
,
"cachemodel
\'
last_row
\'
"
,
"cachemodel
\'
last_value
\'
"
,
"cachemodel
\'
both
\'
"
,
"cachesize 1"
,
"wal_fsync_period 3000"
,
"wal_level 1"
,
"wal_level 2"
};
char
*
data_types
[]
=
{
"timestamp"
,
"int"
,
"int unsigned"
,
"varchar(16)"
,
"float"
,
"double"
,
"binary(16)"
,
"nchar(16)"
,
"bigint"
,
"bigint unsigned"
,
"smallint"
,
"smallint unsigned"
,
"tinyint"
,
"tinyint unsigned"
,
"bool"
,
"json"
};
...
...
@@ -273,10 +316,11 @@ bool waitAutoFill = false;
#define WT_VAR_KEYWORD 7
#define WT_VAR_TBACTION 8
#define WT_VAR_DBOPTION 9
#define WT_VAR_DATATYPE 10
#define WT_VAR_KEYTAGS 11
#define WT_VAR_ANYWORD 12
#define WT_VAR_CNT 13
#define WT_VAR_ALTER_DBOPTION 10
#define WT_VAR_DATATYPE 11
#define WT_VAR_KEYTAGS 12
#define WT_VAR_ANYWORD 13
#define WT_VAR_CNT 14
#define WT_FROM_DB_MAX 4 // max get content from db
#define WT_FROM_DB_CNT (WT_FROM_DB_MAX + 1)
...
...
@@ -301,6 +345,7 @@ char varTypes[WT_VAR_CNT][64] = {
"<keyword>"
,
"<tb_actions>"
,
"<db_options>"
,
"<alter_db_options>"
,
"<data_types>"
,
"<key_tags>"
,
"<anyword>"
...
...
@@ -579,6 +624,7 @@ bool shellAutoInit() {
GenerateVarType
(
WT_VAR_FUNC
,
functions
,
sizeof
(
functions
)
/
sizeof
(
char
*
));
GenerateVarType
(
WT_VAR_KEYWORD
,
keywords
,
sizeof
(
keywords
)
/
sizeof
(
char
*
));
GenerateVarType
(
WT_VAR_DBOPTION
,
db_options
,
sizeof
(
db_options
)
/
sizeof
(
char
*
));
GenerateVarType
(
WT_VAR_ALTER_DBOPTION
,
alter_db_options
,
sizeof
(
alter_db_options
)
/
sizeof
(
char
*
));
GenerateVarType
(
WT_VAR_TBACTION
,
tb_actions
,
sizeof
(
tb_actions
)
/
sizeof
(
char
*
));
GenerateVarType
(
WT_VAR_DATATYPE
,
data_types
,
sizeof
(
data_types
)
/
sizeof
(
char
*
));
GenerateVarType
(
WT_VAR_KEYTAGS
,
key_tags
,
sizeof
(
key_tags
)
/
sizeof
(
char
*
));
...
...
tools/shell/src/shellEngine.c
浏览文件 @
213591f0
...
...
@@ -1060,6 +1060,7 @@ int32_t shellExecute() {
}
#endif
shellSetConn
(
shell
.
conn
);
shellReadHistory
();
if
(
pArgs
->
commands
!=
NULL
||
pArgs
->
file
[
0
]
!=
0
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录