Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
35fccc49
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看板
提交
35fccc49
编写于
4月 29, 2022
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor(query): remove redundant attributes in some structs.
上级
621b6f90
变更
14
隐藏空白更改
内联
并排
Showing
14 changed file
with
54 addition
and
65 deletion
+54
-65
source/dnode/mnode/impl/inc/mndDef.h
source/dnode/mnode/impl/inc/mndDef.h
+0
-3
source/dnode/mnode/impl/src/mndBnode.c
source/dnode/mnode/impl/src/mndBnode.c
+1
-1
source/dnode/mnode/impl/src/mndCluster.c
source/dnode/mnode/impl/src/mndCluster.c
+1
-1
source/dnode/mnode/impl/src/mndDb.c
source/dnode/mnode/impl/src/mndDb.c
+4
-3
source/dnode/mnode/impl/src/mndDnode.c
source/dnode/mnode/impl/src/mndDnode.c
+1
-1
source/dnode/mnode/impl/src/mndFunc.c
source/dnode/mnode/impl/src/mndFunc.c
+4
-4
source/dnode/mnode/impl/src/mndMnode.c
source/dnode/mnode/impl/src/mndMnode.c
+2
-2
source/dnode/mnode/impl/src/mndProfile.c
source/dnode/mnode/impl/src/mndProfile.c
+33
-32
source/dnode/mnode/impl/src/mndQnode.c
source/dnode/mnode/impl/src/mndQnode.c
+1
-1
source/dnode/mnode/impl/src/mndShow.c
source/dnode/mnode/impl/src/mndShow.c
+0
-10
source/dnode/mnode/impl/src/mndSnode.c
source/dnode/mnode/impl/src/mndSnode.c
+1
-1
source/dnode/mnode/impl/src/mndTrans.c
source/dnode/mnode/impl/src/mndTrans.c
+4
-4
source/dnode/mnode/impl/src/mndUser.c
source/dnode/mnode/impl/src/mndUser.c
+1
-1
source/dnode/mnode/impl/src/mndVgroup.c
source/dnode/mnode/impl/src/mndVgroup.c
+1
-1
未找到文件。
source/dnode/mnode/impl/inc/mndDef.h
浏览文件 @
35fccc49
...
@@ -388,15 +388,12 @@ typedef struct {
...
@@ -388,15 +388,12 @@ typedef struct {
int8_t
type
;
int8_t
type
;
int8_t
replica
;
int8_t
replica
;
int16_t
numOfColumns
;
int16_t
numOfColumns
;
int32_t
rowSize
;
int32_t
numOfRows
;
int32_t
numOfRows
;
void
*
pIter
;
void
*
pIter
;
SMnode
*
pMnode
;
SMnode
*
pMnode
;
STableMetaRsp
*
pMeta
;
STableMetaRsp
*
pMeta
;
bool
sysDbRsp
;
bool
sysDbRsp
;
char
db
[
TSDB_DB_FNAME_LEN
];
char
db
[
TSDB_DB_FNAME_LEN
];
int16_t
offset
[
TSDB_MAX_COLUMNS
];
int32_t
bytes
[
TSDB_MAX_COLUMNS
];
}
SShowObj
;
}
SShowObj
;
typedef
struct
{
typedef
struct
{
...
...
source/dnode/mnode/impl/src/mndBnode.c
浏览文件 @
35fccc49
...
@@ -453,7 +453,7 @@ static int32_t mndRetrieveBnodes(SNodeMsg *pReq, SShowObj *pShow, SSDataBlock *p
...
@@ -453,7 +453,7 @@ static int32_t mndRetrieveBnodes(SNodeMsg *pReq, SShowObj *pShow, SSDataBlock *p
colDataAppend
(
pColInfo
,
numOfRows
,
(
const
char
*
)
&
pObj
->
id
,
false
);
colDataAppend
(
pColInfo
,
numOfRows
,
(
const
char
*
)
&
pObj
->
id
,
false
);
char
buf
[
TSDB_EP_LEN
+
VARSTR_HEADER_SIZE
]
=
{
0
};
char
buf
[
TSDB_EP_LEN
+
VARSTR_HEADER_SIZE
]
=
{
0
};
STR_WITH_MAXSIZE_TO_VARSTR
(
buf
,
pObj
->
pDnode
->
ep
,
pShow
->
bytes
[
cols
]
);
STR_WITH_MAXSIZE_TO_VARSTR
(
buf
,
pObj
->
pDnode
->
ep
,
pShow
->
pMeta
->
pSchemas
[
cols
].
bytes
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataAppend
(
pColInfo
,
numOfRows
,
buf
,
false
);
colDataAppend
(
pColInfo
,
numOfRows
,
buf
,
false
);
...
...
source/dnode/mnode/impl/src/mndCluster.c
浏览文件 @
35fccc49
...
@@ -194,7 +194,7 @@ static int32_t mndRetrieveClusters(SNodeMsg *pMsg, SShowObj *pShow, SSDataBlock
...
@@ -194,7 +194,7 @@ static int32_t mndRetrieveClusters(SNodeMsg *pMsg, SShowObj *pShow, SSDataBlock
colDataAppend
(
pColInfo
,
numOfRows
,
(
const
char
*
)
&
pCluster
->
id
,
false
);
colDataAppend
(
pColInfo
,
numOfRows
,
(
const
char
*
)
&
pCluster
->
id
,
false
);
char
buf
[
tListLen
(
pCluster
->
name
)
+
VARSTR_HEADER_SIZE
]
=
{
0
};
char
buf
[
tListLen
(
pCluster
->
name
)
+
VARSTR_HEADER_SIZE
]
=
{
0
};
STR_WITH_MAXSIZE_TO_VARSTR
(
buf
,
pCluster
->
name
,
pShow
->
bytes
[
cols
]
);
STR_WITH_MAXSIZE_TO_VARSTR
(
buf
,
pCluster
->
name
,
pShow
->
pMeta
->
pSchemas
[
cols
].
bytes
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataAppend
(
pColInfo
,
numOfRows
,
buf
,
false
);
colDataAppend
(
pColInfo
,
numOfRows
,
buf
,
false
);
...
...
source/dnode/mnode/impl/src/mndDb.c
浏览文件 @
35fccc49
...
@@ -1387,12 +1387,13 @@ static void dumpDbInfoData(SSDataBlock *pBlock, SDbObj *pDb, SShowObj *pShow, in
...
@@ -1387,12 +1387,13 @@ static void dumpDbInfoData(SSDataBlock *pBlock, SDbObj *pDb, SShowObj *pShow, in
bool
sysDb
)
{
bool
sysDb
)
{
int32_t
cols
=
0
;
int32_t
cols
=
0
;
char
*
buf
=
taosMemoryMalloc
(
pShow
->
bytes
[
cols
]);
int32_t
bytes
=
pShow
->
pMeta
->
pSchemas
[
cols
].
bytes
;
char
*
buf
=
taosMemoryMalloc
(
bytes
);
const
char
*
name
=
mndGetDbStr
(
pDb
->
name
);
const
char
*
name
=
mndGetDbStr
(
pDb
->
name
);
if
(
name
!=
NULL
)
{
if
(
name
!=
NULL
)
{
STR_WITH_MAXSIZE_TO_VARSTR
(
buf
,
name
,
pShow
->
bytes
[
cols
]
);
STR_WITH_MAXSIZE_TO_VARSTR
(
buf
,
name
,
bytes
);
}
else
{
}
else
{
STR_WITH_MAXSIZE_TO_VARSTR
(
buf
,
"NULL"
,
pShow
->
bytes
[
cols
]
);
STR_WITH_MAXSIZE_TO_VARSTR
(
buf
,
"NULL"
,
bytes
);
}
}
char
*
status
=
"ready"
;
char
*
status
=
"ready"
;
...
...
source/dnode/mnode/impl/src/mndDnode.c
浏览文件 @
35fccc49
...
@@ -705,7 +705,7 @@ static int32_t mndRetrieveDnodes(SNodeMsg *pReq, SShowObj *pShow, SSDataBlock *p
...
@@ -705,7 +705,7 @@ static int32_t mndRetrieveDnodes(SNodeMsg *pReq, SShowObj *pShow, SSDataBlock *p
colDataAppend
(
pColInfo
,
numOfRows
,
(
const
char
*
)
&
pDnode
->
id
,
false
);
colDataAppend
(
pColInfo
,
numOfRows
,
(
const
char
*
)
&
pDnode
->
id
,
false
);
char
buf
[
tListLen
(
pDnode
->
ep
)
+
VARSTR_HEADER_SIZE
]
=
{
0
};
char
buf
[
tListLen
(
pDnode
->
ep
)
+
VARSTR_HEADER_SIZE
]
=
{
0
};
STR_WITH_MAXSIZE_TO_VARSTR
(
buf
,
pDnode
->
ep
,
pShow
->
bytes
[
cols
]
);
STR_WITH_MAXSIZE_TO_VARSTR
(
buf
,
pDnode
->
ep
,
pShow
->
pMeta
->
pSchemas
[
cols
].
bytes
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataAppend
(
pColInfo
,
numOfRows
,
buf
,
false
);
colDataAppend
(
pColInfo
,
numOfRows
,
buf
,
false
);
...
...
source/dnode/mnode/impl/src/mndFunc.c
浏览文件 @
35fccc49
...
@@ -517,14 +517,14 @@ static int32_t mndRetrieveFuncs(SNodeMsg *pReq, SShowObj *pShow, SSDataBlock *pB
...
@@ -517,14 +517,14 @@ static int32_t mndRetrieveFuncs(SNodeMsg *pReq, SShowObj *pShow, SSDataBlock *pB
cols
=
0
;
cols
=
0
;
char
b1
[
tListLen
(
pFunc
->
name
)
+
VARSTR_HEADER_SIZE
]
=
{
0
};
char
b1
[
tListLen
(
pFunc
->
name
)
+
VARSTR_HEADER_SIZE
]
=
{
0
};
STR_WITH_MAXSIZE_TO_VARSTR
(
b1
,
pFunc
->
name
,
pShow
->
bytes
[
cols
]
);
STR_WITH_MAXSIZE_TO_VARSTR
(
b1
,
pFunc
->
name
,
pShow
->
pMeta
->
pSchemas
[
cols
].
bytes
);
SColumnInfoData
*
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
SColumnInfoData
*
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataAppend
(
pColInfo
,
numOfRows
,
(
const
char
*
)
b1
,
false
);
colDataAppend
(
pColInfo
,
numOfRows
,
(
const
char
*
)
b1
,
false
);
if
(
pFunc
->
pComment
)
{
if
(
pFunc
->
pComment
)
{
char
*
b2
=
taosMemoryCalloc
(
1
,
pShow
->
bytes
[
cols
]
);
char
*
b2
=
taosMemoryCalloc
(
1
,
pShow
->
pMeta
->
pSchemas
[
cols
].
bytes
);
STR_WITH_MAXSIZE_TO_VARSTR
(
b2
,
pFunc
->
pComment
,
pShow
->
bytes
[
cols
]
);
STR_WITH_MAXSIZE_TO_VARSTR
(
b2
,
pFunc
->
pComment
,
pShow
->
pMeta
->
pSchemas
[
cols
].
bytes
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataAppend
(
pColInfo
,
numOfRows
,
(
const
char
*
)
b2
,
false
);
colDataAppend
(
pColInfo
,
numOfRows
,
(
const
char
*
)
b2
,
false
);
...
@@ -540,7 +540,7 @@ static int32_t mndRetrieveFuncs(SNodeMsg *pReq, SShowObj *pShow, SSDataBlock *pB
...
@@ -540,7 +540,7 @@ static int32_t mndRetrieveFuncs(SNodeMsg *pReq, SShowObj *pShow, SSDataBlock *pB
char
b3
[
TSDB_TYPE_STR_MAX_LEN
]
=
{
0
};
char
b3
[
TSDB_TYPE_STR_MAX_LEN
]
=
{
0
};
STR_WITH_MAXSIZE_TO_VARSTR
(
b3
,
mnodeGenTypeStr
(
buf
,
TSDB_TYPE_STR_MAX_LEN
,
pFunc
->
outputType
,
pFunc
->
outputLen
),
STR_WITH_MAXSIZE_TO_VARSTR
(
b3
,
mnodeGenTypeStr
(
buf
,
TSDB_TYPE_STR_MAX_LEN
,
pFunc
->
outputType
,
pFunc
->
outputLen
),
pShow
->
bytes
[
cols
]
);
pShow
->
pMeta
->
pSchemas
[
cols
].
bytes
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataAppend
(
pColInfo
,
numOfRows
,
(
const
char
*
)
b3
,
false
);
colDataAppend
(
pColInfo
,
numOfRows
,
(
const
char
*
)
b3
,
false
);
...
...
source/dnode/mnode/impl/src/mndMnode.c
浏览文件 @
35fccc49
...
@@ -619,14 +619,14 @@ static int32_t mndRetrieveMnodes(SNodeMsg *pReq, SShowObj *pShow, SSDataBlock *p
...
@@ -619,14 +619,14 @@ static int32_t mndRetrieveMnodes(SNodeMsg *pReq, SShowObj *pShow, SSDataBlock *p
colDataAppend
(
pColInfo
,
numOfRows
,
(
const
char
*
)
&
pObj
->
id
,
false
);
colDataAppend
(
pColInfo
,
numOfRows
,
(
const
char
*
)
&
pObj
->
id
,
false
);
char
b1
[
TSDB_EP_LEN
+
VARSTR_HEADER_SIZE
]
=
{
0
};
char
b1
[
TSDB_EP_LEN
+
VARSTR_HEADER_SIZE
]
=
{
0
};
STR_WITH_MAXSIZE_TO_VARSTR
(
b1
,
pObj
->
pDnode
->
ep
,
pShow
->
bytes
[
cols
]
);
STR_WITH_MAXSIZE_TO_VARSTR
(
b1
,
pObj
->
pDnode
->
ep
,
pShow
->
pMeta
->
pSchemas
[
cols
].
bytes
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataAppend
(
pColInfo
,
numOfRows
,
b1
,
false
);
colDataAppend
(
pColInfo
,
numOfRows
,
b1
,
false
);
const
char
*
roles
=
syncStr
(
pObj
->
role
);
const
char
*
roles
=
syncStr
(
pObj
->
role
);
char
*
b2
=
taosMemoryCalloc
(
1
,
strlen
(
roles
)
+
VARSTR_HEADER_SIZE
);
char
*
b2
=
taosMemoryCalloc
(
1
,
strlen
(
roles
)
+
VARSTR_HEADER_SIZE
);
STR_WITH_MAXSIZE_TO_VARSTR
(
b2
,
roles
,
pShow
->
bytes
[
cols
]
);
STR_WITH_MAXSIZE_TO_VARSTR
(
b2
,
roles
,
pShow
->
pMeta
->
pSchemas
[
cols
].
bytes
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataAppend
(
pColInfo
,
numOfRows
,
(
const
char
*
)
b2
,
false
);
colDataAppend
(
pColInfo
,
numOfRows
,
(
const
char
*
)
b2
,
false
);
...
...
source/dnode/mnode/impl/src/mndProfile.c
浏览文件 @
35fccc49
...
@@ -570,38 +570,39 @@ static int32_t mndRetrieveConns(SNodeMsg *pReq, SShowObj *pShow, char *data, int
...
@@ -570,38 +570,39 @@ static int32_t mndRetrieveConns(SNodeMsg *pReq, SShowObj *pShow, char *data, int
if
(
pConn
==
NULL
)
break
;
if
(
pConn
==
NULL
)
break
;
cols
=
0
;
cols
=
0
;
#if 0
pWrite
=
data
+
pShow
->
offset
[
cols
]
*
rows
+
pShow
->
bytes
[
cols
]
*
numOfRows
;
pWrite = data + pShow->offset[cols] * rows + pShow->
pMeta->pSchemas[cols].bytes
* numOfRows;
*(uint32_t *)pWrite = pConn->id;
*(uint32_t *)pWrite = pConn->id;
cols++;
cols++;
pWrite
=
data
+
pShow
->
offset
[
cols
]
*
rows
+
pShow
->
bytes
[
cols
]
*
numOfRows
;
pWrite = data + pShow->offset[cols] * rows + pShow->
pMeta->pSchemas[cols].bytes
* numOfRows;
STR_WITH_MAXSIZE_TO_VARSTR
(
pWrite
,
pConn
->
user
,
pShow
->
bytes
[
cols
]
);
STR_WITH_MAXSIZE_TO_VARSTR(pWrite, pConn->user, pShow->
pMeta->pSchemas[cols].bytes
);
cols++;
cols++;
// app name
// app name
pWrite
=
data
+
pShow
->
offset
[
cols
]
*
rows
+
pShow
->
bytes
[
cols
]
*
numOfRows
;
pWrite = data + pShow->offset[cols] * rows + pShow->
pMeta->pSchemas[cols].bytes
* numOfRows;
STR_WITH_MAXSIZE_TO_VARSTR
(
pWrite
,
pConn
->
app
,
pShow
->
bytes
[
cols
]
);
STR_WITH_MAXSIZE_TO_VARSTR(pWrite, pConn->app, pShow->
pMeta->pSchemas[cols].bytes
);
cols++;
cols++;
// app pid
// app pid
pWrite
=
data
+
pShow
->
offset
[
cols
]
*
rows
+
pShow
->
bytes
[
cols
]
*
numOfRows
;
pWrite = data + pShow->offset[cols] * rows + pShow->
pMeta->pSchemas[cols].bytes
* numOfRows;
*(int32_t *)pWrite = pConn->pid;
*(int32_t *)pWrite = pConn->pid;
cols++;
cols++;
pWrite
=
data
+
pShow
->
offset
[
cols
]
*
rows
+
pShow
->
bytes
[
cols
]
*
numOfRows
;
pWrite = data + pShow->offset[cols] * rows + pShow->
pMeta->pSchemas[cols].bytes
* numOfRows;
taosIpPort2String(pConn->ip, pConn->port, ipStr);
taosIpPort2String(pConn->ip, pConn->port, ipStr);
STR_WITH_MAXSIZE_TO_VARSTR
(
pWrite
,
ipStr
,
pShow
->
bytes
[
cols
]
);
STR_WITH_MAXSIZE_TO_VARSTR(pWrite, ipStr, pShow->
pMeta->pSchemas[cols].bytes
);
cols++;
cols++;
pWrite
=
data
+
pShow
->
offset
[
cols
]
*
rows
+
pShow
->
bytes
[
cols
]
*
numOfRows
;
pWrite = data + pShow->offset[cols] * rows + pShow->
pMeta->pSchemas[cols].bytes
* numOfRows;
*(int64_t *)pWrite = pConn->loginTimeMs;
*(int64_t *)pWrite = pConn->loginTimeMs;
cols++;
cols++;
pWrite
=
data
+
pShow
->
offset
[
cols
]
*
rows
+
pShow
->
bytes
[
cols
]
*
numOfRows
;
pWrite = data + pShow->offset[cols] * rows + pShow->
pMeta->pSchemas[cols].bytes
* numOfRows;
if (pConn->lastAccessTimeMs < pConn->loginTimeMs) pConn->lastAccessTimeMs = pConn->loginTimeMs;
if (pConn->lastAccessTimeMs < pConn->loginTimeMs) pConn->lastAccessTimeMs = pConn->loginTimeMs;
*(int64_t *)pWrite = pConn->lastAccessTimeMs;
*(int64_t *)pWrite = pConn->lastAccessTimeMs;
cols++;
cols++;
#endif
numOfRows
++
;
numOfRows
++
;
}
}
...
@@ -643,67 +644,67 @@ static int32_t mndRetrieveQueries(SNodeMsg *pReq, SShowObj *pShow, char *data, i
...
@@ -643,67 +644,67 @@ static int32_t mndRetrieveQueries(SNodeMsg *pReq, SShowObj *pShow, char *data, i
SQueryDesc *pDesc = pConn->pQueries + i;
SQueryDesc *pDesc = pConn->pQueries + i;
cols = 0;
cols = 0;
pWrite = data + pShow->offset[cols] * rows + pShow->
bytes[cols]
* numOfRows;
pWrite = data + pShow->offset[cols] * rows + pShow->
pMeta->pSchemas[cols].bytes
* numOfRows;
*(int64_t *)pWrite = htobe64(pDesc->queryId);
*(int64_t *)pWrite = htobe64(pDesc->queryId);
cols++;
cols++;
pWrite = data + pShow->offset[cols] * rows + pShow->
bytes[cols]
* numOfRows;
pWrite = data + pShow->offset[cols] * rows + pShow->
pMeta->pSchemas[cols].bytes
* numOfRows;
*(int64_t *)pWrite = htobe64(pConn->id);
*(int64_t *)pWrite = htobe64(pConn->id);
cols++;
cols++;
pWrite = data + pShow->offset[cols] * rows + pShow->
bytes[cols]
* numOfRows;
pWrite = data + pShow->offset[cols] * rows + pShow->
pMeta->pSchemas[cols].bytes
* numOfRows;
STR_WITH_MAXSIZE_TO_VARSTR(pWrite, pConn->user, pShow->
bytes[cols]
);
STR_WITH_MAXSIZE_TO_VARSTR(pWrite, pConn->user, pShow->
pMeta->pSchemas[cols].bytes
);
cols++;
cols++;
pWrite = data + pShow->offset[cols] * rows + pShow->
bytes[cols]
* numOfRows;
pWrite = data + pShow->offset[cols] * rows + pShow->
pMeta->pSchemas[cols].bytes
* numOfRows;
snprintf(str, tListLen(str), "%s:%u", taosIpStr(pConn->ip), pConn->port);
snprintf(str, tListLen(str), "%s:%u", taosIpStr(pConn->ip), pConn->port);
STR_WITH_MAXSIZE_TO_VARSTR(pWrite, str, pShow->
bytes[cols]
);
STR_WITH_MAXSIZE_TO_VARSTR(pWrite, str, pShow->
pMeta->pSchemas[cols].bytes
);
cols++;
cols++;
char handleBuf[24] = {0};
char handleBuf[24] = {0};
snprintf(handleBuf, tListLen(handleBuf), "%" PRIu64, htobe64(pDesc->qId));
snprintf(handleBuf, tListLen(handleBuf), "%" PRIu64, htobe64(pDesc->qId));
pWrite = data + pShow->offset[cols] * rows + pShow->
bytes[cols]
* numOfRows;
pWrite = data + pShow->offset[cols] * rows + pShow->
pMeta->pSchemas[cols].bytes
* numOfRows;
STR_WITH_MAXSIZE_TO_VARSTR(pWrite, handleBuf, pShow->
bytes[cols]
);
STR_WITH_MAXSIZE_TO_VARSTR(pWrite, handleBuf, pShow->
pMeta->pSchemas[cols].bytes
);
cols++;
cols++;
pWrite = data + pShow->offset[cols] * rows + pShow->
bytes[cols]
* numOfRows;
pWrite = data + pShow->offset[cols] * rows + pShow->
pMeta->pSchemas[cols].bytes
* numOfRows;
*(int64_t *)pWrite = htobe64(pDesc->stime);
*(int64_t *)pWrite = htobe64(pDesc->stime);
cols++;
cols++;
pWrite = data + pShow->offset[cols] * rows + pShow->
bytes[cols]
* numOfRows;
pWrite = data + pShow->offset[cols] * rows + pShow->
pMeta->pSchemas[cols].bytes
* numOfRows;
*(int64_t *)pWrite = htobe64(pDesc->useconds);
*(int64_t *)pWrite = htobe64(pDesc->useconds);
cols++;
cols++;
snprintf(str, tListLen(str), "0x%" PRIx64, htobe64(pDesc->sqlObjId));
snprintf(str, tListLen(str), "0x%" PRIx64, htobe64(pDesc->sqlObjId));
pWrite = data + pShow->offset[cols] * rows + pShow->
bytes[cols]
* numOfRows;
pWrite = data + pShow->offset[cols] * rows + pShow->
pMeta->pSchemas[cols].bytes
* numOfRows;
STR_WITH_MAXSIZE_TO_VARSTR(pWrite, str, pShow->
bytes[cols]
);
STR_WITH_MAXSIZE_TO_VARSTR(pWrite, str, pShow->
pMeta->pSchemas[cols].bytes
);
cols++;
cols++;
pWrite = data + pShow->offset[cols] * rows + pShow->
bytes[cols]
* numOfRows;
pWrite = data + pShow->offset[cols] * rows + pShow->
pMeta->pSchemas[cols].bytes
* numOfRows;
*(int32_t *)pWrite = htonl(pDesc->pid);
*(int32_t *)pWrite = htonl(pDesc->pid);
cols++;
cols++;
char epBuf[TSDB_EP_LEN + 1] = {0};
char epBuf[TSDB_EP_LEN + 1] = {0};
snprintf(epBuf, tListLen(epBuf), "%s:%u", pDesc->fqdn, pConn->port);
snprintf(epBuf, tListLen(epBuf), "%s:%u", pDesc->fqdn, pConn->port);
pWrite = data + pShow->offset[cols] * rows + pShow->
bytes[cols]
* numOfRows;
pWrite = data + pShow->offset[cols] * rows + pShow->
pMeta->pSchemas[cols].bytes
* numOfRows;
STR_WITH_MAXSIZE_TO_VARSTR(pWrite, epBuf, pShow->
bytes[cols]
);
STR_WITH_MAXSIZE_TO_VARSTR(pWrite, epBuf, pShow->
pMeta->pSchemas[cols].bytes
);
cols++;
cols++;
pWrite = data + pShow->offset[cols] * rows + pShow->
bytes[cols]
* numOfRows;
pWrite = data + pShow->offset[cols] * rows + pShow->
pMeta->pSchemas[cols].bytes
* numOfRows;
*(bool *)pWrite = pDesc->stableQuery;
*(bool *)pWrite = pDesc->stableQuery;
cols++;
cols++;
pWrite = data + pShow->offset[cols] * rows + pShow->
bytes[cols]
* numOfRows;
pWrite = data + pShow->offset[cols] * rows + pShow->
pMeta->pSchemas[cols].bytes
* numOfRows;
*(int32_t *)pWrite = htonl(pDesc->numOfSub);
*(int32_t *)pWrite = htonl(pDesc->numOfSub);
cols++;
cols++;
pWrite = data + pShow->offset[cols] * rows + pShow->
bytes[cols]
* numOfRows;
pWrite = data + pShow->offset[cols] * rows + pShow->
pMeta->pSchemas[cols].bytes
* numOfRows;
STR_WITH_MAXSIZE_TO_VARSTR(pWrite, pDesc->subSqlInfo, pShow->
bytes[cols]
);
STR_WITH_MAXSIZE_TO_VARSTR(pWrite, pDesc->subSqlInfo, pShow->
pMeta->pSchemas[cols].bytes
);
cols++;
cols++;
pWrite = data + pShow->offset[cols] * rows + pShow->
bytes[cols]
* numOfRows;
pWrite = data + pShow->offset[cols] * rows + pShow->
pMeta->pSchemas[cols].bytes
* numOfRows;
STR_WITH_MAXSIZE_TO_VARSTR(pWrite, pDesc->sql, pShow->
bytes[cols]
);
STR_WITH_MAXSIZE_TO_VARSTR(pWrite, pDesc->sql, pShow->
pMeta->pSchemas[cols].bytes
);
cols++;
cols++;
numOfRows++;
numOfRows++;
...
...
source/dnode/mnode/impl/src/mndQnode.c
浏览文件 @
35fccc49
...
@@ -517,7 +517,7 @@ static int32_t mndRetrieveQnodes(SNodeMsg *pReq, SShowObj *pShow, SSDataBlock *p
...
@@ -517,7 +517,7 @@ static int32_t mndRetrieveQnodes(SNodeMsg *pReq, SShowObj *pShow, SSDataBlock *p
colDataAppend
(
pColInfo
,
numOfRows
,
(
const
char
*
)
&
pObj
->
id
,
false
);
colDataAppend
(
pColInfo
,
numOfRows
,
(
const
char
*
)
&
pObj
->
id
,
false
);
char
ep
[
TSDB_EP_LEN
+
VARSTR_HEADER_SIZE
]
=
{
0
};
char
ep
[
TSDB_EP_LEN
+
VARSTR_HEADER_SIZE
]
=
{
0
};
STR_WITH_MAXSIZE_TO_VARSTR
(
ep
,
pObj
->
pDnode
->
ep
,
pShow
->
bytes
[
cols
]
);
STR_WITH_MAXSIZE_TO_VARSTR
(
ep
,
pObj
->
pDnode
->
ep
,
pShow
->
pMeta
->
pSchemas
[
cols
].
bytes
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataAppend
(
pColInfo
,
numOfRows
,
(
const
char
*
)
ep
,
false
);
colDataAppend
(
pColInfo
,
numOfRows
,
(
const
char
*
)
ep
,
false
);
...
...
source/dnode/mnode/impl/src/mndShow.c
浏览文件 @
35fccc49
...
@@ -209,16 +209,6 @@ static int32_t mndProcessRetrieveSysTableReq(SNodeMsg *pReq) {
...
@@ -209,16 +209,6 @@ static int32_t mndProcessRetrieveSysTableReq(SNodeMsg *pReq) {
pShow
->
pMeta
=
pMeta
;
pShow
->
pMeta
=
pMeta
;
pShow
->
numOfColumns
=
pShow
->
pMeta
->
numOfColumns
;
pShow
->
numOfColumns
=
pShow
->
pMeta
->
numOfColumns
;
int32_t
offset
=
0
;
for
(
int32_t
i
=
0
;
i
<
pShow
->
pMeta
->
numOfColumns
;
++
i
)
{
pShow
->
offset
[
i
]
=
offset
;
int32_t
bytes
=
pShow
->
pMeta
->
pSchemas
[
i
].
bytes
;
pShow
->
rowSize
+=
bytes
;
pShow
->
bytes
[
i
]
=
bytes
;
offset
+=
bytes
;
}
}
else
{
}
else
{
pShow
=
mndAcquireShowObj
(
pMnode
,
retrieveReq
.
showId
);
pShow
=
mndAcquireShowObj
(
pMnode
,
retrieveReq
.
showId
);
if
(
pShow
==
NULL
)
{
if
(
pShow
==
NULL
)
{
...
...
source/dnode/mnode/impl/src/mndSnode.c
浏览文件 @
35fccc49
...
@@ -463,7 +463,7 @@ static int32_t mndRetrieveSnodes(SNodeMsg *pReq, SShowObj *pShow, SSDataBlock *p
...
@@ -463,7 +463,7 @@ static int32_t mndRetrieveSnodes(SNodeMsg *pReq, SShowObj *pShow, SSDataBlock *p
colDataAppend
(
pColInfo
,
numOfRows
,
(
const
char
*
)
&
pObj
->
id
,
false
);
colDataAppend
(
pColInfo
,
numOfRows
,
(
const
char
*
)
&
pObj
->
id
,
false
);
char
ep
[
TSDB_EP_LEN
+
VARSTR_HEADER_SIZE
]
=
{
0
};
char
ep
[
TSDB_EP_LEN
+
VARSTR_HEADER_SIZE
]
=
{
0
};
STR_WITH_MAXSIZE_TO_VARSTR
(
ep
,
pObj
->
pDnode
->
ep
,
pShow
->
bytes
[
cols
]
);
STR_WITH_MAXSIZE_TO_VARSTR
(
ep
,
pObj
->
pDnode
->
ep
,
pShow
->
pMeta
->
pSchemas
[
cols
].
bytes
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataAppend
(
pColInfo
,
numOfRows
,
(
const
char
*
)
ep
,
false
);
colDataAppend
(
pColInfo
,
numOfRows
,
(
const
char
*
)
ep
,
false
);
...
...
source/dnode/mnode/impl/src/mndTrans.c
浏览文件 @
35fccc49
...
@@ -1351,17 +1351,17 @@ static int32_t mndRetrieveTrans(SNodeMsg *pReq, SShowObj *pShow, SSDataBlock *pB
...
@@ -1351,17 +1351,17 @@ static int32_t mndRetrieveTrans(SNodeMsg *pReq, SShowObj *pShow, SSDataBlock *pB
colDataAppend
(
pColInfo
,
numOfRows
,
(
const
char
*
)
&
pTrans
->
createdTime
,
false
);
colDataAppend
(
pColInfo
,
numOfRows
,
(
const
char
*
)
&
pTrans
->
createdTime
,
false
);
char
stage
[
TSDB_TRANS_STAGE_LEN
+
VARSTR_HEADER_SIZE
]
=
{
0
};
char
stage
[
TSDB_TRANS_STAGE_LEN
+
VARSTR_HEADER_SIZE
]
=
{
0
};
STR_WITH_MAXSIZE_TO_VARSTR
(
stage
,
mndTransStr
(
pTrans
->
stage
),
pShow
->
bytes
[
cols
]
);
STR_WITH_MAXSIZE_TO_VARSTR
(
stage
,
mndTransStr
(
pTrans
->
stage
),
pShow
->
pMeta
->
pSchemas
[
cols
].
bytes
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataAppend
(
pColInfo
,
numOfRows
,
(
const
char
*
)
stage
,
false
);
colDataAppend
(
pColInfo
,
numOfRows
,
(
const
char
*
)
stage
,
false
);
char
dbname
[
TSDB_DB_NAME_LEN
+
VARSTR_HEADER_SIZE
]
=
{
0
};
char
dbname
[
TSDB_DB_NAME_LEN
+
VARSTR_HEADER_SIZE
]
=
{
0
};
STR_WITH_MAXSIZE_TO_VARSTR
(
dbname
,
mndGetDbStr
(
pTrans
->
dbname
),
pShow
->
bytes
[
cols
]
);
STR_WITH_MAXSIZE_TO_VARSTR
(
dbname
,
mndGetDbStr
(
pTrans
->
dbname
),
pShow
->
pMeta
->
pSchemas
[
cols
].
bytes
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataAppend
(
pColInfo
,
numOfRows
,
(
const
char
*
)
dbname
,
false
);
colDataAppend
(
pColInfo
,
numOfRows
,
(
const
char
*
)
dbname
,
false
);
char
transType
[
TSDB_TRANS_TYPE_LEN
+
VARSTR_HEADER_SIZE
]
=
{
0
};
char
transType
[
TSDB_TRANS_TYPE_LEN
+
VARSTR_HEADER_SIZE
]
=
{
0
};
STR_WITH_MAXSIZE_TO_VARSTR
(
dbname
,
mndTransType
(
pTrans
->
transType
),
pShow
->
bytes
[
cols
]
);
STR_WITH_MAXSIZE_TO_VARSTR
(
dbname
,
mndTransType
(
pTrans
->
transType
),
pShow
->
pMeta
->
pSchemas
[
cols
].
bytes
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataAppend
(
pColInfo
,
numOfRows
,
(
const
char
*
)
transType
,
false
);
colDataAppend
(
pColInfo
,
numOfRows
,
(
const
char
*
)
transType
,
false
);
...
@@ -1369,7 +1369,7 @@ static int32_t mndRetrieveTrans(SNodeMsg *pReq, SShowObj *pShow, SSDataBlock *pB
...
@@ -1369,7 +1369,7 @@ static int32_t mndRetrieveTrans(SNodeMsg *pReq, SShowObj *pShow, SSDataBlock *pB
colDataAppend
(
pColInfo
,
numOfRows
,
(
const
char
*
)
&
pTrans
->
lastExecTime
,
false
);
colDataAppend
(
pColInfo
,
numOfRows
,
(
const
char
*
)
&
pTrans
->
lastExecTime
,
false
);
char
lastError
[
TSDB_TRANS_ERROR_LEN
+
VARSTR_HEADER_SIZE
]
=
{
0
};
char
lastError
[
TSDB_TRANS_ERROR_LEN
+
VARSTR_HEADER_SIZE
]
=
{
0
};
STR_WITH_MAXSIZE_TO_VARSTR
(
dbname
,
pTrans
->
lastError
,
pShow
->
bytes
[
cols
]
);
STR_WITH_MAXSIZE_TO_VARSTR
(
dbname
,
pTrans
->
lastError
,
pShow
->
pMeta
->
pSchemas
[
cols
].
bytes
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataAppend
(
pColInfo
,
numOfRows
,
(
const
char
*
)
lastError
,
false
);
colDataAppend
(
pColInfo
,
numOfRows
,
(
const
char
*
)
lastError
,
false
);
...
...
source/dnode/mnode/impl/src/mndUser.c
浏览文件 @
35fccc49
...
@@ -657,7 +657,7 @@ static int32_t mndRetrieveUsers(SNodeMsg *pReq, SShowObj *pShow, SSDataBlock *pB
...
@@ -657,7 +657,7 @@ static int32_t mndRetrieveUsers(SNodeMsg *pReq, SShowObj *pShow, SSDataBlock *pB
SColumnInfoData
*
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
);
SColumnInfoData
*
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
);
char
name
[
TSDB_USER_LEN
+
VARSTR_HEADER_SIZE
]
=
{
0
};
char
name
[
TSDB_USER_LEN
+
VARSTR_HEADER_SIZE
]
=
{
0
};
STR_WITH_MAXSIZE_TO_VARSTR
(
name
,
pUser
->
user
,
pShow
->
bytes
[
cols
]
);
STR_WITH_MAXSIZE_TO_VARSTR
(
name
,
pUser
->
user
,
pShow
->
pMeta
->
pSchemas
[
cols
].
bytes
);
colDataAppend
(
pColInfo
,
numOfRows
,
(
const
char
*
)
name
,
false
);
colDataAppend
(
pColInfo
,
numOfRows
,
(
const
char
*
)
name
,
false
);
...
...
source/dnode/mnode/impl/src/mndVgroup.c
浏览文件 @
35fccc49
...
@@ -540,7 +540,7 @@ static int32_t mndRetrieveVgroups(SNodeMsg *pReq, SShowObj *pShow, SSDataBlock*
...
@@ -540,7 +540,7 @@ static int32_t mndRetrieveVgroups(SNodeMsg *pReq, SShowObj *pShow, SSDataBlock*
char
buf1
[
20
]
=
{
0
};
char
buf1
[
20
]
=
{
0
};
const
char
*
role
=
syncStr
(
pVgroup
->
vnodeGid
[
i
].
role
);
const
char
*
role
=
syncStr
(
pVgroup
->
vnodeGid
[
i
].
role
);
STR_WITH_MAXSIZE_TO_VARSTR
(
buf1
,
role
,
pShow
->
bytes
[
cols
]
);
STR_WITH_MAXSIZE_TO_VARSTR
(
buf1
,
role
,
pShow
->
pMeta
->
pSchemas
[
cols
].
bytes
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataAppend
(
pColInfo
,
numOfRows
,
(
const
char
*
)
buf1
,
false
);
colDataAppend
(
pColInfo
,
numOfRows
,
(
const
char
*
)
buf1
,
false
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录