Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
7935d824
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看板
提交
7935d824
编写于
7月 14, 2023
作者:
G
Ganlin Zhao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
enhance show variables output
上级
e7e923a3
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
24 addition
and
3 deletion
+24
-3
include/common/tmsg.h
include/common/tmsg.h
+1
-0
include/util/tdef.h
include/util/tdef.h
+1
-0
source/client/inc/clientInt.h
source/client/inc/clientInt.h
+2
-1
source/client/src/clientMsgHandler.c
source/client/src/clientMsgHandler.c
+9
-1
source/common/src/tmsg.c
source/common/src/tmsg.c
+2
-0
source/dnode/mnode/impl/src/mndDnode.c
source/dnode/mnode/impl/src/mndDnode.c
+4
-0
source/libs/parser/src/parTranslater.c
source/libs/parser/src/parTranslater.c
+5
-1
未找到文件。
include/common/tmsg.h
浏览文件 @
7935d824
...
...
@@ -1510,6 +1510,7 @@ int32_t tDeserializeSShowVariablesReq(void* buf, int32_t bufLen, SShowVariablesR
typedef
struct
{
char
name
[
TSDB_CONFIG_OPTION_LEN
+
1
];
char
value
[
TSDB_CONFIG_VALUE_LEN
+
1
];
char
scope
[
TSDB_CONFIG_SCOPE_LEN
+
1
];
}
SVariablesInfo
;
typedef
struct
{
...
...
include/util/tdef.h
浏览文件 @
7935d824
...
...
@@ -492,6 +492,7 @@ enum {
#define TSDB_CONFIG_OPTION_LEN 32
#define TSDB_CONFIG_VALUE_LEN 64
#define TSDB_CONFIG_SCOPE_LEN 8
#define TSDB_CONFIG_NUMBER 8
#define QUERY_ID_SIZE 20
...
...
source/client/inc/clientInt.h
浏览文件 @
7935d824
...
...
@@ -46,9 +46,10 @@ enum {
RES_TYPE__TMQ_METADATA
,
};
#define SHOW_VARIABLES_RESULT_COLS
2
#define SHOW_VARIABLES_RESULT_COLS
3
#define SHOW_VARIABLES_RESULT_FIELD1_LEN (TSDB_CONFIG_OPTION_LEN + VARSTR_HEADER_SIZE)
#define SHOW_VARIABLES_RESULT_FIELD2_LEN (TSDB_CONFIG_VALUE_LEN + VARSTR_HEADER_SIZE)
#define SHOW_VARIABLES_RESULT_FIELD3_LEN (TSDB_CONFIG_SCOPE_LEN + VARSTR_HEADER_SIZE)
#define TD_RES_QUERY(res) (*(int8_t*)res == RES_TYPE__QUERY)
#define TD_RES_TMQ(res) (*(int8_t*)res == RES_TYPE__TMQ)
...
...
source/client/src/clientMsgHandler.c
浏览文件 @
7935d824
...
...
@@ -427,13 +427,16 @@ static int32_t buildShowVariablesBlock(SArray* pVars, SSDataBlock** block) {
SColumnInfoData
infoData
=
{
0
};
infoData
.
info
.
type
=
TSDB_DATA_TYPE_VARCHAR
;
infoData
.
info
.
bytes
=
SHOW_VARIABLES_RESULT_FIELD1_LEN
;
taosArrayPush
(
pBlock
->
pDataBlock
,
&
infoData
);
infoData
.
info
.
type
=
TSDB_DATA_TYPE_VARCHAR
;
infoData
.
info
.
bytes
=
SHOW_VARIABLES_RESULT_FIELD2_LEN
;
taosArrayPush
(
pBlock
->
pDataBlock
,
&
infoData
);
infoData
.
info
.
type
=
TSDB_DATA_TYPE_VARCHAR
;
infoData
.
info
.
bytes
=
SHOW_VARIABLES_RESULT_FIELD3_LEN
;
taosArrayPush
(
pBlock
->
pDataBlock
,
&
infoData
);
int32_t
numOfCfg
=
taosArrayGetSize
(
pVars
);
blockDataEnsureCapacity
(
pBlock
,
numOfCfg
);
...
...
@@ -449,6 +452,11 @@ static int32_t buildShowVariablesBlock(SArray* pVars, SSDataBlock** block) {
STR_WITH_MAXSIZE_TO_VARSTR
(
value
,
pInfo
->
value
,
TSDB_CONFIG_VALUE_LEN
+
VARSTR_HEADER_SIZE
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
c
++
);
colDataSetVal
(
pColInfo
,
i
,
value
,
false
);
char
scope
[
TSDB_CONFIG_SCOPE_LEN
+
VARSTR_HEADER_SIZE
]
=
{
0
};
STR_WITH_MAXSIZE_TO_VARSTR
(
scope
,
pInfo
->
scope
,
TSDB_CONFIG_VALUE_LEN
+
VARSTR_HEADER_SIZE
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
c
++
);
colDataSetVal
(
pColInfo
,
i
,
scope
,
false
);
}
pBlock
->
info
.
rows
=
numOfCfg
;
...
...
source/common/src/tmsg.c
浏览文件 @
7935d824
...
...
@@ -3528,12 +3528,14 @@ int32_t tDeserializeSShowVariablesReq(void *buf, int32_t bufLen, SShowVariablesR
int32_t
tEncodeSVariablesInfo
(
SEncoder
*
pEncoder
,
SVariablesInfo
*
pInfo
)
{
if
(
tEncodeCStr
(
pEncoder
,
pInfo
->
name
)
<
0
)
return
-
1
;
if
(
tEncodeCStr
(
pEncoder
,
pInfo
->
value
)
<
0
)
return
-
1
;
if
(
tEncodeCStr
(
pEncoder
,
pInfo
->
scope
)
<
0
)
return
-
1
;
return
0
;
}
int32_t
tDecodeSVariablesInfo
(
SDecoder
*
pDecoder
,
SVariablesInfo
*
pInfo
)
{
if
(
tDecodeCStrTo
(
pDecoder
,
pInfo
->
name
)
<
0
)
return
-
1
;
if
(
tDecodeCStrTo
(
pDecoder
,
pInfo
->
value
)
<
0
)
return
-
1
;
if
(
tDecodeCStrTo
(
pDecoder
,
pInfo
->
scope
)
<
0
)
return
-
1
;
return
0
;
}
...
...
source/dnode/mnode/impl/src/mndDnode.c
浏览文件 @
7935d824
...
...
@@ -783,18 +783,22 @@ static int32_t mndProcessShowVariablesReq(SRpcMsg *pReq) {
strcpy
(
info
.
name
,
"statusInterval"
);
snprintf
(
info
.
value
,
TSDB_CONFIG_VALUE_LEN
,
"%d"
,
tsStatusInterval
);
strcpy
(
info
.
scope
,
"server"
);
taosArrayPush
(
rsp
.
variables
,
&
info
);
strcpy
(
info
.
name
,
"timezone"
);
snprintf
(
info
.
value
,
TSDB_CONFIG_VALUE_LEN
,
"%s"
,
tsTimezoneStr
);
strcpy
(
info
.
scope
,
"server"
);
taosArrayPush
(
rsp
.
variables
,
&
info
);
strcpy
(
info
.
name
,
"locale"
);
snprintf
(
info
.
value
,
TSDB_CONFIG_VALUE_LEN
,
"%s"
,
tsLocale
);
strcpy
(
info
.
scope
,
"server"
);
taosArrayPush
(
rsp
.
variables
,
&
info
);
strcpy
(
info
.
name
,
"charset"
);
snprintf
(
info
.
value
,
TSDB_CONFIG_VALUE_LEN
,
"%s"
,
tsCharset
);
strcpy
(
info
.
scope
,
"server"
);
taosArrayPush
(
rsp
.
variables
,
&
info
);
int32_t
rspLen
=
tSerializeSShowVariablesRsp
(
NULL
,
0
,
&
rsp
);
...
...
source/libs/parser/src/parTranslater.c
浏览文件 @
7935d824
...
...
@@ -7707,7 +7707,7 @@ static int32_t extractShowCreateTableResultSchema(int32_t* numOfCols, SSchema**
}
static
int32_t
extractShowVariablesResultSchema
(
int32_t
*
numOfCols
,
SSchema
**
pSchema
)
{
*
numOfCols
=
2
;
*
numOfCols
=
3
;
*
pSchema
=
taosMemoryCalloc
((
*
numOfCols
),
sizeof
(
SSchema
));
if
(
NULL
==
(
*
pSchema
))
{
return
TSDB_CODE_OUT_OF_MEMORY
;
...
...
@@ -7721,6 +7721,10 @@ static int32_t extractShowVariablesResultSchema(int32_t* numOfCols, SSchema** pS
(
*
pSchema
)[
1
].
bytes
=
TSDB_CONFIG_VALUE_LEN
;
strcpy
((
*
pSchema
)[
1
].
name
,
"value"
);
(
*
pSchema
)[
2
].
type
=
TSDB_DATA_TYPE_BINARY
;
(
*
pSchema
)[
2
].
bytes
=
TSDB_CONFIG_SCOPE_LEN
;
strcpy
((
*
pSchema
)[
2
].
name
,
"scope"
);
return
TSDB_CODE_SUCCESS
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录