Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
c85da8dc
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
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看板
提交
c85da8dc
编写于
1月 05, 2023
作者:
sangshuduo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: typos
上级
f7169103
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
15 addition
and
15 deletion
+15
-15
tools/shell/inc/shellAuto.h
tools/shell/inc/shellAuto.h
+2
-2
tools/shell/inc/shellTire.h
tools/shell/inc/shellTire.h
+1
-1
tools/shell/src/shellAuto.c
tools/shell/src/shellAuto.c
+11
-11
tools/shell/src/shellEngine.c
tools/shell/src/shellEngine.c
+1
-1
未找到文件。
tools/shell/inc/shellAuto.h
浏览文件 @
c85da8dc
...
...
@@ -24,13 +24,13 @@ void pressTabKey(SShellCmd* cmd);
// press othr key
void
pressOtherKey
(
char
c
);
// init shell auto func
it
on , shell start call once
// init shell auto func
ti
on , shell start call once
bool
shellAutoInit
();
// set conn
void
shellSetConn
(
TAOS
*
conn
);
// exit shell auto func
it
on, shell exit call once
// exit shell auto func
ti
on, shell exit call once
void
shellAutoExit
();
// callback autotab module
...
...
tools/shell/inc/shellTire.h
浏览文件 @
c85da8dc
...
...
@@ -19,7 +19,7 @@
//
// The prefix search tree is a efficient storage words and search words tree, it support 95 visible ascii code character
//
#define FIRST_ASCII 40 // first visi
a
ble char is '0'
#define FIRST_ASCII 40 // first visible char is '0'
#define LAST_ASCII 122 // last visilbe char is 'z'
// capacity save char is 95
...
...
tools/shell/src/shellAuto.c
浏览文件 @
c85da8dc
...
...
@@ -264,7 +264,7 @@ char* key_tags[] = {"tags("};
char
*
key_select
[]
=
{
"select "
};
//
// ------- gobal variant define ---------
// ------- g
l
obal variant define ---------
//
int32_t
firstMatchIndex
=
-
1
;
// first match shellCommands index
int32_t
lastMatchIndex
=
-
1
;
// last match shellCommands index
...
...
@@ -603,7 +603,7 @@ void GenerateVarType(int type, char** p, int count) {
// -------------------- shell auto ----------------
//
// init shell auto func
it
on , shell start call once
// init shell auto func
ti
on , shell start call once
bool
shellAutoInit
()
{
// command
int32_t
count
=
SHELL_COMMAND_COUNT
();
...
...
@@ -636,7 +636,7 @@ bool shellAutoInit() {
// set conn
void
shellSetConn
(
TAOS
*
conn
)
{
varCon
=
conn
;
}
// exit shell auto func
it
on, shell exit call once
// exit shell auto func
ti
on, shell exit call once
void
shellAutoExit
()
{
// free command
int32_t
count
=
SHELL_COMMAND_COUNT
();
...
...
@@ -653,7 +653,7 @@ void shellAutoExit() {
}
}
taosThreadMutexUnlock
(
&
tiresMutex
);
// dest
or
y
// dest
ro
y
taosThreadMutexDestroy
(
&
tiresMutex
);
// free threads
...
...
@@ -674,7 +674,7 @@ void shellAutoExit() {
//
// ------------------- auto ptr for tires --------------------------
//
bool
setNewAu
ot
Ptr
(
int
type
,
STire
*
pNew
)
{
bool
setNewAu
to
Ptr
(
int
type
,
STire
*
pNew
)
{
if
(
pNew
==
NULL
)
return
false
;
taosThreadMutexLock
(
&
tiresMutex
);
...
...
@@ -717,7 +717,7 @@ void putBackAutoPtr(int type, STire* tire) {
if
(
tires
[
type
]
!=
tire
)
{
// update by out, can't put back , so free
if
(
--
tire
->
ref
==
1
)
{
// support multi thread getAu
ot
Ptr
// support multi thread getAu
to
Ptr
freeTire
(
tire
);
}
...
...
@@ -775,7 +775,7 @@ int writeVarNames(int type, TAOS_RES* tres) {
}
while
(
row
!=
NULL
);
// replace old tire
setNewAu
ot
Ptr
(
type
,
tire
);
setNewAu
to
Ptr
(
type
,
tire
);
return
numOfRows
;
}
...
...
@@ -1043,7 +1043,7 @@ SWords* matchCommand(SWords* input, bool continueSearch) {
for
(
int32_t
i
=
0
;
i
<
count
;
i
++
)
{
SWords
*
shellCommand
=
shellCommands
+
i
;
if
(
continueSearch
&&
lastMatchIndex
!=
-
1
&&
i
<=
lastMatchIndex
)
{
// new match must greate than lastMatchIndex
// new match must greate
r
than lastMatchIndex
if
(
varMode
&&
i
==
lastMatchIndex
)
{
// do nothing, var match on lastMatchIndex
}
else
{
...
...
@@ -1172,7 +1172,7 @@ void createInputFromFirst(SWords* input, SWords* firstMatch) {
for
(
int
i
=
0
;
i
<
firstMatch
->
matchIndex
&&
word
;
i
++
)
{
// combine source from each word
strncpy
(
input
->
source
+
input
->
source_len
,
word
->
word
,
word
->
len
);
strcat
(
input
->
source
,
" "
);
// append blank sp
lit
e
strcat
(
input
->
source
,
" "
);
// append blank sp
ac
e
input
->
source_len
+=
word
->
len
+
1
;
// 1 is blank length
// move next
word
=
word
->
next
;
...
...
@@ -1401,7 +1401,7 @@ bool appendAfterSelect(TAOS* con, SShellCmd* cmd, char* sql, int32_t len) {
return
true
;
}
// fill func
it
on
// fill func
ti
on
if
(
fieldEnd
)
{
// fields is end , need match keyword
ret
=
fillWithType
(
con
,
cmd
,
last
,
WT_VAR_KEYWORD
);
...
...
@@ -1584,7 +1584,7 @@ bool matchCreateTable(TAOS* con, SShellCmd* cmd) {
// tb options
if
(
!
ret
)
{
// find like create ta
lb
e st (...) tags(..) <here is fill tb option area>
// find like create ta
bl
e st (...) tags(..) <here is fill tb option area>
char
*
p1
=
strchr
(
ps
,
')'
);
// first ')' end
if
(
p1
)
{
if
(
strchr
(
p1
+
1
,
')'
))
{
// second ')' end
...
...
tools/shell/src/shellEngine.c
浏览文件 @
c85da8dc
...
...
@@ -1128,7 +1128,7 @@ int32_t shellExecute() {
}
if
(
tsem_init
(
&
shell
.
cancelSem
,
0
,
0
)
!=
0
)
{
printf
(
"failed to create cancel semphore
\r\n
"
);
printf
(
"failed to create cancel sem
a
phore
\r\n
"
);
return
-
1
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录