Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
3ad184de
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
3ad184de
编写于
9月 29, 2022
作者:
A
Alex Duan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat(shell): modify command with 3.0
上级
213591f0
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
65 addition
and
46 deletion
+65
-46
tools/shell/src/shellAuto.c
tools/shell/src/shellAuto.c
+65
-46
未找到文件。
tools/shell/src/shellAuto.c
浏览文件 @
3ad184de
...
...
@@ -122,6 +122,8 @@ SWords shellCommands[] = {
{
"show vgroups;"
,
0
,
0
,
NULL
},
{
"insert into <tb_name> values("
,
0
,
0
,
NULL
},
{
"insert into <tb_name> using <stb_name> tags("
,
0
,
0
,
NULL
},
{
"insert into <tb_name> file "
,
0
,
0
,
NULL
},
{
"trim database <db_name>"
,
0
,
0
,
NULL
},
{
"use <db_name>"
,
0
,
0
,
NULL
},
{
"quit"
,
0
,
0
,
NULL
}
};
...
...
@@ -214,58 +216,60 @@ char * functions[] = {
};
char
*
tb_actions
[]
=
{
"add column"
,
"modify column"
,
"drop column"
,
"change tag"
,
"add column "
,
"modify column "
,
"drop column "
,
"rename column "
,
"add tag "
,
"modify tag "
,
"drop tag "
,
"rename tag "
,
"set tag "
,
};
char
*
tb_options
[]
=
{
"comment "
,
"watermark "
,
"max_delay "
,
"ttl "
,
"rollup("
,
"sma("
};
char
*
db_options
[]
=
{
"keep 3650"
,
"replica 1"
,
"replica 3"
,
"precision
\'
ms
\'
"
,
"precision
\'
us
\'
"
,
"precision
\'
ns
\'
"
,
"strict
\'
off
\'
"
,
"strict
\'
on
\'
"
,
"keep "
,
"replica "
,
"replica "
,
"precision "
,
"strict "
,
"strict "
,
"buffer "
,
"cachemodel
\'
none
\'
"
,
"cachemodel
\'
last_row
\'
"
,
"cachemodel
\'
last_value
\'
"
,
"cachemodel
\'
both
\'
"
,
"cachesize 1 "
,
"comp 0 "
,
"comp 1 "
,
"comp 2 "
,
"cachemodel "
,
"cachesize "
,
"comp "
,
"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"
"wal_fsync_period"
,
"maxrows "
,
"minrows "
,
"pages "
,
"pagesize "
,
"retentions "
,
"wal_level "
,
"wal_level "
,
"vgroups "
,
"single_stable "
,
"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"
"keep "
,
"cachemodel "
,
"cachesize "
,
"wal_fsync_period "
,
"wal_level "
};
...
...
@@ -320,7 +324,8 @@ bool waitAutoFill = false;
#define WT_VAR_DATATYPE 11
#define WT_VAR_KEYTAGS 12
#define WT_VAR_ANYWORD 13
#define WT_VAR_CNT 14
#define WT_VAR_TBOPTION 14
#define WT_VAR_CNT 15
#define WT_FROM_DB_MAX 4 // max get content from db
#define WT_FROM_DB_CNT (WT_FROM_DB_MAX + 1)
...
...
@@ -348,7 +353,8 @@ char varTypes[WT_VAR_CNT][64] = {
"<alter_db_options>"
,
"<data_types>"
,
"<key_tags>"
,
"<anyword>"
"<anyword>"
,
"<tb_options>"
};
char
varSqls
[
WT_FROM_DB_CNT
][
64
]
=
{
...
...
@@ -628,6 +634,7 @@ bool shellAutoInit() {
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
*
));
GenerateVarType
(
WT_VAR_TBOPTION
,
tb_options
,
sizeof
(
tb_options
)
/
sizeof
(
char
*
));
return
true
;
}
...
...
@@ -1523,6 +1530,18 @@ bool matchCreateTable(TAOS * con, SShellCmd * cmd) {
}
}
// tb options
if
(
!
ret
)
{
// find like create talbe st (...) tags(..) <here is fill tb option area>
char
*
p1
=
strchr
(
ps
,
')'
);
// first ')' end
if
(
p1
)
{
if
(
strchr
(
p1
+
1
,
')'
))
{
// second ')' end
// here is tb options area, can insert option
ret
=
fillWithType
(
con
,
cmd
,
last
,
WT_VAR_TBOPTION
);
}
}
}
taosMemoryFree
(
ps
);
return
ret
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录