Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
3a650da6
T
TDengine
项目概览
慢慢CG
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
3a650da6
编写于
5月 25, 2020
作者:
B
Bomin Zhang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
TD-407: add config for binary column display width
上级
dfbe9ace
变更
7
展开全部
隐藏空白更改
内联
并排
Showing
7 changed file
with
392 addition
and
412 deletion
+392
-412
src/common/src/tglobal.c
src/common/src/tglobal.c
+12
-0
src/kit/shell/inc/shell.h
src/kit/shell/inc/shell.h
+1
-13
src/kit/shell/src/shellDarwin.c
src/kit/shell/src/shellDarwin.c
+17
-25
src/kit/shell/src/shellEngine.c
src/kit/shell/src/shellEngine.c
+326
-326
src/kit/shell/src/shellLinux.c
src/kit/shell/src/shellLinux.c
+16
-25
src/kit/shell/src/shellMain.c
src/kit/shell/src/shellMain.c
+0
-1
src/kit/shell/src/shellWindows.c
src/kit/shell/src/shellWindows.c
+20
-22
未找到文件。
src/common/src/tglobal.c
浏览文件 @
3a650da6
...
@@ -202,6 +202,8 @@ char tsTimezone[64] = {0};
...
@@ -202,6 +202,8 @@ char tsTimezone[64] = {0};
char
tsLocale
[
TSDB_LOCALE_LEN
]
=
{
0
};
char
tsLocale
[
TSDB_LOCALE_LEN
]
=
{
0
};
char
tsCharset
[
TSDB_LOCALE_LEN
]
=
{
0
};
// default encode string
char
tsCharset
[
TSDB_LOCALE_LEN
]
=
{
0
};
// default encode string
int32_t
tsMaxBinaryDisplayWidth
=
30
;
static
pthread_once_t
tsInitGlobalCfgOnce
=
PTHREAD_ONCE_INIT
;
static
pthread_once_t
tsInitGlobalCfgOnce
=
PTHREAD_ONCE_INIT
;
void
taosSetAllDebugFlag
()
{
void
taosSetAllDebugFlag
()
{
...
@@ -1227,6 +1229,16 @@ static void doInitGlobalConfig() {
...
@@ -1227,6 +1229,16 @@ static void doInitGlobalConfig() {
cfg
.
ptrLength
=
0
;
cfg
.
ptrLength
=
0
;
cfg
.
unitType
=
TAOS_CFG_UTYPE_NONE
;
cfg
.
unitType
=
TAOS_CFG_UTYPE_NONE
;
taosInitConfigOption
(
cfg
);
taosInitConfigOption
(
cfg
);
cfg
.
option
=
"maxBinaryDisplayWidth"
;
cfg
.
ptr
=
&
tsMaxBinaryDisplayWidth
;
cfg
.
valType
=
TAOS_CFG_VTYPE_INT32
;
cfg
.
cfgType
=
TSDB_CFG_CTYPE_B_CONFIG
|
TSDB_CFG_CTYPE_B_CLIENT
;
cfg
.
minValue
=
1
;
cfg
.
maxValue
=
0x7fffffff
;
cfg
.
ptrLength
=
0
;
cfg
.
unitType
=
TAOS_CFG_UTYPE_NONE
;
taosInitConfigOption
(
cfg
);
}
}
void
taosInitGlobalCfg
()
{
void
taosInitGlobalCfg
()
{
...
...
src/kit/shell/inc/shell.h
浏览文件 @
3a650da6
...
@@ -29,18 +29,6 @@
...
@@ -29,18 +29,6 @@
#define MAX_COMMAND_SIZE 65536
#define MAX_COMMAND_SIZE 65536
#define HISTORY_FILE ".taos_history"
#define HISTORY_FILE ".taos_history"
#define BOOL_OUTPUT_LENGTH 6
#define TINYINT_OUTPUT_LENGTH 6
#define SMALLINT_OUTPUT_LENGTH 7
#define INT_OUTPUT_LENGTH 11
#define BIGINT_OUTPUT_LENGTH 21
#define FLOAT_OUTPUT_LENGTH 20
#define DOUBLE_OUTPUT_LENGTH 25
#define BINARY_OUTPUT_LENGTH 20
// dynamic config timestamp width according to maximum time precision
extern
int32_t
TIMESTAMP_OUTPUT_LENGTH
;
typedef
struct
SShellHistory
{
typedef
struct
SShellHistory
{
char
*
hist
[
MAX_HISTORY_SIZE
];
char
*
hist
[
MAX_HISTORY_SIZE
];
int
hstart
;
int
hstart
;
...
@@ -80,7 +68,7 @@ void get_history_path(char* history);
...
@@ -80,7 +68,7 @@ void get_history_path(char* history);
void
cleanup_handler
(
void
*
arg
);
void
cleanup_handler
(
void
*
arg
);
void
exitShell
();
void
exitShell
();
int
shellDumpResult
(
TAOS
*
con
,
char
*
fname
,
int
*
error_no
,
bool
printMode
);
int
shellDumpResult
(
TAOS
*
con
,
char
*
fname
,
int
*
error_no
,
bool
printMode
);
void
shellPrintNChar
(
char
*
str
,
int
width
,
bool
printMode
);
int
shellPrintNChar
(
const
char
*
str
,
int
length
,
int
width
);
void
shellGetGrantInfo
(
void
*
con
);
void
shellGetGrantInfo
(
void
*
con
);
int
isCommentLine
(
char
*
line
);
int
isCommentLine
(
char
*
line
);
...
...
src/kit/shell/src/shellDarwin.c
浏览文件 @
3a650da6
...
@@ -352,37 +352,29 @@ void *shellLoopQuery(void *arg) {
...
@@ -352,37 +352,29 @@ void *shellLoopQuery(void *arg) {
return
NULL
;
return
NULL
;
}
}
void
shellPrintNChar
(
char
*
str
,
int
width
,
bool
printMode
)
{
int
shellPrintNChar
(
const
char
*
str
,
int
length
,
int
width
)
{
int
col_left
=
width
;
int
pos
=
0
,
cols
=
0
;
wchar_t
wc
;
while
(
pos
<
length
)
{
while
(
col_left
>
0
)
{
wchar_t
wc
;
if
(
*
str
==
'\0'
)
break
;
pos
+=
mbtowc
(
&
wc
,
str
+
pos
,
MB_CUR_MAX
);
char
*
tstr
=
str
;
if
(
pos
>
length
)
{
int
byte_width
=
mbtowc
(
&
wc
,
tstr
,
MB_CUR_MAX
);
break
;
if
(
byte_width
<=
0
)
break
;
int
col_width
=
wcwidth
(
wc
);
if
(
col_width
<=
0
)
{
str
+=
byte_width
;
continue
;
}
}
if
(
col_left
<
col_width
)
break
;
printf
(
"%lc"
,
wc
);
str
+=
byte_width
;
col_left
-=
col_width
;
}
while
(
col_left
>
0
)
{
int
w
=
wcwidth
(
wc
);
printf
(
" "
);
if
(
w
>
0
)
{
col_left
--
;
if
(
width
>
0
&&
cols
+
w
>
width
)
{
break
;
}
printf
(
"%lc"
,
wc
);
cols
+=
w
;
}
}
}
if
(
!
printMode
)
{
return
cols
;
printf
(
"|"
);
}
else
{
printf
(
"
\n
"
);
}
}
}
int
get_old_terminal_mode
(
struct
termios
*
tio
)
{
int
get_old_terminal_mode
(
struct
termios
*
tio
)
{
/* Make sure stdin is a terminal. */
/* Make sure stdin is a terminal. */
if
(
!
isatty
(
STDIN_FILENO
))
{
if
(
!
isatty
(
STDIN_FILENO
))
{
...
...
src/kit/shell/src/shellEngine.c
浏览文件 @
3a650da6
此差异已折叠。
点击以展开。
src/kit/shell/src/shellLinux.c
浏览文件 @
3a650da6
...
@@ -329,35 +329,26 @@ void *shellLoopQuery(void *arg) {
...
@@ -329,35 +329,26 @@ void *shellLoopQuery(void *arg) {
return
NULL
;
return
NULL
;
}
}
void
shellPrintNChar
(
char
*
str
,
int
width
,
bool
printMode
)
{
int
shellPrintNChar
(
const
char
*
str
,
int
length
,
int
width
)
{
int
col_left
=
width
;
int
pos
=
0
,
cols
=
0
;
wchar_t
wc
;
while
(
pos
<
length
)
{
while
(
col_left
>
0
)
{
wchar_t
wc
;
if
(
*
str
==
'\0'
)
break
;
pos
+=
mbtowc
(
&
wc
,
str
+
pos
,
MB_CUR_MAX
);
char
*
tstr
=
str
;
if
(
pos
>
length
)
{
int
byte_width
=
mbtowc
(
&
wc
,
tstr
,
MB_CUR_MAX
);
break
;
if
(
byte_width
<=
0
)
break
;
int
col_width
=
wcwidth
(
wc
);
if
(
col_width
<=
0
)
{
str
+=
byte_width
;
continue
;
}
}
if
(
col_left
<
col_width
)
break
;
printf
(
"%lc"
,
wc
);
str
+=
byte_width
;
col_left
-=
col_width
;
}
while
(
col_left
>
0
)
{
int
w
=
wcwidth
(
wc
);
printf
(
" "
);
if
(
w
>
0
)
{
col_left
--
;
if
(
width
>
0
&&
cols
+
w
>
width
)
{
break
;
}
printf
(
"%lc"
,
wc
);
cols
+=
w
;
}
}
}
if
(
!
printMode
)
{
return
cols
;
printf
(
"|"
);
}
else
{
printf
(
"
\n
"
);
}
}
}
int
get_old_terminal_mode
(
struct
termios
*
tio
)
{
int
get_old_terminal_mode
(
struct
termios
*
tio
)
{
...
...
src/kit/shell/src/shellMain.c
浏览文件 @
3a650da6
...
@@ -20,7 +20,6 @@
...
@@ -20,7 +20,6 @@
TAOS
*
con
;
TAOS
*
con
;
pthread_t
pid
;
pthread_t
pid
;
int32_t
TIMESTAMP_OUTPUT_LENGTH
=
22
;
// TODO: IMPLEMENT INTERRUPT HANDLER.
// TODO: IMPLEMENT INTERRUPT HANDLER.
void
interruptHandler
(
int
signum
)
{
void
interruptHandler
(
int
signum
)
{
...
...
src/kit/shell/src/shellWindows.c
浏览文件 @
3a650da6
...
@@ -217,32 +217,30 @@ void *shellLoopQuery(void *arg) {
...
@@ -217,32 +217,30 @@ void *shellLoopQuery(void *arg) {
return
NULL
;
return
NULL
;
}
}
void
shellPrintNChar
(
char
*
str
,
int
width
,
bool
printMode
)
{
int
shellPrintNChar
(
const
char
*
str
,
int
length
,
int
width
)
{
int
col_left
=
width
;
int
pos
=
0
,
cols
=
0
;
wchar_t
wc
;
while
(
pos
<
length
)
{
while
(
col_left
>
0
)
{
wchar_t
wc
;
if
(
*
str
==
'\0'
)
break
;
int
bytes
=
mbtowc
(
&
wc
,
str
+
pos
,
MB_CUR_MAX
);
char
*
tstr
=
str
;
pos
+=
bytes
;
int
byte_width
=
mbtowc
(
&
wc
,
tstr
,
MB_CUR_MAX
);
if
(
pos
>
length
)
{
int
col_width
=
byte_width
;
break
;
if
(
col_left
<
col_width
)
break
;
}
printf
(
"%lc"
,
wc
);
str
+=
byte_width
;
col_left
-=
col_width
;
}
while
(
col_left
>
0
)
{
int
w
=
bytes
;
printf
(
" "
);
if
(
w
>
0
)
{
col_left
--
;
if
(
width
>
0
&&
cols
+
w
>
width
)
{
}
break
;
}
if
(
!
printMode
)
{
printf
(
"%lc"
,
wc
);
printf
(
"|"
);
cols
+=
w
;
}
else
{
}
printf
(
"
\n
"
);
}
}
return
cols
;
}
}
void
get_history_path
(
char
*
history
)
{
sprintf
(
history
,
"%s/%s"
,
"."
,
HISTORY_FILE
);
}
void
get_history_path
(
char
*
history
)
{
sprintf
(
history
,
"%s/%s"
,
"."
,
HISTORY_FILE
);
}
void
exitShell
()
{
exit
(
EXIT_SUCCESS
);
}
void
exitShell
()
{
exit
(
EXIT_SUCCESS
);
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录